diff --git a/ibm/go.mod b/ibm/go.mod index 11bd06c782..67ea15c50b 100644 --- a/ibm/go.mod +++ b/ibm/go.mod @@ -2,14 +2,12 @@ module github.com/openshift/installer/terraform/providers/ibm go 1.17 -require github.com/IBM-Cloud/terraform-provider-ibm v1.38.1 +require github.com/IBM-Cloud/terraform-provider-ibm v1.40.1 require ( - cloud.google.com/go v0.65.0 // indirect - cloud.google.com/go/storage v1.10.0 // indirect - github.com/IBM-Cloud/bluemix-go v0.0.0-20211223094327-0da2539481f7 // indirect + github.com/IBM-Cloud/bluemix-go v0.0.0-20220407050707-b4cd0d4da813 // indirect github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 // indirect - github.com/IBM-Cloud/power-go-client v1.0.87 // indirect + github.com/IBM-Cloud/power-go-client v1.1.4 // indirect github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca // indirect github.com/IBM/appconfiguration-go-admin-sdk v0.1.0 // indirect github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f // indirect @@ -18,18 +16,19 @@ require ( github.com/IBM/event-notifications-go-admin-sdk v0.0.2 // indirect github.com/IBM/eventstreams-go-sdk v1.2.0 // indirect github.com/IBM/go-sdk-core/v3 v3.2.4 // indirect - github.com/IBM/go-sdk-core/v5 v5.8.2 // indirect + github.com/IBM/go-sdk-core/v5 v5.9.1 // indirect github.com/IBM/ibm-cos-sdk-go v1.8.0 // indirect github.com/IBM/ibm-cos-sdk-go-config v1.2.0 // indirect github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1 // indirect github.com/IBM/keyprotect-go-client v0.7.0 // indirect - github.com/IBM/networking-go-sdk v0.23.1 // indirect + github.com/IBM/networking-go-sdk v0.26.0 // indirect github.com/IBM/platform-services-go-sdk v0.22.6 // indirect github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 // indirect github.com/IBM/scc-go-sdk v1.3.4 // indirect + github.com/IBM/scc-go-sdk/v3 v3.1.6 // indirect github.com/IBM/schematics-go-sdk v0.1.3 // indirect github.com/IBM/secrets-manager-go-sdk v0.1.19 // indirect - github.com/IBM/vpc-go-sdk v0.15.0 // indirect + github.com/IBM/vpc-go-sdk v0.17.0 // indirect github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect @@ -41,8 +40,6 @@ require ( github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect - github.com/aws/aws-sdk-go v1.37.0 // indirect - github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect @@ -52,44 +49,45 @@ require ( github.com/eapache/queue v1.1.0 // indirect github.com/fatih/color v1.9.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-openapi/analysis v0.20.1 // indirect - github.com/go-openapi/errors v0.20.1 // indirect + github.com/go-openapi/analysis v0.21.2 // indirect + github.com/go-openapi/errors v0.20.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/loads v0.21.0 // indirect - github.com/go-openapi/runtime v0.21.0 // indirect + github.com/go-openapi/loads v0.21.1 // indirect + github.com/go-openapi/runtime v0.23.0 // indirect github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/strfmt v0.21.1 // indirect - github.com/go-openapi/swag v0.19.15 // indirect + github.com/go-openapi/strfmt v0.21.2 // indirect + github.com/go-openapi/swag v0.21.1 // indirect github.com/go-openapi/validate v0.20.3 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-stack/stack v1.8.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.3 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/gax-go/v2 v2.0.5 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-getter v1.5.3 // indirect - github.com/hashicorp/go-hclog v0.15.0 // indirect - github.com/hashicorp/go-multierror v1.0.0 // indirect + github.com/hashicorp/go-hclog v0.16.1 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.4.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect - github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/go-version v1.3.0 // indirect + github.com/hashicorp/hc-install v0.3.1 // indirect github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.14.0 // indirect - github.com/hashicorp/terraform-json v0.12.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.3.0 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 // indirect + github.com/hashicorp/terraform-exec v0.15.0 // indirect + github.com/hashicorp/terraform-json v0.13.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.5.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.2.0 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 // indirect + github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/hokaccha/go-prettyjson v0.0.0-20170213120834-e6b9231a2b1c // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect @@ -100,18 +98,17 @@ require ( github.com/jinzhu/copier v0.3.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/jstemmer/go-junit-report v0.9.1 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/leodido/go-urn v1.2.1 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.4 // indirect github.com/mattn/go-isatty v0.0.11 // indirect github.com/minsikl/netscaler-nitro-go v0.0.0-20170827154432-5b14ce3643e3 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.0.4 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/nicksnyder/go-i18n v1.10.0 // indirect github.com/oklog/run v1.0.0 // indirect @@ -122,21 +119,13 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/softlayer/softlayer-go v1.0.3 // indirect github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e // indirect - github.com/ulikunitz/xz v0.5.8 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/zclconf/go-cty v1.8.4 // indirect - go.mongodb.org/mongo-driver v1.7.5 // indirect - go.opencensus.io v0.22.4 // indirect + github.com/zclconf/go-cty v1.9.1 // indirect + go.mongodb.org/mongo-driver v1.8.3 // indirect golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/mod v0.4.2 // indirect - golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect - golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect - golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef // indirect + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/tools v0.1.7 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/api v0.34.0 // indirect google.golang.org/appengine v1.6.6 // indirect google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect google.golang.org/grpc v1.32.0 // indirect diff --git a/ibm/go.sum b/ibm/go.sum index f140256ab5..e891a25265 100644 --- a/ibm/go.sum +++ b/ibm/go.sum @@ -37,17 +37,17 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 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/IBM-Cloud/bluemix-go v0.0.0-20211223094327-0da2539481f7 h1:XH//z3YFvgWzfZVScUkiT0KQHBWgcKozm3CAb8ujXPo= -github.com/IBM-Cloud/bluemix-go v0.0.0-20211223094327-0da2539481f7/go.mod h1:q0fXFSbum/16D8Mgn1ROSfSyX4BmvBCm/hHdcXz0wCU= +github.com/IBM-Cloud/bluemix-go v0.0.0-20220407050707-b4cd0d4da813 h1:UgPApMMM6SglqB+U/EaFHyaoyaEM16RzxyiVah70g4o= +github.com/IBM-Cloud/bluemix-go v0.0.0-20220407050707-b4cd0d4da813/go.mod h1:UOhxo7T8CdX6sdTY9Dn7rJSgyoTlz1KM9641XcPraH0= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 h1:MOkcr6qQGk4tY542ZJ1DggVh2WUP72EEyLB79llFVH8= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs= -github.com/IBM-Cloud/power-go-client v1.0.87 h1:aJiecMGnlB6k6v3V+VEVSYEkiV3J9AeNoZfX/Ncx7wE= -github.com/IBM-Cloud/power-go-client v1.0.87/go.mod h1:60o7AE2oDi/0CtoXlQhnCbC3o1fSRgaFCJO6DscmokA= +github.com/IBM-Cloud/power-go-client v1.1.4 h1:E1sve+j7k3xHD9VKsQCrJ5Eth6Ndt7BC0tkeFhRFjOQ= +github.com/IBM-Cloud/power-go-client v1.1.4/go.mod h1:YcAHrWuTvckGQYPLLReJ9ijcO/tQuRxAp2kCZ7fnnVk= github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw= github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4= -github.com/IBM-Cloud/terraform-provider-ibm v1.38.1 h1:OoEpcj154lEFWK6OpQ7OQXJ+4U8kDdYaEu9OhrkkEks= -github.com/IBM-Cloud/terraform-provider-ibm v1.38.1/go.mod h1:bhixcFV0btTO8nQVYIVbd+RXKs13uAPrYyOElri5Ll8= +github.com/IBM-Cloud/terraform-provider-ibm v1.40.1 h1:teMeubrPay8YZ6/Sn8w06tQ5ogGkbuOfywJ8Fz5jQpA= +github.com/IBM-Cloud/terraform-provider-ibm v1.40.1/go.mod h1:Yn2ld6diRzTa/Y2Vc4RGTdhihJZQmcW5hk0SV401SrY= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca/go.mod h1:IjXrnOcTe92Q4pEBHmui3H/GM1hw5Pd0zXA5cw5/iZU= github.com/IBM/appconfiguration-go-admin-sdk v0.1.0 h1:9rdOk32VQFnMqsBB7cTpkZbD7/b0EnwrU3VNN8vuUYc= @@ -72,10 +72,10 @@ github.com/IBM/go-sdk-core/v5 v5.5.1/go.mod h1:Sn+z+qTDREQvCr+UFa22TqqfXNxx3o723 github.com/IBM/go-sdk-core/v5 v5.6.3/go.mod h1:tt/B9rxLkRtglE7pvqLuYikgCXaZFL3btdruJaoUeek= github.com/IBM/go-sdk-core/v5 v5.6.5/go.mod h1:tt/B9rxLkRtglE7pvqLuYikgCXaZFL3btdruJaoUeek= github.com/IBM/go-sdk-core/v5 v5.7.0/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc0XQUqRO9Jc= -github.com/IBM/go-sdk-core/v5 v5.7.2/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc0XQUqRO9Jc= github.com/IBM/go-sdk-core/v5 v5.8.0/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc0XQUqRO9Jc= -github.com/IBM/go-sdk-core/v5 v5.8.2 h1:hbT9jU5o2Gxv0CmPHK8Z1i6CpBVHcVuEajDoXNLXQqU= github.com/IBM/go-sdk-core/v5 v5.8.2/go.mod h1:axE2JrRq79gIJTjKPBwV6gWHswvVptBjbcvvCPIxARM= +github.com/IBM/go-sdk-core/v5 v5.9.1 h1:06pXbD9Rgmqqe2HA5YAeQbB4eYRRFgIoOT+Kh3cp1zo= +github.com/IBM/go-sdk-core/v5 v5.9.1/go.mod h1:axE2JrRq79gIJTjKPBwV6gWHswvVptBjbcvvCPIxARM= github.com/IBM/ibm-cos-sdk-go v1.3.1/go.mod h1:YLBAYobEA8bD27P7xpMwSQeNQu6W3DNBtBComXrRzRY= github.com/IBM/ibm-cos-sdk-go v1.8.0 h1:6d3BY+jo71JvQoyUwdtv4pemEfbnK/XSKQCKOEuWmks= github.com/IBM/ibm-cos-sdk-go v1.8.0/go.mod h1:Oi8AC5WNDhmUJgbo1GL2FtBdo0nRgbzE/1HmCL1SERU= @@ -85,20 +85,22 @@ github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1 h1:T5UwRKKd+B github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1/go.mod h1:M2JyuyeWHPtgGNeezr6YqVRuaav2MpY8Ha4QrEYvMoI= github.com/IBM/keyprotect-go-client v0.7.0 h1:JstSHD14Lp6ihwQseyPuGcs1AjOBjAmcisP0dTBA6A0= github.com/IBM/keyprotect-go-client v0.7.0/go.mod h1:SVr2ylV/fhSQPDiUjWirN9fsyWFCNNbt8GIT8hPJVjE= -github.com/IBM/networking-go-sdk v0.23.1 h1:BHZyQqQZsVNgI6kPb8wPMgOyXAEcfC7F1GRD8nxYs2E= -github.com/IBM/networking-go-sdk v0.23.1/go.mod h1:vX/4URo6J6e6QCDhsntk6OAA4G27jp+v3+ZMb9WyBQY= +github.com/IBM/networking-go-sdk v0.26.0 h1:K/geWMCgg5P0pbaVQ0eZLhim2G6yOZc8rjszbv2Kmzc= +github.com/IBM/networking-go-sdk v0.26.0/go.mod h1:tVxXclpQs8nQJYPTr9ZPNC1voaPNQLy8iy/72oVfFtM= github.com/IBM/platform-services-go-sdk v0.22.6 h1:6op+tMkQk8Poqz6jY8AMA38TlXX/8j2xSi0Q04U7+r0= github.com/IBM/platform-services-go-sdk v0.22.6/go.mod h1:0moTvGSCdWiSKPmXejOpblpfya/VgDSeG+x9Tjxy+qI= github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4= github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0= github.com/IBM/scc-go-sdk v1.3.4 h1:nvSsyA2GfwjX3Aloty/LStkrY0e2rV2r+CM+YYg3zR4= github.com/IBM/scc-go-sdk v1.3.4/go.mod h1:YhdeD5NcEM266w33vj+lfoxDroIWQNjUzU9FJPq3XC0= +github.com/IBM/scc-go-sdk/v3 v3.1.6 h1:wg7yujuJJ1O1pcGrIn8ITq6i6GeXb7GRBPNq6kLrkMU= +github.com/IBM/scc-go-sdk/v3 v3.1.6/go.mod h1:cBxkth9AIOcKQx4Gy9bWgyGYa7vYwHAalUBvY+O8xAE= github.com/IBM/schematics-go-sdk v0.1.3 h1:8/2+aOlhdj5BX3bddtYiLRts5kBo8zT9hcOWq+WeEpk= github.com/IBM/schematics-go-sdk v0.1.3/go.mod h1:tKRsoiYvm6l/7ZV/L1aY84PnQZExrXIJBowwSE7oBg4= github.com/IBM/secrets-manager-go-sdk v0.1.19 h1:0GPs5EoTaWNsjo4QPj64GNxlWfN8VHJy4RDFLqddSe8= github.com/IBM/secrets-manager-go-sdk v0.1.19/go.mod h1:eO3dBhzPrHkkt+yPex/jB2xD6qHZxBko+Aw+0tfqHeA= -github.com/IBM/vpc-go-sdk v0.15.0 h1:doL1W0V1ZvHB06pCj4xRbOklcOsnC2v8GQLTIBSTamM= -github.com/IBM/vpc-go-sdk v0.15.0/go.mod h1:mIUjxBs5viRWIiCqfO/W4HPJ7aC6M+26mR4p5gaVls8= +github.com/IBM/vpc-go-sdk v0.17.0 h1:H9qsEx1UJoAR79s1R7n3bGPdOPW6+wLNEUyCjnesaxs= +github.com/IBM/vpc-go-sdk v0.17.0/go.mod h1:+fTuJIR/SWXru/B5XEANwV4GCLV5fRppFEzlYGwGm7k= github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 h1:vuquMR410psHNax14XKNWa0Ae/kYgWJcXi0IFuX60N0= github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56/go.mod h1:Zb3OT4l0mf7P/GOs2w2Ilj5sdm5Whoq3pa24dAEBHFc= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -128,6 +130,7 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= @@ -177,6 +180,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU= github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0= +github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185/go.mod h1:cFRxtTwTOJkz2x3rQUNCYKWC93yP1VKjR8NUhqFxZNU= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= @@ -212,10 +216,13 @@ github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.0.0/go.mod h1:oYD8y9kWsGINPFJoLdaScGCN6dlKg23blmClfZwtUVA= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -230,8 +237,9 @@ github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2 github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= github.com/go-openapi/analysis v0.20.0/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= -github.com/go-openapi/analysis v0.20.1 h1:zdVbw8yoD4SWZeq+cWdGgquaB0W4VrsJvDJHJND/Ktc= github.com/go-openapi/analysis v0.20.1/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= +github.com/go-openapi/analysis v0.21.2 h1:hXFrOYFHUAMQdu6zwAiKKJHJQ8kqZs1ux/ru1P1wLJU= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= @@ -241,8 +249,9 @@ github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpX github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.0/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.1 h1:j23mMDtRxMwIobkpId7sWh7Ddcx4ivaoqUbfXx5P+a8= github.com/go-openapi/errors v0.20.1/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= @@ -266,16 +275,17 @@ github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hs github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= github.com/go-openapi/loads v0.20.2/go.mod h1:hTVUotJ+UonAMMZsvakEgmWKgtulweO9vYP2bQYKA/o= -github.com/go-openapi/loads v0.21.0 h1:jYtUO4wwP7psAweisP/MDoOpdzsYEESdoPcsWjHDR68= github.com/go-openapi/loads v0.21.0/go.mod h1:rHYve9nZrQ4CJhyeIIFJINGCg1tQpx2yJrrNo8sf1ws= +github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/runtime v0.21.0 h1:giZ8eT26R+/rx6RX2MkYjZPY8vPYVKDhP/mOazrQHzM= -github.com/go-openapi/runtime v0.21.0/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= +github.com/go-openapi/runtime v0.23.0 h1:HX6ET2sHCIvaKeDDQoU01CtO1ekg5EkekHSkLTtWXH0= +github.com/go-openapi/runtime v0.23.0/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= @@ -301,8 +311,9 @@ github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF github.com/go-openapi/strfmt v0.20.1/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.20.2/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1 h1:G6s2t5V5kGCHLVbSdZ/6lI8Wm4OzoPFkc3/cjAsKQrM= github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -312,8 +323,9 @@ github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfT github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= @@ -324,14 +336,17 @@ github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE github.com/go-openapi/validate v0.20.3 h1:GZPPhhKSZrE8HjB4eEkoYAZmoWA4+tCemSgINH1/vKw= github.com/go-openapi/validate v0.20.3/go.mod h1:goDdqVGiigM3jChcrYJxD2joalke3ZXeftD16byIjA4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= @@ -412,9 +427,7 @@ github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -423,7 +436,9 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -452,10 +467,11 @@ github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXj github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= +github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o= +github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= @@ -466,27 +482,36 @@ github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk= +github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEXPiqaHL9r+w= -github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= -github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= -github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= -github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA= -github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 h1:SuI59MqNjYDrL7EfqHX9V6P/24isgqYx/FdglwVs9bg= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0/go.mod h1:grseeRo9g3yNkYW09iFlV8LG78jTa1ssBgouogQg/RU= +github.com/hashicorp/terraform-exec v0.15.0 h1:cqjh4d8HYNQrDoEmlSGelHmg2DYDh5yayckvJ5bV18E= +github.com/hashicorp/terraform-exec v0.15.0/go.mod h1:H4IG8ZxanU+NW0ZpDRNsvh9f0ul7C0nHP+rUR/CHs7I= +github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniyEi5CM+FWGY= +github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= +github.com/hashicorp/terraform-plugin-go v0.5.0 h1:+gCDdF0hcYCm0YBTxrP4+K1NGIS5ZKZBKDORBewLJmg= +github.com/hashicorp/terraform-plugin-go v0.5.0/go.mod h1:PAVN26PNGpkkmsvva1qfriae5Arky3xl3NfzKa8XFVM= +github.com/hashicorp/terraform-plugin-log v0.2.0 h1:rjflRuBqCnSk3UHOR25MP1G5BDLKktTA6lNjjcAnBfI= +github.com/hashicorp/terraform-plugin-log v0.2.0/go.mod h1:E1kJmapEHzqu1x6M++gjvhzM2yMQNXPVWZRCB8sgYjg= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 h1:B9AocC+dxrCqcf4vVhztIkSkt3gpRjUkEka8AmZWGlQ= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1/go.mod h1:FjM9DXWfP0w/AeOtJoSKHBZ01LqmaO6uP4bXhv3fekw= +github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw= +github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -495,6 +520,7 @@ github.com/hokaccha/go-prettyjson v0.0.0-20170213120834-e6b9231a2b1c/go.mod h1:p github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -515,6 +541,7 @@ github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJz github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= @@ -526,6 +553,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/johnstarich/go/gopages v0.1.8/go.mod h1:OaSRjfHdFfN+LS7u6xqgNO7C2Uxjlvpm17DcKcvLBhY= +github.com/johnstarich/go/pipe v0.2.0/go.mod h1:3X9IdVJJnI7pkpzEH6np98wqHl55zFmbilKG+9+koMo= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -533,8 +562,10 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kardianos/govendor v1.0.9/go.mod h1:yvmR6q9ZZ7nSF5Wvh40v0wfP+3TwwL8zYQp+itoZSVM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -565,8 +596,9 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -592,17 +624,20 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.4 h1:ZU1VNC02qyufSZsjjs7+khruk2fKvbQ3TwRV/IBCeFA= -github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -628,6 +663,7 @@ github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -636,8 +672,10 @@ github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuK github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -645,7 +683,6 @@ github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUr github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -697,6 +734,7 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -712,10 +750,10 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= -github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc= +github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -728,8 +766,9 @@ go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4S go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= -go.mongodb.org/mongo-driver v1.7.5 h1:ny3p0reEpgsR2cfA5cjgwFZg3Cv/ofFh/8jbhGtz9VI= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.8.3 h1:TDKlTkGDKm9kkJVUOAXDK5/fkqKHJVwYQSpoRfB43R4= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -754,6 +793,7 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -811,6 +851,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -838,8 +879,11 @@ golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5o golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -862,6 +906,7 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -912,10 +957,13 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef h1:fPxZ3Umkct3LZ8gK9nbk+DWDJ9fstZa2grBn+lWVKPs= -golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -980,6 +1028,7 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201021000207-d49c4edd7d96/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= diff --git a/ibm/vendor/cloud.google.com/go/.gitignore b/ibm/vendor/cloud.google.com/go/.gitignore deleted file mode 100644 index ee9694b878..0000000000 --- a/ibm/vendor/cloud.google.com/go/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Editors -.idea -.vscode -*.swp - -# Test files -*.test -coverage.txt - -# Other -.DS_Store diff --git a/ibm/vendor/cloud.google.com/go/CHANGES.md b/ibm/vendor/cloud.google.com/go/CHANGES.md deleted file mode 100644 index eff3b8a61a..0000000000 --- a/ibm/vendor/cloud.google.com/go/CHANGES.md +++ /dev/null @@ -1,1642 +0,0 @@ -# Changes - -## [0.65.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.64.0...v0.65.0) (2020-08-27) - - -### Announcements - -The following changes will be included in an upcoming release and are not -included in this one. - -#### Default Deadlines - -By default, non-streaming methods, like Create or Get methods, will have a -default deadline applied to the context provided at call time, unless a context -deadline is already set. Streaming methods have no default deadline and will run -indefinitely, unless the context provided at call time contains a deadline. - -To opt-out of this behavior, set the environment variable -`GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE` to `true` prior to -initializing a client. This opt-out mechanism will be removed in a later -release, with a notice similar to this one ahead of its removal. - - -### Features - -* **all:** auto-regenerate gapics , refs [#2774](https://www.github.com/googleapis/google-cloud-go/issues/2774) [#2764](https://www.github.com/googleapis/google-cloud-go/issues/2764) - - -### Bug Fixes - -* **all:** correct minor typos ([#2756](https://www.github.com/googleapis/google-cloud-go/issues/2756)) ([03d78b5](https://www.github.com/googleapis/google-cloud-go/commit/03d78b5627819cb64d1f3866f90043f709e825e1)) -* **compute/metadata:** remove leading slash for Get suffix ([#2760](https://www.github.com/googleapis/google-cloud-go/issues/2760)) ([f0d605c](https://www.github.com/googleapis/google-cloud-go/commit/f0d605ccf32391a9da056a2c551158bd076c128d)) - -## [0.64.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.63.0...v0.64.0) (2020-08-18) - - -### Features - -* **all:** auto-regenerate gapics , refs [#2734](https://www.github.com/googleapis/google-cloud-go/issues/2734) [#2731](https://www.github.com/googleapis/google-cloud-go/issues/2731) [#2730](https://www.github.com/googleapis/google-cloud-go/issues/2730) [#2725](https://www.github.com/googleapis/google-cloud-go/issues/2725) [#2722](https://www.github.com/googleapis/google-cloud-go/issues/2722) [#2706](https://www.github.com/googleapis/google-cloud-go/issues/2706) -* **pubsublite:** start generating v1 ([#2700](https://www.github.com/googleapis/google-cloud-go/issues/2700)) ([d2e777f](https://www.github.com/googleapis/google-cloud-go/commit/d2e777f56e08146646b3ffb7a78856795094ab4e)) - -## [0.63.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.62.0...v0.63.0) (2020-08-05) - - -### Features - -* **all:** auto-regenerate gapics ([#2682](https://www.github.com/googleapis/google-cloud-go/issues/2682)) ([63bfd63](https://www.github.com/googleapis/google-cloud-go/commit/63bfd638da169e0f1f4fa4a5125da2955022dc04)) -* **analytics/admin:** start generating apiv1alpha ([#2670](https://www.github.com/googleapis/google-cloud-go/issues/2670)) ([268199e](https://www.github.com/googleapis/google-cloud-go/commit/268199e5350a64a83ecf198e0e0fa4863f00fa6c)) -* **functions/metadata:** Special-case marshaling ([#2669](https://www.github.com/googleapis/google-cloud-go/issues/2669)) ([d8d7fc6](https://www.github.com/googleapis/google-cloud-go/commit/d8d7fc66cbc42f79bec25fb0daaf53d926e3645b)) -* **gaming:** start generate apiv1 ([#2681](https://www.github.com/googleapis/google-cloud-go/issues/2681)) ([1adfd0a](https://www.github.com/googleapis/google-cloud-go/commit/1adfd0aed6b2c0e1dd0c575a5ec0f49388fa5601)) -* **internal/kokoro:** add script to test compatibility with samples ([#2637](https://www.github.com/googleapis/google-cloud-go/issues/2637)) ([f2aa76a](https://www.github.com/googleapis/google-cloud-go/commit/f2aa76a0058e86c1c33bb634d2c084b58f77ab32)) - -## v0.62.0 - -### Announcements - -- There was a breaking change to `cloud.google.com/go/dataproc/apiv1` that was - merged in [this PR](https://github.com/googleapis/google-cloud-go/pull/2606). - This fixed a broken API response for `DiagnoseCluster`. When polling on the - Long Running Operation(LRO), the API now returns - `(*dataprocpb.DiagnoseClusterResults, error)` whereas it only returned an - `error` before. - -### Changes - -- all: - - Updated all direct dependencies. - - Updated contributing guidelines to suggest allowing edits from maintainers. -- billing/budgets: - - Start generating client for apiv1beta1. -- functions: - - Start generating client for apiv1. -- notebooks: - - Start generating client apiv1beta1. -- profiler: - - update proftest to support parsing floating-point backoff durations. - - Fix the regexp used to parse backoff duration. -- Various updates to autogenerated clients. - -## v0.61.0 - -### Changes - -- all: - - Update all direct dependencies. -- dashboard: - - Start generating client for apiv1. -- policytroubleshooter: - - Start generating client for apiv1. -- profiler: - - Disable OpenCensus Telemetry for requests made by the profiler package by default. You can re-enable it using `profiler.Config.EnableOCTelemetry`. -- Various updates to autogenerated clients. - -## v0.60.0 - -### Changes - -- all: - - Refactored examples to reduce module dependencies. - - Update sub-modules to use cloud.google.com/go v0.59.0. -- internal: - - Start generating client for gaming apiv1beta. -- Various updates to autogenerated clients. - -## v0.59.0 - -### Announcements - -goolgeapis/google-cloud-go has moved its source of truth to GitHub and is no longer a mirror. This means that our -contributing process has changed a bit. We will now be conducting all code reviews on GitHub which means we now accept -pull requests! If you have a version of the codebase previously checked out you may wish to update your git remote to -point to GitHub. - -### Changes - -- all: - - Remove dependency on honnef.co/go/tools. - - Update our contributing instructions now that we use GitHub for reviews. - - Remove some un-inclusive terminology. -- compute/metadata: - - Pass cancelable context to DNS lookup. -- .github: - - Update templates issue/PR templates. -- internal: - - Bump several clients to GA. - - Fix GoDoc badge source. - - Several automation changes related to the move to GitHub. - - Start generating a client for asset v1p5beta1. -- Various updates to autogenerated clients. - -## v0.58.0 - -### Deprecation notice - -- `cloud.google.com/go/monitoring/apiv3` has been deprecated due to breaking - changes in the API. Please migrate to `cloud.google.com/go/monitoring/apiv3/v2`. - -### Changes - -- all: - - The remaining uses of gtransport.Dial have been removed. - - The `genproto` dependency has been updated to a version that makes use of - new `protoreflect` library. For more information on these protobuf changes - please see the following post from the official Go blog: - https://blog.golang.org/protobuf-apiv2. -- internal: - - Started generation of datastore admin v1 client. - - Updated protofuf version used for generation to 3.12.X. - - Update the release levels for several APIs. - - Generate clients with protoc-gen-go@v1.4.1. -- monitoring: - - Re-enable generation of monitoring/apiv3 under v2 directory (see deprecation - notice above). -- profiler: - - Fixed flakiness in tests. -- Various updates to autogenerated clients. - -## v0.57.0 - -- all: - - Update module dependency `google.golang.org/api` to `v0.21.0`. -- errorreporting: - - Add exported SetGoogleClientInfo wrappers to manual file. -- expr/v1alpha1: - - Deprecate client. This client will be removed in a future release. -- internal: - - Fix possible data race in TestTracer. - - Pin versions of tools used for generation. - - Correct the release levels for BigQuery APIs. - - Start generation osconfig v1. -- longrunning: - - Add exported SetGoogleClientInfo wrappers to manual file. -- monitoring: - - Stop generation of monitoring/apiv3 because of incoming breaking change. -- trace: - - Add exported SetGoogleClientInfo wrappers to manual file. -- Various updates to autogenerated clients. - -## v0.56.0 - -- secretmanager: - - add IAM helper -- profiler: - - try all us-west1 zones for integration tests -- internal: - - add config to generate webrisk v1 - - add repo and commit to buildcop invocation - - add recaptchaenterprise v1 generation config - - update microgenerator to v0.12.5 - - add datacatalog client - - start generating security center settings v1beta - - start generating osconfig agentendpoint v1 - - setup generation for bigquery/connection/v1beta1 -- all: - - increase continous testing timeout to 45m - - various updates to autogenerated clients. - -## v0.55.0 - -- Various updates to autogenerated clients. - -## v0.54.0 - -- all: - - remove unused golang.org/x/exp from mod file - - update godoc.org links to pkg.go.dev -- compute/metadata: - - use defaultClient when http.Client is nil - - remove subscribeClient -- iam: - - add support for v3 policy and IAM conditions -- Various updates to autogenerated clients. - -## v0.53.0 - -- all: most clients now use transport/grpc.DialPool rather than Dial (see #1777 for outliers). - - Connection pooling now does not use the deprecated (and soon to be removed) gRPC load balancer API. -- profiler: remove symbolization (drops support for go1.10) -- Various updates to autogenerated clients. - -## v0.52.0 - -- internal/gapicgen: multiple improvements related to library generation. -- compute/metadata: unset ResponseHeaderTimeout in defaultClient -- docs: fix link to KMS in README.md -- Various updates to autogenerated clients. - -## v0.51.0 - -- secretmanager: - - add IAM helper for generic resource IAM handle -- cloudbuild: - - migrate to microgen in a major version -- Various updates to autogenerated clients. - -## v0.50.0 - -- profiler: - - Support disabling CPU profile collection. - - Log when a profile creation attempt begins. -- compute/metadata: - - Fix panic on malformed URLs. - - InstanceName returns actual instance name. -- Various updates to autogenerated clients. - -## v0.49.0 - -- functions/metadata: - - Handle string resources in JSON unmarshaller. -- Various updates to autogenerated clients. - -## v0.48.0 - -- Various updates to autogenerated clients - -## v0.47.0 - -This release drops support for Go 1.9 and Go 1.10: we continue to officially -support Go 1.11, Go 1.12, and Go 1.13. - -- Various updates to autogenerated clients. -- Add cloudbuild/apiv1 client. - -## v0.46.3 - -This is an empty release that was created solely to aid in storage's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.46.2 - -This is an empty release that was created solely to aid in spanner's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.46.1 - -This is an empty release that was created solely to aid in firestore's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.46.0 - -- spanner: - - Retry "Session not found" for read-only transactions. - - Retry aborted PDMLs. -- spanner/spannertest: - - Fix a bug that was causing 0X-prefixed number to be parsed incorrectly. -- storage: - - Add HMACKeyOptions. - - Remove *REGIONAL from StorageClass documentation. Using MULTI_REGIONAL, - DURABLE_REDUCED_AVAILABILITY, and REGIONAL are no longer best practice - StorageClasses but they are still acceptable values. -- trace: - - Remove cloud.google.com/go/trace. Package cloud.google.com/go/trace has been - marked OBSOLETE for several years: it is now no longer provided. If you - relied on this package, please vendor it or switch to using - https://cloud.google.com/trace/docs/setup/go (which obsoleted it). - -## v0.45.1 - -This is an empty release that was created solely to aid in pubsub's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.45.0 - -- compute/metadata: - - Add Email method. -- storage: - - Fix duplicated retry logic. - - Add ReaderObjectAttrs.StartOffset. - - Support reading last N bytes of a file when a negative range is given, such - as `obj.NewRangeReader(ctx, -10, -1)`. - - Add HMACKey listing functionality. -- spanner/spannertest: - - Support primary keys with no columns. - - Fix MinInt64 parsing. - - Implement deletion of key ranges. - - Handle reads during a read-write transaction. - - Handle returning DATE values. -- pubsub: - - Fix Ack/Modack request size calculation. -- logging: - - Add auto-detection of monitored resources on GAE Standard. - -## v0.44.3 - -This is an empty release that was created solely to aid in bigtable's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.44.2 - -This is an empty release that was created solely to aid in bigquery's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.44.1 - -This is an empty release that was created solely to aid in datastore's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.44.0 - -- datastore: - - Interface elements whose underlying types are supported, are now supported. - - Reduce time to initial retry from 1s to 100ms. -- firestore: - - Add Increment transformation. -- storage: - - Allow emulator with STORAGE_EMULATOR_HOST. - - Add methods for HMAC key management. -- pubsub: - - Add PublishCount and PublishLatency measurements. - - Add DefaultPublishViews and DefaultSubscribeViews for convenience of - importing all views. - - Add add Subscription.PushConfig.AuthenticationMethod. -- spanner: - - Allow emulator usage with SPANNER_EMULATOR_HOST. - - Add cloud.google.com/go/spanner/spannertest, a spanner emulator. - - Add cloud.google.com/go/spanner/spansql which contains types and a parser - for the Cloud Spanner SQL dialect. -- asset: - - Add apiv1p2beta1 client. - -## v0.43.0 - -This is an empty release that was created solely to aid in logging's module -carve-out. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. - -## v0.42.0 - -- bigtable: - - Add an admin method to update an instance and clusters. - - Fix bttest regex matching behavior for alternations (things like `|a`). - - Expose BlockAllFilter filter. -- bigquery: - - Add Routines API support. -- storage: - - Add read-only Bucket.LocationType. -- logging: - - Add TraceSampled to Entry. - - Fix to properly extract {Trace, Span}Id from X-Cloud-Trace-Context. -- pubsub: - - Add Cloud Key Management to TopicConfig. - - Change ExpirationPolicy to optional.Duration. -- automl: - - Add apiv1beta1 client. -- iam: - - Fix compilation problem with iam/credentials/apiv1. - -## v0.41.0 - -- bigtable: - - Check results from PredicateFilter in bttest, which fixes certain false matches. -- profiler: - - debugLog checks user defined logging options before logging. -- spanner: - - PartitionedUpdates respect query parameters. - - StartInstance allows specifying cloud API access scopes. -- bigquery: - - Use empty slice instead of nil for ValueSaver, fixing an issue with zero-length, repeated, nested fields causing panics. -- firestore: - - Return same number of snapshots as doc refs (in the form of duplicate records) during GetAll. -- replay: - - Change references to IPv4 addresses to localhost, making replay compatible with IPv6. - -## v0.40.0 - -- all: - - Update to protobuf-golang v1.3.1. -- datastore: - - Attempt to decode GAE-encoded keys if initial decoding attempt fails. - - Support integer time conversion. -- pubsub: - - Add PublishSettings.BundlerByteLimit. If users receive pubsub.ErrOverflow, - this value should be adjusted higher. - - Use IPv6 compatible target in testutil. -- bigtable: - - Fix Latin-1 regexp filters in bttest, allowing \C. - - Expose PassAllFilter. -- profiler: - - Add log messages for slow path in start. - - Fix start to allow retry until success. -- firestore: - - Add admin client. -- containeranalysis: - - Add apiv1 client. -- grafeas: - - Add apiv1 client. - -## 0.39.0 - -- bigtable: - - Implement DeleteInstance in bttest. - - Return an error on invalid ReadRowsRequest.RowRange key ranges in bttest. -- bigquery: - - Move RequirePartitionFilter outside of TimePartioning. - - Expose models API. -- firestore: - - Allow array values in create and update calls. - - Add CollectionGroup method. -- pubsub: - - Add ExpirationPolicy to Subscription. -- storage: - - Add V4 signing. -- rpcreplay: - - Match streams by first sent request. This further improves rpcreplay's - ability to distinguish streams. -- httpreplay: - - Set up Man-In-The-Middle config only once. This should improve proxy - creation when multiple proxies are used in a single process. - - Remove error on empty Content-Type, allowing requests with no Content-Type - header but a non-empty body. -- all: - - Fix an edge case bug in auto-generated library pagination by properly - propagating pagetoken. - -## 0.38.0 - -This update includes a substantial reduction in our transitive dependency list -by way of updating to opencensus@v0.21.0. - -- spanner: - - Error implements GRPCStatus, allowing status.Convert. -- bigtable: - - Fix a bug in bttest that prevents single column queries returning results - that match other filters. - - Remove verbose retry logging. -- logging: - - Ensure RequestUrl has proper UTF-8, removing the need for users to wrap and - rune replace manually. -- recaptchaenterprise: - - Add v1beta1 client. -- phishingprotection: - - Add v1beta1 client. - -## 0.37.4 - -This patch releases re-builds the go.sum. This was not possible in the -previous release. - -- firestore: - - Add sentinel value DetectProjectID for auto-detecting project ID. - - Add OpenCensus tracing for public methods. - - Marked stable. All future changes come with a backwards compatibility - guarantee. - - Removed firestore/apiv1beta1. All users relying on this low-level library - should migrate to firestore/apiv1. Note that most users should use the - high-level firestore package instead. -- pubsub: - - Allow large messages in synchronous pull case. - - Cap bundler byte limit. This should prevent OOM conditions when there are - a very large number of message publishes occurring. -- storage: - - Add ETag to BucketAttrs and ObjectAttrs. -- datastore: - - Removed some non-sensical OpenCensus traces. -- webrisk: - - Add v1 client. -- asset: - - Add v1 client. -- cloudtasks: - - Add v2 client. - -## 0.37.3 - -This patch release removes github.com/golang/lint from the transitive -dependency list, resolving `go get -u` problems. - -Note: this release intentionally has a broken go.sum. Please use v0.37.4. - -## 0.37.2 - -This patch release is mostly intended to bring in v0.3.0 of -google.golang.org/api, which fixes a GCF deployment issue. - -Note: we had to-date accidentally marked Redis as stable. In this release, we've -fixed it by downgrading its documentation to alpha, as it is in other languages -and docs. - -- all: - - Document context in generated libraries. - -## 0.37.1 - -Small go.mod version bumps to bring in v0.2.0 of google.golang.org/api, which -introduces a new oauth2 url. - -## 0.37.0 - -- spanner: - - Add BatchDML method. - - Reduced initial time between retries. -- bigquery: - - Produce better error messages for InferSchema. - - Add logical type control for avro loads. - - Add support for the GEOGRAPHY type. -- datastore: - - Add sentinel value DetectProjectID for auto-detecting project ID. - - Allow flatten tag on struct pointers. - - Fixed a bug that caused queries to panic with invalid queries. Instead they - will now return an error. -- profiler: - - Add ability to override GCE zone and instance. -- pubsub: - - BEHAVIOR CHANGE: Refactor error code retry logic. RPCs should now more - consistently retry specific error codes based on whether they're idempotent - or non-idempotent. -- httpreplay: Fixed a bug when a non-GET request had a zero-length body causing - the Content-Length header to be dropped. -- iot: - - Add new apiv1 client. -- securitycenter: - - Add new apiv1 client. -- cloudscheduler: - - Add new apiv1 client. - -## 0.36.0 - -- spanner: - - Reduce minimum retry backoff from 1s to 100ms. This makes time between - retries much faster and should improve latency. -- storage: - - Add support for Bucket Policy Only. -- kms: - - Add ResourceIAM helper method. - - Deprecate KeyRingIAM and CryptoKeyIAM. Please use ResourceIAM. -- firestore: - - Switch from v1beta1 API to v1 API. - - Allow emulator with FIRESTORE_EMULATOR_HOST. -- bigquery: - - Add NumLongTermBytes to Table. - - Add TotalBytesProcessedAccuracy to QueryStatistics. -- irm: - - Add new v1alpha2 client. -- talent: - - Add new v4beta1 client. -- rpcreplay: - - Fix connection to work with grpc >= 1.17. - - It is now required for an actual gRPC server to be running for Dial to - succeed. - -## 0.35.1 - -- spanner: - - Adds OpenCensus views back to public API. - -## v0.35.0 - -- all: - - Add go.mod and go.sum. - - Switch usage of gax-go to gax-go/v2. -- bigquery: - - Fix bug where time partitioning could not be removed from a table. - - Fix panic that occurred with empty query parameters. -- bttest: - - Fix bug where deleted rows were returned by ReadRows. -- bigtable/emulator: - - Configure max message size to 256 MiB. -- firestore: - - Allow non-transactional queries in transactions. - - Allow StartAt/EndBefore on direct children at any depth. - - QuerySnapshotIterator.Stop may be called in an error state. - - Fix bug the prevented reset of transaction write state in between retries. -- functions/metadata: - - Make Metadata.Resource a pointer. -- logging: - - Make SpanID available in logging.Entry. -- metadata: - - Wrap !200 error code in a typed err. -- profiler: - - Add function to check if function name is within a particular file in the - profile. - - Set parent field in create profile request. - - Return kubernetes client to start cluster, so client can be used to poll - cluster. - - Add function for checking if filename is in profile. -- pubsub: - - Fix bug where messages expired without an initial modack in - synchronous=true mode. - - Receive does not retry ResourceExhausted errors. -- spanner: - - client.Close now cancels existing requests and should be much faster for - large amounts of sessions. - - Correctly allow MinOpened sessions to be spun up. - -## v0.34.0 - -- functions/metadata: - - Switch to using JSON in context. - - Make Resource a value. -- vision: Fix ProductSearch return type. -- datastore: Add an example for how to handle MultiError. - -## v0.33.1 - -- compute: Removes an erroneously added go.mod. -- logging: Populate source location in fromLogEntry. - -## v0.33.0 - -- bttest: - - Add support for apply_label_transformer. -- expr: - - Add expr library. -- firestore: - - Support retrieval of missing documents. -- kms: - - Add IAM methods. -- pubsub: - - Clarify extension documentation. -- scheduler: - - Add v1beta1 client. -- vision: - - Add product search helper. - - Add new product search client. - -## v0.32.0 - -Note: This release is the last to support Go 1.6 and 1.8. - -- bigquery: - - Add support for removing an expiration. - - Ignore NeverExpire in Table.Create. - - Validate table expiration time. -- cbt: - - Add note about not supporting arbitrary bytes. -- datastore: - - Align key checks. -- firestore: - - Return an error when using Start/End without providing values. -- pubsub: - - Add pstest Close method. - - Clarify MaxExtension documentation. -- securitycenter: - - Add v1beta1 client. -- spanner: - - Allow nil in mutations. - - Improve doc of SessionPoolConfig.MaxOpened. - - Increase session deletion timeout from 5s to 15s. - -## v0.31.0 - -- bigtable: - - Group mutations across multiple requests. -- bigquery: - - Link to bigquery troubleshooting errors page in bigquery.Error comment. -- cbt: - - Fix go generate command. - - Document usage of both maxage + maxversions. -- datastore: - - Passing nil keys results in ErrInvalidKey. -- firestore: - - Clarify what Document.DataTo does with untouched struct fields. -- profile: - - Validate service name in agent. -- pubsub: - - Fix deadlock with pstest and ctx.Cancel. - - Fix a possible deadlock in pstest. -- trace: - - Update doc URL with new fragment. - -Special thanks to @fastest963 for going above and beyond helping us to debug -hard-to-reproduce Pub/Sub issues. - -## v0.30.0 - -- spanner: DML support added. See https://godoc.org/cloud.google.com/go/spanner#hdr-DML_and_Partitioned_DML for more information. -- bigtable: bttest supports row sample filter. -- functions: metadata package added for accessing Cloud Functions resource metadata. - -## v0.29.0 - -- bigtable: - - Add retry to all idempotent RPCs. - - cbt supports complex GC policies. - - Emulator supports arbitrary bytes in regex filters. -- firestore: Add ArrayUnion and ArrayRemove. -- logging: Add the ContextFunc option to supply the context used for - asynchronous RPCs. -- profiler: Ignore NotDefinedError when fetching the instance name -- pubsub: - - BEHAVIOR CHANGE: Receive doesn't retry if an RPC returns codes.Cancelled. - - BEHAVIOR CHANGE: Receive retries on Unavailable intead of returning. - - Fix deadlock. - - Restore Ack/Nack/Modacks metrics. - - Improve context handling in iterator. - - Implement synchronous mode for Receive. - - pstest: add Pull. -- spanner: Add a metric for the number of sessions currently opened. -- storage: - - Canceling the context releases all resources. - - Add additional RetentionPolicy attributes. -- vision/apiv1: Add LocalizeObjects method. - -## v0.28.0 - -- bigtable: - - Emulator returns Unimplemented for snapshot RPCs. -- bigquery: - - Support zero-length repeated, nested fields. -- cloud assets: - - Add v1beta client. -- datastore: - - Don't nil out transaction ID on retry. -- firestore: - - BREAKING CHANGE: When watching a query with Query.Snapshots, QuerySnapshotIterator.Next - returns a QuerySnapshot which contains read time, result size, change list and the DocumentIterator - (previously, QuerySnapshotIterator.Next returned just the DocumentIterator). See: https://godoc.org/cloud.google.com/go/firestore#Query.Snapshots. - - Add array-contains operator. -- IAM: - - Add iam/credentials/apiv1 client. -- pubsub: - - Canceling the context passed to Subscription.Receive causes Receive to return when - processing finishes on all messages currently in progress, even if new messages are arriving. -- redis: - - Add redis/apiv1 client. -- storage: - - Add Reader.Attrs. - - Deprecate several Reader getter methods: please use Reader.Attrs for these instead. - - Add ObjectHandle.Bucket and ObjectHandle.Object methods. - -## v0.27.0 - -- bigquery: - - Allow modification of encryption configuration and partitioning options to a table via the Update call. - - Add a SchemaFromJSON function that converts a JSON table schema. -- bigtable: - - Restore cbt count functionality. -- containeranalysis: - - Add v1beta client. -- spanner: - - Fix a case where an iterator might not be closed correctly. -- storage: - - Add ServiceAccount method https://godoc.org/cloud.google.com/go/storage#Client.ServiceAccount. - - Add a method to Reader that returns the parsed value of the Last-Modified header. - -## v0.26.0 - -- bigquery: - - Support filtering listed jobs by min/max creation time. - - Support data clustering (https://godoc.org/cloud.google.com/go/bigquery#Clustering). - - Include job creator email in Job struct. -- bigtable: - - Add `RowSampleFilter`. - - emulator: BREAKING BEHAVIOR CHANGE: Regexps in row, family, column and value filters - must match the entire target string to succeed. Previously, the emulator was - succeeding on partial matches. - NOTE: As of this release, this change only affects the emulator when run - from this repo (bigtable/cmd/emulator/cbtemulator.go). The version launched - from `gcloud` will be updated in a subsequent `gcloud` release. -- dataproc: Add apiv1beta2 client. -- datastore: Save non-nil pointer fields on omitempty. -- logging: populate Entry.Trace from the HTTP X-Cloud-Trace-Context header. -- logging/logadmin: Support writer_identity and include_children. -- pubsub: - - Support labels on topics and subscriptions. - - Support message storage policy for topics. - - Use the distribution of ack times to determine when to extend ack deadlines. - The only user-visible effect of this change should be that programs that - call only `Subscription.Receive` need no IAM permissions other than `Pub/Sub - Subscriber`. -- storage: - - Support predefined ACLs. - - Support additional ACL fields other than Entity and Role. - - Support bucket websites. - - Support bucket logging. - - -## v0.25.0 - -- Added [Code of Conduct](https://github.com/googleapis/google-cloud-go/blob/master/CODE_OF_CONDUCT.md) -- bigtable: - - cbt: Support a GC policy of "never". -- errorreporting: - - Support User. - - Close now calls Flush. - - Use OnError (previously ignored). - - Pass through the RPC error as-is to OnError. -- httpreplay: A tool for recording and replaying HTTP requests - (for the bigquery and storage clients in this repo). -- kms: v1 client added -- logging: add SourceLocation to Entry. -- storage: improve CRC checking on read. - -## v0.24.0 - -- bigquery: Support for the NUMERIC type. -- bigtable: - - cbt: Optionally specify columns for read/lookup - - Support instance-level administration. -- oslogin: New client for the OS Login API. -- pubsub: - - The package is now stable. There will be no further breaking changes. - - Internal changes to improve Subscription.Receive behavior. -- storage: Support updating bucket lifecycle config. -- spanner: Support struct-typed parameter bindings. -- texttospeech: New client for the Text-to-Speech API. - -## v0.23.0 - -- bigquery: Add DDL stats to query statistics. -- bigtable: - - cbt: Add cells-per-column limit for row lookup. - - cbt: Make it possible to combine read filters. -- dlp: v2beta2 client removed. Use the v2 client instead. -- firestore, spanner: Fix compilation errors due to protobuf changes. - -## v0.22.0 - -- bigtable: - - cbt: Support cells per column limit for row read. - - bttest: Correctly handle empty RowSet. - - Fix ReadModifyWrite operation in emulator. - - Fix API path in GetCluster. - -- bigquery: - - BEHAVIOR CHANGE: Retry on 503 status code. - - Add dataset.DeleteWithContents. - - Add SchemaUpdateOptions for query jobs. - - Add Timeline to QueryStatistics. - - Add more stats to ExplainQueryStage. - - Support Parquet data format. - -- datastore: - - Support omitempty for times. - -- dlp: - - **BREAKING CHANGE:** Remove v1beta1 client. Please migrate to the v2 client, - which is now out of beta. - - Add v2 client. - -- firestore: - - BEHAVIOR CHANGE: Treat set({}, MergeAll) as valid. - -- iam: - - Support JWT signing via SignJwt callopt. - -- profiler: - - BEHAVIOR CHANGE: PollForSerialOutput returns an error when context.Done. - - BEHAVIOR CHANGE: Increase the initial backoff to 1 minute. - - Avoid returning empty serial port output. - -- pubsub: - - BEHAVIOR CHANGE: Don't backoff during next retryable error once stream is healthy. - - BEHAVIOR CHANGE: Don't backoff on EOF. - - pstest: Support Acknowledge and ModifyAckDeadline RPCs. - -- redis: - - Add v1 beta Redis client. - -- spanner: - - Support SessionLabels. - -- speech: - - Add api v1 beta1 client. - -- storage: - - BEHAVIOR CHANGE: Retry reads when retryable error occurs. - - Fix delete of object in requester-pays bucket. - - Support KMS integration. - -## v0.21.0 - -- bigquery: - - Add OpenCensus tracing. - -- firestore: - - **BREAKING CHANGE:** If a document does not exist, return a DocumentSnapshot - whose Exists method returns false. DocumentRef.Get and Transaction.Get - return the non-nil DocumentSnapshot in addition to a NotFound error. - **DocumentRef.GetAll and Transaction.GetAll return a non-nil - DocumentSnapshot instead of nil.** - - Add DocumentIterator.Stop. **Call Stop whenever you are done with a - DocumentIterator.** - - Added Query.Snapshots and DocumentRef.Snapshots, which provide realtime - notification of updates. See https://cloud.google.com/firestore/docs/query-data/listen. - - Canceling an RPC now always returns a grpc.Status with codes.Canceled. - -- spanner: - - Add `CommitTimestamp`, which supports inserting the commit timestamp of a - transaction into a column. - -## v0.20.0 - -- bigquery: Support SchemaUpdateOptions for load jobs. - -- bigtable: - - Add SampleRowKeys. - - cbt: Support union, intersection GCPolicy. - - Retry admin RPCS. - - Add trace spans to retries. - -- datastore: Add OpenCensus tracing. - -- firestore: - - Fix queries involving Null and NaN. - - Allow Timestamp protobuffers for time values. - -- logging: Add a WriteTimeout option. - -- spanner: Support Batch API. - -- storage: Add OpenCensus tracing. - -## v0.19.0 - -- bigquery: - - Support customer-managed encryption keys. - -- bigtable: - - Improved emulator support. - - Support GetCluster. - -- datastore: - - Add general mutations. - - Support pointer struct fields. - - Support transaction options. - -- firestore: - - Add Transaction.GetAll. - - Support document cursors. - -- logging: - - Support concurrent RPCs to the service. - - Support per-entry resources. - -- profiler: - - Add config options to disable heap and thread profiling. - - Read the project ID from $GOOGLE_CLOUD_PROJECT when it's set. - -- pubsub: - - BEHAVIOR CHANGE: Release flow control after ack/nack (instead of after the - callback returns). - - Add SubscriptionInProject. - - Add OpenCensus instrumentation for streaming pull. - -- storage: - - Support CORS. - -## v0.18.0 - -- bigquery: - - Marked stable. - - Schema inference of nullable fields supported. - - Added TimePartitioning to QueryConfig. - -- firestore: Data provided to DocumentRef.Set with a Merge option can contain - Delete sentinels. - -- logging: Clients can accept parent resources other than projects. - -- pubsub: - - pubsub/pstest: A lighweight fake for pubsub. Experimental; feedback welcome. - - Support updating more subscription metadata: AckDeadline, - RetainAckedMessages and RetentionDuration. - -- oslogin/apiv1beta: New client for the Cloud OS Login API. - -- rpcreplay: A package for recording and replaying gRPC traffic. - -- spanner: - - Add a ReadWithOptions that supports a row limit, as well as an index. - - Support query plan and execution statistics. - - Added [OpenCensus](http://opencensus.io) support. - -- storage: Clarify checksum validation for gzipped files (it is not validated - when the file is served uncompressed). - - -## v0.17.0 - -- firestore BREAKING CHANGES: - - Remove UpdateMap and UpdateStruct; rename UpdatePaths to Update. - Change - `docref.UpdateMap(ctx, map[string]interface{}{"a.b", 1})` - to - `docref.Update(ctx, []firestore.Update{{Path: "a.b", Value: 1}})` - - Change - `docref.UpdateStruct(ctx, []string{"Field"}, aStruct)` - to - `docref.Update(ctx, []firestore.Update{{Path: "Field", Value: aStruct.Field}})` - - Rename MergePaths to Merge; require args to be FieldPaths - - A value stored as an integer can be read into a floating-point field, and vice versa. -- bigtable/cmd/cbt: - - Support deleting a column. - - Add regex option for row read. -- spanner: Mark stable. -- storage: - - Add Reader.ContentEncoding method. - - Fix handling of SignedURL headers. -- bigquery: - - If Uploader.Put is called with no rows, it returns nil without making a - call. - - Schema inference supports the "nullable" option in struct tags for - non-required fields. - - TimePartitioning supports "Field". - - -## v0.16.0 - -- Other bigquery changes: - - `JobIterator.Next` returns `*Job`; removed `JobInfo` (BREAKING CHANGE). - - UseStandardSQL is deprecated; set UseLegacySQL to true if you need - Legacy SQL. - - Uploader.Put will generate a random insert ID if you do not provide one. - - Support time partitioning for load jobs. - - Support dry-run queries. - - A `Job` remembers its last retrieved status. - - Support retrieving job configuration. - - Support labels for jobs and tables. - - Support dataset access lists. - - Improve support for external data sources, including data from Bigtable and - Google Sheets, and tables with external data. - - Support updating a table's view configuration. - - Fix uploading civil times with nanoseconds. - -- storage: - - Support PubSub notifications. - - Support Requester Pays buckets. - -- profiler: Support goroutine and mutex profile types. - -## v0.15.0 - -- firestore: beta release. See the - [announcement](https://firebase.googleblog.com/2017/10/introducing-cloud-firestore.html). - -- errorreporting: The existing package has been redesigned. - -- errors: This package has been removed. Use errorreporting. - - -## v0.14.0 - -- bigquery BREAKING CHANGES: - - Standard SQL is the default for queries and views. - - `Table.Create` takes `TableMetadata` as a second argument, instead of - options. - - `Dataset.Create` takes `DatasetMetadata` as a second argument. - - `DatasetMetadata` field `ID` renamed to `FullID` - - `TableMetadata` field `ID` renamed to `FullID` - -- Other bigquery changes: - - The client will append a random suffix to a provided job ID if you set - `AddJobIDSuffix` to true in a job config. - - Listing jobs is supported. - - Better retry logic. - -- vision, language, speech: clients are now stable - -- monitoring: client is now beta - -- profiler: - - Rename InstanceName to Instance, ZoneName to Zone - - Auto-detect service name and version on AppEngine. - -## v0.13.0 - -- bigquery: UseLegacySQL options for CreateTable and QueryConfig. Use these - options to continue using Legacy SQL after the client switches its default - to Standard SQL. - -- bigquery: Support for updating dataset labels. - -- bigquery: Set DatasetIterator.ProjectID to list datasets in a project other - than the client's. DatasetsInProject is no longer needed and is deprecated. - -- bigtable: Fail ListInstances when any zones fail. - -- spanner: support decoding of slices of basic types (e.g. []string, []int64, - etc.) - -- logging/logadmin: UpdateSink no longer creates a sink if it is missing - (actually a change to the underlying service, not the client) - -- profiler: Service and ServiceVersion replace Target in Config. - -## v0.12.0 - -- pubsub: Subscription.Receive now uses streaming pull. - -- pubsub: add Client.TopicInProject to access topics in a different project - than the client. - -- errors: renamed errorreporting. The errors package will be removed shortly. - -- datastore: improved retry behavior. - -- bigquery: support updates to dataset metadata, with etags. - -- bigquery: add etag support to Table.Update (BREAKING: etag argument added). - -- bigquery: generate all job IDs on the client. - -- storage: support bucket lifecycle configurations. - - -## v0.11.0 - -- Clients for spanner, pubsub and video are now in beta. - -- New client for DLP. - -- spanner: performance and testing improvements. - -- storage: requester-pays buckets are supported. - -- storage, profiler, bigtable, bigquery: bug fixes and other minor improvements. - -- pubsub: bug fixes and other minor improvements - -## v0.10.0 - -- pubsub: Subscription.ModifyPushConfig replaced with Subscription.Update. - -- pubsub: Subscription.Receive now runs concurrently for higher throughput. - -- vision: cloud.google.com/go/vision is deprecated. Use -cloud.google.com/go/vision/apiv1 instead. - -- translation: now stable. - -- trace: several changes to the surface. See the link below. - -### Code changes required from v0.9.0 - -- pubsub: Replace - - ``` - sub.ModifyPushConfig(ctx, pubsub.PushConfig{Endpoint: "https://example.com/push"}) - ``` - - with - - ``` - sub.Update(ctx, pubsub.SubscriptionConfigToUpdate{ - PushConfig: &pubsub.PushConfig{Endpoint: "https://example.com/push"}, - }) - ``` - -- trace: traceGRPCServerInterceptor will be provided from *trace.Client. -Given an initialized `*trace.Client` named `tc`, instead of - - ``` - s := grpc.NewServer(grpc.UnaryInterceptor(trace.GRPCServerInterceptor(tc))) - ``` - - write - - ``` - s := grpc.NewServer(grpc.UnaryInterceptor(tc.GRPCServerInterceptor())) - ``` - -- trace trace.GRPCClientInterceptor will also provided from *trace.Client. -Instead of - - ``` - conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(trace.GRPCClientInterceptor())) - ``` - - write - - ``` - conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor())) - ``` - -- trace: We removed the deprecated `trace.EnableGRPCTracing`. Use the gRPC -interceptor as a dial option as shown below when initializing Cloud package -clients: - - ``` - c, err := pubsub.NewClient(ctx, "project-id", option.WithGRPCDialOption(grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor()))) - if err != nil { - ... - } - ``` - - -## v0.9.0 - -- Breaking changes to some autogenerated clients. -- rpcreplay package added. - -## v0.8.0 - -- profiler package added. -- storage: - - Retry Objects.Insert call. - - Add ProgressFunc to WRiter. -- pubsub: breaking changes: - - Publish is now asynchronous ([announcement](https://groups.google.com/d/topic/google-api-go-announce/aaqRDIQ3rvU/discussion)). - - Subscription.Pull replaced by Subscription.Receive, which takes a callback ([announcement](https://groups.google.com/d/topic/google-api-go-announce/8pt6oetAdKc/discussion)). - - Message.Done replaced with Message.Ack and Message.Nack. - -## v0.7.0 - -- Release of a client library for Spanner. See -the -[blog -post](https://cloudplatform.googleblog.com/2017/02/introducing-Cloud-Spanner-a-global-database-service-for-mission-critical-applications.html). -Note that although the Spanner service is beta, the Go client library is alpha. - -## v0.6.0 - -- Beta release of BigQuery, DataStore, Logging and Storage. See the -[blog post](https://cloudplatform.googleblog.com/2016/12/announcing-new-google-cloud-client.html). - -- bigquery: - - struct support. Read a row directly into a struct with -`RowIterator.Next`, and upload a row directly from a struct with `Uploader.Put`. -You can also use field tags. See the [package documentation][cloud-bigquery-ref] -for details. - - - The `ValueList` type was removed. It is no longer necessary. Instead of - ```go - var v ValueList - ... it.Next(&v) .. - ``` - use - - ```go - var v []Value - ... it.Next(&v) ... - ``` - - - Previously, repeatedly calling `RowIterator.Next` on the same `[]Value` or - `ValueList` would append to the slice. Now each call resets the size to zero first. - - - Schema inference will infer the SQL type BYTES for a struct field of - type []byte. Previously it inferred STRING. - - - The types `uint`, `uint64` and `uintptr` are no longer supported in schema - inference. BigQuery's integer type is INT64, and those types may hold values - that are not correctly represented in a 64-bit signed integer. - -## v0.5.0 - -- bigquery: - - The SQL types DATE, TIME and DATETIME are now supported. They correspond to - the `Date`, `Time` and `DateTime` types in the new `cloud.google.com/go/civil` - package. - - Support for query parameters. - - Support deleting a dataset. - - Values from INTEGER columns will now be returned as int64, not int. This - will avoid errors arising from large values on 32-bit systems. -- datastore: - - Nested Go structs encoded as Entity values, instead of a -flattened list of the embedded struct's fields. This means that you may now have twice-nested slices, eg. - ```go - type State struct { - Cities []struct{ - Populations []int - } - } - ``` - See [the announcement](https://groups.google.com/forum/#!topic/google-api-go-announce/79jtrdeuJAg) for -more details. - - Contexts no longer hold namespaces; instead you must set a key's namespace - explicitly. Also, key functions have been changed and renamed. - - The WithNamespace function has been removed. To specify a namespace in a Query, use the Query.Namespace method: - ```go - q := datastore.NewQuery("Kind").Namespace("ns") - ``` - - All the fields of Key are exported. That means you can construct any Key with a struct literal: - ```go - k := &Key{Kind: "Kind", ID: 37, Namespace: "ns"} - ``` - - As a result of the above, the Key methods Kind, ID, d.Name, Parent, SetParent and Namespace have been removed. - - `NewIncompleteKey` has been removed, replaced by `IncompleteKey`. Replace - ```go - NewIncompleteKey(ctx, kind, parent) - ``` - with - ```go - IncompleteKey(kind, parent) - ``` - and if you do use namespaces, make sure you set the namespace on the returned key. - - `NewKey` has been removed, replaced by `NameKey` and `IDKey`. Replace - ```go - NewKey(ctx, kind, name, 0, parent) - NewKey(ctx, kind, "", id, parent) - ``` - with - ```go - NameKey(kind, name, parent) - IDKey(kind, id, parent) - ``` - and if you do use namespaces, make sure you set the namespace on the returned key. - - The `Done` variable has been removed. Replace `datastore.Done` with `iterator.Done`, from the package `google.golang.org/api/iterator`. - - The `Client.Close` method will have a return type of error. It will return the result of closing the underlying gRPC connection. - - See [the announcement](https://groups.google.com/forum/#!topic/google-api-go-announce/hqXtM_4Ix-0) for -more details. - -## v0.4.0 - -- bigquery: - -`NewGCSReference` is now a function, not a method on `Client`. - - `Table.LoaderFrom` now accepts a `ReaderSource`, enabling - loading data into a table from a file or any `io.Reader`. - * Client.Table and Client.OpenTable have been removed. - Replace - ```go - client.OpenTable("project", "dataset", "table") - ``` - with - ```go - client.DatasetInProject("project", "dataset").Table("table") - ``` - - * Client.CreateTable has been removed. - Replace - ```go - client.CreateTable(ctx, "project", "dataset", "table") - ``` - with - ```go - client.DatasetInProject("project", "dataset").Table("table").Create(ctx) - ``` - - * Dataset.ListTables have been replaced with Dataset.Tables. - Replace - ```go - tables, err := ds.ListTables(ctx) - ``` - with - ```go - it := ds.Tables(ctx) - for { - table, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - // TODO: Handle error. - } - // TODO: use table. - } - ``` - - * Client.Read has been replaced with Job.Read, Table.Read and Query.Read. - Replace - ```go - it, err := client.Read(ctx, job) - ``` - with - ```go - it, err := job.Read(ctx) - ``` - and similarly for reading from tables or queries. - - * The iterator returned from the Read methods is now named RowIterator. Its - behavior is closer to the other iterators in these libraries. It no longer - supports the Schema method; see the next item. - Replace - ```go - for it.Next(ctx) { - var vals ValueList - if err := it.Get(&vals); err != nil { - // TODO: Handle error. - } - // TODO: use vals. - } - if err := it.Err(); err != nil { - // TODO: Handle error. - } - ``` - with - ``` - for { - var vals ValueList - err := it.Next(&vals) - if err == iterator.Done { - break - } - if err != nil { - // TODO: Handle error. - } - // TODO: use vals. - } - ``` - Instead of the `RecordsPerRequest(n)` option, write - ```go - it.PageInfo().MaxSize = n - ``` - Instead of the `StartIndex(i)` option, write - ```go - it.StartIndex = i - ``` - - * ValueLoader.Load now takes a Schema in addition to a slice of Values. - Replace - ```go - func (vl *myValueLoader) Load(v []bigquery.Value) - ``` - with - ```go - func (vl *myValueLoader) Load(v []bigquery.Value, s bigquery.Schema) - ``` - - - * Table.Patch is replace by Table.Update. - Replace - ```go - p := table.Patch() - p.Description("new description") - metadata, err := p.Apply(ctx) - ``` - with - ```go - metadata, err := table.Update(ctx, bigquery.TableMetadataToUpdate{ - Description: "new description", - }) - ``` - - * Client.Copy is replaced by separate methods for each of its four functions. - All options have been replaced by struct fields. - - * To load data from Google Cloud Storage into a table, use Table.LoaderFrom. - - Replace - ```go - client.Copy(ctx, table, gcsRef) - ``` - with - ```go - table.LoaderFrom(gcsRef).Run(ctx) - ``` - Instead of passing options to Copy, set fields on the Loader: - ```go - loader := table.LoaderFrom(gcsRef) - loader.WriteDisposition = bigquery.WriteTruncate - ``` - - * To extract data from a table into Google Cloud Storage, use - Table.ExtractorTo. Set fields on the returned Extractor instead of - passing options. - - Replace - ```go - client.Copy(ctx, gcsRef, table) - ``` - with - ```go - table.ExtractorTo(gcsRef).Run(ctx) - ``` - - * To copy data into a table from one or more other tables, use - Table.CopierFrom. Set fields on the returned Copier instead of passing options. - - Replace - ```go - client.Copy(ctx, dstTable, srcTable) - ``` - with - ```go - dst.Table.CopierFrom(srcTable).Run(ctx) - ``` - - * To start a query job, create a Query and call its Run method. Set fields - on the query instead of passing options. - - Replace - ```go - client.Copy(ctx, table, query) - ``` - with - ```go - query.Run(ctx) - ``` - - * Table.NewUploader has been renamed to Table.Uploader. Instead of options, - configure an Uploader by setting its fields. - Replace - ```go - u := table.NewUploader(bigquery.UploadIgnoreUnknownValues()) - ``` - with - ```go - u := table.NewUploader(bigquery.UploadIgnoreUnknownValues()) - u.IgnoreUnknownValues = true - ``` - -- pubsub: remove `pubsub.Done`. Use `iterator.Done` instead, where `iterator` is the package -`google.golang.org/api/iterator`. - -## v0.3.0 - -- storage: - * AdminClient replaced by methods on Client. - Replace - ```go - adminClient.CreateBucket(ctx, bucketName, attrs) - ``` - with - ```go - client.Bucket(bucketName).Create(ctx, projectID, attrs) - ``` - - * BucketHandle.List replaced by BucketHandle.Objects. - Replace - ```go - for query != nil { - objs, err := bucket.List(d.ctx, query) - if err != nil { ... } - query = objs.Next - for _, obj := range objs.Results { - fmt.Println(obj) - } - } - ``` - with - ```go - iter := bucket.Objects(d.ctx, query) - for { - obj, err := iter.Next() - if err == iterator.Done { - break - } - if err != nil { ... } - fmt.Println(obj) - } - ``` - (The `iterator` package is at `google.golang.org/api/iterator`.) - - Replace `Query.Cursor` with `ObjectIterator.PageInfo().Token`. - - Replace `Query.MaxResults` with `ObjectIterator.PageInfo().MaxSize`. - - - * ObjectHandle.CopyTo replaced by ObjectHandle.CopierFrom. - Replace - ```go - attrs, err := src.CopyTo(ctx, dst, nil) - ``` - with - ```go - attrs, err := dst.CopierFrom(src).Run(ctx) - ``` - - Replace - ```go - attrs, err := src.CopyTo(ctx, dst, &storage.ObjectAttrs{ContextType: "text/html"}) - ``` - with - ```go - c := dst.CopierFrom(src) - c.ContextType = "text/html" - attrs, err := c.Run(ctx) - ``` - - * ObjectHandle.ComposeFrom replaced by ObjectHandle.ComposerFrom. - Replace - ```go - attrs, err := dst.ComposeFrom(ctx, []*storage.ObjectHandle{src1, src2}, nil) - ``` - with - ```go - attrs, err := dst.ComposerFrom(src1, src2).Run(ctx) - ``` - - * ObjectHandle.Update's ObjectAttrs argument replaced by ObjectAttrsToUpdate. - Replace - ```go - attrs, err := obj.Update(ctx, &storage.ObjectAttrs{ContextType: "text/html"}) - ``` - with - ```go - attrs, err := obj.Update(ctx, storage.ObjectAttrsToUpdate{ContextType: "text/html"}) - ``` - - * ObjectHandle.WithConditions replaced by ObjectHandle.If. - Replace - ```go - obj.WithConditions(storage.Generation(gen), storage.IfMetaGenerationMatch(mgen)) - ``` - with - ```go - obj.Generation(gen).If(storage.Conditions{MetagenerationMatch: mgen}) - ``` - - Replace - ```go - obj.WithConditions(storage.IfGenerationMatch(0)) - ``` - with - ```go - obj.If(storage.Conditions{DoesNotExist: true}) - ``` - - * `storage.Done` replaced by `iterator.Done` (from package `google.golang.org/api/iterator`). - -- Package preview/logging deleted. Use logging instead. - -## v0.2.0 - -- Logging client replaced with preview version (see below). - -- New clients for some of Google's Machine Learning APIs: Vision, Speech, and -Natural Language. - -- Preview version of a new [Stackdriver Logging][cloud-logging] client in -[`cloud.google.com/go/preview/logging`](https://godoc.org/cloud.google.com/go/preview/logging). -This client uses gRPC as its transport layer, and supports log reading, sinks -and metrics. It will replace the current client at `cloud.google.com/go/logging` shortly. diff --git a/ibm/vendor/cloud.google.com/go/CODE_OF_CONDUCT.md b/ibm/vendor/cloud.google.com/go/CODE_OF_CONDUCT.md deleted file mode 100644 index 8fd1bc9c22..0000000000 --- a/ibm/vendor/cloud.google.com/go/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,44 +0,0 @@ -# Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) - diff --git a/ibm/vendor/cloud.google.com/go/CONTRIBUTING.md b/ibm/vendor/cloud.google.com/go/CONTRIBUTING.md deleted file mode 100644 index d9775744e5..0000000000 --- a/ibm/vendor/cloud.google.com/go/CONTRIBUTING.md +++ /dev/null @@ -1,254 +0,0 @@ -# Contributing - -1. [File an issue](https://github.com/googleapis/google-cloud-go/issues/new/choose). - The issue will be used to discuss the bug or feature and should be created - before sending a CL. - -1. [Install Go](https://golang.org/dl/). - 1. Ensure that your `GOBIN` directory (by default `$(go env GOPATH)/bin`) - is in your `PATH`. - 1. Check it's working by running `go version`. - * If it doesn't work, check the install location, usually - `/usr/local/go`, is on your `PATH`. - -1. Sign one of the -[contributor license agreements](#contributor-license-agreements) below. - -1. Clone the repo: - `git clone https://github.com/googleapis/google-cloud-go` - -1. Change into the checked out source: - `cd google-cloud-go` - -1. Fork the repo. - -1. Set your fork as a remote: - `git remote add fork git@github.com:GITHUB_USERNAME/google-cloud-go.git` - -1. Make changes, commit to your fork. - - Commit messages should follow the - [Conventional Commits Style](https://www.conventionalcommits.org). The scope - portion should always be filled with the name of the package affected by the - changes being made. For example: - ``` - feat(functions): add gophers codelab - ``` - -1. Send a pull request with your changes. - - To minimize friction, consider setting `Allow edits from maintainers` on the - PR, which will enable project committers and automation to update your PR. - -1. A maintainer will review the pull request and make comments. - - Prefer adding additional commits over amending and force-pushing since it can - be difficult to follow code reviews when the commit history changes. - - Commits will be squashed when they're merged. - -## Integration Tests - -In addition to the unit tests, you may run the integration test suite. These -directions describe setting up your environment to run integration tests for -_all_ packages: note that many of these instructions may be redundant if you -intend only to run integration tests on a single package. - -#### GCP Setup - -To run the integrations tests, creation and configuration of two projects in -the Google Developers Console is required: one specifically for Firestore -integration tests, and another for all other integration tests. We'll refer to -these projects as "general project" and "Firestore project". - -After creating each project, you must [create a service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) -for each project. Ensure the project-level **Owner** -[IAM role](console.cloud.google.com/iam-admin/iam/project) role is added to -each service account. During the creation of the service account, you should -download the JSON credential file for use later. - -Next, ensure the following APIs are enabled in the general project: - -- BigQuery API -- BigQuery Data Transfer API -- Cloud Dataproc API -- Cloud Dataproc Control API Private -- Cloud Datastore API -- Cloud Firestore API -- Cloud Key Management Service (KMS) API -- Cloud Natural Language API -- Cloud OS Login API -- Cloud Pub/Sub API -- Cloud Resource Manager API -- Cloud Spanner API -- Cloud Speech API -- Cloud Translation API -- Cloud Video Intelligence API -- Cloud Vision API -- Compute Engine API -- Compute Engine Instance Group Manager API -- Container Registry API -- Firebase Rules API -- Google Cloud APIs -- Google Cloud Deployment Manager V2 API -- Google Cloud SQL -- Google Cloud Storage -- Google Cloud Storage JSON API -- Google Compute Engine Instance Group Updater API -- Google Compute Engine Instance Groups API -- Kubernetes Engine API -- Stackdriver Error Reporting API - -Next, create a Datastore database in the general project, and a Firestore -database in the Firestore project. - -Finally, in the general project, create an API key for the translate API: - -- Go to GCP Developer Console. -- Navigate to APIs & Services > Credentials. -- Click Create Credentials > API Key. -- Save this key for use in `GCLOUD_TESTS_API_KEY` as described below. - -#### Local Setup - -Once the two projects are created and configured, set the following environment -variables: - -- `GCLOUD_TESTS_GOLANG_PROJECT_ID`: Developers Console project's ID (e.g. -bamboo-shift-455) for the general project. -- `GCLOUD_TESTS_GOLANG_KEY`: The path to the JSON key file of the general -project's service account. -- `GCLOUD_TESTS_GOLANG_FIRESTORE_PROJECT_ID`: Developers Console project's ID -(e.g. doorway-cliff-677) for the Firestore project. -- `GCLOUD_TESTS_GOLANG_FIRESTORE_KEY`: The path to the JSON key file of the -Firestore project's service account. -- `GCLOUD_TESTS_GOLANG_KEYRING`: The full name of the keyring for the tests, -in the form -"projects/P/locations/L/keyRings/R". The creation of this is described below. -- `GCLOUD_TESTS_API_KEY`: API key for using the Translate API. -- `GCLOUD_TESTS_GOLANG_ZONE`: Compute Engine zone. - -Install the [gcloud command-line tool][gcloudcli] to your machine and use it to -create some resources used in integration tests. - -From the project's root directory: - -``` sh -# Sets the default project in your env. -$ gcloud config set project $GCLOUD_TESTS_GOLANG_PROJECT_ID - -# Authenticates the gcloud tool with your account. -$ gcloud auth login - -# Create the indexes used in the datastore integration tests. -$ gcloud datastore indexes create datastore/testdata/index.yaml - -# Creates a Google Cloud storage bucket with the same name as your test project, -# and with the Stackdriver Logging service account as owner, for the sink -# integration tests in logging. -$ gsutil mb gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID -$ gsutil acl ch -g cloud-logs@google.com:O gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID - -# Creates a PubSub topic for integration tests of storage notifications. -$ gcloud beta pubsub topics create go-storage-notification-test -# Next, go to the Pub/Sub dashboard in GCP console. Authorize the user -# "service-@gs-project-accounts.iam.gserviceaccount.com" -# as a publisher to that topic. - -# Creates a Spanner instance for the spanner integration tests. -$ gcloud beta spanner instances create go-integration-test --config regional-us-central1 --nodes 10 --description 'Instance for go client test' -# NOTE: Spanner instances are priced by the node-hour, so you may want to -# delete the instance after testing with 'gcloud beta spanner instances delete'. - -$ export MY_KEYRING=some-keyring-name -$ export MY_LOCATION=global -# Creates a KMS keyring, in the same location as the default location for your -# project's buckets. -$ gcloud kms keyrings create $MY_KEYRING --location $MY_LOCATION -# Creates two keys in the keyring, named key1 and key2. -$ gcloud kms keys create key1 --keyring $MY_KEYRING --location $MY_LOCATION --purpose encryption -$ gcloud kms keys create key2 --keyring $MY_KEYRING --location $MY_LOCATION --purpose encryption -# Sets the GCLOUD_TESTS_GOLANG_KEYRING environment variable. -$ export GCLOUD_TESTS_GOLANG_KEYRING=projects/$GCLOUD_TESTS_GOLANG_PROJECT_ID/locations/$MY_LOCATION/keyRings/$MY_KEYRING -# Authorizes Google Cloud Storage to encrypt and decrypt using key1. -gsutil kms authorize -p $GCLOUD_TESTS_GOLANG_PROJECT_ID -k $GCLOUD_TESTS_GOLANG_KEYRING/cryptoKeys/key1 -``` - -#### Running - -Once you've done the necessary setup, you can run the integration tests by -running: - -``` sh -$ go test -v cloud.google.com/go/... -``` - -#### Replay - -Some packages can record the RPCs during integration tests to a file for -subsequent replay. To record, pass the `-record` flag to `go test`. The -recording will be saved to the _package_`.replay` file. To replay integration -tests from a saved recording, the replay file must be present, the `-short` -flag must be passed to `go test`, and the `GCLOUD_TESTS_GOLANG_ENABLE_REPLAY` -environment variable must have a non-empty value. - -## Contributor License Agreements - -Before we can accept your pull requests you'll need to sign a Contributor -License Agreement (CLA): - -- **If you are an individual writing original source code** and **you own the -intellectual property**, then you'll need to sign an [individual CLA][indvcla]. -- **If you work for a company that wants to allow you to contribute your -work**, then you'll need to sign a [corporate CLA][corpcla]. - -You can sign these electronically (just scroll to the bottom). After that, -we'll be able to accept your pull requests. - -## Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) - -[gcloudcli]: https://developers.google.com/cloud/sdk/gcloud/ -[indvcla]: https://developers.google.com/open-source/cla/individual -[corpcla]: https://developers.google.com/open-source/cla/corporate diff --git a/ibm/vendor/cloud.google.com/go/LICENSE b/ibm/vendor/cloud.google.com/go/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/ibm/vendor/cloud.google.com/go/LICENSE +++ /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/ibm/vendor/cloud.google.com/go/README.md b/ibm/vendor/cloud.google.com/go/README.md deleted file mode 100644 index b115812c26..0000000000 --- a/ibm/vendor/cloud.google.com/go/README.md +++ /dev/null @@ -1,178 +0,0 @@ -# Google Cloud Client Libraries for Go - -[![GoDoc](https://godoc.org/cloud.google.com/go?status.svg)](https://pkg.go.dev/cloud.google.com/go) - -Go packages for [Google Cloud Platform](https://cloud.google.com) services. - -``` go -import "cloud.google.com/go" -``` - -To install the packages on your system, *do not clone the repo*. Instead: - -1. Change to your project directory: - - ``` - cd /my/cloud/project - ``` -1. Get the package you want to use. Some products have their own module, so it's - best to `go get` the package(s) you want to use: - - ``` - $ go get cloud.google.com/go/firestore # Replace with the package you want to use. - ``` - -**NOTE:** Some of these packages are under development, and may occasionally -make backwards-incompatible changes. - -**NOTE:** Github repo is a mirror of [https://code.googlesource.com/gocloud](https://code.googlesource.com/gocloud). - -## Supported APIs - -Google API | Status | Package -------------------------------------------------|--------------|----------------------------------------------------------- -[Asset][cloud-asset] | stable | [`cloud.google.com/go/asset/apiv1`](https://pkg.go.dev/cloud.google.com/go/asset/v1beta) -[Automl][cloud-automl] | stable | [`cloud.google.com/go/automl/apiv1`](https://pkg.go.dev/cloud.google.com/go/automl/apiv1) -[BigQuery][cloud-bigquery] | stable | [`cloud.google.com/go/bigquery`](https://pkg.go.dev/cloud.google.com/go/bigquery) -[Bigtable][cloud-bigtable] | stable | [`cloud.google.com/go/bigtable`](https://pkg.go.dev/cloud.google.com/go/bigtable) -[Cloudbuild][cloud-build] | stable | [`cloud.google.com/go/cloudbuild/apiv1`](https://pkg.go.dev/cloud.google.com/go/cloudbuild/apiv1) -[Cloudtasks][cloud-tasks] | stable | [`cloud.google.com/go/cloudtasks/apiv2`](https://pkg.go.dev/cloud.google.com/go/cloudtasks/apiv2) -[Container][cloud-container] | stable | [`cloud.google.com/go/container/apiv1`](https://pkg.go.dev/cloud.google.com/go/container/apiv1) -[ContainerAnalysis][cloud-containeranalysis] | beta | [`cloud.google.com/go/containeranalysis/apiv1`](https://pkg.go.dev/cloud.google.com/go/containeranalysis/apiv1) -[Dataproc][cloud-dataproc] | stable | [`cloud.google.com/go/dataproc/apiv1`](https://pkg.go.dev/cloud.google.com/go/dataproc/apiv1) -[Datastore][cloud-datastore] | stable | [`cloud.google.com/go/datastore`](https://pkg.go.dev/cloud.google.com/go/datastore) -[Debugger][cloud-debugger] | stable | [`cloud.google.com/go/debugger/apiv2`](https://pkg.go.dev/cloud.google.com/go/debugger/apiv2) -[Dialogflow][cloud-dialogflow] | stable | [`cloud.google.com/go/dialogflow/apiv2`](https://pkg.go.dev/cloud.google.com/go/dialogflow/apiv2) -[Data Loss Prevention][cloud-dlp] | stable | [`cloud.google.com/go/dlp/apiv2`](https://pkg.go.dev/cloud.google.com/go/dlp/apiv2) -[ErrorReporting][cloud-errors] | alpha | [`cloud.google.com/go/errorreporting`](https://pkg.go.dev/cloud.google.com/go/errorreporting) -[Firestore][cloud-firestore] | stable | [`cloud.google.com/go/firestore`](https://pkg.go.dev/cloud.google.com/go/firestore) -[IAM][cloud-iam] | stable | [`cloud.google.com/go/iam`](https://pkg.go.dev/cloud.google.com/go/iam) -[IoT][cloud-iot] | stable | [`cloud.google.com/go/iot/apiv1`](https://pkg.go.dev/cloud.google.com/go/iot/apiv1) -[IRM][cloud-irm] | alpha | [`cloud.google.com/go/irm/apiv1alpha2`](https://pkg.go.dev/cloud.google.com/go/irm/apiv1alpha2) -[KMS][cloud-kms] | stable | [`cloud.google.com/go/kms/apiv1`](https://pkg.go.dev/cloud.google.com/go/kms/apiv1) -[Natural Language][cloud-natural-language] | stable | [`cloud.google.com/go/language/apiv1`](https://pkg.go.dev/cloud.google.com/go/language/apiv1) -[Logging][cloud-logging] | stable | [`cloud.google.com/go/logging`](https://pkg.go.dev/cloud.google.com/go/logging) -[Memorystore][cloud-memorystore] | alpha | [`cloud.google.com/go/redis/apiv1`](https://pkg.go.dev/cloud.google.com/go/redis/apiv1) -[Monitoring][cloud-monitoring] | stable | [`cloud.google.com/go/monitoring/apiv3`](https://pkg.go.dev/cloud.google.com/go/monitoring/apiv3) -[OS Login][cloud-oslogin] | stable | [`cloud.google.com/go/oslogin/apiv1`](https://pkg.go.dev/cloud.google.com/go/oslogin/apiv1) -[Pub/Sub][cloud-pubsub] | stable | [`cloud.google.com/go/pubsub`](https://pkg.go.dev/cloud.google.com/go/pubsub) -[Phishing Protection][cloud-phishingprotection] | alpha | [`cloud.google.com/go/phishingprotection/apiv1beta1`](https://pkg.go.dev/cloud.google.com/go/phishingprotection/apiv1beta1) -[reCAPTCHA Enterprise][cloud-recaptcha] | alpha | [`cloud.google.com/go/recaptchaenterprise/apiv1beta1`](https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/apiv1beta1) -[Recommender][cloud-recommender] | beta | [`cloud.google.com/go/recommender/apiv1beta1`](https://pkg.go.dev/cloud.google.com/go/recommender/apiv1beta1) -[Scheduler][cloud-scheduler] | stable | [`cloud.google.com/go/scheduler/apiv1`](https://pkg.go.dev/cloud.google.com/go/scheduler/apiv1) -[Securitycenter][cloud-securitycenter] | stable | [`cloud.google.com/go/securitycenter/apiv1`](https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1) -[Spanner][cloud-spanner] | stable | [`cloud.google.com/go/spanner`](https://pkg.go.dev/cloud.google.com/go/spanner) -[Speech][cloud-speech] | stable | [`cloud.google.com/go/speech/apiv1`](https://pkg.go.dev/cloud.google.com/go/speech/apiv1) -[Storage][cloud-storage] | stable | [`cloud.google.com/go/storage`](https://pkg.go.dev/cloud.google.com/go/storage) -[Talent][cloud-talent] | alpha | [`cloud.google.com/go/talent/apiv4beta1`](https://pkg.go.dev/cloud.google.com/go/talent/apiv4beta1) -[Text To Speech][cloud-texttospeech] | stable | [`cloud.google.com/go/texttospeech/apiv1`](https://pkg.go.dev/cloud.google.com/go/texttospeech/apiv1) -[Trace][cloud-trace] | stable | [`cloud.google.com/go/trace/apiv2`](https://pkg.go.dev/cloud.google.com/go/trace/apiv2) -[Translate][cloud-translate] | stable | [`cloud.google.com/go/translate`](https://pkg.go.dev/cloud.google.com/go/translate) -[Video Intelligence][cloud-video] | beta | [`cloud.google.com/go/videointelligence/apiv1beta2`](https://pkg.go.dev/cloud.google.com/go/videointelligence/apiv1beta2) -[Vision][cloud-vision] | stable | [`cloud.google.com/go/vision/apiv1`](https://pkg.go.dev/cloud.google.com/go/vision/apiv1) -[Webrisk][cloud-webrisk] | alpha | [`cloud.google.com/go/webrisk/apiv1beta1`](https://pkg.go.dev/cloud.google.com/go/webrisk/apiv1beta1) - -> **Alpha status**: the API is still being actively developed. As a -> result, it might change in backward-incompatible ways and is not recommended -> for production use. -> -> **Beta status**: the API is largely complete, but still has outstanding -> features and bugs to be addressed. There may be minor backwards-incompatible -> changes where necessary. -> -> **Stable status**: the API is mature and ready for production use. We will -> continue addressing bugs and feature requests. - -Documentation and examples are available at [pkg.go.dev/cloud.google.com/go](https://pkg.go.dev/cloud.google.com/go) - -## Go Versions Supported - -We support the two most recent major versions of Go. If Google App Engine uses -an older version, we support that as well. - -## Authorization - -By default, each API will use [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) -for authorization credentials used in calling the API endpoints. This will allow your -application to run in many environments without requiring explicit configuration. - -[snip]:# (auth) -```go -client, err := storage.NewClient(ctx) -``` - -To authorize using a -[JSON key file](https://cloud.google.com/iam/docs/managing-service-account-keys), -pass -[`option.WithCredentialsFile`](https://pkg.go.dev/google.golang.org/api/option#WithCredentialsFile) -to the `NewClient` function of the desired package. For example: - -[snip]:# (auth-JSON) -```go -client, err := storage.NewClient(ctx, option.WithCredentialsFile("path/to/keyfile.json")) -``` - -You can exert more control over authorization by using the -[`golang.org/x/oauth2`](https://pkg.go.dev/golang.org/x/oauth2) package to -create an `oauth2.TokenSource`. Then pass -[`option.WithTokenSource`](https://pkg.go.dev/google.golang.org/api/option#WithTokenSource) -to the `NewClient` function: -[snip]:# (auth-ts) -```go -tokenSource := ... -client, err := storage.NewClient(ctx, option.WithTokenSource(tokenSource)) -``` - -## Contributing - -Contributions are welcome. Please, see the -[CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/CONTRIBUTING.md) -document for details. - -Please note that this project is released with a Contributor Code of Conduct. -By participating in this project you agree to abide by its terms. -See [Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/CONTRIBUTING.md#contributor-code-of-conduct) -for more information. - -[cloud-asset]: https://cloud.google.com/security-command-center/docs/how-to-asset-inventory -[cloud-automl]: https://cloud.google.com/automl -[cloud-build]: https://cloud.google.com/cloud-build/ -[cloud-bigquery]: https://cloud.google.com/bigquery/ -[cloud-bigtable]: https://cloud.google.com/bigtable/ -[cloud-container]: https://cloud.google.com/containers/ -[cloud-containeranalysis]: https://cloud.google.com/container-registry/docs/container-analysis -[cloud-dataproc]: https://cloud.google.com/dataproc/ -[cloud-datastore]: https://cloud.google.com/datastore/ -[cloud-dialogflow]: https://cloud.google.com/dialogflow-enterprise/ -[cloud-debugger]: https://cloud.google.com/debugger/ -[cloud-dlp]: https://cloud.google.com/dlp/ -[cloud-errors]: https://cloud.google.com/error-reporting/ -[cloud-firestore]: https://cloud.google.com/firestore/ -[cloud-iam]: https://cloud.google.com/iam/ -[cloud-iot]: https://cloud.google.com/iot-core/ -[cloud-irm]: https://cloud.google.com/incident-response/docs/concepts -[cloud-kms]: https://cloud.google.com/kms/ -[cloud-pubsub]: https://cloud.google.com/pubsub/ -[cloud-storage]: https://cloud.google.com/storage/ -[cloud-language]: https://cloud.google.com/natural-language -[cloud-logging]: https://cloud.google.com/logging/ -[cloud-natural-language]: https://cloud.google.com/natural-language/ -[cloud-memorystore]: https://cloud.google.com/memorystore/ -[cloud-monitoring]: https://cloud.google.com/monitoring/ -[cloud-oslogin]: https://cloud.google.com/compute/docs/oslogin/rest -[cloud-phishingprotection]: https://cloud.google.com/phishing-protection/ -[cloud-securitycenter]: https://cloud.google.com/security-command-center/ -[cloud-scheduler]: https://cloud.google.com/scheduler -[cloud-spanner]: https://cloud.google.com/spanner/ -[cloud-speech]: https://cloud.google.com/speech -[cloud-talent]: https://cloud.google.com/solutions/talent-solution/ -[cloud-tasks]: https://cloud.google.com/tasks/ -[cloud-texttospeech]: https://cloud.google.com/texttospeech/ -[cloud-talent]: https://cloud.google.com/solutions/talent-solution/ -[cloud-trace]: https://cloud.google.com/trace/ -[cloud-translate]: https://cloud.google.com/translate -[cloud-recaptcha]: https://cloud.google.com/recaptcha-enterprise/ -[cloud-recommender]: https://cloud.google.com/recommendations/ -[cloud-video]: https://cloud.google.com/video-intelligence/ -[cloud-vision]: https://cloud.google.com/vision -[cloud-webrisk]: https://cloud.google.com/web-risk/ diff --git a/ibm/vendor/cloud.google.com/go/RELEASING.md b/ibm/vendor/cloud.google.com/go/RELEASING.md deleted file mode 100644 index c8c7f93352..0000000000 --- a/ibm/vendor/cloud.google.com/go/RELEASING.md +++ /dev/null @@ -1,128 +0,0 @@ -# Setup from scratch - -1. [Install Go](https://golang.org/dl/). - 1. Ensure that your `GOBIN` directory (by default `$(go env GOPATH)/bin`) - is in your `PATH`. - 1. Check it's working by running `go version`. - * If it doesn't work, check the install location, usually - `/usr/local/go`, is on your `PATH`. - -1. Sign one of the -[contributor license agreements](#contributor-license-agreements) below. - -1. Clone the repo: - `git clone https://github.com/googleapis/google-cloud-go` - -1. Change into the checked out source: - `cd google-cloud-go` - -1. Fork the repo and add your fork as a secondary remote (this is necessary in - order to create PRs). - -# Which module to release? - -The Go client libraries have several modules. Each module does not strictly -correspond to a single library - they correspond to trees of directories. If a -file needs to be released, you must release the closest ancestor module. - -To see all modules: - -``` -$ cat `find . -name go.mod` | grep module -module cloud.google.com/go -module cloud.google.com/go/bigtable -module cloud.google.com/go/firestore -module cloud.google.com/go/bigquery -module cloud.google.com/go/storage -module cloud.google.com/go/datastore -module cloud.google.com/go/pubsub -module cloud.google.com/go/spanner -module cloud.google.com/go/logging -``` - -The `cloud.google.com/go` is the repository root module. Each other module is -a submodule. - -So, if you need to release a change in `bigtable/bttest/inmem.go`, the closest -ancestor module is `cloud.google.com/go/bigtable` - so you should release a new -version of the `cloud.google.com/go/bigtable` submodule. - -If you need to release a change in `asset/apiv1/asset_client.go`, the closest -ancestor module is `cloud.google.com/go` - so you should release a new version -of the `cloud.google.com/go` repository root module. Note: releasing -`cloud.google.com/go` has no impact on any of the submodules, and vice-versa. -They are released entirely independently. - -# Test failures - -If there are any test failures in the Kokoro build, releases are blocked until -the failures have been resolved. - -# How to release `cloud.google.com/go` - -1. Check for failures in the - [continuous Kokoro build](http://go/google-cloud-go-continuous). If there are any - failures in the most recent build, address them before proceeding with the - release. -1. Navigate to `~/code/gocloud/` and switch to master. -1. `git pull` -1. Run `git tag -l | grep -v beta | grep -v alpha` to see all existing releases. - The current latest tag `$CV` is the largest tag. It should look something - like `vX.Y.Z` (note: ignore all `LIB/vX.Y.Z` tags - these are tags for a - specific library, not the module root). We'll call the current version `$CV` - and the new version `$NV`. -1. On master, run `git log $CV...` to list all the changes since the last - release. NOTE: You must manually visually parse out changes to submodules [1] - (the `git log` is going to show you things in submodules, which are not going - to be part of your release). -1. Edit `CHANGES.md` to include a summary of the changes. -1. `cd internal/version && go generate && cd -` -1. Commit the changes, push to your fork, and create a PR. -1. Wait for the PR to be reviewed and merged. Once it's merged, and without - merging any other PRs in the meantime: - a. Switch to master. - b. `git pull` - c. Tag the repo with the next version: `git tag $NV`. - d. Push the tag to origin: - `git push origin $NV` -2. Update [the releases page](https://github.com/googleapis/google-cloud-go/releases) - with the new release, copying the contents of `CHANGES.md`. - -# How to release a submodule - -We have several submodules, including `cloud.google.com/go/logging`, -`cloud.google.com/go/datastore`, and so on. - -To release a submodule: - -(these instructions assume we're releasing `cloud.google.com/go/datastore` - adjust accordingly) - -1. Check for failures in the - [continuous Kokoro build](http://go/google-cloud-go-continuous). If there are any - failures in the most recent build, address them before proceeding with the - release. (This applies even if the failures are in a different submodule from the one - being released.) -1. Navigate to `~/code/gocloud/` and switch to master. -1. `git pull` -1. Run `git tag -l | grep datastore | grep -v beta | grep -v alpha` to see all - existing releases. The current latest tag `$CV` is the largest tag. It - should look something like `datastore/vX.Y.Z`. We'll call the current version - `$CV` and the new version `$NV`. -1. On master, run `git log $CV.. -- datastore/` to list all the changes to the - submodule directory since the last release. -1. Edit `datastore/CHANGES.md` to include a summary of the changes. -1. `cd internal/version && go generate && cd -` -1. Commit the changes, push to your fork, and create a PR. -1. Wait for the PR to be reviewed and merged. Once it's merged, and without - merging any other PRs in the meantime: - a. Switch to master. - b. `git pull` - c. Tag the repo with the next version: `git tag $NV`. - d. Push the tag to origin: - `git push origin $NV` -1. Update [the releases page](https://github.com/googleapis/google-cloud-go/releases) - with the new release, copying the contents of `datastore/CHANGES.md`. - -# Appendix - -1: This should get better as submodule tooling matures. diff --git a/ibm/vendor/cloud.google.com/go/compute/metadata/metadata.go b/ibm/vendor/cloud.google.com/go/compute/metadata/metadata.go deleted file mode 100644 index 545bd9d379..0000000000 --- a/ibm/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 metadata provides access to Google Compute Engine (GCE) -// metadata and API service accounts. -// -// This package is a wrapper around the GCE metadata service, -// as documented at https://developers.google.com/compute/docs/metadata. -package metadata // import "cloud.google.com/go/compute/metadata" - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "runtime" - "strings" - "sync" - "time" -) - -const ( - // metadataIP is the documented metadata server IP address. - metadataIP = "169.254.169.254" - - // metadataHostEnv is the environment variable specifying the - // GCE metadata hostname. If empty, the default value of - // metadataIP ("169.254.169.254") is used instead. - // This is variable name is not defined by any spec, as far as - // I know; it was made up for the Go package. - metadataHostEnv = "GCE_METADATA_HOST" - - userAgent = "gcloud-golang/0.1" -) - -type cachedValue struct { - k string - trim bool - mu sync.Mutex - v string -} - -var ( - projID = &cachedValue{k: "project/project-id", trim: true} - projNum = &cachedValue{k: "project/numeric-project-id", trim: true} - instID = &cachedValue{k: "instance/id", trim: true} -) - -var defaultClient = &Client{hc: &http.Client{ - Transport: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 2 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - }, -}} - -// NotDefinedError is returned when requested metadata is not defined. -// -// The underlying string is the suffix after "/computeMetadata/v1/". -// -// This error is not returned if the value is defined to be the empty -// string. -type NotDefinedError string - -func (suffix NotDefinedError) Error() string { - return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix)) -} - -func (c *cachedValue) get(cl *Client) (v string, err error) { - defer c.mu.Unlock() - c.mu.Lock() - if c.v != "" { - return c.v, nil - } - if c.trim { - v, err = cl.getTrimmed(c.k) - } else { - v, err = cl.Get(c.k) - } - if err == nil { - c.v = v - } - return -} - -var ( - onGCEOnce sync.Once - onGCE bool -) - -// OnGCE reports whether this process is running on Google Compute Engine. -func OnGCE() bool { - onGCEOnce.Do(initOnGCE) - return onGCE -} - -func initOnGCE() { - onGCE = testOnGCE() -} - -func testOnGCE() bool { - // The user explicitly said they're on GCE, so trust them. - if os.Getenv(metadataHostEnv) != "" { - return true - } - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - resc := make(chan bool, 2) - - // Try two strategies in parallel. - // See https://github.com/googleapis/google-cloud-go/issues/194 - go func() { - req, _ := http.NewRequest("GET", "http://"+metadataIP, nil) - req.Header.Set("User-Agent", userAgent) - res, err := defaultClient.hc.Do(req.WithContext(ctx)) - if err != nil { - resc <- false - return - } - defer res.Body.Close() - resc <- res.Header.Get("Metadata-Flavor") == "Google" - }() - - go func() { - addrs, err := net.DefaultResolver.LookupHost(ctx, "metadata.google.internal") - if err != nil || len(addrs) == 0 { - resc <- false - return - } - resc <- strsContains(addrs, metadataIP) - }() - - tryHarder := systemInfoSuggestsGCE() - if tryHarder { - res := <-resc - if res { - // The first strategy succeeded, so let's use it. - return true - } - // Wait for either the DNS or metadata server probe to - // contradict the other one and say we are running on - // GCE. Give it a lot of time to do so, since the system - // info already suggests we're running on a GCE BIOS. - timer := time.NewTimer(5 * time.Second) - defer timer.Stop() - select { - case res = <-resc: - return res - case <-timer.C: - // Too slow. Who knows what this system is. - return false - } - } - - // There's no hint from the system info that we're running on - // GCE, so use the first probe's result as truth, whether it's - // true or false. The goal here is to optimize for speed for - // users who are NOT running on GCE. We can't assume that - // either a DNS lookup or an HTTP request to a blackholed IP - // address is fast. Worst case this should return when the - // metaClient's Transport.ResponseHeaderTimeout or - // Transport.Dial.Timeout fires (in two seconds). - return <-resc -} - -// systemInfoSuggestsGCE reports whether the local system (without -// doing network requests) suggests that we're running on GCE. If this -// returns true, testOnGCE tries a bit harder to reach its metadata -// server. -func systemInfoSuggestsGCE() bool { - if runtime.GOOS != "linux" { - // We don't have any non-Linux clues available, at least yet. - return false - } - slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") - name := strings.TrimSpace(string(slurp)) - return name == "Google" || name == "Google Compute Engine" -} - -// Subscribe calls Client.Subscribe on the default client. -func Subscribe(suffix string, fn func(v string, ok bool) error) error { - return defaultClient.Subscribe(suffix, fn) -} - -// Get calls Client.Get on the default client. -func Get(suffix string) (string, error) { return defaultClient.Get(suffix) } - -// ProjectID returns the current instance's project ID string. -func ProjectID() (string, error) { return defaultClient.ProjectID() } - -// NumericProjectID returns the current instance's numeric project ID. -func NumericProjectID() (string, error) { return defaultClient.NumericProjectID() } - -// InternalIP returns the instance's primary internal IP address. -func InternalIP() (string, error) { return defaultClient.InternalIP() } - -// ExternalIP returns the instance's primary external (public) IP address. -func ExternalIP() (string, error) { return defaultClient.ExternalIP() } - -// Email calls Client.Email on the default client. -func Email(serviceAccount string) (string, error) { return defaultClient.Email(serviceAccount) } - -// Hostname returns the instance's hostname. This will be of the form -// ".c..internal". -func Hostname() (string, error) { return defaultClient.Hostname() } - -// InstanceTags returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func InstanceTags() ([]string, error) { return defaultClient.InstanceTags() } - -// InstanceID returns the current VM's numeric instance ID. -func InstanceID() (string, error) { return defaultClient.InstanceID() } - -// InstanceName returns the current VM's instance ID string. -func InstanceName() (string, error) { return defaultClient.InstanceName() } - -// Zone returns the current VM's zone, such as "us-central1-b". -func Zone() (string, error) { return defaultClient.Zone() } - -// InstanceAttributes calls Client.InstanceAttributes on the default client. -func InstanceAttributes() ([]string, error) { return defaultClient.InstanceAttributes() } - -// ProjectAttributes calls Client.ProjectAttributes on the default client. -func ProjectAttributes() ([]string, error) { return defaultClient.ProjectAttributes() } - -// InstanceAttributeValue calls Client.InstanceAttributeValue on the default client. -func InstanceAttributeValue(attr string) (string, error) { - return defaultClient.InstanceAttributeValue(attr) -} - -// ProjectAttributeValue calls Client.ProjectAttributeValue on the default client. -func ProjectAttributeValue(attr string) (string, error) { - return defaultClient.ProjectAttributeValue(attr) -} - -// Scopes calls Client.Scopes on the default client. -func Scopes(serviceAccount string) ([]string, error) { return defaultClient.Scopes(serviceAccount) } - -func strsContains(ss []string, s string) bool { - for _, v := range ss { - if v == s { - return true - } - } - return false -} - -// A Client provides metadata. -type Client struct { - hc *http.Client -} - -// NewClient returns a Client that can be used to fetch metadata. -// Returns the client that uses the specified http.Client for HTTP requests. -// If nil is specified, returns the default client. -func NewClient(c *http.Client) *Client { - if c == nil { - return defaultClient - } - - return &Client{hc: c} -} - -// getETag returns a value from the metadata service as well as the associated ETag. -// This func is otherwise equivalent to Get. -func (c *Client) getETag(suffix string) (value, etag string, err error) { - // Using a fixed IP makes it very difficult to spoof the metadata service in - // a container, which is an important use-case for local testing of cloud - // deployments. To enable spoofing of the metadata service, the environment - // variable GCE_METADATA_HOST is first inspected to decide where metadata - // requests shall go. - host := os.Getenv(metadataHostEnv) - if host == "" { - // Using 169.254.169.254 instead of "metadata" here because Go - // binaries built with the "netgo" tag and without cgo won't - // know the search suffix for "metadata" is - // ".google.internal", and this IP address is documented as - // being stable anyway. - host = metadataIP - } - suffix = strings.TrimLeft(suffix, "/") - u := "http://" + host + "/computeMetadata/v1/" + suffix - req, err := http.NewRequest("GET", u, nil) - if err != nil { - return "", "", err - } - req.Header.Set("Metadata-Flavor", "Google") - req.Header.Set("User-Agent", userAgent) - res, err := c.hc.Do(req) - if err != nil { - return "", "", err - } - defer res.Body.Close() - if res.StatusCode == http.StatusNotFound { - return "", "", NotDefinedError(suffix) - } - all, err := ioutil.ReadAll(res.Body) - if err != nil { - return "", "", err - } - if res.StatusCode != 200 { - return "", "", &Error{Code: res.StatusCode, Message: string(all)} - } - return string(all), res.Header.Get("Etag"), nil -} - -// Get returns a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// -// If the GCE_METADATA_HOST environment variable is not defined, a default of -// 169.254.169.254 will be used instead. -// -// If the requested metadata is not defined, the returned error will -// be of type NotDefinedError. -func (c *Client) Get(suffix string) (string, error) { - val, _, err := c.getETag(suffix) - return val, err -} - -func (c *Client) getTrimmed(suffix string) (s string, err error) { - s, err = c.Get(suffix) - s = strings.TrimSpace(s) - return -} - -func (c *Client) lines(suffix string) ([]string, error) { - j, err := c.Get(suffix) - if err != nil { - return nil, err - } - s := strings.Split(strings.TrimSpace(j), "\n") - for i := range s { - s[i] = strings.TrimSpace(s[i]) - } - return s, nil -} - -// ProjectID returns the current instance's project ID string. -func (c *Client) ProjectID() (string, error) { return projID.get(c) } - -// NumericProjectID returns the current instance's numeric project ID. -func (c *Client) NumericProjectID() (string, error) { return projNum.get(c) } - -// InstanceID returns the current VM's numeric instance ID. -func (c *Client) InstanceID() (string, error) { return instID.get(c) } - -// InternalIP returns the instance's primary internal IP address. -func (c *Client) InternalIP() (string, error) { - return c.getTrimmed("instance/network-interfaces/0/ip") -} - -// Email returns the email address associated with the service account. -// The account may be empty or the string "default" to use the instance's -// main account. -func (c *Client) Email(serviceAccount string) (string, error) { - if serviceAccount == "" { - serviceAccount = "default" - } - return c.getTrimmed("instance/service-accounts/" + serviceAccount + "/email") -} - -// ExternalIP returns the instance's primary external (public) IP address. -func (c *Client) ExternalIP() (string, error) { - return c.getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip") -} - -// Hostname returns the instance's hostname. This will be of the form -// ".c..internal". -func (c *Client) Hostname() (string, error) { - return c.getTrimmed("instance/hostname") -} - -// InstanceTags returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func (c *Client) InstanceTags() ([]string, error) { - var s []string - j, err := c.Get("instance/tags") - if err != nil { - return nil, err - } - if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil { - return nil, err - } - return s, nil -} - -// InstanceName returns the current VM's instance ID string. -func (c *Client) InstanceName() (string, error) { - return c.getTrimmed("instance/name") -} - -// Zone returns the current VM's zone, such as "us-central1-b". -func (c *Client) Zone() (string, error) { - zone, err := c.getTrimmed("instance/zone") - // zone is of the form "projects//zones/". - if err != nil { - return "", err - } - return zone[strings.LastIndex(zone, "/")+1:], nil -} - -// InstanceAttributes returns the list of user-defined attributes, -// assigned when initially creating a GCE VM instance. The value of an -// attribute can be obtained with InstanceAttributeValue. -func (c *Client) InstanceAttributes() ([]string, error) { return c.lines("instance/attributes/") } - -// ProjectAttributes returns the list of user-defined attributes -// applying to the project as a whole, not just this VM. The value of -// an attribute can be obtained with ProjectAttributeValue. -func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project/attributes/") } - -// InstanceAttributeValue returns the value of the provided VM -// instance attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// InstanceAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func (c *Client) InstanceAttributeValue(attr string) (string, error) { - return c.Get("instance/attributes/" + attr) -} - -// ProjectAttributeValue returns the value of the provided -// project attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// ProjectAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func (c *Client) ProjectAttributeValue(attr string) (string, error) { - return c.Get("project/attributes/" + attr) -} - -// Scopes returns the service account scopes for the given account. -// The account may be empty or the string "default" to use the instance's -// main account. -func (c *Client) Scopes(serviceAccount string) ([]string, error) { - if serviceAccount == "" { - serviceAccount = "default" - } - return c.lines("instance/service-accounts/" + serviceAccount + "/scopes") -} - -// Subscribe subscribes to a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// The suffix may contain query parameters. -// -// Subscribe calls fn with the latest metadata value indicated by the provided -// suffix. If the metadata value is deleted, fn is called with the empty string -// and ok false. Subscribe blocks until fn returns a non-nil error or the value -// is deleted. Subscribe returns the error value returned from the last call to -// fn, which may be nil when ok == false. -func (c *Client) Subscribe(suffix string, fn func(v string, ok bool) error) error { - const failedSubscribeSleep = time.Second * 5 - - // First check to see if the metadata value exists at all. - val, lastETag, err := c.getETag(suffix) - if err != nil { - return err - } - - if err := fn(val, true); err != nil { - return err - } - - ok := true - if strings.ContainsRune(suffix, '?') { - suffix += "&wait_for_change=true&last_etag=" - } else { - suffix += "?wait_for_change=true&last_etag=" - } - for { - val, etag, err := c.getETag(suffix + url.QueryEscape(lastETag)) - if err != nil { - if _, deleted := err.(NotDefinedError); !deleted { - time.Sleep(failedSubscribeSleep) - continue // Retry on other errors. - } - ok = false - } - lastETag = etag - - if err := fn(val, ok); err != nil || !ok { - return err - } - } -} - -// Error contains an error response from the server. -type Error struct { - // Code is the HTTP response status code. - Code int - // Message is the server response message. - Message string -} - -func (e *Error) Error() string { - return fmt.Sprintf("compute: Received %d `%s`", e.Code, e.Message) -} diff --git a/ibm/vendor/cloud.google.com/go/doc.go b/ibm/vendor/cloud.google.com/go/doc.go deleted file mode 100644 index 237d84561c..0000000000 --- a/ibm/vendor/cloud.google.com/go/doc.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 cloud is the root of the packages used to access Google Cloud -Services. See https://godoc.org/cloud.google.com/go for a full list -of sub-packages. - - -Client Options - -All clients in sub-packages are configurable via client options. These options are -described here: https://godoc.org/google.golang.org/api/option. - - -Authentication and Authorization - -All the clients in sub-packages support authentication via Google Application Default -Credentials (see https://cloud.google.com/docs/authentication/production), or -by providing a JSON key file for a Service Account. See the authentication examples -in this package for details. - - -Timeouts and Cancellation - -By default, all requests in sub-packages will run indefinitely, retrying on transient -errors when correctness allows. To set timeouts or arrange for cancellation, use -contexts. See the examples for details. - -Do not attempt to control the initial connection (dialing) of a service by setting a -timeout on the context passed to NewClient. Dialing is non-blocking, so timeouts -would be ineffective and would only interfere with credential refreshing, which uses -the same context. - - -Connection Pooling - -Connection pooling differs in clients based on their transport. Cloud -clients either rely on HTTP or gRPC transports to communicate -with Google Cloud. - -Cloud clients that use HTTP (bigquery, compute, storage, and translate) rely on the -underlying HTTP transport to cache connections for later re-use. These are cached to -the default http.MaxIdleConns and http.MaxIdleConnsPerHost settings in -http.DefaultTransport. - -For gRPC clients (all others in this repo), connection pooling is configurable. Users -of cloud client libraries may specify option.WithGRPCConnectionPool(n) as a client -option to NewClient calls. This configures the underlying gRPC connections to be -pooled and addressed in a round robin fashion. - - -Using the Libraries with Docker - -Minimal docker images like Alpine lack CA certificates. This causes RPCs to appear to -hang, because gRPC retries indefinitely. See https://github.com/googleapis/google-cloud-go/issues/928 -for more information. - - -Debugging - -To see gRPC logs, set the environment variable GRPC_GO_LOG_SEVERITY_LEVEL. See -https://godoc.org/google.golang.org/grpc/grpclog for more information. - -For HTTP logging, set the GODEBUG environment variable to "http2debug=1" or "http2debug=2". - - -Client Stability - -Clients in this repository are considered alpha or beta unless otherwise -marked as stable in the README.md. Semver is not used to communicate stability -of clients. - -Alpha and beta clients may change or go away without notice. - -Clients marked stable will maintain compatibility with future versions for as -long as we can reasonably sustain. Incompatible changes might be made in some -situations, including: - -- Security bugs may prompt backwards-incompatible changes. - -- Situations in which components are no longer feasible to maintain without -making breaking changes, including removal. - -- Parts of the client surface may be outright unstable and subject to change. -These parts of the surface will be labeled with the note, "It is EXPERIMENTAL -and subject to change or removal without notice." -*/ -package cloud // import "cloud.google.com/go" diff --git a/ibm/vendor/cloud.google.com/go/iam/iam.go b/ibm/vendor/cloud.google.com/go/iam/iam.go deleted file mode 100644 index 0a06ea2e84..0000000000 --- a/ibm/vendor/cloud.google.com/go/iam/iam.go +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 iam supports the resource-specific operations of Google Cloud -// IAM (Identity and Access Management) for the Google Cloud Libraries. -// See https://cloud.google.com/iam for more about IAM. -// -// Users of the Google Cloud Libraries will typically not use this package -// directly. Instead they will begin with some resource that supports IAM, like -// a pubsub topic, and call its IAM method to get a Handle for that resource. -package iam - -import ( - "context" - "fmt" - "time" - - gax "github.com/googleapis/gax-go/v2" - pb "google.golang.org/genproto/googleapis/iam/v1" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" -) - -// client abstracts the IAMPolicy API to allow multiple implementations. -type client interface { - Get(ctx context.Context, resource string) (*pb.Policy, error) - Set(ctx context.Context, resource string, p *pb.Policy) error - Test(ctx context.Context, resource string, perms []string) ([]string, error) - GetWithVersion(ctx context.Context, resource string, requestedPolicyVersion int32) (*pb.Policy, error) -} - -// grpcClient implements client for the standard gRPC-based IAMPolicy service. -type grpcClient struct { - c pb.IAMPolicyClient -} - -var withRetry = gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.DeadlineExceeded, - codes.Unavailable, - }, gax.Backoff{ - Initial: 100 * time.Millisecond, - Max: 60 * time.Second, - Multiplier: 1.3, - }) -}) - -func (g *grpcClient) Get(ctx context.Context, resource string) (*pb.Policy, error) { - return g.GetWithVersion(ctx, resource, 1) -} - -func (g *grpcClient) GetWithVersion(ctx context.Context, resource string, requestedPolicyVersion int32) (*pb.Policy, error) { - var proto *pb.Policy - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", resource)) - ctx = insertMetadata(ctx, md) - - err := gax.Invoke(ctx, func(ctx context.Context, _ gax.CallSettings) error { - var err error - proto, err = g.c.GetIamPolicy(ctx, &pb.GetIamPolicyRequest{ - Resource: resource, - Options: &pb.GetPolicyOptions{ - RequestedPolicyVersion: requestedPolicyVersion, - }, - }) - return err - }, withRetry) - if err != nil { - return nil, err - } - return proto, nil -} - -func (g *grpcClient) Set(ctx context.Context, resource string, p *pb.Policy) error { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", resource)) - ctx = insertMetadata(ctx, md) - - return gax.Invoke(ctx, func(ctx context.Context, _ gax.CallSettings) error { - _, err := g.c.SetIamPolicy(ctx, &pb.SetIamPolicyRequest{ - Resource: resource, - Policy: p, - }) - return err - }, withRetry) -} - -func (g *grpcClient) Test(ctx context.Context, resource string, perms []string) ([]string, error) { - var res *pb.TestIamPermissionsResponse - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "resource", resource)) - ctx = insertMetadata(ctx, md) - - err := gax.Invoke(ctx, func(ctx context.Context, _ gax.CallSettings) error { - var err error - res, err = g.c.TestIamPermissions(ctx, &pb.TestIamPermissionsRequest{ - Resource: resource, - Permissions: perms, - }) - return err - }, withRetry) - if err != nil { - return nil, err - } - return res.Permissions, nil -} - -// A Handle provides IAM operations for a resource. -type Handle struct { - c client - resource string -} - -// A Handle3 provides IAM operations for a resource. It is similar to a Handle, but provides access to newer IAM features (e.g., conditions). -type Handle3 struct { - c client - resource string - version int32 -} - -// InternalNewHandle is for use by the Google Cloud Libraries only. -// -// InternalNewHandle returns a Handle for resource. -// The conn parameter refers to a server that must support the IAMPolicy service. -func InternalNewHandle(conn grpc.ClientConnInterface, resource string) *Handle { - return InternalNewHandleGRPCClient(pb.NewIAMPolicyClient(conn), resource) -} - -// InternalNewHandleGRPCClient is for use by the Google Cloud Libraries only. -// -// InternalNewHandleClient returns a Handle for resource using the given -// grpc service that implements IAM as a mixin -func InternalNewHandleGRPCClient(c pb.IAMPolicyClient, resource string) *Handle { - return InternalNewHandleClient(&grpcClient{c: c}, resource) -} - -// InternalNewHandleClient is for use by the Google Cloud Libraries only. -// -// InternalNewHandleClient returns a Handle for resource using the given -// client implementation. -func InternalNewHandleClient(c client, resource string) *Handle { - return &Handle{ - c: c, - resource: resource, - } -} - -// V3 returns a Handle3, which is like Handle except it sets -// requestedPolicyVersion to 3 when retrieving a policy and policy.version to 3 -// when storing a policy. -func (h *Handle) V3() *Handle3 { - return &Handle3{ - c: h.c, - resource: h.resource, - version: 3, - } -} - -// Policy retrieves the IAM policy for the resource. -func (h *Handle) Policy(ctx context.Context) (*Policy, error) { - proto, err := h.c.Get(ctx, h.resource) - if err != nil { - return nil, err - } - return &Policy{InternalProto: proto}, nil -} - -// SetPolicy replaces the resource's current policy with the supplied Policy. -// -// If policy was created from a prior call to Get, then the modification will -// only succeed if the policy has not changed since the Get. -func (h *Handle) SetPolicy(ctx context.Context, policy *Policy) error { - return h.c.Set(ctx, h.resource, policy.InternalProto) -} - -// TestPermissions returns the subset of permissions that the caller has on the resource. -func (h *Handle) TestPermissions(ctx context.Context, permissions []string) ([]string, error) { - return h.c.Test(ctx, h.resource, permissions) -} - -// A RoleName is a name representing a collection of permissions. -type RoleName string - -// Common role names. -const ( - Owner RoleName = "roles/owner" - Editor RoleName = "roles/editor" - Viewer RoleName = "roles/viewer" -) - -const ( - // AllUsers is a special member that denotes all users, even unauthenticated ones. - AllUsers = "allUsers" - - // AllAuthenticatedUsers is a special member that denotes all authenticated users. - AllAuthenticatedUsers = "allAuthenticatedUsers" -) - -// A Policy is a list of Bindings representing roles -// granted to members. -// -// The zero Policy is a valid policy with no bindings. -type Policy struct { - // TODO(jba): when type aliases are available, put Policy into an internal package - // and provide an exported alias here. - - // This field is exported for use by the Google Cloud Libraries only. - // It may become unexported in a future release. - InternalProto *pb.Policy -} - -// Members returns the list of members with the supplied role. -// The return value should not be modified. Use Add and Remove -// to modify the members of a role. -func (p *Policy) Members(r RoleName) []string { - b := p.binding(r) - if b == nil { - return nil - } - return b.Members -} - -// HasRole reports whether member has role r. -func (p *Policy) HasRole(member string, r RoleName) bool { - return memberIndex(member, p.binding(r)) >= 0 -} - -// Add adds member member to role r if it is not already present. -// A new binding is created if there is no binding for the role. -func (p *Policy) Add(member string, r RoleName) { - b := p.binding(r) - if b == nil { - if p.InternalProto == nil { - p.InternalProto = &pb.Policy{} - } - p.InternalProto.Bindings = append(p.InternalProto.Bindings, &pb.Binding{ - Role: string(r), - Members: []string{member}, - }) - return - } - if memberIndex(member, b) < 0 { - b.Members = append(b.Members, member) - return - } -} - -// Remove removes member from role r if it is present. -func (p *Policy) Remove(member string, r RoleName) { - bi := p.bindingIndex(r) - if bi < 0 { - return - } - bindings := p.InternalProto.Bindings - b := bindings[bi] - mi := memberIndex(member, b) - if mi < 0 { - return - } - // Order doesn't matter for bindings or members, so to remove, move the last item - // into the removed spot and shrink the slice. - if len(b.Members) == 1 { - // Remove binding. - last := len(bindings) - 1 - bindings[bi] = bindings[last] - bindings[last] = nil - p.InternalProto.Bindings = bindings[:last] - return - } - // Remove member. - // TODO(jba): worry about multiple copies of m? - last := len(b.Members) - 1 - b.Members[mi] = b.Members[last] - b.Members[last] = "" - b.Members = b.Members[:last] -} - -// Roles returns the names of all the roles that appear in the Policy. -func (p *Policy) Roles() []RoleName { - if p.InternalProto == nil { - return nil - } - var rns []RoleName - for _, b := range p.InternalProto.Bindings { - rns = append(rns, RoleName(b.Role)) - } - return rns -} - -// binding returns the Binding for the suppied role, or nil if there isn't one. -func (p *Policy) binding(r RoleName) *pb.Binding { - i := p.bindingIndex(r) - if i < 0 { - return nil - } - return p.InternalProto.Bindings[i] -} - -func (p *Policy) bindingIndex(r RoleName) int { - if p.InternalProto == nil { - return -1 - } - for i, b := range p.InternalProto.Bindings { - if b.Role == string(r) { - return i - } - } - return -1 -} - -// memberIndex returns the index of m in b's Members, or -1 if not found. -func memberIndex(m string, b *pb.Binding) int { - if b == nil { - return -1 - } - for i, mm := range b.Members { - if mm == m { - return i - } - } - return -1 -} - -// insertMetadata inserts metadata into the given context -func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { - out, _ := metadata.FromOutgoingContext(ctx) - out = out.Copy() - for _, md := range mds { - for k, v := range md { - out[k] = append(out[k], v...) - } - } - return metadata.NewOutgoingContext(ctx, out) -} - -// A Policy3 is a list of Bindings representing roles granted to members. -// -// The zero Policy3 is a valid policy with no bindings. -// -// It is similar to a Policy, except a Policy3 provides direct access to the -// list of Bindings. -// -// The policy version is always set to 3. -type Policy3 struct { - etag []byte - Bindings []*pb.Binding -} - -// Policy retrieves the IAM policy for the resource. -// -// requestedPolicyVersion is always set to 3. -func (h *Handle3) Policy(ctx context.Context) (*Policy3, error) { - proto, err := h.c.GetWithVersion(ctx, h.resource, h.version) - if err != nil { - return nil, err - } - return &Policy3{ - Bindings: proto.Bindings, - etag: proto.Etag, - }, nil -} - -// SetPolicy replaces the resource's current policy with the supplied Policy. -// -// If policy was created from a prior call to Get, then the modification will -// only succeed if the policy has not changed since the Get. -func (h *Handle3) SetPolicy(ctx context.Context, policy *Policy3) error { - return h.c.Set(ctx, h.resource, &pb.Policy{ - Bindings: policy.Bindings, - Etag: policy.etag, - Version: h.version, - }) -} - -// TestPermissions returns the subset of permissions that the caller has on the resource. -func (h *Handle3) TestPermissions(ctx context.Context, permissions []string) ([]string, error) { - return h.c.Test(ctx, h.resource, permissions) -} diff --git a/ibm/vendor/cloud.google.com/go/internal/.repo-metadata-full.json b/ibm/vendor/cloud.google.com/go/internal/.repo-metadata-full.json deleted file mode 100644 index 536f89cb36..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/.repo-metadata-full.json +++ /dev/null @@ -1,826 +0,0 @@ -{ - "cloud.google.com/go/analytics/admin/apiv1alpha": { - "distribution_name": "cloud.google.com/go/analytics/admin/apiv1alpha", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/analytics/admin/apiv1alpha", - "release_level": "alpha" - }, - "cloud.google.com/go/asset/apiv1": { - "distribution_name": "cloud.google.com/go/asset/apiv1", - "description": "Cloud Asset API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/asset/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/asset/apiv1beta1": { - "distribution_name": "cloud.google.com/go/asset/apiv1beta1", - "description": "Cloud Asset API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/asset/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/asset/apiv1p2beta1": { - "distribution_name": "cloud.google.com/go/asset/apiv1p2beta1", - "description": "Cloud Asset API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/asset/apiv1p2beta1", - "release_level": "beta" - }, - "cloud.google.com/go/asset/apiv1p5beta1": { - "distribution_name": "cloud.google.com/go/asset/apiv1p5beta1", - "description": "Cloud Asset API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/asset/apiv1p5beta1", - "release_level": "beta" - }, - "cloud.google.com/go/automl/apiv1": { - "distribution_name": "cloud.google.com/go/automl/apiv1", - "description": "Cloud AutoML API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/automl/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/automl/apiv1beta1": { - "distribution_name": "cloud.google.com/go/automl/apiv1beta1", - "description": "Cloud AutoML API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/automl/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/bigquery": { - "distribution_name": "cloud.google.com/go/bigquery", - "description": "BigQuery", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery", - "release_level": "ga" - }, - "cloud.google.com/go/bigquery/connection/apiv1": { - "distribution_name": "cloud.google.com/go/bigquery/connection/apiv1", - "description": "BigQuery Connection API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/connection/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/bigquery/connection/apiv1beta1": { - "distribution_name": "cloud.google.com/go/bigquery/connection/apiv1beta1", - "description": "BigQuery Connection API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/connection/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/bigquery/datatransfer/apiv1": { - "distribution_name": "cloud.google.com/go/bigquery/datatransfer/apiv1", - "description": "BigQuery Data Transfer API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/datatransfer/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/bigquery/reservation/apiv1": { - "distribution_name": "cloud.google.com/go/bigquery/reservation/apiv1", - "description": "BigQuery Reservation API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/reservation/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/bigquery/reservation/apiv1beta1": { - "distribution_name": "cloud.google.com/go/bigquery/reservation/apiv1beta1", - "description": "BigQuery Reservation API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/reservation/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/bigquery/storage/apiv1": { - "distribution_name": "cloud.google.com/go/bigquery/storage/apiv1", - "description": "BigQuery Storage API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/storage/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/bigquery/storage/apiv1alpha2": { - "distribution_name": "cloud.google.com/go/bigquery/storage/apiv1alpha2", - "description": "BigQuery Storage API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/storage/apiv1alpha2", - "release_level": "alpha" - }, - "cloud.google.com/go/bigquery/storage/apiv1beta1": { - "distribution_name": "cloud.google.com/go/bigquery/storage/apiv1beta1", - "description": "BigQuery Storage API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/storage/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/bigquery/storage/apiv1beta2": { - "distribution_name": "cloud.google.com/go/bigquery/storage/apiv1beta2", - "description": "BigQuery Storage API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigquery/storage/apiv1beta2", - "release_level": "beta" - }, - "cloud.google.com/go/bigtable": { - "distribution_name": "cloud.google.com/go/bigtable", - "description": "Cloud BigTable", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/bigtable", - "release_level": "ga" - }, - "cloud.google.com/go/billing/apiv1": { - "distribution_name": "cloud.google.com/go/billing/apiv1", - "description": "Cloud Billing API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/billing/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/billing/budgets/apiv1beta1": { - "distribution_name": "cloud.google.com/go/billing/budgets/apiv1beta1", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/billing/budgets/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/cloudbuild/apiv1/v2": { - "distribution_name": "cloud.google.com/go/cloudbuild/apiv1/v2", - "description": "Cloud Build API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/cloudbuild/apiv1/v2", - "release_level": "ga" - }, - "cloud.google.com/go/cloudtasks/apiv2": { - "distribution_name": "cloud.google.com/go/cloudtasks/apiv2", - "description": "Cloud Tasks API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/cloudtasks/apiv2", - "release_level": "ga" - }, - "cloud.google.com/go/cloudtasks/apiv2beta2": { - "distribution_name": "cloud.google.com/go/cloudtasks/apiv2beta2", - "description": "Cloud Tasks API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/cloudtasks/apiv2beta2", - "release_level": "beta" - }, - "cloud.google.com/go/cloudtasks/apiv2beta3": { - "distribution_name": "cloud.google.com/go/cloudtasks/apiv2beta3", - "description": "Cloud Tasks API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/cloudtasks/apiv2beta3", - "release_level": "beta" - }, - "cloud.google.com/go/container/apiv1": { - "distribution_name": "cloud.google.com/go/container/apiv1", - "description": "Kubernetes Engine API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/container/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/containeranalysis/apiv1beta1": { - "distribution_name": "cloud.google.com/go/containeranalysis/apiv1beta1", - "description": "Container Analysis API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/containeranalysis/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/datacatalog/apiv1": { - "distribution_name": "cloud.google.com/go/datacatalog/apiv1", - "description": "Google Cloud Data Catalog API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/datacatalog/apiv1beta1": { - "distribution_name": "cloud.google.com/go/datacatalog/apiv1beta1", - "description": "Google Cloud Data Catalog API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/dataproc/apiv1": { - "distribution_name": "cloud.google.com/go/dataproc/apiv1", - "description": "Cloud Dataproc API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/dataproc/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/dataproc/apiv1beta2": { - "distribution_name": "cloud.google.com/go/dataproc/apiv1beta2", - "description": "Cloud Dataproc API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/dataproc/apiv1beta2", - "release_level": "beta" - }, - "cloud.google.com/go/datastore": { - "distribution_name": "cloud.google.com/go/datastore", - "description": "Cloud Datastore", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/datastore", - "release_level": "ga" - }, - "cloud.google.com/go/datastore/admin/apiv1": { - "distribution_name": "cloud.google.com/go/datastore/admin/apiv1", - "description": "Cloud Datastore API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/datastore/admin/apiv1", - "release_level": "alpha" - }, - "cloud.google.com/go/debugger/apiv2": { - "distribution_name": "cloud.google.com/go/debugger/apiv2", - "description": "Stackdriver Debugger API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/debugger/apiv2", - "release_level": "ga" - }, - "cloud.google.com/go/dialogflow/apiv2": { - "distribution_name": "cloud.google.com/go/dialogflow/apiv2", - "description": "Dialogflow API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/dialogflow/apiv2", - "release_level": "ga" - }, - "cloud.google.com/go/dlp/apiv2": { - "distribution_name": "cloud.google.com/go/dlp/apiv2", - "description": "Cloud Data Loss Prevention (DLP) API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/dlp/apiv2", - "release_level": "ga" - }, - "cloud.google.com/go/errorreporting": { - "distribution_name": "cloud.google.com/go/errorreporting", - "description": "Stackdriver Error Reporting API", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/errorreporting", - "release_level": "beta" - }, - "cloud.google.com/go/errorreporting/apiv1beta1": { - "distribution_name": "cloud.google.com/go/errorreporting/apiv1beta1", - "description": "Stackdriver Error Reporting API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/errorreporting/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/firestore": { - "distribution_name": "cloud.google.com/go/firestore", - "description": "Cloud Firestore API", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/firestore", - "release_level": "ga" - }, - "cloud.google.com/go/firestore/apiv1": { - "distribution_name": "cloud.google.com/go/firestore/apiv1", - "description": "Cloud Firestore API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/firestore/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/firestore/apiv1/admin": { - "distribution_name": "cloud.google.com/go/firestore/apiv1/admin", - "description": "Google Cloud Firestore Admin API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/firestore/apiv1/admin", - "release_level": "ga" - }, - "cloud.google.com/go/functions/apiv1": { - "distribution_name": "cloud.google.com/go/functions/apiv1", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/functions/apiv1", - "release_level": "beta" - }, - "cloud.google.com/go/gaming/apiv1": { - "distribution_name": "cloud.google.com/go/gaming/apiv1", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/gaming/apiv1", - "release_level": "beta" - }, - "cloud.google.com/go/gaming/apiv1beta": { - "distribution_name": "cloud.google.com/go/gaming/apiv1beta", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/gaming/apiv1beta", - "release_level": "beta" - }, - "cloud.google.com/go/iam": { - "distribution_name": "cloud.google.com/go/iam", - "description": "Cloud IAM", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/iam", - "release_level": "ga" - }, - "cloud.google.com/go/iam/credentials/apiv1": { - "distribution_name": "cloud.google.com/go/iam/credentials/apiv1", - "description": "IAM Service Account Credentials API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/iam/credentials/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/iot/apiv1": { - "distribution_name": "cloud.google.com/go/iot/apiv1", - "description": "Cloud IoT API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/iot/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/kms/apiv1": { - "distribution_name": "cloud.google.com/go/kms/apiv1", - "description": "Cloud Key Management Service (KMS) API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/kms/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/language/apiv1": { - "distribution_name": "cloud.google.com/go/language/apiv1", - "description": "Cloud Natural Language API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/language/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/language/apiv1beta2": { - "distribution_name": "cloud.google.com/go/language/apiv1beta2", - "description": "Cloud Natural Language API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/language/apiv1beta2", - "release_level": "beta" - }, - "cloud.google.com/go/logging": { - "distribution_name": "cloud.google.com/go/logging", - "description": "Stackdriver Logging API", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/logging", - "release_level": "ga" - }, - "cloud.google.com/go/logging/apiv2": { - "distribution_name": "cloud.google.com/go/logging/apiv2", - "description": "Cloud Logging API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/logging/apiv2", - "release_level": "ga" - }, - "cloud.google.com/go/longrunning/autogen": { - "distribution_name": "cloud.google.com/go/longrunning/autogen", - "description": "Long Running Operations API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/longrunning/autogen", - "release_level": "alpha" - }, - "cloud.google.com/go/memcache/apiv1beta2": { - "distribution_name": "cloud.google.com/go/memcache/apiv1beta2", - "description": "Cloud Memorystore for Memcached API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/memcache/apiv1beta2", - "release_level": "beta" - }, - "cloud.google.com/go/monitoring/apiv3/v2": { - "distribution_name": "cloud.google.com/go/monitoring/apiv3/v2", - "description": "Cloud Monitoring API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/monitoring/apiv3/v2", - "release_level": "ga" - }, - "cloud.google.com/go/monitoring/dashboard/apiv1": { - "distribution_name": "cloud.google.com/go/monitoring/dashboard/apiv1", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/monitoring/dashboard/apiv1", - "release_level": "beta" - }, - "cloud.google.com/go/notebooks/apiv1beta1": { - "distribution_name": "cloud.google.com/go/notebooks/apiv1beta1", - "description": "Notebooks API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/notebooks/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/osconfig/agentendpoint/apiv1": { - "distribution_name": "cloud.google.com/go/osconfig/agentendpoint/apiv1", - "description": "Cloud OS Config API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/osconfig/agentendpoint/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/osconfig/agentendpoint/apiv1beta": { - "distribution_name": "cloud.google.com/go/osconfig/agentendpoint/apiv1beta", - "description": "Cloud OS Config API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/osconfig/agentendpoint/apiv1beta", - "release_level": "beta" - }, - "cloud.google.com/go/osconfig/apiv1": { - "distribution_name": "cloud.google.com/go/osconfig/apiv1", - "description": "Cloud OS Config API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/osconfig/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/osconfig/apiv1beta": { - "distribution_name": "cloud.google.com/go/osconfig/apiv1beta", - "description": "Cloud OS Config API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/osconfig/apiv1beta", - "release_level": "beta" - }, - "cloud.google.com/go/oslogin/apiv1": { - "distribution_name": "cloud.google.com/go/oslogin/apiv1", - "description": "Cloud OS Login API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/oslogin/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/oslogin/apiv1beta": { - "distribution_name": "cloud.google.com/go/oslogin/apiv1beta", - "description": "Cloud OS Login API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/oslogin/apiv1beta", - "release_level": "beta" - }, - "cloud.google.com/go/phishingprotection/apiv1beta1": { - "distribution_name": "cloud.google.com/go/phishingprotection/apiv1beta1", - "description": "Phishing Protection API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/phishingprotection/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/policytroubleshooter/apiv1": { - "distribution_name": "cloud.google.com/go/policytroubleshooter/apiv1", - "description": "Policy Troubleshooter API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/policytroubleshooter/apiv1", - "release_level": "beta" - }, - "cloud.google.com/go/profiler": { - "distribution_name": "cloud.google.com/go/profiler", - "description": "Cloud Profiler", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/profiler", - "release_level": "ga" - }, - "cloud.google.com/go/pubsub": { - "distribution_name": "cloud.google.com/go/pubsub", - "description": "Cloud PubSub", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsub", - "release_level": "ga" - }, - "cloud.google.com/go/pubsub/apiv1": { - "distribution_name": "cloud.google.com/go/pubsub/apiv1", - "description": "Cloud Pub/Sub API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsub/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/pubsublite/apiv1": { - "distribution_name": "cloud.google.com/go/pubsublite/apiv1", - "description": "", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsublite/apiv1", - "release_level": "beta" - }, - "cloud.google.com/go/recaptchaenterprise/apiv1": { - "distribution_name": "cloud.google.com/go/recaptchaenterprise/apiv1", - "description": "reCAPTCHA Enterprise API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/apiv1", - "release_level": "beta" - }, - "cloud.google.com/go/recaptchaenterprise/apiv1beta1": { - "distribution_name": "cloud.google.com/go/recaptchaenterprise/apiv1beta1", - "description": "reCAPTCHA Enterprise API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/recommender/apiv1": { - "distribution_name": "cloud.google.com/go/recommender/apiv1", - "description": "Recommender API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/recommender/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/recommender/apiv1beta1": { - "distribution_name": "cloud.google.com/go/recommender/apiv1beta1", - "description": "Recommender API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/recommender/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/redis/apiv1": { - "distribution_name": "cloud.google.com/go/redis/apiv1", - "description": "Google Cloud Memorystore for Redis API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/redis/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/redis/apiv1beta1": { - "distribution_name": "cloud.google.com/go/redis/apiv1beta1", - "description": "Google Cloud Memorystore for Redis API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/redis/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/rpcreplay": { - "distribution_name": "cloud.google.com/go/rpcreplay", - "description": "RPC Replay", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/rpcreplay", - "release_level": "ga" - }, - "cloud.google.com/go/scheduler/apiv1": { - "distribution_name": "cloud.google.com/go/scheduler/apiv1", - "description": "Cloud Scheduler API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/scheduler/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/scheduler/apiv1beta1": { - "distribution_name": "cloud.google.com/go/scheduler/apiv1beta1", - "description": "Cloud Scheduler API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/scheduler/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/secretmanager/apiv1": { - "distribution_name": "cloud.google.com/go/secretmanager/apiv1", - "description": "Secret Manager API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/secretmanager/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/secretmanager/apiv1beta1": { - "distribution_name": "cloud.google.com/go/secretmanager/apiv1beta1", - "description": "Secret Manager API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/secretmanager/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/securitycenter/apiv1": { - "distribution_name": "cloud.google.com/go/securitycenter/apiv1", - "description": "Security Command Center API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/securitycenter/apiv1beta1": { - "distribution_name": "cloud.google.com/go/securitycenter/apiv1beta1", - "description": "Security Command Center API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/securitycenter/apiv1p1beta1": { - "distribution_name": "cloud.google.com/go/securitycenter/apiv1p1beta1", - "description": "Security Command Center API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1p1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/securitycenter/settings/apiv1beta1": { - "distribution_name": "cloud.google.com/go/securitycenter/settings/apiv1beta1", - "description": "Cloud Security Command Center API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/securitycenter/settings/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/servicedirectory/apiv1beta1": { - "distribution_name": "cloud.google.com/go/servicedirectory/apiv1beta1", - "description": "Service Directory API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/servicedirectory/apiv1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/spanner": { - "distribution_name": "cloud.google.com/go/spanner", - "description": "Cloud Spanner", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/spanner", - "release_level": "ga" - }, - "cloud.google.com/go/spanner/admin/database/apiv1": { - "distribution_name": "cloud.google.com/go/spanner/admin/database/apiv1", - "description": "Cloud Spanner Database Admin API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/spanner/admin/database/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/spanner/admin/instance/apiv1": { - "distribution_name": "cloud.google.com/go/spanner/admin/instance/apiv1", - "description": "Cloud Spanner Instance Admin API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/spanner/admin/instance/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/spanner/apiv1": { - "distribution_name": "cloud.google.com/go/spanner/apiv1", - "description": "Cloud Spanner API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/spanner/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/speech/apiv1": { - "distribution_name": "cloud.google.com/go/speech/apiv1", - "description": "Cloud Speech-to-Text API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/speech/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/speech/apiv1p1beta1": { - "distribution_name": "cloud.google.com/go/speech/apiv1p1beta1", - "description": "Cloud Speech-to-Text API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/speech/apiv1p1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/storage": { - "distribution_name": "cloud.google.com/go/storage", - "description": "Cloud Storage (GCS)", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/storage", - "release_level": "ga" - }, - "cloud.google.com/go/talent/apiv4beta1": { - "distribution_name": "cloud.google.com/go/talent/apiv4beta1", - "description": "Cloud Talent Solution API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/talent/apiv4beta1", - "release_level": "beta" - }, - "cloud.google.com/go/texttospeech/apiv1": { - "distribution_name": "cloud.google.com/go/texttospeech/apiv1", - "description": "Cloud Text-to-Speech API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/texttospeech/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/trace": { - "distribution_name": "cloud.google.com/go/trace", - "description": "Stackdriver Trace", - "language": "Go", - "client_library_type": "manual", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/trace", - "release_level": "ga" - }, - "cloud.google.com/go/trace/apiv1": { - "distribution_name": "cloud.google.com/go/trace/apiv1", - "description": "Stackdriver Trace API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/trace/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/trace/apiv2": { - "distribution_name": "cloud.google.com/go/trace/apiv2", - "description": "Stackdriver Trace API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/trace/apiv2", - "release_level": "ga" - }, - "cloud.google.com/go/translate/apiv3": { - "distribution_name": "cloud.google.com/go/translate/apiv3", - "description": "Cloud Translation API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/translate/apiv3", - "release_level": "ga" - }, - "cloud.google.com/go/videointelligence/apiv1": { - "distribution_name": "cloud.google.com/go/videointelligence/apiv1", - "description": "Cloud Video Intelligence API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/videointelligence/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/videointelligence/apiv1beta2": { - "distribution_name": "cloud.google.com/go/videointelligence/apiv1beta2", - "description": "Google Cloud Video Intelligence API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/videointelligence/apiv1beta2", - "release_level": "beta" - }, - "cloud.google.com/go/vision/apiv1": { - "distribution_name": "cloud.google.com/go/vision/apiv1", - "description": "Cloud Vision API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/vision/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/vision/apiv1p1beta1": { - "distribution_name": "cloud.google.com/go/vision/apiv1p1beta1", - "description": "Cloud Vision API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/vision/apiv1p1beta1", - "release_level": "beta" - }, - "cloud.google.com/go/webrisk/apiv1": { - "distribution_name": "cloud.google.com/go/webrisk/apiv1", - "description": "Web Risk API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/webrisk/apiv1", - "release_level": "ga" - }, - "cloud.google.com/go/webrisk/apiv1beta1": { - "distribution_name": "cloud.google.com/go/webrisk/apiv1beta1", - "description": "Web Risk API", - "language": "Go", - "client_library_type": "generated", - "docs_url": "https://pkg.go.dev/cloud.google.com/go/webrisk/apiv1beta1", - "release_level": "beta" - } -} diff --git a/ibm/vendor/cloud.google.com/go/internal/README.md b/ibm/vendor/cloud.google.com/go/internal/README.md deleted file mode 100644 index 8857c8f6fe..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Internal - -This directory contains internal code for cloud.google.com/go packages. - -## .repo-metadata-full.json - -`.repo-metadata-full.json` contains metadata about the packages in this repo. It -is generated by `internal/gapicgen/generator`. It's processed by external tools -to build lists of all of the packages. - -Don't make breaking changes to the format without consulting with the external -tools. - -One day, we may want to create individual `.repo-metadata.json` files next to -each package, which is the pattern followed by some other languages. External -tools would then talk to pkg.go.dev or some other service to get the overall -list of packages and use the `.repo-metadata.json` files to get the additional -metadata required. For now, `.repo-metadata-full.json` includes everything. \ No newline at end of file diff --git a/ibm/vendor/cloud.google.com/go/internal/annotate.go b/ibm/vendor/cloud.google.com/go/internal/annotate.go deleted file mode 100644 index 6435695ba3..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/annotate.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2017 Google LLC -// -// 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 internal - -import ( - "fmt" - - "google.golang.org/api/googleapi" - "google.golang.org/grpc/status" -) - -// Annotate prepends msg to the error message in err, attempting -// to preserve other information in err, like an error code. -// -// Annotate panics if err is nil. -// -// Annotate knows about these error types: -// - "google.golang.org/grpc/status".Status -// - "google.golang.org/api/googleapi".Error -// If the error is not one of these types, Annotate behaves -// like -// fmt.Errorf("%s: %v", msg, err) -func Annotate(err error, msg string) error { - if err == nil { - panic("Annotate called with nil") - } - if s, ok := status.FromError(err); ok { - p := s.Proto() - p.Message = msg + ": " + p.Message - return status.ErrorProto(p) - } - if g, ok := err.(*googleapi.Error); ok { - g.Message = msg + ": " + g.Message - return g - } - return fmt.Errorf("%s: %v", msg, err) -} - -// Annotatef uses format and args to format a string, then calls Annotate. -func Annotatef(err error, format string, args ...interface{}) error { - return Annotate(err, fmt.Sprintf(format, args...)) -} diff --git a/ibm/vendor/cloud.google.com/go/internal/optional/optional.go b/ibm/vendor/cloud.google.com/go/internal/optional/optional.go deleted file mode 100644 index 72780f764c..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/optional/optional.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 optional provides versions of primitive types that can -// be nil. These are useful in methods that update some of an API object's -// fields. -package optional - -import ( - "fmt" - "strings" - "time" -) - -type ( - // Bool is either a bool or nil. - Bool interface{} - - // String is either a string or nil. - String interface{} - - // Int is either an int or nil. - Int interface{} - - // Uint is either a uint or nil. - Uint interface{} - - // Float64 is either a float64 or nil. - Float64 interface{} - - // Duration is either a time.Duration or nil. - Duration interface{} -) - -// ToBool returns its argument as a bool. -// It panics if its argument is nil or not a bool. -func ToBool(v Bool) bool { - x, ok := v.(bool) - if !ok { - doPanic("Bool", v) - } - return x -} - -// ToString returns its argument as a string. -// It panics if its argument is nil or not a string. -func ToString(v String) string { - x, ok := v.(string) - if !ok { - doPanic("String", v) - } - return x -} - -// ToInt returns its argument as an int. -// It panics if its argument is nil or not an int. -func ToInt(v Int) int { - x, ok := v.(int) - if !ok { - doPanic("Int", v) - } - return x -} - -// ToUint returns its argument as a uint. -// It panics if its argument is nil or not a uint. -func ToUint(v Uint) uint { - x, ok := v.(uint) - if !ok { - doPanic("Uint", v) - } - return x -} - -// ToFloat64 returns its argument as a float64. -// It panics if its argument is nil or not a float64. -func ToFloat64(v Float64) float64 { - x, ok := v.(float64) - if !ok { - doPanic("Float64", v) - } - return x -} - -// ToDuration returns its argument as a time.Duration. -// It panics if its argument is nil or not a time.Duration. -func ToDuration(v Duration) time.Duration { - x, ok := v.(time.Duration) - if !ok { - doPanic("Duration", v) - } - return x -} - -func doPanic(capType string, v interface{}) { - panic(fmt.Sprintf("optional.%s value should be %s, got %T", capType, strings.ToLower(capType), v)) -} diff --git a/ibm/vendor/cloud.google.com/go/internal/retry.go b/ibm/vendor/cloud.google.com/go/internal/retry.go deleted file mode 100644 index 7a7b4c2052..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/retry.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 internal - -import ( - "context" - "time" - - gax "github.com/googleapis/gax-go/v2" -) - -// Retry calls the supplied function f repeatedly according to the provided -// backoff parameters. It returns when one of the following occurs: -// When f's first return value is true, Retry immediately returns with f's second -// return value. -// When the provided context is done, Retry returns with an error that -// includes both ctx.Error() and the last error returned by f. -func Retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error)) error { - return retry(ctx, bo, f, gax.Sleep) -} - -func retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error), - sleep func(context.Context, time.Duration) error) error { - var lastErr error - for { - stop, err := f() - if stop { - return err - } - // Remember the last "real" error from f. - if err != nil && err != context.Canceled && err != context.DeadlineExceeded { - lastErr = err - } - p := bo.Pause() - if cerr := sleep(ctx, p); cerr != nil { - if lastErr != nil { - return Annotatef(lastErr, "retry failed with %v; last error", cerr) - } - return cerr - } - } -} diff --git a/ibm/vendor/cloud.google.com/go/internal/trace/trace.go b/ibm/vendor/cloud.google.com/go/internal/trace/trace.go deleted file mode 100644 index 66dc391166..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/trace/trace.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2018 Google LLC -// -// 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 trace - -import ( - "context" - "fmt" - - "go.opencensus.io/trace" - "google.golang.org/api/googleapi" - "google.golang.org/genproto/googleapis/rpc/code" - "google.golang.org/grpc/status" -) - -// StartSpan adds a span to the trace with the given name. -func StartSpan(ctx context.Context, name string) context.Context { - ctx, _ = trace.StartSpan(ctx, name) - return ctx -} - -// EndSpan ends a span with the given error. -func EndSpan(ctx context.Context, err error) { - span := trace.FromContext(ctx) - if err != nil { - span.SetStatus(toStatus(err)) - } - span.End() -} - -// toStatus interrogates an error and converts it to an appropriate -// OpenCensus status. -func toStatus(err error) trace.Status { - if err2, ok := err.(*googleapi.Error); ok { - return trace.Status{Code: httpStatusCodeToOCCode(err2.Code), Message: err2.Message} - } else if s, ok := status.FromError(err); ok { - return trace.Status{Code: int32(s.Code()), Message: s.Message()} - } else { - return trace.Status{Code: int32(code.Code_UNKNOWN), Message: err.Error()} - } -} - -// TODO(deklerk): switch to using OpenCensus function when it becomes available. -// Reference: https://github.com/googleapis/googleapis/blob/26b634d2724ac5dd30ae0b0cbfb01f07f2e4050e/google/rpc/code.proto -func httpStatusCodeToOCCode(httpStatusCode int) int32 { - switch httpStatusCode { - case 200: - return int32(code.Code_OK) - case 499: - return int32(code.Code_CANCELLED) - case 500: - return int32(code.Code_UNKNOWN) // Could also be Code_INTERNAL, Code_DATA_LOSS - case 400: - return int32(code.Code_INVALID_ARGUMENT) // Could also be Code_OUT_OF_RANGE - case 504: - return int32(code.Code_DEADLINE_EXCEEDED) - case 404: - return int32(code.Code_NOT_FOUND) - case 409: - return int32(code.Code_ALREADY_EXISTS) // Could also be Code_ABORTED - case 403: - return int32(code.Code_PERMISSION_DENIED) - case 401: - return int32(code.Code_UNAUTHENTICATED) - case 429: - return int32(code.Code_RESOURCE_EXHAUSTED) - case 501: - return int32(code.Code_UNIMPLEMENTED) - case 503: - return int32(code.Code_UNAVAILABLE) - default: - return int32(code.Code_UNKNOWN) - } -} - -// TODO: (odeke-em): perhaps just pass around spans due to the cost -// incurred from using trace.FromContext(ctx) yet we could avoid -// throwing away the work done by ctx, span := trace.StartSpan. -func TracePrintf(ctx context.Context, attrMap map[string]interface{}, format string, args ...interface{}) { - var attrs []trace.Attribute - for k, v := range attrMap { - var a trace.Attribute - switch v := v.(type) { - case string: - a = trace.StringAttribute(k, v) - case bool: - a = trace.BoolAttribute(k, v) - case int: - a = trace.Int64Attribute(k, int64(v)) - case int64: - a = trace.Int64Attribute(k, v) - default: - a = trace.StringAttribute(k, fmt.Sprintf("%#v", v)) - } - attrs = append(attrs, a) - } - trace.FromContext(ctx).Annotatef(attrs, format, args...) -} diff --git a/ibm/vendor/cloud.google.com/go/internal/version/update_version.sh b/ibm/vendor/cloud.google.com/go/internal/version/update_version.sh deleted file mode 100644 index d7c5a3e219..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/version/update_version.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# 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. - -today=$(date +%Y%m%d) - -sed -i -r -e 's/const Repo = "([0-9]{8})"/const Repo = "'$today'"/' $GOFILE - diff --git a/ibm/vendor/cloud.google.com/go/internal/version/version.go b/ibm/vendor/cloud.google.com/go/internal/version/version.go deleted file mode 100644 index f3dca3d047..0000000000 --- a/ibm/vendor/cloud.google.com/go/internal/version/version.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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. - -//go:generate ./update_version.sh - -// Package version contains version information for Google Cloud Client -// Libraries for Go, as reported in request headers. -package version - -import ( - "runtime" - "strings" - "unicode" -) - -// Repo is the current version of the client libraries in this -// repo. It should be a date in YYYYMMDD format. -const Repo = "20200817" - -// Go returns the Go runtime version. The returned string -// has no whitespace. -func Go() string { - return goVersion -} - -var goVersion = goVer(runtime.Version()) - -const develPrefix = "devel +" - -func goVer(s string) string { - if strings.HasPrefix(s, develPrefix) { - s = s[len(develPrefix):] - if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { - s = s[:p] - } - return s - } - - if strings.HasPrefix(s, "go1") { - s = s[2:] - var prerelease string - if p := strings.IndexFunc(s, notSemverRune); p >= 0 { - s, prerelease = s[:p], s[p:] - } - if strings.HasSuffix(s, ".") { - s += "0" - } else if strings.Count(s, ".") < 2 { - s += ".0" - } - if prerelease != "" { - s += "-" + prerelease - } - return s - } - return "" -} - -func notSemverRune(r rune) bool { - return !strings.ContainsRune("0123456789.", r) -} diff --git a/ibm/vendor/cloud.google.com/go/storage/CHANGES.md b/ibm/vendor/cloud.google.com/go/storage/CHANGES.md deleted file mode 100644 index f6d57be508..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/CHANGES.md +++ /dev/null @@ -1,83 +0,0 @@ -# Changes - -## v1.10.0 -- Bump dependency on google.golang.org/api to capture changes to retry logic - which will make retries on writes more resilient. -- Improve documentation for Writer.ChunkSize. -- Fix a bug in lifecycle to allow callers to clear lifecycle rules on a bucket. - -## v1.9.0 -- Add retry for transient network errors on most operations (with the exception - of writes). -- Bump dependency for google.golang.org/api to capture a change in the default - HTTP transport which will improve performance for reads under heavy load. -- Add CRC32C checksum validation option to Composer. - -## v1.8.0 -- Add support for V4 signed post policies. - -## v1.7.0 -- V4 signed URL support: - - Add support for bucket-bound domains and virtual hosted style URLs. - - Add support for query parameters in the signature. - - Fix text encoding to align with standards. -- Add the object name to query parameters for write calls. -- Fix retry behavior when reading files with Content-Encoding gzip. -- Fix response header in reader. -- New code examples: - - Error handling for `ObjectHandle` preconditions. - - Existence checks for buckets and objects. - -## v1.6.0 - -- Updated option handling: - - Don't drop custom scopes (#1756) - - Don't drop port in provided endpoint (#1737) - -## v1.5.0 - -- Honor WithEndpoint client option for reads as well as writes. -- Add archive storage class to docs. -- Make fixes to storage benchwrapper. - -## v1.4.0 - -- When listing objects in a bucket, allow callers to specify which attributes - are queried. This allows for performance optimization. - -## v1.3.0 - -- Use `storage.googleapis.com/storage/v1` by default for GCS requests - instead of `www.googleapis.com/storage/v1`. - -## v1.2.1 - -- Fixed a bug where UniformBucketLevelAccess and BucketPolicyOnly were not - being sent in all cases. - -## v1.2.0 - -- Add support for UniformBucketLevelAccess. This configures access checks - to use only bucket-level IAM policies. - See: https://godoc.org/cloud.google.com/go/storage#UniformBucketLevelAccess. -- Fix userAgent to use correct version. - -## v1.1.2 - -- Fix memory leak in BucketIterator and ObjectIterator. - -## v1.1.1 - -- Send BucketPolicyOnly even when it's disabled. - -## v1.1.0 - -- Performance improvements for ObjectIterator and BucketIterator. -- Fix Bucket.ObjectIterator size calculation checks. -- Added HMACKeyOptions to all the methods which allows for options such as - UserProject to be set per invocation and optionally be used. - -## v1.0.0 - -This is the first tag to carve out storage as its own module. See: -https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository. diff --git a/ibm/vendor/cloud.google.com/go/storage/LICENSE b/ibm/vendor/cloud.google.com/go/storage/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/LICENSE +++ /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/ibm/vendor/cloud.google.com/go/storage/README.md b/ibm/vendor/cloud.google.com/go/storage/README.md deleted file mode 100644 index a2253c4bb5..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## Cloud Storage [![GoDoc](https://godoc.org/cloud.google.com/go/storage?status.svg)](https://godoc.org/cloud.google.com/go/storage) - -- [About Cloud Storage](https://cloud.google.com/storage/) -- [API documentation](https://cloud.google.com/storage/docs) -- [Go client documentation](https://godoc.org/cloud.google.com/go/storage) -- [Complete sample programs](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/storage) - -### Example Usage - -First create a `storage.Client` to use throughout your application: - -[snip]:# (storage-1) -```go -client, err := storage.NewClient(ctx) -if err != nil { - log.Fatal(err) -} -``` - -[snip]:# (storage-2) -```go -// Read the object1 from bucket. -rc, err := client.Bucket("bucket").Object("object1").NewReader(ctx) -if err != nil { - log.Fatal(err) -} -defer rc.Close() -body, err := ioutil.ReadAll(rc) -if err != nil { - log.Fatal(err) -} -``` \ No newline at end of file diff --git a/ibm/vendor/cloud.google.com/go/storage/acl.go b/ibm/vendor/cloud.google.com/go/storage/acl.go deleted file mode 100644 index 7855d110ad..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/acl.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 storage - -import ( - "context" - "net/http" - "reflect" - - "cloud.google.com/go/internal/trace" - "google.golang.org/api/googleapi" - raw "google.golang.org/api/storage/v1" -) - -// ACLRole is the level of access to grant. -type ACLRole string - -const ( - RoleOwner ACLRole = "OWNER" - RoleReader ACLRole = "READER" - RoleWriter ACLRole = "WRITER" -) - -// ACLEntity refers to a user or group. -// They are sometimes referred to as grantees. -// -// It could be in the form of: -// "user-", "user-", "group-", "group-", -// "domain-" and "project-team-". -// -// Or one of the predefined constants: AllUsers, AllAuthenticatedUsers. -type ACLEntity string - -const ( - AllUsers ACLEntity = "allUsers" - AllAuthenticatedUsers ACLEntity = "allAuthenticatedUsers" -) - -// ACLRule represents a grant for a role to an entity (user, group or team) for a -// Google Cloud Storage object or bucket. -type ACLRule struct { - Entity ACLEntity - EntityID string - Role ACLRole - Domain string - Email string - ProjectTeam *ProjectTeam -} - -// ProjectTeam is the project team associated with the entity, if any. -type ProjectTeam struct { - ProjectNumber string - Team string -} - -// ACLHandle provides operations on an access control list for a Google Cloud Storage bucket or object. -type ACLHandle struct { - c *Client - bucket string - object string - isDefault bool - userProject string // for requester-pays buckets -} - -// Delete permanently deletes the ACL entry for the given entity. -func (a *ACLHandle) Delete(ctx context.Context, entity ACLEntity) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.ACL.Delete") - defer func() { trace.EndSpan(ctx, err) }() - - if a.object != "" { - return a.objectDelete(ctx, entity) - } - if a.isDefault { - return a.bucketDefaultDelete(ctx, entity) - } - return a.bucketDelete(ctx, entity) -} - -// Set sets the role for the given entity. -func (a *ACLHandle) Set(ctx context.Context, entity ACLEntity, role ACLRole) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.ACL.Set") - defer func() { trace.EndSpan(ctx, err) }() - - if a.object != "" { - return a.objectSet(ctx, entity, role, false) - } - if a.isDefault { - return a.objectSet(ctx, entity, role, true) - } - return a.bucketSet(ctx, entity, role) -} - -// List retrieves ACL entries. -func (a *ACLHandle) List(ctx context.Context) (rules []ACLRule, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.ACL.List") - defer func() { trace.EndSpan(ctx, err) }() - - if a.object != "" { - return a.objectList(ctx) - } - if a.isDefault { - return a.bucketDefaultList(ctx) - } - return a.bucketList(ctx) -} - -func (a *ACLHandle) bucketDefaultList(ctx context.Context) ([]ACLRule, error) { - var acls *raw.ObjectAccessControls - var err error - err = runWithRetry(ctx, func() error { - req := a.c.raw.DefaultObjectAccessControls.List(a.bucket) - a.configureCall(ctx, req) - acls, err = req.Do() - return err - }) - if err != nil { - return nil, err - } - return toObjectACLRules(acls.Items), nil -} - -func (a *ACLHandle) bucketDefaultDelete(ctx context.Context, entity ACLEntity) error { - return runWithRetry(ctx, func() error { - req := a.c.raw.DefaultObjectAccessControls.Delete(a.bucket, string(entity)) - a.configureCall(ctx, req) - return req.Do() - }) -} - -func (a *ACLHandle) bucketList(ctx context.Context) ([]ACLRule, error) { - var acls *raw.BucketAccessControls - var err error - err = runWithRetry(ctx, func() error { - req := a.c.raw.BucketAccessControls.List(a.bucket) - a.configureCall(ctx, req) - acls, err = req.Do() - return err - }) - if err != nil { - return nil, err - } - return toBucketACLRules(acls.Items), nil -} - -func (a *ACLHandle) bucketSet(ctx context.Context, entity ACLEntity, role ACLRole) error { - acl := &raw.BucketAccessControl{ - Bucket: a.bucket, - Entity: string(entity), - Role: string(role), - } - err := runWithRetry(ctx, func() error { - req := a.c.raw.BucketAccessControls.Update(a.bucket, string(entity), acl) - a.configureCall(ctx, req) - _, err := req.Do() - return err - }) - if err != nil { - return err - } - return nil -} - -func (a *ACLHandle) bucketDelete(ctx context.Context, entity ACLEntity) error { - return runWithRetry(ctx, func() error { - req := a.c.raw.BucketAccessControls.Delete(a.bucket, string(entity)) - a.configureCall(ctx, req) - return req.Do() - }) -} - -func (a *ACLHandle) objectList(ctx context.Context) ([]ACLRule, error) { - var acls *raw.ObjectAccessControls - var err error - err = runWithRetry(ctx, func() error { - req := a.c.raw.ObjectAccessControls.List(a.bucket, a.object) - a.configureCall(ctx, req) - acls, err = req.Do() - return err - }) - if err != nil { - return nil, err - } - return toObjectACLRules(acls.Items), nil -} - -func (a *ACLHandle) objectSet(ctx context.Context, entity ACLEntity, role ACLRole, isBucketDefault bool) error { - type setRequest interface { - Do(opts ...googleapi.CallOption) (*raw.ObjectAccessControl, error) - Header() http.Header - } - - acl := &raw.ObjectAccessControl{ - Bucket: a.bucket, - Entity: string(entity), - Role: string(role), - } - var req setRequest - if isBucketDefault { - req = a.c.raw.DefaultObjectAccessControls.Update(a.bucket, string(entity), acl) - } else { - req = a.c.raw.ObjectAccessControls.Update(a.bucket, a.object, string(entity), acl) - } - a.configureCall(ctx, req) - return runWithRetry(ctx, func() error { - _, err := req.Do() - return err - }) -} - -func (a *ACLHandle) objectDelete(ctx context.Context, entity ACLEntity) error { - return runWithRetry(ctx, func() error { - req := a.c.raw.ObjectAccessControls.Delete(a.bucket, a.object, string(entity)) - a.configureCall(ctx, req) - return req.Do() - }) -} - -func (a *ACLHandle) configureCall(ctx context.Context, call interface{ Header() http.Header }) { - vc := reflect.ValueOf(call) - vc.MethodByName("Context").Call([]reflect.Value{reflect.ValueOf(ctx)}) - if a.userProject != "" { - vc.MethodByName("UserProject").Call([]reflect.Value{reflect.ValueOf(a.userProject)}) - } - setClientHeader(call.Header()) -} - -func toObjectACLRules(items []*raw.ObjectAccessControl) []ACLRule { - var rs []ACLRule - for _, item := range items { - rs = append(rs, toObjectACLRule(item)) - } - return rs -} - -func toBucketACLRules(items []*raw.BucketAccessControl) []ACLRule { - var rs []ACLRule - for _, item := range items { - rs = append(rs, toBucketACLRule(item)) - } - return rs -} - -func toObjectACLRule(a *raw.ObjectAccessControl) ACLRule { - return ACLRule{ - Entity: ACLEntity(a.Entity), - EntityID: a.EntityId, - Role: ACLRole(a.Role), - Domain: a.Domain, - Email: a.Email, - ProjectTeam: toObjectProjectTeam(a.ProjectTeam), - } -} - -func toBucketACLRule(a *raw.BucketAccessControl) ACLRule { - return ACLRule{ - Entity: ACLEntity(a.Entity), - EntityID: a.EntityId, - Role: ACLRole(a.Role), - Domain: a.Domain, - Email: a.Email, - ProjectTeam: toBucketProjectTeam(a.ProjectTeam), - } -} - -func toRawObjectACL(rules []ACLRule) []*raw.ObjectAccessControl { - if len(rules) == 0 { - return nil - } - r := make([]*raw.ObjectAccessControl, 0, len(rules)) - for _, rule := range rules { - r = append(r, rule.toRawObjectAccessControl("")) // bucket name unnecessary - } - return r -} - -func toRawBucketACL(rules []ACLRule) []*raw.BucketAccessControl { - if len(rules) == 0 { - return nil - } - r := make([]*raw.BucketAccessControl, 0, len(rules)) - for _, rule := range rules { - r = append(r, rule.toRawBucketAccessControl("")) // bucket name unnecessary - } - return r -} - -func (r ACLRule) toRawBucketAccessControl(bucket string) *raw.BucketAccessControl { - return &raw.BucketAccessControl{ - Bucket: bucket, - Entity: string(r.Entity), - Role: string(r.Role), - // The other fields are not settable. - } -} - -func (r ACLRule) toRawObjectAccessControl(bucket string) *raw.ObjectAccessControl { - return &raw.ObjectAccessControl{ - Bucket: bucket, - Entity: string(r.Entity), - Role: string(r.Role), - // The other fields are not settable. - } -} - -func toBucketProjectTeam(p *raw.BucketAccessControlProjectTeam) *ProjectTeam { - if p == nil { - return nil - } - return &ProjectTeam{ - ProjectNumber: p.ProjectNumber, - Team: p.Team, - } -} - -func toObjectProjectTeam(p *raw.ObjectAccessControlProjectTeam) *ProjectTeam { - if p == nil { - return nil - } - return &ProjectTeam{ - ProjectNumber: p.ProjectNumber, - Team: p.Team, - } -} diff --git a/ibm/vendor/cloud.google.com/go/storage/bucket.go b/ibm/vendor/cloud.google.com/go/storage/bucket.go deleted file mode 100644 index 478482645f..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/bucket.go +++ /dev/null @@ -1,1265 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 storage - -import ( - "context" - "fmt" - "net/http" - "reflect" - "time" - - "cloud.google.com/go/internal/optional" - "cloud.google.com/go/internal/trace" - "google.golang.org/api/googleapi" - "google.golang.org/api/iterator" - raw "google.golang.org/api/storage/v1" -) - -// BucketHandle provides operations on a Google Cloud Storage bucket. -// Use Client.Bucket to get a handle. -type BucketHandle struct { - c *Client - name string - acl ACLHandle - defaultObjectACL ACLHandle - conds *BucketConditions - userProject string // project for Requester Pays buckets -} - -// Bucket returns a BucketHandle, which provides operations on the named bucket. -// This call does not perform any network operations. -// -// The supplied name must contain only lowercase letters, numbers, dashes, -// underscores, and dots. The full specification for valid bucket names can be -// found at: -// https://cloud.google.com/storage/docs/bucket-naming -func (c *Client) Bucket(name string) *BucketHandle { - return &BucketHandle{ - c: c, - name: name, - acl: ACLHandle{ - c: c, - bucket: name, - }, - defaultObjectACL: ACLHandle{ - c: c, - bucket: name, - isDefault: true, - }, - } -} - -// Create creates the Bucket in the project. -// If attrs is nil the API defaults will be used. -func (b *BucketHandle) Create(ctx context.Context, projectID string, attrs *BucketAttrs) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Create") - defer func() { trace.EndSpan(ctx, err) }() - - var bkt *raw.Bucket - if attrs != nil { - bkt = attrs.toRawBucket() - } else { - bkt = &raw.Bucket{} - } - bkt.Name = b.name - // If there is lifecycle information but no location, explicitly set - // the location. This is a GCS quirk/bug. - if bkt.Location == "" && bkt.Lifecycle != nil { - bkt.Location = "US" - } - req := b.c.raw.Buckets.Insert(projectID, bkt) - setClientHeader(req.Header()) - if attrs != nil && attrs.PredefinedACL != "" { - req.PredefinedAcl(attrs.PredefinedACL) - } - if attrs != nil && attrs.PredefinedDefaultObjectACL != "" { - req.PredefinedDefaultObjectAcl(attrs.PredefinedDefaultObjectACL) - } - return runWithRetry(ctx, func() error { _, err := req.Context(ctx).Do(); return err }) -} - -// Delete deletes the Bucket. -func (b *BucketHandle) Delete(ctx context.Context) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Delete") - defer func() { trace.EndSpan(ctx, err) }() - - req, err := b.newDeleteCall() - if err != nil { - return err - } - return runWithRetry(ctx, func() error { return req.Context(ctx).Do() }) -} - -func (b *BucketHandle) newDeleteCall() (*raw.BucketsDeleteCall, error) { - req := b.c.raw.Buckets.Delete(b.name) - setClientHeader(req.Header()) - if err := applyBucketConds("BucketHandle.Delete", b.conds, req); err != nil { - return nil, err - } - if b.userProject != "" { - req.UserProject(b.userProject) - } - return req, nil -} - -// ACL returns an ACLHandle, which provides access to the bucket's access control list. -// This controls who can list, create or overwrite the objects in a bucket. -// This call does not perform any network operations. -func (b *BucketHandle) ACL() *ACLHandle { - return &b.acl -} - -// DefaultObjectACL returns an ACLHandle, which provides access to the bucket's default object ACLs. -// These ACLs are applied to newly created objects in this bucket that do not have a defined ACL. -// This call does not perform any network operations. -func (b *BucketHandle) DefaultObjectACL() *ACLHandle { - return &b.defaultObjectACL -} - -// Object returns an ObjectHandle, which provides operations on the named object. -// This call does not perform any network operations. -// -// name must consist entirely of valid UTF-8-encoded runes. The full specification -// for valid object names can be found at: -// https://cloud.google.com/storage/docs/bucket-naming -func (b *BucketHandle) Object(name string) *ObjectHandle { - return &ObjectHandle{ - c: b.c, - bucket: b.name, - object: name, - acl: ACLHandle{ - c: b.c, - bucket: b.name, - object: name, - userProject: b.userProject, - }, - gen: -1, - userProject: b.userProject, - } -} - -// Attrs returns the metadata for the bucket. -func (b *BucketHandle) Attrs(ctx context.Context) (attrs *BucketAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Attrs") - defer func() { trace.EndSpan(ctx, err) }() - - req, err := b.newGetCall() - if err != nil { - return nil, err - } - var resp *raw.Bucket - err = runWithRetry(ctx, func() error { - resp, err = req.Context(ctx).Do() - return err - }) - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { - return nil, ErrBucketNotExist - } - if err != nil { - return nil, err - } - return newBucket(resp) -} - -func (b *BucketHandle) newGetCall() (*raw.BucketsGetCall, error) { - req := b.c.raw.Buckets.Get(b.name).Projection("full") - setClientHeader(req.Header()) - if err := applyBucketConds("BucketHandle.Attrs", b.conds, req); err != nil { - return nil, err - } - if b.userProject != "" { - req.UserProject(b.userProject) - } - return req, nil -} - -// Update updates a bucket's attributes. -func (b *BucketHandle) Update(ctx context.Context, uattrs BucketAttrsToUpdate) (attrs *BucketAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Create") - defer func() { trace.EndSpan(ctx, err) }() - - req, err := b.newPatchCall(&uattrs) - if err != nil { - return nil, err - } - if uattrs.PredefinedACL != "" { - req.PredefinedAcl(uattrs.PredefinedACL) - } - if uattrs.PredefinedDefaultObjectACL != "" { - req.PredefinedDefaultObjectAcl(uattrs.PredefinedDefaultObjectACL) - } - // TODO(jba): retry iff metagen is set? - rb, err := req.Context(ctx).Do() - if err != nil { - return nil, err - } - return newBucket(rb) -} - -func (b *BucketHandle) newPatchCall(uattrs *BucketAttrsToUpdate) (*raw.BucketsPatchCall, error) { - rb := uattrs.toRawBucket() - req := b.c.raw.Buckets.Patch(b.name, rb).Projection("full") - setClientHeader(req.Header()) - if err := applyBucketConds("BucketHandle.Update", b.conds, req); err != nil { - return nil, err - } - if b.userProject != "" { - req.UserProject(b.userProject) - } - return req, nil -} - -// BucketAttrs represents the metadata for a Google Cloud Storage bucket. -// Read-only fields are ignored by BucketHandle.Create. -type BucketAttrs struct { - // Name is the name of the bucket. - // This field is read-only. - Name string - - // ACL is the list of access control rules on the bucket. - ACL []ACLRule - - // BucketPolicyOnly is an alias for UniformBucketLevelAccess. Use of - // UniformBucketLevelAccess is recommended above the use of this field. - // Setting BucketPolicyOnly.Enabled OR UniformBucketLevelAccess.Enabled to - // true, will enable UniformBucketLevelAccess. - BucketPolicyOnly BucketPolicyOnly - - // UniformBucketLevelAccess configures access checks to use only bucket-level IAM - // policies and ignore any ACL rules for the bucket. - // See https://cloud.google.com/storage/docs/uniform-bucket-level-access - // for more information. - UniformBucketLevelAccess UniformBucketLevelAccess - - // DefaultObjectACL is the list of access controls to - // apply to new objects when no object ACL is provided. - DefaultObjectACL []ACLRule - - // DefaultEventBasedHold is the default value for event-based hold on - // newly created objects in this bucket. It defaults to false. - DefaultEventBasedHold bool - - // If not empty, applies a predefined set of access controls. It should be set - // only when creating a bucket. - // It is always empty for BucketAttrs returned from the service. - // See https://cloud.google.com/storage/docs/json_api/v1/buckets/insert - // for valid values. - PredefinedACL string - - // If not empty, applies a predefined set of default object access controls. - // It should be set only when creating a bucket. - // It is always empty for BucketAttrs returned from the service. - // See https://cloud.google.com/storage/docs/json_api/v1/buckets/insert - // for valid values. - PredefinedDefaultObjectACL string - - // Location is the location of the bucket. It defaults to "US". - Location string - - // MetaGeneration is the metadata generation of the bucket. - // This field is read-only. - MetaGeneration int64 - - // StorageClass is the default storage class of the bucket. This defines - // how objects in the bucket are stored and determines the SLA - // and the cost of storage. Typical values are "STANDARD", "NEARLINE", - // "COLDLINE" and "ARCHIVE". Defaults to "STANDARD". - // See https://cloud.google.com/storage/docs/storage-classes for all - // valid values. - StorageClass string - - // Created is the creation time of the bucket. - // This field is read-only. - Created time.Time - - // VersioningEnabled reports whether this bucket has versioning enabled. - VersioningEnabled bool - - // Labels are the bucket's labels. - Labels map[string]string - - // RequesterPays reports whether the bucket is a Requester Pays bucket. - // Clients performing operations on Requester Pays buckets must provide - // a user project (see BucketHandle.UserProject), which will be billed - // for the operations. - RequesterPays bool - - // Lifecycle is the lifecycle configuration for objects in the bucket. - Lifecycle Lifecycle - - // Retention policy enforces a minimum retention time for all objects - // contained in the bucket. A RetentionPolicy of nil implies the bucket - // has no minimum data retention. - // - // This feature is in private alpha release. It is not currently available to - // most customers. It might be changed in backwards-incompatible ways and is not - // subject to any SLA or deprecation policy. - RetentionPolicy *RetentionPolicy - - // The bucket's Cross-Origin Resource Sharing (CORS) configuration. - CORS []CORS - - // The encryption configuration used by default for newly inserted objects. - Encryption *BucketEncryption - - // The logging configuration. - Logging *BucketLogging - - // The website configuration. - Website *BucketWebsite - - // Etag is the HTTP/1.1 Entity tag for the bucket. - // This field is read-only. - Etag string - - // LocationType describes how data is stored and replicated. - // Typical values are "multi-region", "region" and "dual-region". - // This field is read-only. - LocationType string -} - -// BucketPolicyOnly is an alias for UniformBucketLevelAccess. -// Use of UniformBucketLevelAccess is preferred above BucketPolicyOnly. -type BucketPolicyOnly struct { - // Enabled specifies whether access checks use only bucket-level IAM - // policies. Enabled may be disabled until the locked time. - Enabled bool - // LockedTime specifies the deadline for changing Enabled from true to - // false. - LockedTime time.Time -} - -// UniformBucketLevelAccess configures access checks to use only bucket-level IAM -// policies. -type UniformBucketLevelAccess struct { - // Enabled specifies whether access checks use only bucket-level IAM - // policies. Enabled may be disabled until the locked time. - Enabled bool - // LockedTime specifies the deadline for changing Enabled from true to - // false. - LockedTime time.Time -} - -// Lifecycle is the lifecycle configuration for objects in the bucket. -type Lifecycle struct { - Rules []LifecycleRule -} - -// RetentionPolicy enforces a minimum retention time for all objects -// contained in the bucket. -// -// Any attempt to overwrite or delete objects younger than the retention -// period will result in an error. An unlocked retention policy can be -// modified or removed from the bucket via the Update method. A -// locked retention policy cannot be removed or shortened in duration -// for the lifetime of the bucket. -// -// This feature is in private alpha release. It is not currently available to -// most customers. It might be changed in backwards-incompatible ways and is not -// subject to any SLA or deprecation policy. -type RetentionPolicy struct { - // RetentionPeriod specifies the duration that objects need to be - // retained. Retention duration must be greater than zero and less than - // 100 years. Note that enforcement of retention periods less than a day - // is not guaranteed. Such periods should only be used for testing - // purposes. - RetentionPeriod time.Duration - - // EffectiveTime is the time from which the policy was enforced and - // effective. This field is read-only. - EffectiveTime time.Time - - // IsLocked describes whether the bucket is locked. Once locked, an - // object retention policy cannot be modified. - // This field is read-only. - IsLocked bool -} - -const ( - // RFC3339 date with only the date segment, used for CreatedBefore in LifecycleRule. - rfc3339Date = "2006-01-02" - - // DeleteAction is a lifecycle action that deletes a live and/or archived - // objects. Takes precedence over SetStorageClass actions. - DeleteAction = "Delete" - - // SetStorageClassAction changes the storage class of live and/or archived - // objects. - SetStorageClassAction = "SetStorageClass" -) - -// LifecycleRule is a lifecycle configuration rule. -// -// When all the configured conditions are met by an object in the bucket, the -// configured action will automatically be taken on that object. -type LifecycleRule struct { - // Action is the action to take when all of the associated conditions are - // met. - Action LifecycleAction - - // Condition is the set of conditions that must be met for the associated - // action to be taken. - Condition LifecycleCondition -} - -// LifecycleAction is a lifecycle configuration action. -type LifecycleAction struct { - // Type is the type of action to take on matching objects. - // - // Acceptable values are "Delete" to delete matching objects and - // "SetStorageClass" to set the storage class defined in StorageClass on - // matching objects. - Type string - - // StorageClass is the storage class to set on matching objects if the Action - // is "SetStorageClass". - StorageClass string -} - -// Liveness specifies whether the object is live or not. -type Liveness int - -const ( - // LiveAndArchived includes both live and archived objects. - LiveAndArchived Liveness = iota - // Live specifies that the object is still live. - Live - // Archived specifies that the object is archived. - Archived -) - -// LifecycleCondition is a set of conditions used to match objects and take an -// action automatically. -// -// All configured conditions must be met for the associated action to be taken. -type LifecycleCondition struct { - // AgeInDays is the age of the object in days. - AgeInDays int64 - - // CreatedBefore is the time the object was created. - // - // This condition is satisfied when an object is created before midnight of - // the specified date in UTC. - CreatedBefore time.Time - - // Liveness specifies the object's liveness. Relevant only for versioned objects - Liveness Liveness - - // MatchesStorageClasses is the condition matching the object's storage - // class. - // - // Values include "STANDARD", "NEARLINE", "COLDLINE" and "ARCHIVE". - MatchesStorageClasses []string - - // NumNewerVersions is the condition matching objects with a number of newer versions. - // - // If the value is N, this condition is satisfied when there are at least N - // versions (including the live version) newer than this version of the - // object. - NumNewerVersions int64 -} - -// BucketLogging holds the bucket's logging configuration, which defines the -// destination bucket and optional name prefix for the current bucket's -// logs. -type BucketLogging struct { - // The destination bucket where the current bucket's logs - // should be placed. - LogBucket string - - // A prefix for log object names. - LogObjectPrefix string -} - -// BucketWebsite holds the bucket's website configuration, controlling how the -// service behaves when accessing bucket contents as a web site. See -// https://cloud.google.com/storage/docs/static-website for more information. -type BucketWebsite struct { - // If the requested object path is missing, the service will ensure the path has - // a trailing '/', append this suffix, and attempt to retrieve the resulting - // object. This allows the creation of index.html objects to represent directory - // pages. - MainPageSuffix string - - // If the requested object path is missing, and any mainPageSuffix object is - // missing, if applicable, the service will return the named object from this - // bucket as the content for a 404 Not Found result. - NotFoundPage string -} - -func newBucket(b *raw.Bucket) (*BucketAttrs, error) { - if b == nil { - return nil, nil - } - rp, err := toRetentionPolicy(b.RetentionPolicy) - if err != nil { - return nil, err - } - return &BucketAttrs{ - Name: b.Name, - Location: b.Location, - MetaGeneration: b.Metageneration, - DefaultEventBasedHold: b.DefaultEventBasedHold, - StorageClass: b.StorageClass, - Created: convertTime(b.TimeCreated), - VersioningEnabled: b.Versioning != nil && b.Versioning.Enabled, - ACL: toBucketACLRules(b.Acl), - DefaultObjectACL: toObjectACLRules(b.DefaultObjectAcl), - Labels: b.Labels, - RequesterPays: b.Billing != nil && b.Billing.RequesterPays, - Lifecycle: toLifecycle(b.Lifecycle), - RetentionPolicy: rp, - CORS: toCORS(b.Cors), - Encryption: toBucketEncryption(b.Encryption), - Logging: toBucketLogging(b.Logging), - Website: toBucketWebsite(b.Website), - BucketPolicyOnly: toBucketPolicyOnly(b.IamConfiguration), - UniformBucketLevelAccess: toUniformBucketLevelAccess(b.IamConfiguration), - Etag: b.Etag, - LocationType: b.LocationType, - }, nil -} - -// toRawBucket copies the editable attribute from b to the raw library's Bucket type. -func (b *BucketAttrs) toRawBucket() *raw.Bucket { - // Copy label map. - var labels map[string]string - if len(b.Labels) > 0 { - labels = make(map[string]string, len(b.Labels)) - for k, v := range b.Labels { - labels[k] = v - } - } - // Ignore VersioningEnabled if it is false. This is OK because - // we only call this method when creating a bucket, and by default - // new buckets have versioning off. - var v *raw.BucketVersioning - if b.VersioningEnabled { - v = &raw.BucketVersioning{Enabled: true} - } - var bb *raw.BucketBilling - if b.RequesterPays { - bb = &raw.BucketBilling{RequesterPays: true} - } - var bktIAM *raw.BucketIamConfiguration - if b.UniformBucketLevelAccess.Enabled || b.BucketPolicyOnly.Enabled { - bktIAM = &raw.BucketIamConfiguration{ - UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ - Enabled: true, - }, - } - } - return &raw.Bucket{ - Name: b.Name, - Location: b.Location, - StorageClass: b.StorageClass, - Acl: toRawBucketACL(b.ACL), - DefaultObjectAcl: toRawObjectACL(b.DefaultObjectACL), - Versioning: v, - Labels: labels, - Billing: bb, - Lifecycle: toRawLifecycle(b.Lifecycle), - RetentionPolicy: b.RetentionPolicy.toRawRetentionPolicy(), - Cors: toRawCORS(b.CORS), - Encryption: b.Encryption.toRawBucketEncryption(), - Logging: b.Logging.toRawBucketLogging(), - Website: b.Website.toRawBucketWebsite(), - IamConfiguration: bktIAM, - } -} - -// CORS is the bucket's Cross-Origin Resource Sharing (CORS) configuration. -type CORS struct { - // MaxAge is the value to return in the Access-Control-Max-Age - // header used in preflight responses. - MaxAge time.Duration - - // Methods is the list of HTTP methods on which to include CORS response - // headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list - // of methods, and means "any method". - Methods []string - - // Origins is the list of Origins eligible to receive CORS response - // headers. Note: "*" is permitted in the list of origins, and means - // "any Origin". - Origins []string - - // ResponseHeaders is the list of HTTP headers other than the simple - // response headers to give permission for the user-agent to share - // across domains. - ResponseHeaders []string -} - -// BucketEncryption is a bucket's encryption configuration. -type BucketEncryption struct { - // A Cloud KMS key name, in the form - // projects/P/locations/L/keyRings/R/cryptoKeys/K, that will be used to encrypt - // objects inserted into this bucket, if no encryption method is specified. - // The key's location must be the same as the bucket's. - DefaultKMSKeyName string -} - -// BucketAttrsToUpdate define the attributes to update during an Update call. -type BucketAttrsToUpdate struct { - // If set, updates whether the bucket uses versioning. - VersioningEnabled optional.Bool - - // If set, updates whether the bucket is a Requester Pays bucket. - RequesterPays optional.Bool - - // DefaultEventBasedHold is the default value for event-based hold on - // newly created objects in this bucket. - DefaultEventBasedHold optional.Bool - - // BucketPolicyOnly is an alias for UniformBucketLevelAccess. Use of - // UniformBucketLevelAccess is recommended above the use of this field. - // Setting BucketPolicyOnly.Enabled OR UniformBucketLevelAccess.Enabled to - // true, will enable UniformBucketLevelAccess. If both BucketPolicyOnly and - // UniformBucketLevelAccess are set, the value of UniformBucketLevelAccess - // will take precedence. - BucketPolicyOnly *BucketPolicyOnly - - // UniformBucketLevelAccess configures access checks to use only bucket-level IAM - // policies and ignore any ACL rules for the bucket. - // See https://cloud.google.com/storage/docs/uniform-bucket-level-access - // for more information. - UniformBucketLevelAccess *UniformBucketLevelAccess - - // If set, updates the retention policy of the bucket. Using - // RetentionPolicy.RetentionPeriod = 0 will delete the existing policy. - // - // This feature is in private alpha release. It is not currently available to - // most customers. It might be changed in backwards-incompatible ways and is not - // subject to any SLA or deprecation policy. - RetentionPolicy *RetentionPolicy - - // If set, replaces the CORS configuration with a new configuration. - // An empty (rather than nil) slice causes all CORS policies to be removed. - CORS []CORS - - // If set, replaces the encryption configuration of the bucket. Using - // BucketEncryption.DefaultKMSKeyName = "" will delete the existing - // configuration. - Encryption *BucketEncryption - - // If set, replaces the lifecycle configuration of the bucket. - Lifecycle *Lifecycle - - // If set, replaces the logging configuration of the bucket. - Logging *BucketLogging - - // If set, replaces the website configuration of the bucket. - Website *BucketWebsite - - // If not empty, applies a predefined set of access controls. - // See https://cloud.google.com/storage/docs/json_api/v1/buckets/patch. - PredefinedACL string - - // If not empty, applies a predefined set of default object access controls. - // See https://cloud.google.com/storage/docs/json_api/v1/buckets/patch. - PredefinedDefaultObjectACL string - - setLabels map[string]string - deleteLabels map[string]bool -} - -// SetLabel causes a label to be added or modified when ua is used -// in a call to Bucket.Update. -func (ua *BucketAttrsToUpdate) SetLabel(name, value string) { - if ua.setLabels == nil { - ua.setLabels = map[string]string{} - } - ua.setLabels[name] = value -} - -// DeleteLabel causes a label to be deleted when ua is used in a -// call to Bucket.Update. -func (ua *BucketAttrsToUpdate) DeleteLabel(name string) { - if ua.deleteLabels == nil { - ua.deleteLabels = map[string]bool{} - } - ua.deleteLabels[name] = true -} - -func (ua *BucketAttrsToUpdate) toRawBucket() *raw.Bucket { - rb := &raw.Bucket{} - if ua.CORS != nil { - rb.Cors = toRawCORS(ua.CORS) - rb.ForceSendFields = append(rb.ForceSendFields, "Cors") - } - if ua.DefaultEventBasedHold != nil { - rb.DefaultEventBasedHold = optional.ToBool(ua.DefaultEventBasedHold) - rb.ForceSendFields = append(rb.ForceSendFields, "DefaultEventBasedHold") - } - if ua.RetentionPolicy != nil { - if ua.RetentionPolicy.RetentionPeriod == 0 { - rb.NullFields = append(rb.NullFields, "RetentionPolicy") - rb.RetentionPolicy = nil - } else { - rb.RetentionPolicy = ua.RetentionPolicy.toRawRetentionPolicy() - } - } - if ua.VersioningEnabled != nil { - rb.Versioning = &raw.BucketVersioning{ - Enabled: optional.ToBool(ua.VersioningEnabled), - ForceSendFields: []string{"Enabled"}, - } - } - if ua.RequesterPays != nil { - rb.Billing = &raw.BucketBilling{ - RequesterPays: optional.ToBool(ua.RequesterPays), - ForceSendFields: []string{"RequesterPays"}, - } - } - if ua.BucketPolicyOnly != nil { - rb.IamConfiguration = &raw.BucketIamConfiguration{ - UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ - Enabled: ua.BucketPolicyOnly.Enabled, - ForceSendFields: []string{"Enabled"}, - }, - } - } - if ua.UniformBucketLevelAccess != nil { - rb.IamConfiguration = &raw.BucketIamConfiguration{ - UniformBucketLevelAccess: &raw.BucketIamConfigurationUniformBucketLevelAccess{ - Enabled: ua.UniformBucketLevelAccess.Enabled, - ForceSendFields: []string{"Enabled"}, - }, - } - } - if ua.Encryption != nil { - if ua.Encryption.DefaultKMSKeyName == "" { - rb.NullFields = append(rb.NullFields, "Encryption") - rb.Encryption = nil - } else { - rb.Encryption = ua.Encryption.toRawBucketEncryption() - } - } - if ua.Lifecycle != nil { - rb.Lifecycle = toRawLifecycle(*ua.Lifecycle) - rb.ForceSendFields = append(rb.ForceSendFields, "Lifecycle") - } - if ua.Logging != nil { - if *ua.Logging == (BucketLogging{}) { - rb.NullFields = append(rb.NullFields, "Logging") - rb.Logging = nil - } else { - rb.Logging = ua.Logging.toRawBucketLogging() - } - } - if ua.Website != nil { - if *ua.Website == (BucketWebsite{}) { - rb.NullFields = append(rb.NullFields, "Website") - rb.Website = nil - } else { - rb.Website = ua.Website.toRawBucketWebsite() - } - } - if ua.PredefinedACL != "" { - // Clear ACL or the call will fail. - rb.Acl = nil - rb.ForceSendFields = append(rb.ForceSendFields, "Acl") - } - if ua.PredefinedDefaultObjectACL != "" { - // Clear ACLs or the call will fail. - rb.DefaultObjectAcl = nil - rb.ForceSendFields = append(rb.ForceSendFields, "DefaultObjectAcl") - } - if ua.setLabels != nil || ua.deleteLabels != nil { - rb.Labels = map[string]string{} - for k, v := range ua.setLabels { - rb.Labels[k] = v - } - if len(rb.Labels) == 0 && len(ua.deleteLabels) > 0 { - rb.ForceSendFields = append(rb.ForceSendFields, "Labels") - } - for l := range ua.deleteLabels { - rb.NullFields = append(rb.NullFields, "Labels."+l) - } - } - return rb -} - -// If returns a new BucketHandle that applies a set of preconditions. -// Preconditions already set on the BucketHandle are ignored. -// Operations on the new handle will return an error if the preconditions are not -// satisfied. The only valid preconditions for buckets are MetagenerationMatch -// and MetagenerationNotMatch. -func (b *BucketHandle) If(conds BucketConditions) *BucketHandle { - b2 := *b - b2.conds = &conds - return &b2 -} - -// BucketConditions constrain bucket methods to act on specific metagenerations. -// -// The zero value is an empty set of constraints. -type BucketConditions struct { - // MetagenerationMatch specifies that the bucket must have the given - // metageneration for the operation to occur. - // If MetagenerationMatch is zero, it has no effect. - MetagenerationMatch int64 - - // MetagenerationNotMatch specifies that the bucket must not have the given - // metageneration for the operation to occur. - // If MetagenerationNotMatch is zero, it has no effect. - MetagenerationNotMatch int64 -} - -func (c *BucketConditions) validate(method string) error { - if *c == (BucketConditions{}) { - return fmt.Errorf("storage: %s: empty conditions", method) - } - if c.MetagenerationMatch != 0 && c.MetagenerationNotMatch != 0 { - return fmt.Errorf("storage: %s: multiple conditions specified for metageneration", method) - } - return nil -} - -// UserProject returns a new BucketHandle that passes the project ID as the user -// project for all subsequent calls. Calls with a user project will be billed to that -// project rather than to the bucket's owning project. -// -// A user project is required for all operations on Requester Pays buckets. -func (b *BucketHandle) UserProject(projectID string) *BucketHandle { - b2 := *b - b2.userProject = projectID - b2.acl.userProject = projectID - b2.defaultObjectACL.userProject = projectID - return &b2 -} - -// LockRetentionPolicy locks a bucket's retention policy until a previously-configured -// RetentionPeriod past the EffectiveTime. Note that if RetentionPeriod is set to less -// than a day, the retention policy is treated as a development configuration and locking -// will have no effect. The BucketHandle must have a metageneration condition that -// matches the bucket's metageneration. See BucketHandle.If. -// -// This feature is in private alpha release. It is not currently available to -// most customers. It might be changed in backwards-incompatible ways and is not -// subject to any SLA or deprecation policy. -func (b *BucketHandle) LockRetentionPolicy(ctx context.Context) error { - var metageneration int64 - if b.conds != nil { - metageneration = b.conds.MetagenerationMatch - } - req := b.c.raw.Buckets.LockRetentionPolicy(b.name, metageneration) - _, err := req.Context(ctx).Do() - return err -} - -// applyBucketConds modifies the provided call using the conditions in conds. -// call is something that quacks like a *raw.WhateverCall. -func applyBucketConds(method string, conds *BucketConditions, call interface{}) error { - if conds == nil { - return nil - } - if err := conds.validate(method); err != nil { - return err - } - cval := reflect.ValueOf(call) - switch { - case conds.MetagenerationMatch != 0: - if !setConditionField(cval, "IfMetagenerationMatch", conds.MetagenerationMatch) { - return fmt.Errorf("storage: %s: ifMetagenerationMatch not supported", method) - } - case conds.MetagenerationNotMatch != 0: - if !setConditionField(cval, "IfMetagenerationNotMatch", conds.MetagenerationNotMatch) { - return fmt.Errorf("storage: %s: ifMetagenerationNotMatch not supported", method) - } - } - return nil -} - -func (rp *RetentionPolicy) toRawRetentionPolicy() *raw.BucketRetentionPolicy { - if rp == nil { - return nil - } - return &raw.BucketRetentionPolicy{ - RetentionPeriod: int64(rp.RetentionPeriod / time.Second), - } -} - -func toRetentionPolicy(rp *raw.BucketRetentionPolicy) (*RetentionPolicy, error) { - if rp == nil { - return nil, nil - } - t, err := time.Parse(time.RFC3339, rp.EffectiveTime) - if err != nil { - return nil, err - } - return &RetentionPolicy{ - RetentionPeriod: time.Duration(rp.RetentionPeriod) * time.Second, - EffectiveTime: t, - IsLocked: rp.IsLocked, - }, nil -} - -func toRawCORS(c []CORS) []*raw.BucketCors { - var out []*raw.BucketCors - for _, v := range c { - out = append(out, &raw.BucketCors{ - MaxAgeSeconds: int64(v.MaxAge / time.Second), - Method: v.Methods, - Origin: v.Origins, - ResponseHeader: v.ResponseHeaders, - }) - } - return out -} - -func toCORS(rc []*raw.BucketCors) []CORS { - var out []CORS - for _, v := range rc { - out = append(out, CORS{ - MaxAge: time.Duration(v.MaxAgeSeconds) * time.Second, - Methods: v.Method, - Origins: v.Origin, - ResponseHeaders: v.ResponseHeader, - }) - } - return out -} - -func toRawLifecycle(l Lifecycle) *raw.BucketLifecycle { - var rl raw.BucketLifecycle - if len(l.Rules) == 0 { - rl.ForceSendFields = []string{"Rule"} - } - for _, r := range l.Rules { - rr := &raw.BucketLifecycleRule{ - Action: &raw.BucketLifecycleRuleAction{ - Type: r.Action.Type, - StorageClass: r.Action.StorageClass, - }, - Condition: &raw.BucketLifecycleRuleCondition{ - Age: r.Condition.AgeInDays, - MatchesStorageClass: r.Condition.MatchesStorageClasses, - NumNewerVersions: r.Condition.NumNewerVersions, - }, - } - - switch r.Condition.Liveness { - case LiveAndArchived: - rr.Condition.IsLive = nil - case Live: - rr.Condition.IsLive = googleapi.Bool(true) - case Archived: - rr.Condition.IsLive = googleapi.Bool(false) - } - - if !r.Condition.CreatedBefore.IsZero() { - rr.Condition.CreatedBefore = r.Condition.CreatedBefore.Format(rfc3339Date) - } - rl.Rule = append(rl.Rule, rr) - } - return &rl -} - -func toLifecycle(rl *raw.BucketLifecycle) Lifecycle { - var l Lifecycle - if rl == nil { - return l - } - for _, rr := range rl.Rule { - r := LifecycleRule{ - Action: LifecycleAction{ - Type: rr.Action.Type, - StorageClass: rr.Action.StorageClass, - }, - Condition: LifecycleCondition{ - AgeInDays: rr.Condition.Age, - MatchesStorageClasses: rr.Condition.MatchesStorageClass, - NumNewerVersions: rr.Condition.NumNewerVersions, - }, - } - - if rr.Condition.IsLive == nil { - r.Condition.Liveness = LiveAndArchived - } else if *rr.Condition.IsLive { - r.Condition.Liveness = Live - } else { - r.Condition.Liveness = Archived - } - - if rr.Condition.CreatedBefore != "" { - r.Condition.CreatedBefore, _ = time.Parse(rfc3339Date, rr.Condition.CreatedBefore) - } - l.Rules = append(l.Rules, r) - } - return l -} - -func (e *BucketEncryption) toRawBucketEncryption() *raw.BucketEncryption { - if e == nil { - return nil - } - return &raw.BucketEncryption{ - DefaultKmsKeyName: e.DefaultKMSKeyName, - } -} - -func toBucketEncryption(e *raw.BucketEncryption) *BucketEncryption { - if e == nil { - return nil - } - return &BucketEncryption{DefaultKMSKeyName: e.DefaultKmsKeyName} -} - -func (b *BucketLogging) toRawBucketLogging() *raw.BucketLogging { - if b == nil { - return nil - } - return &raw.BucketLogging{ - LogBucket: b.LogBucket, - LogObjectPrefix: b.LogObjectPrefix, - } -} - -func toBucketLogging(b *raw.BucketLogging) *BucketLogging { - if b == nil { - return nil - } - return &BucketLogging{ - LogBucket: b.LogBucket, - LogObjectPrefix: b.LogObjectPrefix, - } -} - -func (w *BucketWebsite) toRawBucketWebsite() *raw.BucketWebsite { - if w == nil { - return nil - } - return &raw.BucketWebsite{ - MainPageSuffix: w.MainPageSuffix, - NotFoundPage: w.NotFoundPage, - } -} - -func toBucketWebsite(w *raw.BucketWebsite) *BucketWebsite { - if w == nil { - return nil - } - return &BucketWebsite{ - MainPageSuffix: w.MainPageSuffix, - NotFoundPage: w.NotFoundPage, - } -} - -func toBucketPolicyOnly(b *raw.BucketIamConfiguration) BucketPolicyOnly { - if b == nil || b.BucketPolicyOnly == nil || !b.BucketPolicyOnly.Enabled { - return BucketPolicyOnly{} - } - lt, err := time.Parse(time.RFC3339, b.BucketPolicyOnly.LockedTime) - if err != nil { - return BucketPolicyOnly{ - Enabled: true, - } - } - return BucketPolicyOnly{ - Enabled: true, - LockedTime: lt, - } -} - -func toUniformBucketLevelAccess(b *raw.BucketIamConfiguration) UniformBucketLevelAccess { - if b == nil || b.UniformBucketLevelAccess == nil || !b.UniformBucketLevelAccess.Enabled { - return UniformBucketLevelAccess{} - } - lt, err := time.Parse(time.RFC3339, b.UniformBucketLevelAccess.LockedTime) - if err != nil { - return UniformBucketLevelAccess{ - Enabled: true, - } - } - return UniformBucketLevelAccess{ - Enabled: true, - LockedTime: lt, - } -} - -// Objects returns an iterator over the objects in the bucket that match the Query q. -// If q is nil, no filtering is done. -// -// Note: The returned iterator is not safe for concurrent operations without explicit synchronization. -func (b *BucketHandle) Objects(ctx context.Context, q *Query) *ObjectIterator { - it := &ObjectIterator{ - ctx: ctx, - bucket: b, - } - it.pageInfo, it.nextFunc = iterator.NewPageInfo( - it.fetch, - func() int { return len(it.items) }, - func() interface{} { b := it.items; it.items = nil; return b }) - if q != nil { - it.query = *q - } - return it -} - -// An ObjectIterator is an iterator over ObjectAttrs. -// -// Note: This iterator is not safe for concurrent operations without explicit synchronization. -type ObjectIterator struct { - ctx context.Context - bucket *BucketHandle - query Query - pageInfo *iterator.PageInfo - nextFunc func() error - items []*ObjectAttrs -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -// -// Note: This method is not safe for concurrent operations without explicit synchronization. -func (it *ObjectIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } - -// Next returns the next result. Its second return value is iterator.Done if -// there are no more results. Once Next returns iterator.Done, all subsequent -// calls will return iterator.Done. -// -// If Query.Delimiter is non-empty, some of the ObjectAttrs returned by Next will -// have a non-empty Prefix field, and a zero value for all other fields. These -// represent prefixes. -// -// Note: This method is not safe for concurrent operations without explicit synchronization. -func (it *ObjectIterator) Next() (*ObjectAttrs, error) { - if err := it.nextFunc(); err != nil { - return nil, err - } - item := it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *ObjectIterator) fetch(pageSize int, pageToken string) (string, error) { - req := it.bucket.c.raw.Objects.List(it.bucket.name) - setClientHeader(req.Header()) - req.Projection("full") - req.Delimiter(it.query.Delimiter) - req.Prefix(it.query.Prefix) - req.Versions(it.query.Versions) - if len(it.query.fieldSelection) > 0 { - req.Fields("nextPageToken", googleapi.Field(it.query.fieldSelection)) - } - req.PageToken(pageToken) - if it.bucket.userProject != "" { - req.UserProject(it.bucket.userProject) - } - if pageSize > 0 { - req.MaxResults(int64(pageSize)) - } - var resp *raw.Objects - var err error - err = runWithRetry(it.ctx, func() error { - resp, err = req.Context(it.ctx).Do() - return err - }) - if err != nil { - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { - err = ErrBucketNotExist - } - return "", err - } - for _, item := range resp.Items { - it.items = append(it.items, newObject(item)) - } - for _, prefix := range resp.Prefixes { - it.items = append(it.items, &ObjectAttrs{Prefix: prefix}) - } - return resp.NextPageToken, nil -} - -// Buckets returns an iterator over the buckets in the project. You may -// optionally set the iterator's Prefix field to restrict the list to buckets -// whose names begin with the prefix. By default, all buckets in the project -// are returned. -// -// Note: The returned iterator is not safe for concurrent operations without explicit synchronization. -func (c *Client) Buckets(ctx context.Context, projectID string) *BucketIterator { - it := &BucketIterator{ - ctx: ctx, - client: c, - projectID: projectID, - } - it.pageInfo, it.nextFunc = iterator.NewPageInfo( - it.fetch, - func() int { return len(it.buckets) }, - func() interface{} { b := it.buckets; it.buckets = nil; return b }) - - return it -} - -// A BucketIterator is an iterator over BucketAttrs. -// -// Note: This iterator is not safe for concurrent operations without explicit synchronization. -type BucketIterator struct { - // Prefix restricts the iterator to buckets whose names begin with it. - Prefix string - - ctx context.Context - client *Client - projectID string - buckets []*BucketAttrs - pageInfo *iterator.PageInfo - nextFunc func() error -} - -// Next returns the next result. Its second return value is iterator.Done if -// there are no more results. Once Next returns iterator.Done, all subsequent -// calls will return iterator.Done. -// -// Note: This method is not safe for concurrent operations without explicit synchronization. -func (it *BucketIterator) Next() (*BucketAttrs, error) { - if err := it.nextFunc(); err != nil { - return nil, err - } - b := it.buckets[0] - it.buckets = it.buckets[1:] - return b, nil -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -// -// Note: This method is not safe for concurrent operations without explicit synchronization. -func (it *BucketIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } - -func (it *BucketIterator) fetch(pageSize int, pageToken string) (token string, err error) { - req := it.client.raw.Buckets.List(it.projectID) - setClientHeader(req.Header()) - req.Projection("full") - req.Prefix(it.Prefix) - req.PageToken(pageToken) - if pageSize > 0 { - req.MaxResults(int64(pageSize)) - } - var resp *raw.Buckets - err = runWithRetry(it.ctx, func() error { - resp, err = req.Context(it.ctx).Do() - return err - }) - if err != nil { - return "", err - } - for _, item := range resp.Items { - b, err := newBucket(item) - if err != nil { - return "", err - } - it.buckets = append(it.buckets, b) - } - return resp.NextPageToken, nil -} diff --git a/ibm/vendor/cloud.google.com/go/storage/copy.go b/ibm/vendor/cloud.google.com/go/storage/copy.go deleted file mode 100644 index 61983df5ad..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/copy.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 storage - -import ( - "context" - "errors" - "fmt" - - "cloud.google.com/go/internal/trace" - raw "google.golang.org/api/storage/v1" -) - -// CopierFrom creates a Copier that can copy src to dst. -// You can immediately call Run on the returned Copier, or -// you can configure it first. -// -// For Requester Pays buckets, the user project of dst is billed, unless it is empty, -// in which case the user project of src is billed. -func (dst *ObjectHandle) CopierFrom(src *ObjectHandle) *Copier { - return &Copier{dst: dst, src: src} -} - -// A Copier copies a source object to a destination. -type Copier struct { - // ObjectAttrs are optional attributes to set on the destination object. - // Any attributes must be initialized before any calls on the Copier. Nil - // or zero-valued attributes are ignored. - ObjectAttrs - - // RewriteToken can be set before calling Run to resume a copy - // operation. After Run returns a non-nil error, RewriteToken will - // have been updated to contain the value needed to resume the copy. - RewriteToken string - - // ProgressFunc can be used to monitor the progress of a multi-RPC copy - // operation. If ProgressFunc is not nil and copying requires multiple - // calls to the underlying service (see - // https://cloud.google.com/storage/docs/json_api/v1/objects/rewrite), then - // ProgressFunc will be invoked after each call with the number of bytes of - // content copied so far and the total size in bytes of the source object. - // - // ProgressFunc is intended to make upload progress available to the - // application. For example, the implementation of ProgressFunc may update - // a progress bar in the application's UI, or log the result of - // float64(copiedBytes)/float64(totalBytes). - // - // ProgressFunc should return quickly without blocking. - ProgressFunc func(copiedBytes, totalBytes uint64) - - // The Cloud KMS key, in the form projects/P/locations/L/keyRings/R/cryptoKeys/K, - // that will be used to encrypt the object. Overrides the object's KMSKeyName, if - // any. - // - // Providing both a DestinationKMSKeyName and a customer-supplied encryption key - // (via ObjectHandle.Key) on the destination object will result in an error when - // Run is called. - DestinationKMSKeyName string - - dst, src *ObjectHandle -} - -// Run performs the copy. -func (c *Copier) Run(ctx context.Context) (attrs *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Copier.Run") - defer func() { trace.EndSpan(ctx, err) }() - - if err := c.src.validate(); err != nil { - return nil, err - } - if err := c.dst.validate(); err != nil { - return nil, err - } - if c.DestinationKMSKeyName != "" && c.dst.encryptionKey != nil { - return nil, errors.New("storage: cannot use DestinationKMSKeyName with a customer-supplied encryption key") - } - // Convert destination attributes to raw form, omitting the bucket. - // If the bucket is included but name or content-type aren't, the service - // returns a 400 with "Required" as the only message. Omitting the bucket - // does not cause any problems. - rawObject := c.ObjectAttrs.toRawObject("") - for { - res, err := c.callRewrite(ctx, rawObject) - if err != nil { - return nil, err - } - if c.ProgressFunc != nil { - c.ProgressFunc(uint64(res.TotalBytesRewritten), uint64(res.ObjectSize)) - } - if res.Done { // Finished successfully. - return newObject(res.Resource), nil - } - } -} - -func (c *Copier) callRewrite(ctx context.Context, rawObj *raw.Object) (*raw.RewriteResponse, error) { - call := c.dst.c.raw.Objects.Rewrite(c.src.bucket, c.src.object, c.dst.bucket, c.dst.object, rawObj) - - call.Context(ctx).Projection("full") - if c.RewriteToken != "" { - call.RewriteToken(c.RewriteToken) - } - if c.DestinationKMSKeyName != "" { - call.DestinationKmsKeyName(c.DestinationKMSKeyName) - } - if c.PredefinedACL != "" { - call.DestinationPredefinedAcl(c.PredefinedACL) - } - if err := applyConds("Copy destination", c.dst.gen, c.dst.conds, call); err != nil { - return nil, err - } - if c.dst.userProject != "" { - call.UserProject(c.dst.userProject) - } else if c.src.userProject != "" { - call.UserProject(c.src.userProject) - } - if err := applySourceConds(c.src.gen, c.src.conds, call); err != nil { - return nil, err - } - if err := setEncryptionHeaders(call.Header(), c.dst.encryptionKey, false); err != nil { - return nil, err - } - if err := setEncryptionHeaders(call.Header(), c.src.encryptionKey, true); err != nil { - return nil, err - } - var res *raw.RewriteResponse - var err error - setClientHeader(call.Header()) - err = runWithRetry(ctx, func() error { res, err = call.Do(); return err }) - if err != nil { - return nil, err - } - c.RewriteToken = res.RewriteToken - return res, nil -} - -// ComposerFrom creates a Composer that can compose srcs into dst. -// You can immediately call Run on the returned Composer, or you can -// configure it first. -// -// The encryption key for the destination object will be used to decrypt all -// source objects and encrypt the destination object. It is an error -// to specify an encryption key for any of the source objects. -func (dst *ObjectHandle) ComposerFrom(srcs ...*ObjectHandle) *Composer { - return &Composer{dst: dst, srcs: srcs} -} - -// A Composer composes source objects into a destination object. -// -// For Requester Pays buckets, the user project of dst is billed. -type Composer struct { - // ObjectAttrs are optional attributes to set on the destination object. - // Any attributes must be initialized before any calls on the Composer. Nil - // or zero-valued attributes are ignored. - ObjectAttrs - - // SendCRC specifies whether to transmit a CRC32C field. It should be set - // to true in addition to setting the Composer's CRC32C field, because zero - // is a valid CRC and normally a zero would not be transmitted. - // If a CRC32C is sent, and the data in the destination object does not match - // the checksum, the compose will be rejected. - SendCRC32C bool - - dst *ObjectHandle - srcs []*ObjectHandle -} - -// Run performs the compose operation. -func (c *Composer) Run(ctx context.Context) (attrs *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Composer.Run") - defer func() { trace.EndSpan(ctx, err) }() - - if err := c.dst.validate(); err != nil { - return nil, err - } - if len(c.srcs) == 0 { - return nil, errors.New("storage: at least one source object must be specified") - } - - req := &raw.ComposeRequest{} - // Compose requires a non-empty Destination, so we always set it, - // even if the caller-provided ObjectAttrs is the zero value. - req.Destination = c.ObjectAttrs.toRawObject(c.dst.bucket) - if c.SendCRC32C { - req.Destination.Crc32c = encodeUint32(c.ObjectAttrs.CRC32C) - } - for _, src := range c.srcs { - if err := src.validate(); err != nil { - return nil, err - } - if src.bucket != c.dst.bucket { - return nil, fmt.Errorf("storage: all source objects must be in bucket %q, found %q", c.dst.bucket, src.bucket) - } - if src.encryptionKey != nil { - return nil, fmt.Errorf("storage: compose source %s.%s must not have encryption key", src.bucket, src.object) - } - srcObj := &raw.ComposeRequestSourceObjects{ - Name: src.object, - } - if err := applyConds("ComposeFrom source", src.gen, src.conds, composeSourceObj{srcObj}); err != nil { - return nil, err - } - req.SourceObjects = append(req.SourceObjects, srcObj) - } - - call := c.dst.c.raw.Objects.Compose(c.dst.bucket, c.dst.object, req).Context(ctx) - if err := applyConds("ComposeFrom destination", c.dst.gen, c.dst.conds, call); err != nil { - return nil, err - } - if c.dst.userProject != "" { - call.UserProject(c.dst.userProject) - } - if c.PredefinedACL != "" { - call.DestinationPredefinedAcl(c.PredefinedACL) - } - if err := setEncryptionHeaders(call.Header(), c.dst.encryptionKey, false); err != nil { - return nil, err - } - var obj *raw.Object - setClientHeader(call.Header()) - err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) - if err != nil { - return nil, err - } - return newObject(obj), nil -} diff --git a/ibm/vendor/cloud.google.com/go/storage/doc.go b/ibm/vendor/cloud.google.com/go/storage/doc.go deleted file mode 100644 index 614ea11a59..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/doc.go +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 storage provides an easy way to work with Google Cloud Storage. -Google Cloud Storage stores data in named objects, which are grouped into buckets. - -More information about Google Cloud Storage is available at -https://cloud.google.com/storage/docs. - -See https://godoc.org/cloud.google.com/go for authentication, timeouts, -connection pooling and similar aspects of this package. - -All of the methods of this package use exponential backoff to retry calls that fail -with certain errors, as described in -https://cloud.google.com/storage/docs/exponential-backoff. Retrying continues -indefinitely unless the controlling context is canceled or the client is closed. See -context.WithTimeout and context.WithCancel. - - -Creating a Client - -To start working with this package, create a client: - - ctx := context.Background() - client, err := storage.NewClient(ctx) - if err != nil { - // TODO: Handle error. - } - -The client will use your default application credentials. - -If you only wish to access public data, you can create -an unauthenticated client with - - client, err := storage.NewClient(ctx, option.WithoutAuthentication()) - -Buckets - -A Google Cloud Storage bucket is a collection of objects. To work with a -bucket, make a bucket handle: - - bkt := client.Bucket(bucketName) - -A handle is a reference to a bucket. You can have a handle even if the -bucket doesn't exist yet. To create a bucket in Google Cloud Storage, -call Create on the handle: - - if err := bkt.Create(ctx, projectID, nil); err != nil { - // TODO: Handle error. - } - -Note that although buckets are associated with projects, bucket names are -global across all projects. - -Each bucket has associated metadata, represented in this package by -BucketAttrs. The third argument to BucketHandle.Create allows you to set -the initial BucketAttrs of a bucket. To retrieve a bucket's attributes, use -Attrs: - - attrs, err := bkt.Attrs(ctx) - if err != nil { - // TODO: Handle error. - } - fmt.Printf("bucket %s, created at %s, is located in %s with storage class %s\n", - attrs.Name, attrs.Created, attrs.Location, attrs.StorageClass) - -Objects - -An object holds arbitrary data as a sequence of bytes, like a file. You -refer to objects using a handle, just as with buckets, but unlike buckets -you don't explicitly create an object. Instead, the first time you write -to an object it will be created. You can use the standard Go io.Reader -and io.Writer interfaces to read and write object data: - - obj := bkt.Object("data") - // Write something to obj. - // w implements io.Writer. - w := obj.NewWriter(ctx) - // Write some text to obj. This will either create the object or overwrite whatever is there already. - if _, err := fmt.Fprintf(w, "This object contains text.\n"); err != nil { - // TODO: Handle error. - } - // Close, just like writing a file. - if err := w.Close(); err != nil { - // TODO: Handle error. - } - - // Read it back. - r, err := obj.NewReader(ctx) - if err != nil { - // TODO: Handle error. - } - defer r.Close() - if _, err := io.Copy(os.Stdout, r); err != nil { - // TODO: Handle error. - } - // Prints "This object contains text." - -Objects also have attributes, which you can fetch with Attrs: - - objAttrs, err := obj.Attrs(ctx) - if err != nil { - // TODO: Handle error. - } - fmt.Printf("object %s has size %d and can be read using %s\n", - objAttrs.Name, objAttrs.Size, objAttrs.MediaLink) - -Listing objects - -Listing objects in a bucket is done with the Bucket.Objects method: - - query := &storage.Query{Prefix: ""} - - var names []string - it := bkt.Objects(ctx, query) - for { - attrs, err := it.Next() - if err == iterator.Done { - break - } - if err != nil { - log.Fatal(err) - } - names = append(names, attrs.Name) - } - -If only a subset of object attributes is needed when listing, specifying this -subset using Query.SetAttrSelection may speed up the listing process: - - query := &storage.Query{Prefix: ""} - query.SetAttrSelection([]string{"Name"}) - - // ... as before - -ACLs - -Both objects and buckets have ACLs (Access Control Lists). An ACL is a list of -ACLRules, each of which specifies the role of a user, group or project. ACLs -are suitable for fine-grained control, but you may prefer using IAM to control -access at the project level (see -https://cloud.google.com/storage/docs/access-control/iam). - -To list the ACLs of a bucket or object, obtain an ACLHandle and call its List method: - - acls, err := obj.ACL().List(ctx) - if err != nil { - // TODO: Handle error. - } - for _, rule := range acls { - fmt.Printf("%s has role %s\n", rule.Entity, rule.Role) - } - -You can also set and delete ACLs. - -Conditions - -Every object has a generation and a metageneration. The generation changes -whenever the content changes, and the metageneration changes whenever the -metadata changes. Conditions let you check these values before an operation; -the operation only executes if the conditions match. You can use conditions to -prevent race conditions in read-modify-write operations. - -For example, say you've read an object's metadata into objAttrs. Now -you want to write to that object, but only if its contents haven't changed -since you read it. Here is how to express that: - - w = obj.If(storage.Conditions{GenerationMatch: objAttrs.Generation}).NewWriter(ctx) - // Proceed with writing as above. - -Signed URLs - -You can obtain a URL that lets anyone read or write an object for a limited time. -You don't need to create a client to do this. See the documentation of -SignedURL for details. - - url, err := storage.SignedURL(bucketName, "shared-object", opts) - if err != nil { - // TODO: Handle error. - } - fmt.Println(url) - -Post Policy V4 Signed Request - -A type of signed request that allows uploads through HTML forms directly to Cloud Storage with -temporary permission. Conditions can be applied to restrict how the HTML form is used and exercised -by a user. - -For more information, please see https://cloud.google.com/storage/docs/xml-api/post-object as well -as the documentation of GenerateSignedPostPolicyV4. - - pv4, err := storage.GenerateSignedPostPolicyV4(bucketName, objectName, opts) - if err != nil { - // TODO: Handle error. - } - fmt.Printf("URL: %s\nFields; %v\n", pv4.URL, pv4.Fields) - -Errors - -Errors returned by this client are often of the type [`googleapi.Error`](https://godoc.org/google.golang.org/api/googleapi#Error). -These errors can be introspected for more information by type asserting to the richer `googleapi.Error` type. For example: - - if e, ok := err.(*googleapi.Error); ok { - if e.Code == 409 { ... } - } -*/ -package storage // import "cloud.google.com/go/storage" diff --git a/ibm/vendor/cloud.google.com/go/storage/go110.go b/ibm/vendor/cloud.google.com/go/storage/go110.go deleted file mode 100644 index c1273d59ad..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/go110.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2017 Google LLC -// -// 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. - -// +build go1.10 - -package storage - -import ( - "net/url" - "strings" - - "google.golang.org/api/googleapi" -) - -func shouldRetry(err error) bool { - switch e := err.(type) { - case *googleapi.Error: - // Retry on 429 and 5xx, according to - // https://cloud.google.com/storage/docs/exponential-backoff. - return e.Code == 429 || (e.Code >= 500 && e.Code < 600) - case *url.Error: - // Retry socket-level errors ECONNREFUSED and ENETUNREACH (from syscall). - // Unfortunately the error type is unexported, so we resort to string - // matching. - retriable := []string{"connection refused", "connection reset"} - for _, s := range retriable { - if strings.Contains(e.Error(), s) { - return true - } - } - return false - case interface{ Temporary() bool }: - return e.Temporary() - default: - return false - } -} diff --git a/ibm/vendor/cloud.google.com/go/storage/go_mod_tidy_hack.go b/ibm/vendor/cloud.google.com/go/storage/go_mod_tidy_hack.go deleted file mode 100644 index 7df7a1d715..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/go_mod_tidy_hack.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019 Google LLC -// -// 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 cloud.google.com/go import, won't actually become part of -// the resultant binary. -// +build modhack - -package storage - -// 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 _ "cloud.google.com/go" diff --git a/ibm/vendor/cloud.google.com/go/storage/hmac.go b/ibm/vendor/cloud.google.com/go/storage/hmac.go deleted file mode 100644 index 7d8185f37b..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/hmac.go +++ /dev/null @@ -1,441 +0,0 @@ -// Copyright 2019 Google LLC -// -// 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 storage - -import ( - "context" - "errors" - "fmt" - "time" - - "google.golang.org/api/iterator" - raw "google.golang.org/api/storage/v1" -) - -// HMACState is the state of the HMAC key. -// -// This type is EXPERIMENTAL and subject to change or removal without notice. -type HMACState string - -const ( - // Active is the status for an active key that can be used to sign - // requests. - Active HMACState = "ACTIVE" - - // Inactive is the status for an inactive key thus requests signed by - // this key will be denied. - Inactive HMACState = "INACTIVE" - - // Deleted is the status for a key that is deleted. - // Once in this state the key cannot key cannot be recovered - // and does not count towards key limits. Deleted keys will be cleaned - // up later. - Deleted HMACState = "DELETED" -) - -// HMACKey is the representation of a Google Cloud Storage HMAC key. -// -// HMAC keys are used to authenticate signed access to objects. To enable HMAC key -// authentication, please visit https://cloud.google.com/storage/docs/migrating. -// -// This type is EXPERIMENTAL and subject to change or removal without notice. -type HMACKey struct { - // The HMAC's secret key. - Secret string - - // AccessID is the ID of the HMAC key. - AccessID string - - // Etag is the HTTP/1.1 Entity tag. - Etag string - - // ID is the ID of the HMAC key, including the ProjectID and AccessID. - ID string - - // ProjectID is the ID of the project that owns the - // service account to which the key authenticates. - ProjectID string - - // ServiceAccountEmail is the email address - // of the key's associated service account. - ServiceAccountEmail string - - // CreatedTime is the creation time of the HMAC key. - CreatedTime time.Time - - // UpdatedTime is the last modification time of the HMAC key metadata. - UpdatedTime time.Time - - // State is the state of the HMAC key. - // It can be one of StateActive, StateInactive or StateDeleted. - State HMACState -} - -// HMACKeyHandle helps provide access and management for HMAC keys. -// -// This type is EXPERIMENTAL and subject to change or removal without notice. -type HMACKeyHandle struct { - projectID string - accessID string - - raw *raw.ProjectsHmacKeysService -} - -// HMACKeyHandle creates a handle that will be used for HMACKey operations. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (c *Client) HMACKeyHandle(projectID, accessID string) *HMACKeyHandle { - return &HMACKeyHandle{ - projectID: projectID, - accessID: accessID, - raw: raw.NewProjectsHmacKeysService(c.raw), - } -} - -// Get invokes an RPC to retrieve the HMAC key referenced by the -// HMACKeyHandle's accessID. -// -// Options such as UserProjectForHMACKeys can be used to set the -// userProject to be billed against for operations. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (hkh *HMACKeyHandle) Get(ctx context.Context, opts ...HMACKeyOption) (*HMACKey, error) { - call := hkh.raw.Get(hkh.projectID, hkh.accessID) - - desc := new(hmacKeyDesc) - for _, opt := range opts { - opt.withHMACKeyDesc(desc) - } - if desc.userProjectID != "" { - call = call.UserProject(desc.userProjectID) - } - - setClientHeader(call.Header()) - - var metadata *raw.HmacKeyMetadata - var err error - err = runWithRetry(ctx, func() error { - metadata, err = call.Context(ctx).Do() - return err - }) - if err != nil { - return nil, err - } - - hkPb := &raw.HmacKey{ - Metadata: metadata, - } - return pbHmacKeyToHMACKey(hkPb, false) -} - -// Delete invokes an RPC to delete the key referenced by accessID, on Google Cloud Storage. -// Only inactive HMAC keys can be deleted. -// After deletion, a key cannot be used to authenticate requests. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (hkh *HMACKeyHandle) Delete(ctx context.Context, opts ...HMACKeyOption) error { - delCall := hkh.raw.Delete(hkh.projectID, hkh.accessID) - desc := new(hmacKeyDesc) - for _, opt := range opts { - opt.withHMACKeyDesc(desc) - } - if desc.userProjectID != "" { - delCall = delCall.UserProject(desc.userProjectID) - } - setClientHeader(delCall.Header()) - - return runWithRetry(ctx, func() error { - return delCall.Context(ctx).Do() - }) -} - -func pbHmacKeyToHMACKey(pb *raw.HmacKey, updatedTimeCanBeNil bool) (*HMACKey, error) { - pbmd := pb.Metadata - if pbmd == nil { - return nil, errors.New("field Metadata cannot be nil") - } - createdTime, err := time.Parse(time.RFC3339, pbmd.TimeCreated) - if err != nil { - return nil, fmt.Errorf("field CreatedTime: %v", err) - } - updatedTime, err := time.Parse(time.RFC3339, pbmd.Updated) - if err != nil && !updatedTimeCanBeNil { - return nil, fmt.Errorf("field UpdatedTime: %v", err) - } - - hmk := &HMACKey{ - AccessID: pbmd.AccessId, - Secret: pb.Secret, - Etag: pbmd.Etag, - ID: pbmd.Id, - State: HMACState(pbmd.State), - ProjectID: pbmd.ProjectId, - CreatedTime: createdTime, - UpdatedTime: updatedTime, - - ServiceAccountEmail: pbmd.ServiceAccountEmail, - } - - return hmk, nil -} - -// CreateHMACKey invokes an RPC for Google Cloud Storage to create a new HMACKey. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (c *Client) CreateHMACKey(ctx context.Context, projectID, serviceAccountEmail string, opts ...HMACKeyOption) (*HMACKey, error) { - if projectID == "" { - return nil, errors.New("storage: expecting a non-blank projectID") - } - if serviceAccountEmail == "" { - return nil, errors.New("storage: expecting a non-blank service account email") - } - - svc := raw.NewProjectsHmacKeysService(c.raw) - call := svc.Create(projectID, serviceAccountEmail) - desc := new(hmacKeyDesc) - for _, opt := range opts { - opt.withHMACKeyDesc(desc) - } - if desc.userProjectID != "" { - call = call.UserProject(desc.userProjectID) - } - - setClientHeader(call.Header()) - - var hkPb *raw.HmacKey - var err error - err = runWithRetry(ctx, func() error { - hkPb, err = call.Context(ctx).Do() - return err - }) - if err != nil { - return nil, err - } - - return pbHmacKeyToHMACKey(hkPb, true) -} - -// HMACKeyAttrsToUpdate defines the attributes of an HMACKey that will be updated. -// -// This type is EXPERIMENTAL and subject to change or removal without notice. -type HMACKeyAttrsToUpdate struct { - // State is required and must be either StateActive or StateInactive. - State HMACState - - // Etag is an optional field and it is the HTTP/1.1 Entity tag. - Etag string -} - -// Update mutates the HMACKey referred to by accessID. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (h *HMACKeyHandle) Update(ctx context.Context, au HMACKeyAttrsToUpdate, opts ...HMACKeyOption) (*HMACKey, error) { - if au.State != Active && au.State != Inactive { - return nil, fmt.Errorf("storage: invalid state %q for update, must be either %q or %q", au.State, Active, Inactive) - } - - call := h.raw.Update(h.projectID, h.accessID, &raw.HmacKeyMetadata{ - Etag: au.Etag, - State: string(au.State), - }) - - desc := new(hmacKeyDesc) - for _, opt := range opts { - opt.withHMACKeyDesc(desc) - } - if desc.userProjectID != "" { - call = call.UserProject(desc.userProjectID) - } - setClientHeader(call.Header()) - - var metadata *raw.HmacKeyMetadata - var err error - err = runWithRetry(ctx, func() error { - metadata, err = call.Context(ctx).Do() - return err - }) - - if err != nil { - return nil, err - } - hkPb := &raw.HmacKey{ - Metadata: metadata, - } - return pbHmacKeyToHMACKey(hkPb, false) -} - -// An HMACKeysIterator is an iterator over HMACKeys. -// -// Note: This iterator is not safe for concurrent operations without explicit synchronization. -// -// This type is EXPERIMENTAL and subject to change or removal without notice. -type HMACKeysIterator struct { - ctx context.Context - raw *raw.ProjectsHmacKeysService - projectID string - hmacKeys []*HMACKey - pageInfo *iterator.PageInfo - nextFunc func() error - index int - desc hmacKeyDesc -} - -// ListHMACKeys returns an iterator for listing HMACKeys. -// -// Note: This iterator is not safe for concurrent operations without explicit synchronization. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (c *Client) ListHMACKeys(ctx context.Context, projectID string, opts ...HMACKeyOption) *HMACKeysIterator { - it := &HMACKeysIterator{ - ctx: ctx, - raw: raw.NewProjectsHmacKeysService(c.raw), - projectID: projectID, - } - - for _, opt := range opts { - opt.withHMACKeyDesc(&it.desc) - } - - it.pageInfo, it.nextFunc = iterator.NewPageInfo( - it.fetch, - func() int { return len(it.hmacKeys) - it.index }, - func() interface{} { - prev := it.hmacKeys - it.hmacKeys = it.hmacKeys[:0] - it.index = 0 - return prev - }) - return it -} - -// Next returns the next result. Its second return value is iterator.Done if -// there are no more results. Once Next returns iterator.Done, all subsequent -// calls will return iterator.Done. -// -// Note: This iterator is not safe for concurrent operations without explicit synchronization. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (it *HMACKeysIterator) Next() (*HMACKey, error) { - if err := it.nextFunc(); err != nil { - return nil, err - } - - key := it.hmacKeys[it.index] - it.index++ - - return key, nil -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -// -// Note: This iterator is not safe for concurrent operations without explicit synchronization. -// -// This method is EXPERIMENTAL and subject to change or removal without notice. -func (it *HMACKeysIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } - -func (it *HMACKeysIterator) fetch(pageSize int, pageToken string) (token string, err error) { - call := it.raw.List(it.projectID) - setClientHeader(call.Header()) - if pageToken != "" { - call = call.PageToken(pageToken) - } - if it.desc.showDeletedKeys { - call = call.ShowDeletedKeys(true) - } - if it.desc.userProjectID != "" { - call = call.UserProject(it.desc.userProjectID) - } - if it.desc.forServiceAccountEmail != "" { - call = call.ServiceAccountEmail(it.desc.forServiceAccountEmail) - } - if pageSize > 0 { - call = call.MaxResults(int64(pageSize)) - } - - ctx := it.ctx - var resp *raw.HmacKeysMetadata - err = runWithRetry(it.ctx, func() error { - resp, err = call.Context(ctx).Do() - return err - }) - if err != nil { - return "", err - } - - for _, metadata := range resp.Items { - hkPb := &raw.HmacKey{ - Metadata: metadata, - } - hkey, err := pbHmacKeyToHMACKey(hkPb, true) - if err != nil { - return "", err - } - it.hmacKeys = append(it.hmacKeys, hkey) - } - return resp.NextPageToken, nil -} - -type hmacKeyDesc struct { - forServiceAccountEmail string - showDeletedKeys bool - userProjectID string -} - -// HMACKeyOption configures the behavior of HMACKey related methods and actions. -// -// This interface is EXPERIMENTAL and subject to change or removal without notice. -type HMACKeyOption interface { - withHMACKeyDesc(*hmacKeyDesc) -} - -type hmacKeyDescFunc func(*hmacKeyDesc) - -func (hkdf hmacKeyDescFunc) withHMACKeyDesc(hkd *hmacKeyDesc) { - hkdf(hkd) -} - -// ForHMACKeyServiceAccountEmail returns HMAC Keys that are -// associated with the email address of a service account in the project. -// -// Only one service account email can be used as a filter, so if multiple -// of these options are applied, the last email to be set will be used. -// -// This option is EXPERIMENTAL and subject to change or removal without notice. -func ForHMACKeyServiceAccountEmail(serviceAccountEmail string) HMACKeyOption { - return hmacKeyDescFunc(func(hkd *hmacKeyDesc) { - hkd.forServiceAccountEmail = serviceAccountEmail - }) -} - -// ShowDeletedHMACKeys will also list keys whose state is "DELETED". -// -// This option is EXPERIMENTAL and subject to change or removal without notice. -func ShowDeletedHMACKeys() HMACKeyOption { - return hmacKeyDescFunc(func(hkd *hmacKeyDesc) { - hkd.showDeletedKeys = true - }) -} - -// UserProjectForHMACKeys will bill the request against userProjectID -// if userProjectID is non-empty. -// -// Note: This is a noop right now and only provided for API compatibility. -// -// This option is EXPERIMENTAL and subject to change or removal without notice. -func UserProjectForHMACKeys(userProjectID string) HMACKeyOption { - return hmacKeyDescFunc(func(hkd *hmacKeyDesc) { - hkd.userProjectID = userProjectID - }) -} diff --git a/ibm/vendor/cloud.google.com/go/storage/iam.go b/ibm/vendor/cloud.google.com/go/storage/iam.go deleted file mode 100644 index 5caefb059d..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/iam.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2017 Google LLC -// -// 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 storage - -import ( - "context" - - "cloud.google.com/go/iam" - "cloud.google.com/go/internal/trace" - raw "google.golang.org/api/storage/v1" - iampb "google.golang.org/genproto/googleapis/iam/v1" - "google.golang.org/genproto/googleapis/type/expr" -) - -// IAM provides access to IAM access control for the bucket. -func (b *BucketHandle) IAM() *iam.Handle { - return iam.InternalNewHandleClient(&iamClient{ - raw: b.c.raw, - userProject: b.userProject, - }, b.name) -} - -// iamClient implements the iam.client interface. -type iamClient struct { - raw *raw.Service - userProject string -} - -func (c *iamClient) Get(ctx context.Context, resource string) (p *iampb.Policy, err error) { - return c.GetWithVersion(ctx, resource, 1) -} - -func (c *iamClient) GetWithVersion(ctx context.Context, resource string, requestedPolicyVersion int32) (p *iampb.Policy, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.IAM.Get") - defer func() { trace.EndSpan(ctx, err) }() - - call := c.raw.Buckets.GetIamPolicy(resource).OptionsRequestedPolicyVersion(int64(requestedPolicyVersion)) - setClientHeader(call.Header()) - if c.userProject != "" { - call.UserProject(c.userProject) - } - var rp *raw.Policy - err = runWithRetry(ctx, func() error { - rp, err = call.Context(ctx).Do() - return err - }) - if err != nil { - return nil, err - } - return iamFromStoragePolicy(rp), nil -} - -func (c *iamClient) Set(ctx context.Context, resource string, p *iampb.Policy) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.IAM.Set") - defer func() { trace.EndSpan(ctx, err) }() - - rp := iamToStoragePolicy(p) - call := c.raw.Buckets.SetIamPolicy(resource, rp) - setClientHeader(call.Header()) - if c.userProject != "" { - call.UserProject(c.userProject) - } - return runWithRetry(ctx, func() error { - _, err := call.Context(ctx).Do() - return err - }) -} - -func (c *iamClient) Test(ctx context.Context, resource string, perms []string) (permissions []string, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.IAM.Test") - defer func() { trace.EndSpan(ctx, err) }() - - call := c.raw.Buckets.TestIamPermissions(resource, perms) - setClientHeader(call.Header()) - if c.userProject != "" { - call.UserProject(c.userProject) - } - var res *raw.TestIamPermissionsResponse - err = runWithRetry(ctx, func() error { - res, err = call.Context(ctx).Do() - return err - }) - if err != nil { - return nil, err - } - return res.Permissions, nil -} - -func iamToStoragePolicy(ip *iampb.Policy) *raw.Policy { - return &raw.Policy{ - Bindings: iamToStorageBindings(ip.Bindings), - Etag: string(ip.Etag), - Version: int64(ip.Version), - } -} - -func iamToStorageBindings(ibs []*iampb.Binding) []*raw.PolicyBindings { - var rbs []*raw.PolicyBindings - for _, ib := range ibs { - rbs = append(rbs, &raw.PolicyBindings{ - Role: ib.Role, - Members: ib.Members, - Condition: iamToStorageCondition(ib.Condition), - }) - } - return rbs -} - -func iamToStorageCondition(exprpb *expr.Expr) *raw.Expr { - if exprpb == nil { - return nil - } - return &raw.Expr{ - Expression: exprpb.Expression, - Description: exprpb.Description, - Location: exprpb.Location, - Title: exprpb.Title, - } -} - -func iamFromStoragePolicy(rp *raw.Policy) *iampb.Policy { - return &iampb.Policy{ - Bindings: iamFromStorageBindings(rp.Bindings), - Etag: []byte(rp.Etag), - } -} - -func iamFromStorageBindings(rbs []*raw.PolicyBindings) []*iampb.Binding { - var ibs []*iampb.Binding - for _, rb := range rbs { - ibs = append(ibs, &iampb.Binding{ - Role: rb.Role, - Members: rb.Members, - Condition: iamFromStorageCondition(rb.Condition), - }) - } - return ibs -} - -func iamFromStorageCondition(rawexpr *raw.Expr) *expr.Expr { - if rawexpr == nil { - return nil - } - return &expr.Expr{ - Expression: rawexpr.Expression, - Description: rawexpr.Description, - Location: rawexpr.Location, - Title: rawexpr.Title, - } -} diff --git a/ibm/vendor/cloud.google.com/go/storage/invoke.go b/ibm/vendor/cloud.google.com/go/storage/invoke.go deleted file mode 100644 index e755f197de..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/invoke.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 storage - -import ( - "context" - - "cloud.google.com/go/internal" - gax "github.com/googleapis/gax-go/v2" -) - -// runWithRetry calls the function until it returns nil or a non-retryable error, or -// the context is done. -func runWithRetry(ctx context.Context, call func() error) error { - return internal.Retry(ctx, gax.Backoff{}, func() (stop bool, err error) { - err = call() - if err == nil { - return true, nil - } - if shouldRetry(err) { - return false, nil - } - return true, err - }) -} diff --git a/ibm/vendor/cloud.google.com/go/storage/not_go110.go b/ibm/vendor/cloud.google.com/go/storage/not_go110.go deleted file mode 100644 index 66fa45bea2..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/not_go110.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 Google LLC -// -// 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. - -// +build !go1.10 - -package storage - -import ( - "net/url" - "strings" - - "google.golang.org/api/googleapi" -) - -func shouldRetry(err error) bool { - switch e := err.(type) { - case *googleapi.Error: - // Retry on 429 and 5xx, according to - // https://cloud.google.com/storage/docs/exponential-backoff. - return e.Code == 429 || (e.Code >= 500 && e.Code < 600) - case *url.Error: - // Retry on REFUSED_STREAM. - // Unfortunately the error type is unexported, so we resort to string - // matching. - return strings.Contains(e.Error(), "REFUSED_STREAM") - case interface{ Temporary() bool }: - return e.Temporary() - default: - return false - } -} diff --git a/ibm/vendor/cloud.google.com/go/storage/notifications.go b/ibm/vendor/cloud.google.com/go/storage/notifications.go deleted file mode 100644 index 84619b6d58..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/notifications.go +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2017 Google LLC -// -// 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 storage - -import ( - "context" - "errors" - "fmt" - "regexp" - - "cloud.google.com/go/internal/trace" - raw "google.golang.org/api/storage/v1" -) - -// A Notification describes how to send Cloud PubSub messages when certain -// events occur in a bucket. -type Notification struct { - //The ID of the notification. - ID string - - // The ID of the topic to which this subscription publishes. - TopicID string - - // The ID of the project to which the topic belongs. - TopicProjectID string - - // Only send notifications about listed event types. If empty, send notifications - // for all event types. - // See https://cloud.google.com/storage/docs/pubsub-notifications#events. - EventTypes []string - - // If present, only apply this notification configuration to object names that - // begin with this prefix. - ObjectNamePrefix string - - // An optional list of additional attributes to attach to each Cloud PubSub - // message published for this notification subscription. - CustomAttributes map[string]string - - // The contents of the message payload. - // See https://cloud.google.com/storage/docs/pubsub-notifications#payload. - PayloadFormat string -} - -// Values for Notification.PayloadFormat. -const ( - // Send no payload with notification messages. - NoPayload = "NONE" - - // Send object metadata as JSON with notification messages. - JSONPayload = "JSON_API_V1" -) - -// Values for Notification.EventTypes. -const ( - // Event that occurs when an object is successfully created. - ObjectFinalizeEvent = "OBJECT_FINALIZE" - - // Event that occurs when the metadata of an existing object changes. - ObjectMetadataUpdateEvent = "OBJECT_METADATA_UPDATE" - - // Event that occurs when an object is permanently deleted. - ObjectDeleteEvent = "OBJECT_DELETE" - - // Event that occurs when the live version of an object becomes an - // archived version. - ObjectArchiveEvent = "OBJECT_ARCHIVE" -) - -func toNotification(rn *raw.Notification) *Notification { - n := &Notification{ - ID: rn.Id, - EventTypes: rn.EventTypes, - ObjectNamePrefix: rn.ObjectNamePrefix, - CustomAttributes: rn.CustomAttributes, - PayloadFormat: rn.PayloadFormat, - } - n.TopicProjectID, n.TopicID = parseNotificationTopic(rn.Topic) - return n -} - -var topicRE = regexp.MustCompile("^//pubsub.googleapis.com/projects/([^/]+)/topics/([^/]+)") - -// parseNotificationTopic extracts the project and topic IDs from from the full -// resource name returned by the service. If the name is malformed, it returns -// "?" for both IDs. -func parseNotificationTopic(nt string) (projectID, topicID string) { - matches := topicRE.FindStringSubmatch(nt) - if matches == nil { - return "?", "?" - } - return matches[1], matches[2] -} - -func toRawNotification(n *Notification) *raw.Notification { - return &raw.Notification{ - Id: n.ID, - Topic: fmt.Sprintf("//pubsub.googleapis.com/projects/%s/topics/%s", - n.TopicProjectID, n.TopicID), - EventTypes: n.EventTypes, - ObjectNamePrefix: n.ObjectNamePrefix, - CustomAttributes: n.CustomAttributes, - PayloadFormat: string(n.PayloadFormat), - } -} - -// AddNotification adds a notification to b. You must set n's TopicProjectID, TopicID -// and PayloadFormat, and must not set its ID. The other fields are all optional. The -// returned Notification's ID can be used to refer to it. -func (b *BucketHandle) AddNotification(ctx context.Context, n *Notification) (ret *Notification, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.AddNotification") - defer func() { trace.EndSpan(ctx, err) }() - - if n.ID != "" { - return nil, errors.New("storage: AddNotification: ID must not be set") - } - if n.TopicProjectID == "" { - return nil, errors.New("storage: AddNotification: missing TopicProjectID") - } - if n.TopicID == "" { - return nil, errors.New("storage: AddNotification: missing TopicID") - } - call := b.c.raw.Notifications.Insert(b.name, toRawNotification(n)) - setClientHeader(call.Header()) - if b.userProject != "" { - call.UserProject(b.userProject) - } - rn, err := call.Context(ctx).Do() - if err != nil { - return nil, err - } - return toNotification(rn), nil -} - -// Notifications returns all the Notifications configured for this bucket, as a map -// indexed by notification ID. -func (b *BucketHandle) Notifications(ctx context.Context) (n map[string]*Notification, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Notifications") - defer func() { trace.EndSpan(ctx, err) }() - - call := b.c.raw.Notifications.List(b.name) - setClientHeader(call.Header()) - if b.userProject != "" { - call.UserProject(b.userProject) - } - var res *raw.Notifications - err = runWithRetry(ctx, func() error { - res, err = call.Context(ctx).Do() - return err - }) - if err != nil { - return nil, err - } - return notificationsToMap(res.Items), nil -} - -func notificationsToMap(rns []*raw.Notification) map[string]*Notification { - m := map[string]*Notification{} - for _, rn := range rns { - m[rn.Id] = toNotification(rn) - } - return m -} - -// DeleteNotification deletes the notification with the given ID. -func (b *BucketHandle) DeleteNotification(ctx context.Context, id string) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.DeleteNotification") - defer func() { trace.EndSpan(ctx, err) }() - - call := b.c.raw.Notifications.Delete(b.name, id) - setClientHeader(call.Header()) - if b.userProject != "" { - call.UserProject(b.userProject) - } - return call.Context(ctx).Do() -} diff --git a/ibm/vendor/cloud.google.com/go/storage/post_policy_v4.go b/ibm/vendor/cloud.google.com/go/storage/post_policy_v4.go deleted file mode 100644 index b9df7db958..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/post_policy_v4.go +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2020 Google LLC -// -// 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 storage - -import ( - "crypto" - "crypto/rand" - "crypto/rsa" - "crypto/sha256" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "net/url" - "strings" - "time" -) - -// PostPolicyV4Options are used to construct a signed post policy. -// Please see https://cloud.google.com/storage/docs/xml-api/post-object -// for reference about the fields. -type PostPolicyV4Options struct { - // GoogleAccessID represents the authorizer of the signed URL generation. - // It is typically the Google service account client email address from - // the Google Developers Console in the form of "xxx@developer.gserviceaccount.com". - // Required. - GoogleAccessID string - - // PrivateKey is the Google service account private key. It is obtainable - // from the Google Developers Console. - // At https://console.developers.google.com/project//apiui/credential, - // create a service account client ID or reuse one of your existing service account - // credentials. Click on the "Generate new P12 key" to generate and download - // a new private key. Once you download the P12 file, use the following command - // to convert it into a PEM file. - // - // $ openssl pkcs12 -in key.p12 -passin pass:notasecret -out key.pem -nodes - // - // Provide the contents of the PEM file as a byte slice. - // Exactly one of PrivateKey or SignBytes must be non-nil. - PrivateKey []byte - - // SignBytes is a function for implementing custom signing. For example, if - // your application is running on Google App Engine, you can use - // appengine's internal signing function: - // ctx := appengine.NewContext(request) - // acc, _ := appengine.ServiceAccount(ctx) - // url, err := SignedURL("bucket", "object", &SignedURLOptions{ - // GoogleAccessID: acc, - // SignBytes: func(b []byte) ([]byte, error) { - // _, signedBytes, err := appengine.SignBytes(ctx, b) - // return signedBytes, err - // }, - // // etc. - // }) - // - // Exactly one of PrivateKey or SignBytes must be non-nil. - SignBytes func(hashBytes []byte) (signature []byte, err error) - - // Expires is the expiration time on the signed URL. - // It must be a time in the future. - // Required. - Expires time.Time - - // Style provides options for the type of URL to use. Options are - // PathStyle (default), BucketBoundHostname, and VirtualHostedStyle. See - // https://cloud.google.com/storage/docs/request-endpoints for details. - // Optional. - Style URLStyle - - // Insecure when set indicates that the generated URL's scheme - // will use "http" instead of "https" (default). - // Optional. - Insecure bool - - // Fields specifies the attributes of a PostPolicyV4 request. - // When Fields is non-nil, its attributes must match those that will - // passed into field Conditions. - // Optional. - Fields *PolicyV4Fields - - // The conditions that the uploaded file will be expected to conform to. - // When used, the failure of an upload to satisfy a condition will result in - // a 4XX status code, back with the message describing the problem. - // Optional. - Conditions []PostPolicyV4Condition -} - -// PolicyV4Fields describes the attributes for a PostPolicyV4 request. -type PolicyV4Fields struct { - // ACL specifies the access control permissions for the object. - // Optional. - ACL string - // CacheControl specifies the caching directives for the object. - // Optional. - CacheControl string - // ContentType specifies the media type of the object. - // Optional. - ContentType string - // ContentDisposition specifies how the file will be served back to requesters. - // Optional. - ContentDisposition string - // ContentEncoding specifies the decompressive transcoding that the object. - // This field is complementary to ContentType in that the file could be - // compressed but ContentType specifies the file's original media type. - // Optional. - ContentEncoding string - // Metadata specifies custom metadata for the object. - // If any key doesn't begin with "x-goog-meta-", an error will be returned. - // Optional. - Metadata map[string]string - // StatusCodeOnSuccess when set, specifies the status code that Cloud Storage - // will serve back on successful upload of the object. - // Optional. - StatusCodeOnSuccess int - // RedirectToURLOnSuccess when set, specifies the URL that Cloud Storage - // will serve back on successful upload of the object. - // Optional. - RedirectToURLOnSuccess string -} - -// PostPolicyV4 describes the URL and respective form fields for a generated PostPolicyV4 request. -type PostPolicyV4 struct { - // URL is the generated URL that the file upload will be made to. - URL string - // Fields specifies the generated key-values that the file uploader - // must include in their multipart upload form. - Fields map[string]string -} - -// PostPolicyV4Condition describes the constraints that the subsequent -// object upload's multipart form fields will be expected to conform to. -type PostPolicyV4Condition interface { - isEmpty() bool - json.Marshaler -} - -type startsWith struct { - key, value string -} - -func (sw *startsWith) MarshalJSON() ([]byte, error) { - return json.Marshal([]string{"starts-with", sw.key, sw.value}) -} -func (sw *startsWith) isEmpty() bool { - return sw.value == "" -} - -// ConditionStartsWith checks that an attributes starts with value. -// An empty value will cause this condition to be ignored. -func ConditionStartsWith(key, value string) PostPolicyV4Condition { - return &startsWith{key, value} -} - -type contentLengthRangeCondition struct { - start, end uint64 -} - -func (clr *contentLengthRangeCondition) MarshalJSON() ([]byte, error) { - return json.Marshal([]interface{}{"content-length-range", clr.start, clr.end}) -} -func (clr *contentLengthRangeCondition) isEmpty() bool { - return clr.start == 0 && clr.end == 0 -} - -type singleValueCondition struct { - name, value string -} - -func (svc *singleValueCondition) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]string{svc.name: svc.value}) -} -func (svc *singleValueCondition) isEmpty() bool { - return svc.value == "" -} - -// ConditionContentLengthRange constraints the limits that the -// multipart upload's range header will be expected to be within. -func ConditionContentLengthRange(start, end uint64) PostPolicyV4Condition { - return &contentLengthRangeCondition{start, end} -} - -func conditionRedirectToURLOnSuccess(redirectURL string) PostPolicyV4Condition { - return &singleValueCondition{"success_action_redirect", redirectURL} -} - -func conditionStatusCodeOnSuccess(statusCode int) PostPolicyV4Condition { - svc := &singleValueCondition{name: "success_action_status"} - if statusCode > 0 { - svc.value = fmt.Sprintf("%d", statusCode) - } - return svc -} - -// GenerateSignedPostPolicyV4 generates a PostPolicyV4 value from bucket, object and opts. -// The generated URL and fields will then allow an unauthenticated client to perform multipart uploads. -func GenerateSignedPostPolicyV4(bucket, object string, opts *PostPolicyV4Options) (*PostPolicyV4, error) { - if bucket == "" { - return nil, errors.New("storage: bucket must be non-empty") - } - if object == "" { - return nil, errors.New("storage: object must be non-empty") - } - now := utcNow() - if err := validatePostPolicyV4Options(opts, now); err != nil { - return nil, err - } - - var signingFn func(hashedBytes []byte) ([]byte, error) - switch { - case opts.SignBytes != nil: - signingFn = opts.SignBytes - - case len(opts.PrivateKey) != 0: - parsedRSAPrivKey, err := parseKey(opts.PrivateKey) - if err != nil { - return nil, err - } - signingFn = func(hashedBytes []byte) ([]byte, error) { - return rsa.SignPKCS1v15(rand.Reader, parsedRSAPrivKey, crypto.SHA256, hashedBytes) - } - - default: - return nil, errors.New("storage: exactly one of PrivateKey or SignedBytes must be set") - } - - var descFields PolicyV4Fields - if opts.Fields != nil { - descFields = *opts.Fields - } - - if err := validateMetadata(descFields.Metadata); err != nil { - return nil, err - } - - // Build the policy. - conds := make([]PostPolicyV4Condition, len(opts.Conditions)) - copy(conds, opts.Conditions) - conds = append(conds, - conditionRedirectToURLOnSuccess(descFields.RedirectToURLOnSuccess), - conditionStatusCodeOnSuccess(descFields.StatusCodeOnSuccess), - &singleValueCondition{"acl", descFields.ACL}, - &singleValueCondition{"cache-control", descFields.CacheControl}, - ) - - YYYYMMDD := now.Format(yearMonthDay) - policyFields := map[string]string{ - "key": object, - "x-goog-date": now.Format(iso8601), - "x-goog-credential": opts.GoogleAccessID + "/" + YYYYMMDD + "/auto/storage/goog4_request", - "x-goog-algorithm": "GOOG4-RSA-SHA256", - "success_action_redirect": descFields.RedirectToURLOnSuccess, - "acl": descFields.ACL, - } - for key, value := range descFields.Metadata { - conds = append(conds, &singleValueCondition{key, value}) - policyFields[key] = value - } - - // Following from the order expected by the conformance test cases, - // hence manually inserting these fields in a specific order. - conds = append(conds, - &singleValueCondition{"bucket", bucket}, - &singleValueCondition{"key", object}, - &singleValueCondition{"x-goog-date", now.Format(iso8601)}, - &singleValueCondition{ - name: "x-goog-credential", - value: opts.GoogleAccessID + "/" + YYYYMMDD + "/auto/storage/goog4_request", - }, - &singleValueCondition{"x-goog-algorithm", "GOOG4-RSA-SHA256"}, - ) - - nonEmptyConds := make([]PostPolicyV4Condition, 0, len(opts.Conditions)) - for _, cond := range conds { - if cond == nil || !cond.isEmpty() { - nonEmptyConds = append(nonEmptyConds, cond) - } - } - condsAsJSON, err := json.Marshal(map[string]interface{}{ - "conditions": nonEmptyConds, - "expiration": opts.Expires.Format(time.RFC3339), - }) - if err != nil { - return nil, fmt.Errorf("storage: PostPolicyV4 JSON serialization failed: %v", err) - } - - b64Policy := base64.StdEncoding.EncodeToString(condsAsJSON) - shaSum := sha256.Sum256([]byte(b64Policy)) - signature, err := signingFn(shaSum[:]) - if err != nil { - return nil, err - } - - policyFields["policy"] = b64Policy - policyFields["x-goog-signature"] = fmt.Sprintf("%x", signature) - - // Construct the URL. - scheme := "https" - if opts.Insecure { - scheme = "http" - } - path := opts.Style.path(bucket, "") + "/" - u := &url.URL{ - Path: path, - RawPath: pathEncodeV4(path), - Host: opts.Style.host(bucket), - Scheme: scheme, - } - - if descFields.StatusCodeOnSuccess > 0 { - policyFields["success_action_status"] = fmt.Sprintf("%d", descFields.StatusCodeOnSuccess) - } - - // Clear out fields with blanks values. - for key, value := range policyFields { - if value == "" { - delete(policyFields, key) - } - } - pp4 := &PostPolicyV4{ - Fields: policyFields, - URL: u.String(), - } - return pp4, nil -} - -// validatePostPolicyV4Options checks that: -// * GoogleAccessID is set -// * either but not both PrivateKey and SignBytes are set or nil, but not both -// * Expires, the deadline is not in the past -// * if Style is not set, it'll use PathStyle -func validatePostPolicyV4Options(opts *PostPolicyV4Options, now time.Time) error { - if opts == nil || opts.GoogleAccessID == "" { - return errors.New("storage: missing required GoogleAccessID") - } - if privBlank, signBlank := len(opts.PrivateKey) == 0, opts.SignBytes == nil; privBlank == signBlank { - return errors.New("storage: exactly one of PrivateKey or SignedBytes must be set") - } - if opts.Expires.Before(now) { - return errors.New("storage: expecting Expires to be in the future") - } - if opts.Style == nil { - opts.Style = PathStyle() - } - return nil -} - -// validateMetadata ensures that all keys passed in have a prefix of "x-goog-meta-", -// otherwise it will return an error. -func validateMetadata(hdrs map[string]string) (err error) { - if len(hdrs) == 0 { - return nil - } - - badKeys := make([]string, 0, len(hdrs)) - for key := range hdrs { - if !strings.HasPrefix(key, "x-goog-meta-") { - badKeys = append(badKeys, key) - } - } - if len(badKeys) != 0 { - err = errors.New("storage: expected metadata to begin with x-goog-meta-, got " + strings.Join(badKeys, ", ")) - } - return -} diff --git a/ibm/vendor/cloud.google.com/go/storage/reader.go b/ibm/vendor/cloud.google.com/go/storage/reader.go deleted file mode 100644 index d64f5ec778..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/reader.go +++ /dev/null @@ -1,435 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 storage - -import ( - "context" - "errors" - "fmt" - "hash/crc32" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "strconv" - "strings" - "time" - - "cloud.google.com/go/internal/trace" - "google.golang.org/api/googleapi" -) - -var crc32cTable = crc32.MakeTable(crc32.Castagnoli) - -// ReaderObjectAttrs are attributes about the object being read. These are populated -// during the New call. This struct only holds a subset of object attributes: to -// get the full set of attributes, use ObjectHandle.Attrs. -// -// Each field is read-only. -type ReaderObjectAttrs struct { - // Size is the length of the object's content. - Size int64 - - // StartOffset is the byte offset within the object - // from which reading begins. - // This value is only non-zero for range requests. - StartOffset int64 - - // ContentType is the MIME type of the object's content. - ContentType string - - // ContentEncoding is the encoding of the object's content. - ContentEncoding string - - // CacheControl specifies whether and for how long browser and Internet - // caches are allowed to cache your objects. - CacheControl string - - // LastModified is the time that the object was last modified. - LastModified time.Time - - // Generation is the generation number of the object's content. - Generation int64 - - // Metageneration is the version of the metadata for this object at - // this generation. This field is used for preconditions and for - // detecting changes in metadata. A metageneration number is only - // meaningful in the context of a particular generation of a - // particular object. - Metageneration int64 -} - -// NewReader creates a new Reader to read the contents of the -// object. -// ErrObjectNotExist will be returned if the object is not found. -// -// The caller must call Close on the returned Reader when done reading. -func (o *ObjectHandle) NewReader(ctx context.Context) (*Reader, error) { - return o.NewRangeReader(ctx, 0, -1) -} - -// NewRangeReader reads part of an object, reading at most length bytes -// starting at the given offset. If length is negative, the object is read -// until the end. If offset is negative, the object is read abs(offset) bytes -// from the end, and length must also be negative to indicate all remaining -// bytes will be read. -// -// If the object's metadata property "Content-Encoding" is set to "gzip" or satisfies -// decompressive transcoding per https://cloud.google.com/storage/docs/transcoding -// that file will be served back whole, regardless of the requested range as -// Google Cloud Storage dictates. -func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) (r *Reader, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.NewRangeReader") - defer func() { trace.EndSpan(ctx, err) }() - - if err := o.validate(); err != nil { - return nil, err - } - if offset < 0 && length >= 0 { - return nil, fmt.Errorf("storage: invalid offset %d < 0 requires negative length", offset) - } - if o.conds != nil { - if err := o.conds.validate("NewRangeReader"); err != nil { - return nil, err - } - } - u := &url.URL{ - Scheme: o.c.scheme, - Host: o.c.readHost, - Path: fmt.Sprintf("/%s/%s", o.bucket, o.object), - } - verb := "GET" - if length == 0 { - verb = "HEAD" - } - req, err := http.NewRequest(verb, u.String(), nil) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if o.userProject != "" { - req.Header.Set("X-Goog-User-Project", o.userProject) - } - if o.readCompressed { - req.Header.Set("Accept-Encoding", "gzip") - } - if err := setEncryptionHeaders(req.Header, o.encryptionKey, false); err != nil { - return nil, err - } - - gen := o.gen - - // Define a function that initiates a Read with offset and length, assuming we - // have already read seen bytes. - reopen := func(seen int64) (*http.Response, error) { - start := offset + seen - if length < 0 && start < 0 { - req.Header.Set("Range", fmt.Sprintf("bytes=%d", start)) - } else if length < 0 && start > 0 { - req.Header.Set("Range", fmt.Sprintf("bytes=%d-", start)) - } else if length > 0 { - // The end character isn't affected by how many bytes we've seen. - req.Header.Set("Range", fmt.Sprintf("bytes=%d-%d", start, offset+length-1)) - } - // We wait to assign conditions here because the generation number can change in between reopen() runs. - req.URL.RawQuery = conditionsQuery(gen, o.conds) - var res *http.Response - err = runWithRetry(ctx, func() error { - res, err = o.c.hc.Do(req) - if err != nil { - return err - } - if res.StatusCode == http.StatusNotFound { - res.Body.Close() - return ErrObjectNotExist - } - if res.StatusCode < 200 || res.StatusCode > 299 { - body, _ := ioutil.ReadAll(res.Body) - res.Body.Close() - return &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - Body: string(body), - } - } - - partialContentNotSatisfied := - !decompressiveTranscoding(res) && - start > 0 && length != 0 && - res.StatusCode != http.StatusPartialContent - - if partialContentNotSatisfied { - res.Body.Close() - return errors.New("storage: partial request not satisfied") - } - - // With "Content-Encoding": "gzip" aka decompressive transcoding, GCS serves - // back the whole file regardless of the range count passed in as per: - // https://cloud.google.com/storage/docs/transcoding#range, - // thus we have to manually move the body forward by seen bytes. - if decompressiveTranscoding(res) && seen > 0 { - _, _ = io.CopyN(ioutil.Discard, res.Body, seen) - } - - // If a generation hasn't been specified, and this is the first response we get, let's record the - // generation. In future requests we'll use this generation as a precondition to avoid data races. - if gen < 0 && res.Header.Get("X-Goog-Generation") != "" { - gen64, err := strconv.ParseInt(res.Header.Get("X-Goog-Generation"), 10, 64) - if err != nil { - return err - } - gen = gen64 - } - return nil - }) - if err != nil { - return nil, err - } - return res, nil - } - - res, err := reopen(0) - if err != nil { - return nil, err - } - var ( - size int64 // total size of object, even if a range was requested. - checkCRC bool - crc uint32 - startOffset int64 // non-zero if range request. - ) - if res.StatusCode == http.StatusPartialContent { - cr := strings.TrimSpace(res.Header.Get("Content-Range")) - if !strings.HasPrefix(cr, "bytes ") || !strings.Contains(cr, "/") { - return nil, fmt.Errorf("storage: invalid Content-Range %q", cr) - } - size, err = strconv.ParseInt(cr[strings.LastIndex(cr, "/")+1:], 10, 64) - if err != nil { - return nil, fmt.Errorf("storage: invalid Content-Range %q", cr) - } - - dashIndex := strings.Index(cr, "-") - if dashIndex >= 0 { - startOffset, err = strconv.ParseInt(cr[len("bytes="):dashIndex], 10, 64) - if err != nil { - return nil, fmt.Errorf("storage: invalid Content-Range %q: %v", cr, err) - } - } - } else { - size = res.ContentLength - // Check the CRC iff all of the following hold: - // - We asked for content (length != 0). - // - We got all the content (status != PartialContent). - // - The server sent a CRC header. - // - The Go http stack did not uncompress the file. - // - We were not served compressed data that was uncompressed on download. - // The problem with the last two cases is that the CRC will not match -- GCS - // computes it on the compressed contents, but we compute it on the - // uncompressed contents. - if length != 0 && !res.Uncompressed && !uncompressedByServer(res) { - crc, checkCRC = parseCRC32c(res) - } - } - - remain := res.ContentLength - body := res.Body - if length == 0 { - remain = 0 - body.Close() - body = emptyBody - } - var metaGen int64 - if res.Header.Get("X-Goog-Metageneration") != "" { - metaGen, err = strconv.ParseInt(res.Header.Get("X-Goog-Metageneration"), 10, 64) - if err != nil { - return nil, err - } - } - - var lm time.Time - if res.Header.Get("Last-Modified") != "" { - lm, err = http.ParseTime(res.Header.Get("Last-Modified")) - if err != nil { - return nil, err - } - } - - attrs := ReaderObjectAttrs{ - Size: size, - ContentType: res.Header.Get("Content-Type"), - ContentEncoding: res.Header.Get("Content-Encoding"), - CacheControl: res.Header.Get("Cache-Control"), - LastModified: lm, - StartOffset: startOffset, - Generation: gen, - Metageneration: metaGen, - } - return &Reader{ - Attrs: attrs, - body: body, - size: size, - remain: remain, - wantCRC: crc, - checkCRC: checkCRC, - reopen: reopen, - }, nil -} - -// decompressiveTranscoding returns true if the request was served decompressed -// and different than its original storage form. This happens when the "Content-Encoding" -// header is "gzip". -// See: -// * https://cloud.google.com/storage/docs/transcoding#transcoding_and_gzip -// * https://github.com/googleapis/google-cloud-go/issues/1800 -func decompressiveTranscoding(res *http.Response) bool { - // Decompressive Transcoding. - return res.Header.Get("Content-Encoding") == "gzip" || - res.Header.Get("X-Goog-Stored-Content-Encoding") == "gzip" -} - -func uncompressedByServer(res *http.Response) bool { - // If the data is stored as gzip but is not encoded as gzip, then it - // was uncompressed by the server. - return res.Header.Get("X-Goog-Stored-Content-Encoding") == "gzip" && - res.Header.Get("Content-Encoding") != "gzip" -} - -func parseCRC32c(res *http.Response) (uint32, bool) { - const prefix = "crc32c=" - for _, spec := range res.Header["X-Goog-Hash"] { - if strings.HasPrefix(spec, prefix) { - c, err := decodeUint32(spec[len(prefix):]) - if err == nil { - return c, true - } - } - } - return 0, false -} - -var emptyBody = ioutil.NopCloser(strings.NewReader("")) - -// Reader reads a Cloud Storage object. -// It implements io.Reader. -// -// Typically, a Reader computes the CRC of the downloaded content and compares it to -// the stored CRC, returning an error from Read if there is a mismatch. This integrity check -// is skipped if transcoding occurs. See https://cloud.google.com/storage/docs/transcoding. -type Reader struct { - Attrs ReaderObjectAttrs - body io.ReadCloser - seen, remain, size int64 - checkCRC bool // should we check the CRC? - wantCRC uint32 // the CRC32c value the server sent in the header - gotCRC uint32 // running crc - reopen func(seen int64) (*http.Response, error) -} - -// Close closes the Reader. It must be called when done reading. -func (r *Reader) Close() error { - return r.body.Close() -} - -func (r *Reader) Read(p []byte) (int, error) { - n, err := r.readWithRetry(p) - if r.remain != -1 { - r.remain -= int64(n) - } - if r.checkCRC { - r.gotCRC = crc32.Update(r.gotCRC, crc32cTable, p[:n]) - // Check CRC here. It would be natural to check it in Close, but - // everybody defers Close on the assumption that it doesn't return - // anything worth looking at. - if err == io.EOF { - if r.gotCRC != r.wantCRC { - return n, fmt.Errorf("storage: bad CRC on read: got %d, want %d", - r.gotCRC, r.wantCRC) - } - } - } - return n, err -} - -func (r *Reader) readWithRetry(p []byte) (int, error) { - n := 0 - for len(p[n:]) > 0 { - m, err := r.body.Read(p[n:]) - n += m - r.seen += int64(m) - if !shouldRetryRead(err) { - return n, err - } - // Read failed, but we will try again. Send a ranged read request that takes - // into account the number of bytes we've already seen. - res, err := r.reopen(r.seen) - if err != nil { - // reopen already retries - return n, err - } - r.body.Close() - r.body = res.Body - } - return n, nil -} - -func shouldRetryRead(err error) bool { - if err == nil { - return false - } - return strings.HasSuffix(err.Error(), "INTERNAL_ERROR") && strings.Contains(reflect.TypeOf(err).String(), "http2") -} - -// Size returns the size of the object in bytes. -// The returned value is always the same and is not affected by -// calls to Read or Close. -// -// Deprecated: use Reader.Attrs.Size. -func (r *Reader) Size() int64 { - return r.Attrs.Size -} - -// Remain returns the number of bytes left to read, or -1 if unknown. -func (r *Reader) Remain() int64 { - return r.remain -} - -// ContentType returns the content type of the object. -// -// Deprecated: use Reader.Attrs.ContentType. -func (r *Reader) ContentType() string { - return r.Attrs.ContentType -} - -// ContentEncoding returns the content encoding of the object. -// -// Deprecated: use Reader.Attrs.ContentEncoding. -func (r *Reader) ContentEncoding() string { - return r.Attrs.ContentEncoding -} - -// CacheControl returns the cache control of the object. -// -// Deprecated: use Reader.Attrs.CacheControl. -func (r *Reader) CacheControl() string { - return r.Attrs.CacheControl -} - -// LastModified returns the value of the Last-Modified header. -// -// Deprecated: use Reader.Attrs.LastModified. -func (r *Reader) LastModified() (time.Time, error) { - return r.Attrs.LastModified, nil -} diff --git a/ibm/vendor/cloud.google.com/go/storage/storage.go b/ibm/vendor/cloud.google.com/go/storage/storage.go deleted file mode 100644 index 20d9518a42..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/storage.go +++ /dev/null @@ -1,1606 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 storage - -import ( - "bytes" - "context" - "crypto" - "crypto/rand" - "crypto/rsa" - "crypto/sha256" - "crypto/x509" - "encoding/base64" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "net/http" - "net/url" - "os" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode/utf8" - - "cloud.google.com/go/internal/optional" - "cloud.google.com/go/internal/trace" - "cloud.google.com/go/internal/version" - "google.golang.org/api/googleapi" - "google.golang.org/api/option" - raw "google.golang.org/api/storage/v1" - htransport "google.golang.org/api/transport/http" -) - -// Methods which can be used in signed URLs. -var signedURLMethods = map[string]bool{"DELETE": true, "GET": true, "HEAD": true, "POST": true, "PUT": true} - -var ( - // ErrBucketNotExist indicates that the bucket does not exist. - ErrBucketNotExist = errors.New("storage: bucket doesn't exist") - // ErrObjectNotExist indicates that the object does not exist. - ErrObjectNotExist = errors.New("storage: object doesn't exist") - // errMethodNotValid indicates that given HTTP method is not valid. - errMethodNotValid = fmt.Errorf("storage: HTTP method should be one of %v", reflect.ValueOf(signedURLMethods).MapKeys()) -) - -var userAgent = fmt.Sprintf("gcloud-golang-storage/%s", version.Repo) - -const ( - // ScopeFullControl grants permissions to manage your - // data and permissions in Google Cloud Storage. - ScopeFullControl = raw.DevstorageFullControlScope - - // ScopeReadOnly grants permissions to - // view your data in Google Cloud Storage. - ScopeReadOnly = raw.DevstorageReadOnlyScope - - // ScopeReadWrite grants permissions to manage your - // data in Google Cloud Storage. - ScopeReadWrite = raw.DevstorageReadWriteScope -) - -var xGoogHeader = fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), version.Repo) - -func setClientHeader(headers http.Header) { - headers.Set("x-goog-api-client", xGoogHeader) -} - -// Client is a client for interacting with Google Cloud Storage. -// -// Clients should be reused instead of created as needed. -// The methods of Client are safe for concurrent use by multiple goroutines. -type Client struct { - hc *http.Client - raw *raw.Service - // Scheme describes the scheme under the current host. - scheme string - // EnvHost is the host set on the STORAGE_EMULATOR_HOST variable. - envHost string - // ReadHost is the default host used on the reader. - readHost string -} - -// NewClient creates a new Google Cloud Storage client. -// The default scope is ScopeFullControl. To use a different scope, like ScopeReadOnly, use option.WithScopes. -func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { - var host, readHost, scheme string - - if host = os.Getenv("STORAGE_EMULATOR_HOST"); host == "" { - scheme = "https" - readHost = "storage.googleapis.com" - - // Prepend default options to avoid overriding options passed by the user. - opts = append([]option.ClientOption{option.WithScopes(ScopeFullControl), option.WithUserAgent(userAgent)}, opts...) - } else { - scheme = "http" - readHost = host - - opts = append([]option.ClientOption{option.WithoutAuthentication()}, opts...) - } - - hc, ep, err := htransport.NewClient(ctx, opts...) - if err != nil { - return nil, fmt.Errorf("dialing: %v", err) - } - rawService, err := raw.NewService(ctx, option.WithHTTPClient(hc)) - if err != nil { - return nil, fmt.Errorf("storage client: %v", err) - } - if ep == "" { - // Override the default value for BasePath from the raw client. - // TODO: remove when the raw client uses this endpoint as its default (~end of 2020) - rawService.BasePath = "https://storage.googleapis.com/storage/v1/" - } else { - // If the endpoint has been set explicitly, use this for the BasePath - // as well as readHost - rawService.BasePath = ep - u, err := url.Parse(ep) - if err != nil { - return nil, fmt.Errorf("supplied endpoint %v is not valid: %v", ep, err) - } - readHost = u.Host - } - - return &Client{ - hc: hc, - raw: rawService, - scheme: scheme, - envHost: host, - readHost: readHost, - }, nil -} - -// Close closes the Client. -// -// Close need not be called at program exit. -func (c *Client) Close() error { - // Set fields to nil so that subsequent uses will panic. - c.hc = nil - c.raw = nil - return nil -} - -// SigningScheme determines the API version to use when signing URLs. -type SigningScheme int - -const ( - // SigningSchemeDefault is presently V2 and will change to V4 in the future. - SigningSchemeDefault SigningScheme = iota - - // SigningSchemeV2 uses the V2 scheme to sign URLs. - SigningSchemeV2 - - // SigningSchemeV4 uses the V4 scheme to sign URLs. - SigningSchemeV4 -) - -// URLStyle determines the style to use for the signed URL. pathStyle is the -// default. All non-default options work with V4 scheme only. See -// https://cloud.google.com/storage/docs/request-endpoints for details. -type URLStyle interface { - // host should return the host portion of the signed URL, not including - // the scheme (e.g. storage.googleapis.com). - host(bucket string) string - - // path should return the path portion of the signed URL, which may include - // both the bucket and object name or only the object name depending on the - // style. - path(bucket, object string) string -} - -type pathStyle struct{} - -type virtualHostedStyle struct{} - -type bucketBoundHostname struct { - hostname string -} - -func (s pathStyle) host(bucket string) string { - return "storage.googleapis.com" -} - -func (s virtualHostedStyle) host(bucket string) string { - return bucket + ".storage.googleapis.com" -} - -func (s bucketBoundHostname) host(bucket string) string { - return s.hostname -} - -func (s pathStyle) path(bucket, object string) string { - p := bucket - if object != "" { - p += "/" + object - } - return p -} - -func (s virtualHostedStyle) path(bucket, object string) string { - return object -} - -func (s bucketBoundHostname) path(bucket, object string) string { - return object -} - -// PathStyle is the default style, and will generate a URL of the form -// "storage.googleapis.com//". -func PathStyle() URLStyle { - return pathStyle{} -} - -// VirtualHostedStyle generates a URL relative to the bucket's virtual -// hostname, e.g. ".storage.googleapis.com/". -func VirtualHostedStyle() URLStyle { - return virtualHostedStyle{} -} - -// BucketBoundHostname generates a URL with a custom hostname tied to a -// specific GCS bucket. The desired hostname should be passed in using the -// hostname argument. Generated urls will be of the form -// "/". See -// https://cloud.google.com/storage/docs/request-endpoints#cname and -// https://cloud.google.com/load-balancing/docs/https/adding-backend-buckets-to-load-balancers -// for details. Note that for CNAMEs, only HTTP is supported, so Insecure must -// be set to true. -func BucketBoundHostname(hostname string) URLStyle { - return bucketBoundHostname{hostname: hostname} -} - -// SignedURLOptions allows you to restrict the access to the signed URL. -type SignedURLOptions struct { - // GoogleAccessID represents the authorizer of the signed URL generation. - // It is typically the Google service account client email address from - // the Google Developers Console in the form of "xxx@developer.gserviceaccount.com". - // Required. - GoogleAccessID string - - // PrivateKey is the Google service account private key. It is obtainable - // from the Google Developers Console. - // At https://console.developers.google.com/project//apiui/credential, - // create a service account client ID or reuse one of your existing service account - // credentials. Click on the "Generate new P12 key" to generate and download - // a new private key. Once you download the P12 file, use the following command - // to convert it into a PEM file. - // - // $ openssl pkcs12 -in key.p12 -passin pass:notasecret -out key.pem -nodes - // - // Provide the contents of the PEM file as a byte slice. - // Exactly one of PrivateKey or SignBytes must be non-nil. - PrivateKey []byte - - // SignBytes is a function for implementing custom signing. For example, if - // your application is running on Google App Engine, you can use - // appengine's internal signing function: - // ctx := appengine.NewContext(request) - // acc, _ := appengine.ServiceAccount(ctx) - // url, err := SignedURL("bucket", "object", &SignedURLOptions{ - // GoogleAccessID: acc, - // SignBytes: func(b []byte) ([]byte, error) { - // _, signedBytes, err := appengine.SignBytes(ctx, b) - // return signedBytes, err - // }, - // // etc. - // }) - // - // Exactly one of PrivateKey or SignBytes must be non-nil. - SignBytes func([]byte) ([]byte, error) - - // Method is the HTTP method to be used with the signed URL. - // Signed URLs can be used with GET, HEAD, PUT, and DELETE requests. - // Required. - Method string - - // Expires is the expiration time on the signed URL. It must be - // a datetime in the future. For SigningSchemeV4, the expiration may be no - // more than seven days in the future. - // Required. - Expires time.Time - - // ContentType is the content type header the client must provide - // to use the generated signed URL. - // Optional. - ContentType string - - // Headers is a list of extension headers the client must provide - // in order to use the generated signed URL. Each must be a string of the - // form "key:values", with multiple values separated by a semicolon. - // Optional. - Headers []string - - // QueryParameters is a map of additional query parameters. When - // SigningScheme is V4, this is used in computing the signature, and the - // client must use the same query parameters when using the generated signed - // URL. - // Optional. - QueryParameters url.Values - - // MD5 is the base64 encoded MD5 checksum of the file. - // If provided, the client should provide the exact value on the request - // header in order to use the signed URL. - // Optional. - MD5 string - - // Style provides options for the type of URL to use. Options are - // PathStyle (default), BucketBoundHostname, and VirtualHostedStyle. See - // https://cloud.google.com/storage/docs/request-endpoints for details. - // Only supported for V4 signing. - // Optional. - Style URLStyle - - // Insecure determines whether the signed URL should use HTTPS (default) or - // HTTP. - // Only supported for V4 signing. - // Optional. - Insecure bool - - // Scheme determines the version of URL signing to use. Default is - // SigningSchemeV2. - Scheme SigningScheme -} - -var ( - tabRegex = regexp.MustCompile(`[\t]+`) - // I was tempted to call this spacex. :) - spaceRegex = regexp.MustCompile(` +`) - - canonicalHeaderRegexp = regexp.MustCompile(`(?i)^(x-goog-[^:]+):(.*)?$`) - excludedCanonicalHeaders = map[string]bool{ - "x-goog-encryption-key": true, - "x-goog-encryption-key-sha256": true, - } -) - -// v2SanitizeHeaders applies the specifications for canonical extension headers at -// https://cloud.google.com/storage/docs/access-control/signed-urls#about-canonical-extension-headers. -func v2SanitizeHeaders(hdrs []string) []string { - headerMap := map[string][]string{} - for _, hdr := range hdrs { - // No leading or trailing whitespaces. - sanitizedHeader := strings.TrimSpace(hdr) - - var header, value string - // Only keep canonical headers, discard any others. - headerMatches := canonicalHeaderRegexp.FindStringSubmatch(sanitizedHeader) - if len(headerMatches) == 0 { - continue - } - header = headerMatches[1] - value = headerMatches[2] - - header = strings.ToLower(strings.TrimSpace(header)) - value = strings.TrimSpace(value) - - if excludedCanonicalHeaders[header] { - // Do not keep any deliberately excluded canonical headers when signing. - continue - } - - if len(value) > 0 { - // Remove duplicate headers by appending the values of duplicates - // in their order of appearance. - headerMap[header] = append(headerMap[header], value) - } - } - - var sanitizedHeaders []string - for header, values := range headerMap { - // There should be no spaces around the colon separating the header name - // from the header value or around the values themselves. The values - // should be separated by commas. - // - // NOTE: The semantics for headers without a value are not clear. - // However from specifications these should be edge-cases anyway and we - // should assume that there will be no canonical headers using empty - // values. Any such headers are discarded at the regexp stage above. - sanitizedHeaders = append(sanitizedHeaders, fmt.Sprintf("%s:%s", header, strings.Join(values, ","))) - } - sort.Strings(sanitizedHeaders) - return sanitizedHeaders -} - -// v4SanitizeHeaders applies the specifications for canonical extension headers -// at https://cloud.google.com/storage/docs/access-control/signed-urls#about-canonical-extension-headers. -// -// V4 does a couple things differently from V2: -// - Headers get sorted by key, instead of by key:value. We do this in -// signedURLV4. -// - There's no canonical regexp: we simply split headers on :. -// - We don't exclude canonical headers. -// - We replace leading and trailing spaces in header values, like v2, but also -// all intermediate space duplicates get stripped. That is, there's only ever -// a single consecutive space. -func v4SanitizeHeaders(hdrs []string) []string { - headerMap := map[string][]string{} - for _, hdr := range hdrs { - // No leading or trailing whitespaces. - sanitizedHeader := strings.TrimSpace(hdr) - - var key, value string - headerMatches := strings.Split(sanitizedHeader, ":") - if len(headerMatches) < 2 { - continue - } - - key = headerMatches[0] - value = headerMatches[1] - - key = strings.ToLower(strings.TrimSpace(key)) - value = strings.TrimSpace(value) - value = string(spaceRegex.ReplaceAll([]byte(value), []byte(" "))) - value = string(tabRegex.ReplaceAll([]byte(value), []byte("\t"))) - - if len(value) > 0 { - // Remove duplicate headers by appending the values of duplicates - // in their order of appearance. - headerMap[key] = append(headerMap[key], value) - } - } - - var sanitizedHeaders []string - for header, values := range headerMap { - // There should be no spaces around the colon separating the header name - // from the header value or around the values themselves. The values - // should be separated by commas. - // - // NOTE: The semantics for headers without a value are not clear. - // However from specifications these should be edge-cases anyway and we - // should assume that there will be no canonical headers using empty - // values. Any such headers are discarded at the regexp stage above. - sanitizedHeaders = append(sanitizedHeaders, fmt.Sprintf("%s:%s", header, strings.Join(values, ","))) - } - return sanitizedHeaders -} - -// SignedURL returns a URL for the specified object. Signed URLs allow -// the users access to a restricted resource for a limited time without having a -// Google account or signing in. For more information about the signed -// URLs, see https://cloud.google.com/storage/docs/accesscontrol#Signed-URLs. -func SignedURL(bucket, name string, opts *SignedURLOptions) (string, error) { - now := utcNow() - if err := validateOptions(opts, now); err != nil { - return "", err - } - - switch opts.Scheme { - case SigningSchemeV2: - opts.Headers = v2SanitizeHeaders(opts.Headers) - return signedURLV2(bucket, name, opts) - case SigningSchemeV4: - opts.Headers = v4SanitizeHeaders(opts.Headers) - return signedURLV4(bucket, name, opts, now) - default: // SigningSchemeDefault - opts.Headers = v2SanitizeHeaders(opts.Headers) - return signedURLV2(bucket, name, opts) - } -} - -func validateOptions(opts *SignedURLOptions, now time.Time) error { - if opts == nil { - return errors.New("storage: missing required SignedURLOptions") - } - if opts.GoogleAccessID == "" { - return errors.New("storage: missing required GoogleAccessID") - } - if (opts.PrivateKey == nil) == (opts.SignBytes == nil) { - return errors.New("storage: exactly one of PrivateKey or SignedBytes must be set") - } - opts.Method = strings.ToUpper(opts.Method) - if _, ok := signedURLMethods[opts.Method]; !ok { - return errMethodNotValid - } - if opts.Expires.IsZero() { - return errors.New("storage: missing required expires option") - } - if opts.MD5 != "" { - md5, err := base64.StdEncoding.DecodeString(opts.MD5) - if err != nil || len(md5) != 16 { - return errors.New("storage: invalid MD5 checksum") - } - } - if opts.Style == nil { - opts.Style = PathStyle() - } - if _, ok := opts.Style.(pathStyle); !ok && opts.Scheme == SigningSchemeV2 { - return errors.New("storage: only path-style URLs are permitted with SigningSchemeV2") - } - if opts.Scheme == SigningSchemeV4 { - cutoff := now.Add(604801 * time.Second) // 7 days + 1 second - if !opts.Expires.Before(cutoff) { - return errors.New("storage: expires must be within seven days from now") - } - } - return nil -} - -const ( - iso8601 = "20060102T150405Z" - yearMonthDay = "20060102" -) - -// utcNow returns the current time in UTC and is a variable to allow for -// reassignment in tests to provide deterministic signed URL values. -var utcNow = func() time.Time { - return time.Now().UTC() -} - -// extractHeaderNames takes in a series of key:value headers and returns the -// header names only. -func extractHeaderNames(kvs []string) []string { - var res []string - for _, header := range kvs { - nameValue := strings.Split(header, ":") - res = append(res, nameValue[0]) - } - return res -} - -// pathEncodeV4 creates an encoded string that matches the v4 signature spec. -// Following the spec precisely is necessary in order to ensure that the URL -// and signing string are correctly formed, and Go's url.PathEncode and -// url.QueryEncode don't generate an exact match without some additional logic. -func pathEncodeV4(path string) string { - segments := strings.Split(path, "/") - var encodedSegments []string - for _, s := range segments { - encodedSegments = append(encodedSegments, url.QueryEscape(s)) - } - encodedStr := strings.Join(encodedSegments, "/") - encodedStr = strings.Replace(encodedStr, "+", "%20", -1) - return encodedStr -} - -// signedURLV4 creates a signed URL using the sigV4 algorithm. -func signedURLV4(bucket, name string, opts *SignedURLOptions, now time.Time) (string, error) { - buf := &bytes.Buffer{} - fmt.Fprintf(buf, "%s\n", opts.Method) - - u := &url.URL{Path: opts.Style.path(bucket, name)} - u.RawPath = pathEncodeV4(u.Path) - - // Note: we have to add a / here because GCS does so auto-magically, despite - // our encoding not doing so (and we have to exactly match their - // canonical query). - fmt.Fprintf(buf, "/%s\n", u.RawPath) - - headerNames := append(extractHeaderNames(opts.Headers), "host") - if opts.ContentType != "" { - headerNames = append(headerNames, "content-type") - } - if opts.MD5 != "" { - headerNames = append(headerNames, "content-md5") - } - sort.Strings(headerNames) - signedHeaders := strings.Join(headerNames, ";") - timestamp := now.Format(iso8601) - credentialScope := fmt.Sprintf("%s/auto/storage/goog4_request", now.Format(yearMonthDay)) - canonicalQueryString := url.Values{ - "X-Goog-Algorithm": {"GOOG4-RSA-SHA256"}, - "X-Goog-Credential": {fmt.Sprintf("%s/%s", opts.GoogleAccessID, credentialScope)}, - "X-Goog-Date": {timestamp}, - "X-Goog-Expires": {fmt.Sprintf("%d", int(opts.Expires.Sub(now).Seconds()))}, - "X-Goog-SignedHeaders": {signedHeaders}, - } - // Add user-supplied query parameters to the canonical query string. For V4, - // it's necessary to include these. - for k, v := range opts.QueryParameters { - canonicalQueryString[k] = append(canonicalQueryString[k], v...) - } - - fmt.Fprintf(buf, "%s\n", canonicalQueryString.Encode()) - - // Fill in the hostname based on the desired URL style. - u.Host = opts.Style.host(bucket) - - // Fill in the URL scheme. - if opts.Insecure { - u.Scheme = "http" - } else { - u.Scheme = "https" - } - - var headersWithValue []string - headersWithValue = append(headersWithValue, "host:"+u.Host) - headersWithValue = append(headersWithValue, opts.Headers...) - if opts.ContentType != "" { - headersWithValue = append(headersWithValue, "content-type:"+opts.ContentType) - } - if opts.MD5 != "" { - headersWithValue = append(headersWithValue, "content-md5:"+opts.MD5) - } - // Trim extra whitespace from headers and replace with a single space. - var trimmedHeaders []string - for _, h := range headersWithValue { - trimmedHeaders = append(trimmedHeaders, strings.Join(strings.Fields(h), " ")) - } - canonicalHeaders := strings.Join(sortHeadersByKey(trimmedHeaders), "\n") - fmt.Fprintf(buf, "%s\n\n", canonicalHeaders) - fmt.Fprintf(buf, "%s\n", signedHeaders) - - // If the user provides a value for X-Goog-Content-SHA256, we must use - // that value in the request string. If not, we use UNSIGNED-PAYLOAD. - sha256Header := false - for _, h := range trimmedHeaders { - if strings.HasPrefix(strings.ToLower(h), "x-goog-content-sha256") && strings.Contains(h, ":") { - sha256Header = true - fmt.Fprintf(buf, "%s", strings.SplitN(h, ":", 2)[1]) - break - } - } - if !sha256Header { - fmt.Fprint(buf, "UNSIGNED-PAYLOAD") - } - - sum := sha256.Sum256(buf.Bytes()) - hexDigest := hex.EncodeToString(sum[:]) - signBuf := &bytes.Buffer{} - fmt.Fprint(signBuf, "GOOG4-RSA-SHA256\n") - fmt.Fprintf(signBuf, "%s\n", timestamp) - fmt.Fprintf(signBuf, "%s\n", credentialScope) - fmt.Fprintf(signBuf, "%s", hexDigest) - - signBytes := opts.SignBytes - if opts.PrivateKey != nil { - key, err := parseKey(opts.PrivateKey) - if err != nil { - return "", err - } - signBytes = func(b []byte) ([]byte, error) { - sum := sha256.Sum256(b) - return rsa.SignPKCS1v15( - rand.Reader, - key, - crypto.SHA256, - sum[:], - ) - } - } - b, err := signBytes(signBuf.Bytes()) - if err != nil { - return "", err - } - signature := hex.EncodeToString(b) - canonicalQueryString.Set("X-Goog-Signature", string(signature)) - u.RawQuery = canonicalQueryString.Encode() - return u.String(), nil -} - -// takes a list of headerKey:headervalue1,headervalue2,etc and sorts by header -// key. -func sortHeadersByKey(hdrs []string) []string { - headersMap := map[string]string{} - var headersKeys []string - for _, h := range hdrs { - parts := strings.Split(h, ":") - k := parts[0] - v := parts[1] - headersMap[k] = v - headersKeys = append(headersKeys, k) - } - sort.Strings(headersKeys) - var sorted []string - for _, k := range headersKeys { - v := headersMap[k] - sorted = append(sorted, fmt.Sprintf("%s:%s", k, v)) - } - return sorted -} - -func signedURLV2(bucket, name string, opts *SignedURLOptions) (string, error) { - signBytes := opts.SignBytes - if opts.PrivateKey != nil { - key, err := parseKey(opts.PrivateKey) - if err != nil { - return "", err - } - signBytes = func(b []byte) ([]byte, error) { - sum := sha256.Sum256(b) - return rsa.SignPKCS1v15( - rand.Reader, - key, - crypto.SHA256, - sum[:], - ) - } - } - - u := &url.URL{ - Path: fmt.Sprintf("/%s/%s", bucket, name), - } - - buf := &bytes.Buffer{} - fmt.Fprintf(buf, "%s\n", opts.Method) - fmt.Fprintf(buf, "%s\n", opts.MD5) - fmt.Fprintf(buf, "%s\n", opts.ContentType) - fmt.Fprintf(buf, "%d\n", opts.Expires.Unix()) - if len(opts.Headers) > 0 { - fmt.Fprintf(buf, "%s\n", strings.Join(opts.Headers, "\n")) - } - fmt.Fprintf(buf, "%s", u.String()) - - b, err := signBytes(buf.Bytes()) - if err != nil { - return "", err - } - encoded := base64.StdEncoding.EncodeToString(b) - u.Scheme = "https" - u.Host = "storage.googleapis.com" - q := u.Query() - q.Set("GoogleAccessId", opts.GoogleAccessID) - q.Set("Expires", fmt.Sprintf("%d", opts.Expires.Unix())) - q.Set("Signature", string(encoded)) - u.RawQuery = q.Encode() - return u.String(), nil -} - -// ObjectHandle provides operations on an object in a Google Cloud Storage bucket. -// Use BucketHandle.Object to get a handle. -type ObjectHandle struct { - c *Client - bucket string - object string - acl ACLHandle - gen int64 // a negative value indicates latest - conds *Conditions - encryptionKey []byte // AES-256 key - userProject string // for requester-pays buckets - readCompressed bool // Accept-Encoding: gzip -} - -// ACL provides access to the object's access control list. -// This controls who can read and write this object. -// This call does not perform any network operations. -func (o *ObjectHandle) ACL() *ACLHandle { - return &o.acl -} - -// Generation returns a new ObjectHandle that operates on a specific generation -// of the object. -// By default, the handle operates on the latest generation. Not -// all operations work when given a specific generation; check the API -// endpoints at https://cloud.google.com/storage/docs/json_api/ for details. -func (o *ObjectHandle) Generation(gen int64) *ObjectHandle { - o2 := *o - o2.gen = gen - return &o2 -} - -// If returns a new ObjectHandle that applies a set of preconditions. -// Preconditions already set on the ObjectHandle are ignored. -// Operations on the new handle will return an error if the preconditions are not -// satisfied. See https://cloud.google.com/storage/docs/generations-preconditions -// for more details. -func (o *ObjectHandle) If(conds Conditions) *ObjectHandle { - o2 := *o - o2.conds = &conds - return &o2 -} - -// Key returns a new ObjectHandle that uses the supplied encryption -// key to encrypt and decrypt the object's contents. -// -// Encryption key must be a 32-byte AES-256 key. -// See https://cloud.google.com/storage/docs/encryption for details. -func (o *ObjectHandle) Key(encryptionKey []byte) *ObjectHandle { - o2 := *o - o2.encryptionKey = encryptionKey - return &o2 -} - -// Attrs returns meta information about the object. -// ErrObjectNotExist will be returned if the object is not found. -func (o *ObjectHandle) Attrs(ctx context.Context) (attrs *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Attrs") - defer func() { trace.EndSpan(ctx, err) }() - - if err := o.validate(); err != nil { - return nil, err - } - call := o.c.raw.Objects.Get(o.bucket, o.object).Projection("full").Context(ctx) - if err := applyConds("Attrs", o.gen, o.conds, call); err != nil { - return nil, err - } - if o.userProject != "" { - call.UserProject(o.userProject) - } - if err := setEncryptionHeaders(call.Header(), o.encryptionKey, false); err != nil { - return nil, err - } - var obj *raw.Object - setClientHeader(call.Header()) - err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { - return nil, ErrObjectNotExist - } - if err != nil { - return nil, err - } - return newObject(obj), nil -} - -// Update updates an object with the provided attributes. -// All zero-value attributes are ignored. -// ErrObjectNotExist will be returned if the object is not found. -func (o *ObjectHandle) Update(ctx context.Context, uattrs ObjectAttrsToUpdate) (oa *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Update") - defer func() { trace.EndSpan(ctx, err) }() - - if err := o.validate(); err != nil { - return nil, err - } - var attrs ObjectAttrs - // Lists of fields to send, and set to null, in the JSON. - var forceSendFields, nullFields []string - if uattrs.ContentType != nil { - attrs.ContentType = optional.ToString(uattrs.ContentType) - // For ContentType, sending the empty string is a no-op. - // Instead we send a null. - if attrs.ContentType == "" { - nullFields = append(nullFields, "ContentType") - } else { - forceSendFields = append(forceSendFields, "ContentType") - } - } - if uattrs.ContentLanguage != nil { - attrs.ContentLanguage = optional.ToString(uattrs.ContentLanguage) - // For ContentLanguage it's an error to send the empty string. - // Instead we send a null. - if attrs.ContentLanguage == "" { - nullFields = append(nullFields, "ContentLanguage") - } else { - forceSendFields = append(forceSendFields, "ContentLanguage") - } - } - if uattrs.ContentEncoding != nil { - attrs.ContentEncoding = optional.ToString(uattrs.ContentEncoding) - forceSendFields = append(forceSendFields, "ContentEncoding") - } - if uattrs.ContentDisposition != nil { - attrs.ContentDisposition = optional.ToString(uattrs.ContentDisposition) - forceSendFields = append(forceSendFields, "ContentDisposition") - } - if uattrs.CacheControl != nil { - attrs.CacheControl = optional.ToString(uattrs.CacheControl) - forceSendFields = append(forceSendFields, "CacheControl") - } - if uattrs.EventBasedHold != nil { - attrs.EventBasedHold = optional.ToBool(uattrs.EventBasedHold) - forceSendFields = append(forceSendFields, "EventBasedHold") - } - if uattrs.TemporaryHold != nil { - attrs.TemporaryHold = optional.ToBool(uattrs.TemporaryHold) - forceSendFields = append(forceSendFields, "TemporaryHold") - } - if uattrs.Metadata != nil { - attrs.Metadata = uattrs.Metadata - if len(attrs.Metadata) == 0 { - // Sending the empty map is a no-op. We send null instead. - nullFields = append(nullFields, "Metadata") - } else { - forceSendFields = append(forceSendFields, "Metadata") - } - } - if uattrs.ACL != nil { - attrs.ACL = uattrs.ACL - // It's an error to attempt to delete the ACL, so - // we don't append to nullFields here. - forceSendFields = append(forceSendFields, "Acl") - } - rawObj := attrs.toRawObject(o.bucket) - rawObj.ForceSendFields = forceSendFields - rawObj.NullFields = nullFields - call := o.c.raw.Objects.Patch(o.bucket, o.object, rawObj).Projection("full").Context(ctx) - if err := applyConds("Update", o.gen, o.conds, call); err != nil { - return nil, err - } - if o.userProject != "" { - call.UserProject(o.userProject) - } - if uattrs.PredefinedACL != "" { - call.PredefinedAcl(uattrs.PredefinedACL) - } - if err := setEncryptionHeaders(call.Header(), o.encryptionKey, false); err != nil { - return nil, err - } - var obj *raw.Object - setClientHeader(call.Header()) - err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { - return nil, ErrObjectNotExist - } - if err != nil { - return nil, err - } - return newObject(obj), nil -} - -// BucketName returns the name of the bucket. -func (o *ObjectHandle) BucketName() string { - return o.bucket -} - -// ObjectName returns the name of the object. -func (o *ObjectHandle) ObjectName() string { - return o.object -} - -// ObjectAttrsToUpdate is used to update the attributes of an object. -// Only fields set to non-nil values will be updated. -// Set a field to its zero value to delete it. -// -// For example, to change ContentType and delete ContentEncoding and -// Metadata, use -// ObjectAttrsToUpdate{ -// ContentType: "text/html", -// ContentEncoding: "", -// Metadata: map[string]string{}, -// } -type ObjectAttrsToUpdate struct { - EventBasedHold optional.Bool - TemporaryHold optional.Bool - ContentType optional.String - ContentLanguage optional.String - ContentEncoding optional.String - ContentDisposition optional.String - CacheControl optional.String - Metadata map[string]string // set to map[string]string{} to delete - ACL []ACLRule - - // If not empty, applies a predefined set of access controls. ACL must be nil. - // See https://cloud.google.com/storage/docs/json_api/v1/objects/patch. - PredefinedACL string -} - -// Delete deletes the single specified object. -func (o *ObjectHandle) Delete(ctx context.Context) error { - if err := o.validate(); err != nil { - return err - } - call := o.c.raw.Objects.Delete(o.bucket, o.object).Context(ctx) - if err := applyConds("Delete", o.gen, o.conds, call); err != nil { - return err - } - if o.userProject != "" { - call.UserProject(o.userProject) - } - // Encryption doesn't apply to Delete. - setClientHeader(call.Header()) - err := runWithRetry(ctx, func() error { return call.Do() }) - switch e := err.(type) { - case nil: - return nil - case *googleapi.Error: - if e.Code == http.StatusNotFound { - return ErrObjectNotExist - } - } - return err -} - -// ReadCompressed when true causes the read to happen without decompressing. -func (o *ObjectHandle) ReadCompressed(compressed bool) *ObjectHandle { - o2 := *o - o2.readCompressed = compressed - return &o2 -} - -// NewWriter returns a storage Writer that writes to the GCS object -// associated with this ObjectHandle. -// -// A new object will be created unless an object with this name already exists. -// Otherwise any previous object with the same name will be replaced. -// The object will not be available (and any previous object will remain) -// until Close has been called. -// -// Attributes can be set on the object by modifying the returned Writer's -// ObjectAttrs field before the first call to Write. If no ContentType -// attribute is specified, the content type will be automatically sniffed -// using net/http.DetectContentType. -// -// It is the caller's responsibility to call Close when writing is done. To -// stop writing without saving the data, cancel the context. -func (o *ObjectHandle) NewWriter(ctx context.Context) *Writer { - return &Writer{ - ctx: ctx, - o: o, - donec: make(chan struct{}), - ObjectAttrs: ObjectAttrs{Name: o.object}, - ChunkSize: googleapi.DefaultUploadChunkSize, - } -} - -func (o *ObjectHandle) validate() error { - if o.bucket == "" { - return errors.New("storage: bucket name is empty") - } - if o.object == "" { - return errors.New("storage: object name is empty") - } - if !utf8.ValidString(o.object) { - return fmt.Errorf("storage: object name %q is not valid UTF-8", o.object) - } - return nil -} - -// parseKey converts the binary contents of a private key file to an -// *rsa.PrivateKey. It detects whether the private key is in a PEM container or -// not. If so, it extracts the private key from PEM container before -// conversion. It only supports PEM containers with no passphrase. -func parseKey(key []byte) (*rsa.PrivateKey, error) { - if block, _ := pem.Decode(key); block != nil { - key = block.Bytes - } - parsedKey, err := x509.ParsePKCS8PrivateKey(key) - if err != nil { - parsedKey, err = x509.ParsePKCS1PrivateKey(key) - if err != nil { - return nil, err - } - } - parsed, ok := parsedKey.(*rsa.PrivateKey) - if !ok { - return nil, errors.New("oauth2: private key is invalid") - } - return parsed, nil -} - -// toRawObject copies the editable attributes from o to the raw library's Object type. -func (o *ObjectAttrs) toRawObject(bucket string) *raw.Object { - var ret string - if !o.RetentionExpirationTime.IsZero() { - ret = o.RetentionExpirationTime.Format(time.RFC3339) - } - return &raw.Object{ - Bucket: bucket, - Name: o.Name, - EventBasedHold: o.EventBasedHold, - TemporaryHold: o.TemporaryHold, - RetentionExpirationTime: ret, - ContentType: o.ContentType, - ContentEncoding: o.ContentEncoding, - ContentLanguage: o.ContentLanguage, - CacheControl: o.CacheControl, - ContentDisposition: o.ContentDisposition, - StorageClass: o.StorageClass, - Acl: toRawObjectACL(o.ACL), - Metadata: o.Metadata, - } -} - -// ObjectAttrs represents the metadata for a Google Cloud Storage (GCS) object. -type ObjectAttrs struct { - // Bucket is the name of the bucket containing this GCS object. - // This field is read-only. - Bucket string - - // Name is the name of the object within the bucket. - // This field is read-only. - Name string - - // ContentType is the MIME type of the object's content. - ContentType string - - // ContentLanguage is the content language of the object's content. - ContentLanguage string - - // CacheControl is the Cache-Control header to be sent in the response - // headers when serving the object data. - CacheControl string - - // EventBasedHold specifies whether an object is under event-based hold. New - // objects created in a bucket whose DefaultEventBasedHold is set will - // default to that value. - EventBasedHold bool - - // TemporaryHold specifies whether an object is under temporary hold. While - // this flag is set to true, the object is protected against deletion and - // overwrites. - TemporaryHold bool - - // RetentionExpirationTime is a server-determined value that specifies the - // earliest time that the object's retention period expires. - // This is a read-only field. - RetentionExpirationTime time.Time - - // ACL is the list of access control rules for the object. - ACL []ACLRule - - // If not empty, applies a predefined set of access controls. It should be set - // only when writing, copying or composing an object. When copying or composing, - // it acts as the destinationPredefinedAcl parameter. - // PredefinedACL is always empty for ObjectAttrs returned from the service. - // See https://cloud.google.com/storage/docs/json_api/v1/objects/insert - // for valid values. - PredefinedACL string - - // Owner is the owner of the object. This field is read-only. - // - // If non-zero, it is in the form of "user-". - Owner string - - // Size is the length of the object's content. This field is read-only. - Size int64 - - // ContentEncoding is the encoding of the object's content. - ContentEncoding string - - // ContentDisposition is the optional Content-Disposition header of the object - // sent in the response headers. - ContentDisposition string - - // MD5 is the MD5 hash of the object's content. This field is read-only, - // except when used from a Writer. If set on a Writer, the uploaded - // data is rejected if its MD5 hash does not match this field. - MD5 []byte - - // CRC32C is the CRC32 checksum of the object's content using the Castagnoli93 - // polynomial. This field is read-only, except when used from a Writer or - // Composer. In those cases, if the SendCRC32C field in the Writer or Composer - // is set to is true, the uploaded data is rejected if its CRC32C hash does - // not match this field. - CRC32C uint32 - - // MediaLink is an URL to the object's content. This field is read-only. - MediaLink string - - // Metadata represents user-provided metadata, in key/value pairs. - // It can be nil if no metadata is provided. - Metadata map[string]string - - // Generation is the generation number of the object's content. - // This field is read-only. - Generation int64 - - // Metageneration is the version of the metadata for this - // object at this generation. This field is used for preconditions - // and for detecting changes in metadata. A metageneration number - // is only meaningful in the context of a particular generation - // of a particular object. This field is read-only. - Metageneration int64 - - // StorageClass is the storage class of the object. This defines - // how objects are stored and determines the SLA and the cost of storage. - // Typical values are "STANDARD", "NEARLINE", "COLDLINE" and "ARCHIVE". - // Defaults to "STANDARD". - // See https://cloud.google.com/storage/docs/storage-classes for all - // valid values. - StorageClass string - - // Created is the time the object was created. This field is read-only. - Created time.Time - - // Deleted is the time the object was deleted. - // If not deleted, it is the zero value. This field is read-only. - Deleted time.Time - - // Updated is the creation or modification time of the object. - // For buckets with versioning enabled, changing an object's - // metadata does not change this property. This field is read-only. - Updated time.Time - - // CustomerKeySHA256 is the base64-encoded SHA-256 hash of the - // customer-supplied encryption key for the object. It is empty if there is - // no customer-supplied encryption key. - // See // https://cloud.google.com/storage/docs/encryption for more about - // encryption in Google Cloud Storage. - CustomerKeySHA256 string - - // Cloud KMS key name, in the form - // projects/P/locations/L/keyRings/R/cryptoKeys/K, used to encrypt this object, - // if the object is encrypted by such a key. - // - // Providing both a KMSKeyName and a customer-supplied encryption key (via - // ObjectHandle.Key) will result in an error when writing an object. - KMSKeyName string - - // Prefix is set only for ObjectAttrs which represent synthetic "directory - // entries" when iterating over buckets using Query.Delimiter. See - // ObjectIterator.Next. When set, no other fields in ObjectAttrs will be - // populated. - Prefix string - - // Etag is the HTTP/1.1 Entity tag for the object. - // This field is read-only. - Etag string -} - -// convertTime converts a time in RFC3339 format to time.Time. -// If any error occurs in parsing, the zero-value time.Time is silently returned. -func convertTime(t string) time.Time { - var r time.Time - if t != "" { - r, _ = time.Parse(time.RFC3339, t) - } - return r -} - -func newObject(o *raw.Object) *ObjectAttrs { - if o == nil { - return nil - } - owner := "" - if o.Owner != nil { - owner = o.Owner.Entity - } - md5, _ := base64.StdEncoding.DecodeString(o.Md5Hash) - crc32c, _ := decodeUint32(o.Crc32c) - var sha256 string - if o.CustomerEncryption != nil { - sha256 = o.CustomerEncryption.KeySha256 - } - return &ObjectAttrs{ - Bucket: o.Bucket, - Name: o.Name, - ContentType: o.ContentType, - ContentLanguage: o.ContentLanguage, - CacheControl: o.CacheControl, - EventBasedHold: o.EventBasedHold, - TemporaryHold: o.TemporaryHold, - RetentionExpirationTime: convertTime(o.RetentionExpirationTime), - ACL: toObjectACLRules(o.Acl), - Owner: owner, - ContentEncoding: o.ContentEncoding, - ContentDisposition: o.ContentDisposition, - Size: int64(o.Size), - MD5: md5, - CRC32C: crc32c, - MediaLink: o.MediaLink, - Metadata: o.Metadata, - Generation: o.Generation, - Metageneration: o.Metageneration, - StorageClass: o.StorageClass, - CustomerKeySHA256: sha256, - KMSKeyName: o.KmsKeyName, - Created: convertTime(o.TimeCreated), - Deleted: convertTime(o.TimeDeleted), - Updated: convertTime(o.Updated), - Etag: o.Etag, - } -} - -// Decode a uint32 encoded in Base64 in big-endian byte order. -func decodeUint32(b64 string) (uint32, error) { - d, err := base64.StdEncoding.DecodeString(b64) - if err != nil { - return 0, err - } - if len(d) != 4 { - return 0, fmt.Errorf("storage: %q does not encode a 32-bit value", d) - } - return uint32(d[0])<<24 + uint32(d[1])<<16 + uint32(d[2])<<8 + uint32(d[3]), nil -} - -// Encode a uint32 as Base64 in big-endian byte order. -func encodeUint32(u uint32) string { - b := []byte{byte(u >> 24), byte(u >> 16), byte(u >> 8), byte(u)} - return base64.StdEncoding.EncodeToString(b) -} - -// Query represents a query to filter objects from a bucket. -type Query struct { - // Delimiter returns results in a directory-like fashion. - // Results will contain only objects whose names, aside from the - // prefix, do not contain delimiter. Objects whose names, - // aside from the prefix, contain delimiter will have their name, - // truncated after the delimiter, returned in prefixes. - // Duplicate prefixes are omitted. - // Optional. - Delimiter string - - // Prefix is the prefix filter to query objects - // whose names begin with this prefix. - // Optional. - Prefix string - - // Versions indicates whether multiple versions of the same - // object will be included in the results. - Versions bool - - // fieldSelection is used to select only specific fields to be returned by - // the query. It's used internally and is populated for the user by - // calling Query.SetAttrSelection - fieldSelection string -} - -// attrToFieldMap maps the field names of ObjectAttrs to the underlying field -// names in the API call. Only the ObjectAttrs field names are visible to users -// because they are already part of the public API of the package. -var attrToFieldMap = map[string]string{ - "Bucket": "bucket", - "Name": "name", - "ContentType": "contentType", - "ContentLanguage": "contentLanguage", - "CacheControl": "cacheControl", - "EventBasedHold": "eventBasedHold", - "TemporaryHold": "temporaryHold", - "RetentionExpirationTime": "retentionExpirationTime", - "ACL": "acl", - "Owner": "owner", - "ContentEncoding": "contentEncoding", - "ContentDisposition": "contentDisposition", - "Size": "size", - "MD5": "md5Hash", - "CRC32C": "crc32c", - "MediaLink": "mediaLink", - "Metadata": "metadata", - "Generation": "generation", - "Metageneration": "metageneration", - "StorageClass": "storageClass", - "CustomerKeySHA256": "customerEncryption", - "KMSKeyName": "kmsKeyName", - "Created": "timeCreated", - "Deleted": "timeDeleted", - "Updated": "updated", - "Etag": "etag", -} - -// SetAttrSelection makes the query populate only specific attributes of -// objects. When iterating over objects, if you only need each object's name -// and size, pass []string{"Name", "Size"} to this method. Only these fields -// will be fetched for each object across the network; the other fields of -// ObjectAttr will remain at their default values. This is a performance -// optimization; for more information, see -// https://cloud.google.com/storage/docs/json_api/v1/how-tos/performance -func (q *Query) SetAttrSelection(attrs []string) error { - fieldSet := make(map[string]bool) - - for _, attr := range attrs { - field, ok := attrToFieldMap[attr] - if !ok { - return fmt.Errorf("storage: attr %v is not valid", attr) - } - fieldSet[field] = true - } - - if len(fieldSet) > 0 { - var b bytes.Buffer - b.WriteString("items(") - first := true - for field := range fieldSet { - if !first { - b.WriteString(",") - } - first = false - b.WriteString(field) - } - b.WriteString(")") - q.fieldSelection = b.String() - } - return nil -} - -// Conditions constrain methods to act on specific generations of -// objects. -// -// The zero value is an empty set of constraints. Not all conditions or -// combinations of conditions are applicable to all methods. -// See https://cloud.google.com/storage/docs/generations-preconditions -// for details on how these operate. -type Conditions struct { - // Generation constraints. - // At most one of the following can be set to a non-zero value. - - // GenerationMatch specifies that the object must have the given generation - // for the operation to occur. - // If GenerationMatch is zero, it has no effect. - // Use DoesNotExist to specify that the object does not exist in the bucket. - GenerationMatch int64 - - // GenerationNotMatch specifies that the object must not have the given - // generation for the operation to occur. - // If GenerationNotMatch is zero, it has no effect. - GenerationNotMatch int64 - - // DoesNotExist specifies that the object must not exist in the bucket for - // the operation to occur. - // If DoesNotExist is false, it has no effect. - DoesNotExist bool - - // Metadata generation constraints. - // At most one of the following can be set to a non-zero value. - - // MetagenerationMatch specifies that the object must have the given - // metageneration for the operation to occur. - // If MetagenerationMatch is zero, it has no effect. - MetagenerationMatch int64 - - // MetagenerationNotMatch specifies that the object must not have the given - // metageneration for the operation to occur. - // If MetagenerationNotMatch is zero, it has no effect. - MetagenerationNotMatch int64 -} - -func (c *Conditions) validate(method string) error { - if *c == (Conditions{}) { - return fmt.Errorf("storage: %s: empty conditions", method) - } - if !c.isGenerationValid() { - return fmt.Errorf("storage: %s: multiple conditions specified for generation", method) - } - if !c.isMetagenerationValid() { - return fmt.Errorf("storage: %s: multiple conditions specified for metageneration", method) - } - return nil -} - -func (c *Conditions) isGenerationValid() bool { - n := 0 - if c.GenerationMatch != 0 { - n++ - } - if c.GenerationNotMatch != 0 { - n++ - } - if c.DoesNotExist { - n++ - } - return n <= 1 -} - -func (c *Conditions) isMetagenerationValid() bool { - return c.MetagenerationMatch == 0 || c.MetagenerationNotMatch == 0 -} - -// applyConds modifies the provided call using the conditions in conds. -// call is something that quacks like a *raw.WhateverCall. -func applyConds(method string, gen int64, conds *Conditions, call interface{}) error { - cval := reflect.ValueOf(call) - if gen >= 0 { - if !setConditionField(cval, "Generation", gen) { - return fmt.Errorf("storage: %s: generation not supported", method) - } - } - if conds == nil { - return nil - } - if err := conds.validate(method); err != nil { - return err - } - switch { - case conds.GenerationMatch != 0: - if !setConditionField(cval, "IfGenerationMatch", conds.GenerationMatch) { - return fmt.Errorf("storage: %s: ifGenerationMatch not supported", method) - } - case conds.GenerationNotMatch != 0: - if !setConditionField(cval, "IfGenerationNotMatch", conds.GenerationNotMatch) { - return fmt.Errorf("storage: %s: ifGenerationNotMatch not supported", method) - } - case conds.DoesNotExist: - if !setConditionField(cval, "IfGenerationMatch", int64(0)) { - return fmt.Errorf("storage: %s: DoesNotExist not supported", method) - } - } - switch { - case conds.MetagenerationMatch != 0: - if !setConditionField(cval, "IfMetagenerationMatch", conds.MetagenerationMatch) { - return fmt.Errorf("storage: %s: ifMetagenerationMatch not supported", method) - } - case conds.MetagenerationNotMatch != 0: - if !setConditionField(cval, "IfMetagenerationNotMatch", conds.MetagenerationNotMatch) { - return fmt.Errorf("storage: %s: ifMetagenerationNotMatch not supported", method) - } - } - return nil -} - -func applySourceConds(gen int64, conds *Conditions, call *raw.ObjectsRewriteCall) error { - if gen >= 0 { - call.SourceGeneration(gen) - } - if conds == nil { - return nil - } - if err := conds.validate("CopyTo source"); err != nil { - return err - } - switch { - case conds.GenerationMatch != 0: - call.IfSourceGenerationMatch(conds.GenerationMatch) - case conds.GenerationNotMatch != 0: - call.IfSourceGenerationNotMatch(conds.GenerationNotMatch) - case conds.DoesNotExist: - call.IfSourceGenerationMatch(0) - } - switch { - case conds.MetagenerationMatch != 0: - call.IfSourceMetagenerationMatch(conds.MetagenerationMatch) - case conds.MetagenerationNotMatch != 0: - call.IfSourceMetagenerationNotMatch(conds.MetagenerationNotMatch) - } - return nil -} - -// setConditionField sets a field on a *raw.WhateverCall. -// We can't use anonymous interfaces because the return type is -// different, since the field setters are builders. -func setConditionField(call reflect.Value, name string, value interface{}) bool { - m := call.MethodByName(name) - if !m.IsValid() { - return false - } - m.Call([]reflect.Value{reflect.ValueOf(value)}) - return true -} - -// conditionsQuery returns the generation and conditions as a URL query -// string suitable for URL.RawQuery. It assumes that the conditions -// have been validated. -func conditionsQuery(gen int64, conds *Conditions) string { - // URL escapes are elided because integer strings are URL-safe. - var buf []byte - - appendParam := func(s string, n int64) { - if len(buf) > 0 { - buf = append(buf, '&') - } - buf = append(buf, s...) - buf = strconv.AppendInt(buf, n, 10) - } - - if gen >= 0 { - appendParam("generation=", gen) - } - if conds == nil { - return string(buf) - } - switch { - case conds.GenerationMatch != 0: - appendParam("ifGenerationMatch=", conds.GenerationMatch) - case conds.GenerationNotMatch != 0: - appendParam("ifGenerationNotMatch=", conds.GenerationNotMatch) - case conds.DoesNotExist: - appendParam("ifGenerationMatch=", 0) - } - switch { - case conds.MetagenerationMatch != 0: - appendParam("ifMetagenerationMatch=", conds.MetagenerationMatch) - case conds.MetagenerationNotMatch != 0: - appendParam("ifMetagenerationNotMatch=", conds.MetagenerationNotMatch) - } - return string(buf) -} - -// composeSourceObj wraps a *raw.ComposeRequestSourceObjects, but adds the methods -// that modifyCall searches for by name. -type composeSourceObj struct { - src *raw.ComposeRequestSourceObjects -} - -func (c composeSourceObj) Generation(gen int64) { - c.src.Generation = gen -} - -func (c composeSourceObj) IfGenerationMatch(gen int64) { - // It's safe to overwrite ObjectPreconditions, since its only field is - // IfGenerationMatch. - c.src.ObjectPreconditions = &raw.ComposeRequestSourceObjectsObjectPreconditions{ - IfGenerationMatch: gen, - } -} - -func setEncryptionHeaders(headers http.Header, key []byte, copySource bool) error { - if key == nil { - return nil - } - // TODO(jbd): Ask the API team to return a more user-friendly error - // and avoid doing this check at the client level. - if len(key) != 32 { - return errors.New("storage: not a 32-byte AES-256 key") - } - var cs string - if copySource { - cs = "copy-source-" - } - headers.Set("x-goog-"+cs+"encryption-algorithm", "AES256") - headers.Set("x-goog-"+cs+"encryption-key", base64.StdEncoding.EncodeToString(key)) - keyHash := sha256.Sum256(key) - headers.Set("x-goog-"+cs+"encryption-key-sha256", base64.StdEncoding.EncodeToString(keyHash[:])) - return nil -} - -// ServiceAccount fetches the email address of the given project's Google Cloud Storage service account. -func (c *Client) ServiceAccount(ctx context.Context, projectID string) (string, error) { - r := c.raw.Projects.ServiceAccount.Get(projectID) - res, err := r.Context(ctx).Do() - if err != nil { - return "", err - } - return res.EmailAddress, nil -} diff --git a/ibm/vendor/cloud.google.com/go/storage/storage.replay b/ibm/vendor/cloud.google.com/go/storage/storage.replay deleted file mode 100644 index 07ed1bfaf3..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/storage.replay +++ /dev/null @@ -1,30067 +0,0 @@ -{ - "Initial": "IjIwMTktMDUtMDJUMjI6MjM6NTMuNDAzNDMyMDEzWiI=", - "Version": "0.2", - "Converter": { - "ClearHeaders": [ - "^X-Goog-.*Encryption-Key$" - ], - "RemoveRequestHeaders": [ - "^Authorization$", - "^Proxy-Authorization$", - "^Connection$", - "^Content-Type$", - "^Date$", - "^Host$", - "^Transfer-Encoding$", - "^Via$", - "^X-Forwarded-.*$", - "^X-Cloud-Trace-Context$", - "^X-Goog-Api-Client$", - "^X-Google-.*$", - "^X-Gfe-.*$" - ], - "RemoveResponseHeaders": [ - "^X-Google-.*$", - "^X-Gfe-.*$" - ], - "ClearParams": null, - "RemoveParams": null - }, - "Entries": [ - { - "ID": "f5f231bed6e14b7f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "485" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:54 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrZvgYBWgsCwPaGI9bo1ccC0WCBc8kJgydTwioDtXR9xps4HiDoKXI-vjYUl876SMqF0JhmhaEBgvxrIL9Y989YCFrH65xGys_r1JbPdi9M9N0kS3M" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1NC42MTBaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "9a9914424ef59619", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAyIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "485" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:55 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqFvRYrCleVqpn0QshSvzW5I1-8o7N6vGYh8o5G1f-AHnsX2N_x-NKJrvlxnXqm9auw5gMoWFaJTSTtKL5y85WlQ_eAjmmlrkD4tbHYBZJ386xgaZw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU1LjEwOVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1NS4xMDlaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "17f2abbdd781a33b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0002?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:55 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:23:55 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoYoTmTG5mxpFGPvmECUTlGMlQwhfmqGsZtBtZ9xV89Pw3q-p5BBeX_3imdofr_7EBT7nBm4v5alpg45Zi8a8ET28qBH2xfNe4n15HR-1fhGou2wQU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU1LjEwOVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1NS4xMDlaIiwibWV0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LCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "6752f5a9a036af11", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0002?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:23:56 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur4bFsk4ylv96GsTkuDKG--hVaCR_UEhZ_fAzMGt5Eu5ZKncHOLjU_f2PcNP9saFGW-UkH9jXwt_nuR0G2zXOBjMJmLdd7Ml61bGMMrJeVa0OtcGpM" - ] - }, - "Body": "" - } - }, - { - "ID": "9c25646df7aacad9", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "543" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJsYWJlbHMiOnsiZW1wdHkiOiIiLCJsMSI6InYxIn0sImxpZmVjeWNsZSI6eyJydWxlIjpbeyJhY3Rpb24iOnsic3RvcmFnZUNsYXNzIjoiTkVBUkxJTkUiLCJ0eXBlIjoiU2V0U3RvcmFnZUNsYXNzIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjEwLCJjcmVhdGVkQmVmb3JlIjoiMjAxNy0wMS0wMSIsImlzTGl2ZSI6ZmFsc2UsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTVVMVElfUkVHSU9OQUwiLCJTVEFOREFSRCJdLCJudW1OZXdlclZlcnNpb25zIjozfX0seyJhY3Rpb24iOnsidHlwZSI6IkRlbGV0ZSJ9LCJjb25kaXRpb24iOnsiYWdlIjozMCwiY3JlYXRlZEJlZm9yZSI6IjIwMTctMDEtMDEiLCJpc0xpdmUiOnRydWUsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTkVBUkxJTkUiXSwibnVtTmV3ZXJWZXJzaW9ucyI6MTB9fV19LCJsb2NhdGlvbiI6IlVTIiwibmFtZSI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInN0b3JhZ2VDbGFzcyI6Ik5FQVJMSU5FIiwidmVyc2lvbmluZyI6eyJlbmFibGVkIjp0cnVlfX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "926" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:56 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq6CjN9PjjzT3LmHxW_tU_ciQ1rahetoQGbX_gX8EC5il7tPJi2yxi5VZxnDNrp1h14b7Ix8tnvtkHufAyO1-lMRutdHK5GSzonff78Nm6KPAKN5fU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU2LjQwOVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1Ni40MDlaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOnRydWV9LCJsaWZlY3ljbGUiOnsicnVsZSI6W3siYWN0aW9uIjp7InR5cGUiOiJTZXRTdG9yYWdlQ2xhc3MiLCJzdG9yYWdlQ2xhc3MiOiJORUFSTElORSJ9LCJjb25kaXRpb24iOnsiYWdlIjoxMCwiY3JlYXRlZEJlZm9yZSI6IjIwMTctMDEtMDEiLCJpc0xpdmUiOmZhbHNlLCJtYXRjaGVzU3RvcmFnZUNsYXNzIjpbIk1VTFRJX1JFR0lPTkFMIiwiU1RBTkRBUkQiXSwibnVtTmV3ZXJWZXJzaW9ucyI6M319LHsiYWN0aW9uIjp7InR5cGUiOiJEZWxldGUifSwiY29uZGl0aW9uIjp7ImFnZSI6MzAsImNyZWF0ZWRCZWZvcmUiOiIyMDE3LTAxLTAxIiwiaXNMaXZlIjp0cnVlLCJtYXRjaGVzU3RvcmFnZUNsYXNzIjpbIk5FQVJMSU5FIl0sIm51bU5ld2VyVmVyc2lvbnMiOjEwfX1dfSwibGFiZWxzIjp7ImwxIjoidjEiLCJlbXB0eSI6IiJ9LCJzdG9yYWdlQ2xhc3MiOiJORUFSTElORSIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "f795b9adcb1b546e", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0002?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2872" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:56 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:23:56 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up2-mWQyRDbFSpF6U96vQpaBYr74NgiUWh3-KZnLWaFYnhQti1tgKWNtL15YgK8blaRSnzGeACPA6jNuM34yhr7bxztrdN2tobEQAzD5RVgzpqx14w" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAyIiwidGltZUNyZWF0ZWQ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lIjozMCwiY3JlYXRlZEJlZm9yZSI6IjIwMTctMDEtMDEiLCJpc0xpdmUiOnRydWUsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTkVBUkxJTkUiXSwibnVtTmV3ZXJWZXJzaW9ucyI6MTB9fV19LCJsYWJlbHMiOnsibDEiOiJ2MSIsImVtcHR5IjoiIn0sInN0b3JhZ2VDbGFzcyI6Ik5FQVJMSU5FIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "2ee3f84c4e4045fb", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0002?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:23:57 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UplJEr-Hxa3hDFT5ozLEHYhHfaxlYFpc9Vwm8AL831-w_7BBgxHjjEsU8Br_uLnLes0h9hz37iuE9V8uVZ2liHY7ZD4piNH31oyapjCtwyXrukIP94" - ] - }, - "Body": "" - } - }, - { - "ID": "16f19dbf8e206756", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:57 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:23:57 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqvp5XjvB8nhNuz-bTeN9OklTfiBGldYKkcY13JF6oUfpV0z_jwoEQD3B3Ss3wWpaSmZfePjo7fkkr-hP3jbrUazNHaqQliiHqOBSNmSoPmwJpzfOI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04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lYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBRT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "949f5ce411d6f672", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:58 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpVeVcmmuUyOt3Hbja89_Ewi6GRsJtRduqK93OT4Ys1aK5GqDWeGxyDbczUyRLeUYvZgtJzYLwVOOUszqAF4ipSXgZ1L_byd9cJ7ttVfQ_ceQBXxY4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1NC42MTBaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc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ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "b75303fbdafb66d0", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "64" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJsYWJlbHMiOnsiZW1wdHkiOiIiLCJsMSI6InYxIn0sInZlcnNpb25pbmciOnsiZW5hYmxlZCI6dHJ1ZX19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2493" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:58 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqDnNlC3m95GplHjE79aqzhtwgfJCWQjHaCFG4i7qmTFliz2gdE4OiOnKAPIoNqxEngE35065YXNYA65aMSSeEluDKmQ__rJXcS_DpRdoYP4rZIyPo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1OC40MzZaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2V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YmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInZlcnNpb25pbmciOnsiZW5hYmxlZCI6dHJ1ZX0sImxhYmVscyI6eyJlbXB0eSI6IiIsImwxIjoidjEifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "831805b62d969707", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "93" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJsYWJlbHMiOnsiYWJzZW50IjpudWxsLCJlbXB0eSI6bnVsbCwibDEiOiJ2MiIsIm5ldyI6Im5ldyJ9LCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOmZhbHNlfX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2495" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:59 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq8yNb3V9Kq8zPa_pdVrJIYv83v4fu6xAHwktfTz_Cy4K1rpi8xrDzYmw5wICaazfMcAiYPhM8r4Y6WkeOyeCRInvkJ6ndduhNN_dgu1U59uI5F3Qc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1OS4wMzJaIiwibWV0YWdlbmVyYXRpb24iOiIzIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbms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nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBTT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInZlcnNpb25pbmciOnsiZW5hYmxlZCI6ZmFsc2V9LCJsYWJlbHMiOnsibDEiOiJ2MiIsIm5ldyI6Im5ldyJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQU09In0=" - } - }, - { - "ID": "8a816d061fe9e7e0", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "77" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJsaWZlY3ljbGUiOnsicnVsZSI6W3siYWN0aW9uIjp7InR5cGUiOiJEZWxldGUifSwiY29uZGl0aW9uIjp7ImFnZSI6MzB9fV19fQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2570" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:23:59 GMT" - ], - "Etag": [ - "CAQ=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrbjywEmDPkqxln7-Nx_8ngRxoWvncfCx1fGVpPZGEjjmg8OJgv0uaczxapjlNeEcvMnqWI_RVzG6_588QaO8nCnPVnE2kkIek3D_t6UNL9CCPYLRc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyMzo1OS41MzBaIiwibWV0YWdlbmVyYXRpb24iOiI0IiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNv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amVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBUT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInZlcnNpb25pbmciOnsiZW5hYmxlZCI6ZmFsc2V9LCJsaWZlY3ljbGUiOnsicnVsZSI6W3siYWN0aW9uIjp7InR5cGUiOiJEZWxldGUifSwiY29uZGl0aW9uIjp7ImFnZSI6MzB9fV19LCJsYWJlbHMiOnsibDEiOiJ2MiIsIm5ldyI6Im5ldyJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQVE9In0=" - } - }, - { - "ID": "6a60397ebae323e7", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiYnVja2V0UG9saWN5T25seSJ9Cg==", - "dGVzdA==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3305" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:00 GMT" - ], - "Etag": [ - "CPmu4bnx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UokOvJnDKKHAQOa8mJLrxFpWWvQ2U_BC_3uI0Z4x870Q068evHio_t_YudbSq614h77-ofhBsyHpoknWnm_YrnXxkHzopreKoMBykFIcbsSB8TDKEE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9idWNrZXRQb2xpY3lPbmx5LzE1NTY4MzU4NDAwNTUxNjEiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9idWNrZXRQb2xpY3lPbmx5IiwibmFtZSI6ImJ1Y2tldFBvbGljeU9ubHkiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0MDA1NTE2MSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0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yay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiYnVja2V0UG9saWN5T25seSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQwMDU1MTYxIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ1BtdTRibngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJocUJ5d0E9PSIsImV0YWciOiJDUG11NGJueC9lRUNFQUU9In0=" - } - }, - { - "ID": "32d392d1da32f27b", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/bucketPolicyOnly/acl/user-test%40example.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "111" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJlbnRpdHkiOiJ1c2VyLXRlc3RAZXhhbXBsZS5jb20iLCJyb2xlIjoiUkVBREVSIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "519" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:00 GMT" - ], - "Etag": [ - "CPmu4bnx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoau0xgFp6ib5wM0bBWjRlklvDRPOu0VZ-LFCeENUWXutmkXSfgUbtr2Nuefb7Pm_yLvCNqtB9B6k_N1V7AlvkN4_JEz67ZSXQ_sAD5L1teQIpGiqA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvYnVja2V0UG9saWN5T25seS8xNTU2ODM1ODQwMDU1MTYxL3VzZXItdGVzdEBleGFtcGxlLmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2J1Y2tldFBvbGljeU9ubHkvYWNsL3VzZXItdGVzdEBleGFtcGxlLmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6ImJ1Y2tldFBvbGljeU9ubHkiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0MDA1NTE2MSIsImVudGl0eSI6InVzZXItdGVzdEBleGFtcGxlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJldGFnIjoiQ1BtdTRibngvZUVDRUFJPSJ9" - } - }, - { - "ID": "6e3d0eda38a3ab6e", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "59" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJpYW1Db25maWd1cmF0aW9uIjp7ImJ1Y2tldFBvbGljeU9ubHkiOnsiZW5hYmxlZCI6dHJ1ZX19fQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "663" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:01 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpSPFJHLzusxOr_OvhStJlWEpOs2EuthMO0Ys6pS9bsQeP0fthp_VUZfa8_sN8TX6PJYpxIdFlxB2QUaIujot1cUrssoU74XFrAwoqhlmiE5y9Aw-w" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowMS4yNDJaIiwibWV0YWdlbmVyYXRpb24iOiI1IiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOnRydWUsImxvY2tlZFRpbWUiOiIyMDE5LTA3LTMxVDIyOjI0OjAxLjIzMFoifX0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOmZhbHNlfSwibGlmZWN5Y2xlIjp7InJ1bGUiOlt7ImFjdGlvbiI6eyJ0eXBlIjoiRGVsZXRlIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjMwfX1dfSwibGFiZWxzIjp7ImwxIjoidjIiLCJuZXciOiJuZXcifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FVPSJ9" - } - }, - { - "ID": "8f8dbb687dc49edb", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13230" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:01 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:01 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpGpW2zLlN7nAgV5IVkKU3kx4QWHCkzAgMa-QPC1PyCol8CP9W605bMUmFMeerbR4enzmeNMvtb4a2HzBPUZ296YfGdtkt_6Guq82E226xzC5TPq4w" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImludmFsaWQiLCJtZXNzYWdlIjoiQ2Fubm90IGdldCBsZWdhY3kgQUNMcyBmb3IgYSBidWNrZXQgdGhhdCBoYXMgZW5hYmxlZCBCdWNrZXQgUG9saWN5IE9ubHkuIFJlYWQgbW9yZSBhdCBodHRwczovL2Nsb3VkLmdvb2dsZS5jb20vc3RvcmFnZS9kb2NzL2J1Y2tldC1wb2xpY3ktb25seS4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6SU5WQUxJRF9SRVFVRVNUX0ZPUl9CVUNLRVRfUE9MSUNZX09OTFlfUkVTT1VSQ0U6IENhbm5vdCBnZXQgbGVnYW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ae4", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/bucketPolicyOnly/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13358" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:02 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:02 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqJwxja3nYzWYbg_I5gWvOiow2ORuo8tNA-_Vzw7DX_YVhhb6_p1giUk3WjUHWt-lyDA13adhPGi4BDfIXzQyf-ZL3lsHoa2sNm29BIqRznw4mkAdE" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHN0b3JhZ2Uub2JqZWN0cy5nZXQgYWNjZXNzIHRvIGdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9idWNrZXRQb2xpY3lPbmx5LiIsImR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5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDAzLCJtZXNzYWdlIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20gZG9lcyBub3QgaGF2ZSBzdG9yYWdlLm9iamVjdHMuZ2V0IGFjY2VzcyB0byBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvYnVja2V0UG9saWN5T25seS4ifX0=" - } - }, - { - "ID": "0ca0bddf513110f4", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "45" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJpYW1Db25maWd1cmF0aW9uIjp7ImJ1Y2tldFBvbGljeU9ubHkiOnt9fX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "624" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:02 GMT" - ], - "Etag": [ - "CAY=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpdDWPDU9-gPzHEieE0Rqx_40yf8fJLhwAP6fVsdS4F7I7sWj0h-Ti7VoDWciZgI_lgNUB7qyh08wjTAxrTLTsSiIYt2GR6ksxhDRupMoPWni5kXmE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowMi4zNjFaIiwibWV0YWdlbmVyYXRpb24iOiI2IiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOmZhbHNlfSwibGlmZWN5Y2xlIjp7InJ1bGUiOlt7ImFjdGlvbiI6eyJ0eXBlIjoiRGVsZXRlIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjMwfX1dfSwibGFiZWxzIjp7ImwxIjoidjIiLCJuZXciOiJuZXcifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FZPSJ9" - } - }, - { - "ID": "8a8bee740102593d", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/bucketPolicyOnly/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2964" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:02 GMT" - ], - "Etag": [ - "CPmu4bnx/eECEAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:02 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq59Mf8Ea4fgpDnUzupeIP3bGt3VpyI6HjL4KJtDKAD_h-Ua-AJSX3u3x4TCsx2MZcIVhMs9pW9SWsrIcsvsr3kGt2Je9W87LElbN5dlw02EItBcR4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvYnVja2V0UG9saWN5T25seS8xNTU2ODM1ODQwMDU1MTYxL3Byb2plY3Qtb3duZXJzLTQ5NjE2OTYwMTcx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0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9idWNrZXRQb2xpY3lPbmx5L2FjbC91c2VyLXRlc3RAZXhhbXBsZS5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJidWNrZXRQb2xpY3lPbmx5IiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDAwNTUxNjEiLCJlbnRpdHkiOiJ1c2VyLXRlc3RAZXhhbXBsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZW1haWwiOiJ0ZXN0QGV4YW1wbGUuY29tIiwiZXRhZyI6IkNQbXU0Ym54L2VFQ0VBST0ifV19" - } - }, - { - "ID": "91ba2c22c5f5de9a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/bucketPolicyOnly?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:03 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrwotKay181GHzZsWfp6BzJA4FDOIfK2s1WlzB9p8QsIEX42AtvMhkgLWqSIyEhb-MSv9snqx0WRwUs5sDN3_5NVoFTzQeLkDBR9mbsixI-udc8SLI" - ] - }, - "Body": "" - } - }, - { - "ID": "43fec6c3a8c8cb63", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiY29uZGRlbCJ9Cg==", - "Zm9v" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3161" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:03 GMT" - ], - "Etag": [ - "CNHLq7vx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrrYnzZRz4GFV3BsHoF-vv9v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0YWciOiJDTkhMcTd2eC9lRUNFQUU9In0=" - } - }, - { - "ID": "ba03d9efb1402903", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/conddel?alt=json\u0026generation=1556835843368400\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12249" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:03 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:03 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur-mcvaL-eBgBoviwBg_r8LyEEK3JNyFaj0cFy2neOMo1pVkWpkGQ-3gz8vQNtAGoX-Q7_CMYLNv_I0pOoy5iRr-MdYKny5ICdC1s3ji5DwL7sqmn0" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vIHN1Y2ggb2JqZWN0OiBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvY29uZGRlbCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW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3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb25kZGVsIn19" - } - }, - { - "ID": "e26af2cd4673cc7c", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/conddel?alt=json\u0026ifMetagenerationMatch=2\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 412, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12051" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:03 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:03 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uopfd5TJBzhGauzgyZW0h-TNFtDHz34k0kjbeuTeQPnMGBaiSFz9FdWA2gxp7qKp-V586voh7kqHgnVSW_QI4bWEuC35pj8NbCmmpNL_9pstpCgckw" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImNvbmRpdGlvbk5vdE1ldCIsIm1lc3NhZ2UiOiJQcmVjb25kaXRpb24gRmFpbGVkIiwibG9jYXRpb25UeXBlIjoiaGVhZGVyIiwibG9jYXRpb24iOiJJZi1NYXRjaCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuU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JsZSQxLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MTIsIm1lc3NhZ2UiOiJQcmVjb25kaXRpb24gRmFpbGVkIn19" - } - }, - { - "ID": "857f8a30eb55b023", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/conddel?alt=json\u0026ifMetagenerationNotMatch=1\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 304, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uprv3QMjU4zz49ScYI4YaY9FitNwO7wGMQ1KZ8Y99w4D7keznFfA8M80bMdKvSH55jsWsDoLKcQ1VvIqIEUw88NqSfUM7E5SR_y5zfDaCf_uHSlgPM" - ] - }, - "Body": "" - } - }, - { - "ID": "4c69a7dc19302935", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/conddel?alt=json\u0026generation=1556835843368401\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpoiZa1zqMV-8ZkeUrvT6Xi0uJul6yGWWth5s3YbFtA2p0-6vc_54sNtEbxbnsASZyMDXLelHaCSixgcVT6JDVELrXHDim9gHcjjlSTF6BsHWu181A" - ] - }, - "Body": "" - } - }, - { - "ID": "834f05b1eb2dbc32", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoib2JqMSJ9Cg==", - "TuDshcL7vdCAXh8L42NvEQ==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3150" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Etag": [ - "CLnS+bvx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UozIFQVqWdhJxDLMyV7dfkeraSOw2Mw_AsI_aCWnAUudrz4HjQgZ4kbnvKXJfNF3SMQhxzxZHhk1Otmw7PgPxL7HyDkPDyK1DeHDc8GyfY1B3Q3YfA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoxLzE1NTY4MzU4NDQ2NDcyMjUiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9vYmoxIiwibmFtZSI6Im9iajEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NDY0NzIyNSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowNC42NDZaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MDQuNjQ2WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjA0LjY0NloiLCJzaXplIjoiMTYiLCJtZDVIYXNoIjoiU25hL1VXdjdtY1pJMjNvRTV0VWFiUT09IiwibWVkaWFMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vZG93bmxvYWQvc3R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SI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiQ1Q2ZFRBPT0iLCJldGFnIjoiQ0xuUytidngvZUVDRUFFPSJ9" - } - }, - { - "ID": "34a1730e8bbe1d09", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoib2JqMiJ9Cg==", - "55GZ37DvGFQS3PnkEKv3Jg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3150" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Etag": [ - "CJ2Xkrzx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Gu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ifSwiY3JjMzJjIjoialY1QVZRPT0iLCJldGFnIjoiQ0oyWGtyengvZUVDRUFFPSJ9" - } - }, - { - "ID": "b7c2c8ec1e65fb6d", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoib2JqL3dpdGgvc2xhc2hlcyJ9Cg==", - "kT7fkMXrRdrhn2P2+EeT5g==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3366" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Etag": [ - "COqurrzx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrEgFAbU2gAqyKMITI9vr9kAgIBfNY3ZGs1l2_X4e-fVtN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jb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPcXVycnp4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoib2VvK0ZBPT0iLCJldGFnIjoiQ09xdXJyengvZUVDRUFFPSJ9" - } - }, - { - "ID": "0dbae3d4b454f434", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj%2Fwith%2Fslashes?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3366" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Etag": [ - "COqurrzx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqk7CzWGAqaT12X_fTymveyPtsPJIPHD814QaAOIQLA_AJo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Njb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPcXVycnp4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoib2VvK0ZBPT0iLCJldGFnIjoiQ09xdXJyengvZUVDRUFFPSJ9" - } - }, - { - "ID": "3793882b91d38a07", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3150" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:06 GMT" - ], - "Etag": [ - "CLnS+bvx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpzUH_BRjU20OGbDAW2dy0lx9Gk_1Ko7zks6KG6OEpq0pBPfCIBjkC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}, - { - "ID": "39924c2826bcd33f", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3150" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:06 GMT" - ], - "Etag": [ - "CJ2Xkrzx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrgOr-dpWoY-JJi6vRigJX3Mpi_WQ4zWvWKK382DCP-mzWSnrpbaOzijhTCdNz6pmXskVVs30APwlqZgvb-S6xAwXqKJG5n6832Py4UlTdDR_INTew" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoyLzE1NTY4MzU4NDUwNDkyNDUiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwN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czovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vb2JqMi9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6Im9iajIiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NTA0OTI0NSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNKMlhrcnp4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoialY1QVZRPT0iLCJldGFnIjoiQ0oyWGtyengvZUVDRUFFPSJ9" - } - }, - { - "ID": "89ea9ab5e21a635e", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "9705" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:06 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:06 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqj9dj5PbUhIU3baBv98vMViDP-BnVPs0APrFYL4jSbKc7fK6eAGoyDfsccGzxK-t0lGvozizW4ltrga8DXo_oxlZ9-k5a85v9i0PWTFIisPC7xuL8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai93aXRoL3NsYXNoZXMvMTU1NjgzNTg0NTUxMTAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iaiUyRndpdGglMkZzbGFzaGVzIiwibmFtZSI6Im9iai93aXRoL3NsYXNoZXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NTUxMTAxOCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhd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ZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJvYmoyIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDUwNDkyNDUiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6ImpWNUFWUT09IiwiZXRhZyI6IkNKMlhrcnp4L2VFQ0VBRT0ifV19" - } - }, - { - "ID": "b27c106562362f6b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=1\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3446" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:06 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:06 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoIo3JJa2rfg9_o3bXN_5QU6XU_iIrWYfuEuvKTQL0O5tjIHkODIDd4biyHxjbGNFnrQNbkiEUXWEBlo-3fTVgfFTOWuaPpgae-SafTBP8h5X5ddJ4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwibmV4dFBhZ2VUb2tlbiI6IkNoQnZZbW92ZDJsMGFDOXpiR0Z6YUdWeiIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmovd2l0aC9zbGFzaGVzLzE1NTY4MzU4NDU1MTEwMTgiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9vYmolMkZ3aXRoJTJGc2xhc2hlcyIsIm5hbWUiOiJvYmovd2l0aC9zbGFzaGVzIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDU1MTEwMTgiLCJtZXRhZ2VuZXJhdGlvbiI6IjEiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJ0aW1lQ3JlYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MDUuNTEwWiIsInVwZGF0ZWQiO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zNDAzNDMyMDEzLTAwMDEvby9vYmolMkZ3aXRoJTJGc2xhc2hlcy9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6Im9iai93aXRoL3NsYXNoZXMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NTUxMTAxOCIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPcXVycnp4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoib2VvK0ZBPT0iLCJldGFnIjoiQ09xdXJyengvZUVDRUFFPSJ9XX0=" - } - }, - { - "ID": "ca654b46531c4cb2", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=1\u0026pageToken=ChBvYmovd2l0aC9zbGFzaGVz\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3214" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:07 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqINI0Ii418NlxoYErOrjhTKb3-G3n-8h1Ryc_4YT4Tksc7WXA9m4CcJWInyhJahYC-UUrM47O5EK-3FUt3toZOZxWlbwhE6Sfnra0H-CqjmvxWyRs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwibmV4dFBhZ2VUb2tlbiI6IkNnUnZZbW94IiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iajEvMTU1NjgzNTg0NDY0NzIyNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajEiLCJuYW1lIjoib2JqMSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ0NjQ3MjI1IiwibWV0YWdlbmVyYXRpb24iOiIxIiwiY29udGVudFR5cGUiOiJ0ZXh0L3BsYWluIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjA0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Ijoib2JqMSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ0NjQ3MjI1IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0xuUytidngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJDVDZkVEE9PSIsImV0YWciOiJDTG5TK2J2eC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "0186889a60e651db", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=1\u0026pageToken=CgRvYmox\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3187" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:07 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpFTK3QnFf4m9htpY4s3P9_NHuDiQl8InpJoWPOaQHo0XaYnSoSqkH7CcUbm0-sWamsCZbd4DHoXHLCrea3ff9rLpWlptkL0aMKV_Dleb1Xm-j14fQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iajIvMTU1NjgzNTg0NTA0OTI0NSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajIiLCJuYW1lIjoib2JqMiIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ1MDQ5MjQ1IiwibWV0YWdlbmVyYXRpb24iOiIxIiwiY29udGVudFR5cGUiOiJ0ZXh0L3BsYWluIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjA1LjA0OFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowNS4wNDhaIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJ0aW1lU3RvcmFnZUNsYXNzVXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MDUuMDQ4WiIsInNpemUiOiIxNiIsIm1kNUhhc2giOiJDQzF3bHdyTU9JcTBkdk1rTXlsVWhnPT0iLCJtZWRpYUxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS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PSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJqVjVBVlE9PSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "a253776f79c46fe1", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=1\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3446" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:07 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoadifz-4B7kC7DvXOyrNa5omK5-DXUNJBtT_d5I1jciPUvGlRm1L1vkvVMU1Y5n9zFig2CF_qqBLlcdvoYCaUeaNUu706L0fKJhJkA8vV5JUvFq0E" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwibmV4dFBhZ2VUb2tlbiI6IkNoQnZZbW92ZDJsMGFDO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oZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPcXVycnp4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoib2VvK0ZBPT0iLCJldGFnIjoiQ09xdXJyengvZUVDRUFFPSJ9XX0=" - } - }, - { - "ID": "dc8959751769ee9c", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=1\u0026pageToken=ChBvYmovd2l0aC9zbGFzaGVz\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3214" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:08 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:08 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqLeV9n2aiAq15pl3CqEWOt3_OYHsxbG0lHFIKr7Emh5btUEXLXl4nZWPi27LinKW7i0LYvp-HZK5b9E742MR_PNFe87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DTG5TK2J2eC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "23f7f167269db6b2", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=1\u0026pageToken=CgRvYmox\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3187" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:08 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:08 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo4hY4jSbETgB5jf-AU8_b1sRvfTSrlt_Pt6UXiuTte4GtueVBgDwuMEliwE2-nOSiRE6juXOCbR1LQlRrpek1TLeRRf1cCVbz90YcCIGhWV_zFz0o" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iajIvMTU1NjgzNTg0NTA0OTI0NSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ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sZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9vYmoyL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0Ijoib2JqMiIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ1MDQ5MjQ1IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0oyWGtyengvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJqVjVBVlE9PSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "518c5855f7f2035b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=2\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "6581" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:09 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:09 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqGaiKkmr1oBduBvG8APGBVoM_Ve7zHw4TBuyV3QYcFr9SYzEnATEwE5P6BH-yBsVXSmaRLej1a55x18Bra_ZAC7nYh2UKvWM66JGE3U1muaDBabyw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwibmV4dFBhZ2VUb2tlbiI6IkNnUnZZbW94IiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai93aXRoL3NsYXNoZXMvMTU1NjgzNTg0NTUxMTAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iaiUyRndpdGglMkZzbGFzaGVzIiwibmFtZSI6Im9iai93aXRoL3NsYXNoZXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLT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ic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vb2JqMS9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6Im9iajEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NDY0NzIyNSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNMblMrYnZ4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiQ1Q2ZFRBPT0iLCJldGFnIjoiQ0xuUytidngvZUVDRUFFPSJ9XX0=" - } - }, - { - "ID": "5887398d8cd8c906", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=2\u0026pageToken=CgRvYmox\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3187" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:09 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:09 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqGAvr7ojM3PcmnrTMTX-TXgYKzfo-3gzwYU_l9OaCfpth_ad2lWUJf6w6B8pjEGsAFZJvNueCHYGSJdx6YJ7NAe71oah1xi6lGQvQkWEwAl0fXd7Y" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iajIvMTU1NjgzNTg0NTA0OTI0NSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajIiLCJuYW1lIjoib2JqMiIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ1MDQ5MjQ1IiwibWV0YWdlbmVyYXRpb24iOiIxIiwiY29udGVudFR5cGUiOiJ0ZXh0L3BsYWluIiwidGltZUNyZWF0ZWQiOi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DYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0Ijoib2JqMiIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ1MDQ5MjQ1IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0oyWGtyengvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJqVjVBVlE9PSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "81d53e304c7ed90d", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=2\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "6581" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:09 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:09 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur9XEMeCefUS1K7QkIxrxZboQ1zQ5SkrEUZMzrQdNBNAuDQnpDczXzJvF-rZmxFVYSdMySScTTu-FICOdI91b-fQVRomrqAxJwgn60FoObIVVpgkog" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwibmV4dFBhZ2VUb2tlbiI6IkNnUnZZbW94IiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai93aXRoL3NsYXNoZXMvMTU1NjgzNTg0NTUxMTAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iaiUyRndpdGglMkZzbGFzaGVzIiwibmFtZSI6Im9iai93aXRoL3NsYXNoZXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NTUxMTAxOCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowNS41MTBaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MDUuNTEwWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjA1LjUxMFo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lcmF0aW9uIjoiMTU1NjgzNTg0NDY0NzIyNSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNMblMrYnZ4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiQ1Q2ZFRBPT0iLCJldGFnIjoiQ0xuUytidngvZUVDRUFFPSJ9XX0=" - } - }, - { - "ID": "0be1bdae5ba86bfd", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=2\u0026pageToken=CgRvYmox\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3187" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:10 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:10 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UocXesX_BUCirPixQFUhYfAIoR0Os309HMGHarzTGrqH1PkmHuGaaiNSH_pJq8nnWUXEnjk1cvuPGJWCF21t7EJQtCIGBWQoPBNV6OpvALZGdpPXuI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iajIvMTU1NjgzNTg0NTA0OTI0NSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajIiLCJuYW1lIjoib2JqMiIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODQ1MDQ5MjQ1IiwibWV0YWdlbmVyYXRpb24iOiIxIiwiY29udGVudFR5cGUiOiJ0ZXh0L3BsYWluIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjA1LjA0OFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowNS4wNDhaIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJ0aW1lU3RvcmFnZUNsYXNzVXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MDUuMDQ4WiIsInNpemUiOiIxNiIsIm1kNUhhc2giOiJDQzF3bHdyTU9JcTBkdk1rTXlsVWhnPT0iLCJtZWRpYUxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9kb3dubG9hZC9zdG9y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siZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJqVjVBVlE9PSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "592a3fdf8b5a83e5", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=3\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "9705" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:10 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:10 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoS2FM55Dkg1PRaNQBzsu5KBns-svmRrQ5byrUGRHgnsBQQDdE3ZznljVTrNq3wDAClddQ4zbCMQSLdqxPPNlom-n1tMg1hO8s6kS8_CTWy2SOM6As" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50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yI6IkNKMlhrcnp4L2VFQ0VBRT0ifV19" - } - }, - { - "ID": "b01846866b585241", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=3\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "9705" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:10 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:10 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo22tWMx8uW6afXbfFrFT8UZzPbsqPItYMdRAPHNEuksgeqWI2US_xblUG6C8WgcHvfEeR_19eVmBTmW6QE7rmosaIm_raZxW9FuCHHiSi8TJnZ1CI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai93aXRoL3NsYXNoZXMvMTU1NjgzNTg0NTUxMTAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3c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2Vzc0NvbnRyb2wiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoyLzE1NTY4MzU4NDUwNDkyNDUvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajIvYWNsL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJvYmoyIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDUwNDkyNDUiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6ImpWNUFWUT09IiwiZXRhZyI6IkNKMlhrcnp4L2VFQ0VBRT0ifV19" - } - }, - { - "ID": "2eeefee032c6e805", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=13\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "9705" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:11 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:11 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq55nB00t16AHTo1gSxBFUNplz5SJcGYBOeCPsK-MD5OLO_kHKT3YNZq69AAHpozaWVrTU_jDQqiqMFSoPhhmlF2dR1mcq6Ihk_y8uuFY6FM4O_hmI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai93aXRoL3NsYXNoZXMvMTU1NjgzNTg0NTUxMTAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iaiUyRndpdGglMkZzbGFzaGV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m90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajIvYWNsL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJvYmoyIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDUwNDkyNDUiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6ImpWNUFWUT09IiwiZXRhZyI6IkNKMlhrcnp4L2VFQ0VBRT0ifV19" - } - }, - { - "ID": "11bfe17bc978cdfd", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026maxResults=13\u0026pageToken=\u0026prefix=obj\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "9705" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:11 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:11 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UotgN85lDspseXEgwnXhmfSmio9oOxSzhqtyabApVH0KQz_aVg3DbQ7m0Z0L9SzPzzmNEUfU6xhAT5xQAXf-wvY1NHDFxdf9IJ6YoVNhN0aHN-75hY" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai93aXRoL3NsYXNoZXMvMTU1NjgzNTg0NTUxMTAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iaiUyRndpdGglMkZzbGFzaGVzIiwibmFtZSI6Im9iai93aXRoL3NsYXNoZXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lc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cmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL29iajIvYWNsL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJvYmoyIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDUwNDkyNDUiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSjJYa3J6eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6ImpWNUFWUT09IiwiZXRhZyI6IkNKMlhrcnp4L2VFQ0VBRT0ifV19" - } - }, - { - "ID": "c05bfa6f1a43381b", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:11 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:11 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrVVjXVa2SMY6cjYeIgdcZOivQwE2Crz6UPZs2VXVBFMwReZs7kKbETuTMwuEMHKKm_LIrk-o6jS07MimubSWVxGMzT1BtCacU1X2Go_RckmyJPZso" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEQ==" - } - }, - { - "ID": "f2932604385db16e", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrADckAOw2vMHdy0qy02f20x-8s_Ue81-NYwSpKeqp6Zx6eCPReLM6qXUyxFz0xHNGob5WJA8J4ctl6ZFzL2fEVwBMNY8xxzpkKOAwSu9n9e0OE63E" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEQ==" - } - }, - { - "ID": "8581afc6216ad2cb", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj2", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"082d70970acc388ab476f32433295486\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:05 GMT" - ], - "X-Goog-Generation": [ - "1556835845049245" - ], - "X-Goog-Hash": [ - "crc32c=jV5AVQ==", - "md5=CC1wlwrMOIq0dvMkMylUhg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrkoYpGTn57WC5t-sItsEdWimp47AtSuqw8autFOD3TirChrdQThg_Fh-kykfgvnTaOyiw1InKeYs0Z2MISmjUpu4uHUUGDKTX6W0zQEuUks7i2BqQ" - ] - }, - "Body": "55GZ37DvGFQS3PnkEKv3Jg==" - } - }, - { - "ID": "ae129e597d5dd3e8", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj2", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"082d70970acc388ab476f32433295486\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:05 GMT" - ], - "X-Goog-Generation": [ - "1556835845049245" - ], - "X-Goog-Hash": [ - "crc32c=jV5AVQ==", - "md5=CC1wlwrMOIq0dvMkMylUhg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoaoET13zBO6-kmfarxy5tCZhmqc2oO38xOd6m6OQ55e-MyyKYM35hNakm5xYdWaoUNsKwVCiklp4HtYE8afVObxcDERuTCgyTw-olewCN6VBwd-H0" - ] - }, - "Body": "55GZ37DvGFQS3PnkEKv3Jg==" - } - }, - { - "ID": "11acf26dc7680b3e", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj/with/slashes", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"b9ecff849eb002b78342771c0d47717e\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:05 GMT" - ], - "X-Goog-Generation": [ - "1556835845511018" - ], - "X-Goog-Hash": [ - "crc32c=oeo+FA==", - "md5=uez/hJ6wAreDQnccDUdxfg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up_XtsS2bu4fnGI-Z85gqz1MECYqweRqin42arAyEfpJpZwmadI1-Op9V7n-q3UaYyRtUWFR7an7zKxWhJ_CB6PXz-C55C1nPoI7EWVEV2oXcS-q8c" - ] - }, - "Body": "kT7fkMXrRdrhn2P2+EeT5g==" - } - }, - { - "ID": "ff72204b0c538268", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj/with/slashes", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"b9ecff849eb002b78342771c0d47717e\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:05 GMT" - ], - "X-Goog-Generation": [ - "1556835845511018" - ], - "X-Goog-Hash": [ - "crc32c=oeo+FA==", - "md5=uez/hJ6wAreDQnccDUdxfg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqrjLdnTX47-_XGNBlBZ0rEgsIkYJMzixBaVmhjn8IsK66UpQAUO-njMM-WznI-DBNIbXVTcPQKZBNe2ZHZEskfuRjsFwMjtooyUH_PqTfZnARVv8M" - ] - }, - "Body": "kT7fkMXrRdrhn2P2+EeT5g==" - } - }, - { - "ID": "7972502f866e015e", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Range": [ - "bytes=0-15" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoNiJIZYFETpngMkDItRU7PtN7Fv4bDU7Kfvndst1JR2eGmW-tOMTfng8Abx6EWwPvvodLkSk-1TM4Gywxzh3c24gPDN4NsQMuh40Mfp0Jvg1syOls" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEQ==" - } - }, - { - "ID": "251a62254c59cbd1", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Range": [ - "bytes=0-7" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 206, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "8" - ], - "Content-Range": [ - "bytes 0-7/16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UobLFpkqodTM1bHuzS0GzRCKZypPQkf3nH1hbOexCjgjAcheZhV_zxJRyLhOYZoW8ABEaVMJLULNrzAm1VZs4JrTdtT46fYIcQe7OBeJp0aHI7Lr5s" - ] - }, - "Body": "TuDshcL7vdA=" - } - }, - { - "ID": "2482617229166e50", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Range": [ - "bytes=8-23" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 206, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "8" - ], - "Content-Range": [ - "bytes 8-15/16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uon8ZtKgOTqFm36bWHd3hf535jPGQBEX9j2yPrr11_ycAJjfI4A-mFWMTsFRR3nwSo68784B9TUPUjQd0cib0QIrfBjfDcz91p6oPJG3VpV9afywIY" - ] - }, - "Body": "gF4fC+NjbxE=" - } - }, - { - "ID": "74ff0c5848c7dba6", - "Request": { - "Method": "HEAD", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:12 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqKc-08ZJEWVbyaV84xKlnrHkl2PBuBUQP6xtx6TzZW0fsjyZ-SHshiy-QMGCuP1UF4x1ettHyDvRbAleHIXy4y7wMwoUWST2NKs_0oRA0oVqOoKtQ" - ] - }, - "Body": "" - } - }, - { - "ID": "90888164f5d2d40d", - "Request": { - "Method": "HEAD", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoTSlg3r_LSoiqQyJVJDzL-0xNj6jlSNp9zLUmlPtu3xbhCLBDNAxY9CRbyEjw7UudDcsFOe43C3QlsVjoBJln1q179ZspYWXY-fHqjrztAfJkZUpU" - ] - }, - "Body": "" - } - }, - { - "ID": "7961f3dc74fa0663", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Range": [ - "bytes=8-" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 206, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "8" - ], - "Content-Range": [ - "bytes 8-15/16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqJjC8HFLb8u_EaJVF0_TUOhNWhbooW0oANE8_LPjoIdLcoU42caZe7LjgbTIjCb0Ss3horP2noxirF3u3FGq0Yoh4rjuHBVhwZcemZHnKLgJUUbQQ" - ] - }, - "Body": "gF4fC+NjbxE=" - } - }, - { - "ID": "af8c1fcfa456592a", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Range": [ - "bytes=0-31" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqq6ro5-i6q8pIDup0yW35uFEynuLK95P8OSFhj7b70DK33tjv3fkOdkobsfwplOAGuNME2bLjQuyy8mhd2xBbNjyjvXt13Nc48PB4M2t_46RoM3Ak" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEQ==" - } - }, - { - "ID": "d312c241da5bd348", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Range": [ - "bytes=32-41" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 416, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "167" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpAvzLs-GgdTPEGM2kvABFTxehSb-DhZQ2Y31nQ9ad0RMmfIMtVGRBXvkXo7FwGAy78ZHMSGWRKG-DYMy6JU9PCM4Tpo8PDmm4-rHa_LVpH2dFN-JM" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+SW52YWxpZFJhbmdlPC9Db2RlPjxNZXNzYWdlPlRoZSByZXF1ZXN0ZWQgcmFuZ2UgY2Fubm90IGJlIHNhdGlzZmllZC48L01lc3NhZ2U+PERldGFpbHM+Ynl0ZXM9MzItNDE8L0RldGFpbHM+PC9FcnJvcj4=" - } - }, - { - "ID": "2bbd010d0173c966", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3150" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Etag": [ - "CLnS+bvx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpZDScoUU4zzBoXc21jt6C1vcW1SrU6ELiWodrCID-OoNKVMbecv_DSgHZATQGs4GS-BebkzqdalqTq5C77aKXQMxiks-9A5kyrc8N4aY9L5YndaI8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoxLzE1NTY4MzU4NDQ2NDcyMjUiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9vYmoxIiwibmFtZSI6Im9iajEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NDY0NzIyNSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDowNC42NDZaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MDQuNjQ2WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LT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iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNMblMrYnZ4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiQ1Q2ZFRBPT0iLCJldGFnIjoiQ0xuUytidngvZUVDRUFFPSJ9" - } - }, - { - "ID": "e3522e1cc7aef940", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2570" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Etag": [ - "CAY=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:13 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur5x_r1PKMQrnKbsfUWRR6wBwFQTM8U9mGwyq_fK56rrHE_UoLDxLRpiuaFGLVi9L4Hj67UXH76drA6KQQQgOsMVo0YEl1pVS2P7O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pbmciOnsiZW5hYmxlZCI6ZmFsc2V9LCJsaWZlY3ljbGUiOnsicnVsZSI6W3siYWN0aW9uIjp7InR5cGUiOiJEZWxldGUifSwiY29uZGl0aW9uIjp7ImFnZSI6MzB9fV19LCJsYWJlbHMiOnsibDEiOiJ2MiIsIm5ldyI6Im5ldyJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQVk9In0=" - } - }, - { - "ID": "77ed46692038573c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/copy-obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3333" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:14 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpBnZgUt8GyAer5VG-_nEuf3YizRjF2t4MS6vOflI_Vid1-zVpQ99TuphB3pZjPZNI5ZoHJxCmDv3lyLwyhUDvk_p_NO9x8qZTEpjf1EOO5ux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RUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJDVDZkVEE9PSIsImV0YWciOiJDSmlxdmNEeC9lRUNFQUU9In19" - } - }, - { - "ID": "9187dbb998c64d40", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/copy-obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "31" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJjb250ZW50RW5jb2RpbmciOiJpZGVudGl0eSJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3299" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:14 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpyrF7U9KSc3XcJb-T_KGf3Fg2yhFUjJqTl06wpqqhG5IT6chgLCWKnLTuamfHtVq8XcP7acZy4TGyKIEvZ4L36TGTfSM8Zp_JyF8K4rN5p375VBMc" - ] - },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rbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IkNUNmRUQT09IiwiZXRhZyI6IkNKZVA0c0R4L2VFQ0VBRT0ifX0=" - } - }, - { - "ID": "c199412d75fadc45", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "193" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJhY2wiOlt7ImVudGl0eSI6ImRvbWFpbi1nb29nbGUuY29tIiwicm9sZSI6IlJFQURFUiJ9XSwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwiY29udGVudExhbmd1YWdlIjoiZW4iLCJjb250ZW50VHlwZSI6InRleHQvaHRtbCIsIm1ldGFkYXRhIjp7ImtleSI6InZhbHVlIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2046" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:15 GMT" - ], - "Etag": [ - "CLnS+bvx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-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bGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vb2JqMS9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6Im9iajEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg0NDY0NzIyNSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNMblMrYnZ4L2VFQ0VBST0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiQ1Q2ZFRBPT0iLCJldGFnIjoiQ0xuUytidngvZUVDRUFJPSJ9" - } - }, - { - "ID": "c845025158c6b7d0", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "120" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50TGFuZ3VhZ2UiOm51bGwsImNvbnRlbnRUeXBlIjpudWxsLCJtZXRhZGF0YSI6bnVsbH0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "1970" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:15 GMT" - ], - "Etag": [ - "CLnS+bvx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UryOVdmGzCqBOS2ZZ0nw1SqbHF7qJ1CeTxgb6a1BJyoA42NTNZ8RdEVQGNF5u2hWdSQW79cBOonxjms_MoogyDJVAtKHl1rys87QHF6-750NNNSoEw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoxLzE1NTY4MzU4NDQ2NDcyMjUiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9vYmoxIiwibmFtZSI6Im9iajEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9u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2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJDVDZkVEE9PSIsImV0YWciOiJDTG5TK2J2eC9lRUNFQU09In0=" - } - }, - { - "ID": "811b0b9d4980b14f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoiY2hlY2tzdW0tb2JqZWN0In0K", - "aGVsbG93b3JsZA==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3305" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:16 GMT" - ], - "Etag": [ - "CIGhrMHx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqJTh_P91pby-vQkRF12GexDihy7TZAlUPamDV_REldvXeqvbrWY_kB0Vcp1lYyuIY7EK2_eMBYYSRMMIVEYz5fxxt51-9Br_UmYvnuRgjhfC16AuA" - ] - }, - "Body": "eyJraW5kIjoic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c2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJWc3UwZ0E9PSIsImV0YWciOiJDSUdock1IeC9lRUNFQUU9In0=" - } - }, - { - "ID": "69c77b8bdd7cc643", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoiemVyby1vYmplY3QifQo=", - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3240" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:16 GMT" - ], - "Etag": [ - "CLirz8Hx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur2iXVwACD0yFKYjt0WT-lW1Tx6PtpOgDYttPBWBnJZ3CPf4cUK7heI_9SwdzYXoieaRHDj9n3w3M_SExedwQqQ-GTOY9qM9DPmrPy11hEny0WjECc" - ] - }, - "Body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ldGFnIjoiQ0xpcno4SHgvZUVDRUFFPSJ9" - } - }, - { - "ID": "1017883279ca634a", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1/acl/allUsers?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "98" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJlbnRpdHkiOiJhbGxVc2VycyIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "417" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:17 GMT" - ], - "Etag": [ - "CLnS+bvx/eECEAQ=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoKqYaaFUj6b4ezS4lnnQgYv4CHVSsqhVSlLP3QqpItNahh25KnLzbTccK_idrfjKV0gExzr17MvFmoRw7oUIWyJJINmpEXEw5EmHScxipsb3KbWZ8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvb2JqMS8xNTU2ODM1ODQ0NjQ3MjI1L2FsbFVzZXJzIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vb2JqMS9hY2wvYWxsVXNlcnMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJvYmoxIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NDQ2NDcyMjUiLCJlbnRpdHkiOiJhbGxVc2VycyIsInJvbGUiOiJSRUFERVIiLCJldGFnIjoiQ0xuUytidngvZUVDRUFRPSJ9" - } - }, - { - "ID": "35f04bf2400be96f", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj1", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:24:17 GMT" - ], - "Etag": [ - "\"4a76bf516bfb99c648db7a04e6d51a6d\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:17 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:04 GMT" - ], - "X-Goog-Generation": [ - "1556835844647225" - ], - "X-Goog-Hash": [ - "crc32c=CT6dTA==", - "md5=Sna/UWv7mcZI23oE5tUabQ==" - ], - "X-Goog-Metageneration": [ - "4" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqC9teasrZdeHJo8KLaQQ251d02ORMxXreH3TKcaQp4NWLVbpiAw1GpW9WeSdFgbpWtVDdyzfjE93gAs6uA0kdlDPZsIEfJVK3GFfaZE2aW5aFCn8Y" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEQ==" - } - }, - { - "ID": "d01040504d2a91c4", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoib2JqMSJ9Cg==", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 401, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "30343" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:17 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "Www-Authenticate": [ - "Bearer realm=\"https://accounts.google.com/\"" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqRhLZOcm0K7eNByUzCBgYfgiytuZ6Hj06jPkbkK77LS80OPgO_78AL530-2AcrlLe1fIy0jM0tonLLncLuOszrqKcGgVhqEJuE48-67vqBRACjqmY" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkFub255bW91cyBjYWxsZXIgZG9lcyBub3QgaGF2ZSBzdG9yYWdlLm9iamVjdHMuY3JlYXRlIGFjY2VzcyB0byBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvb2JqMS4iLCJsb2NhdGlvblR5cGUiOiJoZWFkZXIiLCJsb2NhdGlvbiI6IkF1dGhvcml6YXRpb24iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6QUNDRVNTX0RFTklFRDogQW5vbnltb3VzIGNhbGxlciBkb2VzIG5vdCBoYXZlIHN0b3JhZ2Uub2JqZWN0cy5jcmVhdGUgYWNjZXNzIHRvIGdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoxLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmVFeGNlcHRpb24uamF2YToxNDcpXG5cdGF0IG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NhbGxlciBkb2VzIG5vdCBoYXZlIHN0b3JhZ2Uub2JqZWN0cy5jcmVhdGUgYWNjZXNzIHRvIGdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vYmoxLiJ9fQ==" - } - }, - { - "ID": "db327c92dac99584", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/copy-obj1?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:18 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoa0LrEhOIeq-iYERbwsOkXjr0QR1ANe3tDsleUqoFNU7fRIruaqYikdnU1svzhc8iGRwx0A5dAGYQ_mM045LN_oxU1c76ugXtnWS2PW8wBcmst7hk" - ] - }, - "Body": "" - } - }, - { - "ID": "e70c028bd3dc9250", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/copy-obj1?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12275" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:18 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:18 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqrvFq18HewCbAkJcD7BmKgE8_WOFqSNkcwbpbNqCDPIy5jLVf2fIaHdg76_1rHuAHTtFM84Zr6euptOehRZOqA38Zc_BrJUSZKjg686imvazehpBc" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vIHN1Y2ggb2JqZWN0OiBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvY29weS1vYmoxIiwiZGVidWdJbmZvIjoiY29tLmdvb2dsZS5uZXQucnBjMy5ScGNFeGNlcHRpb246IGNsb3VkLmJpZ3N0b3JlLlJlc3BvbnNlQ29kZS5FcnJvckNvZGU6Ok9CSkVDVF9OT1RfRk9VTkQ6IE5vIHN1Y2ggb2JqZWN0OiBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvY29weS1vYmoxXG5cd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Zy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUkMS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDYwKVxuXHRhdCBpby5ncnBjLkNvbnRleHQucnVuKENvbnRleHQuamF2YTo1NjUpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5DdXJyZW50Q29udGV4dC5ydW5JbkNvbnRleHQoQ3VycmVudENvbnRleHQuamF2YToyMDQpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm8gc3VjaCBvYmplY3Q6IGdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb3B5LW9iajEifX0=" - } - }, - { - "ID": "4d7120b41e583669", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/copy-obj1?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12215" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:18 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:18 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoJ1cGOQjoNiRk8qv-igyccVp3Vg_ut7NLSEO3A-yyQwgGnoXR5jPbi3tuomYWrS57GIvd6GpShkcAYSIJ2e94Jx_1SseYkYtlSF8a7qsDU0OVFYgM" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vIHN1Y2ggb2JqZWN0OiBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvY29weS1vYmoxIiwiZGVidWdJbmZvIjoiY29tLmdvb2dsZS5uZXQucnBjMy5ScGNFeGNlcHRpb246IGNsb3VkLmJpZ3N0b3JlLlJlc3BvbnNlQ29kZS5FcnJvckNvZGU6Ok9CSkVDVF9OT1RfRk9VTkQ6IE5vIHN1Y2ggb2JqZWN0OiBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvY29weS1vYmoxXG5cdGF0IG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KVxuXHRhdCBpby5ncnBjLkNvbnRleHQucnVuKENvbnRleHQuamF2YTo1NjUpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5DdXJyZW50Q29udGV4dC5ydW5JbkNvbnRleHQoQ3VycmVudENvbnRleHQuamF2YToyMDQpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm8gc3VjaCBvYmplY3Q6IGdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb3B5LW9iajEifX0=" - } - }, - { - "ID": "e7711da9b067a58f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/composed1/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "156" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6Im9iajEifSx7Im5hbWUiOiJvYmoyIn0seyJuYW1lIjoib2JqL3dpdGgvc2xhc2hlcyJ9XX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "750" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Etag": [ - "CI2048Lx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoJ5Us6Rp03fUUqSAPFFGPuqW2qR4gCfzJ4w3W1Kx8C0JGfNDxte0QlBoVEi4K7rV5zkUY1IXQvIk6FOU3DxP8ECZdxkVJBW57Jf5iXo8kRyLVu7OA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb21wb3NlZDEvMTU1NjgzNTg1ODk2Mjk1NyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2NvbXBvc2VkMSIsIm5hbWUiOiJjb21wb3NlZDEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg1ODk2Mjk1NyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDoxOC45NjJaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MTguOTYyWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjE4Ljk2MloiLCJzaXplIjoiNDgiLCJtZWRpYUxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9kb3dubG9hZC9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vY29tcG9zZWQxP2dlbmVyYXRpb249MTU1NjgzNTg1ODk2Mjk1NyZhbHQ9bWVkaWEiLCJjcmMzMmMiOiJBYldCeVE9PSIsImNvbXBvbmVudENvdW50IjozLCJldGFnIjoiQ0kyMDQ4THgvZUVDRUFFPSJ9" - } - }, - { - "ID": "de5d78de4310ff60", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/composed1", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "48" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Etag": [ - "\"-CI2048Lx/eECEAE=\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:18 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Component-Count": [ - "3" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:18 GMT" - ], - "X-Goog-Generation": [ - "1556835858962957" - ], - "X-Goog-Hash": [ - "crc32c=AbWByQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "48" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqprnxhGEtAMeMcwiKn43QTEdsHrB7k_jCjOqnvH984bk5CIjIhSalrDVNwlLb37IU67jIYyIY1Nq8uaSz5HGUROWwpE6SVmGvIGXnuAbTP7x8Ez5w" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEeeRmd+w7xhUEtz55BCr9yaRPt+QxetF2uGfY/b4R5Pm" - } - }, - { - "ID": "4b7c14a3f35089ce", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/composed2/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "182" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50VHlwZSI6InRleHQvanNvbiJ9LCJzb3VyY2VPYmplY3RzIjpbeyJuYW1lIjoib2JqMSJ9LHsibmFtZSI6Im9iajIifSx7Im5hbWUiOiJvYmovd2l0aC9zbGFzaGVzIn1dfQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "776" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Etag": [ - "CP+RiMPx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrMYc2wH1kAYUthDQQhZ4gGQU6kYXq6KGs1msu9ifujWYQ2dwS5ifqZFWiTYf74Rq2y9VkzALfhjkTK6anDL-SwHxUH3IwMe8j1rrrbaMbv7eLQCR8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb21wb3NlZDIvMTU1NjgzNTg1OTU2NDc5OSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2NvbXBvc2VkMiIsIm5hbWUiOiJjb21wb3NlZDIiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg1OTU2NDc5OSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9qc29uIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjE5LjU2NFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDoxOS41NjRaIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJ0aW1lU3RvcmFnZUNsYXNzVXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MTkuNTY0WiIsInNpemUiOiI0OCIsIm1lZGlhTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2Rvd25sb2FkL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb21wb3NlZDI/Z2VuZXJhdGlvbj0xNTU2ODM1ODU5NTY0Nzk5JmFsdD1tZWRpYSIsImNyYzMyYyI6IkFiV0J5UT09IiwiY29tcG9uZW50Q291bnQiOjMsImV0YWciOiJDUCtSaU1QeC9lRUNFQUU9In0=" - } - }, - { - "ID": "26a4cb091ed2f1bd", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/composed2", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "48" - ], - "Content-Type": [ - "text/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Etag": [ - "\"-CP+RiMPx/eECEAE=\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:19 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Component-Count": [ - "3" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:19 GMT" - ], - "X-Goog-Generation": [ - "1556835859564799" - ], - "X-Goog-Hash": [ - "crc32c=AbWByQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "48" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur-t-yqapXjBzjIrFWFhaT080f06JahbskCp0DC_-izUjPK4fYn556m2qyRDgj9HjkkDPtKR6dauzF5afjNZZ61bN_dTvw15d82A206-SdS1Jv_YM4" - ] - }, - "Body": "TuDshcL7vdCAXh8L42NvEeeRmd+w7xhUEtz55BCr9yaRPt+QxetF2uGfY/b4R5Pm" - } - }, - { - "ID": "6b59ed7d3d098970", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50RW5jb2RpbmciOiJnemlwIiwibmFtZSI6Imd6aXAtdGVzdCJ9Cg==", - "H4sIAAAAAAAA/2IgEgACAAD//7E97OkoAAAA" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3227" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:20 GMT" - ], - "Etag": [ - "CNuJssPx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoXNmswaWh2Gfcz1pYPy7etwk09Nz_dmuYVq55M2p3ox38A3mC0QgoHf-hL1uCZxQvusJSIHeugTQvmCgZvRdXV-3juD0W8KI669m0EILAHSfnVoJ8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9nemlwLXRlc3QvMTU1NjgzNTg2MDI1MTg2NyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2d6aXAtdGVzdCIsIm5hbWUiOiJnemlwLXRlc3QiLCJidWNrZXQiOiJnby1pbnRlZ3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uZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2d6aXAtdGVzdC9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6Imd6aXAtdGVzdCIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODYwMjUxODY3IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ051SnNzUHgvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiI5RGh3QkE9PSIsImV0YWciOiJDTnVKc3NQeC9lRUNFQUU9In0=" - } - }, - { - "ID": "070a9af78f7967bf", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/gzip-test", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "none" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Type": [ - "application/x-gzip" - ], - "Date": [ - "Thu, 02 May 2019 22:24:20 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:20 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:20 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Accept-Encoding" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:20 GMT" - ], - "X-Goog-Generation": [ - "1556835860251867" - ], - "X-Goog-Hash": [ - "crc32c=9DhwBA==", - "md5=OtCw+aRRIRqKGFAEOax+qw==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "gzip" - ], - "X-Goog-Stored-Content-Length": [ - "27" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UosPALnXk-3j5nBlDDWX7hBP4xBNcCe7lGNkEU-sHHTWsRexFWLoB-1gn8RfnlqS6Q5ZTrR86NBxpP1T0bFxgHnlYUYGh-G3mThRCgGIAWjXggOeOU" - ] - }, - "Body": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" - } - }, - { - "ID": "3ece6665583d65fb", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/obj-not-exists", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "225" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:20 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:20 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uph0zmuYk7ZmOWzbNkj24Iai85wz2vKj0mMnMkIHIoDUlDAUCA0e_CgFT5fV_XAvgUx06I9FspomkB_ImflSVCvj55GK6zEoY5iV1hN96nh4AmPBN0" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+Tm9TdWNoS2V5PC9Db2RlPjxNZXNzYWdlPlRoZSBzcGVjaWZpZWQga2V5IGRvZXMgbm90IGV4aXN0LjwvTWVzc2FnZT48RGV0YWlscz5ObyBzdWNoIG9iamVjdDogZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL29iai1ub3QtZXhpc3RzPC9EZXRhaWxzPjwvRXJyb3I+" - } - }, - { - "ID": "602f4fdfff4e490c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoic2lnbmVkVVJMIn0K", - "VGhpcyBpcyBhIHRlc3Qgb2YgU2lnbmVkVVJMLgo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3230" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:21 GMT" - ], - "Etag": [ - "CNat6MPx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoWSi2VcVAHJJzhGSPjVT17kZYaCh3uZvWXBU0R4hVmPZJ10gvbv_Ucrfd2kwrBvRYoZaQcYkY5Q3M-oywiCNtLm6SM9InWHz2Omc-0pWJJjfQWPCM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9zaWduZWRVUkwvMTU1NjgzNTg2MTE0MTIwNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL3NpZ25lZFVSTCIsIm5hbWUiOiJzaWduZWRVUkwiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMy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WludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL3NpZ25lZFVSTC9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6InNpZ25lZFVSTCIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODYxMTQxMjA2IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ05hdDZNUHgvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJaVHFBTHc9PSIsImV0YWciOiJDTmF0Nk1QeC9lRUNFQUU9In0=" - } - }, - { - "ID": "4a1c9dc802f4427c", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "119" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:23 GMT" - ], - "Etag": [ - "CAc=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrbFZENfdiDkKpD_H_zm44x7h5bTZ3VD6MEoiiXuMwxHHK-zCSSoPRA2ALNUXoR3EcS1c-huuyZBIiw7ULKii7BNqKz0RMu4lWRxrDRQBOjGwKDDgE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQWM9In0=" - } - }, - { - "ID": "e12cb7360f4fd8dd", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/defaultObjectAcl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "684" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:23 GMT" - ], - "Etag": [ - "CAc=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:23 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrVJI9g41JQEDEgaIAOXKSCe2B8xklFKSoIciM7uC0uod7t7NzXfxsIrI6mQeZGkWa2B12xdKpSJBndrNbBvygZ6aXxpBBvL8d80NJ42u8KQC7AaFE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBYz0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQWM9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBYz0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNBYz0ifV19" - } - }, - { - "ID": "d25b1dc2d7247768", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiYWNsMSJ9Cg==", - "/pXmp0sD+azbBKjod9MhwQ==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:24 GMT" - ], - "Etag": [ - "COr+pcXx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UosBTMUgCzCYlGDKqRCN7Kexl832zyi4FxoRqfYtmTr8yv63z4BAQBeCTLajyZqMbRyzjje7TtPPYomUSv_8zrQ8bFdXlNzbTSeKK8kXi2Ys82jus4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9hY2wxLzE1NTY4MzU4NjQyNDgxNzAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9hY2wxIiwibmFtZSI6ImFjbDEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg2NDI0ODE3MCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjI0LjI0N1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDoyNC4yNDdaIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJ0aW1lU3RvcmFnZUNsYXNzVXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MjQuMjQ3WiIsInNpemUiOiIxNiIsIm1kNUhhc2giOiIwRTl0Rk5wWmowL1dLT0o2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U4NjQyNDgxNzAvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2FjbDEvYWNsL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJhY2wxIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NjQyNDgxNzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT3IrcGNYeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IkZpRG1WZz09IiwiZXRhZyI6IkNPcitwY1h4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "1d3df0d90130f5fe", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiYWNsMiJ9Cg==", - "HSHw5Wsm5u7iJL/jjKkPVQ==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:24 GMT" - ], - "Etag": [ - "CJrxw8Xx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpMl0_NB41LujALQWmul06CCiuw7okuKlhYG_qilsoXlld2qoYgc2-ABYogriA37QOJMK5ZlJ5sYzP2Mp7CTSzK9uccFLi10TdrGFMUjUpD0OvcXrE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9hY2wyLzE1NTY4MzU4NjQ3Mzc5NDYiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkw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Ym94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSnJ4dzhYeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IkF0TlJ0QT09IiwiZXRhZyI6IkNKcnh3OFh4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "a270daf4f72d9d3d", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/acl1/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2767" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:25 GMT" - ], - "Etag": [ - "COr+pcXx/eECEAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:25 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UranlihhkPcnPzTT2UYs4r6Hritk60lULu-pzO6YX-EWIlMlFiXzKmxaZVgO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nZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2FjbDEvYWNsL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJvYmplY3QiOiJhY2wxIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NjQyNDgxNzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT3IrcGNYeC9lRUNFQUU9In1dfQ==" - } - }, - { - "ID": "328125b2bc991e95", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/acl1/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:25 GMT" - ], - "Etag": [ - "COr+pcXx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UosP78wuW4e1mPLJgcCbCxBC4Je5LWjKugd0fVK51u-P3qeXbQXj4_Amo25ZHyut2LZvoipvmK95xEvebSyVyzVydKyU2VSbHLDkwnRpR-nr9UGIf0" - ] - }, - "Body": "" - } - }, - { - "ID": "1c7595376917851f", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:26 GMT" - ], - "Etag": [ - "CAg=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqnZXiLrdCFoctnkKUqdvXLdSp9xumFk20gsRJc4xB1CTZ14aLZYwbDJmi90E28Q2_E4klaJBOaB1OCcpbDBoF1N9E9Bk3VEaNYYrHKMoECuO7RMPs" - ] - }, - "Body": "" - } - }, - { - "ID": "4183198b151a3557", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/acl/user-jbd%40google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "109" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJlbnRpdHkiOiJ1c2VyLWpiZEBnb29nbGUuY29tIiwicm9sZSI6IlJFQURFUiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "386" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:27 GMT" - ], - "Etag": [ - "CAk=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo361-YkcyyOvd5CL4q3LgTM1Bk4RdkPY3cn-qOm6Dn0vghTnmIE9VKkzGiOnjRNnD7SWXGMqpxaCGvCt6P44D55PqOwAtVTF8PNwmEK9HWCoVXABo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvdXNlci1qYmRAZ29vZ2xlLmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9hY2wvdXNlci1qYmRAZ29vZ2xlLmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImVudGl0eSI6InVzZXItamJkQGdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZW1haWwiOiJqYmRAZ29vZ2xlLmNvbSIsImV0YWciOiJDQWs9In0=" - } - }, - { - "ID": "e98f53a71d8839c9", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "1789" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:28 GMT" - ], - "Etag": [ - "CAk=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:28 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-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AzNDMyMDEzLTAwMDEvdXNlci1qYmRAZ29vZ2xlLmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9hY2wvdXNlci1qYmRAZ29vZ2xlLmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImVudGl0eSI6InVzZXItamJkQGdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZW1haWwiOiJqYmRAZ29vZ2xlLmNvbSIsImV0YWciOiJDQWs9In1dfQ==" - } - }, - { - "ID": "28b9a29086758e65", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/acl/user-jbd%40google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:28 GMT" - ], - "Etag": [ - "CAo=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UozsFdtI43Ltv91E18-CrdRZ4pQDVZXReJOVhpWDu3mxNA7rrWU7hNGl4kPMd0FgcVWDigZA5JBNsYbFV113Ew6Cp2uTsuk0uI1io_mhA6-Lmd2h18" - ] - }, - "Body": "" - } - }, - { - "ID": "8ef9f7b6caefd750", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiZ29waGVyIn0K", - "ZGF0YQ==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3196" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:29 GMT" - ], - "Etag": [ - "CIXH3cfx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo97hrh9l4pmrJQqaH8Qu3axsdbEPH2Y8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n0sImNyYzMyYyI6InJ0aDkwUT09IiwiZXRhZyI6IkNJWEgzY2Z4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "ae3a5920bc8a9c3c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoi0JPQvtGE0LXRgNC+0LLQuCJ9Cg==", - "ZGF0YQ==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3548" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:29 GMT" - ], - "Etag": [ - "CPzK+8fx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrPLZGQqU8j04JqxMmfsqas3HGTlrdx5NM99YR5nCedJYGMSaZ1ynvd2UbUcdwps_gfRo__0XapzHuD3hM_bshff65qlnw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MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0Ijoi0JPQvtGE0LXRgNC+0LLQuCIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODY5ODQ0ODYwIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ1B6Sys4ZngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJydGg5MFE9PSIsImV0YWciOiJDUHpLKzhmeC9lRUNFQUU9In0=" - } - }, - { - "ID": "0104a746dbe20580", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiYSJ9Cg==", - "ZGF0YQ==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3116" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:30 GMT" - ], - "Etag": [ - "COKVlMjx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqY12miALkWDvx8PHEyL23oxWZlw8Jq7Cn6kS8E8_Tn1tTWWoTuS_pWb5pi9qevCIvqK6aTK56MzwrMuy9axIjpw5yyMZ42MaWK_YFkBr95OnK5IbM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9hLzE1NTY4MzU4NzAyNDc2NTAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9hIiwibmFtZSI6ImEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3MDI0NzY1MCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDozMC4yNDdaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MzAuMjQ3WiIsInN0b3JhZ2VDb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pY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ09LVmxNangvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJydGg5MFE9PSIsImV0YWciOiJDT0tWbE1qeC9lRUNFQUU9In0=" - } - }, - { - "ID": "da19af085be0fb47", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhY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- }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "19484" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:30 GMT" - ], - "Etag": [ - "CLmmusjx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrAJr55dqTDkY_jBKB0vAWyE0owtzB_kEoH91_FKTr9C3bHd8fWUiTrsruL5mgwXg2l8gbPiOXad-A9HIJ3Zt_AeXq_p0m-Q8LrHQqJ6sAKsbzV4Zw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhY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WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODcwODcyMzc3IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0xtbXVzangvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJydGg5MFE9PSIsImV0YWciOiJDTG1tdXNqeC9lRUNFQUU9In0=" - } - }, - { - "ID": "96f915707a76c50c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAifQo=", - "ZGF0YQ==" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "2948" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:31 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrQIwi81TFCNpDIZUjs_5tSUFqURLnaBF7g2l1sGMuHCTWZeLyr45VWkcc8fUDYnF-P84QixYQbTzJGuJzOOx7mw1qluYDqoORFGPICfvKmNxrZM3A" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IlJlcXVpcmVkIiwiZGVidWdJbmZvIjoiY29tLmdvb2dsZS5hcGkuc2VydmVyLmNvcmUuRmF1bHQ6IEltbXV0YWJsZUVycm9yRGVmaW5pdGlvbntiYXNlPVJFUVVJUkVELCBjYXRlZ29yeT1VU0VSX0VSUk9SLCBjYXVzZT1udWxsLCBkZWJ1Z0luZm89bnVsbCwgZG9tYWluPWdsb2JhbCwgZXh0ZW5kZWRIZWxwPW51bGwsIGh0dHBIZWFkZXJzPXt9LCBodHRwU3RhdHVzPWJhZFJlcXVlc3QsIGludGVybmFsUmVhc29uPVJlYXNvbnthcmd1bWVudHM9e30sIGNhdXNlPW51bG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IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDAwLCJtZXNzYWdlIjoiUmVxdWlyZWQifX0=" - } - }, - { - "ID": "7a562d6e65ef8a7a", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYW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", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "4785" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:31 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ups-3Re4_9njFMmkYwND6BuK5cgxs5tKVRwQ2CGkcks-K0aALbethXTYaEb6fLos6w_FSnM8YkPGM3TETCAoyYpVbQPlotXR9CH3DXngjQNv0yv_ZQ" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImludmFsaWQiLCJtZXNzYWdlIjoiVGhlIG1heGltdW0gb2JqZWN0IGxlbmd0aCBpcyAxMDI0IGNoYXJhY3RlcnMsIGJ1dCBnb3QgYSBuYW1lIHdpdGggMTAyNSBjaGFyYWN0ZXJzOiAnJ2FhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhLi4uJyciLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLmFwaS5zZXJ2ZXIuY29yZS5GYXVsdDogSW1tdXRhYmxlRXJyb3JEZWZpbml0aW9ue2Jhc2U9SU5WQUxJRF9WQUxVRSwgY2F0ZWdvcnk9VVNFUl9FUlJPUiwgY2F1c2U9bnVsbCwgZGVidWdJbmZvPW51bGwsIGRvbWFpbj1nbG9iYWwsIGV4dGVuZGVkSGVscD1udWxsLCBodHRwSGVhZGVycz17fSwgaHR0cFN0YXR1cz1iY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dCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwMCwibWVzc2FnZSI6IlRoZSBtYXhpbXVtIG9iamVjdCBsZW5ndGggaXMgMTAyNCBjaGFyYWN0ZXJzLCBidXQgZ290IGEgbmFtZSB3aXRoIDEwMjUgY2hhcmFjdGVyczogJydhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYS4uLicnIn19" - } - }, - { - "ID": "239b642e1919a84a", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoibmV3XG5saW5lcyJ9Cg==", - "ZGF0YQ==" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "3270" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:31 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urk-XOPoshQkyIHYZp241R2W5lOuLwqPMx606rubzPOaGggM2z_sZO93dYCJHffXuPDOjy64lIxrBXIYW4QT04eM932jPtzPdVd-PFWssV9RYk83JE" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImludmFsaWQiLCJtZXNzYWdlIjoiRGlzYWxsb3dlZCB1bmljb2RlIGNoYXJhY3RlcnMgcHJlc2VudCBpbiBvYmplY3QgbmFtZSAnJ25ld1xubGluZXMnJyIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUuYXBpLnNlcnZlci5jb3JlLkZhdWx0OiBJbW11dGFibGVFcnJvckRlZmluaXRpb257YmFzZT1JTlZBTElEX1ZBTFVFLCBjYXRlZ29yeT1VU0VSX0VSUk9SLCBjYXVzZT1udWxsLCBkZWJ1Z0luZm89bnVsbCwgZG9tYWluPWdsb2JhbCwgZXh0ZW5kZWRIZWxwPW51bGwsIGh0dHBIZWFkZXJzPXt9LCBodHRwU3RhdHVzPWJhZFJlcXVlc3QsIGludGVybmFsUmVhc29uPVJlYXNvbnthcmd1bWVudHM9e30sIGNhdXNlPW51bGwsIGNvZGU9Z2RhdGEuQ29yZUVycm9yRG9tYWluLklOVkFMSURfVkFMVUUsIGNyZWF0ZWRCeUJhY2tlbmQ9dHJ1ZSwgZGVidWdNZXNzYWdlPW51bGwsIGVycm9yUHJvdG9Db2RlPUlOVkFMSURfVkFMVUUsIGVycm9yUHJvdG9Eb21haW49Z2RhdGEuQ29yZUVycm9yRG9tYWluLCBmaWx0ZXJlZE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blx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJEaXNhbGxvd2VkIHVuaWNvZGUgY2hhcmFjdGVycyBwcmVzZW50IGluIG9iamVjdCBuYW1lICcnbmV3XG5saW5lcycnIn19" - } - }, - { - "ID": "3cd795cb0b675f98", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:31 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpOXjD9T_c_FRByyyA-CjE753kXZefEzIwQdrNG6OewoHOvKC3Bb9LleziQ6-ymVDg-F1S1eeQeFNJH7nJxDsdA_VmxOjeBzTDB_F3--_1NtwMF6Do" - ] - }, - "Body": "" - } - }, - { - "ID": "361d4541e2cb460a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/a?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:31 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpomJFlpfOIJoFvdCmQgD2dRXSREzV1ToI2ntcHi8I9tSyzMCUk0ZrytllkwR_nU8WFZ0YuXVl0Kwsq1EhJL85RlBgCkBNc1P-yVMyNbdt5YrooKok" - ] - }, - "Body": "" - } - }, - { - "ID": "a4e929446e49411d", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/%D0%93%D0%BE%D1%84%D0%B5%D1%80%D0%BE%D0%B2%D0%B8?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:31 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqmdInqhuXhUxVjtfRvXvHd6Rmo1ODUbeNFFTBW4diuT7HDjzmYnvd4TU6oJPqbck52yFAR99fMx4Tks1TllSUCB4GsMVbBNENfZU6te-hXIB8XyJs" - ] - }, - "Body": "" - } - }, - { - "ID": "89b2ef62a071f7b9", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/gopher?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:24:32 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrRgapcSgK1GOswXS37Vynb9BRj0go8bNPOBtrFZ3TDr-nzIdlvKBQuwHtXl4Tlb-mLl-A65zL5Iw3unCEuy6lwtWl5-V7REtcIVHkrWLK5AoLoHqA" - ] - }, - "Body": "" - } - }, - { - "ID": "ca91b2e4ee4555cb", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiY29udGVudCJ9Cg==", - "SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3213" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:32 GMT" - ], - "Etag": [ - "CLGNmsnx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UovWW5HSrWbcvQoWGU3c_n64wwcau06tjEM-fzdADFSbmmylG3VLjae6MRNIM4B9gDitCKfjo1_xPQNAZEmMYzRplVmdI4cIrBC8ursFSUywoCSJeU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb250ZW50LzE1NTY4MzU4NzI0NDIwMzMiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb250ZW50IiwibmFtZSI6ImNvbnRlbnQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3MjQ0MjAzMyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDozMi40NDFaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MzIuNDQxWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjMyLjQ0MVoiLCJzaXplIjoi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2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNMR05tc254L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiRmNYTThRPT0iLCJldGFnIjoiQ0xHTm1zbngvZUVDRUFFPSJ9" - } - }, - { - "ID": "eb678345630fe080", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/content?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3213" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:32 GMT" - ], - "Etag": [ - "CLGNmsnx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrtPOErXGrnlQtXCV1PhgO5nz80m75Fzs7DoR-y8Ava3jvL9NDJ4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b3VudC5jb20ifSwiY3JjMzJjIjoiRmNYTThRPT0iLCJldGFnIjoiQ0xHTm1zbngvZUVDRUFFPSJ9" - } - }, - { - "ID": "d76ba152a62e7dc1", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJuYW1lIjoiY29udGVudCJ9Cg==", - "PGh0bWw+PGhlYWQ+PHRpdGxlPk15IGZpcnN0IHBhZ2U8L3RpdGxlPjwvaGVhZD48L2h0bWw+" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3212" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:33 GMT" - ], - "Etag": [ - "CLPJv8nx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqk5XoKCyt74JBpeU8oREfzh3e0LLtXupBj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LCJjcmMzMmMiOiJHb1Vic1E9PSIsImV0YWciOiJDTFBKdjhueC9lRUNFQUU9In0=" - } - }, - { - "ID": "f785ed7f0490bb6d", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/content?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3212" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:33 GMT" - ], - "Etag": [ - "CLPJv8nx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrCqpaad9mhxk7VZgTc8xIunote5-AHPp3vYkUbSU8uiVcq65rcnrbtIuCqJ63JTuVJvKw7pFwnLjyn5fL37JzfXLhmLAowAV67_Qqtxxhiy4WQars" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb250ZW50LzE1NTY4MzU4NzMwNTU5MjMiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY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DU1OTIzL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb250ZW50L2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY29udGVudCIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODczMDU1OTIzIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0xQSnY4bngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJHb1Vic1E9PSIsImV0YWciOiJDTFBKdjhueC9lRUNFQUU9In0=" - } - }, - { - "ID": "096d156b863922d6", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvaHRtbCIsIm5hbWUiOiJjb250ZW50In0K", - "PGh0bWw+PGhlYWQ+PHRpdGxlPk15IGZpcnN0IHBhZ2U8L3RpdGxlPjwvaGVhZD48L2h0bWw+" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3197" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:33 GMT" - ], - "Etag": [ - "CPW+6cnx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoivaSzjVdOm2KP4nXCF8VQDNHXmlNjm9rZwTaWzjvBmH3oK01QYTnHqZ5DhYRewu_1H0KoQgFpUIC-M4OKZoOhRHrq0-H8HLT__SqD1D5cmezrqHo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb250ZW50LzE1NTY4MzU4NzM3NDI3MDkiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2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L3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb250ZW50L2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY29udGVudCIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODczNzQyNzA5IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ1BXKzZjbngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJHb1Vic1E9PSIsImV0YWciOiJDUFcrNmNueC9lRUNFQUU9In0=" - } - }, - { - "ID": "0e96d304e9558094", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/content?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3197" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:34 GMT" - ], - "Etag": [ - "CPW+6cnx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoc-8JwtQprLtec5Ft6q3z4p0ooDaCCLmO9oVgrOXvBpoFhApztj8anfFwEcHdzpB6FBlUFqou0viF_HLHJvHolsxeCCoDOhqyIggOOlWjnSRg8XzY" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb250ZW50LzE1NTY4MzU4NzM3NDI3MDkiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb250ZW50IiwibmFtZSI6ImNvbnRlbnQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3Mzc0MjcwOSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvb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nQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY29udGVudCIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODczNzQyNzA5IiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ1BXKzZjbngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJHb1Vic1E9PSIsImV0YWciOiJDUFcrNmNueC9lRUNFQUU9In0=" - } - }, - { - "ID": "b4c8dedc10a69e07", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6ImltYWdlL2pwZWciLCJuYW1lIjoiY29udGVudCJ9Cg==", - "PGh0bWw+PGhlYWQ+PHRpdGxlPk15IGZpcnN0IHBhZ2U8L3RpdGxlPjwvaGVhZD48L2h0bWw+" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3198" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:34 GMT" - ], - "Etag": [ - "CM/Yjsrx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpC3UBVkNENjfRoaL2M1fPRh-iTDTwCsgF8O3TOX_iBuXcDxMjOoTmrIhD4cE5g1s7PObP66TZB1lecFypnLz8hL-aowsOxUMuL0KXJvrgoGxKHUFg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb250ZW50LzE1NTY4MzU4NzQzNTIyMDciLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb250ZW50IiwibmFtZSI6ImNvbnRlbnQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NDM1MjIwNyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbn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C5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6ImNvbnRlbnQiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NDM1MjIwNyIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNNL1lqc3J4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiR29VYnNRPT0iLCJldGFnIjoiQ00vWWpzcngvZUVDRUFFPSJ9" - } - }, - { - "ID": "c45640ec17230f64", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/content?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3198" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:34 GMT" - ], - "Etag": [ - "CM/Yjsrx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrvqLsOaMe2H6Xh3MyDCOuHmLzU1fn_Zh6kHLkpTpn4EWj3nFkeROu1g-cABD151cTh8YmY798iEku-Q3TnZIMZ5mexmHiCJKdUhAolbSd9b_apMK8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jb250ZW50LzE1NTY4MzU4NzQzNTIyMDciLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jb250ZW50IiwibmFtZSI6ImNvbnRlbnQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NDM1MjIwNyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoiaW1hZ2UvanBlZyIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDozNC4zNTFaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MzQuMzUxWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjM0LjM1MVoiLCJzaXplIjoiNTQiLCJtZDV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b20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNNL1lqc3J4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiR29VYnNRPT0iLCJldGFnIjoiQ00vWWpzcngvZUVDRUFFPSJ9" - } - }, - { - "ID": "752ab630b062d61e", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoiY3VzdG9tZXItZW5jcnlwdGlvbiJ9Cg==", - "dG9wIHNlY3JldC4=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3482" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:35 GMT" - ], - "Etag": [ - "CPjnucrx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpaWw6jJMKNOoCNMXwJNVVsxqzPhGfMo-5g3krJ7A8_PSGTx4W2OakfmtDvzOpg1hexLJcsWunNHfyWVXsjBpM58dtQlM6VucQW4Uxndlb9RIp0UhM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jdXN0b21lci1lbmNyeXB0aW9uLzE1NTY4MzU4NzUwNTg2ODAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jdXN0b21lci1lbmNyeXB0aW9uIiwibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NTA1ODY4MCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDozNS4wNThaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MzUuMDU4WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU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lcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6ImN1c3RvbWVyLWVuY3J5cHRpb24iLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NTA1ODY4MCIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNQam51Y3J4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoicjBOR3JnPT0iLCJldGFnIjoiQ1BqbnVjcngvZUVDRUFFPSIsImN1c3RvbWVyRW5jcnlwdGlvbiI6eyJlbmNyeXB0aW9uQWxnb3JpdGhtIjoiQUVTMjU2Iiwia2V5U2hhMjU2IjoiSCtMbW5YaFJvZUk2VE1XNWJzVjZIeVVrNnB5R2MySU1icVliQVhCY3BzMD0ifX0=" - } - }, - { - "ID": "3f4d8fd0e94ca6de", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3425" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:35 GMT" - ], - "Etag": [ - "CPjnucrx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoO-NbHUptMgzQPx9zApWGCeqMgfkk2mt6PJl1iWbq8ocUYq_0ud8gPuj9bcBTBOBdqewKzSouddziC-BFLoOdQJ6ElkN136q5y39ZRDN4zq6UWLUs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jdXN0b21lci1lbmNyeXB0aW9uLzE1NTY4MzU4NzUwNTg2ODAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jdXN0b21lci1lbmNyeXB0aW9uIiwibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NTA1ODY4MCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpb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bmNyeXB0aW9uL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY3VzdG9tZXItZW5jcnlwdGlvbiIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODc1MDU4NjgwIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ1BqbnVjcngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJldGFnIjoiQ1BqbnVjcngvZUVDRUFFPSIsImN1c3RvbWVyRW5jcnlwdGlvbiI6eyJlbmNyeXB0aW9uQWxnb3JpdGhtIjoiQUVTMjU2Iiwia2V5U2hhMjU2IjoiSCtMbW5YaFJvZUk2VE1XNWJzVjZIeVVrNnB5R2MySU1icVliQVhCY3BzMD0ifX0=" - } - }, - { - "ID": "0355971107342253", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3482" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:35 GMT" - ], - "Etag": [ - "CPjnucrx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UryZM2k28xNlFIDnXCH6SJ8RA2lDVNIx-5_eYRExB4-D1-dg_3fWvU3AREwoow4DvlYN4eyzA1AthWs5y0tYZEzvamBoZufkrXPmD64aT8kzAatns8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jdXN0b21lci1lbmNyeXB0aW9uLzE1NTY4MzU4NzUwNTg2ODAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jdXN0b21lci1lbmNyeXB0aW9uIiwibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwM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": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3448" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:36 GMT" - ], - "Etag": [ - "CPjnucrx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upnljw7UWMuKFeJUJp_gu-lyfzDRVTwgInddze_9zF5waX4glKKpcRrGpe50cvS8dV_xbbKLQa-CqAMVxlEp7qIHsmTdUR1amjrq0w9U_qrn4gYwSw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jdXN0b21lci1lbmNyeXB0aW9uLzE1NTY4Mz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pudWNyeC9lRUNFQUk9IiwiY3VzdG9tZXJFbmNyeXB0aW9uIjp7ImVuY3J5cHRpb25BbGdvcml0aG0iOiJBRVMyNTYiLCJrZXlTaGEyNTYiOiJIK0xtblhoUm9lSTZUTVc1YnNWNkh5VWs2cHlHYzJJTWJxWWJBWEJjcHMwPSJ9fQ==" - } - }, - { - "ID": "fc766ddbbfcd9d8a", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3505" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:36 GMT" - ], - "Etag": [ - "CPjnucrx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqlTuEeQHkdcuHKu_aWtuYjopXaORKyG9TF597i1ybzIPgJHE_oiKH-xYwG_D2txhF_Sv6Jzfy44Dfga1bINCpPLseDEeD_Ez4rvxx8baTX1uJ7lJo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jdXN0b21lci1lbmNyeXB0aW9uLzE1NTY4MzU4NzUwNTg2ODAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jdXN0b21lci1lbmNyeXB0aW9uIiwibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg3NTA1ODY4MCIsIm1ldGFnZW5lcmF0aW9uIjoiMyIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDozNS4wNThaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MzYuMjI1WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjM1LjA1OFoiLCJzaXplIjoiMTEiLCJtZDVIYXNoIjoieHdXTkZhMFZkWFBtbEF3cmxjQUpjZz09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tZXItZW5jcnlwdGlvbiIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODc1MDU4NjgwIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ1BqbnVjcngvZUVDRUFNPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJyME5Hcmc9PSIsImV0YWciOiJDUGpudWNyeC9lRUNFQU09IiwiY3VzdG9tZXJFbmNyeXB0aW9uIjp7ImVuY3J5cHRpb25BbGdvcml0aG0iOiJBRVMyNTYiLCJrZXlTaGEyNTYiOiJIK0xtblhoUm9lSTZUTVc1YnNWNkh5VWs2cHlHYzJJTWJxWWJBWEJjcHMwPSJ9fQ==" - } - }, - { - "ID": "fb1e502029272329", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "277" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:36 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:36 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urm5pF1ghApp-RiVg_TAipd-LdTbF-hcDPcVRYbmj7KUIQxnsMUF5WOcrMA1t7ZltdvPZhyfsELISuH6DGJlUUedaCNH-B5j580GjBYLUKCwmAADeM" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+UmVzb3VyY2VJc0VuY3J5cHRlZFdpdGhDdXN0b21lckVuY3J5cHRpb25LZXk8L0NvZGU+PE1lc3NhZ2U+VGhlIHJlc291cmNlIGlzIGVuY3J5cHRlZCB3aXRoIGEgY3VzdG9tZXIgZW5jcnlwdGlvbiBrZXkuPC9NZXNzYWdlPjxEZXRhaWxzPlRoZSByZXF1ZXN0ZWQgb2JqZWN0IGlzIGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LjwvRGV0YWlscz48L0Vycm9yPg==" - } - }, - { - "ID": "c151ba4fab0c6499", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Language": [ - "en" - ], - "Content-Length": [ - "11" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:36 GMT" - ], - "Etag": [ - "\"-CPjnucrx/eECEAM=\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:35 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:35 GMT" - ], - "X-Goog-Generation": [ - "1556835875058680" - ], - "X-Goog-Hash": [ - "crc32c=r0NGrg==", - "md5=xwWNFa0VdXPmlAwrlcAJcg==" - ], - "X-Goog-Metageneration": [ - "3" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "11" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur68mIGQ8VAtTRZs4F6ixZZYKcqe1oTqWHWqmp7gNF-81XKf2xX6eS4PcegbKx7bYnb4i6dzTCoLlbaJRNHwwLVzNbYMkGNy_bTHbWYTgtlBSKVtWs" - ] - }, - "Body": "dG9wIHNlY3JldC4=" - } - }, - { - "ID": "e09c6326cc60ad82", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12563" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:36 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqldLQvGKuu2fihIdwh7CvU7W0yE3vUXu8jqefTPSMhlGgvR1EfeYFqjk_Zxj7fEpv7AjugvHnn1DmkJxJWhrZyM8b5gS4uJID92D_018h2YHH1r30" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlc291cmNlSXNFbmNyeXB0ZWRXaXRoQ3VzdG9tZXJFbmNyeXB0aW9uS2V5IiwibWVzc2FnZSI6IlRoZSB0YXJnZXQgb2JqZWN0IGlzIGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LiIsImV4dGVuZGVkSGVscCI6Imh0dHBzOi8vY2xvdWQuZ29vZ2xlLmNvbS9zdG9yYWdlL2RvY3MvZW5jcnlwdGlvbiNjdXN0b21lci1zdXBwbGllZF9lbmNyeXB0aW9uX2tleXMiLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuU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XRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJUaGUgdGFyZ2V0IG9iamVjdCBpcyBlbmNyeXB0ZWQgYnkgYSBjdXN0b21lci1zdXBwbGllZCBlbmNyeXB0aW9uIGtleS4ifX0=" - } - }, - { - "ID": "6c83b36cc6fc482c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Copy-Source-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Copy-Source-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Copy-Source-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3527" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader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ZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY3VzdG9tZXItZW5jcnlwdGlvbi0yIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NzcxMDg2MTQiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSWIzdHN2eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6InIwTkdyZz09IiwiZXRhZyI6IkNJYjN0c3Z4L2VFQ0VBRT0ifX0=" - } - }, - { - "ID": "e499f3b7077fb222", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption-2", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Language": [ - "en" - ], - "Content-Length": [ - "11" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:37 GMT" - ], - "Etag": [ - "\"c7058d15ad157573e6940c2b95c00972\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:37 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:37 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:37 GMT" - ], - "X-Goog-Generation": [ - "1556835877108614" - ], - "X-Goog-Hash": [ - "crc32c=r0NGrg==", - "md5=xwWNFa0VdXPmlAwrlcAJcg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "11" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpfEf1WUM8E5dSmOe1sOfgheagnlrcFUolvMMBiP6jDvPqoS7Sx0IwklM-DwnuAbBJPQ_EHhX-42njQu9vUjXqamH1U6np0Vmi0BngqFYOTc9MVP3M" - ] - }, - "Body": "dG9wIHNlY3JldC4=" - } - }, - { - "ID": "9e67dfa901c4e619", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "FnBvfQ1dDsyS8kHD+aB6HHIglDoQ5Im7WYDm3XYTGrQ=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12563" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:37 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoYPZ-j39Sr1Whn6F3PYeVaxqIIjS_fBgSNkBO7f7B8RMWih6iCCLf1cPDXB3Br-0XBkdm6i9N9fGeK84_laVYWuJc0uJwSCXydk0bSWezw0qec5yE" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlc291cmNlSXNFbmNyeXB0ZWRXaXRoQ3VzdG9tZXJFbmNyeXB0aW9uS2V5IiwibWVzc2FnZSI6IlRoZSB0YXJnZXQgb2JqZWN0IGlzIGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LiIsImV4dGVuZGVkSGVscCI6Imh0dHBzOi8vY2xvdWQuZ29vZ2xlLmNvbS9zdG9yYWdlL2RvY3MvZW5jcnlwdGlvbiNjdXN0b21lci1zdXBwbGllZF9lbmNyeXB0aW9uX2tleXMiLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6UkVTT1VSQ0VfSVNfRU5DUllQVEVEX1dJVEhfQ1VTVE9NRVJfRU5DUllQVElPTl9LRVlcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRp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0b21lci1zdXBwbGllZCBlbmNyeXB0aW9uIGtleS4ifX0=" - } - }, - { - "ID": "670f74ac2a0b734e", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Copy-Source-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Copy-Source-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Copy-Source-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "FnBvfQ1dDsyS8kHD+aB6HHIglDoQ5Im7WYDm3XYTGrQ=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3640" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:38 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid":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ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY3VzdG9tZXItZW5jcnlwdGlvbi0yIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4NzgxODMyNTEiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTlBDK012eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6InIwTkdyZz09IiwiZXRhZyI6IkNOUEMrTXZ4L2VFQ0VBRT0iLCJjdXN0b21lckVuY3J5cHRpb24iOnsiZW5jcnlwdGlvbkFsZ29yaXRobSI6IkFFUzI1NiIsImtleVNoYTI1NiI6IkZuQnZmUTFkRHN5UzhrSEQrYUI2SEhJZ2xEb1E1SW03V1lEbTNYWVRHclE9In19fQ==" - } - }, - { - "ID": "9c6e7ad2d8e2c68a", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption-2", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "277" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:38 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:38 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoSrQtDkljyQ-aUJoC8m6nY20wZiHLTwh4znEZ5hyKxLQUrZIi7PnU416twfTwfPXWvd4cPGZC3NVdpJWg332KnUKSEdFPY2BQwLJ-_9S5eVdwMrf8" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+UmVzb3VyY2VJc0VuY3J5cHRlZFdpdGhDdXN0b21lckVuY3J5cHRpb25LZXk8L0NvZGU+PE1lc3NhZ2U+VGhlIHJlc291cmNlIGlzIGVuY3J5cHRlZCB3aXRoIGEgY3VzdG9tZXIgZW5jcnlwdGlvbiBrZXkuPC9NZXNzYWdlPjxEZXRhaWxzPlRoZSByZXF1ZXN0ZWQgb2JqZWN0IGlzIGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LjwvRGV0YWlscz48L0Vycm9yPg==" - } - }, - { - "ID": "b5fbec9f26148f95", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption-2", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "FnBvfQ1dDsyS8kHD+aB6HHIglDoQ5Im7WYDm3XYTGrQ=" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Language": [ - "en" - ], - "Content-Length": [ - "11" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:38 GMT" - ], - "Etag": [ - "\"-CNPC+Mvx/eECEAE=\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:38 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key-Sha256": [ - "FnBvfQ1dDsyS8kHD+aB6HHIglDoQ5Im7WYDm3XYTGrQ=" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:38 GMT" - ], - "X-Goog-Generation": [ - "1556835878183251" - ], - "X-Goog-Hash": [ - "crc32c=r0NGrg==", - "md5=xwWNFa0VdXPmlAwrlcAJcg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "11" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpTr8Qws5nL-el_ied6M7FYtryiLpFfhGNN-TxakIl1FCAOBJwMeq6_KBQ0l4UmT8VePQQ9h_S8r55NolBB1Ex12-iKvooCkTsNmvQ4rE4hOqQGbLc" - ] - }, - "Body": "dG9wIHNlY3JldC4=" - } - }, - { - "ID": "616de25561ebbffa", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Copy-Source-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Copy-Source-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Copy-Source-Encryption-Key-Sha256": [ - "FnBvfQ1dDsyS8kHD+aB6HHIglDoQ5Im7WYDm3XYTGrQ=" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3640" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:39 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqyD8XYw6tgOBbcxdUIVAw_vXrrryw0bgh-L-jRW0hyJt0lCHU9K26isn6tykgml7UgX52dgw65xD_ht4yxbHkY_VFl6MkEY6H-mWRx0_52xj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GlvbiI6IjE1NTY4MzU4Nzg5OTg1MTEiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTytqcXN6eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6InIwTkdyZz09IiwiZXRhZyI6IkNPK2pxc3p4L2VFQ0VBRT0iLCJjdXN0b21lckVuY3J5cHRpb24iOnsiZW5jcnlwdGlvbkFsZ29yaXRobSI6IkFFUzI1NiIsImtleVNoYTI1NiI6IkgrTG1uWGhSb2VJNlRNVzVic1Y2SHlVazZweUdjMklNYnFZYkFYQmNwczA9In19fQ==" - } - }, - { - "ID": "2ddf1402c6efc3a8", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-3/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "160" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24ifSx7Im5hbWUiOiJjdXN0b21lci1lbmNyeXB0aW9uLTIifV19Cg==" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13334" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:39 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrFitgTFIY6yt8kk3zprPGtWncWc7Ad6oUFVXVdE0O3QqK0qlYGB7RSw-dwN1AvMk4Sndi8gR22cF8qs88ZlmdAxB-1zYdUNqwArmpP2xni66xX-L4" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlc291cmNlSXNFbmNyeXB0ZWRXaXRoQ3VzdG9tZXJFbmNyeXB0aW9uS2V5IiwibWVzc2FnZSI6IlRoZSB0YXJnZXQgb2JqZWN0IGlzIGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LiIsImV4dGVuZGVkSGVscCI6Imh0dHBzOi8vY2xvdWQuZ29vZ2xlLmNvbS9zdG9yYWdlL2RvY3MvZW5jcnlwdGlvbiNjdXN0b21lci1zdXBwbGllZF9lbmNyeXB0aW9uX2tleXMiLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6UkVTT1VSQ0VfSVNfRU5DUllQVEVEX1dJVEhfQ1VTVE9NRVJfRU5DUllQVElPTl9LRVk6IENvbXBvbmVudCBvYmplY3QgKGdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA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3c7e89", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-3/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "160" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24ifSx7Im5hbWUiOiJjdXN0b21lci1lbmNyeXB0aW9uLTIifV19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "911" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:39 GMT" - ], - "Etag": [ - "CPDp3szx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uotyvz71ZfU1J_hl3NsDz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0MCZhbHQ9bWVkaWEiLCJjcmMzMmMiOiI1ajF5cGc9PSIsImNvbXBvbmVudENvdW50IjoyLCJldGFnIjoiQ1BEcDNzengvZUVDRUFFPSIsImN1c3RvbWVyRW5jcnlwdGlvbiI6eyJlbmNyeXB0aW9uQWxnb3JpdGhtIjoiQUVTMjU2Iiwia2V5U2hhMjU2IjoiSCtMbW5YaFJvZUk2VE1XNWJzVjZIeVVrNnB5R2MySU1icVliQVhCY3BzMD0ifX0=" - } - }, - { - "ID": "b19fb82ecf450b51", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption-3", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "277" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:40 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:40 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urcj3TJ6B5h4Q0DT7G_ioI_Icu9iv65m57OlRH6h9mKD9zZZl320H3QD6A7fNd1UPBSGGDZ9I0TG4_lSFa8JgkJQEVRGVRvVQv36b7ArCuGmg0loV0" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+UmVzb3VyY2VJc0VuY3J5cHRlZFdpdGhDdXN0b21lckVuY3J5cHRpb25LZXk8L0NvZGU+PE1lc3NhZ2U+VGhlIHJlc291cmNlIGlzIGVuY3J5cHRlZCB3aXRoIGEgY3VzdG9tZXIgZW5jcnlwdGlvbiBrZXkuPC9NZXNzYWdlPjxEZXRhaWxzPlRoZSByZXF1ZXN0ZWQgb2JqZWN0IGlzIGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LjwvRGV0YWlscz48L0Vycm9yPg==" - } - }, - { - "ID": "1f0a12bd00a88965", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/customer-encryption-3", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "22" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:24:40 GMT" - ], - "Etag": [ - "\"-CPDp3szx/eECEAE=\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:39 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Component-Count": [ - "2" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:24:39 GMT" - ], - "X-Goog-Generation": [ - "1556835879859440" - ], - "X-Goog-Hash": [ - "crc32c=5j1ypg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "22" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur7DoEkjdrkGGrYpsCDbd2Y6c_Mu8sEA7cN_k06l4WjY25UJsijDFWSlSIA9SCi-ouLuI3if4Rh33a5n5vKcN3oSYjzK92eSPVCczEpQdILKFWyQh4" - ] - }, - "Body": "dG9wIHNlY3JldC50b3Agc2VjcmV0Lg==" - } - }, - { - "ID": "f649a81672a92823", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Copy-Source-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Copy-Source-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Copy-Source-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3527" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:40 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrfhqrYGhW8ew5dxbfg_DcMhaJh6k2oY_JqMwPRSDtS3Ef5kljeo8oTONrxRIAP8I0ScqxFCy7okNejkqOeO4Vr1TBZ2mc4MDjwiJA52ERSgZMUyvM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNyZXdyaXRlUmVzcG9uc2UiLCJ0b3RhbEJ5dGVzUmV3cml0dGVuIjoiMTEiLCJvYmplY3RTaXplIjoiMTEiLCJkb25lIjp0cnVlLCJyZXNvdXJjZSI6eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jdXN0b21lci1lbmNyeXB0aW9uLTIvMTU1NjgzNTg4MDcxNzUwNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2N1c3RvbWVyLWVuY3J5cHRpb24tMiIsIm5hbWUiOiJjdXN0b21lci1lbmNyeXB0aW9uLTIiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMy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TIvMTU1NjgzNTg4MDcxNzUwNi91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vY3VzdG9tZXItZW5jcnlwdGlvbi0yL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiY3VzdG9tZXItZW5jcnlwdGlvbi0yIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4ODA3MTc1MDYiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTUtaazgzeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6InIwTkdyZz09IiwiZXRhZyI6IkNNS1prODN4L2VFQ0VBRT0ifX0=" - } - }, - { - "ID": "61763fd57e906039", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-3/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "129" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "H+LmnXhRoeI6TMW5bsV6HyUk6pyGc2IMbqYbAXBcps0=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImN1c3RvbWVyLWVuY3J5cHRpb24tMiJ9XX0K" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13444" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:41 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur7TRBQyfrSgWnsPL0CVfQCd5s_QJN9pRUHB1YttIoObh1YkzCEtuRxrwyKYtccpyodUCMmTVRyD6d0oDy-c2_Q7GK-_6OC5h_EF_1e9-t6E8VZCQ8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlc291cmNlTm90RW5jcnlwdGVkV2l0aEN1c3RvbWVyRW5jcnlwdGlvbktleSIsIm1lc3NhZ2UiOiJUaGUgdGFyZ2V0IG9iamVjdCBpcyBub3QgZW5jcnlwdGVkIGJ5IG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ZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDAwLCJtZXNzYWdlIjoiVGhlIHRhcmdldCBvYmplY3QgaXMgbm90IGVuY3J5cHRlZCBieSBhIGN1c3RvbWVyLXN1cHBsaWVkIGVuY3J5cHRpb24ga2V5LiJ9fQ==" - } - }, - { - "ID": "b45cb452c78d7b50", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:41 GMT" - ], - "Etag": [ - "CAo=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:41 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq2YnotZtU1JMnJw10vtgVDeukiWK_4DXx0QFWA91CaCYLPXLDKzCzY8xqb6EGkVxvw731As27REu_hYOqZTwSfJJ6SeHemliLV9JgQYjfngxL0HFA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDoyOC44ODJaIiwibWV0YWdlbmVyYXRpb24iOiIxMCIsImFjbCI6W3sia2luZCI6InN0b3JhZ2UjYnVja2V0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL3Byb2plY3Qtb3duZXJzLTQ5NjE2OTYwMTcxNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIw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icHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJ2aWV3ZXJzIn0sImV0YWciOiJDQW89In1dLCJpYW1Db25maWd1cmF0aW9uIjp7ImJ1Y2tldFBvbGljeU9ubHkiOnsiZW5hYmxlZCI6ZmFsc2V9fSwib3duZXIiOnsiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0In0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOmZhbHNlfSwibGlmZWN5Y2xlIjp7InJ1bGUiOlt7ImFjdGlvbiI6eyJ0eXBlIjoiRGVsZXRlIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjMwfX1dfSwibGFiZWxzIjp7Im5ldyI6Im5ldyIsImwxIjoidjIifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FvPSJ9" - } - }, - { - "ID": "6831287fd0edbcd4", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoicG9zYyJ9Cg==", - "Zm9v" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3128" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:42 GMT" - ], - "Etag": [ - "CJek2c3x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrXGhYaqbrodjXeCKtZGAt0hM0GrM8GBcZBkGkLJ7550-Iqaxp681SkhDDDOp0V3-xMmoq3rjWOC8A4XvJfAzgxGsO2VekCUJgUBMalL8hEAur49q8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9wb3NjLzE1NTY4MzU4ODE4NjU3NTEiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9wb3NjIiwibmFtZSI6InBvc2MiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4MTg2NTc1MSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo0MS44NjVaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6NDEuODY1WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0Z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ci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0plazJjM3gvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJ6OFN1SFE9PSIsImV0YWciOiJDSmVrMmMzeC9lRUNFQUU9In0=" - } - }, - { - "ID": "7588cdc84e3976f4", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/posc?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3128" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:42 GMT" - ], - "Etag": [ - "CJek2c3x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpGBHQWnSHLUYlW5nck2w_3QN4x5uYmOM-GIatNzD1tqhzK0JOf7rBe1BKILpdyEUPlSmrLwrukcqJwHgfezE50OQL7ha9n6_fc6qUMoVwk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mplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvcG9zYy8xNTU2ODM1ODgxODY1NzUxL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9wb3NjL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoicG9zYyIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODgxODY1NzUxIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0plazJjM3gvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJ6OFN1SFE9PSIsImV0YWciOiJDSmVrMmMzeC9lRUNFQUU9In0=" - } - }, - { - "ID": "974ed1b42608e806", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/posc/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/posc?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "34" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJzdG9yYWdlQ2xhc3MiOiJNVUxUSV9SRUdJT05BTCJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:42 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrKCtuc_GsAj6sf3zXpqT2_KZrdL0SEwsunv07k0DaaEHMj8gkX4kRCcm5r8AUrD9RNYjoKeceiCyY4pDN8nrHljshmEIXF2P29Oyd0KSuqDjsNeps" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNyZXdyaXRlUmVzcG9uc2UiLCJ0b3RhbEJ5dGVzUmV3cml0dGVuIjoiMyIsIm9iamVjdFNpemUiOiIzIiwiZG9uZSI6dHJ1ZSwicmVzb3VyY2UiOnsia2luZCI6InN0b3JhZ2Ujb2JqZWN0IiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvcG9zYy8xNTU2ODM1ODg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GVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vcG9zYy9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6InBvc2MiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4Mjc2MDYwNyIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNKL3pqODd4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiejhTdUhRPT0iLCJldGFnIjoiQ0ovemo4N3gvZUVDRUFFPSJ9fQ==" - } - }, - { - "ID": "a2be30bf1e3cb539", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoicG9zYzIiLCJzdG9yYWdlQ2xhc3MiOiJNVUxUSV9SRUdJT05BTCJ9Cg==", - "eHh4" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3150" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:43 GMT" - ], - "Etag": [ - "CILrp87x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqziYHpTkcbyMFRtHko_e04Rze8FHLbALw476U2bB9k_SqPwILBzxKRLzFvRN4q3RLt4xR1mpR2lgJ1Zq0BNYCefLOZsOeq4JbzJYLxGL5V799xkQ8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9wb3NjMi8xNTU2ODM1ODgzMTUyNzcwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vcG9zYzIiLCJuYW1lIjoicG9zYzIiLCJidWNrZXQiOiJnby1pbnRlZ3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XRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL3Bvc2MyL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoicG9zYzIiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4MzE1Mjc3MCIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNJTHJwODd4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiMTdxQUJRPT0iLCJldGFnIjoiQ0lMcnA4N3gvZUVDRUFFPSJ9" - } - }, - { - "ID": "d570e13411ade628", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoiYnVja2V0SW5Db3B5QXR0cnMifQo=", - "Zm9v" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3336" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:43 GMT" - ], - "Etag": [ - "CPCDx87x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrltsLp6xgl5GQBA_ZoqyMKcRlP-MvWyo0epRXUAbOAkOUUpAOgezp4fFQRP5wEM1fq771AWUgtYvQ3HLXCnwxmDaCqJxEhICiYhxDp8RpvCnn3xuI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9idWNrZXRJbkNvcHlBdHRycy8xNTU2ODM1ODgzNjYzODU2Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vYnVja2V0SW5Db3B5QXR0cnMiLCJuYW1lIjoiYnVja2V0SW5Db3B5QXR0cnMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4MzY2Mzg1NiIsIm1ldGFnZW5l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jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2J1Y2tldEluQ29weUF0dHJzL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiYnVja2V0SW5Db3B5QXR0cnMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4MzY2Mzg1NiIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNQQ0R4ODd4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiejhTdUhRPT0iLCJldGFnIjoiQ1BDRHg4N3gvZUVDRUFFPSJ9" - } - }, - { - "ID": "284a06aa5d3f4c0f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/bucketInCopyAttrs/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/bucketInCopyAttrs?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "62" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEifQo=" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "2972" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:43 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqEuzT5vUHzBcQTT84B5lbxQRZ8Wazbvf7pARGdim0OKOWWM6MdR9KrH11f9w9bxrybc2YHzoveHnAwpEgFzwUcXlLN8xDttCt9pwOnPMX3My8utXg" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IlJlcXVpcmVkIiwiZGVidWdJbmZvIjoiY29tLmdvb2dsZS5hcGkuc2VydmVyLmNvcmUuRmF1bHQ6IEltbXV0YWJsZUVycm9yRGVmaW5pdGlvbntiYXNlPVJFUVVJUkVELCBjYXRlZ29yeT1VU0VSX0VSUk9SLCBjYXVzZT1udWxsLCBkZWJ1Z0luZm89bnVsbCwgZG9tYWluPWdsb2JhbCwgZXh0ZW5kZWRIZWxwPW51bGwsIGh0dHBIZWFkZXJzPXt9LCBodHRwU3RhdHVzPWJhZFJlcXVlc3QsIGludGVybmFsUmVhc29uPVJlYXNvbnthcmd1bWVudHM9e30sIGNhdXNlPW51bGwsIGNvZGU9Z2RhdGEuQ29yZUVycm9yRG9tYWluLlJFUVVJUkVELCBjcmVhdGVkQnlCYWNrZW5kPXRydWU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VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDAwLCJtZXNzYWdlIjoiUmVxdWlyZWQifX0=" - } - }, - { - "ID": "631a4dc25c1479df", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjcmMzMmMiOiJjSCtBK3c9PSIsIm5hbWUiOiJoYXNoZXNPblVwbG9hZC0xIn0K", - "SSBjYW4ndCB3YWl0IHRvIGJlIHZlcmlmaWVk" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3321" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:44 GMT" - ], - "Etag": [ - "CIes587x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up5pzFgsk-trM6xfNGHCutAafrBhKStla4toQDjvEsTPe4TTesYnwc0KLg9WK95RXOKqdm_KUngd4hv6Tucfns_MALlJyx1s6A2cZR3vco6jKPTW00" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9oYXNoZXNPblVwbG9hZC0xLzE1NTY4MzU4ODQxOTMyODciLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9oYXNoZXNPblVwbG9hZC0xIiwibmFtZSI6Imhhc2hlc09uVXBsb2FkLTEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4NDE5MzI4NyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo0NC4xOTJaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6NDQuMTkyWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjQ0LjE5MloiLCJzaXplIjoiMjciLCJtZDVIYXNoIjoib2ZaakdsY1hQSmlHT0FmS0ZiSmwxUT09IiwibWVkaWFMaW5rIjoiaHR0cHM6Ly93d3cuZ29v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Rib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNJZXM1ODd4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiY0grQSt3PT0iLCJldGFnIjoiQ0llczU4N3gvZUVDRUFFPSJ9" - } - }, - { - "ID": "e60d42eeeafea205", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjcmMzMmMiOiJjSCtBL0E9PSIsIm5hbWUiOiJoYXNoZXNPblVwbG9hZC0xIn0K", - "SSBjYW4ndCB3YWl0IHRvIGJlIHZlcmlmaWVk" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "3301" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:44 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rej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vbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJQcm92aWRlZCBDUkMzMkMgXCJjSCtBL0E9PVwiIGRvZXNuJ3QgbWF0Y2ggY2FsY3VsYXRlZCBDUkMzMkMgXCJjSCtBK3c9PVwiLiJ9fQ==" - } - }, - { - "ID": "5a293e6162b30ef3", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoiaGFzaGVzT25VcGxvYWQtMSJ9Cg==", - "SSBjYW4ndCB3YWl0IHRvIGJlIHZlcmlmaWVk" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3321" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:44 GMT" - ], - "Etag": [ - "CJuDg8/x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqgpXYBQOYHYXTQAVb7IGna0BRqHaB7oBdZ19frcgAVGErLbEHe3bESKZ7zKSO6r0AtvqwfCEuJty95EeD5MkwqIsXbr88YcTG0j7M-g4yTKkejukI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9oYXNoZXNPblVwbG9hZC0xLzE1NTY4MzU4ODQ2NDY4MTEiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9oYXNoZXNPblVwbG9hZC0xIiwibmFtZSI6Imhhc2hlc09uVXBsb2FkLTEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4NDY0NjgxMSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo0NC42NDZaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6NDQuNjQ2WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjQ0LjY0NloiLCJzaXplIjoiMjciLCJtZD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W5lcmF0aW9uIjoiMTU1NjgzNTg4NDY0NjgxMSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNKdURnOC94L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiY0grQSt3PT0iLCJldGFnIjoiQ0p1RGc4L3gvZUVDRUFFPSJ9" - } - }, - { - "ID": "19f19648f1196c10", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJtZDVIYXNoIjoib2ZaakdsY1hQSmlHT0FmS0ZiSmwxUT09IiwibmFtZSI6Imhhc2hlc09uVXBsb2FkLTEifQo=", - "SSBjYW4ndCB3YWl0IHRvIGJlIHZlcmlmaWVk" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3321" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:45 GMT" - ], - "Etag": [ - "CKDem8/x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqAmKuvPxUsjTHDB5nMuNG92dU0gql0Yol2zlvPDWEDuXHQRLhOJzYBAH207Ot-_IB22pH5QSfTaTayqEWBUfkobCR9YGVa79W0LG4fv9fnAjxk5Cs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9oYXNoZXNPblVwbG9hZC0xLzE1NTY4MzU4ODUwNTE2ODAiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9oYXNoZXNPblVwbG9hZC0xIiwibmFtZSI6Imhhc2hlc09uVXBsb2FkLTEiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4NTA1MTY4MCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo0NS4wNTFaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ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ZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6Imhhc2hlc09uVXBsb2FkLTEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg4NTA1MTY4MCIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNLRGVtOC94L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiY0grQSt3PT0iLCJldGFnIjoiQ0tEZW04L3gvZUVDRUFFPSJ9" - } - }, - { - "ID": "880416f9891fc25f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJtZDVIYXNoIjoib3ZaakdsY1hQSmlHT0FmS0ZiSmwxUT09IiwibmFtZSI6Imhhc2hlc09uVXBsb2FkLTEifQo=", - "SSBjYW4ndCB3YWl0IHRvIGJlIHZlcmlmaWVk" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "3515" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:45 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoFC5_DRlr9xktR_eWpfuFqiZRbenVOATtUEg3tfJC8JbCqagKQzn0_sYLvxvG52ordbl2Nwo0L6Y0AbwuenLAo1uoX4uzHnro-JiY8MkdQEsO3uSA" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImludmFsaWQiLCJtZXNzYWdlIjoiUHJvdmlkZWQgTUQ1IGhhc2ggXCJvdlpqR2xjWFBKaUdPQWZLRmJKbDFRPT1cIiBkb2Vzbid0IG1hdGNoIGNhbGN1bGF0ZWQgTUQ1IGhhc2ggXCJvZlpqR2xjWFBKaUdPQWZLRmJKbDFRPT1cIi4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLmFwaS5zZXJ2ZXIuY29yZS5GYXVsdDogSW1tdXRhYmxlRXJyb3JEZWZpbml0aW9ue2Jhc2U9SU5WQUxJRF9WQUxVRSwgY2F0ZWdvcnk9VVNFUl9FUlJPUiwgY2F1c2U9bnVsbCwgZGVidWdJbmZvPW51bGwsIGRvbWFpbj1nbG9iYWwsIGV4dGVuZGVkSGVscD1udWxsLCBodHRwSGVhZGVycz17fSwgaHR0cFN0YXR1cz1iYWRSZXF1ZXN0LCBpbnRlcm5hbFJlYXNvbj1SZWFzb257YXJndW1lbnRzPXt9LCBjYXVzZT1udWxsLCBjb2RlPWdkYXRhLkNvcmV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E6NDYwKVxuXHRhdCBpby5ncnBjLkNvbnRleHQucnVuKENvbnRleHQuamF2YTo1NjUpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5DdXJyZW50Q29udGV4dC5ydW5JbkNvbnRleHQoQ3VycmVudENvbnRleHQuamF2YToyMDQpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDAwLCJtZXNzYWdlIjoiUHJvdmlkZWQgTUQ1IGhhc2ggXCJvdlpqR2xjWFBKaUdPQWZLRmJKbDFRPT1cIiBkb2Vzbid0IG1hdGNoIGNhbGN1bGF0ZWQgTUQ1IGhhc2ggXCJvZlpqR2xjWFBKaUdPQWZLRmJKbDFRPT1cIi4ifX0=" - } - }, - { - "ID": "e1a7bef7c2f0f7b9", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/iam?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "341" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:45 GMT" - ], - "Etag": [ - "CAo=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:45 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrDioJ0fktjtyI_mABE4-oH9KqDlurM5mWiYDhoDp_LRJYSPvDxjuoaYzNhjoTHdHPALySTzCxScTstm27R-praR27EAm4Gx9k3wHAAwKJUptqRnFE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNwb2xpY3kiLCJyZXNvdXJjZUlkIjoicHJvamVjdHMvXy9idWNrZXRzL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImJpbmRpbmdzIjpbeyJyb2xlIjoicm9sZXMvc3RvcmFnZS5sZWdhY3lCdWNrZXRPd25lciIsIm1lbWJlcnMiOlsicHJvamVjdEVkaXRvcjpkZWtsZXJrLXNhbmRib3giLCJwcm9qZWN0T3duZXI6ZGVrbGVyay1zYW5kYm94Il19LHsicm9sZSI6InJvbGVzL3N0b3JhZ2UubGVnYWN5QnVja2V0UmVhZGVyIiwibWVtYmVycyI6WyJwcm9qZWN0Vmlld2VyOmRla2xlcmstc2FuZGJveCJdfV0sImV0YWciOiJDQW89In0=" - } - }, - { - "ID": "df5371a2b0cd8c3b", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/iam?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "317" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJiaW5kaW5ncyI6W3sibWVtYmVycyI6WyJwcm9qZWN0RWRpdG9yOmRla2xlcmstc2FuZGJveCIsInByb2plY3RPd25lcjpkZWtsZXJrLXNhbmRib3giXSwicm9sZSI6InJvbGVzL3N0b3JhZ2UubGVnYWN5QnVja2V0T3duZXIifSx7Im1lbWJlcnMiOlsicHJvamVjdFZpZXdlcjpkZWtsZXJrLXNhbmRib3giXSwicm9sZSI6InJvbGVzL3N0b3JhZ2UubGVnYWN5QnVja2V0UmVhZGVyIn0seyJtZW1iZXJzIjpbInByb2plY3RWaWV3ZXI6ZGVrbGVyay1zYW5kYm94Il0sInJvbGUiOiJyb2xlcy9zdG9yYWdlLm9iamVjdFZpZXdlciJ9XSwiZXRhZyI6IkNBbz0ifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "423" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:46 GMT" - ], - "Etag": [ - "CAs=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrAVgetrpv1xjtKv2B7KFBdnbg20V-btiRn3sD4kQF7shWIQ1-FqJMRsbYfcYJyTMQHv_BhW_eVzvcc56z0LOcYfE-wbCRZpqYjen6c-bVcMzPet2A" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNwb2xpY3kiLCJyZXNvdXJjZUlkIjoicHJvamVjdHMvXy9idWNrZXRzL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImJpbmRpbmdzIjpbeyJyb2xlIjoicm9sZXMvc3RvcmFnZS5sZWdhY3lCdWNrZXRPd25lciIsIm1lbWJlcnMiOlsicHJvamVjdEVkaXRvcjpkZWtsZXJrLXNhbmRib3giLCJwcm9qZWN0T3duZXI6ZGVrbGVyay1zYW5kYm94Il19LHsicm9sZSI6InJvbGVzL3N0b3JhZ2UubGVnYWN5QnVja2V0UmVhZGVyIiwibWVtYmVycyI6WyJwcm9qZWN0Vmlld2VyOmRla2xlcmstc2FuZGJveCJdfSx7InJvbGUiOiJyb2xlcy9zdG9yYWdlLm9iamVjdFZpZXdlciIsIm1lbWJlcnMiOlsicHJvamVjdFZpZXdlcjpkZWtsZXJrLXNhbmRib3giXX1dLCJldGFnIjoiQ0FzPSJ9" - } - }, - { - "ID": "feaa4b1a4dda0450", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/iam?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "423" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:46 GMT" - ], - "Etag": [ - "CAs=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:46 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqwMVZVQQ8s-ZBUJDLKyC-qMMTANncoBhRQWlMCITVUXQrTnFGGxu4GdKyVcuudrSa-DWy5w5iLE-i4a407GopUNma3xIq1eNiyVAziPD7jQ4YluzA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNwb2xpY3kiLCJyZXNvdXJjZUlkIjoicHJvamVjdHMvXy9idWNrZXRzL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImJpbmRpbmdzIjpbeyJyb2xlIjoicm9sZXMvc3RvcmFnZS5sZWdhY3lCdWNrZXRPd25lciIsIm1lbWJlcnMiOlsicHJvamVjdEVkaXRvcjpkZWtsZXJrLXNhbmRib3giLCJwcm9qZWN0T3duZXI6ZGVrbGVyay1zYW5kYm94Il19LHsicm9sZSI6InJvbGVzL3N0b3JhZ2UubGVnYWN5QnVja2V0UmVhZGVyIiwibWVtYmVycyI6WyJwcm9qZWN0Vmlld2VyOmRla2xlcmstc2FuZGJveCJdfSx7InJvbGUiOiJyb2xlcy9zdG9yYWdlLm9iamVjdFZpZXdlciIsIm1lbWJlcnMiOlsicHJvamVjdFZpZXdlcjpkZWtsZXJrLXNhbmRib3giXX1dLCJldGFnIjoiQ0FzPSJ9" - } - }, - { - "ID": "23d94c8a09c0c334", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/iam/testPermissions?alt=json\u0026permissions=storage.buckets.get\u0026permissions=storage.buckets.delete\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "108" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:46 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:46 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoR-XKWu9nOWmFZve2-NeDyDvZDo5rYpPD3avVEmZkZ-lODvHCSR0D7zdPeCa61L5EtOIYJBqmC0D9Xc229A1GDS5d91vgAGuzRoxRnNa9DjBw68xM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSN0ZXN0SWFtUGVybWlzc2lvbnNSZXNwb25zZSIsInBlcm1pc3Npb25zIjpbInN0b3JhZ2UuYnVja2V0cy5nZXQiLCJzdG9yYWdlLmJ1Y2tldHMuZGVsZXRlIl19" - } - }, - { - "ID": "3d0a13fe961ed15c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "93" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9LCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "518" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:47 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoIRjhruHo5rweyX35Zt-Mzm5UDD5vr4319gSNjtnJHD2RWtVLvQdjuZ0jv-XKT3s1xcJO7CvoU-qAehCknukI5ssvv2LgwazyhnkcuFws3isqM9uo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjQ2LjgwM1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo0Ni44MDNaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImJpbGxpbmciOnsicmVxdWVzdGVyUGF5cyI6dHJ1ZX0sImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "c1f385994f4db8e3", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/user-integration%40gcloud-golang-firestore-tests.iam.gserviceaccount.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "159" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJ1c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "589" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:48 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UozEPu-BKQnmBUxTwsOWB7mmIPC5lppmUt6lA150OiXgQttSVRetVysUp299p7PbjI08qchUQl2idgMbfBCScDL5SuoHi_u9ani0DXYX2OV9QXAovQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvdXNlci1pbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9hY2wvdXNlci1pbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "ccb3141a79c55333", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3054" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:48 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:48 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoG9XpooOFPlHtC8fg7llzYYETQUMEm0PvG4TbxBF5KdfCdB_sxNi0Yy9KrAmMDPBVyq0Iuaq7mzQOhQe9lXe5PBOc8-CGTXZiEMkMMJe3OYxjExIM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInByb2plY3ROdW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xlIjoiT1dORVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6ImVkaXRvcnMifSwiZXRhZyI6IkNBST0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LXZpZXdlcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6IlJFQURFUiIsInByb2plY3RUZWFtIjp7InByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJ0ZWFtIjoidmlld2VycyJ9LCJldGFnIjoiQ0FJPSJ9XSwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sIm93bmVyIjp7ImVudGl0eSI6InByb2plY3Qtb3duZXJzLTQ5NjE2OTYwMTcxNCJ9LCJsb2NhdGlvbiI6IlVTIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9LCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "2d4244737318f2d5", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3054" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:48 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:48 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqn_UdEXhLLXE1QsYjwtyqQlzX3nDvpAO1WNpRkHhyV39RJKkxMBrcd8f6Xo3VZFDps7iKuQHnW49yRqjh42062lkisOH7otDXrdAKAih4Iz9fzERM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjQ2LjgwM1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo0Ny45MTlaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9z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qtb3duZXJzLTQ5NjE2OTYwMTcxNCJ9LCJsb2NhdGlvbiI6IlVTIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9LCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "b63c3951975a766e", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12183" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:49 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:49 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq-LP6kQLHNpjT5jYVkPzNXyfr838sGr4jGMVPq-FOq01ayCWvyWVAsvUbxp0NSdOYJcW-z0i2NkQLuSKGQYrX_3z8LW1Vb4uL2jxfC8kSiuz28hkA" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVz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WQuIn19" - } - }, - { - "ID": "0764f2598b67c664", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "3054" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:49 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:49 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrGddSv5GSaZB7qBmb0PigbMbJmWs91JB0W99oOTcbMeUk9QeBf-7QF7W_BpAn3wNxqVD5cBDPgGuKrZCfYv77SgCGxcPW-jrXsUY5h50q8eFL0_3o" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsInByb2plY3ROdW1iZXIiOi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dORVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6ImVkaXRvcnMifSwiZXRhZyI6IkNBST0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LXZpZXdlcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6IlJFQURFUiIsInByb2plY3RUZWFtIjp7InByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJ0ZWFtIjoidmlld2VycyJ9LCJldGFnIjoiQ0FJPSJ9XSwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sIm93bmVyIjp7ImVudGl0eSI6InByb2plY3Qtb3duZXJzLTQ5NjE2OTYwMTcxNCJ9LCJsb2NhdGlvbiI6IlVTIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9LCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "bdb0ff507e4df251", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13039" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:49 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:49 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up8t6bOWiJucB8KpVlIp8WjWLSUKssQaynZNguVy_oBM2ggBePUFnoteMcbw_L9aSHoD4hwi91dMaBC4aVc6VuaMSBSVuCe0L_0IymxhBIx3SRj_As" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20gZG9lcyBub3QgaGF2ZSBzZXJ2aWNldXNhZ2Uuc2VydmljZXMudXNlIGFjY2VzcyB0byBwcm9qZWN0IDY0MjA4MDkxODEwMS5cblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLm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bmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "d2e66ae2cc0d11bc", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3133" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:50 GMT" - ], - "Etag": [ - "COq52NHx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqQ_qlqWPPh6t8-gwPlD5zRB96zsmFgzyez4LG3XN4uErivnyHcCeeHje_i95VLJcWYXn7_-knEn0faPBCCAIStf4fXGs_Lz_VzHK6CLBZjU-oBxcU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MDI0MDc0NiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MDI0MDc0NiIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhd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My0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4OTAyNDA3NDYiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT3E1Mk5IeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNPcTUyTkh4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "89b2bc9232a865a4", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3133" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:50 GMT" - ], - "Etag": [ - "CJTz9tHx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrymnpCwS6vZ0kM33ZD4nBupWs9hAuaOGpwiNcS4GJctgaLPe9CQ0Ada06yQV1aEfh9FtX6lgYh9jHwbsT6qdgOYOYe9yGDdAF9f91aE4y4VUHQHts" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MDczOTYwNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MDczOTYwNCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo1MC43MzlaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6NTAuNzM5WiIsInN0b3JhZ2V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dAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSlR6OXRIeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNKVHo5dEh4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "a70634faba29225b", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:51 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqsIKUUc6WyIHUlDvAIDlXVeOofVG4sVV3Rus8ktfPMTUTI7e4PH4657AoDnNOKKy9TOgt8yUtUvCNvDFQC1xwVApFofRhWT3kcjsEYRgZPCDDsUqM" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCBpZCBwcm92aWRlZCBmb3Igbm9uLW93bmVyLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmVFeGNlcHRpb24uamF2YToxNDcpXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuY29tbW9uLkJpZ3N0b3JlRXhjZXB0aW9uLnRocm93UnBjM09uRXJyb3IoQmlnc3RvcmVFeGNlcHRpb24uamF2YTozMjIpXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuYXBpLmpzb24uaGFuZGxlcnMub2JqZWN0cy5JbnNlcnRPYmplY3QuaGFuZGxlUmVxdWVzdFJlY2VpdmVkKEluc2VydE9iamVjdC5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sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "5539336327f2e0ba", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:51 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrH7pn9r8O1Zu1Nc2aNUO_CO75MyvOJyONGw27TUkfWRSSmFIWJUZ6F3e3OprVF5jKtAkQ73puZbyNCK6mozyHrmPRRa0mtyuBPhkYg4DzPGkXJOSU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MTU0ODAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MTU0ODAwMSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo1MS41NDdaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6NTEuNTQ3WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDb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ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT0dlcU5MeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "029ec3d54709e7ce", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqcpItVCw5LaIWvDckOjfoChIifJGtuURBAmgtpzzna_iVOfDSaQOhxiMDVfYkV3mKG7__z0WTNRdVpa2Zs2IPcIAKwqwSeIMaLtz--MluSCHv9kc8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20gZG9lcyBub3QgaGF2ZSBzZXJ2aWNldXNhZ2Uuc2VydmljZXMudXNlIGFjY2VzcyB0byBwcm9qZWN0IDY0MjA4MDkxODEwMS5cblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MTQ3KVxuXHRhdCBjb20uZ29vZ2xlLmN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VxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "bc0d0ed808bc8e68", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0003/foo", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "5" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Etag": [ - "\"5d41402abc4b2a76b9719d911017c592\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:51 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1556835891548001" - ], - "X-Goog-Hash": [ - "crc32c=mnG7TA==", - "md5=XUFAKrxLKna5cZ2REBfFkg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "5" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpljfpVGJewuMZUyJZ8DU7j2k6JmfPqXXgkeeu8vGdK5j-C_DUgpubS4nFEp1z8EsN-fUdceCxfiy-FGIJiFpME38hWnztW_WIn6zeSh6LCbwIK9oM" - ] - }, - "Body": "aGVsbG8=" - } - }, - { - "ID": "b695481e00d2d6d9", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0003/foo", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ], - "X-Goog-User-Project": [ - "deklerk-sandbox" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "5" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Etag": [ - "\"5d41402abc4b2a76b9719d911017c592\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:51 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1556835891548001" - ], - "X-Goog-Hash": [ - "crc32c=mnG7TA==", - "md5=XUFAKrxLKna5cZ2REBfFkg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "5" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrmYf7b7ig2ase_O8qHEsgSAXifAlxVdDy_Zh5Qaqx1IlL1wkTvy1BSblI6ZDz3M2X-Y6KrdJp1IaP6nDU1F_Yhyt84Y7dOG80r2g-x4E7NAyyjV0o" - ] - }, - "Body": "aGVsbG8=" - } - }, - { - "ID": "2fe3b6cc96ffa451", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0003/foo", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "266" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur-S2G_BUo7MzXUj-7vUDuVFWfBIA5GJYfTdaeruyelzRGFimnhov8wRB_ozWC2cGPQ-a2xQk8bw_cVV_D2Q7c7rdR1ujaTM3oIjr8vjsJBZXa1VeA" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+VXNlclByb2plY3RNaXNzaW5nPC9Db2RlPjxNZXNzYWdlPkJ1Y2tldCBpcyBhIHJlcXVlc3RlciBwYXlzIGJ1Y2tldCBidXQgbm8gdXNlciBwcm9qZWN0IHByb3ZpZGVkLjwvTWVzc2FnZT48RGV0YWlscz5CdWNrZXQgaXMgUmVxdWVzdGVyIFBheXMgYnVja2V0IGJ1dCBubyBiaWxsaW5nIHByb2plY3QgaWQgcHJvdmlkZWQgZm9yIG5vbi1vd25lci48L0RldGFpbHM+PC9FcnJvcj4=" - } - }, - { - "ID": "59bdcad91d723d0e", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0003/foo", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ], - "X-Goog-User-Project": [ - "gcloud-golang-firestore-tests" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "5" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Etag": [ - "\"5d41402abc4b2a76b9719d911017c592\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:24:51 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1556835891548001" - ], - "X-Goog-Hash": [ - "crc32c=mnG7TA==", - "md5=XUFAKrxLKna5cZ2REBfFkg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "5" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up3lrNfk5bvup2RRbcsT6CeDACQitaiF3BTMyQ7B23ACtTqwWweq9ooOfZn3CX7tsbzljhlY_009nsTXXQwm7V_xNNd8FZwT44CzSpul-SZIRODC2w" - ] - }, - "Body": "aGVsbG8=" - } - }, - { - "ID": "7b7b6a79cd2a53e3", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0003/foo", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ], - "X-Goog-User-Project": [ - "veener-jba" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "342" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:52 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpT7Ge_QpcDrqajg6a4kZrmoA55ZSma9IM3pyz0Ow1bu5nLURc0V7cAThbvikg47_O-ox0uMdF6zBbtVtKL7olyMUGd9wqCQ9ubELVoJXiNMDehvXY" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+VXNlclByb2plY3RBY2Nlc3NEZW5pZWQ8L0NvZGU+PE1lc3NhZ2U+UmVxdWVzdGVyIGRvZXMgbm90IGhhdmUgc2VydmljZXVzYWdlLnNlcnZpY2VzLnVzZSBwZXJtaXNzaW9ucyBvbiB1c2VyIHByb2plY3QuPC9NZXNzYWdlPjxEZXRhaWxzPmludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIGRvZXMgbm90IGhhdmUgc2VydmljZXVzYWdlLnNlcnZpY2VzLnVzZSBhY2Nlc3MgdG8gcHJvamVjdCA2NDIwODA5MTgxMDEuPC9EZXRhaWxzPjwvRXJyb3I+" - } - }, - { - "ID": "914bca19df35cbed", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:53 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpM7lBsoxgNb-rh81Lfe0tWFGTkXQYfEB12ofkKZ8SK8kK5bPRUsQMVhm3aYB2N9e5_QSBZA25my-t5LpgR8TVW1lNTGd97OoD7bdBhP_CGo3xMbos" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MTU0ODAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MTU0ODAwMSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDo1MS41NDdaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6NTEuNTQ3WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbG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C1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT0dlcU5MeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "164b4ffce0c7e233", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:53 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" -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RpdHkiOiJ1c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "d04d3cb2ac9d6376", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12183" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:53 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:53 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrcH6PdfDpm0th9SnZgYwMYIiYGYz2VvNs-Nb0VYFbZdA4QXfOJiRFg-xKqmDq09HRt7j8OwTDO7UMm2EiqwjPz7j_JPIvfcCzfCnVVoF3XiZFomuQ" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF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19" - } - }, - { - "ID": "8b3aeb1f423d76c5", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:54 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoX_zzYo9AYFb44YmIz49k5z8v8ITzEQsDrSxEE50-7AC-ndg18Yo5DFAZ9ZFCDtT5P7kch3c0-YlkhX-5oYCUIm-mmPmoTg0CKWVI0TJ9la9z9-vE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MTU0ODAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0a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QuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC91c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4OTE1NDgwMDEiLCJlbnRpdHkiOiJ1c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT0dlcU5MeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "f32edc9a9263c0a1", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13039" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:54 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:54 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uok5lyOpE3YUZDwRz_bsA-E-xzWeqaApyadumOOFoA_YmOi_xnvFaJr6gfp9Gaktbpud9mv8qDCIvq1Yu7CyAVY0ScanSfNCke3naR_G7kPKYgrywY" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWN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dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "da73739950dbfa82", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3216" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:54 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrdpofRnchjkCQz5LLoghzg-RHoGATH3xbgJVW0LKGBkH025w5EB5RlGmHHnmXuPtK_5Ffyl1bxjmoc_h7_vGvjcxWbHv9-NKe9fLO_oNYRmw-ffvU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MTU0ODAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzND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vbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvby9mb28vYWNsL3VzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJvYmplY3QiOiJmb28iLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MTU0ODAwMSIsImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBST0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoibW5HN1RBPT0iLCJldGFnIjoiQ09HZXFOTHgvZUVDRUFJPSJ9" - } - }, - { - "ID": "94e697431c9323b9", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3216" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:55 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqhr0guIL00afW_qpaRvxEGRSJEWTtfrZP2Tv8Vqt2xas1ivvvMHVbSpT12ltU7FjytFhno9SFXTS8pW1S0S8qJdFctUCa83tkcQRXgN1uPUwhX1ws" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MTU0ODAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU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zLTAwMDMvby9mb28vYWNsL3VzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJvYmplY3QiOiJmb28iLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MTU0ODAwMSIsImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBTT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoibW5HN1RBPT0iLCJldGFnIjoiQ09HZXFOTHgvZUVDRUFNPSJ9" - } - }, - { - "ID": "3c5d694690a75054", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12375" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:55 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UogsU3nh3dfRYWq9YqTmJc7CfCX1U0b-IrWpDCM7M4YwfuUWgzzzcydWdHLrF0UPqRxNFQj3eMHBbDuHYcF0xuUNah4g5J_nt26feHRp-moh7uFXNw" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCBpZCBwcm92aWRlZCBmb3Igbm9uLW93bmVyLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmVFeGNlcHRpb24uamF2YTox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vb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZSQxLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "e050063f79f64820", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3216" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:55 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAQ=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq4hs_SY8_2HHPHu8NfVIkOdwmZz7h6XH0nWRSTQJSqzQZQGvv1p83Z6W209h3bXsbN9_ESiU3OIyLRwmEldfBP94hRhN5t1JnagcKPcMEOv8FtvHs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTg5MTU0ODAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLX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cmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvby9mb28vYWNsL3VzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJvYmplY3QiOiJmb28iLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MTU0ODAwMSIsImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBUT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoibW5HN1RBPT0iLCJldGFnIjoiQ09HZXFOTHgvZUVDRUFRPSJ9" - } - }, - { - "ID": "f7edef926cdb7d75", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJjb250ZW50TGFuZ3VhZ2UiOiJlbiJ9Cg==" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13231" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:56 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqyQ9DLrBDGkx7uOkrIKrzMMYA4YygdFsd1si16n2Lr4I5Rfp1lxwadC3jThiJbE-cDyuZATHtvM2bzpsRDPJzbmKgtxYydHykiB-oCsSFqfwy50gw" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25z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tZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "2745d195a40b86f1", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "377" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:57 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpGeWJRYTNsu57knuRFhwHuoeUMIJhUtuQj4PLhGDoFcITB2Y--7JgaOCVhepJ6a5RRKvU9d3UrAyrtbGNOVHyW2WAbN_KpfkiFhYq8l7HPERpLDjg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZG9tYWluLWdvb2dsZS5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvYWNsL2RvbWFpbi1nb29nbGUuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQU09In0=" - } - }, - { - "ID": "5258a70437064146", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "377" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:57 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqImoOCe_iDYCV8XHpaaEXPn-jeAf0M1MyixGju1tNCSTBIMEKDzh_wxVxapMmXWPnOes7YX0T0Fr663x7eJCl85B0EGXggUgp8bqeDV3cJ-mqeDrY" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZG9tYWluLWdvb2dsZS5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvYWNsL2RvbWFpbi1nb29nbGUuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQU09In0=" - } - }, - { - "ID": "5cef2c464b7356c8", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:58 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpH5br-AVWN2g1nkkM_FJWZIjgOgh2NGLuiyYUS7QD2DSs6B-c0IQHgC2NUyy0eZq4McQhwxBGhUJ05-WeD_bX35i7skN7Jn_q3ELAaDwpi6_x3Z8c" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmln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"11cd5140a264e423", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "377" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:58 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo2_tsxxuZC3Ni-A0zL0E9w8OVne0sWfLi61Cv48eTWj2R4F6G0AmXZU7J8L-WnDJf4s-6GpZV0SyQqrjBA_Mp75pJfWb6cl9_7oimTy8HPnxAtMwc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZG9tYWluLWdvb2dsZS5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvYWNsL2RvbWFpbi1nb29nbGUuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQU09In0=" - } - }, - { - "ID": "dac6629e58d45469", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:58 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrTXUzCa6WOvWD6NqoHhkdwRtG0Z4h0QurHOuKU1gyAWzXOt8lc1NVsLqe-6m8siE76k7l8g0EY3Le273_4GFB81gHMhM4qBOOgbwSBgLl4zKHZspU" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20gZG9lcyBub3QgaGF2ZSBzZXJ2aWNldXNhZ2Uuc2VydmljZXMudXNlIGFjY2VzcyB0byBwcm9qZWN0IDY0MjA4MDkxODEwMS5cblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MTQ3KVxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV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29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "1c8663192ed534e8", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2370" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:59 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:59 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqfc2TzyVBAwGuVpWWQt7OYr3IQEmVj5R7LIr5LSRAhwFernkoD6TFVnJno_ria4LL8P9tSQgzCF7uJpStJTpYgTOiW5FqTxQ-AgbOjFmAMjah3o6U" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQiLCJyb2xlIjoiT1dORVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6Im93bmVycyJ9LCJldGFnIjoiQ0FNPSJ9LHsia2luZCI6InN0b3JhZ2UjYnVja2V0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yM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0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9hY2wvZG9tYWluLWdvb2dsZS5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNBTT0ifV19" - } - }, - { - "ID": "51858ae7ea77845a", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2370" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:59 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:59 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqc5V7vaPL-d4aMLJi5QXyxZYWWtGBx0QuvfeB8rFlhwPGPFLQUABxm_XXkR0AOeIqdZ-intSu7I5srWdFKX85aY8r-z4oRTuB-CjGUe5uMiXQzXU4" - ] - }, - "Body": "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googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12203" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:24:59 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:24:59 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqrg4CYWnZtCkMXT5KHCcQXY-aSGc6JuuEoVkTtKgObB9qr-dE-5sMKCrbTfpFudhid3ulDpkNuOUmRmBy4k7QQoRxqgues_a8dB85cOybZKZTM864" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyB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dCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlJDEucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ2MClcblx0YXQgaW8uZ3JwYy5Db250ZXh0LnJ1bihDb250ZXh0LmphdmE6NTY1KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuQ3VycmVudENvbnRleHQucnVuSW5Db250ZXh0KEN1cnJlbnRDb250ZXh0LmphdmE6MjA0KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0Tm9VbnJlZihUcmFjZUNvbnRleHQuamF2YTozMTkpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwMCwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4ifX0=" - } - }, - { - "ID": "8c1628782bcf7eaf", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2370" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:00 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:00 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqmer5wTHG4zziRJUR_QqUbX_xgytHZkMg2KFntbVz8pn55RFN7idAyYcqz3AhqthLD-bHH2Lggdg4MuIdjHVk_kKHxvDdqI0p814avmZPYAhJdvsE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQ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lbWFpbCI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNBTT0ifSx7ImtpbmQiOiJzdG9yYWdlI2J1Y2tldEFjY2Vzc0NvbnRyb2wiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9kb21haW4tZ29vZ2xlLmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9hY2wvZG9tYWluLWdvb2dsZS5jb20iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNBTT0ifV19" - } - }, - { - "ID": "6813d64060667ba0", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13059" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:00 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:00 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpsvYC9PE_CO5H9MncFfA0uYzQqFBOqu0_zdexcxDTJ22CO_vv1LiRY6ZSC49_FMeUZBA3KdMfOnS7DsSxBpqrLC9ZM6GAs2sFolmZKhp0RWJjvOzs" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20gZG9lcyBub3QgaGF2ZSBzZXJ2aWNldXNhZ2Uuc2VydmljZXMudXNlIGFjY2VzcyB0byBwcm9qZWN0IDY0MjA4MDkxODEwMS5cblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0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tm9VbnJlZihUcmFjZUNvbnRleHQuamF2YTozMTkpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwMywibWVzc2FnZSI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIGRvZXMgbm90IGhhdmUgc2VydmljZXVzYWdlLnNlcnZpY2VzLnVzZSBhY2Nlc3MgdG8gcHJvamVjdCA2NDIwODA5MTgxMDEuIn19" - } - }, - { - "ID": "76ac0290041d5a26", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:01 GMT" - ], - "Etag": [ - "CAQ=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur-ejQ-G_PN4CMllngdiEh1SqHQNy8TXBA-htpazVSOadp1oThRsYsQuflX2kwkDQHFpeo1UgDPXqi5BRq8qZUBsM2koJIMOp-APWnB8T_qsTHlY30" - ] - }, - "Body": "" - } - }, - { - "ID": "0de0d173f3f5c2cc", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:01 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:01 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqLOtWcLW6yZk8n72e3qkdl4ft2-s7FJFYyRv_5REkk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yZW50Q29udGV4dC5ydW5JbkNvbnRleHQoQ3VycmVudENvbnRleHQuamF2YToyMDQpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm90IEZvdW5kIn19" - } - }, - { - "ID": "eb2af5bce5b9e1df", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:02 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:02 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqgaldc1OJvgmfZxcZs4i5d6EXMyFK93ZUJLzSK8Vo-qPYKRwhvPzK8GFv3gqrdyjBbvdc2Uz57nCwy10LhC5AD2pscln8VbaQIOAHqxvkwsqV27Rw" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCBpZCBwcm92aWRlZCBmb3Igbm9uLW93bmVyLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmVFeGNlcHRpb24uamF2YToxNDcpXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuY29tbW9uLkJpZ3N0b3JlRXhjZXB0aW9uLnRocm93UnBjM09uRXJyb3IoQmlnc3RvcmVFeGNlcHRpb24uamF2YTozMjIpXG5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4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "ad55ad01147a8c62", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:02 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:02 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoQpkkPNbb1CGY8lAzUfymkmZ7PNlRK6hK3deBeoMip13ARTb212DIgf4lgUDM8PVQsAqcnKwzNulbZICoGzHwrsBZfyi7p5TGX2yJHLXSAGEY0MBE" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpBQ0xfU0NPUEVfTk9UX0ZPVU5EOiBTcGVjaWZpZWQgQUNMIHNjb3BlIHdhcyBub3QgZm91bmRcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MTQ3KVxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50aHJvd1JwYzNPbkVycm9yKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MzIyKVxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmFwaS5qc29uLmhhbmRsZXJzLmFjbHMuRGVsZXRlQWNscy5oYW5kbGVSZXF1ZXN0UmVjZWl2ZWQoRGVsZXRlQWNscy5qYXZhOjg2KVxuXHRhdCBjb20uZ29vZ2xlL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b25Nb2R1bGUuamF2YTo4MDIpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUkMS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDYwKVxuXHRhdCBpby5ncnBjLkNvbnRleHQucnVuKENvbnRleHQuamF2YTo1NjUpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5DdXJyZW50Q29udGV4dC5ydW5JbkNvbnRleHQoQ3VycmVudENvbnRleHQuamF2YToyMDQpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm90IEZvdW5kIn19" - } - }, - { - "ID": "1ef9ea9b9bc398a6", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:03 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:03 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur5WrZwygTHM0dDH6L1kypZzaAQtCwxt9wA7VXvgnjwrfwdRnTw0D7K3VLYLRTPDcf8mRFn5CetkcimFxfqUDoWLMF7bH1TLiBr38K6aBU74aRWUd4" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbG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J1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "5c1cadcffc6c95e0", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "119" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:04 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo_n__u-lZKgZqveqge9YBw7wQMldCd4t0io7l_L_nlcF4DSPBPvZd9jGPCstE1EYuQS9L-Z3Y53Q15FlqM1IcmRDv6bYEJQWqkpuzCRRa_TLh9P7A" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQVU9In0=" - } - }, - { - "ID": "4a615256ab8c55b4", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "119" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:04 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpwGIlBhvugAIHxiObS0RPpJ40OY_R3exJfPh5IHLLB3SrdYtGMpD01QLdxc3E0IPGkBiTrwM-Z2X1gMcxuOqJWJUrhV4xTFe_n5G8bBxzievz39F4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQVU9In0=" - } - }, - { - "ID": "63c0acd95aa571a1", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqNu5DFt-lpr-_4YX8LRIhoi3KVRYVgFAlG7WOPsY7IGJ2NLZSF3SQhmkvfL_IKZ0FWIwx1nGT6HBBe9t2RYXNE1kXis-9KgEaAWhrEByTud5QGx5c" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXI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xuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "3c6b1be88134f9d9", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "119" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:05 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqzTVWCTbjlM7VCFWFbOojrtt8ZMY9bRy0eXj0Uxj3gaYalvwqR0WBrtbX0iGQ-aN5pv3-Acc7EWIoHBa37YbMpx9fuoJUpTswmdpiCOH3wbMN7tIk" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDQVU9In0=" - } - }, - { - "ID": "60cde48b740e9a63", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrLyiKgPsp1RDgH3Q2SGlQAwTvGJwVDvb9U9FfvTysIFo6sO-5AoXrGPQfZpr80aMOEKojmPksURjhsteWSV9g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UNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "95b915570e7c2375", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "684" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:05 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ -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Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "684" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:05 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqXQonYrNQZxcXoDllGz19Ruu-Eq1_3FVjMndISB0h1O1ojodwFr2Xor2nZHBZgv3NN_YOSrunnT_KYTfBFNdqtVvqVC2L19Qhwk-cxse_FqrMVbIM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBVT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQVU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBVT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNBVT0ifV19" - } - }, - { - "ID": "a3918deffd2f8f0f", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12203" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:06 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:06 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpCCE2tr_4iWFlwmQkFVvzfskSWvZdvohQYV52oXF-tWUfie6Brp5TYrvUYx7jH8zsTg9qqk_kv0th8pOA1WsHahBUbDYuaqAmW0EpSJI6_xjBPdZ8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCBpZCBwcm92aWRlZCBmb3Igbm9uLW93bmVyLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmVFeGNlcHRpb24uamF2YToxNDcpXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuY29tbW9uLkJpZ3N0b3JlRXhjZXB0aW9uLnRocm93UnBjM09uRXJyb3IoQmlnc3RvcmVFeGNlcHRpb24uamF2YTozMjIpXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuYXBpLmpzb24uaGFuZ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FjZUNvbnRleHQuamF2YTozMTkpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwMCwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4ifX0=" - } - }, - { - "ID": "42a941620757dac5", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "684" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:06 GMT" - ], - "Etag": [ - "CAU=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:06 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoqov2civPKG8oSKmpVgUSoOD4W3rev4av_O6jgxkc5tSpPMgtxZeG3NznVRuFJLgClao2zPH8BvZIxTAAPUi_R-H0zgPz6ou8k9SMzLrcgW_HW100" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBVT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQVU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBVT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNBVT0ifV19" - } - }, - { - "ID": "ae79f2e22d58681a", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13059" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:06 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:06 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqP_EhJin_8uqVkiSwAv0jBAI8A0o7nSwNAQ-Z_EdAnq2PItIGJZl5NOE_xcDTFce_ncHfsf6LvV4NMvuxiOsl32BOddZj_6x5dC36QqrKvhXKaQJ0" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBk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S5nc2VydmljZWFjY291bnQuY29tIGRvZXMgbm90IGhhdmUgc2VydmljZXVzYWdlLnNlcnZpY2VzLnVzZSBhY2Nlc3MgdG8gcHJvamVjdCA2NDIwODA5MTgxMDEuIn19" - } - }, - { - "ID": "99becaf4890b3c21", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:08 GMT" - ], - "Etag": [ - "CAY=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpWMu40YNkuE3QcNByTmrKw_cnq4a8DVtcknBJ7gTnLdH1BC6CqoFOStPpa6y4PMmdpLpquozlOzvI4NWjgZYp1d9F_wBEyaq-wquTQAWGXNy3qktY" - ] - }, - "Body": "" - } - }, - { - "ID": "586ccc26d5a22712", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:08 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:08 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpsRO9GedosQ-kg2lCQpx2S6C0-HH592CdB3SU9yGMwEEGKX9md7KGeSDhecrm_6Ug6tyYtEMlsMq08YBAKGprXfcN9130mRolu_HVey3CcrXK1nZ0" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpBQ0xfU0NPUEVfTk9UX0ZPVU5EOiBTcGVjaWZpZWQgQUNMIHNjb3BlIHdhcyBub3QgZm91bmRcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9u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uRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm90IEZvdW5kIn19" - } - }, - { - "ID": "fad4bdab588e0f3a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:08 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:08 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoUefKoF0asUvxzmAtX5z5m_5FRy9UfliKkjQN8cYyrHAotGwiQA72QN0lYfA0HXbe7gFRokwBAY8R5OpHcEdRq5K9sw8AwHuNtruFtBMxjN0D3hR4" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXI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UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "23bb9ce53da2f525", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:09 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:09 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upa2KE5JJOXq2FOn7RHasJpOeeHqWU2kk3BC4cQcGQ9jGzh6XIksN6Z6u1NVoCbxW7-3zGiZMdAop-oa_EuyPAauD__JgzNPdngeNeXO7lsGaVI6i8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5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0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm90IEZvdW5kIn19" - } - }, - { - "ID": "46482e47e655836d", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/defaultObjectAcl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:09 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:09 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urze42blCAS2Dskbf5jkbCkdo5IhfOj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lcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "856a1fb5ffdb000f", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "463" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:09 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoFSnYuPlv_JejZ0nEjoWRXeLwj0MS-ddTlIaSOjaK5BudyIcIOeVDEeyFYWsF-GCZzMC0F7v-UEw0_lbsYBXCMZcLp6WZu_s3OPDREhpz2s3Txw-s" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZm9vLzE1NTY4MzU4OTE1NDgwMDEvZG9tYWluLWdvb2dsZS5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvby9mb28vYWNsL2RvbWFpbi1nb29nbGUuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4OTE1NDgwMDEiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBVT0ifQ==" - } - }, - { - "ID": "a74c3e1b541a9ffc", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "463" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:10 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ury3MiMZho3xaSHmFgwHNvKIHTa0_gZzfKvX8FW6iVGNkdSbXvmVypIUuIoKXDjd4rOXpFghdoJlES9A_iXUvZyfWAZLvWqR1w6sDRymrIARVd0dPE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZm9vLzE1NTY4MzU4OTE1NDgwMDEvZG9tYWluLWdvb2dsZS5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvby9mb28vYWNsL2RvbWFpbi1nb29nbGUuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4OTE1NDgwMDEiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBVT0ifQ==" - } - }, - { - "ID": "913da4fa24ea5f1f", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:10 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoKAxObyNBS_Mew44t3k1u80cLBGQW_I2ohrF96rIjZRxFscjGFrvsOHfLxw78rTRnpHmfA0uXnNz8T2FPc_Op16Lnn1YkfyOezSEhDBx11qZbinEE" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCBpZCBwcm92aWRlZCBmb3Igbm9uLW93bmVyLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmVFeGNlcHRpb24uamF2YToxNDcpXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuY29tbW9uLkJpZ3N0b3JlRXhjZXB0aW9uLnRocm93UnBjM09uRXJyb3IoQmlnc3RvcmVFeGNlcHRpb24uamF2YTozMjIpXG5cdGF0IGNvbS5nb29nbGUuY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luSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "5dbdf24cae75e565", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "463" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:10 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAU=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpoJgRZ665WjiUif7SnQ-Vg4B0kJl-UQ_kIk5XgmcQIL5zmCBp3NCxjksybkvNKpGcQnIJSLevfyWd2fugRv5y5vxmEBgqFffIy8ibTIyBDH4b7R74" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZm9vLzE1NTY4MzU4OTE1NDgwMDEvZG9tYWluLWdvb2dsZS5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvby9mb28vYWNsL2RvbWFpbi1nb29nbGUuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU4OTE1NDgwMDEiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIiLCJkb21haW4iOiJnb29nbGUuY29tIiwiZXRhZyI6IkNPR2VxTkx4L2VFQ0VBVT0ifQ==" - } - }, - { - "ID": "f41892a142fe6d2b", - "Request": { - "Method": "PUT", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "107" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJlbnRpdHkiOiJkb21haW4tZ29vZ2xlLmNvbSIsInJvbGUiOiJSRUFERVIifQo=" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:11 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpThInLTHhtepE7J4k-Rg6OoLRyOqnjPz4sZmfIH6wp5TSIyLrZQhExKAP52XbwUwMYp7x-xypSMY5kfR66I-dmpRWaFkfs0Lhy-Z6kqb5JUXSppqk" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbn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nVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "5eb0710be2571dab", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2800" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:11 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAU=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:11 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpbetUCGwYg4rhIR-DP3ntPqbkFwSqutNltVR55I4qedP-rZ5hC7ospMy6hZ4aQaNOhNv0frmst8MQZ0j6Mp8BcTC6qy7mU8bhEAiMGLycR5XxUWfI" - ] - }, - "Body":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dC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL2Zvby8xNTU2ODM1ODkxNTQ4MDAxL2RvbWFpbi1nb29nbGUuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC9kb21haW4tZ29vZ2xlLmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsIm9iamVjdCI6ImZvbyIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODkxNTQ4MDAxIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDT0dlcU5MeC9lRUNFQVU9In1dfQ==" - } - }, - { - "ID": "56aaafb0a24b0644", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2800" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:11 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAU=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:11 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrqQczDm-dzjgTlLFcJ2lXQrMTpQ_8UP-1hNbGj7eZEgZcbxWA-oyXqEe4tJXq3gYdZ3mEIcAzaDtNeBHWidpIev7kdXWank04_JSWbQtU2UomJqeU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZm9vLzE1NTY4MzU4OTE1NDgwMDEvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJvYmplY3QiOiJmb28iLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg5MTU0ODAwMSIsImVudGl0eSI6InByb2plY3Qtb3duZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJPV05FUiIsInByb2plY3RUZWFtIjp7InByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJ0ZWFtIjoib3duZXJzIn0sImV0YWciOiJDT0dlcU5MeC9lRUNFQVU9In0seyJraW5kIjoic3RvcmFnZS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0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ09HZXFOTHgvZUVDRUFVPSJ9LHsia2luZCI6InN0b3JhZ2Ujb2JqZWN0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL2Zvby8xNTU2ODM1ODkxNTQ4MDAxL2RvbWFpbi1nb29nbGUuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC9kb21haW4tZ29vZ2xlLmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMyIsIm9iamVjdCI6ImZvbyIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODkxNTQ4MDAxIiwiZW50aXR5IjoiZG9tYWluLWdvb2dsZS5jb20iLCJyb2xlIjoiUkVBREVSIiwiZG9tYWluIjoiZ29vZ2xlLmNvbSIsImV0YWciOiJDT0dlcU5MeC9lRUNFQVU9In1dfQ==" - } - }, - { - "ID": "3bbc40d778939612", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12203" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur5kJWpLwxz76BKPll75-nOsLv_uoh7X-TW0SbNHCYEzkGq8VZ-W8a5tKGUF6rKea4ejr4MhcqJVr1Zu7O-zNAfQWJMsHC9CTkOrPa5Iu1s0KBJDdY" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCBpZCBwcm92aWRlZCBmb3Igbm9uLW93bmVyLlxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50b1JwYzNFeGNlcHRpb24oQmlnc3RvcmV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vZ2xlLnRyYWNpbmcuQ3VycmVudENvbnRleHQucnVuSW5Db250ZXh0KEN1cnJlbnRDb250ZXh0LmphdmE6MjA0KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0Tm9VbnJlZihUcmFjZUNvbnRleHQuamF2YTozMTkpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwMCwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4ifX0=" - } - }, - { - "ID": "a2868e9e376e356b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2800" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAU=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoyZfAJB3TroGxzYv0gy7dHUwpU0jtIeU_EyQSFQKzHlHbyRa33r_a-B1aHw5tHaoawuDvv7skisdx10yhmm9ZRrPw0ibwpMkX5Cwhf0OK85DF84jM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9scyIsIml0ZW1zIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvZm9vLzE1NTY4MzU4OTE1NDgwMDEvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJvYmplY3QiOiJmb28iLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTg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- "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13059" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:12 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqBumxgw_FTJlt7J3xLsBDxljAcEyC2G5aQqhEibawMttB-ogPabqDfz8ZN65WtOikIggZQ8OqW8zigV4Q5vfQkog7NMasAuivcMjhAsgqv_6qWv_E" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYz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f40c6c1bcd", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Etag": [ - "COGeqNLx/eECEAY=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrC6xxVQeIIjitNwDv5PhDUIBQbtGdHJDi_AmLs8vTbGzkby-5hguMIwI_UeHlCuGF1u5jBoVwCOgSqJBiJJ5fxh8oCzBn-nHGcGAdIOeQt7gTL0RQ" - ] - }, - "Body": "" - } - }, - { - "ID": "4b6b925053570053", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:13 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpiIBwh04pJH1-X9d1oJluF_2ZCJEFLzF4E7SI-easf2noIolxavCbpH7NP9GMmNXnVK_ZJm4kW8coV5ArXDr-Rwodjnd9Bn2hFiJ_puNeWWldJ6mA" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpBQ0xfU0NPUEVfTk9UX0ZPVU5EOiBTcGVjaWZpZWQgQUNMIHNjb3BlIHdhcyBub3QgZm91bmRcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MTQ3KVxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50aHJvd1JwYzNPbkVycm9yKEJpZ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joiTm90IEZvdW5kIn19" - } - }, - { - "ID": "9b4f9c448170e89d", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:14 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:14 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqHc1VVBdvXFq9aDPAprpXNP5xPt-ZtPdYXwCQPHX_s4gkCMom31AtHeDocV_hker5qryWoYnRD8PPu5c7JqDNQ75v7GgE1vO5xAt7AqWPoLU5MO5A" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VD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Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11631" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:14 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:14 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpuFB_mdJg9Fd7Sj06Xdcrj7Up2xXVc_P-SgISEEtiv4v9doPXzNbzBz92Q2UfEchYWSQnikHhS34dUAOefj9J4vaBYqjc9RjFmrn8YcPNyS8aWKgI" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpBQ0xfU0NPUEVfTk9UX0ZPVU5EOiBTcGVjaWZpZWQgQUNMIHNjb3BlIHdhcyBub3QgZm91bmRcblx0YX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FjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm90IEZvdW5kIn19" - } - }, - { - "ID": "db035a3cc51de007", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/acl/domain-google.com?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:14 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:14 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrGb7BqO44vNpZjBnLrSI6_jVCVRFevSqm5eux2DIE2zmUY3sH0T0st7OOsLPcBjvLSbDfijMcdJwsgpM1fQGcerB9bS8Ffd4Qgzdjth0I8FreV4Vs" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7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uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDMsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "e1d95794cb6be989", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/rewriteTo/b/go-integration-test-20190502-80633403432013-0003/o/copy?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3273" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:15 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [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udC5jb20iLCJldGFnIjoiQ0tieHo5M3gvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJtbkc3VEE9PSIsImV0YWciOiJDS2J4ejkzeC9lRUNFQUU9In19" - } - }, - { - "ID": "297f13e741cceb04", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/rewriteTo/b/go-integration-test-20190502-80633403432013-0003/o/copy?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3273" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:15 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UroLXQs6945-UOUyN7qOhICUNnGSzCVrNCv5DD9uMyvgD08zpuufBZj8WM8Fxe0DuOuQowqbPEn1UdJdbFTW7puyeY4zX8fM6UgT7SZIVB0Xi-B0OM" -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nZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJtbkc3VEE9PSIsImV0YWciOiJDTTJEODkzeC9lRUNFQUU9In19" - } - }, - { - "ID": "9617f04d2dc95a7c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/rewriteTo/b/go-integration-test-20190502-80633403432013-0003/o/copy?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12683" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:16 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqeJiJeDLLZgn9vlRyNk1plY-7dcPXaz47gPNAhMqmSx5ZMvg6pqWj18PVUR65UGuWE7Amtua_zqsv0dVyDZE2FFceMeIQcQ2n6noklvRS9kxPXcEU" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5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WNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0Tm9VbnJlZihUcmFjZUNvbnRleHQuamF2YTozMTkpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwMCwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4ifX0=" - } - }, - { - "ID": "2309e069a65c894f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/rewriteTo/b/go-integration-test-20190502-80633403432013-0003/o/copy?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3333" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:16 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpxhvVZmlJMvR93BoI0JsL0TYbDN-kmlYHQOOlRfb-Nnqpc8iUImRtJT8Qvx0XWrOsALmLv4Oub_aeCCWkHPvqaF28oAazlhqRZYoxrPlaQlW0N1Qs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNyZXdyaXRlUmVzcG9uc2UiLCJ0b3RhbEJ5dGVzUmV3cml0dGVuIjoiNSIsIm9iamVjdFNpemUiOiI1IiwiZG9uZSI6dHJ1ZSwicmVzb3VyY2UiOnsia2luZCI6InN0b3JhZ2Ujb2JqZWN0IiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMvY29weS8xNTU2ODM1OTE2NjM3MTY1Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vY29weSIsIm5hbWUiOiJjb3B5IiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MTY2MzcxNjUiLCJtZXRhZ2VuZXJhdGlvbiI6IjEiLCJjb250ZW50VHlwZSI6InRleHQvcGx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S5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiY29weSIsImdlbmVyYXRpb24iOiIxNTU2ODM1OTE2NjM3MTY1IiwiZW50aXR5IjoidXNlci1pbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ08zSG85N3gvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1pbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJtbkc3VEE9PSIsImV0YWciOiJDTzNIbzk3eC9lRUNFQUU9In19" - } - }, - { - "ID": "d2fe101ea1da654d", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo/rewriteTo/b/go-integration-test-20190502-80633403432013-0003/o/copy?alt=json\u0026prettyPrint=false\u0026projection=full\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13539" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:16 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqjFigs6aYtqXW_7VucOIgJY2MQZwuLv9B12s2ffhWgWDxtJyjLinG4A8U9gKBCpiTt9jUvdHKtaG20qZfyfN9Q1eVAkUQh_zv7ESbqnWhsiheI7zw" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpVU0VSX1BST0pFQ1RfQUNDRVNTX0RFTklFRDogaW50ZWdyYXRpb25AZ2Nsb3VkLWdvbGFuZy1maXJlc3RvcmUtdGVzdHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20gZG9lcyBub3QgaGF2ZSBzZXJ2aWNldXNhZ2Uuc2VydmljZXMudXNlIGFjY2VzcyB0byBwcm9qZWN0IDY0MjA4MDkxODEwMS5cblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N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OjQwMywibWVzc2FnZSI6ImludGVncmF0aW9uQGdjbG91ZC1nb2xhbmctZmlyZXN0b3JlLXRlc3RzLmlhbS5nc2VydmljZWFjY291bnQuY29tIGRvZXMgbm90IGhhdmUgc2VydmljZXVzYWdlLnNlcnZpY2VzLnVzZSBhY2Nlc3MgdG8gcHJvamVjdCA2NDIwODA5MTgxMDEuIn19" - } - }, - { - "ID": "6620f07aff04b6fd", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/compose/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "127" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImZvbyJ9LHsibmFtZSI6ImNvcHkifV19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "742" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:17 GMT" - ], - "Etag": [ - "CP/B0t7x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-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iL1JDT2dnPT0iLCJjb21wb25lbnRDb3VudCI6MiwiZXRhZyI6IkNQL0IwdDd4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "7f88847ad9c49799", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/compose/compose?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "127" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImZvbyJ9LHsibmFtZSI6ImNvcHkifV19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "742" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:18 GMT" - ], - "Etag": [ - "CKav+N7x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urtn69BB0ytbCZpuCbus4w__tiLeBpqeNzD2gKl5KN2LgP9ZJOIjudGKpDOJRhyW_WQjVOCJBC1CSB_AgE0MdPzVDAK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{ - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/compose/compose?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "127" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImZvbyJ9LHsibmFtZSI6ImNvcHkifV19Cg==" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12267" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:18 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrE9jrLJ0W1PUHWT3ldYhVsL9nNhAeFPU2K8g2rCMimty07QlN95esxj7dBAySQ-nzvK17L3WA7vjmxjCpeQADa2bztj6ke8NZjb8fuWkQHsnnzKXA" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ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1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "08fda3fa173e6e11", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/compose/compose?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "127" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImZvbyJ9LHsibmFtZSI6ImNvcHkifV19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "742" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:19 GMT" - ], - "Etag": [ - "CKy2sd/x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqfGXVJ2-MQaZWJ-JS6runpSycA3GDKIXYHDGf3VBOXnADbUzL2YhZVmlQcW_95jXY0eMkK4Z5tSRk3cxGP_84T_1t3YDYQS2p37ZouBk7GfX-4xxw" - ] - }, -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age/v1/b/go-integration-test-20190502-80633403432013-0003/o/compose/compose?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "127" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6ImZvbyJ9LHsibmFtZSI6ImNvcHkifV19Cg==" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13123" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:19 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqGREJ2AZDcrZiJzPX5ltwlB28vRYhZ_xv4LMIO3La2IgFWk4wd5IVrqBs3z2epgtg7wkPpZm4qPH9zTzSIsXNxdLLHcNMMYr2azidefxtJVgXqgDY" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2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S10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "84daee26f7d989ce", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3112" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:19 GMT" - ], - "Etag": [ - "CLmF4d/x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoLuw-z5wwTKy-X92_i7pyTrimolUNRUGrElhep6rUH_mmpgu_Vxp-1ncr8x8XNXHLs8NFRW5S7WVUsaDRRTrC5K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G9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTkxOTc0MTYyNS91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MTk3NDE2MjUiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTG1GNGQveC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNMbUY0ZC94L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "8457a5701f4ced08", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:20 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpKF1M6PpAT354ON3809wMCor-B9KITRuEV34MQczP3OD4Co0sJYtNSub2FUzA8qanTDrtANRK0RuxPTz314o3HQro2HLOoyKZBow5CZ4sfsunKHv0" - ] - }, - "Body": "" - } - }, - { - "ID": "1c2ba8a7670e2218", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3112" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:20 GMT" - ], - "Etag": [ - "CP+SgODx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoq9hgjjwBbSH1zXN2UlNtWO31Qf5uk4ijjGCQlETB9_5H_CouvU3q4tyHAKEbIBlaW1_mNk3Fsp6LgXqsPPKvFzs3-WHeADAgc2-GpD-0inoYUHMs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTkyMDI1MTI2MyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkyMDI1MTI2MyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpb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1NTY4MzU5MjAyNTEyNjMiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDUCtTZ09EeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNQK1NnT0R4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "7e6d2f97bd881584", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:20 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UohQH2nTuRg_FtGhlfr9zC26C6lKFA-aZTf4GbiV5kWZCJ9E4YLHfIUKLpCLIgEfX9TAvi4oPNWfEBpbY-orlescLxrxYcB1U5fLmzzHQR2R0teR-s" - ] - }, - "Body": "" - } - }, - { - "ID": "48e189abff98ea93", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3112" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:21 GMT" - ], - "Etag": [ - "CM3Aq+Dx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq_NscG9s3iq-8NZq8vQhzdc9FJMaAfq_0GborrX84b8gG2zpbUNtEVnrjFjLyOXqBeJwthPgPUPcsGbIcD597LaPlx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YWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTkyMDk2MTYxMy91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzL28vZm9vL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MjA5NjE2MTMiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTTNBcStEeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNNM0FxK0R4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "02d6922c26c06cbd", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 400, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "12243" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:21 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:21 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrmjSJHhErkbzi8feJ_-8XOMqsIzGrEe6frQzWXQ7dPl0D8MW1mMHClKdwb2zBOTvpx7mXQWy2STZYSqx2o7O1Tr2DB1RZfwCZ3xp1jgw3NCICi7Xw" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkJ1Y2tldCBpcyByZXF1ZXN0ZXIgcGF5cyBidWNrZXQgYnV0IG5vIHVzZXIgcHJvamVjdCBwcm92aWRlZC4iLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6VVNFUl9QUk9KRUNUX01JU1NJTkc6IEJ1Y2tldCBpcyBSZXF1ZXN0ZXIgUGF5cyBidWNrZXQgYnV0IG5vIGJpbGxpbmcgcHJvamVjdCB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leHRSdW5uYWJsZSQxLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MDAsIm1lc3NhZ2UiOiJCdWNrZXQgaXMgcmVxdWVzdGVyIHBheXMgYnVja2V0IGJ1dCBubyB1c2VyIHByb2plY3QgcHJvdmlkZWQuIn19" - } - }, - { - "ID": "3fee93fca0ef933c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3112" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:21 GMT" - ], - "Etag": [ - "CLfH1eDx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqLO91a0iSaTsK7EA2iN621UX-atvJ-8m8BeqeR8_o_CQLB8Pco5FMXznwQY7DZ8u0GPd1BvLE98s5S7T1Z6yL66OKL0CFFUntLBqNAKlji2Dcme6g" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTkyMTY1MDYxNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWN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DAzL28vZm9vL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAzIiwib2JqZWN0IjoiZm9vIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MjE2NTA2MTUiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTGZIMWVEeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNMZkgxZUR4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "5c26cf93373a296a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026userProject=gcloud-golang-firestore-tests", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:22 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urx3fvI3sQc5JiIazK1OQw5W12poVdjRyBKxIBM6N98jEJli9F0O33KVHHcHaP-QybHub31QmLNngZpzcVKJq33DSaVMW2Vpi5BUaVAAUL2jMoyOxs" - ] - }, - "Body": "" - } - }, - { - "ID": "f8b5020ef71e4047", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJuYW1lIjoiZm9vIn0K", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3112" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:22 GMT" - ], - "Etag": [ - "CIungeHx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq8QEz45d-uPa7qZ6Nl_SMqw2iepQXoM4aAkTx4YCqArXnSKI1UO3ZhJ5-_PDg3Uq6PPa2JDBTbxckiZCRMQvf0Cv6E_8Cwk3jKXGkneWFJYSeMAts" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9mb28vMTU1NjgzNTkyMjM2NzM3MSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMy9vL2ZvbyIsIm5hbWUiOiJmb28iLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDMiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkyMjM2NzM3MSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyMi4zNjZaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjU6MjIuMzY2WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjIyLjM2NloiLCJzaXplIjoiNSIsIm1kNUhhc2giOiJYVUZBS3J4TEtuYTVjWjJSRUJmRmtnPT0iLCJtZWRpYUxpbmsiOiJodHRwczovL3d3dy5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VrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Im1uRzdUQT09IiwiZXRhZyI6IkNJdW5nZUh4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "7cfadd8c1e7c0bd8", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false\u0026userProject=veener-jba", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13099" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:22 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:22 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpjVnPaklKmbO8qV2lapwEIAwPjvf4HSJs3kNHHO_xZH4bV65pVPLKCb2qjMPCYSwEKRZzH6NpYjm6WlxsBdJnfBvpyRpIR017q9iJDyBcVPNUoDn8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJpbnRlZ3JhdGlvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2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lvbkBnY2xvdWQtZ29sYW5nLWZpcmVzdG9yZS10ZXN0cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSBkb2VzIG5vdCBoYXZlIHNlcnZpY2V1c2FnZS5zZXJ2aWNlcy51c2UgYWNjZXNzIHRvIHByb2plY3QgNjQyMDgwOTE4MTAxLiJ9fQ==" - } - }, - { - "ID": "b1381b9995cf35f5", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/foo?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:23 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrD1hmfKK3yAwFXKqIwvCsEVMb_e7MWysJc7zbyVjZ_sbD9P41lzc0gYSef9yl8CRa6B0RtPq14V5MBSdy6C0i_cAkgANDN1da3O5QKELvACU11moU" - ] - }, - "Body": "" - } - }, - { - "ID": "5e06ccad06bbd110", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/copy?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:23 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur2FRcf4QGZH2KhkP3kATb9eOy4S9lgrA3NQXYqhc1KBZDbcZN5NHF4MB6WiTxOraNE0HhkW3SOg8sp1gS4kAcWRZ2G0EGWmLgL6RUcwr3a2O-WY10" - ] - }, - "Body": "" - } - }, - { - "ID": "b637ccaa36faa55b", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003/o/compose?alt=json\u0026prettyPrint=false\u0026userProject=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:23 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqGzSAdUK8pPs53JjaSJVQJObMJRsfQ5FIpSL0D4tNfft68cfE8Xb5fjSsAQG_PfmKZyX1Ind-s6dW6FgwREeHzu_OnEeOwCOaT8EZi2N4vNeWLvac" - ] - }, - "Body": "" - } - }, - { - "ID": "15055c361faad5c1", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0003?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:24 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqwmXVRTmXX3P5iId4-EjuA1oviIQD-Vbdr7M5rgd7d5IxNvmPVkZz_zFyMBNoHd_DzXnPMN5R7grAe1yDdOzbyafIBwRcFsLh4r0a7ghp4LkNSLZk" - ] - }, - "Body": "" - } - }, - { - "ID": "307f8a44d4ce6e9f", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/notificationConfigs?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "32" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:24 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:24 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpaHmcEJBKGI7CtW9fK8-j5Z-oRk_dTwMS40wVaoNH1PN7k6x6d_9aD3w3ce6WGZJF5OYxkdoifp6L2vVz5lIGjzcmmIZ4Wxp1vktBOv8hLa417Mp4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNub3RpZmljYXRpb25zIn0=" - } - }, - { - "ID": "f8df88961018be68", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/notificationConfigs?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "121" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJwYXlsb2FkX2Zvcm1hdCI6Ik5PTkUiLCJ0b3BpYyI6Ii8vcHVic3ViLmdvb2dsZWFwaXMuY29tL3Byb2plY3RzL2Rla2xlcmstc2FuZGJveC90b3BpY3MvZ28tc3RvcmFnZS1ub3RpZmljYXRpb24tdGVzdCJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "297" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:24 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqWiAA6LvnU4rExe2rVTwwFd51SI93o_d2tOj9OY1jk_qe1Yd1eiTXIa2eNecJQsmgwuFr4BUQoWy8ndutrCqGucmVIRL0jA6-i-vaGGVRF8uEe0AM" - ] - }, - "Body": "eyJpZCI6IjExIiwidG9waWMiOiIvL3B1YnN1Yi5nb29nbGVhcGlzLmNvbS9wcm9qZWN0cy9kZWtsZXJrLXNhbmRib3gvdG9waWNzL2dvLXN0b3JhZ2Utbm90aWZpY2F0aW9uLXRlc3QiLCJwYXlsb2FkX2Zvcm1hdCI6Ik5PTkUiLCJldGFnIjoiMTEiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvbm90aWZpY2F0aW9uQ29uZmlncy8xMSIsImtpbmQiOiJzdG9yYWdlI25vdGlmaWNhdGlvbiJ9" - } - }, - { - "ID": "45f44fa6c3668273", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/notificationConfigs?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "340" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:25 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:25 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoFWgB9V-ilyDIBP7KEF3SY7uTg-rikYE1ooEgWYkiXb2cW6oOwwtH1W7oe24WU2A9oyJIGOSskz3_icHqmMn7CfPoZQ-Lu5QdtZzv_5062_-UzAt0" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNub3RpZmljYXRpb25zIiwiaXRlbXMiOlt7ImlkIjoiMTEiLCJ0b3BpYyI6Ii8vcHVic3ViLmdvb2dsZWFwaXMuY29tL3Byb2plY3RzL2Rla2xlcmstc2FuZGJveC90b3BpY3MvZ28tc3RvcmFnZS1ub3RpZmljYXRpb24tdGVzdCIsInBheWxvYWRfZm9ybWF0IjoiTk9ORSIsImV0YWciOiIxMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9ub3RpZmljYXRpb25Db25maWdzLzExIiwia2luZCI6InN0b3JhZ2Ujbm90aWZpY2F0aW9uIn1dfQ==" - } - }, - { - "ID": "08c2546e2c262ee7", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/notificationConfigs/11?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:25 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoTmXr5TZZPRnABz_XbbZpjwU3iPz2e802RkcmNFr3sLzUx205tdmAb6vVWMNlYMUGZ5tGoddlqQ_oPnz0Xdvpz8CiD2eDLMDyrMbxVFjc3BinwBo0" - ] - }, - "Body": "" - } - }, - { - "ID": "efc8b67f9c2f4b40", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/notificationConfigs?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "32" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:25 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:25 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UraMBYT56qFvKLe_OPJfpJRhTy2qSpQyRjP6CScOnnijgaQ88eQtVahktX_Vsvy-G7J11d7GNT64FnpqZrewu1sUmuNNLiEtmkqVFILdNcWed6i1w4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNub3RpZmljYXRpb25zIn0=" - } - }, - { - "ID": "6dd92f9ce3b15a57", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/gcp-public-data-landsat/LC08/PRE/044/034/LC80440342016259LGN00/LC80440342016259LGN00_MTL.txt", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "7903" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:25:25 GMT" - ], - "Etag": [ - "\"7a5fd4743bd647485f88496fadb05c51\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:25 GMT" - ], - "Last-Modified": [ - "Tue, 04 Oct 2016 16:42:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1475599327662000" - ], - "X-Goog-Hash": [ - "crc32c=PWBt8g==", - "md5=el/UdDvWR0hfiElvrbBcUQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "7903" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpedRCcxIOhXCWdipyV2E0R3z00CUlOK6rPlof1gpKuQbLeJmvMoPFn28o8zqmmeVJ5rbX41bB6Hp116-_ISgEXl4Htmc1VS0Aq41lJQiN_mIvozbY" - ] - }, - "Body": "R1JPVVAgPSBMMV9NRVRBREFUQV9GSUxFCiAgR1JPVVAgPSBNRVRBREFUQV9GSUxFX0lORk8KICAgIE9SSUdJTiA9ICJJbWFnZSBjb3VydGVzeSBvZiB0aGUgVS5TLiBHZW9sb2dpY2FsIFN1cnZleSIKICAgIFJFUVVFU1RfSUQgPSAiMDcwMTYwOTE5MTA1MV8wMDAwNCIKICAgIExBTkRTQVRfU0NFTkVfSUQgPSAiTEM4MDQ0MDM0MjAxNjI1OUxHTjAwIgogICAgRklMRV9EQVR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T05fUEFSQU1FVEVSUwogICAgTUFQX1BST0pFQ1RJT04gPSAiVVRNIgogICAgREFUVU0gPSAiV0dTODQiCiAgICBFTExJUFNPSUQgPSAiV0dTODQiCiAgICBVVE1fWk9ORSA9IDEwCiAgICBHUklEX0NFTExfU0laRV9QQU5DSFJPTUFUSUMgPSAxNS4wMAogICAgR1JJRF9DRUxMX1NJWkVfUkVGTEVDVElWRSA9IDMwLjAwCiAgICBHUklEX0NFTExfU0laRV9USEVSTUFMID0gMzAuMDAKICAgIE9SSUVOVEFUSU9OID0gIk5PUlRIX1VQIgogICAgUkVTQU1QTElOR19PUFRJT04gPSAiQ1VCSUNfQ09OVk9MVVRJT04iCiAgRU5EX0dST1VQID0gUFJPSkVDVElPTl9QQVJBTUVURVJTCkVORF9HUk9VUCA9IEwxX01FVEFEQVRBX0ZJTEUKRU5ECg==" - } - }, - { - "ID": "914cb60452456134", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/gcp-public-data-landsat/o?alt=json\u0026delimiter=\u0026pageToken=\u0026prefix=LC08%2FPRE%2F044%2F034%2FLC80440342016259LGN00%2F\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "12632" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:26 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:26 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpLE4EijIrGqoHRLrCqmprZtxBU2JtHLLsZ-nIakblnuZX8s6FZA1SEaczyybdjB32loN1-gVCf83PFM4x06S24ATKp9-xRgQ9QNC9fwVH_ec4e9JQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ2NwLXB1YmxpYy1kYXRhLWxhbmRzYXQvTEMwOC9QUkUvMDQ0LzAzNC9MQzgwNDQwMzQyMDE2MjU5TEdOMDAvTEM4MDQ0MDM0MjAxNjI1OUxHTjAwX0IxLlRJRi8xNDc1NTk5MTQ0NTc5MDAwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ2NwLXB1YmxpYy1kYXRhLWxhbmRzYXQvby9MQzA4JTJGUFJFJTJGMDQ0JTJGMDM0JTJGTEM4MDQ0MDM0MjAxNjI1OUxHTjAwJTJGTEM4MDQ0MDM0MjAxNjI1OUxHTjAwX0IxLlRJRiIsIm5hbWUiOiJMQzA4L1BSRS8wNDQvMDM0L0xDODA0NDAzNDIwMTYyNTlMR04wMC9MQzgwNDQwMzQyMDE2MjU5TEdOMDBfQjEuVElGIiwiYnVja2V0IjoiZ2NwLXB1YmxpYy1kYXRhLWxhbmRzYXQiLCJnZW5lcmF0aW9uIjoiMTQ3NTU5OTE0NDU3OTAwMCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIiwidGltZUNyZWF0ZWQiOiIyMDE2LTEwLTA0VDE2OjM5OjA0LjU0NVoiLCJ1cGRhdGVkIjoiMjAxNi0xMC0wNFQxNjozOTowNC41NDVaIiwic3Rvcm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HZyYkJjVVE9PSIsIm1lZGlhTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2Rvd25sb2FkL3N0b3JhZ2UvdjEvYi9nY3AtcHVibGljLWRhdGEtbGFuZHNhdC9vL0xDMDglMkZQUkUlMkYwNDQlMkYwMzQlMkZMQzgwNDQwMzQyMDE2MjU5TEdOMDAlMkZMQzgwNDQwMzQyMDE2MjU5TEdOMDBfTVRMLnR4dD9nZW5lcmF0aW9uPTE0NzU1OTkzMjc2NjIwMDAmYWx0PW1lZGlhIiwiY3JjMzJjIjoiUFdCdDhnPT0iLCJldGFnIjoiQ0xDZmh1N0x3YzhDRUFFPSJ9XX0=" - } - }, - { - "ID": "3f3f45cd2b718e17", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/noauth", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "247" - ], - "Content-Type": [ - "application/xml; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:26 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:26 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqsZlmkTyf2_fqITeaIiM8s2MLUvz5qFiP_rzA4Mf6Q9LMxsiQeP-GBRwHON_XvnG2qef3XL1EzgTLA_GxtLKZRjdzOBndJPf9XbJa9KjJCIPlducQ" - ] - }, - "Body": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48RXJyb3I+PENvZGU+QWNjZXNzRGVuaWVkPC9Db2RlPjxNZXNzYWdlPkFjY2VzcyBkZW5pZWQuPC9NZXNzYWdlPjxEZXRhaWxzPkFub255bW91cyBjYWxsZXIgZG9lcyBub3QgaGF2ZSBzdG9yYWdlLm9iamVjdHMuZ2V0IGFjY2VzcyB0byBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvbm9hdXRoLjwvRGV0YWlscz48L0Vycm9yPg==" - } - }, - { - "ID": "110cdd2daefc6162", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoibm9hdXRoIn0K", - "Yg==" - ] - }, - "Response": { - "StatusCode": 401, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "30405" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:26 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "Www-Authenticate": [ - "Bearer realm=\"https://accounts.google.com/\"" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrGgfg36ZmqdKbc0NqBivwXULVnF2NuBAD31rJqzC5Rj9xgHFbRnwxJCbdxCuUdlAhGW_-H88mBadNGmqch0fmAyAd80HPANBkUmIgkolsL4HK7XAU" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6InJlcXVpcmVkIiwibWVzc2FnZSI6IkFub255bW91cyBjYWxsZXIgZG9lcyBub3QgaGF2ZSBzdG9yYWdlLm9iamVjdHMuY3JlYXRlIGFjY2VzcyB0byBnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvbm9hdXRoLiIsImxvY2F0aW9uVHlwZSI6ImhlYWRlciIsImxvY2F0aW9uIjoiQXV0aG9yaXphdGlvbiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpBQ0NFU1NfREVOSUVEOiBBbm9ueW1vdXMgY2FsbGVyIGRvZXMgbm90IGhhdmUgc3RvcmFnZS5vYmplY3RzLmNyZWF0ZSBhY2Nlc3MgdG8gZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL25vYXV0aC5cblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MTQ3KVxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi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Rlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9ub2F1dGguIn19" - } - }, - { - "ID": "848c7013eb1665b1", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/gcp-public-data-landsat/LC08/PRE/044/034/LC80440342016259LGN00/LC80440342016259LGN00_MTL.txt", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "7903" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"7a5fd4743bd647485f88496fadb05c51\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 04 Oct 2016 16:42:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1475599327662000" - ], - "X-Goog-Hash": [ - "crc32c=PWBt8g==", - "md5=el/UdDvWR0hfiElvrbBcUQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "7903" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqbrgn51bDFbwZ1c2_BxCHhog7If9w6ooKAtb2YCerQcObpiFJZqT3-Jn7zTXEEPVuysmxKw4PmvEOmkbCAJVkmbEVZm6z877JKFhrXTrkWqWYooq8" - ]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BUSVJTX1RIRVJNQUxfQ09OU1RBTlRTCiAgICBLMV9DT05TVEFOVF9CQU5EXzEwID0gNzc0Ljg4NTMKICAgIEsxX0NPTlNUQU5UX0JBTkRfMTEgPSA0ODAuODg4MwogICAgSzJfQ09OU1RBTlRfQkFORF8xMCA9IDEzMjEuMDc4OQogICAgSzJfQ09OU1RBTlRfQkFORF8xMSA9IDEyMDEuMTQ0MgogIEVORF9HUk9VUCA9IFRJUlNfVEhFUk1BTF9DT05TVEFOVFMKICBHUk9VUCA9IFBST0pFQ1RJT05fUEFSQU1FVEVSUwogICAgTUFQX1BST0pFQ1RJT04gPSAiVVRNIgogICAgREFUVU0gPSAiV0dTODQiCiAgICBFTExJUFNPSUQgPSAiV0dTODQiCiAgICBVVE1fWk9ORSA9IDEwCiAgICBHUklEX0NFTExfU0laRV9QQU5DSFJPTUFUSUMgPSAxNS4wMAogICAgR1JJRF9DRUxMX1NJWkVfUkVGTEVDVElWRSA9IDMwLjAwCiAgICBHUklEX0NFTExfU0laRV9USEVSTUFMID0gMzAuMDAKICAgIE9SSUVOVEFUSU9OID0gIk5PUlRIX1VQIgogICAgUkVTQU1QTElOR19PUFRJT04gPSAiQ1VCSUNfQ09OVk9MVVRJT04iCiAgRU5EX0dST1VQID0gUFJPSkVDVElPTl9QQVJBTUVURVJTCkVORF9HUk9VUCA9IEwxX01FVEFEQVRBX0ZJTEUKRU5ECg==" - } - }, - { - "ID": "a5f818071a0f22da", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/gcp-public-data-landsat/LC08/PRE/044/034/LC80440342016259LGN00/LC80440342016259LGN00_MTL.txt", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "7903" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"7a5fd4743bd647485f88496fadb05c51\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 04 Oct 2016 16:42:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1475599327662000" - ], - "X-Goog-Hash": [ - "crc32c=PWBt8g==", - "md5=el/UdDvWR0hfiElvrbBcUQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "7903" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrozB-0-kEtkjITLFZA2uQpw77J_Zc6GErrYrIyxkPTWeUHJNBRLw4JXhyIEFG8szc7bhqblQVKoKYiZ4myOcfL5zIM9KYGIbCyAP9e4sEEdx2pBe0" - ] - }, - "Body": "R1JPVVAgPSBMMV9NRVRBREFUQV9GSUxFCiAgR1JPVVAgPSBNRVRBREFUQV9GSUxFX0lORk8KICAgIE9SSUdJTiA9ICJJbWFnZSBjb3VydGVzeSBvZiB0aGUgVS5TLiBHZW9sb2dpY2FsIFN1cnZleSIKICAgIFJFUVVFU1RfSUQgPSAiMDcwMTYwOTE5MTA1MV8wMDAwNCIKICAgIExBTkRTQVRfU0NFTkVfSUQgPSAiTEM4MDQ0MDM0MjAxNjI1OUxHTjAwIgogICAgRklMRV9EQVRFID0gMjAxNi0wOS0yMFQwMzoxMzowMloKICAgIFNUQVRJT05fSUQgPSAiTEdOIgogICAgUFJPQ0VTU0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iAgICBFTExJUFNPSUQgPSAiV0dTODQiCiAgICBVVE1fWk9ORSA9IDEwCiAgICBHUklEX0NFTExfU0laRV9QQU5DSFJPTUFUSUMgPSAxNS4wMAogICAgR1JJRF9DRUxMX1NJWkVfUkVGTEVDVElWRSA9IDMwLjAwCiAgICBHUklEX0NFTExfU0laRV9USEVSTUFMID0gMzAuMDAKICAgIE9SSUVOVEFUSU9OID0gIk5PUlRIX1VQIgogICAgUkVTQU1QTElOR19PUFRJT04gPSAiQ1VCSUNfQ09OVk9MVVRJT04iCiAgRU5EX0dST1VQID0gUFJPSkVDVElPTl9QQVJBTUVURVJTCkVORF9HUk9VUCA9IEwxX01FVEFEQVRBX0ZJTEUKRU5ECg==" - } - }, - { - "ID": "55eeb942e5603431", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/gcp-public-data-landsat/LC08/PRE/044/034/LC80440342016259LGN00/LC80440342016259LGN00_MTL.txt", - "Header": { - "Range": [ - "bytes=1-" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 206, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "7902" - ], - "Content-Range": [ - "bytes 1-7902/7903" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"7a5fd4743bd647485f88496fadb05c51\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 04 Oct 2016 16:42:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1475599327662000" - ], - "X-Goog-Hash": [ - "crc32c=PWBt8g==", - "md5=el/UdDvWR0hfiElvrbBcUQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "7903" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqlAytrsQn43Os8JxSOx4C8v9ApqqtqwEE7kZ-voKAcmcYe32lG7ANHxzNrwkqN8bbLLohoAHd88brZDVaC3U6Q01dhBBoeDFnlkCzHKUJjA8ZWrgM" - ] - }, - "Body": "Uk9VUCA9IEwxX01FVEFEQVRBX0ZJTEUKICBHUk9VUCA9IE1FVEFEQVRBX0ZJTEVfSU5GTwogICAgT1JJR0lOID0gIkltYWdlIGNvdXJ0ZXN5IG9mIHRoZSBVLlMuIEdlb2xvZ2ljYWwgU3VydmV5IgogICAgUkVRVUVTVF9JRCA9ICIwNzAxNjA5MTkxMDUxXzAwMDA0IgogICAgTEFORFNBVF9TQ0VORV9JRCA9ICJMQzgwNDQwMzQyMDE2MjU5TEdOMDAiCiAgICBGSUxFX0RBVEUgPSAyMDE2LTA5LTIwVDAzOjEzOjAyWgogICAgU1RBVElPTl9JRCA9ICJMR04iCiAgICBQUk9DRVNTSU5HX1NPRlRXQVJFX1ZFUlNJT04gPSAiTFBHU18yLjYuMiIKICBFTkRfR1JPVVAgPSBNRVRBREFUQV9GSUxFX0lORk8KICBHUk9VUCA9IFBST0RVQ1RfTUVUQURBVEEKICAgIERBVEFfVFlQRSA9ICJMMVQiCiAgICBFTEVWQVRJT05fU09VUkNFID0gIkdMUzIwMDAiCiAgICBPVVRQVVRfRk9STUFUID0gIkdFT1RJRkYiCiAgICBTUEFDRUNSQUZUX0lEID0gIkxBTkRTQVRfOCIKICAgIFNFTlNPUl9JRCA9ICJPTElfVElSUyIKICAgIFdSU19QQVRIID0gNDQKICAgIFdS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TkQK" - } - }, - { - "ID": "320dc27adc377057", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/gcp-public-data-landsat/LC08/PRE/044/034/LC80440342016259LGN00/LC80440342016259LGN00_MTL.txt", - "Header": { - "Range": [ - "bytes=0-17" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 206, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "18" - ], - "Content-Range": [ - "bytes 0-17/7903" - ], - "Content-Type": [ - "application/octet-stream" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"7a5fd4743bd647485f88496fadb05c51\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 04 Oct 2016 16:42:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1475599327662000" - ], - "X-Goog-Hash": [ - "crc32c=PWBt8g==", - "md5=el/UdDvWR0hfiElvrbBcUQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "7903" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UovperPufphUvaf55r54Wd-USAbL2ZQVTseICyulStqI633iJcFBLryyqecsHQcoU2cXp4MsKgB8uQu979IXcnv-aGNm6viDydIrqmPqA7SmPElPGI" - ] - }, - "Body": "R1JPVVAgPSBMMV9NRVRBREFU" - } - }, - { - "ID": "a20a4e3b35dfd271", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/storage-library-test-bucket/gzipped-text.txt", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Encoding": [ - "gzip" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"c6117833aa4d1510d09ef69144d56790\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 14 Nov 2017 13:07:32 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Accept-Encoding" - ], - "X-Goog-Generation": [ - "1510664852486988" - ], - "X-Goog-Hash": [ - "crc32c=T1s5RQ==", - "md5=xhF4M6pNFRDQnvaRRNVnkA==" - ], - "X-Goog-Metageneration": [ - "2" - ], - "X-Goog-Storage-Class": [ - "MULTI_REGIONAL" - ], - "X-Goog-Stored-Content-Encoding": [ - "gzip" - ], - "X-Goog-Stored-Content-Length": [ - "31" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq7491k1eCc7fe_JApsP1zDcSyo759KmHvh-9YHm9ekpOGaG8v1bZNPjaMEkikJSDYt_LkVMHrb9HTDx9vvDGy3Zm1kPrlxS4933Sw-Wdh35lDomi4" - ] - }, - "Body": "H4sIAAAAAAAAC8tIzcnJVyjPL8pJAQCFEUoNCwAAAA==" - } - }, - { - "ID": "d1941f2e08f3bc52", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/storage-library-test-bucket/gzipped-text.txt", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Encoding": [ - "gzip" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"c6117833aa4d1510d09ef69144d56790\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 14 Nov 2017 13:07:32 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Accept-Encoding" - ], - "X-Goog-Generation": [ - "1510664852486988" - ], - "X-Goog-Hash": [ - "crc32c=T1s5RQ==", - "md5=xhF4M6pNFRDQnvaRRNVnkA==" - ], - "X-Goog-Metageneration": [ - "2" - ], - "X-Goog-Storage-Class": [ - "MULTI_REGIONAL" - ], - "X-Goog-Stored-Content-Encoding": [ - "gzip" - ], - "X-Goog-Stored-Content-Length": [ - "31" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoYIJ-m0VbRdjw7ZGI_0TiIfj6fcuhJkomWPdQGApFxH2_LnekHIdv7igEpJAM3a-zrTOzR20bzvc-JBunTe_-f_Hsyxz_VPxJNrQY7PSrQ3OMfEhQ" - ] - }, - "Body": "H4sIAAAAAAAAC8tIzcnJVyjPL8pJAQCFEUoNCwAAAA==" - } - }, - { - "ID": "2451a87df39e1241", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/storage-library-test-bucket/gzipped-text.txt", - "Header": { - "Range": [ - "bytes=1-8" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "W/\"c6117833aa4d1510d09ef69144d56790\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 14 Nov 2017 13:07:32 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Accept-Encoding" - ], - "Warning": [ - "214 UploadServer gunzipped" - ], - "X-Goog-Generation": [ - "1510664852486988" - ], - "X-Goog-Hash": [ - "crc32c=T1s5RQ==", - "md5=xhF4M6pNFRDQnvaRRNVnkA==" - ], - "X-Goog-Metageneration": [ - "2" - ], - "X-Goog-Storage-Class": [ - "MULTI_REGIONAL" - ], - "X-Goog-Stored-Content-Encoding": [ - "gzip" - ], - "X-Goog-Stored-Content-Length": [ - "31" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Response-Body-Transformations": [ - "gunzipped" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoNfvi75DBdUL5KpenQbqbsYr5A8YSQp2lGAPIhe4FlijJP95WctTUrdrLIyq3riprP50HzntCuw7zh5ycZfqbJBkFbibeIwEp5bVDj7yVpJbqctiI" - ] - }, - "Body": "aGVsbG8gd29ybGQ=" - } - }, - { - "ID": "f0e47a86731e8924", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/storage-library-test-bucket/gzipped-text.txt", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Range": [ - "bytes=1-8" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 206, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Encoding": [ - "gzip" - ], - "Content-Range": [ - "bytes 1-8/31" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:25:27 GMT" - ], - "Etag": [ - "\"c6117833aa4d1510d09ef69144d56790\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:25:27 GMT" - ], - "Last-Modified": [ - "Tue, 14 Nov 2017 13:07:32 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Accept-Encoding" - ], - "X-Goog-Generation": [ - "1510664852486988" - ], - "X-Goog-Hash": [ - "crc32c=T1s5RQ==", - "md5=xhF4M6pNFRDQnvaRRNVnkA==" - ], - "X-Goog-Metageneration": [ - "2" - ], - "X-Goog-Storage-Class": [ - "MULTI_REGIONAL" - ], - "X-Goog-Stored-Content-Encoding": [ - "gzip" - ], - "X-Goog-Stored-Content-Length": [ - "31" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upzmwe6UNntf6SxdYLZTz0aZiFJ7UANU6y7I2YKJbADGSVoCRe63OoxcC4uh-9n2JEnkvQgq0dwCHCbQ3qmYG4cWFEovG_fIMKFx6O11iPQUhLmeFw" - ] - }, - "Body": "iwgAAAAAAAA=" - } - }, - { - "ID": "2a14c414736e344d", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "168" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJjb3JzIjpbeyJtYXhBZ2VTZWNvbmRzIjozNjAwLCJtZXRob2QiOlsiUE9TVCJdLCJvcmlnaW4iOlsic29tZS1vcmlnaW4uY29tIl0sInJlc3BvbnNlSGVhZGVyIjpbImZvby1iYXIiXX1dLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA0In0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "593" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:28 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrgiftU7BDllYqI1jhKj6RbZME3LoakRb653ThaSSD_kzX1O5odabBcDFfG-oswR6YOcDZTW174qxbUaa2G1EvajUt_wJAD3ViGgoMwT_YjoTvObkc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA0IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjI4LjAwOVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyOC4wMDlaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJjb3JzIjpbeyJvcmlnaW4iOlsic29tZS1vcmlnaW4uY29tIl0sIm1ldGhvZCI6WyJQT1NUIl0sInJlc3BvbnNlSGVhZGVyIjpbImZvby1iYXIiXSwibWF4QWdlU2Vjb25kcyI6MzYwMH1dLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "b03cb69547c1a6de", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0004?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "99" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJjb3JzIjpbeyJtYXhBZ2VTZWNvbmRzIjozNjAwLCJtZXRob2QiOlsiR0VUIl0sIm9yaWdpbiI6WyIqIl0sInJlc3BvbnNlSGVhZGVyIjpbInNvbWUtaGVhZGVyIl19XX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2528" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:28 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urw36CL-_RvF58GoVX1bJlTZ1YUUdWXJKQDIac7eTOYj5s65KYFsk2ndonwA5ro_9nGPfo4qRIYyt7J1Xxb01TiJUQPRXzH-z9T_S5UQE6fxOssN0g" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA0IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjI4LjAwOVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyOC43Mj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bnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImNvcnMiOlt7Im9yaWdpbiI6WyIqIl0sIm1ldGhvZCI6WyJHRVQiXSwicmVzcG9uc2VIZWFkZXIiOlsic29tZS1oZWFkZXIiXSwibWF4QWdlU2Vjb25kcyI6MzYwMH1dLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "735da673f622341d", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0004?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2528" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:29 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:29 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urb-FeCpjdYOEj6HdkFXRMfVXffmMB8xjLqLwPvjgs3FghXs7r94UrXEpX0rW_CgEpjG6v6iHCWCkwxib31kFkLPMZMMZxHTy66dPT2AdBDsIE8Y8k" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA0IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjI4LjAwOVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyOC43MjRaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNj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IsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImNvcnMiOlt7Im9yaWdpbiI6WyIqIl0sIm1ldGhvZCI6WyJHRVQiXSwicmVzcG9uc2VIZWFkZXIiOlsic29tZS1oZWFkZXIiXSwibWF4QWdlU2Vjb25kcyI6MzYwMH1dLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "97ce23a7211781ed", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "168" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJjb3JzIjpbeyJtYXhBZ2VTZWNvbmRzIjozNjAwLCJtZXRob2QiOlsiUE9TVCJdLCJvcmlnaW4iOlsic29tZS1vcmlnaW4uY29tIl0sInJlc3BvbnNlSGVhZGVyIjpbImZvby1iYXIiXX1dLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA1In0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "593" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:30 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrqrjU-mu7dGgY6-CuNd9AwgGuKtQ_O589el9eyWSAb54cDYnQN74dl8HxRVzIUayStgIinEuuux2afAlvkUGm9lhrefX8nugBXNL2lGluNcfQKfRo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA1IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjI5LjcyNFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyOS43MjRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJjb3JzIjpbeyJvcmlnaW4iOlsic29tZS1vcmlnaW4uY29tIl0sIm1ldGhvZCI6WyJQT1NUIl0sInJlc3BvbnNlSGVhZGVyIjpbImZvby1iYXIiXSwibWF4QWdlU2Vjb25kcyI6MzYwMH1dLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "a8f5b1c42d7a3c5f", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0005?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "12" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJjb3JzIjpbXX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:30 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpZ4q-BeojZ4WgF5ZHNzJG7sIvdOxmprH5GqoQ3DM-QllSzHWOw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y00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "cab9472f01ed4bd5", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0005?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:31 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:31 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo0__TFFuzUsEi6Eck0G1lblGy_1abmyPHERWBavjN2GHncyWWnKQ6yYaFDpDVQ-kfBS15M6H9NoxXUDS0hZ9VX8S9hK4rUGAAFWXznHjOntSK5ldY" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF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N0QWNsIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBST0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "7a196e6b35872d48", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "168" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJjb3JzIjpbeyJtYXhBZ2VTZWNvbmRzIjozNjAwLCJtZXRob2QiOlsiUE9TVCJdLCJvcmlnaW4iOlsic29tZS1vcmlnaW4uY29tIl0sInJlc3BvbnNlSGVhZGVyIjpbImZvby1iYXIiXX1dLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA2In0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "593" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:31 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpJhdZl7X4YXxzKdcr7SJ3C6Xadtlo0ixoS8DNO1jaDHs5MeGKu9nx2pHWPpnUWd13HZ8inxG0pMh3un84TucDfyLu4Z-5Gp7Ka3HBfPnt_w_VTiuE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA2IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMxLjQwN1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozMS40MDdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJjb3JzIjpbeyJvcmlnaW4iOlsic29tZS1vcmlnaW4uY29tIl0sIm1ldGhvZCI6WyJQT1NUIl0sInJlc3BvbnNlSGVhZGVyIjpbImZvby1iYXIiXSwibWF4QWdlU2Vjb25kcyI6MzYwMH1dLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "24b6a3b712ccab17", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0006?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2539" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:31 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqe_Q9NPVf3WTO_It8-A42wh0FD3KyF4kopi6posCEX6l28cnowG8O7WSYwETklwvpp0Uk1fCXiVmgwqLlWCSc3ez-nYllKp5m_UVtxup1E1UNadGg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA2IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMxLjQwN1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozMS40MDdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDYvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9z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C12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImNvcnMiOlt7Im9yaWdpbiI6WyJzb21lLW9yaWdpbi5jb20iXSwibWV0aG9kIjpbIlBPU1QiXSwicmVzcG9uc2VIZWFkZXIiOlsiZm9vLWJhciJdLCJtYXhBZ2VTZWNvbmRzIjozNjAwfV0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "ebed90fad884e1cd", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0006?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2539" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:32 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:32 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrjLjhrtR5T2TdsRM6X3HPy_6vnZjhUfpjytCivwknDLKhiMkND-f1qeZ4te6AnGrv_qtnGI4OGajQJaydHJvQZGWpnBQN9VOXHqYjSBTCxnNbcbC4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA2IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMxLjQwN1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozMS40MDdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDYvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA2L2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3M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VhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImNvcnMiOlt7Im9yaWdpbiI6WyJzb21lLW9yaWdpbi5jb20iXSwibWV0aG9kIjpbIlBPU1QiXSwicmVzcG9uc2VIZWFkZXIiOlsiZm9vLWJhciJdLCJtYXhBZ2VTZWNvbmRzIjozNjAwfV0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "31ee7f558375c66a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0006?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:32 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up70C3kZ6tTqgyRHbTyjXA5pLWMohouKPHCPhexU8UuWw0cAmLxjHcwaa2xBT-Soq-CLyVxoWeEkxFMhRqqK87xaM38Q2hSjGkeXEhmhoZ3iy5s6D8" - ] - }, - "Body": "" - } - }, - { - "ID": "72458186a1839a5a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0005?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:32 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpsiYUGF50kaeS-bMsAR51mlDVCwH9HwmqU1hCFSwzrMDgCmGF46ZuQGfqWx4SJprlBWIxaNwT_EQMKQrTQARvFyee5ZOJq21xZUsVEc1iBW0KkiVk" - ] - }, - "Body": "" - } - }, - { - "ID": "20fcdf5cb9502a64", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0004?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:33 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up8ALydoTkq1rLUaKiwrh6YEhczTwI3VX8iKuCNoqr6N2BSBvtxD2Qc9De99Svk_4EX82rynlWctsS2F9Ffr4WuDby30_W1Fl7TMWFZGWfo5Wc_nfI" - ] - }, - "Body": "" - } - }, - { - "ID": "ace99589753f3389", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA3In0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "485" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:33 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UotVHCMZG4hcbTx20gUPBV1LsUxIAVuDym9d21c2In0VVLzBxOM_DAULuLEd9LTMmpNg6A7yW4yqEsnRlHhAaMbpe7MwAWbadF2gJJ2M7uGdA-rcLQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMzLjcwNVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozMy43MDVaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "466aeae01d2d2933", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0007?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:34 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:34 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoVuGt1j5ranQuT0nS5bzOIcVM5M42RwIHcF2mKK_H1ctJEqC_djWDMm00OBFXY4yxsTFdQ1ZYjWVnFq8GhUAWUsvsj4_B9Ur8MzJQcbAzG9vHgIjs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXR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ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBRT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "34d8505e483be050", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0007?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "31" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZWZhdWx0RXZlbnRCYXNlZEhvbGQiOnRydWV9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2460" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:34 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo5A5V7O5JcpElASqEqUZ_UiEjPa-39PCu3SwJk8EE9cHfyeVL5DWQkAss8k9iRx7YjD4ZC7WnzE_ENz95PuKdccjgzeC2GLFAUzA-sR2iEf-lNil4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMzLjcwNVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozNC42MzJaIiwibWV0YWdlbmVyYXRp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wcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImRlZmF1bHRFdmVudEJhc2VkSG9sZCI6dHJ1ZSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "728568d994e275c7", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0007?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2460" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:34 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:34 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrOVH8W8OREkTrF0UKlK3dOp_AAbRF7Rsx16Zbjdl5caBObFjXETVORm7o-d-YYcPIjcrx1mKcQwxHCIXpdE5P6baH6WeY3Wc3JVF7UcQnKna-a_U4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMzLjcwNVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozNC42MzJaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDcvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS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12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImRlZmF1bHRFdmVudEJhc2VkSG9sZCI6dHJ1ZSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "b7230d8a6b23fd8b", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0007?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "35" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9fQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2493" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:35 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uouwpmid1Y6D0uXWBb_WrmlZVHKYnw0RGbreddchrmPzQUE1H_DeclZnbl6Yb2346L4YNt44ZeZWEM2u46h7Zx45lw9rUFxZDQIvlXRn4vT6fW4WQQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjMzLjcwNVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozNS4zMzNaIiwibWV0YWdlbmVyYXRpb24iOiIzIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDcvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA3L2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQiLCJidWNrZ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ifSwiZXRhZyI6IkNBTT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsImRlZmF1bHRFdmVudEJhc2VkSG9sZCI6dHJ1ZSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9LCJldGFnIjoiQ0FNPSJ9" - } - }, - { - "ID": "ec9da9e78b750503", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0007?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2493" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:35 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:35 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq25oUSnJMHsIEARHohSGtkz5vw7RCXuQupRBliEjCXMeivgUIK0y9C3U4yWEJ-_182SvGUQLvo5rXxymcoyahwAEhfe21FJU_M2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EJhc2VkSG9sZCI6dHJ1ZSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJiaWxsaW5nIjp7InJlcXVlc3RlclBheXMiOnRydWV9LCJldGFnIjoiQ0FNPSJ9" - } - }, - { - "ID": "ad49d37f07d631a5", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0007?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq02fbr_iko_zBCbJljbMwyW7mOaz1cqR6AWHm2ac3m9BcqrUXNkmRqxk0R2rZW6SAUC_KzbOze-1wUGY2E0g6wbYLUqcb8IOdqN2-ROvYO49uxzjE" - ] - }, - "Body": "" - } - }, - { - "ID": "7b04c14c4e323488", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA4In0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "485" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:36 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrJrrmhbKyKRTvA3_mNqzRsaaMOAAlvn8UMwBiOR77-6X6m5InqoXMb4qoollPzgpcFOmchQ54jFNic0xJf-tiGu0tlrzSdbjh5Hzw8Rl3RnJy_jPw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA4IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjM2LjUwMVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozNi41MDFaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "ae3e9c648aaff158", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJuYW1lIjoic29tZS1vYmoifQo=", - "X7Xb+/Xtxt2fLTn7y+yBvw==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:37 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrJv7oOcHCzf9atnIPo70j3xSldrZtXTb5CmV1iuM4mMPU4hiBgpDqCAdUDI3i9hlR2qRie9qT30AJNshzO5CSsuzoTQ88W255VO8VVumaCSZ0KXZs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOC9zb21lLW9iai8xNTU2ODM1OTM3MTM3NDMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA4L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkzNzEzNzQzMCIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozNy4xMzdaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjU6MzcuMTM3WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjM3LjEzN1oiLCJzaXplIjoiMTYiLCJtZDVIYXNoIjoiZExyZG9WZ2p4bEFBR05hWVgxQm1idz09IiwibWVkaWFMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vZG93bmxvYW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NFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Ik01ZUcvQT09IiwiZXRhZyI6IkNKYm1odWp4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "e7a12fdbeb636933", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:37 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo-mQ6Bnw1qbAyHbMdumiv5YlTBrFQbHo-9tXn02VufGPTp3_Q8nXXp9VIcdRmzH2CJbhaVLu5fUFYZ6VKgcitBwcE-dCwxWrzaljgyT6zmM7x01ls" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc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0NvbnRyb2wiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOC9zb21lLW9iai8xNTU2ODM1OTM3MTM3NDMwL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgvby9zb21lLW9iai9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOCIsIm9iamVjdCI6InNvbWUtb2JqIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MzcxMzc0MzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSmJtaHVqeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Ik01ZUcvQT09IiwiZXRhZyI6IkNKYm1odWp4L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "142eb6c42bc6f90e", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "84" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJldmVudEJhc2VkSG9sZCI6dHJ1ZX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3215" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:37 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrBTG1gAXfMDmjm_clsDlv04E6VRtZUsUKnaVr4bC3AIRXILH2f0UebFf1_SmXPSf6Go8sw7TXti9yO112PAG5QNin3LwaSjRuFDSH_unnMZJwRceM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOC9zb21lLW9iai8xNTU2ODM1OTM3MTM3NDMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3Y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kZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgvby9zb21lLW9iai9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOCIsIm9iamVjdCI6InNvbWUtb2JqIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MzcxMzc0MzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSmJtaHVqeC9lRUNFQUk9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Ik01ZUcvQT09IiwiZXRhZyI6IkNKYm1odWp4L2VFQ0VBST0iLCJldmVudEJhc2VkSG9sZCI6dHJ1ZX0=" - } - }, - { - "ID": "12487e4f20538041", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3215" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:38 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqxyG_OCKjwh7TR9zL9nbOGPP1ttxni9cP68b18nTZ7wZ8WqVE0MAGh1XFphNYZEYr-2kdgNgmqQrOvFiNbg6hJi-RfjCWYg0KHPLKfzyWc-gejszc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOC9zb21lLW9iai8xNTU2ODM1OTM3MTM3NDMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA4L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkzNzEzNzQzMCIsIm1ldGFnZW5lcmF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JveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOCIsIm9iamVjdCI6InNvbWUtb2JqIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5MzcxMzc0MzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDSmJtaHVqeC9lRUNFQUk9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6Ik01ZUcvQT09IiwiZXRhZyI6IkNKYm1odWp4L2VFQ0VBST0iLCJldmVudEJhc2VkSG9sZCI6dHJ1ZX0=" - } - }, - { - "ID": "e3a625bb7418cea9", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "82" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJjb250ZW50VHlwZSI6ImZvbyJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:38 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoVf0XeyD5sC9KvHEILX2e7x7VyJ9d9xoyrP3NqGFlsMgvK3zgeOEOXDvSpftUSy4opndA74-LNRkmAi8Q_6wc91iC8OWV7X3VR8kENWwclNK30V_U" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOC9zb21lLW9iai8xNTU2ODM1OTM3MTM3NDMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA4L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkzNzEzNzQzMCIsIm1ldGFnZW5lcmF0aW9uIjoiMyIsImNvbnRlbnRUeXBlIjoiZm9vIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjM3LjEzN1oiLCJ1cGRhdGVkIjoi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ZS1vYmoiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkzNzEzNzQzMCIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNKYm1odWp4L2VFQ0VBTT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiTTVlRy9BPT0iLCJldGFnIjoiQ0pibWh1angvZUVDRUFNPSIsImV2ZW50QmFzZWRIb2xkIjp0cnVlfQ==" - } - }, - { - "ID": "2290ac6bb34b705b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:38 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoKagfJuJDLVLgIcrGtlV_UXlXLSqfEFj2-knllMBWWLktTv22ZfKoeSo8lY6gSfE1LKlvn87WiyJv75QWpcWdXzvablAMBOAZ_XMe-1D8dKZ5ipHs" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOC9zb21lLW9iai8xNTU2ODM1OTM3MTM3NDMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA4L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTkzNzEzNzQzMCIsIm1ldGFnZW5lcmF0aW9uIjoiMyIsImNvbnRlbnRUeXBlIjoiZm9vIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjM3LjEzN1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTozOC40MjBaIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJ0aW1lU3RvcmFnZUNsYXNzVXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjU6MzcuMTM3WiIsInNpemUiOiIxNiIsIm1kNUhhc2giOiJkTHJkb1ZnanhsQUFHTmFZWDFCbWJ3PT0iLCJtZWRpYUxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9kb3dubG9hZC9z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T0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiTTVlRy9BPT0iLCJldGFnIjoiQ0pibWh1angvZUVDRUFNPSIsImV2ZW50QmFzZWRIb2xkIjp0cnVlfQ==" - } - }, - { - "ID": "572d50dc9b5ce8a4", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "85" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDgiLCJldmVudEJhc2VkSG9sZCI6ZmFsc2V9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3194" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:39 GMT" - ], - "Etag": [ - "CJbmhujx/eECEAQ=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrWVb2L8OGfosYWTjk_F-zm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T0iLCJldGFnIjoiQ0pibWh1angvZUVDRUFRPSIsImV2ZW50QmFzZWRIb2xkIjpmYWxzZX0=" - } - }, - { - "ID": "bda340f0117c1fb4", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008/o/some-obj?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:39 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UotG32AgmOwDD_bLLd_W64JCOZQ2-UgeY_cOZwomlkWb6Vx5JSE54tdsuCPvawuyJ8eNuCf8EM0qXlIjtAyg6QQiuN9t72vHrQLsrSs6WtJBDGZziU" - ] - }, - "Body": "" - } - }, - { - "ID": "9a0b7379af024a3a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0008?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:39 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur7S22mcdvPtDq_Z9iUbo4v0ApOQXNFgXFNZuacd8yZUq2FhZKco01Z2T4vJSv8s1yZkGXzoUrAuUKnCBx0vZuE-MDGnmTF_YxhQoXobyvAyktswdE" - ] - }, - "Body": "" - } - }, - { - "ID": "affb380cf86f173c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5In0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "485" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:40 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrF4q2mbuFoVeV9q22libc-FjfB1eDXSMYhNGZNU6sbaMWEKdc-8eXu1gtMLC7Ia9bSRU0oxgpIRR9516KZRcg7o_VGdrU1lliVPuSY9rYa4OsJymE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQwLjA4MVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0MC4wODFaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "88123486ecd710ed", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJuYW1lIjoic29tZS1vYmoifQo=", - "cGCusp668ZMwY59j94Srfg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:41 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrixhGvSHn6UzWmshHjh8Ny2NE4LW-gcPPW4dCm9dZTDfBwtENYMJra88jZlphQFcyabnQwTegZW9_6bL8KYNOsyYQYgdtEDvFFMQeJ9B_IXQbrsgI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9zb21lLW9iai8xNTU2ODM1OTQwNjM4NjcyIiwic2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S9zb21lLW9iai8xNTU2ODM1OTQwNjM4NjcyL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkvby9zb21lLW9iai9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOSIsIm9iamVjdCI6InNvbWUtb2JqIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5NDA2Mzg2NzIiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTkMvM09ueC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IjB6R3NGUT09IiwiZXRhZyI6IkNOQy8zT254L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "042e51e8b073dc93", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:41 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqTH44ERv_v2A5OmhnLVBFOkQ_bPdeDI-MNir5xjrZt1ybrczlk9GwseHZ-kt566XrMnuYGTaCkr4ImF__dpbt98CqMpmYkiJaR1vKcI1DC7o3Dbl8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9zb21lLW9iai8xNTU2ODM1OTQwNjM4NjcyIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJnZW5lcmF0aW9uIjoiMTU1NjgzN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m90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOSIsIm9iamVjdCI6InNvbWUtb2JqIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5NDA2Mzg2NzIiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTkMvM09ueC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IjB6R3NGUT09IiwiZXRhZyI6IkNOQy8zT254L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "ed898d656784527a", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "83" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJ0ZW1wb3JhcnlIb2xkIjp0cnVlfQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3214" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:41 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urh-jh9w3q8AC6TmG1NF_6JgV-Js74mV6EkB4ccrlZ1ZCQ9TlA4AhJ-J6rkqtJ9fKiy4YjT_l-TN6dQhnCwZvTUqoaJC-W-z6QQZywuQ1uX9a90PhU" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9zb21lLW9iai8xNTU2ODM1OTQwNjM4NjcyIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0MDYzODY3MiIsIm1ldGFnZW5lcmF0aW9uIjoiMiIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wM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IwMTMtMDAwOSIsIm9iamVjdCI6InNvbWUtb2JqIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5NDA2Mzg2NzIiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTkMvM09ueC9lRUNFQUk9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IjB6R3NGUT09IiwiZXRhZyI6IkNOQy8zT254L2VFQ0VBST0iLCJ0ZW1wb3JhcnlIb2xkIjp0cnVlfQ==" - } - }, - { - "ID": "9ddea19a0c44c449", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3214" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:41 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoZVnUhVRVPu1unMjxNHQzZrlqTsVtPMZHc_YPTkvy18AAD3d_TOg9qTNAEv5NXUC5n0XF1sPedifaWR19a5w7dCMltRYfuJUfGxaMzyrvpqKbGjx4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9zb21lLW9iai8xNTU2ODM1OTQwNjM4NjcyIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5L28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0MDYzODY3MiIsIm1ldGFnZW5lcmF0aW9uIjoiMiIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0MC42MzhaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjU6NDEuNTE5WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQwLjYzOFoiLCJzaXplIjoiMTYiLCJtZDVIYXNoIjoiUjhVSExIMG84ZjFlTVhVRHRyMTZLZz09IiwibWVk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uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTkMvM09ueC9lRUNFQUk9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IjB6R3NGUT09IiwiZXRhZyI6IkNOQy8zT254L2VFQ0VBST0iLCJ0ZW1wb3JhcnlIb2xkIjp0cnVlfQ==" - } - }, - { - "ID": "9b6c4955472bdb51", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "82" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJjb250ZW50VHlwZSI6ImZvbyJ9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3192" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:42 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success"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aWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiMHpHc0ZRPT0iLCJldGFnIjoiQ05DLzNPbngvZUVDRUFNPSIsInRlbXBvcmFyeUhvbGQiOnRydWV9" - } - }, - { - "ID": "0227238a512229dc", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3192" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:42 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up6PS1r6NaUKQ9158DD3cKWHqyParXLdcW8k7sToMskeTU6BjpajWENp3qNHqLMFvX9NrK78TIw31h_ANYkltj3vAQoYq2RG5C6ZB2LCvUIch96SMo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9zb21lLW9iai8xNTU2ODM1OTQ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5L3NvbWUtb2JqLzE1NTY4MzU5NDA2Mzg2NzIvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9vL3NvbWUtb2JqL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5Iiwib2JqZWN0Ijoic29tZS1vYmoiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0MDYzODY3MiIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNOQy8zT254L2VFQ0VBTT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiMHpHc0ZRPT0iLCJldGFnIjoiQ05DLzNPbngvZUVDRUFNPSIsInRlbXBvcmFyeUhvbGQiOnRydWV9" - } - }, - { - "ID": "7a81946424736215", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "84" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDkiLCJ0ZW1wb3JhcnlIb2xkIjpmYWxzZX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3193" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:42 GMT" - ], - "Etag": [ - "CNC/3Onx/eECEAQ=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo1klBHpEl6qb-hfnVYr2KJLmo_3_1fgqlMYMBpBt23b-U9pF7bPcNEiJaMtrGEhZPQb9-QnqHiU8qPfmpNpSdy9KR41FwZm-89gyu3EtE5gq3J9-0" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9zb21lLW9iai8xNTU2ODM1OTQwNjM4NjcyIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMj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aHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwOS9vL3NvbWUtb2JqL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDA5Iiwib2JqZWN0Ijoic29tZS1vYmoiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0MDYzODY3MiIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNOQy8zT254L2VFQ0VBUT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiMHpHc0ZRPT0iLCJldGFnIjoiQ05DLzNPbngvZUVDRUFRPSIsInRlbXBvcmFyeUhvbGQiOmZhbHNlfQ==" - } - }, - { - "ID": "7865e37b40b9ec66", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009/o/some-obj?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:43 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo2nfd81k4cBaY8ZFRGIu8G6DHyGUVAdIJCB65E8ZqqO9ADJIV4K22sQaOA8fqGL3jyi3tIszjBVsXHOFrCgca1vLXSpA1-3s2cn-MVhTKpzZ5tzY4" - ] - }, - "Body": "" - } - }, - { - "ID": "fd9104ab049c0173", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0009?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:43 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqMqIYvjYuUxhnSLyoY-p5BYUiuZIX7cs418asOvABObfrQc8eXZpo-V4LSZVWWgt4CNoviMvFwcdC9sCTKCZU1H-9Ifcuf8lptTMZpiWMJjZfD-DY" - ] - }, - "Body": "" - } - }, - { - "ID": "e735515a80a67931", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "105" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwIiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjM2MDAifX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "573" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:44 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqxx-CzGd9qn-QCqeE_iYOkeO93A0IpWx1voocTxhTrdkkBJonYBIWXeaEq3g-LNThw7j85IKVotWyBNZlHzqYSgBchb0DeXXetMqS8WBkY603Sa60" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQzLjgwNFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0My44MDRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiMzYwMCIsImVmZmVjdGl2ZVRpbWUiOiIyMDE5LTA1LTAyVDIyOjI1OjQzLjgwNFoifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FFPSJ9" - } - }, - { - "ID": "94bfaea89e1f47c2", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0010/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTAiLCJuYW1lIjoic29tZS1vYmoifQo=", - "29UJUEl2/QvM9FnDBFnPRA==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3245" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:44 GMT" - ], - "Etag": [ - "CPXIv+vx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqLSIzBtq8Qn_3f51_hlfoIkcpamafGwB3U8er3K_mzANwxXyscBHWZhaxb2-3M2wOT6GZER6-zLAtdeeSNtSlUMHkHX77gocrZGYj103HA-AGjVSM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMC9zb21lLW9iai8xNTU2ODM1OTQ0MzU5MDI5Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwL28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQ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lYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMC9vL3NvbWUtb2JqL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwIiwib2JqZWN0Ijoic29tZS1vYmoiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0NDM1OTAyOSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNQWEl2K3Z4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoidUpwZFdRPT0iLCJldGFnIjoiQ1BYSXYrdngvZUVDRUFFPSIsInJldGVudGlvbkV4cGlyYXRpb25UaW1lIjoiMjAxOS0wNS0wMlQyMzoyNTo0NC4zNThaIn0=" - } - }, - { - "ID": "7db6d4640ce21307", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0010/o/some-obj?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3245" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:44 GMT" - ], - "Etag": [ - "CPXIv+vx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoUK3qzYL0xUcMKfWD6mmDZqRfnd8q7O14gBrKng7OYalNXZR3ZegpD1VyqjzW6bgQqFvLrtFjWXwPoJ4E78_nThYByR2n3Hm33ms2fvCdaRSOy1Qc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMC9zb21lLW9iai8xNTU2ODM1OTQ0MzU5MDI5Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwL28vc29tZS1vYmoiLCJuYW1lIjoic29tZS1vYmoiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTAiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0NDM1OTAyOSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vb2N0ZXQtc3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V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwIiwib2JqZWN0Ijoic29tZS1vYmoiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk0NDM1OTAyOSIsImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNQWEl2K3Z4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoidUpwZFdRPT0iLCJldGFnIjoiQ1BYSXYrdngvZUVDRUFFPSIsInJldGVudGlvbkV4cGlyYXRpb25UaW1lIjoiMjAxOS0wNS0wMlQyMzoyNTo0NC4zNThaIn0=" - } - }, - { - "ID": "cec800ec28205dab", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0010?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "25" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOm51bGx9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:45 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqAm9jtf7nMSv2Bbn_pFGaLCmlq2CtqUdGeEOyYrkllqiADBk9_xsJS3BufmzfGIdARRHN7jVwbeHKev2CHMyzWoGA8UxNGNIldPCC4oZ1dMPARKHk" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEwIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQzLjgwNFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0NS4yMjZaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTAvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiw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SNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "c787f6d5b23123a3", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0010/o/some-obj?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:45 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrgP5ghUeBxvXks4XlillwzLwfwyRGxt5y-FImGHSwZ-Meht6M0-keE0YTUG2Qy5hH5i1gpWPyGHXweFDyrk8a3QbDPnG5shDEoxzNOlMEsX6V8-4I" - ] - }, - "Body": "" - } - }, - { - "ID": "144726e64e401a23", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0010?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:45 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpxuxvNJ3APW11H4y-qweAzn3ChIZ0eRjSetoSHkGwVvO7nMR17h5Hbj8I8zgOGjR7HPA201lDCw47ejD6kj1wCz3ZTIrUz-r-qjdm0vGGszQYFidQ" - ] - }, - "Body": "" - } - }, - { - "ID": "eebfbd37f51a5cc6", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDExIiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:46 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uox0foiLUu9KuEF-KVU8lIN_yUKAJsYEuwVqgSXvzFRGmzJtSZvFeNvMDS8W0aQ7c8YoI89qS_MxU8zBSBqcljYpIZe1NPIvkEFEG5K22RJkAuwmh8" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDExIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQ2LjE3M1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0Ni4xNzNaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiNjAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNTo0Ni4xNzNaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "c7ddc04b5d29113a", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0011?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "47" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiMzYwMCJ9fQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2519" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:46 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpD4zsQLTflaR7g-z0FszOHvw5oXvxqdiyjlAnMwMcBcUEjidrpIGgpvmrz1EWi2AyWkdDCSY0l8ItQxYnWwSZt24jOxXBlzq-gCNrCCE6j0fJVGKw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDExIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQ2LjE3M1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0Ni44NjNaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTEvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYX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InJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiIzNjAwIiwiZWZmZWN0aXZlVGltZSI6IjIwMTktMDUtMDJUMjI6MjU6NDYuMTczWiJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "e08a38dca4dda51f", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0011?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2519" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:47 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:47 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload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siYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiIzNjAwIiwiZWZmZWN0aXZlVGltZSI6IjIwMTktMDUtMDJUMjI6MjU6NDYuMTczWiJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "fe586a68284be237", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEyIiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:47 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpAjkPxULicnoY5wPnfrg-D7yzTbTzTZcUShEN8JSsqVMN758lI4DlkvFibNK9URhYVBH0xclTheAOO_CEDoVb5egvcF-WJqJ3SDisU2YPaZsohRro" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQ3LjU2NVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0Ny41NjVaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiNjAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNTo0Ny41NjVaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "732c3421adfb99d8", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0012?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "47" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiMzYwMCJ9fQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2519" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:48 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UohfaTh8JFEjT7TTMwV7NkrcAsgkdpDyovvbjHJLNbXalzOWX3_HwhowBimaqZXhkuvBx1D38zsUZ5dEzigoyoXRJtgHfy7ClUrshBL_yMfPkZ4JE4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdy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9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBST0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiIzNjAwIiwiZWZmZWN0aXZlVGltZSI6IjIwMTktMDUtMDJUMjI6MjU6NDcuNTY1WiJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "aebe46d0a31a6e95", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0012?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2519" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:48 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:48 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uop7c4AxllIcwFmLfqhIIaGP3Q9uHfmQoAm9LttwjQIvzHiJvu4fg_Q3UfNP8YbDuP97jLsG78JbCK68eSQv8ZHPp8kpzfdJcvOER0cs75wQ9gC7NA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQ3LjU2NVoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjo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FjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiIzNjAwIiwiZWZmZWN0aXZlVGltZSI6IjIwMTktMDUtMDJUMjI6MjU6NDcuNTY1WiJ9LCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "bea48b3667650bdd", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEzIiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:49 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo1p1nEuvoUAqYHYa8wuU6qF64gN2JPCxLqqFEUiKXLgo9rwPH_btm63155v5hbuS6sow8cYEvsXVJthsJ1Zn8qfb05USodp1EvTTrt_m1rpJnIxdo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDEzIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjQ5LjAxNFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo0OS4wMTRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiNjAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNTo0OS4wMTRaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "a951cae4048b1267", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0013?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "25" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOm51bGx9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:49 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AE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jpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "e7f0506408261db3", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0013?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:49 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:49 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UotOOFJlGACBcheGxpS8qxLlGsDT0xOhT_Cg1M_6DxUI16IiOu-YHaPvwzxilOKOrTvL8kRzcVUiNuFeS6rQExTmdK70I1IOH2d2BLOrMm1L5Int1g" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxMyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ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aWV3ZXJzIn0sImV0YWciOiJDQUk9In1dLCJkZWZhdWx0T2JqZWN0QWNsIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBST0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "b2c4589e9b9b5ad2", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE0IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:50 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoFdLKiYfqS-J3PXjvHGxpXtJwVnUB7Li8XrR-DTYkmyed-ZlUmUcmZFgGyIayuACtUWVYBcRbhYOKvgkfl8srE0OdJbc15OHWBttYqenraJ0MdXj8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBidWNrZXRzLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpQUk9KRUNUX0JVQ0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x0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZSQxLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MjksIm1lc3NhZ2UiOiJUaGUgcHJvamVjdCBleGNlZWRlZCB0aGUgcmF0ZSBsaW1pdCBmb3IgY3JlYXRpbmcgYW5kIGRlbGV0aW5nIGJ1Y2tldHMuIn19" - } - }, - { - "ID": "836baafb4e98da80", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE0IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:51 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpNuySlLo4SanUdFJK3SGoCidNgWEW4mUuFDGMLLSzY-UUA3TJtN5_FLoLq7et7d1YSUDlOoGZY4a_GdewGQtsUwGdbHLz-bopObpzPy160Wm3UMpg" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBidWNrZXRzLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpQUk9KRUNUX0JVQ0tFVF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QgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZSQxLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MjksIm1lc3NhZ2UiOiJUaGUgcHJvamVjdCBleGNlZWRlZCB0aGUgcmF0ZSBsaW1pdCBmb3IgY3JlYXRpbmcgYW5kIGRlbGV0aW5nIGJ1Y2tldHMuIn19" - } - }, - { - "ID": "281ffb73e66efd1f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE0IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:52 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo8PK9JysFiApLjDSbbo9GloKqKjLO8vr85RWGkeC_Q0iEQf7zu2mwQVeiuJ81pfdJCUja0HrhNG13sczI2XoflqlsWNFvdxHGjCBrvDObr-s6Y32U" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBidWNrZXRzLiIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpQUk9KRUNUX0JVQ0tFVF9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gY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZSQxLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NjApXG5cdGF0IGlvLmdycGMuQ29udGV4dC5ydW4oQ29udGV4dC5qYXZhOjU2NSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLkN1cnJlbnRDb250ZXh0LnJ1bkluQ29udGV4dChDdXJyZW50Q29udGV4dC5qYXZhOjIwNClcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dE5vVW5yZWYoVHJhY2VDb250ZXh0LmphdmE6MzE5KVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JEFic3RyYWN0VHJhY2VDb250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0KFRyYWNlQ29udGV4dC5qYXZhOjMxMSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRUcmFjZUNvbnRleHRSdW5uYWJsZS5ydW4oVHJhY2VDb250ZXh0LmphdmE6NDU3KVxuXHRhdCBjb20uZ29vZ2xlLmdzZS5pbnRlcm5hbC5EaXNwYXRjaFF1ZXVlSW1wbCRXb3JrZXJUaHJlYWQucnVuKERpc3BhdGNoUXVldWVJbXBsLmphdmE6NDAzKVxuIn1dLCJjb2RlIjo0MjksIm1lc3NhZ2UiOiJUaGUgcHJvamVjdCBleGNlZWRlZCB0aGUgcmF0ZSBsaW1pdCBmb3IgY3JlYXRpbmcgYW5kIGRlbGV0aW5nIGJ1Y2tldHMuIn19" - } - }, - { - "ID": "515ecb8616d48a7f", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE0IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:55 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqF93J_Bpwg-_yefVpKWteSyWBSx9FqNm8MP5eZKqVfvDWpSF6EPZsISss7hNOkKMM5OuV8stlJIW2UAkzsSgkYOHx5fCwOwylbtqAyb8OlYJCHz6Q" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE0IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjU1LjIwNFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo1NS4yMDRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiNjAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNTo1NS4yMDRaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "771e55d617425f26", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0014?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "25" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOm51bGx9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:55 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up6Slob_akPo2UWNmzCe-LD4cb-9DVTq_FPlNxA7mKVF6fBFks6gFnZ83BSajEU2qD8g14Y-pX20kbfoKf8XGR9pIW2xXH_oHCxsjspHZ2ARGePTMA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE0IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjU1LjIwNFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo1NS44MjVaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTQvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50Z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TcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "9526aab2be8b214c", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0014?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:56 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:56 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UopNhdzHbHv4sXyk0r1owz7bkkPQwYIGbb3gRingbq7vgESKltWLIr9PDDIUNREfumEvZDf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G9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "0aabff8aa1cc1e9c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "103" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE1IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjYwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:56 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpTj6zYv1NMHDI_ktA1d-p7HKq4YnJMxxI9nXubPfCMyIspOgya8HYibmvOMFwLtCPagnzRHe0HbmTCSqJpYMay0xYZstGSE_IUWRqI9lUhzq0Iqe4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE1IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjU2LjM3NFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo1Ni4zNzRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiNjAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNTo1Ni4zNzRaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "05147b5b5fdd7882", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0015?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2517" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:56 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoshhz3RuOTlNgZ3gOLis_dSFBsqr7khyJCdWUD8BGk0_j-AHxA5etttVHuHTrUcDksF4LdtfJLhlVrAJe9PrGiYZ-Wy57j6tb7L6vc0qHoTvolIRg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE1IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjU2LjM3NFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo1Ni4zNzRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ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HJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiI2MCIsImVmZmVjdGl2ZVRpbWUiOiIyMDE5LTA1LTAyVDIyOjI1OjU2LjM3NFoifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FFPSJ9" - } - }, - { - "ID": "7de8d497e7e1a76c", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0015?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2517" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:57 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:25:57 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up3mjbvLxwRDDhjg8GTGBNcJM7EraDydPsmD77oQcyYYGVlQnUqg0NQbezf4KQOoOHoEnC9jMR052e0olW3qi9KdAi4-qJEiKGI1rGivb5hnJnmU5o" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE1IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjU2LjM3NFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo1Ni4zNzRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTUvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9y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V3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiI2MCIsImVmZmVjdGl2ZVRpbWUiOiIyMDE5LTA1LTAyVDIyOjI1OjU2LjM3NFoifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FFPSJ9" - } - }, - { - "ID": "3876040740117531", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0015?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:57 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqGdmh-XzrU5d5VwRugwWr452hENxpWf1sEtNCDaGksLJ1taCgnEjL_0oAlELqirqyXLlw-frE8LYo1V37Pk1G3qvWGk9E1iSZV7uECOjsdE3JagK8" - ] - }, - "Body": "" - } - }, - { - "ID": "39fb456e528c7081", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0014?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:57 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqKcAQsTdqHfiXj71c5kivJTwCNhY6xUQpZtaxywsmr1kNG5_MdJBsOvuLVbDSHKRIsG9tDxk_9Gz-7zaqP_pqke1aqKOFg9NeCU4ZqfjD0SBy0Q5Q" - ] - }, - "Body": "" - } - }, - { - "ID": "3fdacef865a6fc39", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0013?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:58 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur0PIkQTUvOl8-6tC08mwiS3nBPydo1OYUeD6Q46ZrU6VkmpRwxc9MikGqJlsejuGZkyY_aaxUVKYGREjOF363tfkbII3of6pGFuQ8rINOf8uFV5ts" - ] - }, - "Body": "" - } - }, - { - "ID": "2da48fa864dd9efe", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0012?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:58 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoWkbW_2n8KvRkdk7Lh_5eOVBjW6JvoW0i9LNQUHM-Df2H1QIbUYIwFnUGLt-bPfFa46Ur-v8Q76mU24KpjW7WIC_HVq4Q5H96pRYk7I6ggUsckTs0" - ] - }, - "Body": "" - } - }, - { - "ID": "3ef26f9548e0aec4", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0011?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:25:59 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqZfOfnhYy6nk2TxHz3h1eMu_0KlczCaOb-xcAIBRoRgxk7Q67BqsT5fvb-vAky2phYzQWNHLTk-0T8V2tpPY4Hg23Ub9evuo6_YEndEVdiBRhTcFI" - ] - }, - "Body": "" - } - }, - { - "ID": "8f3abbeca307cc5a", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE2IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "574" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:25:59 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqdSQK1TuFGAgs143LV6RLNjzfrsAl5vt-Jb_RQ4dcVGDzK8I29sKKrPmcY0rLIJuVIQar3mdRGhNLhqXp2xCKli28TFq4rtsIgiA4DxCtdVbajIhY" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE2IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI1OjU5LjM2NFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNTo1OS4zNjRaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiOTAwMDAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNTo1OS4zNjRaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "bb92a1c4ecd9e884", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0016/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTYiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoic29tZS1vYmplY3QifQo=", - "aGVsbG8gd29ybGQ=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3315" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:00 GMT" - ], - "Etag": [ - "COup9/Lx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrRoCa6t1nTWVUrdfIXfyxZBI6PKBkzO24svoJRDEYMEsduIrzBpdDiX8mIUWSxcL8-pSRZgcDvy9_iHKpoVbiUNt4QhlG7zosGpa3WOk--YlBxjeM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNi9zb21lLW9iamVjdC8xNTU2ODM1OTU5OTUyNjE5Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE2L28vc29tZS1vYmplY3QiLCJuYW1lIjoic29tZS1vYmplY3QiLCJidWNrZXQiOiJnby1pbnRlZ3JhdG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WxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTYvby9zb21lLW9iamVjdC9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNiIsIm9iamVjdCI6InNvbWUtb2JqZWN0IiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5NTk5NTI2MTkiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDT3VwOS9MeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6InlaUmxxZz09IiwiZXRhZyI6IkNPdXA5L0x4L2VFQ0VBRT0iLCJyZXRlbnRpb25FeHBpcmF0aW9uVGltZSI6IjIwMTktMDUtMDNUMjM6MjU6NTkuOTUyWiJ9" - } - }, - { - "ID": "8f2ac73db961f1d6", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0016/o/some-object?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "13884" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:00 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:00 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uok63dRFSkGv0Fum7yPhHf_AtYTWceX5_zkck648-jhWkyym1ezg2Og-LqKJ6nnZCW_gPZuU01OkZErKAQbL7mvQroCq8nEtNTEAosMxk9fJRKpYlc" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJPYmplY3QgJ2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNi9zb21lLW9iamVjdCcgaXMgc3ViamVjdCB0byBidWNrZXQncyByZXRlbnRpb24gcG9saWN5IGFuZCBjYW5ub3QgYmUgZGVsZXRlZCwgb3ZlcndyaXR0ZW4gb3IgYXJjaGl2ZWQgdW50aWwgMjAxOS0wNS0wM1QxNjoyNTo1OS45NTIyMDg0MjgtMDc6MDAiLCJkZWJ1Z0luZm8iOiJjb20uZ29vZ2xlLm5ldC5ycGMzLlJwY0V4Y2VwdGlvbjogY2xvdWQuYmlnc3RvcmUuUmVzcG9uc2VDb2RlLkVycm9yQ29kZTo6UkVURU5USU9OX1BPTElDWV9OT1RfTUVUOiBPYmplY3QgJ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q29udGV4dC5ydW5JbkNvbnRleHQoQ3VycmVudENvbnRleHQuamF2YToyMDQpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHROb1VucmVmKFRyYWNlQ29udGV4dC5qYXZhOjMxOSlcblx0YXQgY29tLmdvb2dsZS50cmFjaW5nLlRyYWNlQ29udGV4dCRBYnN0cmFjdFRyYWNlQ29udGV4dENhbGxiYWNrLnJ1bkluSW5oZXJpdGVkQ29udGV4dChUcmFjZUNvbnRleHQuamF2YTozMTEpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkVHJhY2VDb250ZXh0UnVubmFibGUucnVuKFRyYWNlQ29udGV4dC5qYXZhOjQ1Nylcblx0YXQgY29tLmdvb2dsZS5nc2UuaW50ZXJuYWwuRGlzcGF0Y2hRdWV1ZUltcGwkV29ya2VyVGhyZWFkLnJ1bihEaXNwYXRjaFF1ZXVlSW1wbC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDAzLCJtZXNzYWdlIjoiT2JqZWN0ICdnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTYvc29tZS1vYmplY3QnIGlzIHN1YmplY3QgdG8gYnVja2V0J3MgcmV0ZW50aW9uIHBvbGljeSBhbmQgY2Fubm90IGJlIGRlbGV0ZWQsIG92ZXJ3cml0dGVuIG9yIGFyY2hpdmVkIHVudGlsIDIwMTktMDUtMDNUMTY6MjU6NTkuOTUyMjA4NDI4LTA3OjAwIn19" - } - }, - { - "ID": "5a7a0988789dfb17", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0016?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "25" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOm51bGx9Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:00 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrZIBPbBTYIUYYaBFrcXzNnp7uuC8DoPry45bX57PyfL7aM5a83NLxYnvWsXD62w3LrRVksNhJbrLnSL5e8ZS6b0Cto8ufh-V00gNrGI-CaTc4achc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE2IiwidGltZUNyZWF0ZWQ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CIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBST0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUk9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBST0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "8410bda61aa0b6fd", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0016/o/some-object?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:01 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo2MOVFr2ZwvkwYm32qtqndRBhJnBc28nVBEBowKjIIxpOxiYcSef4wtz9sLTJ23PbXr1F8L_TfGwyShv5j1eTsQ-91OXU8Q8JEZtui9VVyK96j2D4" - ] - }, - "Body": "" - } - }, - { - "ID": "7b024f33e16d850f", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0016?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:01 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpDkcsqcqPLSySgf13o9jWNafbKdVjSRqGNu3ZedvF7TlL9TBswdMMpcl0zQOHtvXWIrhrcZODr7RjRhHuvS8gJdMbnYeQDHrBCbiH6x9WrnaZ5uIQ" - ] - }, - "Body": "" - } - }, - { - "ID": "33b0efc1b91cfb42", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE3IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "574" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:02 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpItvsNld0b1FGsjQgaVCDxW22UEra8vRGfkWtbDS7R2kMbHRPr0I6iPjzaQBOaa9-xUJxGO-JV6RhMlWwH2NY-FXY2-0lrkZiAzIL-tdFwkCwlF-Q" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjAxLjkwOFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjowMS45MDhaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiOTAwMDAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNjowMS45MDhaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "632b9a0387d9cff1", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0017?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2520" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:02 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:02 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpEVtrO8ed8TEHdpzyw857ZykloGKTT56atylmGnu682Y0VxI_T6SWN0JLFupJ_2Cu80ntiZttFSCBqwqFGfxVrRqsNnf0KBDyzqOH8eI-BaWPBXvE" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjAxLjkwOFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjowMS45MDhaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ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vamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiI5MDAwMCIsImVmZmVjdGl2ZVRpbWUiOiIyMDE5LTA1LTAyVDIyOjI2OjAxLjkwOFoifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FFPSJ9" - } - }, - { - "ID": "a32a5924f876577b", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0017/lockRetentionPolicy?alt=json\u0026ifMetagenerationMatch=1\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "0" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "639" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:03 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpsYL8RxAKClLw1KRdSSIORQHYKKf_HMml2vtwDOFrh0kTYDzhGEgX2RJAPQKOP2-70q7ZZ2VfkkGz12tmTiRgSuwB2dM3xxZxZucASROVeoit9Shg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE3IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjAxLjkwOFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjowMy41NDRaIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sIm93bmVyIjp7ImVudGl0eSI6InByb2plY3Qtb3duZXJzLTQ5NjE2OTYwMTcxNCJ9LCJsb2NhdGlvbiI6IlVTIiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIiwiZWZmZWN0aXZlVGltZSI6IjIwMTktMDUtMDJUMjI6MjY6MDEuOTA4WiIsImlzTG9ja2VkIjp0cnVlfSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "718775f2f8320cfd", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0017?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2536" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:03 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:03 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UprHupyIuGJCYeUCPKigfkARZRkCc2Jz051KFrXK7YS0FbdKxNe3r20jon1ejkooHsAtcXQOi1tDV41Ob9dJ3Zoyj7stDImJ0eQriMO0WLLQ__-V54" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxNyIsInNlbGZMaW5rIjo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yI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBST0ifQ==" - } - }, - { - "ID": "2f4b1104fa94954b", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0017?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "47" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiMzYwMCJ9fQo=" - ] - }, - "Response": { - "StatusCode": 403, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "13774" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrafLpm39Fg6hBYYi9lSEizIWUdMduEDQykOeT9Bch6uf9BNQUO9sOAnWpTklSpNac1yW_kSNj-JR8LMmVLirC2kqG2DcQdE-Hg5dtVBkVZ4Xhjlc8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImZvcmJpZGRlbiIsIm1lc3NhZ2UiOiJDYW5ub3QgcmVkdWNlIHJldGVudGlvbiBkdXJhdGlvbiBvZiBhIGxvY2tlZCBSZXRlbnRpb24gUG9saWN5IGZvciBidWNrZXQgJ2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2Mz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TcnLiJ9fQ==" - } - }, - { - "ID": "a8964565736a4805", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE4IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:04 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrNbiNCNtu8DhS-gNXfoe4R9DFKEVzknZ0g6YoI0JdvwH6P199oVJ2oaJwh9WXMte6frhDr_vJo1_PlxLhezMnUTJzMYZgPlPWdU1QN9imk3hXgawE" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBidWNrZXRzLiIsImRlYn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1Y2tldHMuIn19" - } - }, - { - "ID": "49648eb4e4e2ddda", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE4IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:05 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UplUHmGCg4wOKtpKVz2KH0cn-th8s-KXQR62bOkAF1pV1zIZJvsoI_tURcFttkyHks8g05Hln5fT4Ej_O-Lx6JCTovYYwhhHIK7AAcialHMj5fPHk4" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBidWNrZXRzLiIsImR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IGJ1Y2tldHMuIn19" - } - }, - { - "ID": "42cf12714cf13289", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE4IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:07 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrcjWbo0pc_i_GQTU2WE6YR0XhWYMGRPJutu1MQXo6XbRKJAYhzNK4p2-_gCqZ6BvNGncUP1UZNoTrXsFFGt1RRTRR3DS9XNiws0gt9YQdp_I8dqqM" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBidWNrZXRz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V0aW5nIGJ1Y2tldHMuIn19" - } - }, - { - "ID": "4f0fdb3eb607f33b", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE4IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 429, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12201" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:11 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up0EsbUXQesAgz95sFt6OzWRDj5WAXqEpYaqHgGvCClYnBGvjX8eQmor80UQOCIDzT6v9ZAtOPVhFIqkJG6rV0-CDXiLAnr4gwDrPkqgezvm8PQTaY" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6InVzYWdlTGltaXRzIiwicmVhc29uIjoicmF0ZUxpbWl0RXhjZWVkZWQiLCJtZXNzYWdlIjoiVGhlIHByb2plY3QgZXhjZWVkZWQgdGhlIHJhdGUgbGltaXQgZm9yIGNyZWF0aW5nIGFuZCBkZWxldGluZyBid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kIGRlbGV0aW5nIGJ1Y2tldHMuIn19" - } - }, - { - "ID": "a5a8b8af13be21cf", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "106" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE4IiwicmV0ZW50aW9uUG9saWN5Ijp7InJldGVudGlvblBlcmlvZCI6IjkwMDAwIn19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "574" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:15 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpF7Lqxvm1dNC6q_v81ZB1Ui9c2ZLJ3GXLX6Y6UNZN1nbkF78c0J3NwXavHF1cMFZ5oP8ufCnmCLg9vQHM6tfs2ih8YxQSfE4D3AxGsvBaGNP3VUMo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE4IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjE1LjA5N1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxNS4wOTdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJyZXRlbnRpb25Qb2xpY3kiOnsicmV0ZW50aW9uUGVyaW9kIjoiOTAwMDAiLCJlZmZlY3RpdmVUaW1lIjoiMjAxOS0wNS0wMlQyMjoyNjoxNS4wOTdaIn0sInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "e1dbaeed8c6d1ffb", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0018/lockRetentionPolicy?alt=json\u0026ifMetagenerationMatch=0\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "0" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 412, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Content-Length": [ - "12155" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:16 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur4dRXLSTXYf9VXr3eOCMfuLBwDLvNQMXwIYjwEuSFQO_p-SxZQXQJ7I_VA0T5Hn8gnnEZIqLV3vLCnurXr0cyHDEMpCdxWOiIiqsXlgkbcLKf78to" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6ImNvbmRpdGlvbk5vdE1ldCIsIm1lc3NhZ2UiOiJQcmVjb25kaXRpb24gRmFpbGVkIiwibG9jYXRpb25UeXBlIjoiaGVhZGVyIiwibG9jYXRpb24iOiJJZi1NYXRjaCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpJTkNPUlJFQ1RfTUVUQV9HRU5FUkFUSU9OX1NQRUNJRklFRDogZXhwZWN0ZWQgQnVja2V0TWV0YWRhdGEubWV0YWRhdGFfZ2VuZXJhdGlvbjogMCBhY3R1YWw6IDFcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udG9ScGMzRXhjZXB0aW9uKEJpZ3N0b3JlRXhjZXB0aW9uLmphdmE6MTQ3KVxuXHRhdCBjb20uZ29vZ2xlLmNsb3VkLmJpZ3N0b3JlLmNvbW1vbi5CaWdzdG9yZUV4Y2VwdGlvbi50aHJvd1JwYzNPbkVycm9yKEJpZ3N0b3J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b250ZXh0Q2FsbGJhY2sucnVuSW5Jbmhlcml0ZWRDb250ZXh0Tm9VbnJlZihUcmFjZUNvbnRleHQuamF2YTozMTkpXG5cdGF0IGNvbS5nb29nbGUudHJhY2luZy5UcmFjZUNvbnRleHQkQWJzdHJhY3RUcmFjZUNvbnRleHRDYWxsYmFjay5ydW5JbkluaGVyaXRlZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQxMiwibWVzc2FnZSI6IlByZWNvbmRpdGlvbiBGYWlsZWQifX0=" - } - }, - { - "ID": "814dffcceacb3bd8", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026kmsKeyName=projects%2Fdeklerk-sandbox%2Flocations%2Fglobal%2FkeyRings%2Fgo-integration-test%2FcryptoKeys%2Fkey1\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoia21zIn0K", - "bXkgc2VjcmV0" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3234" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:17 GMT" - ], - "Etag": [ - "CMGB+Prx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upis-8CwJYvr7glFAMnec_3T3YDojfTz3O_uICK5tQQmfJF2_rFtNnbqopcxBL5L3aKyoYe4zOLoqN4_MFFrhYKDm6Tmrl3rytuh0ymlCV15VZKyrQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9rbXMvMTU1NjgzNTk3Njc0MTA1NyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2ttcyIsIm5hbWUiOiJrbXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk3Njc0MTA1NyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxNi43NDBa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3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTUdCK1ByeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IlVJNzg1QT09IiwiZXRhZyI6IkNNR0IrUHJ4L2VFQ0VBRT0iLCJrbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTEvY3J5cHRvS2V5VmVyc2lvbnMvMSJ9" - } - }, - { - "ID": "9b05110f2b59351b", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/kms", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "9" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:17 GMT" - ], - "Etag": [ - "\"-CMGB+Prx/eECEAE=\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:26:16 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Encryption-Kms-Key-Name": [ - "projects/deklerk-sandbox/locations/global/keyRings/go-integration-test/cryptoKeys/key1/cryptoKeyVersions/1" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:26:16 GMT" - ], - "X-Goog-Generation": [ - "1556835976741057" - ], - "X-Goog-Hash": [ - "crc32c=UI785A==", - "md5=AAPQS46TrnMYnqiKAbagtQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "9" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpZ6aSiGPoeZKANPoMPgXhL1QD5nbILvzv8v3sOMId95Y65wOPssqesNA1MXzp86JA4Qa5gAMxxx5cnY4z3-tCUnvsKoIHn3NXOK2U6ZSRLzYNeQeU" - ] - }, - "Body": "bXkgc2VjcmV0" - } - }, - { - "ID": "011b81453e7060ac", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/kms?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3234" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:17 GMT" - ], - "Etag": [ - "CMGB+Prx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uq5t8aexqBqqxnLJFK9mWmGdVrFfd3gaCGOKfGJMO1phB3ATnxt67-cLVpELRy1gNnjNOK7-zMzWCR6yV1v5PQcv3lccINA--Q92RoECpvBON-QKtc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9rbXMvMTU1NjgzNTk3Njc0MTA1NyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2ttcyIsIm5hbWUiOiJrbXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk3Njc0MTA1NyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxNi43NDBaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjY6MTYuNzQwWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE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JveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTUdCK1ByeC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IlVJNzg1QT09IiwiZXRhZyI6IkNNR0IrUHJ4L2VFQ0VBRT0iLCJrbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTEvY3J5cHRvS2V5VmVyc2lvbnMvMSJ9" - } - }, - { - "ID": "0dbd0a37c735be56", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/kms?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:17 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur_RD6un7NLXQpzwRBFEfZdp982qhfEzyvw8f_P1Lx1wKv8sUid99lQ7Nba5Rs73IJfv3qHXjQfUDHjWclvCAcS91nMboiexn-FwiMrUuKqCQ_d__4" - ] - }, - "Body": "" - } - }, - { - "ID": "1b81fc72e201f2a2", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Encryption-Key-Sha256": [ - "Io4lnOPU+EThO0X0nq7mNEXB1rWxZsBI4L37pBmyfDc=" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoiY3NlayJ9Cg==", - "bXkgc2VjcmV0" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3262" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:17 GMT" - ], - "Etag": [ - "CKCxsfvx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqRTb3RtqG1gIL-ENbVZC8nWKRHapQP78uVzv4yyL2t7N8cA5jEBWa014iJALicWO06KthvAMPLctgZCJ2UvPqo72IO4_LheEfTr13-_h43M-roUyc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jc2VrLzE1NTY4MzU5Nzc2ODEwNTYiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jc2VrIiwibmFtZSI6ImNzZWsiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk3NzY4MTA1NiIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxNy42ODBaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjY6MTcuNjgwWiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjE3LjY4MFoiLCJzaXplIjoiOSIsIm1kNUhhc2giOiJBQVBRUzQ2VHJuTVlucWlLQWJhZ3RRPT0iLCJtZWRpYUxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9kb3dubG9hZC9zdG9yYW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XR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJVSTc4NUE9PSIsImV0YWciOiJDS0N4c2Z2eC9lRUNFQUU9IiwiY3VzdG9tZXJFbmNyeXB0aW9uIjp7ImVuY3J5cHRpb25BbGdvcml0aG0iOiJBRVMyNTYiLCJrZXlTaGEyNTYiOiJJbzRsbk9QVStFVGhPMFgwbnE3bU5FWEIxcld4WnNCSTRMMzdwQm15ZkRjPSJ9fQ==" - } - }, - { - "ID": "6da27052d0dabd22", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/csek/rewriteTo/b/go-integration-test-20190502-80633403432013-0001/o/cmek?alt=json\u0026destinationKmsKeyName=projects%2Fdeklerk-sandbox%2Flocations%2Fglobal%2FkeyRings%2Fgo-integration-test%2FcryptoKeys%2Fkey1\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ], - "X-Goog-Copy-Source-Encryption-Algorithm": [ - "AES256" - ], - "X-Goog-Copy-Source-Encryption-Key": [ - "CLEARED" - ], - "X-Goog-Copy-Source-Encryption-Key-Sha256": [ - "Io4lnOPU+EThO0X0nq7mNEXB1rWxZsBI4L37pBmyfDc=" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3372" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:18 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpKmOV156VWN4edUkrNip1urAj8WTpDcgGTS520rVGilFT71KrZLZQxUMKloxtxKx5R6V9pUvIqYym68P8lQ8RSc5rEE_D1KlH-NyPgybiPERbxYZ4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNyZXdyaXRlUmVzcG9uc2UiLCJ0b3RhbEJ5dGVzUmV3cml0dGVuIjoiOSIsIm9iamVjdFNpemUiOiI5IiwiZG9uZSI6dHJ1ZSwicmVzb3VyY2UiOnsia2luZCI6InN0b3JhZ2Ujb2JqZWN0IiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvY21lay8xNTU2ODM1OTc4MTI2NDc3Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vY21layIsIm5hbWUiOiJjbWVrIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5NzgxMjY0NzciLCJtZXRhZ2VuZXJhdGlvbiI6IjEiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJ0aW1lQ3JlYXRlZCI6IjIwMTktMDUtMDJUMjI6MjY6MTguMTI2WiIsInVwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjE4LjEyNloiLCJzdG9yYWdl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sImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJyb2xlIjoiT1dORVIiLCJlbWFpbCI6ImFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiZXRhZyI6IkNJM0p6UHZ4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoiVUk3ODVBPT0iLCJldGFnIjoiQ0kzSnpQdngvZUVDRUFFPSIsImttc0tleU5hbWUiOiJwcm9qZWN0cy9kZWtsZXJrLXNhbmRib3gvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9nby1pbnRlZ3JhdGlvbi10ZXN0L2NyeXB0b0tleXMva2V5MS9jcnlwdG9LZXlWZXJzaW9ucy8xIn19" - } - }, - { - "ID": "6ff8a4be1ed6bda3", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/cmek", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "9" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:26:18 GMT" - ], - "Etag": [ - "\"-CI3JzPvx/eECEAE=\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:26:18 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Encryption-Kms-Key-Name": [ - "projects/deklerk-sandbox/locations/global/keyRings/go-integration-test/cryptoKeys/key1/cryptoKeyVersions/1" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:26:18 GMT" - ], - "X-Goog-Generation": [ - "1556835978126477" - ], - "X-Goog-Hash": [ - "crc32c=UI785A==", - "md5=AAPQS46TrnMYnqiKAbagtQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "9" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqDR7RHLf_CQraIBM5Z3vCUxSJndE0E6FBOLFBqmYvMntnrQyVIfxwuTE6BtHL4b8oQszU6rIycc72JMUjiGRM_XoGdjsk-WhsbBmL_3c3x5H1s4bs" - ] - }, - "Body": "bXkgc2VjcmV0" - } - }, - { - "ID": "51f1995364e644ed", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/cmek?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3271" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:18 GMT" - ], - "Etag": [ - "CI3JzPvx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpM1hbkOXC-oSxvoqjP8s2MpxREJEpzVp2TTYj-6B8467MLYSA-yrWs9UoGwRGQUCJTR76e-qAmQnbzGsFGT31Kc3qjevb8SM0MynLHL9GhOMkm72w" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9jbWVrLzE1NTY4MzU5NzgxMjY0NzciLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9jbWVrIiwibmFtZSI6ImNtZWsiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk3ODEyNjQ3NyIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbiIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxOC4xMjZaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjY6MTguMTI2WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0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vbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0kzSnpQdngvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJVSTc4NUE9PSIsImV0YWciOiJDSTNKelB2eC9lRUNFQUU9Iiwia21zS2V5TmFtZSI6InByb2plY3RzL2Rla2xlcmstc2FuZGJveC9sb2NhdGlvbnMvZ2xvYmFsL2tleVJpbmdzL2dvLWludGVncmF0aW9uLXRlc3QvY3J5cHRvS2V5cy9rZXkxL2NyeXB0b0tleVZlcnNpb25zLzEifQ==" - } - }, - { - "ID": "8972a840dc3d95a5", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/csek?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:18 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoTmNCzrFh_7cFaryet35nLbKqM6dyo7nvsyZApHIj6fLKcMDb9ZA-_TRNjGOLNFjjoD0IZ1YOz9P-ftNchBFkjWDTaFzBjbHmryCc9JInU3wd_DLw" - ] - }, - "Body": "" - } - }, - { - "ID": "1e28b278fe3e0a66", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/cmek?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:18 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqrX5OILXadm6r5e8fLyuLEhQncM5jrmmDaOesSqraquvQbXXKhTqNJ63RYU3qj90M3FLjwnAOz8oOBTQQDOq2sRqUkbpBbJzYj82Rp3Rd9VLpNns0" - ] - }, - "Body": "" - } - }, - { - "ID": "d1ac5d123ee4bae6", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "200" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJlbmNyeXB0aW9uIjp7ImRlZmF1bHRLbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTEifSwibG9jYXRpb24iOiJVUyIsIm5hbWUiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTkifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "609" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:19 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpbajYTiCBBelYuwcqOs7_O-SyJbcV6WGwYhC4JCMmeImLlFLb93JyaiYrSp-201iYZTIdQ2VViFR_Emxe2Z7b4jV_G-0o2xzkqnkSnz0-Qcw_q0Wc" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE5IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjE5LjA2N1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxOS4wNjdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImVuY3J5cHRpb24iOnsiZGVmYXVsdEttc0tleU5hbWUiOiJwcm9qZWN0cy9kZWtsZXJrLXNhbmRib3gvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9nby1pbnRlZ3JhdGlvbi10ZXN0L2NyeXB0b0tleXMva2V5MSJ9LCJsb2NhdGlvbiI6IlVTIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FFPSJ9" - } - }, - { - "ID": "d035cdb991d0fabb", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2555" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:19 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:19 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoi5SKd4TdRXg-INW-U3pKcPA2ioBWIc2zdC5W3J4efS9iZ0EKFNqprjQ-NGEK_3wSDGezk4Al3Dd4JovGxXSnH73rIw22S_R__XRrpTQmYpTiNFGQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDE5IiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjE5LjA2N1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxOS4wNjdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTkvcHJvam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V0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJlbmNyeXB0aW9uIjp7ImRlZmF1bHRLbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTEifSwib3duZXIiOnsiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0In0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "672cb2bcc1ed4ee2", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0019/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTkiLCJuYW1lIjoia21zIn0K", - "bXkgc2VjcmV0" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3234" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:20 GMT" - ], - "Etag": [ - "CLHMt/zx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upyst1aH69iaN9J4055oX7H2yReN5TADIX11Vul8KakNuYZbJ7yXm1GBdvCDVB-IPTvbhzELJWgfurnIHxGpzKJszLO70n58xMnVbSLsHX1J3W02Lw" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOS9rbXMvMTU1NjgzNTk3OTg3OTk4NSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOS9vL2ttcyIsIm5hbWUiOiJrbXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTkiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk3OTg3OTk4NSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxOS44NzlaIi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RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDTEhNdC96eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IlVJNzg1QT09IiwiZXRhZyI6IkNMSE10L3p4L2VFQ0VBRT0iLCJrbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTEvY3J5cHRvS2V5VmVyc2lvbnMvMSJ9" - } - }, - { - "ID": "c037ecafa6249395", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0019/kms", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "9" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:20 GMT" - ], - "Etag": [ - "\"-CLHMt/zx/eECEAE=\"" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:26:19 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Encryption-Kms-Key-Name": [ - "projects/deklerk-sandbox/locations/global/keyRings/go-integration-test/cryptoKeys/key1/cryptoKeyVersions/1" - ], - "X-Goog-Generation": [ - "1556835979879985" - ], - "X-Goog-Hash": [ - "crc32c=UI785A==", - "md5=AAPQS46TrnMYnqiKAbagtQ==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "9" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrrQOFSgCkxAaKVPAQhz0ohMN6irPryraHLjWDEQgV3dNEwc5cxqcDDRChzx6_HR1Z_NPlm3vmjFCJcNK-2rAz-tmvVS8w36Q5U9Lc2wAGUgL_joX4" - ] - }, - "Body": "bXkgc2VjcmV0" - } - }, - { - "ID": "fc3eda648104f042", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019/o/kms?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3234" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:20 GMT" - ], - "Etag": [ - "CLHMt/zx/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqHPSbutJRXX-6i05QnH_4UizrPft0fsGc3_ISDNmXQ4C3RPbEAnNfS1Ren0j3k2z8zxk9AV1WZQCWiKG9D5A8gZAZESFxbSZyjbBH8jkLEsEX54NQ" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOS9rbXMvMTU1NjgzNTk3OTg3OTk4NSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOS9vL2ttcyIsIm5hbWUiOiJrbXMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMTkiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk3OTg3OTk4NSIsIm1ldGFnZW5lcmF0aW9uIjoiMSIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoxOS44NzlaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjY6MTkuODc5WiIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwidGltZVN0b3JhZ2VDbGFzc1VwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjE5Ljg3OVoiLCJzaXplIjoiOSIs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OiJDTEhNdC96eC9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IlVJNzg1QT09IiwiZXRhZyI6IkNMSE10L3p4L2VFQ0VBRT0iLCJrbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTEvY3J5cHRvS2V5VmVyc2lvbnMvMSJ9" - } - }, - { - "ID": "13283bc1ba20f019", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019/o/kms?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:20 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo2b3OtHWqpsRWxurpcGgrEtM10ZDdsrIa2z0nFsO-P4G3RAGYMTVMR0MCtwLDePrKyhfnsK-d9T5AIcRpeaIe8Z40Qm7gkZP4Fdi9jXd6ceYe5Iwc" - ] - }, - "Body": "" - } - }, - { - "ID": "ca2255586aa4aeab", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "126" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJlbmNyeXB0aW9uIjp7ImRlZmF1bHRLbXNLZXlOYW1lIjoicHJvamVjdHMvZGVrbGVyay1zYW5kYm94L2xvY2F0aW9ucy9nbG9iYWwva2V5UmluZ3MvZ28taW50ZWdyYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTIifX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2555" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:21 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur05CMGbsLFprbwWYFSeE3I5dKFdFUzO--ImyAzkLt6ueNGpMDviyX6c1S4F6t1bqXTSnyQXXQzgugu8JoecrL3-1eJOPsqnN-OBMubntJCblkyWqE" - ] - }, - "Body": "eyJraW5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yYXRpb24tdGVzdC9jcnlwdG9LZXlzL2tleTIifSwib3duZXIiOnsiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0In0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "e1c336910a43425f", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2555" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:21 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:21 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Urcwbg5Z9C0rFvSTWYj4FxF27ooV0028Cm-yme-BrfmvK0dWsRkfRQEMWylWwokcmM2kIvLKEiucJlvDLHvnbJPB_HjH3zF2Lm8xCwV_9gPN42QDeo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOSIsInNlbGZMa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aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUk9In0=" - } - }, - { - "ID": "581a002b653f595d", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "20" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJlbmNyeXB0aW9uIjpudWxsfQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:22 GMT" - ], - "Etag": [ - "CAM=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upv2LawTqc_eDVGR_hv2jSCyEA77H33uMkPevVxUUDKj1u4a9IWOH2f1oMXpU52-49Jg17SUSoJUJai1Ueff3ahN58GC9FCxwJt5v5xOHI3SytFjpo" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAxOSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXB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sImV0YWciOiJDQU09In1dLCJkZWZhdWx0T2JqZWN0QWNsIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBTT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQU09In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBTT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBTT0ifQ==" - } - }, - { - "ID": "a0db97c641f3f17c", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0019?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:22 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo15eoN1OrQFM6eqxJcuNFl7Wfr6x_VvJ0ENBlhhC_Hedf5al2OplGnNslWnRQT9RVs92RVLevZ_F_ohutgnNsUbK1PVsR04UnQ_A6ea3C0ZLy8FkI" - ] - }, - "Body": "" - } - }, - { - "ID": "ca84fc3a71a55ea8", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026predefinedAcl=authenticatedRead\u0026predefinedDefaultObjectAcl=publicRead\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIwIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "1468" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:23 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrnCCRKNh19fdBAL3pyCzbtLnG7z20pSwSZKl9uTerD6o6-B5mB79mqZRIbXNcUmcpTdpxTreKjvsHK3Y9EKq_5fkzBPInDj8YkjbGViIpd1ldSots" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIwIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjIzLjEwNloiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoyMy4xMDZaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwia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joic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoiYWxsVXNlcnMiLCJyb2xlIjoiUkVBREVSIiwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "ed54d82686b4d390", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "1468" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:23 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:23 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpXJh1_aAMuDVjYxLZJdwqAt7OwZdmTkc0_5wf_LshhNm_So0q87o7gJ31T58vp1b0_CucSecAyyyOLUbYTDrWDDTZG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yIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6Im93bmVycyJ9LCJldGFnIjoiQ0FFPSJ9LHsia2luZCI6InN0b3JhZ2UjYnVja2V0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIwL2FsbEF1dGhlbnRpY2F0ZWRVc2VycyIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMC9hY2wvYWxsQXV0aGVudGljYXRlZFVzZXJzIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIwIiwiZW50aXR5IjoiYWxsQXV0aGVudGljYXRlZFVzZXJzIiwicm9sZSI6IlJFQURFUiIsImV0YWciOiJDQUU9In1dLCJkZWZhdWx0T2JqZWN0QWNsIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoiYWxsVXNlcnMiLCJyb2xlIjoiUkVBREVSIiwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "224aee5425ffb86e", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020?alt=json\u0026predefinedAcl=private\u0026predefinedDefaultObjectAcl=authenticatedRead\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "33" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJhY2wiOltdLCJkZWZhdWx0T2JqZWN0QWNsIjpbXX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "1113" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:24 GMT" - ], - "Etag": [ - "CAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoknWPZdEFnvKZGCGO_Z26ZaKeXNdBzc6k6qqlbGdQXVEtPvLPR2oYtKCXsqDgFBjMw4wfWVXwDfmcc5u5kBAxshpuzKGgCp8UOxv-i_Rml56mzrOI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMCIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb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3Qtb3duZXJzLTQ5NjE2OTYwMTcxNCJ9LCJsb2NhdGlvbiI6IlVTIiwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FJPSJ9" - } - }, - { - "ID": "b6a80796e20baf03", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o?alt=json\u0026predefinedAcl=authenticatedRead\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAiLCJuYW1lIjoicHJpdmF0ZSJ9Cg==", - "aGVsbG8=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "1995" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:25 GMT" - ], - "Etag": [ - "CNDq5v7x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqMfGdFW2xElqOJcP4q5XeDjVehJr4FmjcFPij-Y31f_168_Jgb6zibcWxCOJzrV1aUYYTXZW9DMX-BcvfJi6YXoBCPpN23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FwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAvby9wcml2YXRlL2FjbC9hbGxBdXRoZW50aWNhdGVkVXNlcnMiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAiLCJvYmplY3QiOiJwcml2YXRlIiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5ODQ4NDgyMDgiLCJlbnRpdHkiOiJhbGxBdXRoZW50aWNhdGVkVXNlcnMiLCJyb2xlIjoiUkVBREVSIiwiZXRhZyI6IkNORHE1djd4L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoibW5HN1RBPT0iLCJldGFnIjoiQ05EcTV2N3gvZUVDRUFFPSJ9" - } - }, - { - "ID": "4812f1e0e907256e", - "Request": { - "Method": "PATCH", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o/private?alt=json\u0026predefinedAcl=private\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "62" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAifQo=" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "1529" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:25 GMT" - ], - "Etag": [ - "CNDq5v7x/eECEAI=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqTjsMMIlet4CWUmGoB3TuGzhTHXlDwuUe1SAQO8H2vmbTo2QYYV_WozfDO2NyZpsA9LCtgwwthwxeEeEG182WQTTe3xLWnsVjqPZx-iho8JAgI66U" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMC9wcml2YXRlLzE1NTY4MzU5ODQ4NDgyMDgiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAvby9wcml2YXRlIiwibmFtZSI6InByaXZhdGUiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk4NDg0ODIwOCIsIm1ldGFnZW5lcmF0aW9uIjoiMiIsImNvbnRlbnRUeXBlIjoidGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIsInRpbWVDcmVhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjoyNC44NDdaIiwidXBkYXRlZCI6IjIwMTktMDUtMDJUMjI6MjY6MjUuNDIzWiI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ZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ05EcTV2N3gvZUVDRUFJPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJtbkc3VEE9PSIsImV0YWciOiJDTkRxNXY3eC9lRUNFQUk9In0=" - } - }, - { - "ID": "969763dc18755620", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o/private/rewriteTo/b/go-integration-test-20190502-80633403432013-0020/o/dst?alt=json\u0026destinationPredefinedAcl=publicRead\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "3" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "e30K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "2017" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:25 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-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sia2luZCI6InN0b3JhZ2Ujb2JqZWN0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIwL2RzdC8xNTU2ODM1OTg1ODUwMjY5L2FsbFVzZXJzIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIwL28vZHN0L2FjbC9hbGxVc2VycyIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMCIsIm9iamVjdCI6ImRzdCIsImdlbmVyYXRpb24iOiIxNTU2ODM1OTg1ODUwMjY5IiwiZW50aXR5IjoiYWxsVXNlcnMiLCJyb2xlIjoiUkVBREVSIiwiZXRhZyI6IkNKMy9vLy94L2VFQ0VBRT0ifV0sIm93bmVyIjp7ImVudGl0eSI6InVzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20ifSwiY3JjMzJjIjoibW5HN1RBPT0iLCJldGFnIjoiQ0ozL28vL3gvZUVDRUFFPSJ9fQ==" - } - }, - { - "ID": "8db7e2a6b620e794", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o/comp/compose?alt=json\u0026destinationPredefinedAcl=authenticatedRead\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "130" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJkZXN0aW5hdGlvbiI6eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAifSwic291cmNlT2JqZWN0cyI6W3sibmFtZSI6InByaXZhdGUifSx7Im5hbWUiOiJkc3QifV19Cg==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "1906" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:26 GMT" - ], - "Etag": [ - "CJGwwP/x/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpqjCYxNFNTu3V1H_kV5WJxkbEYE9I3H5fYjfGMPO7n6C9NJstYZGcIh6xVA5RAxMCwP1PdzXITgTI1m2vm5xP5nhzLVRHKhder2qzYFGsAooH-kG0" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMC9jb21wLzE1NTY4MzU5ODYzMTUyODEiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAvby9jb21wIiwibmFtZSI6ImNvbXAiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjAi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kNKR3d3UC94L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "72a0ce58c513f6d5", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o/comp?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:26 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpWOQtHF0cKNME8sTEm9vbS9KKKLLK9afxka1b6TTVGxDjCQ4qAdnA9zshsfVFVKK5hNS10aABAQog_gjYCZTXbbsF4bQNBM0i4R7bK2r7saocPtFo" - ] - }, - "Body": "" - } - }, - { - "ID": "111b5a296b726631", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o/dst?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:26 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqPsYXABoYOnGueMXiIvH9AntIPEf4xc6i18Nnr_XEYBxy-3LSK9klIcNyfSB7we4lgbctsiYA2e2WWBJlfqk1GnK6YA2fj-e3IiPbKwBwTSLjr1Jk" - ] - }, - "Body": "" - } - }, - { - "ID": "27e4065cd2000d43", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020/o/private?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:27 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpMPK_b_vcRkSIj1t37L47as9idfpbrNWqzirdNBLwoaGDMPlbjatMzjLThnYRNwk9CqTNQ5H8eoKFbunpe5TMktUo_FHyI7rryoUhbCpkbytRrTeM" - ] - }, - "Body": "" - } - }, - { - "ID": "cccb109f5fba2a3a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0020?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:27 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoVAiJOaePqfycNhiwbkPOptOqgpe9Tvo0jo1aW2nviozj4-QcjTtnGGyhcdrZ8QTxT-KHPo-saYS9ESC_6osYhChJOCi8b9nXtuqH0BqlvywXs9FE" - ] - }, - "Body": "" - } - }, - { - "ID": "cfab6af30981f62b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/projects/deklerk-sandbox/serviceAccount?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "116" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrDBTBzZwm7GH6Jklv6hzuaZaO3JdgliJk8zLZkVNDqwDO7tYP-c06rzrTj03llkWuV_l1k9w2tbUcGG2Rtv-1MdozY6pktTutDMLfyhyHe1DaEIys" - ] - }, - "Body": "eyJlbWFpbF9hZGRyZXNzIjoic2VydmljZS00OTYxNjk2MDE3MTRAZ3MtcHJvamVjdC1hY2NvdW50cy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImtpbmQiOiJzdG9yYWdlI3NlcnZpY2VBY2NvdW50In0=" - } - }, - { - "ID": "677e783b9aea8c15", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJjYWNoZUNvbnRyb2wiOiJwdWJsaWMsIG1heC1hZ2U9NjAiLCJjb250ZW50VHlwZSI6InRleHQvcGxhaW4iLCJuYW1lIjoic29tZS1vYmplY3QifQo=", - "vcVTjdWWssp9XFk0D3Nk5w==" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3262" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Etag": [ - "CPryt4Dy/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrdWRt6oMzDM98VpA0VDmWRuNvox2ZBw6ZpjbyOFDKCFKgJ92jsLkF8v4M4UUxaTUVpmr8iElUTld7Q2g5_MZSbRatDE2zVgaY-769Ppq7Nx6f0HAg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9zb21lLW9iamVjdC8xNTU2ODM1OTg4MjczNTMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04M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g4MjczNTMwL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9zb21lLW9iamVjdC9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6InNvbWUtb2JqZWN0IiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5ODgyNzM1MzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDUHJ5dDREeS9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IlNtMWdLdz09IiwiZXRhZyI6IkNQcnl0NER5L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "ff3c05fe02cd38ac", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/some-object", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=60" - ], - "Content-Length": [ - "16" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Etag": [ - "\"b4769c7d229f0720beffe7251bbabe8f\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:27:28 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:26:28 GMT" - ], - "X-Goog-Generation": [ - "1556835988273530" - ], - "X-Goog-Hash": [ - "crc32c=Sm1gKw==", - "md5=tHacfSKfByC+/+clG7q+jw==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "16" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqn6PsKCJsyZAhI_JtSOcVKs7SWuqYsoprQTUagoZXqu1CHWyBc1TzWfUyF9iv5VBS4iZPP5qz0Lf3b51p8O36Sud2-QS2zDg9FKhtm1uBFKLpcTOs" - ] - }, - "Body": "vcVTjdWWssp9XFk0D3Nk5w==" - } - }, - { - "ID": "d1c7cc7c0e1d2829", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/some-object?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3262" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Etag": [ - "CPryt4Dy/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqluzdkA1sUAJQJZodwWmM7SP7tNoX2JJjDiqHTy3XtjEqiVDNpI0whWTFJJH4caozRYjJPjTb6_ywm82dnAiYEo-YCknhlvkWexfTq1BM9MRWwQeg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9zb21lLW9iamVjdC8xNTU2ODM1OTg4MjczNTMwIiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL28vc29tZS1vYmplY3QiLCJuYW1lIjoic29tZS1vYmplY3QiLCJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJnZW5lcmF0aW9uIjoiMTU1NjgzNTk4ODI3MzUzMCIsI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yLTgwNjMzNDAzNDMyMDEzLTAwMDEvby9zb21lLW9iamVjdC9hY2wvdXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsIm9iamVjdCI6InNvbWUtb2JqZWN0IiwiZ2VuZXJhdGlvbiI6IjE1NTY4MzU5ODgyNzM1MzAiLCJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwicm9sZSI6Ik9XTkVSIiwiZW1haWwiOiJhbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImV0YWciOiJDUHJ5dDREeS9lRUNFQUU9In1dLCJvd25lciI6eyJlbnRpdHkiOiJ1c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIn0sImNyYzMyYyI6IlNtMWdLdz09IiwiZXRhZyI6IkNQcnl0NER5L2VFQ0VBRT0ifQ==" - } - }, - { - "ID": "951f74cbe6b30b67", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Etag": [ - "CA0=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:28 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoMRpk7F0qXPvUV4uNPdV7VhfUO2Mm-qPBbx3VV92y1wRyElPF1kbRNEGJ1KqbIW5w2XozD7IzjxBx4KevqcPxZr0_E1iU1_NASedJ4lZj4EFoP9UI" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyNS41MjdaIiwibWV0YWdlbmVyYXRpb24iOiIxMyIsImFjbCI6W3sia2luZCI6InN0b3JhZ2UjYnVja2V0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL3Byb2plY3QtZWRpdG9ycy00OTYxNjk2MDE3MTQiLCJzZWxmTGluay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Ujb2JqZWN0QWNjZXNzQ29udHJvbCIsImVudGl0eSI6InByb2plY3Qtdmlld2Vycy00OTYxNjk2MDE3MTQiLCJyb2xlIjoiUkVBREVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJ2aWV3ZXJzIn0sImV0YWciOiJDQTA9In1dLCJpYW1Db25maWd1cmF0aW9uIjp7ImJ1Y2tldFBvbGljeU9ubHkiOnsiZW5hYmxlZCI6ZmFsc2V9fSwib3duZXIiOnsiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0In0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOmZhbHNlfSwibGlmZWN5Y2xlIjp7InJ1bGUiOlt7ImFjdGlvbiI6eyJ0eXBlIjoiRGVsZXRlIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjMwfX1dfSwibGFiZWxzIjp7ImwxIjoidjIiLCJuZXciOiJuZXcifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0EwPSJ9" - } - }, - { - "ID": "aadc7916a3fc24ad", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0021?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11805" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqhoAeZtt8ffiWaPr6J0LEaVR3vjerqtJ7gMM9BObOkz_6MtctDuS_s8-DZRxtTZsGfMDtekIKG2v8p2_sb3MxvTgeLhgO4vqvJNIszTaMjjyQcEdY" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpCVUNLRVRfTk9UX0ZPVU5EOiBObyBzdWNoIGJ1Y2tldDogZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIxXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuY29tbW9uLkJpZ3N0b3JlRXhjZXB0aW9uLnRvUnBjM0V4Y2VwdGlvbihCaWdzdG9yZUV4Y2VwdGlvbi5qYXZhOjE0Nylcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5jb21tb24uQmlnc3RvcmVFeGNlcHRpb24udGhyb3dScGMzT25FcnJvcihCaWdzdG9yZUV4Y2VwdGlvbi5qYXZhOjMyMilcblx0YXQgY29tLmdvb2dsZS5jbG91ZC5iaWdzdG9yZS5hcGkuanNvbi5oYW5kbGVycy5idWNrZXRzLkdldEJ1Y2tldC5oYW5kbGVSZXF1ZXN0UmVjZWl2ZWQoR2V0QnVja2V0LmphdmE6MTA0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bC5qYXZhOjQwMylcbiJ9XSwiY29kZSI6NDA0LCJtZXNzYWdlIjoiTm90IEZvdW5kIn19" - } - }, - { - "ID": "03b45b7eac939177", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/storage-library-test-bucket/Caf%C3%A9", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "20" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Etag": [ - "\"ade43306cb39336d630e101af5fb51b4\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:26:29 GMT" - ], - "Last-Modified": [ - "Fri, 24 Mar 2017 20:04:38 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1490385878535828" - ], - "X-Goog-Hash": [ - "crc32c=fN3yZg==", - "md5=reQzBss5M21jDhAa9ftRtA==" - ], - "X-Goog-Metageneration": [ - "2" - ], - "X-Goog-Storage-Class": [ - "MULTI_REGIONAL" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "20" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpFU2KyS5OA-bAy_MovHXHg5zJZ2kznc6tgTTrSjilrNHiw0NimPHZApcRXOS_ejrSSy8nIn02xipxUWxvHM3ru5IYhJRTeBZxhlq6_XQVsATkvink" - ] - }, - "Body": "Tm9ybWFsaXphdGlvbiBGb3JtIEM=" - } - }, - { - "ID": "725883eeccd4b42c", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/upload/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026prettyPrint=false\u0026projection=full\u0026uploadType=multipart", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "multipart/related", - "BodyParts": [ - "eyJidWNrZXQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEiLCJuYW1lIjoiemVybyJ9Cg==", - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "3128" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Etag": [ - "CKyp9oDy/eECEAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_single_post_uploads" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UruPh9tBADr1LSQWFlj1C4tjlS6uwlcy_MVRYaTGD4e_qEUlq0iXJx6ns3JHbH7I9olH7aSJpDW6VQcV5EdLwjQMecgA7qKhxzLoYFW4BZdEXbUrro" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3QiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS96Z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k2MzAwL3VzZXItYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMDEvby96ZXJvL2FjbC91c2VyLWFub3RoZXItdGhpbmdAZGVrbGVyay1zYW5kYm94LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYnVja2V0IjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwib2JqZWN0IjoiemVybyIsImdlbmVyYXRpb24iOiIxNTU2ODM1OTg5Mjk2MzAwIiwiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInJvbGUiOiJPV05FUiIsImVtYWlsIjoiYW5vdGhlci10aGluZ0BkZWtsZXJrLXNhbmRib3guaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJldGFnIjoiQ0t5cDlvRHkvZUVDRUFFPSJ9XSwib3duZXIiOnsiZW50aXR5IjoidXNlci1hbm90aGVyLXRoaW5nQGRla2xlcmstc2FuZGJveC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9LCJjcmMzMmMiOiJBQUFBQUE9PSIsImV0YWciOiJDS3lwOW9EeS9lRUNFQUU9In0=" - } - }, - { - "ID": "036f06773f6d6306", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0021/o?alt=json\u0026delimiter=\u0026pageToken=\u0026prefix=\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 404, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "11821" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "agent_rejected" - ], - "X-Guploader-Upload-Result": [ - "agent_rejected" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqs9uKpqdPwYRv420tAk0KmBT6DS2POPsIj39ROT-r3ymrd2SB-oOJEXuaHGOfih1ckOqp-YrvHHAh7l7A-6rwlFjoBSb4qCtWzXGPjekN0pUBIok8" - ] - }, - "Body": "eyJlcnJvciI6eyJlcnJvcnMiOlt7ImRvbWFpbiI6Imdsb2JhbCIsInJlYXNvbiI6Im5vdEZvdW5kIiwibWVzc2FnZSI6Ik5vdCBGb3VuZCIsImRlYnVnSW5mbyI6ImNvbS5nb29nbGUubmV0LnJwYzMuUnBjRXhjZXB0aW9uOiBjbG91ZC5iaWdzdG9yZS5SZXNwb25zZUNvZGUuRXJyb3JDb2RlOjpCVUNLRVRfTk9UX0ZPVU5EOiBObyBzdWNoIGJ1Y2tldDogZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIxXG5cdGF0IGNvbS5nb29nbGUuY2xvdWQuYmlnc3RvcmUuY29tbW9uLkJpZ3N0b3JlRXhjZXB0aW9uLnRvUnBjM0V4Y2VwdGlvbihCaWdzdG9yZUV4Y2VwdGlvbi5qYXZhOjE0Nylcblx0YXQgY29t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ZENvbnRleHQoVHJhY2VDb250ZXh0LmphdmE6MzExKVxuXHRhdCBjb20uZ29vZ2xlLnRyYWNpbmcuVHJhY2VDb250ZXh0JFRyYWNlQ29udGV4dFJ1bm5hYmxlLnJ1bihUcmFjZUNvbnRleHQuamF2YTo0NTcpXG5cdGF0IGNvbS5nb29nbGUuZ3NlLmludGVybmFsLkRpc3BhdGNoUXVldWVJbXBsJFdvcmtlclRocmVhZC5ydW4oRGlzcGF0Y2hRdWV1ZUltcGwuamF2YTo0MDMpXG4ifV0sImNvZGUiOjQwNCwibWVzc2FnZSI6Ik5vdCBGb3VuZCJ9fQ==" - } - }, - { - "ID": "6b9dc540a02ed56f", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/storage-library-test-bucket/Cafe%CC%81", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "public, max-age=3600" - ], - "Content-Length": [ - "20" - ], - "Content-Type": [ - "text/plain" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Etag": [ - "\"df597679bac7c6150429ad80a1a05680\"" - ], - "Expires": [ - "Thu, 02 May 2019 23:26:29 GMT" - ], - "Last-Modified": [ - "Fri, 24 Mar 2017 20:04:37 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Generation": [ - "1490385877705600" - ], - "X-Goog-Hash": [ - "crc32c=qBeWjQ==", - "md5=31l2ebrHxhUEKa2AoaBWgA==" - ], - "X-Goog-Metageneration": [ - "2" - ], - "X-Goog-Storage-Class": [ - "MULTI_REGIONAL" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "20" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrK69XFh4eDvl0RvSevMYIwMVs-nlDelMhoacS-4faSvuEateXMEqzdMvHClWdzkyqcEk7IQ1N0JMcv5uEPt6V98chYK-p9otm8puF4Uf846EBUEmg" - ] - }, - "Body": "Tm9ybWFsaXphdGlvbiBGb3JtIEQ=" - } - }, - { - "ID": "09f71762da168c2f", - "Request": { - "Method": "GET", - "URL": "https://storage.googleapis.com/go-integration-test-20190502-80633403432013-0001/zero", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Accept-Ranges": [ - "bytes" - ], - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Etag": [ - "\"d41d8cd98f00b204e9800998ecf8427e\"" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Last-Modified": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Server": [ - "UploadServer" - ], - "X-Goog-Expiration": [ - "Sat, 01 Jun 2019 22:26:29 GMT" - ], - "X-Goog-Generation": [ - "1556835989296300" - ], - "X-Goog-Hash": [ - "crc32c=AAAAAA==", - "md5=1B2M2Y8AsgTpgAmY7PhCfg==" - ], - "X-Goog-Metageneration": [ - "1" - ], - "X-Goog-Storage-Class": [ - "STANDARD" - ], - "X-Goog-Stored-Content-Encoding": [ - "identity" - ], - "X-Goog-Stored-Content-Length": [ - "0" - ], - "X-Guploader-Customer": [ - "cloud-storage" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrL3cJhuZXF-arxiYeo4MSf1to_dAoiyMisikOum5rqnrSnFa0OZ25Sl8hUU7lcIeW6P3-dwXK6qv0yHGFYMFnUB0VYpI9BRT16gMo8ikQ_L3gBmew" - ] - }, - "Body": "" - } - }, - { - "ID": "681729281517b9c0", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/zero?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:29 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrKCNWRWyBsgMgWxsrSjXZMKW22GWVttfUWHw_UNSF7X7hnnz4h-cD7vFzaLO7OVWvnuMyW9qpJAA4eJaERT9hSjGfv41XVw_9ouvBOeIK9ykq-DrE" - ] - }, - "Body": "" - } - }, - { - "ID": "39261fa7e6e9aede", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "60" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIyIn0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "485" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:33 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpEt-jSVBZqHHBwfNkeP4NXxMdC1ISsFp2E_M6JiSw9rDj2gTnmTZhrvOn-bo_f9Lx_HMxMDgsXfO0ftWqvUjGwdmHAYNnYK5JSJozLfuosPNxv_S4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjMzLjU1N1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjozMy41NTdaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "3e70965b0aa1111b", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0022?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2431" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:34 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:34 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guplo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mFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInN0b3JhZ2VDbGFzcyI6IlNUQU5EQVJEIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "b80f9a99661cd572", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0022?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:34 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur4ItFRDN2_vB0_Ej095pAE061aywdVAoU_00t3fazm21R5ZLxUHpQL4ifTJ58218EkOeDBSWNaOaWuuzTnTM0DhXTe4l2X3pytOdfcZdIeyLV1rWA" - ] - }, - "Body": "" - } - }, - { - "ID": "979ffb3f3450c3d5", - "Request": { - "Method": "POST", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026prettyPrint=false\u0026project=deklerk-sandbox", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "Content-Length": [ - "543" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "application/json", - "BodyParts": [ - "eyJsYWJlbHMiOnsiZW1wdHkiOiIiLCJsMSI6InYxIn0sImxpZmVjeWNsZSI6eyJydWxlIjpbeyJhY3Rpb24iOnsic3RvcmFnZUNsYXNzIjoiTkVBUkxJTkUiLCJ0eXBlIjoiU2V0U3RvcmFnZUNsYXNzIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjEwLCJjcmVhdGVkQmVmb3JlIjoiMjAxNy0wMS0wMSIsImlzTGl2ZSI6ZmFsc2UsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTVVMVElfUkVHSU9OQUwiLCJTVEFOREFSRCJdLCJudW1OZXdlclZlcnNpb25zIjozfX0seyJhY3Rpb24iOnsidHlwZSI6IkRlbGV0ZSJ9LCJjb25kaXRpb24iOnsiYWdlIjozMCwiY3JlYXRlZEJlZm9yZSI6IjIwMTctMDEtMDEiLCJpc0xpdmUiOnRydWUsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTkVBUkxJTkUiXSwibnVtTmV3ZXJWZXJzaW9ucyI6MTB9fV19LCJsb2NhdGlvbiI6IlVTIiwibmFtZSI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInN0b3JhZ2VDbGFzcyI6Ik5FQVJMSU5FIiwidmVyc2lvbmluZyI6eyJlbmFibGVkIjp0cnVlfX0K" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "926" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:34 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqM_YYHcsYolLFJJwWhO9AUYmnc3Vp3J6C5AydYOy-0RVAmBxObG8QpwZOsn28vDVllo_OZ1-4bASi_RGi4wdply2CPhzUOCVjP11XNzVYZ4_EiFb4" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjM0LjU2M1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjozNC41NjNaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiaWFtQ29uZmlndXJhdGlvbiI6eyJidWNrZXRQb2xpY3lPbmx5Ijp7ImVuYWJsZWQiOmZhbHNlfX0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOnRydWV9LCJsaWZlY3ljbGUiOnsicnVsZSI6W3siYWN0aW9uIjp7InR5cGUiOiJTZXRTdG9yYWdlQ2xhc3MiLCJzdG9yYWdlQ2xhc3MiOiJORUFSTElORSJ9LCJjb25kaXRpb24iOnsiYWdlIjoxMCwiY3JlYXRlZEJlZm9yZSI6IjIwMTctMDEtMDEiLCJpc0xpdmUiOmZhbHNlLCJtYXRjaGVzU3RvcmFnZUNsYXNzIjpbIk1VTFRJX1JFR0lPTkFMIiwiU1RBTkRBUkQiXSwibnVtTmV3ZXJWZXJzaW9ucyI6M319LHsiYWN0aW9uIjp7InR5cGUiOiJEZWxldGUifSwiY29uZGl0aW9uIjp7ImFnZSI6MzAsImNyZWF0ZWRCZWZvcmUiOiIyMDE3LTAxLTAxIiwiaXNMaXZlIjp0cnVlLCJtYXRjaGVzU3RvcmFnZUNsYXNzIjpbIk5FQVJMSU5FIl0sIm51bU5ld2VyVmVyc2lvbnMiOjEwfX1dfSwibGFiZWxzIjp7ImwxIjoidjEiLCJlbXB0eSI6IiJ9LCJzdG9yYWdlQ2xhc3MiOiJORUFSTElORSIsImV0YWciOiJDQUU9In0=" - } - }, - { - "ID": "4931edd6fbd7e278", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0022?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2872" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:34 GMT" - ], - "Etag": [ - "CAE=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:34 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpxOq-rTQ-0CFxAKezuPpbibtEmD_yASKzhW5dOiUdwVORx6a7_e1dmDnNCdamDPwLsBOpLueQD8iDbwlracb2uxGwwZ6yz92QD-t-JSKM-jSNp2xA" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAyMiIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIyIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI2OjM0LjU2M1oiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNjozNC41NjNaIiwibWV0YWdlbmVyYXRpb24iOiIxIiwiYWNsIjpbeyJraW5kIjoic3RvcmFnZSNidWNrZXRBY2Nlc3NDb250cm9sIiwiaWQiOiJnby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLTAwMjIvcHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwic2VsZkxpbmsiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9zdG9yYWdlL3YxL2IvZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDIyL2FjbC9wcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQiLCJid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ZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInZlcnNpb25pbmciOnsiZW5hYmxlZCI6dHJ1ZX0sImxpZmVjeWNsZSI6eyJydWxlIjpbeyJhY3Rpb24iOnsidHlwZSI6IlNldFN0b3JhZ2VDbGFzcyIsInN0b3JhZ2VDbGFzcyI6Ik5FQVJMSU5FIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjEwLCJjcmVhdGVkQmVmb3JlIjoiMjAxNy0wMS0wMSIsImlzTGl2ZSI6ZmFsc2UsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTVVMVElfUkVHSU9OQUwiLCJTVEFOREFSRCJdLCJudW1OZXdlclZlcnNpb25zIjozfX0seyJhY3Rpb24iOnsidHlwZSI6IkRlbGV0ZSJ9LCJjb25kaXRpb24iOnsiYWdlIjozMCwiY3JlYXRlZEJlZm9yZSI6IjIwMTctMDEtMDEiLCJpc0xpdmUiOnRydWUsIm1hdGNoZXNTdG9yYWdlQ2xhc3MiOlsiTkVBUkxJTkUiXSwibnVtTmV3ZXJWZXJzaW9ucyI6MTB9fV19LCJsYWJlbHMiOnsibDEiOiJ2MSIsImVtcHR5IjoiIn0sInN0b3JhZ2VDbGFzcyI6Ik5FQVJMSU5FIiwiZXRhZyI6IkNBRT0ifQ==" - } - }, - { - "ID": "12c06b5419a1fa81", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0022?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uoc24sLEBwU00YKpSYT4V6iJu3WxME2LgbyRWaYj4kX8s6Gjatzl0AWcCwPRhj_Bq0BOoUhKQzS8L0GJlhHC36eyEWEIs2rk2BcUyo0aE3U8XbuHuM" - ] - }, - "Body": "" - } - }, - { - "ID": "bf24dffbe6cb8609", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "2571" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Etag": [ - "CA0=" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqVkn03LSqmt8RiOPdW3JO4dpsS9vRp7VK8Qc0HwhmS3L9KDOgmyZIqLnvAwuAyvoIz1VsbqeoLwMMtz9pCIX216P4K3OpEs-x_bf_VSwMiFehgZiM" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNidWNrZXQiLCJpZCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsInByb2plY3ROdW1iZXIiOiI0OTYxNjk2MDE3MTQiLCJuYW1lIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxIiwidGltZUNyZWF0ZWQiOiIyMDE5LTA1LTAyVDIyOjIzOjU0LjYxMFoiLCJ1cGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNToyNS41MjdaIiwibWV0YWdlbmVyYXRpb24iOiIxMyIsImFjbCI6W3sia2luZCI6InN0b3JhZ2UjYnVja2V0QWNjZXNzQ29udHJvbCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL3Byb2plY3QtZWRpdG9ycy00OTYxNjk2MDE3MTQiLCJzZWxmTGluayI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3N0b3JhZ2UvdjEvYi9nby1pbnRlZ3JhdGlvbi10ZXN0LTIwMTkwNTAyLTgwNjMzNDAzNDMyMDEzLT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HJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJ2aWV3ZXJzIn0sImV0YWciOiJDQTA9In1dLCJpYW1Db25maWd1cmF0aW9uIjp7ImJ1Y2tldFBvbGljeU9ubHkiOnsiZW5hYmxlZCI6ZmFsc2V9fSwib3duZXIiOnsiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0In0sImxvY2F0aW9uIjoiVVMiLCJ2ZXJzaW9uaW5nIjp7ImVuYWJsZWQiOmZhbHNlfSwibGlmZWN5Y2xlIjp7InJ1bGUiOlt7ImFjdGlvbiI6eyJ0eXBlIjoiRGVsZXRlIn0sImNvbmRpdGlvbiI6eyJhZ2UiOjMwfX1dfSwibGFiZWxzIjp7ImwxIjoidjIiLCJuZXciOiJuZXcifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0EwPSJ9" - } - }, - { - "ID": "2e41eac5e693f3e1", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o?alt=json\u0026delimiter=\u0026pageToken=\u0026prefix=\u0026prettyPrint=false\u0026projection=full\u0026versions=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "64746" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqgGJECa6hRJfdjE3ErHERxS3HPU_SALrzjf-HIDuv4lfxMvOwrkF2pfY2jUJ3b8TcIjWcnaa85Rs4LBucKffiSWfFXcfLZMF0EuiVRj9oH6Kp4tOg" - ] - }, - "Body": "eyJraW5kIjoic3RvcmFnZSNvYmplY3RzIiwiaXRlbXMiOlt7ImtpbmQiOiJzdG9yYWdlI29iamVjdCIsImlkIjoiZ28taW50ZWdyYXRpb24tdGVzdC0yMDE5MDUwMi04MDYzMzQwMzQzMjAxMy0wMDAxL2FjbDEvMTU1NjgzNTg2NDI0ODE3MCIsInNlbGZMaW5rIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vc3RvcmFnZS92MS9iL2dvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMS9vL2FjbDEiLCJuYW1lIjoiYWNsMSIsImJ1Y2tldCI6ImdvLWludGVncmF0aW9uLXRlc3QtMjAxOTA1MDItODA2MzM0MDM0MzIwMTMtMDAwMSIsImdlbmVyYXRpb24iOiIxNTU2ODM1ODY0MjQ4MTcwIiwibWV0YWdlbmVyYXRpb24iOiIyIiwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iLCJ0aW1lQ3JlYXRlZCI6IjIwMTktMDUtMDJUMjI6MjQ6MjQuMjQ3WiIsInVwZGF0ZWQiOiIyMDE5LTA1LTAyVDIyOjI0OjI1LjYyOVoiLCJzdG9yYWdlQ2xhc3MiOiJTVEFOREFSRCIsInRpbWVTdG9yYWdlQ2xhc3NVcGRhdGVkIjoiMjAxOS0wNS0wMlQyMjoyNDoyNC4yNDdaIiwic2l6ZSI6IjE2IiwibWQ1SGFzaCI6IjBFOXRGTnBaajAvV0tPSjZmVjlwYXc9PSIsI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{ - "ID": "744cbe6970c9623b", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/acl1?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpfI-4jHQ7K_XJuo8cMIfOvPLKerfuQA1KlRDBi4Fq11Uc9i--oKNuFL_MbH0CCxK8PeI4r4fmZILF9hdSGAMMpMmyX0w67j7t84C4tRDx2LnbzG4I" - ] - }, - "Body": "" - } - }, - { - "ID": "a2bea52380600211", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/acl2?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:35 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrzTcVhZWJuBZITVX_K6haiVlOGb5fEYRdiiH8ODa4XsVSPl4FCDs7zPpKMTfoZA1veIMd4ccdcj8rUqWDMcRfDU5l4cOGvNhGZV-h9S2AVJfl6GdE" - ] - }, - "Body": "" - } - }, - { - "ID": "e187777c49170a6d", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/bucketInCopyAttrs?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UouPwITheFghtKlzs2vxoAGnEm_V7OZZnYkk_0pLhV8g5YN6TPRS2n1h0iAtzkuFXYtjovp3ifqt_351LO6-CobCar6VgRnJ-_EQ9WgOWhIC9DzYTs" - ] - }, - "Body": "" - } - }, - { - "ID": "653fa745ed683364", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/checksum-object?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UoBLZLK-ePmvYxO2ByvMQ1dXb_4-5yhOR-1nYkxjkINZf5fY9ptO2H4RfRtbIrRQ-QQNZHqZGgCOGJakKLkNgVI2_ExobQLkJ-JaJ-ViDWL9GZCEgU" - ] - }, - "Body": "" - } - }, - { - "ID": "91230665f80c46f7", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/composed1?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upasg8dCwbL7dWntUy3O1t_wWVeDNNT3YCz1uVNL8QUNh4z75y0p9OfL57wFX4CUv3NV06Oi9f7a85m42BzgDZl-kqmv4com_INYmRYjKbwrTdFB8A" - ] - }, - "Body": "" - } - }, - { - "ID": "dc68e1f94de4fa2a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/composed2?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqXdUtFVSSFIrK72haTC8pKLogl9pB4lDLpARc8oDKdNt1yfbHj4VAQH0M_Doqj1mLY2LVmThFxvG_1mvtVBm-N4x_J-c5Izq46lZh_xx3wOQEYZKQ" - ] - }, - "Body": "" - } - }, - { - "ID": "db5b5c31ef8e503e", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/content?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Ur2nVuDhUpL1-5n7rzvboeHuOBlvh-59eoy59Y5ZIyvUy6FXYj2eCphVTBFkaIPXK7XIS6DJXkPzZABjiFi4hMA7Ewdgp860sYu44qguzhTfOymXYY" - ] - }, - "Body": "" - } - }, - { - "ID": "f44103066254972d", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqul73HMDr4p6XCqdfKz99RILwd68VT50DnynneOl5m5E_a7ky2mbMA8mdM6xyAWCQtiJm8dCxvIuKYtjLavA8JUlkGIqqCLGfLbB2EvWahd55Fw_A" - ] - }, - "Body": "" - } - }, - { - "ID": "99aa9c86d4998414", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-2?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:36 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uqfk5JfeEeFo80cy1Y-OxXgzSIbt_x7qDWML2yJopIrt9DsPmRq4cDVFqg6sUFStj6aMrjxP7iu_tbwZzS_3BtnwqfPrJZvHllZ7tdeFTXLmto742o" - ] - }, - "Body": "" - } - }, - { - "ID": "24bd829460fb4df6", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/customer-encryption-3?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UprF0LO3CObAApP8iwUO6IvC-Yh-5whtr0F_mMzaj0rltEl4C-AZjNuBMGuQUue-v9oBqb-nQU2ykIenSZ3UYnK4XVV7moFIS43VyP7pByYqsHPkMo" - ] - }, - "Body": "" - } - }, - { - "ID": "acdf7531eddfd72c", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/gzip-test?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqAEWwZD_lXrdbrjMg-PYbmLP1-zSzjESAs-osetXJrFTueJ6ufxVfA3xkMG5KjtEz-68YryfKl9gAGsgfseX6H5COwltvyW6pJSdxDdA-dTV_S8eU" - ] - }, - "Body": "" - } - }, - { - "ID": "8facd7ede0dc71a6", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/hashesOnUpload-1?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrInkaBVPO1ip6mFSpF0Nihd1wYE9HNfIz8HfFsZkiEVG1mX7eKMItsbmNwWMehWZ0qaKAf081imDi7DmKqs6mEy7vyTokMNXVUp5LrFoQ-yDfVRuc" - ] - }, - "Body": "" - } - }, - { - "ID": "6affac5f0a8dea5a", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj%2Fwith%2Fslashes?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqhbUYzZ-vUqGcyfzGFaQrr89Q05cXGCB0EbWA2Dy8dmQxB3uWJ7_FUwi6Ish-VMpOrZv78bT9qAHd5Tr5b3s8bTCX6QR9HlelvxkKdyrUv2G8QQuY" - ] - }, - "Body": "" - } - }, - { - "ID": "8258a6e1b5dc73aa", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj1?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Upola6CIBa9ONjl53PxMpFGQkHvYEau96KG2mgCmUDWDhxZKCw0T58QQRx8OIJW5sisH_acrPcg2o-LLdJgOxCtlVSw-t6wGisVL2-TSopEuezgmu4" - ] - }, - "Body": "" - } - }, - { - "ID": "12186a37ecd09333", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/obj2?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UpFxLaOTSsPe7hDbzBznGCoZvAUmeNgWBwS45X2j3rpLlk8_MIFFuCa-aBpAM83d23ixudKpklnhiqCcrQQotCUZhkrMLpWLHBJdmcM0d5rCKL6opY" - ] - }, - "Body": "" - } - }, - { - "ID": "e7a92beca78e4ec6", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/posc?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:37 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrpITV4ogt1-_eCsp0KFz7tVeM2A4FzSevs8Q0BPZ36nEPrP9aAaB4nfWASzLZgi2hNM1l9eFkf5UbYYWDT5J-nQFCapVNcm_4Nr43yd94Ce95SVps" - ] - }, - "Body": "" - } - }, - { - "ID": "5bb0506f3ca9135d", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/posc2?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:38 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqFBt86Wz7Oqelsb0pPpIskBYdMYLR3XuBmD2F5DwyXt84Q1AUyL0Q94YtqTJP1yzgohHCkJWSGibqUARgP8Ilv9v4lVipsdfjSdFHgIjFJ1H-vuU4" - ] - }, - "Body": "" - } - }, - { - "ID": "3ea05ac204d7a112", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/signedURL?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:38 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Up2mLLaTTO-0iqVf4m8WXPEsP-mHlaS6hz_gavjGI5yzU0jCjBNDRw1gj6Wa_cQIBzfjytwP2XYhBIJeAglwa6Uqv87WhzeqgGXt4u820FuZKVgY-w" - ] - }, - "Body": "" - } - }, - { - "ID": "bed8580dc40e850e", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/some-object?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:38 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UodR7nshMeihBskPB6loBZoNDRFEUxojhFCKhQ0NpiEMRHY0ZHU8ncI4Sr7FHUmIDXyK8xVg_I7Qt5ESrqnGmRzW0h1eM8OGfEM-3weHyzMqN-VMik" - ] - }, - "Body": "" - } - }, - { - "ID": "57489f1d9de0ddb8", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001/o/zero-object?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:38 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UqxQ_NSeD-rrAbZXERIaDr3_1wDC_RZ4MyuFZnOhdDqLkn4qub7rAIamqSQKDD8-jbn0c3XmxvowTghxhq4tZaxxHTmYJtB_FPvJxRZtCt3Leugx4g" - ] - }, - "Body": "" - } - }, - { - "ID": "006b3176688c0ac8", - "Request": { - "Method": "DELETE", - "URL": "https://www.googleapis.com/storage/v1/b/go-integration-test-20190502-80633403432013-0001?alt=json\u0026prettyPrint=false", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 204, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "no-cache, no-store, max-age=0, must-revalidate" - ], - "Content-Length": [ - "0" - ], - "Content-Type": [ - "application/json" - ], - "Date": [ - "Thu, 02 May 2019 22:26:38 GMT" - ], - "Expires": [ - "Mon, 01 Jan 1990 00:00:00 GMT" - ], - "Pragma": [ - "no-cache" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2Uo4l8LfaJI78MH37sa7nOmY2A8EB4paZccrewnIFFud-pwGLeVf067ZiRaBAOAPsPYlaxxtsr6gtECA6UY0xiUBHPTLFOe4VNnNQpniNWYJEfZ1-I8" - ] - }, - "Body": "" - } - }, - { - "ID": "a853ce25e734dbfd", - "Request": { - "Method": "GET", - "URL": "https://www.googleapis.com/storage/v1/b?alt=json\u0026pageToken=\u0026prefix=go-integration-test\u0026prettyPrint=false\u0026project=deklerk-sandbox\u0026projection=full", - "Header": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "google-api-go-client/0.5" - ] - }, - "MediaType": "", - "BodyParts": [ - "" - ] - }, - "Response": { - "StatusCode": 200, - "Proto": "HTTP/1.1", - "ProtoMajor": 1, - "ProtoMinor": 1, - "Header": { - "Alt-Svc": [ - "quic=\":443\"; ma=2592000; v=\"46,44,43,39\"" - ], - "Cache-Control": [ - "private, max-age=0, must-revalidate, no-transform" - ], - "Content-Length": [ - "47300" - ], - "Content-Type": [ - "application/json; charset=UTF-8" - ], - "Date": [ - "Thu, 02 May 2019 22:26:39 GMT" - ], - "Expires": [ - "Thu, 02 May 2019 22:26:39 GMT" - ], - "Server": [ - "UploadServer" - ], - "Vary": [ - "Origin", - "X-Origin" - ], - "X-Guploader-Customer": [ - "apiary_cloudstorage_metadata" - ], - "X-Guploader-Request-Result": [ - "success" - ], - "X-Guploader-Upload-Result": [ - "success" - ], - "X-Guploader-Uploadid": [ - "AEnB2UrnXhEY-kWgvl-XqP1kXnVDpQphHD9znE-EyBBlFT-kHZtXEsAW5QG5PuzlaJPfQUwZqnTHP0wxu6YD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WNsIjpbeyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC1vd25lcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJvd25lcnMifSwiZXRhZyI6IkNBRT0ifSx7ImtpbmQiOiJzdG9yYWdlI29iamVjdEFjY2Vzc0NvbnRyb2wiLCJlbnRpdHkiOiJwcm9qZWN0LWVkaXRvcnMtNDk2MTY5NjAxNzE0Iiwicm9sZSI6Ik9XTkVSIiwicHJvamVjdFRlYW0iOnsicHJvamVjdE51bWJlciI6IjQ5NjE2OTYwMTcxNCIsInRlYW0iOiJlZGl0b3JzIn0sImV0YWciOiJDQUU9In0seyJraW5kIjoic3RvcmFnZSNvYmplY3RBY2Nlc3NDb250cm9sIiwiZW50aXR5IjoicHJvamVjdC12aWV3ZXJzLTQ5NjE2OTYwMTcxNCIsInJvbGUiOiJSRUFERVIiLCJwcm9qZWN0VGVhbSI6eyJwcm9qZWN0TnVtYmVyIjoiNDk2MTY5NjAxNzE0IiwidGVhbSI6InZpZXdlcnMifSwiZXRhZyI6IkNBRT0ifV0sImlhbUNvbmZpZ3VyYXRpb24iOnsiYnVja2V0UG9saWN5T25seSI6eyJlbmFibGVkIjpmYWxzZX19LCJvd25lciI6eyJlbnRpdHkiOiJwcm9qZWN0LW93bmVycy00OTYxNjk2MDE3MTQifSwibG9jYXRpb24iOiJVUyIsInJldGVudGlvblBvbGljeSI6eyJyZXRlbnRpb25QZXJpb2QiOiI5MDAwMCIsImVmZmVjdGl2ZVRpbWUiOiIyMDE5LTA1LTAyVDIyOjI2OjE1LjA5N1oifSwic3RvcmFnZUNsYXNzIjoiU1RBTkRBUkQiLCJldGFnIjoiQ0FFPSJ9XX0=" - } - } - ] -} \ No newline at end of file diff --git a/ibm/vendor/cloud.google.com/go/storage/writer.go b/ibm/vendor/cloud.google.com/go/storage/writer.go deleted file mode 100644 index 1843a81415..0000000000 --- a/ibm/vendor/cloud.google.com/go/storage/writer.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2014 Google LLC -// -// 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 storage - -import ( - "context" - "encoding/base64" - "errors" - "fmt" - "io" - "sync" - "unicode/utf8" - - "google.golang.org/api/googleapi" - raw "google.golang.org/api/storage/v1" -) - -// A Writer writes a Cloud Storage object. -type Writer struct { - // ObjectAttrs are optional attributes to set on the object. Any attributes - // must be initialized before the first Write call. Nil or zero-valued - // attributes are ignored. - ObjectAttrs - - // SendCRC specifies whether to transmit a CRC32C field. It should be set - // to true in addition to setting the Writer's CRC32C field, because zero - // is a valid CRC and normally a zero would not be transmitted. - // If a CRC32C is sent, and the data written does not match the checksum, - // the write will be rejected. - SendCRC32C bool - - // ChunkSize controls the maximum number of bytes of the object that the - // Writer will attempt to send to the server in a single request. Objects - // smaller than the size will be sent in a single request, while larger - // objects will be split over multiple requests. The size will be rounded up - // to the nearest multiple of 256K. - // - // ChunkSize will default to a reasonable value. If you perform many - // concurrent writes of small objects (under ~8MB), you may wish set ChunkSize - // to a value that matches your objects' sizes to avoid consuming large - // amounts of memory. See - // https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#size - // for more information about performance trade-offs related to ChunkSize. - // - // If ChunkSize is set to zero, chunking will be disabled and the object will - // be uploaded in a single request without the use of a buffer. This will - // further reduce memory used during uploads, but will also prevent the writer - // from retrying in case of a transient error from the server, since a buffer - // is required in order to retry the failed request. - // - // ChunkSize must be set before the first Write call. - ChunkSize int - - // ProgressFunc can be used to monitor the progress of a large write. - // operation. If ProgressFunc is not nil and writing requires multiple - // calls to the underlying service (see - // https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload), - // then ProgressFunc will be invoked after each call with the number of bytes of - // content copied so far. - // - // ProgressFunc should return quickly without blocking. - ProgressFunc func(int64) - - ctx context.Context - o *ObjectHandle - - opened bool - pw *io.PipeWriter - - donec chan struct{} // closed after err and obj are set. - obj *ObjectAttrs - - mu sync.Mutex - err error -} - -func (w *Writer) open() error { - attrs := w.ObjectAttrs - // Check the developer didn't change the object Name (this is unfortunate, but - // we don't want to store an object under the wrong name). - if attrs.Name != w.o.object { - return fmt.Errorf("storage: Writer.Name %q does not match object name %q", attrs.Name, w.o.object) - } - if !utf8.ValidString(attrs.Name) { - return fmt.Errorf("storage: object name %q is not valid UTF-8", attrs.Name) - } - if attrs.KMSKeyName != "" && w.o.encryptionKey != nil { - return errors.New("storage: cannot use KMSKeyName with a customer-supplied encryption key") - } - pr, pw := io.Pipe() - w.pw = pw - w.opened = true - - go w.monitorCancel() - - if w.ChunkSize < 0 { - return errors.New("storage: Writer.ChunkSize must be non-negative") - } - mediaOpts := []googleapi.MediaOption{ - googleapi.ChunkSize(w.ChunkSize), - } - if c := attrs.ContentType; c != "" { - mediaOpts = append(mediaOpts, googleapi.ContentType(c)) - } - - go func() { - defer close(w.donec) - - rawObj := attrs.toRawObject(w.o.bucket) - if w.SendCRC32C { - rawObj.Crc32c = encodeUint32(attrs.CRC32C) - } - if w.MD5 != nil { - rawObj.Md5Hash = base64.StdEncoding.EncodeToString(w.MD5) - } - if w.o.c.envHost != "" { - w.o.c.raw.BasePath = fmt.Sprintf("%s://%s", w.o.c.scheme, w.o.c.envHost) - } - call := w.o.c.raw.Objects.Insert(w.o.bucket, rawObj). - Media(pr, mediaOpts...). - Projection("full"). - Context(w.ctx). - Name(w.o.object) - - if w.ProgressFunc != nil { - call.ProgressUpdater(func(n, _ int64) { w.ProgressFunc(n) }) - } - if attrs.KMSKeyName != "" { - call.KmsKeyName(attrs.KMSKeyName) - } - if attrs.PredefinedACL != "" { - call.PredefinedAcl(attrs.PredefinedACL) - } - if err := setEncryptionHeaders(call.Header(), w.o.encryptionKey, false); err != nil { - w.mu.Lock() - w.err = err - w.mu.Unlock() - pr.CloseWithError(err) - return - } - var resp *raw.Object - err := applyConds("NewWriter", w.o.gen, w.o.conds, call) - if err == nil { - if w.o.userProject != "" { - call.UserProject(w.o.userProject) - } - setClientHeader(call.Header()) - - // The internals that perform call.Do automatically retry both the initial - // call to set up the upload as well as calls to upload individual chunks - // for a resumable upload (as long as the chunk size is non-zero). Hence - // there is no need to add retries here. - resp, err = call.Do() - } - if err != nil { - w.mu.Lock() - w.err = err - w.mu.Unlock() - pr.CloseWithError(err) - return - } - w.obj = newObject(resp) - }() - return nil -} - -// Write appends to w. It implements the io.Writer interface. -// -// Since writes happen asynchronously, Write may return a nil -// error even though the write failed (or will fail). Always -// use the error returned from Writer.Close to determine if -// the upload was successful. -// -// Writes will be retried on transient errors from the server, unless -// Writer.ChunkSize has been set to zero. -func (w *Writer) Write(p []byte) (n int, err error) { - w.mu.Lock() - werr := w.err - w.mu.Unlock() - if werr != nil { - return 0, werr - } - if !w.opened { - if err := w.open(); err != nil { - return 0, err - } - } - n, err = w.pw.Write(p) - if err != nil { - w.mu.Lock() - werr := w.err - w.mu.Unlock() - // Preserve existing functionality that when context is canceled, Write will return - // context.Canceled instead of "io: read/write on closed pipe". This hides the - // pipe implementation detail from users and makes Write seem as though it's an RPC. - if werr == context.Canceled || werr == context.DeadlineExceeded { - return n, werr - } - } - return n, err -} - -// Close completes the write operation and flushes any buffered data. -// If Close doesn't return an error, metadata about the written object -// can be retrieved by calling Attrs. -func (w *Writer) Close() error { - if !w.opened { - if err := w.open(); err != nil { - return err - } - } - - // Closing either the read or write causes the entire pipe to close. - if err := w.pw.Close(); err != nil { - return err - } - - <-w.donec - w.mu.Lock() - defer w.mu.Unlock() - return w.err -} - -// monitorCancel is intended to be used as a background goroutine. It monitors the -// context, and when it observes that the context has been canceled, it manually -// closes things that do not take a context. -func (w *Writer) monitorCancel() { - select { - case <-w.ctx.Done(): - w.mu.Lock() - werr := w.ctx.Err() - w.err = werr - w.mu.Unlock() - - // Closing either the read or write causes the entire pipe to close. - w.CloseWithError(werr) - case <-w.donec: - } -} - -// CloseWithError aborts the write operation with the provided error. -// CloseWithError always returns nil. -// -// Deprecated: cancel the context passed to NewWriter instead. -func (w *Writer) CloseWithError(err error) error { - if !w.opened { - return nil - } - return w.pw.CloseWithError(err) -} - -// Attrs returns metadata about a successfully-written object. -// It's only valid to call it after Close returns nil. -func (w *Writer) Attrs() *ObjectAttrs { - return w.obj -} diff --git a/ibm/vendor/cloud.google.com/go/tools.go b/ibm/vendor/cloud.google.com/go/tools.go deleted file mode 100644 index da5ca585d4..0000000000 --- a/ibm/vendor/cloud.google.com/go/tools.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build tools - -// Copyright 2018 Google LLC -// -// 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 package exists to cause `go mod` and `go get` to believe these tools -// are dependencies, even though they are not runtime dependencies of any -// package (these are tools used by our CI builds). This means they will appear -// in our `go.mod` file, but will not be a part of the build. Also, since the -// build target is something non-existent, these should not be included in any -// binaries. - -package cloud - -import ( - _ "github.com/golang/protobuf/protoc-gen-go" - _ "github.com/jstemmer/go-junit-report" - _ "golang.org/x/lint/golint" - _ "golang.org/x/tools/cmd/goimports" -) diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/.legal.yaml b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/.legal.yaml index b5bd9f0ca1..3dedf4c0c7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/.legal.yaml +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/.legal.yaml @@ -1,7 +1,7 @@ schemaVersion: oss-license-declaration.cloud.ibm.com:v4 name: bluemix-go source: https://github.com/IBM-Cloud/bluemix-go -issues: https://github.ibm.com/blueprint/schematics-compliance/issues +issues: https://github.ibm.com/blueprint/security-project-management/issues objectCodeOnly: false additionalDownloads: include: @@ -121,6 +121,8 @@ dependencies: - BSD-3-Clause - name: github.com/google/go-cmp version: v0.5.5 + licenses: + - BSD-3-Clause - name: github.com/google/uuid version: v1.1.1 licenses: @@ -131,6 +133,8 @@ dependencies: - MIT - name: github.com/inconshreveable/mousetrap version: v1.0.0 + licenses: + - Apache-2.0 - name: github.com/jmespath/go-jmespath version: v0.4.0 licenses: @@ -141,24 +145,34 @@ dependencies: - MIT - name: github.com/joho/godotenv version: v1.3.0 + licenses: + - MIT - name: github.com/karrick/godirwalk version: v1.10.3 licenses: - BSD-2-Clause - name: github.com/klauspost/compress version: v1.9.5 + licenses: + - Apache-2.0 + - BSD-3-Clause + - MIT - name: github.com/konsorten/go-windows-terminal-sequences version: v1.0.2 licenses: - MIT - name: github.com/kr/pretty version: v0.1.0 + licenses: + - MIT - name: github.com/kr/pty version: v1.1.1 licenses: - MIT - name: github.com/kr/text version: v0.2.0 + licenses: + - MIT - name: github.com/markbates/oncer version: v0.0.0-20181203154359-bf2de49a0be2 licenses: @@ -169,12 +183,16 @@ dependencies: - MIT - name: github.com/mitchellh/mapstructure version: v1.3.3 + licenses: + - MIT - name: github.com/montanaflynn/stats version: v0.0.0-20171201202039-1bf9dbcd8cbe licenses: - MIT - name: github.com/niemeyer/pretty version: v0.0.0-20200227124842-a10e7caefd8e + licenses: + - MIT - name: github.com/nxadm/tail version: v1.4.8 licenses: @@ -184,7 +202,9 @@ dependencies: licenses: - MIT - name: github.com/onsi/gomega - version: v1.14.0 + version: v1.16.0 + licenses: + - MIT - name: github.com/pelletier/go-toml version: v1.7.0 licenses: @@ -192,12 +212,16 @@ dependencies: - MIT - name: github.com/pkg/errors version: v0.9.1 + licenses: + - BSD-2-Clause - name: github.com/pmezard/go-difflib version: v1.0.0 licenses: - BSD-3-Clause - name: github.com/rogpeppe/go-internal version: v1.3.0 + licenses: + - BSD-3-Clause - name: github.com/sirupsen/logrus version: v1.4.2 licenses: @@ -208,12 +232,16 @@ dependencies: - Apache-2.0 - name: github.com/spf13/pflag version: v1.0.3 + licenses: + - BSD-3-Clause - name: github.com/stretchr/objx version: v0.1.1 licenses: - MIT - name: github.com/stretchr/testify version: v1.6.1 + licenses: + - MIT - name: github.com/tidwall/pretty version: v1.0.0 licenses: @@ -224,6 +252,8 @@ dependencies: - Apache-2.0 - name: github.com/xdg/stringprep version: v0.0.0-20180714160509-73f8eece6fdc + licenses: + - Apache-2.0 - name: github.com/yuin/goldmark version: v1.2.1 licenses: @@ -234,30 +264,44 @@ dependencies: - Apache-2.0 - name: golang.org/x/crypto version: v0.0.0-20200622213623-75b288015ac9 + licenses: + - BSD-3-Clause - name: golang.org/x/mod version: v0.3.0 + licenses: + - BSD-3-Clause - name: golang.org/x/net version: v0.0.0-20210614182718-04defd469f4e licenses: - BSD-3-Clause - name: golang.org/x/sync version: v0.0.0-20201020160332-67f06af15bc9 + licenses: + - BSD-3-Clause - name: golang.org/x/sys version: v0.0.0-20210423082822-04245dca01da + licenses: + - BSD-3-Clause - name: golang.org/x/term version: v0.0.0-20201126162022-7de9c90e9dd1 licenses: - BSD-3-Clause - name: golang.org/x/text version: v0.3.6 + licenses: + - BSD-3-Clause - name: golang.org/x/tools version: v0.0.0-20201224043029-2b0845dc783e licenses: - BSD-3-Clause - name: golang.org/x/xerrors version: v0.0.0-20200804184101-5ec99f83aff1 + licenses: + - BSD-3-Clause - name: google.golang.org/protobuf version: v1.26.0 + licenses: + - BSD-3-Clause - name: gopkg.in/check.v1 version: v1.0.0-20200227125254-8fa46927fb4f licenses: @@ -268,11 +312,18 @@ dependencies: - BSD-3-Clause - name: gopkg.in/fsnotify.v1 version: v1.4.7 + licenses: + - BSD-3-Clause - name: gopkg.in/tomb.v1 version: v1.0.0-20141024135613-dd632973f1e7 licenses: - BSD-3-Clause - name: gopkg.in/yaml.v2 version: v2.4.0 + licenses: + - Apache-2.0 - name: gopkg.in/yaml.v3 version: v3.0.0-20200605160147-a5ece683394c + licenses: + - Apache-2.0 + - MIT diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go index 0a43042c42..10d9918ec1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go @@ -63,6 +63,7 @@ type ClusterInfo struct { Provider string `json:"provider"` PodSubnet string `json:"podSubnet"` ServiceSubnet string `json:"serviceSubnet"` + ImageSecurityEnabled bool `json:"imageSecurityEnabled"` } // ClusterUpdateParam ... diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/clusters.go b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/clusters.go index 5ab008d495..83dd982a3b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/clusters.go +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/clusters.go @@ -57,40 +57,41 @@ type Zone struct { //ClusterInfo ... type ClusterInfo struct { - CreatedDate string `json:"createdDate"` - DataCenter string `json:"dataCenter"` - ID string `json:"id"` - Location string `json:"location"` - Entitlement string `json:"entitlement"` - MasterKubeVersion string `json:"masterKubeVersion"` - Name string `json:"name"` - Region string `json:"region"` - ResourceGroupID string `json:"resourceGroup"` - State string `json:"state"` - IsPaid bool `json:"isPaid"` - Addons []Addon `json:"addons"` - OwnerEmail string `json:"ownerEmail"` - Type string `json:"type"` - TargetVersion string `json:"targetVersion"` - ServiceSubnet string `json:"serviceSubnet"` - ResourceGroupName string `json:"resourceGroupName"` - Provider string `json:"provider"` - PodSubnet string `json:"podSubnet"` - MultiAzCapable bool `json:"multiAzCapable"` - APIUser string `json:"apiUser"` - ServerURL string `json:"serverURL"` - MasterURL string `json:"masterURL"` - MasterStatus string `json:"masterStatus"` - DisableAutoUpdate bool `json:"disableAutoUpdate"` - WorkerZones []string `json:"workerZones"` - Vpcs []string `json:"vpcs"` - CRN string `json:"crn"` - VersionEOS string `json:"versionEOS"` - ServiceEndpoints Endpoints `json:"serviceEndpoints"` - Lifecycle LifeCycleInfo `json:"lifecycle"` - WorkerCount int `json:"workerCount"` - Ingress IngresInfo `json:"ingress"` - Features Feat `json:"features"` + CreatedDate string `json:"createdDate"` + DataCenter string `json:"dataCenter"` + ID string `json:"id"` + Location string `json:"location"` + Entitlement string `json:"entitlement"` + MasterKubeVersion string `json:"masterKubeVersion"` + Name string `json:"name"` + Region string `json:"region"` + ResourceGroupID string `json:"resourceGroup"` + State string `json:"state"` + IsPaid bool `json:"isPaid"` + Addons []Addon `json:"addons"` + OwnerEmail string `json:"ownerEmail"` + Type string `json:"type"` + TargetVersion string `json:"targetVersion"` + ServiceSubnet string `json:"serviceSubnet"` + ResourceGroupName string `json:"resourceGroupName"` + Provider string `json:"provider"` + PodSubnet string `json:"podSubnet"` + MultiAzCapable bool `json:"multiAzCapable"` + APIUser string `json:"apiUser"` + ServerURL string `json:"serverURL"` + MasterURL string `json:"masterURL"` + MasterStatus string `json:"masterStatus"` + DisableAutoUpdate bool `json:"disableAutoUpdate"` + WorkerZones []string `json:"workerZones"` + Vpcs []string `json:"vpcs"` + CRN string `json:"crn"` + VersionEOS string `json:"versionEOS"` + ServiceEndpoints Endpoints `json:"serviceEndpoints"` + Lifecycle LifeCycleInfo `json:"lifecycle"` + WorkerCount int `json:"workerCount"` + Ingress IngresInfo `json:"ingress"` + Features Feat `json:"features"` + ImageSecurityEnabled bool `json:"imageSecurityEnabled"` } type Feat struct { KeyProtectEnabled bool `json:"keyProtectEnabled"` @@ -139,7 +140,8 @@ type Clusters interface { GetCluster(name string, target ClusterTargetHeader) (*ClusterInfo, error) GetClusterConfigDetail(name, homeDir string, admin bool, target ClusterTargetHeader) (containerv1.ClusterKeyInfo, error) StoreConfigDetail(name, baseDir string, admin bool, createCalicoConfig bool, target ClusterTargetHeader) (string, containerv1.ClusterKeyInfo, error) - + EnableImageSecurityEnforcement(name string, target ClusterTargetHeader) error + DisableImageSecurityEnforcement(name string, target ClusterTargetHeader) error //TODO Add other opertaions } type clusters struct { @@ -535,3 +537,17 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig clusterkey.FilePath = kubeconfigFileName return calicoConfig, clusterkey, nil } + +func (r *clusters) EnableImageSecurityEnforcement(name string, target ClusterTargetHeader) error { + rawURL := "/v2/enableImageSecurity" + body := map[string]string{"cluster": name} + _, err := r.client.Post(rawURL, body, nil, target.ToMap()) + return err +} + +func (r *clusters) DisableImageSecurityEnforcement(name string, target ClusterTargetHeader) error { + rawURL := "/v2/disableImageSecurity" + body := map[string]string{"cluster": name} + _, err := r.client.Post(rawURL, body, nil, target.ToMap()) + return err +} diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/worker_pool.go index 9457a6881a..1c038682bf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv2/worker_pool.go @@ -61,6 +61,12 @@ type Subnet struct { Primary bool `json:"primary"` } +type ResizeWorkerPoolReq struct { + Cluster string `json:"cluster"` + Size int64 `json:"size"` + Workerpool string `json:"workerpool"` +} + //Workers ... type WorkerPool interface { CreateWorkerPool(workerPoolReq WorkerPoolRequest, target ClusterTargetHeader) (WorkerPoolResponse, error) @@ -69,6 +75,7 @@ type WorkerPool interface { CreateWorkerPoolZone(workerPoolZone WorkerPoolZone, target ClusterTargetHeader) error DeleteWorkerPool(clusterNameOrID string, workerPoolNameOrID string, target ClusterTargetHeader) error UpdateWorkerPoolTaints(taintRequest WorkerPoolTaintRequest, target ClusterTargetHeader) error + ResizeWorkerPool(resizeWorkerPoolReq ResizeWorkerPoolReq, target ClusterTargetHeader) error } type workerpool struct { @@ -122,3 +129,10 @@ func (w *workerpool) UpdateWorkerPoolTaints(taintRequest WorkerPoolTaintRequest, _, err := w.client.Post("/v2/setWorkerPoolTaints", taintRequest, nil, target.ToMap()) return err } + +// ResizeWorkerPool calls the API to resize an existing worker pool. +func (w *workerpool) ResizeWorkerPool(resizeWorkerPoolReq ResizeWorkerPoolReq, target ClusterTargetHeader) error { + // Make the request, don't care about return value + _, err := w.client.Post("/v2/resizeWorkerPool", resizeWorkerPoolReq, nil, target.ToMap()) + return err +} diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/icd/icdv4/scaling.go b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/icd/icdv4/scaling.go index 97dcee4eaa..b2a866e2f2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/icd/icdv4/scaling.go +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/api/icd/icdv4/scaling.go @@ -2,6 +2,7 @@ package icdv4 import ( "fmt" + "github.com/IBM-Cloud/bluemix-go/client" "github.com/IBM-Cloud/bluemix-go/utils" ) @@ -14,9 +15,9 @@ type Group struct { Id string `json:"id"` Count int `json:"count"` Members Members `json:"members"` - Memory Memory `json:"memory"` - Cpu Cpu `json:"cpu"` - Disk Disk `json:"disk"` + Memory Memory `json:"memory"` + Cpu Cpu `json:"cpu"` + Disk Disk `json:"disk"` } type Members struct { @@ -26,6 +27,7 @@ type Members struct { MaximumCount int `json:"maximum_count"` StepSizeCount int `json:"step_size_count"` IsAdjustable bool `json:"is_adjustable"` + IsOptional bool `json:"is_optional"` CanScaleDown bool `json:"can_scale_down"` } @@ -36,6 +38,7 @@ type Memory struct { MaximumMb int `json:"maximum_mb"` StepSizeMb int `json:"step_size_mb"` IsAdjustable bool `json:"is_adjustable"` + IsOptional bool `json:"is_optional"` CanScaleDown bool `json:"can_scale_down"` } @@ -46,6 +49,7 @@ type Cpu struct { MaximumCount int `json:"maximum_count"` StepSizeCount int `json:"step_size_count"` IsAdjustable bool `json:"is_adjustable"` + IsOptional bool `json:"is_optional"` CanScaleDown bool `json:"can_scale_down"` } @@ -56,6 +60,7 @@ type Disk struct { MaximumMb int `json:"maximum_mb"` StepSizeMb int `json:"step_size_mb"` IsAdjustable bool `json:"is_adjustable"` + IsOptional bool `json:"is_optional"` CanScaleDown bool `json:"can_scale_down"` } @@ -77,7 +82,7 @@ type MemoryReq struct { AllocationMb int `json:"allocation_mb,omitempty"` } type CpuReq struct { - AllocationCount int `json:"allocation_count,omitempty"` + AllocationCount int `json:"allocation_count"` } type DiskReq struct { AllocationMb int `json:"allocation_mb,omitempty"` @@ -128,5 +133,3 @@ func (r *groups) UpdateGroup(icdId string, groupId string, groupReq GroupReq) (T } return taskResult.Task, nil } - - diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/http/transport.go b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/http/transport.go index 7a76f3c8cf..4d8fa78a5d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/http/transport.go +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/http/transport.go @@ -48,17 +48,17 @@ func (r *TraceLoggingTransport) dumpRequest(req *http.Request, start time.Time) dumpedRequest, err := httputil.DumpRequest(req, shouldDisplayBody) if err != nil { - trace.Logger.Printf("An error occurred while dumping request:\n%v\n", err) + trace.Logger.Printf("[ERROR] An error occurred while dumping request: %v", err) return } - trace.Logger.Printf("\n%s [%s]\n%s\n", + trace.Logger.Printf("[DEBUG] %s [%s] %s", "REQUEST:", start.Format(time.RFC3339), trace.Sanitize(string(dumpedRequest))) if !shouldDisplayBody { - trace.Logger.Println("[MULTIPART/FORM-DATA CONTENT HIDDEN]") + trace.Logger.Println("[DEBUG] [MULTIPART/FORM-DATA CONTENT HIDDEN]") } } @@ -68,11 +68,11 @@ func (r *TraceLoggingTransport) dumpResponse(res *http.Response, start time.Time shouldDisplayBody := !strings.Contains(res.Header.Get("Content-Type"), "application/zip") dumpedResponse, err := httputil.DumpResponse(res, shouldDisplayBody) if err != nil { - trace.Logger.Printf("An error occurred while dumping response:\n%v\n", err) + trace.Logger.Printf("[ERROR] An error occurred while dumping response: %v", err) return } - trace.Logger.Printf("\n%s [%s] %s %.0fms\n%s\n", + trace.Logger.Printf("[DEBUG] %s [%s] %s %.0fms %s", "RESPONSE:", end.Format(time.RFC3339), "Elapsed:", diff --git a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/trace/trace.go b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/trace/trace.go index fc697c7181..cf72cef3d4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/bluemix-go/trace/trace.go +++ b/ibm/vendor/github.com/IBM-Cloud/bluemix-go/trace/trace.go @@ -46,6 +46,11 @@ func (loggerImpl *loggerImpl) Close() error { return nil } +var ( + stdout = os.Stdout + stderr = os.Stderr +) + func newLoggerImpl(out io.Writer, prefix string, flag int) *loggerImpl { l := log.New(out, prefix, flag) c := out.(io.WriteCloser) @@ -73,9 +78,9 @@ func NewLogger(bluemix_trace string) Printer { // NewStdLogger return a printer that writes to StdOut. func NewStdLogger() PrinterCloser { if os.Getenv("IBMCLOUD_BLUEMIX_GO_TRACE") != "" { - return newLoggerImpl(os.Stdout, "", 0) + return newLoggerImpl(stdout, "", 0) } - return newLoggerImpl(os.Stdin, "", 0) + return newLoggerImpl(stderr, "", 0) } // NewFileLogger return a printer that writes to the given file path. @@ -83,7 +88,7 @@ func NewFileLogger(path string) PrinterCloser { file, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0644) if err != nil { logger := NewStdLogger() - logger.Printf("An error occurred when creating log file '%s':\n%v\n\n", path, err) + logger.Printf("[ERROR] An error occurred when creating log file '%s':\n%v\n\n", path, err) return logger } return newLoggerImpl(file, "", 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go index db2002b28d..c72b4d0d1f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-clonevolumes.go @@ -29,7 +29,7 @@ func (f *IBMPICloneVolumeClient) Create(body *models.VolumesCloneAsyncRequest) ( params := p_cloud_volumes.NewPcloudV2VolumesClonePostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonePost(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateCloneOperationFailed, err) } @@ -44,7 +44,7 @@ func (f *IBMPICloneVolumeClient) Get(cloneTaskID string) (*models.CloneTaskStatu params := p_cloud_volumes.NewPcloudV2VolumesClonetasksGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithCloneTaskID(cloneTaskID) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonetasksGet(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonetasksGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get the clone task %s status for the cloud instance %s with error %w", cloneTaskID, f.cloudInstanceID, err) } @@ -59,7 +59,7 @@ func (f *IBMPICloneVolumeClient) CreateV2Clone(body *models.VolumesCloneCreate) params := p_cloud_volumes.NewPcloudV2VolumesclonePostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesclonePost(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesclonePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.PrepareCloneOperationFailed, *body.Name, err) } @@ -74,7 +74,7 @@ func (f *IBMPICloneVolumeClient) GetV2Clones(queryFilter string) (*models.Volume params := p_cloud_volumes.NewPcloudV2VolumescloneGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithFilter(&queryFilter) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get the volumes-clones for the cloud instance %s with error %w", f.cloudInstanceID, err) } @@ -89,7 +89,7 @@ func (f *IBMPICloneVolumeClient) DeleteClone(id string) error { params := p_cloud_volumes.NewPcloudV2VolumescloneDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(id) - _, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneDelete(params, f.authInfo) + _, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteCloneOperationFailed, err) } @@ -101,7 +101,7 @@ func (f *IBMPICloneVolumeClient) StartClone(volumesCloneID string) (*models.Volu params := p_cloud_volumes.NewPcloudV2VolumescloneStartPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(volumesCloneID) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneStartPost(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneStartPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.StartCloneOperationFailed, volumesCloneID, err) } @@ -116,7 +116,7 @@ func (f *IBMPICloneVolumeClient) PrepareClone(volumesCloneID string) (*models.Vo params := p_cloud_volumes.NewPcloudV2VolumescloneExecutePostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(volumesCloneID) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneExecutePost(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneExecutePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.PrepareCloneOperationFailed, volumesCloneID, err) } @@ -131,7 +131,7 @@ func (f *IBMPICloneVolumeClient) GetV2CloneStatus(cloneName string) (*models.Vol params := p_cloud_volumes.NewPcloudV2VolumescloneGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(cloneName) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGet(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetCloneOperationFailed, cloneName, f.cloudInstanceID, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go index 175e5476e6..d1846123d2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-connection.go @@ -29,7 +29,7 @@ func (f *IBMPICloudConnectionClient) Create(body *models.CloudConnectionCreate) params := p_cloud_cloud_connections.NewPcloudCloudconnectionsPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, postcreated, postaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPost(params, f.authInfo) + postok, postcreated, postaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, nil, fmt.Errorf(errors.CreateCloudConnectionOperationFailed, f.cloudInstanceID, err) } @@ -50,7 +50,7 @@ func (f *IBMPICloudConnectionClient) Get(id string) (*models.CloudConnection, er params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetCloudConnectionOperationFailed, id, err) } @@ -65,7 +65,7 @@ func (f *IBMPICloudConnectionClient) GetAll() (*models.CloudConnections, error) params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all Cloud Connections: %w", err) } @@ -81,7 +81,7 @@ func (f *IBMPICloudConnectionClient) Update(id string, body *models.CloudConnect WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id). WithBody(body) - putok, putaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPut(params, f.authInfo) + putok, putaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, nil, fmt.Errorf(errors.UpdateCloudConnectionOperationFailed, id, err) } @@ -99,7 +99,7 @@ func (f *IBMPICloudConnectionClient) Delete(id string) (*models.JobReference, er params := p_cloud_cloud_connections.NewPcloudCloudconnectionsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id) - _, delaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsDelete(params, f.authInfo) + _, delaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.DeleteCloudConnectionOperationFailed, id, err) } @@ -115,7 +115,7 @@ func (f *IBMPICloudConnectionClient) AddNetwork(id, networkID string) (*models.C WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id). WithNetworkID(networkID) - respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, f.authInfo) + respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, nil, fmt.Errorf("failed to Add Network %s to Cloud Connection %s: %w", networkID, id, err) } @@ -134,7 +134,7 @@ func (f *IBMPICloudConnectionClient) DeleteNetwork(id, networkID string) (*model WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id). WithNetworkID(networkID) - respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksDelete(params, f.authInfo) + respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, nil, fmt.Errorf("failed to Delete Network %s from Cloud Connection %s: %w", networkID, id, err) } @@ -153,7 +153,7 @@ func (f *IBMPICloudConnectionClient) GetVPC() (*models.CloudConnectionVirtualPri WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsVirtualprivatecloudsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsVirtualprivatecloudsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to perform the get vpc operation: %w", err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go index a2ce52c200..45a0c8238d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-cloud-instance.go @@ -29,7 +29,7 @@ func (f *IBMPICloudInstanceClient) Get(id string) (*models.CloudInstance, error) params := p_cloud_instances.NewPcloudCloudinstancesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(id) - resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetCloudInstanceOperationFailed, id, err) } @@ -44,7 +44,7 @@ func (f *IBMPICloudInstanceClient) Update(id string, body *models.CloudInstanceU params := p_cloud_instances.NewPcloudCloudinstancesPutParams(). WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(id).WithBody(body) - resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesPut(params, f.authInfo) + resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.UpdateCloudInstanceOperationFailed, id, err) } @@ -59,7 +59,7 @@ func (f *IBMPICloudInstanceClient) Delete(id string) error { params := p_cloud_instances.NewPcloudCloudinstancesDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(id) - _, err := f.session.Power.PCloudInstances.PcloudCloudinstancesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudInstances.PcloudCloudinstancesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteCloudInstanceOperationFailed, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-dhcp.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-dhcp.go index 0b4a4cface..b3e7a0d6ed 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-dhcp.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-dhcp.go @@ -25,11 +25,11 @@ func NewIBMPIDhcpClient(ctx context.Context, sess *ibmpisession.IBMPISession, cl } // Create -func (f *IBMPIDhcpClient) Create() (*models.DHCPServer, error) { +func (f *IBMPIDhcpClient) Create(body *models.DHCPServerCreate) (*models.DHCPServer, error) { params := p_cloud_service_d_h_c_p.NewPcloudDhcpPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). - WithCloudInstanceID(f.cloudInstanceID) - postaccepted, err := f.session.Power.PCloudServiceDHCP.PcloudDhcpPost(params, f.authInfo) + WithCloudInstanceID(f.cloudInstanceID).WithBody(body) + postaccepted, err := f.session.Power.PCloudServicedhcp.PcloudDhcpPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateDchpOperationFailed, f.cloudInstanceID, err) } @@ -44,7 +44,7 @@ func (f *IBMPIDhcpClient) Get(id string) (*models.DHCPServerDetail, error) { params := p_cloud_service_d_h_c_p.NewPcloudDhcpGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithDhcpID(id) - resp, err := f.session.Power.PCloudServiceDHCP.PcloudDhcpGet(params, f.authInfo) + resp, err := f.session.Power.PCloudServicedhcp.PcloudDhcpGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetDhcpOperationFailed, id, err) } @@ -59,7 +59,7 @@ func (f *IBMPIDhcpClient) GetAll() (models.DHCPServers, error) { params := p_cloud_service_d_h_c_p.NewPcloudDhcpGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudServiceDHCP.PcloudDhcpGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudServicedhcp.PcloudDhcpGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all DHCP servers: %w", err) } @@ -74,7 +74,7 @@ func (f *IBMPIDhcpClient) Delete(id string) error { params := p_cloud_service_d_h_c_p.NewPcloudDhcpDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithDhcpID(id) - _, err := f.session.Power.PCloudServiceDHCP.PcloudDhcpDelete(params, f.authInfo) + _, err := f.session.Power.PCloudServicedhcp.PcloudDhcpDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteDhcpOperationFailed, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-helper.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-helper.go index 8da5da24fb..4b75a75755 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-helper.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-helper.go @@ -4,7 +4,6 @@ import ( "context" "github.com/IBM-Cloud/power-go-client/ibmpisession" - "github.com/go-openapi/runtime" ) /* @@ -15,17 +14,14 @@ Helper methods that will be used by the client classes type IBMPIClient struct { session *ibmpisession.IBMPISession cloudInstanceID string - authInfo runtime.ClientAuthInfoWriter ctx context.Context } // NewIBMPIClient ... func NewIBMPIClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIClient { - authInfo := ibmpisession.NewAuth(sess, cloudInstanceID) return &IBMPIClient{ session: sess, cloudInstanceID: cloudInstanceID, - authInfo: authInfo, ctx: ctx, } } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go index 97c7f694e8..a6063fe61f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go @@ -29,7 +29,7 @@ func (f *IBMPIImageClient) Get(id string) (*models.Image, error) { params := p_cloud_images.NewPcloudCloudinstancesImagesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithImageID(id) - resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetImageOperationFailed, id, err) } @@ -44,7 +44,7 @@ func (f *IBMPIImageClient) GetAll() (*models.Images, error) { params := p_cloud_images.NewPcloudCloudinstancesImagesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all PI Images of the PVM instance %s : %w", f.cloudInstanceID, err) } @@ -63,7 +63,7 @@ func (f *IBMPIImageClient) Create(body *models.CreateImage) (*models.Image, erro params := p_cloud_images.NewPcloudCloudinstancesImagesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - respok, respcreated, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesPost(params, f.authInfo) + respok, respcreated, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateImageOperationFailed, f.cloudInstanceID, err) } @@ -81,7 +81,7 @@ func (f *IBMPIImageClient) CreateCosImage(body *models.CreateCosImageImportJob) params := p_cloud_images.NewPcloudV1CloudinstancesCosimagesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - resp, err := f.session.Power.PCloudImages.PcloudV1CloudinstancesCosimagesPost(params, f.authInfo) + resp, err := f.session.Power.PCloudImages.PcloudV1CloudinstancesCosimagesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to perform Create COS Image Operation for cloud instance %s with error %w", f.cloudInstanceID, err) } @@ -96,7 +96,7 @@ func (f *IBMPIImageClient) ExportImage(id string, body *models.ExportImage) (*mo params := p_cloud_images.NewPcloudV2ImagesExportPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithImageID(id).WithBody(body) - resp, err := f.session.Power.PCloudImages.PcloudV2ImagesExportPost(params, f.authInfo) + resp, err := f.session.Power.PCloudImages.PcloudV2ImagesExportPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Export COS Image for image id %s with error %w", id, err) } @@ -111,7 +111,7 @@ func (f *IBMPIImageClient) Delete(id string) error { params := p_cloud_images.NewPcloudCloudinstancesImagesDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithImageID(id) - _, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to Delete PI Image %s: %w", id, err) } @@ -123,7 +123,7 @@ func (f *IBMPIImageClient) GetStockImage(id string) (*models.Image, error) { params := p_cloud_images.NewPcloudCloudinstancesStockimagesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithImageID(id) - resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get PI Stock Image %s for cloud instance %s: %w", id, f.cloudInstanceID, err) } @@ -140,7 +140,7 @@ func (f *IBMPIImageClient) GetAllStockImages(includeSAP bool, includeVTl bool) ( WithCloudInstanceID(f.cloudInstanceID). WithSap(&includeSAP). WithVtl(&includeVTl) - resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get Stock Images with (SAP=%t, VTL=%t) for cloud instance %s: %w", includeSAP, includeVTl, f.cloudInstanceID, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go index 03c621ab09..c73f8bcee2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance.go @@ -27,7 +27,7 @@ func (f *IBMPIInstanceClient) Get(id string) (*models.PVMInstance, error) { params := p_cloud_p_vm_instances.NewPcloudPvminstancesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get PVM Instance %s :%w", id, err) } @@ -42,7 +42,7 @@ func (f *IBMPIInstanceClient) GetAll() (*models.PVMInstances, error) { params := p_cloud_p_vm_instances.NewPcloudPvminstancesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all PVM Instances of Power Instance %s :%w", f.cloudInstanceID, err) } @@ -57,7 +57,7 @@ func (f *IBMPIInstanceClient) Create(body *models.PVMInstanceCreate) (*models.PV params := p_cloud_p_vm_instances.NewPcloudPvminstancesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, postcreated, postAccepted, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesPost(params, ibmpisession.NewAuth(f.session, f.cloudInstanceID)) + postok, postcreated, postAccepted, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Create PVM Instance :%w", err) } @@ -78,7 +78,7 @@ func (f *IBMPIInstanceClient) Delete(id string) error { params := p_cloud_p_vm_instances.NewPcloudPvminstancesDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id) - _, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to Delete PVM Instance %s :%w", id, err) } @@ -90,7 +90,7 @@ func (f *IBMPIInstanceClient) Update(id string, body *models.PVMInstanceUpdate) params := p_cloud_p_vm_instances.NewPcloudPvminstancesPutParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id).WithBody(body) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesPut(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Update PVM Instance %s :%w", id, err) } @@ -106,7 +106,7 @@ func (f *IBMPIInstanceClient) Action(id string, body *models.PVMInstanceAction) WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - _, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesActionPost(params, f.authInfo) + _, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesActionPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to perform Action on PVM Instance %s :%w", id, err) } @@ -119,7 +119,7 @@ func (f *IBMPIInstanceClient) PostConsoleURL(id string) (*models.PVMInstanceCons params := p_cloud_p_vm_instances.NewPcloudPvminstancesConsolePostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id) - postok, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesConsolePost(params, f.authInfo) + postok, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesConsolePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Generate the Console URL PVM Instance %s :%w", id, err) } @@ -134,7 +134,7 @@ func (f *IBMPIInstanceClient) GetConsoleLanguages(id string) (*models.ConsoleLan params := p_cloud_p_vm_instances.NewPcloudPvminstancesConsoleGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesConsoleGet(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesConsoleGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get Console Languages for PVM Instance %s :%w", id, err) } @@ -150,7 +150,7 @@ func (f *IBMPIInstanceClient) UpdateConsoleLanguage(id string, body *models.Cons WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesConsolePut(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesConsolePut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Update Console Language for PVM Instance %s :%w", id, err) } @@ -166,7 +166,7 @@ func (f *IBMPIInstanceClient) CaptureInstanceToImageCatalog(id string, body *mod WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - _, _, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesCapturePost(params, f.authInfo) + _, _, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesCapturePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to Capture the PVM Instance %s: %w", id, err) } @@ -180,7 +180,7 @@ func (f *IBMPIInstanceClient) CaptureInstanceToImageCatalogV2(id string, body *m WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - resp, err := f.session.Power.PCloudPVMInstances.PcloudV2PvminstancesCapturePost(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudV2PvminstancesCapturePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Capture the PVM Instance %s: %w", id, err) } @@ -196,7 +196,7 @@ func (f *IBMPIInstanceClient) CreatePvmSnapShot(id string, body *models.Snapshot WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - snapshotpostaccepted, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesSnapshotsPost(params, f.authInfo) + snapshotpostaccepted, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesSnapshotsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Create the snapshot for the pvminstance %s: %w", id, err) } @@ -212,7 +212,7 @@ func (f *IBMPIInstanceClient) CreateClone(id string, body *models.PVMInstanceClo WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - clonePost, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesClonePost(params, f.authInfo) + clonePost, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesClonePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to create the clone of the pvm instance %s: %w", id, err) } @@ -227,7 +227,7 @@ func (f *IBMPIInstanceClient) GetSnapShotVM(id string) (*models.Snapshots, error params := p_cloud_p_vm_instances.NewPcloudPvminstancesSnapshotsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesSnapshotsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesSnapshotsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get the snapshot for the pvminstance %s: %w", id, err) } @@ -245,8 +245,8 @@ func (f *IBMPIInstanceClient) RestoreSnapShotVM(id, snapshotid, restoreAction st WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithSnapshotID(snapshotid).WithRestoreFailAction(&restoreAction). WithBody(body) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesSnapshotsRestorePost(params, f.authInfo) - if err != nil || resp == nil || resp.Payload == nil { + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesSnapshotsRestorePost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { return nil, fmt.Errorf("failed to restrore the snapshot for the pvminstance %s: %w", id, err) } if resp == nil || resp.Payload == nil { @@ -261,7 +261,7 @@ func (f *IBMPIInstanceClient) AddNetwork(id string, body *models.PVMInstanceAddN WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesNetworksPost(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesNetworksPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to attach the network to the pvminstanceid %s: %w", id, err) } @@ -277,7 +277,7 @@ func (f *IBMPIInstanceClient) DeleteNetwork(id string, body *models.PVMInstanceR WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithBody(body) - _, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesNetworksDelete(params, f.authInfo) + _, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesNetworksDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to delete the network to the pvminstanceid %s: %w", id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-job.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-job.go index 5950d59888..e3eddb65f1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-job.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-job.go @@ -29,7 +29,7 @@ func (f *IBMPIJobClient) Get(id string) (*models.Job, error) { params := p_cloud_jobs.NewPcloudCloudinstancesJobsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithJobID(id) - resp, err := f.session.Power.PCloudJobs.PcloudCloudinstancesJobsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudJobs.PcloudCloudinstancesJobsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetJobOperationFailed, id, err) } @@ -44,7 +44,7 @@ func (f *IBMPIJobClient) GetAll() (*models.Jobs, error) { params := p_cloud_jobs.NewPcloudCloudinstancesJobsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudJobs.PcloudCloudinstancesJobsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudJobs.PcloudCloudinstancesJobsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetAllJobsOperationFailed, err) } @@ -59,7 +59,7 @@ func (f *IBMPIJobClient) Delete(id string) error { params := p_cloud_jobs.NewPcloudCloudinstancesJobsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithJobID(id) - _, err := f.session.Power.PCloudJobs.PcloudCloudinstancesJobsDelete(params, f.authInfo) + _, err := f.session.Power.PCloudJobs.PcloudCloudinstancesJobsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteJobsOperationFailed, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go index 992002838d..2c236ae481 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-key.go @@ -26,11 +26,11 @@ func NewIBMPIKeyClient(ctx context.Context, sess *ibmpisession.IBMPISession, clo // Get Key... func (f *IBMPIKeyClient) Get(id string) (*models.SSHKey, error) { - var tenantid = f.session.UserAccount + var tenantid = f.session.Options.UserAccount params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithTenantID(tenantid).WithSshkeyName(id) - resp, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysGet(params, f.authInfo) + resp, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetPIKeyOperationFailed, id, err) } @@ -42,11 +42,11 @@ func (f *IBMPIKeyClient) Get(id string) (*models.SSHKey, error) { // GetAll Information about all the PVM Instances for a Client func (f *IBMPIKeyClient) GetAll() (*models.SSHKeys, error) { - var tenantid = f.session.UserAccount + var tenantid = f.session.Options.UserAccount params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithTenantID(tenantid) - resp, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all PI Keys: %w", err) } @@ -58,10 +58,11 @@ func (f *IBMPIKeyClient) GetAll() (*models.SSHKeys, error) { // Create PI Key ... func (f *IBMPIKeyClient) Create(body *models.SSHKey) (*models.SSHKey, error) { + var tenantid = f.session.Options.UserAccount params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). - WithTenantID(f.session.UserAccount).WithBody(body) - postok, postcreated, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysPost(params, f.authInfo) + WithTenantID(tenantid).WithBody(body) + postok, postcreated, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreatePIKeyOperationFailed, err) } @@ -76,11 +77,11 @@ func (f *IBMPIKeyClient) Create(body *models.SSHKey) (*models.SSHKey, error) { // Delete ... func (f *IBMPIKeyClient) Delete(id string) error { - var tenantid = f.session.UserAccount + var tenantid = f.session.Options.UserAccount params := p_cloud_tenants_ssh_keys.NewPcloudTenantsSshkeysDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithTenantID(tenantid).WithSshkeyName(id) - _, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysDelete(params, f.authInfo) + _, err := f.session.Power.PCloudTenantsSSHKeys.PcloudTenantsSshkeysDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeletePIKeyOperationFailed, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go index eaf3c9e8c6..5871a504fc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network.go @@ -29,7 +29,7 @@ func (f *IBMPINetworkClient) Get(id string) (*models.Network, error) { params := p_cloud_networks.NewPcloudNetworksGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGet(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetNetworkOperationFailed, id, err) } @@ -44,7 +44,7 @@ func (f *IBMPINetworkClient) GetAll() (*models.Networks, error) { params := p_cloud_networks.NewPcloudNetworksGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get Network for cloud instance %s with error %w", f.cloudInstanceID, err) } @@ -59,7 +59,7 @@ func (f *IBMPINetworkClient) Create(body *models.NetworkCreate) (*models.Network params := p_cloud_networks.NewPcloudNetworksPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, postcreated, err := f.session.Power.PCloudNetworks.PcloudNetworksPost(params, f.authInfo) + postok, postcreated, err := f.session.Power.PCloudNetworks.PcloudNetworksPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateNetworkOperationFailed, body.Name, err) } @@ -72,13 +72,29 @@ func (f *IBMPINetworkClient) Create(body *models.NetworkCreate) (*models.Network return nil, fmt.Errorf("failed to perform Create Network Operation for Network %s", body.Name) } +// Update ... +func (f *IBMPINetworkClient) Update(id string, body *models.NetworkUpdate) (*models.Network, error) { + params := p_cloud_networks.NewPcloudNetworksPutParams(). + WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). + WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). + WithBody(body) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, fmt.Errorf("failed to perform Update Network Operation for Network %s with error %w", id, err) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to perform Update Network Operation for Network %s", id) + } + return resp.Payload, nil +} + // GetPublic ... func (f *IBMPINetworkClient) GetAllPublic() (*models.Networks, error) { filterQuery := "type=\"pub-vlan\"" params := p_cloud_networks.NewPcloudNetworksGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithFilter(&filterQuery) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all Public Networks for cloud instance %s: %w", f.cloudInstanceID, err) } @@ -93,7 +109,7 @@ func (f *IBMPINetworkClient) Delete(id string) error { params := p_cloud_networks.NewPcloudNetworksDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id) - _, err := f.session.Power.PCloudNetworks.PcloudNetworksDelete(params, f.authInfo) + _, err := f.session.Power.PCloudNetworks.PcloudNetworksDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to Delete PI Network %s: %w", id, err) } @@ -105,7 +121,7 @@ func (f *IBMPINetworkClient) GetAllPorts(id string) (*models.NetworkPorts, error params := p_cloud_networks.NewPcloudNetworksPortsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all Network Ports for Network %s: %w", id, err) } @@ -121,7 +137,7 @@ func (f *IBMPINetworkClient) GetPort(id string, networkPortID string) (*models.N WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). WithPortID(networkPortID) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get PI Network Port %s for Network %s: %w", networkPortID, id, err) @@ -138,7 +154,7 @@ func (f *IBMPINetworkClient) CreatePort(id string, body *models.NetworkPortCreat WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). WithBody(body) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPost(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateNetworkPortOperationFailed, id, err) } @@ -154,7 +170,7 @@ func (f *IBMPINetworkClient) DeletePort(id string, networkPortID string) error { WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). WithPortID(networkPortID) - _, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsDelete(params, f.authInfo) + _, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to delete the network port %s for network %s with error %w", networkPortID, id, err) } @@ -167,7 +183,7 @@ func (f *IBMPINetworkClient) UpdatePort(id, networkPortID string, body *models.N WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). WithPortID(networkPortID).WithBody(body) - resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPut(params, f.authInfo) + resp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to update the port %s and Network %s with error %w", networkPortID, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go index dc9d0a342b..34ab6eeb30 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-placement-groups.go @@ -29,7 +29,7 @@ func (f *IBMPIPlacementGroupClient) Get(id string) (*models.PlacementGroup, erro params := p_cloud_placement_groups.NewPcloudPlacementgroupsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPlacementGroupID(id) - resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetPlacementGroupOperationFailed, id, err) } @@ -44,7 +44,7 @@ func (f *IBMPIPlacementGroupClient) GetAll() (*models.PlacementGroups, error) { params := p_cloud_placement_groups.NewPcloudPlacementgroupsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get All Placement Groups: %w", err) } @@ -59,7 +59,7 @@ func (f *IBMPIPlacementGroupClient) Create(body *models.PlacementGroupCreate) (* params := p_cloud_placement_groups.NewPcloudPlacementgroupsPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsPost(params, f.authInfo) + postok, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreatePlacementGroupOperationFailed, f.cloudInstanceID, err) } @@ -74,7 +74,7 @@ func (f *IBMPIPlacementGroupClient) Delete(id string) error { params := p_cloud_placement_groups.NewPcloudPlacementgroupsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPlacementGroupID(id) - _, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsDelete(params, f.authInfo) + _, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeletePlacementGroupOperationFailed, id, err) } @@ -87,7 +87,7 @@ func (f *IBMPIPlacementGroupClient) AddMember(id string, body *models.PlacementG WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPlacementGroupID(id). WithBody(body) - postok, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsMembersPost(params, f.authInfo) + postok, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.AddMemberPlacementGroupOperationFailed, *body.ID, id, err) } @@ -103,7 +103,7 @@ func (f *IBMPIPlacementGroupClient) DeleteMember(id string, body *models.Placeme WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPlacementGroupID(id). WithBody(body) - delok, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsMembersDelete(params, f.authInfo) + delok, err := f.session.Power.PCloudPlacementGroups.PcloudPlacementgroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.DeleteMemberPlacementGroupOperationFailed, *body.ID, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-sap-instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-sap-instance.go index 2f2968fa35..da2c17e85f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-sap-instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-sap-instance.go @@ -27,7 +27,7 @@ func (f *IBMPISAPInstanceClient) Create(body *models.SAPCreate) (*models.PVMInst params := p_cloud_s_a_p.NewPcloudSapPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, postcreated, postAccepted, err := f.session.Power.PCloudSAP.PcloudSapPost(params, f.authInfo) + postok, postcreated, postAccepted, err := f.session.Power.PCloudsap.PcloudSapPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Create SAP Instance: %w", err) } @@ -48,7 +48,7 @@ func (f *IBMPISAPInstanceClient) GetSAPProfile(id string) (*models.SAPProfile, e params := p_cloud_s_a_p.NewPcloudSapGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSapProfileID(id) - resp, err := f.session.Power.PCloudSAP.PcloudSapGet(params, f.authInfo) + resp, err := f.session.Power.PCloudsap.PcloudSapGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get sap profile %s : %w", id, err) } @@ -63,7 +63,7 @@ func (f *IBMPISAPInstanceClient) GetAllSAPProfiles(cloudInstanceID string) (*mod params := p_cloud_s_a_p.NewPcloudSapGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudSAP.PcloudSapGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudsap.PcloudSapGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get all sap profiles for power instance %s: %w", cloudInstanceID, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-snapshot.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-snapshot.go index e78362b042..3c3c5830c5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-snapshot.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-snapshot.go @@ -28,7 +28,7 @@ func (f *IBMPISnapshotClient) Get(id string) (*models.Snapshot, error) { params := p_cloud_snapshots.NewPcloudCloudinstancesSnapshotsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSnapshotID(id) - resp, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get PI Snapshot %s: %w", id, err) } @@ -43,7 +43,7 @@ func (f *IBMPISnapshotClient) Delete(id string) error { params := p_cloud_snapshots.NewPcloudCloudinstancesSnapshotsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSnapshotID(id) - _, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsDelete(params, f.authInfo) + _, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to Delete PI Snapshot %s: %w", id, err) } @@ -56,7 +56,7 @@ func (f *IBMPISnapshotClient) Update(id string, body *models.SnapshotUpdate) (mo WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSnapshotID(id). WithBody(body) - resp, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsPut(params, f.authInfo) + resp, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Update PI Snapshot %s: %w", id, err) } @@ -71,7 +71,7 @@ func (f *IBMPISnapshotClient) GetAll() (*models.Snapshots, error) { params := p_cloud_snapshots.NewPcloudCloudinstancesSnapshotsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudSnapshots.PcloudCloudinstancesSnapshotsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all PI Snapshots: %w", err) } @@ -87,7 +87,7 @@ func (f *IBMPISnapshotClient) Create(instanceID, snapshotID, restoreFailAction s WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(instanceID). WithSnapshotID(snapshotID).WithRestoreFailAction(&restoreFailAction) - resp, err := f.session.Power.PCloudPVMInstances.PcloudPvminstancesSnapshotsRestorePost(params, f.authInfo) + resp, err := f.session.Power.PCloudpVMInstances.PcloudPvminstancesSnapshotsRestorePost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to restore PI Snapshot %s of the instance %s: %w", snapshotID, instanceID, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go index 938b443fab..59efabd664 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-storage-capacity.go @@ -27,7 +27,7 @@ func (f *IBMPIStorageCapacityClient) GetAllStoragePoolsCapacity() (*models.Stora params := p_cloud_storage_capacity.NewPcloudStoragecapacityPoolsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityPoolsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityPoolsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get the capacity for all storage pools: %w", err) } @@ -42,7 +42,7 @@ func (f *IBMPIStorageCapacityClient) GetStoragePoolCapacity(storagePool string) params := p_cloud_storage_capacity.NewPcloudStoragecapacityPoolsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithStoragePoolName(storagePool) - resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityPoolsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityPoolsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get the capacity for storage pool %s: %w", storagePool, err) } @@ -57,7 +57,7 @@ func (f *IBMPIStorageCapacityClient) GetStorageTypeCapacity(storageType string) params := p_cloud_storage_capacity.NewPcloudStoragecapacityTypesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithStorageTypeName(storageType) - resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityTypesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityTypesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get the capacity for storage type %s: %w", storageType, err) } @@ -72,7 +72,7 @@ func (f *IBMPIStorageCapacityClient) GetAllStorageTypesCapacity() (*models.Stora params := p_cloud_storage_capacity.NewPcloudStoragecapacityTypesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityTypesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudStorageCapacity.PcloudStoragecapacityTypesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get the capacity for all storage types %w", err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go index f5ac4dd2db..c7abdd673a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-system-pools.go @@ -29,7 +29,7 @@ func (f *IBMPISystemPoolClient) Get(id string) (models.SystemPools, error) { params := p_cloud_system_pools.NewPcloudSystempoolsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(id) - resp, err := f.session.Power.PCloudSystemPools.PcloudSystempoolsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudSystemPools.PcloudSystempoolsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetSystemPoolsOperationFailed, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go index 4d0bf06a8d..569d8379ab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tasks.go @@ -27,7 +27,7 @@ func (f *IBMPITaskClient) Get(id string) (*models.Task, error) { params := p_cloud_tasks.NewPcloudTasksGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithTaskID(id) - resp, err := f.session.Power.PCloudTasks.PcloudTasksGet(params, f.authInfo) + resp, err := f.session.Power.PCloudTasks.PcloudTasksGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil || resp.Payload == nil { return nil, fmt.Errorf("failed to get the task %s: %w", id, err) } @@ -39,7 +39,7 @@ func (f *IBMPITaskClient) Delete(id string) error { params := p_cloud_tasks.NewPcloudTasksDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithTaskID(id) - _, err := f.session.Power.PCloudTasks.PcloudTasksDelete(params, f.authInfo) + _, err := f.session.Power.PCloudTasks.PcloudTasksDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to delete the task id ... %w", err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tenant.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tenant.go index 5945330a5e..e16875e944 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tenant.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-tenant.go @@ -27,7 +27,7 @@ func (f *IBMPITenantClient) Get(tenantid string) (*models.Tenant, error) { params := p_cloud_tenants.NewPcloudTenantsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithTenantID(tenantid) - resp, err := f.session.Power.PCloudTenants.PcloudTenantsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudTenants.PcloudTenantsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get tenant %s with error %w", tenantid, err) } @@ -41,8 +41,8 @@ func (f *IBMPITenantClient) Get(tenantid string) (*models.Tenant, error) { func (f *IBMPITenantClient) GetSelfTenant() (*models.Tenant, error) { params := p_cloud_tenants.NewPcloudTenantsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). - WithTenantID(f.session.UserAccount) - resp, err := f.session.Power.PCloudTenants.PcloudTenantsGet(params, f.authInfo) + WithTenantID(f.session.Options.UserAccount) + resp, err := f.session.Power.PCloudTenants.PcloudTenantsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get self tenant with error %w", err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go index c20d7216d5..0e6d9f75cf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-volume.go @@ -29,11 +29,11 @@ func (f *IBMPIVolumeClient) Get(id string) (*models.Volume, error) { params := p_cloud_volumes.NewPcloudCloudinstancesVolumesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumeID(id) - resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetVolumeOperationFailed, id, err) } - if err != nil || resp.Payload == nil { + if resp == nil || resp.Payload == nil { return nil, fmt.Errorf("failed to Get Volume %s", id) } return resp.Payload, nil @@ -44,7 +44,7 @@ func (f *IBMPIVolumeClient) GetAll() (*models.Volumes, error) { params := p_cloud_volumes.NewPcloudCloudinstancesVolumesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all Volumes for Cloud Instance %s: %w", f.cloudInstanceID, err) } @@ -59,7 +59,7 @@ func (f *IBMPIVolumeClient) GetAllAffinityVolumes(affinity string) (*models.Volu params := p_cloud_volumes.NewPcloudCloudinstancesVolumesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithAffinity(&affinity) - resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all Volumes with affinity %s for Cloud Instance %s: %w", affinity, f.cloudInstanceID, err) } @@ -74,11 +74,11 @@ func (f *IBMPIVolumeClient) CreateVolumeV2(body *models.MultiVolumesCreate) (*mo params := p_cloud_volumes.NewPcloudV2VolumesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesPost(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateVolumeV2OperationFailed, *body.Name, err) } - if err != nil || resp.Payload == nil { + if resp == nil || resp.Payload == nil { return nil, fmt.Errorf("failed to Create Volume v2") } return resp.Payload, nil @@ -89,11 +89,11 @@ func (f *IBMPIVolumeClient) CreateVolume(body *models.CreateDataVolume) (*models params := p_cloud_volumes.NewPcloudCloudinstancesVolumesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPost(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateVolumeOperationFailed, *body.Name, err) } - if err != nil || resp.Payload == nil { + if resp == nil || resp.Payload == nil { return nil, fmt.Errorf("failed to Create Volume") } return resp.Payload, nil @@ -105,11 +105,11 @@ func (f *IBMPIVolumeClient) UpdateVolume(id string, body *models.UpdateVolume) ( WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumeID(id). WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPut(params, f.authInfo) - if err != nil || resp == nil || resp.Payload == nil { + resp, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { return nil, fmt.Errorf(errors.UpdateVolumeOperationFailed, id, err) } - if err != nil || resp.Payload == nil { + if resp == nil || resp.Payload == nil { return nil, fmt.Errorf("failed to Update Volume %s", id) } return resp.Payload, nil @@ -120,7 +120,7 @@ func (f *IBMPIVolumeClient) DeleteVolume(id string) error { params := p_cloud_volumes.NewPcloudCloudinstancesVolumesDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVolumeID(id) - _, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudVolumes.PcloudCloudinstancesVolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteVolumeOperationFailed, id, err) } @@ -133,7 +133,7 @@ func (f *IBMPIVolumeClient) Attach(id, volumename string) error { WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithVolumeID(volumename) - _, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesPost(params, f.authInfo) + _, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.AttachVolumeOperationFailed, volumename, err) } @@ -146,7 +146,7 @@ func (f *IBMPIVolumeClient) Detach(id, volumename string) error { WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithVolumeID(volumename) - _, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DetachVolumeOperationFailed, volumename, err) } @@ -158,7 +158,7 @@ func (f *IBMPIVolumeClient) GetAllInstanceVolumes(id string) (*models.Volumes, e params := p_cloud_volumes.NewPcloudPvminstancesVolumesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id) - resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all Volumes for PI Instance %s: %w", id, err) } @@ -174,7 +174,7 @@ func (f *IBMPIVolumeClient) SetBootVolume(id, volumename string) error { WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithVolumeID(volumename) - _, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesSetbootPut(params, f.authInfo) + _, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesSetbootPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to set the boot volume %s for instance %s", volumename, id) } @@ -187,7 +187,7 @@ func (f *IBMPIVolumeClient) CheckVolumeAttach(id, volumeID string) (*models.Volu WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithVolumeID(volumeID) - resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to validate that the volume %s is attached to the pvminstance %s: %w", volumeID, id, err) } @@ -203,7 +203,7 @@ func (f *IBMPIVolumeClient) UpdateVolumeAttach(id, volumeID string, body *models WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). WithVolumeID(volumeID).WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesPut(params, f.authInfo) + resp, err := f.session.Power.PCloudVolumes.PcloudPvminstancesVolumesPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf("failed to validate that the volume %s is attached to the pvminstance %s: %w", volumeID, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn-policy.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn-policy.go index 0d658bbe3c..1a6ed1771b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn-policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn-policy.go @@ -31,7 +31,7 @@ func (f *IBMPIVpnPolicyClient) GetIKEPolicy(id string) (*models.IKEPolicy, error params := p_cloud_v_p_n_policies.NewPcloudIkepoliciesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithIkePolicyID(id) - resp, err := f.session.Power.PCloudVPNPolicies.PcloudIkepoliciesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnPolicies.PcloudIkepoliciesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetVPNPolicyOperationFailed, id, err) } @@ -46,7 +46,7 @@ func (f *IBMPIVpnPolicyClient) CreateIKEPolicy(body *models.IKEPolicyCreate) (*m params := p_cloud_v_p_n_policies.NewPcloudIkepoliciesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, err := f.session.Power.PCloudVPNPolicies.PcloudIkepoliciesPost(params, f.authInfo) + postok, err := f.session.Power.PCloudvpnPolicies.PcloudIkepoliciesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateVPNPolicyOperationFailed, f.cloudInstanceID, err) } @@ -62,7 +62,7 @@ func (f *IBMPIVpnPolicyClient) UpdateIKEPolicy(id string, body *models.IKEPolicy WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithIkePolicyID(id). WithBody(body) - putok, err := f.session.Power.PCloudVPNPolicies.PcloudIkepoliciesPut(params, f.authInfo) + putok, err := f.session.Power.PCloudvpnPolicies.PcloudIkepoliciesPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.UpdateVPNPolicyOperationFailed, id, err) } @@ -77,7 +77,7 @@ func (f *IBMPIVpnPolicyClient) GetAllIKEPolicies() (*models.IKEPolicies, error) params := p_cloud_v_p_n_policies.NewPcloudIkepoliciesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudVPNPolicies.PcloudIkepoliciesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnPolicies.PcloudIkepoliciesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get all ike policies: %w", err) } @@ -92,7 +92,7 @@ func (f *IBMPIVpnPolicyClient) DeleteIKEPolicy(id string) error { params := p_cloud_v_p_n_policies.NewPcloudIkepoliciesDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithIkePolicyID(id) - _, err := f.session.Power.PCloudVPNPolicies.PcloudIkepoliciesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudvpnPolicies.PcloudIkepoliciesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteVPNPolicyOperationFailed, id, err) } @@ -106,7 +106,7 @@ func (f *IBMPIVpnPolicyClient) GetIPSecPolicy(id string) (*models.IPSecPolicy, e params := p_cloud_v_p_n_policies.NewPcloudIpsecpoliciesGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithIpsecPolicyID(id) - resp, err := f.session.Power.PCloudVPNPolicies.PcloudIpsecpoliciesGet(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnPolicies.PcloudIpsecpoliciesGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetVPNPolicyOperationFailed, id, err) } @@ -121,7 +121,7 @@ func (f *IBMPIVpnPolicyClient) CreateIPSecPolicy(body *models.IPSecPolicyCreate) params := p_cloud_v_p_n_policies.NewPcloudIpsecpoliciesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postok, err := f.session.Power.PCloudVPNPolicies.PcloudIpsecpoliciesPost(params, f.authInfo) + postok, err := f.session.Power.PCloudvpnPolicies.PcloudIpsecpoliciesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateVPNPolicyOperationFailed, f.cloudInstanceID, err) } @@ -137,7 +137,7 @@ func (f *IBMPIVpnPolicyClient) UpdateIPSecPolicy(id string, body *models.IPSecPo WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithIpsecPolicyID(id). WithBody(body) - putok, err := f.session.Power.PCloudVPNPolicies.PcloudIpsecpoliciesPut(params, f.authInfo) + putok, err := f.session.Power.PCloudvpnPolicies.PcloudIpsecpoliciesPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.UpdateVPNPolicyOperationFailed, id, err) } @@ -152,7 +152,7 @@ func (f *IBMPIVpnPolicyClient) GetAllIPSecPolicies() (*models.IPSecPolicies, err params := p_cloud_v_p_n_policies.NewPcloudIpsecpoliciesGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudVPNPolicies.PcloudIpsecpoliciesGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnPolicies.PcloudIpsecpoliciesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to get all ipsec policies: %w", err) } @@ -167,7 +167,7 @@ func (f *IBMPIVpnPolicyClient) DeleteIPSecPolicy(id string) error { params := p_cloud_v_p_n_policies.NewPcloudIpsecpoliciesDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithIpsecPolicyID(id) - _, err := f.session.Power.PCloudVPNPolicies.PcloudIpsecpoliciesDelete(params, f.authInfo) + _, err := f.session.Power.PCloudvpnPolicies.PcloudIpsecpoliciesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return fmt.Errorf(errors.DeleteVPNPolicyOperationFailed, id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn.go index fc7dbcc039..5b2e8b64c6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpn.go @@ -29,7 +29,7 @@ func (f *IBMPIVpnConnectionClient) Get(id string) (*models.VPNConnection, error) params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.GetVPNConnectionOperationFailed, id, err) } @@ -44,7 +44,7 @@ func (f *IBMPIVpnConnectionClient) Create(body *models.VPNConnectionCreate) (*mo params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postaccepted, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsPost(params, f.authInfo) + postaccepted, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.CreateVPNConnectionOperationFailed, f.cloudInstanceID, err) } @@ -60,7 +60,7 @@ func (f *IBMPIVpnConnectionClient) Update(id string, body *models.VPNConnectionU WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id). WithBody(body) - putok, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsPut(params, f.authInfo) + putok, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.UpdateVPNConnectionOperationFailed, id, err) } @@ -75,7 +75,7 @@ func (f *IBMPIVpnConnectionClient) GetAll() (*models.VPNConnections, error) { params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsGetall(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get all VPN Connections: %w", err) } @@ -90,7 +90,7 @@ func (f *IBMPIVpnConnectionClient) Delete(id string) (*models.JobReference, erro params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id) - delaccepted, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsDelete(params, f.authInfo) + delaccepted, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf(errors.DeleteVPNConnectionOperationFailed, id, err) } @@ -101,11 +101,11 @@ func (f *IBMPIVpnConnectionClient) Delete(id string) (*models.JobReference, erro } // Network get -func (f *IBMPIVpnConnectionClient) GetNetwork(id string) (*models.NetworkIds, error) { +func (f *IBMPIVpnConnectionClient) GetNetwork(id string) (*models.NetworkIDs, error) { params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsNetworksGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsNetworksGet(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsNetworksGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get Networks for VPN Connection %s: %w", id, err) } @@ -121,7 +121,7 @@ func (f *IBMPIVpnConnectionClient) AddNetwork(id, networkID string) (*models.Job WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id). WithBody(&models.NetworkID{NetworkID: &networkID}) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsNetworksPut(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsNetworksPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Add Network %s to VPN Connection %s: %w", networkID, id, err) } @@ -137,7 +137,7 @@ func (f *IBMPIVpnConnectionClient) DeleteNetwork(id, networkID string) (*models. WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id). WithBody(&models.NetworkID{NetworkID: &networkID}) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsNetworksDelete(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsNetworksDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Delete Network %s from VPN Connection %s: %w", networkID, id, err) } @@ -152,7 +152,7 @@ func (f *IBMPIVpnConnectionClient) GetSubnet(id string) (*models.PeerSubnets, er params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsPeersubnetsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsPeersubnetsGet(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPeersubnetsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Get Subnets from VPN Connection %s: %w", id, err) } @@ -168,7 +168,7 @@ func (f *IBMPIVpnConnectionClient) AddSubnet(id, subnet string) (*models.PeerSub WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id). WithBody(&models.PeerSubnetUpdate{Cidr: &subnet}) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsPeersubnetsPut(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPeersubnetsPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Add Subnets to VPN Connection %s: %w", id, err) } @@ -184,7 +184,7 @@ func (f *IBMPIVpnConnectionClient) DeleteSubnet(id, subnet string) (*models.Peer WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithVpnConnectionID(id). WithBody(&models.PeerSubnetUpdate{Cidr: &subnet}) - resp, err := f.session.Power.PCloudVPNConnections.PcloudVpnconnectionsPeersubnetsDelete(params, f.authInfo) + resp, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPeersubnetsDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, fmt.Errorf("failed to Delete Subnet from VPN Connection %s: %w", id, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/helpers/env.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/helpers/env.go index 3b65d26bb4..ede87cc0c7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/helpers/env.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/helpers/env.go @@ -11,3 +11,8 @@ func EnvFallBack(envs []string, defaultValue string) string { } return defaultValue } + +// GetPowerEndPoint +func GetPowerEndPoint() string { + return EnvFallBack([]string{"IBMCLOUD_POWER_API_ENDPOINT"}, "") +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/ibmpowersession.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/ibmpowersession.go deleted file mode 100644 index 3d03ef6eec..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/ibmpowersession.go +++ /dev/null @@ -1,193 +0,0 @@ -/* -Code to call the IBM IAM Services and get a session object that will be used by the Power Colo Code. - - -*/ - -package ibmpisession - -import ( - "bytes" - "crypto/tls" - "encoding/json" - "fmt" - "io" - "log" - "net/http" - "strings" - - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/client" - "github.com/IBM-Cloud/power-go-client/power/models" - "github.com/IBM-Cloud/power-go-client/utils" - "github.com/IBM/go-sdk-core/v5/core" -) - -// IBMPISession ... -type IBMPISession struct { - IAMToken string - IMSToken string - Power *client.PowerIaas - UserAccount string - Region string - Zone string - Authenticator core.Authenticator -} - -// PIOptions -type PIOptions struct { - // Enable/Disable http transport debugging log - Debug bool - - // Account id of the Power Cloud Service Instance - // Required - UserAccount string - - // Region of the Power Cloud Service Instance - // Required - Region string - - // Zone of the Power Cloud Service Instance; Use Region if not set - Zone string - - // The authenticator used to configure the appropriate type of authentication - // Required - Authenticator core.Authenticator -} - -func powerJSONConsumer() runtime.Consumer { - return runtime.ConsumerFunc(func(reader io.Reader, data interface{}) error { - buf := new(bytes.Buffer) - _, err := buf.ReadFrom(reader) - if err != nil { - return err - } - b := buf.Bytes() - if b != nil { - dec := json.NewDecoder(bytes.NewReader(b)) - dec.UseNumber() // preserve number formats - err = dec.Decode(data) - } - if string(b) == "null" || err != nil { - errorRecord, _ := data.(*models.Error) - log.Printf("The errorrecord is %s ", errorRecord.Error) - return nil - } - return err - }) -} - -// Create a IBMPISession -func NewSession(options *PIOptions) (*IBMPISession, error) { - newSession := &IBMPISession{ - UserAccount: options.UserAccount, - Region: options.Region, - Zone: options.Zone, - Authenticator: options.Authenticator, - } - - session, err := process(newSession, options.Debug) - if err != nil { - return nil, err - } - - return session, nil -} - -// New ... -// - deprecated: New function can be used, but is slated to become `obsolete`, Instead try using NewSession function. -func New(iamtoken, region string, debug bool, useraccount string, zone string) (*IBMPISession, error) { - //fmt.Println("Warning - New function is slated to become `obsolete`, Instead try using NewSession function.") - session := &IBMPISession{ - IAMToken: iamtoken, - UserAccount: useraccount, - Region: region, - Zone: zone, - } - - session, err := process(session, debug) - if err != nil { - return nil, err - } - return session, nil -} - -// Assign appropriate PowerIaas client to the session after appropriate evaluation -func process(session *IBMPISession, debug bool) (*IBMPISession, error) { - http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: false} - apiEndpointURL := utils.GetPowerEndPoint(session.Region) - transport := httptransport.New(apiEndpointURL, "/", []string{"https"}) - if debug { - transport.Debug = debug - } - transport.SetLogger(IBMPILogger{}) - transport.Consumers[runtime.JSONMime] = powerJSONConsumer() - session.Power = client.New(transport, nil) - return session, nil -} - -// Fetch Authorization token -// Authenticate using Authenticator if set in the session -// Otherwise return IAMToken set in the session -func fetchAuthorizationData(s *IBMPISession) (string, error) { - var authdata = s.IAMToken - if s.Authenticator != nil { - req := &http.Request{ - Header: make(http.Header), - } - if err := s.Authenticator.Validate(); err != nil { - return "", err - } - if err := s.Authenticator.Authenticate(req); err != nil { - return "", err - } - authdata = req.Header.Get("Authorization") - } - return authdata, nil -} - -// NewAuth ... -func NewAuth(sess *IBMPISession, cloudInstanceID string) runtime.ClientAuthInfoWriter { - var crndata = crnBuilder(cloudInstanceID, sess.UserAccount, sess.Region, sess.Zone) - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - authdata, err := fetchAuthorizationData(sess) - if err != nil { - return err - } - if err := r.SetHeaderParam("Authorization", authdata); err != nil { - return err - } - return r.SetHeaderParam("CRN", crndata) - }) -} - -// BearerTokenAndCRN ... -func BearerTokenAndCRN(session *IBMPISession, crn string) runtime.ClientAuthInfoWriter { - return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - authdata, err := fetchAuthorizationData(session) - if err != nil { - return err - } - if err := r.SetHeaderParam("Authorization", authdata); err != nil { - return err - } - return r.SetHeaderParam("CRN", crn) - }) -} - -// crnBuilder ... -func crnBuilder(cloudInstanceID, useraccount, region, zone string) string { - var service string - if strings.Contains(utils.GetPowerEndPoint(region), ".power-iaas.cloud.ibm.com") { - service = "bluemix" - } else { - service = "staging" - } - if zone == "" { - zone = region - } - return fmt.Sprintf("crn:v1:%s:public:power-iaas:%s:a/%s:%s::", service, zone, useraccount, cloudInstanceID) -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go new file mode 100644 index 0000000000..c7e4020119 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go @@ -0,0 +1,121 @@ +package ibmpisession + +import ( + "fmt" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/power/client" + "github.com/IBM/go-sdk-core/v5/core" +) + +// IBMPISession ... +type IBMPISession struct { + CRNFormat string + Power *client.PowerIaasAPI + Options *IBMPIOptions +} + +// PIOptions +type IBMPIOptions struct { + // The authenticator implementation to be used by the + // service instance to authenticate outbound requests + // Required + Authenticator core.Authenticator + + // Enable/Disable http transport debugging log + Debug bool + + // Region of the Power Cloud Service Instance + // For generating the default endpoint + // Required when URL or env `IBMCLOUD_POWER_API_ENDPOINT` is not set + Region string + + // Power Virtual Server host or URL endpoint + // This will be used instead of generating the default host + // eg: dal.power-iaas.cloud.ibm.com + // Required when Region is not provided + URL string + + // Account id of the Power Cloud Service Instance + // It will be part of the CRN string + // Required + UserAccount string + + // Zone of the Power Cloud Service Instance + // It will be part of the CRN string + // Required + Zone string +} + +// Create a IBMPISession +func NewIBMPISession(o *IBMPIOptions) (*IBMPISession, error) { + if core.IsNil(o) { + return nil, fmt.Errorf("options is required") + } + + if core.IsNil(o.Authenticator) { + return nil, fmt.Errorf("option Authenticator is required") + } + + if o.UserAccount == "" { + return nil, fmt.Errorf("option UserAccount is required") + } + + if o.Zone == "" { + return nil, fmt.Errorf("option Zone is required") + } + + var serviceURL string + if o.URL != "" { + serviceURL = o.URL + } else { + // If URL is not set check in env + serviceURL = helpers.GetPowerEndPoint() + if serviceURL == "" { + // Generate default endpoint with Region + if o.Region != "" { + serviceURL = o.Region + ".power-iaas.cloud.ibm.com" + } else { + return nil, fmt.Errorf("atleast one of Region or URL is required") + } + } + } + + // We need just the server host from the URL + var host, scheme string + if strings.HasPrefix(serviceURL, "https://") { + scheme = SCHEME_HTTPS + host = strings.TrimPrefix(serviceURL, "https://") + } else if strings.HasPrefix(serviceURL, "http://") { + scheme = SCHEME_HTTP + host = strings.TrimPrefix(serviceURL, "http://") + } else { + // by default we use "https" + scheme = SCHEME_HTTPS + host = serviceURL + } + + return &IBMPISession{ + CRNFormat: crnBuilder(o.UserAccount, o.Zone, host), + Options: o, + Power: getPIClient(o.Debug, host, scheme), + }, nil +} + +// authInfo ... +func (s *IBMPISession) AuthInfo(cloudInstanceID string) runtime.ClientAuthInfoWriter { + return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { + auth, err := fetchAuthorizationData(s.Options.Authenticator) + if err != nil { + return err + } + if err := r.SetHeaderParam("Authorization", auth); err != nil { + return err + } + return r.SetHeaderParam("CRN", fmt.Sprintf(s.CRNFormat, cloudInstanceID)) + }) +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go new file mode 100644 index 0000000000..7e9bcb2df1 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go @@ -0,0 +1,74 @@ +package ibmpisession + +import ( + "bytes" + "crypto/tls" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/IBM-Cloud/power-go-client/power/client" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" +) + +const ( + SCHEME_HTTPS = "https" + SCHEME_HTTP = "http" +) + +// fetchAuthorizationData Fetch Authorization token using the Authenticator +func fetchAuthorizationData(a core.Authenticator) (string, error) { + req := &http.Request{ + Header: make(http.Header), + } + if err := a.Authenticate(req); err != nil { + return "", err + } + return req.Header.Get("Authorization"), nil +} + +// crnBuilder Return string format to create CRN using the cloud instance id +// The result string will have crn data with a string placeholder to set the cloud instance id +// Usage: +// `crn := fmt.Sprintf(crnBuilder(useraccount, regionZone, host), )` +func crnBuilder(useraccount, zone, host string) string { + var service string + if strings.Contains(host, ".power-iaas.cloud.ibm.com") { + service = "bluemix" + } else { + service = "staging" + } + crn := fmt.Sprintf("crn:v1:%s:public:power-iaas:%s:a/%s:", service, zone, useraccount) + return crn + "%s::" +} + +func powerJSONConsumer() runtime.Consumer { + return runtime.ConsumerFunc(func(reader io.Reader, data interface{}) error { + buf := new(bytes.Buffer) + _, err := buf.ReadFrom(reader) + if err != nil { + return err + } + b := buf.Bytes() + dec := json.NewDecoder(bytes.NewReader(b)) + dec.UseNumber() // preserve number formats + return dec.Decode(data) + }) +} + +// getPIClient generates a PowerIaas client +func getPIClient(debug bool, host string, scheme string) *client.PowerIaasAPI { + http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: false} + if scheme == "" { + scheme = SCHEME_HTTPS + } + transport := httptransport.New(host, "/", []string{scheme}) + transport.Debug = debug + transport.SetLogger(IBMPILogger{}) + transport.Consumers[runtime.JSONMime] = powerJSONConsumer() + return client.New(transport, nil) +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go index d55f6b5f5e..2e9c3f96bf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go @@ -6,13 +6,14 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new authentication API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,43 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthCallbackOK, error) + + ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDeviceCodePostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceCodePostOK, error) + + ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDeviceTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceTokenPostOK, error) + + ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoTokenOK, error) + + ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoUserOK, error) + + ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, opts ...ClientOption) (*ServiceBrokerAuthLoginOK, error) + + ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthLogoutOK, error) + + ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistrationParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationOK, error) + + ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuthRegistrationCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationCallbackOK, error) + + ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthTokenPostOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBrokerAuthCallback returns an access token and set cookie + ServiceBrokerAuthCallback returns an access token and set cookie */ -func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackParams) (*ServiceBrokerAuthCallbackOK, error) { +func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthCallbackOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthCallbackParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.callback", Method: "GET", PathPattern: "/auth/v1/callback", @@ -44,24 +72,34 @@ func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackPara Reader: &ServiceBrokerAuthCallbackReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthCallbackOK), nil - + success, ok := result.(*ServiceBrokerAuthCallbackOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.callback: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthDeviceCodePost requests a authorization device code + ServiceBrokerAuthDeviceCodePost requests a authorization device code */ -func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDeviceCodePostParams) (*ServiceBrokerAuthDeviceCodePostOK, error) { +func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDeviceCodePostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceCodePostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthDeviceCodePostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.device.code.post", Method: "POST", PathPattern: "/auth/v1/device/code", @@ -72,24 +110,34 @@ func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDevice Reader: &ServiceBrokerAuthDeviceCodePostReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthDeviceCodePostOK), nil - + success, ok := result.(*ServiceBrokerAuthDeviceCodePostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.device.code.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthDeviceTokenPost polls for authorization device token + ServiceBrokerAuthDeviceTokenPost polls for authorization device token */ -func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDeviceTokenPostParams) (*ServiceBrokerAuthDeviceTokenPostOK, error) { +func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDeviceTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceTokenPostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthDeviceTokenPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.device.token.post", Method: "POST", PathPattern: "/auth/v1/device/token", @@ -100,24 +148,34 @@ func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDevic Reader: &ServiceBrokerAuthDeviceTokenPostReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthDeviceTokenPostOK), nil - + success, ok := result.(*ServiceBrokerAuthDeviceTokenPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.device.token.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthInfoToken information about current access token + ServiceBrokerAuthInfoToken information about current access token */ -func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerAuthInfoTokenOK, error) { +func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoTokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthInfoTokenParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.info.token", Method: "GET", PathPattern: "/auth/v1/info/token", @@ -129,24 +187,34 @@ func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenPa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthInfoTokenOK), nil - + success, ok := result.(*ServiceBrokerAuthInfoTokenOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.info.token: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthInfoUser information about current user + ServiceBrokerAuthInfoUser information about current user */ -func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerAuthInfoUserOK, error) { +func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoUserOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthInfoUserParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.info.user", Method: "GET", PathPattern: "/auth/v1/info/user", @@ -158,24 +226,34 @@ func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthInfoUserOK), nil - + success, ok := result.(*ServiceBrokerAuthInfoUserOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.info.user: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthLogin logins + ServiceBrokerAuthLogin logins */ -func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams) (*ServiceBrokerAuthLoginOK, error) { +func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, opts ...ClientOption) (*ServiceBrokerAuthLoginOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthLoginParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.login", Method: "GET", PathPattern: "/auth/v1/login", @@ -186,24 +264,34 @@ func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams) (* Reader: &ServiceBrokerAuthLoginReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthLoginOK), nil - + success, ok := result.(*ServiceBrokerAuthLoginOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.login: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthLogout logouts + ServiceBrokerAuthLogout logouts */ -func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerAuthLogoutOK, error) { +func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthLogoutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthLogoutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.logout", Method: "GET", PathPattern: "/auth/v1/logout", @@ -215,24 +303,34 @@ func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthLogoutOK), nil - + success, ok := result.(*ServiceBrokerAuthLogoutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.logout: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthRegistration registrations of a new tenant and login + ServiceBrokerAuthRegistration registrations of a new tenant and login */ -func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistrationParams) (*ServiceBrokerAuthRegistrationOK, error) { +func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistrationParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthRegistrationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.registration", Method: "GET", PathPattern: "/auth/v1/registration", @@ -243,24 +341,34 @@ func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistra Reader: &ServiceBrokerAuthRegistrationReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthRegistrationOK), nil - + success, ok := result.(*ServiceBrokerAuthRegistrationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.registration: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthRegistrationCallback associates the user with a tenant and returns an access token + ServiceBrokerAuthRegistrationCallback associates the user with a tenant and returns an access token */ -func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuthRegistrationCallbackParams) (*ServiceBrokerAuthRegistrationCallbackOK, error) { +func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuthRegistrationCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationCallbackOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthRegistrationCallbackParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.registration.callback", Method: "GET", PathPattern: "/auth/v1/callback-registration", @@ -271,24 +379,34 @@ func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuth Reader: &ServiceBrokerAuthRegistrationCallbackReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthRegistrationCallbackOK), nil - + success, ok := result.(*ServiceBrokerAuthRegistrationCallbackOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.registration.callback: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerAuthTokenPost requests a new token from a refresh token + ServiceBrokerAuthTokenPost requests a new token from a refresh token */ -func (a *Client) ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostParams) (*ServiceBrokerAuthTokenPostOK, error) { +func (a *Client) ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthTokenPostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerAuthTokenPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.auth.token.post", Method: "POST", PathPattern: "/auth/v1/token", @@ -299,12 +417,23 @@ func (a *Client) ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostPa Reader: &ServiceBrokerAuthTokenPostReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerAuthTokenPostOK), nil - + success, ok := result.(*ServiceBrokerAuthTokenPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.token.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_parameters.go index 01246a8f5d..7c2aaa3c94 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthCallbackParams creates a new ServiceBrokerAuthCallbackParams object -// with the default values initialized. +// NewServiceBrokerAuthCallbackParams creates a new ServiceBrokerAuthCallbackParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthCallbackParams() *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthCallbackParamsWithTimeout creates a new ServiceBrokerAuthCallbackParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthCallbackParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - timeout: timeout, } } // NewServiceBrokerAuthCallbackParamsWithContext creates a new ServiceBrokerAuthCallbackParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthCallbackParamsWithContext(ctx context.Context) *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ - Context: ctx, } } // NewServiceBrokerAuthCallbackParamsWithHTTPClient creates a new ServiceBrokerAuthCallbackParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthCallbackParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthCallbackParams { - return &ServiceBrokerAuthCallbackParams{ HTTPClient: client, } } -/*ServiceBrokerAuthCallbackParams contains all the parameters to send to the API endpoint -for the service broker auth callback operation typically these are written to a http.Request +/* ServiceBrokerAuthCallbackParams contains all the parameters to send to the API endpoint + for the service broker auth callback operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthCallbackParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerAuthCallbackParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth callback params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthCallbackParams) WithDefaults() *ServiceBrokerAuthCallbackParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth callback params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthCallbackParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth callback params func (o *ServiceBrokerAuthCallbackParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthCallbackParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go index 5142d6352f..b48acc24a3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthCallbackReader is a Reader for the ServiceBrokerAuthCallback structure. @@ -24,30 +23,26 @@ type ServiceBrokerAuthCallbackReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthCallbackOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewServiceBrokerAuthCallbackUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthCallbackInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceBrokerAuthCallbackOK() *ServiceBrokerAuthCallbackOK { return &ServiceBrokerAuthCallbackOK{} } -/*ServiceBrokerAuthCallbackOK handles this case with default header values. +/* ServiceBrokerAuthCallbackOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceBrokerAuthCallbackOK struct { func (o *ServiceBrokerAuthCallbackOK) Error() string { return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthCallbackOK) GetPayload() *models.AccessToken { + return o.Payload +} func (o *ServiceBrokerAuthCallbackOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceBrokerAuthCallbackUnauthorized() *ServiceBrokerAuthCallbackUnauth return &ServiceBrokerAuthCallbackUnauthorized{} } -/*ServiceBrokerAuthCallbackUnauthorized handles this case with default header values. +/* ServiceBrokerAuthCallbackUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -96,6 +94,9 @@ type ServiceBrokerAuthCallbackUnauthorized struct { func (o *ServiceBrokerAuthCallbackUnauthorized) Error() string { return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %+v", 401, o.Payload) } +func (o *ServiceBrokerAuthCallbackUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthCallbackUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceBrokerAuthCallbackInternalServerError() *ServiceBrokerAuthCallbac return &ServiceBrokerAuthCallbackInternalServerError{} } -/*ServiceBrokerAuthCallbackInternalServerError handles this case with default header values. +/* ServiceBrokerAuthCallbackInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type ServiceBrokerAuthCallbackInternalServerError struct { func (o *ServiceBrokerAuthCallbackInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthCallbackInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthCallbackInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_parameters.go index e58444e88c..ad621b60a2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthDeviceCodePostParams creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the default values initialized. +// NewServiceBrokerAuthDeviceCodePostParams creates a new ServiceBrokerAuthDeviceCodePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthDeviceCodePostParams() *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthDeviceCodePostParamsWithTimeout creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthDeviceCodePostParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - timeout: timeout, } } // NewServiceBrokerAuthDeviceCodePostParamsWithContext creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthDeviceCodePostParamsWithContext(ctx context.Context) *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ - Context: ctx, } } // NewServiceBrokerAuthDeviceCodePostParamsWithHTTPClient creates a new ServiceBrokerAuthDeviceCodePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthDeviceCodePostParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthDeviceCodePostParams { - return &ServiceBrokerAuthDeviceCodePostParams{ HTTPClient: client, } } -/*ServiceBrokerAuthDeviceCodePostParams contains all the parameters to send to the API endpoint -for the service broker auth device code post operation typically these are written to a http.Request +/* ServiceBrokerAuthDeviceCodePostParams contains all the parameters to send to the API endpoint + for the service broker auth device code post operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthDeviceCodePostParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerAuthDeviceCodePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth device code post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthDeviceCodePostParams) WithDefaults() *ServiceBrokerAuthDeviceCodePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth device code post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthDeviceCodePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth device code post params func (o *ServiceBrokerAuthDeviceCodePostParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceCodePostParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go index b16dc9de93..b0d31f0b39 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthDeviceCodePostReader is a Reader for the ServiceBrokerAuthDeviceCodePost structure. @@ -24,30 +23,26 @@ type ServiceBrokerAuthDeviceCodePostReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthDeviceCodePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthDeviceCodePostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 403: result := NewServiceBrokerAuthDeviceCodePostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthDeviceCodePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceBrokerAuthDeviceCodePostOK() *ServiceBrokerAuthDeviceCodePostOK { return &ServiceBrokerAuthDeviceCodePostOK{} } -/*ServiceBrokerAuthDeviceCodePostOK handles this case with default header values. +/* ServiceBrokerAuthDeviceCodePostOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceBrokerAuthDeviceCodePostOK struct { func (o *ServiceBrokerAuthDeviceCodePostOK) Error() string { return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthDeviceCodePostOK) GetPayload() *models.DeviceCode { + return o.Payload +} func (o *ServiceBrokerAuthDeviceCodePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceBrokerAuthDeviceCodePostForbidden() *ServiceBrokerAuthDeviceCodeP return &ServiceBrokerAuthDeviceCodePostForbidden{} } -/*ServiceBrokerAuthDeviceCodePostForbidden handles this case with default header values. +/* ServiceBrokerAuthDeviceCodePostForbidden describes a response with status code 403, with default header values. Quota exceeded */ @@ -96,6 +94,9 @@ type ServiceBrokerAuthDeviceCodePostForbidden struct { func (o *ServiceBrokerAuthDeviceCodePostForbidden) Error() string { return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %+v", 403, o.Payload) } +func (o *ServiceBrokerAuthDeviceCodePostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthDeviceCodePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceBrokerAuthDeviceCodePostInternalServerError() *ServiceBrokerAuthD return &ServiceBrokerAuthDeviceCodePostInternalServerError{} } -/*ServiceBrokerAuthDeviceCodePostInternalServerError handles this case with default header values. +/* ServiceBrokerAuthDeviceCodePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type ServiceBrokerAuthDeviceCodePostInternalServerError struct { func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) Error() string { return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_parameters.go index c8dce41e67..ab928c9a22 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthDeviceTokenPostParams creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the default values initialized. +// NewServiceBrokerAuthDeviceTokenPostParams creates a new ServiceBrokerAuthDeviceTokenPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthDeviceTokenPostParams() *ServiceBrokerAuthDeviceTokenPostParams { - var () return &ServiceBrokerAuthDeviceTokenPostParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthDeviceTokenPostParamsWithTimeout creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthDeviceTokenPostParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceTokenPostParams { - var () return &ServiceBrokerAuthDeviceTokenPostParams{ - timeout: timeout, } } // NewServiceBrokerAuthDeviceTokenPostParamsWithContext creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthDeviceTokenPostParamsWithContext(ctx context.Context) *ServiceBrokerAuthDeviceTokenPostParams { - var () return &ServiceBrokerAuthDeviceTokenPostParams{ - Context: ctx, } } // NewServiceBrokerAuthDeviceTokenPostParamsWithHTTPClient creates a new ServiceBrokerAuthDeviceTokenPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthDeviceTokenPostParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthDeviceTokenPostParams { - var () return &ServiceBrokerAuthDeviceTokenPostParams{ HTTPClient: client, } } -/*ServiceBrokerAuthDeviceTokenPostParams contains all the parameters to send to the API endpoint -for the service broker auth device token post operation typically these are written to a http.Request +/* ServiceBrokerAuthDeviceTokenPostParams contains all the parameters to send to the API endpoint + for the service broker auth device token post operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthDeviceTokenPostParams struct { - /*Body - Parameters for polling authorization device code + /* Body. + Parameters for polling authorization device code */ Body ServiceBrokerAuthDeviceTokenPostBody @@ -72,6 +70,21 @@ type ServiceBrokerAuthDeviceTokenPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth device token post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthDeviceTokenPostParams) WithDefaults() *ServiceBrokerAuthDeviceTokenPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth device token post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthDeviceTokenPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth device token post params func (o *ServiceBrokerAuthDeviceTokenPostParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthDeviceTokenPostParams { o.SetTimeout(timeout) @@ -123,7 +136,6 @@ func (o *ServiceBrokerAuthDeviceTokenPostParams) WriteToRequest(r runtime.Client return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go index 72c28f8be7..f9579f5c6c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go @@ -6,15 +6,15 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthDeviceTokenPostReader is a Reader for the ServiceBrokerAuthDeviceTokenPost structure. @@ -25,44 +25,38 @@ type ServiceBrokerAuthDeviceTokenPostReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthDeviceTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthDeviceTokenPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerAuthDeviceTokenPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewServiceBrokerAuthDeviceTokenPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 429: result := NewServiceBrokerAuthDeviceTokenPostTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthDeviceTokenPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -71,7 +65,7 @@ func NewServiceBrokerAuthDeviceTokenPostOK() *ServiceBrokerAuthDeviceTokenPostOK return &ServiceBrokerAuthDeviceTokenPostOK{} } -/*ServiceBrokerAuthDeviceTokenPostOK handles this case with default header values. +/* ServiceBrokerAuthDeviceTokenPostOK describes a response with status code 200, with default header values. OK */ @@ -82,6 +76,9 @@ type ServiceBrokerAuthDeviceTokenPostOK struct { func (o *ServiceBrokerAuthDeviceTokenPostOK) Error() string { return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthDeviceTokenPostOK) GetPayload() *models.Token { + return o.Payload +} func (o *ServiceBrokerAuthDeviceTokenPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -100,7 +97,7 @@ func NewServiceBrokerAuthDeviceTokenPostBadRequest() *ServiceBrokerAuthDeviceTok return &ServiceBrokerAuthDeviceTokenPostBadRequest{} } -/*ServiceBrokerAuthDeviceTokenPostBadRequest handles this case with default header values. +/* ServiceBrokerAuthDeviceTokenPostBadRequest describes a response with status code 400, with default header values. Authorization pending */ @@ -111,6 +108,9 @@ type ServiceBrokerAuthDeviceTokenPostBadRequest struct { func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) Error() string { return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -129,7 +129,7 @@ func NewServiceBrokerAuthDeviceTokenPostForbidden() *ServiceBrokerAuthDeviceToke return &ServiceBrokerAuthDeviceTokenPostForbidden{} } -/*ServiceBrokerAuthDeviceTokenPostForbidden handles this case with default header values. +/* ServiceBrokerAuthDeviceTokenPostForbidden describes a response with status code 403, with default header values. User refused grant */ @@ -140,6 +140,9 @@ type ServiceBrokerAuthDeviceTokenPostForbidden struct { func (o *ServiceBrokerAuthDeviceTokenPostForbidden) Error() string { return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %+v", 403, o.Payload) } +func (o *ServiceBrokerAuthDeviceTokenPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthDeviceTokenPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -158,7 +161,7 @@ func NewServiceBrokerAuthDeviceTokenPostTooManyRequests() *ServiceBrokerAuthDevi return &ServiceBrokerAuthDeviceTokenPostTooManyRequests{} } -/*ServiceBrokerAuthDeviceTokenPostTooManyRequests handles this case with default header values. +/* ServiceBrokerAuthDeviceTokenPostTooManyRequests describes a response with status code 429, with default header values. Polling too frequently */ @@ -169,6 +172,9 @@ type ServiceBrokerAuthDeviceTokenPostTooManyRequests struct { func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) Error() string { return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %+v", 429, o.Payload) } +func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -187,7 +193,7 @@ func NewServiceBrokerAuthDeviceTokenPostInternalServerError() *ServiceBrokerAuth return &ServiceBrokerAuthDeviceTokenPostInternalServerError{} } -/*ServiceBrokerAuthDeviceTokenPostInternalServerError handles this case with default header values. +/* ServiceBrokerAuthDeviceTokenPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -198,6 +204,9 @@ type ServiceBrokerAuthDeviceTokenPostInternalServerError struct { func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) Error() string { return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -225,6 +234,11 @@ func (o *ServiceBrokerAuthDeviceTokenPostBody) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this service broker auth device token post body based on context it is used +func (o *ServiceBrokerAuthDeviceTokenPostBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ServiceBrokerAuthDeviceTokenPostBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_parameters.go index 95609b0f2a..8bd091b80a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthInfoTokenParams creates a new ServiceBrokerAuthInfoTokenParams object -// with the default values initialized. +// NewServiceBrokerAuthInfoTokenParams creates a new ServiceBrokerAuthInfoTokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthInfoTokenParams() *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthInfoTokenParamsWithTimeout creates a new ServiceBrokerAuthInfoTokenParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthInfoTokenParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - timeout: timeout, } } // NewServiceBrokerAuthInfoTokenParamsWithContext creates a new ServiceBrokerAuthInfoTokenParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthInfoTokenParamsWithContext(ctx context.Context) *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ - Context: ctx, } } // NewServiceBrokerAuthInfoTokenParamsWithHTTPClient creates a new ServiceBrokerAuthInfoTokenParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthInfoTokenParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthInfoTokenParams { - return &ServiceBrokerAuthInfoTokenParams{ HTTPClient: client, } } -/*ServiceBrokerAuthInfoTokenParams contains all the parameters to send to the API endpoint -for the service broker auth info token operation typically these are written to a http.Request +/* ServiceBrokerAuthInfoTokenParams contains all the parameters to send to the API endpoint + for the service broker auth info token operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthInfoTokenParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerAuthInfoTokenParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth info token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthInfoTokenParams) WithDefaults() *ServiceBrokerAuthInfoTokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth info token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthInfoTokenParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth info token params func (o *ServiceBrokerAuthInfoTokenParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoTokenParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go index 0846f83f19..5c38010ddb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthInfoTokenReader is a Reader for the ServiceBrokerAuthInfoToken structure. @@ -24,23 +23,20 @@ type ServiceBrokerAuthInfoTokenReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthInfoTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthInfoTokenOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 500: result := NewServiceBrokerAuthInfoTokenInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerAuthInfoTokenOK() *ServiceBrokerAuthInfoTokenOK { return &ServiceBrokerAuthInfoTokenOK{} } -/*ServiceBrokerAuthInfoTokenOK handles this case with default header values. +/* ServiceBrokerAuthInfoTokenOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerAuthInfoTokenOK struct { func (o *ServiceBrokerAuthInfoTokenOK) Error() string { return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthInfoTokenOK) GetPayload() *models.TokenExtra { + return o.Payload +} func (o *ServiceBrokerAuthInfoTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceBrokerAuthInfoTokenInternalServerError() *ServiceBrokerAuthInfoTo return &ServiceBrokerAuthInfoTokenInternalServerError{} } -/*ServiceBrokerAuthInfoTokenInternalServerError handles this case with default header values. +/* ServiceBrokerAuthInfoTokenInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -89,6 +88,9 @@ type ServiceBrokerAuthInfoTokenInternalServerError struct { func (o *ServiceBrokerAuthInfoTokenInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthInfoTokenInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthInfoTokenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_parameters.go index 166a37bacb..400cfced99 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthInfoUserParams creates a new ServiceBrokerAuthInfoUserParams object -// with the default values initialized. +// NewServiceBrokerAuthInfoUserParams creates a new ServiceBrokerAuthInfoUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthInfoUserParams() *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthInfoUserParamsWithTimeout creates a new ServiceBrokerAuthInfoUserParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthInfoUserParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - timeout: timeout, } } // NewServiceBrokerAuthInfoUserParamsWithContext creates a new ServiceBrokerAuthInfoUserParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthInfoUserParamsWithContext(ctx context.Context) *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ - Context: ctx, } } // NewServiceBrokerAuthInfoUserParamsWithHTTPClient creates a new ServiceBrokerAuthInfoUserParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthInfoUserParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthInfoUserParams { - return &ServiceBrokerAuthInfoUserParams{ HTTPClient: client, } } -/*ServiceBrokerAuthInfoUserParams contains all the parameters to send to the API endpoint -for the service broker auth info user operation typically these are written to a http.Request +/* ServiceBrokerAuthInfoUserParams contains all the parameters to send to the API endpoint + for the service broker auth info user operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthInfoUserParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerAuthInfoUserParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth info user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthInfoUserParams) WithDefaults() *ServiceBrokerAuthInfoUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth info user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthInfoUserParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth info user params func (o *ServiceBrokerAuthInfoUserParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthInfoUserParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go index 2e474c2a29..c8a412dff7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthInfoUserReader is a Reader for the ServiceBrokerAuthInfoUser structure. @@ -24,23 +23,20 @@ type ServiceBrokerAuthInfoUserReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthInfoUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthInfoUserOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 500: result := NewServiceBrokerAuthInfoUserInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerAuthInfoUserOK() *ServiceBrokerAuthInfoUserOK { return &ServiceBrokerAuthInfoUserOK{} } -/*ServiceBrokerAuthInfoUserOK handles this case with default header values. +/* ServiceBrokerAuthInfoUserOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerAuthInfoUserOK struct { func (o *ServiceBrokerAuthInfoUserOK) Error() string { return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthInfoUserOK) GetPayload() *models.UserInfo { + return o.Payload +} func (o *ServiceBrokerAuthInfoUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceBrokerAuthInfoUserInternalServerError() *ServiceBrokerAuthInfoUse return &ServiceBrokerAuthInfoUserInternalServerError{} } -/*ServiceBrokerAuthInfoUserInternalServerError handles this case with default header values. +/* ServiceBrokerAuthInfoUserInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -89,6 +88,9 @@ type ServiceBrokerAuthInfoUserInternalServerError struct { func (o *ServiceBrokerAuthInfoUserInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthInfoUserInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthInfoUserInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_parameters.go index ee6f6cc20a..821c5a0419 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_parameters.go @@ -13,79 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthLoginParams creates a new ServiceBrokerAuthLoginParams object -// with the default values initialized. +// NewServiceBrokerAuthLoginParams creates a new ServiceBrokerAuthLoginParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthLoginParams() *ServiceBrokerAuthLoginParams { - var ( - accessTypeDefault = string("online") - ) return &ServiceBrokerAuthLoginParams{ - AccessType: &accessTypeDefault, - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthLoginParamsWithTimeout creates a new ServiceBrokerAuthLoginParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthLoginParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthLoginParams { - var ( - accessTypeDefault = string("online") - ) return &ServiceBrokerAuthLoginParams{ - AccessType: &accessTypeDefault, - timeout: timeout, } } // NewServiceBrokerAuthLoginParamsWithContext creates a new ServiceBrokerAuthLoginParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthLoginParamsWithContext(ctx context.Context) *ServiceBrokerAuthLoginParams { - var ( - accessTypeDefault = string("online") - ) return &ServiceBrokerAuthLoginParams{ - AccessType: &accessTypeDefault, - Context: ctx, } } // NewServiceBrokerAuthLoginParamsWithHTTPClient creates a new ServiceBrokerAuthLoginParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthLoginParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthLoginParams { - var ( - accessTypeDefault = string("online") - ) return &ServiceBrokerAuthLoginParams{ - AccessType: &accessTypeDefault, HTTPClient: client, } } -/*ServiceBrokerAuthLoginParams contains all the parameters to send to the API endpoint -for the service broker auth login operation typically these are written to a http.Request +/* ServiceBrokerAuthLoginParams contains all the parameters to send to the API endpoint + for the service broker auth login operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthLoginParams struct { - /*AccessType - Determines if a refresh token is returned + /* AccessType. + Determines if a refresh token is returned + + Default: "online" */ AccessType *string - /*RedirectURL - The URL to redirect to after login/registration + /* RedirectURL. + + The URL to redirect to after login/registration */ RedirectURL *string - /*UserID - The user id of the user + /* UserID. + + The user id of the user */ UserID *string @@ -94,6 +84,32 @@ type ServiceBrokerAuthLoginParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth login params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthLoginParams) WithDefaults() *ServiceBrokerAuthLoginParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth login params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthLoginParams) SetDefaults() { + var ( + accessTypeDefault = string("online") + ) + + val := ServiceBrokerAuthLoginParams{ + AccessType: &accessTypeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the service broker auth login params func (o *ServiceBrokerAuthLoginParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthLoginParams { o.SetTimeout(timeout) @@ -172,48 +188,51 @@ func (o *ServiceBrokerAuthLoginParams) WriteToRequest(r runtime.ClientRequest, r // query param access_type var qrAccessType string + if o.AccessType != nil { qrAccessType = *o.AccessType } qAccessType := qrAccessType if qAccessType != "" { + if err := r.SetQueryParam("access_type", qAccessType); err != nil { return err } } - } if o.RedirectURL != nil { // query param redirect_url var qrRedirectURL string + if o.RedirectURL != nil { qrRedirectURL = *o.RedirectURL } qRedirectURL := qrRedirectURL if qRedirectURL != "" { + if err := r.SetQueryParam("redirect_url", qRedirectURL); err != nil { return err } } - } if o.UserID != nil { // query param user_id var qrUserID string + if o.UserID != nil { qrUserID = *o.UserID } qUserID := qrUserID if qUserID != "" { + if err := r.SetQueryParam("user_id", qUserID); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go index cd304ee0e7..0372c622fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthLoginReader is a Reader for the ServiceBrokerAuthLogin structure. @@ -24,30 +23,26 @@ type ServiceBrokerAuthLoginReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthLoginReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthLoginOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewServiceBrokerAuthLoginUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthLoginInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceBrokerAuthLoginOK() *ServiceBrokerAuthLoginOK { return &ServiceBrokerAuthLoginOK{} } -/*ServiceBrokerAuthLoginOK handles this case with default header values. +/* ServiceBrokerAuthLoginOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceBrokerAuthLoginOK struct { func (o *ServiceBrokerAuthLoginOK) Error() string { return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthLoginOK) GetPayload() *models.AccessToken { + return o.Payload +} func (o *ServiceBrokerAuthLoginOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceBrokerAuthLoginUnauthorized() *ServiceBrokerAuthLoginUnauthorized return &ServiceBrokerAuthLoginUnauthorized{} } -/*ServiceBrokerAuthLoginUnauthorized handles this case with default header values. +/* ServiceBrokerAuthLoginUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -96,6 +94,9 @@ type ServiceBrokerAuthLoginUnauthorized struct { func (o *ServiceBrokerAuthLoginUnauthorized) Error() string { return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %+v", 401, o.Payload) } +func (o *ServiceBrokerAuthLoginUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthLoginUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceBrokerAuthLoginInternalServerError() *ServiceBrokerAuthLoginInter return &ServiceBrokerAuthLoginInternalServerError{} } -/*ServiceBrokerAuthLoginInternalServerError handles this case with default header values. +/* ServiceBrokerAuthLoginInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type ServiceBrokerAuthLoginInternalServerError struct { func (o *ServiceBrokerAuthLoginInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthLoginInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthLoginInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_parameters.go index b3af618851..dd227cda39 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthLogoutParams creates a new ServiceBrokerAuthLogoutParams object -// with the default values initialized. +// NewServiceBrokerAuthLogoutParams creates a new ServiceBrokerAuthLogoutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthLogoutParams() *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthLogoutParamsWithTimeout creates a new ServiceBrokerAuthLogoutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthLogoutParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - timeout: timeout, } } // NewServiceBrokerAuthLogoutParamsWithContext creates a new ServiceBrokerAuthLogoutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthLogoutParamsWithContext(ctx context.Context) *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ - Context: ctx, } } // NewServiceBrokerAuthLogoutParamsWithHTTPClient creates a new ServiceBrokerAuthLogoutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthLogoutParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthLogoutParams { - return &ServiceBrokerAuthLogoutParams{ HTTPClient: client, } } -/*ServiceBrokerAuthLogoutParams contains all the parameters to send to the API endpoint -for the service broker auth logout operation typically these are written to a http.Request +/* ServiceBrokerAuthLogoutParams contains all the parameters to send to the API endpoint + for the service broker auth logout operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthLogoutParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerAuthLogoutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth logout params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthLogoutParams) WithDefaults() *ServiceBrokerAuthLogoutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth logout params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthLogoutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth logout params func (o *ServiceBrokerAuthLogoutParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthLogoutParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go index 819f363d38..6907da0111 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthLogoutReader is a Reader for the ServiceBrokerAuthLogout structure. @@ -24,23 +23,20 @@ type ServiceBrokerAuthLogoutReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthLogoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthLogoutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 500: result := NewServiceBrokerAuthLogoutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerAuthLogoutOK() *ServiceBrokerAuthLogoutOK { return &ServiceBrokerAuthLogoutOK{} } -/*ServiceBrokerAuthLogoutOK handles this case with default header values. +/* ServiceBrokerAuthLogoutOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerAuthLogoutOK struct { func (o *ServiceBrokerAuthLogoutOK) Error() string { return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthLogoutOK) GetPayload() models.Object { + return o.Payload +} func (o *ServiceBrokerAuthLogoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -76,7 +75,7 @@ func NewServiceBrokerAuthLogoutInternalServerError() *ServiceBrokerAuthLogoutInt return &ServiceBrokerAuthLogoutInternalServerError{} } -/*ServiceBrokerAuthLogoutInternalServerError handles this case with default header values. +/* ServiceBrokerAuthLogoutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -87,6 +86,9 @@ type ServiceBrokerAuthLogoutInternalServerError struct { func (o *ServiceBrokerAuthLogoutInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthLogoutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthLogoutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_parameters.go index f741a44bd0..0aceb5313b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthRegistrationCallbackParams creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the default values initialized. +// NewServiceBrokerAuthRegistrationCallbackParams creates a new ServiceBrokerAuthRegistrationCallbackParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthRegistrationCallbackParams() *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthRegistrationCallbackParamsWithTimeout creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthRegistrationCallbackParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - timeout: timeout, } } // NewServiceBrokerAuthRegistrationCallbackParamsWithContext creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthRegistrationCallbackParamsWithContext(ctx context.Context) *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ - Context: ctx, } } // NewServiceBrokerAuthRegistrationCallbackParamsWithHTTPClient creates a new ServiceBrokerAuthRegistrationCallbackParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthRegistrationCallbackParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthRegistrationCallbackParams { - return &ServiceBrokerAuthRegistrationCallbackParams{ HTTPClient: client, } } -/*ServiceBrokerAuthRegistrationCallbackParams contains all the parameters to send to the API endpoint -for the service broker auth registration callback operation typically these are written to a http.Request +/* ServiceBrokerAuthRegistrationCallbackParams contains all the parameters to send to the API endpoint + for the service broker auth registration callback operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthRegistrationCallbackParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerAuthRegistrationCallbackParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth registration callback params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthRegistrationCallbackParams) WithDefaults() *ServiceBrokerAuthRegistrationCallbackParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth registration callback params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthRegistrationCallbackParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth registration callback params func (o *ServiceBrokerAuthRegistrationCallbackParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationCallbackParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go index 5c08aab157..bc09a80543 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthRegistrationCallbackReader is a Reader for the ServiceBrokerAuthRegistrationCallback structure. @@ -24,30 +23,26 @@ type ServiceBrokerAuthRegistrationCallbackReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthRegistrationCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthRegistrationCallbackOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewServiceBrokerAuthRegistrationCallbackUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthRegistrationCallbackInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceBrokerAuthRegistrationCallbackOK() *ServiceBrokerAuthRegistration return &ServiceBrokerAuthRegistrationCallbackOK{} } -/*ServiceBrokerAuthRegistrationCallbackOK handles this case with default header values. +/* ServiceBrokerAuthRegistrationCallbackOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceBrokerAuthRegistrationCallbackOK struct { func (o *ServiceBrokerAuthRegistrationCallbackOK) Error() string { return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthRegistrationCallbackOK) GetPayload() *models.AccessToken { + return o.Payload +} func (o *ServiceBrokerAuthRegistrationCallbackOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceBrokerAuthRegistrationCallbackUnauthorized() *ServiceBrokerAuthRe return &ServiceBrokerAuthRegistrationCallbackUnauthorized{} } -/*ServiceBrokerAuthRegistrationCallbackUnauthorized handles this case with default header values. +/* ServiceBrokerAuthRegistrationCallbackUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -96,6 +94,9 @@ type ServiceBrokerAuthRegistrationCallbackUnauthorized struct { func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) Error() string { return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %+v", 401, o.Payload) } +func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceBrokerAuthRegistrationCallbackInternalServerError() *ServiceBroke return &ServiceBrokerAuthRegistrationCallbackInternalServerError{} } -/*ServiceBrokerAuthRegistrationCallbackInternalServerError handles this case with default header values. +/* ServiceBrokerAuthRegistrationCallbackInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type ServiceBrokerAuthRegistrationCallbackInternalServerError struct { func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_parameters.go index dfacdda948..3a49c00a2e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_parameters.go @@ -13,83 +13,86 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewServiceBrokerAuthRegistrationParams creates a new ServiceBrokerAuthRegistrationParams object -// with the default values initialized. +// NewServiceBrokerAuthRegistrationParams creates a new ServiceBrokerAuthRegistrationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthRegistrationParams() *ServiceBrokerAuthRegistrationParams { - var () return &ServiceBrokerAuthRegistrationParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthRegistrationParamsWithTimeout creates a new ServiceBrokerAuthRegistrationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthRegistrationParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationParams { - var () return &ServiceBrokerAuthRegistrationParams{ - timeout: timeout, } } // NewServiceBrokerAuthRegistrationParamsWithContext creates a new ServiceBrokerAuthRegistrationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthRegistrationParamsWithContext(ctx context.Context) *ServiceBrokerAuthRegistrationParams { - var () return &ServiceBrokerAuthRegistrationParams{ - Context: ctx, } } // NewServiceBrokerAuthRegistrationParamsWithHTTPClient creates a new ServiceBrokerAuthRegistrationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthRegistrationParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthRegistrationParams { - var () return &ServiceBrokerAuthRegistrationParams{ HTTPClient: client, } } -/*ServiceBrokerAuthRegistrationParams contains all the parameters to send to the API endpoint -for the service broker auth registration operation typically these are written to a http.Request +/* ServiceBrokerAuthRegistrationParams contains all the parameters to send to the API endpoint + for the service broker auth registration operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthRegistrationParams struct { - /*EntitlementID - Entitlement ID of for this tenant + /* EntitlementID. + Entitlement ID of for this tenant */ EntitlementID string - /*Icn - IBM Customer Number (ICN) for this tenant + /* Icn. + + IBM Customer Number (ICN) for this tenant */ Icn string - /*Plan - Plan for this tenant and entitlement + /* Plan. + + Plan for this tenant and entitlement */ Plan string - /*RedirectURL - The URL to redirect to after login/registration + /* RedirectURL. + + The URL to redirect to after login/registration */ RedirectURL *string - /*Regions - An array of regions matching the number of cloud-instances in the plan + /* Regions. + + An array of regions matching the number of cloud-instances in the plan */ Regions []string - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + + Tenant ID of a pcloud tenant */ TenantID string @@ -98,6 +101,21 @@ type ServiceBrokerAuthRegistrationParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth registration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthRegistrationParams) WithDefaults() *ServiceBrokerAuthRegistrationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth registration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthRegistrationParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth registration params func (o *ServiceBrokerAuthRegistrationParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthRegistrationParams { o.SetTimeout(timeout) @@ -209,6 +227,7 @@ func (o *ServiceBrokerAuthRegistrationParams) WriteToRequest(r runtime.ClientReq qrEntitlementID := o.EntitlementID qEntitlementID := qrEntitlementID if qEntitlementID != "" { + if err := r.SetQueryParam("entitlement_id", qEntitlementID); err != nil { return err } @@ -218,6 +237,7 @@ func (o *ServiceBrokerAuthRegistrationParams) WriteToRequest(r runtime.ClientReq qrIcn := o.Icn qIcn := qrIcn if qIcn != "" { + if err := r.SetQueryParam("icn", qIcn); err != nil { return err } @@ -227,6 +247,7 @@ func (o *ServiceBrokerAuthRegistrationParams) WriteToRequest(r runtime.ClientReq qrPlan := o.Plan qPlan := qrPlan if qPlan != "" { + if err := r.SetQueryParam("plan", qPlan); err != nil { return err } @@ -236,30 +257,35 @@ func (o *ServiceBrokerAuthRegistrationParams) WriteToRequest(r runtime.ClientReq // query param redirect_url var qrRedirectURL string + if o.RedirectURL != nil { qrRedirectURL = *o.RedirectURL } qRedirectURL := qrRedirectURL if qRedirectURL != "" { + if err := r.SetQueryParam("redirect_url", qRedirectURL); err != nil { return err } } - } - valuesRegions := o.Regions + if o.Regions != nil { - joinedRegions := swag.JoinByFormat(valuesRegions, "") - // query array param regions - if err := r.SetQueryParam("regions", joinedRegions...); err != nil { - return err + // binding items for regions + joinedRegions := o.bindParamRegions(reg) + + // query array param regions + if err := r.SetQueryParam("regions", joinedRegions...); err != nil { + return err + } } // query param tenant_id qrTenantID := o.TenantID qTenantID := qrTenantID if qTenantID != "" { + if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { return err } @@ -270,3 +296,20 @@ func (o *ServiceBrokerAuthRegistrationParams) WriteToRequest(r runtime.ClientReq } return nil } + +// bindParamServiceBrokerAuthRegistration binds the parameter regions +func (o *ServiceBrokerAuthRegistrationParams) bindParamRegions(formats strfmt.Registry) []string { + regionsIR := o.Regions + + var regionsIC []string + for _, regionsIIR := range regionsIR { // explode []string + + regionsIIV := regionsIIR // string as string + regionsIC = append(regionsIC, regionsIIV) + } + + // items.CollectionFormat: "" + regionsIS := swag.JoinByFormat(regionsIC, "") + + return regionsIS +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go index ab0ea71212..7ccbe10af1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthRegistrationReader is a Reader for the ServiceBrokerAuthRegistration structure. @@ -24,30 +23,26 @@ type ServiceBrokerAuthRegistrationReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthRegistrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthRegistrationOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewServiceBrokerAuthRegistrationUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthRegistrationInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceBrokerAuthRegistrationOK() *ServiceBrokerAuthRegistrationOK { return &ServiceBrokerAuthRegistrationOK{} } -/*ServiceBrokerAuthRegistrationOK handles this case with default header values. +/* ServiceBrokerAuthRegistrationOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceBrokerAuthRegistrationOK struct { func (o *ServiceBrokerAuthRegistrationOK) Error() string { return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthRegistrationOK) GetPayload() *models.AccessToken { + return o.Payload +} func (o *ServiceBrokerAuthRegistrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceBrokerAuthRegistrationUnauthorized() *ServiceBrokerAuthRegistrati return &ServiceBrokerAuthRegistrationUnauthorized{} } -/*ServiceBrokerAuthRegistrationUnauthorized handles this case with default header values. +/* ServiceBrokerAuthRegistrationUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -96,6 +94,9 @@ type ServiceBrokerAuthRegistrationUnauthorized struct { func (o *ServiceBrokerAuthRegistrationUnauthorized) Error() string { return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %+v", 401, o.Payload) } +func (o *ServiceBrokerAuthRegistrationUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthRegistrationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceBrokerAuthRegistrationInternalServerError() *ServiceBrokerAuthReg return &ServiceBrokerAuthRegistrationInternalServerError{} } -/*ServiceBrokerAuthRegistrationInternalServerError handles this case with default header values. +/* ServiceBrokerAuthRegistrationInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type ServiceBrokerAuthRegistrationInternalServerError struct { func (o *ServiceBrokerAuthRegistrationInternalServerError) Error() string { return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthRegistrationInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthRegistrationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_parameters.go index 00a99209bd..7c77f5ac72 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_parameters.go @@ -13,59 +13,57 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewServiceBrokerAuthTokenPostParams creates a new ServiceBrokerAuthTokenPostParams object -// with the default values initialized. +// NewServiceBrokerAuthTokenPostParams creates a new ServiceBrokerAuthTokenPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerAuthTokenPostParams() *ServiceBrokerAuthTokenPostParams { - var () return &ServiceBrokerAuthTokenPostParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerAuthTokenPostParamsWithTimeout creates a new ServiceBrokerAuthTokenPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerAuthTokenPostParamsWithTimeout(timeout time.Duration) *ServiceBrokerAuthTokenPostParams { - var () return &ServiceBrokerAuthTokenPostParams{ - timeout: timeout, } } // NewServiceBrokerAuthTokenPostParamsWithContext creates a new ServiceBrokerAuthTokenPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerAuthTokenPostParamsWithContext(ctx context.Context) *ServiceBrokerAuthTokenPostParams { - var () return &ServiceBrokerAuthTokenPostParams{ - Context: ctx, } } // NewServiceBrokerAuthTokenPostParamsWithHTTPClient creates a new ServiceBrokerAuthTokenPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerAuthTokenPostParamsWithHTTPClient(client *http.Client) *ServiceBrokerAuthTokenPostParams { - var () return &ServiceBrokerAuthTokenPostParams{ HTTPClient: client, } } -/*ServiceBrokerAuthTokenPostParams contains all the parameters to send to the API endpoint -for the service broker auth token post operation typically these are written to a http.Request +/* ServiceBrokerAuthTokenPostParams contains all the parameters to send to the API endpoint + for the service broker auth token post operation. + + Typically these are written to a http.Request. */ type ServiceBrokerAuthTokenPostParams struct { - /*Body - Parameters for requesting a new Token from a Refresh Token + /* Body. + Parameters for requesting a new Token from a Refresh Token */ Body *models.TokenRequest @@ -74,6 +72,21 @@ type ServiceBrokerAuthTokenPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker auth token post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthTokenPostParams) WithDefaults() *ServiceBrokerAuthTokenPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker auth token post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerAuthTokenPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker auth token post params func (o *ServiceBrokerAuthTokenPostParams) WithTimeout(timeout time.Duration) *ServiceBrokerAuthTokenPostParams { o.SetTimeout(timeout) @@ -125,7 +138,6 @@ func (o *ServiceBrokerAuthTokenPostParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go index e73831d702..72087200a2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerAuthTokenPostReader is a Reader for the ServiceBrokerAuthTokenPost structure. @@ -24,44 +23,38 @@ type ServiceBrokerAuthTokenPostReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerAuthTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerAuthTokenPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerAuthTokenPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewServiceBrokerAuthTokenPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 429: result := NewServiceBrokerAuthTokenPostTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerAuthTokenPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewServiceBrokerAuthTokenPostOK() *ServiceBrokerAuthTokenPostOK { return &ServiceBrokerAuthTokenPostOK{} } -/*ServiceBrokerAuthTokenPostOK handles this case with default header values. +/* ServiceBrokerAuthTokenPostOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type ServiceBrokerAuthTokenPostOK struct { func (o *ServiceBrokerAuthTokenPostOK) Error() string { return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %+v", 200, o.Payload) } +func (o *ServiceBrokerAuthTokenPostOK) GetPayload() *models.Token { + return o.Payload +} func (o *ServiceBrokerAuthTokenPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewServiceBrokerAuthTokenPostBadRequest() *ServiceBrokerAuthTokenPostBadReq return &ServiceBrokerAuthTokenPostBadRequest{} } -/*ServiceBrokerAuthTokenPostBadRequest handles this case with default header values. +/* ServiceBrokerAuthTokenPostBadRequest describes a response with status code 400, with default header values. Authorization pending */ @@ -110,6 +106,9 @@ type ServiceBrokerAuthTokenPostBadRequest struct { func (o *ServiceBrokerAuthTokenPostBadRequest) Error() string { return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerAuthTokenPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthTokenPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewServiceBrokerAuthTokenPostForbidden() *ServiceBrokerAuthTokenPostForbidd return &ServiceBrokerAuthTokenPostForbidden{} } -/*ServiceBrokerAuthTokenPostForbidden handles this case with default header values. +/* ServiceBrokerAuthTokenPostForbidden describes a response with status code 403, with default header values. User refused grant */ @@ -139,6 +138,9 @@ type ServiceBrokerAuthTokenPostForbidden struct { func (o *ServiceBrokerAuthTokenPostForbidden) Error() string { return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %+v", 403, o.Payload) } +func (o *ServiceBrokerAuthTokenPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthTokenPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewServiceBrokerAuthTokenPostTooManyRequests() *ServiceBrokerAuthTokenPostT return &ServiceBrokerAuthTokenPostTooManyRequests{} } -/*ServiceBrokerAuthTokenPostTooManyRequests handles this case with default header values. +/* ServiceBrokerAuthTokenPostTooManyRequests describes a response with status code 429, with default header values. Polling too frequently */ @@ -168,6 +170,9 @@ type ServiceBrokerAuthTokenPostTooManyRequests struct { func (o *ServiceBrokerAuthTokenPostTooManyRequests) Error() string { return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %+v", 429, o.Payload) } +func (o *ServiceBrokerAuthTokenPostTooManyRequests) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthTokenPostTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewServiceBrokerAuthTokenPostInternalServerError() *ServiceBrokerAuthTokenP return &ServiceBrokerAuthTokenPostInternalServerError{} } -/*ServiceBrokerAuthTokenPostInternalServerError handles this case with default header values. +/* ServiceBrokerAuthTokenPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type ServiceBrokerAuthTokenPostInternalServerError struct { func (o *ServiceBrokerAuthTokenPostInternalServerError) Error() string { return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerAuthTokenPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerAuthTokenPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go index fc39f69c1d..185400b277 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewBluemixServiceInstanceGetParams creates a new BluemixServiceInstanceGetParams object -// with the default values initialized. +// NewBluemixServiceInstanceGetParams creates a new BluemixServiceInstanceGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewBluemixServiceInstanceGetParams() *BluemixServiceInstanceGetParams { - var () return &BluemixServiceInstanceGetParams{ - timeout: cr.DefaultTimeout, } } // NewBluemixServiceInstanceGetParamsWithTimeout creates a new BluemixServiceInstanceGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewBluemixServiceInstanceGetParamsWithTimeout(timeout time.Duration) *BluemixServiceInstanceGetParams { - var () return &BluemixServiceInstanceGetParams{ - timeout: timeout, } } // NewBluemixServiceInstanceGetParamsWithContext creates a new BluemixServiceInstanceGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewBluemixServiceInstanceGetParamsWithContext(ctx context.Context) *BluemixServiceInstanceGetParams { - var () return &BluemixServiceInstanceGetParams{ - Context: ctx, } } // NewBluemixServiceInstanceGetParamsWithHTTPClient creates a new BluemixServiceInstanceGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewBluemixServiceInstanceGetParamsWithHTTPClient(client *http.Client) *BluemixServiceInstanceGetParams { - var () return &BluemixServiceInstanceGetParams{ HTTPClient: client, } } -/*BluemixServiceInstanceGetParams contains all the parameters to send to the API endpoint -for the bluemix service instance get operation typically these are written to a http.Request +/* BluemixServiceInstanceGetParams contains all the parameters to send to the API endpoint + for the bluemix service instance get operation. + + Typically these are written to a http.Request. */ type BluemixServiceInstanceGetParams struct { - /*InstanceID - instance id of instance to provision + /* InstanceID. + instance id of instance to provision */ InstanceID string @@ -72,6 +70,21 @@ type BluemixServiceInstanceGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the bluemix service instance get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BluemixServiceInstanceGetParams) WithDefaults() *BluemixServiceInstanceGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the bluemix service instance get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BluemixServiceInstanceGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the bluemix service instance get params func (o *BluemixServiceInstanceGetParams) WithTimeout(timeout time.Duration) *BluemixServiceInstanceGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go index 928de7fe2d..0fe5b096e3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // BluemixServiceInstanceGetReader is a Reader for the BluemixServiceInstanceGet structure. @@ -24,23 +23,20 @@ type BluemixServiceInstanceGetReader struct { // ReadResponse reads a server response into the received o. func (o *BluemixServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewBluemixServiceInstanceGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewBluemixServiceInstanceGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewBluemixServiceInstanceGetOK() *BluemixServiceInstanceGetOK { return &BluemixServiceInstanceGetOK{} } -/*BluemixServiceInstanceGetOK handles this case with default header values. +/* BluemixServiceInstanceGetOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type BluemixServiceInstanceGetOK struct { func (o *BluemixServiceInstanceGetOK) Error() string { return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetOK %+v", 200, o.Payload) } +func (o *BluemixServiceInstanceGetOK) GetPayload() *models.ServiceInstance { + return o.Payload +} func (o *BluemixServiceInstanceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewBluemixServiceInstanceGetBadRequest() *BluemixServiceInstanceGetBadReque return &BluemixServiceInstanceGetBadRequest{} } -/*BluemixServiceInstanceGetBadRequest handles this case with default header values. +/* BluemixServiceInstanceGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -89,6 +88,9 @@ type BluemixServiceInstanceGetBadRequest struct { func (o *BluemixServiceInstanceGetBadRequest) Error() string { return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetBadRequest %+v", 400, o.Payload) } +func (o *BluemixServiceInstanceGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *BluemixServiceInstanceGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go index 0b0b7b0987..7bc989beb9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewBluemixServiceInstancePutParams creates a new BluemixServiceInstancePutParams object -// with the default values initialized. +// NewBluemixServiceInstancePutParams creates a new BluemixServiceInstancePutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewBluemixServiceInstancePutParams() *BluemixServiceInstancePutParams { - var () return &BluemixServiceInstancePutParams{ - timeout: cr.DefaultTimeout, } } // NewBluemixServiceInstancePutParamsWithTimeout creates a new BluemixServiceInstancePutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewBluemixServiceInstancePutParamsWithTimeout(timeout time.Duration) *BluemixServiceInstancePutParams { - var () return &BluemixServiceInstancePutParams{ - timeout: timeout, } } // NewBluemixServiceInstancePutParamsWithContext creates a new BluemixServiceInstancePutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewBluemixServiceInstancePutParamsWithContext(ctx context.Context) *BluemixServiceInstancePutParams { - var () return &BluemixServiceInstancePutParams{ - Context: ctx, } } // NewBluemixServiceInstancePutParamsWithHTTPClient creates a new BluemixServiceInstancePutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewBluemixServiceInstancePutParamsWithHTTPClient(client *http.Client) *BluemixServiceInstancePutParams { - var () return &BluemixServiceInstancePutParams{ HTTPClient: client, } } -/*BluemixServiceInstancePutParams contains all the parameters to send to the API endpoint -for the bluemix service instance put operation typically these are written to a http.Request +/* BluemixServiceInstancePutParams contains all the parameters to send to the API endpoint + for the bluemix service instance put operation. + + Typically these are written to a http.Request. */ type BluemixServiceInstancePutParams struct { - /*Body - parameters for the requested state of a provisioned service + /* Body. + parameters for the requested state of a provisioned service */ Body *models.ServiceInstanceRequest - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string @@ -79,6 +78,21 @@ type BluemixServiceInstancePutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the bluemix service instance put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BluemixServiceInstancePutParams) WithDefaults() *BluemixServiceInstancePutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the bluemix service instance put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BluemixServiceInstancePutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the bluemix service instance put params func (o *BluemixServiceInstancePutParams) WithTimeout(timeout time.Duration) *BluemixServiceInstancePutParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *BluemixServiceInstancePutParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go index 63f7494606..d35787f180 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // BluemixServiceInstancePutReader is a Reader for the BluemixServiceInstancePut structure. @@ -24,23 +23,20 @@ type BluemixServiceInstancePutReader struct { // ReadResponse reads a server response into the received o. func (o *BluemixServiceInstancePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewBluemixServiceInstancePutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewBluemixServiceInstancePutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewBluemixServiceInstancePutOK() *BluemixServiceInstancePutOK { return &BluemixServiceInstancePutOK{} } -/*BluemixServiceInstancePutOK handles this case with default header values. +/* BluemixServiceInstancePutOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type BluemixServiceInstancePutOK struct { func (o *BluemixServiceInstancePutOK) Error() string { return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutOK %+v", 200, o.Payload) } +func (o *BluemixServiceInstancePutOK) GetPayload() *models.ServiceInstance { + return o.Payload +} func (o *BluemixServiceInstancePutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewBluemixServiceInstancePutBadRequest() *BluemixServiceInstancePutBadReque return &BluemixServiceInstancePutBadRequest{} } -/*BluemixServiceInstancePutBadRequest handles this case with default header values. +/* BluemixServiceInstancePutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -89,6 +88,9 @@ type BluemixServiceInstancePutBadRequest struct { func (o *BluemixServiceInstancePutBadRequest) Error() string { return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutBadRequest %+v", 400, o.Payload) } +func (o *BluemixServiceInstancePutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *BluemixServiceInstancePutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go index 6e0787f735..d0cb0758c4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go @@ -6,13 +6,14 @@ package bluemix_service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new bluemix service instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,27 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + BluemixServiceInstanceGet(params *BluemixServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstanceGetOK, error) + + BluemixServiceInstancePut(params *BluemixServiceInstancePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstancePutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -BluemixServiceInstanceGet gets the current state information associated with the service instance + BluemixServiceInstanceGet gets the current state information associated with the service instance */ -func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter) (*BluemixServiceInstanceGetOK, error) { +func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstanceGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewBluemixServiceInstanceGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "bluemix.serviceInstance.get", Method: "GET", PathPattern: "/bluemix_v1/service_instances/{instance_id}", @@ -45,24 +57,34 @@ func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*BluemixServiceInstanceGetOK), nil - + success, ok := result.(*BluemixServiceInstanceGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for bluemix.serviceInstance.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -BluemixServiceInstancePut updates disable or enable the state of a provisioned service instance + BluemixServiceInstancePut updates disable or enable the state of a provisioned service instance */ -func (a *Client) BluemixServiceInstancePut(params *BluemixServiceInstancePutParams, authInfo runtime.ClientAuthInfoWriter) (*BluemixServiceInstancePutOK, error) { +func (a *Client) BluemixServiceInstancePut(params *BluemixServiceInstancePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstancePutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewBluemixServiceInstancePutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "bluemix.serviceInstance.put", Method: "PUT", PathPattern: "/bluemix_v1/service_instances/{instance_id}", @@ -74,12 +96,23 @@ func (a *Client) BluemixServiceInstancePut(params *BluemixServiceInstancePutPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*BluemixServiceInstancePutOK), nil - + success, ok := result.(*BluemixServiceInstancePutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for bluemix.serviceInstance.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go index efc5a54d44..265b7dfec2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go @@ -6,13 +6,14 @@ package catalog // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new catalog API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,25 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CatalogGetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -CatalogGet gets the catalog of services that the service broker offers + CatalogGet gets the catalog of services that the service broker offers */ -func (a *Client) CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAuthInfoWriter) (*CatalogGetOK, error) { +func (a *Client) CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CatalogGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCatalogGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "catalog.get", Method: "GET", PathPattern: "/v2/catalog", @@ -45,12 +55,23 @@ func (a *Client) CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAut AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*CatalogGetOK), nil - + success, ok := result.(*CatalogGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for catalog.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_parameters.go index 3a9f01f5a5..5f11d0a1ac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewCatalogGetParams creates a new CatalogGetParams object -// with the default values initialized. +// NewCatalogGetParams creates a new CatalogGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCatalogGetParams() *CatalogGetParams { - var () return &CatalogGetParams{ - timeout: cr.DefaultTimeout, } } // NewCatalogGetParamsWithTimeout creates a new CatalogGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCatalogGetParamsWithTimeout(timeout time.Duration) *CatalogGetParams { - var () return &CatalogGetParams{ - timeout: timeout, } } // NewCatalogGetParamsWithContext creates a new CatalogGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCatalogGetParamsWithContext(ctx context.Context) *CatalogGetParams { - var () return &CatalogGetParams{ - Context: ctx, } } // NewCatalogGetParamsWithHTTPClient creates a new CatalogGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCatalogGetParamsWithHTTPClient(client *http.Client) *CatalogGetParams { - var () return &CatalogGetParams{ HTTPClient: client, } } -/*CatalogGetParams contains all the parameters to send to the API endpoint -for the catalog get operation typically these are written to a http.Request +/* CatalogGetParams contains all the parameters to send to the API endpoint + for the catalog get operation. + + Typically these are written to a http.Request. */ type CatalogGetParams struct { - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string @@ -72,6 +70,21 @@ type CatalogGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the catalog get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CatalogGetParams) WithDefaults() *CatalogGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the catalog get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CatalogGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the catalog get params func (o *CatalogGetParams) WithTimeout(timeout time.Duration) *CatalogGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go index 5a03deb63d..448d665f88 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // CatalogGetReader is a Reader for the CatalogGet structure. @@ -24,16 +23,14 @@ type CatalogGetReader struct { // ReadResponse reads a server response into the received o. func (o *CatalogGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewCatalogGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -42,7 +39,7 @@ func NewCatalogGetOK() *CatalogGetOK { return &CatalogGetOK{} } -/*CatalogGetOK handles this case with default header values. +/* CatalogGetOK describes a response with status code 200, with default header values. catalog response */ @@ -53,6 +50,9 @@ type CatalogGetOK struct { func (o *CatalogGetOK) Error() string { return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %+v", 200, o.Payload) } +func (o *CatalogGetOK) GetPayload() *models.Catalog { + return o.Payload +} func (o *CatalogGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go index d58ff86ae6..0cb215ec15 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go @@ -6,13 +6,14 @@ package hardware_platforms // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new hardware platforms API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,25 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardwareplatformsGetParams, opts ...ClientOption) (*ServiceBrokerHardwareplatformsGetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBrokerHardwareplatformsGet availables hardware statistics and limits + ServiceBrokerHardwareplatformsGet availables hardware statistics and limits */ -func (a *Client) ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardwareplatformsGetParams) (*ServiceBrokerHardwareplatformsGetOK, error) { +func (a *Client) ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardwareplatformsGetParams, opts ...ClientOption) (*ServiceBrokerHardwareplatformsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerHardwareplatformsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.hardwareplatforms.get", Method: "GET", PathPattern: "/broker/v1/hardware-platforms", @@ -44,12 +54,23 @@ func (a *Client) ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardware Reader: &ServiceBrokerHardwareplatformsGetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerHardwareplatformsGetOK), nil - + success, ok := result.(*ServiceBrokerHardwareplatformsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.hardwareplatforms.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go index 37a62680d3..53c6aee732 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerHardwareplatformsGetParams creates a new ServiceBrokerHardwareplatformsGetParams object -// with the default values initialized. +// NewServiceBrokerHardwareplatformsGetParams creates a new ServiceBrokerHardwareplatformsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerHardwareplatformsGetParams() *ServiceBrokerHardwareplatformsGetParams { - var () return &ServiceBrokerHardwareplatformsGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerHardwareplatformsGetParamsWithTimeout creates a new ServiceBrokerHardwareplatformsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerHardwareplatformsGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerHardwareplatformsGetParams { - var () return &ServiceBrokerHardwareplatformsGetParams{ - timeout: timeout, } } // NewServiceBrokerHardwareplatformsGetParamsWithContext creates a new ServiceBrokerHardwareplatformsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerHardwareplatformsGetParamsWithContext(ctx context.Context) *ServiceBrokerHardwareplatformsGetParams { - var () return &ServiceBrokerHardwareplatformsGetParams{ - Context: ctx, } } // NewServiceBrokerHardwareplatformsGetParamsWithHTTPClient creates a new ServiceBrokerHardwareplatformsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerHardwareplatformsGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerHardwareplatformsGetParams { - var () return &ServiceBrokerHardwareplatformsGetParams{ HTTPClient: client, } } -/*ServiceBrokerHardwareplatformsGetParams contains all the parameters to send to the API endpoint -for the service broker hardwareplatforms get operation typically these are written to a http.Request +/* ServiceBrokerHardwareplatformsGetParams contains all the parameters to send to the API endpoint + for the service broker hardwareplatforms get operation. + + Typically these are written to a http.Request. */ type ServiceBrokerHardwareplatformsGetParams struct { - /*RegionZone - The region zone of the cloud instance + /* RegionZone. + The region zone of the cloud instance */ RegionZone *string @@ -72,6 +70,21 @@ type ServiceBrokerHardwareplatformsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker hardwareplatforms get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerHardwareplatformsGetParams) WithDefaults() *ServiceBrokerHardwareplatformsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker hardwareplatforms get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerHardwareplatformsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker hardwareplatforms get params func (o *ServiceBrokerHardwareplatformsGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerHardwareplatformsGetParams { o.SetTimeout(timeout) @@ -128,16 +141,17 @@ func (o *ServiceBrokerHardwareplatformsGetParams) WriteToRequest(r runtime.Clien // query param regionZone var qrRegionZone string + if o.RegionZone != nil { qrRegionZone = *o.RegionZone } qRegionZone := qrRegionZone if qRegionZone != "" { + if err := r.SetQueryParam("regionZone", qRegionZone); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go index f981e3ee87..41e79c37cc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerHardwareplatformsGetReader is a Reader for the ServiceBrokerHardwareplatformsGet structure. @@ -24,23 +23,20 @@ type ServiceBrokerHardwareplatformsGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerHardwareplatformsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerHardwareplatformsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 500: result := NewServiceBrokerHardwareplatformsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerHardwareplatformsGetOK() *ServiceBrokerHardwareplatformsGet return &ServiceBrokerHardwareplatformsGetOK{} } -/*ServiceBrokerHardwareplatformsGetOK handles this case with default header values. +/* ServiceBrokerHardwareplatformsGetOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerHardwareplatformsGetOK struct { func (o *ServiceBrokerHardwareplatformsGetOK) Error() string { return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %+v", 200, o.Payload) } +func (o *ServiceBrokerHardwareplatformsGetOK) GetPayload() models.HardwarePlatforms { + return o.Payload +} func (o *ServiceBrokerHardwareplatformsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -76,7 +75,7 @@ func NewServiceBrokerHardwareplatformsGetInternalServerError() *ServiceBrokerHar return &ServiceBrokerHardwareplatformsGetInternalServerError{} } -/*ServiceBrokerHardwareplatformsGetInternalServerError handles this case with default header values. +/* ServiceBrokerHardwareplatformsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -87,6 +86,9 @@ type ServiceBrokerHardwareplatformsGetInternalServerError struct { func (o *ServiceBrokerHardwareplatformsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerHardwareplatformsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerHardwareplatformsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go index 9fe0ae3a0a..fee72986f6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go @@ -6,13 +6,14 @@ package iaas_service_broker // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new iaas service broker API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,31 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ...ClientOption) (*ServiceBrokerHealthOK, error) + + ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, opts ...ClientOption) (*ServiceBrokerHealthHeadOK, error) + + ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams, opts ...ClientOption) (*ServiceBrokerTestTimeoutOK, error) + + ServiceBrokerVersion(params *ServiceBrokerVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerVersionOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBrokerHealth gets current server health + ServiceBrokerHealth gets current server health */ -func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams) (*ServiceBrokerHealthOK, error) { +func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ...ClientOption) (*ServiceBrokerHealthOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerHealthParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.health", Method: "GET", PathPattern: "/broker/v1/health", @@ -44,24 +60,34 @@ func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams) (*Servic Reader: &ServiceBrokerHealthReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerHealthOK), nil - + success, ok := result.(*ServiceBrokerHealthOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.health: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerHealthHead gets current server health + ServiceBrokerHealthHead gets current server health */ -func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams) (*ServiceBrokerHealthHeadOK, error) { +func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, opts ...ClientOption) (*ServiceBrokerHealthHeadOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerHealthHeadParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.health.head", Method: "HEAD", PathPattern: "/broker/v1/health", @@ -72,24 +98,34 @@ func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams) Reader: &ServiceBrokerHealthHeadReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerHealthHeadOK), nil - + success, ok := result.(*ServiceBrokerHealthHeadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.health.head: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerTestTimeout gets current server version + ServiceBrokerTestTimeout gets current server version */ -func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams) (*ServiceBrokerTestTimeoutOK, error) { +func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams, opts ...ClientOption) (*ServiceBrokerTestTimeoutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerTestTimeoutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.test.timeout", Method: "GET", PathPattern: "/broker/v1/test/timeout", @@ -100,24 +136,34 @@ func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams Reader: &ServiceBrokerTestTimeoutReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerTestTimeoutOK), nil - + success, ok := result.(*ServiceBrokerTestTimeoutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.test.timeout: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerVersion gets current server version + ServiceBrokerVersion gets current server version */ -func (a *Client) ServiceBrokerVersion(params *ServiceBrokerVersionParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerVersionOK, error) { +func (a *Client) ServiceBrokerVersion(params *ServiceBrokerVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerVersionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerVersionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.version", Method: "GET", PathPattern: "/broker/v1/version", @@ -129,12 +175,23 @@ func (a *Client) ServiceBrokerVersion(params *ServiceBrokerVersionParams, authIn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerVersionOK), nil - + success, ok := result.(*ServiceBrokerVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.version: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_parameters.go index 211325ce0b..0408669592 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerHealthHeadParams creates a new ServiceBrokerHealthHeadParams object -// with the default values initialized. +// NewServiceBrokerHealthHeadParams creates a new ServiceBrokerHealthHeadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerHealthHeadParams() *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerHealthHeadParamsWithTimeout creates a new ServiceBrokerHealthHeadParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerHealthHeadParamsWithTimeout(timeout time.Duration) *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - timeout: timeout, } } // NewServiceBrokerHealthHeadParamsWithContext creates a new ServiceBrokerHealthHeadParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerHealthHeadParamsWithContext(ctx context.Context) *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ - Context: ctx, } } // NewServiceBrokerHealthHeadParamsWithHTTPClient creates a new ServiceBrokerHealthHeadParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerHealthHeadParamsWithHTTPClient(client *http.Client) *ServiceBrokerHealthHeadParams { - return &ServiceBrokerHealthHeadParams{ HTTPClient: client, } } -/*ServiceBrokerHealthHeadParams contains all the parameters to send to the API endpoint -for the service broker health head operation typically these are written to a http.Request +/* ServiceBrokerHealthHeadParams contains all the parameters to send to the API endpoint + for the service broker health head operation. + + Typically these are written to a http.Request. */ type ServiceBrokerHealthHeadParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerHealthHeadParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker health head params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerHealthHeadParams) WithDefaults() *ServiceBrokerHealthHeadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker health head params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerHealthHeadParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker health head params func (o *ServiceBrokerHealthHeadParams) WithTimeout(timeout time.Duration) *ServiceBrokerHealthHeadParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go index 880cac0b58..3af3bd5457 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerHealthHeadReader is a Reader for the ServiceBrokerHealthHead structure. @@ -24,23 +23,20 @@ type ServiceBrokerHealthHeadReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerHealthHeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerHealthHeadOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerHealthHeadBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerHealthHeadOK() *ServiceBrokerHealthHeadOK { return &ServiceBrokerHealthHeadOK{} } -/*ServiceBrokerHealthHeadOK handles this case with default header values. +/* ServiceBrokerHealthHeadOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerHealthHeadOK struct { func (o *ServiceBrokerHealthHeadOK) Error() string { return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %+v", 200, o.Payload) } +func (o *ServiceBrokerHealthHeadOK) GetPayload() *models.Health { + return o.Payload +} func (o *ServiceBrokerHealthHeadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceBrokerHealthHeadBadRequest() *ServiceBrokerHealthHeadBadRequest { return &ServiceBrokerHealthHeadBadRequest{} } -/*ServiceBrokerHealthHeadBadRequest handles this case with default header values. +/* ServiceBrokerHealthHeadBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -89,6 +88,9 @@ type ServiceBrokerHealthHeadBadRequest struct { func (o *ServiceBrokerHealthHeadBadRequest) Error() string { return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerHealthHeadBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerHealthHeadBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_parameters.go index f35798159d..bed2ea2fca 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerHealthParams creates a new ServiceBrokerHealthParams object -// with the default values initialized. +// NewServiceBrokerHealthParams creates a new ServiceBrokerHealthParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerHealthParams() *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerHealthParamsWithTimeout creates a new ServiceBrokerHealthParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerHealthParamsWithTimeout(timeout time.Duration) *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - timeout: timeout, } } // NewServiceBrokerHealthParamsWithContext creates a new ServiceBrokerHealthParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerHealthParamsWithContext(ctx context.Context) *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ - Context: ctx, } } // NewServiceBrokerHealthParamsWithHTTPClient creates a new ServiceBrokerHealthParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerHealthParamsWithHTTPClient(client *http.Client) *ServiceBrokerHealthParams { - return &ServiceBrokerHealthParams{ HTTPClient: client, } } -/*ServiceBrokerHealthParams contains all the parameters to send to the API endpoint -for the service broker health operation typically these are written to a http.Request +/* ServiceBrokerHealthParams contains all the parameters to send to the API endpoint + for the service broker health operation. + + Typically these are written to a http.Request. */ type ServiceBrokerHealthParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerHealthParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerHealthParams) WithDefaults() *ServiceBrokerHealthParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerHealthParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker health params func (o *ServiceBrokerHealthParams) WithTimeout(timeout time.Duration) *ServiceBrokerHealthParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go index 9d9fd8cc38..9ad3dd6b5d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerHealthReader is a Reader for the ServiceBrokerHealth structure. @@ -24,23 +23,20 @@ type ServiceBrokerHealthReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerHealthOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerHealthBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerHealthOK() *ServiceBrokerHealthOK { return &ServiceBrokerHealthOK{} } -/*ServiceBrokerHealthOK handles this case with default header values. +/* ServiceBrokerHealthOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerHealthOK struct { func (o *ServiceBrokerHealthOK) Error() string { return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %+v", 200, o.Payload) } +func (o *ServiceBrokerHealthOK) GetPayload() *models.Health { + return o.Payload +} func (o *ServiceBrokerHealthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceBrokerHealthBadRequest() *ServiceBrokerHealthBadRequest { return &ServiceBrokerHealthBadRequest{} } -/*ServiceBrokerHealthBadRequest handles this case with default header values. +/* ServiceBrokerHealthBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -89,6 +88,9 @@ type ServiceBrokerHealthBadRequest struct { func (o *ServiceBrokerHealthBadRequest) Error() string { return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerHealthBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerHealthBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go index e655336e7c..aec4dc2a33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_parameters.go @@ -13,58 +13,56 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewServiceBrokerTestTimeoutParams creates a new ServiceBrokerTestTimeoutParams object -// with the default values initialized. +// NewServiceBrokerTestTimeoutParams creates a new ServiceBrokerTestTimeoutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerTestTimeoutParams() *ServiceBrokerTestTimeoutParams { - var () return &ServiceBrokerTestTimeoutParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerTestTimeoutParamsWithTimeout creates a new ServiceBrokerTestTimeoutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerTestTimeoutParamsWithTimeout(timeout time.Duration) *ServiceBrokerTestTimeoutParams { - var () return &ServiceBrokerTestTimeoutParams{ - timeout: timeout, } } // NewServiceBrokerTestTimeoutParamsWithContext creates a new ServiceBrokerTestTimeoutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerTestTimeoutParamsWithContext(ctx context.Context) *ServiceBrokerTestTimeoutParams { - var () return &ServiceBrokerTestTimeoutParams{ - Context: ctx, } } // NewServiceBrokerTestTimeoutParamsWithHTTPClient creates a new ServiceBrokerTestTimeoutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerTestTimeoutParamsWithHTTPClient(client *http.Client) *ServiceBrokerTestTimeoutParams { - var () return &ServiceBrokerTestTimeoutParams{ HTTPClient: client, } } -/*ServiceBrokerTestTimeoutParams contains all the parameters to send to the API endpoint -for the service broker test timeout operation typically these are written to a http.Request +/* ServiceBrokerTestTimeoutParams contains all the parameters to send to the API endpoint + for the service broker test timeout operation. + + Typically these are written to a http.Request. */ type ServiceBrokerTestTimeoutParams struct { - /*T - seconds + /* T. + seconds */ T int64 @@ -73,6 +71,21 @@ type ServiceBrokerTestTimeoutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker test timeout params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerTestTimeoutParams) WithDefaults() *ServiceBrokerTestTimeoutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker test timeout params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerTestTimeoutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker test timeout params func (o *ServiceBrokerTestTimeoutParams) WithTimeout(timeout time.Duration) *ServiceBrokerTestTimeoutParams { o.SetTimeout(timeout) @@ -129,6 +142,7 @@ func (o *ServiceBrokerTestTimeoutParams) WriteToRequest(r runtime.ClientRequest, qrT := o.T qT := swag.FormatInt64(qrT) if qT != "" { + if err := r.SetQueryParam("t", qT); err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go index 5aa692909b..4aee22ea56 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerTestTimeoutReader is a Reader for the ServiceBrokerTestTimeout structure. @@ -24,16 +23,14 @@ type ServiceBrokerTestTimeoutReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerTestTimeoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerTestTimeoutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -42,7 +39,7 @@ func NewServiceBrokerTestTimeoutOK() *ServiceBrokerTestTimeoutOK { return &ServiceBrokerTestTimeoutOK{} } -/*ServiceBrokerTestTimeoutOK handles this case with default header values. +/* ServiceBrokerTestTimeoutOK describes a response with status code 200, with default header values. OK */ @@ -53,6 +50,9 @@ type ServiceBrokerTestTimeoutOK struct { func (o *ServiceBrokerTestTimeoutOK) Error() string { return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %+v", 200, o.Payload) } +func (o *ServiceBrokerTestTimeoutOK) GetPayload() models.Object { + return o.Payload +} func (o *ServiceBrokerTestTimeoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_parameters.go index 61d0bcb56e..6afbe895cf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerVersionParams creates a new ServiceBrokerVersionParams object -// with the default values initialized. +// NewServiceBrokerVersionParams creates a new ServiceBrokerVersionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerVersionParams() *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerVersionParamsWithTimeout creates a new ServiceBrokerVersionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerVersionParamsWithTimeout(timeout time.Duration) *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - timeout: timeout, } } // NewServiceBrokerVersionParamsWithContext creates a new ServiceBrokerVersionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerVersionParamsWithContext(ctx context.Context) *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ - Context: ctx, } } // NewServiceBrokerVersionParamsWithHTTPClient creates a new ServiceBrokerVersionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerVersionParamsWithHTTPClient(client *http.Client) *ServiceBrokerVersionParams { - return &ServiceBrokerVersionParams{ HTTPClient: client, } } -/*ServiceBrokerVersionParams contains all the parameters to send to the API endpoint -for the service broker version operation typically these are written to a http.Request +/* ServiceBrokerVersionParams contains all the parameters to send to the API endpoint + for the service broker version operation. + + Typically these are written to a http.Request. */ type ServiceBrokerVersionParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerVersionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker version params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerVersionParams) WithDefaults() *ServiceBrokerVersionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker version params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerVersionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker version params func (o *ServiceBrokerVersionParams) WithTimeout(timeout time.Duration) *ServiceBrokerVersionParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go index 452ac817dc..85c8fc176c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerVersionReader is a Reader for the ServiceBrokerVersion structure. @@ -24,23 +23,20 @@ type ServiceBrokerVersionReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerVersionOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerVersionBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerVersionOK() *ServiceBrokerVersionOK { return &ServiceBrokerVersionOK{} } -/*ServiceBrokerVersionOK handles this case with default header values. +/* ServiceBrokerVersionOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerVersionOK struct { func (o *ServiceBrokerVersionOK) Error() string { return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %+v", 200, o.Payload) } +func (o *ServiceBrokerVersionOK) GetPayload() *models.Version { + return o.Payload +} func (o *ServiceBrokerVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceBrokerVersionBadRequest() *ServiceBrokerVersionBadRequest { return &ServiceBrokerVersionBadRequest{} } -/*ServiceBrokerVersionBadRequest handles this case with default header values. +/* ServiceBrokerVersionBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -89,6 +88,9 @@ type ServiceBrokerVersionBadRequest struct { func (o *ServiceBrokerVersionBadRequest) Error() string { return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerVersionBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerVersionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go index 2e619c43d0..eb44b6d75a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go @@ -6,13 +6,14 @@ package internal_storage_regions // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new internal storage regions API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,33 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + InternalV1StorageRegionsStoragePoolsGet(params *InternalV1StorageRegionsStoragePoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetOK, error) + + InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1StorageRegionsStoragePoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetallOK, error) + + InternalV1StorageRegionsStoragePoolsPut(params *InternalV1StorageRegionsStoragePoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsPutOK, error) + + InternalV1StorageRegionsThresholdsGet(params *InternalV1StorageRegionsThresholdsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsGetOK, error) + + InternalV1StorageRegionsThresholdsPut(params *InternalV1StorageRegionsThresholdsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsPutAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -InternalV1StorageRegionsStoragePoolsGet gets the settings for given pool name + InternalV1StorageRegionsStoragePoolsGet gets the settings for given pool name */ -func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1StorageRegionsStoragePoolsGetParams, authInfo runtime.ClientAuthInfoWriter) (*InternalV1StorageRegionsStoragePoolsGetOK, error) { +func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1StorageRegionsStoragePoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewInternalV1StorageRegionsStoragePoolsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "internal.v1.storage.regions.storage-pools.get", Method: "GET", PathPattern: "/internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}", @@ -45,24 +63,34 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1Stora AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*InternalV1StorageRegionsStoragePoolsGetOK), nil - + success, ok := result.(*InternalV1StorageRegionsStoragePoolsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -InternalV1StorageRegionsStoragePoolsGetall gets the current storage pools settings for a region zone + InternalV1StorageRegionsStoragePoolsGetall gets the current storage pools settings for a region zone */ -func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1StorageRegionsStoragePoolsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*InternalV1StorageRegionsStoragePoolsGetallOK, error) { +func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1StorageRegionsStoragePoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewInternalV1StorageRegionsStoragePoolsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "internal.v1.storage.regions.storage-pools.getall", Method: "GET", PathPattern: "/internal/v1/storage/regions/{region_zone_id}/storage-pools", @@ -74,24 +102,34 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1St AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*InternalV1StorageRegionsStoragePoolsGetallOK), nil - + success, ok := result.(*InternalV1StorageRegionsStoragePoolsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -InternalV1StorageRegionsStoragePoolsPut updates the settings for given pool name + InternalV1StorageRegionsStoragePoolsPut updates the settings for given pool name */ -func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1StorageRegionsStoragePoolsPutParams, authInfo runtime.ClientAuthInfoWriter) (*InternalV1StorageRegionsStoragePoolsPutOK, error) { +func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1StorageRegionsStoragePoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewInternalV1StorageRegionsStoragePoolsPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "internal.v1.storage.regions.storage-pools.put", Method: "PUT", PathPattern: "/internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}", @@ -103,24 +141,34 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1Stora AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*InternalV1StorageRegionsStoragePoolsPutOK), nil - + success, ok := result.(*InternalV1StorageRegionsStoragePoolsPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -InternalV1StorageRegionsThresholdsGet gets the current default threshold settings for a region zone + InternalV1StorageRegionsThresholdsGet gets the current default threshold settings for a region zone */ -func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1StorageRegionsThresholdsGetParams, authInfo runtime.ClientAuthInfoWriter) (*InternalV1StorageRegionsThresholdsGetOK, error) { +func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1StorageRegionsThresholdsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewInternalV1StorageRegionsThresholdsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "internal.v1.storage.regions.thresholds.get", Method: "GET", PathPattern: "/internal/v1/storage/regions/{region_zone_id}/thresholds", @@ -132,24 +180,34 @@ func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1Storage AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*InternalV1StorageRegionsThresholdsGetOK), nil - + success, ok := result.(*InternalV1StorageRegionsThresholdsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.thresholds.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -InternalV1StorageRegionsThresholdsPut updates a default threshold setting for a region zone + InternalV1StorageRegionsThresholdsPut updates a default threshold setting for a region zone */ -func (a *Client) InternalV1StorageRegionsThresholdsPut(params *InternalV1StorageRegionsThresholdsPutParams, authInfo runtime.ClientAuthInfoWriter) (*InternalV1StorageRegionsThresholdsPutAccepted, error) { +func (a *Client) InternalV1StorageRegionsThresholdsPut(params *InternalV1StorageRegionsThresholdsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsPutAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewInternalV1StorageRegionsThresholdsPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "internal.v1.storage.regions.thresholds.put", Method: "PUT", PathPattern: "/internal/v1/storage/regions/{region_zone_id}/thresholds", @@ -161,12 +219,23 @@ func (a *Client) InternalV1StorageRegionsThresholdsPut(params *InternalV1Storage AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*InternalV1StorageRegionsThresholdsPutAccepted), nil - + success, ok := result.(*InternalV1StorageRegionsThresholdsPutAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.thresholds.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go index 58bfbb3010..7f5c37e4b2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewInternalV1StorageRegionsStoragePoolsGetParams creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the default values initialized. +// NewInternalV1StorageRegionsStoragePoolsGetParams creates a new InternalV1StorageRegionsStoragePoolsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewInternalV1StorageRegionsStoragePoolsGetParams() *InternalV1StorageRegionsStoragePoolsGetParams { - var () return &InternalV1StorageRegionsStoragePoolsGetParams{ - timeout: cr.DefaultTimeout, } } // NewInternalV1StorageRegionsStoragePoolsGetParamsWithTimeout creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInternalV1StorageRegionsStoragePoolsGetParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetParams { - var () return &InternalV1StorageRegionsStoragePoolsGetParams{ - timeout: timeout, } } // NewInternalV1StorageRegionsStoragePoolsGetParamsWithContext creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInternalV1StorageRegionsStoragePoolsGetParamsWithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsGetParams { - var () return &InternalV1StorageRegionsStoragePoolsGetParams{ - Context: ctx, } } // NewInternalV1StorageRegionsStoragePoolsGetParamsWithHTTPClient creates a new InternalV1StorageRegionsStoragePoolsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInternalV1StorageRegionsStoragePoolsGetParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsGetParams { - var () return &InternalV1StorageRegionsStoragePoolsGetParams{ HTTPClient: client, } } -/*InternalV1StorageRegionsStoragePoolsGetParams contains all the parameters to send to the API endpoint -for the internal v1 storage regions storage pools get operation typically these are written to a http.Request +/* InternalV1StorageRegionsStoragePoolsGetParams contains all the parameters to send to the API endpoint + for the internal v1 storage regions storage pools get operation. + + Typically these are written to a http.Request. */ type InternalV1StorageRegionsStoragePoolsGetParams struct { - /*RegionZoneID - ID of a Power Cloud Region Zone + /* RegionZoneID. + ID of a Power Cloud Region Zone */ RegionZoneID string - /*StoragePoolName - Storage pool name + /* StoragePoolName. + + Storage pool name */ StoragePoolName string @@ -77,6 +76,21 @@ type InternalV1StorageRegionsStoragePoolsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the internal v1 storage regions storage pools get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithDefaults() *InternalV1StorageRegionsStoragePoolsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 storage regions storage pools get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsStoragePoolsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the internal v1 storage regions storage pools get params func (o *InternalV1StorageRegionsStoragePoolsGetParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go index f0070f5d0a..4cb42f8836 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // InternalV1StorageRegionsStoragePoolsGetReader is a Reader for the InternalV1StorageRegionsStoragePoolsGet structure. @@ -24,37 +23,32 @@ type InternalV1StorageRegionsStoragePoolsGetReader struct { // ReadResponse reads a server response into the received o. func (o *InternalV1StorageRegionsStoragePoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewInternalV1StorageRegionsStoragePoolsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewInternalV1StorageRegionsStoragePoolsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewInternalV1StorageRegionsStoragePoolsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewInternalV1StorageRegionsStoragePoolsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetOK() *InternalV1StorageRegionsSto return &InternalV1StorageRegionsStoragePoolsGetOK{} } -/*InternalV1StorageRegionsStoragePoolsGetOK handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type InternalV1StorageRegionsStoragePoolsGetOK struct { func (o *InternalV1StorageRegionsStoragePoolsGetOK) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetOK %+v", 200, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetOK) GetPayload() models.StoragePools { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -90,7 +87,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetUnauthorized() *InternalV1Storage return &InternalV1StorageRegionsStoragePoolsGetUnauthorized{} } -/*InternalV1StorageRegionsStoragePoolsGetUnauthorized handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -101,6 +98,9 @@ type InternalV1StorageRegionsStoragePoolsGetUnauthorized struct { func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetUnauthorized %+v", 401, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -119,7 +119,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetNotFound() *InternalV1StorageRegi return &InternalV1StorageRegionsStoragePoolsGetNotFound{} } -/*InternalV1StorageRegionsStoragePoolsGetNotFound handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -130,6 +130,9 @@ type InternalV1StorageRegionsStoragePoolsGetNotFound struct { func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetNotFound %+v", 404, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -148,7 +151,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetInternalServerError() *InternalV1 return &InternalV1StorageRegionsStoragePoolsGetInternalServerError{} } -/*InternalV1StorageRegionsStoragePoolsGetInternalServerError handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -159,6 +162,9 @@ type InternalV1StorageRegionsStoragePoolsGetInternalServerError struct { func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetInternalServerError %+v", 500, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go index 9b19118160..cda5153c50 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewInternalV1StorageRegionsStoragePoolsGetallParams creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the default values initialized. +// NewInternalV1StorageRegionsStoragePoolsGetallParams creates a new InternalV1StorageRegionsStoragePoolsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewInternalV1StorageRegionsStoragePoolsGetallParams() *InternalV1StorageRegionsStoragePoolsGetallParams { - var () return &InternalV1StorageRegionsStoragePoolsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewInternalV1StorageRegionsStoragePoolsGetallParamsWithTimeout creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInternalV1StorageRegionsStoragePoolsGetallParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetallParams { - var () return &InternalV1StorageRegionsStoragePoolsGetallParams{ - timeout: timeout, } } // NewInternalV1StorageRegionsStoragePoolsGetallParamsWithContext creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInternalV1StorageRegionsStoragePoolsGetallParamsWithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsGetallParams { - var () return &InternalV1StorageRegionsStoragePoolsGetallParams{ - Context: ctx, } } // NewInternalV1StorageRegionsStoragePoolsGetallParamsWithHTTPClient creates a new InternalV1StorageRegionsStoragePoolsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInternalV1StorageRegionsStoragePoolsGetallParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsGetallParams { - var () return &InternalV1StorageRegionsStoragePoolsGetallParams{ HTTPClient: client, } } -/*InternalV1StorageRegionsStoragePoolsGetallParams contains all the parameters to send to the API endpoint -for the internal v1 storage regions storage pools getall operation typically these are written to a http.Request +/* InternalV1StorageRegionsStoragePoolsGetallParams contains all the parameters to send to the API endpoint + for the internal v1 storage regions storage pools getall operation. + + Typically these are written to a http.Request. */ type InternalV1StorageRegionsStoragePoolsGetallParams struct { - /*RegionZoneID - ID of a Power Cloud Region Zone + /* RegionZoneID. + ID of a Power Cloud Region Zone */ RegionZoneID string @@ -72,6 +70,21 @@ type InternalV1StorageRegionsStoragePoolsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the internal v1 storage regions storage pools getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithDefaults() *InternalV1StorageRegionsStoragePoolsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 storage regions storage pools getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsStoragePoolsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the internal v1 storage regions storage pools getall params func (o *InternalV1StorageRegionsStoragePoolsGetallParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go index 58bbd83699..1c654e2d53 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // InternalV1StorageRegionsStoragePoolsGetallReader is a Reader for the InternalV1StorageRegionsStoragePoolsGetall structure. @@ -24,37 +23,32 @@ type InternalV1StorageRegionsStoragePoolsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *InternalV1StorageRegionsStoragePoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewInternalV1StorageRegionsStoragePoolsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewInternalV1StorageRegionsStoragePoolsGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetallOK() *InternalV1StorageRegions return &InternalV1StorageRegionsStoragePoolsGetallOK{} } -/*InternalV1StorageRegionsStoragePoolsGetallOK handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type InternalV1StorageRegionsStoragePoolsGetallOK struct { func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK %+v", 200, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetallOK) GetPayload() models.StoragePools { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -90,7 +87,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetallUnauthorized() *InternalV1Stor return &InternalV1StorageRegionsStoragePoolsGetallUnauthorized{} } -/*InternalV1StorageRegionsStoragePoolsGetallUnauthorized handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -101,6 +98,9 @@ type InternalV1StorageRegionsStoragePoolsGetallUnauthorized struct { func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized %+v", 401, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -119,7 +119,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetallNotFound() *InternalV1StorageR return &InternalV1StorageRegionsStoragePoolsGetallNotFound{} } -/*InternalV1StorageRegionsStoragePoolsGetallNotFound handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -130,6 +130,9 @@ type InternalV1StorageRegionsStoragePoolsGetallNotFound struct { func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound %+v", 404, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -148,7 +151,7 @@ func NewInternalV1StorageRegionsStoragePoolsGetallInternalServerError() *Interna return &InternalV1StorageRegionsStoragePoolsGetallInternalServerError{} } -/*InternalV1StorageRegionsStoragePoolsGetallInternalServerError handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -159,6 +162,9 @@ type InternalV1StorageRegionsStoragePoolsGetallInternalServerError struct { func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError %+v", 500, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go index 81751aec70..624f961b4c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewInternalV1StorageRegionsStoragePoolsPutParams creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the default values initialized. +// NewInternalV1StorageRegionsStoragePoolsPutParams creates a new InternalV1StorageRegionsStoragePoolsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewInternalV1StorageRegionsStoragePoolsPutParams() *InternalV1StorageRegionsStoragePoolsPutParams { - var () return &InternalV1StorageRegionsStoragePoolsPutParams{ - timeout: cr.DefaultTimeout, } } // NewInternalV1StorageRegionsStoragePoolsPutParamsWithTimeout creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInternalV1StorageRegionsStoragePoolsPutParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsPutParams { - var () return &InternalV1StorageRegionsStoragePoolsPutParams{ - timeout: timeout, } } // NewInternalV1StorageRegionsStoragePoolsPutParamsWithContext creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInternalV1StorageRegionsStoragePoolsPutParamsWithContext(ctx context.Context) *InternalV1StorageRegionsStoragePoolsPutParams { - var () return &InternalV1StorageRegionsStoragePoolsPutParams{ - Context: ctx, } } // NewInternalV1StorageRegionsStoragePoolsPutParamsWithHTTPClient creates a new InternalV1StorageRegionsStoragePoolsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInternalV1StorageRegionsStoragePoolsPutParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsStoragePoolsPutParams { - var () return &InternalV1StorageRegionsStoragePoolsPutParams{ HTTPClient: client, } } -/*InternalV1StorageRegionsStoragePoolsPutParams contains all the parameters to send to the API endpoint -for the internal v1 storage regions storage pools put operation typically these are written to a http.Request +/* InternalV1StorageRegionsStoragePoolsPutParams contains all the parameters to send to the API endpoint + for the internal v1 storage regions storage pools put operation. + + Typically these are written to a http.Request. */ type InternalV1StorageRegionsStoragePoolsPutParams struct { - /*Body - Parameters for updating a storage pool + /* Body. + Parameters for updating a storage pool */ Body *models.UpdateStoragePool - /*RegionZoneID - ID of a Power Cloud Region Zone + /* RegionZoneID. + + ID of a Power Cloud Region Zone */ RegionZoneID string - /*StoragePoolName - Storage pool name + /* StoragePoolName. + + Storage pool name */ StoragePoolName string @@ -84,6 +84,21 @@ type InternalV1StorageRegionsStoragePoolsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the internal v1 storage regions storage pools put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithDefaults() *InternalV1StorageRegionsStoragePoolsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 storage regions storage pools put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsStoragePoolsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the internal v1 storage regions storage pools put params func (o *InternalV1StorageRegionsStoragePoolsPutParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsStoragePoolsPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *InternalV1StorageRegionsStoragePoolsPutParams) WriteToRequest(r runtime return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go index e869d645db..f36b645721 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // InternalV1StorageRegionsStoragePoolsPutReader is a Reader for the InternalV1StorageRegionsStoragePoolsPut structure. @@ -24,44 +23,38 @@ type InternalV1StorageRegionsStoragePoolsPutReader struct { // ReadResponse reads a server response into the received o. func (o *InternalV1StorageRegionsStoragePoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewInternalV1StorageRegionsStoragePoolsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewInternalV1StorageRegionsStoragePoolsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewInternalV1StorageRegionsStoragePoolsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewInternalV1StorageRegionsStoragePoolsPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewInternalV1StorageRegionsStoragePoolsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewInternalV1StorageRegionsStoragePoolsPutOK() *InternalV1StorageRegionsSto return &InternalV1StorageRegionsStoragePoolsPutOK{} } -/*InternalV1StorageRegionsStoragePoolsPutOK handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type InternalV1StorageRegionsStoragePoolsPutOK struct { func (o *InternalV1StorageRegionsStoragePoolsPutOK) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutOK %+v", 200, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsPutOK) GetPayload() *models.StoragePool { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewInternalV1StorageRegionsStoragePoolsPutBadRequest() *InternalV1StorageRe return &InternalV1StorageRegionsStoragePoolsPutBadRequest{} } -/*InternalV1StorageRegionsStoragePoolsPutBadRequest handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type InternalV1StorageRegionsStoragePoolsPutBadRequest struct { func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutBadRequest %+v", 400, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewInternalV1StorageRegionsStoragePoolsPutUnauthorized() *InternalV1Storage return &InternalV1StorageRegionsStoragePoolsPutUnauthorized{} } -/*InternalV1StorageRegionsStoragePoolsPutUnauthorized handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type InternalV1StorageRegionsStoragePoolsPutUnauthorized struct { func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutUnauthorized %+v", 401, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewInternalV1StorageRegionsStoragePoolsPutNotFound() *InternalV1StorageRegi return &InternalV1StorageRegionsStoragePoolsPutNotFound{} } -/*InternalV1StorageRegionsStoragePoolsPutNotFound handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsPutNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type InternalV1StorageRegionsStoragePoolsPutNotFound struct { func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutNotFound %+v", 404, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewInternalV1StorageRegionsStoragePoolsPutInternalServerError() *InternalV1 return &InternalV1StorageRegionsStoragePoolsPutInternalServerError{} } -/*InternalV1StorageRegionsStoragePoolsPutInternalServerError handles this case with default header values. +/* InternalV1StorageRegionsStoragePoolsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type InternalV1StorageRegionsStoragePoolsPutInternalServerError struct { func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutInternalServerError %+v", 500, o.Payload) } +func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go index 6cbbf535ab..c60d4fea48 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewInternalV1StorageRegionsThresholdsGetParams creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the default values initialized. +// NewInternalV1StorageRegionsThresholdsGetParams creates a new InternalV1StorageRegionsThresholdsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewInternalV1StorageRegionsThresholdsGetParams() *InternalV1StorageRegionsThresholdsGetParams { - var () return &InternalV1StorageRegionsThresholdsGetParams{ - timeout: cr.DefaultTimeout, } } // NewInternalV1StorageRegionsThresholdsGetParamsWithTimeout creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInternalV1StorageRegionsThresholdsGetParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsGetParams { - var () return &InternalV1StorageRegionsThresholdsGetParams{ - timeout: timeout, } } // NewInternalV1StorageRegionsThresholdsGetParamsWithContext creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInternalV1StorageRegionsThresholdsGetParamsWithContext(ctx context.Context) *InternalV1StorageRegionsThresholdsGetParams { - var () return &InternalV1StorageRegionsThresholdsGetParams{ - Context: ctx, } } // NewInternalV1StorageRegionsThresholdsGetParamsWithHTTPClient creates a new InternalV1StorageRegionsThresholdsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInternalV1StorageRegionsThresholdsGetParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsThresholdsGetParams { - var () return &InternalV1StorageRegionsThresholdsGetParams{ HTTPClient: client, } } -/*InternalV1StorageRegionsThresholdsGetParams contains all the parameters to send to the API endpoint -for the internal v1 storage regions thresholds get operation typically these are written to a http.Request +/* InternalV1StorageRegionsThresholdsGetParams contains all the parameters to send to the API endpoint + for the internal v1 storage regions thresholds get operation. + + Typically these are written to a http.Request. */ type InternalV1StorageRegionsThresholdsGetParams struct { - /*RegionZoneID - ID of a Power Cloud Region Zone + /* RegionZoneID. + ID of a Power Cloud Region Zone */ RegionZoneID string @@ -72,6 +70,21 @@ type InternalV1StorageRegionsThresholdsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the internal v1 storage regions thresholds get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsThresholdsGetParams) WithDefaults() *InternalV1StorageRegionsThresholdsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 storage regions thresholds get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsThresholdsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the internal v1 storage regions thresholds get params func (o *InternalV1StorageRegionsThresholdsGetParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go index 3db00762ae..87dbb71ea4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // InternalV1StorageRegionsThresholdsGetReader is a Reader for the InternalV1StorageRegionsThresholdsGet structure. @@ -24,37 +23,32 @@ type InternalV1StorageRegionsThresholdsGetReader struct { // ReadResponse reads a server response into the received o. func (o *InternalV1StorageRegionsThresholdsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewInternalV1StorageRegionsThresholdsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewInternalV1StorageRegionsThresholdsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewInternalV1StorageRegionsThresholdsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewInternalV1StorageRegionsThresholdsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewInternalV1StorageRegionsThresholdsGetOK() *InternalV1StorageRegionsThres return &InternalV1StorageRegionsThresholdsGetOK{} } -/*InternalV1StorageRegionsThresholdsGetOK handles this case with default header values. +/* InternalV1StorageRegionsThresholdsGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type InternalV1StorageRegionsThresholdsGetOK struct { func (o *InternalV1StorageRegionsThresholdsGetOK) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetOK %+v", 200, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsGetOK) GetPayload() *models.Thresholds { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewInternalV1StorageRegionsThresholdsGetUnauthorized() *InternalV1StorageRe return &InternalV1StorageRegionsThresholdsGetUnauthorized{} } -/*InternalV1StorageRegionsThresholdsGetUnauthorized handles this case with default header values. +/* InternalV1StorageRegionsThresholdsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type InternalV1StorageRegionsThresholdsGetUnauthorized struct { func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetUnauthorized %+v", 401, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewInternalV1StorageRegionsThresholdsGetNotFound() *InternalV1StorageRegion return &InternalV1StorageRegionsThresholdsGetNotFound{} } -/*InternalV1StorageRegionsThresholdsGetNotFound handles this case with default header values. +/* InternalV1StorageRegionsThresholdsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type InternalV1StorageRegionsThresholdsGetNotFound struct { func (o *InternalV1StorageRegionsThresholdsGetNotFound) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetNotFound %+v", 404, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewInternalV1StorageRegionsThresholdsGetInternalServerError() *InternalV1St return &InternalV1StorageRegionsThresholdsGetInternalServerError{} } -/*InternalV1StorageRegionsThresholdsGetInternalServerError handles this case with default header values. +/* InternalV1StorageRegionsThresholdsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type InternalV1StorageRegionsThresholdsGetInternalServerError struct { func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetInternalServerError %+v", 500, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go index 85cd7b5306..37d8366532 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewInternalV1StorageRegionsThresholdsPutParams creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the default values initialized. +// NewInternalV1StorageRegionsThresholdsPutParams creates a new InternalV1StorageRegionsThresholdsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewInternalV1StorageRegionsThresholdsPutParams() *InternalV1StorageRegionsThresholdsPutParams { - var () return &InternalV1StorageRegionsThresholdsPutParams{ - timeout: cr.DefaultTimeout, } } // NewInternalV1StorageRegionsThresholdsPutParamsWithTimeout creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInternalV1StorageRegionsThresholdsPutParamsWithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsPutParams { - var () return &InternalV1StorageRegionsThresholdsPutParams{ - timeout: timeout, } } // NewInternalV1StorageRegionsThresholdsPutParamsWithContext creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInternalV1StorageRegionsThresholdsPutParamsWithContext(ctx context.Context) *InternalV1StorageRegionsThresholdsPutParams { - var () return &InternalV1StorageRegionsThresholdsPutParams{ - Context: ctx, } } // NewInternalV1StorageRegionsThresholdsPutParamsWithHTTPClient creates a new InternalV1StorageRegionsThresholdsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInternalV1StorageRegionsThresholdsPutParamsWithHTTPClient(client *http.Client) *InternalV1StorageRegionsThresholdsPutParams { - var () return &InternalV1StorageRegionsThresholdsPutParams{ HTTPClient: client, } } -/*InternalV1StorageRegionsThresholdsPutParams contains all the parameters to send to the API endpoint -for the internal v1 storage regions thresholds put operation typically these are written to a http.Request +/* InternalV1StorageRegionsThresholdsPutParams contains all the parameters to send to the API endpoint + for the internal v1 storage regions thresholds put operation. + + Typically these are written to a http.Request. */ type InternalV1StorageRegionsThresholdsPutParams struct { - /*Body - Parameters for updating default threshold settings for a region-zone + /* Body. + Parameters for updating default threshold settings for a region-zone */ Body *models.Thresholds - /*RegionZoneID - ID of a Power Cloud Region Zone + /* RegionZoneID. + + ID of a Power Cloud Region Zone */ RegionZoneID string @@ -79,6 +78,21 @@ type InternalV1StorageRegionsThresholdsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the internal v1 storage regions thresholds put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsThresholdsPutParams) WithDefaults() *InternalV1StorageRegionsThresholdsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 storage regions thresholds put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1StorageRegionsThresholdsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the internal v1 storage regions thresholds put params func (o *InternalV1StorageRegionsThresholdsPutParams) WithTimeout(timeout time.Duration) *InternalV1StorageRegionsThresholdsPutParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *InternalV1StorageRegionsThresholdsPutParams) WriteToRequest(r runtime.C return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go index 60c0c14f28..fab946caab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // InternalV1StorageRegionsThresholdsPutReader is a Reader for the InternalV1StorageRegionsThresholdsPut structure. @@ -24,58 +23,50 @@ type InternalV1StorageRegionsThresholdsPutReader struct { // ReadResponse reads a server response into the received o. func (o *InternalV1StorageRegionsThresholdsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewInternalV1StorageRegionsThresholdsPutAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewInternalV1StorageRegionsThresholdsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewInternalV1StorageRegionsThresholdsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewInternalV1StorageRegionsThresholdsPutForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewInternalV1StorageRegionsThresholdsPutConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewInternalV1StorageRegionsThresholdsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewInternalV1StorageRegionsThresholdsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewInternalV1StorageRegionsThresholdsPutAccepted() *InternalV1StorageRegion return &InternalV1StorageRegionsThresholdsPutAccepted{} } -/*InternalV1StorageRegionsThresholdsPutAccepted handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutAccepted describes a response with status code 202, with default header values. OK, region-zone default threshold settings update */ @@ -95,6 +86,9 @@ type InternalV1StorageRegionsThresholdsPutAccepted struct { func (o *InternalV1StorageRegionsThresholdsPutAccepted) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutAccepted %+v", 202, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutAccepted) GetPayload() *models.Thresholds { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewInternalV1StorageRegionsThresholdsPutBadRequest() *InternalV1StorageRegi return &InternalV1StorageRegionsThresholdsPutBadRequest{} } -/*InternalV1StorageRegionsThresholdsPutBadRequest handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type InternalV1StorageRegionsThresholdsPutBadRequest struct { func (o *InternalV1StorageRegionsThresholdsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutBadRequest %+v", 400, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewInternalV1StorageRegionsThresholdsPutUnauthorized() *InternalV1StorageRe return &InternalV1StorageRegionsThresholdsPutUnauthorized{} } -/*InternalV1StorageRegionsThresholdsPutUnauthorized handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type InternalV1StorageRegionsThresholdsPutUnauthorized struct { func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnauthorized %+v", 401, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewInternalV1StorageRegionsThresholdsPutForbidden() *InternalV1StorageRegio return &InternalV1StorageRegionsThresholdsPutForbidden{} } -/*InternalV1StorageRegionsThresholdsPutForbidden handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type InternalV1StorageRegionsThresholdsPutForbidden struct { func (o *InternalV1StorageRegionsThresholdsPutForbidden) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutForbidden %+v", 403, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewInternalV1StorageRegionsThresholdsPutConflict() *InternalV1StorageRegion return &InternalV1StorageRegionsThresholdsPutConflict{} } -/*InternalV1StorageRegionsThresholdsPutConflict handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type InternalV1StorageRegionsThresholdsPutConflict struct { func (o *InternalV1StorageRegionsThresholdsPutConflict) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutConflict %+v", 409, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutConflict) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewInternalV1StorageRegionsThresholdsPutUnprocessableEntity() *InternalV1St return &InternalV1StorageRegionsThresholdsPutUnprocessableEntity{} } -/*InternalV1StorageRegionsThresholdsPutUnprocessableEntity handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type InternalV1StorageRegionsThresholdsPutUnprocessableEntity struct { func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewInternalV1StorageRegionsThresholdsPutInternalServerError() *InternalV1St return &InternalV1StorageRegionsThresholdsPutInternalServerError{} } -/*InternalV1StorageRegionsThresholdsPutInternalServerError handles this case with default header values. +/* InternalV1StorageRegionsThresholdsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type InternalV1StorageRegionsThresholdsPutInternalServerError struct { func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutInternalServerError %+v", 500, o.Payload) } +func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go index bf6c4edc5e..693bef3bab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go @@ -6,13 +6,14 @@ package open_stacks // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new open stacks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,33 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksGetOK, error) + + ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacksHostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksHostsGetOK, error) + + ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenstacksOpenstackGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksOpenstackGetOK, error) + + ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksPostOK, *ServiceBrokerOpenstacksPostCreated, error) + + ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstacksServersGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksServersGetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBrokerOpenstacksGet lists all open stack instances being managed + ServiceBrokerOpenstacksGet lists all open stack instances being managed */ -func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerOpenstacksGetOK, error) { +func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerOpenstacksGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.openstacks.get", Method: "GET", PathPattern: "/broker/v1/openstacks", @@ -45,24 +63,34 @@ func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetPa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerOpenstacksGetOK), nil - + success, ok := result.(*ServiceBrokerOpenstacksGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerOpenstacksHostsGet lists account information for all pvm instances on hostname + ServiceBrokerOpenstacksHostsGet lists account information for all pvm instances on hostname */ -func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacksHostsGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerOpenstacksHostsGetOK, error) { +func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacksHostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksHostsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerOpenstacksHostsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.openstacks.hosts.get", Method: "GET", PathPattern: "/broker/v1/openstacks/{openstack_id}/hosts/{hostname}", @@ -74,24 +102,34 @@ func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacks AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerOpenstacksHostsGetOK), nil - + success, ok := result.(*ServiceBrokerOpenstacksHostsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.hosts.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerOpenstacksOpenstackGet lists account information for all pvm instances on hostname + ServiceBrokerOpenstacksOpenstackGet lists account information for all pvm instances on hostname */ -func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenstacksOpenstackGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerOpenstacksOpenstackGetOK, error) { +func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenstacksOpenstackGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksOpenstackGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerOpenstacksOpenstackGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.openstacks.openstack.get", Method: "GET", PathPattern: "/broker/v1/openstacks/{openstack_id}", @@ -103,24 +141,34 @@ func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenst AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerOpenstacksOpenstackGetOK), nil - + success, ok := result.(*ServiceBrokerOpenstacksOpenstackGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.openstack.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerOpenstacksPost creates a new open stack instance to be managed + ServiceBrokerOpenstacksPost creates a new open stack instance to be managed */ -func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPostParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerOpenstacksPostOK, *ServiceBrokerOpenstacksPostCreated, error) { +func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksPostOK, *ServiceBrokerOpenstacksPostCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerOpenstacksPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.openstacks.post", Method: "POST", PathPattern: "/broker/v1/openstacks", @@ -132,7 +180,12 @@ func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPost AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -142,20 +195,20 @@ func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPost case *ServiceBrokerOpenstacksPostCreated: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for open_stacks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBrokerOpenstacksServersGet lists account information for a pvm instance + ServiceBrokerOpenstacksServersGet lists account information for a pvm instance */ -func (a *Client) ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstacksServersGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBrokerOpenstacksServersGetOK, error) { +func (a *Client) ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstacksServersGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksServersGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerOpenstacksServersGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.openstacks.servers.get", Method: "GET", PathPattern: "/broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}", @@ -167,12 +220,23 @@ func (a *Client) ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstac AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerOpenstacksServersGetOK), nil - + success, ok := result.(*ServiceBrokerOpenstacksServersGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.servers.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_parameters.go index 6e9fa9b973..a5fc89bfd6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerOpenstacksGetParams creates a new ServiceBrokerOpenstacksGetParams object -// with the default values initialized. +// NewServiceBrokerOpenstacksGetParams creates a new ServiceBrokerOpenstacksGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerOpenstacksGetParams() *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerOpenstacksGetParamsWithTimeout creates a new ServiceBrokerOpenstacksGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerOpenstacksGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - timeout: timeout, } } // NewServiceBrokerOpenstacksGetParamsWithContext creates a new ServiceBrokerOpenstacksGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerOpenstacksGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ - Context: ctx, } } // NewServiceBrokerOpenstacksGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerOpenstacksGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksGetParams { - return &ServiceBrokerOpenstacksGetParams{ HTTPClient: client, } } -/*ServiceBrokerOpenstacksGetParams contains all the parameters to send to the API endpoint -for the service broker openstacks get operation typically these are written to a http.Request +/* ServiceBrokerOpenstacksGetParams contains all the parameters to send to the API endpoint + for the service broker openstacks get operation. + + Typically these are written to a http.Request. */ type ServiceBrokerOpenstacksGetParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerOpenstacksGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker openstacks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksGetParams) WithDefaults() *ServiceBrokerOpenstacksGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker openstacks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker openstacks get params func (o *ServiceBrokerOpenstacksGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go index d37d1514cd..c190341178 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerOpenstacksGetReader is a Reader for the ServiceBrokerOpenstacksGet structure. @@ -24,37 +23,32 @@ type ServiceBrokerOpenstacksGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerOpenstacksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerOpenstacksGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerOpenstacksGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewServiceBrokerOpenstacksGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerOpenstacksGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewServiceBrokerOpenstacksGetOK() *ServiceBrokerOpenstacksGetOK { return &ServiceBrokerOpenstacksGetOK{} } -/*ServiceBrokerOpenstacksGetOK handles this case with default header values. +/* ServiceBrokerOpenstacksGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type ServiceBrokerOpenstacksGetOK struct { func (o *ServiceBrokerOpenstacksGetOK) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %+v", 200, o.Payload) } +func (o *ServiceBrokerOpenstacksGetOK) GetPayload() *models.OpenStacks { + return o.Payload +} func (o *ServiceBrokerOpenstacksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewServiceBrokerOpenstacksGetBadRequest() *ServiceBrokerOpenstacksGetBadReq return &ServiceBrokerOpenstacksGetBadRequest{} } -/*ServiceBrokerOpenstacksGetBadRequest handles this case with default header values. +/* ServiceBrokerOpenstacksGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type ServiceBrokerOpenstacksGetBadRequest struct { func (o *ServiceBrokerOpenstacksGetBadRequest) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerOpenstacksGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewServiceBrokerOpenstacksGetForbidden() *ServiceBrokerOpenstacksGetForbidd return &ServiceBrokerOpenstacksGetForbidden{} } -/*ServiceBrokerOpenstacksGetForbidden handles this case with default header values. +/* ServiceBrokerOpenstacksGetForbidden describes a response with status code 403, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type ServiceBrokerOpenstacksGetForbidden struct { func (o *ServiceBrokerOpenstacksGetForbidden) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %+v", 403, o.Payload) } +func (o *ServiceBrokerOpenstacksGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewServiceBrokerOpenstacksGetInternalServerError() *ServiceBrokerOpenstacks return &ServiceBrokerOpenstacksGetInternalServerError{} } -/*ServiceBrokerOpenstacksGetInternalServerError handles this case with default header values. +/* ServiceBrokerOpenstacksGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type ServiceBrokerOpenstacksGetInternalServerError struct { func (o *ServiceBrokerOpenstacksGetInternalServerError) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerOpenstacksGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go index fdacc2ced6..0f29aa65ee 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerOpenstacksHostsGetParams creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the default values initialized. +// NewServiceBrokerOpenstacksHostsGetParams creates a new ServiceBrokerOpenstacksHostsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerOpenstacksHostsGetParams() *ServiceBrokerOpenstacksHostsGetParams { - var () return &ServiceBrokerOpenstacksHostsGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerOpenstacksHostsGetParamsWithTimeout creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerOpenstacksHostsGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksHostsGetParams { - var () return &ServiceBrokerOpenstacksHostsGetParams{ - timeout: timeout, } } // NewServiceBrokerOpenstacksHostsGetParamsWithContext creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerOpenstacksHostsGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksHostsGetParams { - var () return &ServiceBrokerOpenstacksHostsGetParams{ - Context: ctx, } } // NewServiceBrokerOpenstacksHostsGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksHostsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerOpenstacksHostsGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksHostsGetParams { - var () return &ServiceBrokerOpenstacksHostsGetParams{ HTTPClient: client, } } -/*ServiceBrokerOpenstacksHostsGetParams contains all the parameters to send to the API endpoint -for the service broker openstacks hosts get operation typically these are written to a http.Request +/* ServiceBrokerOpenstacksHostsGetParams contains all the parameters to send to the API endpoint + for the service broker openstacks hosts get operation. + + Typically these are written to a http.Request. */ type ServiceBrokerOpenstacksHostsGetParams struct { - /*Hostname - Hostname + /* Hostname. + Hostname */ Hostname string - /*OpenstackID - Openstack ID + /* OpenstackID. + + Openstack ID */ OpenstackID string @@ -77,6 +76,21 @@ type ServiceBrokerOpenstacksHostsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker openstacks hosts get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksHostsGetParams) WithDefaults() *ServiceBrokerOpenstacksHostsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker openstacks hosts get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksHostsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker openstacks hosts get params func (o *ServiceBrokerOpenstacksHostsGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksHostsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go index e747dff7b8..83eff4cf2e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerOpenstacksHostsGetReader is a Reader for the ServiceBrokerOpenstacksHostsGet structure. @@ -24,37 +23,32 @@ type ServiceBrokerOpenstacksHostsGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerOpenstacksHostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerOpenstacksHostsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerOpenstacksHostsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewServiceBrokerOpenstacksHostsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerOpenstacksHostsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewServiceBrokerOpenstacksHostsGetOK() *ServiceBrokerOpenstacksHostsGetOK { return &ServiceBrokerOpenstacksHostsGetOK{} } -/*ServiceBrokerOpenstacksHostsGetOK handles this case with default header values. +/* ServiceBrokerOpenstacksHostsGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type ServiceBrokerOpenstacksHostsGetOK struct { func (o *ServiceBrokerOpenstacksHostsGetOK) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetOK %+v", 200, o.Payload) } +func (o *ServiceBrokerOpenstacksHostsGetOK) GetPayload() *models.HostInfo { + return o.Payload +} func (o *ServiceBrokerOpenstacksHostsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewServiceBrokerOpenstacksHostsGetBadRequest() *ServiceBrokerOpenstacksHost return &ServiceBrokerOpenstacksHostsGetBadRequest{} } -/*ServiceBrokerOpenstacksHostsGetBadRequest handles this case with default header values. +/* ServiceBrokerOpenstacksHostsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type ServiceBrokerOpenstacksHostsGetBadRequest struct { func (o *ServiceBrokerOpenstacksHostsGetBadRequest) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerOpenstacksHostsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksHostsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewServiceBrokerOpenstacksHostsGetNotFound() *ServiceBrokerOpenstacksHostsG return &ServiceBrokerOpenstacksHostsGetNotFound{} } -/*ServiceBrokerOpenstacksHostsGetNotFound handles this case with default header values. +/* ServiceBrokerOpenstacksHostsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type ServiceBrokerOpenstacksHostsGetNotFound struct { func (o *ServiceBrokerOpenstacksHostsGetNotFound) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetNotFound %+v", 404, o.Payload) } +func (o *ServiceBrokerOpenstacksHostsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksHostsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewServiceBrokerOpenstacksHostsGetInternalServerError() *ServiceBrokerOpens return &ServiceBrokerOpenstacksHostsGetInternalServerError{} } -/*ServiceBrokerOpenstacksHostsGetInternalServerError handles this case with default header values. +/* ServiceBrokerOpenstacksHostsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type ServiceBrokerOpenstacksHostsGetInternalServerError struct { func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go index 4bcf4ee074..11249b70fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerOpenstacksOpenstackGetParams creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the default values initialized. +// NewServiceBrokerOpenstacksOpenstackGetParams creates a new ServiceBrokerOpenstacksOpenstackGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerOpenstacksOpenstackGetParams() *ServiceBrokerOpenstacksOpenstackGetParams { - var () return &ServiceBrokerOpenstacksOpenstackGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerOpenstacksOpenstackGetParamsWithTimeout creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerOpenstacksOpenstackGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksOpenstackGetParams { - var () return &ServiceBrokerOpenstacksOpenstackGetParams{ - timeout: timeout, } } // NewServiceBrokerOpenstacksOpenstackGetParamsWithContext creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerOpenstacksOpenstackGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksOpenstackGetParams { - var () return &ServiceBrokerOpenstacksOpenstackGetParams{ - Context: ctx, } } // NewServiceBrokerOpenstacksOpenstackGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksOpenstackGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerOpenstacksOpenstackGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksOpenstackGetParams { - var () return &ServiceBrokerOpenstacksOpenstackGetParams{ HTTPClient: client, } } -/*ServiceBrokerOpenstacksOpenstackGetParams contains all the parameters to send to the API endpoint -for the service broker openstacks openstack get operation typically these are written to a http.Request +/* ServiceBrokerOpenstacksOpenstackGetParams contains all the parameters to send to the API endpoint + for the service broker openstacks openstack get operation. + + Typically these are written to a http.Request. */ type ServiceBrokerOpenstacksOpenstackGetParams struct { - /*OpenstackID - Openstack ID + /* OpenstackID. + Openstack ID */ OpenstackID string @@ -72,6 +70,21 @@ type ServiceBrokerOpenstacksOpenstackGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker openstacks openstack get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithDefaults() *ServiceBrokerOpenstacksOpenstackGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker openstacks openstack get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksOpenstackGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker openstacks openstack get params func (o *ServiceBrokerOpenstacksOpenstackGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksOpenstackGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go index b427be39a8..dece779e2e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerOpenstacksOpenstackGetReader is a Reader for the ServiceBrokerOpenstacksOpenstackGet structure. @@ -24,37 +23,32 @@ type ServiceBrokerOpenstacksOpenstackGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerOpenstacksOpenstackGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerOpenstacksOpenstackGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerOpenstacksOpenstackGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewServiceBrokerOpenstacksOpenstackGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerOpenstacksOpenstackGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewServiceBrokerOpenstacksOpenstackGetOK() *ServiceBrokerOpenstacksOpenstac return &ServiceBrokerOpenstacksOpenstackGetOK{} } -/*ServiceBrokerOpenstacksOpenstackGetOK handles this case with default header values. +/* ServiceBrokerOpenstacksOpenstackGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type ServiceBrokerOpenstacksOpenstackGetOK struct { func (o *ServiceBrokerOpenstacksOpenstackGetOK) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetOK %+v", 200, o.Payload) } +func (o *ServiceBrokerOpenstacksOpenstackGetOK) GetPayload() *models.OpenStackInfo { + return o.Payload +} func (o *ServiceBrokerOpenstacksOpenstackGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewServiceBrokerOpenstacksOpenstackGetBadRequest() *ServiceBrokerOpenstacks return &ServiceBrokerOpenstacksOpenstackGetBadRequest{} } -/*ServiceBrokerOpenstacksOpenstackGetBadRequest handles this case with default header values. +/* ServiceBrokerOpenstacksOpenstackGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type ServiceBrokerOpenstacksOpenstackGetBadRequest struct { func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewServiceBrokerOpenstacksOpenstackGetNotFound() *ServiceBrokerOpenstacksOp return &ServiceBrokerOpenstacksOpenstackGetNotFound{} } -/*ServiceBrokerOpenstacksOpenstackGetNotFound handles this case with default header values. +/* ServiceBrokerOpenstacksOpenstackGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type ServiceBrokerOpenstacksOpenstackGetNotFound struct { func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetNotFound %+v", 404, o.Payload) } +func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewServiceBrokerOpenstacksOpenstackGetInternalServerError() *ServiceBrokerO return &ServiceBrokerOpenstacksOpenstackGetInternalServerError{} } -/*ServiceBrokerOpenstacksOpenstackGetInternalServerError handles this case with default header values. +/* ServiceBrokerOpenstacksOpenstackGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type ServiceBrokerOpenstacksOpenstackGetInternalServerError struct { func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_parameters.go index b505aa4bc6..32935216b2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_parameters.go @@ -13,59 +13,57 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewServiceBrokerOpenstacksPostParams creates a new ServiceBrokerOpenstacksPostParams object -// with the default values initialized. +// NewServiceBrokerOpenstacksPostParams creates a new ServiceBrokerOpenstacksPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerOpenstacksPostParams() *ServiceBrokerOpenstacksPostParams { - var () return &ServiceBrokerOpenstacksPostParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerOpenstacksPostParamsWithTimeout creates a new ServiceBrokerOpenstacksPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerOpenstacksPostParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksPostParams { - var () return &ServiceBrokerOpenstacksPostParams{ - timeout: timeout, } } // NewServiceBrokerOpenstacksPostParamsWithContext creates a new ServiceBrokerOpenstacksPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerOpenstacksPostParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksPostParams { - var () return &ServiceBrokerOpenstacksPostParams{ - Context: ctx, } } // NewServiceBrokerOpenstacksPostParamsWithHTTPClient creates a new ServiceBrokerOpenstacksPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerOpenstacksPostParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksPostParams { - var () return &ServiceBrokerOpenstacksPostParams{ HTTPClient: client, } } -/*ServiceBrokerOpenstacksPostParams contains all the parameters to send to the API endpoint -for the service broker openstacks post operation typically these are written to a http.Request +/* ServiceBrokerOpenstacksPostParams contains all the parameters to send to the API endpoint + for the service broker openstacks post operation. + + Typically these are written to a http.Request. */ type ServiceBrokerOpenstacksPostParams struct { - /*Body - Parameters for the creation of a new Open Stack Instance + /* Body. + Parameters for the creation of a new Open Stack Instance */ Body *models.OpenStackCreate @@ -74,6 +72,21 @@ type ServiceBrokerOpenstacksPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker openstacks post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksPostParams) WithDefaults() *ServiceBrokerOpenstacksPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker openstacks post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker openstacks post params func (o *ServiceBrokerOpenstacksPostParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksPostParams { o.SetTimeout(timeout) @@ -125,7 +138,6 @@ func (o *ServiceBrokerOpenstacksPostParams) WriteToRequest(r runtime.ClientReque return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go index 99a1843018..b83e9e3971 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerOpenstacksPostReader is a Reader for the ServiceBrokerOpenstacksPost structure. @@ -24,51 +23,44 @@ type ServiceBrokerOpenstacksPostReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerOpenstacksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerOpenstacksPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewServiceBrokerOpenstacksPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerOpenstacksPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewServiceBrokerOpenstacksPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewServiceBrokerOpenstacksPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerOpenstacksPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewServiceBrokerOpenstacksPostOK() *ServiceBrokerOpenstacksPostOK { return &ServiceBrokerOpenstacksPostOK{} } -/*ServiceBrokerOpenstacksPostOK handles this case with default header values. +/* ServiceBrokerOpenstacksPostOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type ServiceBrokerOpenstacksPostOK struct { func (o *ServiceBrokerOpenstacksPostOK) Error() string { return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %+v", 200, o.Payload) } +func (o *ServiceBrokerOpenstacksPostOK) GetPayload() *models.OpenStack { + return o.Payload +} func (o *ServiceBrokerOpenstacksPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewServiceBrokerOpenstacksPostCreated() *ServiceBrokerOpenstacksPostCreated return &ServiceBrokerOpenstacksPostCreated{} } -/*ServiceBrokerOpenstacksPostCreated handles this case with default header values. +/* ServiceBrokerOpenstacksPostCreated describes a response with status code 201, with default header values. Created */ @@ -117,6 +112,9 @@ type ServiceBrokerOpenstacksPostCreated struct { func (o *ServiceBrokerOpenstacksPostCreated) Error() string { return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %+v", 201, o.Payload) } +func (o *ServiceBrokerOpenstacksPostCreated) GetPayload() *models.OpenStack { + return o.Payload +} func (o *ServiceBrokerOpenstacksPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewServiceBrokerOpenstacksPostBadRequest() *ServiceBrokerOpenstacksPostBadR return &ServiceBrokerOpenstacksPostBadRequest{} } -/*ServiceBrokerOpenstacksPostBadRequest handles this case with default header values. +/* ServiceBrokerOpenstacksPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -146,6 +144,9 @@ type ServiceBrokerOpenstacksPostBadRequest struct { func (o *ServiceBrokerOpenstacksPostBadRequest) Error() string { return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerOpenstacksPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewServiceBrokerOpenstacksPostConflict() *ServiceBrokerOpenstacksPostConfli return &ServiceBrokerOpenstacksPostConflict{} } -/*ServiceBrokerOpenstacksPostConflict handles this case with default header values. +/* ServiceBrokerOpenstacksPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type ServiceBrokerOpenstacksPostConflict struct { func (o *ServiceBrokerOpenstacksPostConflict) Error() string { return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %+v", 409, o.Payload) } +func (o *ServiceBrokerOpenstacksPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewServiceBrokerOpenstacksPostUnprocessableEntity() *ServiceBrokerOpenstack return &ServiceBrokerOpenstacksPostUnprocessableEntity{} } -/*ServiceBrokerOpenstacksPostUnprocessableEntity handles this case with default header values. +/* ServiceBrokerOpenstacksPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type ServiceBrokerOpenstacksPostUnprocessableEntity struct { func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewServiceBrokerOpenstacksPostInternalServerError() *ServiceBrokerOpenstack return &ServiceBrokerOpenstacksPostInternalServerError{} } -/*ServiceBrokerOpenstacksPostInternalServerError handles this case with default header values. +/* ServiceBrokerOpenstacksPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type ServiceBrokerOpenstacksPostInternalServerError struct { func (o *ServiceBrokerOpenstacksPostInternalServerError) Error() string { return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerOpenstacksPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go index 9143ff59ab..dbe1a1a52f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerOpenstacksServersGetParams creates a new ServiceBrokerOpenstacksServersGetParams object -// with the default values initialized. +// NewServiceBrokerOpenstacksServersGetParams creates a new ServiceBrokerOpenstacksServersGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerOpenstacksServersGetParams() *ServiceBrokerOpenstacksServersGetParams { - var () return &ServiceBrokerOpenstacksServersGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerOpenstacksServersGetParamsWithTimeout creates a new ServiceBrokerOpenstacksServersGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerOpenstacksServersGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksServersGetParams { - var () return &ServiceBrokerOpenstacksServersGetParams{ - timeout: timeout, } } // NewServiceBrokerOpenstacksServersGetParamsWithContext creates a new ServiceBrokerOpenstacksServersGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerOpenstacksServersGetParamsWithContext(ctx context.Context) *ServiceBrokerOpenstacksServersGetParams { - var () return &ServiceBrokerOpenstacksServersGetParams{ - Context: ctx, } } // NewServiceBrokerOpenstacksServersGetParamsWithHTTPClient creates a new ServiceBrokerOpenstacksServersGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerOpenstacksServersGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerOpenstacksServersGetParams { - var () return &ServiceBrokerOpenstacksServersGetParams{ HTTPClient: client, } } -/*ServiceBrokerOpenstacksServersGetParams contains all the parameters to send to the API endpoint -for the service broker openstacks servers get operation typically these are written to a http.Request +/* ServiceBrokerOpenstacksServersGetParams contains all the parameters to send to the API endpoint + for the service broker openstacks servers get operation. + + Typically these are written to a http.Request. */ type ServiceBrokerOpenstacksServersGetParams struct { - /*OpenstackID - Openstack ID + /* OpenstackID. + Openstack ID */ OpenstackID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type ServiceBrokerOpenstacksServersGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker openstacks servers get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksServersGetParams) WithDefaults() *ServiceBrokerOpenstacksServersGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker openstacks servers get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerOpenstacksServersGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker openstacks servers get params func (o *ServiceBrokerOpenstacksServersGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerOpenstacksServersGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go index 901260334f..d52ebc75f7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerOpenstacksServersGetReader is a Reader for the ServiceBrokerOpenstacksServersGet structure. @@ -24,37 +23,32 @@ type ServiceBrokerOpenstacksServersGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerOpenstacksServersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerOpenstacksServersGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBrokerOpenstacksServersGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewServiceBrokerOpenstacksServersGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewServiceBrokerOpenstacksServersGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewServiceBrokerOpenstacksServersGetOK() *ServiceBrokerOpenstacksServersGet return &ServiceBrokerOpenstacksServersGetOK{} } -/*ServiceBrokerOpenstacksServersGetOK handles this case with default header values. +/* ServiceBrokerOpenstacksServersGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type ServiceBrokerOpenstacksServersGetOK struct { func (o *ServiceBrokerOpenstacksServersGetOK) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetOK %+v", 200, o.Payload) } +func (o *ServiceBrokerOpenstacksServersGetOK) GetPayload() *models.HostPVMInstance { + return o.Payload +} func (o *ServiceBrokerOpenstacksServersGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewServiceBrokerOpenstacksServersGetBadRequest() *ServiceBrokerOpenstacksSe return &ServiceBrokerOpenstacksServersGetBadRequest{} } -/*ServiceBrokerOpenstacksServersGetBadRequest handles this case with default header values. +/* ServiceBrokerOpenstacksServersGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type ServiceBrokerOpenstacksServersGetBadRequest struct { func (o *ServiceBrokerOpenstacksServersGetBadRequest) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetBadRequest %+v", 400, o.Payload) } +func (o *ServiceBrokerOpenstacksServersGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksServersGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewServiceBrokerOpenstacksServersGetNotFound() *ServiceBrokerOpenstacksServ return &ServiceBrokerOpenstacksServersGetNotFound{} } -/*ServiceBrokerOpenstacksServersGetNotFound handles this case with default header values. +/* ServiceBrokerOpenstacksServersGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type ServiceBrokerOpenstacksServersGetNotFound struct { func (o *ServiceBrokerOpenstacksServersGetNotFound) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetNotFound %+v", 404, o.Payload) } +func (o *ServiceBrokerOpenstacksServersGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksServersGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewServiceBrokerOpenstacksServersGetInternalServerError() *ServiceBrokerOpe return &ServiceBrokerOpenstacksServersGetInternalServerError{} } -/*ServiceBrokerOpenstacksServersGetInternalServerError handles this case with default header values. +/* ServiceBrokerOpenstacksServersGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type ServiceBrokerOpenstacksServersGetInternalServerError struct { func (o *ServiceBrokerOpenstacksServersGetInternalServerError) Error() string { return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerOpenstacksServersGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerOpenstacksServersGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go index 6cf9dc61c8..6b3a5437c3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go @@ -6,13 +6,14 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud cloud connections API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,39 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsDeleteOK, *PcloudCloudconnectionsDeleteAccepted, error) + + PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetOK, error) + + PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetallOK, error) + + PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) + + PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) + + PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPostOK, *PcloudCloudconnectionsPostCreated, *PcloudCloudconnectionsPostAccepted, error) + + PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPutOK, *PcloudCloudconnectionsPutAccepted, error) + + PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudCloudconnectionsDelete deletes a cloud connection + PcloudCloudconnectionsDelete deletes a cloud connection */ -func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsDeleteOK, *PcloudCloudconnectionsDeleteAccepted, error) { +func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsDeleteOK, *PcloudCloudconnectionsDeleteAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}", @@ -45,7 +69,12 @@ func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDele AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -55,20 +84,20 @@ func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDele case *PcloudCloudconnectionsDeleteAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsGet gets a cloud connection s state information + PcloudCloudconnectionsGet gets a cloud connection s state information */ -func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsGetOK, error) { +func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}", @@ -80,24 +109,34 @@ func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudconnectionsGetOK), nil - + success, ok := result.(*PcloudCloudconnectionsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsGetall gets all cloud connections in this cloud instance + PcloudCloudconnectionsGetall gets all cloud connections in this cloud instance */ -func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsGetallOK, error) { +func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections", @@ -109,24 +148,34 @@ func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGeta AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudconnectionsGetallOK), nil - + success, ok := result.(*PcloudCloudconnectionsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsNetworksDelete deletes a network from a cloud connection + PcloudCloudconnectionsNetworksDelete deletes a network from a cloud connection */ -func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) { +func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsNetworksDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.networks.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}", @@ -138,7 +187,12 @@ func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnect AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -148,20 +202,20 @@ func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnect case *PcloudCloudconnectionsNetworksDeleteAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsNetworksPut adds a network to the cloud connection + PcloudCloudconnectionsNetworksPut adds a network to the cloud connection */ -func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) { +func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsNetworksPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.networks.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}", @@ -173,7 +227,12 @@ func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnection AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -183,20 +242,20 @@ func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnection case *PcloudCloudconnectionsNetworksPutAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsPost creates a new cloud connection + PcloudCloudconnectionsPost creates a new cloud connection */ -func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsPostOK, *PcloudCloudconnectionsPostCreated, *PcloudCloudconnectionsPostAccepted, error) { +func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPostOK, *PcloudCloudconnectionsPostCreated, *PcloudCloudconnectionsPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections", @@ -208,7 +267,12 @@ func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostPa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } @@ -220,20 +284,20 @@ func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostPa case *PcloudCloudconnectionsPostAccepted: return nil, nil, value, nil } - return nil, nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsPut updates a cloud connection + PcloudCloudconnectionsPut updates a cloud connection */ -func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsPutOK, *PcloudCloudconnectionsPutAccepted, error) { +func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPutOK, *PcloudCloudconnectionsPutAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}", @@ -245,7 +309,12 @@ func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -255,20 +324,20 @@ func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutPara case *PcloudCloudconnectionsPutAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudconnectionsVirtualprivatecloudsGetall gets all virtual private cloud connections in this cloud instance + PcloudCloudconnectionsVirtualprivatecloudsGetall gets all virtual private cloud connections in this cloud instance */ -func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) { +func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudconnections.virtualprivateclouds.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds", @@ -280,12 +349,23 @@ func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *Pcloud AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudconnectionsVirtualprivatecloudsGetallOK), nil - + success, ok := result.(*PcloudCloudconnectionsVirtualprivatecloudsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.virtualprivateclouds.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go index 8e2157b5e8..9cbc14c98f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudconnectionsDeleteParams creates a new PcloudCloudconnectionsDeleteParams object -// with the default values initialized. +// NewPcloudCloudconnectionsDeleteParams creates a new PcloudCloudconnectionsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsDeleteParams() *PcloudCloudconnectionsDeleteParams { - var () return &PcloudCloudconnectionsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsDeleteParamsWithTimeout creates a new PcloudCloudconnectionsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsDeleteParams { - var () return &PcloudCloudconnectionsDeleteParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsDeleteParamsWithContext creates a new PcloudCloudconnectionsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsDeleteParamsWithContext(ctx context.Context) *PcloudCloudconnectionsDeleteParams { - var () return &PcloudCloudconnectionsDeleteParams{ - Context: ctx, } } // NewPcloudCloudconnectionsDeleteParamsWithHTTPClient creates a new PcloudCloudconnectionsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsDeleteParams { - var () return &PcloudCloudconnectionsDeleteParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections delete operation typically these are written to a http.Request +/* PcloudCloudconnectionsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsDeleteParams struct { - /*CloudConnectionID - Cloud Connection ID + /* CloudConnectionID. + Cloud Connection ID */ CloudConnectionID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -77,6 +76,21 @@ type PcloudCloudconnectionsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsDeleteParams) WithDefaults() *PcloudCloudconnectionsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections delete params func (o *PcloudCloudconnectionsDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go index 8d295e3fc0..6d5d1c6902 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsDeleteReader is a Reader for the PcloudCloudconnectionsDelete structure. @@ -24,51 +23,44 @@ type PcloudCloudconnectionsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudCloudconnectionsDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudCloudconnectionsDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudconnectionsDeleteOK() *PcloudCloudconnectionsDeleteOK { return &PcloudCloudconnectionsDeleteOK{} } -/*PcloudCloudconnectionsDeleteOK handles this case with default header values. +/* PcloudCloudconnectionsDeleteOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudCloudconnectionsDeleteOK struct { func (o *PcloudCloudconnectionsDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudconnectionsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudCloudconnectionsDeleteAccepted() *PcloudCloudconnectionsDeleteAcce return &PcloudCloudconnectionsDeleteAccepted{} } -/*PcloudCloudconnectionsDeleteAccepted handles this case with default header values. +/* PcloudCloudconnectionsDeleteAccepted describes a response with status code 202, with default header values. Accepted */ @@ -115,6 +110,9 @@ type PcloudCloudconnectionsDeleteAccepted struct { func (o *PcloudCloudconnectionsDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudconnectionsDeleteAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudCloudconnectionsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudCloudconnectionsDeleteBadRequest() *PcloudCloudconnectionsDeleteBa return &PcloudCloudconnectionsDeleteBadRequest{} } -/*PcloudCloudconnectionsDeleteBadRequest handles this case with default header values. +/* PcloudCloudconnectionsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -144,6 +142,9 @@ type PcloudCloudconnectionsDeleteBadRequest struct { func (o *PcloudCloudconnectionsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudCloudconnectionsDeleteUnauthorized() *PcloudCloudconnectionsDelete return &PcloudCloudconnectionsDeleteUnauthorized{} } -/*PcloudCloudconnectionsDeleteUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -173,6 +174,9 @@ type PcloudCloudconnectionsDeleteUnauthorized struct { func (o *PcloudCloudconnectionsDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudCloudconnectionsDeleteGone() *PcloudCloudconnectionsDeleteGone { return &PcloudCloudconnectionsDeleteGone{} } -/*PcloudCloudconnectionsDeleteGone handles this case with default header values. +/* PcloudCloudconnectionsDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -202,6 +206,9 @@ type PcloudCloudconnectionsDeleteGone struct { func (o *PcloudCloudconnectionsDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteGone %+v", 410, o.Payload) } +func (o *PcloudCloudconnectionsDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudCloudconnectionsDeleteInternalServerError() *PcloudCloudconnection return &PcloudCloudconnectionsDeleteInternalServerError{} } -/*PcloudCloudconnectionsDeleteInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudCloudconnectionsDeleteInternalServerError struct { func (o *PcloudCloudconnectionsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go index 8a8f4d40f9..16a386f8d2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudconnectionsGetParams creates a new PcloudCloudconnectionsGetParams object -// with the default values initialized. +// NewPcloudCloudconnectionsGetParams creates a new PcloudCloudconnectionsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsGetParams() *PcloudCloudconnectionsGetParams { - var () return &PcloudCloudconnectionsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsGetParamsWithTimeout creates a new PcloudCloudconnectionsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetParams { - var () return &PcloudCloudconnectionsGetParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsGetParamsWithContext creates a new PcloudCloudconnectionsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsGetParamsWithContext(ctx context.Context) *PcloudCloudconnectionsGetParams { - var () return &PcloudCloudconnectionsGetParams{ - Context: ctx, } } // NewPcloudCloudconnectionsGetParamsWithHTTPClient creates a new PcloudCloudconnectionsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsGetParams { - var () return &PcloudCloudconnectionsGetParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections get operation typically these are written to a http.Request +/* PcloudCloudconnectionsGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections get operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsGetParams struct { - /*CloudConnectionID - Cloud Connection ID + /* CloudConnectionID. + Cloud Connection ID */ CloudConnectionID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -77,6 +76,21 @@ type PcloudCloudconnectionsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsGetParams) WithDefaults() *PcloudCloudconnectionsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections get params func (o *PcloudCloudconnectionsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go index 52b0f7e391..5a75e69a4c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsGetReader is a Reader for the PcloudCloudconnectionsGet structure. @@ -24,44 +23,38 @@ type PcloudCloudconnectionsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudconnectionsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudconnectionsGetOK() *PcloudCloudconnectionsGetOK { return &PcloudCloudconnectionsGetOK{} } -/*PcloudCloudconnectionsGetOK handles this case with default header values. +/* PcloudCloudconnectionsGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudconnectionsGetOK struct { func (o *PcloudCloudconnectionsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsGetOK) GetPayload() *models.CloudConnection { + return o.Payload +} func (o *PcloudCloudconnectionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudconnectionsGetBadRequest() *PcloudCloudconnectionsGetBadReque return &PcloudCloudconnectionsGetBadRequest{} } -/*PcloudCloudconnectionsGetBadRequest handles this case with default header values. +/* PcloudCloudconnectionsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudconnectionsGetBadRequest struct { func (o *PcloudCloudconnectionsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudconnectionsGetUnauthorized() *PcloudCloudconnectionsGetUnauth return &PcloudCloudconnectionsGetUnauthorized{} } -/*PcloudCloudconnectionsGetUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudconnectionsGetUnauthorized struct { func (o *PcloudCloudconnectionsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudconnectionsGetNotFound() *PcloudCloudconnectionsGetNotFound { return &PcloudCloudconnectionsGetNotFound{} } -/*PcloudCloudconnectionsGetNotFound handles this case with default header values. +/* PcloudCloudconnectionsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudconnectionsGetNotFound struct { func (o *PcloudCloudconnectionsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudconnectionsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudconnectionsGetInternalServerError() *PcloudCloudconnectionsGe return &PcloudCloudconnectionsGetInternalServerError{} } -/*PcloudCloudconnectionsGetInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudconnectionsGetInternalServerError struct { func (o *PcloudCloudconnectionsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go index 69487e593e..ab74a7af06 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudconnectionsGetallParams creates a new PcloudCloudconnectionsGetallParams object -// with the default values initialized. +// NewPcloudCloudconnectionsGetallParams creates a new PcloudCloudconnectionsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsGetallParams() *PcloudCloudconnectionsGetallParams { - var () return &PcloudCloudconnectionsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsGetallParamsWithTimeout creates a new PcloudCloudconnectionsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetallParams { - var () return &PcloudCloudconnectionsGetallParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsGetallParamsWithContext creates a new PcloudCloudconnectionsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsGetallParamsWithContext(ctx context.Context) *PcloudCloudconnectionsGetallParams { - var () return &PcloudCloudconnectionsGetallParams{ - Context: ctx, } } // NewPcloudCloudconnectionsGetallParamsWithHTTPClient creates a new PcloudCloudconnectionsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsGetallParams { - var () return &PcloudCloudconnectionsGetallParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections getall operation typically these are written to a http.Request +/* PcloudCloudconnectionsGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudCloudconnectionsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsGetallParams) WithDefaults() *PcloudCloudconnectionsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections getall params func (o *PcloudCloudconnectionsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go index 262aea8f52..f096d6de76 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsGetallReader is a Reader for the PcloudCloudconnectionsGetall structure. @@ -24,44 +23,38 @@ type PcloudCloudconnectionsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 408: result := NewPcloudCloudconnectionsGetallRequestTimeout() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudconnectionsGetallOK() *PcloudCloudconnectionsGetallOK { return &PcloudCloudconnectionsGetallOK{} } -/*PcloudCloudconnectionsGetallOK handles this case with default header values. +/* PcloudCloudconnectionsGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudconnectionsGetallOK struct { func (o *PcloudCloudconnectionsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsGetallOK) GetPayload() *models.CloudConnections { + return o.Payload +} func (o *PcloudCloudconnectionsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudconnectionsGetallBadRequest() *PcloudCloudconnectionsGetallBa return &PcloudCloudconnectionsGetallBadRequest{} } -/*PcloudCloudconnectionsGetallBadRequest handles this case with default header values. +/* PcloudCloudconnectionsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudconnectionsGetallBadRequest struct { func (o *PcloudCloudconnectionsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudconnectionsGetallUnauthorized() *PcloudCloudconnectionsGetall return &PcloudCloudconnectionsGetallUnauthorized{} } -/*PcloudCloudconnectionsGetallUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudconnectionsGetallUnauthorized struct { func (o *PcloudCloudconnectionsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudconnectionsGetallRequestTimeout() *PcloudCloudconnectionsGeta return &PcloudCloudconnectionsGetallRequestTimeout{} } -/*PcloudCloudconnectionsGetallRequestTimeout handles this case with default header values. +/* PcloudCloudconnectionsGetallRequestTimeout describes a response with status code 408, with default header values. Request Timeout */ @@ -168,6 +170,9 @@ type PcloudCloudconnectionsGetallRequestTimeout struct { func (o *PcloudCloudconnectionsGetallRequestTimeout) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallRequestTimeout %+v", 408, o.Payload) } +func (o *PcloudCloudconnectionsGetallRequestTimeout) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetallRequestTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudconnectionsGetallInternalServerError() *PcloudCloudconnection return &PcloudCloudconnectionsGetallInternalServerError{} } -/*PcloudCloudconnectionsGetallInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudconnectionsGetallInternalServerError struct { func (o *PcloudCloudconnectionsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go index e28101d3dd..e3c9466d43 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudconnectionsNetworksDeleteParams creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the default values initialized. +// NewPcloudCloudconnectionsNetworksDeleteParams creates a new PcloudCloudconnectionsNetworksDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsNetworksDeleteParams() *PcloudCloudconnectionsNetworksDeleteParams { - var () return &PcloudCloudconnectionsNetworksDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsNetworksDeleteParamsWithTimeout creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksDeleteParams { - var () return &PcloudCloudconnectionsNetworksDeleteParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsNetworksDeleteParamsWithContext creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsNetworksDeleteParamsWithContext(ctx context.Context) *PcloudCloudconnectionsNetworksDeleteParams { - var () return &PcloudCloudconnectionsNetworksDeleteParams{ - Context: ctx, } } // NewPcloudCloudconnectionsNetworksDeleteParamsWithHTTPClient creates a new PcloudCloudconnectionsNetworksDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksDeleteParams { - var () return &PcloudCloudconnectionsNetworksDeleteParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsNetworksDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections networks delete operation typically these are written to a http.Request +/* PcloudCloudconnectionsNetworksDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections networks delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsNetworksDeleteParams struct { - /*CloudConnectionID - Cloud Connection ID + /* CloudConnectionID. + Cloud Connection ID */ CloudConnectionID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -82,6 +82,21 @@ type PcloudCloudconnectionsNetworksDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsNetworksDeleteParams) WithDefaults() *PcloudCloudconnectionsNetworksDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsNetworksDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections networks delete params func (o *PcloudCloudconnectionsNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go index 7dfc62131c..0213702851 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsNetworksDeleteReader is a Reader for the PcloudCloudconnectionsNetworksDelete structure. @@ -24,51 +23,44 @@ type PcloudCloudconnectionsNetworksDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsNetworksDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudCloudconnectionsNetworksDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsNetworksDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsNetworksDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudCloudconnectionsNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsNetworksDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudconnectionsNetworksDeleteOK() *PcloudCloudconnectionsNetworks return &PcloudCloudconnectionsNetworksDeleteOK{} } -/*PcloudCloudconnectionsNetworksDeleteOK handles this case with default header values. +/* PcloudCloudconnectionsNetworksDeleteOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudCloudconnectionsNetworksDeleteOK struct { func (o *PcloudCloudconnectionsNetworksDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsNetworksDeleteOK) GetPayload() *models.CloudConnection { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudCloudconnectionsNetworksDeleteAccepted() *PcloudCloudconnectionsNe return &PcloudCloudconnectionsNetworksDeleteAccepted{} } -/*PcloudCloudconnectionsNetworksDeleteAccepted handles this case with default header values. +/* PcloudCloudconnectionsNetworksDeleteAccepted describes a response with status code 202, with default header values. Accepted */ @@ -117,6 +112,9 @@ type PcloudCloudconnectionsNetworksDeleteAccepted struct { func (o *PcloudCloudconnectionsNetworksDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudconnectionsNetworksDeleteAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudCloudconnectionsNetworksDeleteBadRequest() *PcloudCloudconnections return &PcloudCloudconnectionsNetworksDeleteBadRequest{} } -/*PcloudCloudconnectionsNetworksDeleteBadRequest handles this case with default header values. +/* PcloudCloudconnectionsNetworksDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -146,6 +144,9 @@ type PcloudCloudconnectionsNetworksDeleteBadRequest struct { func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudCloudconnectionsNetworksDeleteUnauthorized() *PcloudCloudconnectio return &PcloudCloudconnectionsNetworksDeleteUnauthorized{} } -/*PcloudCloudconnectionsNetworksDeleteUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsNetworksDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -175,6 +176,9 @@ type PcloudCloudconnectionsNetworksDeleteUnauthorized struct { func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudCloudconnectionsNetworksDeleteGone() *PcloudCloudconnectionsNetwor return &PcloudCloudconnectionsNetworksDeleteGone{} } -/*PcloudCloudconnectionsNetworksDeleteGone handles this case with default header values. +/* PcloudCloudconnectionsNetworksDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -204,6 +208,9 @@ type PcloudCloudconnectionsNetworksDeleteGone struct { func (o *PcloudCloudconnectionsNetworksDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteGone %+v", 410, o.Payload) } +func (o *PcloudCloudconnectionsNetworksDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudCloudconnectionsNetworksDeleteInternalServerError() *PcloudCloudco return &PcloudCloudconnectionsNetworksDeleteInternalServerError{} } -/*PcloudCloudconnectionsNetworksDeleteInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsNetworksDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudCloudconnectionsNetworksDeleteInternalServerError struct { func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go index fae9bbd573..c19e5e7ad4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudconnectionsNetworksPutParams creates a new PcloudCloudconnectionsNetworksPutParams object -// with the default values initialized. +// NewPcloudCloudconnectionsNetworksPutParams creates a new PcloudCloudconnectionsNetworksPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsNetworksPutParams() *PcloudCloudconnectionsNetworksPutParams { - var () return &PcloudCloudconnectionsNetworksPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsNetworksPutParamsWithTimeout creates a new PcloudCloudconnectionsNetworksPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsNetworksPutParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksPutParams { - var () return &PcloudCloudconnectionsNetworksPutParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsNetworksPutParamsWithContext creates a new PcloudCloudconnectionsNetworksPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsNetworksPutParamsWithContext(ctx context.Context) *PcloudCloudconnectionsNetworksPutParams { - var () return &PcloudCloudconnectionsNetworksPutParams{ - Context: ctx, } } // NewPcloudCloudconnectionsNetworksPutParamsWithHTTPClient creates a new PcloudCloudconnectionsNetworksPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsNetworksPutParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsNetworksPutParams { - var () return &PcloudCloudconnectionsNetworksPutParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsNetworksPutParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections networks put operation typically these are written to a http.Request +/* PcloudCloudconnectionsNetworksPutParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections networks put operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsNetworksPutParams struct { - /*CloudConnectionID - Cloud Connection ID + /* CloudConnectionID. + Cloud Connection ID */ CloudConnectionID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -82,6 +82,21 @@ type PcloudCloudconnectionsNetworksPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections networks put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsNetworksPutParams) WithDefaults() *PcloudCloudconnectionsNetworksPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections networks put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsNetworksPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections networks put params func (o *PcloudCloudconnectionsNetworksPutParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsNetworksPutParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go index d90ce0a35d..e4abe1cc08 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsNetworksPutReader is a Reader for the PcloudCloudconnectionsNetworksPut structure. @@ -24,51 +23,44 @@ type PcloudCloudconnectionsNetworksPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsNetworksPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudCloudconnectionsNetworksPutAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsNetworksPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsNetworksPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudconnectionsNetworksPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsNetworksPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudconnectionsNetworksPutOK() *PcloudCloudconnectionsNetworksPut return &PcloudCloudconnectionsNetworksPutOK{} } -/*PcloudCloudconnectionsNetworksPutOK handles this case with default header values. +/* PcloudCloudconnectionsNetworksPutOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudCloudconnectionsNetworksPutOK struct { func (o *PcloudCloudconnectionsNetworksPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsNetworksPutOK) GetPayload() *models.CloudConnection { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudCloudconnectionsNetworksPutAccepted() *PcloudCloudconnectionsNetwo return &PcloudCloudconnectionsNetworksPutAccepted{} } -/*PcloudCloudconnectionsNetworksPutAccepted handles this case with default header values. +/* PcloudCloudconnectionsNetworksPutAccepted describes a response with status code 202, with default header values. Accepted */ @@ -117,6 +112,9 @@ type PcloudCloudconnectionsNetworksPutAccepted struct { func (o *PcloudCloudconnectionsNetworksPutAccepted) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudconnectionsNetworksPutAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudCloudconnectionsNetworksPutBadRequest() *PcloudCloudconnectionsNet return &PcloudCloudconnectionsNetworksPutBadRequest{} } -/*PcloudCloudconnectionsNetworksPutBadRequest handles this case with default header values. +/* PcloudCloudconnectionsNetworksPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -146,6 +144,9 @@ type PcloudCloudconnectionsNetworksPutBadRequest struct { func (o *PcloudCloudconnectionsNetworksPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsNetworksPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudCloudconnectionsNetworksPutUnauthorized() *PcloudCloudconnectionsN return &PcloudCloudconnectionsNetworksPutUnauthorized{} } -/*PcloudCloudconnectionsNetworksPutUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsNetworksPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -175,6 +176,9 @@ type PcloudCloudconnectionsNetworksPutUnauthorized struct { func (o *PcloudCloudconnectionsNetworksPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsNetworksPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudCloudconnectionsNetworksPutUnprocessableEntity() *PcloudCloudconne return &PcloudCloudconnectionsNetworksPutUnprocessableEntity{} } -/*PcloudCloudconnectionsNetworksPutUnprocessableEntity handles this case with default header values. +/* PcloudCloudconnectionsNetworksPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudCloudconnectionsNetworksPutUnprocessableEntity struct { func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudCloudconnectionsNetworksPutInternalServerError() *PcloudCloudconne return &PcloudCloudconnectionsNetworksPutInternalServerError{} } -/*PcloudCloudconnectionsNetworksPutInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsNetworksPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudCloudconnectionsNetworksPutInternalServerError struct { func (o *PcloudCloudconnectionsNetworksPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsNetworksPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsNetworksPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go index 7e0d595df4..71ee602f8c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudconnectionsPostParams creates a new PcloudCloudconnectionsPostParams object -// with the default values initialized. +// NewPcloudCloudconnectionsPostParams creates a new PcloudCloudconnectionsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsPostParams() *PcloudCloudconnectionsPostParams { - var () return &PcloudCloudconnectionsPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsPostParamsWithTimeout creates a new PcloudCloudconnectionsPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsPostParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsPostParams { - var () return &PcloudCloudconnectionsPostParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsPostParamsWithContext creates a new PcloudCloudconnectionsPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsPostParamsWithContext(ctx context.Context) *PcloudCloudconnectionsPostParams { - var () return &PcloudCloudconnectionsPostParams{ - Context: ctx, } } // NewPcloudCloudconnectionsPostParamsWithHTTPClient creates a new PcloudCloudconnectionsPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsPostParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsPostParams { - var () return &PcloudCloudconnectionsPostParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsPostParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections post operation typically these are written to a http.Request +/* PcloudCloudconnectionsPostParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections post operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsPostParams struct { - /*Body - Parameters for the creation of a new cloud connection + /* Body. + Parameters for the creation of a new cloud connection */ Body *models.CloudConnectionCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudCloudconnectionsPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsPostParams) WithDefaults() *PcloudCloudconnectionsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections post params func (o *PcloudCloudconnectionsPostParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudCloudconnectionsPostParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go index 209112b04a..b0f46e4e92 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsPostReader is a Reader for the PcloudCloudconnectionsPost structure. @@ -24,65 +23,56 @@ type PcloudCloudconnectionsPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewPcloudCloudconnectionsPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudCloudconnectionsPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudCloudconnectionsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudconnectionsPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -91,7 +81,7 @@ func NewPcloudCloudconnectionsPostOK() *PcloudCloudconnectionsPostOK { return &PcloudCloudconnectionsPostOK{} } -/*PcloudCloudconnectionsPostOK handles this case with default header values. +/* PcloudCloudconnectionsPostOK describes a response with status code 200, with default header values. OK */ @@ -102,6 +92,9 @@ type PcloudCloudconnectionsPostOK struct { func (o *PcloudCloudconnectionsPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsPostOK) GetPayload() *models.CloudConnection { + return o.Payload +} func (o *PcloudCloudconnectionsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -120,7 +113,7 @@ func NewPcloudCloudconnectionsPostCreated() *PcloudCloudconnectionsPostCreated { return &PcloudCloudconnectionsPostCreated{} } -/*PcloudCloudconnectionsPostCreated handles this case with default header values. +/* PcloudCloudconnectionsPostCreated describes a response with status code 201, with default header values. Created */ @@ -131,6 +124,9 @@ type PcloudCloudconnectionsPostCreated struct { func (o *PcloudCloudconnectionsPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostCreated %+v", 201, o.Payload) } +func (o *PcloudCloudconnectionsPostCreated) GetPayload() *models.CloudConnection { + return o.Payload +} func (o *PcloudCloudconnectionsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -149,7 +145,7 @@ func NewPcloudCloudconnectionsPostAccepted() *PcloudCloudconnectionsPostAccepted return &PcloudCloudconnectionsPostAccepted{} } -/*PcloudCloudconnectionsPostAccepted handles this case with default header values. +/* PcloudCloudconnectionsPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -160,6 +156,9 @@ type PcloudCloudconnectionsPostAccepted struct { func (o *PcloudCloudconnectionsPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudconnectionsPostAccepted) GetPayload() *models.CloudConnectionCreateResponse { + return o.Payload +} func (o *PcloudCloudconnectionsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -178,7 +177,7 @@ func NewPcloudCloudconnectionsPostBadRequest() *PcloudCloudconnectionsPostBadReq return &PcloudCloudconnectionsPostBadRequest{} } -/*PcloudCloudconnectionsPostBadRequest handles this case with default header values. +/* PcloudCloudconnectionsPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -189,6 +188,9 @@ type PcloudCloudconnectionsPostBadRequest struct { func (o *PcloudCloudconnectionsPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,7 +209,7 @@ func NewPcloudCloudconnectionsPostUnauthorized() *PcloudCloudconnectionsPostUnau return &PcloudCloudconnectionsPostUnauthorized{} } -/*PcloudCloudconnectionsPostUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -218,6 +220,9 @@ type PcloudCloudconnectionsPostUnauthorized struct { func (o *PcloudCloudconnectionsPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -236,7 +241,7 @@ func NewPcloudCloudconnectionsPostConflict() *PcloudCloudconnectionsPostConflict return &PcloudCloudconnectionsPostConflict{} } -/*PcloudCloudconnectionsPostConflict handles this case with default header values. +/* PcloudCloudconnectionsPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -247,6 +252,9 @@ type PcloudCloudconnectionsPostConflict struct { func (o *PcloudCloudconnectionsPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostConflict %+v", 409, o.Payload) } +func (o *PcloudCloudconnectionsPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -265,7 +273,7 @@ func NewPcloudCloudconnectionsPostUnprocessableEntity() *PcloudCloudconnectionsP return &PcloudCloudconnectionsPostUnprocessableEntity{} } -/*PcloudCloudconnectionsPostUnprocessableEntity handles this case with default header values. +/* PcloudCloudconnectionsPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -276,6 +284,9 @@ type PcloudCloudconnectionsPostUnprocessableEntity struct { func (o *PcloudCloudconnectionsPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudconnectionsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -294,7 +305,7 @@ func NewPcloudCloudconnectionsPostInternalServerError() *PcloudCloudconnectionsP return &PcloudCloudconnectionsPostInternalServerError{} } -/*PcloudCloudconnectionsPostInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -305,6 +316,9 @@ type PcloudCloudconnectionsPostInternalServerError struct { func (o *PcloudCloudconnectionsPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go index 902efdd5cd..136980886a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudconnectionsPutParams creates a new PcloudCloudconnectionsPutParams object -// with the default values initialized. +// NewPcloudCloudconnectionsPutParams creates a new PcloudCloudconnectionsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsPutParams() *PcloudCloudconnectionsPutParams { - var () return &PcloudCloudconnectionsPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsPutParamsWithTimeout creates a new PcloudCloudconnectionsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsPutParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsPutParams { - var () return &PcloudCloudconnectionsPutParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsPutParamsWithContext creates a new PcloudCloudconnectionsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsPutParamsWithContext(ctx context.Context) *PcloudCloudconnectionsPutParams { - var () return &PcloudCloudconnectionsPutParams{ - Context: ctx, } } // NewPcloudCloudconnectionsPutParamsWithHTTPClient creates a new PcloudCloudconnectionsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsPutParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsPutParams { - var () return &PcloudCloudconnectionsPutParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsPutParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections put operation typically these are written to a http.Request +/* PcloudCloudconnectionsPutParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections put operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsPutParams struct { - /*Body - Parameters to update a Cloud Connection + /* Body. + Parameters to update a Cloud Connection */ Body *models.CloudConnectionUpdate - /*CloudConnectionID - Cloud Connection ID + /* CloudConnectionID. + + Cloud Connection ID */ CloudConnectionID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -84,6 +84,21 @@ type PcloudCloudconnectionsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsPutParams) WithDefaults() *PcloudCloudconnectionsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections put params func (o *PcloudCloudconnectionsPutParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudCloudconnectionsPutParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go index eb9837c03d..1eaec8d50d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsPutReader is a Reader for the PcloudCloudconnectionsPut structure. @@ -24,72 +23,62 @@ type PcloudCloudconnectionsPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudCloudconnectionsPutAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudconnectionsPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 405: result := NewPcloudCloudconnectionsPutMethodNotAllowed() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudCloudconnectionsPutConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudconnectionsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -98,7 +87,7 @@ func NewPcloudCloudconnectionsPutOK() *PcloudCloudconnectionsPutOK { return &PcloudCloudconnectionsPutOK{} } -/*PcloudCloudconnectionsPutOK handles this case with default header values. +/* PcloudCloudconnectionsPutOK describes a response with status code 200, with default header values. OK */ @@ -109,6 +98,9 @@ type PcloudCloudconnectionsPutOK struct { func (o *PcloudCloudconnectionsPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsPutOK) GetPayload() *models.CloudConnection { + return o.Payload +} func (o *PcloudCloudconnectionsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -127,7 +119,7 @@ func NewPcloudCloudconnectionsPutAccepted() *PcloudCloudconnectionsPutAccepted { return &PcloudCloudconnectionsPutAccepted{} } -/*PcloudCloudconnectionsPutAccepted handles this case with default header values. +/* PcloudCloudconnectionsPutAccepted describes a response with status code 202, with default header values. Accepted */ @@ -138,6 +130,9 @@ type PcloudCloudconnectionsPutAccepted struct { func (o *PcloudCloudconnectionsPutAccepted) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudconnectionsPutAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudCloudconnectionsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -156,7 +151,7 @@ func NewPcloudCloudconnectionsPutBadRequest() *PcloudCloudconnectionsPutBadReque return &PcloudCloudconnectionsPutBadRequest{} } -/*PcloudCloudconnectionsPutBadRequest handles this case with default header values. +/* PcloudCloudconnectionsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -167,6 +162,9 @@ type PcloudCloudconnectionsPutBadRequest struct { func (o *PcloudCloudconnectionsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -185,7 +183,7 @@ func NewPcloudCloudconnectionsPutUnauthorized() *PcloudCloudconnectionsPutUnauth return &PcloudCloudconnectionsPutUnauthorized{} } -/*PcloudCloudconnectionsPutUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -196,6 +194,9 @@ type PcloudCloudconnectionsPutUnauthorized struct { func (o *PcloudCloudconnectionsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,7 +215,7 @@ func NewPcloudCloudconnectionsPutNotFound() *PcloudCloudconnectionsPutNotFound { return &PcloudCloudconnectionsPutNotFound{} } -/*PcloudCloudconnectionsPutNotFound handles this case with default header values. +/* PcloudCloudconnectionsPutNotFound describes a response with status code 404, with default header values. Not Found */ @@ -225,6 +226,9 @@ type PcloudCloudconnectionsPutNotFound struct { func (o *PcloudCloudconnectionsPutNotFound) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudconnectionsPutNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -243,7 +247,7 @@ func NewPcloudCloudconnectionsPutMethodNotAllowed() *PcloudCloudconnectionsPutMe return &PcloudCloudconnectionsPutMethodNotAllowed{} } -/*PcloudCloudconnectionsPutMethodNotAllowed handles this case with default header values. +/* PcloudCloudconnectionsPutMethodNotAllowed describes a response with status code 405, with default header values. Method Not Allowed */ @@ -254,6 +258,9 @@ type PcloudCloudconnectionsPutMethodNotAllowed struct { func (o *PcloudCloudconnectionsPutMethodNotAllowed) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutMethodNotAllowed %+v", 405, o.Payload) } +func (o *PcloudCloudconnectionsPutMethodNotAllowed) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -272,7 +279,7 @@ func NewPcloudCloudconnectionsPutConflict() *PcloudCloudconnectionsPutConflict { return &PcloudCloudconnectionsPutConflict{} } -/*PcloudCloudconnectionsPutConflict handles this case with default header values. +/* PcloudCloudconnectionsPutConflict describes a response with status code 409, with default header values. Conflict */ @@ -283,6 +290,9 @@ type PcloudCloudconnectionsPutConflict struct { func (o *PcloudCloudconnectionsPutConflict) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutConflict %+v", 409, o.Payload) } +func (o *PcloudCloudconnectionsPutConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -301,7 +311,7 @@ func NewPcloudCloudconnectionsPutUnprocessableEntity() *PcloudCloudconnectionsPu return &PcloudCloudconnectionsPutUnprocessableEntity{} } -/*PcloudCloudconnectionsPutUnprocessableEntity handles this case with default header values. +/* PcloudCloudconnectionsPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -312,6 +322,9 @@ type PcloudCloudconnectionsPutUnprocessableEntity struct { func (o *PcloudCloudconnectionsPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudconnectionsPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -330,7 +343,7 @@ func NewPcloudCloudconnectionsPutInternalServerError() *PcloudCloudconnectionsPu return &PcloudCloudconnectionsPutInternalServerError{} } -/*PcloudCloudconnectionsPutInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -341,6 +354,9 @@ type PcloudCloudconnectionsPutInternalServerError struct { func (o *PcloudCloudconnectionsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go index 540fd66631..6cc7c04cd6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the default values initialized. +// NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams() *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - var () return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithTimeout creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - var () return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - timeout: timeout, } } // NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithContext creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithContext(ctx context.Context) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - var () return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ - Context: ctx, } } // NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithHTTPClient creates a new PcloudCloudconnectionsVirtualprivatecloudsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudconnectionsVirtualprivatecloudsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { - var () return &PcloudCloudconnectionsVirtualprivatecloudsGetallParams{ HTTPClient: client, } } -/*PcloudCloudconnectionsVirtualprivatecloudsGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudconnections virtualprivateclouds getall operation typically these are written to a http.Request +/* PcloudCloudconnectionsVirtualprivatecloudsGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudconnections virtualprivateclouds getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudconnectionsVirtualprivatecloudsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudconnections virtualprivateclouds getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithDefaults() *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudconnections virtualprivateclouds getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudconnections virtualprivateclouds getall params func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudconnectionsVirtualprivatecloudsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go index 971f611f48..ad162ef31e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudconnectionsVirtualprivatecloudsGetallReader is a Reader for the PcloudCloudconnectionsVirtualprivatecloudsGetall structure. @@ -24,37 +23,32 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudCloudconnectionsVirtualprivatecloudsGetallOK() *PcloudCloudconnect return &PcloudCloudconnectionsVirtualprivatecloudsGetallOK{} } -/*PcloudCloudconnectionsVirtualprivatecloudsGetallOK handles this case with default header values. +/* PcloudCloudconnectionsVirtualprivatecloudsGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallOK struct { func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) GetPayload() *models.CloudConnectionVirtualPrivateClouds { + return o.Payload +} func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest() *PcloudClou return &PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest{} } -/*PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest handles this case with default header values. +/* PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest struct { func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized() *PcloudCl return &PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized{} } -/*PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized handles this case with default header values. +/* PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized struct { func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError() *P return &PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError{} } -/*PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError handles this case with default header values. +/* PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError struct func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go index 41cd2f13cf..7305a15619 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go @@ -6,13 +6,14 @@ package p_cloud_events // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud events API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,27 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetOK, error) + + PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetqueryOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudEventsGet gets a single event + PcloudEventsGet gets a single event */ -func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudEventsGetOK, error) { +func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudEventsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.events.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}", @@ -45,24 +57,34 @@ func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudEventsGetOK), nil - + success, ok := result.(*PcloudEventsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.events.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudEventsGetquery gets events from this cloud instance since a specific timestamp + PcloudEventsGetquery gets events from this cloud instance since a specific timestamp */ -func (a *Client) PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudEventsGetqueryOK, error) { +func (a *Client) PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetqueryOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudEventsGetqueryParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.events.getquery", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/events", @@ -74,12 +96,23 @@ func (a *Client) PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authIn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudEventsGetqueryOK), nil - + success, ok := result.(*PcloudEventsGetqueryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.events.getquery: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_parameters.go index 459c4f0ef8..a2b5d98e84 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudEventsGetParams creates a new PcloudEventsGetParams object -// with the default values initialized. +// NewPcloudEventsGetParams creates a new PcloudEventsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudEventsGetParams() *PcloudEventsGetParams { - var () return &PcloudEventsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudEventsGetParamsWithTimeout creates a new PcloudEventsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudEventsGetParamsWithTimeout(timeout time.Duration) *PcloudEventsGetParams { - var () return &PcloudEventsGetParams{ - timeout: timeout, } } // NewPcloudEventsGetParamsWithContext creates a new PcloudEventsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudEventsGetParamsWithContext(ctx context.Context) *PcloudEventsGetParams { - var () return &PcloudEventsGetParams{ - Context: ctx, } } // NewPcloudEventsGetParamsWithHTTPClient creates a new PcloudEventsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudEventsGetParamsWithHTTPClient(client *http.Client) *PcloudEventsGetParams { - var () return &PcloudEventsGetParams{ HTTPClient: client, } } -/*PcloudEventsGetParams contains all the parameters to send to the API endpoint -for the pcloud events get operation typically these are written to a http.Request +/* PcloudEventsGetParams contains all the parameters to send to the API endpoint + for the pcloud events get operation. + + Typically these are written to a http.Request. */ type PcloudEventsGetParams struct { - /*AcceptLanguage - The language requested for the return document + /* AcceptLanguage. + The language requested for the return document */ AcceptLanguage *string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*EventID - Event ID + /* EventID. + + Event ID */ EventID string @@ -82,6 +82,21 @@ type PcloudEventsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud events get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudEventsGetParams) WithDefaults() *PcloudEventsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud events get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudEventsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud events get params func (o *PcloudEventsGetParams) WithTimeout(timeout time.Duration) *PcloudEventsGetParams { o.SetTimeout(timeout) @@ -162,7 +177,6 @@ func (o *PcloudEventsGetParams) WriteToRequest(r runtime.ClientRequest, reg strf if err := r.SetHeaderParam("Accept-Language", *o.AcceptLanguage); err != nil { return err } - } // path param cloud_instance_id diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go index 0285dc7a2c..ff28ed2648 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudEventsGetReader is a Reader for the PcloudEventsGet structure. @@ -24,44 +23,38 @@ type PcloudEventsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudEventsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudEventsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudEventsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudEventsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudEventsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudEventsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudEventsGetOK() *PcloudEventsGetOK { return &PcloudEventsGetOK{} } -/*PcloudEventsGetOK handles this case with default header values. +/* PcloudEventsGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudEventsGetOK struct { func (o *PcloudEventsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetOK %+v", 200, o.Payload) } +func (o *PcloudEventsGetOK) GetPayload() *models.Event { + return o.Payload +} func (o *PcloudEventsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudEventsGetBadRequest() *PcloudEventsGetBadRequest { return &PcloudEventsGetBadRequest{} } -/*PcloudEventsGetBadRequest handles this case with default header values. +/* PcloudEventsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudEventsGetBadRequest struct { func (o *PcloudEventsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudEventsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudEventsGetUnauthorized() *PcloudEventsGetUnauthorized { return &PcloudEventsGetUnauthorized{} } -/*PcloudEventsGetUnauthorized handles this case with default header values. +/* PcloudEventsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudEventsGetUnauthorized struct { func (o *PcloudEventsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudEventsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudEventsGetNotFound() *PcloudEventsGetNotFound { return &PcloudEventsGetNotFound{} } -/*PcloudEventsGetNotFound handles this case with default header values. +/* PcloudEventsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudEventsGetNotFound struct { func (o *PcloudEventsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudEventsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudEventsGetInternalServerError() *PcloudEventsGetInternalServerError return &PcloudEventsGetInternalServerError{} } -/*PcloudEventsGetInternalServerError handles this case with default header values. +/* PcloudEventsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudEventsGetInternalServerError struct { func (o *PcloudEventsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudEventsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go index 83d27dcfde..4ee037fa96 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go @@ -13,77 +13,79 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudEventsGetqueryParams creates a new PcloudEventsGetqueryParams object -// with the default values initialized. +// NewPcloudEventsGetqueryParams creates a new PcloudEventsGetqueryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudEventsGetqueryParams() *PcloudEventsGetqueryParams { - var () return &PcloudEventsGetqueryParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudEventsGetqueryParamsWithTimeout creates a new PcloudEventsGetqueryParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudEventsGetqueryParamsWithTimeout(timeout time.Duration) *PcloudEventsGetqueryParams { - var () return &PcloudEventsGetqueryParams{ - timeout: timeout, } } // NewPcloudEventsGetqueryParamsWithContext creates a new PcloudEventsGetqueryParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudEventsGetqueryParamsWithContext(ctx context.Context) *PcloudEventsGetqueryParams { - var () return &PcloudEventsGetqueryParams{ - Context: ctx, } } // NewPcloudEventsGetqueryParamsWithHTTPClient creates a new PcloudEventsGetqueryParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudEventsGetqueryParamsWithHTTPClient(client *http.Client) *PcloudEventsGetqueryParams { - var () return &PcloudEventsGetqueryParams{ HTTPClient: client, } } -/*PcloudEventsGetqueryParams contains all the parameters to send to the API endpoint -for the pcloud events getquery operation typically these are written to a http.Request +/* PcloudEventsGetqueryParams contains all the parameters to send to the API endpoint + for the pcloud events getquery operation. + + Typically these are written to a http.Request. */ type PcloudEventsGetqueryParams struct { - /*AcceptLanguage - The language requested for the return document + /* AcceptLanguage. + The language requested for the return document */ AcceptLanguage *string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*FromTime - A from query time in either ISO 8601 or unix epoch format + /* FromTime. + + A from query time in either ISO 8601 or unix epoch format */ FromTime *string - /*Time - (deprecated - use from_time) A time in either ISO 8601 or unix epoch format + /* Time. + + (deprecated - use from_time) A time in either ISO 8601 or unix epoch format */ Time *string - /*ToTime - A to query time in either ISO 8601 or unix epoch format + /* ToTime. + + A to query time in either ISO 8601 or unix epoch format */ ToTime *string @@ -92,6 +94,21 @@ type PcloudEventsGetqueryParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud events getquery params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudEventsGetqueryParams) WithDefaults() *PcloudEventsGetqueryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud events getquery params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudEventsGetqueryParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud events getquery params func (o *PcloudEventsGetqueryParams) WithTimeout(timeout time.Duration) *PcloudEventsGetqueryParams { o.SetTimeout(timeout) @@ -194,7 +211,6 @@ func (o *PcloudEventsGetqueryParams) WriteToRequest(r runtime.ClientRequest, reg if err := r.SetHeaderParam("Accept-Language", *o.AcceptLanguage); err != nil { return err } - } // path param cloud_instance_id @@ -206,48 +222,51 @@ func (o *PcloudEventsGetqueryParams) WriteToRequest(r runtime.ClientRequest, reg // query param from_time var qrFromTime string + if o.FromTime != nil { qrFromTime = *o.FromTime } qFromTime := qrFromTime if qFromTime != "" { + if err := r.SetQueryParam("from_time", qFromTime); err != nil { return err } } - } if o.Time != nil { // query param time var qrTime string + if o.Time != nil { qrTime = *o.Time } qTime := qrTime if qTime != "" { + if err := r.SetQueryParam("time", qTime); err != nil { return err } } - } if o.ToTime != nil { // query param to_time var qrToTime string + if o.ToTime != nil { qrToTime = *o.ToTime } qToTime := qrToTime if qToTime != "" { + if err := r.SetQueryParam("to_time", qToTime); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go index f608786401..b018f267f2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudEventsGetqueryReader is a Reader for the PcloudEventsGetquery structure. @@ -24,37 +23,32 @@ type PcloudEventsGetqueryReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudEventsGetqueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudEventsGetqueryOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudEventsGetqueryBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudEventsGetqueryUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudEventsGetqueryInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudEventsGetqueryOK() *PcloudEventsGetqueryOK { return &PcloudEventsGetqueryOK{} } -/*PcloudEventsGetqueryOK handles this case with default header values. +/* PcloudEventsGetqueryOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudEventsGetqueryOK struct { func (o *PcloudEventsGetqueryOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryOK %+v", 200, o.Payload) } +func (o *PcloudEventsGetqueryOK) GetPayload() *models.Events { + return o.Payload +} func (o *PcloudEventsGetqueryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudEventsGetqueryBadRequest() *PcloudEventsGetqueryBadRequest { return &PcloudEventsGetqueryBadRequest{} } -/*PcloudEventsGetqueryBadRequest handles this case with default header values. +/* PcloudEventsGetqueryBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudEventsGetqueryBadRequest struct { func (o *PcloudEventsGetqueryBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryBadRequest %+v", 400, o.Payload) } +func (o *PcloudEventsGetqueryBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetqueryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudEventsGetqueryUnauthorized() *PcloudEventsGetqueryUnauthorized { return &PcloudEventsGetqueryUnauthorized{} } -/*PcloudEventsGetqueryUnauthorized handles this case with default header values. +/* PcloudEventsGetqueryUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudEventsGetqueryUnauthorized struct { func (o *PcloudEventsGetqueryUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryUnauthorized %+v", 401, o.Payload) } +func (o *PcloudEventsGetqueryUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetqueryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudEventsGetqueryInternalServerError() *PcloudEventsGetqueryInternalS return &PcloudEventsGetqueryInternalServerError{} } -/*PcloudEventsGetqueryInternalServerError handles this case with default header values. +/* PcloudEventsGetqueryInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudEventsGetqueryInternalServerError struct { func (o *PcloudEventsGetqueryInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryInternalServerError %+v", 500, o.Payload) } +func (o *PcloudEventsGetqueryInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudEventsGetqueryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go index 25cccf7ae0..be0badf813 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go @@ -6,13 +6,14 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud images API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,49 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesDeleteOK, error) + + PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstancesImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesExportPostAccepted, error) + + PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetOK, error) + + PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetallOK, error) + + PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesPostOK, *PcloudCloudinstancesImagesPostCreated, error) + + PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstancesStockimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetOK, error) + + PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstancesStockimagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetallOK, error) + + PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetOK, error) + + PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetallOK, error) + + PcloudV1CloudinstancesCosimagesGet(params *PcloudV1CloudinstancesCosimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesGetOK, error) + + PcloudV1CloudinstancesCosimagesPost(params *PcloudV1CloudinstancesCosimagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesPostAccepted, error) + + PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportGetOK, error) + + PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportPostAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudCloudinstancesImagesDelete deletes an image from a cloud instance + PcloudCloudinstancesImagesDelete deletes an image from a cloud instance */ -func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesImagesDeleteOK, error) { +func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesImagesDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.images.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}", @@ -45,24 +79,34 @@ func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesIm AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesImagesDeleteOK), nil - + success, ok := result.(*PcloudCloudinstancesImagesDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesImagesExportPost exports an image + PcloudCloudinstancesImagesExportPost exports an image */ -func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstancesImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesImagesExportPostAccepted, error) { +func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstancesImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesExportPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesImagesExportPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.images.export.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export", @@ -74,24 +118,34 @@ func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstanc AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesImagesExportPostAccepted), nil - + success, ok := result.(*PcloudCloudinstancesImagesExportPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.export.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesImagesGet detaileds info of an image + PcloudCloudinstancesImagesGet detaileds info of an image */ -func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImagesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesImagesGetOK, error) { +func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesImagesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.images.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}", @@ -103,24 +157,34 @@ func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImage AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesImagesGetOK), nil - + success, ok := result.(*PcloudCloudinstancesImagesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesImagesGetall lists all images for this cloud instance + PcloudCloudinstancesImagesGetall lists all images for this cloud instance */ -func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesImagesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesImagesGetallOK, error) { +func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesImagesGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.images.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images", @@ -132,24 +196,34 @@ func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesIm AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesImagesGetallOK), nil - + success, ok := result.(*PcloudCloudinstancesImagesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesImagesPost creates a new image from available images + PcloudCloudinstancesImagesPost creates a new image from available images */ -func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImagesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesImagesPostOK, *PcloudCloudinstancesImagesPostCreated, error) { +func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesPostOK, *PcloudCloudinstancesImagesPostCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesImagesPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.images.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/images", @@ -161,7 +235,12 @@ func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImag AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -171,20 +250,20 @@ func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImag case *PcloudCloudinstancesImagesPostCreated: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_images: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesStockimagesGet detaileds info of an available stock image + PcloudCloudinstancesStockimagesGet detaileds info of an available stock image */ -func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstancesStockimagesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesStockimagesGetOK, error) { +func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstancesStockimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesStockimagesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.stockimages.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}", @@ -196,24 +275,34 @@ func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstances AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesStockimagesGetOK), nil - + success, ok := result.(*PcloudCloudinstancesStockimagesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.stockimages.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesStockimagesGetall lists all available stock images + PcloudCloudinstancesStockimagesGetall lists all available stock images */ -func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstancesStockimagesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesStockimagesGetallOK, error) { +func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstancesStockimagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesStockimagesGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.stockimages.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images", @@ -225,24 +314,34 @@ func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstan AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesStockimagesGetallOK), nil - + success, ok := result.(*PcloudCloudinstancesStockimagesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.stockimages.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudImagesGet deprecateds for pcloud v1 cloud instances cloud instance id stock images image id detailed info of an available stock image + PcloudImagesGet deprecateds for pcloud v1 cloud instances cloud instance id stock images image id detailed info of an available stock image */ -func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudImagesGetOK, error) { +func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudImagesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.images.get", Method: "GET", PathPattern: "/pcloud/v1/images/{image_id}", @@ -254,24 +353,34 @@ func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudImagesGetOK), nil - + success, ok := result.(*PcloudImagesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.images.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudImagesGetall deprecateds for pcloud v1 cloud instances cloud instance id stock images list all available stock images + PcloudImagesGetall deprecateds for pcloud v1 cloud instances cloud instance id stock images list all available stock images */ -func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudImagesGetallOK, error) { +func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudImagesGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.images.getall", Method: "GET", PathPattern: "/pcloud/v1/images", @@ -283,24 +392,34 @@ func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo r AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudImagesGetallOK), nil - + success, ok := result.(*PcloudImagesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.images.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV1CloudinstancesCosimagesGet gets detail of last cos image import job + PcloudV1CloudinstancesCosimagesGet gets detail of last cos image import job */ -func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1CloudinstancesCosimagesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV1CloudinstancesCosimagesGetOK, error) { +func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1CloudinstancesCosimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV1CloudinstancesCosimagesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v1.cloudinstances.cosimages.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images", @@ -312,24 +431,34 @@ func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1Cloudinstanc AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV1CloudinstancesCosimagesGetOK), nil - + success, ok := result.(*PcloudV1CloudinstancesCosimagesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v1.cloudinstances.cosimages.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV1CloudinstancesCosimagesPost creates an cos image import job + PcloudV1CloudinstancesCosimagesPost creates an cos image import job */ -func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1CloudinstancesCosimagesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV1CloudinstancesCosimagesPostAccepted, error) { +func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1CloudinstancesCosimagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV1CloudinstancesCosimagesPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v1.cloudinstances.cosimages.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images", @@ -341,24 +470,34 @@ func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1Cloudinstan AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV1CloudinstancesCosimagesPostAccepted), nil - + success, ok := result.(*PcloudV1CloudinstancesCosimagesPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v1.cloudinstances.cosimages.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2ImagesExportGet gets detail of last image export job + PcloudV2ImagesExportGet gets detail of last image export job */ -func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2ImagesExportGetOK, error) { +func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2ImagesExportGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.images.export.get", Method: "GET", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export", @@ -370,24 +509,34 @@ func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2ImagesExportGetOK), nil - + success, ok := result.(*PcloudV2ImagesExportGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.images.export.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2ImagesExportPost adds image export job to the jobs queue + PcloudV2ImagesExportPost adds image export job to the jobs queue */ -func (a *Client) PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2ImagesExportPostAccepted, error) { +func (a *Client) PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2ImagesExportPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.images.export.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export", @@ -399,12 +548,23 @@ func (a *Client) PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2ImagesExportPostAccepted), nil - + success, ok := result.(*PcloudV2ImagesExportPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.images.export.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go index aa70c0530d..36c1a384ab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesImagesDeleteParams creates a new PcloudCloudinstancesImagesDeleteParams object -// with the default values initialized. +// NewPcloudCloudinstancesImagesDeleteParams creates a new PcloudCloudinstancesImagesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesImagesDeleteParams() *PcloudCloudinstancesImagesDeleteParams { - var () return &PcloudCloudinstancesImagesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesImagesDeleteParamsWithTimeout creates a new PcloudCloudinstancesImagesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesImagesDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesDeleteParams { - var () return &PcloudCloudinstancesImagesDeleteParams{ - timeout: timeout, } } // NewPcloudCloudinstancesImagesDeleteParamsWithContext creates a new PcloudCloudinstancesImagesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesImagesDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesDeleteParams { - var () return &PcloudCloudinstancesImagesDeleteParams{ - Context: ctx, } } // NewPcloudCloudinstancesImagesDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesImagesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesImagesDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesDeleteParams { - var () return &PcloudCloudinstancesImagesDeleteParams{ HTTPClient: client, } } -/*PcloudCloudinstancesImagesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances images delete operation typically these are written to a http.Request +/* PcloudCloudinstancesImagesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances images delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesImagesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*ImageID - Image ID of a image + /* ImageID. + + Image ID of a image */ ImageID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesImagesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances images delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesDeleteParams) WithDefaults() *PcloudCloudinstancesImagesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances images delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances images delete params func (o *PcloudCloudinstancesImagesDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go index 180ec1184d..2771980097 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesImagesDeleteReader is a Reader for the PcloudCloudinstancesImagesDelete structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesImagesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesImagesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesImagesDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesImagesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesImagesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudCloudinstancesImagesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesImagesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesImagesDeleteOK() *PcloudCloudinstancesImagesDeleteOK return &PcloudCloudinstancesImagesDeleteOK{} } -/*PcloudCloudinstancesImagesDeleteOK handles this case with default header values. +/* PcloudCloudinstancesImagesDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesImagesDeleteOK struct { func (o *PcloudCloudinstancesImagesDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesImagesDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesImagesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudCloudinstancesImagesDeleteBadRequest() *PcloudCloudinstancesImages return &PcloudCloudinstancesImagesDeleteBadRequest{} } -/*PcloudCloudinstancesImagesDeleteBadRequest handles this case with default header values. +/* PcloudCloudinstancesImagesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudCloudinstancesImagesDeleteBadRequest struct { func (o *PcloudCloudinstancesImagesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesImagesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudCloudinstancesImagesDeleteUnauthorized() *PcloudCloudinstancesImag return &PcloudCloudinstancesImagesDeleteUnauthorized{} } -/*PcloudCloudinstancesImagesDeleteUnauthorized handles this case with default header values. +/* PcloudCloudinstancesImagesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudCloudinstancesImagesDeleteUnauthorized struct { func (o *PcloudCloudinstancesImagesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesImagesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudCloudinstancesImagesDeleteGone() *PcloudCloudinstancesImagesDelete return &PcloudCloudinstancesImagesDeleteGone{} } -/*PcloudCloudinstancesImagesDeleteGone handles this case with default header values. +/* PcloudCloudinstancesImagesDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudCloudinstancesImagesDeleteGone struct { func (o *PcloudCloudinstancesImagesDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteGone %+v", 410, o.Payload) } +func (o *PcloudCloudinstancesImagesDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudCloudinstancesImagesDeleteInternalServerError() *PcloudCloudinstan return &PcloudCloudinstancesImagesDeleteInternalServerError{} } -/*PcloudCloudinstancesImagesDeleteInternalServerError handles this case with default header values. +/* PcloudCloudinstancesImagesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudCloudinstancesImagesDeleteInternalServerError struct { func (o *PcloudCloudinstancesImagesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesImagesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go index afc5ec0957..ec3a6247a8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesImagesExportPostParams creates a new PcloudCloudinstancesImagesExportPostParams object -// with the default values initialized. +// NewPcloudCloudinstancesImagesExportPostParams creates a new PcloudCloudinstancesImagesExportPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesImagesExportPostParams() *PcloudCloudinstancesImagesExportPostParams { - var () return &PcloudCloudinstancesImagesExportPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesImagesExportPostParamsWithTimeout creates a new PcloudCloudinstancesImagesExportPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesImagesExportPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesExportPostParams { - var () return &PcloudCloudinstancesImagesExportPostParams{ - timeout: timeout, } } // NewPcloudCloudinstancesImagesExportPostParamsWithContext creates a new PcloudCloudinstancesImagesExportPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesImagesExportPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesExportPostParams { - var () return &PcloudCloudinstancesImagesExportPostParams{ - Context: ctx, } } // NewPcloudCloudinstancesImagesExportPostParamsWithHTTPClient creates a new PcloudCloudinstancesImagesExportPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesImagesExportPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesExportPostParams { - var () return &PcloudCloudinstancesImagesExportPostParams{ HTTPClient: client, } } -/*PcloudCloudinstancesImagesExportPostParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances images export post operation typically these are written to a http.Request +/* PcloudCloudinstancesImagesExportPostParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances images export post operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesImagesExportPostParams struct { - /*Body - Parameters for exporting an image + /* Body. + Parameters for exporting an image */ Body *models.ExportImage - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*ImageID - Image ID of a image + /* ImageID. + + Image ID of a image */ ImageID string @@ -84,6 +84,21 @@ type PcloudCloudinstancesImagesExportPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances images export post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesExportPostParams) WithDefaults() *PcloudCloudinstancesImagesExportPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances images export post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesExportPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances images export post params func (o *PcloudCloudinstancesImagesExportPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesExportPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudCloudinstancesImagesExportPostParams) WriteToRequest(r runtime.Cl return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go index 1c341c28d2..0b0a6a0b00 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesImagesExportPostReader is a Reader for the PcloudCloudinstancesImagesExportPost structure. @@ -24,51 +23,44 @@ type PcloudCloudinstancesImagesExportPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudCloudinstancesImagesExportPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesImagesExportPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesImagesExportPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesImagesExportPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudinstancesImagesExportPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesImagesExportPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudinstancesImagesExportPostAccepted() *PcloudCloudinstancesImag return &PcloudCloudinstancesImagesExportPostAccepted{} } -/*PcloudCloudinstancesImagesExportPostAccepted handles this case with default header values. +/* PcloudCloudinstancesImagesExportPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudCloudinstancesImagesExportPostAccepted struct { func (o *PcloudCloudinstancesImagesExportPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudinstancesImagesExportPostAccepted) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesImagesExportPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudCloudinstancesImagesExportPostBadRequest() *PcloudCloudinstancesIm return &PcloudCloudinstancesImagesExportPostBadRequest{} } -/*PcloudCloudinstancesImagesExportPostBadRequest handles this case with default header values. +/* PcloudCloudinstancesImagesExportPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -115,6 +110,9 @@ type PcloudCloudinstancesImagesExportPostBadRequest struct { func (o *PcloudCloudinstancesImagesExportPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesImagesExportPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesExportPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudCloudinstancesImagesExportPostUnauthorized() *PcloudCloudinstances return &PcloudCloudinstancesImagesExportPostUnauthorized{} } -/*PcloudCloudinstancesImagesExportPostUnauthorized handles this case with default header values. +/* PcloudCloudinstancesImagesExportPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -144,6 +142,9 @@ type PcloudCloudinstancesImagesExportPostUnauthorized struct { func (o *PcloudCloudinstancesImagesExportPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesImagesExportPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesExportPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudCloudinstancesImagesExportPostNotFound() *PcloudCloudinstancesImag return &PcloudCloudinstancesImagesExportPostNotFound{} } -/*PcloudCloudinstancesImagesExportPostNotFound handles this case with default header values. +/* PcloudCloudinstancesImagesExportPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -173,6 +174,9 @@ type PcloudCloudinstancesImagesExportPostNotFound struct { func (o *PcloudCloudinstancesImagesExportPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesImagesExportPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesExportPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudCloudinstancesImagesExportPostUnprocessableEntity() *PcloudCloudin return &PcloudCloudinstancesImagesExportPostUnprocessableEntity{} } -/*PcloudCloudinstancesImagesExportPostUnprocessableEntity handles this case with default header values. +/* PcloudCloudinstancesImagesExportPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -202,6 +206,9 @@ type PcloudCloudinstancesImagesExportPostUnprocessableEntity struct { func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudCloudinstancesImagesExportPostInternalServerError() *PcloudCloudin return &PcloudCloudinstancesImagesExportPostInternalServerError{} } -/*PcloudCloudinstancesImagesExportPostInternalServerError handles this case with default header values. +/* PcloudCloudinstancesImagesExportPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudCloudinstancesImagesExportPostInternalServerError struct { func (o *PcloudCloudinstancesImagesExportPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesImagesExportPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesExportPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go index 9f5ba65ea8..decd92c083 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesImagesGetParams creates a new PcloudCloudinstancesImagesGetParams object -// with the default values initialized. +// NewPcloudCloudinstancesImagesGetParams creates a new PcloudCloudinstancesImagesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesImagesGetParams() *PcloudCloudinstancesImagesGetParams { - var () return &PcloudCloudinstancesImagesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesImagesGetParamsWithTimeout creates a new PcloudCloudinstancesImagesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesImagesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetParams { - var () return &PcloudCloudinstancesImagesGetParams{ - timeout: timeout, } } // NewPcloudCloudinstancesImagesGetParamsWithContext creates a new PcloudCloudinstancesImagesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesImagesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesGetParams { - var () return &PcloudCloudinstancesImagesGetParams{ - Context: ctx, } } // NewPcloudCloudinstancesImagesGetParamsWithHTTPClient creates a new PcloudCloudinstancesImagesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesImagesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesGetParams { - var () return &PcloudCloudinstancesImagesGetParams{ HTTPClient: client, } } -/*PcloudCloudinstancesImagesGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances images get operation typically these are written to a http.Request +/* PcloudCloudinstancesImagesGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances images get operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesImagesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*ImageID - Image ID of a image + /* ImageID. + + Image ID of a image */ ImageID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesImagesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances images get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesGetParams) WithDefaults() *PcloudCloudinstancesImagesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances images get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances images get params func (o *PcloudCloudinstancesImagesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go index eafde45388..d4b52ee6e6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesImagesGetReader is a Reader for the PcloudCloudinstancesImagesGet structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesImagesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesImagesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesImagesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesImagesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesImagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesImagesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesImagesGetOK() *PcloudCloudinstancesImagesGetOK { return &PcloudCloudinstancesImagesGetOK{} } -/*PcloudCloudinstancesImagesGetOK handles this case with default header values. +/* PcloudCloudinstancesImagesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesImagesGetOK struct { func (o *PcloudCloudinstancesImagesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesImagesGetOK) GetPayload() *models.Image { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesImagesGetBadRequest() *PcloudCloudinstancesImagesGet return &PcloudCloudinstancesImagesGetBadRequest{} } -/*PcloudCloudinstancesImagesGetBadRequest handles this case with default header values. +/* PcloudCloudinstancesImagesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesImagesGetBadRequest struct { func (o *PcloudCloudinstancesImagesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesImagesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesImagesGetUnauthorized() *PcloudCloudinstancesImagesG return &PcloudCloudinstancesImagesGetUnauthorized{} } -/*PcloudCloudinstancesImagesGetUnauthorized handles this case with default header values. +/* PcloudCloudinstancesImagesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesImagesGetUnauthorized struct { func (o *PcloudCloudinstancesImagesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesImagesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesImagesGetNotFound() *PcloudCloudinstancesImagesGetNo return &PcloudCloudinstancesImagesGetNotFound{} } -/*PcloudCloudinstancesImagesGetNotFound handles this case with default header values. +/* PcloudCloudinstancesImagesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesImagesGetNotFound struct { func (o *PcloudCloudinstancesImagesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesImagesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesImagesGetInternalServerError() *PcloudCloudinstances return &PcloudCloudinstancesImagesGetInternalServerError{} } -/*PcloudCloudinstancesImagesGetInternalServerError handles this case with default header values. +/* PcloudCloudinstancesImagesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesImagesGetInternalServerError struct { func (o *PcloudCloudinstancesImagesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesImagesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go index 6bcc6651ee..a0acea17e1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesImagesGetallParams creates a new PcloudCloudinstancesImagesGetallParams object -// with the default values initialized. +// NewPcloudCloudinstancesImagesGetallParams creates a new PcloudCloudinstancesImagesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesImagesGetallParams() *PcloudCloudinstancesImagesGetallParams { - var () return &PcloudCloudinstancesImagesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesImagesGetallParamsWithTimeout creates a new PcloudCloudinstancesImagesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesImagesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetallParams { - var () return &PcloudCloudinstancesImagesGetallParams{ - timeout: timeout, } } // NewPcloudCloudinstancesImagesGetallParamsWithContext creates a new PcloudCloudinstancesImagesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesImagesGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesGetallParams { - var () return &PcloudCloudinstancesImagesGetallParams{ - Context: ctx, } } // NewPcloudCloudinstancesImagesGetallParamsWithHTTPClient creates a new PcloudCloudinstancesImagesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesImagesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesGetallParams { - var () return &PcloudCloudinstancesImagesGetallParams{ HTTPClient: client, } } -/*PcloudCloudinstancesImagesGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances images getall operation typically these are written to a http.Request +/* PcloudCloudinstancesImagesGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances images getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesImagesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudCloudinstancesImagesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances images getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesGetallParams) WithDefaults() *PcloudCloudinstancesImagesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances images getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances images getall params func (o *PcloudCloudinstancesImagesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go index 02b4454c78..a06568fe25 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesImagesGetallReader is a Reader for the PcloudCloudinstancesImagesGetall structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesImagesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesImagesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesImagesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesImagesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesImagesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesImagesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesImagesGetallOK() *PcloudCloudinstancesImagesGetallOK return &PcloudCloudinstancesImagesGetallOK{} } -/*PcloudCloudinstancesImagesGetallOK handles this case with default header values. +/* PcloudCloudinstancesImagesGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesImagesGetallOK struct { func (o *PcloudCloudinstancesImagesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesImagesGetallOK) GetPayload() *models.Images { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesImagesGetallBadRequest() *PcloudCloudinstancesImages return &PcloudCloudinstancesImagesGetallBadRequest{} } -/*PcloudCloudinstancesImagesGetallBadRequest handles this case with default header values. +/* PcloudCloudinstancesImagesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesImagesGetallBadRequest struct { func (o *PcloudCloudinstancesImagesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesImagesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesImagesGetallUnauthorized() *PcloudCloudinstancesImag return &PcloudCloudinstancesImagesGetallUnauthorized{} } -/*PcloudCloudinstancesImagesGetallUnauthorized handles this case with default header values. +/* PcloudCloudinstancesImagesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesImagesGetallUnauthorized struct { func (o *PcloudCloudinstancesImagesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesImagesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesImagesGetallNotFound() *PcloudCloudinstancesImagesGe return &PcloudCloudinstancesImagesGetallNotFound{} } -/*PcloudCloudinstancesImagesGetallNotFound handles this case with default header values. +/* PcloudCloudinstancesImagesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesImagesGetallNotFound struct { func (o *PcloudCloudinstancesImagesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesImagesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesImagesGetallInternalServerError() *PcloudCloudinstan return &PcloudCloudinstancesImagesGetallInternalServerError{} } -/*PcloudCloudinstancesImagesGetallInternalServerError handles this case with default header values. +/* PcloudCloudinstancesImagesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesImagesGetallInternalServerError struct { func (o *PcloudCloudinstancesImagesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesImagesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go index d45fd82253..cd22b7b195 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesImagesPostParams creates a new PcloudCloudinstancesImagesPostParams object -// with the default values initialized. +// NewPcloudCloudinstancesImagesPostParams creates a new PcloudCloudinstancesImagesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesImagesPostParams() *PcloudCloudinstancesImagesPostParams { - var () return &PcloudCloudinstancesImagesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesImagesPostParamsWithTimeout creates a new PcloudCloudinstancesImagesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesImagesPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesPostParams { - var () return &PcloudCloudinstancesImagesPostParams{ - timeout: timeout, } } // NewPcloudCloudinstancesImagesPostParamsWithContext creates a new PcloudCloudinstancesImagesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesImagesPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesImagesPostParams { - var () return &PcloudCloudinstancesImagesPostParams{ - Context: ctx, } } // NewPcloudCloudinstancesImagesPostParamsWithHTTPClient creates a new PcloudCloudinstancesImagesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesImagesPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesImagesPostParams { - var () return &PcloudCloudinstancesImagesPostParams{ HTTPClient: client, } } -/*PcloudCloudinstancesImagesPostParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances images post operation typically these are written to a http.Request +/* PcloudCloudinstancesImagesPostParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances images post operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesImagesPostParams struct { - /*Body - Parameters for the creation of a new image from available images + /* Body. + Parameters for the creation of a new image from available images */ Body *models.CreateImage - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudCloudinstancesImagesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances images post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesPostParams) WithDefaults() *PcloudCloudinstancesImagesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances images post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesImagesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances images post params func (o *PcloudCloudinstancesImagesPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesImagesPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudCloudinstancesImagesPostParams) WriteToRequest(r runtime.ClientRe return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go index 14254d376d..570d84672c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesImagesPostReader is a Reader for the PcloudCloudinstancesImagesPost structure. @@ -24,58 +23,50 @@ type PcloudCloudinstancesImagesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesImagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesImagesPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewPcloudCloudinstancesImagesPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesImagesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesImagesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudCloudinstancesImagesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudinstancesImagesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesImagesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudCloudinstancesImagesPostOK() *PcloudCloudinstancesImagesPostOK { return &PcloudCloudinstancesImagesPostOK{} } -/*PcloudCloudinstancesImagesPostOK handles this case with default header values. +/* PcloudCloudinstancesImagesPostOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudCloudinstancesImagesPostOK struct { func (o *PcloudCloudinstancesImagesPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesImagesPostOK) GetPayload() *models.Image { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudCloudinstancesImagesPostCreated() *PcloudCloudinstancesImagesPostC return &PcloudCloudinstancesImagesPostCreated{} } -/*PcloudCloudinstancesImagesPostCreated handles this case with default header values. +/* PcloudCloudinstancesImagesPostCreated describes a response with status code 201, with default header values. Created */ @@ -124,6 +118,9 @@ type PcloudCloudinstancesImagesPostCreated struct { func (o *PcloudCloudinstancesImagesPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostCreated %+v", 201, o.Payload) } +func (o *PcloudCloudinstancesImagesPostCreated) GetPayload() *models.Image { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudCloudinstancesImagesPostBadRequest() *PcloudCloudinstancesImagesPo return &PcloudCloudinstancesImagesPostBadRequest{} } -/*PcloudCloudinstancesImagesPostBadRequest handles this case with default header values. +/* PcloudCloudinstancesImagesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -153,6 +150,9 @@ type PcloudCloudinstancesImagesPostBadRequest struct { func (o *PcloudCloudinstancesImagesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesImagesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudCloudinstancesImagesPostUnauthorized() *PcloudCloudinstancesImages return &PcloudCloudinstancesImagesPostUnauthorized{} } -/*PcloudCloudinstancesImagesPostUnauthorized handles this case with default header values. +/* PcloudCloudinstancesImagesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -182,6 +182,9 @@ type PcloudCloudinstancesImagesPostUnauthorized struct { func (o *PcloudCloudinstancesImagesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesImagesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudCloudinstancesImagesPostConflict() *PcloudCloudinstancesImagesPost return &PcloudCloudinstancesImagesPostConflict{} } -/*PcloudCloudinstancesImagesPostConflict handles this case with default header values. +/* PcloudCloudinstancesImagesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudCloudinstancesImagesPostConflict struct { func (o *PcloudCloudinstancesImagesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostConflict %+v", 409, o.Payload) } +func (o *PcloudCloudinstancesImagesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudCloudinstancesImagesPostUnprocessableEntity() *PcloudCloudinstance return &PcloudCloudinstancesImagesPostUnprocessableEntity{} } -/*PcloudCloudinstancesImagesPostUnprocessableEntity handles this case with default header values. +/* PcloudCloudinstancesImagesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudCloudinstancesImagesPostUnprocessableEntity struct { func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudCloudinstancesImagesPostInternalServerError() *PcloudCloudinstance return &PcloudCloudinstancesImagesPostInternalServerError{} } -/*PcloudCloudinstancesImagesPostInternalServerError handles this case with default header values. +/* PcloudCloudinstancesImagesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudCloudinstancesImagesPostInternalServerError struct { func (o *PcloudCloudinstancesImagesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesImagesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesImagesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go index 30f2ff8d9e..071d73d802 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesStockimagesGetParams creates a new PcloudCloudinstancesStockimagesGetParams object -// with the default values initialized. +// NewPcloudCloudinstancesStockimagesGetParams creates a new PcloudCloudinstancesStockimagesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesStockimagesGetParams() *PcloudCloudinstancesStockimagesGetParams { - var () return &PcloudCloudinstancesStockimagesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesStockimagesGetParamsWithTimeout creates a new PcloudCloudinstancesStockimagesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesStockimagesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetParams { - var () return &PcloudCloudinstancesStockimagesGetParams{ - timeout: timeout, } } // NewPcloudCloudinstancesStockimagesGetParamsWithContext creates a new PcloudCloudinstancesStockimagesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesStockimagesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesStockimagesGetParams { - var () return &PcloudCloudinstancesStockimagesGetParams{ - Context: ctx, } } // NewPcloudCloudinstancesStockimagesGetParamsWithHTTPClient creates a new PcloudCloudinstancesStockimagesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesStockimagesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesStockimagesGetParams { - var () return &PcloudCloudinstancesStockimagesGetParams{ HTTPClient: client, } } -/*PcloudCloudinstancesStockimagesGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances stockimages get operation typically these are written to a http.Request +/* PcloudCloudinstancesStockimagesGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances stockimages get operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesStockimagesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*ImageID - Image ID of a image + /* ImageID. + + Image ID of a image */ ImageID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesStockimagesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances stockimages get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesStockimagesGetParams) WithDefaults() *PcloudCloudinstancesStockimagesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances stockimages get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesStockimagesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances stockimages get params func (o *PcloudCloudinstancesStockimagesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go index bbb04327a7..2073da1cac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesStockimagesGetReader is a Reader for the PcloudCloudinstancesStockimagesGet structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesStockimagesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesStockimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesStockimagesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesStockimagesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesStockimagesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesStockimagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesStockimagesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesStockimagesGetOK() *PcloudCloudinstancesStockimagesG return &PcloudCloudinstancesStockimagesGetOK{} } -/*PcloudCloudinstancesStockimagesGetOK handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesStockimagesGetOK struct { func (o *PcloudCloudinstancesStockimagesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetOK) GetPayload() *models.Image { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesStockimagesGetBadRequest() *PcloudCloudinstancesStoc return &PcloudCloudinstancesStockimagesGetBadRequest{} } -/*PcloudCloudinstancesStockimagesGetBadRequest handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesStockimagesGetBadRequest struct { func (o *PcloudCloudinstancesStockimagesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesStockimagesGetUnauthorized() *PcloudCloudinstancesSt return &PcloudCloudinstancesStockimagesGetUnauthorized{} } -/*PcloudCloudinstancesStockimagesGetUnauthorized handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesStockimagesGetUnauthorized struct { func (o *PcloudCloudinstancesStockimagesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesStockimagesGetNotFound() *PcloudCloudinstancesStocki return &PcloudCloudinstancesStockimagesGetNotFound{} } -/*PcloudCloudinstancesStockimagesGetNotFound handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesStockimagesGetNotFound struct { func (o *PcloudCloudinstancesStockimagesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesStockimagesGetInternalServerError() *PcloudCloudinst return &PcloudCloudinstancesStockimagesGetInternalServerError{} } -/*PcloudCloudinstancesStockimagesGetInternalServerError handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesStockimagesGetInternalServerError struct { func (o *PcloudCloudinstancesStockimagesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go index 52f1f03cfd..cec512f7bd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_parameters.go @@ -13,68 +13,68 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesStockimagesGetallParams creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the default values initialized. +// NewPcloudCloudinstancesStockimagesGetallParams creates a new PcloudCloudinstancesStockimagesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesStockimagesGetallParams() *PcloudCloudinstancesStockimagesGetallParams { - var () return &PcloudCloudinstancesStockimagesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesStockimagesGetallParamsWithTimeout creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesStockimagesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetallParams { - var () return &PcloudCloudinstancesStockimagesGetallParams{ - timeout: timeout, } } // NewPcloudCloudinstancesStockimagesGetallParamsWithContext creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesStockimagesGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesStockimagesGetallParams { - var () return &PcloudCloudinstancesStockimagesGetallParams{ - Context: ctx, } } // NewPcloudCloudinstancesStockimagesGetallParamsWithHTTPClient creates a new PcloudCloudinstancesStockimagesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesStockimagesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesStockimagesGetallParams { - var () return &PcloudCloudinstancesStockimagesGetallParams{ HTTPClient: client, } } -/*PcloudCloudinstancesStockimagesGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances stockimages getall operation typically these are written to a http.Request +/* PcloudCloudinstancesStockimagesGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances stockimages getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesStockimagesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*Sap - Include SAP images with get available stock images + /* Sap. + + Include SAP images with get available stock images */ Sap *bool - /*Vtl - Include VTL images with get available stock images + /* Vtl. + + Include VTL images with get available stock images */ Vtl *bool @@ -83,6 +83,21 @@ type PcloudCloudinstancesStockimagesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances stockimages getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesStockimagesGetallParams) WithDefaults() *PcloudCloudinstancesStockimagesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances stockimages getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesStockimagesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances stockimages getall params func (o *PcloudCloudinstancesStockimagesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesStockimagesGetallParams { o.SetTimeout(timeout) @@ -166,32 +181,34 @@ func (o *PcloudCloudinstancesStockimagesGetallParams) WriteToRequest(r runtime.C // query param sap var qrSap bool + if o.Sap != nil { qrSap = *o.Sap } qSap := swag.FormatBool(qrSap) if qSap != "" { + if err := r.SetQueryParam("sap", qSap); err != nil { return err } } - } if o.Vtl != nil { // query param vtl var qrVtl bool + if o.Vtl != nil { qrVtl = *o.Vtl } qVtl := swag.FormatBool(qrVtl) if qVtl != "" { + if err := r.SetQueryParam("vtl", qVtl); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go index 30af916613..b30c83880b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesStockimagesGetallReader is a Reader for the PcloudCloudinstancesStockimagesGetall structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesStockimagesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesStockimagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesStockimagesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesStockimagesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesStockimagesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesStockimagesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesStockimagesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesStockimagesGetallOK() *PcloudCloudinstancesStockimag return &PcloudCloudinstancesStockimagesGetallOK{} } -/*PcloudCloudinstancesStockimagesGetallOK handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesStockimagesGetallOK struct { func (o *PcloudCloudinstancesStockimagesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetallOK) GetPayload() *models.Images { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesStockimagesGetallBadRequest() *PcloudCloudinstancesS return &PcloudCloudinstancesStockimagesGetallBadRequest{} } -/*PcloudCloudinstancesStockimagesGetallBadRequest handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesStockimagesGetallBadRequest struct { func (o *PcloudCloudinstancesStockimagesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesStockimagesGetallUnauthorized() *PcloudCloudinstance return &PcloudCloudinstancesStockimagesGetallUnauthorized{} } -/*PcloudCloudinstancesStockimagesGetallUnauthorized handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesStockimagesGetallUnauthorized struct { func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesStockimagesGetallNotFound() *PcloudCloudinstancesSto return &PcloudCloudinstancesStockimagesGetallNotFound{} } -/*PcloudCloudinstancesStockimagesGetallNotFound handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesStockimagesGetallNotFound struct { func (o *PcloudCloudinstancesStockimagesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesStockimagesGetallInternalServerError() *PcloudCloudi return &PcloudCloudinstancesStockimagesGetallInternalServerError{} } -/*PcloudCloudinstancesStockimagesGetallInternalServerError handles this case with default header values. +/* PcloudCloudinstancesStockimagesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesStockimagesGetallInternalServerError struct { func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_parameters.go index 2052bc828b..91192f6fdc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudImagesGetParams creates a new PcloudImagesGetParams object -// with the default values initialized. +// NewPcloudImagesGetParams creates a new PcloudImagesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudImagesGetParams() *PcloudImagesGetParams { - var () return &PcloudImagesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudImagesGetParamsWithTimeout creates a new PcloudImagesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudImagesGetParamsWithTimeout(timeout time.Duration) *PcloudImagesGetParams { - var () return &PcloudImagesGetParams{ - timeout: timeout, } } // NewPcloudImagesGetParamsWithContext creates a new PcloudImagesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudImagesGetParamsWithContext(ctx context.Context) *PcloudImagesGetParams { - var () return &PcloudImagesGetParams{ - Context: ctx, } } // NewPcloudImagesGetParamsWithHTTPClient creates a new PcloudImagesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudImagesGetParamsWithHTTPClient(client *http.Client) *PcloudImagesGetParams { - var () return &PcloudImagesGetParams{ HTTPClient: client, } } -/*PcloudImagesGetParams contains all the parameters to send to the API endpoint -for the pcloud images get operation typically these are written to a http.Request +/* PcloudImagesGetParams contains all the parameters to send to the API endpoint + for the pcloud images get operation. + + Typically these are written to a http.Request. */ type PcloudImagesGetParams struct { - /*ImageID - Image ID of a image + /* ImageID. + Image ID of a image */ ImageID string @@ -72,6 +70,21 @@ type PcloudImagesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud images get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudImagesGetParams) WithDefaults() *PcloudImagesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud images get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudImagesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud images get params func (o *PcloudImagesGetParams) WithTimeout(timeout time.Duration) *PcloudImagesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go index a9bd635b89..040e27c3fe 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudImagesGetReader is a Reader for the PcloudImagesGet structure. @@ -24,44 +23,38 @@ type PcloudImagesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudImagesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudImagesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudImagesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudImagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudImagesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudImagesGetOK() *PcloudImagesGetOK { return &PcloudImagesGetOK{} } -/*PcloudImagesGetOK handles this case with default header values. +/* PcloudImagesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudImagesGetOK struct { func (o *PcloudImagesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetOK %+v", 200, o.Payload) } +func (o *PcloudImagesGetOK) GetPayload() *models.Image { + return o.Payload +} func (o *PcloudImagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudImagesGetBadRequest() *PcloudImagesGetBadRequest { return &PcloudImagesGetBadRequest{} } -/*PcloudImagesGetBadRequest handles this case with default header values. +/* PcloudImagesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudImagesGetBadRequest struct { func (o *PcloudImagesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudImagesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudImagesGetUnauthorized() *PcloudImagesGetUnauthorized { return &PcloudImagesGetUnauthorized{} } -/*PcloudImagesGetUnauthorized handles this case with default header values. +/* PcloudImagesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudImagesGetUnauthorized struct { func (o *PcloudImagesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudImagesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudImagesGetNotFound() *PcloudImagesGetNotFound { return &PcloudImagesGetNotFound{} } -/*PcloudImagesGetNotFound handles this case with default header values. +/* PcloudImagesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudImagesGetNotFound struct { func (o *PcloudImagesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudImagesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudImagesGetInternalServerError() *PcloudImagesGetInternalServerError return &PcloudImagesGetInternalServerError{} } -/*PcloudImagesGetInternalServerError handles this case with default header values. +/* PcloudImagesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudImagesGetInternalServerError struct { func (o *PcloudImagesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudImagesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go index 0de7385b0c..cb90f6f5a6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_parameters.go @@ -13,63 +13,62 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewPcloudImagesGetallParams creates a new PcloudImagesGetallParams object -// with the default values initialized. +// NewPcloudImagesGetallParams creates a new PcloudImagesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudImagesGetallParams() *PcloudImagesGetallParams { - var () return &PcloudImagesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudImagesGetallParamsWithTimeout creates a new PcloudImagesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudImagesGetallParamsWithTimeout(timeout time.Duration) *PcloudImagesGetallParams { - var () return &PcloudImagesGetallParams{ - timeout: timeout, } } // NewPcloudImagesGetallParamsWithContext creates a new PcloudImagesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudImagesGetallParamsWithContext(ctx context.Context) *PcloudImagesGetallParams { - var () return &PcloudImagesGetallParams{ - Context: ctx, } } // NewPcloudImagesGetallParamsWithHTTPClient creates a new PcloudImagesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudImagesGetallParamsWithHTTPClient(client *http.Client) *PcloudImagesGetallParams { - var () return &PcloudImagesGetallParams{ HTTPClient: client, } } -/*PcloudImagesGetallParams contains all the parameters to send to the API endpoint -for the pcloud images getall operation typically these are written to a http.Request +/* PcloudImagesGetallParams contains all the parameters to send to the API endpoint + for the pcloud images getall operation. + + Typically these are written to a http.Request. */ type PcloudImagesGetallParams struct { - /*Sap - Include SAP images with get available stock images + /* Sap. + Include SAP images with get available stock images */ Sap *bool - /*Vtl - Include VTL images with get available stock images + /* Vtl. + + Include VTL images with get available stock images */ Vtl *bool @@ -78,6 +77,21 @@ type PcloudImagesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud images getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudImagesGetallParams) WithDefaults() *PcloudImagesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud images getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudImagesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud images getall params func (o *PcloudImagesGetallParams) WithTimeout(timeout time.Duration) *PcloudImagesGetallParams { o.SetTimeout(timeout) @@ -145,32 +159,34 @@ func (o *PcloudImagesGetallParams) WriteToRequest(r runtime.ClientRequest, reg s // query param sap var qrSap bool + if o.Sap != nil { qrSap = *o.Sap } qSap := swag.FormatBool(qrSap) if qSap != "" { + if err := r.SetQueryParam("sap", qSap); err != nil { return err } } - } if o.Vtl != nil { // query param vtl var qrVtl bool + if o.Vtl != nil { qrVtl = *o.Vtl } qVtl := swag.FormatBool(qrVtl) if qVtl != "" { + if err := r.SetQueryParam("vtl", qVtl); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go index 242dc4a0ca..5be159bd65 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudImagesGetallReader is a Reader for the PcloudImagesGetall structure. @@ -24,44 +23,38 @@ type PcloudImagesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudImagesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudImagesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudImagesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudImagesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudImagesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudImagesGetallOK() *PcloudImagesGetallOK { return &PcloudImagesGetallOK{} } -/*PcloudImagesGetallOK handles this case with default header values. +/* PcloudImagesGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudImagesGetallOK struct { func (o *PcloudImagesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %+v", 200, o.Payload) } +func (o *PcloudImagesGetallOK) GetPayload() *models.Images { + return o.Payload +} func (o *PcloudImagesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudImagesGetallBadRequest() *PcloudImagesGetallBadRequest { return &PcloudImagesGetallBadRequest{} } -/*PcloudImagesGetallBadRequest handles this case with default header values. +/* PcloudImagesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudImagesGetallBadRequest struct { func (o *PcloudImagesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudImagesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudImagesGetallUnauthorized() *PcloudImagesGetallUnauthorized { return &PcloudImagesGetallUnauthorized{} } -/*PcloudImagesGetallUnauthorized handles this case with default header values. +/* PcloudImagesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudImagesGetallUnauthorized struct { func (o *PcloudImagesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudImagesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudImagesGetallNotFound() *PcloudImagesGetallNotFound { return &PcloudImagesGetallNotFound{} } -/*PcloudImagesGetallNotFound handles this case with default header values. +/* PcloudImagesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudImagesGetallNotFound struct { func (o *PcloudImagesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudImagesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudImagesGetallInternalServerError() *PcloudImagesGetallInternalServe return &PcloudImagesGetallInternalServerError{} } -/*PcloudImagesGetallInternalServerError handles this case with default header values. +/* PcloudImagesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudImagesGetallInternalServerError struct { func (o *PcloudImagesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudImagesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudImagesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go index 464bfaa2a3..dd5a1f9ad0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV1CloudinstancesCosimagesGetParams creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the default values initialized. +// NewPcloudV1CloudinstancesCosimagesGetParams creates a new PcloudV1CloudinstancesCosimagesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV1CloudinstancesCosimagesGetParams() *PcloudV1CloudinstancesCosimagesGetParams { - var () return &PcloudV1CloudinstancesCosimagesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV1CloudinstancesCosimagesGetParamsWithTimeout creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV1CloudinstancesCosimagesGetParamsWithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesGetParams { - var () return &PcloudV1CloudinstancesCosimagesGetParams{ - timeout: timeout, } } // NewPcloudV1CloudinstancesCosimagesGetParamsWithContext creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV1CloudinstancesCosimagesGetParamsWithContext(ctx context.Context) *PcloudV1CloudinstancesCosimagesGetParams { - var () return &PcloudV1CloudinstancesCosimagesGetParams{ - Context: ctx, } } // NewPcloudV1CloudinstancesCosimagesGetParamsWithHTTPClient creates a new PcloudV1CloudinstancesCosimagesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV1CloudinstancesCosimagesGetParamsWithHTTPClient(client *http.Client) *PcloudV1CloudinstancesCosimagesGetParams { - var () return &PcloudV1CloudinstancesCosimagesGetParams{ HTTPClient: client, } } -/*PcloudV1CloudinstancesCosimagesGetParams contains all the parameters to send to the API endpoint -for the pcloud v1 cloudinstances cosimages get operation typically these are written to a http.Request +/* PcloudV1CloudinstancesCosimagesGetParams contains all the parameters to send to the API endpoint + for the pcloud v1 cloudinstances cosimages get operation. + + Typically these are written to a http.Request. */ type PcloudV1CloudinstancesCosimagesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudV1CloudinstancesCosimagesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v1 cloudinstances cosimages get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV1CloudinstancesCosimagesGetParams) WithDefaults() *PcloudV1CloudinstancesCosimagesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v1 cloudinstances cosimages get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV1CloudinstancesCosimagesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v1 cloudinstances cosimages get params func (o *PcloudV1CloudinstancesCosimagesGetParams) WithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go index f54dfc2f7a..54dad0dc1a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV1CloudinstancesCosimagesGetReader is a Reader for the PcloudV1CloudinstancesCosimagesGet structure. @@ -24,37 +23,32 @@ type PcloudV1CloudinstancesCosimagesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV1CloudinstancesCosimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV1CloudinstancesCosimagesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudV1CloudinstancesCosimagesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV1CloudinstancesCosimagesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV1CloudinstancesCosimagesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudV1CloudinstancesCosimagesGetOK() *PcloudV1CloudinstancesCosimagesG return &PcloudV1CloudinstancesCosimagesGetOK{} } -/*PcloudV1CloudinstancesCosimagesGetOK handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudV1CloudinstancesCosimagesGetOK struct { func (o *PcloudV1CloudinstancesCosimagesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetOK %+v", 200, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesGetOK) GetPayload() *models.Job { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudV1CloudinstancesCosimagesGetUnauthorized() *PcloudV1Cloudinstances return &PcloudV1CloudinstancesCosimagesGetUnauthorized{} } -/*PcloudV1CloudinstancesCosimagesGetUnauthorized handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudV1CloudinstancesCosimagesGetUnauthorized struct { func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudV1CloudinstancesCosimagesGetNotFound() *PcloudV1CloudinstancesCosi return &PcloudV1CloudinstancesCosimagesGetNotFound{} } -/*PcloudV1CloudinstancesCosimagesGetNotFound handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudV1CloudinstancesCosimagesGetNotFound struct { func (o *PcloudV1CloudinstancesCosimagesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudV1CloudinstancesCosimagesGetInternalServerError() *PcloudV1Cloudin return &PcloudV1CloudinstancesCosimagesGetInternalServerError{} } -/*PcloudV1CloudinstancesCosimagesGetInternalServerError handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudV1CloudinstancesCosimagesGetInternalServerError struct { func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go index 66238d9c95..199d9e7a72 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV1CloudinstancesCosimagesPostParams creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the default values initialized. +// NewPcloudV1CloudinstancesCosimagesPostParams creates a new PcloudV1CloudinstancesCosimagesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV1CloudinstancesCosimagesPostParams() *PcloudV1CloudinstancesCosimagesPostParams { - var () return &PcloudV1CloudinstancesCosimagesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV1CloudinstancesCosimagesPostParamsWithTimeout creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV1CloudinstancesCosimagesPostParamsWithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesPostParams { - var () return &PcloudV1CloudinstancesCosimagesPostParams{ - timeout: timeout, } } // NewPcloudV1CloudinstancesCosimagesPostParamsWithContext creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV1CloudinstancesCosimagesPostParamsWithContext(ctx context.Context) *PcloudV1CloudinstancesCosimagesPostParams { - var () return &PcloudV1CloudinstancesCosimagesPostParams{ - Context: ctx, } } // NewPcloudV1CloudinstancesCosimagesPostParamsWithHTTPClient creates a new PcloudV1CloudinstancesCosimagesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV1CloudinstancesCosimagesPostParamsWithHTTPClient(client *http.Client) *PcloudV1CloudinstancesCosimagesPostParams { - var () return &PcloudV1CloudinstancesCosimagesPostParams{ HTTPClient: client, } } -/*PcloudV1CloudinstancesCosimagesPostParams contains all the parameters to send to the API endpoint -for the pcloud v1 cloudinstances cosimages post operation typically these are written to a http.Request +/* PcloudV1CloudinstancesCosimagesPostParams contains all the parameters to send to the API endpoint + for the pcloud v1 cloudinstances cosimages post operation. + + Typically these are written to a http.Request. */ type PcloudV1CloudinstancesCosimagesPostParams struct { - /*Body - Parameters for the creation of a new cos-image import job + /* Body. + Parameters for the creation of a new cos-image import job */ Body *models.CreateCosImageImportJob - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudV1CloudinstancesCosimagesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v1 cloudinstances cosimages post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV1CloudinstancesCosimagesPostParams) WithDefaults() *PcloudV1CloudinstancesCosimagesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v1 cloudinstances cosimages post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV1CloudinstancesCosimagesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v1 cloudinstances cosimages post params func (o *PcloudV1CloudinstancesCosimagesPostParams) WithTimeout(timeout time.Duration) *PcloudV1CloudinstancesCosimagesPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudV1CloudinstancesCosimagesPostParams) WriteToRequest(r runtime.Cli return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go index 5e0b391b27..ac1a8d0ada 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV1CloudinstancesCosimagesPostReader is a Reader for the PcloudV1CloudinstancesCosimagesPost structure. @@ -24,58 +23,50 @@ type PcloudV1CloudinstancesCosimagesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV1CloudinstancesCosimagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV1CloudinstancesCosimagesPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV1CloudinstancesCosimagesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV1CloudinstancesCosimagesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudV1CloudinstancesCosimagesPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudV1CloudinstancesCosimagesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudV1CloudinstancesCosimagesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV1CloudinstancesCosimagesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudV1CloudinstancesCosimagesPostAccepted() *PcloudV1CloudinstancesCos return &PcloudV1CloudinstancesCosimagesPostAccepted{} } -/*PcloudV1CloudinstancesCosimagesPostAccepted handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostAccepted describes a response with status code 202, with default header values. Accepted, cos-image import successfully added to the jobs queue */ @@ -95,6 +86,9 @@ type PcloudV1CloudinstancesCosimagesPostAccepted struct { func (o *PcloudV1CloudinstancesCosimagesPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostAccepted %+v", 202, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudV1CloudinstancesCosimagesPostBadRequest() *PcloudV1CloudinstancesC return &PcloudV1CloudinstancesCosimagesPostBadRequest{} } -/*PcloudV1CloudinstancesCosimagesPostBadRequest handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudV1CloudinstancesCosimagesPostBadRequest struct { func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudV1CloudinstancesCosimagesPostUnauthorized() *PcloudV1Cloudinstance return &PcloudV1CloudinstancesCosimagesPostUnauthorized{} } -/*PcloudV1CloudinstancesCosimagesPostUnauthorized handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudV1CloudinstancesCosimagesPostUnauthorized struct { func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudV1CloudinstancesCosimagesPostForbidden() *PcloudV1CloudinstancesCo return &PcloudV1CloudinstancesCosimagesPostForbidden{} } -/*PcloudV1CloudinstancesCosimagesPostForbidden handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudV1CloudinstancesCosimagesPostForbidden struct { func (o *PcloudV1CloudinstancesCosimagesPostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostForbidden %+v", 403, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudV1CloudinstancesCosimagesPostConflict() *PcloudV1CloudinstancesCos return &PcloudV1CloudinstancesCosimagesPostConflict{} } -/*PcloudV1CloudinstancesCosimagesPostConflict handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudV1CloudinstancesCosimagesPostConflict struct { func (o *PcloudV1CloudinstancesCosimagesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostConflict %+v", 409, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudV1CloudinstancesCosimagesPostUnprocessableEntity() *PcloudV1Cloudi return &PcloudV1CloudinstancesCosimagesPostUnprocessableEntity{} } -/*PcloudV1CloudinstancesCosimagesPostUnprocessableEntity handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudV1CloudinstancesCosimagesPostUnprocessableEntity struct { func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudV1CloudinstancesCosimagesPostInternalServerError() *PcloudV1Cloudi return &PcloudV1CloudinstancesCosimagesPostInternalServerError{} } -/*PcloudV1CloudinstancesCosimagesPostInternalServerError handles this case with default header values. +/* PcloudV1CloudinstancesCosimagesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudV1CloudinstancesCosimagesPostInternalServerError struct { func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go index c4cb6d2aab..6a7f12b258 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2ImagesExportGetParams creates a new PcloudV2ImagesExportGetParams object -// with the default values initialized. +// NewPcloudV2ImagesExportGetParams creates a new PcloudV2ImagesExportGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2ImagesExportGetParams() *PcloudV2ImagesExportGetParams { - var () return &PcloudV2ImagesExportGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2ImagesExportGetParamsWithTimeout creates a new PcloudV2ImagesExportGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2ImagesExportGetParamsWithTimeout(timeout time.Duration) *PcloudV2ImagesExportGetParams { - var () return &PcloudV2ImagesExportGetParams{ - timeout: timeout, } } // NewPcloudV2ImagesExportGetParamsWithContext creates a new PcloudV2ImagesExportGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2ImagesExportGetParamsWithContext(ctx context.Context) *PcloudV2ImagesExportGetParams { - var () return &PcloudV2ImagesExportGetParams{ - Context: ctx, } } // NewPcloudV2ImagesExportGetParamsWithHTTPClient creates a new PcloudV2ImagesExportGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2ImagesExportGetParamsWithHTTPClient(client *http.Client) *PcloudV2ImagesExportGetParams { - var () return &PcloudV2ImagesExportGetParams{ HTTPClient: client, } } -/*PcloudV2ImagesExportGetParams contains all the parameters to send to the API endpoint -for the pcloud v2 images export get operation typically these are written to a http.Request +/* PcloudV2ImagesExportGetParams contains all the parameters to send to the API endpoint + for the pcloud v2 images export get operation. + + Typically these are written to a http.Request. */ type PcloudV2ImagesExportGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*ImageID - Image ID of a image + /* ImageID. + + Image ID of a image */ ImageID string @@ -77,6 +76,21 @@ type PcloudV2ImagesExportGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 images export get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2ImagesExportGetParams) WithDefaults() *PcloudV2ImagesExportGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 images export get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2ImagesExportGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 images export get params func (o *PcloudV2ImagesExportGetParams) WithTimeout(timeout time.Duration) *PcloudV2ImagesExportGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go index 72cba5f3dd..a5c695a14b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2ImagesExportGetReader is a Reader for the PcloudV2ImagesExportGet structure. @@ -24,37 +23,32 @@ type PcloudV2ImagesExportGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2ImagesExportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2ImagesExportGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudV2ImagesExportGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2ImagesExportGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2ImagesExportGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudV2ImagesExportGetOK() *PcloudV2ImagesExportGetOK { return &PcloudV2ImagesExportGetOK{} } -/*PcloudV2ImagesExportGetOK handles this case with default header values. +/* PcloudV2ImagesExportGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudV2ImagesExportGetOK struct { func (o *PcloudV2ImagesExportGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK %+v", 200, o.Payload) } +func (o *PcloudV2ImagesExportGetOK) GetPayload() *models.Job { + return o.Payload +} func (o *PcloudV2ImagesExportGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudV2ImagesExportGetUnauthorized() *PcloudV2ImagesExportGetUnauthoriz return &PcloudV2ImagesExportGetUnauthorized{} } -/*PcloudV2ImagesExportGetUnauthorized handles this case with default header values. +/* PcloudV2ImagesExportGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudV2ImagesExportGetUnauthorized struct { func (o *PcloudV2ImagesExportGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2ImagesExportGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudV2ImagesExportGetNotFound() *PcloudV2ImagesExportGetNotFound { return &PcloudV2ImagesExportGetNotFound{} } -/*PcloudV2ImagesExportGetNotFound handles this case with default header values. +/* PcloudV2ImagesExportGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudV2ImagesExportGetNotFound struct { func (o *PcloudV2ImagesExportGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound %+v", 404, o.Payload) } +func (o *PcloudV2ImagesExportGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudV2ImagesExportGetInternalServerError() *PcloudV2ImagesExportGetInt return &PcloudV2ImagesExportGetInternalServerError{} } -/*PcloudV2ImagesExportGetInternalServerError handles this case with default header values. +/* PcloudV2ImagesExportGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudV2ImagesExportGetInternalServerError struct { func (o *PcloudV2ImagesExportGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2ImagesExportGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go index ff50da7fcc..da0c0be150 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2ImagesExportPostParams creates a new PcloudV2ImagesExportPostParams object -// with the default values initialized. +// NewPcloudV2ImagesExportPostParams creates a new PcloudV2ImagesExportPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2ImagesExportPostParams() *PcloudV2ImagesExportPostParams { - var () return &PcloudV2ImagesExportPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2ImagesExportPostParamsWithTimeout creates a new PcloudV2ImagesExportPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2ImagesExportPostParamsWithTimeout(timeout time.Duration) *PcloudV2ImagesExportPostParams { - var () return &PcloudV2ImagesExportPostParams{ - timeout: timeout, } } // NewPcloudV2ImagesExportPostParamsWithContext creates a new PcloudV2ImagesExportPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2ImagesExportPostParamsWithContext(ctx context.Context) *PcloudV2ImagesExportPostParams { - var () return &PcloudV2ImagesExportPostParams{ - Context: ctx, } } // NewPcloudV2ImagesExportPostParamsWithHTTPClient creates a new PcloudV2ImagesExportPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2ImagesExportPostParamsWithHTTPClient(client *http.Client) *PcloudV2ImagesExportPostParams { - var () return &PcloudV2ImagesExportPostParams{ HTTPClient: client, } } -/*PcloudV2ImagesExportPostParams contains all the parameters to send to the API endpoint -for the pcloud v2 images export post operation typically these are written to a http.Request +/* PcloudV2ImagesExportPostParams contains all the parameters to send to the API endpoint + for the pcloud v2 images export post operation. + + Typically these are written to a http.Request. */ type PcloudV2ImagesExportPostParams struct { - /*Body - Parameters for the export + /* Body. + Parameters for the export */ Body *models.ExportImage - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*ImageID - Image ID of a image + /* ImageID. + + Image ID of a image */ ImageID string @@ -84,6 +84,21 @@ type PcloudV2ImagesExportPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 images export post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2ImagesExportPostParams) WithDefaults() *PcloudV2ImagesExportPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 images export post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2ImagesExportPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 images export post params func (o *PcloudV2ImagesExportPostParams) WithTimeout(timeout time.Duration) *PcloudV2ImagesExportPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudV2ImagesExportPostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go index b97d934e34..43957ae2cc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2ImagesExportPostReader is a Reader for the PcloudV2ImagesExportPost structure. @@ -24,58 +23,50 @@ type PcloudV2ImagesExportPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2ImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2ImagesExportPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2ImagesExportPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2ImagesExportPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2ImagesExportPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudV2ImagesExportPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudV2ImagesExportPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2ImagesExportPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudV2ImagesExportPostAccepted() *PcloudV2ImagesExportPostAccepted { return &PcloudV2ImagesExportPostAccepted{} } -/*PcloudV2ImagesExportPostAccepted handles this case with default header values. +/* PcloudV2ImagesExportPostAccepted describes a response with status code 202, with default header values. Accepted, image export successfully added to the jobs queue */ @@ -95,6 +86,9 @@ type PcloudV2ImagesExportPostAccepted struct { func (o *PcloudV2ImagesExportPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2ImagesExportPostAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudV2ImagesExportPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudV2ImagesExportPostBadRequest() *PcloudV2ImagesExportPostBadRequest return &PcloudV2ImagesExportPostBadRequest{} } -/*PcloudV2ImagesExportPostBadRequest handles this case with default header values. +/* PcloudV2ImagesExportPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudV2ImagesExportPostBadRequest struct { func (o *PcloudV2ImagesExportPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2ImagesExportPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudV2ImagesExportPostUnauthorized() *PcloudV2ImagesExportPostUnauthor return &PcloudV2ImagesExportPostUnauthorized{} } -/*PcloudV2ImagesExportPostUnauthorized handles this case with default header values. +/* PcloudV2ImagesExportPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudV2ImagesExportPostUnauthorized struct { func (o *PcloudV2ImagesExportPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2ImagesExportPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudV2ImagesExportPostNotFound() *PcloudV2ImagesExportPostNotFound { return &PcloudV2ImagesExportPostNotFound{} } -/*PcloudV2ImagesExportPostNotFound handles this case with default header values. +/* PcloudV2ImagesExportPostNotFound describes a response with status code 404, with default header values. image id not found */ @@ -182,6 +182,9 @@ type PcloudV2ImagesExportPostNotFound struct { func (o *PcloudV2ImagesExportPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2ImagesExportPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudV2ImagesExportPostConflict() *PcloudV2ImagesExportPostConflict { return &PcloudV2ImagesExportPostConflict{} } -/*PcloudV2ImagesExportPostConflict handles this case with default header values. +/* PcloudV2ImagesExportPostConflict describes a response with status code 409, with default header values. Conflict, a conflict has prevented adding image export job */ @@ -211,6 +214,9 @@ type PcloudV2ImagesExportPostConflict struct { func (o *PcloudV2ImagesExportPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostConflict %+v", 409, o.Payload) } +func (o *PcloudV2ImagesExportPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudV2ImagesExportPostUnprocessableEntity() *PcloudV2ImagesExportPostU return &PcloudV2ImagesExportPostUnprocessableEntity{} } -/*PcloudV2ImagesExportPostUnprocessableEntity handles this case with default header values. +/* PcloudV2ImagesExportPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudV2ImagesExportPostUnprocessableEntity struct { func (o *PcloudV2ImagesExportPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudV2ImagesExportPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudV2ImagesExportPostInternalServerError() *PcloudV2ImagesExportPostI return &PcloudV2ImagesExportPostInternalServerError{} } -/*PcloudV2ImagesExportPostInternalServerError handles this case with default header values. +/* PcloudV2ImagesExportPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudV2ImagesExportPostInternalServerError struct { func (o *PcloudV2ImagesExportPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2ImagesExportPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2ImagesExportPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go index 512cca71e8..b8c3c3c8b1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go @@ -6,13 +6,14 @@ package p_cloud_instances // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,29 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesDeleteOK, error) + + PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesGetOK, error) + + PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudCloudinstancesDelete deletes a power cloud instance + PcloudCloudinstancesDelete deletes a power cloud instance */ -func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesDeleteOK, error) { +func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}", @@ -45,24 +59,34 @@ func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeletePa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesDeleteOK), nil - + success, ok := result.(*PcloudCloudinstancesDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesGet gets a cloud instance s current state information + PcloudCloudinstancesGet gets a cloud instance s current state information */ -func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesGetOK, error) { +func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}", @@ -74,24 +98,34 @@ func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesGetOK), nil - + success, ok := result.(*PcloudCloudinstancesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesPut updates upgrade a cloud instance + PcloudCloudinstancesPut updates upgrade a cloud instance */ -func (a *Client) PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesPutOK, error) { +func (a *Client) PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}", @@ -103,12 +137,23 @@ func (a *Client) PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesPutOK), nil - + success, ok := result.(*PcloudCloudinstancesPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go index a55acf93e2..e375cf1652 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesDeleteParams creates a new PcloudCloudinstancesDeleteParams object -// with the default values initialized. +// NewPcloudCloudinstancesDeleteParams creates a new PcloudCloudinstancesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesDeleteParams() *PcloudCloudinstancesDeleteParams { - var () return &PcloudCloudinstancesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesDeleteParamsWithTimeout creates a new PcloudCloudinstancesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesDeleteParams { - var () return &PcloudCloudinstancesDeleteParams{ - timeout: timeout, } } // NewPcloudCloudinstancesDeleteParamsWithContext creates a new PcloudCloudinstancesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesDeleteParams { - var () return &PcloudCloudinstancesDeleteParams{ - Context: ctx, } } // NewPcloudCloudinstancesDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesDeleteParams { - var () return &PcloudCloudinstancesDeleteParams{ HTTPClient: client, } } -/*PcloudCloudinstancesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances delete operation typically these are written to a http.Request +/* PcloudCloudinstancesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudCloudinstancesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesDeleteParams) WithDefaults() *PcloudCloudinstancesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances delete params func (o *PcloudCloudinstancesDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go index c9d968005b..6bd8adbbad 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesDeleteReader is a Reader for the PcloudCloudinstancesDelete structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudCloudinstancesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesDeleteOK() *PcloudCloudinstancesDeleteOK { return &PcloudCloudinstancesDeleteOK{} } -/*PcloudCloudinstancesDeleteOK handles this case with default header values. +/* PcloudCloudinstancesDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesDeleteOK struct { func (o *PcloudCloudinstancesDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudCloudinstancesDeleteBadRequest() *PcloudCloudinstancesDeleteBadReq return &PcloudCloudinstancesDeleteBadRequest{} } -/*PcloudCloudinstancesDeleteBadRequest handles this case with default header values. +/* PcloudCloudinstancesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudCloudinstancesDeleteBadRequest struct { func (o *PcloudCloudinstancesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudCloudinstancesDeleteUnauthorized() *PcloudCloudinstancesDeleteUnau return &PcloudCloudinstancesDeleteUnauthorized{} } -/*PcloudCloudinstancesDeleteUnauthorized handles this case with default header values. +/* PcloudCloudinstancesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudCloudinstancesDeleteUnauthorized struct { func (o *PcloudCloudinstancesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudCloudinstancesDeleteGone() *PcloudCloudinstancesDeleteGone { return &PcloudCloudinstancesDeleteGone{} } -/*PcloudCloudinstancesDeleteGone handles this case with default header values. +/* PcloudCloudinstancesDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudCloudinstancesDeleteGone struct { func (o *PcloudCloudinstancesDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteGone %+v", 410, o.Payload) } +func (o *PcloudCloudinstancesDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudCloudinstancesDeleteInternalServerError() *PcloudCloudinstancesDel return &PcloudCloudinstancesDeleteInternalServerError{} } -/*PcloudCloudinstancesDeleteInternalServerError handles this case with default header values. +/* PcloudCloudinstancesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudCloudinstancesDeleteInternalServerError struct { func (o *PcloudCloudinstancesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go index 2ee7da64cd..4eda9ee4e0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesGetParams creates a new PcloudCloudinstancesGetParams object -// with the default values initialized. +// NewPcloudCloudinstancesGetParams creates a new PcloudCloudinstancesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesGetParams() *PcloudCloudinstancesGetParams { - var () return &PcloudCloudinstancesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesGetParamsWithTimeout creates a new PcloudCloudinstancesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesGetParams { - var () return &PcloudCloudinstancesGetParams{ - timeout: timeout, } } // NewPcloudCloudinstancesGetParamsWithContext creates a new PcloudCloudinstancesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesGetParams { - var () return &PcloudCloudinstancesGetParams{ - Context: ctx, } } // NewPcloudCloudinstancesGetParamsWithHTTPClient creates a new PcloudCloudinstancesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesGetParams { - var () return &PcloudCloudinstancesGetParams{ HTTPClient: client, } } -/*PcloudCloudinstancesGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances get operation typically these are written to a http.Request +/* PcloudCloudinstancesGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances get operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudCloudinstancesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesGetParams) WithDefaults() *PcloudCloudinstancesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances get params func (o *PcloudCloudinstancesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go index c2e7517d65..c7056df69f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesGetReader is a Reader for the PcloudCloudinstancesGet structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesGetOK() *PcloudCloudinstancesGetOK { return &PcloudCloudinstancesGetOK{} } -/*PcloudCloudinstancesGetOK handles this case with default header values. +/* PcloudCloudinstancesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesGetOK struct { func (o *PcloudCloudinstancesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesGetOK) GetPayload() *models.CloudInstance { + return o.Payload +} func (o *PcloudCloudinstancesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesGetBadRequest() *PcloudCloudinstancesGetBadRequest { return &PcloudCloudinstancesGetBadRequest{} } -/*PcloudCloudinstancesGetBadRequest handles this case with default header values. +/* PcloudCloudinstancesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesGetBadRequest struct { func (o *PcloudCloudinstancesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesGetUnauthorized() *PcloudCloudinstancesGetUnauthoriz return &PcloudCloudinstancesGetUnauthorized{} } -/*PcloudCloudinstancesGetUnauthorized handles this case with default header values. +/* PcloudCloudinstancesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesGetUnauthorized struct { func (o *PcloudCloudinstancesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesGetNotFound() *PcloudCloudinstancesGetNotFound { return &PcloudCloudinstancesGetNotFound{} } -/*PcloudCloudinstancesGetNotFound handles this case with default header values. +/* PcloudCloudinstancesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesGetNotFound struct { func (o *PcloudCloudinstancesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesGetInternalServerError() *PcloudCloudinstancesGetInt return &PcloudCloudinstancesGetInternalServerError{} } -/*PcloudCloudinstancesGetInternalServerError handles this case with default header values. +/* PcloudCloudinstancesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesGetInternalServerError struct { func (o *PcloudCloudinstancesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go index 04a998b458..4e47d1af78 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesPutParams creates a new PcloudCloudinstancesPutParams object -// with the default values initialized. +// NewPcloudCloudinstancesPutParams creates a new PcloudCloudinstancesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesPutParams() *PcloudCloudinstancesPutParams { - var () return &PcloudCloudinstancesPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesPutParamsWithTimeout creates a new PcloudCloudinstancesPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesPutParams { - var () return &PcloudCloudinstancesPutParams{ - timeout: timeout, } } // NewPcloudCloudinstancesPutParamsWithContext creates a new PcloudCloudinstancesPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesPutParams { - var () return &PcloudCloudinstancesPutParams{ - Context: ctx, } } // NewPcloudCloudinstancesPutParamsWithHTTPClient creates a new PcloudCloudinstancesPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesPutParams { - var () return &PcloudCloudinstancesPutParams{ HTTPClient: client, } } -/*PcloudCloudinstancesPutParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances put operation typically these are written to a http.Request +/* PcloudCloudinstancesPutParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances put operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesPutParams struct { - /*Body - Parameters for updating a Power Cloud Instance + /* Body. + Parameters for updating a Power Cloud Instance */ Body *models.CloudInstanceUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudCloudinstancesPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesPutParams) WithDefaults() *PcloudCloudinstancesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances put params func (o *PcloudCloudinstancesPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesPutParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudCloudinstancesPutParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go index 8e7cdbc395..8d6cf4b567 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesPutReader is a Reader for the PcloudCloudinstancesPut structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudinstancesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesPutOK() *PcloudCloudinstancesPutOK { return &PcloudCloudinstancesPutOK{} } -/*PcloudCloudinstancesPutOK handles this case with default header values. +/* PcloudCloudinstancesPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesPutOK struct { func (o *PcloudCloudinstancesPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesPutOK) GetPayload() *models.CloudInstance { + return o.Payload +} func (o *PcloudCloudinstancesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesPutBadRequest() *PcloudCloudinstancesPutBadRequest { return &PcloudCloudinstancesPutBadRequest{} } -/*PcloudCloudinstancesPutBadRequest handles this case with default header values. +/* PcloudCloudinstancesPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesPutBadRequest struct { func (o *PcloudCloudinstancesPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesPutUnauthorized() *PcloudCloudinstancesPutUnauthoriz return &PcloudCloudinstancesPutUnauthorized{} } -/*PcloudCloudinstancesPutUnauthorized handles this case with default header values. +/* PcloudCloudinstancesPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesPutUnauthorized struct { func (o *PcloudCloudinstancesPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesPutUnprocessableEntity() *PcloudCloudinstancesPutUnp return &PcloudCloudinstancesPutUnprocessableEntity{} } -/*PcloudCloudinstancesPutUnprocessableEntity handles this case with default header values. +/* PcloudCloudinstancesPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesPutUnprocessableEntity struct { func (o *PcloudCloudinstancesPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudinstancesPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesPutInternalServerError() *PcloudCloudinstancesPutInt return &PcloudCloudinstancesPutInternalServerError{} } -/*PcloudCloudinstancesPutInternalServerError handles this case with default header values. +/* PcloudCloudinstancesPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesPutInternalServerError struct { func (o *PcloudCloudinstancesPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go index 905abf6818..0d4c362afd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go @@ -6,13 +6,14 @@ package p_cloud_jobs // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud jobs API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,29 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsDeleteOK, error) + + PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetOK, error) + + PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetallOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudCloudinstancesJobsDelete deletes a cloud instance job + PcloudCloudinstancesJobsDelete deletes a cloud instance job */ -func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesJobsDeleteOK, error) { +func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesJobsDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.jobs.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}", @@ -45,24 +59,34 @@ func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobs AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesJobsDeleteOK), nil - + success, ok := result.(*PcloudCloudinstancesJobsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesJobsGet lists the detail of a job + PcloudCloudinstancesJobsGet lists the detail of a job */ -func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesJobsGetOK, error) { +func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesJobsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.jobs.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}", @@ -74,24 +98,34 @@ func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGet AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesJobsGetOK), nil - + success, ok := result.(*PcloudCloudinstancesJobsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesJobsGetall lists up to the last 5 jobs initiated by the cloud instance + PcloudCloudinstancesJobsGetall lists up to the last 5 jobs initiated by the cloud instance */ -func (a *Client) PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesJobsGetallOK, error) { +func (a *Client) PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesJobsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.jobs.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/jobs", @@ -103,12 +137,23 @@ func (a *Client) PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobs AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesJobsGetallOK), nil - + success, ok := result.(*PcloudCloudinstancesJobsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go index 7468f7157e..9e3b31e1ef 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesJobsDeleteParams creates a new PcloudCloudinstancesJobsDeleteParams object -// with the default values initialized. +// NewPcloudCloudinstancesJobsDeleteParams creates a new PcloudCloudinstancesJobsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesJobsDeleteParams() *PcloudCloudinstancesJobsDeleteParams { - var () return &PcloudCloudinstancesJobsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesJobsDeleteParamsWithTimeout creates a new PcloudCloudinstancesJobsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesJobsDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsDeleteParams { - var () return &PcloudCloudinstancesJobsDeleteParams{ - timeout: timeout, } } // NewPcloudCloudinstancesJobsDeleteParamsWithContext creates a new PcloudCloudinstancesJobsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesJobsDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesJobsDeleteParams { - var () return &PcloudCloudinstancesJobsDeleteParams{ - Context: ctx, } } // NewPcloudCloudinstancesJobsDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesJobsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesJobsDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsDeleteParams { - var () return &PcloudCloudinstancesJobsDeleteParams{ HTTPClient: client, } } -/*PcloudCloudinstancesJobsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances jobs delete operation typically these are written to a http.Request +/* PcloudCloudinstancesJobsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances jobs delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesJobsDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*JobID - PCloud Job ID + /* JobID. + + PCloud Job ID */ JobID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesJobsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances jobs delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesJobsDeleteParams) WithDefaults() *PcloudCloudinstancesJobsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances jobs delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesJobsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances jobs delete params func (o *PcloudCloudinstancesJobsDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go index bdc2746073..da6ffd992d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesJobsDeleteReader is a Reader for the PcloudCloudinstancesJobsDelete structure. @@ -24,51 +23,44 @@ type PcloudCloudinstancesJobsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesJobsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesJobsDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesJobsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesJobsDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesJobsDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudCloudinstancesJobsDeleteConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesJobsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudinstancesJobsDeleteOK() *PcloudCloudinstancesJobsDeleteOK { return &PcloudCloudinstancesJobsDeleteOK{} } -/*PcloudCloudinstancesJobsDeleteOK handles this case with default header values. +/* PcloudCloudinstancesJobsDeleteOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudCloudinstancesJobsDeleteOK struct { func (o *PcloudCloudinstancesJobsDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesJobsDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesJobsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudCloudinstancesJobsDeleteBadRequest() *PcloudCloudinstancesJobsDele return &PcloudCloudinstancesJobsDeleteBadRequest{} } -/*PcloudCloudinstancesJobsDeleteBadRequest handles this case with default header values. +/* PcloudCloudinstancesJobsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -115,6 +110,9 @@ type PcloudCloudinstancesJobsDeleteBadRequest struct { func (o *PcloudCloudinstancesJobsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesJobsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudCloudinstancesJobsDeleteUnauthorized() *PcloudCloudinstancesJobsDe return &PcloudCloudinstancesJobsDeleteUnauthorized{} } -/*PcloudCloudinstancesJobsDeleteUnauthorized handles this case with default header values. +/* PcloudCloudinstancesJobsDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -144,6 +142,9 @@ type PcloudCloudinstancesJobsDeleteUnauthorized struct { func (o *PcloudCloudinstancesJobsDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesJobsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudCloudinstancesJobsDeleteNotFound() *PcloudCloudinstancesJobsDelete return &PcloudCloudinstancesJobsDeleteNotFound{} } -/*PcloudCloudinstancesJobsDeleteNotFound handles this case with default header values. +/* PcloudCloudinstancesJobsDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -173,6 +174,9 @@ type PcloudCloudinstancesJobsDeleteNotFound struct { func (o *PcloudCloudinstancesJobsDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesJobsDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudCloudinstancesJobsDeleteConflict() *PcloudCloudinstancesJobsDelete return &PcloudCloudinstancesJobsDeleteConflict{} } -/*PcloudCloudinstancesJobsDeleteConflict handles this case with default header values. +/* PcloudCloudinstancesJobsDeleteConflict describes a response with status code 409, with default header values. Conflict */ @@ -202,6 +206,9 @@ type PcloudCloudinstancesJobsDeleteConflict struct { func (o *PcloudCloudinstancesJobsDeleteConflict) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteConflict %+v", 409, o.Payload) } +func (o *PcloudCloudinstancesJobsDeleteConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudCloudinstancesJobsDeleteInternalServerError() *PcloudCloudinstance return &PcloudCloudinstancesJobsDeleteInternalServerError{} } -/*PcloudCloudinstancesJobsDeleteInternalServerError handles this case with default header values. +/* PcloudCloudinstancesJobsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudCloudinstancesJobsDeleteInternalServerError struct { func (o *PcloudCloudinstancesJobsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesJobsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go index 68c7dd1b9e..8b58435479 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesJobsGetParams creates a new PcloudCloudinstancesJobsGetParams object -// with the default values initialized. +// NewPcloudCloudinstancesJobsGetParams creates a new PcloudCloudinstancesJobsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesJobsGetParams() *PcloudCloudinstancesJobsGetParams { - var () return &PcloudCloudinstancesJobsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesJobsGetParamsWithTimeout creates a new PcloudCloudinstancesJobsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesJobsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetParams { - var () return &PcloudCloudinstancesJobsGetParams{ - timeout: timeout, } } // NewPcloudCloudinstancesJobsGetParamsWithContext creates a new PcloudCloudinstancesJobsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesJobsGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesJobsGetParams { - var () return &PcloudCloudinstancesJobsGetParams{ - Context: ctx, } } // NewPcloudCloudinstancesJobsGetParamsWithHTTPClient creates a new PcloudCloudinstancesJobsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesJobsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetParams { - var () return &PcloudCloudinstancesJobsGetParams{ HTTPClient: client, } } -/*PcloudCloudinstancesJobsGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances jobs get operation typically these are written to a http.Request +/* PcloudCloudinstancesJobsGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances jobs get operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesJobsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*JobID - PCloud Job ID + /* JobID. + + PCloud Job ID */ JobID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesJobsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances jobs get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesJobsGetParams) WithDefaults() *PcloudCloudinstancesJobsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances jobs get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesJobsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances jobs get params func (o *PcloudCloudinstancesJobsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go index 0c84485727..b232653f03 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesJobsGetReader is a Reader for the PcloudCloudinstancesJobsGet structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesJobsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesJobsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesJobsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesJobsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesJobsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesJobsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesJobsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesJobsGetOK() *PcloudCloudinstancesJobsGetOK { return &PcloudCloudinstancesJobsGetOK{} } -/*PcloudCloudinstancesJobsGetOK handles this case with default header values. +/* PcloudCloudinstancesJobsGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesJobsGetOK struct { func (o *PcloudCloudinstancesJobsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesJobsGetOK) GetPayload() *models.Job { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesJobsGetBadRequest() *PcloudCloudinstancesJobsGetBadR return &PcloudCloudinstancesJobsGetBadRequest{} } -/*PcloudCloudinstancesJobsGetBadRequest handles this case with default header values. +/* PcloudCloudinstancesJobsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesJobsGetBadRequest struct { func (o *PcloudCloudinstancesJobsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesJobsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesJobsGetUnauthorized() *PcloudCloudinstancesJobsGetUn return &PcloudCloudinstancesJobsGetUnauthorized{} } -/*PcloudCloudinstancesJobsGetUnauthorized handles this case with default header values. +/* PcloudCloudinstancesJobsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesJobsGetUnauthorized struct { func (o *PcloudCloudinstancesJobsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesJobsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesJobsGetNotFound() *PcloudCloudinstancesJobsGetNotFou return &PcloudCloudinstancesJobsGetNotFound{} } -/*PcloudCloudinstancesJobsGetNotFound handles this case with default header values. +/* PcloudCloudinstancesJobsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesJobsGetNotFound struct { func (o *PcloudCloudinstancesJobsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesJobsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesJobsGetInternalServerError() *PcloudCloudinstancesJo return &PcloudCloudinstancesJobsGetInternalServerError{} } -/*PcloudCloudinstancesJobsGetInternalServerError handles this case with default header values. +/* PcloudCloudinstancesJobsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesJobsGetInternalServerError struct { func (o *PcloudCloudinstancesJobsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesJobsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go index 6ed4d43267..50646a09eb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_parameters.go @@ -13,72 +13,73 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesJobsGetallParams creates a new PcloudCloudinstancesJobsGetallParams object -// with the default values initialized. +// NewPcloudCloudinstancesJobsGetallParams creates a new PcloudCloudinstancesJobsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesJobsGetallParams() *PcloudCloudinstancesJobsGetallParams { - var () return &PcloudCloudinstancesJobsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesJobsGetallParamsWithTimeout creates a new PcloudCloudinstancesJobsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesJobsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetallParams { - var () return &PcloudCloudinstancesJobsGetallParams{ - timeout: timeout, } } // NewPcloudCloudinstancesJobsGetallParamsWithContext creates a new PcloudCloudinstancesJobsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesJobsGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesJobsGetallParams { - var () return &PcloudCloudinstancesJobsGetallParams{ - Context: ctx, } } // NewPcloudCloudinstancesJobsGetallParamsWithHTTPClient creates a new PcloudCloudinstancesJobsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesJobsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetallParams { - var () return &PcloudCloudinstancesJobsGetallParams{ HTTPClient: client, } } -/*PcloudCloudinstancesJobsGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances jobs getall operation typically these are written to a http.Request +/* PcloudCloudinstancesJobsGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances jobs getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesJobsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*OperationAction - Operation action to filter jobs (optional) vmCapture - includes operation action value (vmCapture) imageExport - includes operation action value (imageExport) imageImport - includes operation action value (imageImport) storage - includes operation action values (vmCapture,imageExport,imageImport) + /* OperationAction. + + Operation action to filter jobs (optional) vmCapture - includes operation action value (vmCapture) imageExport - includes operation action value (imageExport) imageImport - includes operation action value (imageImport) storage - includes operation action values (vmCapture,imageExport,imageImport) */ OperationAction *string - /*OperationID - Operation ID to filter jobs (optional) + /* OperationID. + + Operation ID to filter jobs (optional) */ OperationID *string - /*OperationTarget - Operation target to filter jobs (optional) + /* OperationTarget. + + Operation target to filter jobs (optional) */ OperationTarget *string @@ -87,6 +88,21 @@ type PcloudCloudinstancesJobsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances jobs getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesJobsGetallParams) WithDefaults() *PcloudCloudinstancesJobsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances jobs getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesJobsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances jobs getall params func (o *PcloudCloudinstancesJobsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetallParams { o.SetTimeout(timeout) @@ -181,48 +197,51 @@ func (o *PcloudCloudinstancesJobsGetallParams) WriteToRequest(r runtime.ClientRe // query param operation.action var qrOperationAction string + if o.OperationAction != nil { qrOperationAction = *o.OperationAction } qOperationAction := qrOperationAction if qOperationAction != "" { + if err := r.SetQueryParam("operation.action", qOperationAction); err != nil { return err } } - } if o.OperationID != nil { // query param operation.id var qrOperationID string + if o.OperationID != nil { qrOperationID = *o.OperationID } qOperationID := qrOperationID if qOperationID != "" { + if err := r.SetQueryParam("operation.id", qOperationID); err != nil { return err } } - } if o.OperationTarget != nil { // query param operation.target var qrOperationTarget string + if o.OperationTarget != nil { qrOperationTarget = *o.OperationTarget } qOperationTarget := qrOperationTarget if qOperationTarget != "" { + if err := r.SetQueryParam("operation.target", qOperationTarget); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go index a73cfdf740..d3b942e52f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesJobsGetallReader is a Reader for the PcloudCloudinstancesJobsGetall structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesJobsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesJobsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesJobsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesJobsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesJobsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesJobsGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesJobsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesJobsGetallOK() *PcloudCloudinstancesJobsGetallOK { return &PcloudCloudinstancesJobsGetallOK{} } -/*PcloudCloudinstancesJobsGetallOK handles this case with default header values. +/* PcloudCloudinstancesJobsGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesJobsGetallOK struct { func (o *PcloudCloudinstancesJobsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesJobsGetallOK) GetPayload() *models.Jobs { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesJobsGetallBadRequest() *PcloudCloudinstancesJobsGeta return &PcloudCloudinstancesJobsGetallBadRequest{} } -/*PcloudCloudinstancesJobsGetallBadRequest handles this case with default header values. +/* PcloudCloudinstancesJobsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesJobsGetallBadRequest struct { func (o *PcloudCloudinstancesJobsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesJobsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesJobsGetallUnauthorized() *PcloudCloudinstancesJobsGe return &PcloudCloudinstancesJobsGetallUnauthorized{} } -/*PcloudCloudinstancesJobsGetallUnauthorized handles this case with default header values. +/* PcloudCloudinstancesJobsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesJobsGetallUnauthorized struct { func (o *PcloudCloudinstancesJobsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesJobsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesJobsGetallNotFound() *PcloudCloudinstancesJobsGetall return &PcloudCloudinstancesJobsGetallNotFound{} } -/*PcloudCloudinstancesJobsGetallNotFound handles this case with default header values. +/* PcloudCloudinstancesJobsGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesJobsGetallNotFound struct { func (o *PcloudCloudinstancesJobsGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesJobsGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesJobsGetallInternalServerError() *PcloudCloudinstance return &PcloudCloudinstancesJobsGetallInternalServerError{} } -/*PcloudCloudinstancesJobsGetallInternalServerError handles this case with default header values. +/* PcloudCloudinstancesJobsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesJobsGetallInternalServerError struct { func (o *PcloudCloudinstancesJobsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesJobsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesJobsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go index a264c42169..5a08ce2c9b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go @@ -6,13 +6,14 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud networks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,43 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksDeleteOK, error) + + PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetOK, error) + + PcloudNetworksGetall(params *PcloudNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetallOK, error) + + PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsDeleteOK, error) + + PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetOK, error) + + PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetallOK, error) + + PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPostCreated, error) + + PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPutOK, error) + + PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPostOK, *PcloudNetworksPostCreated, error) + + PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudNetworksDelete deletes a network + PcloudNetworksDelete deletes a network */ -func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksDeleteOK, error) { +func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}", @@ -45,24 +73,34 @@ func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authIn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksDeleteOK), nil - + success, ok := result.(*PcloudNetworksDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksGet gets a network s current state information + PcloudNetworksGet gets a network s current state information */ -func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksGetOK, error) { +func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}", @@ -74,24 +112,34 @@ func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksGetOK), nil - + success, ok := result.(*PcloudNetworksGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksGetall gets all networks in this cloud instance + PcloudNetworksGetall gets all networks in this cloud instance */ -func (a *Client) PcloudNetworksGetall(params *PcloudNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksGetallOK, error) { +func (a *Client) PcloudNetworksGetall(params *PcloudNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks", @@ -103,24 +151,34 @@ func (a *Client) PcloudNetworksGetall(params *PcloudNetworksGetallParams, authIn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksGetallOK), nil - + success, ok := result.(*PcloudNetworksGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPortsDelete deletes a network port + PcloudNetworksPortsDelete deletes a network port */ -func (a *Client) PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPortsDeleteOK, error) { +func (a *Client) PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPortsDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.ports.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}", @@ -132,24 +190,34 @@ func (a *Client) PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeletePara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksPortsDeleteOK), nil - + success, ok := result.(*PcloudNetworksPortsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPortsGet gets a port s information + PcloudNetworksPortsGet gets a port s information */ -func (a *Client) PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPortsGetOK, error) { +func (a *Client) PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPortsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.ports.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}", @@ -161,24 +229,34 @@ func (a *Client) PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, au AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksPortsGetOK), nil - + success, ok := result.(*PcloudNetworksPortsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPortsGetall gets all ports for this network + PcloudNetworksPortsGetall gets all ports for this network */ -func (a *Client) PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPortsGetallOK, error) { +func (a *Client) PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPortsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.ports.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports", @@ -190,24 +268,34 @@ func (a *Client) PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksPortsGetallOK), nil - + success, ok := result.(*PcloudNetworksPortsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPortsPost performs port addition deletion and listing + PcloudNetworksPortsPost performs port addition deletion and listing */ -func (a *Client) PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPortsPostCreated, error) { +func (a *Client) PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPostCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPortsPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.ports.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports", @@ -219,24 +307,34 @@ func (a *Client) PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksPortsPostCreated), nil - + success, ok := result.(*PcloudNetworksPortsPostCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPortsPut updates a port s information + PcloudNetworksPortsPut updates a port s information */ -func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPortsPutOK, error) { +func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPortsPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.ports.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}", @@ -248,24 +346,34 @@ func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, au AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksPortsPutOK), nil - + success, ok := result.(*PcloudNetworksPortsPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPost creates a new network + PcloudNetworksPost creates a new network */ -func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPostOK, *PcloudNetworksPostCreated, error) { +func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPostOK, *PcloudNetworksPostCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks", @@ -277,7 +385,12 @@ func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo r AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -287,20 +400,20 @@ func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo r case *PcloudNetworksPostCreated: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_networks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudNetworksPut updates a network + PcloudNetworksPut updates a network */ -func (a *Client) PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudNetworksPutOK, error) { +func (a *Client) PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudNetworksPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.networks.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}", @@ -312,12 +425,23 @@ func (a *Client) PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudNetworksPutOK), nil - + success, ok := result.(*PcloudNetworksPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.networks.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go index c823a42771..ed9fd5e8b6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudNetworksDeleteParams creates a new PcloudNetworksDeleteParams object -// with the default values initialized. +// NewPcloudNetworksDeleteParams creates a new PcloudNetworksDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksDeleteParams() *PcloudNetworksDeleteParams { - var () return &PcloudNetworksDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksDeleteParamsWithTimeout creates a new PcloudNetworksDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudNetworksDeleteParams { - var () return &PcloudNetworksDeleteParams{ - timeout: timeout, } } // NewPcloudNetworksDeleteParamsWithContext creates a new PcloudNetworksDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksDeleteParamsWithContext(ctx context.Context) *PcloudNetworksDeleteParams { - var () return &PcloudNetworksDeleteParams{ - Context: ctx, } } // NewPcloudNetworksDeleteParamsWithHTTPClient creates a new PcloudNetworksDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudNetworksDeleteParams { - var () return &PcloudNetworksDeleteParams{ HTTPClient: client, } } -/*PcloudNetworksDeleteParams contains all the parameters to send to the API endpoint -for the pcloud networks delete operation typically these are written to a http.Request +/* PcloudNetworksDeleteParams contains all the parameters to send to the API endpoint + for the pcloud networks delete operation. + + Typically these are written to a http.Request. */ type PcloudNetworksDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -77,6 +76,21 @@ type PcloudNetworksDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksDeleteParams) WithDefaults() *PcloudNetworksDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks delete params func (o *PcloudNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudNetworksDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go index 75172ea3fd..67dba95234 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksDeleteReader is a Reader for the PcloudNetworksDelete structure. @@ -24,44 +23,38 @@ type PcloudNetworksDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudNetworksDeleteOK() *PcloudNetworksDeleteOK { return &PcloudNetworksDeleteOK{} } -/*PcloudNetworksDeleteOK handles this case with default header values. +/* PcloudNetworksDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudNetworksDeleteOK struct { func (o *PcloudNetworksDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteOK %+v", 200, o.Payload) } +func (o *PcloudNetworksDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudNetworksDeleteBadRequest() *PcloudNetworksDeleteBadRequest { return &PcloudNetworksDeleteBadRequest{} } -/*PcloudNetworksDeleteBadRequest handles this case with default header values. +/* PcloudNetworksDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudNetworksDeleteBadRequest struct { func (o *PcloudNetworksDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudNetworksDeleteUnauthorized() *PcloudNetworksDeleteUnauthorized { return &PcloudNetworksDeleteUnauthorized{} } -/*PcloudNetworksDeleteUnauthorized handles this case with default header values. +/* PcloudNetworksDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudNetworksDeleteUnauthorized struct { func (o *PcloudNetworksDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudNetworksDeleteGone() *PcloudNetworksDeleteGone { return &PcloudNetworksDeleteGone{} } -/*PcloudNetworksDeleteGone handles this case with default header values. +/* PcloudNetworksDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudNetworksDeleteGone struct { func (o *PcloudNetworksDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteGone %+v", 410, o.Payload) } +func (o *PcloudNetworksDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudNetworksDeleteInternalServerError() *PcloudNetworksDeleteInternalS return &PcloudNetworksDeleteInternalServerError{} } -/*PcloudNetworksDeleteInternalServerError handles this case with default header values. +/* PcloudNetworksDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudNetworksDeleteInternalServerError struct { func (o *PcloudNetworksDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_parameters.go index ff53360917..a9694c898a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudNetworksGetParams creates a new PcloudNetworksGetParams object -// with the default values initialized. +// NewPcloudNetworksGetParams creates a new PcloudNetworksGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksGetParams() *PcloudNetworksGetParams { - var () return &PcloudNetworksGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksGetParamsWithTimeout creates a new PcloudNetworksGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudNetworksGetParams { - var () return &PcloudNetworksGetParams{ - timeout: timeout, } } // NewPcloudNetworksGetParamsWithContext creates a new PcloudNetworksGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksGetParamsWithContext(ctx context.Context) *PcloudNetworksGetParams { - var () return &PcloudNetworksGetParams{ - Context: ctx, } } // NewPcloudNetworksGetParamsWithHTTPClient creates a new PcloudNetworksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudNetworksGetParams { - var () return &PcloudNetworksGetParams{ HTTPClient: client, } } -/*PcloudNetworksGetParams contains all the parameters to send to the API endpoint -for the pcloud networks get operation typically these are written to a http.Request +/* PcloudNetworksGetParams contains all the parameters to send to the API endpoint + for the pcloud networks get operation. + + Typically these are written to a http.Request. */ type PcloudNetworksGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -77,6 +76,21 @@ type PcloudNetworksGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksGetParams) WithDefaults() *PcloudNetworksGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks get params func (o *PcloudNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudNetworksGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go index 13369bee45..d66f5f1b20 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksGetReader is a Reader for the PcloudNetworksGet structure. @@ -24,44 +23,38 @@ type PcloudNetworksGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudNetworksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudNetworksGetOK() *PcloudNetworksGetOK { return &PcloudNetworksGetOK{} } -/*PcloudNetworksGetOK handles this case with default header values. +/* PcloudNetworksGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudNetworksGetOK struct { func (o *PcloudNetworksGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetOK %+v", 200, o.Payload) } +func (o *PcloudNetworksGetOK) GetPayload() *models.Network { + return o.Payload +} func (o *PcloudNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudNetworksGetBadRequest() *PcloudNetworksGetBadRequest { return &PcloudNetworksGetBadRequest{} } -/*PcloudNetworksGetBadRequest handles this case with default header values. +/* PcloudNetworksGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudNetworksGetBadRequest struct { func (o *PcloudNetworksGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudNetworksGetUnauthorized() *PcloudNetworksGetUnauthorized { return &PcloudNetworksGetUnauthorized{} } -/*PcloudNetworksGetUnauthorized handles this case with default header values. +/* PcloudNetworksGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudNetworksGetUnauthorized struct { func (o *PcloudNetworksGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudNetworksGetNotFound() *PcloudNetworksGetNotFound { return &PcloudNetworksGetNotFound{} } -/*PcloudNetworksGetNotFound handles this case with default header values. +/* PcloudNetworksGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudNetworksGetNotFound struct { func (o *PcloudNetworksGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetNotFound %+v", 404, o.Payload) } +func (o *PcloudNetworksGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudNetworksGetInternalServerError() *PcloudNetworksGetInternalServerE return &PcloudNetworksGetInternalServerError{} } -/*PcloudNetworksGetInternalServerError handles this case with default header values. +/* PcloudNetworksGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudNetworksGetInternalServerError struct { func (o *PcloudNetworksGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go index f7313c8ee4..3ec2e1b918 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudNetworksGetallParams creates a new PcloudNetworksGetallParams object -// with the default values initialized. +// NewPcloudNetworksGetallParams creates a new PcloudNetworksGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksGetallParams() *PcloudNetworksGetallParams { - var () return &PcloudNetworksGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksGetallParamsWithTimeout creates a new PcloudNetworksGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksGetallParamsWithTimeout(timeout time.Duration) *PcloudNetworksGetallParams { - var () return &PcloudNetworksGetallParams{ - timeout: timeout, } } // NewPcloudNetworksGetallParamsWithContext creates a new PcloudNetworksGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksGetallParamsWithContext(ctx context.Context) *PcloudNetworksGetallParams { - var () return &PcloudNetworksGetallParams{ - Context: ctx, } } // NewPcloudNetworksGetallParamsWithHTTPClient creates a new PcloudNetworksGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksGetallParamsWithHTTPClient(client *http.Client) *PcloudNetworksGetallParams { - var () return &PcloudNetworksGetallParams{ HTTPClient: client, } } -/*PcloudNetworksGetallParams contains all the parameters to send to the API endpoint -for the pcloud networks getall operation typically these are written to a http.Request +/* PcloudNetworksGetallParams contains all the parameters to send to the API endpoint + for the pcloud networks getall operation. + + Typically these are written to a http.Request. */ type PcloudNetworksGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*Filter - A filter expression that filters resources listed in the response + /* Filter. + + A filter expression that filters resources listed in the response */ Filter *string @@ -77,6 +76,21 @@ type PcloudNetworksGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksGetallParams) WithDefaults() *PcloudNetworksGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks getall params func (o *PcloudNetworksGetallParams) WithTimeout(timeout time.Duration) *PcloudNetworksGetallParams { o.SetTimeout(timeout) @@ -149,16 +163,17 @@ func (o *PcloudNetworksGetallParams) WriteToRequest(r runtime.ClientRequest, reg // query param filter var qrFilter string + if o.Filter != nil { qrFilter = *o.Filter } qFilter := qrFilter if qFilter != "" { + if err := r.SetQueryParam("filter", qFilter); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go index 21c3d2a47f..fd07134b23 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksGetallReader is a Reader for the PcloudNetworksGetall structure. @@ -24,37 +23,32 @@ type PcloudNetworksGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudNetworksGetallOK() *PcloudNetworksGetallOK { return &PcloudNetworksGetallOK{} } -/*PcloudNetworksGetallOK handles this case with default header values. +/* PcloudNetworksGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudNetworksGetallOK struct { func (o *PcloudNetworksGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallOK %+v", 200, o.Payload) } +func (o *PcloudNetworksGetallOK) GetPayload() *models.Networks { + return o.Payload +} func (o *PcloudNetworksGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudNetworksGetallBadRequest() *PcloudNetworksGetallBadRequest { return &PcloudNetworksGetallBadRequest{} } -/*PcloudNetworksGetallBadRequest handles this case with default header values. +/* PcloudNetworksGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudNetworksGetallBadRequest struct { func (o *PcloudNetworksGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudNetworksGetallUnauthorized() *PcloudNetworksGetallUnauthorized { return &PcloudNetworksGetallUnauthorized{} } -/*PcloudNetworksGetallUnauthorized handles this case with default header values. +/* PcloudNetworksGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudNetworksGetallUnauthorized struct { func (o *PcloudNetworksGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudNetworksGetallInternalServerError() *PcloudNetworksGetallInternalS return &PcloudNetworksGetallInternalServerError{} } -/*PcloudNetworksGetallInternalServerError handles this case with default header values. +/* PcloudNetworksGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudNetworksGetallInternalServerError struct { func (o *PcloudNetworksGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go index 01c40eeb06..2782cd9eb0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudNetworksPortsDeleteParams creates a new PcloudNetworksPortsDeleteParams object -// with the default values initialized. +// NewPcloudNetworksPortsDeleteParams creates a new PcloudNetworksPortsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPortsDeleteParams() *PcloudNetworksPortsDeleteParams { - var () return &PcloudNetworksPortsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPortsDeleteParamsWithTimeout creates a new PcloudNetworksPortsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPortsDeleteParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsDeleteParams { - var () return &PcloudNetworksPortsDeleteParams{ - timeout: timeout, } } // NewPcloudNetworksPortsDeleteParamsWithContext creates a new PcloudNetworksPortsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPortsDeleteParamsWithContext(ctx context.Context) *PcloudNetworksPortsDeleteParams { - var () return &PcloudNetworksPortsDeleteParams{ - Context: ctx, } } // NewPcloudNetworksPortsDeleteParamsWithHTTPClient creates a new PcloudNetworksPortsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPortsDeleteParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsDeleteParams { - var () return &PcloudNetworksPortsDeleteParams{ HTTPClient: client, } } -/*PcloudNetworksPortsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud networks ports delete operation typically these are written to a http.Request +/* PcloudNetworksPortsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud networks ports delete operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPortsDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string - /*PortID - Port ID + /* PortID. + + Port ID */ PortID string @@ -82,6 +82,21 @@ type PcloudNetworksPortsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks ports delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsDeleteParams) WithDefaults() *PcloudNetworksPortsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks ports delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks ports delete params func (o *PcloudNetworksPortsDeleteParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go index 38da0c6c60..45c94b0225 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPortsDeleteReader is a Reader for the PcloudNetworksPortsDelete structure. @@ -24,44 +23,38 @@ type PcloudNetworksPortsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksPortsDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksPortsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksPortsDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudNetworksPortsDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPortsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudNetworksPortsDeleteOK() *PcloudNetworksPortsDeleteOK { return &PcloudNetworksPortsDeleteOK{} } -/*PcloudNetworksPortsDeleteOK handles this case with default header values. +/* PcloudNetworksPortsDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudNetworksPortsDeleteOK struct { func (o *PcloudNetworksPortsDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteOK %+v", 200, o.Payload) } +func (o *PcloudNetworksPortsDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudNetworksPortsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudNetworksPortsDeleteBadRequest() *PcloudNetworksPortsDeleteBadReque return &PcloudNetworksPortsDeleteBadRequest{} } -/*PcloudNetworksPortsDeleteBadRequest handles this case with default header values. +/* PcloudNetworksPortsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudNetworksPortsDeleteBadRequest struct { func (o *PcloudNetworksPortsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksPortsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudNetworksPortsDeleteUnauthorized() *PcloudNetworksPortsDeleteUnauth return &PcloudNetworksPortsDeleteUnauthorized{} } -/*PcloudNetworksPortsDeleteUnauthorized handles this case with default header values. +/* PcloudNetworksPortsDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudNetworksPortsDeleteUnauthorized struct { func (o *PcloudNetworksPortsDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPortsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudNetworksPortsDeleteGone() *PcloudNetworksPortsDeleteGone { return &PcloudNetworksPortsDeleteGone{} } -/*PcloudNetworksPortsDeleteGone handles this case with default header values. +/* PcloudNetworksPortsDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudNetworksPortsDeleteGone struct { func (o *PcloudNetworksPortsDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteGone %+v", 410, o.Payload) } +func (o *PcloudNetworksPortsDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudNetworksPortsDeleteInternalServerError() *PcloudNetworksPortsDelet return &PcloudNetworksPortsDeleteInternalServerError{} } -/*PcloudNetworksPortsDeleteInternalServerError handles this case with default header values. +/* PcloudNetworksPortsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudNetworksPortsDeleteInternalServerError struct { func (o *PcloudNetworksPortsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPortsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go index c3ba79d1af..cced038778 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudNetworksPortsGetParams creates a new PcloudNetworksPortsGetParams object -// with the default values initialized. +// NewPcloudNetworksPortsGetParams creates a new PcloudNetworksPortsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPortsGetParams() *PcloudNetworksPortsGetParams { - var () return &PcloudNetworksPortsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPortsGetParamsWithTimeout creates a new PcloudNetworksPortsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPortsGetParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsGetParams { - var () return &PcloudNetworksPortsGetParams{ - timeout: timeout, } } // NewPcloudNetworksPortsGetParamsWithContext creates a new PcloudNetworksPortsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPortsGetParamsWithContext(ctx context.Context) *PcloudNetworksPortsGetParams { - var () return &PcloudNetworksPortsGetParams{ - Context: ctx, } } // NewPcloudNetworksPortsGetParamsWithHTTPClient creates a new PcloudNetworksPortsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPortsGetParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsGetParams { - var () return &PcloudNetworksPortsGetParams{ HTTPClient: client, } } -/*PcloudNetworksPortsGetParams contains all the parameters to send to the API endpoint -for the pcloud networks ports get operation typically these are written to a http.Request +/* PcloudNetworksPortsGetParams contains all the parameters to send to the API endpoint + for the pcloud networks ports get operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPortsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string - /*PortID - Port ID + /* PortID. + + Port ID */ PortID string @@ -82,6 +82,21 @@ type PcloudNetworksPortsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks ports get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsGetParams) WithDefaults() *PcloudNetworksPortsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks ports get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks ports get params func (o *PcloudNetworksPortsGetParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go index d41c736d16..70ff78c3f8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPortsGetReader is a Reader for the PcloudNetworksPortsGet structure. @@ -24,37 +23,32 @@ type PcloudNetworksPortsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPortsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksPortsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudNetworksPortsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudNetworksPortsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPortsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudNetworksPortsGetOK() *PcloudNetworksPortsGetOK { return &PcloudNetworksPortsGetOK{} } -/*PcloudNetworksPortsGetOK handles this case with default header values. +/* PcloudNetworksPortsGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudNetworksPortsGetOK struct { func (o *PcloudNetworksPortsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetOK %+v", 200, o.Payload) } +func (o *PcloudNetworksPortsGetOK) GetPayload() *models.NetworkPort { + return o.Payload +} func (o *PcloudNetworksPortsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudNetworksPortsGetUnauthorized() *PcloudNetworksPortsGetUnauthorized return &PcloudNetworksPortsGetUnauthorized{} } -/*PcloudNetworksPortsGetUnauthorized handles this case with default header values. +/* PcloudNetworksPortsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudNetworksPortsGetUnauthorized struct { func (o *PcloudNetworksPortsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPortsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudNetworksPortsGetNotFound() *PcloudNetworksPortsGetNotFound { return &PcloudNetworksPortsGetNotFound{} } -/*PcloudNetworksPortsGetNotFound handles this case with default header values. +/* PcloudNetworksPortsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudNetworksPortsGetNotFound struct { func (o *PcloudNetworksPortsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudNetworksPortsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudNetworksPortsGetInternalServerError() *PcloudNetworksPortsGetInter return &PcloudNetworksPortsGetInternalServerError{} } -/*PcloudNetworksPortsGetInternalServerError handles this case with default header values. +/* PcloudNetworksPortsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudNetworksPortsGetInternalServerError struct { func (o *PcloudNetworksPortsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPortsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go index 5dbb41a1a4..bae1e68171 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudNetworksPortsGetallParams creates a new PcloudNetworksPortsGetallParams object -// with the default values initialized. +// NewPcloudNetworksPortsGetallParams creates a new PcloudNetworksPortsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPortsGetallParams() *PcloudNetworksPortsGetallParams { - var () return &PcloudNetworksPortsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPortsGetallParamsWithTimeout creates a new PcloudNetworksPortsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPortsGetallParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsGetallParams { - var () return &PcloudNetworksPortsGetallParams{ - timeout: timeout, } } // NewPcloudNetworksPortsGetallParamsWithContext creates a new PcloudNetworksPortsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPortsGetallParamsWithContext(ctx context.Context) *PcloudNetworksPortsGetallParams { - var () return &PcloudNetworksPortsGetallParams{ - Context: ctx, } } // NewPcloudNetworksPortsGetallParamsWithHTTPClient creates a new PcloudNetworksPortsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPortsGetallParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsGetallParams { - var () return &PcloudNetworksPortsGetallParams{ HTTPClient: client, } } -/*PcloudNetworksPortsGetallParams contains all the parameters to send to the API endpoint -for the pcloud networks ports getall operation typically these are written to a http.Request +/* PcloudNetworksPortsGetallParams contains all the parameters to send to the API endpoint + for the pcloud networks ports getall operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPortsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -77,6 +76,21 @@ type PcloudNetworksPortsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks ports getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsGetallParams) WithDefaults() *PcloudNetworksPortsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks ports getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks ports getall params func (o *PcloudNetworksPortsGetallParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go index 174f34a00f..4c5a21006c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPortsGetallReader is a Reader for the PcloudNetworksPortsGetall structure. @@ -24,37 +23,32 @@ type PcloudNetworksPortsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPortsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksPortsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksPortsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksPortsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPortsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudNetworksPortsGetallOK() *PcloudNetworksPortsGetallOK { return &PcloudNetworksPortsGetallOK{} } -/*PcloudNetworksPortsGetallOK handles this case with default header values. +/* PcloudNetworksPortsGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudNetworksPortsGetallOK struct { func (o *PcloudNetworksPortsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallOK %+v", 200, o.Payload) } +func (o *PcloudNetworksPortsGetallOK) GetPayload() *models.NetworkPorts { + return o.Payload +} func (o *PcloudNetworksPortsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudNetworksPortsGetallBadRequest() *PcloudNetworksPortsGetallBadReque return &PcloudNetworksPortsGetallBadRequest{} } -/*PcloudNetworksPortsGetallBadRequest handles this case with default header values. +/* PcloudNetworksPortsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudNetworksPortsGetallBadRequest struct { func (o *PcloudNetworksPortsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksPortsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudNetworksPortsGetallUnauthorized() *PcloudNetworksPortsGetallUnauth return &PcloudNetworksPortsGetallUnauthorized{} } -/*PcloudNetworksPortsGetallUnauthorized handles this case with default header values. +/* PcloudNetworksPortsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudNetworksPortsGetallUnauthorized struct { func (o *PcloudNetworksPortsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPortsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudNetworksPortsGetallInternalServerError() *PcloudNetworksPortsGetal return &PcloudNetworksPortsGetallInternalServerError{} } -/*PcloudNetworksPortsGetallInternalServerError handles this case with default header values. +/* PcloudNetworksPortsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudNetworksPortsGetallInternalServerError struct { func (o *PcloudNetworksPortsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPortsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go index 37863da8e9..ffeb93590c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudNetworksPortsPostParams creates a new PcloudNetworksPortsPostParams object -// with the default values initialized. +// NewPcloudNetworksPortsPostParams creates a new PcloudNetworksPortsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPortsPostParams() *PcloudNetworksPortsPostParams { - var () return &PcloudNetworksPortsPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPortsPostParamsWithTimeout creates a new PcloudNetworksPortsPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPortsPostParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsPostParams { - var () return &PcloudNetworksPortsPostParams{ - timeout: timeout, } } // NewPcloudNetworksPortsPostParamsWithContext creates a new PcloudNetworksPortsPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPortsPostParamsWithContext(ctx context.Context) *PcloudNetworksPortsPostParams { - var () return &PcloudNetworksPortsPostParams{ - Context: ctx, } } // NewPcloudNetworksPortsPostParamsWithHTTPClient creates a new PcloudNetworksPortsPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPortsPostParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsPostParams { - var () return &PcloudNetworksPortsPostParams{ HTTPClient: client, } } -/*PcloudNetworksPortsPostParams contains all the parameters to send to the API endpoint -for the pcloud networks ports post operation typically these are written to a http.Request +/* PcloudNetworksPortsPostParams contains all the parameters to send to the API endpoint + for the pcloud networks ports post operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPortsPostParams struct { - /*Body - Create a Network Port + /* Body. + Create a Network Port */ Body *models.NetworkPortCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -84,6 +84,21 @@ type PcloudNetworksPortsPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks ports post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsPostParams) WithDefaults() *PcloudNetworksPortsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks ports post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks ports post params func (o *PcloudNetworksPortsPostParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudNetworksPortsPostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go index fc2881e2a6..a284e8b3ac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPortsPostReader is a Reader for the PcloudNetworksPortsPost structure. @@ -24,51 +23,44 @@ type PcloudNetworksPortsPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPortsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 201: result := NewPcloudNetworksPortsPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksPortsPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksPortsPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudNetworksPortsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudNetworksPortsPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPortsPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudNetworksPortsPostCreated() *PcloudNetworksPortsPostCreated { return &PcloudNetworksPortsPostCreated{} } -/*PcloudNetworksPortsPostCreated handles this case with default header values. +/* PcloudNetworksPortsPostCreated describes a response with status code 201, with default header values. Created */ @@ -88,6 +80,9 @@ type PcloudNetworksPortsPostCreated struct { func (o *PcloudNetworksPortsPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostCreated %+v", 201, o.Payload) } +func (o *PcloudNetworksPortsPostCreated) GetPayload() *models.NetworkPort { + return o.Payload +} func (o *PcloudNetworksPortsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudNetworksPortsPostBadRequest() *PcloudNetworksPortsPostBadRequest { return &PcloudNetworksPortsPostBadRequest{} } -/*PcloudNetworksPortsPostBadRequest handles this case with default header values. +/* PcloudNetworksPortsPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudNetworksPortsPostBadRequest struct { func (o *PcloudNetworksPortsPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksPortsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudNetworksPortsPostUnauthorized() *PcloudNetworksPortsPostUnauthoriz return &PcloudNetworksPortsPostUnauthorized{} } -/*PcloudNetworksPortsPostUnauthorized handles this case with default header values. +/* PcloudNetworksPortsPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudNetworksPortsPostUnauthorized struct { func (o *PcloudNetworksPortsPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPortsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudNetworksPortsPostConflict() *PcloudNetworksPortsPostConflict { return &PcloudNetworksPortsPostConflict{} } -/*PcloudNetworksPortsPostConflict handles this case with default header values. +/* PcloudNetworksPortsPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type PcloudNetworksPortsPostConflict struct { func (o *PcloudNetworksPortsPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostConflict %+v", 409, o.Payload) } +func (o *PcloudNetworksPortsPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudNetworksPortsPostUnprocessableEntity() *PcloudNetworksPortsPostUnp return &PcloudNetworksPortsPostUnprocessableEntity{} } -/*PcloudNetworksPortsPostUnprocessableEntity handles this case with default header values. +/* PcloudNetworksPortsPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudNetworksPortsPostUnprocessableEntity struct { func (o *PcloudNetworksPortsPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudNetworksPortsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudNetworksPortsPostInternalServerError() *PcloudNetworksPortsPostInt return &PcloudNetworksPortsPostInternalServerError{} } -/*PcloudNetworksPortsPostInternalServerError handles this case with default header values. +/* PcloudNetworksPortsPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudNetworksPortsPostInternalServerError struct { func (o *PcloudNetworksPortsPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPortsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go index 460a653862..fce7c87e67 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_parameters.go @@ -13,74 +13,75 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudNetworksPortsPutParams creates a new PcloudNetworksPortsPutParams object -// with the default values initialized. +// NewPcloudNetworksPortsPutParams creates a new PcloudNetworksPortsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPortsPutParams() *PcloudNetworksPortsPutParams { - var () return &PcloudNetworksPortsPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPortsPutParamsWithTimeout creates a new PcloudNetworksPortsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPortsPutParamsWithTimeout(timeout time.Duration) *PcloudNetworksPortsPutParams { - var () return &PcloudNetworksPortsPutParams{ - timeout: timeout, } } // NewPcloudNetworksPortsPutParamsWithContext creates a new PcloudNetworksPortsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPortsPutParamsWithContext(ctx context.Context) *PcloudNetworksPortsPutParams { - var () return &PcloudNetworksPortsPutParams{ - Context: ctx, } } // NewPcloudNetworksPortsPutParamsWithHTTPClient creates a new PcloudNetworksPortsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPortsPutParamsWithHTTPClient(client *http.Client) *PcloudNetworksPortsPutParams { - var () return &PcloudNetworksPortsPutParams{ HTTPClient: client, } } -/*PcloudNetworksPortsPutParams contains all the parameters to send to the API endpoint -for the pcloud networks ports put operation typically these are written to a http.Request +/* PcloudNetworksPortsPutParams contains all the parameters to send to the API endpoint + for the pcloud networks ports put operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPortsPutParams struct { - /*Body - Parameters for updating a Port + /* Body. + Parameters for updating a Port */ Body *models.NetworkPortUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string - /*PortID - Port ID + /* PortID. + + Port ID */ PortID string @@ -89,6 +90,21 @@ type PcloudNetworksPortsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks ports put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsPutParams) WithDefaults() *PcloudNetworksPortsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks ports put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPortsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks ports put params func (o *PcloudNetworksPortsPutParams) WithTimeout(timeout time.Duration) *PcloudNetworksPortsPutParams { o.SetTimeout(timeout) @@ -173,7 +189,6 @@ func (o *PcloudNetworksPortsPutParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go index c801e5f885..4fc8e47d29 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPortsPutReader is a Reader for the PcloudNetworksPortsPut structure. @@ -24,44 +23,38 @@ type PcloudNetworksPortsPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPortsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksPortsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksPortsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksPortsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudNetworksPortsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPortsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudNetworksPortsPutOK() *PcloudNetworksPortsPutOK { return &PcloudNetworksPortsPutOK{} } -/*PcloudNetworksPortsPutOK handles this case with default header values. +/* PcloudNetworksPortsPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudNetworksPortsPutOK struct { func (o *PcloudNetworksPortsPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutOK %+v", 200, o.Payload) } +func (o *PcloudNetworksPortsPutOK) GetPayload() *models.NetworkPort { + return o.Payload +} func (o *PcloudNetworksPortsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudNetworksPortsPutBadRequest() *PcloudNetworksPortsPutBadRequest { return &PcloudNetworksPortsPutBadRequest{} } -/*PcloudNetworksPortsPutBadRequest handles this case with default header values. +/* PcloudNetworksPortsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudNetworksPortsPutBadRequest struct { func (o *PcloudNetworksPortsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksPortsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudNetworksPortsPutUnauthorized() *PcloudNetworksPortsPutUnauthorized return &PcloudNetworksPortsPutUnauthorized{} } -/*PcloudNetworksPortsPutUnauthorized handles this case with default header values. +/* PcloudNetworksPortsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudNetworksPortsPutUnauthorized struct { func (o *PcloudNetworksPortsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPortsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudNetworksPortsPutUnprocessableEntity() *PcloudNetworksPortsPutUnpro return &PcloudNetworksPortsPutUnprocessableEntity{} } -/*PcloudNetworksPortsPutUnprocessableEntity handles this case with default header values. +/* PcloudNetworksPortsPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudNetworksPortsPutUnprocessableEntity struct { func (o *PcloudNetworksPortsPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudNetworksPortsPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudNetworksPortsPutInternalServerError() *PcloudNetworksPortsPutInter return &PcloudNetworksPortsPutInternalServerError{} } -/*PcloudNetworksPortsPutInternalServerError handles this case with default header values. +/* PcloudNetworksPortsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudNetworksPortsPutInternalServerError struct { func (o *PcloudNetworksPortsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPortsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPortsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_parameters.go index 69c238877c..dea14d36ad 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudNetworksPostParams creates a new PcloudNetworksPostParams object -// with the default values initialized. +// NewPcloudNetworksPostParams creates a new PcloudNetworksPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPostParams() *PcloudNetworksPostParams { - var () return &PcloudNetworksPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPostParamsWithTimeout creates a new PcloudNetworksPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPostParamsWithTimeout(timeout time.Duration) *PcloudNetworksPostParams { - var () return &PcloudNetworksPostParams{ - timeout: timeout, } } // NewPcloudNetworksPostParamsWithContext creates a new PcloudNetworksPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPostParamsWithContext(ctx context.Context) *PcloudNetworksPostParams { - var () return &PcloudNetworksPostParams{ - Context: ctx, } } // NewPcloudNetworksPostParamsWithHTTPClient creates a new PcloudNetworksPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPostParamsWithHTTPClient(client *http.Client) *PcloudNetworksPostParams { - var () return &PcloudNetworksPostParams{ HTTPClient: client, } } -/*PcloudNetworksPostParams contains all the parameters to send to the API endpoint -for the pcloud networks post operation typically these are written to a http.Request +/* PcloudNetworksPostParams contains all the parameters to send to the API endpoint + for the pcloud networks post operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPostParams struct { - /*Body - Parameters for the creation of a new network + /* Body. + Parameters for the creation of a new network */ Body *models.NetworkCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudNetworksPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPostParams) WithDefaults() *PcloudNetworksPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks post params func (o *PcloudNetworksPostParams) WithTimeout(timeout time.Duration) *PcloudNetworksPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudNetworksPostParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go index 5fd002002e..27a0da33a6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPostReader is a Reader for the PcloudNetworksPost structure. @@ -24,58 +23,50 @@ type PcloudNetworksPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewPcloudNetworksPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudNetworksPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudNetworksPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudNetworksPostOK() *PcloudNetworksPostOK { return &PcloudNetworksPostOK{} } -/*PcloudNetworksPostOK handles this case with default header values. +/* PcloudNetworksPostOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudNetworksPostOK struct { func (o *PcloudNetworksPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostOK %+v", 200, o.Payload) } +func (o *PcloudNetworksPostOK) GetPayload() *models.Network { + return o.Payload +} func (o *PcloudNetworksPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudNetworksPostCreated() *PcloudNetworksPostCreated { return &PcloudNetworksPostCreated{} } -/*PcloudNetworksPostCreated handles this case with default header values. +/* PcloudNetworksPostCreated describes a response with status code 201, with default header values. Created */ @@ -124,6 +118,9 @@ type PcloudNetworksPostCreated struct { func (o *PcloudNetworksPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostCreated %+v", 201, o.Payload) } +func (o *PcloudNetworksPostCreated) GetPayload() *models.Network { + return o.Payload +} func (o *PcloudNetworksPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudNetworksPostBadRequest() *PcloudNetworksPostBadRequest { return &PcloudNetworksPostBadRequest{} } -/*PcloudNetworksPostBadRequest handles this case with default header values. +/* PcloudNetworksPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -153,6 +150,9 @@ type PcloudNetworksPostBadRequest struct { func (o *PcloudNetworksPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudNetworksPostUnauthorized() *PcloudNetworksPostUnauthorized { return &PcloudNetworksPostUnauthorized{} } -/*PcloudNetworksPostUnauthorized handles this case with default header values. +/* PcloudNetworksPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -182,6 +182,9 @@ type PcloudNetworksPostUnauthorized struct { func (o *PcloudNetworksPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudNetworksPostConflict() *PcloudNetworksPostConflict { return &PcloudNetworksPostConflict{} } -/*PcloudNetworksPostConflict handles this case with default header values. +/* PcloudNetworksPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudNetworksPostConflict struct { func (o *PcloudNetworksPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostConflict %+v", 409, o.Payload) } +func (o *PcloudNetworksPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudNetworksPostUnprocessableEntity() *PcloudNetworksPostUnprocessable return &PcloudNetworksPostUnprocessableEntity{} } -/*PcloudNetworksPostUnprocessableEntity handles this case with default header values. +/* PcloudNetworksPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudNetworksPostUnprocessableEntity struct { func (o *PcloudNetworksPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudNetworksPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudNetworksPostInternalServerError() *PcloudNetworksPostInternalServe return &PcloudNetworksPostInternalServerError{} } -/*PcloudNetworksPostInternalServerError handles this case with default header values. +/* PcloudNetworksPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudNetworksPostInternalServerError struct { func (o *PcloudNetworksPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_parameters.go index 4c5ff09c4b..00ef70f90f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudNetworksPutParams creates a new PcloudNetworksPutParams object -// with the default values initialized. +// NewPcloudNetworksPutParams creates a new PcloudNetworksPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudNetworksPutParams() *PcloudNetworksPutParams { - var () return &PcloudNetworksPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudNetworksPutParamsWithTimeout creates a new PcloudNetworksPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudNetworksPutParamsWithTimeout(timeout time.Duration) *PcloudNetworksPutParams { - var () return &PcloudNetworksPutParams{ - timeout: timeout, } } // NewPcloudNetworksPutParamsWithContext creates a new PcloudNetworksPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudNetworksPutParamsWithContext(ctx context.Context) *PcloudNetworksPutParams { - var () return &PcloudNetworksPutParams{ - Context: ctx, } } // NewPcloudNetworksPutParamsWithHTTPClient creates a new PcloudNetworksPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudNetworksPutParamsWithHTTPClient(client *http.Client) *PcloudNetworksPutParams { - var () return &PcloudNetworksPutParams{ HTTPClient: client, } } -/*PcloudNetworksPutParams contains all the parameters to send to the API endpoint -for the pcloud networks put operation typically these are written to a http.Request +/* PcloudNetworksPutParams contains all the parameters to send to the API endpoint + for the pcloud networks put operation. + + Typically these are written to a http.Request. */ type PcloudNetworksPutParams struct { - /*Body - Parameters to update a Network + /* Body. + Parameters to update a Network */ Body *models.NetworkUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string @@ -84,6 +84,21 @@ type PcloudNetworksPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud networks put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPutParams) WithDefaults() *PcloudNetworksPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud networks put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudNetworksPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud networks put params func (o *PcloudNetworksPutParams) WithTimeout(timeout time.Duration) *PcloudNetworksPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudNetworksPutParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go index accda0c917..935956e0ab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudNetworksPutReader is a Reader for the PcloudNetworksPut structure. @@ -24,44 +23,38 @@ type PcloudNetworksPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudNetworksPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudNetworksPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudNetworksPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudNetworksPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudNetworksPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudNetworksPutOK() *PcloudNetworksPutOK { return &PcloudNetworksPutOK{} } -/*PcloudNetworksPutOK handles this case with default header values. +/* PcloudNetworksPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudNetworksPutOK struct { func (o *PcloudNetworksPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutOK %+v", 200, o.Payload) } +func (o *PcloudNetworksPutOK) GetPayload() *models.Network { + return o.Payload +} func (o *PcloudNetworksPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudNetworksPutBadRequest() *PcloudNetworksPutBadRequest { return &PcloudNetworksPutBadRequest{} } -/*PcloudNetworksPutBadRequest handles this case with default header values. +/* PcloudNetworksPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudNetworksPutBadRequest struct { func (o *PcloudNetworksPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudNetworksPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudNetworksPutUnauthorized() *PcloudNetworksPutUnauthorized { return &PcloudNetworksPutUnauthorized{} } -/*PcloudNetworksPutUnauthorized handles this case with default header values. +/* PcloudNetworksPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudNetworksPutUnauthorized struct { func (o *PcloudNetworksPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudNetworksPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudNetworksPutUnprocessableEntity() *PcloudNetworksPutUnprocessableEn return &PcloudNetworksPutUnprocessableEntity{} } -/*PcloudNetworksPutUnprocessableEntity handles this case with default header values. +/* PcloudNetworksPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudNetworksPutUnprocessableEntity struct { func (o *PcloudNetworksPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudNetworksPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudNetworksPutInternalServerError() *PcloudNetworksPutInternalServerE return &PcloudNetworksPutInternalServerError{} } -/*PcloudNetworksPutInternalServerError handles this case with default header values. +/* PcloudNetworksPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudNetworksPutInternalServerError struct { func (o *PcloudNetworksPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudNetworksPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudNetworksPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go deleted file mode 100644 index ccf5bba125..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloud_p_vm_instances_client.go +++ /dev/null @@ -1,653 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_p_vm_instances - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud p vm instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for p cloud p vm instances API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -PcloudPvminstancesActionPost performs an action start stop reboot immediate shutdown reset on a p VM instance -*/ -func (a *Client) PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesActionPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesActionPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.action.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesActionPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesActionPostOK), nil - -} - -/* -PcloudPvminstancesCapturePost captures a p VM instance and create a deployable image -*/ -func (a *Client) PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesCapturePostOK, *PcloudPvminstancesCapturePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesCapturePostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.capture.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesCapturePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *PcloudPvminstancesCapturePostOK: - return value, nil, nil - case *PcloudPvminstancesCapturePostAccepted: - return nil, value, nil - } - return nil, nil, nil - -} - -/* -PcloudPvminstancesClonePost clones a p VM instance -*/ -func (a *Client) PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesClonePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesClonePostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.clone.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesClonePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesClonePostAccepted), nil - -} - -/* -PcloudPvminstancesConsoleGet lists all console languages -*/ -func (a *Client) PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesConsoleGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesConsoleGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.console.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesConsoleGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesConsoleGetOK), nil - -} - -/* -PcloudPvminstancesConsolePost generates the no v n c console URL -*/ -func (a *Client) PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsolePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesConsolePostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesConsolePostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.console.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesConsolePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesConsolePostCreated), nil - -} - -/* -PcloudPvminstancesConsolePut updates p VM instance console laguage code -*/ -func (a *Client) PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsolePutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesConsolePutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesConsolePutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.console.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesConsolePutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesConsolePutOK), nil - -} - -/* -PcloudPvminstancesDelete deletes a p cloud p VM instance -*/ -func (a *Client) PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesDeleteOK), nil - -} - -/* -PcloudPvminstancesGet gets a p VM instance s current state information -*/ -func (a *Client) PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesGetOK), nil - -} - -/* -PcloudPvminstancesGetall gets all the pvm instances for this cloud instance -*/ -func (a *Client) PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesGetallOK), nil - -} - -/* -PcloudPvminstancesNetworksDelete removes all address of network from a p VM instance -*/ -func (a *Client) PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesNetworksDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesNetworksDeleteOK), nil - -} - -/* -PcloudPvminstancesNetworksGet gets a p VM instance s network information -*/ -func (a *Client) PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetworksGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesNetworksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesNetworksGetOK), nil - -} - -/* -PcloudPvminstancesNetworksGetall gets all networks for this p VM instance -*/ -func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesNetworksGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesNetworksGetallOK), nil - -} - -/* -PcloudPvminstancesNetworksPost performs network addition -*/ -func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesNetworksPostCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesNetworksPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.networks.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesNetworksPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesNetworksPostCreated), nil - -} - -/* -PcloudPvminstancesOperationsPost performs an operation on a p VM instance -*/ -func (a *Client) PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOperationsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesOperationsPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesOperationsPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.operations.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesOperationsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesOperationsPostOK), nil - -} - -/* -PcloudPvminstancesPost creates a new power VM instance -*/ -func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesPostOK, *PcloudPvminstancesPostCreated, *PcloudPvminstancesPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *PcloudPvminstancesPostOK: - return value, nil, nil, nil - case *PcloudPvminstancesPostCreated: - return nil, value, nil, nil - case *PcloudPvminstancesPostAccepted: - return nil, nil, value, nil - } - return nil, nil, nil, nil - -} - -/* -PcloudPvminstancesPut updates a p cloud p VM instance -*/ -func (a *Client) PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesPutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesPutAccepted), nil - -} - -/* -PcloudPvminstancesSnapshotsGetall gets all snapshots for this p VM instance -*/ -func (a *Client) PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesSnapshotsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesSnapshotsGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.snapshots.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesSnapshotsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesSnapshotsGetallOK), nil - -} - -/* -PcloudPvminstancesSnapshotsPost creates a p VM instance snapshot -*/ -func (a *Client) PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesSnapshotsPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesSnapshotsPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.snapshots.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesSnapshotsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesSnapshotsPostAccepted), nil - -} - -/* -PcloudPvminstancesSnapshotsRestorePost restores a p VM instance snapshot -*/ -func (a *Client) PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstancesSnapshotsRestorePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesSnapshotsRestorePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudPvminstancesSnapshotsRestorePostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.pvminstances.snapshots.restore.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudPvminstancesSnapshotsRestorePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudPvminstancesSnapshotsRestorePostAccepted), nil - -} - -/* -PcloudV2PvminstancesCaptureGet gets detail of last capture job -*/ -func (a *Client) PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCaptureGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2PvminstancesCaptureGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesCaptureGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.capture.get", - Method: "GET", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesCaptureGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudV2PvminstancesCaptureGetOK), nil - -} - -/* -PcloudV2PvminstancesCapturePost adds a capture pvm instance to the jobs queue -*/ -func (a *Client) PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2PvminstancesCapturePostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudV2PvminstancesCapturePostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.v2.pvminstances.capture.post", - Method: "POST", - PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudV2PvminstancesCapturePostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudV2PvminstancesCapturePostAccepted), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go new file mode 100644 index 0000000000..4e52d96823 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go @@ -0,0 +1,904 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_p_vm_instances + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud p vm instances API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud p vm instances API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesActionPostOK, error) + + PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesCapturePostOK, *PcloudPvminstancesCapturePostAccepted, error) + + PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesClonePostAccepted, error) + + PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsoleGetOK, error) + + PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsolePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePostCreated, error) + + PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsolePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePutOK, error) + + PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesDeleteOK, error) + + PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetOK, error) + + PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetallOK, error) + + PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksDeleteOK, error) + + PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetOK, error) + + PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetallOK, error) + + PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksPostCreated, error) + + PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOperationsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesOperationsPostOK, error) + + PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPostOK, *PcloudPvminstancesPostCreated, *PcloudPvminstancesPostAccepted, error) + + PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPutAccepted, error) + + PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsGetallOK, error) + + PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsPostAccepted, error) + + PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstancesSnapshotsRestorePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsRestorePostAccepted, error) + + PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCaptureGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCaptureGetOK, error) + + PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCapturePostAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PcloudPvminstancesActionPost performs an action start stop reboot immediate shutdown reset on a p VM instance +*/ +func (a *Client) PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesActionPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesActionPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.action.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesActionPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesActionPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesCapturePost captures a p VM instance and create a deployable image +*/ +func (a *Client) PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesCapturePostOK, *PcloudPvminstancesCapturePostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesCapturePostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.capture.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesCapturePostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *PcloudPvminstancesCapturePostOK: + return value, nil, nil + case *PcloudPvminstancesCapturePostAccepted: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_p_vm_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesClonePost clones a p VM instance +*/ +func (a *Client) PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesClonePostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesClonePostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.clone.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesClonePostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesClonePostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesConsoleGet lists all console languages +*/ +func (a *Client) PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsoleGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesConsoleGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.console.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesConsoleGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesConsoleGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesConsolePost generates the no v n c console URL +*/ +func (a *Client) PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsolePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePostCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesConsolePostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.console.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesConsolePostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesConsolePostCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesConsolePut updates p VM instance console laguage code +*/ +func (a *Client) PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsolePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesConsolePutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.console.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesConsolePutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesConsolePutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesDelete deletes a p cloud p VM instance +*/ +func (a *Client) PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesGet gets a p VM instance s current state information +*/ +func (a *Client) PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesGetall gets all the pvm instances for this cloud instance +*/ +func (a *Client) PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesNetworksDelete removes all address of network from a p VM instance +*/ +func (a *Client) PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesNetworksDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.networks.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesNetworksDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesNetworksDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesNetworksGet gets a p VM instance s network information +*/ +func (a *Client) PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesNetworksGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.networks.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesNetworksGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesNetworksGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesNetworksGetall gets all networks for this p VM instance +*/ +func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesNetworksGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.networks.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesNetworksGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesNetworksGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesNetworksPost performs network addition +*/ +func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksPostCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesNetworksPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.networks.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesNetworksPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesNetworksPostCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesOperationsPost performs an operation on a p VM instance +*/ +func (a *Client) PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOperationsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesOperationsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesOperationsPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.operations.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesOperationsPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesOperationsPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.operations.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesPost creates a new power VM instance +*/ +func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPostOK, *PcloudPvminstancesPostCreated, *PcloudPvminstancesPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, nil, err + } + switch value := result.(type) { + case *PcloudPvminstancesPostOK: + return value, nil, nil, nil + case *PcloudPvminstancesPostCreated: + return nil, value, nil, nil + case *PcloudPvminstancesPostAccepted: + return nil, nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_p_vm_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesPut updates a p cloud p VM instance +*/ +func (a *Client) PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPutAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesPutAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesSnapshotsGetall gets all snapshots for this p VM instance +*/ +func (a *Client) PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesSnapshotsGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.snapshots.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesSnapshotsGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesSnapshotsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesSnapshotsPost creates a p VM instance snapshot +*/ +func (a *Client) PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesSnapshotsPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.snapshots.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesSnapshotsPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesSnapshotsPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudPvminstancesSnapshotsRestorePost restores a p VM instance snapshot +*/ +func (a *Client) PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstancesSnapshotsRestorePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsRestorePostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudPvminstancesSnapshotsRestorePostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.snapshots.restore.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesSnapshotsRestorePostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudPvminstancesSnapshotsRestorePostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.restore.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudV2PvminstancesCaptureGet gets detail of last capture job +*/ +func (a *Client) PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCaptureGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCaptureGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudV2PvminstancesCaptureGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.v2.pvminstances.capture.get", + Method: "GET", + PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudV2PvminstancesCaptureGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudV2PvminstancesCaptureGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.capture.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudV2PvminstancesCapturePost adds a capture pvm instance to the jobs queue +*/ +func (a *Client) PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCapturePostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudV2PvminstancesCapturePostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.v2.pvminstances.capture.post", + Method: "POST", + PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudV2PvminstancesCapturePostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudV2PvminstancesCapturePostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.capture.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go index bcff916925..27ae8aa327 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesActionPostParams creates a new PcloudPvminstancesActionPostParams object -// with the default values initialized. +// NewPcloudPvminstancesActionPostParams creates a new PcloudPvminstancesActionPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesActionPostParams() *PcloudPvminstancesActionPostParams { - var () return &PcloudPvminstancesActionPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesActionPostParamsWithTimeout creates a new PcloudPvminstancesActionPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesActionPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesActionPostParams { - var () return &PcloudPvminstancesActionPostParams{ - timeout: timeout, } } // NewPcloudPvminstancesActionPostParamsWithContext creates a new PcloudPvminstancesActionPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesActionPostParamsWithContext(ctx context.Context) *PcloudPvminstancesActionPostParams { - var () return &PcloudPvminstancesActionPostParams{ - Context: ctx, } } // NewPcloudPvminstancesActionPostParamsWithHTTPClient creates a new PcloudPvminstancesActionPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesActionPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesActionPostParams { - var () return &PcloudPvminstancesActionPostParams{ HTTPClient: client, } } -/*PcloudPvminstancesActionPostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances action post operation typically these are written to a http.Request +/* PcloudPvminstancesActionPostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances action post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesActionPostParams struct { - /*Body - Parameters for the desired action + /* Body. + Parameters for the desired action */ Body *models.PVMInstanceAction - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesActionPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances action post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesActionPostParams) WithDefaults() *PcloudPvminstancesActionPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances action post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesActionPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances action post params func (o *PcloudPvminstancesActionPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesActionPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesActionPostParams) WriteToRequest(r runtime.ClientRequ return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go index 710917529c..3f0e3a3f82 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesActionPostReader is a Reader for the PcloudPvminstancesActionPost structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesActionPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesActionPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesActionPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesActionPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesActionPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesActionPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesActionPostOK() *PcloudPvminstancesActionPostOK { return &PcloudPvminstancesActionPostOK{} } -/*PcloudPvminstancesActionPostOK handles this case with default header values. +/* PcloudPvminstancesActionPostOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesActionPostOK struct { func (o *PcloudPvminstancesActionPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesActionPostOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudPvminstancesActionPostBadRequest() *PcloudPvminstancesActionPostBa return &PcloudPvminstancesActionPostBadRequest{} } -/*PcloudPvminstancesActionPostBadRequest handles this case with default header values. +/* PcloudPvminstancesActionPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudPvminstancesActionPostBadRequest struct { func (o *PcloudPvminstancesActionPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesActionPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudPvminstancesActionPostUnauthorized() *PcloudPvminstancesActionPost return &PcloudPvminstancesActionPostUnauthorized{} } -/*PcloudPvminstancesActionPostUnauthorized handles this case with default header values. +/* PcloudPvminstancesActionPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudPvminstancesActionPostUnauthorized struct { func (o *PcloudPvminstancesActionPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesActionPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudPvminstancesActionPostNotFound() *PcloudPvminstancesActionPostNotF return &PcloudPvminstancesActionPostNotFound{} } -/*PcloudPvminstancesActionPostNotFound handles this case with default header values. +/* PcloudPvminstancesActionPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -166,6 +168,9 @@ type PcloudPvminstancesActionPostNotFound struct { func (o *PcloudPvminstancesActionPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesActionPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudPvminstancesActionPostInternalServerError() *PcloudPvminstancesAct return &PcloudPvminstancesActionPostInternalServerError{} } -/*PcloudPvminstancesActionPostInternalServerError handles this case with default header values. +/* PcloudPvminstancesActionPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudPvminstancesActionPostInternalServerError struct { func (o *PcloudPvminstancesActionPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesActionPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go index 1a73c2090a..501695e66b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesCapturePostParams creates a new PcloudPvminstancesCapturePostParams object -// with the default values initialized. +// NewPcloudPvminstancesCapturePostParams creates a new PcloudPvminstancesCapturePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesCapturePostParams() *PcloudPvminstancesCapturePostParams { - var () return &PcloudPvminstancesCapturePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesCapturePostParamsWithTimeout creates a new PcloudPvminstancesCapturePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesCapturePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesCapturePostParams { - var () return &PcloudPvminstancesCapturePostParams{ - timeout: timeout, } } // NewPcloudPvminstancesCapturePostParamsWithContext creates a new PcloudPvminstancesCapturePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesCapturePostParamsWithContext(ctx context.Context) *PcloudPvminstancesCapturePostParams { - var () return &PcloudPvminstancesCapturePostParams{ - Context: ctx, } } // NewPcloudPvminstancesCapturePostParamsWithHTTPClient creates a new PcloudPvminstancesCapturePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesCapturePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesCapturePostParams { - var () return &PcloudPvminstancesCapturePostParams{ HTTPClient: client, } } -/*PcloudPvminstancesCapturePostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances capture post operation typically these are written to a http.Request +/* PcloudPvminstancesCapturePostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances capture post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesCapturePostParams struct { - /*Body - Parameters for the capture PVMInstance + /* Body. + Parameters for the capture PVMInstance */ Body *models.PVMInstanceCapture - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesCapturePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances capture post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesCapturePostParams) WithDefaults() *PcloudPvminstancesCapturePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances capture post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesCapturePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances capture post params func (o *PcloudPvminstancesCapturePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesCapturePostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesCapturePostParams) WriteToRequest(r runtime.ClientReq return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go index 3675f54a01..436187f56a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesCapturePostReader is a Reader for the PcloudPvminstancesCapturePost structure. @@ -24,51 +23,44 @@ type PcloudPvminstancesCapturePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesCapturePostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudPvminstancesCapturePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesCapturePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesCapturePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesCapturePostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesCapturePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudPvminstancesCapturePostOK() *PcloudPvminstancesCapturePostOK { return &PcloudPvminstancesCapturePostOK{} } -/*PcloudPvminstancesCapturePostOK handles this case with default header values. +/* PcloudPvminstancesCapturePostOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudPvminstancesCapturePostOK struct { func (o *PcloudPvminstancesCapturePostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesCapturePostOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesCapturePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudPvminstancesCapturePostAccepted() *PcloudPvminstancesCapturePostAc return &PcloudPvminstancesCapturePostAccepted{} } -/*PcloudPvminstancesCapturePostAccepted handles this case with default header values. +/* PcloudPvminstancesCapturePostAccepted describes a response with status code 202, with default header values. Accepted, upload to cloud storage in progress */ @@ -115,6 +110,9 @@ type PcloudPvminstancesCapturePostAccepted struct { func (o *PcloudPvminstancesCapturePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesCapturePostAccepted) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesCapturePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -131,7 +129,7 @@ func NewPcloudPvminstancesCapturePostBadRequest() *PcloudPvminstancesCapturePost return &PcloudPvminstancesCapturePostBadRequest{} } -/*PcloudPvminstancesCapturePostBadRequest handles this case with default header values. +/* PcloudPvminstancesCapturePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -142,6 +140,9 @@ type PcloudPvminstancesCapturePostBadRequest struct { func (o *PcloudPvminstancesCapturePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesCapturePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesCapturePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -160,7 +161,7 @@ func NewPcloudPvminstancesCapturePostUnauthorized() *PcloudPvminstancesCapturePo return &PcloudPvminstancesCapturePostUnauthorized{} } -/*PcloudPvminstancesCapturePostUnauthorized handles this case with default header values. +/* PcloudPvminstancesCapturePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -171,6 +172,9 @@ type PcloudPvminstancesCapturePostUnauthorized struct { func (o *PcloudPvminstancesCapturePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesCapturePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesCapturePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -189,7 +193,7 @@ func NewPcloudPvminstancesCapturePostUnprocessableEntity() *PcloudPvminstancesCa return &PcloudPvminstancesCapturePostUnprocessableEntity{} } -/*PcloudPvminstancesCapturePostUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesCapturePostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -200,6 +204,9 @@ type PcloudPvminstancesCapturePostUnprocessableEntity struct { func (o *PcloudPvminstancesCapturePostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesCapturePostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesCapturePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -218,7 +225,7 @@ func NewPcloudPvminstancesCapturePostInternalServerError() *PcloudPvminstancesCa return &PcloudPvminstancesCapturePostInternalServerError{} } -/*PcloudPvminstancesCapturePostInternalServerError handles this case with default header values. +/* PcloudPvminstancesCapturePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -229,6 +236,9 @@ type PcloudPvminstancesCapturePostInternalServerError struct { func (o *PcloudPvminstancesCapturePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesCapturePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesCapturePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go index 9c5e86bf2f..b51625f4ce 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesClonePostParams creates a new PcloudPvminstancesClonePostParams object -// with the default values initialized. +// NewPcloudPvminstancesClonePostParams creates a new PcloudPvminstancesClonePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesClonePostParams() *PcloudPvminstancesClonePostParams { - var () return &PcloudPvminstancesClonePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesClonePostParamsWithTimeout creates a new PcloudPvminstancesClonePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesClonePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesClonePostParams { - var () return &PcloudPvminstancesClonePostParams{ - timeout: timeout, } } // NewPcloudPvminstancesClonePostParamsWithContext creates a new PcloudPvminstancesClonePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesClonePostParamsWithContext(ctx context.Context) *PcloudPvminstancesClonePostParams { - var () return &PcloudPvminstancesClonePostParams{ - Context: ctx, } } // NewPcloudPvminstancesClonePostParamsWithHTTPClient creates a new PcloudPvminstancesClonePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesClonePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesClonePostParams { - var () return &PcloudPvminstancesClonePostParams{ HTTPClient: client, } } -/*PcloudPvminstancesClonePostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances clone post operation typically these are written to a http.Request +/* PcloudPvminstancesClonePostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances clone post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesClonePostParams struct { - /*Body - Clone PVM Instance parameters + /* Body. + Clone PVM Instance parameters */ Body *models.PVMInstanceClone - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesClonePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances clone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesClonePostParams) WithDefaults() *PcloudPvminstancesClonePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances clone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesClonePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances clone post params func (o *PcloudPvminstancesClonePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesClonePostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesClonePostParams) WriteToRequest(r runtime.ClientReque return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go index b1933405da..4d4e0510a6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesClonePostReader is a Reader for the PcloudPvminstancesClonePost structure. @@ -24,51 +23,44 @@ type PcloudPvminstancesClonePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudPvminstancesClonePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesClonePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesClonePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesClonePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesClonePostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesClonePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudPvminstancesClonePostAccepted() *PcloudPvminstancesClonePostAccept return &PcloudPvminstancesClonePostAccepted{} } -/*PcloudPvminstancesClonePostAccepted handles this case with default header values. +/* PcloudPvminstancesClonePostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudPvminstancesClonePostAccepted struct { func (o *PcloudPvminstancesClonePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesClonePostAccepted) GetPayload() *models.PVMInstance { + return o.Payload +} func (o *PcloudPvminstancesClonePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudPvminstancesClonePostBadRequest() *PcloudPvminstancesClonePostBadR return &PcloudPvminstancesClonePostBadRequest{} } -/*PcloudPvminstancesClonePostBadRequest handles this case with default header values. +/* PcloudPvminstancesClonePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudPvminstancesClonePostBadRequest struct { func (o *PcloudPvminstancesClonePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesClonePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesClonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudPvminstancesClonePostUnauthorized() *PcloudPvminstancesClonePostUn return &PcloudPvminstancesClonePostUnauthorized{} } -/*PcloudPvminstancesClonePostUnauthorized handles this case with default header values. +/* PcloudPvminstancesClonePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudPvminstancesClonePostUnauthorized struct { func (o *PcloudPvminstancesClonePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesClonePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudPvminstancesClonePostConflict() *PcloudPvminstancesClonePostConfli return &PcloudPvminstancesClonePostConflict{} } -/*PcloudPvminstancesClonePostConflict handles this case with default header values. +/* PcloudPvminstancesClonePostConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type PcloudPvminstancesClonePostConflict struct { func (o *PcloudPvminstancesClonePostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesClonePostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesClonePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudPvminstancesClonePostUnprocessableEntity() *PcloudPvminstancesClon return &PcloudPvminstancesClonePostUnprocessableEntity{} } -/*PcloudPvminstancesClonePostUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesClonePostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudPvminstancesClonePostUnprocessableEntity struct { func (o *PcloudPvminstancesClonePostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesClonePostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesClonePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudPvminstancesClonePostInternalServerError() *PcloudPvminstancesClon return &PcloudPvminstancesClonePostInternalServerError{} } -/*PcloudPvminstancesClonePostInternalServerError handles this case with default header values. +/* PcloudPvminstancesClonePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudPvminstancesClonePostInternalServerError struct { func (o *PcloudPvminstancesClonePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesClonePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesClonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go index ed8463565a..80d994b2c2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesConsoleGetParams creates a new PcloudPvminstancesConsoleGetParams object -// with the default values initialized. +// NewPcloudPvminstancesConsoleGetParams creates a new PcloudPvminstancesConsoleGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesConsoleGetParams() *PcloudPvminstancesConsoleGetParams { - var () return &PcloudPvminstancesConsoleGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesConsoleGetParamsWithTimeout creates a new PcloudPvminstancesConsoleGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesConsoleGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesConsoleGetParams { - var () return &PcloudPvminstancesConsoleGetParams{ - timeout: timeout, } } // NewPcloudPvminstancesConsoleGetParamsWithContext creates a new PcloudPvminstancesConsoleGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesConsoleGetParamsWithContext(ctx context.Context) *PcloudPvminstancesConsoleGetParams { - var () return &PcloudPvminstancesConsoleGetParams{ - Context: ctx, } } // NewPcloudPvminstancesConsoleGetParamsWithHTTPClient creates a new PcloudPvminstancesConsoleGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesConsoleGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesConsoleGetParams { - var () return &PcloudPvminstancesConsoleGetParams{ HTTPClient: client, } } -/*PcloudPvminstancesConsoleGetParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances console get operation typically these are written to a http.Request +/* PcloudPvminstancesConsoleGetParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances console get operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesConsoleGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudPvminstancesConsoleGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances console get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesConsoleGetParams) WithDefaults() *PcloudPvminstancesConsoleGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances console get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesConsoleGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances console get params func (o *PcloudPvminstancesConsoleGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesConsoleGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go index 1e9a8b127c..1caf34981c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesConsoleGetReader is a Reader for the PcloudPvminstancesConsoleGet structure. @@ -24,37 +23,32 @@ type PcloudPvminstancesConsoleGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesConsoleGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesConsoleGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesConsoleGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesConsoleGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesConsoleGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPvminstancesConsoleGetOK() *PcloudPvminstancesConsoleGetOK { return &PcloudPvminstancesConsoleGetOK{} } -/*PcloudPvminstancesConsoleGetOK handles this case with default header values. +/* PcloudPvminstancesConsoleGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPvminstancesConsoleGetOK struct { func (o *PcloudPvminstancesConsoleGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesConsoleGetOK) GetPayload() *models.ConsoleLanguages { + return o.Payload +} func (o *PcloudPvminstancesConsoleGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPvminstancesConsoleGetBadRequest() *PcloudPvminstancesConsoleGetBa return &PcloudPvminstancesConsoleGetBadRequest{} } -/*PcloudPvminstancesConsoleGetBadRequest handles this case with default header values. +/* PcloudPvminstancesConsoleGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudPvminstancesConsoleGetBadRequest struct { func (o *PcloudPvminstancesConsoleGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesConsoleGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsoleGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPvminstancesConsoleGetUnauthorized() *PcloudPvminstancesConsoleGet return &PcloudPvminstancesConsoleGetUnauthorized{} } -/*PcloudPvminstancesConsoleGetUnauthorized handles this case with default header values. +/* PcloudPvminstancesConsoleGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudPvminstancesConsoleGetUnauthorized struct { func (o *PcloudPvminstancesConsoleGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesConsoleGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsoleGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPvminstancesConsoleGetInternalServerError() *PcloudPvminstancesCon return &PcloudPvminstancesConsoleGetInternalServerError{} } -/*PcloudPvminstancesConsoleGetInternalServerError handles this case with default header values. +/* PcloudPvminstancesConsoleGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPvminstancesConsoleGetInternalServerError struct { func (o *PcloudPvminstancesConsoleGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesConsoleGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsoleGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go index d96110748c..86a27e6634 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesConsolePostParams creates a new PcloudPvminstancesConsolePostParams object -// with the default values initialized. +// NewPcloudPvminstancesConsolePostParams creates a new PcloudPvminstancesConsolePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesConsolePostParams() *PcloudPvminstancesConsolePostParams { - var () return &PcloudPvminstancesConsolePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesConsolePostParamsWithTimeout creates a new PcloudPvminstancesConsolePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesConsolePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePostParams { - var () return &PcloudPvminstancesConsolePostParams{ - timeout: timeout, } } // NewPcloudPvminstancesConsolePostParamsWithContext creates a new PcloudPvminstancesConsolePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesConsolePostParamsWithContext(ctx context.Context) *PcloudPvminstancesConsolePostParams { - var () return &PcloudPvminstancesConsolePostParams{ - Context: ctx, } } // NewPcloudPvminstancesConsolePostParamsWithHTTPClient creates a new PcloudPvminstancesConsolePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesConsolePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesConsolePostParams { - var () return &PcloudPvminstancesConsolePostParams{ HTTPClient: client, } } -/*PcloudPvminstancesConsolePostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances console post operation typically these are written to a http.Request +/* PcloudPvminstancesConsolePostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances console post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesConsolePostParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudPvminstancesConsolePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances console post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesConsolePostParams) WithDefaults() *PcloudPvminstancesConsolePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances console post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesConsolePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances console post params func (o *PcloudPvminstancesConsolePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePostParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go index 6a3d7c80b0..590e7f5b1e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesConsolePostReader is a Reader for the PcloudPvminstancesConsolePost structure. @@ -24,37 +23,32 @@ type PcloudPvminstancesConsolePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesConsolePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 201: result := NewPcloudPvminstancesConsolePostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudPvminstancesConsolePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesConsolePostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesConsolePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPvminstancesConsolePostCreated() *PcloudPvminstancesConsolePostCre return &PcloudPvminstancesConsolePostCreated{} } -/*PcloudPvminstancesConsolePostCreated handles this case with default header values. +/* PcloudPvminstancesConsolePostCreated describes a response with status code 201, with default header values. Created */ @@ -74,6 +68,9 @@ type PcloudPvminstancesConsolePostCreated struct { func (o *PcloudPvminstancesConsolePostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostCreated %+v", 201, o.Payload) } +func (o *PcloudPvminstancesConsolePostCreated) GetPayload() *models.PVMInstanceConsole { + return o.Payload +} func (o *PcloudPvminstancesConsolePostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPvminstancesConsolePostUnauthorized() *PcloudPvminstancesConsolePo return &PcloudPvminstancesConsolePostUnauthorized{} } -/*PcloudPvminstancesConsolePostUnauthorized handles this case with default header values. +/* PcloudPvminstancesConsolePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudPvminstancesConsolePostUnauthorized struct { func (o *PcloudPvminstancesConsolePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesConsolePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsolePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPvminstancesConsolePostUnprocessableEntity() *PcloudPvminstancesCo return &PcloudPvminstancesConsolePostUnprocessableEntity{} } -/*PcloudPvminstancesConsolePostUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesConsolePostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -132,6 +132,9 @@ type PcloudPvminstancesConsolePostUnprocessableEntity struct { func (o *PcloudPvminstancesConsolePostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesConsolePostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsolePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPvminstancesConsolePostInternalServerError() *PcloudPvminstancesCo return &PcloudPvminstancesConsolePostInternalServerError{} } -/*PcloudPvminstancesConsolePostInternalServerError handles this case with default header values. +/* PcloudPvminstancesConsolePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPvminstancesConsolePostInternalServerError struct { func (o *PcloudPvminstancesConsolePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesConsolePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsolePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go index c30e3305b9..a6f703784f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesConsolePutParams creates a new PcloudPvminstancesConsolePutParams object -// with the default values initialized. +// NewPcloudPvminstancesConsolePutParams creates a new PcloudPvminstancesConsolePutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesConsolePutParams() *PcloudPvminstancesConsolePutParams { - var () return &PcloudPvminstancesConsolePutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesConsolePutParamsWithTimeout creates a new PcloudPvminstancesConsolePutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesConsolePutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePutParams { - var () return &PcloudPvminstancesConsolePutParams{ - timeout: timeout, } } // NewPcloudPvminstancesConsolePutParamsWithContext creates a new PcloudPvminstancesConsolePutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesConsolePutParamsWithContext(ctx context.Context) *PcloudPvminstancesConsolePutParams { - var () return &PcloudPvminstancesConsolePutParams{ - Context: ctx, } } // NewPcloudPvminstancesConsolePutParamsWithHTTPClient creates a new PcloudPvminstancesConsolePutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesConsolePutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesConsolePutParams { - var () return &PcloudPvminstancesConsolePutParams{ HTTPClient: client, } } -/*PcloudPvminstancesConsolePutParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances console put operation typically these are written to a http.Request +/* PcloudPvminstancesConsolePutParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances console put operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesConsolePutParams struct { - /*Body - Parameters to update a PVMInstance console required codepage + /* Body. + Parameters to update a PVMInstance console required codepage */ Body *models.ConsoleLanguage - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesConsolePutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances console put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesConsolePutParams) WithDefaults() *PcloudPvminstancesConsolePutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances console put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesConsolePutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances console put params func (o *PcloudPvminstancesConsolePutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesConsolePutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesConsolePutParams) WriteToRequest(r runtime.ClientRequ return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go index 05f1356c04..c3331bef56 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesConsolePutReader is a Reader for the PcloudPvminstancesConsolePut structure. @@ -24,37 +23,32 @@ type PcloudPvminstancesConsolePutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesConsolePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesConsolePutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesConsolePutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesConsolePutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesConsolePutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPvminstancesConsolePutOK() *PcloudPvminstancesConsolePutOK { return &PcloudPvminstancesConsolePutOK{} } -/*PcloudPvminstancesConsolePutOK handles this case with default header values. +/* PcloudPvminstancesConsolePutOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPvminstancesConsolePutOK struct { func (o *PcloudPvminstancesConsolePutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesConsolePutOK) GetPayload() *models.ConsoleLanguage { + return o.Payload +} func (o *PcloudPvminstancesConsolePutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPvminstancesConsolePutBadRequest() *PcloudPvminstancesConsolePutBa return &PcloudPvminstancesConsolePutBadRequest{} } -/*PcloudPvminstancesConsolePutBadRequest handles this case with default header values. +/* PcloudPvminstancesConsolePutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudPvminstancesConsolePutBadRequest struct { func (o *PcloudPvminstancesConsolePutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesConsolePutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsolePutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPvminstancesConsolePutUnauthorized() *PcloudPvminstancesConsolePut return &PcloudPvminstancesConsolePutUnauthorized{} } -/*PcloudPvminstancesConsolePutUnauthorized handles this case with default header values. +/* PcloudPvminstancesConsolePutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudPvminstancesConsolePutUnauthorized struct { func (o *PcloudPvminstancesConsolePutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesConsolePutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsolePutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPvminstancesConsolePutInternalServerError() *PcloudPvminstancesCon return &PcloudPvminstancesConsolePutInternalServerError{} } -/*PcloudPvminstancesConsolePutInternalServerError handles this case with default header values. +/* PcloudPvminstancesConsolePutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPvminstancesConsolePutInternalServerError struct { func (o *PcloudPvminstancesConsolePutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesConsolePutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesConsolePutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go index 4f6a9c5a40..8c369a0106 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_parameters.go @@ -13,68 +13,68 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesDeleteParams creates a new PcloudPvminstancesDeleteParams object -// with the default values initialized. +// NewPcloudPvminstancesDeleteParams creates a new PcloudPvminstancesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesDeleteParams() *PcloudPvminstancesDeleteParams { - var () return &PcloudPvminstancesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesDeleteParamsWithTimeout creates a new PcloudPvminstancesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesDeleteParams { - var () return &PcloudPvminstancesDeleteParams{ - timeout: timeout, } } // NewPcloudPvminstancesDeleteParamsWithContext creates a new PcloudPvminstancesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesDeleteParams { - var () return &PcloudPvminstancesDeleteParams{ - Context: ctx, } } // NewPcloudPvminstancesDeleteParamsWithHTTPClient creates a new PcloudPvminstancesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesDeleteParams { - var () return &PcloudPvminstancesDeleteParams{ HTTPClient: client, } } -/*PcloudPvminstancesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances delete operation typically these are written to a http.Request +/* PcloudPvminstancesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances delete operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*DeleteDataVolumes - Indicates if all data volumes attached to the PVMInstance should be deleted when deleting the PVMInstance. Shared data volumes will be deleted if there are no other PVMInstances attached. + /* DeleteDataVolumes. + + Indicates if all data volumes attached to the PVMInstance should be deleted when deleting the PVMInstance. Shared data volumes will be deleted if there are no other PVMInstances attached. */ DeleteDataVolumes *bool - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -83,6 +83,21 @@ type PcloudPvminstancesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesDeleteParams) WithDefaults() *PcloudPvminstancesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances delete params func (o *PcloudPvminstancesDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesDeleteParams { o.SetTimeout(timeout) @@ -166,16 +181,17 @@ func (o *PcloudPvminstancesDeleteParams) WriteToRequest(r runtime.ClientRequest, // query param delete_data_volumes var qrDeleteDataVolumes bool + if o.DeleteDataVolumes != nil { qrDeleteDataVolumes = *o.DeleteDataVolumes } qDeleteDataVolumes := swag.FormatBool(qrDeleteDataVolumes) if qDeleteDataVolumes != "" { + if err := r.SetQueryParam("delete_data_volumes", qDeleteDataVolumes); err != nil { return err } } - } // path param pvm_instance_id diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go index 65007fe27e..18189dcdeb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesDeleteReader is a Reader for the PcloudPvminstancesDelete structure. @@ -24,51 +23,44 @@ type PcloudPvminstancesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudPvminstancesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudPvminstancesDeleteOK() *PcloudPvminstancesDeleteOK { return &PcloudPvminstancesDeleteOK{} } -/*PcloudPvminstancesDeleteOK handles this case with default header values. +/* PcloudPvminstancesDeleteOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudPvminstancesDeleteOK struct { func (o *PcloudPvminstancesDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudPvminstancesDeleteBadRequest() *PcloudPvminstancesDeleteBadRequest return &PcloudPvminstancesDeleteBadRequest{} } -/*PcloudPvminstancesDeleteBadRequest handles this case with default header values. +/* PcloudPvminstancesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -115,6 +110,9 @@ type PcloudPvminstancesDeleteBadRequest struct { func (o *PcloudPvminstancesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudPvminstancesDeleteUnauthorized() *PcloudPvminstancesDeleteUnauthor return &PcloudPvminstancesDeleteUnauthorized{} } -/*PcloudPvminstancesDeleteUnauthorized handles this case with default header values. +/* PcloudPvminstancesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -144,6 +142,9 @@ type PcloudPvminstancesDeleteUnauthorized struct { func (o *PcloudPvminstancesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudPvminstancesDeleteNotFound() *PcloudPvminstancesDeleteNotFound { return &PcloudPvminstancesDeleteNotFound{} } -/*PcloudPvminstancesDeleteNotFound handles this case with default header values. +/* PcloudPvminstancesDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -173,6 +174,9 @@ type PcloudPvminstancesDeleteNotFound struct { func (o *PcloudPvminstancesDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudPvminstancesDeleteGone() *PcloudPvminstancesDeleteGone { return &PcloudPvminstancesDeleteGone{} } -/*PcloudPvminstancesDeleteGone handles this case with default header values. +/* PcloudPvminstancesDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -202,6 +206,9 @@ type PcloudPvminstancesDeleteGone struct { func (o *PcloudPvminstancesDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteGone %+v", 410, o.Payload) } +func (o *PcloudPvminstancesDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudPvminstancesDeleteInternalServerError() *PcloudPvminstancesDeleteI return &PcloudPvminstancesDeleteInternalServerError{} } -/*PcloudPvminstancesDeleteInternalServerError handles this case with default header values. +/* PcloudPvminstancesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudPvminstancesDeleteInternalServerError struct { func (o *PcloudPvminstancesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go index 5badd59cab..ebbc6f4a77 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesGetParams creates a new PcloudPvminstancesGetParams object -// with the default values initialized. +// NewPcloudPvminstancesGetParams creates a new PcloudPvminstancesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesGetParams() *PcloudPvminstancesGetParams { - var () return &PcloudPvminstancesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesGetParamsWithTimeout creates a new PcloudPvminstancesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesGetParams { - var () return &PcloudPvminstancesGetParams{ - timeout: timeout, } } // NewPcloudPvminstancesGetParamsWithContext creates a new PcloudPvminstancesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesGetParamsWithContext(ctx context.Context) *PcloudPvminstancesGetParams { - var () return &PcloudPvminstancesGetParams{ - Context: ctx, } } // NewPcloudPvminstancesGetParamsWithHTTPClient creates a new PcloudPvminstancesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesGetParams { - var () return &PcloudPvminstancesGetParams{ HTTPClient: client, } } -/*PcloudPvminstancesGetParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances get operation typically these are written to a http.Request +/* PcloudPvminstancesGetParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances get operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudPvminstancesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesGetParams) WithDefaults() *PcloudPvminstancesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances get params func (o *PcloudPvminstancesGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go index 1ab6096bfc..ddd375ee49 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesGetReader is a Reader for the PcloudPvminstancesGet structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesGetOK() *PcloudPvminstancesGetOK { return &PcloudPvminstancesGetOK{} } -/*PcloudPvminstancesGetOK handles this case with default header values. +/* PcloudPvminstancesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesGetOK struct { func (o *PcloudPvminstancesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesGetOK) GetPayload() *models.PVMInstance { + return o.Payload +} func (o *PcloudPvminstancesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPvminstancesGetBadRequest() *PcloudPvminstancesGetBadRequest { return &PcloudPvminstancesGetBadRequest{} } -/*PcloudPvminstancesGetBadRequest handles this case with default header values. +/* PcloudPvminstancesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPvminstancesGetBadRequest struct { func (o *PcloudPvminstancesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPvminstancesGetUnauthorized() *PcloudPvminstancesGetUnauthorized { return &PcloudPvminstancesGetUnauthorized{} } -/*PcloudPvminstancesGetUnauthorized handles this case with default header values. +/* PcloudPvminstancesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudPvminstancesGetUnauthorized struct { func (o *PcloudPvminstancesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPvminstancesGetNotFound() *PcloudPvminstancesGetNotFound { return &PcloudPvminstancesGetNotFound{} } -/*PcloudPvminstancesGetNotFound handles this case with default header values. +/* PcloudPvminstancesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudPvminstancesGetNotFound struct { func (o *PcloudPvminstancesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPvminstancesGetInternalServerError() *PcloudPvminstancesGetInterna return &PcloudPvminstancesGetInternalServerError{} } -/*PcloudPvminstancesGetInternalServerError handles this case with default header values. +/* PcloudPvminstancesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPvminstancesGetInternalServerError struct { func (o *PcloudPvminstancesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go index 3e53098418..88205d338e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesGetallParams creates a new PcloudPvminstancesGetallParams object -// with the default values initialized. +// NewPcloudPvminstancesGetallParams creates a new PcloudPvminstancesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesGetallParams() *PcloudPvminstancesGetallParams { - var () return &PcloudPvminstancesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesGetallParamsWithTimeout creates a new PcloudPvminstancesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesGetallParams { - var () return &PcloudPvminstancesGetallParams{ - timeout: timeout, } } // NewPcloudPvminstancesGetallParamsWithContext creates a new PcloudPvminstancesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesGetallParams { - var () return &PcloudPvminstancesGetallParams{ - Context: ctx, } } // NewPcloudPvminstancesGetallParamsWithHTTPClient creates a new PcloudPvminstancesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesGetallParams { - var () return &PcloudPvminstancesGetallParams{ HTTPClient: client, } } -/*PcloudPvminstancesGetallParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances getall operation typically these are written to a http.Request +/* PcloudPvminstancesGetallParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances getall operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudPvminstancesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesGetallParams) WithDefaults() *PcloudPvminstancesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances getall params func (o *PcloudPvminstancesGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go index 03179620a9..f55d76239f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesGetallReader is a Reader for the PcloudPvminstancesGetall structure. @@ -24,37 +23,32 @@ type PcloudPvminstancesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPvminstancesGetallOK() *PcloudPvminstancesGetallOK { return &PcloudPvminstancesGetallOK{} } -/*PcloudPvminstancesGetallOK handles this case with default header values. +/* PcloudPvminstancesGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPvminstancesGetallOK struct { func (o *PcloudPvminstancesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesGetallOK) GetPayload() *models.PVMInstances { + return o.Payload +} func (o *PcloudPvminstancesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPvminstancesGetallBadRequest() *PcloudPvminstancesGetallBadRequest return &PcloudPvminstancesGetallBadRequest{} } -/*PcloudPvminstancesGetallBadRequest handles this case with default header values. +/* PcloudPvminstancesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudPvminstancesGetallBadRequest struct { func (o *PcloudPvminstancesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPvminstancesGetallUnauthorized() *PcloudPvminstancesGetallUnauthor return &PcloudPvminstancesGetallUnauthorized{} } -/*PcloudPvminstancesGetallUnauthorized handles this case with default header values. +/* PcloudPvminstancesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudPvminstancesGetallUnauthorized struct { func (o *PcloudPvminstancesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPvminstancesGetallInternalServerError() *PcloudPvminstancesGetallI return &PcloudPvminstancesGetallInternalServerError{} } -/*PcloudPvminstancesGetallInternalServerError handles this case with default header values. +/* PcloudPvminstancesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPvminstancesGetallInternalServerError struct { func (o *PcloudPvminstancesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go index 8cc10093c8..5b6b0ee46c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_parameters.go @@ -13,74 +13,75 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesNetworksDeleteParams creates a new PcloudPvminstancesNetworksDeleteParams object -// with the default values initialized. +// NewPcloudPvminstancesNetworksDeleteParams creates a new PcloudPvminstancesNetworksDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesNetworksDeleteParams() *PcloudPvminstancesNetworksDeleteParams { - var () return &PcloudPvminstancesNetworksDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesNetworksDeleteParamsWithTimeout creates a new PcloudPvminstancesNetworksDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksDeleteParams { - var () return &PcloudPvminstancesNetworksDeleteParams{ - timeout: timeout, } } // NewPcloudPvminstancesNetworksDeleteParamsWithContext creates a new PcloudPvminstancesNetworksDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesNetworksDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksDeleteParams { - var () return &PcloudPvminstancesNetworksDeleteParams{ - Context: ctx, } } // NewPcloudPvminstancesNetworksDeleteParamsWithHTTPClient creates a new PcloudPvminstancesNetworksDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksDeleteParams { - var () return &PcloudPvminstancesNetworksDeleteParams{ HTTPClient: client, } } -/*PcloudPvminstancesNetworksDeleteParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances networks delete operation typically these are written to a http.Request +/* PcloudPvminstancesNetworksDeleteParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances networks delete operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesNetworksDeleteParams struct { - /*Body - Remove a network from PVM Instance parameters + /* Body. + Remove a network from PVM Instance parameters */ Body *models.PVMInstanceRemoveNetwork - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -89,6 +90,21 @@ type PcloudPvminstancesNetworksDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksDeleteParams) WithDefaults() *PcloudPvminstancesNetworksDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances networks delete params func (o *PcloudPvminstancesNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksDeleteParams { o.SetTimeout(timeout) @@ -173,7 +189,6 @@ func (o *PcloudPvminstancesNetworksDeleteParams) WriteToRequest(r runtime.Client return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go index 750efaf056..e3ce9d7eae 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesNetworksDeleteReader is a Reader for the PcloudPvminstancesNetworksDelete structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesNetworksDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesNetworksDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesNetworksDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesNetworksDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudPvminstancesNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesNetworksDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesNetworksDeleteOK() *PcloudPvminstancesNetworksDeleteOK return &PcloudPvminstancesNetworksDeleteOK{} } -/*PcloudPvminstancesNetworksDeleteOK handles this case with default header values. +/* PcloudPvminstancesNetworksDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesNetworksDeleteOK struct { func (o *PcloudPvminstancesNetworksDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesNetworksDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudPvminstancesNetworksDeleteBadRequest() *PcloudPvminstancesNetworks return &PcloudPvminstancesNetworksDeleteBadRequest{} } -/*PcloudPvminstancesNetworksDeleteBadRequest handles this case with default header values. +/* PcloudPvminstancesNetworksDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudPvminstancesNetworksDeleteBadRequest struct { func (o *PcloudPvminstancesNetworksDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesNetworksDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudPvminstancesNetworksDeleteUnauthorized() *PcloudPvminstancesNetwor return &PcloudPvminstancesNetworksDeleteUnauthorized{} } -/*PcloudPvminstancesNetworksDeleteUnauthorized handles this case with default header values. +/* PcloudPvminstancesNetworksDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudPvminstancesNetworksDeleteUnauthorized struct { func (o *PcloudPvminstancesNetworksDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesNetworksDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudPvminstancesNetworksDeleteGone() *PcloudPvminstancesNetworksDelete return &PcloudPvminstancesNetworksDeleteGone{} } -/*PcloudPvminstancesNetworksDeleteGone handles this case with default header values. +/* PcloudPvminstancesNetworksDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudPvminstancesNetworksDeleteGone struct { func (o *PcloudPvminstancesNetworksDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteGone %+v", 410, o.Payload) } +func (o *PcloudPvminstancesNetworksDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudPvminstancesNetworksDeleteInternalServerError() *PcloudPvminstance return &PcloudPvminstancesNetworksDeleteInternalServerError{} } -/*PcloudPvminstancesNetworksDeleteInternalServerError handles this case with default header values. +/* PcloudPvminstancesNetworksDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudPvminstancesNetworksDeleteInternalServerError struct { func (o *PcloudPvminstancesNetworksDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesNetworksDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go index 98888850bb..c9a444ef56 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesNetworksGetParams creates a new PcloudPvminstancesNetworksGetParams object -// with the default values initialized. +// NewPcloudPvminstancesNetworksGetParams creates a new PcloudPvminstancesNetworksGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesNetworksGetParams() *PcloudPvminstancesNetworksGetParams { - var () return &PcloudPvminstancesNetworksGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesNetworksGetParamsWithTimeout creates a new PcloudPvminstancesNetworksGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetParams { - var () return &PcloudPvminstancesNetworksGetParams{ - timeout: timeout, } } // NewPcloudPvminstancesNetworksGetParamsWithContext creates a new PcloudPvminstancesNetworksGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesNetworksGetParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksGetParams { - var () return &PcloudPvminstancesNetworksGetParams{ - Context: ctx, } } // NewPcloudPvminstancesNetworksGetParamsWithHTTPClient creates a new PcloudPvminstancesNetworksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksGetParams { - var () return &PcloudPvminstancesNetworksGetParams{ HTTPClient: client, } } -/*PcloudPvminstancesNetworksGetParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances networks get operation typically these are written to a http.Request +/* PcloudPvminstancesNetworksGetParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances networks get operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesNetworksGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*NetworkID - Network ID + /* NetworkID. + + Network ID */ NetworkID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -82,6 +82,21 @@ type PcloudPvminstancesNetworksGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances networks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksGetParams) WithDefaults() *PcloudPvminstancesNetworksGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances networks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances networks get params func (o *PcloudPvminstancesNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go index 3e29b24587..1587866e42 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesNetworksGetReader is a Reader for the PcloudPvminstancesNetworksGet structure. @@ -24,37 +23,32 @@ type PcloudPvminstancesNetworksGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesNetworksGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudPvminstancesNetworksGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesNetworksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesNetworksGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPvminstancesNetworksGetOK() *PcloudPvminstancesNetworksGetOK { return &PcloudPvminstancesNetworksGetOK{} } -/*PcloudPvminstancesNetworksGetOK handles this case with default header values. +/* PcloudPvminstancesNetworksGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPvminstancesNetworksGetOK struct { func (o *PcloudPvminstancesNetworksGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesNetworksGetOK) GetPayload() *models.PVMInstanceNetworks { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPvminstancesNetworksGetUnauthorized() *PcloudPvminstancesNetworksG return &PcloudPvminstancesNetworksGetUnauthorized{} } -/*PcloudPvminstancesNetworksGetUnauthorized handles this case with default header values. +/* PcloudPvminstancesNetworksGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudPvminstancesNetworksGetUnauthorized struct { func (o *PcloudPvminstancesNetworksGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesNetworksGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPvminstancesNetworksGetNotFound() *PcloudPvminstancesNetworksGetNo return &PcloudPvminstancesNetworksGetNotFound{} } -/*PcloudPvminstancesNetworksGetNotFound handles this case with default header values. +/* PcloudPvminstancesNetworksGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudPvminstancesNetworksGetNotFound struct { func (o *PcloudPvminstancesNetworksGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesNetworksGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPvminstancesNetworksGetInternalServerError() *PcloudPvminstancesNe return &PcloudPvminstancesNetworksGetInternalServerError{} } -/*PcloudPvminstancesNetworksGetInternalServerError handles this case with default header values. +/* PcloudPvminstancesNetworksGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPvminstancesNetworksGetInternalServerError struct { func (o *PcloudPvminstancesNetworksGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesNetworksGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go index c3d716a349..97fe7898dd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesNetworksGetallParams creates a new PcloudPvminstancesNetworksGetallParams object -// with the default values initialized. +// NewPcloudPvminstancesNetworksGetallParams creates a new PcloudPvminstancesNetworksGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesNetworksGetallParams() *PcloudPvminstancesNetworksGetallParams { - var () return &PcloudPvminstancesNetworksGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesNetworksGetallParamsWithTimeout creates a new PcloudPvminstancesNetworksGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesNetworksGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetallParams { - var () return &PcloudPvminstancesNetworksGetallParams{ - timeout: timeout, } } // NewPcloudPvminstancesNetworksGetallParamsWithContext creates a new PcloudPvminstancesNetworksGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesNetworksGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksGetallParams { - var () return &PcloudPvminstancesNetworksGetallParams{ - Context: ctx, } } // NewPcloudPvminstancesNetworksGetallParamsWithHTTPClient creates a new PcloudPvminstancesNetworksGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesNetworksGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksGetallParams { - var () return &PcloudPvminstancesNetworksGetallParams{ HTTPClient: client, } } -/*PcloudPvminstancesNetworksGetallParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances networks getall operation typically these are written to a http.Request +/* PcloudPvminstancesNetworksGetallParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances networks getall operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesNetworksGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudPvminstancesNetworksGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances networks getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksGetallParams) WithDefaults() *PcloudPvminstancesNetworksGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances networks getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances networks getall params func (o *PcloudPvminstancesNetworksGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go index 7025b1e5d0..79103867be 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesNetworksGetallReader is a Reader for the PcloudPvminstancesNetworksGetall structure. @@ -24,37 +23,32 @@ type PcloudPvminstancesNetworksGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesNetworksGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesNetworksGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesNetworksGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesNetworksGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPvminstancesNetworksGetallOK() *PcloudPvminstancesNetworksGetallOK return &PcloudPvminstancesNetworksGetallOK{} } -/*PcloudPvminstancesNetworksGetallOK handles this case with default header values. +/* PcloudPvminstancesNetworksGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPvminstancesNetworksGetallOK struct { func (o *PcloudPvminstancesNetworksGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesNetworksGetallOK) GetPayload() *models.PVMInstanceNetworks { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPvminstancesNetworksGetallBadRequest() *PcloudPvminstancesNetworks return &PcloudPvminstancesNetworksGetallBadRequest{} } -/*PcloudPvminstancesNetworksGetallBadRequest handles this case with default header values. +/* PcloudPvminstancesNetworksGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudPvminstancesNetworksGetallBadRequest struct { func (o *PcloudPvminstancesNetworksGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesNetworksGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPvminstancesNetworksGetallUnauthorized() *PcloudPvminstancesNetwor return &PcloudPvminstancesNetworksGetallUnauthorized{} } -/*PcloudPvminstancesNetworksGetallUnauthorized handles this case with default header values. +/* PcloudPvminstancesNetworksGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudPvminstancesNetworksGetallUnauthorized struct { func (o *PcloudPvminstancesNetworksGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesNetworksGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPvminstancesNetworksGetallInternalServerError() *PcloudPvminstance return &PcloudPvminstancesNetworksGetallInternalServerError{} } -/*PcloudPvminstancesNetworksGetallInternalServerError handles this case with default header values. +/* PcloudPvminstancesNetworksGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPvminstancesNetworksGetallInternalServerError struct { func (o *PcloudPvminstancesNetworksGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesNetworksGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go index 21e0976059..23c0b0d482 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesNetworksPostParams creates a new PcloudPvminstancesNetworksPostParams object -// with the default values initialized. +// NewPcloudPvminstancesNetworksPostParams creates a new PcloudPvminstancesNetworksPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesNetworksPostParams() *PcloudPvminstancesNetworksPostParams { - var () return &PcloudPvminstancesNetworksPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesNetworksPostParamsWithTimeout creates a new PcloudPvminstancesNetworksPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesNetworksPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksPostParams { - var () return &PcloudPvminstancesNetworksPostParams{ - timeout: timeout, } } // NewPcloudPvminstancesNetworksPostParamsWithContext creates a new PcloudPvminstancesNetworksPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesNetworksPostParamsWithContext(ctx context.Context) *PcloudPvminstancesNetworksPostParams { - var () return &PcloudPvminstancesNetworksPostParams{ - Context: ctx, } } // NewPcloudPvminstancesNetworksPostParamsWithHTTPClient creates a new PcloudPvminstancesNetworksPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesNetworksPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesNetworksPostParams { - var () return &PcloudPvminstancesNetworksPostParams{ HTTPClient: client, } } -/*PcloudPvminstancesNetworksPostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances networks post operation typically these are written to a http.Request +/* PcloudPvminstancesNetworksPostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances networks post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesNetworksPostParams struct { - /*Body - Add network to PVM Instance parameters + /* Body. + Add network to PVM Instance parameters */ Body *models.PVMInstanceAddNetwork - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesNetworksPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances networks post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksPostParams) WithDefaults() *PcloudPvminstancesNetworksPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances networks post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesNetworksPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances networks post params func (o *PcloudPvminstancesNetworksPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesNetworksPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesNetworksPostParams) WriteToRequest(r runtime.ClientRe return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go index 17acedd26e..4bd3ed07c3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesNetworksPostReader is a Reader for the PcloudPvminstancesNetworksPost structure. @@ -24,51 +23,44 @@ type PcloudPvminstancesNetworksPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 201: result := NewPcloudPvminstancesNetworksPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesNetworksPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesNetworksPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesNetworksPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesNetworksPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesNetworksPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudPvminstancesNetworksPostCreated() *PcloudPvminstancesNetworksPostC return &PcloudPvminstancesNetworksPostCreated{} } -/*PcloudPvminstancesNetworksPostCreated handles this case with default header values. +/* PcloudPvminstancesNetworksPostCreated describes a response with status code 201, with default header values. Created */ @@ -88,6 +80,9 @@ type PcloudPvminstancesNetworksPostCreated struct { func (o *PcloudPvminstancesNetworksPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostCreated %+v", 201, o.Payload) } +func (o *PcloudPvminstancesNetworksPostCreated) GetPayload() *models.PVMInstanceNetwork { + return o.Payload +} func (o *PcloudPvminstancesNetworksPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudPvminstancesNetworksPostBadRequest() *PcloudPvminstancesNetworksPo return &PcloudPvminstancesNetworksPostBadRequest{} } -/*PcloudPvminstancesNetworksPostBadRequest handles this case with default header values. +/* PcloudPvminstancesNetworksPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudPvminstancesNetworksPostBadRequest struct { func (o *PcloudPvminstancesNetworksPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesNetworksPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudPvminstancesNetworksPostUnauthorized() *PcloudPvminstancesNetworks return &PcloudPvminstancesNetworksPostUnauthorized{} } -/*PcloudPvminstancesNetworksPostUnauthorized handles this case with default header values. +/* PcloudPvminstancesNetworksPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudPvminstancesNetworksPostUnauthorized struct { func (o *PcloudPvminstancesNetworksPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesNetworksPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudPvminstancesNetworksPostConflict() *PcloudPvminstancesNetworksPost return &PcloudPvminstancesNetworksPostConflict{} } -/*PcloudPvminstancesNetworksPostConflict handles this case with default header values. +/* PcloudPvminstancesNetworksPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type PcloudPvminstancesNetworksPostConflict struct { func (o *PcloudPvminstancesNetworksPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesNetworksPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudPvminstancesNetworksPostUnprocessableEntity() *PcloudPvminstancesN return &PcloudPvminstancesNetworksPostUnprocessableEntity{} } -/*PcloudPvminstancesNetworksPostUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesNetworksPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudPvminstancesNetworksPostUnprocessableEntity struct { func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudPvminstancesNetworksPostInternalServerError() *PcloudPvminstancesN return &PcloudPvminstancesNetworksPostInternalServerError{} } -/*PcloudPvminstancesNetworksPostInternalServerError handles this case with default header values. +/* PcloudPvminstancesNetworksPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudPvminstancesNetworksPostInternalServerError struct { func (o *PcloudPvminstancesNetworksPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesNetworksPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesNetworksPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go index 28041b3195..adf9227844 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesOperationsPostParams creates a new PcloudPvminstancesOperationsPostParams object -// with the default values initialized. +// NewPcloudPvminstancesOperationsPostParams creates a new PcloudPvminstancesOperationsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesOperationsPostParams() *PcloudPvminstancesOperationsPostParams { - var () return &PcloudPvminstancesOperationsPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesOperationsPostParamsWithTimeout creates a new PcloudPvminstancesOperationsPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesOperationsPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesOperationsPostParams { - var () return &PcloudPvminstancesOperationsPostParams{ - timeout: timeout, } } // NewPcloudPvminstancesOperationsPostParamsWithContext creates a new PcloudPvminstancesOperationsPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesOperationsPostParamsWithContext(ctx context.Context) *PcloudPvminstancesOperationsPostParams { - var () return &PcloudPvminstancesOperationsPostParams{ - Context: ctx, } } // NewPcloudPvminstancesOperationsPostParamsWithHTTPClient creates a new PcloudPvminstancesOperationsPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesOperationsPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesOperationsPostParams { - var () return &PcloudPvminstancesOperationsPostParams{ HTTPClient: client, } } -/*PcloudPvminstancesOperationsPostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances operations post operation typically these are written to a http.Request +/* PcloudPvminstancesOperationsPostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances operations post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesOperationsPostParams struct { - /*Body - Parameters for the desired operations + /* Body. + Parameters for the desired operations */ Body *models.PVMInstanceOperation - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesOperationsPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances operations post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesOperationsPostParams) WithDefaults() *PcloudPvminstancesOperationsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances operations post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesOperationsPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances operations post params func (o *PcloudPvminstancesOperationsPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesOperationsPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesOperationsPostParams) WriteToRequest(r runtime.Client return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go index 5d7e0269ac..a68b431911 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesOperationsPostReader is a Reader for the PcloudPvminstancesOperationsPost structure. @@ -24,51 +23,44 @@ type PcloudPvminstancesOperationsPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesOperationsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesOperationsPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesOperationsPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesOperationsPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesOperationsPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesOperationsPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesOperationsPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudPvminstancesOperationsPostOK() *PcloudPvminstancesOperationsPostOK return &PcloudPvminstancesOperationsPostOK{} } -/*PcloudPvminstancesOperationsPostOK handles this case with default header values. +/* PcloudPvminstancesOperationsPostOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudPvminstancesOperationsPostOK struct { func (o *PcloudPvminstancesOperationsPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesOperationsPostOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesOperationsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudPvminstancesOperationsPostBadRequest() *PcloudPvminstancesOperatio return &PcloudPvminstancesOperationsPostBadRequest{} } -/*PcloudPvminstancesOperationsPostBadRequest handles this case with default header values. +/* PcloudPvminstancesOperationsPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -115,6 +110,9 @@ type PcloudPvminstancesOperationsPostBadRequest struct { func (o *PcloudPvminstancesOperationsPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesOperationsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesOperationsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudPvminstancesOperationsPostUnauthorized() *PcloudPvminstancesOperat return &PcloudPvminstancesOperationsPostUnauthorized{} } -/*PcloudPvminstancesOperationsPostUnauthorized handles this case with default header values. +/* PcloudPvminstancesOperationsPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -144,6 +142,9 @@ type PcloudPvminstancesOperationsPostUnauthorized struct { func (o *PcloudPvminstancesOperationsPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesOperationsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesOperationsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudPvminstancesOperationsPostNotFound() *PcloudPvminstancesOperations return &PcloudPvminstancesOperationsPostNotFound{} } -/*PcloudPvminstancesOperationsPostNotFound handles this case with default header values. +/* PcloudPvminstancesOperationsPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -173,6 +174,9 @@ type PcloudPvminstancesOperationsPostNotFound struct { func (o *PcloudPvminstancesOperationsPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesOperationsPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesOperationsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudPvminstancesOperationsPostUnprocessableEntity() *PcloudPvminstance return &PcloudPvminstancesOperationsPostUnprocessableEntity{} } -/*PcloudPvminstancesOperationsPostUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesOperationsPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -202,6 +206,9 @@ type PcloudPvminstancesOperationsPostUnprocessableEntity struct { func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudPvminstancesOperationsPostInternalServerError() *PcloudPvminstance return &PcloudPvminstancesOperationsPostInternalServerError{} } -/*PcloudPvminstancesOperationsPostInternalServerError handles this case with default header values. +/* PcloudPvminstancesOperationsPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudPvminstancesOperationsPostInternalServerError struct { func (o *PcloudPvminstancesOperationsPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesOperationsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesOperationsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go index a615987699..4720dc28ac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_parameters.go @@ -13,70 +13,70 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesPostParams creates a new PcloudPvminstancesPostParams object -// with the default values initialized. +// NewPcloudPvminstancesPostParams creates a new PcloudPvminstancesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesPostParams() *PcloudPvminstancesPostParams { - var () return &PcloudPvminstancesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesPostParamsWithTimeout creates a new PcloudPvminstancesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesPostParams { - var () return &PcloudPvminstancesPostParams{ - timeout: timeout, } } // NewPcloudPvminstancesPostParamsWithContext creates a new PcloudPvminstancesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesPostParamsWithContext(ctx context.Context) *PcloudPvminstancesPostParams { - var () return &PcloudPvminstancesPostParams{ - Context: ctx, } } // NewPcloudPvminstancesPostParamsWithHTTPClient creates a new PcloudPvminstancesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesPostParams { - var () return &PcloudPvminstancesPostParams{ HTTPClient: client, } } -/*PcloudPvminstancesPostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances post operation typically these are written to a http.Request +/* PcloudPvminstancesPostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesPostParams struct { - /*Body - Parameters for the creation of a new Power VM Instance + /* Body. + Parameters for the creation of a new Power VM Instance */ Body *models.PVMInstanceCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*SkipHostValidation - Option to skip host validation on PVMInstance Create API + /* SkipHostValidation. + + Option to skip host validation on PVMInstance Create API */ SkipHostValidation *bool @@ -85,6 +85,21 @@ type PcloudPvminstancesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesPostParams) WithDefaults() *PcloudPvminstancesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances post params func (o *PcloudPvminstancesPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesPostParams { o.SetTimeout(timeout) @@ -158,7 +173,6 @@ func (o *PcloudPvminstancesPostParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -174,16 +188,17 @@ func (o *PcloudPvminstancesPostParams) WriteToRequest(r runtime.ClientRequest, r // query param skipHostValidation var qrSkipHostValidation bool + if o.SkipHostValidation != nil { qrSkipHostValidation = *o.SkipHostValidation } qSkipHostValidation := swag.FormatBool(qrSkipHostValidation) if qSkipHostValidation != "" { + if err := r.SetQueryParam("skipHostValidation", qSkipHostValidation); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go index ee486e4f59..7901103744 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesPostReader is a Reader for the PcloudPvminstancesPost structure. @@ -24,72 +23,62 @@ type PcloudPvminstancesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewPcloudPvminstancesPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudPvminstancesPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 504: result := NewPcloudPvminstancesPostGatewayTimeout() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -98,7 +87,7 @@ func NewPcloudPvminstancesPostOK() *PcloudPvminstancesPostOK { return &PcloudPvminstancesPostOK{} } -/*PcloudPvminstancesPostOK handles this case with default header values. +/* PcloudPvminstancesPostOK describes a response with status code 200, with default header values. OK */ @@ -109,6 +98,9 @@ type PcloudPvminstancesPostOK struct { func (o *PcloudPvminstancesPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesPostOK) GetPayload() models.PVMInstanceList { + return o.Payload +} func (o *PcloudPvminstancesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -125,7 +117,7 @@ func NewPcloudPvminstancesPostCreated() *PcloudPvminstancesPostCreated { return &PcloudPvminstancesPostCreated{} } -/*PcloudPvminstancesPostCreated handles this case with default header values. +/* PcloudPvminstancesPostCreated describes a response with status code 201, with default header values. Created */ @@ -136,6 +128,9 @@ type PcloudPvminstancesPostCreated struct { func (o *PcloudPvminstancesPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostCreated %+v", 201, o.Payload) } +func (o *PcloudPvminstancesPostCreated) GetPayload() models.PVMInstanceList { + return o.Payload +} func (o *PcloudPvminstancesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -152,7 +147,7 @@ func NewPcloudPvminstancesPostAccepted() *PcloudPvminstancesPostAccepted { return &PcloudPvminstancesPostAccepted{} } -/*PcloudPvminstancesPostAccepted handles this case with default header values. +/* PcloudPvminstancesPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -163,6 +158,9 @@ type PcloudPvminstancesPostAccepted struct { func (o *PcloudPvminstancesPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesPostAccepted) GetPayload() models.PVMInstanceList { + return o.Payload +} func (o *PcloudPvminstancesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -179,7 +177,7 @@ func NewPcloudPvminstancesPostBadRequest() *PcloudPvminstancesPostBadRequest { return &PcloudPvminstancesPostBadRequest{} } -/*PcloudPvminstancesPostBadRequest handles this case with default header values. +/* PcloudPvminstancesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -190,6 +188,9 @@ type PcloudPvminstancesPostBadRequest struct { func (o *PcloudPvminstancesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -208,7 +209,7 @@ func NewPcloudPvminstancesPostUnauthorized() *PcloudPvminstancesPostUnauthorized return &PcloudPvminstancesPostUnauthorized{} } -/*PcloudPvminstancesPostUnauthorized handles this case with default header values. +/* PcloudPvminstancesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -219,6 +220,9 @@ type PcloudPvminstancesPostUnauthorized struct { func (o *PcloudPvminstancesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -237,7 +241,7 @@ func NewPcloudPvminstancesPostConflict() *PcloudPvminstancesPostConflict { return &PcloudPvminstancesPostConflict{} } -/*PcloudPvminstancesPostConflict handles this case with default header values. +/* PcloudPvminstancesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -248,6 +252,9 @@ type PcloudPvminstancesPostConflict struct { func (o *PcloudPvminstancesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -266,7 +273,7 @@ func NewPcloudPvminstancesPostUnprocessableEntity() *PcloudPvminstancesPostUnpro return &PcloudPvminstancesPostUnprocessableEntity{} } -/*PcloudPvminstancesPostUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -277,6 +284,9 @@ type PcloudPvminstancesPostUnprocessableEntity struct { func (o *PcloudPvminstancesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -295,7 +305,7 @@ func NewPcloudPvminstancesPostInternalServerError() *PcloudPvminstancesPostInter return &PcloudPvminstancesPostInternalServerError{} } -/*PcloudPvminstancesPostInternalServerError handles this case with default header values. +/* PcloudPvminstancesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -306,6 +316,9 @@ type PcloudPvminstancesPostInternalServerError struct { func (o *PcloudPvminstancesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -324,7 +337,7 @@ func NewPcloudPvminstancesPostGatewayTimeout() *PcloudPvminstancesPostGatewayTim return &PcloudPvminstancesPostGatewayTimeout{} } -/*PcloudPvminstancesPostGatewayTimeout handles this case with default header values. +/* PcloudPvminstancesPostGatewayTimeout describes a response with status code 504, with default header values. Gateway Timeout. Request is still processing and taking longer than expected. */ @@ -335,6 +348,9 @@ type PcloudPvminstancesPostGatewayTimeout struct { func (o *PcloudPvminstancesPostGatewayTimeout) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostGatewayTimeout %+v", 504, o.Payload) } +func (o *PcloudPvminstancesPostGatewayTimeout) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go index cf5ee58bed..48b71a21d9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesPutParams creates a new PcloudPvminstancesPutParams object -// with the default values initialized. +// NewPcloudPvminstancesPutParams creates a new PcloudPvminstancesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesPutParams() *PcloudPvminstancesPutParams { - var () return &PcloudPvminstancesPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesPutParamsWithTimeout creates a new PcloudPvminstancesPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesPutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesPutParams { - var () return &PcloudPvminstancesPutParams{ - timeout: timeout, } } // NewPcloudPvminstancesPutParamsWithContext creates a new PcloudPvminstancesPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesPutParamsWithContext(ctx context.Context) *PcloudPvminstancesPutParams { - var () return &PcloudPvminstancesPutParams{ - Context: ctx, } } // NewPcloudPvminstancesPutParamsWithHTTPClient creates a new PcloudPvminstancesPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesPutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesPutParams { - var () return &PcloudPvminstancesPutParams{ HTTPClient: client, } } -/*PcloudPvminstancesPutParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances put operation typically these are written to a http.Request +/* PcloudPvminstancesPutParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances put operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesPutParams struct { - /*Body - Parameters to update a PCloud PVM Instance + /* Body. + Parameters to update a PCloud PVM Instance */ Body *models.PVMInstanceUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesPutParams) WithDefaults() *PcloudPvminstancesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances put params func (o *PcloudPvminstancesPutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesPutParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go index 52186195eb..c88a794f30 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesPutReader is a Reader for the PcloudPvminstancesPut structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudPvminstancesPutAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPvminstancesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesPutAccepted() *PcloudPvminstancesPutAccepted { return &PcloudPvminstancesPutAccepted{} } -/*PcloudPvminstancesPutAccepted handles this case with default header values. +/* PcloudPvminstancesPutAccepted describes a response with status code 202, with default header values. Accepted (this is a long running operation) */ @@ -81,6 +74,9 @@ type PcloudPvminstancesPutAccepted struct { func (o *PcloudPvminstancesPutAccepted) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesPutAccepted) GetPayload() *models.PVMInstanceUpdateResponse { + return o.Payload +} func (o *PcloudPvminstancesPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPvminstancesPutBadRequest() *PcloudPvminstancesPutBadRequest { return &PcloudPvminstancesPutBadRequest{} } -/*PcloudPvminstancesPutBadRequest handles this case with default header values. +/* PcloudPvminstancesPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPvminstancesPutBadRequest struct { func (o *PcloudPvminstancesPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPvminstancesPutUnauthorized() *PcloudPvminstancesPutUnauthorized { return &PcloudPvminstancesPutUnauthorized{} } -/*PcloudPvminstancesPutUnauthorized handles this case with default header values. +/* PcloudPvminstancesPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudPvminstancesPutUnauthorized struct { func (o *PcloudPvminstancesPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPvminstancesPutUnprocessableEntity() *PcloudPvminstancesPutUnproce return &PcloudPvminstancesPutUnprocessableEntity{} } -/*PcloudPvminstancesPutUnprocessableEntity handles this case with default header values. +/* PcloudPvminstancesPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudPvminstancesPutUnprocessableEntity struct { func (o *PcloudPvminstancesPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPvminstancesPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPvminstancesPutInternalServerError() *PcloudPvminstancesPutInterna return &PcloudPvminstancesPutInternalServerError{} } -/*PcloudPvminstancesPutInternalServerError handles this case with default header values. +/* PcloudPvminstancesPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPvminstancesPutInternalServerError struct { func (o *PcloudPvminstancesPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go index de15608302..6441ed24ab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesSnapshotsGetallParams creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the default values initialized. +// NewPcloudPvminstancesSnapshotsGetallParams creates a new PcloudPvminstancesSnapshotsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesSnapshotsGetallParams() *PcloudPvminstancesSnapshotsGetallParams { - var () return &PcloudPvminstancesSnapshotsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesSnapshotsGetallParamsWithTimeout creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesSnapshotsGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsGetallParams { - var () return &PcloudPvminstancesSnapshotsGetallParams{ - timeout: timeout, } } // NewPcloudPvminstancesSnapshotsGetallParamsWithContext creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesSnapshotsGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesSnapshotsGetallParams { - var () return &PcloudPvminstancesSnapshotsGetallParams{ - Context: ctx, } } // NewPcloudPvminstancesSnapshotsGetallParamsWithHTTPClient creates a new PcloudPvminstancesSnapshotsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesSnapshotsGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsGetallParams { - var () return &PcloudPvminstancesSnapshotsGetallParams{ HTTPClient: client, } } -/*PcloudPvminstancesSnapshotsGetallParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances snapshots getall operation typically these are written to a http.Request +/* PcloudPvminstancesSnapshotsGetallParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances snapshots getall operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesSnapshotsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudPvminstancesSnapshotsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances snapshots getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesSnapshotsGetallParams) WithDefaults() *PcloudPvminstancesSnapshotsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances snapshots getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesSnapshotsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances snapshots getall params func (o *PcloudPvminstancesSnapshotsGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go index 88251dff75..9b257b3e2b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesSnapshotsGetallReader is a Reader for the PcloudPvminstancesSnapshotsGetall structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesSnapshotsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesSnapshotsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesSnapshotsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesSnapshotsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesSnapshotsGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesSnapshotsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesSnapshotsGetallOK() *PcloudPvminstancesSnapshotsGetall return &PcloudPvminstancesSnapshotsGetallOK{} } -/*PcloudPvminstancesSnapshotsGetallOK handles this case with default header values. +/* PcloudPvminstancesSnapshotsGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesSnapshotsGetallOK struct { func (o *PcloudPvminstancesSnapshotsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesSnapshotsGetallOK) GetPayload() *models.Snapshots { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPvminstancesSnapshotsGetallBadRequest() *PcloudPvminstancesSnapsho return &PcloudPvminstancesSnapshotsGetallBadRequest{} } -/*PcloudPvminstancesSnapshotsGetallBadRequest handles this case with default header values. +/* PcloudPvminstancesSnapshotsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPvminstancesSnapshotsGetallBadRequest struct { func (o *PcloudPvminstancesSnapshotsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesSnapshotsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPvminstancesSnapshotsGetallUnauthorized() *PcloudPvminstancesSnaps return &PcloudPvminstancesSnapshotsGetallUnauthorized{} } -/*PcloudPvminstancesSnapshotsGetallUnauthorized handles this case with default header values. +/* PcloudPvminstancesSnapshotsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudPvminstancesSnapshotsGetallUnauthorized struct { func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPvminstancesSnapshotsGetallNotFound() *PcloudPvminstancesSnapshots return &PcloudPvminstancesSnapshotsGetallNotFound{} } -/*PcloudPvminstancesSnapshotsGetallNotFound handles this case with default header values. +/* PcloudPvminstancesSnapshotsGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudPvminstancesSnapshotsGetallNotFound struct { func (o *PcloudPvminstancesSnapshotsGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesSnapshotsGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPvminstancesSnapshotsGetallInternalServerError() *PcloudPvminstanc return &PcloudPvminstancesSnapshotsGetallInternalServerError{} } -/*PcloudPvminstancesSnapshotsGetallInternalServerError handles this case with default header values. +/* PcloudPvminstancesSnapshotsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPvminstancesSnapshotsGetallInternalServerError struct { func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go index 512b492bc9..551a20e44a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesSnapshotsPostParams creates a new PcloudPvminstancesSnapshotsPostParams object -// with the default values initialized. +// NewPcloudPvminstancesSnapshotsPostParams creates a new PcloudPvminstancesSnapshotsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesSnapshotsPostParams() *PcloudPvminstancesSnapshotsPostParams { - var () return &PcloudPvminstancesSnapshotsPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesSnapshotsPostParamsWithTimeout creates a new PcloudPvminstancesSnapshotsPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesSnapshotsPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsPostParams { - var () return &PcloudPvminstancesSnapshotsPostParams{ - timeout: timeout, } } // NewPcloudPvminstancesSnapshotsPostParamsWithContext creates a new PcloudPvminstancesSnapshotsPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesSnapshotsPostParamsWithContext(ctx context.Context) *PcloudPvminstancesSnapshotsPostParams { - var () return &PcloudPvminstancesSnapshotsPostParams{ - Context: ctx, } } // NewPcloudPvminstancesSnapshotsPostParamsWithHTTPClient creates a new PcloudPvminstancesSnapshotsPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesSnapshotsPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsPostParams { - var () return &PcloudPvminstancesSnapshotsPostParams{ HTTPClient: client, } } -/*PcloudPvminstancesSnapshotsPostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances snapshots post operation typically these are written to a http.Request +/* PcloudPvminstancesSnapshotsPostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances snapshots post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesSnapshotsPostParams struct { - /*Body - PVM Instance snapshot create parameters + /* Body. + PVM Instance snapshot create parameters */ Body *models.SnapshotCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudPvminstancesSnapshotsPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances snapshots post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesSnapshotsPostParams) WithDefaults() *PcloudPvminstancesSnapshotsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances snapshots post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesSnapshotsPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances snapshots post params func (o *PcloudPvminstancesSnapshotsPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPvminstancesSnapshotsPostParams) WriteToRequest(r runtime.ClientR return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go index 13f84a959a..a1f957222e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesSnapshotsPostReader is a Reader for the PcloudPvminstancesSnapshotsPost structure. @@ -24,51 +23,44 @@ type PcloudPvminstancesSnapshotsPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudPvminstancesSnapshotsPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesSnapshotsPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesSnapshotsPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesSnapshotsPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesSnapshotsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesSnapshotsPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudPvminstancesSnapshotsPostAccepted() *PcloudPvminstancesSnapshotsPo return &PcloudPvminstancesSnapshotsPostAccepted{} } -/*PcloudPvminstancesSnapshotsPostAccepted handles this case with default header values. +/* PcloudPvminstancesSnapshotsPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudPvminstancesSnapshotsPostAccepted struct { func (o *PcloudPvminstancesSnapshotsPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesSnapshotsPostAccepted) GetPayload() *models.SnapshotCreateResponse { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudPvminstancesSnapshotsPostBadRequest() *PcloudPvminstancesSnapshots return &PcloudPvminstancesSnapshotsPostBadRequest{} } -/*PcloudPvminstancesSnapshotsPostBadRequest handles this case with default header values. +/* PcloudPvminstancesSnapshotsPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudPvminstancesSnapshotsPostBadRequest struct { func (o *PcloudPvminstancesSnapshotsPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesSnapshotsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudPvminstancesSnapshotsPostUnauthorized() *PcloudPvminstancesSnapsho return &PcloudPvminstancesSnapshotsPostUnauthorized{} } -/*PcloudPvminstancesSnapshotsPostUnauthorized handles this case with default header values. +/* PcloudPvminstancesSnapshotsPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudPvminstancesSnapshotsPostUnauthorized struct { func (o *PcloudPvminstancesSnapshotsPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesSnapshotsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudPvminstancesSnapshotsPostNotFound() *PcloudPvminstancesSnapshotsPo return &PcloudPvminstancesSnapshotsPostNotFound{} } -/*PcloudPvminstancesSnapshotsPostNotFound handles this case with default header values. +/* PcloudPvminstancesSnapshotsPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -175,6 +176,9 @@ type PcloudPvminstancesSnapshotsPostNotFound struct { func (o *PcloudPvminstancesSnapshotsPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesSnapshotsPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudPvminstancesSnapshotsPostConflict() *PcloudPvminstancesSnapshotsPo return &PcloudPvminstancesSnapshotsPostConflict{} } -/*PcloudPvminstancesSnapshotsPostConflict handles this case with default header values. +/* PcloudPvminstancesSnapshotsPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -204,6 +208,9 @@ type PcloudPvminstancesSnapshotsPostConflict struct { func (o *PcloudPvminstancesSnapshotsPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesSnapshotsPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudPvminstancesSnapshotsPostInternalServerError() *PcloudPvminstances return &PcloudPvminstancesSnapshotsPostInternalServerError{} } -/*PcloudPvminstancesSnapshotsPostInternalServerError handles this case with default header values. +/* PcloudPvminstancesSnapshotsPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudPvminstancesSnapshotsPostInternalServerError struct { func (o *PcloudPvminstancesSnapshotsPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesSnapshotsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go index bbf792fb7c..9a56a1f7a5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_parameters.go @@ -13,79 +13,81 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesSnapshotsRestorePostParams creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the default values initialized. +// NewPcloudPvminstancesSnapshotsRestorePostParams creates a new PcloudPvminstancesSnapshotsRestorePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesSnapshotsRestorePostParams() *PcloudPvminstancesSnapshotsRestorePostParams { - var () return &PcloudPvminstancesSnapshotsRestorePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesSnapshotsRestorePostParamsWithTimeout creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesSnapshotsRestorePostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsRestorePostParams { - var () return &PcloudPvminstancesSnapshotsRestorePostParams{ - timeout: timeout, } } // NewPcloudPvminstancesSnapshotsRestorePostParamsWithContext creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesSnapshotsRestorePostParamsWithContext(ctx context.Context) *PcloudPvminstancesSnapshotsRestorePostParams { - var () return &PcloudPvminstancesSnapshotsRestorePostParams{ - Context: ctx, } } // NewPcloudPvminstancesSnapshotsRestorePostParamsWithHTTPClient creates a new PcloudPvminstancesSnapshotsRestorePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesSnapshotsRestorePostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesSnapshotsRestorePostParams { - var () return &PcloudPvminstancesSnapshotsRestorePostParams{ HTTPClient: client, } } -/*PcloudPvminstancesSnapshotsRestorePostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances snapshots restore post operation typically these are written to a http.Request +/* PcloudPvminstancesSnapshotsRestorePostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances snapshots restore post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesSnapshotsRestorePostParams struct { - /*Body - PVM Instance snapshot restore parameters + /* Body. + PVM Instance snapshot restore parameters */ Body *models.SnapshotRestore - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string - /*RestoreFailAction - Action to take on a failed snapshot restore + /* RestoreFailAction. + + Action to take on a failed snapshot restore */ RestoreFailAction *string - /*SnapshotID - PVM Instance snapshot id + /* SnapshotID. + + PVM Instance snapshot id */ SnapshotID string @@ -94,6 +96,21 @@ type PcloudPvminstancesSnapshotsRestorePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances snapshots restore post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithDefaults() *PcloudPvminstancesSnapshotsRestorePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances snapshots restore post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesSnapshotsRestorePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances snapshots restore post params func (o *PcloudPvminstancesSnapshotsRestorePostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesSnapshotsRestorePostParams { o.SetTimeout(timeout) @@ -189,7 +206,6 @@ func (o *PcloudPvminstancesSnapshotsRestorePostParams) WriteToRequest(r runtime. return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -210,16 +226,17 @@ func (o *PcloudPvminstancesSnapshotsRestorePostParams) WriteToRequest(r runtime. // query param restore_fail_action var qrRestoreFailAction string + if o.RestoreFailAction != nil { qrRestoreFailAction = *o.RestoreFailAction } qRestoreFailAction := qrRestoreFailAction if qRestoreFailAction != "" { + if err := r.SetQueryParam("restore_fail_action", qRestoreFailAction); err != nil { return err } } - } // path param snapshot_id diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go index bc3d460142..5dbfbac8bb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesSnapshotsRestorePostReader is a Reader for the PcloudPvminstancesSnapshotsRestorePost structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesSnapshotsRestorePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesSnapshotsRestorePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudPvminstancesSnapshotsRestorePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesSnapshotsRestorePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesSnapshotsRestorePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesSnapshotsRestorePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesSnapshotsRestorePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesSnapshotsRestorePostAccepted() *PcloudPvminstancesSnap return &PcloudPvminstancesSnapshotsRestorePostAccepted{} } -/*PcloudPvminstancesSnapshotsRestorePostAccepted handles this case with default header values. +/* PcloudPvminstancesSnapshotsRestorePostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -81,6 +74,9 @@ type PcloudPvminstancesSnapshotsRestorePostAccepted struct { func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) GetPayload() *models.Snapshot { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPvminstancesSnapshotsRestorePostBadRequest() *PcloudPvminstancesSn return &PcloudPvminstancesSnapshotsRestorePostBadRequest{} } -/*PcloudPvminstancesSnapshotsRestorePostBadRequest handles this case with default header values. +/* PcloudPvminstancesSnapshotsRestorePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPvminstancesSnapshotsRestorePostBadRequest struct { func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPvminstancesSnapshotsRestorePostUnauthorized() *PcloudPvminstances return &PcloudPvminstancesSnapshotsRestorePostUnauthorized{} } -/*PcloudPvminstancesSnapshotsRestorePostUnauthorized handles this case with default header values. +/* PcloudPvminstancesSnapshotsRestorePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudPvminstancesSnapshotsRestorePostUnauthorized struct { func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPvminstancesSnapshotsRestorePostConflict() *PcloudPvminstancesSnap return &PcloudPvminstancesSnapshotsRestorePostConflict{} } -/*PcloudPvminstancesSnapshotsRestorePostConflict handles this case with default header values. +/* PcloudPvminstancesSnapshotsRestorePostConflict describes a response with status code 409, with default header values. Conflict */ @@ -168,6 +170,9 @@ type PcloudPvminstancesSnapshotsRestorePostConflict struct { func (o *PcloudPvminstancesSnapshotsRestorePostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesSnapshotsRestorePostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsRestorePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPvminstancesSnapshotsRestorePostInternalServerError() *PcloudPvmin return &PcloudPvminstancesSnapshotsRestorePostInternalServerError{} } -/*PcloudPvminstancesSnapshotsRestorePostInternalServerError handles this case with default header values. +/* PcloudPvminstancesSnapshotsRestorePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPvminstancesSnapshotsRestorePostInternalServerError struct { func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go index ecdb5a353b..8519057ed0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2PvminstancesCaptureGetParams creates a new PcloudV2PvminstancesCaptureGetParams object -// with the default values initialized. +// NewPcloudV2PvminstancesCaptureGetParams creates a new PcloudV2PvminstancesCaptureGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2PvminstancesCaptureGetParams() *PcloudV2PvminstancesCaptureGetParams { - var () return &PcloudV2PvminstancesCaptureGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2PvminstancesCaptureGetParamsWithTimeout creates a new PcloudV2PvminstancesCaptureGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2PvminstancesCaptureGetParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesCaptureGetParams { - var () return &PcloudV2PvminstancesCaptureGetParams{ - timeout: timeout, } } // NewPcloudV2PvminstancesCaptureGetParamsWithContext creates a new PcloudV2PvminstancesCaptureGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2PvminstancesCaptureGetParamsWithContext(ctx context.Context) *PcloudV2PvminstancesCaptureGetParams { - var () return &PcloudV2PvminstancesCaptureGetParams{ - Context: ctx, } } // NewPcloudV2PvminstancesCaptureGetParamsWithHTTPClient creates a new PcloudV2PvminstancesCaptureGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2PvminstancesCaptureGetParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesCaptureGetParams { - var () return &PcloudV2PvminstancesCaptureGetParams{ HTTPClient: client, } } -/*PcloudV2PvminstancesCaptureGetParams contains all the parameters to send to the API endpoint -for the pcloud v2 pvminstances capture get operation typically these are written to a http.Request +/* PcloudV2PvminstancesCaptureGetParams contains all the parameters to send to the API endpoint + for the pcloud v2 pvminstances capture get operation. + + Typically these are written to a http.Request. */ type PcloudV2PvminstancesCaptureGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudV2PvminstancesCaptureGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 pvminstances capture get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2PvminstancesCaptureGetParams) WithDefaults() *PcloudV2PvminstancesCaptureGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 pvminstances capture get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2PvminstancesCaptureGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 pvminstances capture get params func (o *PcloudV2PvminstancesCaptureGetParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesCaptureGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go index 8e75093f2d..d53cfa0b72 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2PvminstancesCaptureGetReader is a Reader for the PcloudV2PvminstancesCaptureGet structure. @@ -24,37 +23,32 @@ type PcloudV2PvminstancesCaptureGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2PvminstancesCaptureGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2PvminstancesCaptureGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudV2PvminstancesCaptureGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2PvminstancesCaptureGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2PvminstancesCaptureGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudV2PvminstancesCaptureGetOK() *PcloudV2PvminstancesCaptureGetOK { return &PcloudV2PvminstancesCaptureGetOK{} } -/*PcloudV2PvminstancesCaptureGetOK handles this case with default header values. +/* PcloudV2PvminstancesCaptureGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudV2PvminstancesCaptureGetOK struct { func (o *PcloudV2PvminstancesCaptureGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetOK %+v", 200, o.Payload) } +func (o *PcloudV2PvminstancesCaptureGetOK) GetPayload() *models.Job { + return o.Payload +} func (o *PcloudV2PvminstancesCaptureGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudV2PvminstancesCaptureGetUnauthorized() *PcloudV2PvminstancesCaptur return &PcloudV2PvminstancesCaptureGetUnauthorized{} } -/*PcloudV2PvminstancesCaptureGetUnauthorized handles this case with default header values. +/* PcloudV2PvminstancesCaptureGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudV2PvminstancesCaptureGetUnauthorized struct { func (o *PcloudV2PvminstancesCaptureGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2PvminstancesCaptureGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCaptureGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudV2PvminstancesCaptureGetNotFound() *PcloudV2PvminstancesCaptureGet return &PcloudV2PvminstancesCaptureGetNotFound{} } -/*PcloudV2PvminstancesCaptureGetNotFound handles this case with default header values. +/* PcloudV2PvminstancesCaptureGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudV2PvminstancesCaptureGetNotFound struct { func (o *PcloudV2PvminstancesCaptureGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetNotFound %+v", 404, o.Payload) } +func (o *PcloudV2PvminstancesCaptureGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCaptureGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudV2PvminstancesCaptureGetInternalServerError() *PcloudV2Pvminstance return &PcloudV2PvminstancesCaptureGetInternalServerError{} } -/*PcloudV2PvminstancesCaptureGetInternalServerError handles this case with default header values. +/* PcloudV2PvminstancesCaptureGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudV2PvminstancesCaptureGetInternalServerError struct { func (o *PcloudV2PvminstancesCaptureGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2PvminstancesCaptureGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCaptureGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go index 134e6edbfa..2a09a266f5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2PvminstancesCapturePostParams creates a new PcloudV2PvminstancesCapturePostParams object -// with the default values initialized. +// NewPcloudV2PvminstancesCapturePostParams creates a new PcloudV2PvminstancesCapturePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2PvminstancesCapturePostParams() *PcloudV2PvminstancesCapturePostParams { - var () return &PcloudV2PvminstancesCapturePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2PvminstancesCapturePostParamsWithTimeout creates a new PcloudV2PvminstancesCapturePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2PvminstancesCapturePostParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesCapturePostParams { - var () return &PcloudV2PvminstancesCapturePostParams{ - timeout: timeout, } } // NewPcloudV2PvminstancesCapturePostParamsWithContext creates a new PcloudV2PvminstancesCapturePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2PvminstancesCapturePostParamsWithContext(ctx context.Context) *PcloudV2PvminstancesCapturePostParams { - var () return &PcloudV2PvminstancesCapturePostParams{ - Context: ctx, } } // NewPcloudV2PvminstancesCapturePostParamsWithHTTPClient creates a new PcloudV2PvminstancesCapturePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2PvminstancesCapturePostParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesCapturePostParams { - var () return &PcloudV2PvminstancesCapturePostParams{ HTTPClient: client, } } -/*PcloudV2PvminstancesCapturePostParams contains all the parameters to send to the API endpoint -for the pcloud v2 pvminstances capture post operation typically these are written to a http.Request +/* PcloudV2PvminstancesCapturePostParams contains all the parameters to send to the API endpoint + for the pcloud v2 pvminstances capture post operation. + + Typically these are written to a http.Request. */ type PcloudV2PvminstancesCapturePostParams struct { - /*Body - Parameters for the capture + /* Body. + Parameters for the capture */ Body *models.PVMInstanceCapture - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudV2PvminstancesCapturePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 pvminstances capture post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2PvminstancesCapturePostParams) WithDefaults() *PcloudV2PvminstancesCapturePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 pvminstances capture post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2PvminstancesCapturePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 pvminstances capture post params func (o *PcloudV2PvminstancesCapturePostParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesCapturePostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudV2PvminstancesCapturePostParams) WriteToRequest(r runtime.ClientR return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go index 88b23e384b..787b81faa3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2PvminstancesCapturePostReader is a Reader for the PcloudV2PvminstancesCapturePost structure. @@ -24,58 +23,50 @@ type PcloudV2PvminstancesCapturePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2PvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2PvminstancesCapturePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2PvminstancesCapturePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2PvminstancesCapturePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2PvminstancesCapturePostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudV2PvminstancesCapturePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudV2PvminstancesCapturePostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2PvminstancesCapturePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudV2PvminstancesCapturePostAccepted() *PcloudV2PvminstancesCapturePo return &PcloudV2PvminstancesCapturePostAccepted{} } -/*PcloudV2PvminstancesCapturePostAccepted handles this case with default header values. +/* PcloudV2PvminstancesCapturePostAccepted describes a response with status code 202, with default header values. Accepted, pvm-instance capture successfully added to the jobs queue */ @@ -95,6 +86,9 @@ type PcloudV2PvminstancesCapturePostAccepted struct { func (o *PcloudV2PvminstancesCapturePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudV2PvminstancesCapturePostBadRequest() *PcloudV2PvminstancesCapture return &PcloudV2PvminstancesCapturePostBadRequest{} } -/*PcloudV2PvminstancesCapturePostBadRequest handles this case with default header values. +/* PcloudV2PvminstancesCapturePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudV2PvminstancesCapturePostBadRequest struct { func (o *PcloudV2PvminstancesCapturePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudV2PvminstancesCapturePostUnauthorized() *PcloudV2PvminstancesCaptu return &PcloudV2PvminstancesCapturePostUnauthorized{} } -/*PcloudV2PvminstancesCapturePostUnauthorized handles this case with default header values. +/* PcloudV2PvminstancesCapturePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudV2PvminstancesCapturePostUnauthorized struct { func (o *PcloudV2PvminstancesCapturePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudV2PvminstancesCapturePostNotFound() *PcloudV2PvminstancesCapturePo return &PcloudV2PvminstancesCapturePostNotFound{} } -/*PcloudV2PvminstancesCapturePostNotFound handles this case with default header values. +/* PcloudV2PvminstancesCapturePostNotFound describes a response with status code 404, with default header values. pvm instance id not found */ @@ -182,6 +182,9 @@ type PcloudV2PvminstancesCapturePostNotFound struct { func (o *PcloudV2PvminstancesCapturePostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudV2PvminstancesCapturePostConflict() *PcloudV2PvminstancesCapturePo return &PcloudV2PvminstancesCapturePostConflict{} } -/*PcloudV2PvminstancesCapturePostConflict handles this case with default header values. +/* PcloudV2PvminstancesCapturePostConflict describes a response with status code 409, with default header values. Conflict, a conflict has prevented adding the pvm-instance capture job */ @@ -211,6 +214,9 @@ type PcloudV2PvminstancesCapturePostConflict struct { func (o *PcloudV2PvminstancesCapturePostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostConflict %+v", 409, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudV2PvminstancesCapturePostUnprocessableEntity() *PcloudV2Pvminstanc return &PcloudV2PvminstancesCapturePostUnprocessableEntity{} } -/*PcloudV2PvminstancesCapturePostUnprocessableEntity handles this case with default header values. +/* PcloudV2PvminstancesCapturePostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudV2PvminstancesCapturePostUnprocessableEntity struct { func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudV2PvminstancesCapturePostInternalServerError() *PcloudV2Pvminstanc return &PcloudV2PvminstancesCapturePostInternalServerError{} } -/*PcloudV2PvminstancesCapturePostInternalServerError handles this case with default header values. +/* PcloudV2PvminstancesCapturePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudV2PvminstancesCapturePostInternalServerError struct { func (o *PcloudV2PvminstancesCapturePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2PvminstancesCapturePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesCapturePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go index 9f71199f0d..85828def89 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go @@ -6,13 +6,14 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud placement groups API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,35 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsDeleteOK, error) + + PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetOK, error) + + PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetallOK, error) + + PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersDeleteOK, error) + + PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersPostOK, error) + + PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsPostOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudPlacementgroupsDelete deletes server placement group + PcloudPlacementgroupsDelete deletes server placement group */ -func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsDeleteOK, error) { +func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPlacementgroupsDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.placementgroups.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}", @@ -45,24 +65,34 @@ func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDelete AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPlacementgroupsDeleteOK), nil - + success, ok := result.(*PcloudPlacementgroupsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPlacementgroupsGet gets server placement group detail + PcloudPlacementgroupsGet gets server placement group detail */ -func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsGetOK, error) { +func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPlacementgroupsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.placementgroups.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}", @@ -74,24 +104,34 @@ func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPlacementgroupsGetOK), nil - + success, ok := result.(*PcloudPlacementgroupsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPlacementgroupsGetall gets all server placement groups + PcloudPlacementgroupsGetall gets all server placement groups */ -func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsGetallOK, error) { +func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPlacementgroupsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.placementgroups.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups", @@ -103,24 +143,34 @@ func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetall AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPlacementgroupsGetallOK), nil - + success, ok := result.(*PcloudPlacementgroupsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPlacementgroupsMembersDelete removes server from placement group + PcloudPlacementgroupsMembersDelete removes server from placement group */ -func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsMembersDeleteOK, error) { +func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPlacementgroupsMembersDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.placementgroups.members.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members", @@ -132,24 +182,34 @@ func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroup AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPlacementgroupsMembersDeleteOK), nil - + success, ok := result.(*PcloudPlacementgroupsMembersDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPlacementgroupsMembersPost adds server to placement group + PcloudPlacementgroupsMembersPost adds server to placement group */ -func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsMembersPostOK, error) { +func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersPostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPlacementgroupsMembersPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.placementgroups.members.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members", @@ -161,24 +221,34 @@ func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsM AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPlacementgroupsMembersPostOK), nil - + success, ok := result.(*PcloudPlacementgroupsMembersPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPlacementgroupsPost creates a new server placement group + PcloudPlacementgroupsPost creates a new server placement group */ -func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPlacementgroupsPostOK, error) { +func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsPostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPlacementgroupsPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.placementgroups.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups", @@ -190,12 +260,23 @@ func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostPara AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPlacementgroupsPostOK), nil - + success, ok := result.(*PcloudPlacementgroupsPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go index e89a5ab0c3..a81176ab48 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPlacementgroupsDeleteParams creates a new PcloudPlacementgroupsDeleteParams object -// with the default values initialized. +// NewPcloudPlacementgroupsDeleteParams creates a new PcloudPlacementgroupsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPlacementgroupsDeleteParams() *PcloudPlacementgroupsDeleteParams { - var () return &PcloudPlacementgroupsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPlacementgroupsDeleteParamsWithTimeout creates a new PcloudPlacementgroupsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPlacementgroupsDeleteParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsDeleteParams { - var () return &PcloudPlacementgroupsDeleteParams{ - timeout: timeout, } } // NewPcloudPlacementgroupsDeleteParamsWithContext creates a new PcloudPlacementgroupsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPlacementgroupsDeleteParamsWithContext(ctx context.Context) *PcloudPlacementgroupsDeleteParams { - var () return &PcloudPlacementgroupsDeleteParams{ - Context: ctx, } } // NewPcloudPlacementgroupsDeleteParamsWithHTTPClient creates a new PcloudPlacementgroupsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPlacementgroupsDeleteParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsDeleteParams { - var () return &PcloudPlacementgroupsDeleteParams{ HTTPClient: client, } } -/*PcloudPlacementgroupsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud placementgroups delete operation typically these are written to a http.Request +/* PcloudPlacementgroupsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud placementgroups delete operation. + + Typically these are written to a http.Request. */ type PcloudPlacementgroupsDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PlacementGroupID - Placement Group ID + /* PlacementGroupID. + + Placement Group ID */ PlacementGroupID string @@ -77,6 +76,21 @@ type PcloudPlacementgroupsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud placementgroups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsDeleteParams) WithDefaults() *PcloudPlacementgroupsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud placementgroups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud placementgroups delete params func (o *PcloudPlacementgroupsDeleteParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go index fac91ef858..7052f60644 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPlacementgroupsDeleteReader is a Reader for the PcloudPlacementgroupsDelete structure. @@ -24,37 +23,32 @@ type PcloudPlacementgroupsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPlacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPlacementgroupsDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPlacementgroupsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPlacementgroupsDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPlacementgroupsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPlacementgroupsDeleteOK() *PcloudPlacementgroupsDeleteOK { return &PcloudPlacementgroupsDeleteOK{} } -/*PcloudPlacementgroupsDeleteOK handles this case with default header values. +/* PcloudPlacementgroupsDeleteOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPlacementgroupsDeleteOK struct { func (o *PcloudPlacementgroupsDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteOK %+v", 200, o.Payload) } +func (o *PcloudPlacementgroupsDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPlacementgroupsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -90,7 +87,7 @@ func NewPcloudPlacementgroupsDeleteBadRequest() *PcloudPlacementgroupsDeleteBadR return &PcloudPlacementgroupsDeleteBadRequest{} } -/*PcloudPlacementgroupsDeleteBadRequest handles this case with default header values. +/* PcloudPlacementgroupsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -101,6 +98,9 @@ type PcloudPlacementgroupsDeleteBadRequest struct { func (o *PcloudPlacementgroupsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudPlacementgroupsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -119,7 +119,7 @@ func NewPcloudPlacementgroupsDeleteNotFound() *PcloudPlacementgroupsDeleteNotFou return &PcloudPlacementgroupsDeleteNotFound{} } -/*PcloudPlacementgroupsDeleteNotFound handles this case with default header values. +/* PcloudPlacementgroupsDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -130,6 +130,9 @@ type PcloudPlacementgroupsDeleteNotFound struct { func (o *PcloudPlacementgroupsDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudPlacementgroupsDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -148,7 +151,7 @@ func NewPcloudPlacementgroupsDeleteInternalServerError() *PcloudPlacementgroupsD return &PcloudPlacementgroupsDeleteInternalServerError{} } -/*PcloudPlacementgroupsDeleteInternalServerError handles this case with default header values. +/* PcloudPlacementgroupsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -159,6 +162,9 @@ type PcloudPlacementgroupsDeleteInternalServerError struct { func (o *PcloudPlacementgroupsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPlacementgroupsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go index d03aeb446d..7c9106fc5c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPlacementgroupsGetParams creates a new PcloudPlacementgroupsGetParams object -// with the default values initialized. +// NewPcloudPlacementgroupsGetParams creates a new PcloudPlacementgroupsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPlacementgroupsGetParams() *PcloudPlacementgroupsGetParams { - var () return &PcloudPlacementgroupsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPlacementgroupsGetParamsWithTimeout creates a new PcloudPlacementgroupsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPlacementgroupsGetParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetParams { - var () return &PcloudPlacementgroupsGetParams{ - timeout: timeout, } } // NewPcloudPlacementgroupsGetParamsWithContext creates a new PcloudPlacementgroupsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPlacementgroupsGetParamsWithContext(ctx context.Context) *PcloudPlacementgroupsGetParams { - var () return &PcloudPlacementgroupsGetParams{ - Context: ctx, } } // NewPcloudPlacementgroupsGetParamsWithHTTPClient creates a new PcloudPlacementgroupsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPlacementgroupsGetParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetParams { - var () return &PcloudPlacementgroupsGetParams{ HTTPClient: client, } } -/*PcloudPlacementgroupsGetParams contains all the parameters to send to the API endpoint -for the pcloud placementgroups get operation typically these are written to a http.Request +/* PcloudPlacementgroupsGetParams contains all the parameters to send to the API endpoint + for the pcloud placementgroups get operation. + + Typically these are written to a http.Request. */ type PcloudPlacementgroupsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PlacementGroupID - Placement Group ID + /* PlacementGroupID. + + Placement Group ID */ PlacementGroupID string @@ -77,6 +76,21 @@ type PcloudPlacementgroupsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud placementgroups get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsGetParams) WithDefaults() *PcloudPlacementgroupsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud placementgroups get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud placementgroups get params func (o *PcloudPlacementgroupsGetParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go index 6b42b7ce1d..8a3a7acf9b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPlacementgroupsGetReader is a Reader for the PcloudPlacementgroupsGet structure. @@ -24,37 +23,32 @@ type PcloudPlacementgroupsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPlacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPlacementgroupsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPlacementgroupsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPlacementgroupsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPlacementgroupsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPlacementgroupsGetOK() *PcloudPlacementgroupsGetOK { return &PcloudPlacementgroupsGetOK{} } -/*PcloudPlacementgroupsGetOK handles this case with default header values. +/* PcloudPlacementgroupsGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPlacementgroupsGetOK struct { func (o *PcloudPlacementgroupsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetOK %+v", 200, o.Payload) } +func (o *PcloudPlacementgroupsGetOK) GetPayload() *models.PlacementGroup { + return o.Payload +} func (o *PcloudPlacementgroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPlacementgroupsGetBadRequest() *PcloudPlacementgroupsGetBadRequest return &PcloudPlacementgroupsGetBadRequest{} } -/*PcloudPlacementgroupsGetBadRequest handles this case with default header values. +/* PcloudPlacementgroupsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudPlacementgroupsGetBadRequest struct { func (o *PcloudPlacementgroupsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudPlacementgroupsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPlacementgroupsGetNotFound() *PcloudPlacementgroupsGetNotFound { return &PcloudPlacementgroupsGetNotFound{} } -/*PcloudPlacementgroupsGetNotFound handles this case with default header values. +/* PcloudPlacementgroupsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudPlacementgroupsGetNotFound struct { func (o *PcloudPlacementgroupsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudPlacementgroupsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPlacementgroupsGetInternalServerError() *PcloudPlacementgroupsGetI return &PcloudPlacementgroupsGetInternalServerError{} } -/*PcloudPlacementgroupsGetInternalServerError handles this case with default header values. +/* PcloudPlacementgroupsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPlacementgroupsGetInternalServerError struct { func (o *PcloudPlacementgroupsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPlacementgroupsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go index 01279c2d2f..07366c2d8b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPlacementgroupsGetallParams creates a new PcloudPlacementgroupsGetallParams object -// with the default values initialized. +// NewPcloudPlacementgroupsGetallParams creates a new PcloudPlacementgroupsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPlacementgroupsGetallParams() *PcloudPlacementgroupsGetallParams { - var () return &PcloudPlacementgroupsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPlacementgroupsGetallParamsWithTimeout creates a new PcloudPlacementgroupsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPlacementgroupsGetallParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetallParams { - var () return &PcloudPlacementgroupsGetallParams{ - timeout: timeout, } } // NewPcloudPlacementgroupsGetallParamsWithContext creates a new PcloudPlacementgroupsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPlacementgroupsGetallParamsWithContext(ctx context.Context) *PcloudPlacementgroupsGetallParams { - var () return &PcloudPlacementgroupsGetallParams{ - Context: ctx, } } // NewPcloudPlacementgroupsGetallParamsWithHTTPClient creates a new PcloudPlacementgroupsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPlacementgroupsGetallParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsGetallParams { - var () return &PcloudPlacementgroupsGetallParams{ HTTPClient: client, } } -/*PcloudPlacementgroupsGetallParams contains all the parameters to send to the API endpoint -for the pcloud placementgroups getall operation typically these are written to a http.Request +/* PcloudPlacementgroupsGetallParams contains all the parameters to send to the API endpoint + for the pcloud placementgroups getall operation. + + Typically these are written to a http.Request. */ type PcloudPlacementgroupsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudPlacementgroupsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud placementgroups getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsGetallParams) WithDefaults() *PcloudPlacementgroupsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud placementgroups getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud placementgroups getall params func (o *PcloudPlacementgroupsGetallParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go index f792a5244d..7263ac5fa8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPlacementgroupsGetallReader is a Reader for the PcloudPlacementgroupsGetall structure. @@ -24,37 +23,32 @@ type PcloudPlacementgroupsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPlacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPlacementgroupsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPlacementgroupsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPlacementgroupsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPlacementgroupsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudPlacementgroupsGetallOK() *PcloudPlacementgroupsGetallOK { return &PcloudPlacementgroupsGetallOK{} } -/*PcloudPlacementgroupsGetallOK handles this case with default header values. +/* PcloudPlacementgroupsGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudPlacementgroupsGetallOK struct { func (o *PcloudPlacementgroupsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallOK %+v", 200, o.Payload) } +func (o *PcloudPlacementgroupsGetallOK) GetPayload() *models.PlacementGroups { + return o.Payload +} func (o *PcloudPlacementgroupsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudPlacementgroupsGetallBadRequest() *PcloudPlacementgroupsGetallBadR return &PcloudPlacementgroupsGetallBadRequest{} } -/*PcloudPlacementgroupsGetallBadRequest handles this case with default header values. +/* PcloudPlacementgroupsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudPlacementgroupsGetallBadRequest struct { func (o *PcloudPlacementgroupsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudPlacementgroupsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudPlacementgroupsGetallUnauthorized() *PcloudPlacementgroupsGetallUn return &PcloudPlacementgroupsGetallUnauthorized{} } -/*PcloudPlacementgroupsGetallUnauthorized handles this case with default header values. +/* PcloudPlacementgroupsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudPlacementgroupsGetallUnauthorized struct { func (o *PcloudPlacementgroupsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPlacementgroupsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudPlacementgroupsGetallInternalServerError() *PcloudPlacementgroupsG return &PcloudPlacementgroupsGetallInternalServerError{} } -/*PcloudPlacementgroupsGetallInternalServerError handles this case with default header values. +/* PcloudPlacementgroupsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudPlacementgroupsGetallInternalServerError struct { func (o *PcloudPlacementgroupsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPlacementgroupsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go index f9422bd761..c860277a23 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPlacementgroupsMembersDeleteParams creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the default values initialized. +// NewPcloudPlacementgroupsMembersDeleteParams creates a new PcloudPlacementgroupsMembersDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPlacementgroupsMembersDeleteParams() *PcloudPlacementgroupsMembersDeleteParams { - var () return &PcloudPlacementgroupsMembersDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPlacementgroupsMembersDeleteParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersDeleteParams { - var () return &PcloudPlacementgroupsMembersDeleteParams{ - timeout: timeout, } } // NewPcloudPlacementgroupsMembersDeleteParamsWithContext creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPlacementgroupsMembersDeleteParamsWithContext(ctx context.Context) *PcloudPlacementgroupsMembersDeleteParams { - var () return &PcloudPlacementgroupsMembersDeleteParams{ - Context: ctx, } } // NewPcloudPlacementgroupsMembersDeleteParamsWithHTTPClient creates a new PcloudPlacementgroupsMembersDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPlacementgroupsMembersDeleteParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersDeleteParams { - var () return &PcloudPlacementgroupsMembersDeleteParams{ HTTPClient: client, } } -/*PcloudPlacementgroupsMembersDeleteParams contains all the parameters to send to the API endpoint -for the pcloud placementgroups members delete operation typically these are written to a http.Request +/* PcloudPlacementgroupsMembersDeleteParams contains all the parameters to send to the API endpoint + for the pcloud placementgroups members delete operation. + + Typically these are written to a http.Request. */ type PcloudPlacementgroupsMembersDeleteParams struct { - /*Body - Parameters for removing a Server in a Placement Group + /* Body. + Parameters for removing a Server in a Placement Group */ Body *models.PlacementGroupServer - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PlacementGroupID - Placement Group ID + /* PlacementGroupID. + + Placement Group ID */ PlacementGroupID string @@ -84,6 +84,21 @@ type PcloudPlacementgroupsMembersDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud placementgroups members delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsMembersDeleteParams) WithDefaults() *PcloudPlacementgroupsMembersDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud placementgroups members delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsMembersDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud placementgroups members delete params func (o *PcloudPlacementgroupsMembersDeleteParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersDeleteParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPlacementgroupsMembersDeleteParams) WriteToRequest(r runtime.Clie return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go index 8c3dde34a7..513178760f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPlacementgroupsMembersDeleteReader is a Reader for the PcloudPlacementgroupsMembersDelete structure. @@ -24,44 +23,44 @@ type PcloudPlacementgroupsMembersDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPlacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPlacementgroupsMembersDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPlacementgroupsMembersDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - + case 404: + result := NewPcloudPlacementgroupsMembersDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 409: result := NewPcloudPlacementgroupsMembersDeleteConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPlacementgroupsMembersDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +69,7 @@ func NewPcloudPlacementgroupsMembersDeleteOK() *PcloudPlacementgroupsMembersDele return &PcloudPlacementgroupsMembersDeleteOK{} } -/*PcloudPlacementgroupsMembersDeleteOK handles this case with default header values. +/* PcloudPlacementgroupsMembersDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +80,9 @@ type PcloudPlacementgroupsMembersDeleteOK struct { func (o *PcloudPlacementgroupsMembersDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteOK %+v", 200, o.Payload) } +func (o *PcloudPlacementgroupsMembersDeleteOK) GetPayload() *models.PlacementGroup { + return o.Payload +} func (o *PcloudPlacementgroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +101,7 @@ func NewPcloudPlacementgroupsMembersDeleteBadRequest() *PcloudPlacementgroupsMem return &PcloudPlacementgroupsMembersDeleteBadRequest{} } -/*PcloudPlacementgroupsMembersDeleteBadRequest handles this case with default header values. +/* PcloudPlacementgroupsMembersDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +112,9 @@ type PcloudPlacementgroupsMembersDeleteBadRequest struct { func (o *PcloudPlacementgroupsMembersDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudPlacementgroupsMembersDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -123,12 +128,44 @@ func (o *PcloudPlacementgroupsMembersDeleteBadRequest) readResponse(response run return nil } +// NewPcloudPlacementgroupsMembersDeleteNotFound creates a PcloudPlacementgroupsMembersDeleteNotFound with default headers values +func NewPcloudPlacementgroupsMembersDeleteNotFound() *PcloudPlacementgroupsMembersDeleteNotFound { + return &PcloudPlacementgroupsMembersDeleteNotFound{} +} + +/* PcloudPlacementgroupsMembersDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudPlacementgroupsMembersDeleteNotFound struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersDeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteNotFound %+v", 404, o.Payload) +} +func (o *PcloudPlacementgroupsMembersDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPlacementgroupsMembersDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPlacementgroupsMembersDeleteConflict creates a PcloudPlacementgroupsMembersDeleteConflict with default headers values func NewPcloudPlacementgroupsMembersDeleteConflict() *PcloudPlacementgroupsMembersDeleteConflict { return &PcloudPlacementgroupsMembersDeleteConflict{} } -/*PcloudPlacementgroupsMembersDeleteConflict handles this case with default header values. +/* PcloudPlacementgroupsMembersDeleteConflict describes a response with status code 409, with default header values. Conflict */ @@ -139,6 +176,9 @@ type PcloudPlacementgroupsMembersDeleteConflict struct { func (o *PcloudPlacementgroupsMembersDeleteConflict) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteConflict %+v", 409, o.Payload) } +func (o *PcloudPlacementgroupsMembersDeleteConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +197,7 @@ func NewPcloudPlacementgroupsMembersDeleteUnprocessableEntity() *PcloudPlacement return &PcloudPlacementgroupsMembersDeleteUnprocessableEntity{} } -/*PcloudPlacementgroupsMembersDeleteUnprocessableEntity handles this case with default header values. +/* PcloudPlacementgroupsMembersDeleteUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +208,9 @@ type PcloudPlacementgroupsMembersDeleteUnprocessableEntity struct { func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +229,7 @@ func NewPcloudPlacementgroupsMembersDeleteInternalServerError() *PcloudPlacement return &PcloudPlacementgroupsMembersDeleteInternalServerError{} } -/*PcloudPlacementgroupsMembersDeleteInternalServerError handles this case with default header values. +/* PcloudPlacementgroupsMembersDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +240,9 @@ type PcloudPlacementgroupsMembersDeleteInternalServerError struct { func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go index 05d85b1aa3..8f9106c183 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPlacementgroupsMembersPostParams creates a new PcloudPlacementgroupsMembersPostParams object -// with the default values initialized. +// NewPcloudPlacementgroupsMembersPostParams creates a new PcloudPlacementgroupsMembersPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPlacementgroupsMembersPostParams() *PcloudPlacementgroupsMembersPostParams { - var () return &PcloudPlacementgroupsMembersPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPlacementgroupsMembersPostParamsWithTimeout creates a new PcloudPlacementgroupsMembersPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPlacementgroupsMembersPostParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersPostParams { - var () return &PcloudPlacementgroupsMembersPostParams{ - timeout: timeout, } } // NewPcloudPlacementgroupsMembersPostParamsWithContext creates a new PcloudPlacementgroupsMembersPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPlacementgroupsMembersPostParamsWithContext(ctx context.Context) *PcloudPlacementgroupsMembersPostParams { - var () return &PcloudPlacementgroupsMembersPostParams{ - Context: ctx, } } // NewPcloudPlacementgroupsMembersPostParamsWithHTTPClient creates a new PcloudPlacementgroupsMembersPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPlacementgroupsMembersPostParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsMembersPostParams { - var () return &PcloudPlacementgroupsMembersPostParams{ HTTPClient: client, } } -/*PcloudPlacementgroupsMembersPostParams contains all the parameters to send to the API endpoint -for the pcloud placementgroups members post operation typically these are written to a http.Request +/* PcloudPlacementgroupsMembersPostParams contains all the parameters to send to the API endpoint + for the pcloud placementgroups members post operation. + + Typically these are written to a http.Request. */ type PcloudPlacementgroupsMembersPostParams struct { - /*Body - Parameters for adding a server to a Server Placement Group + /* Body. + Parameters for adding a server to a Server Placement Group */ Body *models.PlacementGroupServer - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PlacementGroupID - Placement Group ID + /* PlacementGroupID. + + Placement Group ID */ PlacementGroupID string @@ -84,6 +84,21 @@ type PcloudPlacementgroupsMembersPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud placementgroups members post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsMembersPostParams) WithDefaults() *PcloudPlacementgroupsMembersPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud placementgroups members post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsMembersPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud placementgroups members post params func (o *PcloudPlacementgroupsMembersPostParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsMembersPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudPlacementgroupsMembersPostParams) WriteToRequest(r runtime.Client return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go index fce6e411da..c7d53f939b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPlacementgroupsMembersPostReader is a Reader for the PcloudPlacementgroupsMembersPost structure. @@ -24,44 +23,44 @@ type PcloudPlacementgroupsMembersPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPlacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPlacementgroupsMembersPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPlacementgroupsMembersPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - + case 404: + result := NewPcloudPlacementgroupsMembersPostNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 409: result := NewPcloudPlacementgroupsMembersPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPlacementgroupsMembersPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPlacementgroupsMembersPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +69,7 @@ func NewPcloudPlacementgroupsMembersPostOK() *PcloudPlacementgroupsMembersPostOK return &PcloudPlacementgroupsMembersPostOK{} } -/*PcloudPlacementgroupsMembersPostOK handles this case with default header values. +/* PcloudPlacementgroupsMembersPostOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +80,9 @@ type PcloudPlacementgroupsMembersPostOK struct { func (o *PcloudPlacementgroupsMembersPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostOK %+v", 200, o.Payload) } +func (o *PcloudPlacementgroupsMembersPostOK) GetPayload() *models.PlacementGroup { + return o.Payload +} func (o *PcloudPlacementgroupsMembersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +101,7 @@ func NewPcloudPlacementgroupsMembersPostBadRequest() *PcloudPlacementgroupsMembe return &PcloudPlacementgroupsMembersPostBadRequest{} } -/*PcloudPlacementgroupsMembersPostBadRequest handles this case with default header values. +/* PcloudPlacementgroupsMembersPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +112,9 @@ type PcloudPlacementgroupsMembersPostBadRequest struct { func (o *PcloudPlacementgroupsMembersPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPlacementgroupsMembersPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -123,12 +128,44 @@ func (o *PcloudPlacementgroupsMembersPostBadRequest) readResponse(response runti return nil } +// NewPcloudPlacementgroupsMembersPostNotFound creates a PcloudPlacementgroupsMembersPostNotFound with default headers values +func NewPcloudPlacementgroupsMembersPostNotFound() *PcloudPlacementgroupsMembersPostNotFound { + return &PcloudPlacementgroupsMembersPostNotFound{} +} + +/* PcloudPlacementgroupsMembersPostNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudPlacementgroupsMembersPostNotFound struct { + Payload *models.Error +} + +func (o *PcloudPlacementgroupsMembersPostNotFound) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostNotFound %+v", 404, o.Payload) +} +func (o *PcloudPlacementgroupsMembersPostNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPlacementgroupsMembersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudPlacementgroupsMembersPostConflict creates a PcloudPlacementgroupsMembersPostConflict with default headers values func NewPcloudPlacementgroupsMembersPostConflict() *PcloudPlacementgroupsMembersPostConflict { return &PcloudPlacementgroupsMembersPostConflict{} } -/*PcloudPlacementgroupsMembersPostConflict handles this case with default header values. +/* PcloudPlacementgroupsMembersPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -139,6 +176,9 @@ type PcloudPlacementgroupsMembersPostConflict struct { func (o *PcloudPlacementgroupsMembersPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostConflict %+v", 409, o.Payload) } +func (o *PcloudPlacementgroupsMembersPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +197,7 @@ func NewPcloudPlacementgroupsMembersPostUnprocessableEntity() *PcloudPlacementgr return &PcloudPlacementgroupsMembersPostUnprocessableEntity{} } -/*PcloudPlacementgroupsMembersPostUnprocessableEntity handles this case with default header values. +/* PcloudPlacementgroupsMembersPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +208,9 @@ type PcloudPlacementgroupsMembersPostUnprocessableEntity struct { func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +229,7 @@ func NewPcloudPlacementgroupsMembersPostInternalServerError() *PcloudPlacementgr return &PcloudPlacementgroupsMembersPostInternalServerError{} } -/*PcloudPlacementgroupsMembersPostInternalServerError handles this case with default header values. +/* PcloudPlacementgroupsMembersPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +240,9 @@ type PcloudPlacementgroupsMembersPostInternalServerError struct { func (o *PcloudPlacementgroupsMembersPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPlacementgroupsMembersPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsMembersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go index edb2124762..2bb2348af3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPlacementgroupsPostParams creates a new PcloudPlacementgroupsPostParams object -// with the default values initialized. +// NewPcloudPlacementgroupsPostParams creates a new PcloudPlacementgroupsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPlacementgroupsPostParams() *PcloudPlacementgroupsPostParams { - var () return &PcloudPlacementgroupsPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPlacementgroupsPostParamsWithTimeout creates a new PcloudPlacementgroupsPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPlacementgroupsPostParamsWithTimeout(timeout time.Duration) *PcloudPlacementgroupsPostParams { - var () return &PcloudPlacementgroupsPostParams{ - timeout: timeout, } } // NewPcloudPlacementgroupsPostParamsWithContext creates a new PcloudPlacementgroupsPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPlacementgroupsPostParamsWithContext(ctx context.Context) *PcloudPlacementgroupsPostParams { - var () return &PcloudPlacementgroupsPostParams{ - Context: ctx, } } // NewPcloudPlacementgroupsPostParamsWithHTTPClient creates a new PcloudPlacementgroupsPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPlacementgroupsPostParamsWithHTTPClient(client *http.Client) *PcloudPlacementgroupsPostParams { - var () return &PcloudPlacementgroupsPostParams{ HTTPClient: client, } } -/*PcloudPlacementgroupsPostParams contains all the parameters to send to the API endpoint -for the pcloud placementgroups post operation typically these are written to a http.Request +/* PcloudPlacementgroupsPostParams contains all the parameters to send to the API endpoint + for the pcloud placementgroups post operation. + + Typically these are written to a http.Request. */ type PcloudPlacementgroupsPostParams struct { - /*Body - Parameters for the creation of a new Server Placement Group + /* Body. + Parameters for the creation of a new Server Placement Group */ Body *models.PlacementGroupCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudPlacementgroupsPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud placementgroups post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsPostParams) WithDefaults() *PcloudPlacementgroupsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud placementgroups post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPlacementgroupsPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud placementgroups post params func (o *PcloudPlacementgroupsPostParams) WithTimeout(timeout time.Duration) *PcloudPlacementgroupsPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudPlacementgroupsPostParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go index ff49f94d28..448359f199 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPlacementgroupsPostReader is a Reader for the PcloudPlacementgroupsPost structure. @@ -24,44 +23,38 @@ type PcloudPlacementgroupsPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPlacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPlacementgroupsPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPlacementgroupsPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPlacementgroupsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudPlacementgroupsPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPlacementgroupsPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPlacementgroupsPostOK() *PcloudPlacementgroupsPostOK { return &PcloudPlacementgroupsPostOK{} } -/*PcloudPlacementgroupsPostOK handles this case with default header values. +/* PcloudPlacementgroupsPostOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPlacementgroupsPostOK struct { func (o *PcloudPlacementgroupsPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostOK %+v", 200, o.Payload) } +func (o *PcloudPlacementgroupsPostOK) GetPayload() *models.PlacementGroup { + return o.Payload +} func (o *PcloudPlacementgroupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPlacementgroupsPostBadRequest() *PcloudPlacementgroupsPostBadReque return &PcloudPlacementgroupsPostBadRequest{} } -/*PcloudPlacementgroupsPostBadRequest handles this case with default header values. +/* PcloudPlacementgroupsPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPlacementgroupsPostBadRequest struct { func (o *PcloudPlacementgroupsPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPlacementgroupsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPlacementgroupsPostConflict() *PcloudPlacementgroupsPostConflict { return &PcloudPlacementgroupsPostConflict{} } -/*PcloudPlacementgroupsPostConflict handles this case with default header values. +/* PcloudPlacementgroupsPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -139,6 +138,9 @@ type PcloudPlacementgroupsPostConflict struct { func (o *PcloudPlacementgroupsPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostConflict %+v", 409, o.Payload) } +func (o *PcloudPlacementgroupsPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPlacementgroupsPostUnprocessableEntity() *PcloudPlacementgroupsPos return &PcloudPlacementgroupsPostUnprocessableEntity{} } -/*PcloudPlacementgroupsPostUnprocessableEntity handles this case with default header values. +/* PcloudPlacementgroupsPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudPlacementgroupsPostUnprocessableEntity struct { func (o *PcloudPlacementgroupsPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudPlacementgroupsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPlacementgroupsPostInternalServerError() *PcloudPlacementgroupsPos return &PcloudPlacementgroupsPostInternalServerError{} } -/*PcloudPlacementgroupsPostInternalServerError handles this case with default header values. +/* PcloudPlacementgroupsPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPlacementgroupsPostInternalServerError struct { func (o *PcloudPlacementgroupsPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPlacementgroupsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPlacementgroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloud_s_a_p_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloud_s_a_p_client.go deleted file mode 100644 index a6a75e1440..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloud_s_a_p_client.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_s_a_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud s a p API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for p cloud s a p API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -PcloudSapGet gets the information on an s a p profile -*/ -func (a *Client) PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudSapGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSapGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.sap.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSapGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudSapGetOK), nil - -} - -/* -PcloudSapGetall gets list of s a p profiles -*/ -func (a *Client) PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudSapGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSapGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.sap.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSapGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudSapGetallOK), nil - -} - -/* -PcloudSapPost creates a new s a p p VM instance -*/ -func (a *Client) PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudSapPostOK, *PcloudSapPostCreated, *PcloudSapPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSapPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.sap.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSapPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, nil, nil, err - } - switch value := result.(type) { - case *PcloudSapPostOK: - return value, nil, nil, nil - case *PcloudSapPostCreated: - return nil, value, nil, nil - case *PcloudSapPostAccepted: - return nil, nil, value, nil - } - return nil, nil, nil, nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go new file mode 100644 index 0000000000..0504c37c91 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_s_a_p + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud s a p API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud s a p API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetOK, error) + + PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetallOK, error) + + PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapPostOK, *PcloudSapPostCreated, *PcloudSapPostAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PcloudSapGet gets the information on an s a p profile +*/ +func (a *Client) PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudSapGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.sap.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudSapGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudSapGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.sap.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudSapGetall gets list of s a p profiles +*/ +func (a *Client) PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudSapGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.sap.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudSapGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudSapGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.sap.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudSapPost creates a new s a p p VM instance +*/ +func (a *Client) PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapPostOK, *PcloudSapPostCreated, *PcloudSapPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudSapPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.sap.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/sap", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudSapPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, nil, err + } + switch value := result.(type) { + case *PcloudSapPostOK: + return value, nil, nil, nil + case *PcloudSapPostCreated: + return nil, value, nil, nil + case *PcloudSapPostAccepted: + return nil, nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_s_a_p: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go index 72ed1f2255..76081ddb14 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudSapGetParams creates a new PcloudSapGetParams object -// with the default values initialized. +// NewPcloudSapGetParams creates a new PcloudSapGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudSapGetParams() *PcloudSapGetParams { - var () return &PcloudSapGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudSapGetParamsWithTimeout creates a new PcloudSapGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudSapGetParamsWithTimeout(timeout time.Duration) *PcloudSapGetParams { - var () return &PcloudSapGetParams{ - timeout: timeout, } } // NewPcloudSapGetParamsWithContext creates a new PcloudSapGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudSapGetParamsWithContext(ctx context.Context) *PcloudSapGetParams { - var () return &PcloudSapGetParams{ - Context: ctx, } } // NewPcloudSapGetParamsWithHTTPClient creates a new PcloudSapGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudSapGetParamsWithHTTPClient(client *http.Client) *PcloudSapGetParams { - var () return &PcloudSapGetParams{ HTTPClient: client, } } -/*PcloudSapGetParams contains all the parameters to send to the API endpoint -for the pcloud sap get operation typically these are written to a http.Request +/* PcloudSapGetParams contains all the parameters to send to the API endpoint + for the pcloud sap get operation. + + Typically these are written to a http.Request. */ type PcloudSapGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*SapProfileID - SAP Profile ID + /* SapProfileID. + + SAP Profile ID */ SapProfileID string @@ -77,6 +76,21 @@ type PcloudSapGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud sap get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSapGetParams) WithDefaults() *PcloudSapGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud sap get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSapGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud sap get params func (o *PcloudSapGetParams) WithTimeout(timeout time.Duration) *PcloudSapGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go index b8215456ed..395448fd44 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudSapGetReader is a Reader for the PcloudSapGet structure. @@ -24,44 +23,38 @@ type PcloudSapGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudSapGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudSapGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudSapGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudSapGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudSapGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudSapGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudSapGetOK() *PcloudSapGetOK { return &PcloudSapGetOK{} } -/*PcloudSapGetOK handles this case with default header values. +/* PcloudSapGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudSapGetOK struct { func (o *PcloudSapGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetOK %+v", 200, o.Payload) } +func (o *PcloudSapGetOK) GetPayload() *models.SAPProfile { + return o.Payload +} func (o *PcloudSapGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudSapGetBadRequest() *PcloudSapGetBadRequest { return &PcloudSapGetBadRequest{} } -/*PcloudSapGetBadRequest handles this case with default header values. +/* PcloudSapGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudSapGetBadRequest struct { func (o *PcloudSapGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudSapGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudSapGetUnauthorized() *PcloudSapGetUnauthorized { return &PcloudSapGetUnauthorized{} } -/*PcloudSapGetUnauthorized handles this case with default header values. +/* PcloudSapGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudSapGetUnauthorized struct { func (o *PcloudSapGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudSapGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudSapGetNotFound() *PcloudSapGetNotFound { return &PcloudSapGetNotFound{} } -/*PcloudSapGetNotFound handles this case with default header values. +/* PcloudSapGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudSapGetNotFound struct { func (o *PcloudSapGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetNotFound %+v", 404, o.Payload) } +func (o *PcloudSapGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudSapGetInternalServerError() *PcloudSapGetInternalServerError { return &PcloudSapGetInternalServerError{} } -/*PcloudSapGetInternalServerError handles this case with default header values. +/* PcloudSapGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudSapGetInternalServerError struct { func (o *PcloudSapGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudSapGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go index f68f39dd0e..725a1afc58 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudSapGetallParams creates a new PcloudSapGetallParams object -// with the default values initialized. +// NewPcloudSapGetallParams creates a new PcloudSapGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudSapGetallParams() *PcloudSapGetallParams { - var () return &PcloudSapGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudSapGetallParamsWithTimeout creates a new PcloudSapGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudSapGetallParamsWithTimeout(timeout time.Duration) *PcloudSapGetallParams { - var () return &PcloudSapGetallParams{ - timeout: timeout, } } // NewPcloudSapGetallParamsWithContext creates a new PcloudSapGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudSapGetallParamsWithContext(ctx context.Context) *PcloudSapGetallParams { - var () return &PcloudSapGetallParams{ - Context: ctx, } } // NewPcloudSapGetallParamsWithHTTPClient creates a new PcloudSapGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudSapGetallParamsWithHTTPClient(client *http.Client) *PcloudSapGetallParams { - var () return &PcloudSapGetallParams{ HTTPClient: client, } } -/*PcloudSapGetallParams contains all the parameters to send to the API endpoint -for the pcloud sap getall operation typically these are written to a http.Request +/* PcloudSapGetallParams contains all the parameters to send to the API endpoint + for the pcloud sap getall operation. + + Typically these are written to a http.Request. */ type PcloudSapGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudSapGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud sap getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSapGetallParams) WithDefaults() *PcloudSapGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud sap getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSapGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud sap getall params func (o *PcloudSapGetallParams) WithTimeout(timeout time.Duration) *PcloudSapGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go index f2c277b3f1..97b35e04c1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudSapGetallReader is a Reader for the PcloudSapGetall structure. @@ -24,37 +23,32 @@ type PcloudSapGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudSapGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudSapGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudSapGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudSapGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudSapGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudSapGetallOK() *PcloudSapGetallOK { return &PcloudSapGetallOK{} } -/*PcloudSapGetallOK handles this case with default header values. +/* PcloudSapGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudSapGetallOK struct { func (o *PcloudSapGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallOK %+v", 200, o.Payload) } +func (o *PcloudSapGetallOK) GetPayload() *models.SAPProfiles { + return o.Payload +} func (o *PcloudSapGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudSapGetallBadRequest() *PcloudSapGetallBadRequest { return &PcloudSapGetallBadRequest{} } -/*PcloudSapGetallBadRequest handles this case with default header values. +/* PcloudSapGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudSapGetallBadRequest struct { func (o *PcloudSapGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudSapGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudSapGetallUnauthorized() *PcloudSapGetallUnauthorized { return &PcloudSapGetallUnauthorized{} } -/*PcloudSapGetallUnauthorized handles this case with default header values. +/* PcloudSapGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudSapGetallUnauthorized struct { func (o *PcloudSapGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudSapGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudSapGetallInternalServerError() *PcloudSapGetallInternalServerError return &PcloudSapGetallInternalServerError{} } -/*PcloudSapGetallInternalServerError handles this case with default header values. +/* PcloudSapGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudSapGetallInternalServerError struct { func (o *PcloudSapGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudSapGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go index 91eea91488..1b8ad094aa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudSapPostParams creates a new PcloudSapPostParams object -// with the default values initialized. +// NewPcloudSapPostParams creates a new PcloudSapPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudSapPostParams() *PcloudSapPostParams { - var () return &PcloudSapPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudSapPostParamsWithTimeout creates a new PcloudSapPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudSapPostParamsWithTimeout(timeout time.Duration) *PcloudSapPostParams { - var () return &PcloudSapPostParams{ - timeout: timeout, } } // NewPcloudSapPostParamsWithContext creates a new PcloudSapPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudSapPostParamsWithContext(ctx context.Context) *PcloudSapPostParams { - var () return &PcloudSapPostParams{ - Context: ctx, } } // NewPcloudSapPostParamsWithHTTPClient creates a new PcloudSapPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudSapPostParamsWithHTTPClient(client *http.Client) *PcloudSapPostParams { - var () return &PcloudSapPostParams{ HTTPClient: client, } } -/*PcloudSapPostParams contains all the parameters to send to the API endpoint -for the pcloud sap post operation typically these are written to a http.Request +/* PcloudSapPostParams contains all the parameters to send to the API endpoint + for the pcloud sap post operation. + + Typically these are written to a http.Request. */ type PcloudSapPostParams struct { - /*Body - Parameters for the creation of a new SAP PVM Instance + /* Body. + Parameters for the creation of a new SAP PVM Instance */ Body *models.SAPCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudSapPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud sap post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSapPostParams) WithDefaults() *PcloudSapPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud sap post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSapPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud sap post params func (o *PcloudSapPostParams) WithTimeout(timeout time.Duration) *PcloudSapPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudSapPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go index 559beea2b3..802291ee21 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudSapPostReader is a Reader for the PcloudSapPost structure. @@ -24,65 +23,56 @@ type PcloudSapPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudSapPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudSapPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewPcloudSapPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewPcloudSapPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudSapPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudSapPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudSapPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudSapPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudSapPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -91,7 +81,7 @@ func NewPcloudSapPostOK() *PcloudSapPostOK { return &PcloudSapPostOK{} } -/*PcloudSapPostOK handles this case with default header values. +/* PcloudSapPostOK describes a response with status code 200, with default header values. OK */ @@ -102,6 +92,9 @@ type PcloudSapPostOK struct { func (o *PcloudSapPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostOK %+v", 200, o.Payload) } +func (o *PcloudSapPostOK) GetPayload() models.PVMInstanceList { + return o.Payload +} func (o *PcloudSapPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -118,7 +111,7 @@ func NewPcloudSapPostCreated() *PcloudSapPostCreated { return &PcloudSapPostCreated{} } -/*PcloudSapPostCreated handles this case with default header values. +/* PcloudSapPostCreated describes a response with status code 201, with default header values. Created */ @@ -129,6 +122,9 @@ type PcloudSapPostCreated struct { func (o *PcloudSapPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostCreated %+v", 201, o.Payload) } +func (o *PcloudSapPostCreated) GetPayload() models.PVMInstanceList { + return o.Payload +} func (o *PcloudSapPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -145,7 +141,7 @@ func NewPcloudSapPostAccepted() *PcloudSapPostAccepted { return &PcloudSapPostAccepted{} } -/*PcloudSapPostAccepted handles this case with default header values. +/* PcloudSapPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -156,6 +152,9 @@ type PcloudSapPostAccepted struct { func (o *PcloudSapPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostAccepted %+v", 202, o.Payload) } +func (o *PcloudSapPostAccepted) GetPayload() models.PVMInstanceList { + return o.Payload +} func (o *PcloudSapPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -172,7 +171,7 @@ func NewPcloudSapPostBadRequest() *PcloudSapPostBadRequest { return &PcloudSapPostBadRequest{} } -/*PcloudSapPostBadRequest handles this case with default header values. +/* PcloudSapPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -183,6 +182,9 @@ type PcloudSapPostBadRequest struct { func (o *PcloudSapPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudSapPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -201,7 +203,7 @@ func NewPcloudSapPostUnauthorized() *PcloudSapPostUnauthorized { return &PcloudSapPostUnauthorized{} } -/*PcloudSapPostUnauthorized handles this case with default header values. +/* PcloudSapPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -212,6 +214,9 @@ type PcloudSapPostUnauthorized struct { func (o *PcloudSapPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudSapPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -230,7 +235,7 @@ func NewPcloudSapPostConflict() *PcloudSapPostConflict { return &PcloudSapPostConflict{} } -/*PcloudSapPostConflict handles this case with default header values. +/* PcloudSapPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -241,6 +246,9 @@ type PcloudSapPostConflict struct { func (o *PcloudSapPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostConflict %+v", 409, o.Payload) } +func (o *PcloudSapPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -259,7 +267,7 @@ func NewPcloudSapPostUnprocessableEntity() *PcloudSapPostUnprocessableEntity { return &PcloudSapPostUnprocessableEntity{} } -/*PcloudSapPostUnprocessableEntity handles this case with default header values. +/* PcloudSapPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -270,6 +278,9 @@ type PcloudSapPostUnprocessableEntity struct { func (o *PcloudSapPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudSapPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -288,7 +299,7 @@ func NewPcloudSapPostInternalServerError() *PcloudSapPostInternalServerError { return &PcloudSapPostInternalServerError{} } -/*PcloudSapPostInternalServerError handles this case with default header values. +/* PcloudSapPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -299,6 +310,9 @@ type PcloudSapPostInternalServerError struct { func (o *PcloudSapPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudSapPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSapPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_service_d_h_c_p_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_service_d_h_c_p_client.go deleted file mode 100644 index 6d94f0f8c3..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_service_d_h_c_p_client.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_service_d_h_c_p - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud service d h c p API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for p cloud service d h c p API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -PcloudDhcpDelete deletes d h c p server open shift internal use only -*/ -func (a *Client) PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudDhcpDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.dhcp.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudDhcpDeleteAccepted), nil - -} - -/* -PcloudDhcpGet gets d h c p server information open shift internal use only -*/ -func (a *Client) PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudDhcpGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.dhcp.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudDhcpGetOK), nil - -} - -/* -PcloudDhcpGetall gets all d h c p servers information open shift internal use only -*/ -func (a *Client) PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudDhcpGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.dhcp.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudDhcpGetallOK), nil - -} - -/* -PcloudDhcpPost creates a d h c p server open shift internal use only -*/ -func (a *Client) PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudDhcpPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudDhcpPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.dhcp.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudDhcpPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudDhcpPostAccepted), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go new file mode 100644 index 0000000000..ddf143b6cf --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go @@ -0,0 +1,203 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_service_d_h_c_p + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud service d h c p API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud service d h c p API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpDeleteAccepted, error) + + PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetOK, error) + + PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetallOK, error) + + PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpPostAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PcloudDhcpDelete deletes d h c p server open shift internal use only +*/ +func (a *Client) PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpDeleteAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudDhcpDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.dhcp.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudDhcpDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudDhcpDeleteAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudDhcpGet gets d h c p server information open shift internal use only +*/ +func (a *Client) PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudDhcpGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.dhcp.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudDhcpGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudDhcpGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudDhcpGetall gets all d h c p servers information open shift internal use only +*/ +func (a *Client) PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudDhcpGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.dhcp.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudDhcpGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudDhcpGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudDhcpPost creates a d h c p server open shift internal use only +*/ +func (a *Client) PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudDhcpPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.dhcp.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudDhcpPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudDhcpPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go index cfd3fc6112..3869c75667 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudDhcpDeleteParams creates a new PcloudDhcpDeleteParams object -// with the default values initialized. +// NewPcloudDhcpDeleteParams creates a new PcloudDhcpDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudDhcpDeleteParams() *PcloudDhcpDeleteParams { - var () return &PcloudDhcpDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudDhcpDeleteParamsWithTimeout creates a new PcloudDhcpDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudDhcpDeleteParamsWithTimeout(timeout time.Duration) *PcloudDhcpDeleteParams { - var () return &PcloudDhcpDeleteParams{ - timeout: timeout, } } // NewPcloudDhcpDeleteParamsWithContext creates a new PcloudDhcpDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudDhcpDeleteParamsWithContext(ctx context.Context) *PcloudDhcpDeleteParams { - var () return &PcloudDhcpDeleteParams{ - Context: ctx, } } // NewPcloudDhcpDeleteParamsWithHTTPClient creates a new PcloudDhcpDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudDhcpDeleteParamsWithHTTPClient(client *http.Client) *PcloudDhcpDeleteParams { - var () return &PcloudDhcpDeleteParams{ HTTPClient: client, } } -/*PcloudDhcpDeleteParams contains all the parameters to send to the API endpoint -for the pcloud dhcp delete operation typically these are written to a http.Request +/* PcloudDhcpDeleteParams contains all the parameters to send to the API endpoint + for the pcloud dhcp delete operation. + + Typically these are written to a http.Request. */ type PcloudDhcpDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*DhcpID - The ID of the DHCP Server + /* DhcpID. + + The ID of the DHCP Server */ DhcpID string @@ -77,6 +76,21 @@ type PcloudDhcpDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud dhcp delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpDeleteParams) WithDefaults() *PcloudDhcpDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud dhcp delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud dhcp delete params func (o *PcloudDhcpDeleteParams) WithTimeout(timeout time.Duration) *PcloudDhcpDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go index b49dd1dd38..f108dadaa2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudDhcpDeleteReader is a Reader for the PcloudDhcpDelete structure. @@ -24,44 +23,38 @@ type PcloudDhcpDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudDhcpDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudDhcpDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudDhcpDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudDhcpDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudDhcpDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudDhcpDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudDhcpDeleteAccepted() *PcloudDhcpDeleteAccepted { return &PcloudDhcpDeleteAccepted{} } -/*PcloudDhcpDeleteAccepted handles this case with default header values. +/* PcloudDhcpDeleteAccepted describes a response with status code 202, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudDhcpDeleteAccepted struct { func (o *PcloudDhcpDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudDhcpDeleteAccepted) GetPayload() models.Object { + return o.Payload +} func (o *PcloudDhcpDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudDhcpDeleteBadRequest() *PcloudDhcpDeleteBadRequest { return &PcloudDhcpDeleteBadRequest{} } -/*PcloudDhcpDeleteBadRequest handles this case with default header values. +/* PcloudDhcpDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudDhcpDeleteBadRequest struct { func (o *PcloudDhcpDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudDhcpDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudDhcpDeleteForbidden() *PcloudDhcpDeleteForbidden { return &PcloudDhcpDeleteForbidden{} } -/*PcloudDhcpDeleteForbidden handles this case with default header values. +/* PcloudDhcpDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -137,6 +136,9 @@ type PcloudDhcpDeleteForbidden struct { func (o *PcloudDhcpDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudDhcpDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudDhcpDeleteNotFound() *PcloudDhcpDeleteNotFound { return &PcloudDhcpDeleteNotFound{} } -/*PcloudDhcpDeleteNotFound handles this case with default header values. +/* PcloudDhcpDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -166,6 +168,9 @@ type PcloudDhcpDeleteNotFound struct { func (o *PcloudDhcpDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudDhcpDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudDhcpDeleteInternalServerError() *PcloudDhcpDeleteInternalServerErr return &PcloudDhcpDeleteInternalServerError{} } -/*PcloudDhcpDeleteInternalServerError handles this case with default header values. +/* PcloudDhcpDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudDhcpDeleteInternalServerError struct { func (o *PcloudDhcpDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudDhcpDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go index 013e92fac2..341c63d477 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudDhcpGetParams creates a new PcloudDhcpGetParams object -// with the default values initialized. +// NewPcloudDhcpGetParams creates a new PcloudDhcpGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudDhcpGetParams() *PcloudDhcpGetParams { - var () return &PcloudDhcpGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudDhcpGetParamsWithTimeout creates a new PcloudDhcpGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudDhcpGetParamsWithTimeout(timeout time.Duration) *PcloudDhcpGetParams { - var () return &PcloudDhcpGetParams{ - timeout: timeout, } } // NewPcloudDhcpGetParamsWithContext creates a new PcloudDhcpGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudDhcpGetParamsWithContext(ctx context.Context) *PcloudDhcpGetParams { - var () return &PcloudDhcpGetParams{ - Context: ctx, } } // NewPcloudDhcpGetParamsWithHTTPClient creates a new PcloudDhcpGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudDhcpGetParamsWithHTTPClient(client *http.Client) *PcloudDhcpGetParams { - var () return &PcloudDhcpGetParams{ HTTPClient: client, } } -/*PcloudDhcpGetParams contains all the parameters to send to the API endpoint -for the pcloud dhcp get operation typically these are written to a http.Request +/* PcloudDhcpGetParams contains all the parameters to send to the API endpoint + for the pcloud dhcp get operation. + + Typically these are written to a http.Request. */ type PcloudDhcpGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*DhcpID - The ID of the DHCP Server + /* DhcpID. + + The ID of the DHCP Server */ DhcpID string @@ -77,6 +76,21 @@ type PcloudDhcpGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud dhcp get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpGetParams) WithDefaults() *PcloudDhcpGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud dhcp get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud dhcp get params func (o *PcloudDhcpGetParams) WithTimeout(timeout time.Duration) *PcloudDhcpGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go index 583f15fca6..533dd79a84 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudDhcpGetReader is a Reader for the PcloudDhcpGet structure. @@ -24,44 +23,38 @@ type PcloudDhcpGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudDhcpGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudDhcpGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudDhcpGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudDhcpGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudDhcpGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudDhcpGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudDhcpGetOK() *PcloudDhcpGetOK { return &PcloudDhcpGetOK{} } -/*PcloudDhcpGetOK handles this case with default header values. +/* PcloudDhcpGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudDhcpGetOK struct { func (o *PcloudDhcpGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetOK %+v", 200, o.Payload) } +func (o *PcloudDhcpGetOK) GetPayload() *models.DHCPServerDetail { + return o.Payload +} func (o *PcloudDhcpGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudDhcpGetBadRequest() *PcloudDhcpGetBadRequest { return &PcloudDhcpGetBadRequest{} } -/*PcloudDhcpGetBadRequest handles this case with default header values. +/* PcloudDhcpGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudDhcpGetBadRequest struct { func (o *PcloudDhcpGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudDhcpGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudDhcpGetForbidden() *PcloudDhcpGetForbidden { return &PcloudDhcpGetForbidden{} } -/*PcloudDhcpGetForbidden handles this case with default header values. +/* PcloudDhcpGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -139,6 +138,9 @@ type PcloudDhcpGetForbidden struct { func (o *PcloudDhcpGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetForbidden %+v", 403, o.Payload) } +func (o *PcloudDhcpGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudDhcpGetNotFound() *PcloudDhcpGetNotFound { return &PcloudDhcpGetNotFound{} } -/*PcloudDhcpGetNotFound handles this case with default header values. +/* PcloudDhcpGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudDhcpGetNotFound struct { func (o *PcloudDhcpGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetNotFound %+v", 404, o.Payload) } +func (o *PcloudDhcpGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudDhcpGetInternalServerError() *PcloudDhcpGetInternalServerError { return &PcloudDhcpGetInternalServerError{} } -/*PcloudDhcpGetInternalServerError handles this case with default header values. +/* PcloudDhcpGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudDhcpGetInternalServerError struct { func (o *PcloudDhcpGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudDhcpGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go index ac99788283..52bbb8487b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudDhcpGetallParams creates a new PcloudDhcpGetallParams object -// with the default values initialized. +// NewPcloudDhcpGetallParams creates a new PcloudDhcpGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudDhcpGetallParams() *PcloudDhcpGetallParams { - var () return &PcloudDhcpGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudDhcpGetallParamsWithTimeout creates a new PcloudDhcpGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudDhcpGetallParamsWithTimeout(timeout time.Duration) *PcloudDhcpGetallParams { - var () return &PcloudDhcpGetallParams{ - timeout: timeout, } } // NewPcloudDhcpGetallParamsWithContext creates a new PcloudDhcpGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudDhcpGetallParamsWithContext(ctx context.Context) *PcloudDhcpGetallParams { - var () return &PcloudDhcpGetallParams{ - Context: ctx, } } // NewPcloudDhcpGetallParamsWithHTTPClient creates a new PcloudDhcpGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudDhcpGetallParamsWithHTTPClient(client *http.Client) *PcloudDhcpGetallParams { - var () return &PcloudDhcpGetallParams{ HTTPClient: client, } } -/*PcloudDhcpGetallParams contains all the parameters to send to the API endpoint -for the pcloud dhcp getall operation typically these are written to a http.Request +/* PcloudDhcpGetallParams contains all the parameters to send to the API endpoint + for the pcloud dhcp getall operation. + + Typically these are written to a http.Request. */ type PcloudDhcpGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudDhcpGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud dhcp getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpGetallParams) WithDefaults() *PcloudDhcpGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud dhcp getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud dhcp getall params func (o *PcloudDhcpGetallParams) WithTimeout(timeout time.Duration) *PcloudDhcpGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go index aae299c269..3aeb4415c3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudDhcpGetallReader is a Reader for the PcloudDhcpGetall structure. @@ -24,30 +23,26 @@ type PcloudDhcpGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudDhcpGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudDhcpGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 403: result := NewPcloudDhcpGetallForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudDhcpGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewPcloudDhcpGetallOK() *PcloudDhcpGetallOK { return &PcloudDhcpGetallOK{} } -/*PcloudDhcpGetallOK handles this case with default header values. +/* PcloudDhcpGetallOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type PcloudDhcpGetallOK struct { func (o *PcloudDhcpGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallOK %+v", 200, o.Payload) } +func (o *PcloudDhcpGetallOK) GetPayload() models.DHCPServers { + return o.Payload +} func (o *PcloudDhcpGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -83,7 +81,7 @@ func NewPcloudDhcpGetallForbidden() *PcloudDhcpGetallForbidden { return &PcloudDhcpGetallForbidden{} } -/*PcloudDhcpGetallForbidden handles this case with default header values. +/* PcloudDhcpGetallForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -94,6 +92,9 @@ type PcloudDhcpGetallForbidden struct { func (o *PcloudDhcpGetallForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallForbidden %+v", 403, o.Payload) } +func (o *PcloudDhcpGetallForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -112,7 +113,7 @@ func NewPcloudDhcpGetallInternalServerError() *PcloudDhcpGetallInternalServerErr return &PcloudDhcpGetallInternalServerError{} } -/*PcloudDhcpGetallInternalServerError handles this case with default header values. +/* PcloudDhcpGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -123,6 +124,9 @@ type PcloudDhcpGetallInternalServerError struct { func (o *PcloudDhcpGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudDhcpGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go index d38557f016..d16312a19b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_parameters.go @@ -13,57 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudDhcpPostParams creates a new PcloudDhcpPostParams object -// with the default values initialized. +// NewPcloudDhcpPostParams creates a new PcloudDhcpPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudDhcpPostParams() *PcloudDhcpPostParams { - var () return &PcloudDhcpPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudDhcpPostParamsWithTimeout creates a new PcloudDhcpPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudDhcpPostParamsWithTimeout(timeout time.Duration) *PcloudDhcpPostParams { - var () return &PcloudDhcpPostParams{ - timeout: timeout, } } // NewPcloudDhcpPostParamsWithContext creates a new PcloudDhcpPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudDhcpPostParamsWithContext(ctx context.Context) *PcloudDhcpPostParams { - var () return &PcloudDhcpPostParams{ - Context: ctx, } } // NewPcloudDhcpPostParamsWithHTTPClient creates a new PcloudDhcpPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudDhcpPostParamsWithHTTPClient(client *http.Client) *PcloudDhcpPostParams { - var () return &PcloudDhcpPostParams{ HTTPClient: client, } } -/*PcloudDhcpPostParams contains all the parameters to send to the API endpoint -for the pcloud dhcp post operation typically these are written to a http.Request +/* PcloudDhcpPostParams contains all the parameters to send to the API endpoint + for the pcloud dhcp post operation. + + Typically these are written to a http.Request. */ type PcloudDhcpPostParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* Body. + Parameters used during creation of DHCP service + */ + Body *models.DHCPServerCreate + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +78,21 @@ type PcloudDhcpPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud dhcp post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpPostParams) WithDefaults() *PcloudDhcpPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud dhcp post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudDhcpPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud dhcp post params func (o *PcloudDhcpPostParams) WithTimeout(timeout time.Duration) *PcloudDhcpPostParams { o.SetTimeout(timeout) @@ -105,6 +126,17 @@ func (o *PcloudDhcpPostParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithBody adds the body to the pcloud dhcp post params +func (o *PcloudDhcpPostParams) WithBody(body *models.DHCPServerCreate) *PcloudDhcpPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud dhcp post params +func (o *PcloudDhcpPostParams) SetBody(body *models.DHCPServerCreate) { + o.Body = body +} + // WithCloudInstanceID adds the cloudInstanceID to the pcloud dhcp post params func (o *PcloudDhcpPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudDhcpPostParams { o.SetCloudInstanceID(cloudInstanceID) @@ -123,6 +155,11 @@ func (o *PcloudDhcpPostParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } // path param cloud_instance_id if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go index 16350666f3..7b5b685082 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudDhcpPostReader is a Reader for the PcloudDhcpPost structure. @@ -24,37 +23,32 @@ type PcloudDhcpPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudDhcpPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudDhcpPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudDhcpPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudDhcpPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudDhcpPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudDhcpPostAccepted() *PcloudDhcpPostAccepted { return &PcloudDhcpPostAccepted{} } -/*PcloudDhcpPostAccepted handles this case with default header values. +/* PcloudDhcpPostAccepted describes a response with status code 202, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudDhcpPostAccepted struct { func (o *PcloudDhcpPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted %+v", 202, o.Payload) } +func (o *PcloudDhcpPostAccepted) GetPayload() *models.DHCPServer { + return o.Payload +} func (o *PcloudDhcpPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudDhcpPostBadRequest() *PcloudDhcpPostBadRequest { return &PcloudDhcpPostBadRequest{} } -/*PcloudDhcpPostBadRequest handles this case with default header values. +/* PcloudDhcpPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudDhcpPostBadRequest struct { func (o *PcloudDhcpPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudDhcpPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudDhcpPostForbidden() *PcloudDhcpPostForbidden { return &PcloudDhcpPostForbidden{} } -/*PcloudDhcpPostForbidden handles this case with default header values. +/* PcloudDhcpPostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -132,6 +132,9 @@ type PcloudDhcpPostForbidden struct { func (o *PcloudDhcpPostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden %+v", 403, o.Payload) } +func (o *PcloudDhcpPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudDhcpPostInternalServerError() *PcloudDhcpPostInternalServerError { return &PcloudDhcpPostInternalServerError{} } -/*PcloudDhcpPostInternalServerError handles this case with default header values. +/* PcloudDhcpPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudDhcpPostInternalServerError struct { func (o *PcloudDhcpPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudDhcpPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudDhcpPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go index 654163d37b..173f444230 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go @@ -6,13 +6,14 @@ package p_cloud_snapshots // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud snapshots API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,31 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstancesSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsDeleteAccepted, error) + + PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetOK, error) + + PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetallOK, error) + + PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSnapshotsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudCloudinstancesSnapshotsDelete deletes a p VM instance snapshot of a cloud instance + PcloudCloudinstancesSnapshotsDelete deletes a p VM instance snapshot of a cloud instance */ -func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstancesSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesSnapshotsDeleteAccepted, error) { +func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstancesSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsDeleteAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.snapshots.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}", @@ -45,24 +61,34 @@ func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstance AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesSnapshotsDeleteAccepted), nil - + success, ok := result.(*PcloudCloudinstancesSnapshotsDeleteAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesSnapshotsGet gets the detail of a snapshot + PcloudCloudinstancesSnapshotsGet gets the detail of a snapshot */ -func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesSnapshotsGetOK, error) { +func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.snapshots.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}", @@ -74,24 +100,34 @@ func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesSnapshotsGetOK), nil - + success, ok := result.(*PcloudCloudinstancesSnapshotsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesSnapshotsGetall lists all p VM instance snapshots for this cloud instance + PcloudCloudinstancesSnapshotsGetall lists all p VM instance snapshots for this cloud instance */ -func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesSnapshotsGetallOK, error) { +func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.snapshots.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots", @@ -103,24 +139,34 @@ func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstance AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesSnapshotsGetallOK), nil - + success, ok := result.(*PcloudCloudinstancesSnapshotsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesSnapshotsPut updates a p VM instance snapshot + PcloudCloudinstancesSnapshotsPut updates a p VM instance snapshot */ -func (a *Client) PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSnapshotsPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesSnapshotsPutOK, error) { +func (a *Client) PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSnapshotsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.snapshots.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}", @@ -132,12 +178,23 @@ func (a *Client) PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesSnapshotsPutOK), nil - + success, ok := result.(*PcloudCloudinstancesSnapshotsPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go index 3845c35497..ce1013739d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesSnapshotsDeleteParams creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the default values initialized. +// NewPcloudCloudinstancesSnapshotsDeleteParams creates a new PcloudCloudinstancesSnapshotsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesSnapshotsDeleteParams() *PcloudCloudinstancesSnapshotsDeleteParams { - var () return &PcloudCloudinstancesSnapshotsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesSnapshotsDeleteParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesSnapshotsDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsDeleteParams { - var () return &PcloudCloudinstancesSnapshotsDeleteParams{ - timeout: timeout, } } // NewPcloudCloudinstancesSnapshotsDeleteParamsWithContext creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesSnapshotsDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsDeleteParams { - var () return &PcloudCloudinstancesSnapshotsDeleteParams{ - Context: ctx, } } // NewPcloudCloudinstancesSnapshotsDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesSnapshotsDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsDeleteParams { - var () return &PcloudCloudinstancesSnapshotsDeleteParams{ HTTPClient: client, } } -/*PcloudCloudinstancesSnapshotsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances snapshots delete operation typically these are written to a http.Request +/* PcloudCloudinstancesSnapshotsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances snapshots delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesSnapshotsDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*SnapshotID - PVM Instance snapshot id + /* SnapshotID. + + PVM Instance snapshot id */ SnapshotID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesSnapshotsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances snapshots delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithDefaults() *PcloudCloudinstancesSnapshotsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances snapshots delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances snapshots delete params func (o *PcloudCloudinstancesSnapshotsDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go index d3ad4507aa..db47320176 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesSnapshotsDeleteReader is a Reader for the PcloudCloudinstancesSnapshotsDelete structure. @@ -24,51 +23,44 @@ type PcloudCloudinstancesSnapshotsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudCloudinstancesSnapshotsDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesSnapshotsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesSnapshotsDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesSnapshotsDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudCloudinstancesSnapshotsDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesSnapshotsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudinstancesSnapshotsDeleteAccepted() *PcloudCloudinstancesSnaps return &PcloudCloudinstancesSnapshotsDeleteAccepted{} } -/*PcloudCloudinstancesSnapshotsDeleteAccepted handles this case with default header values. +/* PcloudCloudinstancesSnapshotsDeleteAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudCloudinstancesSnapshotsDeleteAccepted struct { func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudCloudinstancesSnapshotsDeleteBadRequest() *PcloudCloudinstancesSna return &PcloudCloudinstancesSnapshotsDeleteBadRequest{} } -/*PcloudCloudinstancesSnapshotsDeleteBadRequest handles this case with default header values. +/* PcloudCloudinstancesSnapshotsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -115,6 +110,9 @@ type PcloudCloudinstancesSnapshotsDeleteBadRequest struct { func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudCloudinstancesSnapshotsDeleteUnauthorized() *PcloudCloudinstancesS return &PcloudCloudinstancesSnapshotsDeleteUnauthorized{} } -/*PcloudCloudinstancesSnapshotsDeleteUnauthorized handles this case with default header values. +/* PcloudCloudinstancesSnapshotsDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -144,6 +142,9 @@ type PcloudCloudinstancesSnapshotsDeleteUnauthorized struct { func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudCloudinstancesSnapshotsDeleteNotFound() *PcloudCloudinstancesSnaps return &PcloudCloudinstancesSnapshotsDeleteNotFound{} } -/*PcloudCloudinstancesSnapshotsDeleteNotFound handles this case with default header values. +/* PcloudCloudinstancesSnapshotsDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -173,6 +174,9 @@ type PcloudCloudinstancesSnapshotsDeleteNotFound struct { func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudCloudinstancesSnapshotsDeleteGone() *PcloudCloudinstancesSnapshots return &PcloudCloudinstancesSnapshotsDeleteGone{} } -/*PcloudCloudinstancesSnapshotsDeleteGone handles this case with default header values. +/* PcloudCloudinstancesSnapshotsDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -202,6 +206,9 @@ type PcloudCloudinstancesSnapshotsDeleteGone struct { func (o *PcloudCloudinstancesSnapshotsDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteGone %+v", 410, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudCloudinstancesSnapshotsDeleteInternalServerError() *PcloudCloudins return &PcloudCloudinstancesSnapshotsDeleteInternalServerError{} } -/*PcloudCloudinstancesSnapshotsDeleteInternalServerError handles this case with default header values. +/* PcloudCloudinstancesSnapshotsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudCloudinstancesSnapshotsDeleteInternalServerError struct { func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go index d4805a80e2..58857dc0eb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesSnapshotsGetParams creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the default values initialized. +// NewPcloudCloudinstancesSnapshotsGetParams creates a new PcloudCloudinstancesSnapshotsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesSnapshotsGetParams() *PcloudCloudinstancesSnapshotsGetParams { - var () return &PcloudCloudinstancesSnapshotsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesSnapshotsGetParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesSnapshotsGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetParams { - var () return &PcloudCloudinstancesSnapshotsGetParams{ - timeout: timeout, } } // NewPcloudCloudinstancesSnapshotsGetParamsWithContext creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesSnapshotsGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsGetParams { - var () return &PcloudCloudinstancesSnapshotsGetParams{ - Context: ctx, } } // NewPcloudCloudinstancesSnapshotsGetParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesSnapshotsGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsGetParams { - var () return &PcloudCloudinstancesSnapshotsGetParams{ HTTPClient: client, } } -/*PcloudCloudinstancesSnapshotsGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances snapshots get operation typically these are written to a http.Request +/* PcloudCloudinstancesSnapshotsGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances snapshots get operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesSnapshotsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*SnapshotID - PVM Instance snapshot id + /* SnapshotID. + + PVM Instance snapshot id */ SnapshotID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesSnapshotsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances snapshots get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsGetParams) WithDefaults() *PcloudCloudinstancesSnapshotsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances snapshots get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances snapshots get params func (o *PcloudCloudinstancesSnapshotsGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go index fc2265ef39..44ebe00012 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesSnapshotsGetReader is a Reader for the PcloudCloudinstancesSnapshotsGet structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesSnapshotsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesSnapshotsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesSnapshotsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesSnapshotsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesSnapshotsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesSnapshotsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesSnapshotsGetOK() *PcloudCloudinstancesSnapshotsGetOK return &PcloudCloudinstancesSnapshotsGetOK{} } -/*PcloudCloudinstancesSnapshotsGetOK handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesSnapshotsGetOK struct { func (o *PcloudCloudinstancesSnapshotsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetOK) GetPayload() *models.Snapshot { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesSnapshotsGetBadRequest() *PcloudCloudinstancesSnapsh return &PcloudCloudinstancesSnapshotsGetBadRequest{} } -/*PcloudCloudinstancesSnapshotsGetBadRequest handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesSnapshotsGetBadRequest struct { func (o *PcloudCloudinstancesSnapshotsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesSnapshotsGetUnauthorized() *PcloudCloudinstancesSnap return &PcloudCloudinstancesSnapshotsGetUnauthorized{} } -/*PcloudCloudinstancesSnapshotsGetUnauthorized handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesSnapshotsGetUnauthorized struct { func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesSnapshotsGetNotFound() *PcloudCloudinstancesSnapshot return &PcloudCloudinstancesSnapshotsGetNotFound{} } -/*PcloudCloudinstancesSnapshotsGetNotFound handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesSnapshotsGetNotFound struct { func (o *PcloudCloudinstancesSnapshotsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesSnapshotsGetInternalServerError() *PcloudCloudinstan return &PcloudCloudinstancesSnapshotsGetInternalServerError{} } -/*PcloudCloudinstancesSnapshotsGetInternalServerError handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesSnapshotsGetInternalServerError struct { func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go index 4929407441..281b70623c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesSnapshotsGetallParams creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the default values initialized. +// NewPcloudCloudinstancesSnapshotsGetallParams creates a new PcloudCloudinstancesSnapshotsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesSnapshotsGetallParams() *PcloudCloudinstancesSnapshotsGetallParams { - var () return &PcloudCloudinstancesSnapshotsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesSnapshotsGetallParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesSnapshotsGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetallParams { - var () return &PcloudCloudinstancesSnapshotsGetallParams{ - timeout: timeout, } } // NewPcloudCloudinstancesSnapshotsGetallParamsWithContext creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesSnapshotsGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsGetallParams { - var () return &PcloudCloudinstancesSnapshotsGetallParams{ - Context: ctx, } } // NewPcloudCloudinstancesSnapshotsGetallParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesSnapshotsGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsGetallParams { - var () return &PcloudCloudinstancesSnapshotsGetallParams{ HTTPClient: client, } } -/*PcloudCloudinstancesSnapshotsGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances snapshots getall operation typically these are written to a http.Request +/* PcloudCloudinstancesSnapshotsGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances snapshots getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesSnapshotsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudCloudinstancesSnapshotsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances snapshots getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsGetallParams) WithDefaults() *PcloudCloudinstancesSnapshotsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances snapshots getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances snapshots getall params func (o *PcloudCloudinstancesSnapshotsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go index 43130ea213..c4dee1b560 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesSnapshotsGetallReader is a Reader for the PcloudCloudinstancesSnapshotsGetall structure. @@ -24,37 +23,32 @@ type PcloudCloudinstancesSnapshotsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesSnapshotsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesSnapshotsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesSnapshotsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesSnapshotsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudCloudinstancesSnapshotsGetallOK() *PcloudCloudinstancesSnapshotsGe return &PcloudCloudinstancesSnapshotsGetallOK{} } -/*PcloudCloudinstancesSnapshotsGetallOK handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetallOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudCloudinstancesSnapshotsGetallOK struct { func (o *PcloudCloudinstancesSnapshotsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetallOK) GetPayload() *models.Snapshots { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudCloudinstancesSnapshotsGetallBadRequest() *PcloudCloudinstancesSna return &PcloudCloudinstancesSnapshotsGetallBadRequest{} } -/*PcloudCloudinstancesSnapshotsGetallBadRequest handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -103,6 +100,9 @@ type PcloudCloudinstancesSnapshotsGetallBadRequest struct { func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudCloudinstancesSnapshotsGetallUnauthorized() *PcloudCloudinstancesS return &PcloudCloudinstancesSnapshotsGetallUnauthorized{} } -/*PcloudCloudinstancesSnapshotsGetallUnauthorized handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -132,6 +132,9 @@ type PcloudCloudinstancesSnapshotsGetallUnauthorized struct { func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudCloudinstancesSnapshotsGetallInternalServerError() *PcloudCloudins return &PcloudCloudinstancesSnapshotsGetallInternalServerError{} } -/*PcloudCloudinstancesSnapshotsGetallInternalServerError handles this case with default header values. +/* PcloudCloudinstancesSnapshotsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudCloudinstancesSnapshotsGetallInternalServerError struct { func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go index 81c6dd1362..268a2dfe26 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesSnapshotsPutParams creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the default values initialized. +// NewPcloudCloudinstancesSnapshotsPutParams creates a new PcloudCloudinstancesSnapshotsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesSnapshotsPutParams() *PcloudCloudinstancesSnapshotsPutParams { - var () return &PcloudCloudinstancesSnapshotsPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesSnapshotsPutParamsWithTimeout creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesSnapshotsPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsPutParams { - var () return &PcloudCloudinstancesSnapshotsPutParams{ - timeout: timeout, } } // NewPcloudCloudinstancesSnapshotsPutParamsWithContext creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesSnapshotsPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesSnapshotsPutParams { - var () return &PcloudCloudinstancesSnapshotsPutParams{ - Context: ctx, } } // NewPcloudCloudinstancesSnapshotsPutParamsWithHTTPClient creates a new PcloudCloudinstancesSnapshotsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesSnapshotsPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSnapshotsPutParams { - var () return &PcloudCloudinstancesSnapshotsPutParams{ HTTPClient: client, } } -/*PcloudCloudinstancesSnapshotsPutParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances snapshots put operation typically these are written to a http.Request +/* PcloudCloudinstancesSnapshotsPutParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances snapshots put operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesSnapshotsPutParams struct { - /*Body - Parameters for the update of a PVM instance snapshot + /* Body. + Parameters for the update of a PVM instance snapshot */ Body *models.SnapshotUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*SnapshotID - PVM Instance snapshot id + /* SnapshotID. + + PVM Instance snapshot id */ SnapshotID string @@ -84,6 +84,21 @@ type PcloudCloudinstancesSnapshotsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances snapshots put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsPutParams) WithDefaults() *PcloudCloudinstancesSnapshotsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances snapshots put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSnapshotsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances snapshots put params func (o *PcloudCloudinstancesSnapshotsPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSnapshotsPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudCloudinstancesSnapshotsPutParams) WriteToRequest(r runtime.Client return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go index 9fbccd4cb4..5dd9d99fac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesSnapshotsPutReader is a Reader for the PcloudCloudinstancesSnapshotsPut structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesSnapshotsPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesSnapshotsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesSnapshotsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesSnapshotsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesSnapshotsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesSnapshotsPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesSnapshotsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesSnapshotsPutOK() *PcloudCloudinstancesSnapshotsPutOK return &PcloudCloudinstancesSnapshotsPutOK{} } -/*PcloudCloudinstancesSnapshotsPutOK handles this case with default header values. +/* PcloudCloudinstancesSnapshotsPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesSnapshotsPutOK struct { func (o *PcloudCloudinstancesSnapshotsPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsPutOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudCloudinstancesSnapshotsPutBadRequest() *PcloudCloudinstancesSnapsh return &PcloudCloudinstancesSnapshotsPutBadRequest{} } -/*PcloudCloudinstancesSnapshotsPutBadRequest handles this case with default header values. +/* PcloudCloudinstancesSnapshotsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudCloudinstancesSnapshotsPutBadRequest struct { func (o *PcloudCloudinstancesSnapshotsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudCloudinstancesSnapshotsPutUnauthorized() *PcloudCloudinstancesSnap return &PcloudCloudinstancesSnapshotsPutUnauthorized{} } -/*PcloudCloudinstancesSnapshotsPutUnauthorized handles this case with default header values. +/* PcloudCloudinstancesSnapshotsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudCloudinstancesSnapshotsPutUnauthorized struct { func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudCloudinstancesSnapshotsPutNotFound() *PcloudCloudinstancesSnapshot return &PcloudCloudinstancesSnapshotsPutNotFound{} } -/*PcloudCloudinstancesSnapshotsPutNotFound handles this case with default header values. +/* PcloudCloudinstancesSnapshotsPutNotFound describes a response with status code 404, with default header values. Not Found */ @@ -166,6 +168,9 @@ type PcloudCloudinstancesSnapshotsPutNotFound struct { func (o *PcloudCloudinstancesSnapshotsPutNotFound) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsPutNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudCloudinstancesSnapshotsPutInternalServerError() *PcloudCloudinstan return &PcloudCloudinstancesSnapshotsPutInternalServerError{} } -/*PcloudCloudinstancesSnapshotsPutInternalServerError handles this case with default header values. +/* PcloudCloudinstancesSnapshotsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudCloudinstancesSnapshotsPutInternalServerError struct { func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go index 018a381a10..061b527297 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go @@ -6,13 +6,14 @@ package p_cloud_storage_capacity // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud storage capacity API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,31 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetOK, error) + + PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityPoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetallOK, error) + + PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityTypesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetOK, error) + + PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityTypesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetallOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudStoragecapacityPoolsGet storages capacity for a storage pool in a region + PcloudStoragecapacityPoolsGet storages capacity for a storage pool in a region */ -func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPoolsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudStoragecapacityPoolsGetOK, error) { +func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudStoragecapacityPoolsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.storagecapacity.pools.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}", @@ -45,24 +61,34 @@ func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPool AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudStoragecapacityPoolsGetOK), nil - + success, ok := result.(*PcloudStoragecapacityPoolsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.pools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudStoragecapacityPoolsGetall storages capacity for all available storage pools in a region + PcloudStoragecapacityPoolsGetall storages capacity for all available storage pools in a region */ -func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityPoolsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudStoragecapacityPoolsGetallOK, error) { +func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityPoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudStoragecapacityPoolsGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.storagecapacity.pools.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools", @@ -74,24 +100,34 @@ func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityP AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudStoragecapacityPoolsGetallOK), nil - + success, ok := result.(*PcloudStoragecapacityPoolsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.pools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudStoragecapacityTypesGet storages capacity for a storage type in a region + PcloudStoragecapacityTypesGet storages capacity for a storage type in a region */ -func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityTypesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudStoragecapacityTypesGetOK, error) { +func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityTypesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudStoragecapacityTypesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.storagecapacity.types.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}", @@ -103,24 +139,34 @@ func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityType AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudStoragecapacityTypesGetOK), nil - + success, ok := result.(*PcloudStoragecapacityTypesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.types.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudStoragecapacityTypesGetall storages capacity for all available storage types in a region + PcloudStoragecapacityTypesGetall storages capacity for all available storage types in a region */ -func (a *Client) PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityTypesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudStoragecapacityTypesGetallOK, error) { +func (a *Client) PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityTypesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudStoragecapacityTypesGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.storagecapacity.types.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types", @@ -132,12 +178,23 @@ func (a *Client) PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityT AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudStoragecapacityTypesGetallOK), nil - + success, ok := result.(*PcloudStoragecapacityTypesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.types.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go index 76ee684ff2..c2d5df8083 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudStoragecapacityPoolsGetParams creates a new PcloudStoragecapacityPoolsGetParams object -// with the default values initialized. +// NewPcloudStoragecapacityPoolsGetParams creates a new PcloudStoragecapacityPoolsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudStoragecapacityPoolsGetParams() *PcloudStoragecapacityPoolsGetParams { - var () return &PcloudStoragecapacityPoolsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudStoragecapacityPoolsGetParamsWithTimeout creates a new PcloudStoragecapacityPoolsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudStoragecapacityPoolsGetParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetParams { - var () return &PcloudStoragecapacityPoolsGetParams{ - timeout: timeout, } } // NewPcloudStoragecapacityPoolsGetParamsWithContext creates a new PcloudStoragecapacityPoolsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudStoragecapacityPoolsGetParamsWithContext(ctx context.Context) *PcloudStoragecapacityPoolsGetParams { - var () return &PcloudStoragecapacityPoolsGetParams{ - Context: ctx, } } // NewPcloudStoragecapacityPoolsGetParamsWithHTTPClient creates a new PcloudStoragecapacityPoolsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudStoragecapacityPoolsGetParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityPoolsGetParams { - var () return &PcloudStoragecapacityPoolsGetParams{ HTTPClient: client, } } -/*PcloudStoragecapacityPoolsGetParams contains all the parameters to send to the API endpoint -for the pcloud storagecapacity pools get operation typically these are written to a http.Request +/* PcloudStoragecapacityPoolsGetParams contains all the parameters to send to the API endpoint + for the pcloud storagecapacity pools get operation. + + Typically these are written to a http.Request. */ type PcloudStoragecapacityPoolsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*StoragePoolName - Storage pool name + /* StoragePoolName. + + Storage pool name */ StoragePoolName string @@ -77,6 +76,21 @@ type PcloudStoragecapacityPoolsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud storagecapacity pools get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityPoolsGetParams) WithDefaults() *PcloudStoragecapacityPoolsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud storagecapacity pools get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityPoolsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud storagecapacity pools get params func (o *PcloudStoragecapacityPoolsGetParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go index 862c1a6350..d6abdcf9b6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudStoragecapacityPoolsGetReader is a Reader for the PcloudStoragecapacityPoolsGet structure. @@ -24,37 +23,32 @@ type PcloudStoragecapacityPoolsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudStoragecapacityPoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudStoragecapacityPoolsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudStoragecapacityPoolsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudStoragecapacityPoolsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudStoragecapacityPoolsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudStoragecapacityPoolsGetOK() *PcloudStoragecapacityPoolsGetOK { return &PcloudStoragecapacityPoolsGetOK{} } -/*PcloudStoragecapacityPoolsGetOK handles this case with default header values. +/* PcloudStoragecapacityPoolsGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudStoragecapacityPoolsGetOK struct { func (o *PcloudStoragecapacityPoolsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetOK %+v", 200, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetOK) GetPayload() *models.StoragePoolCapacity { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudStoragecapacityPoolsGetUnauthorized() *PcloudStoragecapacityPoolsG return &PcloudStoragecapacityPoolsGetUnauthorized{} } -/*PcloudStoragecapacityPoolsGetUnauthorized handles this case with default header values. +/* PcloudStoragecapacityPoolsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudStoragecapacityPoolsGetUnauthorized struct { func (o *PcloudStoragecapacityPoolsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudStoragecapacityPoolsGetNotFound() *PcloudStoragecapacityPoolsGetNo return &PcloudStoragecapacityPoolsGetNotFound{} } -/*PcloudStoragecapacityPoolsGetNotFound handles this case with default header values. +/* PcloudStoragecapacityPoolsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudStoragecapacityPoolsGetNotFound struct { func (o *PcloudStoragecapacityPoolsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudStoragecapacityPoolsGetInternalServerError() *PcloudStoragecapacit return &PcloudStoragecapacityPoolsGetInternalServerError{} } -/*PcloudStoragecapacityPoolsGetInternalServerError handles this case with default header values. +/* PcloudStoragecapacityPoolsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudStoragecapacityPoolsGetInternalServerError struct { func (o *PcloudStoragecapacityPoolsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go index 0bb1b7640d..e955e007b4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudStoragecapacityPoolsGetallParams creates a new PcloudStoragecapacityPoolsGetallParams object -// with the default values initialized. +// NewPcloudStoragecapacityPoolsGetallParams creates a new PcloudStoragecapacityPoolsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudStoragecapacityPoolsGetallParams() *PcloudStoragecapacityPoolsGetallParams { - var () return &PcloudStoragecapacityPoolsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudStoragecapacityPoolsGetallParamsWithTimeout creates a new PcloudStoragecapacityPoolsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudStoragecapacityPoolsGetallParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetallParams { - var () return &PcloudStoragecapacityPoolsGetallParams{ - timeout: timeout, } } // NewPcloudStoragecapacityPoolsGetallParamsWithContext creates a new PcloudStoragecapacityPoolsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudStoragecapacityPoolsGetallParamsWithContext(ctx context.Context) *PcloudStoragecapacityPoolsGetallParams { - var () return &PcloudStoragecapacityPoolsGetallParams{ - Context: ctx, } } // NewPcloudStoragecapacityPoolsGetallParamsWithHTTPClient creates a new PcloudStoragecapacityPoolsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudStoragecapacityPoolsGetallParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityPoolsGetallParams { - var () return &PcloudStoragecapacityPoolsGetallParams{ HTTPClient: client, } } -/*PcloudStoragecapacityPoolsGetallParams contains all the parameters to send to the API endpoint -for the pcloud storagecapacity pools getall operation typically these are written to a http.Request +/* PcloudStoragecapacityPoolsGetallParams contains all the parameters to send to the API endpoint + for the pcloud storagecapacity pools getall operation. + + Typically these are written to a http.Request. */ type PcloudStoragecapacityPoolsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudStoragecapacityPoolsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud storagecapacity pools getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityPoolsGetallParams) WithDefaults() *PcloudStoragecapacityPoolsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud storagecapacity pools getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityPoolsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud storagecapacity pools getall params func (o *PcloudStoragecapacityPoolsGetallParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityPoolsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go index f62b5831f1..6aa16ffe92 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudStoragecapacityPoolsGetallReader is a Reader for the PcloudStoragecapacityPoolsGetall structure. @@ -24,30 +23,26 @@ type PcloudStoragecapacityPoolsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudStoragecapacityPoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudStoragecapacityPoolsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudStoragecapacityPoolsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudStoragecapacityPoolsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewPcloudStoragecapacityPoolsGetallOK() *PcloudStoragecapacityPoolsGetallOK return &PcloudStoragecapacityPoolsGetallOK{} } -/*PcloudStoragecapacityPoolsGetallOK handles this case with default header values. +/* PcloudStoragecapacityPoolsGetallOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type PcloudStoragecapacityPoolsGetallOK struct { func (o *PcloudStoragecapacityPoolsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallOK %+v", 200, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetallOK) GetPayload() *models.StoragePoolsCapacity { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewPcloudStoragecapacityPoolsGetallUnauthorized() *PcloudStoragecapacityPoo return &PcloudStoragecapacityPoolsGetallUnauthorized{} } -/*PcloudStoragecapacityPoolsGetallUnauthorized handles this case with default header values. +/* PcloudStoragecapacityPoolsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -96,6 +94,9 @@ type PcloudStoragecapacityPoolsGetallUnauthorized struct { func (o *PcloudStoragecapacityPoolsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewPcloudStoragecapacityPoolsGetallInternalServerError() *PcloudStoragecapa return &PcloudStoragecapacityPoolsGetallInternalServerError{} } -/*PcloudStoragecapacityPoolsGetallInternalServerError handles this case with default header values. +/* PcloudStoragecapacityPoolsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type PcloudStoragecapacityPoolsGetallInternalServerError struct { func (o *PcloudStoragecapacityPoolsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudStoragecapacityPoolsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityPoolsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go index 372a17a705..51f3bb9b40 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudStoragecapacityTypesGetParams creates a new PcloudStoragecapacityTypesGetParams object -// with the default values initialized. +// NewPcloudStoragecapacityTypesGetParams creates a new PcloudStoragecapacityTypesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudStoragecapacityTypesGetParams() *PcloudStoragecapacityTypesGetParams { - var () return &PcloudStoragecapacityTypesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudStoragecapacityTypesGetParamsWithTimeout creates a new PcloudStoragecapacityTypesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudStoragecapacityTypesGetParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetParams { - var () return &PcloudStoragecapacityTypesGetParams{ - timeout: timeout, } } // NewPcloudStoragecapacityTypesGetParamsWithContext creates a new PcloudStoragecapacityTypesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudStoragecapacityTypesGetParamsWithContext(ctx context.Context) *PcloudStoragecapacityTypesGetParams { - var () return &PcloudStoragecapacityTypesGetParams{ - Context: ctx, } } // NewPcloudStoragecapacityTypesGetParamsWithHTTPClient creates a new PcloudStoragecapacityTypesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudStoragecapacityTypesGetParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityTypesGetParams { - var () return &PcloudStoragecapacityTypesGetParams{ HTTPClient: client, } } -/*PcloudStoragecapacityTypesGetParams contains all the parameters to send to the API endpoint -for the pcloud storagecapacity types get operation typically these are written to a http.Request +/* PcloudStoragecapacityTypesGetParams contains all the parameters to send to the API endpoint + for the pcloud storagecapacity types get operation. + + Typically these are written to a http.Request. */ type PcloudStoragecapacityTypesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*StorageTypeName - Storage type name + /* StorageTypeName. + + Storage type name */ StorageTypeName string @@ -77,6 +76,21 @@ type PcloudStoragecapacityTypesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud storagecapacity types get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityTypesGetParams) WithDefaults() *PcloudStoragecapacityTypesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud storagecapacity types get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityTypesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud storagecapacity types get params func (o *PcloudStoragecapacityTypesGetParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go index 0ff52a04a4..3623f47c00 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudStoragecapacityTypesGetReader is a Reader for the PcloudStoragecapacityTypesGet structure. @@ -24,37 +23,32 @@ type PcloudStoragecapacityTypesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudStoragecapacityTypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudStoragecapacityTypesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudStoragecapacityTypesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudStoragecapacityTypesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudStoragecapacityTypesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudStoragecapacityTypesGetOK() *PcloudStoragecapacityTypesGetOK { return &PcloudStoragecapacityTypesGetOK{} } -/*PcloudStoragecapacityTypesGetOK handles this case with default header values. +/* PcloudStoragecapacityTypesGetOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudStoragecapacityTypesGetOK struct { func (o *PcloudStoragecapacityTypesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetOK %+v", 200, o.Payload) } +func (o *PcloudStoragecapacityTypesGetOK) GetPayload() *models.StorageTypeCapacity { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudStoragecapacityTypesGetUnauthorized() *PcloudStoragecapacityTypesG return &PcloudStoragecapacityTypesGetUnauthorized{} } -/*PcloudStoragecapacityTypesGetUnauthorized handles this case with default header values. +/* PcloudStoragecapacityTypesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudStoragecapacityTypesGetUnauthorized struct { func (o *PcloudStoragecapacityTypesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudStoragecapacityTypesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudStoragecapacityTypesGetNotFound() *PcloudStoragecapacityTypesGetNo return &PcloudStoragecapacityTypesGetNotFound{} } -/*PcloudStoragecapacityTypesGetNotFound handles this case with default header values. +/* PcloudStoragecapacityTypesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudStoragecapacityTypesGetNotFound struct { func (o *PcloudStoragecapacityTypesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudStoragecapacityTypesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudStoragecapacityTypesGetInternalServerError() *PcloudStoragecapacit return &PcloudStoragecapacityTypesGetInternalServerError{} } -/*PcloudStoragecapacityTypesGetInternalServerError handles this case with default header values. +/* PcloudStoragecapacityTypesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudStoragecapacityTypesGetInternalServerError struct { func (o *PcloudStoragecapacityTypesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudStoragecapacityTypesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go index 155f47581f..50519ea2e9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudStoragecapacityTypesGetallParams creates a new PcloudStoragecapacityTypesGetallParams object -// with the default values initialized. +// NewPcloudStoragecapacityTypesGetallParams creates a new PcloudStoragecapacityTypesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudStoragecapacityTypesGetallParams() *PcloudStoragecapacityTypesGetallParams { - var () return &PcloudStoragecapacityTypesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudStoragecapacityTypesGetallParamsWithTimeout creates a new PcloudStoragecapacityTypesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudStoragecapacityTypesGetallParamsWithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetallParams { - var () return &PcloudStoragecapacityTypesGetallParams{ - timeout: timeout, } } // NewPcloudStoragecapacityTypesGetallParamsWithContext creates a new PcloudStoragecapacityTypesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudStoragecapacityTypesGetallParamsWithContext(ctx context.Context) *PcloudStoragecapacityTypesGetallParams { - var () return &PcloudStoragecapacityTypesGetallParams{ - Context: ctx, } } // NewPcloudStoragecapacityTypesGetallParamsWithHTTPClient creates a new PcloudStoragecapacityTypesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudStoragecapacityTypesGetallParamsWithHTTPClient(client *http.Client) *PcloudStoragecapacityTypesGetallParams { - var () return &PcloudStoragecapacityTypesGetallParams{ HTTPClient: client, } } -/*PcloudStoragecapacityTypesGetallParams contains all the parameters to send to the API endpoint -for the pcloud storagecapacity types getall operation typically these are written to a http.Request +/* PcloudStoragecapacityTypesGetallParams contains all the parameters to send to the API endpoint + for the pcloud storagecapacity types getall operation. + + Typically these are written to a http.Request. */ type PcloudStoragecapacityTypesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudStoragecapacityTypesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud storagecapacity types getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityTypesGetallParams) WithDefaults() *PcloudStoragecapacityTypesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud storagecapacity types getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudStoragecapacityTypesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud storagecapacity types getall params func (o *PcloudStoragecapacityTypesGetallParams) WithTimeout(timeout time.Duration) *PcloudStoragecapacityTypesGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go index 88467e7d42..97595cd310 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudStoragecapacityTypesGetallReader is a Reader for the PcloudStoragecapacityTypesGetall structure. @@ -24,30 +23,26 @@ type PcloudStoragecapacityTypesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudStoragecapacityTypesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudStoragecapacityTypesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudStoragecapacityTypesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudStoragecapacityTypesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewPcloudStoragecapacityTypesGetallOK() *PcloudStoragecapacityTypesGetallOK return &PcloudStoragecapacityTypesGetallOK{} } -/*PcloudStoragecapacityTypesGetallOK handles this case with default header values. +/* PcloudStoragecapacityTypesGetallOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type PcloudStoragecapacityTypesGetallOK struct { func (o *PcloudStoragecapacityTypesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallOK %+v", 200, o.Payload) } +func (o *PcloudStoragecapacityTypesGetallOK) GetPayload() *models.StorageTypesCapacity { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewPcloudStoragecapacityTypesGetallUnauthorized() *PcloudStoragecapacityTyp return &PcloudStoragecapacityTypesGetallUnauthorized{} } -/*PcloudStoragecapacityTypesGetallUnauthorized handles this case with default header values. +/* PcloudStoragecapacityTypesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -96,6 +94,9 @@ type PcloudStoragecapacityTypesGetallUnauthorized struct { func (o *PcloudStoragecapacityTypesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudStoragecapacityTypesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewPcloudStoragecapacityTypesGetallInternalServerError() *PcloudStoragecapa return &PcloudStoragecapacityTypesGetallInternalServerError{} } -/*PcloudStoragecapacityTypesGetallInternalServerError handles this case with default header values. +/* PcloudStoragecapacityTypesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -125,6 +126,9 @@ type PcloudStoragecapacityTypesGetallInternalServerError struct { func (o *PcloudStoragecapacityTypesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudStoragecapacityTypesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudStoragecapacityTypesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go index 6a3909dc0f..a94da9c21e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go @@ -6,13 +6,14 @@ package p_cloud_system_pools // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud system pools API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,25 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSystempoolsGetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudSystempoolsGet lists of available system pools within a particular data center + PcloudSystempoolsGet lists of available system pools within a particular data center */ -func (a *Client) PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudSystempoolsGetOK, error) { +func (a *Client) PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSystempoolsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudSystempoolsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.systempools.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools", @@ -45,12 +55,23 @@ func (a *Client) PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authIn AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudSystempoolsGetOK), nil - + success, ok := result.(*PcloudSystempoolsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.systempools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go index 842b8b6c9f..a727b64e5b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudSystempoolsGetParams creates a new PcloudSystempoolsGetParams object -// with the default values initialized. +// NewPcloudSystempoolsGetParams creates a new PcloudSystempoolsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudSystempoolsGetParams() *PcloudSystempoolsGetParams { - var () return &PcloudSystempoolsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudSystempoolsGetParamsWithTimeout creates a new PcloudSystempoolsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudSystempoolsGetParamsWithTimeout(timeout time.Duration) *PcloudSystempoolsGetParams { - var () return &PcloudSystempoolsGetParams{ - timeout: timeout, } } // NewPcloudSystempoolsGetParamsWithContext creates a new PcloudSystempoolsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudSystempoolsGetParamsWithContext(ctx context.Context) *PcloudSystempoolsGetParams { - var () return &PcloudSystempoolsGetParams{ - Context: ctx, } } // NewPcloudSystempoolsGetParamsWithHTTPClient creates a new PcloudSystempoolsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudSystempoolsGetParamsWithHTTPClient(client *http.Client) *PcloudSystempoolsGetParams { - var () return &PcloudSystempoolsGetParams{ HTTPClient: client, } } -/*PcloudSystempoolsGetParams contains all the parameters to send to the API endpoint -for the pcloud systempools get operation typically these are written to a http.Request +/* PcloudSystempoolsGetParams contains all the parameters to send to the API endpoint + for the pcloud systempools get operation. + + Typically these are written to a http.Request. */ type PcloudSystempoolsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudSystempoolsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud systempools get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSystempoolsGetParams) WithDefaults() *PcloudSystempoolsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud systempools get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSystempoolsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud systempools get params func (o *PcloudSystempoolsGetParams) WithTimeout(timeout time.Duration) *PcloudSystempoolsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go index 2f5aec49ef..78089d7a0f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudSystempoolsGetReader is a Reader for the PcloudSystempoolsGet structure. @@ -24,30 +23,26 @@ type PcloudSystempoolsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudSystempoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudSystempoolsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudSystempoolsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudSystempoolsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewPcloudSystempoolsGetOK() *PcloudSystempoolsGetOK { return &PcloudSystempoolsGetOK{} } -/*PcloudSystempoolsGetOK handles this case with default header values. +/* PcloudSystempoolsGetOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type PcloudSystempoolsGetOK struct { func (o *PcloudSystempoolsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetOK %+v", 200, o.Payload) } +func (o *PcloudSystempoolsGetOK) GetPayload() models.SystemPools { + return o.Payload +} func (o *PcloudSystempoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -83,7 +81,7 @@ func NewPcloudSystempoolsGetUnauthorized() *PcloudSystempoolsGetUnauthorized { return &PcloudSystempoolsGetUnauthorized{} } -/*PcloudSystempoolsGetUnauthorized handles this case with default header values. +/* PcloudSystempoolsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -94,6 +92,9 @@ type PcloudSystempoolsGetUnauthorized struct { func (o *PcloudSystempoolsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudSystempoolsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSystempoolsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -112,7 +113,7 @@ func NewPcloudSystempoolsGetInternalServerError() *PcloudSystempoolsGetInternalS return &PcloudSystempoolsGetInternalServerError{} } -/*PcloudSystempoolsGetInternalServerError handles this case with default header values. +/* PcloudSystempoolsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -123,6 +124,9 @@ type PcloudSystempoolsGetInternalServerError struct { func (o *PcloudSystempoolsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudSystempoolsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudSystempoolsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go index a9696ec2bc..22d71e5ec9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go @@ -6,13 +6,14 @@ package p_cloud_tasks // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud tasks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,27 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksDeleteOK, error) + + PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksGetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudTasksDelete deletes a task + PcloudTasksDelete deletes a task */ -func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTasksDeleteOK, error) { +func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTasksDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tasks.delete", Method: "DELETE", PathPattern: "/pcloud/v1/tasks/{task_id}", @@ -45,24 +57,34 @@ func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTasksDeleteOK), nil - + success, ok := result.(*PcloudTasksDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tasks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudTasksGet gets a task + PcloudTasksGet gets a task */ -func (a *Client) PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTasksGetOK, error) { +func (a *Client) PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTasksGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tasks.get", Method: "GET", PathPattern: "/pcloud/v1/tasks/{task_id}", @@ -74,12 +96,23 @@ func (a *Client) PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.C AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTasksGetOK), nil - + success, ok := result.(*PcloudTasksGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tasks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go index 8fda12b0e7..641d712bc8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudTasksDeleteParams creates a new PcloudTasksDeleteParams object -// with the default values initialized. +// NewPcloudTasksDeleteParams creates a new PcloudTasksDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTasksDeleteParams() *PcloudTasksDeleteParams { - var () return &PcloudTasksDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTasksDeleteParamsWithTimeout creates a new PcloudTasksDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTasksDeleteParamsWithTimeout(timeout time.Duration) *PcloudTasksDeleteParams { - var () return &PcloudTasksDeleteParams{ - timeout: timeout, } } // NewPcloudTasksDeleteParamsWithContext creates a new PcloudTasksDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTasksDeleteParamsWithContext(ctx context.Context) *PcloudTasksDeleteParams { - var () return &PcloudTasksDeleteParams{ - Context: ctx, } } // NewPcloudTasksDeleteParamsWithHTTPClient creates a new PcloudTasksDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTasksDeleteParamsWithHTTPClient(client *http.Client) *PcloudTasksDeleteParams { - var () return &PcloudTasksDeleteParams{ HTTPClient: client, } } -/*PcloudTasksDeleteParams contains all the parameters to send to the API endpoint -for the pcloud tasks delete operation typically these are written to a http.Request +/* PcloudTasksDeleteParams contains all the parameters to send to the API endpoint + for the pcloud tasks delete operation. + + Typically these are written to a http.Request. */ type PcloudTasksDeleteParams struct { - /*TaskID - PCloud Task ID + /* TaskID. + PCloud Task ID */ TaskID string @@ -72,6 +70,21 @@ type PcloudTasksDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tasks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTasksDeleteParams) WithDefaults() *PcloudTasksDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tasks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTasksDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tasks delete params func (o *PcloudTasksDeleteParams) WithTimeout(timeout time.Duration) *PcloudTasksDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go index d739a07ed9..63e82c8815 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTasksDeleteReader is a Reader for the PcloudTasksDelete structure. @@ -24,51 +23,44 @@ type PcloudTasksDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTasksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTasksDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTasksDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTasksDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudTasksDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudTasksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTasksDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudTasksDeleteOK() *PcloudTasksDeleteOK { return &PcloudTasksDeleteOK{} } -/*PcloudTasksDeleteOK handles this case with default header values. +/* PcloudTasksDeleteOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudTasksDeleteOK struct { func (o *PcloudTasksDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK %+v", 200, o.Payload) } +func (o *PcloudTasksDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudTasksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -104,7 +99,7 @@ func NewPcloudTasksDeleteBadRequest() *PcloudTasksDeleteBadRequest { return &PcloudTasksDeleteBadRequest{} } -/*PcloudTasksDeleteBadRequest handles this case with default header values. +/* PcloudTasksDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -115,6 +110,9 @@ type PcloudTasksDeleteBadRequest struct { func (o *PcloudTasksDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudTasksDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -133,7 +131,7 @@ func NewPcloudTasksDeleteUnauthorized() *PcloudTasksDeleteUnauthorized { return &PcloudTasksDeleteUnauthorized{} } -/*PcloudTasksDeleteUnauthorized handles this case with default header values. +/* PcloudTasksDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -144,6 +142,9 @@ type PcloudTasksDeleteUnauthorized struct { func (o *PcloudTasksDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTasksDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -162,7 +163,7 @@ func NewPcloudTasksDeleteNotFound() *PcloudTasksDeleteNotFound { return &PcloudTasksDeleteNotFound{} } -/*PcloudTasksDeleteNotFound handles this case with default header values. +/* PcloudTasksDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -173,6 +174,9 @@ type PcloudTasksDeleteNotFound struct { func (o *PcloudTasksDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudTasksDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -191,7 +195,7 @@ func NewPcloudTasksDeleteGone() *PcloudTasksDeleteGone { return &PcloudTasksDeleteGone{} } -/*PcloudTasksDeleteGone handles this case with default header values. +/* PcloudTasksDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -202,6 +206,9 @@ type PcloudTasksDeleteGone struct { func (o *PcloudTasksDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone %+v", 410, o.Payload) } +func (o *PcloudTasksDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,7 +227,7 @@ func NewPcloudTasksDeleteInternalServerError() *PcloudTasksDeleteInternalServerE return &PcloudTasksDeleteInternalServerError{} } -/*PcloudTasksDeleteInternalServerError handles this case with default header values. +/* PcloudTasksDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -231,6 +238,9 @@ type PcloudTasksDeleteInternalServerError struct { func (o *PcloudTasksDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTasksDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go index 23eee0bb16..756ff392bd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudTasksGetParams creates a new PcloudTasksGetParams object -// with the default values initialized. +// NewPcloudTasksGetParams creates a new PcloudTasksGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTasksGetParams() *PcloudTasksGetParams { - var () return &PcloudTasksGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTasksGetParamsWithTimeout creates a new PcloudTasksGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTasksGetParamsWithTimeout(timeout time.Duration) *PcloudTasksGetParams { - var () return &PcloudTasksGetParams{ - timeout: timeout, } } // NewPcloudTasksGetParamsWithContext creates a new PcloudTasksGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTasksGetParamsWithContext(ctx context.Context) *PcloudTasksGetParams { - var () return &PcloudTasksGetParams{ - Context: ctx, } } // NewPcloudTasksGetParamsWithHTTPClient creates a new PcloudTasksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTasksGetParamsWithHTTPClient(client *http.Client) *PcloudTasksGetParams { - var () return &PcloudTasksGetParams{ HTTPClient: client, } } -/*PcloudTasksGetParams contains all the parameters to send to the API endpoint -for the pcloud tasks get operation typically these are written to a http.Request +/* PcloudTasksGetParams contains all the parameters to send to the API endpoint + for the pcloud tasks get operation. + + Typically these are written to a http.Request. */ type PcloudTasksGetParams struct { - /*TaskID - PCloud Task ID + /* TaskID. + PCloud Task ID */ TaskID string @@ -72,6 +70,21 @@ type PcloudTasksGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tasks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTasksGetParams) WithDefaults() *PcloudTasksGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tasks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTasksGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tasks get params func (o *PcloudTasksGetParams) WithTimeout(timeout time.Duration) *PcloudTasksGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go index 2315afbbf0..607e52aa97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTasksGetReader is a Reader for the PcloudTasksGet structure. @@ -24,44 +23,38 @@ type PcloudTasksGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTasksGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTasksGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTasksGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudTasksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTasksGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudTasksGetOK() *PcloudTasksGetOK { return &PcloudTasksGetOK{} } -/*PcloudTasksGetOK handles this case with default header values. +/* PcloudTasksGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudTasksGetOK struct { func (o *PcloudTasksGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetOK %+v", 200, o.Payload) } +func (o *PcloudTasksGetOK) GetPayload() *models.Task { + return o.Payload +} func (o *PcloudTasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudTasksGetBadRequest() *PcloudTasksGetBadRequest { return &PcloudTasksGetBadRequest{} } -/*PcloudTasksGetBadRequest handles this case with default header values. +/* PcloudTasksGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudTasksGetBadRequest struct { func (o *PcloudTasksGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudTasksGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudTasksGetUnauthorized() *PcloudTasksGetUnauthorized { return &PcloudTasksGetUnauthorized{} } -/*PcloudTasksGetUnauthorized handles this case with default header values. +/* PcloudTasksGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudTasksGetUnauthorized struct { func (o *PcloudTasksGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTasksGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudTasksGetNotFound() *PcloudTasksGetNotFound { return &PcloudTasksGetNotFound{} } -/*PcloudTasksGetNotFound handles this case with default header values. +/* PcloudTasksGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudTasksGetNotFound struct { func (o *PcloudTasksGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetNotFound %+v", 404, o.Payload) } +func (o *PcloudTasksGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudTasksGetInternalServerError() *PcloudTasksGetInternalServerError { return &PcloudTasksGetInternalServerError{} } -/*PcloudTasksGetInternalServerError handles this case with default header values. +/* PcloudTasksGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudTasksGetInternalServerError struct { func (o *PcloudTasksGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTasksGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTasksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go index cdb69dcd82..48cd87d940 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go @@ -6,13 +6,14 @@ package p_cloud_tenants // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud tenants API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,27 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsGetOK, error) + + PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudTenantsGet gets a tenant s current state information + PcloudTenantsGet gets a tenant s current state information */ -func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsGetOK, error) { +func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.get", Method: "GET", PathPattern: "/pcloud/v1/tenants/{tenant_id}", @@ -45,24 +57,34 @@ func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runti AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTenantsGetOK), nil - + success, ok := result.(*PcloudTenantsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tenants.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudTenantsPut updates a tenant + PcloudTenantsPut updates a tenant */ -func (a *Client) PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsPutOK, error) { +func (a *Client) PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.put", Method: "PUT", PathPattern: "/pcloud/v1/tenants/{tenant_id}", @@ -74,12 +96,23 @@ func (a *Client) PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runti AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTenantsPutOK), nil - + success, ok := result.(*PcloudTenantsPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tenants.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go index d307eed31b..f6106baeb1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudTenantsGetParams creates a new PcloudTenantsGetParams object -// with the default values initialized. +// NewPcloudTenantsGetParams creates a new PcloudTenantsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsGetParams() *PcloudTenantsGetParams { - var () return &PcloudTenantsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsGetParamsWithTimeout creates a new PcloudTenantsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsGetParamsWithTimeout(timeout time.Duration) *PcloudTenantsGetParams { - var () return &PcloudTenantsGetParams{ - timeout: timeout, } } // NewPcloudTenantsGetParamsWithContext creates a new PcloudTenantsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsGetParamsWithContext(ctx context.Context) *PcloudTenantsGetParams { - var () return &PcloudTenantsGetParams{ - Context: ctx, } } // NewPcloudTenantsGetParamsWithHTTPClient creates a new PcloudTenantsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsGetParamsWithHTTPClient(client *http.Client) *PcloudTenantsGetParams { - var () return &PcloudTenantsGetParams{ HTTPClient: client, } } -/*PcloudTenantsGetParams contains all the parameters to send to the API endpoint -for the pcloud tenants get operation typically these are written to a http.Request +/* PcloudTenantsGetParams contains all the parameters to send to the API endpoint + for the pcloud tenants get operation. + + Typically these are written to a http.Request. */ type PcloudTenantsGetParams struct { - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + Tenant ID of a pcloud tenant */ TenantID string @@ -72,6 +70,21 @@ type PcloudTenantsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsGetParams) WithDefaults() *PcloudTenantsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants get params func (o *PcloudTenantsGetParams) WithTimeout(timeout time.Duration) *PcloudTenantsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go index 1f6d920214..a6ca273143 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsGetReader is a Reader for the PcloudTenantsGet structure. @@ -24,51 +23,44 @@ type PcloudTenantsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudTenantsGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudTenantsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudTenantsGetOK() *PcloudTenantsGetOK { return &PcloudTenantsGetOK{} } -/*PcloudTenantsGetOK handles this case with default header values. +/* PcloudTenantsGetOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudTenantsGetOK struct { func (o *PcloudTenantsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetOK %+v", 200, o.Payload) } +func (o *PcloudTenantsGetOK) GetPayload() *models.Tenant { + return o.Payload +} func (o *PcloudTenantsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudTenantsGetBadRequest() *PcloudTenantsGetBadRequest { return &PcloudTenantsGetBadRequest{} } -/*PcloudTenantsGetBadRequest handles this case with default header values. +/* PcloudTenantsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudTenantsGetBadRequest struct { func (o *PcloudTenantsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudTenantsGetUnauthorized() *PcloudTenantsGetUnauthorized { return &PcloudTenantsGetUnauthorized{} } -/*PcloudTenantsGetUnauthorized handles this case with default header values. +/* PcloudTenantsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudTenantsGetUnauthorized struct { func (o *PcloudTenantsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudTenantsGetForbidden() *PcloudTenantsGetForbidden { return &PcloudTenantsGetForbidden{} } -/*PcloudTenantsGetForbidden handles this case with default header values. +/* PcloudTenantsGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudTenantsGetForbidden struct { func (o *PcloudTenantsGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %+v", 403, o.Payload) } +func (o *PcloudTenantsGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudTenantsGetNotFound() *PcloudTenantsGetNotFound { return &PcloudTenantsGetNotFound{} } -/*PcloudTenantsGetNotFound handles this case with default header values. +/* PcloudTenantsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudTenantsGetNotFound struct { func (o *PcloudTenantsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudTenantsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudTenantsGetInternalServerError() *PcloudTenantsGetInternalServerErr return &PcloudTenantsGetInternalServerError{} } -/*PcloudTenantsGetInternalServerError handles this case with default header values. +/* PcloudTenantsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudTenantsGetInternalServerError struct { func (o *PcloudTenantsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go index f481bbbcd4..182262c513 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudTenantsPutParams creates a new PcloudTenantsPutParams object -// with the default values initialized. +// NewPcloudTenantsPutParams creates a new PcloudTenantsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsPutParams() *PcloudTenantsPutParams { - var () return &PcloudTenantsPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsPutParamsWithTimeout creates a new PcloudTenantsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsPutParamsWithTimeout(timeout time.Duration) *PcloudTenantsPutParams { - var () return &PcloudTenantsPutParams{ - timeout: timeout, } } // NewPcloudTenantsPutParamsWithContext creates a new PcloudTenantsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsPutParamsWithContext(ctx context.Context) *PcloudTenantsPutParams { - var () return &PcloudTenantsPutParams{ - Context: ctx, } } // NewPcloudTenantsPutParamsWithHTTPClient creates a new PcloudTenantsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsPutParamsWithHTTPClient(client *http.Client) *PcloudTenantsPutParams { - var () return &PcloudTenantsPutParams{ HTTPClient: client, } } -/*PcloudTenantsPutParams contains all the parameters to send to the API endpoint -for the pcloud tenants put operation typically these are written to a http.Request +/* PcloudTenantsPutParams contains all the parameters to send to the API endpoint + for the pcloud tenants put operation. + + Typically these are written to a http.Request. */ type PcloudTenantsPutParams struct { - /*Body - Parameters for updating a Tenant + /* Body. + Parameters for updating a Tenant */ Body *models.TenantUpdate - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + + Tenant ID of a pcloud tenant */ TenantID string @@ -79,6 +78,21 @@ type PcloudTenantsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsPutParams) WithDefaults() *PcloudTenantsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants put params func (o *PcloudTenantsPutParams) WithTimeout(timeout time.Duration) *PcloudTenantsPutParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudTenantsPutParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go index d81ccd0f3b..75fec044d2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsPutReader is a Reader for the PcloudTenantsPut structure. @@ -24,44 +23,38 @@ type PcloudTenantsPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudTenantsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudTenantsPutOK() *PcloudTenantsPutOK { return &PcloudTenantsPutOK{} } -/*PcloudTenantsPutOK handles this case with default header values. +/* PcloudTenantsPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudTenantsPutOK struct { func (o *PcloudTenantsPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutOK %+v", 200, o.Payload) } +func (o *PcloudTenantsPutOK) GetPayload() *models.Tenant { + return o.Payload +} func (o *PcloudTenantsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudTenantsPutBadRequest() *PcloudTenantsPutBadRequest { return &PcloudTenantsPutBadRequest{} } -/*PcloudTenantsPutBadRequest handles this case with default header values. +/* PcloudTenantsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudTenantsPutBadRequest struct { func (o *PcloudTenantsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudTenantsPutUnauthorized() *PcloudTenantsPutUnauthorized { return &PcloudTenantsPutUnauthorized{} } -/*PcloudTenantsPutUnauthorized handles this case with default header values. +/* PcloudTenantsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudTenantsPutUnauthorized struct { func (o *PcloudTenantsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudTenantsPutUnprocessableEntity() *PcloudTenantsPutUnprocessableEnti return &PcloudTenantsPutUnprocessableEntity{} } -/*PcloudTenantsPutUnprocessableEntity handles this case with default header values. +/* PcloudTenantsPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudTenantsPutUnprocessableEntity struct { func (o *PcloudTenantsPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudTenantsPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudTenantsPutInternalServerError() *PcloudTenantsPutInternalServerErr return &PcloudTenantsPutInternalServerError{} } -/*PcloudTenantsPutInternalServerError handles this case with default header values. +/* PcloudTenantsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudTenantsPutInternalServerError struct { func (o *PcloudTenantsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go index 4f74cbbe31..d05737fe80 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go @@ -6,13 +6,14 @@ package p_cloud_tenants_ssh_keys // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud tenants ssh keys API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,33 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysDeleteOK, error) + + PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetOK, error) + + PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetallOK, error) + + PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPostOK, *PcloudTenantsSshkeysPostCreated, error) + + PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudTenantsSshkeysDelete deletes a tenant s SSH key + PcloudTenantsSshkeysDelete deletes a tenant s SSH key */ -func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsSshkeysDeleteOK, error) { +func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsSshkeysDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.sshkeys.delete", Method: "DELETE", PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}", @@ -45,24 +63,34 @@ func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeletePa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTenantsSshkeysDeleteOK), nil - + success, ok := result.(*PcloudTenantsSshkeysDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudTenantsSshkeysGet gets a tenant s SSH key by name + PcloudTenantsSshkeysGet gets a tenant s SSH key by name */ -func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsSshkeysGetOK, error) { +func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsSshkeysGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.sshkeys.get", Method: "GET", PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}", @@ -74,24 +102,34 @@ func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTenantsSshkeysGetOK), nil - + success, ok := result.(*PcloudTenantsSshkeysGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudTenantsSshkeysGetall lists a tenant s SSH keys + PcloudTenantsSshkeysGetall lists a tenant s SSH keys */ -func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsSshkeysGetallOK, error) { +func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsSshkeysGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.sshkeys.getall", Method: "GET", PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys", @@ -103,24 +141,34 @@ func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallPa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTenantsSshkeysGetallOK), nil - + success, ok := result.(*PcloudTenantsSshkeysGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudTenantsSshkeysPost adds a new SSH key to the tenant + PcloudTenantsSshkeysPost adds a new SSH key to the tenant */ -func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsSshkeysPostOK, *PcloudTenantsSshkeysPostCreated, error) { +func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPostOK, *PcloudTenantsSshkeysPostCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsSshkeysPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.sshkeys.post", Method: "POST", PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys", @@ -132,7 +180,12 @@ func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -142,20 +195,20 @@ func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams case *PcloudTenantsSshkeysPostCreated: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for p_cloud_tenants_ssh_keys: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudTenantsSshkeysPut updates an SSH key + PcloudTenantsSshkeysPut updates an SSH key */ -func (a *Client) PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudTenantsSshkeysPutOK, error) { +func (a *Client) PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudTenantsSshkeysPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.tenants.sshkeys.put", Method: "PUT", PathPattern: "/pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}", @@ -167,12 +220,23 @@ func (a *Client) PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudTenantsSshkeysPutOK), nil - + success, ok := result.(*PcloudTenantsSshkeysPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go index dce57f3816..0de6c32d74 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudTenantsSshkeysDeleteParams creates a new PcloudTenantsSshkeysDeleteParams object -// with the default values initialized. +// NewPcloudTenantsSshkeysDeleteParams creates a new PcloudTenantsSshkeysDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsSshkeysDeleteParams() *PcloudTenantsSshkeysDeleteParams { - var () return &PcloudTenantsSshkeysDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsSshkeysDeleteParamsWithTimeout creates a new PcloudTenantsSshkeysDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsSshkeysDeleteParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysDeleteParams { - var () return &PcloudTenantsSshkeysDeleteParams{ - timeout: timeout, } } // NewPcloudTenantsSshkeysDeleteParamsWithContext creates a new PcloudTenantsSshkeysDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsSshkeysDeleteParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysDeleteParams { - var () return &PcloudTenantsSshkeysDeleteParams{ - Context: ctx, } } // NewPcloudTenantsSshkeysDeleteParamsWithHTTPClient creates a new PcloudTenantsSshkeysDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsSshkeysDeleteParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysDeleteParams { - var () return &PcloudTenantsSshkeysDeleteParams{ HTTPClient: client, } } -/*PcloudTenantsSshkeysDeleteParams contains all the parameters to send to the API endpoint -for the pcloud tenants sshkeys delete operation typically these are written to a http.Request +/* PcloudTenantsSshkeysDeleteParams contains all the parameters to send to the API endpoint + for the pcloud tenants sshkeys delete operation. + + Typically these are written to a http.Request. */ type PcloudTenantsSshkeysDeleteParams struct { - /*SshkeyName - SSH key name for a pcloud tenant + /* SshkeyName. + SSH key name for a pcloud tenant */ SshkeyName string - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + + Tenant ID of a pcloud tenant */ TenantID string @@ -77,6 +76,21 @@ type PcloudTenantsSshkeysDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants sshkeys delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysDeleteParams) WithDefaults() *PcloudTenantsSshkeysDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants sshkeys delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants sshkeys delete params func (o *PcloudTenantsSshkeysDeleteParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go index fd350dd982..2c0f8aa23d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsSshkeysDeleteReader is a Reader for the PcloudTenantsSshkeysDelete structure. @@ -24,44 +23,38 @@ type PcloudTenantsSshkeysDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsSshkeysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsSshkeysDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsSshkeysDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsSshkeysDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudTenantsSshkeysDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsSshkeysDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudTenantsSshkeysDeleteOK() *PcloudTenantsSshkeysDeleteOK { return &PcloudTenantsSshkeysDeleteOK{} } -/*PcloudTenantsSshkeysDeleteOK handles this case with default header values. +/* PcloudTenantsSshkeysDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudTenantsSshkeysDeleteOK struct { func (o *PcloudTenantsSshkeysDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteOK %+v", 200, o.Payload) } +func (o *PcloudTenantsSshkeysDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudTenantsSshkeysDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudTenantsSshkeysDeleteBadRequest() *PcloudTenantsSshkeysDeleteBadReq return &PcloudTenantsSshkeysDeleteBadRequest{} } -/*PcloudTenantsSshkeysDeleteBadRequest handles this case with default header values. +/* PcloudTenantsSshkeysDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudTenantsSshkeysDeleteBadRequest struct { func (o *PcloudTenantsSshkeysDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsSshkeysDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudTenantsSshkeysDeleteUnauthorized() *PcloudTenantsSshkeysDeleteUnau return &PcloudTenantsSshkeysDeleteUnauthorized{} } -/*PcloudTenantsSshkeysDeleteUnauthorized handles this case with default header values. +/* PcloudTenantsSshkeysDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudTenantsSshkeysDeleteUnauthorized struct { func (o *PcloudTenantsSshkeysDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsSshkeysDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudTenantsSshkeysDeleteGone() *PcloudTenantsSshkeysDeleteGone { return &PcloudTenantsSshkeysDeleteGone{} } -/*PcloudTenantsSshkeysDeleteGone handles this case with default header values. +/* PcloudTenantsSshkeysDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudTenantsSshkeysDeleteGone struct { func (o *PcloudTenantsSshkeysDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteGone %+v", 410, o.Payload) } +func (o *PcloudTenantsSshkeysDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudTenantsSshkeysDeleteInternalServerError() *PcloudTenantsSshkeysDel return &PcloudTenantsSshkeysDeleteInternalServerError{} } -/*PcloudTenantsSshkeysDeleteInternalServerError handles this case with default header values. +/* PcloudTenantsSshkeysDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudTenantsSshkeysDeleteInternalServerError struct { func (o *PcloudTenantsSshkeysDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsSshkeysDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go index 052ac742c1..574cc6ae91 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudTenantsSshkeysGetParams creates a new PcloudTenantsSshkeysGetParams object -// with the default values initialized. +// NewPcloudTenantsSshkeysGetParams creates a new PcloudTenantsSshkeysGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsSshkeysGetParams() *PcloudTenantsSshkeysGetParams { - var () return &PcloudTenantsSshkeysGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsSshkeysGetParamsWithTimeout creates a new PcloudTenantsSshkeysGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsSshkeysGetParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetParams { - var () return &PcloudTenantsSshkeysGetParams{ - timeout: timeout, } } // NewPcloudTenantsSshkeysGetParamsWithContext creates a new PcloudTenantsSshkeysGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsSshkeysGetParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysGetParams { - var () return &PcloudTenantsSshkeysGetParams{ - Context: ctx, } } // NewPcloudTenantsSshkeysGetParamsWithHTTPClient creates a new PcloudTenantsSshkeysGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsSshkeysGetParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysGetParams { - var () return &PcloudTenantsSshkeysGetParams{ HTTPClient: client, } } -/*PcloudTenantsSshkeysGetParams contains all the parameters to send to the API endpoint -for the pcloud tenants sshkeys get operation typically these are written to a http.Request +/* PcloudTenantsSshkeysGetParams contains all the parameters to send to the API endpoint + for the pcloud tenants sshkeys get operation. + + Typically these are written to a http.Request. */ type PcloudTenantsSshkeysGetParams struct { - /*SshkeyName - SSH key name for a pcloud tenant + /* SshkeyName. + SSH key name for a pcloud tenant */ SshkeyName string - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + + Tenant ID of a pcloud tenant */ TenantID string @@ -77,6 +76,21 @@ type PcloudTenantsSshkeysGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants sshkeys get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysGetParams) WithDefaults() *PcloudTenantsSshkeysGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants sshkeys get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants sshkeys get params func (o *PcloudTenantsSshkeysGetParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go index bc40960ed5..f49bad3c0d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsSshkeysGetReader is a Reader for the PcloudTenantsSshkeysGet structure. @@ -24,44 +23,38 @@ type PcloudTenantsSshkeysGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsSshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsSshkeysGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsSshkeysGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsSshkeysGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudTenantsSshkeysGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsSshkeysGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudTenantsSshkeysGetOK() *PcloudTenantsSshkeysGetOK { return &PcloudTenantsSshkeysGetOK{} } -/*PcloudTenantsSshkeysGetOK handles this case with default header values. +/* PcloudTenantsSshkeysGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudTenantsSshkeysGetOK struct { func (o *PcloudTenantsSshkeysGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK %+v", 200, o.Payload) } +func (o *PcloudTenantsSshkeysGetOK) GetPayload() *models.SSHKey { + return o.Payload +} func (o *PcloudTenantsSshkeysGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudTenantsSshkeysGetBadRequest() *PcloudTenantsSshkeysGetBadRequest { return &PcloudTenantsSshkeysGetBadRequest{} } -/*PcloudTenantsSshkeysGetBadRequest handles this case with default header values. +/* PcloudTenantsSshkeysGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudTenantsSshkeysGetBadRequest struct { func (o *PcloudTenantsSshkeysGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsSshkeysGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudTenantsSshkeysGetUnauthorized() *PcloudTenantsSshkeysGetUnauthoriz return &PcloudTenantsSshkeysGetUnauthorized{} } -/*PcloudTenantsSshkeysGetUnauthorized handles this case with default header values. +/* PcloudTenantsSshkeysGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudTenantsSshkeysGetUnauthorized struct { func (o *PcloudTenantsSshkeysGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsSshkeysGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudTenantsSshkeysGetNotFound() *PcloudTenantsSshkeysGetNotFound { return &PcloudTenantsSshkeysGetNotFound{} } -/*PcloudTenantsSshkeysGetNotFound handles this case with default header values. +/* PcloudTenantsSshkeysGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudTenantsSshkeysGetNotFound struct { func (o *PcloudTenantsSshkeysGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound %+v", 404, o.Payload) } +func (o *PcloudTenantsSshkeysGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudTenantsSshkeysGetInternalServerError() *PcloudTenantsSshkeysGetInt return &PcloudTenantsSshkeysGetInternalServerError{} } -/*PcloudTenantsSshkeysGetInternalServerError handles this case with default header values. +/* PcloudTenantsSshkeysGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudTenantsSshkeysGetInternalServerError struct { func (o *PcloudTenantsSshkeysGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsSshkeysGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go index 66bbb51fe6..0e0e30b041 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudTenantsSshkeysGetallParams creates a new PcloudTenantsSshkeysGetallParams object -// with the default values initialized. +// NewPcloudTenantsSshkeysGetallParams creates a new PcloudTenantsSshkeysGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsSshkeysGetallParams() *PcloudTenantsSshkeysGetallParams { - var () return &PcloudTenantsSshkeysGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsSshkeysGetallParamsWithTimeout creates a new PcloudTenantsSshkeysGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsSshkeysGetallParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetallParams { - var () return &PcloudTenantsSshkeysGetallParams{ - timeout: timeout, } } // NewPcloudTenantsSshkeysGetallParamsWithContext creates a new PcloudTenantsSshkeysGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsSshkeysGetallParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysGetallParams { - var () return &PcloudTenantsSshkeysGetallParams{ - Context: ctx, } } // NewPcloudTenantsSshkeysGetallParamsWithHTTPClient creates a new PcloudTenantsSshkeysGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsSshkeysGetallParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysGetallParams { - var () return &PcloudTenantsSshkeysGetallParams{ HTTPClient: client, } } -/*PcloudTenantsSshkeysGetallParams contains all the parameters to send to the API endpoint -for the pcloud tenants sshkeys getall operation typically these are written to a http.Request +/* PcloudTenantsSshkeysGetallParams contains all the parameters to send to the API endpoint + for the pcloud tenants sshkeys getall operation. + + Typically these are written to a http.Request. */ type PcloudTenantsSshkeysGetallParams struct { - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + Tenant ID of a pcloud tenant */ TenantID string @@ -72,6 +70,21 @@ type PcloudTenantsSshkeysGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants sshkeys getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysGetallParams) WithDefaults() *PcloudTenantsSshkeysGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants sshkeys getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants sshkeys getall params func (o *PcloudTenantsSshkeysGetallParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go index 0405bfdb59..700ea0eb98 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsSshkeysGetallReader is a Reader for the PcloudTenantsSshkeysGetall structure. @@ -24,44 +23,38 @@ type PcloudTenantsSshkeysGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsSshkeysGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsSshkeysGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsSshkeysGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsSshkeysGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudTenantsSshkeysGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsSshkeysGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudTenantsSshkeysGetallOK() *PcloudTenantsSshkeysGetallOK { return &PcloudTenantsSshkeysGetallOK{} } -/*PcloudTenantsSshkeysGetallOK handles this case with default header values. +/* PcloudTenantsSshkeysGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudTenantsSshkeysGetallOK struct { func (o *PcloudTenantsSshkeysGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallOK %+v", 200, o.Payload) } +func (o *PcloudTenantsSshkeysGetallOK) GetPayload() *models.SSHKeys { + return o.Payload +} func (o *PcloudTenantsSshkeysGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudTenantsSshkeysGetallBadRequest() *PcloudTenantsSshkeysGetallBadReq return &PcloudTenantsSshkeysGetallBadRequest{} } -/*PcloudTenantsSshkeysGetallBadRequest handles this case with default header values. +/* PcloudTenantsSshkeysGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudTenantsSshkeysGetallBadRequest struct { func (o *PcloudTenantsSshkeysGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsSshkeysGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudTenantsSshkeysGetallUnauthorized() *PcloudTenantsSshkeysGetallUnau return &PcloudTenantsSshkeysGetallUnauthorized{} } -/*PcloudTenantsSshkeysGetallUnauthorized handles this case with default header values. +/* PcloudTenantsSshkeysGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudTenantsSshkeysGetallUnauthorized struct { func (o *PcloudTenantsSshkeysGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsSshkeysGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudTenantsSshkeysGetallNotFound() *PcloudTenantsSshkeysGetallNotFound return &PcloudTenantsSshkeysGetallNotFound{} } -/*PcloudTenantsSshkeysGetallNotFound handles this case with default header values. +/* PcloudTenantsSshkeysGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudTenantsSshkeysGetallNotFound struct { func (o *PcloudTenantsSshkeysGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudTenantsSshkeysGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudTenantsSshkeysGetallInternalServerError() *PcloudTenantsSshkeysGet return &PcloudTenantsSshkeysGetallInternalServerError{} } -/*PcloudTenantsSshkeysGetallInternalServerError handles this case with default header values. +/* PcloudTenantsSshkeysGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudTenantsSshkeysGetallInternalServerError struct { func (o *PcloudTenantsSshkeysGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsSshkeysGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go index cdc2326209..0f65423a5e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudTenantsSshkeysPostParams creates a new PcloudTenantsSshkeysPostParams object -// with the default values initialized. +// NewPcloudTenantsSshkeysPostParams creates a new PcloudTenantsSshkeysPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsSshkeysPostParams() *PcloudTenantsSshkeysPostParams { - var () return &PcloudTenantsSshkeysPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsSshkeysPostParamsWithTimeout creates a new PcloudTenantsSshkeysPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsSshkeysPostParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPostParams { - var () return &PcloudTenantsSshkeysPostParams{ - timeout: timeout, } } // NewPcloudTenantsSshkeysPostParamsWithContext creates a new PcloudTenantsSshkeysPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsSshkeysPostParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysPostParams { - var () return &PcloudTenantsSshkeysPostParams{ - Context: ctx, } } // NewPcloudTenantsSshkeysPostParamsWithHTTPClient creates a new PcloudTenantsSshkeysPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsSshkeysPostParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysPostParams { - var () return &PcloudTenantsSshkeysPostParams{ HTTPClient: client, } } -/*PcloudTenantsSshkeysPostParams contains all the parameters to send to the API endpoint -for the pcloud tenants sshkeys post operation typically these are written to a http.Request +/* PcloudTenantsSshkeysPostParams contains all the parameters to send to the API endpoint + for the pcloud tenants sshkeys post operation. + + Typically these are written to a http.Request. */ type PcloudTenantsSshkeysPostParams struct { - /*Body - Parameters for the creation of a new SSH key + /* Body. + Parameters for the creation of a new SSH key */ Body *models.SSHKey - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + + Tenant ID of a pcloud tenant */ TenantID string @@ -79,6 +78,21 @@ type PcloudTenantsSshkeysPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants sshkeys post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysPostParams) WithDefaults() *PcloudTenantsSshkeysPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants sshkeys post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants sshkeys post params func (o *PcloudTenantsSshkeysPostParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudTenantsSshkeysPostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go index 53e307ebcb..2717b7ea58 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsSshkeysPostReader is a Reader for the PcloudTenantsSshkeysPost structure. @@ -24,58 +23,50 @@ type PcloudTenantsSshkeysPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsSshkeysPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsSshkeysPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewPcloudTenantsSshkeysPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsSshkeysPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsSshkeysPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudTenantsSshkeysPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudTenantsSshkeysPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsSshkeysPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudTenantsSshkeysPostOK() *PcloudTenantsSshkeysPostOK { return &PcloudTenantsSshkeysPostOK{} } -/*PcloudTenantsSshkeysPostOK handles this case with default header values. +/* PcloudTenantsSshkeysPostOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudTenantsSshkeysPostOK struct { func (o *PcloudTenantsSshkeysPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostOK %+v", 200, o.Payload) } +func (o *PcloudTenantsSshkeysPostOK) GetPayload() *models.SSHKey { + return o.Payload +} func (o *PcloudTenantsSshkeysPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudTenantsSshkeysPostCreated() *PcloudTenantsSshkeysPostCreated { return &PcloudTenantsSshkeysPostCreated{} } -/*PcloudTenantsSshkeysPostCreated handles this case with default header values. +/* PcloudTenantsSshkeysPostCreated describes a response with status code 201, with default header values. Created */ @@ -124,6 +118,9 @@ type PcloudTenantsSshkeysPostCreated struct { func (o *PcloudTenantsSshkeysPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostCreated %+v", 201, o.Payload) } +func (o *PcloudTenantsSshkeysPostCreated) GetPayload() *models.SSHKey { + return o.Payload +} func (o *PcloudTenantsSshkeysPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudTenantsSshkeysPostBadRequest() *PcloudTenantsSshkeysPostBadRequest return &PcloudTenantsSshkeysPostBadRequest{} } -/*PcloudTenantsSshkeysPostBadRequest handles this case with default header values. +/* PcloudTenantsSshkeysPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -153,6 +150,9 @@ type PcloudTenantsSshkeysPostBadRequest struct { func (o *PcloudTenantsSshkeysPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsSshkeysPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudTenantsSshkeysPostUnauthorized() *PcloudTenantsSshkeysPostUnauthor return &PcloudTenantsSshkeysPostUnauthorized{} } -/*PcloudTenantsSshkeysPostUnauthorized handles this case with default header values. +/* PcloudTenantsSshkeysPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -182,6 +182,9 @@ type PcloudTenantsSshkeysPostUnauthorized struct { func (o *PcloudTenantsSshkeysPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsSshkeysPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudTenantsSshkeysPostConflict() *PcloudTenantsSshkeysPostConflict { return &PcloudTenantsSshkeysPostConflict{} } -/*PcloudTenantsSshkeysPostConflict handles this case with default header values. +/* PcloudTenantsSshkeysPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudTenantsSshkeysPostConflict struct { func (o *PcloudTenantsSshkeysPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostConflict %+v", 409, o.Payload) } +func (o *PcloudTenantsSshkeysPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudTenantsSshkeysPostUnprocessableEntity() *PcloudTenantsSshkeysPostU return &PcloudTenantsSshkeysPostUnprocessableEntity{} } -/*PcloudTenantsSshkeysPostUnprocessableEntity handles this case with default header values. +/* PcloudTenantsSshkeysPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudTenantsSshkeysPostUnprocessableEntity struct { func (o *PcloudTenantsSshkeysPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudTenantsSshkeysPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudTenantsSshkeysPostInternalServerError() *PcloudTenantsSshkeysPostI return &PcloudTenantsSshkeysPostInternalServerError{} } -/*PcloudTenantsSshkeysPostInternalServerError handles this case with default header values. +/* PcloudTenantsSshkeysPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudTenantsSshkeysPostInternalServerError struct { func (o *PcloudTenantsSshkeysPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsSshkeysPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go index 79f482c3e6..af53274505 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudTenantsSshkeysPutParams creates a new PcloudTenantsSshkeysPutParams object -// with the default values initialized. +// NewPcloudTenantsSshkeysPutParams creates a new PcloudTenantsSshkeysPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudTenantsSshkeysPutParams() *PcloudTenantsSshkeysPutParams { - var () return &PcloudTenantsSshkeysPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudTenantsSshkeysPutParamsWithTimeout creates a new PcloudTenantsSshkeysPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudTenantsSshkeysPutParamsWithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPutParams { - var () return &PcloudTenantsSshkeysPutParams{ - timeout: timeout, } } // NewPcloudTenantsSshkeysPutParamsWithContext creates a new PcloudTenantsSshkeysPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudTenantsSshkeysPutParamsWithContext(ctx context.Context) *PcloudTenantsSshkeysPutParams { - var () return &PcloudTenantsSshkeysPutParams{ - Context: ctx, } } // NewPcloudTenantsSshkeysPutParamsWithHTTPClient creates a new PcloudTenantsSshkeysPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudTenantsSshkeysPutParamsWithHTTPClient(client *http.Client) *PcloudTenantsSshkeysPutParams { - var () return &PcloudTenantsSshkeysPutParams{ HTTPClient: client, } } -/*PcloudTenantsSshkeysPutParams contains all the parameters to send to the API endpoint -for the pcloud tenants sshkeys put operation typically these are written to a http.Request +/* PcloudTenantsSshkeysPutParams contains all the parameters to send to the API endpoint + for the pcloud tenants sshkeys put operation. + + Typically these are written to a http.Request. */ type PcloudTenantsSshkeysPutParams struct { - /*Body - Parameters for updating a Tenant's SSH Key + /* Body. + Parameters for updating a Tenant's SSH Key */ Body *models.SSHKey - /*SshkeyName - SSH key name for a pcloud tenant + /* SshkeyName. + + SSH key name for a pcloud tenant */ SshkeyName string - /*TenantID - Tenant ID of a pcloud tenant + /* TenantID. + + Tenant ID of a pcloud tenant */ TenantID string @@ -84,6 +84,21 @@ type PcloudTenantsSshkeysPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud tenants sshkeys put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysPutParams) WithDefaults() *PcloudTenantsSshkeysPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud tenants sshkeys put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudTenantsSshkeysPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud tenants sshkeys put params func (o *PcloudTenantsSshkeysPutParams) WithTimeout(timeout time.Duration) *PcloudTenantsSshkeysPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudTenantsSshkeysPutParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go index a15df56827..5d091866f5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudTenantsSshkeysPutReader is a Reader for the PcloudTenantsSshkeysPut structure. @@ -24,44 +23,38 @@ type PcloudTenantsSshkeysPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudTenantsSshkeysPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudTenantsSshkeysPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudTenantsSshkeysPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudTenantsSshkeysPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudTenantsSshkeysPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudTenantsSshkeysPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudTenantsSshkeysPutOK() *PcloudTenantsSshkeysPutOK { return &PcloudTenantsSshkeysPutOK{} } -/*PcloudTenantsSshkeysPutOK handles this case with default header values. +/* PcloudTenantsSshkeysPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudTenantsSshkeysPutOK struct { func (o *PcloudTenantsSshkeysPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutOK %+v", 200, o.Payload) } +func (o *PcloudTenantsSshkeysPutOK) GetPayload() *models.SSHKey { + return o.Payload +} func (o *PcloudTenantsSshkeysPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudTenantsSshkeysPutBadRequest() *PcloudTenantsSshkeysPutBadRequest { return &PcloudTenantsSshkeysPutBadRequest{} } -/*PcloudTenantsSshkeysPutBadRequest handles this case with default header values. +/* PcloudTenantsSshkeysPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudTenantsSshkeysPutBadRequest struct { func (o *PcloudTenantsSshkeysPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudTenantsSshkeysPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudTenantsSshkeysPutUnauthorized() *PcloudTenantsSshkeysPutUnauthoriz return &PcloudTenantsSshkeysPutUnauthorized{} } -/*PcloudTenantsSshkeysPutUnauthorized handles this case with default header values. +/* PcloudTenantsSshkeysPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudTenantsSshkeysPutUnauthorized struct { func (o *PcloudTenantsSshkeysPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudTenantsSshkeysPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudTenantsSshkeysPutUnprocessableEntity() *PcloudTenantsSshkeysPutUnp return &PcloudTenantsSshkeysPutUnprocessableEntity{} } -/*PcloudTenantsSshkeysPutUnprocessableEntity handles this case with default header values. +/* PcloudTenantsSshkeysPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -168,6 +170,9 @@ type PcloudTenantsSshkeysPutUnprocessableEntity struct { func (o *PcloudTenantsSshkeysPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudTenantsSshkeysPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudTenantsSshkeysPutInternalServerError() *PcloudTenantsSshkeysPutInt return &PcloudTenantsSshkeysPutInternalServerError{} } -/*PcloudTenantsSshkeysPutInternalServerError handles this case with default header values. +/* PcloudTenantsSshkeysPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudTenantsSshkeysPutInternalServerError struct { func (o *PcloudTenantsSshkeysPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudTenantsSshkeysPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudTenantsSshkeysPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloud_v_p_n_connections_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloud_v_p_n_connections_client.go deleted file mode 100644 index 0c7e4f586b..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloud_v_p_n_connections_client.go +++ /dev/null @@ -1,371 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_connections - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud v p n connections API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for p cloud v p n connections API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -PcloudVpnconnectionsDelete deletes v p n connection - -Delete VPN Connection (by its identifier) -*/ -func (a *Client) PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsDeleteAccepted), nil - -} - -/* -PcloudVpnconnectionsGet gets v p n connection - -Get a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsGetOK), nil - -} - -/* -PcloudVpnconnectionsGetall gets all v p n connections - -Get all VPN Connections -*/ -func (a *Client) PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsGetallOK), nil - -} - -/* -PcloudVpnconnectionsNetworksDelete detaches network - -Detach network from a specific VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsNetworksDeleteAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsNetworksDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.networks.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsNetworksDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsNetworksDeleteAccepted), nil - -} - -/* -PcloudVpnconnectionsNetworksGet gets attached networks - -Get a list of network IDs attached to a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsNetworksGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsNetworksGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.networks.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsNetworksGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsNetworksGetOK), nil - -} - -/* -PcloudVpnconnectionsNetworksPut attaches network - -Attach a network to a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsNetworksPutAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsNetworksPutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.networks.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsNetworksPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsNetworksPutAccepted), nil - -} - -/* -PcloudVpnconnectionsPeersubnetsDelete detaches peer subnet - -Detach peer subnet from a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnectionsPeersubnetsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsPeersubnetsDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPeersubnetsDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.peersubnets.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPeersubnetsDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsPeersubnetsDeleteOK), nil - -} - -/* -PcloudVpnconnectionsPeersubnetsGet gets peer subnets - -Get a list of peer subnets attached to a specific VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnectionsPeersubnetsGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsPeersubnetsGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPeersubnetsGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.peersubnets.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPeersubnetsGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsPeersubnetsGetOK), nil - -} - -/* -PcloudVpnconnectionsPeersubnetsPut attaches peer subnet - -Attach peer subnet to a VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnectionsPeersubnetsPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsPeersubnetsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPeersubnetsPutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.peersubnets.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPeersubnetsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsPeersubnetsPutOK), nil - -} - -/* -PcloudVpnconnectionsPost creates v p n connection - -Create a new VPN Connection -*/ -func (a *Client) PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsPostAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsPostAccepted), nil - -} - -/* -PcloudVpnconnectionsPut updates v p n connection - -update a VPN Connection (by its identifier) -*/ -func (a *Client) PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVpnconnectionsPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudVpnconnectionsPutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.vpnconnections.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudVpnconnectionsPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudVpnconnectionsPutOK), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go new file mode 100644 index 0000000000..95a58fbebb --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go @@ -0,0 +1,512 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_n_connections + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud v p n connections API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud v p n connections API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsDeleteAccepted, error) + + PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetOK, error) + + PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetallOK, error) + + PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksDeleteAccepted, error) + + PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksGetOK, error) + + PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksPutAccepted, error) + + PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnectionsPeersubnetsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsDeleteOK, error) + + PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnectionsPeersubnetsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsGetOK, error) + + PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnectionsPeersubnetsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsPutOK, error) + + PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPostAccepted, error) + + PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PcloudVpnconnectionsDelete deletes v p n connection + + Delete VPN Connection (by its identifier) +*/ +func (a *Client) PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsDeleteAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsDeleteAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsGet gets v p n connection + + Get a VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsGetall gets all v p n connections + + Get all VPN Connections +*/ +func (a *Client) PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsNetworksDelete detaches network + + Detach network from a specific VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksDeleteAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsNetworksDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.networks.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsNetworksDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsNetworksDeleteAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsNetworksGet gets attached networks + + Get a list of network IDs attached to a VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsNetworksGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.networks.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsNetworksGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsNetworksGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsNetworksPut attaches network + + Attach a network to a VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksPutAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsNetworksPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.networks.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsNetworksPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsNetworksPutAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsPeersubnetsDelete detaches peer subnet + + Detach peer subnet from a VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnectionsPeersubnetsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsPeersubnetsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.peersubnets.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsPeersubnetsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsPeersubnetsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsPeersubnetsGet gets peer subnets + + Get a list of peer subnets attached to a specific VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnectionsPeersubnetsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsPeersubnetsGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.peersubnets.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsPeersubnetsGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsPeersubnetsGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsPeersubnetsPut attaches peer subnet + + Attach peer subnet to a VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnectionsPeersubnetsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsPutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsPeersubnetsPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.peersubnets.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsPeersubnetsPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsPeersubnetsPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsPost creates v p n connection + + Create a new VPN Connection +*/ +func (a *Client) PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudVpnconnectionsPut updates v p n connection + + update a VPN Connection (by its identifier) +*/ +func (a *Client) PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVpnconnectionsPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.vpnconnections.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVpnconnectionsPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVpnconnectionsPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go index 4c31427867..6bb03a9b94 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudVpnconnectionsDeleteParams creates a new PcloudVpnconnectionsDeleteParams object -// with the default values initialized. +// NewPcloudVpnconnectionsDeleteParams creates a new PcloudVpnconnectionsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsDeleteParams() *PcloudVpnconnectionsDeleteParams { - var () return &PcloudVpnconnectionsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsDeleteParamsWithTimeout creates a new PcloudVpnconnectionsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsDeleteParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsDeleteParams { - var () return &PcloudVpnconnectionsDeleteParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsDeleteParamsWithContext creates a new PcloudVpnconnectionsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsDeleteParamsWithContext(ctx context.Context) *PcloudVpnconnectionsDeleteParams { - var () return &PcloudVpnconnectionsDeleteParams{ - Context: ctx, } } // NewPcloudVpnconnectionsDeleteParamsWithHTTPClient creates a new PcloudVpnconnectionsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsDeleteParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsDeleteParams { - var () return &PcloudVpnconnectionsDeleteParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections delete operation typically these are written to a http.Request +/* PcloudVpnconnectionsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections delete operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -77,6 +76,21 @@ type PcloudVpnconnectionsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsDeleteParams) WithDefaults() *PcloudVpnconnectionsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections delete params func (o *PcloudVpnconnectionsDeleteParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go index 20533e9d9d..cd546b1522 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsDeleteReader is a Reader for the PcloudVpnconnectionsDelete structure. @@ -24,51 +23,44 @@ type PcloudVpnconnectionsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudVpnconnectionsDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudVpnconnectionsDeleteAccepted() *PcloudVpnconnectionsDeleteAccepted return &PcloudVpnconnectionsDeleteAccepted{} } -/*PcloudVpnconnectionsDeleteAccepted handles this case with default header values. +/* PcloudVpnconnectionsDeleteAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudVpnconnectionsDeleteAccepted struct { func (o *PcloudVpnconnectionsDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudVpnconnectionsDeleteAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudVpnconnectionsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudVpnconnectionsDeleteBadRequest() *PcloudVpnconnectionsDeleteBadReq return &PcloudVpnconnectionsDeleteBadRequest{} } -/*PcloudVpnconnectionsDeleteBadRequest handles this case with default header values. +/* PcloudVpnconnectionsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudVpnconnectionsDeleteBadRequest struct { func (o *PcloudVpnconnectionsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudVpnconnectionsDeleteUnauthorized() *PcloudVpnconnectionsDeleteUnau return &PcloudVpnconnectionsDeleteUnauthorized{} } -/*PcloudVpnconnectionsDeleteUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudVpnconnectionsDeleteUnauthorized struct { func (o *PcloudVpnconnectionsDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudVpnconnectionsDeleteForbidden() *PcloudVpnconnectionsDeleteForbidd return &PcloudVpnconnectionsDeleteForbidden{} } -/*PcloudVpnconnectionsDeleteForbidden handles this case with default header values. +/* PcloudVpnconnectionsDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudVpnconnectionsDeleteForbidden struct { func (o *PcloudVpnconnectionsDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudVpnconnectionsDeleteNotFound() *PcloudVpnconnectionsDeleteNotFound return &PcloudVpnconnectionsDeleteNotFound{} } -/*PcloudVpnconnectionsDeleteNotFound handles this case with default header values. +/* PcloudVpnconnectionsDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudVpnconnectionsDeleteNotFound struct { func (o *PcloudVpnconnectionsDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudVpnconnectionsDeleteInternalServerError() *PcloudVpnconnectionsDel return &PcloudVpnconnectionsDeleteInternalServerError{} } -/*PcloudVpnconnectionsDeleteInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudVpnconnectionsDeleteInternalServerError struct { func (o *PcloudVpnconnectionsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go index 0f39ece167..9e34b4962b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudVpnconnectionsGetParams creates a new PcloudVpnconnectionsGetParams object -// with the default values initialized. +// NewPcloudVpnconnectionsGetParams creates a new PcloudVpnconnectionsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsGetParams() *PcloudVpnconnectionsGetParams { - var () return &PcloudVpnconnectionsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsGetParamsWithTimeout creates a new PcloudVpnconnectionsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsGetParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetParams { - var () return &PcloudVpnconnectionsGetParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsGetParamsWithContext creates a new PcloudVpnconnectionsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsGetParamsWithContext(ctx context.Context) *PcloudVpnconnectionsGetParams { - var () return &PcloudVpnconnectionsGetParams{ - Context: ctx, } } // NewPcloudVpnconnectionsGetParamsWithHTTPClient creates a new PcloudVpnconnectionsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsGetParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsGetParams { - var () return &PcloudVpnconnectionsGetParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsGetParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections get operation typically these are written to a http.Request +/* PcloudVpnconnectionsGetParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections get operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -77,6 +76,21 @@ type PcloudVpnconnectionsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsGetParams) WithDefaults() *PcloudVpnconnectionsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections get params func (o *PcloudVpnconnectionsGetParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go index 59d6ba75cb..79413add9d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsGetReader is a Reader for the PcloudVpnconnectionsGet structure. @@ -24,58 +23,50 @@ type PcloudVpnconnectionsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsGetUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudVpnconnectionsGetOK() *PcloudVpnconnectionsGetOK { return &PcloudVpnconnectionsGetOK{} } -/*PcloudVpnconnectionsGetOK handles this case with default header values. +/* PcloudVpnconnectionsGetOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudVpnconnectionsGetOK struct { func (o *PcloudVpnconnectionsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsGetOK) GetPayload() *models.VPNConnection { + return o.Payload +} func (o *PcloudVpnconnectionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudVpnconnectionsGetBadRequest() *PcloudVpnconnectionsGetBadRequest { return &PcloudVpnconnectionsGetBadRequest{} } -/*PcloudVpnconnectionsGetBadRequest handles this case with default header values. +/* PcloudVpnconnectionsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudVpnconnectionsGetBadRequest struct { func (o *PcloudVpnconnectionsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudVpnconnectionsGetUnauthorized() *PcloudVpnconnectionsGetUnauthoriz return &PcloudVpnconnectionsGetUnauthorized{} } -/*PcloudVpnconnectionsGetUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudVpnconnectionsGetUnauthorized struct { func (o *PcloudVpnconnectionsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudVpnconnectionsGetForbidden() *PcloudVpnconnectionsGetForbidden { return &PcloudVpnconnectionsGetForbidden{} } -/*PcloudVpnconnectionsGetForbidden handles this case with default header values. +/* PcloudVpnconnectionsGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudVpnconnectionsGetForbidden struct { func (o *PcloudVpnconnectionsGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudVpnconnectionsGetNotFound() *PcloudVpnconnectionsGetNotFound { return &PcloudVpnconnectionsGetNotFound{} } -/*PcloudVpnconnectionsGetNotFound handles this case with default header values. +/* PcloudVpnconnectionsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -211,6 +214,9 @@ type PcloudVpnconnectionsGetNotFound struct { func (o *PcloudVpnconnectionsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudVpnconnectionsGetUnprocessableEntity() *PcloudVpnconnectionsGetUnp return &PcloudVpnconnectionsGetUnprocessableEntity{} } -/*PcloudVpnconnectionsGetUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsGetUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudVpnconnectionsGetUnprocessableEntity struct { func (o *PcloudVpnconnectionsGetUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsGetUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudVpnconnectionsGetInternalServerError() *PcloudVpnconnectionsGetInt return &PcloudVpnconnectionsGetInternalServerError{} } -/*PcloudVpnconnectionsGetInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudVpnconnectionsGetInternalServerError struct { func (o *PcloudVpnconnectionsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go index d1d00f5d5c..08d55e3aec 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudVpnconnectionsGetallParams creates a new PcloudVpnconnectionsGetallParams object -// with the default values initialized. +// NewPcloudVpnconnectionsGetallParams creates a new PcloudVpnconnectionsGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsGetallParams() *PcloudVpnconnectionsGetallParams { - var () return &PcloudVpnconnectionsGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsGetallParamsWithTimeout creates a new PcloudVpnconnectionsGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsGetallParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetallParams { - var () return &PcloudVpnconnectionsGetallParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsGetallParamsWithContext creates a new PcloudVpnconnectionsGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsGetallParamsWithContext(ctx context.Context) *PcloudVpnconnectionsGetallParams { - var () return &PcloudVpnconnectionsGetallParams{ - Context: ctx, } } // NewPcloudVpnconnectionsGetallParamsWithHTTPClient creates a new PcloudVpnconnectionsGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsGetallParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsGetallParams { - var () return &PcloudVpnconnectionsGetallParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsGetallParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections getall operation typically these are written to a http.Request +/* PcloudVpnconnectionsGetallParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections getall operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudVpnconnectionsGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsGetallParams) WithDefaults() *PcloudVpnconnectionsGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections getall params func (o *PcloudVpnconnectionsGetallParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go index ef63a3b981..487398c79c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsGetallReader is a Reader for the PcloudVpnconnectionsGetall structure. @@ -24,51 +23,44 @@ type PcloudVpnconnectionsGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsGetallForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudVpnconnectionsGetallOK() *PcloudVpnconnectionsGetallOK { return &PcloudVpnconnectionsGetallOK{} } -/*PcloudVpnconnectionsGetallOK handles this case with default header values. +/* PcloudVpnconnectionsGetallOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudVpnconnectionsGetallOK struct { func (o *PcloudVpnconnectionsGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsGetallOK) GetPayload() *models.VPNConnections { + return o.Payload +} func (o *PcloudVpnconnectionsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudVpnconnectionsGetallBadRequest() *PcloudVpnconnectionsGetallBadReq return &PcloudVpnconnectionsGetallBadRequest{} } -/*PcloudVpnconnectionsGetallBadRequest handles this case with default header values. +/* PcloudVpnconnectionsGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudVpnconnectionsGetallBadRequest struct { func (o *PcloudVpnconnectionsGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudVpnconnectionsGetallUnauthorized() *PcloudVpnconnectionsGetallUnau return &PcloudVpnconnectionsGetallUnauthorized{} } -/*PcloudVpnconnectionsGetallUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudVpnconnectionsGetallUnauthorized struct { func (o *PcloudVpnconnectionsGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudVpnconnectionsGetallForbidden() *PcloudVpnconnectionsGetallForbidd return &PcloudVpnconnectionsGetallForbidden{} } -/*PcloudVpnconnectionsGetallForbidden handles this case with default header values. +/* PcloudVpnconnectionsGetallForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudVpnconnectionsGetallForbidden struct { func (o *PcloudVpnconnectionsGetallForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsGetallForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudVpnconnectionsGetallNotFound() *PcloudVpnconnectionsGetallNotFound return &PcloudVpnconnectionsGetallNotFound{} } -/*PcloudVpnconnectionsGetallNotFound handles this case with default header values. +/* PcloudVpnconnectionsGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudVpnconnectionsGetallNotFound struct { func (o *PcloudVpnconnectionsGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudVpnconnectionsGetallInternalServerError() *PcloudVpnconnectionsGet return &PcloudVpnconnectionsGetallInternalServerError{} } -/*PcloudVpnconnectionsGetallInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudVpnconnectionsGetallInternalServerError struct { func (o *PcloudVpnconnectionsGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go index 8c3cd6ffad..a7b4b14a23 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVpnconnectionsNetworksDeleteParams creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the default values initialized. +// NewPcloudVpnconnectionsNetworksDeleteParams creates a new PcloudVpnconnectionsNetworksDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsNetworksDeleteParams() *PcloudVpnconnectionsNetworksDeleteParams { - var () return &PcloudVpnconnectionsNetworksDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsNetworksDeleteParamsWithTimeout creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsNetworksDeleteParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksDeleteParams { - var () return &PcloudVpnconnectionsNetworksDeleteParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsNetworksDeleteParamsWithContext creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsNetworksDeleteParamsWithContext(ctx context.Context) *PcloudVpnconnectionsNetworksDeleteParams { - var () return &PcloudVpnconnectionsNetworksDeleteParams{ - Context: ctx, } } // NewPcloudVpnconnectionsNetworksDeleteParamsWithHTTPClient creates a new PcloudVpnconnectionsNetworksDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsNetworksDeleteParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksDeleteParams { - var () return &PcloudVpnconnectionsNetworksDeleteParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsNetworksDeleteParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections networks delete operation typically these are written to a http.Request +/* PcloudVpnconnectionsNetworksDeleteParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections networks delete operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsNetworksDeleteParams struct { - /*Body - network to detach + /* Body. + network to detach */ Body *models.NetworkID - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -84,6 +84,21 @@ type PcloudVpnconnectionsNetworksDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsNetworksDeleteParams) WithDefaults() *PcloudVpnconnectionsNetworksDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections networks delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsNetworksDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections networks delete params func (o *PcloudVpnconnectionsNetworksDeleteParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksDeleteParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudVpnconnectionsNetworksDeleteParams) WriteToRequest(r runtime.Clie return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go index 96db174d47..4d2685a4b9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsNetworksDeleteReader is a Reader for the PcloudVpnconnectionsNetworksDelete structure. @@ -24,58 +23,50 @@ type PcloudVpnconnectionsNetworksDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudVpnconnectionsNetworksDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsNetworksDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsNetworksDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsNetworksDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsNetworksDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsNetworksDeleteUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsNetworksDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudVpnconnectionsNetworksDeleteAccepted() *PcloudVpnconnectionsNetwor return &PcloudVpnconnectionsNetworksDeleteAccepted{} } -/*PcloudVpnconnectionsNetworksDeleteAccepted handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteAccepted describes a response with status code 202, with default header values. Accepted */ @@ -95,6 +86,9 @@ type PcloudVpnconnectionsNetworksDeleteAccepted struct { func (o *PcloudVpnconnectionsNetworksDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudVpnconnectionsNetworksDeleteBadRequest() *PcloudVpnconnectionsNetw return &PcloudVpnconnectionsNetworksDeleteBadRequest{} } -/*PcloudVpnconnectionsNetworksDeleteBadRequest handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudVpnconnectionsNetworksDeleteBadRequest struct { func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudVpnconnectionsNetworksDeleteUnauthorized() *PcloudVpnconnectionsNe return &PcloudVpnconnectionsNetworksDeleteUnauthorized{} } -/*PcloudVpnconnectionsNetworksDeleteUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudVpnconnectionsNetworksDeleteUnauthorized struct { func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudVpnconnectionsNetworksDeleteForbidden() *PcloudVpnconnectionsNetwo return &PcloudVpnconnectionsNetworksDeleteForbidden{} } -/*PcloudVpnconnectionsNetworksDeleteForbidden handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudVpnconnectionsNetworksDeleteForbidden struct { func (o *PcloudVpnconnectionsNetworksDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudVpnconnectionsNetworksDeleteNotFound() *PcloudVpnconnectionsNetwor return &PcloudVpnconnectionsNetworksDeleteNotFound{} } -/*PcloudVpnconnectionsNetworksDeleteNotFound handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -211,6 +214,9 @@ type PcloudVpnconnectionsNetworksDeleteNotFound struct { func (o *PcloudVpnconnectionsNetworksDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudVpnconnectionsNetworksDeleteUnprocessableEntity() *PcloudVpnconnec return &PcloudVpnconnectionsNetworksDeleteUnprocessableEntity{} } -/*PcloudVpnconnectionsNetworksDeleteUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudVpnconnectionsNetworksDeleteUnprocessableEntity struct { func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudVpnconnectionsNetworksDeleteInternalServerError() *PcloudVpnconnec return &PcloudVpnconnectionsNetworksDeleteInternalServerError{} } -/*PcloudVpnconnectionsNetworksDeleteInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsNetworksDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudVpnconnectionsNetworksDeleteInternalServerError struct { func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go index 929b6043ea..a09738cfa2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudVpnconnectionsNetworksGetParams creates a new PcloudVpnconnectionsNetworksGetParams object -// with the default values initialized. +// NewPcloudVpnconnectionsNetworksGetParams creates a new PcloudVpnconnectionsNetworksGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsNetworksGetParams() *PcloudVpnconnectionsNetworksGetParams { - var () return &PcloudVpnconnectionsNetworksGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsNetworksGetParamsWithTimeout creates a new PcloudVpnconnectionsNetworksGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsNetworksGetParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksGetParams { - var () return &PcloudVpnconnectionsNetworksGetParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsNetworksGetParamsWithContext creates a new PcloudVpnconnectionsNetworksGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsNetworksGetParamsWithContext(ctx context.Context) *PcloudVpnconnectionsNetworksGetParams { - var () return &PcloudVpnconnectionsNetworksGetParams{ - Context: ctx, } } // NewPcloudVpnconnectionsNetworksGetParamsWithHTTPClient creates a new PcloudVpnconnectionsNetworksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsNetworksGetParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksGetParams { - var () return &PcloudVpnconnectionsNetworksGetParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsNetworksGetParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections networks get operation typically these are written to a http.Request +/* PcloudVpnconnectionsNetworksGetParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections networks get operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsNetworksGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -77,6 +76,21 @@ type PcloudVpnconnectionsNetworksGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections networks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsNetworksGetParams) WithDefaults() *PcloudVpnconnectionsNetworksGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections networks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsNetworksGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections networks get params func (o *PcloudVpnconnectionsNetworksGetParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go index a51ca01140..de86c27f68 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsNetworksGetReader is a Reader for the PcloudVpnconnectionsNetworksGet structure. @@ -24,51 +23,44 @@ type PcloudVpnconnectionsNetworksGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsNetworksGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsNetworksGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsNetworksGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsNetworksGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsNetworksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsNetworksGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,21 +69,24 @@ func NewPcloudVpnconnectionsNetworksGetOK() *PcloudVpnconnectionsNetworksGetOK { return &PcloudVpnconnectionsNetworksGetOK{} } -/*PcloudVpnconnectionsNetworksGetOK handles this case with default header values. +/* PcloudVpnconnectionsNetworksGetOK describes a response with status code 200, with default header values. OK */ type PcloudVpnconnectionsNetworksGetOK struct { - Payload *models.NetworkIds + Payload *models.NetworkIDs } func (o *PcloudVpnconnectionsNetworksGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsNetworksGetOK) GetPayload() *models.NetworkIDs { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.NetworkIds) + o.Payload = new(models.NetworkIDs) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -106,7 +101,7 @@ func NewPcloudVpnconnectionsNetworksGetBadRequest() *PcloudVpnconnectionsNetwork return &PcloudVpnconnectionsNetworksGetBadRequest{} } -/*PcloudVpnconnectionsNetworksGetBadRequest handles this case with default header values. +/* PcloudVpnconnectionsNetworksGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudVpnconnectionsNetworksGetBadRequest struct { func (o *PcloudVpnconnectionsNetworksGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsNetworksGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudVpnconnectionsNetworksGetUnauthorized() *PcloudVpnconnectionsNetwo return &PcloudVpnconnectionsNetworksGetUnauthorized{} } -/*PcloudVpnconnectionsNetworksGetUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsNetworksGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudVpnconnectionsNetworksGetUnauthorized struct { func (o *PcloudVpnconnectionsNetworksGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsNetworksGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudVpnconnectionsNetworksGetForbidden() *PcloudVpnconnectionsNetworks return &PcloudVpnconnectionsNetworksGetForbidden{} } -/*PcloudVpnconnectionsNetworksGetForbidden handles this case with default header values. +/* PcloudVpnconnectionsNetworksGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudVpnconnectionsNetworksGetForbidden struct { func (o *PcloudVpnconnectionsNetworksGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsNetworksGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudVpnconnectionsNetworksGetNotFound() *PcloudVpnconnectionsNetworksG return &PcloudVpnconnectionsNetworksGetNotFound{} } -/*PcloudVpnconnectionsNetworksGetNotFound handles this case with default header values. +/* PcloudVpnconnectionsNetworksGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudVpnconnectionsNetworksGetNotFound struct { func (o *PcloudVpnconnectionsNetworksGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsNetworksGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudVpnconnectionsNetworksGetInternalServerError() *PcloudVpnconnectio return &PcloudVpnconnectionsNetworksGetInternalServerError{} } -/*PcloudVpnconnectionsNetworksGetInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsNetworksGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudVpnconnectionsNetworksGetInternalServerError struct { func (o *PcloudVpnconnectionsNetworksGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsNetworksGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go index 8f07ac280c..1cd48aa157 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVpnconnectionsNetworksPutParams creates a new PcloudVpnconnectionsNetworksPutParams object -// with the default values initialized. +// NewPcloudVpnconnectionsNetworksPutParams creates a new PcloudVpnconnectionsNetworksPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsNetworksPutParams() *PcloudVpnconnectionsNetworksPutParams { - var () return &PcloudVpnconnectionsNetworksPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsNetworksPutParamsWithTimeout creates a new PcloudVpnconnectionsNetworksPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsNetworksPutParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksPutParams { - var () return &PcloudVpnconnectionsNetworksPutParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsNetworksPutParamsWithContext creates a new PcloudVpnconnectionsNetworksPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsNetworksPutParamsWithContext(ctx context.Context) *PcloudVpnconnectionsNetworksPutParams { - var () return &PcloudVpnconnectionsNetworksPutParams{ - Context: ctx, } } // NewPcloudVpnconnectionsNetworksPutParamsWithHTTPClient creates a new PcloudVpnconnectionsNetworksPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsNetworksPutParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsNetworksPutParams { - var () return &PcloudVpnconnectionsNetworksPutParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsNetworksPutParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections networks put operation typically these are written to a http.Request +/* PcloudVpnconnectionsNetworksPutParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections networks put operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsNetworksPutParams struct { - /*Body - network to attach + /* Body. + network to attach */ Body *models.NetworkID - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -84,6 +84,21 @@ type PcloudVpnconnectionsNetworksPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections networks put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsNetworksPutParams) WithDefaults() *PcloudVpnconnectionsNetworksPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections networks put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsNetworksPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections networks put params func (o *PcloudVpnconnectionsNetworksPutParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsNetworksPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudVpnconnectionsNetworksPutParams) WriteToRequest(r runtime.ClientR return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go index 91d7829eb9..4bcc8502d9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsNetworksPutReader is a Reader for the PcloudVpnconnectionsNetworksPut structure. @@ -24,58 +23,50 @@ type PcloudVpnconnectionsNetworksPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudVpnconnectionsNetworksPutAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsNetworksPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsNetworksPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsNetworksPutForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsNetworksPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsNetworksPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsNetworksPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudVpnconnectionsNetworksPutAccepted() *PcloudVpnconnectionsNetworksP return &PcloudVpnconnectionsNetworksPutAccepted{} } -/*PcloudVpnconnectionsNetworksPutAccepted handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutAccepted describes a response with status code 202, with default header values. Accepted */ @@ -95,6 +86,9 @@ type PcloudVpnconnectionsNetworksPutAccepted struct { func (o *PcloudVpnconnectionsNetworksPutAccepted) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted %+v", 202, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutAccepted) GetPayload() *models.JobReference { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudVpnconnectionsNetworksPutBadRequest() *PcloudVpnconnectionsNetwork return &PcloudVpnconnectionsNetworksPutBadRequest{} } -/*PcloudVpnconnectionsNetworksPutBadRequest handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudVpnconnectionsNetworksPutBadRequest struct { func (o *PcloudVpnconnectionsNetworksPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudVpnconnectionsNetworksPutUnauthorized() *PcloudVpnconnectionsNetwo return &PcloudVpnconnectionsNetworksPutUnauthorized{} } -/*PcloudVpnconnectionsNetworksPutUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudVpnconnectionsNetworksPutUnauthorized struct { func (o *PcloudVpnconnectionsNetworksPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudVpnconnectionsNetworksPutForbidden() *PcloudVpnconnectionsNetworks return &PcloudVpnconnectionsNetworksPutForbidden{} } -/*PcloudVpnconnectionsNetworksPutForbidden handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudVpnconnectionsNetworksPutForbidden struct { func (o *PcloudVpnconnectionsNetworksPutForbidden) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudVpnconnectionsNetworksPutNotFound() *PcloudVpnconnectionsNetworksP return &PcloudVpnconnectionsNetworksPutNotFound{} } -/*PcloudVpnconnectionsNetworksPutNotFound handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutNotFound describes a response with status code 404, with default header values. Not Found */ @@ -211,6 +214,9 @@ type PcloudVpnconnectionsNetworksPutNotFound struct { func (o *PcloudVpnconnectionsNetworksPutNotFound) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudVpnconnectionsNetworksPutUnprocessableEntity() *PcloudVpnconnectio return &PcloudVpnconnectionsNetworksPutUnprocessableEntity{} } -/*PcloudVpnconnectionsNetworksPutUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudVpnconnectionsNetworksPutUnprocessableEntity struct { func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudVpnconnectionsNetworksPutInternalServerError() *PcloudVpnconnectio return &PcloudVpnconnectionsNetworksPutInternalServerError{} } -/*PcloudVpnconnectionsNetworksPutInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsNetworksPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudVpnconnectionsNetworksPutInternalServerError struct { func (o *PcloudVpnconnectionsNetworksPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsNetworksPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsNetworksPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go index 8c154c31cb..5834aeab04 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVpnconnectionsPeersubnetsDeleteParams creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the default values initialized. +// NewPcloudVpnconnectionsPeersubnetsDeleteParams creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsPeersubnetsDeleteParams() *PcloudVpnconnectionsPeersubnetsDeleteParams { - var () return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithTimeout creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsDeleteParams { - var () return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithContext creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsDeleteParams { - var () return &PcloudVpnconnectionsPeersubnetsDeleteParams{ - Context: ctx, } } // NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithHTTPClient creates a new PcloudVpnconnectionsPeersubnetsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsPeersubnetsDeleteParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsDeleteParams { - var () return &PcloudVpnconnectionsPeersubnetsDeleteParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsPeersubnetsDeleteParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections peersubnets delete operation typically these are written to a http.Request +/* PcloudVpnconnectionsPeersubnetsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections peersubnets delete operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsPeersubnetsDeleteParams struct { - /*Body - Peer subnet to detach + /* Body. + Peer subnet to detach */ Body *models.PeerSubnetUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -84,6 +84,21 @@ type PcloudVpnconnectionsPeersubnetsDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections peersubnets delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithDefaults() *PcloudVpnconnectionsPeersubnetsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections peersubnets delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections peersubnets delete params func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsDeleteParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteParams) WriteToRequest(r runtime.C return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go index ce88e1a5bc..5b6d05ba59 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsPeersubnetsDeleteReader is a Reader for the PcloudVpnconnectionsPeersubnetsDelete structure. @@ -24,51 +23,44 @@ type PcloudVpnconnectionsPeersubnetsDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsPeersubnetsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsPeersubnetsDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsPeersubnetsDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsPeersubnetsDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsPeersubnetsDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsPeersubnetsDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudVpnconnectionsPeersubnetsDeleteOK() *PcloudVpnconnectionsPeersubne return &PcloudVpnconnectionsPeersubnetsDeleteOK{} } -/*PcloudVpnconnectionsPeersubnetsDeleteOK handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsDeleteOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudVpnconnectionsPeersubnetsDeleteOK struct { func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) GetPayload() *models.PeerSubnets { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudVpnconnectionsPeersubnetsDeleteBadRequest() *PcloudVpnconnectionsP return &PcloudVpnconnectionsPeersubnetsDeleteBadRequest{} } -/*PcloudVpnconnectionsPeersubnetsDeleteBadRequest handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudVpnconnectionsPeersubnetsDeleteBadRequest struct { func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudVpnconnectionsPeersubnetsDeleteUnauthorized() *PcloudVpnconnection return &PcloudVpnconnectionsPeersubnetsDeleteUnauthorized{} } -/*PcloudVpnconnectionsPeersubnetsDeleteUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudVpnconnectionsPeersubnetsDeleteUnauthorized struct { func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudVpnconnectionsPeersubnetsDeleteForbidden() *PcloudVpnconnectionsPe return &PcloudVpnconnectionsPeersubnetsDeleteForbidden{} } -/*PcloudVpnconnectionsPeersubnetsDeleteForbidden handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudVpnconnectionsPeersubnetsDeleteForbidden struct { func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity() *PcloudVpncon return &PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity{} } -/*PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity struct { func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudVpnconnectionsPeersubnetsDeleteInternalServerError() *PcloudVpncon return &PcloudVpnconnectionsPeersubnetsDeleteInternalServerError{} } -/*PcloudVpnconnectionsPeersubnetsDeleteInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudVpnconnectionsPeersubnetsDeleteInternalServerError struct { func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go index f31225d748..d17411fda9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudVpnconnectionsPeersubnetsGetParams creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the default values initialized. +// NewPcloudVpnconnectionsPeersubnetsGetParams creates a new PcloudVpnconnectionsPeersubnetsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsPeersubnetsGetParams() *PcloudVpnconnectionsPeersubnetsGetParams { - var () return &PcloudVpnconnectionsPeersubnetsGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsPeersubnetsGetParamsWithTimeout creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsPeersubnetsGetParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsGetParams { - var () return &PcloudVpnconnectionsPeersubnetsGetParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsPeersubnetsGetParamsWithContext creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsPeersubnetsGetParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsGetParams { - var () return &PcloudVpnconnectionsPeersubnetsGetParams{ - Context: ctx, } } // NewPcloudVpnconnectionsPeersubnetsGetParamsWithHTTPClient creates a new PcloudVpnconnectionsPeersubnetsGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsPeersubnetsGetParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsGetParams { - var () return &PcloudVpnconnectionsPeersubnetsGetParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsPeersubnetsGetParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections peersubnets get operation typically these are written to a http.Request +/* PcloudVpnconnectionsPeersubnetsGetParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections peersubnets get operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsPeersubnetsGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -77,6 +76,21 @@ type PcloudVpnconnectionsPeersubnetsGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections peersubnets get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithDefaults() *PcloudVpnconnectionsPeersubnetsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections peersubnets get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPeersubnetsGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections peersubnets get params func (o *PcloudVpnconnectionsPeersubnetsGetParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go index 2ee86a0a66..6f9e64ef18 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsPeersubnetsGetReader is a Reader for the PcloudVpnconnectionsPeersubnetsGet structure. @@ -24,51 +23,44 @@ type PcloudVpnconnectionsPeersubnetsGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsPeersubnetsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsPeersubnetsGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsPeersubnetsGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsPeersubnetsGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsPeersubnetsGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsPeersubnetsGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsPeersubnetsGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudVpnconnectionsPeersubnetsGetOK() *PcloudVpnconnectionsPeersubnetsG return &PcloudVpnconnectionsPeersubnetsGetOK{} } -/*PcloudVpnconnectionsPeersubnetsGetOK handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsGetOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudVpnconnectionsPeersubnetsGetOK struct { func (o *PcloudVpnconnectionsPeersubnetsGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsGetOK) GetPayload() *models.PeerSubnets { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudVpnconnectionsPeersubnetsGetBadRequest() *PcloudVpnconnectionsPeer return &PcloudVpnconnectionsPeersubnetsGetBadRequest{} } -/*PcloudVpnconnectionsPeersubnetsGetBadRequest handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudVpnconnectionsPeersubnetsGetBadRequest struct { func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudVpnconnectionsPeersubnetsGetUnauthorized() *PcloudVpnconnectionsPe return &PcloudVpnconnectionsPeersubnetsGetUnauthorized{} } -/*PcloudVpnconnectionsPeersubnetsGetUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudVpnconnectionsPeersubnetsGetUnauthorized struct { func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudVpnconnectionsPeersubnetsGetForbidden() *PcloudVpnconnectionsPeers return &PcloudVpnconnectionsPeersubnetsGetForbidden{} } -/*PcloudVpnconnectionsPeersubnetsGetForbidden handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudVpnconnectionsPeersubnetsGetForbidden struct { func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudVpnconnectionsPeersubnetsGetNotFound() *PcloudVpnconnectionsPeersu return &PcloudVpnconnectionsPeersubnetsGetNotFound{} } -/*PcloudVpnconnectionsPeersubnetsGetNotFound handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudVpnconnectionsPeersubnetsGetNotFound struct { func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudVpnconnectionsPeersubnetsGetInternalServerError() *PcloudVpnconnec return &PcloudVpnconnectionsPeersubnetsGetInternalServerError{} } -/*PcloudVpnconnectionsPeersubnetsGetInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudVpnconnectionsPeersubnetsGetInternalServerError struct { func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go index 4a173ea227..0f74fcc155 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVpnconnectionsPeersubnetsPutParams creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the default values initialized. +// NewPcloudVpnconnectionsPeersubnetsPutParams creates a new PcloudVpnconnectionsPeersubnetsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsPeersubnetsPutParams() *PcloudVpnconnectionsPeersubnetsPutParams { - var () return &PcloudVpnconnectionsPeersubnetsPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsPeersubnetsPutParamsWithTimeout creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsPeersubnetsPutParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsPutParams { - var () return &PcloudVpnconnectionsPeersubnetsPutParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsPeersubnetsPutParamsWithContext creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsPeersubnetsPutParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPeersubnetsPutParams { - var () return &PcloudVpnconnectionsPeersubnetsPutParams{ - Context: ctx, } } // NewPcloudVpnconnectionsPeersubnetsPutParamsWithHTTPClient creates a new PcloudVpnconnectionsPeersubnetsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsPeersubnetsPutParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPeersubnetsPutParams { - var () return &PcloudVpnconnectionsPeersubnetsPutParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsPeersubnetsPutParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections peersubnets put operation typically these are written to a http.Request +/* PcloudVpnconnectionsPeersubnetsPutParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections peersubnets put operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsPeersubnetsPutParams struct { - /*Body - peer subnet to attach + /* Body. + peer subnet to attach */ Body *models.PeerSubnetUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -84,6 +84,21 @@ type PcloudVpnconnectionsPeersubnetsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections peersubnets put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithDefaults() *PcloudVpnconnectionsPeersubnetsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections peersubnets put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPeersubnetsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections peersubnets put params func (o *PcloudVpnconnectionsPeersubnetsPutParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPeersubnetsPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudVpnconnectionsPeersubnetsPutParams) WriteToRequest(r runtime.Clie return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go index bd1a21d3d3..a9967c9a47 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsPeersubnetsPutReader is a Reader for the PcloudVpnconnectionsPeersubnetsPut structure. @@ -24,51 +23,44 @@ type PcloudVpnconnectionsPeersubnetsPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsPeersubnetsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsPeersubnetsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsPeersubnetsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsPeersubnetsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsPeersubnetsPutForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsPeersubnetsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsPeersubnetsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudVpnconnectionsPeersubnetsPutOK() *PcloudVpnconnectionsPeersubnetsP return &PcloudVpnconnectionsPeersubnetsPutOK{} } -/*PcloudVpnconnectionsPeersubnetsPutOK handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsPutOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudVpnconnectionsPeersubnetsPutOK struct { func (o *PcloudVpnconnectionsPeersubnetsPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsPutOK) GetPayload() *models.PeerSubnets { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudVpnconnectionsPeersubnetsPutBadRequest() *PcloudVpnconnectionsPeer return &PcloudVpnconnectionsPeersubnetsPutBadRequest{} } -/*PcloudVpnconnectionsPeersubnetsPutBadRequest handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudVpnconnectionsPeersubnetsPutBadRequest struct { func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudVpnconnectionsPeersubnetsPutUnauthorized() *PcloudVpnconnectionsPe return &PcloudVpnconnectionsPeersubnetsPutUnauthorized{} } -/*PcloudVpnconnectionsPeersubnetsPutUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudVpnconnectionsPeersubnetsPutUnauthorized struct { func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudVpnconnectionsPeersubnetsPutForbidden() *PcloudVpnconnectionsPeers return &PcloudVpnconnectionsPeersubnetsPutForbidden{} } -/*PcloudVpnconnectionsPeersubnetsPutForbidden handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsPutForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudVpnconnectionsPeersubnetsPutForbidden struct { func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudVpnconnectionsPeersubnetsPutUnprocessableEntity() *PcloudVpnconnec return &PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity{} } -/*PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity struct { func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudVpnconnectionsPeersubnetsPutInternalServerError() *PcloudVpnconnec return &PcloudVpnconnectionsPeersubnetsPutInternalServerError{} } -/*PcloudVpnconnectionsPeersubnetsPutInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsPeersubnetsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudVpnconnectionsPeersubnetsPutInternalServerError struct { func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go index b71fbcb53a..0c10162117 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVpnconnectionsPostParams creates a new PcloudVpnconnectionsPostParams object -// with the default values initialized. +// NewPcloudVpnconnectionsPostParams creates a new PcloudVpnconnectionsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsPostParams() *PcloudVpnconnectionsPostParams { - var () return &PcloudVpnconnectionsPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsPostParamsWithTimeout creates a new PcloudVpnconnectionsPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsPostParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPostParams { - var () return &PcloudVpnconnectionsPostParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsPostParamsWithContext creates a new PcloudVpnconnectionsPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsPostParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPostParams { - var () return &PcloudVpnconnectionsPostParams{ - Context: ctx, } } // NewPcloudVpnconnectionsPostParamsWithHTTPClient creates a new PcloudVpnconnectionsPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsPostParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPostParams { - var () return &PcloudVpnconnectionsPostParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsPostParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections post operation typically these are written to a http.Request +/* PcloudVpnconnectionsPostParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections post operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsPostParams struct { - /*Body - VPN Connection object used for creation + /* Body. + VPN Connection object used for creation */ Body *models.VPNConnectionCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudVpnconnectionsPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPostParams) WithDefaults() *PcloudVpnconnectionsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections post params func (o *PcloudVpnconnectionsPostParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudVpnconnectionsPostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go index bd6f2de993..c4f1f0a618 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsPostReader is a Reader for the PcloudVpnconnectionsPost structure. @@ -24,58 +23,50 @@ type PcloudVpnconnectionsPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudVpnconnectionsPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudVpnconnectionsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudVpnconnectionsPostAccepted() *PcloudVpnconnectionsPostAccepted { return &PcloudVpnconnectionsPostAccepted{} } -/*PcloudVpnconnectionsPostAccepted handles this case with default header values. +/* PcloudVpnconnectionsPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -95,6 +86,9 @@ type PcloudVpnconnectionsPostAccepted struct { func (o *PcloudVpnconnectionsPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostAccepted %+v", 202, o.Payload) } +func (o *PcloudVpnconnectionsPostAccepted) GetPayload() *models.VPNConnectionCreateResponse { + return o.Payload +} func (o *PcloudVpnconnectionsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudVpnconnectionsPostBadRequest() *PcloudVpnconnectionsPostBadRequest return &PcloudVpnconnectionsPostBadRequest{} } -/*PcloudVpnconnectionsPostBadRequest handles this case with default header values. +/* PcloudVpnconnectionsPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudVpnconnectionsPostBadRequest struct { func (o *PcloudVpnconnectionsPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudVpnconnectionsPostUnauthorized() *PcloudVpnconnectionsPostUnauthor return &PcloudVpnconnectionsPostUnauthorized{} } -/*PcloudVpnconnectionsPostUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudVpnconnectionsPostUnauthorized struct { func (o *PcloudVpnconnectionsPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudVpnconnectionsPostForbidden() *PcloudVpnconnectionsPostForbidden { return &PcloudVpnconnectionsPostForbidden{} } -/*PcloudVpnconnectionsPostForbidden handles this case with default header values. +/* PcloudVpnconnectionsPostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudVpnconnectionsPostForbidden struct { func (o *PcloudVpnconnectionsPostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudVpnconnectionsPostConflict() *PcloudVpnconnectionsPostConflict { return &PcloudVpnconnectionsPostConflict{} } -/*PcloudVpnconnectionsPostConflict handles this case with default header values. +/* PcloudVpnconnectionsPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudVpnconnectionsPostConflict struct { func (o *PcloudVpnconnectionsPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostConflict %+v", 409, o.Payload) } +func (o *PcloudVpnconnectionsPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudVpnconnectionsPostUnprocessableEntity() *PcloudVpnconnectionsPostU return &PcloudVpnconnectionsPostUnprocessableEntity{} } -/*PcloudVpnconnectionsPostUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudVpnconnectionsPostUnprocessableEntity struct { func (o *PcloudVpnconnectionsPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudVpnconnectionsPostInternalServerError() *PcloudVpnconnectionsPostI return &PcloudVpnconnectionsPostInternalServerError{} } -/*PcloudVpnconnectionsPostInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudVpnconnectionsPostInternalServerError struct { func (o *PcloudVpnconnectionsPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go index e0669aba91..5775cb0085 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVpnconnectionsPutParams creates a new PcloudVpnconnectionsPutParams object -// with the default values initialized. +// NewPcloudVpnconnectionsPutParams creates a new PcloudVpnconnectionsPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVpnconnectionsPutParams() *PcloudVpnconnectionsPutParams { - var () return &PcloudVpnconnectionsPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVpnconnectionsPutParamsWithTimeout creates a new PcloudVpnconnectionsPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVpnconnectionsPutParamsWithTimeout(timeout time.Duration) *PcloudVpnconnectionsPutParams { - var () return &PcloudVpnconnectionsPutParams{ - timeout: timeout, } } // NewPcloudVpnconnectionsPutParamsWithContext creates a new PcloudVpnconnectionsPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVpnconnectionsPutParamsWithContext(ctx context.Context) *PcloudVpnconnectionsPutParams { - var () return &PcloudVpnconnectionsPutParams{ - Context: ctx, } } // NewPcloudVpnconnectionsPutParamsWithHTTPClient creates a new PcloudVpnconnectionsPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVpnconnectionsPutParamsWithHTTPClient(client *http.Client) *PcloudVpnconnectionsPutParams { - var () return &PcloudVpnconnectionsPutParams{ HTTPClient: client, } } -/*PcloudVpnconnectionsPutParams contains all the parameters to send to the API endpoint -for the pcloud vpnconnections put operation typically these are written to a http.Request +/* PcloudVpnconnectionsPutParams contains all the parameters to send to the API endpoint + for the pcloud vpnconnections put operation. + + Typically these are written to a http.Request. */ type PcloudVpnconnectionsPutParams struct { - /*Body - VPN Connection object used for update + /* Body. + VPN Connection object used for update */ Body *models.VPNConnectionUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VpnConnectionID - ID of a VPN connection + /* VpnConnectionID. + + ID of a VPN connection */ VpnConnectionID string @@ -84,6 +84,21 @@ type PcloudVpnconnectionsPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud vpnconnections put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPutParams) WithDefaults() *PcloudVpnconnectionsPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud vpnconnections put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVpnconnectionsPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud vpnconnections put params func (o *PcloudVpnconnectionsPutParams) WithTimeout(timeout time.Duration) *PcloudVpnconnectionsPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudVpnconnectionsPutParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go index a6530f96a4..2e2026de05 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVpnconnectionsPutReader is a Reader for the PcloudVpnconnectionsPut structure. @@ -24,58 +23,50 @@ type PcloudVpnconnectionsPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVpnconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVpnconnectionsPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVpnconnectionsPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVpnconnectionsPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudVpnconnectionsPutForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudVpnconnectionsPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudVpnconnectionsPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVpnconnectionsPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudVpnconnectionsPutOK() *PcloudVpnconnectionsPutOK { return &PcloudVpnconnectionsPutOK{} } -/*PcloudVpnconnectionsPutOK handles this case with default header values. +/* PcloudVpnconnectionsPutOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudVpnconnectionsPutOK struct { func (o *PcloudVpnconnectionsPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutOK %+v", 200, o.Payload) } +func (o *PcloudVpnconnectionsPutOK) GetPayload() *models.VPNConnection { + return o.Payload +} func (o *PcloudVpnconnectionsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudVpnconnectionsPutBadRequest() *PcloudVpnconnectionsPutBadRequest { return &PcloudVpnconnectionsPutBadRequest{} } -/*PcloudVpnconnectionsPutBadRequest handles this case with default header values. +/* PcloudVpnconnectionsPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudVpnconnectionsPutBadRequest struct { func (o *PcloudVpnconnectionsPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudVpnconnectionsPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudVpnconnectionsPutUnauthorized() *PcloudVpnconnectionsPutUnauthoriz return &PcloudVpnconnectionsPutUnauthorized{} } -/*PcloudVpnconnectionsPutUnauthorized handles this case with default header values. +/* PcloudVpnconnectionsPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudVpnconnectionsPutUnauthorized struct { func (o *PcloudVpnconnectionsPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVpnconnectionsPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudVpnconnectionsPutForbidden() *PcloudVpnconnectionsPutForbidden { return &PcloudVpnconnectionsPutForbidden{} } -/*PcloudVpnconnectionsPutForbidden handles this case with default header values. +/* PcloudVpnconnectionsPutForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudVpnconnectionsPutForbidden struct { func (o *PcloudVpnconnectionsPutForbidden) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutForbidden %+v", 403, o.Payload) } +func (o *PcloudVpnconnectionsPutForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudVpnconnectionsPutNotFound() *PcloudVpnconnectionsPutNotFound { return &PcloudVpnconnectionsPutNotFound{} } -/*PcloudVpnconnectionsPutNotFound handles this case with default header values. +/* PcloudVpnconnectionsPutNotFound describes a response with status code 404, with default header values. Not Found */ @@ -211,6 +214,9 @@ type PcloudVpnconnectionsPutNotFound struct { func (o *PcloudVpnconnectionsPutNotFound) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutNotFound %+v", 404, o.Payload) } +func (o *PcloudVpnconnectionsPutNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudVpnconnectionsPutUnprocessableEntity() *PcloudVpnconnectionsPutUnp return &PcloudVpnconnectionsPutUnprocessableEntity{} } -/*PcloudVpnconnectionsPutUnprocessableEntity handles this case with default header values. +/* PcloudVpnconnectionsPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudVpnconnectionsPutUnprocessableEntity struct { func (o *PcloudVpnconnectionsPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudVpnconnectionsPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudVpnconnectionsPutInternalServerError() *PcloudVpnconnectionsPutInt return &PcloudVpnconnectionsPutInternalServerError{} } -/*PcloudVpnconnectionsPutInternalServerError handles this case with default header values. +/* PcloudVpnconnectionsPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudVpnconnectionsPutInternalServerError struct { func (o *PcloudVpnconnectionsPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVpnconnectionsPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVpnconnectionsPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloud_v_p_n_policies_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloud_v_p_n_policies_client.go deleted file mode 100644 index 6a0f1890ea..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloud_v_p_n_policies_client.go +++ /dev/null @@ -1,340 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_v_p_n_policies - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud v p n policies API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { - return &Client{transport: transport, formats: formats} -} - -/* -Client for p cloud v p n policies API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -/* -PcloudIkepoliciesDelete deletes i k e policy - -Delete an IKE Policy (by its unique identifier) -*/ -func (a *Client) PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIkepoliciesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ikepolicies.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIkepoliciesDeleteOK), nil - -} - -/* -PcloudIkepoliciesGet gets the specified i k e policy - -Get an IKE Policy (by its unique identifier) -*/ -func (a *Client) PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIkepoliciesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ikepolicies.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIkepoliciesGetOK), nil - -} - -/* -PcloudIkepoliciesGetall gets all i k e policies - -List all IKE Policies with all attributes -*/ -func (a *Client) PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIkepoliciesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ikepolicies.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIkepoliciesGetallOK), nil - -} - -/* -PcloudIkepoliciesPost adds i k e policy - -Add a new IKE Policy -*/ -func (a *Client) PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIkepoliciesPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ikepolicies.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIkepoliciesPostOK), nil - -} - -/* -PcloudIkepoliciesPut updates i k e policy - -update an IKE Policy (by its unique identifier) -*/ -func (a *Client) PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIkepoliciesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIkepoliciesPutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ikepolicies.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIkepoliciesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIkepoliciesPutOK), nil - -} - -/* -PcloudIpsecpoliciesDelete deletes IP sec policy - -Delete an IPSec Policy (by its unique identifier) -*/ -func (a *Client) PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIpsecpoliciesDeleteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesDeleteParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.delete", - Method: "DELETE", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesDeleteReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIpsecpoliciesDeleteOK), nil - -} - -/* -PcloudIpsecpoliciesGet gets the specified IP sec policy - -Get an IPSec Policy (by its unique identifier) -*/ -func (a *Client) PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIpsecpoliciesGetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.get", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesGetReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIpsecpoliciesGetOK), nil - -} - -/* -PcloudIpsecpoliciesGetall gets all IP sec policies - -Get all IPSec Policies with all their attributes -*/ -func (a *Client) PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIpsecpoliciesGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesGetallParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesGetallReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIpsecpoliciesGetallOK), nil - -} - -/* -PcloudIpsecpoliciesPost adds IP sec policy - -Add a new IPSec Policy -*/ -func (a *Client) PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIpsecpoliciesPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesPostParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIpsecpoliciesPostOK), nil - -} - -/* -PcloudIpsecpoliciesPut updates IP sec policy - -update an IPSec Policy -*/ -func (a *Client) PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudIpsecpoliciesPutOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudIpsecpoliciesPutParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "pcloud.ipsecpolicies.put", - Method: "PUT", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudIpsecpoliciesPutReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - return result.(*PcloudIpsecpoliciesPutOK), nil - -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go new file mode 100644 index 0000000000..677be4f2fb --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go @@ -0,0 +1,469 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_n_policies + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud v p n policies API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud v p n policies API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesDeleteOK, error) + + PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetOK, error) + + PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetallOK, error) + + PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPostOK, error) + + PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPutOK, error) + + PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesDeleteOK, error) + + PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetOK, error) + + PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetallOK, error) + + PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPostOK, error) + + PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PcloudIkepoliciesDelete deletes i k e policy + + Delete an IKE Policy (by its unique identifier) +*/ +func (a *Client) PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIkepoliciesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ikepolicies.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIkepoliciesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIkepoliciesDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIkepoliciesGet gets the specified i k e policy + + Get an IKE Policy (by its unique identifier) +*/ +func (a *Client) PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIkepoliciesGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ikepolicies.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIkepoliciesGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIkepoliciesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIkepoliciesGetall gets all i k e policies + + List all IKE Policies with all attributes +*/ +func (a *Client) PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIkepoliciesGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ikepolicies.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIkepoliciesGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIkepoliciesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIkepoliciesPost adds i k e policy + + Add a new IKE Policy +*/ +func (a *Client) PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIkepoliciesPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ikepolicies.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIkepoliciesPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIkepoliciesPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIkepoliciesPut updates i k e policy + + update an IKE Policy (by its unique identifier) +*/ +func (a *Client) PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIkepoliciesPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ikepolicies.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIkepoliciesPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIkepoliciesPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIpsecpoliciesDelete deletes IP sec policy + + Delete an IPSec Policy (by its unique identifier) +*/ +func (a *Client) PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIpsecpoliciesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ipsecpolicies.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIpsecpoliciesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIpsecpoliciesDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIpsecpoliciesGet gets the specified IP sec policy + + Get an IPSec Policy (by its unique identifier) +*/ +func (a *Client) PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIpsecpoliciesGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ipsecpolicies.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIpsecpoliciesGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIpsecpoliciesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIpsecpoliciesGetall gets all IP sec policies + + Get all IPSec Policies with all their attributes +*/ +func (a *Client) PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIpsecpoliciesGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ipsecpolicies.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIpsecpoliciesGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIpsecpoliciesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIpsecpoliciesPost adds IP sec policy + + Add a new IPSec Policy +*/ +func (a *Client) PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIpsecpoliciesPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ipsecpolicies.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIpsecpoliciesPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIpsecpoliciesPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudIpsecpoliciesPut updates IP sec policy + + update an IPSec Policy +*/ +func (a *Client) PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudIpsecpoliciesPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.ipsecpolicies.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudIpsecpoliciesPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudIpsecpoliciesPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go index 6c27c39b99..7463101da6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudIkepoliciesDeleteParams creates a new PcloudIkepoliciesDeleteParams object -// with the default values initialized. +// NewPcloudIkepoliciesDeleteParams creates a new PcloudIkepoliciesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIkepoliciesDeleteParams() *PcloudIkepoliciesDeleteParams { - var () return &PcloudIkepoliciesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIkepoliciesDeleteParamsWithTimeout creates a new PcloudIkepoliciesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIkepoliciesDeleteParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesDeleteParams { - var () return &PcloudIkepoliciesDeleteParams{ - timeout: timeout, } } // NewPcloudIkepoliciesDeleteParamsWithContext creates a new PcloudIkepoliciesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIkepoliciesDeleteParamsWithContext(ctx context.Context) *PcloudIkepoliciesDeleteParams { - var () return &PcloudIkepoliciesDeleteParams{ - Context: ctx, } } // NewPcloudIkepoliciesDeleteParamsWithHTTPClient creates a new PcloudIkepoliciesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIkepoliciesDeleteParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesDeleteParams { - var () return &PcloudIkepoliciesDeleteParams{ HTTPClient: client, } } -/*PcloudIkepoliciesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud ikepolicies delete operation typically these are written to a http.Request +/* PcloudIkepoliciesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud ikepolicies delete operation. + + Typically these are written to a http.Request. */ type PcloudIkepoliciesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*IkePolicyID - ID of a IKE Policy + /* IkePolicyID. + + ID of a IKE Policy */ IkePolicyID string @@ -77,6 +76,21 @@ type PcloudIkepoliciesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ikepolicies delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesDeleteParams) WithDefaults() *PcloudIkepoliciesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ikepolicies delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ikepolicies delete params func (o *PcloudIkepoliciesDeleteParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go index 6aeb58b0d7..6e71794106 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIkepoliciesDeleteReader is a Reader for the PcloudIkepoliciesDelete structure. @@ -24,44 +23,44 @@ type PcloudIkepoliciesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIkepoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIkepoliciesDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIkepoliciesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIkepoliciesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIkepoliciesDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - + case 404: + result := NewPcloudIkepoliciesDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 500: result := NewPcloudIkepoliciesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +69,7 @@ func NewPcloudIkepoliciesDeleteOK() *PcloudIkepoliciesDeleteOK { return &PcloudIkepoliciesDeleteOK{} } -/*PcloudIkepoliciesDeleteOK handles this case with default header values. +/* PcloudIkepoliciesDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +80,9 @@ type PcloudIkepoliciesDeleteOK struct { func (o *PcloudIkepoliciesDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteOK %+v", 200, o.Payload) } +func (o *PcloudIkepoliciesDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudIkepoliciesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +99,7 @@ func NewPcloudIkepoliciesDeleteBadRequest() *PcloudIkepoliciesDeleteBadRequest { return &PcloudIkepoliciesDeleteBadRequest{} } -/*PcloudIkepoliciesDeleteBadRequest handles this case with default header values. +/* PcloudIkepoliciesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +110,9 @@ type PcloudIkepoliciesDeleteBadRequest struct { func (o *PcloudIkepoliciesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudIkepoliciesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +131,7 @@ func NewPcloudIkepoliciesDeleteUnauthorized() *PcloudIkepoliciesDeleteUnauthoriz return &PcloudIkepoliciesDeleteUnauthorized{} } -/*PcloudIkepoliciesDeleteUnauthorized handles this case with default header values. +/* PcloudIkepoliciesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +142,9 @@ type PcloudIkepoliciesDeleteUnauthorized struct { func (o *PcloudIkepoliciesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIkepoliciesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +163,7 @@ func NewPcloudIkepoliciesDeleteForbidden() *PcloudIkepoliciesDeleteForbidden { return &PcloudIkepoliciesDeleteForbidden{} } -/*PcloudIkepoliciesDeleteForbidden handles this case with default header values. +/* PcloudIkepoliciesDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -166,6 +174,9 @@ type PcloudIkepoliciesDeleteForbidden struct { func (o *PcloudIkepoliciesDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudIkepoliciesDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -179,12 +190,44 @@ func (o *PcloudIkepoliciesDeleteForbidden) readResponse(response runtime.ClientR return nil } +// NewPcloudIkepoliciesDeleteNotFound creates a PcloudIkepoliciesDeleteNotFound with default headers values +func NewPcloudIkepoliciesDeleteNotFound() *PcloudIkepoliciesDeleteNotFound { + return &PcloudIkepoliciesDeleteNotFound{} +} + +/* PcloudIkepoliciesDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudIkepoliciesDeleteNotFound struct { + Payload *models.Error +} + +func (o *PcloudIkepoliciesDeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteNotFound %+v", 404, o.Payload) +} +func (o *PcloudIkepoliciesDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudIkepoliciesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudIkepoliciesDeleteInternalServerError creates a PcloudIkepoliciesDeleteInternalServerError with default headers values func NewPcloudIkepoliciesDeleteInternalServerError() *PcloudIkepoliciesDeleteInternalServerError { return &PcloudIkepoliciesDeleteInternalServerError{} } -/*PcloudIkepoliciesDeleteInternalServerError handles this case with default header values. +/* PcloudIkepoliciesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +238,9 @@ type PcloudIkepoliciesDeleteInternalServerError struct { func (o *PcloudIkepoliciesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIkepoliciesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go index 3b61f39935..9a0318cff3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudIkepoliciesGetParams creates a new PcloudIkepoliciesGetParams object -// with the default values initialized. +// NewPcloudIkepoliciesGetParams creates a new PcloudIkepoliciesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIkepoliciesGetParams() *PcloudIkepoliciesGetParams { - var () return &PcloudIkepoliciesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIkepoliciesGetParamsWithTimeout creates a new PcloudIkepoliciesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIkepoliciesGetParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesGetParams { - var () return &PcloudIkepoliciesGetParams{ - timeout: timeout, } } // NewPcloudIkepoliciesGetParamsWithContext creates a new PcloudIkepoliciesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIkepoliciesGetParamsWithContext(ctx context.Context) *PcloudIkepoliciesGetParams { - var () return &PcloudIkepoliciesGetParams{ - Context: ctx, } } // NewPcloudIkepoliciesGetParamsWithHTTPClient creates a new PcloudIkepoliciesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIkepoliciesGetParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesGetParams { - var () return &PcloudIkepoliciesGetParams{ HTTPClient: client, } } -/*PcloudIkepoliciesGetParams contains all the parameters to send to the API endpoint -for the pcloud ikepolicies get operation typically these are written to a http.Request +/* PcloudIkepoliciesGetParams contains all the parameters to send to the API endpoint + for the pcloud ikepolicies get operation. + + Typically these are written to a http.Request. */ type PcloudIkepoliciesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*IkePolicyID - ID of a IKE Policy + /* IkePolicyID. + + ID of a IKE Policy */ IkePolicyID string @@ -77,6 +76,21 @@ type PcloudIkepoliciesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ikepolicies get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesGetParams) WithDefaults() *PcloudIkepoliciesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ikepolicies get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ikepolicies get params func (o *PcloudIkepoliciesGetParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go index 6bef5769e7..d6d3b799c0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIkepoliciesGetReader is a Reader for the PcloudIkepoliciesGet structure. @@ -24,51 +23,50 @@ type PcloudIkepoliciesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIkepoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIkepoliciesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIkepoliciesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIkepoliciesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIkepoliciesGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - + case 404: + result := NewPcloudIkepoliciesGetNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 422: result := NewPcloudIkepoliciesGetUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIkepoliciesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +75,7 @@ func NewPcloudIkepoliciesGetOK() *PcloudIkepoliciesGetOK { return &PcloudIkepoliciesGetOK{} } -/*PcloudIkepoliciesGetOK handles this case with default header values. +/* PcloudIkepoliciesGetOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +86,9 @@ type PcloudIkepoliciesGetOK struct { func (o *PcloudIkepoliciesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetOK %+v", 200, o.Payload) } +func (o *PcloudIkepoliciesGetOK) GetPayload() *models.IKEPolicy { + return o.Payload +} func (o *PcloudIkepoliciesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +107,7 @@ func NewPcloudIkepoliciesGetBadRequest() *PcloudIkepoliciesGetBadRequest { return &PcloudIkepoliciesGetBadRequest{} } -/*PcloudIkepoliciesGetBadRequest handles this case with default header values. +/* PcloudIkepoliciesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +118,9 @@ type PcloudIkepoliciesGetBadRequest struct { func (o *PcloudIkepoliciesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudIkepoliciesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +139,7 @@ func NewPcloudIkepoliciesGetUnauthorized() *PcloudIkepoliciesGetUnauthorized { return &PcloudIkepoliciesGetUnauthorized{} } -/*PcloudIkepoliciesGetUnauthorized handles this case with default header values. +/* PcloudIkepoliciesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +150,9 @@ type PcloudIkepoliciesGetUnauthorized struct { func (o *PcloudIkepoliciesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIkepoliciesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +171,7 @@ func NewPcloudIkepoliciesGetForbidden() *PcloudIkepoliciesGetForbidden { return &PcloudIkepoliciesGetForbidden{} } -/*PcloudIkepoliciesGetForbidden handles this case with default header values. +/* PcloudIkepoliciesGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +182,9 @@ type PcloudIkepoliciesGetForbidden struct { func (o *PcloudIkepoliciesGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetForbidden %+v", 403, o.Payload) } +func (o *PcloudIkepoliciesGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -188,12 +198,44 @@ func (o *PcloudIkepoliciesGetForbidden) readResponse(response runtime.ClientResp return nil } +// NewPcloudIkepoliciesGetNotFound creates a PcloudIkepoliciesGetNotFound with default headers values +func NewPcloudIkepoliciesGetNotFound() *PcloudIkepoliciesGetNotFound { + return &PcloudIkepoliciesGetNotFound{} +} + +/* PcloudIkepoliciesGetNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudIkepoliciesGetNotFound struct { + Payload *models.Error +} + +func (o *PcloudIkepoliciesGetNotFound) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetNotFound %+v", 404, o.Payload) +} +func (o *PcloudIkepoliciesGetNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudIkepoliciesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudIkepoliciesGetUnprocessableEntity creates a PcloudIkepoliciesGetUnprocessableEntity with default headers values func NewPcloudIkepoliciesGetUnprocessableEntity() *PcloudIkepoliciesGetUnprocessableEntity { return &PcloudIkepoliciesGetUnprocessableEntity{} } -/*PcloudIkepoliciesGetUnprocessableEntity handles this case with default header values. +/* PcloudIkepoliciesGetUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +246,9 @@ type PcloudIkepoliciesGetUnprocessableEntity struct { func (o *PcloudIkepoliciesGetUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudIkepoliciesGetUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +267,7 @@ func NewPcloudIkepoliciesGetInternalServerError() *PcloudIkepoliciesGetInternalS return &PcloudIkepoliciesGetInternalServerError{} } -/*PcloudIkepoliciesGetInternalServerError handles this case with default header values. +/* PcloudIkepoliciesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +278,9 @@ type PcloudIkepoliciesGetInternalServerError struct { func (o *PcloudIkepoliciesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIkepoliciesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go index 16f05f90cf..c83d29a40d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudIkepoliciesGetallParams creates a new PcloudIkepoliciesGetallParams object -// with the default values initialized. +// NewPcloudIkepoliciesGetallParams creates a new PcloudIkepoliciesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIkepoliciesGetallParams() *PcloudIkepoliciesGetallParams { - var () return &PcloudIkepoliciesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIkepoliciesGetallParamsWithTimeout creates a new PcloudIkepoliciesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIkepoliciesGetallParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesGetallParams { - var () return &PcloudIkepoliciesGetallParams{ - timeout: timeout, } } // NewPcloudIkepoliciesGetallParamsWithContext creates a new PcloudIkepoliciesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIkepoliciesGetallParamsWithContext(ctx context.Context) *PcloudIkepoliciesGetallParams { - var () return &PcloudIkepoliciesGetallParams{ - Context: ctx, } } // NewPcloudIkepoliciesGetallParamsWithHTTPClient creates a new PcloudIkepoliciesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIkepoliciesGetallParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesGetallParams { - var () return &PcloudIkepoliciesGetallParams{ HTTPClient: client, } } -/*PcloudIkepoliciesGetallParams contains all the parameters to send to the API endpoint -for the pcloud ikepolicies getall operation typically these are written to a http.Request +/* PcloudIkepoliciesGetallParams contains all the parameters to send to the API endpoint + for the pcloud ikepolicies getall operation. + + Typically these are written to a http.Request. */ type PcloudIkepoliciesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudIkepoliciesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ikepolicies getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesGetallParams) WithDefaults() *PcloudIkepoliciesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ikepolicies getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ikepolicies getall params func (o *PcloudIkepoliciesGetallParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go index e31868f285..8286d8f0ba 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIkepoliciesGetallReader is a Reader for the PcloudIkepoliciesGetall structure. @@ -24,51 +23,44 @@ type PcloudIkepoliciesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIkepoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIkepoliciesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIkepoliciesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIkepoliciesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIkepoliciesGetallForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudIkepoliciesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIkepoliciesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudIkepoliciesGetallOK() *PcloudIkepoliciesGetallOK { return &PcloudIkepoliciesGetallOK{} } -/*PcloudIkepoliciesGetallOK handles this case with default header values. +/* PcloudIkepoliciesGetallOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudIkepoliciesGetallOK struct { func (o *PcloudIkepoliciesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallOK %+v", 200, o.Payload) } +func (o *PcloudIkepoliciesGetallOK) GetPayload() *models.IKEPolicies { + return o.Payload +} func (o *PcloudIkepoliciesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudIkepoliciesGetallBadRequest() *PcloudIkepoliciesGetallBadRequest { return &PcloudIkepoliciesGetallBadRequest{} } -/*PcloudIkepoliciesGetallBadRequest handles this case with default header values. +/* PcloudIkepoliciesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudIkepoliciesGetallBadRequest struct { func (o *PcloudIkepoliciesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudIkepoliciesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudIkepoliciesGetallUnauthorized() *PcloudIkepoliciesGetallUnauthoriz return &PcloudIkepoliciesGetallUnauthorized{} } -/*PcloudIkepoliciesGetallUnauthorized handles this case with default header values. +/* PcloudIkepoliciesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudIkepoliciesGetallUnauthorized struct { func (o *PcloudIkepoliciesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIkepoliciesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudIkepoliciesGetallForbidden() *PcloudIkepoliciesGetallForbidden { return &PcloudIkepoliciesGetallForbidden{} } -/*PcloudIkepoliciesGetallForbidden handles this case with default header values. +/* PcloudIkepoliciesGetallForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudIkepoliciesGetallForbidden struct { func (o *PcloudIkepoliciesGetallForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallForbidden %+v", 403, o.Payload) } +func (o *PcloudIkepoliciesGetallForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudIkepoliciesGetallNotFound() *PcloudIkepoliciesGetallNotFound { return &PcloudIkepoliciesGetallNotFound{} } -/*PcloudIkepoliciesGetallNotFound handles this case with default header values. +/* PcloudIkepoliciesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudIkepoliciesGetallNotFound struct { func (o *PcloudIkepoliciesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudIkepoliciesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudIkepoliciesGetallInternalServerError() *PcloudIkepoliciesGetallInt return &PcloudIkepoliciesGetallInternalServerError{} } -/*PcloudIkepoliciesGetallInternalServerError handles this case with default header values. +/* PcloudIkepoliciesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudIkepoliciesGetallInternalServerError struct { func (o *PcloudIkepoliciesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIkepoliciesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go index 2b4db36ff3..57d82f091a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudIkepoliciesPostParams creates a new PcloudIkepoliciesPostParams object -// with the default values initialized. +// NewPcloudIkepoliciesPostParams creates a new PcloudIkepoliciesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIkepoliciesPostParams() *PcloudIkepoliciesPostParams { - var () return &PcloudIkepoliciesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIkepoliciesPostParamsWithTimeout creates a new PcloudIkepoliciesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIkepoliciesPostParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesPostParams { - var () return &PcloudIkepoliciesPostParams{ - timeout: timeout, } } // NewPcloudIkepoliciesPostParamsWithContext creates a new PcloudIkepoliciesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIkepoliciesPostParamsWithContext(ctx context.Context) *PcloudIkepoliciesPostParams { - var () return &PcloudIkepoliciesPostParams{ - Context: ctx, } } // NewPcloudIkepoliciesPostParamsWithHTTPClient creates a new PcloudIkepoliciesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIkepoliciesPostParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesPostParams { - var () return &PcloudIkepoliciesPostParams{ HTTPClient: client, } } -/*PcloudIkepoliciesPostParams contains all the parameters to send to the API endpoint -for the pcloud ikepolicies post operation typically these are written to a http.Request +/* PcloudIkepoliciesPostParams contains all the parameters to send to the API endpoint + for the pcloud ikepolicies post operation. + + Typically these are written to a http.Request. */ type PcloudIkepoliciesPostParams struct { - /*Body - Parameters for the creation of a new IKE Policy + /* Body. + Parameters for the creation of a new IKE Policy */ Body *models.IKEPolicyCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudIkepoliciesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ikepolicies post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesPostParams) WithDefaults() *PcloudIkepoliciesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ikepolicies post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ikepolicies post params func (o *PcloudIkepoliciesPostParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudIkepoliciesPostParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go index 1e6e5d34f6..3b3d81964d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIkepoliciesPostReader is a Reader for the PcloudIkepoliciesPost structure. @@ -24,58 +23,50 @@ type PcloudIkepoliciesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIkepoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIkepoliciesPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIkepoliciesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIkepoliciesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIkepoliciesPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudIkepoliciesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudIkepoliciesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIkepoliciesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudIkepoliciesPostOK() *PcloudIkepoliciesPostOK { return &PcloudIkepoliciesPostOK{} } -/*PcloudIkepoliciesPostOK handles this case with default header values. +/* PcloudIkepoliciesPostOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudIkepoliciesPostOK struct { func (o *PcloudIkepoliciesPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostOK %+v", 200, o.Payload) } +func (o *PcloudIkepoliciesPostOK) GetPayload() *models.IKEPolicy { + return o.Payload +} func (o *PcloudIkepoliciesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudIkepoliciesPostBadRequest() *PcloudIkepoliciesPostBadRequest { return &PcloudIkepoliciesPostBadRequest{} } -/*PcloudIkepoliciesPostBadRequest handles this case with default header values. +/* PcloudIkepoliciesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudIkepoliciesPostBadRequest struct { func (o *PcloudIkepoliciesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudIkepoliciesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudIkepoliciesPostUnauthorized() *PcloudIkepoliciesPostUnauthorized { return &PcloudIkepoliciesPostUnauthorized{} } -/*PcloudIkepoliciesPostUnauthorized handles this case with default header values. +/* PcloudIkepoliciesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudIkepoliciesPostUnauthorized struct { func (o *PcloudIkepoliciesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIkepoliciesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudIkepoliciesPostForbidden() *PcloudIkepoliciesPostForbidden { return &PcloudIkepoliciesPostForbidden{} } -/*PcloudIkepoliciesPostForbidden handles this case with default header values. +/* PcloudIkepoliciesPostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudIkepoliciesPostForbidden struct { func (o *PcloudIkepoliciesPostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostForbidden %+v", 403, o.Payload) } +func (o *PcloudIkepoliciesPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudIkepoliciesPostConflict() *PcloudIkepoliciesPostConflict { return &PcloudIkepoliciesPostConflict{} } -/*PcloudIkepoliciesPostConflict handles this case with default header values. +/* PcloudIkepoliciesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudIkepoliciesPostConflict struct { func (o *PcloudIkepoliciesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostConflict %+v", 409, o.Payload) } +func (o *PcloudIkepoliciesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudIkepoliciesPostUnprocessableEntity() *PcloudIkepoliciesPostUnproce return &PcloudIkepoliciesPostUnprocessableEntity{} } -/*PcloudIkepoliciesPostUnprocessableEntity handles this case with default header values. +/* PcloudIkepoliciesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudIkepoliciesPostUnprocessableEntity struct { func (o *PcloudIkepoliciesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudIkepoliciesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudIkepoliciesPostInternalServerError() *PcloudIkepoliciesPostInterna return &PcloudIkepoliciesPostInternalServerError{} } -/*PcloudIkepoliciesPostInternalServerError handles this case with default header values. +/* PcloudIkepoliciesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudIkepoliciesPostInternalServerError struct { func (o *PcloudIkepoliciesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIkepoliciesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go index 4ddfb840bd..c845b8aee9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudIkepoliciesPutParams creates a new PcloudIkepoliciesPutParams object -// with the default values initialized. +// NewPcloudIkepoliciesPutParams creates a new PcloudIkepoliciesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIkepoliciesPutParams() *PcloudIkepoliciesPutParams { - var () return &PcloudIkepoliciesPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIkepoliciesPutParamsWithTimeout creates a new PcloudIkepoliciesPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIkepoliciesPutParamsWithTimeout(timeout time.Duration) *PcloudIkepoliciesPutParams { - var () return &PcloudIkepoliciesPutParams{ - timeout: timeout, } } // NewPcloudIkepoliciesPutParamsWithContext creates a new PcloudIkepoliciesPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIkepoliciesPutParamsWithContext(ctx context.Context) *PcloudIkepoliciesPutParams { - var () return &PcloudIkepoliciesPutParams{ - Context: ctx, } } // NewPcloudIkepoliciesPutParamsWithHTTPClient creates a new PcloudIkepoliciesPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIkepoliciesPutParamsWithHTTPClient(client *http.Client) *PcloudIkepoliciesPutParams { - var () return &PcloudIkepoliciesPutParams{ HTTPClient: client, } } -/*PcloudIkepoliciesPutParams contains all the parameters to send to the API endpoint -for the pcloud ikepolicies put operation typically these are written to a http.Request +/* PcloudIkepoliciesPutParams contains all the parameters to send to the API endpoint + for the pcloud ikepolicies put operation. + + Typically these are written to a http.Request. */ type PcloudIkepoliciesPutParams struct { - /*Body - Parameters for updating IKE Policy + /* Body. + Parameters for updating IKE Policy */ Body *models.IKEPolicyUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*IkePolicyID - ID of a IKE Policy + /* IkePolicyID. + + ID of a IKE Policy */ IkePolicyID string @@ -84,6 +84,21 @@ type PcloudIkepoliciesPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ikepolicies put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesPutParams) WithDefaults() *PcloudIkepoliciesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ikepolicies put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIkepoliciesPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ikepolicies put params func (o *PcloudIkepoliciesPutParams) WithTimeout(timeout time.Duration) *PcloudIkepoliciesPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudIkepoliciesPutParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go index f420045e1d..b9350c86f8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIkepoliciesPutReader is a Reader for the PcloudIkepoliciesPut structure. @@ -24,51 +23,44 @@ type PcloudIkepoliciesPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIkepoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIkepoliciesPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIkepoliciesPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIkepoliciesPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIkepoliciesPutForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudIkepoliciesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIkepoliciesPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudIkepoliciesPutOK() *PcloudIkepoliciesPutOK { return &PcloudIkepoliciesPutOK{} } -/*PcloudIkepoliciesPutOK handles this case with default header values. +/* PcloudIkepoliciesPutOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudIkepoliciesPutOK struct { func (o *PcloudIkepoliciesPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutOK %+v", 200, o.Payload) } +func (o *PcloudIkepoliciesPutOK) GetPayload() *models.IKEPolicy { + return o.Payload +} func (o *PcloudIkepoliciesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudIkepoliciesPutBadRequest() *PcloudIkepoliciesPutBadRequest { return &PcloudIkepoliciesPutBadRequest{} } -/*PcloudIkepoliciesPutBadRequest handles this case with default header values. +/* PcloudIkepoliciesPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudIkepoliciesPutBadRequest struct { func (o *PcloudIkepoliciesPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudIkepoliciesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudIkepoliciesPutUnauthorized() *PcloudIkepoliciesPutUnauthorized { return &PcloudIkepoliciesPutUnauthorized{} } -/*PcloudIkepoliciesPutUnauthorized handles this case with default header values. +/* PcloudIkepoliciesPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudIkepoliciesPutUnauthorized struct { func (o *PcloudIkepoliciesPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIkepoliciesPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudIkepoliciesPutForbidden() *PcloudIkepoliciesPutForbidden { return &PcloudIkepoliciesPutForbidden{} } -/*PcloudIkepoliciesPutForbidden handles this case with default header values. +/* PcloudIkepoliciesPutForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudIkepoliciesPutForbidden struct { func (o *PcloudIkepoliciesPutForbidden) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutForbidden %+v", 403, o.Payload) } +func (o *PcloudIkepoliciesPutForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudIkepoliciesPutUnprocessableEntity() *PcloudIkepoliciesPutUnprocess return &PcloudIkepoliciesPutUnprocessableEntity{} } -/*PcloudIkepoliciesPutUnprocessableEntity handles this case with default header values. +/* PcloudIkepoliciesPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudIkepoliciesPutUnprocessableEntity struct { func (o *PcloudIkepoliciesPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudIkepoliciesPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudIkepoliciesPutInternalServerError() *PcloudIkepoliciesPutInternalS return &PcloudIkepoliciesPutInternalServerError{} } -/*PcloudIkepoliciesPutInternalServerError handles this case with default header values. +/* PcloudIkepoliciesPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudIkepoliciesPutInternalServerError struct { func (o *PcloudIkepoliciesPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIkepoliciesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIkepoliciesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go index 8982b8b752..fdd67659cc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudIpsecpoliciesDeleteParams creates a new PcloudIpsecpoliciesDeleteParams object -// with the default values initialized. +// NewPcloudIpsecpoliciesDeleteParams creates a new PcloudIpsecpoliciesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIpsecpoliciesDeleteParams() *PcloudIpsecpoliciesDeleteParams { - var () return &PcloudIpsecpoliciesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIpsecpoliciesDeleteParamsWithTimeout creates a new PcloudIpsecpoliciesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIpsecpoliciesDeleteParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesDeleteParams { - var () return &PcloudIpsecpoliciesDeleteParams{ - timeout: timeout, } } // NewPcloudIpsecpoliciesDeleteParamsWithContext creates a new PcloudIpsecpoliciesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIpsecpoliciesDeleteParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesDeleteParams { - var () return &PcloudIpsecpoliciesDeleteParams{ - Context: ctx, } } // NewPcloudIpsecpoliciesDeleteParamsWithHTTPClient creates a new PcloudIpsecpoliciesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIpsecpoliciesDeleteParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesDeleteParams { - var () return &PcloudIpsecpoliciesDeleteParams{ HTTPClient: client, } } -/*PcloudIpsecpoliciesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud ipsecpolicies delete operation typically these are written to a http.Request +/* PcloudIpsecpoliciesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud ipsecpolicies delete operation. + + Typically these are written to a http.Request. */ type PcloudIpsecpoliciesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*IpsecPolicyID - ID of a IPSec Policy + /* IpsecPolicyID. + + ID of a IPSec Policy */ IpsecPolicyID string @@ -77,6 +76,21 @@ type PcloudIpsecpoliciesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ipsecpolicies delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesDeleteParams) WithDefaults() *PcloudIpsecpoliciesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ipsecpolicies delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ipsecpolicies delete params func (o *PcloudIpsecpoliciesDeleteParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go index d0229fba65..0d01bf97cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIpsecpoliciesDeleteReader is a Reader for the PcloudIpsecpoliciesDelete structure. @@ -24,44 +23,44 @@ type PcloudIpsecpoliciesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIpsecpoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIpsecpoliciesDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIpsecpoliciesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIpsecpoliciesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIpsecpoliciesDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - + case 404: + result := NewPcloudIpsecpoliciesDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 500: result := NewPcloudIpsecpoliciesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +69,7 @@ func NewPcloudIpsecpoliciesDeleteOK() *PcloudIpsecpoliciesDeleteOK { return &PcloudIpsecpoliciesDeleteOK{} } -/*PcloudIpsecpoliciesDeleteOK handles this case with default header values. +/* PcloudIpsecpoliciesDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +80,9 @@ type PcloudIpsecpoliciesDeleteOK struct { func (o *PcloudIpsecpoliciesDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteOK %+v", 200, o.Payload) } +func (o *PcloudIpsecpoliciesDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudIpsecpoliciesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +99,7 @@ func NewPcloudIpsecpoliciesDeleteBadRequest() *PcloudIpsecpoliciesDeleteBadReque return &PcloudIpsecpoliciesDeleteBadRequest{} } -/*PcloudIpsecpoliciesDeleteBadRequest handles this case with default header values. +/* PcloudIpsecpoliciesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +110,9 @@ type PcloudIpsecpoliciesDeleteBadRequest struct { func (o *PcloudIpsecpoliciesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudIpsecpoliciesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +131,7 @@ func NewPcloudIpsecpoliciesDeleteUnauthorized() *PcloudIpsecpoliciesDeleteUnauth return &PcloudIpsecpoliciesDeleteUnauthorized{} } -/*PcloudIpsecpoliciesDeleteUnauthorized handles this case with default header values. +/* PcloudIpsecpoliciesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +142,9 @@ type PcloudIpsecpoliciesDeleteUnauthorized struct { func (o *PcloudIpsecpoliciesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIpsecpoliciesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +163,7 @@ func NewPcloudIpsecpoliciesDeleteForbidden() *PcloudIpsecpoliciesDeleteForbidden return &PcloudIpsecpoliciesDeleteForbidden{} } -/*PcloudIpsecpoliciesDeleteForbidden handles this case with default header values. +/* PcloudIpsecpoliciesDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -166,6 +174,9 @@ type PcloudIpsecpoliciesDeleteForbidden struct { func (o *PcloudIpsecpoliciesDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudIpsecpoliciesDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -179,12 +190,44 @@ func (o *PcloudIpsecpoliciesDeleteForbidden) readResponse(response runtime.Clien return nil } +// NewPcloudIpsecpoliciesDeleteNotFound creates a PcloudIpsecpoliciesDeleteNotFound with default headers values +func NewPcloudIpsecpoliciesDeleteNotFound() *PcloudIpsecpoliciesDeleteNotFound { + return &PcloudIpsecpoliciesDeleteNotFound{} +} + +/* PcloudIpsecpoliciesDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudIpsecpoliciesDeleteNotFound struct { + Payload *models.Error +} + +func (o *PcloudIpsecpoliciesDeleteNotFound) Error() string { + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteNotFound %+v", 404, o.Payload) +} +func (o *PcloudIpsecpoliciesDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudIpsecpoliciesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudIpsecpoliciesDeleteInternalServerError creates a PcloudIpsecpoliciesDeleteInternalServerError with default headers values func NewPcloudIpsecpoliciesDeleteInternalServerError() *PcloudIpsecpoliciesDeleteInternalServerError { return &PcloudIpsecpoliciesDeleteInternalServerError{} } -/*PcloudIpsecpoliciesDeleteInternalServerError handles this case with default header values. +/* PcloudIpsecpoliciesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +238,9 @@ type PcloudIpsecpoliciesDeleteInternalServerError struct { func (o *PcloudIpsecpoliciesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIpsecpoliciesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go index 82d7b1b5a8..8f24e703cb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudIpsecpoliciesGetParams creates a new PcloudIpsecpoliciesGetParams object -// with the default values initialized. +// NewPcloudIpsecpoliciesGetParams creates a new PcloudIpsecpoliciesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIpsecpoliciesGetParams() *PcloudIpsecpoliciesGetParams { - var () return &PcloudIpsecpoliciesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIpsecpoliciesGetParamsWithTimeout creates a new PcloudIpsecpoliciesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIpsecpoliciesGetParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetParams { - var () return &PcloudIpsecpoliciesGetParams{ - timeout: timeout, } } // NewPcloudIpsecpoliciesGetParamsWithContext creates a new PcloudIpsecpoliciesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIpsecpoliciesGetParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesGetParams { - var () return &PcloudIpsecpoliciesGetParams{ - Context: ctx, } } // NewPcloudIpsecpoliciesGetParamsWithHTTPClient creates a new PcloudIpsecpoliciesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIpsecpoliciesGetParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesGetParams { - var () return &PcloudIpsecpoliciesGetParams{ HTTPClient: client, } } -/*PcloudIpsecpoliciesGetParams contains all the parameters to send to the API endpoint -for the pcloud ipsecpolicies get operation typically these are written to a http.Request +/* PcloudIpsecpoliciesGetParams contains all the parameters to send to the API endpoint + for the pcloud ipsecpolicies get operation. + + Typically these are written to a http.Request. */ type PcloudIpsecpoliciesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*IpsecPolicyID - ID of a IPSec Policy + /* IpsecPolicyID. + + ID of a IPSec Policy */ IpsecPolicyID string @@ -77,6 +76,21 @@ type PcloudIpsecpoliciesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ipsecpolicies get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesGetParams) WithDefaults() *PcloudIpsecpoliciesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ipsecpolicies get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ipsecpolicies get params func (o *PcloudIpsecpoliciesGetParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go index 66ee77b4e1..ddaa9a9b8e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIpsecpoliciesGetReader is a Reader for the PcloudIpsecpoliciesGet structure. @@ -24,51 +23,50 @@ type PcloudIpsecpoliciesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIpsecpoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIpsecpoliciesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIpsecpoliciesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIpsecpoliciesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIpsecpoliciesGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - + case 404: + result := NewPcloudIpsecpoliciesGetNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 422: result := NewPcloudIpsecpoliciesGetUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIpsecpoliciesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +75,7 @@ func NewPcloudIpsecpoliciesGetOK() *PcloudIpsecpoliciesGetOK { return &PcloudIpsecpoliciesGetOK{} } -/*PcloudIpsecpoliciesGetOK handles this case with default header values. +/* PcloudIpsecpoliciesGetOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +86,9 @@ type PcloudIpsecpoliciesGetOK struct { func (o *PcloudIpsecpoliciesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetOK %+v", 200, o.Payload) } +func (o *PcloudIpsecpoliciesGetOK) GetPayload() *models.IPSecPolicy { + return o.Payload +} func (o *PcloudIpsecpoliciesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +107,7 @@ func NewPcloudIpsecpoliciesGetBadRequest() *PcloudIpsecpoliciesGetBadRequest { return &PcloudIpsecpoliciesGetBadRequest{} } -/*PcloudIpsecpoliciesGetBadRequest handles this case with default header values. +/* PcloudIpsecpoliciesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +118,9 @@ type PcloudIpsecpoliciesGetBadRequest struct { func (o *PcloudIpsecpoliciesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudIpsecpoliciesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +139,7 @@ func NewPcloudIpsecpoliciesGetUnauthorized() *PcloudIpsecpoliciesGetUnauthorized return &PcloudIpsecpoliciesGetUnauthorized{} } -/*PcloudIpsecpoliciesGetUnauthorized handles this case with default header values. +/* PcloudIpsecpoliciesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +150,9 @@ type PcloudIpsecpoliciesGetUnauthorized struct { func (o *PcloudIpsecpoliciesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIpsecpoliciesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +171,7 @@ func NewPcloudIpsecpoliciesGetForbidden() *PcloudIpsecpoliciesGetForbidden { return &PcloudIpsecpoliciesGetForbidden{} } -/*PcloudIpsecpoliciesGetForbidden handles this case with default header values. +/* PcloudIpsecpoliciesGetForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +182,9 @@ type PcloudIpsecpoliciesGetForbidden struct { func (o *PcloudIpsecpoliciesGetForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetForbidden %+v", 403, o.Payload) } +func (o *PcloudIpsecpoliciesGetForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -188,12 +198,44 @@ func (o *PcloudIpsecpoliciesGetForbidden) readResponse(response runtime.ClientRe return nil } +// NewPcloudIpsecpoliciesGetNotFound creates a PcloudIpsecpoliciesGetNotFound with default headers values +func NewPcloudIpsecpoliciesGetNotFound() *PcloudIpsecpoliciesGetNotFound { + return &PcloudIpsecpoliciesGetNotFound{} +} + +/* PcloudIpsecpoliciesGetNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudIpsecpoliciesGetNotFound struct { + Payload *models.Error +} + +func (o *PcloudIpsecpoliciesGetNotFound) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetNotFound %+v", 404, o.Payload) +} +func (o *PcloudIpsecpoliciesGetNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudIpsecpoliciesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudIpsecpoliciesGetUnprocessableEntity creates a PcloudIpsecpoliciesGetUnprocessableEntity with default headers values func NewPcloudIpsecpoliciesGetUnprocessableEntity() *PcloudIpsecpoliciesGetUnprocessableEntity { return &PcloudIpsecpoliciesGetUnprocessableEntity{} } -/*PcloudIpsecpoliciesGetUnprocessableEntity handles this case with default header values. +/* PcloudIpsecpoliciesGetUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +246,9 @@ type PcloudIpsecpoliciesGetUnprocessableEntity struct { func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudIpsecpoliciesGetUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +267,7 @@ func NewPcloudIpsecpoliciesGetInternalServerError() *PcloudIpsecpoliciesGetInter return &PcloudIpsecpoliciesGetInternalServerError{} } -/*PcloudIpsecpoliciesGetInternalServerError handles this case with default header values. +/* PcloudIpsecpoliciesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +278,9 @@ type PcloudIpsecpoliciesGetInternalServerError struct { func (o *PcloudIpsecpoliciesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIpsecpoliciesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go index 90d5541140..6d9a00d3a3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_parameters.go @@ -13,57 +13,55 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudIpsecpoliciesGetallParams creates a new PcloudIpsecpoliciesGetallParams object -// with the default values initialized. +// NewPcloudIpsecpoliciesGetallParams creates a new PcloudIpsecpoliciesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIpsecpoliciesGetallParams() *PcloudIpsecpoliciesGetallParams { - var () return &PcloudIpsecpoliciesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIpsecpoliciesGetallParamsWithTimeout creates a new PcloudIpsecpoliciesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIpsecpoliciesGetallParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetallParams { - var () return &PcloudIpsecpoliciesGetallParams{ - timeout: timeout, } } // NewPcloudIpsecpoliciesGetallParamsWithContext creates a new PcloudIpsecpoliciesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIpsecpoliciesGetallParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesGetallParams { - var () return &PcloudIpsecpoliciesGetallParams{ - Context: ctx, } } // NewPcloudIpsecpoliciesGetallParamsWithHTTPClient creates a new PcloudIpsecpoliciesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIpsecpoliciesGetallParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesGetallParams { - var () return &PcloudIpsecpoliciesGetallParams{ HTTPClient: client, } } -/*PcloudIpsecpoliciesGetallParams contains all the parameters to send to the API endpoint -for the pcloud ipsecpolicies getall operation typically these are written to a http.Request +/* PcloudIpsecpoliciesGetallParams contains all the parameters to send to the API endpoint + for the pcloud ipsecpolicies getall operation. + + Typically these are written to a http.Request. */ type PcloudIpsecpoliciesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -72,6 +70,21 @@ type PcloudIpsecpoliciesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ipsecpolicies getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesGetallParams) WithDefaults() *PcloudIpsecpoliciesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ipsecpolicies getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ipsecpolicies getall params func (o *PcloudIpsecpoliciesGetallParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go index b09be973bb..92925b59b4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIpsecpoliciesGetallReader is a Reader for the PcloudIpsecpoliciesGetall structure. @@ -24,51 +23,44 @@ type PcloudIpsecpoliciesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIpsecpoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIpsecpoliciesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIpsecpoliciesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIpsecpoliciesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIpsecpoliciesGetallForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudIpsecpoliciesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIpsecpoliciesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudIpsecpoliciesGetallOK() *PcloudIpsecpoliciesGetallOK { return &PcloudIpsecpoliciesGetallOK{} } -/*PcloudIpsecpoliciesGetallOK handles this case with default header values. +/* PcloudIpsecpoliciesGetallOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudIpsecpoliciesGetallOK struct { func (o *PcloudIpsecpoliciesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallOK %+v", 200, o.Payload) } +func (o *PcloudIpsecpoliciesGetallOK) GetPayload() *models.IPSecPolicies { + return o.Payload +} func (o *PcloudIpsecpoliciesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudIpsecpoliciesGetallBadRequest() *PcloudIpsecpoliciesGetallBadReque return &PcloudIpsecpoliciesGetallBadRequest{} } -/*PcloudIpsecpoliciesGetallBadRequest handles this case with default header values. +/* PcloudIpsecpoliciesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudIpsecpoliciesGetallBadRequest struct { func (o *PcloudIpsecpoliciesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudIpsecpoliciesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudIpsecpoliciesGetallUnauthorized() *PcloudIpsecpoliciesGetallUnauth return &PcloudIpsecpoliciesGetallUnauthorized{} } -/*PcloudIpsecpoliciesGetallUnauthorized handles this case with default header values. +/* PcloudIpsecpoliciesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudIpsecpoliciesGetallUnauthorized struct { func (o *PcloudIpsecpoliciesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIpsecpoliciesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudIpsecpoliciesGetallForbidden() *PcloudIpsecpoliciesGetallForbidden return &PcloudIpsecpoliciesGetallForbidden{} } -/*PcloudIpsecpoliciesGetallForbidden handles this case with default header values. +/* PcloudIpsecpoliciesGetallForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudIpsecpoliciesGetallForbidden struct { func (o *PcloudIpsecpoliciesGetallForbidden) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallForbidden %+v", 403, o.Payload) } +func (o *PcloudIpsecpoliciesGetallForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudIpsecpoliciesGetallNotFound() *PcloudIpsecpoliciesGetallNotFound { return &PcloudIpsecpoliciesGetallNotFound{} } -/*PcloudIpsecpoliciesGetallNotFound handles this case with default header values. +/* PcloudIpsecpoliciesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudIpsecpoliciesGetallNotFound struct { func (o *PcloudIpsecpoliciesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudIpsecpoliciesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudIpsecpoliciesGetallInternalServerError() *PcloudIpsecpoliciesGetal return &PcloudIpsecpoliciesGetallInternalServerError{} } -/*PcloudIpsecpoliciesGetallInternalServerError handles this case with default header values. +/* PcloudIpsecpoliciesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudIpsecpoliciesGetallInternalServerError struct { func (o *PcloudIpsecpoliciesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIpsecpoliciesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go index 303aceb3a1..a09d4300f1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudIpsecpoliciesPostParams creates a new PcloudIpsecpoliciesPostParams object -// with the default values initialized. +// NewPcloudIpsecpoliciesPostParams creates a new PcloudIpsecpoliciesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIpsecpoliciesPostParams() *PcloudIpsecpoliciesPostParams { - var () return &PcloudIpsecpoliciesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIpsecpoliciesPostParamsWithTimeout creates a new PcloudIpsecpoliciesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIpsecpoliciesPostParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPostParams { - var () return &PcloudIpsecpoliciesPostParams{ - timeout: timeout, } } // NewPcloudIpsecpoliciesPostParamsWithContext creates a new PcloudIpsecpoliciesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIpsecpoliciesPostParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesPostParams { - var () return &PcloudIpsecpoliciesPostParams{ - Context: ctx, } } // NewPcloudIpsecpoliciesPostParamsWithHTTPClient creates a new PcloudIpsecpoliciesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIpsecpoliciesPostParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesPostParams { - var () return &PcloudIpsecpoliciesPostParams{ HTTPClient: client, } } -/*PcloudIpsecpoliciesPostParams contains all the parameters to send to the API endpoint -for the pcloud ipsecpolicies post operation typically these are written to a http.Request +/* PcloudIpsecpoliciesPostParams contains all the parameters to send to the API endpoint + for the pcloud ipsecpolicies post operation. + + Typically these are written to a http.Request. */ type PcloudIpsecpoliciesPostParams struct { - /*Body - Parameters for the creation of a new IPSec Policy + /* Body. + Parameters for the creation of a new IPSec Policy */ Body *models.IPSecPolicyCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudIpsecpoliciesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ipsecpolicies post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesPostParams) WithDefaults() *PcloudIpsecpoliciesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ipsecpolicies post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ipsecpolicies post params func (o *PcloudIpsecpoliciesPostParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudIpsecpoliciesPostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go index eae76371f5..20620cea35 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIpsecpoliciesPostReader is a Reader for the PcloudIpsecpoliciesPost structure. @@ -24,58 +23,50 @@ type PcloudIpsecpoliciesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIpsecpoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIpsecpoliciesPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIpsecpoliciesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIpsecpoliciesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIpsecpoliciesPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudIpsecpoliciesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudIpsecpoliciesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIpsecpoliciesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudIpsecpoliciesPostOK() *PcloudIpsecpoliciesPostOK { return &PcloudIpsecpoliciesPostOK{} } -/*PcloudIpsecpoliciesPostOK handles this case with default header values. +/* PcloudIpsecpoliciesPostOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudIpsecpoliciesPostOK struct { func (o *PcloudIpsecpoliciesPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostOK %+v", 200, o.Payload) } +func (o *PcloudIpsecpoliciesPostOK) GetPayload() *models.IPSecPolicy { + return o.Payload +} func (o *PcloudIpsecpoliciesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudIpsecpoliciesPostBadRequest() *PcloudIpsecpoliciesPostBadRequest { return &PcloudIpsecpoliciesPostBadRequest{} } -/*PcloudIpsecpoliciesPostBadRequest handles this case with default header values. +/* PcloudIpsecpoliciesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudIpsecpoliciesPostBadRequest struct { func (o *PcloudIpsecpoliciesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudIpsecpoliciesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudIpsecpoliciesPostUnauthorized() *PcloudIpsecpoliciesPostUnauthoriz return &PcloudIpsecpoliciesPostUnauthorized{} } -/*PcloudIpsecpoliciesPostUnauthorized handles this case with default header values. +/* PcloudIpsecpoliciesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudIpsecpoliciesPostUnauthorized struct { func (o *PcloudIpsecpoliciesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIpsecpoliciesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudIpsecpoliciesPostForbidden() *PcloudIpsecpoliciesPostForbidden { return &PcloudIpsecpoliciesPostForbidden{} } -/*PcloudIpsecpoliciesPostForbidden handles this case with default header values. +/* PcloudIpsecpoliciesPostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudIpsecpoliciesPostForbidden struct { func (o *PcloudIpsecpoliciesPostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostForbidden %+v", 403, o.Payload) } +func (o *PcloudIpsecpoliciesPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudIpsecpoliciesPostConflict() *PcloudIpsecpoliciesPostConflict { return &PcloudIpsecpoliciesPostConflict{} } -/*PcloudIpsecpoliciesPostConflict handles this case with default header values. +/* PcloudIpsecpoliciesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudIpsecpoliciesPostConflict struct { func (o *PcloudIpsecpoliciesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostConflict %+v", 409, o.Payload) } +func (o *PcloudIpsecpoliciesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudIpsecpoliciesPostUnprocessableEntity() *PcloudIpsecpoliciesPostUnp return &PcloudIpsecpoliciesPostUnprocessableEntity{} } -/*PcloudIpsecpoliciesPostUnprocessableEntity handles this case with default header values. +/* PcloudIpsecpoliciesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudIpsecpoliciesPostUnprocessableEntity struct { func (o *PcloudIpsecpoliciesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudIpsecpoliciesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudIpsecpoliciesPostInternalServerError() *PcloudIpsecpoliciesPostInt return &PcloudIpsecpoliciesPostInternalServerError{} } -/*PcloudIpsecpoliciesPostInternalServerError handles this case with default header values. +/* PcloudIpsecpoliciesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudIpsecpoliciesPostInternalServerError struct { func (o *PcloudIpsecpoliciesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIpsecpoliciesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go index 29df956956..4849277eaa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudIpsecpoliciesPutParams creates a new PcloudIpsecpoliciesPutParams object -// with the default values initialized. +// NewPcloudIpsecpoliciesPutParams creates a new PcloudIpsecpoliciesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudIpsecpoliciesPutParams() *PcloudIpsecpoliciesPutParams { - var () return &PcloudIpsecpoliciesPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudIpsecpoliciesPutParamsWithTimeout creates a new PcloudIpsecpoliciesPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudIpsecpoliciesPutParamsWithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPutParams { - var () return &PcloudIpsecpoliciesPutParams{ - timeout: timeout, } } // NewPcloudIpsecpoliciesPutParamsWithContext creates a new PcloudIpsecpoliciesPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudIpsecpoliciesPutParamsWithContext(ctx context.Context) *PcloudIpsecpoliciesPutParams { - var () return &PcloudIpsecpoliciesPutParams{ - Context: ctx, } } // NewPcloudIpsecpoliciesPutParamsWithHTTPClient creates a new PcloudIpsecpoliciesPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudIpsecpoliciesPutParamsWithHTTPClient(client *http.Client) *PcloudIpsecpoliciesPutParams { - var () return &PcloudIpsecpoliciesPutParams{ HTTPClient: client, } } -/*PcloudIpsecpoliciesPutParams contains all the parameters to send to the API endpoint -for the pcloud ipsecpolicies put operation typically these are written to a http.Request +/* PcloudIpsecpoliciesPutParams contains all the parameters to send to the API endpoint + for the pcloud ipsecpolicies put operation. + + Typically these are written to a http.Request. */ type PcloudIpsecpoliciesPutParams struct { - /*Body - Parameters for the update of an IPSec Policy + /* Body. + Parameters for the update of an IPSec Policy */ Body *models.IPSecPolicyUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*IpsecPolicyID - ID of a IPSec Policy + /* IpsecPolicyID. + + ID of a IPSec Policy */ IpsecPolicyID string @@ -84,6 +84,21 @@ type PcloudIpsecpoliciesPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud ipsecpolicies put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesPutParams) WithDefaults() *PcloudIpsecpoliciesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud ipsecpolicies put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudIpsecpoliciesPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud ipsecpolicies put params func (o *PcloudIpsecpoliciesPutParams) WithTimeout(timeout time.Duration) *PcloudIpsecpoliciesPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudIpsecpoliciesPutParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go index bf21644009..feb151312c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudIpsecpoliciesPutReader is a Reader for the PcloudIpsecpoliciesPut structure. @@ -24,58 +23,50 @@ type PcloudIpsecpoliciesPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudIpsecpoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudIpsecpoliciesPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudIpsecpoliciesPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudIpsecpoliciesPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudIpsecpoliciesPutForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudIpsecpoliciesPutConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudIpsecpoliciesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudIpsecpoliciesPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudIpsecpoliciesPutOK() *PcloudIpsecpoliciesPutOK { return &PcloudIpsecpoliciesPutOK{} } -/*PcloudIpsecpoliciesPutOK handles this case with default header values. +/* PcloudIpsecpoliciesPutOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudIpsecpoliciesPutOK struct { func (o *PcloudIpsecpoliciesPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutOK %+v", 200, o.Payload) } +func (o *PcloudIpsecpoliciesPutOK) GetPayload() *models.IPSecPolicy { + return o.Payload +} func (o *PcloudIpsecpoliciesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -113,7 +107,7 @@ func NewPcloudIpsecpoliciesPutBadRequest() *PcloudIpsecpoliciesPutBadRequest { return &PcloudIpsecpoliciesPutBadRequest{} } -/*PcloudIpsecpoliciesPutBadRequest handles this case with default header values. +/* PcloudIpsecpoliciesPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -124,6 +118,9 @@ type PcloudIpsecpoliciesPutBadRequest struct { func (o *PcloudIpsecpoliciesPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudIpsecpoliciesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -142,7 +139,7 @@ func NewPcloudIpsecpoliciesPutUnauthorized() *PcloudIpsecpoliciesPutUnauthorized return &PcloudIpsecpoliciesPutUnauthorized{} } -/*PcloudIpsecpoliciesPutUnauthorized handles this case with default header values. +/* PcloudIpsecpoliciesPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -153,6 +150,9 @@ type PcloudIpsecpoliciesPutUnauthorized struct { func (o *PcloudIpsecpoliciesPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudIpsecpoliciesPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -171,7 +171,7 @@ func NewPcloudIpsecpoliciesPutForbidden() *PcloudIpsecpoliciesPutForbidden { return &PcloudIpsecpoliciesPutForbidden{} } -/*PcloudIpsecpoliciesPutForbidden handles this case with default header values. +/* PcloudIpsecpoliciesPutForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -182,6 +182,9 @@ type PcloudIpsecpoliciesPutForbidden struct { func (o *PcloudIpsecpoliciesPutForbidden) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutForbidden %+v", 403, o.Payload) } +func (o *PcloudIpsecpoliciesPutForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -200,7 +203,7 @@ func NewPcloudIpsecpoliciesPutConflict() *PcloudIpsecpoliciesPutConflict { return &PcloudIpsecpoliciesPutConflict{} } -/*PcloudIpsecpoliciesPutConflict handles this case with default header values. +/* PcloudIpsecpoliciesPutConflict describes a response with status code 409, with default header values. Conflict */ @@ -211,6 +214,9 @@ type PcloudIpsecpoliciesPutConflict struct { func (o *PcloudIpsecpoliciesPutConflict) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutConflict %+v", 409, o.Payload) } +func (o *PcloudIpsecpoliciesPutConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,7 +235,7 @@ func NewPcloudIpsecpoliciesPutUnprocessableEntity() *PcloudIpsecpoliciesPutUnpro return &PcloudIpsecpoliciesPutUnprocessableEntity{} } -/*PcloudIpsecpoliciesPutUnprocessableEntity handles this case with default header values. +/* PcloudIpsecpoliciesPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -240,6 +246,9 @@ type PcloudIpsecpoliciesPutUnprocessableEntity struct { func (o *PcloudIpsecpoliciesPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudIpsecpoliciesPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -258,7 +267,7 @@ func NewPcloudIpsecpoliciesPutInternalServerError() *PcloudIpsecpoliciesPutInter return &PcloudIpsecpoliciesPutInternalServerError{} } -/*PcloudIpsecpoliciesPutInternalServerError handles this case with default header values. +/* PcloudIpsecpoliciesPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -269,6 +278,9 @@ type PcloudIpsecpoliciesPutInternalServerError struct { func (o *PcloudIpsecpoliciesPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudIpsecpoliciesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudIpsecpoliciesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go index 0ef37d9eb0..d0afc8f436 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -6,13 +6,14 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new p cloud volumes API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,71 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstancesVolumesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesActionPostAccepted, error) + + PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesDeleteOK, error) + + PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetOK, error) + + PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetallOK, error) + + PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPostAccepted, error) + + PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPutOK, error) + + PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesDeleteAccepted, error) + + PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetOK, error) + + PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetallOK, error) + + PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) + + PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPutOK, error) + + PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesSetbootPutOK, error) + + PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesPostAccepted, error) + + PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonePostAccepted, error) + + PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonetasksGetOK, error) + + PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesPostCreated, error) + + PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCancelPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneCancelPostAccepted, error) + + PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneDeleteOK, error) + + PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExecutePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneExecutePostAccepted, error) + + PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetOK, error) + + PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetallOK, error) + + PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesclonePostAccepted, error) + + PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStartPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneStartPostOK, error) + + PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumesClonePostOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -PcloudCloudinstancesVolumesActionPost performs an action on a volume + PcloudCloudinstancesVolumesActionPost performs an action on a volume */ -func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstancesVolumesActionPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesVolumesActionPostAccepted, error) { +func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstancesVolumesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesActionPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesVolumesActionPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.volumes.action.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action", @@ -45,24 +101,34 @@ func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstan AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesVolumesActionPostAccepted), nil - + success, ok := result.(*PcloudCloudinstancesVolumesActionPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesVolumesDelete deletes a cloud instance volume + PcloudCloudinstancesVolumesDelete deletes a cloud instance volume */ -func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesVolumesDeleteOK, error) { +func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesVolumesDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.volumes.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}", @@ -74,24 +140,34 @@ func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesV AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesVolumesDeleteOK), nil - + success, ok := result.(*PcloudCloudinstancesVolumesDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesVolumesGet detaileds info of a volume + PcloudCloudinstancesVolumesGet detaileds info of a volume */ -func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesVolumesGetOK, error) { +func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesVolumesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.volumes.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}", @@ -103,24 +179,34 @@ func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolu AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesVolumesGetOK), nil - + success, ok := result.(*PcloudCloudinstancesVolumesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesVolumesGetall lists all volumes for this cloud instance + PcloudCloudinstancesVolumesGetall lists all volumes for this cloud instance */ -func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesVolumesGetallOK, error) { +func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesVolumesGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.volumes.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes", @@ -132,24 +218,34 @@ func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesV AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesVolumesGetallOK), nil - + success, ok := result.(*PcloudCloudinstancesVolumesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesVolumesPost creates a new data volume + PcloudCloudinstancesVolumesPost creates a new data volume */ -func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesVolumesPostAccepted, error) { +func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesVolumesPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.volumes.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes", @@ -161,24 +257,34 @@ func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVol AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesVolumesPostAccepted), nil - + success, ok := result.(*PcloudCloudinstancesVolumesPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudCloudinstancesVolumesPut updates a cloud instance volume + PcloudCloudinstancesVolumesPut updates a cloud instance volume */ -func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudCloudinstancesVolumesPutOK, error) { +func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudCloudinstancesVolumesPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.cloudinstances.volumes.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}", @@ -190,24 +296,34 @@ func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolu AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudCloudinstancesVolumesPutOK), nil - + success, ok := result.(*PcloudCloudinstancesVolumesPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPvminstancesVolumesDelete detaches a volume from a p VM instance + PcloudPvminstancesVolumesDelete detaches a volume from a p VM instance */ -func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesVolumesDeleteAccepted, error) { +func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesDeleteAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPvminstancesVolumesDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.pvminstances.volumes.delete", Method: "DELETE", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", @@ -219,24 +335,34 @@ func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolum AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPvminstancesVolumesDeleteAccepted), nil - + success, ok := result.(*PcloudPvminstancesVolumesDeleteAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPvminstancesVolumesGet detaileds info of a volume attached to a p VM instance + PcloudPvminstancesVolumesGet detaileds info of a volume attached to a p VM instance */ -func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesVolumesGetOK, error) { +func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPvminstancesVolumesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.pvminstances.volumes.get", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", @@ -248,24 +374,34 @@ func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesG AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPvminstancesVolumesGetOK), nil - + success, ok := result.(*PcloudPvminstancesVolumesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPvminstancesVolumesGetall lists all volumes attached to a p VM instance + PcloudPvminstancesVolumesGetall lists all volumes attached to a p VM instance */ -func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesVolumesGetallOK, error) { +func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPvminstancesVolumesGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.pvminstances.volumes.getall", Method: "GET", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes", @@ -277,24 +413,34 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPvminstancesVolumesGetallOK), nil - + success, ok := result.(*PcloudPvminstancesVolumesGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + PcloudPvminstancesVolumesPost attaches a volume to a p VM instance */ -func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesVolumesPostOK, error) { +func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPvminstancesVolumesPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.pvminstances.volumes.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", @@ -306,24 +452,34 @@ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumes AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPvminstancesVolumesPostOK), nil - + success, ok := result.(*PcloudPvminstancesVolumesPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPvminstancesVolumesPut updates a volume attached to a p VM instance + PcloudPvminstancesVolumesPut updates a volume attached to a p VM instance */ -func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesVolumesPutOK, error) { +func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPvminstancesVolumesPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.pvminstances.volumes.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}", @@ -335,24 +491,34 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPvminstancesVolumesPutOK), nil - + success, ok := result.(*PcloudPvminstancesVolumesPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume */ -func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudPvminstancesVolumesSetbootPutOK, error) { +func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesSetbootPutOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudPvminstancesVolumesSetbootPutParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.pvminstances.volumes.setboot.put", Method: "PUT", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot", @@ -364,24 +530,34 @@ func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesV AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudPvminstancesVolumesSetbootPutOK), nil - + success, ok := result.(*PcloudPvminstancesVolumesSetbootPutOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.setboot.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance */ -func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2PvminstancesVolumesPostAccepted, error) { +func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2PvminstancesVolumesPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.pvminstances.volumes.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes", @@ -393,24 +569,34 @@ func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVol AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2PvminstancesVolumesPostAccepted), nil - + success, ok := result.(*PcloudV2PvminstancesVolumesPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumesClonePost creates a volume clone for specified volumes + PcloudV2VolumesClonePost creates a volume clone for specified volumes */ -func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumesClonePostAccepted, error) { +func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonePostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumesClonePostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumes.clone.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone", @@ -422,24 +608,34 @@ func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumesClonePostAccepted), nil - + success, ok := result.(*PcloudV2VolumesClonePostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumesClonetasksGet gets the status of a volumes clone request for the specified clone task ID + PcloudV2VolumesClonetasksGet gets the status of a volumes clone request for the specified clone task ID */ -func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumesClonetasksGetOK, error) { +func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonetasksGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumesClonetasksGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumes.clonetasks.get", Method: "GET", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}", @@ -451,24 +647,34 @@ func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksG AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumesClonetasksGetOK), nil - + success, ok := result.(*PcloudV2VolumesClonetasksGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.clonetasks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumesPost creates multiple data volumes from a single definition + PcloudV2VolumesPost creates multiple data volumes from a single definition */ -func (a *Client) PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumesPostCreated, error) { +func (a *Client) PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesPostCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumesPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumes.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes", @@ -480,24 +686,34 @@ func (a *Client) PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumesPostCreated), nil - + success, ok := result.(*PcloudV2VolumesPostCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumescloneCancelPost cancels a volumes clone request initiates the cleanup action cleanup action performs the cleanup of the preparatory clones and snapshot volumes + PcloudV2VolumescloneCancelPost cancels a volumes clone request initiates the cleanup action cleanup action performs the cleanup of the preparatory clones and snapshot volumes */ -func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCancelPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumescloneCancelPostAccepted, error) { +func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCancelPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneCancelPostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumescloneCancelPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.cancel.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel", @@ -509,24 +725,34 @@ func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCanc AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumescloneCancelPostAccepted), nil - + success, ok := result.(*PcloudV2VolumescloneCancelPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.cancel.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumescloneDelete deletes a volumes clone request + PcloudV2VolumescloneDelete deletes a volumes clone request */ -func (a *Client) PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumescloneDeleteOK, error) { +func (a *Client) PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumescloneDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.delete", Method: "DELETE", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}", @@ -538,24 +764,34 @@ func (a *Client) PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeletePa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumescloneDeleteOK), nil - + success, ok := result.(*PcloudV2VolumescloneDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumescloneExecutePost initiates the execute action for a volumes clone request execute action creates the cloned volumes using the volume snapshots + PcloudV2VolumescloneExecutePost initiates the execute action for a volumes clone request execute action creates the cloned volumes using the volume snapshots */ -func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExecutePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumescloneExecutePostAccepted, error) { +func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExecutePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneExecutePostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumescloneExecutePostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.execute.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute", @@ -567,24 +803,34 @@ func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExe AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumescloneExecutePostAccepted), nil - + success, ok := result.(*PcloudV2VolumescloneExecutePostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.execute.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumescloneGet gets the details for a volumes clone request + PcloudV2VolumescloneGet gets the details for a volumes clone request */ -func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumescloneGetOK, error) { +func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumescloneGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.get", Method: "GET", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}", @@ -596,24 +842,34 @@ func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumescloneGetOK), nil - + success, ok := result.(*PcloudV2VolumescloneGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumescloneGetall gets the list of volumes clone request for a cloud instance + PcloudV2VolumescloneGetall gets the list of volumes clone request for a cloud instance */ -func (a *Client) PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumescloneGetallOK, error) { +func (a *Client) PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetallOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumescloneGetallParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.getall", Method: "GET", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone", @@ -625,24 +881,34 @@ func (a *Client) PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallPa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumescloneGetallOK), nil - + success, ok := result.(*PcloudV2VolumescloneGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumesclonePost creates a new volumes clone request and initiates the prepare action requires a minimum of two volumes requires a minimum of one volume to be in the in use state requires a unique volumes clone name prepare action does the preparatory work for creating the snapshot volumes + PcloudV2VolumesclonePost creates a new volumes clone request and initiates the prepare action requires a minimum of two volumes requires a minimum of one volume to be in the in use state requires a unique volumes clone name prepare action does the preparatory work for creating the snapshot volumes */ -func (a *Client) PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumesclonePostAccepted, error) { +func (a *Client) PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesclonePostAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumesclonePostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone", @@ -654,24 +920,34 @@ func (a *Client) PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumesclonePostAccepted), nil - + success, ok := result.(*PcloudV2VolumesclonePostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudV2VolumescloneStartPost initiates the start action for a volumes clone request start action starts the consistency group to initiate the flash copy + PcloudV2VolumescloneStartPost initiates the start action for a volumes clone request start action starts the consistency group to initiate the flash copy */ -func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStartPostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudV2VolumescloneStartPostOK, error) { +func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStartPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneStartPostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudV2VolumescloneStartPostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.v2.volumesclone.start.post", Method: "POST", PathPattern: "/pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start", @@ -683,24 +959,34 @@ func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStart AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudV2VolumescloneStartPostOK), nil - + success, ok := result.(*PcloudV2VolumescloneStartPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.start.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -PcloudVolumesClonePost creates a volume clone for specified volumes + PcloudVolumesClonePost creates a volume clone for specified volumes */ -func (a *Client) PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter) (*PcloudVolumesClonePostOK, error) { +func (a *Client) PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumesClonePostOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPcloudVolumesClonePostParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "pcloud.volumes.clone.post", Method: "POST", PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone", @@ -712,12 +998,23 @@ func (a *Client) PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, au AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*PcloudVolumesClonePostOK), nil - + success, ok := result.(*PcloudVolumesClonePostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.volumes.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go index cccce0b7c4..a66e7a29b3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesVolumesActionPostParams creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the default values initialized. +// NewPcloudCloudinstancesVolumesActionPostParams creates a new PcloudCloudinstancesVolumesActionPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesVolumesActionPostParams() *PcloudCloudinstancesVolumesActionPostParams { - var () return &PcloudCloudinstancesVolumesActionPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesVolumesActionPostParamsWithTimeout creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesVolumesActionPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesActionPostParams { - var () return &PcloudCloudinstancesVolumesActionPostParams{ - timeout: timeout, } } // NewPcloudCloudinstancesVolumesActionPostParamsWithContext creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesVolumesActionPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesActionPostParams { - var () return &PcloudCloudinstancesVolumesActionPostParams{ - Context: ctx, } } // NewPcloudCloudinstancesVolumesActionPostParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesActionPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesVolumesActionPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesActionPostParams { - var () return &PcloudCloudinstancesVolumesActionPostParams{ HTTPClient: client, } } -/*PcloudCloudinstancesVolumesActionPostParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances volumes action post operation typically these are written to a http.Request +/* PcloudCloudinstancesVolumesActionPostParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances volumes action post operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesVolumesActionPostParams struct { - /*Body - Parameters for the desired action + /* Body. + Parameters for the desired action */ Body *models.VolumeAction - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -84,6 +84,21 @@ type PcloudCloudinstancesVolumesActionPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances volumes action post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesActionPostParams) WithDefaults() *PcloudCloudinstancesVolumesActionPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances volumes action post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesActionPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances volumes action post params func (o *PcloudCloudinstancesVolumesActionPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesActionPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudCloudinstancesVolumesActionPostParams) WriteToRequest(r runtime.C return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go index 032708ca95..24d75e2cd2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesVolumesActionPostReader is a Reader for the PcloudCloudinstancesVolumesActionPost structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesVolumesActionPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesVolumesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudCloudinstancesVolumesActionPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesVolumesActionPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesVolumesActionPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesVolumesActionPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesVolumesActionPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesVolumesActionPostAccepted() *PcloudCloudinstancesVol return &PcloudCloudinstancesVolumesActionPostAccepted{} } -/*PcloudCloudinstancesVolumesActionPostAccepted handles this case with default header values. +/* PcloudCloudinstancesVolumesActionPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesVolumesActionPostAccepted struct { func (o *PcloudCloudinstancesVolumesActionPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudinstancesVolumesActionPostAccepted) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesVolumesActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudCloudinstancesVolumesActionPostBadRequest() *PcloudCloudinstancesV return &PcloudCloudinstancesVolumesActionPostBadRequest{} } -/*PcloudCloudinstancesVolumesActionPostBadRequest handles this case with default header values. +/* PcloudCloudinstancesVolumesActionPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudCloudinstancesVolumesActionPostBadRequest struct { func (o *PcloudCloudinstancesVolumesActionPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesVolumesActionPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesActionPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudCloudinstancesVolumesActionPostUnauthorized() *PcloudCloudinstance return &PcloudCloudinstancesVolumesActionPostUnauthorized{} } -/*PcloudCloudinstancesVolumesActionPostUnauthorized handles this case with default header values. +/* PcloudCloudinstancesVolumesActionPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudCloudinstancesVolumesActionPostUnauthorized struct { func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudCloudinstancesVolumesActionPostNotFound() *PcloudCloudinstancesVol return &PcloudCloudinstancesVolumesActionPostNotFound{} } -/*PcloudCloudinstancesVolumesActionPostNotFound handles this case with default header values. +/* PcloudCloudinstancesVolumesActionPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -166,6 +168,9 @@ type PcloudCloudinstancesVolumesActionPostNotFound struct { func (o *PcloudCloudinstancesVolumesActionPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesVolumesActionPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesActionPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudCloudinstancesVolumesActionPostInternalServerError() *PcloudCloudi return &PcloudCloudinstancesVolumesActionPostInternalServerError{} } -/*PcloudCloudinstancesVolumesActionPostInternalServerError handles this case with default header values. +/* PcloudCloudinstancesVolumesActionPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudCloudinstancesVolumesActionPostInternalServerError struct { func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go index 9eda652b43..d6066439cc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesVolumesDeleteParams creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the default values initialized. +// NewPcloudCloudinstancesVolumesDeleteParams creates a new PcloudCloudinstancesVolumesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesVolumesDeleteParams() *PcloudCloudinstancesVolumesDeleteParams { - var () return &PcloudCloudinstancesVolumesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesVolumesDeleteParamsWithTimeout creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesVolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesDeleteParams { - var () return &PcloudCloudinstancesVolumesDeleteParams{ - timeout: timeout, } } // NewPcloudCloudinstancesVolumesDeleteParamsWithContext creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesVolumesDeleteParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesDeleteParams { - var () return &PcloudCloudinstancesVolumesDeleteParams{ - Context: ctx, } } // NewPcloudCloudinstancesVolumesDeleteParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesVolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesDeleteParams { - var () return &PcloudCloudinstancesVolumesDeleteParams{ HTTPClient: client, } } -/*PcloudCloudinstancesVolumesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances volumes delete operation typically these are written to a http.Request +/* PcloudCloudinstancesVolumesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances volumes delete operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesVolumesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesVolumesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesDeleteParams) WithDefaults() *PcloudCloudinstancesVolumesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances volumes delete params func (o *PcloudCloudinstancesVolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go index 2526989784..eb7f8fbf96 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesVolumesDeleteReader is a Reader for the PcloudCloudinstancesVolumesDelete structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesVolumesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesVolumesDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesVolumesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesVolumesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewPcloudCloudinstancesVolumesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesVolumesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesVolumesDeleteOK() *PcloudCloudinstancesVolumesDelete return &PcloudCloudinstancesVolumesDeleteOK{} } -/*PcloudCloudinstancesVolumesDeleteOK handles this case with default header values. +/* PcloudCloudinstancesVolumesDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesVolumesDeleteOK struct { func (o *PcloudCloudinstancesVolumesDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesVolumesDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudCloudinstancesVolumesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudCloudinstancesVolumesDeleteBadRequest() *PcloudCloudinstancesVolum return &PcloudCloudinstancesVolumesDeleteBadRequest{} } -/*PcloudCloudinstancesVolumesDeleteBadRequest handles this case with default header values. +/* PcloudCloudinstancesVolumesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudCloudinstancesVolumesDeleteBadRequest struct { func (o *PcloudCloudinstancesVolumesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesVolumesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudCloudinstancesVolumesDeleteUnauthorized() *PcloudCloudinstancesVol return &PcloudCloudinstancesVolumesDeleteUnauthorized{} } -/*PcloudCloudinstancesVolumesDeleteUnauthorized handles this case with default header values. +/* PcloudCloudinstancesVolumesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudCloudinstancesVolumesDeleteUnauthorized struct { func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudCloudinstancesVolumesDeleteGone() *PcloudCloudinstancesVolumesDele return &PcloudCloudinstancesVolumesDeleteGone{} } -/*PcloudCloudinstancesVolumesDeleteGone handles this case with default header values. +/* PcloudCloudinstancesVolumesDeleteGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type PcloudCloudinstancesVolumesDeleteGone struct { func (o *PcloudCloudinstancesVolumesDeleteGone) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteGone %+v", 410, o.Payload) } +func (o *PcloudCloudinstancesVolumesDeleteGone) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudCloudinstancesVolumesDeleteInternalServerError() *PcloudCloudinsta return &PcloudCloudinstancesVolumesDeleteInternalServerError{} } -/*PcloudCloudinstancesVolumesDeleteInternalServerError handles this case with default header values. +/* PcloudCloudinstancesVolumesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudCloudinstancesVolumesDeleteInternalServerError struct { func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go index a922bbac5f..df8f8e699b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudCloudinstancesVolumesGetParams creates a new PcloudCloudinstancesVolumesGetParams object -// with the default values initialized. +// NewPcloudCloudinstancesVolumesGetParams creates a new PcloudCloudinstancesVolumesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesVolumesGetParams() *PcloudCloudinstancesVolumesGetParams { - var () return &PcloudCloudinstancesVolumesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesVolumesGetParamsWithTimeout creates a new PcloudCloudinstancesVolumesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesVolumesGetParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetParams { - var () return &PcloudCloudinstancesVolumesGetParams{ - timeout: timeout, } } // NewPcloudCloudinstancesVolumesGetParamsWithContext creates a new PcloudCloudinstancesVolumesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesVolumesGetParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetParams { - var () return &PcloudCloudinstancesVolumesGetParams{ - Context: ctx, } } // NewPcloudCloudinstancesVolumesGetParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesVolumesGetParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetParams { - var () return &PcloudCloudinstancesVolumesGetParams{ HTTPClient: client, } } -/*PcloudCloudinstancesVolumesGetParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances volumes get operation typically these are written to a http.Request +/* PcloudCloudinstancesVolumesGetParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances volumes get operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesVolumesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -77,6 +76,21 @@ type PcloudCloudinstancesVolumesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances volumes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesGetParams) WithDefaults() *PcloudCloudinstancesVolumesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances volumes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances volumes get params func (o *PcloudCloudinstancesVolumesGetParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go index 9f536aebc1..896d21be08 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesVolumesGetReader is a Reader for the PcloudCloudinstancesVolumesGet structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesVolumesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesVolumesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesVolumesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesVolumesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesVolumesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesVolumesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesVolumesGetOK() *PcloudCloudinstancesVolumesGetOK { return &PcloudCloudinstancesVolumesGetOK{} } -/*PcloudCloudinstancesVolumesGetOK handles this case with default header values. +/* PcloudCloudinstancesVolumesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesVolumesGetOK struct { func (o *PcloudCloudinstancesVolumesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetOK) GetPayload() *models.Volume { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesVolumesGetBadRequest() *PcloudCloudinstancesVolumesG return &PcloudCloudinstancesVolumesGetBadRequest{} } -/*PcloudCloudinstancesVolumesGetBadRequest handles this case with default header values. +/* PcloudCloudinstancesVolumesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesVolumesGetBadRequest struct { func (o *PcloudCloudinstancesVolumesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesVolumesGetUnauthorized() *PcloudCloudinstancesVolume return &PcloudCloudinstancesVolumesGetUnauthorized{} } -/*PcloudCloudinstancesVolumesGetUnauthorized handles this case with default header values. +/* PcloudCloudinstancesVolumesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesVolumesGetUnauthorized struct { func (o *PcloudCloudinstancesVolumesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesVolumesGetNotFound() *PcloudCloudinstancesVolumesGet return &PcloudCloudinstancesVolumesGetNotFound{} } -/*PcloudCloudinstancesVolumesGetNotFound handles this case with default header values. +/* PcloudCloudinstancesVolumesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesVolumesGetNotFound struct { func (o *PcloudCloudinstancesVolumesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesVolumesGetInternalServerError() *PcloudCloudinstance return &PcloudCloudinstancesVolumesGetInternalServerError{} } -/*PcloudCloudinstancesVolumesGetInternalServerError handles this case with default header values. +/* PcloudCloudinstancesVolumesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesVolumesGetInternalServerError struct { func (o *PcloudCloudinstancesVolumesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go index eadb96744b..55d12effb2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_parameters.go @@ -13,70 +13,91 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) -// NewPcloudCloudinstancesVolumesGetallParams creates a new PcloudCloudinstancesVolumesGetallParams object -// with the default values initialized. +// NewPcloudCloudinstancesVolumesGetallParams creates a new PcloudCloudinstancesVolumesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesVolumesGetallParams() *PcloudCloudinstancesVolumesGetallParams { - var () return &PcloudCloudinstancesVolumesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesVolumesGetallParamsWithTimeout creates a new PcloudCloudinstancesVolumesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesVolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetallParams { - var () return &PcloudCloudinstancesVolumesGetallParams{ - timeout: timeout, } } // NewPcloudCloudinstancesVolumesGetallParamsWithContext creates a new PcloudCloudinstancesVolumesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesVolumesGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesGetallParams { - var () return &PcloudCloudinstancesVolumesGetallParams{ - Context: ctx, } } // NewPcloudCloudinstancesVolumesGetallParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesVolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesGetallParams { - var () return &PcloudCloudinstancesVolumesGetallParams{ HTTPClient: client, } } -/*PcloudCloudinstancesVolumesGetallParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances volumes getall operation typically these are written to a http.Request +/* PcloudCloudinstancesVolumesGetallParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances volumes getall operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesVolumesGetallParams struct { - /*Affinity - A pvmInstance (id or name), limits a volumes list response to only volumes that have affinity to the pvmInstance + /* Affinity. + A pvmInstance (id or name), limits a volumes list response to only volumes that have affinity to the pvmInstance */ Affinity *string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string + /* ReplicationEnabled. + + true or false, limits a volumes list to replication or non replication enabled volumes + */ + ReplicationEnabled *bool + timeout time.Duration Context context.Context HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances volumes getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesGetallParams) WithDefaults() *PcloudCloudinstancesVolumesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances volumes getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances volumes getall params func (o *PcloudCloudinstancesVolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesGetallParams { o.SetTimeout(timeout) @@ -132,6 +153,17 @@ func (o *PcloudCloudinstancesVolumesGetallParams) SetCloudInstanceID(cloudInstan o.CloudInstanceID = cloudInstanceID } +// WithReplicationEnabled adds the replicationEnabled to the pcloud cloudinstances volumes getall params +func (o *PcloudCloudinstancesVolumesGetallParams) WithReplicationEnabled(replicationEnabled *bool) *PcloudCloudinstancesVolumesGetallParams { + o.SetReplicationEnabled(replicationEnabled) + return o +} + +// SetReplicationEnabled adds the replicationEnabled to the pcloud cloudinstances volumes getall params +func (o *PcloudCloudinstancesVolumesGetallParams) SetReplicationEnabled(replicationEnabled *bool) { + o.ReplicationEnabled = replicationEnabled +} + // WriteToRequest writes these params to a swagger request func (o *PcloudCloudinstancesVolumesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -144,16 +176,17 @@ func (o *PcloudCloudinstancesVolumesGetallParams) WriteToRequest(r runtime.Clien // query param affinity var qrAffinity string + if o.Affinity != nil { qrAffinity = *o.Affinity } qAffinity := qrAffinity if qAffinity != "" { + if err := r.SetQueryParam("affinity", qAffinity); err != nil { return err } } - } // path param cloud_instance_id @@ -161,6 +194,23 @@ func (o *PcloudCloudinstancesVolumesGetallParams) WriteToRequest(r runtime.Clien return err } + if o.ReplicationEnabled != nil { + + // query param replicationEnabled + var qrReplicationEnabled bool + + if o.ReplicationEnabled != nil { + qrReplicationEnabled = *o.ReplicationEnabled + } + qReplicationEnabled := swag.FormatBool(qrReplicationEnabled) + if qReplicationEnabled != "" { + + if err := r.SetQueryParam("replicationEnabled", qReplicationEnabled); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go index 388793f9e1..88e6badbef 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesVolumesGetallReader is a Reader for the PcloudCloudinstancesVolumesGetall structure. @@ -24,44 +23,38 @@ type PcloudCloudinstancesVolumesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesVolumesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesVolumesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesVolumesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudCloudinstancesVolumesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesVolumesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudCloudinstancesVolumesGetallOK() *PcloudCloudinstancesVolumesGetall return &PcloudCloudinstancesVolumesGetallOK{} } -/*PcloudCloudinstancesVolumesGetallOK handles this case with default header values. +/* PcloudCloudinstancesVolumesGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudCloudinstancesVolumesGetallOK struct { func (o *PcloudCloudinstancesVolumesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetallOK) GetPayload() *models.Volumes { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudCloudinstancesVolumesGetallBadRequest() *PcloudCloudinstancesVolum return &PcloudCloudinstancesVolumesGetallBadRequest{} } -/*PcloudCloudinstancesVolumesGetallBadRequest handles this case with default header values. +/* PcloudCloudinstancesVolumesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudCloudinstancesVolumesGetallBadRequest struct { func (o *PcloudCloudinstancesVolumesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudCloudinstancesVolumesGetallUnauthorized() *PcloudCloudinstancesVol return &PcloudCloudinstancesVolumesGetallUnauthorized{} } -/*PcloudCloudinstancesVolumesGetallUnauthorized handles this case with default header values. +/* PcloudCloudinstancesVolumesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudCloudinstancesVolumesGetallUnauthorized struct { func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudCloudinstancesVolumesGetallNotFound() *PcloudCloudinstancesVolumes return &PcloudCloudinstancesVolumesGetallNotFound{} } -/*PcloudCloudinstancesVolumesGetallNotFound handles this case with default header values. +/* PcloudCloudinstancesVolumesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudCloudinstancesVolumesGetallNotFound struct { func (o *PcloudCloudinstancesVolumesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudCloudinstancesVolumesGetallInternalServerError() *PcloudCloudinsta return &PcloudCloudinstancesVolumesGetallInternalServerError{} } -/*PcloudCloudinstancesVolumesGetallInternalServerError handles this case with default header values. +/* PcloudCloudinstancesVolumesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudCloudinstancesVolumesGetallInternalServerError struct { func (o *PcloudCloudinstancesVolumesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesVolumesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go index 55a0685ec0..456bf17a9b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesVolumesPostParams creates a new PcloudCloudinstancesVolumesPostParams object -// with the default values initialized. +// NewPcloudCloudinstancesVolumesPostParams creates a new PcloudCloudinstancesVolumesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesVolumesPostParams() *PcloudCloudinstancesVolumesPostParams { - var () return &PcloudCloudinstancesVolumesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesVolumesPostParamsWithTimeout creates a new PcloudCloudinstancesVolumesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPostParams { - var () return &PcloudCloudinstancesVolumesPostParams{ - timeout: timeout, } } // NewPcloudCloudinstancesVolumesPostParamsWithContext creates a new PcloudCloudinstancesVolumesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesPostParams { - var () return &PcloudCloudinstancesVolumesPostParams{ - Context: ctx, } } // NewPcloudCloudinstancesVolumesPostParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesPostParams { - var () return &PcloudCloudinstancesVolumesPostParams{ HTTPClient: client, } } -/*PcloudCloudinstancesVolumesPostParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances volumes post operation typically these are written to a http.Request +/* PcloudCloudinstancesVolumesPostParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances volumes post operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesVolumesPostParams struct { - /*Body - Parameters for the creation of a new data volume + /* Body. + Parameters for the creation of a new data volume */ Body *models.CreateDataVolume - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudCloudinstancesVolumesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesPostParams) WithDefaults() *PcloudCloudinstancesVolumesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances volumes post params func (o *PcloudCloudinstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudCloudinstancesVolumesPostParams) WriteToRequest(r runtime.ClientR return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go index 649f58f589..258e913a86 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesVolumesPostReader is a Reader for the PcloudCloudinstancesVolumesPost structure. @@ -24,51 +23,44 @@ type PcloudCloudinstancesVolumesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudCloudinstancesVolumesPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesVolumesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesVolumesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudCloudinstancesVolumesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudinstancesVolumesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesVolumesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudinstancesVolumesPostAccepted() *PcloudCloudinstancesVolumesPo return &PcloudCloudinstancesVolumesPostAccepted{} } -/*PcloudCloudinstancesVolumesPostAccepted handles this case with default header values. +/* PcloudCloudinstancesVolumesPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudCloudinstancesVolumesPostAccepted struct { func (o *PcloudCloudinstancesVolumesPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostAccepted %+v", 202, o.Payload) } +func (o *PcloudCloudinstancesVolumesPostAccepted) GetPayload() *models.Volume { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudCloudinstancesVolumesPostBadRequest() *PcloudCloudinstancesVolumes return &PcloudCloudinstancesVolumesPostBadRequest{} } -/*PcloudCloudinstancesVolumesPostBadRequest handles this case with default header values. +/* PcloudCloudinstancesVolumesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudCloudinstancesVolumesPostBadRequest struct { func (o *PcloudCloudinstancesVolumesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesVolumesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudCloudinstancesVolumesPostUnauthorized() *PcloudCloudinstancesVolum return &PcloudCloudinstancesVolumesPostUnauthorized{} } -/*PcloudCloudinstancesVolumesPostUnauthorized handles this case with default header values. +/* PcloudCloudinstancesVolumesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudCloudinstancesVolumesPostUnauthorized struct { func (o *PcloudCloudinstancesVolumesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesVolumesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudCloudinstancesVolumesPostConflict() *PcloudCloudinstancesVolumesPo return &PcloudCloudinstancesVolumesPostConflict{} } -/*PcloudCloudinstancesVolumesPostConflict handles this case with default header values. +/* PcloudCloudinstancesVolumesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type PcloudCloudinstancesVolumesPostConflict struct { func (o *PcloudCloudinstancesVolumesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostConflict %+v", 409, o.Payload) } +func (o *PcloudCloudinstancesVolumesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudCloudinstancesVolumesPostUnprocessableEntity() *PcloudCloudinstanc return &PcloudCloudinstancesVolumesPostUnprocessableEntity{} } -/*PcloudCloudinstancesVolumesPostUnprocessableEntity handles this case with default header values. +/* PcloudCloudinstancesVolumesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudCloudinstancesVolumesPostUnprocessableEntity struct { func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudCloudinstancesVolumesPostInternalServerError() *PcloudCloudinstanc return &PcloudCloudinstancesVolumesPostInternalServerError{} } -/*PcloudCloudinstancesVolumesPostInternalServerError handles this case with default header values. +/* PcloudCloudinstancesVolumesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudCloudinstancesVolumesPostInternalServerError struct { func (o *PcloudCloudinstancesVolumesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesVolumesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go index 05c98f1a90..3c0e47c964 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudCloudinstancesVolumesPutParams creates a new PcloudCloudinstancesVolumesPutParams object -// with the default values initialized. +// NewPcloudCloudinstancesVolumesPutParams creates a new PcloudCloudinstancesVolumesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudCloudinstancesVolumesPutParams() *PcloudCloudinstancesVolumesPutParams { - var () return &PcloudCloudinstancesVolumesPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudCloudinstancesVolumesPutParamsWithTimeout creates a new PcloudCloudinstancesVolumesPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudCloudinstancesVolumesPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPutParams { - var () return &PcloudCloudinstancesVolumesPutParams{ - timeout: timeout, } } // NewPcloudCloudinstancesVolumesPutParamsWithContext creates a new PcloudCloudinstancesVolumesPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudCloudinstancesVolumesPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesVolumesPutParams { - var () return &PcloudCloudinstancesVolumesPutParams{ - Context: ctx, } } // NewPcloudCloudinstancesVolumesPutParamsWithHTTPClient creates a new PcloudCloudinstancesVolumesPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudCloudinstancesVolumesPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVolumesPutParams { - var () return &PcloudCloudinstancesVolumesPutParams{ HTTPClient: client, } } -/*PcloudCloudinstancesVolumesPutParams contains all the parameters to send to the API endpoint -for the pcloud cloudinstances volumes put operation typically these are written to a http.Request +/* PcloudCloudinstancesVolumesPutParams contains all the parameters to send to the API endpoint + for the pcloud cloudinstances volumes put operation. + + Typically these are written to a http.Request. */ type PcloudCloudinstancesVolumesPutParams struct { - /*Body - Parameters to update a cloud instance volume + /* Body. + Parameters to update a cloud instance volume */ Body *models.UpdateVolume - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -84,6 +84,21 @@ type PcloudCloudinstancesVolumesPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud cloudinstances volumes put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesPutParams) WithDefaults() *PcloudCloudinstancesVolumesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances volumes put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVolumesPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud cloudinstances volumes put params func (o *PcloudCloudinstancesVolumesPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVolumesPutParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudCloudinstancesVolumesPutParams) WriteToRequest(r runtime.ClientRe return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go index 988937c206..37837d8541 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudCloudinstancesVolumesPutReader is a Reader for the PcloudCloudinstancesVolumesPut structure. @@ -24,51 +23,44 @@ type PcloudCloudinstancesVolumesPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudCloudinstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudCloudinstancesVolumesPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudCloudinstancesVolumesPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudCloudinstancesVolumesPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudCloudinstancesVolumesPutConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudCloudinstancesVolumesPutUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudCloudinstancesVolumesPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudCloudinstancesVolumesPutOK() *PcloudCloudinstancesVolumesPutOK { return &PcloudCloudinstancesVolumesPutOK{} } -/*PcloudCloudinstancesVolumesPutOK handles this case with default header values. +/* PcloudCloudinstancesVolumesPutOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudCloudinstancesVolumesPutOK struct { func (o *PcloudCloudinstancesVolumesPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutOK %+v", 200, o.Payload) } +func (o *PcloudCloudinstancesVolumesPutOK) GetPayload() *models.Volume { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudCloudinstancesVolumesPutBadRequest() *PcloudCloudinstancesVolumesP return &PcloudCloudinstancesVolumesPutBadRequest{} } -/*PcloudCloudinstancesVolumesPutBadRequest handles this case with default header values. +/* PcloudCloudinstancesVolumesPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudCloudinstancesVolumesPutBadRequest struct { func (o *PcloudCloudinstancesVolumesPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudCloudinstancesVolumesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudCloudinstancesVolumesPutUnauthorized() *PcloudCloudinstancesVolume return &PcloudCloudinstancesVolumesPutUnauthorized{} } -/*PcloudCloudinstancesVolumesPutUnauthorized handles this case with default header values. +/* PcloudCloudinstancesVolumesPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudCloudinstancesVolumesPutUnauthorized struct { func (o *PcloudCloudinstancesVolumesPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudCloudinstancesVolumesPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudCloudinstancesVolumesPutConflict() *PcloudCloudinstancesVolumesPut return &PcloudCloudinstancesVolumesPutConflict{} } -/*PcloudCloudinstancesVolumesPutConflict handles this case with default header values. +/* PcloudCloudinstancesVolumesPutConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type PcloudCloudinstancesVolumesPutConflict struct { func (o *PcloudCloudinstancesVolumesPutConflict) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutConflict %+v", 409, o.Payload) } +func (o *PcloudCloudinstancesVolumesPutConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudCloudinstancesVolumesPutUnprocessableEntity() *PcloudCloudinstance return &PcloudCloudinstancesVolumesPutUnprocessableEntity{} } -/*PcloudCloudinstancesVolumesPutUnprocessableEntity handles this case with default header values. +/* PcloudCloudinstancesVolumesPutUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudCloudinstancesVolumesPutUnprocessableEntity struct { func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudCloudinstancesVolumesPutInternalServerError() *PcloudCloudinstance return &PcloudCloudinstancesVolumesPutInternalServerError{} } -/*PcloudCloudinstancesVolumesPutInternalServerError handles this case with default header values. +/* PcloudCloudinstancesVolumesPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudCloudinstancesVolumesPutInternalServerError struct { func (o *PcloudCloudinstancesVolumesPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudCloudinstancesVolumesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudCloudinstancesVolumesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go index d4a1b2e8b6..0facc81b62 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesVolumesDeleteParams creates a new PcloudPvminstancesVolumesDeleteParams object -// with the default values initialized. +// NewPcloudPvminstancesVolumesDeleteParams creates a new PcloudPvminstancesVolumesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesVolumesDeleteParams() *PcloudPvminstancesVolumesDeleteParams { - var () return &PcloudPvminstancesVolumesDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesVolumesDeleteParamsWithTimeout creates a new PcloudPvminstancesVolumesDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesVolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesDeleteParams { - var () return &PcloudPvminstancesVolumesDeleteParams{ - timeout: timeout, } } // NewPcloudPvminstancesVolumesDeleteParamsWithContext creates a new PcloudPvminstancesVolumesDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesVolumesDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesDeleteParams { - var () return &PcloudPvminstancesVolumesDeleteParams{ - Context: ctx, } } // NewPcloudPvminstancesVolumesDeleteParamsWithHTTPClient creates a new PcloudPvminstancesVolumesDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesVolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesDeleteParams { - var () return &PcloudPvminstancesVolumesDeleteParams{ HTTPClient: client, } } -/*PcloudPvminstancesVolumesDeleteParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances volumes delete operation typically these are written to a http.Request +/* PcloudPvminstancesVolumesDeleteParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances volumes delete operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesVolumesDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -82,6 +82,21 @@ type PcloudPvminstancesVolumesDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesDeleteParams) WithDefaults() *PcloudPvminstancesVolumesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances volumes delete params func (o *PcloudPvminstancesVolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go index 1a039e6738..7965aa2c97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesVolumesDeleteReader is a Reader for the PcloudPvminstancesVolumesDelete structure. @@ -24,58 +23,50 @@ type PcloudPvminstancesVolumesDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudPvminstancesVolumesDeleteAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesVolumesDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesVolumesDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudPvminstancesVolumesDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesVolumesDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesVolumesDeleteConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesVolumesDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudPvminstancesVolumesDeleteAccepted() *PcloudPvminstancesVolumesDele return &PcloudPvminstancesVolumesDeleteAccepted{} } -/*PcloudPvminstancesVolumesDeleteAccepted handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteAccepted describes a response with status code 202, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudPvminstancesVolumesDeleteAccepted struct { func (o *PcloudPvminstancesVolumesDeleteAccepted) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteAccepted %+v", 202, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteAccepted) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -111,7 +105,7 @@ func NewPcloudPvminstancesVolumesDeleteBadRequest() *PcloudPvminstancesVolumesDe return &PcloudPvminstancesVolumesDeleteBadRequest{} } -/*PcloudPvminstancesVolumesDeleteBadRequest handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -122,6 +116,9 @@ type PcloudPvminstancesVolumesDeleteBadRequest struct { func (o *PcloudPvminstancesVolumesDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -140,7 +137,7 @@ func NewPcloudPvminstancesVolumesDeleteUnauthorized() *PcloudPvminstancesVolumes return &PcloudPvminstancesVolumesDeleteUnauthorized{} } -/*PcloudPvminstancesVolumesDeleteUnauthorized handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -151,6 +148,9 @@ type PcloudPvminstancesVolumesDeleteUnauthorized struct { func (o *PcloudPvminstancesVolumesDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -169,7 +169,7 @@ func NewPcloudPvminstancesVolumesDeleteForbidden() *PcloudPvminstancesVolumesDel return &PcloudPvminstancesVolumesDeleteForbidden{} } -/*PcloudPvminstancesVolumesDeleteForbidden handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -180,6 +180,9 @@ type PcloudPvminstancesVolumesDeleteForbidden struct { func (o *PcloudPvminstancesVolumesDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteForbidden %+v", 403, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -198,7 +201,7 @@ func NewPcloudPvminstancesVolumesDeleteNotFound() *PcloudPvminstancesVolumesDele return &PcloudPvminstancesVolumesDeleteNotFound{} } -/*PcloudPvminstancesVolumesDeleteNotFound handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -209,6 +212,9 @@ type PcloudPvminstancesVolumesDeleteNotFound struct { func (o *PcloudPvminstancesVolumesDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -227,7 +233,7 @@ func NewPcloudPvminstancesVolumesDeleteConflict() *PcloudPvminstancesVolumesDele return &PcloudPvminstancesVolumesDeleteConflict{} } -/*PcloudPvminstancesVolumesDeleteConflict handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteConflict describes a response with status code 409, with default header values. Conflict */ @@ -238,6 +244,9 @@ type PcloudPvminstancesVolumesDeleteConflict struct { func (o *PcloudPvminstancesVolumesDeleteConflict) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -256,7 +265,7 @@ func NewPcloudPvminstancesVolumesDeleteInternalServerError() *PcloudPvminstances return &PcloudPvminstancesVolumesDeleteInternalServerError{} } -/*PcloudPvminstancesVolumesDeleteInternalServerError handles this case with default header values. +/* PcloudPvminstancesVolumesDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -267,6 +276,9 @@ type PcloudPvminstancesVolumesDeleteInternalServerError struct { func (o *PcloudPvminstancesVolumesDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesVolumesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go index ecd4ea666d..0307f189f6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesVolumesGetParams creates a new PcloudPvminstancesVolumesGetParams object -// with the default values initialized. +// NewPcloudPvminstancesVolumesGetParams creates a new PcloudPvminstancesVolumesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesVolumesGetParams() *PcloudPvminstancesVolumesGetParams { - var () return &PcloudPvminstancesVolumesGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesVolumesGetParamsWithTimeout creates a new PcloudPvminstancesVolumesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesVolumesGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetParams { - var () return &PcloudPvminstancesVolumesGetParams{ - timeout: timeout, } } // NewPcloudPvminstancesVolumesGetParamsWithContext creates a new PcloudPvminstancesVolumesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesVolumesGetParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesGetParams { - var () return &PcloudPvminstancesVolumesGetParams{ - Context: ctx, } } // NewPcloudPvminstancesVolumesGetParamsWithHTTPClient creates a new PcloudPvminstancesVolumesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesVolumesGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesGetParams { - var () return &PcloudPvminstancesVolumesGetParams{ HTTPClient: client, } } -/*PcloudPvminstancesVolumesGetParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances volumes get operation typically these are written to a http.Request +/* PcloudPvminstancesVolumesGetParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances volumes get operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesVolumesGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -82,6 +82,21 @@ type PcloudPvminstancesVolumesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances volumes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesGetParams) WithDefaults() *PcloudPvminstancesVolumesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances volumes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances volumes get params func (o *PcloudPvminstancesVolumesGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go index 4a52ebd3d1..fa119079ee 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesVolumesGetReader is a Reader for the PcloudPvminstancesVolumesGet structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesVolumesGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesVolumesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesVolumesGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesVolumesGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesVolumesGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesVolumesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesVolumesGetOK() *PcloudPvminstancesVolumesGetOK { return &PcloudPvminstancesVolumesGetOK{} } -/*PcloudPvminstancesVolumesGetOK handles this case with default header values. +/* PcloudPvminstancesVolumesGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesVolumesGetOK struct { func (o *PcloudPvminstancesVolumesGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesVolumesGetOK) GetPayload() *models.Volume { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPvminstancesVolumesGetBadRequest() *PcloudPvminstancesVolumesGetBa return &PcloudPvminstancesVolumesGetBadRequest{} } -/*PcloudPvminstancesVolumesGetBadRequest handles this case with default header values. +/* PcloudPvminstancesVolumesGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPvminstancesVolumesGetBadRequest struct { func (o *PcloudPvminstancesVolumesGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesVolumesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPvminstancesVolumesGetUnauthorized() *PcloudPvminstancesVolumesGet return &PcloudPvminstancesVolumesGetUnauthorized{} } -/*PcloudPvminstancesVolumesGetUnauthorized handles this case with default header values. +/* PcloudPvminstancesVolumesGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudPvminstancesVolumesGetUnauthorized struct { func (o *PcloudPvminstancesVolumesGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesVolumesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPvminstancesVolumesGetNotFound() *PcloudPvminstancesVolumesGetNotF return &PcloudPvminstancesVolumesGetNotFound{} } -/*PcloudPvminstancesVolumesGetNotFound handles this case with default header values. +/* PcloudPvminstancesVolumesGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudPvminstancesVolumesGetNotFound struct { func (o *PcloudPvminstancesVolumesGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesVolumesGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPvminstancesVolumesGetInternalServerError() *PcloudPvminstancesVol return &PcloudPvminstancesVolumesGetInternalServerError{} } -/*PcloudPvminstancesVolumesGetInternalServerError handles this case with default header values. +/* PcloudPvminstancesVolumesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPvminstancesVolumesGetInternalServerError struct { func (o *PcloudPvminstancesVolumesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesVolumesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go index f07597d38d..ad7ca53186 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesVolumesGetallParams creates a new PcloudPvminstancesVolumesGetallParams object -// with the default values initialized. +// NewPcloudPvminstancesVolumesGetallParams creates a new PcloudPvminstancesVolumesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesVolumesGetallParams() *PcloudPvminstancesVolumesGetallParams { - var () return &PcloudPvminstancesVolumesGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesVolumesGetallParamsWithTimeout creates a new PcloudPvminstancesVolumesGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesVolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetallParams { - var () return &PcloudPvminstancesVolumesGetallParams{ - timeout: timeout, } } // NewPcloudPvminstancesVolumesGetallParamsWithContext creates a new PcloudPvminstancesVolumesGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesVolumesGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesGetallParams { - var () return &PcloudPvminstancesVolumesGetallParams{ - Context: ctx, } } // NewPcloudPvminstancesVolumesGetallParamsWithHTTPClient creates a new PcloudPvminstancesVolumesGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesVolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesGetallParams { - var () return &PcloudPvminstancesVolumesGetallParams{ HTTPClient: client, } } -/*PcloudPvminstancesVolumesGetallParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances volumes getall operation typically these are written to a http.Request +/* PcloudPvminstancesVolumesGetallParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances volumes getall operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesVolumesGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -77,6 +76,21 @@ type PcloudPvminstancesVolumesGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances volumes getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesGetallParams) WithDefaults() *PcloudPvminstancesVolumesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances volumes getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances volumes getall params func (o *PcloudPvminstancesVolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesGetallParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go index 37315da8cc..7e98352931 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesVolumesGetallReader is a Reader for the PcloudPvminstancesVolumesGetall structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesVolumesGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesVolumesGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesVolumesGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesVolumesGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesVolumesGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesVolumesGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesVolumesGetallOK() *PcloudPvminstancesVolumesGetallOK { return &PcloudPvminstancesVolumesGetallOK{} } -/*PcloudPvminstancesVolumesGetallOK handles this case with default header values. +/* PcloudPvminstancesVolumesGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesVolumesGetallOK struct { func (o *PcloudPvminstancesVolumesGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesVolumesGetallOK) GetPayload() *models.Volumes { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudPvminstancesVolumesGetallBadRequest() *PcloudPvminstancesVolumesGe return &PcloudPvminstancesVolumesGetallBadRequest{} } -/*PcloudPvminstancesVolumesGetallBadRequest handles this case with default header values. +/* PcloudPvminstancesVolumesGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudPvminstancesVolumesGetallBadRequest struct { func (o *PcloudPvminstancesVolumesGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesVolumesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudPvminstancesVolumesGetallUnauthorized() *PcloudPvminstancesVolumes return &PcloudPvminstancesVolumesGetallUnauthorized{} } -/*PcloudPvminstancesVolumesGetallUnauthorized handles this case with default header values. +/* PcloudPvminstancesVolumesGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudPvminstancesVolumesGetallUnauthorized struct { func (o *PcloudPvminstancesVolumesGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesVolumesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudPvminstancesVolumesGetallNotFound() *PcloudPvminstancesVolumesGeta return &PcloudPvminstancesVolumesGetallNotFound{} } -/*PcloudPvminstancesVolumesGetallNotFound handles this case with default header values. +/* PcloudPvminstancesVolumesGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudPvminstancesVolumesGetallNotFound struct { func (o *PcloudPvminstancesVolumesGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesVolumesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudPvminstancesVolumesGetallInternalServerError() *PcloudPvminstances return &PcloudPvminstancesVolumesGetallInternalServerError{} } -/*PcloudPvminstancesVolumesGetallInternalServerError handles this case with default header values. +/* PcloudPvminstancesVolumesGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudPvminstancesVolumesGetallInternalServerError struct { func (o *PcloudPvminstancesVolumesGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesVolumesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go index 45688ac115..e6144e828a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesVolumesPostParams creates a new PcloudPvminstancesVolumesPostParams object -// with the default values initialized. +// NewPcloudPvminstancesVolumesPostParams creates a new PcloudPvminstancesVolumesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesVolumesPostParams() *PcloudPvminstancesVolumesPostParams { - var () return &PcloudPvminstancesVolumesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesVolumesPostParamsWithTimeout creates a new PcloudPvminstancesVolumesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPostParams { - var () return &PcloudPvminstancesVolumesPostParams{ - timeout: timeout, } } // NewPcloudPvminstancesVolumesPostParamsWithContext creates a new PcloudPvminstancesVolumesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesPostParams { - var () return &PcloudPvminstancesVolumesPostParams{ - Context: ctx, } } // NewPcloudPvminstancesVolumesPostParamsWithHTTPClient creates a new PcloudPvminstancesVolumesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesPostParams { - var () return &PcloudPvminstancesVolumesPostParams{ HTTPClient: client, } } -/*PcloudPvminstancesVolumesPostParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances volumes post operation typically these are written to a http.Request +/* PcloudPvminstancesVolumesPostParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances volumes post operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesVolumesPostParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -82,6 +82,21 @@ type PcloudPvminstancesVolumesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesPostParams) WithDefaults() *PcloudPvminstancesVolumesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances volumes post params func (o *PcloudPvminstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPostParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go index fada4f6850..85de2ff75c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesVolumesPostReader is a Reader for the PcloudPvminstancesVolumesPost structure. @@ -24,58 +23,50 @@ type PcloudPvminstancesVolumesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesVolumesPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesVolumesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesVolumesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudPvminstancesVolumesPostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesVolumesPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudPvminstancesVolumesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesVolumesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -84,7 +75,7 @@ func NewPcloudPvminstancesVolumesPostOK() *PcloudPvminstancesVolumesPostOK { return &PcloudPvminstancesVolumesPostOK{} } -/*PcloudPvminstancesVolumesPostOK handles this case with default header values. +/* PcloudPvminstancesVolumesPostOK describes a response with status code 200, with default header values. OK */ @@ -95,6 +86,9 @@ type PcloudPvminstancesVolumesPostOK struct { func (o *PcloudPvminstancesVolumesPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesVolumesPostOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -111,7 +105,7 @@ func NewPcloudPvminstancesVolumesPostBadRequest() *PcloudPvminstancesVolumesPost return &PcloudPvminstancesVolumesPostBadRequest{} } -/*PcloudPvminstancesVolumesPostBadRequest handles this case with default header values. +/* PcloudPvminstancesVolumesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -122,6 +116,9 @@ type PcloudPvminstancesVolumesPostBadRequest struct { func (o *PcloudPvminstancesVolumesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesVolumesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -140,7 +137,7 @@ func NewPcloudPvminstancesVolumesPostUnauthorized() *PcloudPvminstancesVolumesPo return &PcloudPvminstancesVolumesPostUnauthorized{} } -/*PcloudPvminstancesVolumesPostUnauthorized handles this case with default header values. +/* PcloudPvminstancesVolumesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -151,6 +148,9 @@ type PcloudPvminstancesVolumesPostUnauthorized struct { func (o *PcloudPvminstancesVolumesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesVolumesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -169,7 +169,7 @@ func NewPcloudPvminstancesVolumesPostForbidden() *PcloudPvminstancesVolumesPostF return &PcloudPvminstancesVolumesPostForbidden{} } -/*PcloudPvminstancesVolumesPostForbidden handles this case with default header values. +/* PcloudPvminstancesVolumesPostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -180,6 +180,9 @@ type PcloudPvminstancesVolumesPostForbidden struct { func (o *PcloudPvminstancesVolumesPostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostForbidden %+v", 403, o.Payload) } +func (o *PcloudPvminstancesVolumesPostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -198,7 +201,7 @@ func NewPcloudPvminstancesVolumesPostNotFound() *PcloudPvminstancesVolumesPostNo return &PcloudPvminstancesVolumesPostNotFound{} } -/*PcloudPvminstancesVolumesPostNotFound handles this case with default header values. +/* PcloudPvminstancesVolumesPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -209,6 +212,9 @@ type PcloudPvminstancesVolumesPostNotFound struct { func (o *PcloudPvminstancesVolumesPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesVolumesPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -227,7 +233,7 @@ func NewPcloudPvminstancesVolumesPostConflict() *PcloudPvminstancesVolumesPostCo return &PcloudPvminstancesVolumesPostConflict{} } -/*PcloudPvminstancesVolumesPostConflict handles this case with default header values. +/* PcloudPvminstancesVolumesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -238,6 +244,9 @@ type PcloudPvminstancesVolumesPostConflict struct { func (o *PcloudPvminstancesVolumesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostConflict %+v", 409, o.Payload) } +func (o *PcloudPvminstancesVolumesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -256,7 +265,7 @@ func NewPcloudPvminstancesVolumesPostInternalServerError() *PcloudPvminstancesVo return &PcloudPvminstancesVolumesPostInternalServerError{} } -/*PcloudPvminstancesVolumesPostInternalServerError handles this case with default header values. +/* PcloudPvminstancesVolumesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -267,6 +276,9 @@ type PcloudPvminstancesVolumesPostInternalServerError struct { func (o *PcloudPvminstancesVolumesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesVolumesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go index 3927ed0216..01ba400c0b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_parameters.go @@ -13,74 +13,75 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudPvminstancesVolumesPutParams creates a new PcloudPvminstancesVolumesPutParams object -// with the default values initialized. +// NewPcloudPvminstancesVolumesPutParams creates a new PcloudPvminstancesVolumesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesVolumesPutParams() *PcloudPvminstancesVolumesPutParams { - var () return &PcloudPvminstancesVolumesPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesVolumesPutParamsWithTimeout creates a new PcloudPvminstancesVolumesPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesVolumesPutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPutParams { - var () return &PcloudPvminstancesVolumesPutParams{ - timeout: timeout, } } // NewPcloudPvminstancesVolumesPutParamsWithContext creates a new PcloudPvminstancesVolumesPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesVolumesPutParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesPutParams { - var () return &PcloudPvminstancesVolumesPutParams{ - Context: ctx, } } // NewPcloudPvminstancesVolumesPutParamsWithHTTPClient creates a new PcloudPvminstancesVolumesPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesVolumesPutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesPutParams { - var () return &PcloudPvminstancesVolumesPutParams{ HTTPClient: client, } } -/*PcloudPvminstancesVolumesPutParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances volumes put operation typically these are written to a http.Request +/* PcloudPvminstancesVolumesPutParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances volumes put operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesVolumesPutParams struct { - /*Body - Parameters to update a volume attached to a PVMInstance + /* Body. + Parameters to update a volume attached to a PVMInstance */ Body *models.PVMInstanceVolumeUpdate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -89,6 +90,21 @@ type PcloudPvminstancesVolumesPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances volumes put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesPutParams) WithDefaults() *PcloudPvminstancesVolumesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances volumes put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances volumes put params func (o *PcloudPvminstancesVolumesPutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesPutParams { o.SetTimeout(timeout) @@ -173,7 +189,6 @@ func (o *PcloudPvminstancesVolumesPutParams) WriteToRequest(r runtime.ClientRequ return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go index 1bf3e1b960..a9da1b15a1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesVolumesPutReader is a Reader for the PcloudPvminstancesVolumesPut structure. @@ -24,30 +23,26 @@ type PcloudPvminstancesVolumesPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesVolumesPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesVolumesPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesVolumesPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewPcloudPvminstancesVolumesPutOK() *PcloudPvminstancesVolumesPutOK { return &PcloudPvminstancesVolumesPutOK{} } -/*PcloudPvminstancesVolumesPutOK handles this case with default header values. +/* PcloudPvminstancesVolumesPutOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type PcloudPvminstancesVolumesPutOK struct { func (o *PcloudPvminstancesVolumesPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesVolumesPutOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesVolumesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -83,7 +81,7 @@ func NewPcloudPvminstancesVolumesPutBadRequest() *PcloudPvminstancesVolumesPutBa return &PcloudPvminstancesVolumesPutBadRequest{} } -/*PcloudPvminstancesVolumesPutBadRequest handles this case with default header values. +/* PcloudPvminstancesVolumesPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -94,6 +92,9 @@ type PcloudPvminstancesVolumesPutBadRequest struct { func (o *PcloudPvminstancesVolumesPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesVolumesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -112,7 +113,7 @@ func NewPcloudPvminstancesVolumesPutInternalServerError() *PcloudPvminstancesVol return &PcloudPvminstancesVolumesPutInternalServerError{} } -/*PcloudPvminstancesVolumesPutInternalServerError handles this case with default header values. +/* PcloudPvminstancesVolumesPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -123,6 +124,9 @@ type PcloudPvminstancesVolumesPutInternalServerError struct { func (o *PcloudPvminstancesVolumesPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesVolumesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go index 00d6420123..77fab0cb54 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudPvminstancesVolumesSetbootPutParams creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the default values initialized. +// NewPcloudPvminstancesVolumesSetbootPutParams creates a new PcloudPvminstancesVolumesSetbootPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudPvminstancesVolumesSetbootPutParams() *PcloudPvminstancesVolumesSetbootPutParams { - var () return &PcloudPvminstancesVolumesSetbootPutParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudPvminstancesVolumesSetbootPutParamsWithTimeout creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudPvminstancesVolumesSetbootPutParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesSetbootPutParams { - var () return &PcloudPvminstancesVolumesSetbootPutParams{ - timeout: timeout, } } // NewPcloudPvminstancesVolumesSetbootPutParamsWithContext creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudPvminstancesVolumesSetbootPutParamsWithContext(ctx context.Context) *PcloudPvminstancesVolumesSetbootPutParams { - var () return &PcloudPvminstancesVolumesSetbootPutParams{ - Context: ctx, } } // NewPcloudPvminstancesVolumesSetbootPutParamsWithHTTPClient creates a new PcloudPvminstancesVolumesSetbootPutParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudPvminstancesVolumesSetbootPutParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVolumesSetbootPutParams { - var () return &PcloudPvminstancesVolumesSetbootPutParams{ HTTPClient: client, } } -/*PcloudPvminstancesVolumesSetbootPutParams contains all the parameters to send to the API endpoint -for the pcloud pvminstances volumes setboot put operation typically these are written to a http.Request +/* PcloudPvminstancesVolumesSetbootPutParams contains all the parameters to send to the API endpoint + for the pcloud pvminstances volumes setboot put operation. + + Typically these are written to a http.Request. */ type PcloudPvminstancesVolumesSetbootPutParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string - /*VolumeID - Volume ID + /* VolumeID. + + Volume ID */ VolumeID string @@ -82,6 +82,21 @@ type PcloudPvminstancesVolumesSetbootPutParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud pvminstances volumes setboot put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesSetbootPutParams) WithDefaults() *PcloudPvminstancesVolumesSetbootPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances volumes setboot put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVolumesSetbootPutParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud pvminstances volumes setboot put params func (o *PcloudPvminstancesVolumesSetbootPutParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVolumesSetbootPutParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go index e34c962390..0842e8f1cb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudPvminstancesVolumesSetbootPutReader is a Reader for the PcloudPvminstancesVolumesSetbootPut structure. @@ -24,44 +23,38 @@ type PcloudPvminstancesVolumesSetbootPutReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudPvminstancesVolumesSetbootPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudPvminstancesVolumesSetbootPutOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudPvminstancesVolumesSetbootPutBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudPvminstancesVolumesSetbootPutUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudPvminstancesVolumesSetbootPutNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudPvminstancesVolumesSetbootPutInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudPvminstancesVolumesSetbootPutOK() *PcloudPvminstancesVolumesSetboo return &PcloudPvminstancesVolumesSetbootPutOK{} } -/*PcloudPvminstancesVolumesSetbootPutOK handles this case with default header values. +/* PcloudPvminstancesVolumesSetbootPutOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudPvminstancesVolumesSetbootPutOK struct { func (o *PcloudPvminstancesVolumesSetbootPutOK) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutOK %+v", 200, o.Payload) } +func (o *PcloudPvminstancesVolumesSetbootPutOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudPvminstancesVolumesSetbootPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudPvminstancesVolumesSetbootPutBadRequest() *PcloudPvminstancesVolum return &PcloudPvminstancesVolumesSetbootPutBadRequest{} } -/*PcloudPvminstancesVolumesSetbootPutBadRequest handles this case with default header values. +/* PcloudPvminstancesVolumesSetbootPutBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudPvminstancesVolumesSetbootPutBadRequest struct { func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutBadRequest %+v", 400, o.Payload) } +func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudPvminstancesVolumesSetbootPutUnauthorized() *PcloudPvminstancesVol return &PcloudPvminstancesVolumesSetbootPutUnauthorized{} } -/*PcloudPvminstancesVolumesSetbootPutUnauthorized handles this case with default header values. +/* PcloudPvminstancesVolumesSetbootPutUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudPvminstancesVolumesSetbootPutUnauthorized struct { func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutUnauthorized %+v", 401, o.Payload) } +func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudPvminstancesVolumesSetbootPutNotFound() *PcloudPvminstancesVolumes return &PcloudPvminstancesVolumesSetbootPutNotFound{} } -/*PcloudPvminstancesVolumesSetbootPutNotFound handles this case with default header values. +/* PcloudPvminstancesVolumesSetbootPutNotFound describes a response with status code 404, with default header values. Not Found */ @@ -166,6 +168,9 @@ type PcloudPvminstancesVolumesSetbootPutNotFound struct { func (o *PcloudPvminstancesVolumesSetbootPutNotFound) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutNotFound %+v", 404, o.Payload) } +func (o *PcloudPvminstancesVolumesSetbootPutNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesSetbootPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudPvminstancesVolumesSetbootPutInternalServerError() *PcloudPvminsta return &PcloudPvminstancesVolumesSetbootPutInternalServerError{} } -/*PcloudPvminstancesVolumesSetbootPutInternalServerError handles this case with default header values. +/* PcloudPvminstancesVolumesSetbootPutInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudPvminstancesVolumesSetbootPutInternalServerError struct { func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) Error() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutInternalServerError %+v", 500, o.Payload) } +func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go index a9331aeba0..ba0f31924c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2PvminstancesVolumesPostParams creates a new PcloudV2PvminstancesVolumesPostParams object -// with the default values initialized. +// NewPcloudV2PvminstancesVolumesPostParams creates a new PcloudV2PvminstancesVolumesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2PvminstancesVolumesPostParams() *PcloudV2PvminstancesVolumesPostParams { - var () return &PcloudV2PvminstancesVolumesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2PvminstancesVolumesPostParamsWithTimeout creates a new PcloudV2PvminstancesVolumesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2PvminstancesVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesPostParams { - var () return &PcloudV2PvminstancesVolumesPostParams{ - timeout: timeout, } } // NewPcloudV2PvminstancesVolumesPostParamsWithContext creates a new PcloudV2PvminstancesVolumesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2PvminstancesVolumesPostParamsWithContext(ctx context.Context) *PcloudV2PvminstancesVolumesPostParams { - var () return &PcloudV2PvminstancesVolumesPostParams{ - Context: ctx, } } // NewPcloudV2PvminstancesVolumesPostParamsWithHTTPClient creates a new PcloudV2PvminstancesVolumesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2PvminstancesVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudV2PvminstancesVolumesPostParams { - var () return &PcloudV2PvminstancesVolumesPostParams{ HTTPClient: client, } } -/*PcloudV2PvminstancesVolumesPostParams contains all the parameters to send to the API endpoint -for the pcloud v2 pvminstances volumes post operation typically these are written to a http.Request +/* PcloudV2PvminstancesVolumesPostParams contains all the parameters to send to the API endpoint + for the pcloud v2 pvminstances volumes post operation. + + Typically these are written to a http.Request. */ type PcloudV2PvminstancesVolumesPostParams struct { - /*Body - Parameter to attach volumes to a PVMInstance + /* Body. + Parameter to attach volumes to a PVMInstance */ Body *models.VolumesAttach - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*PvmInstanceID - PCloud PVM Instance ID + /* PvmInstanceID. + + PCloud PVM Instance ID */ PvmInstanceID string @@ -84,6 +84,21 @@ type PcloudV2PvminstancesVolumesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 pvminstances volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2PvminstancesVolumesPostParams) WithDefaults() *PcloudV2PvminstancesVolumesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 pvminstances volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2PvminstancesVolumesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 pvminstances volumes post params func (o *PcloudV2PvminstancesVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudV2PvminstancesVolumesPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudV2PvminstancesVolumesPostParams) WriteToRequest(r runtime.ClientR return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go index 8bb8725272..e7c8a6c588 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2PvminstancesVolumesPostReader is a Reader for the PcloudV2PvminstancesVolumesPost structure. @@ -24,44 +23,38 @@ type PcloudV2PvminstancesVolumesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2PvminstancesVolumesPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2PvminstancesVolumesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2PvminstancesVolumesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2PvminstancesVolumesPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2PvminstancesVolumesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudV2PvminstancesVolumesPostAccepted() *PcloudV2PvminstancesVolumesPo return &PcloudV2PvminstancesVolumesPostAccepted{} } -/*PcloudV2PvminstancesVolumesPostAccepted handles this case with default header values. +/* PcloudV2PvminstancesVolumesPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -81,6 +74,9 @@ type PcloudV2PvminstancesVolumesPostAccepted struct { func (o *PcloudV2PvminstancesVolumesPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2PvminstancesVolumesPostAccepted) GetPayload() *models.VolumesAttachmentResponse { + return o.Payload +} func (o *PcloudV2PvminstancesVolumesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudV2PvminstancesVolumesPostBadRequest() *PcloudV2PvminstancesVolumes return &PcloudV2PvminstancesVolumesPostBadRequest{} } -/*PcloudV2PvminstancesVolumesPostBadRequest handles this case with default header values. +/* PcloudV2PvminstancesVolumesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudV2PvminstancesVolumesPostBadRequest struct { func (o *PcloudV2PvminstancesVolumesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2PvminstancesVolumesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudV2PvminstancesVolumesPostUnauthorized() *PcloudV2PvminstancesVolum return &PcloudV2PvminstancesVolumesPostUnauthorized{} } -/*PcloudV2PvminstancesVolumesPostUnauthorized handles this case with default header values. +/* PcloudV2PvminstancesVolumesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudV2PvminstancesVolumesPostUnauthorized struct { func (o *PcloudV2PvminstancesVolumesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2PvminstancesVolumesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudV2PvminstancesVolumesPostNotFound() *PcloudV2PvminstancesVolumesPo return &PcloudV2PvminstancesVolumesPostNotFound{} } -/*PcloudV2PvminstancesVolumesPostNotFound handles this case with default header values. +/* PcloudV2PvminstancesVolumesPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudV2PvminstancesVolumesPostNotFound struct { func (o *PcloudV2PvminstancesVolumesPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2PvminstancesVolumesPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudV2PvminstancesVolumesPostInternalServerError() *PcloudV2Pvminstanc return &PcloudV2PvminstancesVolumesPostInternalServerError{} } -/*PcloudV2PvminstancesVolumesPostInternalServerError handles this case with default header values. +/* PcloudV2PvminstancesVolumesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudV2PvminstancesVolumesPostInternalServerError struct { func (o *PcloudV2PvminstancesVolumesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2PvminstancesVolumesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2PvminstancesVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go index 57f303cd0d..99a119e98a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2VolumesClonePostParams creates a new PcloudV2VolumesClonePostParams object -// with the default values initialized. +// NewPcloudV2VolumesClonePostParams creates a new PcloudV2VolumesClonePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumesClonePostParams() *PcloudV2VolumesClonePostParams { - var () return &PcloudV2VolumesClonePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumesClonePostParamsWithTimeout creates a new PcloudV2VolumesClonePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumesClonePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesClonePostParams { - var () return &PcloudV2VolumesClonePostParams{ - timeout: timeout, } } // NewPcloudV2VolumesClonePostParamsWithContext creates a new PcloudV2VolumesClonePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumesClonePostParamsWithContext(ctx context.Context) *PcloudV2VolumesClonePostParams { - var () return &PcloudV2VolumesClonePostParams{ - Context: ctx, } } // NewPcloudV2VolumesClonePostParamsWithHTTPClient creates a new PcloudV2VolumesClonePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumesClonePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesClonePostParams { - var () return &PcloudV2VolumesClonePostParams{ HTTPClient: client, } } -/*PcloudV2VolumesClonePostParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumes clone post operation typically these are written to a http.Request +/* PcloudV2VolumesClonePostParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumes clone post operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumesClonePostParams struct { - /*Body - Parameters for the cloning of volumes + /* Body. + Parameters for the cloning of volumes */ Body *models.VolumesCloneAsyncRequest - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudV2VolumesClonePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumes clone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesClonePostParams) WithDefaults() *PcloudV2VolumesClonePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumes clone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesClonePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumes clone post params func (o *PcloudV2VolumesClonePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesClonePostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudV2VolumesClonePostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go index 24bb6d00f6..17b686b297 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumesClonePostReader is a Reader for the PcloudV2VolumesClonePost structure. @@ -24,44 +23,38 @@ type PcloudV2VolumesClonePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2VolumesClonePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumesClonePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumesClonePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumesClonePostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumesClonePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudV2VolumesClonePostAccepted() *PcloudV2VolumesClonePostAccepted { return &PcloudV2VolumesClonePostAccepted{} } -/*PcloudV2VolumesClonePostAccepted handles this case with default header values. +/* PcloudV2VolumesClonePostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -81,6 +74,9 @@ type PcloudV2VolumesClonePostAccepted struct { func (o *PcloudV2VolumesClonePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2VolumesClonePostAccepted) GetPayload() *models.CloneTaskReference { + return o.Payload +} func (o *PcloudV2VolumesClonePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudV2VolumesClonePostBadRequest() *PcloudV2VolumesClonePostBadRequest return &PcloudV2VolumesClonePostBadRequest{} } -/*PcloudV2VolumesClonePostBadRequest handles this case with default header values. +/* PcloudV2VolumesClonePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudV2VolumesClonePostBadRequest struct { func (o *PcloudV2VolumesClonePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumesClonePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudV2VolumesClonePostUnauthorized() *PcloudV2VolumesClonePostUnauthor return &PcloudV2VolumesClonePostUnauthorized{} } -/*PcloudV2VolumesClonePostUnauthorized handles this case with default header values. +/* PcloudV2VolumesClonePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudV2VolumesClonePostUnauthorized struct { func (o *PcloudV2VolumesClonePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumesClonePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudV2VolumesClonePostNotFound() *PcloudV2VolumesClonePostNotFound { return &PcloudV2VolumesClonePostNotFound{} } -/*PcloudV2VolumesClonePostNotFound handles this case with default header values. +/* PcloudV2VolumesClonePostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudV2VolumesClonePostNotFound struct { func (o *PcloudV2VolumesClonePostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumesClonePostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudV2VolumesClonePostInternalServerError() *PcloudV2VolumesClonePostI return &PcloudV2VolumesClonePostInternalServerError{} } -/*PcloudV2VolumesClonePostInternalServerError handles this case with default header values. +/* PcloudV2VolumesClonePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudV2VolumesClonePostInternalServerError struct { func (o *PcloudV2VolumesClonePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumesClonePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go index 93b3aa56f8..b75497e1e3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2VolumesClonetasksGetParams creates a new PcloudV2VolumesClonetasksGetParams object -// with the default values initialized. +// NewPcloudV2VolumesClonetasksGetParams creates a new PcloudV2VolumesClonetasksGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumesClonetasksGetParams() *PcloudV2VolumesClonetasksGetParams { - var () return &PcloudV2VolumesClonetasksGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumesClonetasksGetParamsWithTimeout creates a new PcloudV2VolumesClonetasksGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumesClonetasksGetParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesClonetasksGetParams { - var () return &PcloudV2VolumesClonetasksGetParams{ - timeout: timeout, } } // NewPcloudV2VolumesClonetasksGetParamsWithContext creates a new PcloudV2VolumesClonetasksGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumesClonetasksGetParamsWithContext(ctx context.Context) *PcloudV2VolumesClonetasksGetParams { - var () return &PcloudV2VolumesClonetasksGetParams{ - Context: ctx, } } // NewPcloudV2VolumesClonetasksGetParamsWithHTTPClient creates a new PcloudV2VolumesClonetasksGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumesClonetasksGetParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesClonetasksGetParams { - var () return &PcloudV2VolumesClonetasksGetParams{ HTTPClient: client, } } -/*PcloudV2VolumesClonetasksGetParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumes clonetasks get operation typically these are written to a http.Request +/* PcloudV2VolumesClonetasksGetParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumes clonetasks get operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumesClonetasksGetParams struct { - /*CloneTaskID - Volumes Clone Task ID + /* CloneTaskID. + Volumes Clone Task ID */ CloneTaskID string - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -77,6 +76,21 @@ type PcloudV2VolumesClonetasksGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumes clonetasks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesClonetasksGetParams) WithDefaults() *PcloudV2VolumesClonetasksGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumes clonetasks get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesClonetasksGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumes clonetasks get params func (o *PcloudV2VolumesClonetasksGetParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesClonetasksGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go index bbba347e5f..a59491866c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumesClonetasksGetReader is a Reader for the PcloudV2VolumesClonetasksGet structure. @@ -24,51 +23,44 @@ type PcloudV2VolumesClonetasksGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumesClonetasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2VolumesClonetasksGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumesClonetasksGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumesClonetasksGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumesClonetasksGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudV2VolumesClonetasksGetConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumesClonetasksGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudV2VolumesClonetasksGetOK() *PcloudV2VolumesClonetasksGetOK { return &PcloudV2VolumesClonetasksGetOK{} } -/*PcloudV2VolumesClonetasksGetOK handles this case with default header values. +/* PcloudV2VolumesClonetasksGetOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type PcloudV2VolumesClonetasksGetOK struct { func (o *PcloudV2VolumesClonetasksGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetOK %+v", 200, o.Payload) } +func (o *PcloudV2VolumesClonetasksGetOK) GetPayload() *models.CloneTaskStatus { + return o.Payload +} func (o *PcloudV2VolumesClonetasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudV2VolumesClonetasksGetBadRequest() *PcloudV2VolumesClonetasksGetBa return &PcloudV2VolumesClonetasksGetBadRequest{} } -/*PcloudV2VolumesClonetasksGetBadRequest handles this case with default header values. +/* PcloudV2VolumesClonetasksGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudV2VolumesClonetasksGetBadRequest struct { func (o *PcloudV2VolumesClonetasksGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumesClonetasksGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonetasksGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudV2VolumesClonetasksGetUnauthorized() *PcloudV2VolumesClonetasksGet return &PcloudV2VolumesClonetasksGetUnauthorized{} } -/*PcloudV2VolumesClonetasksGetUnauthorized handles this case with default header values. +/* PcloudV2VolumesClonetasksGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudV2VolumesClonetasksGetUnauthorized struct { func (o *PcloudV2VolumesClonetasksGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumesClonetasksGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonetasksGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudV2VolumesClonetasksGetNotFound() *PcloudV2VolumesClonetasksGetNotF return &PcloudV2VolumesClonetasksGetNotFound{} } -/*PcloudV2VolumesClonetasksGetNotFound handles this case with default header values. +/* PcloudV2VolumesClonetasksGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -175,6 +176,9 @@ type PcloudV2VolumesClonetasksGetNotFound struct { func (o *PcloudV2VolumesClonetasksGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumesClonetasksGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonetasksGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudV2VolumesClonetasksGetConflict() *PcloudV2VolumesClonetasksGetConf return &PcloudV2VolumesClonetasksGetConflict{} } -/*PcloudV2VolumesClonetasksGetConflict handles this case with default header values. +/* PcloudV2VolumesClonetasksGetConflict describes a response with status code 409, with default header values. Conflict */ @@ -204,6 +208,9 @@ type PcloudV2VolumesClonetasksGetConflict struct { func (o *PcloudV2VolumesClonetasksGetConflict) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetConflict %+v", 409, o.Payload) } +func (o *PcloudV2VolumesClonetasksGetConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonetasksGetConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudV2VolumesClonetasksGetInternalServerError() *PcloudV2VolumesClonet return &PcloudV2VolumesClonetasksGetInternalServerError{} } -/*PcloudV2VolumesClonetasksGetInternalServerError handles this case with default header values. +/* PcloudV2VolumesClonetasksGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudV2VolumesClonetasksGetInternalServerError struct { func (o *PcloudV2VolumesClonetasksGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumesClonetasksGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesClonetasksGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go index 8b845c01d7..6ec3d1080d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2VolumesPostParams creates a new PcloudV2VolumesPostParams object -// with the default values initialized. +// NewPcloudV2VolumesPostParams creates a new PcloudV2VolumesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumesPostParams() *PcloudV2VolumesPostParams { - var () return &PcloudV2VolumesPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumesPostParamsWithTimeout creates a new PcloudV2VolumesPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumesPostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesPostParams { - var () return &PcloudV2VolumesPostParams{ - timeout: timeout, } } // NewPcloudV2VolumesPostParamsWithContext creates a new PcloudV2VolumesPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumesPostParamsWithContext(ctx context.Context) *PcloudV2VolumesPostParams { - var () return &PcloudV2VolumesPostParams{ - Context: ctx, } } // NewPcloudV2VolumesPostParamsWithHTTPClient creates a new PcloudV2VolumesPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumesPostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesPostParams { - var () return &PcloudV2VolumesPostParams{ HTTPClient: client, } } -/*PcloudV2VolumesPostParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumes post operation typically these are written to a http.Request +/* PcloudV2VolumesPostParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumes post operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumesPostParams struct { - /*Body - Parameters for creating multiple volumes + /* Body. + Parameters for creating multiple volumes */ Body *models.MultiVolumesCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudV2VolumesPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesPostParams) WithDefaults() *PcloudV2VolumesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumes post params func (o *PcloudV2VolumesPostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesPostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudV2VolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go index 69414ddb58..7101f33372 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumesPostReader is a Reader for the PcloudV2VolumesPost structure. @@ -24,51 +23,44 @@ type PcloudV2VolumesPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 201: result := NewPcloudV2VolumesPostCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumesPostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumesPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudV2VolumesPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewPcloudV2VolumesPostUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudV2VolumesPostCreated() *PcloudV2VolumesPostCreated { return &PcloudV2VolumesPostCreated{} } -/*PcloudV2VolumesPostCreated handles this case with default header values. +/* PcloudV2VolumesPostCreated describes a response with status code 201, with default header values. Created */ @@ -88,6 +80,9 @@ type PcloudV2VolumesPostCreated struct { func (o *PcloudV2VolumesPostCreated) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostCreated %+v", 201, o.Payload) } +func (o *PcloudV2VolumesPostCreated) GetPayload() *models.Volumes { + return o.Payload +} func (o *PcloudV2VolumesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudV2VolumesPostBadRequest() *PcloudV2VolumesPostBadRequest { return &PcloudV2VolumesPostBadRequest{} } -/*PcloudV2VolumesPostBadRequest handles this case with default header values. +/* PcloudV2VolumesPostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudV2VolumesPostBadRequest struct { func (o *PcloudV2VolumesPostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudV2VolumesPostUnauthorized() *PcloudV2VolumesPostUnauthorized { return &PcloudV2VolumesPostUnauthorized{} } -/*PcloudV2VolumesPostUnauthorized handles this case with default header values. +/* PcloudV2VolumesPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudV2VolumesPostUnauthorized struct { func (o *PcloudV2VolumesPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudV2VolumesPostConflict() *PcloudV2VolumesPostConflict { return &PcloudV2VolumesPostConflict{} } -/*PcloudV2VolumesPostConflict handles this case with default header values. +/* PcloudV2VolumesPostConflict describes a response with status code 409, with default header values. Conflict */ @@ -175,6 +176,9 @@ type PcloudV2VolumesPostConflict struct { func (o *PcloudV2VolumesPostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostConflict %+v", 409, o.Payload) } +func (o *PcloudV2VolumesPostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudV2VolumesPostUnprocessableEntity() *PcloudV2VolumesPostUnprocessab return &PcloudV2VolumesPostUnprocessableEntity{} } -/*PcloudV2VolumesPostUnprocessableEntity handles this case with default header values. +/* PcloudV2VolumesPostUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -204,6 +208,9 @@ type PcloudV2VolumesPostUnprocessableEntity struct { func (o *PcloudV2VolumesPostUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnprocessableEntity %+v", 422, o.Payload) } +func (o *PcloudV2VolumesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudV2VolumesPostInternalServerError() *PcloudV2VolumesPostInternalSer return &PcloudV2VolumesPostInternalServerError{} } -/*PcloudV2VolumesPostInternalServerError handles this case with default header values. +/* PcloudV2VolumesPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudV2VolumesPostInternalServerError struct { func (o *PcloudV2VolumesPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go index c9c6ef715d..a71bc1d7ee 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2VolumescloneCancelPostParams creates a new PcloudV2VolumescloneCancelPostParams object -// with the default values initialized. +// NewPcloudV2VolumescloneCancelPostParams creates a new PcloudV2VolumescloneCancelPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumescloneCancelPostParams() *PcloudV2VolumescloneCancelPostParams { - var () return &PcloudV2VolumescloneCancelPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumescloneCancelPostParamsWithTimeout creates a new PcloudV2VolumescloneCancelPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumescloneCancelPostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneCancelPostParams { - var () return &PcloudV2VolumescloneCancelPostParams{ - timeout: timeout, } } // NewPcloudV2VolumescloneCancelPostParamsWithContext creates a new PcloudV2VolumescloneCancelPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumescloneCancelPostParamsWithContext(ctx context.Context) *PcloudV2VolumescloneCancelPostParams { - var () return &PcloudV2VolumescloneCancelPostParams{ - Context: ctx, } } // NewPcloudV2VolumescloneCancelPostParamsWithHTTPClient creates a new PcloudV2VolumescloneCancelPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumescloneCancelPostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneCancelPostParams { - var () return &PcloudV2VolumescloneCancelPostParams{ HTTPClient: client, } } -/*PcloudV2VolumescloneCancelPostParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone cancel post operation typically these are written to a http.Request +/* PcloudV2VolumescloneCancelPostParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone cancel post operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumescloneCancelPostParams struct { - /*Body - Parameters for cancelling a volumes-clone request + /* Body. + Parameters for cancelling a volumes-clone request */ Body *models.VolumesCloneCancel - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumesCloneID - Volumes Clone ID + /* VolumesCloneID. + + Volumes Clone ID */ VolumesCloneID string @@ -84,6 +84,21 @@ type PcloudV2VolumescloneCancelPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone cancel post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneCancelPostParams) WithDefaults() *PcloudV2VolumescloneCancelPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone cancel post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneCancelPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone cancel post params func (o *PcloudV2VolumescloneCancelPostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneCancelPostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudV2VolumescloneCancelPostParams) WriteToRequest(r runtime.ClientRe return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go index 74547a7b7c..3d06fe1bae 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumescloneCancelPostReader is a Reader for the PcloudV2VolumescloneCancelPost structure. @@ -24,37 +23,32 @@ type PcloudV2VolumescloneCancelPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumescloneCancelPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2VolumescloneCancelPostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudV2VolumescloneCancelPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumescloneCancelPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumescloneCancelPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudV2VolumescloneCancelPostAccepted() *PcloudV2VolumescloneCancelPost return &PcloudV2VolumescloneCancelPostAccepted{} } -/*PcloudV2VolumescloneCancelPostAccepted handles this case with default header values. +/* PcloudV2VolumescloneCancelPostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -74,6 +68,9 @@ type PcloudV2VolumescloneCancelPostAccepted struct { func (o *PcloudV2VolumescloneCancelPostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2VolumescloneCancelPostAccepted) GetPayload() *models.VolumesClone { + return o.Payload +} func (o *PcloudV2VolumescloneCancelPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudV2VolumescloneCancelPostUnauthorized() *PcloudV2VolumescloneCancel return &PcloudV2VolumescloneCancelPostUnauthorized{} } -/*PcloudV2VolumescloneCancelPostUnauthorized handles this case with default header values. +/* PcloudV2VolumescloneCancelPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudV2VolumescloneCancelPostUnauthorized struct { func (o *PcloudV2VolumescloneCancelPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumescloneCancelPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneCancelPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudV2VolumescloneCancelPostNotFound() *PcloudV2VolumescloneCancelPost return &PcloudV2VolumescloneCancelPostNotFound{} } -/*PcloudV2VolumescloneCancelPostNotFound handles this case with default header values. +/* PcloudV2VolumescloneCancelPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudV2VolumescloneCancelPostNotFound struct { func (o *PcloudV2VolumescloneCancelPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumescloneCancelPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneCancelPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudV2VolumescloneCancelPostInternalServerError() *PcloudV2Volumesclon return &PcloudV2VolumescloneCancelPostInternalServerError{} } -/*PcloudV2VolumescloneCancelPostInternalServerError handles this case with default header values. +/* PcloudV2VolumescloneCancelPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudV2VolumescloneCancelPostInternalServerError struct { func (o *PcloudV2VolumescloneCancelPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumescloneCancelPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneCancelPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go index 49a56a1fa1..bee811980f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2VolumescloneDeleteParams creates a new PcloudV2VolumescloneDeleteParams object -// with the default values initialized. +// NewPcloudV2VolumescloneDeleteParams creates a new PcloudV2VolumescloneDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumescloneDeleteParams() *PcloudV2VolumescloneDeleteParams { - var () return &PcloudV2VolumescloneDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumescloneDeleteParamsWithTimeout creates a new PcloudV2VolumescloneDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumescloneDeleteParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneDeleteParams { - var () return &PcloudV2VolumescloneDeleteParams{ - timeout: timeout, } } // NewPcloudV2VolumescloneDeleteParamsWithContext creates a new PcloudV2VolumescloneDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumescloneDeleteParamsWithContext(ctx context.Context) *PcloudV2VolumescloneDeleteParams { - var () return &PcloudV2VolumescloneDeleteParams{ - Context: ctx, } } // NewPcloudV2VolumescloneDeleteParamsWithHTTPClient creates a new PcloudV2VolumescloneDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumescloneDeleteParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneDeleteParams { - var () return &PcloudV2VolumescloneDeleteParams{ HTTPClient: client, } } -/*PcloudV2VolumescloneDeleteParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone delete operation typically these are written to a http.Request +/* PcloudV2VolumescloneDeleteParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone delete operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumescloneDeleteParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumesCloneID - Volumes Clone ID + /* VolumesCloneID. + + Volumes Clone ID */ VolumesCloneID string @@ -77,6 +76,21 @@ type PcloudV2VolumescloneDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneDeleteParams) WithDefaults() *PcloudV2VolumescloneDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone delete params func (o *PcloudV2VolumescloneDeleteParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneDeleteParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go index 3869fc6977..2dc153ace6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumescloneDeleteReader is a Reader for the PcloudV2VolumescloneDelete structure. @@ -24,44 +23,38 @@ type PcloudV2VolumescloneDeleteReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumescloneDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2VolumescloneDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumescloneDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumescloneDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumescloneDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumescloneDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudV2VolumescloneDeleteOK() *PcloudV2VolumescloneDeleteOK { return &PcloudV2VolumescloneDeleteOK{} } -/*PcloudV2VolumescloneDeleteOK handles this case with default header values. +/* PcloudV2VolumescloneDeleteOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudV2VolumescloneDeleteOK struct { func (o *PcloudV2VolumescloneDeleteOK) Error() string { return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteOK %+v", 200, o.Payload) } +func (o *PcloudV2VolumescloneDeleteOK) GetPayload() models.Object { + return o.Payload +} func (o *PcloudV2VolumescloneDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewPcloudV2VolumescloneDeleteBadRequest() *PcloudV2VolumescloneDeleteBadReq return &PcloudV2VolumescloneDeleteBadRequest{} } -/*PcloudV2VolumescloneDeleteBadRequest handles this case with default header values. +/* PcloudV2VolumescloneDeleteBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -108,6 +104,9 @@ type PcloudV2VolumescloneDeleteBadRequest struct { func (o *PcloudV2VolumescloneDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumescloneDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewPcloudV2VolumescloneDeleteUnauthorized() *PcloudV2VolumescloneDeleteUnau return &PcloudV2VolumescloneDeleteUnauthorized{} } -/*PcloudV2VolumescloneDeleteUnauthorized handles this case with default header values. +/* PcloudV2VolumescloneDeleteUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -137,6 +136,9 @@ type PcloudV2VolumescloneDeleteUnauthorized struct { func (o *PcloudV2VolumescloneDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumescloneDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewPcloudV2VolumescloneDeleteNotFound() *PcloudV2VolumescloneDeleteNotFound return &PcloudV2VolumescloneDeleteNotFound{} } -/*PcloudV2VolumescloneDeleteNotFound handles this case with default header values. +/* PcloudV2VolumescloneDeleteNotFound describes a response with status code 404, with default header values. Not Found */ @@ -166,6 +168,9 @@ type PcloudV2VolumescloneDeleteNotFound struct { func (o *PcloudV2VolumescloneDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumescloneDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewPcloudV2VolumescloneDeleteInternalServerError() *PcloudV2VolumescloneDel return &PcloudV2VolumescloneDeleteInternalServerError{} } -/*PcloudV2VolumescloneDeleteInternalServerError handles this case with default header values. +/* PcloudV2VolumescloneDeleteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -195,6 +200,9 @@ type PcloudV2VolumescloneDeleteInternalServerError struct { func (o *PcloudV2VolumescloneDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumescloneDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go index 222da1c3d7..f3d74219a2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_parameters.go @@ -13,69 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2VolumescloneExecutePostParams creates a new PcloudV2VolumescloneExecutePostParams object -// with the default values initialized. +// NewPcloudV2VolumescloneExecutePostParams creates a new PcloudV2VolumescloneExecutePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumescloneExecutePostParams() *PcloudV2VolumescloneExecutePostParams { - var () return &PcloudV2VolumescloneExecutePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumescloneExecutePostParamsWithTimeout creates a new PcloudV2VolumescloneExecutePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumescloneExecutePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneExecutePostParams { - var () return &PcloudV2VolumescloneExecutePostParams{ - timeout: timeout, } } // NewPcloudV2VolumescloneExecutePostParamsWithContext creates a new PcloudV2VolumescloneExecutePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumescloneExecutePostParamsWithContext(ctx context.Context) *PcloudV2VolumescloneExecutePostParams { - var () return &PcloudV2VolumescloneExecutePostParams{ - Context: ctx, } } // NewPcloudV2VolumescloneExecutePostParamsWithHTTPClient creates a new PcloudV2VolumescloneExecutePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumescloneExecutePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneExecutePostParams { - var () return &PcloudV2VolumescloneExecutePostParams{ HTTPClient: client, } } -/*PcloudV2VolumescloneExecutePostParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone execute post operation typically these are written to a http.Request +/* PcloudV2VolumescloneExecutePostParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone execute post operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumescloneExecutePostParams struct { - /*Body - Parameters for the cloning of volumes + /* Body. + Parameters for the cloning of volumes */ Body *models.VolumesCloneExecute - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumesCloneID - Volumes Clone ID + /* VolumesCloneID. + + Volumes Clone ID */ VolumesCloneID string @@ -84,6 +84,21 @@ type PcloudV2VolumescloneExecutePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone execute post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneExecutePostParams) WithDefaults() *PcloudV2VolumescloneExecutePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone execute post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneExecutePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone execute post params func (o *PcloudV2VolumescloneExecutePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneExecutePostParams { o.SetTimeout(timeout) @@ -157,7 +172,6 @@ func (o *PcloudV2VolumescloneExecutePostParams) WriteToRequest(r runtime.ClientR return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go index d2cb004a62..4523d858fd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumescloneExecutePostReader is a Reader for the PcloudV2VolumescloneExecutePost structure. @@ -24,44 +23,38 @@ type PcloudV2VolumescloneExecutePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumescloneExecutePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2VolumescloneExecutePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumescloneExecutePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumescloneExecutePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumescloneExecutePostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumescloneExecutePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudV2VolumescloneExecutePostAccepted() *PcloudV2VolumescloneExecutePo return &PcloudV2VolumescloneExecutePostAccepted{} } -/*PcloudV2VolumescloneExecutePostAccepted handles this case with default header values. +/* PcloudV2VolumescloneExecutePostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -81,6 +74,9 @@ type PcloudV2VolumescloneExecutePostAccepted struct { func (o *PcloudV2VolumescloneExecutePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2VolumescloneExecutePostAccepted) GetPayload() *models.VolumesClone { + return o.Payload +} func (o *PcloudV2VolumescloneExecutePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudV2VolumescloneExecutePostBadRequest() *PcloudV2VolumescloneExecute return &PcloudV2VolumescloneExecutePostBadRequest{} } -/*PcloudV2VolumescloneExecutePostBadRequest handles this case with default header values. +/* PcloudV2VolumescloneExecutePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudV2VolumescloneExecutePostBadRequest struct { func (o *PcloudV2VolumescloneExecutePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumescloneExecutePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneExecutePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudV2VolumescloneExecutePostUnauthorized() *PcloudV2VolumescloneExecu return &PcloudV2VolumescloneExecutePostUnauthorized{} } -/*PcloudV2VolumescloneExecutePostUnauthorized handles this case with default header values. +/* PcloudV2VolumescloneExecutePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudV2VolumescloneExecutePostUnauthorized struct { func (o *PcloudV2VolumescloneExecutePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumescloneExecutePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneExecutePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudV2VolumescloneExecutePostNotFound() *PcloudV2VolumescloneExecutePo return &PcloudV2VolumescloneExecutePostNotFound{} } -/*PcloudV2VolumescloneExecutePostNotFound handles this case with default header values. +/* PcloudV2VolumescloneExecutePostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudV2VolumescloneExecutePostNotFound struct { func (o *PcloudV2VolumescloneExecutePostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumescloneExecutePostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneExecutePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudV2VolumescloneExecutePostInternalServerError() *PcloudV2Volumesclo return &PcloudV2VolumescloneExecutePostInternalServerError{} } -/*PcloudV2VolumescloneExecutePostInternalServerError handles this case with default header values. +/* PcloudV2VolumescloneExecutePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudV2VolumescloneExecutePostInternalServerError struct { func (o *PcloudV2VolumescloneExecutePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumescloneExecutePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneExecutePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go index 47fc5eeb8e..0a9c293e30 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2VolumescloneGetParams creates a new PcloudV2VolumescloneGetParams object -// with the default values initialized. +// NewPcloudV2VolumescloneGetParams creates a new PcloudV2VolumescloneGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumescloneGetParams() *PcloudV2VolumescloneGetParams { - var () return &PcloudV2VolumescloneGetParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumescloneGetParamsWithTimeout creates a new PcloudV2VolumescloneGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumescloneGetParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetParams { - var () return &PcloudV2VolumescloneGetParams{ - timeout: timeout, } } // NewPcloudV2VolumescloneGetParamsWithContext creates a new PcloudV2VolumescloneGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumescloneGetParamsWithContext(ctx context.Context) *PcloudV2VolumescloneGetParams { - var () return &PcloudV2VolumescloneGetParams{ - Context: ctx, } } // NewPcloudV2VolumescloneGetParamsWithHTTPClient creates a new PcloudV2VolumescloneGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumescloneGetParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneGetParams { - var () return &PcloudV2VolumescloneGetParams{ HTTPClient: client, } } -/*PcloudV2VolumescloneGetParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone get operation typically these are written to a http.Request +/* PcloudV2VolumescloneGetParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone get operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumescloneGetParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumesCloneID - Volumes Clone ID + /* VolumesCloneID. + + Volumes Clone ID */ VolumesCloneID string @@ -77,6 +76,21 @@ type PcloudV2VolumescloneGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneGetParams) WithDefaults() *PcloudV2VolumescloneGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone get params func (o *PcloudV2VolumescloneGetParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go index 7de160af61..f1dfe63fb3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumescloneGetReader is a Reader for the PcloudV2VolumescloneGet structure. @@ -24,44 +23,38 @@ type PcloudV2VolumescloneGetReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumescloneGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2VolumescloneGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumescloneGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumescloneGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumescloneGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumescloneGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudV2VolumescloneGetOK() *PcloudV2VolumescloneGetOK { return &PcloudV2VolumescloneGetOK{} } -/*PcloudV2VolumescloneGetOK handles this case with default header values. +/* PcloudV2VolumescloneGetOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudV2VolumescloneGetOK struct { func (o *PcloudV2VolumescloneGetOK) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetOK %+v", 200, o.Payload) } +func (o *PcloudV2VolumescloneGetOK) GetPayload() *models.VolumesCloneDetail { + return o.Payload +} func (o *PcloudV2VolumescloneGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudV2VolumescloneGetBadRequest() *PcloudV2VolumescloneGetBadRequest { return &PcloudV2VolumescloneGetBadRequest{} } -/*PcloudV2VolumescloneGetBadRequest handles this case with default header values. +/* PcloudV2VolumescloneGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudV2VolumescloneGetBadRequest struct { func (o *PcloudV2VolumescloneGetBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumescloneGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudV2VolumescloneGetUnauthorized() *PcloudV2VolumescloneGetUnauthoriz return &PcloudV2VolumescloneGetUnauthorized{} } -/*PcloudV2VolumescloneGetUnauthorized handles this case with default header values. +/* PcloudV2VolumescloneGetUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudV2VolumescloneGetUnauthorized struct { func (o *PcloudV2VolumescloneGetUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumescloneGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudV2VolumescloneGetNotFound() *PcloudV2VolumescloneGetNotFound { return &PcloudV2VolumescloneGetNotFound{} } -/*PcloudV2VolumescloneGetNotFound handles this case with default header values. +/* PcloudV2VolumescloneGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudV2VolumescloneGetNotFound struct { func (o *PcloudV2VolumescloneGetNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumescloneGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudV2VolumescloneGetInternalServerError() *PcloudV2VolumescloneGetInt return &PcloudV2VolumescloneGetInternalServerError{} } -/*PcloudV2VolumescloneGetInternalServerError handles this case with default header values. +/* PcloudV2VolumescloneGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudV2VolumescloneGetInternalServerError struct { func (o *PcloudV2VolumescloneGetInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumescloneGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go index 6e231a9a54..f18506d062 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_parameters.go @@ -13,70 +13,69 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2VolumescloneGetallParams creates a new PcloudV2VolumescloneGetallParams object -// with the default values initialized. +// NewPcloudV2VolumescloneGetallParams creates a new PcloudV2VolumescloneGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumescloneGetallParams() *PcloudV2VolumescloneGetallParams { - var () return &PcloudV2VolumescloneGetallParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumescloneGetallParamsWithTimeout creates a new PcloudV2VolumescloneGetallParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumescloneGetallParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetallParams { - var () return &PcloudV2VolumescloneGetallParams{ - timeout: timeout, } } // NewPcloudV2VolumescloneGetallParamsWithContext creates a new PcloudV2VolumescloneGetallParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumescloneGetallParamsWithContext(ctx context.Context) *PcloudV2VolumescloneGetallParams { - var () return &PcloudV2VolumescloneGetallParams{ - Context: ctx, } } // NewPcloudV2VolumescloneGetallParamsWithHTTPClient creates a new PcloudV2VolumescloneGetallParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumescloneGetallParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneGetallParams { - var () return &PcloudV2VolumescloneGetallParams{ HTTPClient: client, } } -/*PcloudV2VolumescloneGetallParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone getall operation typically these are written to a http.Request +/* PcloudV2VolumescloneGetallParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone getall operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumescloneGetallParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*Filter - volumes-clone filter to limit list items: - prepare - includes status values (preparing, prepared) - start - includes status values (starting, available) - execute - includes status values (executing, available-rollback) - cancel - includes status values (cancelling) - completed - includes status values (completed) - failed - includes status values (failed) - cancelled - includes status values (cancelled) - finalized - included status values (completed, failed, cancelled) + /* Filter. + + volumes-clone filter to limit list items: + prepare - includes status values (preparing, prepared) + start - includes status values (starting, available) + execute - includes status values (executing, available-rollback) + cancel - includes status values (cancelling) + completed - includes status values (completed) + failed - includes status values (failed) + cancelled - includes status values (cancelled) + finalized - included status values (completed, failed, cancelled) */ Filter *string @@ -86,6 +85,21 @@ type PcloudV2VolumescloneGetallParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneGetallParams) WithDefaults() *PcloudV2VolumescloneGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneGetallParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone getall params func (o *PcloudV2VolumescloneGetallParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneGetallParams { o.SetTimeout(timeout) @@ -158,16 +172,17 @@ func (o *PcloudV2VolumescloneGetallParams) WriteToRequest(r runtime.ClientReques // query param filter var qrFilter string + if o.Filter != nil { qrFilter = *o.Filter } qFilter := qrFilter if qFilter != "" { + if err := r.SetQueryParam("filter", qFilter); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go index e641fecd1b..ed1b66608f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumescloneGetallReader is a Reader for the PcloudV2VolumescloneGetall structure. @@ -24,44 +23,38 @@ type PcloudV2VolumescloneGetallReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumescloneGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2VolumescloneGetallOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumescloneGetallBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumescloneGetallUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumescloneGetallNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumescloneGetallInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudV2VolumescloneGetallOK() *PcloudV2VolumescloneGetallOK { return &PcloudV2VolumescloneGetallOK{} } -/*PcloudV2VolumescloneGetallOK handles this case with default header values. +/* PcloudV2VolumescloneGetallOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudV2VolumescloneGetallOK struct { func (o *PcloudV2VolumescloneGetallOK) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallOK %+v", 200, o.Payload) } +func (o *PcloudV2VolumescloneGetallOK) GetPayload() *models.VolumesClones { + return o.Payload +} func (o *PcloudV2VolumescloneGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudV2VolumescloneGetallBadRequest() *PcloudV2VolumescloneGetallBadReq return &PcloudV2VolumescloneGetallBadRequest{} } -/*PcloudV2VolumescloneGetallBadRequest handles this case with default header values. +/* PcloudV2VolumescloneGetallBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudV2VolumescloneGetallBadRequest struct { func (o *PcloudV2VolumescloneGetallBadRequest) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumescloneGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudV2VolumescloneGetallUnauthorized() *PcloudV2VolumescloneGetallUnau return &PcloudV2VolumescloneGetallUnauthorized{} } -/*PcloudV2VolumescloneGetallUnauthorized handles this case with default header values. +/* PcloudV2VolumescloneGetallUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudV2VolumescloneGetallUnauthorized struct { func (o *PcloudV2VolumescloneGetallUnauthorized) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumescloneGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudV2VolumescloneGetallNotFound() *PcloudV2VolumescloneGetallNotFound return &PcloudV2VolumescloneGetallNotFound{} } -/*PcloudV2VolumescloneGetallNotFound handles this case with default header values. +/* PcloudV2VolumescloneGetallNotFound describes a response with status code 404, with default header values. Not Found */ @@ -168,6 +170,9 @@ type PcloudV2VolumescloneGetallNotFound struct { func (o *PcloudV2VolumescloneGetallNotFound) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumescloneGetallNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudV2VolumescloneGetallInternalServerError() *PcloudV2VolumescloneGet return &PcloudV2VolumescloneGetallInternalServerError{} } -/*PcloudV2VolumescloneGetallInternalServerError handles this case with default header values. +/* PcloudV2VolumescloneGetallInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudV2VolumescloneGetallInternalServerError struct { func (o *PcloudV2VolumescloneGetallInternalServerError) Error() string { return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumescloneGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go index 46423f79cc..f728df4e87 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudV2VolumesclonePostParams creates a new PcloudV2VolumesclonePostParams object -// with the default values initialized. +// NewPcloudV2VolumesclonePostParams creates a new PcloudV2VolumesclonePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumesclonePostParams() *PcloudV2VolumesclonePostParams { - var () return &PcloudV2VolumesclonePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumesclonePostParamsWithTimeout creates a new PcloudV2VolumesclonePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumesclonePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesclonePostParams { - var () return &PcloudV2VolumesclonePostParams{ - timeout: timeout, } } // NewPcloudV2VolumesclonePostParamsWithContext creates a new PcloudV2VolumesclonePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumesclonePostParamsWithContext(ctx context.Context) *PcloudV2VolumesclonePostParams { - var () return &PcloudV2VolumesclonePostParams{ - Context: ctx, } } // NewPcloudV2VolumesclonePostParamsWithHTTPClient creates a new PcloudV2VolumesclonePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumesclonePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesclonePostParams { - var () return &PcloudV2VolumesclonePostParams{ HTTPClient: client, } } -/*PcloudV2VolumesclonePostParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone post operation typically these are written to a http.Request +/* PcloudV2VolumesclonePostParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone post operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumesclonePostParams struct { - /*Body - Parameters for preparing a set of volumes to be cloned + /* Body. + Parameters for preparing a set of volumes to be cloned */ Body *models.VolumesCloneCreate - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudV2VolumesclonePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesclonePostParams) WithDefaults() *PcloudV2VolumesclonePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumesclonePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesclonePostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudV2VolumesclonePostParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go index 027b2c16d5..6caa458fd9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumesclonePostReader is a Reader for the PcloudV2VolumesclonePost structure. @@ -24,51 +23,44 @@ type PcloudV2VolumesclonePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumesclonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 202: result := NewPcloudV2VolumesclonePostAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudV2VolumesclonePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudV2VolumesclonePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 403: result := NewPcloudV2VolumesclonePostForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumesclonePostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumesclonePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewPcloudV2VolumesclonePostAccepted() *PcloudV2VolumesclonePostAccepted { return &PcloudV2VolumesclonePostAccepted{} } -/*PcloudV2VolumesclonePostAccepted handles this case with default header values. +/* PcloudV2VolumesclonePostAccepted describes a response with status code 202, with default header values. Accepted */ @@ -88,6 +80,9 @@ type PcloudV2VolumesclonePostAccepted struct { func (o *PcloudV2VolumesclonePostAccepted) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostAccepted %+v", 202, o.Payload) } +func (o *PcloudV2VolumesclonePostAccepted) GetPayload() *models.VolumesClone { + return o.Payload +} func (o *PcloudV2VolumesclonePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewPcloudV2VolumesclonePostBadRequest() *PcloudV2VolumesclonePostBadRequest return &PcloudV2VolumesclonePostBadRequest{} } -/*PcloudV2VolumesclonePostBadRequest handles this case with default header values. +/* PcloudV2VolumesclonePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -117,6 +112,9 @@ type PcloudV2VolumesclonePostBadRequest struct { func (o *PcloudV2VolumesclonePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudV2VolumesclonePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesclonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewPcloudV2VolumesclonePostUnauthorized() *PcloudV2VolumesclonePostUnauthor return &PcloudV2VolumesclonePostUnauthorized{} } -/*PcloudV2VolumesclonePostUnauthorized handles this case with default header values. +/* PcloudV2VolumesclonePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -146,6 +144,9 @@ type PcloudV2VolumesclonePostUnauthorized struct { func (o *PcloudV2VolumesclonePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumesclonePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesclonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewPcloudV2VolumesclonePostForbidden() *PcloudV2VolumesclonePostForbidden { return &PcloudV2VolumesclonePostForbidden{} } -/*PcloudV2VolumesclonePostForbidden handles this case with default header values. +/* PcloudV2VolumesclonePostForbidden describes a response with status code 403, with default header values. Forbidden */ @@ -175,6 +176,9 @@ type PcloudV2VolumesclonePostForbidden struct { func (o *PcloudV2VolumesclonePostForbidden) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostForbidden %+v", 403, o.Payload) } +func (o *PcloudV2VolumesclonePostForbidden) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesclonePostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewPcloudV2VolumesclonePostNotFound() *PcloudV2VolumesclonePostNotFound { return &PcloudV2VolumesclonePostNotFound{} } -/*PcloudV2VolumesclonePostNotFound handles this case with default header values. +/* PcloudV2VolumesclonePostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -204,6 +208,9 @@ type PcloudV2VolumesclonePostNotFound struct { func (o *PcloudV2VolumesclonePostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumesclonePostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesclonePostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewPcloudV2VolumesclonePostInternalServerError() *PcloudV2VolumesclonePostI return &PcloudV2VolumesclonePostInternalServerError{} } -/*PcloudV2VolumesclonePostInternalServerError handles this case with default header values. +/* PcloudV2VolumesclonePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -233,6 +240,9 @@ type PcloudV2VolumesclonePostInternalServerError struct { func (o *PcloudV2VolumesclonePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumesclonePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumesclonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go index 240393ba15..86e9c24684 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_parameters.go @@ -13,62 +13,61 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewPcloudV2VolumescloneStartPostParams creates a new PcloudV2VolumescloneStartPostParams object -// with the default values initialized. +// NewPcloudV2VolumescloneStartPostParams creates a new PcloudV2VolumescloneStartPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumescloneStartPostParams() *PcloudV2VolumescloneStartPostParams { - var () return &PcloudV2VolumescloneStartPostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudV2VolumescloneStartPostParamsWithTimeout creates a new PcloudV2VolumescloneStartPostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudV2VolumescloneStartPostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumescloneStartPostParams { - var () return &PcloudV2VolumescloneStartPostParams{ - timeout: timeout, } } // NewPcloudV2VolumescloneStartPostParamsWithContext creates a new PcloudV2VolumescloneStartPostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudV2VolumescloneStartPostParamsWithContext(ctx context.Context) *PcloudV2VolumescloneStartPostParams { - var () return &PcloudV2VolumescloneStartPostParams{ - Context: ctx, } } // NewPcloudV2VolumescloneStartPostParamsWithHTTPClient creates a new PcloudV2VolumescloneStartPostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumescloneStartPostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumescloneStartPostParams { - var () return &PcloudV2VolumescloneStartPostParams{ HTTPClient: client, } } -/*PcloudV2VolumescloneStartPostParams contains all the parameters to send to the API endpoint -for the pcloud v2 volumesclone start post operation typically these are written to a http.Request +/* PcloudV2VolumescloneStartPostParams contains all the parameters to send to the API endpoint + for the pcloud v2 volumesclone start post operation. + + Typically these are written to a http.Request. */ type PcloudV2VolumescloneStartPostParams struct { - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string - /*VolumesCloneID - Volumes Clone ID + /* VolumesCloneID. + + Volumes Clone ID */ VolumesCloneID string @@ -77,6 +76,21 @@ type PcloudV2VolumescloneStartPostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud v2 volumesclone start post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneStartPostParams) WithDefaults() *PcloudV2VolumescloneStartPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud v2 volumesclone start post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudV2VolumescloneStartPostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud v2 volumesclone start post params func (o *PcloudV2VolumescloneStartPostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumescloneStartPostParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go index 3024d07f29..a144d63d50 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudV2VolumescloneStartPostReader is a Reader for the PcloudV2VolumescloneStartPost structure. @@ -24,37 +23,32 @@ type PcloudV2VolumescloneStartPostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudV2VolumescloneStartPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudV2VolumescloneStartPostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 401: result := NewPcloudV2VolumescloneStartPostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 404: result := NewPcloudV2VolumescloneStartPostNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudV2VolumescloneStartPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewPcloudV2VolumescloneStartPostOK() *PcloudV2VolumescloneStartPostOK { return &PcloudV2VolumescloneStartPostOK{} } -/*PcloudV2VolumescloneStartPostOK handles this case with default header values. +/* PcloudV2VolumescloneStartPostOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type PcloudV2VolumescloneStartPostOK struct { func (o *PcloudV2VolumescloneStartPostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostOK %+v", 200, o.Payload) } +func (o *PcloudV2VolumescloneStartPostOK) GetPayload() *models.VolumesClone { + return o.Payload +} func (o *PcloudV2VolumescloneStartPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -92,7 +89,7 @@ func NewPcloudV2VolumescloneStartPostUnauthorized() *PcloudV2VolumescloneStartPo return &PcloudV2VolumescloneStartPostUnauthorized{} } -/*PcloudV2VolumescloneStartPostUnauthorized handles this case with default header values. +/* PcloudV2VolumescloneStartPostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -103,6 +100,9 @@ type PcloudV2VolumescloneStartPostUnauthorized struct { func (o *PcloudV2VolumescloneStartPostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudV2VolumescloneStartPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneStartPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -121,7 +121,7 @@ func NewPcloudV2VolumescloneStartPostNotFound() *PcloudV2VolumescloneStartPostNo return &PcloudV2VolumescloneStartPostNotFound{} } -/*PcloudV2VolumescloneStartPostNotFound handles this case with default header values. +/* PcloudV2VolumescloneStartPostNotFound describes a response with status code 404, with default header values. Not Found */ @@ -132,6 +132,9 @@ type PcloudV2VolumescloneStartPostNotFound struct { func (o *PcloudV2VolumescloneStartPostNotFound) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostNotFound %+v", 404, o.Payload) } +func (o *PcloudV2VolumescloneStartPostNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneStartPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -150,7 +153,7 @@ func NewPcloudV2VolumescloneStartPostInternalServerError() *PcloudV2Volumesclone return &PcloudV2VolumescloneStartPostInternalServerError{} } -/*PcloudV2VolumescloneStartPostInternalServerError handles this case with default header values. +/* PcloudV2VolumescloneStartPostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -161,6 +164,9 @@ type PcloudV2VolumescloneStartPostInternalServerError struct { func (o *PcloudV2VolumescloneStartPostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudV2VolumescloneStartPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudV2VolumescloneStartPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go index 7aba811656..44e22ad18e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_parameters.go @@ -13,64 +13,63 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewPcloudVolumesClonePostParams creates a new PcloudVolumesClonePostParams object -// with the default values initialized. +// NewPcloudVolumesClonePostParams creates a new PcloudVolumesClonePostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudVolumesClonePostParams() *PcloudVolumesClonePostParams { - var () return &PcloudVolumesClonePostParams{ - timeout: cr.DefaultTimeout, } } // NewPcloudVolumesClonePostParamsWithTimeout creates a new PcloudVolumesClonePostParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPcloudVolumesClonePostParamsWithTimeout(timeout time.Duration) *PcloudVolumesClonePostParams { - var () return &PcloudVolumesClonePostParams{ - timeout: timeout, } } // NewPcloudVolumesClonePostParamsWithContext creates a new PcloudVolumesClonePostParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPcloudVolumesClonePostParamsWithContext(ctx context.Context) *PcloudVolumesClonePostParams { - var () return &PcloudVolumesClonePostParams{ - Context: ctx, } } // NewPcloudVolumesClonePostParamsWithHTTPClient creates a new PcloudVolumesClonePostParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPcloudVolumesClonePostParamsWithHTTPClient(client *http.Client) *PcloudVolumesClonePostParams { - var () return &PcloudVolumesClonePostParams{ HTTPClient: client, } } -/*PcloudVolumesClonePostParams contains all the parameters to send to the API endpoint -for the pcloud volumes clone post operation typically these are written to a http.Request +/* PcloudVolumesClonePostParams contains all the parameters to send to the API endpoint + for the pcloud volumes clone post operation. + + Typically these are written to a http.Request. */ type PcloudVolumesClonePostParams struct { - /*Body - Parameters for the cloning of volumes + /* Body. + Parameters for the cloning of volumes */ Body *models.VolumesCloneRequest - /*CloudInstanceID - Cloud Instance ID of a PCloud Instance + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance */ CloudInstanceID string @@ -79,6 +78,21 @@ type PcloudVolumesClonePostParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the pcloud volumes clone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVolumesClonePostParams) WithDefaults() *PcloudVolumesClonePostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud volumes clone post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVolumesClonePostParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the pcloud volumes clone post params func (o *PcloudVolumesClonePostParams) WithTimeout(timeout time.Duration) *PcloudVolumesClonePostParams { o.SetTimeout(timeout) @@ -141,7 +155,6 @@ func (o *PcloudVolumesClonePostParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go index 261be98dcc..5c13855d74 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // PcloudVolumesClonePostReader is a Reader for the PcloudVolumesClonePost structure. @@ -24,44 +23,38 @@ type PcloudVolumesClonePostReader struct { // ReadResponse reads a server response into the received o. func (o *PcloudVolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewPcloudVolumesClonePostOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewPcloudVolumesClonePostBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 401: result := NewPcloudVolumesClonePostUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewPcloudVolumesClonePostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: result := NewPcloudVolumesClonePostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewPcloudVolumesClonePostOK() *PcloudVolumesClonePostOK { return &PcloudVolumesClonePostOK{} } -/*PcloudVolumesClonePostOK handles this case with default header values. +/* PcloudVolumesClonePostOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type PcloudVolumesClonePostOK struct { func (o *PcloudVolumesClonePostOK) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostOK %+v", 200, o.Payload) } +func (o *PcloudVolumesClonePostOK) GetPayload() *models.VolumesCloneResponse { + return o.Payload +} func (o *PcloudVolumesClonePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -99,7 +95,7 @@ func NewPcloudVolumesClonePostBadRequest() *PcloudVolumesClonePostBadRequest { return &PcloudVolumesClonePostBadRequest{} } -/*PcloudVolumesClonePostBadRequest handles this case with default header values. +/* PcloudVolumesClonePostBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -110,6 +106,9 @@ type PcloudVolumesClonePostBadRequest struct { func (o *PcloudVolumesClonePostBadRequest) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostBadRequest %+v", 400, o.Payload) } +func (o *PcloudVolumesClonePostBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVolumesClonePostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -128,7 +127,7 @@ func NewPcloudVolumesClonePostUnauthorized() *PcloudVolumesClonePostUnauthorized return &PcloudVolumesClonePostUnauthorized{} } -/*PcloudVolumesClonePostUnauthorized handles this case with default header values. +/* PcloudVolumesClonePostUnauthorized describes a response with status code 401, with default header values. Unauthorized */ @@ -139,6 +138,9 @@ type PcloudVolumesClonePostUnauthorized struct { func (o *PcloudVolumesClonePostUnauthorized) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostUnauthorized %+v", 401, o.Payload) } +func (o *PcloudVolumesClonePostUnauthorized) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVolumesClonePostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,7 +159,7 @@ func NewPcloudVolumesClonePostConflict() *PcloudVolumesClonePostConflict { return &PcloudVolumesClonePostConflict{} } -/*PcloudVolumesClonePostConflict handles this case with default header values. +/* PcloudVolumesClonePostConflict describes a response with status code 409, with default header values. Conflict */ @@ -168,6 +170,9 @@ type PcloudVolumesClonePostConflict struct { func (o *PcloudVolumesClonePostConflict) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostConflict %+v", 409, o.Payload) } +func (o *PcloudVolumesClonePostConflict) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVolumesClonePostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -186,7 +191,7 @@ func NewPcloudVolumesClonePostInternalServerError() *PcloudVolumesClonePostInter return &PcloudVolumesClonePostInternalServerError{} } -/*PcloudVolumesClonePostInternalServerError handles this case with default header values. +/* PcloudVolumesClonePostInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -197,6 +202,9 @@ type PcloudVolumesClonePostInternalServerError struct { func (o *PcloudVolumesClonePostInternalServerError) Error() string { return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostInternalServerError %+v", 500, o.Payload) } +func (o *PcloudVolumesClonePostInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *PcloudVolumesClonePostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go new file mode 100644 index 0000000000..749813a14c --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go @@ -0,0 +1,257 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/client/authentication" + "github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances" + "github.com/IBM-Cloud/power-go-client/power/client/catalog" + "github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms" + "github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker" + "github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions" + "github.com/IBM-Cloud/power-go-client/power/client/open_stacks" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes" + "github.com/IBM-Cloud/power-go-client/power/client/service_bindings" + "github.com/IBM-Cloud/power-go-client/power/client/service_instances" + "github.com/IBM-Cloud/power-go-client/power/client/storage_types" + "github.com/IBM-Cloud/power-go-client/power/client/swagger_spec" +) + +// Default power iaas API HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new power iaas API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *PowerIaasAPI { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new power iaas API HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PowerIaasAPI { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new power iaas API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasAPI { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(PowerIaasAPI) + cli.Transport = transport + cli.Authentication = authentication.New(transport, formats) + cli.BluemixServiceInstances = bluemix_service_instances.New(transport, formats) + cli.Catalog = catalog.New(transport, formats) + cli.HardwarePlatforms = hardware_platforms.New(transport, formats) + cli.IaasServiceBroker = iaas_service_broker.New(transport, formats) + cli.InternalStorageRegions = internal_storage_regions.New(transport, formats) + cli.OpenStacks = open_stacks.New(transport, formats) + cli.PCloudCloudConnections = p_cloud_cloud_connections.New(transport, formats) + cli.PCloudEvents = p_cloud_events.New(transport, formats) + cli.PCloudImages = p_cloud_images.New(transport, formats) + cli.PCloudInstances = p_cloud_instances.New(transport, formats) + cli.PCloudJobs = p_cloud_jobs.New(transport, formats) + cli.PCloudNetworks = p_cloud_networks.New(transport, formats) + cli.PCloudpVMInstances = p_cloud_p_vm_instances.New(transport, formats) + cli.PCloudPlacementGroups = p_cloud_placement_groups.New(transport, formats) + cli.PCloudsap = p_cloud_s_a_p.New(transport, formats) + cli.PCloudServicedhcp = p_cloud_service_d_h_c_p.New(transport, formats) + cli.PCloudSnapshots = p_cloud_snapshots.New(transport, formats) + cli.PCloudStorageCapacity = p_cloud_storage_capacity.New(transport, formats) + cli.PCloudSystemPools = p_cloud_system_pools.New(transport, formats) + cli.PCloudTasks = p_cloud_tasks.New(transport, formats) + cli.PCloudTenants = p_cloud_tenants.New(transport, formats) + cli.PCloudTenantsSSHKeys = p_cloud_tenants_ssh_keys.New(transport, formats) + cli.PCloudvpnConnections = p_cloud_v_p_n_connections.New(transport, formats) + cli.PCloudvpnPolicies = p_cloud_v_p_n_policies.New(transport, formats) + cli.PCloudVolumes = p_cloud_volumes.New(transport, formats) + cli.ServiceBindings = service_bindings.New(transport, formats) + cli.ServiceInstances = service_instances.New(transport, formats) + cli.StorageTypes = storage_types.New(transport, formats) + cli.SwaggerSpec = swagger_spec.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// PowerIaasAPI is a client for power iaas API +type PowerIaasAPI struct { + Authentication authentication.ClientService + + BluemixServiceInstances bluemix_service_instances.ClientService + + Catalog catalog.ClientService + + HardwarePlatforms hardware_platforms.ClientService + + IaasServiceBroker iaas_service_broker.ClientService + + InternalStorageRegions internal_storage_regions.ClientService + + OpenStacks open_stacks.ClientService + + PCloudCloudConnections p_cloud_cloud_connections.ClientService + + PCloudEvents p_cloud_events.ClientService + + PCloudImages p_cloud_images.ClientService + + PCloudInstances p_cloud_instances.ClientService + + PCloudJobs p_cloud_jobs.ClientService + + PCloudNetworks p_cloud_networks.ClientService + + PCloudpVMInstances p_cloud_p_vm_instances.ClientService + + PCloudPlacementGroups p_cloud_placement_groups.ClientService + + PCloudsap p_cloud_s_a_p.ClientService + + PCloudServicedhcp p_cloud_service_d_h_c_p.ClientService + + PCloudSnapshots p_cloud_snapshots.ClientService + + PCloudStorageCapacity p_cloud_storage_capacity.ClientService + + PCloudSystemPools p_cloud_system_pools.ClientService + + PCloudTasks p_cloud_tasks.ClientService + + PCloudTenants p_cloud_tenants.ClientService + + PCloudTenantsSSHKeys p_cloud_tenants_ssh_keys.ClientService + + PCloudvpnConnections p_cloud_v_p_n_connections.ClientService + + PCloudvpnPolicies p_cloud_v_p_n_policies.ClientService + + PCloudVolumes p_cloud_volumes.ClientService + + ServiceBindings service_bindings.ClientService + + ServiceInstances service_instances.ClientService + + StorageTypes storage_types.ClientService + + SwaggerSpec swagger_spec.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Authentication.SetTransport(transport) + c.BluemixServiceInstances.SetTransport(transport) + c.Catalog.SetTransport(transport) + c.HardwarePlatforms.SetTransport(transport) + c.IaasServiceBroker.SetTransport(transport) + c.InternalStorageRegions.SetTransport(transport) + c.OpenStacks.SetTransport(transport) + c.PCloudCloudConnections.SetTransport(transport) + c.PCloudEvents.SetTransport(transport) + c.PCloudImages.SetTransport(transport) + c.PCloudInstances.SetTransport(transport) + c.PCloudJobs.SetTransport(transport) + c.PCloudNetworks.SetTransport(transport) + c.PCloudpVMInstances.SetTransport(transport) + c.PCloudPlacementGroups.SetTransport(transport) + c.PCloudsap.SetTransport(transport) + c.PCloudServicedhcp.SetTransport(transport) + c.PCloudSnapshots.SetTransport(transport) + c.PCloudStorageCapacity.SetTransport(transport) + c.PCloudSystemPools.SetTransport(transport) + c.PCloudTasks.SetTransport(transport) + c.PCloudTenants.SetTransport(transport) + c.PCloudTenantsSSHKeys.SetTransport(transport) + c.PCloudvpnConnections.SetTransport(transport) + c.PCloudvpnPolicies.SetTransport(transport) + c.PCloudVolumes.SetTransport(transport) + c.ServiceBindings.SetTransport(transport) + c.ServiceInstances.SetTransport(transport) + c.StorageTypes.SetTransport(transport) + c.SwaggerSpec.SetTransport(transport) +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go deleted file mode 100644 index 0a98eb3106..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_client.go +++ /dev/null @@ -1,320 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/client/authentication" - "github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances" - "github.com/IBM-Cloud/power-go-client/power/client/catalog" - "github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms" - "github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker" - "github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions" - "github.com/IBM-Cloud/power-go-client/power/client/open_stacks" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes" - "github.com/IBM-Cloud/power-go-client/power/client/service_bindings" - "github.com/IBM-Cloud/power-go-client/power/client/service_instances" - "github.com/IBM-Cloud/power-go-client/power/client/storage_types" - "github.com/IBM-Cloud/power-go-client/power/client/swagger_spec" -) - -// Default power iaas HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new power iaas HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PowerIaas { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new power iaas HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PowerIaas { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new power iaas client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaas { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PowerIaas) - cli.Transport = transport - - cli.Authentication = authentication.New(transport, formats) - - cli.BluemixServiceInstances = bluemix_service_instances.New(transport, formats) - - cli.Catalog = catalog.New(transport, formats) - - cli.HardwarePlatforms = hardware_platforms.New(transport, formats) - - cli.IaasServiceBroker = iaas_service_broker.New(transport, formats) - - cli.InternalStorageRegions = internal_storage_regions.New(transport, formats) - - cli.OpenStacks = open_stacks.New(transport, formats) - - cli.PCloudCloudConnections = p_cloud_cloud_connections.New(transport, formats) - - cli.PCloudEvents = p_cloud_events.New(transport, formats) - - cli.PCloudImages = p_cloud_images.New(transport, formats) - - cli.PCloudInstances = p_cloud_instances.New(transport, formats) - - cli.PCloudJobs = p_cloud_jobs.New(transport, formats) - - cli.PCloudNetworks = p_cloud_networks.New(transport, formats) - - cli.PCloudPVMInstances = p_cloud_p_vm_instances.New(transport, formats) - - cli.PCloudPlacementGroups = p_cloud_placement_groups.New(transport, formats) - - cli.PCloudSAP = p_cloud_s_a_p.New(transport, formats) - - cli.PCloudServiceDHCP = p_cloud_service_d_h_c_p.New(transport, formats) - - cli.PCloudSnapshots = p_cloud_snapshots.New(transport, formats) - - cli.PCloudStorageCapacity = p_cloud_storage_capacity.New(transport, formats) - - cli.PCloudSystemPools = p_cloud_system_pools.New(transport, formats) - - cli.PCloudTasks = p_cloud_tasks.New(transport, formats) - - cli.PCloudTenants = p_cloud_tenants.New(transport, formats) - - cli.PCloudTenantsSSHKeys = p_cloud_tenants_ssh_keys.New(transport, formats) - - cli.PCloudVPNConnections = p_cloud_v_p_n_connections.New(transport, formats) - - cli.PCloudVPNPolicies = p_cloud_v_p_n_policies.New(transport, formats) - - cli.PCloudVolumes = p_cloud_volumes.New(transport, formats) - - cli.ServiceBindings = service_bindings.New(transport, formats) - - cli.ServiceInstances = service_instances.New(transport, formats) - - cli.StorageTypes = storage_types.New(transport, formats) - - cli.SwaggerSpec = swagger_spec.New(transport, formats) - - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// PowerIaas is a client for power iaas -type PowerIaas struct { - Authentication *authentication.Client - - BluemixServiceInstances *bluemix_service_instances.Client - - Catalog *catalog.Client - - HardwarePlatforms *hardware_platforms.Client - - IaasServiceBroker *iaas_service_broker.Client - - InternalStorageRegions *internal_storage_regions.Client - - OpenStacks *open_stacks.Client - - PCloudCloudConnections *p_cloud_cloud_connections.Client - - PCloudEvents *p_cloud_events.Client - - PCloudImages *p_cloud_images.Client - - PCloudInstances *p_cloud_instances.Client - - PCloudJobs *p_cloud_jobs.Client - - PCloudNetworks *p_cloud_networks.Client - - PCloudPVMInstances *p_cloud_p_vm_instances.Client - - PCloudPlacementGroups *p_cloud_placement_groups.Client - - PCloudSAP *p_cloud_s_a_p.Client - - PCloudServiceDHCP *p_cloud_service_d_h_c_p.Client - - PCloudSnapshots *p_cloud_snapshots.Client - - PCloudStorageCapacity *p_cloud_storage_capacity.Client - - PCloudSystemPools *p_cloud_system_pools.Client - - PCloudTasks *p_cloud_tasks.Client - - PCloudTenants *p_cloud_tenants.Client - - PCloudTenantsSSHKeys *p_cloud_tenants_ssh_keys.Client - - PCloudVPNConnections *p_cloud_v_p_n_connections.Client - - PCloudVPNPolicies *p_cloud_v_p_n_policies.Client - - PCloudVolumes *p_cloud_volumes.Client - - ServiceBindings *service_bindings.Client - - ServiceInstances *service_instances.Client - - StorageTypes *storage_types.Client - - SwaggerSpec *swagger_spec.Client - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PowerIaas) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - - c.Authentication.SetTransport(transport) - - c.BluemixServiceInstances.SetTransport(transport) - - c.Catalog.SetTransport(transport) - - c.HardwarePlatforms.SetTransport(transport) - - c.IaasServiceBroker.SetTransport(transport) - - c.InternalStorageRegions.SetTransport(transport) - - c.OpenStacks.SetTransport(transport) - - c.PCloudCloudConnections.SetTransport(transport) - - c.PCloudEvents.SetTransport(transport) - - c.PCloudImages.SetTransport(transport) - - c.PCloudInstances.SetTransport(transport) - - c.PCloudJobs.SetTransport(transport) - - c.PCloudNetworks.SetTransport(transport) - - c.PCloudPVMInstances.SetTransport(transport) - - c.PCloudPlacementGroups.SetTransport(transport) - - c.PCloudSAP.SetTransport(transport) - - c.PCloudServiceDHCP.SetTransport(transport) - - c.PCloudSnapshots.SetTransport(transport) - - c.PCloudStorageCapacity.SetTransport(transport) - - c.PCloudSystemPools.SetTransport(transport) - - c.PCloudTasks.SetTransport(transport) - - c.PCloudTenants.SetTransport(transport) - - c.PCloudTenantsSSHKeys.SetTransport(transport) - - c.PCloudVPNConnections.SetTransport(transport) - - c.PCloudVPNPolicies.SetTransport(transport) - - c.PCloudVolumes.SetTransport(transport) - - c.ServiceBindings.SetTransport(transport) - - c.ServiceInstances.SetTransport(transport) - - c.StorageTypes.SetTransport(transport) - - c.SwaggerSpec.SetTransport(transport) - -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_parameters.go index cb170e49b5..e2a1fc917c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_parameters.go @@ -13,85 +13,88 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewServiceBindingBindingParams creates a new ServiceBindingBindingParams object -// with the default values initialized. +// NewServiceBindingBindingParams creates a new ServiceBindingBindingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBindingBindingParams() *ServiceBindingBindingParams { - var () return &ServiceBindingBindingParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBindingBindingParamsWithTimeout creates a new ServiceBindingBindingParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBindingBindingParamsWithTimeout(timeout time.Duration) *ServiceBindingBindingParams { - var () return &ServiceBindingBindingParams{ - timeout: timeout, } } // NewServiceBindingBindingParamsWithContext creates a new ServiceBindingBindingParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBindingBindingParamsWithContext(ctx context.Context) *ServiceBindingBindingParams { - var () return &ServiceBindingBindingParams{ - Context: ctx, } } // NewServiceBindingBindingParamsWithHTTPClient creates a new ServiceBindingBindingParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBindingBindingParamsWithHTTPClient(client *http.Client) *ServiceBindingBindingParams { - var () return &ServiceBindingBindingParams{ HTTPClient: client, } } -/*ServiceBindingBindingParams contains all the parameters to send to the API endpoint -for the service binding binding operation typically these are written to a http.Request +/* ServiceBindingBindingParams contains all the parameters to send to the API endpoint + for the service binding binding operation. + + Typically these are written to a http.Request. */ type ServiceBindingBindingParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*AcceptsIncomplete - asynchronous operations supported + /* AcceptsIncomplete. + + asynchronous operations supported */ AcceptsIncomplete *bool - /*BindingID - binding id of binding to create + /* BindingID. + + binding id of binding to create */ BindingID string - /*Body - parameters for the requested service binding + /* Body. + + parameters for the requested service binding */ Body *models.ServiceBindingRequest - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string @@ -100,6 +103,21 @@ type ServiceBindingBindingParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service binding binding params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingBindingParams) WithDefaults() *ServiceBindingBindingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service binding binding params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingBindingParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service binding binding params func (o *ServiceBindingBindingParams) WithTimeout(timeout time.Duration) *ServiceBindingBindingParams { o.SetTimeout(timeout) @@ -213,7 +231,6 @@ func (o *ServiceBindingBindingParams) WriteToRequest(r runtime.ClientRequest, re if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version @@ -225,23 +242,23 @@ func (o *ServiceBindingBindingParams) WriteToRequest(r runtime.ClientRequest, re // query param accepts_incomplete var qrAcceptsIncomplete bool + if o.AcceptsIncomplete != nil { qrAcceptsIncomplete = *o.AcceptsIncomplete } qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) if qAcceptsIncomplete != "" { + if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { return err } } - } // path param binding_id if err := r.SetPathParam("binding_id", o.BindingID); err != nil { return err } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go index 8314fbf828..8d6a348a2c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBindingBindingReader is a Reader for the ServiceBindingBinding structure. @@ -24,51 +23,44 @@ type ServiceBindingBindingReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBindingBindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBindingBindingOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewServiceBindingBindingCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewServiceBindingBindingAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBindingBindingBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewServiceBindingBindingConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewServiceBindingBindingUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewServiceBindingBindingOK() *ServiceBindingBindingOK { return &ServiceBindingBindingOK{} } -/*ServiceBindingBindingOK handles this case with default header values. +/* ServiceBindingBindingOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type ServiceBindingBindingOK struct { func (o *ServiceBindingBindingOK) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingOK %+v", 200, o.Payload) } +func (o *ServiceBindingBindingOK) GetPayload() *models.ServiceBinding { + return o.Payload +} func (o *ServiceBindingBindingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewServiceBindingBindingCreated() *ServiceBindingBindingCreated { return &ServiceBindingBindingCreated{} } -/*ServiceBindingBindingCreated handles this case with default header values. +/* ServiceBindingBindingCreated describes a response with status code 201, with default header values. Created */ @@ -117,6 +112,9 @@ type ServiceBindingBindingCreated struct { func (o *ServiceBindingBindingCreated) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingCreated %+v", 201, o.Payload) } +func (o *ServiceBindingBindingCreated) GetPayload() *models.ServiceBinding { + return o.Payload +} func (o *ServiceBindingBindingCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewServiceBindingBindingAccepted() *ServiceBindingBindingAccepted { return &ServiceBindingBindingAccepted{} } -/*ServiceBindingBindingAccepted handles this case with default header values. +/* ServiceBindingBindingAccepted describes a response with status code 202, with default header values. Accepted */ @@ -146,6 +144,9 @@ type ServiceBindingBindingAccepted struct { func (o *ServiceBindingBindingAccepted) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingAccepted %+v", 202, o.Payload) } +func (o *ServiceBindingBindingAccepted) GetPayload() *models.AsyncOperation { + return o.Payload +} func (o *ServiceBindingBindingAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewServiceBindingBindingBadRequest() *ServiceBindingBindingBadRequest { return &ServiceBindingBindingBadRequest{} } -/*ServiceBindingBindingBadRequest handles this case with default header values. +/* ServiceBindingBindingBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -175,6 +176,9 @@ type ServiceBindingBindingBadRequest struct { func (o *ServiceBindingBindingBadRequest) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingBadRequest %+v", 400, o.Payload) } +func (o *ServiceBindingBindingBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingBindingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewServiceBindingBindingConflict() *ServiceBindingBindingConflict { return &ServiceBindingBindingConflict{} } -/*ServiceBindingBindingConflict handles this case with default header values. +/* ServiceBindingBindingConflict describes a response with status code 409, with default header values. Conflict */ @@ -204,6 +208,9 @@ type ServiceBindingBindingConflict struct { func (o *ServiceBindingBindingConflict) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingConflict %+v", 409, o.Payload) } +func (o *ServiceBindingBindingConflict) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingBindingConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewServiceBindingBindingUnprocessableEntity() *ServiceBindingBindingUnproce return &ServiceBindingBindingUnprocessableEntity{} } -/*ServiceBindingBindingUnprocessableEntity handles this case with default header values. +/* ServiceBindingBindingUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -233,6 +240,9 @@ type ServiceBindingBindingUnprocessableEntity struct { func (o *ServiceBindingBindingUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnprocessableEntity %+v", 422, o.Payload) } +func (o *ServiceBindingBindingUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingBindingUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_parameters.go index bc7ef77248..98450eb6c2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_parameters.go @@ -13,72 +13,73 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBindingGetParams creates a new ServiceBindingGetParams object -// with the default values initialized. +// NewServiceBindingGetParams creates a new ServiceBindingGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBindingGetParams() *ServiceBindingGetParams { - var () return &ServiceBindingGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBindingGetParamsWithTimeout creates a new ServiceBindingGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBindingGetParamsWithTimeout(timeout time.Duration) *ServiceBindingGetParams { - var () return &ServiceBindingGetParams{ - timeout: timeout, } } // NewServiceBindingGetParamsWithContext creates a new ServiceBindingGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBindingGetParamsWithContext(ctx context.Context) *ServiceBindingGetParams { - var () return &ServiceBindingGetParams{ - Context: ctx, } } // NewServiceBindingGetParamsWithHTTPClient creates a new ServiceBindingGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBindingGetParamsWithHTTPClient(client *http.Client) *ServiceBindingGetParams { - var () return &ServiceBindingGetParams{ HTTPClient: client, } } -/*ServiceBindingGetParams contains all the parameters to send to the API endpoint -for the service binding get operation typically these are written to a http.Request +/* ServiceBindingGetParams contains all the parameters to send to the API endpoint + for the service binding get operation. + + Typically these are written to a http.Request. */ type ServiceBindingGetParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*BindingID - binding id of binding to create + /* BindingID. + + binding id of binding to create */ BindingID string - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string @@ -87,6 +88,21 @@ type ServiceBindingGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service binding get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingGetParams) WithDefaults() *ServiceBindingGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service binding get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service binding get params func (o *ServiceBindingGetParams) WithTimeout(timeout time.Duration) *ServiceBindingGetParams { o.SetTimeout(timeout) @@ -178,7 +194,6 @@ func (o *ServiceBindingGetParams) WriteToRequest(r runtime.ClientRequest, reg st if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go index 61d138e25e..ba1f5d08de 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBindingGetReader is a Reader for the ServiceBindingGet structure. @@ -24,23 +23,20 @@ type ServiceBindingGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBindingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBindingGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 404: result := NewServiceBindingGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBindingGetOK() *ServiceBindingGetOK { return &ServiceBindingGetOK{} } -/*ServiceBindingGetOK handles this case with default header values. +/* ServiceBindingGetOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBindingGetOK struct { func (o *ServiceBindingGetOK) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK %+v", 200, o.Payload) } +func (o *ServiceBindingGetOK) GetPayload() *models.ServiceBindingResource { + return o.Payload +} func (o *ServiceBindingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceBindingGetNotFound() *ServiceBindingGetNotFound { return &ServiceBindingGetNotFound{} } -/*ServiceBindingGetNotFound handles this case with default header values. +/* ServiceBindingGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -89,6 +88,9 @@ type ServiceBindingGetNotFound struct { func (o *ServiceBindingGetNotFound) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound %+v", 404, o.Payload) } +func (o *ServiceBindingGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_parameters.go index 25bba75ced..20ee289c29 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_parameters.go @@ -13,82 +13,85 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBindingLastOperationGetParams creates a new ServiceBindingLastOperationGetParams object -// with the default values initialized. +// NewServiceBindingLastOperationGetParams creates a new ServiceBindingLastOperationGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBindingLastOperationGetParams() *ServiceBindingLastOperationGetParams { - var () return &ServiceBindingLastOperationGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBindingLastOperationGetParamsWithTimeout creates a new ServiceBindingLastOperationGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBindingLastOperationGetParamsWithTimeout(timeout time.Duration) *ServiceBindingLastOperationGetParams { - var () return &ServiceBindingLastOperationGetParams{ - timeout: timeout, } } // NewServiceBindingLastOperationGetParamsWithContext creates a new ServiceBindingLastOperationGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBindingLastOperationGetParamsWithContext(ctx context.Context) *ServiceBindingLastOperationGetParams { - var () return &ServiceBindingLastOperationGetParams{ - Context: ctx, } } // NewServiceBindingLastOperationGetParamsWithHTTPClient creates a new ServiceBindingLastOperationGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBindingLastOperationGetParamsWithHTTPClient(client *http.Client) *ServiceBindingLastOperationGetParams { - var () return &ServiceBindingLastOperationGetParams{ HTTPClient: client, } } -/*ServiceBindingLastOperationGetParams contains all the parameters to send to the API endpoint -for the service binding last operation get operation typically these are written to a http.Request +/* ServiceBindingLastOperationGetParams contains all the parameters to send to the API endpoint + for the service binding last operation get operation. + + Typically these are written to a http.Request. */ type ServiceBindingLastOperationGetParams struct { - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*BindingID - binding id of binding to create + /* BindingID. + + binding id of binding to create */ BindingID string - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string - /*Operation - a provided identifier for the operation + /* Operation. + + a provided identifier for the operation */ Operation *string - /*PlanID - id of the plan associated with the instance + /* PlanID. + + id of the plan associated with the instance */ PlanID *string - /*ServiceID - id of the service associated with the instance + /* ServiceID. + + id of the service associated with the instance */ ServiceID *string @@ -97,6 +100,21 @@ type ServiceBindingLastOperationGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service binding last operation get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingLastOperationGetParams) WithDefaults() *ServiceBindingLastOperationGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service binding last operation get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingLastOperationGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service binding last operation get params func (o *ServiceBindingLastOperationGetParams) WithTimeout(timeout time.Duration) *ServiceBindingLastOperationGetParams { o.SetTimeout(timeout) @@ -223,48 +241,51 @@ func (o *ServiceBindingLastOperationGetParams) WriteToRequest(r runtime.ClientRe // query param operation var qrOperation string + if o.Operation != nil { qrOperation = *o.Operation } qOperation := qrOperation if qOperation != "" { + if err := r.SetQueryParam("operation", qOperation); err != nil { return err } } - } if o.PlanID != nil { // query param plan_id var qrPlanID string + if o.PlanID != nil { qrPlanID = *o.PlanID } qPlanID := qrPlanID if qPlanID != "" { + if err := r.SetQueryParam("plan_id", qPlanID); err != nil { return err } } - } if o.ServiceID != nil { // query param service_id var qrServiceID string + if o.ServiceID != nil { qrServiceID = *o.ServiceID } qServiceID := qrServiceID if qServiceID != "" { + if err := r.SetQueryParam("service_id", qServiceID); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go index e71e8725dd..46779aad17 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBindingLastOperationGetReader is a Reader for the ServiceBindingLastOperationGet structure. @@ -24,30 +23,26 @@ type ServiceBindingLastOperationGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBindingLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBindingLastOperationGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBindingLastOperationGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewServiceBindingLastOperationGetGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceBindingLastOperationGetOK() *ServiceBindingLastOperationGetOK { return &ServiceBindingLastOperationGetOK{} } -/*ServiceBindingLastOperationGetOK handles this case with default header values. +/* ServiceBindingLastOperationGetOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceBindingLastOperationGetOK struct { func (o *ServiceBindingLastOperationGetOK) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetOK %+v", 200, o.Payload) } +func (o *ServiceBindingLastOperationGetOK) GetPayload() *models.LastOperationResource { + return o.Payload +} func (o *ServiceBindingLastOperationGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceBindingLastOperationGetBadRequest() *ServiceBindingLastOperationG return &ServiceBindingLastOperationGetBadRequest{} } -/*ServiceBindingLastOperationGetBadRequest handles this case with default header values. +/* ServiceBindingLastOperationGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -96,6 +94,9 @@ type ServiceBindingLastOperationGetBadRequest struct { func (o *ServiceBindingLastOperationGetBadRequest) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetBadRequest %+v", 400, o.Payload) } +func (o *ServiceBindingLastOperationGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingLastOperationGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceBindingLastOperationGetGone() *ServiceBindingLastOperationGetGone return &ServiceBindingLastOperationGetGone{} } -/*ServiceBindingLastOperationGetGone handles this case with default header values. +/* ServiceBindingLastOperationGetGone describes a response with status code 410, with default header values. Gone */ @@ -125,6 +126,9 @@ type ServiceBindingLastOperationGetGone struct { func (o *ServiceBindingLastOperationGetGone) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetGone %+v", 410, o.Payload) } +func (o *ServiceBindingLastOperationGetGone) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingLastOperationGetGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_parameters.go index 898dfe1b32..fb2dc202da 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_parameters.go @@ -13,88 +13,92 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewServiceBindingUnbindingParams creates a new ServiceBindingUnbindingParams object -// with the default values initialized. +// NewServiceBindingUnbindingParams creates a new ServiceBindingUnbindingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBindingUnbindingParams() *ServiceBindingUnbindingParams { - var () return &ServiceBindingUnbindingParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBindingUnbindingParamsWithTimeout creates a new ServiceBindingUnbindingParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBindingUnbindingParamsWithTimeout(timeout time.Duration) *ServiceBindingUnbindingParams { - var () return &ServiceBindingUnbindingParams{ - timeout: timeout, } } // NewServiceBindingUnbindingParamsWithContext creates a new ServiceBindingUnbindingParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBindingUnbindingParamsWithContext(ctx context.Context) *ServiceBindingUnbindingParams { - var () return &ServiceBindingUnbindingParams{ - Context: ctx, } } // NewServiceBindingUnbindingParamsWithHTTPClient creates a new ServiceBindingUnbindingParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBindingUnbindingParamsWithHTTPClient(client *http.Client) *ServiceBindingUnbindingParams { - var () return &ServiceBindingUnbindingParams{ HTTPClient: client, } } -/*ServiceBindingUnbindingParams contains all the parameters to send to the API endpoint -for the service binding unbinding operation typically these are written to a http.Request +/* ServiceBindingUnbindingParams contains all the parameters to send to the API endpoint + for the service binding unbinding operation. + + Typically these are written to a http.Request. */ type ServiceBindingUnbindingParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*AcceptsIncomplete - asynchronous operations supported + /* AcceptsIncomplete. + + asynchronous operations supported */ AcceptsIncomplete *bool - /*BindingID - binding id of binding to create + /* BindingID. + + binding id of binding to create */ BindingID string - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string - /*PlanID - id of the plan associated with the instance being deleted + /* PlanID. + + id of the plan associated with the instance being deleted */ PlanID string - /*ServiceID - id of the service associated with the instance being deleted + /* ServiceID. + + id of the service associated with the instance being deleted */ ServiceID string @@ -103,6 +107,21 @@ type ServiceBindingUnbindingParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service binding unbinding params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingUnbindingParams) WithDefaults() *ServiceBindingUnbindingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service binding unbinding params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBindingUnbindingParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service binding unbinding params func (o *ServiceBindingUnbindingParams) WithTimeout(timeout time.Duration) *ServiceBindingUnbindingParams { o.SetTimeout(timeout) @@ -227,7 +246,6 @@ func (o *ServiceBindingUnbindingParams) WriteToRequest(r runtime.ClientRequest, if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version @@ -239,16 +257,17 @@ func (o *ServiceBindingUnbindingParams) WriteToRequest(r runtime.ClientRequest, // query param accepts_incomplete var qrAcceptsIncomplete bool + if o.AcceptsIncomplete != nil { qrAcceptsIncomplete = *o.AcceptsIncomplete } qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) if qAcceptsIncomplete != "" { + if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { return err } } - } // path param binding_id @@ -265,6 +284,7 @@ func (o *ServiceBindingUnbindingParams) WriteToRequest(r runtime.ClientRequest, qrPlanID := o.PlanID qPlanID := qrPlanID if qPlanID != "" { + if err := r.SetQueryParam("plan_id", qPlanID); err != nil { return err } @@ -274,6 +294,7 @@ func (o *ServiceBindingUnbindingParams) WriteToRequest(r runtime.ClientRequest, qrServiceID := o.ServiceID qServiceID := qrServiceID if qServiceID != "" { + if err := r.SetQueryParam("service_id", qServiceID); err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go index f5ee2f943b..2416449a3f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBindingUnbindingReader is a Reader for the ServiceBindingUnbinding structure. @@ -24,37 +23,32 @@ type ServiceBindingUnbindingReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBindingUnbindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBindingUnbindingOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewServiceBindingUnbindingAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceBindingUnbindingBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewServiceBindingUnbindingGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewServiceBindingUnbindingOK() *ServiceBindingUnbindingOK { return &ServiceBindingUnbindingOK{} } -/*ServiceBindingUnbindingOK handles this case with default header values. +/* ServiceBindingUnbindingOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type ServiceBindingUnbindingOK struct { func (o *ServiceBindingUnbindingOK) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingOK %+v", 200, o.Payload) } +func (o *ServiceBindingUnbindingOK) GetPayload() models.Object { + return o.Payload +} func (o *ServiceBindingUnbindingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -90,7 +87,7 @@ func NewServiceBindingUnbindingAccepted() *ServiceBindingUnbindingAccepted { return &ServiceBindingUnbindingAccepted{} } -/*ServiceBindingUnbindingAccepted handles this case with default header values. +/* ServiceBindingUnbindingAccepted describes a response with status code 202, with default header values. Accepted */ @@ -101,6 +98,9 @@ type ServiceBindingUnbindingAccepted struct { func (o *ServiceBindingUnbindingAccepted) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingAccepted %+v", 202, o.Payload) } +func (o *ServiceBindingUnbindingAccepted) GetPayload() *models.AsyncOperation { + return o.Payload +} func (o *ServiceBindingUnbindingAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -119,7 +119,7 @@ func NewServiceBindingUnbindingBadRequest() *ServiceBindingUnbindingBadRequest { return &ServiceBindingUnbindingBadRequest{} } -/*ServiceBindingUnbindingBadRequest handles this case with default header values. +/* ServiceBindingUnbindingBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -130,6 +130,9 @@ type ServiceBindingUnbindingBadRequest struct { func (o *ServiceBindingUnbindingBadRequest) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingBadRequest %+v", 400, o.Payload) } +func (o *ServiceBindingUnbindingBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingUnbindingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -148,7 +151,7 @@ func NewServiceBindingUnbindingGone() *ServiceBindingUnbindingGone { return &ServiceBindingUnbindingGone{} } -/*ServiceBindingUnbindingGone handles this case with default header values. +/* ServiceBindingUnbindingGone describes a response with status code 410, with default header values. Gone */ @@ -159,6 +162,9 @@ type ServiceBindingUnbindingGone struct { func (o *ServiceBindingUnbindingGone) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingGone %+v", 410, o.Payload) } +func (o *ServiceBindingUnbindingGone) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBindingUnbindingGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go index f119decec1..554b058d83 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go @@ -6,13 +6,14 @@ package service_bindings // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new service bindings API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,31 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBindingBinding(params *ServiceBindingBindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingBindingOK, *ServiceBindingBindingCreated, *ServiceBindingBindingAccepted, error) + + ServiceBindingGet(params *ServiceBindingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingGetOK, error) + + ServiceBindingLastOperationGet(params *ServiceBindingLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingLastOperationGetOK, error) + + ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingUnbindingOK, *ServiceBindingUnbindingAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBindingBinding generations of a service binding + ServiceBindingBinding generations of a service binding */ -func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBindingBindingOK, *ServiceBindingBindingCreated, *ServiceBindingBindingAccepted, error) { +func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingBindingOK, *ServiceBindingBindingCreated, *ServiceBindingBindingAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBindingBindingParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBinding.binding", Method: "PUT", PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}", @@ -45,7 +61,12 @@ func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, auth AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } @@ -57,20 +78,20 @@ func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, auth case *ServiceBindingBindingAccepted: return nil, nil, value, nil } - return nil, nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for service_bindings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBindingGet gets a service binding + ServiceBindingGet gets a service binding */ -func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBindingGetOK, error) { +func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBindingGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBinding.get", Method: "GET", PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}", @@ -82,24 +103,34 @@ func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBindingGetOK), nil - + success, ok := result.(*ServiceBindingGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBinding.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBindingLastOperationGet lasts requested operation state for service binding + ServiceBindingLastOperationGet lasts requested operation state for service binding */ -func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBindingLastOperationGetOK, error) { +func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingLastOperationGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBindingLastOperationGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBinding.lastOperation.get", Method: "GET", PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation", @@ -111,24 +142,34 @@ func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperat AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBindingLastOperationGetOK), nil - + success, ok := result.(*ServiceBindingLastOperationGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBinding.lastOperation.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceBindingUnbinding deprovisions of a service binding + ServiceBindingUnbinding deprovisions of a service binding */ -func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceBindingUnbindingOK, *ServiceBindingUnbindingAccepted, error) { +func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingUnbindingOK, *ServiceBindingUnbindingAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBindingUnbindingParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBinding.unbinding", Method: "DELETE", PathPattern: "/v2/service_instances/{instance_id}/service_bindings/{binding_id}", @@ -140,7 +181,12 @@ func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -150,8 +196,9 @@ func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, case *ServiceBindingUnbindingAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for service_bindings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_parameters.go index f2efcedfc9..a9f8033ef7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_parameters.go @@ -13,83 +13,86 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" ) -// NewServiceInstanceDeprovisionParams creates a new ServiceInstanceDeprovisionParams object -// with the default values initialized. +// NewServiceInstanceDeprovisionParams creates a new ServiceInstanceDeprovisionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceInstanceDeprovisionParams() *ServiceInstanceDeprovisionParams { - var () return &ServiceInstanceDeprovisionParams{ - timeout: cr.DefaultTimeout, } } // NewServiceInstanceDeprovisionParamsWithTimeout creates a new ServiceInstanceDeprovisionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceInstanceDeprovisionParamsWithTimeout(timeout time.Duration) *ServiceInstanceDeprovisionParams { - var () return &ServiceInstanceDeprovisionParams{ - timeout: timeout, } } // NewServiceInstanceDeprovisionParamsWithContext creates a new ServiceInstanceDeprovisionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceInstanceDeprovisionParamsWithContext(ctx context.Context) *ServiceInstanceDeprovisionParams { - var () return &ServiceInstanceDeprovisionParams{ - Context: ctx, } } // NewServiceInstanceDeprovisionParamsWithHTTPClient creates a new ServiceInstanceDeprovisionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceInstanceDeprovisionParamsWithHTTPClient(client *http.Client) *ServiceInstanceDeprovisionParams { - var () return &ServiceInstanceDeprovisionParams{ HTTPClient: client, } } -/*ServiceInstanceDeprovisionParams contains all the parameters to send to the API endpoint -for the service instance deprovision operation typically these are written to a http.Request +/* ServiceInstanceDeprovisionParams contains all the parameters to send to the API endpoint + for the service instance deprovision operation. + + Typically these are written to a http.Request. */ type ServiceInstanceDeprovisionParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*AcceptsIncomplete - asynchronous operations supported + /* AcceptsIncomplete. + + asynchronous operations supported */ AcceptsIncomplete *bool - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string - /*PlanID - id of the plan associated with the instance being deleted + /* PlanID. + + id of the plan associated with the instance being deleted */ PlanID string - /*ServiceID - id of the service associated with the instance being deleted + /* ServiceID. + + id of the service associated with the instance being deleted */ ServiceID string @@ -98,6 +101,21 @@ type ServiceInstanceDeprovisionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service instance deprovision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceDeprovisionParams) WithDefaults() *ServiceInstanceDeprovisionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service instance deprovision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceDeprovisionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service instance deprovision params func (o *ServiceInstanceDeprovisionParams) WithTimeout(timeout time.Duration) *ServiceInstanceDeprovisionParams { o.SetTimeout(timeout) @@ -211,7 +229,6 @@ func (o *ServiceInstanceDeprovisionParams) WriteToRequest(r runtime.ClientReques if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version @@ -223,16 +240,17 @@ func (o *ServiceInstanceDeprovisionParams) WriteToRequest(r runtime.ClientReques // query param accepts_incomplete var qrAcceptsIncomplete bool + if o.AcceptsIncomplete != nil { qrAcceptsIncomplete = *o.AcceptsIncomplete } qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) if qAcceptsIncomplete != "" { + if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { return err } } - } // path param instance_id @@ -244,6 +262,7 @@ func (o *ServiceInstanceDeprovisionParams) WriteToRequest(r runtime.ClientReques qrPlanID := o.PlanID qPlanID := qrPlanID if qPlanID != "" { + if err := r.SetQueryParam("plan_id", qPlanID); err != nil { return err } @@ -253,6 +272,7 @@ func (o *ServiceInstanceDeprovisionParams) WriteToRequest(r runtime.ClientReques qrServiceID := o.ServiceID qServiceID := qrServiceID if qServiceID != "" { + if err := r.SetQueryParam("service_id", qServiceID); err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go index adfc8497af..1ae4ec9dac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceInstanceDeprovisionReader is a Reader for the ServiceInstanceDeprovision structure. @@ -24,44 +23,38 @@ type ServiceInstanceDeprovisionReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceInstanceDeprovisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceInstanceDeprovisionOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewServiceInstanceDeprovisionAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceInstanceDeprovisionBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewServiceInstanceDeprovisionGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewServiceInstanceDeprovisionUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -70,7 +63,7 @@ func NewServiceInstanceDeprovisionOK() *ServiceInstanceDeprovisionOK { return &ServiceInstanceDeprovisionOK{} } -/*ServiceInstanceDeprovisionOK handles this case with default header values. +/* ServiceInstanceDeprovisionOK describes a response with status code 200, with default header values. OK */ @@ -81,6 +74,9 @@ type ServiceInstanceDeprovisionOK struct { func (o *ServiceInstanceDeprovisionOK) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionOK %+v", 200, o.Payload) } +func (o *ServiceInstanceDeprovisionOK) GetPayload() models.Object { + return o.Payload +} func (o *ServiceInstanceDeprovisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -97,7 +93,7 @@ func NewServiceInstanceDeprovisionAccepted() *ServiceInstanceDeprovisionAccepted return &ServiceInstanceDeprovisionAccepted{} } -/*ServiceInstanceDeprovisionAccepted handles this case with default header values. +/* ServiceInstanceDeprovisionAccepted describes a response with status code 202, with default header values. Accepted */ @@ -108,6 +104,9 @@ type ServiceInstanceDeprovisionAccepted struct { func (o *ServiceInstanceDeprovisionAccepted) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionAccepted %+v", 202, o.Payload) } +func (o *ServiceInstanceDeprovisionAccepted) GetPayload() *models.AsyncOperation { + return o.Payload +} func (o *ServiceInstanceDeprovisionAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -126,7 +125,7 @@ func NewServiceInstanceDeprovisionBadRequest() *ServiceInstanceDeprovisionBadReq return &ServiceInstanceDeprovisionBadRequest{} } -/*ServiceInstanceDeprovisionBadRequest handles this case with default header values. +/* ServiceInstanceDeprovisionBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -137,6 +136,9 @@ type ServiceInstanceDeprovisionBadRequest struct { func (o *ServiceInstanceDeprovisionBadRequest) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionBadRequest %+v", 400, o.Payload) } +func (o *ServiceInstanceDeprovisionBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceDeprovisionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,7 +157,7 @@ func NewServiceInstanceDeprovisionGone() *ServiceInstanceDeprovisionGone { return &ServiceInstanceDeprovisionGone{} } -/*ServiceInstanceDeprovisionGone handles this case with default header values. +/* ServiceInstanceDeprovisionGone describes a response with status code 410, with default header values. Gone */ @@ -166,6 +168,9 @@ type ServiceInstanceDeprovisionGone struct { func (o *ServiceInstanceDeprovisionGone) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionGone %+v", 410, o.Payload) } +func (o *ServiceInstanceDeprovisionGone) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceDeprovisionGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -184,7 +189,7 @@ func NewServiceInstanceDeprovisionUnprocessableEntity() *ServiceInstanceDeprovis return &ServiceInstanceDeprovisionUnprocessableEntity{} } -/*ServiceInstanceDeprovisionUnprocessableEntity handles this case with default header values. +/* ServiceInstanceDeprovisionUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -195,6 +200,9 @@ type ServiceInstanceDeprovisionUnprocessableEntity struct { func (o *ServiceInstanceDeprovisionUnprocessableEntity) Error() string { return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnprocessableEntity %+v", 422, o.Payload) } +func (o *ServiceInstanceDeprovisionUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceDeprovisionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_parameters.go index b9a16cfc9f..c3594fe6d0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_parameters.go @@ -13,67 +13,67 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceInstanceGetParams creates a new ServiceInstanceGetParams object -// with the default values initialized. +// NewServiceInstanceGetParams creates a new ServiceInstanceGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceInstanceGetParams() *ServiceInstanceGetParams { - var () return &ServiceInstanceGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceInstanceGetParamsWithTimeout creates a new ServiceInstanceGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceInstanceGetParamsWithTimeout(timeout time.Duration) *ServiceInstanceGetParams { - var () return &ServiceInstanceGetParams{ - timeout: timeout, } } // NewServiceInstanceGetParamsWithContext creates a new ServiceInstanceGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceInstanceGetParamsWithContext(ctx context.Context) *ServiceInstanceGetParams { - var () return &ServiceInstanceGetParams{ - Context: ctx, } } // NewServiceInstanceGetParamsWithHTTPClient creates a new ServiceInstanceGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceInstanceGetParamsWithHTTPClient(client *http.Client) *ServiceInstanceGetParams { - var () return &ServiceInstanceGetParams{ HTTPClient: client, } } -/*ServiceInstanceGetParams contains all the parameters to send to the API endpoint -for the service instance get operation typically these are written to a http.Request +/* ServiceInstanceGetParams contains all the parameters to send to the API endpoint + for the service instance get operation. + + Typically these are written to a http.Request. */ type ServiceInstanceGetParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string @@ -82,6 +82,21 @@ type ServiceInstanceGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service instance get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceGetParams) WithDefaults() *ServiceInstanceGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service instance get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service instance get params func (o *ServiceInstanceGetParams) WithTimeout(timeout time.Duration) *ServiceInstanceGetParams { o.SetTimeout(timeout) @@ -162,7 +177,6 @@ func (o *ServiceInstanceGetParams) WriteToRequest(r runtime.ClientRequest, reg s if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go index 1bbb698951..94ecfeca2c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceInstanceGetReader is a Reader for the ServiceInstanceGet structure. @@ -24,23 +23,20 @@ type ServiceInstanceGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceInstanceGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 404: result := NewServiceInstanceGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceInstanceGetOK() *ServiceInstanceGetOK { return &ServiceInstanceGetOK{} } -/*ServiceInstanceGetOK handles this case with default header values. +/* ServiceInstanceGetOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceInstanceGetOK struct { func (o *ServiceInstanceGetOK) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetOK %+v", 200, o.Payload) } +func (o *ServiceInstanceGetOK) GetPayload() *models.ServiceInstanceResource { + return o.Payload +} func (o *ServiceInstanceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -78,7 +77,7 @@ func NewServiceInstanceGetNotFound() *ServiceInstanceGetNotFound { return &ServiceInstanceGetNotFound{} } -/*ServiceInstanceGetNotFound handles this case with default header values. +/* ServiceInstanceGetNotFound describes a response with status code 404, with default header values. Not Found */ @@ -89,6 +88,9 @@ type ServiceInstanceGetNotFound struct { func (o *ServiceInstanceGetNotFound) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetNotFound %+v", 404, o.Payload) } +func (o *ServiceInstanceGetNotFound) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_parameters.go index c6d90363ce..8c735cce5e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_parameters.go @@ -13,77 +13,79 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceInstanceLastOperationGetParams creates a new ServiceInstanceLastOperationGetParams object -// with the default values initialized. +// NewServiceInstanceLastOperationGetParams creates a new ServiceInstanceLastOperationGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceInstanceLastOperationGetParams() *ServiceInstanceLastOperationGetParams { - var () return &ServiceInstanceLastOperationGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceInstanceLastOperationGetParamsWithTimeout creates a new ServiceInstanceLastOperationGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceInstanceLastOperationGetParamsWithTimeout(timeout time.Duration) *ServiceInstanceLastOperationGetParams { - var () return &ServiceInstanceLastOperationGetParams{ - timeout: timeout, } } // NewServiceInstanceLastOperationGetParamsWithContext creates a new ServiceInstanceLastOperationGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceInstanceLastOperationGetParamsWithContext(ctx context.Context) *ServiceInstanceLastOperationGetParams { - var () return &ServiceInstanceLastOperationGetParams{ - Context: ctx, } } // NewServiceInstanceLastOperationGetParamsWithHTTPClient creates a new ServiceInstanceLastOperationGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceInstanceLastOperationGetParamsWithHTTPClient(client *http.Client) *ServiceInstanceLastOperationGetParams { - var () return &ServiceInstanceLastOperationGetParams{ HTTPClient: client, } } -/*ServiceInstanceLastOperationGetParams contains all the parameters to send to the API endpoint -for the service instance last operation get operation typically these are written to a http.Request +/* ServiceInstanceLastOperationGetParams contains all the parameters to send to the API endpoint + for the service instance last operation get operation. + + Typically these are written to a http.Request. */ type ServiceInstanceLastOperationGetParams struct { - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string - /*Operation - a provided identifier for the operation + /* Operation. + + a provided identifier for the operation */ Operation *string - /*PlanID - id of the plan associated with the instance + /* PlanID. + + id of the plan associated with the instance */ PlanID *string - /*ServiceID - id of the service associated with the instance + /* ServiceID. + + id of the service associated with the instance */ ServiceID *string @@ -92,6 +94,21 @@ type ServiceInstanceLastOperationGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service instance last operation get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceLastOperationGetParams) WithDefaults() *ServiceInstanceLastOperationGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service instance last operation get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceLastOperationGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service instance last operation get params func (o *ServiceInstanceLastOperationGetParams) WithTimeout(timeout time.Duration) *ServiceInstanceLastOperationGetParams { o.SetTimeout(timeout) @@ -202,48 +219,51 @@ func (o *ServiceInstanceLastOperationGetParams) WriteToRequest(r runtime.ClientR // query param operation var qrOperation string + if o.Operation != nil { qrOperation = *o.Operation } qOperation := qrOperation if qOperation != "" { + if err := r.SetQueryParam("operation", qOperation); err != nil { return err } } - } if o.PlanID != nil { // query param plan_id var qrPlanID string + if o.PlanID != nil { qrPlanID = *o.PlanID } qPlanID := qrPlanID if qPlanID != "" { + if err := r.SetQueryParam("plan_id", qPlanID); err != nil { return err } } - } if o.ServiceID != nil { // query param service_id var qrServiceID string + if o.ServiceID != nil { qrServiceID = *o.ServiceID } qServiceID := qrServiceID if qServiceID != "" { + if err := r.SetQueryParam("service_id", qServiceID); err != nil { return err } } - } if len(res) > 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go index 30123e356c..10e635bfcd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceInstanceLastOperationGetReader is a Reader for the ServiceInstanceLastOperationGet structure. @@ -24,30 +23,26 @@ type ServiceInstanceLastOperationGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceInstanceLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceInstanceLastOperationGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceInstanceLastOperationGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 410: result := NewServiceInstanceLastOperationGetGone() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -56,7 +51,7 @@ func NewServiceInstanceLastOperationGetOK() *ServiceInstanceLastOperationGetOK { return &ServiceInstanceLastOperationGetOK{} } -/*ServiceInstanceLastOperationGetOK handles this case with default header values. +/* ServiceInstanceLastOperationGetOK describes a response with status code 200, with default header values. OK */ @@ -67,6 +62,9 @@ type ServiceInstanceLastOperationGetOK struct { func (o *ServiceInstanceLastOperationGetOK) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetOK %+v", 200, o.Payload) } +func (o *ServiceInstanceLastOperationGetOK) GetPayload() *models.LastOperationResource { + return o.Payload +} func (o *ServiceInstanceLastOperationGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -85,7 +83,7 @@ func NewServiceInstanceLastOperationGetBadRequest() *ServiceInstanceLastOperatio return &ServiceInstanceLastOperationGetBadRequest{} } -/*ServiceInstanceLastOperationGetBadRequest handles this case with default header values. +/* ServiceInstanceLastOperationGetBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -96,6 +94,9 @@ type ServiceInstanceLastOperationGetBadRequest struct { func (o *ServiceInstanceLastOperationGetBadRequest) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetBadRequest %+v", 400, o.Payload) } +func (o *ServiceInstanceLastOperationGetBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceLastOperationGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -114,7 +115,7 @@ func NewServiceInstanceLastOperationGetGone() *ServiceInstanceLastOperationGetGo return &ServiceInstanceLastOperationGetGone{} } -/*ServiceInstanceLastOperationGetGone handles this case with default header values. +/* ServiceInstanceLastOperationGetGone describes a response with status code 410, with default header values. Gone */ @@ -125,6 +126,9 @@ type ServiceInstanceLastOperationGetGone struct { func (o *ServiceInstanceLastOperationGetGone) Error() string { return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetGone %+v", 410, o.Payload) } +func (o *ServiceInstanceLastOperationGetGone) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceLastOperationGetGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_parameters.go index 178a80e54c..89458c04fc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_parameters.go @@ -13,80 +13,82 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewServiceInstanceProvisionParams creates a new ServiceInstanceProvisionParams object -// with the default values initialized. +// NewServiceInstanceProvisionParams creates a new ServiceInstanceProvisionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceInstanceProvisionParams() *ServiceInstanceProvisionParams { - var () return &ServiceInstanceProvisionParams{ - timeout: cr.DefaultTimeout, } } // NewServiceInstanceProvisionParamsWithTimeout creates a new ServiceInstanceProvisionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceInstanceProvisionParamsWithTimeout(timeout time.Duration) *ServiceInstanceProvisionParams { - var () return &ServiceInstanceProvisionParams{ - timeout: timeout, } } // NewServiceInstanceProvisionParamsWithContext creates a new ServiceInstanceProvisionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceInstanceProvisionParamsWithContext(ctx context.Context) *ServiceInstanceProvisionParams { - var () return &ServiceInstanceProvisionParams{ - Context: ctx, } } // NewServiceInstanceProvisionParamsWithHTTPClient creates a new ServiceInstanceProvisionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceInstanceProvisionParamsWithHTTPClient(client *http.Client) *ServiceInstanceProvisionParams { - var () return &ServiceInstanceProvisionParams{ HTTPClient: client, } } -/*ServiceInstanceProvisionParams contains all the parameters to send to the API endpoint -for the service instance provision operation typically these are written to a http.Request +/* ServiceInstanceProvisionParams contains all the parameters to send to the API endpoint + for the service instance provision operation. + + Typically these are written to a http.Request. */ type ServiceInstanceProvisionParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*AcceptsIncomplete - asynchronous operations supported + /* AcceptsIncomplete. + + asynchronous operations supported */ AcceptsIncomplete *bool - /*Body - parameters for the requested service instance provision + /* Body. + + parameters for the requested service instance provision */ Body *models.ServiceInstanceProvisionRequest - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string @@ -95,6 +97,21 @@ type ServiceInstanceProvisionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service instance provision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceProvisionParams) WithDefaults() *ServiceInstanceProvisionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service instance provision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceProvisionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service instance provision params func (o *ServiceInstanceProvisionParams) WithTimeout(timeout time.Duration) *ServiceInstanceProvisionParams { o.SetTimeout(timeout) @@ -197,7 +214,6 @@ func (o *ServiceInstanceProvisionParams) WriteToRequest(r runtime.ClientRequest, if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version @@ -209,18 +225,18 @@ func (o *ServiceInstanceProvisionParams) WriteToRequest(r runtime.ClientRequest, // query param accepts_incomplete var qrAcceptsIncomplete bool + if o.AcceptsIncomplete != nil { qrAcceptsIncomplete = *o.AcceptsIncomplete } qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) if qAcceptsIncomplete != "" { + if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go index 4f29ccbc75..1b457b956a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceInstanceProvisionReader is a Reader for the ServiceInstanceProvision structure. @@ -24,51 +23,44 @@ type ServiceInstanceProvisionReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceInstanceProvisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceInstanceProvisionOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 201: result := NewServiceInstanceProvisionCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewServiceInstanceProvisionAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceInstanceProvisionBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 409: result := NewServiceInstanceProvisionConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewServiceInstanceProvisionUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -77,7 +69,7 @@ func NewServiceInstanceProvisionOK() *ServiceInstanceProvisionOK { return &ServiceInstanceProvisionOK{} } -/*ServiceInstanceProvisionOK handles this case with default header values. +/* ServiceInstanceProvisionOK describes a response with status code 200, with default header values. OK */ @@ -88,6 +80,9 @@ type ServiceInstanceProvisionOK struct { func (o *ServiceInstanceProvisionOK) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionOK %+v", 200, o.Payload) } +func (o *ServiceInstanceProvisionOK) GetPayload() *models.ServiceInstanceProvision { + return o.Payload +} func (o *ServiceInstanceProvisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -106,7 +101,7 @@ func NewServiceInstanceProvisionCreated() *ServiceInstanceProvisionCreated { return &ServiceInstanceProvisionCreated{} } -/*ServiceInstanceProvisionCreated handles this case with default header values. +/* ServiceInstanceProvisionCreated describes a response with status code 201, with default header values. Created */ @@ -117,6 +112,9 @@ type ServiceInstanceProvisionCreated struct { func (o *ServiceInstanceProvisionCreated) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionCreated %+v", 201, o.Payload) } +func (o *ServiceInstanceProvisionCreated) GetPayload() *models.ServiceInstanceProvision { + return o.Payload +} func (o *ServiceInstanceProvisionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -135,7 +133,7 @@ func NewServiceInstanceProvisionAccepted() *ServiceInstanceProvisionAccepted { return &ServiceInstanceProvisionAccepted{} } -/*ServiceInstanceProvisionAccepted handles this case with default header values. +/* ServiceInstanceProvisionAccepted describes a response with status code 202, with default header values. Accepted */ @@ -146,6 +144,9 @@ type ServiceInstanceProvisionAccepted struct { func (o *ServiceInstanceProvisionAccepted) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionAccepted %+v", 202, o.Payload) } +func (o *ServiceInstanceProvisionAccepted) GetPayload() *models.ServiceInstanceAsyncOperation { + return o.Payload +} func (o *ServiceInstanceProvisionAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -164,7 +165,7 @@ func NewServiceInstanceProvisionBadRequest() *ServiceInstanceProvisionBadRequest return &ServiceInstanceProvisionBadRequest{} } -/*ServiceInstanceProvisionBadRequest handles this case with default header values. +/* ServiceInstanceProvisionBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -175,6 +176,9 @@ type ServiceInstanceProvisionBadRequest struct { func (o *ServiceInstanceProvisionBadRequest) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionBadRequest %+v", 400, o.Payload) } +func (o *ServiceInstanceProvisionBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceProvisionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -193,7 +197,7 @@ func NewServiceInstanceProvisionConflict() *ServiceInstanceProvisionConflict { return &ServiceInstanceProvisionConflict{} } -/*ServiceInstanceProvisionConflict handles this case with default header values. +/* ServiceInstanceProvisionConflict describes a response with status code 409, with default header values. Conflict */ @@ -204,6 +208,9 @@ type ServiceInstanceProvisionConflict struct { func (o *ServiceInstanceProvisionConflict) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionConflict %+v", 409, o.Payload) } +func (o *ServiceInstanceProvisionConflict) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceProvisionConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,7 +229,7 @@ func NewServiceInstanceProvisionUnprocessableEntity() *ServiceInstanceProvisionU return &ServiceInstanceProvisionUnprocessableEntity{} } -/*ServiceInstanceProvisionUnprocessableEntity handles this case with default header values. +/* ServiceInstanceProvisionUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity */ @@ -233,6 +240,9 @@ type ServiceInstanceProvisionUnprocessableEntity struct { func (o *ServiceInstanceProvisionUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnprocessableEntity %+v", 422, o.Payload) } +func (o *ServiceInstanceProvisionUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceProvisionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_parameters.go index 52a6ad67f5..0e27172b21 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_parameters.go @@ -13,80 +13,82 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) -// NewServiceInstanceUpdateParams creates a new ServiceInstanceUpdateParams object -// with the default values initialized. +// NewServiceInstanceUpdateParams creates a new ServiceInstanceUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceInstanceUpdateParams() *ServiceInstanceUpdateParams { - var () return &ServiceInstanceUpdateParams{ - timeout: cr.DefaultTimeout, } } // NewServiceInstanceUpdateParamsWithTimeout creates a new ServiceInstanceUpdateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceInstanceUpdateParamsWithTimeout(timeout time.Duration) *ServiceInstanceUpdateParams { - var () return &ServiceInstanceUpdateParams{ - timeout: timeout, } } // NewServiceInstanceUpdateParamsWithContext creates a new ServiceInstanceUpdateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceInstanceUpdateParamsWithContext(ctx context.Context) *ServiceInstanceUpdateParams { - var () return &ServiceInstanceUpdateParams{ - Context: ctx, } } // NewServiceInstanceUpdateParamsWithHTTPClient creates a new ServiceInstanceUpdateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceInstanceUpdateParamsWithHTTPClient(client *http.Client) *ServiceInstanceUpdateParams { - var () return &ServiceInstanceUpdateParams{ HTTPClient: client, } } -/*ServiceInstanceUpdateParams contains all the parameters to send to the API endpoint -for the service instance update operation typically these are written to a http.Request +/* ServiceInstanceUpdateParams contains all the parameters to send to the API endpoint + for the service instance update operation. + + Typically these are written to a http.Request. */ type ServiceInstanceUpdateParams struct { - /*XBrokerAPIOriginatingIdentity - identity of the user that initiated the request from the Platform + /* XBrokerAPIOriginatingIdentity. + identity of the user that initiated the request from the Platform */ XBrokerAPIOriginatingIdentity *string - /*XBrokerAPIVersion - version number of the Service Broker API that the Platform will use + /* XBrokerAPIVersion. + + version number of the Service Broker API that the Platform will use */ XBrokerAPIVersion string - /*AcceptsIncomplete - asynchronous operations supported + /* AcceptsIncomplete. + + asynchronous operations supported */ AcceptsIncomplete *bool - /*Body - parameters for the requested service instance update + /* Body. + + parameters for the requested service instance update */ Body *models.ServiceInstanceUpdateRequest - /*InstanceID - instance id of instance to provision + /* InstanceID. + + instance id of instance to provision */ InstanceID string @@ -95,6 +97,21 @@ type ServiceInstanceUpdateParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service instance update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceUpdateParams) WithDefaults() *ServiceInstanceUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service instance update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceInstanceUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service instance update params func (o *ServiceInstanceUpdateParams) WithTimeout(timeout time.Duration) *ServiceInstanceUpdateParams { o.SetTimeout(timeout) @@ -197,7 +214,6 @@ func (o *ServiceInstanceUpdateParams) WriteToRequest(r runtime.ClientRequest, re if err := r.SetHeaderParam("X-Broker-API-Originating-Identity", *o.XBrokerAPIOriginatingIdentity); err != nil { return err } - } // header param X-Broker-API-Version @@ -209,18 +225,18 @@ func (o *ServiceInstanceUpdateParams) WriteToRequest(r runtime.ClientRequest, re // query param accepts_incomplete var qrAcceptsIncomplete bool + if o.AcceptsIncomplete != nil { qrAcceptsIncomplete = *o.AcceptsIncomplete } qAcceptsIncomplete := swag.FormatBool(qrAcceptsIncomplete) if qAcceptsIncomplete != "" { + if err := r.SetQueryParam("accepts_incomplete", qAcceptsIncomplete); err != nil { return err } } - } - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go index 5780f59203..b86564971b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceInstanceUpdateReader is a Reader for the ServiceInstanceUpdate structure. @@ -24,37 +23,32 @@ type ServiceInstanceUpdateReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceInstanceUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceInstanceUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 202: result := NewServiceInstanceUpdateAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 400: result := NewServiceInstanceUpdateBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 422: result := NewServiceInstanceUpdateUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -63,7 +57,7 @@ func NewServiceInstanceUpdateOK() *ServiceInstanceUpdateOK { return &ServiceInstanceUpdateOK{} } -/*ServiceInstanceUpdateOK handles this case with default header values. +/* ServiceInstanceUpdateOK describes a response with status code 200, with default header values. OK */ @@ -74,6 +68,9 @@ type ServiceInstanceUpdateOK struct { func (o *ServiceInstanceUpdateOK) Error() string { return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateOK %+v", 200, o.Payload) } +func (o *ServiceInstanceUpdateOK) GetPayload() models.Object { + return o.Payload +} func (o *ServiceInstanceUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -90,7 +87,7 @@ func NewServiceInstanceUpdateAccepted() *ServiceInstanceUpdateAccepted { return &ServiceInstanceUpdateAccepted{} } -/*ServiceInstanceUpdateAccepted handles this case with default header values. +/* ServiceInstanceUpdateAccepted describes a response with status code 202, with default header values. Accepted */ @@ -101,6 +98,9 @@ type ServiceInstanceUpdateAccepted struct { func (o *ServiceInstanceUpdateAccepted) Error() string { return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateAccepted %+v", 202, o.Payload) } +func (o *ServiceInstanceUpdateAccepted) GetPayload() *models.ServiceInstanceAsyncOperation { + return o.Payload +} func (o *ServiceInstanceUpdateAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -119,7 +119,7 @@ func NewServiceInstanceUpdateBadRequest() *ServiceInstanceUpdateBadRequest { return &ServiceInstanceUpdateBadRequest{} } -/*ServiceInstanceUpdateBadRequest handles this case with default header values. +/* ServiceInstanceUpdateBadRequest describes a response with status code 400, with default header values. Bad Request */ @@ -130,6 +130,9 @@ type ServiceInstanceUpdateBadRequest struct { func (o *ServiceInstanceUpdateBadRequest) Error() string { return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateBadRequest %+v", 400, o.Payload) } +func (o *ServiceInstanceUpdateBadRequest) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceUpdateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -148,7 +151,7 @@ func NewServiceInstanceUpdateUnprocessableEntity() *ServiceInstanceUpdateUnproce return &ServiceInstanceUpdateUnprocessableEntity{} } -/*ServiceInstanceUpdateUnprocessableEntity handles this case with default header values. +/* ServiceInstanceUpdateUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable entity */ @@ -159,6 +162,9 @@ type ServiceInstanceUpdateUnprocessableEntity struct { func (o *ServiceInstanceUpdateUnprocessableEntity) Error() string { return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnprocessableEntity %+v", 422, o.Payload) } +func (o *ServiceInstanceUpdateUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceInstanceUpdateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go index 27b7469e25..13b07b1689 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go @@ -6,13 +6,14 @@ package service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new service instances API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,33 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceDeprovisionOK, *ServiceInstanceDeprovisionAccepted, error) + + ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceGetOK, error) + + ServiceInstanceLastOperationGet(params *ServiceInstanceLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceLastOperationGetOK, error) + + ServiceInstanceProvision(params *ServiceInstanceProvisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceProvisionOK, *ServiceInstanceProvisionCreated, *ServiceInstanceProvisionAccepted, error) + + ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceUpdateOK, *ServiceInstanceUpdateAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceInstanceDeprovision deprovisions a service instance + ServiceInstanceDeprovision deprovisions a service instance */ -func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceInstanceDeprovisionOK, *ServiceInstanceDeprovisionAccepted, error) { +func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceDeprovisionOK, *ServiceInstanceDeprovisionAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceInstanceDeprovisionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceInstance.deprovision", Method: "DELETE", PathPattern: "/v2/service_instances/{instance_id}", @@ -45,7 +63,12 @@ func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionPa AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -55,20 +78,20 @@ func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionPa case *ServiceInstanceDeprovisionAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceInstanceGet gets a service instance + ServiceInstanceGet gets a service instance */ -func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceInstanceGetOK, error) { +func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceInstanceGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceInstance.get", Method: "GET", PathPattern: "/v2/service_instances/{instance_id}", @@ -80,24 +103,34 @@ func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo r AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceInstanceGetOK), nil - + success, ok := result.(*ServiceInstanceGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceInstance.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceInstanceLastOperationGet lasts requested operation state for service instance + ServiceInstanceLastOperationGet lasts requested operation state for service instance */ -func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceInstanceLastOperationGetOK, error) { +func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceLastOperationGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceInstanceLastOperationGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceInstance.lastOperation.get", Method: "GET", PathPattern: "/v2/service_instances/{instance_id}/last_operation", @@ -109,24 +142,34 @@ func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOper AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceInstanceLastOperationGetOK), nil - + success, ok := result.(*ServiceInstanceLastOperationGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceInstance.lastOperation.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceInstanceProvision provisions a service instance + ServiceInstanceProvision provisions a service instance */ -func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceInstanceProvisionOK, *ServiceInstanceProvisionCreated, *ServiceInstanceProvisionAccepted, error) { +func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceProvisionOK, *ServiceInstanceProvisionCreated, *ServiceInstanceProvisionAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceInstanceProvisionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceInstance.provision", Method: "PUT", PathPattern: "/v2/service_instances/{instance_id}", @@ -138,7 +181,12 @@ func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } @@ -150,20 +198,20 @@ func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams case *ServiceInstanceProvisionAccepted: return nil, nil, value, nil } - return nil, nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* -ServiceInstanceUpdate updates a service instance + ServiceInstanceUpdate updates a service instance */ -func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ServiceInstanceUpdateOK, *ServiceInstanceUpdateAccepted, error) { +func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceUpdateOK, *ServiceInstanceUpdateAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceInstanceUpdateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceInstance.update", Method: "PATCH", PathPattern: "/v2/service_instances/{instance_id}", @@ -175,7 +223,12 @@ func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, auth AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } @@ -185,8 +238,9 @@ func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, auth case *ServiceInstanceUpdateAccepted: return nil, value, nil } - return nil, nil, nil - + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_parameters.go index 7567d13564..932bb7a0e9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerStoragetypesGetParams creates a new ServiceBrokerStoragetypesGetParams object -// with the default values initialized. +// NewServiceBrokerStoragetypesGetParams creates a new ServiceBrokerStoragetypesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerStoragetypesGetParams() *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerStoragetypesGetParamsWithTimeout creates a new ServiceBrokerStoragetypesGetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerStoragetypesGetParamsWithTimeout(timeout time.Duration) *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - timeout: timeout, } } // NewServiceBrokerStoragetypesGetParamsWithContext creates a new ServiceBrokerStoragetypesGetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerStoragetypesGetParamsWithContext(ctx context.Context) *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ - Context: ctx, } } // NewServiceBrokerStoragetypesGetParamsWithHTTPClient creates a new ServiceBrokerStoragetypesGetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerStoragetypesGetParamsWithHTTPClient(client *http.Client) *ServiceBrokerStoragetypesGetParams { - return &ServiceBrokerStoragetypesGetParams{ HTTPClient: client, } } -/*ServiceBrokerStoragetypesGetParams contains all the parameters to send to the API endpoint -for the service broker storagetypes get operation typically these are written to a http.Request +/* ServiceBrokerStoragetypesGetParams contains all the parameters to send to the API endpoint + for the service broker storagetypes get operation. + + Typically these are written to a http.Request. */ type ServiceBrokerStoragetypesGetParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerStoragetypesGetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker storagetypes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerStoragetypesGetParams) WithDefaults() *ServiceBrokerStoragetypesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker storagetypes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerStoragetypesGetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker storagetypes get params func (o *ServiceBrokerStoragetypesGetParams) WithTimeout(timeout time.Duration) *ServiceBrokerStoragetypesGetParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go index 9ed46be1de..30d420dd82 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerStoragetypesGetReader is a Reader for the ServiceBrokerStoragetypesGet structure. @@ -24,23 +23,20 @@ type ServiceBrokerStoragetypesGetReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerStoragetypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerStoragetypesGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - case 500: result := NewServiceBrokerStoragetypesGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -49,7 +45,7 @@ func NewServiceBrokerStoragetypesGetOK() *ServiceBrokerStoragetypesGetOK { return &ServiceBrokerStoragetypesGetOK{} } -/*ServiceBrokerStoragetypesGetOK handles this case with default header values. +/* ServiceBrokerStoragetypesGetOK describes a response with status code 200, with default header values. OK */ @@ -60,6 +56,9 @@ type ServiceBrokerStoragetypesGetOK struct { func (o *ServiceBrokerStoragetypesGetOK) Error() string { return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %+v", 200, o.Payload) } +func (o *ServiceBrokerStoragetypesGetOK) GetPayload() models.StorageTypes { + return o.Payload +} func (o *ServiceBrokerStoragetypesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -76,7 +75,7 @@ func NewServiceBrokerStoragetypesGetInternalServerError() *ServiceBrokerStoraget return &ServiceBrokerStoragetypesGetInternalServerError{} } -/*ServiceBrokerStoragetypesGetInternalServerError handles this case with default header values. +/* ServiceBrokerStoragetypesGetInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ @@ -87,6 +86,9 @@ type ServiceBrokerStoragetypesGetInternalServerError struct { func (o *ServiceBrokerStoragetypesGetInternalServerError) Error() string { return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %+v", 500, o.Payload) } +func (o *ServiceBrokerStoragetypesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} func (o *ServiceBrokerStoragetypesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go index 5359c424c9..5adc4f1ed4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go @@ -6,13 +6,14 @@ package storage_types // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new storage types API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,25 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesGetParams, opts ...ClientOption) (*ServiceBrokerStoragetypesGetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBrokerStoragetypesGet availables storage types in a region + ServiceBrokerStoragetypesGet availables storage types in a region */ -func (a *Client) ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesGetParams) (*ServiceBrokerStoragetypesGetOK, error) { +func (a *Client) ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesGetParams, opts ...ClientOption) (*ServiceBrokerStoragetypesGetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerStoragetypesGetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.storagetypes.get", Method: "GET", PathPattern: "/broker/v1/storage-types", @@ -44,12 +54,23 @@ func (a *Client) ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesG Reader: &ServiceBrokerStoragetypesGetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerStoragetypesGetOK), nil - + success, ok := result.(*ServiceBrokerStoragetypesGetOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.storagetypes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_parameters.go index e57a82db7d..12c76c9d80 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_parameters.go @@ -13,51 +13,49 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) -// NewServiceBrokerSwaggerspecParams creates a new ServiceBrokerSwaggerspecParams object -// with the default values initialized. +// NewServiceBrokerSwaggerspecParams creates a new ServiceBrokerSwaggerspecParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewServiceBrokerSwaggerspecParams() *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - timeout: cr.DefaultTimeout, } } // NewServiceBrokerSwaggerspecParamsWithTimeout creates a new ServiceBrokerSwaggerspecParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewServiceBrokerSwaggerspecParamsWithTimeout(timeout time.Duration) *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - timeout: timeout, } } // NewServiceBrokerSwaggerspecParamsWithContext creates a new ServiceBrokerSwaggerspecParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewServiceBrokerSwaggerspecParamsWithContext(ctx context.Context) *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ - Context: ctx, } } // NewServiceBrokerSwaggerspecParamsWithHTTPClient creates a new ServiceBrokerSwaggerspecParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewServiceBrokerSwaggerspecParamsWithHTTPClient(client *http.Client) *ServiceBrokerSwaggerspecParams { - return &ServiceBrokerSwaggerspecParams{ HTTPClient: client, } } -/*ServiceBrokerSwaggerspecParams contains all the parameters to send to the API endpoint -for the service broker swaggerspec operation typically these are written to a http.Request +/* ServiceBrokerSwaggerspecParams contains all the parameters to send to the API endpoint + for the service broker swaggerspec operation. + + Typically these are written to a http.Request. */ type ServiceBrokerSwaggerspecParams struct { timeout time.Duration @@ -65,6 +63,21 @@ type ServiceBrokerSwaggerspecParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the service broker swaggerspec params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerSwaggerspecParams) WithDefaults() *ServiceBrokerSwaggerspecParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the service broker swaggerspec params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ServiceBrokerSwaggerspecParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the service broker swaggerspec params func (o *ServiceBrokerSwaggerspecParams) WithTimeout(timeout time.Duration) *ServiceBrokerSwaggerspecParams { o.SetTimeout(timeout) diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go index a2942f901e..7f37f6cdbd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go @@ -10,10 +10,9 @@ import ( "io" "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" - strfmt "github.com/go-openapi/strfmt" - - models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/power-go-client/power/models" ) // ServiceBrokerSwaggerspecReader is a Reader for the ServiceBrokerSwaggerspec structure. @@ -24,16 +23,14 @@ type ServiceBrokerSwaggerspecReader struct { // ReadResponse reads a server response into the received o. func (o *ServiceBrokerSwaggerspecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: result := NewServiceBrokerSwaggerspecOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -42,7 +39,7 @@ func NewServiceBrokerSwaggerspecOK() *ServiceBrokerSwaggerspecOK { return &ServiceBrokerSwaggerspecOK{} } -/*ServiceBrokerSwaggerspecOK handles this case with default header values. +/* ServiceBrokerSwaggerspecOK describes a response with status code 200, with default header values. OK */ @@ -53,6 +50,9 @@ type ServiceBrokerSwaggerspecOK struct { func (o *ServiceBrokerSwaggerspecOK) Error() string { return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %+v", 200, o.Payload) } +func (o *ServiceBrokerSwaggerspecOK) GetPayload() models.Object { + return o.Payload +} func (o *ServiceBrokerSwaggerspecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go index 8f9e1a05c7..d6ba1ec15a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go @@ -6,13 +6,14 @@ package swagger_spec // Editing this file might prove futile when you re-run the swagger generate command import ( - "github.com/go-openapi/runtime" + "fmt" - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" ) // New creates a new swagger spec API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } @@ -24,16 +25,25 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams, opts ...ClientOption) (*ServiceBrokerSwaggerspecOK, error) + + SetTransport(transport runtime.ClientTransport) +} + /* -ServiceBrokerSwaggerspec gets swagger json spec + ServiceBrokerSwaggerspec gets swagger json spec */ -func (a *Client) ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams) (*ServiceBrokerSwaggerspecOK, error) { +func (a *Client) ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams, opts ...ClientOption) (*ServiceBrokerSwaggerspecOK, error) { // TODO: Validate the params before sending if params == nil { params = NewServiceBrokerSwaggerspecParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "serviceBroker.swaggerspec", Method: "GET", PathPattern: "/v1/swagger.json", @@ -44,12 +54,23 @@ func (a *Client) ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams Reader: &ServiceBrokerSwaggerspecReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } - return result.(*ServiceBrokerSwaggerspecOK), nil - + success, ok := result.(*ServiceBrokerSwaggerspecOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for serviceBroker.swaggerspec: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } // SetTransport changes the transport on the client diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_token.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_token.go index 6efa42aa29..adc43d9e7b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_token.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_token.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // AccessToken access token +// // swagger:model AccessToken type AccessToken struct { @@ -45,6 +47,11 @@ func (m *AccessToken) validateAccessToken(formats strfmt.Registry) error { return nil } +// ContextValidate validates this access token based on context it is used +func (m *AccessToken) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AccessToken) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/async_operation.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/async_operation.go index 33b1dc40d4..4fe9256236 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/async_operation.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/async_operation.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // AsyncOperation async operation +// // swagger:model AsyncOperation type AsyncOperation struct { @@ -24,6 +26,11 @@ func (m *AsyncOperation) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this async operation based on context it is used +func (m *AsyncOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AsyncOperation) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go index 711845a3b1..ba40ca2d33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // AvailableStockImages A map of an array of stock images for each available storage type +// // swagger:model AvailableStockImages type AvailableStockImages map[string]StockImages @@ -29,6 +31,31 @@ func (m AvailableStockImages) Validate(formats strfmt.Registry) error { if err := m[k].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this available stock images based on the context it is used +func (m AvailableStockImages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := m[k].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go index e60918ece5..dab6aafe03 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Catalog catalog +// // swagger:model Catalog type Catalog struct { @@ -37,7 +38,6 @@ func (m *Catalog) Validate(formats strfmt.Registry) error { } func (m *Catalog) validateServices(formats strfmt.Registry) error { - if swag.IsZero(m.Services) { // not required return nil } @@ -51,6 +51,42 @@ func (m *Catalog) validateServices(formats strfmt.Registry) error { if err := m.Services[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this catalog based on the context it is used +func (m *Catalog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Catalog) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_reference.go index bd777a2db5..80464044d8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloneTaskReference clone task reference +// // swagger:model CloneTaskReference type CloneTaskReference struct { @@ -62,6 +64,11 @@ func (m *CloneTaskReference) validateHref(formats strfmt.Registry) error { return nil } +// ContextValidate validates this clone task reference based on context it is used +func (m *CloneTaskReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloneTaskReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go index 9788a64614..c17b76df8f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloneTaskStatus clone task status +// // swagger:model CloneTaskStatus type CloneTaskStatus struct { @@ -59,7 +60,6 @@ func (m *CloneTaskStatus) Validate(formats strfmt.Registry) error { } func (m *CloneTaskStatus) validateClonedVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.ClonedVolumes) { // not required return nil } @@ -73,6 +73,8 @@ func (m *CloneTaskStatus) validateClonedVolumes(formats strfmt.Registry) error { if err := m.ClonedVolumes[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) } return err } @@ -121,7 +123,7 @@ const ( // prop value enum func (m *CloneTaskStatus) validateStatusEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, cloneTaskStatusTypeStatusPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, cloneTaskStatusTypeStatusPropEnum, true); err != nil { return err } return nil @@ -141,6 +143,40 @@ func (m *CloneTaskStatus) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this clone task status based on the context it is used +func (m *CloneTaskStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClonedVolumes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloneTaskStatus) contextValidateClonedVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ClonedVolumes); i++ { + + if m.ClonedVolumes[i] != nil { + if err := m.ClonedVolumes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *CloneTaskStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume.go index 2c525f2eb5..0431ea9907 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ClonedVolume cloned volume +// // swagger:model ClonedVolume type ClonedVolume struct { @@ -27,6 +29,11 @@ func (m *ClonedVolume) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this cloned volume based on context it is used +func (m *ClonedVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ClonedVolume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go index 50910571b6..67757963b8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ClonedVolumeDetail cloned volume detail +// // swagger:model ClonedVolumeDetail type ClonedVolumeDetail struct { @@ -54,6 +56,8 @@ func (m *ClonedVolumeDetail) validateClone(formats strfmt.Registry) error { if err := m.Clone.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("clone") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clone") } return err } @@ -72,6 +76,58 @@ func (m *ClonedVolumeDetail) validateSource(formats strfmt.Registry) error { if err := m.Source.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("source") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("source") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloned volume detail based on the context it is used +func (m *ClonedVolumeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClone(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSource(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClonedVolumeDetail) contextValidateClone(ctx context.Context, formats strfmt.Registry) error { + + if m.Clone != nil { + if err := m.Clone.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clone") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clone") + } + return err + } + } + + return nil +} + +func (m *ClonedVolumeDetail) contextValidateSource(ctx context.Context, formats strfmt.Registry) error { + + if m.Source != nil { + if err := m.Source.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("source") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("source") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go index 5aed5a66e8..b61c4a054a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnection cloud connection +// // swagger:model CloudConnection type CloudConnection struct { @@ -133,7 +134,6 @@ func (m *CloudConnection) Validate(formats strfmt.Registry) error { } func (m *CloudConnection) validateClassic(formats strfmt.Registry) error { - if swag.IsZero(m.Classic) { // not required return nil } @@ -142,6 +142,8 @@ func (m *CloudConnection) validateClassic(formats strfmt.Registry) error { if err := m.Classic.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("classic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("classic") } return err } @@ -218,7 +220,6 @@ func (m *CloudConnection) validateName(formats strfmt.Registry) error { } func (m *CloudConnection) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required return nil } @@ -232,6 +233,8 @@ func (m *CloudConnection) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } @@ -270,7 +273,6 @@ func (m *CloudConnection) validateUserIPAddress(formats strfmt.Registry) error { } func (m *CloudConnection) validateVpc(formats strfmt.Registry) error { - if swag.IsZero(m.Vpc) { // not required return nil } @@ -279,6 +281,82 @@ func (m *CloudConnection) validateVpc(formats strfmt.Registry) error { if err := m.Vpc.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud connection based on the context it is used +func (m *CloudConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClassic(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpc(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnection) contextValidateClassic(ctx context.Context, formats strfmt.Registry) error { + + if m.Classic != nil { + if err := m.Classic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("classic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("classic") + } + return err + } + } + + return nil +} + +func (m *CloudConnection) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudConnection) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { + + if m.Vpc != nil { + if err := m.Vpc.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go index 22f566f4e8..12231ad9df 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnectionCreate cloud connection create +// // swagger:model CloudConnectionCreate type CloudConnectionCreate struct { @@ -71,7 +72,6 @@ func (m *CloudConnectionCreate) Validate(formats strfmt.Registry) error { } func (m *CloudConnectionCreate) validateClassic(formats strfmt.Registry) error { - if swag.IsZero(m.Classic) { // not required return nil } @@ -80,6 +80,8 @@ func (m *CloudConnectionCreate) validateClassic(formats strfmt.Registry) error { if err := m.Classic.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("classic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("classic") } return err } @@ -111,7 +113,7 @@ func init() { // prop value enum func (m *CloudConnectionCreate) validateSpeedEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, cloudConnectionCreateTypeSpeedPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, cloudConnectionCreateTypeSpeedPropEnum, true); err != nil { return err } return nil @@ -132,7 +134,6 @@ func (m *CloudConnectionCreate) validateSpeed(formats strfmt.Registry) error { } func (m *CloudConnectionCreate) validateVpc(formats strfmt.Registry) error { - if swag.IsZero(m.Vpc) { // not required return nil } @@ -141,6 +142,58 @@ func (m *CloudConnectionCreate) validateVpc(formats strfmt.Registry) error { if err := m.Vpc.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud connection create based on the context it is used +func (m *CloudConnectionCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClassic(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpc(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionCreate) contextValidateClassic(ctx context.Context, formats strfmt.Registry) error { + + if m.Classic != nil { + if err := m.Classic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("classic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("classic") + } + return err + } + } + + return nil +} + +func (m *CloudConnectionCreate) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { + + if m.Vpc != nil { + if err := m.Vpc.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go index 6977373a1d..cf8c089942 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // CloudConnectionCreateResponse cloud connection create response +// // swagger:model CloudConnectionCreateResponse type CloudConnectionCreateResponse struct { CloudConnection @@ -86,7 +88,6 @@ func (m *CloudConnectionCreateResponse) Validate(formats strfmt.Registry) error } func (m *CloudConnectionCreateResponse) validateJobRef(formats strfmt.Registry) error { - if swag.IsZero(m.JobRef) { // not required return nil } @@ -95,6 +96,43 @@ func (m *CloudConnectionCreateResponse) validateJobRef(formats strfmt.Registry) if err := m.JobRef.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("jobRef") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobRef") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud connection create response based on the context it is used +func (m *CloudConnectionCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with CloudConnection + if err := m.CloudConnection.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateJobRef(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionCreateResponse) contextValidateJobRef(ctx context.Context, formats strfmt.Registry) error { + + if m.JobRef != nil { + if err := m.JobRef.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobRef") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobRef") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go index 3ff28f5b93..9ca73c49d3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // CloudConnectionEndpointClassic cloud connection endpoint classic +// // swagger:model CloudConnectionEndpointClassic type CloudConnectionEndpointClassic struct { @@ -38,7 +40,6 @@ func (m *CloudConnectionEndpointClassic) Validate(formats strfmt.Registry) error } func (m *CloudConnectionEndpointClassic) validateGre(formats strfmt.Registry) error { - if swag.IsZero(m.Gre) { // not required return nil } @@ -47,6 +48,38 @@ func (m *CloudConnectionEndpointClassic) validateGre(formats strfmt.Registry) er if err := m.Gre.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("gre") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gre") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud connection endpoint classic based on the context it is used +func (m *CloudConnectionEndpointClassic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGre(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionEndpointClassic) contextValidateGre(ctx context.Context, formats strfmt.Registry) error { + + if m.Gre != nil { + if err := m.Gre.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gre") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gre") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go index 97a3ad65d0..300fef2a19 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // CloudConnectionEndpointClassicUpdate cloud connection endpoint classic update +// // swagger:model CloudConnectionEndpointClassicUpdate type CloudConnectionEndpointClassicUpdate struct { @@ -38,7 +40,6 @@ func (m *CloudConnectionEndpointClassicUpdate) Validate(formats strfmt.Registry) } func (m *CloudConnectionEndpointClassicUpdate) validateGre(formats strfmt.Registry) error { - if swag.IsZero(m.Gre) { // not required return nil } @@ -47,6 +48,38 @@ func (m *CloudConnectionEndpointClassicUpdate) validateGre(formats strfmt.Regist if err := m.Gre.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("gre") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gre") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud connection endpoint classic update based on the context it is used +func (m *CloudConnectionEndpointClassicUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGre(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionEndpointClassicUpdate) contextValidateGre(ctx context.Context, formats strfmt.Registry) error { + + if m.Gre != nil { + if err := m.Gre.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gre") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gre") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go index 7e71e2cddf..873c365c19 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // CloudConnectionEndpointVPC cloud connection endpoint v p c +// // swagger:model CloudConnectionEndpointVPC type CloudConnectionEndpointVPC struct { @@ -40,7 +41,6 @@ func (m *CloudConnectionEndpointVPC) Validate(formats strfmt.Registry) error { } func (m *CloudConnectionEndpointVPC) validateVpcs(formats strfmt.Registry) error { - if swag.IsZero(m.Vpcs) { // not required return nil } @@ -54,6 +54,42 @@ func (m *CloudConnectionEndpointVPC) validateVpcs(formats strfmt.Registry) error if err := m.Vpcs[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vpcs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpcs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this cloud connection endpoint v p c based on the context it is used +func (m *CloudConnectionEndpointVPC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVpcs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionEndpointVPC) contextValidateVpcs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Vpcs); i++ { + + if m.Vpcs[i] != nil { + if err := m.Vpcs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpcs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpcs" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go index 8a41269bf4..df50662405 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnectionGRETunnel cloud connection g r e tunnel +// // swagger:model CloudConnectionGRETunnel type CloudConnectionGRETunnel struct { @@ -62,6 +64,11 @@ func (m *CloudConnectionGRETunnel) validateSourceIPAddress(formats strfmt.Regist return nil } +// ContextValidate validates this cloud connection g r e tunnel based on context it is used +func (m *CloudConnectionGRETunnel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudConnectionGRETunnel) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go index 7ad4526cb9..3310bc0566 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_g_r_e_tunnel_create.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnectionGRETunnelCreate cloud connection g r e tunnel create +// // swagger:model CloudConnectionGRETunnelCreate type CloudConnectionGRETunnelCreate struct { @@ -62,6 +64,11 @@ func (m *CloudConnectionGRETunnelCreate) validateDestIPAddress(formats strfmt.Re return nil } +// ContextValidate validates this cloud connection g r e tunnel create based on context it is used +func (m *CloudConnectionGRETunnelCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudConnectionGRETunnelCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go index bcb428800f..df7e0c302d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnectionUpdate cloud connection update +// // swagger:model CloudConnectionUpdate type CloudConnectionUpdate struct { @@ -62,7 +63,6 @@ func (m *CloudConnectionUpdate) Validate(formats strfmt.Registry) error { } func (m *CloudConnectionUpdate) validateClassic(formats strfmt.Registry) error { - if swag.IsZero(m.Classic) { // not required return nil } @@ -71,6 +71,8 @@ func (m *CloudConnectionUpdate) validateClassic(formats strfmt.Registry) error { if err := m.Classic.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("classic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("classic") } return err } @@ -93,14 +95,13 @@ func init() { // prop value enum func (m *CloudConnectionUpdate) validateSpeedEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, cloudConnectionUpdateTypeSpeedPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, cloudConnectionUpdateTypeSpeedPropEnum, true); err != nil { return err } return nil } func (m *CloudConnectionUpdate) validateSpeed(formats strfmt.Registry) error { - if swag.IsZero(m.Speed) { // not required return nil } @@ -114,7 +115,6 @@ func (m *CloudConnectionUpdate) validateSpeed(formats strfmt.Registry) error { } func (m *CloudConnectionUpdate) validateVpc(formats strfmt.Registry) error { - if swag.IsZero(m.Vpc) { // not required return nil } @@ -123,6 +123,58 @@ func (m *CloudConnectionUpdate) validateVpc(formats strfmt.Registry) error { if err := m.Vpc.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud connection update based on the context it is used +func (m *CloudConnectionUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClassic(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpc(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionUpdate) contextValidateClassic(ctx context.Context, formats strfmt.Registry) error { + + if m.Classic != nil { + if err := m.Classic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("classic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("classic") + } + return err + } + } + + return nil +} + +func (m *CloudConnectionUpdate) contextValidateVpc(ctx context.Context, formats strfmt.Registry) error { + + if m.Vpc != nil { + if err := m.Vpc.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpc") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_v_p_c.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_v_p_c.go index a59b174057..7aab62b3a7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_v_p_c.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_v_p_c.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnectionVPC cloud connection v p c +// // swagger:model CloudConnectionVPC type CloudConnectionVPC struct { @@ -48,6 +50,11 @@ func (m *CloudConnectionVPC) validateVpcID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this cloud connection v p c based on context it is used +func (m *CloudConnectionVPC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudConnectionVPC) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go index edd4991015..5c97aab8b7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnectionVirtualPrivateClouds cloud connection virtual private clouds +// // swagger:model CloudConnectionVirtualPrivateClouds type CloudConnectionVirtualPrivateClouds struct { @@ -53,6 +54,42 @@ func (m *CloudConnectionVirtualPrivateClouds) validateVirtualPrivateClouds(forma if err := m.VirtualPrivateClouds[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this cloud connection virtual private clouds based on the context it is used +func (m *CloudConnectionVirtualPrivateClouds) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVirtualPrivateClouds(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnectionVirtualPrivateClouds) contextValidateVirtualPrivateClouds(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VirtualPrivateClouds); i++ { + + if m.VirtualPrivateClouds[i] != nil { + if err := m.VirtualPrivateClouds[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) } return err } @@ -82,6 +119,7 @@ func (m *CloudConnectionVirtualPrivateClouds) UnmarshalBinary(b []byte) error { } // CloudConnectionVirtualPrivateCloud cloud connection virtual private cloud +// // swagger:model CloudConnectionVirtualPrivateCloud type CloudConnectionVirtualPrivateCloud struct { @@ -164,6 +202,11 @@ func (m *CloudConnectionVirtualPrivateCloud) validateVpcID(formats strfmt.Regist return nil } +// ContextValidate validates this cloud connection virtual private cloud based on context it is used +func (m *CloudConnectionVirtualPrivateCloud) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudConnectionVirtualPrivateCloud) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go index a573bc3f6a..1c9696c6cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudConnections cloud connections +// // swagger:model CloudConnections type CloudConnections struct { @@ -53,6 +54,42 @@ func (m *CloudConnections) validateCloudConnections(formats strfmt.Registry) err if err := m.CloudConnections[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this cloud connections based on the context it is used +func (m *CloudConnections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCloudConnections(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudConnections) contextValidateCloudConnections(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CloudConnections); i++ { + + if m.CloudConnections[i] != nil { + if err := m.CloudConnections[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go index fd31ec247e..307eab2419 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudInstance cloud instance +// // swagger:model CloudInstance type CloudInstance struct { @@ -150,6 +151,8 @@ func (m *CloudInstance) validateLimits(formats strfmt.Registry) error { if err := m.Limits.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("limits") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limits") } return err } @@ -191,6 +194,8 @@ func (m *CloudInstance) validatePvmInstances(formats strfmt.Registry) error { if err := m.PvmInstances[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } return err } @@ -229,6 +234,82 @@ func (m *CloudInstance) validateUsage(formats strfmt.Registry) error { if err := m.Usage.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("usage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("usage") + } + return err + } + } + + return nil +} + +// ContextValidate validate this cloud instance based on the context it is used +func (m *CloudInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLimits(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePvmInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUsage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudInstance) contextValidateLimits(ctx context.Context, formats strfmt.Registry) error { + + if m.Limits != nil { + if err := m.Limits.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("limits") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limits") + } + return err + } + } + + return nil +} + +func (m *CloudInstance) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PvmInstances); i++ { + + if m.PvmInstances[i] != nil { + if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CloudInstance) contextValidateUsage(ctx context.Context, formats strfmt.Registry) error { + + if m.Usage != nil { + if err := m.Usage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("usage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("usage") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_create.go index ac335500ee..a94ca580bc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_create.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudInstanceCreate cloud instance create +// // swagger:model CloudInstanceCreate type CloudInstanceCreate struct { @@ -119,6 +121,11 @@ func (m *CloudInstanceCreate) validateTenantID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this cloud instance create based on context it is used +func (m *CloudInstanceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudInstanceCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go index e5ef396ef8..22901098b0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudInstanceReference cloud instance reference +// // swagger:model CloudInstanceReference type CloudInstanceReference struct { @@ -133,6 +135,8 @@ func (m *CloudInstanceReference) validateLimits(formats strfmt.Registry) error { if err := m.Limits.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("limits") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limits") } return err } @@ -159,6 +163,36 @@ func (m *CloudInstanceReference) validateRegion(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cloud instance reference based on the context it is used +func (m *CloudInstanceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLimits(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CloudInstanceReference) contextValidateLimits(ctx context.Context, formats strfmt.Registry) error { + + if m.Limits != nil { + if err := m.Limits.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("limits") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limits") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *CloudInstanceReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_update.go index 2b244aad6f..a22c0677a8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_update.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // CloudInstanceUpdate cloud instance update +// // swagger:model CloudInstanceUpdate type CloudInstanceUpdate struct { @@ -36,6 +38,11 @@ func (m *CloudInstanceUpdate) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this cloud instance update based on context it is used +func (m *CloudInstanceUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudInstanceUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_usage_limits.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_usage_limits.go index c3a158a8fc..ab8710d9ab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_usage_limits.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_usage_limits.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CloudInstanceUsageLimits cloud instance usage limits +// // swagger:model CloudInstanceUsageLimits type CloudInstanceUsageLimits struct { @@ -131,6 +133,11 @@ func (m *CloudInstanceUsageLimits) validateStorage(formats strfmt.Registry) erro return nil } +// ContextValidate validates this cloud instance usage limits based on context it is used +func (m *CloudInstanceUsageLimits) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CloudInstanceUsageLimits) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_language.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_language.go index 56de8ed31c..76399a994a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_language.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_language.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ConsoleLanguage console language +// // swagger:model ConsoleLanguage type ConsoleLanguage struct { @@ -48,6 +50,11 @@ func (m *ConsoleLanguage) validateCode(formats strfmt.Registry) error { return nil } +// ContextValidate validates this console language based on context it is used +func (m *ConsoleLanguage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ConsoleLanguage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go index ebfa501aa8..adfe7d6540 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ConsoleLanguages console languages +// // swagger:model ConsoleLanguages type ConsoleLanguages struct { @@ -53,6 +54,42 @@ func (m *ConsoleLanguages) validateConsoleLanguages(formats strfmt.Registry) err if err := m.ConsoleLanguages[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this console languages based on the context it is used +func (m *ConsoleLanguages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConsoleLanguages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsoleLanguages) contextValidateConsoleLanguages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ConsoleLanguages); i++ { + + if m.ConsoleLanguages[i] != nil { + if err := m.ConsoleLanguages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go index 63103fe1ea..85e1cd011d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // Context See [Context Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#context-object) for more details. +// // swagger:model Context type Context interface{} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go index dad3ac897c..164c9a5a9d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CreateCosImageImportJob create cos image import job +// // swagger:model CreateCosImageImportJob type CreateCosImageImportJob struct { @@ -120,14 +121,13 @@ const ( // prop value enum func (m *CreateCosImageImportJob) validateBucketAccessEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, createCosImageImportJobTypeBucketAccessPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, createCosImageImportJobTypeBucketAccessPropEnum, true); err != nil { return err } return nil } func (m *CreateCosImageImportJob) validateBucketAccess(formats strfmt.Registry) error { - if swag.IsZero(m.BucketAccess) { // not required return nil } @@ -196,14 +196,13 @@ const ( // prop value enum func (m *CreateCosImageImportJob) validateOsTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, createCosImageImportJobTypeOsTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, createCosImageImportJobTypeOsTypePropEnum, true); err != nil { return err } return nil } func (m *CreateCosImageImportJob) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required return nil } @@ -226,7 +225,6 @@ func (m *CreateCosImageImportJob) validateRegion(formats strfmt.Registry) error } func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required return nil } @@ -235,6 +233,38 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr if err := m.StorageAffinity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create cos image import job based on the context it is used +func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateCosImageImportJob) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go index ee5132578e..77dd2e4b1c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CreateDataVolume create data volume +// // swagger:model CreateDataVolume type CreateDataVolume struct { @@ -95,20 +96,19 @@ const ( // CreateDataVolumeAffinityPolicyAffinity captures enum value "affinity" CreateDataVolumeAffinityPolicyAffinity string = "affinity" - // CreateDataVolumeAffinityPolicyAntiAffinity captures enum value "anti-affinity" - CreateDataVolumeAffinityPolicyAntiAffinity string = "anti-affinity" + // CreateDataVolumeAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" + CreateDataVolumeAffinityPolicyAntiDashAffinity string = "anti-affinity" ) // prop value enum func (m *CreateDataVolume) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, createDataVolumeTypeAffinityPolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, createDataVolumeTypeAffinityPolicyPropEnum, true); err != nil { return err } return nil } func (m *CreateDataVolume) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required return nil } @@ -139,6 +139,11 @@ func (m *CreateDataVolume) validateSize(formats strfmt.Registry) error { return nil } +// ContextValidate validates this create data volume based on context it is used +func (m *CreateDataVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CreateDataVolume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go index 74bfe1dd03..b55fb483db 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // CreateImage create image +// // swagger:model CreateImage type CreateImage struct { @@ -113,14 +114,13 @@ const ( // prop value enum func (m *CreateImage) validateOsTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, createImageTypeOsTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, createImageTypeOsTypePropEnum, true); err != nil { return err } return nil } func (m *CreateImage) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required return nil } @@ -147,8 +147,8 @@ func init() { const ( - // CreateImageSourceRootProject captures enum value "root-project" - CreateImageSourceRootProject string = "root-project" + // CreateImageSourceRootDashProject captures enum value "root-project" + CreateImageSourceRootDashProject string = "root-project" // CreateImageSourceURL captures enum value "url" CreateImageSourceURL string = "url" @@ -156,7 +156,7 @@ const ( // prop value enum func (m *CreateImage) validateSourceEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, createImageTypeSourcePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, createImageTypeSourcePropEnum, true); err != nil { return err } return nil @@ -177,7 +177,6 @@ func (m *CreateImage) validateSource(formats strfmt.Registry) error { } func (m *CreateImage) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required return nil } @@ -186,6 +185,38 @@ func (m *CreateImage) validateStorageAffinity(formats strfmt.Registry) error { if err := m.StorageAffinity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create image based on the context it is used +func (m *CreateImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateImage) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go index 87861aa537..5602d9d0a7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // DHCPServer d h c p server +// // swagger:model DHCPServer type DHCPServer struct { @@ -71,6 +73,8 @@ func (m *DHCPServer) validateNetwork(formats strfmt.Registry) error { if err := m.Network.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") } return err } @@ -88,6 +92,36 @@ func (m *DHCPServer) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this d h c p server based on the context it is used +func (m *DHCPServer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetwork(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DHCPServer) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { + + if m.Network != nil { + if err := m.Network.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DHCPServer) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_create.go new file mode 100644 index 0000000000..2098337b99 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_create.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DHCPServerCreate d h c p server create +// +// swagger:model DHCPServerCreate +type DHCPServerCreate struct { + + // Optional cloud connection uuid to connect with DHCP private network + CloudConnectionID string `json:"cloudConnectionID,omitempty"` +} + +// Validate validates this d h c p server create +func (m *DHCPServerCreate) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this d h c p server create based on context it is used +func (m *DHCPServerCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DHCPServerCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DHCPServerCreate) UnmarshalBinary(b []byte) error { + var res DHCPServerCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go index 0e0d5bb3b2..fc6284fff0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // DHCPServerDetail d h c p server detail +// // swagger:model DHCPServerDetail type DHCPServerDetail struct { @@ -71,7 +72,6 @@ func (m *DHCPServerDetail) validateID(formats strfmt.Registry) error { } func (m *DHCPServerDetail) validateLeases(formats strfmt.Registry) error { - if swag.IsZero(m.Leases) { // not required return nil } @@ -85,6 +85,8 @@ func (m *DHCPServerDetail) validateLeases(formats strfmt.Registry) error { if err := m.Leases[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("leases" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leases" + "." + strconv.Itoa(i)) } return err } @@ -105,6 +107,8 @@ func (m *DHCPServerDetail) validateNetwork(formats strfmt.Registry) error { if err := m.Network.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") } return err } @@ -122,6 +126,60 @@ func (m *DHCPServerDetail) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this d h c p server detail based on the context it is used +func (m *DHCPServerDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLeases(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetwork(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DHCPServerDetail) contextValidateLeases(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Leases); i++ { + + if m.Leases[i] != nil { + if err := m.Leases[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("leases" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("leases" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DHCPServerDetail) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { + + if m.Network != nil { + if err := m.Network.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DHCPServerDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_leases.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_leases.go index b5c5d08592..c2b6d3384f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_leases.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_leases.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // DHCPServerLeases d h c p server leases +// // swagger:model DHCPServerLeases type DHCPServerLeases struct { @@ -62,6 +64,11 @@ func (m *DHCPServerLeases) validateInstanceMacAddress(formats strfmt.Registry) e return nil } +// ContextValidate validates this d h c p server leases based on context it is used +func (m *DHCPServerLeases) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DHCPServerLeases) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_network.go index 68f766c91c..52e05233de 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_network.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // DHCPServerNetwork d h c p server network +// // swagger:model DHCPServerNetwork type DHCPServerNetwork struct { @@ -62,6 +64,11 @@ func (m *DHCPServerNetwork) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this d h c p server network based on context it is used +func (m *DHCPServerNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DHCPServerNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go index 123c30f8aa..947db73c45 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // DHCPServers The list of DHCP Servers +// // swagger:model DHCPServers type DHCPServers []*DHCPServer @@ -31,6 +32,33 @@ func (m DHCPServers) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this d h c p servers based on the context it is used +func (m DHCPServers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dashboard_client.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dashboard_client.go index c993d3c908..bb752401bd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dashboard_client.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dashboard_client.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // DashboardClient dashboard client +// // swagger:model DashboardClient type DashboardClient struct { @@ -30,6 +32,11 @@ func (m *DashboardClient) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this dashboard client based on context it is used +func (m *DashboardClient) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DashboardClient) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go index cbc20ee74a..89688eaa11 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // DeadPeerDetection Dead Peer Detection of the VPN Connection +// // swagger:model DeadPeerDetection type DeadPeerDetection struct { @@ -25,12 +26,14 @@ type DeadPeerDetection struct { Action *string `json:"action"` // How often to test that the Peer Gateway is responsive + // Example: 10 // Required: true // Maximum: 60 // Minimum: 2 Interval *int64 `json:"interval"` // The number of attempts to connect before tearing down the connection + // Example: 5 // Required: true // Maximum: 5 // Minimum: 1 @@ -79,7 +82,7 @@ const ( // prop value enum func (m *DeadPeerDetection) validateActionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, deadPeerDetectionTypeActionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, deadPeerDetectionTypeActionPropEnum, true); err != nil { return err } return nil @@ -105,11 +108,11 @@ func (m *DeadPeerDetection) validateInterval(formats strfmt.Registry) error { return err } - if err := validate.MinimumInt("interval", "body", int64(*m.Interval), 2, false); err != nil { + if err := validate.MinimumInt("interval", "body", *m.Interval, 2, false); err != nil { return err } - if err := validate.MaximumInt("interval", "body", int64(*m.Interval), 60, false); err != nil { + if err := validate.MaximumInt("interval", "body", *m.Interval, 60, false); err != nil { return err } @@ -122,17 +125,22 @@ func (m *DeadPeerDetection) validateThreshold(formats strfmt.Registry) error { return err } - if err := validate.MinimumInt("threshold", "body", int64(*m.Threshold), 1, false); err != nil { + if err := validate.MinimumInt("threshold", "body", *m.Threshold, 1, false); err != nil { return err } - if err := validate.MaximumInt("threshold", "body", int64(*m.Threshold), 5, false); err != nil { + if err := validate.MaximumInt("threshold", "body", *m.Threshold, 5, false); err != nil { return err } return nil } +// ContextValidate validates this dead peer detection based on context it is used +func (m *DeadPeerDetection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DeadPeerDetection) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/device_code.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/device_code.go index a14fb20caa..7cb9a74880 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/device_code.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/device_code.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // DeviceCode device code +// // swagger:model DeviceCode type DeviceCode struct { @@ -113,6 +115,11 @@ func (m *DeviceCode) validateVerificationURL(formats strfmt.Registry) error { return nil } +// ContextValidate validates this device code based on context it is used +func (m *DeviceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *DeviceCode) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/error.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/error.go index a4a74a0b36..a7c90934c3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/error.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/error.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Error error +// // swagger:model Error type Error struct { @@ -33,6 +35,11 @@ func (m *Error) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Error) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go index 74faa8a651..b9190c8f62 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Event event +// // swagger:model Event type Event struct { @@ -145,7 +146,7 @@ const ( // prop value enum func (m *Event) validateLevelEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, eventTypeLevelPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, eventTypeLevelPropEnum, true); err != nil { return err } return nil @@ -206,7 +207,6 @@ func (m *Event) validateTimestamp(formats strfmt.Registry) error { } func (m *Event) validateUser(formats strfmt.Registry) error { - if swag.IsZero(m.User) { // not required return nil } @@ -215,6 +215,38 @@ func (m *Event) validateUser(formats strfmt.Registry) error { if err := m.User.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("user") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("user") + } + return err + } + } + + return nil +} + +// ContextValidate validate this event based on the context it is used +func (m *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUser(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Event) contextValidateUser(ctx context.Context, formats strfmt.Registry) error { + + if m.User != nil { + if err := m.User.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("user") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event_user.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event_user.go index 4de9b694fc..a20b42b1e9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event_user.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/event_user.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // EventUser event user +// // swagger:model EventUser type EventUser struct { @@ -51,6 +53,11 @@ func (m *EventUser) validateUserID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this event user based on context it is used +func (m *EventUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *EventUser) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go index 6747b1728b..721b97fcf4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Events events +// // swagger:model Events type Events struct { @@ -53,6 +54,42 @@ func (m *Events) validateEvents(formats strfmt.Registry) error { if err := m.Events[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("events" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("events" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this events based on the context it is used +func (m *Events) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEvents(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Events) contextValidateEvents(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Events); i++ { + + if m.Events[i] != nil { + if err := m.Events[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("events" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("events" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/export_image.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/export_image.go index 594acbe8ff..1f8a17dd22 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/export_image.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/export_image.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ExportImage export image +// // swagger:model ExportImage type ExportImage struct { @@ -68,6 +70,11 @@ func (m *ExportImage) validateBucketName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this export image based on context it is used +func (m *ExportImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ExportImage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go index 064fc18f0a..8c78c41fcf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // HardwarePlatform Hardware platform detailing its limits and statistics +// // swagger:model HardwarePlatform type HardwarePlatform struct { @@ -55,7 +56,6 @@ func (m *HardwarePlatform) Validate(formats strfmt.Registry) error { } func (m *HardwarePlatform) validateHostsResources(formats strfmt.Registry) error { - if swag.IsZero(m.HostsResources) { // not required return nil } @@ -69,6 +69,42 @@ func (m *HardwarePlatform) validateHostsResources(formats strfmt.Registry) error if err := m.HostsResources[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("hostsResources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hostsResources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this hardware platform based on the context it is used +func (m *HardwarePlatform) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHostsResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HardwarePlatform) contextValidateHostsResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.HostsResources); i++ { + + if m.HostsResources[i] != nil { + if err := m.HostsResources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hostsResources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hostsResources" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go index fa3008ac42..8e98a5e08e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // HardwarePlatforms A map of hardware platforms detailing their limits and statistics +// // swagger:model HardwarePlatforms type HardwarePlatforms map[string]HardwarePlatform @@ -27,6 +29,31 @@ func (m HardwarePlatforms) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this hardware platforms based on the context it is used +func (m HardwarePlatforms) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if val, ok := m[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { return err } } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/health.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/health.go index 4e02af8f82..b94914a5e7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/health.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/health.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Health health +// // swagger:model Health type Health struct { @@ -45,6 +47,11 @@ func (m *Health) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this health based on context it is used +func (m *Health) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Health) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go index 16082117c4..ab26280540 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // HostInfo host info +// // swagger:model HostInfo type HostInfo struct { @@ -80,6 +81,8 @@ func (m *HostInfo) validateCores(formats strfmt.Registry) error { if err := m.Cores.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cores") } return err } @@ -116,6 +119,8 @@ func (m *HostInfo) validateMemory(formats strfmt.Registry) error { if err := m.Memory.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memory") } return err } @@ -139,6 +144,82 @@ func (m *HostInfo) validatePvmInstances(formats strfmt.Registry) error { if err := m.PvmInstances[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this host info based on the context it is used +func (m *HostInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCores(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMemory(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePvmInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HostInfo) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { + + if m.Cores != nil { + if err := m.Cores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cores") + } + return err + } + } + + return nil +} + +func (m *HostInfo) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { + + if m.Memory != nil { + if err := m.Memory.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memory") + } + return err + } + } + + return nil +} + +func (m *HostInfo) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PvmInstances); i++ { + + if m.PvmInstances[i] != nil { + if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go index ee21b460cc..5a04d4fbd8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // HostPVMInstance A pvm instance on host +// // swagger:model HostPVMInstance type HostPVMInstance struct { @@ -95,6 +97,8 @@ func (m *HostPVMInstance) validateOwner(formats strfmt.Registry) error { if err := m.Owner.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") } return err } @@ -139,6 +143,36 @@ func (m *HostPVMInstance) validateTenantID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this host p VM instance based on the context it is used +func (m *HostPVMInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HostPVMInstance) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *HostPVMInstance) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resource.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resource.go index 68cd69abd0..aef626fbe8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resource.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resource.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // HostResource host resource +// // swagger:model HostResource type HostResource struct { @@ -79,6 +81,11 @@ func (m *HostResource) validateUsed(formats strfmt.Registry) error { return nil } +// ContextValidate validates this host resource based on context it is used +func (m *HostResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *HostResource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resources.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resources.go index 92c43fabd8..40b3b8652f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resources.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_resources.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // HostResources host resources +// // swagger:model HostResources type HostResources struct { @@ -79,6 +81,11 @@ func (m *HostResources) validateMemory(formats strfmt.Registry) error { return nil } +// ContextValidate validates this host resources based on context it is used +func (m *HostResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *HostResources) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go index 3c47182ee4..5cfe23d7a8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicies i k e policies +// // swagger:model IKEPolicies type IKEPolicies struct { @@ -53,6 +54,42 @@ func (m *IKEPolicies) validateIkePolicies(formats strfmt.Registry) error { if err := m.IkePolicies[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this i k e policies based on the context it is used +func (m *IKEPolicies) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIkePolicies(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IKEPolicies) contextValidateIkePolicies(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IkePolicies); i++ { + + if m.IkePolicies[i] != nil { + if err := m.IkePolicies[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go index af8873a014..c6eb1bd796 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go @@ -6,46 +6,52 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicy IKE Policy object +// // swagger:model IKEPolicy type IKEPolicy struct { // authentication // Required: true - Authentication IKEPolicyAuthentication `json:"authentication"` + Authentication *IKEPolicyAuthentication `json:"authentication"` // DH group of the IKE Policy + // Example: 2 // Required: true // Enum: [1 2 5 14 19 20 24] DhGroup *int64 `json:"dhGroup"` // encryption of the IKE Policy + // Example: aes-256-cbc // Required: true - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-256-cbc aes-256-gcm des-cbc] + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-128-gcm 3des-cbc] Encryption *string `json:"encryption"` // unique identifier of the IKE Policy object + // Example: 7edc8988-eb18-4b5c-a594-0d73d8254463 // Required: true ID *string `json:"id"` // key lifetime // Required: true - KeyLifetime KeyLifetime `json:"keyLifetime"` + KeyLifetime *KeyLifetime `json:"keyLifetime"` // name of the IKE Policy + // Example: ikePolicy1 // Required: true Name *string `json:"name"` // version of the IKE Policy + // Example: 2 // Required: true // Enum: [1 2] Version *int64 `json:"version"` @@ -91,13 +97,25 @@ func (m *IKEPolicy) Validate(formats strfmt.Registry) error { func (m *IKEPolicy) validateAuthentication(formats strfmt.Registry) error { - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } + if err := validate.Required("authentication", "body", m.Authentication); err != nil { + return err + } + + if err := validate.Required("authentication", "body", m.Authentication); err != nil { return err } + if m.Authentication != nil { + if err := m.Authentication.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + } + return nil } @@ -115,7 +133,7 @@ func init() { // prop value enum func (m *IKEPolicy) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, iKEPolicyTypeDhGroupPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyTypeDhGroupPropEnum, true); err != nil { return err } return nil @@ -139,7 +157,7 @@ var iKEPolicyTypeEncryptionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["3des-cbc","aes-128-cbc","aes-128-gcm","aes-192-cbc","aes-256-cbc","aes-256-gcm","des-cbc"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -149,31 +167,28 @@ func init() { const ( - // IKEPolicyEncryptionNr3desCbc captures enum value "3des-cbc" - IKEPolicyEncryptionNr3desCbc string = "3des-cbc" - - // IKEPolicyEncryptionAes128Cbc captures enum value "aes-128-cbc" - IKEPolicyEncryptionAes128Cbc string = "aes-128-cbc" + // IKEPolicyEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" + IKEPolicyEncryptionAesDash256DashCbc string = "aes-256-cbc" - // IKEPolicyEncryptionAes128Gcm captures enum value "aes-128-gcm" - IKEPolicyEncryptionAes128Gcm string = "aes-128-gcm" + // IKEPolicyEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" + IKEPolicyEncryptionAesDash192DashCbc string = "aes-192-cbc" - // IKEPolicyEncryptionAes192Cbc captures enum value "aes-192-cbc" - IKEPolicyEncryptionAes192Cbc string = "aes-192-cbc" + // IKEPolicyEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" + IKEPolicyEncryptionAesDash128DashCbc string = "aes-128-cbc" - // IKEPolicyEncryptionAes256Cbc captures enum value "aes-256-cbc" - IKEPolicyEncryptionAes256Cbc string = "aes-256-cbc" + // IKEPolicyEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" + IKEPolicyEncryptionAesDash256DashGcm string = "aes-256-gcm" - // IKEPolicyEncryptionAes256Gcm captures enum value "aes-256-gcm" - IKEPolicyEncryptionAes256Gcm string = "aes-256-gcm" + // IKEPolicyEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" + IKEPolicyEncryptionAesDash128DashGcm string = "aes-128-gcm" - // IKEPolicyEncryptionDesCbc captures enum value "des-cbc" - IKEPolicyEncryptionDesCbc string = "des-cbc" + // IKEPolicyEncryptionNr3desDashCbc captures enum value "3des-cbc" + IKEPolicyEncryptionNr3desDashCbc string = "3des-cbc" ) // prop value enum func (m *IKEPolicy) validateEncryptionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, iKEPolicyTypeEncryptionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyTypeEncryptionPropEnum, true); err != nil { return err } return nil @@ -204,13 +219,25 @@ func (m *IKEPolicy) validateID(formats strfmt.Registry) error { func (m *IKEPolicy) validateKeyLifetime(formats strfmt.Registry) error { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { + return err + } + + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { return err } + if m.KeyLifetime != nil { + if err := m.KeyLifetime.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + return nil } @@ -237,7 +264,7 @@ func init() { // prop value enum func (m *IKEPolicy) validateVersionEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, iKEPolicyTypeVersionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyTypeVersionPropEnum, true); err != nil { return err } return nil @@ -257,6 +284,56 @@ func (m *IKEPolicy) validateVersion(formats strfmt.Registry) error { return nil } +// ContextValidate validate this i k e policy based on the context it is used +func (m *IKEPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IKEPolicy) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if m.Authentication != nil { + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + } + + return nil +} + +func (m *IKEPolicy) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IKEPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go index 07082dabb3..8cdd1e861f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go @@ -6,31 +6,42 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // IKEPolicyAuthentication authentication of the IKE policy +// Example: sha-256 +// // swagger:model IKEPolicyAuthentication type IKEPolicyAuthentication string -const ( +func NewIKEPolicyAuthentication(value IKEPolicyAuthentication) *IKEPolicyAuthentication { + return &value +} - // IKEPolicyAuthenticationNone captures enum value "none" - IKEPolicyAuthenticationNone IKEPolicyAuthentication = "none" +// Pointer returns a pointer to a freshly-allocated IKEPolicyAuthentication. +func (m IKEPolicyAuthentication) Pointer() *IKEPolicyAuthentication { + return &m +} + +const ( - // IKEPolicyAuthenticationSha256 captures enum value "sha-256" - IKEPolicyAuthenticationSha256 IKEPolicyAuthentication = "sha-256" + // IKEPolicyAuthenticationShaDash256 captures enum value "sha-256" + IKEPolicyAuthenticationShaDash256 IKEPolicyAuthentication = "sha-256" - // IKEPolicyAuthenticationSha384 captures enum value "sha-384" - IKEPolicyAuthenticationSha384 IKEPolicyAuthentication = "sha-384" + // IKEPolicyAuthenticationShaDash384 captures enum value "sha-384" + IKEPolicyAuthenticationShaDash384 IKEPolicyAuthentication = "sha-384" // IKEPolicyAuthenticationSha1 captures enum value "sha1" IKEPolicyAuthenticationSha1 IKEPolicyAuthentication = "sha1" + + // IKEPolicyAuthenticationNone captures enum value "none" + IKEPolicyAuthenticationNone IKEPolicyAuthentication = "none" ) // for schema @@ -38,7 +49,7 @@ var iKEPolicyAuthenticationEnum []interface{} func init() { var res []IKEPolicyAuthentication - if err := json.Unmarshal([]byte(`["none","sha-256","sha-384","sha1"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["sha-256","sha-384","sha1","none"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -47,7 +58,7 @@ func init() { } func (m IKEPolicyAuthentication) validateIKEPolicyAuthenticationEnum(path, location string, value IKEPolicyAuthentication) error { - if err := validate.Enum(path, location, value, iKEPolicyAuthenticationEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyAuthenticationEnum, true); err != nil { return err } return nil @@ -67,3 +78,8 @@ func (m IKEPolicyAuthentication) Validate(formats strfmt.Registry) error { } return nil } + +// ContextValidate validates this i k e policy authentication based on context it is used +func (m IKEPolicyAuthentication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentications.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentications.go index 2fb4438736..930a3d61fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentications.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentications.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // IKEPolicyAuthentications i k e policy authentications +// Example: ["sha-256","sha-384","sha1","none"] +// // swagger:model IKEPolicyAuthentications type IKEPolicyAuthentications []string @@ -17,3 +21,8 @@ type IKEPolicyAuthentications []string func (m IKEPolicyAuthentications) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this i k e policy authentications based on context it is used +func (m IKEPolicyAuthentications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go index ee2c97ae24..decb59aa55 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicyCreate IKE Policy object used for creation +// // swagger:model IKEPolicyCreate type IKEPolicyCreate struct { @@ -23,20 +24,23 @@ type IKEPolicyCreate struct { Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` // DH group of the IKE Policy + // Example: 2 // Required: true // Enum: [1 2 5 14 19 20 24] DhGroup *int64 `json:"dhGroup"` // encryption of the IKE Policy + // Example: aes-256-cbc // Required: true - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-256-cbc aes-256-gcm des-cbc] + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-128-gcm 3des-cbc] Encryption *string `json:"encryption"` // key lifetime // Required: true - KeyLifetime KeyLifetime `json:"keyLifetime"` + KeyLifetime *KeyLifetime `json:"keyLifetime"` // name of the IKE Policy + // Example: ikePolicy1 // Required: true // Max Length: 47 // Min Length: 1 @@ -47,6 +51,7 @@ type IKEPolicyCreate struct { PresharedKey *string `json:"presharedKey"` // version of the IKE Policy + // Example: 2 // Required: true // Enum: [1 2] Version *int64 `json:"version"` @@ -91,7 +96,6 @@ func (m *IKEPolicyCreate) Validate(formats strfmt.Registry) error { } func (m *IKEPolicyCreate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required return nil } @@ -99,6 +103,8 @@ func (m *IKEPolicyCreate) validateAuthentication(formats strfmt.Registry) error if err := m.Authentication.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") } return err } @@ -120,7 +126,7 @@ func init() { // prop value enum func (m *IKEPolicyCreate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, iKEPolicyCreateTypeDhGroupPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyCreateTypeDhGroupPropEnum, true); err != nil { return err } return nil @@ -144,7 +150,7 @@ var iKEPolicyCreateTypeEncryptionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["3des-cbc","aes-128-cbc","aes-128-gcm","aes-192-cbc","aes-256-cbc","aes-256-gcm","des-cbc"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -154,31 +160,28 @@ func init() { const ( - // IKEPolicyCreateEncryptionNr3desCbc captures enum value "3des-cbc" - IKEPolicyCreateEncryptionNr3desCbc string = "3des-cbc" - - // IKEPolicyCreateEncryptionAes128Cbc captures enum value "aes-128-cbc" - IKEPolicyCreateEncryptionAes128Cbc string = "aes-128-cbc" + // IKEPolicyCreateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" + IKEPolicyCreateEncryptionAesDash256DashCbc string = "aes-256-cbc" - // IKEPolicyCreateEncryptionAes128Gcm captures enum value "aes-128-gcm" - IKEPolicyCreateEncryptionAes128Gcm string = "aes-128-gcm" + // IKEPolicyCreateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" + IKEPolicyCreateEncryptionAesDash192DashCbc string = "aes-192-cbc" - // IKEPolicyCreateEncryptionAes192Cbc captures enum value "aes-192-cbc" - IKEPolicyCreateEncryptionAes192Cbc string = "aes-192-cbc" + // IKEPolicyCreateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" + IKEPolicyCreateEncryptionAesDash128DashCbc string = "aes-128-cbc" - // IKEPolicyCreateEncryptionAes256Cbc captures enum value "aes-256-cbc" - IKEPolicyCreateEncryptionAes256Cbc string = "aes-256-cbc" + // IKEPolicyCreateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" + IKEPolicyCreateEncryptionAesDash256DashGcm string = "aes-256-gcm" - // IKEPolicyCreateEncryptionAes256Gcm captures enum value "aes-256-gcm" - IKEPolicyCreateEncryptionAes256Gcm string = "aes-256-gcm" + // IKEPolicyCreateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" + IKEPolicyCreateEncryptionAesDash128DashGcm string = "aes-128-gcm" - // IKEPolicyCreateEncryptionDesCbc captures enum value "des-cbc" - IKEPolicyCreateEncryptionDesCbc string = "des-cbc" + // IKEPolicyCreateEncryptionNr3desDashCbc captures enum value "3des-cbc" + IKEPolicyCreateEncryptionNr3desDashCbc string = "3des-cbc" ) // prop value enum func (m *IKEPolicyCreate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, iKEPolicyCreateTypeEncryptionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyCreateTypeEncryptionPropEnum, true); err != nil { return err } return nil @@ -200,13 +203,25 @@ func (m *IKEPolicyCreate) validateEncryption(formats strfmt.Registry) error { func (m *IKEPolicyCreate) validateKeyLifetime(formats strfmt.Registry) error { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { return err } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { + return err + } + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + return nil } @@ -216,11 +231,11 @@ func (m *IKEPolicyCreate) validateName(formats strfmt.Registry) error { return err } - if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { return err } - if err := validate.MaxLength("name", "body", string(*m.Name), 47); err != nil { + if err := validate.MaxLength("name", "body", *m.Name, 47); err != nil { return err } @@ -250,7 +265,7 @@ func init() { // prop value enum func (m *IKEPolicyCreate) validateVersionEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, iKEPolicyCreateTypeVersionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyCreateTypeVersionPropEnum, true); err != nil { return err } return nil @@ -270,6 +285,54 @@ func (m *IKEPolicyCreate) validateVersion(formats strfmt.Registry) error { return nil } +// ContextValidate validate this i k e policy create based on the context it is used +func (m *IKEPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IKEPolicyCreate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + + return nil +} + +func (m *IKEPolicyCreate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IKEPolicyCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_dh_groups.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_dh_groups.go index 9810dd56d5..a41c32d011 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_dh_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_dh_groups.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // IKEPolicyDhGroups i k e policy dh groups +// Example: [1,2,5,14,19,20,24] +// // swagger:model IKEPolicyDhGroups type IKEPolicyDhGroups []float64 @@ -17,3 +21,8 @@ type IKEPolicyDhGroups []float64 func (m IKEPolicyDhGroups) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this i k e policy dh groups based on context it is used +func (m IKEPolicyDhGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_encryptions.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_encryptions.go index 2eac04c11e..e464275379 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_encryptions.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_encryptions.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // IKEPolicyEncryptions i k e policy encryptions +// Example: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] +// // swagger:model IKEPolicyEncryptions type IKEPolicyEncryptions []string @@ -17,3 +21,8 @@ type IKEPolicyEncryptions []string func (m IKEPolicyEncryptions) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this i k e policy encryptions based on context it is used +func (m IKEPolicyEncryptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_options.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_options.go index fa8dbf50f3..20103eec80 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_options.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_options.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicyOptions i k e policy options +// // swagger:model IKEPolicyOptions type IKEPolicyOptions struct { @@ -69,6 +71,8 @@ func (m *IKEPolicyOptions) validateAuthentications(formats strfmt.Registry) erro if err := m.Authentications.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("authentications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentications") } return err } @@ -85,6 +89,8 @@ func (m *IKEPolicyOptions) validateDhGroups(formats strfmt.Registry) error { if err := m.DhGroups.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("dhGroups") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dhGroups") } return err } @@ -101,6 +107,8 @@ func (m *IKEPolicyOptions) validateEncryptions(formats strfmt.Registry) error { if err := m.Encryptions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("encryptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("encryptions") } return err } @@ -117,6 +125,90 @@ func (m *IKEPolicyOptions) validateVersions(formats strfmt.Registry) error { if err := m.Versions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("versions") + } + return err + } + + return nil +} + +// ContextValidate validate this i k e policy options based on the context it is used +func (m *IKEPolicyOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDhGroups(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEncryptions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IKEPolicyOptions) contextValidateAuthentications(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Authentications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentications") + } + return err + } + + return nil +} + +func (m *IKEPolicyOptions) contextValidateDhGroups(ctx context.Context, formats strfmt.Registry) error { + + if err := m.DhGroups.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dhGroups") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dhGroups") + } + return err + } + + return nil +} + +func (m *IKEPolicyOptions) contextValidateEncryptions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Encryptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("encryptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("encryptions") + } + return err + } + + return nil +} + +func (m *IKEPolicyOptions) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Versions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("versions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("versions") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_ref.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_ref.go index c0b3e3df1b..4efb0751f3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_ref.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_ref.go @@ -6,22 +6,26 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicyRef IKE Policy reference object +// // swagger:model IKEPolicyRef type IKEPolicyRef struct { // unique identifier of IKE Policy + // Example: 6edc8988-ab18-4b5c-b123-0d73e8254463 // Required: true ID *string `json:"id"` // name of IKE Policy + // Example: IKE Policy 1 // Required: true Name *string `json:"name"` } @@ -62,6 +66,11 @@ func (m *IKEPolicyRef) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this i k e policy ref based on context it is used +func (m *IKEPolicyRef) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *IKEPolicyRef) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_template.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_template.go index fba6a4374c..ac09368f8e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_template.go @@ -6,34 +6,40 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicyTemplate i k e policy template +// // swagger:model IKEPolicyTemplate type IKEPolicyTemplate struct { // ikePolicy Authentication default value + // Example: sha256 // Required: true Authentication *string `json:"authentication"` // ikePolicy DHGroup default value + // Example: 2 // Required: true DhGroup *int64 `json:"dhGroup"` // ikePolicy Encryption default value + // Example: aes-256-cbc // Required: true Encryption *string `json:"encryption"` // key lifetime // Required: true - KeyLifetime KeyLifetime `json:"keyLifetime"` + KeyLifetime *KeyLifetime `json:"keyLifetime"` // ikePolicy Version default value + // Example: 2 // Required: true Version *float64 `json:"version"` } @@ -97,13 +103,25 @@ func (m *IKEPolicyTemplate) validateEncryption(formats strfmt.Registry) error { func (m *IKEPolicyTemplate) validateKeyLifetime(formats strfmt.Registry) error { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { + return err + } + + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { return err } + if m.KeyLifetime != nil { + if err := m.KeyLifetime.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + return nil } @@ -116,6 +134,36 @@ func (m *IKEPolicyTemplate) validateVersion(formats strfmt.Registry) error { return nil } +// ContextValidate validate this i k e policy template based on the context it is used +func (m *IKEPolicyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IKEPolicyTemplate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IKEPolicyTemplate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go index ac8df05306..5d92a6607f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go @@ -6,16 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IKEPolicyUpdate IKE Policy object used for update +// +// Min Properties: 1 +// // swagger:model IKEPolicyUpdate type IKEPolicyUpdate struct { @@ -23,17 +26,20 @@ type IKEPolicyUpdate struct { Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` // DH group of the IKE Policy + // Example: 2 // Enum: [1 2 5 14 19 20 24] DhGroup int64 `json:"dhGroup,omitempty"` // encryption of the IKE Policy - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-256-cbc aes-256-gcm des-cbc] + // Example: aes-256-cbc + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-128-gcm 3des-cbc] Encryption string `json:"encryption,omitempty"` // key lifetime KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` // name of the IKE Policy + // Example: ikePolicy1 // Max Length: 47 // Min Length: 1 Name string `json:"name,omitempty"` @@ -42,6 +48,7 @@ type IKEPolicyUpdate struct { PresharedKey string `json:"presharedKey,omitempty"` // version of the IKE Policy + // Example: 2 // Enum: [1 2] Version int64 `json:"version,omitempty"` @@ -58,17 +65,20 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` // DH group of the IKE Policy + // Example: 2 // Enum: [1 2 5 14 19 20 24] DhGroup int64 `json:"dhGroup,omitempty"` // encryption of the IKE Policy - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-256-cbc aes-256-gcm des-cbc] + // Example: aes-256-cbc + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-128-gcm 3des-cbc] Encryption string `json:"encryption,omitempty"` // key lifetime KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` // name of the IKE Policy + // Example: ikePolicy1 // Max Length: 47 // Min Length: 1 Name string `json:"name,omitempty"` @@ -77,6 +87,7 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { PresharedKey string `json:"presharedKey,omitempty"` // version of the IKE Policy + // Example: 2 // Enum: [1 2] Version int64 `json:"version,omitempty"` } @@ -86,19 +97,12 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { var rcv IKEPolicyUpdate rcv.Authentication = stage1.Authentication - rcv.DhGroup = stage1.DhGroup - rcv.Encryption = stage1.Encryption - rcv.KeyLifetime = stage1.KeyLifetime - rcv.Name = stage1.Name - rcv.PresharedKey = stage1.PresharedKey - rcv.Version = stage1.Version - *m = rcv // stage 2, remove properties and add to map @@ -108,19 +112,12 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { } delete(stage2, "authentication") - delete(stage2, "dhGroup") - delete(stage2, "encryption") - delete(stage2, "keyLifetime") - delete(stage2, "name") - delete(stage2, "presharedKey") - delete(stage2, "version") - // stage 3, add additional properties values if len(stage2) > 0 { result := make(map[string]interface{}) @@ -145,17 +142,20 @@ func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { Authentication IKEPolicyAuthentication `json:"authentication,omitempty"` // DH group of the IKE Policy + // Example: 2 // Enum: [1 2 5 14 19 20 24] DhGroup int64 `json:"dhGroup,omitempty"` // encryption of the IKE Policy - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-256-cbc aes-256-gcm des-cbc] + // Example: aes-256-cbc + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-128-gcm 3des-cbc] Encryption string `json:"encryption,omitempty"` // key lifetime KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` // name of the IKE Policy + // Example: ikePolicy1 // Max Length: 47 // Min Length: 1 Name string `json:"name,omitempty"` @@ -164,22 +164,17 @@ func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { PresharedKey string `json:"presharedKey,omitempty"` // version of the IKE Policy + // Example: 2 // Enum: [1 2] Version int64 `json:"version,omitempty"` } stage1.Authentication = m.Authentication - stage1.DhGroup = m.DhGroup - stage1.Encryption = m.Encryption - stage1.KeyLifetime = m.KeyLifetime - stage1.Name = m.Name - stage1.PresharedKey = m.PresharedKey - stage1.Version = m.Version // make JSON object for known properties @@ -188,7 +183,7 @@ func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { return nil, err } - if len(m.IKEPolicyUpdateAdditionalProperties) == 0 { + if len(m.IKEPolicyUpdateAdditionalProperties) == 0 { // no additional properties return props, nil } @@ -198,19 +193,40 @@ func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { return nil, err } - if len(props) < 3 { + if len(props) < 3 { // "{}": only additional properties return additional, nil } // concatenate the 2 objects - props[len(props)-1] = ',' - return append(props, additional[1:]...), nil + return swag.ConcatJSON(props, additional), nil } // Validate validates this i k e policy update func (m *IKEPolicyUpdate) Validate(formats strfmt.Registry) error { var res []error + // short circuits minProperties > 0 + if m == nil { + return errors.TooFewProperties("", "body", 1) + } + + props := make(map[string]json.RawMessage, 7+10) + j, err := swag.WriteJSON(m) + if err != nil { + return err + } + + if err = swag.ReadJSON(j, &props); err != nil { + return err + } + + nprops := len(props) + + // minProperties: 1 + if nprops < 1 { + return errors.TooFewProperties("", "body", 1) + } + if err := m.validateAuthentication(formats); err != nil { res = append(res, err) } @@ -242,7 +258,6 @@ func (m *IKEPolicyUpdate) Validate(formats strfmt.Registry) error { } func (m *IKEPolicyUpdate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required return nil } @@ -250,6 +265,8 @@ func (m *IKEPolicyUpdate) validateAuthentication(formats strfmt.Registry) error if err := m.Authentication.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") } return err } @@ -271,14 +288,13 @@ func init() { // prop value enum func (m *IKEPolicyUpdate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, iKEPolicyUpdateTypeDhGroupPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyUpdateTypeDhGroupPropEnum, true); err != nil { return err } return nil } func (m *IKEPolicyUpdate) validateDhGroup(formats strfmt.Registry) error { - if swag.IsZero(m.DhGroup) { // not required return nil } @@ -295,7 +311,7 @@ var iKEPolicyUpdateTypeEncryptionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["3des-cbc","aes-128-cbc","aes-128-gcm","aes-192-cbc","aes-256-cbc","aes-256-gcm","des-cbc"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -305,38 +321,34 @@ func init() { const ( - // IKEPolicyUpdateEncryptionNr3desCbc captures enum value "3des-cbc" - IKEPolicyUpdateEncryptionNr3desCbc string = "3des-cbc" + // IKEPolicyUpdateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" + IKEPolicyUpdateEncryptionAesDash256DashCbc string = "aes-256-cbc" - // IKEPolicyUpdateEncryptionAes128Cbc captures enum value "aes-128-cbc" - IKEPolicyUpdateEncryptionAes128Cbc string = "aes-128-cbc" + // IKEPolicyUpdateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" + IKEPolicyUpdateEncryptionAesDash192DashCbc string = "aes-192-cbc" - // IKEPolicyUpdateEncryptionAes128Gcm captures enum value "aes-128-gcm" - IKEPolicyUpdateEncryptionAes128Gcm string = "aes-128-gcm" + // IKEPolicyUpdateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" + IKEPolicyUpdateEncryptionAesDash128DashCbc string = "aes-128-cbc" - // IKEPolicyUpdateEncryptionAes192Cbc captures enum value "aes-192-cbc" - IKEPolicyUpdateEncryptionAes192Cbc string = "aes-192-cbc" + // IKEPolicyUpdateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" + IKEPolicyUpdateEncryptionAesDash256DashGcm string = "aes-256-gcm" - // IKEPolicyUpdateEncryptionAes256Cbc captures enum value "aes-256-cbc" - IKEPolicyUpdateEncryptionAes256Cbc string = "aes-256-cbc" + // IKEPolicyUpdateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" + IKEPolicyUpdateEncryptionAesDash128DashGcm string = "aes-128-gcm" - // IKEPolicyUpdateEncryptionAes256Gcm captures enum value "aes-256-gcm" - IKEPolicyUpdateEncryptionAes256Gcm string = "aes-256-gcm" - - // IKEPolicyUpdateEncryptionDesCbc captures enum value "des-cbc" - IKEPolicyUpdateEncryptionDesCbc string = "des-cbc" + // IKEPolicyUpdateEncryptionNr3desDashCbc captures enum value "3des-cbc" + IKEPolicyUpdateEncryptionNr3desDashCbc string = "3des-cbc" ) // prop value enum func (m *IKEPolicyUpdate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, iKEPolicyUpdateTypeEncryptionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyUpdateTypeEncryptionPropEnum, true); err != nil { return err } return nil } func (m *IKEPolicyUpdate) validateEncryption(formats strfmt.Registry) error { - if swag.IsZero(m.Encryption) { // not required return nil } @@ -350,7 +362,6 @@ func (m *IKEPolicyUpdate) validateEncryption(formats strfmt.Registry) error { } func (m *IKEPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { - if swag.IsZero(m.KeyLifetime) { // not required return nil } @@ -358,6 +369,8 @@ func (m *IKEPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { if err := m.KeyLifetime.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") } return err } @@ -366,16 +379,15 @@ func (m *IKEPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { } func (m *IKEPolicyUpdate) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required return nil } - if err := validate.MinLength("name", "body", string(m.Name), 1); err != nil { + if err := validate.MinLength("name", "body", m.Name, 1); err != nil { return err } - if err := validate.MaxLength("name", "body", string(m.Name), 47); err != nil { + if err := validate.MaxLength("name", "body", m.Name, 47); err != nil { return err } @@ -396,14 +408,13 @@ func init() { // prop value enum func (m *IKEPolicyUpdate) validateVersionEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, iKEPolicyUpdateTypeVersionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, iKEPolicyUpdateTypeVersionPropEnum, true); err != nil { return err } return nil } func (m *IKEPolicyUpdate) validateVersion(formats strfmt.Registry) error { - if swag.IsZero(m.Version) { // not required return nil } @@ -416,6 +427,52 @@ func (m *IKEPolicyUpdate) validateVersion(formats strfmt.Registry) error { return nil } +// ContextValidate validate this i k e policy update based on the context it is used +func (m *IKEPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IKEPolicyUpdate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + + return nil +} + +func (m *IKEPolicyUpdate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *IKEPolicyUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go index 149a46a8ec..1d79e34d13 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Image image +// // swagger:model Image type Image struct { @@ -172,7 +173,6 @@ func (m *Image) validateSize(formats strfmt.Registry) error { } func (m *Image) validateSpecifications(formats strfmt.Registry) error { - if swag.IsZero(m.Specifications) { // not required return nil } @@ -181,6 +181,8 @@ func (m *Image) validateSpecifications(formats strfmt.Registry) error { if err := m.Specifications.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("specifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("specifications") } return err } @@ -208,7 +210,6 @@ func (m *Image) validateStorageType(formats strfmt.Registry) error { } func (m *Image) validateTaskref(formats strfmt.Registry) error { - if swag.IsZero(m.Taskref) { // not required return nil } @@ -217,6 +218,8 @@ func (m *Image) validateTaskref(formats strfmt.Registry) error { if err := m.Taskref.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("taskref") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("taskref") } return err } @@ -226,7 +229,6 @@ func (m *Image) validateTaskref(formats strfmt.Registry) error { } func (m *Image) validateVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.Volumes) { // not required return nil } @@ -240,6 +242,82 @@ func (m *Image) validateVolumes(formats strfmt.Registry) error { if err := m.Volumes[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this image based on the context it is used +func (m *Image) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSpecifications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTaskref(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVolumes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Image) contextValidateSpecifications(ctx context.Context, formats strfmt.Registry) error { + + if m.Specifications != nil { + if err := m.Specifications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("specifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("specifications") + } + return err + } + } + + return nil +} + +func (m *Image) contextValidateTaskref(ctx context.Context, formats strfmt.Registry) error { + + if m.Taskref != nil { + if err := m.Taskref.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taskref") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("taskref") + } + return err + } + } + + return nil +} + +func (m *Image) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Volumes); i++ { + + if m.Volumes[i] != nil { + if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go index a13618ba7a..0d1fb25dcb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ImageReference image reference +// // swagger:model ImageReference type ImageReference struct { @@ -182,6 +184,8 @@ func (m *ImageReference) validateSpecifications(formats strfmt.Registry) error { if err := m.Specifications.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("specifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("specifications") } return err } @@ -217,6 +221,36 @@ func (m *ImageReference) validateStorageType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this image reference based on the context it is used +func (m *ImageReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSpecifications(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageReference) contextValidateSpecifications(ctx context.Context, formats strfmt.Registry) error { + + if m.Specifications != nil { + if err := m.Specifications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("specifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("specifications") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go index 2f4639b57f..d5f71a0ea0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ImageSpecifications image specifications +// // swagger:model ImageSpecifications type ImageSpecifications struct { @@ -42,6 +44,11 @@ func (m *ImageSpecifications) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this image specifications based on context it is used +func (m *ImageSpecifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ImageSpecifications) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_volume.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_volume.go index f419e7a456..44e1899db8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_volume.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ImageVolume image volume +// // swagger:model ImageVolume type ImageVolume struct { @@ -96,6 +98,11 @@ func (m *ImageVolume) validateVolumeID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this image volume based on context it is used +func (m *ImageVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ImageVolume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go index 3c355c496a..b9c4473c0c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Images images +// // swagger:model Images type Images struct { @@ -53,6 +54,42 @@ func (m *Images) validateImages(formats strfmt.Registry) error { if err := m.Images[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this images based on the context it is used +func (m *Images) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Images) contextValidateImages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Images); i++ { + + if m.Images[i] != nil { + if err := m.Images[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("images" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_address_range.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_address_range.go index b4961b41bc..58cbfff918 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_address_range.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_address_range.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPAddressRange IP address range +// // swagger:model IPAddressRange type IPAddressRange struct { @@ -62,6 +64,11 @@ func (m *IPAddressRange) validateStartingIPAddress(formats strfmt.Registry) erro return nil } +// ContextValidate validates this IP address range based on context it is used +func (m *IPAddressRange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *IPAddressRange) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go index bf10e6b793..d3f704f02a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go @@ -6,28 +6,36 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // IPSECPolicyAuthentication authentication for IPSec policy +// Example: hmac-sha-256-128 +// // swagger:model IPSECPolicyAuthentication type IPSECPolicyAuthentication string -const ( +func NewIPSECPolicyAuthentication(value IPSECPolicyAuthentication) *IPSECPolicyAuthentication { + return &value +} - // IPSECPolicyAuthenticationHmacMd596 captures enum value "hmac-md5-96" - IPSECPolicyAuthenticationHmacMd596 IPSECPolicyAuthentication = "hmac-md5-96" +// Pointer returns a pointer to a freshly-allocated IPSECPolicyAuthentication. +func (m IPSECPolicyAuthentication) Pointer() *IPSECPolicyAuthentication { + return &m +} - // IPSECPolicyAuthenticationHmacSha256128 captures enum value "hmac-sha-256-128" - IPSECPolicyAuthenticationHmacSha256128 IPSECPolicyAuthentication = "hmac-sha-256-128" +const ( - // IPSECPolicyAuthenticationHmacSha196 captures enum value "hmac-sha1-96" - IPSECPolicyAuthenticationHmacSha196 IPSECPolicyAuthentication = "hmac-sha1-96" + // IPSECPolicyAuthenticationHmacDashShaDash256Dash128 captures enum value "hmac-sha-256-128" + IPSECPolicyAuthenticationHmacDashShaDash256Dash128 IPSECPolicyAuthentication = "hmac-sha-256-128" + + // IPSECPolicyAuthenticationHmacDashSha1Dash96 captures enum value "hmac-sha1-96" + IPSECPolicyAuthenticationHmacDashSha1Dash96 IPSECPolicyAuthentication = "hmac-sha1-96" // IPSECPolicyAuthenticationNone captures enum value "none" IPSECPolicyAuthenticationNone IPSECPolicyAuthentication = "none" @@ -38,7 +46,7 @@ var ipSECPolicyAuthenticationEnum []interface{} func init() { var res []IPSECPolicyAuthentication - if err := json.Unmarshal([]byte(`["hmac-md5-96","hmac-sha-256-128","hmac-sha1-96","none"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["hmac-sha-256-128","hmac-sha1-96","none"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -47,7 +55,7 @@ func init() { } func (m IPSECPolicyAuthentication) validateIPSECPolicyAuthenticationEnum(path, location string, value IPSECPolicyAuthentication) error { - if err := validate.Enum(path, location, value, ipSECPolicyAuthenticationEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSECPolicyAuthenticationEnum, true); err != nil { return err } return nil @@ -67,3 +75,8 @@ func (m IPSECPolicyAuthentication) Validate(formats strfmt.Registry) error { } return nil } + +// ContextValidate validates this IP s e c policy authentication based on context it is used +func (m IPSECPolicyAuthentication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentications.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentications.go index 0660c5a955..e7d49a6bfe 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentications.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentications.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // IPSECPolicyAuthentications IP s e c policy authentications +// Example: ["hmac-sha-256-128","hmac-sha1-96","none"] +// // swagger:model IPSECPolicyAuthentications type IPSECPolicyAuthentications []string @@ -17,3 +21,8 @@ type IPSECPolicyAuthentications []string func (m IPSECPolicyAuthentications) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this IP s e c policy authentications based on context it is used +func (m IPSECPolicyAuthentications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_dh_groups.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_dh_groups.go index 8da2cbb078..3db313e56a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_dh_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_dh_groups.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // IPSECPolicyDhGroups IP s e c policy dh groups +// Example: [1,2,5,14,19,20] +// // swagger:model IPSECPolicyDhGroups type IPSECPolicyDhGroups []float64 @@ -17,3 +21,8 @@ type IPSECPolicyDhGroups []float64 func (m IPSECPolicyDhGroups) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this IP s e c policy dh groups based on context it is used +func (m IPSECPolicyDhGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_encryptions.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_encryptions.go index ee59af70f0..be20e38f43 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_encryptions.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_encryptions.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // IPSECPolicyEncryptions IP s e c policy encryptions +// Example: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] +// // swagger:model IPSECPolicyEncryptions type IPSECPolicyEncryptions []string @@ -17,3 +21,8 @@ type IPSECPolicyEncryptions []string func (m IPSECPolicyEncryptions) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this IP s e c policy encryptions based on context it is used +func (m IPSECPolicyEncryptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go index b763d7aafa..6e0996a4a3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicies IP sec policies +// // swagger:model IPSecPolicies type IPSecPolicies struct { @@ -53,6 +54,42 @@ func (m *IPSecPolicies) validateIPSecPolicies(formats strfmt.Registry) error { if err := m.IPSecPolicies[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this IP sec policies based on the context it is used +func (m *IPSecPolicies) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIPSecPolicies(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPSecPolicies) contextValidateIPSecPolicies(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IPSecPolicies); i++ { + + if m.IPSecPolicies[i] != nil { + if err := m.IPSecPolicies[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go index e57dba8b35..d13ba5a563 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go @@ -6,46 +6,52 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicy IPSec Policy object +// // swagger:model IPSecPolicy type IPSecPolicy struct { // authentication // Required: true - Authentication IPSECPolicyAuthentication `json:"authentication"` + Authentication *IPSECPolicyAuthentication `json:"authentication"` // Diffie-Hellman group + // Example: 2 // Required: true // Enum: [1 2 5 14 19 20 24] DhGroup *int64 `json:"dhGroup"` // connection encryption policy + // Example: aes-256-cbc // Required: true - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-192-gcm aes-256-cbc aes-256-gcm des-cbc] + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-192-gcm aes-128-gcm 3des-cbc] Encryption *string `json:"encryption"` // unique identifier of the IPSec Policy + // Example: 6edc8988-eb18-4b5c-a594-0d73d8254463 // Required: true ID *string `json:"id"` // key lifetime // Required: true - KeyLifetime KeyLifetime `json:"keyLifetime"` + KeyLifetime *KeyLifetime `json:"keyLifetime"` // IPSec Policy name + // Example: ipSecPolicy2 // Required: true Name *string `json:"name"` // Perfect Forward Secrecy + // Example: true // Required: true Pfs *bool `json:"pfs"` } @@ -90,13 +96,25 @@ func (m *IPSecPolicy) Validate(formats strfmt.Registry) error { func (m *IPSecPolicy) validateAuthentication(formats strfmt.Registry) error { - if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentication") - } + if err := validate.Required("authentication", "body", m.Authentication); err != nil { + return err + } + + if err := validate.Required("authentication", "body", m.Authentication); err != nil { return err } + if m.Authentication != nil { + if err := m.Authentication.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + } + return nil } @@ -114,7 +132,7 @@ func init() { // prop value enum func (m *IPSecPolicy) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, ipSecPolicyTypeDhGroupPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSecPolicyTypeDhGroupPropEnum, true); err != nil { return err } return nil @@ -138,7 +156,7 @@ var ipSecPolicyTypeEncryptionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["3des-cbc","aes-128-cbc","aes-128-gcm","aes-192-cbc","aes-192-gcm","aes-256-cbc","aes-256-gcm","des-cbc"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -148,34 +166,31 @@ func init() { const ( - // IPSecPolicyEncryptionNr3desCbc captures enum value "3des-cbc" - IPSecPolicyEncryptionNr3desCbc string = "3des-cbc" - - // IPSecPolicyEncryptionAes128Cbc captures enum value "aes-128-cbc" - IPSecPolicyEncryptionAes128Cbc string = "aes-128-cbc" + // IPSecPolicyEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" + IPSecPolicyEncryptionAesDash256DashCbc string = "aes-256-cbc" - // IPSecPolicyEncryptionAes128Gcm captures enum value "aes-128-gcm" - IPSecPolicyEncryptionAes128Gcm string = "aes-128-gcm" + // IPSecPolicyEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" + IPSecPolicyEncryptionAesDash192DashCbc string = "aes-192-cbc" - // IPSecPolicyEncryptionAes192Cbc captures enum value "aes-192-cbc" - IPSecPolicyEncryptionAes192Cbc string = "aes-192-cbc" + // IPSecPolicyEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" + IPSecPolicyEncryptionAesDash128DashCbc string = "aes-128-cbc" - // IPSecPolicyEncryptionAes192Gcm captures enum value "aes-192-gcm" - IPSecPolicyEncryptionAes192Gcm string = "aes-192-gcm" + // IPSecPolicyEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" + IPSecPolicyEncryptionAesDash256DashGcm string = "aes-256-gcm" - // IPSecPolicyEncryptionAes256Cbc captures enum value "aes-256-cbc" - IPSecPolicyEncryptionAes256Cbc string = "aes-256-cbc" + // IPSecPolicyEncryptionAesDash192DashGcm captures enum value "aes-192-gcm" + IPSecPolicyEncryptionAesDash192DashGcm string = "aes-192-gcm" - // IPSecPolicyEncryptionAes256Gcm captures enum value "aes-256-gcm" - IPSecPolicyEncryptionAes256Gcm string = "aes-256-gcm" + // IPSecPolicyEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" + IPSecPolicyEncryptionAesDash128DashGcm string = "aes-128-gcm" - // IPSecPolicyEncryptionDesCbc captures enum value "des-cbc" - IPSecPolicyEncryptionDesCbc string = "des-cbc" + // IPSecPolicyEncryptionNr3desDashCbc captures enum value "3des-cbc" + IPSecPolicyEncryptionNr3desDashCbc string = "3des-cbc" ) // prop value enum func (m *IPSecPolicy) validateEncryptionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, ipSecPolicyTypeEncryptionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSecPolicyTypeEncryptionPropEnum, true); err != nil { return err } return nil @@ -206,13 +221,25 @@ func (m *IPSecPolicy) validateID(formats strfmt.Registry) error { func (m *IPSecPolicy) validateKeyLifetime(formats strfmt.Registry) error { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { + return err + } + + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { return err } + if m.KeyLifetime != nil { + if err := m.KeyLifetime.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + return nil } @@ -234,6 +261,56 @@ func (m *IPSecPolicy) validatePfs(formats strfmt.Registry) error { return nil } +// ContextValidate validate this IP sec policy based on the context it is used +func (m *IPSecPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPSecPolicy) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if m.Authentication != nil { + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + } + + return nil +} + +func (m *IPSecPolicy) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IPSecPolicy) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go index 61c7df1117..2dbcb92c07 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicyCreate IPSec Policy object used for creation +// // swagger:model IPSecPolicyCreate type IPSecPolicyCreate struct { @@ -23,26 +24,30 @@ type IPSecPolicyCreate struct { Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` // Diffie-Hellman group + // Example: 2 // Required: true // Enum: [1 2 5 14 19 20 24] DhGroup *int64 `json:"dhGroup"` // connection encryption policy + // Example: aes-256-cbc // Required: true - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-192-gcm aes-256-cbc aes-256-gcm des-cbc] + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-192-gcm aes-128-gcm 3des-cbc] Encryption *string `json:"encryption"` // key lifetime // Required: true - KeyLifetime KeyLifetime `json:"keyLifetime"` + KeyLifetime *KeyLifetime `json:"keyLifetime"` // IPSec Policy name + // Example: ipSecPolicy2 // Required: true // Max Length: 47 // Min Length: 1 Name *string `json:"name"` // Perfect Forward Secrecy + // Example: true // Required: true Pfs *bool `json:"pfs"` } @@ -82,7 +87,6 @@ func (m *IPSecPolicyCreate) Validate(formats strfmt.Registry) error { } func (m *IPSecPolicyCreate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required return nil } @@ -90,6 +94,8 @@ func (m *IPSecPolicyCreate) validateAuthentication(formats strfmt.Registry) erro if err := m.Authentication.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") } return err } @@ -111,7 +117,7 @@ func init() { // prop value enum func (m *IPSecPolicyCreate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, ipSecPolicyCreateTypeDhGroupPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSecPolicyCreateTypeDhGroupPropEnum, true); err != nil { return err } return nil @@ -135,7 +141,7 @@ var ipSecPolicyCreateTypeEncryptionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["3des-cbc","aes-128-cbc","aes-128-gcm","aes-192-cbc","aes-192-gcm","aes-256-cbc","aes-256-gcm","des-cbc"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -145,34 +151,31 @@ func init() { const ( - // IPSecPolicyCreateEncryptionNr3desCbc captures enum value "3des-cbc" - IPSecPolicyCreateEncryptionNr3desCbc string = "3des-cbc" - - // IPSecPolicyCreateEncryptionAes128Cbc captures enum value "aes-128-cbc" - IPSecPolicyCreateEncryptionAes128Cbc string = "aes-128-cbc" + // IPSecPolicyCreateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" + IPSecPolicyCreateEncryptionAesDash256DashCbc string = "aes-256-cbc" - // IPSecPolicyCreateEncryptionAes128Gcm captures enum value "aes-128-gcm" - IPSecPolicyCreateEncryptionAes128Gcm string = "aes-128-gcm" + // IPSecPolicyCreateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" + IPSecPolicyCreateEncryptionAesDash192DashCbc string = "aes-192-cbc" - // IPSecPolicyCreateEncryptionAes192Cbc captures enum value "aes-192-cbc" - IPSecPolicyCreateEncryptionAes192Cbc string = "aes-192-cbc" + // IPSecPolicyCreateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" + IPSecPolicyCreateEncryptionAesDash128DashCbc string = "aes-128-cbc" - // IPSecPolicyCreateEncryptionAes192Gcm captures enum value "aes-192-gcm" - IPSecPolicyCreateEncryptionAes192Gcm string = "aes-192-gcm" + // IPSecPolicyCreateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" + IPSecPolicyCreateEncryptionAesDash256DashGcm string = "aes-256-gcm" - // IPSecPolicyCreateEncryptionAes256Cbc captures enum value "aes-256-cbc" - IPSecPolicyCreateEncryptionAes256Cbc string = "aes-256-cbc" + // IPSecPolicyCreateEncryptionAesDash192DashGcm captures enum value "aes-192-gcm" + IPSecPolicyCreateEncryptionAesDash192DashGcm string = "aes-192-gcm" - // IPSecPolicyCreateEncryptionAes256Gcm captures enum value "aes-256-gcm" - IPSecPolicyCreateEncryptionAes256Gcm string = "aes-256-gcm" + // IPSecPolicyCreateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" + IPSecPolicyCreateEncryptionAesDash128DashGcm string = "aes-128-gcm" - // IPSecPolicyCreateEncryptionDesCbc captures enum value "des-cbc" - IPSecPolicyCreateEncryptionDesCbc string = "des-cbc" + // IPSecPolicyCreateEncryptionNr3desDashCbc captures enum value "3des-cbc" + IPSecPolicyCreateEncryptionNr3desDashCbc string = "3des-cbc" ) // prop value enum func (m *IPSecPolicyCreate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, ipSecPolicyCreateTypeEncryptionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSecPolicyCreateTypeEncryptionPropEnum, true); err != nil { return err } return nil @@ -194,13 +197,25 @@ func (m *IPSecPolicyCreate) validateEncryption(formats strfmt.Registry) error { func (m *IPSecPolicyCreate) validateKeyLifetime(formats strfmt.Registry) error { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { return err } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { + return err + } + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + return nil } @@ -210,11 +225,11 @@ func (m *IPSecPolicyCreate) validateName(formats strfmt.Registry) error { return err } - if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { return err } - if err := validate.MaxLength("name", "body", string(*m.Name), 47); err != nil { + if err := validate.MaxLength("name", "body", *m.Name, 47); err != nil { return err } @@ -230,6 +245,54 @@ func (m *IPSecPolicyCreate) validatePfs(formats strfmt.Registry) error { return nil } +// ContextValidate validate this IP sec policy create based on the context it is used +func (m *IPSecPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPSecPolicyCreate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + + return nil +} + +func (m *IPSecPolicyCreate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *IPSecPolicyCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_options.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_options.go index c0aa531981..07841dffc4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_options.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_options.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicyOptions IP sec policy options +// // swagger:model IPSecPolicyOptions type IPSecPolicyOptions struct { @@ -61,6 +63,8 @@ func (m *IPSecPolicyOptions) validateAuthentications(formats strfmt.Registry) er if err := m.Authentications.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("authentications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentications") } return err } @@ -77,6 +81,8 @@ func (m *IPSecPolicyOptions) validateDhGroups(formats strfmt.Registry) error { if err := m.DhGroups.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("dhGroups") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dhGroups") } return err } @@ -93,6 +99,72 @@ func (m *IPSecPolicyOptions) validateEncryptions(formats strfmt.Registry) error if err := m.Encryptions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("encryptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("encryptions") + } + return err + } + + return nil +} + +// ContextValidate validate this IP sec policy options based on the context it is used +func (m *IPSecPolicyOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDhGroups(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEncryptions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPSecPolicyOptions) contextValidateAuthentications(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Authentications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentications") + } + return err + } + + return nil +} + +func (m *IPSecPolicyOptions) contextValidateDhGroups(ctx context.Context, formats strfmt.Registry) error { + + if err := m.DhGroups.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dhGroups") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dhGroups") + } + return err + } + + return nil +} + +func (m *IPSecPolicyOptions) contextValidateEncryptions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Encryptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("encryptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("encryptions") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_ref.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_ref.go index f68ed11722..4b5a384f23 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_ref.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_ref.go @@ -6,22 +6,26 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicyRef IPSec Policy reference object +// // swagger:model IPSecPolicyRef type IPSecPolicyRef struct { // unique identifier of IPSec Policy + // Example: 7abc1234-ab18-4b5c-b123-0d73e8254463 // Required: true ID *string `json:"id"` // name of IPSec Policy + // Example: IPSec Policy 1 // Required: true Name *string `json:"name"` } @@ -62,6 +66,11 @@ func (m *IPSecPolicyRef) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this IP sec policy ref based on context it is used +func (m *IPSecPolicyRef) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *IPSecPolicyRef) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_template.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_template.go index 811a8c551d..7f8c341371 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_template.go @@ -6,32 +6,37 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicyTemplate IP sec policy template +// // swagger:model IPSecPolicyTemplate type IPSecPolicyTemplate struct { // ipSecPolicy Authentication default value + // Example: sha256 // Required: true Authentication *string `json:"authentication"` // ipSecPolicy DHGroup default value + // Example: 2 // Required: true DhGroup *int64 `json:"dhGroup"` // ipSecPolicy Encryption default value + // Example: aes-256-cbc // Required: true Encryption *string `json:"encryption"` // key lifetime // Required: true - KeyLifetime KeyLifetime `json:"keyLifetime"` + KeyLifetime *KeyLifetime `json:"keyLifetime"` } // Validate validates this IP sec policy template @@ -89,13 +94,55 @@ func (m *IPSecPolicyTemplate) validateEncryption(formats strfmt.Registry) error func (m *IPSecPolicyTemplate) validateKeyLifetime(formats strfmt.Registry) error { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { + return err + } + + if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { return err } + if m.KeyLifetime != nil { + if err := m.KeyLifetime.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + + return nil +} + +// ContextValidate validate this IP sec policy template based on the context it is used +func (m *IPSecPolicyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPSecPolicyTemplate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if m.KeyLifetime != nil { + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } + return err + } + } + return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go index 8d73c49a94..7ec614b2ba 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go @@ -6,16 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // IPSecPolicyUpdate IPSEc Policy object used for update +// +// Min Properties: 1 +// // swagger:model IPSecPolicyUpdate type IPSecPolicyUpdate struct { @@ -23,22 +26,26 @@ type IPSecPolicyUpdate struct { Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` // Diffie-Hellman group + // Example: 2 // Enum: [1 2 5 14 19 20 24] DhGroup int64 `json:"dhGroup,omitempty"` // connection encryption policy - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-192-gcm aes-256-cbc aes-256-gcm des-cbc] + // Example: aes-256-cbc + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-192-gcm aes-128-gcm 3des-cbc] Encryption string `json:"encryption,omitempty"` // key lifetime KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` // IPSec Policy name + // Example: ipSecPolicy2 // Max Length: 47 // Min Length: 1 Name string `json:"name,omitempty"` // Perfect Forward Secrecy + // Example: true Pfs *bool `json:"pfs,omitempty"` // IP sec policy update additional properties @@ -54,22 +61,26 @@ func (m *IPSecPolicyUpdate) UnmarshalJSON(data []byte) error { Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` // Diffie-Hellman group + // Example: 2 // Enum: [1 2 5 14 19 20 24] DhGroup int64 `json:"dhGroup,omitempty"` // connection encryption policy - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-192-gcm aes-256-cbc aes-256-gcm des-cbc] + // Example: aes-256-cbc + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-192-gcm aes-128-gcm 3des-cbc] Encryption string `json:"encryption,omitempty"` // key lifetime KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` // IPSec Policy name + // Example: ipSecPolicy2 // Max Length: 47 // Min Length: 1 Name string `json:"name,omitempty"` // Perfect Forward Secrecy + // Example: true Pfs *bool `json:"pfs,omitempty"` } if err := json.Unmarshal(data, &stage1); err != nil { @@ -78,17 +89,11 @@ func (m *IPSecPolicyUpdate) UnmarshalJSON(data []byte) error { var rcv IPSecPolicyUpdate rcv.Authentication = stage1.Authentication - rcv.DhGroup = stage1.DhGroup - rcv.Encryption = stage1.Encryption - rcv.KeyLifetime = stage1.KeyLifetime - rcv.Name = stage1.Name - rcv.Pfs = stage1.Pfs - *m = rcv // stage 2, remove properties and add to map @@ -98,17 +103,11 @@ func (m *IPSecPolicyUpdate) UnmarshalJSON(data []byte) error { } delete(stage2, "authentication") - delete(stage2, "dhGroup") - delete(stage2, "encryption") - delete(stage2, "keyLifetime") - delete(stage2, "name") - delete(stage2, "pfs") - // stage 3, add additional properties values if len(stage2) > 0 { result := make(map[string]interface{}) @@ -133,35 +132,34 @@ func (m IPSecPolicyUpdate) MarshalJSON() ([]byte, error) { Authentication IPSECPolicyAuthentication `json:"authentication,omitempty"` // Diffie-Hellman group + // Example: 2 // Enum: [1 2 5 14 19 20 24] DhGroup int64 `json:"dhGroup,omitempty"` // connection encryption policy - // Enum: [3des-cbc aes-128-cbc aes-128-gcm aes-192-cbc aes-192-gcm aes-256-cbc aes-256-gcm des-cbc] + // Example: aes-256-cbc + // Enum: [aes-256-cbc aes-192-cbc aes-128-cbc aes-256-gcm aes-192-gcm aes-128-gcm 3des-cbc] Encryption string `json:"encryption,omitempty"` // key lifetime KeyLifetime KeyLifetime `json:"keyLifetime,omitempty"` // IPSec Policy name + // Example: ipSecPolicy2 // Max Length: 47 // Min Length: 1 Name string `json:"name,omitempty"` // Perfect Forward Secrecy + // Example: true Pfs *bool `json:"pfs,omitempty"` } stage1.Authentication = m.Authentication - stage1.DhGroup = m.DhGroup - stage1.Encryption = m.Encryption - stage1.KeyLifetime = m.KeyLifetime - stage1.Name = m.Name - stage1.Pfs = m.Pfs // make JSON object for known properties @@ -170,7 +168,7 @@ func (m IPSecPolicyUpdate) MarshalJSON() ([]byte, error) { return nil, err } - if len(m.IPSecPolicyUpdateAdditionalProperties) == 0 { + if len(m.IPSecPolicyUpdateAdditionalProperties) == 0 { // no additional properties return props, nil } @@ -180,19 +178,40 @@ func (m IPSecPolicyUpdate) MarshalJSON() ([]byte, error) { return nil, err } - if len(props) < 3 { + if len(props) < 3 { // "{}": only additional properties return additional, nil } // concatenate the 2 objects - props[len(props)-1] = ',' - return append(props, additional[1:]...), nil + return swag.ConcatJSON(props, additional), nil } // Validate validates this IP sec policy update func (m *IPSecPolicyUpdate) Validate(formats strfmt.Registry) error { var res []error + // short circuits minProperties > 0 + if m == nil { + return errors.TooFewProperties("", "body", 1) + } + + props := make(map[string]json.RawMessage, 6+10) + j, err := swag.WriteJSON(m) + if err != nil { + return err + } + + if err = swag.ReadJSON(j, &props); err != nil { + return err + } + + nprops := len(props) + + // minProperties: 1 + if nprops < 1 { + return errors.TooFewProperties("", "body", 1) + } + if err := m.validateAuthentication(formats); err != nil { res = append(res, err) } @@ -220,7 +239,6 @@ func (m *IPSecPolicyUpdate) Validate(formats strfmt.Registry) error { } func (m *IPSecPolicyUpdate) validateAuthentication(formats strfmt.Registry) error { - if swag.IsZero(m.Authentication) { // not required return nil } @@ -228,6 +246,8 @@ func (m *IPSecPolicyUpdate) validateAuthentication(formats strfmt.Registry) erro if err := m.Authentication.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") } return err } @@ -249,14 +269,13 @@ func init() { // prop value enum func (m *IPSecPolicyUpdate) validateDhGroupEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, ipSecPolicyUpdateTypeDhGroupPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSecPolicyUpdateTypeDhGroupPropEnum, true); err != nil { return err } return nil } func (m *IPSecPolicyUpdate) validateDhGroup(formats strfmt.Registry) error { - if swag.IsZero(m.DhGroup) { // not required return nil } @@ -273,7 +292,7 @@ var ipSecPolicyUpdateTypeEncryptionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["3des-cbc","aes-128-cbc","aes-128-gcm","aes-192-cbc","aes-192-gcm","aes-256-cbc","aes-256-gcm","des-cbc"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-192-gcm","aes-128-gcm","3des-cbc"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -283,41 +302,37 @@ func init() { const ( - // IPSecPolicyUpdateEncryptionNr3desCbc captures enum value "3des-cbc" - IPSecPolicyUpdateEncryptionNr3desCbc string = "3des-cbc" - - // IPSecPolicyUpdateEncryptionAes128Cbc captures enum value "aes-128-cbc" - IPSecPolicyUpdateEncryptionAes128Cbc string = "aes-128-cbc" + // IPSecPolicyUpdateEncryptionAesDash256DashCbc captures enum value "aes-256-cbc" + IPSecPolicyUpdateEncryptionAesDash256DashCbc string = "aes-256-cbc" - // IPSecPolicyUpdateEncryptionAes128Gcm captures enum value "aes-128-gcm" - IPSecPolicyUpdateEncryptionAes128Gcm string = "aes-128-gcm" + // IPSecPolicyUpdateEncryptionAesDash192DashCbc captures enum value "aes-192-cbc" + IPSecPolicyUpdateEncryptionAesDash192DashCbc string = "aes-192-cbc" - // IPSecPolicyUpdateEncryptionAes192Cbc captures enum value "aes-192-cbc" - IPSecPolicyUpdateEncryptionAes192Cbc string = "aes-192-cbc" + // IPSecPolicyUpdateEncryptionAesDash128DashCbc captures enum value "aes-128-cbc" + IPSecPolicyUpdateEncryptionAesDash128DashCbc string = "aes-128-cbc" - // IPSecPolicyUpdateEncryptionAes192Gcm captures enum value "aes-192-gcm" - IPSecPolicyUpdateEncryptionAes192Gcm string = "aes-192-gcm" + // IPSecPolicyUpdateEncryptionAesDash256DashGcm captures enum value "aes-256-gcm" + IPSecPolicyUpdateEncryptionAesDash256DashGcm string = "aes-256-gcm" - // IPSecPolicyUpdateEncryptionAes256Cbc captures enum value "aes-256-cbc" - IPSecPolicyUpdateEncryptionAes256Cbc string = "aes-256-cbc" + // IPSecPolicyUpdateEncryptionAesDash192DashGcm captures enum value "aes-192-gcm" + IPSecPolicyUpdateEncryptionAesDash192DashGcm string = "aes-192-gcm" - // IPSecPolicyUpdateEncryptionAes256Gcm captures enum value "aes-256-gcm" - IPSecPolicyUpdateEncryptionAes256Gcm string = "aes-256-gcm" + // IPSecPolicyUpdateEncryptionAesDash128DashGcm captures enum value "aes-128-gcm" + IPSecPolicyUpdateEncryptionAesDash128DashGcm string = "aes-128-gcm" - // IPSecPolicyUpdateEncryptionDesCbc captures enum value "des-cbc" - IPSecPolicyUpdateEncryptionDesCbc string = "des-cbc" + // IPSecPolicyUpdateEncryptionNr3desDashCbc captures enum value "3des-cbc" + IPSecPolicyUpdateEncryptionNr3desDashCbc string = "3des-cbc" ) // prop value enum func (m *IPSecPolicyUpdate) validateEncryptionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, ipSecPolicyUpdateTypeEncryptionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, ipSecPolicyUpdateTypeEncryptionPropEnum, true); err != nil { return err } return nil } func (m *IPSecPolicyUpdate) validateEncryption(formats strfmt.Registry) error { - if swag.IsZero(m.Encryption) { // not required return nil } @@ -331,7 +346,6 @@ func (m *IPSecPolicyUpdate) validateEncryption(formats strfmt.Registry) error { } func (m *IPSecPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { - if swag.IsZero(m.KeyLifetime) { // not required return nil } @@ -339,6 +353,8 @@ func (m *IPSecPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { if err := m.KeyLifetime.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") } return err } @@ -347,16 +363,61 @@ func (m *IPSecPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { } func (m *IPSecPolicyUpdate) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required return nil } - if err := validate.MinLength("name", "body", string(m.Name), 1); err != nil { + if err := validate.MinLength("name", "body", m.Name, 1); err != nil { return err } - if err := validate.MaxLength("name", "body", string(m.Name), 47); err != nil { + if err := validate.MaxLength("name", "body", m.Name, 47); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this IP sec policy update based on the context it is used +func (m *IPSecPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPSecPolicyUpdate) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + + return nil +} + +func (m *IPSecPolicyUpdate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { + + if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyLifetime") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("keyLifetime") + } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go index 7b5b4fede5..fd59b76c97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Job job +// // swagger:model Job type Job struct { @@ -61,7 +63,6 @@ func (m *Job) Validate(formats strfmt.Registry) error { } func (m *Job) validateCreateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.CreateTimestamp) { // not required return nil } @@ -92,6 +93,8 @@ func (m *Job) validateOperation(formats strfmt.Registry) error { if err := m.Operation.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") } return err } @@ -110,6 +113,58 @@ func (m *Job) validateStatus(formats strfmt.Registry) error { if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// ContextValidate validate this job based on the context it is used +func (m *Job) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOperation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Job) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { + + if m.Operation != nil { + if err := m.Operation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (m *Job) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job_reference.go index fb776e5dfb..dc09f76fe8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/job_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // JobReference job reference +// // swagger:model JobReference type JobReference struct { @@ -62,6 +64,11 @@ func (m *JobReference) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this job reference based on context it is used +func (m *JobReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *JobReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go index 64c27e70b5..99fd189bf6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Jobs jobs +// // swagger:model Jobs type Jobs struct { @@ -53,6 +54,42 @@ func (m *Jobs) validateJobs(formats strfmt.Registry) error { if err := m.Jobs[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this jobs based on the context it is used +func (m *Jobs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateJobs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Jobs) contextValidateJobs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Jobs); i++ { + + if m.Jobs[i] != nil { + if err := m.Jobs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go index ea8f359bc2..9fec438a57 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // JSONSchemaObject JSON schema object +// // swagger:model JSONSchemaObject type JSONSchemaObject interface{} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/key_lifetime.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/key_lifetime.go index 8ca05e06b6..053deebb2e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/key_lifetime.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/key_lifetime.go @@ -6,13 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // KeyLifetime Policy key lifetime +// Example: 28800 +// // swagger:model KeyLifetime type KeyLifetime int64 @@ -33,3 +36,8 @@ func (m KeyLifetime) Validate(formats strfmt.Registry) error { } return nil } + +// ContextValidate validates this key lifetime based on context it is used +func (m KeyLifetime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go index 558cd5a0f4..37596b72c2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // LastOperationResource last operation resource +// // swagger:model LastOperationResource type LastOperationResource struct { @@ -68,7 +69,7 @@ const ( // prop value enum func (m *LastOperationResource) validateStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, lastOperationResourceTypeStatePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, lastOperationResourceTypeStatePropEnum, true); err != nil { return err } return nil @@ -88,6 +89,11 @@ func (m *LastOperationResource) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validates this last operation resource based on context it is used +func (m *LastOperationResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *LastOperationResource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/maximum_storage_allocation.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/maximum_storage_allocation.go index dfac4c9871..d33f36f3f5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/maximum_storage_allocation.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/maximum_storage_allocation.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // MaximumStorageAllocation Maximum storage allocation +// // swagger:model MaximumStorageAllocation type MaximumStorageAllocation struct { @@ -79,6 +81,11 @@ func (m *MaximumStorageAllocation) validateStorageType(formats strfmt.Registry) return nil } +// ContextValidate validates this maximum storage allocation based on context it is used +func (m *MaximumStorageAllocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MaximumStorageAllocation) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go index e8ddbbdc19..fcebea3ace 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // Metadata See [Service Metadata Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#service-metadata) for more details. +// // swagger:model Metadata type Metadata interface{} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/min_max_default.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/min_max_default.go index 06238e2e6a..1237d64c31 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/min_max_default.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/min_max_default.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // MinMaxDefault min max default +// // swagger:model MinMaxDefault type MinMaxDefault struct { @@ -79,6 +81,11 @@ func (m *MinMaxDefault) validateMin(formats strfmt.Registry) error { return nil } +// ContextValidate validates this min max default based on context it is used +func (m *MinMaxDefault) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MinMaxDefault) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go index 69859b1d3c..4652778773 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // MultiVolumesCreate multi volumes create +// // swagger:model MultiVolumesCreate type MultiVolumesCreate struct { @@ -98,20 +99,19 @@ const ( // MultiVolumesCreateAffinityPolicyAffinity captures enum value "affinity" MultiVolumesCreateAffinityPolicyAffinity string = "affinity" - // MultiVolumesCreateAffinityPolicyAntiAffinity captures enum value "anti-affinity" - MultiVolumesCreateAffinityPolicyAntiAffinity string = "anti-affinity" + // MultiVolumesCreateAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" + MultiVolumesCreateAffinityPolicyAntiDashAffinity string = "anti-affinity" ) // prop value enum func (m *MultiVolumesCreate) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, multiVolumesCreateTypeAffinityPolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, multiVolumesCreateTypeAffinityPolicyPropEnum, true); err != nil { return err } return nil } func (m *MultiVolumesCreate) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required return nil } @@ -142,6 +142,11 @@ func (m *MultiVolumesCreate) validateSize(formats strfmt.Registry) error { return nil } +// ContextValidate validates this multi volumes create based on context it is used +func (m *MultiVolumesCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MultiVolumesCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go index b4036d34c9..0d008cd811 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Network network +// // swagger:model Network type Network struct { @@ -134,7 +135,6 @@ func (m *Network) validateCidr(formats strfmt.Registry) error { } func (m *Network) validateCloudConnections(formats strfmt.Registry) error { - if swag.IsZero(m.CloudConnections) { // not required return nil } @@ -148,6 +148,8 @@ func (m *Network) validateCloudConnections(formats strfmt.Registry) error { if err := m.CloudConnections[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) } return err } @@ -177,6 +179,8 @@ func (m *Network) validateIPAddressMetrics(formats strfmt.Registry) error { if err := m.IPAddressMetrics.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipAddressMetrics") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressMetrics") } return err } @@ -200,6 +204,8 @@ func (m *Network) validateIPAddressRanges(formats strfmt.Registry) error { if err := m.IPAddressRanges[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } return err } @@ -238,7 +244,6 @@ func (m *Network) validateNetworkID(formats strfmt.Registry) error { } func (m *Network) validatePublicIPAddressRanges(formats strfmt.Registry) error { - if swag.IsZero(m.PublicIPAddressRanges) { // not required return nil } @@ -252,6 +257,8 @@ func (m *Network) validatePublicIPAddressRanges(formats strfmt.Registry) error { if err := m.PublicIPAddressRanges[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) } return err } @@ -279,13 +286,13 @@ const ( // NetworkTypeVlan captures enum value "vlan" NetworkTypeVlan string = "vlan" - // NetworkTypePubVlan captures enum value "pub-vlan" - NetworkTypePubVlan string = "pub-vlan" + // NetworkTypePubDashVlan captures enum value "pub-vlan" + NetworkTypePubDashVlan string = "pub-vlan" ) // prop value enum func (m *Network) validateTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, networkTypeTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, networkTypeTypePropEnum, true); err != nil { return err } return nil @@ -314,6 +321,108 @@ func (m *Network) validateVlanID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network based on the context it is used +func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCloudConnections(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIPAddressMetrics(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIPAddressRanges(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePublicIPAddressRanges(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Network) contextValidateCloudConnections(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CloudConnections); i++ { + + if m.CloudConnections[i] != nil { + if err := m.CloudConnections[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Network) contextValidateIPAddressMetrics(ctx context.Context, formats strfmt.Registry) error { + + if m.IPAddressMetrics != nil { + if err := m.IPAddressMetrics.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipAddressMetrics") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressMetrics") + } + return err + } + } + + return nil +} + +func (m *Network) contextValidateIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IPAddressRanges); i++ { + + if m.IPAddressRanges[i] != nil { + if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Network) contextValidatePublicIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PublicIPAddressRanges); i++ { + + if m.PublicIPAddressRanges[i] != nil { + if err := m.PublicIPAddressRanges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Network) MarshalBinary() ([]byte, error) { if m == nil { @@ -333,6 +442,7 @@ func (m *Network) UnmarshalBinary(b []byte) error { } // NetworkCloudConnectionsItems0 network cloud connections items0 +// // swagger:model NetworkCloudConnectionsItems0 type NetworkCloudConnectionsItems0 struct { @@ -348,6 +458,11 @@ func (m *NetworkCloudConnectionsItems0) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this network cloud connections items0 based on context it is used +func (m *NetworkCloudConnectionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkCloudConnectionsItems0) MarshalBinary() ([]byte, error) { if m == nil { @@ -367,6 +482,7 @@ func (m *NetworkCloudConnectionsItems0) UnmarshalBinary(b []byte) error { } // NetworkIPAddressMetrics IP Address Metrics +// // swagger:model NetworkIPAddressMetrics type NetworkIPAddressMetrics struct { @@ -449,6 +565,11 @@ func (m *NetworkIPAddressMetrics) validateUtilization(formats strfmt.Registry) e return nil } +// ContextValidate validates this network IP address metrics based on context it is used +func (m *NetworkIPAddressMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkIPAddressMetrics) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go index bdd9072c6d..c5a54d8f6f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // NetworkCreate network create +// // swagger:model NetworkCreate type NetworkCreate struct { @@ -63,7 +64,6 @@ func (m *NetworkCreate) Validate(formats strfmt.Registry) error { } func (m *NetworkCreate) validateIPAddressRanges(formats strfmt.Registry) error { - if swag.IsZero(m.IPAddressRanges) { // not required return nil } @@ -77,6 +77,8 @@ func (m *NetworkCreate) validateIPAddressRanges(formats strfmt.Registry) error { if err := m.IPAddressRanges[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } return err } @@ -104,13 +106,13 @@ const ( // NetworkCreateTypeVlan captures enum value "vlan" NetworkCreateTypeVlan string = "vlan" - // NetworkCreateTypePubVlan captures enum value "pub-vlan" - NetworkCreateTypePubVlan string = "pub-vlan" + // NetworkCreateTypePubDashVlan captures enum value "pub-vlan" + NetworkCreateTypePubDashVlan string = "pub-vlan" ) // prop value enum func (m *NetworkCreate) validateTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, networkCreateTypeTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, networkCreateTypeTypePropEnum, true); err != nil { return err } return nil @@ -130,6 +132,40 @@ func (m *NetworkCreate) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network create based on the context it is used +func (m *NetworkCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIPAddressRanges(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkCreate) contextValidateIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IPAddressRanges); i++ { + + if m.IPAddressRanges[i] != nil { + if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_i_ds.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_i_ds.go new file mode 100644 index 0000000000..e2ceb6fca3 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_i_ds.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NetworkIDs network i ds +// +// swagger:model NetworkIDs +type NetworkIDs struct { + + // an array of network IDs + // Example: ["7f950c76-8582-11qeb-8dcd-0242ac143","7f950c76-8582-11veb-8dcd-0242ac153","7f950c76-8582-11deb-8dcd-0242ac163"] + NetworkIDs []string `json:"networkIDs"` +} + +// Validate validates this network i ds +func (m *NetworkIDs) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this network i ds based on context it is used +func (m *NetworkIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NetworkIDs) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NetworkIDs) UnmarshalBinary(b []byte) error { + var res NetworkIDs + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_id.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_id.go index 87f86d0759..98ab9bddc1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_id.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_id.go @@ -6,18 +6,21 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // NetworkID unique identifier of a network +// // swagger:model NetworkID type NetworkID struct { // network ID + // Example: 7f950c76-8582-11qeb-8dcd-0242ac172 // Required: true NetworkID *string `json:"networkID"` } @@ -45,6 +48,11 @@ func (m *NetworkID) validateNetworkID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this network ID based on context it is used +func (m *NetworkID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkID) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ids.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ids.go deleted file mode 100644 index fe4df1a797..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ids.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/swag" -) - -// NetworkIds network ids -// swagger:model NetworkIDs -type NetworkIds struct { - - // an array of network IDs - NetworkIds []string `json:"networkIDs"` -} - -// Validate validates this network ids -func (m *NetworkIds) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NetworkIds) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NetworkIds) UnmarshalBinary(b []byte) error { - var res NetworkIds - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go index 226bb26aed..360de77afd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // NetworkPort network port +// // swagger:model NetworkPort type NetworkPort struct { @@ -118,7 +120,6 @@ func (m *NetworkPort) validatePortID(formats strfmt.Registry) error { } func (m *NetworkPort) validatePvmInstance(formats strfmt.Registry) error { - if swag.IsZero(m.PvmInstance) { // not required return nil } @@ -127,6 +128,8 @@ func (m *NetworkPort) validatePvmInstance(formats strfmt.Registry) error { if err := m.PvmInstance.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pvmInstance") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstance") } return err } @@ -144,6 +147,36 @@ func (m *NetworkPort) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this network port based on the context it is used +func (m *NetworkPort) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePvmInstance(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkPort) contextValidatePvmInstance(ctx context.Context, formats strfmt.Registry) error { + + if m.PvmInstance != nil { + if err := m.PvmInstance.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pvmInstance") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstance") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkPort) MarshalBinary() ([]byte, error) { if m == nil { @@ -163,6 +196,7 @@ func (m *NetworkPort) UnmarshalBinary(b []byte) error { } // NetworkPortPvmInstance The attached pvm-instance to this port +// // swagger:model NetworkPortPvmInstance type NetworkPortPvmInstance struct { @@ -178,6 +212,11 @@ func (m *NetworkPortPvmInstance) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this network port pvm instance based on context it is used +func (m *NetworkPortPvmInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkPortPvmInstance) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go index c477d5856d..d9c99e8516 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NetworkPortCreate network port create +// // swagger:model NetworkPortCreate type NetworkPortCreate struct { @@ -27,6 +29,11 @@ func (m *NetworkPortCreate) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this network port create based on context it is used +func (m *NetworkPortCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkPortCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_update.go index 63f0d2e779..6b438efb73 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_update.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NetworkPortUpdate network port update +// // swagger:model NetworkPortUpdate type NetworkPortUpdate struct { @@ -27,6 +29,11 @@ func (m *NetworkPortUpdate) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this network port update based on context it is used +func (m *NetworkPortUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkPortUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go index 5fe68913d0..78f26b2249 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // NetworkPorts network ports +// // swagger:model NetworkPorts type NetworkPorts struct { @@ -53,6 +54,42 @@ func (m *NetworkPorts) validatePorts(formats strfmt.Registry) error { if err := m.Ports[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this network ports based on the context it is used +func (m *NetworkPorts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePorts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkPorts) contextValidatePorts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ports); i++ { + + if m.Ports[i] != nil { + if err := m.Ports[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ports" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go index 1f455e95c8..0398445e89 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // NetworkReference network reference +// // swagger:model NetworkReference type NetworkReference struct { @@ -135,13 +136,13 @@ const ( // NetworkReferenceTypeVlan captures enum value "vlan" NetworkReferenceTypeVlan string = "vlan" - // NetworkReferenceTypePubVlan captures enum value "pub-vlan" - NetworkReferenceTypePubVlan string = "pub-vlan" + // NetworkReferenceTypePubDashVlan captures enum value "pub-vlan" + NetworkReferenceTypePubDashVlan string = "pub-vlan" ) // prop value enum func (m *NetworkReference) validateTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, networkReferenceTypeTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, networkReferenceTypeTypePropEnum, true); err != nil { return err } return nil @@ -170,6 +171,11 @@ func (m *NetworkReference) validateVlanID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this network reference based on context it is used +func (m *NetworkReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NetworkReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go index 786eff03fd..af849c4887 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NetworkUpdate network update +// // swagger:model NetworkUpdate type NetworkUpdate struct { @@ -46,7 +47,6 @@ func (m *NetworkUpdate) Validate(formats strfmt.Registry) error { } func (m *NetworkUpdate) validateIPAddressRanges(formats strfmt.Registry) error { - if swag.IsZero(m.IPAddressRanges) { // not required return nil } @@ -60,6 +60,42 @@ func (m *NetworkUpdate) validateIPAddressRanges(formats strfmt.Registry) error { if err := m.IPAddressRanges[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this network update based on the context it is used +func (m *NetworkUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIPAddressRanges(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkUpdate) contextValidateIPAddressRanges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.IPAddressRanges); i++ { + + if m.IPAddressRanges[i] != nil { + if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go index 416a86b59f..42428ee31d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Networks networks +// // swagger:model Networks type Networks struct { @@ -53,6 +54,42 @@ func (m *Networks) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this networks based on the context it is used +func (m *Networks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Networks) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go index 313a24e977..cf28d25ee3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go @@ -6,5 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command // Object object +// // swagger:model Object type Object interface{} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack.go index 5c5ba92b2e..6654773e09 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // OpenStack open stack +// // swagger:model OpenStack type OpenStack struct { @@ -113,6 +115,11 @@ func (m *OpenStack) validateRegion(formats strfmt.Registry) error { return nil } +// ContextValidate validates this open stack based on context it is used +func (m *OpenStack) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *OpenStack) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_create.go index f86cb6cc8f..9c63f292e6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_create.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // OpenStackCreate open stack create +// // swagger:model OpenStackCreate type OpenStackCreate struct { @@ -79,6 +81,11 @@ func (m *OpenStackCreate) validateRegion(formats strfmt.Registry) error { return nil } +// ContextValidate validates this open stack create based on context it is used +func (m *OpenStackCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *OpenStackCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go index 3596793128..b98ee9762c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // OpenStackInfo open stack info +// // swagger:model OpenStackInfo type OpenStackInfo struct { @@ -61,6 +62,8 @@ func (m *OpenStackInfo) validateHosts(formats strfmt.Registry) error { if err := m.Hosts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } return err } @@ -80,6 +83,40 @@ func (m *OpenStackInfo) validateRegion(formats strfmt.Registry) error { return nil } +// ContextValidate validate this open stack info based on the context it is used +func (m *OpenStackInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHosts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OpenStackInfo) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Hosts); i++ { + + if m.Hosts[i] != nil { + if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *OpenStackInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go index 701a0fce85..3b4c526548 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // OpenStacks open stacks +// // swagger:model OpenStacks type OpenStacks struct { @@ -53,6 +54,42 @@ func (m *OpenStacks) validateOpenStacks(formats strfmt.Registry) error { if err := m.OpenStacks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("openStacks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("openStacks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this open stacks based on the context it is used +func (m *OpenStacks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOpenStacks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OpenStacks) contextValidateOpenStacks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OpenStacks); i++ { + + if m.OpenStacks[i] != nil { + if err := m.OpenStacks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("openStacks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("openStacks" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operation.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operation.go index a238a97608..3423d9e7b0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operation.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operation.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Operation operation +// // swagger:model Operation type Operation struct { @@ -79,6 +81,11 @@ func (m *Operation) validateTarget(formats strfmt.Registry) error { return nil } +// ContextValidate validates this operation based on context it is used +func (m *Operation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Operation) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go index a64afc1e3e..4c2d8b0808 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Operations operations +// // swagger:model Operations type Operations struct { @@ -83,14 +84,13 @@ const ( // prop value enum func (m *Operations) validateBootModeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, operationsTypeBootModePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, operationsTypeBootModePropEnum, true); err != nil { return err } return nil } func (m *Operations) validateBootMode(formats strfmt.Registry) error { - if swag.IsZero(m.BootMode) { // not required return nil } @@ -126,14 +126,13 @@ const ( // prop value enum func (m *Operations) validateOperatingModeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, operationsTypeOperatingModePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, operationsTypeOperatingModePropEnum, true); err != nil { return err } return nil } func (m *Operations) validateOperatingMode(formats strfmt.Registry) error { - if swag.IsZero(m.OperatingMode) { // not required return nil } @@ -187,14 +186,13 @@ const ( // prop value enum func (m *Operations) validateTaskEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, operationsTypeTaskPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, operationsTypeTaskPropEnum, true); err != nil { return err } return nil } func (m *Operations) validateTask(formats strfmt.Registry) error { - if swag.IsZero(m.Task) { // not required return nil } @@ -207,6 +205,11 @@ func (m *Operations) validateTask(formats strfmt.Registry) error { return nil } +// ContextValidate validates this operations based on context it is used +func (m *Operations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Operations) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/options.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/options.go index bc50247f44..f0738536b3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/options.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/options.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Options options +// // swagger:model Options type Options struct { @@ -46,6 +48,38 @@ func (m *Options) validateVpnaasOptions(formats strfmt.Registry) error { if err := m.VpnaasOptions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vpnaasOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpnaasOptions") + } + return err + } + } + + return nil +} + +// ContextValidate validate this options based on the context it is used +func (m *Options) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVpnaasOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Options) contextValidateVpnaasOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.VpnaasOptions != nil { + if err := m.VpnaasOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpnaasOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpnaasOptions") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go index fecd20461b..3ed158c49e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // OwnerInfo owner info +// // swagger:model OwnerInfo type OwnerInfo struct { @@ -44,7 +45,7 @@ type OwnerInfo struct { Name *string `json:"name"` // (deprecated - replaced by softlayerSubscriptions) Array of Soft Layer IDs - SoftlayerIds []string `json:"softlayerIDs"` + SoftlayerIDs []string `json:"softlayerIDs"` // Array of softlayer subscriptions // Required: true @@ -166,6 +167,8 @@ func (m *OwnerInfo) validateSoftlayerSubscriptions(formats strfmt.Registry) erro if err := m.SoftlayerSubscriptions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) } return err } @@ -185,6 +188,40 @@ func (m *OwnerInfo) validateUserID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this owner info based on the context it is used +func (m *OwnerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSoftlayerSubscriptions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OwnerInfo) contextValidateSoftlayerSubscriptions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SoftlayerSubscriptions); i++ { + + if m.SoftlayerSubscriptions[i] != nil { + if err := m.SoftlayerSubscriptions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *OwnerInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go index e2816800ca..5e0a9f10e3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstance p VM instance +// // swagger:model PVMInstance type PVMInstance struct { @@ -71,7 +72,7 @@ type PVMInstance struct { // (deprecated - replaced by networks) List of Network IDs // Required: true - NetworkIds []string `json:"networkIDs"` + NetworkIDs []string `json:"networkIDs"` // The pvm instance networks information Networks []*PVMInstanceNetwork `json:"networks"` @@ -144,7 +145,7 @@ type PVMInstance struct { // List of volume IDs // Required: true - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this p VM instance @@ -183,7 +184,7 @@ func (m *PVMInstance) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateNetworkIds(formats); err != nil { + if err := m.validateNetworkIDs(formats); err != nil { res = append(res, err) } @@ -239,7 +240,7 @@ func (m *PVMInstance) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateVolumeIds(formats); err != nil { + if err := m.validateVolumeIDs(formats); err != nil { res = append(res, err) } @@ -250,7 +251,6 @@ func (m *PVMInstance) Validate(formats strfmt.Registry) error { } func (m *PVMInstance) validateAddresses(formats strfmt.Registry) error { - if swag.IsZero(m.Addresses) { // not required return nil } @@ -264,6 +264,8 @@ func (m *PVMInstance) validateAddresses(formats strfmt.Registry) error { if err := m.Addresses[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) } return err } @@ -275,7 +277,6 @@ func (m *PVMInstance) validateAddresses(formats strfmt.Registry) error { } func (m *PVMInstance) validateConsoleLanguage(formats strfmt.Registry) error { - if swag.IsZero(m.ConsoleLanguage) { // not required return nil } @@ -284,6 +285,8 @@ func (m *PVMInstance) validateConsoleLanguage(formats strfmt.Registry) error { if err := m.ConsoleLanguage.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("consoleLanguage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consoleLanguage") } return err } @@ -293,7 +296,6 @@ func (m *PVMInstance) validateConsoleLanguage(formats strfmt.Registry) error { } func (m *PVMInstance) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required return nil } @@ -315,7 +317,6 @@ func (m *PVMInstance) validateDiskSize(formats strfmt.Registry) error { } func (m *PVMInstance) validateFault(formats strfmt.Registry) error { - if swag.IsZero(m.Fault) { // not required return nil } @@ -324,6 +325,8 @@ func (m *PVMInstance) validateFault(formats strfmt.Registry) error { if err := m.Fault.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("fault") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fault") } return err } @@ -333,7 +336,6 @@ func (m *PVMInstance) validateFault(formats strfmt.Registry) error { } func (m *PVMInstance) validateHealth(formats strfmt.Registry) error { - if swag.IsZero(m.Health) { // not required return nil } @@ -342,6 +344,8 @@ func (m *PVMInstance) validateHealth(formats strfmt.Registry) error { if err := m.Health.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("health") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("health") } return err } @@ -368,9 +372,9 @@ func (m *PVMInstance) validateMemory(formats strfmt.Registry) error { return nil } -func (m *PVMInstance) validateNetworkIds(formats strfmt.Registry) error { +func (m *PVMInstance) validateNetworkIDs(formats strfmt.Registry) error { - if err := validate.Required("networkIDs", "body", m.NetworkIds); err != nil { + if err := validate.Required("networkIDs", "body", m.NetworkIDs); err != nil { return err } @@ -378,7 +382,6 @@ func (m *PVMInstance) validateNetworkIds(formats strfmt.Registry) error { } func (m *PVMInstance) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required return nil } @@ -392,6 +395,8 @@ func (m *PVMInstance) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } @@ -434,13 +439,13 @@ const ( // PVMInstanceProcTypeCapped captures enum value "capped" PVMInstanceProcTypeCapped string = "capped" - // PVMInstanceProcType captures enum value "" - PVMInstanceProcType string = "" + // PVMInstanceProcTypeEmpty captures enum value "" + PVMInstanceProcTypeEmpty string = "" ) // prop value enum func (m *PVMInstance) validateProcTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceTypeProcTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceTypeProcTypePropEnum, true); err != nil { return err } return nil @@ -479,7 +484,6 @@ func (m *PVMInstance) validatePvmInstanceID(formats strfmt.Registry) error { } func (m *PVMInstance) validateSapProfile(formats strfmt.Registry) error { - if swag.IsZero(m.SapProfile) { // not required return nil } @@ -488,6 +492,8 @@ func (m *PVMInstance) validateSapProfile(formats strfmt.Registry) error { if err := m.SapProfile.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("sapProfile") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sapProfile") } return err } @@ -506,7 +512,6 @@ func (m *PVMInstance) validateServerName(formats strfmt.Registry) error { } func (m *PVMInstance) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required return nil } @@ -515,6 +520,8 @@ func (m *PVMInstance) validateSoftwareLicenses(formats strfmt.Registry) error { if err := m.SoftwareLicenses.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") } return err } @@ -524,7 +531,6 @@ func (m *PVMInstance) validateSoftwareLicenses(formats strfmt.Registry) error { } func (m *PVMInstance) validateSrcs(formats strfmt.Registry) error { - if swag.IsZero(m.Srcs) { // not required return nil } @@ -540,6 +546,8 @@ func (m *PVMInstance) validateSrcs(formats strfmt.Registry) error { if err := m.Srcs[i][ii].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } return err } @@ -571,7 +579,6 @@ func (m *PVMInstance) validateStorageType(formats strfmt.Registry) error { } func (m *PVMInstance) validateUpdatedDate(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedDate) { // not required return nil } @@ -584,7 +591,6 @@ func (m *PVMInstance) validateUpdatedDate(formats strfmt.Registry) error { } func (m *PVMInstance) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required return nil } @@ -593,6 +599,8 @@ func (m *PVMInstance) validateVirtualCores(formats strfmt.Registry) error { if err := m.VirtualCores.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") } return err } @@ -601,15 +609,221 @@ func (m *PVMInstance) validateVirtualCores(formats strfmt.Registry) error { return nil } -func (m *PVMInstance) validateVolumeIds(formats strfmt.Registry) error { +func (m *PVMInstance) validateVolumeIDs(formats strfmt.Registry) error { - if err := validate.Required("volumeIDs", "body", m.VolumeIds); err != nil { + if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { return err } return nil } +// ContextValidate validate this p VM instance based on the context it is used +func (m *PVMInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddresses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConsoleLanguage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFault(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHealth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSapProfile(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSrcs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVirtualCores(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstance) contextValidateAddresses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Addresses); i++ { + + if m.Addresses[i] != nil { + if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PVMInstance) contextValidateConsoleLanguage(ctx context.Context, formats strfmt.Registry) error { + + if m.ConsoleLanguage != nil { + if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("consoleLanguage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consoleLanguage") + } + return err + } + } + + return nil +} + +func (m *PVMInstance) contextValidateFault(ctx context.Context, formats strfmt.Registry) error { + + if m.Fault != nil { + if err := m.Fault.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fault") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fault") + } + return err + } + } + + return nil +} + +func (m *PVMInstance) contextValidateHealth(ctx context.Context, formats strfmt.Registry) error { + + if m.Health != nil { + if err := m.Health.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("health") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("health") + } + return err + } + } + + return nil +} + +func (m *PVMInstance) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PVMInstance) contextValidateSapProfile(ctx context.Context, formats strfmt.Registry) error { + + if m.SapProfile != nil { + if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sapProfile") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sapProfile") + } + return err + } + } + + return nil +} + +func (m *PVMInstance) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { + + if m.SoftwareLicenses != nil { + if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") + } + return err + } + } + + return nil +} + +func (m *PVMInstance) contextValidateSrcs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Srcs); i++ { + + for ii := 0; ii < len(m.Srcs[i]); ii++ { + + if m.Srcs[i][ii] != nil { + if err := m.Srcs[i][ii].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) + } + return err + } + } + + } + + } + + return nil +} + +func (m *PVMInstance) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { + + if m.VirtualCores != nil { + if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstance) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go index 6a6cc66802..3c927919d6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceAction p VM instance action +// // swagger:model PVMInstanceAction type PVMInstanceAction struct { @@ -59,22 +60,22 @@ const ( // PVMInstanceActionActionStop captures enum value "stop" PVMInstanceActionActionStop string = "stop" - // PVMInstanceActionActionImmediateShutdown captures enum value "immediate-shutdown" - PVMInstanceActionActionImmediateShutdown string = "immediate-shutdown" + // PVMInstanceActionActionImmediateDashShutdown captures enum value "immediate-shutdown" + PVMInstanceActionActionImmediateDashShutdown string = "immediate-shutdown" - // PVMInstanceActionActionHardReboot captures enum value "hard-reboot" - PVMInstanceActionActionHardReboot string = "hard-reboot" + // PVMInstanceActionActionHardDashReboot captures enum value "hard-reboot" + PVMInstanceActionActionHardDashReboot string = "hard-reboot" - // PVMInstanceActionActionSoftReboot captures enum value "soft-reboot" - PVMInstanceActionActionSoftReboot string = "soft-reboot" + // PVMInstanceActionActionSoftDashReboot captures enum value "soft-reboot" + PVMInstanceActionActionSoftDashReboot string = "soft-reboot" - // PVMInstanceActionActionResetState captures enum value "reset-state" - PVMInstanceActionActionResetState string = "reset-state" + // PVMInstanceActionActionResetDashState captures enum value "reset-state" + PVMInstanceActionActionResetDashState string = "reset-state" ) // prop value enum func (m *PVMInstanceAction) validateActionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceActionTypeActionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceActionTypeActionPropEnum, true); err != nil { return err } return nil @@ -94,6 +95,11 @@ func (m *PVMInstanceAction) validateAction(formats strfmt.Registry) error { return nil } +// ContextValidate validates this p VM instance action based on context it is used +func (m *PVMInstanceAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceAction) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_add_network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_add_network.go index 8d0bc58ea6..d0c9f7569e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_add_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_add_network.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceAddNetwork p VM instance add network +// // swagger:model PVMInstanceAddNetwork type PVMInstanceAddNetwork struct { @@ -48,6 +50,11 @@ func (m *PVMInstanceAddNetwork) validateNetworkID(formats strfmt.Registry) error return nil } +// ContextValidate validates this p VM instance add network based on context it is used +func (m *PVMInstanceAddNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceAddNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_address.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_address.go index 3cff8dad50..2e7ad6b98d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_address.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_address.go @@ -6,12 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // PVMInstanceAddress deprecated - replaced by PVMInstanceNetwork +// // swagger:model PVMInstanceAddress type PVMInstanceAddress struct { PVMInstanceNetwork @@ -38,7 +41,6 @@ func (m PVMInstanceAddress) MarshalJSON() ([]byte, error) { return nil, err } _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil } @@ -47,20 +49,17 @@ func (m *PVMInstanceAddress) Validate(formats strfmt.Registry) error { return nil } -// MarshalBinary interface implementation -func (m *PVMInstanceAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil +// ContextValidate validate this p VM instance address based on the context it is used +func (m *PVMInstanceAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with PVMInstanceNetwork + if err := m.PVMInstanceNetwork.ContextValidate(ctx, formats); err != nil { + res = append(res, err) } - return swag.WriteJSON(m) -} -// UnmarshalBinary interface implementation -func (m *PVMInstanceAddress) UnmarshalBinary(b []byte) error { - var res PVMInstanceAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - *m = res return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go index c33e6451e0..7f925c28c0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceCapture p VM instance capture +// // swagger:model PVMInstanceCapture type PVMInstanceCapture struct { @@ -29,7 +30,7 @@ type PVMInstanceCapture struct { CaptureName *string `json:"captureName"` // List of Data volume IDs to include in the captured PVMInstance - CaptureVolumeIds []string `json:"captureVolumeIDs"` + CaptureVolumeIDs []string `json:"captureVolumeIDs"` // Cloud Storage Access key CloudStorageAccessKey string `json:"cloudStorageAccessKey,omitempty"` @@ -76,11 +77,11 @@ func init() { const ( - // PVMInstanceCaptureCaptureDestinationImageCatalog captures enum value "image-catalog" - PVMInstanceCaptureCaptureDestinationImageCatalog string = "image-catalog" + // PVMInstanceCaptureCaptureDestinationImageDashCatalog captures enum value "image-catalog" + PVMInstanceCaptureCaptureDestinationImageDashCatalog string = "image-catalog" - // PVMInstanceCaptureCaptureDestinationCloudStorage captures enum value "cloud-storage" - PVMInstanceCaptureCaptureDestinationCloudStorage string = "cloud-storage" + // PVMInstanceCaptureCaptureDestinationCloudDashStorage captures enum value "cloud-storage" + PVMInstanceCaptureCaptureDestinationCloudDashStorage string = "cloud-storage" // PVMInstanceCaptureCaptureDestinationBoth captures enum value "both" PVMInstanceCaptureCaptureDestinationBoth string = "both" @@ -88,7 +89,7 @@ const ( // prop value enum func (m *PVMInstanceCapture) validateCaptureDestinationEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceCaptureTypeCaptureDestinationPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceCaptureTypeCaptureDestinationPropEnum, true); err != nil { return err } return nil @@ -117,6 +118,11 @@ func (m *PVMInstanceCapture) validateCaptureName(formats strfmt.Registry) error return nil } +// ContextValidate validates this p VM instance capture based on context it is used +func (m *PVMInstanceCapture) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceCapture) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go index bad6a5beae..c517f97070 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceClone p VM instance clone +// // swagger:model PVMInstanceClone type PVMInstanceClone struct { @@ -45,7 +46,7 @@ type PVMInstanceClone struct { SoftwareLicenses *SoftwareLicenses `json:"softwareLicenses,omitempty"` // List of volume IDs - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this p VM instance clone @@ -98,6 +99,8 @@ func (m *PVMInstanceClone) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } @@ -134,14 +137,13 @@ const ( // prop value enum func (m *PVMInstanceClone) validateProcTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceCloneTypeProcTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceCloneTypeProcTypePropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceClone) validateProcType(formats strfmt.Registry) error { - if swag.IsZero(m.ProcType) { // not required return nil } @@ -155,7 +157,6 @@ func (m *PVMInstanceClone) validateProcType(formats strfmt.Registry) error { } func (m *PVMInstanceClone) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required return nil } @@ -164,6 +165,62 @@ func (m *PVMInstanceClone) validateSoftwareLicenses(formats strfmt.Registry) err if err := m.SoftwareLicenses.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") + } + return err + } + } + + return nil +} + +// ContextValidate validate this p VM instance clone based on the context it is used +func (m *PVMInstanceClone) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceClone) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PVMInstanceClone) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { + + if m.SoftwareLicenses != nil { + if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_console.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_console.go index 62face8795..0ed92109ad 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_console.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_console.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceConsole p VM instance console +// // swagger:model PVMInstanceConsole type PVMInstanceConsole struct { @@ -45,6 +47,11 @@ func (m *PVMInstanceConsole) validateConsoleURL(formats strfmt.Registry) error { return nil } +// ContextValidate validates this p VM instance console based on context it is used +func (m *PVMInstanceConsole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceConsole) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go index 41d964cb54..c5bcc1046d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceCreate p VM instance create +// // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { @@ -38,7 +39,7 @@ type PVMInstanceCreate struct { Migratable *bool `json:"migratable,omitempty"` // (deprecated - replaced by networks) List of Network IDs - NetworkIds []string `json:"networkIDs"` + NetworkIDs []string `json:"networkIDs"` // The pvm instance networks information Networks []*PVMInstanceAddNetwork `json:"networks"` @@ -99,7 +100,7 @@ type PVMInstanceCreate struct { VirtualCores *VirtualCores `json:"virtualCores,omitempty"` // List of volume IDs - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this p VM instance create @@ -183,7 +184,6 @@ func (m *PVMInstanceCreate) validateMemory(formats strfmt.Registry) error { } func (m *PVMInstanceCreate) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required return nil } @@ -197,6 +197,8 @@ func (m *PVMInstanceCreate) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } @@ -208,7 +210,6 @@ func (m *PVMInstanceCreate) validateNetworks(formats strfmt.Registry) error { } func (m *PVMInstanceCreate) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required return nil } @@ -216,6 +217,8 @@ func (m *PVMInstanceCreate) validatePinPolicy(formats strfmt.Registry) error { if err := m.PinPolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") } return err } @@ -249,7 +252,7 @@ const ( // prop value enum func (m *PVMInstanceCreate) validateProcTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceCreateTypeProcTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeProcTypePropEnum, true); err != nil { return err } return nil @@ -295,8 +298,8 @@ const ( // PVMInstanceCreateReplicantAffinityPolicyAffinity captures enum value "affinity" PVMInstanceCreateReplicantAffinityPolicyAffinity string = "affinity" - // PVMInstanceCreateReplicantAffinityPolicyAntiAffinity captures enum value "anti-affinity" - PVMInstanceCreateReplicantAffinityPolicyAntiAffinity string = "anti-affinity" + // PVMInstanceCreateReplicantAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" + PVMInstanceCreateReplicantAffinityPolicyAntiDashAffinity string = "anti-affinity" // PVMInstanceCreateReplicantAffinityPolicyNone captures enum value "none" PVMInstanceCreateReplicantAffinityPolicyNone string = "none" @@ -304,14 +307,13 @@ const ( // prop value enum func (m *PVMInstanceCreate) validateReplicantAffinityPolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceCreate) validateReplicantAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.ReplicantAffinityPolicy) { // not required return nil } @@ -347,14 +349,13 @@ const ( // prop value enum func (m *PVMInstanceCreate) validateReplicantNamingSchemeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceCreateTypeReplicantNamingSchemePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeReplicantNamingSchemePropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceCreate) validateReplicantNamingScheme(formats strfmt.Registry) error { - if swag.IsZero(m.ReplicantNamingScheme) { // not required return nil } @@ -377,7 +378,6 @@ func (m *PVMInstanceCreate) validateServerName(formats strfmt.Registry) error { } func (m *PVMInstanceCreate) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required return nil } @@ -386,6 +386,8 @@ func (m *PVMInstanceCreate) validateSoftwareLicenses(formats strfmt.Registry) er if err := m.SoftwareLicenses.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") } return err } @@ -395,7 +397,6 @@ func (m *PVMInstanceCreate) validateSoftwareLicenses(formats strfmt.Registry) er } func (m *PVMInstanceCreate) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required return nil } @@ -404,6 +405,8 @@ func (m *PVMInstanceCreate) validateStorageAffinity(formats strfmt.Registry) err if err := m.StorageAffinity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") } return err } @@ -432,14 +435,13 @@ const ( // prop value enum func (m *PVMInstanceCreate) validateStorageConnectionEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceCreateTypeStorageConnectionPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeStorageConnectionPropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceCreate) validateStorageConnection(formats strfmt.Registry) error { - if swag.IsZero(m.StorageConnection) { // not required return nil } @@ -453,7 +455,6 @@ func (m *PVMInstanceCreate) validateStorageConnection(formats strfmt.Registry) e } func (m *PVMInstanceCreate) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required return nil } @@ -462,6 +463,120 @@ func (m *PVMInstanceCreate) validateVirtualCores(formats strfmt.Registry) error if err := m.VirtualCores.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") + } + return err + } + } + + return nil +} + +// ContextValidate validate this p VM instance create based on the context it is used +func (m *PVMInstanceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePinPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVirtualCores(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceCreate) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PVMInstanceCreate) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") + } + return err + } + + return nil +} + +func (m *PVMInstanceCreate) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { + + if m.SoftwareLicenses != nil { + if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceCreate) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceCreate) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { + + if m.VirtualCores != nil { + if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_fault.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_fault.go index 0b5a25b344..bc5133e8aa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_fault.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_fault.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceFault Fault information (if occurred) +// // swagger:model PVMInstanceFault type PVMInstanceFault struct { @@ -46,7 +48,6 @@ func (m *PVMInstanceFault) Validate(formats strfmt.Registry) error { } func (m *PVMInstanceFault) validateCreated(formats strfmt.Registry) error { - if swag.IsZero(m.Created) { // not required return nil } @@ -58,6 +59,11 @@ func (m *PVMInstanceFault) validateCreated(formats strfmt.Registry) error { return nil } +// ContextValidate validates this p VM instance fault based on context it is used +func (m *PVMInstanceFault) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceFault) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_health.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_health.go index 64e5731b4f..11c21c9ab4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_health.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_health.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // PVMInstanceHealth PVM's health status details +// // swagger:model PVMInstanceHealth type PVMInstanceHealth struct { @@ -30,6 +32,11 @@ func (m *PVMInstanceHealth) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this p VM instance health based on context it is used +func (m *PVMInstanceHealth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceHealth) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go index 489e0da3bd..2345d10dd6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // PVMInstanceList A list of PVMInstances +// // swagger:model PVMInstanceList type PVMInstanceList []*PVMInstance @@ -31,6 +32,33 @@ func (m PVMInstanceList) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p VM instance list based on the context it is used +func (m PVMInstanceList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go index 800c2b900a..682af222cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceMultiCreate p VM instance multi create +// // swagger:model PVMInstanceMultiCreate type PVMInstanceMultiCreate struct { @@ -66,8 +67,8 @@ const ( // PVMInstanceMultiCreateAffinityPolicyAffinity captures enum value "affinity" PVMInstanceMultiCreateAffinityPolicyAffinity string = "affinity" - // PVMInstanceMultiCreateAffinityPolicyAntiAffinity captures enum value "anti-affinity" - PVMInstanceMultiCreateAffinityPolicyAntiAffinity string = "anti-affinity" + // PVMInstanceMultiCreateAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" + PVMInstanceMultiCreateAffinityPolicyAntiDashAffinity string = "anti-affinity" // PVMInstanceMultiCreateAffinityPolicyNone captures enum value "none" PVMInstanceMultiCreateAffinityPolicyNone string = "none" @@ -75,14 +76,13 @@ const ( // prop value enum func (m *PVMInstanceMultiCreate) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceMultiCreateTypeAffinityPolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceMultiCreateTypeAffinityPolicyPropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceMultiCreate) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required return nil } @@ -118,14 +118,13 @@ const ( // prop value enum func (m *PVMInstanceMultiCreate) validateNumericalEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceMultiCreateTypeNumericalPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceMultiCreateTypeNumericalPropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceMultiCreate) validateNumerical(formats strfmt.Registry) error { - if swag.IsZero(m.Numerical) { // not required return nil } @@ -138,6 +137,11 @@ func (m *PVMInstanceMultiCreate) validateNumerical(formats strfmt.Registry) erro return nil } +// ContextValidate validates this p VM instance multi create based on context it is used +func (m *PVMInstanceMultiCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceMultiCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_network.go index 5a9dfa189d..94e6426411 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_network.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // PVMInstanceNetwork A map containing information about a network address +// // swagger:model PVMInstanceNetwork type PVMInstanceNetwork struct { @@ -48,6 +50,11 @@ func (m *PVMInstanceNetwork) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this p VM instance network based on context it is used +func (m *PVMInstanceNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go index 4ed2e3cf5a..e511b64dfc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceNetworks p VM instance networks +// // swagger:model PVMInstanceNetworks type PVMInstanceNetworks struct { @@ -53,6 +54,42 @@ func (m *PVMInstanceNetworks) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this p VM instance networks based on the context it is used +func (m *PVMInstanceNetworks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceNetworks) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go index fe752989ad..f9c202e542 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceOperation p VM instance operation +// // swagger:model PVMInstanceOperation type PVMInstanceOperation struct { @@ -57,6 +58,8 @@ func (m *PVMInstanceOperation) validateOperation(formats strfmt.Registry) error if err := m.Operation.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") } return err } @@ -88,7 +91,7 @@ const ( // prop value enum func (m *PVMInstanceOperation) validateOperationTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceOperationTypeOperationTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceOperationTypeOperationTypePropEnum, true); err != nil { return err } return nil @@ -108,6 +111,36 @@ func (m *PVMInstanceOperation) validateOperationType(formats strfmt.Registry) er return nil } +// ContextValidate validate this p VM instance operation based on the context it is used +func (m *PVMInstanceOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOperation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceOperation) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { + + if m.Operation != nil { + if err := m.Operation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceOperation) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go index b87b28b048..33303e9d9c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceReference p VM instance reference +// // swagger:model PVMInstanceReference type PVMInstanceReference struct { @@ -234,7 +235,6 @@ func (m *PVMInstanceReference) Validate(formats strfmt.Registry) error { } func (m *PVMInstanceReference) validateAddresses(formats strfmt.Registry) error { - if swag.IsZero(m.Addresses) { // not required return nil } @@ -248,6 +248,8 @@ func (m *PVMInstanceReference) validateAddresses(formats strfmt.Registry) error if err := m.Addresses[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) } return err } @@ -259,7 +261,6 @@ func (m *PVMInstanceReference) validateAddresses(formats strfmt.Registry) error } func (m *PVMInstanceReference) validateConsoleLanguage(formats strfmt.Registry) error { - if swag.IsZero(m.ConsoleLanguage) { // not required return nil } @@ -268,6 +269,8 @@ func (m *PVMInstanceReference) validateConsoleLanguage(formats strfmt.Registry) if err := m.ConsoleLanguage.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("consoleLanguage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consoleLanguage") } return err } @@ -277,7 +280,6 @@ func (m *PVMInstanceReference) validateConsoleLanguage(formats strfmt.Registry) } func (m *PVMInstanceReference) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required return nil } @@ -299,7 +301,6 @@ func (m *PVMInstanceReference) validateDiskSize(formats strfmt.Registry) error { } func (m *PVMInstanceReference) validateFault(formats strfmt.Registry) error { - if swag.IsZero(m.Fault) { // not required return nil } @@ -308,6 +309,8 @@ func (m *PVMInstanceReference) validateFault(formats strfmt.Registry) error { if err := m.Fault.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("fault") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fault") } return err } @@ -317,7 +320,6 @@ func (m *PVMInstanceReference) validateFault(formats strfmt.Registry) error { } func (m *PVMInstanceReference) validateHealth(formats strfmt.Registry) error { - if swag.IsZero(m.Health) { // not required return nil } @@ -326,6 +328,8 @@ func (m *PVMInstanceReference) validateHealth(formats strfmt.Registry) error { if err := m.Health.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("health") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("health") } return err } @@ -362,7 +366,6 @@ func (m *PVMInstanceReference) validateMemory(formats strfmt.Registry) error { } func (m *PVMInstanceReference) validateNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.Networks) { // not required return nil } @@ -376,6 +379,8 @@ func (m *PVMInstanceReference) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } @@ -421,7 +426,7 @@ const ( // prop value enum func (m *PVMInstanceReference) validateProcTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceReferenceTypeProcTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceReferenceTypeProcTypePropEnum, true); err != nil { return err } return nil @@ -460,7 +465,6 @@ func (m *PVMInstanceReference) validatePvmInstanceID(formats strfmt.Registry) er } func (m *PVMInstanceReference) validateSapProfile(formats strfmt.Registry) error { - if swag.IsZero(m.SapProfile) { // not required return nil } @@ -469,6 +473,8 @@ func (m *PVMInstanceReference) validateSapProfile(formats strfmt.Registry) error if err := m.SapProfile.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("sapProfile") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sapProfile") } return err } @@ -487,7 +493,6 @@ func (m *PVMInstanceReference) validateServerName(formats strfmt.Registry) error } func (m *PVMInstanceReference) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required return nil } @@ -496,6 +501,8 @@ func (m *PVMInstanceReference) validateSoftwareLicenses(formats strfmt.Registry) if err := m.SoftwareLicenses.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") } return err } @@ -505,7 +512,6 @@ func (m *PVMInstanceReference) validateSoftwareLicenses(formats strfmt.Registry) } func (m *PVMInstanceReference) validateSrcs(formats strfmt.Registry) error { - if swag.IsZero(m.Srcs) { // not required return nil } @@ -521,6 +527,8 @@ func (m *PVMInstanceReference) validateSrcs(formats strfmt.Registry) error { if err := m.Srcs[i][ii].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } return err } @@ -543,7 +551,6 @@ func (m *PVMInstanceReference) validateStatus(formats strfmt.Registry) error { } func (m *PVMInstanceReference) validateUpdatedDate(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedDate) { // not required return nil } @@ -556,7 +563,6 @@ func (m *PVMInstanceReference) validateUpdatedDate(formats strfmt.Registry) erro } func (m *PVMInstanceReference) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required return nil } @@ -565,6 +571,214 @@ func (m *PVMInstanceReference) validateVirtualCores(formats strfmt.Registry) err if err := m.VirtualCores.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") + } + return err + } + } + + return nil +} + +// ContextValidate validate this p VM instance reference based on the context it is used +func (m *PVMInstanceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddresses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConsoleLanguage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFault(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHealth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSapProfile(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSrcs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVirtualCores(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceReference) contextValidateAddresses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Addresses); i++ { + + if m.Addresses[i] != nil { + if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateConsoleLanguage(ctx context.Context, formats strfmt.Registry) error { + + if m.ConsoleLanguage != nil { + if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("consoleLanguage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("consoleLanguage") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateFault(ctx context.Context, formats strfmt.Registry) error { + + if m.Fault != nil { + if err := m.Fault.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fault") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fault") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateHealth(ctx context.Context, formats strfmt.Registry) error { + + if m.Health != nil { + if err := m.Health.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("health") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("health") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateSapProfile(ctx context.Context, formats strfmt.Registry) error { + + if m.SapProfile != nil { + if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sapProfile") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sapProfile") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { + + if m.SoftwareLicenses != nil { + if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateSrcs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Srcs); i++ { + + for ii := 0; ii < len(m.Srcs[i]); ii++ { + + if m.Srcs[i][ii] != nil { + if err := m.Srcs[i][ii].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) + } + return err + } + } + + } + + } + + return nil +} + +func (m *PVMInstanceReference) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { + + if m.VirtualCores != nil { + if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_remove_network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_remove_network.go index 1d6dc39fba..937e609dec 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_remove_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_remove_network.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // PVMInstanceRemoveNetwork p VM instance remove network +// // swagger:model PVMInstanceRemoveNetwork type PVMInstanceRemoveNetwork struct { @@ -24,6 +26,11 @@ func (m *PVMInstanceRemoveNetwork) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this p VM instance remove network based on context it is used +func (m *PVMInstanceRemoveNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceRemoveNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go index 4a9cbfd6b0..89cb778882 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceUpdate p VM instance update +// // swagger:model PVMInstanceUpdate type PVMInstanceUpdate struct { @@ -81,7 +82,6 @@ func (m *PVMInstanceUpdate) Validate(formats strfmt.Registry) error { } func (m *PVMInstanceUpdate) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required return nil } @@ -89,6 +89,8 @@ func (m *PVMInstanceUpdate) validatePinPolicy(formats strfmt.Registry) error { if err := m.PinPolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") } return err } @@ -122,14 +124,13 @@ const ( // prop value enum func (m *PVMInstanceUpdate) validateProcTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceUpdateTypeProcTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceUpdateTypeProcTypePropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceUpdate) validateProcType(formats strfmt.Registry) error { - if swag.IsZero(m.ProcType) { // not required return nil } @@ -143,7 +144,6 @@ func (m *PVMInstanceUpdate) validateProcType(formats strfmt.Registry) error { } func (m *PVMInstanceUpdate) validateSoftwareLicenses(formats strfmt.Registry) error { - if swag.IsZero(m.SoftwareLicenses) { // not required return nil } @@ -152,6 +152,8 @@ func (m *PVMInstanceUpdate) validateSoftwareLicenses(formats strfmt.Registry) er if err := m.SoftwareLicenses.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") } return err } @@ -161,7 +163,6 @@ func (m *PVMInstanceUpdate) validateSoftwareLicenses(formats strfmt.Registry) er } func (m *PVMInstanceUpdate) validateVirtualCores(formats strfmt.Registry) error { - if swag.IsZero(m.VirtualCores) { // not required return nil } @@ -170,6 +171,76 @@ func (m *PVMInstanceUpdate) validateVirtualCores(formats strfmt.Registry) error if err := m.VirtualCores.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") + } + return err + } + } + + return nil +} + +// ContextValidate validate this p VM instance update based on the context it is used +func (m *PVMInstanceUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePinPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSoftwareLicenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVirtualCores(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceUpdate) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") + } + return err + } + + return nil +} + +func (m *PVMInstanceUpdate) contextValidateSoftwareLicenses(ctx context.Context, formats strfmt.Registry) error { + + if m.SoftwareLicenses != nil { + if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("softwareLicenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("softwareLicenses") + } + return err + } + } + + return nil +} + +func (m *PVMInstanceUpdate) contextValidateVirtualCores(ctx context.Context, formats strfmt.Registry) error { + + if m.VirtualCores != nil { + if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualCores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtualCores") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go index 029f7f1bc2..5f19935c50 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceUpdateResponse p VM instance update response +// // swagger:model PVMInstanceUpdateResponse type PVMInstanceUpdateResponse struct { @@ -61,7 +62,6 @@ func (m *PVMInstanceUpdateResponse) Validate(formats strfmt.Registry) error { } func (m *PVMInstanceUpdateResponse) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required return nil } @@ -69,6 +69,8 @@ func (m *PVMInstanceUpdateResponse) validatePinPolicy(formats strfmt.Registry) e if err := m.PinPolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") } return err } @@ -102,14 +104,13 @@ const ( // prop value enum func (m *PVMInstanceUpdateResponse) validateProcTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, pVmInstanceUpdateResponseTypeProcTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, pVmInstanceUpdateResponseTypeProcTypePropEnum, true); err != nil { return err } return nil } func (m *PVMInstanceUpdateResponse) validateProcType(formats strfmt.Registry) error { - if swag.IsZero(m.ProcType) { // not required return nil } @@ -122,6 +123,34 @@ func (m *PVMInstanceUpdateResponse) validateProcType(formats strfmt.Registry) er return nil } +// ContextValidate validate this p VM instance update response based on the context it is used +func (m *PVMInstanceUpdateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePinPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstanceUpdateResponse) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceUpdateResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_volume_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_volume_update.go index e21263c5e2..d3ab5a7cc4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_volume_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_volume_update.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstanceVolumeUpdate p VM instance volume update +// // swagger:model PVMInstanceVolumeUpdate type PVMInstanceVolumeUpdate struct { @@ -45,6 +47,11 @@ func (m *PVMInstanceVolumeUpdate) validateDeleteOnTermination(formats strfmt.Reg return nil } +// ContextValidate validates this p VM instance volume update based on context it is used +func (m *PVMInstanceVolumeUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceVolumeUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go index 88eed70bbf..c535bc5fb0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PVMInstances p VM instances +// // swagger:model PVMInstances type PVMInstances struct { @@ -53,6 +54,42 @@ func (m *PVMInstances) validatePvmInstances(formats strfmt.Registry) error { if err := m.PvmInstances[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this p VM instances based on the context it is used +func (m *PVMInstances) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePvmInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PVMInstances) contextValidatePvmInstances(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PvmInstances); i++ { + + if m.PvmInstances[i] != nil { + if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_gateway_address.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_gateway_address.go index 323a8dc5e5..1a060a6365 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_gateway_address.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_gateway_address.go @@ -6,13 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // PeerGatewayAddress IP address of the Peer Gateway attached to this VPNConnection +// Example: 192.168.1.1 +// // swagger:model PeerGatewayAddress type PeerGatewayAddress strfmt.IPv4 @@ -29,3 +32,8 @@ func (m PeerGatewayAddress) Validate(formats strfmt.Registry) error { } return nil } + +// ContextValidate validates this peer gateway address based on context it is used +func (m PeerGatewayAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnet_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnet_update.go index 84c6dfe895..863dd97472 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnet_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnet_update.go @@ -6,18 +6,21 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PeerSubnetUpdate CIDR of peer subnet to attach/detach +// // swagger:model PeerSubnetUpdate type PeerSubnetUpdate struct { // cidr + // Example: 128.170.1.0/32 // Required: true Cidr *string `json:"cidr"` } @@ -45,6 +48,11 @@ func (m *PeerSubnetUpdate) validateCidr(formats strfmt.Registry) error { return nil } +// ContextValidate validates this peer subnet update based on context it is used +func (m *PeerSubnetUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PeerSubnetUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnets.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnets.go index f2f2cafdfb..42c108d628 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnets.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_subnets.go @@ -6,16 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // PeerSubnets peer subnets +// // swagger:model PeerSubnets type PeerSubnets struct { // an array of strings containing CIDR of peer subnets + // Example: ["128.170.1.0/20","128.169.1.0/24","128.168.1.0/27","128.170.1.0/32"] PeerSubnets []string `json:"peerSubnets"` } @@ -24,6 +27,11 @@ func (m *PeerSubnets) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this peer subnets based on context it is used +func (m *PeerSubnets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PeerSubnets) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peering_network.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peering_network.go index 4b77e77702..9530fe1748 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peering_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/peering_network.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PeeringNetwork peering network +// // swagger:model PeeringNetwork type PeeringNetwork struct { @@ -65,6 +67,11 @@ func (m *PeeringNetwork) validateProjectName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this peering network based on context it is used +func (m *PeeringNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PeeringNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go index b3493ba53a..9a1f4e4526 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go @@ -6,18 +6,28 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // PinPolicy Specify PVM pin policy +// // swagger:model PinPolicy type PinPolicy string +func NewPinPolicy(value PinPolicy) *PinPolicy { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PinPolicy. +func (m PinPolicy) Pointer() *PinPolicy { + return &m +} + const ( // PinPolicyNone captures enum value "none" @@ -44,7 +54,7 @@ func init() { } func (m PinPolicy) validatePinPolicyEnum(path, location string, value PinPolicy) error { - if err := validate.Enum(path, location, value, pinPolicyEnum); err != nil { + if err := validate.EnumCase(path, location, value, pinPolicyEnum, true); err != nil { return err } return nil @@ -64,3 +74,8 @@ func (m PinPolicy) Validate(formats strfmt.Registry) error { } return nil } + +// ContextValidate validates this pin policy based on context it is used +func (m PinPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go index dcd75772a5..31661603fa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PlacementGroup placement group +// // swagger:model PlacementGroup type PlacementGroup struct { @@ -107,13 +108,13 @@ const ( // PlacementGroupPolicyAffinity captures enum value "affinity" PlacementGroupPolicyAffinity string = "affinity" - // PlacementGroupPolicyAntiAffinity captures enum value "anti-affinity" - PlacementGroupPolicyAntiAffinity string = "anti-affinity" + // PlacementGroupPolicyAntiDashAffinity captures enum value "anti-affinity" + PlacementGroupPolicyAntiDashAffinity string = "anti-affinity" ) // prop value enum func (m *PlacementGroup) validatePolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, placementGroupTypePolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, placementGroupTypePolicyPropEnum, true); err != nil { return err } return nil @@ -133,6 +134,11 @@ func (m *PlacementGroup) validatePolicy(formats strfmt.Registry) error { return nil } +// ContextValidate validates this placement group based on context it is used +func (m *PlacementGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PlacementGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go index 64004b1031..2fd3d083d7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PlacementGroupCreate placement group create +// // swagger:model PlacementGroupCreate type PlacementGroupCreate struct { @@ -73,13 +74,13 @@ const ( // PlacementGroupCreatePolicyAffinity captures enum value "affinity" PlacementGroupCreatePolicyAffinity string = "affinity" - // PlacementGroupCreatePolicyAntiAffinity captures enum value "anti-affinity" - PlacementGroupCreatePolicyAntiAffinity string = "anti-affinity" + // PlacementGroupCreatePolicyAntiDashAffinity captures enum value "anti-affinity" + PlacementGroupCreatePolicyAntiDashAffinity string = "anti-affinity" ) // prop value enum func (m *PlacementGroupCreate) validatePolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, placementGroupCreateTypePolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, placementGroupCreateTypePolicyPropEnum, true); err != nil { return err } return nil @@ -99,6 +100,11 @@ func (m *PlacementGroupCreate) validatePolicy(formats strfmt.Registry) error { return nil } +// ContextValidate validates this placement group create based on context it is used +func (m *PlacementGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PlacementGroupCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go index f134695021..73d29188fd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_server.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PlacementGroupServer placement group server +// // swagger:model PlacementGroupServer type PlacementGroupServer struct { @@ -45,6 +47,11 @@ func (m *PlacementGroupServer) validateID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this placement group server based on context it is used +func (m *PlacementGroupServer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PlacementGroupServer) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go index 0e6ec690c9..9c033b6937 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // PlacementGroups placement groups +// // swagger:model PlacementGroups type PlacementGroups struct { @@ -53,6 +54,42 @@ func (m *PlacementGroups) validatePlacementGroups(formats strfmt.Registry) error if err := m.PlacementGroups[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("placementGroups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this placement groups based on the context it is used +func (m *PlacementGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePlacementGroups(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PlacementGroups) contextValidatePlacementGroups(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PlacementGroups); i++ { + + if m.PlacementGroups[i] != nil { + if err := m.PlacementGroups[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("placementGroups" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go index 7b38a50746..8a3eb9c461 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Plan plan +// // swagger:model Plan type Plan struct { @@ -96,7 +98,6 @@ func (m *Plan) validateName(formats strfmt.Registry) error { } func (m *Plan) validateSchemas(formats strfmt.Registry) error { - if swag.IsZero(m.Schemas) { // not required return nil } @@ -105,6 +106,38 @@ func (m *Plan) validateSchemas(formats strfmt.Registry) error { if err := m.Schemas.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("schemas") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("schemas") + } + return err + } + } + + return nil +} + +// ContextValidate validate this plan based on the context it is used +func (m *Plan) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSchemas(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Plan) contextValidateSchemas(ctx context.Context, formats strfmt.Registry) error { + + if m.Schemas != nil { + if err := m.Schemas.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schemas") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("schemas") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/policy_versions.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/policy_versions.go index 12821b6840..fa426855a9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/policy_versions.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/policy_versions.go @@ -6,10 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + + "github.com/go-openapi/strfmt" ) // PolicyVersions policy versions +// Example: [1,2] +// // swagger:model PolicyVersions type PolicyVersions []float64 @@ -17,3 +21,8 @@ type PolicyVersions []float64 func (m PolicyVersions) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this policy versions based on context it is used +func (m PolicyVersions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go index b5a50ef443..768bc4b51f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // RegionStorageTypes An array of of storage types supported in a region +// // swagger:model RegionStorageTypes type RegionStorageTypes []*StorageType @@ -31,6 +32,33 @@ func (m RegionStorageTypes) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this region storage types based on the context it is used +func (m RegionStorageTypes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go index bcae1dbdd4..b03b60f7d4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SAPCreate s a p create +// // swagger:model SAPCreate type SAPCreate struct { @@ -37,6 +38,9 @@ type SAPCreate struct { // pin policy PinPolicy PinPolicy `json:"pinPolicy,omitempty"` + // The placement group for the server + PlacementGroup string `json:"placementGroup,omitempty"` + // SAP Profile ID for the amount of cores and memory // Required: true ProfileID *string `json:"profileID"` @@ -53,11 +57,14 @@ type SAPCreate struct { // Storage type for server deployment; will be ignored if storagePool or storageAffinity is provided; Only valid when you deploy one of the IBM supplied stock images. Storage type and pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage type and pool the image was created in StorageType string `json:"storageType,omitempty"` + // System type used to host the instance. Only e880, e980, e1080 are supported + SysType string `json:"sysType,omitempty"` + // Cloud init user defined data UserData string `json:"userData,omitempty"` // List of Volume IDs to attach to the pvm-instance on creation - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this s a p create @@ -108,7 +115,6 @@ func (m *SAPCreate) validateImageID(formats strfmt.Registry) error { } func (m *SAPCreate) validateInstances(formats strfmt.Registry) error { - if swag.IsZero(m.Instances) { // not required return nil } @@ -117,6 +123,8 @@ func (m *SAPCreate) validateInstances(formats strfmt.Registry) error { if err := m.Instances.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("instances") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("instances") } return err } @@ -149,6 +157,8 @@ func (m *SAPCreate) validateNetworks(formats strfmt.Registry) error { if err := m.Networks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } return err } @@ -160,7 +170,6 @@ func (m *SAPCreate) validateNetworks(formats strfmt.Registry) error { } func (m *SAPCreate) validatePinPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.PinPolicy) { // not required return nil } @@ -168,6 +177,8 @@ func (m *SAPCreate) validatePinPolicy(formats strfmt.Registry) error { if err := m.PinPolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") } return err } @@ -185,7 +196,6 @@ func (m *SAPCreate) validateProfileID(formats strfmt.Registry) error { } func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageAffinity) { // not required return nil } @@ -194,6 +204,100 @@ func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { if err := m.StorageAffinity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") + } + return err + } + } + + return nil +} + +// ContextValidate validate this s a p create based on the context it is used +func (m *SAPCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePinPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SAPCreate) contextValidateInstances(ctx context.Context, formats strfmt.Registry) error { + + if m.Instances != nil { + if err := m.Instances.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("instances") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("instances") + } + return err + } + } + + return nil +} + +func (m *SAPCreate) contextValidateNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Networks); i++ { + + if m.Networks[i] != nil { + if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("networks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("networks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SAPCreate) contextValidatePinPolicy(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pinPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pinPolicy") + } + return err + } + + return nil +} + +func (m *SAPCreate) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageAffinity != nil { + if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageAffinity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageAffinity") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go index e05cd737e5..73096fa60e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SAPProfile s a p profile +// // swagger:model SAPProfile type SAPProfile struct { @@ -130,16 +131,16 @@ const ( // SAPProfileTypeMemory captures enum value "memory" SAPProfileTypeMemory string = "memory" - // SAPProfileTypeNonProduction captures enum value "non-production" - SAPProfileTypeNonProduction string = "non-production" + // SAPProfileTypeNonDashProduction captures enum value "non-production" + SAPProfileTypeNonDashProduction string = "non-production" - // SAPProfileTypeUltraMemory captures enum value "ultra-memory" - SAPProfileTypeUltraMemory string = "ultra-memory" + // SAPProfileTypeUltraDashMemory captures enum value "ultra-memory" + SAPProfileTypeUltraDashMemory string = "ultra-memory" ) // prop value enum func (m *SAPProfile) validateTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, sAPProfileTypeTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, sAPProfileTypeTypePropEnum, true); err != nil { return err } return nil @@ -159,6 +160,11 @@ func (m *SAPProfile) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this s a p profile based on context it is used +func (m *SAPProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SAPProfile) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile_reference.go index e12750c369..9f7cd91f54 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SAPProfileReference s a p profile reference +// // swagger:model SAPProfileReference type SAPProfileReference struct { @@ -62,6 +64,11 @@ func (m *SAPProfileReference) validateProfileID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this s a p profile reference based on context it is used +func (m *SAPProfileReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SAPProfileReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go index 3fd70e4628..02c67b962e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SAPProfiles s a p profiles +// // swagger:model SAPProfiles type SAPProfiles struct { @@ -53,6 +54,42 @@ func (m *SAPProfiles) validateProfiles(formats strfmt.Registry) error { if err := m.Profiles[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("profiles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("profiles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this s a p profiles based on the context it is used +func (m *SAPProfiles) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateProfiles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SAPProfiles) contextValidateProfiles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Profiles); i++ { + + if m.Profiles[i] != nil { + if err := m.Profiles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("profiles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("profiles" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_r_c.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_r_c.go index 3f54a518eb..e9d191fa7a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_r_c.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_r_c.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SRC s r c +// // swagger:model SRC type SRC struct { @@ -27,6 +29,11 @@ func (m *SRC) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this s r c based on context it is used +func (m *SRC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SRC) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schema_parameters.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schema_parameters.go index e464790b4b..118c6b0f97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schema_parameters.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schema_parameters.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SchemaParameters schema parameters +// // swagger:model SchemaParameters type SchemaParameters struct { @@ -24,6 +26,11 @@ func (m *SchemaParameters) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this schema parameters based on context it is used +func (m *SchemaParameters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SchemaParameters) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go index 0900d82bfd..1f7ce4efe2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SchemasObject schemas object +// // swagger:model SchemasObject type SchemasObject struct { @@ -42,7 +44,6 @@ func (m *SchemasObject) Validate(formats strfmt.Registry) error { } func (m *SchemasObject) validateServiceBinding(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceBinding) { // not required return nil } @@ -51,6 +52,8 @@ func (m *SchemasObject) validateServiceBinding(formats strfmt.Registry) error { if err := m.ServiceBinding.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("service_binding") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_binding") } return err } @@ -60,7 +63,6 @@ func (m *SchemasObject) validateServiceBinding(formats strfmt.Registry) error { } func (m *SchemasObject) validateServiceInstance(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceInstance) { // not required return nil } @@ -69,6 +71,58 @@ func (m *SchemasObject) validateServiceInstance(formats strfmt.Registry) error { if err := m.ServiceInstance.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("service_instance") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_instance") + } + return err + } + } + + return nil +} + +// ContextValidate validate this schemas object based on the context it is used +func (m *SchemasObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceBinding(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceInstance(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SchemasObject) contextValidateServiceBinding(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceBinding != nil { + if err := m.ServiceBinding.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_binding") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_binding") + } + return err + } + } + + return nil +} + +func (m *SchemasObject) contextValidateServiceInstance(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceInstance != nil { + if err := m.ServiceInstance.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_instance") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_instance") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go index 51d719f673..8df437e38b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go @@ -6,17 +6,18 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Service service +// // swagger:model Service type Service struct { @@ -116,7 +117,6 @@ func (m *Service) validateBindable(formats strfmt.Registry) error { } func (m *Service) validateDashboardClient(formats strfmt.Registry) error { - if swag.IsZero(m.DashboardClient) { // not required return nil } @@ -125,6 +125,8 @@ func (m *Service) validateDashboardClient(formats strfmt.Registry) error { if err := m.DashboardClient.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("dashboard_client") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dashboard_client") } return err } @@ -175,6 +177,8 @@ func (m *Service) validatePlans(formats strfmt.Registry) error { if err := m.Plans[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("plans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("plans" + "." + strconv.Itoa(i)) } return err } @@ -198,14 +202,13 @@ func init() { } func (m *Service) validateRequiresItemsEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, serviceRequiresItemsEnum); err != nil { + if err := validate.EnumCase(path, location, value, serviceRequiresItemsEnum, true); err != nil { return err } return nil } func (m *Service) validateRequires(formats strfmt.Registry) error { - if swag.IsZero(m.Requires) { // not required return nil } @@ -222,6 +225,60 @@ func (m *Service) validateRequires(formats strfmt.Registry) error { return nil } +// ContextValidate validate this service based on the context it is used +func (m *Service) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDashboardClient(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePlans(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Service) contextValidateDashboardClient(ctx context.Context, formats strfmt.Registry) error { + + if m.DashboardClient != nil { + if err := m.DashboardClient.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dashboard_client") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dashboard_client") + } + return err + } + } + + return nil +} + +func (m *Service) contextValidatePlans(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Plans); i++ { + + if m.Plans[i] != nil { + if err := m.Plans[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("plans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("plans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Service) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go index 994409d3f0..a20665cc8d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceBinding service binding +// // swagger:model ServiceBinding type ServiceBinding struct { @@ -46,7 +47,6 @@ func (m *ServiceBinding) Validate(formats strfmt.Registry) error { } func (m *ServiceBinding) validateVolumeMounts(formats strfmt.Registry) error { - if swag.IsZero(m.VolumeMounts) { // not required return nil } @@ -60,6 +60,42 @@ func (m *ServiceBinding) validateVolumeMounts(formats strfmt.Registry) error { if err := m.VolumeMounts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service binding based on the context it is used +func (m *ServiceBinding) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVolumeMounts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceBinding) contextValidateVolumeMounts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VolumeMounts); i++ { + + if m.VolumeMounts[i] != nil { + if err := m.VolumeMounts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go index 68ca42fcb9..dbadb94800 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceBindingRequest service binding request +// // swagger:model ServiceBindingRequest type ServiceBindingRequest struct { @@ -61,7 +63,6 @@ func (m *ServiceBindingRequest) Validate(formats strfmt.Registry) error { } func (m *ServiceBindingRequest) validateBindResource(formats strfmt.Registry) error { - if swag.IsZero(m.BindResource) { // not required return nil } @@ -70,6 +71,8 @@ func (m *ServiceBindingRequest) validateBindResource(formats strfmt.Registry) er if err := m.BindResource.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bind_resource") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bind_resource") } return err } @@ -96,6 +99,36 @@ func (m *ServiceBindingRequest) validateServiceID(formats strfmt.Registry) error return nil } +// ContextValidate validate this service binding request based on the context it is used +func (m *ServiceBindingRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBindResource(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceBindingRequest) contextValidateBindResource(ctx context.Context, formats strfmt.Registry) error { + + if m.BindResource != nil { + if err := m.BindResource.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bind_resource") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bind_resource") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ServiceBindingRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go index 1a97439da6..4fcb7ce71c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceBindingResource service binding resource +// // swagger:model ServiceBindingResource type ServiceBindingResource struct { @@ -49,7 +50,6 @@ func (m *ServiceBindingResource) Validate(formats strfmt.Registry) error { } func (m *ServiceBindingResource) validateVolumeMounts(formats strfmt.Registry) error { - if swag.IsZero(m.VolumeMounts) { // not required return nil } @@ -63,6 +63,42 @@ func (m *ServiceBindingResource) validateVolumeMounts(formats strfmt.Registry) e if err := m.VolumeMounts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service binding resource based on the context it is used +func (m *ServiceBindingResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVolumeMounts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceBindingResource) contextValidateVolumeMounts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VolumeMounts); i++ { + + if m.VolumeMounts[i] != nil { + if err := m.VolumeMounts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource_object.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource_object.go index cc1aa4dd14..dc89fff63e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource_object.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceBindingResourceObject service binding resource object +// // swagger:model ServiceBindingResourceObject type ServiceBindingResourceObject struct { @@ -27,6 +29,11 @@ func (m *ServiceBindingResourceObject) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this service binding resource object based on context it is used +func (m *ServiceBindingResourceObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceBindingResourceObject) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go index 9df0a3da65..bb3ba6acc0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceBindingSchemaObject service binding schema object +// // swagger:model ServiceBindingSchemaObject type ServiceBindingSchemaObject struct { @@ -35,7 +37,6 @@ func (m *ServiceBindingSchemaObject) Validate(formats strfmt.Registry) error { } func (m *ServiceBindingSchemaObject) validateCreate(formats strfmt.Registry) error { - if swag.IsZero(m.Create) { // not required return nil } @@ -44,6 +45,38 @@ func (m *ServiceBindingSchemaObject) validateCreate(formats strfmt.Registry) err if err := m.Create.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("create") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("create") + } + return err + } + } + + return nil +} + +// ContextValidate validate this service binding schema object based on the context it is used +func (m *ServiceBindingSchemaObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceBindingSchemaObject) contextValidateCreate(ctx context.Context, formats strfmt.Registry) error { + + if m.Create != nil { + if err := m.Create.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("create") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("create") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go index c3c23e231e..c077d6c0c4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceBindingVolumeMount service binding volume mount +// // swagger:model ServiceBindingVolumeMount type ServiceBindingVolumeMount struct { @@ -91,6 +92,8 @@ func (m *ServiceBindingVolumeMount) validateDevice(formats strfmt.Registry) erro if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("device") } return err } @@ -119,7 +122,7 @@ const ( // prop value enum func (m *ServiceBindingVolumeMount) validateDeviceTypeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, serviceBindingVolumeMountTypeDeviceTypePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, serviceBindingVolumeMountTypeDeviceTypePropEnum, true); err != nil { return err } return nil @@ -171,7 +174,7 @@ const ( // prop value enum func (m *ServiceBindingVolumeMount) validateModeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, serviceBindingVolumeMountTypeModePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, serviceBindingVolumeMountTypeModePropEnum, true); err != nil { return err } return nil @@ -191,6 +194,36 @@ func (m *ServiceBindingVolumeMount) validateMode(formats strfmt.Registry) error return nil } +// ContextValidate validate this service binding volume mount based on the context it is used +func (m *ServiceBindingVolumeMount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDevice(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceBindingVolumeMount) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error { + + if m.Device != nil { + if err := m.Device.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("device") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ServiceBindingVolumeMount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount_device.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount_device.go index 0a64a3a771..f95ff3f730 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount_device.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount_device.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceBindingVolumeMountDevice service binding volume mount device +// // swagger:model ServiceBindingVolumeMountDevice type ServiceBindingVolumeMountDevice struct { @@ -48,6 +50,11 @@ func (m *ServiceBindingVolumeMountDevice) validateVolumeID(formats strfmt.Regist return nil } +// ContextValidate validates this service binding volume mount device based on context it is used +func (m *ServiceBindingVolumeMountDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceBindingVolumeMountDevice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance.go index 98d6f00484..2c6ca23cdc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceInstance service instance +// // swagger:model ServiceInstance type ServiceInstance struct { @@ -79,6 +81,11 @@ func (m *ServiceInstance) validateLastActive(formats strfmt.Registry) error { return nil } +// ContextValidate validates this service instance based on context it is used +func (m *ServiceInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstance) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go index 49c62ee3cb..2711e66730 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceInstanceAsyncOperation service instance async operation +// // swagger:model ServiceInstanceAsyncOperation type ServiceInstanceAsyncOperation struct { @@ -27,6 +29,11 @@ func (m *ServiceInstanceAsyncOperation) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this service instance async operation based on context it is used +func (m *ServiceInstanceAsyncOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstanceAsyncOperation) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_previous_values.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_previous_values.go index df22892440..33c2f1c90b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_previous_values.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_previous_values.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceInstancePreviousValues service instance previous values +// // swagger:model ServiceInstancePreviousValues type ServiceInstancePreviousValues struct { @@ -33,6 +35,11 @@ func (m *ServiceInstancePreviousValues) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this service instance previous values based on context it is used +func (m *ServiceInstancePreviousValues) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstancePreviousValues) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision.go index dd9973eb8e..7fb520f2ef 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceInstanceProvision service instance provision +// // swagger:model ServiceInstanceProvision type ServiceInstanceProvision struct { @@ -24,6 +26,11 @@ func (m *ServiceInstanceProvision) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this service instance provision based on context it is used +func (m *ServiceInstanceProvision) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstanceProvision) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision_request.go index 52835c2848..6e84dd4650 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_provision_request.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceInstanceProvisionRequest service instance provision request +// // swagger:model ServiceInstanceProvisionRequest type ServiceInstanceProvisionRequest struct { @@ -74,6 +76,11 @@ func (m *ServiceInstanceProvisionRequest) validateServiceID(formats strfmt.Regis return nil } +// ContextValidate validates this service instance provision request based on context it is used +func (m *ServiceInstanceProvisionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstanceProvisionRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_request.go index fd635a615f..67afe7a14e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_request.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceInstanceRequest service instance request +// // swagger:model ServiceInstanceRequest type ServiceInstanceRequest struct { @@ -51,6 +53,11 @@ func (m *ServiceInstanceRequest) validateEnabled(formats strfmt.Registry) error return nil } +// ContextValidate validates this service instance request based on context it is used +func (m *ServiceInstanceRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstanceRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_resource.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_resource.go index 95989abe3b..1a7b2da7e7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_resource.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_resource.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceInstanceResource service instance resource +// // swagger:model ServiceInstanceResource type ServiceInstanceResource struct { @@ -33,6 +35,11 @@ func (m *ServiceInstanceResource) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this service instance resource based on context it is used +func (m *ServiceInstanceResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstanceResource) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go index 0c1e0e1698..fb085f5fbe 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ServiceInstanceSchemaObject service instance schema object +// // swagger:model ServiceInstanceSchemaObject type ServiceInstanceSchemaObject struct { @@ -42,7 +44,6 @@ func (m *ServiceInstanceSchemaObject) Validate(formats strfmt.Registry) error { } func (m *ServiceInstanceSchemaObject) validateCreate(formats strfmt.Registry) error { - if swag.IsZero(m.Create) { // not required return nil } @@ -51,6 +52,8 @@ func (m *ServiceInstanceSchemaObject) validateCreate(formats strfmt.Registry) er if err := m.Create.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("create") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("create") } return err } @@ -60,7 +63,6 @@ func (m *ServiceInstanceSchemaObject) validateCreate(formats strfmt.Registry) er } func (m *ServiceInstanceSchemaObject) validateUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.Update) { // not required return nil } @@ -69,6 +71,58 @@ func (m *ServiceInstanceSchemaObject) validateUpdate(formats strfmt.Registry) er if err := m.Update.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("update") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("update") + } + return err + } + } + + return nil +} + +// ContextValidate validate this service instance schema object based on the context it is used +func (m *ServiceInstanceSchemaObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceInstanceSchemaObject) contextValidateCreate(ctx context.Context, formats strfmt.Registry) error { + + if m.Create != nil { + if err := m.Create.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("create") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("create") + } + return err + } + } + + return nil +} + +func (m *ServiceInstanceSchemaObject) contextValidateUpdate(ctx context.Context, formats strfmt.Registry) error { + + if m.Update != nil { + if err := m.Update.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("update") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("update") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go index a1894b8d0b..b4a4079544 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // ServiceInstanceUpdateRequest service instance update request +// // swagger:model ServiceInstanceUpdateRequest type ServiceInstanceUpdateRequest struct { @@ -53,7 +55,6 @@ func (m *ServiceInstanceUpdateRequest) Validate(formats strfmt.Registry) error { } func (m *ServiceInstanceUpdateRequest) validatePreviousValues(formats strfmt.Registry) error { - if swag.IsZero(m.PreviousValues) { // not required return nil } @@ -62,6 +63,8 @@ func (m *ServiceInstanceUpdateRequest) validatePreviousValues(formats strfmt.Reg if err := m.PreviousValues.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("previous_values") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("previous_values") } return err } @@ -79,6 +82,36 @@ func (m *ServiceInstanceUpdateRequest) validateServiceID(formats strfmt.Registry return nil } +// ContextValidate validate this service instance update request based on the context it is used +func (m *ServiceInstanceUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePreviousValues(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceInstanceUpdateRequest) contextValidatePreviousValues(ctx context.Context, formats strfmt.Registry) error { + + if m.PreviousValues != nil { + if err := m.PreviousValues.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("previous_values") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("previous_values") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ServiceInstanceUpdateRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go index ab301f42f7..c5d2fc31ea 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Snapshot snapshot +// // swagger:model Snapshot type Snapshot struct { @@ -89,7 +91,6 @@ func (m *Snapshot) Validate(formats strfmt.Registry) error { } func (m *Snapshot) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required return nil } @@ -102,7 +103,6 @@ func (m *Snapshot) validateCreationDate(formats strfmt.Registry) error { } func (m *Snapshot) validateLastUpdateDate(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdateDate) { // not required return nil } @@ -143,6 +143,15 @@ func (m *Snapshot) validateSnapshotID(formats strfmt.Registry) error { func (m *Snapshot) validateVolumeSnapshots(formats strfmt.Registry) error { + if err := validate.Required("volumeSnapshots", "body", m.VolumeSnapshots); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this snapshot based on context it is used +func (m *Snapshot) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go index 17827deb2f..003771100e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SnapshotCreate snapshot create +// // swagger:model SnapshotCreate type SnapshotCreate struct { @@ -25,7 +27,7 @@ type SnapshotCreate struct { Name *string `json:"name"` // List of volumes to include in the PVM instance snapshot - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this snapshot create @@ -51,6 +53,11 @@ func (m *SnapshotCreate) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this snapshot create based on context it is used +func (m *SnapshotCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SnapshotCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go index c372430b62..61214fb351 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SnapshotCreateResponse snapshot create response +// // swagger:model SnapshotCreateResponse type SnapshotCreateResponse struct { @@ -45,6 +47,11 @@ func (m *SnapshotCreateResponse) validateSnapshotID(formats strfmt.Registry) err return nil } +// ContextValidate validates this snapshot create response based on context it is used +func (m *SnapshotCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SnapshotCreateResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_restore.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_restore.go index f9b8ba1533..b2effe1ffa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_restore.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_restore.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SnapshotRestore snapshot restore +// // swagger:model SnapshotRestore type SnapshotRestore struct { @@ -24,6 +26,11 @@ func (m *SnapshotRestore) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this snapshot restore based on context it is used +func (m *SnapshotRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SnapshotRestore) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go index 27d6b7751e..162102e53d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SnapshotUpdate snapshot update +// // swagger:model SnapshotUpdate type SnapshotUpdate struct { @@ -27,6 +29,11 @@ func (m *SnapshotUpdate) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this snapshot update based on context it is used +func (m *SnapshotUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SnapshotUpdate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go index 885d8eabc8..276c6119a8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Snapshots snapshots +// // swagger:model Snapshots type Snapshots struct { @@ -53,6 +54,42 @@ func (m *Snapshots) validateSnapshots(formats strfmt.Registry) error { if err := m.Snapshots[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this snapshots based on the context it is used +func (m *Snapshots) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSnapshots(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Snapshots) contextValidateSnapshots(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Snapshots); i++ { + + if m.Snapshots[i] != nil { + if err := m.Snapshots[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go index c47a1216d6..26941f4fcd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/softlayer_subscription.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SoftlayerSubscription Softlayer subscription object +// // swagger:model SoftlayerSubscription type SoftlayerSubscription struct { @@ -62,6 +64,11 @@ func (m *SoftlayerSubscription) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validates this softlayer subscription based on context it is used +func (m *SoftlayerSubscription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SoftlayerSubscription) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_licenses.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_licenses.go index d06fd08d91..ae855dccaa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_licenses.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_licenses.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SoftwareLicenses software licenses +// // swagger:model SoftwareLicenses type SoftwareLicenses struct { @@ -36,6 +38,11 @@ func (m *SoftwareLicenses) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this software licenses based on context it is used +func (m *SoftwareLicenses) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SoftwareLicenses) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_key.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_key.go index 29314e99c6..5112e6cd08 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_key.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SSHKey SSH key +// // swagger:model SSHKey type SSHKey struct { @@ -53,7 +55,6 @@ func (m *SSHKey) Validate(formats strfmt.Registry) error { } func (m *SSHKey) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required return nil } @@ -83,6 +84,11 @@ func (m *SSHKey) validateSSHKey(formats strfmt.Registry) error { return nil } +// ContextValidate validates this SSH key based on context it is used +func (m *SSHKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SSHKey) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go index d281a24aea..ae4e4cd5f6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SSHKeys SSH keys +// // swagger:model SSHKeys type SSHKeys struct { @@ -53,6 +54,42 @@ func (m *SSHKeys) validateSSHKeys(formats strfmt.Registry) error { if err := m.SSHKeys[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this SSH keys based on the context it is used +func (m *SSHKeys) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSSHKeys(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SSHKeys) contextValidateSSHKeys(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SSHKeys); i++ { + + if m.SSHKeys[i] != nil { + if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/status.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/status.go index 853fe1164a..b62214580f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/status.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/status.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Status status +// // swagger:model Status type Status struct { @@ -65,6 +67,11 @@ func (m *Status) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validates this status based on context it is used +func (m *Status) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Status) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_image.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_image.go index 6163999653..5ec533e317 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_image.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_image.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StockImage Stock image detail +// // swagger:model StockImage type StockImage struct { @@ -30,6 +32,11 @@ func (m *StockImage) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this stock image based on context it is used +func (m *StockImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *StockImage) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go index d9551dbef9..8ad0b31984 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StockImages List of stock images +// // swagger:model StockImages type StockImages []*StockImage @@ -31,6 +32,33 @@ func (m StockImages) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this stock images based on the context it is used +func (m StockImages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go index d63af261bf..071b9891ab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // StorageAffinity storage affinity +// // swagger:model StorageAffinity type StorageAffinity struct { @@ -67,20 +68,19 @@ const ( // StorageAffinityAffinityPolicyAffinity captures enum value "affinity" StorageAffinityAffinityPolicyAffinity string = "affinity" - // StorageAffinityAffinityPolicyAntiAffinity captures enum value "anti-affinity" - StorageAffinityAffinityPolicyAntiAffinity string = "anti-affinity" + // StorageAffinityAffinityPolicyAntiDashAffinity captures enum value "anti-affinity" + StorageAffinityAffinityPolicyAntiDashAffinity string = "anti-affinity" ) // prop value enum func (m *StorageAffinity) validateAffinityPolicyEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, storageAffinityTypeAffinityPolicyPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, storageAffinityTypeAffinityPolicyPropEnum, true); err != nil { return err } return nil } func (m *StorageAffinity) validateAffinityPolicy(formats strfmt.Registry) error { - if swag.IsZero(m.AffinityPolicy) { // not required return nil } @@ -93,6 +93,11 @@ func (m *StorageAffinity) validateAffinityPolicy(formats strfmt.Registry) error return nil } +// ContextValidate validates this storage affinity based on context it is used +func (m *StorageAffinity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *StorageAffinity) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_entities.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_entities.go index fc22b2dd8d..5f8c6e8f7c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_entities.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_entities.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StorageEntities storage entities +// // swagger:model StorageEntities type StorageEntities struct { @@ -27,6 +29,11 @@ func (m *StorageEntities) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this storage entities based on context it is used +func (m *StorageEntities) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *StorageEntities) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go index 93a9199654..ab18cac6d0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // StoragePool storage pool +// // swagger:model StoragePool type StoragePool struct { @@ -106,7 +107,6 @@ func (m *StoragePool) validateName(formats strfmt.Registry) error { } func (m *StoragePool) validateOverrideThresholds(formats strfmt.Registry) error { - if swag.IsZero(m.OverrideThresholds) { // not required return nil } @@ -115,6 +115,8 @@ func (m *StoragePool) validateOverrideThresholds(formats strfmt.Registry) error if err := m.OverrideThresholds.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("overrideThresholds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("overrideThresholds") } return err } @@ -146,7 +148,7 @@ const ( // prop value enum func (m *StoragePool) validateStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, storagePoolTypeStatePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, storagePoolTypeStatePropEnum, true); err != nil { return err } return nil @@ -175,6 +177,36 @@ func (m *StoragePool) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validate this storage pool based on the context it is used +func (m *StoragePool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOverrideThresholds(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StoragePool) contextValidateOverrideThresholds(ctx context.Context, formats strfmt.Registry) error { + + if m.OverrideThresholds != nil { + if err := m.OverrideThresholds.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("overrideThresholds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("overrideThresholds") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *StoragePool) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool_capacity.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool_capacity.go index 4162d3674e..6b233d6baf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool_capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool_capacity.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // StoragePoolCapacity Storage pool capacity +// // swagger:model StoragePoolCapacity type StoragePoolCapacity struct { @@ -54,6 +56,11 @@ func (m *StoragePoolCapacity) validateMaxAllocationSize(formats strfmt.Registry) return nil } +// ContextValidate validates this storage pool capacity based on context it is used +func (m *StoragePoolCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *StoragePoolCapacity) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go index 8cb5037e87..622e1e19fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StoragePools list of storage pools for a region-zone +// // swagger:model StoragePools type StoragePools []*StoragePool @@ -31,6 +32,33 @@ func (m StoragePools) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this storage pools based on the context it is used +func (m StoragePools) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go index 92380226dd..ad6c04653b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StoragePoolsCapacity Storage capacity for all storage pools +// // swagger:model StoragePoolsCapacity type StoragePoolsCapacity struct { @@ -44,7 +45,6 @@ func (m *StoragePoolsCapacity) Validate(formats strfmt.Registry) error { } func (m *StoragePoolsCapacity) validateMaximumStorageAllocation(formats strfmt.Registry) error { - if swag.IsZero(m.MaximumStorageAllocation) { // not required return nil } @@ -53,6 +53,8 @@ func (m *StoragePoolsCapacity) validateMaximumStorageAllocation(formats strfmt.R if err := m.MaximumStorageAllocation.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maximumStorageAllocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maximumStorageAllocation") } return err } @@ -62,7 +64,6 @@ func (m *StoragePoolsCapacity) validateMaximumStorageAllocation(formats strfmt.R } func (m *StoragePoolsCapacity) validateStoragePoolsCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.StoragePoolsCapacity) { // not required return nil } @@ -76,6 +77,62 @@ func (m *StoragePoolsCapacity) validateStoragePoolsCapacity(formats strfmt.Regis if err := m.StoragePoolsCapacity[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this storage pools capacity based on the context it is used +func (m *StoragePoolsCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMaximumStorageAllocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStoragePoolsCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StoragePoolsCapacity) contextValidateMaximumStorageAllocation(ctx context.Context, formats strfmt.Registry) error { + + if m.MaximumStorageAllocation != nil { + if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maximumStorageAllocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maximumStorageAllocation") + } + return err + } + } + + return nil +} + +func (m *StoragePoolsCapacity) contextValidateStoragePoolsCapacity(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StoragePoolsCapacity); i++ { + + if m.StoragePoolsCapacity[i] != nil { + if err := m.StoragePoolsCapacity[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go index 1f709a93d0..4af1f8954a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // StorageType Storage type detail +// // swagger:model StorageType type StorageType struct { @@ -70,14 +71,13 @@ const ( // prop value enum func (m *StorageType) validateStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, storageTypeTypeStatePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, storageTypeTypeStatePropEnum, true); err != nil { return err } return nil } func (m *StorageType) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required return nil } @@ -90,6 +90,11 @@ func (m *StorageType) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validates this storage type based on context it is used +func (m *StorageType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *StorageType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go index 899d9d3891..4ac3bf6dee 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StorageTypeCapacity Storage type capacity +// // swagger:model StorageTypeCapacity type StorageTypeCapacity struct { @@ -47,7 +48,6 @@ func (m *StorageTypeCapacity) Validate(formats strfmt.Registry) error { } func (m *StorageTypeCapacity) validateMaximumStorageAllocation(formats strfmt.Registry) error { - if swag.IsZero(m.MaximumStorageAllocation) { // not required return nil } @@ -56,6 +56,8 @@ func (m *StorageTypeCapacity) validateMaximumStorageAllocation(formats strfmt.Re if err := m.MaximumStorageAllocation.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maximumStorageAllocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maximumStorageAllocation") } return err } @@ -65,7 +67,6 @@ func (m *StorageTypeCapacity) validateMaximumStorageAllocation(formats strfmt.Re } func (m *StorageTypeCapacity) validateStoragePoolsCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.StoragePoolsCapacity) { // not required return nil } @@ -79,6 +80,62 @@ func (m *StorageTypeCapacity) validateStoragePoolsCapacity(formats strfmt.Regist if err := m.StoragePoolsCapacity[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this storage type capacity based on the context it is used +func (m *StorageTypeCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMaximumStorageAllocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStoragePoolsCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageTypeCapacity) contextValidateMaximumStorageAllocation(ctx context.Context, formats strfmt.Registry) error { + + if m.MaximumStorageAllocation != nil { + if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maximumStorageAllocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maximumStorageAllocation") + } + return err + } + } + + return nil +} + +func (m *StorageTypeCapacity) contextValidateStoragePoolsCapacity(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StoragePoolsCapacity); i++ { + + if m.StoragePoolsCapacity[i] != nil { + if err := m.StoragePoolsCapacity[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go index 3801a77aac..d00c9cd4e4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // StorageTypes A map of an array of storage types supported in a region +// // swagger:model StorageTypes type StorageTypes map[string]RegionStorageTypes @@ -29,6 +31,31 @@ func (m StorageTypes) Validate(formats strfmt.Registry) error { if err := m[k].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this storage types based on the context it is used +func (m StorageTypes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := m[k].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go index 7904067381..de163af979 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StorageTypesCapacity Storage types capacity +// // swagger:model StorageTypesCapacity type StorageTypesCapacity struct { @@ -44,7 +45,6 @@ func (m *StorageTypesCapacity) Validate(formats strfmt.Registry) error { } func (m *StorageTypesCapacity) validateMaximumStorageAllocation(formats strfmt.Registry) error { - if swag.IsZero(m.MaximumStorageAllocation) { // not required return nil } @@ -53,6 +53,8 @@ func (m *StorageTypesCapacity) validateMaximumStorageAllocation(formats strfmt.R if err := m.MaximumStorageAllocation.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maximumStorageAllocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maximumStorageAllocation") } return err } @@ -62,7 +64,6 @@ func (m *StorageTypesCapacity) validateMaximumStorageAllocation(formats strfmt.R } func (m *StorageTypesCapacity) validateStorageTypesCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.StorageTypesCapacity) { // not required return nil } @@ -76,6 +77,62 @@ func (m *StorageTypesCapacity) validateStorageTypesCapacity(formats strfmt.Regis if err := m.StorageTypesCapacity[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this storage types capacity based on the context it is used +func (m *StorageTypesCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMaximumStorageAllocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageTypesCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageTypesCapacity) contextValidateMaximumStorageAllocation(ctx context.Context, formats strfmt.Registry) error { + + if m.MaximumStorageAllocation != nil { + if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maximumStorageAllocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maximumStorageAllocation") + } + return err + } + } + + return nil +} + +func (m *StorageTypesCapacity) contextValidateStorageTypesCapacity(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StorageTypesCapacity); i++ { + + if m.StorageTypesCapacity[i] != nil { + if err := m.StorageTypesCapacity[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system.go index c1dc2c218a..7e09b8ba43 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // System system +// // swagger:model System type System struct { @@ -65,6 +67,11 @@ func (m *System) validateMemory(formats strfmt.Registry) error { return nil } +// ContextValidate validates this system based on context it is used +func (m *System) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *System) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go index c9ae131108..59da690a53 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SystemPool Hardware platform detailing its limits and statistics +// // swagger:model SystemPool type SystemPool struct { @@ -78,7 +79,6 @@ func (m *SystemPool) Validate(formats strfmt.Registry) error { } func (m *SystemPool) validateCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.Capacity) { // not required return nil } @@ -87,6 +87,8 @@ func (m *SystemPool) validateCapacity(formats strfmt.Registry) error { if err := m.Capacity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("capacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("capacity") } return err } @@ -96,7 +98,6 @@ func (m *SystemPool) validateCapacity(formats strfmt.Registry) error { } func (m *SystemPool) validateMaxAvailable(formats strfmt.Registry) error { - if swag.IsZero(m.MaxAvailable) { // not required return nil } @@ -105,6 +106,8 @@ func (m *SystemPool) validateMaxAvailable(formats strfmt.Registry) error { if err := m.MaxAvailable.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maxAvailable") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maxAvailable") } return err } @@ -114,7 +117,6 @@ func (m *SystemPool) validateMaxAvailable(formats strfmt.Registry) error { } func (m *SystemPool) validateMaxCoresAvailable(formats strfmt.Registry) error { - if swag.IsZero(m.MaxCoresAvailable) { // not required return nil } @@ -123,6 +125,8 @@ func (m *SystemPool) validateMaxCoresAvailable(formats strfmt.Registry) error { if err := m.MaxCoresAvailable.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maxCoresAvailable") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maxCoresAvailable") } return err } @@ -132,7 +136,6 @@ func (m *SystemPool) validateMaxCoresAvailable(formats strfmt.Registry) error { } func (m *SystemPool) validateMaxMemoryAvailable(formats strfmt.Registry) error { - if swag.IsZero(m.MaxMemoryAvailable) { // not required return nil } @@ -141,6 +144,8 @@ func (m *SystemPool) validateMaxMemoryAvailable(formats strfmt.Registry) error { if err := m.MaxMemoryAvailable.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maxMemoryAvailable") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maxMemoryAvailable") } return err } @@ -150,7 +155,6 @@ func (m *SystemPool) validateMaxMemoryAvailable(formats strfmt.Registry) error { } func (m *SystemPool) validateSharedCoreRatio(formats strfmt.Registry) error { - if swag.IsZero(m.SharedCoreRatio) { // not required return nil } @@ -159,6 +163,8 @@ func (m *SystemPool) validateSharedCoreRatio(formats strfmt.Registry) error { if err := m.SharedCoreRatio.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("sharedCoreRatio") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sharedCoreRatio") } return err } @@ -168,7 +174,6 @@ func (m *SystemPool) validateSharedCoreRatio(formats strfmt.Registry) error { } func (m *SystemPool) validateSystems(formats strfmt.Registry) error { - if swag.IsZero(m.Systems) { // not required return nil } @@ -182,6 +187,142 @@ func (m *SystemPool) validateSystems(formats strfmt.Registry) error { if err := m.Systems[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("systems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("systems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this system pool based on the context it is used +func (m *SystemPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxAvailable(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxCoresAvailable(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMaxMemoryAvailable(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSharedCoreRatio(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSystems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SystemPool) contextValidateCapacity(ctx context.Context, formats strfmt.Registry) error { + + if m.Capacity != nil { + if err := m.Capacity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("capacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("capacity") + } + return err + } + } + + return nil +} + +func (m *SystemPool) contextValidateMaxAvailable(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxAvailable != nil { + if err := m.MaxAvailable.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maxAvailable") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maxAvailable") + } + return err + } + } + + return nil +} + +func (m *SystemPool) contextValidateMaxCoresAvailable(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxCoresAvailable != nil { + if err := m.MaxCoresAvailable.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maxCoresAvailable") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maxCoresAvailable") + } + return err + } + } + + return nil +} + +func (m *SystemPool) contextValidateMaxMemoryAvailable(ctx context.Context, formats strfmt.Registry) error { + + if m.MaxMemoryAvailable != nil { + if err := m.MaxMemoryAvailable.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("maxMemoryAvailable") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("maxMemoryAvailable") + } + return err + } + } + + return nil +} + +func (m *SystemPool) contextValidateSharedCoreRatio(ctx context.Context, formats strfmt.Registry) error { + + if m.SharedCoreRatio != nil { + if err := m.SharedCoreRatio.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sharedCoreRatio") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sharedCoreRatio") + } + return err + } + } + + return nil +} + +func (m *SystemPool) contextValidateSystems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Systems); i++ { + + if m.Systems[i] != nil { + if err := m.Systems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("systems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("systems" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go index c12cde48f6..afae9a2f15 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // SystemPools List of available system pools within a particular DataCenter +// // swagger:model SystemPools type SystemPools map[string]SystemPool @@ -27,6 +29,31 @@ func (m SystemPools) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this system pools based on the context it is used +func (m SystemPools) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if val, ok := m[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { return err } } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task.go index d5c4cf212d..ccaf515ab2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Task task +// // swagger:model Task type Task struct { @@ -191,6 +193,11 @@ func (m *Task) validateTaskID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this task based on context it is used +func (m *Task) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Task) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task_reference.go index 0f7b85fcc7..aca4c6d20d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/task_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // TaskReference task reference +// // swagger:model TaskReference type TaskReference struct { @@ -62,6 +64,11 @@ func (m *TaskReference) validateTaskID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this task reference based on context it is used +func (m *TaskReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *TaskReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go index df8acb6e93..60dcec1ba2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Tenant tenant +// // swagger:model Tenant type Tenant struct { @@ -95,6 +96,8 @@ func (m *Tenant) validateCloudInstances(formats strfmt.Registry) error { if err := m.CloudInstances[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) } return err } @@ -128,7 +131,6 @@ func (m *Tenant) validateEnabled(formats strfmt.Registry) error { } func (m *Tenant) validatePeeringNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.PeeringNetworks) { // not required return nil } @@ -142,6 +144,8 @@ func (m *Tenant) validatePeeringNetworks(formats strfmt.Registry) error { if err := m.PeeringNetworks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) } return err } @@ -153,7 +157,6 @@ func (m *Tenant) validatePeeringNetworks(formats strfmt.Registry) error { } func (m *Tenant) validateSSHKeys(formats strfmt.Registry) error { - if swag.IsZero(m.SSHKeys) { // not required return nil } @@ -167,6 +170,8 @@ func (m *Tenant) validateSSHKeys(formats strfmt.Registry) error { if err := m.SSHKeys[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } return err } @@ -186,6 +191,88 @@ func (m *Tenant) validateTenantID(formats strfmt.Registry) error { return nil } +// ContextValidate validate this tenant based on the context it is used +func (m *Tenant) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCloudInstances(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePeeringNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSSHKeys(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tenant) contextValidateCloudInstances(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CloudInstances); i++ { + + if m.CloudInstances[i] != nil { + if err := m.CloudInstances[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Tenant) contextValidatePeeringNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PeeringNetworks); i++ { + + if m.PeeringNetworks[i] != nil { + if err := m.PeeringNetworks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Tenant) contextValidateSSHKeys(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SSHKeys); i++ { + + if m.SSHKeys[i] != nil { + if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Tenant) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go index 25edd294ba..a1a9e439a0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // TenantUpdate tenant update +// // swagger:model TenantUpdate type TenantUpdate struct { @@ -40,7 +41,6 @@ func (m *TenantUpdate) Validate(formats strfmt.Registry) error { } func (m *TenantUpdate) validatePeeringNetworks(formats strfmt.Registry) error { - if swag.IsZero(m.PeeringNetworks) { // not required return nil } @@ -54,6 +54,42 @@ func (m *TenantUpdate) validatePeeringNetworks(formats strfmt.Registry) error { if err := m.PeeringNetworks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenant update based on the context it is used +func (m *TenantUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePeeringNetworks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantUpdate) contextValidatePeeringNetworks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PeeringNetworks); i++ { + + if m.PeeringNetworks[i] != nil { + if err := m.PeeringNetworks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go index 93ec80bcb5..9d142d57fe 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Thresholds storage threshold settings +// // swagger:model Thresholds type Thresholds struct { @@ -63,7 +65,6 @@ func (m *Thresholds) Validate(formats strfmt.Registry) error { } func (m *Thresholds) validateCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.Capacity) { // not required return nil } @@ -72,6 +73,8 @@ func (m *Thresholds) validateCapacity(formats strfmt.Registry) error { if err := m.Capacity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("capacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("capacity") } return err } @@ -81,7 +84,6 @@ func (m *Thresholds) validateCapacity(formats strfmt.Registry) error { } func (m *Thresholds) validateOvercommit(formats strfmt.Registry) error { - if swag.IsZero(m.Overcommit) { // not required return nil } @@ -90,6 +92,8 @@ func (m *Thresholds) validateOvercommit(formats strfmt.Registry) error { if err := m.Overcommit.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("overcommit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("overcommit") } return err } @@ -99,7 +103,6 @@ func (m *Thresholds) validateOvercommit(formats strfmt.Registry) error { } func (m *Thresholds) validatePhysicalCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.PhysicalCapacity) { // not required return nil } @@ -108,6 +111,8 @@ func (m *Thresholds) validatePhysicalCapacity(formats strfmt.Registry) error { if err := m.PhysicalCapacity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("physicalCapacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("physicalCapacity") } return err } @@ -117,7 +122,6 @@ func (m *Thresholds) validatePhysicalCapacity(formats strfmt.Registry) error { } func (m *Thresholds) validateVdiskCapacity(formats strfmt.Registry) error { - if swag.IsZero(m.VdiskCapacity) { // not required return nil } @@ -126,6 +130,8 @@ func (m *Thresholds) validateVdiskCapacity(formats strfmt.Registry) error { if err := m.VdiskCapacity.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vdiskCapacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vdiskCapacity") } return err } @@ -135,7 +141,6 @@ func (m *Thresholds) validateVdiskCapacity(formats strfmt.Registry) error { } func (m *Thresholds) validateVdiskLimit(formats strfmt.Registry) error { - if swag.IsZero(m.VdiskLimit) { // not required return nil } @@ -144,6 +149,118 @@ func (m *Thresholds) validateVdiskLimit(formats strfmt.Registry) error { if err := m.VdiskLimit.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vdiskLimit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vdiskLimit") + } + return err + } + } + + return nil +} + +// ContextValidate validate this thresholds based on the context it is used +func (m *Thresholds) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOvercommit(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePhysicalCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVdiskCapacity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVdiskLimit(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Thresholds) contextValidateCapacity(ctx context.Context, formats strfmt.Registry) error { + + if m.Capacity != nil { + if err := m.Capacity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("capacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("capacity") + } + return err + } + } + + return nil +} + +func (m *Thresholds) contextValidateOvercommit(ctx context.Context, formats strfmt.Registry) error { + + if m.Overcommit != nil { + if err := m.Overcommit.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("overcommit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("overcommit") + } + return err + } + } + + return nil +} + +func (m *Thresholds) contextValidatePhysicalCapacity(ctx context.Context, formats strfmt.Registry) error { + + if m.PhysicalCapacity != nil { + if err := m.PhysicalCapacity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("physicalCapacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("physicalCapacity") + } + return err + } + } + + return nil +} + +func (m *Thresholds) contextValidateVdiskCapacity(ctx context.Context, formats strfmt.Registry) error { + + if m.VdiskCapacity != nil { + if err := m.VdiskCapacity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vdiskCapacity") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vdiskCapacity") + } + return err + } + } + + return nil +} + +func (m *Thresholds) contextValidateVdiskLimit(ctx context.Context, formats strfmt.Registry) error { + + if m.VdiskLimit != nil { + if err := m.VdiskLimit.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vdiskLimit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vdiskLimit") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token.go index 70fe73bc84..7dcf363465 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Token token +// // swagger:model Token type Token struct { @@ -101,6 +103,11 @@ func (m *Token) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this token based on context it is used +func (m *Token) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Token) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go index d8f6b64f72..a37a8bc217 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // TokenExtra token extra +// // swagger:model TokenExtra type TokenExtra struct { @@ -93,6 +95,8 @@ func (m *TokenExtra) validateToken(formats strfmt.Registry) error { if err := m.Token.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("token") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("token") } return err } @@ -110,6 +114,36 @@ func (m *TokenExtra) validateValid(formats strfmt.Registry) error { return nil } +// ContextValidate validate this token extra based on the context it is used +func (m *TokenExtra) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateToken(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TokenExtra) contextValidateToken(ctx context.Context, formats strfmt.Registry) error { + + if m.Token != nil { + if err := m.Token.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("token") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("token") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *TokenExtra) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go index e622f512c5..a136c5cec1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // TokenRequest token request +// // swagger:model TokenRequest type TokenRequest struct { @@ -79,7 +80,7 @@ const ( // prop value enum func (m *TokenRequest) validateSourceEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, tokenRequestTypeSourcePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, tokenRequestTypeSourcePropEnum, true); err != nil { return err } return nil @@ -99,6 +100,11 @@ func (m *TokenRequest) validateSource(formats strfmt.Registry) error { return nil } +// ContextValidate validates this token request based on context it is used +func (m *TokenRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *TokenRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go index 2c90d0c914..b186a57ba9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // UpdateStoragePool update storage pool +// // swagger:model UpdateStoragePool type UpdateStoragePool struct { @@ -52,7 +53,6 @@ func (m *UpdateStoragePool) Validate(formats strfmt.Registry) error { } func (m *UpdateStoragePool) validateOverrideThresholds(formats strfmt.Registry) error { - if swag.IsZero(m.OverrideThresholds) { // not required return nil } @@ -61,6 +61,8 @@ func (m *UpdateStoragePool) validateOverrideThresholds(formats strfmt.Registry) if err := m.OverrideThresholds.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("overrideThresholds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("overrideThresholds") } return err } @@ -92,14 +94,13 @@ const ( // prop value enum func (m *UpdateStoragePool) validateStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, updateStoragePoolTypeStatePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, updateStoragePoolTypeStatePropEnum, true); err != nil { return err } return nil } func (m *UpdateStoragePool) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required return nil } @@ -112,6 +113,36 @@ func (m *UpdateStoragePool) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validate this update storage pool based on the context it is used +func (m *UpdateStoragePool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOverrideThresholds(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateStoragePool) contextValidateOverrideThresholds(ctx context.Context, formats strfmt.Registry) error { + + if m.OverrideThresholds != nil { + if err := m.OverrideThresholds.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("overrideThresholds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("overrideThresholds") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *UpdateStoragePool) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_volume.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_volume.go index ab44cd60bc..630668b100 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_volume.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // UpdateVolume update volume +// // swagger:model UpdateVolume type UpdateVolume struct { @@ -33,6 +35,11 @@ func (m *UpdateVolume) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this update volume based on context it is used +func (m *UpdateVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *UpdateVolume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_info.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_info.go index d343271d96..9597821489 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_info.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_info.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // UserInfo user info +// // swagger:model UserInfo type UserInfo struct { @@ -85,6 +87,11 @@ func (m *UserInfo) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this user info based on context it is used +func (m *UserInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *UserInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go index b6a07e614b..368b9814dd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VPNConnection v p n connection +// // swagger:model VPNConnection type VPNConnection struct { @@ -24,6 +25,7 @@ type VPNConnection struct { DeadPeerDetection *DeadPeerDetection `json:"deadPeerDetection"` // unique identifier for VPN Connection + // Example: 123e4567-e89b-12d3-a456-42661475 // Required: true ID *string `json:"id"` @@ -36,28 +38,32 @@ type VPNConnection struct { IPSecPolicy *IPSecPolicyRef `json:"ipSecPolicy"` // local Gateway address, only in 'route' mode. + // Example: 192.168.1.1 // Required: true LocalGatewayAddress *string `json:"localGatewayAddress"` // Mode used by this VPNConnection, either policy-based, or route-based, this attribute is set at the creation and cannot be updated later. + // Example: policy // Required: true // Enum: [policy route] Mode *string `json:"mode"` // VPN Connection name + // Example: VPN-Connection-1 // Required: true Name *string `json:"name"` // an array of network IDs // Required: true - NetworkIds []string `json:"networkIDs"` + NetworkIDs []string `json:"networkIDs"` // peer gateway address // Required: true // Format: ipv4 - PeerGatewayAddress PeerGatewayAddress `json:"peerGatewayAddress"` + PeerGatewayAddress *PeerGatewayAddress `json:"peerGatewayAddress"` // an array of strings containing CIDR of peer subnets + // Example: ["128.170.1.0/20","128.169.1.0/24","128.168.1.0/27","128.170.1.0/32"] // Required: true PeerSubnets []string `json:"peerSubnets"` @@ -67,6 +73,7 @@ type VPNConnection struct { Status *string `json:"status"` // public IP address of the VPN Gateway (vSRX) attached to this VPNConnection + // Example: 192.168.204.1 // Required: true VpnGatewayAddress *string `json:"vpnGatewayAddress"` } @@ -103,7 +110,7 @@ func (m *VPNConnection) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateNetworkIds(formats); err != nil { + if err := m.validateNetworkIDs(formats); err != nil { res = append(res, err) } @@ -139,6 +146,8 @@ func (m *VPNConnection) validateDeadPeerDetection(formats strfmt.Registry) error if err := m.DeadPeerDetection.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("deadPeerDetection") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deadPeerDetection") } return err } @@ -166,6 +175,8 @@ func (m *VPNConnection) validateIkePolicy(formats strfmt.Registry) error { if err := m.IkePolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ikePolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicy") } return err } @@ -184,6 +195,8 @@ func (m *VPNConnection) validateIPSecPolicy(formats strfmt.Registry) error { if err := m.IPSecPolicy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipSecPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicy") } return err } @@ -224,7 +237,7 @@ const ( // prop value enum func (m *VPNConnection) validateModeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, vPNConnectionTypeModePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, vPNConnectionTypeModePropEnum, true); err != nil { return err } return nil @@ -253,9 +266,9 @@ func (m *VPNConnection) validateName(formats strfmt.Registry) error { return nil } -func (m *VPNConnection) validateNetworkIds(formats strfmt.Registry) error { +func (m *VPNConnection) validateNetworkIDs(formats strfmt.Registry) error { - if err := validate.Required("networkIDs", "body", m.NetworkIds); err != nil { + if err := validate.Required("networkIDs", "body", m.NetworkIDs); err != nil { return err } @@ -264,13 +277,25 @@ func (m *VPNConnection) validateNetworkIds(formats strfmt.Registry) error { func (m *VPNConnection) validatePeerGatewayAddress(formats strfmt.Registry) error { - if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } + if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { + return err + } + + if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { return err } + if m.PeerGatewayAddress != nil { + if err := m.PeerGatewayAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peerGatewayAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peerGatewayAddress") + } + return err + } + } + return nil } @@ -309,7 +334,7 @@ const ( // prop value enum func (m *VPNConnection) validateStatusEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, vPNConnectionTypeStatusPropEnum); err != nil { + if err := validate.EnumCase(path, location, value, vPNConnectionTypeStatusPropEnum, true); err != nil { return err } return nil @@ -338,6 +363,96 @@ func (m *VPNConnection) validateVpnGatewayAddress(formats strfmt.Registry) error return nil } +// ContextValidate validate this v p n connection based on the context it is used +func (m *VPNConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDeadPeerDetection(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIkePolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIPSecPolicy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePeerGatewayAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPNConnection) contextValidateDeadPeerDetection(ctx context.Context, formats strfmt.Registry) error { + + if m.DeadPeerDetection != nil { + if err := m.DeadPeerDetection.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deadPeerDetection") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deadPeerDetection") + } + return err + } + } + + return nil +} + +func (m *VPNConnection) contextValidateIkePolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.IkePolicy != nil { + if err := m.IkePolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ikePolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicy") + } + return err + } + } + + return nil +} + +func (m *VPNConnection) contextValidateIPSecPolicy(ctx context.Context, formats strfmt.Registry) error { + + if m.IPSecPolicy != nil { + if err := m.IPSecPolicy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipSecPolicy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicy") + } + return err + } + } + + return nil +} + +func (m *VPNConnection) contextValidatePeerGatewayAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PeerGatewayAddress != nil { + if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peerGatewayAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peerGatewayAddress") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VPNConnection) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go index aa97f5506c..a98a8db474 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go @@ -6,46 +6,53 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VPNConnectionCreate v p n connection create +// // swagger:model VPNConnectionCreate type VPNConnectionCreate struct { // unique identifier of IKEPolicy selected for this VPNConnection + // Example: c36723ec-8593-11eb-8dcd-0242ac133853 // Required: true IkePolicy *string `json:"ikePolicy"` // unique identifier of IPSecPolicy selected for this VPNConnection + // Example: c12345d-8593-11eb-8dcd-0242ac134573 // Required: true IPSecPolicy *string `json:"ipSecPolicy"` // Mode used by this VPNConnection, either policy-based, or route-based, this attribute is set at the creation and cannot be updated later. + // Example: policy // Required: true // Enum: [policy route] Mode *string `json:"mode"` // VPN Connection name + // Example: VPN-Connection-1 // Required: true Name *string `json:"name"` // an array of network IDs to attach to this VPNConnection + // Example: ["7f950c76-8582-11veb-8dcd-0242ac153","7f950c76-8582-11veb-8dcd-0242ac144","7f950c76-8582-11veb-8dcd-0242ac199"] // Required: true Networks []string `json:"networks"` // peer gateway address // Required: true // Format: ipv4 - PeerGatewayAddress PeerGatewayAddress `json:"peerGatewayAddress"` + PeerGatewayAddress *PeerGatewayAddress `json:"peerGatewayAddress"` // an array of strings containing CIDR of peer subnets + // Example: ["128.170.1.0/20","128.169.1.0/24","128.168.1.0/27","128.170.1.0/32"] // Required: true PeerSubnets []string `json:"peerSubnets"` } @@ -129,7 +136,7 @@ const ( // prop value enum func (m *VPNConnectionCreate) validateModeEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, vPNConnectionCreateTypeModePropEnum); err != nil { + if err := validate.EnumCase(path, location, value, vPNConnectionCreateTypeModePropEnum, true); err != nil { return err } return nil @@ -169,13 +176,25 @@ func (m *VPNConnectionCreate) validateNetworks(formats strfmt.Registry) error { func (m *VPNConnectionCreate) validatePeerGatewayAddress(formats strfmt.Registry) error { - if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("peerGatewayAddress") - } + if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { return err } + if err := validate.Required("peerGatewayAddress", "body", m.PeerGatewayAddress); err != nil { + return err + } + + if m.PeerGatewayAddress != nil { + if err := m.PeerGatewayAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peerGatewayAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peerGatewayAddress") + } + return err + } + } + return nil } @@ -188,6 +207,36 @@ func (m *VPNConnectionCreate) validatePeerSubnets(formats strfmt.Registry) error return nil } +// ContextValidate validate this v p n connection create based on the context it is used +func (m *VPNConnectionCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePeerGatewayAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPNConnectionCreate) contextValidatePeerGatewayAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PeerGatewayAddress != nil { + if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peerGatewayAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peerGatewayAddress") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *VPNConnectionCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go index 6b1f05d6d6..fc9c60ef94 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go @@ -6,13 +6,15 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VPNConnectionCreateResponse v p n connection create response +// // swagger:model VPNConnectionCreateResponse type VPNConnectionCreateResponse struct { VPNConnection @@ -86,7 +88,6 @@ func (m *VPNConnectionCreateResponse) Validate(formats strfmt.Registry) error { } func (m *VPNConnectionCreateResponse) validateJobRef(formats strfmt.Registry) error { - if swag.IsZero(m.JobRef) { // not required return nil } @@ -95,6 +96,43 @@ func (m *VPNConnectionCreateResponse) validateJobRef(formats strfmt.Registry) er if err := m.JobRef.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("jobRef") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobRef") + } + return err + } + } + + return nil +} + +// ContextValidate validate this v p n connection create response based on the context it is used +func (m *VPNConnectionCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with VPNConnection + if err := m.VPNConnection.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateJobRef(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPNConnectionCreateResponse) contextValidateJobRef(ctx context.Context, formats strfmt.Registry) error { + + if m.JobRef != nil { + if err := m.JobRef.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jobRef") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jobRef") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go index 3e25f99a3a..a771e5c267 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go @@ -6,25 +6,31 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VPNConnectionUpdate VPN Connection object to send during the update +// +// Min Properties: 1 +// // swagger:model VPNConnectionUpdate type VPNConnectionUpdate struct { // unique identifier of IKEPolicy selected for this VPNConnection + // Example: c36723ec-8593-11eb-8dcd-0242ac133853 IkePolicy string `json:"ikePolicy,omitempty"` // unique identifier of IPSecPolicy selected for this VPNConnection + // Example: c12345d-8593-11eb-8dcd-0242ac134573 IPSecPolicy string `json:"ipSecPolicy,omitempty"` // VPN Connection name + // Example: VPN-Connection-1 Name string `json:"name,omitempty"` // peer gateway address @@ -41,12 +47,15 @@ func (m *VPNConnectionUpdate) UnmarshalJSON(data []byte) error { var stage1 struct { // unique identifier of IKEPolicy selected for this VPNConnection + // Example: c36723ec-8593-11eb-8dcd-0242ac133853 IkePolicy string `json:"ikePolicy,omitempty"` // unique identifier of IPSecPolicy selected for this VPNConnection + // Example: c12345d-8593-11eb-8dcd-0242ac134573 IPSecPolicy string `json:"ipSecPolicy,omitempty"` // VPN Connection name + // Example: VPN-Connection-1 Name string `json:"name,omitempty"` // peer gateway address @@ -59,13 +68,9 @@ func (m *VPNConnectionUpdate) UnmarshalJSON(data []byte) error { var rcv VPNConnectionUpdate rcv.IkePolicy = stage1.IkePolicy - rcv.IPSecPolicy = stage1.IPSecPolicy - rcv.Name = stage1.Name - rcv.PeerGatewayAddress = stage1.PeerGatewayAddress - *m = rcv // stage 2, remove properties and add to map @@ -75,13 +80,9 @@ func (m *VPNConnectionUpdate) UnmarshalJSON(data []byte) error { } delete(stage2, "ikePolicy") - delete(stage2, "ipSecPolicy") - delete(stage2, "name") - delete(stage2, "peerGatewayAddress") - // stage 3, add additional properties values if len(stage2) > 0 { result := make(map[string]interface{}) @@ -103,12 +104,15 @@ func (m VPNConnectionUpdate) MarshalJSON() ([]byte, error) { var stage1 struct { // unique identifier of IKEPolicy selected for this VPNConnection + // Example: c36723ec-8593-11eb-8dcd-0242ac133853 IkePolicy string `json:"ikePolicy,omitempty"` // unique identifier of IPSecPolicy selected for this VPNConnection + // Example: c12345d-8593-11eb-8dcd-0242ac134573 IPSecPolicy string `json:"ipSecPolicy,omitempty"` // VPN Connection name + // Example: VPN-Connection-1 Name string `json:"name,omitempty"` // peer gateway address @@ -117,11 +121,8 @@ func (m VPNConnectionUpdate) MarshalJSON() ([]byte, error) { } stage1.IkePolicy = m.IkePolicy - stage1.IPSecPolicy = m.IPSecPolicy - stage1.Name = m.Name - stage1.PeerGatewayAddress = m.PeerGatewayAddress // make JSON object for known properties @@ -130,7 +131,7 @@ func (m VPNConnectionUpdate) MarshalJSON() ([]byte, error) { return nil, err } - if len(m.VPNConnectionUpdateAdditionalProperties) == 0 { + if len(m.VPNConnectionUpdateAdditionalProperties) == 0 { // no additional properties return props, nil } @@ -140,19 +141,40 @@ func (m VPNConnectionUpdate) MarshalJSON() ([]byte, error) { return nil, err } - if len(props) < 3 { + if len(props) < 3 { // "{}": only additional properties return additional, nil } // concatenate the 2 objects - props[len(props)-1] = ',' - return append(props, additional[1:]...), nil + return swag.ConcatJSON(props, additional), nil } // Validate validates this v p n connection update func (m *VPNConnectionUpdate) Validate(formats strfmt.Registry) error { var res []error + // short circuits minProperties > 0 + if m == nil { + return errors.TooFewProperties("", "body", 1) + } + + props := make(map[string]json.RawMessage, 4+10) + j, err := swag.WriteJSON(m) + if err != nil { + return err + } + + if err = swag.ReadJSON(j, &props); err != nil { + return err + } + + nprops := len(props) + + // minProperties: 1 + if nprops < 1 { + return errors.TooFewProperties("", "body", 1) + } + if err := m.validatePeerGatewayAddress(formats); err != nil { res = append(res, err) } @@ -164,7 +186,6 @@ func (m *VPNConnectionUpdate) Validate(formats strfmt.Registry) error { } func (m *VPNConnectionUpdate) validatePeerGatewayAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PeerGatewayAddress) { // not required return nil } @@ -172,6 +193,36 @@ func (m *VPNConnectionUpdate) validatePeerGatewayAddress(formats strfmt.Registry if err := m.PeerGatewayAddress.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("peerGatewayAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peerGatewayAddress") + } + return err + } + + return nil +} + +// ContextValidate validate this v p n connection update based on the context it is used +func (m *VPNConnectionUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePeerGatewayAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPNConnectionUpdate) contextValidatePeerGatewayAddress(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peerGatewayAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peerGatewayAddress") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go index 7d62f33843..789c36571b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go @@ -6,19 +6,21 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VPNConnections v p n connections +// // swagger:model VPNConnections type VPNConnections struct { // an array of VPN Connections + // Example: [{"deadPeerDetection":{"action":"restart","interval":10,"threshold":5},"id":"123e4567-e89b-12d3-a456-42661475","ikePolicy":{"id":"7654e321-e89b-12d3-a456-4566447","name":"IKE Policy 3"},"ipSecPolicy":{"id":"456f7890-e89b-12d3-a456-4569934","name":"IPSec Policy 2"},"localGatewayAddress":"192.168.1.1","mode":"route","name":"VPN Connection 2","peerGatewayAddress":"192.168.44.1","peerSubnets":["128.169.1.0/24","128.168.1.0/27"],"status":"Active","vpnGatewayAddress":"192.168.24.1"}] VpnConnections []*VPNConnection `json:"vpnConnections"` } @@ -37,7 +39,6 @@ func (m *VPNConnections) Validate(formats strfmt.Registry) error { } func (m *VPNConnections) validateVpnConnections(formats strfmt.Registry) error { - if swag.IsZero(m.VpnConnections) { // not required return nil } @@ -51,6 +52,42 @@ func (m *VPNConnections) validateVpnConnections(formats strfmt.Registry) error { if err := m.VpnConnections[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this v p n connections based on the context it is used +func (m *VPNConnections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVpnConnections(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPNConnections) contextValidateVpnConnections(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpnConnections); i++ { + + if m.VpnConnections[i] != nil { + if err := m.VpnConnections[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_naa_s_options.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_naa_s_options.go index b47ad9a1be..ca802f9027 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_naa_s_options.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_naa_s_options.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VPNaaSOptions v p naa s options +// // swagger:model VPNaaSOptions type VPNaaSOptions struct { @@ -78,6 +80,8 @@ func (m *VPNaaSOptions) validateDeadPeerDetection(formats strfmt.Registry) error if err := m.DeadPeerDetection.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("deadPeerDetection") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deadPeerDetection") } return err } @@ -96,6 +100,8 @@ func (m *VPNaaSOptions) validateIkePolicyOptions(formats strfmt.Registry) error if err := m.IkePolicyOptions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ikePolicyOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicyOptions") } return err } @@ -114,6 +120,8 @@ func (m *VPNaaSOptions) validateIkePolicyTemplate(formats strfmt.Registry) error if err := m.IkePolicyTemplate.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ikePolicyTemplate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicyTemplate") } return err } @@ -132,6 +140,8 @@ func (m *VPNaaSOptions) validateIPSecPolicyOptions(formats strfmt.Registry) erro if err := m.IPSecPolicyOptions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipSecPolicyOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicyOptions") } return err } @@ -150,6 +160,118 @@ func (m *VPNaaSOptions) validateIPSecPolicyTemplate(formats strfmt.Registry) err if err := m.IPSecPolicyTemplate.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipSecPolicyTemplate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicyTemplate") + } + return err + } + } + + return nil +} + +// ContextValidate validate this v p naa s options based on the context it is used +func (m *VPNaaSOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDeadPeerDetection(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIkePolicyOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIkePolicyTemplate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIPSecPolicyOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIPSecPolicyTemplate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPNaaSOptions) contextValidateDeadPeerDetection(ctx context.Context, formats strfmt.Registry) error { + + if m.DeadPeerDetection != nil { + if err := m.DeadPeerDetection.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deadPeerDetection") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deadPeerDetection") + } + return err + } + } + + return nil +} + +func (m *VPNaaSOptions) contextValidateIkePolicyOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.IkePolicyOptions != nil { + if err := m.IkePolicyOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ikePolicyOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicyOptions") + } + return err + } + } + + return nil +} + +func (m *VPNaaSOptions) contextValidateIkePolicyTemplate(ctx context.Context, formats strfmt.Registry) error { + + if m.IkePolicyTemplate != nil { + if err := m.IkePolicyTemplate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ikePolicyTemplate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ikePolicyTemplate") + } + return err + } + } + + return nil +} + +func (m *VPNaaSOptions) contextValidateIPSecPolicyOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.IPSecPolicyOptions != nil { + if err := m.IPSecPolicyOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipSecPolicyOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicyOptions") + } + return err + } + } + + return nil +} + +func (m *VPNaaSOptions) contextValidateIPSecPolicyTemplate(ctx context.Context, formats strfmt.Registry) error { + + if m.IPSecPolicyTemplate != nil { + if err := m.IPSecPolicyTemplate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipSecPolicyTemplate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipSecPolicyTemplate") } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/version.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/version.go index 0d57619e3c..8432df2334 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/version.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/version.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Version version +// // swagger:model Version type Version struct { @@ -33,6 +35,11 @@ func (m *Version) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this version based on context it is used +func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Version) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_cores.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_cores.go index 7ce4fc2036..5d1330783f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_cores.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_cores.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VirtualCores virtual cores +// // swagger:model VirtualCores type VirtualCores struct { @@ -49,13 +51,18 @@ func (m *VirtualCores) validateAssigned(formats strfmt.Registry) error { return err } - if err := validate.MinimumInt("assigned", "body", int64(*m.Assigned), 1, false); err != nil { + if err := validate.MinimumInt("assigned", "body", *m.Assigned, 1, false); err != nil { return err } return nil } +// ContextValidate validates this virtual cores based on context it is used +func (m *VirtualCores) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VirtualCores) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go index 7ad3661237..167869c331 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Volume volume +// // swagger:model Volume type Volume struct { @@ -53,7 +55,7 @@ type Volume struct { Name *string `json:"name"` // List of PCloud PVM Instance attached to the volume - PvmInstanceIds []string `json:"pvmInstanceIDs"` + PvmInstanceIDs []string `json:"pvmInstanceIDs"` // shows the replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` @@ -165,6 +167,11 @@ func (m *Volume) validateVolumeID(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volume based on context it is used +func (m *Volume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Volume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_action.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_action.go index 79ebba9ff0..b0c8b5eb44 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_action.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumeAction volume action +// // swagger:model VolumeAction type VolumeAction struct { @@ -45,6 +47,11 @@ func (m *VolumeAction) validateReplicationEnabled(formats strfmt.Registry) error return nil } +// ContextValidate validates this volume action based on context it is used +func (m *VolumeAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumeAction) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go index b339b5feb8..26f5b3f2a6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VolumeInfo volume info +// // swagger:model VolumeInfo type VolumeInfo struct { @@ -27,6 +29,11 @@ func (m *VolumeInfo) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volume info based on context it is used +func (m *VolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumeInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go index b99e32d0aa..95783127e8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumeReference volume reference +// // swagger:model VolumeReference type VolumeReference struct { @@ -59,7 +61,7 @@ type VolumeReference struct { Name *string `json:"name"` // List of PCloud PVM Instance attached to the volume - PvmInstanceIds []string `json:"pvmInstanceIDs"` + PvmInstanceIDs []string `json:"pvmInstanceIDs"` // shows the replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` @@ -252,6 +254,11 @@ func (m *VolumeReference) validateWwn(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volume reference based on context it is used +func (m *VolumeReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumeReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go index 477c6d34bd..b701d4837e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // Volumes volumes +// // swagger:model Volumes type Volumes struct { @@ -53,6 +54,42 @@ func (m *Volumes) validateVolumes(formats strfmt.Registry) error { if err := m.Volumes[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this volumes based on the context it is used +func (m *Volumes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVolumes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Volumes) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Volumes); i++ { + + if m.Volumes[i] != nil { + if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go index 1c8c8a3eda..5e5b69b089 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attach.go @@ -6,27 +6,29 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesAttach volumes attach +// // swagger:model volumesAttach type VolumesAttach struct { // List of volumes to be attached to a PVM instance // Required: true - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this volumes attach func (m *VolumesAttach) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateVolumeIds(formats); err != nil { + if err := m.validateVolumeIDs(formats); err != nil { res = append(res, err) } @@ -36,15 +38,20 @@ func (m *VolumesAttach) Validate(formats strfmt.Registry) error { return nil } -func (m *VolumesAttach) validateVolumeIds(formats strfmt.Registry) error { +func (m *VolumesAttach) validateVolumeIDs(formats strfmt.Registry) error { - if err := validate.Required("volumeIDs", "body", m.VolumeIds); err != nil { + if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { return err } return nil } +// ContextValidate validates this volumes attach based on context it is used +func (m *VolumesAttach) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesAttach) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go index 985fe4c586..a8d453d27e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_attachment_response.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesAttachmentResponse volumes attachment response +// // swagger:model VolumesAttachmentResponse type VolumesAttachmentResponse struct { @@ -45,6 +47,11 @@ func (m *VolumesAttachmentResponse) validateSummary(formats strfmt.Registry) err return nil } +// ContextValidate validates this volumes attachment response based on context it is used +func (m *VolumesAttachmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesAttachmentResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone.go index 5a57acefd8..38cd8e679d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesClone volumes clone +// // swagger:model VolumesClone type VolumesClone struct { @@ -68,7 +70,6 @@ func (m *VolumesClone) Validate(formats strfmt.Registry) error { } func (m *VolumesClone) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required return nil } @@ -81,7 +82,6 @@ func (m *VolumesClone) validateCreationDate(formats strfmt.Registry) error { } func (m *VolumesClone) validateLastUpdateDate(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdateDate) { // not required return nil } @@ -102,6 +102,11 @@ func (m *VolumesClone) validatePercentComplete(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volumes clone based on context it is used +func (m *VolumesClone) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesClone) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go index d6feeecaaa..4ec6f73cd3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesCloneAsyncRequest volumes clone async request +// // swagger:model VolumesCloneAsyncRequest type VolumesCloneAsyncRequest struct { @@ -30,7 +32,7 @@ type VolumesCloneAsyncRequest struct { // List of volumes to be cloned // Required: true - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this volumes clone async request @@ -41,7 +43,7 @@ func (m *VolumesCloneAsyncRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateVolumeIds(formats); err != nil { + if err := m.validateVolumeIDs(formats); err != nil { res = append(res, err) } @@ -60,15 +62,20 @@ func (m *VolumesCloneAsyncRequest) validateName(formats strfmt.Registry) error { return nil } -func (m *VolumesCloneAsyncRequest) validateVolumeIds(formats strfmt.Registry) error { +func (m *VolumesCloneAsyncRequest) validateVolumeIDs(formats strfmt.Registry) error { - if err := validate.Required("volumeIDs", "body", m.VolumeIds); err != nil { + if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { return err } return nil } +// ContextValidate validates this volumes clone async request based on context it is used +func (m *VolumesCloneAsyncRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneAsyncRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go index b7247a0702..44bf4c720c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_cancel.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VolumesCloneCancel volumes clone cancel +// // swagger:model VolumesCloneCancel type VolumesCloneCancel struct { @@ -26,6 +28,11 @@ func (m *VolumesCloneCancel) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volumes clone cancel based on context it is used +func (m *VolumesCloneCancel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneCancel) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_create.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_create.go index 64183ff17f..77b38ab9b7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_create.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesCloneCreate volumes clone create +// // swagger:model VolumesCloneCreate type VolumesCloneCreate struct { @@ -25,7 +27,7 @@ type VolumesCloneCreate struct { // List of volumes to be cloned // Required: true - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this volumes clone create @@ -36,7 +38,7 @@ func (m *VolumesCloneCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateVolumeIds(formats); err != nil { + if err := m.validateVolumeIDs(formats); err != nil { res = append(res, err) } @@ -55,15 +57,20 @@ func (m *VolumesCloneCreate) validateName(formats strfmt.Registry) error { return nil } -func (m *VolumesCloneCreate) validateVolumeIds(formats strfmt.Registry) error { +func (m *VolumesCloneCreate) validateVolumeIDs(formats strfmt.Registry) error { - if err := validate.Required("volumeIDs", "body", m.VolumeIds); err != nil { + if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { return err } return nil } +// ContextValidate validates this volumes clone create based on context it is used +func (m *VolumesCloneCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go index 3e45cc2423..24a51c91d8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go @@ -6,16 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesCloneDetail volumes clone detail +// // swagger:model VolumesCloneDetail type VolumesCloneDetail struct { @@ -77,7 +78,6 @@ func (m *VolumesCloneDetail) Validate(formats strfmt.Registry) error { } func (m *VolumesCloneDetail) validateClonedVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.ClonedVolumes) { // not required return nil } @@ -91,6 +91,8 @@ func (m *VolumesCloneDetail) validateClonedVolumes(formats strfmt.Registry) erro if err := m.ClonedVolumes[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) } return err } @@ -102,7 +104,6 @@ func (m *VolumesCloneDetail) validateClonedVolumes(formats strfmt.Registry) erro } func (m *VolumesCloneDetail) validateCreationDate(formats strfmt.Registry) error { - if swag.IsZero(m.CreationDate) { // not required return nil } @@ -115,7 +116,6 @@ func (m *VolumesCloneDetail) validateCreationDate(formats strfmt.Registry) error } func (m *VolumesCloneDetail) validateLastUpdateDate(formats strfmt.Registry) error { - if swag.IsZero(m.LastUpdateDate) { // not required return nil } @@ -136,6 +136,40 @@ func (m *VolumesCloneDetail) validatePercentComplete(formats strfmt.Registry) er return nil } +// ContextValidate validate this volumes clone detail based on the context it is used +func (m *VolumesCloneDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClonedVolumes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VolumesCloneDetail) contextValidateClonedVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ClonedVolumes); i++ { + + if m.ClonedVolumes[i] != nil { + if err := m.ClonedVolumes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneDetail) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go index ff610c7057..1e10ae5d35 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesCloneExecute volumes clone execute +// // swagger:model VolumesCloneExecute type VolumesCloneExecute struct { @@ -57,6 +59,11 @@ func (m *VolumesCloneExecute) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volumes clone execute based on context it is used +func (m *VolumesCloneExecute) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneExecute) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_request.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_request.go index 2a4e7c3e69..7ed5f8c5cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_request.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_request.go @@ -6,14 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // VolumesCloneRequest volumes clone request +// // swagger:model VolumesCloneRequest type VolumesCloneRequest struct { @@ -29,7 +31,7 @@ type VolumesCloneRequest struct { // List of volumes to be cloned // Required: true - VolumeIds []string `json:"volumeIDs"` + VolumeIDs []string `json:"volumeIDs"` } // Validate validates this volumes clone request @@ -40,7 +42,7 @@ func (m *VolumesCloneRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateVolumeIds(formats); err != nil { + if err := m.validateVolumeIDs(formats); err != nil { res = append(res, err) } @@ -59,15 +61,20 @@ func (m *VolumesCloneRequest) validateDisplayName(formats strfmt.Registry) error return nil } -func (m *VolumesCloneRequest) validateVolumeIds(formats strfmt.Registry) error { +func (m *VolumesCloneRequest) validateVolumeIDs(formats strfmt.Registry) error { - if err := validate.Required("volumeIDs", "body", m.VolumeIds); err != nil { + if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { return err } return nil } +// ContextValidate validates this volumes clone request based on context it is used +func (m *VolumesCloneRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go index 96a2aad1eb..09ecf72c26 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go @@ -6,12 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VolumesCloneResponse volumes clone response +// // swagger:model VolumesCloneResponse type VolumesCloneResponse struct { @@ -27,6 +29,11 @@ func (m *VolumesCloneResponse) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volumes clone response based on context it is used +func (m *VolumesCloneResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumesCloneResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go index 3aa4aa2378..33bcab36fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go +++ b/ibm/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go @@ -6,15 +6,16 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // VolumesClones volumes clones +// // swagger:model VolumesClones type VolumesClones struct { @@ -37,7 +38,6 @@ func (m *VolumesClones) Validate(formats strfmt.Registry) error { } func (m *VolumesClones) validateVolumesClone(formats strfmt.Registry) error { - if swag.IsZero(m.VolumesClone) { // not required return nil } @@ -51,6 +51,42 @@ func (m *VolumesClones) validateVolumesClone(formats strfmt.Registry) error { if err := m.VolumesClone[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volumesClone" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volumesClone" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this volumes clones based on the context it is used +func (m *VolumesClones) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVolumesClone(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VolumesClones) contextValidateVolumesClone(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VolumesClone); i++ { + + if m.VolumesClone[i] != nil { + if err := m.VolumesClone[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("volumesClone" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("volumesClone" + "." + strconv.Itoa(i)) } return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/power-go-client/utils/utils.go b/ibm/vendor/github.com/IBM-Cloud/power-go-client/utils/utils.go deleted file mode 100644 index d42a070039..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/power-go-client/utils/utils.go +++ /dev/null @@ -1,62 +0,0 @@ -package utils - -import ( - "net/url" - "os" - "reflect" - - "github.com/IBM-Cloud/power-go-client/helpers" -) - -// GetNext ... -func GetNext(next interface{}) string { - if reflect.ValueOf(next).IsNil() { - return "" - } - - u, err := url.Parse(reflect.ValueOf(next).Elem().FieldByName("Href").Elem().String()) - if err != nil { - return "" - } - - q := u.Query() - return q.Get("start") -} - -// GetEndpoint ... -func GetEndpoint(generation int, regionName string) string { - - switch generation { - case 1: - ep := getGCEndpoint(regionName) - return helpers.EnvFallBack([]string{"IBMCLOUD_IS_API_ENDPOINT"}, ep) - case 2: - ep := getNGEndpoint(regionName) - return helpers.EnvFallBack([]string{"IBMCLOUD_IS_NG_API_ENDPOINT"}, ep) - } - ep := getNGEndpoint(regionName) - return helpers.EnvFallBack([]string{"IBMCLOUD_IS_NG_API_ENDPOINT"}, ep) -} - -func getGCEndpoint(regionName string) string { - if url := os.Getenv("IBMCLOUD_IS_API_ENDPOINT"); url != "" { - return url - } - return regionName + ".iaas.cloud.ibm.com" -} - -// For Power-IAAS -func getNGEndpoint(regionName string) string { - if url := os.Getenv("IBMCLOUD_IS_NG_API_ENDPOINT"); url != "" { - return url - } - return regionName + ".power-iaas.cloud.ibm.com" -} - -func GetPowerEndPoint(regionName string) string { - if url := os.Getenv("IBMCLOUD_POWER_API_ENDPOINT"); url != "" { - return url - } - return regionName + ".power-iaas.cloud.ibm.com" - -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.goreleaser.yml b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.goreleaser.yml index 10329dc5e6..80e56d5d90 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.goreleaser.yml +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.goreleaser.yml @@ -17,6 +17,17 @@ builds: - darwin goarch: - amd64 + - arm64 + - arm + ignore: + - goarch: '386' + goos: darwin + - goarch: 'arm' + goos: darwin + - goarch: 'arm64' + goos: windows + - goarch: 'arm' + goos: windows binary: '{{ .ProjectName }}_v{{ .Version }}' archives: - format: zip diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.legal.yaml b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.legal.yaml index 912bef3054..3f80739d80 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.legal.yaml +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.legal.yaml @@ -1,7 +1,7 @@ schemaVersion: oss-license-declaration.cloud.ibm.com:v4 name: terraform-provider-ibm source: https://github.com/IBM-Cloud/terraform-provider-ibm -issues: https://github.ibm.com/blueprint/schematics-compliance/issues +issues: https://github.ibm.com/blueprint/security-project-management/issues objectCodeOnly: false additionalDownloads: include: @@ -15,7 +15,7 @@ additionalDownloads: documentation: Package manager not invoked in build nor runtime use dependencies: - name: cloud.google.com/go - version: v0.61.0 + version: v0.65.0 licenses: - Apache-2.0 - name: cloud.google.com/go/bigquery @@ -48,7 +48,7 @@ dependencies: - BSD-3-Clause - GooglePatentClause - name: github.com/IBM-Cloud/bluemix-go - version: v0.0.0-20210706092416-dc4055f8e0ea + version: v0.0.0-20220209072802-61d92fc63fd1 licenses: - Apache-2.0 - name: github.com/IBM-Cloud/container-services-go-sdk @@ -60,7 +60,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/IBM-Cloud/power-go-client - version: v1.0.55 + version: v1.1.2 licenses: - Apache-2.0 - name: github.com/IBM/apigateway-go-sdk @@ -71,28 +71,36 @@ dependencies: version: v0.1.0 licenses: - Apache-2.0 + - name: github.com/IBM/appid-management-go-sdk + version: v0.0.0-20210908164609-dd0e0eaf732f + licenses: + - Apache-2.0 + - name: github.com/IBM/cloudant-go-sdk + version: v0.0.36 + licenses: + - Apache-2.0 - name: github.com/IBM/container-registry-go-sdk - version: v0.0.13 + version: v0.0.15 licenses: - Apache-2.0 - - name: github.com/IBM/go-sdk-core - version: v1.1.0 + - name: github.com/IBM/event-notifications-go-admin-sdk + version: v0.0.2 licenses: - Apache-2.0 - - name: github.com/IBM/go-sdk-core/v3 - version: v3.2.4 + - name: github.com/IBM/eventstreams-go-sdk + version: v1.2.0 licenses: - Apache-2.0 - - name: github.com/IBM/go-sdk-core/v4 - version: v4.10.0 + - name: github.com/IBM/go-sdk-core/v3 + version: v3.2.4 licenses: - Apache-2.0 - name: github.com/IBM/go-sdk-core/v5 - version: v5.5.1 + version: v5.9.1 licenses: - Apache-2.0 - name: github.com/IBM/ibm-cos-sdk-go - version: v1.7.0 + version: v1.8.0 licenses: - Apache-2.0 - name: github.com/IBM/ibm-cos-sdk-go-config @@ -100,7 +108,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/IBM/ibm-hpcs-tke-sdk - version: v0.0.0-20210723145459-a232c3f3ac91 + version: v0.0.0-20211109141421-a4b61b05f7d1 licenses: - Apache-2.0 - name: github.com/IBM/keyprotect-go-client @@ -108,19 +116,27 @@ dependencies: licenses: - Apache-2.0 - name: github.com/IBM/networking-go-sdk - version: v0.19.0 + version: v0.26.0 licenses: - Apache-2.0 - name: github.com/IBM/platform-services-go-sdk - version: v0.18.16 + version: v0.22.6 licenses: - Apache-2.0 - name: github.com/IBM/push-notifications-go-sdk version: v0.0.0-20210310100607-5790b96c47f5 licenses: - Apache-2.0 + - name: github.com/IBM/scc-go-sdk + version: v1.3.4 + licenses: + - Apache-2.0 + - name: github.com/IBM/scc-go-sdk/v3 + version: v3.1.0 + licenses: + - Apache-2.0 - name: github.com/IBM/schematics-go-sdk - version: v0.0.2 + version: v0.1.3 licenses: - Apache-2.0 - name: github.com/IBM/secrets-manager-go-sdk @@ -128,7 +144,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/IBM/vpc-go-sdk - version: v0.8.0 + version: v0.16.0 licenses: - Apache-2.0 - name: github.com/Logicalis/asn1 @@ -151,6 +167,10 @@ dependencies: version: v0.4.16 licenses: - MIT + - name: github.com/PromonLogicalis/asn1 + version: v0.0.0-20190312173541-d60463189a56 + licenses: + - MIT - name: github.com/ProtonMail/go-crypto version: v0.0.0-20210428141323-04723f9f07d7 licenses: @@ -168,7 +188,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/Shopify/sarama - version: v1.27.2 + version: v1.29.1 licenses: - MIT - name: github.com/Shopify/toxiproxy @@ -230,7 +250,7 @@ dependencies: licenses: - MIT - name: github.com/aws/aws-sdk-go - version: v1.34.28 + version: v1.37.0 licenses: - Apache-2.0 - name: github.com/bgentry/go-netrc @@ -335,7 +355,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/form3tech-oss/jwt-go - version: v3.2.2+incompatible + version: v3.2.3+incompatible licenses: - MIT - name: github.com/fortytw2/leaktest @@ -343,7 +363,7 @@ dependencies: licenses: - BSD-3-Clause - name: github.com/frankban/quicktest - version: v1.10.2 + version: v1.11.3 licenses: - MIT - name: github.com/fsnotify/fsnotify @@ -388,11 +408,11 @@ dependencies: licenses: - BSD-3-Clause - name: github.com/go-openapi/analysis - version: v0.19.16 + version: v0.21.1 licenses: - Apache-2.0 - name: github.com/go-openapi/errors - version: v0.19.9 + version: v0.20.1 licenses: - Apache-2.0 - name: github.com/go-openapi/jsonpointer @@ -400,39 +420,39 @@ dependencies: licenses: - Apache-2.0 - name: github.com/go-openapi/jsonreference - version: v0.19.5 + version: v0.19.6 licenses: - Apache-2.0 - name: github.com/go-openapi/loads - version: v0.20.0 + version: v0.21.0 licenses: - Apache-2.0 - name: github.com/go-openapi/runtime - version: v0.19.24 + version: v0.21.0 licenses: - Apache-2.0 - name: github.com/go-openapi/spec - version: v0.20.0 + version: v0.20.4 licenses: - Apache-2.0 - name: github.com/go-openapi/strfmt - version: v0.20.1 + version: v0.21.1 licenses: - Apache-2.0 - name: github.com/go-openapi/swag - version: v0.19.12 + version: v0.19.15 licenses: - Apache-2.0 - name: github.com/go-openapi/validate - version: v0.20.1 + version: v0.20.3 licenses: - Apache-2.0 - name: github.com/go-playground/locales - version: v0.13.0 + version: v0.14.0 licenses: - MIT - name: github.com/go-playground/universal-translator - version: v0.17.0 + version: v0.18.0 licenses: - MIT - name: github.com/go-sql-driver/mysql @@ -440,7 +460,7 @@ dependencies: licenses: - MPL-2.0 - name: github.com/go-stack/stack - version: v1.8.0 + version: v1.8.1 licenses: - MIT - name: github.com/go-task/slim-sprig @@ -500,7 +520,7 @@ dependencies: licenses: - MIT - name: github.com/golang-jwt/jwt - version: v3.2.1+incompatible + version: v3.2.2+incompatible licenses: - MIT - name: github.com/golang/glog @@ -512,7 +532,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/golang/mock - version: v1.4.3 + version: v1.4.4 licenses: - Apache-2.0 - name: github.com/golang/protobuf @@ -520,7 +540,7 @@ dependencies: licenses: - BSD-3-Clause - name: github.com/golang/snappy - version: v0.0.1 + version: v0.0.3 licenses: - BSD-3-Clause - name: github.com/google/btree @@ -552,13 +572,21 @@ dependencies: licenses: - Apache-2.0 - name: github.com/google/uuid - version: v1.2.0 + version: v1.3.0 licenses: - BSD-3-Clause - name: github.com/googleapis/gax-go/v2 version: v2.0.5 licenses: - BSD-3-Clause + - name: github.com/gorilla/securecookie + version: v1.1.1 + licenses: + - BSD-3-Clause + - name: github.com/gorilla/sessions + version: v1.2.1 + licenses: + - BSD-3-Clause - name: github.com/h2non/parth version: v0.0.0-20190131123155-b4df798d6542 licenses: @@ -596,7 +624,7 @@ dependencies: licenses: - MPL-2.0 - name: github.com/hashicorp/go-retryablehttp - version: v0.6.6 + version: v0.7.0 licenses: - MPL-2.0 - name: github.com/hashicorp/go-safetemp @@ -616,7 +644,7 @@ dependencies: licenses: - MPL-2.0 - name: github.com/hashicorp/hcl/v2 - version: v2.3.0 + version: v2.8.2 licenses: - MPL-2.0 - name: github.com/hashicorp/logutils @@ -675,10 +703,30 @@ dependencies: version: v0.0.0-20150711004518-d14ea06fba99 licenses: - MIT + - name: github.com/jcmturner/aescts/v2 + version: v2.0.0 + licenses: + - Apache-2.0 + - name: github.com/jcmturner/dnsutils/v2 + version: v2.0.0 + licenses: + - Apache-2.0 - name: github.com/jcmturner/gofork version: v1.0.0 licenses: - BSD-3-Clause + - name: github.com/jcmturner/goidentity/v6 + version: v6.0.1 + licenses: + - Apache-2.0 + - name: github.com/jcmturner/gokrb5/v8 + version: v8.4.2 + licenses: + - Apache-2.0 + - name: github.com/jcmturner/rpc/v2 + version: v2.0.3 + licenses: + - Apache-2.0 - name: github.com/jessevdk/go-flags version: v1.5.0 licenses: @@ -687,6 +735,10 @@ dependencies: version: v1.6.0 licenses: - Apache-2.0 + - name: github.com/jinzhu/copier + version: v0.3.2 + licenses: + - MIT - name: github.com/jmespath/go-jmespath version: v0.4.0 licenses: @@ -724,9 +776,11 @@ dependencies: licenses: - MIT - name: github.com/klauspost/compress - version: v1.11.2 + version: v1.13.6 licenses: + - Apache-2.0 - BSD-3-Clause + - MIT - name: github.com/konsorten/go-windows-terminal-sequences version: v1.0.2 licenses: @@ -752,7 +806,7 @@ dependencies: licenses: - MIT - name: github.com/mailru/easyjson - version: v0.7.6 + version: v0.7.7 licenses: - MIT - name: github.com/markbates/oncer @@ -804,7 +858,7 @@ dependencies: licenses: - MIT - name: github.com/mitchellh/mapstructure - version: v1.4.0 + version: v1.4.3 licenses: - MIT - name: github.com/mitchellh/reflectwalk @@ -848,9 +902,13 @@ dependencies: licenses: - MIT - name: github.com/onsi/gomega - version: v1.13.0 + version: v1.16.0 licenses: - MIT + - name: github.com/opentracing/opentracing-go + version: v1.2.0 + licenses: + - Apache-2.0 - name: github.com/pborman/uuid version: v1.2.0 licenses: @@ -861,7 +919,7 @@ dependencies: - Apache-2.0 - MIT - name: github.com/pierrec/lz4 - version: v2.5.2+incompatible + version: v2.6.0+incompatible licenses: - BSD-3-Clause - name: github.com/pkg/errors @@ -881,7 +939,7 @@ dependencies: licenses: - Apache-2.0 - name: github.com/rcrowley/go-metrics - version: v0.0.0-20200313005456-10cdbea86bc0 + version: v0.0.0-20201227073835-cf1acfcdf475 licenses: - BSD-2-Clause-Views - name: github.com/rogpeppe/go-internal @@ -977,11 +1035,11 @@ dependencies: licenses: - Apache-2.0 - name: github.com/xdg/scram - version: v0.0.0-20180814205039-7eeb5667e42c + version: v1.0.3 licenses: - Apache-2.0 - name: github.com/xdg/stringprep - version: v1.0.0 + version: v1.0.3 licenses: - Apache-2.0 - name: github.com/youmark/pkcs8 @@ -989,7 +1047,7 @@ dependencies: licenses: - MIT - name: github.com/yuin/goldmark - version: v1.2.1 + version: v1.4.0 licenses: - MIT - name: github.com/zclconf/go-cty @@ -1001,7 +1059,7 @@ dependencies: licenses: - MIT - name: go.mongodb.org/mongo-driver - version: v1.5.1 + version: v1.8.2 licenses: - Apache-2.0 - name: go.opencensus.io @@ -1014,54 +1072,76 @@ dependencies: - BSD-3-Clause - name: golang.org/x/exp version: v0.0.0-20200224162631-6cc2880d07d6 + licenses: + - BSD-3-Clause - name: golang.org/x/image version: v0.0.0-20190802002840-cff245a6509b licenses: - BSD-3-Clause - name: golang.org/x/lint version: v0.0.0-20200302205851-738671d3881b + licenses: + - BSD-3-Clause - name: golang.org/x/mobile version: v0.0.0-20190719004257-d2bd2a29d028 licenses: - BSD-3-Clause - name: golang.org/x/mod - version: v0.3.0 + version: v0.4.2 + licenses: + - BSD-3-Clause - name: golang.org/x/net - version: v0.0.0-20210614182718-04defd469f4e + version: v0.0.0-20220107192237-5cfca573fb4d licenses: - BSD-3-Clause - name: golang.org/x/oauth2 - version: v0.0.0-20200107190931-bf48bf16ab8d + version: v0.0.0-20200902213428-5d25da1a8d43 + licenses: + - BSD-3-Clause - name: golang.org/x/sync - version: v0.0.0-20201020160332-67f06af15bc9 + version: v0.0.0-20210220032951-036812b2e83c licenses: - BSD-3-Clause - name: golang.org/x/sys - version: v0.0.0-20210615035016-665e8c7367d1 + version: v0.0.0-20211004093028-2c5d950f24ef + licenses: + - BSD-3-Clause - name: golang.org/x/term version: v0.0.0-20201126162022-7de9c90e9dd1 + licenses: + - BSD-3-Clause - name: golang.org/x/text - version: v0.3.6 + version: v0.3.7 licenses: - BSD-3-Clause - name: golang.org/x/time version: v0.0.0-20191024005414-555d28b269f0 + licenses: + - BSD-3-Clause - name: golang.org/x/tools - version: v0.0.0-20210107193943-4ed967dd8eff + version: v0.1.7 + licenses: + - BSD-3-Clause - name: golang.org/x/xerrors version: v0.0.0-20200804184101-5ec99f83aff1 licenses: - BSD-3-Clause - name: google.golang.org/api - version: v0.29.0 + version: v0.34.0 + licenses: + - BSD-3-Clause - name: google.golang.org/appengine version: v1.6.6 + licenses: + - Apache-2.0 - name: google.golang.org/genproto - version: v0.0.0-20200711021454-869866162049 + version: v0.0.0-20200904004341-0bd0a958aa1d licenses: - Apache-2.0 - name: google.golang.org/grpc version: v1.32.0 + licenses: + - Apache-2.0 - name: google.golang.org/protobuf version: v1.26.0 licenses: @@ -1072,61 +1152,61 @@ dependencies: - BSD-2-Clause - name: gopkg.in/cheggaaa/pb.v1 version: v1.0.27 + licenses: + - BSD-3-Clause - name: gopkg.in/errgo.v2 version: v2.1.0 licenses: - BSD-3-Clause - name: gopkg.in/fsnotify.v1 version: v1.4.7 + licenses: + - BSD-3-Clause - name: gopkg.in/go-playground/assert.v1 version: v1.2.1 + licenses: + - MIT - name: gopkg.in/go-playground/validator.v9 version: v9.31.0 licenses: - MIT - name: gopkg.in/h2non/gock.v1 version: v1.0.15 - - name: gopkg.in/jcmturner/aescts.v1 - version: v1.0.1 licenses: - - Apache-2.0 - - name: gopkg.in/jcmturner/dnsutils.v1 - version: v1.0.1 - - name: gopkg.in/jcmturner/goidentity.v3 - version: v3.0.0 - licenses: - - Apache-2.0 - - name: gopkg.in/jcmturner/gokrb5.v7 - version: v7.5.0 - licenses: - - Apache-2.0 - - name: gopkg.in/jcmturner/rpc.v1 - version: v1.1.0 - licenses: - - Apache-2.0 + - MIT - name: gopkg.in/tomb.v1 version: v1.0.0-20141024135613-dd632973f1e7 licenses: - BSD-3-Clause - name: gopkg.in/warnings.v0 version: v0.1.2 + licenses: + - BSD-2-Clause - name: gopkg.in/yaml.v2 version: v2.4.0 + licenses: + - Apache-2.0 - name: gopkg.in/yaml.v3 - version: v3.0.0-20200615113413-eeeca48fe776 + version: v3.0.0-20210107192922-496545a6307b licenses: - Apache-2.0 - MIT - name: gotest.tools version: v2.2.0+incompatible + licenses: + - Apache-2.0 - name: honnef.co/go/tools version: v0.0.1-2020.1.4 licenses: - MIT - name: rsc.io/binaryregexp version: v0.2.0 + licenses: + - BSD-3-Clause - name: rsc.io/quote/v3 version: v3.1.0 + licenses: + - BSD-3-Clause - name: rsc.io/sampler version: v1.3.0 licenses: diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.secrets.baseline b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.secrets.baseline index b24c8f7fcb..ab919bca7a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.secrets.baseline +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2022-01-05T05:23:43Z", + "generated_at": "2022-03-10T13:13:24Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -25,6 +25,7 @@ "name": "CloudantDetector" }, { + "ghe_instance": "github.ibm.com", "name": "GheDetector" }, { @@ -372,6 +373,22 @@ "line_number": 387, "type": "Secret Keyword", "verified_result": null + }, + { + "hashed_secret": "e6cfce8e28aea11eeb9b2aad303e00f925d98956", + "is_secret": false, + "is_verified": false, + "line_number": 410, + "type": "Base64 High Entropy String", + "verified_result": null + }, + { + "hashed_secret": "f7c706d9162cfde26794131ec6925c6ac611791b", + "is_secret": false, + "is_verified": false, + "line_number": 410, + "type": "Secret Keyword", + "verified_result": null } ], "examples/ibm-cloudant/README.md": [ @@ -600,12 +617,22 @@ "verified_result": null } ], - "ibm/config.go": [ + "ibm/acctest/acctest.go": [ + { + "hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6", + "is_secret": false, + "is_verified": false, + "line_number": 676, + "type": "Base64 High Entropy String", + "verified_result": null + } + ], + "ibm/conns/config.go": [ { "hashed_secret": "9184b0c38101bf24d78b2bb0d044deb1d33696fc", "is_secret": false, "is_verified": false, - "line_number": 117, + "line_number": 119, "type": "Secret Keyword", "verified_result": null }, @@ -613,769 +640,725 @@ "hashed_secret": "c427f185ddcb2440be9b77c8e45f1cd487a2e790", "is_secret": false, "is_verified": false, - "line_number": 1275, + "line_number": 1298, "type": "Base64 High Entropy String", "verified_result": null }, { - "hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670", + "hashed_secret": "1f7e33de15e22de9d2eaf502df284ed25ca40018", "is_secret": false, "is_verified": false, - "line_number": 2814, + "line_number": 1366, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6", + "hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670", "is_secret": false, "is_verified": false, - "line_number": 2827, + "line_number": 2885, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1", + "hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6", "is_secret": false, "is_verified": false, - "line_number": 2868, + "line_number": 2898, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/data_source_ibm_appid_apm.go": [ + }, { - "hashed_secret": "84a3a4ff86292fad58ec0eec3a93709800529589", + "hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1", "is_secret": false, "is_verified": false, - "line_number": 208, + "line_number": 2939, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_appid_applications.go": [ + "ibm/flex/structures.go": [ { - "hashed_secret": "b6122eb93901a6a608aa89377c682fbd5b16747a", + "hashed_secret": "da8cae6284528565678de15e03d461e23fe22538", "is_secret": false, "is_verified": false, - "line_number": 93, + "line_number": 1507, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_appid_cloud_directory_user_test.go": [ + "ibm/provider/provider.go": [ { - "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", + "hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9", "is_secret": false, "is_verified": false, - "line_number": 54, + "line_number": 1161, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/data_source_ibm_appid_idp_facebook.go": [ + }, { - "hashed_secret": "eb859276410a946f256b404b51f269e031785e40", + "hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437", "is_secret": false, "is_verified": false, - "line_number": 95, + "line_number": 1167, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_appid_idp_facebook_test.go": [ + "ibm/service/apigateway/resource_ibm_api_gateway_endpoint_subscription.go": [ { - "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", + "hashed_secret": "a2a34b8bdbe4d81821c05f2467b5dcdfa72557b9", "is_secret": false, "is_verified": false, - "line_number": 35, + "line_number": 109, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/data_source_ibm_appid_idp_google.go": [ + }, { - "hashed_secret": "eb859276410a946f256b404b51f269e031785e40", + "hashed_secret": "2d1782d8a065e113961a49011478089bf93115d9", "is_secret": false, "is_verified": false, - "line_number": 94, + "line_number": 114, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/data_source_ibm_appid_idp_google_test.go": [ + }, { - "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", + "hashed_secret": "ce1e10abfd561d0a80450a58ce9c4d620b46d39c", "is_secret": false, "is_verified": false, - "line_number": 35, + "line_number": 215, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_appid_mfa_channel.go": [ + "ibm/service/appid/data_source_ibm_appid_apm.go": [ { - "hashed_secret": "48d6932de081fbdf806d471c3b184d1842e3e427", + "hashed_secret": "84a3a4ff86292fad58ec0eec3a93709800529589", "is_secret": false, "is_verified": false, - "line_number": 81, + "line_number": 210, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_appid_mfa_channel_test.go": [ + "ibm/service/appid/data_source_ibm_appid_applications.go": [ { - "hashed_secret": "478274e7b5bddd2557bdb8e509595598928731f9", + "hashed_secret": "b6122eb93901a6a608aa89377c682fbd5b16747a", "is_secret": false, "is_verified": false, - "line_number": 37, + "line_number": 95, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_appid_user_roles_test.go": [ + "ibm/service/appid/data_source_ibm_appid_cloud_directory_user_test.go": [ { "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", "is_secret": false, "is_verified": false, - "line_number": 45, + "line_number": 57, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_atracker_routes_test.go": [ + "ibm/service/appid/data_source_ibm_appid_idp_facebook.go": [ { - "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", + "hashed_secret": "eb859276410a946f256b404b51f269e031785e40", "is_secret": false, "is_verified": false, - "line_number": 44, + "line_number": 97, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_atracker_targets.go": [ + "ibm/service/appid/data_source_ibm_appid_idp_facebook_test.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", - "is_secret": false, - "is_verified": false, - "line_number": 80, - "type": "Secret Keyword", - "verified_result": null - }, - { - "hashed_secret": "9e86b58b88134560e12ab81945d2e5e464ffd46c", + "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", "is_secret": false, "is_verified": false, - "line_number": 247, + "line_number": 38, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_atracker_targets_test.go": [ + "ibm/service/appid/data_source_ibm_appid_idp_google.go": [ { - "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", + "hashed_secret": "eb859276410a946f256b404b51f269e031785e40", "is_secret": false, "is_verified": false, - "line_number": 44, + "line_number": 96, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_cbr_rule_test.go": [ + "ibm/service/appid/data_source_ibm_appid_idp_google_test.go": [ { - "hashed_secret": "565a143eb50b2b9265143febed766438753c7b65", + "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", "is_secret": false, "is_verified": false, - "line_number": 99, - "type": "Hex High Entropy String", + "line_number": 38, + "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_cis_waf_groups_test.go": [ + "ibm/service/appid/data_source_ibm_appid_mfa_channel.go": [ { - "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", + "hashed_secret": "48d6932de081fbdf806d471c3b184d1842e3e427", "is_secret": false, "is_verified": false, - "line_number": 33, - "type": "Hex High Entropy String", + "line_number": 83, + "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_cis_waf_rules_test.go": [ + "ibm/service/appid/data_source_ibm_appid_mfa_channel_test.go": [ { - "hashed_secret": "4fa34387af5471f6ee44b12c663122418ba7085a", + "hashed_secret": "478274e7b5bddd2557bdb8e509595598928731f9", "is_secret": false, "is_verified": false, - "line_number": 32, - "type": "Hex High Entropy String", + "line_number": 40, + "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_cloudant.go": [ + "ibm/service/appid/data_source_ibm_appid_user_roles_test.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", - "is_secret": false, - "is_verified": false, - "line_number": 81, - "type": "Secret Keyword", - "verified_result": null - }, - { - "hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c", + "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", "is_secret": false, "is_verified": false, - "line_number": 84, + "line_number": 47, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_cos_bucket.go": [ + "ibm/service/appid/resource_ibm_appid_cloud_directory_user.go": [ { - "hashed_secret": "884a58e4c2c5d195d3876787bdc63af6c5af2924", + "hashed_secret": "20a25bac21219ffff1904bde871ded4027eca2f8", "is_secret": false, "is_verified": false, - "line_number": 344, + "line_number": 319, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_iam_account_settings.go": [ - { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", - "is_secret": false, - "is_verified": false, - "line_number": 38, - "type": "Secret Keyword", - "verified_result": null - }, + "ibm/service/appid/resource_ibm_appid_cloud_directory_user_test.go": [ { - "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", + "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", "is_secret": false, "is_verified": false, - "line_number": 150, + "line_number": 61, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_iam_api_key.go": [ + "ibm/service/appid/resource_ibm_appid_idp_facebook_test.go": [ { - "hashed_secret": "5fb0fa884132a8724a8d7cba55853737e442adbd", + "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", "is_secret": false, "is_verified": false, - "line_number": 35, + "line_number": 42, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_resource_key.go": [ + "ibm/service/appid/resource_ibm_appid_idp_google_test.go": [ { - "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", + "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", "is_secret": false, "is_verified": false, - "line_number": 146, + "line_number": 42, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_satellite_endpoint.go": [ + "ibm/service/appid/resource_ibm_appid_mfa_channel.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "48d6932de081fbdf806d471c3b184d1842e3e427", "is_secret": false, "is_verified": false, - "line_number": 76, + "line_number": 93, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", + "hashed_secret": "4c66c898545a69ad3f97654627836c31727b58f0", "is_secret": false, "is_verified": false, - "line_number": 361, + "line_number": 162, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_satellite_endpoint_test.go": [ + "ibm/service/appid/resource_ibm_appid_mfa_channel_test.go": [ { - "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", + "hashed_secret": "478274e7b5bddd2557bdb8e509595598928731f9", "is_secret": false, "is_verified": false, - "line_number": 141, + "line_number": 44, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_schematics_action.go": [ + "ibm/service/appid/resource_ibm_appid_user_roles_test.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", "is_secret": false, "is_verified": false, - "line_number": 210, + "line_number": 52, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/atracker/data_source_ibm_atracker_routes_test.go": [ { - "hashed_secret": "49f3bb8f759241df51c899d3725d877bad58f66e", + "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", "is_secret": false, "is_verified": false, - "line_number": 1220, + "line_number": 46, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_secrets_manager_secret.go": [ + "ibm/service/atracker/data_source_ibm_atracker_targets.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "9e86b58b88134560e12ab81945d2e5e464ffd46c", "is_secret": false, "is_verified": false, - "line_number": 210, + "line_number": 248, "type": "Secret Keyword", "verified_result": null } ], - "ibm/data_source_ibm_secrets_manager_secrets.go": [ + "ibm/service/atracker/data_source_ibm_atracker_targets_test.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", "is_secret": false, "is_verified": false, - "line_number": 221, + "line_number": 46, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/atracker/resource_ibm_atracker_route_test.go": [ { - "hashed_secret": "09c0dfbba1f2b2576cfbac116e13b0258bc26bfa", + "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", "is_secret": false, "is_verified": false, - "line_number": 465, + "line_number": 67, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/atracker/resource_ibm_atracker_target.go": [ { - "hashed_secret": "d282ab8a33d987146dda0381b4effdf2d91c0d65", + "hashed_secret": "d2a08705a631470e0b30cba351390dd1a13a7449", "is_secret": false, "is_verified": false, - "line_number": 471, + "line_number": 242, "type": "Secret Keyword", "verified_result": null } ], - "ibm/provider.go": [ + "ibm/service/atracker/resource_ibm_atracker_target_test.go": [ { - "hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9", + "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", "is_secret": false, "is_verified": false, - "line_number": 1066, + "line_number": 66, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/cis/data_source_ibm_cis_waf_groups_test.go": [ { - "hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437", + "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", "is_secret": false, "is_verified": false, - "line_number": 1072, - "type": "Secret Keyword", + "line_number": 34, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/provider_test.go": [ + "ibm/service/cis/data_source_ibm_cis_waf_rules_test.go": [ { - "hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6", + "hashed_secret": "4fa34387af5471f6ee44b12c663122418ba7085a", "is_secret": false, "is_verified": false, - "line_number": 617, - "type": "Base64 High Entropy String", + "line_number": 33, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_api_gateway_endpoint_subscription.go": [ + "ibm/service/cis/resource_ibm_cis_alert_test.go": [ { - "hashed_secret": "a2a34b8bdbe4d81821c05f2467b5dcdfa72557b9", + "hashed_secret": "5d2e5964fbe399b5279b24d5acd0b08e9132e9db", "is_secret": false, "is_verified": false, - "line_number": 107, + "line_number": 115, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "2d1782d8a065e113961a49011478089bf93115d9", + "hashed_secret": "669aef98a087327df6e90c4aab9a0b38cbe27563", "is_secret": false, "is_verified": false, - "line_number": 112, - "type": "Secret Keyword", + "line_number": 115, + "type": "Base64 High Entropy String", "verified_result": null }, { - "hashed_secret": "ce1e10abfd561d0a80450a58ce9c4d620b46d39c", + "hashed_secret": "ddfb928ed19bb8eb79376a630a96f83f0387b1c1", "is_secret": false, "is_verified": false, - "line_number": 213, - "type": "Secret Keyword", + "line_number": 148, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_appid_cloud_directory_user.go": [ + "ibm/service/cis/resource_ibm_cis_alert_webhook_test.go": [ { - "hashed_secret": "20a25bac21219ffff1904bde871ded4027eca2f8", + "hashed_secret": "90d2eb4a47491c95ddcc59ef7bd96bd14f28a50b", "is_secret": false, "is_verified": false, - "line_number": 318, + "line_number": 81, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_appid_cloud_directory_user_test.go": [ + }, { - "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", + "hashed_secret": "ff8c146e7d5cb11215df1b347ad14dccd5efff25", "is_secret": false, "is_verified": false, - "line_number": 56, + "line_number": 92, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_appid_idp_facebook_test.go": [ + "ibm/service/cis/resource_ibm_cis_certificate_upload_test.go": [ { - "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", + "hashed_secret": "563feb86d4a90eb00c8d274d0aa8528b929f21d3", "is_secret": false, "is_verified": false, - "line_number": 38, + "line_number": 194, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_appid_idp_google_test.go": [ + "ibm/service/cis/resource_ibm_cis_domain_settings.go": [ { - "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", + "hashed_secret": "5a18bef73f31ac1a84a963be1a2c6cdbb7830c93", "is_secret": false, "is_verified": false, - "line_number": 38, + "line_number": 41, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_appid_mfa_channel.go": [ + "ibm/service/cis/resource_ibm_cis_domain_settings_test.go": [ { - "hashed_secret": "48d6932de081fbdf806d471c3b184d1842e3e427", - "is_secret": false, - "is_verified": false, - "line_number": 91, - "type": "Secret Keyword", - "verified_result": null - }, - { - "hashed_secret": "4c66c898545a69ad3f97654627836c31727b58f0", + "hashed_secret": "db3d405b10675998c030223177d42e71b4e7a312", "is_secret": false, "is_verified": false, - "line_number": 160, + "line_number": 140, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_appid_mfa_channel_test.go": [ + "ibm/service/cis/resource_ibm_cis_waf_group_test.go": [ { - "hashed_secret": "478274e7b5bddd2557bdb8e509595598928731f9", + "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", "is_secret": false, "is_verified": false, - "line_number": 40, - "type": "Secret Keyword", + "line_number": 82, + "type": "Hex High Entropy String", "verified_result": null - } - ], - "ibm/resource_ibm_appid_user_roles_test.go": [ + }, { - "hashed_secret": "57b2ad99044d337197c0c39fd3823568ff81e48a", + "hashed_secret": "1f1c2ad5fded044aae42281c1fd4253dd624bf65", "is_secret": false, "is_verified": false, - "line_number": 48, - "type": "Secret Keyword", + "line_number": 83, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_atracker_route_test.go": [ + "ibm/service/cis/resource_ibm_cis_waf_package_test.go": [ { - "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", + "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", "is_secret": false, "is_verified": false, - "line_number": 64, - "type": "Secret Keyword", + "line_number": 79, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_atracker_target.go": [ + "ibm/service/cis/resource_ibm_cis_waf_rule_test.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", "is_secret": false, "is_verified": false, - "line_number": 63, - "type": "Secret Keyword", + "line_number": 104, + "type": "Hex High Entropy String", "verified_result": null }, { - "hashed_secret": "d2a08705a631470e0b30cba351390dd1a13a7449", + "hashed_secret": "4fa34387af5471f6ee44b12c663122418ba7085a", "is_secret": false, "is_verified": false, - "line_number": 239, - "type": "Secret Keyword", + "line_number": 126, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_atracker_target_test.go": [ + "ibm/service/classicinfrastructure/resource_ibm_compute_ssl_certificate_test.go": [ { - "hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad", + "hashed_secret": "73ea03a8ecf302473234e7b9016d47840f295dea", "is_secret": false, "is_verified": false, - "line_number": 63, + "line_number": 225, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_cbr_rule_test.go": [ + }, { - "hashed_secret": "565a143eb50b2b9265143febed766438753c7b65", + "hashed_secret": "be4fc4886bd949b369d5e092eb87494f12e57e5b", "is_secret": false, "is_verified": false, - "line_number": 102, - "type": "Hex High Entropy String", + "line_number": 226, + "type": "Private Key", "verified_result": null } ], - "ibm/resource_ibm_cis_certificate_upload_test.go": [ + "ibm/service/classicinfrastructure/resource_ibm_compute_user_test.go": [ { - "hashed_secret": "563feb86d4a90eb00c8d274d0aa8528b929f21d3", + "hashed_secret": "0f321d14d4c62b4a9d22eee7b593f2ae298bc450", "is_secret": false, "is_verified": false, - "line_number": 190, + "line_number": 267, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_cis_domain_settings.go": [ + }, { - "hashed_secret": "5a18bef73f31ac1a84a963be1a2c6cdbb7830c93", + "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", "is_secret": false, "is_verified": false, - "line_number": 38, + "line_number": 311, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_cis_domain_settings_test.go": [ + "ibm/service/classicinfrastructure/resource_ibm_lb_test.go": [ { - "hashed_secret": "db3d405b10675998c030223177d42e71b4e7a312", + "hashed_secret": "73ea03a8ecf302473234e7b9016d47840f295dea", "is_secret": false, "is_verified": false, - "line_number": 138, + "line_number": 282, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_cis_waf_group_test.go": [ - { - "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", - "is_secret": false, - "is_verified": false, - "line_number": 80, - "type": "Hex High Entropy String", - "verified_result": null }, { - "hashed_secret": "1f1c2ad5fded044aae42281c1fd4253dd624bf65", + "hashed_secret": "be4fc4886bd949b369d5e092eb87494f12e57e5b", "is_secret": false, "is_verified": false, - "line_number": 81, - "type": "Hex High Entropy String", + "line_number": 283, + "type": "Private Key", "verified_result": null } ], - "ibm/resource_ibm_cis_waf_package_test.go": [ + "ibm/service/classicinfrastructure/resource_ibm_lb_vpx_ha.go": [ { - "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", + "hashed_secret": "822d5c6193a3fc7ad3bee4567a74ec80bf123aec", "is_secret": false, "is_verified": false, - "line_number": 77, - "type": "Hex High Entropy String", + "line_number": 71, + "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_cis_waf_rule_test.go": [ + }, { - "hashed_secret": "ece6e4a51cf5a18845f07c95832586a96d5fcf4c", + "hashed_secret": "a9b6c7528c36650a7f7d49023e083118c36a3801", "is_secret": false, "is_verified": false, - "line_number": 103, - "type": "Hex High Entropy String", + "line_number": 312, + "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "4fa34387af5471f6ee44b12c663122418ba7085a", + "hashed_secret": "fc245add66be62a862b96d4a8e407d0001b15958", "is_secret": false, "is_verified": false, - "line_number": 125, - "type": "Hex High Entropy String", + "line_number": 313, + "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_cloudant.go": [ + "ibm/service/classicinfrastructure/resource_ibm_lbaas_test.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "73ea03a8ecf302473234e7b9016d47840f295dea", "is_secret": false, "is_verified": false, - "line_number": 90, + "line_number": 718, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c", + "hashed_secret": "be4fc4886bd949b369d5e092eb87494f12e57e5b", "is_secret": false, "is_verified": false, - "line_number": 94, - "type": "Secret Keyword", + "line_number": 719, + "type": "Private Key", "verified_result": null - }, + } + ], + "ibm/service/classicinfrastructure/resource_ibm_storage_block.go": [ { - "hashed_secret": "2e81e24c4d2c84cca06ec032fc31fd9ac5409454", + "hashed_secret": "96c08bf3aa7c0e306a91f2070b1c4e60431de0cd", "is_secret": false, "is_verified": false, - "line_number": 150, + "line_number": 380, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "0498bc9e372a86de4cec00c77e2a05a79c9d0e5f", + "hashed_secret": "bd75aee24db57f494ce19b3361e8041462c6e68a", "is_secret": false, "is_verified": false, - "line_number": 386, + "line_number": 395, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "f75b33f87ffeacb3a4f793a09693e672e07449ff", + "hashed_secret": "e51377b31dcb5fe8420216c57b104d7c0bf1f9de", "is_secret": false, "is_verified": false, - "line_number": 398, + "line_number": 411, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/cloudant/data_source_ibm_cloudant.go": [ { - "hashed_secret": "3db21c9f89f3c840de8358b5af922eb7f9eed330", + "hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c", "is_secret": false, "is_verified": false, - "line_number": 568, + "line_number": 85, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_compute_ssl_certificate.go": [ + "ibm/service/cloudant/resource_ibm_cloudant.go": [ { "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", "is_secret": false, "is_verified": false, - "line_number": 45, + "line_number": 37, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_compute_ssl_certificate_test.go": [ + }, { - "hashed_secret": "73ea03a8ecf302473234e7b9016d47840f295dea", + "hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c", "is_secret": false, "is_verified": false, - "line_number": 223, + "line_number": 97, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "be4fc4886bd949b369d5e092eb87494f12e57e5b", + "hashed_secret": "2e81e24c4d2c84cca06ec032fc31fd9ac5409454", "is_secret": false, "is_verified": false, - "line_number": 224, - "type": "Private Key", + "line_number": 153, + "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_compute_user.go": [ + }, { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "0498bc9e372a86de4cec00c77e2a05a79c9d0e5f", "is_secret": false, "is_verified": false, - "line_number": 118, + "line_number": 389, "type": "Secret Keyword", "verified_result": null - } - ], - "ibm/resource_ibm_compute_user_test.go": [ + }, { - "hashed_secret": "0f321d14d4c62b4a9d22eee7b593f2ae298bc450", + "hashed_secret": "f75b33f87ffeacb3a4f793a09693e672e07449ff", "is_secret": false, "is_verified": false, - "line_number": 262, + "line_number": 401, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", + "hashed_secret": "3db21c9f89f3c840de8358b5af922eb7f9eed330", "is_secret": false, "is_verified": false, - "line_number": 306, + "line_number": 571, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_container_alb_cert.go": [ + "ibm/service/contextbasedrestrictions/data_source_ibm_cbr_rule_test.go": [ { - "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", + "hashed_secret": "565a143eb50b2b9265143febed766438753c7b65", "is_secret": false, "is_verified": false, - "line_number": 318, - "type": "Secret Keyword", + "line_number": 101, + "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_container_cluster.go": [ + "ibm/service/contextbasedrestrictions/resource_ibm_cbr_rule_test.go": [ { - "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", + "hashed_secret": "565a143eb50b2b9265143febed766438753c7b65", + "is_secret": false, + "is_verified": false, + "line_number": 105, + "type": "Hex High Entropy String", + "verified_result": null + } + ], + "ibm/service/cos/data_source_ibm_cos_bucket.go": [ + { + "hashed_secret": "884a58e4c2c5d195d3876787bdc63af6c5af2924", "is_secret": false, "is_verified": false, - "line_number": 1266, + "line_number": 347, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_cos_bucket.go": [ + "ibm/service/cos/resource_ibm_cos_bucket.go": [ { "hashed_secret": "884a58e4c2c5d195d3876787bdc63af6c5af2924", "is_secret": false, "is_verified": false, - "line_number": 1303, + "line_number": 1310, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_cos_bucket_object.go": [ + "ibm/service/cos/resource_ibm_cos_bucket_object.go": [ { "hashed_secret": "b02fa7fd7ca08b5dc86c2548e40f8a21171ef977", "is_secret": false, "is_verified": false, - "line_number": 413, + "line_number": 415, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_cos_bucket_test.go": [ + "ibm/service/cos/resource_ibm_cos_bucket_test.go": [ { "hashed_secret": "988ff3bd9a74260f3e32e115fdd6535aaa5c531a", "is_secret": false, "is_verified": false, - "line_number": 695, + "line_number": 723, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database.go": [ + "ibm/service/database/resource_ibm_database.go": [ { "hashed_secret": "7deb7557ec8b36e7d5958afe3e08959e7f1ba813", "is_secret": false, "is_verified": false, - "line_number": 1165, + "line_number": 1149, "type": "Secret Keyword", "verified_result": null }, @@ -1383,7 +1366,7 @@ "hashed_secret": "b62aab00e3bf482bfb75e3e42fd5d1be72f33ec0", "is_secret": false, "is_verified": false, - "line_number": 1260, + "line_number": 1244, "type": "Secret Keyword", "verified_result": null }, @@ -1391,7 +1374,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 1745, + "line_number": 1729, "type": "Secret Keyword", "verified_result": null }, @@ -1399,127 +1382,127 @@ "hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c", "is_secret": false, "is_verified": false, - "line_number": 1862, + "line_number": 1846, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_cassandra_test.go": [ + "ibm/service/database/resource_ibm_database_cassandra_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 441, + "line_number": 443, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_edb_test.go": [ + "ibm/service/database/resource_ibm_database_edb_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 187, + "line_number": 189, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_elasticsearch_test.go": [ + "ibm/service/database/resource_ibm_database_elasticsearch_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 446, + "line_number": 448, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_etcd_test.go": [ + "ibm/service/database/resource_ibm_database_etcd_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 197, + "line_number": 199, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_mogodb_enterprise_test.go": [ + "ibm/service/database/resource_ibm_database_mogodb_enterprise_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 186, + "line_number": 188, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_mongodb_test.go": [ + "ibm/service/database/resource_ibm_database_mongodb_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 198, + "line_number": 200, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_mysql_test.go": [ + "ibm/service/database/resource_ibm_database_mysql_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 140, + "line_number": 141, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_postgresql_test.go": [ + "ibm/service/database/resource_ibm_database_postgresql_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 562, + "line_number": 576, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_rabbitmq_test.go": [ + "ibm/service/database/resource_ibm_database_rabbitmq_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 202, + "line_number": 204, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_database_redis_test.go": [ + "ibm/service/database/resource_ibm_database_redis_test.go": [ { "hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58", "is_secret": false, "is_verified": false, - "line_number": 211, + "line_number": 213, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_dl_provider_gateway_test.go": [ + "ibm/service/directlink/resource_ibm_dl_provider_gateway_test.go": [ { "hashed_secret": "a184c8ba0974f2e1da4ca1d71f54e1cf40604335", "is_secret": false, "is_verified": false, - "line_number": 21, + "line_number": 25, "type": "Hex High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_event_streams_topic.go": [ + "ibm/service/eventstreams/resource_ibm_event_streams_topic.go": [ { "hashed_secret": "b02fa7fd7ca08b5dc86c2548e40f8a21171ef977", "is_secret": false, "is_verified": false, - "line_number": 257, + "line_number": 259, "type": "Secret Keyword", "verified_result": null }, @@ -1527,25 +1510,37 @@ "hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030", "is_secret": false, "is_verified": false, - "line_number": 294, + "line_number": 296, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_iam_account_settings.go": [ + "ibm/service/iamidentity/data_source_ibm_iam_account_settings.go": [ { - "hashed_secret": "b939bb67ee5f5b13f7997dba58c31813ce8033f0", + "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 20, + "line_number": 151, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/iamidentity/data_source_ibm_iam_api_key.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "5fb0fa884132a8724a8d7cba55853737e442adbd", "is_secret": false, "is_verified": false, - "line_number": 46, + "line_number": 36, + "type": "Secret Keyword", + "verified_result": null + } + ], + "ibm/service/iamidentity/resource_ibm_iam_account_settings.go": [ + { + "hashed_secret": "b939bb67ee5f5b13f7997dba58c31813ce8033f0", + "is_secret": false, + "is_verified": false, + "line_number": 22, "type": "Secret Keyword", "verified_result": null }, @@ -1553,17 +1548,17 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 224, + "line_number": 226, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_iam_account_settings_test.go": [ + "ibm/service/iamidentity/resource_ibm_iam_account_settings_test.go": [ { "hashed_secret": "469f62fa9e1c6afe62e8808180668934ee548e8f", "is_secret": false, "is_verified": false, - "line_number": 18, + "line_number": 21, "type": "Secret Keyword", "verified_result": null }, @@ -1571,35 +1566,27 @@ "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", "is_secret": false, "is_verified": false, - "line_number": 123, + "line_number": 126, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_iam_api_key.go": [ - { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", - "is_secret": false, - "is_verified": false, - "line_number": 46, - "type": "Secret Keyword", - "verified_result": null - }, + "ibm/service/iamidentity/resource_ibm_iam_api_key.go": [ { "hashed_secret": "5fb0fa884132a8724a8d7cba55853737e442adbd", "is_secret": false, "is_verified": false, - "line_number": 83, + "line_number": 85, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_iam_service_api_key.go": [ + "ibm/service/iamidentity/resource_ibm_iam_service_api_key.go": [ { "hashed_secret": "501eb83e0c6d8ceb21b5a6d055b083796d7d2aca", "is_secret": false, "is_verified": false, - "line_number": 152, + "line_number": 154, "type": "Secret Keyword", "verified_result": null }, @@ -1607,137 +1594,117 @@ "hashed_secret": "c60c87855b97236ef66f94370756fc8800d9a655", "is_secret": false, "is_verified": false, - "line_number": 346, + "line_number": 348, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_iam_service_api_key_test.go": [ + "ibm/service/iamidentity/resource_ibm_iam_service_api_key_test.go": [ { "hashed_secret": "675d39217ab6ffbb69d08c62ecf618f6400684c4", "is_secret": false, "is_verified": false, - "line_number": 127, + "line_number": 130, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_kms_key_test.go": [ + "ibm/service/kms/resource_ibm_kms_key_test.go": [ { "hashed_secret": "568dddb6103d4279bdf89c42a203e0f1ebbd3be3", "is_secret": false, "is_verified": false, - "line_number": 22, + "line_number": 24, "type": "Base64 High Entropy String", "verified_result": null } ], - "ibm/resource_ibm_lb_test.go": [ + "ibm/service/kubernetes/resource_ibm_container_alb_cert.go": [ { - "hashed_secret": "73ea03a8ecf302473234e7b9016d47840f295dea", + "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 280, + "line_number": 318, "type": "Secret Keyword", "verified_result": null - }, - { - "hashed_secret": "be4fc4886bd949b369d5e092eb87494f12e57e5b", - "is_secret": false, - "is_verified": false, - "line_number": 281, - "type": "Private Key", - "verified_result": null } ], - "ibm/resource_ibm_lb_vpx_ha.go": [ - { - "hashed_secret": "822d5c6193a3fc7ad3bee4567a74ec80bf123aec", - "is_secret": false, - "is_verified": false, - "line_number": 70, - "type": "Secret Keyword", - "verified_result": null - }, + "ibm/service/kubernetes/resource_ibm_container_cluster.go": [ { - "hashed_secret": "a9b6c7528c36650a7f7d49023e083118c36a3801", + "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 311, + "line_number": 1289, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/pushnotification/resource_ibm_push_notification_chrome.go": [ { - "hashed_secret": "fc245add66be62a862b96d4a8e407d0001b15958", + "hashed_secret": "8a4036fbf3e13c7a84bac77ddae25de1cdfc4d43", "is_secret": false, "is_verified": false, - "line_number": 312, + "line_number": 53, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_lbaas_test.go": [ + "ibm/service/resourcecontroller/data_source_ibm_resource_key.go": [ { - "hashed_secret": "73ea03a8ecf302473234e7b9016d47840f295dea", + "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 715, + "line_number": 147, "type": "Secret Keyword", "verified_result": null - }, - { - "hashed_secret": "be4fc4886bd949b369d5e092eb87494f12e57e5b", - "is_secret": false, - "is_verified": false, - "line_number": 716, - "type": "Private Key", - "verified_result": null } ], - "ibm/resource_ibm_push_notification_chrome.go": [ + "ibm/service/resourcecontroller/resource_ibm_resource_key.go": [ { - "hashed_secret": "8a4036fbf3e13c7a84bac77ddae25de1cdfc4d43", + "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 51, + "line_number": 294, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_resource_key.go": [ + "ibm/service/satellite/data_source_ibm_satellite_endpoint.go": [ { "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 293, + "line_number": 362, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_satellite_cluster.go": [ + "ibm/service/satellite/data_source_ibm_satellite_endpoint_test.go": [ { - "hashed_secret": "3c2ecad9b250fd6d99893e4d05ec02ca19aa95d0", + "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", "is_secret": false, "is_verified": false, - "line_number": 335, + "line_number": 143, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_satellite_endpoint.go": [ + "ibm/service/satellite/resource_ibm_satellite_cluster.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "3c2ecad9b250fd6d99893e4d05ec02ca19aa95d0", "is_secret": false, "is_verified": false, - "line_number": 82, + "line_number": 359, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/satellite/resource_ibm_satellite_endpoint.go": [ { "hashed_secret": "04ce67274f70b5a291530f3b9543bbdca8667a28", "is_secret": false, "is_verified": false, - "line_number": 541, + "line_number": 544, "type": "SoftLayer Credentials", "verified_result": null }, @@ -1745,63 +1712,57 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 635, + "line_number": 638, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_satellite_endpoint_test.go": [ + "ibm/service/satellite/resource_ibm_satellite_endpoint_test.go": [ { "hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3", "is_secret": false, "is_verified": false, - "line_number": 161, + "line_number": 165, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_scc_posture_credential.go": [ - { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", - "is_secret": false, - "is_verified": false, - "line_number": 59, - "type": "Secret Keyword", - "verified_result": null - }, + "ibm/service/scc/resource_ibm_scc_posture_credential.go": [ { "hashed_secret": "0c0aa212475d8c2a2e0c559fcfc5a67cae2af9ba", "is_secret": false, "is_verified": false, - "line_number": 227, + "line_number": 235, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_scc_posture_credential_test.go": [ + "ibm/service/scc/resource_ibm_scc_posture_credential_test.go": [ { "hashed_secret": "90e44ac970207581d8b44f5e5aeae6f5ad903e74", "is_secret": false, "is_verified": false, - "line_number": 76, + "line_number": 78, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_schematics_action.go": [ + "ibm/service/schematics/data_source_ibm_schematics_action.go": [ { - "hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4", + "hashed_secret": "49f3bb8f759241df51c899d3725d877bad58f66e", "is_secret": false, "is_verified": false, - "line_number": 223, + "line_number": 1222, "type": "Secret Keyword", "verified_result": null - }, + } + ], + "ibm/service/schematics/resource_ibm_schematics_action.go": [ { "hashed_secret": "49f3bb8f759241df51c899d3725d877bad58f66e", "is_secret": false, "is_verified": false, - "line_number": 1380, + "line_number": 1383, "type": "Secret Keyword", "verified_result": null }, @@ -1809,43 +1770,25 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 1383, + "line_number": 1386, "type": "Secret Keyword", "verified_result": null } ], - "ibm/resource_ibm_storage_block.go": [ + "ibm/service/secretsmanager/data_source_ibm_secrets_manager_secrets.go": [ { - "hashed_secret": "96c08bf3aa7c0e306a91f2070b1c4e60431de0cd", - "is_secret": false, - "is_verified": false, - "line_number": 379, - "type": "Secret Keyword", - "verified_result": null - }, - { - "hashed_secret": "bd75aee24db57f494ce19b3361e8041462c6e68a", + "hashed_secret": "09c0dfbba1f2b2576cfbac116e13b0258bc26bfa", "is_secret": false, "is_verified": false, - "line_number": 394, + "line_number": 467, "type": "Secret Keyword", "verified_result": null }, { - "hashed_secret": "e51377b31dcb5fe8420216c57b104d7c0bf1f9de", - "is_secret": false, - "is_verified": false, - "line_number": 410, - "type": "Secret Keyword", - "verified_result": null - } - ], - "ibm/structures.go": [ - { - "hashed_secret": "da8cae6284528565678de15e03d461e23fe22538", + "hashed_secret": "d282ab8a33d987146dda0381b4effdf2d91c0d65", "is_secret": false, "is_verified": false, - "line_number": 1465, + "line_number": 473, "type": "Secret Keyword", "verified_result": null } @@ -1978,6 +1921,24 @@ "verified_result": null } ], + "website/docs/r/cis_alert.html.markdown": [ + { + "hashed_secret": "90d2eb4a47491c95ddcc59ef7bd96bd14f28a50b", + "is_secret": false, + "is_verified": false, + "line_number": 21, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "ddfb928ed19bb8eb79376a630a96f83f0387b1c1", + "is_secret": false, + "is_verified": false, + "line_number": 55, + "type": "Hex High Entropy String", + "verified_result": null + } + ], "website/docs/r/cis_certificate_upload.html.markdown": [ { "hashed_secret": "5f1cf41887644d752e73a85765cb40139c0dbb24", @@ -2036,6 +1997,16 @@ "verified_result": null } ], + "website/docs/r/cis_webhook.html.markdown": [ + { + "hashed_secret": "90d2eb4a47491c95ddcc59ef7bd96bd14f28a50b", + "is_secret": false, + "is_verified": false, + "line_number": 21, + "type": "Secret Keyword", + "verified_result": null + } + ], "website/docs/r/cloudant.html.markdown": [ { "hashed_secret": "4a0a2df96d4c9a13a282268cab33ac4b8cbb2c72", @@ -2157,7 +2128,7 @@ "hashed_secret": "19463ab0c6cf2c8f229c8c9666f2f784edf6bb4f", "is_secret": false, "is_verified": false, - "line_number": 160, + "line_number": 165, "type": "Secret Keyword", "verified_result": null } @@ -2203,7 +2174,7 @@ } ] }, - "version": "0.13.1+ibm.31.dss", + "version": "0.13.1+ibm.47.dss", "word_list": { "file": null, "hash": null diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/CHANGELOG.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/CHANGELOG.md index af83d1fbc5..66d90d29e6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/CHANGELOG.md +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/CHANGELOG.md @@ -1,3 +1,306 @@ +# 1.40.1 (Apr08, 2022) +BUGFIXES: + Allow 0 allocation for optional scaling group types ([3714](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3714)) + +# 1.40.0 (Mar31, 2022) +Features +* Support VPC Infrastructure + - **DataSources** + - ibm_is_lb_listener + - ibm_is_lb_listeners + - ibm_is_lb_listener_policies + - ibm_is_lb_listener_policy + - ibm_is_lb_listener_policy_rule + - ibm_is_lb_listener_policy_rules + - ibm_is_security_groups + - ibm_is_security_group_rule + - ibm_is_security_group_rules + - ibm_is_ipsec_policy + - ibm_is_ipsec_policies + - ibm_is_ike_policies + - ibm_is_ike_policy + - **Resources** + - ibm_is_subnet_public_gateway_attachment + - ibm_is_subnet_routing_table_attachment +* Support Transist Gateway + - **DataSources** + - ibm_tg_route_report + - ibm_tg_route_reports + - **Resources** + - ibm_tg_route_report +* Support CIS + - **DataSources** + - ibm_cis_alerts + - **Resources** + - ibm_cis_alerts + +* Support Power Instance + - **Datasources** + - ibm_pi_storage_pool_capacity + - ibm_pi_storage_pools_capacity + - ibm_pi_storage_type_capacity + - ibm_pi_storage_types_capacity + +ENHANCEMENTS: +* Support resize boot volume for VPC instance ([2205](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2205)) +* Support to allow SAP create with a placement group ([3633](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3633)) +* Support VM Host Failure - Available Policy Development ([3604](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3604)) +* Support default forwarding rule in custom resolver ([3588](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3588)) +* Support trusted-profiles for access group members ([3651](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3651)) +* Authorization policy to support any service specific attributes ([3482](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3482)) +* Move `name` as optional argument in ibm_is_region datasource ([3431](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3431)) +* Add note for disabled VTL creation ([3693](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3693)) + +BUGFIXES: +* resource_ibm_is_virtual_endpoint_gateway does not allow for full name character limit ([3606](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3606)) +* Added the doc support for endpoint gateway identifier ([3649](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3649)) +* Fixing resource_attributes to support the service specific roles ([3648](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3648)) +* endpoint gateways target datasource fix, interchanging the order and including other targets ([3492](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3492)) + +# 1.40.0-beta0 (Mar17, 2022) +Features +* Support VPC Infrastructure + - **DataSources** + - ibm_is_lb_listener + - ibm_is_lb_listeners + - ibm_is_lb_listener_policies + - ibm_is_lb_listener_policy + - ibm_is_lb_listener_policy_rule + - ibm_is_lb_listener_policy_rules + - ibm_is_security_groups + - ibm_is_security_group_rule + - ibm_is_security_group_rules + - ibm_is_ipsec_policy + - ibm_is_ipsec_policies + - ibm_is_ike_policies + - ibm_is_ike_policy + - **Resources** + - ibm_is_subnet_public_gateway_attachment + - ibm_is_subnet_routing_table_attachment +* Support Transist Gateway + - **DataSources** + - ibm_tg_route_report + - ibm_tg_route_reports + - **Resources** + - ibm_tg_route_report +* Support CIS + - **DataSources** + - ibm_cis_alerts + - **Resources** + - ibm_cis_alerts + +* Support Power Instance + - **Datasources** + - ibm_pi_storage_pool_capacity + - ibm_pi_storage_pools_capacity + - ibm_pi_storage_type_capacity + - ibm_pi_storage_types_capacity + +ENHANCEMENTS: +* Support resize boot volume for VPC instance ([2205](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2205)) +* Support to allow SAP create with a placement group ([3633](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3633)) +* Support VM Host Failure - Available Policy Development ([3604](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3604)) +* Support default forwarding rule in custom resolver ([3588](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3588)) +* Support trusted-profiles for access group members ([3651](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3651)) +* Authorization policy to support any service specific attributes ([3482](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3482)) +* Move `name` as optional argument in ibm_is_region datasource ([3431](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3431)) + +BUGFIXES: +* resource_ibm_is_virtual_endpoint_gateway does not allow for full name character limit ([3606](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3606)) +* Added the doc support for endpoint gateway identifier ([3649](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3649)) +* Fixing resource_attributes to support the service specific roles ([3648](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3648)) +* endpoint gateways target datasource fix, interchanging the order and including other targets ([3492](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3492)) + +# 1.39.2 (Mar11, 2022) +BUGFIXES: +* fix proxy on kms client ([3634](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3634)) +* Fix crash on resource_instance ([3643](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3643)) +* SCC data.ibm_scc_posture_latest_scans failing ([3594](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3594)) +* Error: Collector Creation in Security Posture Management API service: us region not supported ([3630](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3630)) +* Fix ibm_cloud_shell_account_settings IAM issue ([3654](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3654)) + +# 1.39.1 (Mar02, 2022) +BUGFIXES: +* Fix the breaking change of 1.39.0 release for ibm_is_instance resource for force_new on VSI([3619](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3619)) + +# 1.39.0 (Feb28, 2022) +Features +* Support VPC Infrastructure + - **DataSources** + - ibm_is_lb_pool + - ibm_is_lb_pools + - ibm_is_lb_pool_member + - ibm_is_lb_pool_members + - ibm_is_vpc_address_prefix + - ibm_is_vpc_routing_table + - ibm_is_vpc_routing_table_route + - ibm_is_vpn_gateway + - ibm_is_vpn_gateway_connection + - ibm_is_bare_metal_server_disk + - ibm_is_bare_metal_server_disks + - ibm_is_bare_metal_server_initialization + - ibm_is_bare_metal_server_network_interface_floating_ip + - ibm_is_bare_metal_server_network_interface_floating_ips + - ibm_is_bare_metal_server_network_interface + - ibm_is_bare_metal_server_network_interfaces + - ibm_is_bare_metal_server_profile + - ibm_is_bare_metal_server_profiles + - ibm_is_bare_metal_server + - ibm_is_bare_metal_servers + - **Resources** + - ibm_is_bare_metal_server_action + - ibm_is_bare_metal_server_disk + - ibm_is_bare_metal_server_network_interface_allow_float + - ibm_is_bare_metal_server_network_interface_floating_ip + - ibm_is_bare_metal_server_network_interface + - ibm_is_bare_metal_server +* Support for CIS + - **Datasources** + - ibm_cis_webhooks + - **Resources** + - ibm_cis_webhook + + +ENHANCEMENTS: +* Remove hmac-md5-96 authentication from IPSec VPN policy ([3515](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3515)) +* added status reason in case of failure in is_instance ([3505](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3505)) +* Updated PI IKEPolicy and IPSecPolicy ([3530](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3530)) +* IBM Cloud VPC Documentation Update ([3479](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3479)) +* IKS image security enforcement ([3344](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3344)) +* add check for empty slice ([3528](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3528)) +* push notifications deprecation label ([3550](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3550)) +* Allow passing cloud connection while creating DHCP server ([3559](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3559)) +* Add dns attribute to power network data source ([3551](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3551)) +* Support arm , arm64 for terraform provider ([2626](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2626)) +* Add support to use the new IAMAuthenticatior for token ([3542](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3542)) +* add network update support ([3565](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3565)) +* P10 enablement for SAP ([3534](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3534)) +* implement provider gateway vlan assignment ([3558](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3558)) +* Support storage pool and affinity while importing image ([3543](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3543)) +* Add custom_script argument to satellite_host_script datasource to avoid provider dependancy ([3579](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3579)) +* Add wait_till to satellite_host resource to wait until location normal ([3579](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3579)) +* Snapshot captured at deletable ([3555](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3555)) +* Support access tags in ibm_iam_access_group_policy ([3290](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3290)) +* Bumpup: terraform-plugin-sdk to 2.10.1 ([3613](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3613)) +* support instance metadata and trusted profile ([3616](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3616)) + +BUGFIXES: +* Not able to list all the subnets for a given VPC ([3506](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3506)) +* panic while creating cloud connections ([3498](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3498)) +* schema and test fix for instance group manager action ([3495](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3495)) +* API endpoints for SCC are wrong and cannot be changed ([3524](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3524)) +* log improvement: subnet delete retry logs ([3485](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3485)) +* added a check to check if remote sg id exists in is_security_group_rule ([3493](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3493)) +* document fix for routing table ([3489](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3489)) +* Fix the sub category ([3560](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3560)) +* Added more info for href ([3486](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3486)) +* Subnet pagination fix in is_vpcs datasource ([3537](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3537)) +* Destroy resource group failed with 204 ([3529](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3529)) +* ibm_is_lb resource is silently updating subnet details in state with no actual affect on lb ([3538](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3538)) +* Fixed satellite location immutable error ([3537](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3537)) +* ibm_cloud_shell_account_settings issue ([3289](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3289)) +* typo in "network_interaces" ([3548](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3548)) +* Add additional example to ibm_iam_trusted_profile_policy ([3532](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3532)) +* remove default from resource_group doc as datasource doesnot support ([3564](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3564)) +* Fix: visibility private for vpc ([3578](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3578)) +* Satellite Host Attach Configuration Adds Incorrect Repos ([3576](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3576)) +* Missing Resource Group Id argument in Data block docs ([3586](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3586)) +* container_addons doesnt update version as expected ([3584](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3584)) +* added description for managed_from parameter in satellite location ([3591](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3591)) +* Fix for ibm_pi_volume response ([3598](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3598)) +* Added a check for "Deleted" status of the VPC worker pool ([3595](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3595)) +* Fix: Ignore 500 on getclusterkey in container cluster datasource ([3613](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3613)) +* Power client update to refresh token for every API call ([3614](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3614)) + + +# 1.39.0-beta0 (Feb16, 2022) +Features +* Support VPC Infrastructure + - **DataSources** + - ibm_is_lb_pool + - ibm_is_lb_pools + - ibm_is_lb_pool_member + - ibm_is_lb_pool_members + - ibm_is_vpc_address_prefix + - ibm_is_vpc_routing_table + - ibm_is_vpc_routing_table_route + - ibm_is_vpn_gateway + - ibm_is_vpn_gateway_connection + - ibm_is_bare_metal_server_disk + - ibm_is_bare_metal_server_disks + - ibm_is_bare_metal_server_initialization + - ibm_is_bare_metal_server_network_interface_floating_ip + - ibm_is_bare_metal_server_network_interface_floating_ips + - ibm_is_bare_metal_server_network_interface + - ibm_is_bare_metal_server_network_interfaces + - ibm_is_bare_metal_server_profile + - ibm_is_bare_metal_server_profiles + - ibm_is_bare_metal_server + - ibm_is_bare_metal_servers + - **Resources** + - ibm_is_bare_metal_server_action + - ibm_is_bare_metal_server_disk + - ibm_is_bare_metal_server_network_interface_allow_float + - ibm_is_bare_metal_server_network_interface_floating_ip + - ibm_is_bare_metal_server_network_interface + - ibm_is_bare_metal_server +* Support for CIS + - **Datasources** + - ibm_cis_webhooks + - **Resources** + - ibm_cis_webhook + + +ENHANCEMENTS: +* Remove hmac-md5-96 authentication from IPSec VPN policy ([3515](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3515)) +* added status reason in case of failure in is_instance ([3505](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3505)) +* Updated PI IKEPolicy and IPSecPolicy ([3530](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3530)) +* IBM Cloud VPC Documentation Update ([3479](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3479)) +* IKS image security enforcement ([3344](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3344)) +* add check for empty slice ([3528](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3528)) +* push notifications deprecation label ([3550](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3550)) +* Allow passing cloud connection while creating DHCP server ([3559](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3559)) +* Add dns attribute to power network data source ([3551](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3551)) +* Support arm , arm64 for terraform provider ([2626](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2626)) +* Add support to use the new IAMAuthenticatior for token ([3542](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3542)) +* add network update support ([3565](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3565)) +* P10 enablement for SAP ([3534](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3534)) +* implement provider gateway vlan assignment ([3558](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3558)) +* Support storage pool and affinity while importing image ([3543](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3543)) +* Add custom_script argument to satellite_host_script datasource to avoid provider dependancy ([3579](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3579)) +* Add wait_till to satellite_host resource to wait until location normal ([3579](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3579)) +* Snapshot captured at deletable ([3555](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3555)) +* Support access tags in ibm_iam_access_group_policy ([3290](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3290)) + +BUGFIXES: +* Not able to list all the subnets for a given VPC ([3506](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3506)) +* panic while creating cloud connections ([3498](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3498)) +* schema and test fix for instance group manager action ([3495](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3495)) +* API endpoints for SCC are wrong and cannot be changed ([3524](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3524)) +* log improvement: subnet delete retry logs ([3485](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3485)) +* added a check to check if remote sg id exists in is_security_group_rule ([3493](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3493)) +* document fix for routing table ([3489](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3489)) +* Fix the sub category ([3560](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3560)) +* Added more info for href ([3486](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3486)) +* Subnet pagination fix in is_vpcs datasource ([3537](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3537)) +* Destroy resource group failed with 204 ([3529](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3529)) +* ibm_is_lb resource is silently updating subnet details in state with no actual affect on lb ([3538](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3538)) +* Fixed satellite location immutable error ([3537](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3537)) +* ibm_cloud_shell_account_settings issue ([3289](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3289)) +* typo in "network_interaces" ([3548](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3548)) +* Add additional example to ibm_iam_trusted_profile_policy ([3532](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3532)) +* remove default from resource_group doc as datasource doesnot support ([3564](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3564)) +* Fix: visibility private for vpc ([3578](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3578)) +* Satellite Host Attach Configuration Adds Incorrect Repos ([3576](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3576)) +* Missing Resource Group Id argument in Data block docs ([3586](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3586)) +* container_addons doesnt update version as expected ([3584](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3584)) +* added description for managed_from parameter in satellite location ([3591](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3591)) + +# 1.38.2 (Feb09, 2022) +BugFIXES: +* Updating members_cpu_allocation_count to 0 fails with ibm_database ([3567](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3567)) + + # 1.38.1 (Jan27, 2022) ENHANCEMENTS: * Support intergation of security groups with virtual private endpoint gateway ([3488](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/3488)) @@ -2072,5 +2375,3 @@ BUG FIXES: * example/ibm-key-protect : Updated example to create an authorisation policy between COS and Key Protect instance([#1133](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/1133)) * resource/ibm_resource_group: Removed suppression of error during deletion ([#1108](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/1108)) * resource/ibm_iam_user_invite : Fix for inviting user from IBM Cloud lite account. ([#1114](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/1114)) - - diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/config.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/config.go deleted file mode 100644 index 31202a28e7..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/config.go +++ /dev/null @@ -1,3037 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "crypto/tls" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "log" - "net" - gohttp "net/http" - "os" - "strings" - "time" - - // Added code for the Power Colo Offering - - "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" - "github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1" - apigateway "github.com/IBM/apigateway-go-sdk/apigatewaycontrollerapiv1" - "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" - appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" - "github.com/IBM/container-registry-go-sdk/containerregistryv1" - "github.com/IBM/go-sdk-core/v5/core" - cosconfig "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1" - kp "github.com/IBM/keyprotect-go-client" - ciscachev1 "github.com/IBM/networking-go-sdk/cachingapiv1" - cisipv1 "github.com/IBM/networking-go-sdk/cisipapiv1" - ciscustompagev1 "github.com/IBM/networking-go-sdk/custompagesv1" - dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" - dl "github.com/IBM/networking-go-sdk/directlinkv1" - cisdnsbulkv1 "github.com/IBM/networking-go-sdk/dnsrecordbulkv1" - cisdnsrecordsv1 "github.com/IBM/networking-go-sdk/dnsrecordsv1" - dns "github.com/IBM/networking-go-sdk/dnssvcsv1" - cisedgefunctionv1 "github.com/IBM/networking-go-sdk/edgefunctionsapiv1" - cisfiltersv1 "github.com/IBM/networking-go-sdk/filtersv1" - cisfirewallrulesv1 "github.com/IBM/networking-go-sdk/firewallrulesv1" - cisglbhealthcheckv1 "github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1" - cisglbpoolv0 "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0" - cisglbv1 "github.com/IBM/networking-go-sdk/globalloadbalancerv1" - cispagerulev1 "github.com/IBM/networking-go-sdk/pageruleapiv1" - cisrangeappv1 "github.com/IBM/networking-go-sdk/rangeapplicationsv1" - cisroutingv1 "github.com/IBM/networking-go-sdk/routingv1" - cissslv1 "github.com/IBM/networking-go-sdk/sslcertificateapiv1" - tg "github.com/IBM/networking-go-sdk/transitgatewayapisv1" - cisuarulev1 "github.com/IBM/networking-go-sdk/useragentblockingrulesv1" - ciswafgroupv1 "github.com/IBM/networking-go-sdk/wafrulegroupsapiv1" - ciswafpackagev1 "github.com/IBM/networking-go-sdk/wafrulepackagesapiv1" - ciswafrulev1 "github.com/IBM/networking-go-sdk/wafrulesapiv1" - cisaccessrulev1 "github.com/IBM/networking-go-sdk/zonefirewallaccessrulesv1" - cislockdownv1 "github.com/IBM/networking-go-sdk/zonelockdownv1" - cisratelimitv1 "github.com/IBM/networking-go-sdk/zoneratelimitsv1" - cisdomainsettingsv1 "github.com/IBM/networking-go-sdk/zonessettingsv1" - ciszonesv1 "github.com/IBM/networking-go-sdk/zonesv1" - "github.com/IBM/platform-services-go-sdk/atrackerv1" - "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" - "github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1" - "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" - "github.com/IBM/platform-services-go-sdk/globaltaggingv1" - iamaccessgroups "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" - iamidentity "github.com/IBM/platform-services-go-sdk/iamidentityv1" - iampolicymanagement "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - ibmcloudshellv1 "github.com/IBM/platform-services-go-sdk/ibmcloudshellv1" - resourcecontroller "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" - resourcemanager "github.com/IBM/platform-services-go-sdk/resourcemanagerv2" - "github.com/IBM/push-notifications-go-sdk/pushservicev1" - "github.com/IBM/scc-go-sdk/adminserviceapiv1" - "github.com/IBM/scc-go-sdk/findingsv1" - schematicsv1 "github.com/IBM/schematics-go-sdk/schematicsv1" - "github.com/IBM/secrets-manager-go-sdk/secretsmanagerv1" - vpc "github.com/IBM/vpc-go-sdk/vpcv1" - "github.com/apache/openwhisk-client-go/whisk" - jwt "github.com/golang-jwt/jwt" - slsession "github.com/softlayer/softlayer-go/session" - - bluemix "github.com/IBM-Cloud/bluemix-go" - "github.com/IBM-Cloud/bluemix-go/api/account/accountv1" - "github.com/IBM-Cloud/bluemix-go/api/account/accountv2" - "github.com/IBM-Cloud/bluemix-go/api/certificatemanager" - "github.com/IBM-Cloud/bluemix-go/api/cis/cisv1" - "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" - "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" - "github.com/IBM-Cloud/bluemix-go/api/functions" - "github.com/IBM-Cloud/bluemix-go/api/globalsearch/globalsearchv2" - "github.com/IBM-Cloud/bluemix-go/api/globaltagging/globaltaggingv3" - "github.com/IBM-Cloud/bluemix-go/api/hpcs" - "github.com/IBM-Cloud/bluemix-go/api/icd/icdv4" - "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/controller" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/managementv2" - "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" - "github.com/IBM-Cloud/bluemix-go/authentication" - "github.com/IBM-Cloud/bluemix-go/bmxerror" - "github.com/IBM-Cloud/bluemix-go/http" - "github.com/IBM-Cloud/bluemix-go/rest" - bxsession "github.com/IBM-Cloud/bluemix-go/session" - ibmpisession "github.com/IBM-Cloud/power-go-client/ibmpisession" - "github.com/IBM-Cloud/terraform-provider-ibm/version" - "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" - "github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1" - "github.com/IBM/scc-go-sdk/posturemanagementv1" - "github.com/IBM/scc-go-sdk/posturemanagementv2" -) - -// RetryAPIDelay - retry api delay -const RetryAPIDelay = 5 * time.Second - -//BluemixRegion ... -var BluemixRegion string - -var ( - errEmptyBluemixCredentials = errors.New("ibmcloud_api_key or bluemix_api_key or iam_token and iam_refresh_token must be provided. Please see the documentation on how to configure it") -) - -//UserConfig ... -type UserConfig struct { - userID string - userEmail string - userAccount string - cloudName string `default:"bluemix"` - cloudType string `default:"public"` - generation int `default:"2"` -} - -//Config stores user provider input -type Config struct { - //BluemixAPIKey is the Bluemix api key - BluemixAPIKey string - //Bluemix region - Region string - //Resource group id - ResourceGroup string - //Bluemix API timeout - BluemixTimeout time.Duration - - //Softlayer end point url - SoftLayerEndpointURL string - - //Softlayer API timeout - SoftLayerTimeout time.Duration - - // Softlayer User Name - SoftLayerUserName string - - // Softlayer API Key - SoftLayerAPIKey string - - //Retry Count for API calls - //Unexposed in the schema at this point as they are used only during session creation for a few calls - //When sdk implements it we an expose them for expected behaviour - //https://github.com/softlayer/softlayer-go/issues/41 - RetryCount int - //Constant Retry Delay for API calls - RetryDelay time.Duration - - // FunctionNameSpace ... - FunctionNameSpace string - - //Riaas End point - RiaasEndPoint string - - //Generation - Generation int - - //IAM Token - IAMToken string - - //TrustedProfileToken Token - IAMTrustedProfileID string - - //IAM Refresh Token - IAMRefreshToken string - - // PowerService Instance - PowerServiceInstance string - - // Zone - Zone string - Visibility string - EndpointsFile string -} - -//Session stores the information required for communication with the SoftLayer and Bluemix API -type Session struct { - // SoftLayerSesssion is the the SoftLayer session used to connect to the SoftLayer API - SoftLayerSession *slsession.Session - - // BluemixSession is the the Bluemix session used to connect to the Bluemix API - BluemixSession *bxsession.Session -} - -// ClientSession ... -type ClientSession interface { - AppIDAPI() (*appid.AppIDManagementV4, error) - BluemixSession() (*bxsession.Session, error) - BluemixAcccountAPI() (accountv2.AccountServiceAPI, error) - BluemixAcccountv1API() (accountv1.AccountServiceAPI, error) - BluemixUserDetails() (*UserConfig, error) - ContainerAPI() (containerv1.ContainerServiceAPI, error) - VpcContainerAPI() (containerv2.ContainerServiceAPI, error) - ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error) - FunctionClient() (*whisk.Client, error) - GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error) - GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error) - GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error) - ICDAPI() (icdv4.ICDServiceAPI, error) - IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error) - IAMAccessGroupsV2() (*iamaccessgroups.IamAccessGroupsV2, error) - MccpAPI() (mccpv2.MccpServiceAPI, error) - ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error) - ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error) - ResourceControllerAPI() (controller.ResourceControllerAPI, error) - ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error) - SoftLayerSession() *slsession.Session - IBMPISession() (*ibmpisession.IBMPISession, error) - UserManagementAPI() (usermanagementv2.UserManagementAPI, error) - PushServiceV1() (*pushservicev1.PushServiceV1, error) - EventNotificationsApiV1() (*eventnotificationsv1.EventNotificationsV1, error) - AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error) - CertificateManagerAPI() (certificatemanager.CertificateManagerServiceAPI, error) - keyProtectAPI() (*kp.Client, error) - keyManagementAPI() (*kp.Client, error) - VpcV1API() (*vpc.VpcV1, error) - APIGateway() (*apigateway.ApiGatewayControllerApiV1, error) - PrivateDNSClientSession() (*dns.DnsSvcsV1, error) - CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error) - DirectlinkV1API() (*dl.DirectLinkV1, error) - DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error) - TransitGatewayV1API() (*tg.TransitGatewayApisV1, error) - HpcsEndpointAPI() (hpcs.HPCSV2, error) - FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error) - CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error) - CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error) - CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error) - CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error) - CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error) - CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error) - CisIPClientSession() (*cisipv1.CisIpApiV1, error) - CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error) - CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error) - CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error) - CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error) - CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error) - CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error) - CisRoutingClientSession() (*cisroutingv1.RoutingV1, error) - CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error) - CisCacheClientSession() (*ciscachev1.CachingApiV1, error) - CisCustomPageClientSession() (*ciscustompagev1.CustomPagesV1, error) - CisAccessRuleClientSession() (*cisaccessrulev1.ZoneFirewallAccessRulesV1, error) - CisUARuleClientSession() (*cisuarulev1.UserAgentBlockingRulesV1, error) - CisLockdownClientSession() (*cislockdownv1.ZoneLockdownV1, error) - CisRangeAppClientSession() (*cisrangeappv1.RangeApplicationsV1, error) - CisWAFRuleClientSession() (*ciswafrulev1.WafRulesApiV1, error) - IAMIdentityV1API() (*iamidentity.IamIdentityV1, error) - IBMCloudShellV1() (*ibmcloudshellv1.IBMCloudShellV1, error) - ResourceManagerV2API() (*resourcemanager.ResourceManagerV2, error) - CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error) - EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error) - ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error) - SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error) - SchematicsV1() (*schematicsv1.SchematicsV1, error) - SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error) - SatellitLinkClientSession() (*satellitelinkv1.SatelliteLinkV1, error) - CisFiltersSession() (*cisfiltersv1.FiltersV1, error) - CisFirewallRulesSession() (*cisfirewallrulesv1.FirewallRulesV1, error) - AtrackerV1() (*atrackerv1.AtrackerV1, error) - ESschemaRegistrySession() (*schemaregistryv1.SchemaregistryV1, error) - FindingsV1() (*findingsv1.FindingsV1, error) - AdminServiceApiV1() (*adminserviceapiv1.AdminServiceApiV1, error) - PostureManagementV1() (*posturemanagementv1.PostureManagementV1, error) - ContextBasedRestrictionsV1() (*contextbasedrestrictionsv1.ContextBasedRestrictionsV1, error) - PostureManagementV2() (*posturemanagementv2.PostureManagementV2, error) -} - -type clientSession struct { - session *Session - - appidErr error - appidAPI *appid.AppIDManagementV4 - - apigatewayErr error - apigatewayAPI *apigateway.ApiGatewayControllerApiV1 - - accountConfigErr error - bmxAccountServiceAPI accountv2.AccountServiceAPI - - accountV1ConfigErr error - bmxAccountv1ServiceAPI accountv1.AccountServiceAPI - - bmxUserDetails *UserConfig - bmxUserFetchErr error - - csConfigErr error - csServiceAPI containerv1.ContainerServiceAPI - - csv2ConfigErr error - csv2ServiceAPI containerv2.ContainerServiceAPI - - containerRegistryClientErr error - containerRegistryClient *containerregistryv1.ContainerRegistryV1 - - certManagementErr error - certManagementAPI certificatemanager.CertificateManagerServiceAPI - - cfConfigErr error - cfServiceAPI mccpv2.MccpServiceAPI - - cisConfigErr error - cisServiceAPI cisv1.CisServiceAPI - - functionConfigErr error - functionClient *whisk.Client - - globalSearchConfigErr error - globalSearchServiceAPI globalsearchv2.GlobalSearchServiceAPI - - globalTaggingConfigErr error - globalTaggingServiceAPI globaltaggingv3.GlobalTaggingServiceAPI - - globalTaggingConfigErrV1 error - globalTaggingServiceAPIV1 globaltaggingv1.GlobalTaggingV1 - - ibmCloudShellClient *ibmcloudshellv1.IBMCloudShellV1 - ibmCloudShellClientErr error - - userManagementErr error - userManagementAPI usermanagementv2.UserManagementAPI - - icdConfigErr error - icdServiceAPI icdv4.ICDServiceAPI - - resourceControllerConfigErr error - resourceControllerServiceAPI controller.ResourceControllerAPI - - resourceControllerConfigErrv2 error - resourceControllerServiceAPIv2 controllerv2.ResourceControllerAPIV2 - - resourceManagementConfigErrv2 error - resourceManagementServiceAPIv2 managementv2.ResourceManagementAPIv2 - - resourceCatalogConfigErr error - resourceCatalogServiceAPI catalog.ResourceCatalogAPI - - powerConfigErr error - ibmpiConfigErr error - ibmpiSession *ibmpisession.IBMPISession - - kpErr error - kpAPI *kp.API - - kmsErr error - kmsAPI *kp.API - - hpcsEndpointErr error - hpcsEndpointAPI hpcs.HPCSV2 - - pDNSClient *dns.DnsSvcsV1 - pDNSErr error - - bluemixSessionErr error - - pushServiceClient *pushservicev1.PushServiceV1 - pushServiceClientErr error - - eventNotificationsApiClient *eventnotificationsv1.EventNotificationsV1 - eventNotificationsApiClientErr error - - appConfigurationClient *appconfigurationv1.AppConfigurationV1 - appConfigurationClientErr error - - vpcErr error - vpcAPI *vpc.VpcV1 - - directlinkAPI *dl.DirectLinkV1 - directlinkErr error - dlProviderAPI *dlProviderV2.DirectLinkProviderV2 - dlProviderErr error - - cosConfigErr error - cosConfigAPI *cosconfig.ResourceConfigurationV1 - - transitgatewayAPI *tg.TransitGatewayApisV1 - transitgatewayErr error - - functionIAMNamespaceAPI functions.FunctionServiceAPI - functionIAMNamespaceErr error - - // CIS Zones - cisZonesErr error - cisZonesV1Client *ciszonesv1.ZonesV1 - - // CIS dns service options - cisDNSErr error - cisDNSRecordsClient *cisdnsrecordsv1.DnsRecordsV1 - - // CIS dns bulk service options - cisDNSBulkErr error - cisDNSRecordBulkClient *cisdnsbulkv1.DnsRecordBulkV1 - - // CIS Global Load Balancer Pool service options - cisGLBPoolErr error - cisGLBPoolClient *cisglbpoolv0.GlobalLoadBalancerPoolsV0 - - // CIS GLB service options - cisGLBErr error - cisGLBClient *cisglbv1.GlobalLoadBalancerV1 - - // CIS GLB health check service options - cisGLBHealthCheckErr error - cisGLBHealthCheckClient *cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1 - - // CIS IP service options - cisIPErr error - cisIPClient *cisipv1.CisIpApiV1 - - // CIS Zone Rate Limits service options - cisRLErr error - cisRLClient *cisratelimitv1.ZoneRateLimitsV1 - - // CIS Page Rules service options - cisPageRuleErr error - cisPageRuleClient *cispagerulev1.PageRuleApiV1 - - // CIS Edge Functions service options - cisEdgeFunctionErr error - cisEdgeFunctionClient *cisedgefunctionv1.EdgeFunctionsApiV1 - - // CIS SSL certificate service options - cisSSLErr error - cisSSLClient *cissslv1.SslCertificateApiV1 - - // CIS WAF Package service options - cisWAFPackageErr error - cisWAFPackageClient *ciswafpackagev1.WafRulePackagesApiV1 - - // CIS Zone Setting service options - cisDomainSettingsErr error - cisDomainSettingsClient *cisdomainsettingsv1.ZonesSettingsV1 - - // CIS Routing service options - cisRoutingErr error - cisRoutingClient *cisroutingv1.RoutingV1 - - // CIS WAF Group service options - cisWAFGroupErr error - cisWAFGroupClient *ciswafgroupv1.WafRuleGroupsApiV1 - - // CIS Caching service options - cisCacheErr error - cisCacheClient *ciscachev1.CachingApiV1 - - // CIS Custom Pages service options - cisCustomPageErr error - cisCustomPageClient *ciscustompagev1.CustomPagesV1 - - // CIS Firewall Access rule service option - cisAccessRuleErr error - cisAccessRuleClient *cisaccessrulev1.ZoneFirewallAccessRulesV1 - - // CIS User Agent Blocking Rule service option - cisUARuleErr error - cisUARuleClient *cisuarulev1.UserAgentBlockingRulesV1 - - // CIS Firewall Lockdwon Rule service option - cisLockdownErr error - cisLockdownClient *cislockdownv1.ZoneLockdownV1 - - // CIS Range app service option - cisRangeAppErr error - cisRangeAppClient *cisrangeappv1.RangeApplicationsV1 - - // CIS WAF rule service options - cisWAFRuleErr error - cisWAFRuleClient *ciswafrulev1.WafRulesApiV1 - //IAM Identity Option - iamIdentityErr error - iamIdentityAPI *iamidentity.IamIdentityV1 - - //Resource Manager Option - resourceManagerErr error - resourceManagerAPI *resourcemanager.ResourceManagerV2 - - //Catalog Management Option - catalogManagementClient *catalogmanagementv1.CatalogManagementV1 - catalogManagementClientErr error - - enterpriseManagementClient *enterprisemanagementv1.EnterpriseManagementV1 - enterpriseManagementClientErr error - - //Resource Controller Option - resourceControllerErr error - resourceControllerAPI *resourcecontroller.ResourceControllerV2 - secretsManagerClient *secretsmanagerv1.SecretsManagerV1 - secretsManagerClientErr error - - // Schematics service options - schematicsClient *schematicsv1.SchematicsV1 - schematicsClientErr error - - //Satellite service - satelliteClient *kubernetesserviceapiv1.KubernetesServiceApiV1 - satelliteClientErr error - - //IAM Policy Management - iamPolicyManagementErr error - iamPolicyManagementAPI *iampolicymanagement.IamPolicyManagementV1 - - //IAM Access Groups - iamAccessGroupsErr error - iamAccessGroupsAPI *iamaccessgroups.IamAccessGroupsV2 - - // CIS Filters options - cisFiltersClient *cisfiltersv1.FiltersV1 - cisFiltersErr error - - // CIS FirewallRules options - cisFirewallRulesClient *cisfirewallrulesv1.FirewallRulesV1 - cisFirewallRulesErr error - - //Atracker - atrackerClient *atrackerv1.AtrackerV1 - atrackerClientErr error - - //Satellite link service - satelliteLinkClient *satellitelinkv1.SatelliteLinkV1 - satelliteLinkClientErr error - - esSchemaRegistryClient *schemaregistryv1.SchemaregistryV1 - esSchemaRegistryErr error - - // Security and Compliance Center (SCC) - findingsClient *findingsv1.FindingsV1 - findingsClientErr error - - // Security and Compliance Center (SCC) Admin - adminServiceApiClient *adminserviceapiv1.AdminServiceApiV1 - adminServiceApiClientErr error - - //Security and Compliance Center (SCC) Compliance posture - postureManagementClientErr error - postureManagementClient *posturemanagementv1.PostureManagementV1 - - //Security and Compliance Center (SCC) Compliance posture v2 - postureManagementClientv2 *posturemanagementv2.PostureManagementV2 - postureManagementClientErrv2 error - - // context Based Restrictions (CBR) - contextBasedRestrictionsClient *contextbasedrestrictionsv1.ContextBasedRestrictionsV1 - contextBasedRestrictionsClientErr error -} - -// AppIDAPI provides AppID Service APIs ... -func (session clientSession) AppIDAPI() (*appid.AppIDManagementV4, error) { - return session.appidAPI, session.appidErr -} - -func (session clientSession) CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error) { - return session.catalogManagementClient, session.catalogManagementClientErr -} - -// BluemixAcccountAPI ... -func (sess clientSession) BluemixAcccountAPI() (accountv2.AccountServiceAPI, error) { - return sess.bmxAccountServiceAPI, sess.accountConfigErr -} - -// BluemixAcccountAPI ... -func (sess clientSession) BluemixAcccountv1API() (accountv1.AccountServiceAPI, error) { - return sess.bmxAccountv1ServiceAPI, sess.accountV1ConfigErr -} - -// BluemixSession to provide the Bluemix Session -func (sess clientSession) BluemixSession() (*bxsession.Session, error) { - return sess.session.BluemixSession, sess.bluemixSessionErr -} - -// BluemixUserDetails ... -func (sess clientSession) BluemixUserDetails() (*UserConfig, error) { - return sess.bmxUserDetails, sess.bmxUserFetchErr -} - -// ContainerAPI provides Container Service APIs ... -func (sess clientSession) ContainerAPI() (containerv1.ContainerServiceAPI, error) { - return sess.csServiceAPI, sess.csConfigErr -} - -// VpcContainerAPI provides v2Container Service APIs ... -func (sess clientSession) VpcContainerAPI() (containerv2.ContainerServiceAPI, error) { - return sess.csv2ServiceAPI, sess.csv2ConfigErr -} - -// ContainerRegistryV1 provides Container Registry Service APIs ... -func (session clientSession) ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error) { - return session.containerRegistryClient, session.containerRegistryClientErr -} - -// SchematicsAPI provides schematics Service APIs ... -func (sess clientSession) SchematicsV1() (*schematicsv1.SchematicsV1, error) { - return sess.schematicsClient, sess.schematicsClientErr -} - -// FunctionClient ... -func (sess clientSession) FunctionClient() (*whisk.Client, error) { - return sess.functionClient, sess.functionConfigErr -} - -// GlobalSearchAPI provides Global Search APIs ... -func (sess clientSession) GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error) { - return sess.globalSearchServiceAPI, sess.globalSearchConfigErr -} - -// GlobalTaggingAPI provides Global Search APIs ... -func (sess clientSession) GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error) { - return sess.globalTaggingServiceAPI, sess.globalTaggingConfigErr -} - -// GlobalTaggingAPIV1 provides Platform-go Global Tagging APIs ... -func (sess clientSession) GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error) { - return sess.globalTaggingServiceAPIV1, sess.globalTaggingConfigErrV1 -} - -// HpcsEndpointAPI provides Hpcs Endpoint generator APIs ... -func (sess clientSession) HpcsEndpointAPI() (hpcs.HPCSV2, error) { - return sess.hpcsEndpointAPI, sess.hpcsEndpointErr -} - -// UserManagementAPI provides User management APIs ... -func (sess clientSession) UserManagementAPI() (usermanagementv2.UserManagementAPI, error) { - return sess.userManagementAPI, sess.userManagementErr -} - -// IAM Policy Management -func (sess clientSession) IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error) { - return sess.iamPolicyManagementAPI, sess.iamPolicyManagementErr -} - -// IAMAccessGroupsV2 provides IAM AG APIs ... -func (sess clientSession) IAMAccessGroupsV2() (*iamaccessgroups.IamAccessGroupsV2, error) { - return sess.iamAccessGroupsAPI, sess.iamAccessGroupsErr -} - -// IBM Cloud Shell -func (session clientSession) IBMCloudShellV1() (*ibmcloudshellv1.IBMCloudShellV1, error) { - return session.ibmCloudShellClient, session.ibmCloudShellClientErr -} - -// IcdAPI provides IBM Cloud Databases APIs ... -func (sess clientSession) ICDAPI() (icdv4.ICDServiceAPI, error) { - return sess.icdServiceAPI, sess.icdConfigErr -} - -// MccpAPI provides Multi Cloud Controller Proxy APIs ... -func (sess clientSession) MccpAPI() (mccpv2.MccpServiceAPI, error) { - return sess.cfServiceAPI, sess.cfConfigErr -} - -// ResourceCatalogAPI ... -func (sess clientSession) ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error) { - return sess.resourceCatalogServiceAPI, sess.resourceCatalogConfigErr -} - -// ResourceManagementAPIv2 ... -func (sess clientSession) ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error) { - return sess.resourceManagementServiceAPIv2, sess.resourceManagementConfigErrv2 -} - -// ResourceControllerAPI ... -func (sess clientSession) ResourceControllerAPI() (controller.ResourceControllerAPI, error) { - return sess.resourceControllerServiceAPI, sess.resourceControllerConfigErr -} - -// ResourceControllerAPIv2 ... -func (sess clientSession) ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error) { - return sess.resourceControllerServiceAPIv2, sess.resourceControllerConfigErrv2 -} - -// SoftLayerSession providers SoftLayer Session -func (sess clientSession) SoftLayerSession() *slsession.Session { - return sess.session.SoftLayerSession -} - -// CertManagementAPI provides Certificate management APIs ... -func (sess clientSession) CertificateManagerAPI() (certificatemanager.CertificateManagerServiceAPI, error) { - return sess.certManagementAPI, sess.certManagementErr -} - -//apigatewayAPI provides API Gateway APIs -func (sess clientSession) APIGateway() (*apigateway.ApiGatewayControllerApiV1, error) { - return sess.apigatewayAPI, sess.apigatewayErr -} - -func (session clientSession) PushServiceV1() (*pushservicev1.PushServiceV1, error) { - return session.pushServiceClient, session.pushServiceClientErr -} - -func (session clientSession) EventNotificationsApiV1() (*eventnotificationsv1.EventNotificationsV1, error) { - return session.eventNotificationsApiClient, session.eventNotificationsApiClientErr -} - -func (session clientSession) AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error) { - return session.appConfigurationClient, session.appConfigurationClientErr -} - -func (sess clientSession) keyProtectAPI() (*kp.Client, error) { - return sess.kpAPI, sess.kpErr -} - -func (sess clientSession) keyManagementAPI() (*kp.Client, error) { - if sess.kmsErr == nil { - var clientConfig *kp.ClientConfig - if sess.kmsAPI.Config.APIKey != "" { - clientConfig = &kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, sess.kmsAPI.Config.BaseURL), - APIKey: sess.kmsAPI.Config.APIKey, //pragma: allowlist secret - Verbose: kp.VerboseFailOnly, - TokenURL: sess.kmsAPI.Config.TokenURL, - } - } else { - clientConfig = &kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, sess.kmsAPI.Config.BaseURL), - Authorization: sess.session.BluemixSession.Config.IAMAccessToken, //pragma: allowlist secret - Verbose: kp.VerboseFailOnly, - TokenURL: sess.kmsAPI.Config.TokenURL, - } - } - - kpClient, err := kp.New(*clientConfig, kp.DefaultTransport()) - if err != nil { - sess.kpErr = fmt.Errorf("Error occured while configuring Key Protect Service: %q", err) - } - return kpClient, nil - } - return sess.kmsAPI, sess.kmsErr -} - -func (sess clientSession) VpcV1API() (*vpc.VpcV1, error) { - return sess.vpcAPI, sess.vpcErr -} - -func (sess clientSession) DirectlinkV1API() (*dl.DirectLinkV1, error) { - return sess.directlinkAPI, sess.directlinkErr -} -func (sess clientSession) DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error) { - return sess.dlProviderAPI, sess.dlProviderErr -} -func (sess clientSession) CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error) { - return sess.cosConfigAPI, sess.cosConfigErr -} - -func (sess clientSession) TransitGatewayV1API() (*tg.TransitGatewayApisV1, error) { - return sess.transitgatewayAPI, sess.transitgatewayErr -} - -// Session to the Power Colo Service - -func (sess clientSession) IBMPISession() (*ibmpisession.IBMPISession, error) { - return sess.ibmpiSession, sess.powerConfigErr -} - -// Private DNS Service - -func (sess clientSession) PrivateDNSClientSession() (*dns.DnsSvcsV1, error) { - return sess.pDNSClient, sess.pDNSErr -} - -// Session to the Namespace cloud function - -func (sess clientSession) FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error) { - return sess.functionIAMNamespaceAPI, sess.functionIAMNamespaceErr -} - -// CIS Zones Service -func (sess clientSession) CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error) { - if sess.cisZonesErr != nil { - return sess.cisZonesV1Client, sess.cisZonesErr - } - return sess.cisZonesV1Client.Clone(), nil -} - -// CIS DNS Service -func (sess clientSession) CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error) { - if sess.cisDNSErr != nil { - return sess.cisDNSRecordsClient, sess.cisDNSErr - } - return sess.cisDNSRecordsClient.Clone(), nil -} - -// CIS DNS Bulk Service -func (sess clientSession) CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error) { - if sess.cisDNSBulkErr != nil { - return sess.cisDNSRecordBulkClient, sess.cisDNSBulkErr - } - return sess.cisDNSRecordBulkClient.Clone(), nil -} - -// CIS GLB Pool -func (sess clientSession) CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error) { - if sess.cisGLBPoolErr != nil { - return sess.cisGLBPoolClient, sess.cisGLBPoolErr - } - return sess.cisGLBPoolClient.Clone(), nil -} - -// CIS GLB -func (sess clientSession) CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error) { - if sess.cisGLBErr != nil { - return sess.cisGLBClient, sess.cisGLBErr - } - return sess.cisGLBClient.Clone(), nil -} - -// CIS GLB Health Check/Monitor -func (sess clientSession) CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error) { - if sess.cisGLBHealthCheckErr != nil { - return sess.cisGLBHealthCheckClient, sess.cisGLBHealthCheckErr - } - return sess.cisGLBHealthCheckClient.Clone(), nil -} - -// CIS Zone Rate Limits -func (sess clientSession) CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error) { - if sess.cisRLErr != nil { - return sess.cisRLClient, sess.cisRLErr - } - return sess.cisRLClient.Clone(), nil -} - -// CIS IP -func (sess clientSession) CisIPClientSession() (*cisipv1.CisIpApiV1, error) { - if sess.cisIPErr != nil { - return sess.cisIPClient, sess.cisIPErr - } - return sess.cisIPClient.Clone(), nil -} - -// CIS Page Rules -func (sess clientSession) CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error) { - if sess.cisPageRuleErr != nil { - return sess.cisPageRuleClient, sess.cisPageRuleErr - } - return sess.cisPageRuleClient.Clone(), nil -} - -// CIS Edge Function -func (sess clientSession) CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error) { - if sess.cisEdgeFunctionErr != nil { - return sess.cisEdgeFunctionClient, sess.cisEdgeFunctionErr - } - return sess.cisEdgeFunctionClient.Clone(), nil -} - -// CIS SSL certificate -func (sess clientSession) CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error) { - if sess.cisSSLErr != nil { - return sess.cisSSLClient, sess.cisSSLErr - } - return sess.cisSSLClient.Clone(), nil -} - -// CIS WAF Packages -func (sess clientSession) CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error) { - if sess.cisWAFPackageErr != nil { - return sess.cisWAFPackageClient, sess.cisWAFPackageErr - } - return sess.cisWAFPackageClient.Clone(), nil -} - -// CIS Zone Settings -func (sess clientSession) CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error) { - if sess.cisDomainSettingsErr != nil { - return sess.cisDomainSettingsClient, sess.cisDomainSettingsErr - } - return sess.cisDomainSettingsClient.Clone(), nil -} - -// CIS Routing -func (sess clientSession) CisRoutingClientSession() (*cisroutingv1.RoutingV1, error) { - if sess.cisRoutingErr != nil { - return sess.cisRoutingClient, sess.cisRoutingErr - } - return sess.cisRoutingClient.Clone(), nil -} - -// CIS WAF Group -func (sess clientSession) CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error) { - if sess.cisWAFGroupErr != nil { - return sess.cisWAFGroupClient, sess.cisWAFGroupErr - } - return sess.cisWAFGroupClient.Clone(), nil -} - -// CIS Cache service -func (sess clientSession) CisCacheClientSession() (*ciscachev1.CachingApiV1, error) { - if sess.cisCacheErr != nil { - return sess.cisCacheClient, sess.cisCacheErr - } - return sess.cisCacheClient.Clone(), nil -} - -// CIS Zone Settings -func (sess clientSession) CisCustomPageClientSession() (*ciscustompagev1.CustomPagesV1, error) { - if sess.cisCustomPageErr != nil { - return sess.cisCustomPageClient, sess.cisCustomPageErr - } - return sess.cisCustomPageClient.Clone(), nil -} - -// CIS Firewall access rule -func (sess clientSession) CisAccessRuleClientSession() (*cisaccessrulev1.ZoneFirewallAccessRulesV1, error) { - if sess.cisAccessRuleErr != nil { - return sess.cisAccessRuleClient, sess.cisAccessRuleErr - } - return sess.cisAccessRuleClient.Clone(), nil -} - -// CIS User Agent Blocking rule -func (sess clientSession) CisUARuleClientSession() (*cisuarulev1.UserAgentBlockingRulesV1, error) { - if sess.cisUARuleErr != nil { - return sess.cisUARuleClient, sess.cisUARuleErr - } - return sess.cisUARuleClient.Clone(), nil -} - -// CIS Firewall Lockdown rule -func (sess clientSession) CisLockdownClientSession() (*cislockdownv1.ZoneLockdownV1, error) { - if sess.cisLockdownErr != nil { - return sess.cisLockdownClient, sess.cisLockdownErr - } - return sess.cisLockdownClient.Clone(), nil -} - -// CIS Range app rule -func (sess clientSession) CisRangeAppClientSession() (*cisrangeappv1.RangeApplicationsV1, error) { - if sess.cisRangeAppErr != nil { - return sess.cisRangeAppClient, sess.cisRangeAppErr - } - return sess.cisRangeAppClient.Clone(), nil -} - -// CIS WAF Rule -func (sess clientSession) CisWAFRuleClientSession() (*ciswafrulev1.WafRulesApiV1, error) { - if sess.cisWAFRuleErr != nil { - return sess.cisWAFRuleClient, sess.cisWAFRuleErr - } - return sess.cisWAFRuleClient.Clone(), nil -} - -// IAM Identity Session -func (sess clientSession) IAMIdentityV1API() (*iamidentity.IamIdentityV1, error) { - return sess.iamIdentityAPI, sess.iamIdentityErr -} - -// ResourceMAanger Session -func (sess clientSession) ResourceManagerV2API() (*resourcemanager.ResourceManagerV2, error) { - return sess.resourceManagerAPI, sess.resourceManagerErr -} - -func (session clientSession) EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error) { - return session.enterpriseManagementClient, session.enterpriseManagementClientErr -} - -// ResourceController Session -func (sess clientSession) ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error) { - return sess.resourceControllerAPI, sess.resourceControllerErr -} - -// SecretsManager Session -func (session clientSession) SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error) { - return session.secretsManagerClient, session.secretsManagerClientErr -} - -// Satellite Link -func (session clientSession) SatellitLinkClientSession() (*satellitelinkv1.SatelliteLinkV1, error) { - return session.satelliteLinkClient, session.satelliteLinkClientErr -} - -var cloudEndpoint = "cloud.ibm.com" - -// Session to the Satellite client -func (sess clientSession) SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error) { - return sess.satelliteClient, sess.satelliteClientErr -} - -// CIS Filters -func (sess clientSession) CisFiltersSession() (*cisfiltersv1.FiltersV1, error) { - if sess.cisFiltersErr != nil { - return sess.cisFiltersClient, sess.cisFiltersErr - } - return sess.cisFiltersClient.Clone(), nil -} - -// CIS FirewallRules -func (sess clientSession) CisFirewallRulesSession() (*cisfirewallrulesv1.FirewallRulesV1, error) { - if sess.cisFirewallRulesErr != nil { - return sess.cisFirewallRulesClient, sess.cisFirewallRulesErr - } - return sess.cisFirewallRulesClient.Clone(), nil -} - -// Activity Tracker API -func (session clientSession) AtrackerV1() (*atrackerv1.AtrackerV1, error) { - return session.atrackerClient, session.atrackerClientErr -} - -func (session clientSession) ESschemaRegistrySession() (*schemaregistryv1.SchemaregistryV1, error) { - return session.esSchemaRegistryClient, session.esSchemaRegistryErr -} - -// Security and Compliance center Findings API -func (session clientSession) FindingsV1() (*findingsv1.FindingsV1, error) { - if session.findingsClientErr != nil { - return session.findingsClient, session.findingsClientErr - } - return session.findingsClient.Clone(), nil -} - -//Security and Compliance center Admin API -func (session clientSession) AdminServiceApiV1() (*adminserviceapiv1.AdminServiceApiV1, error) { - return session.adminServiceApiClient, session.adminServiceApiClientErr -} - -// Security and Compliance center Posture Management -func (session clientSession) PostureManagementV1() (*posturemanagementv1.PostureManagementV1, error) { - if session.postureManagementClientErr != nil { - return session.postureManagementClient, session.postureManagementClientErr - } - return session.postureManagementClient.Clone(), nil -} - -//Security and Compliance center Posture Management v2 -func (session clientSession) PostureManagementV2() (*posturemanagementv2.PostureManagementV2, error) { - if session.postureManagementClientErrv2 != nil { - return session.postureManagementClientv2, session.postureManagementClientErrv2 - } - return session.postureManagementClientv2.Clone(), nil -} - -// Context Based Restrictions -func (session clientSession) ContextBasedRestrictionsV1() (*contextbasedrestrictionsv1.ContextBasedRestrictionsV1, error) { - return session.contextBasedRestrictionsClient, session.contextBasedRestrictionsClientErr -} - -// ClientSession configures and returns a fully initialized ClientSession -func (c *Config) ClientSession() (interface{}, error) { - sess, err := newSession(c) - if err != nil { - return nil, err - } - log.Printf("[INFO] Configured Region: %s\n", c.Region) - session := clientSession{ - session: sess, - } - - if sess.BluemixSession == nil { - //Can be nil only if bluemix_api_key is not provided - log.Println("Skipping Bluemix Clients configuration") - session.bluemixSessionErr = errEmptyBluemixCredentials - session.accountConfigErr = errEmptyBluemixCredentials - session.accountV1ConfigErr = errEmptyBluemixCredentials - session.csConfigErr = errEmptyBluemixCredentials - session.csv2ConfigErr = errEmptyBluemixCredentials - session.containerRegistryClientErr = errEmptyBluemixCredentials - session.kpErr = errEmptyBluemixCredentials - session.pushServiceClientErr = errEmptyBluemixCredentials - session.appConfigurationClientErr = errEmptyBluemixCredentials - session.kmsErr = errEmptyBluemixCredentials - session.cfConfigErr = errEmptyBluemixCredentials - session.cisConfigErr = errEmptyBluemixCredentials - session.functionConfigErr = errEmptyBluemixCredentials - session.globalSearchConfigErr = errEmptyBluemixCredentials - session.globalTaggingConfigErr = errEmptyBluemixCredentials - session.globalTaggingConfigErrV1 = errEmptyBluemixCredentials - session.hpcsEndpointErr = errEmptyBluemixCredentials - session.iamAccessGroupsErr = errEmptyBluemixCredentials - session.icdConfigErr = errEmptyBluemixCredentials - session.resourceCatalogConfigErr = errEmptyBluemixCredentials - session.resourceManagerErr = errEmptyBluemixCredentials - session.resourceManagementConfigErrv2 = errEmptyBluemixCredentials - session.resourceControllerConfigErr = errEmptyBluemixCredentials - session.resourceControllerConfigErrv2 = errEmptyBluemixCredentials - session.enterpriseManagementClientErr = errEmptyBluemixCredentials - session.resourceControllerErr = errEmptyBluemixCredentials - session.catalogManagementClientErr = errEmptyBluemixCredentials - session.powerConfigErr = errEmptyBluemixCredentials - session.ibmpiConfigErr = errEmptyBluemixCredentials - session.userManagementErr = errEmptyBluemixCredentials - session.certManagementErr = errEmptyBluemixCredentials - session.vpcErr = errEmptyBluemixCredentials - session.apigatewayErr = errEmptyBluemixCredentials - session.pDNSErr = errEmptyBluemixCredentials - session.bmxUserFetchErr = errEmptyBluemixCredentials - session.directlinkErr = errEmptyBluemixCredentials - session.dlProviderErr = errEmptyBluemixCredentials - session.cosConfigErr = errEmptyBluemixCredentials - session.transitgatewayErr = errEmptyBluemixCredentials - session.functionIAMNamespaceErr = errEmptyBluemixCredentials - session.cisDNSErr = errEmptyBluemixCredentials - session.cisDNSBulkErr = errEmptyBluemixCredentials - session.cisGLBPoolErr = errEmptyBluemixCredentials - session.cisGLBErr = errEmptyBluemixCredentials - session.cisGLBHealthCheckErr = errEmptyBluemixCredentials - session.cisIPErr = errEmptyBluemixCredentials - session.cisZonesErr = errEmptyBluemixCredentials - session.cisRLErr = errEmptyBluemixCredentials - session.cisPageRuleErr = errEmptyBluemixCredentials - session.cisEdgeFunctionErr = errEmptyBluemixCredentials - session.cisSSLErr = errEmptyBluemixCredentials - session.cisWAFPackageErr = errEmptyBluemixCredentials - session.cisDomainSettingsErr = errEmptyBluemixCredentials - session.cisRoutingErr = errEmptyBluemixCredentials - session.cisWAFGroupErr = errEmptyBluemixCredentials - session.cisCacheErr = errEmptyBluemixCredentials - session.cisCustomPageErr = errEmptyBluemixCredentials - session.cisAccessRuleErr = errEmptyBluemixCredentials - session.cisUARuleErr = errEmptyBluemixCredentials - session.cisLockdownErr = errEmptyBluemixCredentials - session.cisRangeAppErr = errEmptyBluemixCredentials - session.cisWAFRuleErr = errEmptyBluemixCredentials - session.iamIdentityErr = errEmptyBluemixCredentials - session.secretsManagerClientErr = errEmptyBluemixCredentials - session.cisFiltersErr = errEmptyBluemixCredentials - session.schematicsClientErr = errEmptyBluemixCredentials - session.satelliteClientErr = errEmptyBluemixCredentials - session.iamPolicyManagementErr = errEmptyBluemixCredentials - session.satelliteLinkClientErr = errEmptyBluemixCredentials - session.esSchemaRegistryErr = errEmptyBluemixCredentials - session.contextBasedRestrictionsClientErr = errEmptyBluemixCredentials - session.postureManagementClientErr = errEmptyBluemixCredentials - session.postureManagementClientErrv2 = errEmptyBluemixCredentials - - return session, nil - } - - if sess.BluemixSession.Config.BluemixAPIKey != "" { - err = authenticateAPIKey(sess.BluemixSession) - if err != nil { - for count := c.RetryCount; count >= 0; count-- { - if err == nil || !isRetryable(err) { - break - } - time.Sleep(c.RetryDelay) - log.Printf("Retrying IAM Authentication %d", count) - err = authenticateAPIKey(sess.BluemixSession) - } - if err != nil { - session.bmxUserFetchErr = fmt.Errorf("Error occured while fetching auth key for account user details: %q", err) - session.functionConfigErr = fmt.Errorf("Error occured while fetching auth key for function: %q", err) - session.powerConfigErr = fmt.Errorf("Error occured while fetching the auth key for power iaas: %q", err) - session.ibmpiConfigErr = fmt.Errorf("Error occured while fetching the auth key for power iaas: %q", err) - } - } - err = authenticateCF(sess.BluemixSession) - if err != nil { - for count := c.RetryCount; count >= 0; count-- { - if err == nil || !isRetryable(err) { - break - } - time.Sleep(c.RetryDelay) - log.Printf("Retrying CF Authentication %d", count) - err = authenticateCF(sess.BluemixSession) - } - if err != nil { - session.functionConfigErr = fmt.Errorf("Error occured while fetching auth key for function: %q", err) - } - } - } - - if c.IAMTrustedProfileID == "" && sess.BluemixSession.Config.IAMAccessToken != "" && sess.BluemixSession.Config.BluemixAPIKey == "" { - err := refreshToken(sess.BluemixSession) - if err != nil { - for count := c.RetryCount; count >= 0; count-- { - if err == nil || !isRetryable(err) { - break - } - time.Sleep(c.RetryDelay) - log.Printf("Retrying refresh token %d", count) - err = refreshToken(sess.BluemixSession) - } - if err != nil { - return nil, fmt.Errorf("Error occured while refreshing the token: %q", err) - } - } - - } - userConfig, err := fetchUserDetails(sess.BluemixSession, c.RetryCount, c.RetryDelay) - if err != nil { - session.bmxUserFetchErr = fmt.Errorf("Error occured while fetching account user details: %q", err) - } - session.bmxUserDetails = userConfig - - if sess.SoftLayerSession != nil && sess.SoftLayerSession.IAMToken != "" { - sess.SoftLayerSession.IAMToken = sess.BluemixSession.Config.IAMAccessToken - sess.SoftLayerSession.IAMRefreshToken = sess.BluemixSession.Config.IAMRefreshToken - } - - session.functionClient, session.functionConfigErr = FunctionClient(sess.BluemixSession.Config) - - BluemixRegion = sess.BluemixSession.Config.Region - var fileMap map[string]interface{} - if f := envFallBack([]string{"IBMCLOUD_ENDPOINTS_FILE_PATH", "IC_ENDPOINTS_FILE_PATH"}, c.EndpointsFile); f != "" { - jsonFile, err := os.Open(f) - if err != nil { - log.Fatalf("Unable to open Endpoints File %s", err) - } - defer jsonFile.Close() - bytes, err := ioutil.ReadAll(jsonFile) - if err != nil { - log.Fatalf("Unable to read Endpoints File %s", err) - } - err = json.Unmarshal([]byte(bytes), &fileMap) - if err != nil { - log.Fatalf("Unable to unmarshal Endpoints File %s", err) - } - } - accv1API, err := accountv1.New(sess.BluemixSession) - if err != nil { - session.accountV1ConfigErr = fmt.Errorf("Error occured while configuring Bluemix Accountv1 Service: %q", err) - } - session.bmxAccountv1ServiceAPI = accv1API - - accAPI, err := accountv2.New(sess.BluemixSession) - if err != nil { - session.accountConfigErr = fmt.Errorf("Error occured while configuring Account Service: %q", err) - } - session.bmxAccountServiceAPI = accAPI - - cfAPI, err := mccpv2.New(sess.BluemixSession) - if err != nil { - session.cfConfigErr = fmt.Errorf("Error occured while configuring MCCP service: %q", err) - } - session.cfServiceAPI = cfAPI - - clusterAPI, err := containerv1.New(sess.BluemixSession) - if err != nil { - session.csConfigErr = fmt.Errorf("Error occured while configuring Container Service for K8s cluster: %q", err) - } - session.csServiceAPI = clusterAPI - - v2clusterAPI, err := containerv2.New(sess.BluemixSession) - if err != nil { - session.csv2ConfigErr = fmt.Errorf("Error occured while configuring vpc Container Service for K8s cluster: %q", err) - } - session.csv2ServiceAPI = v2clusterAPI - - hpcsAPI, err := hpcs.New(sess.BluemixSession) - if err != nil { - session.hpcsEndpointErr = fmt.Errorf("Error occured while configuring hpcs Endpoint: %q", err) - } - session.hpcsEndpointAPI = hpcsAPI - - kpurl := contructEndpoint(fmt.Sprintf("%s.kms", c.Region), cloudEndpoint) - if c.Visibility == "private" || c.Visibility == "public-and-private" { - kpurl = contructEndpoint(fmt.Sprintf("private.%s.kms", c.Region), cloudEndpoint) - } - if fileMap != nil && c.Visibility != "public-and-private" { - kpurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_KP_API_ENDPOINT", c.Region, kpurl) - } - var options kp.ClientConfig - if c.BluemixAPIKey != "" { - options = kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), - APIKey: sess.BluemixSession.Config.BluemixAPIKey, //pragma: allowlist secret - // InstanceID: "42fET57nnadurKXzXAedFLOhGqETfIGYxOmQXkFgkJV9", - Verbose: kp.VerboseFailOnly, - } - - } else { - options = kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), - Authorization: sess.BluemixSession.Config.IAMAccessToken, - // InstanceID: "42fET57nnadurKXzXAedFLOhGqETfIGYxOmQXkFgkJV9", - Verbose: kp.VerboseFailOnly, - } - } - kpAPIclient, err := kp.New(options, kp.DefaultTransport()) - if err != nil { - session.kpErr = fmt.Errorf("Error occured while configuring Key Protect Service: %q", err) - } - session.kpAPI = kpAPIclient - - iamURL := iamidentity.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - iamURL = contructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) - } else { - iamURL = contructEndpoint("private.iam", cloudEndpoint) - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - iamURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamURL) - } - - // KEY MANAGEMENT Service - kmsurl := contructEndpoint(fmt.Sprintf("%s.kms", c.Region), cloudEndpoint) - if c.Visibility == "private" || c.Visibility == "public-and-private" { - kmsurl = contructEndpoint(fmt.Sprintf("private.%s.kms", c.Region), cloudEndpoint) - } - if fileMap != nil && c.Visibility != "public-and-private" { - kmsurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_KP_API_ENDPOINT", c.Region, kmsurl) - } - var kmsOptions kp.ClientConfig - if c.BluemixAPIKey != "" { - kmsOptions = kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kmsurl), - APIKey: sess.BluemixSession.Config.BluemixAPIKey, //pragma: allowlist secret - // InstanceID: "5af62d5d-5d90-4b84-bbcd-90d2123ae6c8", - Verbose: kp.VerboseFailOnly, - TokenURL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", - } - - } else { - kmsOptions = kp.ClientConfig{ - BaseURL: envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kmsurl), - Authorization: sess.BluemixSession.Config.IAMAccessToken, - // InstanceID: "5af62d5d-5d90-4b84-bbcd-90d2123ae6c8", - Verbose: kp.VerboseFailOnly, - TokenURL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", - } - } - kmsAPIclient, err := kp.New(kmsOptions, DefaultTransport()) - if err != nil { - session.kmsErr = fmt.Errorf("Error occured while configuring key Service: %q", err) - } - session.kmsAPI = kmsAPIclient - - var authenticator core.Authenticator - - if c.BluemixAPIKey != "" { - authenticator = &core.IamAuthenticator{ - ApiKey: c.BluemixAPIKey, - URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", - } - } else if strings.HasPrefix(sess.BluemixSession.Config.IAMAccessToken, "Bearer") { - authenticator = &core.BearerTokenAuthenticator{ - BearerToken: sess.BluemixSession.Config.IAMAccessToken[7:], - } - } else { - authenticator = &core.BearerTokenAuthenticator{ - BearerToken: sess.BluemixSession.Config.IAMAccessToken, - } - } - - // APPID Service - appIDEndpoint := fmt.Sprintf("https://%s.appid.cloud.ibm.com", c.Region) - if c.Visibility == "private" { - session.appidErr = fmt.Errorf("App Id resources doesnot support private endpoints") - } - if fileMap != nil && c.Visibility != "public-and-private" { - appIDEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_APPID_MANAGEMENT_API_ENDPOINT", c.Region, appIDEndpoint) - } - appIDClientOptions := &appid.AppIDManagementV4Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_APPID_MANAGEMENT_API_ENDPOINT"}, appIDEndpoint), - } - appIDClient, err := appid.NewAppIDManagementV4(appIDClientOptions) - if err != nil { - session.appidErr = fmt.Errorf("error occured while configuring AppID service: #{err}") - } - if appIDClient != nil && appIDClient.Service != nil { - appIDClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - appIDClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.appidAPI = appIDClient - - // Construct an "options" struct for creating Context Based Restrictions service client. - cbrURL := contextbasedrestrictionsv1.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - session.contextBasedRestrictionsClientErr = fmt.Errorf("Context Based Restrictions Service API does not support private endpoints") //return this error if private endpoints are not supported - } - if fileMap != nil && c.Visibility != "public-and-private" { - cbrURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CONTEXT_BASED_RESTRICTIONS_ENDPOINT", c.Region, cbrURL) - } - contextBasedRestrictionsClientOptions := &contextbasedrestrictionsv1.Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_CONTEXT_BASED_RESTRICTIONS_ENDPOINT"}, cbrURL), - } - - // Construct the service client. - session.contextBasedRestrictionsClient, err = contextbasedrestrictionsv1.NewContextBasedRestrictionsV1(contextBasedRestrictionsClientOptions) - if err == nil && session.contextBasedRestrictionsClient != nil { - // Enable retries for API calls - session.contextBasedRestrictionsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.contextBasedRestrictionsClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } else { - session.contextBasedRestrictionsClientErr = fmt.Errorf("Error occurred while configuring Context Based Restrictions service: %q", err) - } - - // CATALOG MANAGEMENT Service - catalogManagementURL := "https://cm.globalcatalog.cloud.ibm.com/api/v1-beta" - if c.Visibility == "private" { - session.catalogManagementClientErr = fmt.Errorf("Catalog Management resource doesnot support private endpoints") - } - if fileMap != nil && c.Visibility != "public-and-private" { - catalogManagementURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CATALOG_MANAGEMENT_API_ENDPOINT", c.Region, catalogManagementURL) - } - catalogManagementClientOptions := &catalogmanagementv1.CatalogManagementV1Options{ - URL: envFallBack([]string{"IBMCLOUD_CATALOG_MANAGEMENT_API_ENDPOINT"}, catalogManagementURL), - Authenticator: authenticator, - } - // Construct the service client. - session.catalogManagementClient, err = catalogmanagementv1.NewCatalogManagementV1(catalogManagementClientOptions) - if err != nil { - session.catalogManagementClientErr = fmt.Errorf("Error occurred while configuring Catalog Management API service: %q", err) - } - if session.catalogManagementClient != nil && session.catalogManagementClient.Service != nil { - // Enable retries for API calls - session.catalogManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.catalogManagementClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // ATRACKER Service - var atrackerClientURL string - atrackerClientURL, err = atrackerv1.GetServiceURLForRegion(c.Region) - if err != nil { - session.atrackerClientErr = err - } - if c.Visibility == "private" || c.Visibility == "public-and-private" { - atrackerClientURL, err = atrackerv1.GetServiceURLForRegion("private." + c.Region) - if err != nil && c.Visibility == "public-and-private" { - atrackerClientURL, err = atrackerv1.GetServiceURLForRegion(c.Region) - if err != nil { - session.atrackerClientErr = err - } - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - atrackerClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_ATRACKER_API_ENDPOINT", c.Region, atrackerClientURL) - } - atrackerClientOptions := &atrackerv1.AtrackerV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_ATRACKER_API_ENDPOINT"}, atrackerClientURL), - } - // Construct the service client. - session.atrackerClient, err = atrackerv1.NewAtrackerV1(atrackerClientOptions) - if err != nil { - session.atrackerClientErr = fmt.Errorf("Error occurred while configuring Activity Tracker API service: %q", err) - } - if session.atrackerClient != nil && session.atrackerClient.Service != nil { - // Enable retries for API calls - session.atrackerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.atrackerClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // SCC FINDINGS Service - var findingsClientURL string - if c.Visibility == "public" || c.Visibility == "public-and-private" { - findingsClientURL, err = findingsv1.GetServiceURLForRegion(c.Region) - if err != nil { - session.findingsClientErr = fmt.Errorf("Error occurred while configuring Security Insights Findings API service: `%s` region not supported", c.Region) - } - } else { - session.findingsClientErr = fmt.Errorf("Error occurred while configuring Security Insights Findings API service: `%v` visibility not supported", c.Visibility) - } - if fileMap != nil && c.Visibility != "public-and-private" { - findingsClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SCC_FINDINGS_API_ENDPOINT", c.Region, findingsClientURL) - } - findingsClientOptions := &findingsv1.FindingsV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_SCC_FINDINGS_API_ENDPOINT"}, findingsClientURL), - AccountID: core.StringPtr(userConfig.userAccount), - } - // Construct the service client. - session.findingsClient, err = findingsv1.NewFindingsV1(findingsClientOptions) - if err != nil { - session.findingsClientErr = fmt.Errorf("Error occurred while configuring Security Insights Findings API service: %q", err) - } - if session.findingsClient != nil && session.findingsClient.Service != nil { - // Enable retries for API calls - session.findingsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.findingsClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // SCC ADMIN Service - var adminServiceApiClientURL string - if c.Visibility == "private" || c.Visibility == "public-and-private" { - adminServiceApiClientURL, err = adminserviceapiv1.GetServiceURLForRegion("private." + c.Region) - if err != nil && c.Visibility == "public-and-private" { - adminServiceApiClientURL, err = adminserviceapiv1.GetServiceURLForRegion(c.Region) - } - } else { - adminServiceApiClientURL, err = adminserviceapiv1.GetServiceURLForRegion(c.Region) - } - if err != nil { - adminServiceApiClientURL = adminserviceapiv1.DefaultServiceURL - } - adminServiceApiClientOptions := &adminserviceapiv1.AdminServiceApiV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_SCC_ADMIN_API_ENDPOINT"}, adminServiceApiClientURL), - } - - // Construct the service client. - session.adminServiceApiClient, err = adminserviceapiv1.NewAdminServiceApiV1(adminServiceApiClientOptions) - if err == nil { - // Enable retries for API calls - session.adminServiceApiClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.adminServiceApiClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } else { - session.adminServiceApiClientErr = fmt.Errorf("Error occurred while configuring Admin Service API service: %q", err) - } - - // SCHEMATICS Service - schematicsEndpoint := "https://schematics.cloud.ibm.com" - if c.Visibility == "private" || c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - schematicsEndpoint = contructEndpoint("private-us.schematics", cloudEndpoint) - } else if c.Region == "eu-gb" || c.Region == "eu-de" { - schematicsEndpoint = contructEndpoint("private-eu.schematics", cloudEndpoint) - } else { - schematicsEndpoint = "https://schematics.cloud.ibm.com" - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - schematicsEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SCHEMATICS_API_ENDPOINT", c.Region, schematicsEndpoint) - } - schematicsClientOptions := &schematicsv1.SchematicsV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_SCHEMATICS_API_ENDPOINT"}, schematicsEndpoint), - } - // Construct the service client. - schematicsClient, err := schematicsv1.NewSchematicsV1(schematicsClientOptions) - if err != nil { - session.schematicsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Schematics Service API service: %q", err) - } - // Enable retries for API calls - if schematicsClient != nil && schematicsClient.Service != nil { - schematicsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - schematicsClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.schematicsClient = schematicsClient - - // VPC Service - vpcurl := contructEndpoint(fmt.Sprintf("%s.iaas", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) - if c.Visibility == "private" { - if c.Region == "us-south" || c.Region == "us-east" { - vpcurl = contructEndpoint(fmt.Sprintf("%s.private.iaas", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) - } else { - session.vpcErr = fmt.Errorf("[ERROR] VPC supports private endpoints only in us-south and us-east") - } - } - if c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - vpcurl = contructEndpoint(fmt.Sprintf("%s.private.iaas", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) - } - vpcurl = contructEndpoint(fmt.Sprintf("%s.iaas", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - vpcurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IS_NG_API_ENDPOINT", c.Region, vpcurl) - } - vpcoptions := &vpc.VpcV1Options{ - URL: envFallBack([]string{"IBMCLOUD_IS_NG_API_ENDPOINT"}, vpcurl), - Authenticator: authenticator, - } - vpcclient, err := vpc.NewVpcV1(vpcoptions) - if err != nil { - session.vpcErr = fmt.Errorf("[ERROR] Error occured while configuring vpc service: %q", err) - } - if vpcclient != nil && vpcclient.Service != nil { - vpcclient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - vpcclient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.vpcAPI = vpcclient - - // PUSH NOTIFICATIONS Service - pnurl := fmt.Sprintf("https://%s.imfpush.cloud.ibm.com/imfpush/v1", c.Region) - if c.Visibility == "private" { - session.pushServiceClientErr = fmt.Errorf("Push Notifications Service API doesnot support private endpoints") - } - if fileMap != nil && c.Visibility != "public-and-private" { - pnurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_PUSH_API_ENDPOINT", c.Region, pnurl) - } - pushNotificationOptions := &pushservicev1.PushServiceV1Options{ - URL: envFallBack([]string{"IBMCLOUD_PUSH_API_ENDPOINT"}, pnurl), - Authenticator: authenticator, - } - pnclient, err := pushservicev1.NewPushServiceV1(pushNotificationOptions) - if err != nil { - session.pushServiceClientErr = fmt.Errorf("[ERROR] Error occured while configuring Push Notifications service: %q", err) - } - if pnclient != nil && pnclient.Service != nil { - // Enable retries for API calls - pnclient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - pnclient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.pushServiceClient = pnclient - // event notifications - enurl := fmt.Sprintf("https://%s.event-notifications.cloud.ibm.com/event-notifications", c.Region) - if c.Visibility == "private" { - session.eventNotificationsApiClientErr = fmt.Errorf("Event Notifications Service does not support private endpoints") - } - if fileMap != nil && c.Visibility != "public-and-private" { - enurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_EVENT_NOTIFICATIONS_API_ENDPOINT", c.Region, enurl) - } - enClientOptions := &eventnotificationsv1.EventNotificationsV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_EVENT_NOTIFICATIONS_API_ENDPOINT"}, enurl), - } - // Construct the service client. - session.eventNotificationsApiClient, err = eventnotificationsv1.NewEventNotificationsV1(enClientOptions) - if err != nil { - // Enable { - session.eventNotificationsApiClientErr = fmt.Errorf("Error occurred while configuring Event Notifications service: %q", err) - } - if session.eventNotificationsApiClient != nil && session.eventNotificationsApiClient.Service != nil { - // Enable retries for API calls - session.eventNotificationsApiClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.eventNotificationsApiClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // APP CONFIGURATION Service - if c.Visibility == "private" { - session.appConfigurationClientErr = fmt.Errorf("[ERROR] App Configuration Service API doesnot support private endpoints") - } - appConfigurationClientOptions := &appconfigurationv1.AppConfigurationV1Options{ - Authenticator: authenticator, - } - appConfigClient, err := appconfigurationv1.NewAppConfigurationV1(appConfigurationClientOptions) - if appConfigClient != nil { - // Enable retries for API calls - appConfigClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.appConfigurationClient = appConfigClient - } else { - session.appConfigurationClientErr = fmt.Errorf("[ERROR] Error occurred while configuring App Configuration service: %q", err) - } - - // CONTAINER REGISTRY Service - // Construct an "options" struct for creating the service client. - containerRegistryClientURL, err := containerregistryv1.GetServiceURLForRegion(c.Region) - if err != nil { - containerRegistryClientURL = containerregistryv1.DefaultServiceURL - } - if c.Visibility == "private" || c.Visibility == "public-and-private" { - containerRegistryClientURL, err = GetPrivateServiceURLForRegion(c.Region) - if err != nil { - containerRegistryClientURL, _ = GetPrivateServiceURLForRegion("global") - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - containerRegistryClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CR_API_ENDPOINT", c.Region, containerRegistryClientURL) - } - containerRegistryClientOptions := &containerregistryv1.ContainerRegistryV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_CR_API_ENDPOINT"}, containerRegistryClientURL), - Account: core.StringPtr(userConfig.userAccount), - } - // Construct the service client. - session.containerRegistryClient, err = containerregistryv1.NewContainerRegistryV1(containerRegistryClientOptions) - if err != nil { - session.containerRegistryClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Container Registry API service: %q", err) - } - if session.containerRegistryClient != nil && session.containerRegistryClient.Service != nil { - // Enable retries for API calls - session.containerRegistryClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.containerRegistryClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // OBJECT STORAGE Service - cosconfigurl := "https://config.cloud-object-storage.cloud.ibm.com/v1" - if fileMap != nil && c.Visibility != "public-and-private" { - cosconfigurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_COS_CONFIG_ENDPOINT", c.Region, cosconfigurl) - } - cosconfigoptions := &cosconfig.ResourceConfigurationV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_COS_CONFIG_ENDPOINT"}, cosconfigurl), - } - cosconfigclient, err := cosconfig.NewResourceConfigurationV1(cosconfigoptions) - if err != nil { - session.cosConfigErr = fmt.Errorf("[ERROR] Error occured while configuring COS config service: %q", err) - } - session.cosConfigAPI = cosconfigclient - - globalSearchAPI, err := globalsearchv2.New(sess.BluemixSession) - if err != nil { - session.globalSearchConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Global Search: %q", err) - } - session.globalSearchServiceAPI = globalSearchAPI - // Global Tagging Bluemix-go - globalTaggingAPI, err := globaltaggingv3.New(sess.BluemixSession) - if err != nil { - session.globalTaggingConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Global Tagging: %q", err) - } - session.globalTaggingServiceAPI = globalTaggingAPI - - // GLOBAL TAGGING Service - globalTaggingEndpoint := "https://tags.global-search-tagging.cloud.ibm.com" - if c.Visibility == "private" || c.Visibility == "public-and-private" { - var globalTaggingRegion string - if c.Region != "us-south" && c.Region != "us-east" { - globalTaggingRegion = "us-south" - } else { - globalTaggingRegion = c.Region - } - globalTaggingEndpoint = contructEndpoint(fmt.Sprintf("tags.private.%s", globalTaggingRegion), fmt.Sprintf("global-search-tagging.%s", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - globalTaggingEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_GT_API_ENDPOINT", c.Region, globalTaggingEndpoint) - } - globalTaggingV1Options := &globaltaggingv1.GlobalTaggingV1Options{ - URL: envFallBack([]string{"IBMCLOUD_GT_API_ENDPOINT"}, globalTaggingEndpoint), - Authenticator: authenticator, - } - globalTaggingAPIV1, err := globaltaggingv1.NewGlobalTaggingV1(globalTaggingV1Options) - if err != nil { - session.globalTaggingConfigErrV1 = fmt.Errorf("Error occured while configuring Global Tagging: %q", err) - } - if globalTaggingAPIV1 != nil && globalTaggingAPIV1.Service != nil { - session.globalTaggingServiceAPIV1 = *globalTaggingAPIV1 - session.globalTaggingServiceAPIV1.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.globalTaggingServiceAPIV1.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - icdAPI, err := icdv4.New(sess.BluemixSession) - if err != nil { - session.icdConfigErr = fmt.Errorf("Error occured while configuring IBM Cloud Database Services: %q", err) - } - session.icdServiceAPI = icdAPI - - resourceCatalogAPI, err := catalog.New(sess.BluemixSession) - if err != nil { - session.resourceCatalogConfigErr = fmt.Errorf("Error occured while configuring Resource Catalog service: %q", err) - } - session.resourceCatalogServiceAPI = resourceCatalogAPI - - resourceManagementAPIv2, err := managementv2.New(sess.BluemixSession) - if err != nil { - session.resourceManagementConfigErrv2 = fmt.Errorf("Error occured while configuring Resource Management service: %q", err) - } - session.resourceManagementServiceAPIv2 = resourceManagementAPIv2 - - resourceControllerAPI, err := controller.New(sess.BluemixSession) - if err != nil { - session.resourceControllerConfigErr = fmt.Errorf("Error occured while configuring Resource Controller service: %q", err) - } - session.resourceControllerServiceAPI = resourceControllerAPI - - ResourceControllerAPIv2, err := controllerv2.New(sess.BluemixSession) - if err != nil { - session.resourceControllerConfigErrv2 = fmt.Errorf("Error occured while configuring Resource Controller v2 service: %q", err) - } - session.resourceControllerServiceAPIv2 = ResourceControllerAPIv2 - - userManagementAPI, err := usermanagementv2.New(sess.BluemixSession) - if err != nil { - session.userManagementErr = fmt.Errorf("Error occured while configuring user management service: %q", err) - } - session.userManagementAPI = userManagementAPI - - certManagementAPI, err := certificatemanager.New(sess.BluemixSession) - if err != nil { - session.certManagementErr = fmt.Errorf("Error occured while configuring Certificate manager service: %q", err) - } - session.certManagementAPI = certManagementAPI - - namespaceFunction, err := functions.New(sess.BluemixSession) - if err != nil { - session.functionIAMNamespaceErr = fmt.Errorf("Error occured while configuring Cloud Funciton Service : %q", err) - } - session.functionIAMNamespaceAPI = namespaceFunction - - // API GATEWAY service - apicurl := contructEndpoint(fmt.Sprintf("api.%s.apigw", c.Region), fmt.Sprintf("%s/controller", cloudEndpoint)) - if c.Visibility == "private" || c.Visibility == "public-and-private" { - apicurl = contructEndpoint(fmt.Sprintf("api.private.%s.apigw", c.Region), fmt.Sprintf("%s/controller", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - apicurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_API_GATEWAY_ENDPOINT", c.Region, apicurl) - } - APIGatewayControllerAPIV1Options := &apigateway.ApiGatewayControllerApiV1Options{ - URL: envFallBack([]string{"IBMCLOUD_API_GATEWAY_ENDPOINT"}, apicurl), - Authenticator: &core.NoAuthAuthenticator{}, - } - apigatewayAPI, err := apigateway.NewApiGatewayControllerApiV1(APIGatewayControllerAPIV1Options) - if err != nil { - session.apigatewayErr = fmt.Errorf("Error occured while configuring APIGateway service: %q", err) - } - session.apigatewayAPI = apigatewayAPI - - // POWER SYSTEMS Service - ibmpisession, err := ibmpisession.New(sess.BluemixSession.Config.IAMAccessToken, c.Region, false, session.bmxUserDetails.userAccount, c.Zone) - if err != nil { - session.ibmpiConfigErr = err - return nil, err - } - session.ibmpiSession = ibmpisession - - // PRIVATE DNS Service - pdnsURL := dns.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - pdnsURL = contructEndpoint("api.private.dns-svcs", fmt.Sprintf("%s/v1", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - pdnsURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_PRIVATE_DNS_API_ENDPOINT", c.Region, pdnsURL) - } - dnsOptions := &dns.DnsSvcsV1Options{ - URL: envFallBack([]string{"IBMCLOUD_PRIVATE_DNS_API_ENDPOINT"}, pdnsURL), - Authenticator: authenticator, - } - session.pDNSClient, session.pDNSErr = dns.NewDnsSvcsV1(dnsOptions) - if session.pDNSErr != nil { - session.pDNSErr = fmt.Errorf("Error occured while configuring PrivateDNS Service: %s", session.pDNSErr) - } - if session.pDNSClient != nil && session.pDNSClient.Service != nil { - session.pDNSClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.pDNSClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // DIRECT LINK Service - ver := time.Now().Format("2006-01-02") - dlURL := dl.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - dlURL = contructEndpoint("private.directlink", fmt.Sprintf("%s/v1", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - dlURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_DL_API_ENDPOINT", c.Region, dlURL) - } - directlinkOptions := &dl.DirectLinkV1Options{ - URL: envFallBack([]string{"IBMCLOUD_DL_API_ENDPOINT"}, dlURL), - Authenticator: authenticator, - Version: &ver, - } - session.directlinkAPI, session.directlinkErr = dl.NewDirectLinkV1(directlinkOptions) - if session.directlinkErr != nil { - session.directlinkErr = fmt.Errorf("Error occured while configuring Direct Link Service: %s", session.directlinkErr) - } - if session.directlinkAPI != nil && session.directlinkAPI.Service != nil { - session.directlinkAPI.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.directlinkAPI.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // DIRECT LINK PROVIDER Service - dlproviderURL := dlProviderV2.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - dlproviderURL = contructEndpoint("private.directlink", fmt.Sprintf("%s/provider/v2", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - dlproviderURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_DL_PROVIDER_API_ENDPOINT", c.Region, dlproviderURL) - } - directLinkProviderV2Options := &dlProviderV2.DirectLinkProviderV2Options{ - URL: envFallBack([]string{"IBMCLOUD_DL_PROVIDER_API_ENDPOINT"}, dlproviderURL), - Authenticator: authenticator, - Version: &ver, - } - session.dlProviderAPI, session.dlProviderErr = dlProviderV2.NewDirectLinkProviderV2(directLinkProviderV2Options) - if session.dlProviderErr != nil { - session.dlProviderErr = fmt.Errorf("Error occured while configuring Direct Link Provider Service: %s", session.dlProviderErr) - } - if session.dlProviderAPI != nil && session.dlProviderAPI.Service != nil { - session.dlProviderAPI.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.dlProviderAPI.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // TRANSIT GATEWAY Service - tgURL := tg.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - tgURL = contructEndpoint("private.transit", fmt.Sprintf("%s/v1", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - tgURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_TG_API_ENDPOINT", c.Region, tgURL) - } - transitgatewayOptions := &tg.TransitGatewayApisV1Options{ - URL: envFallBack([]string{"IBMCLOUD_TG_API_ENDPOINT"}, tgURL), - Authenticator: authenticator, - Version: CreateVersionDate(), - } - session.transitgatewayAPI, session.transitgatewayErr = tg.NewTransitGatewayApisV1(transitgatewayOptions) - if session.transitgatewayErr != nil { - session.transitgatewayErr = fmt.Errorf("Error occured while configuring Transit Gateway Service: %s", session.transitgatewayErr) - } - if session.transitgatewayAPI != nil && session.transitgatewayAPI.Service != nil { - session.transitgatewayAPI.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // session.transitgatewayAPI.SetDefaultHeaders(gohttp.Header{ - // "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - // }) - } - - // CIS Service instances starts here. - cisURL := contructEndpoint("api.cis", cloudEndpoint) - if c.Visibility == "private" { - // cisURL = contructEndpoint("api.private.cis", cloudEndpoint) - session.cisZonesErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisDNSBulkErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisGLBPoolErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisGLBErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisGLBHealthCheckErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisIPErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisRLErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisPageRuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisEdgeFunctionErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisSSLErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisWAFPackageErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisDomainSettingsErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisRoutingErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisWAFGroupErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisCacheErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisCustomPageErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisAccessRuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisUARuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisLockdownErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisRangeAppErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisWAFRuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - session.cisFiltersErr = fmt.Errorf("CIS Service doesnt support private endpoints.") - } - if fileMap != nil && c.Visibility != "public-and-private" { - cisURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CIS_API_ENDPOINT", c.Region, cisURL) - } - cisEndPoint := envFallBack([]string{"IBMCLOUD_CIS_API_ENDPOINT"}, cisURL) - - // IBM Network CIS Zones service - cisZonesV1Opt := &ciszonesv1.ZonesV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisZonesV1Client, session.cisZonesErr = ciszonesv1.NewZonesV1(cisZonesV1Opt) - if session.cisZonesErr != nil { - session.cisZonesErr = fmt.Errorf( - "Error occured while configuring CIS Zones service: %s", - session.cisZonesErr) - } - if session.cisZonesV1Client != nil && session.cisZonesV1Client.Service != nil { - session.cisZonesV1Client.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisZonesV1Client.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS DNS Record service - cisDNSRecordsOpt := &cisdnsrecordsv1.DnsRecordsV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisDNSRecordsClient, session.cisDNSErr = cisdnsrecordsv1.NewDnsRecordsV1(cisDNSRecordsOpt) - if session.cisDNSErr != nil { - session.cisDNSErr = fmt.Errorf("Error occured while configuring CIS DNS Service: %s", session.cisDNSErr) - } - if session.cisDNSRecordsClient != nil && session.cisDNSRecordsClient.Service != nil { - session.cisDNSRecordsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisDNSRecordsClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS DNS Record bulk service - cisDNSRecordBulkOpt := &cisdnsbulkv1.DnsRecordBulkV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisDNSRecordBulkClient, session.cisDNSBulkErr = cisdnsbulkv1.NewDnsRecordBulkV1(cisDNSRecordBulkOpt) - if session.cisDNSBulkErr != nil { - session.cisDNSBulkErr = fmt.Errorf( - "Error occured while configuration CIS DNS bulk service : %s", - session.cisDNSBulkErr) - } - if session.cisDNSRecordBulkClient != nil && session.cisDNSRecordBulkClient.Service != nil { - session.cisDNSRecordBulkClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisDNSRecordBulkClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Global load balancer pool - cisGLBPoolOpt := &cisglbpoolv0.GlobalLoadBalancerPoolsV0Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisGLBPoolClient, session.cisGLBPoolErr = - cisglbpoolv0.NewGlobalLoadBalancerPoolsV0(cisGLBPoolOpt) - if session.cisGLBPoolErr != nil { - session.cisGLBPoolErr = - fmt.Errorf("Error occured while configuring CIS GLB Pool service: %s", - session.cisGLBPoolErr) - } - if session.cisGLBPoolClient != nil && session.cisGLBPoolClient.Service != nil { - session.cisGLBPoolClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisGLBPoolClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Global load balancer - cisGLBOpt := &cisglbv1.GlobalLoadBalancerV1Options{ - URL: cisEndPoint, - Authenticator: authenticator, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - } - session.cisGLBClient, session.cisGLBErr = cisglbv1.NewGlobalLoadBalancerV1(cisGLBOpt) - if session.cisGLBErr != nil { - session.cisGLBErr = - fmt.Errorf("Error occured while configuring CIS GLB service: %s", - session.cisGLBErr) - } - if session.cisGLBClient != nil && session.cisGLBClient.Service != nil { - session.cisGLBClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisGLBClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Global load balancer health check/monitor - cisGLBHealthCheckOpt := &cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisGLBHealthCheckClient, session.cisGLBHealthCheckErr = - cisglbhealthcheckv1.NewGlobalLoadBalancerMonitorV1(cisGLBHealthCheckOpt) - if session.cisGLBHealthCheckErr != nil { - session.cisGLBHealthCheckErr = - fmt.Errorf("Error occured while configuring CIS GLB Health Check service: %s", - session.cisGLBHealthCheckErr) - } - if session.cisGLBHealthCheckClient != nil && session.cisGLBHealthCheckClient.Service != nil { - session.cisGLBHealthCheckClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisGLBHealthCheckClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS IP - cisIPOpt := &cisipv1.CisIpApiV1Options{ - URL: cisEndPoint, - Authenticator: authenticator, - } - session.cisIPClient, session.cisIPErr = cisipv1.NewCisIpApiV1(cisIPOpt) - if session.cisIPErr != nil { - session.cisIPErr = fmt.Errorf("Error occured while configuring CIS IP service: %s", - session.cisIPErr) - } - if session.cisIPClient != nil && session.cisIPClient.Service != nil { - session.cisIPClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisIPClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Zone Rate Limit - cisRLOpt := &cisratelimitv1.ZoneRateLimitsV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisRLClient, session.cisRLErr = cisratelimitv1.NewZoneRateLimitsV1(cisRLOpt) - if session.cisRLErr != nil { - session.cisRLErr = fmt.Errorf( - "Error occured while cofiguring CIS Zone Rate Limit service: %s", - session.cisRLErr) - } - if session.cisRLClient != nil && session.cisRLClient.Service != nil { - session.cisRLClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisRLClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Page Rules - cisPageRuleOpt := &cispagerulev1.PageRuleApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneID: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisPageRuleClient, session.cisPageRuleErr = cispagerulev1.NewPageRuleApiV1(cisPageRuleOpt) - if session.cisPageRuleErr != nil { - session.cisPageRuleErr = fmt.Errorf( - "Error occured while cofiguring CIS Page Rule service: %s", - session.cisPageRuleErr) - } - if session.cisPageRuleClient != nil && session.cisPageRuleClient.Service != nil { - session.cisPageRuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisPageRuleClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Edge Function - cisEdgeFunctionOpt := &cisedgefunctionv1.EdgeFunctionsApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisEdgeFunctionClient, session.cisEdgeFunctionErr = - cisedgefunctionv1.NewEdgeFunctionsApiV1(cisEdgeFunctionOpt) - if session.cisEdgeFunctionErr != nil { - session.cisEdgeFunctionErr = - fmt.Errorf("Error occured while configuring CIS Edge Function service: %s", - session.cisEdgeFunctionErr) - } - if session.cisEdgeFunctionClient != nil && session.cisEdgeFunctionClient.Service != nil { - session.cisEdgeFunctionClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisEdgeFunctionClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS SSL certificate - cisSSLOpt := &cissslv1.SslCertificateApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - - session.cisSSLClient, session.cisSSLErr = cissslv1.NewSslCertificateApiV1(cisSSLOpt) - if session.cisSSLErr != nil { - session.cisSSLErr = - fmt.Errorf("Error occured while configuring CIS SSL certificate service: %s", - session.cisSSLErr) - } - if session.cisSSLClient != nil && session.cisSSLClient.Service != nil { - session.cisSSLClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisSSLClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS WAF Package - cisWAFPackageOpt := &ciswafpackagev1.WafRulePackagesApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneID: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisWAFPackageClient, session.cisWAFPackageErr = - ciswafpackagev1.NewWafRulePackagesApiV1(cisWAFPackageOpt) - if session.cisWAFPackageErr != nil { - session.cisWAFPackageErr = - fmt.Errorf("Error occured while configuration CIS WAF Package service: %s", - session.cisWAFPackageErr) - } - if session.cisWAFPackageClient != nil && session.cisWAFPackageClient.Service != nil { - session.cisWAFPackageClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisWAFPackageClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Domain settings - cisDomainSettingsOpt := &cisdomainsettingsv1.ZonesSettingsV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisDomainSettingsClient, session.cisDomainSettingsErr = - cisdomainsettingsv1.NewZonesSettingsV1(cisDomainSettingsOpt) - if session.cisDomainSettingsErr != nil { - session.cisDomainSettingsErr = - fmt.Errorf("[ERROR] Error occured while configuring CIS Domain Settings service: %s", - session.cisDomainSettingsErr) - } - if session.cisDomainSettingsClient != nil && session.cisDomainSettingsClient.Service != nil { - session.cisDomainSettingsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisDomainSettingsClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Routing - cisRoutingOpt := &cisroutingv1.RoutingV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisRoutingClient, session.cisRoutingErr = - cisroutingv1.NewRoutingV1(cisRoutingOpt) - if session.cisRoutingErr != nil { - session.cisRoutingErr = - fmt.Errorf("[ERROR] Error occured while configuring CIS Routing service: %s", - session.cisRoutingErr) - } - if session.cisRoutingClient != nil && session.cisRoutingClient.Service != nil { - session.cisRoutingClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisRoutingClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS WAF Group - cisWAFGroupOpt := &ciswafgroupv1.WafRuleGroupsApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneID: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisWAFGroupClient, session.cisWAFGroupErr = - ciswafgroupv1.NewWafRuleGroupsApiV1(cisWAFGroupOpt) - if session.cisWAFGroupErr != nil { - session.cisWAFGroupErr = - fmt.Errorf("Error occured while configuring CIS WAF Group service: %s", - session.cisWAFGroupErr) - } - if session.cisWAFGroupClient != nil && session.cisWAFGroupClient.Service != nil { - session.cisWAFGroupClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisWAFGroupClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Cache service - cisCacheOpt := &ciscachev1.CachingApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneID: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisCacheClient, session.cisCacheErr = - ciscachev1.NewCachingApiV1(cisCacheOpt) - if session.cisCacheErr != nil { - session.cisCacheErr = - fmt.Errorf("Error occured while configuring CIS Caching service: %s", - session.cisCacheErr) - } - if session.cisCacheClient != nil && session.cisCacheClient.Service != nil { - session.cisCacheClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisCacheClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Custom pages service - cisCustomPageOpt := &ciscustompagev1.CustomPagesV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - - session.cisCustomPageClient, session.cisCustomPageErr = - ciscustompagev1.NewCustomPagesV1(cisCustomPageOpt) - if session.cisCustomPageErr != nil { - session.cisCustomPageErr = - fmt.Errorf("Error occured while configuring CIS Custom Pages service: %s", - session.cisCustomPageErr) - } - if session.cisCustomPageClient != nil && session.cisCustomPageClient.Service != nil { - session.cisCustomPageClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisCustomPageClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Firewall Access rule - cisAccessRuleOpt := &cisaccessrulev1.ZoneFirewallAccessRulesV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisAccessRuleClient, session.cisAccessRuleErr = - cisaccessrulev1.NewZoneFirewallAccessRulesV1(cisAccessRuleOpt) - if session.cisAccessRuleErr != nil { - session.cisAccessRuleErr = - fmt.Errorf("Error occured while configuring CIS Firewall Access Rule service: %s", - session.cisAccessRuleErr) - } - if session.cisAccessRuleClient != nil && session.cisAccessRuleClient.Service != nil { - session.cisAccessRuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisAccessRuleClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Firewall User Agent Blocking rule - cisUARuleOpt := &cisuarulev1.UserAgentBlockingRulesV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisUARuleClient, session.cisUARuleErr = - cisuarulev1.NewUserAgentBlockingRulesV1(cisUARuleOpt) - if session.cisUARuleErr != nil { - session.cisUARuleErr = - fmt.Errorf("Error occured while configuring CIS Firewall User Agent Blocking Rule service: %s", - session.cisUARuleErr) - } - if session.cisUARuleClient != nil && session.cisUARuleClient.Service != nil { - session.cisUARuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisUARuleClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Firewall Lockdown rule - cisLockdownOpt := &cislockdownv1.ZoneLockdownV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisLockdownClient, session.cisLockdownErr = - cislockdownv1.NewZoneLockdownV1(cisLockdownOpt) - if session.cisLockdownErr != nil { - session.cisLockdownErr = - fmt.Errorf("Error occured while configuring CIS Firewall Lockdown Rule service: %s", - session.cisLockdownErr) - } - if session.cisLockdownClient != nil && session.cisLockdownClient.Service != nil { - session.cisLockdownClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisLockdownClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Range Application rule - cisRangeAppOpt := &cisrangeappv1.RangeApplicationsV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneIdentifier: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisRangeAppClient, session.cisRangeAppErr = - cisrangeappv1.NewRangeApplicationsV1(cisRangeAppOpt) - if session.cisRangeAppErr != nil { - session.cisRangeAppErr = - fmt.Errorf("Error occured while configuring CIS Range Application rule service: %s", - session.cisRangeAppErr) - } - if session.cisRangeAppClient != nil && session.cisRangeAppClient.Service != nil { - session.cisRangeAppClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisRangeAppClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS WAF Rule Service - cisWAFRuleOpt := &ciswafrulev1.WafRulesApiV1Options{ - URL: cisEndPoint, - Crn: core.StringPtr(""), - ZoneID: core.StringPtr(""), - Authenticator: authenticator, - } - session.cisWAFRuleClient, session.cisWAFRuleErr = - ciswafrulev1.NewWafRulesApiV1(cisWAFRuleOpt) - if session.cisWAFRuleErr != nil { - session.cisWAFRuleErr = fmt.Errorf( - "Error occured while configuring CIS WAF Rules service: %s", - session.cisWAFRuleErr) - } - if session.cisWAFRuleClient != nil && session.cisWAFRuleClient.Service != nil { - session.cisWAFRuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisWAFRuleClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Filters - cisFiltersOpt := &cisfiltersv1.FiltersV1Options{ - URL: cisEndPoint, - Authenticator: authenticator, - } - session.cisFiltersClient, session.cisFiltersErr = cisfiltersv1.NewFiltersV1(cisFiltersOpt) - if session.cisFiltersErr != nil { - session.cisFiltersErr = - fmt.Errorf("Error occured while configuring CIS Filters : %s", - session.cisFiltersErr) - } - if session.cisFiltersClient != nil && session.cisFiltersClient.Service != nil { - session.cisFiltersClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisFiltersClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IBM Network CIS Firewall rules - cisFirewallrulesOpt := &cisfirewallrulesv1.FirewallRulesV1Options{ - URL: cisEndPoint, - Authenticator: authenticator, - } - session.cisFirewallRulesClient, session.cisFirewallRulesErr = cisfirewallrulesv1.NewFirewallRulesV1(cisFirewallrulesOpt) - if session.cisFirewallRulesErr != nil { - session.cisFirewallRulesErr = - fmt.Errorf("Error occured while configuring CIS Firewall rules : %s", - session.cisFirewallRulesErr) - } - if session.cisFirewallRulesClient != nil && session.cisFirewallRulesClient.Service != nil { - session.cisFirewallRulesClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.cisFirewallRulesClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // IAM IDENTITY Service - // iamIdenityURL := fmt.Sprintf("https://%s.iam.cloud.ibm.com/v1", c.Region) - iamIdenityURL := iamidentity.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - iamIdenityURL = contructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) - } else { - iamIdenityURL = contructEndpoint("private.iam", cloudEndpoint) - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - iamIdenityURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamIdenityURL) - } - iamIdentityOptions := &iamidentity.IamIdentityV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamIdenityURL), - } - iamIdentityClient, err := iamidentity.NewIamIdentityV1(iamIdentityOptions) - if err != nil { - session.iamIdentityErr = fmt.Errorf("Error occured while configuring IAM Identity service: %q", err) - } - if iamIdentityClient != nil && iamIdentityClient.Service != nil { - iamIdentityClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - iamIdentityClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.iamIdentityAPI = iamIdentityClient - - // IAM POLICY MANAGEMENT Service - iamPolicyManagementURL := iampolicymanagement.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - iamPolicyManagementURL = contructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) - } else { - iamPolicyManagementURL = contructEndpoint("private.iam", cloudEndpoint) - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - iamPolicyManagementURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamPolicyManagementURL) - } - iamPolicyManagementOptions := &iampolicymanagement.IamPolicyManagementV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamPolicyManagementURL), - } - iamPolicyManagementClient, err := iampolicymanagement.NewIamPolicyManagementV1(iamPolicyManagementOptions) - if err != nil { - session.iamPolicyManagementErr = fmt.Errorf("Error occured while configuring IAM Policy Management service: %q", err) - } - if iamPolicyManagementClient != nil && iamPolicyManagementClient.Service != nil { - iamPolicyManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - iamPolicyManagementClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.iamPolicyManagementAPI = iamPolicyManagementClient - - // IAM ACCESS GROUP - iamAccessGroupsURL := iamaccessgroups.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - iamAccessGroupsURL = contructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) - } else { - iamAccessGroupsURL = contructEndpoint("private.iam", cloudEndpoint) - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - iamAccessGroupsURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamAccessGroupsURL) - } - iamAccessGroupsOptions := &iamaccessgroups.IamAccessGroupsV2Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamAccessGroupsURL), - } - iamAccessGroupsClient, err := iamaccessgroups.NewIamAccessGroupsV2(iamAccessGroupsOptions) - if err != nil { - session.iamAccessGroupsErr = fmt.Errorf("Error occured while configuring IAM Access Group service: %q", err) - } - if iamAccessGroupsClient != nil && iamAccessGroupsClient.Service != nil { - iamAccessGroupsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - iamAccessGroupsClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.iamAccessGroupsAPI = iamAccessGroupsClient - - // RESOURCE MANAGEMENT Service - rmURL := resourcemanager.DefaultServiceURL - if c.Visibility == "private" { - if c.Region == "us-south" || c.Region == "us-east" { - rmURL = contructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), fmt.Sprintf("%s", cloudEndpoint)) - } else { - fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") - rmURL = contructEndpoint("private.us-south.resource-controller", fmt.Sprintf("%s", cloudEndpoint)) - } - } - if c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - rmURL = contructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), fmt.Sprintf("%s", cloudEndpoint)) - } else { - rmURL = resourcemanager.DefaultServiceURL - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - rmURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_RESOURCE_MANAGEMENT_API_ENDPOINT", c.Region, rmURL) - } - resourceManagerOptions := &resourcemanager.ResourceManagerV2Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_RESOURCE_MANAGEMENT_API_ENDPOINT"}, rmURL), - } - resourceManagerClient, err := resourcemanager.NewResourceManagerV2(resourceManagerOptions) - if err != nil { - session.resourceManagerErr = fmt.Errorf("Error occured while configuring Resource Manager service: %q", err) - } - if resourceManagerClient != nil && resourceManagerClient.Service != nil { - resourceManagerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - resourceManagerClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.resourceManagerAPI = resourceManagerClient - - //CLOUD SHELL Service - cloudShellUrl := ibmcloudshellv1.DefaultServiceURL - if fileMap != nil && c.Visibility != "public-and-private" { - cloudShellUrl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CLOUD_SHELL_API_ENDPOINT", c.Region, cloudShellUrl) - } - ibmCloudShellClientOptions := &ibmcloudshellv1.IBMCloudShellV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_CLOUD_SHELL_API_ENDPOINT"}, cloudShellUrl), - } - session.ibmCloudShellClient, err = ibmcloudshellv1.NewIBMCloudShellV1(ibmCloudShellClientOptions) - if err != nil { - session.ibmCloudShellClientErr = fmt.Errorf("Error occurred while configuring IBM Cloud Shell service: %q", err) - } - if session.ibmCloudShellClient != nil && session.ibmCloudShellClient.Service != nil { - session.ibmCloudShellClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.ibmCloudShellClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // ENTERPRISE Service - enterpriseURL := enterprisemanagementv1.DefaultServiceURL - if c.Visibility == "private" { - if c.Region == "us-south" || c.Region == "us-east" || c.Region == "eu-fr" { - enterpriseURL = contructEndpoint(fmt.Sprintf("private.%s.enterprise", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) - } else { - fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") - enterpriseURL = contructEndpoint("private.us-south.enterprise", fmt.Sprintf("%s/v1", cloudEndpoint)) - } - } - if c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" || c.Region == "eu-fr" { - enterpriseURL = contructEndpoint(fmt.Sprintf("private.%s.enterprise", c.Region), - fmt.Sprintf("%s/v1", cloudEndpoint)) - } else { - enterpriseURL = enterprisemanagementv1.DefaultServiceURL - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - enterpriseURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_ENTERPRISE_API_ENDPOINT", c.Region, enterpriseURL) - } - enterpriseManagementClientOptions := &enterprisemanagementv1.EnterpriseManagementV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_ENTERPRISE_API_ENDPOINT"}, enterpriseURL), - } - enterpriseManagementClient, err := enterprisemanagementv1.NewEnterpriseManagementV1(enterpriseManagementClientOptions) - if err != nil { - session.enterpriseManagementClientErr = fmt.Errorf("Error occurred while configuring IBM Cloud Enterprise Management API service: %q", err) - } - if enterpriseManagementClient != nil && enterpriseManagementClient.Service != nil { - enterpriseManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - enterpriseManagementClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.enterpriseManagementClient = enterpriseManagementClient - - // RESOURCE CONTROLLER Service - rcURL := resourcecontroller.DefaultServiceURL - if c.Visibility == "private" { - if c.Region == "us-south" || c.Region == "us-east" { - rcURL = contructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), cloudEndpoint) - } else { - fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") - rcURL = contructEndpoint("private.us-south.resource-controller", cloudEndpoint) - } - } - if c.Visibility == "public-and-private" { - if c.Region == "us-south" || c.Region == "us-east" { - rcURL = contructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), cloudEndpoint) - } else { - rcURL = resourcecontroller.DefaultServiceURL - } - } - if fileMap != nil && c.Visibility != "public-and-private" { - rcURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_RESOURCE_CONTROLLER_API_ENDPOINT", c.Region, rcURL) - } - resourceControllerOptions := &resourcecontroller.ResourceControllerV2Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_RESOURCE_CONTROLLER_API_ENDPOINT"}, rcURL), - } - resourceControllerClient, err := resourcecontroller.NewResourceControllerV2(resourceControllerOptions) - if err != nil { - session.resourceControllerErr = fmt.Errorf("Error occured while configuring Resource Controller service: %q", err) - } - if resourceControllerClient != nil && resourceControllerClient.Service != nil { - resourceControllerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - resourceControllerClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - session.resourceControllerAPI = resourceControllerClient - - // SECRETS MANAGER Service - secretsManagerClientOptions := &secretsmanagerv1.SecretsManagerV1Options{ - Authenticator: authenticator, - } - /// Construct the service client. - session.secretsManagerClient, err = secretsmanagerv1.NewSecretsManagerV1(secretsManagerClientOptions) - if err != nil { - session.secretsManagerClientErr = fmt.Errorf("Error occurred while configuring IBM Cloud Secrets Manager API service: %q", err) - } - if session.secretsManagerClient != nil && session.secretsManagerClient.Service != nil { - // Enable retries for API calls - session.secretsManagerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.secretsManagerClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // SATELLITE Service - containerEndpoint := kubernetesserviceapiv1.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - containerEndpoint = contructEndpoint(fmt.Sprintf("private.%s.containers", c.Region), fmt.Sprintf("%s/global", cloudEndpoint)) - } - if fileMap != nil && c.Visibility != "public-and-private" { - containerEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SATELLITE_API_ENDPOINT", c.Region, containerEndpoint) - } - kubernetesServiceV1Options := &kubernetesserviceapiv1.KubernetesServiceApiV1Options{ - URL: envFallBack([]string{"IBMCLOUD_SATELLITE_API_ENDPOINT"}, containerEndpoint), - Authenticator: authenticator, - } - session.satelliteClient, err = kubernetesserviceapiv1.NewKubernetesServiceApiV1(kubernetesServiceV1Options) - if err != nil { - session.satelliteClientErr = fmt.Errorf("Error occured while configuring satellite client: %q", err) - } - - // Enable retries for API calls - if session.satelliteClient != nil && session.satelliteClient.Service != nil { - session.satelliteClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.satelliteClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - // SATELLITE LINK Service - // Construct an "options" struct for creating the service client. - satelliteLinkEndpoint := satellitelinkv1.DefaultServiceURL - if c.Visibility == "private" || c.Visibility == "public-and-private" { - satelliteLinkEndpoint = contructEndpoint("private.api.link.satellite", cloudEndpoint) - } - if fileMap != nil && c.Visibility != "public-and-private" { - satelliteLinkEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SATELLITE_LINK_API_ENDPOINT", c.Region, satelliteLinkEndpoint) - } - satelliteLinkClientOptions := &satellitelinkv1.SatelliteLinkV1Options{ - URL: envFallBack([]string{"IBMCLOUD_SATELLITE_LINK_API_ENDPOINT"}, satelliteLinkEndpoint), - Authenticator: authenticator, - } - session.satelliteLinkClient, err = satellitelinkv1.NewSatelliteLinkV1(satelliteLinkClientOptions) - if err != nil { - session.satelliteLinkClientErr = fmt.Errorf("Error occurred while configuring Satellite Link service: %q", err) - } - if session.satelliteLinkClient != nil && session.satelliteLinkClient.Service != nil { - // Enable retries for API calls - session.satelliteLinkClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.satelliteLinkClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - esSchemaRegistryV1Options := &schemaregistryv1.SchemaregistryV1Options{ - Authenticator: authenticator, - } - session.esSchemaRegistryClient, err = schemaregistryv1.NewSchemaregistryV1(esSchemaRegistryV1Options) - if err != nil { - session.esSchemaRegistryErr = fmt.Errorf("Error occured while configuring Event Streams schema registry: %q", err) - } - if session.esSchemaRegistryClient != nil && session.esSchemaRegistryClient.Service != nil { - session.esSchemaRegistryClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - session.esSchemaRegistryClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - - //COMPLIANCE Service - // Construct an "options" struct for creating the service client. - var postureManagementClientURL string - if c.Visibility == "public" || c.Visibility == "public-and-private" { - postureManagementClientURL, err = posturemanagementv1.GetServiceURLForRegion(c.Region) - } else { - session.postureManagementClientErr = fmt.Errorf("Error occurred while configuring Security Posture Management API service: `%v` visibility not supported", c.Visibility) - } - if err != nil { - session.postureManagementClientErr = fmt.Errorf("Error occurred while configuring Security Posture Management API service: `%s` region not supported", c.Region) - } - if fileMap != nil && c.Visibility != "public-and-private" { - postureManagementClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_COMPLIANCE_API_ENDPOINT", c.Region, postureManagementClientURL) - } - postureManagementClientOptions := &posturemanagementv1.PostureManagementV1Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_COMPLIANCE_API_ENDPOINT"}, postureManagementClientURL), - AccountID: core.StringPtr(userConfig.userAccount), - } - - // Construct the service client. - session.postureManagementClient, err = posturemanagementv1.NewPostureManagementV1(postureManagementClientOptions) - if err != nil { - session.postureManagementClientErr = fmt.Errorf("Error occurred while configuring Posture Management service: %q", err) - } - if session.postureManagementClient != nil && session.postureManagementClient.Service != nil { - // Enable retries for API calls - session.postureManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.postureManagementClient.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - //COMPLIANCE Service v2 version - // Construct an "options" struct for creating the service client. - var postureManagementClientURLv2 string - if c.Visibility == "public" || c.Visibility == "public-and-private" { - postureManagementClientURLv2, err = posturemanagementv2.GetServiceURLForRegion(c.Region) - } else { - session.postureManagementClientErrv2 = fmt.Errorf("Error occurred while configuring Security Compliance Centre API service: `%v` visibility not supported", c.Visibility) - } - if err != nil { - session.postureManagementClientErrv2 = fmt.Errorf("Error occurred while configuring Security Posture Management API service: `%s` region not supported", c.Region) - } - if fileMap != nil && c.Visibility != "public-and-private" { - postureManagementClientURLv2 = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_COMPLIANCE_API_ENDPOINT", c.Region, postureManagementClientURLv2) - } - postureManagementClientOptionsv2 := &posturemanagementv2.PostureManagementV2Options{ - Authenticator: authenticator, - URL: envFallBack([]string{"IBMCLOUD_COMPLIANCE_API_ENDPOINT"}, postureManagementClientURLv2), - } - - // Construct the service client. - session.postureManagementClientv2, err = posturemanagementv2.NewPostureManagementV2(postureManagementClientOptionsv2) - if err != nil { - session.postureManagementClientErrv2 = fmt.Errorf("Error occurred while configuring Posture Management v2 service: %q", err) - } - if session.postureManagementClientv2 != nil && session.postureManagementClientv2.Service != nil { - // Enable retries for API calls - session.postureManagementClientv2.Service.EnableRetries(c.RetryCount, c.RetryDelay) - // Add custom header for analytics - session.postureManagementClientv2.SetDefaultHeaders(gohttp.Header{ - "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, - }) - } - if os.Getenv("TF_LOG") != "" { - logDestination := log.Writer() - goLogger := log.New(logDestination, "", log.LstdFlags) - core.SetLogger(core.NewLogger(core.LevelDebug, goLogger, goLogger)) - } - return session, nil -} - -// CreateVersionDate requires mandatory version attribute. Any date from 2019-12-13 up to the currentdate may be provided. Specify the current date to request the latest version. -func CreateVersionDate() *string { - version := time.Now().Format("2006-01-02") - return &version -} - -func newSession(c *Config) (*Session, error) { - ibmSession := &Session{} - - softlayerSession := &slsession.Session{ - Endpoint: c.SoftLayerEndpointURL, - Timeout: c.SoftLayerTimeout, - UserName: c.SoftLayerUserName, - APIKey: c.SoftLayerAPIKey, - Debug: os.Getenv("TF_LOG") != "", - Retries: c.RetryCount, - RetryWait: c.RetryDelay, - } - - if c.IAMToken != "" { - log.Println("Configuring SoftLayer Session with token") - softlayerSession.IAMToken = c.IAMToken - softlayerSession.IAMRefreshToken = c.IAMRefreshToken - } - if c.SoftLayerAPIKey != "" && c.SoftLayerUserName != "" { - log.Println("Configuring SoftLayer Session with API key") - softlayerSession.APIKey = c.SoftLayerAPIKey - softlayerSession.UserName = c.SoftLayerUserName - } - softlayerSession.AppendUserAgent(fmt.Sprintf("terraform-provider-ibm/%s", version.Version)) - ibmSession.SoftLayerSession = softlayerSession - - if c.IAMTrustedProfileID == "" && (c.IAMToken != "" && c.IAMRefreshToken == "") || (c.IAMToken == "" && c.IAMRefreshToken != "") { - return nil, fmt.Errorf("iam_token and iam_refresh_token must be provided") - } - if c.IAMTrustedProfileID != "" && c.IAMToken == "" { - return nil, fmt.Errorf("iam_token and iam_profile_id must be provided") - } - - if c.IAMToken != "" { - log.Println("Configuring IBM Cloud Session with token") - var sess *bxsession.Session - bmxConfig := &bluemix.Config{ - IAMAccessToken: c.IAMToken, - IAMRefreshToken: c.IAMRefreshToken, - //Comment out debug mode for v0.12 - Debug: os.Getenv("TF_LOG") != "", - HTTPTimeout: c.BluemixTimeout, - Region: c.Region, - ResourceGroup: c.ResourceGroup, - RetryDelay: &c.RetryDelay, - MaxRetries: &c.RetryCount, - Visibility: c.Visibility, - EndpointsFile: c.EndpointsFile, - UserAgent: fmt.Sprintf("terraform-provider-ibm/%s", version.Version), - } - sess, err := bxsession.New(bmxConfig) - if err != nil { - return nil, err - } - ibmSession.BluemixSession = sess - } - - if c.BluemixAPIKey != "" { - log.Println("Configuring IBM Cloud Session with API key") - var sess *bxsession.Session - bmxConfig := &bluemix.Config{ - BluemixAPIKey: c.BluemixAPIKey, - //Comment out debug mode for v0.12 - Debug: os.Getenv("TF_LOG") != "", - HTTPTimeout: c.BluemixTimeout, - Region: c.Region, - ResourceGroup: c.ResourceGroup, - RetryDelay: &c.RetryDelay, - MaxRetries: &c.RetryCount, - Visibility: c.Visibility, - EndpointsFile: c.EndpointsFile, - UserAgent: fmt.Sprintf("terraform-provider-ibm/%s", version.Version), - - //PowerServiceInstance: c.PowerServiceInstance, - } - sess, err := bxsession.New(bmxConfig) - if err != nil { - return nil, err - } - ibmSession.BluemixSession = sess - } - - return ibmSession, nil -} - -func authenticateAPIKey(sess *bxsession.Session) error { - config := sess.Config - tokenRefresher, err := authentication.NewIAMAuthRepository(config, &rest.Client{ - DefaultHeader: gohttp.Header{ - "User-Agent": []string{http.UserAgent()}, - "X-Original-User-Agent": []string{config.UserAgent}, - }, - }) - if err != nil { - return err - } - return tokenRefresher.AuthenticateAPIKey(config.BluemixAPIKey) -} - -func authenticateCF(sess *bxsession.Session) error { - config := sess.Config - tokenRefresher, err := authentication.NewUAARepository(config, &rest.Client{ - DefaultHeader: gohttp.Header{ - "User-Agent": []string{http.UserAgent()}, - "X-Original-User-Agent": []string{http.UserAgent()}, - }, - }) - if err != nil { - return err - } - return tokenRefresher.AuthenticateAPIKey(config.BluemixAPIKey) -} - -func fetchUserDetails(sess *bxsession.Session, retries int, retryDelay time.Duration) (*UserConfig, error) { - config := sess.Config - user := UserConfig{} - var bluemixToken string - - if strings.HasPrefix(config.IAMAccessToken, "Bearer") { - bluemixToken = config.IAMAccessToken[7:len(config.IAMAccessToken)] - } else { - bluemixToken = config.IAMAccessToken - } - - token, err := jwt.Parse(bluemixToken, func(token *jwt.Token) (interface{}, error) { - return "", nil - }) - //TODO validate with key - if err != nil && !strings.Contains(err.Error(), "key is of invalid type") { - if retries > 0 { - if config.BluemixAPIKey != "" { - time.Sleep(retryDelay) - log.Printf("Retrying authentication for user details %d", retries) - _ = authenticateAPIKey(sess) - return fetchUserDetails(sess, retries-1, retryDelay) - } - } - return &user, err - } - claims := token.Claims.(jwt.MapClaims) - if email, ok := claims["email"]; ok { - user.userEmail = email.(string) - } - user.userID = claims["id"].(string) - user.userAccount = claims["account"].(map[string]interface{})["bss"].(string) - iss := claims["iss"].(string) - if strings.Contains(iss, "https://iam.cloud.ibm.com") { - user.cloudName = "bluemix" - } else { - user.cloudName = "staging" - } - user.cloudType = "public" - - user.generation = 2 - return &user, nil -} - -func refreshToken(sess *bxsession.Session) error { - config := sess.Config - tokenRefresher, err := authentication.NewIAMAuthRepository(config, &rest.Client{ - DefaultHeader: gohttp.Header{ - "User-Agent": []string{http.UserAgent()}, - "X-Original-User-Agent": []string{config.UserAgent}, - }, - }) - if err != nil { - return err - } - _, err = tokenRefresher.RefreshToken() - return err -} - -func envFallBack(envs []string, defaultValue string) string { - for _, k := range envs { - if v := os.Getenv(k); v != "" { - return v - } - } - return defaultValue -} -func fileFallBack(fileMap map[string]interface{}, visibility, key, region, defaultValue string) string { - if val, ok := fileMap[key]; ok { - if v, ok := val.(map[string]interface{})[visibility]; ok { - if r, ok := v.(map[string]interface{})[region]; ok && r.(string) != "" { - return r.(string) - } - } - } - return defaultValue -} - -// DefaultTransport ... -func DefaultTransport() gohttp.RoundTripper { - transport := &gohttp.Transport{ - Proxy: gohttp.ProxyFromEnvironment, - DisableKeepAlives: true, - MaxIdleConnsPerHost: -1, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: false, - }, - } - return transport -} - -func isRetryable(err error) bool { - if bmErr, ok := err.(bmxerror.RequestFailure); ok { - switch bmErr.StatusCode() { - case 408, 504, 599, 429, 500, 502, 520, 503: - return true - } - } - - if netErr, ok := err.(net.Error); ok && netErr.Timeout() { - return true - } - - if netErr, ok := err.(*net.OpError); ok && netErr.Timeout() { - return true - } - - if netErr, ok := err.(net.UnknownNetworkError); ok && netErr.Timeout() { - return true - } - - return false -} - -func contructEndpoint(subdomain, domain string) string { - endpoint := fmt.Sprintf("https://%s.%s", subdomain, domain) - return endpoint -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/config.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/config.go new file mode 100644 index 0000000000..0d43cac2c9 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/config.go @@ -0,0 +1,3106 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package conns + +import ( + "crypto/tls" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "log" + "net" + gohttp "net/http" + "os" + "strings" + "time" + + // Added code for the Power Colo Offering + + "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1" + apigateway "github.com/IBM/apigateway-go-sdk/apigatewaycontrollerapiv1" + "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" + appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" + "github.com/IBM/container-registry-go-sdk/containerregistryv1" + "github.com/IBM/go-sdk-core/v5/core" + cosconfig "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1" + kp "github.com/IBM/keyprotect-go-client" + cisalertsv1 "github.com/IBM/networking-go-sdk/alertsv1" + ciscachev1 "github.com/IBM/networking-go-sdk/cachingapiv1" + cisipv1 "github.com/IBM/networking-go-sdk/cisipapiv1" + ciscustompagev1 "github.com/IBM/networking-go-sdk/custompagesv1" + dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" + dl "github.com/IBM/networking-go-sdk/directlinkv1" + cisdnsbulkv1 "github.com/IBM/networking-go-sdk/dnsrecordbulkv1" + cisdnsrecordsv1 "github.com/IBM/networking-go-sdk/dnsrecordsv1" + dns "github.com/IBM/networking-go-sdk/dnssvcsv1" + cisedgefunctionv1 "github.com/IBM/networking-go-sdk/edgefunctionsapiv1" + cisfiltersv1 "github.com/IBM/networking-go-sdk/filtersv1" + cisfirewallrulesv1 "github.com/IBM/networking-go-sdk/firewallrulesv1" + cisglbhealthcheckv1 "github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1" + cisglbpoolv0 "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0" + cisglbv1 "github.com/IBM/networking-go-sdk/globalloadbalancerv1" + cispagerulev1 "github.com/IBM/networking-go-sdk/pageruleapiv1" + cisrangeappv1 "github.com/IBM/networking-go-sdk/rangeapplicationsv1" + cisroutingv1 "github.com/IBM/networking-go-sdk/routingv1" + cissslv1 "github.com/IBM/networking-go-sdk/sslcertificateapiv1" + tg "github.com/IBM/networking-go-sdk/transitgatewayapisv1" + cisuarulev1 "github.com/IBM/networking-go-sdk/useragentblockingrulesv1" + ciswafgroupv1 "github.com/IBM/networking-go-sdk/wafrulegroupsapiv1" + ciswafpackagev1 "github.com/IBM/networking-go-sdk/wafrulepackagesapiv1" + ciswafrulev1 "github.com/IBM/networking-go-sdk/wafrulesapiv1" + ciswebhooksv1 "github.com/IBM/networking-go-sdk/webhooksv1" + cisaccessrulev1 "github.com/IBM/networking-go-sdk/zonefirewallaccessrulesv1" + cislockdownv1 "github.com/IBM/networking-go-sdk/zonelockdownv1" + cisratelimitv1 "github.com/IBM/networking-go-sdk/zoneratelimitsv1" + cisdomainsettingsv1 "github.com/IBM/networking-go-sdk/zonessettingsv1" + ciszonesv1 "github.com/IBM/networking-go-sdk/zonesv1" + "github.com/IBM/platform-services-go-sdk/atrackerv1" + "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" + "github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1" + "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" + "github.com/IBM/platform-services-go-sdk/globaltaggingv1" + iamaccessgroups "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" + iamidentity "github.com/IBM/platform-services-go-sdk/iamidentityv1" + iampolicymanagement "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + ibmcloudshellv1 "github.com/IBM/platform-services-go-sdk/ibmcloudshellv1" + resourcecontroller "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" + resourcemanager "github.com/IBM/platform-services-go-sdk/resourcemanagerv2" + "github.com/IBM/push-notifications-go-sdk/pushservicev1" + "github.com/IBM/scc-go-sdk/findingsv1" + "github.com/IBM/scc-go-sdk/v3/adminserviceapiv1" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" + schematicsv1 "github.com/IBM/schematics-go-sdk/schematicsv1" + "github.com/IBM/secrets-manager-go-sdk/secretsmanagerv1" + vpc "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/apache/openwhisk-client-go/whisk" + jwt "github.com/golang-jwt/jwt" + slsession "github.com/softlayer/softlayer-go/session" + + bluemix "github.com/IBM-Cloud/bluemix-go" + "github.com/IBM-Cloud/bluemix-go/api/account/accountv1" + "github.com/IBM-Cloud/bluemix-go/api/account/accountv2" + "github.com/IBM-Cloud/bluemix-go/api/certificatemanager" + "github.com/IBM-Cloud/bluemix-go/api/cis/cisv1" + "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" + "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" + "github.com/IBM-Cloud/bluemix-go/api/functions" + "github.com/IBM-Cloud/bluemix-go/api/globalsearch/globalsearchv2" + "github.com/IBM-Cloud/bluemix-go/api/globaltagging/globaltaggingv3" + "github.com/IBM-Cloud/bluemix-go/api/hpcs" + "github.com/IBM-Cloud/bluemix-go/api/icd/icdv4" + "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/controller" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/managementv2" + "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" + "github.com/IBM-Cloud/bluemix-go/authentication" + "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/bluemix-go/http" + "github.com/IBM-Cloud/bluemix-go/rest" + bxsession "github.com/IBM-Cloud/bluemix-go/session" + ibmpisession "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM-Cloud/terraform-provider-ibm/version" + "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" + "github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv1" +) + +// RetryAPIDelay - retry api delay +const RetryAPIDelay = 5 * time.Second + +//BluemixRegion ... +var BluemixRegion string + +var ( + errEmptyBluemixCredentials = errors.New("ibmcloud_api_key or bluemix_api_key or iam_token and iam_refresh_token must be provided. Please see the documentation on how to configure it") +) + +//UserConfig ... +type UserConfig struct { + UserID string + UserEmail string + UserAccount string + CloudName string `default:"bluemix"` + cloudType string `default:"public"` + generation int `default:"2"` +} + +//Config stores user provider input +type Config struct { + //BluemixAPIKey is the Bluemix api key + BluemixAPIKey string + //Bluemix region + Region string + //Resource group id + ResourceGroup string + //Bluemix API timeout + BluemixTimeout time.Duration + + //Softlayer end point url + SoftLayerEndpointURL string + + //Softlayer API timeout + SoftLayerTimeout time.Duration + + // Softlayer User Name + SoftLayerUserName string + + // Softlayer API Key + SoftLayerAPIKey string + + //Retry Count for API calls + //Unexposed in the schema at this point as they are used only during session creation for a few calls + //When sdk implements it we an expose them for expected behaviour + //https://github.com/softlayer/softlayer-go/issues/41 + RetryCount int + //Constant Retry Delay for API calls + RetryDelay time.Duration + + // FunctionNameSpace ... + FunctionNameSpace string + + //Riaas End point + RiaasEndPoint string + + //Generation + Generation int + + //IAM Token + IAMToken string + + //TrustedProfileToken Token + IAMTrustedProfileID string + + //IAM Refresh Token + IAMRefreshToken string + + // Zone + Zone string + Visibility string + EndpointsFile string +} + +//Session stores the information required for communication with the SoftLayer and Bluemix API +type Session struct { + // SoftLayerSesssion is the the SoftLayer session used to connect to the SoftLayer API + SoftLayerSession *slsession.Session + + // BluemixSession is the the Bluemix session used to connect to the Bluemix API + BluemixSession *bxsession.Session +} + +// ClientSession ... +type ClientSession interface { + AppIDAPI() (*appid.AppIDManagementV4, error) + BluemixSession() (*bxsession.Session, error) + BluemixAcccountAPI() (accountv2.AccountServiceAPI, error) + BluemixAcccountv1API() (accountv1.AccountServiceAPI, error) + BluemixUserDetails() (*UserConfig, error) + ContainerAPI() (containerv1.ContainerServiceAPI, error) + VpcContainerAPI() (containerv2.ContainerServiceAPI, error) + ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error) + FunctionClient() (*whisk.Client, error) + GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error) + GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error) + GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error) + ICDAPI() (icdv4.ICDServiceAPI, error) + IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error) + IAMAccessGroupsV2() (*iamaccessgroups.IamAccessGroupsV2, error) + MccpAPI() (mccpv2.MccpServiceAPI, error) + ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error) + ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error) + ResourceControllerAPI() (controller.ResourceControllerAPI, error) + ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error) + SoftLayerSession() *slsession.Session + IBMPISession() (*ibmpisession.IBMPISession, error) + UserManagementAPI() (usermanagementv2.UserManagementAPI, error) + PushServiceV1() (*pushservicev1.PushServiceV1, error) + EventNotificationsApiV1() (*eventnotificationsv1.EventNotificationsV1, error) + AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error) + CertificateManagerAPI() (certificatemanager.CertificateManagerServiceAPI, error) + KeyProtectAPI() (*kp.Client, error) + KeyManagementAPI() (*kp.Client, error) + VpcV1API() (*vpc.VpcV1, error) + APIGateway() (*apigateway.ApiGatewayControllerApiV1, error) + PrivateDNSClientSession() (*dns.DnsSvcsV1, error) + CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error) + DirectlinkV1API() (*dl.DirectLinkV1, error) + DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error) + TransitGatewayV1API() (*tg.TransitGatewayApisV1, error) + HpcsEndpointAPI() (hpcs.HPCSV2, error) + FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error) + CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error) + CisAlertsSession() (*cisalertsv1.AlertsV1, error) + CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error) + CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error) + CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error) + CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error) + CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error) + CisIPClientSession() (*cisipv1.CisIpApiV1, error) + CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error) + CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error) + CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error) + CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error) + CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error) + CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error) + CisRoutingClientSession() (*cisroutingv1.RoutingV1, error) + CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error) + CisCacheClientSession() (*ciscachev1.CachingApiV1, error) + CisWebhookSession() (*ciswebhooksv1.WebhooksV1, error) + CisCustomPageClientSession() (*ciscustompagev1.CustomPagesV1, error) + CisAccessRuleClientSession() (*cisaccessrulev1.ZoneFirewallAccessRulesV1, error) + CisUARuleClientSession() (*cisuarulev1.UserAgentBlockingRulesV1, error) + CisLockdownClientSession() (*cislockdownv1.ZoneLockdownV1, error) + CisRangeAppClientSession() (*cisrangeappv1.RangeApplicationsV1, error) + CisWAFRuleClientSession() (*ciswafrulev1.WafRulesApiV1, error) + IAMIdentityV1API() (*iamidentity.IamIdentityV1, error) + IBMCloudShellV1() (*ibmcloudshellv1.IBMCloudShellV1, error) + ResourceManagerV2API() (*resourcemanager.ResourceManagerV2, error) + CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error) + EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error) + ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error) + SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error) + SchematicsV1() (*schematicsv1.SchematicsV1, error) + SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error) + SatellitLinkClientSession() (*satellitelinkv1.SatelliteLinkV1, error) + CisFiltersSession() (*cisfiltersv1.FiltersV1, error) + CisFirewallRulesSession() (*cisfirewallrulesv1.FirewallRulesV1, error) + AtrackerV1() (*atrackerv1.AtrackerV1, error) + ESschemaRegistrySession() (*schemaregistryv1.SchemaregistryV1, error) + FindingsV1() (*findingsv1.FindingsV1, error) + AdminServiceApiV1() (*adminserviceapiv1.AdminServiceApiV1, error) + PostureManagementV1() (*posturemanagementv1.PostureManagementV1, error) + ContextBasedRestrictionsV1() (*contextbasedrestrictionsv1.ContextBasedRestrictionsV1, error) + PostureManagementV2() (*posturemanagementv2.PostureManagementV2, error) +} + +type clientSession struct { + session *Session + + appidErr error + appidAPI *appid.AppIDManagementV4 + + apigatewayErr error + apigatewayAPI *apigateway.ApiGatewayControllerApiV1 + + accountConfigErr error + bmxAccountServiceAPI accountv2.AccountServiceAPI + + accountV1ConfigErr error + bmxAccountv1ServiceAPI accountv1.AccountServiceAPI + + bmxUserDetails *UserConfig + bmxUserFetchErr error + + csConfigErr error + csServiceAPI containerv1.ContainerServiceAPI + + csv2ConfigErr error + csv2ServiceAPI containerv2.ContainerServiceAPI + + containerRegistryClientErr error + containerRegistryClient *containerregistryv1.ContainerRegistryV1 + + certManagementErr error + certManagementAPI certificatemanager.CertificateManagerServiceAPI + + cfConfigErr error + cfServiceAPI mccpv2.MccpServiceAPI + + cisConfigErr error + cisServiceAPI cisv1.CisServiceAPI + + functionConfigErr error + functionClient *whisk.Client + + globalSearchConfigErr error + globalSearchServiceAPI globalsearchv2.GlobalSearchServiceAPI + + globalTaggingConfigErr error + globalTaggingServiceAPI globaltaggingv3.GlobalTaggingServiceAPI + + globalTaggingConfigErrV1 error + globalTaggingServiceAPIV1 globaltaggingv1.GlobalTaggingV1 + + ibmCloudShellClient *ibmcloudshellv1.IBMCloudShellV1 + ibmCloudShellClientErr error + + userManagementErr error + userManagementAPI usermanagementv2.UserManagementAPI + + icdConfigErr error + icdServiceAPI icdv4.ICDServiceAPI + + resourceControllerConfigErr error + resourceControllerServiceAPI controller.ResourceControllerAPI + + resourceControllerConfigErrv2 error + resourceControllerServiceAPIv2 controllerv2.ResourceControllerAPIV2 + + resourceManagementConfigErrv2 error + resourceManagementServiceAPIv2 managementv2.ResourceManagementAPIv2 + + resourceCatalogConfigErr error + resourceCatalogServiceAPI catalog.ResourceCatalogAPI + + ibmpiConfigErr error + ibmpiSession *ibmpisession.IBMPISession + + kpErr error + kpAPI *kp.API + + kmsErr error + kmsAPI *kp.API + + hpcsEndpointErr error + hpcsEndpointAPI hpcs.HPCSV2 + + pDNSClient *dns.DnsSvcsV1 + pDNSErr error + + bluemixSessionErr error + + pushServiceClient *pushservicev1.PushServiceV1 + pushServiceClientErr error + + eventNotificationsApiClient *eventnotificationsv1.EventNotificationsV1 + eventNotificationsApiClientErr error + + appConfigurationClient *appconfigurationv1.AppConfigurationV1 + appConfigurationClientErr error + + vpcErr error + vpcAPI *vpc.VpcV1 + + directlinkAPI *dl.DirectLinkV1 + directlinkErr error + dlProviderAPI *dlProviderV2.DirectLinkProviderV2 + dlProviderErr error + + cosConfigErr error + cosConfigAPI *cosconfig.ResourceConfigurationV1 + + transitgatewayAPI *tg.TransitGatewayApisV1 + transitgatewayErr error + + functionIAMNamespaceAPI functions.FunctionServiceAPI + functionIAMNamespaceErr error + + // CIS Zones + cisZonesErr error + cisZonesV1Client *ciszonesv1.ZonesV1 + + // CIS Alerts + cisAlertsClient *cisalertsv1.AlertsV1 + cisAlertsErr error + + // CIS dns service options + cisDNSErr error + cisDNSRecordsClient *cisdnsrecordsv1.DnsRecordsV1 + + // CIS dns bulk service options + cisDNSBulkErr error + cisDNSRecordBulkClient *cisdnsbulkv1.DnsRecordBulkV1 + + // CIS Global Load Balancer Pool service options + cisGLBPoolErr error + cisGLBPoolClient *cisglbpoolv0.GlobalLoadBalancerPoolsV0 + + // CIS GLB service options + cisGLBErr error + cisGLBClient *cisglbv1.GlobalLoadBalancerV1 + + // CIS GLB health check service options + cisGLBHealthCheckErr error + cisGLBHealthCheckClient *cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1 + + // CIS IP service options + cisIPErr error + cisIPClient *cisipv1.CisIpApiV1 + + // CIS Zone Rate Limits service options + cisRLErr error + cisRLClient *cisratelimitv1.ZoneRateLimitsV1 + + // CIS Page Rules service options + cisPageRuleErr error + cisPageRuleClient *cispagerulev1.PageRuleApiV1 + + // CIS Edge Functions service options + cisEdgeFunctionErr error + cisEdgeFunctionClient *cisedgefunctionv1.EdgeFunctionsApiV1 + + // CIS SSL certificate service options + cisSSLErr error + cisSSLClient *cissslv1.SslCertificateApiV1 + + // CIS WAF Package service options + cisWAFPackageErr error + cisWAFPackageClient *ciswafpackagev1.WafRulePackagesApiV1 + + // CIS Zone Setting service options + cisDomainSettingsErr error + cisDomainSettingsClient *cisdomainsettingsv1.ZonesSettingsV1 + + // CIS Routing service options + cisRoutingErr error + cisRoutingClient *cisroutingv1.RoutingV1 + + // CIS WAF Group service options + cisWAFGroupErr error + cisWAFGroupClient *ciswafgroupv1.WafRuleGroupsApiV1 + + // CIS Caching service options + cisCacheErr error + cisCacheClient *ciscachev1.CachingApiV1 + + // CIS Custom Pages service options + cisCustomPageErr error + cisCustomPageClient *ciscustompagev1.CustomPagesV1 + + // CIS Firewall Access rule service option + cisAccessRuleErr error + cisAccessRuleClient *cisaccessrulev1.ZoneFirewallAccessRulesV1 + + // CIS User Agent Blocking Rule service option + cisUARuleErr error + cisUARuleClient *cisuarulev1.UserAgentBlockingRulesV1 + + // CIS Firewall Lockdwon Rule service option + cisLockdownErr error + cisLockdownClient *cislockdownv1.ZoneLockdownV1 + + // CIS Range app service option + cisRangeAppErr error + cisRangeAppClient *cisrangeappv1.RangeApplicationsV1 + + // CIS WAF rule service options + cisWAFRuleErr error + cisWAFRuleClient *ciswafrulev1.WafRulesApiV1 + //IAM Identity Option + iamIdentityErr error + iamIdentityAPI *iamidentity.IamIdentityV1 + + //Resource Manager Option + resourceManagerErr error + resourceManagerAPI *resourcemanager.ResourceManagerV2 + + //Catalog Management Option + catalogManagementClient *catalogmanagementv1.CatalogManagementV1 + catalogManagementClientErr error + + enterpriseManagementClient *enterprisemanagementv1.EnterpriseManagementV1 + enterpriseManagementClientErr error + + //Resource Controller Option + resourceControllerErr error + resourceControllerAPI *resourcecontroller.ResourceControllerV2 + secretsManagerClient *secretsmanagerv1.SecretsManagerV1 + secretsManagerClientErr error + + // Schematics service options + schematicsClient *schematicsv1.SchematicsV1 + schematicsClientErr error + + //Satellite service + satelliteClient *kubernetesserviceapiv1.KubernetesServiceApiV1 + satelliteClientErr error + + //IAM Policy Management + iamPolicyManagementErr error + iamPolicyManagementAPI *iampolicymanagement.IamPolicyManagementV1 + + //IAM Access Groups + iamAccessGroupsErr error + iamAccessGroupsAPI *iamaccessgroups.IamAccessGroupsV2 + + // CIS Webhooks options + cisWebhooksClient *ciswebhooksv1.WebhooksV1 + cisWebhooksErr error + + // CIS Filters options + cisFiltersClient *cisfiltersv1.FiltersV1 + cisFiltersErr error + + // CIS FirewallRules options + cisFirewallRulesClient *cisfirewallrulesv1.FirewallRulesV1 + cisFirewallRulesErr error + + //Atracker + atrackerClient *atrackerv1.AtrackerV1 + atrackerClientErr error + + //Satellite link service + satelliteLinkClient *satellitelinkv1.SatelliteLinkV1 + satelliteLinkClientErr error + + esSchemaRegistryClient *schemaregistryv1.SchemaregistryV1 + esSchemaRegistryErr error + + // Security and Compliance Center (SCC) + findingsClient *findingsv1.FindingsV1 + findingsClientErr error + + // Security and Compliance Center (SCC) Admin + adminServiceApiClient *adminserviceapiv1.AdminServiceApiV1 + adminServiceApiClientErr error + + //Security and Compliance Center (SCC) Compliance posture + postureManagementClientErr error + postureManagementClient *posturemanagementv1.PostureManagementV1 + + //Security and Compliance Center (SCC) Compliance posture v2 + postureManagementClientv2 *posturemanagementv2.PostureManagementV2 + postureManagementClientErrv2 error + + // context Based Restrictions (CBR) + contextBasedRestrictionsClient *contextbasedrestrictionsv1.ContextBasedRestrictionsV1 + contextBasedRestrictionsClientErr error +} + +// AppIDAPI provides AppID Service APIs ... +func (session clientSession) AppIDAPI() (*appid.AppIDManagementV4, error) { + return session.appidAPI, session.appidErr +} + +func (session clientSession) CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error) { + return session.catalogManagementClient, session.catalogManagementClientErr +} + +// BluemixAcccountAPI ... +func (sess clientSession) BluemixAcccountAPI() (accountv2.AccountServiceAPI, error) { + return sess.bmxAccountServiceAPI, sess.accountConfigErr +} + +// BluemixAcccountAPI ... +func (sess clientSession) BluemixAcccountv1API() (accountv1.AccountServiceAPI, error) { + return sess.bmxAccountv1ServiceAPI, sess.accountV1ConfigErr +} + +// BluemixSession to provide the Bluemix Session +func (sess clientSession) BluemixSession() (*bxsession.Session, error) { + return sess.session.BluemixSession, sess.bluemixSessionErr +} + +// BluemixUserDetails ... +func (sess clientSession) BluemixUserDetails() (*UserConfig, error) { + return sess.bmxUserDetails, sess.bmxUserFetchErr +} + +// ContainerAPI provides Container Service APIs ... +func (sess clientSession) ContainerAPI() (containerv1.ContainerServiceAPI, error) { + return sess.csServiceAPI, sess.csConfigErr +} + +// VpcContainerAPI provides v2Container Service APIs ... +func (sess clientSession) VpcContainerAPI() (containerv2.ContainerServiceAPI, error) { + return sess.csv2ServiceAPI, sess.csv2ConfigErr +} + +// ContainerRegistryV1 provides Container Registry Service APIs ... +func (session clientSession) ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error) { + return session.containerRegistryClient, session.containerRegistryClientErr +} + +// SchematicsAPI provides schematics Service APIs ... +func (sess clientSession) SchematicsV1() (*schematicsv1.SchematicsV1, error) { + return sess.schematicsClient, sess.schematicsClientErr +} + +// FunctionClient ... +func (sess clientSession) FunctionClient() (*whisk.Client, error) { + return sess.functionClient, sess.functionConfigErr +} + +// GlobalSearchAPI provides Global Search APIs ... +func (sess clientSession) GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error) { + return sess.globalSearchServiceAPI, sess.globalSearchConfigErr +} + +// GlobalTaggingAPI provides Global Search APIs ... +func (sess clientSession) GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error) { + return sess.globalTaggingServiceAPI, sess.globalTaggingConfigErr +} + +// GlobalTaggingAPIV1 provides Platform-go Global Tagging APIs ... +func (sess clientSession) GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error) { + return sess.globalTaggingServiceAPIV1, sess.globalTaggingConfigErrV1 +} + +// HpcsEndpointAPI provides Hpcs Endpoint generator APIs ... +func (sess clientSession) HpcsEndpointAPI() (hpcs.HPCSV2, error) { + return sess.hpcsEndpointAPI, sess.hpcsEndpointErr +} + +// UserManagementAPI provides User management APIs ... +func (sess clientSession) UserManagementAPI() (usermanagementv2.UserManagementAPI, error) { + return sess.userManagementAPI, sess.userManagementErr +} + +// IAM Policy Management +func (sess clientSession) IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error) { + return sess.iamPolicyManagementAPI, sess.iamPolicyManagementErr +} + +// IAMAccessGroupsV2 provides IAM AG APIs ... +func (sess clientSession) IAMAccessGroupsV2() (*iamaccessgroups.IamAccessGroupsV2, error) { + return sess.iamAccessGroupsAPI, sess.iamAccessGroupsErr +} + +// IBM Cloud Shell +func (session clientSession) IBMCloudShellV1() (*ibmcloudshellv1.IBMCloudShellV1, error) { + return session.ibmCloudShellClient, session.ibmCloudShellClientErr +} + +// IcdAPI provides IBM Cloud Databases APIs ... +func (sess clientSession) ICDAPI() (icdv4.ICDServiceAPI, error) { + return sess.icdServiceAPI, sess.icdConfigErr +} + +// MccpAPI provides Multi Cloud Controller Proxy APIs ... +func (sess clientSession) MccpAPI() (mccpv2.MccpServiceAPI, error) { + return sess.cfServiceAPI, sess.cfConfigErr +} + +// ResourceCatalogAPI ... +func (sess clientSession) ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error) { + return sess.resourceCatalogServiceAPI, sess.resourceCatalogConfigErr +} + +// ResourceManagementAPIv2 ... +func (sess clientSession) ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error) { + return sess.resourceManagementServiceAPIv2, sess.resourceManagementConfigErrv2 +} + +// ResourceControllerAPI ... +func (sess clientSession) ResourceControllerAPI() (controller.ResourceControllerAPI, error) { + return sess.resourceControllerServiceAPI, sess.resourceControllerConfigErr +} + +// ResourceControllerAPIv2 ... +func (sess clientSession) ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error) { + return sess.resourceControllerServiceAPIv2, sess.resourceControllerConfigErrv2 +} + +// SoftLayerSession providers SoftLayer Session +func (sess clientSession) SoftLayerSession() *slsession.Session { + return sess.session.SoftLayerSession +} + +// CertManagementAPI provides Certificate management APIs ... +func (sess clientSession) CertificateManagerAPI() (certificatemanager.CertificateManagerServiceAPI, error) { + return sess.certManagementAPI, sess.certManagementErr +} + +//apigatewayAPI provides API Gateway APIs +func (sess clientSession) APIGateway() (*apigateway.ApiGatewayControllerApiV1, error) { + return sess.apigatewayAPI, sess.apigatewayErr +} + +func (session clientSession) PushServiceV1() (*pushservicev1.PushServiceV1, error) { + return session.pushServiceClient, session.pushServiceClientErr +} + +func (session clientSession) EventNotificationsApiV1() (*eventnotificationsv1.EventNotificationsV1, error) { + return session.eventNotificationsApiClient, session.eventNotificationsApiClientErr +} + +func (session clientSession) AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error) { + return session.appConfigurationClient, session.appConfigurationClientErr +} + +func (sess clientSession) KeyProtectAPI() (*kp.Client, error) { + return sess.kpAPI, sess.kpErr +} + +func (sess clientSession) KeyManagementAPI() (*kp.Client, error) { + if sess.kmsErr == nil { + var clientConfig *kp.ClientConfig + if sess.kmsAPI.Config.APIKey != "" { + clientConfig = &kp.ClientConfig{ + BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, sess.kmsAPI.Config.BaseURL), + APIKey: sess.kmsAPI.Config.APIKey, //pragma: allowlist secret + Verbose: kp.VerboseFailOnly, + TokenURL: sess.kmsAPI.Config.TokenURL, + } + } else { + clientConfig = &kp.ClientConfig{ + BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, sess.kmsAPI.Config.BaseURL), + Authorization: sess.session.BluemixSession.Config.IAMAccessToken, //pragma: allowlist secret + Verbose: kp.VerboseFailOnly, + TokenURL: sess.kmsAPI.Config.TokenURL, + } + } + + kpClient, err := kp.New(*clientConfig, DefaultTransport()) + if err != nil { + sess.kpErr = fmt.Errorf("[ERROR] Error occured while configuring Key Protect Service: %q", err) + } + return kpClient, nil + } + return sess.kmsAPI, sess.kmsErr +} + +func (sess clientSession) VpcV1API() (*vpc.VpcV1, error) { + return sess.vpcAPI, sess.vpcErr +} + +func (sess clientSession) DirectlinkV1API() (*dl.DirectLinkV1, error) { + return sess.directlinkAPI, sess.directlinkErr +} +func (sess clientSession) DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error) { + return sess.dlProviderAPI, sess.dlProviderErr +} +func (sess clientSession) CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error) { + return sess.cosConfigAPI, sess.cosConfigErr +} + +func (sess clientSession) TransitGatewayV1API() (*tg.TransitGatewayApisV1, error) { + return sess.transitgatewayAPI, sess.transitgatewayErr +} + +// Session to the Power Colo Service + +func (sess clientSession) IBMPISession() (*ibmpisession.IBMPISession, error) { + return sess.ibmpiSession, sess.ibmpiConfigErr +} + +// Private DNS Service + +func (sess clientSession) PrivateDNSClientSession() (*dns.DnsSvcsV1, error) { + return sess.pDNSClient, sess.pDNSErr +} + +// Session to the Namespace cloud function + +func (sess clientSession) FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error) { + return sess.functionIAMNamespaceAPI, sess.functionIAMNamespaceErr +} + +// CIS Zones Service +func (sess clientSession) CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error) { + if sess.cisZonesErr != nil { + return sess.cisZonesV1Client, sess.cisZonesErr + } + return sess.cisZonesV1Client.Clone(), nil +} + +// CIS DNS Service +func (sess clientSession) CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error) { + if sess.cisDNSErr != nil { + return sess.cisDNSRecordsClient, sess.cisDNSErr + } + return sess.cisDNSRecordsClient.Clone(), nil +} + +// CIS DNS Bulk Service +func (sess clientSession) CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error) { + if sess.cisDNSBulkErr != nil { + return sess.cisDNSRecordBulkClient, sess.cisDNSBulkErr + } + return sess.cisDNSRecordBulkClient.Clone(), nil +} + +// CIS GLB Pool +func (sess clientSession) CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error) { + if sess.cisGLBPoolErr != nil { + return sess.cisGLBPoolClient, sess.cisGLBPoolErr + } + return sess.cisGLBPoolClient.Clone(), nil +} + +// CIS GLB +func (sess clientSession) CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error) { + if sess.cisGLBErr != nil { + return sess.cisGLBClient, sess.cisGLBErr + } + return sess.cisGLBClient.Clone(), nil +} + +// CIS GLB Health Check/Monitor +func (sess clientSession) CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error) { + if sess.cisGLBHealthCheckErr != nil { + return sess.cisGLBHealthCheckClient, sess.cisGLBHealthCheckErr + } + return sess.cisGLBHealthCheckClient.Clone(), nil +} + +// CIS Zone Rate Limits +func (sess clientSession) CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error) { + if sess.cisRLErr != nil { + return sess.cisRLClient, sess.cisRLErr + } + return sess.cisRLClient.Clone(), nil +} + +// CIS IP +func (sess clientSession) CisIPClientSession() (*cisipv1.CisIpApiV1, error) { + if sess.cisIPErr != nil { + return sess.cisIPClient, sess.cisIPErr + } + return sess.cisIPClient.Clone(), nil +} + +// CIS Page Rules +func (sess clientSession) CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error) { + if sess.cisPageRuleErr != nil { + return sess.cisPageRuleClient, sess.cisPageRuleErr + } + return sess.cisPageRuleClient.Clone(), nil +} + +// CIS Edge Function +func (sess clientSession) CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error) { + if sess.cisEdgeFunctionErr != nil { + return sess.cisEdgeFunctionClient, sess.cisEdgeFunctionErr + } + return sess.cisEdgeFunctionClient.Clone(), nil +} + +// CIS SSL certificate +func (sess clientSession) CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error) { + if sess.cisSSLErr != nil { + return sess.cisSSLClient, sess.cisSSLErr + } + return sess.cisSSLClient.Clone(), nil +} + +// CIS WAF Packages +func (sess clientSession) CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error) { + if sess.cisWAFPackageErr != nil { + return sess.cisWAFPackageClient, sess.cisWAFPackageErr + } + return sess.cisWAFPackageClient.Clone(), nil +} + +// CIS Zone Settings +func (sess clientSession) CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error) { + if sess.cisDomainSettingsErr != nil { + return sess.cisDomainSettingsClient, sess.cisDomainSettingsErr + } + return sess.cisDomainSettingsClient.Clone(), nil +} + +// CIS Alerts +func (sess clientSession) CisAlertsSession() (*cisalertsv1.AlertsV1, error) { + if sess.cisAlertsErr != nil { + return sess.cisAlertsClient, sess.cisAlertsErr + } + return sess.cisAlertsClient.Clone(), nil +} + +// CIS Routing +func (sess clientSession) CisRoutingClientSession() (*cisroutingv1.RoutingV1, error) { + if sess.cisRoutingErr != nil { + return sess.cisRoutingClient, sess.cisRoutingErr + } + return sess.cisRoutingClient.Clone(), nil +} + +// CIS WAF Group +func (sess clientSession) CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error) { + if sess.cisWAFGroupErr != nil { + return sess.cisWAFGroupClient, sess.cisWAFGroupErr + } + return sess.cisWAFGroupClient.Clone(), nil +} + +// CIS Cache service +func (sess clientSession) CisCacheClientSession() (*ciscachev1.CachingApiV1, error) { + if sess.cisCacheErr != nil { + return sess.cisCacheClient, sess.cisCacheErr + } + return sess.cisCacheClient.Clone(), nil +} + +// CIS Zone Settings +func (sess clientSession) CisCustomPageClientSession() (*ciscustompagev1.CustomPagesV1, error) { + if sess.cisCustomPageErr != nil { + return sess.cisCustomPageClient, sess.cisCustomPageErr + } + return sess.cisCustomPageClient.Clone(), nil +} + +// CIS Firewall access rule +func (sess clientSession) CisAccessRuleClientSession() (*cisaccessrulev1.ZoneFirewallAccessRulesV1, error) { + if sess.cisAccessRuleErr != nil { + return sess.cisAccessRuleClient, sess.cisAccessRuleErr + } + return sess.cisAccessRuleClient.Clone(), nil +} + +// CIS User Agent Blocking rule +func (sess clientSession) CisUARuleClientSession() (*cisuarulev1.UserAgentBlockingRulesV1, error) { + if sess.cisUARuleErr != nil { + return sess.cisUARuleClient, sess.cisUARuleErr + } + return sess.cisUARuleClient.Clone(), nil +} + +// CIS Firewall Lockdown rule +func (sess clientSession) CisLockdownClientSession() (*cislockdownv1.ZoneLockdownV1, error) { + if sess.cisLockdownErr != nil { + return sess.cisLockdownClient, sess.cisLockdownErr + } + return sess.cisLockdownClient.Clone(), nil +} + +// CIS Range app rule +func (sess clientSession) CisRangeAppClientSession() (*cisrangeappv1.RangeApplicationsV1, error) { + if sess.cisRangeAppErr != nil { + return sess.cisRangeAppClient, sess.cisRangeAppErr + } + return sess.cisRangeAppClient.Clone(), nil +} + +// CIS WAF Rule +func (sess clientSession) CisWAFRuleClientSession() (*ciswafrulev1.WafRulesApiV1, error) { + if sess.cisWAFRuleErr != nil { + return sess.cisWAFRuleClient, sess.cisWAFRuleErr + } + return sess.cisWAFRuleClient.Clone(), nil +} + +// IAM Identity Session +func (sess clientSession) IAMIdentityV1API() (*iamidentity.IamIdentityV1, error) { + return sess.iamIdentityAPI, sess.iamIdentityErr +} + +// ResourceMAanger Session +func (sess clientSession) ResourceManagerV2API() (*resourcemanager.ResourceManagerV2, error) { + return sess.resourceManagerAPI, sess.resourceManagerErr +} + +func (session clientSession) EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error) { + return session.enterpriseManagementClient, session.enterpriseManagementClientErr +} + +// ResourceController Session +func (sess clientSession) ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error) { + return sess.resourceControllerAPI, sess.resourceControllerErr +} + +// SecretsManager Session +func (session clientSession) SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error) { + return session.secretsManagerClient, session.secretsManagerClientErr +} + +// Satellite Link +func (session clientSession) SatellitLinkClientSession() (*satellitelinkv1.SatelliteLinkV1, error) { + return session.satelliteLinkClient, session.satelliteLinkClientErr +} + +var cloudEndpoint = "cloud.ibm.com" + +// Session to the Satellite client +func (sess clientSession) SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error) { + return sess.satelliteClient, sess.satelliteClientErr +} + +// CIS Webhooks +func (sess clientSession) CisWebhookSession() (*ciswebhooksv1.WebhooksV1, error) { + if sess.cisWebhooksErr != nil { + return sess.cisWebhooksClient, sess.cisWebhooksErr + } + return sess.cisWebhooksClient.Clone(), nil +} + +// CIS Filters +func (sess clientSession) CisFiltersSession() (*cisfiltersv1.FiltersV1, error) { + if sess.cisFiltersErr != nil { + return sess.cisFiltersClient, sess.cisFiltersErr + } + return sess.cisFiltersClient.Clone(), nil +} + +// CIS FirewallRules +func (sess clientSession) CisFirewallRulesSession() (*cisfirewallrulesv1.FirewallRulesV1, error) { + if sess.cisFirewallRulesErr != nil { + return sess.cisFirewallRulesClient, sess.cisFirewallRulesErr + } + return sess.cisFirewallRulesClient.Clone(), nil +} + +// Activity Tracker API +func (session clientSession) AtrackerV1() (*atrackerv1.AtrackerV1, error) { + return session.atrackerClient, session.atrackerClientErr +} + +func (session clientSession) ESschemaRegistrySession() (*schemaregistryv1.SchemaregistryV1, error) { + return session.esSchemaRegistryClient, session.esSchemaRegistryErr +} + +// Security and Compliance center Findings API +func (session clientSession) FindingsV1() (*findingsv1.FindingsV1, error) { + if session.findingsClientErr != nil { + return session.findingsClient, session.findingsClientErr + } + return session.findingsClient.Clone(), nil +} + +//Security and Compliance center Admin API +func (session clientSession) AdminServiceApiV1() (*adminserviceapiv1.AdminServiceApiV1, error) { + return session.adminServiceApiClient, session.adminServiceApiClientErr +} + +// Security and Compliance center Posture Management +func (session clientSession) PostureManagementV1() (*posturemanagementv1.PostureManagementV1, error) { + if session.postureManagementClientErr != nil { + return session.postureManagementClient, session.postureManagementClientErr + } + return session.postureManagementClient.Clone(), nil +} + +//Security and Compliance center Posture Management v2 +func (session clientSession) PostureManagementV2() (*posturemanagementv2.PostureManagementV2, error) { + if session.postureManagementClientErrv2 != nil { + return session.postureManagementClientv2, session.postureManagementClientErrv2 + } + return session.postureManagementClientv2.Clone(), nil +} + +// Context Based Restrictions +func (session clientSession) ContextBasedRestrictionsV1() (*contextbasedrestrictionsv1.ContextBasedRestrictionsV1, error) { + return session.contextBasedRestrictionsClient, session.contextBasedRestrictionsClientErr +} + +// ClientSession configures and returns a fully initialized ClientSession +func (c *Config) ClientSession() (interface{}, error) { + sess, err := newSession(c) + if err != nil { + return nil, err + } + log.Printf("[INFO] Configured Region: %s\n", c.Region) + session := clientSession{ + session: sess, + } + + if sess.BluemixSession == nil { + //Can be nil only if bluemix_api_key is not provided + log.Println("Skipping Bluemix Clients configuration") + session.bluemixSessionErr = errEmptyBluemixCredentials + session.accountConfigErr = errEmptyBluemixCredentials + session.accountV1ConfigErr = errEmptyBluemixCredentials + session.csConfigErr = errEmptyBluemixCredentials + session.csv2ConfigErr = errEmptyBluemixCredentials + session.containerRegistryClientErr = errEmptyBluemixCredentials + session.kpErr = errEmptyBluemixCredentials + session.pushServiceClientErr = errEmptyBluemixCredentials + session.appConfigurationClientErr = errEmptyBluemixCredentials + session.kmsErr = errEmptyBluemixCredentials + session.cfConfigErr = errEmptyBluemixCredentials + session.cisConfigErr = errEmptyBluemixCredentials + session.functionConfigErr = errEmptyBluemixCredentials + session.globalSearchConfigErr = errEmptyBluemixCredentials + session.globalTaggingConfigErr = errEmptyBluemixCredentials + session.globalTaggingConfigErrV1 = errEmptyBluemixCredentials + session.hpcsEndpointErr = errEmptyBluemixCredentials + session.iamAccessGroupsErr = errEmptyBluemixCredentials + session.icdConfigErr = errEmptyBluemixCredentials + session.resourceCatalogConfigErr = errEmptyBluemixCredentials + session.resourceManagerErr = errEmptyBluemixCredentials + session.resourceManagementConfigErrv2 = errEmptyBluemixCredentials + session.resourceControllerConfigErr = errEmptyBluemixCredentials + session.resourceControllerConfigErrv2 = errEmptyBluemixCredentials + session.enterpriseManagementClientErr = errEmptyBluemixCredentials + session.resourceControllerErr = errEmptyBluemixCredentials + session.catalogManagementClientErr = errEmptyBluemixCredentials + session.ibmpiConfigErr = errEmptyBluemixCredentials + session.userManagementErr = errEmptyBluemixCredentials + session.certManagementErr = errEmptyBluemixCredentials + session.vpcErr = errEmptyBluemixCredentials + session.apigatewayErr = errEmptyBluemixCredentials + session.pDNSErr = errEmptyBluemixCredentials + session.bmxUserFetchErr = errEmptyBluemixCredentials + session.directlinkErr = errEmptyBluemixCredentials + session.dlProviderErr = errEmptyBluemixCredentials + session.cosConfigErr = errEmptyBluemixCredentials + session.transitgatewayErr = errEmptyBluemixCredentials + session.functionIAMNamespaceErr = errEmptyBluemixCredentials + session.cisDNSErr = errEmptyBluemixCredentials + session.cisAlertsErr = errEmptyBluemixCredentials + session.cisDNSBulkErr = errEmptyBluemixCredentials + session.cisGLBPoolErr = errEmptyBluemixCredentials + session.cisGLBErr = errEmptyBluemixCredentials + session.cisGLBHealthCheckErr = errEmptyBluemixCredentials + session.cisIPErr = errEmptyBluemixCredentials + session.cisZonesErr = errEmptyBluemixCredentials + session.cisRLErr = errEmptyBluemixCredentials + session.cisPageRuleErr = errEmptyBluemixCredentials + session.cisEdgeFunctionErr = errEmptyBluemixCredentials + session.cisSSLErr = errEmptyBluemixCredentials + session.cisWAFPackageErr = errEmptyBluemixCredentials + session.cisDomainSettingsErr = errEmptyBluemixCredentials + session.cisRoutingErr = errEmptyBluemixCredentials + session.cisWAFGroupErr = errEmptyBluemixCredentials + session.cisCacheErr = errEmptyBluemixCredentials + session.cisCustomPageErr = errEmptyBluemixCredentials + session.cisAccessRuleErr = errEmptyBluemixCredentials + session.cisUARuleErr = errEmptyBluemixCredentials + session.cisLockdownErr = errEmptyBluemixCredentials + session.cisRangeAppErr = errEmptyBluemixCredentials + session.cisWAFRuleErr = errEmptyBluemixCredentials + session.iamIdentityErr = errEmptyBluemixCredentials + session.secretsManagerClientErr = errEmptyBluemixCredentials + session.cisFiltersErr = errEmptyBluemixCredentials + session.cisWebhooksErr = errEmptyBluemixCredentials + session.schematicsClientErr = errEmptyBluemixCredentials + session.satelliteClientErr = errEmptyBluemixCredentials + session.iamPolicyManagementErr = errEmptyBluemixCredentials + session.satelliteLinkClientErr = errEmptyBluemixCredentials + session.esSchemaRegistryErr = errEmptyBluemixCredentials + session.contextBasedRestrictionsClientErr = errEmptyBluemixCredentials + session.postureManagementClientErr = errEmptyBluemixCredentials + session.postureManagementClientErrv2 = errEmptyBluemixCredentials + + return session, nil + } + + if sess.BluemixSession.Config.BluemixAPIKey != "" { + err = authenticateAPIKey(sess.BluemixSession) + if err != nil { + for count := c.RetryCount; count >= 0; count-- { + if err == nil || !isRetryable(err) { + break + } + time.Sleep(c.RetryDelay) + log.Printf("Retrying IAM Authentication %d", count) + err = authenticateAPIKey(sess.BluemixSession) + } + if err != nil { + session.bmxUserFetchErr = fmt.Errorf("[ERROR] Error occured while fetching auth key for account user details: %q", err) + session.functionConfigErr = fmt.Errorf("[ERROR] Error occured while fetching auth key for function: %q", err) + } + } + err = authenticateCF(sess.BluemixSession) + if err != nil { + for count := c.RetryCount; count >= 0; count-- { + if err == nil || !isRetryable(err) { + break + } + time.Sleep(c.RetryDelay) + log.Printf("Retrying CF Authentication %d", count) + err = authenticateCF(sess.BluemixSession) + } + if err != nil { + session.functionConfigErr = fmt.Errorf("[ERROR] Error occured while fetching auth key for function: %q", err) + } + } + } + + if c.IAMTrustedProfileID == "" && sess.BluemixSession.Config.IAMAccessToken != "" && sess.BluemixSession.Config.BluemixAPIKey == "" { + err := RefreshToken(sess.BluemixSession) + if err != nil { + for count := c.RetryCount; count >= 0; count-- { + if err == nil || !isRetryable(err) { + break + } + time.Sleep(c.RetryDelay) + log.Printf("Retrying refresh token %d", count) + err = RefreshToken(sess.BluemixSession) + } + if err != nil { + return nil, fmt.Errorf("[ERROR] Error occured while refreshing the token: %q", err) + } + } + + } + userConfig, err := fetchUserDetails(sess.BluemixSession, c.RetryCount, c.RetryDelay) + if err != nil { + session.bmxUserFetchErr = fmt.Errorf("[ERROR] Error occured while fetching account user details: %q", err) + } + session.bmxUserDetails = userConfig + + if sess.SoftLayerSession != nil && sess.SoftLayerSession.IAMToken != "" { + sess.SoftLayerSession.IAMToken = sess.BluemixSession.Config.IAMAccessToken + sess.SoftLayerSession.IAMRefreshToken = sess.BluemixSession.Config.IAMRefreshToken + } + + session.functionClient, session.functionConfigErr = FunctionClient(sess.BluemixSession.Config) + + BluemixRegion = sess.BluemixSession.Config.Region + var fileMap map[string]interface{} + if f := EnvFallBack([]string{"IBMCLOUD_ENDPOINTS_FILE_PATH", "IC_ENDPOINTS_FILE_PATH"}, c.EndpointsFile); f != "" { + jsonFile, err := os.Open(f) + if err != nil { + log.Fatalf("Unable to open Endpoints File %s", err) + } + defer jsonFile.Close() + bytes, err := ioutil.ReadAll(jsonFile) + if err != nil { + log.Fatalf("Unable to read Endpoints File %s", err) + } + err = json.Unmarshal([]byte(bytes), &fileMap) + if err != nil { + log.Fatalf("Unable to unmarshal Endpoints File %s", err) + } + } + accv1API, err := accountv1.New(sess.BluemixSession) + if err != nil { + session.accountV1ConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Bluemix Accountv1 Service: %q", err) + } + session.bmxAccountv1ServiceAPI = accv1API + + accAPI, err := accountv2.New(sess.BluemixSession) + if err != nil { + session.accountConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Account Service: %q", err) + } + session.bmxAccountServiceAPI = accAPI + + cfAPI, err := mccpv2.New(sess.BluemixSession) + if err != nil { + session.cfConfigErr = fmt.Errorf("[ERROR] Error occured while configuring MCCP service: %q", err) + } + session.cfServiceAPI = cfAPI + + clusterAPI, err := containerv1.New(sess.BluemixSession) + if err != nil { + session.csConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Container Service for K8s cluster: %q", err) + } + session.csServiceAPI = clusterAPI + + v2clusterAPI, err := containerv2.New(sess.BluemixSession) + if err != nil { + session.csv2ConfigErr = fmt.Errorf("[ERROR] Error occured while configuring vpc Container Service for K8s cluster: %q", err) + } + session.csv2ServiceAPI = v2clusterAPI + + hpcsAPI, err := hpcs.New(sess.BluemixSession) + if err != nil { + session.hpcsEndpointErr = fmt.Errorf("[ERROR] Error occured while configuring hpcs Endpoint: %q", err) + } + session.hpcsEndpointAPI = hpcsAPI + + kpurl := ContructEndpoint(fmt.Sprintf("%s.kms", c.Region), cloudEndpoint) + if c.Visibility == "private" || c.Visibility == "public-and-private" { + kpurl = ContructEndpoint(fmt.Sprintf("private.%s.kms", c.Region), cloudEndpoint) + } + if fileMap != nil && c.Visibility != "public-and-private" { + kpurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_KP_API_ENDPOINT", c.Region, kpurl) + } + var options kp.ClientConfig + if c.BluemixAPIKey != "" { + options = kp.ClientConfig{ + BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), + APIKey: sess.BluemixSession.Config.BluemixAPIKey, //pragma: allowlist secret + // InstanceID: "42fET57nnadurKXzXAedFLOhGqETfIGYxOmQXkFgkJV9", + Verbose: kp.VerboseFailOnly, + } + + } else { + options = kp.ClientConfig{ + BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kpurl), + Authorization: sess.BluemixSession.Config.IAMAccessToken, + // InstanceID: "42fET57nnadurKXzXAedFLOhGqETfIGYxOmQXkFgkJV9", + Verbose: kp.VerboseFailOnly, + } + } + kpAPIclient, err := kp.New(options, DefaultTransport()) + if err != nil { + session.kpErr = fmt.Errorf("[ERROR] Error occured while configuring Key Protect Service: %q", err) + } + session.kpAPI = kpAPIclient + + iamURL := iamidentity.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + iamURL = ContructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) + } else { + iamURL = ContructEndpoint("private.iam", cloudEndpoint) + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + iamURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamURL) + } + + // KEY MANAGEMENT Service + kmsurl := ContructEndpoint(fmt.Sprintf("%s.kms", c.Region), cloudEndpoint) + if c.Visibility == "private" || c.Visibility == "public-and-private" { + kmsurl = ContructEndpoint(fmt.Sprintf("private.%s.kms", c.Region), cloudEndpoint) + } + if fileMap != nil && c.Visibility != "public-and-private" { + kmsurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_KP_API_ENDPOINT", c.Region, kmsurl) + } + var kmsOptions kp.ClientConfig + if c.BluemixAPIKey != "" { + kmsOptions = kp.ClientConfig{ + BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kmsurl), + APIKey: sess.BluemixSession.Config.BluemixAPIKey, //pragma: allowlist secret + // InstanceID: "5af62d5d-5d90-4b84-bbcd-90d2123ae6c8", + Verbose: kp.VerboseFailOnly, + TokenURL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", + } + + } else { + kmsOptions = kp.ClientConfig{ + BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, kmsurl), + Authorization: sess.BluemixSession.Config.IAMAccessToken, + // InstanceID: "5af62d5d-5d90-4b84-bbcd-90d2123ae6c8", + Verbose: kp.VerboseFailOnly, + TokenURL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", + } + } + kmsAPIclient, err := kp.New(kmsOptions, DefaultTransport()) + if err != nil { + session.kmsErr = fmt.Errorf("[ERROR] Error occured while configuring key Service: %q", err) + } + session.kmsAPI = kmsAPIclient + + var authenticator core.Authenticator + + if c.BluemixAPIKey != "" || sess.BluemixSession.Config.IAMRefreshToken != "" { + if c.BluemixAPIKey != "" { + authenticator = &core.IamAuthenticator{ + ApiKey: c.BluemixAPIKey, + URL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL), + } + } else { + // Construct the IamAuthenticator with the IAM refresh token. + authenticator = &core.IamAuthenticator{ + RefreshToken: sess.BluemixSession.Config.IAMRefreshToken, + ClientId: "bx", + ClientSecret: "bx", + URL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL), + } + } + } else if strings.HasPrefix(sess.BluemixSession.Config.IAMAccessToken, "Bearer") { + authenticator = &core.BearerTokenAuthenticator{ + BearerToken: sess.BluemixSession.Config.IAMAccessToken[7:], + } + } else { + authenticator = &core.BearerTokenAuthenticator{ + BearerToken: sess.BluemixSession.Config.IAMAccessToken, + } + } + + // APPID Service + appIDEndpoint := fmt.Sprintf("https://%s.appid.cloud.ibm.com", c.Region) + if c.Visibility == "private" { + session.appidErr = fmt.Errorf("App Id resources doesnot support private endpoints") + } + if fileMap != nil && c.Visibility != "public-and-private" { + appIDEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_APPID_MANAGEMENT_API_ENDPOINT", c.Region, appIDEndpoint) + } + appIDClientOptions := &appid.AppIDManagementV4Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_APPID_MANAGEMENT_API_ENDPOINT"}, appIDEndpoint), + } + appIDClient, err := appid.NewAppIDManagementV4(appIDClientOptions) + if err != nil { + session.appidErr = fmt.Errorf("error occured while configuring AppID service: #{err}") + } + if appIDClient != nil && appIDClient.Service != nil { + appIDClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + appIDClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.appidAPI = appIDClient + + // Construct an "options" struct for creating Context Based Restrictions service client. + cbrURL := contextbasedrestrictionsv1.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + session.contextBasedRestrictionsClientErr = fmt.Errorf("Context Based Restrictions Service API does not support private endpoints") //return this error if private endpoints are not supported + } + if fileMap != nil && c.Visibility != "public-and-private" { + cbrURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CONTEXT_BASED_RESTRICTIONS_ENDPOINT", c.Region, cbrURL) + } + contextBasedRestrictionsClientOptions := &contextbasedrestrictionsv1.Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_CONTEXT_BASED_RESTRICTIONS_ENDPOINT"}, cbrURL), + } + + // Construct the service client. + session.contextBasedRestrictionsClient, err = contextbasedrestrictionsv1.NewContextBasedRestrictionsV1(contextBasedRestrictionsClientOptions) + if err == nil && session.contextBasedRestrictionsClient != nil { + // Enable retries for API calls + session.contextBasedRestrictionsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.contextBasedRestrictionsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } else { + session.contextBasedRestrictionsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Context Based Restrictions service: %q", err) + } + + // CATALOG MANAGEMENT Service + catalogManagementURL := "https://cm.globalcatalog.cloud.ibm.com/api/v1-beta" + if c.Visibility == "private" { + session.catalogManagementClientErr = fmt.Errorf("Catalog Management resource doesnot support private endpoints") + } + if fileMap != nil && c.Visibility != "public-and-private" { + catalogManagementURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CATALOG_MANAGEMENT_API_ENDPOINT", c.Region, catalogManagementURL) + } + catalogManagementClientOptions := &catalogmanagementv1.CatalogManagementV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_CATALOG_MANAGEMENT_API_ENDPOINT"}, catalogManagementURL), + Authenticator: authenticator, + } + // Construct the service client. + session.catalogManagementClient, err = catalogmanagementv1.NewCatalogManagementV1(catalogManagementClientOptions) + if err != nil { + session.catalogManagementClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Catalog Management API service: %q", err) + } + if session.catalogManagementClient != nil && session.catalogManagementClient.Service != nil { + // Enable retries for API calls + session.catalogManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.catalogManagementClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // ATRACKER Service + var atrackerClientURL string + atrackerClientURL, err = atrackerv1.GetServiceURLForRegion(c.Region) + if err != nil { + session.atrackerClientErr = err + } + if c.Visibility == "private" || c.Visibility == "public-and-private" { + atrackerClientURL, err = atrackerv1.GetServiceURLForRegion("private." + c.Region) + if err != nil && c.Visibility == "public-and-private" { + atrackerClientURL, err = atrackerv1.GetServiceURLForRegion(c.Region) + if err != nil { + session.atrackerClientErr = err + } + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + atrackerClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_ATRACKER_API_ENDPOINT", c.Region, atrackerClientURL) + } + atrackerClientOptions := &atrackerv1.AtrackerV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_ATRACKER_API_ENDPOINT"}, atrackerClientURL), + } + // Construct the service client. + session.atrackerClient, err = atrackerv1.NewAtrackerV1(atrackerClientOptions) + if err != nil { + session.atrackerClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Activity Tracker API service: %q", err) + } + if session.atrackerClient != nil && session.atrackerClient.Service != nil { + // Enable retries for API calls + session.atrackerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.atrackerClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // SCC FINDINGS Service + var findingsClientURL string + if c.Visibility == "public" || c.Visibility == "public-and-private" { + findingsClientURL, err = findingsv1.GetServiceURLForRegion(c.Region) + if err != nil { + session.findingsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Security Insights Findings API service: `%s` region not supported", c.Region) + } + } else { + session.findingsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Security Insights Findings API service: `%v` visibility not supported", c.Visibility) + } + if fileMap != nil && c.Visibility != "public-and-private" { + findingsClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SCC_FINDINGS_API_ENDPOINT", c.Region, findingsClientURL) + } + findingsClientOptions := &findingsv1.FindingsV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_SCC_FINDINGS_API_ENDPOINT"}, findingsClientURL), + AccountID: core.StringPtr(userConfig.UserAccount), + } + // Construct the service client. + session.findingsClient, err = findingsv1.NewFindingsV1(findingsClientOptions) + if err != nil { + session.findingsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Security Insights Findings API service: %q", err) + } + if session.findingsClient != nil && session.findingsClient.Service != nil { + // Enable retries for API calls + session.findingsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.findingsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // SCC ADMIN Service + var adminServiceApiClientURL string + if c.Visibility == "private" || c.Visibility == "public-and-private" { + adminServiceApiClientURL, err = adminserviceapiv1.GetServiceURLForRegion("private." + c.Region) + if err != nil && c.Visibility == "public-and-private" { + adminServiceApiClientURL, err = adminserviceapiv1.GetServiceURLForRegion(c.Region) + } + } else { + adminServiceApiClientURL, err = adminserviceapiv1.GetServiceURLForRegion(c.Region) + } + if err != nil { + adminServiceApiClientURL = adminserviceapiv1.DefaultServiceURL + } + adminServiceApiClientOptions := &adminserviceapiv1.AdminServiceApiV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_SCC_ADMIN_API_ENDPOINT"}, adminServiceApiClientURL), + } + + // Construct the service client. + session.adminServiceApiClient, err = adminserviceapiv1.NewAdminServiceApiV1(adminServiceApiClientOptions) + if err == nil { + // Enable retries for API calls + session.adminServiceApiClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.adminServiceApiClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } else { + session.adminServiceApiClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Admin Service API service: %q", err) + } + + // SCHEMATICS Service + schematicsEndpoint := "https://schematics.cloud.ibm.com" + if c.Visibility == "private" || c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + schematicsEndpoint = ContructEndpoint("private-us.schematics", cloudEndpoint) + } else if c.Region == "eu-gb" || c.Region == "eu-de" { + schematicsEndpoint = ContructEndpoint("private-eu.schematics", cloudEndpoint) + } else { + schematicsEndpoint = "https://schematics.cloud.ibm.com" + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + schematicsEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SCHEMATICS_API_ENDPOINT", c.Region, schematicsEndpoint) + } + schematicsClientOptions := &schematicsv1.SchematicsV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_SCHEMATICS_API_ENDPOINT"}, schematicsEndpoint), + } + // Construct the service client. + schematicsClient, err := schematicsv1.NewSchematicsV1(schematicsClientOptions) + if err != nil { + session.schematicsClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Schematics Service API service: %q", err) + } + // Enable retries for API calls + if schematicsClient != nil && schematicsClient.Service != nil { + schematicsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + schematicsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.schematicsClient = schematicsClient + + // VPC Service + vpcurl := ContructEndpoint(fmt.Sprintf("%s.iaas", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) + if c.Visibility == "private" || c.Visibility == "public-and-private" { + vpcurl = ContructEndpoint(fmt.Sprintf("%s.private.iaas", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + vpcurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IS_NG_API_ENDPOINT", c.Region, vpcurl) + } + vpcoptions := &vpc.VpcV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_IS_NG_API_ENDPOINT"}, vpcurl), + Authenticator: authenticator, + } + vpcclient, err := vpc.NewVpcV1(vpcoptions) + if err != nil { + session.vpcErr = fmt.Errorf("[ERROR] Error occured while configuring vpc service: %q", err) + } + if vpcclient != nil && vpcclient.Service != nil { + vpcclient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + vpcclient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.vpcAPI = vpcclient + + // PUSH NOTIFICATIONS Service + pnurl := fmt.Sprintf("https://%s.imfpush.cloud.ibm.com/imfpush/v1", c.Region) + if c.Visibility == "private" { + session.pushServiceClientErr = fmt.Errorf("Push Notifications Service API doesnot support private endpoints") + } + if fileMap != nil && c.Visibility != "public-and-private" { + pnurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_PUSH_API_ENDPOINT", c.Region, pnurl) + } + pushNotificationOptions := &pushservicev1.PushServiceV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_PUSH_API_ENDPOINT"}, pnurl), + Authenticator: authenticator, + } + pnclient, err := pushservicev1.NewPushServiceV1(pushNotificationOptions) + if err != nil { + session.pushServiceClientErr = fmt.Errorf("[ERROR] Error occured while configuring Push Notifications service: %q", err) + } + if pnclient != nil && pnclient.Service != nil { + // Enable retries for API calls + pnclient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + pnclient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.pushServiceClient = pnclient + // event notifications + enurl := fmt.Sprintf("https://%s.event-notifications.cloud.ibm.com/event-notifications", c.Region) + if c.Visibility == "private" { + session.eventNotificationsApiClientErr = fmt.Errorf("Event Notifications Service does not support private endpoints") + } + if fileMap != nil && c.Visibility != "public-and-private" { + enurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_EVENT_NOTIFICATIONS_API_ENDPOINT", c.Region, enurl) + } + enClientOptions := &eventnotificationsv1.EventNotificationsV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_EVENT_NOTIFICATIONS_API_ENDPOINT"}, enurl), + } + // Construct the service client. + session.eventNotificationsApiClient, err = eventnotificationsv1.NewEventNotificationsV1(enClientOptions) + if err != nil { + // Enable { + session.eventNotificationsApiClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Event Notifications service: %q", err) + } + if session.eventNotificationsApiClient != nil && session.eventNotificationsApiClient.Service != nil { + // Enable retries for API calls + session.eventNotificationsApiClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.eventNotificationsApiClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // APP CONFIGURATION Service + if c.Visibility == "private" { + session.appConfigurationClientErr = fmt.Errorf("[ERROR] App Configuration Service API doesnot support private endpoints") + } + appConfigurationClientOptions := &appconfigurationv1.AppConfigurationV1Options{ + Authenticator: authenticator, + } + appConfigClient, err := appconfigurationv1.NewAppConfigurationV1(appConfigurationClientOptions) + if appConfigClient != nil { + // Enable retries for API calls + appConfigClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.appConfigurationClient = appConfigClient + } else { + session.appConfigurationClientErr = fmt.Errorf("[ERROR] Error occurred while configuring App Configuration service: %q", err) + } + + // CONTAINER REGISTRY Service + // Construct an "options" struct for creating the service client. + containerRegistryClientURL, err := containerregistryv1.GetServiceURLForRegion(c.Region) + if err != nil { + containerRegistryClientURL = containerregistryv1.DefaultServiceURL + } + if c.Visibility == "private" || c.Visibility == "public-and-private" { + containerRegistryClientURL, err = GetPrivateServiceURLForRegion(c.Region) + if err != nil { + containerRegistryClientURL, _ = GetPrivateServiceURLForRegion("global") + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + containerRegistryClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CR_API_ENDPOINT", c.Region, containerRegistryClientURL) + } + containerRegistryClientOptions := &containerregistryv1.ContainerRegistryV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_CR_API_ENDPOINT"}, containerRegistryClientURL), + Account: core.StringPtr(userConfig.UserAccount), + } + // Construct the service client. + session.containerRegistryClient, err = containerregistryv1.NewContainerRegistryV1(containerRegistryClientOptions) + if err != nil { + session.containerRegistryClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Container Registry API service: %q", err) + } + if session.containerRegistryClient != nil && session.containerRegistryClient.Service != nil { + // Enable retries for API calls + session.containerRegistryClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.containerRegistryClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // OBJECT STORAGE Service + cosconfigurl := "https://config.cloud-object-storage.cloud.ibm.com/v1" + if fileMap != nil && c.Visibility != "public-and-private" { + cosconfigurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_COS_CONFIG_ENDPOINT", c.Region, cosconfigurl) + } + cosconfigoptions := &cosconfig.ResourceConfigurationV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_COS_CONFIG_ENDPOINT"}, cosconfigurl), + } + cosconfigclient, err := cosconfig.NewResourceConfigurationV1(cosconfigoptions) + if err != nil { + session.cosConfigErr = fmt.Errorf("[ERROR] Error occured while configuring COS config service: %q", err) + } + session.cosConfigAPI = cosconfigclient + + globalSearchAPI, err := globalsearchv2.New(sess.BluemixSession) + if err != nil { + session.globalSearchConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Global Search: %q", err) + } + session.globalSearchServiceAPI = globalSearchAPI + // Global Tagging Bluemix-go + globalTaggingAPI, err := globaltaggingv3.New(sess.BluemixSession) + if err != nil { + session.globalTaggingConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Global Tagging: %q", err) + } + session.globalTaggingServiceAPI = globalTaggingAPI + + // GLOBAL TAGGING Service + globalTaggingEndpoint := "https://tags.global-search-tagging.cloud.ibm.com" + if c.Visibility == "private" || c.Visibility == "public-and-private" { + var globalTaggingRegion string + if c.Region != "us-south" && c.Region != "us-east" { + globalTaggingRegion = "us-south" + } else { + globalTaggingRegion = c.Region + } + globalTaggingEndpoint = ContructEndpoint(fmt.Sprintf("tags.private.%s", globalTaggingRegion), fmt.Sprintf("global-search-tagging.%s", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + globalTaggingEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_GT_API_ENDPOINT", c.Region, globalTaggingEndpoint) + } + globalTaggingV1Options := &globaltaggingv1.GlobalTaggingV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_GT_API_ENDPOINT"}, globalTaggingEndpoint), + Authenticator: authenticator, + } + globalTaggingAPIV1, err := globaltaggingv1.NewGlobalTaggingV1(globalTaggingV1Options) + if err != nil { + session.globalTaggingConfigErrV1 = fmt.Errorf("[ERROR] Error occured while configuring Global Tagging: %q", err) + } + if globalTaggingAPIV1 != nil && globalTaggingAPIV1.Service != nil { + session.globalTaggingServiceAPIV1 = *globalTaggingAPIV1 + session.globalTaggingServiceAPIV1.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.globalTaggingServiceAPIV1.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + icdAPI, err := icdv4.New(sess.BluemixSession) + if err != nil { + session.icdConfigErr = fmt.Errorf("[ERROR] Error occured while configuring IBM Cloud Database Services: %q", err) + } + session.icdServiceAPI = icdAPI + + resourceCatalogAPI, err := catalog.New(sess.BluemixSession) + if err != nil { + session.resourceCatalogConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Resource Catalog service: %q", err) + } + session.resourceCatalogServiceAPI = resourceCatalogAPI + + resourceManagementAPIv2, err := managementv2.New(sess.BluemixSession) + if err != nil { + session.resourceManagementConfigErrv2 = fmt.Errorf("[ERROR] Error occured while configuring Resource Management service: %q", err) + } + session.resourceManagementServiceAPIv2 = resourceManagementAPIv2 + + resourceControllerAPI, err := controller.New(sess.BluemixSession) + if err != nil { + session.resourceControllerConfigErr = fmt.Errorf("[ERROR] Error occured while configuring Resource Controller service: %q", err) + } + session.resourceControllerServiceAPI = resourceControllerAPI + + ResourceControllerAPIv2, err := controllerv2.New(sess.BluemixSession) + if err != nil { + session.resourceControllerConfigErrv2 = fmt.Errorf("[ERROR] Error occured while configuring Resource Controller v2 service: %q", err) + } + session.resourceControllerServiceAPIv2 = ResourceControllerAPIv2 + + userManagementAPI, err := usermanagementv2.New(sess.BluemixSession) + if err != nil { + session.userManagementErr = fmt.Errorf("[ERROR] Error occured while configuring user management service: %q", err) + } + session.userManagementAPI = userManagementAPI + + certManagementAPI, err := certificatemanager.New(sess.BluemixSession) + if err != nil { + session.certManagementErr = fmt.Errorf("[ERROR] Error occured while configuring Certificate manager service: %q", err) + } + session.certManagementAPI = certManagementAPI + + namespaceFunction, err := functions.New(sess.BluemixSession) + if err != nil { + session.functionIAMNamespaceErr = fmt.Errorf("[ERROR] Error occured while configuring Cloud Funciton Service : %q", err) + } + session.functionIAMNamespaceAPI = namespaceFunction + + // API GATEWAY service + apicurl := ContructEndpoint(fmt.Sprintf("api.%s.apigw", c.Region), fmt.Sprintf("%s/controller", cloudEndpoint)) + if c.Visibility == "private" || c.Visibility == "public-and-private" { + apicurl = ContructEndpoint(fmt.Sprintf("api.private.%s.apigw", c.Region), fmt.Sprintf("%s/controller", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + apicurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_API_GATEWAY_ENDPOINT", c.Region, apicurl) + } + APIGatewayControllerAPIV1Options := &apigateway.ApiGatewayControllerApiV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_API_GATEWAY_ENDPOINT"}, apicurl), + Authenticator: &core.NoAuthAuthenticator{}, + } + apigatewayAPI, err := apigateway.NewApiGatewayControllerApiV1(APIGatewayControllerAPIV1Options) + if err != nil { + session.apigatewayErr = fmt.Errorf("[ERROR] Error occured while configuring APIGateway service: %q", err) + } + session.apigatewayAPI = apigatewayAPI + + // POWER SYSTEMS Service + piURL := ContructEndpoint(c.Region, "power-iaas.cloud.ibm.com") + ibmPIOptions := &ibmpisession.IBMPIOptions{ + Authenticator: authenticator, + Debug: os.Getenv("TF_LOG") != "", + Region: c.Region, + URL: EnvFallBack([]string{"IBMCLOUD_PI_API_ENDPOINT"}, piURL), + UserAccount: userConfig.UserAccount, + Zone: c.Zone, + } + ibmpisession, err := ibmpisession.NewIBMPISession(ibmPIOptions) + if err != nil { + session.ibmpiConfigErr = fmt.Errorf("Error occured while configuring ibmpisession: %q", err) + } + session.ibmpiSession = ibmpisession + + // PRIVATE DNS Service + pdnsURL := dns.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + pdnsURL = ContructEndpoint("api.private.dns-svcs", fmt.Sprintf("%s/v1", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + pdnsURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_PRIVATE_DNS_API_ENDPOINT", c.Region, pdnsURL) + } + dnsOptions := &dns.DnsSvcsV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_PRIVATE_DNS_API_ENDPOINT"}, pdnsURL), + Authenticator: authenticator, + } + session.pDNSClient, session.pDNSErr = dns.NewDnsSvcsV1(dnsOptions) + if session.pDNSErr != nil { + session.pDNSErr = fmt.Errorf("[ERROR] Error occured while configuring PrivateDNS Service: %s", session.pDNSErr) + } + if session.pDNSClient != nil && session.pDNSClient.Service != nil { + session.pDNSClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.pDNSClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // DIRECT LINK Service + ver := time.Now().Format("2006-01-02") + dlURL := dl.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + dlURL = ContructEndpoint("private.directlink", fmt.Sprintf("%s/v1", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + dlURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_DL_API_ENDPOINT", c.Region, dlURL) + } + directlinkOptions := &dl.DirectLinkV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_DL_API_ENDPOINT"}, dlURL), + Authenticator: authenticator, + Version: &ver, + } + session.directlinkAPI, session.directlinkErr = dl.NewDirectLinkV1(directlinkOptions) + if session.directlinkErr != nil { + session.directlinkErr = fmt.Errorf("[ERROR] Error occured while configuring Direct Link Service: %s", session.directlinkErr) + } + if session.directlinkAPI != nil && session.directlinkAPI.Service != nil { + session.directlinkAPI.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.directlinkAPI.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // DIRECT LINK PROVIDER Service + dlproviderURL := dlProviderV2.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + dlproviderURL = ContructEndpoint("private.directlink", fmt.Sprintf("%s/provider/v2", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + dlproviderURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_DL_PROVIDER_API_ENDPOINT", c.Region, dlproviderURL) + } + directLinkProviderV2Options := &dlProviderV2.DirectLinkProviderV2Options{ + URL: EnvFallBack([]string{"IBMCLOUD_DL_PROVIDER_API_ENDPOINT"}, dlproviderURL), + Authenticator: authenticator, + Version: &ver, + } + session.dlProviderAPI, session.dlProviderErr = dlProviderV2.NewDirectLinkProviderV2(directLinkProviderV2Options) + if session.dlProviderErr != nil { + session.dlProviderErr = fmt.Errorf("[ERROR] Error occured while configuring Direct Link Provider Service: %s", session.dlProviderErr) + } + if session.dlProviderAPI != nil && session.dlProviderAPI.Service != nil { + session.dlProviderAPI.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.dlProviderAPI.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // TRANSIT GATEWAY Service + tgURL := tg.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + tgURL = ContructEndpoint("private.transit", fmt.Sprintf("%s/v1", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + tgURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_TG_API_ENDPOINT", c.Region, tgURL) + } + transitgatewayOptions := &tg.TransitGatewayApisV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_TG_API_ENDPOINT"}, tgURL), + Authenticator: authenticator, + Version: CreateVersionDate(), + } + session.transitgatewayAPI, session.transitgatewayErr = tg.NewTransitGatewayApisV1(transitgatewayOptions) + if session.transitgatewayErr != nil { + session.transitgatewayErr = fmt.Errorf("[ERROR] Error occured while configuring Transit Gateway Service: %s", session.transitgatewayErr) + } + if session.transitgatewayAPI != nil && session.transitgatewayAPI.Service != nil { + session.transitgatewayAPI.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // session.transitgatewayAPI.SetDefaultHeaders(gohttp.Header{ + // "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + // }) + } + + // CIS Service instances starts here. + cisURL := ContructEndpoint("api.cis", cloudEndpoint) + if c.Visibility == "private" { + // cisURL = ContructEndpoint("api.private.cis", cloudEndpoint) + session.cisZonesErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisDNSBulkErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisGLBPoolErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisGLBErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisGLBHealthCheckErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisIPErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisRLErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisPageRuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisEdgeFunctionErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisSSLErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisWAFPackageErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisDomainSettingsErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisRoutingErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisWAFGroupErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisCacheErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisCustomPageErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisAccessRuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisUARuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisLockdownErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisRangeAppErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisWAFRuleErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisFiltersErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + session.cisWebhooksErr = fmt.Errorf("CIS Service doesnt support private endpoints.") + + } + if fileMap != nil && c.Visibility != "public-and-private" { + cisURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CIS_API_ENDPOINT", c.Region, cisURL) + } + cisEndPoint := EnvFallBack([]string{"IBMCLOUD_CIS_API_ENDPOINT"}, cisURL) + + // IBM Network CIS Zones service + cisZonesV1Opt := &ciszonesv1.ZonesV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisZonesV1Client, session.cisZonesErr = ciszonesv1.NewZonesV1(cisZonesV1Opt) + if session.cisZonesErr != nil { + session.cisZonesErr = fmt.Errorf( + "Error occured while configuring CIS Zones service: %s", + session.cisZonesErr) + } + if session.cisZonesV1Client != nil && session.cisZonesV1Client.Service != nil { + session.cisZonesV1Client.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisZonesV1Client.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS DNS Record service + cisDNSRecordsOpt := &cisdnsrecordsv1.DnsRecordsV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisDNSRecordsClient, session.cisDNSErr = cisdnsrecordsv1.NewDnsRecordsV1(cisDNSRecordsOpt) + if session.cisDNSErr != nil { + session.cisDNSErr = fmt.Errorf("[ERROR] Error occured while configuring CIS DNS Service: %s", session.cisDNSErr) + } + if session.cisDNSRecordsClient != nil && session.cisDNSRecordsClient.Service != nil { + session.cisDNSRecordsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisDNSRecordsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS DNS Record bulk service + cisDNSRecordBulkOpt := &cisdnsbulkv1.DnsRecordBulkV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisDNSRecordBulkClient, session.cisDNSBulkErr = cisdnsbulkv1.NewDnsRecordBulkV1(cisDNSRecordBulkOpt) + if session.cisDNSBulkErr != nil { + session.cisDNSBulkErr = fmt.Errorf( + "Error occured while configuration CIS DNS bulk service : %s", + session.cisDNSBulkErr) + } + if session.cisDNSRecordBulkClient != nil && session.cisDNSRecordBulkClient.Service != nil { + session.cisDNSRecordBulkClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisDNSRecordBulkClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Global load balancer pool + cisGLBPoolOpt := &cisglbpoolv0.GlobalLoadBalancerPoolsV0Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisGLBPoolClient, session.cisGLBPoolErr = + cisglbpoolv0.NewGlobalLoadBalancerPoolsV0(cisGLBPoolOpt) + if session.cisGLBPoolErr != nil { + session.cisGLBPoolErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS GLB Pool service: %s", + session.cisGLBPoolErr) + } + if session.cisGLBPoolClient != nil && session.cisGLBPoolClient.Service != nil { + session.cisGLBPoolClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisGLBPoolClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Global load balancer + cisGLBOpt := &cisglbv1.GlobalLoadBalancerV1Options{ + URL: cisEndPoint, + Authenticator: authenticator, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + } + session.cisGLBClient, session.cisGLBErr = cisglbv1.NewGlobalLoadBalancerV1(cisGLBOpt) + if session.cisGLBErr != nil { + session.cisGLBErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS GLB service: %s", + session.cisGLBErr) + } + if session.cisGLBClient != nil && session.cisGLBClient.Service != nil { + session.cisGLBClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisGLBClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Global load balancer health check/monitor + cisGLBHealthCheckOpt := &cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisGLBHealthCheckClient, session.cisGLBHealthCheckErr = + cisglbhealthcheckv1.NewGlobalLoadBalancerMonitorV1(cisGLBHealthCheckOpt) + if session.cisGLBHealthCheckErr != nil { + session.cisGLBHealthCheckErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS GLB Health Check service: %s", + session.cisGLBHealthCheckErr) + } + if session.cisGLBHealthCheckClient != nil && session.cisGLBHealthCheckClient.Service != nil { + session.cisGLBHealthCheckClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisGLBHealthCheckClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS IP + cisIPOpt := &cisipv1.CisIpApiV1Options{ + URL: cisEndPoint, + Authenticator: authenticator, + } + session.cisIPClient, session.cisIPErr = cisipv1.NewCisIpApiV1(cisIPOpt) + if session.cisIPErr != nil { + session.cisIPErr = fmt.Errorf("[ERROR] Error occured while configuring CIS IP service: %s", + session.cisIPErr) + } + if session.cisIPClient != nil && session.cisIPClient.Service != nil { + session.cisIPClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisIPClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Zone Rate Limit + cisRLOpt := &cisratelimitv1.ZoneRateLimitsV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisRLClient, session.cisRLErr = cisratelimitv1.NewZoneRateLimitsV1(cisRLOpt) + if session.cisRLErr != nil { + session.cisRLErr = fmt.Errorf( + "Error occured while cofiguring CIS Zone Rate Limit service: %s", + session.cisRLErr) + } + if session.cisRLClient != nil && session.cisRLClient.Service != nil { + session.cisRLClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisRLClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + // IBM Network CIS Alerts + cisAlertsOpt := &cisalertsv1.AlertsV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisAlertsClient, session.cisAlertsErr = cisalertsv1.NewAlertsV1(cisAlertsOpt) + if session.cisAlertsErr != nil { + session.cisAlertsErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Alerts : %s", + session.cisAlertsErr) + } + if session.cisAlertsClient != nil && session.cisAlertsClient.Service != nil { + session.cisAlertsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisAlertsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Page Rules + cisPageRuleOpt := &cispagerulev1.PageRuleApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneID: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisPageRuleClient, session.cisPageRuleErr = cispagerulev1.NewPageRuleApiV1(cisPageRuleOpt) + if session.cisPageRuleErr != nil { + session.cisPageRuleErr = fmt.Errorf( + "Error occured while cofiguring CIS Page Rule service: %s", + session.cisPageRuleErr) + } + if session.cisPageRuleClient != nil && session.cisPageRuleClient.Service != nil { + session.cisPageRuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisPageRuleClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Edge Function + cisEdgeFunctionOpt := &cisedgefunctionv1.EdgeFunctionsApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisEdgeFunctionClient, session.cisEdgeFunctionErr = + cisedgefunctionv1.NewEdgeFunctionsApiV1(cisEdgeFunctionOpt) + if session.cisEdgeFunctionErr != nil { + session.cisEdgeFunctionErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Edge Function service: %s", + session.cisEdgeFunctionErr) + } + if session.cisEdgeFunctionClient != nil && session.cisEdgeFunctionClient.Service != nil { + session.cisEdgeFunctionClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisEdgeFunctionClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS SSL certificate + cisSSLOpt := &cissslv1.SslCertificateApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + + session.cisSSLClient, session.cisSSLErr = cissslv1.NewSslCertificateApiV1(cisSSLOpt) + if session.cisSSLErr != nil { + session.cisSSLErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS SSL certificate service: %s", + session.cisSSLErr) + } + if session.cisSSLClient != nil && session.cisSSLClient.Service != nil { + session.cisSSLClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisSSLClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS WAF Package + cisWAFPackageOpt := &ciswafpackagev1.WafRulePackagesApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneID: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisWAFPackageClient, session.cisWAFPackageErr = + ciswafpackagev1.NewWafRulePackagesApiV1(cisWAFPackageOpt) + if session.cisWAFPackageErr != nil { + session.cisWAFPackageErr = + fmt.Errorf("[ERROR] Error occured while configuration CIS WAF Package service: %s", + session.cisWAFPackageErr) + } + if session.cisWAFPackageClient != nil && session.cisWAFPackageClient.Service != nil { + session.cisWAFPackageClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisWAFPackageClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Domain settings + cisDomainSettingsOpt := &cisdomainsettingsv1.ZonesSettingsV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisDomainSettingsClient, session.cisDomainSettingsErr = + cisdomainsettingsv1.NewZonesSettingsV1(cisDomainSettingsOpt) + if session.cisDomainSettingsErr != nil { + session.cisDomainSettingsErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Domain Settings service: %s", + session.cisDomainSettingsErr) + } + if session.cisDomainSettingsClient != nil && session.cisDomainSettingsClient.Service != nil { + session.cisDomainSettingsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisDomainSettingsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Routing + cisRoutingOpt := &cisroutingv1.RoutingV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisRoutingClient, session.cisRoutingErr = + cisroutingv1.NewRoutingV1(cisRoutingOpt) + if session.cisRoutingErr != nil { + session.cisRoutingErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Routing service: %s", + session.cisRoutingErr) + } + if session.cisRoutingClient != nil && session.cisRoutingClient.Service != nil { + session.cisRoutingClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisRoutingClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS WAF Group + cisWAFGroupOpt := &ciswafgroupv1.WafRuleGroupsApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneID: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisWAFGroupClient, session.cisWAFGroupErr = + ciswafgroupv1.NewWafRuleGroupsApiV1(cisWAFGroupOpt) + if session.cisWAFGroupErr != nil { + session.cisWAFGroupErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS WAF Group service: %s", + session.cisWAFGroupErr) + } + if session.cisWAFGroupClient != nil && session.cisWAFGroupClient.Service != nil { + session.cisWAFGroupClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisWAFGroupClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Cache service + cisCacheOpt := &ciscachev1.CachingApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneID: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisCacheClient, session.cisCacheErr = + ciscachev1.NewCachingApiV1(cisCacheOpt) + if session.cisCacheErr != nil { + session.cisCacheErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Caching service: %s", + session.cisCacheErr) + } + if session.cisCacheClient != nil && session.cisCacheClient.Service != nil { + session.cisCacheClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisCacheClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Custom pages service + cisCustomPageOpt := &ciscustompagev1.CustomPagesV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + + session.cisCustomPageClient, session.cisCustomPageErr = + ciscustompagev1.NewCustomPagesV1(cisCustomPageOpt) + if session.cisCustomPageErr != nil { + session.cisCustomPageErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Custom Pages service: %s", + session.cisCustomPageErr) + } + if session.cisCustomPageClient != nil && session.cisCustomPageClient.Service != nil { + session.cisCustomPageClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisCustomPageClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Firewall Access rule + cisAccessRuleOpt := &cisaccessrulev1.ZoneFirewallAccessRulesV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisAccessRuleClient, session.cisAccessRuleErr = + cisaccessrulev1.NewZoneFirewallAccessRulesV1(cisAccessRuleOpt) + if session.cisAccessRuleErr != nil { + session.cisAccessRuleErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Firewall Access Rule service: %s", + session.cisAccessRuleErr) + } + if session.cisAccessRuleClient != nil && session.cisAccessRuleClient.Service != nil { + session.cisAccessRuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisAccessRuleClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Firewall User Agent Blocking rule + cisUARuleOpt := &cisuarulev1.UserAgentBlockingRulesV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisUARuleClient, session.cisUARuleErr = + cisuarulev1.NewUserAgentBlockingRulesV1(cisUARuleOpt) + if session.cisUARuleErr != nil { + session.cisUARuleErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Firewall User Agent Blocking Rule service: %s", + session.cisUARuleErr) + } + if session.cisUARuleClient != nil && session.cisUARuleClient.Service != nil { + session.cisUARuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisUARuleClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Firewall Lockdown rule + cisLockdownOpt := &cislockdownv1.ZoneLockdownV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisLockdownClient, session.cisLockdownErr = + cislockdownv1.NewZoneLockdownV1(cisLockdownOpt) + if session.cisLockdownErr != nil { + session.cisLockdownErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Firewall Lockdown Rule service: %s", + session.cisLockdownErr) + } + if session.cisLockdownClient != nil && session.cisLockdownClient.Service != nil { + session.cisLockdownClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisLockdownClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Range Application rule + cisRangeAppOpt := &cisrangeappv1.RangeApplicationsV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneIdentifier: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisRangeAppClient, session.cisRangeAppErr = + cisrangeappv1.NewRangeApplicationsV1(cisRangeAppOpt) + if session.cisRangeAppErr != nil { + session.cisRangeAppErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Range Application rule service: %s", + session.cisRangeAppErr) + } + if session.cisRangeAppClient != nil && session.cisRangeAppClient.Service != nil { + session.cisRangeAppClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisRangeAppClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS WAF Rule Service + cisWAFRuleOpt := &ciswafrulev1.WafRulesApiV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + ZoneID: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisWAFRuleClient, session.cisWAFRuleErr = + ciswafrulev1.NewWafRulesApiV1(cisWAFRuleOpt) + if session.cisWAFRuleErr != nil { + session.cisWAFRuleErr = fmt.Errorf( + "Error occured while configuring CIS WAF Rules service: %s", + session.cisWAFRuleErr) + } + if session.cisWAFRuleClient != nil && session.cisWAFRuleClient.Service != nil { + session.cisWAFRuleClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisWAFRuleClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Webhooks + cisWebhooksOpt := &ciswebhooksv1.WebhooksV1Options{ + URL: cisEndPoint, + Crn: core.StringPtr(""), + Authenticator: authenticator, + } + session.cisWebhooksClient, session.cisWebhooksErr = ciswebhooksv1.NewWebhooksV1(cisWebhooksOpt) + if session.cisWebhooksErr != nil { + session.cisWebhooksErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Webhooks : %s", + session.cisWebhooksErr) + } + if session.cisWebhooksClient != nil && session.cisWebhooksClient.Service != nil { + session.cisWebhooksClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisWebhooksClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + // IBM Network CIS Filters + cisFiltersOpt := &cisfiltersv1.FiltersV1Options{ + URL: cisEndPoint, + Authenticator: authenticator, + } + session.cisFiltersClient, session.cisFiltersErr = cisfiltersv1.NewFiltersV1(cisFiltersOpt) + if session.cisFiltersErr != nil { + session.cisFiltersErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Filters : %s", + session.cisFiltersErr) + } + if session.cisFiltersClient != nil && session.cisFiltersClient.Service != nil { + session.cisFiltersClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisFiltersClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IBM Network CIS Firewall rules + cisFirewallrulesOpt := &cisfirewallrulesv1.FirewallRulesV1Options{ + URL: cisEndPoint, + Authenticator: authenticator, + } + session.cisFirewallRulesClient, session.cisFirewallRulesErr = cisfirewallrulesv1.NewFirewallRulesV1(cisFirewallrulesOpt) + if session.cisFirewallRulesErr != nil { + session.cisFirewallRulesErr = + fmt.Errorf("[ERROR] Error occured while configuring CIS Firewall rules : %s", + session.cisFirewallRulesErr) + } + if session.cisFirewallRulesClient != nil && session.cisFirewallRulesClient.Service != nil { + session.cisFirewallRulesClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.cisFirewallRulesClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // IAM IDENTITY Service + // iamIdenityURL := fmt.Sprintf("https://%s.iam.cloud.ibm.com/v1", c.Region) + iamIdenityURL := iamidentity.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + iamIdenityURL = ContructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) + } else { + iamIdenityURL = ContructEndpoint("private.iam", cloudEndpoint) + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + iamIdenityURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamIdenityURL) + } + iamIdentityOptions := &iamidentity.IamIdentityV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamIdenityURL), + } + iamIdentityClient, err := iamidentity.NewIamIdentityV1(iamIdentityOptions) + if err != nil { + session.iamIdentityErr = fmt.Errorf("[ERROR] Error occured while configuring IAM Identity service: %q", err) + } + if iamIdentityClient != nil && iamIdentityClient.Service != nil { + iamIdentityClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + iamIdentityClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.iamIdentityAPI = iamIdentityClient + + // IAM POLICY MANAGEMENT Service + iamPolicyManagementURL := iampolicymanagement.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + iamPolicyManagementURL = ContructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) + } else { + iamPolicyManagementURL = ContructEndpoint("private.iam", cloudEndpoint) + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + iamPolicyManagementURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamPolicyManagementURL) + } + iamPolicyManagementOptions := &iampolicymanagement.IamPolicyManagementV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamPolicyManagementURL), + } + iamPolicyManagementClient, err := iampolicymanagement.NewIamPolicyManagementV1(iamPolicyManagementOptions) + if err != nil { + session.iamPolicyManagementErr = fmt.Errorf("[ERROR] Error occured while configuring IAM Policy Management service: %q", err) + } + if iamPolicyManagementClient != nil && iamPolicyManagementClient.Service != nil { + iamPolicyManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + iamPolicyManagementClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.iamPolicyManagementAPI = iamPolicyManagementClient + + // IAM ACCESS GROUP + iamAccessGroupsURL := iamaccessgroups.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + iamAccessGroupsURL = ContructEndpoint(fmt.Sprintf("private.%s.iam", c.Region), cloudEndpoint) + } else { + iamAccessGroupsURL = ContructEndpoint("private.iam", cloudEndpoint) + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + iamAccessGroupsURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_IAM_API_ENDPOINT", c.Region, iamAccessGroupsURL) + } + iamAccessGroupsOptions := &iamaccessgroups.IamAccessGroupsV2Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamAccessGroupsURL), + } + iamAccessGroupsClient, err := iamaccessgroups.NewIamAccessGroupsV2(iamAccessGroupsOptions) + if err != nil { + session.iamAccessGroupsErr = fmt.Errorf("[ERROR] Error occured while configuring IAM Access Group service: %q", err) + } + if iamAccessGroupsClient != nil && iamAccessGroupsClient.Service != nil { + iamAccessGroupsClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + iamAccessGroupsClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.iamAccessGroupsAPI = iamAccessGroupsClient + + // RESOURCE MANAGEMENT Service + rmURL := resourcemanager.DefaultServiceURL + if c.Visibility == "private" { + if c.Region == "us-south" || c.Region == "us-east" { + rmURL = ContructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), fmt.Sprintf("%s", cloudEndpoint)) + } else { + fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") + rmURL = ContructEndpoint("private.us-south.resource-controller", fmt.Sprintf("%s", cloudEndpoint)) + } + } + if c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + rmURL = ContructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), fmt.Sprintf("%s", cloudEndpoint)) + } else { + rmURL = resourcemanager.DefaultServiceURL + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + rmURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_RESOURCE_MANAGEMENT_API_ENDPOINT", c.Region, rmURL) + } + resourceManagerOptions := &resourcemanager.ResourceManagerV2Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_RESOURCE_MANAGEMENT_API_ENDPOINT"}, rmURL), + } + resourceManagerClient, err := resourcemanager.NewResourceManagerV2(resourceManagerOptions) + if err != nil { + session.resourceManagerErr = fmt.Errorf("[ERROR] Error occured while configuring Resource Manager service: %q", err) + } + if resourceManagerClient != nil && resourceManagerClient.Service != nil { + resourceManagerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + resourceManagerClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.resourceManagerAPI = resourceManagerClient + + //CLOUD SHELL Service + cloudShellUrl := ibmcloudshellv1.DefaultServiceURL + if fileMap != nil && c.Visibility != "public-and-private" { + cloudShellUrl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_CLOUD_SHELL_API_ENDPOINT", c.Region, cloudShellUrl) + } + ibmCloudShellClientOptions := &ibmcloudshellv1.IBMCloudShellV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_CLOUD_SHELL_API_ENDPOINT"}, cloudShellUrl), + } + session.ibmCloudShellClient, err = ibmcloudshellv1.NewIBMCloudShellV1(ibmCloudShellClientOptions) + if err != nil { + session.ibmCloudShellClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Shell service: %q", err) + } + if session.ibmCloudShellClient != nil && session.ibmCloudShellClient.Service != nil { + session.ibmCloudShellClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.ibmCloudShellClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // ENTERPRISE Service + enterpriseURL := enterprisemanagementv1.DefaultServiceURL + if c.Visibility == "private" { + if c.Region == "us-south" || c.Region == "us-east" || c.Region == "eu-fr" { + enterpriseURL = ContructEndpoint(fmt.Sprintf("private.%s.enterprise", c.Region), fmt.Sprintf("%s/v1", cloudEndpoint)) + } else { + fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") + enterpriseURL = ContructEndpoint("private.us-south.enterprise", fmt.Sprintf("%s/v1", cloudEndpoint)) + } + } + if c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" || c.Region == "eu-fr" { + enterpriseURL = ContructEndpoint(fmt.Sprintf("private.%s.enterprise", c.Region), + fmt.Sprintf("%s/v1", cloudEndpoint)) + } else { + enterpriseURL = enterprisemanagementv1.DefaultServiceURL + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + enterpriseURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_ENTERPRISE_API_ENDPOINT", c.Region, enterpriseURL) + } + enterpriseManagementClientOptions := &enterprisemanagementv1.EnterpriseManagementV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_ENTERPRISE_API_ENDPOINT"}, enterpriseURL), + } + enterpriseManagementClient, err := enterprisemanagementv1.NewEnterpriseManagementV1(enterpriseManagementClientOptions) + if err != nil { + session.enterpriseManagementClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Enterprise Management API service: %q", err) + } + if enterpriseManagementClient != nil && enterpriseManagementClient.Service != nil { + enterpriseManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + enterpriseManagementClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.enterpriseManagementClient = enterpriseManagementClient + + // RESOURCE CONTROLLER Service + rcURL := resourcecontroller.DefaultServiceURL + if c.Visibility == "private" { + if c.Region == "us-south" || c.Region == "us-east" { + rcURL = ContructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), cloudEndpoint) + } else { + fmt.Println("Private Endpint supports only us-south and us-east region specific endpoint") + rcURL = ContructEndpoint("private.us-south.resource-controller", cloudEndpoint) + } + } + if c.Visibility == "public-and-private" { + if c.Region == "us-south" || c.Region == "us-east" { + rcURL = ContructEndpoint(fmt.Sprintf("private.%s.resource-controller", c.Region), cloudEndpoint) + } else { + rcURL = resourcecontroller.DefaultServiceURL + } + } + if fileMap != nil && c.Visibility != "public-and-private" { + rcURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_RESOURCE_CONTROLLER_API_ENDPOINT", c.Region, rcURL) + } + resourceControllerOptions := &resourcecontroller.ResourceControllerV2Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_RESOURCE_CONTROLLER_API_ENDPOINT"}, rcURL), + } + resourceControllerClient, err := resourcecontroller.NewResourceControllerV2(resourceControllerOptions) + if err != nil { + session.resourceControllerErr = fmt.Errorf("[ERROR] Error occured while configuring Resource Controller service: %q", err) + } + if resourceControllerClient != nil && resourceControllerClient.Service != nil { + resourceControllerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + resourceControllerClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + session.resourceControllerAPI = resourceControllerClient + + // SECRETS MANAGER Service + secretsManagerClientOptions := &secretsmanagerv1.SecretsManagerV1Options{ + Authenticator: authenticator, + } + /// Construct the service client. + session.secretsManagerClient, err = secretsmanagerv1.NewSecretsManagerV1(secretsManagerClientOptions) + if err != nil { + session.secretsManagerClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Secrets Manager API service: %q", err) + } + if session.secretsManagerClient != nil && session.secretsManagerClient.Service != nil { + // Enable retries for API calls + session.secretsManagerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.secretsManagerClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // SATELLITE Service + containerEndpoint := kubernetesserviceapiv1.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + containerEndpoint = ContructEndpoint(fmt.Sprintf("private.%s.containers", c.Region), fmt.Sprintf("%s/global", cloudEndpoint)) + } + if fileMap != nil && c.Visibility != "public-and-private" { + containerEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SATELLITE_API_ENDPOINT", c.Region, containerEndpoint) + } + kubernetesServiceV1Options := &kubernetesserviceapiv1.KubernetesServiceApiV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_SATELLITE_API_ENDPOINT"}, containerEndpoint), + Authenticator: authenticator, + } + session.satelliteClient, err = kubernetesserviceapiv1.NewKubernetesServiceApiV1(kubernetesServiceV1Options) + if err != nil { + session.satelliteClientErr = fmt.Errorf("[ERROR] Error occured while configuring satellite client: %q", err) + } + + // Enable retries for API calls + if session.satelliteClient != nil && session.satelliteClient.Service != nil { + session.satelliteClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.satelliteClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + // SATELLITE LINK Service + // Construct an "options" struct for creating the service client. + satelliteLinkEndpoint := satellitelinkv1.DefaultServiceURL + if c.Visibility == "private" || c.Visibility == "public-and-private" { + satelliteLinkEndpoint = ContructEndpoint("private.api.link.satellite", cloudEndpoint) + } + if fileMap != nil && c.Visibility != "public-and-private" { + satelliteLinkEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_SATELLITE_LINK_API_ENDPOINT", c.Region, satelliteLinkEndpoint) + } + satelliteLinkClientOptions := &satellitelinkv1.SatelliteLinkV1Options{ + URL: EnvFallBack([]string{"IBMCLOUD_SATELLITE_LINK_API_ENDPOINT"}, satelliteLinkEndpoint), + Authenticator: authenticator, + } + session.satelliteLinkClient, err = satellitelinkv1.NewSatelliteLinkV1(satelliteLinkClientOptions) + if err != nil { + session.satelliteLinkClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Satellite Link service: %q", err) + } + if session.satelliteLinkClient != nil && session.satelliteLinkClient.Service != nil { + // Enable retries for API calls + session.satelliteLinkClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.satelliteLinkClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + esSchemaRegistryV1Options := &schemaregistryv1.SchemaregistryV1Options{ + Authenticator: authenticator, + } + session.esSchemaRegistryClient, err = schemaregistryv1.NewSchemaregistryV1(esSchemaRegistryV1Options) + if err != nil { + session.esSchemaRegistryErr = fmt.Errorf("[ERROR] Error occured while configuring Event Streams schema registry: %q", err) + } + if session.esSchemaRegistryClient != nil && session.esSchemaRegistryClient.Service != nil { + session.esSchemaRegistryClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + session.esSchemaRegistryClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + //COMPLIANCE Service + // Construct an "options" struct for creating the service client. + var postureManagementClientURL string + if c.Visibility == "public" || c.Visibility == "public-and-private" { + postureManagementClientURL, err = posturemanagementv1.GetServiceURLForRegion(c.Region) + } else { + session.postureManagementClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Security Insights Findings API service: `%v` visibility not supported", c.Visibility) + } + if err != nil { + postureManagementClientURL = posturemanagementv1.DefaultServiceURL + } + if fileMap != nil && c.Visibility != "public-and-private" { + postureManagementClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_COMPLIANCE_API_ENDPOINT", c.Region, postureManagementClientURL) + } + postureManagementClientOptions := &posturemanagementv1.PostureManagementV1Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_COMPLIANCE_API_ENDPOINT"}, postureManagementClientURL), + AccountID: core.StringPtr(userConfig.UserAccount), + } + + // Construct the service client. + session.postureManagementClient, err = posturemanagementv1.NewPostureManagementV1(postureManagementClientOptions) + if err != nil { + session.postureManagementClientErr = fmt.Errorf("[ERROR] Error occurred while configuring Posture Management service: %q", err) + } + if session.postureManagementClient != nil && session.postureManagementClient.Service != nil { + // Enable retries for API calls + session.postureManagementClient.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.postureManagementClient.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + //COMPLIANCE Service v2 version + // Construct an "options" struct for creating the service client. + var postureManagementClientURLv2 string + if c.Visibility == "public" || c.Visibility == "public-and-private" { + postureManagementClientURLv2, err = posturemanagementv2.GetServiceURLForRegion(c.Region) + } else { + session.postureManagementClientErrv2 = fmt.Errorf("[ERROR] Error occurred while configuring Security Compliance Centre API service: `%v` visibility not supported", c.Visibility) + } + if err != nil { + session.postureManagementClientErrv2 = fmt.Errorf("[ERROR] Error occurred while configuring Security Posture Management API service: `%s` region not supported", c.Region) + } + if fileMap != nil && c.Visibility != "public-and-private" { + postureManagementClientURLv2 = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_COMPLIANCE_API_ENDPOINT", c.Region, postureManagementClientURLv2) + } + postureManagementClientOptionsv2 := &posturemanagementv2.PostureManagementV2Options{ + Authenticator: authenticator, + URL: EnvFallBack([]string{"IBMCLOUD_COMPLIANCE_API_ENDPOINT"}, postureManagementClientURLv2), + } + + // Construct the service client. + session.postureManagementClientv2, err = posturemanagementv2.NewPostureManagementV2(postureManagementClientOptionsv2) + if err != nil { + session.postureManagementClientErrv2 = fmt.Errorf("[ERROR] Error occurred while configuring Posture Management v2 service: %q", err) + } + if session.postureManagementClientv2 != nil && session.postureManagementClientv2.Service != nil { + // Enable retries for API calls + session.postureManagementClientv2.Service.EnableRetries(c.RetryCount, c.RetryDelay) + // Add custom header for analytics + session.postureManagementClientv2.SetDefaultHeaders(gohttp.Header{ + "X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)}, + }) + } + + if os.Getenv("TF_LOG") != "" { + logDestination := log.Writer() + goLogger := log.New(logDestination, "", log.LstdFlags) + core.SetLogger(core.NewLogger(core.LevelDebug, goLogger, goLogger)) + } + return session, nil +} + +// CreateVersionDate requires mandatory version attribute. Any date from 2019-12-13 up to the currentdate may be provided. Specify the current date to request the latest version. +func CreateVersionDate() *string { + version := time.Now().Format("2006-01-02") + return &version +} + +func newSession(c *Config) (*Session, error) { + ibmSession := &Session{} + + softlayerSession := &slsession.Session{ + Endpoint: c.SoftLayerEndpointURL, + Timeout: c.SoftLayerTimeout, + UserName: c.SoftLayerUserName, + APIKey: c.SoftLayerAPIKey, + Debug: os.Getenv("TF_LOG") != "", + Retries: c.RetryCount, + RetryWait: c.RetryDelay, + } + + if c.IAMToken != "" { + log.Println("Configuring SoftLayer Session with token") + softlayerSession.IAMToken = c.IAMToken + softlayerSession.IAMRefreshToken = c.IAMRefreshToken + } + if c.SoftLayerAPIKey != "" && c.SoftLayerUserName != "" { + log.Println("Configuring SoftLayer Session with API key") + softlayerSession.APIKey = c.SoftLayerAPIKey + softlayerSession.UserName = c.SoftLayerUserName + } + softlayerSession.AppendUserAgent(fmt.Sprintf("terraform-provider-ibm/%s", version.Version)) + ibmSession.SoftLayerSession = softlayerSession + + if c.IAMTrustedProfileID == "" && (c.IAMToken != "" && c.IAMRefreshToken == "") || (c.IAMToken == "" && c.IAMRefreshToken != "") { + return nil, fmt.Errorf("iam_token and iam_refresh_token must be provided") + } + if c.IAMTrustedProfileID != "" && c.IAMToken == "" { + return nil, fmt.Errorf("iam_token and iam_profile_id must be provided") + } + + if c.IAMToken != "" { + log.Println("Configuring IBM Cloud Session with token") + var sess *bxsession.Session + bmxConfig := &bluemix.Config{ + IAMAccessToken: c.IAMToken, + IAMRefreshToken: c.IAMRefreshToken, + //Comment out debug mode for v0.12 + Debug: os.Getenv("TF_LOG") != "", + HTTPTimeout: c.BluemixTimeout, + Region: c.Region, + ResourceGroup: c.ResourceGroup, + RetryDelay: &c.RetryDelay, + MaxRetries: &c.RetryCount, + Visibility: c.Visibility, + EndpointsFile: c.EndpointsFile, + UserAgent: fmt.Sprintf("terraform-provider-ibm/%s", version.Version), + } + sess, err := bxsession.New(bmxConfig) + if err != nil { + return nil, err + } + ibmSession.BluemixSession = sess + } + + if c.BluemixAPIKey != "" { + log.Println("Configuring IBM Cloud Session with API key") + var sess *bxsession.Session + bmxConfig := &bluemix.Config{ + BluemixAPIKey: c.BluemixAPIKey, + //Comment out debug mode for v0.12 + Debug: os.Getenv("TF_LOG") != "", + HTTPTimeout: c.BluemixTimeout, + Region: c.Region, + ResourceGroup: c.ResourceGroup, + RetryDelay: &c.RetryDelay, + MaxRetries: &c.RetryCount, + Visibility: c.Visibility, + EndpointsFile: c.EndpointsFile, + UserAgent: fmt.Sprintf("terraform-provider-ibm/%s", version.Version), + } + sess, err := bxsession.New(bmxConfig) + if err != nil { + return nil, err + } + ibmSession.BluemixSession = sess + } + + return ibmSession, nil +} + +func authenticateAPIKey(sess *bxsession.Session) error { + config := sess.Config + tokenRefresher, err := authentication.NewIAMAuthRepository(config, &rest.Client{ + DefaultHeader: gohttp.Header{ + "User-Agent": []string{http.UserAgent()}, + "X-Original-User-Agent": []string{config.UserAgent}, + }, + }) + if err != nil { + return err + } + return tokenRefresher.AuthenticateAPIKey(config.BluemixAPIKey) +} + +func authenticateCF(sess *bxsession.Session) error { + config := sess.Config + tokenRefresher, err := authentication.NewUAARepository(config, &rest.Client{ + DefaultHeader: gohttp.Header{ + "User-Agent": []string{http.UserAgent()}, + "X-Original-User-Agent": []string{http.UserAgent()}, + }, + }) + if err != nil { + return err + } + return tokenRefresher.AuthenticateAPIKey(config.BluemixAPIKey) +} + +func fetchUserDetails(sess *bxsession.Session, retries int, retryDelay time.Duration) (*UserConfig, error) { + config := sess.Config + user := UserConfig{} + var bluemixToken string + + if strings.HasPrefix(config.IAMAccessToken, "Bearer") { + bluemixToken = config.IAMAccessToken[7:len(config.IAMAccessToken)] + } else { + bluemixToken = config.IAMAccessToken + } + + token, err := jwt.Parse(bluemixToken, func(token *jwt.Token) (interface{}, error) { + return "", nil + }) + //TODO validate with key + if err != nil && !strings.Contains(err.Error(), "key is of invalid type") { + if retries > 0 { + if config.BluemixAPIKey != "" { + time.Sleep(retryDelay) + log.Printf("Retrying authentication for user details %d", retries) + _ = authenticateAPIKey(sess) + return fetchUserDetails(sess, retries-1, retryDelay) + } + } + return &user, err + } + claims := token.Claims.(jwt.MapClaims) + if email, ok := claims["email"]; ok { + user.UserEmail = email.(string) + } + user.UserID = claims["id"].(string) + user.UserAccount = claims["account"].(map[string]interface{})["bss"].(string) + iss := claims["iss"].(string) + if strings.Contains(iss, "https://iam.cloud.ibm.com") { + user.CloudName = "bluemix" + } else { + user.CloudName = "staging" + } + user.cloudType = "public" + + user.generation = 2 + return &user, nil +} + +func RefreshToken(sess *bxsession.Session) error { + config := sess.Config + tokenRefresher, err := authentication.NewIAMAuthRepository(config, &rest.Client{ + DefaultHeader: gohttp.Header{ + "User-Agent": []string{http.UserAgent()}, + "X-Original-User-Agent": []string{config.UserAgent}, + }, + }) + if err != nil { + return err + } + _, err = tokenRefresher.RefreshToken() + return err +} + +func EnvFallBack(envs []string, defaultValue string) string { + for _, k := range envs { + if v := os.Getenv(k); v != "" { + return v + } + } + return defaultValue +} +func fileFallBack(fileMap map[string]interface{}, visibility, key, region, defaultValue string) string { + if val, ok := fileMap[key]; ok { + if v, ok := val.(map[string]interface{})[visibility]; ok { + if r, ok := v.(map[string]interface{})[region]; ok && r.(string) != "" { + return r.(string) + } + } + } + return defaultValue +} + +// DefaultTransport ... +func DefaultTransport() gohttp.RoundTripper { + transport := &gohttp.Transport{ + Proxy: gohttp.ProxyFromEnvironment, + DisableKeepAlives: true, + MaxIdleConnsPerHost: -1, + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: false, + }, + } + return transport +} + +func isRetryable(err error) bool { + if bmErr, ok := err.(bmxerror.RequestFailure); ok { + switch bmErr.StatusCode() { + case 408, 504, 599, 429, 500, 502, 520, 503: + return true + } + } + + if netErr, ok := err.(net.Error); ok && netErr.Timeout() { + return true + } + + if netErr, ok := err.(*net.OpError); ok && netErr.Timeout() { + return true + } + + if netErr, ok := err.(net.UnknownNetworkError); ok && netErr.Timeout() { + return true + } + + return false +} + +func ContructEndpoint(subdomain, domain string) string { + endpoint := fmt.Sprintf("https://%s.%s", subdomain, domain) + return endpoint +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/config_functions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/config_functions.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/config_functions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/config_functions.go index f7988da19c..a827288262 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/config_functions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/config_functions.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package conns import ( "fmt" "net/http" "net/url" "os" + "strings" bluemix "github.com/IBM-Cloud/bluemix-go" "github.com/IBM-Cloud/bluemix-go/api/functions" @@ -51,7 +52,7 @@ func getBaseURL(region string) string { * iam-based namespace don't have an auth key and needs only iam token for authorization. * */ -func setupOpenWhiskClientConfig(namespace string, sess *bxsession.Session, functionNamespace functions.FunctionServiceAPI) (*whisk.Client, error) { +func SetupOpenWhiskClientConfig(namespace string, sess *bxsession.Session, functionNamespace functions.FunctionServiceAPI) (*whisk.Client, error) { u, _ := url.Parse(fmt.Sprintf("https://%s.functions.cloud.ibm.com/api", sess.Config.Region)) wskClient, _ := whisk.NewClient(http.DefaultClient, &whisk.Config{ Host: u.Host, @@ -81,13 +82,13 @@ func setupOpenWhiskClientConfig(namespace string, sess *bxsession.Session, funct if n.IsIamEnabled() { additionalHeaders := make(http.Header) - err := refreshToken(sess) + err := RefreshToken(sess) if err != nil { for count := sess.Config.MaxRetries; *count >= 0; *count-- { if err == nil || !isRetryable(err) { break } - err = refreshToken(sess) + err = RefreshToken(sess) } if err != nil { return nil, err @@ -134,3 +135,11 @@ func setupOpenWhiskClientConfig(namespace string, sess *bxsession.Session, funct return nil, fmt.Errorf("Failed to create whisk config object for namespace '%s'", namespace) } +func validateNamespace(ns string) error { + os := strings.Split(ns, "_") + if len(os) < 2 || (len(os) == 2 && (len(os[0]) == 0 || len(os[1]) == 0)) { + return fmt.Errorf( + "Namespace is (%s), it must be of the form _, provider can't find the auth key if you use _ as well", ns) + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode/hashcode.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/hashcode.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode/hashcode.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/hashcode.go index 94c0ff5082..fb903d4d16 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode/hashcode.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/hashcode.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package hashcode +package conns import ( "bytes" diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/mutexkv/mutexkv.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/mutexkv.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/mutexkv/mutexkv.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/mutexkv.go index 77c0013429..0615bddfd5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/mutexkv/mutexkv.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/mutexkv.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package mutexkv +package conns import ( "log" @@ -17,6 +17,10 @@ import ( // // The initial use case is to let aws_security_group_rule resources serialize // their access to individual security groups based on SG ID. + +// This is a global MutexKV for use within this plugin. +var IbmMutexKV = NewMutexKV() + type MutexKV struct { lock sync.Mutex store map[string]*sync.Mutex diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/utils.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/utils.go new file mode 100644 index 0000000000..7fefb6d9c3 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns/utils.go @@ -0,0 +1,38 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package conns + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// Used for retry logic on resource timeout. +func IsResourceTimeoutError(err error) bool { + timeoutErr, ok := err.(*resource.TimeoutError) + return ok && timeoutErr.LastError == nil +} +func GetPrivateServiceURLForRegion(region string) (string, error) { + var endpoints = map[string]string{ + "us-south": "https://private.us.icr.io", // us-south + "uk-south": "https://private.uk.icr.io", // uk-south + "eu-gb": "https://private.uk.icr.io", // eu-gb + "eu-central": "https://private.de.icr.io", // eu-central + "eu-de": "https://private.de.icr.io", // eu-de + "ap-north": "https://private.jp.icr.io", // ap-north + "jp-tok": "https://private.jp.icr.io", // jp-tok + "ap-south": "https://private.au.icr.io", // ap-south + "au-syd": "https://private.au.icr.io", // au-syd + "global": "https://private.icr.io", // global + "jp-osa": "https://private.jp2.icr.io", // jp-osa + "ca-tor": "https://private.ca.icr.io", // ca-tor + "br-sao": "https://private.br.icr.io", // br-sao + } + + if url, ok := endpoints[region]; ok { + return url, nil + } + return "", fmt.Errorf("service URL for region '%s' not found", region) +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_domain_private.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_domain_private.go deleted file mode 100644 index dc8bdeb71d..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_domain_private.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMAppDomainPrivate() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMAppDomainPrivateRead, - - Schema: map[string]*schema.Schema{ - "name": { - Description: "The name of the private domain", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func dataSourceIBMAppDomainPrivateRead(d *schema.ResourceData, meta interface{}) error { - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - domainName := d.Get("name").(string) - prdomain, err := cfAPI.PrivateDomains().FindByName(domainName) - if err != nil { - return fmt.Errorf("Error retrieving domain: %s", err) - } - d.SetId(prdomain.GUID) - return nil - -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_domain_shared.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_domain_shared.go deleted file mode 100644 index 4e9ddc0c81..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_domain_shared.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMAppDomainShared() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMAppDomainSharedRead, - - Schema: map[string]*schema.Schema{ - "name": { - Description: "The name of the shared domain", - Type: schema.TypeString, - Required: true, - ValidateFunc: validateDomainName, - }, - }, - } -} - -func dataSourceIBMAppDomainSharedRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - domainName := d.Get("name").(string) - shdomain, err := cfClient.SharedDomains().FindByName(domainName) - if err != nil { - return fmt.Errorf("Error retrieving shared domain: %s", err) - } - d.SetId(shdomain.GUID) - return nil - -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis.go deleted file mode 100644 index 14448fc3de..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "net/url" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/models" -) - -func dataSourceIBMCISInstance() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMCISInstanceRead, - - Schema: map[string]*schema.Schema{ - "name": { - Description: "Resource instance name for example, my cis instance", - Type: schema.TypeString, - Required: true, - }, - - "resource_group_id": { - Type: schema.TypeString, - Optional: true, - Description: "The id of the resource group in which the cis instance is present", - }, - - "guid": { - Type: schema.TypeString, - Computed: true, - Description: "Unique identifier of resource instance", - }, - - "location": { - Description: "The location or the environment in which cis instance exists", - Type: schema.TypeString, - Computed: true, - }, - - "service": { - Description: "The name of the Cloud Internet Services offering, 'internet-svcs'", - Type: schema.TypeString, - Computed: true, - }, - - "plan": { - Description: "The plan type of the cis instance", - Type: schema.TypeString, - Computed: true, - }, - - "status": { - Description: "The resource instance status", - Type: schema.TypeString, - Computed: true, - }, - ResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "The name of the resource", - }, - - ResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - - ResourceStatus: { - Type: schema.TypeString, - Computed: true, - Description: "The status of the resource", - }, - - ResourceGroupName: { - Type: schema.TypeString, - Computed: true, - Description: "The resource group name in which resource is provisioned", - }, - ResourceControllerURL: { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - }, - }, - } -} - -func dataSourceIBMCISInstanceRead(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerAPIV2() - if err != nil { - return err - } - rsAPI := rsConClient.ResourceServiceInstanceV2() - name := d.Get("name").(string) - - rsInstQuery := controllerv2.ServiceInstanceQuery{ - Name: name, - } - - if rsGrpID, ok := d.GetOk("resource_group_id"); ok { - rsInstQuery.ResourceGroupID = rsGrpID.(string) - } else { - defaultRg, err := defaultResourceGroup(meta) - if err != nil { - return err - } - rsInstQuery.ResourceGroupID = defaultRg - } - - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - if service, ok := d.GetOk("service"); ok { - - serviceOff, err := rsCatRepo.FindByName(service.(string), true) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - rsInstQuery.ServiceID = serviceOff[0].ID - } - - var instances []models.ServiceInstanceV2 - - instances, err = rsAPI.ListInstances(rsInstQuery) - if err != nil { - return err - } - var filteredInstances []models.ServiceInstanceV2 - var location string - - if loc, ok := d.GetOk("location"); ok { - location = loc.(string) - for _, instance := range instances { - if getLocation(instance) == location { - filteredInstances = append(filteredInstances, instance) - } - } - } else { - filteredInstances = instances - } - - if len(filteredInstances) == 0 { - return fmt.Errorf("No resource instance found with name [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) - } - - var instance models.ServiceInstanceV2 - - if len(filteredInstances) > 1 { - return fmt.Errorf( - "More than one resource instance found with name matching [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) - } - instance = filteredInstances[0] - - d.SetId(instance.ID) - d.Set("status", instance.State) - d.Set("resource_group_id", instance.ResourceGroupID) - d.Set("location", instance.RegionID) - d.Set("guid", instance.Guid) - serviceOff, err := rsCatRepo.GetServiceName(instance.ServiceID) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - d.Set("service", serviceOff) - - servicePlan, err := rsCatRepo.GetServicePlanName(instance.ResourcePlanID) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - d.Set("plan", servicePlan) - - d.Set(ResourceName, instance.Name) - d.Set(ResourceCRN, instance.Crn.String()) - d.Set(ResourceStatus, instance.State) - d.Set(ResourceGroupName, instance.ResourceGroupName) - - rcontroller, err := getBaseController(meta) - if err != nil { - return err - } - d.Set(ResourceControllerURL, rcontroller+"/internet-svcs/"+url.QueryEscape(instance.Crn.String())) - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_ip_addresses.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_ip_addresses.go deleted file mode 100644 index 10f55ea066..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_ip_addresses.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - cisIPv4CIDRs = "ipv4_cidrs" - cisIPv6CIDRs = "ipv6_cidrs" -) - -func dataSourceIBMCISIP() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMCISIPRead, - - Schema: map[string]*schema.Schema{ - cisIPv4CIDRs: { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - cisIPv6CIDRs: { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - } -} - -func dataSourceIBMCISIPRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisIPClientSession() - if err != nil { - return err - } - opt := cisClient.NewListIpsOptions() - result, response, err := cisClient.ListIps(opt) - if err != nil { - log.Printf("Failed to list IP addresses: %v", response) - return err - } - - d.Set(cisIPv4CIDRs, flattenStringList(result.Result.Ipv4Cidrs)) - d.Set(cisIPv6CIDRs, flattenStringList(result.Result.Ipv4Cidrs)) - d.SetId(dataSourceIBMCISIPID(d)) - return nil -} - -func dataSourceIBMCISIPID(d *schema.ResourceData) string { - return time.Now().UTC().String() -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_catalog.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_catalog.go deleted file mode 100644 index 1e724833d3..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_catalog.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" -) - -func dataSourceIBMCmCatalog() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMCmCatalogRead, - - Schema: map[string]*schema.Schema{ - "catalog_identifier": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "ID for catalog", - }, - "kind": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Kind of catalog, offering or vpe.", - }, - "label": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Display Name in the requested language.", - }, - "short_description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Description in the requested language.", - }, - "catalog_icon_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "URL for an icon associated with this catalog.", - }, - "tags": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "List of tags associated with this catalog.", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The url for this specific catalog.", - }, - "crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "CRN associated with the catalog.", - }, - "offerings_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "URL path to offerings.", - }, - "resource_group_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Resource Group ID", - }, - }, - } -} - -func dataSourceIBMCmCatalogRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() - if err != nil { - return diag.FromErr(err) - } - - getCatalogOptions := &catalogmanagementv1.GetCatalogOptions{} - - getCatalogOptions.SetCatalogIdentifier(d.Get("catalog_identifier").(string)) - - catalog, response, err := catalogManagementClient.GetCatalogWithContext(context, getCatalogOptions) - if err != nil { - log.Printf("[DEBUG] GetCatalogWithContext failed %s\n%s", err, response) - return diag.FromErr(err) - } - - d.SetId(*catalog.ID) - if err = d.Set("label", catalog.Label); err != nil { - return diag.FromErr(fmt.Errorf("Error setting label: %s", err)) - } - if err = d.Set("short_description", catalog.ShortDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting short_description: %s", err)) - } - if err = d.Set("catalog_icon_url", catalog.CatalogIconURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_icon_url: %s", err)) - } - if err = d.Set("tags", catalog.Tags); err != nil { - return diag.FromErr(fmt.Errorf("Error setting tags: %s", err)) - } - if err = d.Set("url", catalog.URL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting url: %s", err)) - } - if err = d.Set("crn", catalog.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) - } - if err = d.Set("offerings_url", catalog.OfferingsURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting offerings_url: %s", err)) - } - if err = d.Set("kind", catalog.Kind); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) - } - if err = d.Set("resource_group_id", catalog.ResourceGroupID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group_id: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_offering.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_offering.go deleted file mode 100644 index 6557d2b599..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_offering.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" -) - -func dataSourceIBMCmOffering() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMCmOfferingRead, - - Schema: map[string]*schema.Schema{ - "catalog_identifier": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Catalog identifier.", - ForceNew: true, - }, - "offering_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The id of the catalog containing this offering.", - ForceNew: true, - }, - "url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The url for this specific offering.", - }, - "crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The crn for this specific offering.", - }, - "label": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Display Name in the requested language.", - ForceNew: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The programmatic name of this offering.", - }, - "offering_icon_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "URL for an icon associated with this offering.", - }, - "offering_docs_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "URL for an additional docs with this offering.", - }, - "offering_support_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "URL to be displayed in the Consumption UI for getting support on this offering.", - }, - "short_description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Short description in the requested language.", - }, - "long_description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Long description in the requested language.", - }, - "permit_request_ibm_public_publish": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Is it permitted to request publishing to IBM or Public.", - }, - "ibm_publish_approved": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Indicates if this offering has been approved for use by all IBMers.", - }, - "public_publish_approved": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Indicates if this offering has been approved for use by all IBM Cloud users.", - }, - "public_original_crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The original offering CRN that this publish entry came from.", - }, - "publish_public_crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The crn of the public catalog entry of this offering.", - }, - "portal_approval_record": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The portal's approval record ID.", - }, - "portal_ui_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The portal UI URL.", - }, - "catalog_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The id of the catalog containing this offering.", - }, - "catalog_name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The name of the catalog.", - }, - "disclaimer": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "A disclaimer for this offering.", - }, - "hidden": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "Determine if this offering should be displayed in the Consumption UI.", - }, - "repo_info": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Repository info for offerings.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "token": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Token for private repos.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Public or enterprise GitHub.", - }, - }, - }, - }, - }, - } -} - -func dataSourceIBMCmOfferingRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() - if err != nil { - return diag.FromErr(err) - } - - getOfferingOptions := &catalogmanagementv1.GetOfferingOptions{} - - getOfferingOptions.SetCatalogIdentifier(d.Get("catalog_identifier").(string)) - getOfferingOptions.SetOfferingID(d.Get("offering_id").(string)) - - offering, response, err := catalogManagementClient.GetOfferingWithContext(context, getOfferingOptions) - if err != nil { - log.Printf("[DEBUG] GetOfferingWithContext failed %s\n%s", err, response) - return diag.FromErr(err) - } - - d.SetId(*offering.ID) - if err = d.Set("url", offering.URL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting url: %s", err)) - } - if err = d.Set("crn", offering.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) - } - if err = d.Set("label", offering.Label); err != nil { - return diag.FromErr(fmt.Errorf("Error setting label: %s", err)) - } - if err = d.Set("name", offering.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) - } - if err = d.Set("offering_icon_url", offering.OfferingIconURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting offering_icon_url: %s", err)) - } - if err = d.Set("offering_docs_url", offering.OfferingDocsURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting offering_docs_url: %s", err)) - } - if err = d.Set("offering_support_url", offering.OfferingSupportURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting offering_support_url: %s", err)) - } - if err = d.Set("short_description", offering.ShortDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting short_description: %s", err)) - } - if err = d.Set("long_description", offering.LongDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting long_description: %s", err)) - } - if err = d.Set("permit_request_ibm_public_publish", offering.PermitRequestIBMPublicPublish); err != nil { - return diag.FromErr(fmt.Errorf("Error setting permit_request_ibm_public_publish: %s", err)) - } - if err = d.Set("ibm_publish_approved", offering.IBMPublishApproved); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ibm_publish_approved: %s", err)) - } - if err = d.Set("public_publish_approved", offering.PublicPublishApproved); err != nil { - return diag.FromErr(fmt.Errorf("Error setting public_publish_approved: %s", err)) - } - if err = d.Set("public_original_crn", offering.PublicOriginalCRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting public_original_crn: %s", err)) - } - if err = d.Set("publish_public_crn", offering.PublishPublicCRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting publish_public_crn: %s", err)) - } - if err = d.Set("portal_approval_record", offering.PortalApprovalRecord); err != nil { - return diag.FromErr(fmt.Errorf("Error setting portal_approval_record: %s", err)) - } - if err = d.Set("portal_ui_url", offering.PortalUIURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting portal_ui_url: %s", err)) - } - if err = d.Set("catalog_id", offering.CatalogID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_id: %s", err)) - } - if err = d.Set("catalog_name", offering.CatalogName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_name: %s", err)) - } - if err = d.Set("disclaimer", offering.Disclaimer); err != nil { - return diag.FromErr(fmt.Errorf("Error setting disclaimer: %s", err)) - } - if err = d.Set("hidden", offering.Hidden); err != nil { - return diag.FromErr(fmt.Errorf("Error setting hidden: %s", err)) - } - - if offering.RepoInfo != nil { - repoInfoMap := dataSourceOfferingRepoInfoToMap(*offering.RepoInfo) - if err = d.Set("repo_info", []map[string]interface{}{repoInfoMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting repo_info %s", err)) - } - } - - return nil -} - -func dataSourceOfferingRepoInfoToMap(repoInfoItem catalogmanagementv1.RepoInfo) (repoInfoMap map[string]interface{}) { - repoInfoMap = map[string]interface{}{} - - if repoInfoItem.Token != nil { - repoInfoMap["token"] = repoInfoItem.Token - } - if repoInfoItem.Type != nil { - repoInfoMap["type"] = repoInfoItem.Type - } - - return repoInfoMap -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_offering_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_offering_instance.go deleted file mode 100644 index 3f74b9202a..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_offering_instance.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" -) - -func dataSourceIBMCmOfferingInstance() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMCmOfferingInstanceRead, - - Schema: map[string]*schema.Schema{ - "instance_identifier": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "ID for this instance", - }, - "url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "url reference to this object.", - }, - "crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "platform CRN for this instance.", - }, - "_rev": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cloudant Revision for this instance", - }, - "label": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "the label for this instance.", - }, - "catalog_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Catalog ID this instance was created from.", - }, - "offering_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Offering ID this instance was created from.", - }, - "kind_format": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "the format this instance has (helm, operator, ova...).", - }, - "version": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The version this instance was installed from (not version id).", - }, - "cluster_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster ID.", - }, - "cluster_region": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cluster region (e.g., us-south).", - }, - "cluster_namespaces": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "List of target namespaces to install into.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "cluster_all_namespaces": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "designate to install into all namespaces.", - }, - "schematics_workspace_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "id of the schematics workspace, for offerings installed through schematics", - }, - "resource_group_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "id of the resource group", - }, - "install_plan": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "install plan for the subscription of the operator- can be either Automatic or Manual. Required for operator bundles", - }, - "channel": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "channel to target for the operator subscription. Required for operator bundles", - }, - }, - } -} - -func dataSourceIBMCmOfferingInstanceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() - if err != nil { - return diag.FromErr(err) - } - - getOfferingInstanceOptions := &catalogmanagementv1.GetOfferingInstanceOptions{} - - getOfferingInstanceOptions.SetInstanceIdentifier(d.Get("instance_identifier").(string)) - - offeringInstance, response, err := catalogManagementClient.GetOfferingInstanceWithContext(context, getOfferingInstanceOptions) - if err != nil { - log.Printf("[DEBUG] GetOfferingInstanceWithContext failed %s\n%s", err, response) - return diag.FromErr(err) - } - - d.SetId(*offeringInstance.ID) - - if err = d.Set("url", offeringInstance.URL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting url: %s", err)) - } - if err = d.Set("crn", offeringInstance.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) - } - if err = d.Set("_rev", offeringInstance.Rev); err != nil { - return diag.FromErr(fmt.Errorf("Error setting _rev: %s", err)) - } - if err = d.Set("label", offeringInstance.Label); err != nil { - return diag.FromErr(fmt.Errorf("Error setting label: %s", err)) - } - if err = d.Set("catalog_id", offeringInstance.CatalogID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_id: %s", err)) - } - if err = d.Set("offering_id", offeringInstance.OfferingID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting offering_id: %s", err)) - } - if err = d.Set("kind_format", offeringInstance.KindFormat); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kind_format: %s", err)) - } - if err = d.Set("version", offeringInstance.Version); err != nil { - return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) - } - if err = d.Set("cluster_id", offeringInstance.ClusterID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cluster_id: %s", err)) - } - if err = d.Set("cluster_region", offeringInstance.ClusterRegion); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cluster_region: %s", err)) - } - if err = d.Set("cluster_namespaces", offeringInstance.ClusterNamespaces); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cluster_namespaces: %s", err)) - } - if err = d.Set("cluster_all_namespaces", offeringInstance.ClusterAllNamespaces); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cluster_all_namespaces: %s", err)) - } - if err = d.Set("schematics_workspace_id", offeringInstance.SchematicsWorkspaceID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting schematics_workspace_id: %s", err)) - } - if err = d.Set("resource_group_id", offeringInstance.ResourceGroupID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group_id: %s", err)) - } - if err = d.Set("install_plan", offeringInstance.InstallPlan); err != nil { - return diag.FromErr(fmt.Errorf("Error setting install_plan: %s", err)) - } - if err = d.Set("channel", offeringInstance.Channel); err != nil { - return diag.FromErr(fmt.Errorf("Error setting channel: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_version.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_version.go deleted file mode 100644 index 4069b9a88c..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cm_version.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" -) - -func dataSourceIBMCmVersion() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMCmVersionRead, - - Schema: map[string]*schema.Schema{ - "version_loc_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Catalog identifier.", - }, - "crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Version's CRN.", - }, - "version": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Version of content type.", - }, - "sha": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "hash of the content.", - }, - "catalog_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Catalog ID.", - }, - "repo_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Content's repo URL.", - }, - "source_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Content's source URL (e.g git repo).", - }, - "tgz_url": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "File used to on-board this version.", - }, - }, - } -} - -func dataSourceIBMCmVersionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() - if err != nil { - return diag.FromErr(err) - } - - getVersionOptions := &catalogmanagementv1.GetVersionOptions{} - - getVersionOptions.SetVersionLocID(d.Get("version_loc_id").(string)) - - offering, response, err := catalogManagementClient.GetVersionWithContext(context, getVersionOptions) - version := offering.Kinds[0].Versions[0] - - if err != nil { - log.Printf("[DEBUG] GetVersionWithContext failed %s\n%s", err, response) - return diag.FromErr(err) - } - - d.SetId(*version.VersionLocator) - if err = d.Set("crn", version.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) - } - if err = d.Set("version", version.Version); err != nil { - return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) - } - if err = d.Set("sha", version.Sha); err != nil { - return diag.FromErr(fmt.Errorf("Error setting sha: %s", err)) - } - if err = d.Set("catalog_id", version.CatalogID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_id: %s", err)) - } - if err = d.Set("repo_url", version.RepoURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting repo_url: %s", err)) - } - if err = d.Set("source_url", version.SourceURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_url: %s", err)) - } - if err = d.Set("tgz_url", version.TgzURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting tgz_url: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_nlb_dns.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_nlb_dns.go deleted file mode 100644 index 38a2945e04..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_nlb_dns.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - - "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMContainerNLBDNS() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMContainerNLBDNSRead, - - Schema: map[string]*schema.Schema{ - "cluster": { - Type: schema.TypeString, - Required: true, - Description: "A unique name of the cluster", - }, - "nlb_config": { - Type: schema.TypeList, - Computed: true, - Description: "List of nlb config of cluster", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "secret_name": { - Type: schema.TypeString, - Computed: true, - Description: "Name of the secret.", - }, - "secret_status": { - Type: schema.TypeString, - Computed: true, - Description: "Status of Secret.", - }, - "cluster": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster Id.", - }, - "dns_type": { - Type: schema.TypeString, - Computed: true, - Description: "Type of DNS.", - }, - "lb_hostname": { - Type: schema.TypeString, - Computed: true, - Description: "Host Name of load Balancer.", - }, - "nlb_ips": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: " NLB IPs.", - }, - "nlb_sub_domain": { - Type: schema.TypeString, - Computed: true, - Description: "NLB Sub-Domain.", - }, - "type": { - Type: schema.TypeString, - Computed: true, - Description: " Nlb Type.", - }, - "secret_namespace": { - Type: schema.TypeString, - Computed: true, - Description: "Namespace of Secret.", - }, - }, - }, - }, - }, - } -} - -func dataSourceIBMContainerNLBDNSRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - - name := d.Get("cluster").(string) - - kubeClient, err := meta.(ClientSession).VpcContainerAPI() - if err != nil { - return diag.FromErr(err) - } - - nlbData, err := kubeClient.NlbDns().GetNLBDNSList(name) - if err != nil || nlbData == nil || len(nlbData) < 1 { - return diag.FromErr(fmt.Errorf("[ERROR] Error Listing NLB DNS (%s): %s", name, err)) - } - d.SetId(name) - d.Set("cluster", name) - d.Set("nlb_config", flattenNlbConfigs(nlbData)) - return nil -} -func flattenNlbConfigs(nlbData []containerv2.NlbVPCListConfig) []map[string]interface{} { - nlbConfigList := make([]map[string]interface{}, 0) - for _, n := range nlbData { - nlbConfig := make(map[string]interface{}) - nlbConfig["secret_name"] = n.SecretName - nlbConfig["secret_status"] = n.SecretStatus - c := n.Nlb - nlbConfig["cluster"] = c.Cluster - nlbConfig["dns_type"] = c.DnsType - nlbConfig["lb_hostname"] = c.LbHostname - nlbConfig["nlb_ips"] = c.NlbIPArray - nlbConfig["nlb_sub_domain"] = c.NlbSubdomain - nlbConfig["secret_namespace"] = c.SecretNamespace - nlbConfig["type"] = c.Type - nlbConfigList = append(nlbConfigList, nlbConfig) - } - - return nlbConfigList -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_domain.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_domain.go deleted file mode 100644 index c2738ed3ad..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_domain.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/softlayer/softlayer-go/filter" - "github.com/softlayer/softlayer-go/services" -) - -func dataSourceIBMDNSDomain() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMDNSDomainRead, - - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Description: "A domain record's internal identifier", - Type: schema.TypeInt, - Computed: true, - }, - - "name": &schema.Schema{ - Description: "The name of the domain", - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func dataSourceIBMDNSDomainRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() - service := services.GetAccountService(sess) - - name := d.Get("name").(string) - - names, err := service. - Filter(filter.Build(filter.Path("domains.name").Eq(name))). - Mask("id,name"). - GetDomains() - - if err != nil { - return fmt.Errorf("Error retrieving domain: %s", err) - } - - if len(names) == 0 { - return fmt.Errorf("No domain found with name [%s]", name) - } - - d.SetId(fmt.Sprintf("%d", *names[0].Id)) - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_access_group_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_access_group_policy.go deleted file mode 100644 index 13517ad7e5..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_access_group_policy.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -// Data source to find all the policies for an access group in a particular account -func dataSourceIBMIAMAccessGroupPolicy() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMIAMAccessGroupPolicyRead, - - Schema: map[string]*schema.Schema{ - "access_group_id": { - Description: "ID of access group", - Type: schema.TypeString, - Required: true, - }, - "sort": { - Description: "Sort query for policies", - Type: schema.TypeString, - Optional: true, - }, - "policies": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "roles": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "Role names of the policy definition", - }, - "resources": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "service": { - Type: schema.TypeString, - Computed: true, - Description: "Service name of the policy definition", - }, - "resource_instance_id": { - Type: schema.TypeString, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "ID of resource instance of the policy definition", - }, - "region": { - Type: schema.TypeString, - Computed: true, - Description: "Region of the policy definition", - }, - "resource_type": { - Type: schema.TypeString, - Computed: true, - Description: "Resource type of the policy definition", - }, - "resource": { - Type: schema.TypeString, - Computed: true, - Description: "Resource of the policy definition", - }, - "resource_group_id": { - Type: schema.TypeString, - Computed: true, - Description: "ID of the resource group.", - }, - "service_type": { - Type: schema.TypeString, - Optional: true, - Description: "Service type of the policy definition", - }, - }, - }, - }, - "description": { - Type: schema.TypeString, - Computed: true, - Description: "Description of the Policy", - }, - }, - }, - }, - }, - } -} - -func dataSourceIBMIAMAccessGroupPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - accessGroupId := d.Get("access_group_id").(string) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - accountID := userDetails.userAccount - - listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ - AccountID: core.StringPtr(accountID), - AccessGroupID: core.StringPtr(accessGroupId), - Type: core.StringPtr("access"), - } - - if v, ok := d.GetOk("sort"); ok { - listPoliciesOptions.Sort = core.StringPtr(v.(string)) - } - - policyList, _, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) - policies := policyList.Policies - - if err != nil { - return err - } - - accessGroupPolicies := make([]map[string]interface{}, 0, len(policies)) - for _, policy := range policies { - roles := make([]string, len(policy.Roles)) - for i, role := range policy.Roles { - roles[i] = *role.DisplayName - } - resources := flattenPolicyResource(policy.Resources) - p := map[string]interface{}{ - "id": fmt.Sprintf("%s/%s", accessGroupId, *policy.ID), - "roles": roles, - "resources": resources, - } - if policy.Description != nil { - p["description"] = policy.Description - } - accessGroupPolicies = append(accessGroupPolicies, p) - } - d.SetId(accessGroupId) - d.Set("policies", accessGroupPolicies) - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_api_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_api_key.go deleted file mode 100644 index 1ab7b158ed..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_api_key.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/platform-services-go-sdk/iamidentityv1" -) - -func dataSourceIbmIamApiKey() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIbmIamApiKeyRead, - - Schema: map[string]*schema.Schema{ - "apikey_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Unique ID of the API key.", - }, - "entity_tag": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.", - }, - "crn": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'.", - }, - "locked": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "The API key cannot be changed if set to true.", - }, - "created_at": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "If set contains a date time string of the creation date in ISO format.", - }, - "created_by": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "IAM ID of the user or service which created the API key.", - }, - "modified_at": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "If set contains a date time string of the last modification date in ISO format.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", - }, - "iam_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The iam_id that this API key authenticates.", - }, - "account_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "ID of the account that this API key authenticates for.", - }, - }, - } -} - -func dataSourceIbmIamApiKeyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() - if err != nil { - return diag.FromErr(err) - } - - getApiKeyOptions := &iamidentityv1.GetAPIKeyOptions{} - - getApiKeyOptions.SetID(d.Get("apikey_id").(string)) - - apiKey, response, err := iamIdentityClient.GetAPIKey(getApiKeyOptions) - if err != nil { - log.Printf("[DEBUG] GetApiKey failed %s\n%s", err, response) - return diag.FromErr(err) - } - - d.SetId(*apiKey.ID) - - if err = d.Set("entity_tag", apiKey.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) - } - if err = d.Set("crn", apiKey.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) - } - if err = d.Set("locked", apiKey.Locked); err != nil { - return diag.FromErr(fmt.Errorf("Error setting locked: %s", err)) - } - if err = d.Set("created_at", apiKey.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) - } - if err = d.Set("created_by", apiKey.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) - } - if err = d.Set("modified_at", apiKey.ModifiedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) - } - if err = d.Set("name", apiKey.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) - } - if err = d.Set("description", apiKey.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) - } - if err = d.Set("iam_id", apiKey.IamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting iam_id: %s", err)) - } - if err = d.Set("account_id", apiKey.AccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_roles.go deleted file mode 100644 index 5c8e64dcd0..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_roles.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func datasourceIBMIAMRole() *schema.Resource { - return &schema.Resource{ - Read: datasourceIBMIAMRoleRead, - - Schema: map[string]*schema.Schema{ - "service": { - Type: schema.TypeString, - Optional: true, - Description: "The Service Name", - ForceNew: true, - }, - "roles": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Computed: true, - }, - "type": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - }, - } - -} - -func datasourceIBMIAMRoleRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - var serviceName string - var customRoles []iampolicymanagementv1.CustomRole - var serviceRoles, systemRoles []iampolicymanagementv1.Role - - listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ - AccountID: &userDetails.userAccount, - } - - if service, ok := d.GetOk("service"); ok { - serviceName = service.(string) - listRoleOptions.ServiceName = &serviceName - } - roleList, _, err := iamPolicyManagementClient.ListRoles(listRoleOptions) - if err != nil { - return err - } - customRoles = roleList.CustomRoles - serviceRoles = roleList.ServiceRoles - systemRoles = roleList.SystemRoles - - d.SetId(userDetails.userAccount) - - var roles []map[string]string - - roles = append(flattenRoleData(systemRoles, "platform"), append(flattenRoleData(serviceRoles, "service"), flattenCustomRoleData(customRoles, "custom")...)...) - - d.Set("roles", roles) - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_user_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_user_policy.go deleted file mode 100644 index f7b3ba788e..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_user_policy.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -// Data source to find all the policies for a user in a particular account -func dataSourceIBMIAMUserPolicy() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMIAMUserPolicyRead, - - Schema: map[string]*schema.Schema{ - "ibm_id": { - Description: "The ibm id or email of user", - Type: schema.TypeString, - Required: true, - }, - "sort": { - Description: "Sort query for policies", - Type: schema.TypeString, - Optional: true, - }, - "policies": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "roles": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "Role names of the policy definition", - }, - "resources": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "service": { - Type: schema.TypeString, - Computed: true, - Description: "Service name of the policy definition", - }, - "resource_instance_id": { - Type: schema.TypeString, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "ID of resource instance of the policy definition", - }, - "region": { - Type: schema.TypeString, - Computed: true, - Description: "Region of the policy definition", - }, - "resource_type": { - Type: schema.TypeString, - Computed: true, - Description: "Resource type of the policy definition", - }, - "resource": { - Type: schema.TypeString, - Computed: true, - Description: "Resource of the policy definition", - }, - "resource_group_id": { - Type: schema.TypeString, - Computed: true, - Description: "ID of the resource group.", - }, - "service_type": { - Type: schema.TypeString, - Optional: true, - Description: "Service type of the policy definition", - }, - }, - }, - }, - "description": { - Type: schema.TypeString, - Computed: true, - Description: "Description of the Policy", - }, - }, - }, - }, - }, - } -} - -func dataSourceIBMIAMUserPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - userEmail := d.Get("ibm_id").(string) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - accountID := userDetails.userAccount - - ibmUniqueID, err := getIBMUniqueId(accountID, userEmail, meta) - if err != nil { - return err - } - - listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ - AccountID: core.StringPtr(accountID), - IamID: core.StringPtr(ibmUniqueID), - Type: core.StringPtr("access"), - } - - if v, ok := d.GetOk("sort"); ok { - listPoliciesOptions.Sort = core.StringPtr(v.(string)) - } - - policyList, _, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) - policies := policyList.Policies - if err != nil { - return err - } - - if err != nil { - return err - } - - userPolicies := make([]map[string]interface{}, 0, len(policies)) - for _, policy := range policies { - roles := make([]string, len(policy.Roles)) - for i, role := range policy.Roles { - roles[i] = *role.DisplayName - } - resources := flattenPolicyResource(policy.Resources) - p := map[string]interface{}{ - "id": fmt.Sprintf("%s/%s", userEmail, *policy.ID), - "roles": roles, - "resources": resources, - } - if policy.Description != nil { - p["description"] = policy.Description - } - userPolicies = append(userPolicies, p) - } - d.SetId(userEmail) - d.Set("policies", userPolicies) - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_endpoint_gateway_targets.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_endpoint_gateway_targets.go deleted file mode 100644 index 398de8ad48..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_endpoint_gateway_targets.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - "net/url" - "strconv" - "strings" - "time" - - "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - isVPEResources = "resources" - isVPEResourceCRN = "crn" - isVPEResourceParent = "parent" - isVPEResourceName = "name" - isVPEResourceEndpointType = "endpoint_type" - isVPEResourceType = "resource_type" - isVPEResourceFullQualifiedDomainNames = "full_qualified_domain_names" - isVPEResourceServiceLocation = "location" -) - -func dataSourceIBMISEndpointGatewayTargets() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMISEndpointGatewayTargetsRead, - - Schema: map[string]*schema.Schema{ - isVPEResources: { - Type: schema.TypeList, - Computed: true, - Description: "List of resources", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - isVPEResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "CRN for this specific object", - }, - isVPEResourceParent: { - Type: schema.TypeString, - Computed: true, - Description: "Parent for this specific object", - }, - isVPEResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "Display name in the requested language", - }, - isVPEResourceType: { - Type: schema.TypeString, - Computed: true, - Description: "Resource type of this offering.", - }, - isVPEResourceEndpointType: { - Type: schema.TypeString, - Computed: true, - Description: "Data endpoint type of this offering", - }, - isVPEResourceFullQualifiedDomainNames: { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "Fully qualified domain names", - }, - isVPEResourceServiceLocation: { - Type: schema.TypeString, - Computed: true, - Description: "Service location of this offering", - }, - }, - }, - }, - }, - } -} - -func dataSourceIBMISEndpointGatewayTargetsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - bmxSess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return diag.FromErr(err) - } - region := bmxSess.Config.Region - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() - if err != nil { - return diag.FromErr(err) - } - - getCatalogOptions := &catalogmanagementv1.SearchObjectsOptions{} - // query := "kind%3Avpe+AND+svc+AND+parent_id%3Aus-south" - query := fmt.Sprintf("kind:vpe AND svc AND parent_id:%s", region) - getCatalogOptions.Query = &query - digest := false - getCatalogOptions.Digest = &digest - - start := int64(0) - catalog := []catalogmanagementv1.CatalogObject{} - for { - if start != int64(0) { - getCatalogOptions.Offset = &start - } - search, response, err := catalogManagementClient.SearchObjectsWithContext(context, getCatalogOptions) - if err != nil { - log.Printf("[DEBUG] GetCatalogWithContext failed %s\n%s", err, response) - return diag.FromErr(err) - } - next := search.Next - if next == nil { - start = int64(0) - } else { - u, _ := url.Parse(fmt.Sprintf("%s", *next)) - q := u.Query() - start, _ = strconv.ParseInt(q.Get("offset"), 10, 64) - } - catalog = append(catalog, search.Resources...) - if start == int64(0) { - break - } - } - if catalog != nil { - resourceInfo := make([]map[string]interface{}, 0) - for _, res := range catalog { - l := map[string]interface{}{} - if res.ParentID != nil { - l[isVPEResourceParent] = *res.ParentID - } - l[isVPEResourceName] = "provider_cloud_service" - if res.Label != nil { - l[isVPEResourceType] = *res.Label - } - sl := "" - data := res.Data - if data != nil { - if serviceCrn, ok := data["service_crn"].(string); ok { - if serviceCrn != "" { - l[isVPEResourceCRN] = serviceCrn - crnFs := strings.Split(serviceCrn, ":") - if len(crnFs) > 5 { - sl = crnFs[5] - } - l[isVPEResourceServiceLocation] = sl - } - } - if data["endpoint_type"] != nil { - l[isVPEResourceEndpointType] = data["endpoint_type"] - } - if data["fully_qualified_domain_names"] != nil { - l[isVPEResourceFullQualifiedDomainNames] = data["fully_qualified_domain_names"] - } - } - resourceInfo = append(resourceInfo, l) - } - d.Set(isVPEResources, resourceInfo) - d.SetId(dataSourceIBMISEndpointGatewayTargetsId(d)) - } - return nil -} -func dataSourceIBMISEndpointGatewayTargetsId(d *schema.ResourceData) string { - return time.Now().UTC().String() -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet.go deleted file mode 100644 index 370e3f390b..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - - "github.com/IBM/vpc-go-sdk/vpcv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMISSubnet() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMISSubnetRead, - - Schema: map[string]*schema.Schema{ - - "identifier": { - Type: schema.TypeString, - Optional: true, - ExactlyOneOf: []string{isSubnetName, "identifier"}, - ValidateFunc: InvokeDataSourceValidator("ibm_is_subnet", "identifier"), - }, - - isSubnetIpv4CidrBlock: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetAvailableIpv4AddressCount: { - Type: schema.TypeInt, - Computed: true, - }, - - isSubnetTotalIpv4AddressCount: { - Type: schema.TypeInt, - Computed: true, - }, - - isSubnetName: { - Type: schema.TypeString, - Computed: true, - Optional: true, - ExactlyOneOf: []string{isSubnetName, "identifier"}, - ValidateFunc: InvokeDataSourceValidator("ibm_is_subnet", isSubnetName), - }, - - isSubnetTags: { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, - Description: "List of tags", - }, - - isSubnetAccessTags: { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, - Description: "List of access tags", - }, - - isSubnetCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - - isSubnetNetworkACL: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetPublicGateway: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetStatus: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetVPC: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetVPCName: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetZone: { - Type: schema.TypeString, - Computed: true, - }, - - isSubnetResourceGroup: { - Type: schema.TypeString, - Computed: true, - }, - - ResourceControllerURL: { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", - }, - - ResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "The name of the resource", - }, - - ResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - - ResourceStatus: { - Type: schema.TypeString, - Computed: true, - Description: "The status of the resource", - }, - - ResourceGroupName: { - Type: schema.TypeString, - Computed: true, - Description: "The resource group name in which resource is provisioned", - }, - }, - } -} - -func dataSourceIBMISSubnetValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "identifier", - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: isSubnetName, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) - - ibmISSubnetDataSourceValidator := ResourceValidator{ResourceName: "ibm_is_subnet", Schema: validateSchema} - return &ibmISSubnetDataSourceValidator -} - -func dataSourceIBMISSubnetRead(d *schema.ResourceData, meta interface{}) error { - err := subnetGetByNameOrID(d, meta) - if err != nil { - return err - } - return nil -} - -func subnetGetByNameOrID(d *schema.ResourceData, meta interface{}) error { - sess, err := vpcClient(meta) - if err != nil { - return err - } - var subnet *vpcv1.Subnet - if v, ok := d.GetOk("identifier"); ok { - id := v.(string) - getSubnetOptions := &vpcv1.GetSubnetOptions{ - ID: &id, - } - subnetinfo, response, err := sess.GetSubnet(getSubnetOptions) - if err != nil { - return fmt.Errorf("Error Getting Subnet (%s): %s\n%s", id, err, response) - } - subnet = subnetinfo - } else if v, ok := d.GetOk(isSubnetName); ok { - name := v.(string) - start := "" - allrecs := []vpcv1.Subnet{} - getSubnetsListOptions := &vpcv1.ListSubnetsOptions{} - - for { - if start != "" { - getSubnetsListOptions.Start = &start - } - subnetsCollection, response, err := sess.ListSubnets(getSubnetsListOptions) - if err != nil { - return fmt.Errorf("Error Fetching subnets List %s\n%s", err, response) - } - start = GetNext(subnetsCollection.Next) - allrecs = append(allrecs, subnetsCollection.Subnets...) - if start == "" { - break - } - } - - for _, subnetInfo := range allrecs { - if *subnetInfo.Name == name { - subnet = &subnetInfo - break - } - } - if subnet == nil { - return fmt.Errorf("No subnet found with name (%s)", name) - } - } - - d.SetId(*subnet.ID) - d.Set(isSubnetName, *subnet.Name) - d.Set(isSubnetIpv4CidrBlock, *subnet.Ipv4CIDRBlock) - d.Set(isSubnetAvailableIpv4AddressCount, *subnet.AvailableIpv4AddressCount) - d.Set(isSubnetTotalIpv4AddressCount, *subnet.TotalIpv4AddressCount) - if subnet.NetworkACL != nil { - d.Set(isSubnetNetworkACL, *subnet.NetworkACL.ID) - } - if subnet.PublicGateway != nil { - d.Set(isSubnetPublicGateway, *subnet.PublicGateway.ID) - } else { - d.Set(isSubnetPublicGateway, nil) - } - d.Set(isSubnetStatus, *subnet.Status) - d.Set(isSubnetZone, *subnet.Zone.Name) - d.Set(isSubnetVPC, *subnet.VPC.ID) - d.Set(isSubnetVPCName, *subnet.VPC.Name) - - controller, err := getBaseController(meta) - if err != nil { - return err - } - - tags, err := GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isUserTagType) - if err != nil { - log.Printf( - "An error occured during reading of subnet (%s) tags : %s", d.Id(), err) - } - - accesstags, err := GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isAccessTagType) - if err != nil { - log.Printf( - "Error on get of resource subnet (%s) access tags: %s", d.Id(), err) - } - - d.Set(isSubnetTags, tags) - d.Set(isSubnetAccessTags, accesstags) - d.Set(isSubnetCRN, *subnet.CRN) - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/subnets") - d.Set(ResourceName, *subnet.Name) - d.Set(ResourceCRN, *subnet.CRN) - d.Set(ResourceStatus, *subnet.Status) - if subnet.ResourceGroup != nil { - d.Set(isSubnetResourceGroup, *subnet.ResourceGroup.ID) - d.Set(ResourceGroupName, *subnet.ResourceGroup.Name) - } - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_push_notification_chrome.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_push_notification_chrome.go deleted file mode 100644 index 7e838b268d..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_push_notification_chrome.go +++ /dev/null @@ -1,63 +0,0 @@ -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/IBM/push-notifications-go-sdk/pushservicev1" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMPNApplicationChrome() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceApplicationChromeRead, - - Schema: map[string]*schema.Schema{ - "guid": { - Type: schema.TypeString, - Required: true, - Description: "Unique guid of the application using the push service.", - }, - "server_key": { - Type: schema.TypeString, - Computed: true, - Description: "A server key that gives the push service an authorized access to Google services that is used for Chrome Web Push.", - }, - "web_site_url": { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", - }, - }, - } -} - -func dataSourceApplicationChromeRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - pushServiceClient, err := meta.(ClientSession).PushServiceV1() - if err != nil { - return diag.FromErr(err) - } - - getChromeWebConfOptions := &pushservicev1.GetChromeWebConfOptions{} - - guid := d.Get("guid").(string) - getChromeWebConfOptions.SetApplicationID(guid) - - chromeWebConf, response, err := pushServiceClient.GetChromeWebConfWithContext(context, getChromeWebConfOptions) - if err != nil { - log.Printf("[DEBUG] GetChromeWebConfWithContext failed %s\n%d", err, response.StatusCode) - return diag.FromErr(err) - } - - d.SetId(guid) - if err = d.Set("server_key", chromeWebConf.ApiKey); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_key: %s", err)) - } - if err = d.Set("web_site_url", chromeWebConf.WebSiteURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting web_site_url: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_instance.go deleted file mode 100644 index af871394d7..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_instance.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" - "github.com/IBM-Cloud/bluemix-go/models" -) - -func dataSourceIBMResourceInstance() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMResourceInstanceRead, - - Schema: map[string]*schema.Schema{ - "name": { - Description: "Resource instance name for example, myobjectstorage", - Type: schema.TypeString, - Required: true, - }, - - "resource_group_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "The id of the resource group in which the instance is present", - }, - - "location": { - Description: "The location or the environment in which instance exists", - Optional: true, - Type: schema.TypeString, - Computed: true, - }, - - "service": { - Description: "The service type of the instance", - Optional: true, - Type: schema.TypeString, - Computed: true, - }, - - "plan": { - Description: "The plan type of the instance", - Type: schema.TypeString, - Computed: true, - }, - - "status": { - Description: "The resource instance status", - Type: schema.TypeString, - Computed: true, - }, - - "crn": { - Type: schema.TypeString, - Computed: true, - Description: "CRN of resource instance", - }, - "tags": { - Type: schema.TypeSet, - Computed: true, - Description: "Tags of Resource Instance", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "guid": { - Type: schema.TypeString, - Computed: true, - Description: "Guid of resource instance", - }, - - ResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "The name of the resource", - }, - - ResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - - ResourceStatus: { - Type: schema.TypeString, - Computed: true, - Description: "The status of the resource", - }, - - ResourceGroupName: { - Type: schema.TypeString, - Computed: true, - Description: "The resource group name in which resource is provisioned", - }, - ResourceControllerURL: { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - }, - - "extensions": { - Type: schema.TypeMap, - Computed: true, - Description: "The extended metadata as a map associated with the resource instance.", - }, - }, - } -} - -func dataSourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerAPIV2() - if err != nil { - return err - } - rsAPI := rsConClient.ResourceServiceInstanceV2() - name := d.Get("name").(string) - - rsInstQuery := controllerv2.ServiceInstanceQuery{ - Name: name, - } - - if rsGrpID, ok := d.GetOk("resource_group_id"); ok { - rsInstQuery.ResourceGroupID = rsGrpID.(string) - } else { - defaultRg, err := defaultResourceGroup(meta) - if err != nil { - return err - } - rsInstQuery.ResourceGroupID = defaultRg - } - - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - if service, ok := d.GetOk("service"); ok { - - serviceOff, err := rsCatRepo.FindByName(service.(string), true) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - rsInstQuery.ServiceID = serviceOff[0].ID - } - - var instances []models.ServiceInstanceV2 - - instances, err = rsAPI.ListInstances(rsInstQuery) - if err != nil { - return err - } - var filteredInstances []models.ServiceInstanceV2 - var location string - - if loc, ok := d.GetOk("location"); ok { - location = loc.(string) - for _, instance := range instances { - if getLocation(instance) == location { - filteredInstances = append(filteredInstances, instance) - } - } - } else { - filteredInstances = instances - } - - if len(filteredInstances) == 0 { - return fmt.Errorf("No resource instance found with name [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) - } - - var instance models.ServiceInstanceV2 - - if len(filteredInstances) > 1 { - return fmt.Errorf( - "More than one resource instance found with name matching [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) - } - instance = filteredInstances[0] - - d.SetId(instance.ID) - d.Set("status", instance.State) - d.Set("resource_group_id", instance.ResourceGroupID) - d.Set("location", instance.RegionID) - serviceOff, err := rsCatRepo.GetServiceName(instance.ServiceID) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - d.Set("service", serviceOff) - - d.Set(ResourceName, instance.Name) - d.Set(ResourceCRN, instance.Crn.String()) - d.Set(ResourceStatus, instance.State) - d.Set(ResourceGroupName, instance.ResourceGroupName) - d.Set("guid", instance.Guid) - if len(instance.Extensions) == 0 { - d.Set("extensions", instance.Extensions) - } else { - d.Set("extensions", Flatten(instance.Extensions)) - } - - rcontroller, err := getBaseController(meta) - if err != nil { - return err - } - d.Set(ResourceControllerURL, rcontroller+"/services/") - - servicePlan, err := rsCatRepo.GetServicePlanName(instance.ResourcePlanID) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - d.Set("plan", servicePlan) - d.Set("crn", instance.Crn.String()) - tags, err := GetTagsUsingCRN(meta, instance.Crn.String()) - if err != nil { - log.Printf( - "Error on get of resource instance tags (%s) tags: %s", d.Id(), err) - } - d.Set("tags", tags) - - return nil -} - -func getLocation(instance models.ServiceInstanceV2) string { - region := instance.Crn.Region - cName := instance.Crn.CName - if cName == "bluemix" || cName == "staging" { - return region - } else { - return cName + "-" + region - } -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_tag.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_tag.go deleted file mode 100644 index e6f3f3b927..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_tag.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMResourceTag() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMResourceTagRead, - - Schema: map[string]*schema.Schema{ - "resource_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: InvokeValidator("ibm_resource_tag", resourceID), - Description: "CRN of the resource on which the tags should be attached", - }, - "tags": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_resource_tag", tags)}, - Set: resourceIBMVPCHash, - Description: "List of tags associated with resource instance", - }, - "resource_type": { - Type: schema.TypeString, - Optional: true, - Description: "Resource type on which the tags should be fetched", - }, - "tag_type": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: InvokeValidator("ibm_resource_tag", "tag_type"), - Description: "Tag type on which the tags should be fetched", - Default: "user", - }, - }, - } -} - -func dataSourceIBMResourceTagRead(d *schema.ResourceData, meta interface{}) error { - var rID, rType string - - if r, ok := d.GetOk("resource_id"); ok && r != nil { - rID = r.(string) - } - if v, ok := d.GetOk(resourceType); ok && v != nil { - rType = v.(string) - } - tType := "" - if t, ok := d.GetOk("tag_type"); ok && t != nil { - tType = t.(string) - } - - tags, err := GetGlobalTagsUsingCRN(meta, rID, rType, tType) - if err != nil { - return fmt.Errorf( - "Error on get of resource tags (%s) tags: %s", d.Id(), err) - } - - d.SetId(time.Now().UTC().String()) - d.Set("resource_id", rID) - d.Set("resource_type", rType) - d.Set("tags", tags) - d.Set("tag_type", tType) - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_host_script.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_host_script.go deleted file mode 100644 index e3be012c8c..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_host_script.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "io/ioutil" - "log" - "path/filepath" - "strings" - "time" - - "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - homedir "github.com/mitchellh/go-homedir" -) - -func dataSourceIBMSatelliteAttachHostScript() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMSatelliteAttachHostScriptRead, - - Schema: map[string]*schema.Schema{ - "location": { - Type: schema.TypeString, - Required: true, - Description: "A unique name for the new Satellite location", - }, - "description": { - Type: schema.TypeString, - Computed: true, - Description: "A unique name for the new Satellite location", - }, - "labels": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Description: "List of labels for the attach host", - }, - "host_provider": { - Type: schema.TypeString, - Required: true, - }, - "script_dir": { - Description: "The directory where the satellite attach host script to be downloaded. Default is home directory", - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "script_path": { - Description: "The absolute path to the generated host script file", - Type: schema.TypeString, - Computed: true, - }, - "host_script": { - Type: schema.TypeString, - Computed: true, - Description: "Attach host script content", - }, - }, - } -} - -func dataSourceIBMSatelliteAttachHostScriptRead(d *schema.ResourceData, meta interface{}) error { - var scriptDir string - location := d.Get("location").(string) - hostProvider := d.Get("host_provider").(string) - - if _, ok := d.GetOk("script_dir"); ok { - scriptDir = d.Get("script_dir").(string) - } - - satClient, err := meta.(ClientSession).SatelliteClientSession() - if err != nil { - return err - } - - var locData *kubernetesserviceapiv1.MultishiftGetController - var response *core.DetailedResponse - getSatLocOptions := &kubernetesserviceapiv1.GetSatelliteLocationOptions{ - Controller: &location, - } - - err = resource.Retry(1*time.Minute, func() *resource.RetryError { - locData, response, err = satClient.GetSatelliteLocation(getSatLocOptions) - if err != nil || locData == nil { - if response != nil && response.StatusCode == 404 { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - - if isResourceTimeoutError(err) { - locData, response, err = satClient.GetSatelliteLocation(getSatLocOptions) - } - if err != nil || locData == nil { - return fmt.Errorf("Error getting Satellite location (%s): %s\n%s", location, err, response) - } - - // script labels - labels := make(map[string]string) - if v, ok := d.GetOk("labels"); ok { - l := v.(*schema.Set) - labels = flattenHostLabels(l.List()) - d.Set("labels", l) - } - - if len(scriptDir) == 0 { - scriptDir, err = homedir.Dir() - if err != nil { - return fmt.Errorf("Error fetching homedir: %s", err) - } - } - scriptDir, _ = filepath.Abs(scriptDir) - scriptPath := filepath.Join(scriptDir, "addHost.sh") - - //Generate script - createRegOptions := &kubernetesserviceapiv1.AttachSatelliteHostOptions{} - createRegOptions.Controller = locData.ID - createRegOptions.Labels = labels - - resp, err := satClient.AttachSatelliteHost(createRegOptions) - if err != nil { - return fmt.Errorf("Error Generating Satellite Registration Script: %s\n%s", err, resp) - } - - lines := strings.Split(string(resp), "\n") - for i, line := range lines { - if strings.Contains(line, "API_URL=") { - i = i + 1 - if strings.ToLower(hostProvider) == "aws" { - lines[i] = "yum update -y\nyum-config-manager --enable '*'\nyum repolist all\nyum install container-selinux -y" - } else if strings.ToLower(hostProvider) == "ibm" { - lines[i] = "subscription-manager refresh\nsubscription-manager repos --enable=*\n" - } else if strings.ToLower(hostProvider) == "azure" { - lines[i] = fmt.Sprintf(`yum update --disablerepo=* --enablerepo="*microsoft*" -y -yum-config-manager --enable '*' -yum repolist all -yum install container-selinux -y - `) - } else if strings.ToLower(hostProvider) == "google" { - lines[i] = fmt.Sprintf(`yum update --disablerepo=* --enablerepo="*" -y -yum repolist all -yum install container-selinux -y -yum install subscription-manager -y -`) - } else { - lines[i] = "subscription-manager refresh\nyum update -y\n" - } - } - } - - scriptContent := strings.Join(lines, "\n") - err = ioutil.WriteFile(scriptPath, []byte(scriptContent), 0644) - if err != nil { - return fmt.Errorf("Error Creating Satellite Attach Host Script: %s", err) - } - - d.Set("location", location) - d.Set("host_script", scriptContent) - d.Set("host_provider", hostProvider) - d.Set("script_dir", scriptDir) - d.Set("script_path", scriptPath) - d.SetId(*locData.ID) - - log.Printf("[INFO] Generated satellite location script : %s", *locData.Name) - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_location_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_location_settings.go deleted file mode 100644 index 9220dbf5fe..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_location_settings.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright IBM Corp. 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/scc-go-sdk/adminserviceapiv1" -) - -func dataSourceIbmSccAccountLocationSettings() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIbmSccAccountLocationSettingsRead, - - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The programatic ID of the location that you want to work in.", - }, - }, - } -} - -func dataSourceIbmSccAccountLocationSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - adminServiceApiClient, err := meta.(ClientSession).AdminServiceApiV1() - if err != nil { - return diag.FromErr(err) - } - - getSettingsOptions := &adminserviceapiv1.GetSettingsOptions{} - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - - getSettingsOptions.SetAccountID(userDetails.userAccount) - - locationSettings, response, err := adminServiceApiClient.GetSettingsWithContext(context, getSettingsOptions) - if err != nil { - log.Printf("[DEBUG] GetSettingsWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSettingsWithContext failed %s\n%s", err, response)) - } - - d.SetId(*locationSettings.Location.ID) - if err = d.Set("id", locationSettings.Location.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_profile.go deleted file mode 100644 index bf162df77e..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_profile.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright IBM Corp. 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/scc-go-sdk/posturemanagementv2" -) - -func dataSourceIBMSccPostureProfileDetails() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMSccPostureProfileDetailsRead, - - Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The id for the given API.", - }, - "profile_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "The profile type ID. This will be 4 for profiles and 6 for group profiles.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The name of the profile.", - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "A description of the profile.", - }, - "version": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - Description: "The version of the profile.", - }, - "created_by": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The user who created the profile.", - }, - "modified_by": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The user who last modified the profile.", - }, - "reason_for_delete": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "A reason that you want to delete a profile.", - }, - "base_profile": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The base profile that the controls are pulled from.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The type of profile.", - }, - "no_of_controls": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - Description: "no of Controls.", - }, - "created_at": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The time that the profile was created in UTC.", - }, - "updated_at": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The time that the profile was most recently modified in UTC.", - }, - "enabled": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "The profile status. If the profile is enabled, the value is true. If the profile is disabled, the value is false.", - }, - }, - } -} - -func dataSourceIBMSccPostureProfileDetailsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() - if err != nil { - return diag.FromErr(err) - } - - getProfileOptions := &posturemanagementv2.GetProfileOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) - } - - accountID := userDetails.userAccount - getProfileOptions.SetAccountID(accountID) - - getProfileOptions.SetID(d.Get("profile_id").(string)) - getProfileOptions.SetProfileType(d.Get("profile_type").(string)) - - profile, response, err := postureManagementClient.GetProfileWithContext(context, getProfileOptions) - if err != nil { - log.Printf("[DEBUG] GetProfileWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetProfileWithContext failed %s\n%s", err, response)) - } - - d.SetId(*profile.ID) - if err = d.Set("name", profile.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) - } - if err = d.Set("description", profile.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) - } - if err = d.Set("version", intValue(profile.Version)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) - } - if err = d.Set("created_by", profile.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) - } - if err = d.Set("modified_by", profile.ModifiedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_by: %s", err)) - } - if err = d.Set("reason_for_delete", profile.ReasonForDelete); err != nil { - return nil //return diag.FromErr(fmt.Errorf("Error setting reason_for_delete: %s", err)) - } - if err = d.Set("base_profile", profile.BaseProfile); err != nil { - return diag.FromErr(fmt.Errorf("Error setting base_profile: %s", err)) - } - if err = d.Set("type", profile.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) - } - if err = d.Set("no_of_controls", intValue(profile.NoOfControls)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting no_of_controls: %s", err)) - } - if err = d.Set("created_at", dateTimeToString(profile.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) - } - if err = d.Set("updated_at", dateTimeToString(profile.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) - } - if err = d.Set("enabled", profile.Enabled); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enabled: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scope_correlation.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scope_correlation.go deleted file mode 100644 index a4a5dfe9df..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scope_correlation.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright IBM Corp. 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/scc-go-sdk/posturemanagementv2" -) - -func dataSourceIBMSccPostureScopeCorrelation() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMSccPostureScopeCorrelationRead, - - Schema: map[string]*schema.Schema{ - "correlation_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "A correlation_Id is created when a scope is created and discovery task is triggered or when a validation is triggered on a Scope. This is used to get the status of the task(discovery or validation).", - }, - "status": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Returns the current status of a task.", - }, - "start_time": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Returns the time that task started.", - }, - "last_heartbeat": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Returns the time that the scope was last updated. This value exists when collector is installed and running.", - }, - }, - } -} - -func dataSourceIBMSccPostureScopeCorrelationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() - if err != nil { - return diag.FromErr(err) - } - - getCorrelationIDOptions := &posturemanagementv2.GetCorrelationIDOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) - } - - accountID := userDetails.userAccount - getCorrelationIDOptions.SetAccountID(accountID) - - getCorrelationIDOptions.SetCorrelationID(d.Get("correlation_id").(string)) - - scopeTaskStatus, response, err := postureManagementClient.GetCorrelationIDWithContext(context, getCorrelationIDOptions) - if err != nil { - log.Printf("[DEBUG] GetCorrelationIDWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetCorrelationIDWithContext failed %s\n%s", err, response)) - } - - d.SetId(dataSourceIBMSccPostureScopeCorrelationID(d)) - if err = d.Set("status", scopeTaskStatus.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) - } - if err = d.Set("start_time", scopeTaskStatus.StartTime); err != nil { - return diag.FromErr(fmt.Errorf("Error setting start_time: %s", err)) - } - if err = d.Set("last_heartbeat", dateTimeToString(scopeTaskStatus.LastHeartbeat)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_heartbeat: %s", err)) - } - - return nil -} - -// dataSourceIBMScopeCorrelationID returns a reasonable ID for the list. -func dataSourceIBMSccPostureScopeCorrelationID(d *schema.ResourceData) string { - return time.Now().UTC().String() -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_inventory.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_inventory.go deleted file mode 100644 index 941efa9739..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_inventory.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright IBM Corp. 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/schematics-go-sdk/schematicsv1" -) - -func dataSourceIBMSchematicsInventory() *schema.Resource { - return &schema.Resource{ - ReadContext: dataSourceIBMSchematicsInventoryRead, - - Schema: map[string]*schema.Schema{ - "inventory_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Resource Inventory Id. Use `GET /v2/inventories` API to look up the Resource Inventory definition Ids in your IBM Cloud account.", - }, - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Inventory id.", - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "The description of your Inventory. The description can be up to 2048 characters long in size.", - }, - "location": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", - }, - "resource_group": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", - }, - "created_at": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Inventory creation time.", - }, - "created_by": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Email address of user who created the Inventory.", - }, - "updated_at": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Inventory updation time.", - }, - "updated_by": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Email address of user who updated the Inventory.", - }, - "inventories_ini": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Input inventory of host and host group for the playbook, in the .ini file format.", - }, - "resource_queries": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - } -} - -func dataSourceIBMSchematicsInventoryRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() - if err != nil { - return diag.FromErr(err) - } - - getInventoryOptions := &schematicsv1.GetInventoryOptions{} - - getInventoryOptions.SetInventoryID(d.Get("inventory_id").(string)) - - inventoryResourceRecord, response, err := schematicsClient.GetInventoryWithContext(context, getInventoryOptions) - if err != nil { - log.Printf("[DEBUG] GetInventoryWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetInventoryWithContext failed %s\n%s", err, response)) - } - - d.SetId(fmt.Sprintf("%s", *getInventoryOptions.InventoryID)) - if err = d.Set("name", inventoryResourceRecord.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) - } - if err = d.Set("id", inventoryResourceRecord.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) - } - if err = d.Set("description", inventoryResourceRecord.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) - } - if err = d.Set("location", inventoryResourceRecord.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) - } - if err = d.Set("resource_group", inventoryResourceRecord.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) - } - if err = d.Set("created_at", dateTimeToString(inventoryResourceRecord.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) - } - if err = d.Set("created_by", inventoryResourceRecord.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) - } - if err = d.Set("updated_at", dateTimeToString(inventoryResourceRecord.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) - } - if err = d.Set("updated_by", inventoryResourceRecord.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) - } - if err = d.Set("inventories_ini", inventoryResourceRecord.InventoriesIni); err != nil { - return diag.FromErr(fmt.Errorf("Error setting inventories_ini: %s", err)) - } - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_space.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_space.go deleted file mode 100644 index 338e76aa60..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_space.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceIBMSpace() *schema.Resource { - return &schema.Resource{ - Read: dataSourceIBMSpaceRead, - - Schema: map[string]*schema.Schema{ - "space": { - Description: "Space name, for example dev", - Type: schema.TypeString, - Optional: true, - Deprecated: "use name instead", - ExactlyOneOf: []string{"space", "name"}, - }, - "name": { - Description: "Space name, for example dev", - Type: schema.TypeString, - Optional: true, - ExactlyOneOf: []string{"space", "name"}, - }, - "org": { - Description: "The org this space belongs to", - Type: schema.TypeString, - Required: true, - }, - "auditors": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who have auditor role in this space, ex - user@example.com", - }, - "managers": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who have manager role in this space, ex - user@example.com", - }, - "developers": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who have developer role in this space, ex - user@example.com", - }, - }, - } -} - -func dataSourceIBMSpaceRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - orgAPI := cfClient.Organizations() - spaceAPI := cfClient.Spaces() - var space string - if v, ok := d.GetOk("name"); ok { - space = v.(string) - } - if v, ok := d.GetOk("space"); ok { - space = v.(string) - } - - org := d.Get("org").(string) - - orgFields, err := orgAPI.FindByName(org, BluemixRegion) - if err != nil { - return fmt.Errorf("Error retrieving org: %s", err) - } - spaceFields, err := spaceAPI.FindByNameInOrg(orgFields.GUID, space, BluemixRegion) - if err != nil { - return fmt.Errorf("Error retrieving space: %s", err) - } - - spaceGUID := spaceFields.GUID - d.SetId(spaceGUID) - - auditors, err := spaceAPI.ListAuditors(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving auditors in the space: %s", err) - } - - managers, err := spaceAPI.ListManagers(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving managers in the space: %s", err) - } - - developers, err := spaceAPI.ListDevelopers(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving developers in space: %s", err) - } - - d.Set("auditors", flattenSpaceRoleUsers(auditors)) - d.Set("managers", flattenSpaceRoleUsers(managers)) - d.Set("developers", flattenSpaceRoleUsers(developers)) - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/diff_supress_funcs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/diff_supress_funcs.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/diff_supress_funcs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/diff_supress_funcs.go index 968f7ee300..e4e11b391b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/diff_supress_funcs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/diff_supress_funcs.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package flex import ( "encoding/json" @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func suppressEquivalentJSON(k, old, new string, d *schema.ResourceData) bool { +func SuppressEquivalentJSON(k, old, new string, d *schema.ResourceData) bool { if old == "" { return false diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flatten.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/flatten.go similarity index 99% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flatten.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/flatten.go index 21f0bd1e48..7b9872929b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flatten.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/flatten.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package flex import ( "fmt" diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/map.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/map.go new file mode 100644 index 0000000000..12c91340b9 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/map.go @@ -0,0 +1,85 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package flex + +import ( + "strings" +) + +// Map is a wrapper around map[string]string that provides some helpers +// above it that assume the map is in the format that flatmap expects +// (the result of Flatten). +// +// All modifying functions such as Delete are done in-place unless +// otherwise noted. +type Map map[string]string + +// Contains returns true if the map contains the given key. +func (m Map) Contains(key string) bool { + for _, k := range m.Keys() { + if k == key { + return true + } + } + + return false +} + +// Delete deletes a key out of the map with the given prefix. +func (m Map) Delete(prefix string) { + for k, _ := range m { + match := k == prefix + if !match { + if !strings.HasPrefix(k, prefix) { + continue + } + + if k[len(prefix):len(prefix)+1] != "." { + continue + } + } + + delete(m, k) + } +} + +// Keys returns all of the top-level keys in this map +func (m Map) Keys() []string { + ks := make(map[string]struct{}) + for k, _ := range m { + idx := strings.Index(k, ".") + if idx == -1 { + idx = len(k) + } + + ks[k[:idx]] = struct{}{} + } + + result := make([]string, 0, len(ks)) + for k, _ := range ks { + result = append(result, k) + } + + return result +} + +// Merge merges the contents of the other Map into this one. +// +// This merge is smarter than a simple map iteration because it +// will fully replace arrays and other complex structures that +// are present in this map with the other map's. For example, if +// this map has a 3 element "foo" list, and m2 has a 2 element "foo" +// list, then the result will be that m has a 2 element "foo" +// list. +func (m Map) Merge(m2 Map) { + for _, prefix := range m2.Keys() { + m.Delete(prefix) + + for k, v := range m2 { + if strings.HasPrefix(k, prefix) { + m[k] = v + } + } + } +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/structures.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/structures.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/structures.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/structures.go index 1c8717d8db..73a9762201 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/structures.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/structures.go @@ -1,9 +1,10 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package flex import ( + "bytes" b64 "encoding/base64" "encoding/json" "errors" @@ -18,7 +19,10 @@ import ( "strings" "time" + "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/bluemix-go/models" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1" "github.com/IBM/ibm-cos-sdk-go/service/s3" @@ -56,16 +60,27 @@ const ( //ResourceGroupName ... ResourceGroupName = "resource_group_name" //RelatedCRN ... - RelatedCRN = "related_crn" - SystemIBMLabelPrefix = "ibm-cloud.kubernetes.io/" - KubernetesLabelPrefix = "kubernetes.io/" - K8sLabelPrefix = "k8s.io/" + RelatedCRN = "related_crn" + SystemIBMLabelPrefix = "ibm-cloud.kubernetes.io/" + KubernetesLabelPrefix = "kubernetes.io/" + K8sLabelPrefix = "k8s.io/" + isLBListenerPolicyAction = "action" + isLBListenerPolicyTargetID = "target_id" + isLBListenerPolicyTargetURL = "target_url" + isLBListenerPolicyHTTPSRedirectStatusCode = "target_https_redirect_status_code" + isLBListenerPolicyHTTPSRedirectURI = "target_https_redirect_uri" + isLBListenerPolicyHTTPSRedirectListener = "target_https_redirect_listener" + isLBPoolSessPersistenceType = "session_persistence_type" + isLBPoolSessPersistenceAppCookieName = "session_persistence_app_cookie_name" + isLBProfile = "profile" + isLBRouteMode = "route_mode" + isLBType = "type" ) //HashInt ... func HashInt(v interface{}) int { return v.(int) } -func expandStringList(input []interface{}) []string { +func ExpandStringList(input []interface{}) []string { vs := make([]string, len(input)) for i, v := range input { vs[i] = v.(string) @@ -73,7 +88,7 @@ func expandStringList(input []interface{}) []string { return vs } -func flattenStringList(list []string) []interface{} { +func FlattenStringList(list []string) []interface{} { vs := make([]interface{}, len(list)) for i, v := range list { vs[i] = v @@ -81,7 +96,7 @@ func flattenStringList(list []string) []interface{} { return vs } -func expandIntList(input []interface{}) []int { +func ExpandIntList(input []interface{}) []int { vs := make([]int, len(input)) for i, v := range input { vs[i] = v.(int) @@ -89,7 +104,7 @@ func expandIntList(input []interface{}) []int { return vs } -func flattenIntList(list []int) []interface{} { +func FlattenIntList(list []int) []interface{} { vs := make([]interface{}, len(list)) for i, v := range list { vs[i] = v @@ -97,7 +112,7 @@ func flattenIntList(list []int) []interface{} { return vs } -func newStringSet(f schema.SchemaSetFunc, in []string) *schema.Set { +func NewStringSet(f schema.SchemaSetFunc, in []string) *schema.Set { var out = make([]interface{}, len(in), len(in)) for i, v := range in { out[i] = v @@ -105,12 +120,12 @@ func newStringSet(f schema.SchemaSetFunc, in []string) *schema.Set { return schema.NewSet(f, out) } -func flattenRoute(in []mccpv2.Route) *schema.Set { +func FlattenRoute(in []mccpv2.Route) *schema.Set { vs := make([]string, len(in)) for i, v := range in { vs[i] = v.GUID } - return newStringSet(schema.HashString, vs) + return NewStringSet(schema.HashString, vs) } func stringSliceToSet(in []string) *schema.Set { @@ -118,15 +133,15 @@ func stringSliceToSet(in []string) *schema.Set { for i, v := range in { vs[i] = v } - return newStringSet(schema.HashString, vs) + return NewStringSet(schema.HashString, vs) } -func flattenServiceBindings(in []mccpv2.ServiceBinding) *schema.Set { +func FlattenServiceBindings(in []mccpv2.ServiceBinding) *schema.Set { vs := make([]string, len(in)) for i, v := range in { vs[i] = v.ServiceInstanceGUID } - return newStringSet(schema.HashString, vs) + return NewStringSet(schema.HashString, vs) } func flattenPort(in []int) *schema.Set { @@ -137,7 +152,7 @@ func flattenPort(in []int) *schema.Set { return schema.NewSet(HashInt, out) } -func flattenFileStorageID(in []datatypes.Network_Storage) *schema.Set { +func FlattenFileStorageID(in []datatypes.Network_Storage) *schema.Set { var out = []interface{}{} for _, v := range in { if *v.NasType == "NAS" { @@ -147,7 +162,7 @@ func flattenFileStorageID(in []datatypes.Network_Storage) *schema.Set { return schema.NewSet(HashInt, out) } -func flattenBlockStorageID(in []datatypes.Network_Storage) *schema.Set { +func FlattenBlockStorageID(in []datatypes.Network_Storage) *schema.Set { var out = []interface{}{} for _, v := range in { if *v.NasType == "ISCSI" { @@ -157,7 +172,7 @@ func flattenBlockStorageID(in []datatypes.Network_Storage) *schema.Set { return schema.NewSet(HashInt, out) } -func flattenSSHKeyIDs(in []datatypes.Security_Ssh_Key) *schema.Set { +func FlattenSSHKeyIDs(in []datatypes.Security_Ssh_Key) *schema.Set { var out = []interface{}{} for _, v := range in { out = append(out, *v.Id) @@ -165,7 +180,7 @@ func flattenSSHKeyIDs(in []datatypes.Security_Ssh_Key) *schema.Set { return schema.NewSet(HashInt, out) } -func flattenSpaceRoleUsers(in []mccpv2.SpaceRole) *schema.Set { +func FlattenSpaceRoleUsers(in []mccpv2.SpaceRole) *schema.Set { var out = []interface{}{} for _, v := range in { out = append(out, v.UserName) @@ -173,7 +188,7 @@ func flattenSpaceRoleUsers(in []mccpv2.SpaceRole) *schema.Set { return schema.NewSet(schema.HashString, out) } -func flattenOrgRole(in []mccpv2.OrgRole, excludeUsername string) *schema.Set { +func FlattenOrgRole(in []mccpv2.OrgRole, excludeUsername string) *schema.Set { var out = []interface{}{} for _, v := range in { if excludeUsername == "" { @@ -203,7 +218,7 @@ func flattenServiceKeyCredentials(creds map[string]interface{}) map[string]strin return flattenCredentials(creds) } -func flattenServiceInstanceCredentials(keys []mccpv2.ServiceKeyFields) []interface{} { +func FlattenServiceInstanceCredentials(keys []mccpv2.ServiceKeyFields) []interface{} { var out = make([]interface{}, len(keys), len(keys)) for i, k := range keys { m := make(map[string]interface{}) @@ -214,7 +229,7 @@ func flattenServiceInstanceCredentials(keys []mccpv2.ServiceKeyFields) []interfa return out } -func flattenUsersSet(userList *schema.Set) []string { +func FlattenUsersSet(userList *schema.Set) []string { users := make([]string, 0) for _, user := range userList.List() { users = append(users, user.(string)) @@ -222,8 +237,9 @@ func flattenUsersSet(userList *schema.Set) []string { return users } -func expandProtocols(configured []interface{}) ([]datatypes.Network_LBaaS_LoadBalancerProtocolConfiguration, error) { +func ExpandProtocols(configured []interface{}) ([]datatypes.Network_LBaaS_LoadBalancerProtocolConfiguration, error) { protocols := make([]datatypes.Network_LBaaS_LoadBalancerProtocolConfiguration, 0, len(configured)) + var lbMethodToId = make(map[string]string) for _, lRaw := range configured { data := lRaw.(map[string]interface{}) p := &datatypes.Network_LBaaS_LoadBalancerProtocolConfiguration{ @@ -268,7 +284,7 @@ func expandProtocols(configured []interface{}) ([]datatypes.Network_LBaaS_LoadBa return protocols, nil } -func expandMembers(configured []interface{}) []datatypes.Network_LBaaS_LoadBalancerServerInstanceInfo { +func ExpandMembers(configured []interface{}) []datatypes.Network_LBaaS_LoadBalancerServerInstanceInfo { members := make([]datatypes.Network_LBaaS_LoadBalancerServerInstanceInfo, 0, len(configured)) for _, lRaw := range configured { data := lRaw.(map[string]interface{}) @@ -285,7 +301,7 @@ func expandMembers(configured []interface{}) []datatypes.Network_LBaaS_LoadBalan return members } -func flattenServerInstances(list []datatypes.Network_LBaaS_Member) []map[string]interface{} { +func FlattenServerInstances(list []datatypes.Network_LBaaS_Member) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(list)) for _, i := range list { l := map[string]interface{}{ @@ -300,7 +316,8 @@ func flattenServerInstances(list []datatypes.Network_LBaaS_Member) []map[string] return result } -func flattenProtocols(list []datatypes.Network_LBaaS_Listener) []map[string]interface{} { +func FlattenProtocols(list []datatypes.Network_LBaaS_Listener) []map[string]interface{} { + var lbIdToMethod = make(map[string]string) result := make([]map[string]interface{}, 0, len(list)) for _, i := range list { l := map[string]interface{}{ @@ -325,7 +342,7 @@ func flattenProtocols(list []datatypes.Network_LBaaS_Listener) []map[string]inte return result } -func flattenVpcWorkerPools(list []containerv2.GetWorkerPoolResponse) []map[string]interface{} { +func FlattenVpcWorkerPools(list []containerv2.GetWorkerPoolResponse) []map[string]interface{} { workerPools := make([]map[string]interface{}, len(list)) for i, workerPool := range list { l := map[string]interface{}{ @@ -368,14 +385,14 @@ func flattenVpcZones(list []containerv2.ZoneResp) []map[string]interface{} { for i, zone := range list { l := map[string]interface{}{ "id": zone.ID, - "subnet_id": flattenSubnets(zone.Subnets), + "subnet_id": FlattenSubnets(zone.Subnets), "worker_count": zone.WorkerCount, } zones[i] = l } return zones } -func flattenConditions(list []iamaccessgroupsv2.RuleConditions) []map[string]interface{} { +func FlattenConditions(list []iamaccessgroupsv2.RuleConditions) []map[string]interface{} { conditions := make([]map[string]interface{}, len(list)) for i, cond := range list { l := map[string]interface{}{ @@ -387,21 +404,21 @@ func flattenConditions(list []iamaccessgroupsv2.RuleConditions) []map[string]int } return conditions } -func flattenAccessGroupRules(list *iamaccessgroupsv2.RulesList) []map[string]interface{} { +func FlattenAccessGroupRules(list *iamaccessgroupsv2.RulesList) []map[string]interface{} { rules := make([]map[string]interface{}, len(list.Rules)) for i, item := range list.Rules { l := map[string]interface{}{ "name": item.Name, "expiration": item.Expiration, "identity_provider": item.RealmName, - "conditions": flattenConditions(item.Conditions), + "conditions": FlattenConditions(item.Conditions), } rules[i] = l } return rules } -func flattenSubnets(list []containerv2.Subnet) []map[string]interface{} { +func FlattenSubnets(list []containerv2.Subnet) []map[string]interface{} { subs := make([]map[string]interface{}, len(list)) for i, sub := range list { l := map[string]interface{}{ @@ -413,7 +430,7 @@ func flattenSubnets(list []containerv2.Subnet) []map[string]interface{} { return subs } -func flattenZones(list []containerv1.WorkerPoolZoneResponse) []map[string]interface{} { +func FlattenZones(list []containerv1.WorkerPoolZoneResponse) []map[string]interface{} { zones := make([]map[string]interface{}, len(list)) for i, zone := range list { l := map[string]interface{}{ @@ -427,7 +444,7 @@ func flattenZones(list []containerv1.WorkerPoolZoneResponse) []map[string]interf return zones } -func flattenWorkerPools(list []containerv1.WorkerPoolResponse) []map[string]interface{} { +func FlattenWorkerPools(list []containerv1.WorkerPoolResponse) []map[string]interface{} { workerPools := make([]map[string]interface{}, len(list)) for i, workerPool := range list { l := map[string]interface{}{ @@ -457,7 +474,7 @@ func flattenWorkerPools(list []containerv1.WorkerPoolResponse) []map[string]inte return workerPools } -func flattenAlbs(list []containerv1.ALBConfig, filterType string) []map[string]interface{} { +func FlattenAlbs(list []containerv1.ALBConfig, filterType string) []map[string]interface{} { albs := make([]map[string]interface{}, 0) for _, alb := range list { if alb.ALBType == filterType || filterType == "all" { @@ -478,7 +495,7 @@ func flattenAlbs(list []containerv1.ALBConfig, filterType string) []map[string]i return albs } -func flattenVpcAlbs(list []containerv2.AlbConfig, filterType string) []map[string]interface{} { +func FlattenVpcAlbs(list []containerv2.AlbConfig, filterType string) []map[string]interface{} { albs := make([]map[string]interface{}, 0) for _, alb := range list { if alb.AlbType == filterType || filterType == "all" { @@ -498,7 +515,7 @@ func flattenVpcAlbs(list []containerv2.AlbConfig, filterType string) []map[strin return albs } -func flattenNetworkInterfaces(list []containerv2.Network) []map[string]interface{} { +func FlattenNetworkInterfaces(list []containerv2.Network) []map[string]interface{} { nwInterfaces := make([]map[string]interface{}, len(list)) for i, nw := range list { l := map[string]interface{}{ @@ -511,7 +528,7 @@ func flattenNetworkInterfaces(list []containerv2.Network) []map[string]interface return nwInterfaces } -func flattenVlans(list []containerv1.Vlan) []map[string]interface{} { +func FlattenVlans(list []containerv1.Vlan) []map[string]interface{} { vlans := make([]map[string]interface{}, len(list)) for i, vlanR := range list { subnets := make([]map[string]interface{}, len(vlanR.Subnets)) @@ -537,7 +554,7 @@ func flattenVlans(list []containerv1.Vlan) []map[string]interface{} { return vlans } -func flattenIcdGroups(grouplist icdv4.GroupList) []map[string]interface{} { +func FlattenIcdGroups(grouplist icdv4.GroupList) []map[string]interface{} { groups := make([]map[string]interface{}, len(grouplist.Groups)) for i, group := range grouplist.Groups { memorys := make([]map[string]interface{}, 1) @@ -582,7 +599,7 @@ func flattenIcdGroups(grouplist icdv4.GroupList) []map[string]interface{} { return groups } -func normalizeJSONString(jsonString interface{}) (string, error) { +func NormalizeJSONString(jsonString interface{}) (string, error) { var j interface{} if jsonString == nil || jsonString.(string) == "" { return "", nil @@ -599,7 +616,7 @@ func normalizeJSONString(jsonString interface{}) (string, error) { return string(bytes[:]), nil } -func expandAnnotations(annotations string) (whisk.KeyValueArr, error) { +func ExpandAnnotations(annotations string) (whisk.KeyValueArr, error) { var result whisk.KeyValueArr dc := json.NewDecoder(strings.NewReader(annotations)) dc.UseNumber() @@ -607,7 +624,7 @@ func expandAnnotations(annotations string) (whisk.KeyValueArr, error) { return result, err } -func flattenAnnotations(in whisk.KeyValueArr) (string, error) { +func FlattenAnnotations(in whisk.KeyValueArr) (string, error) { b, err := json.Marshal(in) if err != nil { return "", err @@ -615,7 +632,7 @@ func flattenAnnotations(in whisk.KeyValueArr) (string, error) { return string(b[:]), nil } -func expandParameters(annotations string) (whisk.KeyValueArr, error) { +func ExpandParameters(annotations string) (whisk.KeyValueArr, error) { var result whisk.KeyValueArr dc := json.NewDecoder(strings.NewReader(annotations)) dc.UseNumber() @@ -623,7 +640,7 @@ func expandParameters(annotations string) (whisk.KeyValueArr, error) { return result, err } -func flattenParameters(in whisk.KeyValueArr) (string, error) { +func FlattenParameters(in whisk.KeyValueArr) (string, error) { b, err := json.Marshal(in) if err != nil { return "", err @@ -631,7 +648,7 @@ func flattenParameters(in whisk.KeyValueArr) (string, error) { return string(b[:]), nil } -func expandLimits(l []interface{}) *whisk.Limits { +func ExpandLimits(l []interface{}) *whisk.Limits { if len(l) == 0 || l[0] == nil { return &whisk.Limits{} } @@ -644,7 +661,7 @@ func expandLimits(l []interface{}) *whisk.Limits { return obj } -func flattenActivityTrack(in *resourceconfigurationv1.ActivityTracking) []interface{} { +func FlattenActivityTrack(in *resourceconfigurationv1.ActivityTracking) []interface{} { att := make(map[string]interface{}) if in != nil { @@ -661,7 +678,7 @@ func flattenActivityTrack(in *resourceconfigurationv1.ActivityTracking) []interf return []interface{}{att} } -func flattenMetricsMonitor(in *resourceconfigurationv1.MetricsMonitoring) []interface{} { +func FlattenMetricsMonitor(in *resourceconfigurationv1.MetricsMonitoring) []interface{} { att := make(map[string]interface{}) if in != nil { if in.UsageMetricsEnabled != nil { @@ -677,7 +694,7 @@ func flattenMetricsMonitor(in *resourceconfigurationv1.MetricsMonitoring) []inte return []interface{}{att} } -func archiveRuleGet(in []*s3.LifecycleRule) []interface{} { +func ArchiveRuleGet(in []*s3.LifecycleRule) []interface{} { rules := make([]interface{}, 0, len(in)) for _, r := range in { // Checking this is not an expire_rule. LifeCycle rules are either archive or expire or non current version or abort incomplete multipart upload @@ -712,7 +729,7 @@ func archiveRuleGet(in []*s3.LifecycleRule) []interface{} { return rules } -func expireRuleGet(in []*s3.LifecycleRule) []interface{} { +func ExpireRuleGet(in []*s3.LifecycleRule) []interface{} { rules := make([]interface{}, 0, len(in)) for _, r := range in { if r.Expiration != nil && r.Transitions == nil { @@ -759,7 +776,7 @@ func expireRuleGet(in []*s3.LifecycleRule) []interface{} { } -func nc_exp_RuleGet(in []*s3.LifecycleRule) []interface{} { +func Nc_exp_RuleGet(in []*s3.LifecycleRule) []interface{} { rules := make([]interface{}, 0, len(in)) for _, r := range in { if r.Expiration == nil && r.AbortIncompleteMultipartUpload == nil && r.Transitions == nil { @@ -788,7 +805,7 @@ func nc_exp_RuleGet(in []*s3.LifecycleRule) []interface{} { return rules } -func abort_mpu_RuleGet(in []*s3.LifecycleRule) []interface{} { +func Abort_mpu_RuleGet(in []*s3.LifecycleRule) []interface{} { rules := make([]interface{}, 0, len(in)) for _, r := range in { if r.Expiration == nil && r.NoncurrentVersionExpiration == nil && r.Transitions == nil { @@ -817,7 +834,7 @@ func abort_mpu_RuleGet(in []*s3.LifecycleRule) []interface{} { return rules } -func retentionRuleGet(in *s3.ProtectionConfiguration) []interface{} { +func RetentionRuleGet(in *s3.ProtectionConfiguration) []interface{} { rules := make([]interface{}, 0, 1) if in != nil && in.Status != nil && *in.Status == "COMPLIANCE" { protectConfig := make(map[string]interface{}) @@ -838,7 +855,7 @@ func retentionRuleGet(in *s3.ProtectionConfiguration) []interface{} { return rules } -func flattenCosObejctVersioning(in *s3.GetBucketVersioningOutput) []interface{} { +func FlattenCosObejctVersioning(in *s3.GetBucketVersioningOutput) []interface{} { versioning := make([]interface{}, 0, 1) if in != nil { if in.Status != nil { @@ -854,7 +871,7 @@ func flattenCosObejctVersioning(in *s3.GetBucketVersioningOutput) []interface{} return versioning } -func flattenLimits(in *whisk.Limits) []interface{} { +func FlattenLimits(in *whisk.Limits) []interface{} { att := make(map[string]interface{}) if in.Timeout != nil { att["timeout"] = *in.Timeout @@ -868,7 +885,7 @@ func flattenLimits(in *whisk.Limits) []interface{} { return []interface{}{att} } -func expandExec(execs []interface{}) *whisk.Exec { +func ExpandExec(execs []interface{}) *whisk.Exec { var code string var document []byte for _, exec := range execs { @@ -899,10 +916,10 @@ func expandExec(execs []interface{}) *whisk.Exec { obj := &whisk.Exec{ Image: e["image"].(string), Init: e["init"].(string), - Code: ptrToString(code), + Code: PtrToString(code), Kind: e["kind"].(string), Main: e["main"].(string), - Components: expandStringList(e["components"].([]interface{})), + Components: ExpandStringList(e["components"].([]interface{})), } return obj } @@ -910,7 +927,7 @@ func expandExec(execs []interface{}) *whisk.Exec { return &whisk.Exec{} } -func flattenExec(in *whisk.Exec, d *schema.ResourceData) []interface{} { +func FlattenExec(in *whisk.Exec, d *schema.ResourceData) []interface{} { code_data := 4194304 // length of 'code' parameter should be always <= 4MB data att := make(map[string]interface{}) // open-whisk SDK will not return the value for code_path @@ -935,7 +952,7 @@ func flattenExec(in *whisk.Exec, d *schema.ResourceData) []interface{} { } if len(in.Components) > 0 { - att["components"] = flattenStringList(in.Components) + att["components"] = FlattenStringList(in.Components) } return []interface{}{att} @@ -945,11 +962,11 @@ func ptrToInt(i int) *int { return &i } -func ptrToString(s string) *string { +func PtrToString(s string) *string { return &s } -func intValue(i64 *int64) (i int) { +func IntValue(i64 *int64) (i int) { if i64 != nil { i = int(*i64) } @@ -970,14 +987,14 @@ func dateToString(d *strfmt.Date) (s string) { return } -func dateTimeToString(dt *strfmt.DateTime) (s string) { +func DateTimeToString(dt *strfmt.DateTime) (s string) { if dt != nil { s = dt.String() } return } -func filterActionAnnotations(in whisk.KeyValueArr) (string, error) { +func FilterActionAnnotations(in whisk.KeyValueArr) (string, error) { noExec := make(whisk.KeyValueArr, 0, len(in)) for _, v := range in { if v.Key == "exec" { @@ -986,10 +1003,10 @@ func filterActionAnnotations(in whisk.KeyValueArr) (string, error) { noExec = append(noExec, v) } - return flattenAnnotations(noExec) + return FlattenAnnotations(noExec) } -func filterActionParameters(in whisk.KeyValueArr) (string, error) { +func FilterActionParameters(in whisk.KeyValueArr) (string, error) { noAction := make(whisk.KeyValueArr, 0, len(in)) for _, v := range in { if v.Key == "_actions" { @@ -997,10 +1014,10 @@ func filterActionParameters(in whisk.KeyValueArr) (string, error) { } noAction = append(noAction, v) } - return flattenParameters(noAction) + return FlattenParameters(noAction) } -func filterInheritedAnnotations(inheritedAnnotations, annotations whisk.KeyValueArr) whisk.KeyValueArr { +func FilterInheritedAnnotations(inheritedAnnotations, annotations whisk.KeyValueArr) whisk.KeyValueArr { userDefinedAnnotations := make(whisk.KeyValueArr, 0) for _, a := range annotations { insert := false @@ -1022,7 +1039,7 @@ func filterInheritedAnnotations(inheritedAnnotations, annotations whisk.KeyValue return userDefinedAnnotations } -func filterInheritedParameters(inheritedParameters, parameters whisk.KeyValueArr) whisk.KeyValueArr { +func FilterInheritedParameters(inheritedParameters, parameters whisk.KeyValueArr) whisk.KeyValueArr { userDefinedParameters := make(whisk.KeyValueArr, 0) for _, p := range parameters { insert := false @@ -1045,7 +1062,7 @@ func filterInheritedParameters(inheritedParameters, parameters whisk.KeyValueArr return userDefinedParameters } -func isEmpty(object interface{}) bool { +func IsEmpty(object interface{}) bool { //First check normal definitions of empty if object == nil { return true @@ -1066,7 +1083,7 @@ func isEmpty(object interface{}) bool { return false } -func filterTriggerAnnotations(in whisk.KeyValueArr) (string, error) { +func FilterTriggerAnnotations(in whisk.KeyValueArr) (string, error) { noFeed := make(whisk.KeyValueArr, 0, len(in)) for _, v := range in { if v.Key == "feed" { @@ -1074,17 +1091,17 @@ func filterTriggerAnnotations(in whisk.KeyValueArr) (string, error) { } noFeed = append(noFeed, v) } - return flattenParameters(noFeed) + return FlattenParameters(noFeed) } -func flattenFeed(feedName string) []interface{} { +func FlattenFeed(feedName string) []interface{} { att := make(map[string]interface{}) att["name"] = feedName att["parameters"] = "[]" return []interface{}{att} } -func flattenGatewayVlans(list []datatypes.Network_Gateway_Vlan) []map[string]interface{} { +func FlattenGatewayVlans(list []datatypes.Network_Gateway_Vlan) []map[string]interface{} { vlans := make([]map[string]interface{}, len(list)) for i, ele := range list { vlan := make(map[string]interface{}) @@ -1096,7 +1113,7 @@ func flattenGatewayVlans(list []datatypes.Network_Gateway_Vlan) []map[string]int return vlans } -func flattenGatewayMembers(d *schema.ResourceData, list []datatypes.Network_Gateway_Member) []map[string]interface{} { +func FlattenGatewayMembers(d *schema.ResourceData, list []datatypes.Network_Gateway_Member) []map[string]interface{} { members := make([]map[string]interface{}, len(list)) for i, ele := range list { hardware := *ele.Hardware @@ -1167,7 +1184,7 @@ func flattenGatewayMembers(d *schema.ResourceData, list []datatypes.Network_Gate return members } -func flattenDisks(result datatypes.Virtual_Guest) []int { +func FlattenDisks(result datatypes.Virtual_Guest) []int { var out = make([]int, 0) for _, v := range result.BlockDevices { @@ -1196,7 +1213,7 @@ func flattenDisks(result datatypes.Virtual_Guest) []int { return out } -func flattenDisksForWindows(result datatypes.Virtual_Guest) []int { +func FlattenDisksForWindows(result datatypes.Virtual_Guest) []int { var out = make([]int, 0) for _, v := range result.BlockDevices { @@ -1229,7 +1246,7 @@ func filterResourceKeyParameters(params map[string]interface{}) map[string]inter return params } -func idParts(id string) ([]string, error) { +func IdParts(id string) ([]string, error) { if strings.Contains(id, "/") { parts := strings.Split(id, "/") return parts, nil @@ -1237,7 +1254,7 @@ func idParts(id string) ([]string, error) { return []string{}, fmt.Errorf("The given id %s does not contain / please check documentation on how to provider id during import command", id) } -func sepIdParts(id string, separator string) ([]string, error) { +func SepIdParts(id string, separator string) ([]string, error) { if strings.Contains(id, separator) { parts := strings.Split(id, separator) return parts, nil @@ -1245,12 +1262,12 @@ func sepIdParts(id string, separator string) ([]string, error) { return []string{}, fmt.Errorf("The given id %s does not contain %s please check documentation on how to provider id during import command", id, separator) } -func vmIdParts(id string) ([]string, error) { +func VmIdParts(id string) ([]string, error) { parts := strings.Split(id, "/") return parts, nil } -func cfIdParts(id string) ([]string, error) { +func CfIdParts(id string) ([]string, error) { parts := strings.Split(id, ":") return parts, nil } @@ -1278,17 +1295,17 @@ func getCustomAttributes(r iampolicymanagementv1.PolicyResource) []iampolicymana return attributes } -func flattenPolicyResource(list []iampolicymanagementv1.PolicyResource) []map[string]interface{} { +func FlattenPolicyResource(list []iampolicymanagementv1.PolicyResource) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(list)) for _, i := range list { l := map[string]interface{}{ - "service": getResourceAttribute("serviceName", i), - "resource_instance_id": getResourceAttribute("serviceInstance", i), - "region": getResourceAttribute("region", i), - "resource_type": getResourceAttribute("resourceType", i), - "resource": getResourceAttribute("resource", i), - "resource_group_id": getResourceAttribute("resourceGroupId", i), - "service_type": getResourceAttribute("serviceType", i), + "service": GetResourceAttribute("serviceName", i), + "resource_instance_id": GetResourceAttribute("serviceInstance", i), + "region": GetResourceAttribute("region", i), + "resource_type": GetResourceAttribute("resourceType", i), + "resource": GetResourceAttribute("resource", i), + "resource_group_id": GetResourceAttribute("resourceGroupId", i), + "service_type": GetResourceAttribute("serviceType", i), } customAttributes := getCustomAttributes(i) if len(customAttributes) > 0 { @@ -1303,7 +1320,7 @@ func flattenPolicyResource(list []iampolicymanagementv1.PolicyResource) []map[st } return result } -func flattenPolicyResourceAttributes(list []iampolicymanagementv1.PolicyResource) []map[string]interface{} { +func FlattenPolicyResourceAttributes(list []iampolicymanagementv1.PolicyResource) []map[string]interface{} { result := make([]map[string]interface{}, 0) for _, i := range list { for _, a := range i.Attributes { @@ -1320,8 +1337,26 @@ func flattenPolicyResourceAttributes(list []iampolicymanagementv1.PolicyResource return result } +func FlattenPolicyResourceTags(resources []iampolicymanagementv1.PolicyResource) []map[string]interface{} { + result := make([]map[string]interface{}, 0) + + for _, resource := range resources { + if resource.Tags != nil { + for _, tags := range resource.Tags { + tag := map[string]interface{}{ + "name": tags.Name, + "value": tags.Value, + "operator": tags.Operator, + } + result = append(result, tag) + } + } + } + return result +} + // Cloud Internet Services -func flattenHealthMonitors(list []datatypes.Network_LBaaS_Listener) []map[string]interface{} { +func FlattenHealthMonitors(list []datatypes.Network_LBaaS_Listener) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(list)) ports := make([]int, 0, 0) for _, i := range list { @@ -1364,9 +1399,10 @@ func StringContains(s []string, str string) bool { return false } -func flattenMembersData(list []iamaccessgroupsv2.ListGroupMembersResponseMember, users []usermanagementv2.UserInfo, serviceids []iamidentityv1.ServiceID) ([]string, []string) { +func FlattenMembersData(list []iamaccessgroupsv2.ListGroupMembersResponseMember, users []usermanagementv2.UserInfo, serviceids []iamidentityv1.ServiceID, profileids []iamidentityv1.TrustedProfile) ([]string, []string, []string) { var ibmid []string var serviceid []string + var profileid []string for _, m := range list { if *m.Type == "user" { for _, user := range users { @@ -1375,22 +1411,27 @@ func flattenMembersData(list []iamaccessgroupsv2.ListGroupMembersResponseMember, break } } + } else if *m.Type == "profile" { + for _, prid := range profileids { + if *prid.IamID == *m.IamID { + profileid = append(profileid, *prid.ID) + break + } + } } else { - for _, srid := range serviceids { if *srid.IamID == *m.IamID { serviceid = append(serviceid, *srid.ID) break } } - } } - return ibmid, serviceid + return ibmid, serviceid, profileid } -func flattenAccessGroupMembers(list []iamaccessgroupsv2.ListGroupMembersResponseMember, users []usermanagementv2.UserInfo, serviceids []iamidentityv1.ServiceID) []map[string]interface{} { +func FlattenAccessGroupMembers(list []iamaccessgroupsv2.ListGroupMembersResponseMember, users []usermanagementv2.UserInfo, serviceids []iamidentityv1.ServiceID) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(list)) for _, m := range list { var value, vtype string @@ -1420,10 +1461,10 @@ func flattenAccessGroupMembers(list []iamaccessgroupsv2.ListGroupMembersResponse return result } -func flattenUserIds(accountID string, users []string, meta interface{}) ([]string, error) { +func FlattenUserIds(accountID string, users []string, meta interface{}) ([]string, error) { userids := make([]string, len(users)) for i, name := range users { - iamID, err := getIBMUniqueId(accountID, name, meta) + iamID, err := GetIBMUniqueId(accountID, name, meta) if err != nil { return nil, err } @@ -1432,19 +1473,7 @@ func flattenUserIds(accountID string, users []string, meta interface{}) ([]strin return userids, nil } -func flattenServiceIds(services []string, meta interface{}) ([]string, error) { - serviceids := make([]string, len(services)) - for i, id := range services { - serviceID, err := getServiceID(id, meta) - if err != nil { - return nil, err - } - serviceids[i] = *serviceID.IamID - } - return serviceids, nil -} - -func expandUsers(userList *schema.Set) (users []icdv4.User) { +func ExpandUsers(userList *schema.Set) (users []icdv4.User) { for _, iface := range userList.List() { userEl := iface.(map[string]interface{}) user := icdv4.User{ @@ -1456,8 +1485,27 @@ func expandUsers(userList *schema.Set) (users []icdv4.User) { return } +type CsEntry struct { + Name string + Password string + String string + Composed string + CertName string + CertBase64 string + Hosts []struct { + HostName string `json:"hostname"` + Port int `json:"port"` + } + Scheme string + QueryOptions map[string]interface{} + Path string + Database string + BundleName string + BundleBase64 string +} + // IBM Cloud Databases -func flattenConnectionStrings(cs []CsEntry) []map[string]interface{} { +func FlattenConnectionStrings(cs []CsEntry) []map[string]interface{} { entries := make([]map[string]interface{}, len(cs), len(cs)) for i, csEntry := range cs { l := map[string]interface{}{ @@ -1504,7 +1552,7 @@ func flattenConnectionStrings(cs []CsEntry) []map[string]interface{} { return entries } -func flattenPhaseOneAttributes(vpn *datatypes.Network_Tunnel_Module_Context) []map[string]interface{} { +func FlattenPhaseOneAttributes(vpn *datatypes.Network_Tunnel_Module_Context) []map[string]interface{} { phaseoneAttributesMap := make([]map[string]interface{}, 0, 1) phaseoneAttributes := make(map[string]interface{}) phaseoneAttributes["authentication"] = *vpn.PhaseOneAuthentication @@ -1515,7 +1563,7 @@ func flattenPhaseOneAttributes(vpn *datatypes.Network_Tunnel_Module_Context) []m return phaseoneAttributesMap } -func flattenPhaseTwoAttributes(vpn *datatypes.Network_Tunnel_Module_Context) []map[string]interface{} { +func FlattenPhaseTwoAttributes(vpn *datatypes.Network_Tunnel_Module_Context) []map[string]interface{} { phasetwoAttributesMap := make([]map[string]interface{}, 0, 1) phasetwoAttributes := make(map[string]interface{}) phasetwoAttributes["authentication"] = *vpn.PhaseTwoAuthentication @@ -1526,7 +1574,7 @@ func flattenPhaseTwoAttributes(vpn *datatypes.Network_Tunnel_Module_Context) []m return phasetwoAttributesMap } -func flattenaddressTranslation(vpn *datatypes.Network_Tunnel_Module_Context, fwID int) []map[string]interface{} { +func FlattenaddressTranslation(vpn *datatypes.Network_Tunnel_Module_Context, fwID int) []map[string]interface{} { addressTranslationMap := make([]map[string]interface{}, 0, 1) addressTranslationAttributes := make(map[string]interface{}) for _, networkAddressTranslation := range vpn.AddressTranslations { @@ -1540,7 +1588,7 @@ func flattenaddressTranslation(vpn *datatypes.Network_Tunnel_Module_Context, fwI return addressTranslationMap } -func flattenremoteSubnet(vpn *datatypes.Network_Tunnel_Module_Context) []map[string]interface{} { +func FlattenremoteSubnet(vpn *datatypes.Network_Tunnel_Module_Context) []map[string]interface{} { remoteSubnetMap := make([]map[string]interface{}, 0, 1) remoteSubnetAttributes := make(map[string]interface{}) for _, customerSubnet := range vpn.CustomerSubnets { @@ -1553,7 +1601,7 @@ func flattenremoteSubnet(vpn *datatypes.Network_Tunnel_Module_Context) []map[str } // IBM Cloud Databases -func expandWhitelist(whiteList *schema.Set) (whitelist []icdv4.WhitelistEntry) { +func ExpandWhitelist(whiteList *schema.Set) (whitelist []icdv4.WhitelistEntry) { for _, iface := range whiteList.List() { wlItem := iface.(map[string]interface{}) wlEntry := icdv4.WhitelistEntry{ @@ -1566,7 +1614,7 @@ func expandWhitelist(whiteList *schema.Set) (whitelist []icdv4.WhitelistEntry) { } // Cloud Internet Services -func flattenWhitelist(whitelist icdv4.Whitelist) []map[string]interface{} { +func FlattenWhitelist(whitelist icdv4.Whitelist) []map[string]interface{} { entries := make([]map[string]interface{}, len(whitelist.WhitelistEntrys), len(whitelist.WhitelistEntrys)) for i, whitelistEntry := range whitelist.WhitelistEntrys { l := map[string]interface{}{ @@ -1591,7 +1639,7 @@ func expandStringMap(inVal interface{}) map[string]string { } // Cloud Internet Services -func convertTfToCisThreeVar(glbTfId string) (glbId string, zoneId string, cisId string, err error) { +func ConvertTfToCisThreeVar(glbTfId string) (glbId string, zoneId string, cisId string, err error) { g := strings.SplitN(glbTfId, ":", 3) glbId = g[0] if len(g) > 2 { @@ -1603,7 +1651,7 @@ func convertTfToCisThreeVar(glbTfId string) (glbId string, zoneId string, cisId } return } -func convertCisToTfFourVar(firewallType string, ID string, ID2 string, cisID string) (buildID string) { +func ConvertCisToTfFourVar(firewallType string, ID string, ID2 string, cisID string) (buildID string) { if ID != "" { buildID = firewallType + ":" + ID + ":" + ID2 + ":" + cisID } else { @@ -1611,7 +1659,7 @@ func convertCisToTfFourVar(firewallType string, ID string, ID2 string, cisID str } return } -func convertTfToCisFourVar(TfID string) (firewallType string, ID string, zoneID string, cisID string, err error) { +func ConvertTfToCisFourVar(TfID string) (firewallType string, ID string, zoneID string, cisID string, err error) { g := strings.SplitN(TfID, ":", 4) firewallType = g[0] if len(g) > 3 { @@ -1626,7 +1674,7 @@ func convertTfToCisFourVar(TfID string) (firewallType string, ID string, zoneID } // Cloud Internet Services -func convertCisToTfThreeVar(Id string, Id2 string, cisId string) (buildId string) { +func ConvertCisToTfThreeVar(Id string, Id2 string, cisId string) (buildId string) { if Id != "" { buildId = Id + ":" + Id2 + ":" + cisId } else { @@ -1636,7 +1684,7 @@ func convertCisToTfThreeVar(Id string, Id2 string, cisId string) (buildId string } // Cloud Internet Services -func convertTfToCisTwoVarSlice(tfIds []string) (Ids []string, cisId string, err error) { +func ConvertTfToCisTwoVarSlice(tfIds []string) (Ids []string, cisId string, err error) { for _, item := range tfIds { Id := strings.SplitN(item, ":", 2) if len(Id) < 2 { @@ -1650,7 +1698,7 @@ func convertTfToCisTwoVarSlice(tfIds []string) (Ids []string, cisId string, err } // Cloud Internet Services -func convertCisToTfTwoVarSlice(Ids []string, cisId string) (buildIds []string) { +func ConvertCisToTfTwoVarSlice(Ids []string, cisId string) (buildIds []string) { for _, Id := range Ids { buildIds = append(buildIds, Id+":"+cisId) } @@ -1658,7 +1706,7 @@ func convertCisToTfTwoVarSlice(Ids []string, cisId string) (buildIds []string) { } // Cloud Internet Services -func convertCisToTfTwoVar(Id string, cisId string) (buildId string) { +func ConvertCisToTfTwoVar(Id string, cisId string) (buildId string) { if Id != "" { buildId = Id + ":" + cisId } else { @@ -1668,7 +1716,7 @@ func convertCisToTfTwoVar(Id string, cisId string) (buildId string) { } // Cloud Internet Services -func convertTftoCisTwoVar(tfId string) (Id string, cisId string, err error) { +func ConvertTftoCisTwoVar(tfId string) (Id string, cisId string, err error) { g := strings.SplitN(tfId, ":", 2) Id = g[0] if len(g) > 1 { @@ -1679,9 +1727,46 @@ func convertTftoCisTwoVar(tfId string) (Id string, cisId string, err error) { } return } +func stringInSlice(str string, list []string) bool { + for _, v := range list { + if v == str { + return true + } + } + return false +} + +var dnsTypeIntFields = []string{ + "algorithm", + "key_tag", + "type", + "usage", + "selector", + "matching_type", + "weight", + "priority", + "port", + "long_degrees", + "lat_degrees", + "long_minutes", + "lat_minutes", + "protocol", + "digest_type", + "order", + "preference", +} + +var dnsTypeFloatFields = []string{ + "size", + "altitude", + "precision_horz", + "precision_vert", + "long_seconds", + "lat_seconds", +} // Cloud Internet Services -func transformToIBMCISDnsData(recordType string, id string, value interface{}) (newValue interface{}, err error) { +func TransformToIBMCISDnsData(recordType string, id string, value interface{}) (newValue interface{}, err error) { switch { case id == "flags": switch { @@ -1703,7 +1788,7 @@ func transformToIBMCISDnsData(recordType string, id string, value interface{}) ( return } -func indexOf(element string, data []string) int { +func IndexOf(element string, data []string) int { for k, v := range data { if element == v { return k @@ -1714,7 +1799,7 @@ func indexOf(element string, data []string) int { func rcInstanceExists(resourceId string, resourceType string, meta interface{}) (bool, error) { // Check to see if Resource Manager instance exists - rsConClient, err := meta.(ClientSession).ResourceControllerAPI() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerAPI() if err != nil { return true, nil } @@ -1725,7 +1810,7 @@ func rcInstanceExists(resourceId string, resourceType string, meta interface{}) strings.Contains(err.Error(), "status code: 404") { exists = false } else { - return true, fmt.Errorf("Error checking resource instance exists: %s", err) + return true, fmt.Errorf("[ERROR] Error checking resource instance exists: %s", err) } } else { if strings.Contains(instance.State, "removed") { @@ -1774,12 +1859,21 @@ func EscapeUrlParm(urlParm string) string { } return urlParm } +func GetLocation(instance models.ServiceInstanceV2) string { + region := instance.Crn.Region + cName := instance.Crn.CName + if cName == "bluemix" || cName == "staging" { + return region + } else { + return cName + "-" + region + } +} func GetTags(d *schema.ResourceData, meta interface{}) error { resourceID := d.Id() - gtClient, err := meta.(ClientSession).GlobalTaggingAPI() + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPI() if err != nil { - return fmt.Errorf("Error getting global tagging client settings: %s", err) + return fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) } taggingResult, err := gtClient.Tags().GetTags(resourceID) if err != nil { @@ -1789,69 +1883,69 @@ func GetTags(d *schema.ResourceData, meta interface{}) error { for _, item := range taggingResult.Items { taglist = append(taglist, item.Name) } - d.Set("tags", flattenStringList(taglist)) + d.Set("tags", FlattenStringList(taglist)) return nil } -func UpdateTags(d *schema.ResourceData, meta interface{}) error { - resourceID := d.Id() - gtClient, err := meta.(ClientSession).GlobalTaggingAPI() - if err != nil { - return fmt.Errorf("Error getting global tagging client settings: %s", err) - } - oldList, newList := d.GetChange("tags") - if oldList == nil { - oldList = new(schema.Set) - } - if newList == nil { - newList = new(schema.Set) - } - olds := oldList.(*schema.Set) - news := newList.(*schema.Set) - removeInt := olds.Difference(news).List() - addInt := news.Difference(olds).List() - add := make([]string, len(addInt)) - for i, v := range addInt { - add[i] = fmt.Sprint(v) - } - remove := make([]string, len(removeInt)) - for i, v := range removeInt { - remove[i] = fmt.Sprint(v) - } - - if len(add) > 0 { - _, err := gtClient.Tags().AttachTags(resourceID, add) - if err != nil { - return fmt.Errorf("Error updating database tags %v : %s", add, err) - } - } - if len(remove) > 0 { - _, err := gtClient.Tags().DetachTags(resourceID, remove) - if err != nil { - return fmt.Errorf("Error detaching database tags %v: %s", remove, err) - } - for _, v := range remove { - _, err := gtClient.Tags().DeleteTag(v) - if err != nil { - return fmt.Errorf("Error deleting database tag %v: %s", v, err) - } - } - } - return nil -} +// func UpdateTags(d *schema.ResourceData, meta interface{}) error { +// resourceID := d.Id() +// gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPI() +// if err != nil { +// return fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) +// } +// oldList, newList := d.GetChange("tags") +// if oldList == nil { +// oldList = new(schema.Set) +// } +// if newList == nil { +// newList = new(schema.Set) +// } +// olds := oldList.(*schema.Set) +// news := newList.(*schema.Set) +// removeInt := olds.Difference(news).List() +// addInt := news.Difference(olds).List() +// add := make([]string, len(addInt)) +// for i, v := range addInt { +// add[i] = fmt.Sprint(v) +// } +// remove := make([]string, len(removeInt)) +// for i, v := range removeInt { +// remove[i] = fmt.Sprint(v) +// } + +// if len(add) > 0 { +// _, err := gtClient.Tags().AttachTags(resourceID, add) +// if err != nil { +// return fmt.Errorf("[ERROR] Error updating database tags %v : %s", add, err) +// } +// } +// if len(remove) > 0 { +// _, err := gtClient.Tags().DetachTags(resourceID, remove) +// if err != nil { +// return fmt.Errorf("[ERROR] Error detaching database tags %v: %s", remove, err) +// } +// for _, v := range remove { +// _, err := gtClient.Tags().DeleteTag(v) +// if err != nil { +// return fmt.Errorf("[ERROR] Error deleting database tag %v: %s", v, err) +// } +// } +// } +// return nil +// } func GetGlobalTagsUsingCRN(meta interface{}, resourceID, resourceType, tagType string) (*schema.Set, error) { - gtClient, err := meta.(ClientSession).GlobalTaggingAPIv1() + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPIv1() if err != nil { - return nil, fmt.Errorf("Error getting global tagging client settings: %s", err) + return nil, fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return nil, err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount var providers []string if strings.Contains(resourceType, "SoftLayer_") { @@ -1864,10 +1958,10 @@ func GetGlobalTagsUsingCRN(meta interface{}, resourceID, resourceType, tagType s } ListTagsOptions.Providers = providers if len(tagType) > 0 { - ListTagsOptions.TagType = ptrToString(tagType) + ListTagsOptions.TagType = PtrToString(tagType) - if tagType == service { - ListTagsOptions.AccountID = ptrToString(accountID) + if tagType == "service" { + ListTagsOptions.AccountID = PtrToString(accountID) } } taggingResult, _, err := gtClient.ListTags(ListTagsOptions) @@ -1879,23 +1973,23 @@ func GetGlobalTagsUsingCRN(meta interface{}, resourceID, resourceType, tagType s taglist = append(taglist, *item.Name) } log.Println("tagList: ", taglist) - return newStringSet(resourceIBMVPCHash, taglist), nil + return NewStringSet(ResourceIBMVPCHash, taglist), nil } func UpdateGlobalTagsUsingCRN(oldList, newList interface{}, meta interface{}, resourceID, resourceType, tagType string) error { - gtClient, err := meta.(ClientSession).GlobalTaggingAPIv1() + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPIv1() if err != nil { - return fmt.Errorf("Error getting global tagging client settings: %s", err) + return fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - acctID := userDetails.userAccount + acctID := userDetails.UserAccount resources := []globaltaggingv1.Resource{} - r := globaltaggingv1.Resource{ResourceID: ptrToString(resourceID), ResourceType: ptrToString(resourceType)} + r := globaltaggingv1.Resource{ResourceID: PtrToString(resourceID), ResourceType: PtrToString(resourceType)} resources = append(resources, r) if oldList == nil { @@ -1931,23 +2025,23 @@ func UpdateGlobalTagsUsingCRN(oldList, newList interface{}, meta interface{}, re detachTagOptions.Resources = resources detachTagOptions.TagNames = remove if len(tagType) > 0 { - detachTagOptions.TagType = ptrToString(tagType) - if tagType == service { - detachTagOptions.AccountID = ptrToString(acctID) + detachTagOptions.TagType = PtrToString(tagType) + if tagType == "service" { + detachTagOptions.AccountID = PtrToString(acctID) } } _, resp, err := gtClient.DetachTag(detachTagOptions) if err != nil { - return fmt.Errorf("Error detaching database tags %v: %s\n%s", remove, err, resp) + return fmt.Errorf("[ERROR] Error detaching database tags %v: %s\n%s", remove, err, resp) } for _, v := range remove { delTagOptions := &globaltaggingv1.DeleteTagOptions{ - TagName: ptrToString(v), + TagName: PtrToString(v), } _, resp, err := gtClient.DeleteTag(delTagOptions) if err != nil { - return fmt.Errorf("Error deleting database tag %v: %s\n%s", v, err, resp) + return fmt.Errorf("[ERROR] Error deleting database tag %v: %s\n%s", v, err, resp) } } } @@ -1957,26 +2051,40 @@ func UpdateGlobalTagsUsingCRN(oldList, newList interface{}, meta interface{}, re AttachTagOptions.Resources = resources AttachTagOptions.TagNames = add if len(tagType) > 0 { - AttachTagOptions.TagType = ptrToString(tagType) - if tagType == service { - AttachTagOptions.AccountID = ptrToString(acctID) + AttachTagOptions.TagType = PtrToString(tagType) + if tagType == "service" { + AttachTagOptions.AccountID = PtrToString(acctID) } } _, resp, err := gtClient.AttachTag(AttachTagOptions) if err != nil { - return fmt.Errorf("Error updating database tags %v : %s\n%s", add, err, resp) + return fmt.Errorf("[ERROR] Error updating database tags %v : %s\n%s", add, err, resp) } } return nil } +func ResourceIBMVPCHash(v interface{}) int { + var buf bytes.Buffer + buf.WriteString(fmt.Sprintf("%s", + strings.ToLower(v.(string)))) + return conns.String(buf.String()) +} + +// Use this function for attributes which only should be applied in resource creation time. +func ApplyOnce(k, o, n string, d *schema.ResourceData) bool { + if len(d.Id()) == 0 { + return false + } + return true +} func GetTagsUsingCRN(meta interface{}, resourceCRN string) (*schema.Set, error) { - gtClient, err := meta.(ClientSession).GlobalTaggingAPI() + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPI() if err != nil { - return nil, fmt.Errorf("Error getting global tagging client settings: %s", err) + return nil, fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) } taggingResult, err := gtClient.Tags().GetTags(resourceCRN) if err != nil { @@ -1987,13 +2095,13 @@ func GetTagsUsingCRN(meta interface{}, resourceCRN string) (*schema.Set, error) taglist = append(taglist, item.Name) } log.Println("tagList: ", taglist) - return newStringSet(resourceIBMVPCHash, taglist), nil + return NewStringSet(ResourceIBMVPCHash, taglist), nil } func UpdateTagsUsingCRN(oldList, newList interface{}, meta interface{}, resourceCRN string) error { - gtClient, err := meta.(ClientSession).GlobalTaggingAPI() + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPI() if err != nil { - return fmt.Errorf("Error getting global tagging client settings: %s", err) + return fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) } if oldList == nil { oldList = new(schema.Set) @@ -2024,12 +2132,12 @@ func UpdateTagsUsingCRN(oldList, newList interface{}, meta interface{}, resource if len(remove) > 0 { _, err := gtClient.Tags().DetachTags(resourceCRN, remove) if err != nil { - return fmt.Errorf("Error detaching database tags %v: %s", remove, err) + return fmt.Errorf("[ERROR] Error detaching database tags %v: %s", remove, err) } for _, v := range remove { _, err := gtClient.Tags().DeleteTag(v) if err != nil { - return fmt.Errorf("Error deleting database tag %v: %s", v, err) + return fmt.Errorf("[ERROR] Error deleting database tag %v: %s", v, err) } } } @@ -2037,33 +2145,33 @@ func UpdateTagsUsingCRN(oldList, newList interface{}, meta interface{}, resource if len(add) > 0 { _, err := gtClient.Tags().AttachTags(resourceCRN, add) if err != nil { - return fmt.Errorf("Error updating database tags %v : %s", add, err) + return fmt.Errorf("[ERROR] Error updating database tags %v : %s", add, err) } } return nil } -func getBaseController(meta interface{}) (string, error) { - userDetails, err := meta.(ClientSession).BluemixUserDetails() +func GetBaseController(meta interface{}) (string, error) { + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return "", err } - if userDetails != nil && userDetails.cloudName == "staging" { + if userDetails != nil && userDetails.CloudName == "staging" { return stageBaseController, nil } return prodBaseController, nil } -func flattenSSLCiphers(ciphers []datatypes.Network_LBaaS_SSLCipher) *schema.Set { +func FlattenSSLCiphers(ciphers []datatypes.Network_LBaaS_SSLCipher) *schema.Set { c := make([]string, len(ciphers)) for i, v := range ciphers { c[i] = *v.Name } - return newStringSet(schema.HashString, c) + return NewStringSet(schema.HashString, c) } -func resourceTagsCustomizeDiff(diff *schema.ResourceDiff) error { +func ResourceTagsCustomizeDiff(diff *schema.ResourceDiff) error { if diff.Id() != "" && diff.HasChange("tags") { o, n := diff.GetChange("tags") @@ -2082,7 +2190,7 @@ func resourceTagsCustomizeDiff(diff *schema.ResourceDiff) error { return nil } -func resourceLBListenerPolicyCustomizeDiff(diff *schema.ResourceDiff) error { +func ResourceLBListenerPolicyCustomizeDiff(diff *schema.ResourceDiff) error { policyActionIntf, _ := diff.GetOk(isLBListenerPolicyAction) policyAction := policyActionIntf.(string) @@ -2119,7 +2227,7 @@ func resourceLBListenerPolicyCustomizeDiff(diff *schema.ResourceDiff) error { return nil } -func resourceIBMISLBPoolCookieValidate(diff *schema.ResourceDiff) error { +func ResourceIBMISLBPoolCookieValidate(diff *schema.ResourceDiff) error { _, sessionPersistenceTypeIntf := diff.GetChange(isLBPoolSessPersistenceType) _, sessionPersistenceCookieNameIntf := diff.GetChange(isLBPoolSessPersistenceAppCookieName) sessionPersistenceType := sessionPersistenceTypeIntf.(string) @@ -2140,13 +2248,13 @@ func resourceIBMISLBPoolCookieValidate(diff *schema.ResourceDiff) error { return nil } -func resourceVolumeAttachmentValidate(diff *schema.ResourceDiff) error { +func ResourceVolumeAttachmentValidate(diff *schema.ResourceDiff) error { if volsintf, ok := diff.GetOk("volume_attachments"); ok { vols := volsintf.([]interface{}) for volAttIdx := range vols { - volumeid := "volume_attachments." + strconv.Itoa(volAttIdx) + "." + isInstanceTemplateVolAttVol - volumePrototype := "volume_attachments." + strconv.Itoa(volAttIdx) + "." + isInstanceTemplateVolAttVolPrototype + volumeid := "volume_attachments." + strconv.Itoa(volAttIdx) + "." + "volume" + volumePrototype := "volume_attachments." + strconv.Itoa(volAttIdx) + "." + "volume_prototype" var volIdnterpolated = false var volumeIdFound = false if _, volumeIdFound = diff.GetOk(volumeid); !volumeIdFound { @@ -2168,23 +2276,23 @@ func resourceVolumeAttachmentValidate(diff *schema.ResourceDiff) error { return nil } -func resourceVolumeValidate(diff *schema.ResourceDiff) error { +func ResourceVolumeValidate(diff *schema.ResourceDiff) error { - if diff.Id() != "" && diff.HasChange(isVolumeCapacity) { - o, n := diff.GetChange(isVolumeCapacity) + if diff.Id() != "" && diff.HasChange("capacity") { + o, n := diff.GetChange("capacity") old := int64(o.(int)) new := int64(n.(int)) if new < old { - return fmt.Errorf("'%s' attribute has a constraint, it supports only expansion and can't be changed from %d to %d.", isVolumeCapacity, old, new) + return fmt.Errorf("'%s' attribute has a constraint, it supports only expansion and can't be changed from %d to %d.", "capacity", old, new) } } profile := "" var capacity, iops int64 - if profileOk, ok := diff.GetOk(isVolumeProfileName); ok { + if profileOk, ok := diff.GetOk("profile"); ok { profile = profileOk.(string) } - if capacityOk, ok := diff.GetOk(isVolumeCapacity); ok { + if capacityOk, ok := diff.GetOk("capacity"); ok { capacity = int64(capacityOk.(int)) } @@ -2197,19 +2305,19 @@ func resourceVolumeValidate(diff *schema.ResourceDiff) error { return fmt.Errorf("'%s' storage block supports capacity up to %d.", profile, 4800) } - if iopsOk, ok := diff.GetOk(isVolumeIops); ok { + if iopsOk, ok := diff.GetOk("iops"); ok { iops = int64(iopsOk.(int)) } - if diff.HasChange(isVolumeProfileName) { - oldProfile, newProfile := diff.GetChange(isVolumeProfileName) + if diff.HasChange("profile") { + oldProfile, newProfile := diff.GetChange("profile") if oldProfile.(string) == "custom" || newProfile.(string) == "custom" { - diff.ForceNew(isVolumeProfileName) + diff.ForceNew("profile") } } if profile != "custom" { - if iops != 0 && diff.NewValueKnown(isVolumeIops) && diff.HasChange(isVolumeIops) { + if iops != 0 && diff.NewValueKnown("iops") && diff.HasChange("iops") { return fmt.Errorf("VolumeError : iops is applicable for only custom volume profiles") } } else { @@ -2290,7 +2398,7 @@ func resourceVolumeValidate(diff *schema.ResourceDiff) error { return nil } -func resourceRouteModeValidate(diff *schema.ResourceDiff) error { +func ResourceRouteModeValidate(diff *schema.ResourceDiff) error { var lbtype, lbprofile string if typeOk, ok := diff.GetOk(isLBType); ok { @@ -2313,7 +2421,7 @@ func resourceRouteModeValidate(diff *schema.ResourceDiff) error { return nil } -func flattenRoleData(object []iampolicymanagementv1.Role, roleType string) []map[string]string { +func FlattenRoleData(object []iampolicymanagementv1.Role, roleType string) []map[string]string { var roles []map[string]string for _, item := range object { @@ -2326,7 +2434,7 @@ func flattenRoleData(object []iampolicymanagementv1.Role, roleType string) []map return roles } -func flattenCustomRoleData(object []iampolicymanagementv1.CustomRole, roleType string) []map[string]string { +func FlattenCustomRoleData(object []iampolicymanagementv1.CustomRole, roleType string) []map[string]string { var roles []map[string]string for _, item := range object { @@ -2341,15 +2449,15 @@ func flattenCustomRoleData(object []iampolicymanagementv1.CustomRole, roleType s func flattenActions(object []iampolicymanagementv1.Role) map[string]interface{} { actions := map[string]interface{}{ - "reader": flattenActionbyDisplayName("Reader", object), - "manager": flattenActionbyDisplayName("Manager", object), - "reader_plus": flattenActionbyDisplayName("ReaderPlus", object), - "writer": flattenActionbyDisplayName("Writer", object), + "reader": FlattenActionbyDisplayName("Reader", object), + "manager": FlattenActionbyDisplayName("Manager", object), + "reader_plus": FlattenActionbyDisplayName("ReaderPlus", object), + "writer": FlattenActionbyDisplayName("Writer", object), } return actions } -func flattenActionbyDisplayName(displayName string, object []iampolicymanagementv1.Role) []string { +func FlattenActionbyDisplayName(displayName string, object []iampolicymanagementv1.Role) []string { var actionIDs []string for _, role := range object { if *role.DisplayName == displayName { @@ -2399,9 +2507,9 @@ func GetNextIAM(next interface{}) string { } /* Return the default resource group */ -func defaultResourceGroup(meta interface{}) (string, error) { +func DefaultResourceGroup(meta interface{}) (string, error) { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return "", err } @@ -2419,7 +2527,7 @@ func defaultResourceGroup(meta interface{}) (string, error) { return *grpList.Resources[0].ID, nil } -func flattenKeyPolicies(policies []kp.Policy) []map[string]interface{} { +func FlattenKeyPolicies(policies []kp.Policy) []map[string]interface{} { policyMap := make([]map[string]interface{}, 0, 1) rotationMap := make([]map[string]interface{}, 0, 1) dualAuthMap := make([]map[string]interface{}, 0, 1) @@ -2450,7 +2558,7 @@ func flattenKeyPolicies(policies []kp.Policy) []map[string]interface{} { return policyMap } -func flattenKeyIndividualPolicy(policy string, policies []kp.Policy) []map[string]interface{} { +func FlattenKeyIndividualPolicy(policy string, policies []kp.Policy) []map[string]interface{} { rotationMap := make([]map[string]interface{}, 0, 1) dualAuthMap := make([]map[string]interface{}, 0, 1) for _, policy := range policies { @@ -2498,35 +2606,54 @@ func IgnoreSystemLabels(labels map[string]string) map[string]string { return result } -// expandCosConfig .. -func expandCosConfig(cos []interface{}) *kubernetesserviceapiv1.COSBucket { +// ExpandCosConfig .. +func ExpandCosConfig(cos []interface{}) *kubernetesserviceapiv1.COSBucket { if len(cos) == 0 || cos[0] == nil { return &kubernetesserviceapiv1.COSBucket{} } in := cos[0].(map[string]interface{}) obj := &kubernetesserviceapiv1.COSBucket{ - Bucket: ptrToString(in["bucket"].(string)), - Endpoint: ptrToString(in["endpoint"].(string)), - Region: ptrToString(in["region"].(string)), + Bucket: PtrToString(in["bucket"].(string)), + Endpoint: PtrToString(in["endpoint"].(string)), + Region: PtrToString(in["region"].(string)), } return obj } // expandCosCredentials .. -func expandCosCredentials(cos []interface{}) *kubernetesserviceapiv1.COSAuthorization { +func ExpandCosCredentials(cos []interface{}) *kubernetesserviceapiv1.COSAuthorization { if len(cos) == 0 || cos[0] == nil { return &kubernetesserviceapiv1.COSAuthorization{} } in := cos[0].(map[string]interface{}) obj := &kubernetesserviceapiv1.COSAuthorization{ - AccessKeyID: ptrToString(in["access_key-id"].(string)), - SecretAccessKey: ptrToString(in["secret_access_key"].(string)), + AccessKeyID: PtrToString(in["access_key-id"].(string)), + SecretAccessKey: PtrToString(in["secret_access_key"].(string)), } return obj } +func FlattenNlbConfigs(nlbData []containerv2.NlbVPCListConfig) []map[string]interface{} { + nlbConfigList := make([]map[string]interface{}, 0) + for _, n := range nlbData { + nlbConfig := make(map[string]interface{}) + nlbConfig["secret_name"] = n.SecretName + nlbConfig["secret_status"] = n.SecretStatus + c := n.Nlb + nlbConfig["cluster"] = c.Cluster + nlbConfig["dns_type"] = c.DnsType + nlbConfig["lb_hostname"] = c.LbHostname + nlbConfig["nlb_ips"] = c.NlbIPArray + nlbConfig["nlb_sub_domain"] = c.NlbSubdomain + nlbConfig["secret_namespace"] = c.SecretNamespace + nlbConfig["type"] = c.Type + nlbConfigList = append(nlbConfigList, nlbConfig) + } + + return nlbConfigList +} // flattenHostLabels .. -func flattenHostLabels(hostLabels []interface{}) map[string]string { +func FlattenHostLabels(hostLabels []interface{}) map[string]string { labels := make(map[string]string) for _, v := range hostLabels { parts := strings.Split(v.(string), ":") @@ -2538,7 +2665,7 @@ func flattenHostLabels(hostLabels []interface{}) map[string]string { return labels } -func flatterSatelliteZones(zones *schema.Set) []string { +func FlattenSatelliteZones(zones *schema.Set) []string { zoneList := make([]string, zones.Len()) for i, v := range zones.List() { zoneList[i] = fmt.Sprint(v) @@ -2554,7 +2681,7 @@ type ServiceErrorResponse struct { Result interface{} } -func beautifyError(err error, response *core.DetailedResponse) *ServiceErrorResponse { +func BeautifyError(err error, response *core.DetailedResponse) *ServiceErrorResponse { var ( statusCode int result interface{} @@ -2579,7 +2706,7 @@ func (response *ServiceErrorResponse) String() string { } // IAM Policy Management -func getResourceAttribute(name string, r iampolicymanagementv1.PolicyResource) *string { +func GetResourceAttribute(name string, r iampolicymanagementv1.PolicyResource) *string { for _, a := range r.Attributes { if *a.Name == name { return a.Value @@ -2588,7 +2715,7 @@ func getResourceAttribute(name string, r iampolicymanagementv1.PolicyResource) * return core.StringPtr("") } -func getSubjectAttribute(name string, s iampolicymanagementv1.PolicySubject) *string { +func GetSubjectAttribute(name string, s iampolicymanagementv1.PolicySubject) *string { for _, a := range s.Attributes { if *a.Name == name { return a.Value @@ -2597,7 +2724,7 @@ func getSubjectAttribute(name string, s iampolicymanagementv1.PolicySubject) *st return core.StringPtr("") } -func setResourceAttribute(name *string, value *string, r []iampolicymanagementv1.ResourceAttribute) []iampolicymanagementv1.ResourceAttribute { +func SetResourceAttribute(name *string, value *string, r []iampolicymanagementv1.ResourceAttribute) []iampolicymanagementv1.ResourceAttribute { for _, a := range r { if *a.Name == *name { a.Value = value @@ -2611,12 +2738,39 @@ func setResourceAttribute(name *string, value *string, r []iampolicymanagementv1 }) return r } +func FindRoleByName(supported []iampolicymanagementv1.PolicyRole, name string) (iampolicymanagementv1.PolicyRole, error) { + for _, role := range supported { + if role.DisplayName != nil { + if *role.DisplayName == name { + role.DisplayName = nil + return role, nil + } + } + } + supportedRoles := getSupportedRolesStr(supported) + return iampolicymanagementv1.PolicyRole{}, bmxerror.New("RoleDoesnotExist", + fmt.Sprintf("%s was not found. Valid roles are %s", name, supportedRoles)) -func getRolesFromRoleNames(roleNames []string, roles []iampolicymanagementv1.PolicyRole) ([]iampolicymanagementv1.PolicyRole, error) { +} + +func getSupportedRolesStr(supported []iampolicymanagementv1.PolicyRole) string { + rolesStr := "" + for index, role := range supported { + if index != 0 { + rolesStr += ", " + } + if role.DisplayName != nil { + rolesStr += *role.DisplayName + } + } + return rolesStr +} + +func GetRolesFromRoleNames(roleNames []string, roles []iampolicymanagementv1.PolicyRole) ([]iampolicymanagementv1.PolicyRole, error) { filteredRoles := []iampolicymanagementv1.PolicyRole{} for _, roleName := range roleNames { - role, err := findRoleByName(roles, roleName) + role, err := FindRoleByName(roles, roleName) if err != nil { return []iampolicymanagementv1.PolicyRole{}, err } @@ -2626,7 +2780,7 @@ func getRolesFromRoleNames(roleNames []string, roles []iampolicymanagementv1.Pol return filteredRoles, nil } -func mapRoleListToPolicyRoles(roleList iampolicymanagementv1.RoleList) []iampolicymanagementv1.PolicyRole { +func MapRoleListToPolicyRoles(roleList iampolicymanagementv1.RoleList) []iampolicymanagementv1.PolicyRole { var policyRoles []iampolicymanagementv1.PolicyRole for _, customRole := range roleList.CustomRoles { newPolicyRole := iampolicymanagementv1.PolicyRole{ @@ -2652,7 +2806,7 @@ func mapRoleListToPolicyRoles(roleList iampolicymanagementv1.RoleList) []iampoli return policyRoles } -func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicymanagementv1.CreatePolicyOptions, error) { +func GeneratePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicymanagementv1.CreatePolicyOptions, error) { var serviceName string var resourceType string @@ -2743,7 +2897,7 @@ func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicym if r, ok := r["attributes"]; ok { for k, v := range r.(map[string]interface{}) { - resourceAttributes = setResourceAttribute(core.StringPtr(k), core.StringPtr(v.(string)), resourceAttributes) + resourceAttributes = SetResourceAttribute(core.StringPtr(k), core.StringPtr(v.(string)), resourceAttributes) } } } @@ -2754,6 +2908,9 @@ func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicym name := a["name"].(string) value := a["value"].(string) operator := a["operator"].(string) + if name == "serviceName" { + serviceName = value + } at := iampolicymanagementv1.ResourceAttribute{ Name: &name, Value: &value, @@ -2787,12 +2944,12 @@ func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicym Attributes: resourceAttributes, } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return iampolicymanagementv1.CreatePolicyOptions{}, err } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return iampolicymanagementv1.CreatePolicyOptions{}, err @@ -2807,7 +2964,7 @@ func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicym } listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ - AccountID: &userDetails.userAccount, + AccountID: &userDetails.UserAccount, ServiceName: &serviceToQuery, } @@ -2816,8 +2973,8 @@ func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicym return iampolicymanagementv1.CreatePolicyOptions{}, err } - roles := mapRoleListToPolicyRoles(*roleList) - policyRoles, err := getRolesFromRoleNames(expandStringList(d.Get("roles").([]interface{})), roles) + roles := MapRoleListToPolicyRoles(*roleList) + policyRoles, err := GetRolesFromRoleNames(ExpandStringList(d.Get("roles").([]interface{})), roles) if err != nil { return iampolicymanagementv1.CreatePolicyOptions{}, err } @@ -2825,8 +2982,28 @@ func generatePolicyOptions(d *schema.ResourceData, meta interface{}) (iampolicym return iampolicymanagementv1.CreatePolicyOptions{Roles: policyRoles, Resources: []iampolicymanagementv1.PolicyResource{policyResources}}, nil } -func getIBMUniqueId(accountID, userEmail string, meta interface{}) (string, error) { - userManagement, err := meta.(ClientSession).UserManagementAPI() +func SetTags(d *schema.ResourceData) []iampolicymanagementv1.ResourceTag { + resourceAttributes := []iampolicymanagementv1.ResourceTag{} + if r, ok := d.GetOk("resource_tags"); ok { + for _, attribute := range r.(*schema.Set).List() { + a := attribute.(map[string]interface{}) + name := a["name"].(string) + value := a["value"].(string) + operator := a["operator"].(string) + tag := iampolicymanagementv1.ResourceTag{ + Name: &name, + Value: &value, + Operator: &operator, + } + resourceAttributes = append(resourceAttributes, tag) + } + return resourceAttributes + } + return []iampolicymanagementv1.ResourceTag{} +} + +func GetIBMUniqueId(accountID, userEmail string, meta interface{}) (string, error) { + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return "", err } @@ -2844,18 +3021,18 @@ func getIBMUniqueId(accountID, userEmail string, meta interface{}) (string, erro return "", fmt.Errorf("User %s is not found under account %s", userEmail, accountID) } -func immutableResourceCustomizeDiff(resourceList []string, diff *schema.ResourceDiff) error { +func ImmutableResourceCustomizeDiff(resourceList []string, diff *schema.ResourceDiff) error { + sateLocZone := "managed_from" for _, rName := range resourceList { if diff.Id() != "" && diff.HasChange(rName) && rName != sateLocZone { return fmt.Errorf("'%s' attribute is immutable and can't be changed", rName) - } - if diff.Id() != "" && diff.HasChange(rName) && rName == sateLocZone { + } else if diff.Id() != "" && diff.HasChange(rName) && rName == sateLocZone { o, n := diff.GetChange(rName) old := o.(string) new := n.(string) - if len(old) > 0 && old != new { - if !(rName == sateLocZone && strings.Contains(old, new)) { + if len(old) >= 3 && len(new) >= 3 { + if old[0:3] != new[0:3] { return fmt.Errorf("'%s' attribute is immutable and can't be changed from %s to %s", rName, old, new) } } @@ -2864,7 +3041,7 @@ func immutableResourceCustomizeDiff(resourceList []string, diff *schema.Resource return nil } -func flattenSatelliteWorkerPoolZones(zones *schema.Set) []kubernetesserviceapiv1.SatelliteCreateWorkerPoolZone { +func FlattenSatelliteWorkerPoolZones(zones *schema.Set) []kubernetesserviceapiv1.SatelliteCreateWorkerPoolZone { zoneList := make([]kubernetesserviceapiv1.SatelliteCreateWorkerPoolZone, zones.Len()) for i, v := range zones.List() { data := v.(map[string]interface{}) @@ -2876,7 +3053,7 @@ func flattenSatelliteWorkerPoolZones(zones *schema.Set) []kubernetesserviceapiv1 return zoneList } -func flattenSatelliteWorkerPools(list []kubernetesserviceapiv1.GetWorkerPoolResponse) []map[string]interface{} { +func FlattenSatelliteWorkerPools(list []kubernetesserviceapiv1.GetWorkerPoolResponse) []map[string]interface{} { workerPools := make([]map[string]interface{}, len(list)) for i, workerPool := range list { l := map[string]interface{}{ @@ -2905,7 +3082,7 @@ func flattenSatelliteWorkerPools(list []kubernetesserviceapiv1.GetWorkerPoolResp return workerPools } -func flattenSatelliteHosts(hostList []kubernetesserviceapiv1.MultishiftQueueNode) []map[string]interface{} { +func FlattenSatelliteHosts(hostList []kubernetesserviceapiv1.MultishiftQueueNode) []map[string]interface{} { hosts := make([]map[string]interface{}, len(hostList)) for i, host := range hostList { l := map[string]interface{}{ @@ -2923,7 +3100,7 @@ func flattenSatelliteHosts(hostList []kubernetesserviceapiv1.MultishiftQueueNode return hosts } -func flattenWorkerPoolHostLabels(hostLabels map[string]string) *schema.Set { +func FlattenWorkerPoolHostLabels(hostLabels map[string]string) *schema.Set { mapped := make([]string, len(hostLabels)) idx := 0 for k, v := range hostLabels { @@ -2931,7 +3108,7 @@ func flattenWorkerPoolHostLabels(hostLabels map[string]string) *schema.Set { idx++ } - return newStringSet(schema.HashString, mapped) + return NewStringSet(schema.HashString, mapped) } // KMS Private Endpoint @@ -2943,13 +3120,13 @@ func updatePrivateURL(kpURL string) (string, error) { kmsEndpointURL = kmsEndpURL[0] + "private." + kmsEndpURL[1] + "/api/v2/" } else { - return "", fmt.Errorf("Error in Kms EndPoint URL ") + return "", fmt.Errorf("[ERROR] Error in Kms EndPoint URL ") } } return kmsEndpointURL, nil } -func flattenSatelliteClusterZones(list []string) []map[string]interface{} { +func FlattenSatelliteClusterZones(list []string) []map[string]interface{} { zones := make([]map[string]interface{}, len(list)) for i, zone := range list { l := map[string]interface{}{ diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/map.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/map.go deleted file mode 100644 index 153ae70d69..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/map.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "strings" -) - -// Map is a wrapper around map[string]string that provides some helpers -// above it that assume the map is in the format that flatmap expects -// (the result of Flatten). -// -// All modifying functions such as Delete are done in-place unless -// otherwise noted. -type Map map[string]string - -// Contains returns true if the map contains the given key. -func (m Map) Contains(key string) bool { - for _, k := range m.Keys() { - if k == key { - return true - } - } - - return false -} - -// Delete deletes a key out of the map with the given prefix. -func (m Map) Delete(prefix string) { - for k, _ := range m { - match := k == prefix - if !match { - if !strings.HasPrefix(k, prefix) { - continue - } - - if k[len(prefix):len(prefix)+1] != "." { - continue - } - } - - delete(m, k) - } -} - -// Keys returns all of the top-level keys in this map -func (m Map) Keys() []string { - ks := make(map[string]struct{}) - for k, _ := range m { - idx := strings.Index(k, ".") - if idx == -1 { - idx = len(k) - } - - ks[k[:idx]] = struct{}{} - } - - result := make([]string, 0, len(ks)) - for k, _ := range ks { - result = append(result, k) - } - - return result -} - -// Merge merges the contents of the other Map into this one. -// -// This merge is smarter than a simple map iteration because it -// will fully replace arrays and other complex structures that -// are present in this map with the other map's. For example, if -// this map has a 3 element "foo" list, and m2 has a 2 element "foo" -// list, then the result will be that m has a 2 element "foo" -// list. -func (m Map) Merge(m2 Map) { - for _, prefix := range m2.Keys() { - m.Delete(prefix) - - for k, v := range m2 { - if strings.HasPrefix(k, prefix) { - m[k] = v - } - } - } -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider.go deleted file mode 100644 index 44b15cb7bd..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider.go +++ /dev/null @@ -1,1094 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "os" - "sync" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/mutexkv" -) - -// This is a global MutexKV for use within this plugin. -var ibmMutexKV = mutexkv.NewMutexKV() - -// Provider returns a *schema.Provider. -func Provider() *schema.Provider { - return &schema.Provider{ - Schema: map[string]*schema.Schema{ - "bluemix_api_key": { - Type: schema.TypeString, - Optional: true, - Description: "The Bluemix API Key", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"BM_API_KEY", "BLUEMIX_API_KEY"}, nil), - Deprecated: "This field is deprecated please use ibmcloud_api_key", - }, - "bluemix_timeout": { - Type: schema.TypeInt, - Optional: true, - Description: "The timeout (in seconds) to set for any Bluemix API calls made.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"BM_TIMEOUT", "BLUEMIX_TIMEOUT"}, nil), - Deprecated: "This field is deprecated please use ibmcloud_timeout", - }, - "ibmcloud_api_key": { - Type: schema.TypeString, - Optional: true, - Description: "The IBM Cloud API Key", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_API_KEY", "IBMCLOUD_API_KEY"}, nil), - }, - "ibmcloud_timeout": { - Type: schema.TypeInt, - Optional: true, - Description: "The timeout (in seconds) to set for any IBM Cloud API calls made.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_TIMEOUT", "IBMCLOUD_TIMEOUT"}, 60), - }, - "region": { - Type: schema.TypeString, - Optional: true, - Description: "The IBM cloud Region (for example 'us-south').", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_REGION", "IBMCLOUD_REGION", "BM_REGION", "BLUEMIX_REGION"}, "us-south"), - }, - "zone": { - Type: schema.TypeString, - Optional: true, - Description: "The IBM cloud Region zone (for example 'us-south-1') for power resources.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_ZONE", "IBMCLOUD_ZONE"}, ""), - }, - "resource_group": { - Type: schema.TypeString, - Optional: true, - Description: "The Resource group id.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_RESOURCE_GROUP", "IBMCLOUD_RESOURCE_GROUP", "BM_RESOURCE_GROUP", "BLUEMIX_RESOURCE_GROUP"}, ""), - }, - "softlayer_api_key": { - Type: schema.TypeString, - Optional: true, - Description: "The SoftLayer API Key", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_API_KEY", "SOFTLAYER_API_KEY"}, nil), - Deprecated: "This field is deprecated please use iaas_classic_api_key", - }, - "softlayer_username": { - Type: schema.TypeString, - Optional: true, - Description: "The SoftLayer user name", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_USERNAME", "SOFTLAYER_USERNAME"}, nil), - Deprecated: "This field is deprecated please use iaas_classic_username", - }, - "softlayer_endpoint_url": { - Type: schema.TypeString, - Optional: true, - Description: "The Softlayer Endpoint", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_ENDPOINT_URL", "SOFTLAYER_ENDPOINT_URL"}, nil), - Deprecated: "This field is deprecated please use iaas_classic_endpoint_url", - }, - "softlayer_timeout": { - Type: schema.TypeInt, - Optional: true, - Description: "The timeout (in seconds) to set for any SoftLayer API calls made.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_TIMEOUT", "SOFTLAYER_TIMEOUT"}, nil), - Deprecated: "This field is deprecated please use iaas_classic_timeout", - }, - "iaas_classic_api_key": { - Type: schema.TypeString, - Optional: true, - Description: "The Classic Infrastructure API Key", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_API_KEY"}, nil), - }, - "iaas_classic_username": { - Type: schema.TypeString, - Optional: true, - Description: "The Classic Infrastructure API user name", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_USERNAME"}, nil), - }, - "iaas_classic_endpoint_url": { - Type: schema.TypeString, - Optional: true, - Description: "The Classic Infrastructure Endpoint", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_ENDPOINT_URL"}, "https://api.softlayer.com/rest/v3"), - }, - "iaas_classic_timeout": { - Type: schema.TypeInt, - Optional: true, - Description: "The timeout (in seconds) to set for any Classic Infrastructure API calls made.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_TIMEOUT"}, 60), - }, - "max_retries": { - Type: schema.TypeInt, - Optional: true, - Description: "The retry count to set for API calls.", - DefaultFunc: schema.EnvDefaultFunc("MAX_RETRIES", 10), - }, - "function_namespace": { - Type: schema.TypeString, - Optional: true, - Description: "The IBM Cloud Function namespace", - DefaultFunc: schema.EnvDefaultFunc("FUNCTION_NAMESPACE", nil), - Deprecated: "This field will be deprecated soon", - }, - "riaas_endpoint": { - Type: schema.TypeString, - Optional: true, - Description: "The next generation infrastructure service endpoint url.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"RIAAS_ENDPOINT"}, nil), - Deprecated: "This field is deprecated use generation", - }, - "generation": { - Type: schema.TypeInt, - Optional: true, - Description: "Generation of Virtual Private Cloud. Default is 2", - //DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_GENERATION", "IBMCLOUD_GENERATION"}, nil), - Deprecated: "The generation field is deprecated and will be removed after couple of releases", - }, - "iam_profile_id": { - Type: schema.TypeString, - Optional: true, - Description: "IAM Trusted Profile Authentication token", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_IAM_PROFILE_ID", "IBMCLOUD_IAM_PROFILE_ID"}, nil), - }, - "iam_token": { - Type: schema.TypeString, - Optional: true, - Description: "IAM Authentication token", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_IAM_TOKEN", "IBMCLOUD_IAM_TOKEN"}, nil), - }, - "iam_refresh_token": { - Type: schema.TypeString, - Optional: true, - Description: "IAM Authentication refresh token", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_IAM_REFRESH_TOKEN", "IBMCLOUD_IAM_REFRESH_TOKEN"}, nil), - }, - "visibility": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "public-and-private"}), - Description: "Visibility of the provider if it is private or public.", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_VISIBILITY", "IBMCLOUD_VISIBILITY"}, "public"), - }, - "endpoints_file_path": { - Type: schema.TypeString, - Optional: true, - Description: "Path of the file that contains private and public regional endpoints mapping", - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_ENDPOINTS_FILE_PATH", "IBMCLOUD_ENDPOINTS_FILE_PATH"}, nil), - }, - }, - - DataSourcesMap: map[string]*schema.Resource{ - "ibm_api_gateway": dataSourceIBMApiGateway(), - "ibm_account": dataSourceIBMAccount(), - "ibm_app": dataSourceIBMApp(), - "ibm_app_domain_private": dataSourceIBMAppDomainPrivate(), - "ibm_app_domain_shared": dataSourceIBMAppDomainShared(), - "ibm_app_route": dataSourceIBMAppRoute(), - - // AppID - "ibm_appid_action_url": dataSourceIBMAppIDActionURL(), - "ibm_appid_apm": dataSourceIBMAppIDAPM(), - "ibm_appid_application": dataSourceIBMAppIDApplication(), - "ibm_appid_application_scopes": dataSourceIBMAppIDApplicationScopes(), - "ibm_appid_application_roles": dataSourceIBMAppIDApplicationRoles(), - "ibm_appid_applications": dataSourceIBMAppIDApplications(), - "ibm_appid_audit_status": dataSourceIBMAppIDAuditStatus(), - "ibm_appid_cloud_directory_template": dataSourceIBMAppIDCloudDirectoryTemplate(), - "ibm_appid_cloud_directory_user": dataSourceIBMAppIDCloudDirectoryUser(), - "ibm_appid_idp_cloud_directory": dataSourceIBMAppIDIDPCloudDirectory(), - "ibm_appid_idp_custom": dataSourceIBMAppIDIDPCustom(), - "ibm_appid_idp_facebook": dataSourceIBMAppIDIDPFacebook(), - "ibm_appid_idp_google": dataSourceIBMAppIDIDPGoogle(), - "ibm_appid_idp_saml": dataSourceIBMAppIDIDPSAML(), - "ibm_appid_idp_saml_metadata": dataSourceIBMAppIDIDPSAMLMetadata(), - "ibm_appid_languages": dataSourceIBMAppIDLanguages(), - "ibm_appid_mfa": dataSourceIBMAppIDMFA(), - "ibm_appid_mfa_channel": dataSourceIBMAppIDMFAChannel(), - "ibm_appid_password_regex": dataSourceIBMAppIDPasswordRegex(), - "ibm_appid_token_config": dataSourceIBMAppIDTokenConfig(), - "ibm_appid_redirect_urls": dataSourceIBMAppIDRedirectURLs(), - "ibm_appid_role": dataSourceIBMAppIDRole(), - "ibm_appid_roles": dataSourceIBMAppIDRoles(), - "ibm_appid_theme_color": dataSourceIBMAppIDThemeColor(), - "ibm_appid_theme_text": dataSourceIBMAppIDThemeText(), - "ibm_appid_user_roles": dataSourceIBMAppIDUserRoles(), - - "ibm_function_action": dataSourceIBMFunctionAction(), - "ibm_function_package": dataSourceIBMFunctionPackage(), - "ibm_function_rule": dataSourceIBMFunctionRule(), - "ibm_function_trigger": dataSourceIBMFunctionTrigger(), - "ibm_function_namespace": dataSourceIBMFunctionNamespace(), - "ibm_certificate_manager_certificates": dataIBMCertificateManagerCertificates(), - "ibm_certificate_manager_certificate": dataIBMCertificateManagerCertificate(), - "ibm_cis": dataSourceIBMCISInstance(), - "ibm_cis_dns_records": dataSourceIBMCISDNSRecords(), - "ibm_cis_certificates": dataIBMCISCertificates(), - "ibm_cis_global_load_balancers": dataSourceIBMCISGlbs(), - "ibm_cis_origin_pools": dataSourceIBMCISOriginPools(), - "ibm_cis_healthchecks": dataSourceIBMCISHealthChecks(), - "ibm_cis_domain": dataSourceIBMCISDomain(), - "ibm_cis_firewall": dataIBMCISFirewallsRecord(), - "ibm_cis_cache_settings": dataSourceIBMCISCacheSetting(), - "ibm_cis_waf_packages": dataSourceIBMCISWAFPackages(), - "ibm_cis_range_apps": dataSourceIBMCISRangeApps(), - "ibm_cis_custom_certificates": dataSourceIBMCISCustomCertificates(), - "ibm_cis_rate_limit": dataSourceIBMCISRateLimit(), - "ibm_cis_ip_addresses": dataSourceIBMCISIP(), - "ibm_cis_waf_groups": dataSourceIBMCISWAFGroups(), - "ibm_cis_edge_functions_actions": dataSourceIBMCISEdgeFunctionsActions(), - "ibm_cis_edge_functions_triggers": dataSourceIBMCISEdgeFunctionsTriggers(), - "ibm_cis_custom_pages": dataSourceIBMCISCustomPages(), - "ibm_cis_page_rules": dataSourceIBMCISPageRules(), - "ibm_cis_waf_rules": dataSourceIBMCISWAFRules(), - "ibm_cis_filters": dataSourceIBMCISFilters(), - "ibm_cis_firewall_rules": dataSourceIBMCISFirewallRules(), - "ibm_cloudant": dataSourceIBMCloudant(), - "ibm_database": dataSourceIBMDatabaseInstance(), - "ibm_compute_bare_metal": dataSourceIBMComputeBareMetal(), - "ibm_compute_image_template": dataSourceIBMComputeImageTemplate(), - "ibm_compute_placement_group": dataSourceIBMComputePlacementGroup(), - "ibm_compute_reserved_capacity": dataSourceIBMComputeReservedCapacity(), - "ibm_compute_ssh_key": dataSourceIBMComputeSSHKey(), - "ibm_compute_vm_instance": dataSourceIBMComputeVmInstance(), - "ibm_container_addons": datasourceIBMContainerAddOns(), - "ibm_container_alb": dataSourceIBMContainerALB(), - "ibm_container_alb_cert": dataSourceIBMContainerALBCert(), - "ibm_container_bind_service": dataSourceIBMContainerBindService(), - "ibm_container_cluster": dataSourceIBMContainerCluster(), - "ibm_container_cluster_config": dataSourceIBMContainerClusterConfig(), - "ibm_container_cluster_versions": dataSourceIBMContainerClusterVersions(), - "ibm_container_cluster_worker": dataSourceIBMContainerClusterWorker(), - "ibm_container_nlb_dns": dataSourceIBMContainerNLBDNS(), - "ibm_container_vpc_cluster_alb": dataSourceIBMContainerVPCClusterALB(), - "ibm_container_vpc_alb": dataSourceIBMContainerVPCClusterALB(), - "ibm_container_vpc_cluster": dataSourceIBMContainerVPCCluster(), - "ibm_container_vpc_cluster_worker": dataSourceIBMContainerVPCClusterWorker(), - "ibm_container_vpc_cluster_worker_pool": dataSourceIBMContainerVpcClusterWorkerPool(), - "ibm_container_vpc_worker_pool": dataSourceIBMContainerVpcClusterWorkerPool(), - "ibm_container_worker_pool": dataSourceIBMContainerWorkerPool(), - "ibm_container_storage_attachment": dataSourceIBMContainerVpcWorkerVolumeAttachment(), - "ibm_cr_namespaces": dataIBMContainerRegistryNamespaces(), - "ibm_cloud_shell_account_settings": dataSourceIBMCloudShellAccountSettings(), - "ibm_cos_bucket": dataSourceIBMCosBucket(), - "ibm_cos_bucket_object": dataSourceIBMCosBucketObject(), - "ibm_dns_domain_registration": dataSourceIBMDNSDomainRegistration(), - "ibm_dns_domain": dataSourceIBMDNSDomain(), - "ibm_dns_secondary": dataSourceIBMDNSSecondary(), - "ibm_event_streams_topic": dataSourceIBMEventStreamsTopic(), - "ibm_event_streams_schema": dataSourceIBMEventStreamsSchema(), - "ibm_hpcs": dataSourceIBMHPCS(), - "ibm_iam_access_group": dataSourceIBMIAMAccessGroup(), - "ibm_iam_access_group_policy": dataSourceIBMIAMAccessGroupPolicy(), - "ibm_iam_account_settings": dataSourceIBMIAMAccountSettings(), - "ibm_iam_auth_token": dataSourceIBMIAMAuthToken(), - "ibm_iam_role_actions": datasourceIBMIAMRoleAction(), - "ibm_iam_users": dataSourceIBMIAMUsers(), - "ibm_iam_roles": datasourceIBMIAMRole(), - "ibm_iam_user_policy": dataSourceIBMIAMUserPolicy(), - "ibm_iam_authorization_policies": dataSourceIBMIAMAuthorizationPolicies(), - "ibm_iam_user_profile": dataSourceIBMIAMUserProfile(), - "ibm_iam_service_id": dataSourceIBMIAMServiceID(), - "ibm_iam_service_policy": dataSourceIBMIAMServicePolicy(), - "ibm_iam_api_key": dataSourceIbmIamApiKey(), - "ibm_iam_trusted_profile": dataSourceIBMIamTrustedProfile(), - "ibm_iam_trusted_profile_claim_rule": dataSourceIBMIamTrustedProfileClaimRule(), - "ibm_iam_trusted_profile_link": dataSourceIBMIamTrustedProfileLink(), - "ibm_iam_trusted_profile_claim_rules": dataSourceIBMIamTrustedProfileClaimRules(), - "ibm_iam_trusted_profile_links": dataSourceIBMIamTrustedProfileLinks(), - "ibm_iam_trusted_profiles": dataSourceIBMIamTrustedProfiles(), - "ibm_iam_trusted_profile_policy": dataSourceIBMIAMTrustedProfilePolicy(), - "ibm_is_dedicated_host": dataSourceIbmIsDedicatedHost(), - "ibm_is_dedicated_hosts": dataSourceIbmIsDedicatedHosts(), - "ibm_is_dedicated_host_profile": dataSourceIbmIsDedicatedHostProfile(), - "ibm_is_dedicated_host_profiles": dataSourceIbmIsDedicatedHostProfiles(), - "ibm_is_dedicated_host_group": dataSourceIbmIsDedicatedHostGroup(), - "ibm_is_dedicated_host_groups": dataSourceIbmIsDedicatedHostGroups(), - "ibm_is_dedicated_host_disk": dataSourceIbmIsDedicatedHostDisk(), - "ibm_is_dedicated_host_disks": dataSourceIbmIsDedicatedHostDisks(), - "ibm_is_placement_group": dataSourceIbmIsPlacementGroup(), - "ibm_is_placement_groups": dataSourceIbmIsPlacementGroups(), - "ibm_is_floating_ip": dataSourceIBMISFloatingIP(), - "ibm_is_floating_ips": dataSourceIBMIsFloatingIps(), - "ibm_is_flow_log": dataSourceIBMIsFlowLog(), - "ibm_is_flow_logs": dataSourceIBMISFlowLogs(), - "ibm_is_image": dataSourceIBMISImage(), - "ibm_is_images": dataSourceIBMISImages(), - "ibm_is_endpoint_gateway_targets": dataSourceIBMISEndpointGatewayTargets(), - "ibm_is_instance_group": dataSourceIBMISInstanceGroup(), - "ibm_is_instance_group_memberships": dataSourceIBMISInstanceGroupMemberships(), - "ibm_is_instance_group_membership": dataSourceIBMISInstanceGroupMembership(), - "ibm_is_instance_group_manager": dataSourceIBMISInstanceGroupManager(), - "ibm_is_instance_group_managers": dataSourceIBMISInstanceGroupManagers(), - "ibm_is_instance_group_manager_policies": dataSourceIBMISInstanceGroupManagerPolicies(), - "ibm_is_instance_group_manager_policy": dataSourceIBMISInstanceGroupManagerPolicy(), - "ibm_is_instance_group_manager_action": dataSourceIBMISInstanceGroupManagerAction(), - "ibm_is_instance_group_manager_actions": dataSourceIBMISInstanceGroupManagerActions(), - "ibm_is_virtual_endpoint_gateways": dataSourceIBMISEndpointGateways(), - "ibm_is_virtual_endpoint_gateway_ips": dataSourceIBMISEndpointGatewayIPs(), - "ibm_is_virtual_endpoint_gateway": dataSourceIBMISEndpointGateway(), - "ibm_is_instance_template": dataSourceIBMISInstanceTemplate(), - "ibm_is_instance_templates": dataSourceIBMISInstanceTemplates(), - "ibm_is_instance_profile": dataSourceIBMISInstanceProfile(), - "ibm_is_instance_profiles": dataSourceIBMISInstanceProfiles(), - "ibm_is_instance": dataSourceIBMISInstance(), - "ibm_is_instances": dataSourceIBMISInstances(), - "ibm_is_instance_network_interface": dataSourceIBMIsInstanceNetworkInterface(), - "ibm_is_instance_network_interfaces": dataSourceIBMIsInstanceNetworkInterfaces(), - "ibm_is_instance_disk": dataSourceIbmIsInstanceDisk(), - "ibm_is_instance_disks": dataSourceIbmIsInstanceDisks(), - "ibm_is_instance_volume_attachment": dataSourceIBMISInstanceVolumeAttachment(), - "ibm_is_instance_volume_attachments": dataSourceIBMISInstanceVolumeAttachments(), - "ibm_is_lb": dataSourceIBMISLB(), - "ibm_is_lb_profiles": dataSourceIBMISLbProfiles(), - "ibm_is_lbs": dataSourceIBMISLBS(), - "ibm_is_public_gateway": dataSourceIBMISPublicGateway(), - "ibm_is_public_gateways": dataSourceIBMISPublicGateways(), - "ibm_is_region": dataSourceIBMISRegion(), - "ibm_is_regions": dataSourceIBMISRegions(), - "ibm_is_ssh_key": dataSourceIBMISSSHKey(), - "ibm_is_subnet": dataSourceIBMISSubnet(), - "ibm_is_subnets": dataSourceIBMISSubnets(), - "ibm_is_subnet_reserved_ip": dataSourceIBMISReservedIP(), - "ibm_is_subnet_reserved_ips": dataSourceIBMISReservedIPs(), - "ibm_is_security_group": dataSourceIBMISSecurityGroup(), - "ibm_is_security_group_target": dataSourceIBMISSecurityGroupTarget(), - "ibm_is_security_group_targets": dataSourceIBMISSecurityGroupTargets(), - "ibm_is_snapshot": dataSourceSnapshot(), - "ibm_is_snapshots": dataSourceSnapshots(), - "ibm_is_volume": dataSourceIBMISVolume(), - "ibm_is_volume_profile": dataSourceIBMISVolumeProfile(), - "ibm_is_volume_profiles": dataSourceIBMISVolumeProfiles(), - "ibm_is_vpc": dataSourceIBMISVPC(), - "ibm_is_vpcs": dataSourceIBMISVPCs(), - "ibm_is_vpn_gateways": dataSourceIBMISVPNGateways(), - "ibm_is_vpc_address_prefixes": dataSourceIbmIsVpcAddressPrefixes(), - "ibm_is_vpn_gateway_connections": dataSourceIBMISVPNGatewayConnections(), - "ibm_is_vpc_default_routing_table": dataSourceIBMISVPCDefaultRoutingTable(), - "ibm_is_vpc_routing_tables": dataSourceIBMISVPCRoutingTables(), - "ibm_is_vpc_routing_table_routes": dataSourceIBMISVPCRoutingTableRoutes(), - "ibm_is_zone": dataSourceIBMISZone(), - "ibm_is_zones": dataSourceIBMISZones(), - "ibm_is_operating_system": dataSourceIBMISOperatingSystem(), - "ibm_is_operating_systems": dataSourceIBMISOperatingSystems(), - "ibm_is_network_acls": dataSourceIBMIsNetworkAcls(), - "ibm_is_network_acl": dataSourceIBMIsNetworkACL(), - "ibm_is_network_acl_rule": dataSourceIBMISNetworkACLRule(), - "ibm_is_network_acl_rules": dataSourceIBMISNetworkACLRules(), - "ibm_lbaas": dataSourceIBMLbaas(), - "ibm_network_vlan": dataSourceIBMNetworkVlan(), - "ibm_org": dataSourceIBMOrg(), - "ibm_org_quota": dataSourceIBMOrgQuota(), - "ibm_kp_key": dataSourceIBMkey(), - "ibm_kms_key_rings": dataSourceIBMKMSkeyRings(), - "ibm_kms_key_policies": dataSourceIBMKMSkeyPolicies(), - "ibm_kms_keys": dataSourceIBMKMSkeys(), - "ibm_pn_application_chrome": dataSourceIBMPNApplicationChrome(), - "ibm_app_config_environment": dataSourceIbmAppConfigEnvironment(), - "ibm_app_config_environments": dataSourceIbmAppConfigEnvironments(), - "ibm_app_config_feature": dataSourceIbmAppConfigFeature(), - "ibm_app_config_features": dataSourceIbmAppConfigFeatures(), - "ibm_kms_key": dataSourceIBMKMSkey(), - "ibm_resource_quota": dataSourceIBMResourceQuota(), - "ibm_resource_group": dataSourceIBMResourceGroup(), - "ibm_resource_instance": dataSourceIBMResourceInstance(), - "ibm_resource_key": dataSourceIBMResourceKey(), - "ibm_security_group": dataSourceIBMSecurityGroup(), - "ibm_service_instance": dataSourceIBMServiceInstance(), - "ibm_service_key": dataSourceIBMServiceKey(), - "ibm_service_plan": dataSourceIBMServicePlan(), - "ibm_space": dataSourceIBMSpace(), - - // Added for Schematics - "ibm_schematics_workspace": dataSourceIBMSchematicsWorkspace(), - "ibm_schematics_output": dataSourceIBMSchematicsOutput(), - "ibm_schematics_state": dataSourceIBMSchematicsState(), - "ibm_schematics_action": dataSourceIBMSchematicsAction(), - "ibm_schematics_job": dataSourceIBMSchematicsJob(), - "ibm_schematics_inventory": dataSourceIBMSchematicsInventory(), - "ibm_schematics_resource_query": dataSourceIBMSchematicsResourceQuery(), - - // Added for Power Resources - - "ibm_pi_key": dataSourceIBMPIKey(), - "ibm_pi_keys": dataSourceIBMPIKeys(), - "ibm_pi_image": dataSourceIBMPIImage(), - "ibm_pi_instance": dataSourceIBMPIInstance(), - "ibm_pi_tenant": dataSourceIBMPITenant(), - "ibm_pi_network": dataSourceIBMPINetwork(), - "ibm_pi_volume": dataSourceIBMPIVolume(), - "ibm_pi_instance_volumes": dataSourceIBMPIInstanceVolumes(), - "ibm_pi_public_network": dataSourceIBMPIPublicNetwork(), - "ibm_pi_images": dataSourceIBMPIImages(), - "ibm_pi_instance_ip": dataSourceIBMPIInstanceIP(), - "ibm_pi_instance_snapshots": dataSourceIBMPISnapshots(), - "ibm_pi_pvm_snapshots": dataSourceIBMPISnapshot(), - "ibm_pi_network_port": dataSourceIBMPINetworkPort(), - "ibm_pi_cloud_instance": dataSourceIBMPICloudInstance(), - "ibm_pi_catalog_images": dataSourceIBMPICatalogImages(), - "ibm_pi_dhcp": dataSourceIBMPIDhcp(), - "ibm_pi_dhcps": dataSourceIBMPIDhcps(), - "ibm_pi_cloud_connection": dataSourceIBMPICloudConnection(), - "ibm_pi_cloud_connections": dataSourceIBMPICloudConnections(), - "ibm_pi_sap_profiles": dataSourceIBMPISAPProfiles(), - "ibm_pi_sap_profile": dataSourceIBMPISAPProfile(), - "ibm_pi_console_languages": dataSourceIBMPIInstanceConsoleLanguages(), - "ibm_pi_placement_group": dataSourceIBMPIPlacementGroup(), - "ibm_pi_placement_groups": dataSourceIBMPIPlacementGroups(), - - // Added for private dns zones - - "ibm_dns_zones": dataSourceIBMPrivateDNSZones(), - "ibm_dns_permitted_networks": dataSourceIBMPrivateDNSPermittedNetworks(), - "ibm_dns_resource_records": dataSourceIBMPrivateDNSResourceRecords(), - "ibm_dns_glb_monitors": dataSourceIBMPrivateDNSGLBMonitors(), - "ibm_dns_glb_pools": dataSourceIBMPrivateDNSGLBPools(), - "ibm_dns_glbs": dataSourceIBMPrivateDNSGLBs(), - "ibm_dns_custom_resolvers": dataSourceIBMDNSCustomResolver(), - "ibm_dns_custom_resolver_forwarding_rules": dataSourceIBMPrivateDNSForwardingRules(), - - // Added for Direct Link - - "ibm_dl_gateways": dataSourceIBMDLGateways(), - "ibm_dl_offering_speeds": dataSourceIBMDLOfferingSpeeds(), - "ibm_dl_port": dataSourceIBMDirectLinkPort(), - "ibm_dl_ports": dataSourceIBMDirectLinkPorts(), - "ibm_dl_gateway": dataSourceIBMDLGateway(), - "ibm_dl_locations": dataSourceIBMDLLocations(), - "ibm_dl_routers": dataSourceIBMDLRouters(), - "ibm_dl_provider_ports": dataSourceIBMDirectLinkProviderPorts(), - "ibm_dl_provider_gateways": dataSourceIBMDirectLinkProviderGateways(), - - //Added for Transit Gateway - "ibm_tg_gateway": dataSourceIBMTransitGateway(), - "ibm_tg_gateways": dataSourceIBMTransitGateways(), - "ibm_tg_locations": dataSourceIBMTransitGatewaysLocations(), - "ibm_tg_location": dataSourceIBMTransitGatewaysLocation(), - - //Added for BSS Enterprise - "ibm_enterprises": dataSourceIbmEnterprises(), - "ibm_enterprise_account_groups": dataSourceIbmEnterpriseAccountGroups(), - "ibm_enterprise_accounts": dataSourceIbmEnterpriseAccounts(), - - //Added for Secrets Manager - "ibm_secrets_manager_secrets": dataSourceIBMSecretsManagerSecrets(), - "ibm_secrets_manager_secret": dataSourceIBMSecretsManagerSecret(), - - //Added for Satellite - "ibm_satellite_location": dataSourceIBMSatelliteLocation(), - "ibm_satellite_location_nlb_dns": dataSourceIBMSatelliteLocationNLBDNS(), - "ibm_satellite_attach_host_script": dataSourceIBMSatelliteAttachHostScript(), - "ibm_satellite_cluster": dataSourceIBMSatelliteCluster(), - "ibm_satellite_cluster_worker_pool": dataSourceIBMSatelliteClusterWorkerPool(), - "ibm_satellite_link": dataSourceIbmSatelliteLink(), - "ibm_satellite_endpoint": dataSourceIbmSatelliteEndpoint(), - "ibm_satellite_cluster_worker_pool_zone_attachment": dataSourceIBMSatelliteClusterWorkerPoolAttachment(), - - // Catalog related resources - "ibm_cm_catalog": dataSourceIBMCmCatalog(), - "ibm_cm_offering": dataSourceIBMCmOffering(), - "ibm_cm_version": dataSourceIBMCmVersion(), - "ibm_cm_offering_instance": dataSourceIBMCmOfferingInstance(), - - //Added for Resource Tag - "ibm_resource_tag": dataSourceIBMResourceTag(), - - // Atracker - "ibm_atracker_targets": dataSourceIBMAtrackerTargets(), - "ibm_atracker_routes": dataSourceIBMAtrackerRoutes(), - "ibm_atracker_endpoints": dataSourceIBMAtrackerEndpoints(), - - //Security and Compliance Center - "ibm_scc_si_providers": dataSourceIBMSccSiProviders(), - "ibm_scc_si_note": dataSourceIBMSccSiNote(), - "ibm_scc_si_notes": dataSourceIBMSccSiNotes(), - "ibm_scc_account_location": dataSourceIbmSccAccountLocation(), - "ibm_scc_account_locations": dataSourceIbmSccAccountLocations(), - "ibm_scc_account_settings": dataSourceIbmSccAccountLocationSettings(), - "ibm_scc_si_occurrence": dataSourceIBMSccSiOccurrence(), - "ibm_scc_si_occurrences": dataSourceIBMSccSiOccurrences(), - - // Compliance Posture Management - "ibm_scc_posture_scopes": dataSourceIBMSccPostureScopes(), - "ibm_scc_posture_latest_scans": dataSourceIBMSccPostureLatestScans(), - "ibm_scc_posture_profiles": dataSourceIBMSccPostureProfiles(), - "ibm_scc_posture_scan_summary": dataSourceIBMSccPostureScansSummary(), - "ibm_scc_posture_scan_summaries": dataSourceIBMSccPostureScanSummaries(), - "ibm_scc_posture_profile": dataSourceIBMSccPostureProfileDetails(), - "ibm_scc_posture_group_profile": dataSourceIBMSccPostureGroupProfileDetails(), - "ibm_scc_posture_scope_correlation": dataSourceIBMSccPostureScopeCorrelation(), - - // Added for Context Based Restrictions - "ibm_cbr_zone": dataSourceIBMCbrZone(), - "ibm_cbr_rule": dataSourceIBMCbrRule(), - - // Added for Event Notifications - "ibm_en_destination": dataSourceIBMEnDestination(), - "ibm_en_destinations": dataSourceIBMEnDestinations(), - "ibm_en_topic": dataSourceIBMEnTopic(), - "ibm_en_topics": dataSourceIBMEnTopics(), - "ibm_en_subscription": dataSourceIBMEnSubscription(), - "ibm_en_subscriptions": dataSourceIBMEnSubscriptions(), - }, - - ResourcesMap: map[string]*schema.Resource{ - "ibm_api_gateway_endpoint": resourceIBMApiGatewayEndPoint(), - "ibm_api_gateway_endpoint_subscription": resourceIBMApiGatewayEndpointSubscription(), - "ibm_app": resourceIBMApp(), - "ibm_app_domain_private": resourceIBMAppDomainPrivate(), - "ibm_app_domain_shared": resourceIBMAppDomainShared(), - "ibm_app_route": resourceIBMAppRoute(), - - // AppID - "ibm_appid_action_url": resourceIBMAppIDActionURL(), - "ibm_appid_apm": resourceIBMAppIDAPM(), - "ibm_appid_application": resourceIBMAppIDApplication(), - "ibm_appid_application_scopes": resourceIBMAppIDApplicationScopes(), - "ibm_appid_application_roles": resourceIBMAppIDApplicationRoles(), - "ibm_appid_audit_status": resourceIBMAppIDAuditStatus(), - "ibm_appid_cloud_directory_template": resourceIBMAppIDCloudDirectoryTemplate(), - "ibm_appid_cloud_directory_user": resourceIBMAppIDCloudDirectoryUser(), - "ibm_appid_idp_cloud_directory": resourceIBMAppIDIDPCloudDirectory(), - "ibm_appid_idp_custom": resourceIBMAppIDIDPCustom(), - "ibm_appid_idp_facebook": resourceIBMAppIDIDPFacebook(), - "ibm_appid_idp_google": resourceIBMAppIDIDPGoogle(), - "ibm_appid_idp_saml": resourceIBMAppIDIDPSAML(), - "ibm_appid_languages": resourceIBMAppIDLanguages(), - "ibm_appid_mfa": resourceIBMAppIDMFA(), - "ibm_appid_mfa_channel": resourceIBMAppIDMFAChannel(), - "ibm_appid_password_regex": resourceIBMAppIDPasswordRegex(), - "ibm_appid_token_config": resourceIBMAppIDTokenConfig(), - "ibm_appid_redirect_urls": resourceIBMAppIDRedirectURLs(), - "ibm_appid_role": resourceIBMAppIDRole(), - "ibm_appid_theme_color": resourceIBMAppIDThemeColor(), - "ibm_appid_theme_text": resourceIBMAppIDThemeText(), - "ibm_appid_user_roles": resourceIBMAppIDUserRoles(), - - "ibm_function_action": resourceIBMFunctionAction(), - "ibm_function_package": resourceIBMFunctionPackage(), - "ibm_function_rule": resourceIBMFunctionRule(), - "ibm_function_trigger": resourceIBMFunctionTrigger(), - "ibm_function_namespace": resourceIBMFunctionNamespace(), - "ibm_cis": resourceIBMCISInstance(), - "ibm_database": resourceIBMDatabaseInstance(), - "ibm_certificate_manager_import": resourceIBMCertificateManagerImport(), - "ibm_certificate_manager_order": resourceIBMCertificateManagerOrder(), - "ibm_cis_domain": resourceIBMCISDomain(), - "ibm_cis_domain_settings": resourceIBMCISSettings(), - "ibm_cis_firewall": resourceIBMCISFirewallRecord(), - "ibm_cis_range_app": resourceIBMCISRangeApp(), - "ibm_cis_healthcheck": resourceIBMCISHealthCheck(), - "ibm_cis_origin_pool": resourceIBMCISPool(), - "ibm_cis_global_load_balancer": resourceIBMCISGlb(), - "ibm_cis_certificate_upload": resourceIBMCISCertificateUpload(), - "ibm_cis_dns_record": resourceIBMCISDnsRecord(), - "ibm_cis_dns_records_import": resourceIBMCISDNSRecordsImport(), - "ibm_cis_rate_limit": resourceIBMCISRateLimit(), - "ibm_cis_page_rule": resourceIBMCISPageRule(), - "ibm_cis_edge_functions_action": resourceIBMCISEdgeFunctionsAction(), - "ibm_cis_edge_functions_trigger": resourceIBMCISEdgeFunctionsTrigger(), - "ibm_cis_tls_settings": resourceIBMCISTLSSettings(), - "ibm_cis_waf_package": resourceIBMCISWAFPackage(), - "ibm_cis_routing": resourceIBMCISRouting(), - "ibm_cis_waf_group": resourceIBMCISWAFGroup(), - "ibm_cis_cache_settings": resourceIBMCISCacheSettings(), - "ibm_cis_custom_page": resourceIBMCISCustomPage(), - "ibm_cis_waf_rule": resourceIBMCISWAFRule(), - "ibm_cis_certificate_order": resourceIBMCISCertificateOrder(), - "ibm_cis_filter": resourceIBMCISFilter(), - "ibm_cis_firewall_rule": resourceIBMCISFirewallrules(), - "ibm_cloudant": resourceIBMCloudant(), - "ibm_cloud_shell_account_settings": resourceIBMCloudShellAccountSettings(), - "ibm_compute_autoscale_group": resourceIBMComputeAutoScaleGroup(), - "ibm_compute_autoscale_policy": resourceIBMComputeAutoScalePolicy(), - "ibm_compute_bare_metal": resourceIBMComputeBareMetal(), - "ibm_compute_dedicated_host": resourceIBMComputeDedicatedHost(), - "ibm_compute_monitor": resourceIBMComputeMonitor(), - "ibm_compute_placement_group": resourceIBMComputePlacementGroup(), - "ibm_compute_reserved_capacity": resourceIBMComputeReservedCapacity(), - "ibm_compute_provisioning_hook": resourceIBMComputeProvisioningHook(), - "ibm_compute_ssh_key": resourceIBMComputeSSHKey(), - "ibm_compute_ssl_certificate": resourceIBMComputeSSLCertificate(), - "ibm_compute_user": resourceIBMComputeUser(), - "ibm_compute_vm_instance": resourceIBMComputeVmInstance(), - "ibm_container_addons": resourceIBMContainerAddOns(), - "ibm_container_alb": resourceIBMContainerALB(), - "ibm_container_alb_create": resourceIBMContainerAlbCreate(), - "ibm_container_api_key_reset": resourceIBMContainerAPIKeyReset(), - "ibm_container_vpc_alb": resourceIBMContainerVpcALB(), - "ibm_container_vpc_alb_create": resourceIBMContainerVpcAlbCreateNew(), - "ibm_container_vpc_worker_pool": resourceIBMContainerVpcWorkerPool(), - "ibm_container_vpc_cluster": resourceIBMContainerVpcCluster(), - "ibm_container_alb_cert": resourceIBMContainerALBCert(), - "ibm_container_cluster": resourceIBMContainerCluster(), - "ibm_container_cluster_feature": resourceIBMContainerClusterFeature(), - "ibm_container_bind_service": resourceIBMContainerBindService(), - "ibm_container_worker_pool": resourceIBMContainerWorkerPool(), - "ibm_container_worker_pool_zone_attachment": resourceIBMContainerWorkerPoolZoneAttachment(), - "ibm_container_storage_attachment": resourceIBMContainerVpcWorkerVolumeAttachment(), - "ibm_container_nlb_dns": resourceIbmContainerNlbDns(), - "ibm_cr_namespace": resourceIBMCrNamespace(), - "ibm_cr_retention_policy": resourceIBMCrRetentionPolicy(), - "ibm_ob_logging": resourceIBMObLogging(), - "ibm_ob_monitoring": resourceIBMObMonitoring(), - "ibm_cos_bucket": resourceIBMCOSBucket(), - "ibm_cos_bucket_object": resourceIBMCOSBucketObject(), - "ibm_dns_domain": resourceIBMDNSDomain(), - "ibm_dns_domain_registration_nameservers": resourceIBMDNSDomainRegistrationNameservers(), - "ibm_dns_secondary": resourceIBMDNSSecondary(), - "ibm_dns_record": resourceIBMDNSRecord(), - "ibm_event_streams_topic": resourceIBMEventStreamsTopic(), - "ibm_event_streams_schema": resourceIBMEventStreamsSchema(), - "ibm_firewall": resourceIBMFirewall(), - "ibm_firewall_policy": resourceIBMFirewallPolicy(), - "ibm_hpcs": resourceIBMHPCS(), - "ibm_iam_access_group": resourceIBMIAMAccessGroup(), - "ibm_iam_account_settings": resourceIbmIamAccountSettings(), - "ibm_iam_custom_role": resourceIBMIAMCustomRole(), - "ibm_iam_access_group_dynamic_rule": resourceIBMIAMDynamicRule(), - "ibm_iam_access_group_members": resourceIBMIAMAccessGroupMembers(), - "ibm_iam_access_group_policy": resourceIBMIAMAccessGroupPolicy(), - "ibm_iam_authorization_policy": resourceIBMIAMAuthorizationPolicy(), - "ibm_iam_authorization_policy_detach": resourceIBMIAMAuthorizationPolicyDetach(), - "ibm_iam_user_policy": resourceIBMIAMUserPolicy(), - "ibm_iam_user_settings": resourceIBMUserSettings(), - "ibm_iam_service_id": resourceIBMIAMServiceID(), - "ibm_iam_service_api_key": resourceIBMIAMServiceAPIKey(), - "ibm_iam_service_policy": resourceIBMIAMServicePolicy(), - "ibm_iam_user_invite": resourceIBMUserInvite(), - "ibm_iam_api_key": resourceIbmIamApiKey(), - "ibm_iam_trusted_profile": resourceIBMIamTrustedProfile(), - "ibm_iam_trusted_profile_claim_rule": resourceIBMIamTrustedProfileClaimRule(), - "ibm_iam_trusted_profile_link": resourceIBMIamTrustedProfileLink(), - "ibm_iam_trusted_profile_policy": resourceIBMIAMTrustedProfilePolicy(), - "ibm_ipsec_vpn": resourceIBMIPSecVPN(), - "ibm_is_dedicated_host": resourceIbmIsDedicatedHost(), - "ibm_is_dedicated_host_group": resourceIbmIsDedicatedHostGroup(), - "ibm_is_dedicated_host_disk_management": resourceIBMISDedicatedHostDiskManagement(), - "ibm_is_placement_group": resourceIbmIsPlacementGroup(), - "ibm_is_floating_ip": resourceIBMISFloatingIP(), - "ibm_is_flow_log": resourceIBMISFlowLog(), - "ibm_is_instance": resourceIBMISInstance(), - "ibm_is_instance_action": resourceIBMISInstanceAction(), - "ibm_is_instance_network_interface": resourceIBMIsInstanceNetworkInterface(), - "ibm_is_instance_disk_management": resourceIBMISInstanceDiskManagement(), - "ibm_is_instance_group": resourceIBMISInstanceGroup(), - "ibm_is_instance_group_membership": resourceIBMISInstanceGroupMembership(), - "ibm_is_instance_group_manager": resourceIBMISInstanceGroupManager(), - "ibm_is_instance_group_manager_policy": resourceIBMISInstanceGroupManagerPolicy(), - "ibm_is_instance_group_manager_action": resourceIBMISInstanceGroupManagerAction(), - "ibm_is_instance_volume_attachment": resourceIBMISInstanceVolumeAttachment(), - "ibm_is_virtual_endpoint_gateway": resourceIBMISEndpointGateway(), - "ibm_is_virtual_endpoint_gateway_ip": resourceIBMISEndpointGatewayIP(), - "ibm_is_instance_template": resourceIBMISInstanceTemplate(), - "ibm_is_ike_policy": resourceIBMISIKEPolicy(), - "ibm_is_ipsec_policy": resourceIBMISIPSecPolicy(), - "ibm_is_lb": resourceIBMISLB(), - "ibm_is_lb_listener": resourceIBMISLBListener(), - "ibm_is_lb_listener_policy": resourceIBMISLBListenerPolicy(), - "ibm_is_lb_listener_policy_rule": resourceIBMISLBListenerPolicyRule(), - "ibm_is_lb_pool": resourceIBMISLBPool(), - "ibm_is_lb_pool_member": resourceIBMISLBPoolMember(), - "ibm_is_network_acl": resourceIBMISNetworkACL(), - "ibm_is_network_acl_rule": resourceIBMISNetworkACLRule(), - "ibm_is_public_gateway": resourceIBMISPublicGateway(), - "ibm_is_security_group": resourceIBMISSecurityGroup(), - "ibm_is_security_group_rule": resourceIBMISSecurityGroupRule(), - "ibm_is_security_group_target": resourceIBMISSecurityGroupTarget(), - "ibm_is_security_group_network_interface_attachment": resourceIBMISSecurityGroupNetworkInterfaceAttachment(), - "ibm_is_subnet": resourceIBMISSubnet(), - "ibm_is_subnet_reserved_ip": resourceIBMISReservedIP(), - "ibm_is_subnet_network_acl_attachment": resourceIBMISSubnetNetworkACLAttachment(), - "ibm_is_ssh_key": resourceIBMISSSHKey(), - "ibm_is_snapshot": resourceIBMSnapshot(), - "ibm_is_volume": resourceIBMISVolume(), - "ibm_is_vpn_gateway": resourceIBMISVPNGateway(), - "ibm_is_vpn_gateway_connection": resourceIBMISVPNGatewayConnection(), - "ibm_is_vpc": resourceIBMISVPC(), - "ibm_is_vpc_address_prefix": resourceIBMISVpcAddressPrefix(), - "ibm_is_vpc_route": resourceIBMISVpcRoute(), - "ibm_is_vpc_routing_table": resourceIBMISVPCRoutingTable(), - "ibm_is_vpc_routing_table_route": resourceIBMISVPCRoutingTableRoute(), - "ibm_is_image": resourceIBMISImage(), - "ibm_lb": resourceIBMLb(), - "ibm_lbaas": resourceIBMLbaas(), - "ibm_lbaas_health_monitor": resourceIBMLbaasHealthMonitor(), - "ibm_lbaas_server_instance_attachment": resourceIBMLbaasServerInstanceAttachment(), - "ibm_lb_service": resourceIBMLbService(), - "ibm_lb_service_group": resourceIBMLbServiceGroup(), - "ibm_lb_vpx": resourceIBMLbVpx(), - "ibm_lb_vpx_ha": resourceIBMLbVpxHa(), - "ibm_lb_vpx_service": resourceIBMLbVpxService(), - "ibm_lb_vpx_vip": resourceIBMLbVpxVip(), - "ibm_multi_vlan_firewall": resourceIBMMultiVlanFirewall(), - "ibm_network_gateway": resourceIBMNetworkGateway(), - "ibm_network_gateway_vlan_association": resourceIBMNetworkGatewayVlanAttachment(), - "ibm_network_interface_sg_attachment": resourceIBMNetworkInterfaceSGAttachment(), - "ibm_network_public_ip": resourceIBMNetworkPublicIp(), - "ibm_network_vlan": resourceIBMNetworkVlan(), - "ibm_network_vlan_spanning": resourceIBMNetworkVlanSpan(), - "ibm_object_storage_account": resourceIBMObjectStorageAccount(), - "ibm_org": resourceIBMOrg(), - "ibm_pn_application_chrome": resourceIBMPNApplicationChrome(), - "ibm_app_config_environment": resourceIbmAppConfigEnvironment(), - "ibm_app_config_feature": resourceIbmIbmAppConfigFeature(), - "ibm_kms_key": resourceIBMKmskey(), - "ibm_kms_key_alias": resourceIBMKmskeyAlias(), - "ibm_kms_key_rings": resourceIBMKmskeyRings(), - "ibm_kms_key_policies": resourceIBMKmskeyPolicies(), - "ibm_kp_key": resourceIBMkey(), - "ibm_resource_group": resourceIBMResourceGroup(), - "ibm_resource_instance": resourceIBMResourceInstance(), - "ibm_resource_key": resourceIBMResourceKey(), - "ibm_security_group": resourceIBMSecurityGroup(), - "ibm_security_group_rule": resourceIBMSecurityGroupRule(), - "ibm_service_instance": resourceIBMServiceInstance(), - "ibm_service_key": resourceIBMServiceKey(), - "ibm_space": resourceIBMSpace(), - "ibm_storage_evault": resourceIBMStorageEvault(), - "ibm_storage_block": resourceIBMStorageBlock(), - "ibm_storage_file": resourceIBMStorageFile(), - "ibm_subnet": resourceIBMSubnet(), - "ibm_dns_reverse_record": resourceIBMDNSReverseRecord(), - "ibm_ssl_certificate": resourceIBMSSLCertificate(), - "ibm_cdn": resourceIBMCDN(), - "ibm_hardware_firewall_shared": resourceIBMFirewallShared(), - - //Added for Power Colo - - "ibm_pi_key": resourceIBMPIKey(), - "ibm_pi_volume": resourceIBMPIVolume(), - "ibm_pi_network": resourceIBMPINetwork(), - "ibm_pi_instance": resourceIBMPIInstance(), - "ibm_pi_operations": resourceIBMPIIOperations(), - "ibm_pi_volume_attach": resourceIBMPIVolumeAttach(), - "ibm_pi_capture": resourceIBMPICapture(), - "ibm_pi_image": resourceIBMPIImage(), - "ibm_pi_image_export": resourceIBMPIImageExport(), - "ibm_pi_network_port": resourceIBMPINetworkPort(), - "ibm_pi_snapshot": resourceIBMPISnapshot(), - "ibm_pi_network_port_attach": resourceIBMPINetworkPortAttach(), - "ibm_pi_dhcp": resourceIBMPIDhcp(), - "ibm_pi_cloud_connection": resourceIBMPICloudConnection(), - "ibm_pi_ike_policy": resourceIBMPIIKEPolicy(), - "ibm_pi_ipsec_policy": resourceIBMPIIPSecPolicy(), - "ibm_pi_vpn_connection": resourceIBMPIVPNConnection(), - "ibm_pi_console_language": resourceIBMPIInstanceConsoleLanguage(), - "ibm_pi_placement_group": resourceIBMPIPlacementGroup(), - - //Private DNS related resources - "ibm_dns_zone": resourceIBMPrivateDNSZone(), - "ibm_dns_permitted_network": resourceIBMPrivateDNSPermittedNetwork(), - "ibm_dns_resource_record": resourceIBMPrivateDNSResourceRecord(), - "ibm_dns_glb_monitor": resourceIBMPrivateDNSGLBMonitor(), - "ibm_dns_glb_pool": resourceIBMPrivateDNSGLBPool(), - "ibm_dns_glb": resourceIBMPrivateDNSGLB(), - - //Added for Custom Resolver - "ibm_dns_custom_resolver": resouceIBMPrivateDNSCustomResolver(), - "ibm_dns_custom_resolver_location": resourceIBMPrivateDNSCRLocation(), - "ibm_dns_custom_resolver_forwarding_rule": resourceIBMPrivateDNSForwardingRule(), - - //Direct Link related resources - "ibm_dl_gateway": resourceIBMDLGateway(), - "ibm_dl_virtual_connection": resourceIBMDLGatewayVC(), - "ibm_dl_provider_gateway": resourceIBMDLProviderGateway(), - //Added for Transit Gateway - "ibm_tg_gateway": resourceIBMTransitGateway(), - "ibm_tg_connection": resourceIBMTransitGatewayConnection(), - - //Catalog related resources - "ibm_cm_offering_instance": resourceIBMCmOfferingInstance(), - "ibm_cm_catalog": resourceIBMCmCatalog(), - "ibm_cm_offering": resourceIBMCmOffering(), - "ibm_cm_version": resourceIBMCmVersion(), - - //Added for enterprise - "ibm_enterprise": resourceIbmEnterprise(), - "ibm_enterprise_account_group": resourceIbmEnterpriseAccountGroup(), - "ibm_enterprise_account": resourceIbmEnterpriseAccount(), - - //Added for Schematics - "ibm_schematics_workspace": resourceIBMSchematicsWorkspace(), - "ibm_schematics_action": resourceIBMSchematicsAction(), - "ibm_schematics_job": resourceIBMSchematicsJob(), - "ibm_schematics_inventory": resourceIBMSchematicsInventory(), - "ibm_schematics_resource_query": resourceIBMSchematicsResourceQuery(), - - //satellite resources - "ibm_satellite_location": resourceIBMSatelliteLocation(), - "ibm_satellite_host": resourceIBMSatelliteHost(), - "ibm_satellite_cluster": resourceIBMSatelliteCluster(), - "ibm_satellite_cluster_worker_pool": resourceIBMSatelliteClusterWorkerPool(), - "ibm_satellite_link": resourceIbmSatelliteLink(), - "ibm_satellite_endpoint": resourceIbmSatelliteEndpoint(), - "ibm_satellite_location_nlb_dns": resourceIbmSatelliteLocationNlbDns(), - "ibm_satellite_cluster_worker_pool_zone_attachment": resourceIbmSatelliteClusterWorkerPoolZoneAttachment(), - - //Added for Resource Tag - "ibm_resource_tag": resourceIBMResourceTag(), - - // Atracker - "ibm_atracker_target": resourceIBMAtrackerTarget(), - "ibm_atracker_route": resourceIBMAtrackerRoute(), - - //Security and Compliance Center - "ibm_scc_si_note": resourceIBMSccSiNote(), - "ibm_scc_account_settings": resourceIBMSccAccountSettings(), - "ibm_scc_si_occurrence": resourceIBMSccSiOccurrence(), - - //Security and Compliance Center - PostureManagement - "ibm_scc_posture_collector": resourceIBMSccPostureCollectors(), - "ibm_scc_posture_scope": resourceIBMSccPostureScopes(), - "ibm_scc_posture_credential": resourceIBMSccPostureCredentials(), - - // Added for Context Based Restrictions - "ibm_cbr_zone": resourceIBMCbrZone(), - "ibm_cbr_rule": resourceIBMCbrRule(), - - // Added for Event Notifications - "ibm_en_destination": resourceIBMEnDestination(), - "ibm_en_topic": resourceIBMEnTopic(), - "ibm_en_subscription": resourceIBMEnSubscription(), - }, - - ConfigureFunc: providerConfigure, - } -} - -var globalValidatorDict ValidatorDict -var initOnce sync.Once - -// Validator return validator -func Validator() ValidatorDict { - initOnce.Do(func() { - globalValidatorDict = ValidatorDict{ - ResourceValidatorDictionary: map[string]*ResourceValidator{ - "ibm_iam_account_settings": resourceIBMIAMAccountSettingsValidator(), - "ibm_iam_custom_role": resourceIBMIAMCustomRoleValidator(), - "ibm_cis_healthcheck": resourceIBMCISHealthCheckValidator(), - "ibm_cis_rate_limit": resourceIBMCISRateLimitValidator(), - "ibm_cis": resourceIBMCISValidator(), - "ibm_cis_domain_settings": resourceIBMCISDomainSettingValidator(), - "ibm_cis_tls_settings": resourceIBMCISTLSSettingsValidator(), - "ibm_cis_routing": resourceIBMCISRoutingValidator(), - "ibm_cis_page_rule": resourceCISPageRuleValidator(), - "ibm_cis_waf_package": resourceIBMCISWAFPackageValidator(), - "ibm_cis_waf_group": resourceIBMCISWAFGroupValidator(), - "ibm_cis_certificate_upload": resourceCISCertificateUploadValidator(), - "ibm_cis_cache_settings": resourceIBMCISCacheSettingsValidator(), - "ibm_cis_custom_page": resourceIBMCISCustomPageValidator(), - "ibm_cis_firewall": resourceIBMCISFirewallValidator(), - "ibm_cis_range_app": resourceIBMCISRangeAppValidator(), - "ibm_cis_waf_rule": resourceIBMCISWAFRuleValidator(), - "ibm_cis_certificate_order": resourceIBMCISCertificateOrderValidator(), - "ibm_cis_filter": resourceIBMCISFilterValidator(), - "ibm_cis_firewall_rules": resourceIBMCISFirewallrulesValidator(), - "ibm_container_cluster": resourceIBMContainerClusterValidator(), - "ibm_container_worker_pool": resourceContainerWorkerPoolValidator(), - "ibm_container_vpc_worker_pool": resourceContainerVPCWorkerPoolValidator(), - "ibm_container_vpc_cluster": resourceIBMContainerVpcClusterValidator(), - "ibm_cr_namespace": resourceIBMCrNamespaceValidator(), - "ibm_tg_gateway": resourceIBMTGValidator(), - "ibm_app_config_feature": resourceIbmAppConfigFeatureValidator(), - "ibm_tg_connection": resourceIBMTransitGatewayConnectionValidator(), - "ibm_dl_virtual_connection": resourceIBMdlGatewayVCValidator(), - "ibm_dl_gateway": resourceIBMDLGatewayValidator(), - "ibm_dl_provider_gateway": resourceIBMDLProviderGatewayValidator(), - "ibm_database": resourceIBMICDValidator(), - "ibm_function_package": resourceIBMFuncPackageValidator(), - "ibm_function_action": resourceIBMFuncActionValidator(), - "ibm_function_rule": resourceIBMFuncRuleValidator(), - "ibm_function_trigger": resourceIBMFuncTriggerValidator(), - "ibm_function_namespace": resourceIBMFuncNamespaceValidator(), - "ibm_hpcs": resourceIBMHPCSValidator(), - "ibm_is_dedicated_host_group": resourceIbmIsDedicatedHostGroupValidator(), - "ibm_is_dedicated_host": resourceIbmIsDedicatedHostValidator(), - "ibm_is_dedicated_host_disk_management": resourceIBMISDedicatedHostDiskManagementValidator(), - "ibm_is_flow_log": resourceIBMISFlowLogValidator(), - "ibm_is_instance_group": resourceIBMISInstanceGroupValidator(), - "ibm_is_instance_group_membership": resourceIBMISInstanceGroupMembershipValidator(), - "ibm_is_instance_group_manager": resourceIBMISInstanceGroupManagerValidator(), - "ibm_is_instance_group_manager_policy": resourceIBMISInstanceGroupManagerPolicyValidator(), - "ibm_is_instance_group_manager_action": resourceIBMISInstanceGroupManagerActionValidator(), - "ibm_is_floating_ip": resourceIBMISFloatingIPValidator(), - "ibm_is_ike_policy": resourceIBMISIKEValidator(), - "ibm_is_image": resourceIBMISImageValidator(), - "ibm_is_instance_template": resourceIBMISInstanceTemplateValidator(), - "ibm_is_instance": resourceIBMISInstanceValidator(), - "ibm_is_instance_action": resourceIBMISInstanceActionValidator(), - "ibm_is_instance_network_interface": resourceIBMIsInstanceNetworkInterfaceValidator(), - "ibm_is_instance_disk_management": resourceIBMISInstanceDiskManagementValidator(), - "ibm_is_instance_volume_attachment": resourceIBMISInstanceVolumeAttachmentValidator(), - "ibm_is_ipsec_policy": resourceIBMISIPSECValidator(), - "ibm_is_lb_listener_policy_rule": resourceIBMISLBListenerPolicyRuleValidator(), - "ibm_is_lb_listener_policy": resourceIBMISLBListenerPolicyValidator(), - "ibm_is_lb_listener": resourceIBMISLBListenerValidator(), - "ibm_is_lb_pool_member": resourceIBMISLBPoolMemberValidator(), - "ibm_is_lb_pool": resourceIBMISLBPoolValidator(), - "ibm_is_lb": resourceIBMISLBValidator(), - "ibm_is_network_acl": resourceIBMISNetworkACLValidator(), - "ibm_is_network_acl_rule": resourceIBMISNetworkACLRuleValidator(), - "ibm_is_public_gateway": resourceIBMISPublicGatewayValidator(), - "ibm_is_placement_group": resourceIbmIsPlacementGroupValidator(), - "ibm_is_security_group_target": resourceIBMISSecurityGroupTargetValidator(), - "ibm_is_security_group_rule": resourceIBMISSecurityGroupRuleValidator(), - "ibm_is_security_group": resourceIBMISSecurityGroupValidator(), - "ibm_is_snapshot": resourceIBMISSnapshotValidator(), - "ibm_is_ssh_key": resourceIBMISSHKeyValidator(), - "ibm_is_subnet": resourceIBMISSubnetValidator(), - "ibm_is_subnet_reserved_ip": resourceIBMISSubnetReservedIPValidator(), - "ibm_is_volume": resourceIBMISVolumeValidator(), - "ibm_is_address_prefix": resourceIBMISAddressPrefixValidator(), - "ibm_is_route": resourceIBMISRouteValidator(), - "ibm_is_vpc": resourceIBMISVPCValidator(), - "ibm_is_vpc_routing_table": resourceIBMISVPCRoutingTableValidator(), - "ibm_is_vpc_routing_table_route": resourceIBMISVPCRoutingTableRouteValidator(), - "ibm_is_vpn_gateway_connection": resourceIBMISVPNGatewayConnectionValidator(), - "ibm_is_vpn_gateway": resourceIBMISVPNGatewayValidator(), - "ibm_kms_key_rings": resourceIBMKeyRingValidator(), - "ibm_dns_glb_monitor": resourceIBMPrivateDNSGLBMonitorValidator(), - "ibm_dns_glb_pool": resourceIBMPrivateDNSGLBPoolValidator(), - "ibm_dns_custom_resolver_forwarding_rule": resourceIBMPrivateDNSForwardingRuleValidator(), - "ibm_schematics_action": resourceIBMSchematicsActionValidator(), - "ibm_schematics_job": resourceIBMSchematicsJobValidator(), - "ibm_schematics_workspace": resourceIBMSchematicsWorkspaceValidator(), - "ibm_schematics_inventory": resourceIBMSchematicsInventoryValidator(), - "ibm_schematics_resource_query": resourceIBMSchematicsResourceQueryValidator(), - "ibm_resource_instance": resourceIBMResourceInstanceValidator(), - "ibm_is_virtual_endpoint_gateway": resourceIBMISEndpointGatewayValidator(), - "ibm_resource_tag": resourceIBMResourceTagValidator(), - "ibm_satellite_location": resourceIBMSatelliteLocationValidator(), - "ibm_satellite_cluster": resourceIBMSatelliteClusterValidator(), - "ibm_pi_volume": resourceIBMPIVolumeValidator(), - "ibm_atracker_target": resourceIBMAtrackerTargetValidator(), - "ibm_atracker_route": resourceIBMAtrackerRouteValidator(), - "ibm_satellite_endpoint": resourceIbmSatelliteEndpointValidator(), - "ibm_scc_si_note": resourceIBMSccSiNoteValidator(), - "ibm_scc_account_settings": resourceIBMSccAccountSettingsValidator(), - "ibm_scc_si_occurrence": resourceIBMSccSiOccurrenceValidator(), - "ibm_cbr_zone": resourceIBMCbrZoneValidator(), - "ibm_cbr_rule": resourceIBMCbrRuleValidator(), - "ibm_scc_posture_collector": resourceIBMSccPostureCollectorsValidator(), - "ibm_scc_posture_scope": resourceIBMSccPostureScopesValidator(), - "ibm_scc_posture_credential": resourceIBMSccPostureCredentialsValidator(), - - // Added for Event Notifications - "ibm_en_destination": resourceIBMEnDestinationValidator(), - }, - DataSourceValidatorDictionary: map[string]*ResourceValidator{ - "ibm_is_subnet": dataSourceIBMISSubnetValidator(), - "ibm_is_snapshot": dataSourceIBMISSnapshotValidator(), - "ibm_dl_offering_speeds": datasourceIBMDLOfferingSpeedsValidator(), - "ibm_dl_routers": datasourceIBMDLRoutersValidator(), - "ibm_is_vpc": dataSourceIBMISVpcValidator(), - "ibm_is_volume": dataSourceIBMISVolumeValidator(), - "ibm_scc_si_notes": dataSourceIBMSccSiNotesValidator(), - "ibm_scc_si_occurrences": dataSourceIBMSccSiOccurrencesValidator(), - "ibm_secrets_manager_secret": datasourceIBMSecretsManagerSecretValidator(), - "ibm_secrets_manager_secrets": datasourceIBMSecretsManagerSecretsValidator(), - }, - } - }) - return globalValidatorDict -} - -func providerConfigure(d *schema.ResourceData) (interface{}, error) { - var bluemixAPIKey string - var bluemixTimeout int - var iamToken, iamRefreshToken, iamTrustedProfileId string - if key, ok := d.GetOk("bluemix_api_key"); ok { - bluemixAPIKey = key.(string) - } - if key, ok := d.GetOk("ibmcloud_api_key"); ok { - bluemixAPIKey = key.(string) - } - if itoken, ok := d.GetOk("iam_token"); ok { - iamToken = itoken.(string) - } - if rtoken, ok := d.GetOk("iam_refresh_token"); ok { - iamRefreshToken = rtoken.(string) - } - if ttoken, ok := d.GetOk("iam_profile_id"); ok { - iamTrustedProfileId = ttoken.(string) - } - var softlayerUsername, softlayerAPIKey, softlayerEndpointUrl string - var softlayerTimeout int - if username, ok := d.GetOk("softlayer_username"); ok { - softlayerUsername = username.(string) - } - if username, ok := d.GetOk("iaas_classic_username"); ok { - softlayerUsername = username.(string) - } - if apikey, ok := d.GetOk("softlayer_api_key"); ok { - softlayerAPIKey = apikey.(string) - } - if apikey, ok := d.GetOk("iaas_classic_api_key"); ok { - softlayerAPIKey = apikey.(string) - } - if endpoint, ok := d.GetOk("softlayer_endpoint_url"); ok { - softlayerEndpointUrl = endpoint.(string) - } - if endpoint, ok := d.GetOk("iaas_classic_endpoint_url"); ok { - softlayerEndpointUrl = endpoint.(string) - } - if tm, ok := d.GetOk("softlayer_timeout"); ok { - softlayerTimeout = tm.(int) - } - if tm, ok := d.GetOk("iaas_classic_timeout"); ok { - softlayerTimeout = tm.(int) - } - - if tm, ok := d.GetOk("bluemix_timeout"); ok { - bluemixTimeout = tm.(int) - } - if tm, ok := d.GetOk("ibmcloud_timeout"); ok { - bluemixTimeout = tm.(int) - } - var visibility string - if v, ok := d.GetOk("visibility"); ok { - visibility = v.(string) - } - var file string - if f, ok := d.GetOk("endpoints_file_path"); ok { - file = f.(string) - } - - resourceGrp := d.Get("resource_group").(string) - region := d.Get("region").(string) - zone := d.Get("zone").(string) - retryCount := d.Get("max_retries").(int) - wskNameSpace := d.Get("function_namespace").(string) - riaasEndPoint := d.Get("riaas_endpoint").(string) - - wskEnvVal, err := schema.EnvDefaultFunc("FUNCTION_NAMESPACE", "")() - if err != nil { - return nil, err - } - //Set environment variable to be used in DiffSupressFunction - if wskEnvVal.(string) == "" { - os.Setenv("FUNCTION_NAMESPACE", wskNameSpace) - } - - config := Config{ - BluemixAPIKey: bluemixAPIKey, - Region: region, - ResourceGroup: resourceGrp, - BluemixTimeout: time.Duration(bluemixTimeout) * time.Second, - SoftLayerTimeout: time.Duration(softlayerTimeout) * time.Second, - SoftLayerUserName: softlayerUsername, - SoftLayerAPIKey: softlayerAPIKey, - RetryCount: retryCount, - SoftLayerEndpointURL: softlayerEndpointUrl, - RetryDelay: RetryAPIDelay, - FunctionNameSpace: wskNameSpace, - RiaasEndPoint: riaasEndPoint, - IAMToken: iamToken, - IAMRefreshToken: iamRefreshToken, - Zone: zone, - Visibility: visibility, - EndpointsFile: file, - IAMTrustedProfileID: iamTrustedProfileId, - //PowerServiceInstance: powerServiceInstance, - } - - return config.ClientSession() -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider/provider.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider/provider.go new file mode 100644 index 0000000000..c88e9a3e39 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider/provider.go @@ -0,0 +1,1204 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package provider + +import ( + "os" + "sync" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" +) + +// Provider returns a *schema.Provider. +func Provider() *schema.Provider { + return &schema.Provider{ + Schema: map[string]*schema.Schema{ + "bluemix_api_key": { + Type: schema.TypeString, + Optional: true, + Description: "The Bluemix API Key", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"BM_API_KEY", "BLUEMIX_API_KEY"}, nil), + Deprecated: "This field is deprecated please use ibmcloud_api_key", + }, + "bluemix_timeout": { + Type: schema.TypeInt, + Optional: true, + Description: "The timeout (in seconds) to set for any Bluemix API calls made.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"BM_TIMEOUT", "BLUEMIX_TIMEOUT"}, nil), + Deprecated: "This field is deprecated please use ibmcloud_timeout", + }, + "ibmcloud_api_key": { + Type: schema.TypeString, + Optional: true, + Description: "The IBM Cloud API Key", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_API_KEY", "IBMCLOUD_API_KEY"}, nil), + }, + "ibmcloud_timeout": { + Type: schema.TypeInt, + Optional: true, + Description: "The timeout (in seconds) to set for any IBM Cloud API calls made.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_TIMEOUT", "IBMCLOUD_TIMEOUT"}, 60), + }, + "region": { + Type: schema.TypeString, + Optional: true, + Description: "The IBM cloud Region (for example 'us-south').", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_REGION", "IBMCLOUD_REGION", "BM_REGION", "BLUEMIX_REGION"}, "us-south"), + }, + "zone": { + Type: schema.TypeString, + Optional: true, + Description: "The IBM cloud Region zone (for example 'us-south-1') for power resources.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_ZONE", "IBMCLOUD_ZONE"}, ""), + }, + "resource_group": { + Type: schema.TypeString, + Optional: true, + Description: "The Resource group id.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_RESOURCE_GROUP", "IBMCLOUD_RESOURCE_GROUP", "BM_RESOURCE_GROUP", "BLUEMIX_RESOURCE_GROUP"}, ""), + }, + "softlayer_api_key": { + Type: schema.TypeString, + Optional: true, + Description: "The SoftLayer API Key", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_API_KEY", "SOFTLAYER_API_KEY"}, nil), + Deprecated: "This field is deprecated please use iaas_classic_api_key", + }, + "softlayer_username": { + Type: schema.TypeString, + Optional: true, + Description: "The SoftLayer user name", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_USERNAME", "SOFTLAYER_USERNAME"}, nil), + Deprecated: "This field is deprecated please use iaas_classic_username", + }, + "softlayer_endpoint_url": { + Type: schema.TypeString, + Optional: true, + Description: "The Softlayer Endpoint", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_ENDPOINT_URL", "SOFTLAYER_ENDPOINT_URL"}, nil), + Deprecated: "This field is deprecated please use iaas_classic_endpoint_url", + }, + "softlayer_timeout": { + Type: schema.TypeInt, + Optional: true, + Description: "The timeout (in seconds) to set for any SoftLayer API calls made.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"SL_TIMEOUT", "SOFTLAYER_TIMEOUT"}, nil), + Deprecated: "This field is deprecated please use iaas_classic_timeout", + }, + "iaas_classic_api_key": { + Type: schema.TypeString, + Optional: true, + Description: "The Classic Infrastructure API Key", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_API_KEY"}, nil), + }, + "iaas_classic_username": { + Type: schema.TypeString, + Optional: true, + Description: "The Classic Infrastructure API user name", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_USERNAME"}, nil), + }, + "iaas_classic_endpoint_url": { + Type: schema.TypeString, + Optional: true, + Description: "The Classic Infrastructure Endpoint", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_ENDPOINT_URL"}, "https://api.softlayer.com/rest/v3"), + }, + "iaas_classic_timeout": { + Type: schema.TypeInt, + Optional: true, + Description: "The timeout (in seconds) to set for any Classic Infrastructure API calls made.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IAAS_CLASSIC_TIMEOUT"}, 60), + }, + "max_retries": { + Type: schema.TypeInt, + Optional: true, + Description: "The retry count to set for API calls.", + DefaultFunc: schema.EnvDefaultFunc("MAX_RETRIES", 10), + }, + "function_namespace": { + Type: schema.TypeString, + Optional: true, + Description: "The IBM Cloud Function namespace", + DefaultFunc: schema.EnvDefaultFunc("FUNCTION_NAMESPACE", nil), + Deprecated: "This field will be deprecated soon", + }, + "riaas_endpoint": { + Type: schema.TypeString, + Optional: true, + Description: "The next generation infrastructure service endpoint url.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"RIAAS_ENDPOINT"}, nil), + Deprecated: "This field is deprecated use generation", + }, + "generation": { + Type: schema.TypeInt, + Optional: true, + Description: "Generation of Virtual Private Cloud. Default is 2", + //DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_GENERATION", "IBMCLOUD_GENERATION"}, nil), + Deprecated: "The generation field is deprecated and will be removed after couple of releases", + }, + "iam_profile_id": { + Type: schema.TypeString, + Optional: true, + Description: "IAM Trusted Profile Authentication token", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_IAM_PROFILE_ID", "IBMCLOUD_IAM_PROFILE_ID"}, nil), + }, + "iam_token": { + Type: schema.TypeString, + Optional: true, + Description: "IAM Authentication token", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_IAM_TOKEN", "IBMCLOUD_IAM_TOKEN"}, nil), + }, + "iam_refresh_token": { + Type: schema.TypeString, + Optional: true, + Description: "IAM Authentication refresh token", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_IAM_REFRESH_TOKEN", "IBMCLOUD_IAM_REFRESH_TOKEN"}, nil), + }, + "visibility": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "public-and-private"}), + Description: "Visibility of the provider if it is private or public.", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_VISIBILITY", "IBMCLOUD_VISIBILITY"}, "public"), + }, + "endpoints_file_path": { + Type: schema.TypeString, + Optional: true, + Description: "Path of the file that contains private and public regional endpoints mapping", + DefaultFunc: schema.MultiEnvDefaultFunc([]string{"IC_ENDPOINTS_FILE_PATH", "IBMCLOUD_ENDPOINTS_FILE_PATH"}, nil), + }, + }, + + DataSourcesMap: map[string]*schema.Resource{ + "ibm_api_gateway": apigateway.DataSourceIBMApiGateway(), + "ibm_account": cloudfoundry.DataSourceIBMAccount(), + "ibm_app": cloudfoundry.DataSourceIBMApp(), + "ibm_app_domain_private": cloudfoundry.DataSourceIBMAppDomainPrivate(), + "ibm_app_domain_shared": cloudfoundry.DataSourceIBMAppDomainShared(), + "ibm_app_route": cloudfoundry.DataSourceIBMAppRoute(), + + // // AppID + "ibm_appid_action_url": appid.DataSourceIBMAppIDActionURL(), + "ibm_appid_apm": appid.DataSourceIBMAppIDAPM(), + "ibm_appid_application": appid.DataSourceIBMAppIDApplication(), + "ibm_appid_application_scopes": appid.DataSourceIBMAppIDApplicationScopes(), + "ibm_appid_application_roles": appid.DataSourceIBMAppIDApplicationRoles(), + "ibm_appid_applications": appid.DataSourceIBMAppIDApplications(), + "ibm_appid_audit_status": appid.DataSourceIBMAppIDAuditStatus(), + "ibm_appid_cloud_directory_template": appid.DataSourceIBMAppIDCloudDirectoryTemplate(), + "ibm_appid_cloud_directory_user": appid.DataSourceIBMAppIDCloudDirectoryUser(), + "ibm_appid_idp_cloud_directory": appid.DataSourceIBMAppIDIDPCloudDirectory(), + "ibm_appid_idp_custom": appid.DataSourceIBMAppIDIDPCustom(), + "ibm_appid_idp_facebook": appid.DataSourceIBMAppIDIDPFacebook(), + "ibm_appid_idp_google": appid.DataSourceIBMAppIDIDPGoogle(), + "ibm_appid_idp_saml": appid.DataSourceIBMAppIDIDPSAML(), + "ibm_appid_idp_saml_metadata": appid.DataSourceIBMAppIDIDPSAMLMetadata(), + "ibm_appid_languages": appid.DataSourceIBMAppIDLanguages(), + "ibm_appid_mfa": appid.DataSourceIBMAppIDMFA(), + "ibm_appid_mfa_channel": appid.DataSourceIBMAppIDMFAChannel(), + "ibm_appid_password_regex": appid.DataSourceIBMAppIDPasswordRegex(), + "ibm_appid_token_config": appid.DataSourceIBMAppIDTokenConfig(), + "ibm_appid_redirect_urls": appid.DataSourceIBMAppIDRedirectURLs(), + "ibm_appid_role": appid.DataSourceIBMAppIDRole(), + "ibm_appid_roles": appid.DataSourceIBMAppIDRoles(), + "ibm_appid_theme_color": appid.DataSourceIBMAppIDThemeColor(), + "ibm_appid_theme_text": appid.DataSourceIBMAppIDThemeText(), + "ibm_appid_user_roles": appid.DataSourceIBMAppIDUserRoles(), + + "ibm_function_action": functions.DataSourceIBMFunctionAction(), + "ibm_function_package": functions.DataSourceIBMFunctionPackage(), + "ibm_function_rule": functions.DataSourceIBMFunctionRule(), + "ibm_function_trigger": functions.DataSourceIBMFunctionTrigger(), + "ibm_function_namespace": functions.DataSourceIBMFunctionNamespace(), + "ibm_certificate_manager_certificates": certificatemanager.DataIBMCertificateManagerCertificates(), + "ibm_certificate_manager_certificate": certificatemanager.DataIBMCertificateManagerCertificate(), + "ibm_cis": cis.DataSourceIBMCISInstance(), + "ibm_cis_dns_records": cis.DataSourceIBMCISDNSRecords(), + "ibm_cis_certificates": cis.DataSourceIBMCISCertificates(), + "ibm_cis_global_load_balancers": cis.DataSourceIBMCISGlbs(), + "ibm_cis_origin_pools": cis.DataSourceIBMCISOriginPools(), + "ibm_cis_healthchecks": cis.DataSourceIBMCISHealthChecks(), + "ibm_cis_domain": cis.DataSourceIBMCISDomain(), + "ibm_cis_firewall": cis.DataSourceIBMCISFirewallsRecord(), + "ibm_cis_cache_settings": cis.DataSourceIBMCISCacheSetting(), + "ibm_cis_waf_packages": cis.DataSourceIBMCISWAFPackages(), + "ibm_cis_range_apps": cis.DataSourceIBMCISRangeApps(), + "ibm_cis_custom_certificates": cis.DataSourceIBMCISCustomCertificates(), + "ibm_cis_rate_limit": cis.DataSourceIBMCISRateLimit(), + "ibm_cis_ip_addresses": cis.DataSourceIBMCISIP(), + "ibm_cis_waf_groups": cis.DataSourceIBMCISWAFGroups(), + "ibm_cis_alerts": cis.DataSourceIBMCISAlert(), + "ibm_cis_webhooks": cis.DataSourceIBMCISWebhooks(), + "ibm_cis_edge_functions_actions": cis.DataSourceIBMCISEdgeFunctionsActions(), + "ibm_cis_edge_functions_triggers": cis.DataSourceIBMCISEdgeFunctionsTriggers(), + "ibm_cis_custom_pages": cis.DataSourceIBMCISCustomPages(), + "ibm_cis_page_rules": cis.DataSourceIBMCISPageRules(), + "ibm_cis_waf_rules": cis.DataSourceIBMCISWAFRules(), + "ibm_cis_filters": cis.DataSourceIBMCISFilters(), + "ibm_cis_firewall_rules": cis.DataSourceIBMCISFirewallRules(), + "ibm_cloudant": cloudant.DataSourceIBMCloudant(), + "ibm_database": database.DataSourceIBMDatabaseInstance(), + "ibm_compute_bare_metal": classicinfrastructure.DataSourceIBMComputeBareMetal(), + "ibm_compute_image_template": classicinfrastructure.DataSourceIBMComputeImageTemplate(), + "ibm_compute_placement_group": classicinfrastructure.DataSourceIBMComputePlacementGroup(), + "ibm_compute_reserved_capacity": classicinfrastructure.DataSourceIBMComputeReservedCapacity(), + "ibm_compute_ssh_key": classicinfrastructure.DataSourceIBMComputeSSHKey(), + "ibm_compute_vm_instance": classicinfrastructure.DataSourceIBMComputeVmInstance(), + "ibm_container_addons": kubernetes.DataSourceIBMContainerAddOns(), + "ibm_container_alb": kubernetes.DataSourceIBMContainerALB(), + "ibm_container_alb_cert": kubernetes.DataSourceIBMContainerALBCert(), + "ibm_container_bind_service": kubernetes.DataSourceIBMContainerBindService(), + "ibm_container_cluster": kubernetes.DataSourceIBMContainerCluster(), + "ibm_container_cluster_config": kubernetes.DataSourceIBMContainerClusterConfig(), + "ibm_container_cluster_versions": kubernetes.DataSourceIBMContainerClusterVersions(), + "ibm_container_cluster_worker": kubernetes.DataSourceIBMContainerClusterWorker(), + "ibm_container_nlb_dns": kubernetes.DataSourceIBMContainerNLBDNS(), + "ibm_container_vpc_cluster_alb": kubernetes.DataSourceIBMContainerVPCClusterALB(), + "ibm_container_vpc_alb": kubernetes.DataSourceIBMContainerVPCClusterALB(), + "ibm_container_vpc_cluster": kubernetes.DataSourceIBMContainerVPCCluster(), + "ibm_container_vpc_cluster_worker": kubernetes.DataSourceIBMContainerVPCClusterWorker(), + "ibm_container_vpc_cluster_worker_pool": kubernetes.DataSourceIBMContainerVpcClusterWorkerPool(), + "ibm_container_vpc_worker_pool": kubernetes.DataSourceIBMContainerVpcClusterWorkerPool(), + "ibm_container_worker_pool": kubernetes.DataSourceIBMContainerWorkerPool(), + "ibm_container_storage_attachment": kubernetes.DataSourceIBMContainerVpcWorkerVolumeAttachment(), + "ibm_cr_namespaces": registry.DataIBMContainerRegistryNamespaces(), + "ibm_cloud_shell_account_settings": cloudshell.DataSourceIBMCloudShellAccountSettings(), + "ibm_cos_bucket": cos.DataSourceIBMCosBucket(), + "ibm_cos_bucket_object": cos.DataSourceIBMCosBucketObject(), + "ibm_dns_domain_registration": classicinfrastructure.DataSourceIBMDNSDomainRegistration(), + "ibm_dns_domain": classicinfrastructure.DataSourceIBMDNSDomain(), + "ibm_dns_secondary": classicinfrastructure.DataSourceIBMDNSSecondary(), + "ibm_event_streams_topic": eventstreams.DataSourceIBMEventStreamsTopic(), + "ibm_event_streams_schema": eventstreams.DataSourceIBMEventStreamsSchema(), + "ibm_hpcs": hpcs.DataSourceIBMHPCS(), + "ibm_iam_access_group": iamaccessgroup.DataSourceIBMIAMAccessGroup(), + "ibm_iam_access_group_policy": iampolicy.DataSourceIBMIAMAccessGroupPolicy(), + "ibm_iam_account_settings": iamidentity.DataSourceIBMIAMAccountSettings(), + "ibm_iam_auth_token": iamidentity.DataSourceIBMIAMAuthToken(), + "ibm_iam_role_actions": iampolicy.DataSourceIBMIAMRoleAction(), + "ibm_iam_users": iamidentity.DataSourceIBMIAMUsers(), + "ibm_iam_roles": iampolicy.DataSourceIBMIAMRole(), + "ibm_iam_user_policy": iampolicy.DataSourceIBMIAMUserPolicy(), + "ibm_iam_authorization_policies": iampolicy.DataSourceIBMIAMAuthorizationPolicies(), + "ibm_iam_user_profile": iamidentity.DataSourceIBMIAMUserProfile(), + "ibm_iam_service_id": iamidentity.DataSourceIBMIAMServiceID(), + "ibm_iam_service_policy": iampolicy.DataSourceIBMIAMServicePolicy(), + "ibm_iam_api_key": iamidentity.DataSourceIBMIamApiKey(), + "ibm_iam_trusted_profile": iamidentity.DataSourceIBMIamTrustedProfile(), + "ibm_iam_trusted_profile_claim_rule": iamidentity.DataSourceIBMIamTrustedProfileClaimRule(), + "ibm_iam_trusted_profile_link": iamidentity.DataSourceIBMIamTrustedProfileLink(), + "ibm_iam_trusted_profile_claim_rules": iamidentity.DataSourceIBMIamTrustedProfileClaimRules(), + "ibm_iam_trusted_profile_links": iamidentity.DataSourceIBMIamTrustedProfileLinks(), + "ibm_iam_trusted_profiles": iamidentity.DataSourceIBMIamTrustedProfiles(), + "ibm_iam_trusted_profile_policy": iampolicy.DataSourceIBMIAMTrustedProfilePolicy(), + + // bare_metal_server + "ibm_is_bare_metal_server_disk": vpc.DataSourceIBMIsBareMetalServerDisk(), + "ibm_is_bare_metal_server_disks": vpc.DataSourceIBMIsBareMetalServerDisks(), + "ibm_is_bare_metal_server_initialization": vpc.DataSourceIBMIsBareMetalServerInitialization(), + "ibm_is_bare_metal_server_network_interface_floating_ip": vpc.DataSourceIBMIsBareMetalServerNetworkInterfaceFloatingIP(), + "ibm_is_bare_metal_server_network_interface_floating_ips": vpc.DataSourceIBMIsBareMetalServerNetworkInterfaceFloatingIPs(), + "ibm_is_bare_metal_server_network_interface": vpc.DataSourceIBMIsBareMetalServerNetworkInterface(), + "ibm_is_bare_metal_server_network_interfaces": vpc.DataSourceIBMIsBareMetalServerNetworkInterfaces(), + "ibm_is_bare_metal_server_profile": vpc.DataSourceIBMIsBareMetalServerProfile(), + "ibm_is_bare_metal_server_profiles": vpc.DataSourceIBMIsBareMetalServerProfiles(), + "ibm_is_bare_metal_server": vpc.DataSourceIBMIsBareMetalServer(), + "ibm_is_bare_metal_servers": vpc.DataSourceIBMIsBareMetalServers(), + + "ibm_is_dedicated_host": vpc.DataSourceIbmIsDedicatedHost(), + "ibm_is_dedicated_hosts": vpc.DataSourceIbmIsDedicatedHosts(), + "ibm_is_dedicated_host_profile": vpc.DataSourceIbmIsDedicatedHostProfile(), + "ibm_is_dedicated_host_profiles": vpc.DataSourceIbmIsDedicatedHostProfiles(), + "ibm_is_dedicated_host_group": vpc.DataSourceIbmIsDedicatedHostGroup(), + "ibm_is_dedicated_host_groups": vpc.DataSourceIbmIsDedicatedHostGroups(), + "ibm_is_dedicated_host_disk": vpc.DataSourceIbmIsDedicatedHostDisk(), + "ibm_is_dedicated_host_disks": vpc.DataSourceIbmIsDedicatedHostDisks(), + "ibm_is_placement_group": vpc.DataSourceIbmIsPlacementGroup(), + "ibm_is_placement_groups": vpc.DataSourceIbmIsPlacementGroups(), + "ibm_is_floating_ip": vpc.DataSourceIBMISFloatingIP(), + "ibm_is_floating_ips": vpc.DataSourceIBMIsFloatingIps(), + "ibm_is_flow_log": vpc.DataSourceIBMIsFlowLog(), + "ibm_is_flow_logs": vpc.DataSourceIBMISFlowLogs(), + "ibm_is_image": vpc.DataSourceIBMISImage(), + "ibm_is_images": vpc.DataSourceIBMISImages(), + "ibm_is_endpoint_gateway_targets": vpc.DataSourceIBMISEndpointGatewayTargets(), + "ibm_is_instance_group": vpc.DataSourceIBMISInstanceGroup(), + "ibm_is_instance_group_memberships": vpc.DataSourceIBMISInstanceGroupMemberships(), + "ibm_is_instance_group_membership": vpc.DataSourceIBMISInstanceGroupMembership(), + "ibm_is_instance_group_manager": vpc.DataSourceIBMISInstanceGroupManager(), + "ibm_is_instance_group_managers": vpc.DataSourceIBMISInstanceGroupManagers(), + "ibm_is_instance_group_manager_policies": vpc.DataSourceIBMISInstanceGroupManagerPolicies(), + "ibm_is_instance_group_manager_policy": vpc.DataSourceIBMISInstanceGroupManagerPolicy(), + "ibm_is_instance_group_manager_action": vpc.DataSourceIBMISInstanceGroupManagerAction(), + "ibm_is_instance_group_manager_actions": vpc.DataSourceIBMISInstanceGroupManagerActions(), + "ibm_is_virtual_endpoint_gateways": vpc.DataSourceIBMISEndpointGateways(), + "ibm_is_virtual_endpoint_gateway_ips": vpc.DataSourceIBMISEndpointGatewayIPs(), + "ibm_is_virtual_endpoint_gateway": vpc.DataSourceIBMISEndpointGateway(), + "ibm_is_instance_template": vpc.DataSourceIBMISInstanceTemplate(), + "ibm_is_instance_templates": vpc.DataSourceIBMISInstanceTemplates(), + "ibm_is_instance_profile": vpc.DataSourceIBMISInstanceProfile(), + "ibm_is_instance_profiles": vpc.DataSourceIBMISInstanceProfiles(), + "ibm_is_instance": vpc.DataSourceIBMISInstance(), + "ibm_is_instances": vpc.DataSourceIBMISInstances(), + "ibm_is_instance_network_interface": vpc.DataSourceIBMIsInstanceNetworkInterface(), + "ibm_is_instance_network_interfaces": vpc.DataSourceIBMIsInstanceNetworkInterfaces(), + "ibm_is_instance_disk": vpc.DataSourceIbmIsInstanceDisk(), + "ibm_is_instance_disks": vpc.DataSourceIbmIsInstanceDisks(), + "ibm_is_instance_volume_attachment": vpc.DataSourceIBMISInstanceVolumeAttachment(), + "ibm_is_instance_volume_attachments": vpc.DataSourceIBMISInstanceVolumeAttachments(), + "ibm_is_ipsec_policy": vpc.DataSourceIBMIsIpsecPolicy(), + "ibm_is_ipsec_policies": vpc.DataSourceIBMIsIpsecPolicies(), + "ibm_is_ike_policies": vpc.DataSourceIBMIsIkePolicies(), + "ibm_is_ike_policy": vpc.DataSourceIBMIsIkePolicy(), + "ibm_is_lb": vpc.DataSourceIBMISLB(), + "ibm_is_lb_listener": vpc.DataSourceIBMISLBListener(), + "ibm_is_lb_listeners": vpc.DataSourceIBMISLBListeners(), + "ibm_is_lb_listener_policies": vpc.DataSourceIBMISLBListenerPolicies(), + "ibm_is_lb_listener_policy": vpc.DataSourceIBMISLBListenerPolicy(), + "ibm_is_lb_listener_policy_rule": vpc.DataSourceIBMISLBListenerPolicyRule(), + "ibm_is_lb_listener_policy_rules": vpc.DataSourceIBMISLBListenerPolicyRules(), + "ibm_is_lb_pool": vpc.DataSourceIBMISLBPool(), + "ibm_is_lb_pools": vpc.DataSourceIBMISLBPools(), + "ibm_is_lb_pool_member": vpc.DataSourceIBMIBLBPoolMember(), + "ibm_is_lb_pool_members": vpc.DataSourceIBMISLBPoolMembers(), + "ibm_is_lb_profiles": vpc.DataSourceIBMISLbProfiles(), + "ibm_is_lbs": vpc.DataSourceIBMISLBS(), + "ibm_is_public_gateway": vpc.DataSourceIBMISPublicGateway(), + "ibm_is_public_gateways": vpc.DataSourceIBMISPublicGateways(), + "ibm_is_region": vpc.DataSourceIBMISRegion(), + "ibm_is_regions": vpc.DataSourceIBMISRegions(), + "ibm_is_ssh_key": vpc.DataSourceIBMISSSHKey(), + "ibm_is_subnet": vpc.DataSourceIBMISSubnet(), + "ibm_is_subnets": vpc.DataSourceIBMISSubnets(), + "ibm_is_subnet_reserved_ip": vpc.DataSourceIBMISReservedIP(), + "ibm_is_subnet_reserved_ips": vpc.DataSourceIBMISReservedIPs(), + "ibm_is_security_group": vpc.DataSourceIBMISSecurityGroup(), + "ibm_is_security_groups": vpc.DataSourceIBMIsSecurityGroups(), + "ibm_is_security_group_rule": vpc.DataSourceIBMIsSecurityGroupRule(), + "ibm_is_security_group_rules": vpc.DataSourceIBMIsSecurityGroupRules(), + "ibm_is_security_group_target": vpc.DataSourceIBMISSecurityGroupTarget(), + "ibm_is_security_group_targets": vpc.DataSourceIBMISSecurityGroupTargets(), + "ibm_is_snapshot": vpc.DataSourceSnapshot(), + "ibm_is_snapshots": vpc.DataSourceSnapshots(), + "ibm_is_volume": vpc.DataSourceIBMISVolume(), + "ibm_is_volume_profile": vpc.DataSourceIBMISVolumeProfile(), + "ibm_is_volume_profiles": vpc.DataSourceIBMISVolumeProfiles(), + "ibm_is_vpc": vpc.DataSourceIBMISVPC(), + "ibm_is_vpcs": vpc.DataSourceIBMISVPCs(), + "ibm_is_vpn_gateway": vpc.DataSourceIBMISVPNGateway(), + "ibm_is_vpn_gateways": vpc.DataSourceIBMISVPNGateways(), + "ibm_is_vpc_address_prefixes": vpc.DataSourceIbmIsVpcAddressPrefixes(), + "ibm_is_vpc_address_prefix": vpc.DataSourceIBMIsVPCAddressPrefix(), + "ibm_is_vpn_gateway_connection": vpc.DataSourceIBMISVPNGatewayConnection(), + "ibm_is_vpn_gateway_connections": vpc.DataSourceIBMISVPNGatewayConnections(), + "ibm_is_vpc_default_routing_table": vpc.DataSourceIBMISVPCDefaultRoutingTable(), + "ibm_is_vpc_routing_table": vpc.DataSourceIBMIBMIsVPCRoutingTable(), + "ibm_is_vpc_routing_tables": vpc.DataSourceIBMISVPCRoutingTables(), + "ibm_is_vpc_routing_table_route": vpc.DataSourceIBMIBMIsVPCRoutingTableRoute(), + "ibm_is_vpc_routing_table_routes": vpc.DataSourceIBMISVPCRoutingTableRoutes(), + "ibm_is_zone": vpc.DataSourceIBMISZone(), + "ibm_is_zones": vpc.DataSourceIBMISZones(), + "ibm_is_operating_system": vpc.DataSourceIBMISOperatingSystem(), + "ibm_is_operating_systems": vpc.DataSourceIBMISOperatingSystems(), + "ibm_is_network_acls": vpc.DataSourceIBMIsNetworkAcls(), + "ibm_is_network_acl": vpc.DataSourceIBMIsNetworkACL(), + "ibm_is_network_acl_rule": vpc.DataSourceIBMISNetworkACLRule(), + "ibm_is_network_acl_rules": vpc.DataSourceIBMISNetworkACLRules(), + "ibm_lbaas": classicinfrastructure.DataSourceIBMLbaas(), + "ibm_network_vlan": classicinfrastructure.DataSourceIBMNetworkVlan(), + "ibm_org": cloudfoundry.DataSourceIBMOrg(), + "ibm_org_quota": cloudfoundry.DataSourceIBMOrgQuota(), + "ibm_kp_key": kms.DataSourceIBMkey(), + "ibm_kms_key_rings": kms.DataSourceIBMKMSkeyRings(), + "ibm_kms_key_policies": kms.DataSourceIBMKMSkeyPolicies(), + "ibm_kms_keys": kms.DataSourceIBMKMSkeys(), + "ibm_kms_key": kms.DataSourceIBMKMSkey(), + "ibm_pn_application_chrome": pushnotification.DataSourceIBMPNApplicationChrome(), + "ibm_app_config_environment": appconfiguration.DataSourceIBMAppConfigEnvironment(), + "ibm_app_config_environments": appconfiguration.DataSourceIBMAppConfigEnvironments(), + "ibm_app_config_feature": appconfiguration.DataSourceIBMAppConfigFeature(), + "ibm_app_config_features": appconfiguration.DataSourceIBMAppConfigFeatures(), + + "ibm_resource_quota": resourcecontroller.DataSourceIBMResourceQuota(), + "ibm_resource_group": resourcemanager.DataSourceIBMResourceGroup(), + "ibm_resource_instance": resourcecontroller.DataSourceIBMResourceInstance(), + "ibm_resource_key": resourcecontroller.DataSourceIBMResourceKey(), + "ibm_security_group": classicinfrastructure.DataSourceIBMSecurityGroup(), + "ibm_service_instance": cloudfoundry.DataSourceIBMServiceInstance(), + "ibm_service_key": cloudfoundry.DataSourceIBMServiceKey(), + "ibm_service_plan": cloudfoundry.DataSourceIBMServicePlan(), + "ibm_space": cloudfoundry.DataSourceIBMSpace(), + + // Added for Schematics + "ibm_schematics_workspace": schematics.DataSourceIBMSchematicsWorkspace(), + "ibm_schematics_output": schematics.DataSourceIBMSchematicsOutput(), + "ibm_schematics_state": schematics.DataSourceIBMSchematicsState(), + "ibm_schematics_action": schematics.DataSourceIBMSchematicsAction(), + "ibm_schematics_job": schematics.DataSourceIBMSchematicsJob(), + "ibm_schematics_inventory": schematics.DataSourceIBMSchematicsInventory(), + "ibm_schematics_resource_query": schematics.DataSourceIBMSchematicsResourceQuery(), + + // // Added for Power Resources + + "ibm_pi_catalog_images": power.DataSourceIBMPICatalogImages(), + "ibm_pi_cloud_connection": power.DataSourceIBMPICloudConnection(), + "ibm_pi_cloud_connections": power.DataSourceIBMPICloudConnections(), + "ibm_pi_cloud_instance": power.DataSourceIBMPICloudInstance(), + "ibm_pi_console_languages": power.DataSourceIBMPIInstanceConsoleLanguages(), + "ibm_pi_dhcp": power.DataSourceIBMPIDhcp(), + "ibm_pi_dhcps": power.DataSourceIBMPIDhcps(), + "ibm_pi_image": power.DataSourceIBMPIImage(), + "ibm_pi_images": power.DataSourceIBMPIImages(), + "ibm_pi_instance": power.DataSourceIBMPIInstance(), + "ibm_pi_instances": power.DataSourceIBMPIInstances(), + "ibm_pi_instance_ip": power.DataSourceIBMPIInstanceIP(), + "ibm_pi_instance_snapshots": power.DataSourceIBMPISnapshots(), + "ibm_pi_instance_volumes": power.DataSourceIBMPIInstanceVolumes(), + "ibm_pi_key": power.DataSourceIBMPIKey(), + "ibm_pi_keys": power.DataSourceIBMPIKeys(), + "ibm_pi_network": power.DataSourceIBMPINetwork(), + "ibm_pi_network_port": power.DataSourceIBMPINetworkPort(), + "ibm_pi_placement_group": power.DataSourceIBMPIPlacementGroup(), + "ibm_pi_placement_groups": power.DataSourceIBMPIPlacementGroups(), + "ibm_pi_public_network": power.DataSourceIBMPIPublicNetwork(), + "ibm_pi_pvm_snapshots": power.DataSourceIBMPISnapshot(), + "ibm_pi_sap_profile": power.DataSourceIBMPISAPProfile(), + "ibm_pi_sap_profiles": power.DataSourceIBMPISAPProfiles(), + "ibm_pi_storage_pool_capacity": power.DataSourceIBMPIStoragePoolCapacity(), + "ibm_pi_storage_pools_capacity": power.DataSourceIBMPIStoragePoolsCapacity(), + "ibm_pi_storage_type_capacity": power.DataSourceIBMPIStorageTypeCapacity(), + "ibm_pi_storage_types_capacity": power.DataSourceIBMPIStorageTypesCapacity(), + "ibm_pi_tenant": power.DataSourceIBMPITenant(), + "ibm_pi_volume": power.DataSourceIBMPIVolume(), + + // // Added for private dns zones + + "ibm_dns_zones": dnsservices.DataSourceIBMPrivateDNSZones(), + "ibm_dns_permitted_networks": dnsservices.DataSourceIBMPrivateDNSPermittedNetworks(), + "ibm_dns_resource_records": dnsservices.DataSourceIBMPrivateDNSResourceRecords(), + "ibm_dns_glb_monitors": dnsservices.DataSourceIBMPrivateDNSGLBMonitors(), + "ibm_dns_glb_pools": dnsservices.DataSourceIBMPrivateDNSGLBPools(), + "ibm_dns_glbs": dnsservices.DataSourceIBMPrivateDNSGLBs(), + "ibm_dns_custom_resolvers": dnsservices.DataSourceIBMPrivateDNSCustomResolver(), + "ibm_dns_custom_resolver_forwarding_rules": dnsservices.DataSourceIBMPrivateDNSForwardingRules(), + + // // Added for Direct Link + + "ibm_dl_gateways": directlink.DataSourceIBMDLGateways(), + "ibm_dl_offering_speeds": directlink.DataSourceIBMDLOfferingSpeeds(), + "ibm_dl_port": directlink.DataSourceIBMDirectLinkPort(), + "ibm_dl_ports": directlink.DataSourceIBMDirectLinkPorts(), + "ibm_dl_gateway": directlink.DataSourceIBMDLGateway(), + "ibm_dl_locations": directlink.DataSourceIBMDLLocations(), + "ibm_dl_routers": directlink.DataSourceIBMDLRouters(), + "ibm_dl_provider_ports": directlink.DataSourceIBMDirectLinkProviderPorts(), + "ibm_dl_provider_gateways": directlink.DataSourceIBMDirectLinkProviderGateways(), + + // //Added for Transit Gateway + "ibm_tg_gateway": transitgateway.DataSourceIBMTransitGateway(), + "ibm_tg_gateways": transitgateway.DataSourceIBMTransitGateways(), + "ibm_tg_locations": transitgateway.DataSourceIBMTransitGatewaysLocations(), + "ibm_tg_location": transitgateway.DataSourceIBMTransitGatewaysLocation(), + "ibm_tg_route_report": transitgateway.DataSourceIBMTransitGatewayRouteReport(), + "ibm_tg_route_reports": transitgateway.DataSourceIBMTransitGatewayRouteReports(), + + // //Added for BSS Enterprise + "ibm_enterprises": enterprise.DataSourceIBMEnterprises(), + "ibm_enterprise_account_groups": enterprise.DataSourceIBMEnterpriseAccountGroups(), + "ibm_enterprise_accounts": enterprise.DataSourceIBMEnterpriseAccounts(), + + // //Added for Secrets Manager + "ibm_secrets_manager_secrets": secretsmanager.DataSourceIBMSecretsManagerSecrets(), + "ibm_secrets_manager_secret": secretsmanager.DataSourceIBMSecretsManagerSecret(), + + // //Added for Satellite + "ibm_satellite_location": satellite.DataSourceIBMSatelliteLocation(), + "ibm_satellite_location_nlb_dns": satellite.DataSourceIBMSatelliteLocationNLBDNS(), + "ibm_satellite_attach_host_script": satellite.DataSourceIBMSatelliteAttachHostScript(), + "ibm_satellite_cluster": satellite.DataSourceIBMSatelliteCluster(), + "ibm_satellite_cluster_worker_pool": satellite.DataSourceIBMSatelliteClusterWorkerPool(), + "ibm_satellite_link": satellite.DataSourceIBMSatelliteLink(), + "ibm_satellite_endpoint": satellite.DataSourceIBMSatelliteEndpoint(), + "ibm_satellite_cluster_worker_pool_zone_attachment": satellite.DataSourceIBMSatelliteClusterWorkerPoolAttachment(), + + // // Catalog related resources + "ibm_cm_catalog": catalogmanagement.DataSourceIBMCmCatalog(), + "ibm_cm_offering": catalogmanagement.DataSourceIBMCmOffering(), + "ibm_cm_version": catalogmanagement.DataSourceIBMCmVersion(), + "ibm_cm_offering_instance": catalogmanagement.DataSourceIBMCmOfferingInstance(), + + // //Added for Resource Tag + "ibm_resource_tag": globaltagging.DataSourceIBMResourceTag(), + + // // Atracker + "ibm_atracker_targets": atracker.DataSourceIBMAtrackerTargets(), + "ibm_atracker_routes": atracker.DataSourceIBMAtrackerRoutes(), + "ibm_atracker_endpoints": atracker.DataSourceIBMAtrackerEndpoints(), + + //Security and Compliance Center + "ibm_scc_si_providers": scc.DataSourceIBMSccSiProviders(), + "ibm_scc_si_note": scc.DataSourceIBMSccSiNote(), + "ibm_scc_si_notes": scc.DataSourceIBMSccSiNotes(), + "ibm_scc_account_location": scc.DataSourceIBMSccAccountLocation(), + "ibm_scc_account_locations": scc.DataSourceIBMSccAccountLocations(), + "ibm_scc_account_settings": scc.DataSourceIBMSccAccountLocationSettings(), + "ibm_scc_si_occurrence": scc.DataSourceIBMSccSiOccurrence(), + "ibm_scc_si_occurrences": scc.DataSourceIBMSccSiOccurrences(), + + // Compliance Posture Management + "ibm_scc_posture_scopes": scc.DataSourceIBMSccPostureScopes(), + "ibm_scc_posture_latest_scans": scc.DataSourceIBMSccPostureLatestScans(), + "ibm_scc_posture_profiles": scc.DataSourceIBMSccPostureProfiles(), + "ibm_scc_posture_scan_summary": scc.DataSourceIBMSccPostureScansSummary(), + "ibm_scc_posture_scan_summaries": scc.DataSourceIBMSccPostureScanSummaries(), + "ibm_scc_posture_profile": scc.DataSourceIBMSccPostureProfileDetails(), + "ibm_scc_posture_group_profile": scc.DataSourceIBMSccPostureGroupProfileDetails(), + "ibm_scc_posture_scope_correlation": scc.DataSourceIBMSccPostureScopeCorrelation(), + + // // Added for Context Based Restrictions + "ibm_cbr_zone": contextbasedrestrictions.DataSourceIBMCbrZone(), + "ibm_cbr_rule": contextbasedrestrictions.DataSourceIBMCbrRule(), + + // // Added for Event Notifications + "ibm_en_destination": eventnotification.DataSourceIBMEnDestination(), + "ibm_en_destinations": eventnotification.DataSourceIBMEnDestinations(), + "ibm_en_topic": eventnotification.DataSourceIBMEnTopic(), + "ibm_en_topics": eventnotification.DataSourceIBMEnTopics(), + "ibm_en_subscription": eventnotification.DataSourceIBMEnSubscription(), + "ibm_en_subscriptions": eventnotification.DataSourceIBMEnSubscriptions(), + }, + + ResourcesMap: map[string]*schema.Resource{ + "ibm_api_gateway_endpoint": apigateway.ResourceIBMApiGatewayEndPoint(), + "ibm_api_gateway_endpoint_subscription": apigateway.ResourceIBMApiGatewayEndpointSubscription(), + "ibm_app": cloudfoundry.ResourceIBMApp(), + "ibm_app_domain_private": cloudfoundry.ResourceIBMAppDomainPrivate(), + "ibm_app_domain_shared": cloudfoundry.ResourceIBMAppDomainShared(), + "ibm_app_route": cloudfoundry.ResourceIBMAppRoute(), + + // // AppID + "ibm_appid_action_url": appid.ResourceIBMAppIDActionURL(), + "ibm_appid_apm": appid.ResourceIBMAppIDAPM(), + "ibm_appid_application": appid.ResourceIBMAppIDApplication(), + "ibm_appid_application_scopes": appid.ResourceIBMAppIDApplicationScopes(), + "ibm_appid_application_roles": appid.ResourceIBMAppIDApplicationRoles(), + "ibm_appid_audit_status": appid.ResourceIBMAppIDAuditStatus(), + "ibm_appid_cloud_directory_template": appid.ResourceIBMAppIDCloudDirectoryTemplate(), + "ibm_appid_cloud_directory_user": appid.ResourceIBMAppIDCloudDirectoryUser(), + "ibm_appid_idp_cloud_directory": appid.ResourceIBMAppIDIDPCloudDirectory(), + "ibm_appid_idp_custom": appid.ResourceIBMAppIDIDPCustom(), + "ibm_appid_idp_facebook": appid.ResourceIBMAppIDIDPFacebook(), + "ibm_appid_idp_google": appid.ResourceIBMAppIDIDPGoogle(), + "ibm_appid_idp_saml": appid.ResourceIBMAppIDIDPSAML(), + "ibm_appid_languages": appid.ResourceIBMAppIDLanguages(), + "ibm_appid_mfa": appid.ResourceIBMAppIDMFA(), + "ibm_appid_mfa_channel": appid.ResourceIBMAppIDMFAChannel(), + "ibm_appid_password_regex": appid.ResourceIBMAppIDPasswordRegex(), + "ibm_appid_token_config": appid.ResourceIBMAppIDTokenConfig(), + "ibm_appid_redirect_urls": appid.ResourceIBMAppIDRedirectURLs(), + "ibm_appid_role": appid.ResourceIBMAppIDRole(), + "ibm_appid_theme_color": appid.ResourceIBMAppIDThemeColor(), + "ibm_appid_theme_text": appid.ResourceIBMAppIDThemeText(), + "ibm_appid_user_roles": appid.ResourceIBMAppIDUserRoles(), + + "ibm_function_action": functions.ResourceIBMFunctionAction(), + "ibm_function_package": functions.ResourceIBMFunctionPackage(), + "ibm_function_rule": functions.ResourceIBMFunctionRule(), + "ibm_function_trigger": functions.ResourceIBMFunctionTrigger(), + "ibm_function_namespace": functions.ResourceIBMFunctionNamespace(), + "ibm_cis": cis.ResourceIBMCISInstance(), + "ibm_database": database.ResourceIBMDatabaseInstance(), + "ibm_certificate_manager_import": certificatemanager.ResourceIBMCertificateManagerImport(), + "ibm_certificate_manager_order": certificatemanager.ResourceIBMCertificateManagerOrder(), + "ibm_cis_domain": cis.ResourceIBMCISDomain(), + "ibm_cis_domain_settings": cis.ResourceIBMCISSettings(), + "ibm_cis_firewall": cis.ResourceIBMCISFirewallRecord(), + "ibm_cis_range_app": cis.ResourceIBMCISRangeApp(), + "ibm_cis_healthcheck": cis.ResourceIBMCISHealthCheck(), + "ibm_cis_origin_pool": cis.ResourceIBMCISPool(), + "ibm_cis_global_load_balancer": cis.ResourceIBMCISGlb(), + "ibm_cis_certificate_upload": cis.ResourceIBMCISCertificateUpload(), + "ibm_cis_dns_record": cis.ResourceIBMCISDnsRecord(), + "ibm_cis_dns_records_import": cis.ResourceIBMCISDNSRecordsImport(), + "ibm_cis_rate_limit": cis.ResourceIBMCISRateLimit(), + "ibm_cis_page_rule": cis.ResourceIBMCISPageRule(), + "ibm_cis_edge_functions_action": cis.ResourceIBMCISEdgeFunctionsAction(), + "ibm_cis_edge_functions_trigger": cis.ResourceIBMCISEdgeFunctionsTrigger(), + "ibm_cis_tls_settings": cis.ResourceIBMCISTLSSettings(), + "ibm_cis_waf_package": cis.ResourceIBMCISWAFPackage(), + "ibm_cis_webhook": cis.ResourceIBMCISWebhooks(), + "ibm_cis_alert": cis.ResourceIBMCISAlert(), + "ibm_cis_routing": cis.ResourceIBMCISRouting(), + "ibm_cis_waf_group": cis.ResourceIBMCISWAFGroup(), + "ibm_cis_cache_settings": cis.ResourceIBMCISCacheSettings(), + "ibm_cis_custom_page": cis.ResourceIBMCISCustomPage(), + "ibm_cis_waf_rule": cis.ResourceIBMCISWAFRule(), + "ibm_cis_certificate_order": cis.ResourceIBMCISCertificateOrder(), + "ibm_cis_filter": cis.ResourceIBMCISFilter(), + "ibm_cis_firewall_rule": cis.ResourceIBMCISFirewallrules(), + "ibm_cloudant": cloudant.ResourceIBMCloudant(), + "ibm_cloud_shell_account_settings": cloudshell.ResourceIBMCloudShellAccountSettings(), + "ibm_compute_autoscale_group": classicinfrastructure.ResourceIBMComputeAutoScaleGroup(), + "ibm_compute_autoscale_policy": classicinfrastructure.ResourceIBMComputeAutoScalePolicy(), + "ibm_compute_bare_metal": classicinfrastructure.ResourceIBMComputeBareMetal(), + "ibm_compute_dedicated_host": classicinfrastructure.ResourceIBMComputeDedicatedHost(), + "ibm_compute_monitor": classicinfrastructure.ResourceIBMComputeMonitor(), + "ibm_compute_placement_group": classicinfrastructure.ResourceIBMComputePlacementGroup(), + "ibm_compute_reserved_capacity": classicinfrastructure.ResourceIBMComputeReservedCapacity(), + "ibm_compute_provisioning_hook": classicinfrastructure.ResourceIBMComputeProvisioningHook(), + "ibm_compute_ssh_key": classicinfrastructure.ResourceIBMComputeSSHKey(), + "ibm_compute_ssl_certificate": classicinfrastructure.ResourceIBMComputeSSLCertificate(), + "ibm_compute_user": classicinfrastructure.ResourceIBMComputeUser(), + "ibm_compute_vm_instance": classicinfrastructure.ResourceIBMComputeVmInstance(), + "ibm_container_addons": kubernetes.ResourceIBMContainerAddOns(), + "ibm_container_alb": kubernetes.ResourceIBMContainerALB(), + "ibm_container_alb_create": kubernetes.ResourceIBMContainerAlbCreate(), + "ibm_container_api_key_reset": kubernetes.ResourceIBMContainerAPIKeyReset(), + "ibm_container_vpc_alb": kubernetes.ResourceIBMContainerVpcALB(), + "ibm_container_vpc_alb_create": kubernetes.ResourceIBMContainerVpcAlbCreateNew(), + "ibm_container_vpc_worker_pool": kubernetes.ResourceIBMContainerVpcWorkerPool(), + "ibm_container_vpc_cluster": kubernetes.ResourceIBMContainerVpcCluster(), + "ibm_container_alb_cert": kubernetes.ResourceIBMContainerALBCert(), + "ibm_container_cluster": kubernetes.ResourceIBMContainerCluster(), + "ibm_container_cluster_feature": kubernetes.ResourceIBMContainerClusterFeature(), + "ibm_container_bind_service": kubernetes.ResourceIBMContainerBindService(), + "ibm_container_worker_pool": kubernetes.ResourceIBMContainerWorkerPool(), + "ibm_container_worker_pool_zone_attachment": kubernetes.ResourceIBMContainerWorkerPoolZoneAttachment(), + "ibm_container_storage_attachment": kubernetes.ResourceIBMContainerVpcWorkerVolumeAttachment(), + "ibm_container_nlb_dns": kubernetes.ResourceIBMContainerNlbDns(), + "ibm_cr_namespace": registry.ResourceIBMCrNamespace(), + "ibm_cr_retention_policy": registry.ResourceIBMCrRetentionPolicy(), + "ibm_ob_logging": kubernetes.ResourceIBMObLogging(), + "ibm_ob_monitoring": kubernetes.ResourceIBMObMonitoring(), + "ibm_cos_bucket": cos.ResourceIBMCOSBucket(), + "ibm_cos_bucket_object": cos.ResourceIBMCOSBucketObject(), + "ibm_dns_domain": classicinfrastructure.ResourceIBMDNSDomain(), + "ibm_dns_domain_registration_nameservers": classicinfrastructure.ResourceIBMDNSDomainRegistrationNameservers(), + "ibm_dns_secondary": classicinfrastructure.ResourceIBMDNSSecondary(), + "ibm_dns_record": classicinfrastructure.ResourceIBMDNSRecord(), + "ibm_event_streams_topic": eventstreams.ResourceIBMEventStreamsTopic(), + "ibm_event_streams_schema": eventstreams.ResourceIBMEventStreamsSchema(), + "ibm_firewall": classicinfrastructure.ResourceIBMFirewall(), + "ibm_firewall_policy": classicinfrastructure.ResourceIBMFirewallPolicy(), + "ibm_hpcs": hpcs.ResourceIBMHPCS(), + "ibm_iam_access_group": iamaccessgroup.ResourceIBMIAMAccessGroup(), + "ibm_iam_account_settings": iamidentity.ResourceIBMIAMAccountSettings(), + "ibm_iam_custom_role": iampolicy.ResourceIBMIAMCustomRole(), + "ibm_iam_access_group_dynamic_rule": iamaccessgroup.ResourceIBMIAMDynamicRule(), + "ibm_iam_access_group_members": iamaccessgroup.ResourceIBMIAMAccessGroupMembers(), + "ibm_iam_access_group_policy": iampolicy.ResourceIBMIAMAccessGroupPolicy(), + "ibm_iam_authorization_policy": iampolicy.ResourceIBMIAMAuthorizationPolicy(), + "ibm_iam_authorization_policy_detach": iampolicy.ResourceIBMIAMAuthorizationPolicyDetach(), + "ibm_iam_user_policy": iampolicy.ResourceIBMIAMUserPolicy(), + "ibm_iam_user_settings": iamidentity.ResourceIBMIAMUserSettings(), + "ibm_iam_service_id": iamidentity.ResourceIBMIAMServiceID(), + "ibm_iam_service_api_key": iamidentity.ResourceIBMIAMServiceAPIKey(), + "ibm_iam_service_policy": iampolicy.ResourceIBMIAMServicePolicy(), + "ibm_iam_user_invite": iampolicy.ResourceIBMIAMUserInvite(), + "ibm_iam_api_key": iamidentity.ResourceIBMIAMApiKey(), + "ibm_iam_trusted_profile": iamidentity.ResourceIBMIAMTrustedProfile(), + "ibm_iam_trusted_profile_claim_rule": iamidentity.ResourceIBMIAMTrustedProfileClaimRule(), + "ibm_iam_trusted_profile_link": iamidentity.ResourceIBMIAMTrustedProfileLink(), + "ibm_iam_trusted_profile_policy": iampolicy.ResourceIBMIAMTrustedProfilePolicy(), + "ibm_ipsec_vpn": classicinfrastructure.ResourceIBMIPSecVPN(), + + // bare_metal_server + "ibm_is_bare_metal_server_action": vpc.ResourceIBMIsBareMetalServerAction(), + "ibm_is_bare_metal_server_disk": vpc.ResourceIBMIsBareMetalServerDisk(), + "ibm_is_bare_metal_server_network_interface_allow_float": vpc.ResourceIBMIsBareMetalServerNetworkInterfaceAllowFloat(), + "ibm_is_bare_metal_server_network_interface_floating_ip": vpc.ResourceIBMIsBareMetalServerNetworkInterfaceFloatingIp(), + "ibm_is_bare_metal_server_network_interface": vpc.ResourceIBMIsBareMetalServerNetworkInterface(), + "ibm_is_bare_metal_server": vpc.ResourceIBMIsBareMetalServer(), + + "ibm_is_dedicated_host": vpc.ResourceIbmIsDedicatedHost(), + "ibm_is_dedicated_host_group": vpc.ResourceIbmIsDedicatedHostGroup(), + "ibm_is_dedicated_host_disk_management": vpc.ResourceIBMISDedicatedHostDiskManagement(), + "ibm_is_placement_group": vpc.ResourceIbmIsPlacementGroup(), + "ibm_is_floating_ip": vpc.ResourceIBMISFloatingIP(), + "ibm_is_flow_log": vpc.ResourceIBMISFlowLog(), + "ibm_is_instance": vpc.ResourceIBMISInstance(), + "ibm_is_instance_action": vpc.ResourceIBMISInstanceAction(), + "ibm_is_instance_network_interface": vpc.ResourceIBMIsInstanceNetworkInterface(), + "ibm_is_instance_disk_management": vpc.ResourceIBMISInstanceDiskManagement(), + "ibm_is_instance_group": vpc.ResourceIBMISInstanceGroup(), + "ibm_is_instance_group_membership": vpc.ResourceIBMISInstanceGroupMembership(), + "ibm_is_instance_group_manager": vpc.ResourceIBMISInstanceGroupManager(), + "ibm_is_instance_group_manager_policy": vpc.ResourceIBMISInstanceGroupManagerPolicy(), + "ibm_is_instance_group_manager_action": vpc.ResourceIBMISInstanceGroupManagerAction(), + "ibm_is_instance_volume_attachment": vpc.ResourceIBMISInstanceVolumeAttachment(), + "ibm_is_virtual_endpoint_gateway": vpc.ResourceIBMISEndpointGateway(), + "ibm_is_virtual_endpoint_gateway_ip": vpc.ResourceIBMISEndpointGatewayIP(), + "ibm_is_instance_template": vpc.ResourceIBMISInstanceTemplate(), + "ibm_is_ike_policy": vpc.ResourceIBMISIKEPolicy(), + "ibm_is_ipsec_policy": vpc.ResourceIBMISIPSecPolicy(), + "ibm_is_lb": vpc.ResourceIBMISLB(), + "ibm_is_lb_listener": vpc.ResourceIBMISLBListener(), + "ibm_is_lb_listener_policy": vpc.ResourceIBMISLBListenerPolicy(), + "ibm_is_lb_listener_policy_rule": vpc.ResourceIBMISLBListenerPolicyRule(), + "ibm_is_lb_pool": vpc.ResourceIBMISLBPool(), + "ibm_is_lb_pool_member": vpc.ResourceIBMISLBPoolMember(), + "ibm_is_network_acl": vpc.ResourceIBMISNetworkACL(), + "ibm_is_network_acl_rule": vpc.ResourceIBMISNetworkACLRule(), + "ibm_is_public_gateway": vpc.ResourceIBMISPublicGateway(), + "ibm_is_security_group": vpc.ResourceIBMISSecurityGroup(), + "ibm_is_security_group_rule": vpc.ResourceIBMISSecurityGroupRule(), + "ibm_is_security_group_target": vpc.ResourceIBMISSecurityGroupTarget(), + "ibm_is_security_group_network_interface_attachment": vpc.ResourceIBMISSecurityGroupNetworkInterfaceAttachment(), + "ibm_is_subnet": vpc.ResourceIBMISSubnet(), + "ibm_is_subnet_reserved_ip": vpc.ResourceIBMISReservedIP(), + "ibm_is_subnet_network_acl_attachment": vpc.ResourceIBMISSubnetNetworkACLAttachment(), + "ibm_is_subnet_public_gateway_attachment": vpc.ResourceIBMISSubnetPublicGatewayAttachment(), + "ibm_is_subnet_routing_table_attachment": vpc.ResourceIBMISSubnetRoutingTableAttachment(), + "ibm_is_ssh_key": vpc.ResourceIBMISSSHKey(), + "ibm_is_snapshot": vpc.ResourceIBMSnapshot(), + "ibm_is_volume": vpc.ResourceIBMISVolume(), + "ibm_is_vpn_gateway": vpc.ResourceIBMISVPNGateway(), + "ibm_is_vpn_gateway_connection": vpc.ResourceIBMISVPNGatewayConnection(), + "ibm_is_vpc": vpc.ResourceIBMISVPC(), + "ibm_is_vpc_address_prefix": vpc.ResourceIBMISVpcAddressPrefix(), + "ibm_is_vpc_route": vpc.ResourceIBMISVpcRoute(), + "ibm_is_vpc_routing_table": vpc.ResourceIBMISVPCRoutingTable(), + "ibm_is_vpc_routing_table_route": vpc.ResourceIBMISVPCRoutingTableRoute(), + "ibm_is_image": vpc.ResourceIBMISImage(), + "ibm_lb": classicinfrastructure.ResourceIBMLb(), + "ibm_lbaas": classicinfrastructure.ResourceIBMLbaas(), + "ibm_lbaas_health_monitor": classicinfrastructure.ResourceIBMLbaasHealthMonitor(), + "ibm_lbaas_server_instance_attachment": classicinfrastructure.ResourceIBMLbaasServerInstanceAttachment(), + "ibm_lb_service": classicinfrastructure.ResourceIBMLbService(), + "ibm_lb_service_group": classicinfrastructure.ResourceIBMLbServiceGroup(), + "ibm_lb_vpx": classicinfrastructure.ResourceIBMLbVpx(), + "ibm_lb_vpx_ha": classicinfrastructure.ResourceIBMLbVpxHa(), + "ibm_lb_vpx_service": classicinfrastructure.ResourceIBMLbVpxService(), + "ibm_lb_vpx_vip": classicinfrastructure.ResourceIBMLbVpxVip(), + "ibm_multi_vlan_firewall": classicinfrastructure.ResourceIBMMultiVlanFirewall(), + "ibm_network_gateway": classicinfrastructure.ResourceIBMNetworkGateway(), + "ibm_network_gateway_vlan_association": classicinfrastructure.ResourceIBMNetworkGatewayVlanAttachment(), + "ibm_network_interface_sg_attachment": classicinfrastructure.ResourceIBMNetworkInterfaceSGAttachment(), + "ibm_network_public_ip": classicinfrastructure.ResourceIBMNetworkPublicIp(), + "ibm_network_vlan": classicinfrastructure.ResourceIBMNetworkVlan(), + "ibm_network_vlan_spanning": classicinfrastructure.ResourceIBMNetworkVlanSpan(), + "ibm_object_storage_account": classicinfrastructure.ResourceIBMObjectStorageAccount(), + "ibm_org": cloudfoundry.ResourceIBMOrg(), + "ibm_pn_application_chrome": pushnotification.ResourceIBMPNApplicationChrome(), + "ibm_app_config_environment": appconfiguration.ResourceIBMAppConfigEnvironment(), + "ibm_app_config_feature": appconfiguration.ResourceIBMIbmAppConfigFeature(), + "ibm_kms_key": kms.ResourceIBMKmskey(), + "ibm_kms_key_alias": kms.ResourceIBMKmskeyAlias(), + "ibm_kms_key_rings": kms.ResourceIBMKmskeyRings(), + "ibm_kms_key_policies": kms.ResourceIBMKmskeyPolicies(), + "ibm_kp_key": kms.ResourceIBMkey(), + "ibm_resource_group": resourcemanager.ResourceIBMResourceGroup(), + "ibm_resource_instance": resourcecontroller.ResourceIBMResourceInstance(), + "ibm_resource_key": resourcecontroller.ResourceIBMResourceKey(), + "ibm_security_group": classicinfrastructure.ResourceIBMSecurityGroup(), + "ibm_security_group_rule": classicinfrastructure.ResourceIBMSecurityGroupRule(), + "ibm_service_instance": cloudfoundry.ResourceIBMServiceInstance(), + "ibm_service_key": cloudfoundry.ResourceIBMServiceKey(), + "ibm_space": cloudfoundry.ResourceIBMSpace(), + "ibm_storage_evault": classicinfrastructure.ResourceIBMStorageEvault(), + "ibm_storage_block": classicinfrastructure.ResourceIBMStorageBlock(), + "ibm_storage_file": classicinfrastructure.ResourceIBMStorageFile(), + "ibm_subnet": classicinfrastructure.ResourceIBMSubnet(), + "ibm_dns_reverse_record": classicinfrastructure.ResourceIBMDNSReverseRecord(), + "ibm_ssl_certificate": classicinfrastructure.ResourceIBMSSLCertificate(), + "ibm_cdn": classicinfrastructure.ResourceIBMCDN(), + "ibm_hardware_firewall_shared": classicinfrastructure.ResourceIBMFirewallShared(), + + // //Added for Power Colo + + "ibm_pi_key": power.ResourceIBMPIKey(), + "ibm_pi_volume": power.ResourceIBMPIVolume(), + "ibm_pi_network": power.ResourceIBMPINetwork(), + "ibm_pi_instance": power.ResourceIBMPIInstance(), + "ibm_pi_operations": power.ResourceIBMPIIOperations(), + "ibm_pi_volume_attach": power.ResourceIBMPIVolumeAttach(), + "ibm_pi_capture": power.ResourceIBMPICapture(), + "ibm_pi_image": power.ResourceIBMPIImage(), + "ibm_pi_image_export": power.ResourceIBMPIImageExport(), + "ibm_pi_network_port": power.ResourceIBMPINetworkPort(), + "ibm_pi_snapshot": power.ResourceIBMPISnapshot(), + "ibm_pi_network_port_attach": power.ResourceIBMPINetworkPortAttach(), + "ibm_pi_dhcp": power.ResourceIBMPIDhcp(), + "ibm_pi_cloud_connection": power.ResourceIBMPICloudConnection(), + "ibm_pi_ike_policy": power.ResourceIBMPIIKEPolicy(), + "ibm_pi_ipsec_policy": power.ResourceIBMPIIPSecPolicy(), + "ibm_pi_vpn_connection": power.ResourceIBMPIVPNConnection(), + "ibm_pi_console_language": power.ResourceIBMPIInstanceConsoleLanguage(), + "ibm_pi_placement_group": power.ResourceIBMPIPlacementGroup(), + + // //Private DNS related resources + "ibm_dns_zone": dnsservices.ResourceIBMPrivateDNSZone(), + "ibm_dns_permitted_network": dnsservices.ResourceIBMPrivateDNSPermittedNetwork(), + "ibm_dns_resource_record": dnsservices.ResourceIBMPrivateDNSResourceRecord(), + "ibm_dns_glb_monitor": dnsservices.ResourceIBMPrivateDNSGLBMonitor(), + "ibm_dns_glb_pool": dnsservices.ResourceIBMPrivateDNSGLBPool(), + "ibm_dns_glb": dnsservices.ResourceIBMPrivateDNSGLB(), + + // //Added for Custom Resolver + "ibm_dns_custom_resolver": dnsservices.ResourceIBMPrivateDNSCustomResolver(), + "ibm_dns_custom_resolver_location": dnsservices.ResourceIBMPrivateDNSCRLocation(), + "ibm_dns_custom_resolver_forwarding_rule": dnsservices.ResourceIBMPrivateDNSForwardingRule(), + + // //Direct Link related resources + "ibm_dl_gateway": directlink.ResourceIBMDLGateway(), + "ibm_dl_virtual_connection": directlink.ResourceIBMDLGatewayVC(), + "ibm_dl_provider_gateway": directlink.ResourceIBMDLProviderGateway(), + // //Added for Transit Gateway + "ibm_tg_gateway": transitgateway.ResourceIBMTransitGateway(), + "ibm_tg_connection": transitgateway.ResourceIBMTransitGatewayConnection(), + "ibm_tg_route_report": transitgateway.ResourceIBMTransitGatewayRouteReport(), + + // //Catalog related resources + "ibm_cm_offering_instance": catalogmanagement.ResourceIBMCmOfferingInstance(), + "ibm_cm_catalog": catalogmanagement.ResourceIBMCmCatalog(), + "ibm_cm_offering": catalogmanagement.ResourceIBMCmOffering(), + "ibm_cm_version": catalogmanagement.ResourceIBMCmVersion(), + + // //Added for enterprise + "ibm_enterprise": enterprise.ResourceIBMEnterprise(), + "ibm_enterprise_account_group": enterprise.ResourceIBMEnterpriseAccountGroup(), + "ibm_enterprise_account": enterprise.ResourceIBMEnterpriseAccount(), + + //Added for Schematics + "ibm_schematics_workspace": schematics.ResourceIBMSchematicsWorkspace(), + "ibm_schematics_action": schematics.ResourceIBMSchematicsAction(), + "ibm_schematics_job": schematics.ResourceIBMSchematicsJob(), + "ibm_schematics_inventory": schematics.ResourceIBMSchematicsInventory(), + "ibm_schematics_resource_query": schematics.ResourceIBMSchematicsResourceQuery(), + + // //satellite resources + "ibm_satellite_location": satellite.ResourceIBMSatelliteLocation(), + "ibm_satellite_host": satellite.ResourceIBMSatelliteHost(), + "ibm_satellite_cluster": satellite.ResourceIBMSatelliteCluster(), + "ibm_satellite_cluster_worker_pool": satellite.ResourceIBMSatelliteClusterWorkerPool(), + "ibm_satellite_link": satellite.ResourceIBMSatelliteLink(), + "ibm_satellite_endpoint": satellite.ResourceIBMSatelliteEndpoint(), + "ibm_satellite_location_nlb_dns": satellite.ResourceIBMSatelliteLocationNlbDns(), + "ibm_satellite_cluster_worker_pool_zone_attachment": satellite.ResourceIbmSatelliteClusterWorkerPoolZoneAttachment(), + + //Added for Resource Tag + "ibm_resource_tag": globaltagging.ResourceIBMResourceTag(), + + // // Atracker + "ibm_atracker_target": atracker.ResourceIBMAtrackerTarget(), + "ibm_atracker_route": atracker.ResourceIBMAtrackerRoute(), + + // //Security and Compliance Center + "ibm_scc_si_note": scc.ResourceIBMSccSiNote(), + "ibm_scc_account_settings": scc.ResourceIBMSccAccountSettings(), + "ibm_scc_si_occurrence": scc.ResourceIBMSccSiOccurrence(), + + //Security and Compliance Center - PostureManagement + "ibm_scc_posture_collector": scc.ResourceIBMSccPostureCollectors(), + "ibm_scc_posture_scope": scc.ResourceIBMSccPostureScopes(), + "ibm_scc_posture_credential": scc.ResourceIBMSccPostureCredentials(), + + // // Added for Context Based Restrictions + "ibm_cbr_zone": contextbasedrestrictions.ResourceIBMCbrZone(), + "ibm_cbr_rule": contextbasedrestrictions.ResourceIBMCbrRule(), + + // // Added for Event Notifications + "ibm_en_destination": eventnotification.ResourceIBMEnDestination(), + "ibm_en_topic": eventnotification.ResourceIBMEnTopic(), + "ibm_en_subscription": eventnotification.ResourceIBMEnSubscription(), + }, + + ConfigureFunc: providerConfigure, + } +} + +var globalValidatorDict validate.ValidatorDict +var initOnce sync.Once + +func init() { + validate.SetValidatorDict(Validator()) +} + +// Validator return validator +func Validator() validate.ValidatorDict { + initOnce.Do(func() { + globalValidatorDict = validate.ValidatorDict{ + ResourceValidatorDictionary: map[string]*validate.ResourceValidator{ + "ibm_iam_account_settings": iamidentity.ResourceIBMIAMAccountSettingsValidator(), + "ibm_iam_custom_role": iampolicy.ResourceIBMIAMCustomRoleValidator(), + "ibm_cis_healthcheck": cis.ResourceIBMCISHealthCheckValidator(), + "ibm_cis_rate_limit": cis.ResourceIBMCISRateLimitValidator(), + "ibm_cis": cis.ResourceIBMCISValidator(), + "ibm_cis_domain_settings": cis.ResourceIBMCISDomainSettingValidator(), + "ibm_cis_tls_settings": cis.ResourceIBMCISTLSSettingsValidator(), + "ibm_cis_routing": cis.ResourceIBMCISRoutingValidator(), + "ibm_cis_page_rule": cis.ResourceIBMCISPageRuleValidator(), + "ibm_cis_waf_package": cis.ResourceIBMCISWAFPackageValidator(), + "ibm_cis_waf_group": cis.ResourceIBMCISWAFGroupValidator(), + "ibm_cis_certificate_upload": cis.ResourceIBMCISCertificateUploadValidator(), + "ibm_cis_cache_settings": cis.ResourceIBMCISCacheSettingsValidator(), + "ibm_cis_custom_page": cis.ResourceIBMCISCustomPageValidator(), + "ibm_cis_firewall": cis.ResourceIBMCISFirewallValidator(), + "ibm_cis_range_app": cis.ResourceIBMCISRangeAppValidator(), + "ibm_cis_waf_rule": cis.ResourceIBMCISWAFRuleValidator(), + "ibm_cis_certificate_order": cis.ResourceIBMCISCertificateOrderValidator(), + "ibm_cis_filter": cis.ResourceIBMCISFilterValidator(), + "ibm_cis_firewall_rules": cis.ResourceIBMCISFirewallrulesValidator(), + "ibm_container_cluster": kubernetes.ResourceIBMContainerClusterValidator(), + "ibm_container_worker_pool": kubernetes.ResourceIBMContainerWorkerPoolValidator(), + "ibm_container_vpc_worker_pool": kubernetes.ResourceIBMContainerVPCWorkerPoolValidator(), + "ibm_container_vpc_cluster": kubernetes.ResourceIBMContainerVpcClusterValidator(), + "ibm_cr_namespace": registry.ResourceIBMCrNamespaceValidator(), + "ibm_tg_gateway": transitgateway.ResourceIBMTGValidator(), + "ibm_app_config_feature": appconfiguration.ResourceIBMAppConfigFeatureValidator(), + "ibm_tg_connection": transitgateway.ResourceIBMTransitGatewayConnectionValidator(), + "ibm_dl_virtual_connection": directlink.ResourceIBMDLGatewayVCValidator(), + "ibm_dl_gateway": directlink.ResourceIBMDLGatewayValidator(), + "ibm_dl_provider_gateway": directlink.ResourceIBMDLProviderGatewayValidator(), + "ibm_database": database.ResourceIBMICDValidator(), + "ibm_function_package": functions.ResourceIBMFuncPackageValidator(), + "ibm_function_action": functions.ResourceIBMFuncActionValidator(), + "ibm_function_rule": functions.ResourceIBMFuncRuleValidator(), + "ibm_function_trigger": functions.ResourceIBMFuncTriggerValidator(), + "ibm_function_namespace": functions.ResourceIBMFuncNamespaceValidator(), + "ibm_hpcs": hpcs.ResourceIBMHPCSValidator(), + + // bare_metal_server + "ibm_is_bare_metal_server_disk": vpc.ResourceIBMIsBareMetalServerDiskValidator(), + "ibm_is_bare_metal_server_network_interface": vpc.ResourceIBMIsBareMetalServerNetworkInterfaceValidator(), + "ibm_is_bare_metal_server": vpc.ResourceIBMIsBareMetalServerValidator(), + + "ibm_is_dedicated_host_group": vpc.ResourceIbmIsDedicatedHostGroupValidator(), + "ibm_is_dedicated_host": vpc.ResourceIbmIsDedicatedHostValidator(), + "ibm_is_dedicated_host_disk_management": vpc.ResourceIBMISDedicatedHostDiskManagementValidator(), + "ibm_is_flow_log": vpc.ResourceIBMISFlowLogValidator(), + "ibm_is_instance_group": vpc.ResourceIBMISInstanceGroupValidator(), + "ibm_is_instance_group_membership": vpc.ResourceIBMISInstanceGroupMembershipValidator(), + "ibm_is_instance_group_manager": vpc.ResourceIBMISInstanceGroupManagerValidator(), + "ibm_is_instance_group_manager_policy": vpc.ResourceIBMISInstanceGroupManagerPolicyValidator(), + "ibm_is_instance_group_manager_action": vpc.ResourceIBMISInstanceGroupManagerActionValidator(), + "ibm_is_floating_ip": vpc.ResourceIBMISFloatingIPValidator(), + "ibm_is_ike_policy": vpc.ResourceIBMISIKEValidator(), + "ibm_is_image": vpc.ResourceIBMISImageValidator(), + "ibm_is_instance_template": vpc.ResourceIBMISInstanceTemplateValidator(), + "ibm_is_instance": vpc.ResourceIBMISInstanceValidator(), + "ibm_is_instance_action": vpc.ResourceIBMISInstanceActionValidator(), + "ibm_is_instance_network_interface": vpc.ResourceIBMIsInstanceNetworkInterfaceValidator(), + "ibm_is_instance_disk_management": vpc.ResourceIBMISInstanceDiskManagementValidator(), + "ibm_is_instance_volume_attachment": vpc.ResourceIBMISInstanceVolumeAttachmentValidator(), + "ibm_is_ipsec_policy": vpc.ResourceIBMISIPSECValidator(), + "ibm_is_lb_listener_policy_rule": vpc.ResourceIBMISLBListenerPolicyRuleValidator(), + "ibm_is_lb_listener_policy": vpc.ResourceIBMISLBListenerPolicyValidator(), + "ibm_is_lb_listener": vpc.ResourceIBMISLBListenerValidator(), + "ibm_is_lb_pool_member": vpc.ResourceIBMISLBPoolMemberValidator(), + "ibm_is_lb_pool": vpc.ResourceIBMISLBPoolValidator(), + "ibm_is_lb": vpc.ResourceIBMISLBValidator(), + "ibm_is_network_acl": vpc.ResourceIBMISNetworkACLValidator(), + "ibm_is_network_acl_rule": vpc.ResourceIBMISNetworkACLRuleValidator(), + "ibm_is_public_gateway": vpc.ResourceIBMISPublicGatewayValidator(), + "ibm_is_placement_group": vpc.ResourceIbmIsPlacementGroupValidator(), + "ibm_is_security_group_target": vpc.ResourceIBMISSecurityGroupTargetValidator(), + "ibm_is_security_group_rule": vpc.ResourceIBMISSecurityGroupRuleValidator(), + "ibm_is_security_group": vpc.ResourceIBMISSecurityGroupValidator(), + "ibm_is_snapshot": vpc.ResourceIBMISSnapshotValidator(), + "ibm_is_ssh_key": vpc.ResourceIBMISSHKeyValidator(), + "ibm_is_subnet": vpc.ResourceIBMISSubnetValidator(), + "ibm_is_subnet_reserved_ip": vpc.ResourceIBMISSubnetReservedIPValidator(), + "ibm_is_volume": vpc.ResourceIBMISVolumeValidator(), + "ibm_is_address_prefix": vpc.ResourceIBMISAddressPrefixValidator(), + "ibm_is_route": vpc.ResourceIBMISRouteValidator(), + "ibm_is_vpc": vpc.ResourceIBMISVPCValidator(), + "ibm_is_vpc_routing_table": vpc.ResourceIBMISVPCRoutingTableValidator(), + "ibm_is_vpc_routing_table_route": vpc.ResourceIBMISVPCRoutingTableRouteValidator(), + "ibm_is_vpn_gateway_connection": vpc.ResourceIBMISVPNGatewayConnectionValidator(), + "ibm_is_vpn_gateway": vpc.ResourceIBMISVPNGatewayValidator(), + "ibm_kms_key_rings": kms.ResourceIBMKeyRingValidator(), + "ibm_dns_glb_monitor": dnsservices.ResourceIBMPrivateDNSGLBMonitorValidator(), + "ibm_dns_glb_pool": dnsservices.ResourceIBMPrivateDNSGLBPoolValidator(), + "ibm_dns_custom_resolver_forwarding_rule": dnsservices.ResourceIBMPrivateDNSForwardingRuleValidator(), + "ibm_schematics_action": schematics.ResourceIBMSchematicsActionValidator(), + "ibm_schematics_job": schematics.ResourceIBMSchematicsJobValidator(), + "ibm_schematics_workspace": schematics.ResourceIBMSchematicsWorkspaceValidator(), + "ibm_schematics_inventory": schematics.ResourceIBMSchematicsInventoryValidator(), + "ibm_schematics_resource_query": schematics.ResourceIBMSchematicsResourceQueryValidator(), + "ibm_resource_instance": resourcecontroller.ResourceIBMResourceInstanceValidator(), + "ibm_is_virtual_endpoint_gateway": vpc.ResourceIBMISEndpointGatewayValidator(), + "ibm_resource_tag": globaltagging.ResourceIBMResourceTagValidator(), + "ibm_satellite_location": satellite.ResourceIBMSatelliteLocationValidator(), + "ibm_satellite_cluster": satellite.ResourceIBMSatelliteClusterValidator(), + "ibm_pi_volume": power.ResourceIBMPIVolumeValidator(), + "ibm_atracker_target": atracker.ResourceIBMAtrackerTargetValidator(), + "ibm_atracker_route": atracker.ResourceIBMAtrackerRouteValidator(), + "ibm_satellite_endpoint": satellite.ResourceIBMSatelliteEndpointValidator(), + "ibm_scc_si_note": scc.ResourceIBMSccSiNoteValidator(), + "ibm_scc_account_settings": scc.ResourceIBMSccAccountSettingsValidator(), + "ibm_scc_si_occurrence": scc.ResourceIBMSccSiOccurrenceValidator(), + "ibm_scc_posture_collector": scc.ResourceIBMSccPostureCollectorsValidator(), + "ibm_scc_posture_scope": scc.ResourceIBMSccPostureScopesValidator(), + "ibm_scc_posture_credential": scc.ResourceIBMSccPostureCredentialsValidator(), + "ibm_cbr_zone": contextbasedrestrictions.ResourceIBMCbrZoneValidator(), + "ibm_cbr_rule": contextbasedrestrictions.ResourceIBMCbrRuleValidator(), + "ibm_satellite_host": satellite.ResourceIBMSatelliteHostValidator(), + + // // Added for Event Notifications + "ibm_en_destination": eventnotification.ResourceIBMEnDestinationValidator(), + }, + DataSourceValidatorDictionary: map[string]*validate.ResourceValidator{ + "ibm_is_subnet": vpc.DataSourceIBMISSubnetValidator(), + "ibm_is_snapshot": vpc.DataSourceIBMISSnapshotValidator(), + "ibm_dl_offering_speeds": directlink.DataSourceIBMDLOfferingSpeedsValidator(), + "ibm_dl_routers": directlink.DataSourceIBMDLRoutersValidator(), + + // bare_metal_server + "ibm_is_bare_metal_server": vpc.DataSourceIBMIsBareMetalServerValidator(), + + "ibm_is_vpc": vpc.DataSourceIBMISVpcValidator(), + "ibm_is_volume": vpc.DataSourceIBMISVolumeValidator(), + "ibm_scc_si_notes": scc.DataSourceIBMSccSiNotesValidator(), + "ibm_scc_si_occurrences": scc.DataSourceIBMSccSiOccurrencesValidator(), + "ibm_secrets_manager_secret": secretsmanager.DataSourceIBMSecretsManagerSecretValidator(), + "ibm_secrets_manager_secrets": secretsmanager.DataSourceIBMSecretsManagerSecretsValidator(), + }, + } + }) + return globalValidatorDict +} + +func providerConfigure(d *schema.ResourceData) (interface{}, error) { + var bluemixAPIKey string + var bluemixTimeout int + var iamToken, iamRefreshToken, iamTrustedProfileId string + if key, ok := d.GetOk("bluemix_api_key"); ok { + bluemixAPIKey = key.(string) + } + if key, ok := d.GetOk("ibmcloud_api_key"); ok { + bluemixAPIKey = key.(string) + } + if itoken, ok := d.GetOk("iam_token"); ok { + iamToken = itoken.(string) + } + if rtoken, ok := d.GetOk("iam_refresh_token"); ok { + iamRefreshToken = rtoken.(string) + } + if ttoken, ok := d.GetOk("iam_profile_id"); ok { + iamTrustedProfileId = ttoken.(string) + } + var softlayerUsername, softlayerAPIKey, softlayerEndpointUrl string + var softlayerTimeout int + if username, ok := d.GetOk("softlayer_username"); ok { + softlayerUsername = username.(string) + } + if username, ok := d.GetOk("iaas_classic_username"); ok { + softlayerUsername = username.(string) + } + if apikey, ok := d.GetOk("softlayer_api_key"); ok { + softlayerAPIKey = apikey.(string) + } + if apikey, ok := d.GetOk("iaas_classic_api_key"); ok { + softlayerAPIKey = apikey.(string) + } + if endpoint, ok := d.GetOk("softlayer_endpoint_url"); ok { + softlayerEndpointUrl = endpoint.(string) + } + if endpoint, ok := d.GetOk("iaas_classic_endpoint_url"); ok { + softlayerEndpointUrl = endpoint.(string) + } + if tm, ok := d.GetOk("softlayer_timeout"); ok { + softlayerTimeout = tm.(int) + } + if tm, ok := d.GetOk("iaas_classic_timeout"); ok { + softlayerTimeout = tm.(int) + } + + if tm, ok := d.GetOk("bluemix_timeout"); ok { + bluemixTimeout = tm.(int) + } + if tm, ok := d.GetOk("ibmcloud_timeout"); ok { + bluemixTimeout = tm.(int) + } + var visibility string + if v, ok := d.GetOk("visibility"); ok { + visibility = v.(string) + } + var file string + if f, ok := d.GetOk("endpoints_file_path"); ok { + file = f.(string) + } + + resourceGrp := d.Get("resource_group").(string) + region := d.Get("region").(string) + zone := d.Get("zone").(string) + retryCount := d.Get("max_retries").(int) + wskNameSpace := d.Get("function_namespace").(string) + riaasEndPoint := d.Get("riaas_endpoint").(string) + + wskEnvVal, err := schema.EnvDefaultFunc("FUNCTION_NAMESPACE", "")() + if err != nil { + return nil, err + } + //Set environment variable to be used in DiffSupressFunction + if wskEnvVal.(string) == "" { + os.Setenv("FUNCTION_NAMESPACE", wskNameSpace) + } + + config := conns.Config{ + BluemixAPIKey: bluemixAPIKey, + Region: region, + ResourceGroup: resourceGrp, + BluemixTimeout: time.Duration(bluemixTimeout) * time.Second, + SoftLayerTimeout: time.Duration(softlayerTimeout) * time.Second, + SoftLayerUserName: softlayerUsername, + SoftLayerAPIKey: softlayerAPIKey, + RetryCount: retryCount, + SoftLayerEndpointURL: softlayerEndpointUrl, + RetryDelay: conns.RetryAPIDelay, + FunctionNameSpace: wskNameSpace, + RiaasEndPoint: riaasEndPoint, + IAMToken: iamToken, + IAMRefreshToken: iamRefreshToken, + Zone: zone, + Visibility: visibility, + EndpointsFile: file, + IAMTrustedProfileID: iamTrustedProfileId, + } + + return config.ClientSession() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis.go deleted file mode 100644 index d3d7550d99..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis.go +++ /dev/null @@ -1,566 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "net/url" - "os" - "strings" - "time" - - rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/bmxerror" - "github.com/IBM-Cloud/bluemix-go/models" -) - -const ( - cisInstanceSuccessStatus = "active" - cisInstanceProgressStatus = "in progress" - cisInstanceProvisioningStatus = "provisioning" - cisInstanceInactiveStatus = "inactive" - cisInstanceFailStatus = "failed" - cisInstanceRemovedStatus = "removed" - cisInstanceReclamation = "pending_reclamation" -) - -func resourceIBMCISInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISInstanceCreate, - Read: resourceIBMCISInstanceRead, - Update: resourceIBMCISInstanceUpdate, - Delete: resourceIBMCISInstanceDelete, - Exists: resourceIBMCISInstanceExists, - Importer: &schema.ResourceImporter{}, - - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "A name for the resource instance", - }, - - "service": { - Type: schema.TypeString, - Computed: true, - Description: "The name of the Cloud Internet Services offering", - }, - - "plan": { - Type: schema.TypeString, - Required: true, - Description: "The plan type of the service", - }, - - "guid": { - Type: schema.TypeString, - Computed: true, - Description: "Unique identifier of resource instance", - }, - - "location": { - Description: "The location where the instance available", - Required: true, - ForceNew: true, - Type: schema.TypeString, - }, - - "resource_group_id": { - Description: "The resource group id", - Optional: true, - ForceNew: true, - Type: schema.TypeString, - Computed: true, - }, - - "parameters": { - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - Description: "Arbitrary parameters to pass. Must be a JSON object", - }, - - "tags": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_cis", "tag")}, - Set: schema.HashString, - }, - - "status": { - Type: schema.TypeString, - Computed: true, - Description: "Status of resource instance", - }, - ResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "The name of the resource", - }, - - ResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - - ResourceStatus: { - Type: schema.TypeString, - Computed: true, - Description: "The status of the resource", - }, - - ResourceGroupName: { - Type: schema.TypeString, - Computed: true, - Description: "The resource group name in which resource is provisioned", - }, - ResourceControllerURL: { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - }, - }, - } -} - -func resourceIBMCISValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Optional: true, - Regexp: `^[A-Za-z0-9:_ .-]+$`, - MinValueLength: 1, - MaxValueLength: 128}) - - ibmCISResourceValidator := ResourceValidator{ResourceName: "ibm_cis", Schema: validateSchema} - return &ibmCISResourceValidator -} - -// Replace with func wrapper for resourceIBMResourceInstanceCreate specifying serviceName := "internet-svcs" -func resourceIBMCISInstanceCreate(d *schema.ResourceData, meta interface{}) error { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - serviceName := "internet-svcs" - plan := d.Get("plan").(string) - name := d.Get("name").(string) - location := d.Get("location").(string) - - rsInst := rc.CreateResourceInstanceOptions{ - Name: &name, - } - - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - serviceOff, err := rsCatRepo.FindByName(serviceName, true) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - rsInst.ResourcePlanID = &servicePlan - - deployments, err := rsCatRepo.ListDeployments(servicePlan) - if err != nil { - return fmt.Errorf("Error retrieving deployment for plan %s : %s", plan, err) - } - if len(deployments) == 0 { - return fmt.Errorf("No deployment found for service plan : %s", plan) - } - deployments, supportedLocations := filterCISDeployments(deployments, location) - - if len(deployments) == 0 { - locationList := make([]string, 0, len(supportedLocations)) - for l := range supportedLocations { - locationList = append(locationList, l) - } - return fmt.Errorf("No deployment found for service plan %s at location %s.\nValid location(s) are: %q.", plan, location, locationList) - } - - rsInst.Target = &deployments[0].CatalogCRN - - if rsGrpID, ok := d.GetOk("resource_group_id"); ok { - rg := rsGrpID.(string) - rsInst.ResourceGroup = &rg - } else { - defaultRg, err := defaultResourceGroup(meta) - if err != nil { - return err - } - rsInst.ResourceGroup = &defaultRg - } - - if parameters, ok := d.GetOk("parameters"); ok { - rsInst.Parameters = parameters.(map[string]interface{}) - } - - instance, response, err := rsConClient.CreateResourceInstance(&rsInst) - if err != nil { - return fmt.Errorf("Error creating resource instance: %s %s", err, response) - } - v := os.Getenv("IC_ENV_TAGS") - if _, ok := d.GetOk("tags"); ok || v != "" { - oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) - if err != nil { - log.Printf( - "Error on create of ibm cis (%s) tags: %s", d.Id(), err) - } - } - - // Moved d.SetId(instance.ID) to after waiting for resource to finish creation. Otherwise Terraform initates depedent tasks too early. - // Original flow had SetId here as its required as input to waitForCISInstanceCreate - - _, err = waitForCISInstanceCreate(d, meta, *instance.ID) - if err != nil { - return fmt.Errorf( - "Error waiting for create resource instance (%s) to be succeeded: %s", d.Id(), err) - } - - d.SetId(*instance.ID) - - return resourceIBMCISInstanceRead(d, meta) -} - -func resourceIBMCISInstanceRead(d *schema.ResourceData, meta interface{}) error { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - - instanceID := d.Id() - rsInst := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - instance, response, err := rsConClient.GetResourceInstance(&rsInst) - if err != nil { - if strings.Contains(err.Error(), "Object not found") || - strings.Contains(err.Error(), "status code: 404") { - log.Printf("[WARN] Removing record from state because it's not found via the API") - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving resource instance: %s %s", err, response) - } - if strings.Contains(*instance.State, "removed") { - log.Printf("[WARN] Removing instance from TF state because it's now in removed state") - d.SetId("") - return nil - } - tags, err := GetTagsUsingCRN(meta, *instance.CRN) - if err != nil { - log.Printf( - "Error on get of ibm cis tags (%s) tags: %s", d.Id(), err) - } - d.Set("tags", tags) - d.Set("name", *instance.Name) - d.Set("status", *instance.State) - d.Set("resource_group_id", *instance.ResourceGroupID) - d.Set("parameters", Flatten(instance.Parameters)) - if instance.CRN != nil { - location := strings.Split(*instance.CRN, ":") - if len(location) > 5 { - d.Set("location", location[5]) - } - } - d.Set("guid", *instance.GUID) - - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - d.Set("service", "internet-svcs") - - servicePlan, err := rsCatRepo.GetServicePlanName(*instance.ResourcePlanID) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - d.Set("plan", servicePlan) - - d.Set(ResourceName, *instance.Name) - d.Set(ResourceCRN, *instance.CRN) - d.Set(ResourceStatus, *instance.State) - d.Set(ResourceGroupName, *instance.ResourceGroupCRN) - - rcontroller, err := getBaseController(meta) - if err != nil { - return err - } - d.Set(ResourceControllerURL, rcontroller+"/internet-svcs/"+url.QueryEscape(*instance.CRN)) - - return nil -} - -func resourceIBMCISInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - - instanceID := d.Id() - - updateReq := rc.UpdateResourceInstanceOptions{ - ID: &instanceID, - } - if d.HasChange("name") { - name := d.Get("name").(string) - updateReq.Name = &name - } - - if d.HasChange("plan") { - plan := d.Get("plan").(string) - service := d.Get("service").(string) - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - serviceOff, err := rsCatRepo.FindByName(service, true) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - - updateReq.ResourcePlanID = &servicePlan - - } - - if d.HasChange("tags") { - oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, instanceID) - if err != nil { - log.Printf( - "Error on update of CIS (%s) tags: %s", d.Id(), err) - } - } - - _, response, err := rsConClient.UpdateResourceInstance(&updateReq) - if err != nil { - return fmt.Errorf("Error updating resource instance: %s %s", err, response) - } - - _, err = waitForCISInstanceUpdate(d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for update resource instance (%s) to be succeeded: %s", d.Id(), err) - } - - return resourceIBMCISInstanceRead(d, meta) -} - -func resourceIBMCISInstanceDelete(d *schema.ResourceData, meta interface{}) error { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - id := d.Id() - recursive := true - deleteReq := rc.DeleteResourceInstanceOptions{ - ID: &id, - Recursive: &recursive, - } - response, err := rsConClient.DeleteResourceInstance(&deleteReq) - if err != nil { - // If prior delete occurs, instance is not immediately deleted, but remains in "removed" state" - // RC 410 with "Gone" returned as error - if strings.Contains(err.Error(), "Gone") || - strings.Contains(err.Error(), "status code: 410") { - log.Printf("[WARN] Resource instance already deleted %s\n %s", err, response) - err = nil - } else { - return fmt.Errorf("Error deleting resource instance: %s %s", err, response) - } - } - - _, err = waitForCISInstanceDelete(d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for resource instance (%s) to be deleted: %s", d.Id(), err) - } - - d.SetId("") - - return nil -} -func resourceIBMCISInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - rsInst := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - instance, response, err := rsConClient.GetResourceInstance(&rsInst) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok { - if apiErr.StatusCode() == 404 { - return false, nil - } - } - return false, fmt.Errorf("[ERROR] Error getting cis instance: %s %s", err, response) - } - if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, cisInstanceReclamation)) { - log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") - d.SetId("") - return false, nil - } - - return *instance.ID == instanceID, nil -} - -func waitForCISInstanceCreate(d *schema.ResourceData, meta interface{}, instanceID string) (interface{}, error) { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - //instanceID := d.Id() - - stateConf := &resource.StateChangeConf{ - Pending: []string{cisInstanceProgressStatus, cisInstanceInactiveStatus, cisInstanceProvisioningStatus}, - Target: []string{cisInstanceSuccessStatus}, - Refresh: func() (interface{}, string, error) { - rsInst := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - instance, response, err := rsConClient.GetResourceInstance(&rsInst) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The resource instance %s does not exist anymore: %v %s", d.Id(), err, response) - } - return nil, "", err - } - if *instance.State == cisInstanceFailStatus { - return instance, *instance.State, fmt.Errorf("The resource instance %s failed: %v %s", d.Id(), err, response) - } - return instance, *instance.State, nil - }, - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func waitForCISInstanceUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error) { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - - stateConf := &resource.StateChangeConf{ - Pending: []string{cisInstanceProgressStatus, cisInstanceInactiveStatus}, - Target: []string{cisInstanceSuccessStatus}, - Refresh: func() (interface{}, string, error) { - rsInst := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - instance, response, err := rsConClient.GetResourceInstance(&rsInst) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The resource instance %s does not exist anymore: %v %s", d.Id(), err, response) - } - return nil, "", err - } - if *instance.State == cisInstanceFailStatus { - return instance, *instance.State, fmt.Errorf("The resource instance %s failed: %v %s", d.Id(), err, response) - } - return instance, *instance.State, nil - }, - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func waitForCISInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - stateConf := &resource.StateChangeConf{ - Pending: []string{cisInstanceProgressStatus, cisInstanceInactiveStatus, cisInstanceSuccessStatus}, - Target: []string{cisInstanceRemovedStatus, cisInstanceReclamation}, - Refresh: func() (interface{}, string, error) { - rsInst := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - instance, response, err := rsConClient.GetResourceInstance(&rsInst) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return instance, cisInstanceSuccessStatus, nil - } - return nil, "", err - } - if *instance.State == cisInstanceFailStatus { - return instance, *instance.State, fmt.Errorf("The resource instance %s failed to delete: %v %s", d.Id(), err, response) - } - return instance, *instance.State, nil - }, - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func filterCISDeployments(deployments []models.ServiceDeployment, location string) ([]models.ServiceDeployment, map[string]bool) { - supportedDeployments := []models.ServiceDeployment{} - supportedLocations := make(map[string]bool) - for _, d := range deployments { - if d.Metadata.RCCompatible { - deploymentLocation := d.Metadata.Deployment.Location - supportedLocations[deploymentLocation] = true - if deploymentLocation == location { - supportedDeployments = append(supportedDeployments, d) - } - } - } - return supportedDeployments, supportedLocations -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_certificate_order.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_certificate_order.go deleted file mode 100644 index 8609342854..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_certificate_order.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "log" - "time" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - ibmCISCertificateOrder = "ibm_cis_certificate_order" - cisCertificateOrderID = "certificate_id" - cisCertificateOrderHosts = "hosts" - cisCertificateOrderType = "type" - cisCertificateOrderTypeDedicated = "dedicated" - cisCertificateOrderStatus = "status" - cisCertificateOrderDeleted = "deleted" - cisCertificateOrderDeletePending = "deleting" -) - -func resourceIBMCISCertificateOrder() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISCertificateOrderCreate, - Update: resourceIBMCISCertificateOrderRead, - Read: resourceIBMCISCertificateOrderRead, - Delete: resourceIBMCISCertificateOrderDelete, - Exists: resourceIBMCISCertificateOrderExist, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Description: "CIS object id or CRN", - Required: true, - }, - cisDomainID: { - Type: schema.TypeString, - Description: "Associated CIS domain", - Required: true, - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisCertificateOrderID: { - Type: schema.TypeString, - Description: "certificate id", - Computed: true, - }, - cisCertificateOrderType: { - Type: schema.TypeString, - Description: "certificate type", - Optional: true, - Default: cisCertificateOrderTypeDedicated, - }, - cisCertificateOrderHosts: { - Type: schema.TypeList, - Description: "Hosts which certificate need to be ordered", - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - cisCertificateOrderStatus: { - Type: schema.TypeString, - Description: "certificate status", - Computed: true, - }, - }, - } -} - -func resourceIBMCISCertificateOrderValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisCertificateOrderType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: cisCertificateOrderTypeDedicated}) - - cisCertificateOrderValidator := ResourceValidator{ - ResourceName: ibmCISCertificateOrder, - Schema: validateSchema} - return &cisCertificateOrderValidator -} - -func resourceIBMCISCertificateOrderCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() - if err != nil { - return err - } - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - certType := d.Get(cisCertificateOrderType).(string) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - hosts := d.Get(cisCertificateOrderHosts) - hostsList := expandStringList(hosts.([]interface{})) - opt := cisClient.NewOrderCertificateOptions() - opt.SetType(certType) - opt.SetHosts(hostsList) - - result, resp, err := cisClient.OrderCertificate(opt) - if err != nil { - log.Printf("Certificate order failed: %v", resp) - return err - } - - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) - return resourceIBMCISCertificateOrderRead(d, meta) -} - -func resourceIBMCISCertificateOrderRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() - if err != nil { - return err - } - certificateID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - log.Println("Error in reading certificate id") - return err - } - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - opt := cisClient.NewGetCustomCertificateOptions(certificateID) - result, resp, err := cisClient.GetCustomCertificate(opt) - if err != nil { - log.Printf("Certificate read failed: %v", resp) - return err - } - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisCertificateOrderID, result.Result.ID) - d.Set(cisCertificateOrderType, cisCertificateOrderTypeDedicated) - d.Set(cisCertificateOrderHosts, flattenStringList(result.Result.Hosts)) - d.Set(cisCertificateOrderStatus, result.Result.Status) - return nil -} - -func resourceIBMCISCertificateOrderDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() - if err != nil { - return err - } - certificateID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - log.Println("Error in reading certificate id") - return err - } - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - opt := cisClient.NewDeleteCertificateOptions(certificateID) - resp, err := cisClient.DeleteCertificate(opt) - if err != nil { - log.Printf("Certificate delete failed: %v", resp) - return err - } - - _, err = waitForCISCertificateOrderDelete(d, meta) - if err != nil { - return err - } - - return nil -} - -func resourceIBMCISCertificateOrderExist(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisSSLClientSession() - if err != nil { - return false, err - } - certificateID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - log.Println("Error in reading certificate id") - return false, err - } - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - opt := cisClient.NewGetCustomCertificateOptions(certificateID) - _, response, err := cisClient.GetCustomCertificate(opt) - if err != nil { - if response != nil && response.StatusCode == 400 { - log.Printf("Certificate is not found") - return false, nil - } - log.Printf("Get Certificate failed: %v", response) - return false, err - } - return true, nil -} - -func waitForCISCertificateOrderDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cisClient, err := meta.(ClientSession).CisSSLClientSession() - if err != nil { - return nil, err - } - certificateID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - log.Println("Error in reading certificate id") - return nil, err - } - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - opt := cisClient.NewGetCustomCertificateOptions(certificateID) - stateConf := &resource.StateChangeConf{ - Pending: []string{cisCertificateOrderDeletePending}, - Target: []string{cisCertificateOrderDeleted}, - Refresh: func() (interface{}, string, error) { - _, detail, err := cisClient.GetCustomCertificate(opt) - if err != nil { - if detail != nil && detail.StatusCode == 400 { - return detail, cisCertificateOrderDeleted, nil - } - return nil, "", err - } - return detail, cisCertificateOrderDeletePending, nil - }, - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - PollInterval: 10 * time.Second, - } - - return stateConf.WaitForState() -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_edge_functions_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_edge_functions_action.go deleted file mode 100644 index d5f4ef3da4..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_edge_functions_action.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "io" - "io/ioutil" - "log" - "strings" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - cisEdgeFunctionsActionActionName = "action_name" - cisEdgeFunctionsActionScript = "script" -) - -func resourceIBMCISEdgeFunctionsAction() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISEdgeFunctionsActionCreate, - Read: resourceIBMCISEdgeFunctionsActionRead, - Update: resourceIBMCISEdgeFunctionsActionUpdate, - Delete: resourceIBMCISEdgeFunctionsActionDelete, - Exists: resourceIBMCISEdgeFunctionsActionExists, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Intance CRN", - }, - cisDomainID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Domain ID", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisEdgeFunctionsActionActionName: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Edge function action script name", - }, - cisEdgeFunctionsActionScript: { - Type: schema.TypeString, - Required: true, - Description: "Edge function action script", - }, - }, - } -} - -func resourceIBMCISEdgeFunctionsActionCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return err - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - scriptName := d.Get(cisEdgeFunctionsActionActionName).(string) - script := d.Get(cisEdgeFunctionsActionScript).(string) - r := ioutil.NopCloser(strings.NewReader(script)) - opt := cisClient.NewUpdateEdgeFunctionsActionOptions(scriptName) - opt.SetEdgeFunctionsAction(r) - - _, _, err = cisClient.UpdateEdgeFunctionsAction(opt) - if err != nil { - return fmt.Errorf("Error: %v", err) - } - d.SetId(convertCisToTfThreeVar(scriptName, zoneID, crn)) - return resourceIBMCISEdgeFunctionsActionRead(d, meta) -} - -func resourceIBMCISEdgeFunctionsActionUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange(cisEdgeFunctionsActionScript) { - return resourceIBMCISEdgeFunctionsActionCreate(d, meta) - } - - return resourceIBMCISEdgeFunctionsActionRead(d, meta) -} - -func resourceIBMCISEdgeFunctionsActionRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return err - } - - scriptName, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - opt := cisClient.NewGetEdgeFunctionsActionOptions(scriptName) - result, resp, err := cisClient.GetEdgeFunctionsAction(opt) - if err != nil { - return fmt.Errorf("Error: %v", resp) - } - - // read script content - content := []byte{} - p := make([]byte, 8) - for { - n, err := result.Read(p) - content = append(content, p[:n]...) - if err == io.EOF || n < 1 { - break - } - } - err = result.Close() - if err != nil { - return fmt.Errorf("Error in closing reader") - } - - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisEdgeFunctionsActionActionName, scriptName) - d.Set(cisEdgeFunctionsActionScript, string(content)) - return nil -} - -func resourceIBMCISEdgeFunctionsActionExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return false, fmt.Errorf("Error in creating CIS object") - } - - scriptName, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - opt := cisClient.NewGetEdgeFunctionsActionOptions(scriptName) - _, response, err := cisClient.GetEdgeFunctionsAction(opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - log.Printf("Edge functions action script is not found") - return false, nil - } - return false, fmt.Errorf("Error: %v", response) - } - return true, nil -} - -func resourceIBMCISEdgeFunctionsActionDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return fmt.Errorf("Error in creating CIS object") - } - - scriptName, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - opt := cisClient.NewDeleteEdgeFunctionsActionOptions(scriptName) - _, response, err := cisClient.DeleteEdgeFunctionsAction(opt) - if err != nil { - return fmt.Errorf("Error in edge function action script deletion: %v", response) - } - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_edge_functions_trigger.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_edge_functions_trigger.go deleted file mode 100644 index a552b2782e..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_edge_functions_trigger.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - cisEdgeFunctionsTriggerID = "trigger_id" - cisEdgeFunctionsTriggerPattern = "pattern_url" - cisEdgeFunctionsTriggerActionName = "action_name" - cisEdgeFunctionsTriggerRequestLimitFailOpen = "request_limit_fail_open" -) - -func resourceIBMCISEdgeFunctionsTrigger() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISEdgeFunctionsTriggerCreate, - Read: resourceIBMCISEdgeFunctionsTriggerRead, - Update: resourceIBMCISEdgeFunctionsTriggerUpdate, - Delete: resourceIBMCISEdgeFunctionsTriggerDelete, - Exists: resourceIBMCISEdgeFunctionsTriggerExists, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Intance CRN", - }, - cisDomainID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Domain ID", - DiffSuppressFunc: suppressDataDiff, - }, - cisEdgeFunctionsTriggerID: { - Type: schema.TypeString, - Computed: true, - Description: "CIS Edge Functions trigger route ID", - }, - cisEdgeFunctionsTriggerPattern: { - Type: schema.TypeString, - Required: true, - Description: "Edge function trigger pattern", - }, - cisEdgeFunctionsTriggerActionName: { - Type: schema.TypeString, - Optional: true, - Description: "Edge function trigger action name", - }, - cisEdgeFunctionsTriggerRequestLimitFailOpen: { - Type: schema.TypeBool, - Computed: true, - Description: "Edge function trigger request limit fail open", - }, - }, - } -} - -func resourceIBMCISEdgeFunctionsTriggerCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return err - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - opt := cisClient.NewCreateEdgeFunctionsTriggerOptions() - if action, ok := d.GetOk(cisEdgeFunctionsTriggerActionName); ok { - opt.SetScript(action.(string)) - } - pattern := d.Get(cisEdgeFunctionsTriggerPattern).(string) - opt.SetPattern(pattern) - - result, _, err := cisClient.CreateEdgeFunctionsTrigger(opt) - if err != nil { - return fmt.Errorf("Error creating edge function trigger route : %v", err) - } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) - return resourceIBMCISEdgeFunctionsTriggerRead(d, meta) -} - -func resourceIBMCISEdgeFunctionsTriggerUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return err - } - - routeID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - if d.HasChange(cisEdgeFunctionsTriggerActionName) || - d.HasChange(cisEdgeFunctionsTriggerPattern) { - opt := cisClient.NewUpdateEdgeFunctionsTriggerOptions(routeID) - - if action, ok := d.GetOk(cisEdgeFunctionsTriggerActionName); ok { - opt.SetScript(action.(string)) - } - pattern := d.Get(cisEdgeFunctionsTriggerPattern).(string) - opt.SetPattern(pattern) - - _, _, err := cisClient.UpdateEdgeFunctionsTrigger(opt) - if err != nil { - return fmt.Errorf("Error updating edge function trigger route : %v", err) - } - } - return resourceIBMCISEdgeFunctionsTriggerRead(d, meta) -} - -func resourceIBMCISEdgeFunctionsTriggerRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return err - } - - routeID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - opt := cisClient.NewGetEdgeFunctionsTriggerOptions(routeID) - result, resp, err := cisClient.GetEdgeFunctionsTrigger(opt) - if err != nil { - return fmt.Errorf("Error: %v", resp) - } - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisEdgeFunctionsTriggerID, routeID) - d.Set(cisEdgeFunctionsTriggerActionName, result.Result.Script) - d.Set(cisEdgeFunctionsTriggerPattern, result.Result.Pattern) - d.Set(cisEdgeFunctionsTriggerRequestLimitFailOpen, result.Result.RequestLimitFailOpen) - return nil -} - -func resourceIBMCISEdgeFunctionsTriggerExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return false, err - } - - routeID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - opt := cisClient.NewGetEdgeFunctionsTriggerOptions(routeID) - _, response, err := cisClient.GetEdgeFunctionsTrigger(opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - log.Printf("Edge functions trigger route is not found") - return false, nil - } - return false, fmt.Errorf("Error: %v", response) - } - return true, nil -} - -func resourceIBMCISEdgeFunctionsTriggerDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() - if err != nil { - return fmt.Errorf("Error in creating CIS object") - } - - routeID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - opt := cisClient.NewDeleteEdgeFunctionsTriggerOptions(routeID) - _, response, err := cisClient.DeleteEdgeFunctionsTrigger(opt) - if err != nil { - return fmt.Errorf("Error in edge function trigger route deletion: %v", response) - } - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_filter.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_filter.go deleted file mode 100644 index d40154ef07..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_filter.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - - "github.com/IBM/networking-go-sdk/filtersv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - ibmCISFilters = "ibm_cis_filter" - cisFilterExpression = "expression" - cisFilterPaused = "paused" - cisFilterDescription = "description" - cisFilterID = "filter_id" -) - -func resourceIBMCISFilter() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISFilterCreate, - Read: resourceIBMCISFilterRead, - Update: resourceIBMCISFilterUpdate, - Delete: resourceIBMCISFilterDelete, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Description: "CIS instance crn", - Required: true, - }, - cisDomainID: { - Type: schema.TypeString, - Description: "Associated CIS domain", - Required: true, - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisFilterPaused: { - Type: schema.TypeBool, - Optional: true, - Description: "Filter Paused", - }, - cisFilterID: { - Type: schema.TypeString, - Computed: true, - Description: "Filter ID", - }, - cisFilterExpression: { - Type: schema.TypeString, - Required: true, - Description: "Filter Expression", - }, - cisFilterDescription: { - Type: schema.TypeString, - Optional: true, - Description: "Filter Description", - ValidateFunc: InvokeValidator(ibmCISFilters, cisFilterDescription), - }, - }, - } -} -func resourceIBMCISFilterCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return fmt.Errorf("Error while Getting IAM Access Token using BluemixSession %s", err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFiltersSession() - if err != nil { - return fmt.Errorf("Error while getting the CisFiltersSession %s", err) - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - - var newfilter filtersv1.FilterInput - - if p, ok := d.GetOkExists(cisFilterPaused); ok { - paused := p.(bool) - newfilter.Paused = &paused - } - if des, ok := d.GetOk(cisFilterDescription); ok { - description := des.(string) - newfilter.Description = &description - } - if e, ok := d.GetOk(cisFilterExpression); ok { - expression := e.(string) - newfilter.Expression = &expression - } - - opt := cisClient.NewCreateFilterOptions(xAuthtoken, crn, zoneID) - - opt.SetFilterInput([]filtersv1.FilterInput{newfilter}) - - result, resp, err := cisClient.CreateFilter(opt) - if err != nil || result == nil { - return fmt.Errorf("Error creating Filter for zone %q: %s %s", zoneID, err, resp) - } - d.SetId(convertCisToTfThreeVar(*result.Result[0].ID, zoneID, crn)) - return resourceIBMCISFilterRead(d, meta) - -} -func resourceIBMCISFilterRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return fmt.Errorf("Error while Getting IAM Access Token using BluemixSession %s", err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFiltersSession() - if err != nil { - return fmt.Errorf("Error while getting the CisFiltersSession %s", err) - } - filterid, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - return err - } - opt := cisClient.NewGetFilterOptions(xAuthtoken, crn, zoneID, filterid) - - result, response, err := cisClient.GetFilter(opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - log.Printf("Error GetFilter not found ") - d.SetId("") - return nil - } - return fmt.Errorf("Error finding GetFilter %q: %s %s", d.Id(), err, response) - } - if result.Result != nil { - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisFilterID, result.Result.ID) - d.Set(cisFilterPaused, result.Result.Paused) - d.Set(cisFilterDescription, result.Result.Description) - d.Set(cisFilterExpression, result.Result.Expression) - } - return nil -} -func resourceIBMCISFilterUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return fmt.Errorf("Error while Getting IAM Access Token using BluemixSession %s", err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFiltersSession() - if err != nil { - return fmt.Errorf("Error while getting the CisFiltersSession %s", err) - } - - filterid, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - return err - } - - if d.HasChange(cisFilterExpression) || - d.HasChange(cisFilterPaused) || - d.HasChange(cisFilterDescription) { - - var updatefilter filtersv1.FilterUpdateInput - updatefilter.ID = &filterid - - if p, ok := d.GetOkExists(cisFilterPaused); ok { - paused := p.(bool) - updatefilter.Paused = &paused - } - if des, ok := d.GetOk(cisFilterDescription); ok { - description := des.(string) - updatefilter.Description = &description - } - if e, ok := d.GetOk(cisFilterExpression); ok { - expression := e.(string) - updatefilter.Expression = &expression - } - - opt := cisClient.NewUpdateFiltersOptions(xAuthtoken, crn, zoneID) - - opt.SetFilterUpdateInput([]filtersv1.FilterUpdateInput{updatefilter}) - - result, resp, err := cisClient.UpdateFilters(opt) - if err != nil { - return fmt.Errorf("Error updating Filter for zone %q: %s %s", zoneID, err, resp) - } - - if *result.Result[0].ID == "" { - return fmt.Errorf("Error failed to find id in Update response; resource was empty") - } - } - return resourceIBMCISFilterRead(d, meta) -} -func resourceIBMCISFilterDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - xAuthtoken := sess.Config.IAMAccessToken - cisClient, err := meta.(ClientSession).CisFiltersSession() - if err != nil { - return err - } - filterid, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - return err - } - opt := cisClient.NewDeleteFiltersOptions(xAuthtoken, crn, zoneID, filterid) - _, _, err = cisClient.DeleteFilters(opt) - if err != nil { - return fmt.Errorf("Error deleting Filter: %s", err) - } - - return nil -} -func resourceIBMCISFilterValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisFilterDescription, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: "Filter-creation"}) - - ibmCISFiltersResourceValidator := ResourceValidator{ResourceName: ibmCISFilters, Schema: validateSchema} - return &ibmCISFiltersResourceValidator -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_firewall_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_firewall_rules.go deleted file mode 100644 index d10b48fcec..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_firewall_rules.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - - "github.com/IBM/networking-go-sdk/firewallrulesv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - ibmCISFirewallrules = "ibm_cis_firewall_rules" - cisFirewallrulesID = "firewall_rule_id" - cisFilter = "filter" - cisFirewallrulesAction = "action" - cisFirewallrulesPaused = "paused" - cisFirewallrulesPriority = "priority" - cisFirewallrulesDescription = "description" - cisFirewallrulesList = "firewall_rules" -) - -func resourceIBMCISFirewallrules() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceIBMCISFirewallrulesCreate, - ReadContext: resourceIBMCISFirewallrulesRead, - UpdateContext: resourceIBMCISFirewallrulesUpdate, - DeleteContext: resourceIBMCISFirewallrulesDelete, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Description: "CIS instance crn", - Required: true, - }, - cisDomainID: { - Type: schema.TypeString, - Description: "Associated CIS domain", - Required: true, - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisFilterID: { - Type: schema.TypeString, - Required: true, - Description: "Firewallrules Existing FilterID", - }, - cisFirewallrulesAction: { - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator(ibmCISFirewallrules, cisFirewallrulesAction), - Description: "Firewallrules Action", - }, - cisFirewallrulesPriority: { - Type: schema.TypeInt, - Description: "Firewallrules Action", - Optional: true, - Computed: true, - ValidateFunc: InvokeValidator(ibmCISFirewallrules, cisFirewallrulesPriority), - }, - cisFirewallrulesDescription: { - Type: schema.TypeString, - Optional: true, - Description: "Firewallrules Description", - ValidateFunc: InvokeValidator(ibmCISFirewallrules, cisFirewallrulesDescription), - }, - cisFirewallrulesPaused: { - Type: schema.TypeBool, - Optional: true, - Description: "Firewallrules Paused", - }, - }, - } -} - -func resourceIBMCISFirewallrulesCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return diag.FromErr(err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFirewallRulesSession() - if err != nil { - return diag.FromErr(err) - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - - var newFirewallRules firewallrulesv1.FirewallRuleInputWithFilterID - - if a, ok := d.GetOk(cisFirewallrulesAction); ok { - action := a.(string) - newFirewallRules.Action = &action - } - if des, ok := d.GetOk(cisFilterDescription); ok { - description := des.(string) - newFirewallRules.Description = &description - } - if id, ok := d.GetOk(cisFilterID); ok { - filterid := id.(string) - filterModel, _ := cisClient.NewFirewallRuleInputWithFilterIdFilter(filterid) - newFirewallRules.Filter = filterModel - } - - opt := cisClient.NewCreateFirewallRulesOptions(xAuthtoken, crn, zoneID) - - opt.SetFirewallRuleInputWithFilterID([]firewallrulesv1.FirewallRuleInputWithFilterID{newFirewallRules}) - - result, _, err := cisClient.CreateFirewallRulesWithContext(context, opt) - if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error reading the %s", err)) - } - d.SetId(convertCisToTfThreeVar(*result.Result[0].ID, zoneID, crn)) - - return resourceIBMCISFirewallrulesRead(context, d, meta) - -} -func resourceIBMCISFirewallrulesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return diag.FromErr(err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFirewallRulesSession() - if err != nil { - return diag.FromErr(err) - } - firwallruleID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - opt := cisClient.NewGetFirewallRuleOptions(xAuthtoken, crn, zoneID, firwallruleID) - - result, response, err := cisClient.GetFirewallRuleWithContext(context, opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - d.SetId("") - return nil - } - return diag.FromErr(fmt.Errorf("Error reading the firewall rules %s:%s", err, response)) - } - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisFilterID, result.Result.Filter.ID) - d.Set(cisFirewallrulesAction, result.Result.Action) - d.Set(cisFirewallrulesPaused, result.Result.Paused) - d.Set(cisFilterDescription, result.Result.Description) - - return nil -} -func resourceIBMCISFirewallrulesUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return diag.FromErr(err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFirewallRulesSession() - if err != nil { - return diag.FromErr(err) - } - - firewallruleID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - if d.HasChange(cisFilterID) || - d.HasChange(cisFirewallrulesAction) || - d.HasChange(cisFirewallrulesPaused) || - d.HasChange(cisFilterDescription) { - - var updatefirewallrules firewallrulesv1.FirewallRulesUpdateInputItem - updatefirewallrules.ID = &firewallruleID - - if a, ok := d.GetOk(cisFirewallrulesAction); ok { - action := a.(string) - updatefirewallrules.Action = &action - } - if p, ok := d.GetOk(cisFirewallrulesPaused); ok { - paused := p.(bool) - updatefirewallrules.Paused = &paused - } - if des, ok := d.GetOk(cisFilterDescription); ok { - description := des.(string) - updatefirewallrules.Description = &description - } - - if id, ok := d.GetOk(cisFilterID); ok { - filterid := id.(string) - filterUpdate, _ := cisClient.NewFirewallRulesUpdateInputItemFilter(filterid) - updatefirewallrules.Filter = filterUpdate - } - opt := cisClient.NewUpdateFirewllRulesOptions(xAuthtoken, crn, zoneID) - - opt.SetFirewallRulesUpdateInputItem([]firewallrulesv1.FirewallRulesUpdateInputItem{updatefirewallrules}) - - result, _, err := cisClient.UpdateFirewllRulesWithContext(context, opt) - if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error updating the firewall rules %s", err)) - } - } - return resourceIBMCISFirewallrulesRead(context, d, meta) -} -func resourceIBMCISFirewallrulesDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).BluemixSession() - if err != nil { - return diag.FromErr(err) - } - xAuthtoken := sess.Config.IAMAccessToken - - cisClient, err := meta.(ClientSession).CisFirewallRulesSession() - if err != nil { - return diag.FromErr(err) - } - - firewallruleid, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - if err != nil { - return diag.FromErr(err) - } - opt := cisClient.NewDeleteFirewallRulesOptions(xAuthtoken, crn, zoneID, firewallruleid) - _, response, err := cisClient.DeleteFirewallRulesWithContext(context, opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - return nil - } - return diag.FromErr(fmt.Errorf("Error deleting the custom resolver %s:%s", err, response)) - } - - d.SetId("") - return nil -} -func resourceIBMCISFirewallrulesValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisFirewallrulesAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: "log, allow, challenge, js_challenge, block"}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisFirewallrulesDescription, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: "Firewallrules-creation"}) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisFirewallrulesPriority, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, - Optional: true, - MinValue: "1", - MaxValue: "2147483647"}) - ibmCISFirewallrulesResourceValidator := ResourceValidator{ResourceName: ibmCISFirewallrules, Schema: validateSchema} - return &ibmCISFirewallrulesResourceValidator -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_routing.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_routing.go deleted file mode 100644 index 3f739f4550..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_routing.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "log" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - ibmCISRouting = "ibm_cis_routing" - cisRoutingSmartRouting = "smart_routing" -) - -func resourceIBMCISRouting() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISRoutingUpdate, - Read: resourceIBMCISRoutingRead, - Update: resourceIBMCISRoutingUpdate, - Delete: resourceIBMCISRoutingDelete, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Intance CRN", - }, - cisDomainID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Domain ID", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisRoutingSmartRouting: { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Smart Routing value", - ValidateFunc: InvokeValidator(ibmCISRouting, cisRoutingSmartRouting), - }, - }, - } -} - -func resourceIBMCISRoutingValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) - smartRoutingValues := "on, off" - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisRoutingSmartRouting, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: smartRoutingValues}) - ibmCISRoutingValidator := ResourceValidator{ResourceName: ibmCISRouting, Schema: validateSchema} - return &ibmCISRoutingValidator -} - -func resourceIBMCISRoutingUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRoutingClientSession() - if err != nil { - return err - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - - if d.HasChange(cisRoutingSmartRouting) { - smartRoutingValue := d.Get(cisRoutingSmartRouting).(string) - opt := cisClient.NewUpdateSmartRoutingOptions() - opt.SetValue(smartRoutingValue) - _, response, err := cisClient.UpdateSmartRouting(opt) - if err != nil { - log.Printf("Update smart route setting failed: %v", response) - return err - } - } - - d.SetId(convertCisToTfTwoVar(zoneID, crn)) - return resourceIBMCISRoutingRead(d, meta) -} - -func resourceIBMCISRoutingRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRoutingClientSession() - if err != nil { - return err - } - zoneID, crn, err := convertTftoCisTwoVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneIdentifier = core.StringPtr(zoneID) - opt := cisClient.NewGetSmartRoutingOptions() - result, response, err := cisClient.GetSmartRouting(opt) - if err != nil { - log.Printf("Get smart route setting failed: %v", response) - return err - } - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisRoutingSmartRouting, *result.Result.Value) - return nil -} - -func resourceIBMCISRoutingDelete(d *schema.ResourceData, meta interface{}) error { - // Nothing to delete on CIS resource - d.SetId("") - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_group.go deleted file mode 100644 index 78e1510ea5..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_group.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "log" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - ibmCISWAFGroup = "ibm_cis_waf_group" - cisWAFGroupID = "group_id" - cisWAFGroupPackageID = "package_id" - cisWAFGroupMode = "mode" - cisWAFGroupName = "name" - cisWAFGroupRulesCount = "rules_count" - cisWAFGroupModifiedRulesCount = "modified_rules_count" - cisWAFGroupDesc = "description" -) - -func resourceIBMCISWAFGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISWAFGroupUpdate, - Read: resourceIBMCISWAFGroupRead, - Update: resourceIBMCISWAFGroupUpdate, - Delete: resourceIBMCISWAFGroupDelete, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Intance CRN", - }, - cisDomainID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Domain ID", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisWAFGroupPackageID: { - Type: schema.TypeString, - Required: true, - Description: "WAF Rule package id", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisWAFGroupID: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "WAF Rule group id", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisWAFGroupMode: { - Type: schema.TypeString, - Required: true, - Description: "WAF Rule group mode on/off", - ValidateFunc: InvokeValidator(ibmCISWAFGroup, cisWAFGroupMode), - }, - cisWAFGroupName: { - Type: schema.TypeString, - Computed: true, - Description: "WAF Rule group name", - }, - cisWAFGroupDesc: { - Type: schema.TypeString, - Computed: true, - Description: "WAF Rule group description", - }, - cisWAFGroupRulesCount: { - Type: schema.TypeString, - Computed: true, - Description: "WAF Rule group rules count", - }, - cisWAFGroupModifiedRulesCount: { - Type: schema.TypeString, - Computed: true, - Description: "WAF Rule group modified rules count", - }, - }, - } -} - -func resourceIBMCISWAFGroupValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) - mode := "on, off" - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisWAFGroupMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: mode}) - ibmCISWAFGroupValidator := ResourceValidator{ResourceName: ibmCISWAFGroup, Schema: validateSchema} - return &ibmCISWAFGroupValidator -} - -func resourceIBMCISWAFGroupUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFGroupClientSession() - if err != nil { - return err - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneID = core.StringPtr(zoneID) - packageID, _, _, _ := convertTfToCisThreeVar(d.Get(cisWAFGroupPackageID).(string)) - groupID := d.Get(cisWAFGroupID).(string) - - if d.HasChange(cisWAFGroupMode) { - mode := d.Get(cisWAFGroupMode).(string) - opt := cisClient.NewUpdateWafRuleGroupOptions(packageID, groupID) - opt.SetMode(mode) - _, response, err := cisClient.UpdateWafRuleGroup(opt) - if err != nil { - log.Printf("Update waf rule group mode failed: %v", response) - return err - } - } - d.SetId(convertCisToTfFourVar(groupID, packageID, zoneID, crn)) - return resourceIBMCISWAFGroupRead(d, meta) -} - -func resourceIBMCISWAFGroupRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFGroupClientSession() - if err != nil { - return err - } - groupID, packageID, zoneID, crn, err := convertTfToCisFourVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneID = core.StringPtr(zoneID) - opt := cisClient.NewGetWafRuleGroupOptions(packageID, groupID) - result, response, err := cisClient.GetWafRuleGroup(opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - log.Printf("WAF group is not found!") - d.SetId("") - return nil - } - log.Printf("Get waf rule group setting failed: %v", response) - return err - } - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisWAFGroupID, groupID) - d.Set(cisWAFGroupPackageID, result.Result.PackageID) - d.Set(cisWAFGroupMode, result.Result.Mode) - d.Set(cisWAFGroupName, result.Result.Name) - d.Set(cisWAFGroupDesc, result.Result.Description) - d.Set(cisWAFGroupModifiedRulesCount, result.Result.ModifiedRulesCount) - d.Set(cisWAFGroupRulesCount, result.Result.RulesCount) - return nil -} - -func resourceIBMCISWAFGroupDelete(d *schema.ResourceData, meta interface{}) error { - // Nothing to delete on CIS WAF Group resource - d.SetId("") - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_package.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_package.go deleted file mode 100644 index 262f393a71..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_package.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "log" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - ibmCISWAFPackage = "ibm_cis_waf_package" - cisWAFPackageID = "package_id" - cisWAFPackageName = "name" - cisWAFPackageDescription = "description" - cisWAFPackageDetectionMode = "detection_mode" - cisWAFPackageSensitivity = "sensitivity" - cisWAFPackageActionMode = "action_mode" -) - -func resourceIBMCISWAFPackage() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMCISWAFPackageUpdate, - Read: resourceIBMCISWAFPackageRead, - Update: resourceIBMCISWAFPackageUpdate, - Delete: resourceIBMCISWAFPackageDelete, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - cisID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Intance CRN", - }, - cisDomainID: { - Type: schema.TypeString, - Required: true, - Description: "CIS Domain ID", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisWAFPackageID: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "WAF pakcage ID", - DiffSuppressFunc: suppressDomainIDDiff, - }, - cisWAFPackageName: { - Type: schema.TypeString, - Computed: true, - Description: "WAF pakcage name", - }, - cisWAFPackageDetectionMode: { - Type: schema.TypeString, - Computed: true, - Description: "WAF pakcage detection mode", - }, - cisWAFPackageSensitivity: { - Type: schema.TypeString, - Required: true, - Description: "WAF pakcage sensitivity", - ValidateFunc: InvokeValidator( - ibmCISWAFPackage, cisWAFPackageSensitivity), - }, - cisWAFPackageActionMode: { - Type: schema.TypeString, - Required: true, - Description: "WAF pakcage action mode", - ValidateFunc: InvokeValidator( - ibmCISWAFPackage, cisWAFPackageActionMode), - }, - cisWAFPackageDescription: { - Type: schema.TypeString, - Computed: true, - Description: "WAF package description", - }, - }, - } -} - -func resourceIBMCISWAFPackageValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) - sesitivity := "high, medium, low, off" - actionMode := "simulate, block, challenge" - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisWAFPackageSensitivity, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: sesitivity}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: cisWAFPackageActionMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: actionMode}) - ibmCISWAFPackageValidator := ResourceValidator{ResourceName: ibmCISWAFPackage, Schema: validateSchema} - return &ibmCISWAFPackageValidator -} - -func resourceIBMCISWAFPackageUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFPackageClientSession() - if err != nil { - return err - } - - crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) - packageID, _, _, err := convertTfToCisThreeVar(d.Get(cisWAFPackageID).(string)) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneID = core.StringPtr(zoneID) - - if d.HasChange(cisWAFPackageSensitivity) || - d.HasChange(cisWAFPackageActionMode) { - opt := cisClient.NewUpdateWafPackageOptions(packageID) - if v, ok := d.GetOk(cisWAFPackageSensitivity); ok { - opt.SetSensitivity(v.(string)) - } - if v, ok := d.GetOk(cisWAFPackageActionMode); ok { - opt.SetActionMode(v.(string)) - } - result, response, err := cisClient.UpdateWafPackage(opt) - if err != nil { - log.Printf("Update waf package setting failed: %v", response) - return err - } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) - } - - return resourceIBMCISWAFPackageRead(d, meta) -} - -func resourceIBMCISWAFPackageRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFPackageClientSession() - if err != nil { - return err - } - packageID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) - cisClient.Crn = core.StringPtr(crn) - cisClient.ZoneID = core.StringPtr(zoneID) - opt := cisClient.NewGetWafPackageOptions(packageID) - result, response, err := cisClient.GetWafPackage(opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - log.Printf("WAF package is not found!") - d.SetId("") - return nil - } - log.Printf("Get waf package setting failed: %v", response) - return err - } - d.Set(cisID, crn) - d.Set(cisDomainID, zoneID) - d.Set(cisWAFPackageID, result.Result.ID) - d.Set(cisWAFPackageName, result.Result.Name) - d.Set(cisWAFPackageDetectionMode, result.Result.DetectionMode) - d.Set(cisWAFPackageActionMode, result.Result.ActionMode) - d.Set(cisWAFPackageSensitivity, result.Result.Sensitivity) - d.Set(cisWAFPackageDescription, result.Result.Description) - return nil -} - -func resourceIBMCISWAFPackageDelete(d *schema.ResourceData, meta interface{}) error { - // Nothing to delete on CIS WAF Package resource - d.SetId("") - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_action.go deleted file mode 100644 index f4bbd86a1e..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_action.go +++ /dev/null @@ -1,571 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "net/http" - "os" - "strings" - - "github.com/apache/openwhisk-client-go/whisk" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - funcActionName = "name" - funcActionNamespace = "namespace" - funcActionUsrDefAnnots = "user_defined_annotations" - funcActionUsrDefParams = "user_defined_parameters" -) - -func resourceIBMFunctionAction() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMFunctionActionCreate, - Read: resourceIBMFunctionActionRead, - Update: resourceIBMFunctionActionUpdate, - Delete: resourceIBMFunctionActionDelete, - Exists: resourceIBMFunctionActionExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - funcActionName: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Name of action.", - ValidateFunc: InvokeValidator("ibm_function_action", funcActionName), - }, - funcActionNamespace: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "IBM Cloud function namespace.", - ValidateFunc: InvokeValidator("ibm_function_action", funcActionNamespace), - }, - "limits": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "timeout": { - Type: schema.TypeInt, - Optional: true, - Default: 60000, - Description: "The timeout LIMIT in milliseconds after which the action is terminated.", - }, - "memory": { - Type: schema.TypeInt, - Optional: true, - Default: 256, - Description: "The maximum memory LIMIT in MB for the action (default 256.", - }, - "log_size": { - Type: schema.TypeInt, - Optional: true, - Default: 10, - Description: "The maximum log size LIMIT in MB for the action.", - }, - }, - }, - }, - "exec": { - Type: schema.TypeList, - Required: true, - MaxItems: 1, - Description: "Execution info", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "image": { - Type: schema.TypeString, - Optional: true, - Description: "Container image name when kind is 'blackbox'.", - ConflictsWith: []string{"exec.0.components"}, - }, - "init": { - Type: schema.TypeString, - Optional: true, - Description: "Optional zipfile reference.", - ConflictsWith: []string{"exec.0.image", "exec.0.components"}, - }, - "code": { - Type: schema.TypeString, - Computed: true, - Optional: true, - Description: "The code to execute.", - ConflictsWith: []string{"exec.0.components", "exec.0.code_path"}, - }, - "code_path": { - Type: schema.TypeString, - Optional: true, - Description: "The file path of code to execute.", - ConflictsWith: []string{"exec.0.components", "exec.0.code"}, - }, - "kind": { - Type: schema.TypeString, - Required: true, - Description: "The type of action. Possible values can be found here (https://cloud.ibm.com/docs/openwhisk?topic=cloud-functions-runtimes)", - }, - "main": { - Type: schema.TypeString, - Optional: true, - Description: "The name of the action entry point (function or fully-qualified method name when applicable).", - ConflictsWith: []string{"exec.0.image", "exec.0.components"}, - }, - "components": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The List of fully qualified action.", - ConflictsWith: []string{"exec.0.image", "exec.0.code", "exec.0.code_path"}, - }, - }, - }, - }, - "publish": { - Type: schema.TypeBool, - Optional: true, - Description: "Action visibilty.", - }, - "version": { - Type: schema.TypeString, - Computed: true, - Description: "Semantic version of the item.", - }, - funcActionUsrDefAnnots: { - Type: schema.TypeString, - Optional: true, - Default: "[]", - Description: "Annotation values in KEY VALUE format.", - ValidateFunc: InvokeValidator("ibm_function_action", funcActionUsrDefAnnots), - DiffSuppressFunc: suppressEquivalentJSON, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - funcActionUsrDefParams: { - Type: schema.TypeString, - Optional: true, - Default: "[]", - Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the action.", - ValidateFunc: InvokeValidator("ibm_function_action", funcActionUsrDefParams), - DiffSuppressFunc: suppressEquivalentJSON, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - "annotations": { - Type: schema.TypeString, - Computed: true, - Description: "All annotations set on action by user and those set by the IBM Cloud Function backend/API.", - }, - "parameters": { - Type: schema.TypeString, - Computed: true, - Description: "All paramters set on action by user and those set by the IBM Cloud Function backend/API.", - }, - "action_id": { - Type: schema.TypeString, - Computed: true, - }, - "target_endpoint_url": { - Type: schema.TypeString, - Computed: true, - Description: "Action target endpoint URL.", - }, - }, - } -} - -func resourceIBMFuncActionValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcActionName, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, - Regexp: `^[^/*][a-zA-Z0-9/_@.-]`, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcActionNamespace, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcActionUsrDefAnnots, - ValidateFunctionIdentifier: ValidateJSONString, - Type: TypeString, - Default: "[]", - Optional: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcActionUsrDefParams, - ValidateFunctionIdentifier: ValidateJSONString, - Type: TypeString, - Optional: true}) - - ibmFuncActionResourceValidator := ResourceValidator{ResourceName: "ibm_function_action", Schema: validateSchema} - return &ibmFuncActionResourceValidator -} - -func resourceIBMFunctionActionCreate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - actionService := wskClient.Actions - name := d.Get("name").(string) - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(name); err != nil { - return NewQualifiedNameError(name, err) - } - - payload := whisk.Action{ - Name: qualifiedName.GetEntityName(), - Namespace: namespace, - } - - exec := d.Get("exec").([]interface{}) - payload.Exec = expandExec(exec) - - userDefinedAnnotations := d.Get("user_defined_annotations").(string) - payload.Annotations, err = expandAnnotations(userDefinedAnnotations) - if err != nil { - return err - } - - userDefinedParameters := d.Get("user_defined_parameters").(string) - payload.Parameters, err = expandParameters(userDefinedParameters) - if err != nil { - return err - } - - if v, ok := d.GetOk("limits"); ok { - payload.Limits = expandLimits(v.([]interface{})) - } - - if publish, ok := d.GetOk("publish"); ok { - p := publish.(bool) - payload.Publish = &p - } - - log.Println("[INFO] Creating IBM Cloud Function Action") - _, _, err = actionService.Insert(&payload, true) - - if err != nil { - return fmt.Errorf("Error creating IBM Cloud Function Action: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", namespace, qualifiedName.GetEntityName())) - - return resourceIBMFunctionActionRead(d, meta) -} - -func resourceIBMFunctionActionRead(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := "" - actionID := "" - if len(parts) == 2 { - namespace = parts[0] - actionID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - actionID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, actionID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - actionService := wskClient.Actions - action, _, err := actionService.Get(actionID, true) - if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function Action %s : %s", actionID, err) - } - d.Set("namespace", namespace) - d.Set("limits", flattenLimits(action.Limits)) - d.Set("exec", flattenExec(action.Exec, d)) - d.Set("publish", action.Publish) - d.Set("version", action.Version) - d.Set("action_id", action.Name) - annotations, err := flattenAnnotations(action.Annotations) - if err != nil { - return err - } - - d.Set("annotations", annotations) - parameters, err := flattenParameters(action.Parameters) - if err != nil { - return err - } - d.Set("parameters", parameters) - - temp := strings.Split(action.Namespace, "/") - pkgName := "" - if len(temp) == 2 { - pkgName = temp[1] - d.Set("name", fmt.Sprintf("%s/%s", pkgName, action.Name)) - c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ - Namespace: wskClient.Namespace, - AuthToken: wskClient.AuthToken, - Host: wskClient.Host, - AdditionalHeaders: wskClient.AdditionalHeaders, - }) - - pkg, _, err := c.Packages.Get(pkgName) - if err != nil { - return fmt.Errorf("Error retrieving package IBM Cloud Function package %s : %s", pkgName, err) - } - - userAnnotations, err := flattenAnnotations(filterInheritedAnnotations(pkg.Annotations, action.Annotations)) - if err != nil { - return err - } - - d.Set("user_defined_annotations", userAnnotations) - userParameters, err := flattenParameters(filterInheritedParameters(pkg.Parameters, action.Parameters)) - if err != nil { - return err - } - d.Set("user_defined_parameters", userParameters) - } else { - d.Set("name", action.Name) - userDefinedAnnotations, err := filterActionAnnotations(action.Annotations) - if err != nil { - return err - } - d.Set("user_defined_annotations", userDefinedAnnotations) - - userDefinedParameters, err := filterActionParameters(action.Parameters) - if err != nil { - return err - } - d.Set("user_defined_parameters", userDefinedParameters) - } - - targetUrl, err := action.ActionURL(wskClient.Config.Host, "/api", wskClient.Config.Version, pkgName) - if err != nil { - log.Printf( - "Error creating target endpoint URL for action (%s) targetURL : %s", d.Id(), err) - - } - d.Set("target_endpoint_url", targetUrl) - - return nil -} - -func resourceIBMFunctionActionUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - actionID := parts[1] - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - actionService := wskClient.Actions - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(actionID); err != nil { - return NewQualifiedNameError(actionID, err) - } - - payload := whisk.Action{ - Name: qualifiedName.GetEntityName(), - Namespace: namespace, - } - - ischanged := false - - if d.HasChange("publish") { - p := d.Get("publish").(bool) - payload.Publish = &p - } - - if d.HasChange("user_defined_parameters") { - var err error - payload.Parameters, err = expandParameters(d.Get("user_defined_parameters").(string)) - if err != nil { - return err - } - ischanged = true - } - - if d.HasChange("user_defined_annotations") { - var err error - payload.Annotations, err = expandAnnotations(d.Get("user_defined_annotations").(string)) - if err != nil { - return err - } - ischanged = true - } - - if d.HasChange("exec") { - exec := d.Get("exec").([]interface{}) - payload.Exec = expandExec(exec) - ischanged = true - } - - if d.HasChange("limits") { - limits := d.Get("limits").([]interface{}) - payload.Limits = expandLimits(limits) - ischanged = true - } - - if ischanged { - log.Println("[INFO] Update IBM Cloud Function Action") - _, _, err = actionService.Insert(&payload, true) - if err != nil { - return fmt.Errorf("Error updating IBM Cloud Function Action: %s", err) - } - } - - return resourceIBMFunctionActionRead(d, meta) -} - -func resourceIBMFunctionActionDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - actionID := parts[1] - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - actionService := wskClient.Actions - - _, err = actionService.Delete(actionID) - if err != nil { - return fmt.Errorf("Error deleting IBM Cloud Function Action: %s", err) - } - - d.SetId("") - return nil -} - -func resourceIBMFunctionActionExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := cfIdParts(d.Id()) - if err != nil { - return false, err - } - - namespace := "" - actionID := "" - if len(parts) >= 2 { - namespace = parts[0] - actionID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - actionID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, actionID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return false, err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return false, err - } - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return false, err - - } - - actionService := wskClient.Actions - - action, resp, err := actionService.Get(actionID, true) - if err != nil { - if resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("Error communicating with IBM Cloud Function Client : %s", err) - } - - temp := strings.Split(action.Namespace, "/") - var name string - - if len(temp) == 2 { - name = fmt.Sprintf("%s/%s", temp[1], action.Name) - } else { - name = action.Name - } - - return name == actionID, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_namespace.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_namespace.go deleted file mode 100644 index 87364d1529..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_namespace.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "strings" - - "github.com/IBM-Cloud/bluemix-go/api/functions" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - funcNamespaceName = "name" - funcNamespaceResGrpId = "resource_group_id" - funcNamespaceResPlanId = "resource_plan_id" - funcNamespaceDesc = "description" - funcNamespaceLoc = "location" -) - -func resourceIBMFunctionNamespace() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMFunctionNamespaceCreate, - Read: resourceIBMFunctionNamespaceRead, - Update: resourceIBMFunctionNamespaceUpdate, - Delete: resourceIBMFunctionNamespaceDelete, - Exists: resourceIBMFunctionNamespaceExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - funcNamespaceName: { - Type: schema.TypeString, - Required: true, - Description: "Name of namespace.", - ValidateFunc: InvokeValidator("ibm_function_namespace", funcNamespaceName), - }, - funcNamespaceDesc: { - Type: schema.TypeString, - Optional: true, - Description: "Namespace Description.", - }, - funcNamespaceResGrpId: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Resource Group ID.", - ValidateFunc: InvokeValidator("ibm_function_namespace", funcNamespaceResGrpId), - }, - funcNamespaceLoc: { - Type: schema.TypeString, - Computed: true, - Description: "Namespace Location.", - }, - }, - } -} - -func resourceIBMFuncNamespaceValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcNamespaceName, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString, - Required: true}) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcNamespaceResGrpId, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString, - Required: true}) - - ibmFuncNamespaceResourceValidator := ResourceValidator{ResourceName: "ibm_function_namespace", Schema: validateSchema} - return &ibmFuncNamespaceResourceValidator -} - -func resourceIBMFunctionNamespaceCreate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - createNamespaceOptions := functions.CreateNamespaceOptions{} - - name := d.Get(funcNamespaceName).(string) - createNamespaceOptions.Name = &name - resourceGroupID := d.Get(funcNamespaceResGrpId).(string) - createNamespaceOptions.ResourceGroupID = &resourceGroupID - resourcePlanID := "functions-base-plan" - createNamespaceOptions.ResourcePlanID = &resourcePlanID - - if _, ok := d.GetOk(funcNamespaceDesc); ok { - description := d.Get(funcNamespaceDesc).(string) - createNamespaceOptions.Description = &description - } - - namespace, err := functionNamespaceAPI.Namespaces().CreateNamespace(createNamespaceOptions) - if err != nil { - return fmt.Errorf("Error Creating Namespace: %s", err) - } - - d.SetId(*namespace.ID) - log.Printf("[INFO] Created namespace (IAM) : %s", *namespace.Name) - - return resourceIBMFunctionNamespaceRead(d, meta) -} - -func resourceIBMFunctionNamespaceRead(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - id := d.Id() - - getOptions := functions.GetNamespaceOptions{ - ID: &id, - } - instance, err := functionNamespaceAPI.Namespaces().GetNamespace(getOptions) - if err != nil { - if strings.Contains(err.Error(), "404") { - d.SetId("") - return nil - } - return fmt.Errorf("Error getting namesapce (IAM): %s", err) - } - - if instance.Name != nil { - d.Set(funcNamespaceName, *instance.Name) - } - - if instance.ResourceGroupID != nil { - d.Set(funcNamespaceResGrpId, *instance.ResourceGroupID) - } - - if instance.Location != nil { - d.Set(funcNamespaceLoc, *instance.Location) - } - if instance.Description != nil { - d.Set(funcNamespaceDesc, *instance.Description) - } - - return nil -} - -func resourceIBMFunctionNamespaceUpdate(d *schema.ResourceData, meta interface{}) error { - nsClient, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - ID := d.Id() - updateNamespaceOptions := functions.UpdateNamespaceOptions{} - if d.HasChange(funcNamespaceName) { - name := d.Get(funcNamespaceName).(string) - updateNamespaceOptions.Name = &name - } - - if d.HasChange(funcNamespaceDesc) { - description := d.Get(funcNamespaceDesc).(string) - updateNamespaceOptions.Description = &description - } - - updateNamespaceOptions.ID = &ID - namespace, err := nsClient.Namespaces().UpdateNamespace(updateNamespaceOptions) - if err != nil { - return fmt.Errorf("Error Updating Namespace: %s", err) - } - - log.Printf("[INFO] Updated namespace (IAM) : %s", *namespace.Name) - - return resourceIBMFunctionNamespaceRead(d, meta) -} - -func resourceIBMFunctionNamespaceDelete(d *schema.ResourceData, meta interface{}) error { - nsClient, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - ID := d.Id() - _, err = nsClient.Namespaces().DeleteNamespace(ID) - if err != nil { - return fmt.Errorf("Error Deleting Namespace: %s", err) - } - - d.SetId("") - return nil -} - -func resourceIBMFunctionNamespaceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - nsClient, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return false, err - } - - ID := d.Id() - - getOptions := functions.GetNamespaceOptions{ - ID: &ID, - } - _, err = nsClient.Namespaces().GetNamespace(getOptions) - if err != nil { - if strings.Contains(err.Error(), "404") { - return false, nil - } - return false, fmt.Errorf("Error getting existing namesapce (IAM): %s", err) - } - - return true, nil - -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_package.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_package.go deleted file mode 100644 index 89b4dff107..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_package.go +++ /dev/null @@ -1,459 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "net/http" - "os" - "strings" - - "github.com/apache/openwhisk-client-go/whisk" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - funcPkgNamespace = "namespace" - funcPkgName = "name" - funcPkgUsrDefAnnots = "user_defined_annotations" - funcPkgUsrDefParams = "user_defined_parameters" - funcPkgBindPkgName = "bind_package_name" -) - -func resourceIBMFunctionPackage() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMFunctionPackageCreate, - Read: resourceIBMFunctionPackageRead, - Update: resourceIBMFunctionPackageUpdate, - Delete: resourceIBMFunctionPackageDelete, - Exists: resourceIBMFunctionPackageExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - funcPkgNamespace: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "IBM Cloud function namespace.", - ValidateFunc: InvokeValidator("ibm_function_package", funcPkgNamespace), - }, - funcPkgName: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Name of package.", - ValidateFunc: InvokeValidator("ibm_function_package", funcPkgName), - }, - "publish": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Package visibilty.", - }, - "version": { - Type: schema.TypeString, - Computed: true, - Description: "Semantic version of the item.", - }, - funcPkgUsrDefAnnots: { - Type: schema.TypeString, - Optional: true, - Description: "Annotation values in KEY VALUE format.", - Default: "[]", - ValidateFunc: InvokeValidator("ibm_function_package", funcPkgUsrDefAnnots), - DiffSuppressFunc: suppressEquivalentJSON, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - funcPkgUsrDefParams: { - Type: schema.TypeString, - Optional: true, - Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the package.", - ValidateFunc: InvokeValidator("ibm_function_package", funcPkgUsrDefParams), - Default: "[]", - DiffSuppressFunc: suppressEquivalentJSON, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - "annotations": { - Type: schema.TypeString, - Computed: true, - Description: "All annotations set on package by user and those set by the IBM Cloud Function backend/API.", - }, - "parameters": { - Type: schema.TypeString, - Computed: true, - Description: "All parameters set on package by user and those set by the IBM Cloud Function backend/API.", - }, - funcPkgBindPkgName: { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Name of package to be binded.", - ValidateFunc: InvokeValidator("ibm_function_package", funcPkgBindPkgName), - DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { - if o == "" { - return false - } - if strings.Compare(n, o) == 0 { - return true - } - return false - }, - }, - "package_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceIBMFuncPackageValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcPkgName, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, - Regexp: `\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcPkgNamespace, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcPkgUsrDefAnnots, - ValidateFunctionIdentifier: ValidateJSONString, - Type: TypeString, - Default: "[]", - Optional: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcPkgBindPkgName, - ValidateFunctionIdentifier: ValidateBindedPackageName, - Type: TypeString, - Optional: true}) - - ibmFuncPackageResourceValidator := ResourceValidator{ResourceName: "ibm_function_package", Schema: validateSchema} - return &ibmFuncPackageResourceValidator -} - -func resourceIBMFunctionPackageCreate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - packageService := wskClient.Packages - - name := d.Get("name").(string) - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(name); err != nil { - return NewQualifiedNameError(name, err) - } - - payload := whisk.Package{ - Name: qualifiedName.GetEntityName(), - Namespace: qualifiedName.GetNamespace(), - } - - userDefinedAnnotations := d.Get("user_defined_annotations").(string) - payload.Annotations, err = expandAnnotations(userDefinedAnnotations) - if err != nil { - return err - } - - userDefinedParameters := d.Get("user_defined_parameters").(string) - payload.Parameters, err = expandParameters(userDefinedParameters) - if err != nil { - return err - } - - if publish, ok := d.GetOk("publish"); ok { - p := publish.(bool) - payload.Publish = &p - } - - if v, ok := d.GetOk("bind_package_name"); ok { - var BindingQualifiedName = new(QualifiedName) - if BindingQualifiedName, err = NewQualifiedName(v.(string)); err != nil { - return NewQualifiedNameError(v.(string), err) - } - BindingPayload := whisk.Binding{ - Name: BindingQualifiedName.GetEntityName(), - Namespace: BindingQualifiedName.GetNamespace(), - } - payload.Binding = &BindingPayload - } - - log.Println("[INFO] Creating IBM CLoud Function package") - result, _, err := packageService.Insert(&payload, false) - if err != nil { - return fmt.Errorf("Error creating IBM CLoud Function package: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) - - return resourceIBMFunctionPackageRead(d, meta) -} - -func resourceIBMFunctionPackageRead(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := "" - packageID := "" - if len(parts) == 2 { - namespace = parts[0] - packageID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - packageID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, packageID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - packageService := wskClient.Packages - - pkg, _, err := packageService.Get(packageID) - if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function package %s : %s", packageID, err) - } - d.Set("package_id", pkg.Name) - d.Set("name", pkg.Name) - d.Set("namespace", namespace) - d.Set("publish", pkg.Publish) - d.Set("version", pkg.Version) - annotations, err := flattenAnnotations(pkg.Annotations) - if err != nil { - return err - } - d.Set("annotations", annotations) - parameters, err := flattenParameters(pkg.Parameters) - if err != nil { - return err - } - d.Set("parameters", parameters) - if isEmpty(*pkg.Binding) { - - d.Set("user_defined_annotations", annotations) - d.Set("user_defined_parameters", parameters) - - } else { - d.Set("bind_package_name", fmt.Sprintf("/%s/%s", pkg.Binding.Namespace, pkg.Binding.Name)) - c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ - Namespace: pkg.Binding.Namespace, - AuthToken: wskClient.AuthToken, - Host: wskClient.Host, - AdditionalHeaders: wskClient.AdditionalHeaders, - }) - bindedPkg, _, err := c.Packages.Get(pkg.Binding.Name) - if err != nil { - return fmt.Errorf("Error retrieving Binded IBM Cloud Function package %s : %s", pkg.Binding.Name, err) - } - - userAnnotations, err := flattenAnnotations(filterInheritedAnnotations(bindedPkg.Annotations, pkg.Annotations)) - if err != nil { - return err - } - d.Set("user_defined_annotations", userAnnotations) - - userParameters, err := flattenParameters(filterInheritedParameters(bindedPkg.Parameters, pkg.Parameters)) - if err != nil { - return err - } - d.Set("user_defined_parameters", userParameters) - } - - return nil -} - -func resourceIBMFunctionPackageUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - packageService := wskClient.Packages - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(d.Get("name").(string)); err != nil { - return NewQualifiedNameError(d.Get("name").(string), err) - } - - payload := whisk.Package{ - Name: qualifiedName.GetEntityName(), - Namespace: qualifiedName.GetNamespace(), - } - ischanged := false - if d.HasChange("publish") { - p := d.Get("publish").(bool) - payload.Publish = &p - ischanged = true - } - - if d.HasChange("user_defined_parameters") { - var err error - payload.Parameters, err = expandParameters(d.Get("user_defined_parameters").(string)) - if err != nil { - return err - } - ischanged = true - } - - if d.HasChange("user_defined_annotations") { - var err error - payload.Annotations, err = expandAnnotations(d.Get("user_defined_annotations").(string)) - if err != nil { - return err - } - ischanged = true - } - - if ischanged { - log.Println("[INFO] Update IBM Cloud Function Package") - _, _, err = packageService.Insert(&payload, true) - if err != nil { - return fmt.Errorf("Error updating IBM Cloud Function Package: %s", err) - } - } - - return resourceIBMFunctionPackageRead(d, meta) -} - -func resourceIBMFunctionPackageDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - packageID := parts[1] - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - packageService := wskClient.Packages - - _, err = packageService.Delete(packageID) - if err != nil { - return fmt.Errorf("Error deleting IBM Cloud Function Package: %s", err) - } - - d.SetId("") - return nil -} - -func resourceIBMFunctionPackageExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := cfIdParts(d.Id()) - if err != nil { - return false, err - } - - namespace := "" - packageID := "" - if len(parts) == 2 { - namespace = parts[0] - packageID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - packageID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, packageID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return false, err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return false, err - } - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return false, err - - } - - packageService := wskClient.Packages - - pkg, resp, err := packageService.Get(packageID) - if err != nil { - if resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("Error communicating with IBM Cloud Function Client : %s", err) - } - - return pkg.Name == packageID, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_rule.go deleted file mode 100644 index 73285d0240..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_rule.go +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "os" - "strings" - - "github.com/apache/openwhisk-client-go/whisk" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - funcRuleNamespace = "namespace" - funcRuleName = "name" -) - -func resourceIBMFunctionRule() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMFunctionRuleCreate, - Read: resourceIBMFunctionRuleRead, - Update: resourceIBMFunctionRuleUpdate, - Delete: resourceIBMFunctionRuleDelete, - Exists: resourceIBMFunctionRuleExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - funcRuleNamespace: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "IBM Cloud function namespace.", - ValidateFunc: InvokeValidator("ibm_function_rule", funcRuleNamespace), - }, - funcRuleName: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Name of rule.", - ValidateFunc: InvokeValidator("ibm_function_rule", funcRuleName), - }, - "trigger_name": { - Type: schema.TypeString, - Required: true, - Description: "Name of trigger.", - }, - "action_name": { - Type: schema.TypeString, - Required: true, - Description: "Name of action.", - DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { - new := strings.Split(n, "/") - old := strings.Split(o, "/") - action_name_new := new[len(new)-1] - action_name_old := old[len(old)-1] - - if o == "" { - return false - } - if strings.HasPrefix(n, "/_") { - temp := strings.Replace(n, "/_", "/"+d.Get("namespace").(string), 1) - if strings.Compare(temp, o) == 0 { - return true - } - if strings.Compare(action_name_old, action_name_new) == 0 { - return true - } - - } - if !strings.HasPrefix(n, "/") { - if strings.HasPrefix(o, "/"+d.Get("namespace").(string)) { - return true - } - if strings.Compare(action_name_old, action_name_new) == 0 { - return true - } - } - return false - }, - }, - "status": { - Type: schema.TypeString, - Computed: true, - Description: "Status of the rule.", - }, - "publish": { - Type: schema.TypeBool, - Computed: true, - Description: "Rule visbility.", - }, - "version": { - Type: schema.TypeString, - Computed: true, - Description: "Semantic version of the item.", - }, - "rule_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceIBMFuncRuleValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcRuleName, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, - Regexp: `\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcRuleNamespace, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString, - Required: true}) - - ibmFuncRuleResourceValidator := ResourceValidator{ResourceName: "ibm_function_rule", Schema: validateSchema} - return &ibmFuncRuleResourceValidator -} - -func resourceIBMFunctionRuleCreate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - ruleService := wskClient.Rules - - name := d.Get("name").(string) - - var qualifiedName = new(QualifiedName) - if qualifiedName, err = NewQualifiedName(name); err != nil { - return NewQualifiedNameError(name, err) - } - trigger := d.Get("trigger_name").(string) - action := d.Get("action_name").(string) - - triggerName := getQualifiedName(trigger, wskClient.Config.Namespace) - actionName := getQualifiedName(action, wskClient.Config.Namespace) - payload := whisk.Rule{ - Name: qualifiedName.GetEntityName(), - Namespace: qualifiedName.GetNamespace(), - Trigger: triggerName, - Action: actionName, - } - log.Println("[INFO] Creating IBM Cloud Function rule") - result, _, err := ruleService.Insert(&payload, false) - if err != nil { - return fmt.Errorf("Error creating IBM Cloud Function rule: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) - - return resourceIBMFunctionRuleRead(d, meta) -} - -func resourceIBMFunctionRuleRead(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := "" - ruleID := "" - if len(parts) == 2 { - namespace = parts[0] - ruleID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - ruleID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, ruleID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - ruleService := wskClient.Rules - rule, _, err := ruleService.Get(ruleID) - if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function rule %s : %s", ruleID, err) - } - - d.Set("rule_id", rule.Name) - d.Set("name", rule.Name) - d.Set("publish", rule.Publish) - d.Set("namespace", namespace) - d.Set("version", rule.Version) - d.Set("status", rule.Status) - - path := rule.Action.(map[string]interface{})["path"] - d.Set("trigger_name", rule.Trigger.(map[string]interface{})["name"]) - actionName := rule.Action.(map[string]interface{})["name"] - d.Set("action_name", fmt.Sprintf("/%s/%s", path, actionName)) - d.SetId(fmt.Sprintf("%s:%s", namespace, rule.Name)) - return nil -} - -func resourceIBMFunctionRuleUpdate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - ruleService := wskClient.Rules - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(d.Get("name").(string)); err != nil { - return NewQualifiedNameError(d.Get("name").(string), err) - } - - payload := whisk.Rule{ - Name: qualifiedName.GetEntityName(), - Namespace: qualifiedName.GetNamespace(), - } - ischanged := false - - if d.HasChange("trigger_name") { - trigger := d.Get("trigger_name").(string) - payload.Trigger = getQualifiedName(trigger, wskClient.Config.Namespace) - ischanged = true - } - - if d.HasChange("action_name") { - action := d.Get("action_name").(string) - payload.Action = getQualifiedName(action, wskClient.Config.Namespace) - ischanged = true - } - - if ischanged { - log.Println("[INFO] Update IBM Cloud Function Rule") - result, _, err := ruleService.Insert(&payload, true) - if err != nil { - return fmt.Errorf("Error updating IBM Cloud Function Rule: %s", err) - } - _, _, err = ruleService.SetState(result.Name, "active") - if err != nil { - return fmt.Errorf("Error updating IBM Cloud Function Rule: %s", err) - } - } - - return resourceIBMFunctionRuleRead(d, meta) -} - -func resourceIBMFunctionRuleDelete(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - ruleID := parts[1] - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - ruleService := wskClient.Rules - - _, err = ruleService.Delete(ruleID) - if err != nil { - return fmt.Errorf("Error deleting IBM Cloud Function Rule: %s", err) - } - - d.SetId("") - return nil -} - -func resourceIBMFunctionRuleExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := cfIdParts(d.Id()) - if err != nil { - return false, err - } - - namespace := "" - ruleID := "" - if len(parts) == 2 { - namespace = parts[0] - ruleID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - ruleID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, ruleID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return false, err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return false, err - } - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return false, err - - } - - ruleService := wskClient.Rules - - rule, resp, err := ruleService.Get(ruleID) - if err != nil { - if resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("Error communicating with IBM Cloud Function Client : %s", err) - } - return rule.Name == ruleID, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_trigger.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_trigger.go deleted file mode 100644 index cadf3761f8..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_function_trigger.go +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "net/http" - "os" - - "github.com/apache/openwhisk-client-go/whisk" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - funcTriggerNamespace = "namespace" - funcTriggerName = "name" - funcTriggerParams = "parameters" - funcTriggerUsrDefAnnots = "user_defined_annotations" - funcTriggerUsrDefParams = "user_defined_parameters" - - feedLifeCycleEvent = "lifecycleEvent" - feedTriggerName = "triggerName" - feedAuthKey = "authKey" - feedCreate = "CREATE" - feedDelete = "DELETE" -) - -func resourceIBMFunctionTrigger() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMFunctionTriggerCreate, - Read: resourceIBMFunctionTriggerRead, - Update: resourceIBMFunctionTriggerUpdate, - Delete: resourceIBMFunctionTriggerDelete, - Exists: resourceIBMFunctionTriggerExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - funcTriggerNamespace: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "IBM Cloud function namespace.", - ValidateFunc: InvokeValidator("ibm_function_trigger", funcTriggerNamespace), - }, - funcTriggerName: { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Name of Trigger.", - ValidateFunc: InvokeValidator("ibm_function_trigger", funcTriggerName), - }, - "feed": { - Type: schema.TypeList, - ForceNew: true, - Optional: true, - MaxItems: 1, - Description: "Trigger feed", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Trigger feed ACTION_NAME.", - }, - funcTriggerParams: { - Type: schema.TypeString, - Optional: true, - Default: "[]", - Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the action invoke.", - ValidateFunc: InvokeValidator("ibm_function_trigger", funcTriggerParams), - DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { - if o == "" && n == "" { - return false - } - if o == "[]" { - return true - } - return false - }, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - }, - }, - }, - "publish": { - Type: schema.TypeBool, - Computed: true, - Description: "Trigger visbility.", - }, - "version": { - Type: schema.TypeString, - Computed: true, - Description: "Semantic version of the item.", - }, - funcTriggerUsrDefAnnots: { - Type: schema.TypeString, - Optional: true, - Description: "Annotation values in KEY VALUE format.", - Default: "[]", - ValidateFunc: InvokeValidator("ibm_function_trigger", funcTriggerUsrDefAnnots), - DiffSuppressFunc: suppressEquivalentJSON, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - funcTriggerUsrDefParams: { - Type: schema.TypeString, - Optional: true, - Default: "[]", - Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the trigger.", - ValidateFunc: InvokeValidator("ibm_function_trigger", funcTriggerUsrDefParams), - DiffSuppressFunc: suppressEquivalentJSON, - StateFunc: func(v interface{}) string { - json, _ := normalizeJSONString(v) - return json - }, - }, - "annotations": { - Type: schema.TypeString, - Computed: true, - Description: "All annotations set on trigger by user and those set by the IBM Cloud Function backend/API.", - }, - "parameters": { - Type: schema.TypeString, - Computed: true, - Description: "All parameters set on trigger by user and those set by the IBM Cloud Function backend/API.", - }, - "trigger_id": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceIBMFuncTriggerValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcTriggerName, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, - Regexp: `\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcTriggerNamespace, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString, - Required: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcTriggerUsrDefAnnots, - ValidateFunctionIdentifier: ValidateJSONString, - Type: TypeString, - Default: "[]", - Optional: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcTriggerUsrDefParams, - ValidateFunctionIdentifier: ValidateJSONString, - Type: TypeString, - Optional: true}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: funcTriggerParams, - ValidateFunctionIdentifier: ValidateJSONString, - Type: TypeString, - Default: "[]", - Optional: true}) - - ibmFuncTriggerResourceValidator := ResourceValidator{ResourceName: "ibm_function_trigger", Schema: validateSchema} - return &ibmFuncTriggerResourceValidator -} - -func resourceIBMFunctionTriggerCreate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - triggerService := wskClient.Triggers - feed := false - feedPayload := map[string]interface{}{} - name := d.Get("name").(string) - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(name); err != nil { - return NewQualifiedNameError(name, err) - } - - payload := whisk.Trigger{ - Name: qualifiedName.GetEntityName(), - Namespace: qualifiedName.GetNamespace(), - } - - userDefinedAnnotations := d.Get("user_defined_annotations").(string) - payload.Annotations, err = expandAnnotations(userDefinedAnnotations) - if err != nil { - return err - } - - userDefinedParameters := d.Get("user_defined_parameters").(string) - payload.Parameters, err = expandParameters(userDefinedParameters) - if err != nil { - return err - } - - if v, ok := d.GetOk("feed"); ok { - feed = true - value := v.([]interface{})[0].(map[string]interface{}) - feedPaylod := whisk.KeyValue{ - Key: "feed", - Value: value["name"], - } - feedArray := make([]whisk.KeyValue, 0, 1) - feedArray = append(feedArray, feedPaylod) - payload.Annotations = payload.Annotations.AppendKeyValueArr(feedArray) - } - - log.Println("[INFO] Creating IBM Cloud Function trigger") - result, _, err := triggerService.Insert(&payload, false) - if err != nil { - return fmt.Errorf("Error creating IBM Cloud Function trigger: %s", err) - } - - d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) - - if feed { - feed := d.Get("feed").([]interface{})[0].(map[string]interface{}) - actionName := feed["name"].(string) - parameters := feed["parameters"].(string) - var err error - feedParameters, err := expandParameters(parameters) - if err != nil { - return err - } - for _, value := range feedParameters { - feedPayload[value.Key] = value.Value - } - var feedQualifiedName = new(QualifiedName) - - if feedQualifiedName, err = NewQualifiedName(actionName); err != nil { - _, _, delerr := triggerService.Delete(name) - if delerr != nil { - return fmt.Errorf("Error creating IBM Cloud Function trigger with feed: %s", err) - } - return NewQualifiedNameError(actionName, err) - } - - feedPayload[feedLifeCycleEvent] = feedCreate - feedPayload[feedAuthKey] = wskClient.Config.AuthToken - feedPayload[feedTriggerName] = fmt.Sprintf("/%s/%s", qualifiedName.GetNamespace(), name) - - c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ - AuthToken: wskClient.AuthToken, - Host: wskClient.Host, - AdditionalHeaders: wskClient.AdditionalHeaders, - }) - - if feedQualifiedName.GetNamespace() != namespace { - c.Config.Namespace = feedQualifiedName.GetNamespace() - } - actionService := c.Actions - _, _, err = actionService.Invoke(feedQualifiedName.GetEntityName(), feedPayload, true, true) - if err != nil { - _, _, delerr := triggerService.Delete(name) - if delerr != nil { - return fmt.Errorf("Error creating IBM Cloud Function trigger with feed: %s", err) - } - d.SetId("") - return fmt.Errorf("Error creating IBM Cloud Function trigger with feed: %s", err) - } - } - - d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) - - return resourceIBMFunctionTriggerRead(d, meta) -} - -func resourceIBMFunctionTriggerRead(d *schema.ResourceData, meta interface{}) error { - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := "" - triggerID := "" - if len(parts) == 2 { - namespace = parts[0] - triggerID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - triggerID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, triggerID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - triggerService := wskClient.Triggers - - trigger, _, err := triggerService.Get(triggerID) - if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function Trigger %s : %s", triggerID, err) - } - d.Set("trigger_id", trigger.Name) - d.Set("namespace", namespace) - d.Set("name", trigger.Name) - d.Set("publish", trigger.Publish) - d.Set("version", trigger.Version) - annotations, err := flattenAnnotations(trigger.Annotations) - if err != nil { - return err - } - d.Set("annotations", annotations) - parameters, err := flattenParameters(trigger.Parameters) - if err != nil { - return err - } - d.Set("parameters", parameters) - d.Set("user_defined_parameters", parameters) - - userDefinedAnnotations, err := filterTriggerAnnotations(trigger.Annotations) - if err != nil { - return err - } - d.Set("user_defined_annotations", userDefinedAnnotations) - - found := trigger.Annotations.FindKeyValue("feed") - - if found >= 0 { - d.Set("feed", flattenFeed(trigger.Annotations.GetValue("feed").(string))) - } - - return nil -} - -func resourceIBMFunctionTriggerUpdate(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - - namespace := parts[0] - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - triggerService := wskClient.Triggers - - name := d.Get("name").(string) - - var qualifiedName = new(QualifiedName) - - if qualifiedName, err = NewQualifiedName(name); err != nil { - return NewQualifiedNameError(name, err) - } - - payload := whisk.Trigger{ - Name: qualifiedName.GetEntityName(), - Namespace: qualifiedName.GetNamespace(), - } - ischanged := false - - if d.HasChange("user_defined_parameters") { - var err error - payload.Parameters, err = expandParameters(d.Get("user_defined_parameters").(string)) - if err != nil { - return err - } - ischanged = true - } - - if d.HasChange("user_defined_annotations") { - var err error - payload.Annotations, err = expandAnnotations(d.Get("user_defined_annotations").(string)) - if err != nil { - return err - } - ischanged = true - } - - if ischanged { - log.Println("[INFO] Update IBM Cloud Function Trigger") - - _, _, err = triggerService.Insert(&payload, true) - if err != nil { - return fmt.Errorf("Error updating IBM Cloud Function Trigger: %s", err) - } - } - - return resourceIBMFunctionTriggerRead(d, meta) -} - -func resourceIBMFunctionTriggerDelete(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return err - } - - parts, err := cfIdParts(d.Id()) - if err != nil { - return err - } - namespace := parts[0] - triggerID := parts[1] - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return err - - } - - triggerService := wskClient.Triggers - var qualifiedName = new(QualifiedName) - fmt.Println(qualifiedName) - if qualifiedName, err = NewQualifiedName(triggerID); err != nil { - return NewQualifiedNameError(triggerID, err) - } - trigger, _, err := triggerService.Get(triggerID) - if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function Trigger %s : %s", triggerID, err) - } - found := trigger.Annotations.FindKeyValue("feed") - if found >= 0 { - actionName := trigger.Annotations.GetValue("feed").(string) - var feedQualifiedName = new(QualifiedName) - - if feedQualifiedName, err = NewQualifiedName(actionName); err != nil { - return NewQualifiedNameError(actionName, err) - } - - feedPayload := map[string]interface{}{ - feedLifeCycleEvent: feedDelete, - feedAuthKey: wskClient.Config.AuthToken, - feedTriggerName: fmt.Sprintf("/%s/%s", qualifiedName.GetNamespace(), triggerID), - } - - c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ - AuthToken: wskClient.AuthToken, - Host: wskClient.Host, - AdditionalHeaders: wskClient.AdditionalHeaders, - }) - if feedQualifiedName.GetNamespace() != namespace { - c.Config.Namespace = feedQualifiedName.GetNamespace() - } - - actionService := c.Actions - _, _, err = actionService.Invoke(feedQualifiedName.GetEntityName(), feedPayload, true, true) - if err != nil { - return fmt.Errorf("Error deleting IBM Cloud Function trigger with feed: %s", err) - - } - } - - _, _, err = triggerService.Delete(triggerID) - if err != nil { - return fmt.Errorf("Error deleting IBM Cloud Function Trigger: %s", err) - } - - d.SetId("") - return nil -} - -func resourceIBMFunctionTriggerExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := cfIdParts(d.Id()) - if err != nil { - return false, err - } - - namespace := "" - triggerID := "" - if len(parts) == 2 { - namespace = parts[0] - triggerID = parts[1] - } else { - namespace = os.Getenv("FUNCTION_NAMESPACE") - triggerID = parts[0] - d.SetId(fmt.Sprintf("%s:%s", namespace, triggerID)) - } - - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() - if err != nil { - return false, err - } - - bxSession, err := meta.(ClientSession).BluemixSession() - if err != nil { - return false, err - } - - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) - if err != nil { - return false, err - - } - - triggerService := wskClient.Triggers - trigger, resp, err := triggerService.Get(triggerID) - if err != nil { - if resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("Error communicating with IBM Cloud Function Client : %s", err) - } - return trigger.Name == triggerID, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_members.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_members.go deleted file mode 100644 index 69a1bedf12..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_members.go +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - "time" - - "github.com/IBM/platform-services-go-sdk/iamidentityv1" - - "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceIBMIAMAccessGroupMembers() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceIBMIAMAccessGroupMembersCreate, - ReadContext: resourceIBMIAMAccessGroupMembersRead, - UpdateContext: resourceIBMIAMAccessGroupMembersUpdate, - DeleteContext: resourceIBMIAMAccessGroupMembersDelete, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "access_group_id": { - Type: schema.TypeString, - Required: true, - Description: "Unique identifier of the access group", - ForceNew: true, - }, - - "ibm_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, - }, - - "iam_service_ids": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - - "members": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "iam_id": { - Type: schema.TypeString, - Computed: true, - }, - "type": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - }, - } -} - -func resourceIBMIAMAccessGroupMembersCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() - if err != nil { - return diag.FromErr(err) - } - - grpID := d.Get("access_group_id").(string) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - - accountID := userDetails.userAccount - - var userids, serviceids []string - - users := expandStringList(d.Get("ibm_ids").(*schema.Set).List()) - services := expandStringList(d.Get("iam_service_ids").(*schema.Set).List()) - - if len(users) == 0 && len(services) == 0 { - return diag.FromErr(fmt.Errorf("ERROR] Provide either `ibm_ids` or `iam_service_ids`")) - - } - - userids, err = flattenUserIds(accountID, users, meta) - if err != nil { - return diag.FromErr(err) - } - - serviceids, err = flattenServiceIds(services, meta) - if err != nil { - return diag.FromErr(err) - } - - members := prepareMemberAddRequest(iamAccessGroupsClient, userids, serviceids) - - addMembersToAccessGroupOptions := iamAccessGroupsClient.NewAddMembersToAccessGroupOptions(grpID) - addMembersToAccessGroupOptions.SetMembers(members) - membership, detailResponse, err := iamAccessGroupsClient.AddMembersToAccessGroup(addMembersToAccessGroupOptions) - if err != nil || membership == nil { - return diag.FromErr(fmt.Errorf("Error adding members to group(%s). API response: %s", grpID, detailResponse)) - } - - d.SetId(fmt.Sprintf("%s/%s", grpID, time.Now().UTC().String())) - - return resourceIBMIAMAccessGroupMembersRead(context, d, meta) -} - -func resourceIBMIAMAccessGroupMembersRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() - if err != nil { - return diag.FromErr(err) - } - - parts, err := idParts(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - grpID := parts[0] - listAccessGroupMembersOptions := iamAccessGroupsClient.NewListAccessGroupMembersOptions(grpID) - offset := int64(0) - // lets fetch 100 in a single pagination - limit := int64(100) - listAccessGroupMembersOptions.SetLimit(limit) - members, detailedResponse, err := iamAccessGroupsClient.ListAccessGroupMembers(listAccessGroupMembersOptions) - if err != nil { - return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving access group members: %s. API Response: %s", err, detailedResponse)) - } - allMembers := members.Members - totalMembers := intValue(members.TotalCount) - for len(allMembers) < totalMembers { - offset = offset + limit - listAccessGroupMembersOptions.SetOffset(offset) - members, detailedResponse, err = iamAccessGroupsClient.ListAccessGroupMembers(listAccessGroupMembersOptions) - if err != nil { - return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving access group members: %s. API Response: %s", err, detailedResponse)) - } - allMembers = append(allMembers, members.Members...) - } - - d.Set("access_group_id", grpID) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - - accountID := userDetails.userAccount - - userManagement, err := meta.(ClientSession).UserManagementAPI() - if err != nil { - return diag.FromErr(err) - } - client := userManagement.UserInvite() - res, err := client.ListUsers(accountID) - if err != nil { - return diag.FromErr(err) - } - - iamClient, err := meta.(ClientSession).IAMIdentityV1API() - if err != nil { - return diag.FromErr(err) - } - - start := "" - allrecs := []iamidentityv1.ServiceID{} - var pg int64 = 100 - for { - listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{ - AccountID: &userDetails.userAccount, - Pagesize: &pg, - } - if start != "" { - listServiceIDOptions.Pagetoken = &start - } - - serviceIDs, resp, err := iamClient.ListServiceIds(&listServiceIDOptions) - if err != nil { - return diag.FromErr(fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp)) - } - start = GetNextIAM(serviceIDs.Next) - allrecs = append(allrecs, serviceIDs.Serviceids...) - if start == "" { - break - } - } - - d.Set("members", flattenAccessGroupMembers(allMembers, res, allrecs)) - ibmID, serviceID := flattenMembersData(allMembers, res, allrecs) - if len(ibmID) > 0 { - d.Set("ibm_ids", ibmID) - } - if len(serviceID) > 0 { - d.Set("iam_service_ids", serviceID) - } - return nil -} - -func resourceIBMIAMAccessGroupMembersUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() - if err != nil { - return diag.FromErr(err) - } - - parts, err := idParts(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - grpID := parts[0] - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - - accountID := userDetails.userAccount - - var removeUsers, addUsers, removeServiceids, addServiceids []string - o, n := d.GetChange("ibm_ids") - ou := o.(*schema.Set) - nu := n.(*schema.Set) - - removeUsers = expandStringList(ou.Difference(nu).List()) - addUsers = expandStringList(nu.Difference(ou).List()) - - os, ns := d.GetChange("iam_service_ids") - osi := os.(*schema.Set) - nsi := ns.(*schema.Set) - - removeServiceids = expandStringList(osi.Difference(nsi).List()) - addServiceids = expandStringList(nsi.Difference(osi).List()) - - if len(addUsers) > 0 || len(addServiceids) > 0 && !d.IsNewResource() { - var userids, serviceids []string - userids, err = flattenUserIds(accountID, addUsers, meta) - if err != nil { - return diag.FromErr(err) - } - - serviceids, err = flattenServiceIds(addServiceids, meta) - if err != nil { - return diag.FromErr(err) - } - members := prepareMemberAddRequest(iamAccessGroupsClient, userids, serviceids) - - addMembersToAccessGroupOptions := iamAccessGroupsClient.NewAddMembersToAccessGroupOptions(grpID) - addMembersToAccessGroupOptions.SetMembers(members) - membership, detailResponse, err := iamAccessGroupsClient.AddMembersToAccessGroup(addMembersToAccessGroupOptions) - if err != nil || membership == nil { - return diag.FromErr(fmt.Errorf("Error updating members to group(%s). API response: %s", grpID, detailResponse)) - } - - } - if len(removeUsers) > 0 || len(removeServiceids) > 0 && !d.IsNewResource() { - iamClient, err := meta.(ClientSession).IAMIdentityV1API() - if err != nil { - return diag.FromErr(err) - } - for _, u := range removeUsers { - ibmUniqueId, err := getIBMUniqueId(accountID, u, meta) - if err != nil { - return diag.FromErr(err) - } - removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, ibmUniqueId) - _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) - if err != nil { - return diag.FromErr(err) - } - - } - - for _, s := range removeServiceids { - getServiceIDOptions := iamidentityv1.GetServiceIDOptions{ - ID: &s, - } - serviceID, resp, err := iamClient.GetServiceID(&getServiceIDOptions) - if err != nil || serviceID == nil { - return diag.FromErr(fmt.Errorf("ERROR] Error Getting Service Ids %s %s", err, resp)) - } - removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, *serviceID.IamID) - detailResponse, err := iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) - if err != nil { - return diag.FromErr(fmt.Errorf("Error removing members to group(%s). API Response: %s", grpID, detailResponse)) - } - - } - } - - return resourceIBMIAMAccessGroupMembersRead(context, d, meta) - -} - -func resourceIBMIAMAccessGroupMembersDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() - if err != nil { - return diag.FromErr(err) - } - - parts, err := idParts(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - grpID := parts[0] - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - - users := expandStringList(d.Get("ibm_ids").(*schema.Set).List()) - - for _, name := range users { - - ibmUniqueID, err := getIBMUniqueId(userDetails.userAccount, name, meta) - if err != nil { - return diag.FromErr(err) - } - - removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, ibmUniqueID) - _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) - if err != nil { - return diag.FromErr(err) - } - - } - - services := expandStringList(d.Get("iam_service_ids").(*schema.Set).List()) - - for _, id := range services { - serviceID, err := getServiceID(id, meta) - if err != nil { - return diag.FromErr(err) - } - - removeMembersFromAccessGroupOptions := &iamaccessgroupsv2.RemoveMemberFromAccessGroupOptions{ - AccessGroupID: &grpID, - IamID: serviceID.IamID, - } - _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) - if err != nil { - return diag.FromErr(err) - } - } - - d.SetId("") - - return nil -} - -func prepareMemberAddRequest(iamAccessGroupsClient *iamaccessgroupsv2.IamAccessGroupsV2, userIds, serviceIds []string) (members []iamaccessgroupsv2.AddGroupMembersRequestMembersItem) { - members = make([]iamaccessgroupsv2.AddGroupMembersRequestMembersItem, len(userIds)+len(serviceIds)) - var i = 0 - userType := "user" - serviceType := "service" - for _, id := range userIds { - membersItem, err := iamAccessGroupsClient.NewAddGroupMembersRequestMembersItem(id, userType) - if err != nil { - log.Printf("Error in preparing membership data. %s", err) - } - members[i] = *membersItem - i++ - } - - for _, id := range serviceIds { - membersItem, err := iamAccessGroupsClient.NewAddGroupMembersRequestMembersItem(id, serviceType) - if err != nil || membersItem == nil { - log.Printf("Error in preparing membership data. %s", err) - } - members[i] = *membersItem - i++ - } - return -} - -func getServiceID(id string, meta interface{}) (iamidentityv1.ServiceID, error) { - serviceids := iamidentityv1.ServiceID{} - iamClient, err := meta.(ClientSession).IAMIdentityV1API() - if err != nil { - return serviceids, err - } - getServiceIDOptions := iamidentityv1.GetServiceIDOptions{ - ID: &id, - } - serviceID, resp, err := iamClient.GetServiceID(&getServiceIDOptions) - if err != nil || serviceID == nil { - return serviceids, fmt.Errorf("ERROR] Error Getting Service Ids %s %s", err, resp) - } - return *serviceID, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_policy.go deleted file mode 100644 index 7a05a4605e..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_policy.go +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "time" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceIBMIAMAccessGroupPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMIAMAccessGroupPolicyCreate, - Read: resourceIBMIAMAccessGroupPolicyRead, - Update: resourceIBMIAMAccessGroupPolicyUpdate, - Delete: resourceIBMIAMAccessGroupPolicyDelete, - Exists: resourceIBMIAMAccessGroupPolicyExists, - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - resources, resourceAttributes, err := importAccessGroupPolicy(d, meta) - if err != nil { - return nil, fmt.Errorf("Error reading resource ID: %s", err) - } - d.Set("resources", resources) - d.Set("resource_attributes", resourceAttributes) - return []*schema.ResourceData{d}, nil - }, - }, - - Schema: map[string]*schema.Schema{ - "access_group_id": { - Type: schema.TypeString, - Required: true, - Description: "ID of access group", - ForceNew: true, - }, - - "roles": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "Role names of the policy definition", - }, - - "resources": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - ConflictsWith: []string{"account_management", "resource_attributes"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "service": { - Type: schema.TypeString, - Optional: true, - Description: "Service name of the policy definition", - }, - - "resource_instance_id": { - Type: schema.TypeString, - Optional: true, - Description: "ID of resource instance of the policy definition", - }, - - "region": { - Type: schema.TypeString, - Optional: true, - Description: "Region of the policy definition", - }, - - "resource_type": { - Type: schema.TypeString, - Optional: true, - Description: "Resource type of the policy definition", - }, - - "resource": { - Type: schema.TypeString, - Optional: true, - Description: "Resource of the policy definition", - }, - - "resource_group_id": { - Type: schema.TypeString, - Optional: true, - Description: "ID of the resource group.", - }, - - "service_type": { - Type: schema.TypeString, - Optional: true, - Description: "Service type of the policy definition", - }, - - "attributes": { - Type: schema.TypeMap, - Optional: true, - Description: "Set resource attributes in the form of 'name=value,name=value....", - Elem: schema.TypeString, - }, - }, - }, - }, - - "resource_attributes": { - Type: schema.TypeSet, - Optional: true, - Description: "Set resource attributes.", - ConflictsWith: []string{"resources", "account_management"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "Name of attribute.", - }, - "value": { - Type: schema.TypeString, - Required: true, - Description: "Value of attribute.", - }, - "operator": { - Type: schema.TypeString, - Optional: true, - Default: "stringEquals", - Description: "Operator of attribute.", - }, - }, - }, - }, - "account_management": { - Type: schema.TypeBool, - Default: false, - Optional: true, - Description: "Give access to all account management services", - ConflictsWith: []string{"resources", "resource_attributes"}, - }, - - "tags": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "version": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} - -func resourceIBMIAMAccessGroupPolicyCreate(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - accessGroupId := d.Get("access_group_id").(string) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - var policyOptions iampolicymanagementv1.CreatePolicyOptions - policyOptions, err = generatePolicyOptions(d, meta) - if err != nil { - return err - } - - // Keep configuring the policy options by adding subject part - accessGroupIdSubject := &iampolicymanagementv1.PolicySubject{ - Attributes: []iampolicymanagementv1.SubjectAttribute{ - { - Name: core.StringPtr("access_group_id"), - Value: &accessGroupId, - }, - }, - } - - accountIdResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("accountId"), - Value: &userDetails.userAccount, - } - - policyResource := &iampolicymanagementv1.PolicyResource{ - Attributes: append(policyOptions.Resources[0].Attributes, *accountIdResourceAttribute), - } - - createPolicyOptions := iamPolicyManagementClient.NewCreatePolicyOptions( - "access", - []iampolicymanagementv1.PolicySubject{*accessGroupIdSubject}, - policyOptions.Roles, - []iampolicymanagementv1.PolicyResource{*policyResource}, - ) - - accessGroupPolicy, res, err := iamPolicyManagementClient.CreatePolicy(createPolicyOptions) - if err != nil || accessGroupPolicy == nil { - return fmt.Errorf("Error creating access group policy: %s\n%s", err, res) - } - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: accessGroupPolicy.ID, - } - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - var err error - policy, res, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil || policy == nil { - if res != nil && res.StatusCode == 404 { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - - if isResourceTimeoutError(err) { - _, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) - } - if err != nil { - d.SetId(fmt.Sprintf("%s/%s", accessGroupId, *accessGroupPolicy.ID)) - return fmt.Errorf("Error fetching access group policy: %s\n%s", err, res) - } - d.SetId(fmt.Sprintf("%s/%s", accessGroupId, *accessGroupPolicy.ID)) - - return resourceIBMIAMAccessGroupPolicyRead(d, meta) -} - -func resourceIBMIAMAccessGroupPolicyRead(d *schema.ResourceData, meta interface{}) error { - - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - parts, err := idParts(d.Id()) - if err != nil { - return err - } - accessGroupId := parts[0] - accessGroupPolicyId := parts[1] - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: &accessGroupPolicyId, - } - accessGroupPolicy := &iampolicymanagementv1.Policy{} - res := &core.DetailedResponse{} - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - var err error - accessGroupPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil || accessGroupPolicy == nil { - if res != nil && res.StatusCode == 404 { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - - if isResourceTimeoutError(err) { - accessGroupPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) - } - if err != nil || accessGroupPolicy == nil { - return fmt.Errorf("Error retrieving access group policy: %s\n%s", err, res) - } - - retrievedAttribute := getSubjectAttribute("access_group_id", accessGroupPolicy.Subjects[0]) - if accessGroupId != *retrievedAttribute { - return fmt.Errorf("Policy %s does not belong to access group %s, retrievedAttr: %s", accessGroupPolicyId, accessGroupId, *retrievedAttribute) - } - - d.Set("access_group_id", accessGroupId) - roles := make([]string, len(accessGroupPolicy.Roles)) - for i, role := range accessGroupPolicy.Roles { - roles[i] = *role.DisplayName - } - d.Set("roles", roles) - d.Set("version", res.Headers.Get("ETag")) - - if _, ok := d.GetOk("resources"); ok { - d.Set("resources", flattenPolicyResource(accessGroupPolicy.Resources)) - } - if _, ok := d.GetOk("resource_attributes"); ok { - d.Set("resource_attributes", flattenPolicyResourceAttributes(accessGroupPolicy.Resources)) - } - if len(accessGroupPolicy.Resources) > 0 { - if *getResourceAttribute("serviceType", accessGroupPolicy.Resources[0]) == "service" { - d.Set("account_management", false) - } - if *getResourceAttribute("serviceType", accessGroupPolicy.Resources[0]) == "platform_service" { - d.Set("account_management", true) - } - } - - return nil -} - -func resourceIBMIAMAccessGroupPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") { - parts, err := idParts(d.Id()) - if err != nil { - return err - } - accessGroupId := parts[0] - accessGroupPolicyId := parts[1] - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - var policyOptions iampolicymanagementv1.CreatePolicyOptions - policyOptions, err = generatePolicyOptions(d, meta) - if err != nil { - return err - } - - accessGroupIdSubject := &iampolicymanagementv1.PolicySubject{ - Attributes: []iampolicymanagementv1.SubjectAttribute{ - { - Name: core.StringPtr("access_group_id"), - Value: &accessGroupId, - }, - }, - } - - accountIdResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("accountId"), - Value: &userDetails.userAccount, - } - - policyResource := &iampolicymanagementv1.PolicyResource{ - Attributes: append(policyOptions.Resources[0].Attributes, *accountIdResourceAttribute), - } - - updatePolicyOptions := iamPolicyManagementClient.NewUpdatePolicyOptions( - accessGroupPolicyId, - d.Get("version").(string), - "access", - []iampolicymanagementv1.PolicySubject{*accessGroupIdSubject}, - policyOptions.Roles, - []iampolicymanagementv1.PolicyResource{*policyResource}, - ) - - _, res, err := iamPolicyManagementClient.UpdatePolicy(updatePolicyOptions) - if err != nil { - return fmt.Errorf("Error updating access group policy: %s\n%s", err, res) - } - } - - return resourceIBMIAMAccessGroupPolicyRead(d, meta) -} - -func resourceIBMIAMAccessGroupPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - parts, err := idParts(d.Id()) - if err != nil { - return err - } - - accessGroupPolicyId := parts[1] - - deletePolicyOptions := iamPolicyManagementClient.NewDeletePolicyOptions( - accessGroupPolicyId, - ) - - res, err := iamPolicyManagementClient.DeletePolicy(deletePolicyOptions) - if err != nil { - return fmt.Errorf("Error deleting access group policy: %s\n%s", err, res) - } - - d.SetId("") - - return nil -} - -func resourceIBMIAMAccessGroupPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return false, err - } - parts, err := idParts(d.Id()) - if err != nil { - return false, err - } - if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of accessGroupID/PolicyID", d.Id()) - } - - accessGroupPolicyId := parts[1] - - getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( - accessGroupPolicyId, - ) - - accessGroupPolicy, resp, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil || accessGroupPolicy == nil { - if resp != nil && resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("[ERROR] Error getting access group policy: %s\n%s", err, resp) - } - - if accessGroupPolicy != nil && accessGroupPolicy.State != nil && *accessGroupPolicy.State == "deleted" { - return false, nil - } - - tempID := fmt.Sprintf("%s/%s", *getSubjectAttribute("access_group_id", accessGroupPolicy.Subjects[0]), *accessGroupPolicy.ID) - - return tempID == d.Id(), nil -} -func importAccessGroupPolicy(d *schema.ResourceData, meta interface{}) (interface{}, interface{}, error) { - - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return nil, nil, err - } - - parts, err := idParts(d.Id()) - if err != nil { - return nil, nil, err - } - accgrpPolicyID := parts[1] - - getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( - accgrpPolicyID, - ) - - accessGroupPolicy, res, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil { - return nil, nil, fmt.Errorf("Error retrieving access group policy: %s\n%s", err, res) - } - - resources := flattenPolicyResource(accessGroupPolicy.Resources) - resource_attributes := flattenPolicyResourceAttributes(accessGroupPolicy.Resources) - - return resources, resource_attributes, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_authorization_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_authorization_policy.go deleted file mode 100644 index 49035f5fce..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_authorization_policy.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceIBMIAMAuthorizationPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMIAMAuthorizationPolicyCreate, - Read: resourceIBMIAMAuthorizationPolicyRead, - Update: resourceIBMIAMAuthorizationPolicyUpdate, - Delete: resourceIBMIAMAuthorizationPolicyDelete, - Exists: resourceIBMIAMAuthorizationPolicyExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "source_service_name": { - Type: schema.TypeString, - Required: true, - Description: "The source service name", - ForceNew: true, - }, - - "target_service_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "The target service name", - }, - - "roles": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "Role names of the policy definition", - }, - - "source_resource_instance_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "The source resource instance Id", - }, - - "target_resource_instance_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "The target resource instance Id", - }, - - "source_resource_group_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "The source resource group Id", - }, - - "target_resource_group_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "The target resource group Id", - }, - - "source_resource_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Resource type of source service", - }, - - "target_resource_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Resource type of target service", - }, - - "source_service_account": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - Description: "Account GUID of source service", - }, - - "version": { - Type: schema.TypeString, - Computed: true, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Description of the Policy", - }, - }, - } -} - -func resourceIBMIAMAuthorizationPolicyCreate(d *schema.ResourceData, meta interface{}) error { - sourceServiceName := d.Get("source_service_name").(string) - targetServiceName := d.Get("target_service_name").(string) - policyType := "authorization" - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - iampapClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - sourceServiceAccount := userDetails.userAccount - - if account, ok := d.GetOk("source_service_account"); ok { - sourceServiceAccount = account.(string) - } - - accountIdSubjectAttribute := &iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("accountId"), - Value: &sourceServiceAccount, - } - serviceNameSubjectAttribute := &iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("serviceName"), - Value: &sourceServiceName, - } - - policySubject := &iampolicymanagementv1.PolicySubject{ - Attributes: []iampolicymanagementv1.SubjectAttribute{*accountIdSubjectAttribute, *serviceNameSubjectAttribute}, - } - - accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("accountId"), - Value: core.StringPtr(userDetails.userAccount), - Operator: core.StringPtr("stringEquals"), - } - - serviceNameResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("serviceName"), - Value: core.StringPtr(targetServiceName), - Operator: core.StringPtr("stringEquals"), - } - - policyResource := &iampolicymanagementv1.PolicyResource{ - Attributes: []iampolicymanagementv1.ResourceAttribute{*accountIDResourceAttribute, *serviceNameResourceAttribute}, - } - - if sID, ok := d.GetOk("source_resource_instance_id"); ok { - serviceInstanceSubjectAttribute := iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("serviceInstance"), - Value: core.StringPtr(sID.(string)), - } - policySubject.Attributes = append(policySubject.Attributes, serviceInstanceSubjectAttribute) - } - - if tID, ok := d.GetOk("target_resource_instance_id"); ok { - serviceInstanceResourceAttribute := iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("serviceInstance"), - Value: core.StringPtr(tID.(string)), - } - policyResource.Attributes = append(policyResource.Attributes, serviceInstanceResourceAttribute) - } - - if sType, ok := d.GetOk("source_resource_type"); ok { - resourceTypeSubjectAttribute := iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("resourceType"), - Value: core.StringPtr(sType.(string)), - } - policySubject.Attributes = append(policySubject.Attributes, resourceTypeSubjectAttribute) - } - - if tType, ok := d.GetOk("target_resource_type"); ok { - resourceTypeResourceAttribute := iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("resourceType"), - Value: core.StringPtr(tType.(string)), - } - policyResource.Attributes = append(policyResource.Attributes, resourceTypeResourceAttribute) - } - - if sResGrpID, ok := d.GetOk("source_resource_group_id"); ok { - resourceGroupSubjectAttribute := iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("resourceGroupId"), - Value: core.StringPtr(sResGrpID.(string)), - } - policySubject.Attributes = append(policySubject.Attributes, resourceGroupSubjectAttribute) - } - - if tResGrpID, ok := d.GetOk("target_resource_group_id"); ok { - resourceGroupResourceAttribute := iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("resourceGroupId"), - Value: core.StringPtr(tResGrpID.(string)), - } - policyResource.Attributes = append(policyResource.Attributes, resourceGroupResourceAttribute) - } - - listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ - ServiceName: &targetServiceName, - SourceServiceName: &sourceServiceName, - PolicyType: &policyType, - } - roleList, resp, err := iampapClient.ListRoles(listRoleOptions) - - if err != nil || roleList == nil { - return fmt.Errorf("[ERROR] Error in listing roles %s, %s", err, resp) - } - - policyRoles := mapRoleListToPolicyRoles(*roleList) - roles, err := getRolesFromRoleNames(expandStringList(d.Get("roles").([]interface{})), policyRoles) - - if err != nil { - return err - } - - createPolicyOptions := iampapClient.NewCreatePolicyOptions( - "authorization", - []iampolicymanagementv1.PolicySubject{*policySubject}, - roles, - []iampolicymanagementv1.PolicyResource{*policyResource}, - ) - - if description, ok := d.GetOk("description"); ok { - des := description.(string) - createPolicyOptions.Description = &des - } - - authPolicy, resp, err := iampapClient.CreatePolicy(createPolicyOptions) - if err != nil { - return fmt.Errorf("[ERROR] Error creating authorization policy: %s %s", err, resp) - } - - d.SetId(*authPolicy.ID) - - return resourceIBMIAMAuthorizationPolicyRead(d, meta) -} - -func resourceIBMIAMAuthorizationPolicyRead(d *schema.ResourceData, meta interface{}) error { - - iampapClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: core.StringPtr(d.Id()), - } - - authorizationPolicy, resp, err := iampapClient.GetPolicy(getPolicyOptions) - if err != nil { - return fmt.Errorf("[ERROR] Error retrieving authorizationPolicy: %s %s", err, resp) - } - roles := make([]string, len(authorizationPolicy.Roles)) - for i, role := range authorizationPolicy.Roles { - roles[i] = *role.DisplayName - } - if authorizationPolicy.Description != nil { - d.Set("description", *authorizationPolicy.Description) - } - d.Set("roles", roles) - source := authorizationPolicy.Subjects[0] - target := authorizationPolicy.Resources[0] - d.Set("source_service_name", getSubjectAttribute("serviceName", source)) - d.Set("target_service_name", getResourceAttribute("serviceName", target)) - d.Set("source_resource_instance_id", getSubjectAttribute("serviceInstance", source)) - d.Set("target_resource_instance_id", getResourceAttribute("serviceInstance", target)) - d.Set("source_resource_type", getSubjectAttribute("resourceType", source)) - d.Set("target_resource_type", getResourceAttribute("resourceType", target)) - d.Set("source_service_account", getSubjectAttribute("accountId", source)) - d.Set("source_resource_group_id", getSubjectAttribute("resourceGroupId", source)) - d.Set("target_resource_group_id", getResourceAttribute("resourceGroupId", target)) - return nil -} - -// Returns nil, because ibmcloud iam cli authoirization policy does not have an update command -func resourceIBMIAMAuthorizationPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - return nil -} - -func resourceIBMIAMAuthorizationPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iampapClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - authorizationPolicyID := d.Id() - - deletePolicyOptions := &iampolicymanagementv1.DeletePolicyOptions{ - PolicyID: core.StringPtr(authorizationPolicyID), - } - resp, err := iampapClient.DeletePolicy(deletePolicyOptions) - if err != nil { - log.Printf( - "Error deleting authorization policy: %s, %s", err, resp) - } - - d.SetId("") - - return nil -} - -func resourceIBMIAMAuthorizationPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iampapClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return false, err - } - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: core.StringPtr(d.Id()), - } - authorizationPolicy, resp, err := iampapClient.GetPolicy(getPolicyOptions) - if err != nil || authorizationPolicy == nil { - if resp != nil && resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("[ERROR] Error getting authorisation policy: %s\n%s", err, resp) - } - - if authorizationPolicy != nil && authorizationPolicy.State != nil && *authorizationPolicy.State == "deleted" { - return false, nil - } - - return *authorizationPolicy.ID == d.Id(), nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_custom_role.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_custom_role.go deleted file mode 100644 index 5561ce7879..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_custom_role.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "strings" - - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - iamCRDisplayName = "display_name" - iamCRName = "name" - iamCRDescription = "description" - iamCRActions = "actions" - iamCRServiceName = "service" -) - -func resourceIBMIAMCustomRole() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMIAMCustomRoleCreate, - Read: resourceIBMIAMCustomRoleRead, - Update: resourceIBMIAMCustomRoleUpdate, - Delete: resourceIBMIAMCustomRoleDelete, - Exists: resourceIBMIAMCustomRoleExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - iamCRDisplayName: { - Type: schema.TypeString, - Required: true, - Description: "Display Name of the Custom Role", - ValidateFunc: InvokeValidator("ibm_iam_custom_role", iamCRDisplayName), - }, - - iamCRName: { - Type: schema.TypeString, - Required: true, - Description: "The name of the custom Role", - ForceNew: true, - ValidateFunc: InvokeValidator("ibm_iam_custom_role", iamCRName), - }, - iamCRDescription: { - Type: schema.TypeString, - Optional: true, - Description: "The description of the role", - ValidateFunc: InvokeValidator("ibm_iam_custom_role", iamCRDescription), - }, - iamCRServiceName: { - Type: schema.TypeString, - Required: true, - Description: "The Service Name", - ForceNew: true, - }, - iamCRActions: { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The actions of the role", - }, - "crn": { - Type: schema.TypeString, - Computed: true, - Description: "crn of the Custom Role", - }, - ResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "The name of the resource", - }, - - ResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - ResourceControllerURL: { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - }, - }, - } -} - -func resourceIBMIAMCustomRoleValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: iamCRName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Optional: true, - Regexp: `^[A-Z]{1}[A-Za-z0-9]{0,29}$`, - MinValueLength: 1, - MaxValueLength: 30}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: iamCRDisplayName, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, - Optional: true, - MinValueLength: 1, - MaxValueLength: 50}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: iamCRDescription, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, - Optional: true, - MinValueLength: 1, - MaxValueLength: 250}) - - ibmIAMCustomRoleResourceValidator := ResourceValidator{ResourceName: "ibm_iam_custom_role", Schema: validateSchema} - return &ibmIAMCustomRoleResourceValidator -} - -func resourceIBMIAMCustomRoleCreate(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - displayName := d.Get(iamCRDisplayName).(string) - name := d.Get(iamCRName).(string) - description := d.Get(iamCRDescription).(string) - serviceName := d.Get(iamCRServiceName).(string) - actionList := expandStringList(d.Get(iamCRActions).([]interface{})) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - roleOptions := &iampolicymanagementv1.CreateRoleOptions{ - DisplayName: &displayName, - Actions: actionList, - Name: &name, - AccountID: &userDetails.userAccount, - ServiceName: &serviceName, - Description: &description, - } - - role, response, err := iamPolicyManagementClient.CreateRole(roleOptions) - if err != nil || role == nil { - return fmt.Errorf("Error creating Custom Roles: %s\n%s", err, response) - } - - d.SetId(*role.ID) - - return resourceIBMIAMCustomRoleRead(d, meta) -} - -func resourceIBMIAMCustomRoleRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - roleID := d.Id() - roleOptions := &iampolicymanagementv1.GetRoleOptions{ - RoleID: &roleID, - } - - role, response, err := iamPolicyManagementClient.GetRole(roleOptions) - if err != nil || role == nil { - if response != nil && response.StatusCode == 404 { - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving Custom Roles: %s\n%s", err, response) - } - - d.Set(iamCRDisplayName, role.DisplayName) - d.Set(iamCRName, role.Name) - d.Set(iamCRDescription, role.Description) - d.Set(iamCRServiceName, role.ServiceName) - d.Set(iamCRActions, role.Actions) - d.Set("crn", role.CRN) - - d.Set(ResourceName, role.Name) - d.Set(ResourceCRN, role.CRN) - rcontroller, err := getBaseController(meta) - if err != nil { - return err - } - - d.Set(ResourceControllerURL, rcontroller+"/iam/roles") - - return nil -} - -func resourceIBMIAMCustomRoleUpdate(d *schema.ResourceData, meta interface{}) error { - - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - roleID := d.Id() - - updatedDescription := d.Get(iamCRDescription).(string) - updatedActions := expandStringList(d.Get(iamCRActions).([]interface{})) - updatedDisplayName := d.Get(iamCRDisplayName).(string) - - if d.HasChange("display_name") || d.HasChange("description") || d.HasChange("actions") { - roleGetOptions := &iampolicymanagementv1.GetRoleOptions{ - RoleID: &roleID, - } - - role, response, err := iamPolicyManagementClient.GetRole(roleGetOptions) - if err != nil || role == nil { - if response != nil && response.StatusCode == 404 { - d.SetId("") - return nil - } - return fmt.Errorf("Error retrieving Custom Roles: %s\n%s", err, response) - } - - roleETag := response.Headers.Get("ETag") - roleUpdateOptions := &iampolicymanagementv1.UpdateRoleOptions{ - RoleID: &roleID, - IfMatch: &roleETag, - DisplayName: &updatedDisplayName, - Description: &updatedDescription, - Actions: updatedActions, - } - - _, response, err = iamPolicyManagementClient.UpdateRole(roleUpdateOptions) - if err != nil { - return fmt.Errorf("Error updating Custom Roles: %s\n%s", err, response) - } - } - - return resourceIBMIAMCustomRoleRead(d, meta) -} - -func resourceIBMIAMCustomRoleDelete(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - roleID := d.Id() - roleDeleteOptions := &iampolicymanagementv1.DeleteRoleOptions{ - RoleID: &roleID, - } - - response, err := iamPolicyManagementClient.DeleteRole(roleDeleteOptions) - if err != nil && !strings.Contains(err.Error(), "404") { - return fmt.Errorf("Error deleting Custom Roles: %s\n%s", err, response) - } - - d.SetId("") - - return nil -} - -func resourceIBMIAMCustomRoleExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return false, err - } - roleID := d.Id() - - roleGetOptions := &iampolicymanagementv1.GetRoleOptions{ - RoleID: &roleID, - } - - role, response, err := iamPolicyManagementClient.GetRole(roleGetOptions) - if err != nil { - if response != nil && response.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("Error retrieving Custom Roles: %s\n%s", err, response) - } - - return *role.ID == roleID, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_policy.go deleted file mode 100644 index 64e4e763af..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_policy.go +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "time" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceIBMIAMUserPolicy() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMIAMUserPolicyCreate, - Read: resourceIBMIAMUserPolicyRead, - Update: resourceIBMIAMUserPolicyUpdate, - Delete: resourceIBMIAMUserPolicyDelete, - Exists: resourceIBMIAMUserPolicyExists, - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - resources, resourceAttributes, err := importServicePolicy(d, meta) - if err != nil { - return nil, fmt.Errorf("Error reading resource ID: %s", err) - } - d.Set("resources", resources) - d.Set("resource_attributes", resourceAttributes) - return []*schema.ResourceData{d}, nil - }, - }, - Schema: map[string]*schema.Schema{ - - "ibm_id": { - Description: "The ibm id or email of user", - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "roles": { - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "Role names of the policy definition", - }, - - "resources": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - ConflictsWith: []string{"account_management", "resource_attributes"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "service": { - Type: schema.TypeString, - Optional: true, - Description: "Service name of the policy definition", - }, - - "resource_instance_id": { - Type: schema.TypeString, - Optional: true, - Description: "ID of resource instance of the policy definition", - }, - - "region": { - Type: schema.TypeString, - Optional: true, - Description: "Region of the policy definition", - }, - - "resource_type": { - Type: schema.TypeString, - Optional: true, - Description: "Resource type of the policy definition", - }, - - "resource": { - Type: schema.TypeString, - Optional: true, - Description: "Resource of the policy definition", - }, - - "resource_group_id": { - Type: schema.TypeString, - Optional: true, - Description: "ID of the resource group.", - }, - - "service_type": { - Type: schema.TypeString, - Optional: true, - Description: "Service type of the policy definition", - }, - - "attributes": { - Type: schema.TypeMap, - Optional: true, - Description: "Set resource attributes in the form of 'name=value,name=value....", - Elem: schema.TypeString, - }, - }, - }, - }, - - "resource_attributes": { - Type: schema.TypeSet, - Optional: true, - Description: "Set resource attributes.", - ConflictsWith: []string{"resources", "account_management"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "Name of attribute.", - }, - "value": { - Type: schema.TypeString, - Required: true, - Description: "Value of attribute.", - }, - "operator": { - Type: schema.TypeString, - Optional: true, - Default: "stringEquals", - Description: "Operator of attribute.", - }, - }, - }, - }, - "account_management": { - Type: schema.TypeBool, - Default: false, - Optional: true, - Description: "Give access to all account management services", - ConflictsWith: []string{"resources", "resource_attributes"}, - }, - - "tags": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Description of the Policy", - }, - }, - } -} - -func resourceIBMIAMUserPolicyCreate(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - var policyOptions iampolicymanagementv1.CreatePolicyOptions - policyOptions, err = generatePolicyOptions(d, meta) - - if err != nil { - return err - } - - userEmail := d.Get("ibm_id").(string) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - accountID := userDetails.userAccount - - ibmUniqueID, err := getIBMUniqueId(accountID, userEmail, meta) - if err != nil { - return err - } - - subjectAttribute := &iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("iam_id"), - Value: &ibmUniqueID, - } - - policySubjects := &iampolicymanagementv1.PolicySubject{ - Attributes: []iampolicymanagementv1.SubjectAttribute{*subjectAttribute}, - } - - accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("accountId"), - Value: core.StringPtr(accountID), - Operator: core.StringPtr("stringEquals"), - } - - policyResources := iampolicymanagementv1.PolicyResource{ - Attributes: append(policyOptions.Resources[0].Attributes, *accountIDResourceAttribute), - } - - createPolicyOptions := iamPolicyManagementClient.NewCreatePolicyOptions( - "access", - []iampolicymanagementv1.PolicySubject{*policySubjects}, - policyOptions.Roles, - []iampolicymanagementv1.PolicyResource{policyResources}, - ) - - if description, ok := d.GetOk("description"); ok { - des := description.(string) - createPolicyOptions.Description = &des - } - - userPolicy, _, err := iamPolicyManagementClient.CreatePolicy(createPolicyOptions) - - if err != nil { - return err - } - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: userPolicy.ID, - } - - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - var err error - policy, res, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - - if err != nil || policy == nil { - if res != nil && res.StatusCode == 404 { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - - if isResourceTimeoutError(err) { - _, _, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) - } - if err != nil { - d.SetId(fmt.Sprintf("%s/%s", userEmail, *userPolicy.ID)) - return fmt.Errorf("error fetching user policy: %w", err) - } - d.SetId(fmt.Sprintf("%s/%s", userEmail, *userPolicy.ID)) - - return resourceIBMIAMUserPolicyRead(d, meta) -} - -func resourceIBMIAMUserPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - parts, err := idParts(d.Id()) - if err != nil { - return err - } - - userEmail := parts[0] - userPolicyID := parts[1] - - if err != nil { - return err - } - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: core.StringPtr(userPolicyID), - } - userPolicy := &iampolicymanagementv1.Policy{} - res := &core.DetailedResponse{} - err = resource.Retry(5*time.Minute, func() *resource.RetryError { - var err error - userPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) - - if err != nil || userPolicy == nil { - if res != nil && res.StatusCode == 404 { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - - if isResourceTimeoutError(err) { - userPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) - } - if err != nil || userPolicy == nil { - return fmt.Errorf("Error retrieving userPolicy: %s %s", err, res) - } - d.Set("ibm_id", userEmail) - roles := make([]string, len(userPolicy.Roles)) - - for i, role := range userPolicy.Roles { - roles[i] = *role.DisplayName - } - d.Set("roles", roles) - if _, ok := d.GetOk("resources"); ok { - d.Set("resources", flattenPolicyResource(userPolicy.Resources)) - } - if _, ok := d.GetOk("resource_attributes"); ok { - d.Set("resource_attributes", flattenPolicyResourceAttributes(userPolicy.Resources)) - } - if len(userPolicy.Resources) > 0 { - if *getResourceAttribute("serviceType", userPolicy.Resources[0]) == "service" { - d.Set("account_management", false) - } - if *getResourceAttribute("serviceType", userPolicy.Resources[0]) == "platform_service" { - d.Set("account_management", true) - } - } - if userPolicy.Description != nil { - d.Set("description", *userPolicy.Description) - } - return nil -} - -func resourceIBMIAMUserPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") { - parts, err := idParts(d.Id()) - if err != nil { - return err - } - userEmail := parts[0] - userPolicyID := parts[1] - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - - accountID := userDetails.userAccount - - createPolicyOptions, err := generatePolicyOptions(d, meta) - if err != nil { - return err - } - - ibmUniqueID, err := getIBMUniqueId(accountID, userEmail, meta) - if err != nil { - return err - } - - accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ - Name: core.StringPtr("accountId"), - Value: core.StringPtr(accountID), - Operator: core.StringPtr("stringEquals"), - } - - policyResources := iampolicymanagementv1.PolicyResource{ - Attributes: append(createPolicyOptions.Resources[0].Attributes, *accountIDResourceAttribute), - } - - subjectAttribute := &iampolicymanagementv1.SubjectAttribute{ - Name: core.StringPtr("iam_id"), - Value: &ibmUniqueID, - } - policySubjects := &iampolicymanagementv1.PolicySubject{ - Attributes: []iampolicymanagementv1.SubjectAttribute{*subjectAttribute}, - } - - getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ - PolicyID: &userPolicyID, - } - policy, response, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil || policy == nil { - if response != nil && response.StatusCode == 404 { - return nil - } - return fmt.Errorf("Error retrieving Policy: %s\n%s", err, response) - } - - userPolicyETag := response.Headers.Get("ETag") - updatePolicyOptions := iamPolicyManagementClient.NewUpdatePolicyOptions( - userPolicyID, - userPolicyETag, - "access", - []iampolicymanagementv1.PolicySubject{*policySubjects}, - createPolicyOptions.Roles, - []iampolicymanagementv1.PolicyResource{policyResources}, - ) - - if description, ok := d.GetOk("description"); ok { - des := description.(string) - updatePolicyOptions.Description = &des - } - - policy, _, err = iamPolicyManagementClient.UpdatePolicy(updatePolicyOptions) - if err != nil { - return fmt.Errorf("Error updating user policy: %s", err) - } - } - return resourceIBMIAMUserPolicyRead(d, meta) -} - -func resourceIBMIAMUserPolicyDelete(d *schema.ResourceData, meta interface{}) error { - - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return err - } - - parts, err := idParts(d.Id()) - if err != nil { - return err - } - userPolicyID := parts[1] - - deletePolicyOptions := iamPolicyManagementClient.NewDeletePolicyOptions( - userPolicyID, - ) - _, err = iamPolicyManagementClient.DeletePolicy(deletePolicyOptions) - if err != nil { - return err - } - d.SetId("") - return nil -} - -func resourceIBMIAMUserPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return false, err - } - - parts, err := idParts(d.Id()) - if err != nil { - return false, err - } - if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of userEmail/PolicyID", d.Id()) - } - userEmail := parts[0] - userPolicyID := parts[1] - - getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( - userPolicyID, - ) - - userPolicy, resp, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil || userPolicy == nil { - if resp != nil && resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("[ERROR] Error getting user policy: %s\n%s", err, resp) - } - - if userPolicy != nil && userPolicy.State != nil && *userPolicy.State == "deleted" { - return false, nil - } - - tempID := fmt.Sprintf("%s/%s", userEmail, *userPolicy.ID) - - return tempID == d.Id(), nil -} - -func importUserPolicy(d *schema.ResourceData, meta interface{}) (interface{}, interface{}, error) { - - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() - if err != nil { - return nil, nil, err - } - parts, err := idParts(d.Id()) - if err != nil { - return nil, nil, err - } - userPolicyID := parts[1] - - getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( - userPolicyID, - ) - userPolicy, _, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) - if err != nil { - return nil, nil, fmt.Errorf("Error retrieving User Policy: %s", err) - } - resources := flattenPolicyResource(userPolicy.Resources) - resource_attributes := flattenPolicyResourceAttributes(userPolicy.Resources) - return resources, resource_attributes, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_ha.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_ha.go deleted file mode 100644 index 10f2c62298..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_ha.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "strconv" - "strings" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/minsikl/netscaler-nitro-go/client" - dt "github.com/minsikl/netscaler-nitro-go/datatypes" - "github.com/minsikl/netscaler-nitro-go/op" -) - -func resourceIBMLbVpxHa() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMLbVpxHaCreate, - Read: resourceIBMLbVpxHaRead, - Update: resourceIBMLbVpxHaUpdate, - Delete: resourceIBMLbVpxHaDelete, - Exists: resourceIBMLbVpxHaExists, - Importer: &schema.ResourceImporter{}, - Schema: map[string]*schema.Schema{ - - "primary_id": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - Description: "primary ID", - }, - "secondary_id": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - Description: "Secondary ID", - }, - "stay_secondary": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Description: "Boolean value for stay secondary", - }, - "tags": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Description: "Tags set for the resource", - }, - }, - } -} - -func configureHA(nClient1 *client.NitroClient, nClient2 *client.NitroClient, staySecondary bool) error { - // 1. VPX2 : Sync password - systemuserReq2 := dt.SystemuserReq{ - Systemuser: &dt.Systemuser{ - Username: op.String("root"), - Password: op.String(nClient1.Password), - }, - } - err := nClient2.Update(&systemuserReq2) - if err != nil { - return err - } - nClient2.Password = nClient1.Password - - // 2. VPX1 : Register hanode - hanodeReq1 := dt.HanodeReq{ - Hanode: &dt.Hanode{ - Id: op.String("2"), - Ipaddress: op.String(nClient2.IpAddress), - }, - } - - err = nClient1.Add(&hanodeReq1) - if err != nil { - return err - } - - // Wait 5 secs to make VPX1 a primary node. - time.Sleep(time.Second * 5) - - // 3. VPX2 : Register hanode - hanodeReq2 := dt.HanodeReq{ - Hanode: &dt.Hanode{ - Id: op.String("2"), - Ipaddress: op.String(nClient1.IpAddress), - }, - } - err = nClient2.Add(&hanodeReq2) - if err != nil { - return err - } - - // 4. VPX2 : Update STAYSECONDARY - stay := dt.HanodeReq{Hanode: &dt.Hanode{}} - if staySecondary { - stay.Hanode.Hastatus = op.String("STAYSECONDARY") - } else { - stay.Hanode.Hastatus = op.String("ENABLE") - } - err = nClient2.Update(&stay) - if err != nil { - return err - } - - // 5. VPX1 : Register rpcnode - nsrpcnode1 := dt.NsrpcnodeReq{ - Nsrpcnode: &dt.Nsrpcnode{ - Ipaddress: op.String(nClient1.IpAddress), - Password: op.String(nClient1.Password), - }, - } - err = nClient1.Update(&nsrpcnode1) - if err != nil { - return err - } - nsrpcnode1.Nsrpcnode.Ipaddress = op.String(nClient2.IpAddress) - err = nClient1.Update(&nsrpcnode1) - if err != nil { - return err - } - - // 6. VPX2 : Register rpcnode - nsrpcnode2 := dt.NsrpcnodeReq{ - Nsrpcnode: &dt.Nsrpcnode{ - Ipaddress: op.String(nClient1.IpAddress), - Password: op.String(nClient1.Password), - }, - } - err = nClient2.Update(&nsrpcnode2) - if err != nil { - return err - } - nsrpcnode2.Nsrpcnode.Ipaddress = op.String(nClient2.IpAddress) - err = nClient2.Update(&nsrpcnode2) - if err != nil { - return err - } - - // 7. VPX1 : Sync files - hafiles := dt.HafilesReq{ - Hafiles: &dt.Hafiles{ - Mode: []string{"all"}, - }, - } - err = nClient1.Add(&hafiles, "action=sync") - if err != nil { - return err - } - - return nil -} - -func deleteHA(nClient1 *client.NitroClient, nClient2 *client.NitroClient) error { - // 1. VPX2 : Delete hanode - err := nClient2.Delete(&dt.HanodeReq{}, "2") - if err != nil { - return err - } - - // 2. VPX1 : Delete hanode - err = nClient1.Delete(&dt.HanodeReq{}, "2") - if err != nil { - return err - } - return nil -} - -func parseHAId(id string) (int, int, error) { - if len(id) < 1 { - return 0, 0, fmt.Errorf("Failed to parse id : Unable to get netscaler Ids") - } - idList := strings.Split(id, ":") - if len(idList) != 2 || len(idList[0]) < 1 || len(idList[1]) < 1 { - return 0, 0, fmt.Errorf("Failed to parse id : Invalid HA ID") - } - primaryId, err := strconv.Atoi(idList[0]) - if err != nil { - return 0, 0, fmt.Errorf("Failed to parse id : Unable to get a primaryId %s", err) - } - secondaryId, err := strconv.Atoi(idList[1]) - if err != nil { - return 0, 0, fmt.Errorf("Failed to parse id : Unable to get a secondaryId %s", err) - } - return primaryId, secondaryId, nil -} - -func resourceIBMLbVpxHaCreate(d *schema.ResourceData, meta interface{}) error { - primaryId := d.Get("primary_id").(int) - secondaryId := d.Get("secondary_id").(int) - staySecondary := false - if stay, ok := d.GetOk("stay_secondary"); ok { - staySecondary = stay.(bool) - } - - nClientPrimary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), primaryId) - if err != nil { - return fmt.Errorf("Error getting primary netscaler information ID: %d", primaryId) - } - - nClientSecondary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), secondaryId) - if err != nil { - return fmt.Errorf("Error getting secondary netscaler information ID: %d", secondaryId) - } - - err = configureHA(nClientPrimary, nClientSecondary, staySecondary) - if err != nil { - return fmt.Errorf("Error configuration HA %s", err.Error()) - } - - d.SetId(fmt.Sprintf("%d:%d", primaryId, secondaryId)) - - log.Printf("[INFO] Netscaler HA ID: %s", d.Id()) - - return resourceIBMLbVpxHaRead(d, meta) -} - -func resourceIBMLbVpxHaRead(d *schema.ResourceData, meta interface{}) error { - primaryId, secondaryId, err := parseHAId(d.Id()) - if err != nil { - return fmt.Errorf("Error reading HA %s", err.Error()) - } - - nClientPrimary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), primaryId) - if err != nil { - return fmt.Errorf("Error getting primary netscaler information ID: %d", primaryId) - } - - nClientSecondary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), secondaryId) - if err != nil { - return fmt.Errorf("Error getting primary netscaler information ID: %d", primaryId) - } - - nClientSecondary.Password = nClientPrimary.Password - - res := dt.HanodeRes{} - err = nClientSecondary.Get(&res, "") - if err != nil { - fmt.Printf("Error getting hnode information : %s", err.Error()) - } - staySecondary := false - if *res.Hanode[0].Hastatus == "STAYSECONDARY" { - staySecondary = true - } - - d.Set("primary_id", primaryId) - d.Set("secondary_id", secondaryId) - d.Set("stay_secondary", staySecondary) - - return nil -} - -func resourceIBMLbVpxHaUpdate(d *schema.ResourceData, meta interface{}) error { - primaryId, secondaryId, err := parseHAId(d.Id()) - if err != nil { - return fmt.Errorf("Error deleting HA %s", err.Error()) - } - - nClientPrimary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), primaryId) - if err != nil { - return fmt.Errorf("Error getting primary netscaler information ID: %d", primaryId) - } - - nClientSecondary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), secondaryId) - if err != nil { - return fmt.Errorf("Error getting secondary netscaler information ID: %d", secondaryId) - } - - nClientSecondary.Password = nClientPrimary.Password - - staySecondary := false - if stay, ok := d.GetOk("stay_secondary"); ok { - staySecondary = stay.(bool) - } - - stay := dt.HanodeReq{Hanode: &dt.Hanode{}} - if staySecondary { - stay.Hanode.Hastatus = op.String("STAYSECONDARY") - } else { - stay.Hanode.Hastatus = op.String("ENABLE") - } - - err = nClientSecondary.Update(&stay) - if err != nil { - return err - } - - return nil -} - -func resourceIBMLbVpxHaDelete(d *schema.ResourceData, meta interface{}) error { - primaryId, secondaryId, err := parseHAId(d.Id()) - if err != nil { - return fmt.Errorf("Error deleting HA %s", err.Error()) - } - nClientPrimary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), primaryId) - if err != nil { - return fmt.Errorf("Error getting primary netscaler information ID: %d", primaryId) - } - nClientSecondary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), secondaryId) - if err != nil { - return fmt.Errorf("Error getting secondary netscaler information ID: %d", secondaryId) - } - - secondaryPassword := nClientSecondary.Password - nClientSecondary.Password = nClientPrimary.Password - err = deleteHA(nClientPrimary, nClientSecondary) - if err != nil { - return fmt.Errorf("Error deleting HA %s", err.Error()) - } - - // Restore password of the secondary VPX - systemuserReq := dt.SystemuserReq{ - Systemuser: &dt.Systemuser{ - Username: op.String("root"), - Password: op.String(secondaryPassword), - }, - } - err = nClientSecondary.Update(&systemuserReq) - if err != nil { - return err - } - - return nil -} - -func resourceIBMLbVpxHaExists(d *schema.ResourceData, meta interface{}) (bool, error) { - primaryId, _, err := parseHAId(d.Id()) - if err != nil { - return false, fmt.Errorf("Error reading HA %s", err.Error()) - } - - nClientPrimary, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), primaryId) - if err != nil { - return false, fmt.Errorf("Error getting primary netscaler information ID in Exist: %d", primaryId) - } - - res := dt.HanodeRes{} - err = nClientPrimary.Get(&res, "") - if err != nil { - return false, fmt.Errorf("Error getting hnode information in Exist: %s", err.Error()) - } - - if len(res.Hanode) < 2 { - return false, nil - } - - return true, nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_org.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_org.go deleted file mode 100644 index 4865f2d6cc..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_org.go +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "errors" - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" - "github.com/IBM-Cloud/bluemix-go/bmxerror" - "github.com/IBM-Cloud/bluemix-go/helpers" -) - -var ( - errManagerRoleAssociation = errors.New("please remove your email from the manager role and try again. " + - "This is done to avoid spurious diffs because a user creating an organization gets the manager role by default.") - - errUserRoleAssociation = errors.New("please remove your email from the user role and try again. " + - "This is done to avoid spurious diffs because a user creating an organization automatically gets the userrole by default.") -) - -func resourceIBMOrg() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMOrgCreate, - Read: resourceIBMOrgRead, - Delete: resourceIBMOrgDelete, - Update: resourceIBMOrgUpdate, - Exists: resourceIBMOrgExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "name": { - Description: "Org name, for example myorg@domain", - Type: schema.TypeString, - Required: true, - }, - "org_quota_definition_guid": { - Description: "Org quota guid", - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "billing_managers": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have billing manager role in this org, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - "managers": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have manager role in this org, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - "auditors": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have auditor role in this org, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - "users": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have user role in this org, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - - "tags": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} -func resourceIBMOrgCreate(d *schema.ResourceData, meta interface{}) error { - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - orgAPI := cfAPI.Organizations() - orgName := d.Get("name").(string) - req := mccpv2.OrgCreateRequest{ - Name: orgName, - } - if orgQuotaDefinitionGUID, ok := d.GetOk("org_quota_definition_guid"); ok { - req.OrgQuotaDefinitionGUID = orgQuotaDefinitionGUID.(string) - } - orgFields, err := orgAPI.Create(req) - if err != nil { - return fmt.Errorf("Error creating organisation: %s", err) - } - orgGUID := orgFields.Metadata.GUID - d.SetId(orgGUID) - - return resourceIBMOrgUpdate(d, meta) -} - -func resourceIBMOrgRead(d *schema.ResourceData, meta interface{}) error { - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - orgAPI := cfAPI.Organizations() - id := d.Id() - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - orgOwnerID := userDetails.userEmail - orgFields, err := orgAPI.Get(id) - if err != nil { - return fmt.Errorf("Error retrieving organisation: %s", err) - } - d.Set("name", orgFields.Entity.Name) - billingManager, err := orgAPI.ListBillingManager(id) - if err != nil { - return fmt.Errorf("Error retrieving billing manager in the org: %s", err) - } - managers, err := orgAPI.ListManager(id) - if err != nil { - return fmt.Errorf("Error retrieving managers in the org: %s", err) - } - auditors, err := orgAPI.ListAuditors(id) - if err != nil { - return fmt.Errorf("Error retrieving auditors in space: %s", err) - } - users, err := orgAPI.ListUsers(id) - if err != nil { - return fmt.Errorf("Error retrieving users in space: %s", err) - } - if len(auditors) > 0 { - d.Set("auditors", flattenOrgRole(auditors, "")) - } - if len(managers) > 0 { - d.Set("managers", flattenOrgRole(managers, orgOwnerID)) - } - if len(billingManager) > 0 { - d.Set("billing_managers", flattenOrgRole(billingManager, "")) - } - if len(users) > 0 { - d.Set("users", flattenOrgRole(users, orgOwnerID)) - } - if orgFields.Entity.OrgQuotaDefinitionGUID != "" { - d.Set("org_quota_definition_guid", orgFields.Entity.OrgQuotaDefinitionGUID) - } - return nil -} - -func resourceIBMOrgUpdate(d *schema.ResourceData, meta interface{}) error { - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - orgAPI := cfAPI.Organizations() - id := d.Id() - - req := mccpv2.OrgUpdateRequest{} - if d.HasChange("name") { - req.Name = helpers.String(d.Get("name").(string)) - } - _, err = orgAPI.Update(id, req) - if err != nil { - return fmt.Errorf("Error updating organisation: %s", err) - } - err = updateOrgBillingManagers(orgAPI, id, d) - if err != nil { - return err - } - err = updateOrgManagers(meta, id, d) - if err != nil { - return err - } - err = updateOrgAuditors(orgAPI, id, d) - if err != nil { - return err - } - err = updateOrgUsers(meta, id, d) - if err != nil { - return err - } - - return resourceIBMOrgRead(d, meta) -} - -func resourceIBMOrgDelete(d *schema.ResourceData, meta interface{}) error { - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - orgAPI := cfAPI.Organizations() - id := d.Id() - err = orgAPI.Delete(id, false) - if err != nil { - return fmt.Errorf("Error deleting organisation: %s", err) - } - d.SetId("") - return nil -} - -func resourceIBMOrgExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return false, err - } - id := d.Id() - org, err := cfClient.Organizations().Get(id) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok { - if apiErr.StatusCode() == 404 { - return false, nil - } - } - return false, fmt.Errorf("[ERROR] Error getting Organization: %s", err) - } - return org.Metadata.GUID == id, nil -} - -func updateOrgBillingManagers(api mccpv2.Organizations, orgGUID string, d *schema.ResourceData) error { - if !d.HasChange("billing_managers") { - return nil - } - var remove, add []string - o, n := d.GetChange("billing_managers") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - if len(add) > 0 { - for _, d := range add { - _, err := api.AssociateBillingManager(orgGUID, d) - if err != nil { - return fmt.Errorf("Error associating billing manager (%s) with org %s : %s", d, orgGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateBillingManager(orgGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating billing manager (%s) with org %s : %s", d, orgGUID, err) - } - } - } - return nil -} - -func updateOrgManagers(meta interface{}, orgGUID string, d *schema.ResourceData) error { - if !d.HasChange("managers") { - return nil - } - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - api := cfAPI.Organizations() - - var remove, add []string - o, n := d.GetChange("managers") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - orgOwnerID := userDetails.userEmail - - if len(add) > 0 { - for _, d := range add { - if d == orgOwnerID { - return fmt.Errorf("Error associating user (%s) with manager role, %v", d, errManagerRoleAssociation) - } - _, err := api.AssociateManager(orgGUID, d) - if err != nil { - return fmt.Errorf("Error associating manager (%s) with org %s : %s", d, orgGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateManager(orgGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating manager (%s) with org %s : %s", d, orgGUID, err) - } - } - } - return nil -} -func updateOrgAuditors(api mccpv2.Organizations, orgGUID string, d *schema.ResourceData) error { - if !d.HasChange("auditors") { - return nil - } - var remove, add []string - o, n := d.GetChange("auditors") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - if len(add) > 0 { - for _, d := range add { - _, err := api.AssociateAuditor(orgGUID, d) - if err != nil { - return fmt.Errorf("Error associating auditor (%s) with org %s : %s", d, orgGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateAuditor(orgGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating auditor (%s) with org %s : %s", d, orgGUID, err) - } - } - } - return nil -} - -func updateOrgUsers(meta interface{}, orgGUID string, d *schema.ResourceData) error { - if !d.HasChange("users") { - return nil - } - var remove, add []string - o, n := d.GetChange("users") - os := o.(*schema.Set) - ns := n.(*schema.Set) - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - cfAPI, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - api := cfAPI.Organizations() - if len(add) > 0 { - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - orgOwnerID := userDetails.userEmail - for _, d := range add { - if d == orgOwnerID { - return fmt.Errorf("Error associating user (%s) with User role, %v", d, errUserRoleAssociation) - } - _, err := api.AssociateUser(orgGUID, d) - if err != nil { - return fmt.Errorf("Error associating user (%s) with org %s : %s", d, orgGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateUser(orgGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating user (%s) with org %s : %s", d, orgGUID, err) - } - } - } - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_image.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_image.go deleted file mode 100644 index c554e9a18a..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_image.go +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - st "github.com/IBM-Cloud/power-go-client/clients/instance" - "github.com/IBM-Cloud/power-go-client/errors" - "github.com/IBM-Cloud/power-go-client/helpers" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images" - "github.com/IBM-Cloud/power-go-client/power/models" -) - -func resourceIBMPIImage() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceIBMPIImageCreate, - ReadContext: resourceIBMPIImageRead, - UpdateContext: resourceIBMPIImageUpdate, - DeleteContext: resourceIBMPIImageDelete, - Importer: &schema.ResourceImporter{}, - - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(60 * time.Minute), - Delete: schema.DefaultTimeout(60 * time.Minute), - }, - - Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, - Required: true, - Description: "PI cloud instance ID", - }, - helpers.PIImageName: { - Type: schema.TypeString, - Required: true, - Description: "Image name", - DiffSuppressFunc: applyOnce, - }, - helpers.PIImageId: { - Type: schema.TypeString, - Optional: true, - ExactlyOneOf: []string{helpers.PIImageId, helpers.PIImageBucketName}, - Description: "Instance image id", - DiffSuppressFunc: applyOnce, - ConflictsWith: []string{helpers.PIImageBucketName}, - ForceNew: true, - }, - - // COS import variables - helpers.PIImageBucketName: { - Type: schema.TypeString, - Optional: true, - ExactlyOneOf: []string{helpers.PIImageId, helpers.PIImageBucketName}, - Description: "Cloud Object Storage bucket name; bucket-name[/optional/folder]", - ConflictsWith: []string{helpers.PIImageId}, - RequiredWith: []string{helpers.PIImageBucketRegion, helpers.PIImageBucketFileName}, - ForceNew: true, - }, - helpers.PIImageBucketAccess: { - Type: schema.TypeString, - Optional: true, - Description: "Indicates if the bucket has public or private access", - Default: "public", - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), - ConflictsWith: []string{helpers.PIImageId}, - ForceNew: true, - }, - helpers.PIImageAccessKey: { - Type: schema.TypeString, - Optional: true, - Description: "Cloud Object Storage access key; required for buckets with private access", - ForceNew: true, - Sensitive: true, - RequiredWith: []string{helpers.PIImageSecretKey}, - }, - helpers.PIImageSecretKey: { - Type: schema.TypeString, - Optional: true, - Description: "Cloud Object Storage secret key; required for buckets with private access", - ForceNew: true, - Sensitive: true, - RequiredWith: []string{helpers.PIImageAccessKey}, - }, - helpers.PIImageBucketRegion: { - Type: schema.TypeString, - Optional: true, - Description: "Cloud Object Storage region", - ConflictsWith: []string{helpers.PIImageId}, - RequiredWith: []string{helpers.PIImageBucketName}, - ForceNew: true, - }, - helpers.PIImageBucketFileName: { - Type: schema.TypeString, - Optional: true, - Description: "Cloud Object Storage image filename", - ConflictsWith: []string{helpers.PIImageId}, - RequiredWith: []string{helpers.PIImageBucketName}, - ForceNew: true, - }, - helpers.PIImageStorageType: { - Type: schema.TypeString, - Optional: true, - Description: "Type of storage", - RequiredWith: []string{helpers.PIImageBucketName}, - ForceNew: true, - }, - - // Computed Attribute - "image_id": { - Type: schema.TypeString, - Computed: true, - Description: "Image ID", - }, - }, - } -} - -func resourceIBMPIImageCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() - if err != nil { - log.Printf("Failed to get the session") - return diag.FromErr(err) - } - - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) - imageName := d.Get(helpers.PIImageName).(string) - - client := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) - // image copy - if v, ok := d.GetOk(helpers.PIImageId); ok { - imageid := v.(string) - source := "root-project" - var body = &models.CreateImage{ - ImageName: imageName, - ImageID: imageid, - Source: &source, - } - imageResponse, err := client.Create(body) - if err != nil { - return diag.FromErr(err) - } - - IBMPIImageID := imageResponse.ImageID - d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *IBMPIImageID)) - - _, err = isWaitForIBMPIImageAvailable(ctx, client, *IBMPIImageID, d.Timeout(schema.TimeoutCreate)) - if err != nil { - log.Printf("[DEBUG] err %s", err) - return diag.FromErr(err) - } - } - - // COS image import - if v, ok := d.GetOk(helpers.PIImageBucketName); ok { - bucketName := v.(string) - bucketImageFileName := d.Get(helpers.PIImageBucketFileName).(string) - bucketRegion := d.Get(helpers.PIImageBucketRegion).(string) - bucketAccess := d.Get(helpers.PIImageBucketAccess).(string) - storageType := d.Get(helpers.PIImageStorageType).(string) - - body := &models.CreateCosImageImportJob{ - ImageName: &imageName, - BucketName: &bucketName, - BucketAccess: &bucketAccess, - ImageFilename: &bucketImageFileName, - Region: &bucketRegion, - StorageType: storageType, - } - - if v, ok := d.GetOk(helpers.PIImageAccessKey); ok { - body.AccessKey = v.(string) - } - if v, ok := d.GetOk(helpers.PIImageSecretKey); ok { - body.SecretKey = v.(string) - } - - imageResponse, err := client.CreateCosImage(body) - if err != nil { - return diag.FromErr(err) - } - - jobClient := st.NewIBMPIJobClient(ctx, sess, cloudInstanceID) - _, err = waitForIBMPIJobCompleted(ctx, jobClient, *imageResponse.ID, d.Timeout(schema.TimeoutCreate)) - if err != nil { - return diag.FromErr(err) - } - - // Once the job is completed find by name - image, err := client.Get(imageName) - if err != nil { - return diag.FromErr(err) - } - d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *image.ImageID)) - } - - return resourceIBMPIImageRead(ctx, d, meta) -} - -func resourceIBMPIImageRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() - if err != nil { - return diag.FromErr(err) - } - - cloudInstanceID, imageID, err := splitID(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - imageC := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) - imagedata, err := imageC.Get(imageID) - if err != nil { - uErr := errors.Unwrap(err) - switch uErr.(type) { - case *p_cloud_images.PcloudCloudinstancesImagesGetNotFound: - log.Printf("[DEBUG] image does not exist %v", err) - d.SetId("") - return nil - } - log.Printf("[DEBUG] get image failed %v", err) - return diag.FromErr(err) - } - - imageid := *imagedata.ImageID - d.Set("image_id", imageid) - d.Set(helpers.PICloudInstanceId, cloudInstanceID) - - return nil -} - -func resourceIBMPIImageUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil -} - -func resourceIBMPIImageDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() - if err != nil { - return diag.FromErr(err) - } - - cloudInstanceID, imageID, err := splitID(d.Id()) - if err != nil { - return diag.FromErr(err) - } - - imageC := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) - err = imageC.Delete(imageID) - if err != nil { - return diag.FromErr(err) - } - - d.SetId("") - return nil -} - -func isWaitForIBMPIImageAvailable(ctx context.Context, client *st.IBMPIImageClient, id string, timeout time.Duration) (interface{}, error) { - log.Printf("Waiting for Power Image (%s) to be available.", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"retry", helpers.PIImageQueStatus}, - Target: []string{helpers.PIImageActiveStatus}, - Refresh: isIBMPIImageRefreshFunc(ctx, client, id), - Timeout: timeout, - Delay: 20 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForStateContext(ctx) -} - -func isIBMPIImageRefreshFunc(ctx context.Context, client *st.IBMPIImageClient, id string) resource.StateRefreshFunc { - - log.Printf("Calling the isIBMPIImageRefreshFunc Refresh Function....") - return func() (interface{}, string, error) { - image, err := client.Get(id) - if err != nil { - return nil, "", err - } - - if image.State == "active" { - return image, helpers.PIImageActiveStatus, nil - } - - return image, helpers.PIImageQueStatus, nil - } -} - -func waitForIBMPIJobCompleted(ctx context.Context, client *st.IBMPIJobClient, jobID string, timeout time.Duration) (interface{}, error) { - stateConf := &resource.StateChangeConf{ - Pending: []string{helpers.JobStatusQueued, helpers.JobStatusReadyForProcessing, helpers.JobStatusInProgress, helpers.JobStatusRunning, helpers.JobStatusWaiting}, - Target: []string{helpers.JobStatusCompleted, helpers.JobStatusFailed}, - Refresh: func() (interface{}, string, error) { - job, err := client.Get(jobID) - if err != nil { - log.Printf("[DEBUG] get job failed %v", err) - return nil, "", fmt.Errorf(errors.GetJobOperationFailed, jobID, err) - } - if job == nil || job.Status == nil { - log.Printf("[DEBUG] get job failed with empty response") - return nil, "", fmt.Errorf("failed to get job status for job id %s", jobID) - } - if *job.Status.State == helpers.JobStatusFailed { - log.Printf("[DEBUG] job status failed with message: %v", job.Status.Message) - return nil, helpers.JobStatusFailed, fmt.Errorf("job status failed for job id %s with message: %v", jobID, job.Status.Message) - } - return job, *job.Status.State, nil - }, - Timeout: timeout, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - return stateConf.WaitForStateContext(ctx) -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver_forwarding_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver_forwarding_rule.go deleted file mode 100644 index a91b76ee49..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver_forwarding_rule.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright IBM Corp. 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - pdnsCRForwardRule = "ibm_dns_custom_resolver_forwarding_rule" - pdnsCRForwardRules = "rules" - pdnsCRFRResolverID = "resolver_id" - pdnsCRFRDesctiption = "description" - pdnsCRFRType = "type" - pdnsCRFRMatch = "match" - pdnsCRFRForwardTo = "forward_to" - pdnsCRFRRuleID = "rule_id" - pdnsCRFRCreatedOn = "created_on" - pdnsCRFRModifiedOn = "modified_on" -) - -func resourceIBMPrivateDNSForwardingRule() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceIbmDnsCrForwardingRuleCreate, - ReadContext: resourceIbmDnsCrForwardingRuleRead, - UpdateContext: resourceIbmDnsCrForwardingRuleUpdate, - DeleteContext: resourceIbmDnsCrForwardingRuleDelete, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - pdnsInstanceID: { - Type: schema.TypeString, - Required: true, - Description: "The unique identifier of a service instance.", - }, - pdnsCRFRResolverID: { - Type: schema.TypeString, - Required: true, - Description: "The unique identifier of a custom resolver.", - }, - pdnsCRFRDesctiption: { - Type: schema.TypeString, - Optional: true, - Description: "Descriptive text of the forwarding rule.", - }, - pdnsCRFRType: { - Type: schema.TypeString, - Optional: true, - ValidateFunc: InvokeValidator(pdnsCRForwardRule, "type"), - Description: "Type of the forwarding rule.", - }, - pdnsCRFRMatch: { - Type: schema.TypeString, - Optional: true, - Description: "The matching zone or hostname.", - }, - pdnsCRFRForwardTo: { - Type: schema.TypeList, - Optional: true, - Description: "The upstream DNS servers will be forwarded to.", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - pdnsCRFRRuleID: { - Type: schema.TypeString, - Computed: true, - Description: "the time when a forwarding rule ID is created, RFC3339 format.", - }, - }, - } -} - -func resourceIBMPrivateDNSForwardingRuleValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Optional: true, - AllowedValues: "hostname, zone", - }, - ) - - resourceValidator := ResourceValidator{ResourceName: pdnsCRForwardRule, Schema: validateSchema} - return &resourceValidator -} - -func resourceIbmDnsCrForwardingRuleCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - dnsSvcsClient, err := meta.(ClientSession).PrivateDNSClientSession() - if err != nil { - return diag.FromErr(err) - } - instanceID := d.Get(pdnsInstanceID).(string) - resolverID := d.Get(pdnsCRFRResolverID).(string) - opt := dnsSvcsClient.NewCreateForwardingRuleOptions(instanceID, resolverID) - - if des, ok := d.GetOk(pdnsCRFRDesctiption); ok { - opt.SetDescription(des.(string)) - } - if t, ok := d.GetOk(pdnsCRFRType); ok { - opt.SetType(t.(string)) - } - if m, ok := d.GetOk(pdnsCRFRMatch); ok { - opt.SetMatch(m.(string)) - } - if _, ok := d.GetOk(pdnsCRFRForwardTo); ok { - opt.SetForwardTo(expandStringList(d.Get(pdnsCRFRForwardTo).([]interface{}))) - } - result, resp, err := dnsSvcsClient.CreateForwardingRuleWithContext(context, opt) - - if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error creating the forwarding rules %s:%s", err, resp)) - } - d.SetId(convertCisToTfThreeVar(*result.ID, resolverID, instanceID)) - - return resourceIbmDnsCrForwardingRuleRead(context, d, meta) -} - -func resourceIbmDnsCrForwardingRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - dnsSvcsClient, err := meta.(ClientSession).PrivateDNSClientSession() - if err != nil { - return diag.FromErr(err) - } - ruleID, resolverID, instanceID, err := convertTfToCisThreeVar(d.Id()) - opt := dnsSvcsClient.NewGetForwardingRuleOptions(instanceID, resolverID, ruleID) - result, resp, err := dnsSvcsClient.GetForwardingRuleWithContext(context, opt) - - if err != nil || result == nil { - if resp != nil && resp.StatusCode == 404 { - d.SetId("") - return nil - } - return diag.FromErr(fmt.Errorf("Error reading the forwarding rules %s:%s", err, resp)) - } - d.Set(pdnsInstanceID, instanceID) - d.Set(pdnsCRFRResolverID, resolverID) - d.Set(pdnsCRFRRuleID, ruleID) - d.Set(pdnsCRFRDesctiption, *result.Description) - d.Set(pdnsCRFRType, *result.Type) - d.Set(pdnsCRFRMatch, *result.Match) - d.Set(pdnsCRFRForwardTo, result.ForwardTo) - return nil - -} -func resourceIbmDnsCrForwardingRuleUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - dnsSvcsClient, err := meta.(ClientSession).PrivateDNSClientSession() - if err != nil { - return diag.FromErr(err) - } - ruleID, resolverID, instanceID, err := convertTfToCisThreeVar(d.Id()) - - if err != nil { - return diag.FromErr(err) - } - - opt := dnsSvcsClient.NewUpdateForwardingRuleOptions(instanceID, resolverID, ruleID) - if d.HasChange(pdnsCRFRDesctiption) || - d.HasChange(pdnsCRFRMatch) || - d.HasChange(pdnsCRFRForwardTo) { - - if des, ok := d.GetOk(pdnsCRFRDesctiption); ok { - frdes := des.(string) - opt.SetDescription(frdes) - } - if ma, ok := d.GetOk(pdnsCRFRMatch); ok { - frmatch := ma.(string) - opt.SetMatch(frmatch) - } - if _, ok := d.GetOk(pdnsCRFRForwardTo); ok { - opt.SetForwardTo(expandStringList(d.Get(pdnsCRFRForwardTo).([]interface{}))) - } - - result, resp, err := dnsSvcsClient.UpdateForwardingRuleWithContext(context, opt) - if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error updating the forwarding rule %s:%s", err, resp)) - } - - } - return resourceIbmDnsCrForwardingRuleRead(context, d, meta) -} - -func resourceIbmDnsCrForwardingRuleDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - dnsSvcsClient, err := meta.(ClientSession).PrivateDNSClientSession() - if err != nil { - return diag.FromErr(err) - } - ruleID, resolverID, instanceID, err := convertTfToCisThreeVar(d.Id()) - opt := dnsSvcsClient.NewDeleteForwardingRuleOptions(instanceID, resolverID, ruleID) - response, err := dnsSvcsClient.DeleteForwardingRuleWithContext(context, opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - return nil - } - return diag.FromErr(fmt.Errorf("Error deleting the Forwarding Rules %s:%s", err, response)) - } - d.SetId("") - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_push_notification_chrome.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_push_notification_chrome.go deleted file mode 100644 index 780b3ea7f4..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_push_notification_chrome.go +++ /dev/null @@ -1,124 +0,0 @@ -package ibm - -import ( - "fmt" - - "github.com/IBM/push-notifications-go-sdk/pushservicev1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceIBMPNApplicationChrome() *schema.Resource { - return &schema.Resource{ - Read: resourceApplicationChromeRead, - Create: resourceApplicationChromeCreate, - Update: resourceApplicationChromeUpdate, - Delete: resourceApplicationChromeDelete, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "guid": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Unique guid of the push notification instance.", - }, - "server_key": { - Type: schema.TypeString, - Required: true, - Description: "A server key that gives the push service an authorized access to Google services that is used for Chrome Web Push.", - }, - "web_site_url": { - Type: schema.TypeString, - Required: true, - Description: "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", - }, - }, - } -} - -func resourceApplicationChromeCreate(d *schema.ResourceData, meta interface{}) error { - pnClient, err := meta.(ClientSession).PushServiceV1() - if err != nil { - return err - } - - serverKey := d.Get("server_key").(string) - websiteURL := d.Get("web_site_url").(string) - guid := d.Get("guid").(string) - - _, response, err := pnClient.SaveChromeWebConf(&pushservicev1.SaveChromeWebConfOptions{ - ApplicationID: &guid, - ApiKey: &serverKey, - WebSiteURL: &websiteURL, - }) - - if err != nil { - d.SetId("") - return fmt.Errorf("Error configuring chrome web platform: %s with response code %d", err, response.StatusCode) - } - d.SetId(guid) - - return resourceApplicationChromeRead(d, meta) -} - -func resourceApplicationChromeUpdate(d *schema.ResourceData, meta interface{}) error { - - if d.HasChanges("server_key", "web_site_url") { - return resourceApplicationChromeCreate(d, meta) - } - return nil -} - -func resourceApplicationChromeRead(d *schema.ResourceData, meta interface{}) error { - pnClient, err := meta.(ClientSession).PushServiceV1() - if err != nil { - return err - } - - guid := d.Id() - - chromeWebConf, response, err := pnClient.GetChromeWebConf(&pushservicev1.GetChromeWebConfOptions{ - ApplicationID: &guid, - }) - - if err != nil { - if response != nil && response.StatusCode == 404 { - d.SetId("") - return nil - } - return fmt.Errorf("Error fetching chrome web platform configuration: %s with response code %d", err, response.StatusCode) - } - - d.SetId(guid) - - if response.StatusCode == 200 { - d.Set("server_key", *chromeWebConf.ApiKey) - d.Set("web_site_url", *chromeWebConf.WebSiteURL) - } - return nil -} - -func resourceApplicationChromeDelete(d *schema.ResourceData, meta interface{}) error { - pnClient, err := meta.(ClientSession).PushServiceV1() - if err != nil { - return err - } - guid := d.Get("guid").(string) - - response, err := pnClient.DeleteChromeWebConf(&pushservicev1.DeleteChromeWebConfOptions{ - ApplicationID: &guid, - }) - - if err != nil { - if response != nil && response.StatusCode == 404 { - d.SetId("") - return nil - } - return fmt.Errorf("Error deleting chrome web platform configuration: %s with response code %d", err, response.StatusCode) - } - - d.SetId("") - - return nil - -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_instance.go deleted file mode 100644 index 7db4ee8335..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_instance.go +++ /dev/null @@ -1,922 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "encoding/json" - "fmt" - "log" - "os" - "strconv" - "strings" - "time" - - rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/models" -) - -const ( - rsInstanceSuccessStatus = "active" - rsInstanceProgressStatus = "in progress" - rsInstanceProvisioningStatus = "provisioning" - rsInstanceInactiveStatus = "inactive" - rsInstanceFailStatus = "failed" - rsInstanceRemovedStatus = "removed" - rsInstanceReclamation = "pending_reclamation" -) - -func resourceIBMResourceInstance() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMResourceInstanceCreate, - Read: resourceIBMResourceInstanceRead, - Update: resourceIBMResourceInstanceUpdate, - Delete: resourceIBMResourceInstanceDelete, - Exists: resourceIBMResourceInstanceExists, - Importer: &schema.ResourceImporter{}, - - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - - CustomizeDiff: customdiff.Sequence( - func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) - }, - ), - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "A name for the resource instance", - }, - - "service": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "The name of the service offering like cloud-object-storage, kms etc", - }, - - "plan": { - Type: schema.TypeString, - Required: true, - Description: "The plan type of the service", - }, - - "location": { - Description: "The location where the instance available", - Required: true, - ForceNew: true, - Type: schema.TypeString, - }, - - "resource_group_id": { - Description: "The resource group id", - Optional: true, - ForceNew: true, - Type: schema.TypeString, - Computed: true, - }, - - "parameters": { - Type: schema.TypeMap, - Optional: true, - Description: "Arbitrary parameters to pass. Must be a JSON object", - ConflictsWith: []string{"parameters_json"}, - }, - "parameters_json": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"parameters"}, - StateFunc: func(v interface{}) string { - json, err := normalizeJSONString(v) - if err != nil { - return fmt.Sprintf("%q", err.Error()) - } - return json - }, - Description: "Arbitrary parameters to pass in Json string format", - }, - - "tags": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_resource_instance", "tag")}, - Set: resourceIBMVPCHash, - }, - - "status": { - Type: schema.TypeString, - Computed: true, - Description: "Status of resource instance", - }, - - "crn": { - Type: schema.TypeString, - Computed: true, - Description: "CRN of resource instance", - }, - - "guid": { - Type: schema.TypeString, - Computed: true, - Description: "Guid of resource instance", - }, - - "service_endpoints": { - Description: "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "public-and-private"}), - }, - - "dashboard_url": { - Description: "Dashboard URL to access resource.", - Type: schema.TypeString, - Computed: true, - }, - - "plan_history": { - Description: "The plan history of the instance.", - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "resource_plan_id": { - Type: schema.TypeString, - Computed: true, - }, - "start_date": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - - "account_id": { - Description: "An alpha-numeric value identifying the account ID.", - Type: schema.TypeString, - Computed: true, - }, - - "resource_group_crn": { - Description: "The long ID (full CRN) of the resource group", - Type: schema.TypeString, - Computed: true, - }, - - "resource_id": { - Description: "The unique ID of the offering", - Type: schema.TypeString, - Computed: true, - }, - - "resource_plan_id": { - Description: "The unique ID of the plan associated with the offering", - Type: schema.TypeString, - Computed: true, - }, - - "target_crn": { - Description: "The full deployment CRN as defined in the global catalog", - Type: schema.TypeString, - Computed: true, - }, - - "state": { - Description: "The current state of the instance.", - Type: schema.TypeString, - Computed: true, - }, - - "type": { - Description: "The type of the instance, e.g. service_instance.", - Type: schema.TypeString, - Computed: true, - }, - - "sub_type": { - Description: "The sub-type of instance, e.g. cfaas .", - Type: schema.TypeString, - Computed: true, - }, - - "allow_cleanup": { - Description: "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", - Type: schema.TypeBool, - Computed: true, - }, - - "locked": { - Description: "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", - Type: schema.TypeBool, - Computed: true, - }, - - "last_operation": { - Type: schema.TypeMap, - Computed: true, - Description: "The status of the last operation requested on the instance", - }, - - "resource_aliases_url": { - Description: "The relative path to the resource aliases for the instance.", - Type: schema.TypeString, - Computed: true, - }, - - "resource_bindings_url": { - Description: "The relative path to the resource bindings for the instance.", - Type: schema.TypeString, - Computed: true, - }, - - "resource_keys_url": { - Description: "The relative path to the resource keys for the instance.", - Type: schema.TypeString, - Computed: true, - }, - - "created_at": { - Type: schema.TypeString, - Description: "The date when the instance was created.", - Computed: true, - }, - - "created_by": { - Type: schema.TypeString, - Description: "The subject who created the instance.", - Computed: true, - }, - - "update_at": { - Type: schema.TypeString, - Description: "The date when the instance was last updated.", - Computed: true, - }, - - "update_by": { - Type: schema.TypeString, - Description: "The subject who updated the instance.", - Computed: true, - }, - - "deleted_at": { - Type: schema.TypeString, - Description: "The date when the instance was deleted.", - Computed: true, - }, - - "deleted_by": { - Type: schema.TypeString, - Description: "The subject who deleted the instance.", - Computed: true, - }, - - "scheduled_reclaim_at": { - Type: schema.TypeString, - Description: "The date when the instance was scheduled for reclamation.", - Computed: true, - }, - - "scheduled_reclaim_by": { - Type: schema.TypeString, - Description: "The subject who initiated the instance reclamation.", - Computed: true, - }, - - "restored_at": { - Type: schema.TypeString, - Description: "The date when the instance under reclamation was restored.", - Computed: true, - }, - - "restored_by": { - Type: schema.TypeString, - Description: "The subject who restored the instance back from reclamation.", - Computed: true, - }, - - ResourceName: { - Type: schema.TypeString, - Computed: true, - Description: "The name of the resource", - }, - - ResourceCRN: { - Type: schema.TypeString, - Computed: true, - Description: "The crn of the resource", - }, - - ResourceStatus: { - Type: schema.TypeString, - Computed: true, - Description: "The status of the resource", - }, - - ResourceGroupName: { - Type: schema.TypeString, - Computed: true, - Description: "The resource group name in which resource is provisioned", - }, - ResourceControllerURL: { - Type: schema.TypeString, - Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", - }, - - "extensions": { - Type: schema.TypeMap, - Computed: true, - Description: "The extended metadata as a map associated with the resource instance.", - }, - }, - } -} - -func resourceIBMResourceInstanceValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Optional: true, - Regexp: `^[A-Za-z0-9:_ .-]+$`, - MinValueLength: 1, - MaxValueLength: 128}) - - ibmResourceInstanceResourceValidator := ResourceValidator{ResourceName: "ibm_resource_instance", Schema: validateSchema} - return &ibmResourceInstanceResourceValidator -} - -func resourceIBMResourceInstanceCreate(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - - serviceName := d.Get("service").(string) - plan := d.Get("plan").(string) - name := d.Get("name").(string) - location := d.Get("location").(string) - - rsInst := rc.CreateResourceInstanceOptions{ - Name: &name, - } - - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - serviceOff, err := rsCatRepo.FindByName(serviceName, true) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - if metadata, ok := serviceOff[0].Metadata.(*models.ServiceResourceMetadata); ok { - if !metadata.Service.RCProvisionable { - return fmt.Errorf("%s cannot be provisioned by resource controller", serviceName) - } - } else { - return fmt.Errorf("Cannot create instance of resource %s\nUse 'ibm_service_instance' if the resource is a Cloud Foundry service", serviceName) - } - - servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - rsInst.ResourcePlanID = &servicePlan - - deployments, err := rsCatRepo.ListDeployments(servicePlan) - if err != nil { - return fmt.Errorf("Error retrieving deployment for plan %s : %s", plan, err) - } - if len(deployments) == 0 { - return fmt.Errorf("No deployment found for service plan : %s", plan) - } - deployments, supportedLocations := filterDeployments(deployments, location) - - if len(deployments) == 0 { - locationList := make([]string, 0, len(supportedLocations)) - for l := range supportedLocations { - locationList = append(locationList, l) - } - return fmt.Errorf("No deployment found for service plan %s at location %s.\nValid location(s) are: %q.\nUse 'ibm_service_instance' if the service is a Cloud Foundry service.", plan, location, locationList) - } - - rsInst.Target = &deployments[0].CatalogCRN - - if rsGrpID, ok := d.GetOk("resource_group_id"); ok { - rg := rsGrpID.(string) - rsInst.ResourceGroup = &rg - } else { - defaultRg, err := defaultResourceGroup(meta) - if err != nil { - return err - } - rsInst.ResourceGroup = &defaultRg - } - - params := map[string]interface{}{} - - if serviceEndpoints, ok := d.GetOk("service_endpoints"); ok { - params["service-endpoints"] = serviceEndpoints.(string) - } - - if parameters, ok := d.GetOk("parameters"); ok { - temp := parameters.(map[string]interface{}) - for k, v := range temp { - if v == "true" || v == "false" { - b, _ := strconv.ParseBool(v.(string)) - params[k] = b - } else if strings.HasPrefix(v.(string), "[") && strings.HasSuffix(v.(string), "]") { - //transform v.(string) to be []string - arrayString := v.(string) - trimLeft := strings.TrimLeft(arrayString, "[") - trimRight := strings.TrimRight(trimLeft, "]") - array := strings.Split(trimRight, ",") - result := []string{} - for _, a := range array { - result = append(result, strings.Trim(a, "\"")) - } - params[k] = result - } else { - params[k] = v - } - } - - } - if s, ok := d.GetOk("parameters_json"); ok { - json.Unmarshal([]byte(s.(string)), ¶ms) - } - - rsInst.Parameters = params - - //Start to create resource instance - instance, resp, err := rsConClient.CreateResourceInstance(&rsInst) - if err != nil { - log.Printf( - "Error when creating resource instance: %s, Instance info NAME->%s, LOCATION->%s, GROUP_ID->%s, PLAN_ID->%s", - err, *rsInst.Name, *rsInst.Target, *rsInst.ResourceGroup, *rsInst.ResourcePlanID) - return fmt.Errorf("Error when creating resource instance: %s with resp code: %s", err, resp) - } - - d.SetId(*instance.ID) - - _, err = waitForResourceInstanceCreate(d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for create resource instance (%s) to be succeeded: %s", d.Id(), err) - } - - v := os.Getenv("IC_ENV_TAGS") - if _, ok := d.GetOk("tags"); ok || v != "" { - oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) - if err != nil { - log.Printf( - "Error on create of resource instance (%s) tags: %s", d.Id(), err) - } - } - - return resourceIBMResourceInstanceRead(d, meta) -} -func resourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - - instanceID := d.Id() - resourceInstanceGet := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - return fmt.Errorf("Error retrieving resource instance: %s with resp code: %s", err, resp) - } - - tags, err := GetTagsUsingCRN(meta, *instance.CRN) - if err != nil { - log.Printf( - "Error on get of resource instance tags (%s) tags: %s", d.Id(), err) - } - d.Set("tags", tags) - d.Set("name", instance.Name) - d.Set("status", instance.State) - d.Set("resource_group_id", instance.ResourceGroupID) - if instance.CRN != nil { - location := strings.Split(*instance.CRN, ":") - if len(location) > 5 { - d.Set("location", location[5]) - } - } - d.Set("crn", instance.CRN) - d.Set("dashboard_url", instance.DashboardURL) - - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - serviceOff, err := rsCatRepo.GetServiceName(*instance.ResourceID) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - d.Set("service", serviceOff) - - d.Set(ResourceName, instance.Name) - d.Set(ResourceCRN, instance.CRN) - d.Set(ResourceStatus, instance.State) - d.Set(ResourceGroupName, instance.ResourceGroupCRN) - - rcontroller, err := getBaseController(meta) - if err != nil { - return err - } - d.Set(ResourceControllerURL, rcontroller+"/services/") - - servicePlan, err := rsCatRepo.GetServicePlanName(*instance.ResourcePlanID) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - d.Set("plan", servicePlan) - d.Set("guid", instance.GUID) - if instance.Parameters != nil { - if endpoint, ok := instance.Parameters["service-endpoints"]; ok { - d.Set("service_endpoints", endpoint) - } - } - - if len(instance.Extensions) == 0 { - d.Set("extensions", instance.Extensions) - } else { - d.Set("extensions", Flatten(instance.Extensions)) - } - d.Set("account_id", instance.AccountID) - d.Set("restored_by", instance.RestoredBy) - if instance.RestoredAt != nil { - d.Set("restored_at", instance.RestoredAt.String()) - } - d.Set("scheduled_reclaim_by", instance.ScheduledReclaimBy) - if instance.ScheduledReclaimAt != nil { - d.Set("scheduled_reclaim_at", instance.ScheduledReclaimAt.String()) - } - if instance.ScheduledReclaimAt != nil { - d.Set("deleted_at", instance.DeletedAt.String()) - } - d.Set("deleted_by", instance.DeletedBy) - if instance.UpdatedAt != nil { - d.Set("update_at", instance.UpdatedAt.String()) - } - if instance.CreatedAt != nil { - d.Set("created_at", instance.CreatedAt.String()) - } - d.Set("update_by", instance.UpdatedBy) - d.Set("created_by", instance.CreatedBy) - d.Set("resource_keys_url", instance.ResourceKeysURL) - d.Set("resource_bindings_url", instance.ResourceBindingsURL) - d.Set("resource_aliases_url", instance.ResourceAliasesURL) - if instance.LastOperation != nil { - d.Set("last_operation", Flatten(instance.LastOperation)) - } - d.Set("locked", instance.Locked) - d.Set("allow_cleanup", instance.AllowCleanup) - d.Set("type", instance.Type) - d.Set("state", instance.State) - d.Set("sub_type", instance.SubType) - d.Set("target_crn", instance.TargetCRN) - d.Set("resource_plan_id", instance.ResourcePlanID) - d.Set("resource_id", instance.ResourceID) - d.Set("resource_group_crn", instance.ResourceGroupCRN) - if instance.PlanHistory != nil { - d.Set("plan_history", flattenPlanHistory(instance.PlanHistory)) - } - - return nil -} - -func resourceIBMResourceInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - - instanceID := d.Id() - - resourceInstanceUpdate := rc.UpdateResourceInstanceOptions{ - ID: &instanceID, - } - if d.HasChange("name") { - name := d.Get("name").(string) - resourceInstanceUpdate.Name = &name - } - - if d.HasChange("plan") { - plan := d.Get("plan").(string) - service := d.Get("service").(string) - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() - if err != nil { - return err - } - rsCatRepo := rsCatClient.ResourceCatalog() - - serviceOff, err := rsCatRepo.FindByName(service, true) - if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) - } - - servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) - if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) - } - - resourceInstanceUpdate.ResourcePlanID = &servicePlan - - } - params := map[string]interface{}{} - - if d.HasChange("service_endpoints") { - endpoint := d.Get("service_endpoints").(string) - params["service-endpoints"] = endpoint - } - - resourceInstanceGet := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - if d.HasChange("parameters") { - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - return fmt.Errorf("Error retrieving resource instance: %s with resp code: %s", err, resp) - } - - if parameters, ok := d.GetOk("parameters"); ok { - temp := parameters.(map[string]interface{}) - for k, v := range temp { - if v == "true" || v == "false" { - b, _ := strconv.ParseBool(v.(string)) - params[k] = b - } else if strings.HasPrefix(v.(string), "[") && strings.HasSuffix(v.(string), "]") { - //transform v.(string) to be []string - arrayString := v.(string) - trimLeft := strings.TrimLeft(arrayString, "[") - trimRight := strings.TrimRight(trimLeft, "]") - array := strings.Split(trimRight, ",") - result := []string{} - for _, a := range array { - result = append(result, strings.Trim(a, "\"")) - } - params[k] = result - } else { - params[k] = v - } - } - } - serviceEndpoints := d.Get("service_endpoints").(string) - if serviceEndpoints != "" { - endpoint := d.Get("service_endpoints").(string) - params["service-endpoints"] = endpoint - } else if _, ok := instance.Parameters["service-endpoints"]; ok { - params["service-endpoints"] = instance.Parameters["service-endpoints"] - } - - } - - if d.HasChange("service_endpoints") || d.HasChange("parameters") { - resourceInstanceUpdate.Parameters = params - } - if d.HasChange("parameters_json") { - if s, ok := d.GetOk("parameters_json"); ok { - json.Unmarshal([]byte(s.(string)), ¶ms) - resourceInstanceUpdate.Parameters = params - } - } - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - return fmt.Errorf("Error Getting resource instance: %s with resp code: %s", err, resp) - } - - if d.HasChange("tags") { - oldList, newList := d.GetChange(isVPCTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) - if err != nil { - log.Printf( - "Error on update of resource instance (%s) tags: %s", d.Id(), err) - } - } - - _, resp, err = rsConClient.UpdateResourceInstance(&resourceInstanceUpdate) - if err != nil { - return fmt.Errorf("Error updating resource instance: %s with resp code: %s", err, resp) - } - - _, err = waitForResourceInstanceUpdate(d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for update resource instance (%s) to be succeeded: %s", d.Id(), err) - } - - return resourceIBMResourceInstanceRead(d, meta) -} - -func resourceIBMResourceInstanceDelete(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return err - } - id := d.Id() - recursive := true - resourceInstanceDelete := rc.DeleteResourceInstanceOptions{ - ID: &id, - Recursive: &recursive, - } - - resp, error := rsConClient.DeleteResourceInstance(&resourceInstanceDelete) - if error != nil { - if resp != nil && resp.StatusCode == 410 { - return nil - } - return fmt.Errorf("Error deleting resource instance: %s with resp code: %s", error, resp) - } - - _, err = waitForResourceInstanceDelete(d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for resource instance (%s) to be deleted: %s", d.Id(), err) - } - - d.SetId("") - - return nil -} -func resourceIBMResourceInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - resourceInstanceGet := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - if resp != nil && resp.StatusCode == 404 { - return false, nil - } - return false, fmt.Errorf("[ERROR] Error getting resource instance: %s with resp code: %s", err, resp) - } - if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, rsInstanceReclamation)) { - log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") - d.SetId("") - return false, nil - } - - return *instance.ID == instanceID, nil -} - -func waitForResourceInstanceCreate(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - resourceInstanceGet := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{rsInstanceProgressStatus, rsInstanceInactiveStatus, rsInstanceProvisioningStatus}, - Target: []string{rsInstanceSuccessStatus}, - Refresh: func() (interface{}, string, error) { - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - if resp != nil && resp.StatusCode == 404 { - return nil, "", fmt.Errorf("The resource instance %s does not exist anymore: %v", d.Id(), err) - } - return nil, "", fmt.Errorf("Get the resource instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) - } - if *instance.State == rsInstanceFailStatus { - return instance, *instance.State, fmt.Errorf("The resource instance %s failed: %v", d.Id(), err) - } - return instance, *instance.State, nil - }, - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func waitForResourceInstanceUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - resourceInstanceGet := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{rsInstanceProgressStatus, rsInstanceInactiveStatus}, - Target: []string{rsInstanceSuccessStatus}, - Refresh: func() (interface{}, string, error) { - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - if resp != nil && resp.StatusCode == 404 { - return nil, "", fmt.Errorf("The resource instance %s does not exist anymore: %v", d.Id(), err) - } - return nil, "", fmt.Errorf("Get the resource instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) - } - if *instance.State == rsInstanceFailStatus { - return instance, *instance.State, fmt.Errorf("The resource instance %s failed: %v", d.Id(), err) - } - return instance, *instance.State, nil - }, - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func waitForResourceInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() - if err != nil { - return false, err - } - instanceID := d.Id() - resourceInstanceGet := rc.GetResourceInstanceOptions{ - ID: &instanceID, - } - stateConf := &resource.StateChangeConf{ - Pending: []string{rsInstanceProgressStatus, rsInstanceInactiveStatus, rsInstanceSuccessStatus}, - Target: []string{rsInstanceRemovedStatus, rsInstanceReclamation}, - Refresh: func() (interface{}, string, error) { - instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) - if err != nil { - if resp != nil && resp.StatusCode == 404 { - return instance, rsInstanceSuccessStatus, nil - } - return nil, "", fmt.Errorf("Get the resource instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) - } - if *instance.State == rsInstanceFailStatus { - return instance, *instance.State, fmt.Errorf("The resource instance %s failed to delete: %v", d.Id(), err) - } - return instance, *instance.State, nil - }, - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func filterDeployments(deployments []models.ServiceDeployment, location string) ([]models.ServiceDeployment, map[string]bool) { - supportedDeployments := []models.ServiceDeployment{} - supportedLocations := make(map[string]bool) - for _, d := range deployments { - if d.Metadata.RCCompatible { - deploymentLocation := d.Metadata.Deployment.Location - supportedLocations[deploymentLocation] = true - if deploymentLocation == location { - supportedDeployments = append(supportedDeployments, d) - } - } - } - return supportedDeployments, supportedLocations -} - -func flattenPlanHistory(keys []rc.PlanHistoryItem) []interface{} { - var out = make([]interface{}, len(keys), len(keys)) - for i, k := range keys { - m := make(map[string]interface{}) - m["resource_plan_id"] = k.ResourcePlanID - m["start_date"] = k.StartDate.String() - out[i] = m - } - return out -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_tag.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_tag.go deleted file mode 100644 index c5dc5d4795..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_tag.go +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "os" - "regexp" - "strings" - - "github.com/IBM/platform-services-go-sdk/globaltaggingv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/bmxerror" -) - -const ( - resourceID = "resource_id" - tags = "tags" - resourceType = "resource_type" - tagType = "tag_type" - acccountID = "acccount_id" - service = "service" - crnRegex = "^crn:v1(:[a-zA-Z0-9 \\-\\._~\\*\\+,;=!$&'\\(\\)\\/\\?#\\[\\]@]*){8}$|^[0-9]+$" -) - -func resourceIBMResourceTag() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMResourceTagCreate, - Read: resourceIBMResourceTagRead, - Update: resourceIBMResourceTagUpdate, - Delete: resourceIBMResourceTagDelete, - Importer: &schema.ResourceImporter{}, - - CustomizeDiff: customdiff.Sequence( - func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) - }, - ), - - Schema: map[string]*schema.Schema{ - resourceID: { - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator("ibm_resource_tag", resourceID), - Description: "CRN of the resource on which the tags should be attached", - }, - tags: { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_resource_tag", tags)}, - Set: resourceIBMVPCHash, - Description: "List of tags associated with resource instance", - }, - resourceType: { - Type: schema.TypeString, - Optional: true, - Description: "Resource type on which the tags should be attached", - }, - tagType: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: InvokeValidator("ibm_resource_tag", "tag_type"), - Description: "Type of the tag. Only allowed values are: user, or service or access (default value : user)", - }, - acccountID: { - Type: schema.TypeString, - Computed: true, - Description: "The ID of the account that owns the resources to be tagged (required if tag-type is set to service)", - }, - }, - } -} - -func resourceIBMResourceTagValidator() *ResourceValidator { - tagTypeAllowedValues := "service,access,user" - validateSchema := make([]ValidateSchema, 0) - - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: resourceID, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Required: true, - Regexp: `^crn:v1(:[a-zA-Z0-9 \-\._~\*\+,;=!$&'\(\)\/\?#\[\]@]*){8}$|^[0-9]+$`, - MinValueLength: 1, - MaxValueLength: 128}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: tags, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Optional: true, - Regexp: `^[A-Za-z0-9:_ .-]+$`, - MinValueLength: 1, - MaxValueLength: 128}) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "tag_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Optional: true, - AllowedValues: tagTypeAllowedValues}) - - ibmResourceTagValidator := ResourceValidator{ResourceName: "ibm_resource_tag", Schema: validateSchema} - return &ibmResourceTagValidator -} - -func resourceIBMResourceTagCreate(d *schema.ResourceData, meta interface{}) error { - var rType, tType string - resources := []globaltaggingv1.Resource{} - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - accountID := userDetails.userAccount - - gtClient, err := meta.(ClientSession).GlobalTaggingAPIv1() - if err != nil { - return fmt.Errorf("Error getting global tagging client settings: %s", err) - } - - resourceID := d.Get(resourceID).(string) - if v, ok := d.GetOk(resourceType); ok && v != nil { - rType = v.(string) - } - - r := globaltaggingv1.Resource{ResourceID: ptrToString(resourceID), ResourceType: ptrToString(rType)} - resources = append(resources, r) - - var add []string - if v, ok := d.GetOk(tags); ok { - tags := v.(*schema.Set) - for _, t := range tags.List() { - add = append(add, fmt.Sprint(t)) - } - } - - schematicTags := os.Getenv("IC_ENV_TAGS") - var envTags []string - if schematicTags != "" { - envTags = strings.Split(schematicTags, ",") - add = append(add, envTags...) - } - - AttachTagOptions := &globaltaggingv1.AttachTagOptions{} - AttachTagOptions.Resources = resources - AttachTagOptions.TagNames = add - if v, ok := d.GetOk(tagType); ok && v != nil { - tType = v.(string) - AttachTagOptions.TagType = ptrToString(tType) - - if tType == service { - AttachTagOptions.AccountID = ptrToString(accountID) - } - } - - if len(add) > 0 { - _, resp, err := gtClient.AttachTag(AttachTagOptions) - if err != nil { - return fmt.Errorf("Error attaching resource tags : %v\n%s", resp, err) - } - } - - crn, err := regexp.Compile(crnRegex) - if err != nil { - return err - } - - if crn.MatchString(resourceID) { - d.SetId(resourceID) - } else { - d.SetId(fmt.Sprintf("%s/%s", resourceID, resourceType)) - } - - return resourceIBMResourceTagRead(d, meta) -} - -func resourceIBMResourceTagRead(d *schema.ResourceData, meta interface{}) error { - var rID, rType, tType string - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return err - } - acctID := userDetails.userAccount - - crn, err := regexp.Compile(crnRegex) - if err != nil { - return err - } - - if crn.MatchString(d.Id()) { - rID = d.Id() - } else { - parts, err := vmIdParts(d.Id()) - if err != nil { - return err - } - if len(parts) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of resourceID/resourceType", d.Id()) - } - rID = parts[0] - rType = parts[1] - } - - if v, ok := d.GetOk(tagType); ok && v != nil { - tType = v.(string) - - if tType == service { - d.Set(acccountID, acctID) - } - } - - tagList, err := GetGlobalTagsUsingCRN(meta, rID, resourceType, tType) - if err != nil { - if apierr, ok := err.(bmxerror.RequestFailure); ok && apierr.StatusCode() == 404 { - d.SetId("") - return nil - } - return fmt.Errorf("Error getting resource tags for: %s with error : %s\n", rID, err) - } - - d.Set(resourceID, rID) - d.Set(resourceType, rType) - d.Set(tags, tagList) - - return nil -} - -func resourceIBMResourceTagUpdate(d *schema.ResourceData, meta interface{}) error { - var rID, rType, tType string - - crn, err := regexp.Compile(crnRegex) - if err != nil { - return err - } - - if crn.MatchString(d.Id()) { - rID = d.Id() - } else { - parts, err := vmIdParts(d.Id()) - if err != nil { - return err - } - rID = parts[0] - rType = parts[1] - } - - if v, ok := d.GetOk(tagType); ok && v != nil { - tType = v.(string) - } - - if _, ok := d.GetOk(tags); ok { - oldList, newList := d.GetChange(tags) - err := UpdateGlobalTagsUsingCRN(oldList, newList, meta, rID, rType, tType) - if err != nil { - return fmt.Errorf( - "Error on create of resource tags: %s", err) - } - } - - return resourceIBMResourceTagRead(d, meta) -} - -func resourceIBMResourceTagDelete(d *schema.ResourceData, meta interface{}) error { - var rID, rType string - - crn, err := regexp.Compile(crnRegex) - if err != nil { - return err - } - - if crn.MatchString(d.Id()) { - rID = d.Id() - } else { - parts, err := vmIdParts(d.Id()) - if err != nil { - return err - } - rID = parts[0] - rType = parts[1] - } - - gtClient, err := meta.(ClientSession).GlobalTaggingAPIv1() - if err != nil { - return fmt.Errorf("Error getting global tagging client settings: %s", err) - } - - var remove []string - removeTags := d.Get(tags).(*schema.Set) - remove = make([]string, len(removeTags.List())) - for i, v := range removeTags.List() { - remove[i] = fmt.Sprint(v) - } - - if len(remove) > 0 { - resources := []globaltaggingv1.Resource{} - r := globaltaggingv1.Resource{ResourceID: ptrToString(rID), ResourceType: ptrToString(rType)} - resources = append(resources, r) - - detachTagOptions := &globaltaggingv1.DetachTagOptions{ - Resources: resources, - TagNames: remove, - } - - _, resp, err := gtClient.DetachTag(detachTagOptions) - if err != nil { - return fmt.Errorf("Error detaching resource tags %v: %s\n%s", remove, err, resp) - } - for _, v := range remove { - delTagOptions := &globaltaggingv1.DeleteTagOptions{ - TagName: ptrToString(v), - } - _, resp, err := gtClient.DeleteTag(delTagOptions) - if err != nil { - return fmt.Errorf("Error deleting resource tag %v: %s\n%s", v, err, resp) - } - } - } - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_host.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_host.go deleted file mode 100644 index c6d452d7cd..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_host.go +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - "log" - "time" - - "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM-Cloud/bluemix-go/bmxerror" -) - -const ( - hostCluster = "cluster" - hostLocation = "location" - hostID = "host_id" - hostState = "host_state" - hostLabels = "labels" - hostZone = "zone" - hostWorkerPool = "worker_pool" - hostProvider = "host_provider" - - rsHostNormalStatus = "normal" - rsHostProvisioningStatus = "provisioning" - rsHostReadyStatus = "ready" - rsHostUnknownStatus = "unknown" -) - -func resourceIBMSatelliteHost() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMSatelliteHostCreate, - Read: resourceIBMSatelliteHostRead, - Update: resourceIBMSatelliteHostUpdate, - Delete: resourceIBMSatelliteHostDelete, - Importer: &schema.ResourceImporter{}, - - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(75 * time.Minute), - Read: schema.DefaultTimeout(75 * time.Minute), - Delete: schema.DefaultTimeout(45 * time.Minute), - Update: schema.DefaultTimeout(45 * time.Minute), - }, - - Schema: map[string]*schema.Schema{ - hostLocation: { - Type: schema.TypeString, - Required: true, - Description: "The name or ID of the Satellite location", - }, - hostCluster: { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "The name or ID of a Satellite location or cluster to assign the host to", - }, - hostID: { - Type: schema.TypeString, - Required: true, - Description: "The specific host ID to assign to a Satellite location or cluster", - }, - hostLabels: { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - Description: "List of labels for the host", - }, - hostZone: { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "The zone within the cluster to assign the host to", - }, - hostWorkerPool: { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "The name or ID of the worker pool within the cluster to assign the host to", - }, - hostProvider: { - Type: schema.TypeString, - Optional: true, - Description: "Host Provider", - }, - hostState: { - Type: schema.TypeString, - Computed: true, - Description: "Health status of the host", - }, - }, - } -} - -func resourceIBMSatelliteHostCreate(d *schema.ResourceData, meta interface{}) error { - hostName := d.Get(hostID).(string) - location := d.Get(hostLocation).(string) - - satClient, err := meta.(ClientSession).SatelliteClientSession() - if err != nil { - return err - } - - hostAssignOptions := &kubernetesserviceapiv1.CreateSatelliteAssignmentOptions{} - hostAssignOptions.Controller = ptrToString(location) - - if _, ok := d.GetOk(hostCluster); ok { - hostAssignOptions.Cluster = ptrToString(d.Get(hostCluster).(string)) - } else { - hostAssignOptions.Cluster = ptrToString(location) - } - hostAssignOptions.HostID = ptrToString(hostName) - - //Check host attached to location - hostStatus, err := waitForHostAttachment(hostName, location, d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for attaching host (%s) to be succeeded: %s", hostName, err) - } - - labels := make(map[string]string) - if _, ok := d.GetOk(hostLabels); ok { - l := d.Get(hostLabels).(*schema.Set) - labels = flattenHostLabels(l.List()) - hostAssignOptions.Labels = labels - } else { - hostAssignOptions.Labels = labels - } - - if _, ok := d.GetOk(hostWorkerPool); ok { - hostAssignOptions.Workerpool = ptrToString(d.Get(hostWorkerPool).(string)) - } - - if _, ok := d.GetOk(hostZone); ok { - hostAssignOptions.Zone = ptrToString(d.Get(hostZone).(string)) - } - - if hostStatus == rsHostReadyStatus { - _, response, err := satClient.CreateSatelliteAssignment(hostAssignOptions) - if err != nil { - return fmt.Errorf("Error Assigning Satellite Host: %s\n%s", err, response) - } - } - - d.SetId(fmt.Sprintf("%s/%s", location, hostName)) - - //Wait for host to reach normal state - _, err = waitForHostAttachment(hostName, location, d, meta) - if err != nil { - return fmt.Errorf( - "Error waiting for host (%s) to get normal state: %s", hostName, err) - } - - return resourceIBMSatelliteHostRead(d, meta) -} - -func resourceIBMSatelliteHostRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) - if err != nil { - return err - } - if len(parts) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of location/hostName", d.Id()) - } - location := parts[0] - hostName := parts[1] - - satClient, err := meta.(ClientSession).SatelliteClientSession() - if err != nil { - return err - } - - hostOptions := &kubernetesserviceapiv1.GetSatelliteHostsOptions{ - Controller: &location, - } - hostList, resp, err := satClient.GetSatelliteHosts(hostOptions) - if err != nil { - if resp != nil && resp.StatusCode == 404 { - d.SetId("") - return nil - } - log.Println("resourceIBMSatelliteHostRead : error in getting hostlist :", err, resp) - return err - } - - for _, h := range hostList { - if hostName == *h.Name || hostName == *h.ID { - d.Set(hostLocation, location) - d.Set("host_id", hostName) - - if _, ok := d.GetOk(hostLabels); ok { - l := d.Get(hostLabels).(*schema.Set) - d.Set(hostLabels, l) - } - - if h.Health != nil { - d.Set(hostState, *h.Health.Status) - } - - if _, ok := d.GetOk(hostCluster); ok { - d.Set(hostCluster, d.Get(hostCluster).(string)) - } else { - d.Set(hostCluster, location) - } - - if h.Assignment != nil { - d.Set(hostWorkerPool, *h.Assignment.WorkerPoolName) - d.Set(hostZone, *h.Assignment.Zone) - } - } - } - - return nil -} - -func resourceIBMSatelliteHostUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) - if err != nil { - return err - } - - locationName := parts[0] - hostID := parts[1] - satClient, err := meta.(ClientSession).SatelliteClientSession() - if err != nil { - return err - } - - updateHostOptions := &kubernetesserviceapiv1.UpdateSatelliteHostOptions{} - updateHostOptions.Controller = &locationName - updateHostOptions.HostID = &hostID - - if v, ok := d.GetOk(hostState); ok && v != nil && v.(string) == rsHostReadyStatus { - labels := make(map[string]string) - if _, ok := d.GetOk(hostLabels); ok { - l := d.Get(hostLabels).(*schema.Set) - labels = flattenHostLabels(l.List()) - updateHostOptions.Labels = labels - } - response, err := satClient.UpdateSatelliteHost(updateHostOptions) - if err != nil { - return fmt.Errorf("Error Updating Satellite Host: %s\n%s", err, response) - } - } - - return resourceIBMSatelliteHostRead(d, meta) -} - -func resourceIBMSatelliteHostDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) - if err != nil { - return err - } - - location := parts[0] - hostID := parts[1] - satClient, err := meta.(ClientSession).SatelliteClientSession() - if err != nil { - return err - } - - removeSatHostOptions := &kubernetesserviceapiv1.RemoveSatelliteHostOptions{} - removeSatHostOptions.Controller = &location - removeSatHostOptions.HostID = &hostID - - response, err := satClient.RemoveSatelliteHost(removeSatHostOptions) - if err != nil { - if response != nil && response.StatusCode == 404 { - return nil - } - return fmt.Errorf("Error Deleting Satellite Host: %s\n%s", err, response) - } - - d.SetId("") - return nil -} - -func waitForHostAttachment(hostName, location string, d *schema.ResourceData, meta interface{}) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() - if err != nil { - return false, err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{rsHostProvisioningStatus, rsHostUnknownStatus}, - Target: []string{rsHostReadyStatus, rsHostNormalStatus}, - Refresh: func() (interface{}, string, error) { - attachOptions := &kubernetesserviceapiv1.GetSatelliteHostsOptions{ - Controller: &location, - } - hostList, resp, err := satClient.GetSatelliteHosts(attachOptions) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() != 404 { - return nil, "", fmt.Errorf("The satellite host (%s) failed to attached: %v\n%s", hostName, err, resp) - } - } - - if hostList != nil { - for _, h := range hostList { - if h.Health != nil { - if (hostName == *h.Name) && (*h.Health.Status == rsHostNormalStatus || *h.Health.Status == rsHostReadyStatus) { - return *h.Health.Status, *h.Health.Status, err - } - } - } - } - return hostName, rsHostProvisioningStatus, nil - }, - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 60 * time.Second, - MinTimeout: 60 * time.Second, - } - - return stateConf.WaitForState() -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_account_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_account_settings.go deleted file mode 100644 index 49cc7d43c6..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_account_settings.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/scc-go-sdk/adminserviceapiv1" -) - -func resourceIBMSccAccountSettings() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceIbmSccAccountSettingsUpdate, - ReadContext: resourceIbmSccAccountSettingsRead, - UpdateContext: resourceIbmSccAccountSettingsUpdate, - DeleteContext: resourceIbmSccAccountSettingsDelete, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "location_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator("ibm_scc_account_settings", "location_id"), - Description: "The programatic ID of the location that you want to work in.", - }, - }, - } -} - -func resourceIbmSccAccountSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - adminServiceClient, err := meta.(ClientSession).AdminServiceApiV1() - if err != nil { - return diag.FromErr(err) - } - - getAccountSettingsOption := &adminserviceapiv1.GetSettingsOptions{} - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - accountID := userDetails.userAccount - - getAccountSettingsOption.SetAccountID(accountID) - - accountSettings, response, err := adminServiceClient.GetSettingsWithContext(context, getAccountSettingsOption) - if err != nil { - if response != nil && response.StatusCode == 404 { - return nil - } - log.Printf("[DEBUG] GetSettingsWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("GetSettingsWithContext failed %s\n%s", err, response)) - } - - d.SetId(*accountSettings.Location.ID) - - return nil - -} - -func resourceIbmSccAccountSettingsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - adminServiceClient, err := meta.(ClientSession).AdminServiceApiV1() - if err != nil { - return diag.FromErr(err) - } - - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(err) - } - accountID := userDetails.userAccount - - locationID := d.Get("location_id").(string) - updateAccountSettingsOption := &adminserviceapiv1.PatchAccountSettingsOptions{} - updateAccountSettingsOption.SetAccountID(accountID) - updateAccountSettingsOption.SetLocation(&adminserviceapiv1.LocationID{ - ID: core.StringPtr(locationID), - }) - - _, response, err := adminServiceClient.PatchAccountSettingsWithContext(context, updateAccountSettingsOption) - if err != nil { - log.Printf("[DEBUG] PatchAccountSettingsWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("PatchAccountSettingsWithContext failed %s\n%s", err, response)) - } - - d.SetId(locationID) - - return resourceIbmSccAccountSettingsRead(context, d, meta) -} - -func resourceIBMSccAccountSettingsValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 2) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "location_id", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: "us, eu, uk", - }, - ) - - resourceValidator := ResourceValidator{ResourceName: "ibm_scc_account_settings", Schema: validateSchema} - return &resourceValidator -} - -func resourceIbmSccAccountSettingsDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_scope.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_scope.go deleted file mode 100644 index 756ab62e85..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_scope.go +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright IBM Corp. 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "context" - "fmt" - "log" - "os" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/IBM/scc-go-sdk/posturemanagementv2" -) - -func resourceIBMSccPostureScopes() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceIBMSccPostureScopesCreate, - ReadContext: resourceIBMSccPostureScopesRead, - UpdateContext: resourceIBMSccPostureScopesUpdate, - DeleteContext: resourceIBMSccPostureScopesDelete, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_scope", "name"), - Description: "A unique name for your scope.", - }, - "description": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_scope", "description"), - Description: "A detailed description of the scope.", - }, - "collector_ids": &schema.Schema{ - Type: schema.TypeList, - Required: true, - Description: "The unique IDs of the collectors that are attached to the scope.", - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "credential_id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_scope", "credential_id"), - Description: "The unique identifier of the credential.", - }, - "credential_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_scope", "credential_type"), - Description: "The environment that the scope is targeted to.", - }, - }, - } -} - -func resourceIBMSccPostureScopesValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) - validateSchema = append(validateSchema, - ValidateSchema{ - Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Required: true, - Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, - MinValueLength: 1, - MaxValueLength: 50, - }, - ValidateSchema{ - Identifier: "description", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Required: true, - Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, - MinValueLength: 1, - MaxValueLength: 255, - }, - ValidateSchema{ - Identifier: "credential_id", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, - Required: true, - Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, - MinValueLength: 1, - MaxValueLength: 50, - }, - ValidateSchema{ - Identifier: "credential_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, - Required: true, - AllowedValues: "aws, azure, gcp, hosted, ibm, on_premise, openstack, services", - }, - ) - - resourceValidator := ResourceValidator{ResourceName: "ibm_scc_posture_scope", Schema: validateSchema} - return &resourceValidator -} - -func resourceIBMSccPostureScopesCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() - if err != nil { - return diag.FromErr(err) - } - - createScopeOptions := &posturemanagementv2.CreateScopeOptions{} - createScopeOptions.SetAccountID(os.Getenv("SCC_POSTURE_ACCOUNT_ID")) - - createScopeOptions.SetName(d.Get("name").(string)) - createScopeOptions.SetDescription(d.Get("description").(string)) - createScopeOptions.SetCollectorIds([]string{"4188"}) //[]string{ - createScopeOptions.SetCredentialID(d.Get("credential_id").(string)) - createScopeOptions.SetCredentialType(d.Get("credential_type").(string)) - - scope, response, err := postureManagementClient.CreateScopeWithContext(context, createScopeOptions) - if err != nil { - log.Printf("[DEBUG] CreateScopeWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("CreateScopeWithContext failed %s\n%s", err, response)) - } - - d.SetId(*scope.ID) - - return resourceIBMSccPostureScopesRead(context, d, meta) -} - -func resourceIBMSccPostureScopesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() - if err != nil { - return diag.FromErr(err) - } - - listScopesOptions := &posturemanagementv2.ListScopesOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() - if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) - } - - accountID := userDetails.userAccount - listScopesOptions.SetAccountID(accountID) - - scopeList, response, err := postureManagementClient.ListScopesWithContext(context, listScopesOptions) - d.SetId(*(scopeList.Scopes[0].ID)) - if err != nil { - if response != nil && response.StatusCode == 404 { - d.SetId("") - return nil - } - log.Printf("[DEBUG] ListScopesWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("ListScopesWithContext failed %s\n%s", err, response)) - } - - return nil -} - -func resourceIBMSccPostureScopesUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() - if err != nil { - return diag.FromErr(err) - } - - updateScopeDetailsOptions := &posturemanagementv2.UpdateScopeDetailsOptions{} - updateScopeDetailsOptions.SetAccountID(os.Getenv("SCC_POSTURE_ACCOUNT_ID")) - - hasChange := false - - updateScopeDetailsOptions.SetID(d.Id()) - - if d.HasChange("name") { - updateScopeDetailsOptions.SetName(d.Get("name").(string)) - hasChange = true - } - if d.HasChange("description") { - updateScopeDetailsOptions.SetDescription(d.Get("description").(string)) - hasChange = true - } - - if hasChange { - _, response, err := postureManagementClient.UpdateScopeDetailsWithContext(context, updateScopeDetailsOptions) - if err != nil { - log.Printf("[DEBUG] UpdateScopeDetailsWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("UpdateScopeDetailsWithContext failed %s\n%s", err, response)) - } - } - - return resourceIBMSccPostureScopesRead(context, d, meta) -} - -func resourceIBMSccPostureScopesDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() - if err != nil { - return diag.FromErr(err) - } - - deleteScopeOptions := &posturemanagementv2.DeleteScopeOptions{} - deleteScopeOptions.SetAccountID(os.Getenv("SCC_POSTURE_ACCOUNT_ID")) - - deleteScopeOptions.SetID(d.Id()) - - response, err := postureManagementClient.DeleteScopeWithContext(context, deleteScopeOptions) - if err != nil { - log.Printf("[DEBUG] DeleteScopeWithContext failed %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("DeleteScopeWithContext failed %s\n%s", err, response)) - } - - d.SetId("") - - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_space.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_space.go deleted file mode 100644 index ef61dc2727..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_space.go +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" - "github.com/IBM-Cloud/bluemix-go/bmxerror" - "github.com/IBM-Cloud/bluemix-go/helpers" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceIBMSpace() *schema.Resource { - return &schema.Resource{ - Create: resourceIBMSpaceCreate, - Read: resourceIBMSpaceRead, - Update: resourceIBMSpaceUpdate, - Delete: resourceIBMSpaceDelete, - Exists: resourceIBMSpaceExists, - Importer: &schema.ResourceImporter{}, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "The name for the space", - }, - "org": { - Description: "The org this space belongs to", - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "auditors": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have auditor role in this space, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - "managers": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have manager role in this space, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - "developers": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Description: "The IBMID of the users who will have developer role in this space, ex - user@example.com", - Set: resourceIBMVPCHash, - }, - "space_quota": { - Description: "The name of the Space Quota Definition", - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "tags": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - } -} - -func resourceIBMSpaceCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - org := d.Get("org").(string) - name := d.Get("name").(string) - - req := mccpv2.SpaceCreateRequest{ - Name: name, - } - - orgFields, err := cfClient.Organizations().FindByName(org, BluemixRegion) - if err != nil { - return fmt.Errorf("Error retrieving org: %s", err) - } - req.OrgGUID = orgFields.GUID - - if spaceQuota, ok := d.GetOk("space_quota"); ok { - quota, err := cfClient.SpaceQuotas().FindByName(spaceQuota.(string), orgFields.GUID) - if err != nil { - return fmt.Errorf("Error retrieving space quota: %s", err) - } - req.SpaceQuotaGUID = quota.GUID - } - - spaceAPI := cfClient.Spaces() - space, err := spaceAPI.Create(req) - if err != nil { - return fmt.Errorf("Error creating space: %s", err) - } - - spaceGUID := space.Metadata.GUID - d.SetId(spaceGUID) - - if developerSet := d.Get("developers").(*schema.Set); len(developerSet.List()) > 0 { - developers := expandStringList(developerSet.List()) - for _, d := range developers { - _, err := spaceAPI.AssociateDeveloper(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error associating developer %s with space %s : %s", d, spaceGUID, err) - } - } - } - - if auditorSet := d.Get("auditors").(*schema.Set); len(auditorSet.List()) > 0 { - auditors := expandStringList(auditorSet.List()) - for _, d := range auditors { - _, err := spaceAPI.AssociateAuditor(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error associating auditor %s with space %s : %s", d, spaceGUID, err) - } - } - - } - if managerSet := d.Get("managers").(*schema.Set); len(managerSet.List()) > 0 { - managers := expandStringList(managerSet.List()) - for _, d := range managers { - _, err := spaceAPI.AssociateManager(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error associating manager %s with space %s : %s", d, spaceGUID, err) - } - } - } - - return resourceIBMSpaceRead(d, meta) -} - -func resourceIBMSpaceRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - spaceGUID := d.Id() - - spaceAPI := cfClient.Spaces() - orgAPI := cfClient.Organizations() - spaceDetails, err := spaceAPI.Get(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving space: %s", err) - } - - auditors, err := spaceAPI.ListAuditors(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving auditors in the space: %s", err) - } - - managers, err := spaceAPI.ListManagers(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving managers in the space: %s", err) - } - - developers, err := spaceAPI.ListDevelopers(spaceGUID) - if err != nil { - return fmt.Errorf("Error retrieving developers in space: %s", err) - } - - d.Set("auditors", flattenSpaceRoleUsers(auditors)) - d.Set("managers", flattenSpaceRoleUsers(managers)) - d.Set("developers", flattenSpaceRoleUsers(developers)) - - if spaceDetails.Entity.SpaceQuotaGUID != "" { - sqAPI := cfClient.SpaceQuotas() - quota, err := sqAPI.Get(spaceDetails.Entity.SpaceQuotaGUID) - if err != nil { - return fmt.Errorf("Error retrieving quotas details for space: %s", err) - } - d.Set("space_quota", quota.Entity.Name) - } - d.Set("name", spaceDetails.Entity.Name) - org, err := orgAPI.Get(spaceDetails.Entity.OrgGUID) - if err != nil { - return fmt.Errorf("Error retrieving Organization details for space: %s", err) - } - d.Set("org", org.Entity.Name) - return nil -} - -func resourceIBMSpaceUpdate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - id := d.Id() - - req := mccpv2.SpaceUpdateRequest{} - if d.HasChange("name") { - req.Name = helpers.String(d.Get("name").(string)) - } - - api := cfClient.Spaces() - _, err = api.Update(id, req) - if err != nil { - return fmt.Errorf("Error updating space: %s", err) - } - - err = updateAuditors(api, id, d) - if err != nil { - return err - } - err = updateManagers(api, id, d) - if err != nil { - return err - } - err = updateDevelopers(api, id, d) - if err != nil { - return err - } - return resourceIBMSpaceRead(d, meta) -} - -func resourceIBMSpaceDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return err - } - id := d.Id() - - err = cfClient.Spaces().Delete(id, false) - if err != nil { - return fmt.Errorf("Error deleting space: %s", err) - } - - d.SetId("") - return nil -} - -func resourceIBMSpaceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() - if err != nil { - return false, err - } - id := d.Id() - - space, err := cfClient.Spaces().Get(id) - if err != nil { - if apiErr, ok := err.(bmxerror.RequestFailure); ok { - if apiErr.StatusCode() == 404 { - return false, nil - } - } - return false, fmt.Errorf("[ERROR] Error getting space: %s", err) - } - - return space.Metadata.GUID == id, nil -} - -func updateDevelopers(api mccpv2.Spaces, spaceGUID string, d *schema.ResourceData) error { - if !d.HasChange("developers") { - return nil - } - var remove, add []string - o, n := d.GetChange("developers") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - - if len(add) > 0 { - for _, d := range add { - _, err := api.AssociateDeveloper(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error associating developer %s with space %s : %s", d, spaceGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateDeveloper(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating developer %s with space %s : %s", d, spaceGUID, err) - } - } - } - return nil -} - -func updateManagers(api mccpv2.Spaces, spaceGUID string, d *schema.ResourceData) error { - if !d.HasChange("managers") { - return nil - } - var remove, add []string - o, n := d.GetChange("managers") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - - if len(add) > 0 { - for _, d := range add { - _, err := api.AssociateManager(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error associating manager %s with space %s : %s", d, spaceGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateManager(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating manager %s with space %s : %s", d, spaceGUID, err) - } - } - } - return nil -} -func updateAuditors(api mccpv2.Spaces, spaceGUID string, d *schema.ResourceData) error { - if !d.HasChange("auditors") { - return nil - } - var remove, add []string - o, n := d.GetChange("auditors") - os := o.(*schema.Set) - ns := n.(*schema.Set) - - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) - - if len(add) > 0 { - for _, d := range add { - _, err := api.AssociateAuditor(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error associating auditor %s with space %s : %s", d, spaceGUID, err) - } - } - } - if len(remove) > 0 { - for _, d := range remove { - err := api.DisassociateAuditor(spaceGUID, d) - if err != nil { - return fmt.Errorf("Error dis-associating auditor %s with space %s : %s", d, spaceGUID, err) - } - } - } - return nil -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/README.md new file mode 100644 index 0000000000..bfe779cbf5 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider API Gateway + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the API Gateway resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/api_gateway_endpoint) +* IBM API Docs: [IBM API Docs for API Gateway](https://cloud.ibm.com/apidocs/api-gateway/apigw-endpoints-v1) +* IBM API Gateway SDK: [IBM SDK for API Gateway](https://github.com/IBM/apigateway-go-sdk/tree/master/apigatewaycontrollerapiv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_api_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/data_source_ibm_api_gateway.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_api_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/data_source_ibm_api_gateway.go index e4b3a12e89..5b15e8d826 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_api_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/data_source_ibm_api_gateway.go @@ -1,18 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package apigateway import ( "encoding/json" "fmt" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" apigatewaysdk "github.com/IBM/apigateway-go-sdk/apigatewaycontrollerapiv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMApiGateway() *schema.Resource { +func DataSourceIBMApiGateway() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMApiGatewayRead, Schema: map[string]*schema.Schema{ @@ -111,11 +112,11 @@ func dataSourceIBMApiGateway() *schema.Resource { } func dataSourceIBMApiGatewayRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -127,7 +128,7 @@ func dataSourceIBMApiGatewayRead(d *schema.ResourceData, meta interface{}) error payload.ServiceInstanceCrn = &serviceInstanceCrn allendpoints, response, err := endpointservice.GetAllEndpoints(payload) if err != nil { - return fmt.Errorf("Error Getting All Endpoint: %s,%s", err, response) + return fmt.Errorf("[ERROR] Error Getting All Endpoint: %s,%s", err, response) } endpointsMap := make([]map[string]interface{}, 0, len(*allendpoints)) @@ -141,7 +142,7 @@ func dataSourceIBMApiGatewayRead(d *schema.ResourceData, meta interface{}) error swagger, err := endpointservice.GetEndpointSwagger(swaggerPayload) if err != nil { - return fmt.Errorf("Error Getting All Endpoint: %s,%s", err, swagger) + return fmt.Errorf("[ERROR] Error Getting All Endpoint: %s,%s", err, swagger) } doc := swagger.Result str, err := json.Marshal(doc) @@ -161,7 +162,7 @@ func dataSourceIBMApiGatewayRead(d *schema.ResourceData, meta interface{}) error } allsubscriptions, response, err := endpointservice.GetAllSubscriptions(SubscriptionPayload) if err != nil { - return fmt.Errorf("Error Getting All Endpoint: %s %s", err, response) + return fmt.Errorf("[ERROR] Error Getting All Endpoint: %s %s", err, response) } subscriptionMap := make([]map[string]interface{}, 0, len(*allsubscriptions)) for _, subscription := range *allsubscriptions { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_api_gateway_endpoint.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/resource_ibm_api_gateway_endpoint.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_api_gateway_endpoint.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/resource_ibm_api_gateway_endpoint.go index f79c41ab62..bbb99b66a7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_api_gateway_endpoint.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/resource_ibm_api_gateway_endpoint.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package apigateway import ( "fmt" @@ -9,12 +9,13 @@ import ( "path" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" apigatewaysdk "github.com/IBM/apigateway-go-sdk/apigatewaycontrollerapiv1" "github.com/ghodss/yaml" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMApiGatewayEndPoint() *schema.Resource { +func ResourceIBMApiGatewayEndPoint() *schema.Resource { return &schema.Resource{ Create: resourceIBMApiGatewayEndPointCreate, @@ -84,11 +85,11 @@ func resourceIBMApiGatewayEndPoint() *schema.Resource { } func resourceIBMApiGatewayEndPointCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -133,7 +134,7 @@ func resourceIBMApiGatewayEndPointCreate(d *schema.ResourceData, meta interface{ } document = y2j } else { - return fmt.Errorf("File extension type must be json or yaml") + return fmt.Errorf("[ERROR] File extension type must be json or yaml") } } @@ -152,7 +153,7 @@ func resourceIBMApiGatewayEndPointCreate(d *schema.ResourceData, meta interface{ result, response, err := endpointservice.CreateEndpoint(payload) if err != nil { - return fmt.Errorf("Error creating Endpoint: %s,%s", err, response) + return fmt.Errorf("[ERROR] Error creating Endpoint: %s,%s", err, response) } d.SetId(fmt.Sprintf("%s//%s", *result.ServiceInstanceCrn, *result.ArtifactID)) @@ -161,11 +162,11 @@ func resourceIBMApiGatewayEndPointCreate(d *schema.ResourceData, meta interface{ } func resourceIBMApiGatewayEndPointGet(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -173,7 +174,7 @@ func resourceIBMApiGatewayEndPointGet(d *schema.ResourceData, meta interface{}) parts := d.Id() partslist := strings.Split(parts, "//") if len(partslist) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of instanceCRN//artifactID", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of instanceCRN//artifactID", d.Id()) } serviceInstanceCrn := partslist[0] @@ -193,7 +194,7 @@ func resourceIBMApiGatewayEndPointGet(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error Getting Endpoint: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Endpoint: %s\n%s", err, response) } d.Set("service_instance_crn", serviceInstanceCrn) d.Set("endpoint_id", apiID) @@ -213,11 +214,11 @@ func resourceIBMApiGatewayEndPointGet(d *schema.ResourceData, meta interface{}) } func resourceIBMApiGatewayEndPointUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -270,7 +271,7 @@ func resourceIBMApiGatewayEndPointUpdate(d *schema.ResourceData, meta interface{ } document = y2j } else { - return fmt.Errorf("File extension type must be json or yaml") + return fmt.Errorf("[ERROR] File extension type must be json or yaml") } } @@ -303,14 +304,14 @@ func resourceIBMApiGatewayEndPointUpdate(d *schema.ResourceData, meta interface{ if d.HasChange("type") { actionType := d.Get("type").(string) - if managed == false && actionType == "share" { - return fmt.Errorf("Endpoint %s not managed", apiID) + if !managed && actionType == "share" { + return fmt.Errorf("[ERROR] Endpoint %s not managed", apiID) } actionPayload.Type = &actionType _, response, err := endpointservice.EndpointActions(actionPayload) if err != nil { - return fmt.Errorf("Error updating Endpoint Action: %s,%s", err, response) + return fmt.Errorf("[ERROR] Error updating Endpoint Action: %s,%s", err, response) } } @@ -340,7 +341,7 @@ func resourceIBMApiGatewayEndPointUpdate(d *schema.ResourceData, meta interface{ } document = y2j } else { - return fmt.Errorf("File extension type must be json or yaml") + return fmt.Errorf("[ERROR] File extension type must be json or yaml") } } @@ -355,17 +356,17 @@ func resourceIBMApiGatewayEndPointUpdate(d *schema.ResourceData, meta interface{ if update { _, response, err := endpointservice.UpdateEndpoint(payload) if err != nil { - return fmt.Errorf("Error updating Endpoint: %s,%s", err, response) + return fmt.Errorf("[ERROR] Error updating Endpoint: %s,%s", err, response) } } return resourceIBMApiGatewayEndPointGet(d, meta) } func resourceIBMApiGatewayEndPointDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -390,7 +391,7 @@ func resourceIBMApiGatewayEndPointDelete(d *schema.ResourceData, meta interface{ if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error deleting Endpoint: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting Endpoint: %s\n%s", err, response) } d.SetId("") @@ -398,11 +399,11 @@ func resourceIBMApiGatewayEndPointDelete(d *schema.ResourceData, meta interface{ } func resourceIBMApiGatewayEndPointExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return false, err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return false, err } @@ -410,7 +411,7 @@ func resourceIBMApiGatewayEndPointExists(d *schema.ResourceData, meta interface{ parts := d.Id() partslist := strings.Split(parts, "//") if len(partslist) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of instanceCRN//artifactID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of instanceCRN//artifactID", d.Id()) } serviceInstanceCrn := partslist[0] diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_api_gateway_endpoint_subscription.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/resource_ibm_api_gateway_endpoint_subscription.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_api_gateway_endpoint_subscription.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/resource_ibm_api_gateway_endpoint_subscription.go index 77843a5765..ecd3c5263c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_api_gateway_endpoint_subscription.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway/resource_ibm_api_gateway_endpoint_subscription.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package apigateway import ( "fmt" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" apigatewaysdk "github.com/IBM/apigateway-go-sdk/apigatewaycontrollerapiv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMApiGatewayEndpointSubscription() *schema.Resource { +func ResourceIBMApiGatewayEndpointSubscription() *schema.Resource { return &schema.Resource{ Create: resourceIBMApiGatewayEndpointSubscriptionCreate, @@ -41,7 +43,7 @@ func resourceIBMApiGatewayEndpointSubscription() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"external", "internal"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"external", "internal"}), Description: "Subscription type. Allowable values are external, internal", }, "client_secret": { @@ -66,11 +68,11 @@ func resourceIBMApiGatewayEndpointSubscription() *schema.Resource { } } func resourceIBMApiGatewayEndpointSubscriptionCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -114,7 +116,7 @@ func resourceIBMApiGatewayEndpointSubscriptionCreate(d *schema.ResourceData, met result, response, err := endpointservice.CreateSubscription(payload) if err != nil { - return fmt.Errorf("Error creating Subscription: %s %s", err, response) + return fmt.Errorf("[ERROR] Error creating Subscription: %s %s", err, response) } d.SetId(fmt.Sprintf("%s//%s", *result.ArtifactID, *result.ClientID)) @@ -122,11 +124,11 @@ func resourceIBMApiGatewayEndpointSubscriptionCreate(d *schema.ResourceData, met } func resourceIBMApiGatewayEndpointSubscriptionGet(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -134,7 +136,7 @@ func resourceIBMApiGatewayEndpointSubscriptionGet(d *schema.ResourceData, meta i parts := d.Id() partslist := strings.Split(parts, "//") if len(partslist) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of artifactID//clientID", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of artifactID//clientID", d.Id()) } artifactID := partslist[0] clientID := partslist[1] @@ -153,7 +155,7 @@ func resourceIBMApiGatewayEndpointSubscriptionGet(d *schema.ResourceData, meta i d.SetId("") return nil } - return fmt.Errorf("Error Getting Subscription: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Subscription: %s\n%s", err, response) } d.Set("artifact_id", result.ArtifactID) d.Set("client_id", result.ClientID) @@ -169,11 +171,11 @@ func resourceIBMApiGatewayEndpointSubscriptionGet(d *schema.ResourceData, meta i } func resourceIBMApiGatewayEndpointSubscriptionUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -214,24 +216,24 @@ func resourceIBMApiGatewayEndpointSubscriptionUpdate(d *schema.ResourceData, met } _, SecretResponse, err := endpointservice.AddSubscriptionSecret(secretpayload) if err != nil { - return fmt.Errorf("Error Adding Secret to Subscription: %s,%s", err, SecretResponse) + return fmt.Errorf("[ERROR] Error Adding Secret to Subscription: %s,%s", err, SecretResponse) } } if update { _, response, err := endpointservice.UpdateSubscription(payload) if err != nil { - return fmt.Errorf("Error updating Subscription: %s,%s", err, response) + return fmt.Errorf("[ERROR] Error updating Subscription: %s,%s", err, response) } } return resourceIBMApiGatewayEndpointSubscriptionGet(d, meta) } func resourceIBMApiGatewayEndpointSubscriptionDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return err } @@ -253,7 +255,7 @@ func resourceIBMApiGatewayEndpointSubscriptionDelete(d *schema.ResourceData, met if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error deleting Subscription: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting Subscription: %s\n%s", err, response) } d.SetId("") @@ -261,18 +263,18 @@ func resourceIBMApiGatewayEndpointSubscriptionDelete(d *schema.ResourceData, met } func resourceIBMApiGatewayEndpointSubscriptionExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return false, err } - endpointservice, err := meta.(ClientSession).APIGateway() + endpointservice, err := meta.(conns.ClientSession).APIGateway() if err != nil { return false, err } parts := d.Id() partslist := strings.Split(parts, "//") if len(partslist) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of artifactID//clientID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of artifactID//clientID", d.Id()) } artifactID := partslist[0] clientID := partslist[1] diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/README.md new file mode 100644 index 0000000000..d78aea7a6e --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider APP Configuration + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the APP Configuration resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/app_config_environment) +* IBM API Docs: [IBM API Docs for APP Configuration](https://cloud.ibm.com/apidocs/app-configuration) +* IBM APP Configuration SDK: [IBM SDK for APP Configuration](https://github.com/IBM/appconfiguration-go-admin-sdk/tree/master/appconfigurationv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_environment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_environment.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_environment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_environment.go index 29f31c38f8..738f8f278e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_environment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_environment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appconfiguration import ( "fmt" @@ -12,7 +12,7 @@ import ( "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" ) -func dataSourceIbmAppConfigEnvironment() *schema.Resource { +func DataSourceIBMAppConfigEnvironment() *schema.Resource { return &schema.Resource{ Read: dataSourceIbmAppConfigEnvironmentRead, @@ -96,37 +96,37 @@ func dataSourceIbmAppConfigEnvironmentRead(d *schema.ResourceData, meta interfac if result.Name != nil { if err = d.Set("name", result.Name); err != nil { - return fmt.Errorf("error setting name: %s", err) + return fmt.Errorf("[ERROR] Error setting name: %s", err) } } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return fmt.Errorf("error setting description: %s", err) + return fmt.Errorf("[ERROR] Error setting description: %s", err) } } if result.Tags != nil { if err = d.Set("tags", result.Tags); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("[ERROR] Error setting tags: %s", err) } } if result.ColorCode != nil { if err = d.Set("color_code", result.ColorCode); err != nil { - return fmt.Errorf("error setting color_code: %s", err) + return fmt.Errorf("[ERROR] Error setting color_code: %s", err) } } if result.CreatedTime != nil { if err = d.Set("created_time", result.CreatedTime.String()); err != nil { - return fmt.Errorf("error setting created_time: %s", err) + return fmt.Errorf("[ERROR] Error setting created_time: %s", err) } } if result.UpdatedTime != nil { if err = d.Set("updated_time", result.UpdatedTime.String()); err != nil { - return fmt.Errorf("error setting updated_time: %s", err) + return fmt.Errorf("[ERROR] Error setting updated_time: %s", err) } } if result.Href != nil { if err = d.Set("href", result.Href); err != nil { - return fmt.Errorf("error setting href: %s", err) + return fmt.Errorf("[ERROR] Error setting href: %s", err) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_environments.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_environments.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_environments.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_environments.go index 22d74d4797..c9b3e23853 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_environments.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_environments.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appconfiguration import ( "fmt" @@ -15,7 +15,7 @@ import ( "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" ) -func dataSourceIbmAppConfigEnvironments() *schema.Resource { +func DataSourceIBMAppConfigEnvironments() *schema.Resource { return &schema.Resource{ Read: dataSourceIbmAppConfigEnvironmentsRead, @@ -219,48 +219,48 @@ func dataSourceIbmAppConfigEnvironmentsRead(d *schema.ResourceData, meta interfa if environmentList.Environments != nil { err = d.Set("environments", dataSourceEnvironmentListFlattenEnvironments(environmentList.Environments)) if err != nil { - return fmt.Errorf("error setting environments %s", err) + return fmt.Errorf("[ERROR] Error setting environments %s", err) } } if environmentList.TotalCount != nil { if err = d.Set("total_count", environmentList.TotalCount); err != nil { - return fmt.Errorf("error setting total_count: %s", err) + return fmt.Errorf("[ERROR] Error setting total_count: %s", err) } } if environmentList.Limit != nil { if err = d.Set("limit", environmentList.Limit); err != nil { - return fmt.Errorf("error setting limit: %s", err) + return fmt.Errorf("[ERROR] Error setting limit: %s", err) } } if environmentList.Offset != nil { if err = d.Set("offset", environmentList.Offset); err != nil { - return fmt.Errorf("error setting offset: %s", err) + return fmt.Errorf("[ERROR] Error setting offset: %s", err) } } if environmentList.First != nil { err = d.Set("first", dataSourceEnvironmentListFlattenPagination(*environmentList.First)) if err != nil { - return fmt.Errorf("error setting first %s", err) + return fmt.Errorf("[ERROR] Error setting first %s", err) } } if environmentList.Previous != nil { err = d.Set("previous", dataSourceEnvironmentListFlattenPagination(*environmentList.Previous)) if err != nil { - return fmt.Errorf("error setting previous %s", err) + return fmt.Errorf("[ERROR] Error setting previous %s", err) } } if environmentList.Last != nil { err = d.Set("last", dataSourceEnvironmentListFlattenPagination(*environmentList.Last)) if err != nil { - return fmt.Errorf("error setting last %s", err) + return fmt.Errorf("[ERROR] Error setting last %s", err) } } if environmentList.Next != nil { err = d.Set("next", dataSourceEnvironmentListFlattenPagination(*environmentList.Next)) if err != nil { - return fmt.Errorf("error setting next %s", err) + return fmt.Errorf("[ERROR] Error setting next %s", err) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_feature.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_feature.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go index 0950d9b6cd..047502882d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_feature.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_feature.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appconfiguration import ( "fmt" @@ -13,7 +13,7 @@ import ( "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" ) -func dataSourceIbmAppConfigFeature() *schema.Resource { +func DataSourceIBMAppConfigFeature() *schema.Resource { return &schema.Resource{ Read: dataSourceIbmAppConfigFeatureRead, @@ -178,47 +178,47 @@ func dataSourceIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{}) d.SetId(fmt.Sprintf("%s/%s/%s", guid, *options.EnvironmentID, *result.FeatureID)) if result.Name != nil { if err = d.Set("name", result.Name); err != nil { - return fmt.Errorf("error setting name: %s", err) + return fmt.Errorf("[ERROR] Error setting name: %s", err) } } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return fmt.Errorf("error setting description: %s", err) + return fmt.Errorf("[ERROR] Error setting description: %s", err) } } if result.Type != nil { if err = d.Set("type", result.Type); err != nil { - return fmt.Errorf("error setting type: %s", err) + return fmt.Errorf("[ERROR] Error setting type: %s", err) } } if result.Enabled != nil { if err = d.Set("enabled", result.Enabled); err != nil { - return fmt.Errorf("error setting enabled: %s", err) + return fmt.Errorf("[ERROR] Error setting enabled: %s", err) } } if result.Tags != nil { if err = d.Set("tags", result.Tags); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("[ERROR] Error setting tags: %s", err) } } if result.SegmentExists != nil { if err = d.Set("segment_exists", result.SegmentExists); err != nil { - return fmt.Errorf("error setting segment_exists: %s", err) + return fmt.Errorf("[ERROR] Error setting segment_exists: %s", err) } } if result.CreatedTime != nil { if err = d.Set("created_time", result.CreatedTime.String()); err != nil { - return fmt.Errorf("error setting created_time: %s", err) + return fmt.Errorf("[ERROR] Error setting created_time: %s", err) } } if result.UpdatedTime != nil { if err = d.Set("updated_time", result.UpdatedTime.String()); err != nil { - return fmt.Errorf("error setting updated_time: %s", err) + return fmt.Errorf("[ERROR] Error setting updated_time: %s", err) } } if result.Href != nil { if err = d.Set("href", result.Href); err != nil { - return fmt.Errorf("error setting href: %s", err) + return fmt.Errorf("[ERROR] Error setting href: %s", err) } } @@ -251,14 +251,14 @@ func dataSourceIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{}) if result.SegmentRules != nil { err = d.Set("segment_rules", dataSourceFeatureFlattenSegmentRules(result.SegmentRules)) if err != nil { - return fmt.Errorf("error setting segment_rules %s", err) + return fmt.Errorf("[ERROR] Error setting segment_rules %s", err) } } if result.Collections != nil { err = d.Set("collections", dataSourceFeatureFlattenCollections(result.Collections)) if err != nil { - return fmt.Errorf("error setting collections %s", err) + return fmt.Errorf("[ERROR] Error setting collections %s", err) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_features.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_features.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_features.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_features.go index 510f252705..bf862e4ea7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_config_features.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/data_source_ibm_app_config_features.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appconfiguration import ( "fmt" @@ -15,7 +15,7 @@ import ( "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" ) -func dataSourceIbmAppConfigFeatures() *schema.Resource { +func DataSourceIBMAppConfigFeatures() *schema.Resource { return &schema.Resource{ Read: dataSourceIbmAppConfigFeaturesRead, @@ -340,48 +340,48 @@ func dataSourceIbmAppConfigFeaturesRead(d *schema.ResourceData, meta interface{} if featuresList.Features != nil { err = d.Set("features", dataSourceFeaturesListFlattenFeatures(featuresList.Features)) if err != nil { - return fmt.Errorf("error setting features %s", err) + return fmt.Errorf("[ERROR] Error setting features %s", err) } } if featuresList.TotalCount != nil { if err = d.Set("total_count", featuresList.TotalCount); err != nil { - return fmt.Errorf("error setting total_count: %s", err) + return fmt.Errorf("[ERROR] Error setting total_count: %s", err) } } if featuresList.Limit != nil { if err = d.Set("limit", featuresList.Limit); err != nil { - return fmt.Errorf("error setting limit: %s", err) + return fmt.Errorf("[ERROR] Error setting limit: %s", err) } } if featuresList.Offset != nil { if err = d.Set("offset", featuresList.Offset); err != nil { - return fmt.Errorf("error setting offset: %s", err) + return fmt.Errorf("[ERROR] Error setting offset: %s", err) } } if featuresList.First != nil { err = d.Set("first", dataSourceFeatureListFlattenPagination(*featuresList.First)) if err != nil { - return fmt.Errorf("error setting first %s", err) + return fmt.Errorf("[ERROR] Error setting first %s", err) } } if featuresList.Previous != nil { err = d.Set("previous", dataSourceFeatureListFlattenPagination(*featuresList.Previous)) if err != nil { - return fmt.Errorf("error setting previous %s", err) + return fmt.Errorf("[ERROR] Error setting previous %s", err) } } if featuresList.Last != nil { err = d.Set("last", dataSourceFeatureListFlattenPagination(*featuresList.Last)) if err != nil { - return fmt.Errorf("error setting last %s", err) + return fmt.Errorf("[ERROR] Error setting last %s", err) } } if featuresList.Next != nil { err = d.Set("next", dataSourceFeatureListFlattenPagination(*featuresList.Next)) if err != nil { - return fmt.Errorf("error setting next %s", err) + return fmt.Errorf("[ERROR] Error setting next %s", err) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_config_environment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/resource_ibm_app_config_environment.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_config_environment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/resource_ibm_app_config_environment.go index d947eb18ce..5ca709a6ec 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_config_environment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/resource_ibm_app_config_environment.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appconfiguration import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIbmAppConfigEnvironment() *schema.Resource { +func ResourceIBMAppConfigEnvironment() *schema.Resource { return &schema.Resource{ Read: resourceEnvironmentRead, Create: resourceEnvironmentCreate, @@ -70,16 +72,16 @@ func resourceIbmAppConfigEnvironment() *schema.Resource { } func getAppConfigClient(meta interface{}, guid string) (*appconfigurationv1.AppConfigurationV1, error) { - appconfigClient, err := meta.(ClientSession).AppConfigurationV1() + appconfigClient, err := meta.(conns.ClientSession).AppConfigurationV1() if err != nil { return nil, err } - bluemixSession, err := meta.(ClientSession).BluemixSession() + bluemixSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return nil, err } appConfigURL := fmt.Sprintf("https://%s.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/%s", bluemixSession.Config.Region, guid) - url := envFallBack([]string{"IBMCLOUD_APP_CONFIG_API_ENDPOINT"}, appConfigURL) + url := conns.EnvFallBack([]string{"IBMCLOUD_APP_CONFIG_API_ENDPOINT"}, appConfigURL) appconfigClient.Service.Options.URL = url return appconfigClient, nil } @@ -115,7 +117,7 @@ func resourceEnvironmentCreate(d *schema.ResourceData, meta interface{}) error { func resourceEnvironmentUpdate(d *schema.ResourceData, meta interface{}) error { if ok := d.HasChanges("name", "tags", "color_code", "description"); ok { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil } @@ -148,7 +150,7 @@ func resourceEnvironmentUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceEnvironmentRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil } @@ -170,49 +172,49 @@ func resourceEnvironmentRead(d *schema.ResourceData, meta interface{}) error { d.Set("guid", parts[0]) if result.Name != nil { if err = d.Set("name", result.Name); err != nil { - return fmt.Errorf("error setting name: %s", err) + return fmt.Errorf("[ERROR] Error setting name: %s", err) } } if result.EnvironmentID != nil { if err = d.Set("environment_id", result.EnvironmentID); err != nil { - return fmt.Errorf("error setting environment_id: %s", err) + return fmt.Errorf("[ERROR] Error setting environment_id: %s", err) } } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return fmt.Errorf("error setting description: %s", err) + return fmt.Errorf("[ERROR] Error setting description: %s", err) } } if result.Tags != nil { if err = d.Set("tags", result.Tags); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("[ERROR] Error setting tags: %s", err) } } if result.ColorCode != nil { if err = d.Set("color_code", result.ColorCode); err != nil { - return fmt.Errorf("error setting color_code: %s", err) + return fmt.Errorf("[ERROR] Error setting color_code: %s", err) } } if result.CreatedTime != nil { if err = d.Set("created_time", result.CreatedTime.String()); err != nil { - return fmt.Errorf("error setting created_time: %s", err) + return fmt.Errorf("[ERROR] Error setting created_time: %s", err) } } if result.UpdatedTime != nil { if err = d.Set("updated_time", result.UpdatedTime.String()); err != nil { - return fmt.Errorf("error setting updated_time: %s", err) + return fmt.Errorf("[ERROR] Error setting updated_time: %s", err) } } if result.Href != nil { if err = d.Set("href", result.Href); err != nil { - return fmt.Errorf("error setting href: %s", err) + return fmt.Errorf("[ERROR] Error setting href: %s", err) } } return nil } func resourceEnvironmentDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_config_feature.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/resource_ibm_app_config_feature.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_config_feature.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/resource_ibm_app_config_feature.go index e504af9eb0..a54ba8d57c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_config_feature.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration/resource_ibm_app_config_feature.go @@ -1,20 +1,22 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appconfiguration import ( "fmt" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1" "github.com/IBM/go-sdk-core/v5/core" ) -func resourceIbmIbmAppConfigFeature() *schema.Resource { +func ResourceIBMIbmAppConfigFeature() *schema.Resource { return &schema.Resource{ Create: resourceIbmIbmAppConfigFeatureCreate, Read: resourceIbmIbmAppConfigFeatureRead, @@ -46,7 +48,7 @@ func resourceIbmIbmAppConfigFeature() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_app_config_feature", "type"), + ValidateFunc: validate.InvokeValidator("ibm_app_config_feature", "type"), Description: "Type of the feature (BOOLEAN, STRING, NUMERIC).", }, "enabled_value": { @@ -200,7 +202,7 @@ func resourceIbmIbmAppConfigFeatureCreate(d *schema.ResourceData, meta interface } func resourceIbmIbmAppConfigFeatureUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil } @@ -257,7 +259,7 @@ func resourceIbmIbmAppConfigFeatureUpdate(d *schema.ResourceData, meta interface } func resourceIbmIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil } @@ -279,28 +281,28 @@ func resourceIbmIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{} d.Set("environment_id", parts[1]) if result.Name != nil { if err = d.Set("name", result.Name); err != nil { - return fmt.Errorf("error setting name: %s", err) + return fmt.Errorf("[ERROR] Error setting name: %s", err) } } if result.FeatureID != nil { if err = d.Set("feature_id", result.FeatureID); err != nil { - return fmt.Errorf("error setting feature_id: %s", err) + return fmt.Errorf("[ERROR] Error setting feature_id: %s", err) } } if result.Type != nil { if err = d.Set("type", result.Type); err != nil { - return fmt.Errorf("error setting type: %s", err) + return fmt.Errorf("[ERROR] Error setting type: %s", err) } } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return fmt.Errorf("error setting description: %s", err) + return fmt.Errorf("[ERROR] Error setting description: %s", err) } } if result.Tags != nil { if err = d.Set("tags", result.Tags); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("[ERROR] Error setting tags: %s", err) } } @@ -311,7 +313,7 @@ func resourceIbmIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{} segmentRules = append(segmentRules, segmentRulesItemMap) } if err = d.Set("segment_rules", segmentRules); err != nil { - return fmt.Errorf("error setting segment_rules: %s", err) + return fmt.Errorf("[ERROR] Error setting segment_rules: %s", err) } } if result.Collections != nil { @@ -321,32 +323,32 @@ func resourceIbmIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{} collections = append(collections, collectionsItemMap) } if err = d.Set("collections", collections); err != nil { - return fmt.Errorf("error setting collections: %s", err) + return fmt.Errorf("[ERROR] Error setting collections: %s", err) } } if result.SegmentExists != nil { if err = d.Set("segment_exists", result.SegmentExists); err != nil { - return fmt.Errorf("error setting segment_exists: %s", err) + return fmt.Errorf("[ERROR] Error setting segment_exists: %s", err) } } if result.CreatedTime != nil { if err = d.Set("created_time", result.CreatedTime.String()); err != nil { - return fmt.Errorf("error setting created_time: %s", err) + return fmt.Errorf("[ERROR] Error setting created_time: %s", err) } } if result.UpdatedTime != nil { if err = d.Set("updated_time", result.UpdatedTime.String()); err != nil { - return fmt.Errorf("error setting updated_time: %s", err) + return fmt.Errorf("[ERROR] Error setting updated_time: %s", err) } } if result.Href != nil { if err = d.Set("href", result.Href); err != nil { - return fmt.Errorf("error setting href: %s", err) + return fmt.Errorf("[ERROR] Error setting href: %s", err) } } if result.Enabled != nil { if err = d.Set("enabled", result.Enabled); err != nil { - return fmt.Errorf("error setting enabled: %s", err) + return fmt.Errorf("[ERROR] Error setting enabled: %s", err) } } @@ -379,7 +381,7 @@ func resourceIbmIbmAppConfigFeatureRead(d *schema.ResourceData, meta interface{} } func resourceIbmIbmAppConfigFeatureDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil } @@ -406,19 +408,22 @@ func resourceIbmIbmAppConfigFeatureDelete(d *schema.ResourceData, meta interface return nil } -func resourceIbmAppConfigFeatureValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMAppConfigFeatureValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "BOOLEAN, NUMERIC, STRING", }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_app_config_feature", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ + ResourceName: "ibm_app_config_feature", + Schema: validateSchema, + } return &resourceValidator } @@ -433,7 +438,7 @@ func resourceIbmAppConfigFeatureSegmentRuleToMap(segmentRule appconfigurationv1. } segmentRuleMap["rules"] = rules - segmentRuleMap["order"] = intValue(segmentRule.Order) + segmentRuleMap["order"] = flex.IntValue(segmentRule.Order) segmentValue := segmentRule.Value switch segmentValue.(interface{}).(type) { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/README.md new file mode 100644 index 0000000000..47a7cdb14b --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider APP ID Management + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the APP ID Management resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/appid_action_url) +* IBM API Docs: [IBM API Docs for APP ID Management](https://cloud.ibm.com/apidocs/app-id/management) +* IBM APP ID Management SDK: [IBM SDK for APP ID Management](https://github.com/IBM/appid-management-go-sdk/tree/main/appidmanagementv4) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_action_url.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_action_url.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_action_url.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_action_url.go index 77e80d6917..3f510e69d1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_action_url.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_action_url.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMAppIDActionURL() *schema.Resource { +func DataSourceIBMAppIDActionURL() *schema.Resource { return &schema.Resource{ Description: "The custom url to redirect to when Cloud Directory action is executed.", ReadContext: dataSourceIBMAppIDActionURLRead, @@ -35,7 +37,7 @@ func dataSourceIBMAppIDActionURL() *schema.Resource { } func dataSourceIBMAppIDActionURLRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_apm.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_apm.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_apm.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_apm.go index d875cdb36a..0768d55d93 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_apm.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_apm.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDAPM() *schema.Resource { +func DataSourceIBMAppIDAPM() *schema.Resource { return &schema.Resource{ Description: "AppID advanced password management configuration (available for graduated tier only)", ReadContext: dataSourceIBMAppIDAPMRead, @@ -99,7 +101,7 @@ func dataSourceIBMAppIDAPM() *schema.Resource { } func dataSourceIBMAppIDAPMRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application.go index e731ac9c3d..c5acc25798 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application.go @@ -1,14 +1,16 @@ -package ibm +package appid import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDApplication() *schema.Resource { +func DataSourceIBMAppIDApplication() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDApplicationRead, Schema: map[string]*schema.Schema{ @@ -57,7 +59,7 @@ func dataSourceIBMAppIDApplication() *schema.Resource { } func dataSourceIBMAppIDApplicationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application_roles.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application_roles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application_roles.go index 25d12c5645..06f8bd63a8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application_roles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application_roles.go @@ -1,14 +1,16 @@ -package ibm +package appid import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDApplicationRoles() *schema.Resource { +func DataSourceIBMAppIDApplicationRoles() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDApplicationRolesRead, Schema: map[string]*schema.Schema{ @@ -46,7 +48,7 @@ func dataSourceIBMAppIDApplicationRoles() *schema.Resource { } func dataSourceIBMAppIDApplicationRolesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application_scopes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application_scopes.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application_scopes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application_scopes.go index 873c90dc30..d3a1342204 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_application_scopes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_application_scopes.go @@ -1,14 +1,16 @@ -package ibm +package appid import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDApplicationScopes() *schema.Resource { +func DataSourceIBMAppIDApplicationScopes() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDApplicationScopesRead, Schema: map[string]*schema.Schema{ @@ -35,7 +37,7 @@ func dataSourceIBMAppIDApplicationScopes() *schema.Resource { } func dataSourceIBMAppIDApplicationScopesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_applications.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_applications.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_applications.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_applications.go index b80f91710a..bd4c7a42f9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_applications.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_applications.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" "fmt" + "sort" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "sort" ) -func dataSourceIBMAppIDApplications() *schema.Resource { +func DataSourceIBMAppIDApplications() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDApplicationsRead, Schema: map[string]*schema.Schema{ @@ -66,7 +68,7 @@ func dataSourceIBMAppIDApplications() *schema.Resource { } func dataSourceIBMAppIDApplicationsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_audit_status.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_audit_status.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_audit_status.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_audit_status.go index 696f19d019..6f75253764 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_audit_status.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_audit_status.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDAuditStatus() *schema.Resource { +func DataSourceIBMAppIDAuditStatus() *schema.Resource { return &schema.Resource{ Description: "Tenant audit status", ReadContext: dataSourceIBMAppIDAuditStatusRead, @@ -27,7 +29,7 @@ func dataSourceIBMAppIDAuditStatus() *schema.Resource { } func dataSourceIBMAppIDAuditStatusRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_cloud_directory_template.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_cloud_directory_template.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_cloud_directory_template.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_cloud_directory_template.go index 3d533d7364..8c6a1d5e97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_cloud_directory_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_cloud_directory_template.go @@ -1,8 +1,10 @@ -package ibm +package appid import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -11,7 +13,7 @@ import ( var supportedAppIDCDTemplates = []string{"USER_VERIFICATION", "RESET_PASSWORD", "WELCOME", "PASSWORD_CHANGED", "MFA_VERIFICATION"} -func dataSourceIBMAppIDCloudDirectoryTemplate() *schema.Resource { +func DataSourceIBMAppIDCloudDirectoryTemplate() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDCloudDirectoryTemplateRead, Schema: map[string]*schema.Schema{ @@ -57,7 +59,7 @@ func dataSourceIBMAppIDCloudDirectoryTemplate() *schema.Resource { } func dataSourceIBMAppIDCloudDirectoryTemplateRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_cloud_directory_user.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_cloud_directory_user.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_cloud_directory_user.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_cloud_directory_user.go index 4e6b5e192a..c851cab8a2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_cloud_directory_user.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_cloud_directory_user.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func dataSourceIBMAppIDCloudDirectoryUser() *schema.Resource { +func DataSourceIBMAppIDCloudDirectoryUser() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDCloudDirectoryUserRead, Schema: map[string]*schema.Schema{ @@ -96,7 +98,7 @@ func dataSourceIBMAppIDCloudDirectoryUser() *schema.Resource { } func dataSourceIBMAppIDCloudDirectoryUserRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_cloud_directory.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_cloud_directory.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_cloud_directory.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_cloud_directory.go index 404d0eae4f..54ac05dad8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_cloud_directory.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_cloud_directory.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDIDPCloudDirectory() *schema.Resource { +func DataSourceIBMAppIDIDPCloudDirectory() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDIDPCloudDirectoryRead, Schema: map[string]*schema.Schema{ @@ -62,7 +64,7 @@ func dataSourceIBMAppIDIDPCloudDirectory() *schema.Resource { } func dataSourceIBMAppIDIDPCloudDirectoryRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_custom.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_custom.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_custom.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_custom.go index cf7c41dcc6..604063515b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_custom.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_custom.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDIDPCustom() *schema.Resource { +func DataSourceIBMAppIDIDPCustom() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDIDPCustomRead, Schema: map[string]*schema.Schema{ @@ -30,7 +32,7 @@ func dataSourceIBMAppIDIDPCustom() *schema.Resource { } func dataSourceIBMAppIDIDPCustomRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_facebook.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_facebook.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_facebook.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_facebook.go index 381ae20e7f..59deb692cb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_facebook.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_facebook.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDIDPFacebook() *schema.Resource { +func DataSourceIBMAppIDIDPFacebook() *schema.Resource { return &schema.Resource{ Description: "Returns the Facebook identity provider configuration.", ReadContext: dataSourceIBMAppIDIDPFacebookRead, @@ -52,7 +54,7 @@ func dataSourceIBMAppIDIDPFacebook() *schema.Resource { } func dataSourceIBMAppIDIDPFacebookRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_google.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_google.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_google.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_google.go index 0d0e934600..3522c787d4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_google.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_google.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDIDPGoogle() *schema.Resource { +func DataSourceIBMAppIDIDPGoogle() *schema.Resource { return &schema.Resource{ Description: "Returns the Google identity provider configuration.", ReadContext: dataSourceIBMAppIDIDPGoogleRead, @@ -51,7 +53,7 @@ func dataSourceIBMAppIDIDPGoogle() *schema.Resource { } func dataSourceIBMAppIDIDPGoogleRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_saml.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_saml.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_saml.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_saml.go index 4ec6e5ddd8..71bf1f31fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_saml.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_saml.go @@ -1,13 +1,16 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDIDPSAML() *schema.Resource { +func DataSourceIBMAppIDIDPSAML() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDIDPSAMLRead, Schema: map[string]*schema.Schema{ @@ -94,7 +97,7 @@ func dataSourceIBMAppIDIDPSAML() *schema.Resource { } func dataSourceIBMAppIDIDPSAMLRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -138,7 +141,7 @@ func flattenAppIDIDPSAMLConfig(config *appid.SAMLConfigParams) []interface{} { mConfig["sign_in_url"] = *config.SignInURL } - mConfig["certificates"] = flattenStringList(config.Certificates) + mConfig["certificates"] = flex.FlattenStringList(config.Certificates) if config.DisplayName != nil { mConfig["display_name"] = *config.DisplayName diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_saml_metadata.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_saml_metadata.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_saml_metadata.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_saml_metadata.go index daeb2cf56a..b64d7b816f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_idp_saml_metadata.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_idp_saml_metadata.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDIDPSAMLMetadata() *schema.Resource { +func DataSourceIBMAppIDIDPSAMLMetadata() *schema.Resource { return &schema.Resource{ Description: "Retrieve SAML metadata", ReadContext: dataSourceIBMAppIDIDPSAMLMetadataRead, @@ -27,7 +29,7 @@ func dataSourceIBMAppIDIDPSAMLMetadata() *schema.Resource { } func dataSourceIBMAppIDIDPSAMLMetadataRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appidClient, err := meta.(ClientSession).AppIDAPI() + appidClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_languages.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_languages.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_languages.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_languages.go index 3437272889..7d1bccfed5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_languages.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_languages.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDLanguages() *schema.Resource { +func DataSourceIBMAppIDLanguages() *schema.Resource { return &schema.Resource{ Description: "User localization configuration", ReadContext: dataSourceIBMAppIDLanguagesRead, @@ -30,7 +32,7 @@ func dataSourceIBMAppIDLanguages() *schema.Resource { } func dataSourceIBMAppIDLanguagesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_mfa.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_mfa.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_mfa.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_mfa.go index b84e00586b..18e23dca68 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_mfa.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_mfa.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDMFA() *schema.Resource { +func DataSourceIBMAppIDMFA() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAppIDMFARead, Schema: map[string]*schema.Schema{ @@ -26,7 +28,7 @@ func dataSourceIBMAppIDMFA() *schema.Resource { } func dataSourceIBMAppIDMFARead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_mfa_channel.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_mfa_channel.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_mfa_channel.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_mfa_channel.go index 37e2c31743..edb15051d9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_mfa_channel.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_mfa_channel.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDMFAChannel() *schema.Resource { +func DataSourceIBMAppIDMFAChannel() *schema.Resource { return &schema.Resource{ Description: "Get MFA channel configuration", ReadContext: dataSourceIBMAppIDMFAChannelRead, @@ -54,7 +56,7 @@ func dataSourceIBMAppIDMFAChannel() *schema.Resource { } func dataSourceIBMAppIDMFAChannelRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_password_regex.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_password_regex.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_password_regex.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_password_regex.go index 5baddbe56d..e04a0a01fc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_password_regex.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_password_regex.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDPasswordRegex() *schema.Resource { +func DataSourceIBMAppIDPasswordRegex() *schema.Resource { return &schema.Resource{ Description: "The regular expression used by App ID for password strength validation", ReadContext: dataSourceIBMAppIDPasswordRegexRead, @@ -37,7 +39,7 @@ func dataSourceIBMAppIDPasswordRegex() *schema.Resource { } func dataSourceIBMAppIDPasswordRegexRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_redirect_urls.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_redirect_urls.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_redirect_urls.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_redirect_urls.go index d95e32cad9..66292a2890 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_redirect_urls.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_redirect_urls.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDRedirectURLs() *schema.Resource { +func DataSourceIBMAppIDRedirectURLs() *schema.Resource { return &schema.Resource{ Description: "Redirect URIs that can be used as callbacks of App ID authentication flow", ReadContext: dataSourceIBMAppIDRedirectURLsRead, @@ -30,7 +32,7 @@ func dataSourceIBMAppIDRedirectURLs() *schema.Resource { } func dataSourceIBMAppIDRedirectURLsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appidClient, err := meta.(ClientSession).AppIDAPI() + appidClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_role.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_role.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_role.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_role.go index 9946c20a39..902f2b8e89 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_role.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_role.go @@ -1,14 +1,17 @@ -package ibm +package appid import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDRole() *schema.Resource { +func DataSourceIBMAppIDRole() *schema.Resource { return &schema.Resource{ Description: "A role is a collection of `scopes` that allow varying permissions to different types of app users", ReadContext: dataSourceIBMAppIDRoleRead, @@ -58,7 +61,7 @@ func dataSourceIBMAppIDRole() *schema.Resource { } func dataSourceIBMAppIDRoleRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -96,7 +99,7 @@ func flattenAppIDRoleAccess(ra []appid.RoleAccessItem) []interface{} { for _, a := range ra { access := map[string]interface{}{ - "scopes": flattenStringList(a.Scopes), + "scopes": flex.FlattenStringList(a.Scopes), } if a.ApplicationID != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_roles.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_roles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_roles.go index d8ac0726ed..7f1ea4ac47 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_roles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_roles.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" "fmt" + "sort" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "sort" ) -func dataSourceIBMAppIDRoles() *schema.Resource { +func DataSourceIBMAppIDRoles() *schema.Resource { return &schema.Resource{ Description: "A list of AppID roles", ReadContext: dataSourceIBMAppIDRolesRead, @@ -66,7 +68,7 @@ func dataSourceIBMAppIDRoles() *schema.Resource { } func dataSourceIBMAppIDRolesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_theme_color.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_theme_color.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_theme_color.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_theme_color.go index 7a23df4dbd..b62e8c90ce 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_theme_color.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_theme_color.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDThemeColor() *schema.Resource { +func DataSourceIBMAppIDThemeColor() *schema.Resource { return &schema.Resource{ Description: "Colors of the App ID login widget", ReadContext: dataSourceIBMAppIDThemeColorRead, @@ -26,7 +28,7 @@ func dataSourceIBMAppIDThemeColor() *schema.Resource { } func dataSourceIBMAppIDThemeColorRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_theme_text.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_theme_text.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_theme_text.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_theme_text.go index 2b97116f4b..b5597afe0c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_theme_text.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_theme_text.go @@ -1,13 +1,15 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDThemeText() *schema.Resource { +func DataSourceIBMAppIDThemeText() *schema.Resource { return &schema.Resource{ Description: "The theme texts of the App ID login widget", ReadContext: dataSourceIBMAppIDThemeTextRead, @@ -30,7 +32,7 @@ func dataSourceIBMAppIDThemeText() *schema.Resource { } func dataSourceIBMAppIDThemeTextRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_token_config.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_token_config.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_token_config.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_token_config.go index 730a04124f..c33cb2c008 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_token_config.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_token_config.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppIDTokenConfig() *schema.Resource { +func DataSourceIBMAppIDTokenConfig() *schema.Resource { return &schema.Resource{ Description: "`ibm_appid_token_config` data source can be used to retrieve the token configuration for specific AppID tenant. [Learn more.](https://cloud.ibm.com/docs/appid?topic=appid-customizing-tokens){target=_blank}", ReadContext: dataSourceIBMAppIDTokenConfigRead, @@ -115,7 +117,7 @@ func flattenTokenClaims(c []appid.TokenClaimMapping) []interface{} { } func dataSourceIBMAppIDTokenConfigRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appidClient, err := meta.(ClientSession).AppIDAPI() + appidClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_user_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_user_roles.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_user_roles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_user_roles.go index 135e119aa4..9775967ab2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_appid_user_roles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/data_source_ibm_appid_user_roles.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func dataSourceIBMAppIDUserRoles() *schema.Resource { +func DataSourceIBMAppIDUserRoles() *schema.Resource { return &schema.Resource{ Description: "Get a list of AppID user roles", ReadContext: dataSourceIBMAppIDUserRolesRead, @@ -48,7 +50,7 @@ func dataSourceIBMAppIDUserRoles() *schema.Resource { } func dataSourceIBMAppIDUserRolesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_action_url.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_action_url.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_action_url.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_action_url.go index ac894ceb0a..cf2328292c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_action_url.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_action_url.go @@ -1,17 +1,19 @@ -package ibm +package appid import ( "context" "fmt" + "log" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "log" - "strings" ) -func resourceIBMAppIDActionURL() *schema.Resource { +func ResourceIBMAppIDActionURL() *schema.Resource { return &schema.Resource{ Description: "The custom url to redirect to when Cloud Directory action is executed.", CreateContext: resourceIBMAppIDActionURLCreate, @@ -45,7 +47,7 @@ func resourceIBMAppIDActionURL() *schema.Resource { } func resourceIBMAppIDActionURLRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -87,7 +89,7 @@ func resourceIBMAppIDActionURLRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDActionURLCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -115,7 +117,7 @@ func resourceIBMAppIDActionURLCreate(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDActionURLDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_apm.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_apm.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_apm.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_apm.go index 51e4a03544..9882a0a8c5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_apm.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_apm.go @@ -1,16 +1,18 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDAPM() *schema.Resource { +func ResourceIBMAppIDAPM() *schema.Resource { return &schema.Resource{ Description: "AppID advanced password management configuration (available for graduated tier only)", ReadContext: resourceIBMAppIDAPMRead, @@ -119,7 +121,7 @@ func resourceIBMAppIDAPM() *schema.Resource { } func resourceIBMAppIDAPMRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -170,7 +172,7 @@ func resourceIBMAppIDAPMRead(ctx context.Context, d *schema.ResourceData, meta i } func resourceIBMAppIDAPMCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -273,7 +275,7 @@ func expandAppIDAPMMinPasswordChangeInterval(chg []interface{}) *appid.ApmSchema } func resourceIBMAppIDAPMDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application.go index ed24bc2156..a7be3fd136 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application.go @@ -1,17 +1,19 @@ -package ibm +package appid import ( "context" "fmt" + "log" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "log" - "strings" ) -func resourceIBMAppIDApplication() *schema.Resource { +func ResourceIBMAppIDApplication() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDApplicationCreate, ReadContext: resourceIBMAppIDApplicationRead, @@ -71,7 +73,7 @@ func resourceIBMAppIDApplication() *schema.Resource { } func resourceIBMAppIDApplicationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -99,7 +101,7 @@ func resourceIBMAppIDApplicationCreate(ctx context.Context, d *schema.ResourceDa } func resourceIBMAppIDApplicationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -162,7 +164,7 @@ func resourceIBMAppIDApplicationRead(ctx context.Context, d *schema.ResourceData func resourceIBMAppIDApplicationUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { if d.HasChange("name") { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -187,7 +189,7 @@ func resourceIBMAppIDApplicationUpdate(ctx context.Context, d *schema.ResourceDa } func resourceIBMAppIDApplicationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application_roles.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application_roles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application_roles.go index 39018838dc..a1d93d9ace 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application_roles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application_roles.go @@ -1,16 +1,19 @@ -package ibm +package appid import ( "context" "fmt" + "log" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" - "strings" ) -func resourceIBMAppIDApplicationRoles() *schema.Resource { +func ResourceIBMAppIDApplicationRoles() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDApplicationRolesCreate, ReadContext: resourceIBMAppIDApplicationRolesRead, @@ -45,7 +48,7 @@ func resourceIBMAppIDApplicationRoles() *schema.Resource { } func resourceIBMAppIDApplicationRolesCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -53,7 +56,7 @@ func resourceIBMAppIDApplicationRolesCreate(ctx context.Context, d *schema.Resou tenantID := d.Get("tenant_id").(string) clientID := d.Get("client_id").(string) - roles := expandStringList(d.Get("roles").([]interface{})) + roles := flex.ExpandStringList(d.Get("roles").([]interface{})) roleOpts := &appid.PutApplicationsRolesOptions{ TenantID: &tenantID, @@ -75,7 +78,7 @@ func resourceIBMAppIDApplicationRolesCreate(ctx context.Context, d *schema.Resou } func resourceIBMAppIDApplicationRolesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -125,7 +128,7 @@ func resourceIBMAppIDApplicationRolesRead(ctx context.Context, d *schema.Resourc } func resourceIBMAppIDApplicationRolesUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -133,7 +136,7 @@ func resourceIBMAppIDApplicationRolesUpdate(ctx context.Context, d *schema.Resou tenantID := d.Get("tenant_id").(string) clientID := d.Get("client_id").(string) - roles := expandStringList(d.Get("roles").([]interface{})) + roles := flex.ExpandStringList(d.Get("roles").([]interface{})) roleOpts := &appid.PutApplicationsRolesOptions{ TenantID: &tenantID, @@ -153,7 +156,7 @@ func resourceIBMAppIDApplicationRolesUpdate(ctx context.Context, d *schema.Resou } func resourceIBMAppIDApplicationRolesDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application_scopes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application_scopes.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application_scopes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application_scopes.go index 560570cb7c..c951f3792c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_application_scopes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_application_scopes.go @@ -1,16 +1,19 @@ -package ibm +package appid import ( "context" "fmt" + "log" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" - "strings" ) -func resourceIBMAppIDApplicationScopes() *schema.Resource { +func ResourceIBMAppIDApplicationScopes() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDApplicationScopesCreate, ReadContext: resourceIBMAppIDApplicationScopesRead, @@ -45,7 +48,7 @@ func resourceIBMAppIDApplicationScopes() *schema.Resource { } func resourceIBMAppIDApplicationScopesCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -53,7 +56,7 @@ func resourceIBMAppIDApplicationScopesCreate(ctx context.Context, d *schema.Reso tenantID := d.Get("tenant_id").(string) clientID := d.Get("client_id").(string) - scopes := expandStringList(d.Get("scopes").([]interface{})) + scopes := flex.ExpandStringList(d.Get("scopes").([]interface{})) scopeOpts := &appid.PutApplicationsScopesOptions{ TenantID: &tenantID, @@ -73,7 +76,7 @@ func resourceIBMAppIDApplicationScopesCreate(ctx context.Context, d *schema.Reso } func resourceIBMAppIDApplicationScopesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -115,7 +118,7 @@ func resourceIBMAppIDApplicationScopesRead(ctx context.Context, d *schema.Resour } func resourceIBMAppIDApplicationScopesUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -123,7 +126,7 @@ func resourceIBMAppIDApplicationScopesUpdate(ctx context.Context, d *schema.Reso tenantID := d.Get("tenant_id").(string) clientID := d.Get("client_id").(string) - scopes := expandStringList(d.Get("scopes").([]interface{})) + scopes := flex.ExpandStringList(d.Get("scopes").([]interface{})) scopeOpts := &appid.PutApplicationsScopesOptions{ TenantID: &tenantID, @@ -141,7 +144,7 @@ func resourceIBMAppIDApplicationScopesUpdate(ctx context.Context, d *schema.Reso } func resourceIBMAppIDApplicationScopesDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_audit_status.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_audit_status.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_audit_status.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_audit_status.go index f9979614ad..9c75549505 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_audit_status.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_audit_status.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDAuditStatus() *schema.Resource { +func ResourceIBMAppIDAuditStatus() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDAuditStatusCreate, ReadContext: resourceIBMAppIDAuditStatusRead, @@ -35,7 +37,7 @@ func resourceIBMAppIDAuditStatus() *schema.Resource { } func resourceIBMAppIDAuditStatusRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -64,7 +66,7 @@ func resourceIBMAppIDAuditStatusRead(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDAuditStatusCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -93,7 +95,7 @@ func resourceIBMAppIDAuditStatusCreate(ctx context.Context, d *schema.ResourceDa } func resourceIBMAppIDAuditStatusDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_cloud_directory_template.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_cloud_directory_template.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_cloud_directory_template.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_cloud_directory_template.go index 2cf73a47ea..b4ac7b4ce4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_cloud_directory_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_cloud_directory_template.go @@ -1,19 +1,21 @@ -package ibm +package appid import ( "context" b64 "encoding/base64" "fmt" + "log" + "strings" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "log" - "strings" ) -func resourceIBMAppIDCloudDirectoryTemplate() *schema.Resource { +func ResourceIBMAppIDCloudDirectoryTemplate() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDCloudDirectoryTemplateCreate, ReadContext: resourceIBMAppIDCloudDirectoryTemplateRead, @@ -68,7 +70,7 @@ func resourceIBMAppIDCloudDirectoryTemplate() *schema.Resource { } func resourceIBMAppIDCloudDirectoryTemplateRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -125,7 +127,7 @@ func resourceIBMAppIDCloudDirectoryTemplateRead(ctx context.Context, d *schema.R } func resourceIBMAppIDCloudDirectoryTemplateCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -163,7 +165,7 @@ func resourceIBMAppIDCloudDirectoryTemplateCreate(ctx context.Context, d *schema } func resourceIBMAppIDCloudDirectoryTemplateDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_cloud_directory_user.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_cloud_directory_user.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_cloud_directory_user.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_cloud_directory_user.go index 7970a75f6c..4cebe6e622 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_cloud_directory_user.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_cloud_directory_user.go @@ -1,4 +1,4 @@ -package ibm +package appid import ( "context" @@ -7,6 +7,7 @@ import ( "strings" "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -14,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func resourceIBMAppIDCloudDirectoryUser() *schema.Resource { +func ResourceIBMAppIDCloudDirectoryUser() *schema.Resource { return &schema.Resource{ Description: "Manage AppID Cloud Directory user", CreateContext: resourceIBMAppIDCloudDirectoryUserCreate, @@ -126,7 +127,7 @@ func resourceIBMAppIDCloudDirectoryUser() *schema.Resource { } func resourceIBMAppIDCloudDirectoryUserRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -209,7 +210,7 @@ func resourceIBMAppIDCloudDirectoryUserRead(ctx context.Context, d *schema.Resou } func resourceIBMAppIDCloudDirectoryUserCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -250,7 +251,7 @@ func resourceIBMAppIDCloudDirectoryUserCreate(ctx context.Context, d *schema.Res } func resourceIBMAppIDCloudDirectoryUserDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -273,7 +274,7 @@ func resourceIBMAppIDCloudDirectoryUserDelete(ctx context.Context, d *schema.Res } func resourceIBMAppIDCloudDirectoryUserUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_cloud_directory.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_cloud_directory.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_cloud_directory.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_cloud_directory.go index 89306da6eb..91c969cee0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_cloud_directory.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_cloud_directory.go @@ -1,16 +1,19 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "log" ) -func resourceIBMAppIDIDPCloudDirectory() *schema.Resource { +func ResourceIBMAppIDIDPCloudDirectory() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDIDPCloudDirectoryCreate, ReadContext: resourceIBMAppIDIDPCloudDirectoryRead, @@ -76,7 +79,7 @@ func resourceIBMAppIDIDPCloudDirectory() *schema.Resource { } func resourceIBMAppIDIDPCloudDirectoryRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -129,7 +132,7 @@ func resourceIBMAppIDIDPCloudDirectoryRead(ctx context.Context, d *schema.Resour } func resourceIBMAppIDIDPCloudDirectoryCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -160,7 +163,7 @@ func resourceIBMAppIDIDPCloudDirectoryCreate(ctx context.Context, d *schema.Reso } if methods, ok := d.GetOk("identity_confirm_methods"); ok { - config.Config.Interactions.IdentityConfirmation.Methods = expandStringList(methods.([]interface{})) + config.Config.Interactions.IdentityConfirmation.Methods = flex.ExpandStringList(methods.([]interface{})) } _, resp, err := appIDClient.SetCloudDirectoryIDPWithContext(ctx, config) @@ -180,7 +183,7 @@ func resourceIBMAppIDIDPCloudDirectoryUpdate(ctx context.Context, d *schema.Reso } func resourceIBMAppIDIDPCloudDirectoryDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_custom.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_custom.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_custom.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_custom.go index 06cde441e1..348dc99ae9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_custom.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_custom.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDIDPCustom() *schema.Resource { +func ResourceIBMAppIDIDPCustom() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDIDPCustomCreate, ReadContext: resourceIBMAppIDIDPCustomRead, @@ -39,7 +41,7 @@ func resourceIBMAppIDIDPCustom() *schema.Resource { } func resourceIBMAppIDIDPCustomRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -75,7 +77,7 @@ func resourceIBMAppIDIDPCustomRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDIDPCustomCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -116,7 +118,7 @@ func appIDCustomIDPDefaults(tenantID string) *appid.SetCustomIDPOptions { } func resourceIBMAppIDIDPCustomDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_facebook.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_facebook.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_facebook.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_facebook.go index d4d8d0bdbb..409ee60c8c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_facebook.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_facebook.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDIDPFacebook() *schema.Resource { +func ResourceIBMAppIDIDPFacebook() *schema.Resource { return &schema.Resource{ Description: "Update Facebook identity provider configuration.", CreateContext: resourceIBMAppIDIDPFacebookCreate, @@ -62,7 +64,7 @@ func resourceIBMAppIDIDPFacebook() *schema.Resource { } func resourceIBMAppIDIDPFacebookRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -102,7 +104,7 @@ func resourceIBMAppIDIDPFacebookRead(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDIDPFacebookCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -134,7 +136,7 @@ func resourceIBMAppIDIDPFacebookCreate(ctx context.Context, d *schema.ResourceDa } func resourceIBMAppIDIDPFacebookDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_google.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_google.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_google.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_google.go index aea37d2f57..75e53dc28c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_google.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_google.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDIDPGoogle() *schema.Resource { +func ResourceIBMAppIDIDPGoogle() *schema.Resource { return &schema.Resource{ Description: "Update Google identity provider configuration.", CreateContext: resourceIBMAppIDIDPGoogleCreate, @@ -62,7 +64,7 @@ func resourceIBMAppIDIDPGoogle() *schema.Resource { } func resourceIBMAppIDIDPGoogleRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -102,7 +104,7 @@ func resourceIBMAppIDIDPGoogleRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDIDPGoogleCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -134,7 +136,7 @@ func resourceIBMAppIDIDPGoogleCreate(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDIDPGoogleDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_saml.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_saml.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_saml.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_saml.go index 227605556d..662da12550 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_idp_saml.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_idp_saml.go @@ -1,16 +1,19 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "log" ) -func resourceIBMAppIDIDPSAML() *schema.Resource { +func ResourceIBMAppIDIDPSAML() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDIDPSAMLCreate, ReadContext: resourceIBMAppIDIDPSAMLRead, @@ -111,7 +114,7 @@ func resourceIBMAppIDIDPSAML() *schema.Resource { } func resourceIBMAppIDIDPSAMLRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -147,7 +150,7 @@ func resourceIBMAppIDIDPSAMLRead(ctx context.Context, d *schema.ResourceData, me } func resourceIBMAppIDIDPSAMLCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -192,7 +195,7 @@ func expandAppIDIDPSAMLAuthNContext(ctx []interface{}) *appid.SAMLConfigParamsAu } if class, ok := mContext["class"]; ok { - authNContext.Class = expandStringList(class.([]interface{})) + authNContext.Class = flex.ExpandStringList(class.([]interface{})) } return authNContext @@ -251,7 +254,7 @@ func appIDIDPSAMLConfigDefaults(tenantID string) *appid.SetSAMLIDPOptions { } func resourceIBMAppIDIDPSAMLDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_languages.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_languages.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_languages.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_languages.go index 40a1ef674a..dc31554235 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_languages.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_languages.go @@ -1,14 +1,17 @@ -package ibm +package appid import ( "context" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDLanguages() *schema.Resource { +func ResourceIBMAppIDLanguages() *schema.Resource { return &schema.Resource{ Description: "User localization configuration", CreateContext: resourceIBMAppIDLanguagesCreate, @@ -38,7 +41,7 @@ func resourceIBMAppIDLanguages() *schema.Resource { } func resourceIBMAppIDLanguagesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -67,14 +70,14 @@ func resourceIBMAppIDLanguagesRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDLanguagesCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) } tenantID := d.Get("tenant_id").(string) - languages := expandStringList(d.Get("languages").([]interface{})) + languages := flex.ExpandStringList(d.Get("languages").([]interface{})) input := &appid.UpdateLocalizationOptions{ TenantID: &tenantID, @@ -93,7 +96,7 @@ func resourceIBMAppIDLanguagesCreate(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDLanguagesDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_mfa.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_mfa.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_mfa.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_mfa.go index 67d54652f3..74bd53554e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_mfa.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_mfa.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDMFA() *schema.Resource { +func ResourceIBMAppIDMFA() *schema.Resource { return &schema.Resource{ ReadContext: resourceIBMAppIDMFARead, CreateContext: resourceIBMAppIDMFACreate, @@ -35,7 +37,7 @@ func resourceIBMAppIDMFA() *schema.Resource { } func resourceIBMAppIDMFARead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -67,7 +69,7 @@ func resourceIBMAppIDMFARead(ctx context.Context, d *schema.ResourceData, meta i } func resourceIBMAppIDMFACreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -93,7 +95,7 @@ func resourceIBMAppIDMFACreate(ctx context.Context, d *schema.ResourceData, meta } func resourceIBMAppIDMFADelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_mfa_channel.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_mfa_channel.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_mfa_channel.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_mfa_channel.go index 093007a21c..eeda8f2cdc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_mfa_channel.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_mfa_channel.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func resourceIBMAppIDMFAChannel() *schema.Resource { +func ResourceIBMAppIDMFAChannel() *schema.Resource { return &schema.Resource{ Description: "Update MFA channel configuration", ReadContext: resourceIBMAppIDMFAChannelRead, @@ -64,7 +66,7 @@ func resourceIBMAppIDMFAChannel() *schema.Resource { } func resourceIBMAppIDMFAChannelRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -104,7 +106,7 @@ func resourceIBMAppIDMFAChannelRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDMFAChannelCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -140,7 +142,7 @@ func resourceIBMAppIDMFAChannelCreate(ctx context.Context, d *schema.ResourceDat } func resourceIBMAppIDMFAChannelDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_password_regex.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_password_regex.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_password_regex.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_password_regex.go index e6d7348647..979e477cd6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_password_regex.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_password_regex.go @@ -1,16 +1,18 @@ -package ibm +package appid import ( "context" b64 "encoding/base64" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDPasswordRegex() *schema.Resource { +func ResourceIBMAppIDPasswordRegex() *schema.Resource { return &schema.Resource{ Description: "The regular expression used by App ID for password strength validation", CreateContext: resourceIBMAppIDPasswordRegexCreate, @@ -47,7 +49,7 @@ func resourceIBMAppIDPasswordRegex() *schema.Resource { } func resourceIBMAppIDPasswordRegexRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -87,7 +89,7 @@ func resourceIBMAppIDPasswordRegexRead(ctx context.Context, d *schema.ResourceDa } func resourceIBMAppIDPasswordRegexCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -121,7 +123,7 @@ func resourceIBMAppIDPasswordRegexUpdate(ctx context.Context, d *schema.Resource } func resourceIBMAppIDPasswordRegexDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_redirect_urls.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_redirect_urls.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_redirect_urls.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_redirect_urls.go index 472c2ef886..081d1f815e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_redirect_urls.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_redirect_urls.go @@ -1,13 +1,16 @@ -package ibm +package appid import ( "context" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMAppIDRedirectURLs() *schema.Resource { +func ResourceIBMAppIDRedirectURLs() *schema.Resource { return &schema.Resource{ Description: "Redirect URIs that can be used as callbacks of App ID authentication flow", CreateContext: resourceIBMAppIDRedirectURLsCreate, @@ -37,7 +40,7 @@ func resourceIBMAppIDRedirectURLs() *schema.Resource { } func resourceIBMAppIDRedirectURLsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -62,7 +65,7 @@ func resourceIBMAppIDRedirectURLsRead(ctx context.Context, d *schema.ResourceDat } func resourceIBMAppIDRedirectURLsCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -71,7 +74,7 @@ func resourceIBMAppIDRedirectURLsCreate(ctx context.Context, d *schema.ResourceD tenantID := d.Get("tenant_id").(string) urls := d.Get("urls") - redirectURLs := expandStringList(urls.([]interface{})) + redirectURLs := flex.ExpandStringList(urls.([]interface{})) resp, err := appIDClient.UpdateRedirectUrisWithContext(ctx, &appid.UpdateRedirectUrisOptions{ TenantID: &tenantID, RedirectUrisArray: &appid.RedirectURIConfig{ @@ -88,7 +91,7 @@ func resourceIBMAppIDRedirectURLsCreate(ctx context.Context, d *schema.ResourceD } func resourceIBMAppIDRedirectURLsUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -97,7 +100,7 @@ func resourceIBMAppIDRedirectURLsUpdate(ctx context.Context, d *schema.ResourceD tenantID := d.Get("tenant_id").(string) urls := d.Get("urls") - redirectURLs := expandStringList(urls.([]interface{})) + redirectURLs := flex.ExpandStringList(urls.([]interface{})) resp, err := appIDClient.UpdateRedirectUrisWithContext(ctx, &appid.UpdateRedirectUrisOptions{ TenantID: &tenantID, RedirectUrisArray: &appid.RedirectURIConfig{ @@ -113,7 +116,7 @@ func resourceIBMAppIDRedirectURLsUpdate(ctx context.Context, d *schema.ResourceD } func resourceIBMAppIDRedirectURLsDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_role.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_role.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_role.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_role.go index f6dcdcdb6d..66c72c1495 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_role.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_role.go @@ -1,16 +1,18 @@ -package ibm +package appid import ( "context" "fmt" + "strings" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "strings" ) -func resourceIBMAppIDRole() *schema.Resource { +func ResourceIBMAppIDRole() *schema.Resource { return &schema.Resource{ Description: "A role is a collection of `scopes` that allow varying permissions to different types of app users", CreateContext: resourceIBMAppIDRoleCreate, @@ -67,7 +69,7 @@ func resourceIBMAppIDRole() *schema.Resource { } func resourceIBMAppIDRoleCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -99,7 +101,7 @@ func resourceIBMAppIDRoleCreate(ctx context.Context, d *schema.ResourceData, met } func resourceIBMAppIDRoleRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -141,7 +143,7 @@ func resourceIBMAppIDRoleRead(ctx context.Context, d *schema.ResourceData, meta } func resourceIBMAppIDRoleDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -172,7 +174,7 @@ func resourceIBMAppIDRoleDelete(ctx context.Context, d *schema.ResourceData, met func resourceIBMAppIDRoleUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { // AppID role resource does not support partial updates, all inputs should be included - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_theme_color.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_theme_color.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_theme_color.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_theme_color.go index 247f2a16f9..ee05e0a283 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_theme_color.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_theme_color.go @@ -1,17 +1,19 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) const defaultHeaderColor = "#EEF2F5" // AppID default -func resourceIBMAppIDThemeColor() *schema.Resource { +func ResourceIBMAppIDThemeColor() *schema.Resource { return &schema.Resource{ Description: "Colors of the App ID login widget", CreateContext: resourceIBMAppIDThemeColorCreate, @@ -37,7 +39,7 @@ func resourceIBMAppIDThemeColor() *schema.Resource { } func resourceIBMAppIDThemeColorRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -69,7 +71,7 @@ func resourceIBMAppIDThemeColorRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDThemeColorCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -98,7 +100,7 @@ func resourceIBMAppIDThemeColorUpdate(ctx context.Context, d *schema.ResourceDat } func resourceIBMAppIDThemeColorDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_theme_text.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_theme_text.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_theme_text.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_theme_text.go index 5bc8f66531..1424f1e4b8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_theme_text.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_theme_text.go @@ -1,15 +1,17 @@ -package ibm +package appid import ( "context" + "log" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" ) -func resourceIBMAppIDThemeText() *schema.Resource { +func ResourceIBMAppIDThemeText() *schema.Resource { return &schema.Resource{ Description: "Update theme texts of the App ID login widget", CreateContext: resourceIBMAppIDThemeTextCreate, @@ -36,7 +38,7 @@ func resourceIBMAppIDThemeText() *schema.Resource { } func resourceIBMAppIDThemeTextRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -72,7 +74,7 @@ func resourceIBMAppIDThemeTextRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDThemeTextCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -102,7 +104,7 @@ func resourceIBMAppIDThemeTextUpdate(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDThemeTextDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_token_config.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_token_config.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_token_config.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_token_config.go index 31024491b3..dd2e482d0b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_token_config.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_token_config.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package appid import ( "context" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -13,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func resourceIBMAppIDTokenConfig() *schema.Resource { +func ResourceIBMAppIDTokenConfig() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAppIDTokenConfigCreate, ReadContext: resourceIBMAppIDTokenConfigRead, @@ -109,7 +111,7 @@ func resourceIBMAppIDTokenConfig() *schema.Resource { } func resourceIBMAppIDTokenConfigCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appidClient, err := meta.(ClientSession).AppIDAPI() + appidClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -133,7 +135,7 @@ func resourceIBMAppIDTokenConfigCreate(ctx context.Context, d *schema.ResourceDa func resourceIBMAppIDTokenConfigRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics - appidClient, err := meta.(ClientSession).AppIDAPI() + appidClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -301,7 +303,7 @@ func tokenConfigDefaults(tenantID string) *appid.PutTokensConfigOptions { } func resourceIBMAppIDTokenConfigDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appidClient, err := meta.(ClientSession).AppIDAPI() + appidClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_user_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_user_roles.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_user_roles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_user_roles.go index 57b8735726..8b07ca82b7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_appid_user_roles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid/resource_ibm_appid_user_roles.go @@ -1,16 +1,19 @@ -package ibm +package appid import ( "context" "fmt" + "log" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" - "strings" ) -func resourceIBMAppIDUserRoles() *schema.Resource { +func ResourceIBMAppIDUserRoles() *schema.Resource { return &schema.Resource{ Description: "Manage AppID user roles", ReadContext: resourceIBMAppIDUserRolesRead, @@ -44,7 +47,7 @@ func resourceIBMAppIDUserRoles() *schema.Resource { } func resourceIBMAppIDUserRolesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -83,7 +86,7 @@ func resourceIBMAppIDUserRolesRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMAppIDUserRolesCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) @@ -97,7 +100,7 @@ func resourceIBMAppIDUserRolesCreate(ctx context.Context, d *schema.ResourceData TenantID: &tenantID, ID: &subject, Roles: &appid.UpdateUserRolesParamsRoles{ - Ids: expandStringList(roleIds.List()), + Ids: flex.ExpandStringList(roleIds.List()), }, } @@ -113,7 +116,7 @@ func resourceIBMAppIDUserRolesCreate(ctx context.Context, d *schema.ResourceData } func resourceIBMAppIDUserRolesDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - appIDClient, err := meta.(ClientSession).AppIDAPI() + appIDClient, err := meta.(conns.ClientSession).AppIDAPI() if err != nil { return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/README.md new file mode 100644 index 0000000000..6466e65630 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Activity Tracker + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Activity Tracker resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/atracker_route) +* IBM API Docs: [IBM API Docs for Activity Tracker](https://cloud.ibm.com/apidocs/atracker) +* IBM Activity Tracker SDK: [IBM SDK for Activity Tracker](https://github.com/IBM/platform-services-go-sdk/tree/main/atrackerv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_endpoints.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_endpoints.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_endpoints.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_endpoints.go index 325481786b..6b961dc95d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_endpoints.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_endpoints.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package atracker import ( "context" @@ -9,39 +9,40 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/atrackerv1" ) -func dataSourceIBMAtrackerEndpoints() *schema.Resource { +func DataSourceIBMAtrackerEndpoints() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAtrackerEndpointsRead, Schema: map[string]*schema.Schema{ - "api_endpoint": &schema.Schema{ + "api_endpoint": { Type: schema.TypeList, Computed: true, Description: "Activity Tracker API endpoint.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "public_url": &schema.Schema{ + "public_url": { Type: schema.TypeString, Computed: true, Description: "The public URL of Activity Tracker in a region.", }, - "public_enabled": &schema.Schema{ + "public_enabled": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether or not the public endpoint is enabled in the account.", }, - "private_url": &schema.Schema{ + "private_url": { Type: schema.TypeString, Computed: true, Description: "The private URL of Activity Tracker. This URL cannot be disabled.", }, - "private_enabled": &schema.Schema{ + "private_enabled": { Type: schema.TypeBool, Computed: true, Description: "The private endpoint is always enabled.", @@ -54,7 +55,7 @@ func dataSourceIBMAtrackerEndpoints() *schema.Resource { } func dataSourceIBMAtrackerEndpointsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -72,7 +73,7 @@ func dataSourceIBMAtrackerEndpointsRead(context context.Context, d *schema.Resou if endpoints.APIEndpoint != nil { err = d.Set("api_endpoint", dataSourceEndpointsFlattenAPIEndpoint(*endpoints.APIEndpoint)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting api_endpoint %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting api_endpoint %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_routes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_routes.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_routes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_routes.go index 20d22b36cb..17cea53e26 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_routes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_routes.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package atracker import ( "context" @@ -9,60 +9,61 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/atrackerv1" ) -func dataSourceIBMAtrackerRoutes() *schema.Resource { +func DataSourceIBMAtrackerRoutes() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAtrackerRoutesRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The name of the route.", }, - "routes": &schema.Schema{ + "routes": { Type: schema.TypeList, Computed: true, Description: "A list of route resources.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The uuid of the route resource.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the route.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The crn of the route resource.", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeInt, Computed: true, Description: "The version of the route.", }, - "receive_global_events": &schema.Schema{ + "receive_global_events": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether or not all global events should be forwarded to this region.", }, - "rules": &schema.Schema{ + "rules": { Type: schema.TypeList, Computed: true, Description: "The routing rules that will be evaluated in their order of the array.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target_ids": &schema.Schema{ + "target_ids": { Type: schema.TypeList, Computed: true, Description: "The target ID List. Only 1 target id is supported.", @@ -73,12 +74,12 @@ func dataSourceIBMAtrackerRoutes() *schema.Resource { }, }, }, - "created": &schema.Schema{ + "created": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the route creation time.", }, - "updated": &schema.Schema{ + "updated": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the route last updated time.", @@ -91,7 +92,7 @@ func dataSourceIBMAtrackerRoutes() *schema.Resource { } func dataSourceIBMAtrackerRoutesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -134,7 +135,7 @@ func dataSourceIBMAtrackerRoutesRead(context context.Context, d *schema.Resource if routeList.Routes != nil { err = d.Set("routes", dataSourceRouteListFlattenRoutes(routeList.Routes)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting routes %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting routes %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_targets.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_targets.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_targets.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_targets.go index 1663304c0b..4e43cf8f85 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_atracker_targets.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/data_source_ibm_atracker_targets.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package atracker import ( "context" @@ -9,75 +9,76 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/atrackerv1" ) -func dataSourceIBMAtrackerTargets() *schema.Resource { +func DataSourceIBMAtrackerTargets() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMAtrackerTargetsRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The name of the target resource.", }, - "targets": &schema.Schema{ + "targets": { Type: schema.TypeList, Computed: true, Description: "A list of target resources.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The uuid of the target resource.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the target resource.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The crn of the target resource.", }, - "target_type": &schema.Schema{ + "target_type": { Type: schema.TypeString, Computed: true, Description: "The type of the target.", }, - "encrypt_key": &schema.Schema{ + "encrypt_key": { Type: schema.TypeString, Computed: true, Description: "The encryption key that is used to encrypt events before Activity Tracker services buffer them on storage. This credential is masked in the response.", }, - "cos_endpoint": &schema.Schema{ + "cos_endpoint": { Type: schema.TypeList, Computed: true, Description: "Property values for a Cloud Object Storage Endpoint.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "endpoint": &schema.Schema{ + "endpoint": { Type: schema.TypeString, Computed: true, Description: "The host name of the Cloud Object Storage endpoint.", }, - "target_crn": &schema.Schema{ + "target_crn": { Type: schema.TypeString, Computed: true, Description: "The CRN of the Cloud Object Storage instance.", }, - "bucket": &schema.Schema{ + "bucket": { Type: schema.TypeString, Computed: true, Description: "The bucket name under the Cloud Object Storage instance.", }, - "api_key": &schema.Schema{ + "api_key": { Type: schema.TypeString, Computed: true, Sensitive: true, @@ -86,23 +87,23 @@ func dataSourceIBMAtrackerTargets() *schema.Resource { }, }, }, - "cos_write_status": &schema.Schema{ + "cos_write_status": { Type: schema.TypeList, Computed: true, Description: "The status of the write attempt with the provided cos_endpoint parameters.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status such as failed or success.", }, - "last_failure": &schema.Schema{ + "last_failure": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the failure.", }, - "reason_for_last_failure": &schema.Schema{ + "reason_for_last_failure": { Type: schema.TypeString, Computed: true, Description: "Detailed description of the cause of the failure.", @@ -110,12 +111,12 @@ func dataSourceIBMAtrackerTargets() *schema.Resource { }, }, }, - "created": &schema.Schema{ + "created": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the target creation time.", }, - "updated": &schema.Schema{ + "updated": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the target last updated time.", @@ -128,7 +129,7 @@ func dataSourceIBMAtrackerTargets() *schema.Resource { } func dataSourceIBMAtrackerTargetsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -171,7 +172,7 @@ func dataSourceIBMAtrackerTargetsRead(context context.Context, d *schema.Resourc if targetList.Targets != nil { err = d.Set("targets", dataSourceTargetListFlattenTargets(targetList.Targets)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting targets %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting targets %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_atracker_route.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/resource_ibm_atracker_route.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_atracker_route.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/resource_ibm_atracker_route.go index 9e09a99e2e..d6b4e5197e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_atracker_route.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/resource_ibm_atracker_route.go @@ -1,20 +1,23 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package atracker import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/atrackerv1" ) -func resourceIBMAtrackerRoute() *schema.Resource { +func ResourceIBMAtrackerRoute() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAtrackerRouteCreate, ReadContext: resourceIBMAtrackerRouteRead, @@ -23,24 +26,24 @@ func resourceIBMAtrackerRoute() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_atracker_route", "name"), + ValidateFunc: validate.InvokeValidator("ibm_atracker_route", "name"), Description: "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`.", }, - "receive_global_events": &schema.Schema{ + "receive_global_events": { Type: schema.TypeBool, Required: true, Description: "Indicates whether or not all global events should be forwarded to this region.", }, - "rules": &schema.Schema{ + "rules": { Type: schema.TypeList, Required: true, Description: "Routing rules that will be evaluated in their order of the array.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target_ids": &schema.Schema{ + "target_ids": { Type: schema.TypeList, Required: true, Description: "The target ID List. Only 1 target id is supported.", @@ -49,22 +52,22 @@ func resourceIBMAtrackerRoute() *schema.Resource { }, }, }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The crn of the route resource.", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeInt, Computed: true, Description: "The version of the route.", }, - "created": &schema.Schema{ + "created": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the route creation time.", }, - "updated": &schema.Schema{ + "updated": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the route last updated time.", @@ -73,13 +76,13 @@ func resourceIBMAtrackerRoute() *schema.Resource { } } -func resourceIBMAtrackerRouteValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMAtrackerRouteValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-zA-Z0-9 -._:]+$`, MinValueLength: 1, @@ -87,12 +90,12 @@ func resourceIBMAtrackerRouteValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_atracker_route", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_atracker_route", Schema: validateSchema} return &resourceValidator } func resourceIBMAtrackerRouteCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -133,7 +136,7 @@ func resourceIBMAtrackerRouteMapToRule(ruleMap map[string]interface{}) atrackerv } func resourceIBMAtrackerRouteRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -153,10 +156,10 @@ func resourceIBMAtrackerRouteRead(context context.Context, d *schema.ResourceDat } if err = d.Set("name", route.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("receive_global_events", route.ReceiveGlobalEvents); err != nil { - return diag.FromErr(fmt.Errorf("Error setting receive_global_events: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting receive_global_events: %s", err)) } rules := []map[string]interface{}{} for _, rulesItem := range route.Rules { @@ -164,19 +167,19 @@ func resourceIBMAtrackerRouteRead(context context.Context, d *schema.ResourceDat rules = append(rules, rulesItemMap) } if err = d.Set("rules", rules); err != nil { - return diag.FromErr(fmt.Errorf("Error setting rules: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting rules: %s", err)) } if err = d.Set("crn", route.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } - if err = d.Set("version", intValue(route.Version)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) + if err = d.Set("version", flex.IntValue(route.Version)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) } - if err = d.Set("created", dateTimeToString(route.Created)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created: %s", err)) + if err = d.Set("created", flex.DateTimeToString(route.Created)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created: %s", err)) } - if err = d.Set("updated", dateTimeToString(route.Updated)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated: %s", err)) + if err = d.Set("updated", flex.DateTimeToString(route.Updated)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated: %s", err)) } return nil @@ -191,7 +194,7 @@ func resourceIBMAtrackerRouteRuleToMap(rule atrackerv1.Rule) map[string]interfac } func resourceIBMAtrackerRouteUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -219,7 +222,7 @@ func resourceIBMAtrackerRouteUpdate(context context.Context, d *schema.ResourceD } func resourceIBMAtrackerRouteDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_atracker_target.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/resource_ibm_atracker_target.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_atracker_target.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/resource_ibm_atracker_target.go index 43f4e9e806..e3163aa8d2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_atracker_target.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker/resource_ibm_atracker_target.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package atracker import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +18,7 @@ import ( "github.com/IBM/platform-services-go-sdk/atrackerv1" ) -func resourceIBMAtrackerTarget() *schema.Resource { +func ResourceIBMAtrackerTarget() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMAtrackerTargetCreate, ReadContext: resourceIBMAtrackerTargetRead, @@ -24,20 +27,20 @@ func resourceIBMAtrackerTarget() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_atracker_target", "name"), + ValidateFunc: validate.InvokeValidator("ibm_atracker_target", "name"), Description: "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`.", }, - "target_type": &schema.Schema{ + "target_type": { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_atracker_target", "target_type"), + ValidateFunc: validate.InvokeValidator("ibm_atracker_target", "target_type"), Description: "The type of the target.", }, - "cos_endpoint": &schema.Schema{ + "cos_endpoint": { Type: schema.TypeList, MinItems: 1, MaxItems: 1, @@ -45,58 +48,58 @@ func resourceIBMAtrackerTarget() *schema.Resource { Description: "Property values for a Cloud Object Storage Endpoint.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "endpoint": &schema.Schema{ + "endpoint": { Type: schema.TypeString, Required: true, Description: "The host name of the Cloud Object Storage endpoint.", }, - "target_crn": &schema.Schema{ + "target_crn": { Type: schema.TypeString, Required: true, Description: "The CRN of the Cloud Object Storage instance.", }, - "bucket": &schema.Schema{ + "bucket": { Type: schema.TypeString, Required: true, Description: "The bucket name under the Cloud Object Storage instance.", }, - "api_key": &schema.Schema{ + "api_key": { Type: schema.TypeString, Required: true, Sensitive: true, Description: "The IAM API key that has writer access to the Cloud Object Storage instance. This credential is masked in the response.", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, }, }, }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The crn of the target resource.", }, - "encrypt_key": &schema.Schema{ + "encrypt_key": { Type: schema.TypeString, Computed: true, Description: "The encryption key that is used to encrypt events before Activity Tracker services buffer them on storage. This credential is masked in the response.", }, - "cos_write_status": &schema.Schema{ + "cos_write_status": { Type: schema.TypeList, Computed: true, Description: "The status of the write attempt with the provided cos_endpoint parameters.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Optional: true, Description: "The status such as failed or success.", }, - "last_failure": &schema.Schema{ + "last_failure": { Type: schema.TypeString, Optional: true, Description: "The timestamp of the failure.", }, - "reason_for_last_failure": &schema.Schema{ + "reason_for_last_failure": { Type: schema.TypeString, Optional: true, Description: "Detailed description of the cause of the failure.", @@ -104,12 +107,12 @@ func resourceIBMAtrackerTarget() *schema.Resource { }, }, }, - "created": &schema.Schema{ + "created": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the target creation time.", }, - "updated": &schema.Schema{ + "updated": { Type: schema.TypeString, Computed: true, Description: "The timestamp of the target last updated time.", @@ -118,33 +121,33 @@ func resourceIBMAtrackerTarget() *schema.Resource { } } -func resourceIBMAtrackerTargetValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMAtrackerTargetValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-zA-Z0-9 -._:]+$`, MinValueLength: 1, MaxValueLength: 1000, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "target_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "cloud_object_storage", }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_atracker_target", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_atracker_target", Schema: validateSchema} return &resourceValidator } func resourceIBMAtrackerTargetCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -179,7 +182,7 @@ func resourceIBMAtrackerTargetMapToCosEndpoint(cosEndpointMap map[string]interfa } func resourceIBMAtrackerTargetRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -199,32 +202,32 @@ func resourceIBMAtrackerTargetRead(context context.Context, d *schema.ResourceDa } if err = d.Set("name", target.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("target_type", target.TargetType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting target_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting target_type: %s", err)) } cosEndpointMap := resourceIBMAtrackerTargetCosEndpointToMap(*target.CosEndpoint) if err = d.Set("cos_endpoint", []map[string]interface{}{cosEndpointMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cos_endpoint: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cos_endpoint: %s", err)) } if err = d.Set("crn", target.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("encrypt_key", target.EncryptKey); err != nil { - return diag.FromErr(fmt.Errorf("Error setting encrypt_key: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting encrypt_key: %s", err)) } if target.CosWriteStatus != nil { cosWriteStatusMap := resourceIBMAtrackerTargetCosWriteStatusToMap(*target.CosWriteStatus) if err = d.Set("cos_write_status", []map[string]interface{}{cosWriteStatusMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cos_write_status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cos_write_status: %s", err)) } } - if err = d.Set("created", dateTimeToString(target.Created)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created: %s", err)) + if err = d.Set("created", flex.DateTimeToString(target.Created)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created: %s", err)) } - if err = d.Set("updated", dateTimeToString(target.Updated)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated: %s", err)) + if err = d.Set("updated", flex.DateTimeToString(target.Updated)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated: %s", err)) } return nil @@ -258,7 +261,7 @@ func resourceIBMAtrackerTargetCosWriteStatusToMap(cosWriteStatus atrackerv1.CosW } func resourceIBMAtrackerTargetUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } @@ -289,7 +292,7 @@ func resourceIBMAtrackerTargetUpdate(context context.Context, d *schema.Resource } func resourceIBMAtrackerTargetDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - atrackerClient, err := meta.(ClientSession).AtrackerV1() + atrackerClient, err := meta.(conns.ClientSession).AtrackerV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/README.md new file mode 100644 index 0000000000..5d3ac20bd0 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Catalog Management + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Catalog Management resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cm_catalog) +* IBM API Docs: [IBM API Docs for Catalog Management](https://cloud.ibm.com/apidocs/resource-catalog/private-catalog) +* IBM Catalog Management SDK: [IBM SDK for Catalog Management](https://github.com/IBM/platform-services-go-sdk/tree/main/catalogmanagementv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go new file mode 100644 index 0000000000..a23ebc2bde --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go @@ -0,0 +1,125 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package catalogmanagement + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" +) + +func DataSourceIBMCmCatalog() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMCmCatalogRead, + + Schema: map[string]*schema.Schema{ + "catalog_identifier": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "ID for catalog", + }, + "kind": { + Type: schema.TypeString, + Computed: true, + Description: "Kind of catalog, offering or vpe.", + }, + "label": { + Type: schema.TypeString, + Computed: true, + Description: "Display Name in the requested language.", + }, + "short_description": { + Type: schema.TypeString, + Computed: true, + Description: "Description in the requested language.", + }, + "catalog_icon_url": { + Type: schema.TypeString, + Computed: true, + Description: "URL for an icon associated with this catalog.", + }, + "tags": { + Type: schema.TypeList, + Computed: true, + Description: "List of tags associated with this catalog.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "url": { + Type: schema.TypeString, + Computed: true, + Description: "The url for this specific catalog.", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "CRN associated with the catalog.", + }, + "offerings_url": { + Type: schema.TypeString, + Computed: true, + Description: "URL path to offerings.", + }, + "resource_group_id": { + Type: schema.TypeString, + Computed: true, + Description: "Resource Group ID", + }, + }, + } +} + +func dataSourceIBMCmCatalogRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() + if err != nil { + return diag.FromErr(err) + } + + getCatalogOptions := &catalogmanagementv1.GetCatalogOptions{} + + getCatalogOptions.SetCatalogIdentifier(d.Get("catalog_identifier").(string)) + + catalog, response, err := catalogManagementClient.GetCatalogWithContext(context, getCatalogOptions) + if err != nil { + log.Printf("[DEBUG] GetCatalogWithContext failed %s\n%s", err, response) + return diag.FromErr(err) + } + + d.SetId(*catalog.ID) + if err = d.Set("label", catalog.Label); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting label: %s", err)) + } + if err = d.Set("short_description", catalog.ShortDescription); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting short_description: %s", err)) + } + if err = d.Set("catalog_icon_url", catalog.CatalogIconURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_icon_url: %s", err)) + } + if err = d.Set("tags", catalog.Tags); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting tags: %s", err)) + } + if err = d.Set("url", catalog.URL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting url: %s", err)) + } + if err = d.Set("crn", catalog.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + if err = d.Set("offerings_url", catalog.OfferingsURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting offerings_url: %s", err)) + } + if err = d.Set("kind", catalog.Kind); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kind: %s", err)) + } + if err = d.Set("resource_group_id", catalog.ResourceGroupID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group_id: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_offering.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_offering.go new file mode 100644 index 0000000000..024a066ddd --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_offering.go @@ -0,0 +1,259 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package catalogmanagement + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" +) + +func DataSourceIBMCmOffering() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMCmOfferingRead, + + Schema: map[string]*schema.Schema{ + "catalog_identifier": { + Type: schema.TypeString, + Required: true, + Description: "Catalog identifier.", + ForceNew: true, + }, + "offering_id": { + Type: schema.TypeString, + Required: true, + Description: "The id of the catalog containing this offering.", + ForceNew: true, + }, + "url": { + Type: schema.TypeString, + Computed: true, + Description: "The url for this specific offering.", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "The crn for this specific offering.", + }, + "label": { + Type: schema.TypeString, + Computed: true, + Description: "Display Name in the requested language.", + ForceNew: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The programmatic name of this offering.", + }, + "offering_icon_url": { + Type: schema.TypeString, + Computed: true, + Description: "URL for an icon associated with this offering.", + }, + "offering_docs_url": { + Type: schema.TypeString, + Computed: true, + Description: "URL for an additional docs with this offering.", + }, + "offering_support_url": { + Type: schema.TypeString, + Computed: true, + Description: "URL to be displayed in the Consumption UI for getting support on this offering.", + }, + "short_description": { + Type: schema.TypeString, + Computed: true, + Description: "Short description in the requested language.", + }, + "long_description": { + Type: schema.TypeString, + Computed: true, + Description: "Long description in the requested language.", + }, + "permit_request_ibm_public_publish": { + Type: schema.TypeBool, + Computed: true, + Description: "Is it permitted to request publishing to IBM or Public.", + }, + "ibm_publish_approved": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates if this offering has been approved for use by all IBMers.", + }, + "public_publish_approved": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates if this offering has been approved for use by all IBM Cloud users.", + }, + "public_original_crn": { + Type: schema.TypeString, + Computed: true, + Description: "The original offering CRN that this publish entry came from.", + }, + "publish_public_crn": { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the public catalog entry of this offering.", + }, + "portal_approval_record": { + Type: schema.TypeString, + Computed: true, + Description: "The portal's approval record ID.", + }, + "portal_ui_url": { + Type: schema.TypeString, + Computed: true, + Description: "The portal UI URL.", + }, + "catalog_id": { + Type: schema.TypeString, + Computed: true, + Description: "The id of the catalog containing this offering.", + }, + "catalog_name": { + Type: schema.TypeString, + Computed: true, + Description: "The name of the catalog.", + }, + "disclaimer": { + Type: schema.TypeString, + Computed: true, + Description: "A disclaimer for this offering.", + }, + "hidden": { + Type: schema.TypeBool, + Computed: true, + Description: "Determine if this offering should be displayed in the Consumption UI.", + }, + "repo_info": { + Type: schema.TypeList, + Computed: true, + Description: "Repository info for offerings.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "token": { + Type: schema.TypeString, + Computed: true, + Description: "Token for private repos.", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: "Public or enterprise GitHub.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMCmOfferingRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() + if err != nil { + return diag.FromErr(err) + } + + getOfferingOptions := &catalogmanagementv1.GetOfferingOptions{} + + getOfferingOptions.SetCatalogIdentifier(d.Get("catalog_identifier").(string)) + getOfferingOptions.SetOfferingID(d.Get("offering_id").(string)) + + offering, response, err := catalogManagementClient.GetOfferingWithContext(context, getOfferingOptions) + if err != nil { + log.Printf("[DEBUG] GetOfferingWithContext failed %s\n%s", err, response) + return diag.FromErr(err) + } + + d.SetId(*offering.ID) + if err = d.Set("url", offering.URL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting url: %s", err)) + } + if err = d.Set("crn", offering.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + if err = d.Set("label", offering.Label); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting label: %s", err)) + } + if err = d.Set("name", offering.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + if err = d.Set("offering_icon_url", offering.OfferingIconURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting offering_icon_url: %s", err)) + } + if err = d.Set("offering_docs_url", offering.OfferingDocsURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting offering_docs_url: %s", err)) + } + if err = d.Set("offering_support_url", offering.OfferingSupportURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting offering_support_url: %s", err)) + } + if err = d.Set("short_description", offering.ShortDescription); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting short_description: %s", err)) + } + if err = d.Set("long_description", offering.LongDescription); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting long_description: %s", err)) + } + if err = d.Set("permit_request_ibm_public_publish", offering.PermitRequestIBMPublicPublish); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting permit_request_ibm_public_publish: %s", err)) + } + if err = d.Set("ibm_publish_approved", offering.IBMPublishApproved); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ibm_publish_approved: %s", err)) + } + if err = d.Set("public_publish_approved", offering.PublicPublishApproved); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting public_publish_approved: %s", err)) + } + if err = d.Set("public_original_crn", offering.PublicOriginalCRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting public_original_crn: %s", err)) + } + if err = d.Set("publish_public_crn", offering.PublishPublicCRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting publish_public_crn: %s", err)) + } + if err = d.Set("portal_approval_record", offering.PortalApprovalRecord); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting portal_approval_record: %s", err)) + } + if err = d.Set("portal_ui_url", offering.PortalUIURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting portal_ui_url: %s", err)) + } + if err = d.Set("catalog_id", offering.CatalogID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_id: %s", err)) + } + if err = d.Set("catalog_name", offering.CatalogName); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_name: %s", err)) + } + if err = d.Set("disclaimer", offering.Disclaimer); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting disclaimer: %s", err)) + } + if err = d.Set("hidden", offering.Hidden); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting hidden: %s", err)) + } + + if offering.RepoInfo != nil { + repoInfoMap := dataSourceOfferingRepoInfoToMap(*offering.RepoInfo) + if err = d.Set("repo_info", []map[string]interface{}{repoInfoMap}); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting repo_info %s", err)) + } + } + + return nil +} + +func dataSourceOfferingRepoInfoToMap(repoInfoItem catalogmanagementv1.RepoInfo) (repoInfoMap map[string]interface{}) { + repoInfoMap = map[string]interface{}{} + + if repoInfoItem.Token != nil { + repoInfoMap["token"] = repoInfoItem.Token + } + if repoInfoItem.Type != nil { + repoInfoMap["type"] = repoInfoItem.Type + } + + return repoInfoMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_offering_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_offering_instance.go new file mode 100644 index 0000000000..ffc2263bc3 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_offering_instance.go @@ -0,0 +1,183 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package catalogmanagement + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" +) + +func DataSourceIBMCmOfferingInstance() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMCmOfferingInstanceRead, + + Schema: map[string]*schema.Schema{ + "instance_identifier": { + Type: schema.TypeString, + Required: true, + Description: "ID for this instance", + }, + "url": { + Type: schema.TypeString, + Computed: true, + Description: "url reference to this object.", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "platform CRN for this instance.", + }, + "_rev": { + Type: schema.TypeString, + Computed: true, + Description: "Cloudant Revision for this instance", + }, + "label": { + Type: schema.TypeString, + Computed: true, + Description: "the label for this instance.", + }, + "catalog_id": { + Type: schema.TypeString, + Computed: true, + Description: "Catalog ID this instance was created from.", + }, + "offering_id": { + Type: schema.TypeString, + Computed: true, + Description: "Offering ID this instance was created from.", + }, + "kind_format": { + Type: schema.TypeString, + Computed: true, + Description: "the format this instance has (helm, operator, ova...).", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "The version this instance was installed from (not version id).", + }, + "cluster_id": { + Type: schema.TypeString, + Computed: true, + Description: "Cluster ID.", + }, + "cluster_region": { + Type: schema.TypeString, + Computed: true, + Description: "Cluster region (e.g., us-south).", + }, + "cluster_namespaces": { + Type: schema.TypeList, + Computed: true, + Description: "List of target namespaces to install into.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "cluster_all_namespaces": { + Type: schema.TypeBool, + Computed: true, + Description: "designate to install into all namespaces.", + }, + "schematics_workspace_id": { + Type: schema.TypeString, + Computed: true, + Description: "id of the schematics workspace, for offerings installed through schematics", + }, + "resource_group_id": { + Type: schema.TypeString, + Computed: true, + Description: "id of the resource group", + }, + "install_plan": { + Type: schema.TypeString, + Computed: true, + Description: "install plan for the subscription of the operator- can be either Automatic or Manual. Required for operator bundles", + }, + "channel": { + Type: schema.TypeString, + Computed: true, + Description: "channel to target for the operator subscription. Required for operator bundles", + }, + }, + } +} + +func dataSourceIBMCmOfferingInstanceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() + if err != nil { + return diag.FromErr(err) + } + + getOfferingInstanceOptions := &catalogmanagementv1.GetOfferingInstanceOptions{} + + getOfferingInstanceOptions.SetInstanceIdentifier(d.Get("instance_identifier").(string)) + + offeringInstance, response, err := catalogManagementClient.GetOfferingInstanceWithContext(context, getOfferingInstanceOptions) + if err != nil { + log.Printf("[DEBUG] GetOfferingInstanceWithContext failed %s\n%s", err, response) + return diag.FromErr(err) + } + + d.SetId(*offeringInstance.ID) + + if err = d.Set("url", offeringInstance.URL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting url: %s", err)) + } + if err = d.Set("crn", offeringInstance.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + if err = d.Set("_rev", offeringInstance.Rev); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting _rev: %s", err)) + } + if err = d.Set("label", offeringInstance.Label); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting label: %s", err)) + } + if err = d.Set("catalog_id", offeringInstance.CatalogID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_id: %s", err)) + } + if err = d.Set("offering_id", offeringInstance.OfferingID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting offering_id: %s", err)) + } + if err = d.Set("kind_format", offeringInstance.KindFormat); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kind_format: %s", err)) + } + if err = d.Set("version", offeringInstance.Version); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) + } + if err = d.Set("cluster_id", offeringInstance.ClusterID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cluster_id: %s", err)) + } + if err = d.Set("cluster_region", offeringInstance.ClusterRegion); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cluster_region: %s", err)) + } + if err = d.Set("cluster_namespaces", offeringInstance.ClusterNamespaces); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cluster_namespaces: %s", err)) + } + if err = d.Set("cluster_all_namespaces", offeringInstance.ClusterAllNamespaces); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cluster_all_namespaces: %s", err)) + } + if err = d.Set("schematics_workspace_id", offeringInstance.SchematicsWorkspaceID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting schematics_workspace_id: %s", err)) + } + if err = d.Set("resource_group_id", offeringInstance.ResourceGroupID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group_id: %s", err)) + } + if err = d.Set("install_plan", offeringInstance.InstallPlan); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting install_plan: %s", err)) + } + if err = d.Set("channel", offeringInstance.Channel); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting channel: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_version.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_version.go new file mode 100644 index 0000000000..4849e6ff07 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/data_source_ibm_cm_version.go @@ -0,0 +1,110 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package catalogmanagement + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" +) + +func DataSourceIBMCmVersion() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMCmVersionRead, + + Schema: map[string]*schema.Schema{ + "version_loc_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Catalog identifier.", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "Version's CRN.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Version of content type.", + }, + "sha": { + Type: schema.TypeString, + Computed: true, + Description: "hash of the content.", + }, + "catalog_id": { + Type: schema.TypeString, + Computed: true, + Description: "Catalog ID.", + }, + "repo_url": { + Type: schema.TypeString, + Computed: true, + Description: "Content's repo URL.", + }, + "source_url": { + Type: schema.TypeString, + Computed: true, + Description: "Content's source URL (e.g git repo).", + }, + "tgz_url": { + Type: schema.TypeString, + Computed: true, + Description: "File used to on-board this version.", + }, + }, + } +} + +func dataSourceIBMCmVersionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() + if err != nil { + return diag.FromErr(err) + } + + getVersionOptions := &catalogmanagementv1.GetVersionOptions{} + + getVersionOptions.SetVersionLocID(d.Get("version_loc_id").(string)) + + offering, response, err := catalogManagementClient.GetVersionWithContext(context, getVersionOptions) + version := offering.Kinds[0].Versions[0] + + if err != nil { + log.Printf("[DEBUG] GetVersionWithContext failed %s\n%s", err, response) + return diag.FromErr(err) + } + + d.SetId(*version.VersionLocator) + if err = d.Set("crn", version.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + if err = d.Set("version", version.Version); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) + } + if err = d.Set("sha", version.Sha); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sha: %s", err)) + } + if err = d.Set("catalog_id", version.CatalogID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_id: %s", err)) + } + if err = d.Set("repo_url", version.RepoURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting repo_url: %s", err)) + } + if err = d.Set("source_url", version.SourceURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_url: %s", err)) + } + if err = d.Set("tgz_url", version.TgzURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting tgz_url: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_catalog.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_catalog.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go index a7c65920d4..e2a4ff2350 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_catalog.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_catalog.go @@ -1,18 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package catalogmanagement import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" ) -func resourceIBMCmCatalog() *schema.Resource { +func ResourceIBMCmCatalog() *schema.Resource { return &schema.Resource{ Create: resourceIBMCmCatalogCreate, Read: resourceIBMCmCatalogRead, @@ -20,54 +21,54 @@ func resourceIBMCmCatalog() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Optional: true, ForceNew: true, Default: "offering", Description: "Kind of catalog, offering or vpe.", }, - "label": &schema.Schema{ + "label": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Display Name in the requested language.", }, - "short_description": &schema.Schema{ + "short_description": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "Description in the requested language.", }, - "catalog_icon_url": &schema.Schema{ + "catalog_icon_url": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "URL for an icon associated with this catalog.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, ForceNew: true, Description: "List of tags associated with this catalog.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The url for this specific catalog.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "CRN associated with the catalog.", }, - "offerings_url": &schema.Schema{ + "offerings_url": { Type: schema.TypeString, Computed: true, Description: "URL path to offerings.", }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Computed: true, ForceNew: true, @@ -79,7 +80,7 @@ func resourceIBMCmCatalog() *schema.Resource { } func resourceIBMCmCatalogCreate(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -117,7 +118,7 @@ func resourceIBMCmCatalogCreate(d *schema.ResourceData, meta interface{}) error } func resourceIBMCmCatalogRead(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -137,40 +138,40 @@ func resourceIBMCmCatalogRead(d *schema.ResourceData, meta interface{}) error { return err } if err = d.Set("label", catalog.Label); err != nil { - return fmt.Errorf("Error setting label: %s", err) + return fmt.Errorf("[ERROR] Error setting label: %s", err) } if err = d.Set("short_description", catalog.ShortDescription); err != nil { - return fmt.Errorf("Error setting short_description: %s", err) + return fmt.Errorf("[ERROR] Error setting short_description: %s", err) } if err = d.Set("catalog_icon_url", catalog.CatalogIconURL); err != nil { - return fmt.Errorf("Error setting catalog_icon_url: %s", err) + return fmt.Errorf("[ERROR] Error setting catalog_icon_url: %s", err) } if catalog.Tags != nil { if err = d.Set("tags", catalog.Tags); err != nil { - return fmt.Errorf("Error setting tags: %s", err) + return fmt.Errorf("[ERROR] Error setting tags: %s", err) } } if err = d.Set("url", catalog.URL); err != nil { - return fmt.Errorf("Error setting url: %s", err) + return fmt.Errorf("[ERROR] Error setting url: %s", err) } if err = d.Set("crn", catalog.CRN); err != nil { - return fmt.Errorf("Error setting crn: %s", err) + return fmt.Errorf("[ERROR] Error setting crn: %s", err) } if err = d.Set("offerings_url", catalog.OfferingsURL); err != nil { - return fmt.Errorf("Error setting offerings_url: %s", err) + return fmt.Errorf("[ERROR] Error setting offerings_url: %s", err) } if err = d.Set("kind", catalog.Kind); err != nil { - return fmt.Errorf("Error setting kind: %s", err) + return fmt.Errorf("[ERROR] Error setting kind: %s", err) } if err = d.Set("resource_group_id", catalog.ResourceGroupID); err != nil { - return fmt.Errorf("Error setting resource_group_id: %s", err) + return fmt.Errorf("[ERROR] Error setting resource_group_id: %s", err) } return nil } func resourceIBMCmCatalogDelete(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_offering.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_offering.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_offering.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_offering.go index 11dc914e6c..7eab888a8d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_offering.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_offering.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package catalogmanagement import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" ) -func resourceIBMCmOffering() *schema.Resource { +func ResourceIBMCmOffering() *schema.Resource { return &schema.Resource{ Create: resourceIBMCmOfferingCreate, Read: resourceIBMCmOfferingRead, @@ -20,132 +22,132 @@ func resourceIBMCmOffering() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Computed: true, Description: "The id of the catalog containing this offering.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The url for this specific offering.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The crn for this specific offering.", }, - "label": &schema.Schema{ + "label": { Type: schema.TypeString, Required: true, Description: "Display Name in the requested language.", ForceNew: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The programmatic name of this offering.", }, - "offering_icon_url": &schema.Schema{ + "offering_icon_url": { Type: schema.TypeString, Computed: true, Description: "URL for an icon associated with this offering.", }, - "offering_docs_url": &schema.Schema{ + "offering_docs_url": { Type: schema.TypeString, Computed: true, Description: "URL for an additional docs with this offering.", }, - "offering_support_url": &schema.Schema{ + "offering_support_url": { Type: schema.TypeString, Computed: true, Description: "URL to be displayed in the Consumption UI for getting support on this offering.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, ForceNew: true, Description: "List of tags associated with this catalog.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "short_description": &schema.Schema{ + "short_description": { Type: schema.TypeString, Computed: true, Description: "Short description in the requested language.", }, - "long_description": &schema.Schema{ + "long_description": { Type: schema.TypeString, Computed: true, Description: "Long description in the requested language.", }, - "permit_request_ibm_public_publish": &schema.Schema{ + "permit_request_ibm_public_publish": { Type: schema.TypeBool, Computed: true, Description: "Is it permitted to request publishing to IBM or Public.", }, - "ibm_publish_approved": &schema.Schema{ + "ibm_publish_approved": { Type: schema.TypeBool, Computed: true, Description: "Indicates if this offering has been approved for use by all IBMers.", }, - "public_publish_approved": &schema.Schema{ + "public_publish_approved": { Type: schema.TypeBool, Computed: true, Description: "Indicates if this offering has been approved for use by all IBM Cloud users.", }, - "public_original_crn": &schema.Schema{ + "public_original_crn": { Type: schema.TypeString, Computed: true, Description: "The original offering CRN that this publish entry came from.", }, - "publish_public_crn": &schema.Schema{ + "publish_public_crn": { Type: schema.TypeString, Computed: true, Description: "The crn of the public catalog entry of this offering.", }, - "portal_approval_record": &schema.Schema{ + "portal_approval_record": { Type: schema.TypeString, Computed: true, Description: "The portal's approval record ID.", }, - "portal_ui_url": &schema.Schema{ + "portal_ui_url": { Type: schema.TypeString, Computed: true, Description: "The portal UI URL.", }, - "catalog_id": &schema.Schema{ + "catalog_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The id of the catalog containing this offering.", }, - "catalog_name": &schema.Schema{ + "catalog_name": { Type: schema.TypeString, Computed: true, Description: "The name of the catalog.", }, - "disclaimer": &schema.Schema{ + "disclaimer": { Type: schema.TypeString, Computed: true, Description: "A disclaimer for this offering.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "Determine if this offering should be displayed in the Consumption UI.", }, - "repo_info": &schema.Schema{ + "repo_info": { Type: schema.TypeList, Computed: true, Description: "Repository info for offerings.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "token": &schema.Schema{ + "token": { Type: schema.TypeString, Computed: true, Description: "Token for private repos.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Public or enterprise GitHub.", @@ -158,7 +160,7 @@ func resourceIBMCmOffering() *schema.Resource { } func resourceIBMCmOfferingCreate(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -178,7 +180,7 @@ func resourceIBMCmOfferingCreate(d *schema.ResourceData, meta interface{}) error createOfferingOptions.SetOfferingSupportURL(d.Get("offering_support_url").(string)) } if tags, ok := d.GetOk("tags"); ok { - list := expandStringList(tags.([]interface{})) + list := flex.ExpandStringList(tags.([]interface{})) createOfferingOptions.SetTags(list) } @@ -195,7 +197,7 @@ func resourceIBMCmOfferingCreate(d *schema.ResourceData, meta interface{}) error } func resourceIBMCmOfferingRead(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -215,69 +217,69 @@ func resourceIBMCmOfferingRead(d *schema.ResourceData, meta interface{}) error { return err } if err = d.Set("url", offering.URL); err != nil { - return fmt.Errorf("Error setting url: %s", err) + return fmt.Errorf("[ERROR] Error setting url: %s", err) } if err = d.Set("crn", offering.CRN); err != nil { - return fmt.Errorf("Error setting crn: %s", err) + return fmt.Errorf("[ERROR] Error setting crn: %s", err) } if err = d.Set("label", offering.Label); err != nil { - return fmt.Errorf("Error setting label: %s", err) + return fmt.Errorf("[ERROR] Error setting label: %s", err) } if err = d.Set("name", offering.Name); err != nil { - return fmt.Errorf("Error setting name: %s", err) + return fmt.Errorf("[ERROR] Error setting name: %s", err) } if err = d.Set("offering_icon_url", offering.OfferingIconURL); err != nil { - return fmt.Errorf("Error setting offering_icon_url: %s", err) + return fmt.Errorf("[ERROR] Error setting offering_icon_url: %s", err) } if err = d.Set("offering_docs_url", offering.OfferingDocsURL); err != nil { - return fmt.Errorf("Error setting offering_docs_url: %s", err) + return fmt.Errorf("[ERROR] Error setting offering_docs_url: %s", err) } if err = d.Set("offering_support_url", offering.OfferingSupportURL); err != nil { - return fmt.Errorf("Error setting offering_support_url: %s", err) + return fmt.Errorf("[ERROR] Error setting offering_support_url: %s", err) } if err = d.Set("short_description", offering.ShortDescription); err != nil { - return fmt.Errorf("Error setting short_description: %s", err) + return fmt.Errorf("[ERROR] Error setting short_description: %s", err) } if err = d.Set("long_description", offering.LongDescription); err != nil { - return fmt.Errorf("Error setting long_description: %s", err) + return fmt.Errorf("[ERROR] Error setting long_description: %s", err) } if err = d.Set("permit_request_ibm_public_publish", offering.PermitRequestIBMPublicPublish); err != nil { - return fmt.Errorf("Error setting permit_request_ibm_public_publish: %s", err) + return fmt.Errorf("[ERROR] Error setting permit_request_ibm_public_publish: %s", err) } if err = d.Set("ibm_publish_approved", offering.IBMPublishApproved); err != nil { - return fmt.Errorf("Error setting ibm_publish_approved: %s", err) + return fmt.Errorf("[ERROR] Error setting ibm_publish_approved: %s", err) } if err = d.Set("public_publish_approved", offering.PublicPublishApproved); err != nil { - return fmt.Errorf("Error setting public_publish_approved: %s", err) + return fmt.Errorf("[ERROR] Error setting public_publish_approved: %s", err) } if err = d.Set("public_original_crn", offering.PublicOriginalCRN); err != nil { - return fmt.Errorf("Error setting public_original_crn: %s", err) + return fmt.Errorf("[ERROR] Error setting public_original_crn: %s", err) } if err = d.Set("publish_public_crn", offering.PublishPublicCRN); err != nil { - return fmt.Errorf("Error setting publish_public_crn: %s", err) + return fmt.Errorf("[ERROR] Error setting publish_public_crn: %s", err) } if err = d.Set("portal_approval_record", offering.PortalApprovalRecord); err != nil { - return fmt.Errorf("Error setting portal_approval_record: %s", err) + return fmt.Errorf("[ERROR] Error setting portal_approval_record: %s", err) } if err = d.Set("portal_ui_url", offering.PortalUIURL); err != nil { - return fmt.Errorf("Error setting portal_ui_url: %s", err) + return fmt.Errorf("[ERROR] Error setting portal_ui_url: %s", err) } if err = d.Set("catalog_id", offering.CatalogID); err != nil { - return fmt.Errorf("Error setting catalog_id: %s", err) + return fmt.Errorf("[ERROR] Error setting catalog_id: %s", err) } if err = d.Set("catalog_name", offering.CatalogName); err != nil { - return fmt.Errorf("Error setting catalog_name: %s", err) + return fmt.Errorf("[ERROR] Error setting catalog_name: %s", err) } if err = d.Set("disclaimer", offering.Disclaimer); err != nil { - return fmt.Errorf("Error setting disclaimer: %s", err) + return fmt.Errorf("[ERROR] Error setting disclaimer: %s", err) } if err = d.Set("hidden", offering.Hidden); err != nil { - return fmt.Errorf("Error setting hidden: %s", err) + return fmt.Errorf("[ERROR] Error setting hidden: %s", err) } if offering.RepoInfo != nil { repoInfoMap := resourceIBMCmOfferingRepoInfoToMap(*offering.RepoInfo) if err = d.Set("repo_info", []map[string]interface{}{repoInfoMap}); err != nil { - return fmt.Errorf("Error setting repo_info: %s", err) + return fmt.Errorf("[ERROR] Error setting repo_info: %s", err) } } @@ -294,7 +296,7 @@ func resourceIBMCmOfferingRepoInfoToMap(repoInfo catalogmanagementv1.RepoInfo) m } func resourceIBMCmOfferingDelete(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_offering_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_offering_instance.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_offering_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_offering_instance.go index 735d79894b..d24b22c9de 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_offering_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_offering_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package catalogmanagement import ( "fmt" @@ -9,6 +9,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,7 +24,7 @@ const ( waitUntilInterval = 10 * time.Second ) -func resourceIBMCmOfferingInstance() *schema.Resource { +func ResourceIBMCmOfferingInstance() *schema.Resource { return &schema.Resource{ Create: resourceIBMCmOfferingInstanceCreate, Read: resourceIBMCmOfferingInstanceRead, @@ -38,78 +40,78 @@ func resourceIBMCmOfferingInstance() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "url reference to this object.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "platform CRN for this instance.", }, - "label": &schema.Schema{ + "label": { Type: schema.TypeString, Required: true, Description: "the label for this instance.", }, - "catalog_id": &schema.Schema{ + "catalog_id": { Type: schema.TypeString, Required: true, Description: "Catalog ID this instance was created from.", }, - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Required: true, Description: "Offering ID this instance was created from.", }, - "kind_format": &schema.Schema{ + "kind_format": { Type: schema.TypeString, Required: true, Description: "the format this instance has (helm, operator, ova...).", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeString, Required: true, Description: "The version this instance was installed from (not version id).", }, - "cluster_id": &schema.Schema{ + "cluster_id": { Type: schema.TypeString, Required: true, Description: "Cluster ID.", }, - "cluster_region": &schema.Schema{ + "cluster_region": { Type: schema.TypeString, Required: true, Description: "Cluster region (e.g., us-south).", }, - "cluster_namespaces": &schema.Schema{ + "cluster_namespaces": { Type: schema.TypeList, Required: true, Description: "List of target namespaces to install into.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "cluster_all_namespaces": &schema.Schema{ + "cluster_all_namespaces": { Type: schema.TypeBool, Required: true, Description: "designate to install into all namespaces.", }, - "schematics_workspace_id": &schema.Schema{ + "schematics_workspace_id": { Type: schema.TypeString, Computed: true, Description: "id of the schematics workspace, for offerings installed through schematics", }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Optional: true, Description: "id of the resource group", }, - "install_plan": &schema.Schema{ + "install_plan": { Type: schema.TypeString, Optional: true, Description: "install plan for the subscription of the operator- can be either automatic or manual. Required for operator bundles", }, - "channel": &schema.Schema{ + "channel": { Type: schema.TypeString, Optional: true, Description: "channel to target for the operator subscription. Required for operator bundles", @@ -117,7 +119,7 @@ func resourceIBMCmOfferingInstance() *schema.Resource { "wait_until_successful": { Type: schema.TypeBool, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Default: true, Description: "Whether to wait until the offering instance successfully provisions, or to return when accepted", }, @@ -126,12 +128,12 @@ func resourceIBMCmOfferingInstance() *schema.Resource { } func resourceIBMCmOfferingInstanceCreate(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } @@ -165,7 +167,7 @@ func resourceIBMCmOfferingInstanceCreate(d *schema.ResourceData, meta interface{ createOfferingInstanceOptions.SetClusterRegion(d.Get("cluster_region").(string)) } if ns, ok := d.GetOk("cluster_namespaces"); ok { - list := expandStringList(ns.([]interface{})) + list := flex.ExpandStringList(ns.([]interface{})) createOfferingInstanceOptions.SetClusterNamespaces(list) } if _, ok := d.GetOk("cluster_all_namespaces"); ok { @@ -202,7 +204,7 @@ func resourceIBMCmOfferingInstanceCreate(d *schema.ResourceData, meta interface{ } func waitUntilSuccess(d *schema.ResourceData, meta interface{}) (interface{}, error) { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return nil, err } @@ -216,7 +218,7 @@ func waitUntilSuccess(d *schema.ResourceData, meta interface{}) (interface{}, er Refresh: func() (interface{}, string, error) { offeringInstance, _, err := catalogManagementClient.GetOfferingInstance(getOfferingInstanceOptions) if err != nil { - return nil, "", fmt.Errorf("Error retrieving offering instance: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving offering instance: %s", err) } return offeringInstance, *offeringInstance.LastOperation.State, nil @@ -230,7 +232,7 @@ func waitUntilSuccess(d *schema.ResourceData, meta interface{}) (interface{}, er } func resourceIBMCmOfferingInstanceRead(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -250,55 +252,55 @@ func resourceIBMCmOfferingInstanceRead(d *schema.ResourceData, meta interface{}) } if err = d.Set("url", offeringInstance.URL); err != nil { - return fmt.Errorf("Error setting url: %s", err) + return fmt.Errorf("[ERROR] Error setting url: %s", err) } if err = d.Set("crn", offeringInstance.CRN); err != nil { - return fmt.Errorf("Error setting crn: %s", err) + return fmt.Errorf("[ERROR] Error setting crn: %s", err) } if err = d.Set("label", offeringInstance.Label); err != nil { - return fmt.Errorf("Error setting label: %s", err) + return fmt.Errorf("[ERROR] Error setting label: %s", err) } if err = d.Set("catalog_id", offeringInstance.CatalogID); err != nil { - return fmt.Errorf("Error setting catalog_id: %s", err) + return fmt.Errorf("[ERROR] Error setting catalog_id: %s", err) } if err = d.Set("offering_id", offeringInstance.OfferingID); err != nil { - return fmt.Errorf("Error setting offering_id: %s", err) + return fmt.Errorf("[ERROR] Error setting offering_id: %s", err) } if err = d.Set("kind_format", offeringInstance.KindFormat); err != nil { - return fmt.Errorf("Error setting kind_format: %s", err) + return fmt.Errorf("[ERROR] Error setting kind_format: %s", err) } if err = d.Set("version", offeringInstance.Version); err != nil { - return fmt.Errorf("Error setting version: %s", err) + return fmt.Errorf("[ERROR] Error setting version: %s", err) } if err = d.Set("cluster_id", offeringInstance.ClusterID); err != nil { - return fmt.Errorf("Error setting cluster_id: %s", err) + return fmt.Errorf("[ERROR] Error setting cluster_id: %s", err) } if err = d.Set("cluster_region", offeringInstance.ClusterRegion); err != nil { - return fmt.Errorf("Error setting cluster_region: %s", err) + return fmt.Errorf("[ERROR] Error setting cluster_region: %s", err) } if offeringInstance.ClusterNamespaces != nil { if err = d.Set("cluster_namespaces", offeringInstance.ClusterNamespaces); err != nil { - return fmt.Errorf("Error setting cluster_namespaces: %s", err) + return fmt.Errorf("[ERROR] Error setting cluster_namespaces: %s", err) } } if err = d.Set("cluster_all_namespaces", offeringInstance.ClusterAllNamespaces); err != nil { - return fmt.Errorf("Error setting cluster_all_namespaces: %s", err) + return fmt.Errorf("[ERROR] Error setting cluster_all_namespaces: %s", err) } if err = d.Set("schematics_workspace_id", offeringInstance.SchematicsWorkspaceID); err != nil { - return fmt.Errorf("Error setting schematics_workspace_id: %s", err) + return fmt.Errorf("[ERROR] Error setting schematics_workspace_id: %s", err) } if err = d.Set("install_plan", offeringInstance.InstallPlan); err != nil { - return fmt.Errorf("Error setting install_plan: %s", err) + return fmt.Errorf("[ERROR] Error setting install_plan: %s", err) } if err = d.Set("channel", offeringInstance.Channel); err != nil { - return fmt.Errorf("Error setting channel: %s", err) + return fmt.Errorf("[ERROR] Error setting channel: %s", err) } return nil } func resourceIBMCmOfferingInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -313,7 +315,7 @@ func resourceIBMCmOfferingInstanceUpdate(d *schema.ResourceData, meta interface{ return err } - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } @@ -351,7 +353,7 @@ func resourceIBMCmOfferingInstanceUpdate(d *schema.ResourceData, meta interface{ putOfferingInstanceOptions.SetClusterRegion(d.Get("cluster_region").(string)) } if ns, ok := d.GetOk("cluster_namespaces"); ok { - list := expandStringList(ns.([]interface{})) + list := flex.ExpandStringList(ns.([]interface{})) putOfferingInstanceOptions.SetClusterNamespaces(list) } if _, ok := d.GetOk("cluster_all_namespaces"); ok { @@ -377,11 +379,11 @@ func resourceIBMCmOfferingInstanceUpdate(d *schema.ResourceData, meta interface{ } func resourceIBMCmOfferingInstanceDelete(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } @@ -403,7 +405,7 @@ func resourceIBMCmOfferingInstanceDelete(d *schema.ResourceData, meta interface{ } func resourceIBMCmOfferingInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_version.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_version.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_version.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_version.go index 2a879e7040..e357b7daac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cm_version.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement/resource_ibm_cm_version.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package catalogmanagement import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" ) -func resourceIBMCmVersion() *schema.Resource { +func ResourceIBMCmVersion() *schema.Resource { return &schema.Resource{ Create: resourceIBMCmVersionCreate, Read: resourceIBMCmVersionRead, @@ -20,96 +22,96 @@ func resourceIBMCmVersion() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "catalog_identifier": &schema.Schema{ + "catalog_identifier": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Catalog identifier.", }, - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Offering identification.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, ForceNew: true, Description: "Tags array.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "target_kinds": &schema.Schema{ + "target_kinds": { Type: schema.TypeList, Optional: true, ForceNew: true, Description: "Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "content": &schema.Schema{ + "content": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "byte array representing the content to be imported. Only supported for OVA images at this time.", }, - "zipurl": &schema.Schema{ + "zipurl": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "URL path to zip location. If not specified, must provide content in the body of this call.", }, - "target_version": &schema.Schema{ + "target_version": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "The semver value for this new version, if not found in the zip url package content.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Version's CRN.", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeString, Computed: true, Description: "Version of content type.", }, - "sha": &schema.Schema{ + "sha": { Type: schema.TypeString, Computed: true, Description: "hash of the content.", }, - "created": &schema.Schema{ + "created": { Type: schema.TypeString, Computed: true, Description: "The date and time this version was created.", }, - "updated": &schema.Schema{ + "updated": { Type: schema.TypeString, Computed: true, Description: "The date and time this version was last updated.", }, - "catalog_id": &schema.Schema{ + "catalog_id": { Type: schema.TypeString, Computed: true, Description: "Catalog ID.", }, - "kind_id": &schema.Schema{ + "kind_id": { Type: schema.TypeString, Computed: true, Description: "Kind ID.", }, - "repo_url": &schema.Schema{ + "repo_url": { Type: schema.TypeString, Computed: true, Description: "Content's repo URL.", }, - "source_url": &schema.Schema{ + "source_url": { Type: schema.TypeString, Computed: true, Description: "Content's source URL (e.g git repo).", }, - "tgz_url": &schema.Schema{ + "tgz_url": { Type: schema.TypeString, Computed: true, Description: "File used to on-board this version.", @@ -119,7 +121,7 @@ func resourceIBMCmVersion() *schema.Resource { } func resourceIBMCmVersionCreate(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -130,7 +132,7 @@ func resourceIBMCmVersionCreate(d *schema.ResourceData, meta interface{}) error importOfferingVersionOptions.SetTags(d.Get("tags").([]string)) } if _, ok := d.GetOk("target_kinds"); ok { - list := expandStringList(d.Get("target_kinds").([]interface{})) + list := flex.ExpandStringList(d.Get("target_kinds").([]interface{})) importOfferingVersionOptions.SetTargetKinds(list) } @@ -159,7 +161,7 @@ func resourceIBMCmVersionCreate(d *schema.ResourceData, meta interface{}) error } func resourceIBMCmVersionRead(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } @@ -181,41 +183,41 @@ func resourceIBMCmVersionRead(d *schema.ResourceData, meta interface{}) error { } if err = d.Set("crn", version.CRN); err != nil { - return fmt.Errorf("Error setting crn: %s", err) + return fmt.Errorf("[ERROR] Error setting crn: %s", err) } if err = d.Set("version", version.Version); err != nil { - return fmt.Errorf("Error setting version: %s", err) + return fmt.Errorf("[ERROR] Error setting version: %s", err) } if err = d.Set("sha", version.Sha); err != nil { - return fmt.Errorf("Error setting sha: %s", err) + return fmt.Errorf("[ERROR] Error setting sha: %s", err) } if err = d.Set("created", version.Created.String()); err != nil { - return fmt.Errorf("Error setting created: %s", err) + return fmt.Errorf("[ERROR] Error setting created: %s", err) } if err = d.Set("updated", version.Updated.String()); err != nil { - return fmt.Errorf("Error setting updated: %s", err) + return fmt.Errorf("[ERROR] Error setting updated: %s", err) } if err = d.Set("catalog_id", version.CatalogID); err != nil { - return fmt.Errorf("Error setting catalog_id: %s", err) + return fmt.Errorf("[ERROR] Error setting catalog_id: %s", err) } if err = d.Set("kind_id", version.KindID); err != nil { - return fmt.Errorf("Error setting kind_id: %s", err) + return fmt.Errorf("[ERROR] Error setting kind_id: %s", err) } if err = d.Set("repo_url", version.RepoURL); err != nil { - return fmt.Errorf("Error setting repo_url: %s", err) + return fmt.Errorf("[ERROR] Error setting repo_url: %s", err) } if err = d.Set("source_url", version.SourceURL); err != nil { - return fmt.Errorf("Error setting source_url: %s", err) + return fmt.Errorf("[ERROR] Error setting source_url: %s", err) } if err = d.Set("tgz_url", version.TgzURL); err != nil { - return fmt.Errorf("Error setting tgz_url: %s", err) + return fmt.Errorf("[ERROR] Error setting tgz_url: %s", err) } return nil } func resourceIBMCmVersionDelete(d *schema.ResourceData, meta interface{}) error { - catalogManagementClient, err := meta.(ClientSession).CatalogManagementV1() + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/README.md new file mode 100644 index 0000000000..24312adf08 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Certificate Manager + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Certificate Manager resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/certificate_manager_import) +* IBM Docs: [IBM Docs for Certificate Manager](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-ordering-certificates) +* IBM Certificate Manager SDK: [IBM SDK for Certificate Manager](https://github.com/IBM-Cloud/bluemix-go/tree/master/api/certificatemanager) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_certificate_manager_certificate.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/data_source_ibm_certificate_manager_certificate.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_certificate_manager_certificate.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/data_source_ibm_certificate_manager_certificate.go index eec8208aac..ac43971b26 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_certificate_manager_certificate.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/data_source_ibm_certificate_manager_certificate.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package certificatemanager import ( "fmt" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataIBMCertificateManagerCertificate() *schema.Resource { +func DataIBMCertificateManagerCertificate() *schema.Resource { return &schema.Resource{ Read: dataIBMCertificateManagerCertificateRead, Schema: map[string]*schema.Schema{ @@ -92,7 +93,7 @@ func dataIBMCertificateManagerCertificate() *schema.Resource { } } func dataIBMCertificateManagerCertificateRead(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_certificate_manager_certificates.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/data_source_ibm_certificate_manager_certificates.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_certificate_manager_certificates.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/data_source_ibm_certificate_manager_certificates.go index 018e25bb04..3194992328 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_certificate_manager_certificates.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/data_source_ibm_certificate_manager_certificates.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package certificatemanager import ( "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataIBMCertificateManagerCertificates() *schema.Resource { +func DataIBMCertificateManagerCertificates() *schema.Resource { return &schema.Resource{ Read: dataIBMCertificateManagerCertificatesRead, Schema: map[string]*schema.Schema{ @@ -84,7 +85,7 @@ func dataIBMCertificateManagerCertificates() *schema.Resource { } } func dataIBMCertificateManagerCertificatesRead(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_certificate_manager_import.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/resource_ibm_certificate_manager_import.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_certificate_manager_import.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/resource_ibm_certificate_manager_import.go index 53ba836618..c1ff1e226e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_certificate_manager_import.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/resource_ibm_certificate_manager_import.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package certificatemanager import ( "fmt" @@ -11,9 +11,10 @@ import ( "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func resourceIBMCertificateManagerImport() *schema.Resource { +func ResourceIBMCertificateManagerImport() *schema.Resource { return &schema.Resource{ Create: resourceIBMCertificateManagerImportCertificate, Read: resourceIBMCertificateManagerGet, @@ -83,7 +84,7 @@ func resourceIBMCertificateManagerImport() *schema.Resource { func resourceIBMCertificateManagerImportCertificate(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } @@ -117,14 +118,14 @@ func resourceIBMCertificateManagerImportCertificate(d *schema.ResourceData, meta return resourceIBMCertificateManagerUpdate(d, meta) } func resourceIBMCertificateManagerGet(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } certID := d.Id() certificatedata, err := cmService.Certificate().GetCertData(certID) if err != nil { - return fmt.Errorf("Error getting certificate during import: %s", err) + return fmt.Errorf("[ERROR] Error getting certificate during import: %s", err) } cminstanceid := strings.Split(certID, ":certificate:") d.Set("certificate_manager_instance_id", cminstanceid[0]+"::") @@ -155,7 +156,7 @@ func resourceIBMCertificateManagerGet(d *schema.ResourceData, meta interface{}) } func resourceIBMCertificateManagerUpdate(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } @@ -194,14 +195,14 @@ func resourceIBMCertificateManagerUpdate(d *schema.ResourceData, meta interface{ return resourceIBMCertificateManagerGet(d, meta) } func resourceIBMCertificateManagerDelete(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } certID := d.Id() err = cmService.Certificate().DeleteCertificate(certID) if err != nil { - return fmt.Errorf("Error deleting Certificate: %s", err) + return fmt.Errorf("[ERROR] Error deleting Certificate: %s", err) } d.SetId("") @@ -209,7 +210,7 @@ func resourceIBMCertificateManagerDelete(d *schema.ResourceData, meta interface{ } func resourceIBMCertificateManagerExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_certificate_manager_order.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/resource_ibm_certificate_manager_order.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_certificate_manager_order.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/resource_ibm_certificate_manager_order.go index 72a3a550d8..86fbf8b575 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_certificate_manager_order.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager/resource_ibm_certificate_manager_order.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package certificatemanager import ( "fmt" @@ -14,9 +14,11 @@ import ( "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func resourceIBMCertificateManagerOrder() *schema.Resource { +func ResourceIBMCertificateManagerOrder() *schema.Resource { return &schema.Resource{ Create: resourceIBMCertificateManagerOrderCertificate, Read: resourceIBMCertificateManagerRead, @@ -85,7 +87,7 @@ func resourceIBMCertificateManagerOrder() *schema.Resource { Optional: true, Default: "rsaEncryption 2048 bit", Description: "Keyalgorithm info", - ValidateFunc: validateAllowedStringValue([]string{"rsaEncryption 2048 bit", "rsaEncryption 4096 bit"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"rsaEncryption 2048 bit", "rsaEncryption 4096 bit"}), }, "auto_renew_enabled": { Type: schema.TypeBool, @@ -132,7 +134,7 @@ func resourceIBMCertificateManagerOrder() *schema.Resource { func resourceIBMCertificateManagerOrderCertificate(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } @@ -169,14 +171,13 @@ func resourceIBMCertificateManagerOrderCertificate(d *schema.ResourceData, meta _, err = waitForCertificateOrder(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for Ordering Certificate (%s) to be succeeded: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for Ordering Certificate (%s) to be succeeded: %s", d.Id(), err) } return resourceIBMCertificateManagerRead(d, meta) } func resourceIBMCertificateManagerRead(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } @@ -224,7 +225,7 @@ func resourceIBMCertificateManagerRead(d *schema.ResourceData, meta interface{}) } func resourceIBMCertificateManagerRenew(d *schema.ResourceData, meta interface{}) error { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return err } @@ -261,13 +262,12 @@ func resourceIBMCertificateManagerRenew(d *schema.ResourceData, meta interface{} } _, err = waitForCertificateRenew(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for Renew Certificate (%s) to be succeeded: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for Renew Certificate (%s) to be succeeded: %s", d.Id(), err) } return resourceIBMCertificateManagerRead(d, meta) } func waitForCertificateOrder(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return false, err } @@ -280,12 +280,12 @@ func waitForCertificateOrder(d *schema.ResourceData, meta interface{}) (interfac getcert, err := cmService.Certificate().GetMetaData(certID) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The certificate %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The certificate %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } if getcert.Status == "failed" { - return getcert, getcert.Status, fmt.Errorf("The certificate %s failed: %v", d.Id(), err) + return getcert, getcert.Status, fmt.Errorf("[ERROR] The certificate %s failed: %v", d.Id(), err) } return getcert, getcert.Status, nil }, @@ -297,7 +297,7 @@ func waitForCertificateOrder(d *schema.ResourceData, meta interface{}) (interfac return stateConf.WaitForState() } func waitForCertificateRenew(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cmService, err := meta.(ClientSession).CertificateManagerAPI() + cmService, err := meta.(conns.ClientSession).CertificateManagerAPI() if err != nil { return false, err } @@ -310,12 +310,12 @@ func waitForCertificateRenew(d *schema.ResourceData, meta interface{}) (interfac getcert, err := cmService.Certificate().GetMetaData(certID) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The certificate %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The certificate %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } if getcert.Status == "failed" { - return getcert, getcert.Status, fmt.Errorf("The certificate %s failed: %v", d.Id(), err) + return getcert, getcert.Status, fmt.Errorf("[ERROR] The certificate %s failed: %v", d.Id(), err) } return getcert, getcert.Status, nil }, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/README.md new file mode 100644 index 0000000000..91c7dc5c6a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Cloud Internet Services + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the CIS resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cis) +* IBM API Docs: [IBM API Docs for CIS](https://cloud.ibm.com/apidocs/cis) +* IBM CIS SDK: [IBM SDK for CIS](https://github.com/IBM/networking-go-sdk/) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis.go new file mode 100644 index 0000000000..f96193afef --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis.go @@ -0,0 +1,195 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + "net/url" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" +) + +func DataSourceIBMCISInstance() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMCISInstanceRead, + + Schema: map[string]*schema.Schema{ + "name": { + Description: "Resource instance name for example, my cis instance", + Type: schema.TypeString, + Required: true, + }, + + "resource_group_id": { + Type: schema.TypeString, + Optional: true, + Description: "The id of the resource group in which the cis instance is present", + }, + + "guid": { + Type: schema.TypeString, + Computed: true, + Description: "Unique identifier of resource instance", + }, + + "location": { + Description: "The location or the environment in which cis instance exists", + Type: schema.TypeString, + Computed: true, + }, + + "service": { + Description: "The name of the Cloud Internet Services offering, 'internet-svcs'", + Type: schema.TypeString, + Computed: true, + }, + + "plan": { + Description: "The plan type of the cis instance", + Type: schema.TypeString, + Computed: true, + }, + + "status": { + Description: "The resource instance status", + Type: schema.TypeString, + Computed: true, + }, + flex.ResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + flex.ResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + flex.ResourceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the resource", + }, + + flex.ResourceGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "The resource group name in which resource is provisioned", + }, + flex.ResourceControllerURL: { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + }, + }, + } +} + +func dataSourceIBMCISInstanceRead(d *schema.ResourceData, meta interface{}) error { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerAPIV2() + if err != nil { + return err + } + rsAPI := rsConClient.ResourceServiceInstanceV2() + name := d.Get("name").(string) + + rsInstQuery := controllerv2.ServiceInstanceQuery{ + Name: name, + } + + if rsGrpID, ok := d.GetOk("resource_group_id"); ok { + rsInstQuery.ResourceGroupID = rsGrpID.(string) + } else { + defaultRg, err := flex.DefaultResourceGroup(meta) + if err != nil { + return err + } + rsInstQuery.ResourceGroupID = defaultRg + } + + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + if service, ok := d.GetOk("service"); ok { + + serviceOff, err := rsCatRepo.FindByName(service.(string), true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + rsInstQuery.ServiceID = serviceOff[0].ID + } + + var instances []models.ServiceInstanceV2 + + instances, err = rsAPI.ListInstances(rsInstQuery) + if err != nil { + return err + } + var filteredInstances []models.ServiceInstanceV2 + var location string + + if loc, ok := d.GetOk("location"); ok { + location = loc.(string) + for _, instance := range instances { + if flex.GetLocation(instance) == location { + filteredInstances = append(filteredInstances, instance) + } + } + } else { + filteredInstances = instances + } + + if len(filteredInstances) == 0 { + return fmt.Errorf("[ERROR] No resource instance found with name [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) + } + + var instance models.ServiceInstanceV2 + + if len(filteredInstances) > 1 { + return fmt.Errorf("[ERROR] More than one resource instance found with name matching [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) + } + instance = filteredInstances[0] + + d.SetId(instance.ID) + d.Set("status", instance.State) + d.Set("resource_group_id", instance.ResourceGroupID) + d.Set("location", instance.RegionID) + d.Set("guid", instance.Guid) + serviceOff, err := rsCatRepo.GetServiceName(instance.ServiceID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + d.Set("service", serviceOff) + + servicePlan, err := rsCatRepo.GetServicePlanName(instance.ResourcePlanID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + d.Set("plan", servicePlan) + + d.Set(flex.ResourceName, instance.Name) + d.Set(flex.ResourceCRN, instance.Crn.String()) + d.Set(flex.ResourceStatus, instance.State) + d.Set(flex.ResourceGroupName, instance.ResourceGroupName) + + rcontroller, err := flex.GetBaseController(meta) + if err != nil { + return err + } + d.Set(flex.ResourceControllerURL, rcontroller+"/internet-svcs/"+url.QueryEscape(instance.Crn.String())) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_alert_webhooks.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_alert_webhooks.go new file mode 100644 index 0000000000..8f3e856e3c --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_alert_webhooks.go @@ -0,0 +1,90 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const cisWebhookList = "cis_webhooks" + +func DataSourceIBMCISWebhooks() *schema.Resource { + return &schema.Resource{ + Read: dataIBMCISWebhookRead, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS instance crn", + Required: true, + }, + cisWebhookList: { + Type: schema.TypeList, + Description: "Collection of Webhook details", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + cisWebhookID: { + Type: schema.TypeString, + Computed: true, + Description: "Webhook ID", + }, + cisWebhookName: { + Type: schema.TypeString, + Computed: true, + Description: "Webhook Name", + }, + cisWebhookURL: { + Type: schema.TypeString, + Computed: true, + Description: "Webhook URL", + }, + cisWebhookType: { + Type: schema.TypeString, + Computed: true, + Description: "Webhook Type", + }, + }, + }, + }, + }, + } +} +func dataIBMCISWebhookRead(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisWebhookSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the cisWebhookession %s", err) + } + crn := d.Get(cisID).(string) + sess.Crn = core.StringPtr(crn) + opt := sess.NewListWebhooksOptions() + + result, resp, err := sess.ListWebhooks(opt) + if err != nil || result == nil { + return fmt.Errorf("[ERROR] Error Listing all Webhooks %q: %s %s", d.Id(), err, resp) + } + + webhooks := make([]map[string]interface{}, 0) + + for _, instance := range result.Result { + webhook := map[string]interface{}{} + webhook[cisWebhookID] = *instance.ID + webhook[cisWebhookName] = *instance.Name + webhook[cisWebhookURL] = *instance.URL + webhook[cisWebhookType] = *instance.Type + webhooks = append(webhooks, webhook) + } + d.SetId(dataSourcecisWebhookCheckID(d)) + d.Set(cisID, crn) + d.Set(cisWebhookList, webhooks) + return nil +} + +func dataSourcecisWebhookCheckID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_alerts.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_alerts.go new file mode 100644 index 0000000000..aa7cb5ebc6 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_alerts.go @@ -0,0 +1,169 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "encoding/json" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/networking-go-sdk/alertsv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + cisAlerts = "alert_policies" +) + +func DataSourceIBMCISAlert() *schema.Resource { + return &schema.Resource{ + Read: dataIBMCISAlertPolicyRead, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS instance crn", + Required: true, + }, + cisAlerts: { + Type: schema.TypeList, + Computed: true, + Description: "Container for response information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + cisAlertID: { + Type: schema.TypeString, + Computed: true, + Description: "Policy ID", + }, + cisAlertName: { + Type: schema.TypeString, + Computed: true, + Description: "Policy name", + }, + cisAlertDescription: { + Type: schema.TypeString, + Computed: true, + Description: "Policy Description", + }, + cisAlertEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Is the alert policy active", + }, + cisAlertType: { + Type: schema.TypeString, + Computed: true, + Description: "Condition for the alert", + }, + cisAlertMechanisms: { + Type: schema.TypeList, + Computed: true, + Description: "Delivery mechanisms for the alert, can include an email, a webhook, or both.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + cisAlertEmail: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Set: schema.HashString, + }, + cisAlertWebhook: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Set: schema.HashString, + }, + }, + }, + }, + cisAlertFilters: { + Type: schema.TypeString, + Computed: true, + Description: "Filters based on filter type", + }, + cisAlertConditions: { + Type: schema.TypeString, + Computed: true, + Description: "Conditions based on filter type", + }, + }, + }, + }, + }, + } +} +func dataIBMCISAlertPolicyRead(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisAlertsSession() + if err != nil { + return err + } + crn := d.Get(cisID).(string) + sess.Crn = core.StringPtr(crn) + + opt := sess.NewGetAlertPoliciesOptions() + result, resp, err := sess.GetAlertPolicies(opt) + if err != nil { + log.Printf("[WARN] List all alerts failed: %v\n", resp) + return err + } + alertList := make([]map[string]interface{}, 0) + for _, alertObj := range result.Result { + alertOutput := map[string]interface{}{} + alertOutput[cisAlertID] = *alertObj.ID + alertOutput[cisAlertName] = *alertObj.Name + alertOutput[cisAlertDescription] = *alertObj.Description + alertOutput[cisAlertEnabled] = *alertObj.Enabled + alertOutput[cisAlertType] = *alertObj.AlertType + filterOpt, err := json.Marshal(alertObj.Filters) + if err != nil { + return fmt.Errorf("[ERROR] Error marshalling the created filters: %s", err) + } + alertOutput[cisAlertFilters] = string(filterOpt) + conditionsOpt, err := json.Marshal(alertObj.Conditions) + if err != nil { + return fmt.Errorf("[ERROR] Error marshalling the created Conditions: %s", err) + } + alertOutput[cisAlertConditions] = string(conditionsOpt) + alertOutput[cisAlertMechanisms] = dataflattenCISMechanism(*alertObj.Mechanisms) + alertList = append(alertList, alertOutput) + + } + d.SetId(dataSourceCISAlertsCheckID(d)) + d.Set(cisID, crn) + + d.Set(cisAlerts, alertList) + return nil +} +func dataSourceCISAlertsCheckID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} +func dataflattenCISMechanism(Mechanism alertsv1.ListAlertPoliciesRespResultItemMechanisms) interface{} { + emailoutput := []string{} + webhookoutput := []string{} + + output := map[string]interface{}{} + flatten := []map[string]interface{}{} + + for _, mech := range Mechanism.Email { + emailoutput = append(emailoutput, *mech.ID) + } + + for _, mech := range Mechanism.Webhooks { + webhookoutput = append(webhookoutput, *mech.ID) + } + + output[cisAlertEmail] = emailoutput + output[cisAlertWebhook] = webhookoutput + + flatten = append(flatten, output) + + return flatten +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_cache_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_cache_settings.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_cache_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_cache_settings.go index 32f679509d..5c07ff3b8e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_cache_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_cache_settings.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMCISCacheSetting() *schema.Resource { +func DataSourceIBMCISCacheSetting() *schema.Resource { return &schema.Resource{ Read: dataSourceCISCacheSettingsRead, Schema: map[string]*schema.Schema{ @@ -175,13 +177,13 @@ func dataSourceIBMCISCacheSetting() *schema.Resource { } } func dataSourceCISCacheSettingsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisCacheClientSession() + cisClient, err := meta.(conns.ClientSession).CisCacheClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_certificates.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_certificates.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_certificates.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_certificates.go index f4e18eb93c..81f29f8bf9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_certificates.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_certificates.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -24,7 +26,7 @@ const ( cisCertificateTypeDedicated = "dedicated" ) -func dataIBMCISCertificates() *schema.Resource { +func DataSourceIBMCISCertificates() *schema.Resource { return &schema.Resource{ Read: dataIBMCISCertificatesRead, Schema: map[string]*schema.Schema{ @@ -108,12 +110,12 @@ func dataIBMCISCertificates() *schema.Resource { } } func dataIBMCISCertificatesRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewListCertificatesOptions() @@ -125,14 +127,14 @@ func dataIBMCISCertificatesRead(d *schema.ResourceData, meta interface{}) error certificatesList := make([]interface{}, 0) for _, instance := range result.Result { certificate := map[string]interface{}{} - certificate["id"] = convertCisToTfThreeVar(*instance.ID, zoneID, crn) + certificate["id"] = flex.ConvertCisToTfThreeVar(*instance.ID, zoneID, crn) certificate[cisCertificateOrderID] = *instance.ID certificate[cisCertificateOrderStatus] = *instance.Status if instance.PrimaryCertificate != nil { certificate[cisCertificatesPrimaryCertificate] = convertCISCertificatesObj(*instance.Type, instance.PrimaryCertificate) } - certificate[cisCertificateOrderHosts] = flattenStringList(instance.Hosts) + certificate[cisCertificateOrderHosts] = flex.FlattenStringList(instance.Hosts) certs := []interface{}{} for _, i := range instance.Certificates { @@ -141,7 +143,7 @@ func dataIBMCISCertificatesRead(d *schema.ResourceData, meta interface{}) error cert[cisCertificatesCertificatesID] = convertCISCertificatesObj(*instance.Type, i.ID) } cert[cisCertificatesCertificatesStatus] = *i.Status - cert[cisCertificatesCertificatesHosts] = flattenStringList(i.Hosts) + cert[cisCertificatesCertificatesHosts] = flex.FlattenStringList(i.Hosts) certs = append(certs, cert) } certificate[cisCertificatesType] = *instance.Type diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_custom_certificates.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_custom_certificates.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_custom_certificates.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_custom_certificates.go index 93e15fe132..1bced54487 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_custom_certificates.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_custom_certificates.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( cisCustomCertificates = "custom_certificates" ) -func dataSourceIBMCISCustomCertificates() *schema.Resource { +func DataSourceIBMCISCustomCertificates() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISCustomCertificatesRead, Schema: map[string]*schema.Schema{ @@ -97,26 +99,26 @@ func dataSourceIBMCISCustomCertificates() *schema.Resource { } func dataSourceIBMCISCustomCertificatesRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewListCustomCertificatesOptions() result, resp, err := cisClient.ListCustomCertificates(opt) if err != nil { - return fmt.Errorf("Failed to list custom certificates: %v", resp) + return fmt.Errorf("[ERROR] Failed to list custom certificates: %v", resp) } certsList := make([]map[string]interface{}, 0) for _, r := range result.Result { cert := map[string]interface{}{} - cert["id"] = convertCisToTfThreeVar(*r.ID, zoneID, crn) + cert["id"] = flex.ConvertCisToTfThreeVar(*r.ID, zoneID, crn) cert[cisCertificateUploadCustomCertID] = *r.ID cert[cisCertificateUploadBundleMethod] = *r.BundleMethod - cert[cisCertificateUploadHosts] = flattenStringList(r.Hosts) + cert[cisCertificateUploadHosts] = flex.FlattenStringList(r.Hosts) cert[cisCertificateUploadIssuer] = *r.Issuer cert[cisCertificateUploadSignature] = *r.Signature cert[cisCertificateUploadStatus] = *r.Status diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_custom_pages.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_custom_pages.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_custom_pages.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_custom_pages.go index 6e9cd18917..2d48060678 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_custom_pages.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_custom_pages.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( cisCustomPages = "cis_custom_pages" ) -func dataSourceIBMCISCustomPages() *schema.Resource { +func DataSourceIBMCISCustomPages() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISCustomPagesRead, Importer: &schema.ResourceImporter{}, @@ -88,7 +90,7 @@ func dataSourceIBMCISCustomPages() *schema.Resource { } func dataSourceIBMCISCustomPagesRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisCustomPageClientSession() + cisClient, err := meta.(conns.ClientSession).CisCustomPageClientSession() if err != nil { return err } @@ -105,12 +107,12 @@ func dataSourceIBMCISCustomPagesRead(d *schema.ResourceData, meta interface{}) e } customPagesOutput := make([]map[string]interface{}, 0) for _, instance := range result.Result { - customPage := make(map[string]interface{}, 0) + customPage := make(map[string]interface{}) customPage[cisCustomPageIdentifier] = *instance.ID customPage[cisCustomPageState] = *instance.State customPage[cisCustomPageDesc] = *instance.Description customPage[cisCustomPagePreviewTarget] = *instance.PreviewTarget - customPage[cisCustomPageRequiredTokens] = flattenStringList(instance.RequiredTokens) + customPage[cisCustomPageRequiredTokens] = flex.FlattenStringList(instance.RequiredTokens) if instance.CreatedOn != nil { customPage[cisCustomPageCreatedOn] = (*instance.CreatedOn).String() } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_dns_records.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_dns_records.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_dns_records.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_dns_records.go index c5aa7c8dcd..1499eb63b0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_dns_records.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_dns_records.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -19,7 +21,7 @@ const ( cisDNSRecordsExportFile = "file" ) -func dataSourceIBMCISDNSRecords() *schema.Resource { +func DataSourceIBMCISDNSRecords() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISDNSRecordsRead, Importer: &schema.ResourceImporter{}, @@ -129,19 +131,19 @@ func dataSourceIBMCISDNSRecordsRead(d *schema.ResourceData, meta interface{}) er zoneID string records []map[string]interface{} ) - sess, err := meta.(ClientSession).CisDNSRecordClientSession() + sess, err := meta.(conns.ClientSession).CisDNSRecordClientSession() if err != nil { return err } // session options crn = d.Get(cisID).(string) - zoneID, _, _ = convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ = flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) sess.Crn = core.StringPtr(crn) sess.ZoneIdentifier = core.StringPtr(zoneID) if file, ok := d.GetOk(cisDNSRecordsExportFile); ok { - sess, err := meta.(ClientSession).CisDNSRecordBulkClientSession() + sess, err := meta.(conns.ClientSession).CisDNSRecordBulkClientSession() if err != nil { return err } @@ -181,7 +183,7 @@ func dataSourceIBMCISDNSRecordsRead(d *schema.ResourceData, meta interface{}) er records = make([]map[string]interface{}, 0) for _, instance := range result.Result { record := map[string]interface{}{} - record["id"] = convertCisToTfThreeVar(*instance.ID, zoneID, crn) + record["id"] = flex.ConvertCisToTfThreeVar(*instance.ID, zoneID, crn) record[cisDNSRecordID] = *instance.ID record[cisZoneName] = *instance.ZoneName record[cisDNSRecordCreatedOn] = *instance.CreatedOn diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_domain.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_domain.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_domain.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_domain.go index 8dd536e66a..07484e051b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_domain.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_domain.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMCISDomain() *schema.Resource { +func DataSourceIBMCISDomain() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISDomainRead, @@ -54,7 +56,7 @@ func dataSourceIBMCISDomain() *schema.Resource { func dataSourceIBMCISDomainRead(d *schema.ResourceData, meta interface{}) error { var zoneFound bool - cisClient, err := meta.(ClientSession).CisZonesV1ClientSession() + cisClient, err := meta.(conns.ClientSession).CisZonesV1ClientSession() if err != nil { return err } @@ -74,7 +76,7 @@ func dataSourceIBMCISDomainRead(d *schema.ResourceData, meta interface{}) error for _, zone := range zones.Result { if *zone.Name == zoneName { - d.SetId(convertCisToTfTwoVar(*zone.ID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(*zone.ID, crn)) d.Set(cisID, crn) d.Set(cisDomain, *zone.Name) d.Set(cisDomainStatus, *zone.Status) @@ -86,8 +88,8 @@ func dataSourceIBMCISDomainRead(d *schema.ResourceData, meta interface{}) error } } - if zoneFound == false { - return fmt.Errorf("Given zone does not exist. Please specify correct domain") + if !zoneFound { + return fmt.Errorf("[ERROR] Given zone does not exist. Please specify correct domain") } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_edge_functions_actions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_edge_functions_actions.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_edge_functions_actions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_edge_functions_actions.go index c65ec6909c..641732633c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_edge_functions_actions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_edge_functions_actions.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -24,7 +26,7 @@ const ( cisEdgeFunctionsActionModifiedOn = "modified_on" ) -func dataSourceIBMCISEdgeFunctionsActions() *schema.Resource { +func DataSourceIBMCISEdgeFunctionsActions() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISEdgeFunctionsActionsRead, Schema: map[string]*schema.Schema{ @@ -103,19 +105,19 @@ func dataSourceIBMCISEdgeFunctionsActions() *schema.Resource { } func dataSourceIBMCISEdgeFunctionsActionsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewListEdgeFunctionsActionsOptions() result, _, err := cisClient.ListEdgeFunctionsActions(opt) if err != nil { - return fmt.Errorf("Error: %v", err) + return fmt.Errorf("[ERROR] Error: %v", err) } scriptInfo := make([]map[string]interface{}, 0) for _, script := range result.Result { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_edge_functions_triggers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_edge_functions_triggers.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_edge_functions_triggers.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_edge_functions_triggers.go index 41745b3814..2da8d2a91f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_edge_functions_triggers.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_edge_functions_triggers.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const cisEdgeFunctionsTriggers = "cis_edge_functions_triggers" -func dataSourceIBMCISEdgeFunctionsTriggers() *schema.Resource { +func DataSourceIBMCISEdgeFunctionsTriggers() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISEdgeFunctionsTriggerRead, Schema: map[string]*schema.Schema{ @@ -67,24 +69,24 @@ func dataSourceIBMCISEdgeFunctionsTriggers() *schema.Resource { } func dataSourceIBMCISEdgeFunctionsTriggerRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisEdgeFunctionClientSession() + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewListEdgeFunctionsTriggersOptions() result, _, err := cisClient.ListEdgeFunctionsTriggers(opt) if err != nil { - return fmt.Errorf("Error listing edge functions triggers: %v", err) + return fmt.Errorf("[ERROR] Error listing edge functions triggers: %v", err) } triggerInfo := make([]map[string]interface{}, 0) for _, trigger := range result.Result { l := map[string]interface{}{} - l["id"] = convertCisToTfThreeVar(*trigger.ID, zoneID, crn) + l["id"] = flex.ConvertCisToTfThreeVar(*trigger.ID, zoneID, crn) l[cisEdgeFunctionsTriggerID] = *trigger.ID l[cisEdgeFunctionsTriggerPattern] = *trigger.Pattern l[cisEdgeFunctionsTriggerRequestLimitFailOpen] = *trigger.RequestLimitFailOpen diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_filters.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_filters.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_filters.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_filters.go index b88aa18786..4fc568b578 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_filters.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_filters.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const cisFiltersList = "cis_filters_list" -func dataSourceIBMCISFilters() *schema.Resource { +func DataSourceIBMCISFilters() *schema.Resource { return &schema.Resource{ Read: dataIBMCISFiltersRead, Schema: map[string]*schema.Schema{ @@ -61,22 +63,22 @@ func dataSourceIBMCISFilters() *schema.Resource { } func dataIBMCISFiltersRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { - return fmt.Errorf("Error while Getting IAM Access Token using BluemixSession %s", err) + return fmt.Errorf("[ERROR] Error while Getting IAM Access Token using BluemixSession %s", err) } xAuthtoken := sess.Config.IAMAccessToken - cisClient, err := meta.(ClientSession).CisFiltersSession() + cisClient, err := meta.(conns.ClientSession).CisFiltersSession() if err != nil { - return fmt.Errorf("Error while getting the CisFiltersSession %s", err) + return fmt.Errorf("[ERROR] Error while getting the CisFiltersSession %s", err) } crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) result, resp, err := cisClient.ListAllFilters(cisClient.NewListAllFiltersOptions(xAuthtoken, crn, zoneID)) if err != nil || result == nil { - return fmt.Errorf("Error Listing all filters %q: %s %s", d.Id(), err, resp) + return fmt.Errorf("[ERROR] Error Listing all filters %q: %s %s", d.Id(), err, resp) } filtersList := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_firewall.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_firewall.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_firewall.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_firewall.go index 6f41b9d39d..d911f8b16f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_firewall.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_firewall.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataIBMCISFirewallsRecord() *schema.Resource { +func DataSourceIBMCISFirewallsRecord() *schema.Resource { return &schema.Resource{ Read: dataIBMCISFirewallRecordRead, Schema: map[string]*schema.Schema{ @@ -178,11 +180,11 @@ func dataIBMCISFirewallsRecord() *schema.Resource { } func dataIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) error { crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) firewallType := d.Get(cisFirewallType).(string) if firewallType == cisFirewallTypeLockdowns { - cisClient, err := meta.(ClientSession).CisLockdownClientSession() + cisClient, err := meta.(conns.ClientSession).CisLockdownClientSession() if err != nil { return err } @@ -198,7 +200,7 @@ func dataIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) erro for _, instance := range result.Result { configurationList := []interface{}{} for _, c := range instance.Configurations { - configuration := make(map[string]interface{}, 0) + configuration := make(map[string]interface{}) configuration[cisFirewallLockdownConfigurationsTarget] = c.Target configuration[cisFirewallLockdownConfigurationsValue] = c.Value configurationList = append(configurationList, configuration) @@ -218,7 +220,7 @@ func dataIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) erro } d.Set(cisFirewallLockdown, lockdownList) } else if firewallType == cisFirewallTypeAccessRules { - cisClient, err := meta.(ClientSession).CisAccessRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisAccessRuleClientSession() if err != nil { return err } @@ -237,7 +239,7 @@ func dataIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) erro configuration[cisFirewallAccessRuleConfigurationTarget] = *instance.Configuration.Target configuration[cisFirewallAccessRuleConfigurationValue] = *instance.Configuration.Value configurations = append(configurations, configuration) - accessRule := make(map[string]interface{}, 0) + accessRule := make(map[string]interface{}) accessRule[cisFirewallAccessRuleID] = *instance.ID accessRule[cisFirewallAccessRuleMode] = *instance.Mode accessRule[cisFirewallAccessRuleNotes] = *instance.Notes @@ -246,7 +248,7 @@ func dataIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) erro } d.Set(cisFirewallAccessRule, accessRuleList) } else if firewallType == cisFirewallTypeUARules { - cisClient, err := meta.(ClientSession).CisUARuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisUARuleClientSession() if err != nil { return err } @@ -265,7 +267,7 @@ func dataIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) erro configuration[cisFirewallUARuleConfigurationTarget] = *instance.Configuration.Target configuration[cisFirewallUARuleConfigurationValue] = *instance.Configuration.Value configurations = append(configurations, configuration) - uaRule := make(map[string]interface{}, 0) + uaRule := make(map[string]interface{}) uaRule[cisFirewallUARuleID] = *instance.ID uaRule[cisFirewallUARuleMode] = *instance.Mode uaRule[cisFirewallUARulePaused] = *instance.Paused diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_firewall_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_firewall_rule.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_firewall_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_firewall_rule.go index 648c63151c..1a33673337 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_firewall_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_firewall_rule.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "context" "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMCISFirewallRules() *schema.Resource { +func DataSourceIBMCISFirewallRules() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMCISFirewallRulesRead, @@ -66,22 +68,22 @@ func dataSourceIBMCISFirewallRules() *schema.Resource { } func dataSourceIBMCISFirewallRulesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } xAuthtoken := sess.Config.IAMAccessToken - cisClient, err := meta.(ClientSession).CisFirewallRulesSession() + cisClient, err := meta.(conns.ClientSession).CisFirewallRulesSession() if err != nil { return diag.FromErr(err) } crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) result, resp, err := cisClient.ListAllFirewallRules(cisClient.NewListAllFirewallRulesOptions(xAuthtoken, crn, zoneID)) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error listing the firewall rules %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error listing the firewall rules %s:%s", err, resp)) } fwrList := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_global_load_balancers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_global_load_balancers.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_global_load_balancers.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_global_load_balancers.go index 94bd5d523c..c1b479e7ef 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_global_load_balancers.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_global_load_balancers.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const cisGLB = "cis_glb" -func dataSourceIBMCISGlbs() *schema.Resource { +func DataSourceIBMCISGlbs() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -154,13 +156,13 @@ func dataSourceIBMCISGlbs() *schema.Resource { } func dataSourceCISGlbsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -176,12 +178,12 @@ func dataSourceCISGlbsRead(d *schema.ResourceData, meta interface{}) error { glbList := make([]map[string]interface{}, 0) for _, glbObj := range glbs { glbOutput := map[string]interface{}{} - glbOutput["id"] = convertCisToTfThreeVar(*glbObj.ID, zoneID, crn) + glbOutput["id"] = flex.ConvertCisToTfThreeVar(*glbObj.ID, zoneID, crn) glbOutput[cisGLBID] = *glbObj.ID glbOutput[cisGLBName] = *glbObj.Name - glbOutput[cisGLBDefaultPoolIDs] = convertCisToTfTwoVarSlice(glbObj.DefaultPools, crn) + glbOutput[cisGLBDefaultPoolIDs] = flex.ConvertCisToTfTwoVarSlice(glbObj.DefaultPools, crn) glbOutput[cisGLBDesc] = *glbObj.Description - glbOutput[cisGLBFallbackPoolID] = convertCisToTfTwoVar(*glbObj.FallbackPool, crn) + glbOutput[cisGLBFallbackPoolID] = flex.ConvertCisToTfTwoVar(*glbObj.FallbackPool, crn) glbOutput[cisGLBTTL] = *glbObj.TTL glbOutput[cisGLBSteeringPolicy] = *glbObj.SteeringPolicy glbOutput[cisGLBProxied] = *glbObj.Proxied @@ -212,7 +214,7 @@ func dataSourceCISGlbsCheckID(d *schema.ResourceData) string { func flattenDataSourcePopPools(pools interface{}, geoType string, cisID string) []interface{} { result := make([]interface{}, 0) for k, v := range pools.(map[string]interface{}) { - poolIds := convertCisToTfTwoVarSlice(expandStringList(v.([]interface{})), cisID) + poolIds := flex.ConvertCisToTfTwoVarSlice(flex.ExpandStringList(v.([]interface{})), cisID) pool := map[string]interface{}{ cisGLBPopPoolsPop: k, cisGLBPopPoolsPoolIDs: poolIds, @@ -225,7 +227,7 @@ func flattenDataSourcePopPools(pools interface{}, geoType string, cisID string) func flattenDataSourceRegionPools(pools interface{}, geoType string, cisID string) []interface{} { result := make([]interface{}, 0) for k, v := range pools.(map[string]interface{}) { - poolIds := convertCisToTfTwoVarSlice(expandStringList(v.([]interface{})), cisID) + poolIds := flex.ConvertCisToTfTwoVarSlice(flex.ExpandStringList(v.([]interface{})), cisID) pool := map[string]interface{}{ cisGLBRegionPoolsRegion: k, cisGLBRegionPoolsPoolIDs: poolIds, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_healthchecks.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_healthchecks.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_healthchecks.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_healthchecks.go index 1f34c212ad..db6cab1806 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_healthchecks.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_healthchecks.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( cisGLBHealthCheck = "cis_healthchecks" ) -func dataSourceIBMCISHealthChecks() *schema.Resource { +func DataSourceIBMCISHealthChecks() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISGLBHealthCheckRead, Importer: &schema.ResourceImporter{}, @@ -145,7 +147,7 @@ func dataSourceIBMCISHealthChecks() *schema.Resource { } func dataSourceIBMCISGLBHealthCheckRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisGLBHealthCheckClientSession() + sess, err := meta.(conns.ClientSession).CisGLBHealthCheckClientSession() if err != nil { return err } @@ -164,7 +166,7 @@ func dataSourceIBMCISGLBHealthCheckRead(d *schema.ResourceData, meta interface{} monitors := make([]map[string]interface{}, 0) for _, instance := range result.Result { monitor := map[string]interface{}{} - monitor["id"] = convertCisToTfTwoVar(*instance.ID, crn) + monitor["id"] = flex.ConvertCisToTfTwoVar(*instance.ID, crn) monitor[cisID] = crn monitor[cisGLBHealthCheckID] = *instance.ID monitor[cisGLBHealthCheckDesc] = *instance.Description diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_ip_addresses.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_ip_addresses.go new file mode 100644 index 0000000000..cd684a673f --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_ip_addresses.go @@ -0,0 +1,59 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + cisIPv4CIDRs = "ipv4_cidrs" + cisIPv6CIDRs = "ipv6_cidrs" +) + +func DataSourceIBMCISIP() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMCISIPRead, + + Schema: map[string]*schema.Schema{ + cisIPv4CIDRs: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + cisIPv6CIDRs: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +func dataSourceIBMCISIPRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisIPClientSession() + if err != nil { + return err + } + opt := cisClient.NewListIpsOptions() + result, response, err := cisClient.ListIps(opt) + if err != nil { + log.Printf("Failed to list IP addresses: %v", response) + return err + } + + d.Set(cisIPv4CIDRs, flex.FlattenStringList(result.Result.Ipv4Cidrs)) + d.Set(cisIPv6CIDRs, flex.FlattenStringList(result.Result.Ipv4Cidrs)) + d.SetId(dataSourceIBMCISIPID(d)) + return nil +} + +func dataSourceIBMCISIPID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_origin_pools.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_origin_pools.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_origin_pools.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_origin_pools.go index 9ca417e3f2..e8cc5dbb17 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_origin_pools.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_origin_pools.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( cisOriginPools = "cis_origin_pools" ) -func dataSourceIBMCISOriginPools() *schema.Resource { +func DataSourceIBMCISOriginPools() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISGLBPoolsRead, Importer: &schema.ResourceImporter{}, @@ -143,7 +145,7 @@ func dataSourceIBMCISOriginPools() *schema.Resource { } func dataSourceIBMCISGLBPoolsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBPoolClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBPoolClientSession() if err != nil { return err } @@ -161,7 +163,7 @@ func dataSourceIBMCISGLBPoolsRead(d *schema.ResourceData, meta interface{}) erro pools := make([]map[string]interface{}, 0) for _, instance := range result.Result { pool := map[string]interface{}{} - pool["id"] = convertCisToTfTwoVar(*instance.ID, crn) + pool["id"] = flex.ConvertCisToTfTwoVar(*instance.ID, crn) pool[cisGLBPoolID] = *instance.ID pool[cisGLBPoolName] = *instance.Name pool[cisGLBPoolOrigins] = flattenOrigins(instance.Origins) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_page_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_page_rules.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_page_rules.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_page_rules.go index ff1c6cdba2..e785e4be0f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_page_rules.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_page_rules.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( cisPageRules = "cis_page_rules" ) -func dataSourceIBMCISPageRules() *schema.Resource { +func DataSourceIBMCISPageRules() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISPageRulesRead, Importer: &schema.ResourceImporter{}, @@ -145,13 +147,13 @@ func dataSourceIBMCISPageRules() *schema.Resource { } func dataSourceIBMCISPageRulesRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisPageRuleClientSession() + sess, err := meta.(conns.ClientSession).CisPageRuleClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) sess.Crn = core.StringPtr(crn) sess.ZoneID = core.StringPtr(zoneID) @@ -166,7 +168,7 @@ func dataSourceIBMCISPageRulesRead(d *schema.ResourceData, meta interface{}) err pageRules := make([]map[string]interface{}, 0) for _, instance := range result.Result { pageRule := map[string]interface{}{} - pageRule["id"] = convertCisToTfThreeVar(*instance.ID, zoneID, crn) + pageRule["id"] = flex.ConvertCisToTfThreeVar(*instance.ID, zoneID, crn) pageRule[cisPageRuleID] = *instance.ID pageRule[cisPageRulePriority] = *instance.Priority pageRule[cisPageRuleStatus] = *instance.Status diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_range_apps.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_range_apps.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_range_apps.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_range_apps.go index 0f3a77fb20..ff5912c894 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_range_apps.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_range_apps.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const cisRangeApps = "range_apps" -func dataSourceIBMCISRangeApps() *schema.Resource { +func DataSourceIBMCISRangeApps() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISRangeAppsRead, Schema: map[string]*schema.Schema{ @@ -123,28 +125,28 @@ func dataSourceIBMCISRangeApps() *schema.Resource { } func dataSourceIBMCISRangeAppsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRangeAppClientSession() + cisClient, err := meta.(conns.ClientSession).CisRangeAppClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewListRangeAppsOptions() result, resp, err := cisClient.ListRangeApps(opt) if err != nil { - return fmt.Errorf("Failed to list range applications: %v", resp) + return fmt.Errorf("[ERROR] Failed to list range applications: %v", resp) } apps := make([]map[string]interface{}, 0) for _, i := range result.Result { app := map[string]interface{}{} - app["id"] = convertCisToTfThreeVar(*i.ID, zoneID, crn) + app["id"] = flex.ConvertCisToTfThreeVar(*i.ID, zoneID, crn) app[cisRangeAppID] = *i.ID app[cisRangeAppProtocol] = *i.Protocol app[cisRangeAppDNS] = *i.Dns.Name app[cisRangeAppDNSType] = *i.Dns.Type - app[cisRangeAppOriginDirect] = flattenStringList(i.OriginDirect) + app[cisRangeAppOriginDirect] = flex.FlattenStringList(i.OriginDirect) app[cisRangeAppIPFirewall] = *i.IpFirewall app[cisRangeAppProxyProtocol] = *i.ProxyProtocol app[cisRangeAppEdgeIPsType] = *i.EdgeIps.Type diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_rate_limit.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_rate_limit.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_rate_limit.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_rate_limit.go index 4bac09aa48..78fc9f077b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_rate_limit.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_rate_limit.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMCISRateLimit() *schema.Resource { +func DataSourceIBMCISRateLimit() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISRateLimitRead, Schema: map[string]*schema.Schema{ @@ -183,18 +185,18 @@ func dataSourceIBMCISRateLimit() *schema.Resource { } func dataSourceIBMCISRateLimitRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRLClientSession() + cisClient, err := meta.(conns.ClientSession).CisRLClientSession() if err != nil { return err } cisID := d.Get("cis_id").(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get("domain_id").(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get("domain_id").(string)) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewListAllZoneRateLimitsOptions() rateLimitRecord, resp, err := cisClient.ListAllZoneRateLimits(opt) if err != nil { - return fmt.Errorf("Failed to read RateLimit: %v", resp) + return fmt.Errorf("[ERROR] Failed to read RateLimit: %v", resp) } rules := make([]map[string]interface{}, 0) for _, r := range rateLimitRecord.Result { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_groups.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_groups.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_groups.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_groups.go index 4aec958b01..ffda55e80a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_groups.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const cisWAFGroups = "waf_groups" -func dataSourceIBMCISWAFGroups() *schema.Resource { +func DataSourceIBMCISWAFGroups() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISWAFGroupsRead, Schema: map[string]*schema.Schema{ @@ -81,16 +83,16 @@ func dataSourceIBMCISWAFGroups() *schema.Resource { } func dataSourceIBMCISWAFGroupsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFGroupClientSession() + cisClient, err := meta.(conns.ClientSession).CisWAFGroupClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) - packageID, _, _, _ := convertTfToCisThreeVar(d.Get(cisWAFGroupPackageID).(string)) + packageID, _, _, _ := flex.ConvertTfToCisThreeVar(d.Get(cisWAFGroupPackageID).(string)) opt := cisClient.NewListWafRuleGroupsOptions(packageID) opt.SetPage(1) @@ -103,7 +105,7 @@ func dataSourceIBMCISWAFGroupsRead(d *schema.ResourceData, meta interface{}) err wafGroups := []interface{}{} for _, i := range result.Result { waf := map[string]interface{}{} - waf["id"] = convertCisToTfFourVar(*i.ID, packageID, zoneID, crn) + waf["id"] = flex.ConvertCisToTfFourVar(*i.ID, packageID, zoneID, crn) waf[cisWAFGroupID] = *i.ID waf[cisWAFGroupName] = *i.Name waf[cisWAFGroupDesc] = *i.Description diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_packages.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_packages.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_packages.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_packages.go index 943e18da94..cafbb81083 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_packages.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_packages.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( cisWAFPackages = "waf_packages" ) -func dataSourceIBMCISWAFPackages() *schema.Resource { +func DataSourceIBMCISWAFPackages() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISWAFPackagesRead, Schema: map[string]*schema.Schema{ @@ -69,13 +71,13 @@ func dataSourceIBMCISWAFPackages() *schema.Resource { } func dataSourceIBMCISWAFPackagesRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFPackageClientSession() + cisClient, err := meta.(conns.ClientSession).CisWAFPackageClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) @@ -88,8 +90,8 @@ func dataSourceIBMCISWAFPackagesRead(d *schema.ResourceData, meta interface{}) e packages := make([]interface{}, 0) for _, instance := range result.Result { - packageDetail := make(map[string]interface{}, 0) - packageDetail["id"] = convertCisToTfThreeVar(*instance.ID, zoneID, crn) + packageDetail := make(map[string]interface{}) + packageDetail["id"] = flex.ConvertCisToTfThreeVar(*instance.ID, zoneID, crn) packageDetail[cisWAFPackageID] = *instance.ID packageDetail[cisWAFPackageName] = *instance.Name packageDetail[cisWAFPackageDetectionMode] = *instance.DetectionMode diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_rules.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_rules.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_rules.go index 7ff3f1d229..10739863d7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cis_waf_rules.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/data_source_ibm_cis_waf_rules.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const cisWAFRules = "waf_rules" -func dataSourceIBMCISWAFRules() *schema.Resource { +func DataSourceIBMCISWAFRules() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCISWAFRuleRead, Schema: map[string]*schema.Schema{ @@ -105,16 +107,16 @@ func dataSourceIBMCISWAFRules() *schema.Resource { } func dataSourceIBMCISWAFRuleRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisWAFRuleClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) - packageID, _, _, _ := convertTfToCisThreeVar(d.Get(cisWAFRulePackageID).(string)) + packageID, _, _, _ := flex.ConvertTfToCisThreeVar(d.Get(cisWAFRulePackageID).(string)) opt := cisClient.NewListWafRulesOptions(packageID) opt.SetPage(1) @@ -134,14 +136,14 @@ func dataSourceIBMCISWAFRuleRead(d *schema.ResourceData, meta interface{}) error groups = append(groups, group) rule := map[string]interface{}{} - rule["id"] = convertCisToTfFourVar(*i.ID, *i.PackageID, zoneID, crn) + rule["id"] = flex.ConvertCisToTfFourVar(*i.ID, *i.PackageID, zoneID, crn) rule[cisWAFRuleID] = *i.ID rule[cisWAFRulePackageID] = *i.PackageID rule[cisWAFRuleMode] = *i.Mode rule[cisWAFRuleDesc] = *i.Description rule[cisWAFRulePriority] = *i.Priority rule[cisWAFRuleGroup] = groups - rule[cisWAFRuleAllowedModes] = flattenStringList(i.AllowedModes) + rule[cisWAFRuleAllowedModes] = flex.FlattenStringList(i.AllowedModes) rules = append(rules, rule) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis.go new file mode 100644 index 0000000000..6ee1f87f01 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis.go @@ -0,0 +1,566 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + "log" + "net/url" + "os" + "strings" + "time" + + rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" +) + +const ( + CisInstanceSuccessStatus = "active" + CisInstanceProgressStatus = "in progress" + cisInstanceProvisioningStatus = "provisioning" + CisInstanceInactiveStatus = "inactive" + CisInstanceFailStatus = "failed" + CisInstanceRemovedStatus = "removed" + cisInstanceReclamation = "pending_reclamation" +) + +func ResourceIBMCISInstance() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISInstanceCreate, + Read: ResourceIBMCISInstanceRead, + Update: ResourceIBMCISInstanceUpdate, + Delete: ResourceIBMCISInstanceDelete, + Exists: ResourceIBMCISInstanceExists, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "A name for the resource instance", + }, + + "service": { + Type: schema.TypeString, + Computed: true, + Description: "The name of the Cloud Internet Services offering", + }, + + "plan": { + Type: schema.TypeString, + Required: true, + Description: "The plan type of the service", + }, + + "guid": { + Type: schema.TypeString, + Computed: true, + Description: "Unique identifier of resource instance", + }, + + "location": { + Description: "The location where the instance available", + Required: true, + ForceNew: true, + Type: schema.TypeString, + }, + + "resource_group_id": { + Description: "The resource group id", + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Computed: true, + }, + + "parameters": { + Type: schema.TypeMap, + Optional: true, + ForceNew: true, + Description: "Arbitrary parameters to pass. Must be a JSON object", + }, + + "tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_cis", "tag")}, + Set: schema.HashString, + }, + + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Status of resource instance", + }, + flex.ResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + flex.ResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + flex.ResourceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the resource", + }, + + flex.ResourceGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "The resource group name in which resource is provisioned", + }, + flex.ResourceControllerURL: { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + }, + }, + } +} + +func ResourceIBMCISValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "tag", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^[A-Za-z0-9:_ .-]+$`, + MinValueLength: 1, + MaxValueLength: 128}) + + ibmCISResourceValidator := validate.ResourceValidator{ResourceName: "ibm_cis", Schema: validateSchema} + return &ibmCISResourceValidator +} + +// Replace with func wrapper for resourceIBMResourceInstanceCreate specifying serviceName := "internet-svcs" +func ResourceIBMCISInstanceCreate(d *schema.ResourceData, meta interface{}) error { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + serviceName := "internet-svcs" + plan := d.Get("plan").(string) + name := d.Get("name").(string) + location := d.Get("location").(string) + + rsInst := rc.CreateResourceInstanceOptions{ + Name: &name, + } + + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + serviceOff, err := rsCatRepo.FindByName(serviceName, true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + rsInst.ResourcePlanID = &servicePlan + + deployments, err := rsCatRepo.ListDeployments(servicePlan) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving deployment for plan %s : %s", plan, err) + } + if len(deployments) == 0 { + return fmt.Errorf("[ERROR] No deployment found for service plan : %s", plan) + } + deployments, supportedLocations := filterCISDeployments(deployments, location) + + if len(deployments) == 0 { + locationList := make([]string, 0, len(supportedLocations)) + for l := range supportedLocations { + locationList = append(locationList, l) + } + return fmt.Errorf("[ERROR] No deployment found for service plan %s at location %s.\nValid location(s) are: %q", plan, location, locationList) + } + + rsInst.Target = &deployments[0].CatalogCRN + + if rsGrpID, ok := d.GetOk("resource_group_id"); ok { + rg := rsGrpID.(string) + rsInst.ResourceGroup = &rg + } else { + defaultRg, err := flex.DefaultResourceGroup(meta) + if err != nil { + return err + } + rsInst.ResourceGroup = &defaultRg + } + + if parameters, ok := d.GetOk("parameters"); ok { + rsInst.Parameters = parameters.(map[string]interface{}) + } + + instance, response, err := rsConClient.CreateResourceInstance(&rsInst) + if err != nil { + return fmt.Errorf("[ERROR] Error creating resource instance: %s %s", err, response) + } + v := os.Getenv("IC_ENV_TAGS") + if _, ok := d.GetOk("tags"); ok || v != "" { + oldList, newList := d.GetChange("tags") + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + if err != nil { + log.Printf( + "Error on create of ibm cis (%s) tags: %s", d.Id(), err) + } + } + + // Moved d.SetId(instance.ID) to after waiting for resource to finish creation. Otherwise Terraform initates depedent tasks too early. + // Original flow had SetId here as its required as input to waitForCISInstanceCreate + + _, err = waitForCISInstanceCreate(d, meta, *instance.ID) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for create resource instance (%s) to be succeeded: %s", d.Id(), err) + } + + d.SetId(*instance.ID) + + return ResourceIBMCISInstanceRead(d, meta) +} + +func ResourceIBMCISInstanceRead(d *schema.ResourceData, meta interface{}) error { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + + instanceID := d.Id() + rsInst := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + instance, response, err := rsConClient.GetResourceInstance(&rsInst) + if err != nil { + if strings.Contains(err.Error(), "Object not found") || + strings.Contains(err.Error(), "status code: 404") { + log.Printf("[WARN] Removing record from state because it's not found via the API") + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error retrieving resource instance: %s %s", err, response) + } + if strings.Contains(*instance.State, "removed") { + log.Printf("[WARN] Removing instance from TF state because it's now in removed state") + d.SetId("") + return nil + } + tags, err := flex.GetTagsUsingCRN(meta, *instance.CRN) + if err != nil { + log.Printf( + "Error on get of ibm cis tags (%s) tags: %s", d.Id(), err) + } + d.Set("tags", tags) + d.Set("name", *instance.Name) + d.Set("status", *instance.State) + d.Set("resource_group_id", *instance.ResourceGroupID) + d.Set("parameters", flex.Flatten(instance.Parameters)) + if instance.CRN != nil { + location := strings.Split(*instance.CRN, ":") + if len(location) > 5 { + d.Set("location", location[5]) + } + } + d.Set("guid", *instance.GUID) + + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + d.Set("service", "internet-svcs") + + servicePlan, err := rsCatRepo.GetServicePlanName(*instance.ResourcePlanID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + d.Set("plan", servicePlan) + + d.Set(flex.ResourceName, *instance.Name) + d.Set(flex.ResourceCRN, *instance.CRN) + d.Set(flex.ResourceStatus, *instance.State) + d.Set(flex.ResourceGroupName, *instance.ResourceGroupCRN) + + rcontroller, err := flex.GetBaseController(meta) + if err != nil { + return err + } + d.Set(flex.ResourceControllerURL, rcontroller+"/internet-svcs/"+url.QueryEscape(*instance.CRN)) + + return nil +} + +func ResourceIBMCISInstanceUpdate(d *schema.ResourceData, meta interface{}) error { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + + instanceID := d.Id() + + updateReq := rc.UpdateResourceInstanceOptions{ + ID: &instanceID, + } + if d.HasChange("name") { + name := d.Get("name").(string) + updateReq.Name = &name + } + + if d.HasChange("plan") { + plan := d.Get("plan").(string) + service := d.Get("service").(string) + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + serviceOff, err := rsCatRepo.FindByName(service, true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + + updateReq.ResourcePlanID = &servicePlan + + } + + if d.HasChange("tags") { + oldList, newList := d.GetChange("tags") + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, instanceID) + if err != nil { + log.Printf( + "Error on update of CIS (%s) tags: %s", d.Id(), err) + } + } + + _, response, err := rsConClient.UpdateResourceInstance(&updateReq) + if err != nil { + return fmt.Errorf("[ERROR] Error updating resource instance: %s %s", err, response) + } + + _, err = waitForCISInstanceUpdate(d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for update resource instance (%s) to be succeeded: %s", d.Id(), err) + } + + return ResourceIBMCISInstanceRead(d, meta) +} + +func ResourceIBMCISInstanceDelete(d *schema.ResourceData, meta interface{}) error { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + id := d.Id() + recursive := true + deleteReq := rc.DeleteResourceInstanceOptions{ + ID: &id, + Recursive: &recursive, + } + response, err := rsConClient.DeleteResourceInstance(&deleteReq) + if err != nil { + // If prior delete occurs, instance is not immediately deleted, but remains in "removed" state" + // RC 410 with "Gone" returned as error + if strings.Contains(err.Error(), "Gone") || + strings.Contains(err.Error(), "status code: 410") { + log.Printf("[WARN] Resource instance already deleted %s\n %s", err, response) + err = nil + } else { + return fmt.Errorf("[ERROR] Error deleting resource instance: %s %s", err, response) + } + } + + _, err = waitForCISInstanceDelete(d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for resource instance (%s) to be deleted: %s", d.Id(), err) + } + + d.SetId("") + + return nil +} +func ResourceIBMCISInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + rsInst := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + instance, response, err := rsConClient.GetResourceInstance(&rsInst) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok { + if apiErr.StatusCode() == 404 { + return false, nil + } + } + return false, fmt.Errorf("[ERROR] Error getting cis instance: %s %s", err, response) + } + if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, cisInstanceReclamation)) { + log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") + d.SetId("") + return false, nil + } + + return *instance.ID == instanceID, nil +} + +func waitForCISInstanceCreate(d *schema.ResourceData, meta interface{}, instanceID string) (interface{}, error) { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + //instanceID := d.Id() + + stateConf := &resource.StateChangeConf{ + Pending: []string{CisInstanceProgressStatus, CisInstanceInactiveStatus, cisInstanceProvisioningStatus}, + Target: []string{CisInstanceSuccessStatus}, + Refresh: func() (interface{}, string, error) { + rsInst := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + instance, response, err := rsConClient.GetResourceInstance(&rsInst) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { + return nil, "", fmt.Errorf("[ERROR] The resource instance %s does not exist anymore: %v %s", d.Id(), err, response) + } + return nil, "", err + } + if *instance.State == CisInstanceFailStatus { + return instance, *instance.State, fmt.Errorf("[ERROR] The resource instance %s failed: %v %s", d.Id(), err, response) + } + return instance, *instance.State, nil + }, + Timeout: d.Timeout(schema.TimeoutCreate), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func waitForCISInstanceUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error) { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + + stateConf := &resource.StateChangeConf{ + Pending: []string{CisInstanceProgressStatus, CisInstanceInactiveStatus}, + Target: []string{CisInstanceSuccessStatus}, + Refresh: func() (interface{}, string, error) { + rsInst := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + instance, response, err := rsConClient.GetResourceInstance(&rsInst) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { + return nil, "", fmt.Errorf("[ERROR] The resource instance %s does not exist anymore: %v %s", d.Id(), err, response) + } + return nil, "", err + } + if *instance.State == CisInstanceFailStatus { + return instance, *instance.State, fmt.Errorf("[ERROR] The resource instance %s failed: %v %s", d.Id(), err, response) + } + return instance, *instance.State, nil + }, + Timeout: d.Timeout(schema.TimeoutUpdate), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func waitForCISInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { + + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + stateConf := &resource.StateChangeConf{ + Pending: []string{CisInstanceProgressStatus, CisInstanceInactiveStatus, CisInstanceSuccessStatus}, + Target: []string{CisInstanceRemovedStatus, cisInstanceReclamation}, + Refresh: func() (interface{}, string, error) { + rsInst := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + instance, response, err := rsConClient.GetResourceInstance(&rsInst) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { + return instance, CisInstanceSuccessStatus, nil + } + return nil, "", err + } + if *instance.State == CisInstanceFailStatus { + return instance, *instance.State, fmt.Errorf("[ERROR] The resource instance %s failed to delete: %v %s", d.Id(), err, response) + } + return instance, *instance.State, nil + }, + Timeout: d.Timeout(schema.TimeoutDelete), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func filterCISDeployments(deployments []models.ServiceDeployment, location string) ([]models.ServiceDeployment, map[string]bool) { + supportedDeployments := []models.ServiceDeployment{} + supportedLocations := make(map[string]bool) + for _, d := range deployments { + if d.Metadata.RCCompatible { + deploymentLocation := d.Metadata.Deployment.Location + supportedLocations[deploymentLocation] = true + if deploymentLocation == location { + supportedDeployments = append(supportedDeployments, d) + } + } + } + return supportedDeployments, supportedLocations +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_alert.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_alert.go new file mode 100644 index 0000000000..9e1027c846 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_alert.go @@ -0,0 +1,401 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "encoding/json" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/networking-go-sdk/alertsv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISAlert = "ibm_cis_alert" + cisAlertID = "policy_id" + cisAlertName = "name" + cisAlertDescription = "description" + cisAlertEnabled = "enabled" + cisAlertType = "alert_type" + cisAlertMechanisms = "mechanisms" + cisAlertEmail = "email" + cisAlertEmailID = "email_id" + cisAlertWebhook = "webhooks" + cisAlertConditions = "conditions" + cisAlertFilters = "filters" + cisAlertFilterEnabled = "enabled" + cisAlertFilterPoolID = "pool_id" + cisAlertType1 = "dos_attack_l7" + cisAlertType2 = "g6_pool_toggle_alert" + cisAlertType3 = "clickhouse_alert_fw_anomaly" + cisAlertType4 = "clickhouse_alert_fw_ent_anomaly" +) + +func ResourceIBMCISAlert() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISAlertPolicyCreate, + Read: ResourceIBMCISAlertPolicyRead, + Update: ResourceIBMCISAlertPolicyUpdate, + Delete: ResourceIBMCISAlertPolicyDelete, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS instance crn", + Required: true, + }, + cisAlertID: { + Type: schema.TypeString, + Computed: true, + Description: "Identifier of the Alert Policy", + }, + cisAlertName: { + Type: schema.TypeString, + Required: true, + Description: "Policy name", + }, + cisAlertDescription: { + Type: schema.TypeString, + Optional: true, + Description: "Policy Description", + }, + cisAlertEnabled: { + Type: schema.TypeBool, + Required: true, + Description: "Is the alert policy active", + }, + cisAlertType: { + Type: schema.TypeString, + Required: true, + Description: "Condition for the alert", + }, + cisAlertMechanisms: { + Type: schema.TypeList, + Required: true, + Description: "Delivery mechanisms for the alert, can include an email, a webhook, or both.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + cisAlertEmail: { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Set: schema.HashString, + }, + cisAlertWebhook: { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Set: schema.HashString, + }, + }, + }, + }, + cisAlertFilters: { + Type: schema.TypeString, + Optional: true, + StateFunc: func(v interface{}) string { + json, err := flex.NormalizeJSONString(v) + if err != nil { + return fmt.Sprintf("%q", err.Error()) + } + return json + }, + Description: "Filters based on filter type", + }, + cisAlertConditions: { + Type: schema.TypeString, + Optional: true, + StateFunc: func(v interface{}) string { + json, err := flex.NormalizeJSONString(v) + if err != nil { + return fmt.Sprintf("%q", err.Error()) + } + return json + }, + Description: "Conditions based on filter type", + }, + }, + } +} + +func ResourceIBMCISAlertPolicyCreate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisAlertsSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisAlertsSession %s", err) + } + crn := d.Get(cisID).(string) + sess.Crn = core.StringPtr(crn) + + opt := sess.NewCreateAlertPolicyOptions() + + if name, ok := d.GetOk(cisAlertName); ok { + opt.SetName(name.(string)) + } + if description, ok := d.GetOk(cisAlertDescription); ok { + opt.SetDescription(description.(string)) + } + if enabled, ok := d.GetOk(cisAlertEnabled); ok { + opt.SetEnabled(enabled.(bool)) + } + if alertType, ok := d.GetOk(cisAlertType); ok { + opt.SetAlertType(alertType.(string)) + } + if retFilter, ok := d.GetOk(cisAlertFilters); ok { + var filter interface{} + json.Unmarshal([]byte(retFilter.(string)), &filter) + opt.Filters = filter + } + mechanismsOpt := &alertsv1.CreateAlertPolicyInputMechanisms{} + if mechanisms, ok := d.GetOk(cisAlertMechanisms); ok { + mechanism := mechanisms.([]interface{})[0].(map[string]interface{}) + webhook, ok := mechanism[cisAlertWebhook] + if ok { + webhookString := webhook.(*schema.Set) + if webhookString.Len() != 0 { + var webhookarray = make([]alertsv1.CreateAlertPolicyInputMechanismsWebhooksItem, webhookString.Len()) + for k, w := range webhookString.List() { + wString := w.(string) + webhookarray[k] = alertsv1.CreateAlertPolicyInputMechanismsWebhooksItem{ + ID: &wString, + } + } + mechanismsOpt.Webhooks = webhookarray + } + } + email, ok := mechanism[cisAlertEmail] + if ok { + emailString := email.(*schema.Set) + if emailString.Len() != 0 { + var emailarray = make([]alertsv1.CreateAlertPolicyInputMechanismsEmailItem, emailString.Len()) + for k, w := range emailString.List() { + wString := w.(string) + emailarray[k] = alertsv1.CreateAlertPolicyInputMechanismsEmailItem{ + ID: &wString, + } + } + mechanismsOpt.Email = emailarray + } + } + } + opt.Mechanisms = mechanismsOpt + result, resp, err := sess.CreateAlertPolicy(opt) + if err != nil || result == nil { + return fmt.Errorf("[ERROR] Error creating Alert Policy %s %s", err, resp) + } + d.SetId(flex.ConvertCisToTfTwoVar(*result.Result.ID, crn)) + d.Set(cisAlertID, *result.Result.ID) + + return ResourceIBMCISAlertPolicyRead(d, meta) +} + +func ResourceIBMCISAlertPolicyRead(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisAlertsSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisAlertsSession %s", err) + } + + alertID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) + if err != nil { + return fmt.Errorf("[ERROR] Error while ConvertTftoCisTwoVar %s", err) + } + sess.Crn = core.StringPtr(crn) + opt := sess.NewGetAlertPolicyOptions(alertID) + result, resp, err := sess.GetAlertPolicy(opt) + if err != nil { + if resp != nil && resp.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting alert policy detail %s, %s", err, resp) + } + + d.Set(cisID, crn) + d.Set(cisAlertID, *result.Result.ID) + d.Set(cisGLBPoolName, *result.Result.Name) + d.Set(cisAlertDescription, *result.Result.Description) + d.Set(cisAlertEnabled, *result.Result.Enabled) + d.Set(cisAlertType, *result.Result.AlertType) + d.Set(cisGLBPoolEnabled, *result.Result.Enabled) + if err := d.Set(cisAlertMechanisms, flattenCISMechanism(*result.Result.Mechanisms)); err != nil { + log.Printf("[WARN] Error setting mechanism for alert policies %q: %s", d.Id(), err) + } + + filterOpt, err := json.Marshal(result.Result.Filters) + if err != nil { + return fmt.Errorf("[ERROR] Error marshalling the created filters: %s", err) + } + if err = d.Set(cisAlertFilters, string(filterOpt)); err != nil { + return fmt.Errorf("[ERROR] Error setting the filters: %s", err) + } + conditionsOpt, err := json.Marshal(result.Result.Conditions) + if err != nil { + return fmt.Errorf("[ERROR] Error marshalling the created Conditions: %s", err) + } + if err = d.Set(cisAlertConditions, string(conditionsOpt)); err != nil { + return fmt.Errorf("[ERROR] Error setting the Conditions: %s", err) + } + return nil +} + +func ResourceIBMCISAlertPolicyUpdate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisAlertsSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisAlertsSession %s", err) + } + + alertID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) + + if err != nil { + return fmt.Errorf("[ERROR] Error while ConvertTftoCisTwoVar %s", err) + } + sess.Crn = core.StringPtr(crn) + + if d.HasChange(cisAlertName) || + d.HasChange(cisAlertEnabled) || + d.HasChange(cisAlertDescription) || + d.HasChange(cisAlertType) || + d.HasChange(cisAlertFilters) || + d.HasChange(cisAlertConditions) || + d.HasChange(cisAlertMechanisms) { + + opt := sess.NewUpdateAlertPolicyOptions(alertID) + if name, ok := d.GetOk(cisAlertName); ok { + opt.SetName(name.(string)) + } + if description, ok := d.GetOk(cisAlertDescription); ok { + opt.SetDescription(description.(string)) + } + if enabled, ok := d.GetOk(cisAlertEnabled); ok { + opt.SetEnabled(enabled.(bool)) + } + if alertType, ok := d.GetOk(cisAlertType); ok { + opt.SetAlertType(alertType.(string)) + + } + if retConditions, ok := d.GetOk(cisAlertConditions); ok { + var condition interface{} + json.Unmarshal([]byte(retConditions.(string)), &condition) + opt.Conditions = condition + } + + if retFilter, ok := d.GetOk(cisAlertFilters); ok { + var filter interface{} + json.Unmarshal([]byte(retFilter.(string)), &filter) + opt.Filters = filter + } + + mechanismsOpt := &alertsv1.UpdateAlertPolicyInputMechanisms{} + if mechanisms, ok := d.GetOk(cisAlertMechanisms); ok { + mechanism := mechanisms.([]interface{})[0].(map[string]interface{}) + webhook, ok := mechanism[cisAlertWebhook] + if ok { + webhookString := webhook.(*schema.Set) + if webhookString.Len() != 0 { + var webhookarray = make([]alertsv1.UpdateAlertPolicyInputMechanismsWebhooksItem, webhookString.Len()) + for k, w := range webhookString.List() { + wString := w.(string) + webhookarray[k] = alertsv1.UpdateAlertPolicyInputMechanismsWebhooksItem{ + ID: &wString, + } + } + mechanismsOpt.Webhooks = webhookarray + } + } + email, ok := mechanism[cisAlertEmail] + if ok { + emailString := email.(*schema.Set) + if emailString.Len() != 0 { + var emailarray = make([]alertsv1.UpdateAlertPolicyInputMechanismsEmailItem, emailString.Len()) + for k, w := range emailString.List() { + wString := w.(string) + emailarray[k] = alertsv1.UpdateAlertPolicyInputMechanismsEmailItem{ + ID: &wString, + } + } + mechanismsOpt.Email = emailarray + } + } + } + opt.Mechanisms = mechanismsOpt + + result, resp, err := sess.UpdateAlertPolicy(opt) + if err != nil || result == nil { + return fmt.Errorf("[ERROR] Error while Update Alert Policy %s %s", err, resp) + } + } + + return nil +} +func ResourceIBMCISAlertPolicyDelete(d *schema.ResourceData, meta interface{}) error { + + sess, err := meta.(conns.ClientSession).CisAlertsSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisAlertsSession %s", err) + } + alertID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) + if err != nil { + return err + } + sess.Crn = core.StringPtr(crn) + opt := sess.NewDeleteAlertPolicyOptions(alertID) + _, response, err := sess.DeleteAlertPolicy(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error deleting the alert %s:%s", err, response) + } + return nil +} +func getAlertMechanisms(s *schema.Set) interface{} { + var alertMechanisms []interface{} + for _, m := range s.List() { + switch m.(type) { + case alertsv1.CreateAlertPolicyInputMechanismsEmailItem: + email := m.(alertsv1.CreateAlertPolicyInputMechanismsEmailItem) + data := alertsv1.CreateAlertPolicyInputMechanismsEmailItem{ + ID: email.ID, + } + alertMechanisms = append(alertMechanisms, data) + case alertsv1.CreateAlertPolicyInputMechanismsWebhooksItem: + webhook := m.(alertsv1.CreateAlertPolicyInputMechanismsWebhooksItem) + data := alertsv1.CreateAlertPolicyInputMechanismsWebhooksItem{ + ID: webhook.ID, + } + alertMechanisms = append(alertMechanisms, data) + } + } + return alertMechanisms +} + +func flattenCISMechanism(Mechanism alertsv1.GetAlertPolicyRespResultMechanisms) interface{} { + emailoutput := []string{} + webhookoutput := []string{} + + output := map[string]interface{}{} + flatten := []map[string]interface{}{} + + for _, mech := range Mechanism.Email { + emailoutput = append(emailoutput, *mech.ID) + } + + for _, mech := range Mechanism.Webhooks { + webhookoutput = append(webhookoutput, *mech.ID) + } + + output[cisAlertEmail] = emailoutput + output[cisAlertWebhook] = webhookoutput + + flatten = append(flatten, output) + + return flatten +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_alert_webhook.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_alert_webhook.go new file mode 100644 index 0000000000..07769f527a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_alert_webhook.go @@ -0,0 +1,174 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + cisWebhookID = "webhook_id" + cisWebhookName = "name" + cisWebhookURL = "url" + cisWebhookType = "type" + cisWebhookSecret = "secret" +) + +func ResourceIBMCISWebhooks() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISWebhookCreate, + Read: ResourceIBMCISWebhookRead, + Update: ResourceIBMCISWebhookUpdate, + Delete: ResourceIBMCISWebhookDelete, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS instance crn", + Required: true, + }, + cisWebhookID: { + Type: schema.TypeString, + Computed: true, + Description: "Webhook ID", + }, + cisWebhookName: { + Type: schema.TypeString, + Required: true, + Description: "Webhook Name", + }, + cisWebhookURL: { + Type: schema.TypeString, + Optional: true, + Description: "Webhook URL", + }, + cisWebhookType: { + Type: schema.TypeString, + Computed: true, + Description: "Webhook Type", + }, + cisWebhookSecret: { + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Description: "API key needed to use the webhook", + }, + }, + } +} +func ResourceIBMCISWebhookCreate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisWebhookSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the cisWebhookSession %s", err) + } + + crn := d.Get(cisID).(string) + sess.Crn = core.StringPtr(crn) + + opt := sess.NewCreateAlertWebhookOptions() + + if name, ok := d.GetOk(cisWebhookName); ok { + opt.SetName(name.(string)) + } + if url, ok := d.GetOk(cisWebhookURL); ok { + opt.SetURL(url.(string)) + } + if secret, ok := d.GetOk(cisWebhookSecret); ok { + opt.SetSecret((secret.(string))) + } + result, resp, err := sess.CreateAlertWebhook(opt) + if err != nil || result == nil { + return fmt.Errorf("[ERROR] Error creating Webhooks %s %s", err, resp) + } + d.SetId(flex.ConvertCisToTfTwoVar(*result.Result.ID, crn)) + return ResourceIBMCISWebhookRead(d, meta) + +} +func ResourceIBMCISWebhookRead(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisWebhookSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the cisWebhookSession %s", err) + } + webhooksID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) + if err != nil { + return err + } + sess.Crn = core.StringPtr(crn) + opt := sess.NewGetWebhookOptions(webhooksID) + + result, response, err := sess.GetWebhook(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting webhook detail %s, %s", err, response) + } + d.Set(cisID, crn) + d.Set(cisWebhookID, result.Result.ID) + d.Set(cisWebhookName, result.Result.Name) + d.Set(cisWebhookURL, result.Result.URL) + d.Set(cisWebhookType, result.Result.Type) + return nil +} +func ResourceIBMCISWebhookUpdate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisWebhookSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while updating the webhook %s", err) + } + webhooksID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) + if err != nil { + return err + } + sess.Crn = core.StringPtr(crn) + opt := sess.NewUpdateAlertWebhookOptions(webhooksID) + if d.HasChange(cisWebhookName) || + d.HasChange(cisWebhookURL) || + d.HasChange(cisWebhookSecret) { + + if name, ok := d.GetOk(cisWebhookName); ok { + opt.SetName(name.(string)) + } + if url, ok := d.GetOk(cisWebhookURL); ok { + opt.SetURL(url.(string)) + } + if secret, ok := d.GetOk(cisWebhookSecret); ok { + opt.SetSecret((secret.(string))) + } + + result, _, err := sess.UpdateAlertWebhook(opt) + if err != nil || result == nil { + return fmt.Errorf("[ERROR] Error updating the Webhook %s", err) + } + } + return ResourceIBMCISWebhookRead(d, meta) +} +func ResourceIBMCISWebhookDelete(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisWebhookSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while Deleting the webhook %s", err) + } + webhooksID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the webhook ID %s", err) + } + sess.Crn = core.StringPtr(crn) + + opt := sess.NewDeleteWebhookOptions(webhooksID) + + _, response, err := sess.DeleteWebhook(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error deleting the Webhook %s:%s", err, response) + } + return nil + +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_cache_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_cache_settings.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_cache_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_cache_settings.go index 37f995d397..d80ef0a3b9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_cache_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_cache_settings.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -24,7 +27,7 @@ const ( cisCacheServeStaleContent = "serve_stale_content" ) -func resourceIBMCISCacheSettings() *schema.Resource { +func ResourceIBMCISCacheSettings() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -43,7 +46,7 @@ func resourceIBMCISCacheSettings() *schema.Resource { Description: "Cache level setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator(ibmCISCacheSettings, + ValidateFunc: validate.InvokeValidator(ibmCISCacheSettings, cisCacheSettingsCachingLevel), }, cisCacheServeStaleContent: { @@ -51,7 +54,7 @@ func resourceIBMCISCacheSettings() *schema.Resource { Description: "Serve Stale Content ", Default: "on", Optional: true, - ValidateFunc: InvokeValidator(ibmCISCacheSettings, + ValidateFunc: validate.InvokeValidator(ibmCISCacheSettings, cisCacheServeStaleContent), }, cisCacheSettingsBrowserExpiration: { @@ -59,7 +62,7 @@ func resourceIBMCISCacheSettings() *schema.Resource { Description: "Browser Expiration setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator(ibmCISCacheSettings, + ValidateFunc: validate.InvokeValidator(ibmCISCacheSettings, cisCacheSettingsBrowserExpiration), }, cisCacheSettingsDevelopmentMode: { @@ -67,7 +70,7 @@ func resourceIBMCISCacheSettings() *schema.Resource { Description: "Development mode setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator(ibmCISCacheSettings, + ValidateFunc: validate.InvokeValidator(ibmCISCacheSettings, cisCacheSettingsOnOffValidatorID), }, cisCacheSettingsQueryStringSort: { @@ -75,7 +78,7 @@ func resourceIBMCISCacheSettings() *schema.Resource { Description: "Query String sort setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator(ibmCISCacheSettings, + ValidateFunc: validate.InvokeValidator(ibmCISCacheSettings, cisCacheSettingsOnOffValidatorID), }, cisCachePurgeAll: { @@ -133,52 +136,52 @@ func resourceIBMCISCacheSettings() *schema.Resource { } } -func resourceIBMCISCacheSettingsValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMCISCacheSettingsValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) browserCacheTTL := "0, 30, 60, 300, 1200, 1800, 3600, 7200, 10800, 14400," + "18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000," + "691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisCacheSettingsOnOffValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "on, off"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisCacheSettingsBrowserExpiration, - ValidateFunctionIdentifier: ValidateAllowedIntValue, - Type: TypeInt, + ValidateFunctionIdentifier: validate.ValidateAllowedIntValue, + Type: validate.TypeInt, Optional: true, AllowedValues: browserCacheTTL}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisCacheServeStaleContent, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "on, off"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisCacheSettingsCachingLevel, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "basic, simplified, aggressive"}) - ibmCISCacheSettingsResourceValidator := ResourceValidator{ + ibmCISCacheSettingsResourceValidator := validate.ResourceValidator{ ResourceName: ibmCISCacheSettings, Schema: validateSchema} return &ibmCISCacheSettingsResourceValidator } func resourceCISCacheSettingsUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisCacheClientSession() + cisClient, err := meta.(conns.ClientSession).CisCacheClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) @@ -257,7 +260,7 @@ func resourceCISCacheSettingsUpdate(d *schema.ResourceData, meta interface{}) er } } if value, ok := d.GetOk(cisCachePurgeByURLs); ok { - urls := expandStringList(value.([]interface{})) + urls := flex.ExpandStringList(value.([]interface{})) opt := cisClient.NewPurgeByUrlsOptions() opt.SetFiles(urls) _, response, err := cisClient.PurgeByUrls(opt) @@ -267,7 +270,7 @@ func resourceCISCacheSettingsUpdate(d *schema.ResourceData, meta interface{}) er } } if value, ok := d.GetOk(cisCachePurgeByCacheTags); ok { - cacheTags := expandStringList(value.([]interface{})) + cacheTags := flex.ExpandStringList(value.([]interface{})) opt := cisClient.NewPurgeByCacheTagsOptions() opt.SetTags(cacheTags) result, response, err := cisClient.PurgeByCacheTags(opt) @@ -279,7 +282,7 @@ func resourceCISCacheSettingsUpdate(d *schema.ResourceData, meta interface{}) er } if value, ok := d.GetOk(cisCachePurgeByHosts); ok { - hosts := expandStringList(value.([]interface{})) + hosts := flex.ExpandStringList(value.([]interface{})) opt := cisClient.NewPurgeByHostsOptions() opt.SetHosts(hosts) result, response, err := cisClient.PurgeByHosts(opt) @@ -290,16 +293,16 @@ func resourceCISCacheSettingsUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("Purge by hosts successful : %s", *result.Result.ID) } } - d.SetId(convertCisToTfTwoVar(zoneID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(zoneID, crn)) return resourceCISCacheSettingsRead(d, meta) } func resourceCISCacheSettingsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisCacheClientSession() + cisClient, err := meta.(conns.ClientSession).CisCacheClientSession() if err != nil { return err } - zoneID, crn, _ := convertTftoCisTwoVar(d.Id()) + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_certificate_order.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_certificate_order.go new file mode 100644 index 0000000000..fb5d1b2bef --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_certificate_order.go @@ -0,0 +1,230 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISCertificateOrder = "ibm_cis_certificate_order" + cisCertificateOrderID = "certificate_id" + cisCertificateOrderHosts = "hosts" + cisCertificateOrderType = "type" + cisCertificateOrderTypeDedicated = "dedicated" + cisCertificateOrderStatus = "status" + cisCertificateOrderDeleted = "deleted" + cisCertificateOrderDeletePending = "deleting" +) + +func ResourceIBMCISCertificateOrder() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISCertificateOrderCreate, + Update: ResourceIBMCISCertificateOrderRead, + Read: ResourceIBMCISCertificateOrderRead, + Delete: ResourceIBMCISCertificateOrderDelete, + Exists: ResourceIBMCISCertificateOrderExist, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS object id or CRN", + Required: true, + }, + cisDomainID: { + Type: schema.TypeString, + Description: "Associated CIS domain", + Required: true, + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisCertificateOrderID: { + Type: schema.TypeString, + Description: "certificate id", + Computed: true, + }, + cisCertificateOrderType: { + Type: schema.TypeString, + Description: "certificate type", + Optional: true, + Default: cisCertificateOrderTypeDedicated, + }, + cisCertificateOrderHosts: { + Type: schema.TypeList, + Description: "Hosts which certificate need to be ordered", + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + cisCertificateOrderStatus: { + Type: schema.TypeString, + Description: "certificate status", + Computed: true, + }, + }, + } +} + +func ResourceIBMCISCertificateOrderValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisCertificateOrderType, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: cisCertificateOrderTypeDedicated}) + + cisCertificateOrderValidator := validate.ResourceValidator{ + ResourceName: ibmCISCertificateOrder, + Schema: validateSchema} + return &cisCertificateOrderValidator +} + +func ResourceIBMCISCertificateOrderCreate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() + if err != nil { + return err + } + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + certType := d.Get(cisCertificateOrderType).(string) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + hosts := d.Get(cisCertificateOrderHosts) + hostsList := flex.ExpandStringList(hosts.([]interface{})) + opt := cisClient.NewOrderCertificateOptions() + opt.SetType(certType) + opt.SetHosts(hostsList) + + result, resp, err := cisClient.OrderCertificate(opt) + if err != nil { + log.Printf("Certificate order failed: %v", resp) + return err + } + + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + return ResourceIBMCISCertificateOrderRead(d, meta) +} + +func ResourceIBMCISCertificateOrderRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() + if err != nil { + return err + } + certificateID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + log.Println("Error in reading certificate id") + return err + } + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + opt := cisClient.NewGetCustomCertificateOptions(certificateID) + result, resp, err := cisClient.GetCustomCertificate(opt) + if err != nil { + log.Printf("Certificate read failed: %v", resp) + return err + } + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisCertificateOrderID, result.Result.ID) + d.Set(cisCertificateOrderType, cisCertificateOrderTypeDedicated) + d.Set(cisCertificateOrderHosts, flex.FlattenStringList(result.Result.Hosts)) + d.Set(cisCertificateOrderStatus, result.Result.Status) + return nil +} + +func ResourceIBMCISCertificateOrderDelete(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() + if err != nil { + return err + } + certificateID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + log.Println("Error in reading certificate id") + return err + } + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + opt := cisClient.NewDeleteCertificateOptions(certificateID) + resp, err := cisClient.DeleteCertificate(opt) + if err != nil { + log.Printf("Certificate delete failed: %v", resp) + return err + } + + _, err = waitForCISCertificateOrderDelete(d, meta) + if err != nil { + return err + } + + return nil +} + +func ResourceIBMCISCertificateOrderExist(d *schema.ResourceData, meta interface{}) (bool, error) { + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() + if err != nil { + return false, err + } + certificateID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + log.Println("Error in reading certificate id") + return false, err + } + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + opt := cisClient.NewGetCustomCertificateOptions(certificateID) + _, response, err := cisClient.GetCustomCertificate(opt) + if err != nil { + if response != nil && response.StatusCode == 400 { + log.Printf("Certificate is not found") + return false, nil + } + log.Printf("Get Certificate failed: %v", response) + return false, err + } + return true, nil +} + +func waitForCISCertificateOrderDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() + if err != nil { + return nil, err + } + certificateID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + log.Println("Error in reading certificate id") + return nil, err + } + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + opt := cisClient.NewGetCustomCertificateOptions(certificateID) + stateConf := &resource.StateChangeConf{ + Pending: []string{cisCertificateOrderDeletePending}, + Target: []string{cisCertificateOrderDeleted}, + Refresh: func() (interface{}, string, error) { + _, detail, err := cisClient.GetCustomCertificate(opt) + if err != nil { + if detail != nil && detail.StatusCode == 400 { + return detail, cisCertificateOrderDeleted, nil + } + return nil, "", err + } + return detail, cisCertificateOrderDeletePending, nil + }, + Timeout: d.Timeout(schema.TimeoutDelete), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + PollInterval: 10 * time.Second, + } + + return stateConf.WaitForState() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_certificate_upload.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_certificate_upload.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_certificate_upload.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_certificate_upload.go index f1930edf41..47c4a71366 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_certificate_upload.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_certificate_upload.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" cissslv1 "github.com/IBM/networking-go-sdk/sslcertificateapiv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -16,8 +19,8 @@ import ( const ( ibmCISCertificateUpload = "ibm_cis_certificate_upload" - cisCertificateUploadCertificate = "certificate" - cisCertificateUploadPrivateKey = "private_key" + CisCertificateUploadCertificate = "certificate" + CisCertificateUploadPrivateKey = "private_key" cisCertificateUploadBundleMethod = "bundle_method" cisCertificateUploadGeoRestrictions = "geo_restrictions" cisCertificateUploadCustomCertID = "custom_cert_id" @@ -34,7 +37,7 @@ const ( cisCertificateUploadDeleted = "deleted" ) -func resourceIBMCISCertificateUpload() *schema.Resource { +func ResourceIBMCISCertificateUpload() *schema.Resource { return &schema.Resource{ Create: resourceCISCertificateUploadCreate, Read: resourceCISCertificateUploadRead, @@ -58,13 +61,13 @@ func resourceIBMCISCertificateUpload() *schema.Resource { Type: schema.TypeString, Computed: true, }, - cisCertificateUploadCertificate: { + CisCertificateUploadCertificate: { Type: schema.TypeString, Description: "Certificate key", Required: true, Sensitive: true, }, - cisCertificateUploadPrivateKey: { + CisCertificateUploadPrivateKey: { Type: schema.TypeString, Description: "Certificate private key", Required: true, @@ -75,7 +78,7 @@ func resourceIBMCISCertificateUpload() *schema.Resource { Description: "Certificate bundle method", Optional: true, Default: cisCertificateUploadUbiquitous, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISCertificateUpload, cisCertificateUploadBundleMethod), }, @@ -127,36 +130,36 @@ func resourceIBMCISCertificateUpload() *schema.Resource { } } -func resourceCISCertificateUploadValidator() *ResourceValidator { +func ResourceIBMCISCertificateUploadValidator() *validate.ResourceValidator { bundleMethod := "ubiquitous, optimal, force" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisCertificateUploadBundleMethod, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: bundleMethod}) - cisCertificateUploadValidator := ResourceValidator{ResourceName: ibmCISCertificateUpload, Schema: validateSchema} + cisCertificateUploadValidator := validate.ResourceValidator{ResourceName: ibmCISCertificateUpload, Schema: validateSchema} return &cisCertificateUploadValidator } func resourceCISCertificateUploadCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) // upload certificate opt := cisClient.NewUploadCustomCertificateOptions() - opt.SetCertificate(d.Get(cisCertificateUploadCertificate).(string)) - opt.SetPrivateKey(d.Get(cisCertificateUploadPrivateKey).(string)) + opt.SetCertificate(d.Get(CisCertificateUploadCertificate).(string)) + opt.SetPrivateKey(d.Get(CisCertificateUploadPrivateKey).(string)) if v, ok := d.GetOk(cisCertificateUploadBundleMethod); ok { opt.SetBundleMethod(v.(string)) } @@ -167,7 +170,7 @@ func resourceCISCertificateUploadCreate(d *schema.ResourceData, meta interface{} return err } certID := *result.Result.ID - d.SetId(convertCisToTfThreeVar(certID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfThreeVar(certID, zoneID, crn)) // change priority of certificate certsList := []cissslv1.CertPriorityReqCertificatesItem{} @@ -189,12 +192,12 @@ func resourceCISCertificateUploadCreate(d *schema.ResourceData, meta interface{} return resourceCISCertificateUploadRead(d, meta) } func resourceCISCertificateUploadRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } - certID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + certID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -212,7 +215,7 @@ func resourceCISCertificateUploadRead(d *schema.ResourceData, meta interface{}) d.Set(cisCertificateUploadCustomCertID, result.Result.ID) d.Set(cisCertificateUploadBundleMethod, result.Result.BundleMethod) d.Set(cisCertificateUploadIssuer, result.Result.Issuer) - d.Set(cisCertificateUploadHosts, flattenStringList(result.Result.Hosts)) + d.Set(cisCertificateUploadHosts, flex.FlattenStringList(result.Result.Hosts)) d.Set(cisCertificateUploadSignature, result.Result.Signature) d.Set(cisCertificateUploadPriority, result.Result.Priority) d.Set(cisCertificateUploadStatus, result.Result.Status) @@ -222,12 +225,12 @@ func resourceCISCertificateUploadRead(d *schema.ResourceData, meta interface{}) return nil } func resourceCISCertificateUploadUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } - certID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + certID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -237,8 +240,8 @@ func resourceCISCertificateUploadUpdate(d *schema.ResourceData, meta interface{} if d.HasChange(cisCertificateUploadBundleMethod) { opt := cisClient.NewUpdateCustomCertificateOptions(certID) - opt.SetCertificate(d.Get(cisCertificateUploadCertificate).(string)) - opt.SetPrivateKey(d.Get(cisCertificateUploadPrivateKey).(string)) + opt.SetCertificate(d.Get(CisCertificateUploadCertificate).(string)) + opt.SetPrivateKey(d.Get(CisCertificateUploadPrivateKey).(string)) if v, ok := d.GetOk(cisCertificateUploadBundleMethod); ok { opt.SetBundleMethod(v.(string)) } @@ -271,12 +274,12 @@ func resourceCISCertificateUploadUpdate(d *schema.ResourceData, meta interface{} } func resourceCISCertificateUploadDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } - certID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + certID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -297,12 +300,12 @@ func resourceCISCertificateUploadDelete(d *schema.ResourceData, meta interface{} } func resourceCISCertificateUploadExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return false, err } - certID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + certID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return false, err } @@ -322,12 +325,12 @@ func resourceCISCertificateUploadExists(d *schema.ResourceData, meta interface{} } func waitForCISCertificateUploadDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return nil, err } - certID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + certID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return nil, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_custom_page.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_custom_page.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_custom_page.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_custom_page.go index 9c45eee044..9bab13dac2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_custom_page.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_custom_page.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -24,7 +27,7 @@ const ( cisCustomPageModifiedOn = "modified_on" ) -func resourceIBMCISCustomPage() *schema.Resource { +func ResourceIBMCISCustomPage() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -43,7 +46,7 @@ func resourceIBMCISCustomPage() *schema.Resource { Description: "Custom page identifier", ForceNew: true, Required: true, - ValidateFunc: InvokeValidator(ibmCISCustomPage, + ValidateFunc: validate.InvokeValidator(ibmCISCustomPage, cisCustomPageIdentifier), }, cisCustomPageURL: { @@ -93,31 +96,31 @@ func resourceIBMCISCustomPage() *schema.Resource { } } -func resourceIBMCISCustomPageValidator() *ResourceValidator { +func ResourceIBMCISCustomPageValidator() *validate.ResourceValidator { customPageIDs := "basic_challenge, waf_challenge, waf_block, ratelimit_block," + "country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisCustomPageIdentifier, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: customPageIDs}) - ibmCISCustomPageResourceValidator := ResourceValidator{ + ibmCISCustomPageResourceValidator := validate.ResourceValidator{ ResourceName: ibmCISCustomPage, Schema: validateSchema} return &ibmCISCustomPageResourceValidator } func resourceCISCustomPageUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisCustomPageClientSession() + cisClient, err := meta.(conns.ClientSession).CisCustomPageClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) pageID := d.Get(cisCustomPageIdentifier).(string) @@ -138,17 +141,17 @@ func resourceCISCustomPageUpdate(d *schema.ResourceData, meta interface{}) error log.Printf("Update custom page failed : %v", response) return err } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) } return resourceCISCustomPageRead(d, meta) } func resourceCISCustomPageRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisCustomPageClientSession() + cisClient, err := meta.(conns.ClientSession).CisCustomPageClientSession() if err != nil { return err } - pageID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + pageID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -170,7 +173,7 @@ func resourceCISCustomPageRead(d *schema.ResourceData, meta interface{}) error { d.Set(cisCustomPageIdentifier, result.Result.ID) d.Set(cisCustomPageURL, result.Result.URL) d.Set(cisCustomPageState, result.Result.State) - d.Set(cisCustomPageRequiredTokens, flattenStringList(result.Result.RequiredTokens)) + d.Set(cisCustomPageRequiredTokens, flex.FlattenStringList(result.Result.RequiredTokens)) d.Set(cisCustomPageDesc, result.Result.Description) d.Set(cisCustomPagePreviewTarget, result.Result.PreviewTarget) d.Set(cisCustomPageCreatedOn, (*result.Result.CreatedOn).String()) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_dns_record.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_dns_record.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_dns_record.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_dns_record.go index b3bffba246..bb2668ea6f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_dns_record.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_dns_record.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" @@ -9,6 +9,8 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -46,13 +48,13 @@ const ( cisDNSRecordTypePTR = "PTR" ) -func resourceIBMCISDnsRecord() *schema.Resource { +func ResourceIBMCISDnsRecord() *schema.Resource { return &schema.Resource{ - Create: resourceIBMCISDnsRecordCreate, - Read: resourceIBMCISDnsRecordRead, - Update: resourceIBMCISDnsRecordUpdate, - Delete: resourceIBMCISDnsRecordDelete, - Exists: resourceIBMCISDnsRecordExist, + Create: ResourceIBMCISDnsRecordCreate, + Read: ResourceIBMCISDnsRecordRead, + Update: ResourceIBMCISDnsRecordUpdate, + Delete: ResourceIBMCISDnsRecordDelete, + Exists: ResourceIBMCISDnsRecordExist, Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ @@ -137,9 +139,9 @@ func resourceIBMCISDnsRecord() *schema.Resource { } } -func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisDNSRecordClientSession() + sess, err := meta.(conns.ClientSession).CisDNSRecordClientSession() if err != nil { log.Printf("Error: %s", err) return err @@ -159,7 +161,7 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err ) // session options crn = d.Get(cisID).(string) - zoneID, _, err = convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, err = flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) sess.Crn = core.StringPtr(crn) sess.ZoneIdentifier = core.StringPtr(zoneID) @@ -210,7 +212,7 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err log.Printf("Error in getting data") return err } - recordData = make(map[string]interface{}, 0) + recordData = make(map[string]interface{}) var dataMap map[string]interface{} = data.(map[string]interface{}) // altitude @@ -274,7 +276,7 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err if ok != nil { return ok } - recordData["precision_horz"] = v + recordData["precision_horz"] = i // precision_vert i, ok = strconv.ParseFloat(dataMap["precision_vert"].(string), 64) @@ -303,7 +305,7 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err log.Printf("Error in getting data") return err } - recordData = make(map[string]interface{}, 0) + recordData = make(map[string]interface{}) var dataMap map[string]interface{} = data.(map[string]interface{}) // tag @@ -323,7 +325,7 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err log.Printf("Error in getting data") return err } - recordData = make(map[string]interface{}, 0) + recordData = make(map[string]interface{}) var dataMap map[string]interface{} = data.(map[string]interface{}) // name @@ -381,7 +383,7 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err if dataOk { for id, content := range data.(map[string]interface{}) { - newData, err := transformToIBMCISDnsData(recordType, id, content) + newData, err := flex.TransformToIBMCISDnsData(recordType, id, content) if err != nil { return err } else if newData == nil { @@ -414,23 +416,23 @@ func resourceIBMCISDnsRecordCreate(d *schema.ResourceData, meta interface{}) err return err } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) - return resourceIBMCISDnsRecordUpdate(d, meta) + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + return ResourceIBMCISDnsRecordUpdate(d, meta) } -func resourceIBMCISDnsRecordRead(d *schema.ResourceData, meta interface{}) error { +func ResourceIBMCISDnsRecordRead(d *schema.ResourceData, meta interface{}) error { var ( crn string zoneID string recordID string ) - sess, err := meta.(ClientSession).CisDNSRecordClientSession() + sess, err := meta.(conns.ClientSession).CisDNSRecordClientSession() if err != nil { return err } - recordID, zoneID, crn, _ = convertTfToCisThreeVar(d.Id()) + recordID, zoneID, crn, _ = flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -471,8 +473,8 @@ func resourceIBMCISDnsRecordRead(d *schema.ResourceData, meta interface{}) error return nil } -func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisDNSRecordClientSession() +func ResourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).CisDNSRecordClientSession() if err != nil { log.Printf("Error: %s", err) return err @@ -492,7 +494,7 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err recordData map[string]interface{} ) // session options - recordID, zoneID, crn, err = convertTfToCisThreeVar(d.Id()) + recordID, zoneID, crn, err = flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { log.Println("Error in reading record id") return err @@ -561,11 +563,11 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err opt.SetName(recordName) data, ok = d.GetOk(cisDNSRecordData) - if ok == false { + if !ok { log.Printf("Error in getting data") return err } - recordData = make(map[string]interface{}, 0) + recordData = make(map[string]interface{}) var dataMap map[string]interface{} = data.(map[string]interface{}) // altitude @@ -653,11 +655,11 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err recordName = d.Get(cisDNSRecordName).(string) opt.SetName(recordName) data, ok = d.GetOk(cisDNSRecordData) - if ok == false { + if !ok { log.Printf("Error in getting data") return err } - recordData = make(map[string]interface{}, 0) + recordData = make(map[string]interface{}) var dataMap map[string]interface{} = data.(map[string]interface{}) // tag @@ -673,11 +675,11 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err // SRV record input case cisDNSRecordTypeSRV: data, ok = d.GetOk(cisDNSRecordData) - if ok == false { + if !ok { log.Printf("Error in getting data") return err } - recordData = make(map[string]interface{}, 0) + recordData = make(map[string]interface{}) var dataMap map[string]interface{} = data.(map[string]interface{}) // name @@ -742,8 +744,8 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err opt.SetTTL(int64(ttl.(int))) } if ttl != 1 && proxied == true { - return fmt.Errorf("To enable proxy TTL should be Automatic %s", - "i.e it should be set to 1. For the the values other than Automatic, proxy should be disabled.") + return fmt.Errorf("[ERROR] To enable proxy TTL should be Automatic %s", + "i.e it should be set to 1. For the the values other than Automatic, proxy should be disabled") } priority, priorityOk := d.GetOk(cisDNSRecordPriority) if priorityOk { @@ -754,7 +756,7 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err newDataMap := make(map[string]interface{}) if dataOk { for id, content := range data.(map[string]interface{}) { - newData, err := transformToIBMCISDnsData(recordType, id, content) + newData, err := flex.TransformToIBMCISDnsData(recordType, id, content) if err != nil { return err } else if newData == nil { @@ -780,22 +782,22 @@ func resourceIBMCISDnsRecordUpdate(d *schema.ResourceData, meta interface{}) err } log.Printf("record id: %s", *result.Result.ID) } - return resourceIBMCISDnsRecordRead(d, meta) + return ResourceIBMCISDnsRecordRead(d, meta) } -func resourceIBMCISDnsRecordDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceIBMCISDnsRecordDelete(d *schema.ResourceData, meta interface{}) error { var ( crn string zoneID string recordID string ) - sess, err := meta.(ClientSession).CisDNSRecordClientSession() + sess, err := meta.(conns.ClientSession).CisDNSRecordClientSession() if err != nil { log.Printf("Error: %s", err) return err } // session options - recordID, zoneID, crn, _ = convertTfToCisThreeVar(d.Id()) + recordID, zoneID, crn, _ = flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { log.Println("Error in reading input") return err @@ -814,15 +816,15 @@ func resourceIBMCISDnsRecordDelete(d *schema.ResourceData, meta interface{}) err return nil } -func resourceIBMCISDnsRecordExist(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).CisDNSRecordClientSession() +func ResourceIBMCISDnsRecordExist(d *schema.ResourceData, meta interface{}) (bool, error) { + sess, err := meta.(conns.ClientSession).CisDNSRecordClientSession() if err != nil { log.Printf("session creation failed: %s", err) return false, err } // session options - recordID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + recordID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { log.Println("Error in reading input") return false, err @@ -844,35 +846,6 @@ func resourceIBMCISDnsRecordExist(d *schema.ResourceData, meta interface{}) (boo return true, nil } -var dnsTypeIntFields = []string{ - "algorithm", - "key_tag", - "type", - "usage", - "selector", - "matching_type", - "weight", - "priority", - "port", - "long_degrees", - "lat_degrees", - "long_minutes", - "lat_minutes", - "protocol", - "digest_type", - "order", - "preference", -} - -var dnsTypeFloatFields = []string{ - "size", - "altitude", - "precision_horz", - "precision_vert", - "long_seconds", - "lat_seconds", -} - func suppressPriority(k, old, new string, d *schema.ResourceData) bool { recordType := d.Get("type").(string) if recordType != "MX" && recordType != "URI" { @@ -902,18 +875,12 @@ func suppressContentDiff(k, old, new string, d *schema.ResourceData) bool { func suppressDataDiff(k, old, new string, d *schema.ResourceData) bool { // Tuncate after . - if strings.SplitN(old, ".", 2)[0] == strings.SplitN(new, ".", 2)[0] { - return true - } - return false + return strings.SplitN(old, ".", 2)[0] == strings.SplitN(new, ".", 2)[0] } func suppressDomainIDDiff(k, old, new string, d *schema.ResourceData) bool { // TF concantenates domain_id with cis_id. So just check when is passed as input it is same as domai_id in the combination that is Set. - if strings.Split(new, ":")[0] == old { - return true - } - return false + return strings.Split(new, ":")[0] == old } func flattenData(inVal interface{}, zone string) map[string]string { outVal := make(map[string]string) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_dns_records_import.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_dns_records_import.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_dns_records_import.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_dns_records_import.go index c2fa378d91..ec7f1bf9c2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_dns_records_import.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_dns_records_import.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" @@ -10,6 +10,8 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -20,7 +22,7 @@ const ( cisDNSRecordsImportRecordsAdded = "records_added" ) -func resourceIBMCISDNSRecordsImport() *schema.Resource { +func ResourceIBMCISDNSRecordsImport() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -60,13 +62,13 @@ func resourceIBMCISDNSRecordsImport() *schema.Resource { } } func resourceCISDNSRecordsImportUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisDNSRecordBulkClientSession() + cisClient, err := meta.(conns.ClientSession).CisDNSRecordBulkClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) file := d.Get(cisDNSRecordsImportFile).(string) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_domain.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_domain.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_domain.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_domain.go index aa918e0a94..7ca75c81e0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_domain.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_domain.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -18,7 +20,7 @@ const ( cisDomainOriginalNameServers = "original_name_servers" ) -func resourceIBMCISDomain() *schema.Resource { +func ResourceIBMCISDomain() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -64,7 +66,7 @@ func resourceIBMCISDomain() *schema.Resource { } func resourceCISdomainCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisZonesV1ClientSession() + cisClient, err := meta.(conns.ClientSession).CisZonesV1ClientSession() if err != nil { return err } @@ -80,17 +82,17 @@ func resourceCISdomainCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("CreateZones Failed %s", resp) return err } - d.SetId(convertCisToTfTwoVar(*result.Result.ID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(*result.Result.ID, crn)) return resourceCISdomainRead(d, meta) } func resourceCISdomainRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisZonesV1ClientSession() + cisClient, err := meta.(conns.ClientSession).CisZonesV1ClientSession() if err != nil { return err } - zoneID, crn, err := convertTftoCisTwoVar(d.Id()) + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -112,12 +114,12 @@ func resourceCISdomainRead(d *schema.ResourceData, meta interface{}) error { return nil } func resourceCISdomainExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisZonesV1ClientSession() + cisClient, err := meta.(conns.ClientSession).CisZonesV1ClientSession() if err != nil { return false, err } - zoneID, crn, err := convertTftoCisTwoVar(d.Id()) + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) log.Println("resource exist :", d.Id()) if err != nil { return false, err @@ -142,12 +144,12 @@ func resourceCISdomainUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceCISdomainDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisZonesV1ClientSession() + cisClient, err := meta.(conns.ClientSession).CisZonesV1ClientSession() if err != nil { return err } - zoneID, crn, err := convertTftoCisTwoVar(d.Id()) + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) log.Println("resource delete :", d.Id()) if err != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_domain_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_domain_settings.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_domain_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_domain_settings.go index 98e53ca3d1..9655773d63 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_domain_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_domain_settings.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -66,7 +69,7 @@ const ( cisDomainSettingsCipherValidatorID = "cipher" ) -func resourceIBMCISSettings() *schema.Resource { +func ResourceIBMCISSettings() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -85,7 +88,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "DNS Sec setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsActiveDisableValidatorID), }, @@ -94,7 +97,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "WAF setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -103,7 +106,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "SSL/TLS setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsSSLSettingValidatorID), }, @@ -117,7 +120,7 @@ func resourceIBMCISSettings() *schema.Resource { Type: schema.TypeString, Description: "Minimum version of TLS required", Optional: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsTLSVersionValidatorID), Default: "1.1", @@ -127,7 +130,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "cname_flattening setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsCNAMEFlattenValidatorID), }, @@ -136,7 +139,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "opportunistic_encryption setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -145,7 +148,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "automatic_https_rewrites setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -154,7 +157,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "always_use_https setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -163,7 +166,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "ipv6 setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -172,7 +175,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "browser_check setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -181,7 +184,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "hotlink_protection setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -190,7 +193,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "http2 setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -199,7 +202,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "image_load_optimization setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -208,7 +211,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "image_size_optimization setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsImgSizeOptimizeValidatorID), }, @@ -217,7 +220,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "ip_geolocation setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -226,7 +229,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "origin_error_page_pass_thru setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -235,7 +238,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "brotli setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -244,7 +247,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "pseudo_ipv4 setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsPseudoIPv4ValidatorID), }, @@ -253,7 +256,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "prefetch_preload setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -262,7 +265,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "response_buffering setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -271,7 +274,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "script_load_optimization setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -280,7 +283,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "server_side_exclude setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -289,7 +292,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "tls_client_auth setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -298,7 +301,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "true_client_ip_header setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -307,7 +310,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "websockets setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -316,7 +319,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "Challenge TTL setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsChallengeTTLValidatorID), }, @@ -325,7 +328,7 @@ func resourceIBMCISSettings() *schema.Resource { Description: "Maximum upload", Optional: true, Computed: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsMaxUploadValidatorID), }, @@ -337,7 +340,7 @@ func resourceIBMCISSettings() *schema.Resource { Set: schema.HashString, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsCipherValidatorID), }, @@ -355,7 +358,7 @@ func resourceIBMCISSettings() *schema.Resource { Type: schema.TypeString, Description: "Minify CSS setting", Required: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -363,7 +366,7 @@ func resourceIBMCISSettings() *schema.Resource { Type: schema.TypeString, Description: "Minify HTML setting", Required: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -371,7 +374,7 @@ func resourceIBMCISSettings() *schema.Resource { Type: schema.TypeString, Description: "Minify JS setting", Required: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -422,7 +425,7 @@ func resourceIBMCISSettings() *schema.Resource { Type: schema.TypeString, Description: "mobile redirect status", Required: true, - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISDomainSettings, cisDomainSettingsONOFFValidatorID), }, @@ -451,7 +454,7 @@ func resourceIBMCISSettings() *schema.Resource { } } -func resourceIBMCISDomainSettingValidator() *ResourceValidator { +func ResourceIBMCISDomainSettingValidator() *validate.ResourceValidator { sslSetting := "off, flexible, full, strict, origin_pull" tlsVersion := "1.1, 1.2, 1.3, 1.4" @@ -462,87 +465,87 @@ func resourceIBMCISDomainSettingValidator() *ResourceValidator { maxUpload := "100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500" cipher := "ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-ECDSA-CHACHA20-POLY1305, ECDHE-RSA-AES128-GCM-SHA256,ECDHE-RSA-CHACHA20-POLY1305, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES128-SHA, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES128-SHA, AES128-GCM-SHA256, AES128-SHA256, AES128-SHA, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES256-SHA, AES256-GCM-SHA384, AES256-SHA256, AES256-SHA, DES-CBC3-SHA" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsONOFFValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "on, off"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsActiveDisableValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "active, disabled"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsSSLSettingValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: sslSetting}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsTLSVersionValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: tlsVersion}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsCNAMEFlattenValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: cnameFlatten}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsImgSizeOptimizeValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: imgSizeOptimize}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsPseudoIPv4ValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: pseudoIPv4}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsChallengeTTLValidatorID, - ValidateFunctionIdentifier: ValidateAllowedIntValue, - Type: TypeInt, + ValidateFunctionIdentifier: validate.ValidateAllowedIntValue, + Type: validate.TypeInt, Optional: true, AllowedValues: challengeTTL}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsMaxUploadValidatorID, - ValidateFunctionIdentifier: ValidateAllowedIntValue, - Type: TypeInt, + ValidateFunctionIdentifier: validate.ValidateAllowedIntValue, + Type: validate.TypeInt, Optional: true, AllowedValues: maxUpload}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisDomainSettingsCipherValidatorID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: cipher}) - ibmCISDomainSettingResourceValidator := ResourceValidator{ + ibmCISDomainSettingResourceValidator := validate.ResourceValidator{ ResourceName: ibmCISDomainSettings, Schema: validateSchema} return &ibmCISDomainSettingResourceValidator @@ -583,13 +586,13 @@ var settingsList = []string{ } func resourceCISSettingsUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisDomainSettingsClientSession() + cisClient, err := meta.(conns.ClientSession).CisDomainSettingsClientSession() if err != nil { return err } cisID := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -617,7 +620,7 @@ func resourceCISSettingsUpdate(d *schema.ResourceData, meta interface{}) error { case cisDomainSettingsSSL: if d.HasChange(item) { if v, ok := d.GetOk(item); ok { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } @@ -824,7 +827,7 @@ func resourceCISSettingsUpdate(d *schema.ResourceData, meta interface{}) error { case cisDomainSettingsCipher: if d.HasChange(item) { if v, ok := d.GetOk(item); ok { - cipherValue := expandStringList(v.(*schema.Set).List()) + cipherValue := flex.ExpandStringList(v.(*schema.Set).List()) opt := cisClient.NewUpdateCiphersOptions() opt.SetValue(cipherValue) _, resp, err = cisClient.UpdateCiphers(opt) @@ -898,17 +901,17 @@ func resourceCISSettingsUpdate(d *schema.ResourceData, meta interface{}) error { return err } } - d.SetId(convertCisToTfTwoVar(zoneID, cisID)) + d.SetId(flex.ConvertCisToTfTwoVar(zoneID, cisID)) return resourceCISSettingsRead(d, meta) } func resourceCISSettingsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisDomainSettingsClientSession() + cisClient, err := meta.(conns.ClientSession).CisDomainSettingsClientSession() if err != nil { return err } - zoneID, crn, _ := convertTftoCisTwoVar(d.Id()) + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -935,7 +938,7 @@ func resourceCISSettingsRead(d *schema.ResourceData, meta interface{}) error { settingErr = err case cisDomainSettingsSSL: - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_edge_functions_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_edge_functions_action.go new file mode 100644 index 0000000000..5c2043f8d3 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_edge_functions_action.go @@ -0,0 +1,168 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + "io" + "io/ioutil" + "log" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + cisEdgeFunctionsActionActionName = "action_name" + cisEdgeFunctionsActionScript = "script" +) + +func ResourceIBMCISEdgeFunctionsAction() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISEdgeFunctionsActionCreate, + Read: ResourceIBMCISEdgeFunctionsActionRead, + Update: ResourceIBMCISEdgeFunctionsActionUpdate, + Delete: ResourceIBMCISEdgeFunctionsActionDelete, + Exists: ResourceIBMCISEdgeFunctionsActionExists, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Intance CRN", + }, + cisDomainID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Domain ID", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisEdgeFunctionsActionActionName: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Edge function action script name", + }, + cisEdgeFunctionsActionScript: { + Type: schema.TypeString, + Required: true, + Description: "Edge function action script", + }, + }, + } +} + +func ResourceIBMCISEdgeFunctionsActionCreate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return err + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + scriptName := d.Get(cisEdgeFunctionsActionActionName).(string) + script := d.Get(cisEdgeFunctionsActionScript).(string) + r := ioutil.NopCloser(strings.NewReader(script)) + opt := cisClient.NewUpdateEdgeFunctionsActionOptions(scriptName) + opt.SetEdgeFunctionsAction(r) + + _, _, err = cisClient.UpdateEdgeFunctionsAction(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error: %v", err) + } + d.SetId(flex.ConvertCisToTfThreeVar(scriptName, zoneID, crn)) + return ResourceIBMCISEdgeFunctionsActionRead(d, meta) +} + +func ResourceIBMCISEdgeFunctionsActionUpdate(d *schema.ResourceData, meta interface{}) error { + if d.HasChange(cisEdgeFunctionsActionScript) { + return ResourceIBMCISEdgeFunctionsActionCreate(d, meta) + } + + return ResourceIBMCISEdgeFunctionsActionRead(d, meta) +} + +func ResourceIBMCISEdgeFunctionsActionRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return err + } + + scriptName, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + opt := cisClient.NewGetEdgeFunctionsActionOptions(scriptName) + result, resp, err := cisClient.GetEdgeFunctionsAction(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error: %v", resp) + } + + // read script content + content := []byte{} + p := make([]byte, 8) + for { + n, err := result.Read(p) + content = append(content, p[:n]...) + if err == io.EOF || n < 1 { + break + } + } + err = result.Close() + if err != nil { + return fmt.Errorf("[ERROR] Error in closing reader") + } + + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisEdgeFunctionsActionActionName, scriptName) + d.Set(cisEdgeFunctionsActionScript, string(content)) + return nil +} + +func ResourceIBMCISEdgeFunctionsActionExists(d *schema.ResourceData, meta interface{}) (bool, error) { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return false, fmt.Errorf("[ERROR] Error in creating CIS object") + } + + scriptName, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + opt := cisClient.NewGetEdgeFunctionsActionOptions(scriptName) + _, response, err := cisClient.GetEdgeFunctionsAction(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + log.Printf("Edge functions action script is not found") + return false, nil + } + return false, fmt.Errorf("[ERROR] Error: %v", response) + } + return true, nil +} + +func ResourceIBMCISEdgeFunctionsActionDelete(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return fmt.Errorf("[ERROR] Error in creating CIS object") + } + + scriptName, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + opt := cisClient.NewDeleteEdgeFunctionsActionOptions(scriptName) + _, response, err := cisClient.DeleteEdgeFunctionsAction(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error in edge function action script deletion: %v", response) + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_edge_functions_trigger.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_edge_functions_trigger.go new file mode 100644 index 0000000000..bc6b913e58 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_edge_functions_trigger.go @@ -0,0 +1,182 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + cisEdgeFunctionsTriggerID = "trigger_id" + cisEdgeFunctionsTriggerPattern = "pattern_url" + cisEdgeFunctionsTriggerActionName = "action_name" + cisEdgeFunctionsTriggerRequestLimitFailOpen = "request_limit_fail_open" +) + +func ResourceIBMCISEdgeFunctionsTrigger() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISEdgeFunctionsTriggerCreate, + Read: ResourceIBMCISEdgeFunctionsTriggerRead, + Update: ResourceIBMCISEdgeFunctionsTriggerUpdate, + Delete: ResourceIBMCISEdgeFunctionsTriggerDelete, + Exists: ResourceIBMCISEdgeFunctionsTriggerExists, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Intance CRN", + }, + cisDomainID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Domain ID", + DiffSuppressFunc: suppressDataDiff, + }, + cisEdgeFunctionsTriggerID: { + Type: schema.TypeString, + Computed: true, + Description: "CIS Edge Functions trigger route ID", + }, + cisEdgeFunctionsTriggerPattern: { + Type: schema.TypeString, + Required: true, + Description: "Edge function trigger pattern", + }, + cisEdgeFunctionsTriggerActionName: { + Type: schema.TypeString, + Optional: true, + Description: "Edge function trigger action name", + }, + cisEdgeFunctionsTriggerRequestLimitFailOpen: { + Type: schema.TypeBool, + Computed: true, + Description: "Edge function trigger request limit fail open", + }, + }, + } +} + +func ResourceIBMCISEdgeFunctionsTriggerCreate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return err + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + opt := cisClient.NewCreateEdgeFunctionsTriggerOptions() + if action, ok := d.GetOk(cisEdgeFunctionsTriggerActionName); ok { + opt.SetScript(action.(string)) + } + pattern := d.Get(cisEdgeFunctionsTriggerPattern).(string) + opt.SetPattern(pattern) + + result, _, err := cisClient.CreateEdgeFunctionsTrigger(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error creating edge function trigger route : %v", err) + } + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + return ResourceIBMCISEdgeFunctionsTriggerRead(d, meta) +} + +func ResourceIBMCISEdgeFunctionsTriggerUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return err + } + + routeID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + if d.HasChange(cisEdgeFunctionsTriggerActionName) || + d.HasChange(cisEdgeFunctionsTriggerPattern) { + opt := cisClient.NewUpdateEdgeFunctionsTriggerOptions(routeID) + + if action, ok := d.GetOk(cisEdgeFunctionsTriggerActionName); ok { + opt.SetScript(action.(string)) + } + pattern := d.Get(cisEdgeFunctionsTriggerPattern).(string) + opt.SetPattern(pattern) + + _, _, err := cisClient.UpdateEdgeFunctionsTrigger(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error updating edge function trigger route : %v", err) + } + } + return ResourceIBMCISEdgeFunctionsTriggerRead(d, meta) +} + +func ResourceIBMCISEdgeFunctionsTriggerRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return err + } + + routeID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + opt := cisClient.NewGetEdgeFunctionsTriggerOptions(routeID) + result, resp, err := cisClient.GetEdgeFunctionsTrigger(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error: %v", resp) + } + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisEdgeFunctionsTriggerID, routeID) + d.Set(cisEdgeFunctionsTriggerActionName, result.Result.Script) + d.Set(cisEdgeFunctionsTriggerPattern, result.Result.Pattern) + d.Set(cisEdgeFunctionsTriggerRequestLimitFailOpen, result.Result.RequestLimitFailOpen) + return nil +} + +func ResourceIBMCISEdgeFunctionsTriggerExists(d *schema.ResourceData, meta interface{}) (bool, error) { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return false, err + } + + routeID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + opt := cisClient.NewGetEdgeFunctionsTriggerOptions(routeID) + _, response, err := cisClient.GetEdgeFunctionsTrigger(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + log.Printf("Edge functions trigger route is not found") + return false, nil + } + return false, fmt.Errorf("[ERROR] Error: %v", response) + } + return true, nil +} + +func ResourceIBMCISEdgeFunctionsTriggerDelete(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisEdgeFunctionClientSession() + if err != nil { + return fmt.Errorf("[ERROR] Error in creating CIS object") + } + + routeID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + opt := cisClient.NewDeleteEdgeFunctionsTriggerOptions(routeID) + _, response, err := cisClient.DeleteEdgeFunctionsTrigger(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error in edge function trigger route deletion: %v", response) + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_filter.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_filter.go new file mode 100644 index 0000000000..521f1d133e --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_filter.go @@ -0,0 +1,232 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/networking-go-sdk/filtersv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISFilters = "ibm_cis_filter" + cisFilterExpression = "expression" + cisFilterPaused = "paused" + cisFilterDescription = "description" + cisFilterID = "filter_id" +) + +func ResourceIBMCISFilter() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISFilterCreate, + Read: ResourceIBMCISFilterRead, + Update: ResourceIBMCISFilterUpdate, + Delete: ResourceIBMCISFilterDelete, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS instance crn", + Required: true, + }, + cisDomainID: { + Type: schema.TypeString, + Description: "Associated CIS domain", + Required: true, + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisFilterPaused: { + Type: schema.TypeBool, + Optional: true, + Description: "Filter Paused", + }, + cisFilterID: { + Type: schema.TypeString, + Computed: true, + Description: "Filter ID", + }, + cisFilterExpression: { + Type: schema.TypeString, + Required: true, + Description: "Filter Expression", + }, + cisFilterDescription: { + Type: schema.TypeString, + Optional: true, + Description: "Filter Description", + ValidateFunc: validate.InvokeValidator(ibmCISFilters, cisFilterDescription), + }, + }, + } +} +func ResourceIBMCISFilterCreate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while Getting IAM Access Token using BluemixSession %s", err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFiltersSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisFiltersSession %s", err) + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + + var newfilter filtersv1.FilterInput + + if p, ok := d.GetOkExists(cisFilterPaused); ok { + paused := p.(bool) + newfilter.Paused = &paused + } + if des, ok := d.GetOk(cisFilterDescription); ok { + description := des.(string) + newfilter.Description = &description + } + if e, ok := d.GetOk(cisFilterExpression); ok { + expression := e.(string) + newfilter.Expression = &expression + } + + opt := cisClient.NewCreateFilterOptions(xAuthtoken, crn, zoneID) + + opt.SetFilterInput([]filtersv1.FilterInput{newfilter}) + + result, resp, err := cisClient.CreateFilter(opt) + if err != nil || result == nil { + return fmt.Errorf("[ERROR] Error creating Filter for zone %q: %s %s", zoneID, err, resp) + } + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result[0].ID, zoneID, crn)) + return ResourceIBMCISFilterRead(d, meta) + +} +func ResourceIBMCISFilterRead(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while Getting IAM Access Token using BluemixSession %s", err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFiltersSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisFiltersSession %s", err) + } + filterid, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + return err + } + opt := cisClient.NewGetFilterOptions(xAuthtoken, crn, zoneID, filterid) + + result, response, err := cisClient.GetFilter(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + log.Printf("Error GetFilter not found ") + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error finding GetFilter %q: %s %s", d.Id(), err, response) + } + if result.Result != nil { + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisFilterID, result.Result.ID) + d.Set(cisFilterPaused, result.Result.Paused) + d.Set(cisFilterDescription, result.Result.Description) + d.Set(cisFilterExpression, result.Result.Expression) + } + return nil +} +func ResourceIBMCISFilterUpdate(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while Getting IAM Access Token using BluemixSession %s", err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFiltersSession() + if err != nil { + return fmt.Errorf("[ERROR] Error while getting the CisFiltersSession %s", err) + } + + filterid, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + return err + } + + if d.HasChange(cisFilterExpression) || + d.HasChange(cisFilterPaused) || + d.HasChange(cisFilterDescription) { + + var updatefilter filtersv1.FilterUpdateInput + updatefilter.ID = &filterid + + if p, ok := d.GetOkExists(cisFilterPaused); ok { + paused := p.(bool) + updatefilter.Paused = &paused + } + if des, ok := d.GetOk(cisFilterDescription); ok { + description := des.(string) + updatefilter.Description = &description + } + if e, ok := d.GetOk(cisFilterExpression); ok { + expression := e.(string) + updatefilter.Expression = &expression + } + + opt := cisClient.NewUpdateFiltersOptions(xAuthtoken, crn, zoneID) + + opt.SetFilterUpdateInput([]filtersv1.FilterUpdateInput{updatefilter}) + + result, resp, err := cisClient.UpdateFilters(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error updating Filter for zone %q: %s %s", zoneID, err, resp) + } + + if *result.Result[0].ID == "" { + return fmt.Errorf("[ERROR] Error failed to find id in Update response; resource was empty") + } + } + return ResourceIBMCISFilterRead(d, meta) +} +func ResourceIBMCISFilterDelete(d *schema.ResourceData, meta interface{}) error { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + xAuthtoken := sess.Config.IAMAccessToken + cisClient, err := meta.(conns.ClientSession).CisFiltersSession() + if err != nil { + return err + } + filterid, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + return err + } + opt := cisClient.NewDeleteFiltersOptions(xAuthtoken, crn, zoneID, filterid) + _, _, err = cisClient.DeleteFilters(opt) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting Filter: %s", err) + } + + return nil +} +func ResourceIBMCISFilterValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisFilterDescription, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "Filter-creation"}) + + ibmCISFiltersResourceValidator := validate.ResourceValidator{ResourceName: ibmCISFilters, Schema: validateSchema} + return &ibmCISFiltersResourceValidator +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_firewall.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_firewall.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_firewall.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_firewall.go index b262f0fc34..e30d38dac6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_firewall.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_firewall.go @@ -1,12 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" cislockdownv1 "github.com/IBM/networking-go-sdk/zonelockdownv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -55,13 +58,13 @@ const ( cisFirewallUARuleConfigurationValue = "value" ) -func resourceIBMCISFirewallRecord() *schema.Resource { +func ResourceIBMCISFirewallRecord() *schema.Resource { return &schema.Resource{ - Create: resourceIBMCISFirewallRecordCreate, - Read: resourceIBMCISFirewallRecordRead, - Update: resourceIBMCISFirewallRecordUpdate, - Delete: resourceIBMCISFirewallRecordDelete, - Exists: resourceIBMCISFirewallRecordExists, + Create: ResourceIBMCISFirewallRecordCreate, + Read: ResourceIBMCISFirewallRecordRead, + Update: ResourceIBMCISFirewallRecordUpdate, + Delete: ResourceIBMCISFirewallRecordDelete, + Exists: ResourceIBMCISFirewallRecordExists, Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ @@ -83,7 +86,7 @@ func resourceIBMCISFirewallRecord() *schema.Resource { Required: true, ForceNew: true, Description: "Type of firewall.Allowable values are access-rules,ua-rules,lockdowns", - ValidateFunc: InvokeValidator(ibmCISFirewall, cisFirewallType), + ValidateFunc: validate.InvokeValidator(ibmCISFirewall, cisFirewallType), }, cisFirewallLockdown: { @@ -133,7 +136,7 @@ func resourceIBMCISFirewallRecord() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Target type", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISFirewall, cisFirewallLockdownConfigurationsTarget), }, @@ -173,7 +176,7 @@ func resourceIBMCISFirewallRecord() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Access rule mode", - ValidateFunc: InvokeValidator(ibmCISFirewall, cisFirewallAccessRuleMode), + ValidateFunc: validate.InvokeValidator(ibmCISFirewall, cisFirewallAccessRuleMode), }, cisFirewallAccessRuleConfiguration: { Type: schema.TypeList, @@ -187,7 +190,7 @@ func resourceIBMCISFirewallRecord() *schema.Resource { Required: true, ForceNew: true, Description: "Target type", - ValidateFunc: InvokeValidator(ibmCISFirewall, + ValidateFunc: validate.InvokeValidator(ibmCISFirewall, cisFirewallAccessRuleConfigurationTarget), }, cisFirewallUARuleConfigurationValue: { @@ -232,7 +235,7 @@ func resourceIBMCISFirewallRecord() *schema.Resource { Type: schema.TypeString, Required: true, Description: "user agent rule mode", - ValidateFunc: InvokeValidator(ibmCISFirewall, cisFirewallUARuleMode), + ValidateFunc: validate.InvokeValidator(ibmCISFirewall, cisFirewallUARuleMode), }, cisFirewallUARuleConfiguration: { Type: schema.TypeList, @@ -245,7 +248,7 @@ func resourceIBMCISFirewallRecord() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Target type", - ValidateFunc: InvokeValidator(ibmCISFirewall, + ValidateFunc: validate.InvokeValidator(ibmCISFirewall, cisFirewallUARuleConfigurationTarget), }, cisFirewallUARuleConfigurationValue: { @@ -263,64 +266,64 @@ func resourceIBMCISFirewallRecord() *schema.Resource { } } -func resourceIBMCISFirewallValidator() *ResourceValidator { +func ResourceIBMCISFirewallValidator() *validate.ResourceValidator { firewallTypes := "access_rules, ua_rules, lockdowns" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisFirewallType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: firewallTypes}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisFirewallLockdownConfigurationsTarget, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "ip, ip_range"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisFirewallAccessRuleConfigurationTarget, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "ip, ip_range, asn, country"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisFirewallUARuleConfigurationTarget, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "ua"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisFirewallAccessRuleMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "block, challenge, whitelist, js_challenge"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisFirewallUARuleMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "block, challenge, js_challenge"}) - cisFirewallValidator := ResourceValidator{ResourceName: ibmCISHealthCheck, Schema: validateSchema} + cisFirewallValidator := validate.ResourceValidator{ResourceName: ibmCISHealthCheck, Schema: validateSchema} return &cisFirewallValidator } -func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{}) error { crn := d.Get(cisID).(string) - zoneID, _, _ := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) firewallType := d.Get(cisFirewallType).(string) if firewallType == cisFirewallTypeLockdowns { // Firewall Type : Lockdowns - cisClient, err := meta.(ClientSession).CisLockdownClientSession() + cisClient, err := meta.(conns.ClientSession).CisLockdownClientSession() if err != nil { return err } @@ -328,7 +331,7 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} opt := cisClient.NewCreateZoneLockdownRuleOptions() // not able to check bool variable availability - v, _ := lockdown[cisFirewallLockdownPaused] + v := lockdown[cisFirewallLockdownPaused] opt.SetPaused(v.(bool)) if v, ok := lockdown[cisFirewallLockdownDesc]; ok && v.(string) != "" { opt.SetDescription(v.(string)) @@ -336,7 +339,7 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} if v, ok := lockdown[cisFirewallLockdownPriority]; ok && v.(int) > 0 { opt.SetPriority(int64(v.(int))) } - urls := expandStringList(lockdown[cisFirewallLockdownURLs].([]interface{})) + urls := flex.ExpandStringList(lockdown[cisFirewallLockdownURLs].([]interface{})) configurations, err := expandLockdownsTypeConfiguration( lockdown[cisFirewallLockdownConfigurations].([]interface{})) if err != nil { @@ -352,11 +355,11 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} log.Printf("Create zone firewall lockdown failed: %v", response) return err } - d.SetId(convertCisToTfFourVar(firewallType, *result.Result.ID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfFourVar(firewallType, *result.Result.ID, zoneID, crn)) } else if firewallType == cisFirewallTypeAccessRules { - cisClient, err := meta.(ClientSession).CisAccessRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisAccessRuleClientSession() if err != nil { return err } @@ -390,10 +393,10 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} log.Printf("Create zone firewall access rule failed: %v", response) return err } - d.SetId(convertCisToTfFourVar(firewallType, *result.Result.ID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfFourVar(firewallType, *result.Result.ID, zoneID, crn)) } else if firewallType == cisFirewallTypeUARules { - cisClient, err := meta.(ClientSession).CisUARuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisUARuleClientSession() if err != nil { return err } @@ -404,7 +407,7 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} mode := uaRule[cisFirewallUARuleMode].(string) configList := uaRule[cisFirewallUARuleConfiguration].([]interface{}) if len(configList) > 1 { - return fmt.Errorf("Only one configuration is allowed for %s type", firewallType) + return fmt.Errorf("[ERROR] Only one configuration is allowed for %s type", firewallType) } config := configList[0].(map[string]interface{}) target := config[cisFirewallLockdownConfigurationsTarget].(string) @@ -424,7 +427,7 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} opt.SetDescription(v.(string)) } // not able to check bool attribute availablity - v, _ := uaRule[cisFirewallUARulePaused] + v := uaRule[cisFirewallUARulePaused] opt.SetPaused(v.(bool)) result, response, err := cisClient.CreateZoneUserAgentRule(opt) @@ -432,18 +435,18 @@ func resourceIBMCISFirewallRecordCreate(d *schema.ResourceData, meta interface{} log.Printf("Create zone user agent rule failed: %v", response) return err } - d.SetId(convertCisToTfFourVar(firewallType, *result.Result.ID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfFourVar(firewallType, *result.Result.ID, zoneID, crn)) } - return resourceIBMCISFirewallRecordRead(d, meta) + return ResourceIBMCISFirewallRecordRead(d, meta) } -func resourceIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) error { - firewallType, lockdownID, zoneID, crn, _ := convertTfToCisFourVar(d.Id()) +func ResourceIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) error { + firewallType, lockdownID, zoneID, crn, _ := flex.ConvertTfToCisFourVar(d.Id()) if firewallType == cisFirewallTypeLockdowns { // Firewall Type : Lockdowns - cisClient, err := meta.(ClientSession).CisLockdownClientSession() + cisClient, err := meta.(conns.ClientSession).CisLockdownClientSession() if err != nil { return err } @@ -462,7 +465,7 @@ func resourceIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) lockdown := map[string]interface{}{} lockdown[cisFirewallLockdownID] = *result.Result.ID lockdown[cisFirewallLockdownPaused] = *result.Result.Paused - lockdown[cisFirewallLockdownURLs] = flattenStringList(result.Result.Urls) + lockdown[cisFirewallLockdownURLs] = flex.FlattenStringList(result.Result.Urls) lockdown[cisFirewallLockdownConfigurations] = flattenLockdownsTypeConfiguration(result.Result.Configurations) if result.Result.Description != nil { @@ -477,7 +480,7 @@ func resourceIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) } else if firewallType == cisFirewallTypeAccessRules { // Firewall Type : Zone Access firewall rules - cisClient, err := meta.(ClientSession).CisAccessRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisAccessRuleClientSession() if err != nil { return err } @@ -509,7 +512,7 @@ func resourceIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) } else if firewallType == cisFirewallTypeUARules { // Firewall Type: User Agent access rules - cisClient, err := meta.(ClientSession).CisUARuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisUARuleClientSession() if err != nil { return err } @@ -547,9 +550,9 @@ func resourceIBMCISFirewallRecordRead(d *schema.ResourceData, meta interface{}) return nil } -func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{}) error { - firewallType, lockdownID, zoneID, crn, _ := convertTfToCisFourVar(d.Id()) + firewallType, lockdownID, zoneID, crn, _ := flex.ConvertTfToCisFourVar(d.Id()) if d.HasChange(cisFirewallLockdown) || d.HasChange(cisFirewallAccessRule) || @@ -559,14 +562,14 @@ func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{} // Firewall Type : Lockdowns lockdown := d.Get(cisFirewallLockdown).([]interface{})[0].(map[string]interface{}) - cisClient, err := meta.(ClientSession).CisLockdownClientSession() + cisClient, err := meta.(conns.ClientSession).CisLockdownClientSession() if err != nil { return err } opt := cisClient.NewUpdateLockdownRuleOptions(lockdownID) // not able to check bool variable availability - v, _ := lockdown[cisFirewallLockdownPaused] + v := lockdown[cisFirewallLockdownPaused] opt.SetPaused(v.(bool)) if v, ok := lockdown[cisFirewallLockdownDesc]; ok && v.(string) != "" { opt.SetDescription(v.(string)) @@ -574,7 +577,7 @@ func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{} if v, ok := lockdown[cisFirewallLockdownPriority]; ok && v.(int) > 0 { opt.SetPriority(int64(v.(int))) } - urls := expandStringList(lockdown[cisFirewallLockdownURLs].([]interface{})) + urls := flex.ExpandStringList(lockdown[cisFirewallLockdownURLs].([]interface{})) configurations, err := expandLockdownsTypeConfiguration(lockdown[cisFirewallLockdownConfigurations].([]interface{})) if err != nil { return err @@ -595,7 +598,7 @@ func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{} accessRule := d.Get(cisFirewallAccessRule).([]interface{})[0].(map[string]interface{}) // Firewall Type : Zone Access firewall rules - cisClient, err := meta.(ClientSession).CisAccessRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisAccessRuleClientSession() if err != nil { return err } @@ -618,7 +621,7 @@ func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{} } else if firewallType == cisFirewallTypeUARules { // Firewall Type: User Agent access rules uaRule := d.Get(cisFirewallUARule).([]interface{})[0].(map[string]interface{}) - cisClient, err := meta.(ClientSession).CisUARuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisUARuleClientSession() if err != nil { return err } @@ -644,7 +647,7 @@ func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{} opt.SetDescription(v.(string)) } // not able to check bool attribute availablity - v, _ := uaRule[cisFirewallUARulePaused] + v := uaRule[cisFirewallUARulePaused] opt.SetPaused(v.(bool)) _, response, err := cisClient.UpdateUserAgentRule(opt) @@ -655,15 +658,15 @@ func resourceIBMCISFirewallRecordUpdate(d *schema.ResourceData, meta interface{} } } - return resourceIBMCISFirewallRecordRead(d, meta) + return ResourceIBMCISFirewallRecordRead(d, meta) } -func resourceIBMCISFirewallRecordDelete(d *schema.ResourceData, meta interface{}) error { - firewallType, lockdownID, zoneID, crn, _ := convertTfToCisFourVar(d.Id()) +func ResourceIBMCISFirewallRecordDelete(d *schema.ResourceData, meta interface{}) error { + firewallType, lockdownID, zoneID, crn, _ := flex.ConvertTfToCisFourVar(d.Id()) if firewallType == cisFirewallTypeLockdowns { // Firewall Type : Lockdowns - cisClient, err := meta.(ClientSession).CisLockdownClientSession() + cisClient, err := meta.(conns.ClientSession).CisLockdownClientSession() if err != nil { return err } @@ -682,7 +685,7 @@ func resourceIBMCISFirewallRecordDelete(d *schema.ResourceData, meta interface{} } else if firewallType == cisFirewallTypeAccessRules { // Firewall Type : Zone Access firewall rules - cisClient, err := meta.(ClientSession).CisAccessRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisAccessRuleClientSession() if err != nil { return err } @@ -699,7 +702,7 @@ func resourceIBMCISFirewallRecordDelete(d *schema.ResourceData, meta interface{} } else if firewallType == cisFirewallTypeUARules { // Firewall Type: User Agent access rules - cisClient, err := meta.(ClientSession).CisUARuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisUARuleClientSession() if err != nil { return err } @@ -716,12 +719,12 @@ func resourceIBMCISFirewallRecordDelete(d *schema.ResourceData, meta interface{} return nil } -func resourceIBMCISFirewallRecordExists(d *schema.ResourceData, meta interface{}) (bool, error) { - firewallType, lockdownID, zoneID, crn, _ := convertTfToCisFourVar(d.Id()) +func ResourceIBMCISFirewallRecordExists(d *schema.ResourceData, meta interface{}) (bool, error) { + firewallType, lockdownID, zoneID, crn, _ := flex.ConvertTfToCisFourVar(d.Id()) if firewallType == cisFirewallTypeLockdowns { // Firewall Type : Lockdowns - cisClient, err := meta.(ClientSession).CisLockdownClientSession() + cisClient, err := meta.(conns.ClientSession).CisLockdownClientSession() if err != nil { return false, err } @@ -744,7 +747,7 @@ func resourceIBMCISFirewallRecordExists(d *schema.ResourceData, meta interface{} } else if firewallType == cisFirewallTypeAccessRules { // Firewall Type : Zone Access firewall rules - cisClient, err := meta.(ClientSession).CisAccessRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisAccessRuleClientSession() if err != nil { return false, err } @@ -765,7 +768,7 @@ func resourceIBMCISFirewallRecordExists(d *schema.ResourceData, meta interface{} } else if firewallType == cisFirewallTypeUARules { // Firewall Type: User Agent access rules - cisClient, err := meta.(ClientSession).CisUARuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisUARuleClientSession() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_firewall_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_firewall_rules.go new file mode 100644 index 0000000000..9392909167 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_firewall_rules.go @@ -0,0 +1,272 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/networking-go-sdk/firewallrulesv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISFirewallrules = "ibm_cis_firewall_rules" + cisFirewallrulesID = "firewall_rule_id" + cisFilter = "filter" + cisFirewallrulesAction = "action" + cisFirewallrulesPaused = "paused" + cisFirewallrulesPriority = "priority" + cisFirewallrulesDescription = "description" + cisFirewallrulesList = "firewall_rules" +) + +func ResourceIBMCISFirewallrules() *schema.Resource { + return &schema.Resource{ + CreateContext: ResourceIBMCISFirewallrulesCreate, + ReadContext: ResourceIBMCISFirewallrulesRead, + UpdateContext: ResourceIBMCISFirewallrulesUpdate, + DeleteContext: ResourceIBMCISFirewallrulesDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Description: "CIS instance crn", + Required: true, + }, + cisDomainID: { + Type: schema.TypeString, + Description: "Associated CIS domain", + Required: true, + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisFilterID: { + Type: schema.TypeString, + Required: true, + Description: "Firewallrules Existing FilterID", + }, + cisFirewallrulesAction: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator(ibmCISFirewallrules, cisFirewallrulesAction), + Description: "Firewallrules Action", + }, + cisFirewallrulesPriority: { + Type: schema.TypeInt, + Description: "Firewallrules Action", + Optional: true, + Computed: true, + ValidateFunc: validate.InvokeValidator(ibmCISFirewallrules, cisFirewallrulesPriority), + }, + cisFirewallrulesDescription: { + Type: schema.TypeString, + Optional: true, + Description: "Firewallrules Description", + ValidateFunc: validate.InvokeValidator(ibmCISFirewallrules, cisFirewallrulesDescription), + }, + cisFirewallrulesPaused: { + Type: schema.TypeBool, + Optional: true, + Description: "Firewallrules Paused", + }, + }, + } +} + +func ResourceIBMCISFirewallrulesCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFirewallRulesSession() + if err != nil { + return diag.FromErr(err) + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + + var newFirewallRules firewallrulesv1.FirewallRuleInputWithFilterID + + if a, ok := d.GetOk(cisFirewallrulesAction); ok { + action := a.(string) + newFirewallRules.Action = &action + } + if des, ok := d.GetOk(cisFilterDescription); ok { + description := des.(string) + newFirewallRules.Description = &description + } + if id, ok := d.GetOk(cisFilterID); ok { + filterid := id.(string) + filterModel, _ := cisClient.NewFirewallRuleInputWithFilterIdFilter(filterid) + newFirewallRules.Filter = filterModel + } + + opt := cisClient.NewCreateFirewallRulesOptions(xAuthtoken, crn, zoneID) + + opt.SetFirewallRuleInputWithFilterID([]firewallrulesv1.FirewallRuleInputWithFilterID{newFirewallRules}) + + result, _, err := cisClient.CreateFirewallRulesWithContext(context, opt) + if err != nil || result == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error reading the %s", err)) + } + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result[0].ID, zoneID, crn)) + + return ResourceIBMCISFirewallrulesRead(context, d, meta) + +} +func ResourceIBMCISFirewallrulesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFirewallRulesSession() + if err != nil { + return diag.FromErr(err) + } + firwallruleID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + opt := cisClient.NewGetFirewallRuleOptions(xAuthtoken, crn, zoneID, firwallruleID) + + result, response, err := cisClient.GetFirewallRuleWithContext(context, opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error reading the firewall rules %s:%s", err, response)) + } + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisFilterID, result.Result.Filter.ID) + d.Set(cisFirewallrulesAction, result.Result.Action) + d.Set(cisFirewallrulesPaused, result.Result.Paused) + d.Set(cisFilterDescription, result.Result.Description) + + return nil +} +func ResourceIBMCISFirewallrulesUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFirewallRulesSession() + if err != nil { + return diag.FromErr(err) + } + + firewallruleID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + if d.HasChange(cisFilterID) || + d.HasChange(cisFirewallrulesAction) || + d.HasChange(cisFirewallrulesPaused) || + d.HasChange(cisFilterDescription) { + + var updatefirewallrules firewallrulesv1.FirewallRulesUpdateInputItem + updatefirewallrules.ID = &firewallruleID + + if a, ok := d.GetOk(cisFirewallrulesAction); ok { + action := a.(string) + updatefirewallrules.Action = &action + } + if p, ok := d.GetOk(cisFirewallrulesPaused); ok { + paused := p.(bool) + updatefirewallrules.Paused = &paused + } + if des, ok := d.GetOk(cisFilterDescription); ok { + description := des.(string) + updatefirewallrules.Description = &description + } + + if id, ok := d.GetOk(cisFilterID); ok { + filterid := id.(string) + filterUpdate, _ := cisClient.NewFirewallRulesUpdateInputItemFilter(filterid) + updatefirewallrules.Filter = filterUpdate + } + opt := cisClient.NewUpdateFirewllRulesOptions(xAuthtoken, crn, zoneID) + + opt.SetFirewallRulesUpdateInputItem([]firewallrulesv1.FirewallRulesUpdateInputItem{updatefirewallrules}) + + result, _, err := cisClient.UpdateFirewllRulesWithContext(context, opt) + if err != nil || result == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the firewall rules %s", err)) + } + } + return ResourceIBMCISFirewallrulesRead(context, d, meta) +} +func ResourceIBMCISFirewallrulesDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + xAuthtoken := sess.Config.IAMAccessToken + + cisClient, err := meta.(conns.ClientSession).CisFirewallRulesSession() + if err != nil { + return diag.FromErr(err) + } + + firewallruleid, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + if err != nil { + return diag.FromErr(err) + } + opt := cisClient.NewDeleteFirewallRulesOptions(xAuthtoken, crn, zoneID, firewallruleid) + _, response, err := cisClient.DeleteFirewallRulesWithContext(context, opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting the custom resolver %s:%s", err, response)) + } + + d.SetId("") + return nil +} +func ResourceIBMCISFirewallrulesValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisFirewallrulesAction, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "log, allow, challenge, js_challenge, block"}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisFirewallrulesDescription, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "Firewallrules-creation"}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisFirewallrulesPriority, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, + Optional: true, + MinValue: "1", + MaxValue: "2147483647"}) + ibmCISFirewallrulesResourceValidator := validate.ResourceValidator{ResourceName: ibmCISFirewallrules, Schema: validateSchema} + return &ibmCISFirewallrulesResourceValidator +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_global_load_balancer.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_global_load_balancer.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_global_load_balancer.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_global_load_balancer.go index f46f5a38bd..8844ee3220 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_global_load_balancer.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_global_load_balancer.go @@ -1,12 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -32,7 +35,7 @@ const ( cisGLBModifiedOn = "modified_on" ) -func resourceIBMCISGlb() *schema.Resource { +func ResourceIBMCISGlb() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -85,7 +88,7 @@ func resourceIBMCISGlb() *schema.Resource { cisGLBSteeringPolicy: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"off", "geo", "random", "dynamic_latency"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"off", "geo", "random", "dynamic_latency"}), Description: "Steering policy info", }, cisGLBProxied: { @@ -100,7 +103,7 @@ func resourceIBMCISGlb() *schema.Resource { Optional: true, Default: "none", // Set to cookie when proxy=true - ValidateFunc: validateAllowedStringValue([]string{"none", "cookie"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"none", "cookie"}), Description: "Session affinity info", }, cisGLBEnabled: { @@ -166,26 +169,27 @@ func resourceIBMCISGlb() *schema.Resource { Create: resourceCISGlbCreate, Read: resourceCISGlbRead, Update: resourceCISGlbUpdate, + Exists: resourceCISGlbExists, Delete: resourceCISGlbDelete, Importer: &schema.ResourceImporter{}, } } func resourceCISGlbCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) - tfDefaultPoolIds := expandStringList(d.Get(cisGLBDefaultPoolIDs).(*schema.Set).List()) - defaultPoolIds, _, err := convertTfToCisTwoVarSlice(tfDefaultPoolIds) + tfDefaultPoolIds := flex.ExpandStringList(d.Get(cisGLBDefaultPoolIDs).(*schema.Set).List()) + defaultPoolIds, _, _ := flex.ConvertTfToCisTwoVarSlice(tfDefaultPoolIds) fbPoolID := d.Get(cisGLBFallbackPoolID).(string) - fallbackPool, _, err := convertTftoCisTwoVar(fbPoolID) + fallbackPool, _, _ := flex.ConvertTftoCisTwoVar(fbPoolID) opt := cisClient.NewCreateLoadBalancerOptions() opt.SetName(d.Get(cisGLBName).(string)) @@ -221,18 +225,18 @@ func resourceCISGlbCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("Create GLB failed %s\n", resp) return err } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) return resourceCISGlbUpdate(d, meta) } func resourceCISGlbRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBClientSession() if err != nil { return err } // Extract CIS Ids from TF Id - glbID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + glbID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -252,9 +256,9 @@ func resourceCISGlbRead(d *schema.ResourceData, meta interface{}) error { d.Set(cisDomainID, zoneID) d.Set(cisGLBID, glbObj.ID) d.Set(cisGLBName, glbObj.Name) - d.Set(cisGLBDefaultPoolIDs, convertCisToTfTwoVarSlice(glbObj.DefaultPools, crn)) + d.Set(cisGLBDefaultPoolIDs, flex.ConvertCisToTfTwoVarSlice(glbObj.DefaultPools, crn)) d.Set(cisGLBDesc, glbObj.Description) - d.Set(cisGLBFallbackPoolID, convertCisToTfTwoVar(*glbObj.FallbackPool, crn)) + d.Set(cisGLBFallbackPoolID, flex.ConvertCisToTfTwoVar(*glbObj.FallbackPool, crn)) d.Set(cisGLBTTL, glbObj.TTL) d.Set(cisGLBSessionAffinity, glbObj.SessionAffinity) d.Set(cisGLBProxied, glbObj.Proxied) @@ -271,12 +275,12 @@ func resourceCISGlbRead(d *schema.ResourceData, meta interface{}) error { } func resourceCISGlbUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBClientSession() if err != nil { return err } // Extract CIS Ids from TF Id - glbID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + glbID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -289,10 +293,10 @@ func resourceCISGlbUpdate(d *schema.ResourceData, meta interface{}) error { d.HasChange(cisGLBTTL) || d.HasChange(cisGLBEnabled) || d.HasChange(cisGLBPopPools) || d.HasChange(cisGLBRegionPools) || d.HasChange(cisGLBSteeringPolicy) { - tfDefaultPools := expandStringList(d.Get(cisGLBDefaultPoolIDs).(*schema.Set).List()) - defaultPoolIds, _, err := convertTfToCisTwoVarSlice(tfDefaultPools) + tfDefaultPools := flex.ExpandStringList(d.Get(cisGLBDefaultPoolIDs).(*schema.Set).List()) + defaultPoolIds, _, _ := flex.ConvertTfToCisTwoVarSlice(tfDefaultPools) fbPoolID := d.Get(cisGLBFallbackPoolID).(string) - fallbackPool, _, _ := convertTftoCisTwoVar(fbPoolID) + fallbackPool, _, _ := flex.ConvertTftoCisTwoVar(fbPoolID) opt := cisClient.NewEditLoadBalancerOptions(glbID) opt.SetName(d.Get(cisGLBName).(string)) @@ -339,12 +343,12 @@ func resourceCISGlbUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceCISGlbDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBClientSession() if err != nil { return err } // Extract CIS Ids from TF Id - glbID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + glbID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -362,12 +366,12 @@ func resourceCISGlbDelete(d *schema.ResourceData, meta interface{}) error { } func resourceCISGlbExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisGLBClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBClientSession() if err != nil { return false, err } // Extract CIS Ids from TF Id - glbID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + glbID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return false, err } @@ -394,8 +398,8 @@ func expandGeoPools(pool interface{}, geoType string) (map[string][]string, erro locationConfig := v.(map[string]interface{}) location := locationConfig[geoType].(string) if _, p := expandPool[location]; !p { - geoPools := expandStringList(locationConfig[cisGLBRegionPoolsPoolIDs].([]interface{})) - expandPool[location], _, _ = convertTfToCisTwoVarSlice(geoPools) + geoPools := flex.ExpandStringList(locationConfig[cisGLBRegionPoolsPoolIDs].([]interface{})) + expandPool[location], _, _ = flex.ConvertTfToCisTwoVarSlice(geoPools) } else { return nil, fmt.Errorf("duplicate entry specified for %s pool in location %q. "+ "each location must only be specified once", geoType, location) @@ -407,7 +411,7 @@ func expandGeoPools(pool interface{}, geoType string) (map[string][]string, erro func flattenPools(pools interface{}, geoType string, cisID string) []interface{} { result := make([]interface{}, 0) for k, v := range pools.(map[string]interface{}) { - poolIds := convertCisToTfTwoVarSlice(expandStringList(v.([]interface{})), cisID) + poolIds := flex.ConvertCisToTfTwoVarSlice(flex.ExpandStringList(v.([]interface{})), cisID) pool := map[string]interface{}{ geoType: k, cisGLBPopPoolsPoolIDs: poolIds, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_healthcheck.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_healthcheck.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_healthcheck.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_healthcheck.go index 5dbebf1b67..ff991fe861 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_healthcheck.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_healthcheck.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -32,7 +35,7 @@ const ( cisGLBHealthCheckHeadersValues = "values" ) -func resourceIBMCISHealthCheck() *schema.Resource { +func ResourceIBMCISHealthCheck() *schema.Resource { return &schema.Resource{ Create: resourceCISHealthCheckCreate, @@ -58,7 +61,7 @@ func resourceIBMCISHealthCheck() *schema.Resource { Description: "path", Optional: true, Default: "/", - ValidateFunc: validateURLPath, + ValidateFunc: validate.ValidateURLPath, }, cisGLBHealthCheckExpectedBody: { Type: schema.TypeString, @@ -81,35 +84,35 @@ func resourceIBMCISHealthCheck() *schema.Resource { Description: "type", Optional: true, Default: "http", - ValidateFunc: InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckType), + ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckType), }, cisGLBHealthCheckMethod: { Type: schema.TypeString, Description: "method", Optional: true, Default: "GET", - ValidateFunc: InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckMethod), + ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckMethod), }, cisGLBHealthCheckTimeout: { Type: schema.TypeInt, Description: "timeout", Optional: true, Default: 5, - ValidateFunc: InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckTimeout), + ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckTimeout), }, cisGLBHealthCheckRetries: { Type: schema.TypeInt, Description: "retries", Optional: true, Default: 2, - ValidateFunc: InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckRetries), + ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckRetries), }, cisGLBHealthCheckInterval: { Type: schema.TypeInt, Description: "interval", Optional: true, Default: 60, - ValidateFunc: InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckInterval), + ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckInterval), }, cisGLBHealthCheckFollowRedirects: { Type: schema.TypeBool, @@ -136,7 +139,7 @@ func resourceIBMCISHealthCheck() *schema.Resource { Description: "port number", Computed: true, Optional: true, - ValidateFunc: InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckPort), + ValidateFunc: validate.InvokeValidator(ibmCISHealthCheck, cisGLBHealthCheckPort), }, cisGLBHealthCheckHeaders: { Type: schema.TypeSet, @@ -163,63 +166,63 @@ func resourceIBMCISHealthCheck() *schema.Resource { } } -func resourceIBMCISHealthCheckValidator() *ResourceValidator { +func ResourceIBMCISHealthCheckValidator() *validate.ResourceValidator { healthCheckTypes := "http, https, tcp" methods := "GET, HEAD" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisGLBHealthCheckType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: healthCheckTypes}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisGLBHealthCheckMethod, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: methods}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisGLBHealthCheckTimeout, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "1", MaxValue: "10"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisGLBHealthCheckRetries, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "1", MaxValue: "3"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisGLBHealthCheckInterval, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "5", MaxValue: "3600"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisGLBHealthCheckPort, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "1", MaxValue: "65535"}) - cisHealthCheckValidator := ResourceValidator{ResourceName: ibmCISHealthCheck, Schema: validateSchema} + cisHealthCheckValidator := validate.ResourceValidator{ResourceName: ibmCISHealthCheck, Schema: validateSchema} return &cisHealthCheckValidator } func resourceCISHealthCheckCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisGLBHealthCheckClientSession() + sess, err := meta.(conns.ClientSession).CisGLBHealthCheckClientSession() if err != nil { return err } @@ -275,17 +278,17 @@ func resourceCISHealthCheckCreate(d *schema.ResourceData, meta interface{}) erro return err } log.Printf("global load balancer created successfully : %s", *result.Result.ID) - d.SetId(convertCisToTfTwoVar(*result.Result.ID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(*result.Result.ID, crn)) return resourceCISHealthCheckRead(d, meta) } func resourceCISHealthCheckRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisGLBHealthCheckClientSession() + sess, err := meta.(conns.ClientSession).CisGLBHealthCheckClientSession() if err != nil { return err } - monitorID, crn, err := convertTftoCisTwoVar(d.Id()) + monitorID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -322,12 +325,12 @@ func resourceCISHealthCheckRead(d *schema.ResourceData, meta interface{}) error } func resourceCISHealthCheckUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisGLBHealthCheckClientSession() + sess, err := meta.(conns.ClientSession).CisGLBHealthCheckClientSession() if err != nil { return err } - monitorID, crn, err := convertTftoCisTwoVar(d.Id()) + monitorID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -398,12 +401,12 @@ func resourceCISHealthCheckUpdate(d *schema.ResourceData, meta interface{}) erro } func resourceCISHealthCheckDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).CisGLBHealthCheckClientSession() + sess, err := meta.(conns.ClientSession).CisGLBHealthCheckClientSession() if err != nil { return err } - monitorID, crn, err := convertTftoCisTwoVar(d.Id()) + monitorID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -421,12 +424,12 @@ func resourceCISHealthCheckDelete(d *schema.ResourceData, meta interface{}) erro } func resourceCISHealthCheckExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).CisGLBHealthCheckClientSession() + sess, err := meta.(conns.ClientSession).CisGLBHealthCheckClientSession() if err != nil { return false, err } - monitorID, crn, err := convertTftoCisTwoVar(d.Id()) + monitorID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return false, err } @@ -460,7 +463,7 @@ func expandLoadBalancerMonitorHeader(cfgSet interface{}) map[string][]string { for _, item := range cfgList { cfg := item.(map[string]interface{}) header[cfg[cisGLBHealthCheckHeadersHeader].(string)] = - expandStringList(cfg[cisGLBHealthCheckHeadersValues].(*schema.Set).List()) + flex.ExpandStringList(cfg[cisGLBHealthCheckHeadersValues].(*schema.Set).List()) } return header } @@ -470,7 +473,7 @@ func flattenLoadBalancerMonitorHeader(header map[string][]string) *schema.Set { for k, v := range header { cfg := map[string]interface{}{ cisGLBHealthCheckHeadersHeader: k, - cisGLBHealthCheckHeadersValues: schema.NewSet(schema.HashString, flattenStringList(v)), + cisGLBHealthCheckHeadersValues: schema.NewSet(schema.HashString, flex.FlattenStringList(v)), } flattened = append(flattened, cfg) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_origin_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_origin_pool.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_origin_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_origin_pool.go index 9cbccf3758..554fbeef6b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_origin_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_origin_pool.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -34,7 +36,7 @@ const ( cisGLBPoolOriginsFailureReason = "failure_reason" ) -func resourceIBMCISPool() *schema.Resource { +func ResourceIBMCISPool() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -157,7 +159,7 @@ func resourceIBMCISPool() *schema.Resource { func resourceCISPoolCreate(d *schema.ResourceData, meta interface{}) error { var regions []string - cisClient, err := meta.(ClientSession).CisGLBPoolClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBPoolClientSession() if err != nil { return err } @@ -195,7 +197,7 @@ func resourceCISPoolCreate(d *schema.ResourceData, meta interface{}) error { opt.SetNotificationEmail(notifEmail.(string)) } if monitor, ok := d.GetOk(cisGLBPoolMonitor); ok { - monitorID, _, _ := convertTftoCisTwoVar(monitor.(string)) + monitorID, _, _ := flex.ConvertTftoCisTwoVar(monitor.(string)) opt.SetMonitor(monitorID) } if minOrigins, ok := d.GetOk(cisGLBPoolMinimumOrigins); ok { @@ -211,16 +213,16 @@ func resourceCISPoolCreate(d *schema.ResourceData, meta interface{}) error { return err } //Set unique TF Id from concatenated CIS Ids - d.SetId(convertCisToTfTwoVar(*result.Result.ID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(*result.Result.ID, crn)) return resourceCISPoolRead(d, meta) } func resourceCISPoolRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBPoolClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBPoolClientSession() if err != nil { return err } - poolID, crn, err := convertTftoCisTwoVar(d.Id()) + poolID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -252,11 +254,11 @@ func resourceCISPoolRead(d *schema.ResourceData, meta interface{}) error { } func resourceCISPoolUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBPoolClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBPoolClientSession() if err != nil { return err } - poolID, crn, err := convertTftoCisTwoVar(d.Id()) + poolID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -272,7 +274,7 @@ func resourceCISPoolUpdate(d *schema.ResourceData, meta interface{}) error { opt := cisClient.NewEditLoadBalancerPoolOptions(poolID) if monitor, ok := d.GetOk(cisGLBPoolMonitor); ok { - monitorID, _, _ := convertTftoCisTwoVar(monitor.(string)) + monitorID, _, _ := flex.ConvertTftoCisTwoVar(monitor.(string)) opt.SetMonitor(monitorID) } @@ -325,11 +327,11 @@ func resourceCISPoolUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceCISPoolDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisGLBPoolClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBPoolClientSession() if err != nil { return err } - poolID, crn, err := convertTftoCisTwoVar(d.Id()) + poolID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return err } @@ -345,11 +347,11 @@ func resourceCISPoolDelete(d *schema.ResourceData, meta interface{}) error { } func resourceCISPoolExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisGLBPoolClientSession() + cisClient, err := meta.(conns.ClientSession).CisGLBPoolClientSession() if err != nil { return false, err } - poolID, cisID, err := convertTftoCisTwoVar(d.Id()) + poolID, cisID, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_page_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_page_rule.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_page_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_page_rule.go index 720322b2e8..d92fdbf462 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_page_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_page_rule.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" cispagerulev1 "github.com/IBM/networking-go-sdk/pageruleapiv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -39,7 +42,7 @@ const ( cisPageRuleActionsMinifyJS = "js" ) -func resourceIBMCISPageRule() *schema.Resource { +func ResourceIBMCISPageRule() *schema.Resource { return &schema.Resource{ Create: resourceCISPageRuleCreate, Read: resourceCISPageRuleRead, @@ -74,7 +77,7 @@ func resourceIBMCISPageRule() *schema.Resource { Description: "Page Rule status", Optional: true, Default: "disabled", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISPageRule, cisPageRuleStatus), }, cisPageRuleTargets: { @@ -121,7 +124,7 @@ func resourceIBMCISPageRule() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Page rule target url", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( ibmCISPageRule, cisPageRuleActionsID), }, cisPageRuleActionsValue: { @@ -161,7 +164,7 @@ func resourceIBMCISPageRule() *schema.Resource { } } -func resourceCISPageRuleValidator() *ResourceValidator { +func ResourceIBMCISPageRuleValidator() *validate.ResourceValidator { actions := "disable_security, always_use_https, always_online, ssl, browser_cache_ttl, " + "security_level, cache_level, edge_cache_ttl, bypass_cache_on_cookie, " + "browser_check, server_side_exclude, serve_stale_content, email_obfuscation, " + @@ -172,34 +175,34 @@ func resourceCISPageRuleValidator() *ResourceValidator { "response_buffering, image_size_optimization, script_load_optimization, " + "true_client_ip_header, sort_query_string_for_cache, respect_strong_etag,minify" status := "active, disabled" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisPageRuleActionsID, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: actions}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisPageRuleStatus, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: status}) - cisPageRuleValidator := ResourceValidator{ResourceName: ibmCISPageRule, Schema: validateSchema} + cisPageRuleValidator := validate.ResourceValidator{ResourceName: ibmCISPageRule, Schema: validateSchema} return &cisPageRuleValidator } func resourceCISPageRuleCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisPageRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisPageRuleClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) @@ -221,16 +224,16 @@ func resourceCISPageRuleCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("Create page rule failed: %v", response) return err } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) return resourceCISPageRuleRead(d, meta) } func resourceCISPageRuleRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisPageRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisPageRuleClientSession() if err != nil { return err } - ruleID, zoneID, crn, err := convertTfToCisThreeVar(d.Id()) + ruleID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -253,12 +256,12 @@ func resourceCISPageRuleRead(d *schema.ResourceData, meta interface{}) error { return nil } func resourceCISPageRuleUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisPageRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisPageRuleClientSession() if err != nil { return err } - ruleID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + ruleID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) @@ -290,12 +293,12 @@ func resourceCISPageRuleUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceCISPageRuleDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisPageRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisPageRuleClientSession() if err != nil { return err } - ruleID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + ruleID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) opt := cisClient.NewDeletePageRuleOptions(ruleID) @@ -308,12 +311,12 @@ func resourceCISPageRuleDelete(d *schema.ResourceData, meta interface{}) error { } func resourceCISPageRuleExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisPageRuleClientSession() + cisClient, err := meta.(conns.ClientSession).CisPageRuleClientSession() if err != nil { return false, err } - ruleID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + ruleID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) @@ -367,7 +370,6 @@ func expandCISPageRuleActions(actions interface{}) []cispagerulev1.PageRulesBody ID: &id, } actionsOutput = append(actionsOutput, actionItem) - break case cisPageRuleActionsIDBrowserCacheTTL, cisPageRuleActionsIDEdgeCacheTTL: @@ -378,7 +380,6 @@ func expandCISPageRuleActions(actions interface{}) []cispagerulev1.PageRulesBody Value: &value, } actionsOutput = append(actionsOutput, actionItem) - break case cisPageRuleActionsIDForwardingURL: forwardingURL := instance[cisPageRuleActionsValueURL].(string) statusCode := instance[cisPageRuleActionsValueStatusCode].(int) @@ -391,7 +392,6 @@ func expandCISPageRuleActions(actions interface{}) []cispagerulev1.PageRulesBody Value: &value, } actionsOutput = append(actionsOutput, actionItem) - break case cisPageRuleActionsIDMinify: Value := make(map[string]interface{}) Value["css"] = instance[cisPageRuleActionsMinifyCSS].(string) @@ -402,7 +402,6 @@ func expandCISPageRuleActions(actions interface{}) []cispagerulev1.PageRulesBody Value: &Value, } actionsOutput = append(actionsOutput, actionItem) - break default: value = instance[cisPageRuleActionsValue] actionItem := &cispagerulev1.PageRulesBodyActionsItem{ diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_range_app.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_range_app.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_range_app.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_range_app.go index f0ce3c2806..58f9cc0a98 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_range_app.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_range_app.go @@ -1,12 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" cisrangeappv1 "github.com/IBM/networking-go-sdk/rangeapplicationsv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -46,13 +49,13 @@ const ( cisRangeAppModifiedOn = "modified_on" ) -func resourceIBMCISRangeApp() *schema.Resource { +func ResourceIBMCISRangeApp() *schema.Resource { return &schema.Resource{ - Create: resourceIBMCISRangeAppCreate, - Read: resourceIBMCISRangeAppRead, - Update: resourceIBMCISRangeAppUpdate, - Delete: resourceIBMCISRangeAppDelete, - Exists: resourceIBMCISRangeAppExists, + Create: ResourceIBMCISRangeAppCreate, + Read: ResourceIBMCISRangeAppRead, + Update: ResourceIBMCISRangeAppUpdate, + Delete: ResourceIBMCISRangeAppDelete, + Exists: ResourceIBMCISRangeAppExists, Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ cisID: { @@ -116,35 +119,35 @@ func resourceIBMCISRangeApp() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "Allows for the true client IP to be passed to the service.", - ValidateFunc: InvokeValidator(ibmCISRangeApp, cisRangeAppProtocol), + ValidateFunc: validate.InvokeValidator(ibmCISRangeApp, cisRangeAppProtocol), }, cisRangeAppEdgeIPsType: { Type: schema.TypeString, Optional: true, Default: cisRangeAppEdgeIPsTypeDynamic, Description: "The type of edge IP configuration.", - ValidateFunc: InvokeValidator(ibmCISRangeApp, cisRangeAppEdgeIPsType), + ValidateFunc: validate.InvokeValidator(ibmCISRangeApp, cisRangeAppEdgeIPsType), }, cisRangeAppEdgeIPsConnectivity: { Type: schema.TypeString, Optional: true, Default: cisRangeAppEdgeIPsConnectivityAll, Description: "Specifies the IP version.", - ValidateFunc: InvokeValidator(ibmCISRangeApp, cisRangeAppEdgeIPsConnectivity), + ValidateFunc: validate.InvokeValidator(ibmCISRangeApp, cisRangeAppEdgeIPsConnectivity), }, cisRangeAppTrafficType: { Type: schema.TypeString, Optional: true, Default: cisRangeAppTrafficTypeDirect, Description: "Configure how traffic is handled at the edge.", - ValidateFunc: InvokeValidator(ibmCISRangeApp, cisRangeAppTrafficType), + ValidateFunc: validate.InvokeValidator(ibmCISRangeApp, cisRangeAppTrafficType), }, cisRangeAppTLS: { Type: schema.TypeString, Optional: true, Default: cisRangeAppTLSOff, Description: "Configure if and how TLS connections are terminated at the edge.", - ValidateFunc: InvokeValidator(ibmCISRangeApp, cisRangeAppTLS), + ValidateFunc: validate.InvokeValidator(ibmCISRangeApp, cisRangeAppTLS), }, cisRangeAppCreatedOn: { Type: schema.TypeString, @@ -159,60 +162,60 @@ func resourceIBMCISRangeApp() *schema.Resource { }, } } -func resourceIBMCISRangeAppValidator() *ResourceValidator { +func ResourceIBMCISRangeAppValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) proxyProtocol := "off, v1, v2, simple" connectivity := "ipv4, ipv6, all" trafficType := "direct, http, https" tls := "off, flexible, full, strict" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRangeAppProxyProtocol, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: proxyProtocol}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRangeAppEdgeIPsConnectivity, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: connectivity}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRangeAppEdgeIPsType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "dynamic"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRangeAppTrafficType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: trafficType}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRangeAppTLS, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: tls}) - ibmCISRangeAppResourceValidator := ResourceValidator{ResourceName: ibmCISRangeApp, Schema: validateSchema} + ibmCISRangeAppResourceValidator := validate.ResourceValidator{ResourceName: ibmCISRangeApp, Schema: validateSchema} return &ibmCISRangeAppResourceValidator } -func resourceIBMCISRangeAppCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRangeAppClientSession() +func ResourceIBMCISRangeAppCreate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRangeAppClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -228,7 +231,7 @@ func resourceIBMCISRangeAppCreate(d *schema.ResourceData, meta interface{}) erro opt := cisClient.NewCreateRangeAppOptions(protocol, dnsOpt) if v, ok := d.GetOk(cisRangeAppOriginDirect); ok { - opt.SetOriginDirect(expandStringList(v.([]interface{}))) + opt.SetOriginDirect(flex.ExpandStringList(v.([]interface{}))) } if v, ok := d.GetOk(cisRangeAppOriginDNS); ok { originDNSOpt := &cisrangeappv1.RangeAppReqOriginDns{ @@ -264,26 +267,26 @@ func resourceIBMCISRangeAppCreate(d *schema.ResourceData, meta interface{}) erro result, resp, err := cisClient.CreateRangeApp(opt) if err != nil { - return fmt.Errorf("Failed to create range application: %v", resp) + return fmt.Errorf("[ERROR] Failed to create range application: %v", resp) } - d.SetId(convertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) - return resourceIBMCISRangeAppRead(d, meta) + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + return ResourceIBMCISRangeAppRead(d, meta) } -func resourceIBMCISRangeAppRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRangeAppClientSession() +func ResourceIBMCISRangeAppRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRangeAppClientSession() if err != nil { return err } - rangeAppID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + rangeAppID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewGetRangeAppOptions(rangeAppID) result, resp, err := cisClient.GetRangeApp(opt) if err != nil { - return fmt.Errorf("Failed to read range application: %v", resp) + return fmt.Errorf("[ERROR] Failed to read range application: %v", resp) } d.Set(cisID, crn) d.Set(cisDomainID, zoneID) @@ -291,7 +294,7 @@ func resourceIBMCISRangeAppRead(d *schema.ResourceData, meta interface{}) error d.Set(cisRangeAppProtocol, result.Result.Protocol) d.Set(cisRangeAppDNSType, result.Result.Dns.Type) d.Set(cisRangeAppDNS, result.Result.Dns.Name) - d.Set(cisRangeAppOriginDirect, flattenStringList(result.Result.OriginDirect)) + d.Set(cisRangeAppOriginDirect, flex.FlattenStringList(result.Result.OriginDirect)) d.Set(cisRangeAppProxyProtocol, result.Result.ProxyProtocol) d.Set(cisRangeAppIPFirewall, result.Result.IpFirewall) d.Set(cisRangeAppTrafficType, result.Result.TrafficType) @@ -303,8 +306,8 @@ func resourceIBMCISRangeAppRead(d *schema.ResourceData, meta interface{}) error return nil } -func resourceIBMCISRangeAppUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRangeAppClientSession() +func ResourceIBMCISRangeAppUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRangeAppClientSession() if err != nil { return err } @@ -319,7 +322,7 @@ func resourceIBMCISRangeAppUpdate(d *schema.ResourceData, meta interface{}) erro d.HasChange(cisRangeAppTLS) || d.HasChange(cisRangeAppTrafficType) { - rangeAppID, zoneID, crn, _ := convertTfToCisThreeVar(d.Id()) + rangeAppID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) protocol := d.Get(cisRangeAppProtocol).(string) @@ -334,7 +337,7 @@ func resourceIBMCISRangeAppUpdate(d *schema.ResourceData, meta interface{}) erro opt := cisClient.NewUpdateRangeAppOptions(rangeAppID, protocol, dnsOpt) if v, ok := d.GetOk(cisRangeAppOriginDirect); ok { - opt.SetOriginDirect(expandStringList(v.([]interface{}))) + opt.SetOriginDirect(flex.ExpandStringList(v.([]interface{}))) } if v, ok := d.GetOk(cisRangeAppOriginDNS); ok { originDNSOpt := &cisrangeappv1.RangeAppReqOriginDns{ @@ -369,35 +372,35 @@ func resourceIBMCISRangeAppUpdate(d *schema.ResourceData, meta interface{}) erro } _, resp, err := cisClient.UpdateRangeApp(opt) if err != nil { - return fmt.Errorf("Failed to update range application: %v", resp) + return fmt.Errorf("[ERROR] Failed to update range application: %v", resp) } } - return resourceIBMCISRangeAppRead(d, meta) + return ResourceIBMCISRangeAppRead(d, meta) } -func resourceIBMCISRangeAppDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRangeAppClientSession() +func ResourceIBMCISRangeAppDelete(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRangeAppClientSession() if err != nil { return err } - rangeAppID, zoneID, cisID, _ := convertTfToCisThreeVar(d.Id()) + rangeAppID, zoneID, cisID, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewDeleteRangeAppOptions(rangeAppID) _, resp, err := cisClient.DeleteRangeApp(opt) if err != nil { - return fmt.Errorf("Failed to delete range application: %v", resp) + return fmt.Errorf("[ERROR] Failed to delete range application: %v", resp) } return nil } -func resourceIBMCISRangeAppExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisRangeAppClientSession() +func ResourceIBMCISRangeAppExists(d *schema.ResourceData, meta interface{}) (bool, error) { + cisClient, err := meta.(conns.ClientSession).CisRangeAppClientSession() if err != nil { return false, err } - rangeAppID, zoneID, cisID, _ := convertTfToCisThreeVar(d.Id()) + rangeAppID, zoneID, cisID, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewGetRangeAppOptions(rangeAppID) @@ -407,7 +410,7 @@ func resourceIBMCISRangeAppExists(d *schema.ResourceData, meta interface{}) (boo log.Println("range application is not found") return false, nil } - return false, fmt.Errorf("Failed to getting existing range application: %v", err) + return false, fmt.Errorf("[ERROR] Failed to getting existing range application: %v", err) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_rate_limit.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_rate_limit.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_rate_limit.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_rate_limit.go index 818e648db5..6b2724660c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_rate_limit.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_rate_limit.go @@ -1,12 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/networking-go-sdk/zoneratelimitsv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -21,13 +24,13 @@ const ( cisRLURL = "url" ) -func resourceIBMCISRateLimit() *schema.Resource { +func ResourceIBMCISRateLimit() *schema.Resource { return &schema.Resource{ - Create: resourceIBMCISRateLimitCreate, - Read: resourceIBMCISRateLimitRead, - Update: resourceIBMCISRateLimitUpdate, - Delete: resourceIBMCISRateLimitDelete, - Exists: resourceIBMCISRateLimitExists, + Create: ResourceIBMCISRateLimitCreate, + Read: ResourceIBMCISRateLimitRead, + Update: ResourceIBMCISRateLimitUpdate, + Delete: ResourceIBMCISRateLimitDelete, + Exists: ResourceIBMCISRateLimitExists, Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ "cis_id": { @@ -50,7 +53,7 @@ func resourceIBMCISRateLimit() *schema.Resource { cisRLDescription: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", cisRLDescription), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", cisRLDescription), Description: "A note that you can use to describe the reason for a rate limiting rule.", }, "bypass": { @@ -76,13 +79,13 @@ func resourceIBMCISRateLimit() *schema.Resource { cisRLThreshold: { Type: schema.TypeInt, Required: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", cisRLThreshold), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", cisRLThreshold), Description: "Rate Limiting Threshold", }, cisRLPeriod: { Type: schema.TypeInt, Required: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", cisRLPeriod), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", cisRLPeriod), Description: "Rate Limiting Period", }, "correlate": { @@ -96,7 +99,7 @@ func resourceIBMCISRateLimit() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "nat", - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", "by"), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", "by"), Description: "Whether to enable NAT based rate limiting", }, }, @@ -113,13 +116,13 @@ func resourceIBMCISRateLimit() *schema.Resource { "mode": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", "mode"), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", "mode"), Description: "Type of action performed.Valid values are: 'simulate', 'ban', 'challenge', 'js_challenge'.", }, "timeout": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", cisRLTimeout), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", cisRLTimeout), Description: "The time to perform the mitigation action. Timeout be the same or greater than the period.", }, "response": { @@ -132,13 +135,13 @@ func resourceIBMCISRateLimit() *schema.Resource { "content_type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", "content_type"), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", "content_type"), Description: "Custom content-type and body to return. It must be one of following 'text/plain', 'text/xml', 'application/json'.", }, "body": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", cisRLBody), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", cisRLBody), Description: "The body to return. The content here must confirm to the 'content_type'", }, }, @@ -171,7 +174,7 @@ func resourceIBMCISRateLimit() *schema.Resource { Description: "HTTP Methos of matching request. It can be one or many. Example methods 'POST', 'PUT'", Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", "methods"), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", "methods"), }, }, "schemes": { @@ -181,7 +184,7 @@ func resourceIBMCISRateLimit() *schema.Resource { Description: "HTTP Schemes of matching request. It can be one or many. Example schemes 'HTTP', 'HTTPS'.", Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", "schemes"), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", "schemes"), }, }, "url": { @@ -189,7 +192,7 @@ func resourceIBMCISRateLimit() *schema.Resource { Optional: true, Computed: true, Description: "URL pattern of matching request", - ValidateFunc: InvokeValidator("ibm_cis_rate_limit", cisRLURL), + ValidateFunc: validate.InvokeValidator("ibm_cis_rate_limit", cisRLURL), }, }, }, @@ -250,9 +253,9 @@ func resourceIBMCISRateLimit() *schema.Resource { }, } } -func resourceIBMCISRateLimitValidator() *ResourceValidator { +func ResourceIBMCISRateLimitValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) byValues := "nat" modeValues := "simulate, ban, challenge, js_challenge" ctypeValues := "text/plain, text/xml, application/json" @@ -260,100 +263,100 @@ func resourceIBMCISRateLimitValidator() *ResourceValidator { schemeValues := "HTTP, HTTPS, _ALL_" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRLDescription, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, Optional: true, MinValueLength: 0, MaxValueLength: 1024}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRLThreshold, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "1", MaxValue: "1000000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRLPeriod, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "1", MaxValue: "86400"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "by", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: byValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "mode", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: modeValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "content_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: ctypeValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "methods", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: methodValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "schemes", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: schemeValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRLTimeout, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Optional: true, MinValue: "1", MaxValue: "86400"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRLBody, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, Optional: true, MinValueLength: 0, MaxValueLength: 10240}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisRLURL, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, Optional: true, MinValueLength: 0, MaxValueLength: 1024}) - ibmCISRateLimitResourceValidator := ResourceValidator{ResourceName: "ibm_cis_rate_limit", Schema: validateSchema} + ibmCISRateLimitResourceValidator := validate.ResourceValidator{ResourceName: "ibm_cis_rate_limit", Schema: validateSchema} return &ibmCISRateLimitResourceValidator } -func resourceIBMCISRateLimitCreate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRLClientSession() +func ResourceIBMCISRateLimitCreate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRLClientSession() if err != nil { return err } cisID := d.Get("cis_id").(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get("domain_id").(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get("domain_id").(string)) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -372,13 +375,13 @@ func resourceIBMCISRateLimitCreate(d *schema.ResourceData, meta interface{}) err action, err := expandRateLimitAction(d) if err != nil { - return fmt.Errorf("Error in getting action from expandRateLimitAction %s", err) + return fmt.Errorf("[ERROR] Error in getting action from expandRateLimitAction %s", err) } opt.SetAction(action) match, err := expandRateLimitMatch(d) if err != nil { - return fmt.Errorf("Error in getting match from expandRateLimitMatch %s", err) + return fmt.Errorf("[ERROR] Error in getting match from expandRateLimitMatch %s", err) } opt.SetMatch(match) @@ -389,26 +392,26 @@ func resourceIBMCISRateLimitCreate(d *schema.ResourceData, meta interface{}) err byPass, err := expandRateLimitBypass(d) if err != nil { - return fmt.Errorf("Error in getting bypass from expandRateLimitBypass %s", err) + return fmt.Errorf("[ERROR] Error in getting bypass from expandRateLimitBypass %s", err) } opt.SetBypass(byPass) //creating rate limit rule result, resp, err := cisClient.CreateZoneRateLimits(opt) if err != nil { - return fmt.Errorf("Failed to create RateLimit: %v", resp) + return fmt.Errorf("[ERROR] Failed to create RateLimit: %v", resp) } record := result.Result - d.SetId(convertCisToTfThreeVar(*record.ID, zoneID, cisID)) - return resourceIBMCISRateLimitRead(d, meta) + d.SetId(flex.ConvertCisToTfThreeVar(*record.ID, zoneID, cisID)) + return ResourceIBMCISRateLimitRead(d, meta) } -func resourceIBMCISRateLimitRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRLClientSession() +func ResourceIBMCISRateLimitRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRLClientSession() if err != nil { return err } - recordID, zoneID, cisID, _ := convertTfToCisThreeVar(d.Id()) + recordID, zoneID, cisID, _ := flex.ConvertTfToCisThreeVar(d.Id()) if err != nil { return err } @@ -417,7 +420,7 @@ func resourceIBMCISRateLimitRead(d *schema.ResourceData, meta interface{}) error opt := cisClient.NewGetRateLimitOptions(recordID) result, resp, err := cisClient.GetRateLimit(opt) if err != nil { - return fmt.Errorf("Failed to read RateLimit: %v", resp) + return fmt.Errorf("[ERROR] Failed to read RateLimit: %v", resp) } rule := result.Result @@ -436,13 +439,13 @@ func resourceIBMCISRateLimitRead(d *schema.ResourceData, meta interface{}) error return nil } -func resourceIBMCISRateLimitUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRLClientSession() +func ResourceIBMCISRateLimitUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRLClientSession() if err != nil { return err } - recordID, zoneID, cisID, _ := convertTfToCisThreeVar(d.Id()) + recordID, zoneID, cisID, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -469,13 +472,13 @@ func resourceIBMCISRateLimitUpdate(d *schema.ResourceData, meta interface{}) err action, err := expandRateLimitAction(d) if err != nil { - return fmt.Errorf("Error in getting action from expandRateLimitAction %s", err) + return fmt.Errorf("[ERROR] Error in getting action from expandRateLimitAction %s", err) } opt.SetAction(action) match, err := expandRateLimitMatch(d) if err != nil { - return fmt.Errorf("Error in getting match from expandRateLimitMatch %s", err) + return fmt.Errorf("[ERROR] Error in getting match from expandRateLimitMatch %s", err) } opt.SetMatch(match) @@ -486,41 +489,41 @@ func resourceIBMCISRateLimitUpdate(d *schema.ResourceData, meta interface{}) err byPass, err := expandRateLimitBypass(d) if err != nil { - return fmt.Errorf("Error in getting bypass from expandRateLimitBypass %s", err) + return fmt.Errorf("[ERROR] Error in getting bypass from expandRateLimitBypass %s", err) } opt.SetBypass(byPass) _, resp, err := cisClient.UpdateRateLimit(opt) if err != nil { - return fmt.Errorf("Failed to update RateLimit: %v", resp) + return fmt.Errorf("[ERROR] Failed to update RateLimit: %v", resp) } } - d.SetId(convertCisToTfThreeVar(recordID, zoneID, cisID)) - return resourceIBMCISRateLimitRead(d, meta) + d.SetId(flex.ConvertCisToTfThreeVar(recordID, zoneID, cisID)) + return ResourceIBMCISRateLimitRead(d, meta) } -func resourceIBMCISRateLimitDelete(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisRLClientSession() +func ResourceIBMCISRateLimitDelete(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRLClientSession() if err != nil { return err } - recordID, zoneID, cisID, _ := convertTfToCisThreeVar(d.Id()) + recordID, zoneID, cisID, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewDeleteZoneRateLimitOptions(recordID) _, resp, err := cisClient.DeleteZoneRateLimit(opt) if err != nil { - return fmt.Errorf("Failed to delete RateLimit: %v", resp) + return fmt.Errorf("[ERROR] Failed to delete RateLimit: %v", resp) } return nil } -func resourceIBMCISRateLimitExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cisClient, err := meta.(ClientSession).CisRLClientSession() +func ResourceIBMCISRateLimitExists(d *schema.ResourceData, meta interface{}) (bool, error) { + cisClient, err := meta.(conns.ClientSession).CisRLClientSession() if err != nil { return false, err } - recordID, zoneID, cisID, _ := convertTfToCisThreeVar(d.Id()) + recordID, zoneID, cisID, _ := flex.ConvertTfToCisThreeVar(d.Id()) cisClient.Crn = core.StringPtr(cisID) cisClient.ZoneIdentifier = core.StringPtr(zoneID) opt := cisClient.NewGetRateLimitOptions(recordID) @@ -530,7 +533,7 @@ func resourceIBMCISRateLimitExists(d *schema.ResourceData, meta interface{}) (bo log.Println("ratelimit is not found") return false, nil } - return false, fmt.Errorf("Failed to getting existing RateLimit: %v", err) + return false, fmt.Errorf("[ERROR] Failed to getting existing RateLimit: %v", err) } return true, nil } @@ -543,13 +546,12 @@ func expandRateLimitAction(d *schema.ResourceData) ( timeout := actionRecord["timeout"].(int) if timeout == 0 { if mode == "simulate" || mode == "ban" { - return action, fmt.Errorf("For the mode 'simulate' and 'ban' timeout must be %s %s", + return action, fmt.Errorf("[ERROR] For the mode 'simulate' and 'ban' timeout must be %s %s", "set.. valid range for timeout is 10 - 86400", err) } } else { if mode == "challenge" || mode == "js_challenge" { - return action, fmt.Errorf( - "Timeout field is only valid for 'simulate' and 'ban' modes. %s", err) + return action, fmt.Errorf("[ERROR] Timeout field is only valid for 'simulate' and 'ban' modes. %s", err) } } action.Mode = core.StringPtr(mode) @@ -756,7 +758,7 @@ func flattenRateLimitMatchResponse(response zoneratelimitsv1.RatelimitObjectMatc responseRecord["headers"] = headers flag = true } - if flag == true { + if flag { return []interface{}{responseRecord} } return []interface{}{} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_routing.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_routing.go new file mode 100644 index 0000000000..e56a0f1e8c --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_routing.go @@ -0,0 +1,117 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISRouting = "ibm_cis_routing" + cisRoutingSmartRouting = "smart_routing" +) + +func ResourceIBMCISRouting() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISRoutingUpdate, + Read: ResourceIBMCISRoutingRead, + Update: ResourceIBMCISRoutingUpdate, + Delete: ResourceIBMCISRoutingDelete, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Intance CRN", + }, + cisDomainID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Domain ID", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisRoutingSmartRouting: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Smart Routing value", + ValidateFunc: validate.InvokeValidator(ibmCISRouting, cisRoutingSmartRouting), + }, + }, + } +} + +func ResourceIBMCISRoutingValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + smartRoutingValues := "on, off" + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisRoutingSmartRouting, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: smartRoutingValues}) + ibmCISRoutingValidator := validate.ResourceValidator{ResourceName: ibmCISRouting, Schema: validateSchema} + return &ibmCISRoutingValidator +} + +func ResourceIBMCISRoutingUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRoutingClientSession() + if err != nil { + return err + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + + if d.HasChange(cisRoutingSmartRouting) { + smartRoutingValue := d.Get(cisRoutingSmartRouting).(string) + opt := cisClient.NewUpdateSmartRoutingOptions() + opt.SetValue(smartRoutingValue) + _, response, err := cisClient.UpdateSmartRouting(opt) + if err != nil { + log.Printf("Update smart route setting failed: %v", response) + return err + } + } + + d.SetId(flex.ConvertCisToTfTwoVar(zoneID, crn)) + return ResourceIBMCISRoutingRead(d, meta) +} + +func ResourceIBMCISRoutingRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisRoutingClientSession() + if err != nil { + return err + } + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneIdentifier = core.StringPtr(zoneID) + opt := cisClient.NewGetSmartRoutingOptions() + result, response, err := cisClient.GetSmartRouting(opt) + if err != nil { + log.Printf("Get smart route setting failed: %v", response) + return err + } + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisRoutingSmartRouting, *result.Result.Value) + return nil +} + +func ResourceIBMCISRoutingDelete(d *schema.ResourceData, meta interface{}) error { + // Nothing to delete on CIS resource + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_tls_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_tls_settings.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_tls_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_tls_settings.go index 124dc4373a..14acffd465 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_tls_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_tls_settings.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -18,7 +21,7 @@ const ( cisTLSSettingsMinTLSVersion = "min_tls_version" ) -func resourceIBMCISTLSSettings() *schema.Resource { +func ResourceIBMCISTLSSettings() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ cisID: { @@ -43,14 +46,14 @@ func resourceIBMCISTLSSettings() *schema.Resource { Description: "TLS 1.3 setting", Optional: true, Computed: true, - ValidateFunc: InvokeValidator(ibmCISTLSSettings, cisTLSSettingsTLS13), + ValidateFunc: validate.InvokeValidator(ibmCISTLSSettings, cisTLSSettingsTLS13), DiffSuppressFunc: suppressTLS13Diff, }, cisTLSSettingsMinTLSVersion: { Type: schema.TypeString, Description: "Minimum version of TLS required", Optional: true, - ValidateFunc: InvokeValidator(ibmCISTLSSettings, cisTLSSettingsMinTLSVersion), + ValidateFunc: validate.InvokeValidator(ibmCISTLSSettings, cisTLSSettingsMinTLSVersion), Default: "1.1", }, }, @@ -62,36 +65,36 @@ func resourceIBMCISTLSSettings() *schema.Resource { } } -func resourceIBMCISTLSSettingsValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMCISTLSSettingsValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisTLSSettingsTLS13, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "on, off, zrt"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisTLSSettingsMinTLSVersion, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "1.1, 1.2, 1.3, 1.4"}) - ibmCISTLSSettingsResourceValidator := ResourceValidator{ + ibmCISTLSSettingsResourceValidator := validate.ResourceValidator{ ResourceName: ibmCISTLSSettings, Schema: validateSchema} return &ibmCISTLSSettingsResourceValidator } func resourceCISTLSSettingsUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -124,7 +127,7 @@ func resourceCISTLSSettingsUpdate(d *schema.ResourceData, meta interface{}) erro // Minimum TLS version if minTLSVer, ok := d.GetOk(cisTLSSettingsMinTLSVersion); ok { - cisClient, err := meta.(ClientSession).CisDomainSettingsClientSession() + cisClient, err := meta.(conns.ClientSession).CisDomainSettingsClientSession() if err != nil { return err } @@ -139,16 +142,16 @@ func resourceCISTLSSettingsUpdate(d *schema.ResourceData, meta interface{}) erro } } } - d.SetId(convertCisToTfTwoVar(zoneID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(zoneID, crn)) return resourceCISTLSSettingsRead(d, meta) } func resourceCISTLSSettingsRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisSSLClientSession() + cisClient, err := meta.(conns.ClientSession).CisSSLClientSession() if err != nil { return err } - zoneID, crn, _ := convertTftoCisTwoVar(d.Id()) + zoneID, crn, _ := flex.ConvertTftoCisTwoVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneIdentifier = core.StringPtr(zoneID) @@ -168,7 +171,7 @@ func resourceCISTLSSettingsRead(d *schema.ResourceData, meta interface{}) error } // Minumum TLS version setting - minTLSClient, err := meta.(ClientSession).CisDomainSettingsClientSession() + minTLSClient, err := meta.(conns.ClientSession).CisDomainSettingsClientSession() if err != nil { return err } @@ -196,7 +199,7 @@ func resourceCISTLSSettingsDelete(d *schema.ResourceData, meta interface{}) erro func suppressTLS13Diff(k, old, new string, d *schema.ResourceData) bool { // if we enable TLS 1.3, it gives zrt in output. - if "zrt" == old && new == "on" { + if old == "zrt" && new == "on" { return true } return false diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_group.go new file mode 100644 index 0000000000..9fb7f33b88 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_group.go @@ -0,0 +1,167 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISWAFGroup = "ibm_cis_waf_group" + cisWAFGroupID = "group_id" + cisWAFGroupPackageID = "package_id" + cisWAFGroupMode = "mode" + cisWAFGroupName = "name" + cisWAFGroupRulesCount = "rules_count" + cisWAFGroupModifiedRulesCount = "modified_rules_count" + cisWAFGroupDesc = "description" +) + +func ResourceIBMCISWAFGroup() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISWAFGroupUpdate, + Read: ResourceIBMCISWAFGroupRead, + Update: ResourceIBMCISWAFGroupUpdate, + Delete: ResourceIBMCISWAFGroupDelete, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Intance CRN", + }, + cisDomainID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Domain ID", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisWAFGroupPackageID: { + Type: schema.TypeString, + Required: true, + Description: "WAF Rule package id", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisWAFGroupID: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "WAF Rule group id", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisWAFGroupMode: { + Type: schema.TypeString, + Required: true, + Description: "WAF Rule group mode on/off", + ValidateFunc: validate.InvokeValidator(ibmCISWAFGroup, cisWAFGroupMode), + }, + cisWAFGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "WAF Rule group name", + }, + cisWAFGroupDesc: { + Type: schema.TypeString, + Computed: true, + Description: "WAF Rule group description", + }, + cisWAFGroupRulesCount: { + Type: schema.TypeString, + Computed: true, + Description: "WAF Rule group rules count", + }, + cisWAFGroupModifiedRulesCount: { + Type: schema.TypeString, + Computed: true, + Description: "WAF Rule group modified rules count", + }, + }, + } +} + +func ResourceIBMCISWAFGroupValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + mode := "on, off" + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisWAFGroupMode, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: mode}) + ibmCISWAFGroupValidator := validate.ResourceValidator{ResourceName: ibmCISWAFGroup, Schema: validateSchema} + return &ibmCISWAFGroupValidator +} + +func ResourceIBMCISWAFGroupUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisWAFGroupClientSession() + if err != nil { + return err + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneID = core.StringPtr(zoneID) + packageID, _, _, _ := flex.ConvertTfToCisThreeVar(d.Get(cisWAFGroupPackageID).(string)) + groupID := d.Get(cisWAFGroupID).(string) + + if d.HasChange(cisWAFGroupMode) { + mode := d.Get(cisWAFGroupMode).(string) + opt := cisClient.NewUpdateWafRuleGroupOptions(packageID, groupID) + opt.SetMode(mode) + _, response, err := cisClient.UpdateWafRuleGroup(opt) + if err != nil { + log.Printf("Update waf rule group mode failed: %v", response) + return err + } + } + d.SetId(flex.ConvertCisToTfFourVar(groupID, packageID, zoneID, crn)) + return ResourceIBMCISWAFGroupRead(d, meta) +} + +func ResourceIBMCISWAFGroupRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisWAFGroupClientSession() + if err != nil { + return err + } + groupID, packageID, zoneID, crn, _ := flex.ConvertTfToCisFourVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneID = core.StringPtr(zoneID) + opt := cisClient.NewGetWafRuleGroupOptions(packageID, groupID) + result, response, err := cisClient.GetWafRuleGroup(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + log.Printf("WAF group is not found!") + d.SetId("") + return nil + } + log.Printf("Get waf rule group setting failed: %v", response) + return err + } + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisWAFGroupID, groupID) + d.Set(cisWAFGroupPackageID, result.Result.PackageID) + d.Set(cisWAFGroupMode, result.Result.Mode) + d.Set(cisWAFGroupName, result.Result.Name) + d.Set(cisWAFGroupDesc, result.Result.Description) + d.Set(cisWAFGroupModifiedRulesCount, result.Result.ModifiedRulesCount) + d.Set(cisWAFGroupRulesCount, result.Result.RulesCount) + return nil +} + +func ResourceIBMCISWAFGroupDelete(d *schema.ResourceData, meta interface{}) error { + // Nothing to delete on CIS WAF Group resource + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_package.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_package.go new file mode 100644 index 0000000000..54d3780a44 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_package.go @@ -0,0 +1,175 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cis + +import ( + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + ibmCISWAFPackage = "ibm_cis_waf_package" + cisWAFPackageID = "package_id" + cisWAFPackageName = "name" + cisWAFPackageDescription = "description" + cisWAFPackageDetectionMode = "detection_mode" + cisWAFPackageSensitivity = "sensitivity" + cisWAFPackageActionMode = "action_mode" +) + +func ResourceIBMCISWAFPackage() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMCISWAFPackageUpdate, + Read: ResourceIBMCISWAFPackageRead, + Update: ResourceIBMCISWAFPackageUpdate, + Delete: ResourceIBMCISWAFPackageDelete, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + cisID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Intance CRN", + }, + cisDomainID: { + Type: schema.TypeString, + Required: true, + Description: "CIS Domain ID", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisWAFPackageID: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "WAF pakcage ID", + DiffSuppressFunc: suppressDomainIDDiff, + }, + cisWAFPackageName: { + Type: schema.TypeString, + Computed: true, + Description: "WAF pakcage name", + }, + cisWAFPackageDetectionMode: { + Type: schema.TypeString, + Computed: true, + Description: "WAF pakcage detection mode", + }, + cisWAFPackageSensitivity: { + Type: schema.TypeString, + Required: true, + Description: "WAF pakcage sensitivity", + ValidateFunc: validate.InvokeValidator( + ibmCISWAFPackage, cisWAFPackageSensitivity), + }, + cisWAFPackageActionMode: { + Type: schema.TypeString, + Required: true, + Description: "WAF pakcage action mode", + ValidateFunc: validate.InvokeValidator( + ibmCISWAFPackage, cisWAFPackageActionMode), + }, + cisWAFPackageDescription: { + Type: schema.TypeString, + Computed: true, + Description: "WAF package description", + }, + }, + } +} + +func ResourceIBMCISWAFPackageValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + sesitivity := "high, medium, low, off" + actionMode := "simulate, block, challenge" + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisWAFPackageSensitivity, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: sesitivity}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: cisWAFPackageActionMode, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: actionMode}) + ibmCISWAFPackageValidator := validate.ResourceValidator{ResourceName: ibmCISWAFPackage, Schema: validateSchema} + return &ibmCISWAFPackageValidator +} + +func ResourceIBMCISWAFPackageUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisWAFPackageClientSession() + if err != nil { + return err + } + + crn := d.Get(cisID).(string) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) + packageID, _, _, _ := flex.ConvertTfToCisThreeVar(d.Get(cisWAFPackageID).(string)) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneID = core.StringPtr(zoneID) + + if d.HasChange(cisWAFPackageSensitivity) || + d.HasChange(cisWAFPackageActionMode) { + opt := cisClient.NewUpdateWafPackageOptions(packageID) + if v, ok := d.GetOk(cisWAFPackageSensitivity); ok { + opt.SetSensitivity(v.(string)) + } + if v, ok := d.GetOk(cisWAFPackageActionMode); ok { + opt.SetActionMode(v.(string)) + } + result, response, err := cisClient.UpdateWafPackage(opt) + if err != nil { + log.Printf("Update waf package setting failed: %v", response) + return err + } + d.SetId(flex.ConvertCisToTfThreeVar(*result.Result.ID, zoneID, crn)) + } + + return ResourceIBMCISWAFPackageRead(d, meta) +} + +func ResourceIBMCISWAFPackageRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisWAFPackageClientSession() + if err != nil { + return err + } + packageID, zoneID, crn, _ := flex.ConvertTfToCisThreeVar(d.Id()) + cisClient.Crn = core.StringPtr(crn) + cisClient.ZoneID = core.StringPtr(zoneID) + opt := cisClient.NewGetWafPackageOptions(packageID) + result, response, err := cisClient.GetWafPackage(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + log.Printf("WAF package is not found!") + d.SetId("") + return nil + } + log.Printf("Get waf package setting failed: %v", response) + return err + } + d.Set(cisID, crn) + d.Set(cisDomainID, zoneID) + d.Set(cisWAFPackageID, result.Result.ID) + d.Set(cisWAFPackageName, result.Result.Name) + d.Set(cisWAFPackageDetectionMode, result.Result.DetectionMode) + d.Set(cisWAFPackageActionMode, result.Result.ActionMode) + d.Set(cisWAFPackageSensitivity, result.Result.Sensitivity) + d.Set(cisWAFPackageDescription, result.Result.Description) + return nil +} + +func ResourceIBMCISWAFPackageDelete(d *schema.ResourceData, meta interface{}) error { + // Nothing to delete on CIS WAF Package resource + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_rule.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_rule.go index 73ce49ae4e..022e679fe3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cis_waf_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis/resource_ibm_cis_waf_rule.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cis import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -25,12 +28,12 @@ const ( cisWAFRuleAllowedModes = "allowed_modes" ) -func resourceIBMCISWAFRule() *schema.Resource { +func ResourceIBMCISWAFRule() *schema.Resource { return &schema.Resource{ - Create: resourceIBMCISWAFRuleUpdate, - Read: resourceIBMCISWAFRuleRead, - Update: resourceIBMCISWAFRuleUpdate, - Delete: resourceIBMCISWAFRuleDelete, + Create: ResourceIBMCISWAFRuleUpdate, + Read: ResourceIBMCISWAFRuleRead, + Update: ResourceIBMCISWAFRuleUpdate, + Delete: ResourceIBMCISWAFRuleDelete, Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ cisID: { @@ -60,7 +63,7 @@ func resourceIBMCISWAFRule() *schema.Resource { Type: schema.TypeString, Required: true, Description: "CIS WAF Rule mode", - ValidateFunc: InvokeValidator(ibmCISWAFRule, cisWAFRuleMode), + ValidateFunc: validate.InvokeValidator(ibmCISWAFRule, cisWAFRuleMode), }, cisWAFRuleDesc: { Type: schema.TypeString, @@ -103,34 +106,34 @@ func resourceIBMCISWAFRule() *schema.Resource { } } -func resourceIBMCISWAFRuleValidator() *ResourceValidator { +func ResourceIBMCISWAFRuleValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) modes := "on, off, default, disable, simulate, block, challenge" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: cisWAFRuleMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: modes}) - ibmCISWAFRuleValidator := ResourceValidator{ResourceName: ibmCISWAFRule, Schema: validateSchema} + ibmCISWAFRuleValidator := validate.ResourceValidator{ResourceName: ibmCISWAFRule, Schema: validateSchema} return &ibmCISWAFRuleValidator } -func resourceIBMCISWAFRuleUpdate(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFRuleClientSession() +func ResourceIBMCISWAFRuleUpdate(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisWAFRuleClientSession() if err != nil { return err } crn := d.Get(cisID).(string) - zoneID, _, err := convertTftoCisTwoVar(d.Get(cisDomainID).(string)) + zoneID, _, _ := flex.ConvertTftoCisTwoVar(d.Get(cisDomainID).(string)) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) ruleID := d.Get(cisWAFRuleID).(string) - packageID, _, _, _ := convertTfToCisThreeVar(d.Get(cisWAFRulePackageID).(string)) + packageID, _, _, _ := flex.ConvertTfToCisThreeVar(d.Get(cisWAFRulePackageID).(string)) if d.HasChange(cisWAFRuleMode) { mode := d.Get(cisWAFRuleMode).(string) @@ -163,16 +166,16 @@ func resourceIBMCISWAFRuleUpdate(d *schema.ResourceData, meta interface{}) error } } - d.SetId(convertCisToTfFourVar(ruleID, packageID, zoneID, crn)) - return resourceIBMCISWAFRuleRead(d, meta) + d.SetId(flex.ConvertCisToTfFourVar(ruleID, packageID, zoneID, crn)) + return ResourceIBMCISWAFRuleRead(d, meta) } -func resourceIBMCISWAFRuleRead(d *schema.ResourceData, meta interface{}) error { - cisClient, err := meta.(ClientSession).CisWAFRuleClientSession() +func ResourceIBMCISWAFRuleRead(d *schema.ResourceData, meta interface{}) error { + cisClient, err := meta.(conns.ClientSession).CisWAFRuleClientSession() if err != nil { return err } - ruleID, packageID, zoneID, crn, err := convertTfToCisFourVar(d.Id()) + ruleID, packageID, zoneID, crn, _ := flex.ConvertTfToCisFourVar(d.Id()) cisClient.Crn = core.StringPtr(crn) cisClient.ZoneID = core.StringPtr(zoneID) opt := cisClient.NewGetWafRuleOptions(packageID, ruleID) @@ -200,11 +203,11 @@ func resourceIBMCISWAFRuleRead(d *schema.ResourceData, meta interface{}) error { d.Set(cisWAFRulePriority, *result.Result.Priority) d.Set(cisWAFRuleGroup, groups) d.Set(cisWAFRuleMode, *result.Result.Mode) - d.Set(cisWAFRuleAllowedModes, flattenStringList(result.Result.AllowedModes)) + d.Set(cisWAFRuleAllowedModes, flex.FlattenStringList(result.Result.AllowedModes)) return nil } -func resourceIBMCISWAFRuleDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceIBMCISWAFRuleDelete(d *schema.ResourceData, meta interface{}) error { // Nothing to delete on CIS WAF rule resource d.SetId("") return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_bare_metal.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_bare_metal.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_bare_metal.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_bare_metal.go index b1302f7697..daf02f615f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_bare_metal.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_bare_metal.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "sort" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" @@ -31,13 +33,13 @@ const ( "operatingSystem[softwareLicense[softwareDescription[referenceCode]]]" ) -func dataSourceIBMComputeBareMetal() *schema.Resource { +func DataSourceIBMComputeBareMetal() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMComputeBareMetalRead, Schema: map[string]*schema.Schema{ - "global_identifier": &schema.Schema{ + "global_identifier": { Description: "The unique global identifier of the bare metal server", Type: schema.TypeString, Optional: true, @@ -45,7 +47,7 @@ func dataSourceIBMComputeBareMetal() *schema.Resource { ConflictsWith: []string{"hostname", "domain", "most_recent"}, }, - "hostname": &schema.Schema{ + "hostname": { Description: "The hostname of the bare metal server", Type: schema.TypeString, Optional: true, @@ -53,7 +55,7 @@ func dataSourceIBMComputeBareMetal() *schema.Resource { ConflictsWith: []string{"global_identifier"}, }, - "domain": &schema.Schema{ + "domain": { Description: "The domain of the bare metal server", Type: schema.TypeString, Optional: true, @@ -61,7 +63,7 @@ func dataSourceIBMComputeBareMetal() *schema.Resource { ConflictsWith: []string{"global_identifier"}, }, - "datacenter": &schema.Schema{ + "datacenter": { Description: "Datacenter in which the bare metal is deployed", Type: schema.TypeString, Computed: true, @@ -229,7 +231,7 @@ func dataSourceIBMComputeBareMetal() *schema.Resource { Description: " The public secondary IPv4 addresses of the bare metal server.", }, - "most_recent": &schema.Schema{ + "most_recent": { Description: "If true and multiple entries are found, the most recently created bare metal is used. " + "If false, an error is returned", Type: schema.TypeBool, @@ -242,7 +244,7 @@ func dataSourceIBMComputeBareMetal() *schema.Resource { } func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) var hostname, domain, globalIdentifier string @@ -272,10 +274,10 @@ func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) BareMetalMask).GetHardware() if err != nil { - return fmt.Errorf("Error retrieving bare metal server details for %s: %s", globalIdentifier, err) + return fmt.Errorf("[ERROR] Error retrieving bare metal server details for %s: %s", globalIdentifier, err) } if len(bms) == 0 { - return fmt.Errorf("No bare metal server found with identifier %s", globalIdentifier) + return fmt.Errorf("[ERROR] No bare metal server found with identifier %s", globalIdentifier) } } else { @@ -285,10 +287,10 @@ func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) BareMetalMask).GetHardware() if err != nil { - return fmt.Errorf("Error retrieving bare metal server for host %s: %s", hostname, err) + return fmt.Errorf("[ERROR] Error retrieving bare metal server for host %s: %s", hostname, err) } if len(bms) == 0 { - return fmt.Errorf("No bare metal server with hostname %s and domain %s", hostname, domain) + return fmt.Errorf("[ERROR] No bare metal server with hostname %s and domain %s", hostname, domain) } } @@ -299,10 +301,9 @@ func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) if mostRecent { bm = mostRecentBareMetal(bms) } else { - return fmt.Errorf( - "More than one bare metals found with host matching [%s] and domain "+ - "matching [%s]. Set 'most_recent' to true in your configuration to force the most recent bare metal "+ - "to be used", hostname, domain) + return fmt.Errorf("[ERROR] More than one bare metals found with host matching [%s] and domain "+ + "matching [%s]. Set 'most_recent' to true in your configuration to force the most recent bare metal "+ + "to be used", hostname, domain) } } else { bm = bms[0] @@ -359,7 +360,7 @@ func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) d.Set("redundant_network", false) d.Set("unbonded_network", false) - bareMetalService := services.GetHardwareService(meta.(ClientSession).SoftLayerSession()) + bareMetalService := services.GetHardwareService(meta.(conns.ClientSession).SoftLayerSession()) backendNetworkComponent, err := bareMetalService.Filter( filter.Build( filter.Path("backendNetworkComponents.status").Eq("ACTIVE"), @@ -367,7 +368,7 @@ func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) ).Id(*bm.Id).GetBackendNetworkComponents() if err != nil { - return fmt.Errorf("Error retrieving bare metal server network: %s", err) + return fmt.Errorf("[ERROR] Error retrieving bare metal server network: %s", err) } if len(backendNetworkComponent) > 2 && bm.PrimaryBackendNetworkComponent != nil { @@ -397,8 +398,8 @@ func dataSourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) storages := bm.AllowedNetworkStorage if len(storages) > 0 { - d.Set("block_storage_ids", flattenBlockStorageID(storages)) - d.Set("file_storage_ids", flattenFileStorageID(storages)) + d.Set("block_storage_ids", flex.FlattenBlockStorageID(storages)) + d.Set("file_storage_ids", flex.FlattenFileStorageID(storages)) } connInfo := map[string]string{"type": "ssh"} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_image_template.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_image_template.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_image_template.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_image_template.go index ae5d3893b9..6dde751f2e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_image_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_image_template.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMComputeImageTemplate() *schema.Resource { +func DataSourceIBMComputeImageTemplate() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMComputeImageTemplateRead, @@ -34,7 +35,7 @@ func dataSourceIBMComputeImageTemplate() *schema.Resource { } func dataSourceIBMComputeImageTemplateRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) name := d.Get("name").(string) @@ -43,7 +44,7 @@ func dataSourceIBMComputeImageTemplateRead(d *schema.ResourceData, meta interfac Mask("id,name"). GetBlockDeviceTemplateGroups() if err != nil { - return fmt.Errorf("Error looking up image template [%s]: %s", name, err) + return fmt.Errorf("[ERROR] Error looking up image template [%s]: %s", name, err) } for _, imageTemplate := range imageTemplates { @@ -61,7 +62,7 @@ func dataSourceIBMComputeImageTemplateRead(d *schema.ResourceData, meta interfac Filter(filter.Path("name").Eq(name).Build()). GetPublicImages() if err != nil { - return fmt.Errorf("Error looking up image template [%s] among the public images: %s", name, err) + return fmt.Errorf("[ERROR] Error looking up image template [%s] among the public images: %s", name, err) } if len(pubImageTemplates) > 0 { @@ -70,5 +71,5 @@ func dataSourceIBMComputeImageTemplateRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Could not find image template with name [%s]", name) + return fmt.Errorf("[ERROR] Could not find image template with name [%s]", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_placement_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_placement_group.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_placement_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_placement_group.go index 5e96a5fb90..477f67a1f1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_placement_group.go @@ -1,20 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "regexp" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMComputePlacementGroup() *schema.Resource { +func DataSourceIBMComputePlacementGroup() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMComputePlacementGroupRead, @@ -64,7 +65,7 @@ func dataSourceIBMComputePlacementGroup() *schema.Resource { } func dataSourceIBMComputePlacementGroupRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) name := d.Get("name").(string) @@ -74,7 +75,7 @@ func dataSourceIBMComputePlacementGroupRead(d *schema.ResourceData, meta interfa Mask("id,name,rule[name],guests[id,domain,hostname],backendRouter[hostname,datacenter[name]]").GetPlacementGroups() if err != nil { - return fmt.Errorf("Error retrieving placement group: %s", err) + return fmt.Errorf("[ERROR] Error retrieving placement group: %s", err) } grps := []datatypes.Virtual_PlacementGroup{} @@ -86,12 +87,10 @@ func dataSourceIBMComputePlacementGroupRead(d *schema.ResourceData, meta interfa } if len(grps) == 0 { - return fmt.Errorf("No placement group found with name [%s]", name) + return fmt.Errorf("[ERROR] No placement group found with name [%s]", name) } - var grp datatypes.Virtual_PlacementGroup - - grp = grps[0] + grp := grps[0] d.SetId(fmt.Sprintf("%d", *grp.Id)) d.Set("name", grp.Name) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_reserved_capacity.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_reserved_capacity.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_reserved_capacity.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_reserved_capacity.go index a80248d8e5..6010c69a25 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_reserved_capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_reserved_capacity.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "context" @@ -10,6 +10,7 @@ import ( "sort" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -18,7 +19,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func dataSourceIBMComputeReservedCapacity() *schema.Resource { +func DataSourceIBMComputeReservedCapacity() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMComputeReservedCapacityRead, @@ -86,7 +87,7 @@ func dataSourceIBMComputeReservedCapacity() *schema.Resource { } func dataSourceIBMComputeReservedCapacityRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) name := d.Get("name").(string) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_ssh_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_ssh_key.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_ssh_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_ssh_key.go index abe9837233..62cb3a414c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_ssh_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_ssh_key.go @@ -1,49 +1,50 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "sort" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMComputeSSHKey() *schema.Resource { +func DataSourceIBMComputeSSHKey() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMComputeSSHKeyRead, Schema: map[string]*schema.Schema{ - "label": &schema.Schema{ + "label": { Description: "The label associated with the ssh key", Type: schema.TypeString, Required: true, }, - "public_key": &schema.Schema{ + "public_key": { Description: "The public ssh key", Type: schema.TypeString, Computed: true, }, - "fingerprint": &schema.Schema{ + "fingerprint": { Description: "A sequence of bytes to authenticate or lookup a longer ssh key", Type: schema.TypeString, Computed: true, }, - "notes": &schema.Schema{ + "notes": { Description: "A small note about a ssh key to use at your discretion", Type: schema.TypeString, Computed: true, }, - "most_recent": &schema.Schema{ + "most_recent": { Description: "If true and multiple entries are found, the most recently created key is used. " + "If false, an error is returned", Type: schema.TypeBool, @@ -55,7 +56,7 @@ func dataSourceIBMComputeSSHKey() *schema.Resource { } func dataSourceIBMComputeSSHKeyRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) label := d.Get("label").(string) @@ -67,10 +68,10 @@ func dataSourceIBMComputeSSHKeyRead(d *schema.ResourceData, meta interface{}) er GetSshKeys() if err != nil { - return fmt.Errorf("Error retrieving SSH key: %s", err) + return fmt.Errorf("[ERROR] Error retrieving SSH key: %s", err) } if len(keys) == 0 { - return fmt.Errorf("No ssh key found with name [%s]", label) + return fmt.Errorf("[ERROR] No ssh key found with name [%s]", label) } var key datatypes.Security_Ssh_Key diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_vm_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_vm_instance.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_vm_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_vm_instance.go index 927f218e9b..eab48a4694 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_compute_vm_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_compute_vm_instance.go @@ -1,55 +1,56 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "sort" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMComputeVmInstance() *schema.Resource { +func DataSourceIBMComputeVmInstance() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMComputeVmInstanceRead, Schema: map[string]*schema.Schema{ - "hostname": &schema.Schema{ + "hostname": { Description: "The hostname of the virtual guest", Type: schema.TypeString, Required: true, }, - "domain": &schema.Schema{ + "domain": { Description: "The domain of the virtual guest", Type: schema.TypeString, Required: true, }, - "datacenter": &schema.Schema{ + "datacenter": { Description: "Datacenter in which the virtual guest is deployed", Type: schema.TypeString, Computed: true, }, - "cores": &schema.Schema{ + "cores": { Description: "Number of cpu cores", Type: schema.TypeInt, Computed: true, }, - "status": &schema.Schema{ + "status": { Description: "The VSI status", Type: schema.TypeString, Computed: true, }, - "last_known_power_state": &schema.Schema{ + "last_known_power_state": { Description: "The last known power state of a virtual guest in the event the guest is turned off outside of IMS or has gone offline.", Type: schema.TypeString, Computed: true, @@ -64,12 +65,12 @@ func dataSourceIBMComputeVmInstance() *schema.Resource { Computed: true, }, - "power_state": &schema.Schema{ + "power_state": { Description: "The current power state of a virtual guest.", Type: schema.TypeString, Computed: true, }, - "most_recent": &schema.Schema{ + "most_recent": { Description: "If true and multiple entries are found, the most recently created virtual guest is used. " + "If false, an error is returned", Type: schema.TypeBool, @@ -142,7 +143,7 @@ func dataSourceIBMComputeVmInstance() *schema.Resource { } func dataSourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) hostname := d.Get("hostname").(string) @@ -159,10 +160,10 @@ func dataSourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{} ).GetVirtualGuests() if err != nil { - return fmt.Errorf("Error retrieving virtual guest details for host %s: %s", hostname, err) + return fmt.Errorf("[ERROR] Error retrieving virtual guest details for host %s: %s", hostname, err) } if len(vgs) == 0 { - return fmt.Errorf("No virtual guest with hostname %s and domain %s", hostname, domain) + return fmt.Errorf("[ERROR] No virtual guest with hostname %s and domain %s", hostname, domain) } var vg datatypes.Virtual_Guest @@ -228,7 +229,7 @@ func dataSourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{} err = readSecondaryIPAddresses(d, meta, vg.PrimaryIpAddress) if err != nil { - return fmt.Errorf("Error retrieving virtual guest details for host %s: %s", hostname, err) + return fmt.Errorf("[ERROR] Error retrieving virtual guest details for host %s: %s", hostname, err) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_domain.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_domain.go new file mode 100644 index 0000000000..5e9137e2af --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_domain.go @@ -0,0 +1,56 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package classicinfrastructure + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/softlayer/softlayer-go/filter" + "github.com/softlayer/softlayer-go/services" +) + +func DataSourceIBMDNSDomain() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMDNSDomainRead, + + Schema: map[string]*schema.Schema{ + "id": { + Description: "A domain record's internal identifier", + Type: schema.TypeInt, + Computed: true, + }, + + "name": { + Description: "The name of the domain", + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func dataSourceIBMDNSDomainRead(d *schema.ResourceData, meta interface{}) error { + sess := meta.(conns.ClientSession).SoftLayerSession() + service := services.GetAccountService(sess) + + name := d.Get("name").(string) + + names, err := service. + Filter(filter.Build(filter.Path("domains.name").Eq(name))). + Mask("id,name"). + GetDomains() + + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving domain: %s", err) + } + + if len(names) == 0 { + return fmt.Errorf("[ERROR] No domain found with name [%s]", name) + } + + d.SetId(fmt.Sprintf("%d", *names[0].Id)) + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_domain_registration.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_domain_registration.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_domain_registration.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_domain_registration.go index 563c0a1375..60be38bd13 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_domain_registration.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_domain_registration.go @@ -1,33 +1,35 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" - "log" ) -func dataSourceIBMDNSDomainRegistration() *schema.Resource { +func DataSourceIBMDNSDomainRegistration() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDNSDomainRegistrationRead, Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Description: "A domain registration record's internal identifier", Type: schema.TypeInt, Computed: true, }, - "name": &schema.Schema{ + "name": { Description: "The name of the domain registration", Type: schema.TypeString, Required: true, }, - "name_servers": &schema.Schema{ + "name_servers": { Description: "Custom name servers for the domain registration", Type: schema.TypeList, Computed: true, @@ -38,7 +40,7 @@ func dataSourceIBMDNSDomainRegistration() *schema.Resource { } func dataSourceIBMDNSDomainRegistrationRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) name := d.Get("name").(string) @@ -48,11 +50,11 @@ func dataSourceIBMDNSDomainRegistrationRead(d *schema.ResourceData, meta interfa GetDomainRegistrations() if err != nil { - return fmt.Errorf("Error retrieving domain registration: %s", err) + return fmt.Errorf("[ERROR] Error retrieving domain registration: %s", err) } if len(names) == 0 { - return fmt.Errorf("No domain registration found with name [%s]", name) + return fmt.Errorf("[ERROR] No domain registration found with name [%s]", name) } log.Printf("names %v\n", names) @@ -77,7 +79,7 @@ func dataSourceIBMDNSDomainRegistrationRead(d *schema.ResourceData, meta interfa log.Printf("names %v\n", ns) if err != nil { - return fmt.Errorf("Error retrieving domain registration nameservers: %s", err) + return fmt.Errorf("[ERROR] Error retrieving domain registration nameservers: %s", err) } d.SetId(fmt.Sprintf("%d", dnsId)) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_secondary.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_secondary.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_secondary.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_secondary.go index 366e594d9d..276852b0fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dns_secondary.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_dns_secondary.go @@ -1,22 +1,23 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMDNSSecondary() *schema.Resource { +func DataSourceIBMDNSSecondary() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDNSSecondaryRead, Schema: map[string]*schema.Schema{ - "zone_name": &schema.Schema{ + "zone_name": { Description: "The name of the secondary", Type: schema.TypeString, Required: true, @@ -46,7 +47,7 @@ func dataSourceIBMDNSSecondary() *schema.Resource { } func dataSourceIBMDNSSecondaryRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) name := d.Get("zone_name").(string) @@ -56,11 +57,11 @@ func dataSourceIBMDNSSecondaryRead(d *schema.ResourceData, meta interface{}) err GetSecondaryDomains() if err != nil { - return fmt.Errorf("Error retrieving secondary zone: %s", err) + return fmt.Errorf("[ERROR] Error retrieving secondary zone: %s", err) } if len(names) == 0 { - return fmt.Errorf("No secondary zone found with name: %s", name) + return fmt.Errorf("[ERROR] No secondary zone found with name: %s", name) } for _, zone := range names { @@ -75,6 +76,6 @@ func dataSourceIBMDNSSecondaryRead(d *schema.ResourceData, meta interface{}) err } } - return fmt.Errorf("No secondary zone found with name: %s", name) + return fmt.Errorf("[ERROR] No secondary zone found with name: %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_lbaas.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_lbaas.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_lbaas.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_lbaas.go index d1a33396c0..2f55b2f16a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_lbaas.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_lbaas.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMLbaas() *schema.Resource { +func DataSourceIBMLbaas() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMLbaasRead, @@ -172,7 +174,7 @@ func dataSourceIBMLbaas() *schema.Resource { func dataSourceIBMLbaasRead(d *schema.ResourceData, meta interface{}) error { name := d.Get("name").(string) - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) lbs, err := service.Mask("datacenter,members,listeners.defaultPool,listeners.defaultPool.sessionAffinity,listeners.defaultPool.healthMonitor,healthMonitors,sslCiphers[name],useSystemPublicIpPool,isPublic,name,description,operatingStatus,address,uuid").Filter(filter.Build( filter.Path("name").Eq(name))).GetAllObjects() @@ -180,21 +182,21 @@ func dataSourceIBMLbaasRead(d *schema.ResourceData, meta interface{}) error { return err } if len(lbs) != 1 { - return fmt.Errorf("No load balancer with name: %s", name) + return fmt.Errorf("[ERROR] No load balancer with name: %s", name) } result := lbs[0] //Get statistics lbStat, err := service.GetLoadBalancerStatistics(result.Uuid) if err != nil { - return fmt.Errorf("Error retrieving load balancer statistics: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer statistics: %s", err) } //Get members health lbMembersHealth, err := service.GetLoadBalancerMemberHealth(result.Uuid) if err != nil { - return fmt.Errorf("Error retrieving load balancer members: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer members: %s", err) } - members := flattenServerInstances(result.Members) + members := flex.FlattenServerInstances(result.Members) for _, lbHealth := range lbMembersHealth { for _, lbMemHealth := range lbHealth.MembersHealth { @@ -226,10 +228,10 @@ func dataSourceIBMLbaasRead(d *schema.ResourceData, meta interface{}) error { d.Set("type", lbType) d.Set("status", result.OperatingStatus) d.Set("vip", result.Address) - d.Set("protocols", flattenProtocols(result.Listeners)) - d.Set("health_monitors", flattenHealthMonitors(result.Listeners)) + d.Set("protocols", flex.FlattenProtocols(result.Listeners)) + d.Set("health_monitors", flex.FlattenHealthMonitors(result.Listeners)) d.Set("server_instances", members) - d.Set("ssl_ciphers", flattenSSLCiphers(result.SslCiphers)) + d.Set("ssl_ciphers", flex.FlattenSSLCiphers(result.SslCiphers)) if *result.UseSystemPublicIpPool == 1 { d.Set("use_system_public_ip_pool", true) } else { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_network_vlan.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_network_vlan.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_network_vlan.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_network_vlan.go index 0f4d7ff19f..5d880d812c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_network_vlan.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_network_vlan.go @@ -1,20 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" "fmt" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMNetworkVlan() *schema.Resource { +func DataSourceIBMNetworkVlan() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMNetworkVlanRead, @@ -98,7 +99,7 @@ func dataSourceIBMNetworkVlan() *schema.Resource { } func dataSourceIBMNetworkVlanRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) name := d.Get("name").(string) @@ -133,9 +134,9 @@ func dataSourceIBMNetworkVlanRead(d *schema.ResourceData, meta interface{}) erro ). GetNetworkVlans() if err != nil { - return fmt.Errorf("Error obtaining VLAN id: %s", err) + return fmt.Errorf("[ERROR] Error obtaining VLAN id: %s", err) } else if len(networkVlans) == 0 { - return fmt.Errorf("No VLAN was found with the name '%s'", name) + return fmt.Errorf("[ERROR] No VLAN was found with the name '%s'", name) } vlan = &networkVlans[0] @@ -179,7 +180,7 @@ func dataSourceIBMNetworkVlanRead(d *schema.ResourceData, meta interface{}) erro } func getVlan(vlanNumber int, primaryRouterHostname string, name string, meta interface{}) (*datatypes.Network_Vlan, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) filters := filter.New(filter.Path("networkVlans.primaryRouter.hostname").Eq(primaryRouterHostname), filter.Path("networkVlans.vlanNumber").Eq(vlanNumber)) @@ -196,7 +197,7 @@ func getVlan(vlanNumber int, primaryRouterHostname string, name string, meta int GetNetworkVlans() if err != nil { - return &datatypes.Network_Vlan{}, fmt.Errorf("Error looking up Vlan: %s", err) + return &datatypes.Network_Vlan{}, fmt.Errorf("[ERROR] Error looking up Vlan: %s", err) } if len(networkVlans) < 1 { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_security_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_security_group.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_security_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_security_group.go index 146467e829..d16dc4c30c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_security_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/data_source_ibm_security_group.go @@ -1,19 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "sort" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" "github.com/softlayer/softlayer-go/services" ) -func dataSourceIBMSecurityGroup() *schema.Resource { +func DataSourceIBMSecurityGroup() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMSecurityGroupRead, @@ -29,7 +30,7 @@ func dataSourceIBMSecurityGroup() *schema.Resource { Computed: true, Description: "The description of the security group", }, - "most_recent": &schema.Schema{ + "most_recent": { Description: "If true and multiple entries are found, the most recently created group is used. " + "If false, an error is returned", Type: schema.TypeBool, @@ -41,7 +42,7 @@ func dataSourceIBMSecurityGroup() *schema.Resource { } func dataSourceIBMSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() name := d.Get("name").(string) mostRecent := d.Get("most_recent").(bool) @@ -57,10 +58,10 @@ func dataSourceIBMSecurityGroupRead(d *schema.ResourceData, meta interface{}) er GetSecurityGroups() if err != nil { - return fmt.Errorf("Error retrieving Security group: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Security group: %s", err) } if len(groups) == 0 { - return fmt.Errorf("No security group found with name [%s]", name) + return fmt.Errorf("[ERROR] No security group found with name [%s]", name) } var sg datatypes.Network_SecurityGroup diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cdn.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_cdn.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cdn.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_cdn.go index 30096e6f94..c69cc9d179 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cdn.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_cdn.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,6 +9,8 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" @@ -17,7 +19,7 @@ import ( const str string = ".cdn.appdomain.cloud" -func resourceIBMCDN() *schema.Resource { +func ResourceIBMCDN() *schema.Resource { return &schema.Resource{ Create: resourceIBMCDNCreate, Read: resourceIBMCDNRead, @@ -26,13 +28,13 @@ func resourceIBMCDN() *schema.Resource { Exists: resourceIBMCDNExists, Schema: map[string]*schema.Schema{ - "host_name": &schema.Schema{ + "host_name": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Host name", }, - "vendor_name": &schema.Schema{ + "vendor_name": { Type: schema.TypeString, Optional: true, Default: "akamai", @@ -40,50 +42,50 @@ func resourceIBMCDN() *schema.Resource { Description: "Vendor name", }, - "origin_type": &schema.Schema{ + "origin_type": { Type: schema.TypeString, Optional: true, Default: "HOST_SERVER", ForceNew: true, - ValidateFunc: validateAllowedStringValue([]string{"HOST_SERVER", "OBJECT_STORAGE"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"HOST_SERVER", "OBJECT_STORAGE"}), Description: "Origin type info", }, - "origin_address": &schema.Schema{ + "origin_address": { Type: schema.TypeString, Required: true, Description: "origin address info", }, - "bucket_name": &schema.Schema{ + "bucket_name": { Type: schema.TypeString, Optional: true, Description: "Bucket name", }, - "protocol": &schema.Schema{ + "protocol": { Type: schema.TypeString, Optional: true, Default: "HTTP", ForceNew: true, - ValidateFunc: validateAllowedStringValue([]string{"HTTP", "HTTPS", "HTTP_AND_HTTPS"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"HTTP", "HTTPS", "HTTP_AND_HTTPS"}), Description: "Protocol name", }, - "http_port": &schema.Schema{ + "http_port": { Type: schema.TypeInt, Optional: true, Default: 80, Description: "HTTP port number", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "Status info of the CDN instance", }, - "https_port": &schema.Schema{ + "https_port": { Type: schema.TypeInt, Optional: true, Default: 443, Description: "HTTPS port number", }, - "cname": &schema.Schema{ + "cname": { Type: schema.TypeString, Computed: true, Optional: true, @@ -100,45 +102,45 @@ func resourceIBMCDN() *schema.Resource { }, Description: "cname info", }, - "header": &schema.Schema{ + "header": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Header info", }, - "respect_headers": &schema.Schema{ + "respect_headers": { Type: schema.TypeBool, Optional: true, Default: true, Description: "respect headers info", }, - "file_extension": &schema.Schema{ + "file_extension": { Type: schema.TypeString, Optional: true, Description: "File extension info", }, - "certificate_type": &schema.Schema{ + "certificate_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"SHARED_SAN_CERT", "WILDCARD_CERT"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"SHARED_SAN_CERT", "WILDCARD_CERT"}), ForceNew: true, Description: "Certificate type", }, - "cache_key_query_rule": &schema.Schema{ + "cache_key_query_rule": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"include-all", "ignore-all", "ignore: space separated query-args", "include: space separated query-args"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"include-all", "ignore-all", "ignore: space separated query-args", "include: space separated query-args"}), Default: "include-all", Description: "query rule info", }, - "performance_configuration": &schema.Schema{ + "performance_configuration": { Type: schema.TypeString, Optional: true, Default: "General web delivery", ForceNew: true, Description: "performance configuration info", }, - "path": &schema.Schema{ + "path": { Type: schema.TypeString, Optional: true, Default: "/*", @@ -151,7 +153,7 @@ func resourceIBMCDN() *schema.Resource { func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { ///create session - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() ///get the value of all the parameters domain := d.Get("host_name").(string) vendorname := d.Get("vendor_name").(string) @@ -196,11 +198,11 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { PerformanceConfiguration: sl.String(performanceconfiguration), }) if err != nil { - return fmt.Errorf("Error creating CDN: %s", err) + return fmt.Errorf("[ERROR] Error creating CDN: %s", err) } d.SetId(*receipt1[0].UniqueId) - id, err := strconv.Atoi((d.Id())) + id, _ := strconv.Atoi((d.Id())) result1, err := service.VerifyDomainMapping(&id) log.Print("The status of domain mapping ", result1) return resourceIBMCDNRead(d, meta) @@ -224,7 +226,7 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { PerformanceConfiguration: sl.String(performanceconfiguration), }) if err != nil { - return fmt.Errorf("Error creating CDN: %s", err) + return fmt.Errorf("[ERROR] Error creating CDN: %s", err) } d.SetId(*receipt2[0].UniqueId) @@ -252,7 +254,7 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { PerformanceConfiguration: sl.String(performanceconfiguration), }) if err != nil { - return fmt.Errorf("Error creating CDN: %s", err) + return fmt.Errorf("[ERROR] Error creating CDN: %s", err) } d.SetId(*receipt3[0].UniqueId) @@ -277,7 +279,7 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { PerformanceConfiguration: sl.String(performanceconfiguration), }) if err != nil { - return fmt.Errorf("Error creating CDN: %s", err) + return fmt.Errorf("[ERROR] Error creating CDN: %s", err) } d.SetId(*receipt4[0].UniqueId) @@ -303,7 +305,7 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { PerformanceConfiguration: sl.String(performanceconfiguration), }) if err != nil { - return fmt.Errorf("Error creating CDN: %s", err) + return fmt.Errorf("[ERROR] Error creating CDN: %s", err) } d.SetId(*receipt5[0].UniqueId) @@ -330,7 +332,7 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { PerformanceConfiguration: sl.String(performanceconfiguration), }) if err != nil { - return fmt.Errorf("Error creating CDN: %s", err) + return fmt.Errorf("[ERROR] Error creating CDN: %s", err) } d.SetId(*receipt6[0].UniqueId) @@ -344,7 +346,7 @@ func resourceIBMCDNCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMCDNRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkCdnMarketplaceConfigurationMappingService(sess) cdnId := sl.String(d.Id()) ///read the changes in the remote resource and update in the local resource. @@ -380,7 +382,7 @@ func resourceIBMCDNRead(d *schema.ResourceData, meta interface{}) error { func resourceIBMCDNUpdate(d *schema.ResourceData, meta interface{}) error { /// Nothing to update for now. Not supported. - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() domain := d.Get("host_name").(string) vendorname := d.Get("vendor_name").(string) origintype := d.Get("origin_type").(string) @@ -573,7 +575,7 @@ func resourceIBMCDNUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMCDNDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkCdnMarketplaceConfigurationMappingService(sess) cdnId := sl.String(d.Id()) @@ -590,7 +592,7 @@ func resourceIBMCDNDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMCDNExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkCdnMarketplaceConfigurationMappingService(sess) cdnId := sl.String(d.Id()) ///check if the resource exists with the given id. @@ -603,7 +605,7 @@ func resourceIBMCDNExists(d *schema.ResourceData, meta interface{}) (bool, error return false, nil } } - return false, fmt.Errorf("Error retrieving CDN mapping info: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving CDN mapping info: %s", err) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_autoscale_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_autoscale_group.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_autoscale_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_autoscale_group.go index 1f1f411c85..e533e6b623 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_autoscale_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_autoscale_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -11,6 +11,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -36,7 +37,7 @@ var IBMComputeAutoScaleGroupObjectMask = []string{ "loadBalancers[healthCheck[healthCheckTypeId,type[keyname],attributes[value,type[id,keyname]]]]", } -func resourceIBMComputeAutoScaleGroup() *schema.Resource { +func ResourceIBMComputeAutoScaleGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeAutoScaleGroupCreate, Read: resourceIBMComputeAutoScaleGroupRead, @@ -135,7 +136,7 @@ func resourceIBMComputeAutoScaleGroup() *schema.Resource { // Otherwise a modified template parameter unnecessarily forces scale group drop/create func getModifiedVirtualGuestResource() *schema.Resource { - r := resourceIBMComputeVmInstance() + r := ResourceIBMComputeVmInstance() // wait_time_minutes is only used in virtual_guest resource. delete(r.Schema, "wait_time_minutes") delete(r.Schema, "reserved_capacity_id") @@ -220,14 +221,14 @@ func buildScaleVlansFromResourceData(v interface{}, meta interface{}) ([]datatyp func getVirtualGuestTemplate(vGuestTemplateList []interface{}, meta interface{}) (datatypes.Virtual_Guest, error) { if len(vGuestTemplateList) != 1 { return datatypes.Virtual_Guest{}, - errors.New("Only one virtual_guest_member_template can be provided") + errors.New("[ERROR] Only one virtual_guest_member_template can be provided") } // Retrieve the map of virtual_guest_member_template attributes vGuestMap := vGuestTemplateList[0].(map[string]interface{}) // Create an empty ResourceData instance for a IBM_Compute_VM_Instance resource - vGuestResourceData := resourceIBMComputeVmInstance().Data(nil) + vGuestResourceData := ResourceIBMComputeVmInstance().Data(nil) // For each item in the map, call Set on the ResourceData. This handles // validation and yields a completed ResourceData object @@ -236,7 +237,7 @@ func getVirtualGuestTemplate(vGuestTemplateList []interface{}, meta interface{}) err := vGuestResourceData.Set(k, v) if err != nil { return datatypes.Virtual_Guest{}, - fmt.Errorf("Error while parsing virtual_guest_member_template values: %s", err) + fmt.Errorf("[ERROR] Error while parsing virtual_guest_member_template values: %s", err) } } dc := vGuestResourceData.Get("datacenter").(string) @@ -249,17 +250,17 @@ func getVirtualGuestTemplate(vGuestTemplateList []interface{}, meta interface{}) } func resourceIBMComputeAutoScaleGroupCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() accountServiceNoRetry := services.GetScaleGroupService(sess.SetRetries(0)) virtualGuestTemplateOpts, err := getVirtualGuestTemplate(d.Get("virtual_guest_member_template").([]interface{}), meta) if err != nil { - return fmt.Errorf("Error while parsing virtual_guest_member_template values: %s", err) + return fmt.Errorf("[ERROR] Error while parsing virtual_guest_member_template values: %s", err) } scaleNetworkVlans, err := buildScaleVlansFromResourceData(d.Get("network_vlan_ids").(*schema.Set).List(), meta) if err != nil { - return fmt.Errorf("Error while parsing network vlan values: %s", err) + return fmt.Errorf("[ERROR] Error while parsing network vlan values: %s", err) } locationGroupRegionalId, err := getLocationGroupRegionalId(sess, d.Get("regional_group").(string)) @@ -285,12 +286,12 @@ func resourceIBMComputeAutoScaleGroupCreate(d *schema.ResourceData, meta interfa opts.LoadBalancers, err = buildLoadBalancers(d) if err != nil { - return fmt.Errorf("Error creating Scale Group: %s", err) + return fmt.Errorf("[ERROR] Error creating Scale Group: %s", err) } res, err := accountServiceNoRetry.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Scale Group: %s", err) + return fmt.Errorf("[ERROR] Error creating Scale Group: %s", err) } d.SetId(strconv.Itoa(*res.Id)) @@ -302,7 +303,7 @@ func resourceIBMComputeAutoScaleGroupCreate(d *schema.ResourceData, meta interfa _, err = waitForActiveStatus(d, meta) if err != nil { - return fmt.Errorf("Error waiting for scale group (%s) to become active: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for scale group (%s) to become active: %s", d.Id(), err) } return resourceIBMComputeAutoScaleGroupRead(d, meta) @@ -324,7 +325,7 @@ func buildLoadBalancers(d *schema.ResourceData, ids ...int) ([]datatypes.Scale_L isLoadBalancerEmpty = false healthCheckOpts, err := buildHealthCheckFromResourceData(healthCheck.(map[string]interface{})) if err != nil { - return []datatypes.Scale_LoadBalancer{}, fmt.Errorf("Error while parsing health check options: %s", err) + return []datatypes.Scale_LoadBalancer{}, fmt.Errorf("[ERROR] Error while parsing health check options: %s", err) } loadBalancers[0].HealthCheck = &healthCheckOpts } @@ -342,7 +343,7 @@ func buildLoadBalancers(d *schema.ResourceData, ids ...int) ([]datatypes.Scale_L } func resourceIBMComputeAutoScaleGroupRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetScaleGroupService(sess) groupId, _ := strconv.Atoi(d.Id()) @@ -355,7 +356,7 @@ func resourceIBMComputeAutoScaleGroupRead(d *schema.ResourceData, meta interface return nil } - return fmt.Errorf("Error retrieving autoscale Group: %s", err) + return fmt.Errorf("[ERROR] Error retrieving autoscale Group: %s", err) } d.Set("name", slGroupObj.Name) @@ -457,7 +458,7 @@ func populateMemberTemplateResourceData(template datatypes.Virtual_Guest) []map[ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() scaleGroupService := services.GetScaleGroupService(sess) scaleNetworkVlanService := services.GetScaleNetworkVlanService(sess) scaleLoadBalancerService := services.GetScaleLoadBalancerService(sess) @@ -465,14 +466,14 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa groupId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID. Must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID. Must be an integer: %s", err) } // Fetch the complete object from SoftLayer, update with current values from the configuration, and send the // whole thing back to SoftLayer (effectively, a PUT) groupObj, err := scaleGroupService.Id(groupId).Mask(strings.Join(IBMComputeAutoScaleGroupObjectMask, ",")).GetObject() if err != nil { - return fmt.Errorf("Error retrieving autoscale_group resource: %s", err) + return fmt.Errorf("[ERROR] Error retrieving autoscale_group resource: %s", err) } groupObj.Name = sl.String(d.Get("name").(string)) @@ -488,7 +489,7 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa groupObj.LoadBalancers, err = buildLoadBalancers(d) } if err != nil { - return fmt.Errorf("Error creating Scale Group: %s", err) + return fmt.Errorf("[ERROR] Error creating Scale Group: %s", err) } if d.HasChange("network_vlan_ids") { @@ -506,13 +507,13 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa Id(groupId). GetNetworkVlans() if err != nil { - return fmt.Errorf("Could not retrieve current vlans for scale group (%d): %s", groupId, err) + return fmt.Errorf("[ERROR] Could not retrieve current vlans for scale group (%d): %s", groupId, err) } for _, oldScaleVlan := range oldScaleVlans { _, err := scaleNetworkVlanService.Id(*oldScaleVlan.Id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting scale network vlan %d: %s", *oldScaleVlan.Id, err) + return fmt.Errorf("[ERROR] Error deleting scale network vlan %d: %s", *oldScaleVlan.Id, err) } } @@ -520,7 +521,7 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa scaleVlans, err := buildScaleVlansFromResourceData(newIds, meta) if err != nil { - return fmt.Errorf("Unable to parse network vlan options: %s", err) + return fmt.Errorf("[ERROR] Unable to parse network vlan options: %s", err) } groupObj.NetworkVlans = scaleVlans @@ -529,7 +530,7 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa if d.HasChange("virtual_guest_member_template") { virtualGuestTemplateOpts, err := getVirtualGuestTemplate(d.Get("virtual_guest_member_template").([]interface{}), meta) if err != nil { - return fmt.Errorf("Unable to parse virtual guest member template options: %s", err) + return fmt.Errorf("[ERROR] Unable to parse virtual guest member template options: %s", err) } groupObj.VirtualGuestMemberTemplate = &virtualGuestTemplateOpts @@ -537,14 +538,14 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa } _, err = scaleGroupServiceNoRetry.Id(groupId).EditObject(&groupObj) if err != nil { - return fmt.Errorf("Error received while editing autoscale_group: %s", err) + return fmt.Errorf("[ERROR] Error received while editing autoscale_group: %s", err) } // wait for scale group to become active _, err = waitForActiveStatus(d, meta) if err != nil { - return fmt.Errorf("Error waiting for scale group (%s) to become active: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for scale group (%s) to become active: %s", d.Id(), err) } // Delete a load balancer if there is the load balancer in a scale group @@ -552,7 +553,7 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa if len(currentLoadBalancers) > 0 && len(groupObj.LoadBalancers) <= 0 { _, err = scaleLoadBalancerService.Id(*currentLoadBalancers[0].Id).DeleteObject() if err != nil { - return fmt.Errorf("Error received while deleting loadbalancers: %s", err) + return fmt.Errorf("[ERROR] Error received while deleting loadbalancers: %s", err) } } @@ -560,18 +561,18 @@ func resourceIBMComputeAutoScaleGroupUpdate(d *schema.ResourceData, meta interfa } func resourceIBMComputeAutoScaleGroupDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() scaleGroupService := services.GetScaleGroupService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Error deleting scale group: %s", err) + return fmt.Errorf("[ERROR] Error deleting scale group: %s", err) } log.Printf("[INFO] Deleting scale group: %d", id) _, err = scaleGroupService.Id(id).ForceDeleteObject() if err != nil { - return fmt.Errorf("Error deleting scale group: %s", err) + return fmt.Errorf("[ERROR] Error deleting scale group: %s", err) } d.SetId("") @@ -580,13 +581,13 @@ func resourceIBMComputeAutoScaleGroupDelete(d *schema.ResourceData, meta interfa } func waitForActiveStatus(d *schema.ResourceData, meta interface{}) (interface{}, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() scaleGroupService := services.GetScaleGroupService(sess) log.Printf("Waiting for scale group (%s) to become active", d.Id()) id, err := strconv.Atoi(d.Id()) if err != nil { - return nil, fmt.Errorf("The scale group ID %s must be numeric", d.Id()) + return nil, fmt.Errorf("[ERROR] The scale group ID %s must be numeric", d.Id()) } stateConf := &resource.StateChangeConf{ @@ -599,7 +600,7 @@ func waitForActiveStatus(d *schema.ResourceData, meta interface{}) (interface{}, GetObject() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("The scale group %d does not exist anymore: %s", id, err) + return nil, "", fmt.Errorf("[ERROR] The scale group %d does not exist anymore: %s", id, err) } return result, "BUSY", nil // Retry @@ -643,12 +644,12 @@ func waitForActiveStatus(d *schema.ResourceData, meta interface{}) (interface{}, func resourceIBMComputeAutoScaleGroupExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() scaleGroupService := services.GetScaleGroupService(sess) groupId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := scaleGroupService.Id(groupId).Mask("id").GetObject() @@ -677,7 +678,7 @@ func getLocationGroupRegionalId(sess *session.Session, locationGroupRegionalName } if len(locationGroupRegionals) < 1 { - return -1, fmt.Errorf("Invalid location group regional: %s", locationGroupRegionalName) + return -1, fmt.Errorf("[ERROR] Invalid location group regional: %s", locationGroupRegionalName) } for _, locationGroupRegional := range locationGroupRegionals { @@ -686,5 +687,5 @@ func getLocationGroupRegionalId(sess *session.Session, locationGroupRegionalName } } - return -1, fmt.Errorf("Invalid regional_group_id: %s", locationGroupRegionalName) + return -1, fmt.Errorf("[ERROR] Invalid regional_group_id: %s", locationGroupRegionalName) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_autoscale_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_autoscale_policy.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_autoscale_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_autoscale_policy.go index c4e21327b3..5b5a2a8d90 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_autoscale_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_autoscale_policy.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "bytes" @@ -17,7 +17,7 @@ import ( "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( @@ -39,7 +39,7 @@ var IBMComputeAutoScalePolicyObjectMask = []string{ "triggers", } -func resourceIBMComputeAutoScalePolicy() *schema.Resource { +func ResourceIBMComputeAutoScalePolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeAutoScalePolicyCreate, Read: resourceIBMComputeAutoScalePolicyRead, @@ -147,7 +147,7 @@ func resourceIBMComputeAutoScalePolicy() *schema.Resource { } func resourceIBMComputeAutoScalePolicyCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetScalePolicyService(sess.SetRetries(0)) var err error @@ -160,7 +160,7 @@ func resourceIBMComputeAutoScalePolicyCreate(d *schema.ResourceData, meta interf } if *opts.Cooldown < 0 || *opts.Cooldown > 864000 { - return fmt.Errorf("Error retrieving scalePolicy: %s", "cooldown must be between 0 seconds and 10 days.") + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", "cooldown must be between 0 seconds and 10 days.") } opts.ScaleActions = []datatypes.Scale_Policy_Action_Scale{{ @@ -171,37 +171,37 @@ func resourceIBMComputeAutoScalePolicyCreate(d *schema.ResourceData, meta interf opts.ScaleActions[0].TypeId = sl.Int(1) if *opts.ScaleActions[0].Amount <= 0 { - return fmt.Errorf("Error retrieving scalePolicy: %s", "scale_amount should be greater than 0.") + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", "scale_amount should be greater than 0.") } if *opts.ScaleActions[0].ScaleType != "ABSOLUTE" && *opts.ScaleActions[0].ScaleType != "RELATIVE" && *opts.ScaleActions[0].ScaleType != "PERCENT" { - return fmt.Errorf("Error retrieving scalePolicy: %s", "scale_type should be ABSOLUTE, RELATIVE, or PERCENT.") + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", "scale_type should be ABSOLUTE, RELATIVE, or PERCENT.") } if _, ok := d.GetOk("triggers"); ok { err = validateTriggerTypes(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } opts.OneTimeTriggers, err = prepareOneTimeTriggers(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } opts.RepeatingTriggers, err = prepareRepeatingTriggers(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } opts.ResourceUseTriggers, err = prepareResourceUseTriggers(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } } res, err := service.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Scale Policy: %s $s", err) + return fmt.Errorf("[ERROR] Error creating Scale Policy: %s $s", err) } d.SetId(strconv.Itoa(*res.Id)) @@ -211,18 +211,18 @@ func resourceIBMComputeAutoScalePolicyCreate(d *schema.ResourceData, meta interf } func resourceIBMComputeAutoScalePolicyRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetScalePolicyService(sess) scalePolicyId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid scale policy ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid scale policy ID, must be an integer: %s", err) } log.Printf("[INFO] Reading Scale Polocy: %d", scalePolicyId) scalePolicy, err := service.Id(scalePolicyId).Mask(strings.Join(IBMComputeAutoScalePolicyObjectMask, ";")).GetObject() if err != nil { - return fmt.Errorf("Error retrieving Scale Policy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Scale Policy: %s", err) } d.Set("name", scalePolicy.Name) @@ -242,19 +242,19 @@ func resourceIBMComputeAutoScalePolicyRead(d *schema.ResourceData, meta interfac func resourceIBMComputeAutoScalePolicyUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() scalePolicyService := services.GetScalePolicyService(sess) scalePolicyTriggerService := services.GetScalePolicyTriggerService(sess) scalePolicyServiceNoRetry := services.GetScalePolicyService(sess.SetRetries(0)) scalePolicyId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid scale policy ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid scale policy ID, must be an integer: %s", err) } scalePolicy, err := scalePolicyService.Id(scalePolicyId).Mask(strings.Join(IBMComputeAutoScalePolicyObjectMask, ";")).GetObject() if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } var template datatypes.Scale_Policy @@ -274,36 +274,36 @@ func resourceIBMComputeAutoScalePolicyUpdate(d *schema.ResourceData, meta interf if d.HasChange("scale_type") { template.ScaleActions[0].ScaleType = sl.String(d.Get("scale_type").(string)) if *template.ScaleActions[0].ScaleType != "ABSOLUTE" && *template.ScaleActions[0].ScaleType != "RELATIVE" && *template.ScaleActions[0].ScaleType != "PERCENT" { - return fmt.Errorf("Error retrieving scalePolicy: %s", "scale_type should be ABSOLUTE, RELATIVE, or PERCENT.") + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", "scale_type should be ABSOLUTE, RELATIVE, or PERCENT.") } } if d.HasChange("scale_amount") { template.ScaleActions[0].Amount = sl.Int(d.Get("scale_amount").(int)) if *template.ScaleActions[0].Amount <= 0 { - return fmt.Errorf("Error retrieving scalePolicy: %s", "scale_amount should be greater than 0.") + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", "scale_amount should be greater than 0.") } } if d.HasChange("cooldown") { template.Cooldown = sl.Int(d.Get("cooldown").(int)) if *template.Cooldown <= 0 || *template.Cooldown > 864000 { - return fmt.Errorf("Error retrieving scalePolicy: %s", "cooldown must be between 0 seconds and 10 days.") + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", "cooldown must be between 0 seconds and 10 days.") } } if _, ok := d.GetOk("triggers"); ok { template.OneTimeTriggers, err = prepareOneTimeTriggers(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } template.RepeatingTriggers, err = prepareRepeatingTriggers(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } template.ResourceUseTriggers, err = prepareResourceUseTriggers(d) if err != nil { - return fmt.Errorf("Error retrieving scalePolicy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving scalePolicy: %s", err) } } @@ -317,25 +317,25 @@ func resourceIBMComputeAutoScalePolicyUpdate(d *schema.ResourceData, meta interf _, err = scalePolicyServiceNoRetry.Id(scalePolicyId).EditObject(&template) if err != nil { - return fmt.Errorf("Error updating scalie policy: %s", err) + return fmt.Errorf("[ERROR] Error updating scalie policy: %s", err) } return nil } func resourceIBMComputeAutoScalePolicyDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetScalePolicyService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Error deleting scale policy: %s", err) + return fmt.Errorf("[ERROR] Error deleting scale policy: %s", err) } log.Printf("[INFO] Deleting scale policy: %d", id) _, err = service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting scale policy: %s", err) + return fmt.Errorf("[ERROR] Error deleting scale policy: %s", err) } d.SetId("") @@ -344,12 +344,12 @@ func resourceIBMComputeAutoScalePolicyDelete(d *schema.ResourceData, meta interf } func resourceIBMComputeAutoScalePolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetScalePolicyService(sess) policyId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(policyId).Mask("id").GetObject() if err != nil { @@ -370,7 +370,7 @@ func validateTriggerTypes(d *schema.ResourceData) error { trigger := triggerList.(map[string]interface{}) trigger_type := trigger["type"].(string) if trigger_type != "ONE_TIME" && trigger_type != "REPEATING" && trigger_type != "RESOURCE_USE" { - return fmt.Errorf("Invalid trigger type: %s", trigger_type) + return fmt.Errorf("[ERROR] Invalid trigger type: %s", trigger_type) } } return nil @@ -452,12 +452,12 @@ func prepareWatches(d *schema.Set) ([]datatypes.Scale_Policy_Trigger_ResourceUse watch.Metric = sl.String(watchMap["metric"].(string)) if *watch.Metric != "host.cpu.percent" && *watch.Metric != "host.network.backend.in.rate" && *watch.Metric != "host.network.backend.out.rate" && *watch.Metric != "host.network.frontend.in.rate" && *watch.Metric != "host.network.frontend.out.rate" { - return nil, fmt.Errorf("Invalid metric : %s", *watch.Metric) + return nil, fmt.Errorf("[ERROR] Invalid metric : %s", *watch.Metric) } watch.Operator = sl.String(watchMap["operator"].(string)) if *watch.Operator != ">" && *watch.Operator != "<" { - return nil, fmt.Errorf("Invalid operator : %s", *watch.Operator) + return nil, fmt.Errorf("[ERROR] Invalid operator : %s", *watch.Operator) } watch.Period = sl.Int(watchMap["period"].(int)) @@ -549,7 +549,7 @@ func resourceIBMComputeAutoScalePolicyTriggerHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%d-", watch["period"].(int))) } } - return hashcode.String(buf.String()) + return conns.String(buf.String()) } func resourceIBMComputeAutoScalePolicyHandlerHash(v interface{}) int { @@ -559,5 +559,5 @@ func resourceIBMComputeAutoScalePolicyHandlerHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", watch["operator"].(string))) buf.WriteString(fmt.Sprintf("%s-", watch["value"].(string))) buf.WriteString(fmt.Sprintf("%d-", watch["period"].(int))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_bare_metal.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_bare_metal.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_bare_metal.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_bare_metal.go index cb2ba12d27..ff01de9be2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_bare_metal.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_bare_metal.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -21,7 +24,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputeBareMetal() *schema.Resource { +func ResourceIBMComputeBareMetal() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeBareMetalCreate, Read: resourceIBMComputeBareMetalRead, @@ -105,7 +108,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, Default: nil, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "tags": { @@ -120,7 +123,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Fixed config preset value", }, @@ -131,7 +134,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Computed: true, ForceNew: true, ConflictsWith: []string{"image_template_id"}, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "OS refernece code value", }, @@ -179,7 +182,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "TCP monitoring enabled if set as true", }, @@ -195,7 +198,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -203,7 +206,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -211,7 +214,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -219,7 +222,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -227,7 +230,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -235,7 +238,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -244,7 +247,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly/Hourly only @@ -253,7 +256,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly/Hourly only @@ -262,7 +265,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only. For controlling datacenter restricted port speed @@ -286,7 +289,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Monthly only @@ -296,7 +299,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { ForceNew: true, //Sometime memory returns back as different. Since this resource is immutable at this point //and memory can't be really updated , suppress the change until we figure out how to handle it - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Computed: true, }, // Monthly only @@ -329,7 +332,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { }, }, }, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Quote based provisioning only @@ -337,7 +340,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeInt, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Quote ID for Quote based provisioning", }, @@ -397,7 +400,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Type: schema.TypeInt, Optional: true, ForceNew: true, - ValidateFunc: validateSecondaryIPCount, + ValidateFunc: validate.ValidateSecondaryIPCount, DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { // secondary_ip_count is only used when a virtual_guest resource is created. if d.State() == nil { @@ -435,7 +438,7 @@ func resourceIBMComputeBareMetal() *schema.Resource { Description: "boolean value true if ipv6 static is enabled else false", }, - "global_identifier": &schema.Schema{ + "global_identifier": { Description: "The unique global identifier of the bare metal server", Type: schema.TypeString, Computed: true, @@ -489,7 +492,7 @@ func getBareMetalOrderFromResourceData(d *schema.ResourceData, meta interface{}) subnet := public_subnet.(string) subnetID, err := getSubnetID(subnet, meta) if err != nil { - return hardware, fmt.Errorf("Error determining id for subnet %s: %s", subnet, err) + return hardware, fmt.Errorf("[ERROR] Error determining id for subnet %s: %s", subnet, err) } hardware.PrimaryNetworkComponent.NetworkVlan.PrimarySubnetId = sl.Int(subnetID) @@ -499,7 +502,7 @@ func getBareMetalOrderFromResourceData(d *schema.ResourceData, meta interface{}) subnet := private_subnet.(string) subnetID, err := getSubnetID(subnet, meta) if err != nil { - return hardware, fmt.Errorf("Error determining id for subnet %s: %s", subnet, err) + return hardware, fmt.Errorf("[ERROR] Error determining id for subnet %s: %s", subnet, err) } hardware.PrimaryBackendNetworkComponent.NetworkVlan.PrimarySubnetId = sl.Int(subnetID) @@ -526,7 +529,7 @@ func getBareMetalOrderFromResourceData(d *schema.ResourceData, meta interface{}) } func resourceIBMComputeBareMetalCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() hwService := services.GetHardwareService(sess) var order datatypes.Container_Product_Order var err error @@ -601,14 +604,13 @@ func resourceIBMComputeBareMetalCreate(d *schema.ResourceData, meta interface{}) order, err = setCommonBareMetalOrderOptions(d, meta, order) if err != nil { - return fmt.Errorf( - "Encountered problem trying to configure bare metal server options: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to configure bare metal server options: %s", err) } log.Println("[INFO] Ordering bare metal server") orderReceipt, err := services.GetProductOrderService(sess.SetRetries(0)).PlaceOrder(&order, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error ordering bare metal server: %s\n%+v\n", err, order) + return fmt.Errorf("[ERROR] Error ordering bare metal server: %s\n%+v\n", err, order) } gID := *orderReceipt.OrderDetails.Hardware[0].GlobalIdentifier @@ -619,8 +621,7 @@ func resourceIBMComputeBareMetalCreate(d *schema.ResourceData, meta interface{}) // wait for machine availability bm, err := waitForBareMetalProvision(&hardware, d, meta, gID) if err != nil { - return fmt.Errorf( - "Error waiting for bare metal server (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for bare metal server (%s) to become ready: %s", d.Id(), err) } id := *bm.(datatypes.Hardware).Id @@ -636,11 +637,11 @@ func resourceIBMComputeBareMetalCreate(d *schema.ResourceData, meta interface{}) var storageIds []int if storageIdsSet := d.Get("file_storage_ids").(*schema.Set); len(storageIdsSet.List()) > 0 { - storageIds = expandIntList(storageIdsSet.List()) + storageIds = flex.ExpandIntList(storageIdsSet.List()) } if storageIdsSet := d.Get("block_storage_ids").(*schema.Set); len(storageIdsSet.List()) > 0 { - storageIds = append(storageIds, expandIntList(storageIdsSet.List())...) + storageIds = append(storageIds, flex.ExpandIntList(storageIdsSet.List())...) } if len(storageIds) > 0 { err := addAccessToStorageList(hwService.Id(id), id, storageIds, meta) @@ -661,11 +662,11 @@ func resourceIBMComputeBareMetalCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) error { - service := services.GetHardwareService(meta.(ClientSession).SoftLayerSession()) + service := services.GetHardwareService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).Mask( @@ -686,7 +687,7 @@ func resourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) e ).GetObject() if err != nil { - return fmt.Errorf("Error retrieving bare metal server: %s", err) + return fmt.Errorf("[ERROR] Error retrieving bare metal server: %s", err) } d.Set("hostname", *result.Hostname) @@ -745,7 +746,7 @@ func resourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) e ).Id(id).GetBackendNetworkComponents() if err != nil { - return fmt.Errorf("Error retrieving bare metal server network: %s", err) + return fmt.Errorf("[ERROR] Error retrieving bare metal server network: %s", err) } if len(backendNetworkComponent) > 2 && result.PrimaryBackendNetworkComponent != nil { @@ -775,8 +776,8 @@ func resourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) e storages := result.AllowedNetworkStorage if len(storages) > 0 { - d.Set("block_storage_ids", flattenBlockStorageID(storages)) - d.Set("file_storage_ids", flattenFileStorageID(storages)) + d.Set("block_storage_ids", flex.FlattenBlockStorageID(storages)) + d.Set("file_storage_ids", flex.FlattenFileStorageID(storages)) } connInfo := map[string]string{"type": "ssh"} @@ -800,7 +801,7 @@ func resourceIBMComputeBareMetalRead(d *schema.ResourceData, meta interface{}) e func resourceIBMComputeBareMetalUpdate(d *schema.ResourceData, meta interface{}) error { id, _ := strconv.Atoi(d.Id()) - service := services.GetHardwareService(meta.(ClientSession).SoftLayerSession()) + service := services.GetHardwareService(meta.(conns.ClientSession).SoftLayerSession()) if d.HasChange("tags") { err := setHardwareTags(id, d, meta) @@ -828,21 +829,21 @@ func resourceIBMComputeBareMetalDelete(d *schema.ResourceData, meta interface{}) } func deleteHardware(d dataRetriever, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetHardwareService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = waitForNoBareMetalActiveTransactions(id, meta) if err != nil { - return fmt.Errorf("Error deleting bare metal server while waiting for zero active transactions: %s", err) + return fmt.Errorf("[ERROR] Error deleting bare metal server while waiting for zero active transactions: %s", err) } billingItem, err := service.Id(id).GetBillingItem() if err != nil { - return fmt.Errorf("Error getting billing item for bare metal server: %s", err) + return fmt.Errorf("[ERROR] Error getting billing item for bare metal server: %s", err) } // Monthly bare metal servers only support an anniversary date cancellation option. @@ -851,24 +852,24 @@ func deleteHardware(d dataRetriever, meta interface{}) error { sl.Bool(d.Get("hourly_billing").(bool)), sl.Bool(true), sl.String("No longer required"), sl.String("Please cancel this server"), ) if err != nil { - return fmt.Errorf("Error canceling the bare metal server (%d): %s", id, err) + return fmt.Errorf("[ERROR] Error canceling the bare metal server (%d): %s", id, err) } return nil } func resourceIBMComputeBareMetalExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetHardwareService(meta.(ClientSession).SoftLayerSession()) + service := services.GetHardwareService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).GetObject() if err != nil { if apiErr, ok := err.(sl.Error); !ok || apiErr.StatusCode != 404 { - return false, fmt.Errorf("Error trying to retrieve the Bare Metal server: %s", err) + return false, fmt.Errorf("[ERROR] Error trying to retrieve the Bare Metal server: %s", err) } } @@ -888,7 +889,7 @@ func waitForBareMetalProvision(hw *datatypes.Hardware, d *schema.ResourceData, m Pending: []string{"retry", "pending"}, Target: []string{"provisioned"}, Refresh: func() (interface{}, string, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) bms, err := service.Filter( filter.Build( @@ -908,7 +909,7 @@ func waitForBareMetalProvision(hw *datatypes.Hardware, d *schema.ResourceData, m Filter(filter.Build(filter.Path("publicSubnets.endPointIpAddress.hardware.id").Eq(bms[0].Id))). GetPublicSubnets() if err != nil { - return nil, "", fmt.Errorf("Error retrieving secondary ip address: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving secondary ip address: %s", err) } if len(secondarySubnetResult) == 0 { return datatypes.Hardware{}, "pending", nil @@ -929,7 +930,7 @@ func waitForBareMetalProvision(hw *datatypes.Hardware, d *schema.ResourceData, m func waitForNoBareMetalActiveTransactions(id int, meta interface{}) (interface{}, error) { log.Printf("Waiting for server (%d) to have zero active transactions", id) - service := services.GetHardwareServerService(meta.(ClientSession).SoftLayerSession()) + service := services.GetHardwareServerService(meta.(conns.ClientSession).SoftLayerSession()) stateConf := &resource.StateChangeConf{ Pending: []string{"retry", "active"}, @@ -956,19 +957,19 @@ func waitForNoBareMetalActiveTransactions(id int, meta interface{}) (interface{} } func setHardwareTags(id int, d dataRetriever, meta interface{}) error { - service := services.GetHardwareService(meta.(ClientSession).SoftLayerSession()) + service := services.GetHardwareService(meta.(conns.ClientSession).SoftLayerSession()) tags := getTags(d) _, err := service.Id(id).SetTags(sl.String(tags)) if err != nil { - return fmt.Errorf("Could not set tags on bare metal server %d", id) + return fmt.Errorf("[ERROR] Could not set tags on bare metal server %d", id) } return nil } func setHardwareNotes(id int, d dataRetriever, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetHardwareServerService(sess) result, err := service.Id(id).GetObject() @@ -1032,11 +1033,11 @@ func getItemPriceId(items []datatypes.Product_Item, categoryCode string, keyName } } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find the matching item with categorycode %s and keyName %s. Available item(s) is(are) %s", categoryCode, keyName, availableItems) + fmt.Errorf("[ERROR] Could not find the matching item with categorycode %s and keyName %s. Available item(s) is(are) %s", categoryCode, keyName, availableItems) } func getMonthlyBareMetalOrder(d *schema.ResourceData, meta interface{}) (datatypes.Container_Product_Order, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Validate attributes for monthly bare metal server ordering. if d.Get("hourly_billing").(bool) { return datatypes.Container_Product_Order{}, fmt.Errorf("Monthly bare metal server only supports monthly billing.") @@ -1044,17 +1045,17 @@ func getMonthlyBareMetalOrder(d *schema.ResourceData, meta interface{}) (datatyp model, ok := d.GetOk("package_key_name") if !ok { - return datatypes.Container_Product_Order{}, fmt.Errorf("The attribute 'package_key_name' is not defined.") + return datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] The attribute 'package_key_name' is not defined.") } datacenter, ok := d.GetOk("datacenter") if !ok { - return datatypes.Container_Product_Order{}, fmt.Errorf("The attribute 'datacenter' is not defined.") + return datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] The attribute 'datacenter' is not defined.") } osKeyName, ok := d.GetOk("os_key_name") if !ok { - return datatypes.Container_Product_Order{}, fmt.Errorf("The attribute 'os_key_name' is not defined.") + return datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] The attribute 'os_key_name' is not defined.") } dc, err := location.GetDatacenterByName(sess, datacenter.(string), "id") @@ -1222,7 +1223,7 @@ func setMonthlyHourlyCommonOrder(d *schema.ResourceData, items []datatypes.Produ privateNetworkOnly := d.Get("private_network_only").(bool) if secondaryIPCount > 0 { if privateNetworkOnly { - return fmt.Errorf("Unable to configure public secondary addresses with a private_network_only option") + return fmt.Errorf("[ERROR] Unable to configure public secondary addresses with a private_network_only option") } keyName := strconv.Itoa(secondaryIPCount) + "_PUBLIC_IP_ADDRESSES" @@ -1235,7 +1236,7 @@ func setMonthlyHourlyCommonOrder(d *schema.ResourceData, items []datatypes.Produ if d.Get("ipv6_enabled").(bool) { if privateNetworkOnly { - return fmt.Errorf("Unable to configure a public IPv6 address with a private_network_only option") + return fmt.Errorf("[ERROR] Unable to configure a public IPv6 address with a private_network_only option") } keyName := "1_IPV6_ADDRESS" @@ -1248,7 +1249,7 @@ func setMonthlyHourlyCommonOrder(d *schema.ResourceData, items []datatypes.Produ if d.Get("ipv6_static_enabled").(bool) { if privateNetworkOnly { - return fmt.Errorf("Unable to configure a public static IPv6 address with a private_network_only option") + return fmt.Errorf("[ERROR] Unable to configure a public static IPv6 address with a private_network_only option") } keyName := "64_BLOCK_STATIC_PUBLIC_IPV6_ADDRESSES" @@ -1285,7 +1286,7 @@ func setCommonBareMetalOrderOptions(d *schema.ResourceData, meta interface{}, or subnet := public_subnet.(string) subnetId, err := getSubnetId(subnet, meta) if err != nil { - return datatypes.Container_Product_Order{}, fmt.Errorf("Error determining id for subnet %s: %s", subnet, err) + return datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] Error determining id for subnet %s: %s", subnet, err) } order.Hardware[0].PrimaryNetworkComponent.NetworkVlan.PrimarySubnetId = sl.Int(subnetId) @@ -1295,7 +1296,7 @@ func setCommonBareMetalOrderOptions(d *schema.ResourceData, meta interface{}, or subnet := private_subnet.(string) subnetId, err := getSubnetId(subnet, meta) if err != nil { - return datatypes.Container_Product_Order{}, fmt.Errorf("Error determining id for subnet %s: %s", subnet, err) + return datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] Error determining id for subnet %s: %s", subnet, err) } order.Hardware[0].PrimaryBackendNetworkComponent.NetworkVlan.PrimarySubnetId = sl.Int(subnetId) @@ -1388,7 +1389,7 @@ func findNetworkItemPriceId(items []datatypes.Product_Item, d dataRetriever) (da } } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find the network with %s, %s, %s, and private_network_only = %t", + fmt.Errorf("[ERROR] Could not find the network with %s, %s, %s, and private_network_only = %t", networkSpeedStr, redundantNetworkStr, unbondedNetworkStr, privateNetworkOnly) } @@ -1413,7 +1414,7 @@ func findMemoryItemPriceId(items []datatypes.Product_Item, d dataRetriever) (dat } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find the price item for %d GB memory. Available items are %s", memory, availableMemories) + fmt.Errorf("[ERROR] Could not find the price item for %d GB memory. Available items are %s", memory, availableMemories) } // Find a bare metal package object using a package key name @@ -1445,7 +1446,7 @@ func getPackageByModel(sess *session.Session, model string) (datatypes.Product_P } } - return datatypes.Product_Package{}, fmt.Errorf("No custom bare metal package key name for %s. Available package key name(s) is(are) %s", model, availableModels) + return datatypes.Product_Package{}, fmt.Errorf("[ERROR] No custom bare metal package key name for %s. Available package key name(s) is(are) %s", model, availableModels) } func getStorageGroupsFromResourceData(d dataRetriever) []datatypes.Container_Product_Order_Storage_Group { @@ -1474,14 +1475,6 @@ func getStorageGroupsFromResourceData(d dataRetriever) []datatypes.Container_Pro return storageGroups } -// Use this function for attributes which only should be applied in resource creation time. -func applyOnce(k, o, n string, d *schema.ResourceData) bool { - if len(d.Id()) == 0 { - return false - } - return true -} - func addCommomDefaultPrices(d *schema.ResourceData, meta interface{}, order datatypes.Container_Product_Order, items []datatypes.Product_Item) datatypes.Container_Product_Order { if !d.Get("tcp_monitoring").(bool) { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_dedicated_host.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_dedicated_host.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_dedicated_host.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_dedicated_host.go index d29e2958f8..70e1b16d7d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_dedicated_host.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_dedicated_host.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,6 +9,7 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -22,7 +23,7 @@ import ( var dedicatedHostPackageType = "DEDICATED_HOST" -func resourceIBMComputeDedicatedHost() *schema.Resource { +func ResourceIBMComputeDedicatedHost() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeDedicatedHostCreate, Read: resourceIBMComputeDedicatedHostRead, @@ -100,7 +101,7 @@ func resourceIBMComputeDedicatedHost() *schema.Resource { } func resourceIBMComputeDedicatedHostCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() pkg, err := product.GetPackageByType(sess, dedicatedHostPackageType) if err != nil { @@ -114,12 +115,12 @@ func resourceIBMComputeDedicatedHostCreate(d *schema.ResourceData, meta interfac // Lookup the data center ID dc, err := location.GetDatacenterByName(sess, datacenter) if err != nil { - return fmt.Errorf("No data centers matching %s could be found", datacenter) + return fmt.Errorf("[ERROR] No data centers matching %s could be found", datacenter) } rt, err := hardware.GetRouterByName(sess, router, "id") if err != nil { - return fmt.Errorf("Error creating dedicated host: %s", err) + return fmt.Errorf("[ERROR] Error creating dedicated host: %s", err) } primaryBackendNetworkComponent := datatypes.Network_Component{ @@ -180,20 +181,19 @@ func resourceIBMComputeDedicatedHostCreate(d *schema.ResourceData, meta interfac _, err = services.GetProductOrderService(sess.SetRetries(0)). VerifyOrder(&productOrderContainer) if err != nil { - return fmt.Errorf("Error during creation of dedicated host: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated host: %s", err) } //place order _, err = services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(&productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of dedicated host: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated host: %s", err) } // wait for machine availability dedicated, err := findDedicatedHostByOrderID(&hardware, d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for dedicated host (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for dedicated host (%s) to become ready: %s", d.Id(), err) } id := *dedicated.(datatypes.Virtual_DedicatedHost).Id @@ -202,11 +202,11 @@ func resourceIBMComputeDedicatedHostCreate(d *schema.ResourceData, meta interfac } func resourceIBMComputeDedicatedHostRead(d *schema.ResourceData, meta interface{}) error { - service := services.GetVirtualDedicatedHostService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualDedicatedHostService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).Mask( @@ -214,7 +214,7 @@ func resourceIBMComputeDedicatedHostRead(d *schema.ResourceData, meta interface{ ).GetObject() if err != nil { - return fmt.Errorf("Error retrieving dedicated host: %s", err) + return fmt.Errorf("[ERROR] Error retrieving dedicated host: %s", err) } d.Set("hostname", result.Name) @@ -228,24 +228,24 @@ func resourceIBMComputeDedicatedHostRead(d *schema.ResourceData, meta interface{ func resourceIBMComputeDedicatedHostUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualDedicatedHostService(sess.SetRetries(0)) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).GetObject() if err != nil { - return fmt.Errorf("Error retrieving dedicated host: %s", err) + return fmt.Errorf("[ERROR] Error retrieving dedicated host: %s", err) } if d.HasChange("hostname") { result.Name = sl.String(d.Get("hostname").(string)) _, err = service.Id(id).EditObject(&result) if err != nil { - return fmt.Errorf("Couldn't update dedicated host: %s", err) + return fmt.Errorf("[ERROR] Could n't update dedicated host: %s", err) } } @@ -253,17 +253,17 @@ func resourceIBMComputeDedicatedHostUpdate(d *schema.ResourceData, meta interfac } func resourceIBMComputeDedicatedHostDelete(d *schema.ResourceData, meta interface{}) error { - service := services.GetVirtualDedicatedHostService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualDedicatedHostService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } ok, err := service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting dedicated host: %s", err) + return fmt.Errorf("[ERROR] Error deleting dedicated host: %s", err) } if !ok { @@ -276,10 +276,10 @@ func resourceIBMComputeDedicatedHostDelete(d *schema.ResourceData, meta interfac } func resourceIBMComputeDedicatedHostExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetVirtualDedicatedHostService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualDedicatedHostService(meta.(conns.ClientSession).SoftLayerSession()) dedicatedID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(dedicatedID).GetObject() @@ -304,7 +304,7 @@ func findDedicatedHostByOrderID(d *datatypes.Hardware, r *schema.ResourceData, m Pending: []string{"retry", "pending"}, Target: []string{"provisioned"}, Refresh: func() (interface{}, string, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) dedicatedHosts, err := service.Filter( filter.Build( filter.Path("dedicatedHosts.name").Eq(hostname), diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_monitor.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_monitor.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_monitor.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_monitor.go index 764c25d49b..c016d23b41 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_monitor.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_monitor.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,13 +9,14 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputeMonitor() *schema.Resource { +func ResourceIBMComputeMonitor() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeMonitorCreate, Read: resourceIBMComputeMonitorRead, @@ -77,7 +78,7 @@ func resourceIBMComputeMonitor() *schema.Resource { } func resourceIBMComputeMonitorCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() virtualGuestService := services.GetVirtualGuestService(sess) monitorService := services.GetNetworkMonitorVersion1QueryHostService(sess.SetRetries(0)) @@ -86,7 +87,7 @@ func resourceIBMComputeMonitorCreate(d *schema.ResourceData, meta interface{}) e if ipAddress == "" { virtualGuest, err := virtualGuestService.Id(guestId).GetObject() if err != nil { - return fmt.Errorf("Error looking up virtual guest %d: %s", guestId, err) + return fmt.Errorf("[ERROR] Error looking up virtual guest %d: %s", guestId, err) } if virtualGuest.PrimaryIpAddress == nil { @@ -111,7 +112,7 @@ func resourceIBMComputeMonitorCreate(d *schema.ResourceData, meta interface{}) e // Create a monitor res, err := monitorService.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Basic Monitor : %s", err) + return fmt.Errorf("[ERROR] Error creating Basic Monitor : %s", err) } d.SetId(strconv.Itoa(*res.Id)) @@ -126,7 +127,7 @@ func resourceIBMComputeMonitorCreate(d *schema.ResourceData, meta interface{}) e } func createNotifications(d *schema.ResourceData, meta interface{}, guestId int) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() virtualGuestService := services.GetVirtualGuestService(sess) notificationService := services.GetUserCustomerNotificationVirtualGuestService(sess.SetRetries(0)) @@ -134,7 +135,7 @@ func createNotifications(d *schema.ResourceData, meta interface{}, guestId int) // This represents a link between a monitored guest instance and a user account notificationLinks, err := virtualGuestService.Id(guestId).GetMonitoringUserNotification() if err != nil { - return fmt.Errorf("Error looking up user notifications for virtual guest %d", guestId) + return fmt.Errorf("[ERROR] Error looking up user notifications for virtual guest %d", guestId) } userNotificationOpts := datatypes.User_Customer_Notification_Virtual_Guest{ @@ -147,7 +148,7 @@ func createNotifications(d *schema.ResourceData, meta interface{}, guestId int) if !notificationExists(notificationLinks, userId.(int)) { _, err := notificationService.CreateObject(&userNotificationOpts) if err != nil { - return fmt.Errorf("Error creating notification for userID %d: %v", *userNotificationOpts.UserId, err) + return fmt.Errorf("[ERROR] Error creating notification for userID %d: %v", *userNotificationOpts.UserId, err) } } } @@ -167,7 +168,7 @@ func notificationExists(notificationLinks []datatypes.User_Customer_Notification func resourceIBMComputeMonitorRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkMonitorVersion1QueryHostService(sess) virtualGuestService := services.GetVirtualGuestService(sess) @@ -182,7 +183,7 @@ func resourceIBMComputeMonitorRead(d *schema.ResourceData, meta interface{}) err return nil } - return fmt.Errorf("Error retrieving Basic Monitor : %s", err) + return fmt.Errorf("[ERROR] Error retrieving Basic Monitor : %s", err) } guestId := *basicMonitor.GuestId @@ -195,7 +196,7 @@ func resourceIBMComputeMonitorRead(d *schema.ResourceData, meta interface{}) err notificationLinks, err := virtualGuestService.Id(guestId).GetMonitoringUserNotification() if err != nil { - return fmt.Errorf("Error looking up user notifications for virtual guest %d", guestId) + return fmt.Errorf("[ERROR] Error looking up user notifications for virtual guest %d", guestId) } notificationUserIds := schema.NewSet(func(v interface{}) int { return v.(int) }, make([]interface{}, 0, len(notificationLinks))) @@ -228,7 +229,7 @@ func resourceIBMComputeMonitorRead(d *schema.ResourceData, meta interface{}) err func resourceIBMComputeMonitorUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() serviceNoRetry := services.GetNetworkMonitorVersion1QueryHostService(sess.SetRetries(0)) service := services.GetNetworkMonitorVersion1QueryHostService(sess) @@ -237,7 +238,7 @@ func resourceIBMComputeMonitorUpdate(d *schema.ResourceData, meta interface{}) e basicMonitor, err := service.Id(basicMonitorId).GetObject() if err != nil { - return fmt.Errorf("Error retrieving Basic Monitor : %s", err) + return fmt.Errorf("[ERROR] Error retrieving Basic Monitor : %s", err) } if d.HasChange("query_type_id") { basicMonitor.QueryTypeId = sl.Int(d.Get("query_type_id").(int)) @@ -251,7 +252,7 @@ func resourceIBMComputeMonitorUpdate(d *schema.ResourceData, meta interface{}) e _, err = serviceNoRetry.Id(basicMonitorId).EditObject(&basicMonitor) if err != nil { - return fmt.Errorf("Error editing Basic Monitor : %s", err) + return fmt.Errorf("[ERROR] Error editing Basic Monitor : %s", err) } // Will only create notification objects for user/vm relationships that @@ -265,7 +266,7 @@ func resourceIBMComputeMonitorUpdate(d *schema.ResourceData, meta interface{}) e } func resourceIBMComputeMonitorDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkMonitorVersion1QueryHostService(sess) // Delete the basic monitor @@ -274,7 +275,7 @@ func resourceIBMComputeMonitorDelete(d *schema.ResourceData, meta interface{}) e log.Printf("[INFO] Deleting Basic Monitor : %d", id) _, err = service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Basic Monitor : %s", err) + return fmt.Errorf("[ERROR] Error deleting Basic Monitor : %s", err) } d.SetId("") @@ -282,12 +283,12 @@ func resourceIBMComputeMonitorDelete(d *schema.ResourceData, meta interface{}) e } func resourceIBMComputeMonitorExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkMonitorVersion1QueryHostService(sess) basicMonitorId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(basicMonitorId).GetObject() @@ -297,7 +298,7 @@ func resourceIBMComputeMonitorExists(d *schema.ResourceData, meta interface{}) ( return false, nil } } - return false, fmt.Errorf("Error retrieving basic monitor info: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving basic monitor info: %s", err) } return *result.Id == basicMonitorId, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_placement_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_placement_group.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_placement_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_placement_group.go index 8f2a9eecd0..c23463755f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_placement_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -12,6 +12,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/filter" @@ -21,7 +23,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputePlacementGroup() *schema.Resource { +func ResourceIBMComputePlacementGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputePlacementGroupCreate, Read: resourceIBMComputePlacementGroupRead, @@ -63,7 +65,7 @@ func resourceIBMComputePlacementGroup() *schema.Resource { Optional: true, Default: "SPREAD", ForceNew: true, - ValidateFunc: validateAllowedStringValue([]string{"SPREAD"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"SPREAD"}), Description: "Rule info", }, @@ -79,7 +81,7 @@ func resourceIBMComputePlacementGroup() *schema.Resource { } func resourceIBMComputePlacementGroupCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() name := d.Get("name").(string) datacenter := d.Get("datacenter").(string) pod := d.Get("pod").(string) @@ -91,7 +93,7 @@ func resourceIBMComputePlacementGroupCreate(d *schema.ResourceData, meta interfa // 1.Getting the router ID routerids, err := PodService.Filter(filter.Path("datacenterName").Eq(datacenter).Build()).Mask(podMask).GetAllObjects() if err != nil { - return fmt.Errorf("Encountered problem trying to get the router ID: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get the router ID: %s", err) } var routerid int for _, iterate := range routerids { @@ -105,7 +107,7 @@ func resourceIBMComputePlacementGroupCreate(d *schema.ResourceData, meta interfa Mask("id,name"). Filter(filter.Path("name").Eq(rule).Build()).GetObject() if err != nil { - return fmt.Errorf("Encountered problem trying to get the placement group rule ID: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get the placement group rule ID: %s", err) } opts := datatypes.Virtual_PlacementGroup{ @@ -118,7 +120,7 @@ func resourceIBMComputePlacementGroupCreate(d *schema.ResourceData, meta interfa pgrp, err := service.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Placement Group: %s", err) + return fmt.Errorf("[ERROR] Error creating Placement Group: %s", err) } d.SetId(strconv.Itoa(*pgrp.Id)) @@ -128,7 +130,7 @@ func resourceIBMComputePlacementGroupCreate(d *schema.ResourceData, meta interfa } func resourceIBMComputePlacementGroupRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualPlacementGroupService(sess) pgrpID, _ := strconv.Atoi(d.Id()) @@ -141,7 +143,7 @@ func resourceIBMComputePlacementGroupRead(d *schema.ResourceData, meta interface return nil } } - return fmt.Errorf("Error retrieving Placement Group: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Placement Group: %s", err) } d.Set("name", pgrp.Name) @@ -156,7 +158,7 @@ func resourceIBMComputePlacementGroupRead(d *schema.ResourceData, meta interface } func resourceIBMComputePlacementGroupUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualPlacementGroupService(sess.SetRetries(0)) pgrpID, _ := strconv.Atoi(d.Id()) @@ -168,7 +170,7 @@ func resourceIBMComputePlacementGroupUpdate(d *schema.ResourceData, meta interfa _, err := service.Id(pgrpID).EditObject(&opts) if err != nil { - return fmt.Errorf("Error editing Placement Group: %s", err) + return fmt.Errorf("[ERROR] Error editing Placement Group: %s", err) } } @@ -177,12 +179,12 @@ func resourceIBMComputePlacementGroupUpdate(d *schema.ResourceData, meta interfa func resourceIBMComputePlacementGroupExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualPlacementGroupService(sess) pgrpID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(pgrpID).GetObject() @@ -198,7 +200,7 @@ func resourceIBMComputePlacementGroupExists(d *schema.ResourceData, meta interfa } func resourceIBMComputePlacementGroupDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualPlacementGroupService(sess) pgrpID, err := strconv.Atoi(d.Id()) @@ -235,7 +237,7 @@ func resourceIBMComputePlacementGroupDelete(d *schema.ResourceData, meta interfa _, err = service.Id(pgrpID).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Placement Group: %s", err) + return fmt.Errorf("[ERROR] Error deleting Placement Group: %s", err) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_provisioning_hook.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_provisioning_hook.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_provisioning_hook.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_provisioning_hook.go index 236b4394db..0e1bd2afc4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_provisioning_hook.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_provisioning_hook.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,13 +9,14 @@ import ( "net/http" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputeProvisioningHook() *schema.Resource { +func ResourceIBMComputeProvisioningHook() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeProvisioningHookCreate, Read: resourceIBMComputeProvisioningHookRead, @@ -25,13 +26,13 @@ func resourceIBMComputeProvisioningHook() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "Provision hook name", }, - "uri": &schema.Schema{ + "uri": { Type: schema.TypeString, Required: true, Description: "URI of the hook", @@ -49,7 +50,7 @@ func resourceIBMComputeProvisioningHook() *schema.Resource { } func resourceIBMComputeProvisioningHookCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetProvisioningHookService(sess.SetRetries(0)) opts := datatypes.Provisioning_Hook{ @@ -59,7 +60,7 @@ func resourceIBMComputeProvisioningHookCreate(d *schema.ResourceData, meta inter hook, err := service.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Provisioning Hook: %s", err) + return fmt.Errorf("[ERROR] Error creating Provisioning Hook: %s", err) } d.SetId(strconv.Itoa(*hook.Id)) @@ -69,7 +70,7 @@ func resourceIBMComputeProvisioningHookCreate(d *schema.ResourceData, meta inter } func resourceIBMComputeProvisioningHookRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetProvisioningHookService(sess) hookId, _ := strconv.Atoi(d.Id()) @@ -82,7 +83,7 @@ func resourceIBMComputeProvisioningHookRead(d *schema.ResourceData, meta interfa return nil } } - return fmt.Errorf("Error retrieving Provisioning Hook: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Provisioning Hook: %s", err) } d.Set("name", hook.Name) @@ -92,7 +93,7 @@ func resourceIBMComputeProvisioningHookRead(d *schema.ResourceData, meta interfa } func resourceIBMComputeProvisioningHookUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetProvisioningHookService(sess.SetRetries(0)) hookId, _ := strconv.Atoi(d.Id()) @@ -111,32 +112,32 @@ func resourceIBMComputeProvisioningHookUpdate(d *schema.ResourceData, meta inter _, err := service.Id(hookId).EditObject(&opts) if err != nil { - return fmt.Errorf("Error editing Provisioning Hook: %s", err) + return fmt.Errorf("[ERROR] Error editing Provisioning Hook: %s", err) } return nil } func resourceIBMComputeProvisioningHookDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetProvisioningHookService(sess) hookId, err := strconv.Atoi(d.Id()) log.Printf("[INFO] Deleting Provisioning Hook: %d", hookId) _, err = service.Id(hookId).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Provisioning Hook: %s", err) + return fmt.Errorf("[ERROR] Error deleting Provisioning Hook: %s", err) } return nil } func resourceIBMComputeProvisioningHookExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetProvisioningHookService(sess) hookId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(hookId).GetObject() diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_reserved_capacity.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_reserved_capacity.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_reserved_capacity.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_reserved_capacity.go index 1bb4b82646..c5c3c9c551 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_reserved_capacity.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_reserved_capacity.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "context" @@ -13,6 +13,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -25,7 +27,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputeReservedCapacity() *schema.Resource { +func ResourceIBMComputeReservedCapacity() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMComputeReservedCapacityCreate, ReadContext: resourceIBMComputeReservedCapacityRead, @@ -85,7 +87,7 @@ func resourceIBMComputeReservedCapacity() *schema.Resource { "force_create": { Type: schema.TypeBool, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Force the creation of reserved capacity with same name", }, }, @@ -93,7 +95,7 @@ func resourceIBMComputeReservedCapacity() *schema.Resource { } func resourceIBMComputeReservedCapacityCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() name := d.Get("name").(string) datacenter := d.Get("datacenter").(string) pod := d.Get("pod").(string) @@ -194,7 +196,7 @@ func findReservedCapacityByOrderID(name string, r *schema.ResourceData, meta int Pending: []string{"retry", "pending"}, Target: []string{"provisioned"}, Refresh: func() (interface{}, string, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) reservedCapacitys, err := service.Filter( filter.Build( filter.Path("reservedCapacityGroups.name").Eq(name), @@ -219,7 +221,7 @@ func findReservedCapacityByOrderID(name string, r *schema.ResourceData, meta int } func resourceIBMComputeReservedCapacityRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualReservedCapacityGroupService(sess) rgrpID, _ := strconv.Atoi(d.Id()) @@ -252,7 +254,7 @@ func resourceIBMComputeReservedCapacityRead(context context.Context, d *schema.R } func resourceIBMComputeReservedCapacityUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualReservedCapacityGroupService(sess) rgrpID, _ := strconv.Atoi(d.Id()) @@ -273,7 +275,7 @@ func resourceIBMComputeReservedCapacityUpdate(context context.Context, d *schema func resourceIBMComputeReservedCapacityExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualReservedCapacityGroupService(sess) rgrpID, err := strconv.Atoi(d.Id()) @@ -303,7 +305,7 @@ func resourceReservedCapacityValidate(_ context.Context, diff *schema.ResourceDi forceCreate := diff.Get("force_create").(bool) if diff.Id() == "" && !forceCreate { name := diff.Get("name").(string) - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) reservedCapacities, _ := service.Filter( filter.Build( filter.Path("reservedCapacityGroups.name").Eq(name), diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_ssh_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_ssh_key.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_ssh_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_ssh_key.go index 91a6556b69..d26a6b3717 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_ssh_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_ssh_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "crypto/sha256" @@ -11,6 +11,7 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" @@ -18,7 +19,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputeSSHKey() *schema.Resource { +func ResourceIBMComputeSSHKey() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeSSHKeyCreate, Read: resourceIBMComputeSSHKeyRead, @@ -69,7 +70,7 @@ func resourceIBMComputeSSHKey() *schema.Resource { } func resourceIBMComputeSSHKeyCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecuritySshKeyService(sess) // First check if the key exists by fingerprint @@ -126,7 +127,7 @@ func resourceIBMComputeSSHKeyCreate(d *schema.ResourceData, meta interface{}) er res, err := service.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating SSH Key: %s", err) + return fmt.Errorf("[ERROR] Error creating SSH Key: %s", err) } d.SetId(strconv.Itoa(*res.Id)) @@ -136,7 +137,7 @@ func resourceIBMComputeSSHKeyCreate(d *schema.ResourceData, meta interface{}) er } func resourceIBMComputeSSHKeyRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecuritySshKeyService(sess) keyID, _ := strconv.Atoi(d.Id()) @@ -148,7 +149,7 @@ func resourceIBMComputeSSHKeyRead(d *schema.ResourceData, meta interface{}) erro d.SetId("") return nil } - return fmt.Errorf("Error retrieving SSH key: %s", err) + return fmt.Errorf("[ERROR] Error retrieving SSH key: %s", err) } d.Set("label", key.Label) @@ -159,14 +160,14 @@ func resourceIBMComputeSSHKeyRead(d *schema.ResourceData, meta interface{}) erro } func resourceIBMComputeSSHKeyUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecuritySshKeyService(sess) keyID, _ := strconv.Atoi(d.Id()) key, err := service.Id(keyID).GetObject() if err != nil { - return fmt.Errorf("Error retrieving SSH key: %s", err) + return fmt.Errorf("[ERROR] Error retrieving SSH key: %s", err) } if d.HasChange("label") { @@ -179,24 +180,24 @@ func resourceIBMComputeSSHKeyUpdate(d *schema.ResourceData, meta interface{}) er _, err = service.Id(keyID).EditObject(&key) if err != nil { - return fmt.Errorf("Error editing SSH key: %s", err) + return fmt.Errorf("[ERROR] Error editing SSH key: %s", err) } return resourceIBMComputeSSHKeyRead(d, meta) } func resourceIBMComputeSSHKeyDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecuritySshKeyService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Error deleting SSH Key: %s", err) + return fmt.Errorf("[ERROR] Error deleting SSH Key: %s", err) } log.Printf("[INFO] Deleting SSH key: %d", id) _, err = service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting SSH key: %s", err) + return fmt.Errorf("[ERROR] Error deleting SSH key: %s", err) } d.SetId("") @@ -204,12 +205,12 @@ func resourceIBMComputeSSHKeyDelete(d *schema.ResourceData, meta interface{}) er } func resourceIBMComputeSSHKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecuritySshKeyService(sess) keyID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(keyID).GetObject() @@ -227,11 +228,11 @@ func resourceIBMComputeSSHKeyExists(d *schema.ResourceData, meta interface{}) (b func computeSSHKeyFingerprint(key string) (fingerprint string, err error) { parts := strings.Fields(key) if len(parts) < 2 { - return "", fmt.Errorf("Invalid public key specified :%s\nPlease check the value of public_key", key) + return "", fmt.Errorf("[ERROR] Invalid public key specified :%s\nPlease check the value of public_key", key) } k, err := base64.StdEncoding.DecodeString(parts[1]) if err != nil { - return "", fmt.Errorf("Error decoding the public key: %s\nPlease check the value of public_key", err) + return "", fmt.Errorf("[ERROR] Error decoding the public key: %s\nPlease check the value of public_key", err) } fp := sha256.Sum256([]byte(k)) prints := make([]string, len(fp)) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_ssl_certificate.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_ssl_certificate.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_ssl_certificate.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_ssl_certificate.go index f5fe11cf23..e3fbd6947d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_ssl_certificate.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_ssl_certificate.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,13 +9,14 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMComputeSSLCertificate() *schema.Resource { +func ResourceIBMComputeSSLCertificate() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeSSLCertificateCreate, Read: resourceIBMComputeSSLCertificateRead, @@ -26,7 +27,7 @@ func resourceIBMComputeSSLCertificate() *schema.Resource { Schema: map[string]*schema.Schema{ - "certificate": &schema.Schema{ + "certificate": { Type: schema.TypeString, Required: true, ForceNew: true, @@ -34,7 +35,7 @@ func resourceIBMComputeSSLCertificate() *schema.Resource { Description: "SSL Certifcate", }, - "intermediate_certificate": &schema.Schema{ + "intermediate_certificate": { Type: schema.TypeString, Optional: true, ForceNew: true, @@ -42,7 +43,7 @@ func resourceIBMComputeSSLCertificate() *schema.Resource { Description: "Intermediate certificate value", }, - "private_key": &schema.Schema{ + "private_key": { Type: schema.TypeString, Required: true, ForceNew: true, @@ -51,49 +52,49 @@ func resourceIBMComputeSSLCertificate() *schema.Resource { Description: "SSL Private Key", }, - "common_name": &schema.Schema{ + "common_name": { Type: schema.TypeString, Computed: true, Description: "Common name", }, - "organization_name": &schema.Schema{ + "organization_name": { Type: schema.TypeString, Computed: true, Description: "Organization name", }, - "validity_begin": &schema.Schema{ + "validity_begin": { Type: schema.TypeString, Computed: true, Description: "Validity begins from", }, - "validity_days": &schema.Schema{ + "validity_days": { Type: schema.TypeInt, Computed: true, Description: "Validity days", }, - "validity_end": &schema.Schema{ + "validity_end": { Type: schema.TypeString, Computed: true, Description: "Validity ends before", }, - "key_size": &schema.Schema{ + "key_size": { Type: schema.TypeInt, Computed: true, Description: "SSL key size", }, - "create_date": &schema.Schema{ + "create_date": { Type: schema.TypeString, Computed: true, Description: "certificate creation date", }, - "modify_date": &schema.Schema{ + "modify_date": { Type: schema.TypeString, Computed: true, Description: "certificate modificatiob date", @@ -111,7 +112,7 @@ func resourceIBMComputeSSLCertificate() *schema.Resource { } func resourceIBMComputeSSLCertificateCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateService(sess.SetRetries(0)) template := datatypes.Security_Certificate{ @@ -125,7 +126,7 @@ func resourceIBMComputeSSLCertificateCreate(d *schema.ResourceData, meta interfa cert, err := service.CreateObject(&template) if err != nil { - return fmt.Errorf("Error creating Security Certificate: %s", err) + return fmt.Errorf("[ERROR] Error creating Security Certificate: %s", err) } d.SetId(fmt.Sprintf("%d", *cert.Id)) @@ -134,18 +135,18 @@ func resourceIBMComputeSSLCertificateCreate(d *schema.ResourceData, meta interfa } func resourceIBMComputeSSLCertificateRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } cert, err := service.Id(id).GetObject() if err != nil { - return fmt.Errorf("Unable to get Security Certificate: %s", err) + return fmt.Errorf("[ERROR] Unable to get Security Certificate: %s", err) } d.SetId(fmt.Sprintf("%d", *cert.Id)) @@ -178,24 +179,24 @@ func resourceIBMComputeSSLCertificateUpdate(d *schema.ResourceData, meta interfa } func resourceIBMComputeSSLCertificateDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateService(sess) id, err := strconv.Atoi(d.Id()) _, err = service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Security Certificate %d: %s", id, err) + return fmt.Errorf("[ERROR] Error deleting Security Certificate %d: %s", id, err) } return nil } func resourceIBMComputeSSLCertificateExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } cert, err := service.Id(id).GetObject() diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_user.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_user.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_user.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_user.go index 8d4c93d0e2..e17d295620 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_user.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_user.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "crypto/sha256" @@ -11,6 +11,7 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" @@ -20,7 +21,7 @@ import ( const userCustomerCancelStatus = 1021 -func resourceIBMComputeUser() *schema.Resource { +func ResourceIBMComputeUser() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeUserCreate, Read: resourceIBMComputeUserRead, @@ -30,69 +31,69 @@ func resourceIBMComputeUser() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "username": &schema.Schema{ + "username": { Type: schema.TypeString, Optional: true, Computed: true, Description: "user name", }, - "first_name": &schema.Schema{ + "first_name": { Type: schema.TypeString, Required: true, Description: "First name of the user", }, - "last_name": &schema.Schema{ + "last_name": { Type: schema.TypeString, Required: true, Description: "Last name of the user", }, - "email": &schema.Schema{ + "email": { Type: schema.TypeString, Required: true, Description: "email address of the user", }, - "company_name": &schema.Schema{ + "company_name": { Type: schema.TypeString, Required: true, Description: "comapany name", }, - "address1": &schema.Schema{ + "address1": { Type: schema.TypeString, Required: true, Description: "Address info of the user", }, - "address2": &schema.Schema{ + "address2": { Type: schema.TypeString, Optional: true, Description: "Address info of the user", }, - "city": &schema.Schema{ + "city": { Type: schema.TypeString, Required: true, Description: "City name", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Required: true, Description: "Satate name", }, - "country": &schema.Schema{ + "country": { Type: schema.TypeString, Required: true, Description: "Country name", }, - "timezone": &schema.Schema{ + "timezone": { Type: schema.TypeString, Required: true, Description: "time zone info", }, - "user_status": &schema.Schema{ + "user_status": { Type: schema.TypeString, Optional: true, Default: "ACTIVE", Description: "user status info", }, - "password": &schema.Schema{ + "password": { Type: schema.TypeString, Optional: true, Sensitive: true, @@ -102,27 +103,27 @@ func resourceIBMComputeUser() *schema.Resource { }, Description: "password for the user", }, - "permissions": &schema.Schema{ + "permissions": { Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, Description: "set of persmissions assigned for the user", }, - "has_api_key": &schema.Schema{ + "has_api_key": { Type: schema.TypeBool, Optional: true, Default: false, Description: "API Key info of the user", }, - "api_key": &schema.Schema{ + "api_key": { Type: schema.TypeString, Optional: true, Computed: true, Sensitive: true, Description: "API key for the user", }, - "ibm_id": &schema.Schema{ + "ibm_id": { Type: schema.TypeString, Computed: true, Description: "IBM ID of the user", @@ -163,7 +164,7 @@ func getPermissions(d *schema.ResourceData) []datatypes.User_Customer_CustomerPe } func resourceIBMComputeUserCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetUserCustomerService(sess) serviceNoRetry := services.GetUserCustomerService(sess.SetRetries(0)) @@ -207,7 +208,7 @@ func resourceIBMComputeUserCreate(d *schema.ResourceData, meta interface{}) erro res, err := serviceNoRetry.CreateObject(&opts, pass, nil) if err != nil { - return fmt.Errorf("Error creating IBM Cloud User: %s", err) + return fmt.Errorf("[ERROR] Error creating IBM Cloud User: %s", err) } d.SetId(strconv.Itoa(*res.Id)) @@ -227,12 +228,12 @@ func resourceIBMComputeUserCreate(d *schema.ResourceData, meta interface{}) erro _, err = service.RemoveBulkPortalPermission(defaultPortalPermissions, sl.Bool(true)) if err != nil { - return fmt.Errorf("Error removing default portal permissions for IBM Cloud User: %s", err) + return fmt.Errorf("[ERROR] Error removing default portal permissions for IBM Cloud User: %s", err) } _, err = service.AddBulkPortalPermission(permissions) if err != nil { - return fmt.Errorf("Error setting portal permissions for IBM Cloud User: %s", err) + return fmt.Errorf("[ERROR] Error setting portal permissions for IBM Cloud User: %s", err) } create_api_key_flag := d.Get("has_api_key").(bool) @@ -242,7 +243,7 @@ func resourceIBMComputeUserCreate(d *schema.ResourceData, meta interface{}) erro // and not the edit method. _, err = service.AddApiAuthenticationKey() if err != nil { - return fmt.Errorf("Error creating API key: %s", err) + return fmt.Errorf("[ERROR] Error creating API key: %s", err) } } @@ -250,7 +251,7 @@ func resourceIBMComputeUserCreate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMComputeUserRead(d *schema.ResourceData, meta interface{}) error { - service := services.GetUserCustomerService(meta.(ClientSession).SoftLayerSession()) + service := services.GetUserCustomerService(meta.(conns.ClientSession).SoftLayerSession()) userID, _ := strconv.Atoi(d.Id()) mask := strings.Join([]string{ @@ -281,7 +282,7 @@ func resourceIBMComputeUserRead(d *schema.ResourceData, meta interface{}) error return nil } - return fmt.Errorf("Error retrieving IBM Cloud User: %s", err) + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud User: %s", err) } d.Set("username", sluserObj.Username) @@ -321,7 +322,7 @@ func resourceIBMComputeUserRead(d *schema.ResourceData, meta interface{}) error func resourceIBMComputeUserUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetUserCustomerService(sess) serviceNoRetry := services.GetUserCustomerService(sess.SetRetries(0)) @@ -396,7 +397,7 @@ func resourceIBMComputeUserUpdate(d *schema.ResourceData, meta interface{}) erro _, err = serviceNoRetry.Id(sluid).EditObject(&userObj) if err != nil { - return fmt.Errorf("Error received while editing ibm_compute_user: %s", err) + return fmt.Errorf("[ERROR] Error received while editing ibm_compute_user: %s", err) } if d.HasChange("permissions") { @@ -422,13 +423,13 @@ func resourceIBMComputeUserUpdate(d *schema.ResourceData, meta interface{}) erro // 'remove' all old permissions _, err = service.RemoveBulkPortalPermission(oldPermissions, sl.Bool(true)) if err != nil { - return fmt.Errorf("Error received while removing old permissions from ibm_compute_user: %s", err) + return fmt.Errorf("[ERROR] Error received while removing old permissions from ibm_compute_user: %s", err) } // 'add' new permission set _, err = service.AddBulkPortalPermission(newPermissions) if err != nil { - return fmt.Errorf("Error received while assigning new permissions to ibm_compute_user: %s", err) + return fmt.Errorf("[ERROR] Error received while assigning new permissions to ibm_compute_user: %s", err) } } @@ -445,7 +446,7 @@ func resourceIBMComputeUserUpdate(d *schema.ResourceData, meta interface{}) erro if len(keys) == 0 { // means key does not exist, so create one. key, err := service.AddApiAuthenticationKey() if err != nil { - return fmt.Errorf("Error creating API key while editing ibm_compute_user resource: %s", err) + return fmt.Errorf("[ERROR] Error creating API key while editing ibm_compute_user resource: %s", err) } d.Set("api_key", key) @@ -457,12 +458,11 @@ func resourceIBMComputeUserUpdate(d *schema.ResourceData, meta interface{}) erro if len(keys) > 0 { success, err := service.RemoveApiAuthenticationKey(keys[0].Id) if err != nil { - return fmt.Errorf("Error deleting API key while editing ibm_compute_user resource: %s", err) + return fmt.Errorf("[ERROR] Error deleting API key while editing ibm_compute_user resource: %s", err) } if !success { - return fmt.Errorf( - "The API reported removal of the api key was not successful for %s", + return fmt.Errorf("[ERROR] The API reported removal of the api key was not successful for %s", d.Get("email").(string), ) } @@ -474,7 +474,7 @@ func resourceIBMComputeUserUpdate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMComputeUserDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetUserCustomerService(sess) id, _ := strconv.Atoi(d.Id()) @@ -486,7 +486,7 @@ func resourceIBMComputeUserDelete(d *schema.ResourceData, meta interface{}) erro log.Printf("[INFO] Deleting IBM Cloud user: %d", id) _, err := service.Id(id).EditObject(&user) if err != nil { - return fmt.Errorf("Error deleting IBM Cloud user: %s", err) + return fmt.Errorf("[ERROR] Error deleting IBM Cloud user: %s", err) } d.SetId("") @@ -494,7 +494,7 @@ func resourceIBMComputeUserDelete(d *schema.ResourceData, meta interface{}) erro } func resourceIBMComputeUserExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetUserCustomerService(meta.(ClientSession).SoftLayerSession()) + service := services.GetUserCustomerService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) @@ -518,7 +518,7 @@ func getTimezoneIDByName(sess *session.Session, shortName string) (int, error) { } } - return -1, fmt.Errorf("Timezone %s could not be found", shortName) + return -1, fmt.Errorf("[ERROR] Timezone %s could not be found", shortName) } @@ -537,6 +537,6 @@ func getUserStatusIDByName(sess *session.Session, name string) (int, error) { } } - return -1, fmt.Errorf("User status %s could not be found", name) + return -1, fmt.Errorf("[ERROR] User status %s could not be found", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_vm_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_vm_instance.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_vm_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_vm_instance.go index 0655064eae..f53c1c8b7a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_compute_vm_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_compute_vm_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "bytes" @@ -16,7 +16,9 @@ import ( "strings" "time" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -31,7 +33,7 @@ import ( type storageIds []int func (s storageIds) Storages(meta interface{}) ([]datatypes.Network_Storage, error) { - storageService := services.GetNetworkStorageService(meta.(ClientSession).SoftLayerSession()) + storageService := services.GetNetworkStorageService(meta.(conns.ClientSession).SoftLayerSession()) storages := make([]datatypes.Network_Storage, len(s)) for i, id := range s { @@ -61,7 +63,7 @@ const ( retryDelayForModifyingStorageAccess = 10 * time.Second ) -func resourceIBMComputeVmInstance() *schema.Resource { +func ResourceIBMComputeVmInstance() *schema.Resource { return &schema.Resource{ Create: resourceIBMComputeVmInstanceCreate, Read: resourceIBMComputeVmInstanceRead, @@ -454,7 +456,7 @@ func resourceIBMComputeVmInstance() *schema.Resource { Type: schema.TypeInt, Optional: true, ForceNew: true, - ValidateFunc: validateSecondaryIPCount, + ValidateFunc: validate.ValidateSecondaryIPCount, DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { // secondary_ip_count is only used when a virtual_guest resource is created. if d.State() == nil { @@ -507,7 +509,7 @@ func resourceIBMComputeVmInstance() *schema.Resource { "notes": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateNotes, + ValidateFunc: validate.ValidateNotes, }, "local_disk": { @@ -550,9 +552,9 @@ func resourceIBMComputeVmInstance() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, ConflictsWith: []string{"private_network_only", "public_bandwidth_unlimited"}, - ValidateFunc: validatePublicBandwidth, + ValidateFunc: validate.ValidatePublicBandwidth, }, // Monthly only @@ -562,7 +564,7 @@ func resourceIBMComputeVmInstance() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, ConflictsWith: []string{"private_network_only", "public_bandwidth_limited"}, }, @@ -570,7 +572,7 @@ func resourceIBMComputeVmInstance() *schema.Resource { Type: schema.TypeInt, Optional: true, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, // Quote based provisioning only @@ -581,17 +583,17 @@ func resourceIBMComputeVmInstance() *schema.Resource { Description: "Quote ID for Quote based provisioning", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", @@ -603,7 +605,7 @@ func resourceIBMComputeVmInstance() *schema.Resource { type vmMember map[string]interface{} func getSubnetID(subnet string, meta interface{}) (int, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) subnetInfo := strings.Split(subnet, "/") if len(subnetInfo) != 2 { @@ -625,7 +627,7 @@ func getSubnetID(subnet string, meta interface{}) (int, error) { GetSubnets() if err != nil { - return 0, fmt.Errorf("Error looking up Subnet: %s", err) + return 0, fmt.Errorf("[ERROR] Error looking up Subnet: %s", err) } if len(subnets) < 1 { @@ -642,7 +644,7 @@ func resourceIBMBulkVMHostHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["hostname"].(string))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } func getNameForBlockDevice(i int) string { @@ -715,7 +717,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf // it is not using the default value. networkSpeed := d.Get("network_speed").(int) if networkSpeed == 0 { - networkSpeed = resourceIBMComputeVmInstance().Schema["network_speed"].Default.(int) + networkSpeed = ResourceIBMComputeVmInstance().Schema["network_speed"].Default.(int) } networkComponent := datatypes.Virtual_Guest_Network_Component{ @@ -751,16 +753,16 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if reservedGroupID, ok := d.GetOk("reserved_capacity_id"); ok { if *opts.HourlyBillingFlag || *opts.LocalDiskFlag { - return vms, fmt.Errorf("Unable to provision a reserved instance with a hourly_billing false or local_disk true") + return vms, fmt.Errorf("[ERROR] Unable to provision a reserved instance with a hourly_billing false or local_disk true") } grpID := reservedGroupID.(int) opts.ReservedCapacityGroup = &datatypes.Virtual_ReservedCapacityGroup{ Id: sl.Int(grpID), } - service := services.GetVirtualReservedCapacityGroupService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualReservedCapacityGroupService(meta.(conns.ClientSession).SoftLayerSession()) grp, err := service.Id(grpID).Mask("id,instances[id, billingItem[id, item[id,keyName]]]").GetObject() if err != nil { - return vms, fmt.Errorf("Error looking up reserved capacity: %s", err) + return vms, fmt.Errorf("[ERROR] Error looking up reserved capacity: %s", err) } capacityFlavor := *grp.Instances[0].BillingItem.Item.KeyName primaryDisks := d.Get("reserved_instance_primary_disk").(int) @@ -778,17 +780,17 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if reservedGroupName, ok := d.GetOk("reserved_capacity_name"); ok { if *opts.HourlyBillingFlag || *opts.LocalDiskFlag { - return vms, fmt.Errorf("Unable to provision a reserved instance with a hourly_billing false or local_disk true") + return vms, fmt.Errorf("[ERROR] Unable to provision a reserved instance with a hourly_billing false or local_disk true") } grpName := reservedGroupName.(string) - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) groups, err := service. Mask("id,name,instances[id,billingItem[id,item[id,keyName]]]"). Filter(filter.Path("reservedCapacityGroups.name").Eq(grpName).Build()). GetReservedCapacityGroups() if err != nil { - return vms, fmt.Errorf("Error looking up reserved capacity '%s': %s", grpName, err) + return vms, fmt.Errorf("[ERROR] Error looking up reserved capacity '%s': %s", grpName, err) } grps := []datatypes.Virtual_ReservedCapacityGroup{} for _, g := range groups { @@ -798,7 +800,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf } } if len(grps) == 0 { - return vms, fmt.Errorf("Error looking up reserved capacity '%s'", grpName) + return vms, fmt.Errorf("[ERROR] Error looking up reserved capacity '%s'", grpName) } grp := grps[0] @@ -821,24 +823,24 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if placementGroupID, ok := d.GetOk("placement_group_id"); ok { grpID := placementGroupID.(int) - service := services.GetVirtualPlacementGroupService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualPlacementGroupService(meta.(conns.ClientSession).SoftLayerSession()) grp, err := service.Id(grpID).Mask("id,name,backendRouter[datacenter[name]]").GetObject() if err != nil { - return vms, fmt.Errorf("Error looking up placement group: %s", err) + return vms, fmt.Errorf("[ERROR] Error looking up placement group: %s", err) } opts.PlacementGroupId = sl.Int(*grp.Id) } else if placementGroupName, ok := d.GetOk("placement_group_name"); ok { grpName := placementGroupName.(string) - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) groups, err := service. Mask("id,name,backendRouter[hostname,datacenter[name]]"). Filter(filter.Path("placementGroup.name").Eq(grpName).Build()). GetPlacementGroups() if err != nil { - return vms, fmt.Errorf("Error looking up placement group '%s': %s", grpName, err) + return vms, fmt.Errorf("[ERROR] Error looking up placement group '%s': %s", grpName, err) } grps := []datatypes.Virtual_PlacementGroup{} for _, g := range groups { @@ -848,7 +850,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf } } if len(grps) == 0 { - return vms, fmt.Errorf("Error looking up placement group '%s'", grpName) + return vms, fmt.Errorf("[ERROR] Error looking up placement group '%s'", grpName) } grp := grps[0] @@ -877,16 +879,16 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf } } else if dedicatedHostName, ok := d.GetOk("dedicated_host_name"); ok { hostName := dedicatedHostName.(string) - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) hosts, err := service. Mask("id"). Filter(filter.Path("dedicatedHosts.name").Eq(hostName).Build()). GetDedicatedHosts() if err != nil { - return vms, fmt.Errorf("Error looking up dedicated host '%s': %s", hostName, err) + return vms, fmt.Errorf("[ERROR] Error looking up dedicated host '%s': %s", hostName, err) } else if len(hosts) == 0 { - return vms, fmt.Errorf("Error looking up dedicated host '%s'", hostName) + return vms, fmt.Errorf("[ERROR] Error looking up dedicated host '%s'", hostName) } opts.DedicatedHost = &hosts[0] @@ -894,7 +896,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if transientFlag, ok := d.GetOk("transient"); ok { if !*opts.HourlyBillingFlag || *opts.LocalDiskFlag { - return vms, fmt.Errorf("Unable to provision a transient instance with a hourly_billing false or local_disk true") + return vms, fmt.Errorf("[ERROR] Unable to provision a transient instance with a hourly_billing false or local_disk true") } opts.TransientGuestFlag = sl.Bool(transientFlag.(bool)) } @@ -904,16 +906,15 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if imgID, ok := d.GetOk("image_id"); ok { imageID := imgID.(int) service := services. - GetVirtualGuestBlockDeviceTemplateGroupService(meta.(ClientSession).SoftLayerSession()) + GetVirtualGuestBlockDeviceTemplateGroupService(meta.(conns.ClientSession).SoftLayerSession()) image, err := service. Mask("id,globalIdentifier").Id(imageID). GetObject() if err != nil { - return vms, fmt.Errorf("Error looking up image %d: %s", imageID, err) + return vms, fmt.Errorf("[ERROR] Error looking up image %d: %s", imageID, err) } else if image.GlobalIdentifier == nil { - return vms, fmt.Errorf( - "Image template %d does not have a global identifier", imageID) + return vms, fmt.Errorf("[ERROR] Image template %d does not have a global identifier", imageID) } opts.BlockDeviceTemplateGroup = &datatypes.Virtual_Guest_Block_Device_Template_Group{ @@ -945,7 +946,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if publicSubnet != "" { primarySubnetID, err := getSubnetID(publicSubnet, meta) if err != nil { - return vms, fmt.Errorf("Error creating virtual guest: %s", err) + return vms, fmt.Errorf("[ERROR] Error creating virtual guest: %s", err) } primaryNetworkComponent.NetworkVlan.PrimarySubnetId = &primarySubnetID usePrimaryNetworkComponent = true @@ -981,7 +982,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf if privateSubnet != "" { primarySubnetID, err := getSubnetID(privateSubnet, meta) if err != nil { - return vms, fmt.Errorf("Error creating virtual guest: %s", err) + return vms, fmt.Errorf("[ERROR] Error creating virtual guest: %s", err) } primaryBackendNetworkComponent.NetworkVlan.PrimarySubnetId = &primarySubnetID usePrimaryBackendNetworkComponent = true @@ -1034,7 +1035,7 @@ func getVirtualGuestTemplateFromResourceData(d *schema.ResourceData, meta interf func resourceIBMComputeVmInstanceCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualGuestService(sess) var id int @@ -1056,11 +1057,11 @@ func resourceIBMComputeVmInstanceCreate(d *schema.ResourceData, meta interface{} } if dcName == "" && len(retryOptions) == 0 { - return fmt.Errorf("Provide either `datacenter` or `datacenter_choice`") + return fmt.Errorf("[ERROR] Provide either `datacenter` or `datacenter_choice`") } if (d.Get("hostname").(string) == "" || d.Get("domain").(string) == "") && len(d.Get("bulk_vms").(*schema.Set).List()) == 0 { - return fmt.Errorf("Provide either `hostname` and `domain` or `bulk_vms`") + return fmt.Errorf("[ERROR] Provide either `hostname` and `domain` or `bulk_vms`") } if dcName != "" { @@ -1078,13 +1079,13 @@ func resourceIBMComputeVmInstanceCreate(d *schema.ResourceData, meta interface{} receipt, err1 = placeOrder(d, meta, dcName, publicVlan, privateVlan, quote_id) } else if len(retryOptions) > 0 { - err := validateDatacenterOption(retryOptions, []string{"datacenter", "public_vlan_id", "private_vlan_id"}) + err := validate.ValidateDatacenterOption(retryOptions, []string{"datacenter", "public_vlan_id", "private_vlan_id"}) if err != nil { return err } for _, option := range retryOptions { if option == nil { - return fmt.Errorf("Provide a valid `datacenter_choice`") + return fmt.Errorf("[ERROR] Provide a valid `datacenter_choice`") } center := option.(map[string]interface{}) var publicVlan, privateVlan int @@ -1112,7 +1113,7 @@ func resourceIBMComputeVmInstanceCreate(d *schema.ResourceData, meta interface{} } if err1 != nil { - return fmt.Errorf("Error ordering virtual guest: %s", err1) + return fmt.Errorf("[ERROR] Error ordering virtual guest: %s", err1) } var idStrings []string @@ -1149,11 +1150,11 @@ func resourceIBMComputeVmInstanceCreate(d *schema.ResourceData, meta interface{} var storageIds []int if fileStorageSet := d.Get("file_storage_ids").(*schema.Set); len(fileStorageSet.List()) > 0 { - storageIds = expandIntList(fileStorageSet.List()) + storageIds = flex.ExpandIntList(fileStorageSet.List()) } if blockStorageSet := d.Get("block_storage_ids").(*schema.Set); len(blockStorageSet.List()) > 0 { - storageIds = append(storageIds, expandIntList(blockStorageSet.List())...) + storageIds = append(storageIds, flex.ExpandIntList(blockStorageSet.List())...) } if len(storageIds) > 0 { err := addAccessToStorageList(service.Id(id), id, storageIds, meta) @@ -1182,14 +1183,14 @@ func resourceIBMComputeVmInstanceCreate(d *schema.ResourceData, meta interface{} } func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) error { - service := services.GetVirtualGuestService(meta.(ClientSession).SoftLayerSession()) - parts, err := vmIdParts(d.Id()) + service := services.GetVirtualGuestService(meta.(conns.ClientSession).SoftLayerSession()) + parts, err := flex.VmIdParts(d.Id()) if err != nil { return err } id, err := strconv.Atoi(parts[0]) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).Mask( @@ -1214,7 +1215,7 @@ func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) ).GetObject() if err != nil { - return fmt.Errorf("Error retrieving virtual guest: %s", err) + return fmt.Errorf("[ERROR] Error retrieving virtual guest: %s", err) } if len(parts) == 1 { @@ -1225,7 +1226,7 @@ func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) for _, part := range parts { vmId, err := strconv.Atoi(part) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } vmResult, err := service.Id(vmId).Mask( "hostname,domain", @@ -1283,9 +1284,9 @@ func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) ), ) if result.OperatingSystemReferenceCode != nil && strings.HasPrefix(*result.OperatingSystemReferenceCode, "WIN") { - d.Set("disks", flattenDisksForWindows(result)) + d.Set("disks", flex.FlattenDisksForWindows(result)) } else { - d.Set("disks", flattenDisks(result)) + d.Set("disks", flex.FlattenDisks(result)) } d.Set("cores", *result.StartCpus) d.Set("memory", *result.MaxMemory) @@ -1394,12 +1395,12 @@ func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) } storages := result.AllowedNetworkStorage - d.Set("block_storage_ids", flattenBlockStorageID(storages)) - d.Set("file_storage_ids", flattenFileStorageID(storages)) + d.Set("block_storage_ids", flex.FlattenBlockStorageID(storages)) + d.Set("file_storage_ids", flex.FlattenFileStorageID(storages)) sshKeys := result.SshKeys if len(sshKeys) > 0 { - d.Set("ssh_key_ids", flattenSSHKeyIDs(sshKeys)) + d.Set("ssh_key_ids", flex.FlattenSSHKeyIDs(sshKeys)) } // Set connection info @@ -1417,9 +1418,9 @@ func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) } } - d.Set(ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/gen1/infrastructure/virtual-server/%s/details#main", d.Id())) - d.Set(ResourceName, *result.Hostname) - d.Set(ResourceStatus, *result.Status.Name) + d.Set(flex.ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/gen1/infrastructure/virtual-server/%s/details#main", d.Id())) + d.Set(flex.ResourceName, *result.Hostname) + d.Set(flex.ResourceStatus, *result.Status.Name) err = readSecondaryIPAddresses(d, meta, result.PrimaryIpAddress) return err } @@ -1427,7 +1428,7 @@ func resourceIBMComputeVmInstanceRead(d *schema.ResourceData, meta interface{}) func readSecondaryIPAddresses(d *schema.ResourceData, meta interface{}, primaryIPAddress *string) error { d.Set("secondary_ip_addresses", nil) if primaryIPAddress != nil { - secondarySubnetResult, err := services.GetAccountService(meta.(ClientSession).SoftLayerSession()). + secondarySubnetResult, err := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()). Mask("ipAddresses[id,ipAddress],subnetType"). Filter(filter.Build(filter.Path("publicSubnets.endPointIpAddress.ipAddress").Eq(*primaryIPAddress))). GetPublicSubnets() @@ -1453,21 +1454,21 @@ func readSecondaryIPAddresses(d *schema.ResourceData, meta interface{}, primaryI } func resourceIBMComputeVmInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualGuestService(sess) - parts, err := vmIdParts(d.Id()) + parts, err := flex.VmIdParts(d.Id()) if err != nil { return err } id, err := strconv.Atoi(parts[0]) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).GetObject() if err != nil { - return fmt.Errorf("Error retrieving virtual guest: %s", err) + return fmt.Errorf("[ERROR] Error retrieving virtual guest: %s", err) } isChanged := false @@ -1488,7 +1489,7 @@ func resourceIBMComputeVmInstanceUpdate(d *schema.ResourceData, meta interface{} if isChanged { _, err = service.Id(id).EditObject(&result) if err != nil { - return fmt.Errorf("Couldn't update virtual guest: %s", err) + return fmt.Errorf("[ERROR] Could n't update virtual guest: %s", err) } } @@ -1567,13 +1568,13 @@ func resourceIBMComputeVmInstanceUpdate(d *schema.ResourceData, meta interface{} presetKeyName := d.Get("flavor_key_name").(string) _, err = virtual.UpgradeVirtualGuestWithPreset(sess.SetRetries(0), &result, presetKeyName, upgradeOptions) if err != nil { - return fmt.Errorf("Couldn't upgrade virtual guest: %s", err) + return fmt.Errorf("[ERROR] Could n't upgrade virtual guest: %s", err) } } else { _, err = virtual.UpgradeVirtualGuest(sess.SetRetries(0), &result, upgradeOptions) if err != nil { - return fmt.Errorf("Couldn't upgrade virtual guest: %s", err) + return fmt.Errorf("[ERROR] Could n't upgrade virtual guest: %s", err) } } @@ -1600,16 +1601,16 @@ func modifyStorageAccess(sam storageAccessModifier, deviceID int, meta interface os := o.(*schema.Set) ns := n.(*schema.Set) - remove = expandIntList(os.Difference(ns).List()) - add = expandIntList(ns.Difference(os).List()) + remove = flex.ExpandIntList(os.Difference(ns).List()) + add = flex.ExpandIntList(ns.Difference(os).List()) } if d.HasChange("block_storage_ids") { o, n := d.GetChange("block_storage_ids") os := o.(*schema.Set) ns := n.(*schema.Set) - remove = append(remove, expandIntList(os.Difference(ns).List())...) - add = append(add, expandIntList(ns.Difference(os).List())...) + remove = append(remove, flex.ExpandIntList(os.Difference(ns).List())...) + add = append(add, flex.ExpandIntList(ns.Difference(os).List())...) } if len(add) > 0 { @@ -1628,22 +1629,22 @@ func modifyStorageAccess(sam storageAccessModifier, deviceID int, meta interface } func resourceIBMComputeVmInstanceDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualGuestService(sess) - parts, err := vmIdParts(d.Id()) + parts, err := flex.VmIdParts(d.Id()) if err != nil { return err } for _, part := range parts { id, err := strconv.Atoi(part) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = WaitForNoActiveTransactions(id, d, d.Timeout(schema.TimeoutDelete), meta) if err != nil { - return fmt.Errorf("Error deleting virtual guest, couldn't wait for zero active transactions: %s", err) + return fmt.Errorf("[ERROR] Error deleting virtual guest, couldn't wait for zero active transactions: %s", err) } err = detachSecurityGroupNetworkComponentBindings(d, meta, id) if err != nil { @@ -1651,7 +1652,7 @@ func resourceIBMComputeVmInstanceDelete(d *schema.ResourceData, meta interface{} } ok, err := service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting virtual guest: %s", err) + return fmt.Errorf("[ERROR] Error deleting virtual guest: %s", err) } if !ok { @@ -1664,7 +1665,7 @@ func resourceIBMComputeVmInstanceDelete(d *schema.ResourceData, meta interface{} } func detachSecurityGroupNetworkComponentBindings(d *schema.ResourceData, meta interface{}, id int) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualGuestService(sess) publicSgIDs := d.Get("public_security_group_ids").(*schema.Set).List() privateSgIDS := d.Get("private_security_group_ids").(*schema.Set).List() @@ -1732,24 +1733,24 @@ func genID() (interface{}, error) { func WaitForUpgradeTransactionsToAppear(d *schema.ResourceData, meta interface{}) (interface{}, error) { log.Printf("Waiting for server (%s) to have upgrade transactions", d.Id()) - parts, err := vmIdParts(d.Id()) + parts, err := flex.VmIdParts(d.Id()) if err != nil { return nil, err } id, err := strconv.Atoi(parts[0]) if err != nil { - return nil, fmt.Errorf("The instance ID %s must be numeric", d.Id()) + return nil, fmt.Errorf("[ERROR] The instance ID %s must be numeric", d.Id()) } stateConf := &resource.StateChangeConf{ Pending: []string{"retry", pendingUpgrade}, Target: []string{inProgressUpgrade}, Refresh: func() (interface{}, string, error) { - service := services.GetVirtualGuestService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualGuestService(meta.(conns.ClientSession).SoftLayerSession()) transactions, err := service.Id(id).GetActiveTransactions() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Couldn't fetch active transactions: %s", err) + return nil, "", fmt.Errorf("[ERROR] Could n't fetch active transactions: %s", err) } return false, "retry", nil } @@ -1775,13 +1776,13 @@ func WaitForNoActiveTransactions(id int, d *schema.ResourceData, timeout time.Du Pending: []string{"retry", activeTransaction}, Target: []string{idleTransaction}, Refresh: func() (interface{}, string, error) { - service := services.GetVirtualGuestService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualGuestService(meta.(conns.ClientSession).SoftLayerSession()) transactions, err := service.Id(id).GetActiveTransactions() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return nil, "", nil } - return false, "retry", fmt.Errorf("Couldn't get active transactions: %s", err) + return false, "retry", fmt.Errorf("[ERROR] Could n't get active transactions: %s", err) } if len(transactions) == 0 { return transactions, idleTransaction, nil @@ -1799,7 +1800,7 @@ func WaitForNoActiveTransactions(id int, d *schema.ResourceData, timeout time.Du // WaitForVirtualGuestAvailable Waits for virtual guest creation func WaitForVirtualGuestAvailable(id int, d *schema.ResourceData, meta interface{}) (interface{}, error) { log.Printf("Waiting for server (%s) to be available.", d.Id()) - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() stateConf := &resource.StateChangeConf{ Pending: []string{"retry", virtualGuestProvisioning}, Target: []string{virtualGuestAvailable}, @@ -1820,7 +1821,7 @@ func virtualGuestStateRefreshFunc(sess *session.Session, instanceID int, d *sche result, err := service.Id(instanceID).Mask("activeTransaction,primaryBackendIpAddress,primaryIpAddress").GetObject() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Error retrieving virtual guest: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving virtual guest: %s", err) } return false, "retry", nil } @@ -1849,7 +1850,7 @@ func virtualGuestStateRefreshFunc(sess *session.Session, instanceID int, d *sche Filter(filter.Build(filter.Path("publicSubnets.endPointIpAddress.virtualGuest.id").Eq(fmt.Sprintf("%d", instanceID)))). GetPublicSubnets() if err != nil { - return nil, "", fmt.Errorf("Error retrieving secondary ip address: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving secondary ip address: %s", err) } if len(secondarySubnetResult) == 0 { return result, virtualGuestProvisioning, nil @@ -1861,14 +1862,14 @@ func virtualGuestStateRefreshFunc(sess *session.Session, instanceID int, d *sche } func resourceIBMComputeVmInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetVirtualGuestService(meta.(ClientSession).SoftLayerSession()) - parts, err := vmIdParts(d.Id()) + service := services.GetVirtualGuestService(meta.(conns.ClientSession).SoftLayerSession()) + parts, err := flex.VmIdParts(d.Id()) if err != nil { return false, err } guestID, err := strconv.Atoi(parts[0]) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(guestID).GetObject() @@ -1900,10 +1901,10 @@ func getTags(d dataRetriever) string { } func setGuestTags(id int, tags string, meta interface{}) error { - service := services.GetVirtualGuestService(meta.(ClientSession).SoftLayerSession()) + service := services.GetVirtualGuestService(meta.(conns.ClientSession).SoftLayerSession()) _, err := service.Id(id).SetTags(sl.String(tags)) if err != nil { - return fmt.Errorf("Could not set tags on virtual guest %d", id) + return fmt.Errorf("[ERROR] Could not set tags on virtual guest %d", id) } return nil } @@ -1926,7 +1927,7 @@ func addAccessToStorageList(sam storageAccessModifier, deviceID int, ids storage time.Sleep(retryDelayForModifyingStorageAccess) continue } - return fmt.Errorf("Could not authorize Device %d, access to the following storages %q, %q", deviceID, ids, err) + return fmt.Errorf("[ERROR] Could not authorize Device %d, access to the following storages %q, %q", deviceID, ids, err) } log.Printf("[INFO] Device authorized to access %q", ids) break @@ -1947,7 +1948,7 @@ func removeAccessToStorageList(sam storageAccessModifier, deviceID int, ids stor time.Sleep(retryDelayForModifyingStorageAccess) continue } - return fmt.Errorf("Could not remove Device %d, access to the following storages %q, %q", deviceID, ids, err) + return fmt.Errorf("[ERROR] Could not remove Device %d, access to the following storages %q, %q", deviceID, ids, err) } log.Printf("[INFO] Devices's access to %q have been removed", ids) break @@ -1956,20 +1957,20 @@ func removeAccessToStorageList(sam storageAccessModifier, deviceID int, ids stor } func setNotes(id int, d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualGuestService(sess) if notes := d.Get("notes").(string); notes != "" { result, err := service.Id(id).GetObject() if err != nil { - return fmt.Errorf("Error retrieving virtual guest: %s", err) + return fmt.Errorf("[ERROR] Error retrieving virtual guest: %s", err) } result.Notes = sl.String(notes) _, err = service.Id(id).EditObject(&result) if err != nil { - return fmt.Errorf("Could not set note on virtual guest %d", id) + return fmt.Errorf("[ERROR] Could not set note on virtual guest %d", id) } } @@ -1977,7 +1978,7 @@ func setNotes(id int, d *schema.ResourceData, meta interface{}) error { } func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVlanID, privateVlanID, quote_id int) (datatypes.Container_Product_Order_Receipt, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetVirtualGuestService(sess) options, err := getVirtualGuestTemplateFromResourceData(d, meta, name, publicVlanID, privateVlanID, quote_id) @@ -2047,7 +2048,7 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla opts.OperatingSystemReferenceCode = sl.String("UBUNTU_LATEST") template, err = service.GenerateOrderTemplate(&opts) if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } // Remove temporary OS from actual order @@ -2068,13 +2069,13 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla // Build an order template with os_reference_code template, err = service.GenerateOrderTemplate(&opts) if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } } items, err := product.GetPackageProducts(sess, *template.PackageId, productItemMaskWithPriceLocationGroupID) if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } privateNetworkOnly := d.Get("private_network_only").(bool) @@ -2082,7 +2083,7 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla secondaryIPCount := d.Get("secondary_ip_count").(int) if secondaryIPCount > 0 { if privateNetworkOnly { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Unable to configure public secondary addresses with a private_network_only option") + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Unable to configure public secondary addresses with a private_network_only option") } keyName := strconv.Itoa(secondaryIPCount) + "_PUBLIC_IP_ADDRESSES" price, err := getItemPriceId(items, "sec_ip_addresses", keyName) @@ -2094,22 +2095,22 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla if d.Get("ipv6_enabled").(bool) { if privateNetworkOnly { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Unable to configure a public IPv6 address with a private_network_only option") + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Unable to configure a public IPv6 address with a private_network_only option") } price, err := getItemPriceId(items, "pri_ipv6_addresses", "1_IPV6_ADDRESS") if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } template.Prices = append(template.Prices, price) } if d.Get("ipv6_static_enabled").(bool) { if privateNetworkOnly { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Unable to configure a public static IPv6 address with a private_network_only option") + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Unable to configure a public static IPv6 address with a private_network_only option") } price, err := getItemPriceId(items, "static_ipv6_addresses", "64_BLOCK_STATIC_PUBLIC_IPV6_ADDRESSES") if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } template.Prices = append(template.Prices, price) } @@ -2118,7 +2119,7 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla // Add public bandwidth limited if publicBandwidth, ok := d.GetOk("public_bandwidth_limited"); ok { if *opts.HourlyBillingFlag { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Unable to configure a public bandwidth with a hourly_billing true") + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Unable to configure a public bandwidth with a hourly_billing true") } // Remove Default bandwidth price prices := make([]datatypes.Product_Item_Price, len(template.Prices)) @@ -2137,7 +2138,7 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla keyName := "BANDWIDTH_" + strconv.Itoa(publicBandwidth.(int)) + "_GB" price, err := getItemPriceId(items, "bandwidth", keyName) if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } template.Prices = append(template.Prices, price) } @@ -2146,7 +2147,7 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla publicUnlimitedBandwidth := d.Get("public_bandwidth_unlimited").(bool) if publicUnlimitedBandwidth { if *opts.HourlyBillingFlag { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Unable to configure a public bandwidth with a hourly_billing true") + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Unable to configure a public bandwidth with a hourly_billing true") } networkSpeed := d.Get("network_speed").(int) if networkSpeed != 100 { @@ -2168,20 +2169,20 @@ func placeOrder(d *schema.ResourceData, meta interface{}, name string, publicVla template.Prices = prices[:i] price, err := getItemPriceId(items, "bandwidth", "BANDWIDTH_UNLIMITED_100_MBPS_UPLINK") if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } template.Prices = append(template.Prices, price) } if evault, ok := d.GetOk("evault"); ok { if *opts.HourlyBillingFlag { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Unable to configure a evault with hourly_billing true") + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Unable to configure a evault with hourly_billing true") } keyName := "EVAULT_" + strconv.Itoa(evault.(int)) + "_GB" price, err := getItemPriceId(items, "evault", keyName) if err != nil { - return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("Error generating order template: %s", err) + return datatypes.Container_Product_Order_Receipt{}, fmt.Errorf("[ERROR] Error generating order template: %s", err) } template.Prices = append(template.Prices, price) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_domain.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_domain.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_domain.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_domain.go index a58524858a..792e7ac623 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_domain.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_domain.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -9,13 +9,14 @@ import ( "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMDNSDomain() *schema.Resource { +func ResourceIBMDNSDomain() *schema.Resource { return &schema.Resource{ Exists: resourceIBMDNSDomainExists, Create: resourceIBMDNSDomainCreate, @@ -61,7 +62,7 @@ func resourceIBMDNSDomain() *schema.Resource { } func resourceIBMDNSDomainCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainService(sess.SetRetries(0)) // prepare creation parameters @@ -85,7 +86,7 @@ func resourceIBMDNSDomainCreate(d *schema.ResourceData, meta interface{}) error // create Dns_Domain object response, err := service.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Dns Domain: %s", err) + return fmt.Errorf("[ERROR] Error creating Dns Domain: %s", err) } // populate id @@ -98,7 +99,7 @@ func resourceIBMDNSDomainCreate(d *schema.ResourceData, meta interface{}) error } func resourceIBMDNSDomainRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainService(sess) dnsId, _ := strconv.Atoi(d.Id()) @@ -108,7 +109,7 @@ func resourceIBMDNSDomainRead(d *schema.ResourceData, meta interface{}) error { "id,name,updateDate,resourceRecords", ).GetObject() if err != nil { - return fmt.Errorf("Error retrieving Dns Domain %d: %s", dnsId, err) + return fmt.Errorf("[ERROR] Error retrieving Dns Domain %d: %s", dnsId, err) } // populate fields @@ -130,7 +131,7 @@ func resourceIBMDNSDomainRead(d *schema.ResourceData, meta interface{}) error { func resourceIBMDNSDomainUpdate(d *schema.ResourceData, meta interface{}) error { // If the target has been updated, find the corresponding dns record and update its data - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() domainService := services.GetDnsDomainService(sess) service := services.GetDnsDomainResourceRecordService(sess.SetRetries(0)) @@ -147,7 +148,7 @@ func resourceIBMDNSDomainUpdate(d *schema.ResourceData, meta interface{}) error "id,name,updateDate,resourceRecords", ).GetObject() if err != nil { - return fmt.Errorf("Error retrieving DNS resource %d: %s", domainId, err) + return fmt.Errorf("[ERROR] Error retrieving DNS resource %d: %s", domainId, err) } // find a record with host @; that will have the current target. @@ -159,7 +160,7 @@ func resourceIBMDNSDomainUpdate(d *schema.ResourceData, meta interface{}) error } if record.Id == nil { - return fmt.Errorf("Could not find DNS target record for domain %s (%d)", + return fmt.Errorf("[ERROR] Could not find DNS target record for domain %s (%d)", sl.Get(domain.Name), sl.Get(domain.Id)) } @@ -168,7 +169,7 @@ func resourceIBMDNSDomainUpdate(d *schema.ResourceData, meta interface{}) error _, err = service.Id(*record.Id).EditObject(&record) if err != nil { - return fmt.Errorf("Error editing DNS target record for domain %s (%d): %s", + return fmt.Errorf("[ERROR] Error editing DNS target record for domain %s (%d): %s", sl.Get(domain.Name), sl.Get(domain.Id), err) } @@ -176,22 +177,22 @@ func resourceIBMDNSDomainUpdate(d *schema.ResourceData, meta interface{}) error } func resourceIBMDNSDomainDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainService(sess) dnsId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Error deleting Dns Domain: %s", err) + return fmt.Errorf("[ERROR] Error deleting Dns Domain: %s", err) } log.Printf("[INFO] Deleting Dns Domain: %d", dnsId) result, err := service.Id(dnsId).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Dns Domain: %s", err) + return fmt.Errorf("[ERROR] Error deleting Dns Domain: %s", err) } if !result { - return errors.New("Error deleting Dns Domain") + return errors.New("[ERROR] Error deleting Dns Domain") } d.SetId("") @@ -199,12 +200,12 @@ func resourceIBMDNSDomainDelete(d *schema.ResourceData, meta interface{}) error } func resourceIBMDNSDomainExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainService(sess) dnsId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(dnsId).GetObject() @@ -214,7 +215,7 @@ func resourceIBMDNSDomainExists(d *schema.ResourceData, meta interface{}) (bool, return false, nil } } - return false, fmt.Errorf("Error retrieving domain info: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving domain info: %s", err) } return result.Id != nil && *result.Id == dnsId, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_domain_registration_nameservers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_domain_registration_nameservers.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_domain_registration_nameservers.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_domain_registration_nameservers.go index 0737b82e25..bf174e3797 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_domain_registration_nameservers.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_domain_registration_nameservers.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( //"errors" @@ -9,11 +9,12 @@ import ( "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/services" ) -func resourceIBMDNSDomainRegistrationNameservers() *schema.Resource { +func ResourceIBMDNSDomainRegistrationNameservers() *schema.Resource { return &schema.Resource{ Create: resourceIBMDNSDomainRegistrationNSCreate, Read: resourceIBMDNSDomainRegistrationNSRead, @@ -25,7 +26,7 @@ func resourceIBMDNSDomainRegistrationNameservers() *schema.Resource { Required: true, Description: "DNS registration ID", }, - "name_servers": &schema.Schema{ + "name_servers": { Description: "Custom name servers for the domain registration", Type: schema.TypeSet, Required: true, @@ -33,7 +34,7 @@ func resourceIBMDNSDomainRegistrationNameservers() *schema.Resource { Type: schema.TypeString, }, }, - "original_name_servers": &schema.Schema{ + "original_name_servers": { Description: "Save of name servers prior to update", Type: schema.TypeSet, Computed: true, @@ -46,7 +47,7 @@ func resourceIBMDNSDomainRegistrationNameservers() *schema.Resource { } func resourceIBMDNSDomainRegistrationNSCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() nService := services.GetDnsDomainRegistrationService(sess) dnsId, _ := strconv.Atoi(d.Get("dns_registration_id").(string)) newNameServers := d.Get("name_servers").(*schema.Set).List() @@ -57,11 +58,11 @@ func resourceIBMDNSDomainRegistrationNSCreate(d *schema.ResourceData, meta inter GetDomainNameservers() if err != nil { - return fmt.Errorf("Error retrieving domain Registration NSCreate: %s", err) + return fmt.Errorf("[ERROR] Error retrieving domain Registration NSCreate: %s", err) } if len(dns_domain_nameservers) == 0 { - return fmt.Errorf("No domain found with id NSCreate [%d]", dnsId) + return fmt.Errorf("[ERROR] No domain found with id NSCreate [%d]", dnsId) } oldNameServers := make([]string, len(dns_domain_nameservers[0].Nameservers)) for i, elem := range dns_domain_nameservers[0].Nameservers { @@ -99,7 +100,7 @@ func resourceIBMDNSDomainRegistrationNSCreate(d *schema.ResourceData, meta inter nsUnlock_res, err := nService.Id(dnsId). UnlockDomain() if err != nil || nsUnlock_res != true { - return fmt.Errorf("Error unlocking domain registration record: %s", err) + return fmt.Errorf("[ERROR] Error unlocking domain registration record: %s", err) } nsAdd_res := false @@ -107,7 +108,7 @@ func resourceIBMDNSDomainRegistrationNSCreate(d *schema.ResourceData, meta inter AddNameserversToDomain(addNs) if err != nil || nsAdd_res != true { - return fmt.Errorf("Error Adding name servers to record: %s", err) + return fmt.Errorf("[ERROR] Error Adding name servers to record: %s", err) } // old NS to delete, if not found in new list @@ -133,7 +134,7 @@ func resourceIBMDNSDomainRegistrationNSCreate(d *schema.ResourceData, meta inter RemoveNameserversFromDomain(delNs) if err != nil || nsDel_res != true { - return fmt.Errorf("Error Deleting name servers from record: %s", err) + return fmt.Errorf("[ERROR] Error Deleting name servers from record: %s", err) } _, _ = nService.Id(dnsId).LockDomain() @@ -146,7 +147,7 @@ func resourceIBMDNSDomainRegistrationNSCreate(d *schema.ResourceData, meta inter } func resourceIBMDNSDomainRegistrationNSRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() dnsId, _ := strconv.Atoi(d.Id()) //service := services.GetDnsDomainService(sess) @@ -156,11 +157,11 @@ func resourceIBMDNSDomainRegistrationNSRead(d *schema.ResourceData, meta interfa GetDomainNameservers() if err != nil { - return fmt.Errorf("Error retrieving domain registration NSReaD: %s", err) + return fmt.Errorf("[ERROR] Error retrieving domain registration NSReaD: %s", err) } if len(dns_domain_nameservers) == 0 { - return fmt.Errorf("No domain found with id [%d]", dnsId) + return fmt.Errorf("[ERROR] No domain found with id [%d]", dnsId) } log.Printf("list %v\n", dns_domain_nameservers) @@ -172,7 +173,7 @@ func resourceIBMDNSDomainRegistrationNSRead(d *schema.ResourceData, meta interfa log.Printf("names %v\n", ns) if err != nil { - return fmt.Errorf("Error retrieving domain registration nameservers: %s", err) + return fmt.Errorf("[ERROR] Error retrieving domain registration nameservers: %s", err) } d.SetId(fmt.Sprintf("%d", dnsId)) @@ -188,7 +189,7 @@ func resourceIBMDNSDomainRegistrationNSUpdate(d *schema.ResourceData, meta inter // No delete on IBM Cloud func resourceIBMDNSDomainRegistrationNSDelete(d *schema.ResourceData, meta interface{}) error { // Exact reverse of create to restore name servers back to original values - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() nService := services.GetDnsDomainRegistrationService(sess) dnsId, _ := strconv.Atoi(d.Get("dns_registration_id").(string)) currentNameServers := d.Get("name_servers").(*schema.Set).List() @@ -223,7 +224,7 @@ func resourceIBMDNSDomainRegistrationNSDelete(d *schema.ResourceData, meta inter nsUnlock_res, err := nService.Id(dnsId). UnlockDomain() if err != nil || nsUnlock_res != true { - return fmt.Errorf("Error unlocking domain registration record: %s", err) + return fmt.Errorf("[ERROR] Error unlocking domain registration record: %s", err) } nsAdd_res := false @@ -231,7 +232,7 @@ func resourceIBMDNSDomainRegistrationNSDelete(d *schema.ResourceData, meta inter AddNameserversToDomain(addNs) if err != nil || nsAdd_res != true { - return fmt.Errorf("Error Adding name servers to record: %s", err) + return fmt.Errorf("[ERROR] Error Adding name servers to record: %s", err) } // current NS to delete, if not found in original list @@ -257,7 +258,7 @@ func resourceIBMDNSDomainRegistrationNSDelete(d *schema.ResourceData, meta inter RemoveNameserversFromDomain(delNs) if err != nil || nsDel_res != true { - return fmt.Errorf("Error Deleting name servers from record: %s", err) + return fmt.Errorf("[ERROR] Error Deleting name servers from record: %s", err) } _, _ = nService.Id(dnsId).LockDomain() diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_record.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_record.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_record.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_record.go index de217f61b2..0240bba4ae 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_record.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_record.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,7 @@ import ( "strconv" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" @@ -30,7 +31,7 @@ func init() { upcaseRegexp, _ = regexp.Compile("[A-Z]") } -func resourceIBMDNSRecord() *schema.Resource { +func ResourceIBMDNSRecord() *schema.Resource { return &schema.Resource{ Exists: resourceIBMDNSRecordExists, Create: resourceIBMDNSRecordCreate, @@ -191,7 +192,7 @@ func resourceIBMDNSRecord() *schema.Resource { // Creates DNS Domain Resource Record // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/createObject func resourceIBMDNSRecordCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess.SetRetries(0)) opts := datatypes.Dns_Domain_ResourceRecord{ @@ -266,7 +267,7 @@ func resourceIBMDNSRecordCreate(d *schema.ResourceData, meta interface{}) error } if err != nil { - return fmt.Errorf("Error creating DNS Resource %s Record: %s", *opts.Type, err) + return fmt.Errorf("[ERROR] Error creating DNS Resource %s Record: %s", *opts.Type, err) } d.SetId(fmt.Sprintf("%d", id)) @@ -279,16 +280,16 @@ func resourceIBMDNSRecordCreate(d *schema.ResourceData, meta interface{}) error // Reads DNS Domain Resource Record from SL system // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/getObject func resourceIBMDNSRecordRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).GetObject() if err != nil { - return fmt.Errorf("Error retrieving DNS Resource Record: %s", err) + return fmt.Errorf("[ERROR] Error retrieving DNS Resource Record: %s", err) } // Required fields @@ -320,14 +321,14 @@ func resourceIBMDNSRecordRead(d *schema.ResourceData, meta interface{}) error { // Updates DNS Domain Resource Record in SL system // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/editObject func resourceIBMDNSRecordUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) serviceNoRetry := services.GetDnsDomainResourceRecordService(sess.SetRetries(0)) recordId, _ := strconv.Atoi(d.Id()) record, err := service.Id(recordId).GetObject() if err != nil { - return fmt.Errorf("Error retrieving DNS Resource Record: %s", err) + return fmt.Errorf("[ERROR] Error retrieving DNS Resource Record: %s", err) } recordType := d.Get("type").(string) @@ -405,7 +406,7 @@ func resourceIBMDNSRecordUpdate(d *schema.ResourceData, meta interface{}) error } if err != nil { - return fmt.Errorf("Error editing DNS Resource %s Record %d: %s", recordType, recordId, err) + return fmt.Errorf("[ERROR] Error editing DNS Resource %s Record %d: %s", recordType, recordId, err) } return nil @@ -414,18 +415,18 @@ func resourceIBMDNSRecordUpdate(d *schema.ResourceData, meta interface{}) error // Deletes DNS Domain Resource Record in SL system // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/deleteObject func resourceIBMDNSRecordDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting DNS Resource Record: %s", err) + return fmt.Errorf("[ERROR] Error deleting DNS Resource Record: %s", err) } return nil @@ -434,12 +435,12 @@ func resourceIBMDNSRecordDelete(d *schema.ResourceData, meta interface{}) error // Exists function is called by refresh // if the entity is absent - it is deleted from the .tfstate file func resourceIBMDNSRecordExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } record, err := service.Id(id).GetObject() @@ -449,7 +450,7 @@ func resourceIBMDNSRecordExists(d *schema.ResourceData, meta interface{}) (bool, return false, nil } } - return false, fmt.Errorf("Error retrieving domain record info: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving domain record info: %s", err) } return record.Id != nil && *record.Id == id, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_reverse_record.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_reverse_record.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_reverse_record.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_reverse_record.go index c2cf5f0ab9..970413cd16 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_reverse_record.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_reverse_record.go @@ -1,19 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMDNSReverseRecord() *schema.Resource { +func ResourceIBMDNSReverseRecord() *schema.Resource { return &schema.Resource{ Exists: resourceIBMDNSREVERSERecordExists, Create: resourceIBMDNSREVERSERecordCreate, @@ -48,7 +49,7 @@ func resourceIBMDNSReverseRecord() *schema.Resource { // Creates DNS Domain Reverse Record // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain/CreatePtrRecord func resourceIBMDNSREVERSERecordCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainService(sess.SetRetries(0)) Data := sl.String(d.Get("hostname").(string)) Ttl := sl.Int(d.Get("ttl").(int)) @@ -60,7 +61,7 @@ func resourceIBMDNSREVERSERecordCreate(d *schema.ResourceData, meta interface{}) } if err != nil { - return fmt.Errorf("Error creating DNS Reverse %s", err) + return fmt.Errorf("[ERROR] Error creating DNS Reverse %s", err) } d.SetId(fmt.Sprintf("%d", id)) log.Printf("[INFO] Dns Reverse %s ", d.Id()) @@ -70,16 +71,16 @@ func resourceIBMDNSREVERSERecordCreate(d *schema.ResourceData, meta interface{}) // Reads DNS Domain Reverse Record from SL system // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/getObject func resourceIBMDNSREVERSERecordRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, nexterr := service.Id(id).GetObject() if nexterr != nil { - return fmt.Errorf("Error retrieving DNS Reverse Record: %s", err) + return fmt.Errorf("[ERROR] Error retrieving DNS Reverse Record: %s", err) } return nil } @@ -87,13 +88,13 @@ func resourceIBMDNSREVERSERecordRead(d *schema.ResourceData, meta interface{}) e // Updates DNS Domain Reverse Record in SL system // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/editObject func resourceIBMDNSREVERSERecordUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) serviceNoRetry := services.GetDnsDomainResourceRecordService(sess.SetRetries(0)) recordId, _ := strconv.Atoi(d.Id()) record, err := service.Id(recordId).GetObject() if err != nil { - return fmt.Errorf("Error retrieving DNS Reverse Record: %s", err) + return fmt.Errorf("[ERROR] Error retrieving DNS Reverse Record: %s", err) } if data, ok := d.GetOk("hostname"); ok && d.HasChange("hostname") { record.Data = sl.String(data.(string)) @@ -104,7 +105,7 @@ func resourceIBMDNSREVERSERecordUpdate(d *schema.ResourceData, meta interface{}) record.IsGatewayAddress = nil _, err = serviceNoRetry.Id(recordId).EditObject(&record) if err != nil { - return fmt.Errorf("Error editing DNS Reverse Record %d: %s", recordId, err) + return fmt.Errorf("[ERROR] Error editing DNS Reverse Record %d: %s", recordId, err) } return nil } @@ -112,16 +113,16 @@ func resourceIBMDNSREVERSERecordUpdate(d *schema.ResourceData, meta interface{}) // Deletes DNS Domain Reverse Record in SL system // https://sldn.softlayer.com/reference/services/SoftLayer_Dns_Domain_ResourceRecord/deleteObject func resourceIBMDNSREVERSERecordDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = service.Id(id).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting DNS Reverse Record: %s", err) + return fmt.Errorf("[ERROR] Error deleting DNS Reverse Record: %s", err) } return nil } @@ -129,11 +130,11 @@ func resourceIBMDNSREVERSERecordDelete(d *schema.ResourceData, meta interface{}) // Exists function is called by refresh // if the entity is absent - it is deleted from the .tfstate file func resourceIBMDNSREVERSERecordExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsDomainResourceRecordService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } record, err := service.Id(id).GetObject() if err != nil { @@ -142,7 +143,7 @@ func resourceIBMDNSREVERSERecordExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error retrieving domain reverse record info: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving domain reverse record info: %s", err) } return record.Id != nil && *record.Id == id, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_secondary.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_secondary.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_secondary.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_secondary.go index b87e80247c..fc05395f7e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dns_secondary.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_dns_secondary.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -9,13 +9,14 @@ import ( "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMDNSSecondary() *schema.Resource { +func ResourceIBMDNSSecondary() *schema.Resource { return &schema.Resource{ Exists: resourceIBMDNSSecondaryExists, Create: resourceIBMDNSSecondaryCreate, @@ -67,7 +68,7 @@ func resourceIBMDNSSecondary() *schema.Resource { } func resourceIBMDNSSecondaryCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsSecondaryService(sess) // prepare creation parameters @@ -80,7 +81,7 @@ func resourceIBMDNSSecondaryCreate(d *schema.ResourceData, meta interface{}) err // create Dns_Secondary object response, err := service.CreateObject(&opts) if err != nil { - return fmt.Errorf("Error creating Dns Secondary Zone: %s", err) + return fmt.Errorf("[ERROR] Error creating Dns Secondary Zone: %s", err) } // populate id @@ -93,7 +94,7 @@ func resourceIBMDNSSecondaryCreate(d *schema.ResourceData, meta interface{}) err } func resourceIBMDNSSecondaryRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsSecondaryService(sess) dnsId, _ := strconv.Atoi(d.Id()) @@ -101,7 +102,7 @@ func resourceIBMDNSSecondaryRead(d *schema.ResourceData, meta interface{}) error // retrieve remote object state dns_domain_secondary, err := service.Id(dnsId).GetObject() if err != nil { - return fmt.Errorf("Error retrieving Dns Secondary Zone %d: %s", dnsId, err) + return fmt.Errorf("[ERROR] Error retrieving Dns Secondary Zone %d: %s", dnsId, err) } // populate fields @@ -115,7 +116,7 @@ func resourceIBMDNSSecondaryRead(d *schema.ResourceData, meta interface{}) error } func resourceIBMDNSSecondaryUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() domainId, _ := strconv.Atoi(d.Id()) hasChange := false @@ -135,7 +136,7 @@ func resourceIBMDNSSecondaryUpdate(d *schema.ResourceData, meta interface{}) err _, err := service.Id(domainId).EditObject(&opts) if err != nil { - return fmt.Errorf("Error editing DNS secondary zone (%d): %s", domainId, err) + return fmt.Errorf("[ERROR] Error editing DNS secondary zone (%d): %s", domainId, err) } } @@ -143,22 +144,22 @@ func resourceIBMDNSSecondaryUpdate(d *schema.ResourceData, meta interface{}) err } func resourceIBMDNSSecondaryDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsSecondaryService(sess) dnsId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Error deleting Dns Secondary Zone: %s", err) + return fmt.Errorf("[ERROR] Error deleting Dns Secondary Zone: %s", err) } log.Printf("[INFO] Deleting Dns Secondary Zone: %d", dnsId) result, err := service.Id(dnsId).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Dns Secondary Zone: %s", err) + return fmt.Errorf("[ERROR] Error deleting Dns Secondary Zone: %s", err) } if !result { - return errors.New("Error deleting Dns Secondary Zone") + return errors.New("[ERROR] Error deleting Dns Secondary Zone") } d.SetId("") @@ -166,12 +167,12 @@ func resourceIBMDNSSecondaryDelete(d *schema.ResourceData, meta interface{}) err } func resourceIBMDNSSecondaryExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetDnsSecondaryService(sess) dnsId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(dnsId).GetObject() diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall.go index 9615d8e5dd..a9696963cb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,8 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -29,7 +31,7 @@ const ( multiVlanMask = "id,name,networkFirewall[id,customerManagedFlag,datacenter.name,billingItem[orderItem.order.id,activeChildren[categoryCode, description,id]],managementCredentials,firewallType],publicIpAddress.ipAddress,publicIpv6Address.ipAddress,publicVlan[id,primaryRouter.hostname],privateVlan[id,primaryRouter.hostname],privateIpAddress.ipAddress,insideVlans[id],memberCount,status.keyName" ) -func resourceIBMFirewall() *schema.Resource { +func ResourceIBMFirewall() *schema.Resource { return &schema.Resource{ Create: resourceIBMFirewallCreate, Read: resourceIBMFirewallRead, @@ -44,7 +46,7 @@ func resourceIBMFirewall() *schema.Resource { Optional: true, ForceNew: true, Default: "HARDWARE_FIREWALL_DEDICATED", - ValidateFunc: validateAllowedStringValue([]string{ + ValidateFunc: validate.ValidateAllowedStringValues([]string{ "HARDWARE_FIREWALL_DEDICATED", "FORTIGATE_SECURITY_APPLIANCE", }), @@ -96,7 +98,7 @@ func resourceIBMFirewall() *schema.Resource { } func resourceIBMFirewallCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() keyName := "HARDWARE_FIREWALL_DEDICATED" firewallType := d.Get("firewall_type").(string) @@ -133,7 +135,7 @@ func resourceIBMFirewallCreate(d *schema.ResourceData, meta interface{}) error { } if len(targetItems) == 0 { - return fmt.Errorf("No product items matching %s could be found", keyName) + return fmt.Errorf("[ERROR] No product items matching %s could be found", keyName) } productOrderContainer := datatypes.Container_Product_Order_Network_Protection_Firewall_Dedicated{ @@ -154,11 +156,11 @@ func resourceIBMFirewallCreate(d *schema.ResourceData, meta interface{}) error { receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(&productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of dedicated hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated hardware firewall: %s", err) } vlan, _, _, err := findDedicatedFirewallByOrderId(sess, *receipt.OrderId, d) if err != nil { - return fmt.Errorf("Error during creation of dedicated hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated hardware firewall: %s", err) } id := *vlan.NetworkVlanFirewall.Id @@ -182,7 +184,7 @@ func resourceIBMFirewallCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMFirewallRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwID, _ := strconv.Atoi(d.Id()) @@ -192,7 +194,7 @@ func resourceIBMFirewallRead(d *schema.ResourceData, meta interface{}) error { GetObject() if err != nil { - return fmt.Errorf("Error retrieving firewall information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving firewall information: %s", err) } d.Set("public_vlan_id", *fw.NetworkVlan.Id) @@ -221,7 +223,7 @@ func resourceIBMFirewallUpdate(d *schema.ResourceData, meta interface{}) error { fwID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid firewall ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid firewall ID, must be an integer: %s", err) } // Update tags @@ -236,7 +238,7 @@ func resourceIBMFirewallUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMFirewallDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwService := services.GetNetworkVlanFirewallService(sess) fwID, _ := strconv.Atoi(d.Id()) @@ -245,11 +247,11 @@ func resourceIBMFirewallDelete(d *schema.ResourceData, meta interface{}) error { billingItem, err := fwService.Id(fwID).GetBillingItem() if err != nil { - return fmt.Errorf("Error while looking up billing item associated with the firewall: %s", err) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the firewall: %s", err) } if billingItem.Id == nil { - return fmt.Errorf("Error while looking up billing item associated with the firewall: No billing item for ID:%d", fwID) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the firewall: No billing item for ID:%d", fwID) } success, err := services.GetBillingItemService(sess).Id(*billingItem.Id).CancelService() @@ -265,11 +267,11 @@ func resourceIBMFirewallDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMFirewallExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = services.GetNetworkVlanFirewallService(sess). @@ -280,7 +282,7 @@ func resourceIBMFirewallExists(d *schema.ResourceData, meta interface{}) (bool, if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving firewall information: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving firewall information: %s", err) } return true, nil @@ -338,7 +340,7 @@ func findDedicatedFirewallByOrderId(sess *session.Session, orderId int, d *schem } else if len(vlans) == 0 || len(firewalls) == 0 || *upgraderequest.Status.Name != "Complete" { return datatypes.Network_Vlan{}, "pending", nil } - return nil, "", fmt.Errorf("Expected one dedicated firewall: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one dedicated firewall: %s", err) }, Timeout: 2 * time.Hour, Delay: 10 * time.Second, @@ -356,13 +358,13 @@ func findDedicatedFirewallByOrderId(sess *session.Session, orderId int, d *schem return datatypes.Network_Vlan{}, datatypes.Network_Gateway{}, result, nil } return datatypes.Network_Vlan{}, datatypes.Network_Gateway{}, datatypes.Product_Upgrade_Request{}, - fmt.Errorf("Something went wrong while upgrading '%d'", orderId) + fmt.Errorf("[ERROR] Something went wrong while upgrading '%d'", orderId) } else if _, ok := d.GetOk("pod"); ok { if result, ok := pendingResult.(datatypes.Network_Gateway); ok { return datatypes.Network_Vlan{}, result, datatypes.Product_Upgrade_Request{}, nil } return datatypes.Network_Vlan{}, datatypes.Network_Gateway{}, datatypes.Product_Upgrade_Request{}, - fmt.Errorf("Cannot find Dedicated Firewall with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find Dedicated Firewall with order id '%d'", orderId) } var result, ok = pendingResult.(datatypes.Network_Vlan) @@ -371,14 +373,14 @@ func findDedicatedFirewallByOrderId(sess *session.Session, orderId int, d *schem } return datatypes.Network_Vlan{}, datatypes.Network_Gateway{}, datatypes.Product_Upgrade_Request{}, - fmt.Errorf("Cannot find Dedicated Firewall with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find Dedicated Firewall with order id '%d'", orderId) } func setFirewallTags(id int, tags string, meta interface{}) error { - service := services.GetNetworkVlanFirewallService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkVlanFirewallService(meta.(conns.ClientSession).SoftLayerSession()) _, err := service.Id(id).SetTags(sl.String(tags)) if err != nil { - return fmt.Errorf("Could not set tags on firewall %d", id) + return fmt.Errorf("[ERROR] Could not set tags on firewall %d", id) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall_policy.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall_policy.go index 61d1d42e32..35565de942 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall_policy.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -12,6 +12,7 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" @@ -23,7 +24,7 @@ const ( aclMask = "name,firewallInterfaces[name,firewallContextAccessControlLists]" ) -func resourceIBMFirewallPolicy() *schema.Resource { +func ResourceIBMFirewallPolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMFirewallPolicyCreate, Read: resourceIBMFirewallPolicyRead, @@ -155,18 +156,18 @@ func getFirewallContextAccessControlListId(fwId int, sess *session.Session) (int return *fwInterface.FirewallContextAccessControlLists[0].Id, nil } } - return 0, fmt.Errorf("No firewallContextAccessControlListId.") + return 0, fmt.Errorf("[ERROR] No firewallContextAccessControlListId") } func resourceIBMFirewallPolicyCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwId := d.Get("firewall_id").(int) rules := prepareRules(d) fwContextACLId, err := getFirewallContextAccessControlListId(fwId, sess) if err != nil { - return fmt.Errorf("Error during creation of dedicated hardware firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated hardware firewall rules: %s", err) } ruleTemplate := datatypes.Network_Firewall_Update_Request{ @@ -178,7 +179,7 @@ func resourceIBMFirewallPolicyCreate(d *schema.ResourceData, meta interface{}) e _, err = services.GetNetworkFirewallUpdateRequestService(sess.SetRetries(0)).CreateObject(&ruleTemplate) if err != nil { - return fmt.Errorf("Error during creation of dedicated hardware firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated hardware firewall rules: %s", err) } d.SetId(strconv.Itoa(fwId)) @@ -191,7 +192,7 @@ func resourceIBMFirewallPolicyCreate(d *schema.ResourceData, meta interface{}) e } func resourceIBMFirewallPolicyRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwRulesID, _ := strconv.Atoi(d.Id()) @@ -201,7 +202,7 @@ func resourceIBMFirewallPolicyRead(d *schema.ResourceData, meta interface{}) err GetObject() if err != nil { - return fmt.Errorf("Error retrieving firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error retrieving firewall rules: %s", err) } rules := make([]map[string]interface{}, 0, len(fw.Rules)) @@ -259,17 +260,17 @@ func appendAnyOpenRule(rules []datatypes.Network_Firewall_Update_Request_Rule, p } func resourceIBMFirewallPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid firewall ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid firewall ID, must be an integer: %s", err) } rules := prepareRules(d) fwContextACLId, err := getFirewallContextAccessControlListId(fwId, sess) if err != nil { - return fmt.Errorf("Error during updating of dedicated hardware firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error during updating of dedicated hardware firewall rules: %s", err) } ruleTemplate := datatypes.Network_Firewall_Update_Request{ @@ -281,7 +282,7 @@ func resourceIBMFirewallPolicyUpdate(d *schema.ResourceData, meta interface{}) e _, err = services.GetNetworkFirewallUpdateRequestService(sess.SetRetries(0)).CreateObject(&ruleTemplate) if err != nil { - return fmt.Errorf("Error during updating of dedicated hardware firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error during updating of dedicated hardware firewall rules: %s", err) } time.Sleep(time.Minute) @@ -289,15 +290,15 @@ func resourceIBMFirewallPolicyUpdate(d *schema.ResourceData, meta interface{}) e } func resourceIBMFirewallPolicyDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid firewall ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid firewall ID, must be an integer: %s", err) } fwContextACLId, err := getFirewallContextAccessControlListId(fwId, sess) if err != nil { - return fmt.Errorf("Error during deleting of dedicated hardware firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error during deleting of dedicated hardware firewall rules: %s", err) } ruleTemplate := datatypes.Network_Firewall_Update_Request{ @@ -316,7 +317,7 @@ func resourceIBMFirewallPolicyDelete(d *schema.ResourceData, meta interface{}) e _, err = services.GetNetworkFirewallUpdateRequestService(sess.SetRetries(0)).CreateObject(&ruleTemplate) if err != nil { - return fmt.Errorf("Error during deleting of dedicated hardware firewall rules: %s", err) + return fmt.Errorf("[ERROR] Error during deleting of dedicated hardware firewall rules: %s", err) } time.Sleep(time.Minute) @@ -324,11 +325,11 @@ func resourceIBMFirewallPolicyDelete(d *schema.ResourceData, meta interface{}) e } func resourceIBMFirewallPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwRulesID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } fw, err := services.GetNetworkVlanFirewallService(sess). @@ -342,7 +343,7 @@ func resourceIBMFirewallPolicyExists(d *schema.ResourceData, meta interface{}) ( return false, nil } } - return false, fmt.Errorf("Error retrieving firewall rules: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving firewall rules: %s", err) } if len(fw.Rules) == 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall_shared.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall_shared.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall_shared.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall_shared.go index 984dc19326..4142858d3c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_firewall_shared.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_firewall_shared.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,6 +9,8 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -21,7 +23,7 @@ const ( FwHardwarePackageType = "ADDITIONAL_SERVICES_FIREWALL" ) -func resourceIBMFirewallShared() *schema.Resource { +func ResourceIBMFirewallShared() *schema.Resource { return &schema.Resource{ Create: resourceIBMFirewallSharedCreate, Read: resourceIBMFirewallSharedRead, @@ -44,7 +46,7 @@ func resourceIBMFirewallShared() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateAllowedStringValue([]string{"10MBPS_HARDWARE_FIREWALL", "20MBPS_HARDWARE_FIREWALL", "100MBPS_HARDWARE_FIREWALL", "1000MBPS_HARDWARE_FIREWALL", "200MBPS_HARDWARE_FIREWALL", "2000MBPS_HARDWARE_FIREWALL"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"10MBPS_HARDWARE_FIREWALL", "20MBPS_HARDWARE_FIREWALL", "100MBPS_HARDWARE_FIREWALL", "1000MBPS_HARDWARE_FIREWALL", "200MBPS_HARDWARE_FIREWALL", "2000MBPS_HARDWARE_FIREWALL"}), Description: "Firewall type", }, "virtual_instance_id": { @@ -68,7 +70,7 @@ func resourceIBMFirewallShared() *schema.Resource { // keyName is in between:[10MBPS_HARDWARE_FIREWALL, 20MBPS_HARDWARE_FIREWALL, // 100MBPS_HARDWARE_FIREWALL, 1000MBPS_HARDWARE_FIREWALL] func resourceIBMFirewallSharedCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() keyName := d.Get("firewall_type").(string) @@ -82,7 +84,7 @@ func resourceIBMFirewallSharedCreate(d *schema.ResourceData, meta interface{}) e } if virtualId == 0 && hardwareId == 0 { - return fmt.Errorf("Provide either `virtual_instance_id` or `hardware_instance_id`") + return fmt.Errorf("[ERROR] Provide either `virtual_instance_id` or `hardware_instance_id`") } //var productOrderContainer *string @@ -106,7 +108,7 @@ func resourceIBMFirewallSharedCreate(d *schema.ResourceData, meta interface{}) e } if len(targetItems) == 0 { - return fmt.Errorf("No product items matching %s could be found", keyName) + return fmt.Errorf("[ERROR] No product items matching %s could be found", keyName) } masked := "id,firewallServiceComponent[id,status]" @@ -165,7 +167,7 @@ func resourceIBMFirewallSharedCreate(d *schema.ResourceData, meta interface{}) e d.SetId(fmt.Sprintf("%d", idd)) if err != nil { - return fmt.Errorf("Error during creation of hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of hardware firewall: %s", err) } } @@ -225,7 +227,7 @@ func resourceIBMFirewallSharedCreate(d *schema.ResourceData, meta interface{}) e d.SetId(fmt.Sprintf("%d", idd2)) log.Print(idd2) if err != nil { - return fmt.Errorf("Error during creation of hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of hardware firewall: %s", err) } } @@ -235,7 +237,7 @@ func resourceIBMFirewallSharedCreate(d *schema.ResourceData, meta interface{}) e } func resourceIBMFirewallSharedRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() firewall_type := (d.Get("firewall_type").(string)) d.Set("firewall_type", firewall_type) @@ -247,7 +249,7 @@ func resourceIBMFirewallSharedRead(d *schema.ResourceData, meta interface{}) err data, err := fservice.Id(fwID).Mask("billingItem.id").GetObject() d.Set("billing_item_id", *data.BillingItem.Id) if err != nil { - return fmt.Errorf("Error during creation of hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of hardware firewall: %s", err) } return nil @@ -255,7 +257,7 @@ func resourceIBMFirewallSharedRead(d *schema.ResourceData, meta interface{}) err //detach hardware firewall from particular machine func resourceIBMFirewallSharedDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() idd2 := (d.Get("billing_item_id")).(int) success, err := services.GetBillingItemService(sess).Id(idd2).CancelService() @@ -272,7 +274,7 @@ func resourceIBMFirewallSharedDelete(d *schema.ResourceData, meta interface{}) e //exists method func resourceIBMFirewallSharedExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fservice := services.GetNetworkComponentFirewallService(sess) id, err := strconv.Atoi(d.Id()) response, err := fservice.Id(id).GetObject() diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ipsec_vpn.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_ipsec_vpn.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ipsec_vpn.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_ipsec_vpn.go index 4f85af9efb..157cd01657 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ipsec_vpn.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_ipsec_vpn.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -21,7 +24,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMIPSecVPN() *schema.Resource { +func ResourceIBMIPSecVPN() *schema.Resource { return &schema.Resource{ Create: resourceIBMIPSecVpnCreate, Read: resourceIBMIPSecVPNRead, @@ -56,25 +59,25 @@ func resourceIBMIPSecVPN() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "MD5", - ValidateFunc: validateAuthProtocol, + ValidateFunc: validate.ValidateAuthProtocol, }, "encryption": { Type: schema.TypeString, Optional: true, Default: "3DES", - ValidateFunc: validateEncyptionProtocol, + ValidateFunc: validate.ValidateEncyptionProtocol, }, "diffie_hellman_group": { Type: schema.TypeInt, Optional: true, Default: 2, - ValidateFunc: validateDiffieHellmanGroup, + ValidateFunc: validate.ValidateDiffieHellmanGroup, }, "keylife": { Type: schema.TypeInt, Optional: true, Default: 14400, - ValidateFunc: validatekeylife, + ValidateFunc: validate.Validatekeylife, }, }, }, @@ -90,25 +93,25 @@ func resourceIBMIPSecVPN() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "MD5", - ValidateFunc: validateAuthProtocol, + ValidateFunc: validate.ValidateAuthProtocol, }, "encryption": { Type: schema.TypeString, Optional: true, Default: "3DES", - ValidateFunc: validateEncyptionProtocol, + ValidateFunc: validate.ValidateEncyptionProtocol, }, "diffie_hellman_group": { Type: schema.TypeInt, Optional: true, Default: 2, - ValidateFunc: validateDiffieHellmanGroup, + ValidateFunc: validate.ValidateDiffieHellmanGroup, }, "keylife": { Type: schema.TypeInt, Optional: true, Default: 3600, - ValidateFunc: validatekeylife, + ValidateFunc: validate.Validatekeylife, }, }, }, @@ -170,7 +173,7 @@ func resourceIBMIPSecVPN() *schema.Resource { }, "remote_ip_cidr": { Type: schema.TypeString, - ValidateFunc: validateCIDR, + ValidateFunc: validate.ValidateCIDR, Required: true, }, "account_id": { @@ -194,13 +197,13 @@ const ( ) func resourceIBMIPSecVpnCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() datacenter := d.Get("datacenter").(string) dc, err := location.GetDatacenterByName(sess, datacenter, "id") locationid := strconv.Itoa(*dc.Id) packageid := 0 if err != nil { - return fmt.Errorf("Datacenter not found") + return fmt.Errorf("[ERROR] Something not found") } locationservice := services.GetLocationService(sess) priceidds, _ := locationservice.Id(*dc.Id).GetPriceGroups() @@ -227,18 +230,18 @@ func resourceIBMIPSecVpnCreate(d *schema.ResourceData, meta interface{}) error { _, err = services.GetProductOrderService(sess.SetRetries(0)). VerifyOrder(&IPSecOrder) if err != nil { - return fmt.Errorf("Error during Verify order for Creating: %s", err) + return fmt.Errorf("[ERROR] Error during Verify order for Creating: %s", err) } //Calling place order receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(&IPSecOrder, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during Place order for Creating: %s", err) + return fmt.Errorf("[ERROR] Error during Place order for Creating: %s", err) } vpn, _ := findIPSecVpnByOrderID(sess, *receipt.OrderId, d) if err != nil { - return fmt.Errorf("Error during creation of IPSec VPN: %s", err) + return fmt.Errorf("[ERROR] Error during creation of IPSec VPN: %s", err) } id := *vpn.Id d.SetId(fmt.Sprintf("%d", id)) @@ -267,7 +270,7 @@ func findIPSecVpnByOrderID(sess *session.Session, orderID int, d *schema.Resourc } else if len(vpn) == 0 { return datatypes.Network_Tunnel_Module_Context{}, "pending", nil } - return nil, "", fmt.Errorf("Expected one IPSec VPN: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one IPSec VPN: %s", err) }, Timeout: 2 * time.Hour, Delay: 10 * time.Second, @@ -286,32 +289,32 @@ func findIPSecVpnByOrderID(sess *session.Session, orderID int, d *schema.Resourc } return datatypes.Network_Tunnel_Module_Context{}, - fmt.Errorf("Cannot find IPSec Vpn with order id '%d'", orderID) + fmt.Errorf("[ERROR] Cannot find IPSec Vpn with order id '%d'", orderID) } func resourceIBMIPSecVPNRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vpnID, _ := strconv.Atoi(d.Id()) vpn, err := services.GetNetworkTunnelModuleContextService(sess). Id(vpnID).Mask(ipsecMask). GetObject() if err != nil { - return fmt.Errorf("Error retrieving firewall information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving firewall information: %s", err) } d.Set("name", *vpn.Name) d.Set("internal_peer_ip_address", *vpn.InternalPeerIpAddress) if vpn.Datacenter != nil { d.Set("datacenter", *vpn.Datacenter.Name) } - d.Set("phase_one", flattenPhaseOneAttributes(&vpn)) - d.Set("phase_two", flattenPhaseTwoAttributes(&vpn)) + d.Set("phase_one", flex.FlattenPhaseOneAttributes(&vpn)) + d.Set("phase_two", flex.FlattenPhaseTwoAttributes(&vpn)) fwID, err := strconv.Atoi(d.Id()) if vpn.AddressTranslations != nil { - d.Set("address_translation", flattenaddressTranslation(&vpn, fwID)) + d.Set("address_translation", flex.FlattenaddressTranslation(&vpn, fwID)) } if vpn.CustomerSubnets != nil { - d.Set("remote_subnet", flattenremoteSubnet(&vpn)) + d.Set("remote_subnet", flex.FlattenremoteSubnet(&vpn)) } if vpn.PresharedKey != nil { d.Set("preshared_key", *vpn.PresharedKey) @@ -332,11 +335,11 @@ func resourceIBMIPSecVPNRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMIPSecVPNExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = services.GetNetworkTunnelModuleContextService(sess). @@ -347,14 +350,14 @@ func resourceIBMIPSecVPNExists(d *schema.ResourceData, meta interface{}) (bool, if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving vpn information: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving vpn information: %s", err) } return true, nil } func resourceIBMIPSecVPNDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vpnService := services.GetNetworkTunnelModuleContextService(sess) vpnID, _ := strconv.Atoi(d.Id()) @@ -363,11 +366,11 @@ func resourceIBMIPSecVPNDelete(d *schema.ResourceData, meta interface{}) error { billingItem, err := vpnService.Id(vpnID).GetBillingItem() if err != nil { - return fmt.Errorf("Error while looking up billing item associated with the ipsecvpn: %s", err) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the ipsecvpn: %s", err) } if billingItem.Id == nil { - return fmt.Errorf("Error while looking up billing item associated with the ipsecvpn: No billing item for ID:%d", vpnID) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the ipsecvpn: No billing item for ID:%d", vpnID) } success, err := services.GetBillingItemService(sess).Id(*billingItem.Id).CancelService() @@ -383,11 +386,11 @@ func resourceIBMIPSecVPNDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMIPSecVPNUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vpnID, err := strconv.Atoi(d.Id()) var addresstranslation datatypes.Network_Tunnel_Module_Context_Address_Translation if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } vpn, err := services.GetNetworkTunnelModuleContextService(sess). @@ -395,7 +398,7 @@ func resourceIBMIPSecVPNUpdate(d *schema.ResourceData, meta interface{}) error { GetObject() if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } if d.HasChange("phase_one") { for _, e := range d.Get("phase_one").([]interface{}) { @@ -441,21 +444,21 @@ func resourceIBMIPSecVPNUpdate(d *schema.ResourceData, meta interface{}) error { subnetid := d.Get("internal_subnet_id").(int) _, err = services.GetNetworkTunnelModuleContextService(sess).AddPrivateSubnetToNetworkTunnel(&subnetid) if err != nil { - return fmt.Errorf("Unable to find object with id of: %s", err) + return fmt.Errorf("[ERROR] Unable to find object with id of: %s", err) } } if d.HasChange("remote_subnet_id") { subnetid := d.Get("remote_subnet_id").(int) _, err = services.GetNetworkTunnelModuleContextService(sess).AddCustomerSubnetToNetworkTunnel(&subnetid) if err != nil { - return fmt.Errorf("Unable to find object with id of: %s", err) + return fmt.Errorf("[ERROR] Unable to find object with id of: %s", err) } } if d.HasChange("service_subnet_id") { subnetid := d.Get("service_subnet_id").(int) _, err = services.GetNetworkTunnelModuleContextService(sess).AddServiceSubnetToNetworkTunnel(&subnetid) if err != nil { - return fmt.Errorf("Unable to find object with id of: %s", err) + return fmt.Errorf("[ERROR] Unable to find object with id of: %s", err) } } if d.HasChange("address_translation") { @@ -470,7 +473,7 @@ func resourceIBMIPSecVPNUpdate(d *schema.ResourceData, meta interface{}) error { } _, err = services.GetNetworkTunnelModuleContextService(sess).Id(vpnID).CreateAddressTranslation(&addresstranslation) if err != nil { - return fmt.Errorf("Unable to create the address translation: %s", err) + return fmt.Errorf("[ERROR] Unable to create the address translation: %s", err) } } if d.HasChange("remote_subnet") { @@ -487,11 +490,11 @@ func resourceIBMIPSecVPNUpdate(d *schema.ResourceData, meta interface{}) error { remoteSubnet.AccountId = &accountID subnet, err := services.GetNetworkCustomerSubnetService(sess).Id(vpnID).CreateObject(&remoteSubnet) if err != nil { - return fmt.Errorf("Some error occured creating the customer subnet resource %s", err) + return fmt.Errorf("[ERROR] Expected error occured creating the customer subnet resource %s", err) } _, err = services.GetNetworkTunnelModuleContextService(sess).Id(vpnID).AddCustomerSubnetToNetworkTunnel(subnet.Id) if err != nil { - return fmt.Errorf("Some error occured adding the customer subnet to the network tunnel module %s", err) + return fmt.Errorf("[ERROR] Expected error occured adding the customer subnet to the network tunnel module %s", err) } } @@ -500,12 +503,12 @@ func resourceIBMIPSecVPNUpdate(d *schema.ResourceData, meta interface{}) error { _, err = services.GetNetworkTunnelModuleContextService(sess).Id(vpnID).ApplyConfigurationsToDevice() if err != nil { - return fmt.Errorf("There is some erorr applying the configuration %s", err) + return fmt.Errorf("[ERROR] There is some erorr applying the configuration %s", err) } } else if _, ok := d.GetOk("remote_subnet"); ok { _, err = services.GetNetworkTunnelModuleContextService(sess).Id(vpnID).ApplyConfigurationsToDevice() if err != nil { - return fmt.Errorf("There is some erorr applying the configuration %s", err) + return fmt.Errorf("[ERROR] There is some erorr applying the configuration %s", err) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb.go index 45b31ff1ea..2cfc1947ec 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,6 +9,7 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -30,7 +31,7 @@ const ( "sslEnabledFlag,sslActiveFlag,loadBalancerHardware[datacenter[name]],ipAddress[ipAddress,subnetId],billingItem[upgradeItems[capacity]]" ) -func resourceIBMLb() *schema.Resource { +func ResourceIBMLb() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbCreate, Read: resourceIBMLbRead, @@ -109,7 +110,7 @@ func resourceIBMLb() *schema.Resource { func resourceIBMLbCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() connections := d.Get("connections").(int) haEnabled := d.Get("ha_enabled").(bool) @@ -179,7 +180,7 @@ func resourceIBMLbCreate(d *schema.ResourceData, meta interface{}) error { } if len(targetItems) == 0 { - return fmt.Errorf("No product items matching %s could be found", keyName) + return fmt.Errorf("[ERROR] No product items matching %s could be found", keyName) } //select prices with the required capacity @@ -207,12 +208,12 @@ func resourceIBMLbCreate(d *schema.ResourceData, meta interface{}) error { receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(&productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of load balancer: %s", err) + return fmt.Errorf("[ERROR] Error during creation of load balancer: %s", err) } loadBalancer, err := findLoadBalancerByOrderId(sess, *receipt.OrderId, dedicated, d) if err != nil { - return fmt.Errorf("Error during creation of load balancer: %s", err) + return fmt.Errorf("[ERROR] Error during creation of load balancer: %s", err) } d.SetId(fmt.Sprintf("%d", *loadBalancer.Id)) @@ -228,7 +229,7 @@ func resourceIBMLbCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipID, _ := strconv.Atoi(d.Id()) @@ -253,7 +254,7 @@ func resourceIBMLbUpdate(d *schema.ResourceData, meta interface{}) error { if oldValue > 0 { if *vip.DedicatedFlag { - return fmt.Errorf("Error Updating load balancer connection limit: Upgrade for dedicated loadbalancer is not supported") + return fmt.Errorf("[ERROR] Error Updating load balancer connection limit: Upgrade for dedicated loadbalancer is not supported") } if vip.BillingItem.UpgradeItems[0].Capacity != nil { validUpgradeValue := vip.BillingItem.UpgradeItems[0].Capacity @@ -261,16 +262,16 @@ func resourceIBMLbUpdate(d *schema.ResourceData, meta interface{}) error { _, err := services.GetNetworkApplicationDeliveryControllerLoadBalancerVirtualIpAddressService(sess). Id(vipID).UpgradeConnectionLimit() if err != nil { - return fmt.Errorf("Error Updating load balancer connection limit: %s", err) + return fmt.Errorf("[ERROR] Error Updating load balancer connection limit: %s", err) } } else { - return fmt.Errorf("Error Updating load balancer connection limit : Valid value to which connection limit can be upgraded is : %d ", int(*validUpgradeValue)) + return fmt.Errorf("[ERROR] Error Updating load balancer connection limit : Valid value to which connection limit can be upgraded is : %d ", int(*validUpgradeValue)) } } else { - return fmt.Errorf("Error Updating load balancer connection limit: No upgrade available, already it has maximum connection limit") + return fmt.Errorf("[ERROR] Error Updating load balancer connection limit: No upgrade available, already it has maximum connection limit") } } @@ -283,7 +284,7 @@ func resourceIBMLbUpdate(d *schema.ResourceData, meta interface{}) error { _, err := services.GetNetworkApplicationDeliveryControllerLoadBalancerVirtualIpAddressService(sess). Id(vipID).StartSsl() if err != nil { - return fmt.Errorf("Error starting ssl acceleration for load balancer : %s", err) + return fmt.Errorf("[ERROR] Error starting ssl acceleration for load balancer : %s", err) } } else { @@ -291,7 +292,7 @@ func resourceIBMLbUpdate(d *schema.ResourceData, meta interface{}) error { _, err := services.GetNetworkApplicationDeliveryControllerLoadBalancerVirtualIpAddressService(sess). Id(vipID).StopSsl() if err != nil { - return fmt.Errorf("Error stopping ssl acceleration for load balancer : %s", err) + return fmt.Errorf("[ERROR] Error stopping ssl acceleration for load balancer : %s", err) } } @@ -301,7 +302,7 @@ func resourceIBMLbUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipID, _ := strconv.Atoi(d.Id()) vip, err := services.GetNetworkApplicationDeliveryControllerLoadBalancerVirtualIpAddressService(sess). @@ -310,7 +311,7 @@ func resourceIBMLbRead(d *schema.ResourceData, meta interface{}) error { GetObject() if err != nil { - return fmt.Errorf("Error retrieving load balancer: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } d.Set("connections", getConnectionLimit(*vip.ConnectionLimit)) @@ -328,7 +329,7 @@ func resourceIBMLbRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipService := services.GetNetworkApplicationDeliveryControllerLoadBalancerVirtualIpAddressService(sess) vipID, _ := strconv.Atoi(d.Id()) @@ -337,7 +338,7 @@ func resourceIBMLbDelete(d *schema.ResourceData, meta interface{}) error { if certID > 0 { err := setLocalLBSecurityCert(sess, vipID, 0) if err != nil { - return fmt.Errorf("Remove certificate before deleting load balancer failed: %s", err) + return fmt.Errorf("[ERROR] Remove certificate before deleting load balancer failed: %s", err) } } @@ -357,11 +358,11 @@ func resourceIBMLbDelete(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("Error while looking up billing item associated with the load balancer: %s", err) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the load balancer: %s", err) } if billingItem.Id == nil { - return fmt.Errorf("Error while looking up billing item associated with the load balancer: No billing item for ID:%d", vipID) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the load balancer: No billing item for ID:%d", vipID) } success, err := services.GetBillingItemService(sess).Id(*billingItem.Id).CancelService() if err != nil { @@ -376,7 +377,7 @@ func resourceIBMLbDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipID, _ := strconv.Atoi(d.Id()) @@ -435,7 +436,7 @@ func findLoadBalancerByOrderId(sess *session.Session, orderId int, dedicated boo } else if len(lbs) == 0 { return datatypes.Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress{}, "pending", nil } else { - return nil, "", fmt.Errorf("Expected one load balancer: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one load balancer: %s", err) } }, Timeout: d.Timeout(schema.TimeoutCreate), @@ -457,7 +458,7 @@ func findLoadBalancerByOrderId(sess *session.Session, orderId int, dedicated boo } return datatypes.Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress{}, - fmt.Errorf("Cannot find Application Delivery Controller Load Balancer with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find Application Delivery Controller Load Balancer with order id '%d'", orderId) } func setLocalLBSecurityCert(sess *session.Session, vipID int, certID int) error { @@ -483,7 +484,7 @@ func setLocalLBSecurityCert(sess *session.Session, vipID int, certID int) error ) if !success && err == nil { - return fmt.Errorf("Unable to remove ssl security certificate from load balancer") + return fmt.Errorf("[ERROR] Unable to remove ssl security certificate from load balancer") } return err diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_service.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_service.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_service.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_service.go index 100c959200..c607634364 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_service.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_service.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -11,6 +11,7 @@ import ( "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -20,7 +21,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMLbService() *schema.Resource { +func ResourceIBMLbService() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbServiceCreate, Read: resourceIBMLbServiceRead, @@ -74,7 +75,7 @@ func resourceIBMLbService() *schema.Resource { } func resourceIBMLbServiceCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // SoftLayer Local LBs consist of a multi-level hierarchy of types. // (virtualIpAddress -> []virtualServer -> []serviceGroup -> []service) @@ -88,7 +89,7 @@ func resourceIBMLbServiceCreate(d *schema.ResourceData, meta interface{}) error GetObject() if err != nil { - return fmt.Errorf("Error retrieving load balancer service group from SoftLayer, %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer service group from SoftLayer, %s", err) } // Store the IDs for later use @@ -138,7 +139,7 @@ func resourceIBMLbServiceCreate(d *schema.ResourceData, meta interface{}) error err = updateLoadBalancerService(sess.SetRetries(0), vipID, &vip) if err != nil { - return fmt.Errorf("Error creating load balancer service: %s", err) + return fmt.Errorf("[ERROR] Error creating load balancer service: %s", err) } // Retrieve the newly created object, to obtain its ID @@ -151,7 +152,7 @@ func resourceIBMLbServiceCreate(d *schema.ResourceData, meta interface{}) error GetServices() if err != nil || len(svcs) == 0 { - return fmt.Errorf("Error retrieving load balancer: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } d.SetId(strconv.Itoa(*svcs[0].Id)) @@ -162,7 +163,7 @@ func resourceIBMLbServiceCreate(d *schema.ResourceData, meta interface{}) error } func resourceIBMLbServiceUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Using the ID stored in the config, find the IDs of the respective // serviceGroup, virtualServer and virtualIpAddress @@ -173,7 +174,7 @@ func resourceIBMLbServiceUpdate(d *schema.ResourceData, meta interface{}) error GetObject() if err != nil { - return fmt.Errorf("Error retrieving load balancer service group from SoftLayer, %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer service group from SoftLayer, %s", err) } // Store the IDs for later use @@ -225,14 +226,14 @@ func resourceIBMLbServiceUpdate(d *schema.ResourceData, meta interface{}) error err = updateLoadBalancerService(sess.SetRetries(0), vipID, &vip) if err != nil { - return fmt.Errorf("Error updating load balancer service: %s", err) + return fmt.Errorf("[ERROR] Error updating load balancer service: %s", err) } return resourceIBMLbServiceRead(d, meta) } func resourceIBMLbServiceRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() svcID, _ := strconv.Atoi(d.Id()) @@ -242,7 +243,7 @@ func resourceIBMLbServiceRead(d *schema.ResourceData, meta interface{}) error { GetObject() if err != nil { - return fmt.Errorf("Error retrieving service: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service: %s", err) } d.Set("ip_address_id", svc.IpAddressId) @@ -256,7 +257,7 @@ func resourceIBMLbServiceRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbServiceDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() svcID, _ := strconv.Atoi(d.Id()) @@ -295,14 +296,14 @@ func resourceIBMLbServiceDelete(d *schema.ResourceData, meta interface{}) error _, err := stateConf.WaitForState() if err != nil { - return fmt.Errorf("Error deleting service: %s", err) + return fmt.Errorf("[ERROR] Error deleting service: %s", err) } return nil } func resourceIBMLbServiceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() svcID, _ := strconv.Atoi(d.Id()) @@ -335,7 +336,7 @@ func getHealthCheckTypeId(sess *session.Session, healthCheckTypeName string) (in } if len(healthCheckTypes) < 1 { - return -1, fmt.Errorf("Invalid health check type: %s", healthCheckTypeName) + return -1, fmt.Errorf("[ERROR] Invalid health check type: %s", healthCheckTypeName) } return *healthCheckTypes[0].Id, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_service_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_service_group.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_service_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_service_group.go index ff15d4a775..4f17df51e5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_service_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_service_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -12,6 +12,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -21,7 +23,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMLbServiceGroup() *schema.Resource { +func ResourceIBMLbServiceGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbServiceGroupCreate, Read: resourceIBMLbServiceGroupRead, @@ -70,7 +72,7 @@ func resourceIBMLbServiceGroup() *schema.Resource { "timeout": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateLBTimeout, + ValidateFunc: validate.ValidateLBTimeout, Description: "Timeout value", }, "tags": { @@ -85,7 +87,7 @@ func resourceIBMLbServiceGroup() *schema.Resource { } func resourceIBMLbServiceGroupCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipID := d.Get("load_balancer_id").(int) @@ -122,7 +124,7 @@ func resourceIBMLbServiceGroupCreate(d *schema.ResourceData, meta interface{}) e err = updateLoadBalancerService(sess.SetRetries(0), vipID, &vip) if err != nil { - return fmt.Errorf("Error creating load balancer service group: %s", err) + return fmt.Errorf("[ERROR] Error creating load balancer service group: %s", err) } // Retrieve the newly created object, to obtain its ID @@ -133,7 +135,7 @@ func resourceIBMLbServiceGroupCreate(d *schema.ResourceData, meta interface{}) e GetVirtualServers() if err != nil { - return fmt.Errorf("Error retrieving load balancer: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } d.SetId(strconv.Itoa(*vs[0].Id)) @@ -144,7 +146,7 @@ func resourceIBMLbServiceGroupCreate(d *schema.ResourceData, meta interface{}) e return resourceIBMLbServiceGroupRead(d, meta) } func resourceIBMLbServiceGroupUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipID := d.Get("load_balancer_id").(int) vsID, _ := strconv.Atoi(d.Id()) @@ -188,14 +190,14 @@ func resourceIBMLbServiceGroupUpdate(d *schema.ResourceData, meta interface{}) e err = updateLoadBalancerService(sess.SetRetries(0), vipID, &vip) if err != nil { - return fmt.Errorf("Error creating load balancer service group: %s", err) + return fmt.Errorf("[ERROR] Error creating load balancer service group: %s", err) } return resourceIBMLbServiceGroupRead(d, meta) } func resourceIBMLbServiceGroupRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vsID, _ := strconv.Atoi(d.Id()) @@ -205,7 +207,7 @@ func resourceIBMLbServiceGroupRead(d *schema.ResourceData, meta interface{}) err GetObject() if err != nil { - return fmt.Errorf("Error retrieving load balancer: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } d.Set("allocation", vs.Allocation) @@ -220,7 +222,7 @@ func resourceIBMLbServiceGroupRead(d *schema.ResourceData, meta interface{}) err } func resourceIBMLbServiceGroupDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vsID, _ := strconv.Atoi(d.Id()) @@ -260,14 +262,14 @@ func resourceIBMLbServiceGroupDelete(d *schema.ResourceData, meta interface{}) e _, err := stateConf.WaitForState() if err != nil { - return fmt.Errorf("Error deleting service: %s", err) + return fmt.Errorf("[ERROR] Error deleting service: %s", err) } return nil } func resourceIBMLbServiceGroupExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vsID, _ := strconv.Atoi(d.Id()) @@ -301,7 +303,7 @@ func getRoutingTypeId(sess *session.Session, routingTypeName string) (int, error } if len(routingTypes) < 1 { - return -1, fmt.Errorf("Invalid routing type: %s", routingTypeName) + return -1, fmt.Errorf("[ERROR] Invalid routing type: %s", routingTypeName) } return *routingTypes[0].Id, nil @@ -320,7 +322,7 @@ func getRoutingMethodId(sess *session.Session, routingMethodName string) (int, e } if len(routingMethods) < 1 { - return -1, fmt.Errorf("Invalid routing method: %s", routingMethodName) + return -1, fmt.Errorf("[ERROR] Invalid routing method: %s", routingMethodName) } return *routingMethods[0].Id, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx.go index 4d783c8264..fc21160e23 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -12,6 +12,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -28,7 +29,7 @@ const ( DELIMITER = "_" ) -func resourceIBMLbVpx() *schema.Resource { +func ResourceIBMLbVpx() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbVpxCreate, Read: resourceIBMLbVpxRead, @@ -142,12 +143,11 @@ func resourceIBMLbVpx() *schema.Resource { } func getSubnetId(subnet string, meta interface{}) (int, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) subnetInfo := strings.Split(subnet, "/") if len(subnetInfo) != 2 { - return 0, fmt.Errorf( - "Unable to parse the provided subnet: %s", subnet) + return 0, fmt.Errorf("[ERROR] Unable to parse the provided subnet: %s", subnet) } networkIdentifier := subnetInfo[0] @@ -164,7 +164,7 @@ func getSubnetId(subnet string, meta interface{}) (int, error) { GetSubnets() if err != nil { - return 0, fmt.Errorf("Error looking up Subnet: %s", err) + return 0, fmt.Errorf("[ERROR] Error looking up Subnet: %s", err) } if len(subnets) < 1 { @@ -180,7 +180,7 @@ func getVPXVersion(id int, sess *session.Session) (string, error) { getObjectResult, err := service.Id(id).Mask("description").GetObject() if err != nil { - return "", fmt.Errorf("Error retrieving VPX version: %s", err) + return "", fmt.Errorf("[ERROR] Error retrieving VPX version: %s", err) } return strings.Split(*getObjectResult.Description, " ")[3], nil @@ -219,7 +219,7 @@ func getPublicIpItemKeyName(ipCount int) string { } func findVPXPriceItems(version string, speed int, plan string, ipCount int, meta interface{}) ([]datatypes.Product_Item_Price, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Get VPX package type. productPackage, err := product.GetPackageByType(sess, "ADDITIONAL_SERVICES_APPLICATION_DELIVERY_APPLIANCE") @@ -275,7 +275,7 @@ func findVPXPriceItems(version string, speed int, plan string, ipCount int, meta } func findVPXByOrderId(orderId int, meta interface{}) (datatypes.Network_Application_Delivery_Controller, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) stateConf := &resource.StateChangeConf{ Pending: []string{"pending"}, @@ -296,7 +296,7 @@ func findVPXByOrderId(orderId int, meta interface{}) (datatypes.Network_Applicat } else if len(vpxs) == 0 { return datatypes.Network_Application_Delivery_Controller{}, "pending", nil } else { - return nil, "", fmt.Errorf("Expected one VPX: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one VPX: %s", err) } }, Timeout: 45 * time.Minute, @@ -317,7 +317,7 @@ func findVPXByOrderId(orderId int, meta interface{}) (datatypes.Network_Applicat } return datatypes.Network_Application_Delivery_Controller{}, - fmt.Errorf("Cannot find Application Delivery Controller with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find Application Delivery Controller with order id '%d'", orderId) } func prepareHardwareOptions(d *schema.ResourceData, meta interface{}) ([]datatypes.Hardware, error) { @@ -336,7 +336,7 @@ func prepareHardwareOptions(d *schema.ResourceData, meta interface{}) ([]datatyp if len(publicSubnet) > 0 { primarySubnetId, err := getSubnetId(publicSubnet, meta) if err != nil { - return nil, fmt.Errorf("Error creating network application delivery controller: %s", err) + return nil, fmt.Errorf("[ERROR] Error creating network application delivery controller: %s", err) } hardwareOpts[0].PrimaryNetworkComponent.NetworkVlan = &datatypes.Network_Vlan{ PrimarySubnetId: &primarySubnetId, @@ -356,7 +356,7 @@ func prepareHardwareOptions(d *schema.ResourceData, meta interface{}) ([]datatyp if len(privateSubnet) > 0 { primarySubnetId, err := getSubnetId(privateSubnet, meta) if err != nil { - return nil, fmt.Errorf("Error creating network application delivery controller: %s", err) + return nil, fmt.Errorf("[ERROR] Error creating network application delivery controller: %s", err) } hardwareOpts[0].PrimaryBackendNetworkComponent.NetworkVlan = &datatypes.Network_Vlan{ PrimarySubnetId: &primarySubnetId, @@ -366,7 +366,7 @@ func prepareHardwareOptions(d *schema.ResourceData, meta interface{}) ([]datatyp } func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() NADCService := services.GetNetworkApplicationDeliveryControllerService(sess) productOrderService := services.GetProductOrderService(sess.SetRetries(0)) var err error @@ -384,7 +384,7 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { meta) if err != nil { - return fmt.Errorf("Error Cannot find Application Delivery Controller prices '%s'.", err) + return fmt.Errorf("[ERROR] Error Cannot find Application Delivery Controller prices '%s'", err) } datacenter := d.Get("datacenter").(string) @@ -392,14 +392,14 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { if len(datacenter) > 0 { datacenter, err := location.GetDatacenterByName(sess, datacenter, "id") if err != nil { - return fmt.Errorf("Error creating network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error creating network application delivery controller: %s", err) } opts.Location = sl.String(strconv.Itoa(*datacenter.Id)) } opts.Hardware, err = prepareHardwareOptions(d, meta) if err != nil { - return fmt.Errorf("Error Cannot get hardware options '%s'.", err) + return fmt.Errorf("[ERROR] Error Cannot get hardware options '%s'", err) } log.Println("[INFO] Creating network application delivery controller") @@ -407,14 +407,14 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { receipt, err := productOrderService.PlaceOrder(&opts, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error creating network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error creating network application delivery controller: %s", err) } // Wait VPX provisioning VPX, err := findVPXByOrderId(*receipt.OrderId, meta) if err != nil { - return fmt.Errorf("Error creating network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error creating network application delivery controller: %s", err) } d.SetId(fmt.Sprintf("%d", *VPX.Id)) @@ -423,7 +423,7 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } // Wait Virtual IP provisioning @@ -432,7 +432,7 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { for vipWaitCount := 0; vipWaitCount < 270; vipWaitCount++ { getObjectResult, err := NADCService.Id(id).Mask("subnets[ipAddresses],password[password]").GetObject() if err != nil { - return fmt.Errorf("Error retrieving network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error retrieving network application delivery controller: %s", err) } ipCount := 0 @@ -449,7 +449,7 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { } if !IsVipReady { - return fmt.Errorf("Failed to create VIPs for Netscaler VPX ID: %d", id) + return fmt.Errorf("[ERROR] Failed to create VIPs for Netscaler VPX ID: %d", id) } // Wait while VPX service is initializing. GetLoadBalancers() internally calls REST API of VPX and returns @@ -469,7 +469,7 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { } if !IsRESTReady { - return fmt.Errorf("Failed to intialize VPX REST Service for Netscaler VPX ID: %d", id) + return fmt.Errorf("[ERROR] Failed to intialize VPX REST Service for Netscaler VPX ID: %d", id) } // Wait additional buffer time for VPX service. @@ -479,12 +479,12 @@ func resourceIBMLbVpxCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbVpxRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkApplicationDeliveryControllerService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } getObjectResult, err := service. @@ -493,7 +493,7 @@ func resourceIBMLbVpxRead(d *schema.ResourceData, meta interface{}) error { GetObject() if err != nil { - return fmt.Errorf("Error retrieving network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error retrieving network application delivery controller: %s", err) } d.Set("name", *getObjectResult.Name) @@ -579,24 +579,24 @@ func resourceIBMLbVpxUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbVpxDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkApplicationDeliveryControllerService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } billingItem, err := service.Id(id).GetBillingItem() if err != nil { - return fmt.Errorf("Error deleting network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error deleting network application delivery controller: %s", err) } if *billingItem.Id > 0 { billingItemService := services.GetBillingItemService(sess) deleted, err := billingItemService.Id(*billingItem.Id).CancelService() if err != nil { - return fmt.Errorf("Error deleting network application delivery controller: %s", err) + return fmt.Errorf("[ERROR] Error deleting network application delivery controller: %s", err) } if deleted { @@ -608,11 +608,11 @@ func resourceIBMLbVpxDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbVpxExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetNetworkApplicationDeliveryControllerService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkApplicationDeliveryControllerService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } nadc, err := service.Mask("id").Id(id).GetObject() if err != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_ha.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_ha.go new file mode 100644 index 0000000000..671c4f5201 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_ha.go @@ -0,0 +1,356 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package classicinfrastructure + +import ( + "fmt" + "log" + "strconv" + "strings" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/minsikl/netscaler-nitro-go/client" + dt "github.com/minsikl/netscaler-nitro-go/datatypes" + "github.com/minsikl/netscaler-nitro-go/op" +) + +func ResourceIBMLbVpxHa() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMLbVpxHaCreate, + Read: resourceIBMLbVpxHaRead, + Update: resourceIBMLbVpxHaUpdate, + Delete: resourceIBMLbVpxHaDelete, + Exists: resourceIBMLbVpxHaExists, + Importer: &schema.ResourceImporter{}, + Schema: map[string]*schema.Schema{ + + "primary_id": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "primary ID", + }, + "secondary_id": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "Secondary ID", + }, + "stay_secondary": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Boolean value for stay secondary", + }, + "tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Tags set for the resource", + }, + }, + } +} + +func configureHA(nClient1 *client.NitroClient, nClient2 *client.NitroClient, staySecondary bool) error { + // 1. VPX2 : Sync password + systemuserReq2 := dt.SystemuserReq{ + Systemuser: &dt.Systemuser{ + Username: op.String("root"), + Password: op.String(nClient1.Password), + }, + } + err := nClient2.Update(&systemuserReq2) + if err != nil { + return err + } + nClient2.Password = nClient1.Password + + // 2. VPX1 : Register hanode + hanodeReq1 := dt.HanodeReq{ + Hanode: &dt.Hanode{ + Id: op.String("2"), + Ipaddress: op.String(nClient2.IpAddress), + }, + } + + err = nClient1.Add(&hanodeReq1) + if err != nil { + return err + } + + // Wait 5 secs to make VPX1 a primary node. + time.Sleep(time.Second * 5) + + // 3. VPX2 : Register hanode + hanodeReq2 := dt.HanodeReq{ + Hanode: &dt.Hanode{ + Id: op.String("2"), + Ipaddress: op.String(nClient1.IpAddress), + }, + } + err = nClient2.Add(&hanodeReq2) + if err != nil { + return err + } + + // 4. VPX2 : Update STAYSECONDARY + stay := dt.HanodeReq{Hanode: &dt.Hanode{}} + if staySecondary { + stay.Hanode.Hastatus = op.String("STAYSECONDARY") + } else { + stay.Hanode.Hastatus = op.String("ENABLE") + } + err = nClient2.Update(&stay) + if err != nil { + return err + } + + // 5. VPX1 : Register rpcnode + nsrpcnode1 := dt.NsrpcnodeReq{ + Nsrpcnode: &dt.Nsrpcnode{ + Ipaddress: op.String(nClient1.IpAddress), + Password: op.String(nClient1.Password), + }, + } + err = nClient1.Update(&nsrpcnode1) + if err != nil { + return err + } + nsrpcnode1.Nsrpcnode.Ipaddress = op.String(nClient2.IpAddress) + err = nClient1.Update(&nsrpcnode1) + if err != nil { + return err + } + + // 6. VPX2 : Register rpcnode + nsrpcnode2 := dt.NsrpcnodeReq{ + Nsrpcnode: &dt.Nsrpcnode{ + Ipaddress: op.String(nClient1.IpAddress), + Password: op.String(nClient1.Password), + }, + } + err = nClient2.Update(&nsrpcnode2) + if err != nil { + return err + } + nsrpcnode2.Nsrpcnode.Ipaddress = op.String(nClient2.IpAddress) + err = nClient2.Update(&nsrpcnode2) + if err != nil { + return err + } + + // 7. VPX1 : Sync files + hafiles := dt.HafilesReq{ + Hafiles: &dt.Hafiles{ + Mode: []string{"all"}, + }, + } + err = nClient1.Add(&hafiles, "action=sync") + if err != nil { + return err + } + + return nil +} + +func deleteHA(nClient1 *client.NitroClient, nClient2 *client.NitroClient) error { + // 1. VPX2 : Delete hanode + err := nClient2.Delete(&dt.HanodeReq{}, "2") + if err != nil { + return err + } + + // 2. VPX1 : Delete hanode + err = nClient1.Delete(&dt.HanodeReq{}, "2") + if err != nil { + return err + } + return nil +} + +func parseHAId(id string) (int, int, error) { + if len(id) < 1 { + return 0, 0, fmt.Errorf("[ERROR] Failed to parse id : Unable to get netscaler Ids") + } + idList := strings.Split(id, ":") + if len(idList) != 2 || len(idList[0]) < 1 || len(idList[1]) < 1 { + return 0, 0, fmt.Errorf("[ERROR] Failed to parse id : Invalid HA ID") + } + primaryId, err := strconv.Atoi(idList[0]) + if err != nil { + return 0, 0, fmt.Errorf("[ERROR] Failed to parse id : Unable to get a primaryId %s", err) + } + secondaryId, err := strconv.Atoi(idList[1]) + if err != nil { + return 0, 0, fmt.Errorf("[ERROR] Failed to parse id : Unable to get a secondaryId %s", err) + } + return primaryId, secondaryId, nil +} + +func resourceIBMLbVpxHaCreate(d *schema.ResourceData, meta interface{}) error { + primaryId := d.Get("primary_id").(int) + secondaryId := d.Get("secondary_id").(int) + staySecondary := false + if stay, ok := d.GetOk("stay_secondary"); ok { + staySecondary = stay.(bool) + } + + nClientPrimary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), primaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting primary netscaler information ID: %d", primaryId) + } + + nClientSecondary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), secondaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting secondary netscaler information ID: %d", secondaryId) + } + + err = configureHA(nClientPrimary, nClientSecondary, staySecondary) + if err != nil { + return fmt.Errorf("[ERROR] Error configuration HA %s", err.Error()) + } + + d.SetId(fmt.Sprintf("%d:%d", primaryId, secondaryId)) + + log.Printf("[INFO] Netscaler HA ID: %s", d.Id()) + + return resourceIBMLbVpxHaRead(d, meta) +} + +func resourceIBMLbVpxHaRead(d *schema.ResourceData, meta interface{}) error { + primaryId, secondaryId, err := parseHAId(d.Id()) + if err != nil { + return fmt.Errorf("[ERROR] Error reading HA %s", err.Error()) + } + + nClientPrimary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), primaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting primary netscaler information ID: %d", primaryId) + } + + nClientSecondary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), secondaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting primary netscaler information ID: %d", primaryId) + } + + nClientSecondary.Password = nClientPrimary.Password + + res := dt.HanodeRes{} + err = nClientSecondary.Get(&res, "") + if err != nil { + fmt.Printf("Error getting hnode information : %s", err.Error()) + } + staySecondary := false + if *res.Hanode[0].Hastatus == "STAYSECONDARY" { + staySecondary = true + } + + d.Set("primary_id", primaryId) + d.Set("secondary_id", secondaryId) + d.Set("stay_secondary", staySecondary) + + return nil +} + +func resourceIBMLbVpxHaUpdate(d *schema.ResourceData, meta interface{}) error { + primaryId, secondaryId, err := parseHAId(d.Id()) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting HA %s", err.Error()) + } + + nClientPrimary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), primaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting primary netscaler information ID: %d", primaryId) + } + + nClientSecondary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), secondaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting secondary netscaler information ID: %d", secondaryId) + } + + nClientSecondary.Password = nClientPrimary.Password + + staySecondary := false + if stay, ok := d.GetOk("stay_secondary"); ok { + staySecondary = stay.(bool) + } + + stay := dt.HanodeReq{Hanode: &dt.Hanode{}} + if staySecondary { + stay.Hanode.Hastatus = op.String("STAYSECONDARY") + } else { + stay.Hanode.Hastatus = op.String("ENABLE") + } + + err = nClientSecondary.Update(&stay) + if err != nil { + return err + } + + return nil +} + +func resourceIBMLbVpxHaDelete(d *schema.ResourceData, meta interface{}) error { + primaryId, secondaryId, err := parseHAId(d.Id()) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting HA %s", err.Error()) + } + nClientPrimary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), primaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting primary netscaler information ID: %d", primaryId) + } + nClientSecondary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), secondaryId) + if err != nil { + return fmt.Errorf("[ERROR] Error getting secondary netscaler information ID: %d", secondaryId) + } + + secondaryPassword := nClientSecondary.Password + nClientSecondary.Password = nClientPrimary.Password + err = deleteHA(nClientPrimary, nClientSecondary) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting HA %s", err.Error()) + } + + // Restore password of the secondary VPX + systemuserReq := dt.SystemuserReq{ + Systemuser: &dt.Systemuser{ + Username: op.String("root"), + Password: op.String(secondaryPassword), + }, + } + err = nClientSecondary.Update(&systemuserReq) + if err != nil { + return err + } + + return nil +} + +func resourceIBMLbVpxHaExists(d *schema.ResourceData, meta interface{}) (bool, error) { + primaryId, _, err := parseHAId(d.Id()) + if err != nil { + return false, fmt.Errorf("[ERROR] Error reading HA %s", err.Error()) + } + + nClientPrimary, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), primaryId) + if err != nil { + return false, fmt.Errorf("[ERROR] Error getting primary netscaler information ID in Exist: %d", primaryId) + } + + res := dt.HanodeRes{} + err = nClientPrimary.Get(&res, "") + if err != nil { + return false, fmt.Errorf("[ERROR] Error getting hnode information in Exist: %s", err.Error()) + } + + if len(res.Hanode) < 2 { + return false, nil + } + + return true, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_service.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_service.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_service.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_service.go index 70d8dff37c..1b309b9ec6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_service.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_service.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -11,6 +11,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" dt "github.com/minsikl/netscaler-nitro-go/datatypes" "github.com/minsikl/netscaler-nitro-go/op" @@ -39,7 +40,7 @@ var ( } ) -func resourceIBMLbVpxService() *schema.Resource { +func ResourceIBMLbVpxService() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbVpxServiceCreate, Read: resourceIBMLbVpxServiceRead, @@ -125,7 +126,7 @@ func parseServiceId(id string) (string, int, string, error) { vipId := parts[1] nacdId, err := strconv.Atoi(parts[0]) if err != nil { - return "", -1, "", fmt.Errorf("Error parsing vip id: %s", err) + return "", -1, "", fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } serviceName := "" @@ -161,12 +162,12 @@ func resourceIBMLbVpxServiceCreate(d *schema.ResourceData, meta interface{}) err _, nadcId, _, err := parseServiceId(vipId) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error creating Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error creating Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -179,12 +180,12 @@ func resourceIBMLbVpxServiceCreate(d *schema.ResourceData, meta interface{}) err func resourceIBMLbVpxServiceRead(d *schema.ResourceData, meta interface{}) error { _, nadcId, _, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error Reading Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error Reading Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -197,12 +198,12 @@ func resourceIBMLbVpxServiceRead(d *schema.ResourceData, meta interface{}) error func resourceIBMLbVpxServiceUpdate(d *schema.ResourceData, meta interface{}) error { _, nadcId, _, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error updating Virtual IP Address: %s", err) + return fmt.Errorf("[ERROR] Error updating Virtual IP Address: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error updating Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error updating Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -215,12 +216,12 @@ func resourceIBMLbVpxServiceUpdate(d *schema.ResourceData, meta interface{}) err func resourceIBMLbVpxServiceDelete(d *schema.ResourceData, meta interface{}) error { _, nadcId, _, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -233,12 +234,12 @@ func resourceIBMLbVpxServiceDelete(d *schema.ResourceData, meta interface{}) err func resourceIBMLbVpxServiceExists(d *schema.ResourceData, meta interface{}) (bool, error) { _, nadcId, _, err := parseServiceId(d.Id()) if err != nil { - return false, fmt.Errorf("Error in exists: %s", err) + return false, fmt.Errorf("[ERROR] Error in exists: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return false, fmt.Errorf("Error in exists: %s", err) + return false, fmt.Errorf("[ERROR] Error in exists: %s", err) } if version == VPX_VERSION_10_1 { @@ -250,14 +251,14 @@ func resourceIBMLbVpxServiceExists(d *schema.ResourceData, meta interface{}) (bo func resourceIBMLbVpxServiceCreate101(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipId := d.Get("vip_id").(string) vipName, nadcId, _, err := parseServiceId(vipId) serviceName := d.Get("name").(string) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } lb_services := []datatypes.Network_LoadBalancer_Service{ @@ -281,7 +282,7 @@ func resourceIBMLbVpxServiceCreate101(d *schema.ResourceData, meta interface{}) _, err = network.GetNadcLbVipServiceByName(sess, nadcId, vipName, serviceName) if err == nil { - return fmt.Errorf("Error creating LoadBalancer Service: The service name '%s' is already used.", + return fmt.Errorf("[ERROR] Error creating LoadBalancer Service: The service name '%s' is already used.", serviceName) } @@ -290,11 +291,11 @@ func resourceIBMLbVpxServiceCreate101(d *schema.ResourceData, meta interface{}) successFlag, err := updateVpxService(sess.SetRetries(0), nadcId, lbVip) if err != nil { - return fmt.Errorf("Error creating LoadBalancer Service: %s", err) + return fmt.Errorf("[ERROR] Error creating LoadBalancer Service: %s", err) } if !successFlag { - return errors.New("Error creating LoadBalancer Service") + return errors.New("[ERROR] Error creating LoadBalancer Service") } d.SetId(fmt.Sprintf("%s:%s", vipId, serviceName)) @@ -304,19 +305,19 @@ func resourceIBMLbVpxServiceCreate101(d *schema.ResourceData, meta interface{}) func resourceIBMLbVpxServiceCreate105(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipId := d.Get("vip_id").(string) vipName, nadcId, _, err := parseServiceId(vipId) serviceName := d.Get("name").(string) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } nClient, err := getNitroClient(sess, nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } // Create a service @@ -334,13 +335,13 @@ func resourceIBMLbVpxServiceCreate105(d *schema.ResourceData, meta interface{}) vip := dt.LbvserverRes{} err = nClient.Get(&vip, vipName) if err != nil { - return fmt.Errorf("Error creating LoadBalancer Service : %s", err) + return fmt.Errorf("[ERROR] Error creating LoadBalancer Service : %s", err) } if vip.Lbvserver[0].ServiceType != nil { svcReq.Service.ServiceType = vip.Lbvserver[0].ServiceType } else { - return fmt.Errorf("Error creating LoadBalancer : type of VIP '%s' is null.", vipName) + return fmt.Errorf("[ERROR] Error creating LoadBalancer : type of VIP '%s' is null.", vipName) } // SSL offload @@ -353,7 +354,7 @@ func resourceIBMLbVpxServiceCreate105(d *schema.ResourceData, meta interface{}) // Add the service err = nClient.Add(&svcReq) if err != nil { - return fmt.Errorf("Error creating LoadBalancer Service: %s", err) + return fmt.Errorf("[ERROR] Error creating LoadBalancer Service: %s", err) } // Bind the virtual server and the service @@ -366,7 +367,7 @@ func resourceIBMLbVpxServiceCreate105(d *schema.ResourceData, meta interface{}) err = nClient.Add(&lbvserverServiceBindingReq) if err != nil { - return fmt.Errorf("Error creating LoadBalancer Service: %s", err) + return fmt.Errorf("[ERROR] Error creating LoadBalancer Service: %s", err) } // Bind Health_check monitor @@ -384,7 +385,7 @@ func resourceIBMLbVpxServiceCreate105(d *schema.ResourceData, meta interface{}) err = nClient.Add(&serviceLbmonitorBindingReq) if err != nil { - return fmt.Errorf("Error creating LoadBalancer Service: %s", err) + return fmt.Errorf("[ERROR] Error creating LoadBalancer Service: %s", err) } d.SetId(fmt.Sprintf("%s:%s", vipId, serviceName)) @@ -393,16 +394,16 @@ func resourceIBMLbVpxServiceCreate105(d *schema.ResourceData, meta interface{}) } func resourceIBMLbVpxServiceRead101(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipName, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } lbService, err := network.GetNadcLbVipServiceByName(sess, nadcId, vipName, serviceName) if err != nil { - return fmt.Errorf("Unable to get load balancer service %s: %s", serviceName, err) + return fmt.Errorf("[ERROR] Unable to get load balancer service %s: %s", serviceName, err) } d.Set("vip_id", strconv.Itoa(nadcId)+":"+vipName) @@ -419,12 +420,12 @@ func resourceIBMLbVpxServiceRead101(d *schema.ResourceData, meta interface{}) er func resourceIBMLbVpxServiceRead105(d *schema.ResourceData, meta interface{}) error { vipName, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } // Read a service @@ -464,16 +465,16 @@ func resourceIBMLbVpxServiceRead105(d *schema.ResourceData, meta interface{}) er func resourceIBMLbVpxServiceUpdate101(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() vipName, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } lbService, err := network.GetNadcLbVipServiceByName(sess, nadcId, vipName, serviceName) if err != nil { - return fmt.Errorf("Unable to get load balancer service: %s", err) + return fmt.Errorf("[ERROR] Unable to get load balancer service: %s", err) } // copy current service @@ -507,11 +508,11 @@ func resourceIBMLbVpxServiceUpdate101(d *schema.ResourceData, meta interface{}) successFlag, err := updateVpxService(sess.SetRetries(0), nadcId, lbVip) if err != nil { - return fmt.Errorf("Error updating LoadBalancer Service: %s", err) + return fmt.Errorf("[ERROR] Error updating LoadBalancer Service: %s", err) } if !successFlag { - return errors.New("Error updating LoadBalancer Service") + return errors.New("[ERROR] Error updating LoadBalancer Service") } return nil @@ -520,12 +521,12 @@ func resourceIBMLbVpxServiceUpdate101(d *schema.ResourceData, meta interface{}) func resourceIBMLbVpxServiceUpdate105(d *schema.ResourceData, meta interface{}) error { _, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } // Update a service @@ -548,7 +549,7 @@ func resourceIBMLbVpxServiceUpdate105(d *schema.ResourceData, meta interface{}) // Delete previous health_check err = nClient.Delete(&dt.ServiceLbmonitorBindingReq{}, serviceName, "args=monitor_name:"+*monitorName) if err != nil { - return fmt.Errorf("Error deleting monitor %s: %s", *monitorName, err) + return fmt.Errorf("[ERROR] Error deleting monitor %s: %s", *monitorName, err) } } @@ -567,7 +568,7 @@ func resourceIBMLbVpxServiceUpdate105(d *schema.ResourceData, meta interface{}) err = nClient.Add(&serviceLbmonitorBindingReq) if err != nil { - return fmt.Errorf("Error adding a monitor: %s", err) + return fmt.Errorf("[ERROR] Error adding a monitor: %s", err) } } @@ -588,7 +589,7 @@ func resourceIBMLbVpxServiceUpdate105(d *schema.ResourceData, meta interface{}) } if err != nil { - return fmt.Errorf("Error updating LoadBalancer Service: %s", err) + return fmt.Errorf("[ERROR] Error updating LoadBalancer Service: %s", err) } return nil @@ -597,10 +598,10 @@ func resourceIBMLbVpxServiceUpdate105(d *schema.ResourceData, meta interface{}) func resourceIBMLbVpxServiceDelete101(d *schema.ResourceData, meta interface{}) error { vipName, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkApplicationDeliveryControllerService(sess) lbSvc := datatypes.Network_LoadBalancer_Service{ @@ -633,7 +634,7 @@ func resourceIBMLbVpxServiceDelete101(d *schema.ResourceData, meta interface{}) } if err != nil { - return fmt.Errorf("Error deleting LoadBalancer Service %s: %s", serviceName, err) + return fmt.Errorf("[ERROR] Error deleting LoadBalancer Service %s: %s", serviceName, err) } return nil @@ -642,18 +643,18 @@ func resourceIBMLbVpxServiceDelete101(d *schema.ResourceData, meta interface{}) func resourceIBMLbVpxServiceDelete105(d *schema.ResourceData, meta interface{}) error { _, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return fmt.Errorf("Error parsing vip id: %s", err) + return fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } // Delete a service err = nClient.Delete(&dt.ServiceReq{}, serviceName) if err != nil { - return fmt.Errorf("Error deleting service %s: %s", serviceName, err) + return fmt.Errorf("[ERROR] Error deleting service %s: %s", serviceName, err) } return nil @@ -662,9 +663,9 @@ func resourceIBMLbVpxServiceDelete105(d *schema.ResourceData, meta interface{}) func resourceIBMLbVpxServiceExists101(d *schema.ResourceData, meta interface{}) (bool, error) { vipName, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return false, fmt.Errorf("Error parsing vip id: %s", err) + return false, fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - lbService, err := network.GetNadcLbVipServiceByName(meta.(ClientSession).SoftLayerSession(), nadcId, vipName, serviceName) + lbService, err := network.GetNadcLbVipServiceByName(meta.(conns.ClientSession).SoftLayerSession(), nadcId, vipName, serviceName) if err != nil { if apiErr, ok := err.(sl.Error); ok { if apiErr.StatusCode == 404 { @@ -679,12 +680,12 @@ func resourceIBMLbVpxServiceExists101(d *schema.ResourceData, meta interface{}) func resourceIBMLbVpxServiceExists105(d *schema.ResourceData, meta interface{}) (bool, error) { _, nadcId, serviceName, err := parseServiceId(d.Id()) if err != nil { - return false, fmt.Errorf("Error parsing vip id: %s", err) + return false, fmt.Errorf("[ERROR] Error parsing vip id: %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return false, fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return false, fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } svc := dt.ServiceRes{} @@ -692,7 +693,7 @@ func resourceIBMLbVpxServiceExists105(d *schema.ResourceData, meta interface{}) if err != nil && strings.Contains(err.Error(), "No Service") { return false, nil } else if err != nil { - return false, fmt.Errorf("Unable to get load balancer service %s: %s", serviceName, err) + return false, fmt.Errorf("[ERROR] Unable to get load balancer service %s: %s", serviceName, err) } return *svc.Service[0].Name == serviceName, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_vip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_vip.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_vip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_vip.go index 046735e482..4a5fa41b33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lb_vpx_vip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lb_vpx_vip.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "encoding/base64" @@ -12,6 +12,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/helpers/network" @@ -56,7 +57,7 @@ var ( } ) -func resourceIBMLbVpxVip() *schema.Resource { +func ResourceIBMLbVpxVip() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbVpxVipCreate, Read: resourceIBMLbVpxVipRead, @@ -135,9 +136,9 @@ func resourceIBMLbVpxVip() *schema.Resource { } func resourceIBMLbVpxVipCreate(d *schema.ResourceData, meta interface{}) error { - version, err := getVPXVersion(d.Get("nad_controller_id").(int), meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(d.Get("nad_controller_id").(int), meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error creating Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error creating Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -150,12 +151,12 @@ func resourceIBMLbVpxVipCreate(d *schema.ResourceData, meta interface{}) error { func resourceIBMLbVpxVipRead(d *schema.ResourceData, meta interface{}) error { nadcId, _, err := parseId(d.Id()) if err != nil { - return fmt.Errorf("Error Reading Virtual IP Address: %s", err) + return fmt.Errorf("[ERROR] Error Reading Virtual IP Address: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error Reading Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error Reading Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -168,12 +169,12 @@ func resourceIBMLbVpxVipRead(d *schema.ResourceData, meta interface{}) error { func resourceIBMLbVpxVipUpdate(d *schema.ResourceData, meta interface{}) error { nadcId, _, err := parseId(d.Id()) if err != nil { - return fmt.Errorf("Error updating Virtual IP Address: %s", err) + return fmt.Errorf("[ERROR] Error updating Virtual IP Address: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error updating Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error updating Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -186,12 +187,12 @@ func resourceIBMLbVpxVipUpdate(d *schema.ResourceData, meta interface{}) error { func resourceIBMLbVpxVipDelete(d *schema.ResourceData, meta interface{}) error { nadcId, _, err := parseId(d.Id()) if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address: %s", err) } if version == VPX_VERSION_10_1 { @@ -204,12 +205,12 @@ func resourceIBMLbVpxVipDelete(d *schema.ResourceData, meta interface{}) error { func resourceIBMLbVpxVipExists(d *schema.ResourceData, meta interface{}) (bool, error) { nadcId, _, err := parseId(d.Id()) if err != nil { - return false, fmt.Errorf("Error in exists: %s", err) + return false, fmt.Errorf("[ERROR] Error in exists: %s", err) } - version, err := getVPXVersion(nadcId, meta.(ClientSession).SoftLayerSession()) + version, err := getVPXVersion(nadcId, meta.(conns.ClientSession).SoftLayerSession()) if err != nil { - return false, fmt.Errorf("Error in exists: %s", err) + return false, fmt.Errorf("[ERROR] Error in exists: %s", err) } if version == VPX_VERSION_10_1 { @@ -221,17 +222,17 @@ func resourceIBMLbVpxVipExists(d *schema.ResourceData, meta interface{}) (bool, func parseId(id string) (int, string, error) { if len(id) < 1 { - return 0, "", fmt.Errorf("Failed to parse id %s: Unable to get a VIP ID", id) + return 0, "", fmt.Errorf("[ERROR] Failed to parse id %s: Unable to get a VIP ID", id) } idList := strings.Split(id, ":") if len(idList) != 2 || len(idList[0]) < 1 || len(idList[1]) < 1 { - return 0, "", fmt.Errorf("Failed to parse id %s: Invalid VIP ID", id) + return 0, "", fmt.Errorf("[ERROR] Failed to parse id %s: Invalid VIP ID", id) } nadcId, err := strconv.Atoi(idList[0]) if err != nil { - return 0, "", fmt.Errorf("Failed to parse id : Unable to get a VIP ID %s", err) + return 0, "", fmt.Errorf("[ERROR] Failed to parse id : Unable to get a VIP ID %s", err) } vipName := idList[1] @@ -240,10 +241,10 @@ func parseId(id string) (int, string, error) { func resourceIBMLbVpxVipCreate101(d *schema.ResourceData, meta interface{}) error { if _, ok := d.GetOk("security_certificate_id"); ok { - return fmt.Errorf("Error creating Virtual Ip Address: security_certificate_id is not supported with VPX 10.1.") + return fmt.Errorf("[ERROR] Error creating Virtual Ip Address: security_certificate_id is not supported with VPX 10.1.") } - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkApplicationDeliveryControllerService(sess.SetRetries(0)) nadcId := d.Get("nad_controller_id").(int) @@ -283,11 +284,11 @@ func resourceIBMLbVpxVipCreate101(d *schema.ResourceData, meta interface{}) erro } if err != nil { - return fmt.Errorf("Error creating Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error creating Virtual Ip Address: %s", err) } if !successFlag { - return errors.New("Error creating Virtual Ip Address") + return errors.New("[ERROR] Error creating Virtual Ip Address") } d.SetId(fmt.Sprintf("%d:%s", nadcId, vipName)) @@ -299,9 +300,9 @@ func resourceIBMLbVpxVipCreate101(d *schema.ResourceData, meta interface{}) erro func resourceIBMLbVpxVipCreate105(d *schema.ResourceData, meta interface{}) error { nadcId := d.Get("nad_controller_id").(int) - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } vipName := d.Get("name").(string) @@ -334,9 +335,9 @@ func resourceIBMLbVpxVipCreate105(d *schema.ResourceData, meta interface{}) erro // security_certificated_id is only available when type is 'SSL' if securityCertificateId > 0 && vipType != "SSL" { - return fmt.Errorf("Error creating VIP : security_certificated_id is only available when type is 'SSL'") + return fmt.Errorf("[ERROR] Error creating VIP : security_certificated_id is only available when type is 'SSL'") } else if securityCertificateId == 0 && vipType == "SSL" { - return fmt.Errorf("Error creating VIP : 'SSL' type requires security_certificated_id.") + return fmt.Errorf("[ERROR] Error creating VIP : 'SSL' type requires security_certificated_id.") } @@ -351,7 +352,7 @@ func resourceIBMLbVpxVipCreate105(d *schema.ResourceData, meta interface{}) erro // Delete the previous security certificate. deleteSecurityCertificate(nClient, vipName, securityCertificateId) - err = configureSecurityCertificate(nClient, meta.(ClientSession).SoftLayerSession(), vipName, securityCertificateId) + err = configureSecurityCertificate(nClient, meta.(conns.ClientSession).SoftLayerSession(), vipName, securityCertificateId) if err != nil { // Rollback VIP creation and return an error. @@ -368,7 +369,7 @@ func resourceIBMLbVpxVipCreate105(d *schema.ResourceData, meta interface{}) erro } func resourceIBMLbVpxVipRead101(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() nadcId, vipName, err := parseId(d.Id()) if err != nil { @@ -410,9 +411,9 @@ func resourceIBMLbVpxVipRead105(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("ibm_lb_vpx : %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } // Read a virtual server @@ -470,7 +471,7 @@ func resourceIBMLbVpxVipRead105(d *schema.ResourceData, meta interface{}) error } func resourceIBMLbVpxVipUpdate101(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkApplicationDeliveryControllerService(sess.SetRetries(0)) nadcId := d.Get("nad_controller_id").(int) @@ -503,7 +504,7 @@ func resourceIBMLbVpxVipUpdate101(d *schema.ResourceData, meta interface{}) erro } if err != nil { - return fmt.Errorf("Error updating Virtual Ip Address: %s", err) + return fmt.Errorf("[ERROR] Error updating Virtual Ip Address: %s", err) } return resourceIBMLbVpxVipRead(d, meta) @@ -511,9 +512,9 @@ func resourceIBMLbVpxVipUpdate101(d *schema.ResourceData, meta interface{}) erro func resourceIBMLbVpxVipUpdate105(d *schema.ResourceData, meta interface{}) error { nadcId := d.Get("nad_controller_id").(int) - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error getting netscaler information ID: %d", nadcId) + return fmt.Errorf("[ERROR] Error getting netscaler information ID: %d", nadcId) } lbvserverReq := dt.LbvserverReq{ @@ -544,14 +545,14 @@ func resourceIBMLbVpxVipUpdate105(d *schema.ResourceData, meta interface{}) erro // Update the virtual server err = nClient.Update(&lbvserverReq) if err != nil { - return fmt.Errorf("Error updating Virtual Ip Address: " + err.Error()) + return fmt.Errorf("[ERROR] Error updating Virtual Ip Address: " + err.Error()) } return resourceIBMLbVpxVipRead(d, meta) } func resourceIBMLbVpxVipDelete101(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkApplicationDeliveryControllerService(sess) nadcId, vipName, err := parseId(d.Id()) @@ -584,7 +585,7 @@ func resourceIBMLbVpxVipDelete101(d *schema.ResourceData, meta interface{}) erro } if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address %s: %s", vipName, err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address %s: %s", vipName, err) } return nil @@ -596,15 +597,15 @@ func resourceIBMLbVpxVipDelete105(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("ibm_lb_vpx : %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address %s: %s", vipName, err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address %s: %s", vipName, err) } // Delete a virtual server err = nClient.Delete(&dt.LbvserverReq{}, vipName) if err != nil { - return fmt.Errorf("Error deleting Virtual Ip Address %s: %s", vipName, err) + return fmt.Errorf("[ERROR] Error deleting Virtual Ip Address %s: %s", vipName, err) } // Delete a security certificate @@ -617,7 +618,7 @@ func resourceIBMLbVpxVipDelete105(d *schema.ResourceData, meta interface{}) erro } func resourceIBMLbVpxVipExists101(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() nadcId, vipName, err := parseId(d.Id()) if err != nil { @@ -642,7 +643,7 @@ func resourceIBMLbVpxVipExists105(d *schema.ResourceData, meta interface{}) (boo return false, fmt.Errorf("ibm_lb_vpx : %s", err) } - nClient, err := getNitroClient(meta.(ClientSession).SoftLayerSession(), nadcId) + nClient, err := getNitroClient(meta.(conns.ClientSession).SoftLayerSession(), nadcId) if err != nil { return false, err } @@ -664,7 +665,7 @@ func getNitroClient(sess *session.Session, nadcId int) (*client.NitroClient, err service := services.GetNetworkApplicationDeliveryControllerService(sess) nadc, err := service.Id(nadcId).Mask("managementIpAddress,password[password]").GetObject() if err != nil { - return nil, fmt.Errorf("Error retrieving netscaler: %s", err) + return nil, fmt.Errorf("[ERROR] Error retrieving netscaler: %s", err) } return client.NewNitroClient("http", *nadc.ManagementIpAddress, dt.CONFIG, "root", *nadc.Password.Password, true), nil @@ -676,7 +677,7 @@ func configureSecurityCertificate(nClient *client.NitroClient, sess *session.Ses cert, err := service.Id(securityCertificateId).GetObject() if err != nil { - return fmt.Errorf("Unable to get Security Certificate: %s", err) + return fmt.Errorf("[ERROR] Unable to get Security Certificate: %s", err) } certName := vipName + "_" + strconv.Itoa(securityCertificateId) @@ -787,7 +788,7 @@ func getSecurityCertificateId(nClient *client.NitroClient, vipName string) (int, res := dt.SslcertkeyRes{} err := nClient.Get(&res, "") if err != nil { - return 0, fmt.Errorf("Error getting securityCertificateId information : %s", err.Error()) + return 0, fmt.Errorf("[ERROR] Error getting securityCertificateId information : %s", err.Error()) } //CertKey name is consisted of `vipName`_`securityCertificateId`. @@ -804,5 +805,5 @@ func getSecurityCertificateId(nClient *client.NitroClient, vipName string) (int, return securityCertificateId, nil } } - return 0, fmt.Errorf("Error getting securityCertificateId information : No security certificate for %s", vipName) + return 0, fmt.Errorf("[ERROR] Error getting securityCertificateId information : No security certificate for %s", vipName) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas.go index e61cbce9c8..d2ff595b33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "bytes" @@ -10,7 +10,9 @@ import ( "strings" "time" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -50,7 +52,7 @@ func init() { } } -func resourceIBMLbaas() *schema.Resource { +func ResourceIBMLbaas() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbaasCreate, Read: resourceIBMLbaasRead, @@ -77,7 +79,7 @@ func resourceIBMLbaas() *schema.Resource { Default: "PUBLIC", ForceNew: true, Description: "Specifies if a load balancer is public or private", - ValidateFunc: validateAllowedStringValue([]string{"PUBLIC", "PRIVATE"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"PUBLIC", "PRIVATE"}), }, "datacenter": { Type: schema.TypeString, @@ -106,7 +108,7 @@ func resourceIBMLbaas() *schema.Resource { Type: schema.TypeBool, Optional: true, Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: `"in public loadbalancer - Public IP address allocation done by system public IP pool or public subnet."`, }, "protocols": { @@ -119,30 +121,30 @@ func resourceIBMLbaas() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Frontend protocol, one of 'TCP', 'HTTP', 'HTTPS'.", - ValidateFunc: validateAllowedStringValue([]string{"HTTP", "HTTPS", "TCP"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"HTTP", "HTTPS", "TCP"}), }, "frontend_port": { Type: schema.TypeInt, Required: true, Description: "Frontend Protocol port number. Should be in range (1, 65535)", - ValidateFunc: validatePortRange(1, 65535), + ValidateFunc: validate.ValidatePortRange(1, 65535), }, "backend_protocol": { Type: schema.TypeString, Required: true, Description: "Backend protocol, one of 'TCP', 'HTTP', 'HTTPS'.", - ValidateFunc: validateAllowedStringValue([]string{"HTTP", "HTTPS", "TCP"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"HTTP", "HTTPS", "TCP"}), }, "backend_port": { Type: schema.TypeInt, Required: true, Description: "Backend Protocol port number. Should be in range (1, 65535)", - ValidateFunc: validatePortRange(1, 65535), + ValidateFunc: validate.ValidatePortRange(1, 65535), }, "load_balancing_method": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"round_robin", "weighted_round_robin", "least_connection"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"round_robin", "weighted_round_robin", "least_connection"}), Default: "round_robin", Description: "Load balancing algorithm: 'round_robin', 'weighted_round_robin', 'least_connection'", }, @@ -150,13 +152,13 @@ func resourceIBMLbaas() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "Session stickness. Valid values is SOURCE_IP and HTTP_COOKIE", - ValidateFunc: validateAllowedStringValue([]string{"SOURCE_IP", "HTTP_COOKIE"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"SOURCE_IP", "HTTP_COOKIE"}), }, "max_conn": { Type: schema.TypeInt, Optional: true, Description: "No. of connections the listener can accept. Should be between 1-64000", - ValidateFunc: validateMaxConn, + ValidateFunc: validate.ValidateMaxConn, }, "tls_certificate_id": { Type: schema.TypeInt, @@ -178,7 +180,7 @@ func resourceIBMLbaas() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, - //ValidateFunc: validateAllowedStringValue([]string{"ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-SHA384", "AES256-GCM-SHA384", "AES256-SHA256", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-SHA256", "AES128-GCM-SHA256", "AES128-SHA256"}), + //ValidateFunc: validate.ValidateAllowedStringValues([]string{"ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-SHA384", "AES256-GCM-SHA384", "AES256-SHA256", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-SHA256", "AES128-GCM-SHA256", "AES128-SHA256"}), }, "wait_time_minutes": { Type: schema.TypeInt, @@ -222,17 +224,17 @@ func resourceIBMLbaas() *schema.Resource { }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", @@ -243,12 +245,12 @@ func resourceIBMLbaas() *schema.Resource { func resourceIBMLbaasCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Find price items productOrderContainer, err := buildLbaasLBProductOrderContainer(d, sess) if err != nil { - return fmt.Errorf("Error creating Load balancer: %s", err) + return fmt.Errorf("[ERROR] Error creating Load balancer: %s", err) } log.Println("[INFO] Creating Load Balancer") @@ -256,20 +258,20 @@ func resourceIBMLbaasCreate(d *schema.ResourceData, meta interface{}) error { _, err = services.GetProductOrderService(sess). VerifyOrder(productOrderContainer) if err != nil { - return fmt.Errorf("Error during creation of Load balancer: %s", err) + return fmt.Errorf("[ERROR] Error during creation of Load balancer: %s", err) } //place order _, err = services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of Load balancer: %s", err) + return fmt.Errorf("[ERROR] Error during creation of Load balancer: %s", err) } name := d.Get("name").(string) lbaasLB, err := findLbaasLBByOrderId(sess, name, d) if err != nil { - return fmt.Errorf("Error during creation of Load balancer: %s", err) + return fmt.Errorf("[ERROR] Error during creation of Load balancer: %s", err) } d.SetId(*lbaasLB.Uuid) @@ -278,12 +280,12 @@ func resourceIBMLbaasCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbaasRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) result, err := service.Mask("datacenter,members,listeners.defaultPool,listeners.defaultPool.sessionAffinity,listeners.defaultPool.healthMonitor,healthMonitors,sslCiphers[name],useSystemPublicIpPool,isPublic,name,description,operatingStatus,address").GetLoadBalancer(sl.String(d.Id())) if err != nil { - return fmt.Errorf("Error retrieving load balancer: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } var lbType string @@ -301,23 +303,23 @@ func resourceIBMLbaasRead(d *schema.ResourceData, meta interface{}) error { d.Set("type", lbType) d.Set("status", result.OperatingStatus) d.Set("vip", result.Address) - d.Set("health_monitors", flattenHealthMonitors(result.Listeners)) - d.Set("protocols", flattenProtocols(result.Listeners)) - d.Set("ssl_ciphers", flattenSSLCiphers(result.SslCiphers)) + d.Set("health_monitors", flex.FlattenHealthMonitors(result.Listeners)) + d.Set("protocols", flex.FlattenProtocols(result.Listeners)) + d.Set("ssl_ciphers", flex.FlattenSSLCiphers(result.SslCiphers)) if *result.UseSystemPublicIpPool == 1 { d.Set("use_system_public_ip_pool", true) } else { d.Set("use_system_public_ip_pool", false) } - d.Set(ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/network/loadbalancing/cloud/details/%s#Overview", d.Id())) - d.Set(ResourceName, *result.Name) - d.Set(ResourceStatus, *result.OperatingStatus) + d.Set(flex.ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/network/loadbalancing/cloud/details/%s#Overview", d.Id())) + d.Set(flex.ResourceName, *result.Name) + d.Set(flex.ResourceStatus, *result.OperatingStatus) return nil } func resourceIBMLbaasUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess.SetRetries(0)) if d.HasChange("description") { @@ -332,7 +334,7 @@ func resourceIBMLbaasUpdate(d *schema.ResourceData, meta interface{}) error { os := o.(*schema.Set) ns := n.(*schema.Set) - add, err := expandProtocols(ns.Difference(os).List()) + add, err := flex.ExpandProtocols(ns.Difference(os).List()) if err != nil { return err } @@ -347,24 +349,22 @@ func resourceIBMLbaasUpdate(d *schema.ResourceData, meta interface{}) error { if len(removeList) > 0 { _, err := listenerService.DeleteLoadBalancerProtocols(sl.String(d.Id()), removeList) if err != nil { - return fmt.Errorf("Error removing protocols: %#v", err) + return fmt.Errorf("[ERROR] Error removing protocols: %#v", err) } _, err = waitForLbaasLBAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } } if len(add) > 0 { _, err := listenerService.UpdateLoadBalancerProtocols(sl.String(d.Id()), add) if err != nil { - return fmt.Errorf("Error adding protocols: %#v", err) + return fmt.Errorf("[ERROR] Error adding protocols: %#v", err) } _, err = waitForLbaasLBAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } } @@ -374,7 +374,7 @@ func resourceIBMLbaasUpdate(d *schema.ResourceData, meta interface{}) error { service := services.GetNetworkLBaaSLoadBalancerService(sess.SetRetries(0)) supportedCiphers, err := services.GetNetworkLBaaSSSLCipherService(sess).Mask("id,name").GetAllObjects() if err != nil { - return fmt.Errorf("Error retreving list of ssl ciphers: %#v", err) + return fmt.Errorf("[ERROR] Error retreving list of ssl ciphers: %#v", err) } ciphers := make([]int, v.(*schema.Set).Len()) for i, v := range v.(*schema.Set).List() { @@ -387,12 +387,11 @@ func resourceIBMLbaasUpdate(d *schema.ResourceData, meta interface{}) error { } _, err = service.UpdateSslCiphers(sl.String(d.Id()), ciphers) if err != nil { - return fmt.Errorf("Error updating ssl ciphers: %#v", err) + return fmt.Errorf("[ERROR] Error updating ssl ciphers: %#v", err) } _, err = waitForLbaasLBAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } } @@ -403,7 +402,7 @@ func resourceIBMLbaasUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLbaasDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) _, err := service.CancelLoadBalancer(sl.String(d.Id())) @@ -411,20 +410,19 @@ func resourceIBMLbaasDelete(d *schema.ResourceData, meta interface{}) error { if strings.Contains(err.Error(), "DELETE_PENDING") { log.Println("Deletion is already in progress, probably from previous runs") } else { - return fmt.Errorf("Error deleting load balancer: %s", err) + return fmt.Errorf("[ERROR] Error deleting load balancer: %s", err) } } _, err = waitForLbaasLBDelete(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to be deleted: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to be deleted: %s", d.Id(), err) } d.SetId("") return nil } func resourceIBMLbaasExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) result, err := service.GetLoadBalancer(sl.String(d.Id())) @@ -432,7 +430,7 @@ func resourceIBMLbaasExists(d *schema.ResourceData, meta interface{}) (bool, err if apiErr, ok := err.(sl.Error); ok && (apiErr.StatusCode == 404 || apiErr.Exception == NOT_FOUND) { return false, nil } - return false, fmt.Errorf("Error retrieving load balancer: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } return result.Uuid != nil && *result.Uuid == d.Id(), nil } @@ -547,11 +545,11 @@ func findLbaasLBByOrderId(sess *session.Session, name string, d *schema.Resource } return nil, - fmt.Errorf("Cannot find a load balancer with name '%s' ", name) + fmt.Errorf("[ERROR] Cannot find a load balancer with name '%s' ", name) } func waitForLbaasLBAvailable(d *schema.ResourceData, meta interface{}) (interface{}, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) stateConf := &resource.StateChangeConf{ @@ -561,7 +559,7 @@ func waitForLbaasLBAvailable(d *schema.ResourceData, meta interface{}) (interfac lb, err := service.GetLoadBalancer(sl.String(d.Id())) if err != nil { if apiErr, ok := err.(sl.Error); ok && (apiErr.StatusCode == 404 || apiErr.Exception == NOT_FOUND) { - return nil, "", fmt.Errorf("The load balancer %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The load balancer %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } @@ -581,7 +579,7 @@ func waitForLbaasLBAvailable(d *schema.ResourceData, meta interface{}) (interfac } func waitForLbaasLBDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) stateConf := &resource.StateChangeConf{ @@ -620,7 +618,7 @@ func resourceIBMLBProtocolHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%d-", v.(int))) } - return hashcode.String(buf.String()) + return conns.String(buf.String()) } func resourceIBMLBMemberHash(v interface{}) int { @@ -629,5 +627,5 @@ func resourceIBMLBMemberHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["private_ip_address"].(string))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas_health_monitor.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas_health_monitor.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas_health_monitor.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas_health_monitor.go index 431bd36f87..a99762130c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas_health_monitor.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas_health_monitor.go @@ -1,18 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/services" "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMLbaasHealthMonitor() *schema.Resource { +func ResourceIBMLbaasHealthMonitor() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbaasHealthMonitorCreate, Read: resourceIBMLbaasHealthMonitorRead, @@ -25,41 +28,41 @@ func resourceIBMLbaasHealthMonitor() *schema.Resource { "protocol": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"HTTP", "HTTPS", "TCP"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"HTTP", "HTTPS", "TCP"}), Description: "Protocol value", }, "port": { Type: schema.TypeInt, Required: true, - ValidateFunc: validatePortRange(1, 65535), + ValidateFunc: validate.ValidatePortRange(1, 65535), Description: "Port number", }, "interval": { Type: schema.TypeInt, Optional: true, Default: 5, - ValidateFunc: validateInterval, + ValidateFunc: validate.ValidateInterval, Description: "Interval value", }, "max_retries": { Type: schema.TypeInt, Optional: true, Default: 2, - ValidateFunc: validateMaxRetries, + ValidateFunc: validate.ValidateMaxRetries, Description: "Maximum retry counts", }, "timeout": { Type: schema.TypeInt, Optional: true, Default: 2, - ValidateFunc: validateTimeout, + ValidateFunc: validate.ValidateTimeout, Description: "Timeout in seconds", }, "url_path": { Type: schema.TypeString, Optional: true, Default: "/", - ValidateFunc: validateURLPath, + ValidateFunc: validate.ValidateURLPath, Description: "URL Path", }, "monitor_id": { @@ -79,7 +82,7 @@ func resourceIBMLbaasHealthMonitor() *schema.Resource { } func resourceIBMLbaasHealthMonitorCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() healthMonitorService := services.GetNetworkLBaaSHealthMonitorService(sess.SetRetries(0)) lbaasID := d.Get("lbaas_id").(string) @@ -98,27 +101,25 @@ func resourceIBMLbaasHealthMonitorCreate(d *schema.ResourceData, meta interface{ _, err := waitForLbaasLBActive(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } _, err = healthMonitorService.UpdateLoadBalancerHealthMonitors(sl.String(lbaasID), healthMonitors) if err != nil { - return fmt.Errorf("Error adding health monitors: %#v", err) + return fmt.Errorf("[ERROR] Error adding health monitors: %#v", err) } _, err = waitForLbaasLBActive(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } d.SetId(fmt.Sprintf("%s/%s", lbaasID, d.Get("monitor_id").(string))) return resourceIBMLbaasHealthMonitorRead(d, meta) } func resourceIBMLbaasHealthMonitorRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -127,7 +128,7 @@ func resourceIBMLbaasHealthMonitorRead(d *schema.ResourceData, meta interface{}) result, err := service.Mask("listeners.defaultPool.healthMonitor").GetLoadBalancer(sl.String(lbaasID)) if err != nil { - return fmt.Errorf("Error retrieving load balancer: %s", err) + return fmt.Errorf("[ERROR] Error retrieving load balancer: %s", err) } for _, i := range result.Listeners { if monitorID == *i.DefaultPool.HealthMonitor.Uuid { @@ -148,9 +149,9 @@ func resourceIBMLbaasHealthMonitorRead(d *schema.ResourceData, meta interface{}) } func resourceIBMLbaasHealthMonitorUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() healthMonitorService := services.GetNetworkLBaaSHealthMonitorService(sess.SetRetries(0)) - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -179,7 +180,7 @@ func resourceIBMLbaasHealthMonitorUpdate(d *schema.ResourceData, meta interface{ _, err := healthMonitorService.UpdateLoadBalancerHealthMonitors(sl.String(lbaasID), healthMonitors) if err != nil { - return fmt.Errorf("Error adding health monitors: %#v", err) + return fmt.Errorf("[ERROR] Error adding health monitors: %#v", err) } _, err = waitForLbaasLBActive(d, meta) if err != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas_server_instance_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas_server_instance_attachment.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas_server_instance_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas_server_instance_attachment.go index 3af7f52e07..bea2775b6a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_lbaas_server_instance_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_lbaas_server_instance_attachment.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -15,7 +17,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMLbaasServerInstanceAttachment() *schema.Resource { +func ResourceIBMLbaasServerInstanceAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMLbaasServerInstanceAttachmentCreate, Read: resourceIBMLbaasServerInstanceAttachmentRead, @@ -30,14 +32,14 @@ func resourceIBMLbaasServerInstanceAttachment() *schema.Resource { Description: "The Private IP address of a load balancer member.", Required: true, ForceNew: true, - ValidateFunc: validateIP, + ValidateFunc: validate.ValidateIP, }, "weight": { Type: schema.TypeInt, Description: "The weight of a load balancer member.", Computed: true, Optional: true, - ValidateFunc: validateWeight, + ValidateFunc: validate.ValidateWeight, }, "lbaas_id": { Type: schema.TypeString, @@ -55,7 +57,7 @@ func resourceIBMLbaasServerInstanceAttachment() *schema.Resource { } func resourceIBMLbaasServerInstanceAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) memberService := services.GetNetworkLBaaSMemberService(sess) privateIPAddress := d.Get("private_ip_address").(string) @@ -68,17 +70,15 @@ func resourceIBMLbaasServerInstanceAttachmentCreate(d *schema.ResourceData, meta members = append(members, *p) _, err := waitForLbaasLBActive(d, meta) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", d.Id(), err) } _, err = memberService.AddLoadBalancerMembers(sl.String(lbaasId), members) if err != nil { - return fmt.Errorf("Error adding server instances: %#v", err) + return fmt.Errorf("[ERROR] Error adding server instances: %#v", err) } _, err = waitForLbaasLBActive(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } result, err := service.Mask("members").GetLoadBalancer(sl.String(lbaasId)) lbaasMembers := result.Members @@ -93,14 +93,13 @@ func resourceIBMLbaasServerInstanceAttachmentCreate(d *schema.ResourceData, meta } func resourceIBMLbaasServerInstanceAttachmentRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() memberService := services.GetNetworkLBaaSMemberService(sess) id := d.Id() memId, _ := strconv.Atoi(d.Id()) member, err := memberService.Id(memId).GetObject() if err != nil { - return fmt.Errorf( - "Error retrieving load balancer member(%s) : %s", id, err) + return fmt.Errorf("[ERROR] Error retrieving load balancer member(%s) : %s", id, err) } d.Set("private_ip_address", member.Address) d.Set("weight", member.Weight) @@ -110,7 +109,7 @@ func resourceIBMLbaasServerInstanceAttachmentRead(d *schema.ResourceData, meta i } func resourceIBMLbaasServerInstanceAttachmentUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() memberService := services.GetNetworkLBaaSMemberService(sess) if d.HasChange("weight") { weight := d.Get("weight").(int) @@ -131,7 +130,7 @@ func resourceIBMLbaasServerInstanceAttachmentUpdate(d *schema.ResourceData, meta } _, err = memberService.UpdateLoadBalancerMembers(sl.String(lbaasId), members) if err != nil { - return fmt.Errorf("Error updating loadbalnacer: %#v", err) + return fmt.Errorf("[ERROR] Error updating loadbalnacer: %#v", err) } _, err = waitForLbaasLBActive(d, meta) if err != nil { @@ -145,7 +144,7 @@ func resourceIBMLbaasServerInstanceAttachmentUpdate(d *schema.ResourceData, meta } func resourceIBMLbaasServerInstanceAttachmentExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() memberService := services.GetNetworkLBaaSMemberService(sess) memId, _ := strconv.Atoi(d.Id()) result, err := memberService.Id(memId).GetObject() @@ -153,36 +152,34 @@ func resourceIBMLbaasServerInstanceAttachmentExists(d *schema.ResourceData, meta if apiErr, ok := err.(sl.Error); ok && (apiErr.StatusCode == 404 || apiErr.Exception == NOT_FOUND) { return false, nil } - return false, fmt.Errorf("Error retrieving load balancer member: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving load balancer member: %s", err) } return result.Id != nil && *result.Id == memId, nil } func resourceIBMLbaasServerInstanceAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() memberService := services.GetNetworkLBaaSMemberService(sess) lbaasId := d.Get("lbaas_id").(string) removeList := make([]string, 0, 1) removeList = append(removeList, d.Get("uuid").(string)) _, err := waitForLbaasLBActive(d, meta) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", d.Id(), err) } _, err = memberService.DeleteLoadBalancerMembers(sl.String(lbaasId), removeList) if err != nil { - return fmt.Errorf("Error removing server instances: %#v", err) + return fmt.Errorf("[ERROR] Error removing server instances: %#v", err) } _, err = waitForLbaasLBActive(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", d.Id(), err) } return nil } func waitForLbaasLBActive(d *schema.ResourceData, meta interface{}) (interface{}, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkLBaaSLoadBalancerService(sess) lbaasId := d.Get("lbaas_id").(string) @@ -193,7 +190,7 @@ func waitForLbaasLBActive(d *schema.ResourceData, meta interface{}) (interface{} lb, err := service.GetLoadBalancer(sl.String(lbaasId)) if err != nil { if apiErr, ok := err.(sl.Error); ok && (apiErr.StatusCode == 404 || apiErr.Exception == NOT_FOUND) { - return nil, "", fmt.Errorf("The load balancer %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The load balancer %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_multi_vlan_firewall.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_multi_vlan_firewall.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_multi_vlan_firewall.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_multi_vlan_firewall.go index 76cdcbc7d1..b51e16443b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_multi_vlan_firewall.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_multi_vlan_firewall.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" @@ -19,7 +21,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMMultiVlanFirewall() *schema.Resource { +func ResourceIBMMultiVlanFirewall() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkMultiVlanCreate, Read: resourceIBMMultiVlanFirewallRead, @@ -69,7 +71,7 @@ func resourceIBMMultiVlanFirewall() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateAllowedStringValue([]string{"FortiGate Firewall Appliance HA Option", "FortiGate Security Appliance"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"FortiGate Firewall Appliance HA Option", "FortiGate Security Appliance"}), Description: "Firewall type", }, @@ -123,7 +125,7 @@ const ( ) func resourceIBMNetworkMultiVlanCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() name := d.Get("name").(string) FirewallType := d.Get("firewall_type").(string) datacenter := d.Get("datacenter").(string) @@ -135,7 +137,7 @@ func resourceIBMNetworkMultiVlanCreate(d *schema.ResourceData, meta interface{}) // 1.Getting the router ID routerids, err := PodService.Filter(filter.Path("datacenterName").Eq(datacenter).Build()).Mask(podMask).GetAllObjects() if err != nil { - return fmt.Errorf("Encountered problem trying to get the router ID: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get the router ID: %s", err) } var routerid int for _, iterate := range routerids { @@ -147,7 +149,7 @@ func resourceIBMNetworkMultiVlanCreate(d *schema.ResourceData, meta interface{}) //2.Get the datacenter id dc, err := location.GetDatacenterByName(sess, datacenter, "id") if err != nil { - return fmt.Errorf("Encountered problem trying to get the Datacenter ID: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get the Datacenter ID: %s", err) } locationservice := services.GetLocationService(sess) @@ -181,7 +183,7 @@ func resourceIBMNetworkMultiVlanCreate(d *schema.ResourceData, meta interface{}) for _, addon := range actualaddons { actualpriceid, err := product.GetPriceIDByPackageIdandLocationGroups(sess, listofpriceids, 863, addon) if err != nil || actualpriceid == 0 { - return fmt.Errorf("Encountered problem trying to get priceIds of items which have to be ordered: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get priceIds of items which have to be ordered: %s", err) } priceItem := datatypes.Product_Item_Price{ Id: &actualpriceid, @@ -213,17 +215,17 @@ func resourceIBMNetworkMultiVlanCreate(d *schema.ResourceData, meta interface{}) _, err = services.GetProductOrderService(sess.SetRetries(0)). VerifyOrder(&productOrderContainer) if err != nil { - return fmt.Errorf("Error during Verify order for Creating: %s", err) + return fmt.Errorf("[ERROR] Error during Verify order for Creating: %s", err) } //9.Calling place order receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(&productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during Place order for Creating: %s", err) + return fmt.Errorf("[ERROR] Error during Place order for Creating: %s", err) } _, vlan, _, err := findDedicatedFirewallByOrderId(sess, *receipt.OrderId, d) if err != nil { - return fmt.Errorf("Error during creation of dedicated hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated hardware firewall: %s", err) } id := *vlan.NetworkFirewall.Id d.SetId(fmt.Sprintf("%d", id)) @@ -232,7 +234,7 @@ func resourceIBMNetworkMultiVlanCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMMultiVlanFirewallRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwID, _ := strconv.Atoi(d.Id()) @@ -243,7 +245,7 @@ func resourceIBMMultiVlanFirewallRead(d *schema.ResourceData, meta interface{}) Mask(multiVlanMask). GetNetworkGateways() if err != nil { - return fmt.Errorf("Error retrieving firewall information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving firewall information: %s", err) } d.Set("datacenter", *firewalls[0].NetworkFirewall.Datacenter.Name) if *firewalls[0].NetworkFirewall.CustomerManagedFlag && *firewalls[0].MemberCount == 1 { @@ -276,7 +278,7 @@ func resourceIBMMultiVlanFirewallRead(d *schema.ResourceData, meta interface{}) func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("addon_configuration") { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwID, _ := strconv.Atoi(d.Id()) old, new := d.GetChange("addon_configuration") oldaddons := old.([]interface{}) @@ -300,7 +302,7 @@ func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{} Mask(multiVlanMask). GetNetworkGateways() if err != nil { - return fmt.Errorf("Some error occured while fetching the information of the Multi-Vlan Firewall") + return fmt.Errorf("[ERROR] Expected error occured while fetching the information of the Multi-Vlan Firewall") } for _, i := range remove { for _, j := range firewalls[0].NetworkFirewall.BillingItem.ActiveChildren { @@ -311,7 +313,7 @@ func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{} customerNote := "No longer needed" billingitemservice, err := services.GetBillingItemService(sess).Id(*j.Id).CancelItem(&cancelimmediately, &cancelAssociatedBillingItems, &reason, &customerNote) if err != nil || !billingitemservice { - return fmt.Errorf("Error while cancelling the addon") + return fmt.Errorf("[ERROR] Error while cancelling the addon") } } } @@ -320,12 +322,12 @@ func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{} if len(add) > 0 { datacentername, ok := d.GetOk("datacenter") if !ok { - return fmt.Errorf("The attribute datacenter is not defined") + return fmt.Errorf("[ERROR] The attribute datacenter is not defined") } //2.Get the datacenter id dc, err := location.GetDatacenterByName(sess, datacentername.(string), "id") if err != nil { - return fmt.Errorf("Datacenter not found") + return fmt.Errorf("[ERROR] Something not found") } locationservice := services.GetLocationService(sess) //3. get the pricegroups that the datacenter belongs to @@ -339,7 +341,7 @@ func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{} for _, addon := range add { actualpriceid, err := product.GetPriceIDByPackageIdandLocationGroups(sess, listofpriceids, 863, addon) if err != nil || actualpriceid == 0 { - return fmt.Errorf("The addon or the firewall is not available for the datacenter you have selected. Please enter a different datacenter") + return fmt.Errorf("[ERROR] The addon or the firewall is not available for the datacenter you have selected. Please enter a different datacenter") } priceItem := datatypes.Product_Item_Price{ Id: &actualpriceid, @@ -372,18 +374,18 @@ func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{} _, err = services.GetProductOrderService(sess.SetRetries(0)). VerifyOrder(&upgradeproductOrderContainer) if err != nil { - return fmt.Errorf("Error during Verify order for Updating: %s", err) + return fmt.Errorf("[ERROR] Error during Verify order for Updating: %s", err) } //9.Calling place order receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(&upgradeproductOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during Place order for Updating: %s", err) + return fmt.Errorf("[ERROR] Error during Place order for Updating: %s", err) } _, _, _, err = findDedicatedFirewallByOrderId(sess, *receipt.OrderId, d) if err != nil { - return fmt.Errorf("Error during creation of dedicated hardware firewall: %s", err) + return fmt.Errorf("[ERROR] Error during creation of dedicated hardware firewall: %s", err) } } } @@ -391,7 +393,7 @@ func resourceIBMMultiVlanFirewallUpdate(d *schema.ResourceData, meta interface{} } func resourceIBMMultiVLanFirewallExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() fwID, _ := strconv.Atoi(d.Id()) @@ -402,7 +404,7 @@ func resourceIBMMultiVLanFirewallExists(d *schema.ResourceData, meta interface{} Mask(multiVlanMask). GetNetworkGateways() if err != nil { - return false, fmt.Errorf("Error retrieving firewall information: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving firewall information: %s", err) } if firewalls[0].NetworkFirewall.BillingItem == nil { return false, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_gateway.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_gateway.go index 7c7d1e8f05..ab7cc6e250 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "bytes" @@ -13,7 +13,8 @@ import ( "strings" "time" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -28,7 +29,7 @@ import ( const highAvailability = "HA" const GATEWAY_APPLIANCE_CLUSTER = "NETWORK_GATEWAY_APPLIANCE_CLUSTER" -func resourceIBMNetworkGateway() *schema.Resource { +func ResourceIBMNetworkGateway() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkGatewayCreate, Read: resourceIBMNetworkGatewayRead, @@ -50,7 +51,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeInt}, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "post_install_script_uri": { @@ -58,7 +59,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Default: nil, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "private_ip_address_id": { @@ -159,7 +160,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "package_key_name": { @@ -167,7 +168,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Default: "NETWORK_GATEWAY_APPLIANCE", ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "redundant_power_supply": { @@ -175,7 +176,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "process_key_name": { @@ -183,7 +184,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, ForceNew: true, Default: "INTEL_SINGLE_XEON_1270_3_50", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "os_key_name": { @@ -191,7 +192,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, ForceNew: true, Default: "OS_VYATTA_5600_5_X_UP_TO_1GBPS_SUBSCRIPTION_EDITION_64_BIT", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "redundant_network": { @@ -199,14 +200,14 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "unbonded_network": { Type: schema.TypeBool, Optional: true, Default: false, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "tags": { Type: schema.TypeSet, @@ -220,14 +221,14 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, ForceNew: true, Default: 20000, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "memory": { Type: schema.TypeInt, Required: true, //Sometime memory returns back as different. Since this resource is immutable at this point //and memory can't be really updated , suppress the change until we figure out how to handle it - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, ForceNew: true, }, "storage_groups": { @@ -255,7 +256,7 @@ func resourceIBMNetworkGateway() *schema.Resource { }, }, }, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "ssh_key_ids": { @@ -263,7 +264,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeInt}, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "post_install_script_uri": { @@ -271,7 +272,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, Default: nil, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "user_metadata": { @@ -285,7 +286,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "public_vlan_id": { @@ -293,7 +294,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, ForceNew: true, Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "private_vlan_id": { @@ -301,7 +302,7 @@ func resourceIBMNetworkGateway() *schema.Resource { Optional: true, ForceNew: true, Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "public_ipv4_address": { @@ -364,7 +365,7 @@ func resourceIBMNetworkGateway() *schema.Resource { } func resourceIBMNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() members := []gatewayMember{} for _, v := range d.Get("members").(*schema.Set).List() { m := v.(map[string]interface{}) @@ -373,7 +374,7 @@ func resourceIBMNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) e if len(members) == 2 { if !areVlanCompatible(members) { - return fmt.Errorf("Members should have exactly same public and private vlan configuration," + + return fmt.Errorf("[ERROR] Members should have exactly same public and private vlan configuration," + "please check public_vlan_id and private_vlan_id property on individual members") } } @@ -381,13 +382,11 @@ func resourceIBMNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) e //Build order for one member order, err := getMonthlyGatewayOrder(members[0], meta) if err != nil { - return fmt.Errorf( - "Encountered problem trying to get the Gateway order template: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get the Gateway order template: %s", err) } err = setHardwareOptions(members[0], &order.Hardware[0]) if err != nil { - return fmt.Errorf( - "Encountered problem trying to configure Gateway options: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to configure Gateway options: %s", err) } // two members can be ordered together if they have same hardware configuration @@ -422,8 +421,7 @@ func resourceIBMNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) e }) err = setHardwareOptions(members[1], &order.Hardware[1]) if err != nil { - return fmt.Errorf( - "Encountered problem trying to configure Gateway options: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to configure Gateway options: %s", err) } } @@ -500,20 +498,17 @@ func resourceIBMNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) e _, err = services.GetProductOrderService(sess).VerifyOrder(&productOrder) if err != nil { - return fmt.Errorf( - "Encountered problem trying to verify the order: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to verify the order: %s", err) } orderReceipt, err := services.GetProductOrderService(sess.SetRetries(0)).PlaceOrder(&productOrder, sl.Bool(false)) if err != nil { - return fmt.Errorf( - "Encountered problem trying to place the order: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to place the order: %s", err) } gID := *orderReceipt.OrderDetails.OrderContainers[0].Hardware[0].GlobalIdentifier bm, err := waitForNetworkGatewayMemberProvision(&order.Hardware[0], meta, gID) if err != nil { - return fmt.Errorf( - "Error waiting for Gateway (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for Gateway (%s) to become ready: %s", d.Id(), err) } id := *bm.(datatypes.Hardware).NetworkGatewayMember.NetworkGatewayId @@ -534,8 +529,7 @@ func resourceIBMNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) e gID1 := *orderReceipt.OrderDetails.OrderContainers[0].Hardware[1].GlobalIdentifier bm, err := waitForNetworkGatewayMemberProvision(&order.Hardware[1], meta, gID1) if err != nil { - return fmt.Errorf( - "Error waiting for Gateway (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for Gateway (%s) to become ready: %s", d.Id(), err) } member2Id := *bm.(datatypes.Hardware).Id log.Printf("[INFO] Member 2 ID: %d", member2Id) @@ -580,14 +574,14 @@ func resourceIBMMemberHostHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["hostname"].(string))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } func resourceIBMNetworkGatewayRead(d *schema.ResourceData, meta interface{}) error { - service := services.GetNetworkGatewayService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkGatewayService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).Mask( "insideVlans,members,status,privateIpAddress[ipAddress],publicIpAddress[ipAddress]," + @@ -598,7 +592,7 @@ func resourceIBMNetworkGatewayRead(d *schema.ResourceData, meta interface{}) err "powerSupplyCount,primaryNetworkComponent[networkVlan],memoryCapacity,networkVlans[id,vlanNumber]]]", ).GetObject() if err != nil { - return fmt.Errorf("Error retrieving Network Gateway: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Network Gateway: %s", err) } d.Set("name", result.Name) if result.PrivateIpAddress != nil { @@ -613,8 +607,8 @@ func resourceIBMNetworkGatewayRead(d *schema.ResourceData, meta interface{}) err d.Set("public_ipv6_address_id", result.PublicIpv6AddressId) d.Set("public_vlan_id", result.PublicVlanId) d.Set("status", result.Status.Name) - d.Set("members", flattenGatewayMembers(d, result.Members)) - d.Set("associated_vlans", flattenGatewayVlans(result.InsideVlans)) + d.Set("members", flex.FlattenGatewayMembers(d, result.Members)) + d.Set("associated_vlans", flex.FlattenGatewayVlans(result.InsideVlans)) //Set default connection info connInfo := map[string]string{"type": "ssh", "user": "vyatta"} @@ -629,28 +623,26 @@ func resourceIBMNetworkGatewayRead(d *schema.ResourceData, meta interface{}) err } func updateGatewayName(id int, name string, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkGatewayService(sess) _, err := service.Id(id).EditObject(&datatypes.Network_Gateway{ Name: sl.String(name), }) if err != nil { - return fmt.Errorf("Couldn't set the gateway name to %s", name) + return fmt.Errorf("[ERROR] Could n't set the gateway name to %s", name) } return err } func addGatewayMember(gwID int, member gatewayMember, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() order, err := getMonthlyGatewayOrder(member, meta) if err != nil { - return fmt.Errorf( - "Encountered problem trying to get the Gateway order template: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to get the Gateway order template: %s", err) } err = setHardwareOptions(member, &order.Hardware[0]) if err != nil { - return fmt.Errorf( - "Encountered problem trying to configure Gateway options: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to configure Gateway options: %s", err) } haOrder := datatypes.Container_Product_Order_Hardware_Server_Gateway_Appliance{} @@ -675,21 +667,18 @@ func addGatewayMember(gwID int, member gatewayMember, meta interface{}) error { _, err = services.GetProductOrderService(sess).VerifyOrder(&haOrder) if err != nil { - return fmt.Errorf( - "Encountered problem trying to verify the order: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to verify the order: %s", err) } orderReceipt, err := services.GetProductOrderService(sess.SetRetries(0)).PlaceOrder(&haOrder, sl.Bool(false)) if err != nil { - return fmt.Errorf( - "Encountered problem trying to place the order: %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to place the order: %s", err) } gID := *orderReceipt.OrderDetails.Hardware[0].GlobalIdentifier bm, err := waitForNetworkGatewayMemberProvision(&order.Hardware[0], meta, gID) if err != nil { - return fmt.Errorf( - "Error waiting for Gateway (%d) to become ready: %s", gwID, err) + return fmt.Errorf("[ERROR] Error waiting for Gateway (%d) to become ready: %s", gwID, err) } id := *bm.(datatypes.Hardware).Id log.Printf("[INFO] Newly added member ID: %d", id) @@ -711,10 +700,10 @@ func resourceIBMNetworkGatewayUpdate(d *schema.ResourceData, meta interface{}) e } func resourceIBMNetworkGatewayDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } service := services.GetNetworkGatewayService(sess) gw, err := service.Id(id).Mask("members[hardwareId]").GetObject() @@ -733,17 +722,17 @@ func resourceIBMNetworkGatewayDelete(d *schema.ResourceData, meta interface{}) e } func resourceIBMNetworkGatewayExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetNetworkGatewayService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkGatewayService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).GetObject() if err != nil { if apiErr, ok := err.(sl.Error); !ok || apiErr.StatusCode != 404 { - return false, fmt.Errorf("Error trying to retrieve Network Gateway: %s", err) + return false, fmt.Errorf("[ERROR] Error trying to retrieve Network Gateway: %s", err) } } @@ -751,7 +740,7 @@ func resourceIBMNetworkGatewayExists(d *schema.ResourceData, meta interface{}) ( } func getMonthlyGatewayOrder(d dataRetriever, meta interface{}) (datatypes.Container_Product_Order, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Validate attributes for network gateway ordering. model := d.Get("package_key_name") @@ -890,7 +879,7 @@ func getMonthlyGatewayOrder(d dataRetriever, meta interface{}) (datatypes.Contai privateNetworkOnly := d.Get("private_network_only").(bool) if d.Get("ipv6_enabled").(bool) { if privateNetworkOnly { - return datatypes.Container_Product_Order{}, fmt.Errorf("Unable to configure a public IPv6 address with a private_network_only option") + return datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] Unable to configure a public IPv6 address with a private_network_only option") } keyName := "1_IPV6_ADDRESS" price, err := getItemPriceId(items, "pri_ipv6_addresses", keyName) @@ -967,7 +956,7 @@ func getPackageByModelGateway(sess *session.Session, model string, isGateway boo return pkg, nil } } - return datatypes.Product_Package{}, fmt.Errorf("No Gateway package key name for %s. Available package key name(s) is(are) %s", model, availableModels) + return datatypes.Product_Package{}, fmt.Errorf("[ERROR] No Gateway package key name for %s. Available package key name(s) is(are) %s", model, availableModels) } func setHardwareOptions(m gatewayMember, hardware *datatypes.Hardware) error { public_vlan_id := m.Get("public_vlan_id").(int) @@ -1021,7 +1010,7 @@ func waitForNetworkGatewayMemberProvision(d *datatypes.Hardware, meta interface{ Pending: []string{"retry", "pending"}, Target: []string{"provisioned"}, Refresh: func() (interface{}, string, error) { - service := services.GetAccountService(meta.(ClientSession).SoftLayerSession()) + service := services.GetAccountService(meta.(conns.ClientSession).SoftLayerSession()) bms, err := service.Filter( filter.Build( filter.Path("hardware.globalIdentifier").Eq(globalIdentifier)), diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_gateway_vlan_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_gateway_vlan_attachment.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_gateway_vlan_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_gateway_vlan_attachment.go index cd337ae020..1f6b39df77 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_gateway_vlan_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_gateway_vlan_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,6 +9,7 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -16,7 +17,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMNetworkGatewayVlanAttachment() *schema.Resource { +func ResourceIBMNetworkGatewayVlanAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkGatewayVlanAttachmentCreate, Read: resourceIBMNetworkGatewayVlanAttachmentRead, @@ -53,7 +54,7 @@ func resourceIBMNetworkGatewayVlanAttachmentCreate(d *schema.ResourceData, meta networkVlanID := d.Get("network_vlan_id").(int) bypass := d.Get("bypass").(bool) - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkGatewayService(sess) vlanService := services.GetNetworkGatewayVlanService(sess) result, err := service.Id(gatewayID).Mask( @@ -82,7 +83,7 @@ func resourceIBMNetworkGatewayVlanAttachmentCreate(d *schema.ResourceData, meta } vlan, err := vlanService.Id(*i.Id).GetObject() if err != nil { - return fmt.Errorf("Error trying to retrieve Network Gateway Vlan: %s", err) + return fmt.Errorf("[ERROR] Error trying to retrieve Network Gateway Vlan: %s", err) } d.SetId(fmt.Sprintf("%d", *vlan.Id)) d.Set("bypass", vlan.BypassFlag) @@ -112,15 +113,15 @@ func resourceIBMNetworkGatewayVlanAttachmentCreate(d *schema.ResourceData, meta } func resourceIBMNetworkGatewayVlanAttachmentRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } vlan, err := services.GetNetworkGatewayVlanService(sess).Id(id).GetObject() if err != nil { - return fmt.Errorf("Error trying to retrieve Network Gateway Vlan: %s", err) + return fmt.Errorf("[ERROR] Error trying to retrieve Network Gateway Vlan: %s", err) } d.Set("gateway_id", vlan.NetworkGatewayId) d.Set("network_vlan_id", vlan.NetworkVlanId) @@ -129,11 +130,11 @@ func resourceIBMNetworkGatewayVlanAttachmentRead(d *schema.ResourceData, meta in } func resourceIBMNetworkGatewayVlanAttachmentUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkGatewayVlanService(sess) id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } if d.HasChange("bypass") { bypass := d.Get("bypass").(bool) @@ -160,15 +161,15 @@ func resourceIBMNetworkGatewayVlanAttachmentUpdate(d *schema.ResourceData, meta } func resourceIBMNetworkGatewayVlanAttachmentExists(d *schema.ResourceData, meta interface{}) (bool, error) { - service := services.GetNetworkGatewayVlanService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkGatewayVlanService(meta.(conns.ClientSession).SoftLayerSession()) id, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(id).GetObject() if err != nil { if apiErr, ok := err.(sl.Error); !ok || apiErr.StatusCode != 404 { - return false, fmt.Errorf("Error trying to retrieve Network Gateway Vlan: %s", err) + return false, fmt.Errorf("[ERROR] Error trying to retrieve Network Gateway Vlan: %s", err) } } return result.Id != nil && *result.Id == id, nil @@ -178,9 +179,9 @@ func resourceIBMNetworkGatewayVlanAttachmentDelete(d *schema.ResourceData, meta id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } - vlan, err := services.GetNetworkGatewayVlanService(meta.(ClientSession).SoftLayerSession()).Id(id).GetObject() + vlan, err := services.GetNetworkGatewayVlanService(meta.(conns.ClientSession).SoftLayerSession()).Id(id).GetObject() err = resourceIBMNetworkGatewayVlanDissociate(d, meta) if err != nil { @@ -197,33 +198,31 @@ func resourceIBMNetworkGatewayVlanAttachmentDelete(d *schema.ResourceData, meta } func resourceIBMNetworkGatewayVlanAssociate(d *schema.ResourceData, meta interface{}, vlan datatypes.Network_Gateway_Vlan) (resp datatypes.Network_Gateway_Vlan, err error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() resp, err = services.GetNetworkGatewayVlanService(sess).CreateObject(&vlan) if err != nil { - return resp, fmt.Errorf( - "Encountered problem trying to associate the VLAN : %s", err) + return resp, fmt.Errorf("[ERROR] Encountered problem trying to associate the VLAN : %s", err) } return resp, nil } func resourceIBMNetworkGatewayVlanDissociate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } err = services.GetNetworkGatewayVlanService(sess).Id(id).DeleteObject() if err != nil { - return fmt.Errorf( - "Encountered problem trying to dissociate the VLAN : %s", err) + return fmt.Errorf("[ERROR] Encountered problem trying to dissociate the VLAN : %s", err) } return nil } func waitForNetworkGatewayActiveState(id int, meta interface{}) (interface{}, error) { log.Printf("Waiting for Gateway (%d) to be active", id) - service := services.GetNetworkGatewayService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkGatewayService(meta.(conns.ClientSession).SoftLayerSession()) stateConf := &resource.StateChangeConf{ Pending: []string{"updating"}, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_interface_sg_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_interface_sg_attachment.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_interface_sg_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_interface_sg_attachment.go index c8dc1c1deb..6cdde8ce14 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_interface_sg_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_interface_sg_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/services" @@ -17,7 +18,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMNetworkInterfaceSGAttachment() *schema.Resource { +func ResourceIBMNetworkInterfaceSGAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkInterfaceSGAttachmentCreate, Read: resourceIBMNetworkInterfaceSGAttachmentRead, @@ -52,10 +53,10 @@ func resourceIBMNetworkInterfaceSGAttachment() *schema.Resource { func resourceIBMNetworkInterfaceSGAttachmentCreate(d *schema.ResourceData, meta interface{}) error { mk := "network_interface_sg_attachment_" + strconv.Itoa(d.Get("network_interface_id").(int)) - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) ncs := services.GetVirtualGuestNetworkComponentService(sess) @@ -84,7 +85,7 @@ func resourceIBMNetworkInterfaceSGAttachmentCreate(d *schema.ResourceData, meta } guest, err := ncs.Id(interfaceID).GetGuest() if err != nil { - return fmt.Errorf("Couldn't retrieve the virtual guest on interface %d", interfaceID) + return fmt.Errorf("[ERROR] Could n't retrieve the virtual guest on interface %d", interfaceID) } guestService := services.GetVirtualGuestService(sess) ok, err := guestService.Id(*guest.Id).RebootSoft() @@ -92,7 +93,7 @@ func resourceIBMNetworkInterfaceSGAttachmentCreate(d *schema.ResourceData, meta return err } if !ok { - return fmt.Errorf("Couldn't reboot the VSI %d", *guest.Id) + return fmt.Errorf("[ERROR] Could n't reboot the VSI %d", *guest.Id) } //Wait for security group to be ready again after reboot stateConf := &resource.StateChangeConf{ @@ -111,7 +112,7 @@ func resourceIBMNetworkInterfaceSGAttachmentCreate(d *schema.ResourceData, meta } func resourceIBMNetworkInterfaceSGAttachmentRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID, interfaceID, err := decomposeNetworkSGAttachmentID(d.Id()) if err != nil { @@ -126,14 +127,14 @@ func resourceIBMNetworkInterfaceSGAttachmentRead(d *schema.ResourceData, meta in return nil } } - return fmt.Errorf("No association found between security group %d and network interface %d", sgID, interfaceID) + return fmt.Errorf("[ERROR] No association found between security group %d and network interface %d", sgID, interfaceID) } func resourceIBMNetworkInterfaceSGAttachmentDelete(d *schema.ResourceData, meta interface{}) error { mk := "network_interface_sg_attachment_" + strconv.Itoa(d.Get("network_interface_id").(int)) - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) - sess := meta.(ClientSession).SoftLayerSession() + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID, interfaceID, err := decomposeNetworkSGAttachmentID(d.Id()) if err != nil { @@ -141,14 +142,14 @@ func resourceIBMNetworkInterfaceSGAttachmentDelete(d *schema.ResourceData, meta } _, err = service.Id(sgID).DetachNetworkComponents([]int{interfaceID}) if err != nil { - return fmt.Errorf("Error detaching network components from Security Group: %s", err) + return fmt.Errorf("[ERROR] Error detaching network components from Security Group: %s", err) } d.SetId("") return nil } func resourceIBMNetworkInterfaceSGAttachmentExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID, interfaceID, err := decomposeNetworkSGAttachmentID(d.Id()) @@ -170,22 +171,22 @@ func resourceIBMNetworkInterfaceSGAttachmentExists(d *schema.ResourceData, meta return true, nil } } - return false, fmt.Errorf("No association found between security group %d and network interface %d", sgID, interfaceID) + return false, fmt.Errorf("[ERROR] No association found between security group %d and network interface %d", sgID, interfaceID) } func decomposeNetworkSGAttachmentID(attachmentID string) (sgID, interfaceID int, err error) { ids := strings.Split(attachmentID, "_") if len(ids) != 2 { - return -1, -1, fmt.Errorf("The ibm_network_interface_sg_attachment id must be of the form _ but it is %s", attachmentID) + return -1, -1, fmt.Errorf("[ERROR] The ibm_network_interface_sg_attachment id must be of the form _ but it is %s", attachmentID) } sgID, err = strconv.Atoi(ids[0]) if err != nil { - return -1, -1, fmt.Errorf("Not a valid security group ID, must be an integer: %s", err) + return -1, -1, fmt.Errorf("[ERROR] Not a valid security group ID, must be an integer: %s", err) } interfaceID, err = strconv.Atoi(ids[1]) if err != nil { - return -1, -1, fmt.Errorf("Not a valid network interface ID, must be an integer: %s", err) + return -1, -1, fmt.Errorf("[ERROR] Not a valid network interface ID, must be an integer: %s", err) } return } @@ -206,7 +207,7 @@ func securityGroupReadyRefreshStateFunc(sess *slsession.Session, ifcID int) reso func WaitForVSAvailable(d *schema.ResourceData, meta interface{}, timeout time.Duration) (interface{}, error) { interfaceID := d.Get("network_interface_id").(int) log.Printf("Waiting for server (%d) to be available.", interfaceID) - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() stateConf := &resource.StateChangeConf{ Pending: []string{"retry", virtualGuestProvisioning}, Target: []string{virtualGuestAvailable}, @@ -225,7 +226,7 @@ func vsReadyRefreshStateFunc(sess *slsession.Session, ifcID int) resource.StateR guest, err := ncs.Id(ifcID).GetGuest() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Error retrieving virtual guest: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving virtual guest: %s", err) } return false, "retry", nil } @@ -233,7 +234,7 @@ func vsReadyRefreshStateFunc(sess *slsession.Session, ifcID int) resource.StateR ready, err := guestService.Id(*guest.Id).GetStatus() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Error retrieving virtual guest: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving virtual guest: %s", err) } return false, "retry", nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_public_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_public_ip.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_public_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_public_ip.go index 460dbf0309..5ff62ceed4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_public_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_public_ip.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -11,6 +11,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -27,7 +28,7 @@ const ( GlobalIpMask = "id,ipAddress[ipAddress,id,note],destinationIpAddress[ipAddress]" ) -func resourceIBMNetworkPublicIp() *schema.Resource { +func ResourceIBMNetworkPublicIp() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkPublicIpCreate, Read: resourceIBMNetworkPublicIpRead, @@ -40,19 +41,19 @@ func resourceIBMNetworkPublicIp() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "ip_address": &schema.Schema{ + "ip_address": { Type: schema.TypeString, Computed: true, Description: "IP Address", }, - "routes_to": &schema.Schema{ + "routes_to": { Type: schema.TypeString, Required: true, ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { address := v.(string) if net.ParseIP(address) == nil { - errors = append(errors, fmt.Errorf("Invalid IP format: %s", address)) + errors = append(errors, fmt.Errorf("[ERROR] Invalid IP format: %s", address)) } return }, @@ -82,7 +83,7 @@ func resourceIBMNetworkPublicIp() *schema.Resource { func resourceIBMNetworkPublicIpCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Find price items with AdditionalServicesGlobalIpAddresses productOrderContainer, err := buildGlobalIpProductOrderContainer(d, sess, AdditionalServicesGlobalIpAddressesPackageType) @@ -90,7 +91,7 @@ func resourceIBMNetworkPublicIpCreate(d *schema.ResourceData, meta interface{}) // Find price items with AdditionalServices productOrderContainer, err = buildGlobalIpProductOrderContainer(d, sess, AdditionalServicesPackageType) if err != nil { - return fmt.Errorf("Error creating network public ip: %s", err) + return fmt.Errorf("[ERROR] Error creating network public ip: %s", err) } } @@ -99,12 +100,12 @@ func resourceIBMNetworkPublicIpCreate(d *schema.ResourceData, meta interface{}) receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of network public ip: %s", err) + return fmt.Errorf("[ERROR] Error during creation of network public ip: %s", err) } globalIp, err := findGlobalIpByOrderId(sess, *receipt.OrderId, d) if err != nil { - return fmt.Errorf("Error during creation of network public ip: %s", err) + return fmt.Errorf("[ERROR] Error during creation of network public ip: %s", err) } d.SetId(fmt.Sprintf("%d", *globalIp.Id)) @@ -114,17 +115,17 @@ func resourceIBMNetworkPublicIpCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMNetworkPublicIpRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetIpAddressGlobalService(sess) globalIpId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid network public ip ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid network public ip ID, must be an integer: %s", err) } globalIp, err := service.Id(globalIpId).Mask(GlobalIpMask).GetObject() if err != nil { - return fmt.Errorf("Error retrieving network public Ip: %s", err) + return fmt.Errorf("[ERROR] Error retrieving network public Ip: %s", err) } d.Set("ip_address", *globalIp.IpAddress.IpAddress) @@ -138,12 +139,12 @@ func resourceIBMNetworkPublicIpRead(d *schema.ResourceData, meta interface{}) er } func resourceIBMNetworkPublicIpUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetIpAddressGlobalService(sess) globalIpId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid network public ip ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid network public ip ID, must be an integer: %s", err) } routes_to := d.Get("routes_to").(string) @@ -164,17 +165,17 @@ func resourceIBMNetworkPublicIpUpdate(d *schema.ResourceData, meta interface{}) _, err = service.Id(globalIpId).Route(sl.String(routes_to)) if err != nil { - return fmt.Errorf("Error editing network public Ip: %s", err) + return fmt.Errorf("[ERROR] Error editing network public Ip: %s", err) } // Update notes if d.HasChange("notes") { publicIp, err := service.Id(globalIpId).Mask(GlobalIpMask).GetObject() if err != nil { - return fmt.Errorf("Error updating network public Ip: %s", err) + return fmt.Errorf("[ERROR] Error updating network public Ip: %s", err) } err = updatePublicIPNotes(d, sess, publicIp) if err != nil { - return fmt.Errorf("Error editing network public Ip: %s", err) + return fmt.Errorf("[ERROR] Error editing network public Ip: %s", err) } } @@ -199,7 +200,7 @@ func resourceIBMNetworkPublicIpUpdate(d *schema.ResourceData, meta interface{}) pendingResult, err := stateConf.WaitForState() if err != nil { - return fmt.Errorf("Error waiting for network public ip destination ip address to become active: %s", err) + return fmt.Errorf("[ERROR] Error waiting for network public ip destination ip address to become active: %s", err) } if _, ok := pendingResult.(datatypes.Network_Subnet_IpAddress_Global); ok { @@ -210,17 +211,17 @@ func resourceIBMNetworkPublicIpUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMNetworkPublicIpDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetIpAddressGlobalService(sess) globalIpId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid network public ip ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid network public ip ID, must be an integer: %s", err) } billingItem, err := service.Id(globalIpId).GetBillingItem() if err != nil { - return fmt.Errorf("Error deleting network public ip: %s", err) + return fmt.Errorf("[ERROR] Error deleting network public ip: %s", err) } if billingItem.Id == nil { @@ -233,12 +234,12 @@ func resourceIBMNetworkPublicIpDelete(d *schema.ResourceData, meta interface{}) } func resourceIBMNetworkPublicIpExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetIpAddressGlobalService(sess) globalIpId, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(globalIpId).GetObject() @@ -246,7 +247,7 @@ func resourceIBMNetworkPublicIpExists(d *schema.ResourceData, meta interface{}) if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving network public ip: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving network public ip: %s", err) } return result.Id != nil && *result.Id == globalIpId, nil } @@ -270,7 +271,7 @@ func findGlobalIpByOrderId(sess *session.Session, orderId int, d *schema.Resourc } else if len(globalIps) == 0 || len(globalIps) == 1 { return datatypes.Network_Subnet_IpAddress_Global{}, "pending", nil } else { - return nil, "", fmt.Errorf("Expected one network public ip: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one network public ip: %s", err) } }, Timeout: d.Timeout(schema.TimeoutCreate), @@ -290,7 +291,7 @@ func findGlobalIpByOrderId(sess *session.Session, orderId int, d *schema.Resourc } return datatypes.Network_Subnet_IpAddress_Global{}, - fmt.Errorf("Cannot find network public ip with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find network public ip with order id '%d'", orderId) } func buildGlobalIpProductOrderContainer(d *schema.ResourceData, sess *session.Session, packageType string) ( @@ -325,7 +326,7 @@ func buildGlobalIpProductOrderContainer(d *schema.ResourceData, sess *session.Se if len(globalIpItems) == 0 { return &datatypes.Container_Product_Order_Network_Subnet{}, - fmt.Errorf("No product items matching %s could be found", globalIpKeyname) + fmt.Errorf("[ERROR] No product items matching %s could be found", globalIpKeyname) } productOrderContainer := datatypes.Container_Product_Order_Network_Subnet{ @@ -352,7 +353,7 @@ func updatePublicIPNotes(d *schema.ResourceData, sess *session.Session, publicIP Id(id). EditObject(&datatypes.Network_Subnet_IpAddress{Note: sl.String(notes)}) if err != nil { - return fmt.Errorf("Error adding note to network public IP (%d): %s", id, err) + return fmt.Errorf("[ERROR] Error adding note to network public IP (%d): %s", id, err) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_vlan.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_vlan.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_vlan.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_vlan.go index f1a811a46b..8487949e8f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_vlan.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_vlan.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -12,6 +12,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -32,7 +35,7 @@ const ( "billingItem[recurringFee],guestNetworkComponentCount,subnets[networkIdentifier,cidr,subnetType],tagReferences[id,tag[name]]" ) -func resourceIBMNetworkVlan() *schema.Resource { +func ResourceIBMNetworkVlan() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkVlanCreate, Read: resourceIBMNetworkVlanRead, @@ -72,7 +75,7 @@ func resourceIBMNetworkVlan() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateVLANName, + ValidateFunc: validate.ValidateVLANName, Description: "VLAN name", }, @@ -134,12 +137,12 @@ func resourceIBMNetworkVlan() *schema.Resource { Set: schema.HashString, Description: "List of tags", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", @@ -150,14 +153,14 @@ func resourceIBMNetworkVlan() *schema.Resource { func resourceIBMNetworkVlanCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() router := d.Get("router_hostname").(string) name := d.Get("name").(string) vlanType := d.Get("type").(string) if (vlanType == "PRIVATE" && len(router) > 0 && strings.Contains(router, "fcr")) || (vlanType == "PUBLIC" && len(router) > 0 && strings.Contains(router, "bcr")) { - return fmt.Errorf("Error creating vlan: mismatch between vlan_type '%s' and router_hostname '%s'", vlanType, router) + return fmt.Errorf("[ERROR] Error creating vlan: mismatch between vlan_type '%s' and router_hostname '%s'", vlanType, router) } // Find price items with AdditionalServicesNetworkVlan @@ -166,7 +169,7 @@ func resourceIBMNetworkVlanCreate(d *schema.ResourceData, meta interface{}) erro // Find price items with AdditionalServices productOrderContainer, err = buildVlanProductOrderContainer(d, sess, AdditionalServicesPackageType) if err != nil { - return fmt.Errorf("Error creating vlan: %s", err) + return fmt.Errorf("[ERROR] Error creating vlan: %s", err) } } @@ -175,19 +178,19 @@ func resourceIBMNetworkVlanCreate(d *schema.ResourceData, meta interface{}) erro receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of vlan: %s", err) + return fmt.Errorf("[ERROR] Error during creation of vlan: %s", err) } vlan, err := findVlanByOrderId(sess, *receipt.OrderId, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf("Error finding VLAN order %d: %s", *receipt.OrderId, err) + return fmt.Errorf("[ERROR] Error finding VLAN order %d: %s", *receipt.OrderId, err) } if len(name) > 0 { _, err = services.GetNetworkVlanService(sess). Id(*vlan.Id).EditObject(&datatypes.Network_Vlan{Name: sl.String(name)}) if err != nil { - return fmt.Errorf("Error updating vlan: %s", err) + return fmt.Errorf("[ERROR] Error updating vlan: %s", err) } } @@ -207,18 +210,18 @@ func resourceIBMNetworkVlanCreate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMNetworkVlanRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkVlanService(sess) vlanId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid vlan ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid vlan ID, must be an integer: %s", err) } vlan, err := service.Id(vlanId).Mask(VlanMask).GetObject() if err != nil { - return fmt.Errorf("Error retrieving vlan: %s", err) + return fmt.Errorf("[ERROR] Error retrieving vlan: %s", err) } d.Set("vlan_number", *vlan.VlanNumber) @@ -278,19 +281,19 @@ func resourceIBMNetworkVlanRead(d *schema.ResourceData, meta interface{}) error } d.Set("tags", tags) } - d.Set(ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/network/vlans/%s", d.Id())) - d.Set(ResourceName, sl.Get(vlan.Name, "")) + d.Set(flex.ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/network/vlans/%s", d.Id())) + d.Set(flex.ResourceName, sl.Get(vlan.Name, "")) return nil } func resourceIBMNetworkVlanUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkVlanService(sess) vlanId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid vlan ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid vlan ID, must be an integer: %s", err) } opts := datatypes.Network_Vlan{} @@ -315,7 +318,7 @@ func resourceIBMNetworkVlanUpdate(d *schema.ResourceData, meta interface{}) erro _, err = service.Id(vlanId).EditObject(&opts) if err != nil { - return fmt.Errorf("Error updating vlan: %s", err) + return fmt.Errorf("[ERROR] Error updating vlan: %s", err) } } @@ -323,12 +326,12 @@ func resourceIBMNetworkVlanUpdate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMNetworkVlanDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkVlanService(sess) vlanId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid vlan ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid vlan ID, must be an integer: %s", err) } const ( @@ -362,7 +365,7 @@ func resourceIBMNetworkVlanDelete(d *schema.ResourceData, meta interface{}) erro billingItem, err := service.Id(vlanId).GetBillingItem() if err != nil { - return fmt.Errorf("Error deleting vlan: %s", err) + return fmt.Errorf("[ERROR] Error deleting vlan: %s", err) } // VLANs which don't have billing items are managed by SoftLayer. They can't be deleted by @@ -382,12 +385,12 @@ func resourceIBMNetworkVlanDelete(d *schema.ResourceData, meta interface{}) erro } func resourceIBMNetworkVlanExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkVlanService(sess) vlanID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid vlan ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid vlan ID, must be an integer: %s", err) } result, err := service.Id(vlanID).Mask("id").GetObject() @@ -421,7 +424,7 @@ func findVlanByOrderId(sess *session.Session, orderId int, timeout time.Duration } else if len(vlans) == 0 { return []datatypes.Network_Vlan{}, "pending", nil } else { - return nil, "", fmt.Errorf("Expected one vlan: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one vlan: %s", err) } }, Timeout: timeout, @@ -443,7 +446,7 @@ func findVlanByOrderId(sess *session.Session, orderId int, timeout time.Duration } return datatypes.Network_Vlan{}, - fmt.Errorf("Cannot find vlan with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find vlan with order id '%d'", orderId) } func buildVlanProductOrderContainer(d *schema.ResourceData, sess *session.Session, packageType string) ( @@ -489,7 +492,7 @@ func buildVlanProductOrderContainer(d *schema.ResourceData, sess *session.Sessio if len(vlanItems) == 0 { return &datatypes.Container_Product_Order_Network_Vlan{}, - fmt.Errorf("No product items matching %s could be found", vlanKeyname) + fmt.Errorf("[ERROR] No product items matching %s could be found", vlanKeyname) } productOrderContainer := datatypes.Container_Product_Order_Network_Vlan{ @@ -510,7 +513,7 @@ func buildVlanProductOrderContainer(d *schema.ResourceData, sess *session.Sessio productOrderContainer.RouterId = rt.Id if err != nil { return &datatypes.Container_Product_Order_Network_Vlan{}, - fmt.Errorf("Error creating vlan: %s", err) + fmt.Errorf("[ERROR] Error creating vlan: %s", err) } } @@ -518,10 +521,10 @@ func buildVlanProductOrderContainer(d *schema.ResourceData, sess *session.Sessio } func setVlanTags(id int, tags string, meta interface{}) error { - service := services.GetNetworkVlanService(meta.(ClientSession).SoftLayerSession()) + service := services.GetNetworkVlanService(meta.(conns.ClientSession).SoftLayerSession()) _, err := service.Id(id).SetTags(sl.String(tags)) if err != nil { - return fmt.Errorf("Could not set tags on vlan %d", id) + return fmt.Errorf("[ERROR] Could not set tags on vlan %d", id) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_vlan_spanning.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_vlan_spanning.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_vlan_spanning.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_vlan_spanning.go index 0a492293b4..282e4613cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_network_vlan_spanning.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_network_vlan_spanning.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "math/rand" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/services" ) -func resourceIBMNetworkVlanSpan() *schema.Resource { +func ResourceIBMNetworkVlanSpan() *schema.Resource { return &schema.Resource{ Create: resourceIBMNetworkVlanSpanCreate, Read: resourceIBMNetworkVlanSpanRead, @@ -24,7 +26,7 @@ func resourceIBMNetworkVlanSpan() *schema.Resource { "vlan_spanning": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"off", "on"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"off", "on"}), Description: "VLAN Spanning set to On or Off", }, }, @@ -32,13 +34,13 @@ func resourceIBMNetworkVlanSpan() *schema.Resource { } func resourceIBMNetworkVlanSpanRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) vlanSpan, err := service.GetNetworkVlanSpan() if err != nil { - return fmt.Errorf("Error retrieving vlan: %s", err) + return fmt.Errorf("[ERROR] Error retrieving vlan: %s", err) } if *vlanSpan.EnabledFlag == true { @@ -51,7 +53,7 @@ func resourceIBMNetworkVlanSpanRead(d *schema.ResourceData, meta interface{}) er } func resourceIBMNetworkVlanSpanCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) rnd := rand.Intn(8999999) + 1000000 @@ -66,7 +68,7 @@ func resourceIBMNetworkVlanSpanCreate(d *schema.ResourceData, meta interface{}) _, err := service.SetVlanSpan(&enabled) if err != nil { - return fmt.Errorf("Error settinging VLAN Spanning %s", err) + return fmt.Errorf("[ERROR] Error settinging VLAN Spanning %s", err) } d.SetId(strconv.Itoa(rnd)) @@ -74,7 +76,7 @@ func resourceIBMNetworkVlanSpanCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMNetworkVlanSpanUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetAccountService(sess) vlanSpanning := d.Get("vlan_spanning").(string) @@ -87,7 +89,7 @@ func resourceIBMNetworkVlanSpanUpdate(d *schema.ResourceData, meta interface{}) _, err := service.SetVlanSpan(&enabled) if err != nil { - return fmt.Errorf("Error settinging VLAN Spanning %s", err) + return fmt.Errorf("[ERROR] Error settinging VLAN Spanning %s", err) } return resourceIBMNetworkVlanSpanRead(d, meta) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_object_storage_account.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_object_storage_account.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_object_storage_account.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_object_storage_account.go index fcea40e673..6eb48c8cf5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_object_storage_account.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_object_storage_account.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -10,6 +10,7 @@ import ( "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -19,7 +20,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMObjectStorageAccount() *schema.Resource { +func ResourceIBMObjectStorageAccount() *schema.Resource { return &schema.Resource{ Create: resourceIBMObjectStorageAccountCreate, Read: resourceIBMObjectStorageAccountRead, @@ -29,11 +30,11 @@ func resourceIBMObjectStorageAccount() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, }, - "local_note": &schema.Schema{ + "local_note": { Type: schema.TypeString, Optional: true, }, @@ -48,7 +49,7 @@ func resourceIBMObjectStorageAccount() *schema.Resource { } func resourceIBMObjectStorageAccountCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() accountService := services.GetAccountService(sess) // Check if an object storage account exists @@ -113,7 +114,7 @@ func WaitForOrderCompletion( var err error var completed bool - completed, billingOrderItem, err = order.CheckBillingOrderComplete(meta.(ClientSession).SoftLayerSession(), receipt) + completed, billingOrderItem, err = order.CheckBillingOrderComplete(meta.(conns.ClientSession).SoftLayerSession(), receipt) if err != nil { return nil, "", err } @@ -134,7 +135,7 @@ func WaitForOrderCompletion( } func resourceIBMObjectStorageAccountRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() accountService := services.GetAccountService(sess) accountName := d.Id() d.Set("name", accountName) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_securitygroup.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_securitygroup.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_securitygroup.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_securitygroup.go index 83a60934f6..be897942f8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_securitygroup.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_securitygroup.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" @@ -15,7 +16,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMSecurityGroup() *schema.Resource { +func ResourceIBMSecurityGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMSecurityGroupCreate, Read: resourceIBMSecurityGroupRead, @@ -41,7 +42,7 @@ func resourceIBMSecurityGroup() *schema.Resource { } func resourceIBMSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess.SetRetries(0)) name := d.Get("name").(string) @@ -84,7 +85,7 @@ func resourceIBMSecurityGroupCreate(d *schema.ResourceData, meta interface{}) er } res, err := service.CreateObject(sg) if err != nil { - return fmt.Errorf("Error creating Security Group: %s", err) + return fmt.Errorf("[ERROR] Error creating Security Group: %s", err) } d.SetId(strconv.Itoa(*res.Id)) @@ -94,7 +95,7 @@ func resourceIBMSecurityGroupCreate(d *schema.ResourceData, meta interface{}) er } func resourceIBMSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) groupID, _ := strconv.Atoi(d.Id()) @@ -106,7 +107,7 @@ func resourceIBMSecurityGroupRead(d *schema.ResourceData, meta interface{}) erro d.SetId("") return nil } - return fmt.Errorf("Error retrieving Security Group: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Security Group: %s", err) } d.Set("name", group.Name) @@ -115,17 +116,17 @@ func resourceIBMSecurityGroupRead(d *schema.ResourceData, meta interface{}) erro } func resourceIBMSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) groupID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } group, err := services.GetNetworkSecurityGroupService(sess).Id(groupID).GetObject() if err != nil { - return fmt.Errorf("Error retrieving Security Group: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Security Group: %s", err) } if d.HasChange("description") { @@ -137,23 +138,23 @@ func resourceIBMSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) er } _, err = service.Id(groupID).EditObject(&group) if err != nil { - return fmt.Errorf("Error editing Security Group: %s", err) + return fmt.Errorf("[ERROR] Error editing Security Group: %s", err) } return resourceIBMSecurityGroupRead(d, meta) } func resourceIBMSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) groupID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } log.Printf("[INFO] Deleting Security Group: %d", groupID) _, err = service.Id(groupID).DeleteObject() if err != nil { - return fmt.Errorf("Error deleting Security Group: %s", err) + return fmt.Errorf("[ERROR] Error deleting Security Group: %s", err) } d.SetId("") @@ -161,12 +162,12 @@ func resourceIBMSecurityGroupDelete(d *schema.ResourceData, meta interface{}) er } func resourceIBMSecurityGroupExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) groupID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(groupID).GetObject() diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_securitygroup_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_securitygroup_rule.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_securitygroup_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_securitygroup_rule.go index 5f97763a14..616cb59dc9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_securitygroup_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_securitygroup_rule.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/filter" @@ -15,7 +17,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMSecurityGroupRule() *schema.Resource { +func ResourceIBMSecurityGroupRule() *schema.Resource { return &schema.Resource{ Create: resourceIBMSecurityGroupRuleCreate, Read: resourceIBMSecurityGroupRuleRead, @@ -29,14 +31,14 @@ func resourceIBMSecurityGroupRule() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Direction of rule: ingress or egress", - ValidateFunc: validateSecurityRuleDirection, + ValidateFunc: validate.ValidateSecurityRuleDirection, }, "ether_type": { Type: schema.TypeString, Optional: true, Description: "IP version IPv4 or IPv6", Default: "IPv4", - ValidateFunc: validateSecurityRuleEtherType, + ValidateFunc: validate.ValidateSecurityRuleEtherType, }, "port_range_min": { Type: schema.TypeInt, @@ -58,14 +60,14 @@ func resourceIBMSecurityGroupRule() *schema.Resource { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"remote_group_id"}, - ValidateFunc: validateRemoteIP, + ValidateFunc: validate.ValidateRemoteIP, Description: "Remote IP Address", }, "protocol": { Type: schema.TypeString, Optional: true, Description: "icmp, tcp or udp", - ValidateFunc: validateSecurityRuleProtocol, + ValidateFunc: validate.ValidateSecurityRuleProtocol, }, "security_group_id": { Type: schema.TypeInt, @@ -107,7 +109,7 @@ func findMatchingRule(sgID int, rule *datatypes.Network_SecurityGroup_Rule, rules, err := service.Filter(filter.Build(filters...)).Id(sgID).GetRules() if err != nil { - return nil, fmt.Errorf("Error fetching information for Security Group Rule: %s", err) + return nil, fmt.Errorf("[ERROR] Error fetching information for Security Group Rule: %s", err) } log.Printf("[INFO] rules %v", rules) @@ -118,7 +120,7 @@ func findMatchingRule(sgID int, rule *datatypes.Network_SecurityGroup_Rule, } func resourceIBMSecurityGroupRuleCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID := d.Get("security_group_id").(int) @@ -177,7 +179,7 @@ func resourceIBMSecurityGroupRuleCreate(d *schema.ResourceData, meta interface{} log.Println("[INFO] creating security group rule") _, err = service.Id(sgID).AddRules(opts) if err != nil { - return fmt.Errorf("Error creating Security Group Rule: %s", err) + return fmt.Errorf("[ERROR] Error creating Security Group Rule: %s", err) } matchingrule, err = findMatchingRule(sgID, &sgrule, service) @@ -190,7 +192,7 @@ func resourceIBMSecurityGroupRuleCreate(d *schema.ResourceData, meta interface{} } func resourceIBMSecurityGroupRuleRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID := d.Get("security_group_id").(int) @@ -203,7 +205,7 @@ func resourceIBMSecurityGroupRuleRead(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error retrieving Security Group Rule: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Security Group Rule: %s", err) } if len(matchingrules) == 0 { @@ -236,13 +238,13 @@ func resourceIBMSecurityGroupRuleRead(d *schema.ResourceData, meta interface{}) } func resourceIBMSecurityGroupRuleUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) securityGroupID := d.Get("security_group_id").(int) matchingrules, err := service.Filter(filter.Build( filter.Path("rules.id").Eq(d.Id()))).Id(securityGroupID).GetRules() if err != nil { - return fmt.Errorf("Error retrieving Security Group Rule: %s", err) + return fmt.Errorf("[ERROR] Error retrieving Security Group Rule: %s", err) } if d.HasChange("direction") { matchingrules[0].Direction = sl.String(d.Get("direction").(string)) @@ -267,13 +269,13 @@ func resourceIBMSecurityGroupRuleUpdate(d *schema.ResourceData, meta interface{} } _, err = service.Id(securityGroupID).EditRules([]datatypes.Network_SecurityGroup_Rule{matchingrules[0]}) if err != nil { - return fmt.Errorf("Couldn't update Security Group Rule: %s", err) + return fmt.Errorf("[ERROR] Could n't update Security Group Rule: %s", err) } return resourceIBMSecurityGroupRuleRead(d, meta) } func resourceIBMSecurityGroupRuleDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID := d.Get("security_group_id").(int) id, _ := strconv.Atoi(d.Id()) @@ -283,7 +285,7 @@ func resourceIBMSecurityGroupRuleDelete(d *schema.ResourceData, meta interface{} d.SetId("") return nil } - return fmt.Errorf("Error deleting Security Group Rule: %s", err) + return fmt.Errorf("[ERROR] Error deleting Security Group Rule: %s", err) } d.SetId("") @@ -291,7 +293,7 @@ func resourceIBMSecurityGroupRuleDelete(d *schema.ResourceData, meta interface{} } func resourceIBMSecurityGroupRuleExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSecurityGroupService(sess) sgID := d.Get("security_group_id").(int) @@ -304,7 +306,7 @@ func resourceIBMSecurityGroupRuleExists(d *schema.ResourceData, meta interface{} d.SetId("") return false, nil } - return false, fmt.Errorf("Error retrieving Security Group Rule: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving Security Group Rule: %s", err) } if len(matchingrules) == 0 { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ssl_certificate.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_ssl_certificate.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ssl_certificate.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_ssl_certificate.go index 58267425a0..70b006b0fa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ssl_certificate.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_ssl_certificate.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( fmt "fmt" @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -27,7 +28,7 @@ const ( SSLMask = "id" ) -func resourceIBMSSLCertificate() *schema.Resource { +func ResourceIBMSSLCertificate() *schema.Resource { return &schema.Resource{ Create: resourceIBMSSLCertificateCreate, Read: resourceIBMSSLCertificateRead, @@ -43,7 +44,7 @@ func resourceIBMSSLCertificate() *schema.Resource { Description: "Server count", }, - "server_type": &schema.Schema{ + "server_type": { Type: schema.TypeString, Required: true, Description: "server type", @@ -61,7 +62,7 @@ func resourceIBMSSLCertificate() *schema.Resource { Description: "ssl type", }, - "certificate_signing_request": &schema.Schema{ + "certificate_signing_request": { Type: schema.TypeString, Required: true, Description: "certificate signing request info", @@ -74,7 +75,7 @@ func resourceIBMSSLCertificate() *schema.Resource { Description: "Renewal flag", }, - "order_approver_email_address": &schema.Schema{ + "order_approver_email_address": { Type: schema.TypeString, Required: true, Description: "Email address of the approver", @@ -130,51 +131,51 @@ func resourceIBMSSLCertificate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "org_address_line1": &schema.Schema{ + "org_address_line1": { Type: schema.TypeString, Required: true, }, - "org_address_line2": &schema.Schema{ + "org_address_line2": { Type: schema.TypeString, Optional: true, }, - "org_city": &schema.Schema{ + "org_city": { Type: schema.TypeString, Required: true, }, - "org_country_code": &schema.Schema{ + "org_country_code": { Type: schema.TypeString, Required: true, }, - "org_postal_code": &schema.Schema{ + "org_postal_code": { Type: schema.TypeString, Required: true, }, - "org_state": &schema.Schema{ + "org_state": { Type: schema.TypeString, Required: true, }, }, }, }, - "org_organization_name": &schema.Schema{ + "org_organization_name": { Type: schema.TypeString, Required: true, Description: "Organization name", }, - "org_phone_number": &schema.Schema{ + "org_phone_number": { Type: schema.TypeString, Required: true, Description: "Organization phone number", }, - "org_fax_number": &schema.Schema{ + "org_fax_number": { Type: schema.TypeString, Optional: true, }, @@ -195,68 +196,68 @@ func resourceIBMSSLCertificate() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "tech_address_line1": &schema.Schema{ + "tech_address_line1": { Type: schema.TypeString, Optional: true, }, - "tech_address_line2": &schema.Schema{ + "tech_address_line2": { Type: schema.TypeString, Optional: true, }, - "tech_city": &schema.Schema{ + "tech_city": { Type: schema.TypeString, Optional: true, }, - "tech_country_code": &schema.Schema{ + "tech_country_code": { Type: schema.TypeString, Optional: true, }, - "tech_postal_code": &schema.Schema{ + "tech_postal_code": { Type: schema.TypeString, Optional: true, }, - "tech_state": &schema.Schema{ + "tech_state": { Type: schema.TypeString, Optional: true, }, }, }, }, - "tech_organization_name": &schema.Schema{ + "tech_organization_name": { Type: schema.TypeString, Required: true, }, - "tech_first_name": &schema.Schema{ + "tech_first_name": { Type: schema.TypeString, Required: true, }, - "tech_last_name": &schema.Schema{ + "tech_last_name": { Type: schema.TypeString, Required: true, }, - "tech_email_address": &schema.Schema{ + "tech_email_address": { Type: schema.TypeString, Required: true, }, - "tech_phone_number": &schema.Schema{ + "tech_phone_number": { Type: schema.TypeString, Required: true, }, - "tech_fax_number": &schema.Schema{ + "tech_fax_number": { Type: schema.TypeString, Optional: true, }, - "tech_title": &schema.Schema{ + "tech_title": { Type: schema.TypeString, Required: true, }, @@ -275,68 +276,68 @@ func resourceIBMSSLCertificate() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "billing_address_line1": &schema.Schema{ + "billing_address_line1": { Type: schema.TypeString, Optional: true, }, - "billing_address_line2": &schema.Schema{ + "billing_address_line2": { Type: schema.TypeString, Optional: true, }, - "billing_city": &schema.Schema{ + "billing_city": { Type: schema.TypeString, Optional: true, }, - "billing_country_code": &schema.Schema{ + "billing_country_code": { Type: schema.TypeString, Optional: true, }, - "billing_postal_code": &schema.Schema{ + "billing_postal_code": { Type: schema.TypeString, Optional: true, }, - "billing_state": &schema.Schema{ + "billing_state": { Type: schema.TypeString, Optional: true, }, }, }, }, - "billing_organization_name": &schema.Schema{ + "billing_organization_name": { Type: schema.TypeString, Optional: true, }, - "billing_first_name": &schema.Schema{ + "billing_first_name": { Type: schema.TypeString, Optional: true, }, - "billing_last_name": &schema.Schema{ + "billing_last_name": { Type: schema.TypeString, Optional: true, }, - "billing_email_address": &schema.Schema{ + "billing_email_address": { Type: schema.TypeString, Optional: true, }, - "billing_phone_number": &schema.Schema{ + "billing_phone_number": { Type: schema.TypeString, Optional: true, }, - "billing_fax_number": &schema.Schema{ + "billing_fax_number": { Type: schema.TypeString, Optional: true, }, - "billing_title": &schema.Schema{ + "billing_title": { Type: schema.TypeString, Optional: true, }, @@ -356,67 +357,67 @@ func resourceIBMSSLCertificate() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "admin_address_line1": &schema.Schema{ + "admin_address_line1": { Type: schema.TypeString, Optional: true, }, - "admin_address_line2": &schema.Schema{ + "admin_address_line2": { Type: schema.TypeString, Optional: true, }, - "admin_city": &schema.Schema{ + "admin_city": { Type: schema.TypeString, Optional: true, Default: "", }, - "admin_country_code": &schema.Schema{ + "admin_country_code": { Type: schema.TypeString, Optional: true, }, - "admin_postal_code": &schema.Schema{ + "admin_postal_code": { Type: schema.TypeString, Optional: true, }, - "admin_state": &schema.Schema{ + "admin_state": { Type: schema.TypeString, Optional: true, }, }, }, }, - "admin_organization_name": &schema.Schema{ + "admin_organization_name": { Type: schema.TypeString, Optional: true, }, - "admin_first_name": &schema.Schema{ + "admin_first_name": { Type: schema.TypeString, Optional: true, }, - "admin_last_name": &schema.Schema{ + "admin_last_name": { Type: schema.TypeString, Optional: true, }, - "admin_email_address": &schema.Schema{ + "admin_email_address": { Type: schema.TypeString, Optional: true, }, - "admin_phone_number": &schema.Schema{ + "admin_phone_number": { Type: schema.TypeString, Optional: true, }, - "admin_fax_number": &schema.Schema{ + "admin_fax_number": { Type: schema.TypeString, Optional: true, }, - "admin_title": &schema.Schema{ + "admin_title": { Type: schema.TypeString, Optional: true, }, @@ -427,7 +428,7 @@ func resourceIBMSSLCertificate() *schema.Resource { } } func resourceIBMSSLCertificateCreate(d *schema.ResourceData, m interface{}) error { - sess := m.(ClientSession).SoftLayerSession() + sess := m.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateRequestService(sess.SetRetries(0)) sslKeyName := sl.String(d.Get("ssl_type").(string)) pkg, err := product.GetPackageByType(sess, AdditionalServicesSSLCertificatePackageType) @@ -446,7 +447,7 @@ func resourceIBMSSLCertificateCreate(d *schema.ResourceData, m interface{}) erro } validCSR, err := service.ValidateCsr(sl.String(d.Get("certificate_signing_request").(string)), sl.Int(d.Get("validity_months").(int)), itemId, sl.String(d.Get("server_type").(string))) if err != nil { - return fmt.Errorf("Error during validation of CSR: %s", err) + return fmt.Errorf("[ERROR] Error during validation of CSR: %s", err) } if validCSR == true { productOrderContainer, err := buildSSLProductOrderContainer(d, sess, AdditionalServicesSSLCertificatePackageType) @@ -454,7 +455,7 @@ func resourceIBMSSLCertificateCreate(d *schema.ResourceData, m interface{}) erro // Find price items with AdditionalServices productOrderContainer, err = buildSSLProductOrderContainer(d, sess, AdditionalSSLServicesPackageType) if err != nil { - return fmt.Errorf("Error creating SSL certificate: %s", err) + return fmt.Errorf("[ERROR] Error creating SSL certificate: %s", err) } } log.Printf("[INFO] Creating SSL Certificate") @@ -469,7 +470,7 @@ func resourceIBMSSLCertificateCreate(d *schema.ResourceData, m interface{}) erro receipt, err := services.GetProductOrderService(sess).PlaceOrder(productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of ssl: %s", err) + return fmt.Errorf("[ERROR] Error during creation of ssl: %s", err) } ssl, err := findSSLByOrderId(sess, *receipt.OrderId) @@ -477,21 +478,21 @@ func resourceIBMSSLCertificateCreate(d *schema.ResourceData, m interface{}) erro return resourceIBMSSLCertificateRead(d, m) } else { log.Println("Provided CSR is not valid.") - return fmt.Errorf("Error while validating CSR: %s", err) + return fmt.Errorf("[ERROR] Error while validating CSR: %s", err) } } func resourceIBMSSLCertificateRead(d *schema.ResourceData, m interface{}) error { - sess := m.(ClientSession).SoftLayerSession() + sess := m.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateRequestService(sess) sslId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid SSL ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid SSL ID, must be an integer: %s", err) } ssl, err := service.Id(sslId).Mask(SSLMask).GetObject() if err != nil { - return fmt.Errorf("Error retrieving SSL: %s", err) + return fmt.Errorf("[ERROR] Error retrieving SSL: %s", err) } d.Set("certificate_signing_request", ssl.CertificateSigningRequest) return nil @@ -502,24 +503,24 @@ func resourceIBMSSLCertificateUpdate(d *schema.ResourceData, m interface{}) erro } func resourceIBMSSLCertificateDelete(d *schema.ResourceData, m interface{}) error { - sess := m.(ClientSession).SoftLayerSession() + sess := m.(conns.ClientSession).SoftLayerSession() service := services.GetSecurityCertificateService(sess) service1 := services.GetSecurityCertificateRequestService(sess) sslId, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid SSL ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid SSL ID, must be an integer: %s", err) } value, err := service1.Id(sslId).GetObject() if err != nil { - return fmt.Errorf("Not a valid Object ID: %s", err) + return fmt.Errorf("[ERROR] Not a valid Object ID: %s", err) } sslReqId := value.StatusId if *sslReqId == 49 || *sslReqId == 43 { deleteObject, err := service.Id(sslId).DeleteObject() if deleteObject == false { - return fmt.Errorf("Error deleting SSL: %s", err) + return fmt.Errorf("[ERROR] Error deleting SSL: %s", err) } else { d.SetId("") return nil @@ -527,7 +528,7 @@ func resourceIBMSSLCertificateDelete(d *schema.ResourceData, m interface{}) erro } else if *sslReqId == 50 { cancelObject, err := service1.Id(sslId).CancelSslOrder() if cancelObject == false { - return fmt.Errorf("Error deleting SSL: %s", err) + return fmt.Errorf("[ERROR] Error deleting SSL: %s", err) } else { d.SetId("") return nil @@ -787,7 +788,7 @@ func buildSSLProductOrderContainer(d *schema.ResourceData, sess *session1.Sessio if len(sslItems) == 0 { return &datatypes.Container_Product_Order_Security_Certificate{}, - fmt.Errorf("No product items matching %p could be found", sslKeyName) + fmt.Errorf("[ERROR] No product items matching %p could be found", sslKeyName) } sslContainer := datatypes.Container_Product_Order_Security_Certificate{ Container_Product_Order: datatypes.Container_Product_Order{ @@ -850,5 +851,5 @@ func findSSLByOrderId(sess *session1.Session, orderId int) (datatypes.Security_C } return datatypes.Security_Certificate_Request{}, - fmt.Errorf("Cannot find SSl with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find SSl with order id '%d'", orderId) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_block.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_block.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_block.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_block.go index 03085be830..deb69d242b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_block.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_block.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -11,6 +11,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" "github.com/softlayer/softlayer-go/helpers/network" @@ -18,7 +20,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMStorageBlock() *schema.Resource { +func ResourceIBMStorageBlock() *schema.Resource { return &schema.Resource{ Create: resourceIBMStorageBlockCreate, Read: resourceIBMStorageBlockRead, @@ -232,12 +234,12 @@ func resourceIBMStorageBlock() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Description: "List of target Addresses", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", @@ -247,7 +249,7 @@ func resourceIBMStorageBlock() *schema.Resource { } func resourceIBMStorageBlockCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() storageType := d.Get("type").(string) iops := d.Get("iops").(float64) @@ -264,7 +266,7 @@ func resourceIBMStorageBlockCreate(d *schema.ResourceData, meta interface{}) err storageOrderContainer, err := buildStorageProductOrderContainer(sess, storageType, iops, capacity, snapshotCapacity, blockStorage, datacenter, hourlyBilling) if err != nil { - return fmt.Errorf("Error while creating storage:%s", err) + return fmt.Errorf("[ERROR] Error while creating storage:%s", err) } log.Println("[INFO] Creating storage") @@ -294,18 +296,18 @@ func resourceIBMStorageBlockCreate(d *schema.ResourceData, meta interface{}) err VolumeSize: &capacity, }, sl.Bool(false)) default: - return fmt.Errorf("Error during creation of storage: Invalid storageType %s", storageType) + return fmt.Errorf("[ERROR] Error during creation of storage: Invalid storageType %s", storageType) } if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } // Find the storage device blockStorage, err := findStorageByOrderId(sess, *receipt.OrderId, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } d.SetId(fmt.Sprintf("%d", *blockStorage.Id)) @@ -313,15 +315,14 @@ func resourceIBMStorageBlockCreate(d *schema.ResourceData, meta interface{}) err _, err = WaitForStorageAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for storage (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for storage (%s) to become ready: %s", d.Id(), err) } // SoftLayer changes the device ID after completion of provisioning. It is necessary to refresh device ID. blockStorage, err = findStorageByOrderId(sess, *receipt.OrderId, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } d.SetId(fmt.Sprintf("%d", *blockStorage.Id)) @@ -331,7 +332,7 @@ func resourceIBMStorageBlockCreate(d *schema.ResourceData, meta interface{}) err } func resourceIBMStorageBlockRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() storageId, _ := strconv.Atoi(d.Id()) storage, err := services.GetNetworkStorageService(sess). @@ -340,7 +341,7 @@ func resourceIBMStorageBlockRead(d *schema.ResourceData, meta interface{}) error GetObject() if err != nil { - return fmt.Errorf("Error retrieving storage information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } storageType := strings.Fields(*storage.StorageType.Description)[0] @@ -348,7 +349,7 @@ func resourceIBMStorageBlockRead(d *schema.ResourceData, meta interface{}) error // Calculate IOPS iops, err := getIops(storage, storageType) if err != nil { - return fmt.Errorf("Error retrieving storage information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } d.Set("type", storageType) @@ -430,17 +431,17 @@ func resourceIBMStorageBlockRead(d *schema.ResourceData, meta interface{}) error } d.Set("target_address", storage.IscsiTargetIpAddresses) - d.Set(ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/storage/block/%s", d.Id())) - d.Set(ResourceName, *storage.ServiceResourceName) + d.Set(flex.ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/storage/block/%s", d.Id())) + d.Set(flex.ResourceName, *storage.ServiceResourceName) return nil } func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } storage, err := services.GetNetworkStorageService(sess). @@ -449,14 +450,14 @@ func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) err GetObject() if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } // Update allowed_ip_addresses if d.HasChange("allowed_ip_addresses") { err := updateAllowedIpAddresses(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -464,7 +465,7 @@ func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) err if d.HasChange("allowed_subnets") { err := updateAllowedSubnets(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -472,7 +473,7 @@ func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) err if d.HasChange("allowed_virtual_guest_ids") { err := updateAllowedVirtualGuestIds(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -480,7 +481,7 @@ func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) err if d.HasChange("allowed_hardware_ids") { err := updateAllowedHardwareIds(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -488,7 +489,7 @@ func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) err if d.HasChange("notes") { err := updateNotes(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -498,7 +499,7 @@ func resourceIBMStorageBlockUpdate(d *schema.ResourceData, meta interface{}) err modifyOrder, err := prepareModifyOrder(sess, storage, iops, size) if err != nil { - return fmt.Errorf("Error updating storage: %s", err) + return fmt.Errorf("[ERROR] Error updating storage: %s", err) } _, err = services.GetProductOrderService(sess.SetRetries(0)).PlaceOrder( diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_evault.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_evault.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_evault.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_evault.go index 55eec57751..122b659611 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_evault.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_evault.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "fmt" @@ -9,6 +9,7 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -20,7 +21,7 @@ import ( "github.com/softlayer/softlayer-go/sl" ) -func resourceIBMStorageEvault() *schema.Resource { +func ResourceIBMStorageEvault() *schema.Resource { return &schema.Resource{ Create: resourceIBMStorageEvaultCreate, Read: resourceIBMStorageEvaultRead, @@ -93,12 +94,12 @@ const ( ) func resourceIBMStorageEvaultCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Find price items productOrderContainer, err := buildEvaultProductOrderContainer(d, sess) if err != nil { - return fmt.Errorf("Error creating evault: %s", err) + return fmt.Errorf("[ERROR] Error creating evault: %s", err) } log.Println("[INFO] Creating Evault") @@ -106,12 +107,12 @@ func resourceIBMStorageEvaultCreate(d *schema.ResourceData, meta interface{}) er receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of evault: %s", err) + return fmt.Errorf("[ERROR] Error during creation of evault: %s", err) } evaultStorage, err := findEvaultStorageByOrderID(d, meta, *receipt.OrderId) if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } d.SetId(fmt.Sprintf("%d", *evaultStorage.Id)) @@ -120,15 +121,14 @@ func resourceIBMStorageEvaultCreate(d *schema.ResourceData, meta interface{}) er _, err = WaitForEvaultAvailable(d, meta, schema.TimeoutCreate) if err != nil { - return fmt.Errorf( - "Error waiting for evault (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for evault (%s) to become ready: %s", d.Id(), err) } // SoftLayer changes the device ID after completion of provisioning. It is necessary to refresh device ID. evaultStorage, err = findEvaultStorageByOrderID(d, meta, *receipt.OrderId) if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } d.SetId(fmt.Sprintf("%d", *evaultStorage.Id)) @@ -152,7 +152,7 @@ func buildEvaultProductOrderContainer(d *schema.ResourceData, sess *session.Sess } if virtualID == 0 && hardwareID == 0 { - return &datatypes.Container_Product_Order{}, fmt.Errorf("Provide either `virtual_instance_id` or `hardware_instance_id`") + return &datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] Provide either `virtual_instance_id` or `hardware_instance_id`") } /*pkg, err := product.GetPackageByType(sess, "ADDITIONAL_PRODUCTS") @@ -169,7 +169,7 @@ func buildEvaultProductOrderContainer(d *schema.ResourceData, sess *session.Sess dc, err := location.GetDatacenterByName(sess, datacenter) if err != nil { return &datatypes.Container_Product_Order{}, - fmt.Errorf("No data centers matching %s could be found", datacenter) + fmt.Errorf("[ERROR] No data centers matching %s could be found", datacenter) } locationservice := services.GetLocationService(sess) @@ -189,7 +189,7 @@ func buildEvaultProductOrderContainer(d *schema.ResourceData, sess *session.Sess priceItems := []datatypes.Product_Item_Price{} actualpriceid, err := product.GetPriceIDByPackageIdandLocationGroups(sess, listofpriceids, 0, description) if err != nil || actualpriceid == 0 { - return &datatypes.Container_Product_Order{}, fmt.Errorf("The evault with the given capacity is not available for the datacenter you have selected. Please enter a different capacity : %s", err) + return &datatypes.Container_Product_Order{}, fmt.Errorf("[ERROR] The evault with the given capacity is not available for the datacenter you have selected. Please enter a different capacity : %s", err) } priceItem := datatypes.Product_Item_Price{ Id: &actualpriceid, @@ -223,7 +223,7 @@ func buildEvaultProductOrderContainer(d *schema.ResourceData, sess *session.Sess } func resourceIBMStorageEvaultRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() evaultID, _ := strconv.Atoi(d.Id()) @@ -232,7 +232,7 @@ func resourceIBMStorageEvaultRead(d *schema.ResourceData, meta interface{}) erro GetObject() if err != nil { - return fmt.Errorf("Error retrieving evault information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving evault information: %s", err) } d.Set("capacity", evault.CapacityGb) @@ -256,11 +256,11 @@ func resourceIBMStorageEvaultRead(d *schema.ResourceData, meta interface{}) erro func resourceIBMStorageEvaultUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("capacity") && !d.IsNewResource() { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() evaultID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } priceID, err := getEvaultUpgradePriceItem(d, sess) @@ -290,7 +290,7 @@ func resourceIBMStorageEvaultUpdate(d *schema.ResourceData, meta interface{}) er } func resourceIBMStorageEvaultDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() evaultService := services.GetNetworkStorageBackupEvaultService(sess) evaultID, _ := strconv.Atoi(d.Id()) @@ -298,11 +298,11 @@ func resourceIBMStorageEvaultDelete(d *schema.ResourceData, meta interface{}) er billingItem, err := evaultService.Id(evaultID).GetBillingItem() if err != nil { - return fmt.Errorf("Error while looking up billing item associated with the evault: %s", err) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the evault: %s", err) } if billingItem.Id == nil { - return fmt.Errorf("Error while looking up billing item associated with the evault: No billing item for ID:%d", evaultID) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the evault: No billing item for ID:%d", evaultID) } success, err := services.GetBillingItemService(sess).Id(*billingItem.Id).CancelService() @@ -318,7 +318,7 @@ func resourceIBMStorageEvaultDelete(d *schema.ResourceData, meta interface{}) er func findEvaultStorageByOrderID(d *schema.ResourceData, meta interface{}, orderId int) (datatypes.Network_Storage, error) { filterPath := "evaultNetworkStorage.billingItem.orderItem.order.id" - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() stateConf := &resource.StateChangeConf{ Pending: []string{"pending"}, @@ -339,7 +339,7 @@ func findEvaultStorageByOrderID(d *schema.ResourceData, meta interface{}, orderI } else if len(storages) == 0 { return datatypes.Network_Storage{}, "pending", nil } else { - return nil, "", fmt.Errorf("Expected one evault: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one evault: %s", err) } }, @@ -362,7 +362,7 @@ func findEvaultStorageByOrderID(d *schema.ResourceData, meta interface{}, orderI } return datatypes.Network_Storage{}, - fmt.Errorf("Cannot find evault with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find evault with order id '%d'", orderId) } // Waits for storage provisioning @@ -370,9 +370,9 @@ func WaitForEvaultAvailable(d *schema.ResourceData, meta interface{}, timeout st log.Printf("Waiting for evault (%s) to be available.", d.Id()) id, err := strconv.Atoi(d.Id()) if err != nil { - return nil, fmt.Errorf("The evault ID %s must be numeric", d.Id()) + return nil, fmt.Errorf("[ERROR] The evault ID %s must be numeric", d.Id()) } - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() stateConf := &resource.StateChangeConf{ Pending: []string{"retry", "provisioning"}, Target: []string{"available"}, @@ -382,7 +382,7 @@ func WaitForEvaultAvailable(d *schema.ResourceData, meta interface{}, timeout st result, err := service.Id(id).Mask("activeTransactionCount").GetObject() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Error retrieving evault: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving evault: %s", err) } return false, "retry", nil } @@ -403,11 +403,11 @@ func WaitForEvaultAvailable(d *schema.ResourceData, meta interface{}, timeout st } func resourceIBMStorageEvaultExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() evaultID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = services.GetNetworkStorageBackupEvaultService(sess). @@ -418,7 +418,7 @@ func resourceIBMStorageEvaultExists(d *schema.ResourceData, meta interface{}) (b if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving evault information: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving evault information: %s", err) } return true, nil } @@ -431,7 +431,7 @@ func getEvaultUpgradePriceItem(d *schema.ResourceData, sess *session.Session) (i GetObject() if err != nil { - return 0, fmt.Errorf("Error retrieving evault information: %s", err) + return 0, fmt.Errorf("[ERROR] Error retrieving evault information: %s", err) } capacity := d.Get("capacity") @@ -447,6 +447,6 @@ func getEvaultUpgradePriceItem(d *schema.ResourceData, sess *session.Session) (i validCapacities[i] = int(*item.Capacity) } - return 0, fmt.Errorf("The given capacity is not a valid upgrade value. Valid capacity upgrades are: %d", validCapacities) + return 0, fmt.Errorf("[ERROR] The given capacity is not a valid upgrade value. Valid capacity upgrades are: %d", validCapacities) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_file.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_file.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_file.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_file.go index d3dddf6883..31ed4c65a9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_storage_file.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_storage_file.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "bytes" @@ -12,7 +12,9 @@ import ( "strings" "time" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -65,7 +67,7 @@ var ( } ) -func resourceIBMStorageFile() *schema.Resource { +func ResourceIBMStorageFile() *schema.Resource { return &schema.Resource{ Create: resourceIBMStorageFileCreate, Read: resourceIBMStorageFileRead, @@ -86,7 +88,7 @@ func resourceIBMStorageFile() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateStorageType, + ValidateFunc: validate.ValidateStorageType, Description: "Storage type", }, @@ -179,7 +181,7 @@ func resourceIBMStorageFile() *schema.Resource { "schedule_type": { Type: schema.TypeString, Required: true, - ValidateFunc: validateScheduleType, + ValidateFunc: validate.ValidateScheduleType, Description: "schedule type", }, @@ -192,21 +194,21 @@ func resourceIBMStorageFile() *schema.Resource { "minute": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateMinute(0, 59), + ValidateFunc: validate.ValidateMinute(0, 59), Description: "Time duration in minutes", }, "hour": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateHour(0, 23), + ValidateFunc: validate.ValidateHour(0, 23), Description: "Time duration in hour", }, "day_of_week": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateDayOfWeek, + ValidateFunc: validate.ValidateDayOfWeek, Description: "Day of the week", }, @@ -237,17 +239,17 @@ func resourceIBMStorageFile() *schema.Resource { ForceNew: true, Description: "Hourly based billing type", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", @@ -257,7 +259,7 @@ func resourceIBMStorageFile() *schema.Resource { } func resourceIBMStorageFileCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() storageType := d.Get("type").(string) iops := d.Get("iops").(float64) @@ -273,7 +275,7 @@ func resourceIBMStorageFileCreate(d *schema.ResourceData, meta interface{}) erro storageOrderContainer, err = buildStorageProductOrderContainer(sess, storageType, iops, capacity, snapshotCapacity, fileStorage, datacenter, hourlyBilling) if err != nil { - return fmt.Errorf("Error while creating storage:%s", err) + return fmt.Errorf("[ERROR] Error while creating storage:%s", err) } log.Println("[INFO] Creating storage") @@ -296,18 +298,18 @@ func resourceIBMStorageFileCreate(d *schema.ResourceData, meta interface{}) erro }, sl.Bool(false)) default: - return fmt.Errorf("Error during creation of storage: Invalid storageType %s", storageType) + return fmt.Errorf("[ERROR] Error during creation of storage: Invalid storageType %s", storageType) } if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } // Find the storage device fileStorage, err := findStorageByOrderId(sess, *receipt.OrderId, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } d.SetId(fmt.Sprintf("%d", *fileStorage.Id)) @@ -315,15 +317,14 @@ func resourceIBMStorageFileCreate(d *schema.ResourceData, meta interface{}) erro _, err = WaitForStorageAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for storage (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for storage (%s) to become ready: %s", d.Id(), err) } // SoftLayer changes the device ID after completion of provisioning. It is necessary to refresh device ID. fileStorage, err = findStorageByOrderId(sess, *receipt.OrderId, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf("Error during creation of storage: %s", err) + return fmt.Errorf("[ERROR] Error during creation of storage: %s", err) } d.SetId(fmt.Sprintf("%d", *fileStorage.Id)) @@ -333,7 +334,7 @@ func resourceIBMStorageFileCreate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMStorageFileRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() storageId, _ := strconv.Atoi(d.Id()) @@ -343,18 +344,18 @@ func resourceIBMStorageFileRead(d *schema.ResourceData, meta interface{}) error GetObject() if err != nil { - return fmt.Errorf("Error retrieving storage information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } storageType, err := getStorageTypeFromKeyName(*storage.StorageType.KeyName) if err != nil { - return fmt.Errorf("Error retrieving storage information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } // Calculate IOPS iops, err := getIops(storage, storageType) if err != nil { - return fmt.Errorf("Error retrieving storage information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } d.Set("iops", iops) @@ -411,7 +412,7 @@ func resourceIBMStorageFileRead(d *schema.ResourceData, meta interface{}) error mountpoint, err := services.GetNetworkStorageService(sess).Id(storageId).GetFileNetworkMountAddress() if err != nil { - return fmt.Errorf("Error retrieving storage information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } d.Set("mountpoint", mountpoint) @@ -446,20 +447,20 @@ func resourceIBMStorageFileRead(d *schema.ResourceData, meta interface{}) error schds[i] = s } d.Set("snapshot_schedule", schds) - d.Set(ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/storage/file/%s", d.Id())) + d.Set(flex.ResourceControllerURL, fmt.Sprintf("https://cloud.ibm.com/classic/storage/file/%s", d.Id())) - d.Set(ResourceName, *storage.ServiceResourceName) + d.Set(flex.ResourceName, *storage.ServiceResourceName) - d.Set(ResourceStatus, *storage.VolumeStatus) + d.Set(flex.ResourceStatus, *storage.VolumeStatus) return nil } func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() id, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } storage, err := services.GetNetworkStorageService(sess). @@ -468,14 +469,14 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro GetObject() if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } // Update allowed_ip_addresses if d.HasChange("allowed_ip_addresses") { err := updateAllowedIpAddresses(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -483,7 +484,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro if d.HasChange("allowed_subnets") { err := updateAllowedSubnets(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -491,7 +492,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro if d.HasChange("allowed_virtual_guest_ids") { err := updateAllowedVirtualGuestIds(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -499,7 +500,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro if d.HasChange("allowed_hardware_ids") { err := updateAllowedHardwareIds(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -507,7 +508,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro if d.HasChange("notes") { err := updateNotes(d, sess, storage) if err != nil { - return fmt.Errorf("Error updating storage information: %s", err) + return fmt.Errorf("[ERROR] Error updating storage information: %s", err) } } @@ -515,7 +516,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro if d.HasChange("snapshot_schedule") { err := enableStorageSnapshot(d, sess, storage) if err != nil { - return fmt.Errorf("Error creating storage snapshot schedule: %s", err) + return fmt.Errorf("[ERROR] Error creating storage snapshot schedule: %s", err) } } @@ -525,7 +526,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro modifyOrder, err := prepareModifyOrder(sess, storage, iops, size) if err != nil { - return fmt.Errorf("Error updating storage: %s", err) + return fmt.Errorf("[ERROR] Error updating storage: %s", err) } _, err = services.GetProductOrderService(sess.SetRetries(0)).PlaceOrder( @@ -548,7 +549,7 @@ func resourceIBMStorageFileUpdate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMStorageFileDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() storageService := services.GetNetworkStorageService(sess) storageID, _ := strconv.Atoi(d.Id()) @@ -556,11 +557,11 @@ func resourceIBMStorageFileDelete(d *schema.ResourceData, meta interface{}) erro billingItem, err := storageService.Id(storageID).GetBillingItem() if err != nil { - return fmt.Errorf("Error while looking up billing item associated with the storage: %s", err) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the storage: %s", err) } if billingItem.Id == nil { - return fmt.Errorf("Error while looking up billing item associated with the storage: No billing item for ID:%d", storageID) + return fmt.Errorf("[ERROR] Error while looking up billing item associated with the storage: No billing item for ID:%d", storageID) } success, err := services.GetBillingItemService(sess).Id(*billingItem.Id).CancelService() @@ -575,11 +576,11 @@ func resourceIBMStorageFileDelete(d *schema.ResourceData, meta interface{}) erro } func resourceIBMStorageFileExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() storageID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } _, err = services.GetNetworkStorageService(sess). @@ -590,7 +591,7 @@ func resourceIBMStorageFileExists(d *schema.ResourceData, meta interface{}) (boo if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving storage information: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } return true, nil } @@ -684,7 +685,7 @@ func buildStorageProductOrderContainer( dc, err := location.GetDatacenterByName(sess, datacenter) if err != nil { return datatypes.Container_Product_Order{}, - fmt.Errorf("No data centers matching %s could be found", datacenter) + fmt.Errorf("[ERROR] No data centers matching %s could be found", datacenter) } productOrderContainer := datatypes.Container_Product_Order{ @@ -720,7 +721,7 @@ func findStorageByOrderId(sess *session.Session, orderId int, timeout time.Durat } else if len(storage) == 0 { return datatypes.Network_Storage{}, "pending", nil } else { - return nil, "", fmt.Errorf("Expected one Storage: %s", err) + return nil, "", fmt.Errorf("[ERROR] Expected one Storage: %s", err) } }, Timeout: timeout, @@ -742,7 +743,7 @@ func findStorageByOrderId(sess *session.Session, orderId int, timeout time.Durat } return datatypes.Network_Storage{}, - fmt.Errorf("Cannot find Storage with order id '%d'", orderId) + fmt.Errorf("[ERROR] Cannot find Storage with order id '%d'", orderId) } // Waits for storage provisioning @@ -750,9 +751,9 @@ func WaitForStorageAvailable(d *schema.ResourceData, meta interface{}) (interfac log.Printf("Waiting for storage (%s) to be available.", d.Id()) id, err := strconv.Atoi(d.Id()) if err != nil { - return nil, fmt.Errorf("The storage ID %s must be numeric", d.Id()) + return nil, fmt.Errorf("[ERROR] The storage ID %s must be numeric", d.Id()) } - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() stateConf := &resource.StateChangeConf{ Pending: []string{"retry", "provisioning"}, Target: []string{"available"}, @@ -762,7 +763,7 @@ func WaitForStorageAvailable(d *schema.ResourceData, meta interface{}) (interfac result, err := service.Id(id).Mask("activeTransactionCount").GetObject() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Error retrieving storage: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving storage: %s", err) } return false, "retry", nil } @@ -819,7 +820,7 @@ func getIops(storage datatypes.Network_Storage, storageType string) (float64, er } case performanceType: if storage.Iops == nil { - return 0, fmt.Errorf("Failed to retrieve iops information.") + return 0, fmt.Errorf("[ERROR] Failed to retrieve iops information") } iops, err := strconv.Atoi(*storage.Iops) if err != nil { @@ -827,7 +828,7 @@ func getIops(storage datatypes.Network_Storage, storageType string) (float64, er } return float64(iops), nil } - return 0, fmt.Errorf("Invalid storage type %s", storageType) + return 0, fmt.Errorf("[ERROR] Invalid storage type %s", storageType) } func updateAllowedIpAddresses(d *schema.ResourceData, sess *session.Session, storage datatypes.Network_Storage) error { @@ -852,7 +853,7 @@ func updateAllowedIpAddresses(d *schema.ResourceData, sess *session.Session, sto return err } if len(ipObject) != 1 { - return fmt.Errorf("Number of IP address is %d", len(ipObject)) + return fmt.Errorf("[ERROR] Number of IP address is %d", len(ipObject)) } for { _, err = services.GetNetworkStorageService(sess). @@ -935,7 +936,7 @@ func updateAllowedSubnets(d *schema.ResourceData, sess *session.Session, storage return err } if len(subnetObject) != 1 { - return fmt.Errorf("Number of subnet is %d", len(subnetObject)) + return fmt.Errorf("[ERROR] Number of subnet is %d", len(subnetObject)) } _, err = services.GetNetworkStorageService(sess). Id(id). @@ -1139,7 +1140,7 @@ func updateNotes(d *schema.ResourceData, sess *session.Session, storage datatype Id(id). EditObject(&datatypes.Network_Storage{Notes: sl.String(notes)}) if err != nil { - return fmt.Errorf("Error adding note to storage (%d): %s", id, err) + return fmt.Errorf("[ERROR] Error adding note to storage (%d): %s", id, err) } } @@ -1153,7 +1154,7 @@ func getStorageTypeFromKeyName(key string) (string, error) { case "PERFORMANCE_FILE_STORAGE", "PERFORMANCE_BLOCK_STORAGE": return performanceType, nil } - return "", fmt.Errorf("Couldn't find storage type for key %s", key) + return "", fmt.Errorf("[ERROR] Could n't find storage type for key %s", key) } func resourceIBMFilSnapshotHash(v interface{}) int { @@ -1172,7 +1173,7 @@ func resourceIBMFilSnapshotHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%d-", m["retention_count"].(int))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } func getPrice(prices []datatypes.Product_Item_Price, category, restrictionType string, restrictionValue int) datatypes.Product_Item_Price { @@ -1209,7 +1210,7 @@ func getPriceByCategory(productItems []datatypes.Product_Item, priceCategory str } return datatypes.Product_Item_Price{}, - fmt.Errorf("No product items matching with category %s could be found", priceCategory) + fmt.Errorf("[ERROR] No product items matching with category %s could be found", priceCategory) } func getSaaSPerformSpacePrice(productItems []datatypes.Product_Item, size int) (datatypes.Product_Item_Price, error) { @@ -1244,7 +1245,7 @@ func getSaaSPerformSpacePrice(productItems []datatypes.Product_Item, size int) ( } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find price for performance storage space") + fmt.Errorf("[ERROR] Could not find price for performance storage space") } @@ -1276,7 +1277,7 @@ func getSaaSPerformIOPSPrice(productItems []datatypes.Product_Item, size, iops i } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find price for iops for the given volume") + fmt.Errorf("[ERROR] Could not find price for iops for the given volume") } @@ -1317,7 +1318,7 @@ func getSaaSEnduranceSpacePrice(productItems []datatypes.Product_Item, size int, } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find price for endurance storage space") + fmt.Errorf("[ERROR] Could not find price for endurance storage space") } @@ -1343,7 +1344,7 @@ func getSaaSEnduranceTierPrice(productItems []datatypes.Product_Item, iops float } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find price for endurance tier level") + fmt.Errorf("[ERROR] Could not find price for endurance tier level") } @@ -1374,14 +1375,14 @@ func getSaaSSnapshotSpacePrice(productItems []datatypes.Product_Item, size int, } return datatypes.Product_Item_Price{}, - fmt.Errorf("Could not find price for snapshot space") + fmt.Errorf("[ERROR] Could not find price for snapshot space") } func prepareModifyOrder(sess *session.Session, originalVolume datatypes.Network_Storage, newIops float64, newSize int) (datatypes.Container_Product_Order_Network_Storage_AsAService, error) { // Verify that the origin volume has not been cancelled if originalVolume.BillingItem == nil { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("The volume has been cancelled; unable to modify volume.") + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] The volume has been cancelled; unable to modify volume") } // Get the appropriate package for the order ('storage_as_a_service' is currently used for modifying volumes) @@ -1406,22 +1407,22 @@ func prepareModifyOrder(sess *session.Session, originalVolume datatypes.Network_ if strings.Contains(volumeStorageType, "PERFORMANCE") { volumeIsPerformance = true if newSize == 0 && newIops == 0 { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("A size or IOPS value must be given to modify this performance volume.") + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] A size or IOPS value must be given to modify this performance volume") } if newSize == 0 { newSize = *originalVolume.CapacityGb } else if newIops == 0 { storageType, err := getStorageTypeFromKeyName(*originalVolume.StorageType.KeyName) if err != nil { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("Error retrieving storage information: %s", err) + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } iops, err := getIops(originalVolume, storageType) if err != nil { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("Error retrieving storage information: %s", err) + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } newIops = iops if newIops <= 0 { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("Cannot find volume's provisioned IOPS.") + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] Cannot find volume's provisioned IOPS") } } @@ -1447,7 +1448,7 @@ func prepareModifyOrder(sess *session.Session, originalVolume datatypes.Network_ } else if strings.Contains(volumeStorageType, "ENDURANCE") { volumeIsPerformance = false if newSize == 0 && newIops == 0 { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("A size or IOPS value must be given to modify this performance volume.") + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] A size or IOPS value must be given to modify this performance volume") } if newSize == 0 { newSize = *originalVolume.CapacityGb @@ -1476,7 +1477,7 @@ func prepareModifyOrder(sess *session.Session, originalVolume datatypes.Network_ targetItemPrices = append(targetItemPrices, price) } else { - return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("Volume does not have a valid storage type (with an appropriate keyName to indicate the volume is a PERFORMANCE or an ENDURANCE volume).") + return datatypes.Container_Product_Order_Network_Storage_AsAService{}, fmt.Errorf("[ERROR] Volume does not have a valid storage type (with an appropriate keyName to indicate the volume is a PERFORMANCE or an ENDURANCE volume)") } modifyOrder := datatypes.Container_Product_Order_Network_Storage_AsAService{ @@ -1508,7 +1509,7 @@ func findEnduranceTierIopsPerGb(originalVolume datatypes.Network_Storage) (iopsP } else if tier == "10_IOPS_PER_GB" { iopsPerGB = 10 } else { - return iopsPerGB, fmt.Errorf("Could not find tier IOPS per GB for this volume") + return iopsPerGB, fmt.Errorf("[ERROR] Could not find tier IOPS per GB for this volume") } return iopsPerGB, nil @@ -1520,11 +1521,11 @@ func WaitForStorageUpdate(d *schema.ResourceData, meta interface{}) (interface{} log.Printf("Waiting for storage (%s) to be updated.", d.Id()) id, err := strconv.Atoi(d.Id()) if err != nil { - return nil, fmt.Errorf("The storage ID %s must be numeric", d.Id()) + return nil, fmt.Errorf("[ERROR] The storage ID %s must be numeric", d.Id()) } size := d.Get("capacity").(int) iops := d.Get("iops").(float64) - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() stateConf := &resource.StateChangeConf{ Pending: []string{"provisioning"}, Target: []string{"available"}, @@ -1533,17 +1534,17 @@ func WaitForStorageUpdate(d *schema.ResourceData, meta interface{}) (interface{} result, err := service.Id(id).Mask(storageDetailMask).GetObject() if err != nil { if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { - return nil, "", fmt.Errorf("Error retrieving storage: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving storage: %s", err) } return result, "provisioning", nil } storageType, err := getStorageTypeFromKeyName(*result.StorageType.KeyName) if err != nil { - return nil, "", fmt.Errorf("Error retrieving storage information: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } temp, err := getIops(result, storageType) if err != nil { - return nil, "", fmt.Errorf("Error retrieving storage information: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving storage information: %s", err) } if *result.CapacityGb == size && iops == float64(temp) { return result, "available", nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_subnet.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_subnet.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_subnet.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_subnet.go index c8f2ba79f7..4a19204628 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_subnet.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure/resource_ibm_subnet.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package classicinfrastructure import ( "errors" @@ -11,6 +11,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/softlayer/softlayer-go/datatypes" @@ -34,7 +35,7 @@ var ( } ) -func resourceIBMSubnet() *schema.Resource { +func ResourceIBMSubnet() *schema.Resource { return &schema.Resource{ Create: resourceIBMSubnetCreate, Read: resourceIBMSubnetRead, @@ -115,13 +116,13 @@ func resourceIBMSubnet() *schema.Resource { }, // Provides IP address/cidr format (ex. 10.10.10.10/28) - "subnet_cidr": &schema.Schema{ + "subnet_cidr": { Type: schema.TypeString, Computed: true, Description: "CIDR notation for the subnet", }, - "notes": &schema.Schema{ + "notes": { Type: schema.TypeString, Optional: true, Description: "Notes", @@ -139,12 +140,12 @@ func resourceIBMSubnet() *schema.Resource { } func resourceIBMSubnetCreate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() // Find price items with AdditionalServicesSubnetAddresses productOrderContainer, err := buildSubnetProductOrderContainer(d, sess) if err != nil { - return fmt.Errorf("Error creating subnet: %s", err) + return fmt.Errorf("[ERROR] Error creating subnet: %s", err) } log.Println("[INFO] Creating subnet") @@ -152,12 +153,12 @@ func resourceIBMSubnetCreate(d *schema.ResourceData, meta interface{}) error { receipt, err := services.GetProductOrderService(sess.SetRetries(0)). PlaceOrder(productOrderContainer, sl.Bool(false)) if err != nil { - return fmt.Errorf("Error during creation of subnet: %s", err) + return fmt.Errorf("[ERROR] Error during creation of subnet: %s", err) } Subnet, err := findSubnetByOrderID(sess, *receipt.OrderId, d) if err != nil { - return fmt.Errorf("Error during creation of subnet: %s", err) + return fmt.Errorf("[ERROR] Error during creation of subnet: %s", err) } d.SetId(fmt.Sprintf("%d", *Subnet.Id)) @@ -166,17 +167,17 @@ func resourceIBMSubnetCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMSubnetRead(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetService(sess) subnetID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid subnet ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid subnet ID, must be an integer: %s", err) } subnet, err := service.Id(subnetID).Mask(SubnetMask).GetObject() if err != nil { - return fmt.Errorf("Error retrieving a subnet: %s", err) + return fmt.Errorf("[ERROR] Error retrieving a subnet: %s", err) } if *subnet.AddressSpace == "PRIVATE" { @@ -186,14 +187,14 @@ func resourceIBMSubnetRead(d *schema.ResourceData, meta interface{}) error { } if subnet.SubnetType == nil { - return fmt.Errorf("Invalid vlan type: the subnet type is null") + return fmt.Errorf("[ERROR] Invalid vlan type: the subnet type is null") } if strings.Contains(*subnet.SubnetType, "STATIC") { d.Set("type", "Static") } else if strings.Contains(*subnet.SubnetType, "VLAN") { d.Set("type", "Portable") } else { - return fmt.Errorf("Invalid vlan type: %s", *subnet.SubnetType) + return fmt.Errorf("[ERROR] Invalid vlan type: %s", *subnet.SubnetType) } d.Set("ip_version", *subnet.Version) d.Set("capacity", *subnet.TotalIpAddresses) @@ -216,35 +217,35 @@ func resourceIBMSubnetRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMSubnetUpdate(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetService(sess) subnetID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid subnet ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid subnet ID, must be an integer: %s", err) } if d.HasChange("notes") { _, err = service.Id(subnetID).EditNote(sl.String(d.Get("notes").(string))) if err != nil { - return fmt.Errorf("Error updating subnet: %s", err) + return fmt.Errorf("[ERROR] Error updating subnet: %s", err) } } return resourceIBMSubnetRead(d, meta) } func resourceIBMSubnetDelete(d *schema.ResourceData, meta interface{}) error { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetService(sess) subnetID, err := strconv.Atoi(d.Id()) if err != nil { - return fmt.Errorf("Not a valid subnet ID, must be an integer: %s", err) + return fmt.Errorf("[ERROR] Not a valid subnet ID, must be an integer: %s", err) } billingItem, err := service.Id(subnetID).GetBillingItem() if err != nil { - return fmt.Errorf("Error deleting subnet: %s", err) + return fmt.Errorf("[ERROR] Error deleting subnet: %s", err) } if billingItem.Id == nil { @@ -252,19 +253,19 @@ func resourceIBMSubnetDelete(d *schema.ResourceData, meta interface{}) error { } _, err = services.GetBillingItemService(sess).Id(*billingItem.Id).CancelService() if err != nil { - return fmt.Errorf("Error deleting subnet: %s", err) + return fmt.Errorf("[ERROR] Error deleting subnet: %s", err) } return err } func resourceIBMSubnetExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess := meta.(ClientSession).SoftLayerSession() + sess := meta.(conns.ClientSession).SoftLayerSession() service := services.GetNetworkSubnetService(sess) subnetID, err := strconv.Atoi(d.Id()) if err != nil { - return false, fmt.Errorf("Not a valid ID, must be an integer: %s", err) + return false, fmt.Errorf("[ERROR] Not a valid ID, must be an integer: %s", err) } result, err := service.Id(subnetID).GetObject() @@ -272,7 +273,7 @@ func resourceIBMSubnetExists(d *schema.ResourceData, meta interface{}) (bool, er if apiErr, ok := err.(sl.Error); ok && apiErr.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving subnet: %s", err) + return false, fmt.Errorf("[ERROR] Error retrieving subnet: %s", err) } return result.Id != nil && *result.Id == subnetID, nil } @@ -313,7 +314,7 @@ func findSubnetByOrderID(sess *session.Session, orderID int, d *schema.ResourceD } return datatypes.Network_Subnet{}, - fmt.Errorf("Cannot find a subnet with order id '%d'", orderID) + fmt.Errorf("[ERROR] Cannot find a subnet with order id '%d'", orderID) } func buildSubnetProductOrderContainer(d *schema.ResourceData, sess *session.Session) ( @@ -356,7 +357,7 @@ func buildSubnetProductOrderContainer(d *schema.ResourceData, sess *session.Sess if len(SubnetItems) == 0 { return &datatypes.Container_Product_Order_Network_Subnet{}, - fmt.Errorf("No product items matching with capacity %d could be found", capacity) + fmt.Errorf("[ERROR] No product items matching with capacity %d could be found", capacity) } productOrderContainer := datatypes.Container_Product_Order_Network_Subnet{ @@ -389,7 +390,7 @@ func buildSubnetProductOrderContainer(d *schema.ResourceData, sess *session.Sess } if productOrderContainer.EndPointIpAddressId == nil { return &datatypes.Container_Product_Order_Network_Subnet{}, - fmt.Errorf("Unable to find an ID of ipAddress: %s", endpointIPStr) + fmt.Errorf("[ERROR] Unable to find an ID of ipAddress: %s", endpointIPStr) } } return &productOrderContainer, nil @@ -399,7 +400,7 @@ func getVlanType(sess *session.Session, vlanID int) (string, error) { vlan, err := services.GetNetworkVlanService(sess).Id(vlanID).Mask(VlanMask).GetObject() if err != nil { - return "", fmt.Errorf("Error retrieving vlan: %s", err) + return "", fmt.Errorf("[ERROR] Error retrieving vlan: %s", err) } if vlan.PrimaryRouter != nil { @@ -409,5 +410,5 @@ func getVlanType(sess *session.Session, vlanID int) (string, error) { return "PRIVATE", nil } } - return "", fmt.Errorf("Unable to determine network") + return "", fmt.Errorf("[ERROR] Unable to determine network") } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/README.md new file mode 100644 index 0000000000..cb3c1a1bdc --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Cloudant + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Cloudant resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cloudant) +* IBM API Docs: [IBM API Docs for Cloudant](https://cloud.ibm.com/apidocs/cloudant) +* IBM Cloudant SDK: [IBM SDK for Cloudant](https://github.com/IBM/cloudant-go-sdk/) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cloudant.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/data_source_ibm_cloudant.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cloudant.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/data_source_ibm_cloudant.go index e25d354d8a..142174ec9b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cloudant.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/data_source_ibm_cloudant.go @@ -1,19 +1,20 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudant import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/cloudant-go-sdk/cloudantv1" ) -func dataSourceIBMCloudant() *schema.Resource { - riSchema := dataSourceIBMResourceInstance().Schema +func DataSourceIBMCloudant() *schema.Resource { + riSchema := resourcecontroller.DataSourceIBMResourceInstance().Schema riSchema["service"] = &schema.Schema{ Type: schema.TypeString, @@ -78,12 +79,12 @@ func dataSourceIBMCloudant() *schema.Resource { Description: "Configuration for CORS.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "allow_credentials": &schema.Schema{ + "allow_credentials": { Type: schema.TypeBool, Computed: true, Description: "Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.", }, - "origins": &schema.Schema{ + "origins": { Type: schema.TypeList, Computed: true, Description: "An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.", @@ -102,7 +103,7 @@ func dataSourceIBMCloudant() *schema.Resource { } func dataSourceIBMCloudantRead(d *schema.ResourceData, meta interface{}) error { - err := dataSourceIBMResourceInstanceRead(d, meta) + err := resourcecontroller.DataSourceIBMResourceInstanceRead(d, meta) if err != nil { return err } @@ -143,7 +144,7 @@ func dataSourceIBMCloudantRead(d *schema.ResourceData, meta interface{}) error { func setCloudantServerInformation(client *cloudantv1.CloudantV1, d *schema.ResourceData) error { serverInformation, err := readCloudantServerInformation(client) if err != nil { - return fmt.Errorf("Error retrieving server information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving server information: %s", err) } if serverInformation.Vendor != nil && serverInformation.Vendor.Version != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cloudant.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/resource_ibm_cloudant.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cloudant.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/resource_ibm_cloudant.go index ddc68364bc..aeddee1fd4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cloudant.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant/resource_ibm_cloudant.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudant import ( "context" @@ -11,6 +11,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -22,8 +25,8 @@ import ( iamidentity "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func resourceIBMCloudant() *schema.Resource { - riSchema := resourceIBMResourceInstance().Schema +func ResourceIBMCloudant() *schema.Resource { + riSchema := resourcecontroller.ResourceIBMResourceInstance().Schema riSchema["service"] = &schema.Schema{ Type: schema.TypeString, @@ -87,13 +90,13 @@ func resourceIBMCloudant() *schema.Resource { Description: "Configuration for CORS.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "allow_credentials": &schema.Schema{ + "allow_credentials": { Type: schema.TypeBool, Optional: true, Default: true, Description: "Boolean value to allow authentication credentials. If set to true, browser requests must be done by using withCredentials = true.", }, - "origins": &schema.Schema{ + "origins": { Type: schema.TypeList, Required: true, Description: "An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used.", @@ -111,8 +114,8 @@ func resourceIBMCloudant() *schema.Resource { Create: resourceIBMCloudantCreate, Read: resourceIBMCloudantRead, Update: resourceIBMCloudantUpdate, - Delete: resourceIBMResourceInstanceDelete, - Exists: resourceIBMResourceInstanceExists, + Delete: resourcecontroller.ResourceIBMResourceInstanceDelete, + Exists: resourcecontroller.ResourceIBMResourceInstanceExists, Importer: &schema.ResourceImporter{}, Timeouts: &schema.ResourceTimeout{ @@ -123,7 +126,7 @@ func resourceIBMCloudant() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -171,7 +174,7 @@ func resourceIBMCloudantCreate(d *schema.ResourceData, meta interface{}) error { d.Set("parameters", params) } - err = resourceIBMResourceInstanceCreate(d, meta) + err = resourcecontroller.ResourceIBMResourceInstanceCreate(d, meta) if err != nil { return err } @@ -188,7 +191,7 @@ func resourceIBMCloudantCreate(d *schema.ResourceData, meta interface{}) error { if d.Get("include_data_events").(bool) { err := updateCloudantActivityTrackerEvents(client, d) if err != nil { - return fmt.Errorf("Error updating activity tracker events: %s", err) + return fmt.Errorf("[ERROR] Error updating activity tracker events: %s", err) } } @@ -196,20 +199,20 @@ func resourceIBMCloudantCreate(d *schema.ResourceData, meta interface{}) error { if d.Get("capacity").(int) > 1 { err := updateCloudantInstanceCapacity(client, d) if err != nil { - return fmt.Errorf("Error retrieving capacity throughput information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving capacity throughput information: %s", err) } } err = updateCloudantInstanceCors(client, d) if err != nil { - return fmt.Errorf("Error updating CORS settings: %s", err) + return fmt.Errorf("[ERROR] Error updating CORS settings: %s", err) } return resourceIBMCloudantRead(d, meta) } func resourceIBMCloudantRead(d *schema.ResourceData, meta interface{}) error { - err := resourceIBMResourceInstanceRead(d, meta) + err := resourcecontroller.ResourceIBMResourceInstanceRead(d, meta) if err != nil { return err } @@ -260,7 +263,7 @@ func resourceIBMCloudantUpdate(d *schema.ResourceData, meta interface{}) error { return err } - err = resourceIBMResourceInstanceUpdate(d, meta) + err = resourcecontroller.ResourceIBMResourceInstanceUpdate(d, meta) if err != nil { return err } @@ -273,21 +276,21 @@ func resourceIBMCloudantUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("include_data_events") { err := updateCloudantActivityTrackerEvents(client, d) if err != nil { - return fmt.Errorf("Error updating activity tracker events: %s", err) + return fmt.Errorf("[ERROR] Error updating activity tracker events: %s", err) } } if d.HasChange("capacity") { err := updateCloudantInstanceCapacity(client, d) if err != nil { - return fmt.Errorf("Error retrieving capacity throughput information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving capacity throughput information: %s", err) } } if d.HasChange("enable_cors") { err := updateCloudantInstanceCors(client, d) if err != nil { - return fmt.Errorf("Error updating CORS settings: %s", err) + return fmt.Errorf("[ERROR] Error updating CORS settings: %s", err) } } @@ -295,7 +298,7 @@ func resourceIBMCloudantUpdate(d *schema.ResourceData, meta interface{}) error { } func setCloudantLegacyCredentials(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -333,19 +336,19 @@ func setCloudantLegacyCredentials(d *schema.ResourceData, meta interface{}) erro } func setCloudantResourceControllerURL(d *schema.ResourceData, meta interface{}) error { - crn := d.Get(ResourceCRN).(string) - rcontroller, err := getBaseController(meta) + crn := d.Get(flex.ResourceCRN).(string) + rcontroller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, rcontroller+"/services/cloudantnosqldb/"+url.QueryEscape(crn)) + d.Set(flex.ResourceControllerURL, rcontroller+"/services/cloudantnosqldb/"+url.QueryEscape(crn)) return nil } func getCloudantClient(d *schema.ResourceData, meta interface{}) (*cloudantv1.CloudantV1, error) { - session, err := meta.(ClientSession).BluemixSession() + session, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return nil, err } @@ -360,7 +363,7 @@ func getCloudantClient(d *schema.ResourceData, meta interface{}) (*cloudantv1.Cl case "private": _, ok := extensions["endpoints.private"] if !ok { - return nil, fmt.Errorf("Missing endpoints.private in extensions") + return nil, fmt.Errorf("[ERROR] Missing endpoints.private in extensions") } endpoint = "https://" + extensions["endpoints.private"].(string) case "public-and-private": @@ -369,9 +372,9 @@ func getCloudantClient(d *schema.ResourceData, meta interface{}) (*cloudantv1.Cl } } - endpoint = envFallBack([]string{"IBMCLOUD_CLOUDANT_ENDPOINT"}, endpoint) + endpoint = conns.EnvFallBack([]string{"IBMCLOUD_CLOUDANT_ENDPOINT"}, endpoint) if endpoint == "" { - return nil, fmt.Errorf("Missing endpoints.public in extensions") + return nil, fmt.Errorf("[ERROR] Missing endpoints.public in extensions") } var authenticator core.Authenticator @@ -389,14 +392,14 @@ func getCloudantClient(d *schema.ResourceData, meta interface{}) (*cloudantv1.Cl iamURL := iamidentity.DefaultServiceURL if visibility == "private" || visibility == "public-and-private" { if region == "us-south" || region == "us-east" { - iamURL = contructEndpoint(fmt.Sprintf("private.%s.iam", region), cloudEndpoint) + iamURL = conns.ContructEndpoint(fmt.Sprintf("private.%s.iam", region), "cloud.ibm.com") } else { - iamURL = contructEndpoint("private.iam", cloudEndpoint) + iamURL = conns.ContructEndpoint("private.iam", "cloud.ibm.com") } } authenticator = &core.IamAuthenticator{ ApiKey: apiKey, - URL: envFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", + URL: conns.EnvFallBack([]string{"IBMCLOUD_IAM_API_ENDPOINT"}, iamURL) + "/identity/token", } } @@ -405,7 +408,7 @@ func getCloudantClient(d *schema.ResourceData, meta interface{}) (*cloudantv1.Cl URL: endpoint, }) if err != nil { - return nil, fmt.Errorf("Error occured while configuring Cloudant service: %q", err) + return nil, fmt.Errorf("[ERROR] Error occured while configuring Cloudant service: %q", err) } return client, nil @@ -414,7 +417,7 @@ func getCloudantClient(d *schema.ResourceData, meta interface{}) (*cloudantv1.Cl func setCloudantActivityTrackerEvents(client *cloudantv1.CloudantV1, d *schema.ResourceData) error { activityTrackerEvents, err := readCloudantActivityTrackerEvents(client) if err != nil { - return fmt.Errorf("Error retrieving activity tracker events: %s", err) + return fmt.Errorf("[ERROR] Error retrieving activity tracker events: %s", err) } if activityTrackerEvents.Types != nil { includeDataEvents := false @@ -457,7 +460,7 @@ func validateCloudantInstanceCapacity(d *schema.ResourceData) error { plan := d.Get("plan").(string) capacity := d.Get("capacity").(int) if capacity > 1 && plan == "lite" { - return fmt.Errorf("Setting capacity is not supported for your instance's plan.") + return fmt.Errorf("[ERROR] Setting capacity is not supported for your instance's plan") } return nil } @@ -465,7 +468,7 @@ func validateCloudantInstanceCapacity(d *schema.ResourceData) error { func setCloudantInstanceCapacity(client *cloudantv1.CloudantV1, d *schema.ResourceData) error { capacityThroughputInformation, err := readCloudantInstanceCapacity(client) if err != nil { - return fmt.Errorf("Error retrieving capacity throughput information: %s", err) + return fmt.Errorf("[ERROR] Error retrieving capacity throughput information: %s", err) } if capacityThroughputInformation.Current != nil && capacityThroughputInformation.Current.Throughput != nil { @@ -548,7 +551,7 @@ func validateCloudantInstanceCors(d *schema.ResourceData) error { allowCredentials := corsConfig["allow_credentials"].(bool) origins := corsConfig["origins"].([]interface{}) if !allowCredentials || len(origins) > 0 { - return fmt.Errorf("Setting \"cors_config\" conflicts with enable_cors set to false") + return fmt.Errorf("[ERROR] Setting \"cors_config\" conflicts with enable_cors set to false") } } return nil @@ -557,7 +560,7 @@ func validateCloudantInstanceCors(d *schema.ResourceData) error { func setCloudantInstanceCors(client *cloudantv1.CloudantV1, d *schema.ResourceData) error { corsInformation, err := readCloudantInstanceCors(client) if err != nil { - return fmt.Errorf("Error retrieving CORS config: %s", err) + return fmt.Errorf("[ERROR] Error retrieving CORS config: %s", err) } if corsInformation != nil { d.Set("enable_cors", corsInformation.EnableCors) @@ -593,7 +596,7 @@ func updateCloudantInstanceCors(client *cloudantv1.CloudantV1, d *schema.Resourc if enableCors && len(corsConfigRaw) > 0 { corsConfig := corsConfigRaw[0].(map[string]interface{}) allowCredentials = corsConfig["allow_credentials"].(bool) - origins = expandStringList(corsConfig["origins"].([]interface{})) + origins = flex.ExpandStringList(corsConfig["origins"].([]interface{})) } opts := client.NewPutCorsConfigurationOptions(origins) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_account.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_account.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_account.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_account.go index 8b34bd1e04..712d262ced 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_account.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_account.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAccount() *schema.Resource { +func DataSourceIBMAccount() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMAccountRead, @@ -48,27 +49,27 @@ func dataSourceIBMAccount() *schema.Resource { } func dataSourceIBMAccountRead(d *schema.ResourceData, meta interface{}) error { - bmxSess, err := meta.(ClientSession).BluemixSession() + bmxSess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } - accClient, err := meta.(ClientSession).BluemixAcccountAPI() + accClient, err := meta.(conns.ClientSession).BluemixAcccountAPI() if err != nil { return err } orgGUID := d.Get("org_guid").(string) account, err := accClient.Accounts().FindByOrg(orgGUID, bmxSess.Config.Region) if err != nil { - return fmt.Errorf("Error retrieving organisation: %s", err) + return fmt.Errorf("[ERROR] Error retrieving organisation: %s", err) } - accountv1Client, err := meta.(ClientSession).BluemixAcccountv1API() + accountv1Client, err := meta.(conns.ClientSession).BluemixAcccountv1API() if err != nil { return err } accountUsers, err := accountv1Client.Accounts().GetAccountUsers(account.GUID) if err != nil { - return fmt.Errorf("Error retrieving users in account: %s", err) + return fmt.Errorf("[ERROR] Error retrieving users in account: %s", err) } accountUsersMap := make([]map[string]string, 0, len(accountUsers)) for _, user := range accountUsers { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app.go index e3b396d64a..efe3adf82f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMApp() *schema.Resource { +func DataSourceIBMApp() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMAppRead, @@ -91,7 +93,7 @@ func dataSourceIBMApp() *schema.Resource { } func dataSourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -109,7 +111,7 @@ func dataSourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { if app.BuildPack != nil { d.Set("buildpack", app.BuildPack) } - d.Set("environment_json", Flatten(app.EnvironmentJSON)) + d.Set("environment_json", flex.Flatten(app.EnvironmentJSON)) d.Set("package_state", app.PackageState) d.Set("state", app.State) d.Set("instances", app.Instances) @@ -122,14 +124,14 @@ func dataSourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { return err } if len(route) > 0 { - d.Set("route_guid", flattenRoute(route)) + d.Set("route_guid", flex.FlattenRoute(route)) } svcBindings, err := appAPI.ListServiceBindings(app.GUID) if err != nil { return err } if len(svcBindings) > 0 { - d.Set("service_instance_guid", flattenServiceBindings(svcBindings)) + d.Set("service_instance_guid", flex.FlattenServiceBindings(svcBindings)) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_domain_private.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_domain_private.go new file mode 100644 index 0000000000..37f94aab2e --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_domain_private.go @@ -0,0 +1,40 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cloudfoundry + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMAppDomainPrivate() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMAppDomainPrivateRead, + + Schema: map[string]*schema.Schema{ + "name": { + Description: "The name of the private domain", + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func dataSourceIBMAppDomainPrivateRead(d *schema.ResourceData, meta interface{}) error { + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + domainName := d.Get("name").(string) + prdomain, err := cfAPI.PrivateDomains().FindByName(domainName) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving domain: %s", err) + } + d.SetId(prdomain.GUID) + return nil + +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_domain_shared.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_domain_shared.go new file mode 100644 index 0000000000..71bb660d8d --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_domain_shared.go @@ -0,0 +1,42 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cloudfoundry + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMAppDomainShared() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMAppDomainSharedRead, + + Schema: map[string]*schema.Schema{ + "name": { + Description: "The name of the shared domain", + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.ValidateDomainName, + }, + }, + } +} + +func dataSourceIBMAppDomainSharedRead(d *schema.ResourceData, meta interface{}) error { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + domainName := d.Get("name").(string) + shdomain, err := cfClient.SharedDomains().FindByName(domainName) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving shared domain: %s", err) + } + d.SetId(shdomain.GUID) + return nil + +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_route.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_route.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_route.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_route.go index 37587bbc9c..7d7ed0a9e2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_app_route.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_app_route.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" v2 "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMAppRoute() *schema.Resource { +func DataSourceIBMAppRoute() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMAppRouteRead, @@ -36,20 +38,20 @@ func dataSourceIBMAppRoute() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "The path of the route", - ValidateFunc: validateRoutePath, + ValidateFunc: validate.ValidateRoutePath, }, "port": { Type: schema.TypeString, Optional: true, Description: "The port of the route", - ValidateFunc: validateRoutePort, + ValidateFunc: validate.ValidateRoutePort, }, }, } } func dataSourceIBMAppRouteRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -74,14 +76,14 @@ func dataSourceIBMAppRouteRead(d *schema.ResourceData, meta interface{}) error { } route, err := spaceAPI.ListRoutes(spaceGUID, params) if err != nil { - return fmt.Errorf("Error retrieving route: %s", err) + return fmt.Errorf("[ERROR] Error retrieving route: %s", err) } if len(route) == 0 { - return fmt.Errorf("No route satifies the given parameters") + return fmt.Errorf("[ERROR] No route satifies the given parameters") } if len(route) > 1 { - return fmt.Errorf("More than one route satifies the given parameters") + return fmt.Errorf("[ERROR] More than one route satifies the given parameters") } d.SetId(route[0].GUID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_org.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_org.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_org.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_org.go index 64b309697e..0878c73701 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_org.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_org.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMOrg() *schema.Resource { +func DataSourceIBMOrg() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMOrgRead, @@ -32,7 +33,7 @@ func dataSourceIBMOrg() *schema.Resource { } func dataSourceIBMOrgRead(d *schema.ResourceData, meta interface{}) error { - cfAPI, err := meta.(ClientSession).MccpAPI() + cfAPI, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -45,9 +46,9 @@ func dataSourceIBMOrgRead(d *schema.ResourceData, meta interface{}) error { org = v.(string) } - orgFields, err := orgAPI.FindByName(org, BluemixRegion) + orgFields, err := orgAPI.FindByName(org, conns.BluemixRegion) if err != nil { - return fmt.Errorf("Error retrieving organisation: %s", err) + return fmt.Errorf("[ERROR] Error retrieving organisation: %s", err) } d.SetId(orgFields.GUID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_org_quota.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_org_quota.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_org_quota.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_org_quota.go index 036e5475bd..cc6a9c47bc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_org_quota.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_org_quota.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMOrgQuota() *schema.Resource { +func DataSourceIBMOrgQuota() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMOrgQuotaRead, @@ -79,7 +80,7 @@ func dataSourceIBMOrgQuota() *schema.Resource { } func dataSourceIBMOrgQuotaRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -87,7 +88,7 @@ func dataSourceIBMOrgQuotaRead(d *schema.ResourceData, meta interface{}) error { orgQuotaName := d.Get("name").(string) orgQuotaFields, err := orgQuotaAPI.FindByName(orgQuotaName) if err != nil { - return fmt.Errorf("Error retrieving org quota: %s", err) + return fmt.Errorf("[ERROR] Error retrieving org quota: %s", err) } d.SetId(orgQuotaFields.GUID) d.Set("app_instance_limit", orgQuotaFields.AppInstanceLimit) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_instance.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_instance.go index 1b97b8c249..651496de41 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_instance.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMServiceInstance() *schema.Resource { +func DataSourceIBMServiceInstance() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMServiceInstanceRead, @@ -64,7 +66,7 @@ func dataSourceIBMServiceInstance() *schema.Resource { } func dataSourceIBMServiceInstanceRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -78,13 +80,13 @@ func dataSourceIBMServiceInstanceRead(d *schema.ResourceData, meta interface{}) serviceInstance, err := siAPI.Get(inst.GUID, 1) if err != nil { - return fmt.Errorf("Error retrieving service: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service: %s", err) } d.SetId(serviceInstance.Metadata.GUID) serviceKeys := serviceInstance.Entity.ServiceKeys - d.Set("credentials", Flatten(serviceInstance.Entity.Credentials)) - d.Set("service_keys", flattenServiceInstanceCredentials(serviceKeys)) + d.Set("credentials", flex.Flatten(serviceInstance.Entity.Credentials)) + d.Set("service_keys", flex.FlattenServiceInstanceCredentials(serviceKeys)) d.Set("service_plan_guid", serviceInstance.Entity.ServicePlanGUID) return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_key.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_key.go index 1bf75aa1ee..6a63b0c189 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_key.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMServiceKey() *schema.Resource { +func DataSourceIBMServiceKey() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMServiceKeyRead, @@ -40,7 +42,7 @@ func dataSourceIBMServiceKey() *schema.Resource { } func dataSourceIBMServiceKeyRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -55,13 +57,13 @@ func dataSourceIBMServiceKeyRead(d *schema.ResourceData, meta interface{}) error } serviceInstance, err := siAPI.Get(inst.GUID) if err != nil { - return fmt.Errorf("Error retrieving service: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service: %s", err) } serviceKey, err := skAPI.FindByName(serviceInstance.Metadata.GUID, name) if err != nil { - return fmt.Errorf("Error retrieving service key: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service key: %s", err) } d.SetId(serviceKey.GUID) - d.Set("credentials", Flatten(serviceKey.Credentials)) + d.Set("credentials", flex.Flatten(serviceKey.Credentials)) return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_plan.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_plan.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_plan.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_plan.go index e018f55f43..67c5655d82 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_service_plan.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_service_plan.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMServicePlan() *schema.Resource { +func DataSourceIBMServicePlan() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMServicePlanRead, @@ -30,7 +31,7 @@ func dataSourceIBMServicePlan() *schema.Resource { } func dataSourceIBMServicePlanRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -41,11 +42,11 @@ func dataSourceIBMServicePlanRead(d *schema.ResourceData, meta interface{}) erro plan := d.Get("plan").(string) serviceOff, err := soffAPI.FindByLabel(service) if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) } servicePlan, err := spAPI.FindPlanInServiceOffering(serviceOff.GUID, plan) if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) } d.SetId(servicePlan.GUID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_space.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_space.go new file mode 100644 index 0000000000..e6a9f4af4b --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/data_source_ibm_space.go @@ -0,0 +1,108 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cloudfoundry + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMSpace() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMSpaceRead, + + Schema: map[string]*schema.Schema{ + "space": { + Description: "Space name, for example dev", + Type: schema.TypeString, + Optional: true, + Deprecated: "use name instead", + ExactlyOneOf: []string{"space", "name"}, + }, + "name": { + Description: "Space name, for example dev", + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"space", "name"}, + }, + "org": { + Description: "The org this space belongs to", + Type: schema.TypeString, + Required: true, + }, + "auditors": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who have auditor role in this space, ex - user@example.com", + }, + "managers": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who have manager role in this space, ex - user@example.com", + }, + "developers": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who have developer role in this space, ex - user@example.com", + }, + }, + } +} + +func dataSourceIBMSpaceRead(d *schema.ResourceData, meta interface{}) error { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + orgAPI := cfClient.Organizations() + spaceAPI := cfClient.Spaces() + var space string + if v, ok := d.GetOk("name"); ok { + space = v.(string) + } + if v, ok := d.GetOk("space"); ok { + space = v.(string) + } + + org := d.Get("org").(string) + + orgFields, err := orgAPI.FindByName(org, conns.BluemixRegion) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving org: %s", err) + } + spaceFields, err := spaceAPI.FindByNameInOrg(orgFields.GUID, space, conns.BluemixRegion) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving space: %s", err) + } + + spaceGUID := spaceFields.GUID + d.SetId(spaceGUID) + + auditors, err := spaceAPI.ListAuditors(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving auditors in the space: %s", err) + } + + managers, err := spaceAPI.ListManagers(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving managers in the space: %s", err) + } + + developers, err := spaceAPI.ListDevelopers(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving developers in space: %s", err) + } + + d.Set("auditors", flex.FlattenSpaceRoleUsers(auditors)) + d.Set("managers", flex.FlattenSpaceRoleUsers(managers)) + d.Set("developers", flex.FlattenSpaceRoleUsers(developers)) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app.go index 0ef1757d90..c0ddbd5d3f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" @@ -11,11 +11,14 @@ import ( v2 "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" homedir "github.com/mitchellh/go-homedir" ) -func resourceIBMApp() *schema.Resource { +func ResourceIBMApp() *schema.Resource { return &schema.Resource{ Create: resourceIBMAppCreate, Read: resourceIBMAppRead, @@ -115,7 +118,7 @@ func resourceIBMApp() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "port", - ValidateFunc: validateAllowedStringValue([]string{"port", "process"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"port", "process"}), }, "health_check_timeout": { Description: "Timeout in seconds for health checking of an staged app when starting up.", @@ -127,7 +130,7 @@ func resourceIBMApp() *schema.Resource { } func resourceIBMAppCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -183,7 +186,7 @@ func resourceIBMAppCreate(d *schema.ResourceData, meta interface{}) error { log.Println("[INFO] Creating Cloud Foundary Application") app, err := appAPI.Create(appCreatePayload) if err != nil { - return fmt.Errorf("Error creating app: %s", err) + return fmt.Errorf("[ERROR] Error creating app: %s", err) } appGUID := app.Metadata.GUID @@ -196,7 +199,7 @@ func resourceIBMAppCreate(d *schema.ResourceData, meta interface{}) error { for _, routeID := range v.List() { _, err := appAPI.BindRoute(appGUID, routeID.(string)) if err != nil { - return fmt.Errorf("Error binding route %s to app: %s", routeID.(string), err) + return fmt.Errorf("[ERROR] Error binding route %s to app: %s", routeID.(string), err) } } } @@ -209,7 +212,7 @@ func resourceIBMAppCreate(d *schema.ResourceData, meta interface{}) error { } _, err := sbAPI.Create(req) if err != nil { - return fmt.Errorf("Error binding service instance %s to app: %s", svcID.(string), err) + return fmt.Errorf("[ERROR] Error binding service instance %s to app: %s", svcID.(string), err) } } } @@ -221,7 +224,7 @@ func resourceIBMAppCreate(d *schema.ResourceData, meta interface{}) error { _, err = appAPI.Upload(appGUID, applicationZip) if err != nil { - return fmt.Errorf("Error uploading app bits: %s", err) + return fmt.Errorf("[ERROR] Error uploading app bits: %s", err) } err = restartApp(appGUID, d, meta) @@ -233,7 +236,7 @@ func resourceIBMAppCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -242,7 +245,7 @@ func resourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { appData, err := appAPI.Get(appGUID) if err != nil { - return fmt.Errorf("Error retrieving app details %s : %s", appGUID, err) + return fmt.Errorf("[ERROR] Error retrieving app details %s : %s", appGUID, err) } d.SetId(appData.Metadata.GUID) @@ -252,7 +255,7 @@ func resourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { d.Set("space_guid", appData.Entity.SpaceGUID) d.Set("disk_quota", appData.Entity.DiskQuota) d.Set("buildpack", appData.Entity.BuildPack) - d.Set("environment_json", Flatten(appData.Entity.EnvironmentJSON)) + d.Set("environment_json", flex.Flatten(appData.Entity.EnvironmentJSON)) d.Set("command", appData.Entity.Command) d.Set("health_check_type", appData.Entity.HealthCheckType) d.Set("health_check_http_endpoint", appData.Entity.HealthCheckHTTPEndpoint) @@ -263,7 +266,7 @@ func resourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { return err } if len(route) > 0 { - d.Set("route_guid", flattenRoute(route)) + d.Set("route_guid", flex.FlattenRoute(route)) } svcBindings, err := appAPI.ListServiceBindings(appGUID) @@ -271,7 +274,7 @@ func resourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { return err } if len(svcBindings) > 0 { - d.Set("service_instance_guid", flattenServiceBindings(svcBindings)) + d.Set("service_instance_guid", flex.FlattenServiceBindings(svcBindings)) } return nil @@ -279,7 +282,7 @@ func resourceIBMAppRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMAppUpdate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -346,7 +349,7 @@ func resourceIBMAppUpdate(d *schema.ResourceData, meta interface{}) error { _, err = appAPI.Update(appGUID, appUpdatePayload) if err != nil { - return fmt.Errorf("Error updating application: %s", err) + return fmt.Errorf("[ERROR] Error updating application: %s", err) } //TODO find the digest of the zip and avoid upload if it is same if d.HasChange("app_path") || d.HasChange("app_version") { @@ -357,7 +360,7 @@ func resourceIBMAppUpdate(d *schema.ResourceData, meta interface{}) error { log.Println("[DEBUG] Uploading application bits") _, err = appAPI.Upload(appGUID, appZipLoc) if err != nil { - return fmt.Errorf("Error uploading app: %s", err) + return fmt.Errorf("[ERROR] Error uploading app: %s", err) } restartRequired = true } @@ -379,7 +382,7 @@ func resourceIBMAppUpdate(d *schema.ResourceData, meta interface{}) error { log.Println("[INFO] Waiting to see any previous staging is on or not") state, err := appAPI.WaitForAppStatus(v2.AppStagedState, appGUID, waitTimeout) if waitTimeout != 0 && (err != nil || state == v2.AppPendingState) { - return fmt.Errorf("The application is still in %s from last operations.Please try again after sometime by increasing timeout value %q", state, err) + return fmt.Errorf("[ERROR] The application is still in %s from last operations.Please try again after sometime by increasing timeout value %q", state, err) }*/ //If restage and restart both are required then we only need restage as that starts over everything @@ -399,7 +402,7 @@ func resourceIBMAppUpdate(d *schema.ResourceData, meta interface{}) error { //and spin new ones, so we are waiting till they come up again state, err := appAPI.WaitForInstanceStatus(v2.AppRunningState, appGUID, waitTimeout) if waitTimeout != 0 && (err != nil || state != v2.AppRunningState) { - return fmt.Errorf("All applications instances aren't %s, Current status is %s, %q", v2.AppRunningState, state, err) + return fmt.Errorf("[ERROR] All applications instances aren't %s, Current status is %s, %q", v2.AppRunningState, state, err) } } @@ -407,7 +410,7 @@ func resourceIBMAppUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMAppDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -416,7 +419,7 @@ func resourceIBMAppDelete(d *schema.ResourceData, meta interface{}) error { err = appAPI.Delete(id, false, true) if err != nil { - return fmt.Errorf("Error deleting app: %s", err) + return fmt.Errorf("[ERROR] Error deleting app: %s", err) } d.SetId("") @@ -424,7 +427,7 @@ func resourceIBMAppDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMAppExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -450,14 +453,14 @@ func updateRouteGUID(appGUID string, appAPI v2.Apps, d *schema.ResourceData) (er or := ors.(*schema.Set) nr := nrs.(*schema.Set) - remove := expandStringList(or.Difference(nr).List()) - add := expandStringList(nr.Difference(or).List()) + remove := flex.ExpandStringList(or.Difference(nr).List()) + add := flex.ExpandStringList(nr.Difference(or).List()) if len(add) > 0 { for i := range add { _, err = appAPI.BindRoute(appGUID, add[i]) if err != nil { - return fmt.Errorf("Error while binding route %q to application %s: %q", add[i], appGUID, err) + return fmt.Errorf("[ERROR] Error while binding route %q to application %s: %q", add[i], appGUID, err) } } } @@ -465,7 +468,7 @@ func updateRouteGUID(appGUID string, appAPI v2.Apps, d *schema.ResourceData) (er for i := range remove { err = appAPI.UnBindRoute(appGUID, remove[i]) if err != nil { - return fmt.Errorf("Error while un-binding route %q from application %s: %q", add[i], appGUID, err) + return fmt.Errorf("[ERROR] Error while un-binding route %q from application %s: %q", add[i], appGUID, err) } } } @@ -474,7 +477,7 @@ func updateRouteGUID(appGUID string, appAPI v2.Apps, d *schema.ResourceData) (er } func updateServiceInstanceGUID(appGUID string, d *schema.ResourceData, meta interface{}) (restageRequired bool, err error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -484,8 +487,8 @@ func updateServiceInstanceGUID(appGUID string, d *schema.ResourceData, meta inte oss, nss := d.GetChange("service_instance_guid") os := oss.(*schema.Set) ns := nss.(*schema.Set) - remove := expandStringList(os.Difference(ns).List()) - add := expandStringList(ns.Difference(os).List()) + remove := flex.ExpandStringList(os.Difference(ns).List()) + add := flex.ExpandStringList(ns.Difference(os).List()) if len(add) > 0 { for i := range add { @@ -495,7 +498,7 @@ func updateServiceInstanceGUID(appGUID string, d *schema.ResourceData, meta inte } _, err = sbAPI.Create(sbPayload) if err != nil { - err = fmt.Errorf("Error while binding service instance %s to application %s: %q", add[i], appGUID, err) + err = fmt.Errorf("[ERROR] Error while binding service instance %s to application %s: %q", add[i], appGUID, err) return } restageRequired = true @@ -522,7 +525,7 @@ func updateServiceInstanceGUID(appGUID string, d *schema.ResourceData, meta inte } err = appAPI.DeleteServiceBindings(appGUID, sbIds...) if err != nil { - err = fmt.Errorf("Error while un-binding service instances %s to application %s: %q", remove, appGUID, err) + err = fmt.Errorf("[ERROR] Error while un-binding service instances %s to application %s: %q", remove, appGUID, err) return } } @@ -530,7 +533,7 @@ func updateServiceInstanceGUID(appGUID string, d *schema.ResourceData, meta inte return } func restartApp(appGUID string, d *schema.ResourceData, meta interface{}) error { - cfClient, _ := meta.(ClientSession).MccpAPI() + cfClient, _ := meta.(conns.ClientSession).MccpAPI() appAPI := cfClient.Apps() appUpdatePayload := v2.AppRequest{ @@ -539,13 +542,13 @@ func restartApp(appGUID string, d *schema.ResourceData, meta interface{}) error log.Println("[INFO] Stopping Application") _, err := appAPI.Update(appGUID, appUpdatePayload) if err != nil { - return fmt.Errorf("Error updating application status to %s %s", v2.AppStoppedState, err) + return fmt.Errorf("[ERROR] Error updating application status to %s %s", v2.AppStoppedState, err) } waitTimeout := time.Duration(d.Get("wait_time_minutes").(int)) * time.Minute log.Println("[INFO] Starting Application") status, err := appAPI.Start(appGUID, waitTimeout) if err != nil { - return fmt.Errorf("Error while starting application : %s", err) + return fmt.Errorf("[ERROR] Error while starting application : %s", err) } if waitTimeout != 0 { return checkAppStatus(status) @@ -554,14 +557,14 @@ func restartApp(appGUID string, d *schema.ResourceData, meta interface{}) error } func restageApp(appGUID string, d *schema.ResourceData, meta interface{}) error { - cfClient, _ := meta.(ClientSession).MccpAPI() + cfClient, _ := meta.(conns.ClientSession).MccpAPI() appAPI := cfClient.Apps() log.Println("[INFO] Restage Application") waitTimeout := time.Duration(d.Get("wait_time_minutes").(int)) * time.Minute status, err := appAPI.Restage(appGUID, waitTimeout) if err != nil { - return fmt.Errorf("Error while restaging application : %s", err) + return fmt.Errorf("[ERROR] Error while restaging application : %s", err) } if waitTimeout != 0 { return checkAppStatus(status) @@ -571,10 +574,10 @@ func restageApp(appGUID string, d *schema.ResourceData, meta interface{}) error func checkAppStatus(status *v2.AppState) error { if status.PackageState != v2.AppStagedState { - return fmt.Errorf("Applications couldn't be staged, current status is %s", status.PackageState) + return fmt.Errorf("[ERROR] Applications couldn't be staged, current status is %s", status.PackageState) } if status.InstanceState != v2.AppRunningState { - return fmt.Errorf("All applications instances aren't %s, Current status is %s", v2.AppRunningState, status.InstanceState) + return fmt.Errorf("[ERROR] All applications instances aren't %s, Current status is %s", v2.AppRunningState, status.InstanceState) } return nil } @@ -585,7 +588,7 @@ func processAppZipPath(path string) (string, error) { return path, fmt.Errorf("home directory in the given path %s couldn't be expanded", path) } if !helpers.FileExists(applicationZip) { - return path, fmt.Errorf("The given app path: %s doesn't exist", path) + return path, fmt.Errorf("[ERROR] The given app path: %s doesn't exist", path) } return applicationZip, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_domain_private.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_domain_private.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_domain_private.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_domain_private.go index 385433df42..f645c04e9c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_domain_private.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_domain_private.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" v2 "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMAppDomainPrivate() *schema.Resource { +func ResourceIBMAppDomainPrivate() *schema.Resource { return &schema.Resource{ Create: resourceIBMAppDomainPrivateCreate, Read: resourceIBMAppDomainPrivateRead, @@ -27,7 +29,7 @@ func resourceIBMAppDomainPrivate() *schema.Resource { Required: true, ForceNew: true, Description: "The name of the domain", - ValidateFunc: validateDomainName, + ValidateFunc: validate.ValidateDomainName, }, "org_guid": { @@ -47,7 +49,7 @@ func resourceIBMAppDomainPrivate() *schema.Resource { } func resourceIBMAppDomainPrivateCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -61,7 +63,7 @@ func resourceIBMAppDomainPrivateCreate(d *schema.ResourceData, meta interface{}) prdomain, err := cfClient.PrivateDomains().Create(params) if err != nil { - return fmt.Errorf("Error creating private domain: %s", err) + return fmt.Errorf("[ERROR] Error creating private domain: %s", err) } d.SetId(prdomain.Metadata.GUID) @@ -75,7 +77,7 @@ func resourceIBMAppDomainPrivateUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMAppDomainPrivateRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -83,7 +85,7 @@ func resourceIBMAppDomainPrivateRead(d *schema.ResourceData, meta interface{}) e prdomain, err := cfClient.PrivateDomains().Get(prdomainGUID) if err != nil { - return fmt.Errorf("Error retrieving private domain: %s", err) + return fmt.Errorf("[ERROR] Error retrieving private domain: %s", err) } d.Set("name", prdomain.Entity.Name) d.Set("org_guid", prdomain.Entity.OwningOrganizationGUID) @@ -92,7 +94,7 @@ func resourceIBMAppDomainPrivateRead(d *schema.ResourceData, meta interface{}) e } func resourceIBMAppDomainPrivateDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -101,7 +103,7 @@ func resourceIBMAppDomainPrivateDelete(d *schema.ResourceData, meta interface{}) err = cfClient.PrivateDomains().Delete(prdomainGUID, false) if err != nil { - return fmt.Errorf("Error deleting private domain: %s", err) + return fmt.Errorf("[ERROR] Error deleting private domain: %s", err) } d.SetId("") @@ -110,7 +112,7 @@ func resourceIBMAppDomainPrivateDelete(d *schema.ResourceData, meta interface{}) } func resourceIBMAppDomainPrivateExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -123,7 +125,7 @@ func resourceIBMAppDomainPrivateExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error getting private app domains: %s", err) + return false, fmt.Errorf("[ERROR] Error getting private app domains: %s", err) } return prdomain.Metadata.GUID == prdomainGUID, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_domain_shared.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_domain_shared.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_domain_shared.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_domain_shared.go index 862b1e13f4..75ee3a6eaa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_domain_shared.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_domain_shared.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" v2 "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMAppDomainShared() *schema.Resource { +func ResourceIBMAppDomainShared() *schema.Resource { return &schema.Resource{ Create: resourceIBMAppDomainSharedCreate, Read: resourceIBMAppDomainSharedRead, @@ -27,7 +29,7 @@ func resourceIBMAppDomainShared() *schema.Resource { Required: true, ForceNew: true, Description: "The name of the domain", - ValidateFunc: validateDomainName, + ValidateFunc: validate.ValidateDomainName, }, "router_group_guid": { @@ -48,7 +50,7 @@ func resourceIBMAppDomainShared() *schema.Resource { } func resourceIBMAppDomainSharedCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -62,7 +64,7 @@ func resourceIBMAppDomainSharedCreate(d *schema.ResourceData, meta interface{}) shdomain, err := cfClient.SharedDomains().Create(params) if err != nil { - return fmt.Errorf("Error creating shared domain: %s", err) + return fmt.Errorf("[ERROR] Error creating shared domain: %s", err) } d.SetId(shdomain.Metadata.GUID) @@ -76,7 +78,7 @@ func resourceIBMAppDomainSharedUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMAppDomainSharedRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -84,7 +86,7 @@ func resourceIBMAppDomainSharedRead(d *schema.ResourceData, meta interface{}) er shdomain, err := cfClient.SharedDomains().Get(shdomainGUID) if err != nil { - return fmt.Errorf("Error retrieving shared domain: %s", err) + return fmt.Errorf("[ERROR] Error retrieving shared domain: %s", err) } d.Set("name", shdomain.Entity.Name) d.Set("router_group_guid", shdomain.Entity.RouterGroupGUID) @@ -93,7 +95,7 @@ func resourceIBMAppDomainSharedRead(d *schema.ResourceData, meta interface{}) er } func resourceIBMAppDomainSharedDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -102,7 +104,7 @@ func resourceIBMAppDomainSharedDelete(d *schema.ResourceData, meta interface{}) err = cfClient.SharedDomains().Delete(shdomainGUID, false) if err != nil { - return fmt.Errorf("Error deleting shared domain: %s", err) + return fmt.Errorf("[ERROR] Error deleting shared domain: %s", err) } d.SetId("") @@ -111,7 +113,7 @@ func resourceIBMAppDomainSharedDelete(d *schema.ResourceData, meta interface{}) } func resourceIBMAppDomainSharedExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -124,7 +126,7 @@ func resourceIBMAppDomainSharedExists(d *schema.ResourceData, meta interface{}) return false, nil } } - return false, fmt.Errorf("Error getting shared domains: %s", err) + return false, fmt.Errorf("[ERROR] Error getting shared domains: %s", err) } return shdomain.Metadata.GUID == shdomainGUID, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_route.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_route.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_route.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_route.go index db8c2fbcea..511b1cae3f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_app_route.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_app_route.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" v2 "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMAppRoute() *schema.Resource { +func ResourceIBMAppRoute() *schema.Resource { return &schema.Resource{ Create: resourceIBMAppRouteCreate, Read: resourceIBMAppRouteRead, @@ -47,14 +49,14 @@ func resourceIBMAppRoute() *schema.Resource { Description: "The port of the route. Supported for domains of TCP router groups only.", Optional: true, Type: schema.TypeInt, - ValidateFunc: validateRoutePort, + ValidateFunc: validate.ValidateRoutePort, }, "path": { Description: "The path for a route as raw text.Paths must be between 2 and 128 characters.Paths must start with a forward slash '/'.Paths must not contain a '?'", Optional: true, Type: schema.TypeString, - ValidateFunc: validateRoutePath, + ValidateFunc: validate.ValidateRoutePath, }, "tags": { @@ -68,7 +70,7 @@ func resourceIBMAppRoute() *schema.Resource { } func resourceIBMAppRouteCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -95,7 +97,7 @@ func resourceIBMAppRouteCreate(d *schema.ResourceData, meta interface{}) error { route, err := cfClient.Routes().Create(params) if err != nil { - return fmt.Errorf("Error creating route: %s", err) + return fmt.Errorf("[ERROR] Error creating route: %s", err) } d.SetId(route.Metadata.GUID) @@ -104,7 +106,7 @@ func resourceIBMAppRouteCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMAppRouteRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -112,7 +114,7 @@ func resourceIBMAppRouteRead(d *schema.ResourceData, meta interface{}) error { route, err := cfClient.Routes().Get(routeGUID) if err != nil { - return fmt.Errorf("Error retrieving route: %s", err) + return fmt.Errorf("[ERROR] Error retrieving route: %s", err) } d.Set("host", route.Entity.Host) @@ -127,7 +129,7 @@ func resourceIBMAppRouteRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMAppRouteUpdate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -149,13 +151,13 @@ func resourceIBMAppRouteUpdate(d *schema.ResourceData, meta interface{}) error { _, err = cfClient.Routes().Update(routeGUID, params) if err != nil { - return fmt.Errorf("Error updating route: %s", err) + return fmt.Errorf("[ERROR] Error updating route: %s", err) } return resourceIBMAppRouteRead(d, meta) } func resourceIBMAppRouteDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -163,7 +165,7 @@ func resourceIBMAppRouteDelete(d *schema.ResourceData, meta interface{}) error { err = cfClient.Routes().Delete(routeGUID, false) if err != nil { - return fmt.Errorf("Error deleting route: %s", err) + return fmt.Errorf("[ERROR] Error deleting route: %s", err) } d.SetId("") @@ -171,7 +173,7 @@ func resourceIBMAppRouteDelete(d *schema.ResourceData, meta interface{}) error { return nil } func resourceIBMAppRouteExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_org.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_org.go new file mode 100644 index 0000000000..d559b95f06 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_org.go @@ -0,0 +1,372 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cloudfoundry + +import ( + "errors" + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" + "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" +) + +var ( + errManagerRoleAssociation = errors.New("[ERROR]please remove your email from the manager role and try again. " + + "This is done to avoid spurious diffs because a user creating an organization gets the manager role by default.") + + errUserRoleAssociation = errors.New("[ERROR]please remove your email from the user role and try again. " + + "This is done to avoid spurious diffs because a user creating an organization automatically gets the userrole by default.") +) + +func ResourceIBMOrg() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMOrgCreate, + Read: resourceIBMOrgRead, + Delete: resourceIBMOrgDelete, + Update: resourceIBMOrgUpdate, + Exists: resourceIBMOrgExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "name": { + Description: "Org name, for example myorg@domain", + Type: schema.TypeString, + Required: true, + }, + "org_quota_definition_guid": { + Description: "Org quota guid", + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "billing_managers": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have billing manager role in this org, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + "managers": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have manager role in this org, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + "auditors": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have auditor role in this org, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + "users": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have user role in this org, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + + "tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + }, + } +} +func resourceIBMOrgCreate(d *schema.ResourceData, meta interface{}) error { + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + orgAPI := cfAPI.Organizations() + orgName := d.Get("name").(string) + req := mccpv2.OrgCreateRequest{ + Name: orgName, + } + if orgQuotaDefinitionGUID, ok := d.GetOk("org_quota_definition_guid"); ok { + req.OrgQuotaDefinitionGUID = orgQuotaDefinitionGUID.(string) + } + orgFields, err := orgAPI.Create(req) + if err != nil { + return fmt.Errorf("[ERROR] Error creating organisation: %s", err) + } + orgGUID := orgFields.Metadata.GUID + d.SetId(orgGUID) + + return resourceIBMOrgUpdate(d, meta) +} + +func resourceIBMOrgRead(d *schema.ResourceData, meta interface{}) error { + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + orgAPI := cfAPI.Organizations() + id := d.Id() + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + orgOwnerID := userDetails.UserEmail + orgFields, err := orgAPI.Get(id) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving organisation: %s", err) + } + d.Set("name", orgFields.Entity.Name) + billingManager, err := orgAPI.ListBillingManager(id) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving billing manager in the org: %s", err) + } + managers, err := orgAPI.ListManager(id) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving managers in the org: %s", err) + } + auditors, err := orgAPI.ListAuditors(id) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving auditors in space: %s", err) + } + users, err := orgAPI.ListUsers(id) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving users in space: %s", err) + } + if len(auditors) > 0 { + d.Set("auditors", flex.FlattenOrgRole(auditors, "")) + } + if len(managers) > 0 { + d.Set("managers", flex.FlattenOrgRole(managers, orgOwnerID)) + } + if len(billingManager) > 0 { + d.Set("billing_managers", flex.FlattenOrgRole(billingManager, "")) + } + if len(users) > 0 { + d.Set("users", flex.FlattenOrgRole(users, orgOwnerID)) + } + if orgFields.Entity.OrgQuotaDefinitionGUID != "" { + d.Set("org_quota_definition_guid", orgFields.Entity.OrgQuotaDefinitionGUID) + } + return nil +} + +func resourceIBMOrgUpdate(d *schema.ResourceData, meta interface{}) error { + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + orgAPI := cfAPI.Organizations() + id := d.Id() + + req := mccpv2.OrgUpdateRequest{} + if d.HasChange("name") { + req.Name = helpers.String(d.Get("name").(string)) + } + _, err = orgAPI.Update(id, req) + if err != nil { + return fmt.Errorf("[ERROR] Error updating organisation: %s", err) + } + err = updateOrgBillingManagers(orgAPI, id, d) + if err != nil { + return err + } + err = updateOrgManagers(meta, id, d) + if err != nil { + return err + } + err = updateOrgAuditors(orgAPI, id, d) + if err != nil { + return err + } + err = updateOrgUsers(meta, id, d) + if err != nil { + return err + } + + return resourceIBMOrgRead(d, meta) +} + +func resourceIBMOrgDelete(d *schema.ResourceData, meta interface{}) error { + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + orgAPI := cfAPI.Organizations() + id := d.Id() + err = orgAPI.Delete(id, false) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting organisation: %s", err) + } + d.SetId("") + return nil +} + +func resourceIBMOrgExists(d *schema.ResourceData, meta interface{}) (bool, error) { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return false, err + } + id := d.Id() + org, err := cfClient.Organizations().Get(id) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok { + if apiErr.StatusCode() == 404 { + return false, nil + } + } + return false, fmt.Errorf("[ERROR] Error getting Organization: %s", err) + } + return org.Metadata.GUID == id, nil +} + +func updateOrgBillingManagers(api mccpv2.Organizations, orgGUID string, d *schema.ResourceData) error { + if !d.HasChange("billing_managers") { + return nil + } + var remove, add []string + o, n := d.GetChange("billing_managers") + os := o.(*schema.Set) + ns := n.(*schema.Set) + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + if len(add) > 0 { + for _, d := range add { + _, err := api.AssociateBillingManager(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating billing manager (%s) with org %s : %s", d, orgGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateBillingManager(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating billing manager (%s) with org %s : %s", d, orgGUID, err) + } + } + } + return nil +} + +func updateOrgManagers(meta interface{}, orgGUID string, d *schema.ResourceData) error { + if !d.HasChange("managers") { + return nil + } + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + api := cfAPI.Organizations() + + var remove, add []string + o, n := d.GetChange("managers") + os := o.(*schema.Set) + ns := n.(*schema.Set) + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + orgOwnerID := userDetails.UserEmail + + if len(add) > 0 { + for _, d := range add { + if d == orgOwnerID { + return fmt.Errorf("[ERROR] Error associating user (%s) with manager role, %v", d, errManagerRoleAssociation) + } + _, err := api.AssociateManager(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating manager (%s) with org %s : %s", d, orgGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateManager(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating manager (%s) with org %s : %s", d, orgGUID, err) + } + } + } + return nil +} +func updateOrgAuditors(api mccpv2.Organizations, orgGUID string, d *schema.ResourceData) error { + if !d.HasChange("auditors") { + return nil + } + var remove, add []string + o, n := d.GetChange("auditors") + os := o.(*schema.Set) + ns := n.(*schema.Set) + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + if len(add) > 0 { + for _, d := range add { + _, err := api.AssociateAuditor(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating auditor (%s) with org %s : %s", d, orgGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateAuditor(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating auditor (%s) with org %s : %s", d, orgGUID, err) + } + } + } + return nil +} + +func updateOrgUsers(meta interface{}, orgGUID string, d *schema.ResourceData) error { + if !d.HasChange("users") { + return nil + } + var remove, add []string + o, n := d.GetChange("users") + os := o.(*schema.Set) + ns := n.(*schema.Set) + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + cfAPI, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + api := cfAPI.Organizations() + if len(add) > 0 { + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + orgOwnerID := userDetails.UserEmail + for _, d := range add { + if d == orgOwnerID { + return fmt.Errorf("[ERROR] Error associating user (%s) with User role, %v", d, errUserRoleAssociation) + } + _, err := api.AssociateUser(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating user (%s) with org %s : %s", d, orgGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateUser(orgGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating user (%s) with org %s : %s", d, orgGUID, err) + } + } + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_service_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_service_instance.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_service_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_service_instance.go index 1e5fdb521c..aeea18dbd5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_service_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_service_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" @@ -11,6 +11,8 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -21,7 +23,7 @@ const ( svcInstanceFailStatus = "failed" ) -func resourceIBMServiceInstance() *schema.Resource { +func ResourceIBMServiceInstance() *schema.Resource { return &schema.Resource{ Create: resourceIBMServiceInstanceCreate, Read: resourceIBMServiceInstanceRead, @@ -119,7 +121,7 @@ func resourceIBMServiceInstance() *schema.Resource { } func resourceIBMServiceInstanceCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -135,12 +137,12 @@ func resourceIBMServiceInstanceCreate(d *schema.ResourceData, meta interface{}) serviceOff, err := cfClient.ServiceOfferings().FindByLabel(serviceName) if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) } servicePlan, err := cfClient.ServicePlans().FindPlanInServiceOffering(serviceOff.GUID, plan) if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) } svcInst.PlanGUID = servicePlan.GUID @@ -165,22 +167,21 @@ func resourceIBMServiceInstanceCreate(d *schema.ResourceData, meta interface{}) service, err := cfClient.ServiceInstances().Create(svcInst) if err != nil { - return fmt.Errorf("Error creating service: %s", err) + return fmt.Errorf("[ERROR] Error creating service: %s", err) } d.SetId(service.Metadata.GUID) _, err = waitForServiceInstanceAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for create service (%s) to be succeeded: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for create service (%s) to be succeeded: %s", d.Id(), err) } return resourceIBMServiceInstanceRead(d, meta) } func resourceIBMServiceInstanceRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -189,15 +190,15 @@ func resourceIBMServiceInstanceRead(d *schema.ResourceData, meta interface{}) er service, err := cfClient.ServiceInstances().Get(serviceGUID, 1) if err != nil { - return fmt.Errorf("Error retrieving service: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service: %s", err) } servicePlanGUID := service.Entity.ServicePlanGUID d.Set("service_plan_guid", servicePlanGUID) d.Set("space_guid", service.Entity.SpaceGUID) serviceKeys := service.Entity.ServiceKeys - d.Set("service_keys", flattenServiceInstanceCredentials(serviceKeys)) - d.Set("credentials", Flatten(service.Entity.Credentials)) + d.Set("service_keys", flex.FlattenServiceInstanceCredentials(serviceKeys)) + d.Set("credentials", flex.Flatten(service.Entity.Credentials)) d.Set("tags", service.Entity.Tags) d.Set("name", service.Entity.Name) d.Set("dashboard_url", service.Entity.DashboardURL) @@ -214,7 +215,7 @@ func resourceIBMServiceInstanceRead(d *schema.ResourceData, meta interface{}) er } func resourceIBMServiceInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -231,12 +232,12 @@ func resourceIBMServiceInstanceUpdate(d *schema.ResourceData, meta interface{}) service := d.Get("service").(string) serviceOff, err := cfClient.ServiceOfferings().FindByLabel(service) if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) } servicePlan, err := cfClient.ServicePlans().FindPlanInServiceOffering(serviceOff.GUID, plan) if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) } updateReq.PlanGUID = helpers.String(servicePlan.GUID) @@ -253,20 +254,19 @@ func resourceIBMServiceInstanceUpdate(d *schema.ResourceData, meta interface{}) _, err = cfClient.ServiceInstances().Update(serviceGUID, updateReq) if err != nil { - return fmt.Errorf("Error updating service: %s", err) + return fmt.Errorf("[ERROR] Error updating service: %s", err) } _, err = waitForServiceInstanceAvailable(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for update service (%s) to be succeeded: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for update service (%s) to be succeeded: %s", d.Id(), err) } return resourceIBMServiceInstanceRead(d, meta) } func resourceIBMServiceInstanceDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -274,13 +274,12 @@ func resourceIBMServiceInstanceDelete(d *schema.ResourceData, meta interface{}) err = cfClient.ServiceInstances().Delete(id, true) if err != nil { - return fmt.Errorf("Error deleting service: %s", err) + return fmt.Errorf("[ERROR] Error deleting service: %s", err) } _, err = waitForServiceInstanceDelete(d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for service (%s) to be deleted: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for service (%s) to be deleted: %s", d.Id(), err) } d.SetId("") @@ -288,7 +287,7 @@ func resourceIBMServiceInstanceDelete(d *schema.ResourceData, meta interface{}) return nil } func resourceIBMServiceInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -324,7 +323,7 @@ func getServiceTags(d *schema.ResourceData) []string { } func waitForServiceInstanceAvailable(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -337,12 +336,12 @@ func waitForServiceInstanceAvailable(d *schema.ResourceData, meta interface{}) ( service, err := cfClient.ServiceInstances().Get(serviceGUID) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The service instance %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The service instance %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } if service.Entity.LastOperation.State == svcInstanceFailStatus { - return service, service.Entity.LastOperation.State, fmt.Errorf("The service instance %s failed: %v", d.Id(), err) + return service, service.Entity.LastOperation.State, fmt.Errorf("[ERROR] The service instance %s failed: %v", d.Id(), err) } return service, service.Entity.LastOperation.State, nil }, @@ -355,7 +354,7 @@ func waitForServiceInstanceAvailable(d *schema.ResourceData, meta interface{}) ( } func waitForServiceInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } @@ -372,7 +371,7 @@ func waitForServiceInstanceDelete(d *schema.ResourceData, meta interface{}) (int return nil, "", err } if service.Entity.LastOperation.State == svcInstanceFailStatus { - return service, service.Entity.LastOperation.State, fmt.Errorf("The service instance %s failed to delete: %v", d.Id(), err) + return service, service.Entity.LastOperation.State, fmt.Errorf("[ERROR] The service instance %s failed to delete: %v", d.Id(), err) } return service, service.Entity.LastOperation.State, nil }, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_service_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_service_key.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_service_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_service_key.go index 1c9bdc0272..db9c6001a2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_service_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_service_key.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudfoundry import ( "fmt" "strconv" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMServiceKey() *schema.Resource { +func ResourceIBMServiceKey() *schema.Resource { return &schema.Resource{ Create: resourceIBMServiceKeyCreate, Read: resourceIBMServiceKeyRead, @@ -57,7 +59,7 @@ func resourceIBMServiceKey() *schema.Resource { } func resourceIBMServiceKeyCreate(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -81,7 +83,7 @@ func resourceIBMServiceKeyCreate(d *schema.ResourceData, meta interface{}) error serviceKey, err := cfClient.ServiceKeys().Create(serviceInstanceGUID, name, keyParams) if err != nil { - return fmt.Errorf("Error creating service key: %s", err) + return fmt.Errorf("[ERROR] Error creating service key: %s", err) } d.SetId(serviceKey.Metadata.GUID) @@ -95,7 +97,7 @@ func resourceIBMServiceKeyUpdate(d *schema.ResourceData, meta interface{}) error } func resourceIBMServiceKeyRead(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -103,9 +105,9 @@ func resourceIBMServiceKeyRead(d *schema.ResourceData, meta interface{}) error { serviceKey, err := cfClient.ServiceKeys().Get(serviceKeyGUID) if err != nil { - return fmt.Errorf("Error retrieving service key: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service key: %s", err) } - d.Set("credentials", Flatten(serviceKey.Entity.Credentials)) + d.Set("credentials", flex.Flatten(serviceKey.Entity.Credentials)) d.Set("service_instance_guid", serviceKey.Entity.ServiceInstanceGUID) d.Set("name", serviceKey.Entity.Name) @@ -113,7 +115,7 @@ func resourceIBMServiceKeyRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMServiceKeyDelete(d *schema.ResourceData, meta interface{}) error { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return err } @@ -122,7 +124,7 @@ func resourceIBMServiceKeyDelete(d *schema.ResourceData, meta interface{}) error err = cfClient.ServiceKeys().Delete(serviceKeyGUID) if err != nil { - return fmt.Errorf("Error deleting service key: %s", err) + return fmt.Errorf("[ERROR] Error deleting service key: %s", err) } d.SetId("") @@ -131,7 +133,7 @@ func resourceIBMServiceKeyDelete(d *schema.ResourceData, meta interface{}) error } func resourceIBMServiceKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - cfClient, err := meta.(ClientSession).MccpAPI() + cfClient, err := meta.(conns.ClientSession).MccpAPI() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_space.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_space.go new file mode 100644 index 0000000000..3649e8a26d --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry/resource_ibm_space.go @@ -0,0 +1,352 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package cloudfoundry + +import ( + "fmt" + + "github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2" + "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMSpace() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMSpaceCreate, + Read: resourceIBMSpaceRead, + Update: resourceIBMSpaceUpdate, + Delete: resourceIBMSpaceDelete, + Exists: resourceIBMSpaceExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "The name for the space", + }, + "org": { + Description: "The org this space belongs to", + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "auditors": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have auditor role in this space, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + "managers": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have manager role in this space, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + "developers": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The IBMID of the users who will have developer role in this space, ex - user@example.com", + Set: flex.ResourceIBMVPCHash, + }, + "space_quota": { + Description: "The name of the Space Quota Definition", + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + }, + } +} + +func resourceIBMSpaceCreate(d *schema.ResourceData, meta interface{}) error { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + org := d.Get("org").(string) + name := d.Get("name").(string) + + req := mccpv2.SpaceCreateRequest{ + Name: name, + } + + orgFields, err := cfClient.Organizations().FindByName(org, conns.BluemixRegion) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving org: %s", err) + } + req.OrgGUID = orgFields.GUID + + if spaceQuota, ok := d.GetOk("space_quota"); ok { + quota, err := cfClient.SpaceQuotas().FindByName(spaceQuota.(string), orgFields.GUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving space quota: %s", err) + } + req.SpaceQuotaGUID = quota.GUID + } + + spaceAPI := cfClient.Spaces() + space, err := spaceAPI.Create(req) + if err != nil { + return fmt.Errorf("[ERROR] Error creating space: %s", err) + } + + spaceGUID := space.Metadata.GUID + d.SetId(spaceGUID) + + if developerSet := d.Get("developers").(*schema.Set); len(developerSet.List()) > 0 { + developers := flex.ExpandStringList(developerSet.List()) + for _, d := range developers { + _, err := spaceAPI.AssociateDeveloper(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating developer %s with space %s : %s", d, spaceGUID, err) + } + } + } + + if auditorSet := d.Get("auditors").(*schema.Set); len(auditorSet.List()) > 0 { + auditors := flex.ExpandStringList(auditorSet.List()) + for _, d := range auditors { + _, err := spaceAPI.AssociateAuditor(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating auditor %s with space %s : %s", d, spaceGUID, err) + } + } + + } + if managerSet := d.Get("managers").(*schema.Set); len(managerSet.List()) > 0 { + managers := flex.ExpandStringList(managerSet.List()) + for _, d := range managers { + _, err := spaceAPI.AssociateManager(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating manager %s with space %s : %s", d, spaceGUID, err) + } + } + } + + return resourceIBMSpaceRead(d, meta) +} + +func resourceIBMSpaceRead(d *schema.ResourceData, meta interface{}) error { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + spaceGUID := d.Id() + + spaceAPI := cfClient.Spaces() + orgAPI := cfClient.Organizations() + spaceDetails, err := spaceAPI.Get(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving space: %s", err) + } + + auditors, err := spaceAPI.ListAuditors(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving auditors in the space: %s", err) + } + + managers, err := spaceAPI.ListManagers(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving managers in the space: %s", err) + } + + developers, err := spaceAPI.ListDevelopers(spaceGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving developers in space: %s", err) + } + + d.Set("auditors", flex.FlattenSpaceRoleUsers(auditors)) + d.Set("managers", flex.FlattenSpaceRoleUsers(managers)) + d.Set("developers", flex.FlattenSpaceRoleUsers(developers)) + + if spaceDetails.Entity.SpaceQuotaGUID != "" { + sqAPI := cfClient.SpaceQuotas() + quota, err := sqAPI.Get(spaceDetails.Entity.SpaceQuotaGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving quotas details for space: %s", err) + } + d.Set("space_quota", quota.Entity.Name) + } + d.Set("name", spaceDetails.Entity.Name) + org, err := orgAPI.Get(spaceDetails.Entity.OrgGUID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving Organization details for space: %s", err) + } + d.Set("org", org.Entity.Name) + return nil +} + +func resourceIBMSpaceUpdate(d *schema.ResourceData, meta interface{}) error { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + id := d.Id() + + req := mccpv2.SpaceUpdateRequest{} + if d.HasChange("name") { + req.Name = helpers.String(d.Get("name").(string)) + } + + api := cfClient.Spaces() + _, err = api.Update(id, req) + if err != nil { + return fmt.Errorf("[ERROR] Error updating space: %s", err) + } + + err = updateAuditors(api, id, d) + if err != nil { + return err + } + err = updateManagers(api, id, d) + if err != nil { + return err + } + err = updateDevelopers(api, id, d) + if err != nil { + return err + } + return resourceIBMSpaceRead(d, meta) +} + +func resourceIBMSpaceDelete(d *schema.ResourceData, meta interface{}) error { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return err + } + id := d.Id() + + err = cfClient.Spaces().Delete(id, false) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting space: %s", err) + } + + d.SetId("") + return nil +} + +func resourceIBMSpaceExists(d *schema.ResourceData, meta interface{}) (bool, error) { + cfClient, err := meta.(conns.ClientSession).MccpAPI() + if err != nil { + return false, err + } + id := d.Id() + + space, err := cfClient.Spaces().Get(id) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok { + if apiErr.StatusCode() == 404 { + return false, nil + } + } + return false, fmt.Errorf("[ERROR] Error getting space: %s", err) + } + + return space.Metadata.GUID == id, nil +} + +func updateDevelopers(api mccpv2.Spaces, spaceGUID string, d *schema.ResourceData) error { + if !d.HasChange("developers") { + return nil + } + var remove, add []string + o, n := d.GetChange("developers") + os := o.(*schema.Set) + ns := n.(*schema.Set) + + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + + if len(add) > 0 { + for _, d := range add { + _, err := api.AssociateDeveloper(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating developer %s with space %s : %s", d, spaceGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateDeveloper(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating developer %s with space %s : %s", d, spaceGUID, err) + } + } + } + return nil +} + +func updateManagers(api mccpv2.Spaces, spaceGUID string, d *schema.ResourceData) error { + if !d.HasChange("managers") { + return nil + } + var remove, add []string + o, n := d.GetChange("managers") + os := o.(*schema.Set) + ns := n.(*schema.Set) + + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + + if len(add) > 0 { + for _, d := range add { + _, err := api.AssociateManager(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating manager %s with space %s : %s", d, spaceGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateManager(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating manager %s with space %s : %s", d, spaceGUID, err) + } + } + } + return nil +} +func updateAuditors(api mccpv2.Spaces, spaceGUID string, d *schema.ResourceData) error { + if !d.HasChange("auditors") { + return nil + } + var remove, add []string + o, n := d.GetChange("auditors") + os := o.(*schema.Set) + ns := n.(*schema.Set) + + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) + + if len(add) > 0 { + for _, d := range add { + _, err := api.AssociateAuditor(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error associating auditor %s with space %s : %s", d, spaceGUID, err) + } + } + } + if len(remove) > 0 { + for _, d := range remove { + err := api.DisassociateAuditor(spaceGUID, d) + if err != nil { + return fmt.Errorf("[ERROR] Error dis-associating auditor %s with space %s : %s", d, spaceGUID, err) + } + } + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/README.md new file mode 100644 index 0000000000..93da9f96d1 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Cloud Shell + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Cloud Shell resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cloud_shell_account_settings) +* IBM API Docs: [IBM API Docs for Cloud Shell](https://cloud.ibm.com/apidocs/cloudshell) +* IBM Cloud Shell SDK: [IBM SDK for Cloud Shell](https://github.com/IBM/platform-services-go-sdk/tree/main/ibmcloudshellv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cloud_shell_account_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/data_source_ibm_cloud_shell_account_settings.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cloud_shell_account_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/data_source_ibm_cloud_shell_account_settings.go index fd45c246e2..222f433199 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cloud_shell_account_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/data_source_ibm_cloud_shell_account_settings.go @@ -1,71 +1,73 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudshell import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/ibmcloudshellv1" ) -func dataSourceIBMCloudShellAccountSettings() *schema.Resource { +func DataSourceIBMCloudShellAccountSettings() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMCloudShellAccountSettingsRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Required: true, Description: "The account ID in which the account settings belong to.", }, - "rev": &schema.Schema{ + "rev": { Type: schema.TypeString, Computed: true, Description: "Unique revision number for the settings object.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeInt, Computed: true, Description: "Creation timestamp in Unix epoch time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "IAM ID of creator.", }, - "default_enable_new_features": &schema.Schema{ + "default_enable_new_features": { Type: schema.TypeBool, Computed: true, Description: "You can choose which Cloud Shell features are available in the account and whether any new features are enabled as they become available. The feature settings apply only to the enabled Cloud Shell locations.", }, - "default_enable_new_regions": &schema.Schema{ + "default_enable_new_regions": { Type: schema.TypeBool, Computed: true, Description: "Set whether Cloud Shell is enabled in a specific location for the account. The location determines where user and session data are stored. By default, users are routed to the nearest available location.", }, - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "When enabled, Cloud Shell is available to all users in the account.", }, - "features": &schema.Schema{ + "features": { Type: schema.TypeList, Computed: true, Description: "List of Cloud Shell features.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "State of the feature.", }, - "key": &schema.Schema{ + "key": { Type: schema.TypeString, Computed: true, Description: "Name of the feature.", @@ -73,18 +75,18 @@ func dataSourceIBMCloudShellAccountSettings() *schema.Resource { }, }, }, - "regions": &schema.Schema{ + "regions": { Type: schema.TypeList, Computed: true, Description: "List of Cloud Shell region settings.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "State of the region.", }, - "key": &schema.Schema{ + "key": { Type: schema.TypeString, Computed: true, Description: "Name of the region.", @@ -92,17 +94,17 @@ func dataSourceIBMCloudShellAccountSettings() *schema.Resource { }, }, }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of api response object.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeInt, Computed: true, Description: "Timestamp of last update in Unix epoch time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "IAM ID of last updater.", @@ -112,7 +114,7 @@ func dataSourceIBMCloudShellAccountSettings() *schema.Resource { } func dataSourceIBMCloudShellAccountSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - ibmCloudShellClient, err := meta.(ClientSession).IBMCloudShellV1() + ibmCloudShellClient, err := meta.(conns.ClientSession).IBMCloudShellV1() if err != nil { return diag.FromErr(err) } @@ -129,45 +131,45 @@ func dataSourceIBMCloudShellAccountSettingsRead(context context.Context, d *sche d.SetId(*accountSettings.AccountID) if err = d.Set("rev", accountSettings.Rev); err != nil { - return diag.FromErr(fmt.Errorf("Error setting rev: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting rev: %s", err)) } - if err = d.Set("created_at", intValue(accountSettings.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.IntValue(accountSettings.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", accountSettings.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if err = d.Set("default_enable_new_features", accountSettings.DefaultEnableNewFeatures); err != nil { - return diag.FromErr(fmt.Errorf("Error setting default_enable_new_features: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting default_enable_new_features: %s", err)) } if err = d.Set("default_enable_new_regions", accountSettings.DefaultEnableNewRegions); err != nil { - return diag.FromErr(fmt.Errorf("Error setting default_enable_new_regions: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting default_enable_new_regions: %s", err)) } if err = d.Set("enabled", accountSettings.Enabled); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enabled: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enabled: %s", err)) } if accountSettings.Features != nil { err = d.Set("features", dataSourceAccountSettingsFlattenFeatures(accountSettings.Features)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting features %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting features %s", err)) } } if accountSettings.Regions != nil { err = d.Set("regions", dataSourceAccountSettingsFlattenRegions(accountSettings.Regions)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting regions %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting regions %s", err)) } } if err = d.Set("type", accountSettings.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } - if err = d.Set("updated_at", intValue(accountSettings.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.IntValue(accountSettings.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", accountSettings.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cloud_shell_account_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/resource_ibm_cloud_shell_account_settings.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cloud_shell_account_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/resource_ibm_cloud_shell_account_settings.go index 3d31a8c6b4..e64c200758 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cloud_shell_account_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell/resource_ibm_cloud_shell_account_settings.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cloudshell import ( "context" "fmt" "log" + "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +18,7 @@ import ( "github.com/IBM/platform-services-go-sdk/ibmcloudshellv1" ) -func resourceIBMCloudShellAccountSettings() *schema.Resource { +func ResourceIBMCloudShellAccountSettings() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMCloudShellAccountSettingsCreate, ReadContext: resourceIBMCloudShellAccountSettingsRead, @@ -54,6 +57,7 @@ func resourceIBMCloudShellAccountSettings() *schema.Resource { "features": { Type: schema.TypeList, Optional: true, + Computed: true, Description: "List of Cloud Shell features.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -73,6 +77,7 @@ func resourceIBMCloudShellAccountSettings() *schema.Resource { "regions": { Type: schema.TypeList, Optional: true, + Computed: true, Description: "List of Cloud Shell region settings.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -119,7 +124,7 @@ func resourceIBMCloudShellAccountSettings() *schema.Resource { } func resourceIBMCloudShellAccountSettingsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - ibmCloudShellClient, err := meta.(ClientSession).IBMCloudShellV1() + ibmCloudShellClient, err := meta.(conns.ClientSession).IBMCloudShellV1() if err != nil { return diag.FromErr(err) } @@ -196,14 +201,14 @@ func resourceIBMCloudShellAccountSettingsMapToRegionSetting(regionSettingMap map } func resourceIBMCloudShellAccountSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - ibmCloudShellClient, err := meta.(ClientSession).IBMCloudShellV1() + ibmCloudShellClient, err := meta.(conns.ClientSession).IBMCloudShellV1() if err != nil { return diag.FromErr(err) } getAccountSettingsOptions := &ibmcloudshellv1.GetAccountSettingsOptions{} - getAccountSettingsOptions.SetAccountID(d.Id()) + getAccountSettingsOptions.SetAccountID(strings.TrimPrefix(d.Id(), "ac-")) accountSettings, response, err := ibmCloudShellClient.GetAccountSettingsWithContext(context, getAccountSettingsOptions) if err != nil { @@ -250,7 +255,7 @@ func resourceIBMCloudShellAccountSettingsRead(context context.Context, d *schema return diag.FromErr(fmt.Errorf("[ERROR] Error setting regions: %s", err)) } } - if err = d.Set("created_at", intValue(accountSettings.CreatedAt)); err != nil { + if err = d.Set("created_at", flex.IntValue(accountSettings.CreatedAt)); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", accountSettings.CreatedBy); err != nil { @@ -259,7 +264,7 @@ func resourceIBMCloudShellAccountSettingsRead(context context.Context, d *schema if err = d.Set("type", accountSettings.Type); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } - if err = d.Set("updated_at", intValue(accountSettings.UpdatedAt)); err != nil { + if err = d.Set("updated_at", flex.IntValue(accountSettings.UpdatedAt)); err != nil { return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", accountSettings.UpdatedBy); err != nil { @@ -296,14 +301,14 @@ func resourceIBMCloudShellAccountSettingsRegionSettingToMap(regionSetting ibmclo } func resourceIBMCloudShellAccountSettingsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - ibmCloudShellClient, err := meta.(ClientSession).IBMCloudShellV1() + ibmCloudShellClient, err := meta.(conns.ClientSession).IBMCloudShellV1() if err != nil { return diag.FromErr(err) } updateAccountSettingsOptions := &ibmcloudshellv1.UpdateAccountSettingsOptions{} - updateAccountSettingsOptions.SetAccountID(d.Id()) + updateAccountSettingsOptions.SetAccountID(strings.TrimPrefix(d.Id(), "ac-")) hasChange := false updateAccountSettingsOptions.SetRev(d.Get("rev").(string)) if d.HasChange("default_enable_new_features") { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/README.md new file mode 100644 index 0000000000..7385146c6f --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Context Based Restrictions + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Context Based Restrictions resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cbr_rule) +* IBM API Docs: [IBM API Docs for Context Based Restrictions](https://cloud.ibm.com/apidocs/context-based-restrictions) +* IBM Context Based Restrictions SDK: [IBM SDK for Context Based Restrictions](https://github.com/IBM/platform-services-go-sdk/tree/main/contextbasedrestrictionsv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cbr_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/data_source_ibm_cbr_rule.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cbr_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/data_source_ibm_cbr_rule.go index 8d37eb1e96..fe73b8316c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cbr_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/data_source_ibm_cbr_rule.go @@ -1,57 +1,59 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package contextbasedrestrictions import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1" ) -func dataSourceIBMCbrRule() *schema.Resource { +func DataSourceIBMCbrRule() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMCbrRuleRead, Schema: map[string]*schema.Schema{ - "rule_id": &schema.Schema{ + "rule_id": { Type: schema.TypeString, Required: true, Description: "The ID of a rule.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The rule CRN.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the rule.", }, - "contexts": &schema.Schema{ + "contexts": { Type: schema.TypeList, Computed: true, Description: "The contexts this rule applies to.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "attributes": &schema.Schema{ + "attributes": { Type: schema.TypeList, Computed: true, Description: "The attributes.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The attribute name.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The attribute value.", @@ -62,29 +64,29 @@ func dataSourceIBMCbrRule() *schema.Resource { }, }, }, - "resources": &schema.Schema{ + "resources": { Type: schema.TypeList, Computed: true, Description: "The resources this rule apply to.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "attributes": &schema.Schema{ + "attributes": { Type: schema.TypeList, Computed: true, Description: "The resource attributes.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The attribute name.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The attribute value.", }, - "operator": &schema.Schema{ + "operator": { Type: schema.TypeString, Computed: true, Description: "The attribute operator.", @@ -92,23 +94,23 @@ func dataSourceIBMCbrRule() *schema.Resource { }, }, }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Computed: true, Description: "The optional resource tags.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The tag attribute name.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The tag attribute value.", }, - "operator": &schema.Schema{ + "operator": { Type: schema.TypeString, Computed: true, Description: "The attribute operator.", @@ -119,27 +121,27 @@ func dataSourceIBMCbrRule() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The href link to the resource.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time the resource was created.", }, - "created_by_id": &schema.Schema{ + "created_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which created the resource.", }, - "last_modified_at": &schema.Schema{ + "last_modified_at": { Type: schema.TypeString, Computed: true, Description: "The last time the resource was modified.", }, - "last_modified_by_id": &schema.Schema{ + "last_modified_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which modified the resource.", @@ -149,7 +151,7 @@ func dataSourceIBMCbrRule() *schema.Resource { } func dataSourceIBMCbrRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -164,41 +166,41 @@ func dataSourceIBMCbrRuleRead(context context.Context, d *schema.ResourceData, m return diag.FromErr(fmt.Errorf("GetRuleWithContext failed %s\n%s", err, response)) } - d.SetId(fmt.Sprintf("%s", *getRuleOptions.RuleID)) + d.SetId(*getRuleOptions.RuleID) if err = d.Set("crn", rule.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("description", rule.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if rule.Contexts != nil { err = d.Set("contexts", dataSourceRuleFlattenContexts(rule.Contexts)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting contexts %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting contexts %s", err)) } } if rule.Resources != nil { err = d.Set("resources", dataSourceRuleFlattenResources(rule.Resources)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resources %s", err)) } } if err = d.Set("href", rule.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } - if err = d.Set("created_at", dateTimeToString(rule.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(rule.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by_id", rule.CreatedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by_id: %s", err)) } - if err = d.Set("last_modified_at", dateTimeToString(rule.LastModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_at: %s", err)) + if err = d.Set("last_modified_at", flex.DateTimeToString(rule.LastModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_at: %s", err)) } if err = d.Set("last_modified_by_id", rule.LastModifiedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_by_id: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cbr_zone.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/data_source_ibm_cbr_zone.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cbr_zone.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/data_source_ibm_cbr_zone.go index 0c17549151..db9ba1f726 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cbr_zone.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/data_source_ibm_cbr_zone.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package contextbasedrestrictions import ( "context" @@ -9,95 +9,97 @@ import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1" ) -func dataSourceIBMCbrZone() *schema.Resource { +func DataSourceIBMCbrZone() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMCbrZoneRead, Schema: map[string]*schema.Schema{ - "zone_id": &schema.Schema{ + "zone_id": { Type: schema.TypeString, Required: true, Description: "The ID of a zone.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The globally unique ID of the zone.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The zone CRN.", }, - "address_count": &schema.Schema{ + "address_count": { Type: schema.TypeInt, Computed: true, Description: "The number of addresses in the zone.", }, - "excluded_count": &schema.Schema{ + "excluded_count": { Type: schema.TypeInt, Computed: true, Description: "The number of excluded addresses in the zone.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the zone.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The id of the account owning this zone.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the zone.", }, - "addresses": &schema.Schema{ + "addresses": { Type: schema.TypeList, Computed: true, Description: "The list of addresses in the zone.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of address.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The IP address.", }, - "ref": &schema.Schema{ + "ref": { Type: schema.TypeList, Computed: true, Description: "A service reference value.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The id of the account owning the service.", }, - "service_type": &schema.Schema{ + "service_type": { Type: schema.TypeString, Computed: true, Description: "The service type.", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Computed: true, Description: "The service name.", }, - "service_instance": &schema.Schema{ + "service_instance": { Type: schema.TypeString, Computed: true, Description: "The service instance.", @@ -108,44 +110,44 @@ func dataSourceIBMCbrZone() *schema.Resource { }, }, }, - "excluded": &schema.Schema{ + "excluded": { Type: schema.TypeList, Computed: true, Description: "The list of excluded addresses in the zone.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of address.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The IP address.", }, - "ref": &schema.Schema{ + "ref": { Type: schema.TypeList, Computed: true, Description: "A service reference value.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The id of the account owning the service.", }, - "service_type": &schema.Schema{ + "service_type": { Type: schema.TypeString, Computed: true, Description: "The service type.", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Computed: true, Description: "The service name.", }, - "service_instance": &schema.Schema{ + "service_instance": { Type: schema.TypeString, Computed: true, Description: "The service instance.", @@ -156,27 +158,27 @@ func dataSourceIBMCbrZone() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The href link to the resource.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time the resource was created.", }, - "created_by_id": &schema.Schema{ + "created_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which created the resource.", }, - "last_modified_at": &schema.Schema{ + "last_modified_at": { Type: schema.TypeString, Computed: true, Description: "The last time the resource was modified.", }, - "last_modified_by_id": &schema.Schema{ + "last_modified_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which modified the resource.", @@ -186,7 +188,7 @@ func dataSourceIBMCbrZone() *schema.Resource { } func dataSourceIBMCbrZoneRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -201,56 +203,56 @@ func dataSourceIBMCbrZoneRead(context context.Context, d *schema.ResourceData, m return diag.FromErr(fmt.Errorf("GetZoneWithContext failed %s\n%s", err, response)) } - d.SetId(fmt.Sprintf("%s", *getZoneOptions.ZoneID)) + d.SetId(*getZoneOptions.ZoneID) if err = d.Set("id", zone.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } if err = d.Set("crn", zone.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } - if err = d.Set("address_count", intValue(zone.AddressCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting address_count: %s", err)) + if err = d.Set("address_count", flex.IntValue(zone.AddressCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting address_count: %s", err)) } - if err = d.Set("excluded_count", intValue(zone.ExcludedCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting excluded_count: %s", err)) + if err = d.Set("excluded_count", flex.IntValue(zone.ExcludedCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting excluded_count: %s", err)) } if err = d.Set("name", zone.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("account_id", zone.AccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) } if err = d.Set("description", zone.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if zone.Addresses != nil { err = d.Set("addresses", dataSourceZoneFlattenAddresses(zone.Addresses)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting addresses %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting addresses %s", err)) } } if zone.Excluded != nil { err = d.Set("excluded", dataSourceZoneFlattenExcluded(zone.Excluded)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting excluded %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting excluded %s", err)) } } if err = d.Set("href", zone.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } - if err = d.Set("created_at", dateTimeToString(zone.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(zone.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by_id", zone.CreatedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by_id: %s", err)) } - if err = d.Set("last_modified_at", dateTimeToString(zone.LastModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_at: %s", err)) + if err = d.Set("last_modified_at", flex.DateTimeToString(zone.LastModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_at: %s", err)) } if err = d.Set("last_modified_by_id", zone.LastModifiedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_by_id: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cbr_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/resource_ibm_cbr_rule.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cbr_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/resource_ibm_cbr_rule.go index 60a197a7be..5745874d24 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cbr_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/resource_ibm_cbr_rule.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package contextbasedrestrictions import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +18,7 @@ import ( "github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1" ) -func resourceIBMCbrRule() *schema.Resource { +func ResourceIBMCbrRule() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMCbrRuleCreate, ReadContext: resourceIBMCbrRuleRead, @@ -24,30 +27,30 @@ func resourceIBMCbrRule() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_cbr_rule", "description"), + ValidateFunc: validate.InvokeValidator("ibm_cbr_rule", "description"), Description: "The description of the rule.", }, - "contexts": &schema.Schema{ + "contexts": { Type: schema.TypeList, Required: true, Description: "The contexts this rule applies to.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "attributes": &schema.Schema{ + "attributes": { Type: schema.TypeList, Required: true, Description: "The attributes.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The attribute name.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "The attribute value.", @@ -58,29 +61,29 @@ func resourceIBMCbrRule() *schema.Resource { }, }, }, - "resources": &schema.Schema{ + "resources": { Type: schema.TypeList, Required: true, Description: "The resources this rule apply to.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "attributes": &schema.Schema{ + "attributes": { Type: schema.TypeList, Required: true, Description: "The resource attributes.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The attribute name.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "The attribute value.", }, - "operator": &schema.Schema{ + "operator": { Type: schema.TypeString, Optional: true, Description: "The attribute operator.", @@ -88,23 +91,23 @@ func resourceIBMCbrRule() *schema.Resource { }, }, }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, Description: "The optional resource tags.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The tag attribute name.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "The tag attribute value.", }, - "operator": &schema.Schema{ + "operator": { Type: schema.TypeString, Optional: true, Description: "The attribute operator.", @@ -115,37 +118,37 @@ func resourceIBMCbrRule() *schema.Resource { }, }, }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The rule CRN.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The href link to the resource.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time the resource was created.", }, - "created_by_id": &schema.Schema{ + "created_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which created the resource.", }, - "last_modified_at": &schema.Schema{ + "last_modified_at": { Type: schema.TypeString, Computed: true, Description: "The last time the resource was modified.", }, - "last_modified_by_id": &schema.Schema{ + "last_modified_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which modified the resource.", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeString, Computed: true, }, @@ -153,13 +156,13 @@ func resourceIBMCbrRule() *schema.Resource { } } -func resourceIBMCbrRuleValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMCbrRuleValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "description", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[\x20-\xFE]*$`, MinValueLength: 0, @@ -167,12 +170,12 @@ func resourceIBMCbrRuleValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_cbr_rule", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_cbr_rule", Schema: validateSchema} return &resourceValidator } func resourceIBMCbrRuleCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -304,7 +307,7 @@ func resourceIBMCbrRuleMapToResourceTagAttribute(resourceTagAttributeMap map[str } func resourceIBMCbrRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -324,7 +327,7 @@ func resourceIBMCbrRuleRead(context context.Context, d *schema.ResourceData, met } if err = d.Set("description", rule.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if rule.Contexts != nil { contexts := []map[string]interface{}{} @@ -333,7 +336,7 @@ func resourceIBMCbrRuleRead(context context.Context, d *schema.ResourceData, met contexts = append(contexts, contextsItemMap) } if err = d.Set("contexts", contexts); err != nil { - return diag.FromErr(fmt.Errorf("Error setting contexts: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting contexts: %s", err)) } } if rule.Resources != nil { @@ -343,29 +346,29 @@ func resourceIBMCbrRuleRead(context context.Context, d *schema.ResourceData, met resources = append(resources, resourcesItemMap) } if err = d.Set("resources", resources); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resources: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resources: %s", err)) } } if err = d.Set("crn", rule.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("href", rule.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } - if err = d.Set("created_at", dateTimeToString(rule.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(rule.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by_id", rule.CreatedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by_id: %s", err)) } - if err = d.Set("last_modified_at", dateTimeToString(rule.LastModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_at: %s", err)) + if err = d.Set("last_modified_at", flex.DateTimeToString(rule.LastModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_at: %s", err)) } if err = d.Set("last_modified_by_id", rule.LastModifiedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_by_id: %s", err)) } if err = d.Set("version", response.Headers.Get("Etag")); err != nil { - return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) } return nil @@ -445,7 +448,7 @@ func resourceIBMCbrRuleResourceTagAttributeToMap(resourceTagAttribute contextbas } func resourceIBMCbrRuleUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -492,7 +495,7 @@ func resourceIBMCbrRuleUpdate(context context.Context, d *schema.ResourceData, m } func resourceIBMCbrRuleDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cbr_zone.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/resource_ibm_cbr_zone.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cbr_zone.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/resource_ibm_cbr_zone.go index b998ca47ff..311c70376c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cbr_zone.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions/resource_ibm_cbr_zone.go @@ -1,21 +1,25 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package contextbasedrestrictions import ( "context" "encoding/json" "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "log" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1" ) -func resourceIBMCbrZone() *schema.Resource { +func ResourceIBMCbrZone() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMCbrZoneCreate, ReadContext: resourceIBMCbrZoneRead, @@ -24,62 +28,62 @@ func resourceIBMCbrZone() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_cbr_zone", "name"), + ValidateFunc: validate.InvokeValidator("ibm_cbr_zone", "name"), Description: "The name of the zone.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The id of the account owning this zone.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_cbr_zone", "description"), + ValidateFunc: validate.InvokeValidator("ibm_cbr_zone", "description"), Description: "The description of the zone.", }, - "addresses": &schema.Schema{ + "addresses": { Type: schema.TypeList, Required: true, Description: "The list of addresses in the zone.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "The type of address.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "The IP address.", }, - "ref": &schema.Schema{ + "ref": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "A service reference value.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The id of the account owning the service.", }, - "service_type": &schema.Schema{ + "service_type": { Type: schema.TypeString, Optional: true, Description: "The service type.", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Optional: true, Description: "The service name.", }, - "service_instance": &schema.Schema{ + "service_instance": { Type: schema.TypeString, Optional: true, Description: "The service instance.", @@ -90,45 +94,45 @@ func resourceIBMCbrZone() *schema.Resource { }, }, }, - "excluded": &schema.Schema{ + "excluded": { Type: schema.TypeList, Optional: true, Description: "The list of excluded addresses in the zone. Only addresses of type `ipAddress`, `ipRange`, and `subnet` can be excluded.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "The type of address.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "The IP address.", }, - "ref": &schema.Schema{ + "ref": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "A service reference value.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The id of the account owning the service.", }, - "service_type": &schema.Schema{ + "service_type": { Type: schema.TypeString, Optional: true, Description: "The service type.", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Optional: true, Description: "The service name.", }, - "service_instance": &schema.Schema{ + "service_instance": { Type: schema.TypeString, Optional: true, Description: "The service instance.", @@ -139,47 +143,47 @@ func resourceIBMCbrZone() *schema.Resource { }, }, }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The zone CRN.", }, - "address_count": &schema.Schema{ + "address_count": { Type: schema.TypeInt, Computed: true, Description: "The number of addresses in the zone.", }, - "excluded_count": &schema.Schema{ + "excluded_count": { Type: schema.TypeInt, Computed: true, Description: "The number of excluded addresses in the zone.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The href link to the resource.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time the resource was created.", }, - "created_by_id": &schema.Schema{ + "created_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which created the resource.", }, - "last_modified_at": &schema.Schema{ + "last_modified_at": { Type: schema.TypeString, Computed: true, Description: "The last time the resource was modified.", }, - "last_modified_by_id": &schema.Schema{ + "last_modified_by_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which modified the resource.", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeString, Computed: true, }, @@ -187,22 +191,22 @@ func resourceIBMCbrZone() *schema.Resource { } } -func resourceIBMCbrZoneValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMCbrZoneValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[a-zA-Z0-9 \\-_]+$`, MinValueLength: 1, MaxValueLength: 128, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "description", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[\x20-\xFE]*$`, MinValueLength: 0, @@ -210,22 +214,22 @@ func resourceIBMCbrZoneValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_cbr_zone", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_cbr_zone", Schema: validateSchema} return &resourceValidator } func getIBMCbrAccountId(meta interface{}) (string, error) { - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return "", err } else { - return userDetails.userAccount, nil + return userDetails.UserAccount, nil } } func resourceIBMCbrZoneCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -378,7 +382,7 @@ func resourceIBMCbrZoneMapToAddressVPC(addressVPCMap map[string]interface{}) con } func resourceIBMCbrZoneRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -403,11 +407,11 @@ func resourceIBMCbrZoneRead(context context.Context, d *schema.ResourceData, met } if err = d.Set("name", zone.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", zone.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if zone.Addresses != nil { @@ -418,7 +422,7 @@ func resourceIBMCbrZoneRead(context context.Context, d *schema.ResourceData, met } if err = d.Set("addresses", addresses); err != nil { - return diag.FromErr(fmt.Errorf("Error setting addresses: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting addresses: %s", err)) } } @@ -429,35 +433,35 @@ func resourceIBMCbrZoneRead(context context.Context, d *schema.ResourceData, met excluded = append(excluded, excludedItemMap) } if err = d.Set("excluded", excluded); err != nil { - return diag.FromErr(fmt.Errorf("Error setting excluded: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting excluded: %s", err)) } } if err = d.Set("crn", zone.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } - if err = d.Set("address_count", intValue(zone.AddressCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting address_count: %s", err)) + if err = d.Set("address_count", flex.IntValue(zone.AddressCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting address_count: %s", err)) } - if err = d.Set("excluded_count", intValue(zone.ExcludedCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting excluded_count: %s", err)) + if err = d.Set("excluded_count", flex.IntValue(zone.ExcludedCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting excluded_count: %s", err)) } if err = d.Set("href", zone.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } - if err = d.Set("created_at", dateTimeToString(zone.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(zone.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by_id", zone.CreatedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by_id: %s", err)) } - if err = d.Set("last_modified_at", dateTimeToString(zone.LastModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_at: %s", err)) + if err = d.Set("last_modified_at", flex.DateTimeToString(zone.LastModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_at: %s", err)) } if err = d.Set("last_modified_by_id", zone.LastModifiedByID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_modified_by_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_modified_by_id: %s", err)) } if err = d.Set("version", response.Headers.Get("Etag")); err != nil { - return diag.FromErr(fmt.Errorf("Error setting version: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) } return nil @@ -566,7 +570,7 @@ func resourceIBMCbrZoneAddressVPCToMap(addressVPC contextbasedrestrictionsv1.Add } func resourceIBMCbrZoneUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } @@ -618,7 +622,7 @@ func resourceIBMCbrZoneUpdate(context context.Context, d *schema.ResourceData, m } func resourceIBMCbrZoneDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - contextBasedRestrictionsClient, err := meta.(ClientSession).ContextBasedRestrictionsV1() + contextBasedRestrictionsClient, err := meta.(conns.ClientSession).ContextBasedRestrictionsV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/README.md new file mode 100644 index 0000000000..98644d0cd8 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/README.md @@ -0,0 +1,13 @@ +# Terraform IBM Provider Object Storage + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the COS resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cos_bucket) +* IBM API Docs: [IBM API Docs for COS](https://cloud.ibm.com/apidocs/cos/cos-compatibility) +* IBM API Docs: [IBM API Docs for COS Config](https://cloud.ibm.com/apidocs/cos/cos-configuration) +* IBM COS SDK: [IBM SDK for COS Config](github.com/IBM/ibm-cos-sdk-go-config) +* IBM COS SDK: [IBM SDK for COS](https://github.com/IBM/ibm-cos-sdk-go/) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cos_bucket.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/data_source_ibm_cos_bucket.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cos_bucket.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/data_source_ibm_cos_bucket.go index 49afe31909..d16f40b28b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cos_bucket.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/data_source_ibm_cos_bucket.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cos import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1" "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam" @@ -19,7 +22,7 @@ import ( var bucketTypes = []string{"single_site_location", "region_location", "cross_region_location"} -func dataSourceIBMCosBucket() *schema.Resource { +func DataSourceIBMCosBucket() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMCosBucketRead, @@ -30,7 +33,7 @@ func dataSourceIBMCosBucket() *schema.Resource { }, "bucket_type": { Type: schema.TypeString, - ValidateFunc: validateAllowedStringValue(bucketTypes), + ValidateFunc: validate.ValidateAllowedStringValues(bucketTypes), Required: true, }, "bucket_region": { @@ -44,7 +47,7 @@ func dataSourceIBMCosBucket() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "direct"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "direct"}), Description: "public or private", Default: "public", }, @@ -316,7 +319,7 @@ func dataSourceIBMCosBucket() *schema.Resource { func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error { var s3Conf *aws.Config - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } @@ -325,16 +328,16 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error bucketType := d.Get("bucket_type").(string) bucketRegion := d.Get("bucket_region").(string) var endpointType = d.Get("endpoint_type").(string) - apiEndpoint, apiEndpointPrivate, directApiEndpoint := selectCosApi(bucketLocationConvert(bucketType), bucketRegion) + apiEndpoint, apiEndpointPrivate, directApiEndpoint := SelectCosApi(bucketLocationConvert(bucketType), bucketRegion) if endpointType == "private" { apiEndpoint = apiEndpointPrivate } if endpointType == "direct" { apiEndpoint = directApiEndpoint } - apiEndpoint = envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) + apiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) if apiEndpoint == "" { - return fmt.Errorf("The endpoint doesn't exists for given location %s and endpoint type %s", bucketRegion, endpointType) + return fmt.Errorf("[ERROR] The endpoint doesn't exists for given location %s and endpoint type %s", bucketRegion, endpointType) } authEndpoint, err := rsConClient.Config.EndpointLocator.IAMEndpoint() if err != nil { @@ -409,7 +412,7 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error Bucket: &bucketName, } - sess, err := meta.(ClientSession).CosConfigV1API() + sess, err := meta.(conns.ClientSession).CosConfigV1API() if err != nil { return err } @@ -420,19 +423,19 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error bucketPtr, response, err := sess.GetBucketConfig(getBucketConfigOptions) if err != nil { - return fmt.Errorf("Error in getting bucket info rule: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in getting bucket info rule: %s\n%s", err, response) } if bucketPtr != nil { if bucketPtr.Firewall != nil { - d.Set("allowed_ip", flattenStringList(bucketPtr.Firewall.AllowedIp)) + d.Set("allowed_ip", flex.FlattenStringList(bucketPtr.Firewall.AllowedIp)) } if bucketPtr.ActivityTracking != nil { - d.Set("activity_tracking", flattenActivityTrack(bucketPtr.ActivityTracking)) + d.Set("activity_tracking", flex.FlattenActivityTrack(bucketPtr.ActivityTracking)) } if bucketPtr.MetricsMonitoring != nil { - d.Set("metrics_monitoring", flattenMetricsMonitor(bucketPtr.MetricsMonitoring)) + d.Set("metrics_monitoring", flex.FlattenMetricsMonitor(bucketPtr.MetricsMonitoring)) } if bucketPtr.HardQuota != nil { d.Set("hard_quota", bucketPtr.HardQuota) @@ -454,10 +457,10 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error if lifecycleptr != nil { if len(lifecycleptr.Rules) > 0 { - archiveRules := archiveRuleGet(lifecycleptr.Rules) - expireRules := expireRuleGet(lifecycleptr.Rules) - nc_expRules := nc_exp_RuleGet(lifecycleptr.Rules) - abort_mpuRules := abort_mpu_RuleGet(lifecycleptr.Rules) + archiveRules := flex.ArchiveRuleGet(lifecycleptr.Rules) + expireRules := flex.ExpireRuleGet(lifecycleptr.Rules) + nc_expRules := flex.Nc_exp_RuleGet(lifecycleptr.Rules) + abort_mpuRules := flex.Abort_mpu_RuleGet(lifecycleptr.Rules) if len(archiveRules) > 0 { d.Set("archive_rule", archiveRules) } @@ -484,7 +487,7 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error } if retentionptr != nil { - retentionRules := retentionRuleGet(retentionptr.ProtectionConfiguration) + retentionRules := flex.RetentionRuleGet(retentionptr.ProtectionConfiguration) if len(retentionRules) > 0 { d.Set("retention_rule", retentionRules) } @@ -500,7 +503,7 @@ func dataSourceIBMCosBucketRead(d *schema.ResourceData, meta interface{}) error return err } if versionPtr != nil { - versioningData := flattenCosObejctVersioning(versionPtr) + versioningData := flex.FlattenCosObejctVersioning(versionPtr) if len(versioningData) > 0 { d.Set("object_versioning", versioningData) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cos_bucket_object.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/data_source_ibm_cos_bucket_object.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cos_bucket_object.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/data_source_ibm_cos_bucket_object.go index 6eb1f409bf..9fc057e887 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cos_bucket_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/data_source_ibm_cos_bucket_object.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cos import ( "bytes" @@ -11,13 +11,15 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/IBM/ibm-cos-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMCosBucketObject() *schema.Resource { +func DataSourceIBMCosBucketObject() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMCosBucketObjectRead, @@ -50,7 +52,7 @@ func dataSourceIBMCosBucketObject() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "direct"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "direct"}), Description: "COS endpoint type: public, private, direct", Default: "public", }, @@ -89,7 +91,7 @@ func dataSourceIBMCosBucketObjectRead(ctx context.Context, d *schema.ResourceDat bucketLocation := d.Get("bucket_location").(string) endpointType := d.Get("endpoint_type").(string) - bxSession, err := m.(ClientSession).BluemixSession() + bxSession, err := m.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cos_bucket.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/resource_ibm_cos_bucket.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cos_bucket.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/resource_ibm_cos_bucket.go index 522c9ea384..df323220b8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cos_bucket.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/resource_ibm_cos_bucket.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cos import ( "context" @@ -11,6 +11,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1" "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam" @@ -46,7 +49,11 @@ const ( keyAlgorithm = "AES256" ) -func resourceIBMCOSBucket() *schema.Resource { +func caseDiffSuppress(_, old, new string, _ *schema.ResourceData) bool { + return strings.ToUpper(old) == strings.ToUpper(new) +} + +func ResourceIBMCOSBucket() *schema.Resource { return &schema.Resource{ Read: resourceIBMCOSBucketRead, Create: resourceIBMCOSBucketCreate, @@ -73,7 +80,7 @@ func resourceIBMCOSBucket() *schema.Resource { Required: true, ForceNew: true, Description: "resource instance ID", - ValidateFunc: validateRegexp(`^crn:.+:.+:.+:.+:.+:a\/[0-9a-f]{32}:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\:\:$`), + ValidateFunc: validate.ValidateRegexps(`^crn:.+:.+:.+:.+:.+:a\/[0-9a-f]{32}:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\:\:$`), }, "crn": { Type: schema.TypeString, @@ -89,7 +96,7 @@ func resourceIBMCOSBucket() *schema.Resource { "single_site_location": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue(singleSiteLocation), + ValidateFunc: validate.ValidateAllowedStringValues(singleSiteLocation), ForceNew: true, ConflictsWith: []string{"region_location", "cross_region_location"}, Description: "single site location info", @@ -97,7 +104,7 @@ func resourceIBMCOSBucket() *schema.Resource { "region_location": { Type: schema.TypeString, Optional: true, - //ValidateFunc: validateAllowedStringValue(regionLocation), + //ValidateFunc: validate.ValidateAllowedStringValues(regionLocation), ForceNew: true, ConflictsWith: []string{"cross_region_location", "single_site_location"}, Description: "Region Location info.", @@ -105,7 +112,7 @@ func resourceIBMCOSBucket() *schema.Resource { "cross_region_location": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue(crossRegionLocation), + ValidateFunc: validate.ValidateAllowedStringValues(crossRegionLocation), ForceNew: true, ConflictsWith: []string{"region_location", "single_site_location"}, Description: "Cros region location info", @@ -113,16 +120,16 @@ func resourceIBMCOSBucket() *schema.Resource { "storage_class": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue(storageClass), + ValidateFunc: validate.ValidateAllowedStringValues(storageClass), ForceNew: true, Description: "Storage class info", }, "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "direct"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "direct"}), Description: "public or private", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Default: "public", }, "s3_endpoint_public": { @@ -228,7 +235,7 @@ func resourceIBMCOSBucket() *schema.Resource { "days_after_initiation": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateAllowedRangeInt(1, 3650), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 3650), Description: "Specifies the number of days when the specific rule action takes effect.", }, }, @@ -255,13 +262,13 @@ func resourceIBMCOSBucket() *schema.Resource { "days": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(0, 3650), + ValidateFunc: validate.ValidateAllowedRangeInt(0, 3650), Description: "Specifies the number of days when the specific rule action takes effect.", }, "type": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"GLACIER", "ACCELERATED", "Glacier", "Accelerated", "glacier", "accelerated"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"GLACIER", "ACCELERATED", "Glacier", "Accelerated", "glacier", "accelerated"}), DiffSuppressFunc: caseDiffSuppress, Description: "Specifies the storage class/archive type to which you want the object to transition. It can be Glacier or Accelerated", }, @@ -295,13 +302,13 @@ func resourceIBMCOSBucket() *schema.Resource { "date": { Type: schema.TypeString, Optional: true, - ValidateFunc: validBucketLifecycleTimestamp, + ValidateFunc: validate.ValidBucketLifecycleTimestamp, Description: "Specify a rule to expire the current version of objects in bucket after a specific date.", }, "days": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateAllowedRangeInt(1, 3650), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 3650), Description: "Specifies the number of days when the specific rule action takes effect.", }, "expired_object_delete_marker": { @@ -323,21 +330,21 @@ func resourceIBMCOSBucket() *schema.Resource { "default": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(0, 365243), + ValidateFunc: validate.ValidateAllowedRangeInt(0, 365243), Description: "If an object is stored in the bucket without specifying a custom retention period.", ForceNew: false, }, "maximum": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(0, 365243), + ValidateFunc: validate.ValidateAllowedRangeInt(0, 365243), Description: "Maximum duration of time an object can be kept unmodified in the bucket.", ForceNew: false, }, "minimum": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(0, 365243), + ValidateFunc: validate.ValidateAllowedRangeInt(0, 365243), Description: "Minimum duration of time an object must be kept unmodified in the bucket", ForceNew: false, }, @@ -394,7 +401,7 @@ func resourceIBMCOSBucket() *schema.Resource { "noncurrent_days": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateAllowedRangeInt(1, 3650), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 3650), Description: "Specifies the number of days when the specific rule action takes effect.", }, }, @@ -635,14 +642,14 @@ func expireRuleList(expireList []interface{}) []*s3.LifecycleRule { func resourceIBMCOSBucketUpdate(d *schema.ResourceData, meta interface{}) error { var s3Conf *aws.Config - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } bucketName := parseBucketId(d.Id(), "bucketName") serviceID := parseBucketId(d.Id(), "serviceID") endpointType := parseBucketId(d.Id(), "endpointType") - apiEndpoint, apiEndpointPrivate, directApiEndpoint := selectCosApi(parseBucketId(d.Id(), "apiType"), parseBucketId(d.Id(), "bLocation")) + apiEndpoint, apiEndpointPrivate, directApiEndpoint := SelectCosApi(parseBucketId(d.Id(), "apiType"), parseBucketId(d.Id(), "bLocation")) if endpointType == "private" { apiEndpoint = apiEndpointPrivate } @@ -656,7 +663,7 @@ func resourceIBMCOSBucketUpdate(d *schema.ResourceData, meta interface{}) error authEndpointPath := fmt.Sprintf("%s%s", authEndpoint, "/identity/token") apiKey := rsConClient.Config.BluemixAPIKey if apiKey != "" { - s3Conf = aws.NewConfig().WithEndpoint(envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint)).WithCredentials(ibmiam.NewStaticCredentials(aws.NewConfig(), authEndpointPath, apiKey, serviceID)).WithS3ForcePathStyle(true) + s3Conf = aws.NewConfig().WithEndpoint(conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint)).WithCredentials(ibmiam.NewStaticCredentials(aws.NewConfig(), authEndpointPath, apiKey, serviceID)).WithS3ForcePathStyle(true) } iamAccessToken := rsConClient.Config.IAMAccessToken if iamAccessToken != "" { @@ -669,7 +676,7 @@ func resourceIBMCOSBucketUpdate(d *schema.ResourceData, meta interface{}) error Expiration: time.Now().Add(-1 * time.Hour).Unix(), }, nil } - s3Conf = aws.NewConfig().WithEndpoint(envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint)).WithCredentials(ibmiam.NewCustomInitFuncCredentials(aws.NewConfig(), initFunc, authEndpointPath, serviceID)).WithS3ForcePathStyle(true) + s3Conf = aws.NewConfig().WithEndpoint(conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint)).WithCredentials(ibmiam.NewCustomInitFuncCredentials(aws.NewConfig(), initFunc, authEndpointPath, serviceID)).WithS3ForcePathStyle(true) } s3Sess := session.Must(session.NewSession()) s3Client := s3.New(s3Sess, s3Conf) @@ -805,7 +812,7 @@ func resourceIBMCOSBucketUpdate(d *schema.ResourceData, meta interface{}) error } } - sess, err := meta.(ClientSession).CosConfigV1API() + sess, err := meta.(conns.ClientSession).CosConfigV1API() if err != nil { return err } @@ -897,7 +904,7 @@ func resourceIBMCOSBucketUpdate(d *schema.ResourceData, meta interface{}) error if hasChanged { response, err := sess.UpdateBucketConfig(updateBucketConfigOptions) if err != nil { - return fmt.Errorf("Error Update COS Bucket: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Update COS Bucket: %s\n%s", err, response) } } @@ -906,21 +913,21 @@ func resourceIBMCOSBucketUpdate(d *schema.ResourceData, meta interface{}) error func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { var s3Conf *aws.Config - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } bucketName := parseBucketId(d.Id(), "bucketName") serviceID := parseBucketId(d.Id(), "serviceID") endpointType := parseBucketId(d.Id(), "endpointType") - apiEndpoint, apiEndpointPrivate, directApiEndpoint := selectCosApi(parseBucketId(d.Id(), "apiType"), parseBucketId(d.Id(), "bLocation")) + apiEndpoint, apiEndpointPrivate, directApiEndpoint := SelectCosApi(parseBucketId(d.Id(), "apiType"), parseBucketId(d.Id(), "bLocation")) if endpointType == "private" { apiEndpoint = apiEndpointPrivate } if endpointType == "direct" { apiEndpoint = directApiEndpoint } - apiEndpoint = envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) + apiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) authEndpoint, err := rsConClient.Config.EndpointLocator.IAMEndpoint() if err != nil { return err @@ -995,7 +1002,7 @@ func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { Bucket: &bucketName, } - sess, err := meta.(ClientSession).CosConfigV1API() + sess, err := meta.(conns.ClientSession).CosConfigV1API() if err != nil { return err } @@ -1005,19 +1012,19 @@ func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { bucketPtr, response, err := sess.GetBucketConfig(getBucketConfigOptions) if err != nil { - return fmt.Errorf("Error in getting bucket info rule: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in getting bucket info rule: %s\n%s", err, response) } if bucketPtr != nil { if bucketPtr.Firewall != nil { - d.Set("allowed_ip", flattenStringList(bucketPtr.Firewall.AllowedIp)) + d.Set("allowed_ip", flex.FlattenStringList(bucketPtr.Firewall.AllowedIp)) } if bucketPtr.ActivityTracking != nil { - d.Set("activity_tracking", flattenActivityTrack(bucketPtr.ActivityTracking)) + d.Set("activity_tracking", flex.FlattenActivityTrack(bucketPtr.ActivityTracking)) } if bucketPtr.MetricsMonitoring != nil { - d.Set("metrics_monitoring", flattenMetricsMonitor(bucketPtr.MetricsMonitoring)) + d.Set("metrics_monitoring", flex.FlattenMetricsMonitor(bucketPtr.MetricsMonitoring)) } if bucketPtr.HardQuota != nil { d.Set("hard_quota", bucketPtr.HardQuota) @@ -1035,10 +1042,10 @@ func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { return err } if lifecycleptr != nil { - archiveRules := archiveRuleGet(lifecycleptr.Rules) - expireRules := expireRuleGet(lifecycleptr.Rules) - nc_expRules := nc_exp_RuleGet(lifecycleptr.Rules) - abort_mpuRules := abort_mpu_RuleGet(lifecycleptr.Rules) + archiveRules := flex.ArchiveRuleGet(lifecycleptr.Rules) + expireRules := flex.ExpireRuleGet(lifecycleptr.Rules) + nc_expRules := flex.Nc_exp_RuleGet(lifecycleptr.Rules) + abort_mpuRules := flex.Abort_mpu_RuleGet(lifecycleptr.Rules) if len(archiveRules) > 0 { d.Set("archive_rule", archiveRules) } @@ -1064,7 +1071,7 @@ func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { } if retentionptr != nil { - retentionRules := retentionRuleGet(retentionptr.ProtectionConfiguration) + retentionRules := flex.RetentionRuleGet(retentionptr.ProtectionConfiguration) if len(retentionRules) > 0 { d.Set("retention_rule", retentionRules) } @@ -1080,7 +1087,7 @@ func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { return err } if versionPtr != nil { - versioningData := flattenCosObejctVersioning(versionPtr) + versioningData := flex.FlattenCosObejctVersioning(versionPtr) if len(versioningData) > 0 { d.Set("object_versioning", versioningData) } else { @@ -1092,7 +1099,7 @@ func resourceIBMCOSBucketRead(d *schema.ResourceData, meta interface{}) error { func resourceIBMCOSBucketCreate(d *schema.ResourceData, meta interface{}) error { var s3Conf *aws.Config - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } @@ -1119,16 +1126,16 @@ func resourceIBMCOSBucketCreate(d *schema.ResourceData, meta interface{}) error } lConstraint := fmt.Sprintf("%s-%s", bLocation, storageClass) var endpointType = d.Get("endpoint_type").(string) - apiEndpoint, privateApiEndpoint, directApiEndpoint := selectCosApi(apiType, bLocation) + apiEndpoint, privateApiEndpoint, directApiEndpoint := SelectCosApi(apiType, bLocation) if endpointType == "private" { apiEndpoint = privateApiEndpoint } if endpointType == "direct" { apiEndpoint = directApiEndpoint } - apiEndpoint = envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) + apiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) if apiEndpoint == "" { - return fmt.Errorf("The endpoint doesn't exists for given location %s and endpoint type %s", bLocation, endpointType) + return fmt.Errorf("[ERROR] The endpoint doesn't exists for given location %s and endpoint type %s", bLocation, endpointType) } create := &s3.CreateBucketInput{ Bucket: aws.String(bucketName), @@ -1182,7 +1189,7 @@ func resourceIBMCOSBucketCreate(d *schema.ResourceData, meta interface{}) error func resourceIBMCOSBucketDelete(d *schema.ResourceData, meta interface{}) error { var s3Conf *aws.Config - rsConClient, _ := meta.(ClientSession).BluemixSession() + rsConClient, _ := meta.(conns.ClientSession).BluemixSession() bucketName := parseBucketId(d.Id(), "bucketName") serviceID := d.Get("resource_instance_id").(string) var bLocation string @@ -1200,16 +1207,16 @@ func resourceIBMCOSBucketDelete(d *schema.ResourceData, meta interface{}) error apiType = "ssl" } endpointType := parseBucketId(d.Id(), "endpointType") - apiEndpoint, apiEndpointPrivate, directApiEndpoint := selectCosApi(apiType, bLocation) + apiEndpoint, apiEndpointPrivate, directApiEndpoint := SelectCosApi(apiType, bLocation) if endpointType == "private" { apiEndpoint = apiEndpointPrivate } if endpointType == "direct" { apiEndpoint = directApiEndpoint } - apiEndpoint = envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) + apiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) if apiEndpoint == "" { - return fmt.Errorf("The endpoint doesn't exists for given location %s and endpoint type %s", bLocation, endpointType) + return fmt.Errorf("[ERROR] The endpoint doesn't exists for given location %s and endpoint type %s", bLocation, endpointType) } authEndpoint, err := rsConClient.Config.EndpointLocator.IAMEndpoint() if err != nil { @@ -1258,7 +1265,7 @@ func resourceIBMCOSBucketDelete(d *schema.ResourceData, meta interface{}) error err = deleteAllCOSObjectVersions(s3Client, bucketName, "", false, false) if err != nil { - return fmt.Errorf("error COS Bucket force_delete: %s", err) + return fmt.Errorf("[ERROR] Error COS Bucket force_delete: %s", err) } // this line recurses until all objects are deleted or an error is returned @@ -1267,7 +1274,7 @@ func resourceIBMCOSBucketDelete(d *schema.ResourceData, meta interface{}) error } } if err != nil { - return fmt.Errorf("error deleting COS Bucket (%s): %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error deleting COS Bucket (%s): %s", d.Id(), err) } return nil @@ -1275,7 +1282,7 @@ func resourceIBMCOSBucketDelete(d *schema.ResourceData, meta interface{}) error func resourceIBMCOSBucketExists(d *schema.ResourceData, meta interface{}) (bool, error) { var s3Conf *aws.Config - rsConClient, err := meta.(ClientSession).BluemixSession() + rsConClient, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return false, err } @@ -1283,16 +1290,16 @@ func resourceIBMCOSBucketExists(d *schema.ResourceData, meta interface{}) (bool, bucketName := parseBucketId(d.Id(), "bucketName") serviceID := parseBucketId(d.Id(), "serviceID") endpointType := parseBucketId(d.Id(), "endpointType") - apiEndpoint, apiEndpointPrivate, directApiEndpoint := selectCosApi(parseBucketId(d.Id(), "apiType"), parseBucketId(d.Id(), "bLocation")) + apiEndpoint, apiEndpointPrivate, directApiEndpoint := SelectCosApi(parseBucketId(d.Id(), "apiType"), parseBucketId(d.Id(), "bLocation")) if endpointType == "private" { apiEndpoint = apiEndpointPrivate } if endpointType == "direct" { apiEndpoint = directApiEndpoint } - apiEndpoint = envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) + apiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) if apiEndpoint == "" { - return false, fmt.Errorf("The endpoint doesn't exists for given endpoint type %s", endpointType) + return false, fmt.Errorf("[ERROR] The endpoint doesn't exists for given endpoint type %s", endpointType) } authEndpoint, err := rsConClient.Config.EndpointLocator.IAMEndpoint() if err != nil { @@ -1333,7 +1340,7 @@ func resourceIBMCOSBucketExists(d *schema.ResourceData, meta interface{}) (bool, return false, nil } -func selectCosApi(apiType string, bLocation string) (string, string, string) { +func SelectCosApi(apiType string, bLocation string) (string, string, string) { if apiType == "crl" { return fmt.Sprintf("s3.%s.cloud-object-storage.appdomain.cloud", bLocation), fmt.Sprintf("s3.private.%s.cloud-object-storage.appdomain.cloud", bLocation), fmt.Sprintf("s3.direct.%s.cloud-object-storage.appdomain.cloud", bLocation) } @@ -1389,7 +1396,7 @@ func resourceExpiryValidate(_ context.Context, diff *schema.ResourceDiff, meta i ctr++ } if ctr > 1 { - return fmt.Errorf("The expiry 3 action elements (Days, Date, ExpiredObjectDeleteMarker) are all mutually exclusive. These can not be used with each other. Please set one expiry element on the same rule of expiration.") + return fmt.Errorf("[ERROR] The expiry 3 action elements (Days, Date, ExpiredObjectDeleteMarker) are all mutually exclusive. These can not be used with each other. Please set one expiry element on the same rule of expiration.") } } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cos_bucket_object.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/resource_ibm_cos_bucket_object.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cos_bucket_object.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/resource_ibm_cos_bucket_object.go index 36034f28a5..53161d1f1c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cos_bucket_object.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos/resource_ibm_cos_bucket_object.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package cos import ( "bytes" @@ -16,6 +16,8 @@ import ( "time" bxsession "github.com/IBM-Cloud/bluemix-go/session" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/IBM/ibm-cos-sdk-go/aws/awserr" "github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam" @@ -26,7 +28,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMCOSBucketObject() *schema.Resource { +func ResourceIBMCOSBucketObject() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMCOSBucketObjectCreate, ReadContext: resourceIBMCOSBucketObjectRead, @@ -88,7 +90,7 @@ func resourceIBMCOSBucketObject() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "direct"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "direct"}), Description: "COS endpoint type: public, private, direct", Default: "public", }, @@ -136,7 +138,7 @@ func resourceIBMCOSBucketObjectCreate(ctx context.Context, d *schema.ResourceDat bucketLocation := d.Get("bucket_location").(string) endpointType := d.Get("endpoint_type").(string) - bxSession, err := m.(ClientSession).BluemixSession() + bxSession, err := m.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -155,7 +157,7 @@ func resourceIBMCOSBucketObjectCreate(ctx context.Context, d *schema.ResourceDat return diag.FromErr(err) } if exists { - return diag.FromErr(fmt.Errorf("error COS bucket (%s) object (%s) already exists", bucketName, objectKey)) + return diag.FromErr(fmt.Errorf("[ERROR] Error COS bucket (%s) object (%s) already exists", bucketName, objectKey)) } var body io.ReadSeeker @@ -167,14 +169,14 @@ func resourceIBMCOSBucketObjectCreate(ctx context.Context, d *schema.ResourceDat content := v.(string) contentRaw, err := base64.StdEncoding.DecodeString(content) if err != nil { - return diag.FromErr(fmt.Errorf("error decoding content_base64: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error decoding content_base64: %s", err)) } body = bytes.NewReader(contentRaw) } else if v, ok := d.GetOk("content_file"); ok { path := v.(string) file, err := os.Open(path) if err != nil { - return diag.FromErr(fmt.Errorf("error opening COS object file (%s): %s", path, err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error opening COS object file (%s): %s", path, err)) } body = file @@ -193,7 +195,7 @@ func resourceIBMCOSBucketObjectCreate(ctx context.Context, d *schema.ResourceDat } if _, err := s3Client.PutObject(putInput); err != nil { - return diag.FromErr(fmt.Errorf("error putting object (%s) in COS bucket (%s): %s", objectKey, bucketName, err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error putting object (%s) in COS bucket (%s): %s", objectKey, bucketName, err)) } objectID := getObjectId(bucketCRN, objectKey, bucketLocation) @@ -214,7 +216,7 @@ func resourceIBMCOSBucketObjectRead(ctx context.Context, d *schema.ResourceData, d.Set("bucket_crn", bucketCRN) d.Set("bucket_location", bucketLocation) - bxSession, err := m.(ClientSession).BluemixSession() + bxSession, err := m.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -292,7 +294,7 @@ func resourceIBMCOSBucketObjectUpdate(ctx context.Context, d *schema.ResourceDat bucketLocation := d.Get("bucket_location").(string) endpointType := d.Get("endpoint_type").(string) - bxSession, err := m.(ClientSession).BluemixSession() + bxSession, err := m.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -311,14 +313,14 @@ func resourceIBMCOSBucketObjectUpdate(ctx context.Context, d *schema.ResourceDat content := v.(string) contentRaw, err := base64.StdEncoding.DecodeString(content) if err != nil { - return diag.FromErr(fmt.Errorf("error decoding content_base64: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error decoding content_base64: %s", err)) } body = bytes.NewReader(contentRaw) } else if v, ok := d.GetOk("content_file"); ok { path := v.(string) file, err := os.Open(path) if err != nil { - return diag.FromErr(fmt.Errorf("error opening COS object file (%s): %s", path, err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error opening COS object file (%s): %s", path, err)) } body = file @@ -339,7 +341,7 @@ func resourceIBMCOSBucketObjectUpdate(ctx context.Context, d *schema.ResourceDat } if _, err := s3Client.PutObject(putInput); err != nil { - return diag.FromErr(fmt.Errorf("error putting object (%s) in COS bucket (%s): %s", objectKey, bucketName, err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error putting object (%s) in COS bucket (%s): %s", objectKey, bucketName, err)) } objectID := getObjectId(bucketCRN, objectKey, bucketLocation) @@ -357,7 +359,7 @@ func resourceIBMCOSBucketObjectDelete(ctx context.Context, d *schema.ResourceDat bucketLocation := d.Get("bucket_location").(string) endpointType := d.Get("endpoint_type").(string) - bxSession, err := m.(ClientSession).BluemixSession() + bxSession, err := m.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -400,7 +402,7 @@ func getS3Client(bxSession *bxsession.Session, bucketLocation string, endpointTy var s3Conf *aws.Config apiEndpoint := getCosEndpoint(bucketLocation, endpointType) - apiEndpoint = envFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) + apiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_COS_ENDPOINT"}, apiEndpoint) if apiEndpoint == "" { return nil, fmt.Errorf("the endpoint doesn't exists for given location %s and endpoint type %s", bucketLocation, endpointType) } @@ -558,7 +560,7 @@ func deleteAllCOSObjectVersions(conn *s3.S3, bucketName, key string, force, igno if lastErr != nil { if !ignoreObjectErrors { - return fmt.Errorf("error deleting at least one object version, last error: %s", lastErr) + return fmt.Errorf("[ERROR] Error deleting at least one object version, last error: %s", lastErr) } lastErr = nil @@ -594,7 +596,7 @@ func deleteAllCOSObjectVersions(conn *s3.S3, bucketName, key string, force, igno if lastErr != nil { if !ignoreObjectErrors { - return fmt.Errorf("error deleting at least one object delete marker, last error: %s", lastErr) + return fmt.Errorf("[ERROR] Error deleting at least one object delete marker, last error: %s", lastErr) } lastErr = nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/README.md new file mode 100644 index 0000000000..0970b05e9a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Cloud Databases + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Cloud Databases resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/database) +* IBM API Docs: [IBM API Docs for Cloud Databases](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v4) +* IBM Cloud Databases SDK: [IBM SDK for Cloud Databases](https://github.com/IBM-Cloud/bluemix-go/tree/master/api/icd/icdv4) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_database.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/data_source_ibm_database.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_database.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/data_source_ibm_database.go index f6ec408da7..101158561d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_database.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/data_source_ibm_database.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package database import ( "encoding/base64" @@ -17,9 +17,11 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func dataSourceIBMDatabaseInstance() *schema.Resource { +func DataSourceIBMDatabaseInstance() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDatabaseInstanceRead, @@ -519,30 +521,30 @@ func dataSourceIBMDatabaseInstance() *schema.Resource { Computed: true, Description: "The configuration schema in JSON format", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, - Description: "The name of the resource", + Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, - Description: "The crn of the resource", + Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, - Description: "The status of the resource", + Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, - Description: "The resource group name in which resource is provisioned", + Description: "The resource group name in which resource is provisioned", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", @@ -552,7 +554,7 @@ func dataSourceIBMDatabaseInstance() *schema.Resource { } func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerAPIV2() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerAPIV2() if err != nil { return err } @@ -566,14 +568,14 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) if rsGrpID, ok := d.GetOk("resource_group_id"); ok { rsInstQuery.ResourceGroupID = rsGrpID.(string) } else { - defaultRg, err := defaultResourceGroup(meta) + defaultRg, err := flex.DefaultResourceGroup(meta) if err != nil { return err } rsInstQuery.ResourceGroupID = defaultRg } - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return err } @@ -583,7 +585,7 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) serviceOff, err := rsCatRepo.FindByName(service.(string), true) if err != nil { - return fmt.Errorf("Error retrieving database offering: %s", err) + return fmt.Errorf("[ERROR] Error retrieving database offering: %s", err) } rsInstQuery.ServiceID = serviceOff[0].ID @@ -601,7 +603,7 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) if loc, ok := d.GetOk("location"); ok { location = loc.(string) for _, instance := range instances { - if getLocation(instance) == location { + if flex.GetLocation(instance) == location { filteredInstances = append(filteredInstances, instance) } } @@ -610,7 +612,7 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) } if len(filteredInstances) == 0 { - return fmt.Errorf("No resource instance found with name [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or database", name) + return fmt.Errorf("[ERROR] No resource instance found with name [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or database", name) } var instance models.ServiceInstanceV2 @@ -623,10 +625,9 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) d.SetId(instance.ID) - err = GetTags(d, meta) + err = flex.GetTags(d, meta) if err != nil { - return fmt.Errorf( - "Error on get of resource instance (%s) tags: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error on get of resource instance (%s) tags: %s", d.Id(), err) } d.Set("name", instance.Name) @@ -637,40 +638,40 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) serviceOff, err := rsCatRepo.GetServiceName(instance.ServiceID) if err != nil { - return fmt.Errorf("Error retrieving service offering: %s", err) + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) } d.Set("service", serviceOff) servicePlan, err := rsCatRepo.GetServicePlanName(instance.ResourcePlanID) if err != nil { - return fmt.Errorf("Error retrieving plan: %s", err) + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) } d.Set("plan", servicePlan) - d.Set(ResourceName, instance.Name) - d.Set(ResourceCRN, instance.Crn.String()) - d.Set(ResourceStatus, instance.State) - d.Set(ResourceGroupName, instance.ResourceGroupName) + d.Set(flex.ResourceName, instance.Name) + d.Set(flex.ResourceCRN, instance.Crn.String()) + d.Set(flex.ResourceStatus, instance.State) + d.Set(flex.ResourceGroupName, instance.ResourceGroupName) - rcontroller, err := getBaseController(meta) + rcontroller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, rcontroller+"/services/"+url.QueryEscape(instance.Crn.String())) + d.Set(flex.ResourceControllerURL, rcontroller+"/services/"+url.QueryEscape(instance.Crn.String())) - icdClient, err := meta.(ClientSession).ICDAPI() + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { - return fmt.Errorf("Error getting database client settings: %s", err) + return fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } - icdId := EscapeUrlParm(instance.ID) + icdId := flex.EscapeUrlParm(instance.ID) cdb, err := icdClient.Cdbs().GetCdb(icdId) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return fmt.Errorf("The database instance was not found in the region set for the Provider, or the default of us-south. Specify the correct region in the provider definition, or create a provider alias for the correct region. %v", err) + return fmt.Errorf("[ERROR] The database instance was not found in the region set for the Provider, or the default of us-south. Specify the correct region in the provider definition, or create a provider alias for the correct region. %v", err) } - return fmt.Errorf("Error getting database config for: %s with error %s\n", icdId, err) + return fmt.Errorf("[ERROR] Error getting database config for: %s with error %s\n", icdId, err) } d.Set("adminuser", cdb.AdminUser) d.Set("version", cdb.Version) @@ -685,23 +686,23 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) groupList, err := icdClient.Groups().GetGroups(icdId) if err != nil { - return fmt.Errorf("Error getting database groups: %s", err) + return fmt.Errorf("[ERROR] Error getting database groups: %s", err) } - d.Set("groups", flattenIcdGroups(groupList)) + d.Set("groups", flex.FlattenIcdGroups(groupList)) d.Set("members_memory_allocation_mb", groupList.Groups[0].Memory.AllocationMb) d.Set("members_disk_allocation_mb", groupList.Groups[0].Disk.AllocationMb) autoSclaingGroup, err := icdClient.AutoScaling().GetAutoScaling(icdId, "member") if err != nil { - return fmt.Errorf("Error getting database groups: %s", err) + return fmt.Errorf("[ERROR] Error getting database groups: %s", err) } d.Set("auto_scaling", flattenICDAutoScalingGroup(autoSclaingGroup)) whitelist, err := icdClient.Whitelists().GetWhitelist(icdId) if err != nil { - return fmt.Errorf("Error getting database whitelist: %s", err) + return fmt.Errorf("[ERROR] Error getting database whitelist: %s", err) } - d.Set("whitelist", flattenWhitelist(whitelist)) + d.Set("whitelist", flex.FlattenWhitelist(whitelist)) connectionEndpoint := "public" if instance.Parameters != nil { @@ -713,10 +714,10 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) } - var connectionStrings []CsEntry + var connectionStrings []flex.CsEntry //ICD does not implement a GetUsers API. Users populated from tf configuration. tfusers := d.Get("users").(*schema.Set) - users := expandUsers(tfusers) + users := flex.ExpandUsers(tfusers) user := icdv4.User{ UserName: cdb.AdminUser, } @@ -725,23 +726,23 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) userName := user.UserName csEntry, err := getConnectionString(d, userName, connectionEndpoint, meta) if err != nil { - return fmt.Errorf("Error getting user connection string for user (%s): %s", userName, err) + return fmt.Errorf("[ERROR] Error getting user connection string for user (%s): %s", userName, err) } connectionStrings = append(connectionStrings, csEntry) } - d.Set("connectionstrings", flattenConnectionStrings(connectionStrings)) + d.Set("connectionstrings", flex.FlattenConnectionStrings(connectionStrings)) connStr := connectionStrings[0] certFile, err := filepath.Abs(connStr.CertName + ".pem") if err != nil { - return fmt.Errorf("Error generating certificate file path: %s", err) + return fmt.Errorf("[ERROR] Error generating certificate file path: %s", err) } content, err := base64.StdEncoding.DecodeString(connStr.CertBase64) if err != nil { - return fmt.Errorf("Error decoding certificate content: %s", err) + return fmt.Errorf("[ERROR] Error decoding certificate content: %s", err) } if err := ioutil.WriteFile(certFile, content, 0644); err != nil { - return fmt.Errorf("Error writing certificate to file: %s", err) + return fmt.Errorf("[ERROR] Error writing certificate to file: %s", err) } d.Set("cert_file_path", certFile) if serviceOff == "databases-for-postgresql" || serviceOff == "databases-for-redis" || serviceOff == "databases-for-enterprisedb" { @@ -751,11 +752,11 @@ func dataSourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) } s, err := json.Marshal(configSchema) if err != nil { - return fmt.Errorf("error marshalling the database configuration schema: %s", err) + return fmt.Errorf("[ERROR] Error marshalling the database configuration schema: %s", err) } if err = d.Set("configuration_schema", string(s)); err != nil { - return fmt.Errorf("error setting the database configuration schema: %s", err) + return fmt.Errorf("[ERROR] Error setting the database configuration schema: %s", err) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_database.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/resource_ibm_database.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_database.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/resource_ibm_database.go index 37478e64e8..fd3240b748 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_database.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database/resource_ibm_database.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package database import ( "context" @@ -23,6 +23,9 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/icd/icdv4" "github.com/IBM-Cloud/bluemix-go/bmxerror" "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -41,25 +44,6 @@ const ( databaseTaskFailStatus = "failed" ) -type CsEntry struct { - Name string - Password string - String string - Composed string - CertName string - CertBase64 string - Hosts []struct { - HostName string `json:"hostname"` - Port int `json:"port"` - } - Scheme string - QueryOptions map[string]interface{} - Path string - Database string - BundleName string - BundleBase64 string -} - func retry(f func() error) (err error) { attempts := 3 @@ -99,7 +83,7 @@ func retryTask(f func() (icdv4.Task, error)) (task icdv4.Task, err error) { } } -func resourceIBMDatabaseInstance() *schema.Resource { +func ResourceIBMDatabaseInstance() *schema.Resource { return &schema.Resource{ Create: resourceIBMDatabaseInstanceCreate, Read: resourceIBMDatabaseInstanceRead, @@ -140,13 +124,13 @@ func resourceIBMDatabaseInstance() *schema.Resource { Description: "The name of the Cloud Internet database service", Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"databases-for-etcd", "databases-for-postgresql", "databases-for-redis", "databases-for-elasticsearch", "databases-for-mongodb", "messages-for-rabbitmq", "databases-for-mysql", "databases-for-cassandra", "databases-for-enterprisedb"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"databases-for-etcd", "databases-for-postgresql", "databases-for-redis", "databases-for-elasticsearch", "databases-for-mongodb", "messages-for-rabbitmq", "databases-for-mysql", "databases-for-cassandra", "databases-for-enterprisedb"}), }, "plan": { Description: "The plan type of the Database instance", Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"standard", "enterprise"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"standard", "enterprise"}), ForceNew: true, }, @@ -181,7 +165,7 @@ func resourceIBMDatabaseInstance() *schema.Resource { Type: schema.TypeString, Optional: true, StateFunc: func(v interface{}) string { - json, err := normalizeJSONString(v) + json, err := flex.NormalizeJSONString(v) if err != nil { return fmt.Sprintf("%q", err.Error()) } @@ -268,7 +252,7 @@ func resourceIBMDatabaseInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "public", - ValidateFunc: validateAllowedStringValue([]string{"public", "private", "public-and-private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "public-and-private"}), }, "backup_id": { Description: "The CRN of backup source database", @@ -279,7 +263,7 @@ func resourceIBMDatabaseInstance() *schema.Resource { Description: "The CRN of leader database", Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "key_protect_instance": { Description: "The CRN of Key protect instance", @@ -303,20 +287,20 @@ func resourceIBMDatabaseInstance() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_database", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_database", "tag")}, + Set: flex.ResourceIBMVPCHash, }, "point_in_time_recovery_deployment_id": { Description: "The CRN of source instance", Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "point_in_time_recovery_time": { Description: "The point in time recovery time stamp of the deployed instance", Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "users": { Type: schema.TypeSet, @@ -429,7 +413,7 @@ func resourceIBMDatabaseInstance() *schema.Resource { Description: "Whitelist IP address in CIDR notation", Type: schema.TypeString, Optional: true, - ValidateFunc: validateCIDR, + ValidateFunc: validate.ValidateCIDR, }, "description": { Description: "Unique white list description", @@ -738,30 +722,30 @@ func resourceIBMDatabaseInstance() *schema.Resource { }, }, }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, - Description: "The name of the resource", + Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, - Description: "The crn of the resource", + Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, - Description: "The status of the resource", + Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, - Description: "The resource group name in which resource is provisioned", + Description: "The resource group name in which resource is provisioned", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", @@ -769,21 +753,21 @@ func resourceIBMDatabaseInstance() *schema.Resource { }, } } -func resourceIBMICDValidator() *ResourceValidator { +func ResourceIBMICDValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmICDResourceValidator := ResourceValidator{ResourceName: "ibm_database", Schema: validateSchema} + ibmICDResourceValidator := validate.ResourceValidator{ResourceName: "ibm_database", Schema: validateSchema} return &ibmICDResourceValidator } @@ -803,7 +787,7 @@ type Params struct { } func getDatabaseServiceDefaults(service string, meta interface{}) (*icdv4.Group, error) { - icdClient, err := meta.(ClientSession).ICDAPI() + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return nil, fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } @@ -850,6 +834,7 @@ type GroupLimit struct { Maximum int StepSize int IsAdjustable bool + IsOptional bool CanScaleDown bool } @@ -860,7 +845,9 @@ func checkGroupValue(name string, limits GroupLimit, divider int, diff *schema.R new := newSetting.(int) if new < limits.Minimum/divider || new > limits.Maximum/divider || new%(limits.StepSize/divider) != 0 { - return fmt.Errorf("%s must be >= %d and <= %d in increments of %d", name, limits.Minimum/divider, limits.Maximum/divider/divider, limits.StepSize/divider) + if !(new == 0 && limits.IsOptional) { + return fmt.Errorf("%s must be >= %d and <= %d in increments of %d", name, limits.Minimum/divider, limits.Maximum/divider/divider, limits.StepSize/divider) + } } if old != new && !limits.IsAdjustable { return fmt.Errorf("%s can not change value after create", name) @@ -880,6 +867,7 @@ type CountLimit struct { MaximumCount int StepSizeCount int IsAdjustable bool + IsOptional bool CanScaleDown bool } @@ -891,6 +879,7 @@ func checkCountValue(name string, limits CountLimit, divider int, diff *schema.R Maximum: limits.MaximumCount, StepSize: limits.StepSizeCount, IsAdjustable: limits.IsAdjustable, + IsOptional: limits.IsOptional, CanScaleDown: limits.CanScaleDown, } return checkGroupValue(name, groupLimit, divider, diff) @@ -903,6 +892,7 @@ type MbLimit struct { MaximumMb int StepSizeMb int IsAdjustable bool + IsOptional bool CanScaleDown bool } @@ -914,6 +904,7 @@ func checkMbValue(name string, limits MbLimit, divider int, diff *schema.Resourc Maximum: limits.MaximumMb, StepSize: limits.StepSizeMb, IsAdjustable: limits.IsAdjustable, + IsOptional: limits.IsOptional, CanScaleDown: limits.CanScaleDown, } return checkGroupValue(name, groupLimit, divider, diff) @@ -921,7 +912,7 @@ func checkMbValue(name string, limits MbLimit, divider int, diff *schema.Resourc func resourceIBMDatabaseInstanceDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) error { - err := resourceTagsCustomizeDiff(diff) + err := flex.ResourceTagsCustomizeDiff(diff) if err != nil { return err } @@ -992,7 +983,7 @@ func resourceIBMDatabaseInstanceDiff(_ context.Context, diff *schema.ResourceDif // Replace with func wrapper for resourceIBMResourceInstanceCreate specifying serviceName := "database......." func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -1006,7 +997,7 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) Name: &name, } - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return err } @@ -1046,7 +1037,7 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) rgID := rsGrpID.(string) rsInst.ResourceGroup = &rgID } else { - defaultRg, err := defaultResourceGroup(meta) + defaultRg, err := flex.DefaultResourceGroup(meta) if err != nil { return err } @@ -1123,7 +1114,7 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) if node_count, ok := d.GetOk("node_count"); ok { if initialNodeCount != node_count { - icdClient, err := meta.(ClientSession).ICDAPI() + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } @@ -1137,15 +1128,15 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk("tags"); ok || v != "" { oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "Error on create of ibm database (%s) tags: %s", d.Id(), err) } } - icdId := EscapeUrlParm(*instance.ID) - icdClient, err := meta.(ClientSession).ICDAPI() + icdId := flex.EscapeUrlParm(*instance.ID) + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } @@ -1177,7 +1168,7 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) } if wl, ok := d.GetOk("whitelist"); ok { - whitelist := expandWhitelist(wl.(*schema.Set)) + whitelist := flex.ExpandWhitelist(wl.(*schema.Set)) for _, wlEntry := range whitelist { whitelistReq := icdv4.WhitelistReq{ WhitelistEntry: icdv4.WhitelistEntry{ @@ -1252,7 +1243,7 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) } if userlist, ok := d.GetOk("users"); ok { - users := expandUsers(userlist.(*schema.Set)) + users := flex.ExpandUsers(userlist.(*schema.Set)) for _, user := range users { userReq := icdv4.UserReq{ User: icdv4.User{ @@ -1276,7 +1267,7 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -1302,7 +1293,7 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e return nil } - tags, err := GetTagsUsingCRN(meta, *instance.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *instance.CRN) if err != nil { log.Printf( "Error on get of ibm Database tags (%s) tags: %s", d.Id(), err) @@ -1329,18 +1320,18 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e } - d.Set(ResourceName, *instance.Name) - d.Set(ResourceCRN, *instance.CRN) - d.Set(ResourceStatus, *instance.State) - d.Set(ResourceGroupName, *instance.ResourceGroupCRN) + d.Set(flex.ResourceName, *instance.Name) + d.Set(flex.ResourceCRN, *instance.CRN) + d.Set(flex.ResourceStatus, *instance.State) + d.Set(flex.ResourceGroupName, *instance.ResourceGroupCRN) - rcontroller, err := getBaseController(meta) + rcontroller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, rcontroller+"/services/"+url.QueryEscape(*instance.CRN)) + d.Set(flex.ResourceControllerURL, rcontroller+"/services/"+url.QueryEscape(*instance.CRN)) - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return err } @@ -1359,12 +1350,12 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e } d.Set("plan", servicePlan) - icdClient, err := meta.(ClientSession).ICDAPI() + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } - icdId := EscapeUrlParm(instanceID) + icdId := flex.EscapeUrlParm(instanceID) cdb, err := icdClient.Cdbs().GetCdb(icdId) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { @@ -1379,7 +1370,7 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e if err != nil { return fmt.Errorf("[ERROR] Error getting database groups: %s", err) } - d.Set("groups", flattenIcdGroups(groupList)) + d.Set("groups", flex.FlattenIcdGroups(groupList)) d.Set("node_count", groupList.Groups[0].Members.AllocationCount) d.Set("members_memory_allocation_mb", groupList.Groups[0].Memory.AllocationMb) @@ -1401,12 +1392,12 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e if err != nil { return fmt.Errorf("[ERROR] Error getting database whitelist: %s", err) } - d.Set("whitelist", flattenWhitelist(whitelist)) + d.Set("whitelist", flex.FlattenWhitelist(whitelist)) - var connectionStrings []CsEntry + var connectionStrings []flex.CsEntry //ICD does not implement a GetUsers API. Users populated from tf configuration. tfusers := d.Get("users").(*schema.Set) - users := expandUsers(tfusers) + users := flex.ExpandUsers(tfusers) user := icdv4.User{ UserName: cdb.AdminUser, } @@ -1419,7 +1410,7 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e } connectionStrings = append(connectionStrings, csEntry) } - d.Set("connectionstrings", flattenConnectionStrings(connectionStrings)) + d.Set("connectionstrings", flex.FlattenConnectionStrings(connectionStrings)) if serviceOff == "databases-for-postgresql" || serviceOff == "databases-for-redis" || serviceOff == "databases-for-enterprisedb" { configSchema, err := icdClient.Configurations().GetConfiguration(icdId) @@ -1428,18 +1419,18 @@ func resourceIBMDatabaseInstanceRead(d *schema.ResourceData, meta interface{}) e } s, err := json.Marshal(configSchema) if err != nil { - return fmt.Errorf("error marshalling the database configuration schema: %s", err) + return fmt.Errorf("[ERROR] Error marshalling the database configuration schema: %s", err) } if err = d.Set("configuration_schema", string(s)); err != nil { - return fmt.Errorf("error setting the database configuration schema: %s", err) + return fmt.Errorf("[ERROR] Error setting the database configuration schema: %s", err) } } return nil } func resourceIBMDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -1481,18 +1472,18 @@ func resourceIBMDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) if d.HasChange("tags") { oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, instanceID) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, instanceID) if err != nil { log.Printf( "[ERROR] Error on update of Database (%s) tags: %s", d.Id(), err) } } - icdClient, err := meta.(ClientSession).ICDAPI() + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } - icdId := EscapeUrlParm(instanceID) + icdId := flex.EscapeUrlParm(instanceID) if d.HasChange("node_count") { err = horizontalScale(d, meta, icdClient) @@ -1787,7 +1778,7 @@ func resourceIBMDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) func horizontalScale(d *schema.ResourceData, meta interface{}, icdClient icdv4.ICDServiceAPI) error { params := icdv4.GroupReq{} - icdId := EscapeUrlParm(d.Id()) + icdId := flex.EscapeUrlParm(d.Id()) members := d.Get("node_count").(int) membersReq := icdv4.MembersReq{AllocationCount: members} @@ -1809,9 +1800,9 @@ func horizontalScale(d *schema.ResourceData, meta interface{}, icdClient icdv4.I return nil } -func getConnectionString(d *schema.ResourceData, userName, connectionEndpoint string, meta interface{}) (CsEntry, error) { - csEntry := CsEntry{} - icdClient, err := meta.(ClientSession).ICDAPI() +func getConnectionString(d *schema.ResourceData, userName, connectionEndpoint string, meta interface{}) (flex.CsEntry, error) { + csEntry := flex.CsEntry{} + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return csEntry, fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } @@ -1850,14 +1841,14 @@ func getConnectionString(d *schema.ResourceData, userName, connectionEndpoint st } if !reflect.DeepEqual(cassandraConnection, icdv4.CassandraUri{}) { - csEntry = CsEntry{ + csEntry = flex.CsEntry{ Name: userName, Hosts: cassandraConnection.Hosts, BundleName: cassandraConnection.Bundle.Name, BundleBase64: cassandraConnection.Bundle.BundleBase64, } } else { - csEntry = CsEntry{ + csEntry = flex.CsEntry{ Name: userName, Password: "", // Populate only first 'composed' connection string as an example @@ -1889,7 +1880,7 @@ func getConnectionString(d *schema.ResourceData, userName, connectionEndpoint st } func resourceIBMDatabaseInstanceDelete(d *schema.ResourceData, meta interface{}) error { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -1923,7 +1914,7 @@ func resourceIBMDatabaseInstanceDelete(d *schema.ResourceData, meta interface{}) return nil } func resourceIBMDatabaseInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -1950,10 +1941,10 @@ func resourceIBMDatabaseInstanceExists(d *schema.ResourceData, meta interface{}) } func waitForICDReady(meta interface{}, instanceID string) error { - icdId := EscapeUrlParm(instanceID) - icdClient, clientErr := meta.(ClientSession).ICDAPI() + icdId := flex.EscapeUrlParm(instanceID) + icdClient, clientErr := meta.(conns.ClientSession).ICDAPI() if clientErr != nil { - return fmt.Errorf("Error getting database client settings: %s", clientErr) + return fmt.Errorf("[ERROR] Error getting database client settings: %s", clientErr) } // Wait for ICD Interface @@ -1961,9 +1952,9 @@ func waitForICDReady(meta interface{}, instanceID string) error { _, cdbErr := icdClient.Cdbs().GetCdb(icdId) if cdbErr != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return fmt.Errorf("The database instance was not found in the region set for the Provider, or the default of us-south. Specify the correct region in the provider definition, or create a provider alias for the correct region. %v", err) + return fmt.Errorf("[ERROR] The database instance was not found in the region set for the Provider, or the default of us-south. Specify the correct region in the provider definition, or create a provider alias for the correct region. %v", err) } - return fmt.Errorf("Error getting database config for: %s with error %s\n", icdId, err) + return fmt.Errorf("[ERROR] Error getting database config for: %s with error %s\n", icdId, err) } return nil }) @@ -1974,7 +1965,7 @@ func waitForICDReady(meta interface{}, instanceID string) error { } func waitForDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}, instanceID string) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -2005,7 +1996,7 @@ func waitForDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}, ins waitErr := waitForICDReady(meta, instanceID) if waitErr != nil { - return false, fmt.Errorf("Error ICD interface not ready after create: %s with error %s\n", instanceID, waitErr) + return false, fmt.Errorf("[ERROR] Error ICD interface not ready after create: %s with error %s\n", instanceID, waitErr) } @@ -2013,7 +2004,7 @@ func waitForDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}, ins } func waitForDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -2045,7 +2036,7 @@ func waitForDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) (in waitErr := waitForICDReady(meta, instanceID) if waitErr != nil { - return false, fmt.Errorf("Error ICD interface not ready after update: %s with error %s\n", instanceID, waitErr) + return false, fmt.Errorf("[ERROR] Error ICD interface not ready after update: %s with error %s\n", instanceID, waitErr) } @@ -2053,7 +2044,7 @@ func waitForDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) (in } func waitForDatabaseTaskComplete(taskId string, d *schema.ResourceData, meta interface{}, t time.Duration) (bool, error) { - icdClient, err := meta.(ClientSession).ICDAPI() + icdClient, err := meta.(conns.ClientSession).ICDAPI() if err != nil { return false, fmt.Errorf("[ERROR] Error getting database client settings: %s", err) } @@ -2068,7 +2059,7 @@ func waitForDatabaseTaskComplete(taskId string, d *schema.ResourceData, meta int case <-timeout: return false, fmt.Errorf("[Error] Time out waiting for database task to complete") case <-delay: - innerTask, err = icdClient.Tasks().GetTask(EscapeUrlParm(taskId)) + innerTask, err = icdClient.Tasks().GetTask(flex.EscapeUrlParm(taskId)) if err != nil { return false, fmt.Errorf("[ERROR] The ICD Get task on database update errored: %v", err) } @@ -2085,7 +2076,7 @@ func waitForDatabaseTaskComplete(taskId string, d *schema.ResourceData, meta int } func waitForDatabaseInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/README.md new file mode 100644 index 0000000000..e7533cfaab --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/README.md @@ -0,0 +1,12 @@ +# Terraform IBM Provider Direct Link Services + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the DL resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/dl_gateway) +* IBM API Docs: [IBM API Docs for DL](https://cloud.ibm.com/apidocs/direct_link) +* IBM DL SDK: [IBM SDK for DL](https://github.com/IBM/networking-go-sdk/tree/master/directlinkv1) +* IBM DL SDK: [IBM SDK for DL Provider](https://github.com/IBM/networking-go-sdk/tree/master/directlinkproviderv2) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_gateway.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_gateway.go index c31ab59455..2cef5132dd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_gateway.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/directlinkv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -17,7 +19,7 @@ const ( dlActiveCak = "active_cak" ) -func dataSourceIBMDLGateway() *schema.Resource { +func DataSourceIBMDLGateway() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDLGatewayRead, Schema: map[string]*schema.Schema{ @@ -25,7 +27,7 @@ func dataSourceIBMDLGateway() *schema.Resource { Type: schema.TypeString, Required: true, Description: "The unique user-defined name for this gateway", - ValidateFunc: InvokeValidator("ibm_dl_gateway", dlName), + ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", dlName), }, dlGatewaysVirtualConnections: { @@ -293,7 +295,7 @@ func dataSourceIBMDLGateway() *schema.Resource { } func dataSourceIBMDLGatewayVirtualConnectionsRead(d *schema.ResourceData, meta interface{}) error { - directLink, err := meta.(ClientSession).DirectlinkV1API() + directLink, err := meta.(conns.ClientSession).DirectlinkV1API() if err != nil { return err @@ -303,7 +305,7 @@ func dataSourceIBMDLGatewayVirtualConnectionsRead(d *schema.ResourceData, meta i listVcOptions.SetGatewayID(dlGatewayId) listGatewayVirtualConnections, response, err := directLink.ListGatewayVirtualConnections(listVcOptions) if err != nil { - return fmt.Errorf("Error while listing directlink gateway's virtual connections XXX %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while listing directlink gateway's virtual connections XXX %s\n%s", err, response) } gatewayVCs := make([]map[string]interface{}, 0) for _, instance := range listGatewayVirtualConnections.VirtualConnections { @@ -517,8 +519,7 @@ func dataSourceIBMDLGatewayRead(d *schema.ResourceData, meta interface{}) error } if !found { - return fmt.Errorf( - "Error Gateway with name (%s) not found ", dlGatewayName) + return fmt.Errorf("[ERROR] Error Gateway with name (%s) not found ", dlGatewayName) } return dataSourceIBMDLGatewayVirtualConnectionsRead(d, meta) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_gateways.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_gateways.go similarity index 99% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_gateways.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_gateways.go index 896db3cc02..adee6b7df8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_gateways.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_gateways.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "log" @@ -16,7 +16,7 @@ const ( dlGatewaysId = "id" ) -func dataSourceIBMDLGateways() *schema.Resource { +func DataSourceIBMDLGateways() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDLGatewaysRead, Schema: map[string]*schema.Schema{ diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_locations.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_locations.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_locations.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_locations.go index 50f7e410e0..94b9a2c034 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_locations.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_locations.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/directlinkv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "time" ) const ( @@ -25,14 +28,14 @@ const ( dlProvisionEnabled = "provision_enabled" ) -func dataSourceIBMDLLocations() *schema.Resource { +func DataSourceIBMDLLocations() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDLOfferingLocationsRead, Schema: map[string]*schema.Schema{ dlOfferingType: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"dedicated", "connect"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"dedicated", "connect"}), Description: "The Direct Link offering type. Current supported values (dedicated and connect).", }, dlLocations: { @@ -108,7 +111,7 @@ func dataSourceIBMDLLocations() *schema.Resource { } func dataSourceIBMDLOfferingLocationsRead(d *schema.ResourceData, meta interface{}) error { - directLink, err := meta.(ClientSession).DirectlinkV1API() + directLink, err := meta.(conns.ClientSession).DirectlinkV1API() if err != nil { return err } @@ -116,7 +119,7 @@ func dataSourceIBMDLOfferingLocationsRead(d *schema.ResourceData, meta interface listOfferingTypeLocationsOptions.SetOfferingType(d.Get(dlOfferingType).(string)) listLocations, response, err := directLink.ListOfferingTypeLocations(listOfferingTypeLocationsOptions) if err != nil { - return fmt.Errorf("Error while listing directlink gateway's locations %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while listing directlink gateway's locations %s\n%s", err, response) } locations := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_offering_speeds.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_offering_speeds.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_offering_speeds.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_offering_speeds.go index e00c971df6..f0ac003b70 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_offering_speeds.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_offering_speeds.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/directlinkv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -19,7 +21,7 @@ const ( dlMeteringCapabilities = "capabilities" ) -func dataSourceIBMDLOfferingSpeeds() *schema.Resource { +func DataSourceIBMDLOfferingSpeeds() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDLOfferingSpeedsRead, Schema: map[string]*schema.Schema{ @@ -27,7 +29,7 @@ func dataSourceIBMDLOfferingSpeeds() *schema.Resource { Type: schema.TypeString, Required: true, Description: "The Direct Link offering type", - ValidateFunc: InvokeDataSourceValidator("ibm_dl_offering_speeds", dlOfferingType), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_dl_offering_speeds", dlOfferingType), }, dlSpeeds: { Type: schema.TypeList, @@ -76,7 +78,7 @@ func dataSourceIBMDLOfferingSpeedsRead(d *schema.ResourceData, meta interface{}) for _, instance := range listSpeeds.Speeds { speed := map[string]interface{}{} if instance.Capabilities != nil { - speed[dlMeteringCapabilities] = flattenStringList(instance.Capabilities) + speed[dlMeteringCapabilities] = flex.FlattenStringList(instance.Capabilities) } if instance.LinkSpeed != nil { speed[dlLinkSpeed] = *instance.LinkSpeed @@ -96,19 +98,19 @@ func dataSourceIBMDLOfferingSpeedsID(d *schema.ResourceData) string { return time.Now().UTC().String() } -func datasourceIBMDLOfferingSpeedsValidator() *ResourceValidator { +func DataSourceIBMDLOfferingSpeedsValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) dlTypeAllowedValues := "dedicated, connect" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlOfferingType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: dlTypeAllowedValues}) - ibmDLOfferingSpeedsDatasourceValidator := ResourceValidator{ResourceName: "ibm_dl_offering_speeds", Schema: validateSchema} + ibmDLOfferingSpeedsDatasourceValidator := validate.ResourceValidator{ResourceName: "ibm_dl_offering_speeds", Schema: validateSchema} return &ibmDLOfferingSpeedsDatasourceValidator } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_port.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_port.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_port.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_port.go index 8d0524e71b..204e4b8893 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_port.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_port.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMDirectLinkPort() *schema.Resource { +func DataSourceIBMDirectLinkPort() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDirectLinkPortRead, Schema: map[string]*schema.Schema{ @@ -57,7 +58,7 @@ func dataSourceIBMDirectLinkPort() *schema.Resource { func dataSourceIBMDirectLinkPortRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).DirectlinkV1API() + sess, err := meta.(conns.ClientSession).DirectlinkV1API() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_ports.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_ports.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_ports.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_ports.go index 7c01863350..ab83727807 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_ports.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_ports.go @@ -1,9 +1,11 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" dl "github.com/IBM/networking-go-sdk/directlinkv1" "log" @@ -23,7 +25,7 @@ const ( dlProviderName = "provider_name" ) -func dataSourceIBMDirectLinkPorts() *schema.Resource { +func DataSourceIBMDirectLinkPorts() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDirectLinkPortsRead, @@ -89,7 +91,7 @@ func dataSourceIBMDirectLinkPorts() *schema.Resource { func dataSourceIBMDirectLinkPortsRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).DirectlinkV1API() + sess, err := meta.(conns.ClientSession).DirectlinkV1API() if err != nil { return err } @@ -112,7 +114,7 @@ func dataSourceIBMDirectLinkPortsRead(d *schema.ResourceData, meta interface{}) log.Println("[WARN] Error listing dl ports", resp, err) return err } - start = GetNext(response.Next) + start = flex.GetNext(response.Next) allrecs = append(allrecs, response.Ports...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_provider_gateways.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_provider_gateways.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_provider_gateways.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_provider_gateways.go index 22545ad760..9bc7cb9480 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_provider_gateways.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_provider_gateways.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( - dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "log" "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( @@ -15,7 +17,7 @@ const ( dlProviderGatewaysID = "id" ) -func dataSourceIBMDirectLinkProviderGateways() *schema.Resource { +func DataSourceIBMDirectLinkProviderGateways() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDirectLinkProviderGatewaysRead, @@ -146,7 +148,7 @@ func dataSourceIBMDirectLinkProviderGatewaysRead(d *schema.ResourceData, meta in log.Println("[WARN] Error listing dl provider gateways", providerGateways, resp, err) return err } - start = GetNext(providerGateways.Next) + start = flex.GetNext(providerGateways.Next) allrecs = append(allrecs, providerGateways.Gateways...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_provider_ports.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_provider_ports.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_provider_ports.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_provider_ports.go index 1b90c24389..03cf4e8b0c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_provider_ports.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_provider_ports.go @@ -1,16 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( - dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "log" "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMDirectLinkProviderPorts() *schema.Resource { +func DataSourceIBMDirectLinkProviderPorts() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDirectLinkProviderPortsRead, @@ -67,7 +70,7 @@ func dataSourceIBMDirectLinkProviderPorts() *schema.Resource { } func directlinkProviderClient(meta interface{}) (*dlProviderV2.DirectLinkProviderV2, error) { - sess, err := meta.(ClientSession).DirectlinkProviderV2API() + sess, err := meta.(conns.ClientSession).DirectlinkProviderV2API() return sess, err } func dataSourceIBMDirectLinkProviderPortsRead(d *schema.ResourceData, meta interface{}) error { @@ -88,7 +91,7 @@ func dataSourceIBMDirectLinkProviderPortsRead(d *schema.ResourceData, meta inter log.Println("[WARN] Error listing dl provider ports", ports, resp, err) return err } - start = GetNext(ports.Next) + start = flex.GetNext(ports.Next) allrecs = append(allrecs, ports.Ports...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_routers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_routers.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_routers.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_routers.go index 4b87904cdc..440f1d6397 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_dl_routers.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/data_source_ibm_dl_routers.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/directlinkv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -19,7 +21,7 @@ const ( dlMacsecCapabilities = "capabilities" ) -func dataSourceIBMDLRouters() *schema.Resource { +func DataSourceIBMDLRouters() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMDLRoutersRead, Schema: map[string]*schema.Schema{ @@ -27,7 +29,7 @@ func dataSourceIBMDLRouters() *schema.Resource { Type: schema.TypeString, Required: true, Description: "The Direct Link offering type", - ValidateFunc: InvokeDataSourceValidator("ibm_dl_routers", dlOfferingType), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_dl_routers", dlOfferingType), }, dlLocation: { Type: schema.TypeString, @@ -77,14 +79,14 @@ func dataSourceIBMDLRoutersRead(d *schema.ResourceData, meta interface{}) error listRouters, detail, err := directLink.ListOfferingTypeLocationCrossConnectRouters(listRoutersOptionsModel) if err != nil { - return fmt.Errorf("Error Getting Direct Link Location Cross Connect Routers: %s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error Getting Direct Link Location Cross Connect Routers: %s\n%s", err, detail) } routers := make([]map[string]interface{}, 0) for _, instance := range listRouters.CrossConnectRouters { route := map[string]interface{}{} if instance.Capabilities != nil { - route[dlMacsecCapabilities] = flattenStringList(instance.Capabilities) + route[dlMacsecCapabilities] = flex.FlattenStringList(instance.Capabilities) } if instance.RouterName != nil { route[dlRouterName] = *instance.RouterName @@ -104,19 +106,19 @@ func dataSourceIBMDLRoutersID(d *schema.ResourceData) string { return time.Now().UTC().String() } -func datasourceIBMDLRoutersValidator() *ResourceValidator { +func DataSourceIBMDLRoutersValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) dlTypeAllowedValues := "dedicated" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlOfferingType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: dlTypeAllowedValues}) - ibmDLRoutersDatasourceValidator := ResourceValidator{ResourceName: "ibm_dl_routers", Schema: validateSchema} + ibmDLRoutersDatasourceValidator := validate.ResourceValidator{ResourceName: "ibm_dl_routers", Schema: validateSchema} return &ibmDLRoutersDatasourceValidator } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_gateway.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_gateway.go index a5076be529..540de9e30a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "context" @@ -12,6 +12,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/directlinkv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -69,7 +72,7 @@ const ( dlWindowSize = "window_size" ) -func resourceIBMDLGateway() *schema.Resource { +func ResourceIBMDLGateway() *schema.Resource { return &schema.Resource{ Create: resourceIBMdlGatewayCreate, Read: resourceIBMdlGatewayRead, @@ -86,7 +89,7 @@ func resourceIBMDLGateway() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -102,14 +105,14 @@ func resourceIBMDLGateway() *schema.Resource { Optional: true, ForceNew: false, Description: "BFD Interval", - ValidateFunc: InvokeValidator("ibm_dl_gateway", dlBfdInterval), + ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", dlBfdInterval), }, dlBfdMultiplier: { Type: schema.TypeInt, Optional: true, ForceNew: false, Description: "BFD Multiplier", - ValidateFunc: InvokeValidator("ibm_dl_gateway", dlBfdMultiplier), + ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", dlBfdMultiplier), }, dlBfdStatus: { Type: schema.TypeString, @@ -132,7 +135,7 @@ func resourceIBMDLGateway() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: false, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "BGP base CIDR", }, dlPort: { @@ -149,7 +152,7 @@ func resourceIBMDLGateway() *schema.Resource { Optional: true, ForceNew: false, Description: "Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection", - ValidateFunc: InvokeValidator("ibm_dl_gateway", dlConnectionMode), + ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", dlConnectionMode), }, dlCrossConnectRouter: { Type: schema.TypeString, @@ -181,7 +184,7 @@ func resourceIBMDLGateway() *schema.Resource { Required: true, ForceNew: false, Description: "The unique user-defined name for this gateway", - ValidateFunc: InvokeValidator("ibm_dl_gateway", dlName), + ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", dlName), // ValidateFunc: validateRegexpLen(1, 63, "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$"), }, dlCarrierName: { @@ -209,8 +212,8 @@ func resourceIBMDLGateway() *schema.Resource { Required: true, ForceNew: true, Description: "Gateway type", - ValidateFunc: InvokeValidator("ibm_dl_gateway", dlType), - // ValidateFunc: validateAllowedStringValue([]string{"dedicated", "connect"}), + ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", dlType), + // ValidateFunc: validate.ValidateAllowedStringValues([]string{"dedicated", "connect"}), }, dlMacSecConfig: { Type: schema.TypeList, @@ -376,35 +379,35 @@ func resourceIBMDLGateway() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_dl_gateway", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_dl_gateway", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the direct link gateway", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -413,67 +416,67 @@ func resourceIBMDLGateway() *schema.Resource { } } -func resourceIBMDLGatewayValidator() *ResourceValidator { +func ResourceIBMDLGatewayValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) dlTypeAllowedValues := "dedicated, connect" dlConnectionModeAllowedValues := "direct, transit" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: dlTypeAllowedValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlConnectionMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: dlConnectionModeAllowedValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlBfdInterval, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "300", MaxValue: "255000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlBfdMultiplier, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: true, MinValue: "1", MaxValue: "255"}) - ibmISDLGatewayResourceValidator := ResourceValidator{ResourceName: "ibm_dl_gateway", Schema: validateSchema} + ibmISDLGatewayResourceValidator := validate.ResourceValidator{ResourceName: "ibm_dl_gateway", Schema: validateSchema} return &ibmISDLGatewayResourceValidator } func directlinkClient(meta interface{}) (*directlinkv1.DirectLinkV1, error) { - sess, err := meta.(ClientSession).DirectlinkV1API() + sess, err := meta.(conns.ClientSession).DirectlinkV1API() return sess, err } @@ -514,7 +517,7 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error carrierName = d.Get(dlCarrierName).(string) // gatewayTemplateModel.CarrierName = &carrierName } else { - err = fmt.Errorf("Error creating gateway, %s is a required field", dlCarrierName) + err = fmt.Errorf("[ERROR] Error creating gateway, %s is a required field", dlCarrierName) log.Printf("%s is a required field", dlCarrierName) return err } @@ -522,7 +525,7 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error crossConnectRouter = d.Get(dlCrossConnectRouter).(string) // gatewayTemplateModel.CrossConnectRouter = &crossConnectRouter } else { - err = fmt.Errorf("Error creating gateway, %s is a required field", dlCrossConnectRouter) + err = fmt.Errorf("[ERROR] Error creating gateway, %s is a required field", dlCrossConnectRouter) log.Printf("%s is a required field", dlCrossConnectRouter) return err } @@ -530,7 +533,7 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error locationName = d.Get(dlLocationName).(string) //gatewayTemplateModel.LocationName = &locationName } else { - err = fmt.Errorf("Error creating gateway, %s is a required field", dlLocationName) + err = fmt.Errorf("[ERROR] Error creating gateway, %s is a required field", dlLocationName) log.Printf("%s is a required field", dlLocationName) return err } @@ -538,7 +541,7 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error customerName = d.Get(dlCustomerName).(string) //gatewayTemplateModel.CustomerName = &customerName } else { - err = fmt.Errorf("Error creating gateway, %s is a required field", dlCustomerName) + err = fmt.Errorf("[ERROR] Error creating gateway, %s is a required field", dlCustomerName) log.Printf("%s is a required field", dlCustomerName) return err } @@ -651,7 +654,7 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error createGatewayOptionsModel.GatewayTemplate = gatewayConnectTemplateModel } else { - err = fmt.Errorf("Error creating direct link connect gateway, %s is a required field", dlPort) + err = fmt.Errorf("[ERROR] Error creating direct link connect gateway, %s is a required field", dlPort) return err } } @@ -681,7 +684,7 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(dlTags); ok || v != "" { oldList, newList := d.GetChange(dlTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *gateway.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *gateway.Crn) if err != nil { log.Printf( "Error on create of resource direct link gateway %s (%s) tags: %s", dtype, d.Id(), err) @@ -713,7 +716,7 @@ func resourceIBMdlGatewayRead(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Direct Link Gateway (%s Template): %s\n%s", dtype, err, response) + return fmt.Errorf("[ERROR] Error Getting Direct Link Gateway (%s Template): %s\n%s", dtype, err, response) } if instance.Name != nil { d.Set(dlName, *instance.Name) @@ -842,24 +845,24 @@ func resourceIBMdlGatewayRead(d *schema.ResourceData, meta interface{}) error { gatewayChangeRequest := gatewayChangeRequestIntf.(*directlinkv1.GatewayChangeRequest) d.Set(dlChangeRequest, *gatewayChangeRequest.Type) } - tags, err := GetTagsUsingCRN(meta, *instance.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *instance.Crn) if err != nil { log.Printf( "Error on get of resource direct link gateway (%s) tags: %s", d.Id(), err) } d.Set(dlTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/interconnectivity/direct-link") - d.Set(ResourceName, *instance.Name) - d.Set(ResourceCRN, *instance.Crn) - d.Set(ResourceStatus, *instance.OperationalStatus) + d.Set(flex.ResourceControllerURL, controller+"/interconnectivity/direct-link") + d.Set(flex.ResourceName, *instance.Name) + d.Set(flex.ResourceCRN, *instance.Crn) + d.Set(flex.ResourceStatus, *instance.OperationalStatus) if instance.ResourceGroup != nil { rg := instance.ResourceGroup d.Set(dlResourceGroup, *rg.ID) - d.Set(ResourceGroupName, *rg.ID) + d.Set(flex.ResourceGroupName, *rg.ID) } //Show the BFD Config parameters if set @@ -902,7 +905,7 @@ func isDirectLinkRefreshFunc(client *directlinkv1.DirectLinkV1, id string) resou } instance, response, err := client.GetGateway(getOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Direct Link: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Direct Link: %s\n%s", err, response) } if *instance.OperationalStatus == "provisioned" || *instance.OperationalStatus == "failed" || *instance.OperationalStatus == "create_rejected" { return instance, dlGatewayProvisioningDone, nil @@ -935,7 +938,7 @@ func resourceIBMdlGatewayUpdate(d *schema.ResourceData, meta interface{}) error if d.HasChange(dlTags) { oldList, newList := d.GetChange(dlTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) if err != nil { log.Printf( "Error on update of resource direct link gateway (%s) tags: %s", *instance.ID, err) @@ -1101,7 +1104,7 @@ func resourceIBMdlGatewayExists(d *schema.ResourceData, meta interface{}) (bool, d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting Direct Link Gateway : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Direct Link Gateway : %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_gateway_virtual_connection.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_gateway_virtual_connection.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_gateway_virtual_connection.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_gateway_virtual_connection.go index 1eda4e9c07..f6aaa307a9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_gateway_virtual_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_gateway_virtual_connection.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/directlinkv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -25,7 +27,7 @@ const ( dlVirtualConnectionId = "virtual_connection_id" ) -func resourceIBMDLGatewayVC() *schema.Resource { +func ResourceIBMDLGatewayVC() *schema.Resource { return &schema.Resource{ Create: resourceIBMdlGatewayVCCreate, Read: resourceIBMdlGatewayVCRead, @@ -51,14 +53,14 @@ func resourceIBMDLGatewayVC() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_dl_virtual_connection", dlVCType), + ValidateFunc: validate.InvokeValidator("ibm_dl_virtual_connection", dlVCType), Description: "The type of virtual connection.Allowable values (classic,vpc)", }, dlVCName: { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_dl_virtual_connection", dlVCName), + ValidateFunc: validate.InvokeValidator("ibm_dl_virtual_connection", dlVCName), Description: "The user-defined name for this virtual connection. Virtualconnection names are unique within a gateway. This is the name of thevirtual connection itself, the network being connected may have its ownname attribute", }, dlVCNetworkId: { @@ -90,7 +92,7 @@ func resourceIBMDLGatewayVC() *schema.Resource { Description: "The Direct Gateway virtual connection identifier", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the Direct link gateway", @@ -98,28 +100,28 @@ func resourceIBMDLGatewayVC() *schema.Resource { }, } } -func resourceIBMdlGatewayVCValidator() *ResourceValidator { +func ResourceIBMDLGatewayVCValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) vcType := "classic, vpc" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlVCType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: vcType}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlVCName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmDLGatewayVCResourceValidator := ResourceValidator{ResourceName: "ibm_dl_virtual_connection", Schema: validateSchema} + ibmDLGatewayVCResourceValidator := validate.ResourceValidator{ResourceName: "ibm_dl_virtual_connection", Schema: validateSchema} return &ibmDLGatewayVCResourceValidator } @@ -160,7 +162,7 @@ func resourceIBMdlGatewayVCRead(d *schema.ResourceData, meta interface{}) error if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -177,7 +179,7 @@ func resourceIBMdlGatewayVCRead(d *schema.ResourceData, meta interface{}) error d.SetId("") return nil } - return fmt.Errorf("Error Getting Directlink Gateway Connection (%s): %s\n%s", ID, err, response) + return fmt.Errorf("[ERROR] Error Getting Directlink Gateway Connection (%s): %s\n%s", ID, err, response) } if instance.Name != nil { @@ -205,9 +207,9 @@ func resourceIBMdlGatewayVCRead(d *schema.ResourceData, meta interface{}) error } dlgw, response, err := directLink.GetGateway(getGatewayOptions) if err != nil { - return fmt.Errorf("Error Getting Direct Link Gateway (Dedicated Template): %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Direct Link Gateway (Dedicated Template): %s\n%s", err, response) } - d.Set(RelatedCRN, *dlgw.Crn) + d.Set(flex.RelatedCRN, *dlgw.Crn) return nil } @@ -217,7 +219,7 @@ func resourceIBMdlGatewayVCUpdate(d *schema.ResourceData, meta interface{}) erro if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -261,7 +263,7 @@ func resourceIBMdlGatewayVCDelete(d *schema.ResourceData, meta interface{}) erro if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -288,12 +290,12 @@ func resourceIBMdlGatewayVCExists(d *schema.ResourceData, meta interface{}) (boo if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of gatewayID/gatewayVCID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of gatewayID/gatewayVCID", d.Id()) } gatewayId := parts[0] ID := parts[1] @@ -308,7 +310,7 @@ func resourceIBMdlGatewayVCExists(d *schema.ResourceData, meta interface{}) (boo d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting Direct Link Gateway (Dedicated Template) Virtual Connection: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Direct Link Gateway (Dedicated Template) Virtual Connection: %s\n%s", err, response) } if response.StatusCode == 404 { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_provider_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_provider_gateway.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_provider_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_provider_gateway.go index 07bd6674ba..e3f4b27495 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_dl_provider_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink/resource_ibm_dl_provider_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package directlink import ( "context" @@ -9,6 +9,8 @@ import ( "log" "os" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -17,7 +19,7 @@ const ( customerAccountID = "customer_account_id" ) -func resourceIBMDLProviderGateway() *schema.Resource { +func ResourceIBMDLProviderGateway() *schema.Resource { return &schema.Resource{ Create: resourceIBMdlProviderGatewayCreate, Read: resourceIBMdlProviderGatewayRead, @@ -27,7 +29,7 @@ func resourceIBMDLProviderGateway() *schema.Resource { Importer: &schema.ResourceImporter{}, CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -75,10 +77,9 @@ func resourceIBMDLProviderGateway() *schema.Resource { Required: true, ForceNew: false, Description: "The unique user-defined name for this gateway", - ValidateFunc: InvokeValidator("ibm_dl_provider_gateway", dlName), + ValidateFunc: validate.InvokeValidator("ibm_dl_provider_gateway", dlName), // ValidateFunc: validateRegexpLen(1, 63, "^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$"), }, - dlSpeedMbps: { Type: schema.TypeInt, Required: true, @@ -90,7 +91,7 @@ func resourceIBMDLProviderGateway() *schema.Resource { Required: true, ForceNew: true, Description: "Customer IBM Cloud account ID for the new gateway. A gateway object containing the pending create request will become available in the specified account.", - ValidateFunc: InvokeValidator("ibm_dl_provider_gateway", customerAccountID), + ValidateFunc: validate.InvokeValidator("ibm_dl_provider_gateway", customerAccountID), }, dlOperationalStatus: { Type: schema.TypeString, @@ -109,6 +110,7 @@ func resourceIBMDLProviderGateway() *schema.Resource { }, dlVlan: { Type: schema.TypeInt, + Optional: true, Computed: true, Description: "VLAN allocated for this gateway", }, @@ -121,35 +123,35 @@ func resourceIBMDLProviderGateway() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_dl_provider_gateway", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_dl_provider_gateway", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the direct link gateway", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -158,39 +160,39 @@ func resourceIBMDLProviderGateway() *schema.Resource { } } -func resourceIBMDLProviderGatewayValidator() *ResourceValidator { +func ResourceIBMDLProviderGatewayValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: customerAccountID, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[0-9a-f]+$`, MinValueLength: 1, MaxValueLength: 32}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: dlName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISDLGatewayResourceValidator := ResourceValidator{ResourceName: "ibm_dl_provider_gateway", Schema: validateSchema} + ibmISDLGatewayResourceValidator := validate.ResourceValidator{ResourceName: "ibm_dl_provider_gateway", Schema: validateSchema} return &ibmISDLGatewayResourceValidator } @@ -203,8 +205,8 @@ func resourceIBMdlProviderGatewayCreate(d *schema.ResourceData, meta interface{} speed := int64(d.Get(dlSpeedMbps).(int)) custAccountID := d.Get(customerAccountID).(string) bgpAsn := int64(d.Get(dlBgpAsn).(int)) - var portID string - portID = d.Get(dlPort).(string) + // var portID string + portID := d.Get(dlPort).(string) portIdentity, _ := directLink.NewProviderGatewayPortIdentity(portID) gatewayOptions := directLink.NewCreateProviderGatewayOptions(bgpAsn, custAccountID, name, portIdentity, speed) if _, ok := d.GetOk(dlBgpIbmCidr); ok { @@ -218,6 +220,12 @@ func resourceIBMdlProviderGatewayCreate(d *schema.ResourceData, meta interface{} } + if _, ok := d.GetOk(dlVlan); ok { + vlan := int64(d.Get(dlVlan).(int)) + gatewayOptions.Vlan = &vlan + + } + gateway, response, err := directLink.CreateProviderGateway(gatewayOptions) if err != nil { log.Printf("[DEBUG] Create Direct Link Provider Gateway err %s\n%s", err, response) @@ -230,7 +238,7 @@ func resourceIBMdlProviderGatewayCreate(d *schema.ResourceData, meta interface{} v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(dlTags); ok || v != "" { oldList, newList := d.GetChange(dlTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *gateway.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *gateway.Crn) if err != nil { log.Printf( "Error on create of resource direct link Provider gateway (%s) tags: %s", d.Id(), err) @@ -261,7 +269,7 @@ func resourceIBMdlProviderGatewayRead(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error Getting Direct Link Gateway (%s Template): %s\n%s", dtype, err, response) + return fmt.Errorf("[ERROR] Error Getting Direct Link Gateway (%s Template): %s\n%s", dtype, err, response) } if instance.Name != nil { d.Set(dlName, *instance.Name) @@ -278,7 +286,6 @@ func resourceIBMdlProviderGatewayRead(d *schema.ResourceData, meta interface{}) if instance.BgpIbmAsn != nil { d.Set(dlBgpIbmAsn, *instance.BgpIbmAsn) } - if instance.BgpCerCidr != nil { d.Set(dlBgpCerCidr, *instance.BgpCerCidr) } @@ -311,20 +318,20 @@ func resourceIBMdlProviderGatewayRead(d *schema.ResourceData, meta interface{}) if instance.CreatedAt != nil { d.Set(dlCreatedAt, instance.CreatedAt.String()) } - tags, err := GetTagsUsingCRN(meta, *instance.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *instance.Crn) if err != nil { log.Printf( "Error on get of resource direct link gateway (%s) tags: %s", d.Id(), err) } d.Set(dlTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/interconnectivity/direct-link") - d.Set(ResourceName, *instance.Name) - d.Set(ResourceCRN, *instance.Crn) - d.Set(ResourceStatus, *instance.OperationalStatus) + d.Set(flex.ResourceControllerURL, controller+"/interconnectivity/direct-link") + d.Set(flex.ResourceName, *instance.Name) + d.Set(flex.ResourceCRN, *instance.Crn) + d.Set(flex.ResourceStatus, *instance.OperationalStatus) return nil } @@ -341,12 +348,15 @@ func resourceIBMdlProviderGatewayUpdate(d *schema.ResourceData, meta interface{} log.Printf("[INFO] Calling getgateway provider api") instance, response, err := directLink.GetProviderGateway(getOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error getting provider gateway %s, %s", err, response) + } updateGatewayOptionsModel := directLink.NewUpdateProviderGatewayOptions(ID) if d.HasChange(dlTags) { oldList, newList := d.GetChange(dlTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) if err != nil { log.Printf( "Error on update of resource direct link gateway dedicated (%s) tags: %s", *instance.ID, err) @@ -373,7 +383,10 @@ func resourceIBMdlProviderGatewayUpdate(d *schema.ResourceData, meta interface{} bgpIbmCidr := d.Get(dlBgpIbmCidr).(string) updateGatewayOptionsModel.BgpIbmCidr = &bgpIbmCidr } - + if d.HasChange(dlVlan) { + vlan := int64(d.Get(dlVlan).(int)) + updateGatewayOptionsModel.Vlan = &vlan + } _, response, err = directLink.UpdateProviderGateway(updateGatewayOptionsModel) if err != nil { log.Printf("[DEBUG] Update Direct Link Provider Gateway err %s\n%s", err, response) @@ -419,7 +432,7 @@ func resourceIBMdlProviderGatewayExists(d *schema.ResourceData, meta interface{} d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting Direct Link Provider Gateway : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Direct Link Provider Gateway : %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/README.md new file mode 100644 index 0000000000..2c96d0d8f0 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider DNS Services + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the DNS Services resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/dns_custom_resolver) +* IBM API Docs: [IBM API Docs for DNS Services](https://cloud.ibm.com/apidocs/dns-svcs) +* IBM DNS Services SDK: [IBM SDK for DNS Services](https://github.com/IBM/networking-go-sdk/tree/master/dnssvcsv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_custom_resolver.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_custom_resolver.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_custom_resolver.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_custom_resolver.go index c0a4300613..49733eeabc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_custom_resolver.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_custom_resolver.go @@ -1,18 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "context" "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMDNSCustomResolver() *schema.Resource { +func DataSourceIBMPrivateDNSCustomResolver() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMDNSCustomResolverRead, @@ -88,7 +89,7 @@ func dataSourceIBMDNSCustomResolver() *schema.Resource { } func dataSourceIBMDNSCustomResolverRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } @@ -97,7 +98,7 @@ func dataSourceIBMDNSCustomResolverRead(context context.Context, d *schema.Resou opt := sess.NewListCustomResolversOptions(instanceID) result, resp, err := sess.ListCustomResolversWithContext(context, opt) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error listing the custom resolvers %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error listing the custom resolvers %s:%s", err, resp)) } customResolvers := make([]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_custom_resolver_forwarding_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_custom_resolver_forwarding_rules.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_custom_resolver_forwarding_rules.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_custom_resolver_forwarding_rules.go index 96b741f851..25bcabd67c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_custom_resolver_forwarding_rules.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_custom_resolver_forwarding_rules.go @@ -1,18 +1,19 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "context" "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMPrivateDNSForwardingRules() *schema.Resource { +func DataSourceIBMPrivateDNSForwardingRules() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmDnsCrForwardingRulesRead, @@ -68,7 +69,7 @@ func dataSourceIBMPrivateDNSForwardingRules() *schema.Resource { } func dataSourceIbmDnsCrForwardingRulesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } @@ -79,7 +80,7 @@ func dataSourceIbmDnsCrForwardingRulesRead(context context.Context, d *schema.Re result, resp, err := sess.ListForwardingRulesWithContext(context, opt) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error listing the forwarding rules %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error listing the forwarding rules %s:%s", err, resp)) } forwardRules := make([]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glb_monitors.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glb_monitors.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glb_monitors.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glb_monitors.go index 537d3bd98c..4d34b1209f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glb_monitors.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glb_monitors.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,7 +15,7 @@ const ( pdnsGLBMonitors = "dns_glb_monitors" ) -func dataSourceIBMPrivateDNSGLBMonitors() *schema.Resource { +func DataSourceIBMPrivateDNSGLBMonitors() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMPrivateDNSGLBMonitorsRead, @@ -130,7 +131,7 @@ func dataSourceIBMPrivateDNSGLBMonitors() *schema.Resource { func dataSourceIBMPrivateDNSGLBMonitorsRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -138,7 +139,7 @@ func dataSourceIBMPrivateDNSGLBMonitorsRead(d *schema.ResourceData, meta interfa listDNSGLBMonitorions := sess.NewListMonitorsOptions(instanceID) availableGLBMonitors, detail, err := sess.ListMonitors(listDNSGLBMonitorions) if err != nil { - return fmt.Errorf("Error reading list of pdns GLB monitors:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of pdns GLB monitors:%s\n%s", err, detail) } dnsMonitors := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glb_pools.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glb_pools.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glb_pools.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glb_pools.go index 56ccb5f636..e06017a311 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glb_pools.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glb_pools.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,7 +15,7 @@ const ( pdnsGLBPools = "dns_glb_pools" ) -func dataSourceIBMPrivateDNSGLBPools() *schema.Resource { +func DataSourceIBMPrivateDNSGLBPools() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMPrivateDNSGLBPoolsRead, Schema: map[string]*schema.Schema{ @@ -140,7 +141,7 @@ func dataSourceIBMPrivateDNSGLBPools() *schema.Resource { func dataSourceIBMPrivateDNSGLBPoolsRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -148,7 +149,7 @@ func dataSourceIBMPrivateDNSGLBPoolsRead(d *schema.ResourceData, meta interface{ listDNSGLBPooloptions := sess.NewListPoolsOptions(instanceID) availableGLBPools, detail, err := sess.ListPools(listDNSGLBPooloptions) if err != nil { - return fmt.Errorf("Error reading list of pdns GLB pools:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of pdns GLB pools:%s\n%s", err, detail) } d.Set(pdnsInstanceID, instanceID) dnsPools := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glbs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glbs.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glbs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glbs.go index c5b67193dc..745b52859a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_glbs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_glbs.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,7 +15,7 @@ const ( pdnsGLBs = "dns_glbs" ) -func dataSourceIBMPrivateDNSGLBs() *schema.Resource { +func DataSourceIBMPrivateDNSGLBs() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMPrivateDNSGLBsRead, @@ -121,7 +122,7 @@ func dataSourceIBMPrivateDNSGLBs() *schema.Resource { func dataSourceIBMPrivateDNSGLBsRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -130,7 +131,7 @@ func dataSourceIBMPrivateDNSGLBsRead(d *schema.ResourceData, meta interface{}) e listDNSGLBs := sess.NewListLoadBalancersOptions(instanceID, zoneID) availableGLBs, detail, err := sess.ListLoadBalancers(listDNSGLBs) if err != nil { - return fmt.Errorf("Error reading list of pdns GLB load balancers:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of pdns GLB load balancers:%s\n%s", err, detail) } dnslbs := make([]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_permitted_network.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_permitted_network.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_permitted_network.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_permitted_network.go index 3171743c5b..8f0395c846 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_permitted_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_permitted_network.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,7 +15,7 @@ const ( pdnsPermittedNetworks = "dns_permitted_networks" ) -func dataSourceIBMPrivateDNSPermittedNetworks() *schema.Resource { +func DataSourceIBMPrivateDNSPermittedNetworks() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMPrivateDNSPermittedNetworksRead, @@ -96,7 +97,7 @@ func dataSourceIBMPrivateDNSPermittedNetworks() *schema.Resource { } func dataSourceIBMPrivateDNSPermittedNetworksRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -106,7 +107,7 @@ func dataSourceIBMPrivateDNSPermittedNetworksRead(d *schema.ResourceData, meta i listPermittedNetworkOptions := sess.NewListPermittedNetworksOptions(instanceID, dnsZoneID) availablePermittedNetworks, detail, err := sess.ListPermittedNetworks(listPermittedNetworkOptions) if err != nil { - return fmt.Errorf("Error reading list of pdns permitted networks:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of pdns permitted networks:%s\n%s", err, detail) } permittedNetworks := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_resource_records.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_resource_records.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_resource_records.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_resource_records.go index 79f6fd4869..f96f27a5dd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_resource_records.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_resource_records.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "encoding/json" "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +16,7 @@ const ( pdnsResourceRecords = "dns_resource_records" ) -func dataSourceIBMPrivateDNSResourceRecords() *schema.Resource { +func DataSourceIBMPrivateDNSResourceRecords() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMPrivateDNSResourceRecordsRead, Schema: map[string]*schema.Schema{ @@ -69,7 +70,7 @@ func dataSourceIBMPrivateDNSResourceRecords() *schema.Resource { func dataSourceIBMPrivateDNSResourceRecordsRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -78,7 +79,7 @@ func dataSourceIBMPrivateDNSResourceRecordsRead(d *schema.ResourceData, meta int listDNSResRecOptions := sess.NewListResourceRecordsOptions(instanceID, DnszoneID) availableDNSResRecs, detail, err := sess.ListResourceRecords(listDNSResRecOptions) if err != nil { - return fmt.Errorf("Error reading list of pdns resource records:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of pdns resource records:%s\n%s", err, detail) } dnsResRecs := make([]map[string]interface{}, 0) for _, instance := range availableDNSResRecs.ResourceRecords { @@ -89,7 +90,7 @@ func dataSourceIBMPrivateDNSResourceRecordsRead(d *schema.ResourceData, meta int // Marshal the rdata map into a JSON string rData, err := json.Marshal(instance.Rdata) if err != nil { - return fmt.Errorf("Error reading rdata map of dns resource records:%s", err) + return fmt.Errorf("[ERROR] Error reading rdata map of dns resource records:%s", err) } jsonStr := string(rData) dnsRecord[pdnsRdata] = jsonStr diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_zones.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_zones.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_zones.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_zones.go index 603875a331..b91af1e75f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_private_dns_zones.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/data_source_ibm_private_dns_zones.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,7 +15,7 @@ const ( pdnsZones = "dns_zones" ) -func dataSourceIBMPrivateDNSZones() *schema.Resource { +func DataSourceIBMPrivateDNSZones() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMPrivateDNSZonesRead, Schema: map[string]*schema.Schema{ @@ -78,7 +79,7 @@ func dataSourceIBMPrivateDNSZones() *schema.Resource { func dataSourceIBMPrivateDNSZonesRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -86,7 +87,7 @@ func dataSourceIBMPrivateDNSZonesRead(d *schema.ResourceData, meta interface{}) listDNSZonesOptions := sess.NewListDnszonesOptions(instanceID) availableDNSZones, detail, err := sess.ListDnszones(listDNSZonesOptions) if err != nil { - return fmt.Errorf("Error reading list of dns zones:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of dns zones:%s\n%s", err, detail) } dnsZones := make([]map[string]interface{}, 0) for _, instance := range availableDNSZones.Dnszones { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver.go index 84972125f5..8ba4a596b3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "context" @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/networking-go-sdk/dnssvcsv1" "github.com/IBM/go-sdk-core/v5/core" @@ -40,7 +42,7 @@ const ( pdnsCRHighAvailability = "high_availability" ) -func resouceIBMPrivateDNSCustomResolver() *schema.Resource { +func ResourceIBMPrivateDNSCustomResolver() *schema.Resource { return &schema.Resource{ CreateContext: resouceIBMPrivateDNSCustomResolverCreate, ReadContext: resouceIBMPrivateDNSCustomResolverRead, @@ -99,7 +101,7 @@ func resouceIBMPrivateDNSCustomResolver() *schema.Resource { Type: schema.TypeSet, Description: "Locations on which the custom resolver will be running", Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ pdnsCRLocationId: { @@ -131,7 +133,42 @@ func resouceIBMPrivateDNSCustomResolver() *schema.Resource { }, }, }, - + pdnsCRForwardRules: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + pdnsCRFRRuleID: { + Type: schema.TypeString, + Computed: true, + Description: "Identifier of the forwarding rule.", + }, + pdnsCRFRDesctiption: { + Type: schema.TypeString, + Computed: true, + Description: "Descriptive text of the forwarding rule.", + }, + pdnsCRFRType: { + Type: schema.TypeString, + Computed: true, + Description: "Type of the forwarding rule.", + }, + pdnsCRFRMatch: { + Type: schema.TypeString, + Computed: true, + Description: "The matching zone or hostname.", + }, + pdnsCRFRForwardTo: { + Type: schema.TypeList, + Computed: true, + Description: "The upstream DNS servers will be forwarded to.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, pdnsCRCreatedOn: { Type: schema.TypeString, Computed: true, @@ -148,7 +185,7 @@ func resouceIBMPrivateDNSCustomResolver() *schema.Resource { } func resouceIBMPrivateDNSCustomResolverCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } @@ -186,10 +223,10 @@ func resouceIBMPrivateDNSCustomResolverCreate(context context.Context, d *schema result, resp, err := sess.CreateCustomResolverWithContext(context, customResolverOption) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error reading the custom resolver %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading the custom resolver %s:%s", err, resp)) } - d.SetId(convertCisToTfTwoVar(*result.ID, crn)) + d.SetId(flex.ConvertCisToTfTwoVar(*result.ID, crn)) d.Set(pdnsCRId, *result.ID) if crLocationCreate { @@ -204,12 +241,12 @@ func resouceIBMPrivateDNSCustomResolverCreate(context context.Context, d *schema func resouceIBMPrivateDNSCustomResolverRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } - customResolverID, crn, err := convertTftoCisTwoVar(d.Id()) + customResolverID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return diag.FromErr(err) } @@ -222,7 +259,24 @@ func resouceIBMPrivateDNSCustomResolverRead(context context.Context, d *schema.R d.SetId("") return nil } - return diag.FromErr(fmt.Errorf("Error reading the custom resolver %s:%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading the custom resolver %s:%s", err, response)) + } + fwopt := sess.NewListForwardingRulesOptions(crn, customResolverID) + + fwresult, fwresp, fwerr := sess.ListForwardingRulesWithContext(context, fwopt) + if fwerr != nil || fwresult == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error listing the forwarding rules %s:%s", fwerr, fwresp)) + } + + forwardRules := make([]interface{}, 0) + for _, instance := range fwresult.ForwardingRules { + forwardRule := map[string]interface{}{} + forwardRule[pdnsCRFRRuleID] = *instance.ID + forwardRule[pdnsCRFRDesctiption] = *instance.Description + forwardRule[pdnsCRFRType] = *instance.Type + forwardRule[pdnsCRFRMatch] = *instance.Match + forwardRule[pdnsCRFRForwardTo] = instance.ForwardTo + forwardRules = append(forwardRules, forwardRule) } d.Set(pdnsInstanceID, crn) d.Set(pdnsCRId, *result.ID) @@ -231,17 +285,17 @@ func resouceIBMPrivateDNSCustomResolverRead(context context.Context, d *schema.R d.Set(pdnsCRHealth, *result.Health) d.Set(pdnsCREnabled, *result.Enabled) d.Set(pdnsCustomResolverLocations, flattenPdnsCRLocations(result.Locations)) - + d.Set(pdnsCRForwardRules, forwardRules) return nil } func resouceIBMPrivateDNSCustomResolverUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } - customResolverID, crn, err := convertTftoCisTwoVar(d.Id()) + customResolverID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return diag.FromErr(err) } @@ -266,7 +320,7 @@ func resouceIBMPrivateDNSCustomResolverUpdate(context context.Context, d *schema result, resp, err := sess.UpdateCustomResolverWithContext(context, opt) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error updating the custom resolver %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the custom resolver %s:%s", err, resp)) } } @@ -276,12 +330,12 @@ func resouceIBMPrivateDNSCustomResolverUpdate(context context.Context, d *schema func resouceIBMPrivateDNSCustomResolverDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } - customResolverID, crn, err := convertTftoCisTwoVar(d.Id()) + customResolverID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return diag.FromErr(err) } @@ -290,7 +344,7 @@ func resouceIBMPrivateDNSCustomResolverDelete(context context.Context, d *schema optEnabled.SetEnabled(false) result, resp, errEnabled := sess.UpdateCustomResolverWithContext(context, optEnabled) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error updating the custom resolver to disable before deleting %s:%s", errEnabled, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the custom resolver to disable before deleting %s:%s", errEnabled, resp)) } opt := sess.NewDeleteCustomResolverOptions(crn, customResolverID) @@ -300,7 +354,7 @@ func resouceIBMPrivateDNSCustomResolverDelete(context context.Context, d *schema if response != nil && response.StatusCode == 404 { return nil } - return diag.FromErr(fmt.Errorf("Error deleting the custom resolver %s:%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting the custom resolver %s:%s", err, response)) } d.SetId("") @@ -309,12 +363,12 @@ func resouceIBMPrivateDNSCustomResolverDelete(context context.Context, d *schema func resouceIBMPrivateDNSCustomResolverExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } - customResolverID, crn, err := convertTftoCisTwoVar(d.Id()) + customResolverID, crn, err := flex.ConvertTftoCisTwoVar(d.Id()) if err != nil { return false, err } @@ -361,7 +415,7 @@ func expandPdnsCRLocations(crLocList *schema.Set) (crLocations []dnssvcsv1.Locat } func waitForPDNSCustomResolverHealthy(d *schema.ResourceData, meta interface{}) (interface{}, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return nil, err } @@ -370,9 +424,9 @@ func waitForPDNSCustomResolverHealthy(d *schema.ResourceData, meta interface{}) g := strings.SplitN(d.Id(), ":", -1) if len(g) > 2 { - _, customResolverID, crn, _ = convertTfToCisThreeVar(d.Id()) + _, customResolverID, crn, _ = flex.ConvertTfToCisThreeVar(d.Id()) } else { - customResolverID, crn, _ = convertTftoCisTwoVar(d.Id()) + customResolverID, crn, _ = flex.ConvertTftoCisTwoVar(d.Id()) } opt := sess.NewGetCustomResolverOptions(crn, customResolverID) @@ -384,7 +438,7 @@ func waitForPDNSCustomResolverHealthy(d *schema.ResourceData, meta interface{}) res, detail, err := sess.GetCustomResolver(opt) if err != nil { if detail != nil && detail.StatusCode == 404 { - return nil, "", fmt.Errorf("The custom resolver %s does not exist anymore: %v", customResolverID, err) + return nil, "", fmt.Errorf("[ERROR] The custom resolver %s does not exist anymore: %v", customResolverID, err) } return nil, "", fmt.Errorf("Get the custom resolver %s failed with resp code: %s, err: %v", customResolverID, detail, err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver_forwarding_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver_forwarding_rule.go new file mode 100644 index 0000000000..2f2d6664cf --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver_forwarding_rule.go @@ -0,0 +1,211 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package dnsservices + +import ( + "context" + "fmt" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + pdnsCRForwardRule = "ibm_dns_custom_resolver_forwarding_rule" + pdnsCRForwardRules = "rules" + pdnsCRFRResolverID = "resolver_id" + pdnsCRFRDesctiption = "description" + pdnsCRFRType = "type" + pdnsCRFRMatch = "match" + pdnsCRFRForwardTo = "forward_to" + pdnsCRFRRuleID = "rule_id" + pdnsCRFRCreatedOn = "created_on" + pdnsCRFRModifiedOn = "modified_on" +) + +func ResourceIBMPrivateDNSForwardingRule() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmDnsCrForwardingRuleCreate, + ReadContext: resourceIbmDnsCrForwardingRuleRead, + UpdateContext: resourceIbmDnsCrForwardingRuleUpdate, + DeleteContext: resourceIbmDnsCrForwardingRuleDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + pdnsInstanceID: { + Type: schema.TypeString, + Required: true, + Description: "The unique identifier of a service instance.", + }, + pdnsCRFRResolverID: { + Type: schema.TypeString, + Required: true, + Description: "The unique identifier of a custom resolver.", + }, + pdnsCRFRDesctiption: { + Type: schema.TypeString, + Optional: true, + Description: "Descriptive text of the forwarding rule.", + }, + pdnsCRFRType: { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator(pdnsCRForwardRule, "type"), + Description: "Type of the forwarding rule.", + }, + pdnsCRFRMatch: { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The matching zone or hostname.", + }, + pdnsCRFRForwardTo: { + Type: schema.TypeList, + Optional: true, + Description: "The upstream DNS servers will be forwarded to.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + pdnsCRFRRuleID: { + Type: schema.TypeString, + Computed: true, + Description: "the time when a forwarding rule ID is created, RFC3339 format.", + }, + }, + } +} + +func ResourceIBMPrivateDNSForwardingRuleValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "type", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: "hostname, zone, Default", + }, + ) + + resourceValidator := validate.ResourceValidator{ResourceName: pdnsCRForwardRule, Schema: validateSchema} + return &resourceValidator +} + +func resourceIbmDnsCrForwardingRuleCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + dnsSvcsClient, err := meta.(conns.ClientSession).PrivateDNSClientSession() + if err != nil { + return diag.FromErr(err) + } + instanceID := d.Get(pdnsInstanceID).(string) + resolverID := d.Get(pdnsCRFRResolverID).(string) + opt := dnsSvcsClient.NewCreateForwardingRuleOptions(instanceID, resolverID) + + if des, ok := d.GetOk(pdnsCRFRDesctiption); ok { + opt.SetDescription(des.(string)) + } + if t, ok := d.GetOk(pdnsCRFRType); ok { + opt.SetType(t.(string)) + } + if m, ok := d.GetOk(pdnsCRFRMatch); ok { + opt.SetMatch(m.(string)) + } + if _, ok := d.GetOk(pdnsCRFRForwardTo); ok { + opt.SetForwardTo(flex.ExpandStringList(d.Get(pdnsCRFRForwardTo).([]interface{}))) + } + result, resp, err := dnsSvcsClient.CreateForwardingRuleWithContext(context, opt) + + if err != nil || result == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error creating the forwarding rules %s:%s", err, resp)) + } + d.SetId(flex.ConvertCisToTfThreeVar(*result.ID, resolverID, instanceID)) + + return resourceIbmDnsCrForwardingRuleRead(context, d, meta) +} + +func resourceIbmDnsCrForwardingRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + dnsSvcsClient, err := meta.(conns.ClientSession).PrivateDNSClientSession() + if err != nil { + return diag.FromErr(err) + } + ruleID, resolverID, instanceID, err := flex.ConvertTfToCisThreeVar(d.Id()) + opt := dnsSvcsClient.NewGetForwardingRuleOptions(instanceID, resolverID, ruleID) + result, resp, err := dnsSvcsClient.GetForwardingRuleWithContext(context, opt) + + if err != nil || result == nil { + if resp != nil && resp.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error reading the forwarding rules %s:%s", err, resp)) + } + d.Set(pdnsInstanceID, instanceID) + d.Set(pdnsCRFRResolverID, resolverID) + d.Set(pdnsCRFRRuleID, ruleID) + d.Set(pdnsCRFRDesctiption, *result.Description) + d.Set(pdnsCRFRType, *result.Type) + d.Set(pdnsCRFRMatch, *result.Match) + d.Set(pdnsCRFRForwardTo, result.ForwardTo) + return nil + +} +func resourceIbmDnsCrForwardingRuleUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + dnsSvcsClient, err := meta.(conns.ClientSession).PrivateDNSClientSession() + if err != nil { + return diag.FromErr(err) + } + ruleID, resolverID, instanceID, err := flex.ConvertTfToCisThreeVar(d.Id()) + + if err != nil { + return diag.FromErr(err) + } + opt := dnsSvcsClient.NewUpdateForwardingRuleOptions(instanceID, resolverID, ruleID) + + if d.HasChange(pdnsCRFRDesctiption) || + d.HasChange(pdnsCRFRMatch) || + d.HasChange(pdnsCRFRForwardTo) { + if des, ok := d.GetOk(pdnsCRFRDesctiption); ok { + frdesc := des.(string) + opt.SetDescription(frdesc) + } + if _, ok := d.GetOk(pdnsCRFRForwardTo); ok { + opt.SetForwardTo(flex.ExpandStringList(d.Get(pdnsCRFRForwardTo).([]interface{}))) + } + if ty, ok := d.GetOk(pdnsCRFRType); ok { + crtype := ty.(string) + if strings.ToLower(crtype) == "Default" { + if match, ok := d.GetOk(pdnsCRFRMatch); ok { + frmatch := match.(string) + opt.SetMatch(frmatch) + } + } + } + result, resp, err := dnsSvcsClient.UpdateForwardingRuleWithContext(context, opt) + if err != nil || result == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the forwarding rule %s:%s", err, resp)) + } + + } + return resourceIbmDnsCrForwardingRuleRead(context, d, meta) +} + +func resourceIbmDnsCrForwardingRuleDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + dnsSvcsClient, err := meta.(conns.ClientSession).PrivateDNSClientSession() + if err != nil { + return diag.FromErr(err) + } + ruleID, resolverID, instanceID, err := flex.ConvertTfToCisThreeVar(d.Id()) + opt := dnsSvcsClient.NewDeleteForwardingRuleOptions(instanceID, resolverID, ruleID) + response, err := dnsSvcsClient.DeleteForwardingRuleWithContext(context, opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting the Forwarding Rules %s:%s", err, response)) + } + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver_location.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver_location.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver_location.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver_location.go index 26d6f83a2c..779344ee46 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_custom_resolver_location.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_custom_resolver_location.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -21,7 +23,7 @@ const ( pdnsCustomReolverEnabled = "cr_enabled" ) -func resourceIBMPrivateDNSCRLocation() *schema.Resource { +func ResourceIBMPrivateDNSCRLocation() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPrivateDNSLocationCreate, ReadContext: resourceIBMPrivateDNSLocationRead, @@ -75,13 +77,13 @@ func resourceIBMPrivateDNSCRLocation() *schema.Resource { Type: schema.TypeBool, Optional: true, Default: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, }, } } func resourceIBMPrivateDNSLocationCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } @@ -89,8 +91,8 @@ func resourceIBMPrivateDNSLocationCreate(context context.Context, d *schema.Reso resolverID := d.Get(pdnsResolverID).(string) mk := "private_dns_resource_custom_resolver_location_" + instanceID + resolverID - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) opt := sess.NewAddCustomResolverLocationOptions(instanceID, resolverID) @@ -107,14 +109,14 @@ func resourceIBMPrivateDNSLocationCreate(context context.Context, d *schema.Reso optCr.SetEnabled(false) resultCr, respCr, errCr := sess.UpdateCustomResolverWithContext(context, optCr) if errCr != nil || resultCr == nil { - return diag.FromErr(fmt.Errorf("Error updating the custom resolver with cr_enable false %s:%s", errCr, respCr)) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the custom resolver with cr_enable false %s:%s", errCr, respCr)) } } result, resp, err := sess.AddCustomResolverLocationWithContext(context, opt) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error creating the custom resolver location %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error creating the custom resolver location %s:%s", err, resp)) } - d.SetId(convertCisToTfThreeVar(*result.ID, resolverID, instanceID)) + d.SetId(flex.ConvertCisToTfThreeVar(*result.ID, resolverID, instanceID)) if cr_enable, ok := d.GetOkExists(pdnsCustomReolverEnabled); ok { if cr_enable.(bool) && enable_loc { @@ -126,7 +128,7 @@ func resourceIBMPrivateDNSLocationCreate(context context.Context, d *schema.Reso optCr.SetEnabled(cr_enable.(bool)) resultCr, respCr, errCr := sess.UpdateCustomResolverWithContext(context, optCr) if errCr != nil || resultCr == nil { - return diag.FromErr(fmt.Errorf("Error updating the custom resolver %s:%s", errCr, respCr)) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the custom resolver %s:%s", errCr, respCr)) } } @@ -138,16 +140,16 @@ func resourceIBMPrivateDNSLocationRead(context context.Context, d *schema.Resour return nil } func resourceIBMPrivateDNSLocationUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } - locationID, resolverID, instanceID, err := convertTfToCisThreeVar(d.Id()) + locationID, resolverID, instanceID, err := flex.ConvertTfToCisThreeVar(d.Id()) mk := "private_dns_resource_custom_resolver_location_" + instanceID + resolverID - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) updatelocation := sess.NewUpdateCustomResolverLocationOptions(instanceID, resolverID, locationID) @@ -161,18 +163,18 @@ func resourceIBMPrivateDNSLocationUpdate(context context.Context, d *schema.Reso } result, resp, err := sess.UpdateCustomResolverLocationWithContext(context, updatelocation) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error updating the custom resolver location %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating the custom resolver location %s:%s", err, resp)) } } return resourceIBMPrivateDNSLocationRead(context, d, meta) } func resourceIBMPrivateDNSLocationDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return diag.FromErr(err) } - locationID, resolverID, instanceID, err := convertTfToCisThreeVar(d.Id()) + locationID, resolverID, instanceID, err := flex.ConvertTfToCisThreeVar(d.Id()) delete_loc := true if cr_enable, ok := d.GetOkExists(pdnsCustomReolverEnabled); ok { if cr_enable.(bool) { @@ -182,7 +184,7 @@ func resourceIBMPrivateDNSLocationDelete(context context.Context, d *schema.Reso result, resp, errEnabled := sess.UpdateCustomResolverWithContext(context, optEnabled) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error Disable and Update the custom resolver %s:%s", errEnabled, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Disable and Update the custom resolver %s:%s", errEnabled, resp)) } } else { // Disable the Cutsom Resolver Location @@ -190,7 +192,7 @@ func resourceIBMPrivateDNSLocationDelete(context context.Context, d *schema.Reso updatelocation.SetEnabled(false) result, resp, err := sess.UpdateCustomResolverLocationWithContext(context, updatelocation) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error Disbale and updating the custom resolver location %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Disbale and updating the custom resolver location %s:%s", err, resp)) } } } @@ -199,7 +201,7 @@ func resourceIBMPrivateDNSLocationDelete(context context.Context, d *schema.Reso updatelocation.SetEnabled(false) result, resp, err := sess.UpdateCustomResolverLocationWithContext(context, updatelocation) if err != nil || result == nil { - return diag.FromErr(fmt.Errorf("Error Disbale and updating the custom resolver location %s:%s", err, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Disbale and updating the custom resolver location %s:%s", err, resp)) } if delete_loc { @@ -212,7 +214,7 @@ func resourceIBMPrivateDNSLocationDelete(context context.Context, d *schema.Reso if resp != nil && resp.StatusCode == 404 { return nil } - return diag.FromErr(fmt.Errorf("Error Deleting the custom resolver location %s:%s", errDel, resp)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Deleting the custom resolver location %s:%s", errDel, resp)) } } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb.go index 6ca04eae9d..80d4d62dd2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/networking-go-sdk/dnssvcsv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -32,7 +34,7 @@ const ( pdnsGLBDeleted = "done" ) -func resourceIBMPrivateDNSGLB() *schema.Resource { +func ResourceIBMPrivateDNSGLB() *schema.Resource { return &schema.Resource{ Create: resourceIBMPrivateDNSGLBCreate, Read: resourceIBMPrivateDNSGLBRead, @@ -144,7 +146,7 @@ func resourceIBMPrivateDNSGLB() *schema.Resource { } func resourceIBMPrivateDNSGLBCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -155,7 +157,7 @@ func resourceIBMPrivateDNSGLBCreate(d *schema.ResourceData, meta interface{}) er lbname := d.Get(pdnsGLBName).(string) createlbOptions.SetName(lbname) createlbOptions.SetFallbackPool(d.Get(pdnsGLBFallbackPool).(string)) - createlbOptions.SetDefaultPools(expandStringList(d.Get(pdnsGLBDefaultPool).([]interface{}))) + createlbOptions.SetDefaultPools(flex.ExpandStringList(d.Get(pdnsGLBDefaultPool).([]interface{}))) if description, ok := d.GetOk(pdnsGLBDescription); ok { createlbOptions.SetDescription(description.(string)) @@ -186,7 +188,7 @@ func resourceIBMPrivateDNSGLBCreate(d *schema.ResourceData, meta interface{}) er } func resourceIBMPrivateDNSGLBRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -195,7 +197,7 @@ func resourceIBMPrivateDNSGLBRead(d *schema.ResourceData, meta interface{}) erro getlbOptions := sess.NewGetLoadBalancerOptions(idset[0], idset[1], idset[2]) presponse, resp, err := sess.GetLoadBalancer(getlbOptions) if err != nil { - return fmt.Errorf("Error fetching pdns GLB :%s\n%s", err, resp) + return fmt.Errorf("[ERROR] Error fetching pdns GLB :%s\n%s", err, resp) } response := *presponse @@ -216,7 +218,7 @@ func resourceIBMPrivateDNSGLBRead(d *schema.ResourceData, meta interface{}) erro } func resourceIBMPrivateDNSGLBUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -235,7 +237,7 @@ func resourceIBMPrivateDNSGLBUpdate(d *schema.ResourceData, meta interface{}) er updatelbOptions.SetName(d.Get(pdnsGLBName).(string)) updatelbOptions.SetFallbackPool(d.Get(pdnsGLBFallbackPool).(string)) - updatelbOptions.SetDefaultPools(expandStringList(d.Get(pdnsGLBDefaultPool).([]interface{}))) + updatelbOptions.SetDefaultPools(flex.ExpandStringList(d.Get(pdnsGLBDefaultPool).([]interface{}))) if description, ok := d.GetOk(pdnsGLBDescription); ok { updatelbOptions.SetDescription(description.(string)) @@ -257,7 +259,7 @@ func resourceIBMPrivateDNSGLBUpdate(d *schema.ResourceData, meta interface{}) er _, detail, err := sess.UpdateLoadBalancer(updatelbOptions) if err != nil { - return fmt.Errorf("Error updating pdns GLB :%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error updating pdns GLB :%s\n%s", err, detail) } } @@ -265,7 +267,7 @@ func resourceIBMPrivateDNSGLBUpdate(d *schema.ResourceData, meta interface{}) er } func resourceIBMPrivateDNSGLBDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -274,7 +276,7 @@ func resourceIBMPrivateDNSGLBDelete(d *schema.ResourceData, meta interface{}) er deletelbOptions := sess.NewDeleteLoadBalancerOptions(idset[0], idset[1], idset[2]) response, err := sess.DeleteLoadBalancer(deletelbOptions) if err != nil { - return fmt.Errorf("Error deleting pdns GLB :%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting pdns GLB :%s\n%s", err, response) } _, err = isWaitForLoadBalancerDeleted(sess, d, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -284,13 +286,13 @@ func resourceIBMPrivateDNSGLBDelete(d *schema.ResourceData, meta interface{}) er } func resourceIBMPrivateDNSGLBExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } idset := strings.Split(d.Id(), "/") if len(idset) < 3 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of InstanceID/zoneID/glbID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of InstanceID/zoneID/glbID", d.Id()) } getlbOptions := sess.NewGetLoadBalancerOptions(idset[0], idset[1], idset[2]) @@ -312,7 +314,7 @@ func expandPDNSGlbAZPools(azpool interface{}) ([]dnssvcsv1.LoadBalancerAzPoolsIt for _, v := range azpools { locationConfig := v.(map[string]interface{}) avzone := locationConfig[pdnsGLBAvailabilityZone].(string) - pools := expandStringList(locationConfig[pdnsGLBAZPoolsPools].([]interface{})) + pools := flex.ExpandStringList(locationConfig[pdnsGLBAZPoolsPools].([]interface{})) aZItem := dnssvcsv1.LoadBalancerAzPoolsItem{ AvailabilityZone: &avzone, Pools: pools, @@ -327,7 +329,7 @@ func flattenPDNSGlbAZpool(azpool []dnssvcsv1.LoadBalancerAzPoolsItem) interface{ for _, v := range azpool { cfg := map[string]interface{}{ pdnsGLBAvailabilityZone: *v.AvailabilityZone, - pdnsGLBAZPoolsPools: flattenStringList(v.Pools), + pdnsGLBAZPoolsPools: flex.FlattenStringList(v.Pools), } flattened = append(flattened, cfg) } @@ -366,7 +368,7 @@ func isVLoadBalancerDeleteRefreshFunc(LoadBalancer *dnssvcsv1.DnsSvcsV1, d *sche if response != nil && response.StatusCode == 404 { return "", pdnsGLBDeleted, nil } - return "", "", fmt.Errorf("Error Getting PDNS Load Balancer : %s\n%s", err, response) + return "", "", fmt.Errorf("[ERROR] Error Getting PDNS Load Balancer : %s\n%s", err, response) } return LoadBalancer, pdnsGLBDeleting, err diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb_monitor.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb_monitor.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb_monitor.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb_monitor.go index 294516fdbd..e0472f121c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb_monitor.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb_monitor.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/dnssvcsv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -34,7 +37,7 @@ const ( pdnsGlbMonitorModifiedOn = "modified_on" ) -func resourceIBMPrivateDNSGLBMonitor() *schema.Resource { +func ResourceIBMPrivateDNSGLBMonitor() *schema.Resource { return &schema.Resource{ Create: resourceIBMPrivateDNSGLBMonitorCreate, Read: resourceIBMPrivateDNSGLBMonitorRead, @@ -79,7 +82,7 @@ func resourceIBMPrivateDNSGLBMonitor() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "HTTP", - ValidateFunc: InvokeValidator(ibmDNSGlbMonitor, pdnsGlbMonitorType), + ValidateFunc: validate.InvokeValidator(ibmDNSGlbMonitor, pdnsGlbMonitorType), Description: "The protocol to use for the health check", }, @@ -115,7 +118,7 @@ func resourceIBMPrivateDNSGLBMonitor() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator(ibmDNSGlbMonitor, pdnsGlbMonitorMethod), + ValidateFunc: validate.InvokeValidator(ibmDNSGlbMonitor, pdnsGlbMonitorMethod), Description: "The method to use for the health check", }, @@ -161,7 +164,7 @@ func resourceIBMPrivateDNSGLBMonitor() *schema.Resource { Type: schema.TypeString, Computed: true, Optional: true, - ValidateFunc: InvokeValidator(ibmDNSGlbMonitor, pdnsGlbMonitorExpectedCodes), + ValidateFunc: validate.InvokeValidator(ibmDNSGlbMonitor, pdnsGlbMonitorExpectedCodes), Description: "The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS", }, @@ -186,39 +189,39 @@ func resourceIBMPrivateDNSGLBMonitor() *schema.Resource { } } -func resourceIBMPrivateDNSGLBMonitorValidator() *ResourceValidator { +func ResourceIBMPrivateDNSGLBMonitorValidator() *validate.ResourceValidator { monitorCheckTypes := "HTTP, HTTPS, TCP" methods := "GET, HEAD" expectedcode := "200,201,202,203,204,205,206,207,208,226,2xx" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: pdnsGlbMonitorType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: monitorCheckTypes}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: pdnsGlbMonitorMethod, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: methods}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: pdnsGlbMonitorExpectedCodes, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: expectedcode}) - dnsMonitorValidator := ResourceValidator{ResourceName: ibmDNSGlbMonitor, Schema: validateSchema} + dnsMonitorValidator := validate.ResourceValidator{ResourceName: ibmDNSGlbMonitor, Schema: validateSchema} return &dnsMonitorValidator } func resourceIBMPrivateDNSGLBMonitorCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -267,7 +270,7 @@ func resourceIBMPrivateDNSGLBMonitorCreate(d *schema.ResourceData, meta interfac response, detail, err := sess.CreateMonitor(createMonitorOptions) if err != nil { - return fmt.Errorf("Error creating pdns GLB monitor:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error creating pdns GLB monitor:%s\n%s", err, detail) } d.SetId(fmt.Sprintf("%s/%s", instanceID, *response.ID)) @@ -280,7 +283,7 @@ func expandPDNSGLBMonitorsHeader(header interface{}) ([]dnssvcsv1.HealthcheckHea for _, v := range headers { locationConfig := v.(map[string]interface{}) hname := locationConfig[pdnsGlbMonitorHeadersName].(string) - headers := expandStringList(locationConfig[pdnsGlbMonitorHeadersValue].([]interface{})) + headers := flex.ExpandStringList(locationConfig[pdnsGlbMonitorHeadersValue].([]interface{})) headerItem := dnssvcsv1.HealthcheckHeader{ Name: &hname, Value: headers, @@ -291,7 +294,7 @@ func expandPDNSGLBMonitorsHeader(header interface{}) ([]dnssvcsv1.HealthcheckHea } func resourceIBMPrivateDNSGLBMonitorRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -300,7 +303,7 @@ func resourceIBMPrivateDNSGLBMonitorRead(d *schema.ResourceData, meta interface{ getMonitorOptions := sess.NewGetMonitorOptions(idset[0], idset[1]) response, detail, err := sess.GetMonitor(getMonitorOptions) if err != nil { - return fmt.Errorf("Error fetching pdns GLB Monitor:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error fetching pdns GLB Monitor:%s\n%s", err, detail) } d.Set(pdnsInstanceID, idset[0]) d.Set(pdnsGlbMonitorID, response.ID) @@ -348,7 +351,7 @@ func flattenDataSourceLoadBalancerHeader(header []dnssvcsv1.HealthcheckHeader) i for _, v := range header { cfg := map[string]interface{}{ pdnsGlbMonitorHeadersName: v.Name, - pdnsGlbMonitorHeadersValue: flattenStringList(v.Value), + pdnsGlbMonitorHeadersValue: flex.FlattenStringList(v.Value), } flattened = append(flattened, cfg) } @@ -356,7 +359,7 @@ func flattenDataSourceLoadBalancerHeader(header []dnssvcsv1.HealthcheckHeader) i } func resourceIBMPrivateDNSGLBMonitorUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -422,7 +425,7 @@ func resourceIBMPrivateDNSGLBMonitorUpdate(d *schema.ResourceData, meta interfac _, detail, err := sess.UpdateMonitor(updateMonitorOptions) if err != nil { - return fmt.Errorf("Error updating pdns GLB Monitor:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error updating pdns GLB Monitor:%s\n%s", err, detail) } } @@ -430,7 +433,7 @@ func resourceIBMPrivateDNSGLBMonitorUpdate(d *schema.ResourceData, meta interfac } func resourceIBMPrivateDNSGLBMonitorDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -441,7 +444,7 @@ func resourceIBMPrivateDNSGLBMonitorDelete(d *schema.ResourceData, meta interfac response, err := sess.DeleteMonitor(DeleteMonitorOptions) if err != nil { - return fmt.Errorf("Error deleting pdns GLB Monitor:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting pdns GLB Monitor:%s\n%s", err, response) } d.SetId("") @@ -449,14 +452,14 @@ func resourceIBMPrivateDNSGLBMonitorDelete(d *schema.ResourceData, meta interfac } func resourceIBMPrivateDNSGLBMonitorExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } idset := strings.Split(d.Id(), "/") if len(idset) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of InstanceID/monitorID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of InstanceID/monitorID", d.Id()) } getMonitorOptions := sess.NewGetMonitorOptions(idset[0], idset[1]) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb_pool.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb_pool.go index 58a96551c5..61b4527f55 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_glb_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_glb_pool.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" @@ -9,6 +9,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" dns "github.com/IBM/networking-go-sdk/dnssvcsv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -40,7 +43,7 @@ const ( pdnsGlbPoolDeleted = "deleted" ) -func resourceIBMPrivateDNSGLBPool() *schema.Resource { +func ResourceIBMPrivateDNSGLBPool() *schema.Resource { return &schema.Resource{ Create: resourceIBMPrivateDNSGLBPoolCreate, @@ -145,7 +148,7 @@ func resourceIBMPrivateDNSGLBPool() *schema.Resource { pdnsGlbPoolRegion: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator(ibmDNSGlbPool, pdnsGlbPoolRegion), + ValidateFunc: validate.InvokeValidator(ibmDNSGlbPool, pdnsGlbPoolRegion), Description: "Health check region of VSIs", }, pdnsGlbPoolSubnet: { @@ -170,23 +173,23 @@ func resourceIBMPrivateDNSGLBPool() *schema.Resource { } } -func resourceIBMPrivateDNSGLBPoolValidator() *ResourceValidator { +func ResourceIBMPrivateDNSGLBPoolValidator() *validate.ResourceValidator { regions := "us-south,us-east,eu-gb,eu-du,au-syd,jp-tok" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: pdnsGlbPoolRegion, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: regions}) - dnsPoolValidator := ResourceValidator{ResourceName: ibmDNSGlbPool, Schema: validateSchema} + dnsPoolValidator := validate.ResourceValidator{ResourceName: ibmDNSGlbPool, Schema: validateSchema} return &dnsPoolValidator } func resourceIBMPrivateDNSGLBPoolCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -207,7 +210,7 @@ func resourceIBMPrivateDNSGLBPoolCreate(d *schema.ResourceData, meta interface{} CreatePoolOptions.SetHealthyOriginsThreshold(int64(threshold.(int))) } if monitor, ok := d.GetOk(pdnsGlbPoolMonitor); ok { - monitorID, _, _ := convertTftoCisTwoVar(monitor.(string)) + monitorID, _, _ := flex.ConvertTftoCisTwoVar(monitor.(string)) CreatePoolOptions.SetMonitor(monitorID) } if chanel, ok := d.GetOk(pdnsGlbPoolChannel); ok { @@ -217,7 +220,7 @@ func resourceIBMPrivateDNSGLBPoolCreate(d *schema.ResourceData, meta interface{} CreatePoolOptions.SetHealthcheckRegion(region.(string)) } if subnets, ok := d.GetOk(pdnsGlbPoolSubnet); ok { - CreatePoolOptions.SetHealthcheckSubnets(expandStringList(subnets.([]interface{}))) + CreatePoolOptions.SetHealthcheckSubnets(flex.ExpandStringList(subnets.([]interface{}))) } poolorigins := d.Get(pdnsGlbPoolOrigins).(*schema.Set) @@ -234,7 +237,7 @@ func resourceIBMPrivateDNSGLBPoolCreate(d *schema.ResourceData, meta interface{} } func resourceIBMPrivateDNSGLBPoolRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -243,7 +246,7 @@ func resourceIBMPrivateDNSGLBPoolRead(d *schema.ResourceData, meta interface{}) getPoolOptions := sess.NewGetPoolOptions(idset[0], idset[1]) presponse, resp, err := sess.GetPool(getPoolOptions) if err != nil { - return fmt.Errorf("Error fetching pdns GLB Pool:%s\n%s", err, resp) + return fmt.Errorf("[ERROR] Error fetching pdns GLB Pool:%s\n%s", err, resp) } response := *presponse @@ -282,7 +285,7 @@ func flattenPDNSGlbPoolOrigins(list []dns.Origin) []map[string]interface{} { } func resourceIBMPrivateDNSGLBPoolUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -312,7 +315,7 @@ func resourceIBMPrivateDNSGLBPoolUpdate(d *schema.ResourceData, meta interface{} updatePoolOptions.SetHealthyOriginsThreshold(int64(threshold.(int))) } if monitor, ok := d.GetOk(pdnsGlbPoolMonitor); ok { - monitorID, _, _ := convertTftoCisTwoVar(monitor.(string)) + monitorID, _, _ := flex.ConvertTftoCisTwoVar(monitor.(string)) updatePoolOptions.SetMonitor(monitorID) } if chanel, ok := d.GetOk(pdnsGlbPoolChannel); ok { @@ -322,7 +325,7 @@ func resourceIBMPrivateDNSGLBPoolUpdate(d *schema.ResourceData, meta interface{} updatePoolOptions.SetHealthcheckRegion(region.(string)) } if _, ok := d.GetOk(pdnsGlbPoolSubnet); ok { - updatePoolOptions.SetHealthcheckSubnets(expandStringList(d.Get(pdnsGlbPoolSubnet).([]interface{}))) + updatePoolOptions.SetHealthcheckSubnets(flex.ExpandStringList(d.Get(pdnsGlbPoolSubnet).([]interface{}))) } if _, ok := d.GetOk(pdnsGlbPoolOrigins); ok { poolorigins := d.Get(pdnsGlbPoolOrigins).(*schema.Set) @@ -331,7 +334,7 @@ func resourceIBMPrivateDNSGLBPoolUpdate(d *schema.ResourceData, meta interface{} } _, detail, err := sess.UpdatePool(updatePoolOptions) if err != nil { - return fmt.Errorf("Error updating pdns GLB Pool:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error updating pdns GLB Pool:%s\n%s", err, detail) } } @@ -339,7 +342,7 @@ func resourceIBMPrivateDNSGLBPoolUpdate(d *schema.ResourceData, meta interface{} } func resourceIBMPrivateDNSGLBPoolDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -348,7 +351,7 @@ func resourceIBMPrivateDNSGLBPoolDelete(d *schema.ResourceData, meta interface{} DeletePoolOptions := sess.NewDeletePoolOptions(idset[0], idset[1]) response, err := sess.DeletePool(DeletePoolOptions) if err != nil { - return fmt.Errorf("Error deleting pdns GLB Pool:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting pdns GLB Pool:%s\n%s", err, response) } _, err = waitForPDNSGlbPoolDelete(d, meta) if err != nil { @@ -359,14 +362,14 @@ func resourceIBMPrivateDNSGLBPoolDelete(d *schema.ResourceData, meta interface{} } func resourceIBMPrivateDNSGLBPoolExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } idset := strings.Split(d.Id(), "/") if len(idset) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of InstanceID/poolID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of InstanceID/poolID", d.Id()) } getPoolOptions := sess.NewGetPoolOptions(idset[0], idset[1]) @@ -395,7 +398,7 @@ func expandPDNSGlbPoolOrigins(originsList *schema.Set) (origins []dns.OriginInpu } func waitForPDNSGlbPoolDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - cisClient, err := meta.(ClientSession).PrivateDNSClientSession() + cisClient, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return nil, err } @@ -408,11 +411,11 @@ func waitForPDNSGlbPoolDelete(d *schema.ResourceData, meta interface{}) (interfa _, detail, err := cisClient.GetPool(getPoolOptions) if err != nil { if detail != nil && detail.StatusCode == 404 { - return detail, clusterDeleted, nil + return detail, "deleted", nil } return nil, "", err } - return detail, clusterDeletePending, nil + return detail, "deleting", nil }, Timeout: d.Timeout(schema.TimeoutDelete), Delay: 60 * time.Second, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_permitted_network.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_permitted_network.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_permitted_network.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_permitted_network.go index 69d635085b..679c31fced 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_permitted_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_permitted_network.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -25,7 +27,7 @@ var allowedNetworkTypes = []string{ "vpc", } -func resourceIBMPrivateDNSPermittedNetwork() *schema.Resource { +func ResourceIBMPrivateDNSPermittedNetwork() *schema.Resource { return &schema.Resource{ Create: resourceIBMPrivateDNSPermittedNetworkCreate, Read: resourceIBMPrivateDNSPermittedNetworkRead, @@ -64,7 +66,7 @@ func resourceIBMPrivateDNSPermittedNetwork() *schema.Resource { Optional: true, ForceNew: true, Default: "vpc", - ValidateFunc: validateAllowedStringValue([]string{"vpc"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"vpc"}), Description: "Network Type", }, @@ -97,7 +99,7 @@ func resourceIBMPrivateDNSPermittedNetwork() *schema.Resource { } func resourceIBMPrivateDNSPermittedNetworkCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -107,8 +109,8 @@ func resourceIBMPrivateDNSPermittedNetworkCreate(d *schema.ResourceData, meta in vpcCRN := d.Get(pdnsVpcCRN).(string) nwType := d.Get(pdnsNetworkType).(string) mk := "private_dns_permitted_network_" + instanceID + zoneID - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) createPermittedNetworkOptions := sess.NewCreatePermittedNetworkOptions(instanceID, zoneID) permittedNetworkCrn, err := sess.NewPermittedNetworkVpc(vpcCRN) @@ -120,7 +122,7 @@ func resourceIBMPrivateDNSPermittedNetworkCreate(d *schema.ResourceData, meta in createPermittedNetworkOptions.SetType(nwType) response, detail, err := sess.CreatePermittedNetwork(createPermittedNetworkOptions) if err != nil { - return fmt.Errorf("Error creating pdns permitted network:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error creating pdns permitted network:%s\n%s", err, detail) } d.SetId(fmt.Sprintf("%s/%s/%s", instanceID, zoneID, *response.ID)) @@ -129,7 +131,7 @@ func resourceIBMPrivateDNSPermittedNetworkCreate(d *schema.ResourceData, meta in } func resourceIBMPrivateDNSPermittedNetworkRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -139,7 +141,7 @@ func resourceIBMPrivateDNSPermittedNetworkRead(d *schema.ResourceData, meta inte response, detail, err := sess.GetPermittedNetwork(getPermittedNetworkOptions) if err != nil { - return fmt.Errorf("Error reading pdns permitted network:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading pdns permitted network:%s\n%s", err, detail) } d.Set(pdnsInstanceID, idSet[0]) @@ -155,20 +157,20 @@ func resourceIBMPrivateDNSPermittedNetworkRead(d *schema.ResourceData, meta inte } func resourceIBMPrivateDNSPermittedNetworkDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } idSet := strings.Split(d.Id(), "/") mk := "private_dns_permitted_network_" + idSet[0] + idSet[1] - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) deletePermittedNetworkOptions := sess.NewDeletePermittedNetworkOptions(idSet[0], idSet[1], idSet[2]) _, response, err := sess.DeletePermittedNetwork(deletePermittedNetworkOptions) if err != nil { - return fmt.Errorf("Error deleting pdns permitted network:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting pdns permitted network:%s\n%s", err, response) } d.SetId("") @@ -176,19 +178,19 @@ func resourceIBMPrivateDNSPermittedNetworkDelete(d *schema.ResourceData, meta in } func resourceIBMPrivateDNSPermittedNetworkExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } idSet := strings.Split(d.Id(), "/") if len(idSet) < 3 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of InstanceID/zoneID/permittedNetworkID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of InstanceID/zoneID/permittedNetworkID", d.Id()) } mk := "private_dns_permitted_network_" + idSet[0] + idSet[1] - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) getPermittedNetworkOptions := sess.NewGetPermittedNetworkOptions(idSet[0], idSet[1], idSet[2]) _, response, err := sess.GetPermittedNetwork(getPermittedNetworkOptions) if err != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_resource_record.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_resource_record.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go index 114e39d73f..af4e939957 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_resource_record.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_resource_record.go @@ -1,19 +1,31 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" + "regexp" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) var allowedPrivateDomainRecordTypes = []string{ "A", "AAAA", "CNAME", "MX", "PTR", "SRV", "TXT", } +var ipv6Regexp *regexp.Regexp +var upcaseRegexp *regexp.Regexp + +func init() { + ipv6Regexp, _ = regexp.Compile( + "[a-zA-Z0-9]{4}:[a-zA-Z0-9]{4}:[a-zA-Z0-9]{4}:[a-zA-Z0-9]{4}:" + + "[a-zA-Z0-9]{4}:[a-zA-Z0-9]{4}:[a-zA-Z0-9]{4}:[a-zA-Z0-9]{4}", + ) + upcaseRegexp, _ = regexp.Compile("[A-Z]") +} const ( pdnsResourceRecordID = "resource_record_id" @@ -35,7 +47,7 @@ func caseDiffSuppress(_, old, new string, _ *schema.ResourceData) bool { return strings.ToUpper(old) == strings.ToUpper(new) } -func resourceIBMPrivateDNSResourceRecord() *schema.Resource { +func ResourceIBMPrivateDNSResourceRecord() *schema.Resource { return &schema.Resource{ Create: resourceIBMPrivateDNSResourceRecordCreate, Read: resourceIBMPrivateDNSResourceRecordRead, @@ -186,7 +198,7 @@ func resourceIBMPrivateDNSResourceRecord() *schema.Resource { } func resourceIBMPrivateDNSResourceRecordCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -225,31 +237,31 @@ func resourceIBMPrivateDNSResourceRecordCreate(d *schema.ResourceData, meta inte case "A": resourceRecordAData, err := sess.NewResourceRecordInputRdataRdataARecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record A data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record A data:%s", err) } createResourceRecordOptions.SetRdata(resourceRecordAData) case "AAAA": resourceRecordAaaaData, err := sess.NewResourceRecordInputRdataRdataAaaaRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Aaaa data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Aaaa data:%s", err) } createResourceRecordOptions.SetRdata(resourceRecordAaaaData) case "CNAME": resourceRecordCnameData, err := sess.NewResourceRecordInputRdataRdataCnameRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Cname data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Cname data:%s", err) } createResourceRecordOptions.SetRdata(resourceRecordCnameData) case "PTR": resourceRecordPtrData, err := sess.NewResourceRecordInputRdataRdataPtrRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Ptr data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Ptr data:%s", err) } createResourceRecordOptions.SetRdata(resourceRecordPtrData) case "TXT": resourceRecordTxtData, err := sess.NewResourceRecordInputRdataRdataTxtRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Txt data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Txt data:%s", err) } createResourceRecordOptions.SetRdata(resourceRecordTxtData) case "MX": @@ -258,7 +270,7 @@ func resourceIBMPrivateDNSResourceRecordCreate(d *schema.ResourceData, meta inte } resourceRecordMxData, err := sess.NewResourceRecordInputRdataRdataMxRecord(rdata, int64(preference)) if err != nil { - return fmt.Errorf("Error creating pdns resource record Mx data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Mx data:%s", err) } createResourceRecordOptions.SetRdata(resourceRecordMxData) case "SRV": @@ -273,7 +285,7 @@ func resourceIBMPrivateDNSResourceRecordCreate(d *schema.ResourceData, meta inte } resourceRecordSrvData, err := sess.NewResourceRecordInputRdataRdataSrvRecord(int64(port), int64(priority), rdata, int64(weight)) if err != nil { - return fmt.Errorf("Error creating pdns resource record Srv data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Srv data:%s", err) } if v, ok := d.GetOk(pdnsSrvService); ok { service = v.(string) @@ -286,11 +298,11 @@ func resourceIBMPrivateDNSResourceRecordCreate(d *schema.ResourceData, meta inte createResourceRecordOptions.SetProtocol(protocol) } mk := "private_dns_resource_record_" + instanceID + zoneID - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) response, detail, err := sess.CreateResourceRecord(createResourceRecordOptions) if err != nil { - return fmt.Errorf("Error creating pdns resource record:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error creating pdns resource record:%s\n%s", err, detail) } d.SetId(fmt.Sprintf("%s/%s/%s", instanceID, zoneID, *response.ID)) @@ -300,14 +312,14 @@ func resourceIBMPrivateDNSResourceRecordCreate(d *schema.ResourceData, meta inte func resourceIBMPrivateDNSResourceRecordRead(d *schema.ResourceData, meta interface{}) error { idSet := strings.Split(d.Id(), "/") - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } getResourceRecordOptions := sess.NewGetResourceRecordOptions(idSet[0], idSet[1], idSet[2]) response, detail, err := sess.GetResourceRecord(getResourceRecordOptions) if err != nil { - return fmt.Errorf("Error reading pdns resource record:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading pdns resource record:%s\n%s", err, detail) } // extract the record name by removing zone details @@ -370,14 +382,14 @@ func resourceIBMPrivateDNSResourceRecordRead(d *schema.ResourceData, meta interf func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta interface{}) error { idSet := strings.Split(d.Id(), "/") - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } mk := "private_dns_resource_record_" + idSet[0] + idSet[1] - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) updateResourceRecordOptions := sess.NewUpdateResourceRecordOptions(idSet[0], idSet[1], idSet[2]) @@ -401,7 +413,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte rdata = d.Get(pdnsRdata).(string) resourceRecordAData, err := sess.NewResourceRecordUpdateInputRdataRdataARecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record A data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record A data:%s", err) } updateResourceRecordOptions.SetRdata(resourceRecordAData) @@ -410,7 +422,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte rdata = d.Get(pdnsRdata).(string) resourceRecordAaaaData, err := sess.NewResourceRecordUpdateInputRdataRdataAaaaRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Aaaa data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Aaaa data:%s", err) } updateResourceRecordOptions.SetRdata(resourceRecordAaaaData) @@ -419,7 +431,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte rdata = d.Get(pdnsRdata).(string) resourceRecordCnameData, err := sess.NewResourceRecordUpdateInputRdataRdataCnameRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Cname data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Cname data:%s", err) } updateResourceRecordOptions.SetRdata(resourceRecordCnameData) @@ -431,7 +443,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte rdata = d.Get(pdnsRdata).(string) resourceRecordTxtData, err := sess.NewResourceRecordUpdateInputRdataRdataTxtRecord(rdata) if err != nil { - return fmt.Errorf("Error creating pdns resource record Txt data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Txt data:%s", err) } updateResourceRecordOptions.SetRdata(resourceRecordTxtData) @@ -442,7 +454,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte resourceRecordMxData, err := sess.NewResourceRecordUpdateInputRdataRdataMxRecord(rdata, int64(preference)) if err != nil { - return fmt.Errorf("Error creating pdns resource record Mx data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Mx data:%s", err) } updateResourceRecordOptions.SetRdata(resourceRecordMxData) @@ -455,7 +467,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte resourceRecordSrvData, err := sess.NewResourceRecordUpdateInputRdataRdataSrvRecord(int64(port), int64(priority), rdata, int64(weight)) if err != nil { - return fmt.Errorf("Error creating pdns resource record Srv data:%s", err) + return fmt.Errorf("[ERROR] Error creating pdns resource record Srv data:%s", err) } updateResourceRecordOptions.SetRdata(resourceRecordSrvData) @@ -467,7 +479,7 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte _, detail, err := sess.UpdateResourceRecord(updateResourceRecordOptions) if err != nil { - return fmt.Errorf("Error updating pdns resource record:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error updating pdns resource record:%s\n%s", err, detail) } } @@ -477,18 +489,18 @@ func resourceIBMPrivateDNSResourceRecordUpdate(d *schema.ResourceData, meta inte func resourceIBMPrivateDNSResourceRecordDelete(d *schema.ResourceData, meta interface{}) error { idSet := strings.Split(d.Id(), "/") - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } deleteResourceRecordOptions := sess.NewDeleteResourceRecordOptions(idSet[0], idSet[1], idSet[2]) mk := "private_dns_resource_record_" + idSet[0] + idSet[1] - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) response, err := sess.DeleteResourceRecord(deleteResourceRecordOptions) if err != nil { - return fmt.Errorf("Error deleting pdns resource record:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting pdns resource record:%s\n%s", err, response) } d.SetId("") @@ -496,19 +508,19 @@ func resourceIBMPrivateDNSResourceRecordDelete(d *schema.ResourceData, meta inte } func resourceIBMPrivateDNSResourceRecordExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } idSet := strings.Split(d.Id(), "/") if len(idSet) < 3 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of InstanceID/zoneID/recordID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of InstanceID/zoneID/recordID", d.Id()) } getResourceRecordOptions := sess.NewGetResourceRecordOptions(idSet[0], idSet[1], idSet[2]) mk := "private_dns_resource_record_" + idSet[0] + idSet[1] - ibmMutexKV.Lock(mk) - defer ibmMutexKV.Unlock(mk) + conns.IbmMutexKV.Lock(mk) + defer conns.IbmMutexKV.Unlock(mk) _, response, err := sess.GetResourceRecord(getResourceRecordOptions) if err != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_zones.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_zones.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_zones.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_zones.go index 54d0f440fd..dd5cc2f516 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_private_dns_zones.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices/resource_ibm_private_dns_zones.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package dnsservices import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -22,7 +23,7 @@ const ( pdnsZoneID = "zone_id" ) -func resourceIBMPrivateDNSZone() *schema.Resource { +func ResourceIBMPrivateDNSZone() *schema.Resource { return &schema.Resource{ Create: resourceIBMPrivateDNSZoneCreate, Read: resourceIBMPrivateDNSZoneRead, @@ -94,7 +95,7 @@ func resourceIBMPrivateDNSZone() *schema.Resource { } func resourceIBMPrivateDNSZoneCreate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -120,7 +121,7 @@ func resourceIBMPrivateDNSZoneCreate(d *schema.ResourceData, meta interface{}) e createZoneOptions.SetLabel(zoneLabel) response, detail, err := sess.CreateDnszone(createZoneOptions) if err != nil { - return fmt.Errorf("Error creating pdns zone:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error creating pdns zone:%s\n%s", err, detail) } d.SetId(fmt.Sprintf("%s/%s", *response.InstanceID, *response.ID)) @@ -130,7 +131,7 @@ func resourceIBMPrivateDNSZoneCreate(d *schema.ResourceData, meta interface{}) e } func resourceIBMPrivateDNSZoneRead(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -139,7 +140,7 @@ func resourceIBMPrivateDNSZoneRead(d *schema.ResourceData, meta interface{}) err getZoneOptions := sess.NewGetDnszoneOptions(idSet[0], idSet[1]) response, detail, err := sess.GetDnszone(getZoneOptions) if err != nil { - return fmt.Errorf("Error fetching pdns zone:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error fetching pdns zone:%s\n%s", err, detail) } d.Set(pdnsZoneID, response.ID) @@ -155,7 +156,7 @@ func resourceIBMPrivateDNSZoneRead(d *schema.ResourceData, meta interface{}) err } func resourceIBMPrivateDNSZoneUpdate(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -166,7 +167,7 @@ func resourceIBMPrivateDNSZoneUpdate(d *schema.ResourceData, meta interface{}) e getZoneOptions := sess.NewGetDnszoneOptions(idSet[0], idSet[1]) _, response, err := sess.GetDnszone(getZoneOptions) if err != nil { - return fmt.Errorf("Error fetching pdns zone:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching pdns zone:%s\n%s", err, response) } // Update DNS zone if attributes has any change @@ -181,7 +182,7 @@ func resourceIBMPrivateDNSZoneUpdate(d *schema.ResourceData, meta interface{}) e _, detail, err := sess.UpdateDnszone(updateZoneOptions) if err != nil { - return fmt.Errorf("Error updating pdns zone:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error updating pdns zone:%s\n%s", err, detail) } } @@ -189,7 +190,7 @@ func resourceIBMPrivateDNSZoneUpdate(d *schema.ResourceData, meta interface{}) e } func resourceIBMPrivateDNSZoneDelete(d *schema.ResourceData, meta interface{}) error { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return err } @@ -199,7 +200,7 @@ func resourceIBMPrivateDNSZoneDelete(d *schema.ResourceData, meta interface{}) e deleteZoneOptions := sess.NewDeleteDnszoneOptions(idSet[0], idSet[1]) response, err := sess.DeleteDnszone(deleteZoneOptions) if err != nil { - return fmt.Errorf("Error deleting pdns zone:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting pdns zone:%s\n%s", err, response) } d.SetId("") @@ -208,14 +209,14 @@ func resourceIBMPrivateDNSZoneDelete(d *schema.ResourceData, meta interface{}) e func resourceIBMPrivateDNSZoneExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).PrivateDNSClientSession() + sess, err := meta.(conns.ClientSession).PrivateDNSClientSession() if err != nil { return false, err } idSet := strings.Split(d.Id(), "/") if len(idSet) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of InstanceID/zoneID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of InstanceID/zoneID", d.Id()) } getZoneOptions := sess.NewGetDnszoneOptions(idSet[0], idSet[1]) _, response, err := sess.GetDnszone(getZoneOptions) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/README.md new file mode 100644 index 0000000000..fbc143a49e --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Enterprise Management + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Enterprise resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/enterprise) +* IBM API Docs: [IBM API Docs for Enterprise](https://cloud.ibm.com/apidocs/enterprise-apis/enterprise) +* IBM Enterprise SDK: [IBM SDK for Enterprise](https://github.com/IBM/platform-services-go-sdk/tree/main/enterprisemanagementv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprise_account_groups.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprise_account_groups.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprise_account_groups.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprise_account_groups.go index 74859bf6d0..fd6078fd6f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprise_account_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprise_account_groups.go @@ -1,109 +1,112 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package enterprise import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "log" "net/url" "reflect" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" ) -func dataSourceIbmEnterpriseAccountGroups() *schema.Resource { +func DataSourceIBMEnterpriseAccountGroups() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmEnterpriseAccountGroupsRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The name of the account group.", - ValidateFunc: validateAllowedEnterpriseNameValue(), + ValidateFunc: validate.ValidateAllowedEnterpriseNameValue(), }, - "account_groups": &schema.Schema{ + "account_groups": { Type: schema.TypeList, Computed: true, Description: "A list of account groups.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL of the account group.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The account group ID.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) of the account group.", }, - "parent": &schema.Schema{ + "parent": { Type: schema.TypeString, Computed: true, Description: "The CRN of the parent of the account group.", }, - "enterprise_account_id": &schema.Schema{ + "enterprise_account_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise account ID.", }, - "enterprise_id": &schema.Schema{ + "enterprise_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise ID that the account group is a part of.", }, - "enterprise_path": &schema.Schema{ + "enterprise_path": { Type: schema.TypeString, Computed: true, Description: "The path from the enterprise to this particular account group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the account group.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The state of the account group.", }, - "primary_contact_iam_id": &schema.Schema{ + "primary_contact_iam_id": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the primary contact of the account group.", }, - "primary_contact_email": &schema.Schema{ + "primary_contact_email": { Type: schema.TypeString, Computed: true, Description: "The email address of the primary contact of the account group.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account group was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that created the account group.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account group was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that updated the account group.", @@ -128,7 +131,7 @@ func getEnterpriseNext(next *string) (string, error) { } func dataSourceIbmEnterpriseAccountGroupsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -184,7 +187,7 @@ func dataSourceIbmEnterpriseAccountGroupsRead(context context.Context, d *schema if allRecs != nil { err = d.Set("account_groups", dataSourceListEnterpriseAccountGroupsResponseFlattenResources(allRecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resources %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprise_accounts.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprise_accounts.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprise_accounts.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprise_accounts.go index c5bf482ef3..76386ed8f0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprise_accounts.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprise_accounts.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package enterprise import ( "context" @@ -9,110 +9,112 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" ) -func dataSourceIbmEnterpriseAccounts() *schema.Resource { +func DataSourceIBMEnterpriseAccounts() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmEnterpriseAccountsRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The name of the account.", - ValidateFunc: validateAllowedEnterpriseNameValue(), + ValidateFunc: validate.ValidateAllowedEnterpriseNameValue(), }, - "accounts": &schema.Schema{ + "accounts": { Type: schema.TypeList, Computed: true, Description: "A list of accounts.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL of the account.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The account ID.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) of the account.", }, - "parent": &schema.Schema{ + "parent": { Type: schema.TypeString, Computed: true, Description: "The CRN of the parent of the account.", }, - "enterprise_account_id": &schema.Schema{ + "enterprise_account_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise account ID.", }, - "enterprise_id": &schema.Schema{ + "enterprise_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise ID that the account is a part of.", }, - "enterprise_path": &schema.Schema{ + "enterprise_path": { Type: schema.TypeString, Computed: true, Description: "The path from the enterprise to this particular account.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the account.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The state of the account.", }, - "owner_iam_id": &schema.Schema{ + "owner_iam_id": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the owner of the account.", }, - "paid": &schema.Schema{ + "paid": { Type: schema.TypeBool, Computed: true, Description: "The type of account - whether it is free or paid.", }, - "owner_email": &schema.Schema{ + "owner_email": { Type: schema.TypeString, Computed: true, Description: "The email address of the owner of the account.", }, - "is_enterprise_account": &schema.Schema{ + "is_enterprise_account": { Type: schema.TypeBool, Computed: true, Description: "The flag to indicate whether the account is an enterprise account or not.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that created the account.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that updated the account.", @@ -125,7 +127,7 @@ func dataSourceIbmEnterpriseAccounts() *schema.Resource { } func dataSourceIbmEnterpriseAccountsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -183,7 +185,7 @@ func dataSourceIbmEnterpriseAccountsRead(context context.Context, d *schema.Reso if allRecs != nil { err = d.Set("accounts", dataSourceListEnterpriseAccountsResponseFlattenResources(allRecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resources %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprises.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprises.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprises.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprises.go index 3a547c8a59..2e7466d9b8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_enterprises.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/data_source_ibm_enterprises.go @@ -1,6 +1,6 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package enterprise import ( "context" @@ -8,90 +8,92 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" ) -func dataSourceIbmEnterprises() *schema.Resource { +func DataSourceIBMEnterprises() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmEnterprisesRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The name of the enterprise.", - ValidateFunc: validateAllowedEnterpriseNameValue(), + ValidateFunc: validate.ValidateAllowedEnterpriseNameValue(), }, - "enterprises": &schema.Schema{ + "enterprises": { Type: schema.TypeList, Computed: true, Description: "A list of enterprise objects.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL of the enterprise.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The enterprise ID.", }, - "enterprise_account_id": &schema.Schema{ + "enterprise_account_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise account ID.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) of the enterprise.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the enterprise.", }, - "domain": &schema.Schema{ + "domain": { Type: schema.TypeString, Computed: true, Description: "The domain of the enterprise.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The state of the enterprise.", }, - "primary_contact_iam_id": &schema.Schema{ + "primary_contact_iam_id": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the primary contact of the enterprise, such as `IBMid-0123ABC`.", }, - "primary_contact_email": &schema.Schema{ + "primary_contact_email": { Type: schema.TypeString, Computed: true, Description: "The email of the primary contact of the enterprise.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the enterprise was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that created the enterprise.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the enterprise was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that updated the enterprise.", @@ -104,7 +106,7 @@ func dataSourceIbmEnterprises() *schema.Resource { } func dataSourceIbmEnterprisesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -148,7 +150,7 @@ func dataSourceIbmEnterprisesRead(context context.Context, d *schema.ResourceDat if listEnterprisesResponse.Resources != nil { err = d.Set("enterprises", dataSourceListEnterprisesResponseFlattenResources(listEnterprisesResponse.Resources)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resources %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise.go index 3135d23ea2..25f90769f6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise.go @@ -1,20 +1,23 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package enterprise import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" ) -func resourceIbmEnterprise() *schema.Resource { +func ResourceIBMEnterprise() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmEnterpriseCreate, ReadContext: resourceIbmEnterpriseRead, @@ -27,69 +30,69 @@ func resourceIbmEnterprise() *schema.Resource { Delete: schema.DefaultTimeout(10 * time.Minute), }, Schema: map[string]*schema.Schema{ - "source_account_id": &schema.Schema{ + "source_account_id": { Type: schema.TypeString, Required: true, Description: "The ID of the account that is used to create the enterprise.", ForceNew: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The name of the enterprise. This field must have 3 - 60 characters.", - ValidateFunc: validateAllowedEnterpriseNameValue(), + ValidateFunc: validate.ValidateAllowedEnterpriseNameValue(), }, - "primary_contact_iam_id": &schema.Schema{ + "primary_contact_iam_id": { Type: schema.TypeString, Required: true, Description: "The IAM ID of the enterprise primary contact, such as `IBMid-0123ABC`. The IAM ID must already exist.", }, - "domain": &schema.Schema{ + "domain": { Type: schema.TypeString, Optional: true, Description: "A domain or subdomain for the enterprise, such as `example.com` or `my.example.com`.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL of the enterprise.", }, - "enterprise_account_id": &schema.Schema{ + "enterprise_account_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise account ID.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) of the enterprise.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The state of the enterprise.", }, - "primary_contact_email": &schema.Schema{ + "primary_contact_email": { Type: schema.TypeString, Computed: true, Description: "The email of the primary contact of the enterprise.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the enterprise was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that created the enterprise.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the enterprise was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that updated the enterprise.", @@ -99,7 +102,7 @@ func resourceIbmEnterprise() *schema.Resource { } func resourceIbmEnterpriseCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -120,7 +123,7 @@ func resourceIbmEnterpriseCreate(context context.Context, d *schema.ResourceData } func resourceIbmEnterpriseRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -140,50 +143,50 @@ func resourceIbmEnterpriseRead(context context.Context, d *schema.ResourceData, } //if err = d.Set("source_account_id", enterprise.); err != nil { - // return diag.FromErr(fmt.Errorf("Error setting source_account_id: %s", err)) + // return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_account_id: %s", err)) //} if err = d.Set("name", enterprise.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("primary_contact_iam_id", enterprise.PrimaryContactIamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting primary_contact_iam_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting primary_contact_iam_id: %s", err)) } if err = d.Set("domain", enterprise.Domain); err != nil { - return diag.FromErr(fmt.Errorf("Error setting domain: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting domain: %s", err)) } if err = d.Set("url", enterprise.URL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting url: %s", err)) } if err = d.Set("enterprise_account_id", enterprise.EnterpriseAccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_account_id: %s", err)) } if err = d.Set("crn", enterprise.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("state", enterprise.State); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state: %s", err)) } if err = d.Set("primary_contact_email", enterprise.PrimaryContactEmail); err != nil { - return diag.FromErr(fmt.Errorf("Error setting primary_contact_email: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting primary_contact_email: %s", err)) } if err = d.Set("created_at", enterprise.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", enterprise.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if err = d.Set("updated_at", enterprise.UpdatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", enterprise.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } return nil } func resourceIbmEnterpriseUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise_account.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise_account.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise_account.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise_account.go index 14452969ae..18da154443 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise_account.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise_account.go @@ -1,21 +1,24 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package enterprise import ( "context" "errors" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" ) -func resourceIbmEnterpriseAccount() *schema.Resource { +func ResourceIBMEnterpriseAccount() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmEnterpriseAccountCreate, ReadContext: resourceIbmEnterpriseAccountRead, @@ -28,93 +31,93 @@ func resourceIbmEnterpriseAccount() *schema.Resource { Delete: schema.DefaultTimeout(10 * time.Minute), }, Schema: map[string]*schema.Schema{ - "parent": &schema.Schema{ + "parent": { Type: schema.TypeString, Required: true, Description: "The CRN of the parent under which the account will be created. The parent can be an existing account group or the enterprise itself.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The name of the account. This field must have 3 - 60 characters.", ForceNew: true, - ValidateFunc: validateAllowedEnterpriseNameValue(), + ValidateFunc: validate.ValidateAllowedEnterpriseNameValue(), }, - "owner_iam_id": &schema.Schema{ + "owner_iam_id": { Type: schema.TypeString, Optional: true, Description: "The IAM ID of the account owner, such as `IBMid-0123ABC`. The IAM ID must already exist.", ForceNew: true, }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL of the account.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) of the account.", }, - "enterprise_account_id": &schema.Schema{ + "enterprise_account_id": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The enterprise account ID.", }, - "enterprise_id": &schema.Schema{ + "enterprise_id": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The enterprise ID that the account is a part of.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The source account id of account to be imported", }, - "enterprise_path": &schema.Schema{ + "enterprise_path": { Type: schema.TypeString, Computed: true, Description: "The path from the enterprise to this particular account.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The state of the account.", }, - "paid": &schema.Schema{ + "paid": { Type: schema.TypeBool, Computed: true, Description: "The type of account - whether it is free or paid.", }, - "owner_email": &schema.Schema{ + "owner_email": { Type: schema.TypeString, Computed: true, Description: "The email address of the owner of the account.", }, - "is_enterprise_account": &schema.Schema{ + "is_enterprise_account": { Type: schema.TypeBool, Computed: true, Description: "The flag to indicate whether the account is an enterprise account or not.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that created the account.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that updated the account.", @@ -143,7 +146,7 @@ func checkCreateAccount(d *schema.ResourceData) bool { } func resourceIbmEnterpriseAccountCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -171,16 +174,16 @@ func resourceIbmEnterpriseAccountCreate(context context.Context, d *schema.Resou d.SetId(*createAccountResponse.AccountID) } else { - err := errors.New("Required Parameters are missing." + + err := errors.New("[ERROR] Required Parameters are missing." + "Please input parent,name,owner_iam_id for creating a new account in enterprise." + - "Input enterprise_id and enterprise_account_id for importing an existing account to enterprise.") + "Input enterprise_id and enterprise_account_id for importing an existing account to enterprise") return diag.FromErr(err) } return resourceIbmEnterpriseAccountRead(context, d, meta) } func resourceIbmEnterpriseAccountRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -200,66 +203,66 @@ func resourceIbmEnterpriseAccountRead(context context.Context, d *schema.Resourc } if err = d.Set("parent", account.Parent); err != nil { - return diag.FromErr(fmt.Errorf("Error setting parent: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting parent: %s", err)) } if err = d.Set("name", account.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("owner_iam_id", account.OwnerIamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting owner_iam_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting owner_iam_id: %s", err)) } if err = d.Set("account_id", account.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) } if err = d.Set("url", account.URL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting url: %s", err)) } if err = d.Set("crn", account.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("enterprise_account_id", account.EnterpriseAccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_account_id: %s", err)) } if err = d.Set("enterprise_id", account.EnterpriseID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_id: %s", err)) } if err = d.Set("enterprise_path", account.EnterprisePath); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_path: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_path: %s", err)) } if err = d.Set("state", account.State); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state: %s", err)) } if err = d.Set("paid", account.Paid); err != nil { - return diag.FromErr(fmt.Errorf("Error setting paid: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting paid: %s", err)) } if err = d.Set("owner_email", account.OwnerEmail); err != nil { - return diag.FromErr(fmt.Errorf("Error setting owner_email: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting owner_email: %s", err)) } if err = d.Set("is_enterprise_account", account.IsEnterpriseAccount); err != nil { - return diag.FromErr(fmt.Errorf("Error setting is_enterprise_account: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting is_enterprise_account: %s", err)) } if err = d.Set("created_at", account.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", account.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if account.UpdatedAt != nil { if err = d.Set("updated_at", account.UpdatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } } if account.UpdatedBy != nil { if err = d.Set("updated_by", account.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } } return nil } func resourceIbmEnterpriseAccountUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise_account_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise_account_group.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise_account_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise_account_group.go index 09936dee93..cbec6c2f69 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_enterprise_account_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise/resource_ibm_enterprise_account_group.go @@ -1,6 +1,6 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package enterprise import ( "context" @@ -8,13 +8,15 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/enterprisemanagementv1" ) -func resourceIbmEnterpriseAccountGroup() *schema.Resource { +func ResourceIBMEnterpriseAccountGroup() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmEnterpriseAccountGroupCreate, ReadContext: resourceIbmEnterpriseAccountGroupRead, @@ -27,74 +29,74 @@ func resourceIbmEnterpriseAccountGroup() *schema.Resource { Delete: schema.DefaultTimeout(10 * time.Minute), }, Schema: map[string]*schema.Schema{ - "parent": &schema.Schema{ + "parent": { Type: schema.TypeString, Required: true, Description: "The CRN of the parent under which the account group will be created. The parent can be an existing account group or the enterprise itself.", ForceNew: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The name of the account group. This field must have 3 - 60 characters.", - ValidateFunc: validateAllowedEnterpriseNameValue(), + ValidateFunc: validate.ValidateAllowedEnterpriseNameValue(), }, - "primary_contact_iam_id": &schema.Schema{ + "primary_contact_iam_id": { Type: schema.TypeString, Required: true, Description: "The IAM ID of the primary contact for this account group, such as `IBMid-0123ABC`. The IAM ID must already exist.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL of the account group.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) of the account group.", }, - "enterprise_account_id": &schema.Schema{ + "enterprise_account_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise account ID.", }, - "enterprise_id": &schema.Schema{ + "enterprise_id": { Type: schema.TypeString, Computed: true, Description: "The enterprise ID that the account group is a part of.", }, - "enterprise_path": &schema.Schema{ + "enterprise_path": { Type: schema.TypeString, Computed: true, Description: "The path from the enterprise to this particular account group.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The state of the account group.", }, - "primary_contact_email": &schema.Schema{ + "primary_contact_email": { Type: schema.TypeString, Computed: true, Description: "The email address of the primary contact of the account group.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account group was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that created the account group.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time stamp at which the account group was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The IAM ID of the user or service that updated the account group.", @@ -104,7 +106,7 @@ func resourceIbmEnterpriseAccountGroup() *schema.Resource { } func resourceIbmEnterpriseAccountGroupCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -127,7 +129,7 @@ func resourceIbmEnterpriseAccountGroupCreate(context context.Context, d *schema. } func resourceIbmEnterpriseAccountGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } @@ -147,49 +149,49 @@ func resourceIbmEnterpriseAccountGroupRead(context context.Context, d *schema.Re } log.Printf("[DEBUG] GetAccountGroupWithContext testing %s", response) if err = d.Set("parent", accountGroup.Parent); err != nil { - return diag.FromErr(fmt.Errorf("Error setting parent: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting parent: %s", err)) } if err = d.Set("name", accountGroup.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("primary_contact_iam_id", accountGroup.PrimaryContactIamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting primary_contact_iam_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting primary_contact_iam_id: %s", err)) } if err = d.Set("url", accountGroup.URL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting url: %s", err)) } if err = d.Set("crn", accountGroup.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("enterprise_account_id", accountGroup.EnterpriseAccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_account_id: %s", err)) } if err = d.Set("enterprise_id", accountGroup.EnterpriseID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_id: %s", err)) } if err = d.Set("enterprise_path", accountGroup.EnterprisePath); err != nil { - return diag.FromErr(fmt.Errorf("Error setting enterprise_path: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enterprise_path: %s", err)) } if err = d.Set("state", accountGroup.State); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state: %s", err)) } if err = d.Set("primary_contact_email", accountGroup.PrimaryContactEmail); err != nil { - return diag.FromErr(fmt.Errorf("Error setting primary_contact_email: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting primary_contact_email: %s", err)) } if err = d.Set("created_at", accountGroup.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", accountGroup.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if accountGroup.UpdatedAt != nil { if err = d.Set("updated_at", accountGroup.UpdatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } } if accountGroup.UpdatedBy != nil { if err = d.Set("updated_by", accountGroup.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } } @@ -197,7 +199,7 @@ func resourceIbmEnterpriseAccountGroupRead(context context.Context, d *schema.Re } func resourceIbmEnterpriseAccountGroupUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enterpriseManagementClient, err := meta.(ClientSession).EnterpriseManagementV1() + enterpriseManagementClient, err := meta.(conns.ClientSession).EnterpriseManagementV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/README.md new file mode 100644 index 0000000000..2a42d3119b --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Event Notifications + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Event Notification resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_destination) +* IBM API Docs: [IBM API Docs for Event Notification](https://cloud.ibm.com/apidocs/event-notifications/event-notifications) +* IBM Event Notification SDK: [IBM SDK for Event Notification](https://github.com/IBM/event-notifications-go-admin-sdk/tree/main/eventnotificationsv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_destination.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_destination.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_destination.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_destination.go index a93624a53d..d9597d2e84 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_destination.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_destination.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func dataSourceIBMEnDestination() *schema.Resource { +func DataSourceIBMEnDestination() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEnDestinationRead, @@ -109,7 +111,7 @@ func dataSourceIBMEnDestination() *schema.Resource { } func dataSourceIBMEnDestinationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -127,39 +129,39 @@ func dataSourceIBMEnDestinationRead(context context.Context, d *schema.ResourceD d.SetId(fmt.Sprintf("%s/%s", *options.InstanceID, *options.ID)) if err = d.Set("name", result.Name); err != nil { - return diag.FromErr(fmt.Errorf("error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return diag.FromErr(fmt.Errorf("error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } } if err = d.Set("type", result.Type); err != nil { - return diag.FromErr(fmt.Errorf("error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } if result.Config != nil { err = d.Set("config", enDestinationFlattenConfig(*result.Config)) if err != nil { - return diag.FromErr(fmt.Errorf("error setting config %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting config %s", err)) } } if result.SubscriptionNames != nil { err = d.Set("subscription_names", result.SubscriptionNames) if err != nil { - return diag.FromErr(fmt.Errorf("error setting subscription_names %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_names %s", err)) } } - if err = d.Set("updated_at", dateTimeToString(result.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(result.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } - if err = d.Set("subscription_count", intValue(result.SubscriptionCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting subscription_count: %s", err)) + if err = d.Set("subscription_count", flex.IntValue(result.SubscriptionCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_count: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_destinations.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_destinations.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_destinations.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_destinations.go index e71e9851bc..f05d583313 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_destinations.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_destinations.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func dataSourceIBMEnDestinations() *schema.Resource { +func DataSourceIBMEnDestinations() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEnDestinationsRead, @@ -85,7 +87,7 @@ func dataSourceIBMEnDestinations() *schema.Resource { } func dataSourceIBMEnDestinationsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -130,13 +132,13 @@ func dataSourceIBMEnDestinationsRead(context context.Context, d *schema.Resource d.SetId(fmt.Sprintf("destinations/%s", *options.InstanceID)) - if err = d.Set("total_count", intValue(destinationList.TotalCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting total_count: %s", err)) + if err = d.Set("total_count", flex.IntValue(destinationList.TotalCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } if destinationList.Destinations != nil { if err = d.Set("destinations", enFlattenDestinationsList(destinationList.Destinations)); err != nil { - return diag.FromErr(fmt.Errorf("error setting destinations %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destinations %s", err)) } } @@ -173,7 +175,7 @@ func enDestinationListToMap(destinationItem en.DestinationLisItem) (destination destination["subscription_names"] = destinationItem.SubscriptionNames } if destinationItem.UpdatedAt != nil { - destination["updated_at"] = dateTimeToString(destinationItem.UpdatedAt) + destination["updated_at"] = flex.DateTimeToString(destinationItem.UpdatedAt) } return destination diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_subscription.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_subscription.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_subscription.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_subscription.go index b7fee3636d..daeb37cc27 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_subscription.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_subscription.go @@ -1,19 +1,20 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func dataSourceIBMEnSubscription() *schema.Resource { +func DataSourceIBMEnSubscription() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEnSubscriptionRead, @@ -114,7 +115,7 @@ func dataSourceIBMEnSubscription() *schema.Resource { } func dataSourceIBMEnSubscriptionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -132,49 +133,49 @@ func dataSourceIBMEnSubscriptionRead(context context.Context, d *schema.Resource d.SetId(fmt.Sprintf("%s/%s", *getSubscriptionOptions.InstanceID, *getSubscriptionOptions.ID)) if err = d.Set("name", result.Name); err != nil { - return diag.FromErr(fmt.Errorf("error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return diag.FromErr(fmt.Errorf("error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } } if err = d.Set("updated_at", result.UpdatedAt); err != nil { - return diag.FromErr(fmt.Errorf("error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if result.DestinationType != nil { if err = d.Set("destination_type", result.DestinationType); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_type: %s", err)) } } if err = d.Set("destination_id", result.DestinationID); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_id: %s", err)) } if err = d.Set("destination_name", result.DestinationName); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_name: %s", err)) } if err = d.Set("topic_id", result.TopicID); err != nil { - return diag.FromErr(fmt.Errorf("error setting topic_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_id: %s", err)) } if err = d.Set("topic_name", result.TopicName); err != nil { - return diag.FromErr(fmt.Errorf("error setting topic_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_name: %s", err)) } if result.Attributes != nil { if err = d.Set("attributes", enSubscriptionFlattenAttributes(result.Attributes)); err != nil { - return diag.FromErr(fmt.Errorf("error setting attributes %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting attributes %s", err)) } } if result.From != nil { if err = d.Set("from", result.From); err != nil { - return diag.FromErr(fmt.Errorf("error setting from %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting from %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_subscriptions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_subscriptions.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_subscriptions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_subscriptions.go index c567b05e95..a43bdf5b31 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_subscriptions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_subscriptions.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func dataSourceIBMEnSubscriptions() *schema.Resource { +func DataSourceIBMEnSubscriptions() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEnSubscriptionsRead, @@ -92,7 +94,7 @@ func dataSourceIBMEnSubscriptions() *schema.Resource { } func dataSourceIBMEnSubscriptionsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -137,14 +139,14 @@ func dataSourceIBMEnSubscriptionsRead(context context.Context, d *schema.Resourc d.SetId(fmt.Sprintf("subscriptions_%s", d.Get("instance_guid").(string))) - if err = d.Set("total_count", intValue(subscriptionList.TotalCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting total_count: %s", err)) + if err = d.Set("total_count", flex.IntValue(subscriptionList.TotalCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } if subscriptionList.Subscriptions != nil { err = d.Set("subscriptions", enFlattenSubscriptionList(subscriptionList.Subscriptions)) if err != nil { - return diag.FromErr(fmt.Errorf("error setting subscriptions %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscriptions %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_topic.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_topic.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_topic.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_topic.go index eecff6dd9e..bbc5353f5f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_topic.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_topic.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func dataSourceIBMEnTopic() *schema.Resource { +func DataSourceIBMEnTopic() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEnTopicRead, @@ -155,7 +157,7 @@ func dataSourceIBMEnTopic() *schema.Resource { } func dataSourceIBMEnTopicRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -176,38 +178,38 @@ func dataSourceIBMEnTopicRead(context context.Context, d *schema.ResourceData, m d.Set("topic_id", options.ID) if err = d.Set("name", result.Name); err != nil { - return diag.FromErr(fmt.Errorf("error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return diag.FromErr(fmt.Errorf("error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } } if err = d.Set("updated_at", result.UpdatedAt); err != nil { - return diag.FromErr(fmt.Errorf("error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } - if err = d.Set("source_count", intValue(result.SourceCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting source_count: %s", err)) + if err = d.Set("source_count", flex.IntValue(result.SourceCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_count: %s", err)) } - if err = d.Set("subscription_count", intValue(result.SubscriptionCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting subscription_count: %s", err)) + if err = d.Set("subscription_count", flex.IntValue(result.SubscriptionCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_count: %s", err)) } if result.Sources != nil { err = d.Set("sources", dataSourceTopicFlattenSources(result.Sources)) if err != nil { - return diag.FromErr(fmt.Errorf("error setting sources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sources %s", err)) } } if result.Subscriptions != nil { err = d.Set("subscriptions", enFlattenSubscriptions(result.Subscriptions)) if err != nil { - return diag.FromErr(fmt.Errorf("error setting subscriptions %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscriptions %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_topics.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_topics.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_topics.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_topics.go index 1ff5c182e2..74d4d66d4a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_en_topics.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/data_source_ibm_en_topics.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func dataSourceIBMEnTopics() *schema.Resource { +func DataSourceIBMEnTopics() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEnTopicsRead, @@ -80,7 +82,7 @@ func dataSourceIBMEnTopics() *schema.Resource { } func dataSourceIBMEnTopicsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -124,14 +126,14 @@ func dataSourceIBMEnTopicsRead(context context.Context, d *schema.ResourceData, d.SetId(fmt.Sprintf("topics_%s", d.Get("instance_guid").(string))) - if err = d.Set("total_count", intValue(topicList.TotalCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting total_count: %s", err)) + if err = d.Set("total_count", flex.IntValue(topicList.TotalCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } if topicList.Topics != nil { err = d.Set("topics", enTopicListFlatten(topicList.Topics)) if err != nil { - return diag.FromErr(fmt.Errorf("error setting topics %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topics %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_destination.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_destination.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_destination.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_destination.go index d36de656fb..0ca962a9ae 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_destination.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_destination.go @@ -1,12 +1,15 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -14,7 +17,7 @@ import ( en "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" ) -func resourceIBMEnDestination() *schema.Resource { +func ResourceIBMEnDestination() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMEnDestinationCreate, ReadContext: resourceIBMEnDestinationRead, @@ -37,7 +40,7 @@ func resourceIBMEnDestination() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_en_destination", "type"), + ValidateFunc: validate.InvokeValidator("ibm_en_destination", "type"), Description: "The type of Destination Webhook.", }, "description": { @@ -111,25 +114,25 @@ func resourceIBMEnDestination() *schema.Resource { } } -func resourceIBMEnDestinationValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMEnDestinationValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "webhook", MinValueLength: 1, }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_en_destination", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_en_destination", Schema: validateSchema} return &resourceValidator } func resourceIBMEnDestinationCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -159,14 +162,14 @@ func resourceIBMEnDestinationCreate(context context.Context, d *schema.ResourceD } func resourceIBMEnDestinationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.GetDestinationOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -184,43 +187,43 @@ func resourceIBMEnDestinationRead(context context.Context, d *schema.ResourceDat } if err = d.Set("instance_guid", options.InstanceID); err != nil { - return diag.FromErr(fmt.Errorf("error setting instance_guid: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_guid: %s", err)) } if err = d.Set("destination_id", options.ID); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_id: %s", err)) } if err = d.Set("name", result.Name); err != nil { - return diag.FromErr(fmt.Errorf("error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("type", result.Type); err != nil { - return diag.FromErr(fmt.Errorf("error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } if err = d.Set("description", result.Description); err != nil { - return diag.FromErr(fmt.Errorf("error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if result.Config != nil { err = d.Set("config", enDestinationFlattenConfig(*result.Config)) if err != nil { - return diag.FromErr(fmt.Errorf("error setting config %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting config %s", err)) } } - if err = d.Set("updated_at", dateTimeToString(result.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(result.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } - if err = d.Set("subscription_count", intValue(result.SubscriptionCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting subscription_count: %s", err)) + if err = d.Set("subscription_count", flex.IntValue(result.SubscriptionCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_count: %s", err)) } if result.Config != nil { if err = d.Set("subscription_names", result.SubscriptionNames); err != nil { - return diag.FromErr(fmt.Errorf("error setting subscription_names: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_names: %s", err)) } } @@ -228,14 +231,14 @@ func resourceIBMEnDestinationRead(context context.Context, d *schema.ResourceDat } func resourceIBMEnDestinationUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.UpdateDestinationOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -265,14 +268,14 @@ func resourceIBMEnDestinationUpdate(context context.Context, d *schema.ResourceD } func resourceIBMEnDestinationDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.DeleteDestinationOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_subscription.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_subscription.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_subscription.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_subscription.go index 6ff7c932a6..406db15ae7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_subscription.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_subscription.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -14,7 +16,7 @@ import ( "github.com/IBM/go-sdk-core/v5/core" ) -func resourceIBMEnSubscription() *schema.Resource { +func ResourceIBMEnSubscription() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMEnSubscriptionCreate, ReadContext: resourceIBMEnSubscriptionRead, @@ -115,7 +117,7 @@ func resourceIBMEnSubscription() *schema.Resource { } func resourceIBMEnSubscriptionCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -146,14 +148,14 @@ func resourceIBMEnSubscriptionCreate(context context.Context, d *schema.Resource } func resourceIBMEnSubscriptionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.GetSubscriptionOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -171,69 +173,69 @@ func resourceIBMEnSubscriptionRead(context context.Context, d *schema.ResourceDa } if err = d.Set("instance_guid", options.InstanceID); err != nil { - return diag.FromErr(fmt.Errorf("error setting instance_guid: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_guid: %s", err)) } if err = d.Set("subscription_id", result.ID); err != nil { - return diag.FromErr(fmt.Errorf("error setting instance_guid: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_guid: %s", err)) } if err = d.Set("name", result.Name); err != nil { - return diag.FromErr(fmt.Errorf("error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if result.Description != nil { if err = d.Set("description", result.Description); err != nil { - return diag.FromErr(fmt.Errorf("error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } } if result.From != nil { if err = d.Set("from", result.From); err != nil { - return diag.FromErr(fmt.Errorf("error setting from: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting from: %s", err)) } } if err = d.Set("destination_id", result.DestinationID); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_id: %s", err)) } if err = d.Set("destination_type", result.DestinationType); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_type: %s", err)) } if result.DestinationName != nil { if err = d.Set("destination_name", result.DestinationName); err != nil { - return diag.FromErr(fmt.Errorf("error setting destination_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination_name: %s", err)) } } if err = d.Set("topic_id", result.TopicID); err != nil { - return diag.FromErr(fmt.Errorf("error setting topic_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_id: %s", err)) } if result.TopicName != nil { if err = d.Set("topic_name", result.TopicName); err != nil { - return diag.FromErr(fmt.Errorf("error setting topic_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting topic_name: %s", err)) } } if err = d.Set("updated_at", result.UpdatedAt); err != nil { - return diag.FromErr(fmt.Errorf("error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } return nil } func resourceIBMEnSubscriptionUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.UpdateSubscriptionOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -263,14 +265,14 @@ func resourceIBMEnSubscriptionUpdate(context context.Context, d *schema.Resource } func resourceIBMEnSubscriptionDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.DeleteSubscriptionOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_topic.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_topic.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_topic.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_topic.go index 1ba30ea6cf..474095dad0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_en_topic.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification/resource_ibm_en_topic.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventnotification import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -14,7 +16,7 @@ import ( "github.com/IBM/go-sdk-core/v5/core" ) -func resourceIBMEnTopic() *schema.Resource { +func ResourceIBMEnTopic() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMEnTopicCreate, ReadContext: resourceIBMEnTopicRead, @@ -148,7 +150,7 @@ func resourceIBMEnTopic() *schema.Resource { } func resourceIBMEnTopicCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } @@ -184,14 +186,14 @@ func resourceIBMEnTopicCreate(context context.Context, d *schema.ResourceData, m } func resourceIBMEnTopicRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.GetTopicOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -214,11 +216,11 @@ func resourceIBMEnTopicRead(context context.Context, d *schema.ResourceData, met d.Set("topic_id", result.ID) if err = d.Set("name", result.Name); err != nil { - return diag.FromErr(fmt.Errorf("error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", result.Description); err != nil { - return diag.FromErr(fmt.Errorf("error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if result.Sources != nil { @@ -228,20 +230,20 @@ func resourceIBMEnTopicRead(context context.Context, d *schema.ResourceData, met sources = append(sources, sourcesItemMap) } if err = d.Set("sources", sources); err != nil { - return diag.FromErr(fmt.Errorf("error setting sources: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sources: %s", err)) } } if err = d.Set("updated_at", result.UpdatedAt); err != nil { - return diag.FromErr(fmt.Errorf("error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } - if err = d.Set("source_count", intValue(result.SourceCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting source_count: %s", err)) + if err = d.Set("source_count", flex.IntValue(result.SourceCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_count: %s", err)) } - if err = d.Set("subscription_count", intValue(result.SubscriptionCount)); err != nil { - return diag.FromErr(fmt.Errorf("error setting subscription_count: %s", err)) + if err = d.Set("subscription_count", flex.IntValue(result.SubscriptionCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscription_count: %s", err)) } subscriptions := []map[string]interface{}{} @@ -251,21 +253,21 @@ func resourceIBMEnTopicRead(context context.Context, d *schema.ResourceData, met } if err = d.Set("subscriptions", subscriptions); err != nil { - return diag.FromErr(fmt.Errorf("error setting subscriptions: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subscriptions: %s", err)) } return nil } func resourceIBMEnTopicUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.ReplaceTopicOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -299,14 +301,14 @@ func resourceIBMEnTopicUpdate(context context.Context, d *schema.ResourceData, m } func resourceIBMEnTopicDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - enClient, err := meta.(ClientSession).EventNotificationsApiV1() + enClient, err := meta.(conns.ClientSession).EventNotificationsApiV1() if err != nil { return diag.FromErr(err) } options := &en.DeleteTopicOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/README.md new file mode 100644 index 0000000000..0e054addb1 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Event Streams + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Event Streams resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/event_streams_schema) +* IBM API Docs: [IBM API Docs for Event Streams](https://cloud.ibm.com/apidocs/event-streams/adminrest) +* IBM Event Streams SDK: [IBM SDK for Event Streams](https://github.com/IBM/eventstreams-go-sdk/tree/main/pkg) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_event_streams_schema.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/data_source_ibm_event_streams_schema.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_event_streams_schema.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/data_source_ibm_event_streams_schema.go index a25e78fc94..efc9aa7f97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_event_streams_schema.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/data_source_ibm_event_streams_schema.go @@ -1,24 +1,25 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventstreams import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMEventStreamsSchema() *schema.Resource { +func DataSourceIBMEventStreamsSchema() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMEventStreamsSchemaRead, Schema: map[string]*schema.Schema{ - "resource_instance_id": &schema.Schema{ + "resource_instance_id": { Type: schema.TypeString, Required: true, Description: "The ID or CRN of the Event Streams service instance", @@ -28,7 +29,7 @@ func dataSourceIBMEventStreamsSchema() *schema.Resource { Computed: true, Description: "The API endpoint for interacting with an Event Streams REST API", }, - "schema_id": &schema.Schema{ + "schema_id": { Type: schema.TypeString, Required: true, Description: "The unique ID to be assigned to the schema.", @@ -38,7 +39,7 @@ func dataSourceIBMEventStreamsSchema() *schema.Resource { } func dataSourceIBMEventStreamsSchemaRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schemaregistryClient, err := meta.(ClientSession).ESschemaRegistrySession() + schemaregistryClient, err := meta.(conns.ClientSession).ESschemaRegistrySession() if err != nil { log.Printf("[DEBUG] dataSourceIBMEventStreamsSchemaRead schemaregistryClient err %s", err) return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_event_streams_topic.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_event_streams_topic.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go index f0534c5aa3..bfa4b67e0d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_event_streams_topic.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/data_source_ibm_event_streams_topic.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventstreams import ( "fmt" @@ -10,11 +10,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMEventStreamsTopic() *schema.Resource { +func DataSourceIBMEventStreamsTopic() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMEventStreamsTopicRead, Schema: map[string]*schema.Schema{ - "resource_instance_id": &schema.Schema{ + "resource_instance_id": { Type: schema.TypeString, Required: true, Description: "The CRN of the Event Streams instance", @@ -30,17 +30,17 @@ func dataSourceIBMEventStreamsTopic() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Description: "Kafka brokers addresses for interacting with Kafka native API", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Description: "The name of the topic", Required: true, }, - "partitions": &schema.Schema{ + "partitions": { Type: schema.TypeInt, Description: "The number of partitions of the topic", Computed: true, }, - "config": &schema.Schema{ + "config": { Type: schema.TypeMap, Description: "The configuration parameters of the topic.", Computed: true, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_event_streams_schema.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/resource_ibm_event_streams_schema.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_event_streams_schema.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/resource_ibm_event_streams_schema.go index 3a989c4ef0..7d4865eb9b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_event_streams_schema.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/resource_ibm_event_streams_schema.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventstreams import ( "context" @@ -10,13 +10,15 @@ import ( "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1" "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMEventStreamsSchema() *schema.Resource { +func ResourceIBMEventStreamsSchema() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMEventStreamsSchemaCreate, ReadContext: resourceIBMEventStreamsSchemaRead, @@ -25,7 +27,7 @@ func resourceIBMEventStreamsSchema() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "resource_instance_id": &schema.Schema{ + "resource_instance_id": { Type: schema.TypeString, Description: "The ID or the CRN of the Event Streams service instance", Required: true, @@ -36,11 +38,11 @@ func resourceIBMEventStreamsSchema() *schema.Resource { Computed: true, Description: "The API endpoint for interacting with an Event Streams REST API", }, - "schema": &schema.Schema{ + "schema": { Type: schema.TypeString, Required: true, StateFunc: func(v interface{}) string { - json, err := normalizeJSONString(v) + json, err := flex.NormalizeJSONString(v) if err != nil { return fmt.Sprintf("%q", err.Error()) } @@ -49,7 +51,7 @@ func resourceIBMEventStreamsSchema() *schema.Resource { ValidateFunc: validateAvroSchema, Description: "The schema in JSON format", }, - "schema_id": &schema.Schema{ + "schema_id": { Type: schema.TypeString, Optional: true, Computed: true, @@ -94,7 +96,7 @@ func (Bytes) _type() string { return "bytes" } func (String) _type() string { return "string" } func validateAvroSchema(v interface{}, k string) (ws []string, errors []error) { - if _, err := normalizeJSONString(v); err != nil { + if _, err := flex.NormalizeJSONString(v); err != nil { errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) } var j interface{} @@ -171,7 +173,7 @@ func validateName(s map[string]interface{}, t string) error { } func resourceIBMEventStreamsSchemaCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schemaregistryClient, err := meta.(ClientSession).ESschemaRegistrySession() + schemaregistryClient, err := meta.(conns.ClientSession).ESschemaRegistrySession() if err != nil { return diag.FromErr(err) } @@ -203,7 +205,7 @@ func resourceIBMEventStreamsSchemaCreate(context context.Context, d *schema.Reso } func resourceIBMEventStreamsSchemaRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schemaregistryClient, err := meta.(ClientSession).ESschemaRegistrySession() + schemaregistryClient, err := meta.(conns.ClientSession).ESschemaRegistrySession() if err != nil { return diag.FromErr(err) } @@ -231,11 +233,11 @@ func resourceIBMEventStreamsSchemaRead(context context.Context, d *schema.Resour s, err := json.Marshal(avroSchema) if err != nil { - return diag.FromErr(fmt.Errorf("error marshalling the created schema: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error marshalling the created schema: %s", err)) } if err = d.Set("schema", string(s)); err != nil { - return diag.FromErr(fmt.Errorf("error setting the schema: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting the schema: %s", err)) } d.Set("resource_instance_id", instanceCRN) d.Set("schema_id", schemaID) @@ -244,7 +246,7 @@ func resourceIBMEventStreamsSchemaRead(context context.Context, d *schema.Resour } func resourceIBMEventStreamsSchemaUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schemaregistryClient, err := meta.(ClientSession).ESschemaRegistrySession() + schemaregistryClient, err := meta.(conns.ClientSession).ESschemaRegistrySession() if err != nil { return diag.FromErr(err) } @@ -276,7 +278,7 @@ func resourceIBMEventStreamsSchemaUpdate(context context.Context, d *schema.Reso } func resourceIBMEventStreamsSchemaDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schemaregistryClient, err := meta.(ClientSession).ESschemaRegistrySession() + schemaregistryClient, err := meta.(conns.ClientSession).ESschemaRegistrySession() if err != nil { return diag.FromErr(err) } @@ -331,7 +333,7 @@ func getInstanceURL(d *schema.ResourceData, meta interface{}) (string, string, e } func getInstanceDetails(crn string, meta interface{}) (*resourcecontrollerv2.ResourceInstance, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { log.Printf("[DEBUG] getInstanceURL ResourceControllerAPI err %s", err) return nil, err diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_event_streams_topic.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/resource_ibm_event_streams_topic.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_event_streams_topic.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/resource_ibm_event_streams_topic.go index f8cb9ea857..9df1bf1026 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_event_streams_topic.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams/resource_ibm_event_streams_topic.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package eventstreams import ( "fmt" @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/Shopify/sarama" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -42,7 +44,7 @@ var ( } ) -func resourceIBMEventStreamsTopic() *schema.Resource { +func ResourceIBMEventStreamsTopic() *schema.Resource { return &schema.Resource{ Exists: resourceIBMEventStreamsTopicExists, Create: resourceIBMEventStreamsTopicCreate, @@ -51,7 +53,7 @@ func resourceIBMEventStreamsTopic() *schema.Resource { Delete: resourceIBMEventStreamsTopicDelete, Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "resource_instance_id": &schema.Schema{ + "resource_instance_id": { Type: schema.TypeString, Description: "The CRN of the Event Streams instance", Required: true, @@ -100,7 +102,7 @@ func resourceIBMEventStreamsTopicExists(d *schema.ResourceData, meta interface{} topicName := d.Get("name").(string) topicsMetadata, err := adminClient.DescribeTopics([]string{topicName}) if err != nil { - descErr := fmt.Errorf("error describing topic %s : %v", topicName, err) + descErr := fmt.Errorf("[ERROR] Error describing topic %s : %v", topicName, err) log.Printf("[DEBUG] resourceIBMEventStreamsTopicExists DescribeTopics err %v", descErr) return false, descErr } @@ -249,7 +251,7 @@ func resourceIBMEventStreamsTopicDelete(d *schema.ResourceData, meta interface{} } func createSaramaAdminClient(d *schema.ResourceData, meta interface{}) (sarama.ClusterAdmin, string, error) { - bxSession, err := meta.(ClientSession).BluemixSession() + bxSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { log.Printf("[DEBUG] createSaramaAdminClient BluemixSession err %s", err) return nil, "", err @@ -279,7 +281,7 @@ func createSaramaAdminClient(d *schema.ResourceData, meta interface{}) (sarama.C adminURL := instance.Extensions["kafka_http_url"].(string) d.Set("kafka_http_url", adminURL) log.Printf("[INFO] createSaramaAdminClient kafka_http_url is set to %s", adminURL) - brokerAddress := expandStringList(instance.Extensions["kafka_brokers_sasl"].([]interface{})) + brokerAddress := flex.ExpandStringList(instance.Extensions["kafka_brokers_sasl"].([]interface{})) d.Set("kafka_brokers_sasl", brokerAddress) log.Printf("[INFO] createSaramaAdminClient kafka_brokers_sasl is set to %s", brokerAddress) tenantID := strings.TrimPrefix(strings.Split(adminURL, ".")[0], "https://") @@ -308,7 +310,7 @@ func createSaramaAdminClient(d *schema.ResourceData, meta interface{}) (sarama.C func topicDetail2Config(topicConfigEntries map[string]*string) map[string]*string { configs := map[string]*string{} for key, value := range topicConfigEntries { - if indexOf(key, allowedTopicConfigs) != -1 { + if flex.IndexOf(key, allowedTopicConfigs) != -1 { configs[key] = value } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/README.md new file mode 100644 index 0000000000..1f71084f3e --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Cloud Functions + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Cloud Functions resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/function_action) +* IBM API Docs: [IBM API Docs for Cloud Functions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_over) +* IBM Cloud Functions SDK: [IBM SDK for Cloud Functions](https://github.com/apache/openwhisk-client-go/tree/master/whisk) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_action.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_action.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_action.go index 1e77a124f4..e9bb3f306f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_action.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package functions import ( "fmt" "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMFunctionAction() *schema.Resource { +func DataSourceIBMFunctionAction() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMFunctionActionRead, @@ -123,17 +125,17 @@ func dataSourceIBMFunctionAction() *schema.Resource { } func dataSourceIBMFunctionActionRead(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() if err != nil { return err } - bxSession, err := meta.(ClientSession).BluemixSession() + bxSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) if err != nil { return err @@ -144,7 +146,7 @@ func dataSourceIBMFunctionActionRead(d *schema.ResourceData, meta interface{}) e action, _, err := actionService.Get(name, true) if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function Action %s : %s", name, err) + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function Action %s : %s", name, err) } temp := strings.Split(action.Namespace, "/") @@ -159,18 +161,18 @@ func dataSourceIBMFunctionActionRead(d *schema.ResourceData, meta interface{}) e } d.Set("namespace", namespace) - d.Set("limits", flattenLimits(action.Limits)) - d.Set("exec", flattenExec(action.Exec, d)) + d.Set("limits", flex.FlattenLimits(action.Limits)) + d.Set("exec", flex.FlattenExec(action.Exec, d)) d.Set("publish", action.Publish) d.Set("version", action.Version) d.Set("action_id", action.Name) - annotations, err := flattenAnnotations(action.Annotations) + annotations, err := flex.FlattenAnnotations(action.Annotations) if err != nil { log.Printf( "An error occured during reading of action (%s) annotations : %s", d.Id(), err) } d.Set("annotations", annotations) - parameters, err := flattenParameters(action.Parameters) + parameters, err := flex.FlattenParameters(action.Parameters) if err != nil { log.Printf( "An error occured during reading of action (%s) parameters : %s", d.Id(), err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_namespace.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_namespace.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_namespace.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_namespace.go index 6ffea0ab4e..c627bbd8a6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_namespace.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_namespace.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package functions import ( "fmt" @@ -9,9 +9,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM-Cloud/bluemix-go/api/functions" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func dataSourceIBMFunctionNamespace() *schema.Resource { +func DataSourceIBMFunctionNamespace() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMFunctionNamespaceRead, Schema: map[string]*schema.Schema{ @@ -19,7 +21,7 @@ func dataSourceIBMFunctionNamespace() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Name of namespace.", - ValidateFunc: InvokeValidator("ibm_function_namespace", funcNamespaceName), + ValidateFunc: validate.InvokeValidator("ibm_function_namespace", funcNamespaceName), }, funcNamespaceDesc: { Type: schema.TypeString, @@ -41,7 +43,7 @@ func dataSourceIBMFunctionNamespace() *schema.Resource { } func dataSourceIBMFunctionNamespaceRead(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() if err != nil { return err } @@ -87,5 +89,5 @@ func dataSourceIBMFunctionNamespaceRead(d *schema.ResourceData, meta interface{} } } - return fmt.Errorf("No cloud function namespace found with name [%s]", name) + return fmt.Errorf("[ERROR] No cloud function namespace found with name [%s]", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_package.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_package.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_package.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_package.go index 9e4c35fa42..ac49ad6576 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_package.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_package.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package functions import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMFunctionPackage() *schema.Resource { +func DataSourceIBMFunctionPackage() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMFunctionPackageRead, @@ -64,17 +66,17 @@ func dataSourceIBMFunctionPackage() *schema.Resource { } func dataSourceIBMFunctionPackageRead(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() if err != nil { return err } - bxSession, err := meta.(ClientSession).BluemixSession() + bxSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) if err != nil { return err @@ -84,7 +86,7 @@ func dataSourceIBMFunctionPackageRead(d *schema.ResourceData, meta interface{}) name := d.Get("name").(string) pkg, _, err := packageService.Get(name) if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function package %s : %s", name, err) + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function package %s : %s", name, err) } d.SetId(pkg.Name) @@ -93,20 +95,20 @@ func dataSourceIBMFunctionPackageRead(d *schema.ResourceData, meta interface{}) d.Set("publish", pkg.Publish) d.Set("version", pkg.Version) d.Set("package_id", pkg.Name) - annotations, err := flattenAnnotations(pkg.Annotations) + annotations, err := flex.FlattenAnnotations(pkg.Annotations) if err != nil { log.Printf( "An error occured during reading of package (%s) annotations : %s", d.Id(), err) } d.Set("annotations", annotations) - parameters, err := flattenParameters(pkg.Parameters) + parameters, err := flex.FlattenParameters(pkg.Parameters) if err != nil { log.Printf( "An error occured during reading of package (%s) parameters : %s", d.Id(), err) } d.Set("parameters", parameters) - if !isEmpty(*pkg.Binding) { + if !flex.IsEmpty(*pkg.Binding) { d.Set("bind_package_name", fmt.Sprintf("/%s/%s", pkg.Binding.Namespace, pkg.Binding.Name)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_rule.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_rule.go index f44bf6c94f..727f0432e8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_rule.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package functions import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMFunctionRule() *schema.Resource { +func DataSourceIBMFunctionRule() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMFunctionRuleRead, @@ -59,17 +60,17 @@ func dataSourceIBMFunctionRule() *schema.Resource { } func dataSourceIBMFunctionRuleRead(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() if err != nil { return err } - bxSession, err := meta.(ClientSession).BluemixSession() + bxSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) if err != nil { return err @@ -80,7 +81,7 @@ func dataSourceIBMFunctionRuleRead(d *schema.ResourceData, meta interface{}) err rule, _, err := ruleService.Get(name) if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function Rule %s : %s", name, err) + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function Rule %s : %s", name, err) } d.SetId(rule.Name) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_trigger.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_trigger.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_trigger.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_trigger.go index 3cfedcfca9..e9876e218a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_function_trigger.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/data_source_ibm_function_trigger.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package functions import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMFunctionTrigger() *schema.Resource { +func DataSourceIBMFunctionTrigger() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMFunctionTriggerRead, @@ -56,17 +58,17 @@ func dataSourceIBMFunctionTrigger() *schema.Resource { } func dataSourceIBMFunctionTriggerRead(d *schema.ResourceData, meta interface{}) error { - functionNamespaceAPI, err := meta.(ClientSession).FunctionIAMNamespaceAPI() + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() if err != nil { return err } - bxSession, err := meta.(ClientSession).BluemixSession() + bxSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } namespace := d.Get("namespace").(string) - wskClient, err := setupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) if err != nil { return err @@ -77,7 +79,7 @@ func dataSourceIBMFunctionTriggerRead(d *schema.ResourceData, meta interface{}) trigger, _, err := triggerService.Get(name) if err != nil { - return fmt.Errorf("Error retrieving IBM Cloud Function Trigger %s : %s", name, err) + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function Trigger %s : %s", name, err) } d.SetId(trigger.Name) @@ -86,14 +88,14 @@ func dataSourceIBMFunctionTriggerRead(d *schema.ResourceData, meta interface{}) d.Set("publish", trigger.Publish) d.Set("version", trigger.Version) d.Set("trigger_id", trigger.Name) - annotations, err := flattenAnnotations(trigger.Annotations) + annotations, err := flex.FlattenAnnotations(trigger.Annotations) if err != nil { log.Printf( "An error occured during reading of trigger (%s) annotations : %s", d.Id(), err) } d.Set("annotations", annotations) - parameters, err := flattenParameters(trigger.Parameters) + parameters, err := flex.FlattenParameters(trigger.Parameters) if err != nil { log.Printf( "An error occured during reading of trigger (%s) parameters : %s", d.Id(), err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/qualified_name.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/qualified_name.go similarity index 98% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/qualified_name.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/qualified_name.go index 95a67fce55..6b5dfdfe1a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/qualified_name.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/qualified_name.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package functions import ( "errors" @@ -126,7 +126,7 @@ func NewQualifiedName(name string) (*QualifiedName, error) { // invalid qualified names detected while building a new // QualifiedName struct. func qualifiedNameNotSpecifiedErr() error { - return errors.New("A valid qualified name must be specified.") + return errors.New("[ERROR] valid qualified name must be specified") } // NewQualifiedNameError(entityName, err) returns specific whisk error diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_action.go new file mode 100644 index 0000000000..bba6ee6b01 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_action.go @@ -0,0 +1,576 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package functions + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/apache/openwhisk-client-go/whisk" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + funcActionName = "name" + funcActionNamespace = "namespace" + funcActionUsrDefAnnots = "user_defined_annotations" + funcActionUsrDefParams = "user_defined_parameters" +) + +func ResourceIBMFunctionAction() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMFunctionActionCreate, + Read: resourceIBMFunctionActionRead, + Update: resourceIBMFunctionActionUpdate, + Delete: resourceIBMFunctionActionDelete, + Exists: resourceIBMFunctionActionExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + funcActionName: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Name of action.", + ValidateFunc: validate.InvokeValidator("ibm_function_action", funcActionName), + }, + funcActionNamespace: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "IBM Cloud function namespace.", + ValidateFunc: validate.InvokeValidator("ibm_function_action", funcActionNamespace), + }, + "limits": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "timeout": { + Type: schema.TypeInt, + Optional: true, + Default: 60000, + Description: "The timeout LIMIT in milliseconds after which the action is terminated.", + }, + "memory": { + Type: schema.TypeInt, + Optional: true, + Default: 256, + Description: "The maximum memory LIMIT in MB for the action (default 256.", + }, + "log_size": { + Type: schema.TypeInt, + Optional: true, + Default: 10, + Description: "The maximum log size LIMIT in MB for the action.", + }, + }, + }, + }, + "exec": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Description: "Execution info", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "image": { + Type: schema.TypeString, + Optional: true, + Description: "Container image name when kind is 'blackbox'.", + ConflictsWith: []string{"exec.0.components"}, + }, + "init": { + Type: schema.TypeString, + Optional: true, + Description: "Optional zipfile reference.", + ConflictsWith: []string{"exec.0.image", "exec.0.components"}, + }, + "code": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "The code to execute.", + ConflictsWith: []string{"exec.0.components", "exec.0.code_path"}, + }, + "code_path": { + Type: schema.TypeString, + Optional: true, + Description: "The file path of code to execute.", + ConflictsWith: []string{"exec.0.components", "exec.0.code"}, + }, + "kind": { + Type: schema.TypeString, + Required: true, + Description: "The type of action. Possible values can be found here (https://cloud.ibm.com/docs/openwhisk?topic=cloud-functions-runtimes)", + }, + "main": { + Type: schema.TypeString, + Optional: true, + Description: "The name of the action entry point (function or fully-qualified method name when applicable).", + ConflictsWith: []string{"exec.0.image", "exec.0.components"}, + }, + "components": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The List of fully qualified action.", + ConflictsWith: []string{"exec.0.image", "exec.0.code", "exec.0.code_path"}, + }, + }, + }, + }, + "publish": { + Type: schema.TypeBool, + Optional: true, + Description: "Action visibilty.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Semantic version of the item.", + }, + funcActionUsrDefAnnots: { + Type: schema.TypeString, + Optional: true, + Default: "[]", + Description: "Annotation values in KEY VALUE format.", + ValidateFunc: validate.InvokeValidator("ibm_function_action", funcActionUsrDefAnnots), + DiffSuppressFunc: flex.SuppressEquivalentJSON, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + funcActionUsrDefParams: { + Type: schema.TypeString, + Optional: true, + Default: "[]", + Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the action.", + ValidateFunc: validate.InvokeValidator("ibm_function_action", funcActionUsrDefParams), + DiffSuppressFunc: flex.SuppressEquivalentJSON, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + "annotations": { + Type: schema.TypeString, + Computed: true, + Description: "All annotations set on action by user and those set by the IBM Cloud Function backend/API.", + }, + "parameters": { + Type: schema.TypeString, + Computed: true, + Description: "All paramters set on action by user and those set by the IBM Cloud Function backend/API.", + }, + "action_id": { + Type: schema.TypeString, + Computed: true, + }, + "target_endpoint_url": { + Type: schema.TypeString, + Computed: true, + Description: "Action target endpoint URL.", + }, + }, + } +} + +func ResourceIBMFuncActionValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcActionName, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, + Regexp: `^[^/*][a-zA-Z0-9/_@.-]`, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcActionNamespace, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcActionUsrDefAnnots, + ValidateFunctionIdentifier: validate.ValidateJSONString, + Type: validate.TypeString, + Default: "[]", + Optional: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcActionUsrDefParams, + ValidateFunctionIdentifier: validate.ValidateJSONString, + Type: validate.TypeString, + Optional: true}) + + ibmFuncActionResourceValidator := validate.ResourceValidator{ResourceName: "ibm_function_action", Schema: validateSchema} + return &ibmFuncActionResourceValidator +} + +func resourceIBMFunctionActionCreate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + namespace := d.Get("namespace").(string) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + actionService := wskClient.Actions + name := d.Get("name").(string) + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(name); err != nil { + return NewQualifiedNameError(name, err) + } + + payload := whisk.Action{ + Name: qualifiedName.GetEntityName(), + Namespace: namespace, + } + + exec := d.Get("exec").([]interface{}) + payload.Exec = flex.ExpandExec(exec) + + userDefinedAnnotations := d.Get("user_defined_annotations").(string) + payload.Annotations, err = flex.ExpandAnnotations(userDefinedAnnotations) + if err != nil { + return err + } + + userDefinedParameters := d.Get("user_defined_parameters").(string) + payload.Parameters, err = flex.ExpandParameters(userDefinedParameters) + if err != nil { + return err + } + + if v, ok := d.GetOk("limits"); ok { + payload.Limits = flex.ExpandLimits(v.([]interface{})) + } + + if publish, ok := d.GetOk("publish"); ok { + p := publish.(bool) + payload.Publish = &p + } + + log.Println("[INFO] Creating IBM Cloud Function Action") + _, _, err = actionService.Insert(&payload, true) + + if err != nil { + return fmt.Errorf("[ERROR] Error creating IBM Cloud Function Action: %s", err) + } + + d.SetId(fmt.Sprintf("%s:%s", namespace, qualifiedName.GetEntityName())) + + return resourceIBMFunctionActionRead(d, meta) +} + +func resourceIBMFunctionActionRead(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := "" + actionID := "" + if len(parts) == 2 { + namespace = parts[0] + actionID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + actionID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, actionID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + actionService := wskClient.Actions + action, _, err := actionService.Get(actionID, true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function Action %s : %s", actionID, err) + } + d.Set("namespace", namespace) + d.Set("limits", flex.FlattenLimits(action.Limits)) + d.Set("exec", flex.FlattenExec(action.Exec, d)) + d.Set("publish", action.Publish) + d.Set("version", action.Version) + d.Set("action_id", action.Name) + annotations, err := flex.FlattenAnnotations(action.Annotations) + if err != nil { + return err + } + + d.Set("annotations", annotations) + parameters, err := flex.FlattenParameters(action.Parameters) + if err != nil { + return err + } + d.Set("parameters", parameters) + + temp := strings.Split(action.Namespace, "/") + pkgName := "" + if len(temp) == 2 { + pkgName = temp[1] + d.Set("name", fmt.Sprintf("%s/%s", pkgName, action.Name)) + c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ + Namespace: wskClient.Namespace, + AuthToken: wskClient.AuthToken, + Host: wskClient.Host, + AdditionalHeaders: wskClient.AdditionalHeaders, + }) + if err != nil { + return err + } + pkg, _, err := c.Packages.Get(pkgName) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving package IBM Cloud Function package %s : %s", pkgName, err) + } + + userAnnotations, err := flex.FlattenAnnotations(flex.FilterInheritedAnnotations(pkg.Annotations, action.Annotations)) + if err != nil { + return err + } + + d.Set("user_defined_annotations", userAnnotations) + userParameters, err := flex.FlattenParameters(flex.FilterInheritedParameters(pkg.Parameters, action.Parameters)) + if err != nil { + return err + } + d.Set("user_defined_parameters", userParameters) + } else { + d.Set("name", action.Name) + userDefinedAnnotations, err := flex.FilterActionAnnotations(action.Annotations) + if err != nil { + return err + } + d.Set("user_defined_annotations", userDefinedAnnotations) + + userDefinedParameters, err := flex.FilterActionParameters(action.Parameters) + if err != nil { + return err + } + d.Set("user_defined_parameters", userDefinedParameters) + } + + targetUrl, err := action.ActionURL(wskClient.Config.Host, "/api", wskClient.Config.Version, pkgName) + if err != nil { + log.Printf( + "Error creating target endpoint URL for action (%s) targetURL : %s", d.Id(), err) + + } + d.Set("target_endpoint_url", targetUrl) + + return nil +} + +func resourceIBMFunctionActionUpdate(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + actionID := parts[1] + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + actionService := wskClient.Actions + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(actionID); err != nil { + return NewQualifiedNameError(actionID, err) + } + + payload := whisk.Action{ + Name: qualifiedName.GetEntityName(), + Namespace: namespace, + } + + ischanged := false + + if d.HasChange("publish") { + p := d.Get("publish").(bool) + payload.Publish = &p + } + + if d.HasChange("user_defined_parameters") { + var err error + payload.Parameters, err = flex.ExpandParameters(d.Get("user_defined_parameters").(string)) + if err != nil { + return err + } + ischanged = true + } + + if d.HasChange("user_defined_annotations") { + var err error + payload.Annotations, err = flex.ExpandAnnotations(d.Get("user_defined_annotations").(string)) + if err != nil { + return err + } + ischanged = true + } + + if d.HasChange("exec") { + exec := d.Get("exec").([]interface{}) + payload.Exec = flex.ExpandExec(exec) + ischanged = true + } + + if d.HasChange("limits") { + limits := d.Get("limits").([]interface{}) + payload.Limits = flex.ExpandLimits(limits) + ischanged = true + } + + if ischanged { + log.Println("[INFO] Update IBM Cloud Function Action") + _, _, err = actionService.Insert(&payload, true) + if err != nil { + return fmt.Errorf("[ERROR] Error updating IBM Cloud Function Action: %s", err) + } + } + + return resourceIBMFunctionActionRead(d, meta) +} + +func resourceIBMFunctionActionDelete(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + actionID := parts[1] + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + actionService := wskClient.Actions + + _, err = actionService.Delete(actionID) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting IBM Cloud Function Action: %s", err) + } + + d.SetId("") + return nil +} + +func resourceIBMFunctionActionExists(d *schema.ResourceData, meta interface{}) (bool, error) { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return false, err + } + + namespace := "" + actionID := "" + if len(parts) >= 2 { + namespace = parts[0] + actionID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + actionID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, actionID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return false, err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return false, err + } + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return false, err + + } + + actionService := wskClient.Actions + + action, resp, err := actionService.Get(actionID, true) + if err != nil { + if resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error communicating with IBM Cloud Function Client : %s", err) + } + + temp := strings.Split(action.Namespace, "/") + var name string + + if len(temp) == 2 { + name = fmt.Sprintf("%s/%s", temp[1], action.Name) + } else { + name = action.Name + } + + return name == actionID, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_namespace.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_namespace.go new file mode 100644 index 0000000000..dd4da03365 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_namespace.go @@ -0,0 +1,218 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package functions + +import ( + "fmt" + "log" + "strings" + + "github.com/IBM-Cloud/bluemix-go/api/functions" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + funcNamespaceName = "name" + funcNamespaceResGrpId = "resource_group_id" + funcNamespaceResPlanId = "resource_plan_id" + funcNamespaceDesc = "description" + funcNamespaceLoc = "location" +) + +func ResourceIBMFunctionNamespace() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMFunctionNamespaceCreate, + Read: resourceIBMFunctionNamespaceRead, + Update: resourceIBMFunctionNamespaceUpdate, + Delete: resourceIBMFunctionNamespaceDelete, + Exists: resourceIBMFunctionNamespaceExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + funcNamespaceName: { + Type: schema.TypeString, + Required: true, + Description: "Name of namespace.", + ValidateFunc: validate.InvokeValidator("ibm_function_namespace", funcNamespaceName), + }, + funcNamespaceDesc: { + Type: schema.TypeString, + Optional: true, + Description: "Namespace Description.", + }, + funcNamespaceResGrpId: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource Group ID.", + ValidateFunc: validate.InvokeValidator("ibm_function_namespace", funcNamespaceResGrpId), + }, + funcNamespaceLoc: { + Type: schema.TypeString, + Computed: true, + Description: "Namespace Location.", + }, + }, + } +} + +func ResourceIBMFuncNamespaceValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcNamespaceName, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString, + Required: true}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcNamespaceResGrpId, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString, + Required: true}) + + ibmFuncNamespaceResourceValidator := validate.ResourceValidator{ResourceName: "ibm_function_namespace", Schema: validateSchema} + return &ibmFuncNamespaceResourceValidator +} + +func resourceIBMFunctionNamespaceCreate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + createNamespaceOptions := functions.CreateNamespaceOptions{} + + name := d.Get(funcNamespaceName).(string) + createNamespaceOptions.Name = &name + resourceGroupID := d.Get(funcNamespaceResGrpId).(string) + createNamespaceOptions.ResourceGroupID = &resourceGroupID + resourcePlanID := "functions-base-plan" + createNamespaceOptions.ResourcePlanID = &resourcePlanID + + if _, ok := d.GetOk(funcNamespaceDesc); ok { + description := d.Get(funcNamespaceDesc).(string) + createNamespaceOptions.Description = &description + } + + namespace, err := functionNamespaceAPI.Namespaces().CreateNamespace(createNamespaceOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Creating Namespace: %s", err) + } + + d.SetId(*namespace.ID) + log.Printf("[INFO] Created namespace (IAM) : %s", *namespace.Name) + + return resourceIBMFunctionNamespaceRead(d, meta) +} + +func resourceIBMFunctionNamespaceRead(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + id := d.Id() + + getOptions := functions.GetNamespaceOptions{ + ID: &id, + } + instance, err := functionNamespaceAPI.Namespaces().GetNamespace(getOptions) + if err != nil { + if strings.Contains(err.Error(), "404") { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting namesapce (IAM): %s", err) + } + + if instance.Name != nil { + d.Set(funcNamespaceName, *instance.Name) + } + + if instance.ResourceGroupID != nil { + d.Set(funcNamespaceResGrpId, *instance.ResourceGroupID) + } + + if instance.Location != nil { + d.Set(funcNamespaceLoc, *instance.Location) + } + if instance.Description != nil { + d.Set(funcNamespaceDesc, *instance.Description) + } + + return nil +} + +func resourceIBMFunctionNamespaceUpdate(d *schema.ResourceData, meta interface{}) error { + nsClient, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + ID := d.Id() + updateNamespaceOptions := functions.UpdateNamespaceOptions{} + if d.HasChange(funcNamespaceName) { + name := d.Get(funcNamespaceName).(string) + updateNamespaceOptions.Name = &name + } + + if d.HasChange(funcNamespaceDesc) { + description := d.Get(funcNamespaceDesc).(string) + updateNamespaceOptions.Description = &description + } + + updateNamespaceOptions.ID = &ID + namespace, err := nsClient.Namespaces().UpdateNamespace(updateNamespaceOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Updating Namespace: %s", err) + } + + log.Printf("[INFO] Updated namespace (IAM) : %s", *namespace.Name) + + return resourceIBMFunctionNamespaceRead(d, meta) +} + +func resourceIBMFunctionNamespaceDelete(d *schema.ResourceData, meta interface{}) error { + nsClient, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + ID := d.Id() + _, err = nsClient.Namespaces().DeleteNamespace(ID) + if err != nil { + return fmt.Errorf("[ERROR] Error Deleting Namespace: %s", err) + } + + d.SetId("") + return nil +} + +func resourceIBMFunctionNamespaceExists(d *schema.ResourceData, meta interface{}) (bool, error) { + nsClient, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return false, err + } + + ID := d.Id() + + getOptions := functions.GetNamespaceOptions{ + ID: &ID, + } + _, err = nsClient.Namespaces().GetNamespace(getOptions) + if err != nil { + if strings.Contains(err.Error(), "404") { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error getting existing namesapce (IAM): %s", err) + } + + return true, nil + +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_package.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_package.go new file mode 100644 index 0000000000..3332a96856 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_package.go @@ -0,0 +1,465 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package functions + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/apache/openwhisk-client-go/whisk" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + funcPkgNamespace = "namespace" + funcPkgName = "name" + funcPkgUsrDefAnnots = "user_defined_annotations" + funcPkgUsrDefParams = "user_defined_parameters" + funcPkgBindPkgName = "bind_package_name" +) + +func ResourceIBMFunctionPackage() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMFunctionPackageCreate, + Read: resourceIBMFunctionPackageRead, + Update: resourceIBMFunctionPackageUpdate, + Delete: resourceIBMFunctionPackageDelete, + Exists: resourceIBMFunctionPackageExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + funcPkgNamespace: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "IBM Cloud function namespace.", + ValidateFunc: validate.InvokeValidator("ibm_function_package", funcPkgNamespace), + }, + funcPkgName: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Name of package.", + ValidateFunc: validate.InvokeValidator("ibm_function_package", funcPkgName), + }, + "publish": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Package visibilty.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Semantic version of the item.", + }, + funcPkgUsrDefAnnots: { + Type: schema.TypeString, + Optional: true, + Description: "Annotation values in KEY VALUE format.", + Default: "[]", + ValidateFunc: validate.InvokeValidator("ibm_function_package", funcPkgUsrDefAnnots), + DiffSuppressFunc: flex.SuppressEquivalentJSON, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + funcPkgUsrDefParams: { + Type: schema.TypeString, + Optional: true, + Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the package.", + ValidateFunc: validate.InvokeValidator("ibm_function_package", funcPkgUsrDefParams), + Default: "[]", + DiffSuppressFunc: flex.SuppressEquivalentJSON, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + "annotations": { + Type: schema.TypeString, + Computed: true, + Description: "All annotations set on package by user and those set by the IBM Cloud Function backend/API.", + }, + "parameters": { + Type: schema.TypeString, + Computed: true, + Description: "All parameters set on package by user and those set by the IBM Cloud Function backend/API.", + }, + funcPkgBindPkgName: { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Name of package to be binded.", + ValidateFunc: validate.InvokeValidator("ibm_function_package", funcPkgBindPkgName), + DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { + if o == "" { + return false + } + if strings.Compare(n, o) == 0 { + return true + } + return false + }, + }, + "package_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func ResourceIBMFuncPackageValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcPkgName, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, + Regexp: `\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcPkgNamespace, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcPkgUsrDefAnnots, + ValidateFunctionIdentifier: validate.ValidateJSONString, + Type: validate.TypeString, + Default: "[]", + Optional: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcPkgBindPkgName, + ValidateFunctionIdentifier: validate.ValidateBindedPackageName, + Type: validate.TypeString, + Optional: true}) + + ibmFuncPackageResourceValidator := validate.ResourceValidator{ResourceName: "ibm_function_package", Schema: validateSchema} + return &ibmFuncPackageResourceValidator +} + +func resourceIBMFunctionPackageCreate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + namespace := d.Get("namespace").(string) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + packageService := wskClient.Packages + + name := d.Get("name").(string) + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(name); err != nil { + return NewQualifiedNameError(name, err) + } + + payload := whisk.Package{ + Name: qualifiedName.GetEntityName(), + Namespace: qualifiedName.GetNamespace(), + } + + userDefinedAnnotations := d.Get("user_defined_annotations").(string) + payload.Annotations, err = flex.ExpandAnnotations(userDefinedAnnotations) + if err != nil { + return err + } + + userDefinedParameters := d.Get("user_defined_parameters").(string) + payload.Parameters, err = flex.ExpandParameters(userDefinedParameters) + if err != nil { + return err + } + + if publish, ok := d.GetOk("publish"); ok { + p := publish.(bool) + payload.Publish = &p + } + + if v, ok := d.GetOk("bind_package_name"); ok { + var BindingQualifiedName = new(QualifiedName) + if BindingQualifiedName, err = NewQualifiedName(v.(string)); err != nil { + return NewQualifiedNameError(v.(string), err) + } + BindingPayload := whisk.Binding{ + Name: BindingQualifiedName.GetEntityName(), + Namespace: BindingQualifiedName.GetNamespace(), + } + payload.Binding = &BindingPayload + } + + log.Println("[INFO] Creating IBM CLoud Function package") + result, _, err := packageService.Insert(&payload, false) + if err != nil { + return fmt.Errorf("[ERROR] Error creating IBM CLoud Function package: %s", err) + } + + d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) + + return resourceIBMFunctionPackageRead(d, meta) +} + +func resourceIBMFunctionPackageRead(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := "" + packageID := "" + if len(parts) == 2 { + namespace = parts[0] + packageID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + packageID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, packageID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + packageService := wskClient.Packages + + pkg, _, err := packageService.Get(packageID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function package %s : %s", packageID, err) + } + d.Set("package_id", pkg.Name) + d.Set("name", pkg.Name) + d.Set("namespace", namespace) + d.Set("publish", pkg.Publish) + d.Set("version", pkg.Version) + annotations, err := flex.FlattenAnnotations(pkg.Annotations) + if err != nil { + return err + } + d.Set("annotations", annotations) + parameters, err := flex.FlattenParameters(pkg.Parameters) + if err != nil { + return err + } + d.Set("parameters", parameters) + if flex.IsEmpty(*pkg.Binding) { + + d.Set("user_defined_annotations", annotations) + d.Set("user_defined_parameters", parameters) + + } else { + d.Set("bind_package_name", fmt.Sprintf("/%s/%s", pkg.Binding.Namespace, pkg.Binding.Name)) + c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ + Namespace: pkg.Binding.Namespace, + AuthToken: wskClient.AuthToken, + Host: wskClient.Host, + AdditionalHeaders: wskClient.AdditionalHeaders, + }) + if err != nil { + return err + } + bindedPkg, _, err := c.Packages.Get(pkg.Binding.Name) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving Binded IBM Cloud Function package %s : %s", pkg.Binding.Name, err) + } + + userAnnotations, err := flex.FlattenAnnotations(flex.FilterInheritedAnnotations(bindedPkg.Annotations, pkg.Annotations)) + if err != nil { + return err + } + d.Set("user_defined_annotations", userAnnotations) + + userParameters, err := flex.FlattenParameters(flex.FilterInheritedParameters(bindedPkg.Parameters, pkg.Parameters)) + if err != nil { + return err + } + d.Set("user_defined_parameters", userParameters) + } + + return nil +} + +func resourceIBMFunctionPackageUpdate(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + packageService := wskClient.Packages + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(d.Get("name").(string)); err != nil { + return NewQualifiedNameError(d.Get("name").(string), err) + } + + payload := whisk.Package{ + Name: qualifiedName.GetEntityName(), + Namespace: qualifiedName.GetNamespace(), + } + ischanged := false + if d.HasChange("publish") { + p := d.Get("publish").(bool) + payload.Publish = &p + ischanged = true + } + + if d.HasChange("user_defined_parameters") { + var err error + payload.Parameters, err = flex.ExpandParameters(d.Get("user_defined_parameters").(string)) + if err != nil { + return err + } + ischanged = true + } + + if d.HasChange("user_defined_annotations") { + var err error + payload.Annotations, err = flex.ExpandAnnotations(d.Get("user_defined_annotations").(string)) + if err != nil { + return err + } + ischanged = true + } + + if ischanged { + log.Println("[INFO] Update IBM Cloud Function Package") + _, _, err = packageService.Insert(&payload, true) + if err != nil { + return fmt.Errorf("[ERROR] Error updating IBM Cloud Function Package: %s", err) + } + } + + return resourceIBMFunctionPackageRead(d, meta) +} + +func resourceIBMFunctionPackageDelete(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + packageID := parts[1] + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + packageService := wskClient.Packages + + _, err = packageService.Delete(packageID) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting IBM Cloud Function Package: %s", err) + } + + d.SetId("") + return nil +} + +func resourceIBMFunctionPackageExists(d *schema.ResourceData, meta interface{}) (bool, error) { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return false, err + } + + namespace := "" + packageID := "" + if len(parts) == 2 { + namespace = parts[0] + packageID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + packageID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, packageID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return false, err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return false, err + } + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return false, err + + } + + packageService := wskClient.Packages + + pkg, resp, err := packageService.Get(packageID) + if err != nil { + if resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error communicating with IBM Cloud Function Client : %s", err) + } + + return pkg.Name == packageID, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_rule.go new file mode 100644 index 0000000000..7f3748f738 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_rule.go @@ -0,0 +1,374 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package functions + +import ( + "fmt" + "log" + "os" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/apache/openwhisk-client-go/whisk" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + funcRuleNamespace = "namespace" + funcRuleName = "name" +) + +func ResourceIBMFunctionRule() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMFunctionRuleCreate, + Read: resourceIBMFunctionRuleRead, + Update: resourceIBMFunctionRuleUpdate, + Delete: resourceIBMFunctionRuleDelete, + Exists: resourceIBMFunctionRuleExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + funcRuleNamespace: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "IBM Cloud function namespace.", + ValidateFunc: validate.InvokeValidator("ibm_function_rule", funcRuleNamespace), + }, + funcRuleName: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Name of rule.", + ValidateFunc: validate.InvokeValidator("ibm_function_rule", funcRuleName), + }, + "trigger_name": { + Type: schema.TypeString, + Required: true, + Description: "Name of trigger.", + }, + "action_name": { + Type: schema.TypeString, + Required: true, + Description: "Name of action.", + DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { + new := strings.Split(n, "/") + old := strings.Split(o, "/") + action_name_new := new[len(new)-1] + action_name_old := old[len(old)-1] + + if o == "" { + return false + } + if strings.HasPrefix(n, "/_") { + temp := strings.Replace(n, "/_", "/"+d.Get("namespace").(string), 1) + if strings.Compare(temp, o) == 0 { + return true + } + if strings.Compare(action_name_old, action_name_new) == 0 { + return true + } + + } + if !strings.HasPrefix(n, "/") { + if strings.HasPrefix(o, "/"+d.Get("namespace").(string)) { + return true + } + if strings.Compare(action_name_old, action_name_new) == 0 { + return true + } + } + return false + }, + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Status of the rule.", + }, + "publish": { + Type: schema.TypeBool, + Computed: true, + Description: "Rule visbility.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Semantic version of the item.", + }, + "rule_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func ResourceIBMFuncRuleValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcRuleName, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, + Regexp: `\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcRuleNamespace, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString, + Required: true}) + + ibmFuncRuleResourceValidator := validate.ResourceValidator{ResourceName: "ibm_function_rule", Schema: validateSchema} + return &ibmFuncRuleResourceValidator +} + +func resourceIBMFunctionRuleCreate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + namespace := d.Get("namespace").(string) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + ruleService := wskClient.Rules + + name := d.Get("name").(string) + + var qualifiedName = new(QualifiedName) + if qualifiedName, err = NewQualifiedName(name); err != nil { + return NewQualifiedNameError(name, err) + } + trigger := d.Get("trigger_name").(string) + action := d.Get("action_name").(string) + + triggerName := getQualifiedName(trigger, wskClient.Config.Namespace) + actionName := getQualifiedName(action, wskClient.Config.Namespace) + payload := whisk.Rule{ + Name: qualifiedName.GetEntityName(), + Namespace: qualifiedName.GetNamespace(), + Trigger: triggerName, + Action: actionName, + } + log.Println("[INFO] Creating IBM Cloud Function rule") + result, _, err := ruleService.Insert(&payload, false) + if err != nil { + return fmt.Errorf("[ERROR] Error creating IBM Cloud Function rule: %s", err) + } + + d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) + + return resourceIBMFunctionRuleRead(d, meta) +} + +func resourceIBMFunctionRuleRead(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := "" + ruleID := "" + if len(parts) == 2 { + namespace = parts[0] + ruleID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + ruleID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, ruleID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + ruleService := wskClient.Rules + rule, _, err := ruleService.Get(ruleID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function rule %s : %s", ruleID, err) + } + + d.Set("rule_id", rule.Name) + d.Set("name", rule.Name) + d.Set("publish", rule.Publish) + d.Set("namespace", namespace) + d.Set("version", rule.Version) + d.Set("status", rule.Status) + + path := rule.Action.(map[string]interface{})["path"] + d.Set("trigger_name", rule.Trigger.(map[string]interface{})["name"]) + actionName := rule.Action.(map[string]interface{})["name"] + d.Set("action_name", fmt.Sprintf("/%s/%s", path, actionName)) + d.SetId(fmt.Sprintf("%s:%s", namespace, rule.Name)) + return nil +} + +func resourceIBMFunctionRuleUpdate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + ruleService := wskClient.Rules + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(d.Get("name").(string)); err != nil { + return NewQualifiedNameError(d.Get("name").(string), err) + } + + payload := whisk.Rule{ + Name: qualifiedName.GetEntityName(), + Namespace: qualifiedName.GetNamespace(), + } + ischanged := false + + if d.HasChange("trigger_name") { + trigger := d.Get("trigger_name").(string) + payload.Trigger = getQualifiedName(trigger, wskClient.Config.Namespace) + ischanged = true + } + + if d.HasChange("action_name") { + action := d.Get("action_name").(string) + payload.Action = getQualifiedName(action, wskClient.Config.Namespace) + ischanged = true + } + + if ischanged { + log.Println("[INFO] Update IBM Cloud Function Rule") + result, _, err := ruleService.Insert(&payload, true) + if err != nil { + return fmt.Errorf("[ERROR] Error updating IBM Cloud Function Rule: %s", err) + } + _, _, err = ruleService.SetState(result.Name, "active") + if err != nil { + return fmt.Errorf("[ERROR] Error updating IBM Cloud Function Rule: %s", err) + } + } + + return resourceIBMFunctionRuleRead(d, meta) +} + +func resourceIBMFunctionRuleDelete(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + ruleID := parts[1] + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + ruleService := wskClient.Rules + + _, err = ruleService.Delete(ruleID) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting IBM Cloud Function Rule: %s", err) + } + + d.SetId("") + return nil +} + +func resourceIBMFunctionRuleExists(d *schema.ResourceData, meta interface{}) (bool, error) { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return false, err + } + + namespace := "" + ruleID := "" + if len(parts) == 2 { + namespace = parts[0] + ruleID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + ruleID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, ruleID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return false, err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return false, err + } + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return false, err + + } + + ruleService := wskClient.Rules + + rule, resp, err := ruleService.Get(ruleID) + if err != nil { + if resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error communicating with IBM Cloud Function Client : %s", err) + } + return rule.Name == ruleID, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_trigger.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_trigger.go new file mode 100644 index 0000000000..ac3eabdf1e --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions/resource_ibm_function_trigger.go @@ -0,0 +1,565 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package functions + +import ( + "fmt" + "log" + "net/http" + "os" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/apache/openwhisk-client-go/whisk" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + funcTriggerNamespace = "namespace" + funcTriggerName = "name" + funcTriggerParams = "parameters" + funcTriggerUsrDefAnnots = "user_defined_annotations" + funcTriggerUsrDefParams = "user_defined_parameters" + + feedLifeCycleEvent = "lifecycleEvent" + feedTriggerName = "triggerName" + feedAuthKey = "authKey" + feedCreate = "CREATE" + feedDelete = "DELETE" +) + +func ResourceIBMFunctionTrigger() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMFunctionTriggerCreate, + Read: resourceIBMFunctionTriggerRead, + Update: resourceIBMFunctionTriggerUpdate, + Delete: resourceIBMFunctionTriggerDelete, + Exists: resourceIBMFunctionTriggerExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + funcTriggerNamespace: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "IBM Cloud function namespace.", + ValidateFunc: validate.InvokeValidator("ibm_function_trigger", funcTriggerNamespace), + }, + funcTriggerName: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Name of Trigger.", + ValidateFunc: validate.InvokeValidator("ibm_function_trigger", funcTriggerName), + }, + "feed": { + Type: schema.TypeList, + ForceNew: true, + Optional: true, + MaxItems: 1, + Description: "Trigger feed", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Trigger feed ACTION_NAME.", + }, + funcTriggerParams: { + Type: schema.TypeString, + Optional: true, + Default: "[]", + Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the action invoke.", + ValidateFunc: validate.InvokeValidator("ibm_function_trigger", funcTriggerParams), + DiffSuppressFunc: func(k, o, n string, d *schema.ResourceData) bool { + if o == "" && n == "" { + return false + } + if o == "[]" { + return true + } + return false + }, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + }, + }, + }, + "publish": { + Type: schema.TypeBool, + Computed: true, + Description: "Trigger visbility.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Semantic version of the item.", + }, + funcTriggerUsrDefAnnots: { + Type: schema.TypeString, + Optional: true, + Description: "Annotation values in KEY VALUE format.", + Default: "[]", + ValidateFunc: validate.InvokeValidator("ibm_function_trigger", funcTriggerUsrDefAnnots), + DiffSuppressFunc: flex.SuppressEquivalentJSON, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + funcTriggerUsrDefParams: { + Type: schema.TypeString, + Optional: true, + Default: "[]", + Description: "Parameters values in KEY VALUE format. Parameter bindings included in the context passed to the trigger.", + ValidateFunc: validate.InvokeValidator("ibm_function_trigger", funcTriggerUsrDefParams), + DiffSuppressFunc: flex.SuppressEquivalentJSON, + StateFunc: func(v interface{}) string { + json, _ := flex.NormalizeJSONString(v) + return json + }, + }, + "annotations": { + Type: schema.TypeString, + Computed: true, + Description: "All annotations set on trigger by user and those set by the IBM Cloud Function backend/API.", + }, + "parameters": { + Type: schema.TypeString, + Computed: true, + Description: "All parameters set on trigger by user and those set by the IBM Cloud Function backend/API.", + }, + "trigger_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func ResourceIBMFuncTriggerValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcTriggerName, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, + Regexp: `\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcTriggerNamespace, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString, + Required: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcTriggerUsrDefAnnots, + ValidateFunctionIdentifier: validate.ValidateJSONString, + Type: validate.TypeString, + Default: "[]", + Optional: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcTriggerUsrDefParams, + ValidateFunctionIdentifier: validate.ValidateJSONString, + Type: validate.TypeString, + Optional: true}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: funcTriggerParams, + ValidateFunctionIdentifier: validate.ValidateJSONString, + Type: validate.TypeString, + Default: "[]", + Optional: true}) + + ibmFuncTriggerResourceValidator := validate.ResourceValidator{ResourceName: "ibm_function_trigger", Schema: validateSchema} + return &ibmFuncTriggerResourceValidator +} + +func resourceIBMFunctionTriggerCreate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + namespace := d.Get("namespace").(string) + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + triggerService := wskClient.Triggers + feed := false + feedPayload := map[string]interface{}{} + name := d.Get("name").(string) + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(name); err != nil { + return NewQualifiedNameError(name, err) + } + + payload := whisk.Trigger{ + Name: qualifiedName.GetEntityName(), + Namespace: qualifiedName.GetNamespace(), + } + + userDefinedAnnotations := d.Get("user_defined_annotations").(string) + payload.Annotations, err = flex.ExpandAnnotations(userDefinedAnnotations) + if err != nil { + return err + } + + userDefinedParameters := d.Get("user_defined_parameters").(string) + payload.Parameters, err = flex.ExpandParameters(userDefinedParameters) + if err != nil { + return err + } + + if v, ok := d.GetOk("feed"); ok { + feed = true + value := v.([]interface{})[0].(map[string]interface{}) + feedPaylod := whisk.KeyValue{ + Key: "feed", + Value: value["name"], + } + feedArray := make([]whisk.KeyValue, 0, 1) + feedArray = append(feedArray, feedPaylod) + payload.Annotations = payload.Annotations.AppendKeyValueArr(feedArray) + } + + log.Println("[INFO] Creating IBM Cloud Function trigger") + result, _, err := triggerService.Insert(&payload, false) + if err != nil { + return fmt.Errorf("[ERROR] Error creating IBM Cloud Function trigger: %s", err) + } + + d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) + + if feed { + feed := d.Get("feed").([]interface{})[0].(map[string]interface{}) + actionName := feed["name"].(string) + parameters := feed["parameters"].(string) + var err error + feedParameters, err := flex.ExpandParameters(parameters) + if err != nil { + return err + } + for _, value := range feedParameters { + feedPayload[value.Key] = value.Value + } + var feedQualifiedName = new(QualifiedName) + + if feedQualifiedName, err = NewQualifiedName(actionName); err != nil { + _, _, delerr := triggerService.Delete(name) + if delerr != nil { + return fmt.Errorf("[ERROR] Error creating IBM Cloud Function trigger with feed: %s", err) + } + return NewQualifiedNameError(actionName, err) + } + + feedPayload[feedLifeCycleEvent] = feedCreate + feedPayload[feedAuthKey] = wskClient.Config.AuthToken + feedPayload[feedTriggerName] = fmt.Sprintf("/%s/%s", qualifiedName.GetNamespace(), name) + + c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ + AuthToken: wskClient.AuthToken, + Host: wskClient.Host, + AdditionalHeaders: wskClient.AdditionalHeaders, + }) + if err != nil { + return err + } + if feedQualifiedName.GetNamespace() != namespace { + c.Config.Namespace = feedQualifiedName.GetNamespace() + } + actionService := c.Actions + _, _, err = actionService.Invoke(feedQualifiedName.GetEntityName(), feedPayload, true, true) + if err != nil { + _, _, delerr := triggerService.Delete(name) + if delerr != nil { + return fmt.Errorf("[ERROR] Error creating IBM Cloud Function trigger with feed: %s", err) + } + d.SetId("") + return fmt.Errorf("[ERROR] Error creating IBM Cloud Function trigger with feed: %s", err) + } + } + + d.SetId(fmt.Sprintf("%s:%s", namespace, result.Name)) + + return resourceIBMFunctionTriggerRead(d, meta) +} + +func resourceIBMFunctionTriggerRead(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := "" + triggerID := "" + if len(parts) == 2 { + namespace = parts[0] + triggerID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + triggerID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, triggerID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + triggerService := wskClient.Triggers + + trigger, _, err := triggerService.Get(triggerID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function Trigger %s : %s", triggerID, err) + } + d.Set("trigger_id", trigger.Name) + d.Set("namespace", namespace) + d.Set("name", trigger.Name) + d.Set("publish", trigger.Publish) + d.Set("version", trigger.Version) + annotations, err := flex.FlattenAnnotations(trigger.Annotations) + if err != nil { + return err + } + d.Set("annotations", annotations) + parameters, err := flex.FlattenParameters(trigger.Parameters) + if err != nil { + return err + } + d.Set("parameters", parameters) + d.Set("user_defined_parameters", parameters) + + userDefinedAnnotations, err := flex.FilterTriggerAnnotations(trigger.Annotations) + if err != nil { + return err + } + d.Set("user_defined_annotations", userDefinedAnnotations) + + found := trigger.Annotations.FindKeyValue("feed") + + if found >= 0 { + d.Set("feed", flex.FlattenFeed(trigger.Annotations.GetValue("feed").(string))) + } + + return nil +} + +func resourceIBMFunctionTriggerUpdate(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + + namespace := parts[0] + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + triggerService := wskClient.Triggers + + name := d.Get("name").(string) + + var qualifiedName = new(QualifiedName) + + if qualifiedName, err = NewQualifiedName(name); err != nil { + return NewQualifiedNameError(name, err) + } + + payload := whisk.Trigger{ + Name: qualifiedName.GetEntityName(), + Namespace: qualifiedName.GetNamespace(), + } + ischanged := false + + if d.HasChange("user_defined_parameters") { + var err error + payload.Parameters, err = flex.ExpandParameters(d.Get("user_defined_parameters").(string)) + if err != nil { + return err + } + ischanged = true + } + + if d.HasChange("user_defined_annotations") { + var err error + payload.Annotations, err = flex.ExpandAnnotations(d.Get("user_defined_annotations").(string)) + if err != nil { + return err + } + ischanged = true + } + + if ischanged { + log.Println("[INFO] Update IBM Cloud Function Trigger") + + _, _, err = triggerService.Insert(&payload, true) + if err != nil { + return fmt.Errorf("[ERROR] Error updating IBM Cloud Function Trigger: %s", err) + } + } + + return resourceIBMFunctionTriggerRead(d, meta) +} + +func resourceIBMFunctionTriggerDelete(d *schema.ResourceData, meta interface{}) error { + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return err + } + namespace := parts[0] + triggerID := parts[1] + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return err + + } + + triggerService := wskClient.Triggers + var qualifiedName = new(QualifiedName) + fmt.Println(qualifiedName) + if qualifiedName, err = NewQualifiedName(triggerID); err != nil { + return NewQualifiedNameError(triggerID, err) + } + trigger, _, err := triggerService.Get(triggerID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving IBM Cloud Function Trigger %s : %s", triggerID, err) + } + found := trigger.Annotations.FindKeyValue("feed") + if found >= 0 { + actionName := trigger.Annotations.GetValue("feed").(string) + var feedQualifiedName = new(QualifiedName) + + if feedQualifiedName, err = NewQualifiedName(actionName); err != nil { + return NewQualifiedNameError(actionName, err) + } + + feedPayload := map[string]interface{}{ + feedLifeCycleEvent: feedDelete, + feedAuthKey: wskClient.Config.AuthToken, + feedTriggerName: fmt.Sprintf("/%s/%s", qualifiedName.GetNamespace(), triggerID), + } + + c, err := whisk.NewClient(http.DefaultClient, &whisk.Config{ + AuthToken: wskClient.AuthToken, + Host: wskClient.Host, + AdditionalHeaders: wskClient.AdditionalHeaders, + }) + if err != nil { + return err + } + if feedQualifiedName.GetNamespace() != namespace { + c.Config.Namespace = feedQualifiedName.GetNamespace() + } + + actionService := c.Actions + _, _, err = actionService.Invoke(feedQualifiedName.GetEntityName(), feedPayload, true, true) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting IBM Cloud Function trigger with feed: %s", err) + + } + } + + _, _, err = triggerService.Delete(triggerID) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting IBM Cloud Function Trigger: %s", err) + } + + d.SetId("") + return nil +} + +func resourceIBMFunctionTriggerExists(d *schema.ResourceData, meta interface{}) (bool, error) { + parts, err := flex.CfIdParts(d.Id()) + if err != nil { + return false, err + } + + namespace := "" + triggerID := "" + if len(parts) == 2 { + namespace = parts[0] + triggerID = parts[1] + } else { + namespace = os.Getenv("FUNCTION_NAMESPACE") + triggerID = parts[0] + d.SetId(fmt.Sprintf("%s:%s", namespace, triggerID)) + } + + functionNamespaceAPI, err := meta.(conns.ClientSession).FunctionIAMNamespaceAPI() + if err != nil { + return false, err + } + + bxSession, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return false, err + } + + wskClient, err := conns.SetupOpenWhiskClientConfig(namespace, bxSession, functionNamespaceAPI) + if err != nil { + return false, err + + } + + triggerService := wskClient.Triggers + trigger, resp, err := triggerService.Get(triggerID) + if err != nil { + if resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error communicating with IBM Cloud Function Client : %s", err) + } + return trigger.Name == triggerID, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/README.md new file mode 100644 index 0000000000..0370bf405c --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Global Tagging + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Global tagging resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_tag) +* IBM API Docs: [IBM API Docs for Global tagging](https://cloud.ibm.com/apidocs/tagging) +* IBM Global tagging SDK: [IBM SDK for Global tagging](https://github.com/IBM/platform-services-go-sdk/tree/main/globaltaggingv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/data_source_ibm_resource_tag.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/data_source_ibm_resource_tag.go new file mode 100644 index 0000000000..65ca52fb17 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/data_source_ibm_resource_tag.go @@ -0,0 +1,74 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package globaltagging + +import ( + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMResourceTag() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMResourceTagRead, + + Schema: map[string]*schema.Schema{ + "resource_id": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_resource_tag", resourceID), + Description: "CRN of the resource on which the tags should be attached", + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_resource_tag", tags)}, + Set: flex.ResourceIBMVPCHash, + Description: "List of tags associated with resource instance", + }, + "resource_type": { + Type: schema.TypeString, + Optional: true, + Description: "Resource type on which the tags should be fetched", + }, + "tag_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_resource_tag", "tag_type"), + Description: "Tag type on which the tags should be fetched", + Default: "user", + }, + }, + } +} + +func dataSourceIBMResourceTagRead(d *schema.ResourceData, meta interface{}) error { + var rID, rType string + + if r, ok := d.GetOk("resource_id"); ok && r != nil { + rID = r.(string) + } + if v, ok := d.GetOk(resourceType); ok && v != nil { + rType = v.(string) + } + tType := "" + if t, ok := d.GetOk("tag_type"); ok && t != nil { + tType = t.(string) + } + + tags, err := flex.GetGlobalTagsUsingCRN(meta, rID, rType, tType) + if err != nil { + return fmt.Errorf("[ERROR] Error on get of resource tags (%s) tags: %s", d.Id(), err) + } + + d.SetId(time.Now().UTC().String()) + d.Set("resource_id", rID) + d.Set("resource_type", rType) + d.Set("tags", tags) + d.Set("tag_type", tType) + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/resource_ibm_resource_tag.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/resource_ibm_resource_tag.go new file mode 100644 index 0000000000..2643e1d19d --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging/resource_ibm_resource_tag.go @@ -0,0 +1,330 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package globaltagging + +import ( + "context" + "fmt" + "os" + "regexp" + "strings" + + "github.com/IBM/platform-services-go-sdk/globaltaggingv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" +) + +const ( + resourceID = "resource_id" + tags = "tags" + resourceType = "resource_type" + tagType = "tag_type" + acccountID = "acccount_id" + service = "service" + crnRegex = "^crn:v1(:[a-zA-Z0-9 \\-\\._~\\*\\+,;=!$&'\\(\\)\\/\\?#\\[\\]@]*){8}$|^[0-9]+$" +) + +func ResourceIBMResourceTag() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMResourceTagCreate, + Read: resourceIBMResourceTagRead, + Update: resourceIBMResourceTagUpdate, + Delete: resourceIBMResourceTagDelete, + Importer: &schema.ResourceImporter{}, + + CustomizeDiff: customdiff.Sequence( + func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { + return flex.ResourceTagsCustomizeDiff(diff) + }, + ), + + Schema: map[string]*schema.Schema{ + resourceID: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_resource_tag", resourceID), + Description: "CRN of the resource on which the tags should be attached", + }, + tags: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_resource_tag", tags)}, + Set: flex.ResourceIBMVPCHash, + Description: "List of tags associated with resource instance", + }, + resourceType: { + Type: schema.TypeString, + Optional: true, + Description: "Resource type on which the tags should be attached", + }, + tagType: { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validate.InvokeValidator("ibm_resource_tag", "tag_type"), + Description: "Type of the tag. Only allowed values are: user, or service or access (default value : user)", + }, + acccountID: { + Type: schema.TypeString, + Computed: true, + Description: "The ID of the account that owns the resources to be tagged (required if tag-type is set to service)", + }, + }, + } +} + +func ResourceIBMResourceTagValidator() *validate.ResourceValidator { + tagTypeAllowedValues := "service,access,user" + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: resourceID, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^crn:v1(:[a-zA-Z0-9 \-\._~\*\+,;=!$&'\(\)\/\?#\[\]@]*){8}$|^[0-9]+$`, + MinValueLength: 1, + MaxValueLength: 128}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: tags, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^[A-Za-z0-9:_ .-]+$`, + MinValueLength: 1, + MaxValueLength: 128}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "tag_type", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: tagTypeAllowedValues}) + + ibmResourceTagValidator := validate.ResourceValidator{ResourceName: "ibm_resource_tag", Schema: validateSchema} + return &ibmResourceTagValidator +} + +func resourceIBMResourceTagCreate(d *schema.ResourceData, meta interface{}) error { + var rType, tType string + resources := []globaltaggingv1.Resource{} + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + accountID := userDetails.UserAccount + + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPIv1() + if err != nil { + return fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) + } + + resourceID := d.Get(resourceID).(string) + if v, ok := d.GetOk(resourceType); ok && v != nil { + rType = v.(string) + } + + r := globaltaggingv1.Resource{ResourceID: flex.PtrToString(resourceID), ResourceType: flex.PtrToString(rType)} + resources = append(resources, r) + + var add []string + if v, ok := d.GetOk(tags); ok { + tags := v.(*schema.Set) + for _, t := range tags.List() { + add = append(add, fmt.Sprint(t)) + } + } + + schematicTags := os.Getenv("IC_ENV_TAGS") + var envTags []string + if schematicTags != "" { + envTags = strings.Split(schematicTags, ",") + add = append(add, envTags...) + } + + AttachTagOptions := &globaltaggingv1.AttachTagOptions{} + AttachTagOptions.Resources = resources + AttachTagOptions.TagNames = add + if v, ok := d.GetOk(tagType); ok && v != nil { + tType = v.(string) + AttachTagOptions.TagType = flex.PtrToString(tType) + + if tType == service { + AttachTagOptions.AccountID = flex.PtrToString(accountID) + } + } + + if len(add) > 0 { + _, resp, err := gtClient.AttachTag(AttachTagOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error attaching resource tags : %v\n%s", resp, err) + } + } + + crn, err := regexp.Compile(crnRegex) + if err != nil { + return err + } + + if crn.MatchString(resourceID) { + d.SetId(resourceID) + } else { + d.SetId(fmt.Sprintf("%s/%s", resourceID, resourceType)) + } + + return resourceIBMResourceTagRead(d, meta) +} + +func resourceIBMResourceTagRead(d *schema.ResourceData, meta interface{}) error { + var rID, rType, tType string + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + acctID := userDetails.UserAccount + + crn, err := regexp.Compile(crnRegex) + if err != nil { + return err + } + + if crn.MatchString(d.Id()) { + rID = d.Id() + } else { + parts, err := flex.VmIdParts(d.Id()) + if err != nil { + return err + } + if len(parts) < 2 { + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of resourceID/resourceType", d.Id()) + } + rID = parts[0] + rType = parts[1] + } + + if v, ok := d.GetOk(tagType); ok && v != nil { + tType = v.(string) + + if tType == service { + d.Set(acccountID, acctID) + } + } + + tagList, err := flex.GetGlobalTagsUsingCRN(meta, rID, resourceType, tType) + if err != nil { + if apierr, ok := err.(bmxerror.RequestFailure); ok && apierr.StatusCode() == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting resource tags for: %s with error : %s", rID, err) + } + + d.Set(resourceID, rID) + d.Set(resourceType, rType) + d.Set(tags, tagList) + + return nil +} + +func resourceIBMResourceTagUpdate(d *schema.ResourceData, meta interface{}) error { + var rID, rType, tType string + + crn, err := regexp.Compile(crnRegex) + if err != nil { + return err + } + + if crn.MatchString(d.Id()) { + rID = d.Id() + } else { + parts, err := flex.VmIdParts(d.Id()) + if err != nil { + return err + } + rID = parts[0] + rType = parts[1] + } + + if v, ok := d.GetOk(tagType); ok && v != nil { + tType = v.(string) + } + + if _, ok := d.GetOk(tags); ok { + oldList, newList := d.GetChange(tags) + err := flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, rID, rType, tType) + if err != nil { + return fmt.Errorf("[ERROR] Error on create of resource tags: %s", err) + } + } + + return resourceIBMResourceTagRead(d, meta) +} + +func resourceIBMResourceTagDelete(d *schema.ResourceData, meta interface{}) error { + var rID, rType string + + crn, err := regexp.Compile(crnRegex) + if err != nil { + return err + } + + if crn.MatchString(d.Id()) { + rID = d.Id() + } else { + parts, err := flex.VmIdParts(d.Id()) + if err != nil { + return err + } + rID = parts[0] + rType = parts[1] + } + + gtClient, err := meta.(conns.ClientSession).GlobalTaggingAPIv1() + if err != nil { + return fmt.Errorf("[ERROR] Error getting global tagging client settings: %s", err) + } + + var remove []string + removeTags := d.Get(tags).(*schema.Set) + remove = make([]string, len(removeTags.List())) + for i, v := range removeTags.List() { + remove[i] = fmt.Sprint(v) + } + + if len(remove) > 0 { + resources := []globaltaggingv1.Resource{} + r := globaltaggingv1.Resource{ResourceID: flex.PtrToString(rID), ResourceType: flex.PtrToString(rType)} + resources = append(resources, r) + + detachTagOptions := &globaltaggingv1.DetachTagOptions{ + Resources: resources, + TagNames: remove, + } + + _, resp, err := gtClient.DetachTag(detachTagOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error detaching resource tags %v: %s\n%s", remove, err, resp) + } + for _, v := range remove { + delTagOptions := &globaltaggingv1.DeleteTagOptions{ + TagName: flex.PtrToString(v), + } + _, resp, err := gtClient.DeleteTag(delTagOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting resource tag %v: %s\n%s", v, err, resp) + } + } + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/README.md new file mode 100644 index 0000000000..2d89ec9951 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/README.md @@ -0,0 +1,10 @@ +# Terraform IBM Provider HPCS + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the HPCS resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/hpcs) +* IBM HPCS TKE SDK: [IBM SDK for HPCS TKE](https://github.com/IBM/ibm-hpcs-tke-sdk) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_hpcs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/data_source_ibm_hpcs.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_hpcs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/data_source_ibm_hpcs.go index bb8b5930b0..db08f58a22 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_hpcs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/data_source_ibm_hpcs.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package hpcs import ( "context" @@ -15,9 +15,11 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func dataSourceIBMHPCS() *schema.Resource { +func DataSourceIBMHPCS() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMHPCSRead, @@ -157,7 +159,7 @@ func dataSourceIBMHPCS() *schema.Resource { } func dataSourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - rsConClient, err := meta.(ClientSession).ResourceControllerAPIV2() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerAPIV2() if err != nil { return diag.FromErr(err) } @@ -171,14 +173,14 @@ func dataSourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta if rsGrpID, ok := d.GetOk("resource_group_id"); ok { rsInstQuery.ResourceGroupID = rsGrpID.(string) } else { - defaultRg, err := defaultResourceGroup(meta) + defaultRg, err := flex.DefaultResourceGroup(meta) if err != nil { return diag.FromErr(err) } rsInstQuery.ResourceGroupID = defaultRg } - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return diag.FromErr(err) } @@ -206,7 +208,7 @@ func dataSourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta if loc, ok := d.GetOk("location"); ok { location = loc.(string) for _, instance := range instances { - if getLocation(instance) == location { + if flex.GetLocation(instance) == location { filteredInstances = append(filteredInstances, instance) } } @@ -240,10 +242,10 @@ func dataSourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta if len(instance.Extensions) == 0 { d.Set("extensions", instance.Extensions) } else { - d.Set("extensions", Flatten(instance.Extensions)) + d.Set("extensions", flex.Flatten(instance.Extensions)) } if instance.Parameters != nil { - instanceParameters := Flatten(instance.Parameters) + instanceParameters := flex.Flatten(instance.Parameters) if endpoint, ok := instanceParameters["allowed_network"]; ok { if endpoint != "private-only" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_hpcs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/resource_ibm_hpcs.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_hpcs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/resource_ibm_hpcs.go index 2967bf024c..2f51b65382 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_hpcs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs/resource_ibm_hpcs.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package hpcs import ( "bytes" @@ -22,10 +22,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM-Cloud/bluemix-go/models" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func resourceIBMHPCS() *schema.Resource { +func ResourceIBMHPCS() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMHPCSCreate, ReadContext: resourceIBMHPCSRead, @@ -41,10 +44,10 @@ func resourceIBMHPCS() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return immutableResourceCustomizeDiff([]string{"units", "failover_units", "location", "resource_group_id", "service"}, diff) + return flex.ImmutableResourceCustomizeDiff([]string{"units", "failover_units", "location", "resource_group_id", "service"}, diff) }, func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -91,14 +94,14 @@ func resourceIBMHPCS() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"public-and-private", "private-only"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public-and-private", "private-only"}), }, "tags": { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_hpcs", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_hpcs", "tag")}, + Set: flex.ResourceIBMVPCHash, }, "status": { Type: schema.TypeString, @@ -311,24 +314,24 @@ type HPCSParams struct { ServiceEndpoints string `json:"allowed_network,omitempty"` } -func resourceIBMHPCSValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMHPCSValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmResourceInstanceResourceValidator := ResourceValidator{ResourceName: "ibm_hpcs", Schema: validateSchema} + ibmResourceInstanceResourceValidator := validate.ResourceValidator{ResourceName: "ibm_hpcs", Schema: validateSchema} return &ibmResourceInstanceResourceValidator } func resourceIBMHPCSCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -342,7 +345,7 @@ func resourceIBMHPCSCreate(context context.Context, d *schema.ResourceData, meta Name: &name, } // Fetch Service Plan ID using Global Catalog APIs - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return diag.FromErr(err) } @@ -375,7 +378,7 @@ func resourceIBMHPCSCreate(context context.Context, d *schema.ResourceData, meta if len(deployments) == 0 { return diag.FromErr(fmt.Errorf("[ERROR] No deployment found for service plan : %s", plan)) } - deployments, supportedLocations := filterDeployments(deployments, location) + deployments, supportedLocations := resourcecontroller.FilterDeployments(deployments, location) if len(deployments) == 0 { locationList := make([]string, 0, len(supportedLocations)) for l := range supportedLocations { @@ -390,7 +393,7 @@ func resourceIBMHPCSCreate(context context.Context, d *schema.ResourceData, meta rg := rsGrpID.(string) rsInst.ResourceGroup = &rg } else { - defaultRg, err := defaultResourceGroup(meta) + defaultRg, err := flex.DefaultResourceGroup(meta) if err != nil { return diag.FromErr(err) } @@ -430,7 +433,7 @@ func resourceIBMHPCSCreate(context context.Context, d *schema.ResourceData, meta v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk("tags"); ok || v != "" { oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "[ERROR] Error on create of HPCS instance (%s) tags: %s", d.Id(), err) @@ -440,7 +443,7 @@ func resourceIBMHPCSCreate(context context.Context, d *schema.ResourceData, meta return resourceIBMHPCSUpdate(context, d, meta) } func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -457,7 +460,7 @@ func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta i } return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving HPCS instance: %s with resp code: %s", err, resp)) } - if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, rsInstanceReclamation)) { + if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, resourcecontroller.RsInstanceReclamation)) { log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") d.SetId("") return nil @@ -475,7 +478,7 @@ func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta i d.Set("state", instance.State) d.Set("service", strings.Split(instanceID, ":")[4]) //Set tags - tags, err := GetTagsUsingCRN(meta, *instance.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *instance.CRN) if err != nil { log.Printf( "[ERROR] Error on get of HPCS instance tags (%s) tags: %s", d.Id(), err) @@ -489,7 +492,7 @@ func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta i } } // Set Service Plan - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return diag.FromErr(err) } @@ -502,7 +505,7 @@ func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta i d.Set("plan", servicePlan) // Set Instance parameters if instance.Parameters != nil { - instanceParameters := Flatten(instance.Parameters) + instanceParameters := flex.Flatten(instance.Parameters) if endpoint, ok := instanceParameters["allowed_network"]; ok { if endpoint != "private-only" { @@ -531,7 +534,7 @@ func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta i if len(instance.Extensions) == 0 { d.Set("extensions", instance.Extensions) } else { - d.Set("extensions", Flatten(instance.Extensions)) + d.Set("extensions", flex.Flatten(instance.Extensions)) } d.Set("restored_by", instance.RestoredBy) d.Set("scheduled_reclaim_by", instance.ScheduledReclaimBy) @@ -576,7 +579,7 @@ func resourceIBMHPCSRead(context context.Context, d *schema.ResourceData, meta i } func resourceIBMHPCSUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -594,7 +597,7 @@ func resourceIBMHPCSUpdate(context context.Context, d *schema.ResourceData, meta if d.HasChange("plan") { plan := d.Get("plan").(string) service := d.Get("service").(string) - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { return diag.FromErr(err) } @@ -615,7 +618,7 @@ func resourceIBMHPCSUpdate(context context.Context, d *schema.ResourceData, meta } if d.HasChange("service_endpoints") { - params := Params{} + params := HPCSParams{} params.ServiceEndpoints = d.Get("service_endpoints").(string) parameters, _ := json.Marshal(params) var raw map[string]interface{} @@ -631,8 +634,8 @@ func resourceIBMHPCSUpdate(context context.Context, d *schema.ResourceData, meta return diag.FromErr(fmt.Errorf("[ERROR] Error Getting HPCS instance: %s with resp code: %s", err, resp)) } if d.HasChange("tags") { - oldList, newList := d.GetChange(isVPCTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + oldList, newList := d.GetChange("tags") + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "[ERROR] Error on update of HPCS instance (%s) tags: %s", d.Id(), err) @@ -712,7 +715,7 @@ func expandHSMConfig(d *schema.ResourceData, meta interface{}) tkesdk.HsmConfig return hsmConfig } func resourceIBMHPCSDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -765,7 +768,7 @@ func resourceIBMHPCSDelete(context context.Context, d *schema.ResourceData, meta return nil } func waitForHPCSInstanceCreate(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -775,8 +778,8 @@ func waitForHPCSInstanceCreate(d *schema.ResourceData, meta interface{}) (interf } stateConf := &resource.StateChangeConf{ - Pending: []string{rsInstanceProgressStatus, rsInstanceInactiveStatus, rsInstanceProvisioningStatus}, - Target: []string{rsInstanceSuccessStatus}, + Pending: []string{resourcecontroller.RsInstanceProgressStatus, resourcecontroller.RsInstanceInactiveStatus, resourcecontroller.RsInstanceProvisioningStatus}, + Target: []string{resourcecontroller.RsInstanceSuccessStatus}, Refresh: func() (interface{}, string, error) { instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) if err != nil { @@ -785,7 +788,7 @@ func waitForHPCSInstanceCreate(d *schema.ResourceData, meta interface{}) (interf } return nil, "", fmt.Errorf("[ERROR] Get on HPCS instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) } - if *instance.State == rsInstanceFailStatus { + if *instance.State == resourcecontroller.RsInstanceFailStatus { return instance, *instance.State, fmt.Errorf("[ERROR] The status of HPCS instance %s failed: %v", d.Id(), err) } return instance, *instance.State, nil @@ -799,7 +802,7 @@ func waitForHPCSInstanceCreate(d *schema.ResourceData, meta interface{}) (interf } func waitForHPCSInstanceUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -809,8 +812,8 @@ func waitForHPCSInstanceUpdate(d *schema.ResourceData, meta interface{}) (interf } stateConf := &resource.StateChangeConf{ - Pending: []string{rsInstanceProgressStatus, rsInstanceInactiveStatus}, - Target: []string{rsInstanceSuccessStatus}, + Pending: []string{resourcecontroller.RsInstanceProgressStatus, resourcecontroller.RsInstanceInactiveStatus}, + Target: []string{resourcecontroller.RsInstanceSuccessStatus}, Refresh: func() (interface{}, string, error) { instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) if err != nil { @@ -819,7 +822,7 @@ func waitForHPCSInstanceUpdate(d *schema.ResourceData, meta interface{}) (interf } return nil, "", fmt.Errorf("[ERROR] Get the HPCS instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) } - if *instance.State == rsInstanceFailStatus { + if *instance.State == resourcecontroller.RsInstanceFailStatus { return instance, *instance.State, fmt.Errorf("[ERROR] The status of HPCS instance %s failed: %v", d.Id(), err) } return instance, *instance.State, nil @@ -833,7 +836,7 @@ func waitForHPCSInstanceUpdate(d *schema.ResourceData, meta interface{}) (interf } func waitForHPCSInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -842,17 +845,17 @@ func waitForHPCSInstanceDelete(d *schema.ResourceData, meta interface{}) (interf ID: &instanceID, } stateConf := &resource.StateChangeConf{ - Pending: []string{rsInstanceProgressStatus, rsInstanceInactiveStatus, rsInstanceSuccessStatus}, - Target: []string{rsInstanceRemovedStatus, rsInstanceReclamation}, + Pending: []string{resourcecontroller.RsInstanceProgressStatus, resourcecontroller.RsInstanceInactiveStatus, resourcecontroller.RsInstanceSuccessStatus}, + Target: []string{resourcecontroller.RsInstanceRemovedStatus, resourcecontroller.RsInstanceReclamation}, Refresh: func() (interface{}, string, error) { instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) if err != nil { if resp != nil && resp.StatusCode == 404 { - return instance, rsInstanceSuccessStatus, nil + return instance, resourcecontroller.RsInstanceSuccessStatus, nil } return nil, "", fmt.Errorf("[ERROR] Get on HPCS instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) } - if *instance.State == rsInstanceFailStatus { + if *instance.State == resourcecontroller.RsInstanceFailStatus { return instance, *instance.State, fmt.Errorf("[ERROR] HPCS instance %s failed to delete: %v", d.Id(), err) } return instance, *instance.State, nil @@ -871,7 +874,7 @@ func resourceIBMHPCSAdminHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", a["key"].(string))) buf.WriteString(fmt.Sprintf("%s-", a["token"].(string))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } func validateHSM(hsmInfo []tkesdk.HsmInfo) bool { update := false @@ -888,11 +891,11 @@ func validateHSM(hsmInfo []tkesdk.HsmInfo) bool { func hsmClient(d *schema.ResourceData, meta interface{}) (tkesdk.CommonInputs, error) { ci := tkesdk.CommonInputs{} // Bluemix Session to get Oauth tokens - bluemixSession, err := meta.(ClientSession).BluemixSession() + bluemixSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return ci, err } - err = refreshToken(bluemixSession) + err = conns.RefreshToken(bluemixSession) if err != nil { return ci, fmt.Errorf("[ERROR] Error Refreshing Authentication Token: %s", err) } @@ -901,9 +904,9 @@ func hsmClient(d *schema.ResourceData, meta interface{}) (tkesdk.CommonInputs, e serviceEndpoint = e.(string) } ci.Region = d.Get("location").(string) - ci.ApiEndpoint = envFallBack([]string{"IBMCLOUD_HPCS_TKE_ENDPOINT"}, "cloud.ibm.com") + ci.ApiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_HPCS_TKE_ENDPOINT"}, "cloud.ibm.com") if bluemixSession.Config.Visibility == "private" || bluemixSession.Config.Visibility == "public-and-private" || serviceEndpoint == "private-only" { - ci.ApiEndpoint = envFallBack([]string{"IBMCLOUD_HPCS_TKE_ENDPOINT"}, "private.cloud.ibm.com") + ci.ApiEndpoint = conns.EnvFallBack([]string{"IBMCLOUD_HPCS_TKE_ENDPOINT"}, "private.cloud.ibm.com") } ci.AuthToken = bluemixSession.Config.IAMAccessToken diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/README.md new file mode 100644 index 0000000000..febb8aacf4 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider IAM Access Group + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the IAM Access Group resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_access_group) +* IBM API Docs: [IBM API Docs for IAM Access Group](https://cloud.ibm.com/apidocs/iam-access-groups) +* IBM IAM Access Group SDK: [IBM SDK for IAM Access Group](https://github.com/IBM/platform-services-go-sdk/tree/main/iamaccessgroupsv2) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_access_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/data_source_ibm_iam_access_group.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_access_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/data_source_ibm_iam_access_group.go index 30d738186c..77fc740281 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_access_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/data_source_ibm_iam_access_group.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamaccessgroup import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMIAMAccessGroup() *schema.Resource { +func DataSourceIBMIAMAccessGroup() *schema.Resource { return &schema.Resource{ Read: dataIBMIAMAccessGroupRead, Schema: map[string]*schema.Schema{ @@ -50,6 +52,11 @@ func dataSourceIBMIAMAccessGroup() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "iam_profile_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, "rules": { Type: schema.TypeList, Computed: true, @@ -106,18 +113,18 @@ func dataSourceIBMIAMAccessGroup() *schema.Resource { } func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - accountID := userDetails.userAccount - userManagement, err := meta.(ClientSession).UserManagementAPI() + accountID := userDetails.UserAccount + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -127,7 +134,7 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error { return err } - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -137,7 +144,7 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error { var pg int64 = 100 for { listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{ - AccountID: &userDetails.userAccount, + AccountID: &userDetails.UserAccount, Pagesize: &pg, } if start != "" { @@ -148,13 +155,36 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error { if err != nil { return fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp) } - start = GetNextIAM(serviceIDs.Next) + start = flex.GetNextIAM(serviceIDs.Next) allrecs = append(allrecs, serviceIDs.Serviceids...) if start == "" { break } } + profileStart := "" + allprofiles := []iamidentityv1.TrustedProfile{} + var plimit int64 = 100 + for { + listProfilesOptions := iamidentityv1.ListProfilesOptions{ + AccountID: &userDetails.UserAccount, + Pagesize: &plimit, + } + if profileStart != "" { + listProfilesOptions.Pagetoken = &profileStart + } + + profileIDs, resp, err := iamClient.ListProfiles(&listProfilesOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error listing Trusted Profiles %s %s", err, resp) + } + profileStart = flex.GetNextIAM(profileIDs.Next) + allprofiles = append(allprofiles, profileIDs.Profiles...) + if profileStart == "" { + break + } + } + listAccessGroupOption := iamAccessGroupsClient.NewListAccessGroupsOptions(accountID) retreivedGroups, detailedResponse, err := iamAccessGroupsClient.ListAccessGroups(listAccessGroupOption) if err != nil { @@ -194,7 +224,7 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error { if err != nil { log.Printf("Error retrieving access group rules: %s. API Response: %s", err, detailedResponse) } - ibmID, serviceID := flattenMembersData(members.Members, res, allrecs) + ibmID, serviceID, profileID := flex.FlattenMembersData(members.Members, res, allrecs, allprofiles) grpInstance := map[string]interface{}{ "id": grp.ID, @@ -202,7 +232,8 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error { "description": grp.Description, "ibm_ids": ibmID, "iam_service_ids": serviceID, - "rules": flattenAccessGroupRules(rules), + "iam_profile_ids": profileID, + "rules": flex.FlattenAccessGroupRules(rules), } grpMap = append(grpMap, grpInstance) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group.go index 9d6bcef50a..5ca55dafc6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamaccessgroup import ( "context" "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMIAMAccessGroup() *schema.Resource { +func ResourceIBMIAMAccessGroup() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMIAMAccessGroupCreate, ReadContext: resourceIBMIAMAccessGroupRead, @@ -47,25 +49,25 @@ func resourceIBMIAMAccessGroup() *schema.Resource { } func resourceIBMIAMAccessGroupCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } name := d.Get("name").(string) - creatAccessGroupOptions := iamAccessGroupsClient.NewCreateAccessGroupOptions(userDetails.userAccount, name) + creatAccessGroupOptions := iamAccessGroupsClient.NewCreateAccessGroupOptions(userDetails.UserAccount, name) if des, ok := d.GetOk("description"); ok { description := des.(string) creatAccessGroupOptions.Description = &description } agrp, detailedResponse, err := iamAccessGroupsClient.CreateAccessGroup(creatAccessGroupOptions) if err != nil || agrp == nil { - return diag.FromErr(fmt.Errorf("Error creating access group: %s. API Response: %s", err, detailedResponse)) + return diag.FromErr(fmt.Errorf("[ERROR] Error creating access group: %s. API Response: %s", err, detailedResponse)) } d.SetId(*agrp.ID) @@ -74,7 +76,7 @@ func resourceIBMIAMAccessGroupCreate(context context.Context, d *schema.Resource } func resourceIBMIAMAccessGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return diag.FromErr(err) } @@ -86,7 +88,7 @@ func resourceIBMIAMAccessGroupRead(context context.Context, d *schema.ResourceDa d.SetId("") return nil } - return diag.FromErr(fmt.Errorf("Error retrieving access group: %s. API Response: %s", err, detailedResponse)) + return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving access group: %s. API Response: %s", err, detailedResponse)) } version := detailedResponse.GetHeaders().Get("etag") d.Set("name", agrp.Name) @@ -97,7 +99,7 @@ func resourceIBMIAMAccessGroupRead(context context.Context, d *schema.ResourceDa } func resourceIBMIAMAccessGroupUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return diag.FromErr(err) } @@ -122,7 +124,7 @@ func resourceIBMIAMAccessGroupUpdate(context context.Context, d *schema.Resource if hasChange { agrp, detailedResponse, err := iamAccessGroupsClient.UpdateAccessGroup(updateAccessGroupOptions) if err != nil || agrp == nil { - return diag.FromErr(fmt.Errorf("Error updating access group: %s. API Response: %s", err, detailedResponse)) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating access group: %s. API Response: %s", err, detailedResponse)) } } @@ -131,7 +133,7 @@ func resourceIBMIAMAccessGroupUpdate(context context.Context, d *schema.Resource } func resourceIBMIAMAccessGroupDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return diag.FromErr(err) } @@ -142,7 +144,7 @@ func resourceIBMIAMAccessGroupDelete(context context.Context, d *schema.Resource deleteAccessGroupOptions.SetForce(force) detailedResponse, err := iamAccessGroupsClient.DeleteAccessGroup(deleteAccessGroupOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error deleting access group: %s, API Response: %s", err, detailedResponse)) + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting access group: %s, API Response: %s", err, detailedResponse)) } d.SetId("") diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_dynamic_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group_dynamic_rule.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_dynamic_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group_dynamic_rule.go index ea55c00b22..16872a8e9e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_access_group_dynamic_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group_dynamic_rule.go @@ -1,15 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamaccessgroup import ( "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMIAMDynamicRule() *schema.Resource { +func ResourceIBMIAMDynamicRule() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMDynamicRuleCreate, Read: resourceIBMIAMDynamicRuleRead, @@ -34,7 +38,7 @@ func resourceIBMIAMDynamicRule() *schema.Resource { Type: schema.TypeInt, Required: true, Description: "The expiration in hours", - ValidateFunc: validatePortRange(1, 24), + ValidateFunc: validate.ValidatePortRange(1, 24), }, "identity_provider": { Type: schema.TypeString, @@ -54,7 +58,7 @@ func resourceIBMIAMDynamicRule() *schema.Resource { "operator": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"EQUALS", "EQUALS_IGNORE_CASE", "IN", "NOT_EQUALS_IGNORE_CASE", "NOT_EQUALS", "CONTAINS"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"EQUALS", "EQUALS_IGNORE_CASE", "IN", "NOT_EQUALS_IGNORE_CASE", "NOT_EQUALS", "CONTAINS"}), }, "value": { Type: schema.TypeString, @@ -73,7 +77,7 @@ func resourceIBMIAMDynamicRule() *schema.Resource { } func resourceIBMIAMDynamicRuleCreate(d *schema.ResourceData, meta interface{}) error { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return err } @@ -110,7 +114,7 @@ func resourceIBMIAMDynamicRuleCreate(d *schema.ResourceData, meta interface{}) e } rule, detailedResponse, err := iamAccessGroupsClient.AddAccessGroupRule(addAccessGroupRuleOptions) if err != nil || rule == nil { - return fmt.Errorf("Error adding rule to Access Group(%s) %s. API Response: %s", grpID, err, detailedResponse) + return fmt.Errorf("[ERROR] Error adding rule to Access Group(%s) %s. API Response: %s", grpID, err, detailedResponse) } ruleID := rule.ID d.SetId(fmt.Sprintf("%s/%s", grpID, *ruleID)) @@ -119,12 +123,12 @@ func resourceIBMIAMDynamicRuleCreate(d *schema.ResourceData, meta interface{}) e } func resourceIBMIAMDynamicRuleRead(d *schema.ResourceData, meta interface{}) error { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -143,7 +147,7 @@ func resourceIBMIAMDynamicRuleRead(d *schema.ResourceData, meta interface{}) err d.SetId("") return nil } else { - return fmt.Errorf("Error retrieving access group Rules: %s. API Response: %s", err, detailResponse) + return fmt.Errorf("[ERROR] Error retrieving access group Rules: %s. API Response: %s", err, detailResponse) } } @@ -151,18 +155,18 @@ func resourceIBMIAMDynamicRuleRead(d *schema.ResourceData, meta interface{}) err d.Set("name", rule.Name) d.Set("expiration", rule.Expiration) d.Set("identity_provider", rule.RealmName) - d.Set("conditions", flattenConditions(rule.Conditions)) + d.Set("conditions", flex.FlattenConditions(rule.Conditions)) d.Set("rule_id", rule.ID) return nil } func resourceIBMIAMDynamicRuleUpdate(d *schema.ResourceData, meta interface{}) error { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -172,7 +176,7 @@ func resourceIBMIAMDynamicRuleUpdate(d *schema.ResourceData, meta interface{}) e getAccessGroupRuleOptions := iamAccessGroupsClient.NewGetAccessGroupRuleOptions(grpID, ruleID) _, detailedResponse, err := iamAccessGroupsClient.GetAccessGroupRule(getAccessGroupRuleOptions) if err != nil { - return fmt.Errorf("Error retrieving access group Rules: %s. API Response: %s", err, detailedResponse) + return fmt.Errorf("[ERROR] Error retrieving access group Rules: %s. API Response: %s", err, detailedResponse) } etag := detailedResponse.GetHeaders().Get("etag") @@ -200,7 +204,7 @@ func resourceIBMIAMDynamicRuleUpdate(d *schema.ResourceData, meta interface{}) e replaceAccessGroupRuleOption := iamAccessGroupsClient.NewReplaceAccessGroupRuleOptions(grpID, ruleID, etag, expiration, realm, condition) rule, detailedResponse, err := iamAccessGroupsClient.ReplaceAccessGroupRule(replaceAccessGroupRuleOption) if err != nil || rule == nil { - return fmt.Errorf("Error replacing group(%s) rule(%s). API response: %s", grpID, ruleID, detailedResponse) + return fmt.Errorf("[ERROR] Error replacing group(%s) rule(%s). API response: %s", grpID, ruleID, detailedResponse) } return resourceIBMIAMDynamicRuleRead(d, meta) @@ -208,12 +212,12 @@ func resourceIBMIAMDynamicRuleUpdate(d *schema.ResourceData, meta interface{}) e } func resourceIBMIAMDynamicRuleDelete(d *schema.ResourceData, meta interface{}) error { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -227,24 +231,24 @@ func resourceIBMIAMDynamicRuleDelete(d *schema.ResourceData, meta interface{}) e d.SetId("") return nil } - return fmt.Errorf("Error getting group(%s) rule(%s). API Response: %s", grpID, ruleID, detailedResponse) + return fmt.Errorf("[ERROR] Error getting group(%s) rule(%s). API Response: %s", grpID, ruleID, detailedResponse) } return nil } func resourceIBMIAMDynamicRuleExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of accessGroupID/RuleID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of accessGroupID/RuleID", d.Id()) } grpID := parts[0] ruleID := parts[1] @@ -257,7 +261,7 @@ func resourceIBMIAMDynamicRuleExists(d *schema.ResourceData, meta interface{}) ( return false, nil } if err != nil || rule == nil { - return false, fmt.Errorf("Error getting group(%s) rule(%s). API response: %s", grpID, ruleID, detailResponse) + return false, fmt.Errorf("[ERROR] Error getting group(%s) rule(%s). API response: %s", grpID, ruleID, detailResponse) } return *rule.AccessGroupID == grpID, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group_members.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group_members.go new file mode 100644 index 0000000000..9ca91c17f0 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup/resource_ibm_iam_access_group_members.go @@ -0,0 +1,537 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iamaccessgroup + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/platform-services-go-sdk/iamidentityv1" + + "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMIAMAccessGroupMembers() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMIAMAccessGroupMembersCreate, + ReadContext: resourceIBMIAMAccessGroupMembersRead, + UpdateContext: resourceIBMIAMAccessGroupMembersUpdate, + DeleteContext: resourceIBMIAMAccessGroupMembersDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "access_group_id": { + Type: schema.TypeString, + Required: true, + Description: "Unique identifier of the access group", + ForceNew: true, + }, + + "ibm_ids": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + }, + + "iam_service_ids": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "iam_profile_ids": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "members": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "iam_id": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func resourceIBMIAMAccessGroupMembersCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() + if err != nil { + return diag.FromErr(err) + } + + grpID := d.Get("access_group_id").(string) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + + accountID := userDetails.UserAccount + + var userids, serviceids, profileids []string + + users := flex.ExpandStringList(d.Get("ibm_ids").(*schema.Set).List()) + services := flex.ExpandStringList(d.Get("iam_service_ids").(*schema.Set).List()) + profiles := flex.ExpandStringList(d.Get("iam_profile_ids").(*schema.Set).List()) + + if len(users) == 0 && len(services) == 0 && len(profiles) == 0 { + return diag.FromErr(fmt.Errorf("ERROR] Provide either `ibm_ids` or `iam_service_ids` or `iam_profile_ids`")) + + } + + userids, err = flex.FlattenUserIds(accountID, users, meta) + if err != nil { + return diag.FromErr(err) + } + + serviceids, err = FlattenServiceIds(services, meta) + if err != nil { + return diag.FromErr(err) + } + + profileids, err = FlattenProfileIds(profiles, meta) + if err != nil { + return diag.FromErr(err) + } + + members := prepareMemberAddRequest(iamAccessGroupsClient, userids, serviceids, profileids) + + addMembersToAccessGroupOptions := iamAccessGroupsClient.NewAddMembersToAccessGroupOptions(grpID) + addMembersToAccessGroupOptions.SetMembers(members) + membership, detailResponse, err := iamAccessGroupsClient.AddMembersToAccessGroup(addMembersToAccessGroupOptions) + if err != nil || membership == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error adding members to group(%s). API response: %s", grpID, detailResponse)) + } + + d.SetId(fmt.Sprintf("%s/%s", grpID, time.Now().UTC().String())) + + return resourceIBMIAMAccessGroupMembersRead(context, d, meta) +} + +func resourceIBMIAMAccessGroupMembersRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() + if err != nil { + return diag.FromErr(err) + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + grpID := parts[0] + listAccessGroupMembersOptions := iamAccessGroupsClient.NewListAccessGroupMembersOptions(grpID) + offset := int64(0) + // lets fetch 100 in a single pagination + limit := int64(100) + listAccessGroupMembersOptions.SetLimit(limit) + members, detailedResponse, err := iamAccessGroupsClient.ListAccessGroupMembers(listAccessGroupMembersOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving access group members: %s. API Response: %s", err, detailedResponse)) + } + allMembers := members.Members + totalMembers := flex.IntValue(members.TotalCount) + for len(allMembers) < totalMembers { + offset = offset + limit + listAccessGroupMembersOptions.SetOffset(offset) + members, detailedResponse, err = iamAccessGroupsClient.ListAccessGroupMembers(listAccessGroupMembersOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving access group members: %s. API Response: %s", err, detailedResponse)) + } + allMembers = append(allMembers, members.Members...) + } + + d.Set("access_group_id", grpID) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + + accountID := userDetails.UserAccount + + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() + if err != nil { + return diag.FromErr(err) + } + client := userManagement.UserInvite() + res, err := client.ListUsers(accountID) + if err != nil { + return diag.FromErr(err) + } + + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() + if err != nil { + return diag.FromErr(err) + } + + start := "" + allrecs := []iamidentityv1.ServiceID{} + var pg int64 = 100 + for { + listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{ + AccountID: &userDetails.UserAccount, + Pagesize: &pg, + } + if start != "" { + listServiceIDOptions.Pagetoken = &start + } + + serviceIDs, resp, err := iamClient.ListServiceIds(&listServiceIDOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp)) + } + start = flex.GetNextIAM(serviceIDs.Next) + allrecs = append(allrecs, serviceIDs.Serviceids...) + if start == "" { + break + } + } + + profileStart := "" + allprofiles := []iamidentityv1.TrustedProfile{} + var plimit int64 = 100 + for { + listProfilesOptions := iamidentityv1.ListProfilesOptions{ + AccountID: &userDetails.UserAccount, + Pagesize: &plimit, + } + if profileStart != "" { + listProfilesOptions.Pagetoken = &profileStart + } + + profileIDs, resp, err := iamClient.ListProfiles(&listProfilesOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error listing Trusted Profiles %s %s", err, resp)) + } + profileStart = flex.GetNextIAM(profileIDs.Next) + allprofiles = append(allprofiles, profileIDs.Profiles...) + if profileStart == "" { + break + } + } + + d.Set("members", flex.FlattenAccessGroupMembers(allMembers, res, allrecs)) + ibmID, serviceID, profileID := flex.FlattenMembersData(allMembers, res, allrecs, allprofiles) + if len(ibmID) > 0 { + d.Set("ibm_ids", ibmID) + } + if len(serviceID) > 0 { + d.Set("iam_service_ids", serviceID) + } + if len(profileID) > 0 { + d.Set("iam_profile_ids", profileID) + } + return nil +} + +func resourceIBMIAMAccessGroupMembersUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() + if err != nil { + return diag.FromErr(err) + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + grpID := parts[0] + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + + accountID := userDetails.UserAccount + + var removeUsers, addUsers, removeServiceids, addServiceids, removeProfileids, addProfileids []string + o, n := d.GetChange("ibm_ids") + ou := o.(*schema.Set) + nu := n.(*schema.Set) + + removeUsers = flex.ExpandStringList(ou.Difference(nu).List()) + addUsers = flex.ExpandStringList(nu.Difference(ou).List()) + + os, ns := d.GetChange("iam_service_ids") + osi := os.(*schema.Set) + nsi := ns.(*schema.Set) + + removeServiceids = flex.ExpandStringList(osi.Difference(nsi).List()) + addServiceids = flex.ExpandStringList(nsi.Difference(osi).List()) + + op, np := d.GetChange("iam_profile_ids") + opi := op.(*schema.Set) + npi := np.(*schema.Set) + + removeProfileids = flex.ExpandStringList(opi.Difference(npi).List()) + addProfileids = flex.ExpandStringList(npi.Difference(opi).List()) + + if len(addUsers) > 0 || len(addServiceids) > 0 || len(addProfileids) > 0 && !d.IsNewResource() { + var userids, serviceids, profileids []string + userids, err = flex.FlattenUserIds(accountID, addUsers, meta) + if err != nil { + return diag.FromErr(err) + } + + serviceids, err = FlattenServiceIds(addServiceids, meta) + if err != nil { + return diag.FromErr(err) + } + + profileids, err = FlattenProfileIds(addProfileids, meta) + if err != nil { + return diag.FromErr(err) + } + + members := prepareMemberAddRequest(iamAccessGroupsClient, userids, serviceids, profileids) + + addMembersToAccessGroupOptions := iamAccessGroupsClient.NewAddMembersToAccessGroupOptions(grpID) + addMembersToAccessGroupOptions.SetMembers(members) + membership, detailResponse, err := iamAccessGroupsClient.AddMembersToAccessGroup(addMembersToAccessGroupOptions) + if err != nil || membership == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating members to group(%s). API response: %s", grpID, detailResponse)) + } + + } + if len(removeUsers) > 0 || len(removeServiceids) > 0 || len(removeProfileids) > 0 && !d.IsNewResource() { + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() + if err != nil { + return diag.FromErr(err) + } + for _, u := range removeUsers { + ibmUniqueId, err := flex.GetIBMUniqueId(accountID, u, meta) + if err != nil { + return diag.FromErr(err) + } + removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, ibmUniqueId) + _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) + if err != nil { + return diag.FromErr(err) + } + + } + + for _, s := range removeServiceids { + getServiceIDOptions := iamidentityv1.GetServiceIDOptions{ + ID: &s, + } + serviceID, resp, err := iamClient.GetServiceID(&getServiceIDOptions) + if err != nil || serviceID == nil { + return diag.FromErr(fmt.Errorf("ERROR] Error Getting Service Ids %s %s", err, resp)) + } + removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, *serviceID.IamID) + detailResponse, err := iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error removing members to group(%s). API Response: %s", grpID, detailResponse)) + } + + } + + for _, p := range removeProfileids { + getProfileOptions := iamidentityv1.GetProfileOptions{ + ProfileID: &p, + } + profileID, resp, err := iamClient.GetProfile(&getProfileOptions) + if err != nil || profileID == nil { + return diag.FromErr(fmt.Errorf("ERROR] Error Getting Profile Ids %s %s", err, resp)) + } + removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, *profileID.IamID) + detailResponse, err := iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error removing members to group(%s). API Response: %s", grpID, detailResponse)) + } + + } + } + + return resourceIBMIAMAccessGroupMembersRead(context, d, meta) + +} + +func resourceIBMIAMAccessGroupMembersDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() + if err != nil { + return diag.FromErr(err) + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + grpID := parts[0] + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + + users := flex.ExpandStringList(d.Get("ibm_ids").(*schema.Set).List()) + + for _, name := range users { + + ibmUniqueID, err := flex.GetIBMUniqueId(userDetails.UserAccount, name, meta) + if err != nil { + return diag.FromErr(err) + } + + removeMembersFromAccessGroupOptions := iamAccessGroupsClient.NewRemoveMemberFromAccessGroupOptions(grpID, ibmUniqueID) + _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) + if err != nil { + return diag.FromErr(err) + } + + } + + services := flex.ExpandStringList(d.Get("iam_service_ids").(*schema.Set).List()) + + for _, id := range services { + serviceID, err := getServiceID(id, meta) + if err != nil { + return diag.FromErr(err) + } + + removeMembersFromAccessGroupOptions := &iamaccessgroupsv2.RemoveMemberFromAccessGroupOptions{ + AccessGroupID: &grpID, + IamID: serviceID.IamID, + } + _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) + if err != nil { + return diag.FromErr(err) + } + } + + profiles := flex.ExpandStringList(d.Get("iam_profile_ids").(*schema.Set).List()) + + for _, id := range profiles { + profileID, err := getProfileID(id, meta) + if err != nil { + return diag.FromErr(err) + } + + removeMembersFromAccessGroupOptions := &iamaccessgroupsv2.RemoveMemberFromAccessGroupOptions{ + AccessGroupID: &grpID, + IamID: profileID.IamID, + } + _, err = iamAccessGroupsClient.RemoveMemberFromAccessGroup(removeMembersFromAccessGroupOptions) + if err != nil { + return diag.FromErr(err) + } + } + + d.SetId("") + + return nil +} + +func prepareMemberAddRequest(iamAccessGroupsClient *iamaccessgroupsv2.IamAccessGroupsV2, userIds, serviceIds, profileIds []string) (members []iamaccessgroupsv2.AddGroupMembersRequestMembersItem) { + members = make([]iamaccessgroupsv2.AddGroupMembersRequestMembersItem, len(userIds)+len(serviceIds)+len(profileIds)) + var i = 0 + userType := "user" + serviceType := "service" + profileType := "profile" + + for _, id := range userIds { + membersItem, err := iamAccessGroupsClient.NewAddGroupMembersRequestMembersItem(id, userType) + if err != nil { + log.Printf("Error in preparing membership data. %s", err) + } + members[i] = *membersItem + i++ + } + + for _, id := range serviceIds { + membersItem, err := iamAccessGroupsClient.NewAddGroupMembersRequestMembersItem(id, serviceType) + if err != nil || membersItem == nil { + log.Printf("Error in preparing membership data. %s", err) + } + members[i] = *membersItem + i++ + } + + for _, id := range profileIds { + membersItem, err := iamAccessGroupsClient.NewAddGroupMembersRequestMembersItem(id, profileType) + if err != nil || membersItem == nil { + log.Printf("Error in preparing membership data. %s", err) + } + members[i] = *membersItem + i++ + } + return +} +func getServiceID(id string, meta interface{}) (iamidentityv1.ServiceID, error) { + serviceids := iamidentityv1.ServiceID{} + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() + if err != nil { + return serviceids, err + } + getServiceIDOptions := iamidentityv1.GetServiceIDOptions{ + ID: &id, + } + serviceID, resp, err := iamClient.GetServiceID(&getServiceIDOptions) + if err != nil || serviceID == nil { + return serviceids, fmt.Errorf("ERROR] Error Getting Service Ids %s %s", err, resp) + } + return *serviceID, nil +} + +func FlattenServiceIds(services []string, meta interface{}) ([]string, error) { + serviceids := make([]string, len(services)) + for i, id := range services { + serviceID, err := getServiceID(id, meta) + if err != nil { + return nil, err + } + serviceids[i] = *serviceID.IamID + } + return serviceids, nil +} + +func FlattenProfileIds(profiles []string, meta interface{}) ([]string, error) { + profileids := make([]string, len(profiles)) + for i, id := range profiles { + profileID, err := getProfileID(id, meta) + if err != nil { + return nil, err + } + profileids[i] = *profileID.IamID + } + return profileids, nil +} + +func getProfileID(id string, meta interface{}) (iamidentityv1.TrustedProfile, error) { + profileids := iamidentityv1.TrustedProfile{} + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() + if err != nil { + return profileids, err + } + getProfileOptions := iamidentityv1.GetProfileOptions{ + ProfileID: &id, + } + profileID, resp, err := iamClient.GetProfile(&getProfileOptions) + if err != nil || profileID == nil { + return profileids, fmt.Errorf("ERROR] Error Getting Profile Ids %s %s", err, resp) + } + return *profileID, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/README.md new file mode 100644 index 0000000000..8f53833828 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider IAM Identity Services + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the IAM Identity Services resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_account_settings) +* IBM API Docs: [IBM API Docs for IAM Identity Services](https://cloud.ibm.com/apidocs/iam-identity-token-api) +* IBM IAM Identity Services SDK: [IBM SDK for IAM Identity Services](https://github.com/IBM/platform-services-go-sdk/tree/main/iamidentityv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_account_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_account_settings.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_account_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_account_settings.go index 378c124f43..1fbe2ed657 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_account_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_account_settings.go @@ -1,87 +1,88 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIAMAccountSettings() *schema.Resource { +func DataSourceIBMIAMAccountSettings() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIamAccountSettingsRead, Schema: map[string]*schema.Schema{ - "include_history": &schema.Schema{ + "include_history": { Type: schema.TypeBool, Optional: true, Default: false, Description: "Defines if the entity history is included in the response.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "Unique ID of the account.", }, - "restrict_create_service_id": &schema.Schema{ + "restrict_create_service_id": { Type: schema.TypeString, Computed: true, Description: "Defines whether or not creating a Service Id is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", }, - "restrict_create_platform_apikey": &schema.Schema{ + "restrict_create_platform_apikey": { Type: schema.TypeString, Computed: true, Description: "Defines whether or not creating platform API keys is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", }, - "allowed_ip_addresses": &schema.Schema{ + "allowed_ip_addresses": { Type: schema.TypeString, Computed: true, Description: "Defines the IP addresses and subnets from which IAM tokens can be created for the account.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "Version of the account settings.", }, - "mfa": &schema.Schema{ + "mfa": { Type: schema.TypeString, Computed: true, Description: "Defines the MFA trait for the account. Valid values: * NONE - No MFA trait set * TOTP - For all non-federated IBMId users * TOTP4ALL - For all users * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - U2F MFA for all users.", }, - "history": &schema.Schema{ + "history": { Type: schema.TypeList, Computed: true, Description: "History of the Account Settings.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "timestamp": &schema.Schema{ + "timestamp": { Type: schema.TypeString, Computed: true, Description: "Timestamp when the action was triggered.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the identity which triggered the action.", }, - "iam_id_account": &schema.Schema{ + "iam_id_account": { Type: schema.TypeString, Computed: true, Description: "Account of the identity which triggered the action.", }, - "action": &schema.Schema{ + "action": { Type: schema.TypeString, Computed: true, Description: "Action of the history entry.", }, - "params": &schema.Schema{ + "params": { Type: schema.TypeList, Computed: true, Description: "Params of the history entry.", @@ -89,7 +90,7 @@ func dataSourceIBMIAMAccountSettings() *schema.Resource { Type: schema.TypeString, }, }, - "message": &schema.Schema{ + "message": { Type: schema.TypeString, Computed: true, Description: "Message which summarizes the executed action.", @@ -97,17 +98,17 @@ func dataSourceIBMIAMAccountSettings() *schema.Resource { }, }, }, - "session_expiration_in_seconds": &schema.Schema{ + "session_expiration_in_seconds": { Type: schema.TypeString, Computed: true, Description: "Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default.", }, - "session_invalidation_in_seconds": &schema.Schema{ + "session_invalidation_in_seconds": { Type: schema.TypeString, Computed: true, Description: "Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: * Any whole number between '900' and '7200' * NOT_SET - To unset account setting and use service default.", }, - "max_sessions_per_identity": &schema.Schema{ + "max_sessions_per_identity": { Type: schema.TypeString, Computed: true, Description: "Defines the max allowed sessions per identity required by the account. Value values: * Any whole number greater than '0' * NOT_SET - To unset account setting and use service default.", @@ -117,7 +118,7 @@ func dataSourceIBMIAMAccountSettings() *schema.Resource { } func dataSourceIbmIamAccountSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -125,12 +126,12 @@ func dataSourceIbmIamAccountSettingsRead(context context.Context, d *schema.Reso getAccountSettingsOptions := &iamidentityv1.GetAccountSettingsOptions{} getAccountSettingsOptions.SetIncludeHistory(d.Get("include_history").(bool)) - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } - getAccountSettingsOptions.SetAccountID(userDetails.userAccount) + getAccountSettingsOptions.SetAccountID(userDetails.UserAccount) accountSettingsResponse, response, err := iamIdentityClient.GetAccountSettings(getAccountSettingsOptions) if err != nil { @@ -138,41 +139,41 @@ func dataSourceIbmIamAccountSettingsRead(context context.Context, d *schema.Reso return diag.FromErr(err) } - d.SetId(userDetails.userAccount) + d.SetId(userDetails.UserAccount) if err = d.Set("account_id", accountSettingsResponse.AccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) } if err = d.Set("restrict_create_service_id", accountSettingsResponse.RestrictCreateServiceID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting restrict_create_service_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting restrict_create_service_id: %s", err)) } if err = d.Set("restrict_create_platform_apikey", accountSettingsResponse.RestrictCreatePlatformApikey); err != nil { - return diag.FromErr(fmt.Errorf("Error setting restrict_create_platform_apikey: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting restrict_create_platform_apikey: %s", err)) } if err = d.Set("allowed_ip_addresses", accountSettingsResponse.AllowedIPAddresses); err != nil { - return diag.FromErr(fmt.Errorf("Error setting allowed_ip_addresses: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting allowed_ip_addresses: %s", err)) } if err = d.Set("entity_tag", accountSettingsResponse.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } if err = d.Set("mfa", accountSettingsResponse.Mfa); err != nil { - return diag.FromErr(fmt.Errorf("Error setting mfa: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting mfa: %s", err)) } if accountSettingsResponse.History != nil { err = d.Set("history", dataSourceAccountSettingsResponseFlattenHistory(accountSettingsResponse.History)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting history %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting history %s", err)) } } if err = d.Set("session_expiration_in_seconds", accountSettingsResponse.SessionExpirationInSeconds); err != nil { - return diag.FromErr(fmt.Errorf("Error setting session_expiration_in_seconds: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting session_expiration_in_seconds: %s", err)) } if err = d.Set("session_invalidation_in_seconds", accountSettingsResponse.SessionInvalidationInSeconds); err != nil { - return diag.FromErr(fmt.Errorf("Error setting session_invalidation_in_seconds: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting session_invalidation_in_seconds: %s", err)) } if err = d.Set("max_sessions_per_identity", accountSettingsResponse.MaxSessionsPerIdentity); err != nil { - return diag.FromErr(fmt.Errorf("Error setting max_sessions_per_identity: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting max_sessions_per_identity: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_api_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_api_key.go new file mode 100644 index 0000000000..f78b453256 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_api_key.go @@ -0,0 +1,132 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iamidentity + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/platform-services-go-sdk/iamidentityv1" +) + +func DataSourceIBMIamApiKey() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmIamApiKeyRead, + + Schema: map[string]*schema.Schema{ + "apikey_id": { + Type: schema.TypeString, + Required: true, + Description: "Unique ID of the API key.", + }, + "entity_tag": { + Type: schema.TypeString, + Computed: true, + Description: "Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'.", + }, + "locked": { + Type: schema.TypeBool, + Computed: true, + Description: "The API key cannot be changed if set to true.", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "If set contains a date time string of the creation date in ISO format.", + }, + "created_by": { + Type: schema.TypeString, + Computed: true, + Description: "IAM ID of the user or service which created the API key.", + }, + "modified_at": { + Type: schema.TypeString, + Computed: true, + Description: "If set contains a date time string of the last modification date in ISO format.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", + }, + "iam_id": { + Type: schema.TypeString, + Computed: true, + Description: "The iam_id that this API key authenticates.", + }, + "account_id": { + Type: schema.TypeString, + Computed: true, + Description: "ID of the account that this API key authenticates for.", + }, + }, + } +} + +func dataSourceIbmIamApiKeyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() + if err != nil { + return diag.FromErr(err) + } + + getApiKeyOptions := &iamidentityv1.GetAPIKeyOptions{} + + getApiKeyOptions.SetID(d.Get("apikey_id").(string)) + + apiKey, response, err := iamIdentityClient.GetAPIKey(getApiKeyOptions) + if err != nil { + log.Printf("[DEBUG] GetApiKey failed %s\n%s", err, response) + return diag.FromErr(err) + } + + d.SetId(*apiKey.ID) + + if err = d.Set("entity_tag", apiKey.EntityTag); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) + } + if err = d.Set("crn", apiKey.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + if err = d.Set("locked", apiKey.Locked); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting locked: %s", err)) + } + if err = d.Set("created_at", apiKey.CreatedAt.String()); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + if err = d.Set("created_by", apiKey.CreatedBy); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) + } + if err = d.Set("modified_at", apiKey.ModifiedAt.String()); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) + } + if err = d.Set("name", apiKey.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + if err = d.Set("description", apiKey.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + if err = d.Set("iam_id", apiKey.IamID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting iam_id: %s", err)) + } + if err = d.Set("account_id", apiKey.AccountID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_auth_token.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_auth_token.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_auth_token.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_auth_token.go index b6d41286be..3bfc69211e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_auth_token.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_auth_token.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMIAMAuthToken() *schema.Resource { +func DataSourceIBMIAMAuthToken() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMAuthTokenRead, @@ -38,7 +39,7 @@ func dataSourceIBMIAMAuthToken() *schema.Resource { } func dataSourceIBMIAMAuthTokenRead(d *schema.ResourceData, meta interface{}) error { - bmxSess, err := meta.(ClientSession).BluemixSession() + bmxSess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_service_id.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_service_id.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_service_id.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_service_id.go index f8f937352a..7c6101c289 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_service_id.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_service_id.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMIAMServiceID() *schema.Resource { +func DataSourceIBMIAMServiceID() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMServiceIDRead, @@ -78,12 +80,12 @@ func dataSourceIBMIAMServiceIDRead(d *schema.ResourceData, meta interface{}) err name := d.Get("name").(string) - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -93,7 +95,7 @@ func dataSourceIBMIAMServiceIDRead(d *schema.ResourceData, meta interface{}) err var pg int64 = 100 for { listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{ - AccountID: &userDetails.userAccount, + AccountID: &userDetails.UserAccount, Pagesize: &pg, Name: &name, } @@ -105,7 +107,7 @@ func dataSourceIBMIAMServiceIDRead(d *schema.ResourceData, meta interface{}) err if err != nil { return fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp) } - start = GetNextIAM(serviceIDs.Next) + start = flex.GetNextIAM(serviceIDs.Next) allrecs = append(allrecs, serviceIDs.Serviceids...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile.go index 7c73e75ddc..2af711b48c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile.go @@ -1,106 +1,108 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIamTrustedProfile() *schema.Resource { +func DataSourceIBMIamTrustedProfile() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIamTrustedProfileRead, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "ID of the trusted profile to get.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "Version of the trusted profile details object. You need to specify this value when updating the trusted profile to avoid stale updates.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the trusted profile. The name is checked for uniqueness. Therefore trusted profiles with the same names can not exist in the same account.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The optional description of the trusted profile. The 'description' property is only available if a description was provided during a create of a trusted profile.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "The iam_id of this trusted profile.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "ID of the account that this trusted profile belong to.", }, - "ims_account_id": &schema.Schema{ + "ims_account_id": { Type: schema.TypeInt, Computed: true, Description: "IMS acount ID of the trusted profile.", }, - "ims_user_id": &schema.Schema{ + "ims_user_id": { Type: schema.TypeInt, Computed: true, Description: "IMS user ID of the trusted profile.", }, - "history": &schema.Schema{ + "history": { Type: schema.TypeList, Computed: true, Description: "History of the trusted profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "timestamp": &schema.Schema{ + "timestamp": { Type: schema.TypeString, Computed: true, Description: "Timestamp when the action was triggered.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the identity which triggered the action.", }, - "iam_id_account": &schema.Schema{ + "iam_id_account": { Type: schema.TypeString, Computed: true, Description: "Account of the identity which triggered the action.", }, - "action": &schema.Schema{ + "action": { Type: schema.TypeString, Computed: true, Description: "Action of the history entry.", }, - "params": &schema.Schema{ + "params": { Type: schema.TypeList, Computed: true, Description: "Params of the history entry.", @@ -108,7 +110,7 @@ func dataSourceIBMIamTrustedProfile() *schema.Resource { Type: schema.TypeString, }, }, - "message": &schema.Schema{ + "message": { Type: schema.TypeString, Computed: true, Description: "Message which summarizes the executed action.", @@ -121,7 +123,7 @@ func dataSourceIBMIamTrustedProfile() *schema.Resource { } func dataSourceIBMIamTrustedProfileRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -139,39 +141,39 @@ func dataSourceIBMIamTrustedProfileRead(context context.Context, d *schema.Resou d.SetId(*trustedProfile.ID) if err = d.Set("entity_tag", trustedProfile.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } if err = d.Set("crn", trustedProfile.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("name", trustedProfile.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", trustedProfile.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } - if err = d.Set("created_at", dateTimeToString(trustedProfile.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(trustedProfile.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } - if err = d.Set("modified_at", dateTimeToString(trustedProfile.ModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + if err = d.Set("modified_at", flex.DateTimeToString(trustedProfile.ModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } if err = d.Set("iam_id", trustedProfile.IamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting iam_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting iam_id: %s", err)) } if err = d.Set("account_id", trustedProfile.AccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) } - if err = d.Set("ims_account_id", intValue(trustedProfile.ImsAccountID)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ims_account_id: %s", err)) + if err = d.Set("ims_account_id", flex.IntValue(trustedProfile.ImsAccountID)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ims_account_id: %s", err)) } - if err = d.Set("ims_user_id", intValue(trustedProfile.ImsUserID)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ims_user_id: %s", err)) + if err = d.Set("ims_user_id", flex.IntValue(trustedProfile.ImsUserID)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ims_user_id: %s", err)) } err = d.Set("history", dataSourceTrustedProfileFlattenHistory(trustedProfile.History)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting history %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting history %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_claim_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_claim_rule.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_claim_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_claim_rule.go index 73312205d5..e8829de441 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_claim_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_claim_rule.go @@ -1,91 +1,93 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIamTrustedProfileClaimRule() *schema.Resource { +func DataSourceIBMIamTrustedProfileClaimRule() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIamTrustedProfileClaimRuleRead, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "ID of the trusted profile.", }, - "rule_id": &schema.Schema{ + "rule_id": { Type: schema.TypeString, Required: true, Description: "ID of the claim rule to get.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "version of the claim rule.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The optional claim rule name.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the Calim rule, either 'Profile-SAML' or 'Profile-CR'.", }, - "realm_name": &schema.Schema{ + "realm_name": { Type: schema.TypeString, Computed: true, Description: "The realm name of the Idp this claim rule applies to.", }, - "expiration": &schema.Schema{ + "expiration": { Type: schema.TypeInt, Computed: true, Description: "Session expiration in seconds.", }, - "cr_type": &schema.Schema{ + "cr_type": { Type: schema.TypeString, Computed: true, Description: "The compute resource type. Not required if type is Profile-SAML. Valid values are VSI, IKS_SA, ROKS_SA.", }, - "conditions": &schema.Schema{ + "conditions": { Type: schema.TypeList, Computed: true, Description: "Conditions of this claim rule.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "claim": &schema.Schema{ + "claim": { Type: schema.TypeString, Computed: true, Description: "The claim to evaluate against.", }, - "operator": &schema.Schema{ + "operator": { Type: schema.TypeString, Computed: true, Description: "The operation to perform on the claim. valid values are EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, CONTAINS, IN.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The stringified JSON value that the claim is compared to using the operator.", @@ -98,7 +100,7 @@ func dataSourceIBMIamTrustedProfileClaimRule() *schema.Resource { } func dataSourceIBMIamTrustedProfileClaimRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -115,34 +117,34 @@ func dataSourceIBMIamTrustedProfileClaimRuleRead(context context.Context, d *sch } d.SetId(fmt.Sprintf("%s/%s", *getClaimRuleOptions.ProfileID, *profileClaimRule.ID)) if err = d.Set("entity_tag", profileClaimRule.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } - if err = d.Set("created_at", dateTimeToString(profileClaimRule.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(profileClaimRule.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } - if err = d.Set("modified_at", dateTimeToString(profileClaimRule.ModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + if err = d.Set("modified_at", flex.DateTimeToString(profileClaimRule.ModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } if err = d.Set("name", profileClaimRule.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("type", profileClaimRule.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } if err = d.Set("realm_name", profileClaimRule.RealmName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting realm_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting realm_name: %s", err)) } - if err = d.Set("expiration", intValue(profileClaimRule.Expiration)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting expiration: %s", err)) + if err = d.Set("expiration", flex.IntValue(profileClaimRule.Expiration)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting expiration: %s", err)) } if err = d.Set("cr_type", profileClaimRule.CrType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cr_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cr_type: %s", err)) } if profileClaimRule.Conditions != nil { err = d.Set("conditions", dataSourceProfileClaimRuleFlattenConditions(profileClaimRule.Conditions)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting conditions %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting conditions %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_link.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_link.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_link.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_link.go index 1e6cfa7541..d3e61c0fff 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_link.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_link.go @@ -1,75 +1,77 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIamTrustedProfileLink() *schema.Resource { +func DataSourceIBMIamTrustedProfileLink() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIamTrustedProfileLinkRead, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "ID of the trusted profile.", }, - "link_id": &schema.Schema{ + "link_id": { Type: schema.TypeString, Required: true, Description: "ID of the link.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "version of the claim rule.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Optional name of the Link.", }, - "cr_type": &schema.Schema{ + "cr_type": { Type: schema.TypeString, Computed: true, Description: "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.", }, - "link": &schema.Schema{ + "link": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN of the compute resource.", }, - "namespace": &schema.Schema{ + "namespace": { Type: schema.TypeString, Computed: true, Description: "The compute resource namespace, only required if cr_type is IKS_SA or ROKS_SA.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.", @@ -82,7 +84,7 @@ func dataSourceIBMIamTrustedProfileLink() *schema.Resource { } func dataSourceIBMIamTrustedProfileLinkRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -100,25 +102,25 @@ func dataSourceIBMIamTrustedProfileLinkRead(context context.Context, d *schema.R d.SetId(fmt.Sprintf("%s/%s", *getLinkOptions.ProfileID, *getLinkOptions.LinkID)) if err = d.Set("entity_tag", profileLink.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } - if err = d.Set("created_at", dateTimeToString(profileLink.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(profileLink.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } - if err = d.Set("modified_at", dateTimeToString(profileLink.ModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + if err = d.Set("modified_at", flex.DateTimeToString(profileLink.ModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } if err = d.Set("name", profileLink.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("cr_type", profileLink.CrType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cr_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cr_type: %s", err)) } if profileLink.Link != nil { err = d.Set("link", dataSourceProfileLinkFlattenLink(*profileLink.Link)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting link %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting link %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_links.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_links.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_links.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_links.go index 43731b415b..ae74172559 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_links.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_links.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" @@ -9,74 +9,75 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIamTrustedProfileLinks() *schema.Resource { +func DataSourceIBMIamTrustedProfileLinks() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIamTrustedProfileLinkListRead, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "ID of the trusted profile.", }, - "links": &schema.Schema{ + "links": { Type: schema.TypeList, Computed: true, Description: "List of links to a trusted profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "the unique identifier of the claim rule.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "version of the claim rule.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Optional name of the Link.", }, - "cr_type": &schema.Schema{ + "cr_type": { Type: schema.TypeString, Computed: true, Description: "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.", }, - "link": &schema.Schema{ + "link": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN of the compute resource.", }, - "namespace": &schema.Schema{ + "namespace": { Type: schema.TypeString, Computed: true, Description: "The compute resource namespace, only required if cr_type is IKS_SA or ROKS_SA.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.", @@ -92,7 +93,7 @@ func dataSourceIBMIamTrustedProfileLinks() *schema.Resource { } func dataSourceIBMIamTrustedProfileLinkListRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -112,7 +113,7 @@ func dataSourceIBMIamTrustedProfileLinkListRead(context context.Context, d *sche if profileLinkList.Links != nil { err = d.Set("links", dataSourceProfileLinkListFlattenLinks(profileLinkList.Links)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting links %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting links %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profiles.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profiles.go index aa6e1ff4ec..b02a427972 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profiles.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" @@ -9,18 +9,20 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIamTrustedProfiles() *schema.Resource { +func DataSourceIBMIamTrustedProfiles() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIamTrustedProfileListRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, Description: "Account ID to query for trusted profiles.", @@ -35,94 +37,94 @@ func dataSourceIBMIamTrustedProfiles() *schema.Resource { Type: schema.TypeBool, Optional: true, }, - "profiles": &schema.Schema{ + "profiles": { Type: schema.TypeList, Computed: true, Description: "List of trusted profiles.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "the unique identifier of the trusted profile. Example:'Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "Version of the trusted profile details object. You need to specify this value when updating the trusted profile to avoid stale updates.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the trusted profile. The name is checked for uniqueness. Therefore trusted profiles with the same names can not exist in the same account.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The optional description of the trusted profile. The 'description' property is only available if a description was provided during a create of a trusted profile.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "The iam_id of this trusted profile.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "ID of the account that this trusted profile belong to.", }, - "ims_account_id": &schema.Schema{ + "ims_account_id": { Type: schema.TypeInt, Computed: true, Description: "IMS acount ID of the trusted profile.", }, - "ims_user_id": &schema.Schema{ + "ims_user_id": { Type: schema.TypeInt, Computed: true, Description: "IMS user ID of the trusted profile.", }, - "history": &schema.Schema{ + "history": { Type: schema.TypeList, Computed: true, Description: "History of the trusted profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "timestamp": &schema.Schema{ + "timestamp": { Type: schema.TypeString, Computed: true, Description: "Timestamp when the action was triggered.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the identity which triggered the action.", }, - "iam_id_account": &schema.Schema{ + "iam_id_account": { Type: schema.TypeString, Computed: true, Description: "Account of the identity which triggered the action.", }, - "action": &schema.Schema{ + "action": { Type: schema.TypeString, Computed: true, Description: "Action of the history entry.", }, - "params": &schema.Schema{ + "params": { Type: schema.TypeList, Computed: true, Description: "Params of the history entry.", @@ -130,7 +132,7 @@ func dataSourceIBMIamTrustedProfiles() *schema.Resource { Type: schema.TypeString, }, }, - "message": &schema.Schema{ + "message": { Type: schema.TypeString, Computed: true, Description: "Message which summarizes the executed action.", @@ -146,19 +148,19 @@ func dataSourceIBMIamTrustedProfiles() *schema.Resource { } func dataSourceIBMIamTrustedProfileListRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } start := "" allrecs := []iamidentityv1.TrustedProfile{} - accountID := userDetails.userAccount + accountID := userDetails.UserAccount for { listProfileOptions := &iamidentityv1.ListProfilesOptions{} @@ -187,7 +189,7 @@ func dataSourceIBMIamTrustedProfileListRead(context context.Context, d *schema.R log.Printf("[DEBUG] ListProfile failed %s\n%s", err, response) return diag.FromErr(fmt.Errorf("ListProfile failed %s\n%s", err, response)) } - start = GetNextIAM(trustedProfiles.Next) + start = flex.GetNextIAM(trustedProfiles.Next) allrecs = append(allrecs, trustedProfiles.Profiles...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profiles_claim_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profiles_claim_rules.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profiles_claim_rules.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profiles_claim_rules.go index f4cc56b762..121bb20cc4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profiles_claim_rules.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_trusted_profiles_claim_rules.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" @@ -9,90 +9,91 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func dataSourceIBMIamTrustedProfileClaimRules() *schema.Resource { +func DataSourceIBMIamTrustedProfileClaimRules() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIamTrustedProfileClaimRuleListRead, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "ID of the trusted profile.", }, - "rules": &schema.Schema{ + "rules": { Type: schema.TypeList, Computed: true, Description: "List of claim rules.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "the unique identifier of the claim rule.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "version of the claim rule.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The optional claim rule name.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the Calim rule, either 'Profile-SAML' or 'Profile-CR'.", }, - "realm_name": &schema.Schema{ + "realm_name": { Type: schema.TypeString, Computed: true, Description: "The realm name of the Idp this claim rule applies to.", }, - "expiration": &schema.Schema{ + "expiration": { Type: schema.TypeInt, Computed: true, Description: "Session expiration in seconds.", }, - "cr_type": &schema.Schema{ + "cr_type": { Type: schema.TypeString, Computed: true, Description: "The compute resource type. Not required if type is Profile-SAML. Valid values are VSI, IKS_SA, ROKS_SA.", }, - "conditions": &schema.Schema{ + "conditions": { Type: schema.TypeList, Computed: true, Description: "Conditions of this claim rule.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "claim": &schema.Schema{ + "claim": { Type: schema.TypeString, Computed: true, Description: "The claim to evaluate against.", }, - "operator": &schema.Schema{ + "operator": { Type: schema.TypeString, Computed: true, Description: "The operation to perform on the claim. valid values are EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, CONTAINS, IN.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The stringified JSON value that the claim is compared to using the operator.", @@ -108,7 +109,7 @@ func dataSourceIBMIamTrustedProfileClaimRules() *schema.Resource { } func dataSourceIBMIamTrustedProfileClaimRuleListRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -128,7 +129,7 @@ func dataSourceIBMIamTrustedProfileClaimRuleListRead(context context.Context, d if profileClaimRuleList.Rules != nil { err = d.Set("rules", dataSourceProfileClaimRuleListFlattenRules(profileClaimRuleList.Rules)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting rules %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting rules %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_user_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_user_profile.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_user_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_user_profile.go index 8005fde4c2..f2cbabea71 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_user_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_user_profile.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMIAMUserProfile() *schema.Resource { +func DataSourceIBMIAMUserProfile() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMUserProfileRead, @@ -85,7 +87,7 @@ func dataSourceIBMIAMUserProfile() *schema.Resource { } func dataSourceIBMIAMUserProfileRead(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -98,7 +100,7 @@ func dataSourceIBMIAMUserProfileRead(d *schema.ResourceData, meta interface{}) e return err } - iamID, err := getIBMUniqueId(accountID, userEmail, meta) + iamID, err := flex.GetIBMUniqueId(accountID, userEmail, meta) if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_users.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_users.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_users.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_users.go index b548881133..4dd5a82728 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_users.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/data_source_ibm_iam_users.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMIAMUsers() *schema.Resource { +func DataSourceIBMIAMUsers() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMUsersRead, @@ -87,18 +88,18 @@ func dataSourceIBMIAMUsers() *schema.Resource { } func dataSourceIBMIAMUsersRead(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } client := userManagement.UserInvite() - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount if err != nil { return err diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_account_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_account_settings.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_account_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_account_settings.go index 3d46c5cd59..541e1fa7bc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_account_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_account_settings.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -21,7 +23,7 @@ const ( mfa = "mfa" ) -func resourceIbmIamAccountSettings() *schema.Resource { +func ResourceIBMIAMAccountSettings() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmIamAccountSettingsCreate, ReadContext: resourceIbmIamAccountSettingsRead, @@ -30,83 +32,83 @@ func resourceIbmIamAccountSettings() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "include_history": &schema.Schema{ + "include_history": { Type: schema.TypeBool, Optional: true, Default: false, Description: "Defines if the entity history is included in the response.", }, - "restrict_create_service_id": &schema.Schema{ + "restrict_create_service_id": { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator(accountSettings, restrictCreateServiceId), + ValidateFunc: validate.InvokeValidator(accountSettings, restrictCreateServiceId), Description: "Defines whether or not creating a Service Id is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", }, - "restrict_create_platform_apikey": &schema.Schema{ + "restrict_create_platform_apikey": { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator(accountSettings, restrictCreateApiKey), + ValidateFunc: validate.InvokeValidator(accountSettings, restrictCreateApiKey), Description: "Defines whether or not creating platform API keys is access controlled. Valid values: * RESTRICTED - to apply access control * NOT_RESTRICTED - to remove access control * NOT_SET - to 'unset' a previous set value.", }, - "allowed_ip_addresses": &schema.Schema{ + "allowed_ip_addresses": { Type: schema.TypeString, Optional: true, Description: "Defines the IP addresses and subnets from which IAM tokens can be created for the account.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Version of the account settings.", }, - "mfa": &schema.Schema{ + "mfa": { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator(accountSettings, mfa), + ValidateFunc: validate.InvokeValidator(accountSettings, mfa), Description: "Defines the MFA trait for the account. Valid values: * NONE - No MFA trait set * TOTP - For all non-federated IBMId users * TOTP4ALL - For all users * LEVEL1 - Email-based MFA for all users * LEVEL2 - TOTP-based MFA for all users * LEVEL3 - U2F MFA for all users.", }, - "if_match": &schema.Schema{ + "if_match": { Type: schema.TypeString, Optional: true, Default: "*", Description: "Version of the account settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the account. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.", }, - "history": &schema.Schema{ + "history": { Type: schema.TypeList, Computed: true, Description: "History of the Account Settings.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "timestamp": &schema.Schema{ + "timestamp": { Type: schema.TypeString, Required: true, Description: "Timestamp when the action was triggered.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Required: true, Description: "IAM ID of the identity which triggered the action.", }, - "iam_id_account": &schema.Schema{ + "iam_id_account": { Type: schema.TypeString, Required: true, Description: "Account of the identity which triggered the action.", }, - "action": &schema.Schema{ + "action": { Type: schema.TypeString, Required: true, Description: "Action of the history entry.", }, - "params": &schema.Schema{ + "params": { Type: schema.TypeList, Required: true, Description: "Params of the history entry.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "message": &schema.Schema{ + "message": { Type: schema.TypeString, Required: true, Description: "Message which summarizes the executed action.", @@ -114,19 +116,19 @@ func resourceIbmIamAccountSettings() *schema.Resource { }, }, }, - "session_expiration_in_seconds": &schema.Schema{ + "session_expiration_in_seconds": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default.", }, - "session_invalidation_in_seconds": &schema.Schema{ + "session_invalidation_in_seconds": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: * Any whole number between '900' and '7200' * NOT_SET - To unset account setting and use service default.", }, - "max_sessions_per_identity": &schema.Schema{ + "max_sessions_per_identity": { Type: schema.TypeString, Optional: true, Computed: true, @@ -136,51 +138,51 @@ func resourceIbmIamAccountSettings() *schema.Resource { } } -func resourceIBMIAMAccountSettingsValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMIAMAccountSettingsValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) restrict_values := "RESTRICTED, NOT_RESTRICTED, NOT_SET" mfa_values := "NONE, TOTP, TOTP4ALL, LEVEL1, LEVEL2, LEVEL3" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: restrictCreateServiceId, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: restrict_values}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: restrictCreateApiKey, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: restrict_values}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: mfa, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: mfa_values}) - ibmIAMAccountSettingsValidator := ResourceValidator{ResourceName: "ibm_iam_account_settings", Schema: validateSchema} + ibmIAMAccountSettingsValidator := validate.ResourceValidator{ResourceName: "ibm_iam_account_settings", Schema: validateSchema} return &ibmIAMAccountSettingsValidator } func resourceIbmIamAccountSettingsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } getAccountSettingsOptions := &iamidentityv1.GetAccountSettingsOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } - getAccountSettingsOptions.SetAccountID(userDetails.userAccount) + getAccountSettingsOptions.SetAccountID(userDetails.UserAccount) if _, ok := d.GetOk("include_history"); ok { getAccountSettingsOptions.SetIncludeHistory(d.Get("include_history").(bool)) } @@ -191,13 +193,13 @@ func resourceIbmIamAccountSettingsCreate(context context.Context, d *schema.Reso return diag.FromErr(err) } - d.SetId(fmt.Sprintf("%s", *accountSettingsResponse.AccountID)) + d.SetId(*accountSettingsResponse.AccountID) return resourceIbmIamAccountSettingsUpdate(context, d, meta) } func resourceIbmIamAccountSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -218,19 +220,19 @@ func resourceIbmIamAccountSettingsRead(context context.Context, d *schema.Resour } if err = d.Set("restrict_create_service_id", accountSettingsResponse.RestrictCreateServiceID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting restrict_create_service_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting restrict_create_service_id: %s", err)) } if err = d.Set("restrict_create_platform_apikey", accountSettingsResponse.RestrictCreatePlatformApikey); err != nil { - return diag.FromErr(fmt.Errorf("Error setting restrict_create_platform_apikey: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting restrict_create_platform_apikey: %s", err)) } if err = d.Set("allowed_ip_addresses", accountSettingsResponse.AllowedIPAddresses); err != nil { - return diag.FromErr(fmt.Errorf("Error setting allowed_ip_addresses: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting allowed_ip_addresses: %s", err)) } if err = d.Set("entity_tag", accountSettingsResponse.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } if err = d.Set("mfa", accountSettingsResponse.Mfa); err != nil { - return diag.FromErr(fmt.Errorf("Error setting mfa: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting mfa: %s", err)) } if accountSettingsResponse.History != nil { history := []map[string]interface{}{} @@ -239,17 +241,17 @@ func resourceIbmIamAccountSettingsRead(context context.Context, d *schema.Resour history = append(history, historyItemMap) } if err = d.Set("history", history); err != nil { - return diag.FromErr(fmt.Errorf("Error setting history: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting history: %s", err)) } } if err = d.Set("session_expiration_in_seconds", accountSettingsResponse.SessionExpirationInSeconds); err != nil { - return diag.FromErr(fmt.Errorf("Error setting session_expiration_in_seconds: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting session_expiration_in_seconds: %s", err)) } if err = d.Set("session_invalidation_in_seconds", accountSettingsResponse.SessionInvalidationInSeconds); err != nil { - return diag.FromErr(fmt.Errorf("Error setting session_invalidation_in_seconds: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting session_invalidation_in_seconds: %s", err)) } if err = d.Set("max_sessions_per_identity", accountSettingsResponse.MaxSessionsPerIdentity); err != nil { - return diag.FromErr(fmt.Errorf("Error setting max_sessions_per_identity: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting max_sessions_per_identity: %s", err)) } return nil @@ -269,7 +271,7 @@ func resourceIbmIamAccountSettingsEnityHistoryRecordToMap(enityHistoryRecord iam } func resourceIbmIamAccountSettingsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_api_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_api_key.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_api_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_api_key.go index e4abd518d5..326e8ac3fe 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_api_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_api_key.go @@ -1,20 +1,22 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func resourceIbmIamApiKey() *schema.Resource { +func ResourceIBMIAMApiKey() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmIamApiKeyCreate, ReadContext: resourceIbmIamApiKeyRead, @@ -23,81 +25,81 @@ func resourceIbmIamApiKey() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the API key.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "The iam_id that this API key authenticates.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "The optional description of the API key. The 'description' property is only available if a description was provided during a create of an API key.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The account ID of the API key.", }, - "apikey": &schema.Schema{ + "apikey": { Type: schema.TypeString, Optional: true, Computed: true, Sensitive: true, Description: "You can optionally passthrough the API key value for this API key. If passed, NO validation of that apiKey value is done, i.e. the value can be non-URL safe. If omitted, the API key management will create an URL safe opaque API key value. The value of the API key is checked for uniqueness. Please ensure enough variations when passing in this value.", }, - "store_value": &schema.Schema{ + "store_value": { Type: schema.TypeBool, Optional: true, Description: "Send true or false to set whether the API key value is retrievable in the future by using the Get details of an API key request. If you create an API key for a user, you must specify `false` or omit the value. We don't allow storing of API keys for users.", }, - "file": &schema.Schema{ + "file": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "File where api key is to be stored", }, - "entity_lock": &schema.Schema{ + "entity_lock": { Type: schema.TypeString, Optional: true, Default: "false", Description: "Indicates if the API key is locked for further write operations. False by default.", }, - "apikey_id": &schema.Schema{ + "apikey_id": { Type: schema.TypeString, Computed: true, Description: "Unique identifier of this API Key.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'.", }, - "locked": &schema.Schema{ + "locked": { Type: schema.TypeBool, Computed: true, Description: "The API key cannot be changed if set to true.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the user or service which created the API key.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", @@ -107,19 +109,19 @@ func resourceIbmIamApiKey() *schema.Resource { } func resourceIbmIamApiKeyCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } createApiKeyOptions := &iamidentityv1.CreateAPIKeyOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } - iamID := userDetails.userID - accountID := userDetails.userAccount + iamID := userDetails.UserID + accountID := userDetails.UserAccount createApiKeyOptions.SetName(d.Get("name").(string)) createApiKeyOptions.SetIamID(iamID) @@ -157,7 +159,7 @@ func resourceIbmIamApiKeyCreate(context context.Context, d *schema.ResourceData, } func resourceIbmIamApiKeyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -177,44 +179,44 @@ func resourceIbmIamApiKeyRead(context context.Context, d *schema.ResourceData, m } if err = d.Set("name", apiKey.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("iam_id", apiKey.IamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting iam_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting iam_id: %s", err)) } if err = d.Set("description", apiKey.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("account_id", apiKey.AccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) } if err = d.Set("locked", apiKey.Locked); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_lock: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_lock: %s", err)) } if err = d.Set("apikey_id", apiKey.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } if err = d.Set("entity_tag", apiKey.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } if err = d.Set("crn", apiKey.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("created_at", apiKey.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", apiKey.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if err = d.Set("modified_at", apiKey.ModifiedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } return nil } func resourceIbmIamApiKeyUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -237,7 +239,7 @@ func resourceIbmIamApiKeyUpdate(context context.Context, d *schema.ResourceData, } func resourceIbmIamApiKeyDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_api_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_service_api_key.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_api_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_service_api_key.go index df986516ee..8a89c7adae 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_api_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_service_api_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "encoding/json" @@ -10,12 +10,14 @@ import ( "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" homedir "github.com/mitchellh/go-homedir" ) -func resourceIBMIAMServiceAPIKey() *schema.Resource { +func ResourceIBMIAMServiceAPIKey() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMServiceAPIkeyCreate, Read: resourceIBMIAMServiceAPIKeyRead, @@ -63,21 +65,21 @@ func resourceIBMIAMServiceAPIKey() *schema.Resource { "locked": { Type: schema.TypeBool, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "The API key cannot be changed if set to true", }, "store_value": { Type: schema.TypeBool, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Boolean value deciding whether API key value is retrievable in the future", }, "file": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "File where api key is to be stored", }, @@ -123,7 +125,7 @@ type APIKey struct { } func resourceIBMIAMServiceAPIkeyCreate(d *schema.ResourceData, meta interface{}) error { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -141,11 +143,11 @@ func resourceIBMIAMServiceAPIkeyCreate(d *schema.ResourceData, meta interface{}) createAPIKeyOptions.Description = &desString } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - createAPIKeyOptions.AccountID = &userDetails.userAccount + createAPIKeyOptions.AccountID = &userDetails.UserAccount if key, ok := d.GetOk("apikey"); ok { apikeyString := key.(string) @@ -180,7 +182,7 @@ func resourceIBMIAMServiceAPIkeyCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMIAMServiceAPIKeyRead(d *schema.ResourceData, meta interface{}) error { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -237,7 +239,7 @@ func resourceIBMIAMServiceAPIKeyRead(d *schema.ResourceData, meta interface{}) e func resourceIBMIAMServiceAPIKeyUpdate(d *schema.ResourceData, meta interface{}) error { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -282,7 +284,7 @@ func resourceIBMIAMServiceAPIKeyUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMIAMServiceAPIKeyDelete(d *schema.ResourceData, meta interface{}) error { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -315,7 +317,7 @@ func resourceIBMIAMServiceAPIKeyDelete(d *schema.ResourceData, meta interface{}) } func resourceIBMIAMServiceAPIKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return false, err } @@ -330,7 +332,7 @@ func resourceIBMIAMServiceAPIKeyExists(d *schema.ResourceData, meta interface{}) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error retrieving Service API Key: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error retrieving Service API Key: %s\n%s", err, response) } return *apiKey.ID == apiKeyID, nil } @@ -338,7 +340,7 @@ func resourceIBMIAMServiceAPIKeyExists(d *schema.ResourceData, meta interface{}) func saveToFile(apiKey *iamidentityv1.APIKey, filePath string) error { outputFilePath, err := homedir.Expand(filePath) if err != nil { - return fmt.Errorf("Error generating API Key file path: %s", err) + return fmt.Errorf("[ERROR] Error generating API Key file path: %s", err) } key := &APIKey{ @@ -353,7 +355,7 @@ func saveToFile(apiKey *iamidentityv1.APIKey, filePath string) error { key.Description = "" } - out, err := json.MarshalIndent(key, "", "\t") + out, _ := json.MarshalIndent(key, "", "\t") err = ioutil.WriteFile(outputFilePath, out, 0666) if err == nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_id.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_service_id.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_id.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_service_id.go index 9b05299757..c269a677e0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_id.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_service_id.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" + "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMIAMServiceID() *schema.Resource { +func ResourceIBMIAMServiceID() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMIAMServiceIDCreate, ReadContext: resourceIBMIAMServiceIDRead, @@ -66,21 +68,21 @@ func resourceIBMIAMServiceID() *schema.Resource { } func resourceIBMIAMServiceIDCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } name := d.Get("name").(string) - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } createServiceIDOptions := iamidentityv1.CreateServiceIDOptions{ Name: &name, - AccountID: &userDetails.userAccount, + AccountID: &userDetails.UserAccount, } if d, ok := d.GetOk("description"); ok { @@ -91,7 +93,7 @@ func resourceIBMIAMServiceIDCreate(context context.Context, d *schema.ResourceDa serviceID, resp, err := iamIdentityClient.CreateServiceID(&createServiceIDOptions) if err != nil || serviceID == nil { log.Printf("Error creating serviceID: %s, %s", err, resp) - return diag.FromErr(err) + return diag.FromErr(fmt.Errorf("[ERROR] Error creating serviceID: %s %s", err, resp)) } d.SetId(*serviceID.ID) @@ -99,7 +101,7 @@ func resourceIBMIAMServiceIDCreate(context context.Context, d *schema.ResourceDa } func resourceIBMIAMServiceIDRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -114,7 +116,7 @@ func resourceIBMIAMServiceIDRead(context context.Context, d *schema.ResourceData return nil } log.Printf("Error retrieving serviceID: %s %s", err, resp) - return diag.FromErr(err) + return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving serviceID: %s %s", err, resp)) } if serviceID.Name != nil { d.Set("name", *serviceID.Name) @@ -139,7 +141,7 @@ func resourceIBMIAMServiceIDRead(context context.Context, d *schema.ResourceData func resourceIBMIAMServiceIDUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -168,7 +170,7 @@ func resourceIBMIAMServiceIDUpdate(context context.Context, d *schema.ResourceDa _, resp, err := iamIdentityClient.UpdateServiceID(&updateServiceIDOptions) if err != nil { log.Printf("Error updating serviceID: %s, %s", err, resp) - return diag.FromErr(err) + return diag.FromErr(fmt.Errorf("[ERROR] Error updating serviceID: %s %s", err, resp)) } } @@ -177,7 +179,7 @@ func resourceIBMIAMServiceIDUpdate(context context.Context, d *schema.ResourceDa } func resourceIBMIAMServiceIDDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -189,7 +191,7 @@ func resourceIBMIAMServiceIDDelete(context context.Context, d *schema.ResourceDa resp, err := iamIdentityClient.DeleteServiceID(&deleteServiceIDOptions) if err != nil { log.Printf("Error deleting serviceID: %s %s", err, resp) - return diag.FromErr(err) + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting serviceID: %s %s", err, resp)) } d.SetId("") diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile.go index df1f5ae4ba..0d4e73aaf2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile.go @@ -1,20 +1,22 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func resourceIBMIamTrustedProfile() *schema.Resource { +func ResourceIBMIAMTrustedProfile() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMIamTrustedProfileCreate, ReadContext: resourceIBMIamTrustedProfileRead, @@ -23,94 +25,94 @@ func resourceIBMIamTrustedProfile() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "Name of the trusted profile. The name is checked for uniqueness. Therefore trusted profiles with the same names can not exist in the same account.", }, - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Computed: true, Description: "The account ID of the trusted profile.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "The optional description of the trusted profile. The 'description' property is only available if a description was provided during creation of trusted profile.", }, - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Computed: true, Description: "Unique identifier of this trusted profile.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "Version of the trusted profile details object. You need to specify this value when updating the trusted profile to avoid stale updates.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "The iam_id of this trusted profile.", }, - "ims_account_id": &schema.Schema{ + "ims_account_id": { Type: schema.TypeInt, Computed: true, Description: "IMS acount ID of the trusted profile.", }, - "ims_user_id": &schema.Schema{ + "ims_user_id": { Type: schema.TypeInt, Computed: true, Description: "IMS user ID of the trusted profile.", }, - "history": &schema.Schema{ + "history": { Type: schema.TypeList, Computed: true, Description: "History of the trusted profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "timestamp": &schema.Schema{ + "timestamp": { Type: schema.TypeString, Computed: true, Description: "Timestamp when the action was triggered.", }, - "iam_id": &schema.Schema{ + "iam_id": { Type: schema.TypeString, Computed: true, Description: "IAM ID of the identity which triggered the action.", }, - "iam_id_account": &schema.Schema{ + "iam_id_account": { Type: schema.TypeString, Computed: true, Description: "Account of the identity which triggered the action.", }, - "action": &schema.Schema{ + "action": { Type: schema.TypeString, Computed: true, Description: "Action of the history entry.", }, - "params": &schema.Schema{ + "params": { Type: schema.TypeList, Computed: true, Description: "Params of the history entry.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "message": &schema.Schema{ + "message": { Type: schema.TypeString, Computed: true, Description: "Message which summarizes the executed action.", @@ -123,19 +125,19 @@ func resourceIBMIamTrustedProfile() *schema.Resource { } func resourceIBMIamTrustedProfileCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } createProfileOptions := &iamidentityv1.CreateProfileOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount createProfileOptions.SetName(d.Get("name").(string)) createProfileOptions.SetAccountID(accountID) @@ -155,7 +157,7 @@ func resourceIBMIamTrustedProfileCreate(context context.Context, d *schema.Resou } func resourceIBMIamTrustedProfileRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -175,37 +177,37 @@ func resourceIBMIamTrustedProfileRead(context context.Context, d *schema.Resourc } if err = d.Set("name", trustedProfile.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("account_id", trustedProfile.AccountID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account_id: %s", err)) } if err = d.Set("description", trustedProfile.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("profile_id", trustedProfile.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } if err = d.Set("entity_tag", trustedProfile.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } if err = d.Set("crn", trustedProfile.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } - if err = d.Set("created_at", dateTimeToString(trustedProfile.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(trustedProfile.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } - if err = d.Set("modified_at", dateTimeToString(trustedProfile.ModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + if err = d.Set("modified_at", flex.DateTimeToString(trustedProfile.ModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } if err = d.Set("iam_id", trustedProfile.IamID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting iam_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting iam_id: %s", err)) } - if err = d.Set("ims_account_id", intValue(trustedProfile.ImsAccountID)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ims_account_id: %s", err)) + if err = d.Set("ims_account_id", flex.IntValue(trustedProfile.ImsAccountID)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ims_account_id: %s", err)) } - if err = d.Set("ims_user_id", intValue(trustedProfile.ImsUserID)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ims_user_id: %s", err)) + if err = d.Set("ims_user_id", flex.IntValue(trustedProfile.ImsUserID)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ims_user_id: %s", err)) } history := []map[string]interface{}{} if trustedProfile.History != nil { @@ -215,7 +217,7 @@ func resourceIBMIamTrustedProfileRead(context context.Context, d *schema.Resourc } } if err = d.Set("history", history); err != nil { - return diag.FromErr(fmt.Errorf("Error setting history: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting history: %s", err)) } return nil @@ -275,7 +277,7 @@ func resourceIBMIamTrustedProfileEnityHistoryRecordToMap(enityHistoryRecord iami } func resourceIBMIamTrustedProfileUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -299,7 +301,7 @@ func resourceIBMIamTrustedProfileUpdate(context context.Context, d *schema.Resou } func resourceIBMIamTrustedProfileDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_claim_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile_claim_rule.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_claim_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile_claim_rule.go index cfc0a55342..4ea677a7ca 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_claim_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile_claim_rule.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -20,7 +23,7 @@ const ( iamClaimRuleOperator = "operator" ) -func resourceIBMIamTrustedProfileClaimRule() *schema.Resource { +func ResourceIBMIAMTrustedProfileClaimRule() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMIamTrustedProfileClaimRuleCreate, ReadContext: resourceIBMIamTrustedProfileClaimRuleRead, @@ -29,41 +32,41 @@ func resourceIBMIamTrustedProfileClaimRule() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "ID of the trusted profile to create a claim rule.", }, - "rule_id": &schema.Schema{ + "rule_id": { Type: schema.TypeString, Computed: true, Description: "Unique identifier of this claim rule.", }, - iamClaimRuleType: &schema.Schema{ + iamClaimRuleType: { Type: schema.TypeString, Required: true, Description: "Type of the calim rule, either 'Profile-SAML' or 'Profile-CR'.", - ValidateFunc: validateAllowedStringValue([]string{"Profile-SAML", "Profile-CR"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"Profile-SAML", "Profile-CR"}), }, - "conditions": &schema.Schema{ + "conditions": { Type: schema.TypeList, Required: true, Description: "Conditions of this claim rule.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "claim": &schema.Schema{ + "claim": { Type: schema.TypeString, Required: true, Description: "The claim to evaluate against.", }, - iamClaimRuleOperator: &schema.Schema{ + iamClaimRuleOperator: { Type: schema.TypeString, Required: true, Description: "The operation to perform on the claim. valid values are EQUALS, NOT_EQUALS, EQUALS_IGNORE_CASE, NOT_EQUALS_IGNORE_CASE, CONTAINS, IN.", - ValidateFunc: validateAllowedStringValue([]string{"EQUALS", "NOT_EQUALS", "EQUALS_IGNORE_CASE", "NOT_EQUALS_IGNORE_CASE", "CONTAINS", "IN"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"EQUALS", "NOT_EQUALS", "EQUALS_IGNORE_CASE", "NOT_EQUALS_IGNORE_CASE", "CONTAINS", "IN"}), }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "The stringified JSON value that the claim is compared to using the operator.", @@ -71,37 +74,37 @@ func resourceIBMIamTrustedProfileClaimRule() *schema.Resource { }, }, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the claim rule to be created or updated.", }, - "realm_name": &schema.Schema{ + "realm_name": { Type: schema.TypeString, Optional: true, Description: "The realm name of the Idp this claim rule applies to. This field is required only if the type is specified as 'Profile-SAML'.", }, - "cr_type": &schema.Schema{ + "cr_type": { Type: schema.TypeString, Optional: true, Description: "The compute resource type the rule applies to, required only if type is specified as 'Profile-CR'. Valid values are VSI, IKS_SA, ROKS_SA.", }, - "expiration": &schema.Schema{ + "expiration": { Type: schema.TypeInt, Optional: true, Description: "Session expiration in seconds, only required if type is 'Profile-SAML'.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "version of the claim rule.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", @@ -111,7 +114,7 @@ func resourceIBMIamTrustedProfileClaimRule() *schema.Resource { } func resourceIBMIamTrustedProfileClaimRuleCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -203,13 +206,13 @@ func resourceIBMIamTrustedProfileClaimRuleMapToResponseContext(responseContextMa } func resourceIBMIamTrustedProfileClaimRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { - return diag.FromErr(fmt.Errorf("Invalid ID %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid ID %s", err)) } getClaimRuleOptions := &iamidentityv1.GetClaimRuleOptions{} @@ -227,10 +230,10 @@ func resourceIBMIamTrustedProfileClaimRuleRead(context context.Context, d *schem } if err = d.Set("profile_id", getClaimRuleOptions.ProfileID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting profile_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile_id: %s", err)) } if err = d.Set("type", profileClaimRule.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } conditions := []map[string]interface{}{} for _, conditionsItem := range profileClaimRule.Conditions { @@ -238,31 +241,31 @@ func resourceIBMIamTrustedProfileClaimRuleRead(context context.Context, d *schem conditions = append(conditions, conditionsItemMap) } if err = d.Set("conditions", conditions); err != nil { - return diag.FromErr(fmt.Errorf("Error setting conditions: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting conditions: %s", err)) } if err = d.Set("name", profileClaimRule.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("rule_id", profileClaimRule.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting rule_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting rule_id: %s", err)) } if err = d.Set("realm_name", profileClaimRule.RealmName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting realm_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting realm_name: %s", err)) } if err = d.Set("cr_type", profileClaimRule.CrType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cr_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cr_type: %s", err)) } - if err = d.Set("expiration", intValue(profileClaimRule.Expiration)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting expiration: %s", err)) + if err = d.Set("expiration", flex.IntValue(profileClaimRule.Expiration)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting expiration: %s", err)) } if err = d.Set("entity_tag", profileClaimRule.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } - if err = d.Set("created_at", dateTimeToString(profileClaimRule.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(profileClaimRule.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } - if err = d.Set("modified_at", dateTimeToString(profileClaimRule.ModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + if err = d.Set("modified_at", flex.DateTimeToString(profileClaimRule.ModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } return nil @@ -319,13 +322,13 @@ func resourceIBMIamTrustedProfileClaimRuleResponseContextToMap(responseContext i } func resourceIBMIamTrustedProfileClaimRuleUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { - return diag.FromErr(fmt.Errorf("Invalid ID %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid ID %s", err)) } updateClaimRuleOptions := &iamidentityv1.UpdateClaimRuleOptions{} @@ -364,13 +367,13 @@ func resourceIBMIamTrustedProfileClaimRuleUpdate(context context.Context, d *sch } func resourceIBMIamTrustedProfileClaimRuleDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { - return diag.FromErr(fmt.Errorf("Invalid ID %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid ID %s", err)) } deleteClaimRuleOptions := &iamidentityv1.DeleteClaimRuleOptions{} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_link.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile_link.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_link.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile_link.go index ea0c2bc9a1..216b6e8239 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_link.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_trusted_profile_link.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +17,7 @@ import ( "github.com/IBM/platform-services-go-sdk/iamidentityv1" ) -func resourceIBMIamTrustedProfileLink() *schema.Resource { +func ResourceIBMIAMTrustedProfileLink() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMIamTrustedProfileLinkCreate, ReadContext: resourceIBMIamTrustedProfileLinkRead, @@ -23,19 +25,19 @@ func resourceIBMIamTrustedProfileLink() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "ID of the trusted profile.", }, - "cr_type": &schema.Schema{ + "cr_type": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.", }, - "link": &schema.Schema{ + "link": { Type: schema.TypeList, MinItems: 1, MaxItems: 1, @@ -44,17 +46,17 @@ func resourceIBMIamTrustedProfileLink() *schema.Resource { Description: "Link details.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Required: true, Description: "The CRN of the compute resource.", }, - "namespace": &schema.Schema{ + "namespace": { Type: schema.TypeString, Optional: true, Description: "The compute resource namespace, only required if cr_type is IKS_SA or ROKS_SA.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.", @@ -62,28 +64,28 @@ func resourceIBMIamTrustedProfileLink() *schema.Resource { }, }, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "Optional name of the Link.", }, - "link_id": &schema.Schema{ + "link_id": { Type: schema.TypeString, Computed: true, Description: "Unique identifier of this link.", }, - "entity_tag": &schema.Schema{ + "entity_tag": { Type: schema.TypeString, Computed: true, Description: "version of the claim rule.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the creation date in ISO format.", }, - "modified_at": &schema.Schema{ + "modified_at": { Type: schema.TypeString, Computed: true, Description: "If set contains a date time string of the last modification date in ISO format.", @@ -93,7 +95,7 @@ func resourceIBMIamTrustedProfileLink() *schema.Resource { } func resourceIBMIamTrustedProfileLinkCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } @@ -132,13 +134,13 @@ func resourceIBMIamTrustedProfileLinkMapToCreateProfileLinkRequestLink(createPro } func resourceIBMIamTrustedProfileLinkRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { - return diag.FromErr(fmt.Errorf("Invalid ID %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid ID %s", err)) } getLinkOptions := &iamidentityv1.GetLinkOptions{} @@ -156,29 +158,29 @@ func resourceIBMIamTrustedProfileLinkRead(context context.Context, d *schema.Res } if err = d.Set("profile_id", getLinkOptions.ProfileID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting profile_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile_id: %s", err)) } if err = d.Set("cr_type", profileLink.CrType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cr_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cr_type: %s", err)) } linkMap := resourceIBMIamTrustedProfileLinkCreateProfileLinkRequestLinkToMap(*profileLink.Link) if err = d.Set("link", []map[string]interface{}{linkMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting link: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting link: %s", err)) } if err = d.Set("name", profileLink.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("link_id", profileLink.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } if err = d.Set("entity_tag", profileLink.EntityTag); err != nil { - return diag.FromErr(fmt.Errorf("Error setting entity_tag: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting entity_tag: %s", err)) } - if err = d.Set("created_at", dateTimeToString(profileLink.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(profileLink.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } - if err = d.Set("modified_at", dateTimeToString(profileLink.ModifiedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting modified_at: %s", err)) + if err = d.Set("modified_at", flex.DateTimeToString(profileLink.ModifiedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_at: %s", err)) } return nil @@ -197,13 +199,13 @@ func resourceIBMIamTrustedProfileLinkCreateProfileLinkRequestLinkToMap(createPro } func resourceIBMIamTrustedProfileLinkDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - iamIdentityClient, err := meta.(ClientSession).IAMIdentityV1API() + iamIdentityClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { - return diag.FromErr(fmt.Errorf("Invalid ID %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid ID %s", err)) } deleteLinkOptions := &iamidentityv1.DeleteLinkOptions{} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_user_settings.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_settings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_user_settings.go index c10cd0acd1..9f32986d30 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_settings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity/resource_ibm_iam_user_settings.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iamidentity import ( "fmt" "strings" v2 "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +18,7 @@ const ( iamUserSettingAllowedIPAddresses = "allowed_ip_addresses" ) -func resourceIBMUserSettings() *schema.Resource { +func ResourceIBMIAMUserSettings() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMUserSettingsCreate, Read: resourceIBMIAMUserSettingsRead, @@ -46,7 +48,7 @@ func resourceIBMUserSettings() *schema.Resource { } func resourceIBMIAMUserSettingsCreate(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -60,7 +62,7 @@ func resourceIBMIAMUserSettingsCreate(d *schema.ResourceData, meta interface{}) return err } - iamID, err := getIBMUniqueId(accountID, userEmail, meta) + iamID, err := flex.GetIBMUniqueId(accountID, userEmail, meta) if err != nil { return err } @@ -79,7 +81,7 @@ func resourceIBMIAMUserSettingsCreate(d *schema.ResourceData, meta interface{}) _, UserSettingError := client.ManageUserSettings(accountID, iamID, UserSettingsPayload) if UserSettingError != nil && !strings.Contains(UserSettingError.Error(), "EmptyResponseBody") { - return fmt.Errorf("Error occured during user settings: %s", UserSettingError) + return fmt.Errorf("[ERROR] Error occured during user settings: %s", UserSettingError) } d.SetId(userEmail) @@ -88,15 +90,15 @@ func resourceIBMIAMUserSettingsCreate(d *schema.ResourceData, meta interface{}) } func getUserAccountID(d *schema.ResourceData, meta interface{}) (string, error) { - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return "", err } - return userDetails.userAccount, nil + return userDetails.UserAccount, nil } func resourceIBMIAMUserSettingsRead(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -107,7 +109,7 @@ func resourceIBMIAMUserSettingsRead(d *schema.ResourceData, meta interface{}) er return err } - iamID, err := getIBMUniqueId(accountID, d.Id(), meta) + iamID, err := flex.GetIBMUniqueId(accountID, d.Id(), meta) if err != nil { return err } @@ -126,7 +128,7 @@ func resourceIBMIAMUserSettingsRead(d *schema.ResourceData, meta interface{}) er func resourceIBMIAMUserSettingsUpdate(d *schema.ResourceData, meta interface{}) error { // validate change - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -137,7 +139,7 @@ func resourceIBMIAMUserSettingsUpdate(d *schema.ResourceData, meta interface{}) return err } - iamID, err := getIBMUniqueId(accountID, d.Id(), meta) + iamID, err := flex.GetIBMUniqueId(accountID, d.Id(), meta) if err != nil { return err } @@ -161,7 +163,7 @@ func resourceIBMIAMUserSettingsUpdate(d *schema.ResourceData, meta interface{}) if hasChanged { _, UserSettingError := client.ManageUserSettings(accountID, iamID, userSettingPayload) if UserSettingError != nil && !strings.Contains(UserSettingError.Error(), "EmptyResponseBody") { - return fmt.Errorf("Error occured during user settings: %s", UserSettingError) + return fmt.Errorf("[ERROR] Error occured during user settings: %s", UserSettingError) } } @@ -169,7 +171,7 @@ func resourceIBMIAMUserSettingsUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMIAMUserSettingsDelete(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -180,7 +182,7 @@ func resourceIBMIAMUserSettingsDelete(d *schema.ResourceData, meta interface{}) return err } - iamID, err := getIBMUniqueId(accountID, d.Id(), meta) + iamID, err := flex.GetIBMUniqueId(accountID, d.Id(), meta) if err != nil { return err } @@ -189,14 +191,14 @@ func resourceIBMIAMUserSettingsDelete(d *schema.ResourceData, meta interface{}) _, UserSettingError := client.ManageUserSettings(accountID, iamID, userSettingPayload) if UserSettingError != nil && !strings.Contains(UserSettingError.Error(), "EmptyResponseBody") { - return fmt.Errorf("Error occured during user settings: %s", UserSettingError) + return fmt.Errorf("[ERROR] Error occured during user settings: %s", UserSettingError) } return nil } func resourceIBMIAMUserSettingsExists(d *schema.ResourceData, meta interface{}) (bool, error) { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return false, err } @@ -207,7 +209,7 @@ func resourceIBMIAMUserSettingsExists(d *schema.ResourceData, meta interface{}) return false, err } - iamID, err := getIBMUniqueId(accountID, d.Id(), meta) + iamID, err := flex.GetIBMUniqueId(accountID, d.Id(), meta) if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/README.md new file mode 100644 index 0000000000..c966cf944f --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider IAM Policy Management + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the IAM Policy Management resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_access_group_policy) +* IBM API Docs: [IBM API Docs for IAM Policy Management](https://cloud.ibm.com/apidocs/iam-policy-management) +* IBM IAM Policy Management SDK: [IBM SDK for IAM Policy Management](https://github.com/IBM/platform-services-go-sdk/tree/main/iampolicymanagementv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_access_group_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_access_group_policy.go new file mode 100644 index 0000000000..45926a1780 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_access_group_policy.go @@ -0,0 +1,180 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// Data source to find all the policies for an access group in a particular account +func DataSourceIBMIAMAccessGroupPolicy() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMIAMAccessGroupPolicyRead, + + Schema: map[string]*schema.Schema{ + "access_group_id": { + Description: "ID of access group", + Type: schema.TypeString, + Required: true, + }, + "sort": { + Description: "Sort query for policies", + Type: schema.TypeString, + Optional: true, + }, + "policies": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + "roles": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Role names of the policy definition", + }, + "resources": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "service": { + Type: schema.TypeString, + Computed: true, + Description: "Service name of the policy definition", + }, + "resource_instance_id": { + Type: schema.TypeString, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "ID of resource instance of the policy definition", + }, + "region": { + Type: schema.TypeString, + Computed: true, + Description: "Region of the policy definition", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "Resource type of the policy definition", + }, + "resource": { + Type: schema.TypeString, + Computed: true, + Description: "Resource of the policy definition", + }, + "resource_group_id": { + Type: schema.TypeString, + Computed: true, + Description: "ID of the resource group.", + }, + "service_type": { + Type: schema.TypeString, + Optional: true, + Description: "Service type of the policy definition", + }, + }, + }, + }, + "resource_tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Computed: true, + Description: "Operator of attribute.", + }, + }, + }, + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Description of the Policy", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIAMAccessGroupPolicyRead(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + accessGroupId := d.Get("access_group_id").(string) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + accountID := userDetails.UserAccount + + listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ + AccountID: core.StringPtr(accountID), + AccessGroupID: core.StringPtr(accessGroupId), + Type: core.StringPtr("access"), + } + + if v, ok := d.GetOk("sort"); ok { + listPoliciesOptions.Sort = core.StringPtr(v.(string)) + } + + policyList, resp, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) + if err != nil { + return fmt.Errorf("Error listing access group policies: %s, %s", err, resp) + } + + policies := policyList.Policies + accessGroupPolicies := make([]map[string]interface{}, 0, len(policies)) + for _, policy := range policies { + roles := make([]string, len(policy.Roles)) + for i, role := range policy.Roles { + roles[i] = *role.DisplayName + } + resources := flex.FlattenPolicyResource(policy.Resources) + p := map[string]interface{}{ + "id": fmt.Sprintf("%s/%s", accessGroupId, *policy.ID), + "roles": roles, + "resources": resources, + "resource_tags": flex.FlattenPolicyResourceTags(policy.Resources), + } + if policy.Description != nil { + p["description"] = policy.Description + } + accessGroupPolicies = append(accessGroupPolicies, p) + } + d.SetId(accessGroupId) + d.Set("policies", accessGroupPolicies) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_authorization_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_authorization_policies.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_authorization_policies.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_authorization_policies.go index 7cac25bb9d..4d61086bde 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_authorization_policies.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_authorization_policies.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) // Data source to find all the authorization policies in a particular account -func dataSourceIBMIAMAuthorizationPolicies() *schema.Resource { +func DataSourceIBMIAMAuthorizationPolicies() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMAuthorizationPoliciesRead, @@ -120,7 +122,7 @@ func dataSourceIBMIAMAuthorizationPolicies() *schema.Resource { func dataSourceIBMIAMAuthorizationPoliciesRead(d *schema.ResourceData, meta interface{}) error { var accountID string - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -128,11 +130,11 @@ func dataSourceIBMIAMAuthorizationPoliciesRead(d *schema.ResourceData, meta inte if account, ok := d.GetOk("account_id"); ok && account.(string) != "" { accountID = account.(string) } else { - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - accountID = userDetails.userAccount + accountID = userDetails.UserAccount } listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ @@ -147,7 +149,7 @@ func dataSourceIBMIAMAuthorizationPoliciesRead(d *schema.ResourceData, meta inte policyList, resp, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) if err != nil { - return fmt.Errorf("Error listing authorization policies: %s, %s", err, resp) + return fmt.Errorf("[ERROR] Error listing authorization policies: %s, %s", err, resp) } policies := policyList.Policies @@ -164,15 +166,15 @@ func dataSourceIBMIAMAuthorizationPoliciesRead(d *schema.ResourceData, meta inte p := map[string]interface{}{ "id": fmt.Sprintf("%s/%s", accountID, *policy.ID), "roles": roles, - "source_service_name": *getSubjectAttribute("serviceName", source), - "target_service_name": *getResourceAttribute("serviceName", target), - "source_resource_instance_id": *getSubjectAttribute("serviceInstance", source), - "target_resource_instance_id": *getResourceAttribute("serviceInstance", target), - "source_resource_type": *getSubjectAttribute("resourceType", source), - "target_resource_type": *getResourceAttribute("resourceType", target), - "source_service_account": *getSubjectAttribute("accountId", source), - "source_resource_group_id": *getSubjectAttribute("resourceGroupId", source), - "target_resource_group_id": *getResourceAttribute("resourceGroupId", target), + "source_service_name": *flex.GetSubjectAttribute("serviceName", source), + "target_service_name": *flex.GetResourceAttribute("serviceName", target), + "source_resource_instance_id": *flex.GetSubjectAttribute("serviceInstance", source), + "target_resource_instance_id": *flex.GetResourceAttribute("serviceInstance", target), + "source_resource_type": *flex.GetSubjectAttribute("resourceType", source), + "target_resource_type": *flex.GetResourceAttribute("resourceType", target), + "source_service_account": *flex.GetSubjectAttribute("accountId", source), + "source_resource_group_id": *flex.GetSubjectAttribute("resourceGroupId", source), + "target_resource_group_id": *flex.GetResourceAttribute("resourceGroupId", target), } if policy.Description != nil { p["description"] = *policy.Description diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_role_actions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_role_actions.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_role_actions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_role_actions.go index 133c829eeb..9418741074 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_role_actions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_role_actions.go @@ -1,15 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "strings" ) -func datasourceIBMIAMRoleAction() *schema.Resource { +func DataSourceIBMIAMRoleAction() *schema.Resource { return &schema.Resource{ Read: datasourceIBMIAMRoleActionRead, @@ -55,7 +58,7 @@ func datasourceIBMIAMRoleAction() *schema.Resource { } func datasourceIBMIAMRoleActionRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -73,10 +76,10 @@ func datasourceIBMIAMRoleActionRead(d *schema.ResourceData, meta interface{}) er } serviceRoles := roleList.ServiceRoles - d.Set("reader", flattenActionbyDisplayName("Reader", serviceRoles)) - d.Set("manager", flattenActionbyDisplayName("Manager", serviceRoles)) - d.Set("reader_plus", flattenActionbyDisplayName("ReaderPlus", serviceRoles)) - d.Set("writer", flattenActionbyDisplayName("Writer", serviceRoles)) + d.Set("reader", flex.FlattenActionbyDisplayName("Reader", serviceRoles)) + d.Set("manager", flex.FlattenActionbyDisplayName("Manager", serviceRoles)) + d.Set("reader_plus", flex.FlattenActionbyDisplayName("ReaderPlus", serviceRoles)) + d.Set("writer", flex.FlattenActionbyDisplayName("Writer", serviceRoles)) d.Set("actions", flattenRoleActions(serviceRoles)) return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_roles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_roles.go new file mode 100644 index 0000000000..a593f5ebdb --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_roles.go @@ -0,0 +1,87 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMIAMRole() *schema.Resource { + return &schema.Resource{ + Read: datasourceIBMIAMRoleRead, + + Schema: map[string]*schema.Schema{ + "service": { + Type: schema.TypeString, + Optional: true, + Description: "The Service Name", + ForceNew: true, + }, + "roles": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } + +} + +func datasourceIBMIAMRoleRead(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + var serviceName string + var customRoles []iampolicymanagementv1.CustomRole + var serviceRoles, systemRoles []iampolicymanagementv1.Role + + listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ + AccountID: &userDetails.UserAccount, + } + + if service, ok := d.GetOk("service"); ok { + serviceName = service.(string) + listRoleOptions.ServiceName = &serviceName + } + roleList, _, err := iamPolicyManagementClient.ListRoles(listRoleOptions) + if err != nil { + return err + } + customRoles = roleList.CustomRoles + serviceRoles = roleList.ServiceRoles + systemRoles = roleList.SystemRoles + + d.SetId(userDetails.UserAccount) + + roles := append(flex.FlattenRoleData(systemRoles, "platform"), append(flex.FlattenRoleData(serviceRoles, "service"), flex.FlattenCustomRoleData(customRoles, "custom")...)...) + + d.Set("roles", roles) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_service_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_service_policy.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_service_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_service_policy.go index 6733aad4d6..97a65951b7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_service_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_service_policy.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" @@ -14,7 +16,7 @@ import ( ) // Data source to find all the policies for a serviceID -func dataSourceIBMIAMServicePolicy() *schema.Resource { +func DataSourceIBMIAMServicePolicy() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMServicePolicyRead, @@ -95,6 +97,30 @@ func dataSourceIBMIAMServicePolicy() *schema.Resource { }, }, }, + "resource_tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Computed: true, + Description: "Operator of attribute.", + }, + }, + }, + }, "description": { Type: schema.TypeString, Computed: true, @@ -113,7 +139,7 @@ func dataSourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) if v, ok := d.GetOk("iam_service_id"); ok && v != nil { serviceIDUUID := v.(string) - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -130,18 +156,18 @@ func dataSourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) iamID = v.(string) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ - AccountID: core.StringPtr(userDetails.userAccount), + AccountID: core.StringPtr(userDetails.UserAccount), IamID: core.StringPtr(iamID), Type: core.StringPtr("access"), } @@ -150,11 +176,12 @@ func dataSourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) listPoliciesOptions.Sort = core.StringPtr(v.(string)) } - policyList, _, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) - policies := policyList.Policies + policyList, resp, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) + if err != nil { - return err + return fmt.Errorf("Error listing service policies: %s, %s", err, resp) } + policies := policyList.Policies servicePolicies := make([]map[string]interface{}, 0, len(policies)) for _, policy := range policies { @@ -162,10 +189,11 @@ func dataSourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) for i, role := range policy.Roles { roles[i] = *role.DisplayName } - resources := flattenPolicyResource(policy.Resources) + resources := flex.FlattenPolicyResource(policy.Resources) p := map[string]interface{}{ - "roles": roles, - "resources": resources, + "roles": roles, + "resources": resources, + "resource_tags": flex.FlattenPolicyResourceTags(policy.Resources), } if v, ok := d.GetOk("iam_service_id"); ok && v != nil { serviceIDUUID := v.(string) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_trusted_profile_policy.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_trusted_profile_policy.go index f0b71a1661..168de74ecc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_iam_trusted_profile_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_trusted_profile_policy.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" @@ -14,7 +16,7 @@ import ( ) // Data source to find all the policies for a trusted profile -func dataSourceIBMIAMTrustedProfilePolicy() *schema.Resource { +func DataSourceIBMIAMTrustedProfilePolicy() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMIAMTrustedProfilePolicyRead, @@ -95,6 +97,30 @@ func dataSourceIBMIAMTrustedProfilePolicy() *schema.Resource { }, }, }, + "resource_tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Computed: true, + Description: "Operator of attribute.", + }, + }, + }, + }, "description": { Type: schema.TypeString, Computed: true, @@ -113,7 +139,7 @@ func dataSourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta inter if v, ok := d.GetOk("profile_id"); ok && v != nil { profileUUID := v.(string) - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -130,18 +156,18 @@ func dataSourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta inter iamID = v.(string) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ - AccountID: core.StringPtr(userDetails.userAccount), + AccountID: core.StringPtr(userDetails.UserAccount), IamID: core.StringPtr(iamID), Type: core.StringPtr("access"), } @@ -150,22 +176,23 @@ func dataSourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta inter listPoliciesOptions.Sort = core.StringPtr(v.(string)) } - policyList, _, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) - policies := policyList.Policies + policyList, resp, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) if err != nil { - return err + return fmt.Errorf("Error listing trusted profile policies: %s, %s", err, resp) } + policies := policyList.Policies profilePolicies := make([]map[string]interface{}, 0, len(policies)) for _, policy := range policies { roles := make([]string, len(policy.Roles)) for i, role := range policy.Roles { roles[i] = *role.DisplayName } - resources := flattenPolicyResource(policy.Resources) + resources := flex.FlattenPolicyResource(policy.Resources) p := map[string]interface{}{ - "roles": roles, - "resources": resources, + "roles": roles, + "resources": resources, + "resource_tags": flex.FlattenPolicyResourceTags(policy.Resources), } if v, ok := d.GetOk("profile_id"); ok && v != nil { profileUUID := v.(string) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_user_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_user_policy.go new file mode 100644 index 0000000000..8ddb06a372 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/data_source_ibm_iam_user_policy.go @@ -0,0 +1,186 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// Data source to find all the policies for a user in a particular account +func DataSourceIBMIAMUserPolicy() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMIAMUserPolicyRead, + + Schema: map[string]*schema.Schema{ + "ibm_id": { + Description: "The ibm id or email of user", + Type: schema.TypeString, + Required: true, + }, + "sort": { + Description: "Sort query for policies", + Type: schema.TypeString, + Optional: true, + }, + "policies": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + "roles": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Role names of the policy definition", + }, + "resources": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "service": { + Type: schema.TypeString, + Computed: true, + Description: "Service name of the policy definition", + }, + "resource_instance_id": { + Type: schema.TypeString, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "ID of resource instance of the policy definition", + }, + "region": { + Type: schema.TypeString, + Computed: true, + Description: "Region of the policy definition", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "Resource type of the policy definition", + }, + "resource": { + Type: schema.TypeString, + Computed: true, + Description: "Resource of the policy definition", + }, + "resource_group_id": { + Type: schema.TypeString, + Computed: true, + Description: "ID of the resource group.", + }, + "service_type": { + Type: schema.TypeString, + Optional: true, + Description: "Service type of the policy definition", + }, + }, + }, + }, + "resource_tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Computed: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Computed: true, + Description: "Operator of attribute.", + }, + }, + }, + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Description of the Policy", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIAMUserPolicyRead(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + userEmail := d.Get("ibm_id").(string) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + accountID := userDetails.UserAccount + + ibmUniqueID, err := flex.GetIBMUniqueId(accountID, userEmail, meta) + if err != nil { + return err + } + + listPoliciesOptions := &iampolicymanagementv1.ListPoliciesOptions{ + AccountID: core.StringPtr(accountID), + IamID: core.StringPtr(ibmUniqueID), + Type: core.StringPtr("access"), + } + + if v, ok := d.GetOk("sort"); ok { + listPoliciesOptions.Sort = core.StringPtr(v.(string)) + } + + policyList, resp, err := iamPolicyManagementClient.ListPolicies(listPoliciesOptions) + + if err != nil { + return fmt.Errorf("Error listing user policies: %s, %s", err, resp) + } + policies := policyList.Policies + + userPolicies := make([]map[string]interface{}, 0, len(policies)) + for _, policy := range policies { + roles := make([]string, len(policy.Roles)) + for i, role := range policy.Roles { + roles[i] = *role.DisplayName + } + resources := flex.FlattenPolicyResource(policy.Resources) + p := map[string]interface{}{ + "id": fmt.Sprintf("%s/%s", userEmail, *policy.ID), + "roles": roles, + "resources": resources, + "resource_tags": flex.FlattenPolicyResourceTags(policy.Resources), + } + if policy.Description != nil { + p["description"] = policy.Description + } + userPolicies = append(userPolicies, p) + } + d.SetId(userEmail) + d.Set("policies", userPolicies) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_access_group_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_access_group_policy.go new file mode 100644 index 0000000000..3b4981b610 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_access_group_policy.go @@ -0,0 +1,510 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMIAMAccessGroupPolicy() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMIAMAccessGroupPolicyCreate, + Read: resourceIBMIAMAccessGroupPolicyRead, + Update: resourceIBMIAMAccessGroupPolicyUpdate, + Delete: resourceIBMIAMAccessGroupPolicyDelete, + Exists: resourceIBMIAMAccessGroupPolicyExists, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + resources, resourceAttributes, err := importAccessGroupPolicy(d, meta) + if err != nil { + return nil, fmt.Errorf("[ERROR] Error reading resource ID: %s", err) + } + d.Set("resources", resources) + d.Set("resource_attributes", resourceAttributes) + return []*schema.ResourceData{d}, nil + }, + }, + + Schema: map[string]*schema.Schema{ + "access_group_id": { + Type: schema.TypeString, + Required: true, + Description: "ID of access group", + ForceNew: true, + }, + + "roles": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Role names of the policy definition", + }, + + "resources": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + ConflictsWith: []string{"account_management", "resource_attributes"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "service": { + Type: schema.TypeString, + Optional: true, + Description: "Service name of the policy definition", + }, + + "resource_instance_id": { + Type: schema.TypeString, + Optional: true, + Description: "ID of resource instance of the policy definition", + }, + + "region": { + Type: schema.TypeString, + Optional: true, + Description: "Region of the policy definition", + }, + + "resource_type": { + Type: schema.TypeString, + Optional: true, + Description: "Resource type of the policy definition", + }, + + "resource": { + Type: schema.TypeString, + Optional: true, + Description: "Resource of the policy definition", + }, + + "resource_group_id": { + Type: schema.TypeString, + Optional: true, + Description: "ID of the resource group.", + }, + + "service_type": { + Type: schema.TypeString, + Optional: true, + Description: "Service type of the policy definition", + }, + + "attributes": { + Type: schema.TypeMap, + Optional: true, + Description: "Set resource attributes in the form of 'name=value,name=value....", + Elem: schema.TypeString, + }, + }, + }, + }, + + "resource_attributes": { + Type: schema.TypeSet, + Optional: true, + Description: "Set resource attributes.", + ConflictsWith: []string{"resources", "account_management"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + "account_management": { + Type: schema.TypeBool, + Default: false, + Optional: true, + Description: "Give access to all account management services", + ConflictsWith: []string{"resources", "resource_attributes"}, + }, + + "tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + + "resource_tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + + "description": { + Type: schema.TypeString, + Optional: true, + Description: "Description of the Policy", + }, + + "version": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func resourceIBMIAMAccessGroupPolicyCreate(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + accessGroupId := d.Get("access_group_id").(string) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + var policyOptions iampolicymanagementv1.CreatePolicyOptions + policyOptions, err = flex.GeneratePolicyOptions(d, meta) + if err != nil { + return err + } + + // Keep configuring the policy options by adding subject part + accessGroupIdSubject := &iampolicymanagementv1.PolicySubject{ + Attributes: []iampolicymanagementv1.SubjectAttribute{ + { + Name: core.StringPtr("access_group_id"), + Value: &accessGroupId, + }, + }, + } + + accountIdResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("accountId"), + Value: &userDetails.UserAccount, + } + + policyResource := &iampolicymanagementv1.PolicyResource{ + Attributes: append(policyOptions.Resources[0].Attributes, *accountIdResourceAttribute), + Tags: flex.SetTags(d), + } + + createPolicyOptions := iamPolicyManagementClient.NewCreatePolicyOptions( + "access", + []iampolicymanagementv1.PolicySubject{*accessGroupIdSubject}, + policyOptions.Roles, + []iampolicymanagementv1.PolicyResource{*policyResource}, + ) + + if desc, ok := d.GetOk("description"); ok { + des := desc.(string) + createPolicyOptions.Description = &des + } + + accessGroupPolicy, res, err := iamPolicyManagementClient.CreatePolicy(createPolicyOptions) + if err != nil || accessGroupPolicy == nil { + return fmt.Errorf("[ERROR] Error creating access group policy: %s\n%s", err, res) + } + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: accessGroupPolicy.ID, + } + + err = resource.Retry(5*time.Minute, func() *resource.RetryError { + var err error + policy, res, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil || policy == nil { + if res != nil && res.StatusCode == 404 { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + + if conns.IsResourceTimeoutError(err) { + _, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) + } + if err != nil { + d.SetId(fmt.Sprintf("%s/%s", accessGroupId, *accessGroupPolicy.ID)) + return fmt.Errorf("[ERROR] Error fetching access group policy: %s\n%s", err, res) + } + d.SetId(fmt.Sprintf("%s/%s", accessGroupId, *accessGroupPolicy.ID)) + + return resourceIBMIAMAccessGroupPolicyRead(d, meta) +} + +func resourceIBMIAMAccessGroupPolicyRead(d *schema.ResourceData, meta interface{}) error { + + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + accessGroupId := parts[0] + accessGroupPolicyId := parts[1] + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: &accessGroupPolicyId, + } + accessGroupPolicy := &iampolicymanagementv1.Policy{} + res := &core.DetailedResponse{} + err = resource.Retry(5*time.Minute, func() *resource.RetryError { + var err error + accessGroupPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil || accessGroupPolicy == nil { + if res != nil && res.StatusCode == 404 { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + + if conns.IsResourceTimeoutError(err) { + accessGroupPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) + } + if err != nil || accessGroupPolicy == nil { + return fmt.Errorf("[ERROR] Error retrieving access group policy: %s\n%s", err, res) + } + + retrievedAttribute := flex.GetSubjectAttribute("access_group_id", accessGroupPolicy.Subjects[0]) + if accessGroupId != *retrievedAttribute { + return fmt.Errorf("[ERROR] Policy %s does not belong to access group %s, retrievedAttr: %s", accessGroupPolicyId, accessGroupId, *retrievedAttribute) + } + + d.Set("access_group_id", accessGroupId) + roles := make([]string, len(accessGroupPolicy.Roles)) + for i, role := range accessGroupPolicy.Roles { + roles[i] = *role.DisplayName + } + d.Set("roles", roles) + d.Set("version", res.Headers.Get("ETag")) + + if _, ok := d.GetOk("resources"); ok { + d.Set("resources", flex.FlattenPolicyResource(accessGroupPolicy.Resources)) + } + if _, ok := d.GetOk("resource_attributes"); ok { + d.Set("resource_attributes", flex.FlattenPolicyResourceAttributes(accessGroupPolicy.Resources)) + } + + if _, ok := d.GetOk("resource_tags"); ok { + d.Set("resource_tags", flex.FlattenPolicyResourceTags(accessGroupPolicy.Resources)) + } + + if len(accessGroupPolicy.Resources) > 0 { + if *flex.GetResourceAttribute("serviceType", accessGroupPolicy.Resources[0]) == "service" { + d.Set("account_management", false) + } + if *flex.GetResourceAttribute("serviceType", accessGroupPolicy.Resources[0]) == "platform_service" { + d.Set("account_management", true) + } + } + + if accessGroupPolicy.Description != nil { + d.Set("description", *accessGroupPolicy.Description) + } + + return nil +} + +func resourceIBMIAMAccessGroupPolicyUpdate(d *schema.ResourceData, meta interface{}) error { + + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") || d.HasChange("resource_tags") { + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + accessGroupId := parts[0] + accessGroupPolicyId := parts[1] + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + var policyOptions iampolicymanagementv1.CreatePolicyOptions + policyOptions, err = flex.GeneratePolicyOptions(d, meta) + if err != nil { + return err + } + + accessGroupIdSubject := &iampolicymanagementv1.PolicySubject{ + Attributes: []iampolicymanagementv1.SubjectAttribute{ + { + Name: core.StringPtr("access_group_id"), + Value: &accessGroupId, + }, + }, + } + + accountIdResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("accountId"), + Value: &userDetails.UserAccount, + } + + policyResource := &iampolicymanagementv1.PolicyResource{ + Attributes: append(policyOptions.Resources[0].Attributes, *accountIdResourceAttribute), + Tags: flex.SetTags(d), + } + + updatePolicyOptions := iamPolicyManagementClient.NewUpdatePolicyOptions( + accessGroupPolicyId, + d.Get("version").(string), + "access", + []iampolicymanagementv1.PolicySubject{*accessGroupIdSubject}, + policyOptions.Roles, + []iampolicymanagementv1.PolicyResource{*policyResource}, + ) + + if desc, ok := d.GetOk("description"); ok { + des := desc.(string) + updatePolicyOptions.Description = &des + } + + _, res, err := iamPolicyManagementClient.UpdatePolicy(updatePolicyOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error updating access group policy: %s\n%s", err, res) + } + } + + return resourceIBMIAMAccessGroupPolicyRead(d, meta) +} + +func resourceIBMIAMAccessGroupPolicyDelete(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + + accessGroupPolicyId := parts[1] + + deletePolicyOptions := iamPolicyManagementClient.NewDeletePolicyOptions( + accessGroupPolicyId, + ) + + res, err := iamPolicyManagementClient.DeletePolicy(deletePolicyOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error deleting access group policy: %s\n%s", err, res) + } + + d.SetId("") + + return nil +} + +func resourceIBMIAMAccessGroupPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return false, err + } + parts, err := flex.IdParts(d.Id()) + if err != nil { + return false, err + } + if len(parts) < 2 { + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of accessGroupID/PolicyID", d.Id()) + } + + accessGroupPolicyId := parts[1] + + getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( + accessGroupPolicyId, + ) + + accessGroupPolicy, resp, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil || accessGroupPolicy == nil { + if resp != nil && resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error getting access group policy: %s\n%s", err, resp) + } + + if accessGroupPolicy != nil && accessGroupPolicy.State != nil && *accessGroupPolicy.State == "deleted" { + return false, nil + } + + tempID := fmt.Sprintf("%s/%s", *flex.GetSubjectAttribute("access_group_id", accessGroupPolicy.Subjects[0]), *accessGroupPolicy.ID) + + return tempID == d.Id(), nil +} +func importAccessGroupPolicy(d *schema.ResourceData, meta interface{}) (interface{}, interface{}, error) { + + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return nil, nil, err + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return nil, nil, err + } + accgrpPolicyID := parts[1] + + getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( + accgrpPolicyID, + ) + + accessGroupPolicy, res, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil { + return nil, nil, fmt.Errorf("[ERROR] Error retrieving access group policy: %s\n%s", err, res) + } + + resources := flex.FlattenPolicyResource(accessGroupPolicy.Resources) + resource_attributes := flex.FlattenPolicyResourceAttributes(accessGroupPolicy.Resources) + d.Set("resource_tags", flex.FlattenPolicyResourceTags(accessGroupPolicy.Resources)) + + return resources, resource_attributes, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_authorization_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_authorization_policy.go new file mode 100644 index 0000000000..31eef8b95a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_authorization_policy.go @@ -0,0 +1,476 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMIAMAuthorizationPolicy() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMIAMAuthorizationPolicyCreate, + Read: resourceIBMIAMAuthorizationPolicyRead, + Update: resourceIBMIAMAuthorizationPolicyUpdate, + Delete: resourceIBMIAMAuthorizationPolicyDelete, + Exists: resourceIBMIAMAuthorizationPolicyExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "source_service_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"source_service_name", "subject_attributes"}, + Description: "The source service name", + ForceNew: true, + }, + + "target_service_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"target_service_name", "resource_attributes"}, + ForceNew: true, + Description: "The target service name", + }, + + "roles": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Role names of the policy definition", + }, + + "source_resource_instance_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"subject_attributes"}, + Description: "The source resource instance Id", + }, + + "target_resource_instance_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"resource_attributes"}, + Description: "The target resource instance Id", + }, + + "source_resource_group_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"subject_attributes"}, + Description: "The source resource group Id", + }, + + "target_resource_group_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"resource_attributes"}, + Description: "The target resource group Id", + }, + + "source_resource_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ConflictsWith: []string{"subject_attributes"}, + Description: "Resource type of source service", + }, + + "target_resource_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ConflictsWith: []string{"resource_attributes"}, + Description: "Resource type of target service", + }, + + "source_service_account": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"subject_attributes"}, + Description: "Account GUID of source service", + }, + + "subject_attributes": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Set subject attributes.", + ConflictsWith: []string{"source_resource_instance_id", "source_resource_group_id", "source_resource_type", "source_service_account"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + }, + }, + }, + + "resource_attributes": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Set resource attributes.", + ConflictsWith: []string{"target_resource_instance_id", "target_resource_group_id", "target_resource_type"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + + "version": { + Type: schema.TypeString, + Computed: true, + }, + + "description": { + Type: schema.TypeString, + Optional: true, + Description: "Description of the Policy", + }, + }, + } +} + +func resourceIBMIAMAuthorizationPolicyCreate(d *schema.ResourceData, meta interface{}) error { + + var sourceServiceName, targetServiceName string + policyType := "authorization" + policySubject := &iampolicymanagementv1.PolicySubject{} + policyResource := &iampolicymanagementv1.PolicyResource{} + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + iampapClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + // check subject_attributes exists + if attributes, ok := d.GetOk("subject_attributes"); ok { + for _, attribute := range attributes.(*schema.Set).List() { + a := attribute.(map[string]interface{}) + name := a["name"].(string) + value := a["value"].(string) + if name == "serviceName" { + sourceServiceName = value + } + at := iampolicymanagementv1.SubjectAttribute{ + Name: &name, + Value: &value, + } + policySubject.Attributes = append(policySubject.Attributes, at) + } + } else { + + sourceServiceName = d.Get("source_service_name").(string) + + serviceNameSubjectAttribute := &iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("serviceName"), + Value: &sourceServiceName, + } + policySubject.Attributes = append(policySubject.Attributes, *serviceNameSubjectAttribute) + + sourceServiceAccount := userDetails.UserAccount + if account, ok := d.GetOk("source_service_account"); ok { + sourceServiceAccount = account.(string) + } + + accountIdSubjectAttribute := &iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("accountId"), + Value: &sourceServiceAccount, + } + + policySubject.Attributes = append(policySubject.Attributes, *accountIdSubjectAttribute) + + if sID, ok := d.GetOk("source_resource_instance_id"); ok { + serviceInstanceSubjectAttribute := iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("serviceInstance"), + Value: core.StringPtr(sID.(string)), + } + policySubject.Attributes = append(policySubject.Attributes, serviceInstanceSubjectAttribute) + } + + if sType, ok := d.GetOk("source_resource_type"); ok { + resourceTypeSubjectAttribute := iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("resourceType"), + Value: core.StringPtr(sType.(string)), + } + policySubject.Attributes = append(policySubject.Attributes, resourceTypeSubjectAttribute) + } + + if sResGrpID, ok := d.GetOk("source_resource_group_id"); ok { + resourceGroupSubjectAttribute := iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("resourceGroupId"), + Value: core.StringPtr(sResGrpID.(string)), + } + policySubject.Attributes = append(policySubject.Attributes, resourceGroupSubjectAttribute) + } + } + + // check resource_attributes exists + if attributes, ok := d.GetOk("resource_attributes"); ok { + for _, attribute := range attributes.(*schema.Set).List() { + a := attribute.(map[string]interface{}) + name := a["name"].(string) + value := a["value"].(string) + operator := a["operator"].(string) + if name == "serviceName" { + targetServiceName = value + } + at := iampolicymanagementv1.ResourceAttribute{ + Name: &name, + Value: &value, + Operator: &operator, + } + policyResource.Attributes = append(policyResource.Attributes, at) + } + } else { + targetServiceName = d.Get("target_service_name").(string) + serviceNameResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("serviceName"), + Value: core.StringPtr(targetServiceName), + Operator: core.StringPtr("stringEquals"), + } + policyResource.Attributes = append(policyResource.Attributes, *serviceNameResourceAttribute) + + accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("accountId"), + Value: core.StringPtr(userDetails.UserAccount), + Operator: core.StringPtr("stringEquals"), + } + + policyResource.Attributes = append(policyResource.Attributes, *accountIDResourceAttribute) + + if tID, ok := d.GetOk("target_resource_instance_id"); ok { + serviceInstanceResourceAttribute := iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("serviceInstance"), + Value: core.StringPtr(tID.(string)), + } + policyResource.Attributes = append(policyResource.Attributes, serviceInstanceResourceAttribute) + } + + if tType, ok := d.GetOk("target_resource_type"); ok { + resourceTypeResourceAttribute := iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("resourceType"), + Value: core.StringPtr(tType.(string)), + } + policyResource.Attributes = append(policyResource.Attributes, resourceTypeResourceAttribute) + } + + if tResGrpID, ok := d.GetOk("target_resource_group_id"); ok { + resourceGroupResourceAttribute := iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("resourceGroupId"), + Value: core.StringPtr(tResGrpID.(string)), + } + policyResource.Attributes = append(policyResource.Attributes, resourceGroupResourceAttribute) + } + } + + listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ + ServiceName: &targetServiceName, + SourceServiceName: &sourceServiceName, + PolicyType: &policyType, + } + roleList, resp, err := iampapClient.ListRoles(listRoleOptions) + + if err != nil || roleList == nil { + return fmt.Errorf("[ERROR] Error in listing roles %s, %s", err, resp) + } + + policyRoles := flex.MapRoleListToPolicyRoles(*roleList) + roles, err := flex.GetRolesFromRoleNames(flex.ExpandStringList(d.Get("roles").([]interface{})), policyRoles) + + if err != nil { + return err + } + + createPolicyOptions := iampapClient.NewCreatePolicyOptions( + "authorization", + []iampolicymanagementv1.PolicySubject{*policySubject}, + roles, + []iampolicymanagementv1.PolicyResource{*policyResource}, + ) + + if description, ok := d.GetOk("description"); ok { + des := description.(string) + createPolicyOptions.Description = &des + } + + authPolicy, resp, err := iampapClient.CreatePolicy(createPolicyOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error creating authorization policy: %s %s", err, resp) + } + + d.SetId(*authPolicy.ID) + + return resourceIBMIAMAuthorizationPolicyRead(d, meta) +} + +func resourceIBMIAMAuthorizationPolicyRead(d *schema.ResourceData, meta interface{}) error { + + iampapClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: core.StringPtr(d.Id()), + } + + authorizationPolicy, resp, err := iampapClient.GetPolicy(getPolicyOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving authorizationPolicy: %s %s", err, resp) + } + roles := make([]string, len(authorizationPolicy.Roles)) + for i, role := range authorizationPolicy.Roles { + roles[i] = *role.DisplayName + } + if authorizationPolicy.Description != nil { + d.Set("description", *authorizationPolicy.Description) + } + d.Set("roles", roles) + source := authorizationPolicy.Subjects[0] + target := authorizationPolicy.Resources[0] + + d.Set("resource_attributes", setAuthorizationResourceAttributes(target)) + d.Set("target_resource_instance_id", flex.GetResourceAttribute("serviceInstance", target)) + d.Set("target_resource_type", flex.GetResourceAttribute("resourceType", target)) + d.Set("target_resource_group_id", flex.GetResourceAttribute("resourceGroupId", target)) + d.Set("target_service_name", flex.GetResourceAttribute("serviceName", target)) + + d.Set("subject_attributes", setAuthorizationSubjectAttributes(source)) + d.Set("source_service_name", flex.GetSubjectAttribute("serviceName", source)) + d.Set("source_resource_instance_id", flex.GetSubjectAttribute("serviceInstance", source)) + d.Set("source_resource_type", flex.GetSubjectAttribute("resourceType", source)) + d.Set("source_service_account", flex.GetSubjectAttribute("accountId", source)) + d.Set("source_resource_group_id", flex.GetSubjectAttribute("resourceGroupId", source)) + + return nil +} + +// Returns nil, because ibmcloud iam cli authorization policy does not have an update command +func resourceIBMIAMAuthorizationPolicyUpdate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceIBMIAMAuthorizationPolicyDelete(d *schema.ResourceData, meta interface{}) error { + iampapClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + authorizationPolicyID := d.Id() + + deletePolicyOptions := &iampolicymanagementv1.DeletePolicyOptions{ + PolicyID: core.StringPtr(authorizationPolicyID), + } + resp, err := iampapClient.DeletePolicy(deletePolicyOptions) + if err != nil { + log.Printf( + "Error deleting authorization policy: %s, %s", err, resp) + } + + d.SetId("") + + return nil +} + +func resourceIBMIAMAuthorizationPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { + iampapClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return false, err + } + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: core.StringPtr(d.Id()), + } + authorizationPolicy, resp, err := iampapClient.GetPolicy(getPolicyOptions) + if err != nil || authorizationPolicy == nil { + if resp != nil && resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error getting authorisation policy: %s\n%s", err, resp) + } + + if authorizationPolicy != nil && authorizationPolicy.State != nil && *authorizationPolicy.State == "deleted" { + return false, nil + } + + return *authorizationPolicy.ID == d.Id(), nil +} + +func setAuthorizationResourceAttributes(list iampolicymanagementv1.PolicyResource) []map[string]interface{} { + result := make([]map[string]interface{}, 0) + for _, attribute := range list.Attributes { + l := map[string]interface{}{ + "name": attribute.Name, + "value": attribute.Value, + "operator": attribute.Operator, + } + result = append(result, l) + } + return result +} + +func setAuthorizationSubjectAttributes(list iampolicymanagementv1.PolicySubject) []map[string]interface{} { + result := make([]map[string]interface{}, 0) + for _, attribute := range list.Attributes { + l := map[string]interface{}{ + "name": attribute.Name, + "value": attribute.Value, + } + result = append(result, l) + } + return result +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_authorization_policy_detach.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_authorization_policy_detach.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_authorization_policy_detach.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_authorization_policy_detach.go index 77d39166ad..b42ec4f15c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_authorization_policy_detach.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_authorization_policy_detach.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMIAMAuthorizationPolicyDetach() *schema.Resource { +func ResourceIBMIAMAuthorizationPolicyDetach() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMAuthorizationPolicyDetachCreate, Read: resourceIBMIAMAuthorizationPolicyDetachRead, @@ -29,7 +30,7 @@ func resourceIBMIAMAuthorizationPolicyDetach() *schema.Resource { } func resourceIBMIAMAuthorizationPolicyDetachCreate(d *schema.ResourceData, meta interface{}) error { - iampapClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iampapClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -40,7 +41,7 @@ func resourceIBMIAMAuthorizationPolicyDetachCreate(d *schema.ResourceData, meta ) _, err = iampapClient.DeletePolicy(deletePolicyOptions) if err != nil { - return fmt.Errorf("Error detaching authorization policy: %s", err) + return fmt.Errorf("[ERROR] Error detaching authorization policy: %s", err) } d.SetId(time.Now().UTC().String()) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_custom_role.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_custom_role.go new file mode 100644 index 0000000000..116f2ef293 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_custom_role.go @@ -0,0 +1,286 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "fmt" + "strings" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + iamCRDisplayName = "display_name" + iamCRName = "name" + iamCRDescription = "description" + iamCRActions = "actions" + iamCRServiceName = "service" +) + +func ResourceIBMIAMCustomRole() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMIAMCustomRoleCreate, + Read: resourceIBMIAMCustomRoleRead, + Update: resourceIBMIAMCustomRoleUpdate, + Delete: resourceIBMIAMCustomRoleDelete, + Exists: resourceIBMIAMCustomRoleExists, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + iamCRDisplayName: { + Type: schema.TypeString, + Required: true, + Description: "Display Name of the Custom Role", + ValidateFunc: validate.InvokeValidator("ibm_iam_custom_role", iamCRDisplayName), + }, + + iamCRName: { + Type: schema.TypeString, + Required: true, + Description: "The name of the custom Role", + ForceNew: true, + ValidateFunc: validate.InvokeValidator("ibm_iam_custom_role", iamCRName), + }, + iamCRDescription: { + Type: schema.TypeString, + Optional: true, + Description: "The description of the role", + ValidateFunc: validate.InvokeValidator("ibm_iam_custom_role", iamCRDescription), + }, + iamCRServiceName: { + Type: schema.TypeString, + Required: true, + Description: "The Service Name", + ForceNew: true, + }, + iamCRActions: { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "The actions of the role", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "crn of the Custom Role", + }, + flex.ResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + flex.ResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + flex.ResourceControllerURL: { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + }, + }, + } +} + +func ResourceIBMIAMCustomRoleValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: iamCRName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^[A-Z]{1}[A-Za-z0-9]{0,29}$`, + MinValueLength: 1, + MaxValueLength: 30}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: iamCRDisplayName, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, + Optional: true, + MinValueLength: 1, + MaxValueLength: 50}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: iamCRDescription, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, + Optional: true, + MinValueLength: 1, + MaxValueLength: 250}) + + ibmIAMCustomRoleResourceValidator := validate.ResourceValidator{ResourceName: "ibm_iam_custom_role", Schema: validateSchema} + return &ibmIAMCustomRoleResourceValidator +} + +func resourceIBMIAMCustomRoleCreate(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + displayName := d.Get(iamCRDisplayName).(string) + name := d.Get(iamCRName).(string) + description := d.Get(iamCRDescription).(string) + serviceName := d.Get(iamCRServiceName).(string) + actionList := flex.ExpandStringList(d.Get(iamCRActions).([]interface{})) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + roleOptions := &iampolicymanagementv1.CreateRoleOptions{ + DisplayName: &displayName, + Actions: actionList, + Name: &name, + AccountID: &userDetails.UserAccount, + ServiceName: &serviceName, + Description: &description, + } + + role, response, err := iamPolicyManagementClient.CreateRole(roleOptions) + if err != nil || role == nil { + return fmt.Errorf("[ERROR] Error creating Custom Roles: %s\n%s", err, response) + } + + d.SetId(*role.ID) + + return resourceIBMIAMCustomRoleRead(d, meta) +} + +func resourceIBMIAMCustomRoleRead(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + roleID := d.Id() + roleOptions := &iampolicymanagementv1.GetRoleOptions{ + RoleID: &roleID, + } + + role, response, err := iamPolicyManagementClient.GetRole(roleOptions) + if err != nil || role == nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error retrieving Custom Roles: %s\n%s", err, response) + } + + d.Set(iamCRDisplayName, role.DisplayName) + d.Set(iamCRName, role.Name) + d.Set(iamCRDescription, role.Description) + d.Set(iamCRServiceName, role.ServiceName) + d.Set(iamCRActions, role.Actions) + d.Set("crn", role.CRN) + + d.Set(flex.ResourceName, role.Name) + d.Set(flex.ResourceCRN, role.CRN) + rcontroller, err := flex.GetBaseController(meta) + if err != nil { + return err + } + + d.Set(flex.ResourceControllerURL, rcontroller+"/iam/roles") + + return nil +} + +func resourceIBMIAMCustomRoleUpdate(d *schema.ResourceData, meta interface{}) error { + + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + roleID := d.Id() + + updatedDescription := d.Get(iamCRDescription).(string) + updatedActions := flex.ExpandStringList(d.Get(iamCRActions).([]interface{})) + updatedDisplayName := d.Get(iamCRDisplayName).(string) + + if d.HasChange("display_name") || d.HasChange("description") || d.HasChange("actions") { + roleGetOptions := &iampolicymanagementv1.GetRoleOptions{ + RoleID: &roleID, + } + + role, response, err := iamPolicyManagementClient.GetRole(roleGetOptions) + if err != nil || role == nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error retrieving Custom Roles: %s\n%s", err, response) + } + + roleETag := response.Headers.Get("ETag") + roleUpdateOptions := &iampolicymanagementv1.UpdateRoleOptions{ + RoleID: &roleID, + IfMatch: &roleETag, + DisplayName: &updatedDisplayName, + Description: &updatedDescription, + Actions: updatedActions, + } + + _, response, err = iamPolicyManagementClient.UpdateRole(roleUpdateOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error updating Custom Roles: %s\n%s", err, response) + } + } + + return resourceIBMIAMCustomRoleRead(d, meta) +} + +func resourceIBMIAMCustomRoleDelete(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + roleID := d.Id() + roleDeleteOptions := &iampolicymanagementv1.DeleteRoleOptions{ + RoleID: &roleID, + } + + response, err := iamPolicyManagementClient.DeleteRole(roleDeleteOptions) + if err != nil && !strings.Contains(err.Error(), "404") { + return fmt.Errorf("[ERROR] Error deleting Custom Roles: %s\n%s", err, response) + } + + d.SetId("") + + return nil +} + +func resourceIBMIAMCustomRoleExists(d *schema.ResourceData, meta interface{}) (bool, error) { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return false, err + } + roleID := d.Id() + + roleGetOptions := &iampolicymanagementv1.GetRoleOptions{ + RoleID: &roleID, + } + + role, response, err := iamPolicyManagementClient.GetRole(roleGetOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error retrieving Custom Roles: %s\n%s", err, response) + } + + return *role.ID == roleID, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_service_policy.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_service_policy.go index 73eaeb8054..6c842ee3e4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_service_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_service_policy.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" @@ -15,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMIAMServicePolicy() *schema.Resource { +func ResourceIBMIAMServicePolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMServicePolicyCreate, Read: resourceIBMIAMServicePolicyRead, @@ -156,6 +158,32 @@ func resourceIBMIAMServicePolicy() *schema.Resource { Set: schema.HashString, }, + "resource_tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + "description": { Type: schema.TypeString, Optional: true, @@ -171,7 +199,7 @@ func resourceIBMIAMServicePolicyCreate(d *schema.ResourceData, meta interface{}) if v, ok := d.GetOk("iam_service_id"); ok && v != nil { serviceIDUUID := v.(string) - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -188,12 +216,12 @@ func resourceIBMIAMServicePolicyCreate(d *schema.ResourceData, meta interface{}) iamID = v.(string) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - policyOptions, err := generatePolicyOptions(d, meta) + policyOptions, err := flex.GeneratePolicyOptions(d, meta) if err != nil { return err } @@ -209,15 +237,16 @@ func resourceIBMIAMServicePolicyCreate(d *schema.ResourceData, meta interface{}) accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ Name: core.StringPtr("accountId"), - Value: core.StringPtr(userDetails.userAccount), + Value: core.StringPtr(userDetails.UserAccount), Operator: core.StringPtr("stringEquals"), } policyResources := iampolicymanagementv1.PolicyResource{ Attributes: append(policyOptions.Resources[0].Attributes, *accountIDResourceAttribute), + Tags: flex.SetTags(d), } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -256,7 +285,7 @@ func resourceIBMIAMServicePolicyCreate(d *schema.ResourceData, meta interface{}) return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { _, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) } if err != nil { @@ -282,12 +311,12 @@ func resourceIBMIAMServicePolicyCreate(d *schema.ResourceData, meta interface{}) func resourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -311,7 +340,7 @@ func resourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) e return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { servicePolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) } if err != nil || servicePolicy == nil { @@ -330,16 +359,21 @@ func resourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) e d.Set("roles", roles) if _, ok := d.GetOk("resources"); ok { - d.Set("resources", flattenPolicyResource(servicePolicy.Resources)) + d.Set("resources", flex.FlattenPolicyResource(servicePolicy.Resources)) } if _, ok := d.GetOk("resource_attributes"); ok { - d.Set("resource_attributes", flattenPolicyResourceAttributes(servicePolicy.Resources)) + d.Set("resource_attributes", flex.FlattenPolicyResourceAttributes(servicePolicy.Resources)) } + + if _, ok := d.GetOk("resource_tags"); ok { + d.Set("resource_tags", flex.FlattenPolicyResourceTags(servicePolicy.Resources)) + } + if len(servicePolicy.Resources) > 0 { - if *getResourceAttribute("serviceType", servicePolicy.Resources[0]) == "service" { + if *flex.GetResourceAttribute("serviceType", servicePolicy.Resources[0]) == "service" { d.Set("account_management", false) } - if *getResourceAttribute("serviceType", servicePolicy.Resources[0]) == "platform_service" { + if *flex.GetResourceAttribute("serviceType", servicePolicy.Resources[0]) == "platform_service" { d.Set("account_management", true) } } @@ -352,9 +386,9 @@ func resourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{}) e func resourceIBMIAMServicePolicyUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") { + if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") || d.HasChange("resource_tags") { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -364,7 +398,7 @@ func resourceIBMIAMServicePolicyUpdate(d *schema.ResourceData, meta interface{}) if v, ok := d.GetOk("iam_service_id"); ok && v != nil { serviceIDUUID := v.(string) - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -381,24 +415,25 @@ func resourceIBMIAMServicePolicyUpdate(d *schema.ResourceData, meta interface{}) iamID = v.(string) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - createPolicyOptions, err := generatePolicyOptions(d, meta) + createPolicyOptions, err := flex.GeneratePolicyOptions(d, meta) if err != nil { return err } accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ Name: core.StringPtr("accountId"), - Value: core.StringPtr(userDetails.userAccount), + Value: core.StringPtr(userDetails.UserAccount), Operator: core.StringPtr("stringEquals"), } policyResources := iampolicymanagementv1.PolicyResource{ Attributes: append(createPolicyOptions.Resources[0].Attributes, *accountIDResourceAttribute), + Tags: flex.SetTags(d), } subjectAttribute := &iampolicymanagementv1.SubjectAttribute{ @@ -409,7 +444,7 @@ func resourceIBMIAMServicePolicyUpdate(d *schema.ResourceData, meta interface{}) Attributes: []iampolicymanagementv1.SubjectAttribute{*subjectAttribute}, } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -452,12 +487,12 @@ func resourceIBMIAMServicePolicyUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMIAMServicePolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -478,11 +513,11 @@ func resourceIBMIAMServicePolicyDelete(d *schema.ResourceData, meta interface{}) } func resourceIBMIAMServicePolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -515,11 +550,11 @@ func resourceIBMIAMServicePolicyExists(d *schema.ResourceData, meta interface{}) func importServicePolicy(d *schema.ResourceData, meta interface{}) (interface{}, interface{}, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return nil, nil, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil, nil, err } @@ -531,7 +566,8 @@ func importServicePolicy(d *schema.ResourceData, meta interface{}) (interface{}, if err != nil { return nil, nil, fmt.Errorf("[ERROR] Error retrieving servicePolicy: %s", err) } - resources := flattenPolicyResource(servicePolicy.Resources) - resource_attributes := flattenPolicyResourceAttributes(servicePolicy.Resources) + resources := flex.FlattenPolicyResource(servicePolicy.Resources) + resource_attributes := flex.FlattenPolicyResourceAttributes(servicePolicy.Resources) + d.Set("resource_tags", flex.FlattenPolicyResourceTags(servicePolicy.Resources)) return resources, resource_attributes, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_trusted_profile_policy.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_trusted_profile_policy.go index 02cb667afa..2a3d27b4a7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_trusted_profile_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_trusted_profile_policy.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/iamidentityv1" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" @@ -15,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMIAMTrustedProfilePolicy() *schema.Resource { +func ResourceIBMIAMTrustedProfilePolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMTrustedProfilePolicyCreate, Read: resourceIBMIAMTrustedProfilePolicyRead, @@ -156,6 +158,32 @@ func resourceIBMIAMTrustedProfilePolicy() *schema.Resource { Set: schema.HashString, }, + "resource_tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + "description": { Type: schema.TypeString, Optional: true, @@ -171,7 +199,7 @@ func resourceIBMIAMTrustedProfilePolicyCreate(d *schema.ResourceData, meta inter if v, ok := d.GetOk("profile_id"); ok && v != nil { profileIDUUID := v.(string) - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -188,12 +216,12 @@ func resourceIBMIAMTrustedProfilePolicyCreate(d *schema.ResourceData, meta inter iamID = v.(string) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - policyOptions, err := generatePolicyOptions(d, meta) + policyOptions, err := flex.GeneratePolicyOptions(d, meta) if err != nil { return err } @@ -209,15 +237,16 @@ func resourceIBMIAMTrustedProfilePolicyCreate(d *schema.ResourceData, meta inter accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ Name: core.StringPtr("accountId"), - Value: core.StringPtr(userDetails.userAccount), + Value: core.StringPtr(userDetails.UserAccount), Operator: core.StringPtr("stringEquals"), } policyResources := iampolicymanagementv1.PolicyResource{ Attributes: append(policyOptions.Resources[0].Attributes, *accountIDResourceAttribute), + Tags: flex.SetTags(d), } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -256,7 +285,7 @@ func resourceIBMIAMTrustedProfilePolicyCreate(d *schema.ResourceData, meta inter return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { _, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) } if err != nil { @@ -282,12 +311,12 @@ func resourceIBMIAMTrustedProfilePolicyCreate(d *schema.ResourceData, meta inter func resourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -311,7 +340,7 @@ func resourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta interfa return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { trustedProfilePolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) } if err != nil || trustedProfilePolicy == nil { @@ -330,16 +359,21 @@ func resourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta interfa d.Set("roles", roles) if _, ok := d.GetOk("resources"); ok { - d.Set("resources", flattenPolicyResource(trustedProfilePolicy.Resources)) + d.Set("resources", flex.FlattenPolicyResource(trustedProfilePolicy.Resources)) } if _, ok := d.GetOk("resource_attributes"); ok { - d.Set("resource_attributes", flattenPolicyResourceAttributes(trustedProfilePolicy.Resources)) + d.Set("resource_attributes", flex.FlattenPolicyResourceAttributes(trustedProfilePolicy.Resources)) } + + if _, ok := d.GetOk("resource_tags"); ok { + d.Set("resource_tags", flex.FlattenPolicyResourceTags(trustedProfilePolicy.Resources)) + } + if len(trustedProfilePolicy.Resources) > 0 { - if *getResourceAttribute("serviceType", trustedProfilePolicy.Resources[0]) == "service" { + if *flex.GetResourceAttribute("serviceType", trustedProfilePolicy.Resources[0]) == "service" { d.Set("account_management", false) } - if *getResourceAttribute("serviceType", trustedProfilePolicy.Resources[0]) == "platform_service" { + if *flex.GetResourceAttribute("serviceType", trustedProfilePolicy.Resources[0]) == "platform_service" { d.Set("account_management", true) } } @@ -352,9 +386,9 @@ func resourceIBMIAMTrustedProfilePolicyRead(d *schema.ResourceData, meta interfa func resourceIBMIAMTrustedProfilePolicyUpdate(d *schema.ResourceData, meta interface{}) error { - if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") { + if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") || d.HasChange("resource_tags") { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -364,7 +398,7 @@ func resourceIBMIAMTrustedProfilePolicyUpdate(d *schema.ResourceData, meta inter if v, ok := d.GetOk("profile_id"); ok && v != nil { profileIDUUID := v.(string) - iamClient, err := meta.(ClientSession).IAMIdentityV1API() + iamClient, err := meta.(conns.ClientSession).IAMIdentityV1API() if err != nil { return err } @@ -381,24 +415,25 @@ func resourceIBMIAMTrustedProfilePolicyUpdate(d *schema.ResourceData, meta inter iamID = v.(string) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - createPolicyOptions, err := generatePolicyOptions(d, meta) + createPolicyOptions, err := flex.GeneratePolicyOptions(d, meta) if err != nil { return err } accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ Name: core.StringPtr("accountId"), - Value: core.StringPtr(userDetails.userAccount), + Value: core.StringPtr(userDetails.UserAccount), Operator: core.StringPtr("stringEquals"), } policyResources := iampolicymanagementv1.PolicyResource{ Attributes: append(createPolicyOptions.Resources[0].Attributes, *accountIDResourceAttribute), + Tags: flex.SetTags(d), } subjectAttribute := &iampolicymanagementv1.SubjectAttribute{ @@ -409,7 +444,7 @@ func resourceIBMIAMTrustedProfilePolicyUpdate(d *schema.ResourceData, meta inter Attributes: []iampolicymanagementv1.SubjectAttribute{*subjectAttribute}, } - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } @@ -452,12 +487,12 @@ func resourceIBMIAMTrustedProfilePolicyUpdate(d *schema.ResourceData, meta inter } func resourceIBMIAMTrustedProfilePolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -478,11 +513,11 @@ func resourceIBMIAMTrustedProfilePolicyDelete(d *schema.ResourceData, meta inter } func resourceIBMIAMTrustedProfilePolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -515,11 +550,11 @@ func resourceIBMIAMTrustedProfilePolicyExists(d *schema.ResourceData, meta inter func importTrustedProfilePolicy(d *schema.ResourceData, meta interface{}) (interface{}, interface{}, error) { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return nil, nil, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil, nil, err } @@ -531,7 +566,8 @@ func importTrustedProfilePolicy(d *schema.ResourceData, meta interface{}) (inter if err != nil { return nil, nil, fmt.Errorf("[ERROR] Error retrieving trusted profile policy: %s %s", err, resp) } - resources := flattenPolicyResource(trustedProfilePolicy.Resources) - resource_attributes := flattenPolicyResourceAttributes(trustedProfilePolicy.Resources) + resources := flex.FlattenPolicyResource(trustedProfilePolicy.Resources) + resource_attributes := flex.FlattenPolicyResourceAttributes(trustedProfilePolicy.Resources) + d.Set("resource_tags", flex.FlattenPolicyResourceTags(trustedProfilePolicy.Resources)) return resources, resource_attributes, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_invite.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_user_invite.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_invite.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_user_invite.go index af00af6029..8b3981788f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_iam_user_invite.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_user_invite.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package iampolicy import ( "fmt" @@ -11,6 +11,9 @@ import ( "github.com/IBM-Cloud/bluemix-go/api/iampap/iampapv1" v2 "github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" @@ -129,7 +132,7 @@ var superUser = []string{"HARDWARE_VIEW", var permissionSets = map[string][]string{NOACCESS: noAccess, VIEWONLY: viewOnly, BASICUSER: basicUser, SUPERUSER: superUser} -func resourceIBMUserInvite() *schema.Resource { +func ResourceIBMIAMUserInvite() *schema.Resource { return &schema.Resource{ Create: resourceIBMIAMInviteUsers, Read: resourceIBMIAMGetUsers, @@ -144,7 +147,7 @@ func resourceIBMUserInvite() *schema.Resource { Type: schema.TypeSet, Required: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, }, "access_groups": { Description: "access group ids to associate the inviting user", @@ -412,7 +415,7 @@ func resourceIBMUserInvite() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "permission set for claasic infrastructure", - ValidateFunc: validateAllowedStringValue([]string{NOACCESS, VIEWONLY, BASICUSER, SUPERUSER}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{NOACCESS, VIEWONLY, BASICUSER, SUPERUSER}), }, "permissions": { @@ -471,20 +474,20 @@ func resourceIBMUserInvite() *schema.Resource { } func resourceIBMIAMInviteUsers(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } client := userManagement.UserInvite() usersSet := d.Get("users").(*schema.Set) - usersList := flattenUsersSet(usersSet) + usersList := flex.FlattenUsersSet(usersSet) users := make([]v2.User, 0) for _, user := range usersList { users = append(users, v2.User{Email: user, AccountRole: MEMBER}) } if len(users) == 0 { - return fmt.Errorf("Users email not provided") + return fmt.Errorf("[ERROR] Users email not provided") } var accessGroups = make([]string, 0) if data, ok := d.GetOk("access_groups"); ok { @@ -537,16 +540,16 @@ func resourceIBMIAMInviteUsers(d *schema.ResourceData, meta interface{}) error { } func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } Client := userManagement.UserInvite() - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return err } - iamAccessGroupsClient, err := meta.(ClientSession).IAMAccessGroupsV2() + iamAccessGroupsClient, err := meta.(conns.ClientSession).IAMAccessGroupsV2() if err != nil { return err } @@ -582,7 +585,7 @@ func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { policies := policyList.Policies if err != nil { - return fmt.Errorf("Error retrieving user policies: %s", err) + return fmt.Errorf("[ERROR] Error retrieving user policies: %s", err) } userPolicies := make([]map[string]interface{}, 0, len(policies)) for _, policy := range policies { @@ -592,7 +595,7 @@ func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { roles[i] = *role.DisplayName } //populate policy resources - resources := flattenPolicyResource(policy.Resources) + resources := flex.FlattenPolicyResource(policy.Resources) p := map[string]interface{}{ "id": policy.ID, "roles": roles, @@ -607,7 +610,7 @@ func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { } retreivedGroups, _, err := iamAccessGroupsClient.ListAccessGroups(listAccessGroupOptions) if err != nil { - return fmt.Errorf("Error retrieving access groups: %s", err) + return fmt.Errorf("[ERROR] Error retrieving access groups: %s", err) } accGroupList := make([]map[string]interface{}, 0, len(retreivedGroups.Groups)) @@ -619,7 +622,7 @@ func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { }) accgrpPolicy := policyList.Policies if err != nil { - return fmt.Errorf("Error retrieving access group policy: %s", err) + return fmt.Errorf("[ERROR] Error retrieving access group policy: %s", err) } //Fetch access group policies @@ -631,7 +634,7 @@ func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { roles[i] = *role.DisplayName } //populate policy resources - resources := flattenPolicyResource(policy.Resources) + resources := flex.FlattenPolicyResource(policy.Resources) p := map[string]interface{}{ "id": policy.ID, "roles": roles, @@ -662,7 +665,7 @@ func resourceIBMIAMGetUsers(d *schema.ResourceData, meta interface{}) error { func resourceIBMIAMUpdateUserProfile(d *schema.ResourceData, meta interface{}) error { // validate change - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -678,8 +681,8 @@ func resourceIBMIAMUpdateUserProfile(d *schema.ResourceData, meta interface{}) e old := ousrs.(*schema.Set) new := nusrs.(*schema.Set) - removed := expandStringList(old.Difference(new).List()) - added := expandStringList(new.Difference(old).List()) + removed := flex.ExpandStringList(old.Difference(new).List()) + added := flex.ExpandStringList(new.Difference(old).List()) //Update the added users if len(added) > 0 { @@ -688,7 +691,7 @@ func resourceIBMIAMUpdateUserProfile(d *schema.ResourceData, meta interface{}) e users = append(users, v2.User{Email: user, AccountRole: MEMBER}) } if len(users) == 0 { - return fmt.Errorf("Users email not provided") + return fmt.Errorf("[ERROR] Users email not provided") } var accessPolicies []v2.UserPolicy @@ -739,7 +742,7 @@ func resourceIBMIAMUpdateUserProfile(d *schema.ResourceData, meta interface{}) e for _, user := range removed { IAMID, err := getUserIAMID(d, meta, user) if err != nil { - return fmt.Errorf("User's IAM ID not found: %s", err.Error()) + return fmt.Errorf("[ERROR] User's IAM ID not found: %s", err.Error()) } Err := Client.RemoveUsers(accountID, IAMID) if Err != nil { @@ -754,7 +757,7 @@ func resourceIBMIAMUpdateUserProfile(d *schema.ResourceData, meta interface{}) e } func resourceIBMIAMRemoveUser(d *schema.ResourceData, meta interface{}) error { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return err } @@ -766,12 +769,12 @@ func resourceIBMIAMRemoveUser(d *schema.ResourceData, meta interface{}) error { } usersSet := d.Get("users").(*schema.Set) - usersList := flattenUsersSet(usersSet) + usersList := flex.FlattenUsersSet(usersSet) for _, user := range usersList { IAMID, err := getUserIAMID(d, meta, user) if err != nil { - return fmt.Errorf("User's IAM ID not found: %s", err.Error()) + return fmt.Errorf("[ERROR] User's IAM ID not found: %s", err.Error()) } Err := Client.RemoveUsers(accountID, IAMID) if Err != nil { @@ -782,7 +785,7 @@ func resourceIBMIAMRemoveUser(d *schema.ResourceData, meta interface{}) error { } func resourceIBMIAMGetUserProfileExists(d *schema.ResourceData, meta interface{}) (bool, error) { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return false, err } @@ -794,7 +797,7 @@ func resourceIBMIAMGetUserProfileExists(d *schema.ResourceData, meta interface{} } usersSet := d.Get("users").(*schema.Set) - usersList := flattenUsersSet(usersSet) + usersList := flex.FlattenUsersSet(usersSet) res, err := Client.ListUsers(accountID) if err != nil { @@ -817,16 +820,16 @@ func resourceIBMIAMGetUserProfileExists(d *schema.ResourceData, meta interface{} // getAccountID returns accountID func getAccountID(d *schema.ResourceData, meta interface{}) (string, error) { - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return "", err } - return userDetails.userAccount, nil + return userDetails.UserAccount, nil } // getUserIAMID ... func getUserIAMID(d *schema.ResourceData, meta interface{}, user string) (string, error) { - userManagement, err := meta.(ClientSession).UserManagementAPI() + userManagement, err := meta.(conns.ClientSession).UserManagementAPI() if err != nil { return "", err } @@ -960,7 +963,7 @@ func getPolicies(d *schema.ResourceData, meta interface{}, policies []interface{ if r, ok := r["attributes"]; ok { for k, v := range r.(map[string]interface{}) { - resourceAttributes = setResourceAttribute(core.StringPtr(k), v.(*string), resourceAttributes) + resourceAttributes = flex.SetResourceAttribute(core.StringPtr(k), v.(*string), resourceAttributes) } } @@ -1000,30 +1003,30 @@ func getPolicies(d *schema.ResourceData, meta interface{}, policies []interface{ policyResource.Attributes = resourceAttributes - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return policyList, err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return policyList, err } listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ - AccountID: &userDetails.userAccount, + AccountID: &userDetails.UserAccount, ServiceName: &serviceName, } roleList, _, err := iamPolicyManagementClient.ListRoles(listRoleOptions) - roles := mapRoleListToPolicyRoles(*roleList) + roles := flex.MapRoleListToPolicyRoles(*roleList) if err != nil { return policyList, err } var policyRoles = make([]iampolicymanagementv1.PolicyRole, 0) if userRoles, ok := p["roles"]; ok { - policyRoles, err = getRolesFromRoleNames(expandStringList(userRoles.([]interface{})), roles) + policyRoles, err = flex.GetRolesFromRoleNames(flex.ExpandStringList(userRoles.([]interface{})), roles) if err != nil { return policyList, err } @@ -1059,12 +1062,12 @@ func convertIPMResourcesToV1(resource iampolicymanagementv1.PolicyResource) []ia func getCloudFoundryRoles(d *schema.ResourceData, meta interface{}) ([]v2.OrgRole, error) { cloudFoundryRoles := make([]v2.OrgRole, 0) if data, ok := d.GetOk("cloud_foundry_roles"); ok { - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return nil, err } usersSet := d.Get("users").(*schema.Set) - usersList := flattenUsersSet(usersSet) + usersList := flex.FlattenUsersSet(usersSet) for _, d := range data.([]interface{}) { orgRole := v2.OrgRole{} role := d.(map[string]interface{}) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_user_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_user_policy.go new file mode 100644 index 0000000000..325c9827dd --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy/resource_ibm_iam_user_policy.go @@ -0,0 +1,521 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package iampolicy + +import ( + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMIAMUserPolicy() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMIAMUserPolicyCreate, + Read: resourceIBMIAMUserPolicyRead, + Update: resourceIBMIAMUserPolicyUpdate, + Delete: resourceIBMIAMUserPolicyDelete, + Exists: resourceIBMIAMUserPolicyExists, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + resources, resourceAttributes, err := importUserPolicy(d, meta) + if err != nil { + return nil, fmt.Errorf("[ERROR] Error reading resource ID: %s", err) + } + d.Set("resources", resources) + d.Set("resource_attributes", resourceAttributes) + return []*schema.ResourceData{d}, nil + }, + }, + Schema: map[string]*schema.Schema{ + + "ibm_id": { + Description: "The ibm id or email of user", + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "roles": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Role names of the policy definition", + }, + + "resources": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + ConflictsWith: []string{"account_management", "resource_attributes"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "service": { + Type: schema.TypeString, + Optional: true, + Description: "Service name of the policy definition", + }, + + "resource_instance_id": { + Type: schema.TypeString, + Optional: true, + Description: "ID of resource instance of the policy definition", + }, + + "region": { + Type: schema.TypeString, + Optional: true, + Description: "Region of the policy definition", + }, + + "resource_type": { + Type: schema.TypeString, + Optional: true, + Description: "Resource type of the policy definition", + }, + + "resource": { + Type: schema.TypeString, + Optional: true, + Description: "Resource of the policy definition", + }, + + "resource_group_id": { + Type: schema.TypeString, + Optional: true, + Description: "ID of the resource group.", + }, + + "service_type": { + Type: schema.TypeString, + Optional: true, + Description: "Service type of the policy definition", + }, + + "attributes": { + Type: schema.TypeMap, + Optional: true, + Description: "Set resource attributes in the form of 'name=value,name=value....", + Elem: schema.TypeString, + }, + }, + }, + }, + + "resource_attributes": { + Type: schema.TypeSet, + Optional: true, + Description: "Set resource attributes.", + ConflictsWith: []string{"resources", "account_management"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + "account_management": { + Type: schema.TypeBool, + Default: false, + Optional: true, + Description: "Give access to all account management services", + ConflictsWith: []string{"resources", "resource_attributes"}, + }, + + "tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + + "resource_tags": { + Type: schema.TypeSet, + Optional: true, + Description: "Set access management tags.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of attribute.", + }, + "value": { + Type: schema.TypeString, + Required: true, + Description: "Value of attribute.", + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Default: "stringEquals", + Description: "Operator of attribute.", + }, + }, + }, + }, + + "description": { + Type: schema.TypeString, + Optional: true, + Description: "Description of the Policy", + }, + }, + } +} + +func resourceIBMIAMUserPolicyCreate(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + var policyOptions iampolicymanagementv1.CreatePolicyOptions + policyOptions, err = flex.GeneratePolicyOptions(d, meta) + + if err != nil { + return err + } + + userEmail := d.Get("ibm_id").(string) + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + accountID := userDetails.UserAccount + + ibmUniqueID, err := flex.GetIBMUniqueId(accountID, userEmail, meta) + if err != nil { + return err + } + + subjectAttribute := &iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("iam_id"), + Value: &ibmUniqueID, + } + + policySubjects := &iampolicymanagementv1.PolicySubject{ + Attributes: []iampolicymanagementv1.SubjectAttribute{*subjectAttribute}, + } + + accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("accountId"), + Value: core.StringPtr(accountID), + Operator: core.StringPtr("stringEquals"), + } + + policyResources := iampolicymanagementv1.PolicyResource{ + Attributes: append(policyOptions.Resources[0].Attributes, *accountIDResourceAttribute), + Tags: flex.SetTags(d), + } + + createPolicyOptions := iamPolicyManagementClient.NewCreatePolicyOptions( + "access", + []iampolicymanagementv1.PolicySubject{*policySubjects}, + policyOptions.Roles, + []iampolicymanagementv1.PolicyResource{policyResources}, + ) + + if description, ok := d.GetOk("description"); ok { + des := description.(string) + createPolicyOptions.Description = &des + } + + userPolicy, resp, err := iamPolicyManagementClient.CreatePolicy(createPolicyOptions) + + if err != nil { + return fmt.Errorf("Error creating user policies: %s, %s", err, resp) + } + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: userPolicy.ID, + } + + err = resource.Retry(5*time.Minute, func() *resource.RetryError { + var err error + policy, res, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + + if err != nil || policy == nil { + if res != nil && res.StatusCode == 404 { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + + if conns.IsResourceTimeoutError(err) { + _, _, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) + } + if err != nil { + d.SetId(fmt.Sprintf("%s/%s", userEmail, *userPolicy.ID)) + return fmt.Errorf("[ERROR] Error fetching user policy: %w", err) + } + d.SetId(fmt.Sprintf("%s/%s", userEmail, *userPolicy.ID)) + + return resourceIBMIAMUserPolicyRead(d, meta) +} + +func resourceIBMIAMUserPolicyRead(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + + userEmail := parts[0] + userPolicyID := parts[1] + + if err != nil { + return err + } + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: core.StringPtr(userPolicyID), + } + userPolicy := &iampolicymanagementv1.Policy{} + res := &core.DetailedResponse{} + err = resource.Retry(5*time.Minute, func() *resource.RetryError { + var err error + userPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) + + if err != nil || userPolicy == nil { + if res != nil && res.StatusCode == 404 { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + + if conns.IsResourceTimeoutError(err) { + userPolicy, res, err = iamPolicyManagementClient.GetPolicy(getPolicyOptions) + } + if err != nil || userPolicy == nil { + return fmt.Errorf("[ERROR] Error retrieving userPolicy: %s %s", err, res) + } + d.Set("ibm_id", userEmail) + roles := make([]string, len(userPolicy.Roles)) + + for i, role := range userPolicy.Roles { + roles[i] = *role.DisplayName + } + d.Set("roles", roles) + if _, ok := d.GetOk("resources"); ok { + d.Set("resources", flex.FlattenPolicyResource(userPolicy.Resources)) + } + if _, ok := d.GetOk("resource_attributes"); ok { + d.Set("resource_attributes", flex.FlattenPolicyResourceAttributes(userPolicy.Resources)) + } + + if _, ok := d.GetOk("resource_tags"); ok { + d.Set("resource_tags", flex.FlattenPolicyResourceTags(userPolicy.Resources)) + } + + if len(userPolicy.Resources) > 0 { + if *flex.GetResourceAttribute("serviceType", userPolicy.Resources[0]) == "service" { + d.Set("account_management", false) + } + if *flex.GetResourceAttribute("serviceType", userPolicy.Resources[0]) == "platform_service" { + d.Set("account_management", true) + } + } + if userPolicy.Description != nil { + d.Set("description", *userPolicy.Description) + } + return nil +} + +func resourceIBMIAMUserPolicyUpdate(d *schema.ResourceData, meta interface{}) error { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + if d.HasChange("roles") || d.HasChange("resources") || d.HasChange("resource_attributes") || d.HasChange("account_management") || d.HasChange("description") || d.HasChange("resource_tags") { + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + userEmail := parts[0] + userPolicyID := parts[1] + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return err + } + + accountID := userDetails.UserAccount + + createPolicyOptions, err := flex.GeneratePolicyOptions(d, meta) + if err != nil { + return err + } + + ibmUniqueID, err := flex.GetIBMUniqueId(accountID, userEmail, meta) + if err != nil { + return err + } + + accountIDResourceAttribute := &iampolicymanagementv1.ResourceAttribute{ + Name: core.StringPtr("accountId"), + Value: core.StringPtr(accountID), + Operator: core.StringPtr("stringEquals"), + } + + policyResources := iampolicymanagementv1.PolicyResource{ + Attributes: append(createPolicyOptions.Resources[0].Attributes, *accountIDResourceAttribute), + Tags: flex.SetTags(d), + } + + subjectAttribute := &iampolicymanagementv1.SubjectAttribute{ + Name: core.StringPtr("iam_id"), + Value: &ibmUniqueID, + } + policySubjects := &iampolicymanagementv1.PolicySubject{ + Attributes: []iampolicymanagementv1.SubjectAttribute{*subjectAttribute}, + } + + getPolicyOptions := &iampolicymanagementv1.GetPolicyOptions{ + PolicyID: &userPolicyID, + } + policy, response, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil || policy == nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error retrieving Policy: %s\n%s", err, response) + } + + userPolicyETag := response.Headers.Get("ETag") + updatePolicyOptions := iamPolicyManagementClient.NewUpdatePolicyOptions( + userPolicyID, + userPolicyETag, + "access", + []iampolicymanagementv1.PolicySubject{*policySubjects}, + createPolicyOptions.Roles, + []iampolicymanagementv1.PolicyResource{policyResources}, + ) + + if description, ok := d.GetOk("description"); ok { + des := description.(string) + updatePolicyOptions.Description = &des + } + + _, resp, err := iamPolicyManagementClient.UpdatePolicy(updatePolicyOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error updating user policy: %s, %s", err, resp) + } + } + return resourceIBMIAMUserPolicyRead(d, meta) +} + +func resourceIBMIAMUserPolicyDelete(d *schema.ResourceData, meta interface{}) error { + + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return err + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + userPolicyID := parts[1] + + deletePolicyOptions := iamPolicyManagementClient.NewDeletePolicyOptions( + userPolicyID, + ) + _, err = iamPolicyManagementClient.DeletePolicy(deletePolicyOptions) + if err != nil { + return err + } + d.SetId("") + return nil +} + +func resourceIBMIAMUserPolicyExists(d *schema.ResourceData, meta interface{}) (bool, error) { + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return false, err + } + + parts, err := flex.IdParts(d.Id()) + if err != nil { + return false, err + } + if len(parts) < 2 { + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of userEmail/PolicyID", d.Id()) + } + userEmail := parts[0] + userPolicyID := parts[1] + + getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( + userPolicyID, + ) + + userPolicy, resp, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil || userPolicy == nil { + if resp != nil && resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error getting user policy: %s\n%s", err, resp) + } + + if userPolicy != nil && userPolicy.State != nil && *userPolicy.State == "deleted" { + return false, nil + } + + tempID := fmt.Sprintf("%s/%s", userEmail, *userPolicy.ID) + + return tempID == d.Id(), nil +} + +func importUserPolicy(d *schema.ResourceData, meta interface{}) (interface{}, interface{}, error) { + + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() + if err != nil { + return nil, nil, err + } + parts, err := flex.IdParts(d.Id()) + if err != nil { + return nil, nil, err + } + userPolicyID := parts[1] + + getPolicyOptions := iamPolicyManagementClient.NewGetPolicyOptions( + userPolicyID, + ) + userPolicy, _, err := iamPolicyManagementClient.GetPolicy(getPolicyOptions) + if err != nil { + return nil, nil, fmt.Errorf("[ERROR] Error retrieving User Policy: %s", err) + } + resources := flex.FlattenPolicyResource(userPolicy.Resources) + resource_attributes := flex.FlattenPolicyResourceAttributes(userPolicy.Resources) + d.Set("resource_tags", flex.FlattenPolicyResourceTags(userPolicy.Resources)) + return resources, resource_attributes, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/README.md new file mode 100644 index 0000000000..ae263f08e3 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Key Management Service + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the KMS resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/kms_key) +* IBM API Docs: [IBM API Docs for KMS](https://cloud.ibm.com/apidocs/key-protect) +* IBM KMS SDK: [IBM SDK for KMS](https://github.com/IBM/keyprotect-go-client) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key.go index 4556b7923f..94145fc3a7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -9,12 +9,15 @@ import ( "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" kp "github.com/IBM/keyprotect-go-client" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMKMSkey() *schema.Resource { +func DataSourceIBMKMSkey() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMKMSKeyRead, @@ -49,7 +52,7 @@ func dataSourceIBMKMSkey() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", Default: "public", }, @@ -174,7 +177,7 @@ func dataSourceIBMKMSkey() *schema.Resource { } func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyManagementAPI() + api, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -186,7 +189,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { } endpointType := d.Get("endpoint_type").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -220,8 +223,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { if limitVal == 0 { keys, err := api.GetKeys(context.Background(), 0, offset) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } retreivedKeys := keys.Keys totalKeys = append(totalKeys, retreivedKeys...) @@ -232,8 +234,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { if (limitVal - offset) < pageSize { keys, err := api.GetKeys(context.Background(), (limitVal - offset), offset) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } retreivedKeys := keys.Keys totalKeys = append(totalKeys, retreivedKeys...) @@ -241,8 +242,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { } else { keys, err := api.GetKeys(context.Background(), pageSize, offset) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } numOfKeysFetched := keys.Metadata.NumberOfKeys retreivedKeys := keys.Keys @@ -258,7 +258,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { } if len(totalKeys) == 0 { - return fmt.Errorf("No keys in instance %s", instanceID) + return fmt.Errorf("[ERROR] No keys in instance %s", instanceID) } var keyName string var matchKeys []kp.Key @@ -273,7 +273,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { matchKeys = totalKeys } if len(matchKeys) == 0 { - return fmt.Errorf("No keys with name %s in instance %s", keyName, instanceID) + return fmt.Errorf("[ERROR] No keys with name %s in instance %s", keyName, instanceID) } keyMap := make([]map[string]interface{}, 0, len(matchKeys)) @@ -288,12 +288,12 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { keyInstance["key_ring_id"] = key.KeyRingID policies, err := api.GetPolicies(context.Background(), key.ID) if err != nil { - return fmt.Errorf("Failed to read policies: %s", err) + return fmt.Errorf("[ERROR] Failed to read policies: %s", err) } if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - keyInstance["policies"] = flattenKeyPolicies(policies) + keyInstance["policies"] = flex.FlattenKeyPolicies(policies) } keyMap = append(keyMap, keyInstance) @@ -304,8 +304,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { } else if v, ok := d.GetOk("key_id"); ok { key, err := api.GetKey(context.Background(), v.(string)) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } keyMap := make([]map[string]interface{}, 0, 1) keyInstance := make(map[string]interface{}) @@ -317,12 +316,12 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { keyInstance["key_ring_id"] = key.KeyRingID policies, err := api.GetPolicies(context.Background(), key.ID) if err != nil { - return fmt.Errorf("Failed to read policies: %s", err) + return fmt.Errorf("[ERROR] Failed to read policies: %s", err) } if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - keyInstance["policies"] = flattenKeyPolicies(policies) + keyInstance["policies"] = flex.FlattenKeyPolicies(policies) } keyMap = append(keyMap, keyInstance) @@ -333,8 +332,7 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { aliasName := d.Get("alias").(string) key, err := api.GetKey(context.Background(), aliasName) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } keyMap := make([]map[string]interface{}, 0, 1) keyInstance := make(map[string]interface{}) @@ -346,12 +344,12 @@ func dataSourceIBMKMSKeyRead(d *schema.ResourceData, meta interface{}) error { keyInstance["key_ring_id"] = key.KeyRingID policies, err := api.GetPolicies(context.Background(), key.ID) if err != nil { - return fmt.Errorf("Failed to read policies: %s", err) + return fmt.Errorf("[ERROR] Failed to read policies: %s", err) } if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - keyInstance["policies"] = flattenKeyPolicies(policies) + keyInstance["policies"] = flex.FlattenKeyPolicies(policies) } keyMap = append(keyMap, keyInstance) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key_policies.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key_policies.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key_policies.go index 103f7d7189..d9c974d059 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key_policies.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key_policies.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -9,12 +9,15 @@ import ( "strings" //kp "github.com/IBM/keyprotect-go-client" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMKMSkeyPolicies() *schema.Resource { +func DataSourceIBMKMSkeyPolicies() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMKMSKeyPoliciesRead, @@ -27,7 +30,7 @@ func dataSourceIBMKMSkeyPolicies() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", Default: "public", }, @@ -86,7 +89,7 @@ func dataSourceIBMKMSkeyPolicies() *schema.Resource { "interval_month": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(1, 12), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 12), Description: "Specifies the key rotation time interval in months", }, }, @@ -146,7 +149,7 @@ func dataSourceIBMKMSkeyPolicies() *schema.Resource { } func dataSourceIBMKMSKeyPoliciesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - api, err := meta.(ClientSession).keyManagementAPI() + api, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return diag.FromErr(err) } @@ -159,7 +162,7 @@ func dataSourceIBMKMSKeyPoliciesRead(context context.Context, d *schema.Resource endpointType := d.Get("endpoint_type").(string) key_id := d.Get("key_id").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -187,7 +190,7 @@ func dataSourceIBMKMSKeyPoliciesRead(context context.Context, d *schema.Resource if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - d.Set("policies", flattenKeyPolicies(policies)) + d.Set("policies", flex.FlattenKeyPolicies(policies)) } d.SetId(instanceID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key_rings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key_rings.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key_rings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key_rings.go index a1c50212f4..54229934d0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_key_rings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_key_rings.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -9,11 +9,13 @@ import ( "strings" //kp "github.com/IBM/keyprotect-go-client" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMKMSkeyRings() *schema.Resource { +func DataSourceIBMKMSkeyRings() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMKMSKeyRingsRead, @@ -27,7 +29,7 @@ func dataSourceIBMKMSkeyRings() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", Default: "public", }, @@ -57,7 +59,7 @@ func dataSourceIBMKMSkeyRings() *schema.Resource { } func dataSourceIBMKMSKeyRingsRead(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyManagementAPI() + api, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -69,7 +71,7 @@ func dataSourceIBMKMSKeyRingsRead(d *schema.ResourceData, meta interface{}) erro } endpointType := d.Get("endpoint_type").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -90,23 +92,16 @@ func dataSourceIBMKMSKeyRingsRead(d *schema.ResourceData, meta interface{}) erro api.Config.InstanceID = instanceID keys, err := api.GetKeyRings(context.Background()) - if err != nil { - return fmt.Errorf( - "Get Key Rings failed with error: %s", err) - } - retreivedKeyRings := keys.KeyRings - if keys == nil || len(retreivedKeyRings) == 0 { - return fmt.Errorf("No key Rings in instance %s", instanceID) + if err != nil || keys == nil { + return fmt.Errorf("[ERROR] Get Key Rings failed with error: %s", err) } - var keyRingName string - - if len(retreivedKeyRings) == 0 { - return fmt.Errorf("No key Ring with name %s in instance %s", keyRingName, instanceID) + if keys == nil || keys.KeyRings == nil || len(keys.KeyRings) == 0 { + return fmt.Errorf("[ERROR] No key Rings in instance %s", instanceID) } - keyRingMap := make([]map[string]interface{}, 0, len(retreivedKeyRings)) + keyRingMap := make([]map[string]interface{}, 0, len(keys.KeyRings)) - for _, keyRing := range retreivedKeyRings { + for _, keyRing := range keys.KeyRings { keyInstance := make(map[string]interface{}) keyInstance["id"] = keyRing.ID diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_keys.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_keys.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_keys.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_keys.go index 19586f1380..882afe02eb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kms_keys.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kms_keys.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -9,12 +9,15 @@ import ( "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" kp "github.com/IBM/keyprotect-go-client" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMKMSkeys() *schema.Resource { +func DataSourceIBMKMSkeys() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMKMSKeysRead, @@ -50,7 +53,7 @@ func dataSourceIBMKMSkeys() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", ForceNew: true, Default: "public", @@ -167,7 +170,7 @@ func dataSourceIBMKMSkeys() *schema.Resource { } func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyManagementAPI() + api, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -179,7 +182,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { } endpointType := d.Get("endpoint_type").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -204,8 +207,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { aliasName := v.(string) key, err := api.GetKey(context.Background(), aliasName) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } keyMap := make([]map[string]interface{}, 0, 1) keyInstance := make(map[string]interface{}) @@ -221,8 +223,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { } else if v, ok := d.GetOk("key_id"); ok { key, err := api.GetKey(context.Background(), v.(string)) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } keyMap := make([]map[string]interface{}, 0, 1) keyInstance := make(map[string]interface{}) @@ -234,12 +235,12 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { keyInstance["key_ring_id"] = key.KeyRingID policies, err := api.GetPolicies(context.Background(), key.ID) if err != nil { - return fmt.Errorf("Failed to read policies: %s", err) + return fmt.Errorf("[ERROR] Failed to read policies: %s", err) } if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - keyInstance["policies"] = flattenKeyPolicies(policies) + keyInstance["policies"] = flex.FlattenKeyPolicies(policies) } keyMap = append(keyMap, keyInstance) @@ -259,8 +260,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { { keys, err := api.GetKeys(context.Background(), 0, offset) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } retreivedKeys := keys.Keys totalKeys = append(totalKeys, retreivedKeys...) @@ -272,8 +272,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { if (limitVal - offset) < pageSize { keys, err := api.GetKeys(context.Background(), (limitVal - offset), offset) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } retreivedKeys := keys.Keys totalKeys = append(totalKeys, retreivedKeys...) @@ -281,8 +280,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { } else { keys, err := api.GetKeys(context.Background(), pageSize, offset) if err != nil { - return fmt.Errorf( - "Get Keys failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Keys failed with error: %s", err) } numOfKeysFetched := keys.Metadata.NumberOfKeys retreivedKeys := keys.Keys @@ -310,7 +308,7 @@ func dataSourceIBMKMSKeysRead(d *schema.ResourceData, meta interface{}) error { } if len(matchKeys) == 0 { - return fmt.Errorf("No keys with name %s in instance %s", keyName, instanceID) + return fmt.Errorf("[ERROR] No keys with name %s in instance %s", keyName, instanceID) } keyMap := make([]map[string]interface{}, 0, len(matchKeys)) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kp_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kp_key.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kp_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kp_key.go index 70b8b96158..27385da120 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_kp_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/data_source_ibm_kp_key.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" kp "github.com/IBM/keyprotect-go-client" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMkey() *schema.Resource { +func DataSourceIBMkey() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMKeyRead, @@ -54,7 +55,7 @@ func dataSourceIBMkey() *schema.Resource { } func dataSourceIBMKeyRead(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyProtectAPI() + api, err := meta.(conns.ClientSession).KeyProtectAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key.go index f9ef30b8b2..c4547b8977 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -12,6 +12,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" kp "github.com/IBM/keyprotect-go-client" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -27,7 +30,7 @@ func suppressKMSInstanceIDDiff(k, old, new string, d *schema.ResourceData) bool return false } -func resourceIBMKmskey() *schema.Resource { +func ResourceIBMKmskey() *schema.Resource { return &schema.Resource{ Create: resourceIBMKmsKeyCreate, Read: resourceIBMKmsKeyRead, @@ -75,7 +78,7 @@ func resourceIBMKmskey() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", ForceNew: true, }, @@ -173,7 +176,7 @@ func resourceIBMKmskey() *schema.Resource { "interval_month": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(1, 12), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 12), Description: "Specifies the key rotation time interval in months", }, }, @@ -233,30 +236,30 @@ func resourceIBMKmskey() *schema.Resource { Computed: true, Description: "Key protect or hpcs instance CRN", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, - Description: "The name of the resource", + Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, - Description: "The crn of the resource", + Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, - Description: "The status of the resource", + Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, - Description: "The resource group name in which resource is provisioned", + Description: "The resource group name in which resource is provisioned", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", @@ -266,7 +269,7 @@ func resourceIBMKmskey() *schema.Resource { } func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -279,7 +282,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { endpointType := d.Get("endpoint_type").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -311,7 +314,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { // parse string to required time format expiration_time, err := time.Parse(time.RFC3339, expiration_string) if err != nil { - return fmt.Errorf("Invalid time format (the date format follows RFC 3339): %s", err) + return fmt.Errorf("[ERROR] Invalid time format (the date format follows RFC 3339): %s", err) } expiration = &expiration_time } else { @@ -325,8 +328,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { payload := v.(string) stkey, err := kpAPI.CreateImportedStandardKey(context.Background(), name, expiration, payload) if err != nil { - return fmt.Errorf( - "Error while creating standard key with payload: %s", err) + return fmt.Errorf("[ERROR] Error while creating standard key with payload: %s", err) } keyCRN = stkey.CRN d.SetId(keyCRN) @@ -335,8 +337,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { //create standard key stkey, err := kpAPI.CreateStandardKey(context.Background(), name, expiration) if err != nil { - return fmt.Errorf( - "Error while creating standard key: %s", err) + return fmt.Errorf("[ERROR] Error while creating standard key: %s", err) } keyCRN = stkey.CRN d.SetId(keyCRN) @@ -349,8 +350,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { iv := d.Get("iv_value").(string) stkey, err := kpAPI.CreateImportedRootKey(context.Background(), name, expiration, payload, encryptedNonce, iv) if err != nil { - return fmt.Errorf( - "Error while creating Root key with payload: %s", err) + return fmt.Errorf("[ERROR] Error while creating Root key with payload: %s", err) } keyCRN = stkey.CRN d.SetId(keyCRN) @@ -358,8 +358,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { } else { stkey, err := kpAPI.CreateRootKey(context.Background(), name, expiration) if err != nil { - return fmt.Errorf( - "Error while creating Root key: %s", err) + return fmt.Errorf("[ERROR] Error while creating Root key: %s", err) } keyCRN = stkey.CRN d.SetId(keyCRN) @@ -369,7 +368,7 @@ func resourceIBMKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKmsKeyRead(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -380,7 +379,7 @@ func resourceIBMKmsKeyRead(d *schema.ResourceData, meta interface{}) error { instanceID := crnData[len(crnData)-3] keyid := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -409,7 +408,7 @@ func resourceIBMKmsKeyRead(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil } - return fmt.Errorf("Get Key failed with error while reading policies: %s", err) + return fmt.Errorf("[ERROR] Get Key failed with error while reading policies: %s", err) } else if key.State == 5 { //Refers to Deleted state of the Key d.SetId("") return nil @@ -417,12 +416,12 @@ func resourceIBMKmsKeyRead(d *schema.ResourceData, meta interface{}) error { policies, err := kpAPI.GetPolicies(context.Background(), keyid) if err != nil && !strings.Contains(fmt.Sprint(err), "Unauthorized: The user does not have access to the specified resource") { - return fmt.Errorf("Failed to read policies: %s", err) + return fmt.Errorf("[ERROR] Failed to read policies: %s", err) } if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - d.Set("policies", flattenKeyPolicies(policies)) + d.Set("policies", flex.FlattenKeyPolicies(policies)) } d.Set("instance_id", instanceID) d.Set("instance_crn", instanceCRN) @@ -449,18 +448,18 @@ func resourceIBMKmsKeyRead(d *schema.ResourceData, meta interface{}) error { } else { d.Set("expiration_date", "") } - d.Set(ResourceName, key.Name) - d.Set(ResourceCRN, key.CRN) + d.Set(flex.ResourceName, key.Name) + d.Set(flex.ResourceCRN, key.CRN) state := key.State - d.Set(ResourceStatus, strconv.Itoa(state)) - rcontroller, err := getBaseController(meta) + d.Set(flex.ResourceStatus, strconv.Itoa(state)) + rcontroller, err := flex.GetBaseController(meta) if err != nil { return err } id := key.ID crn1 := strings.TrimSuffix(key.CRN, ":key:"+id) - d.Set(ResourceControllerURL, rcontroller+"/services/kms/"+url.QueryEscape(crn1)+"%3A%3A") + d.Set(flex.ResourceControllerURL, rcontroller+"/services/kms/"+url.QueryEscape(crn1)+"%3A%3A") return nil @@ -473,7 +472,7 @@ func resourceIBMKmsKeyUpdate(d *schema.ResourceData, meta interface{}) error { } if d.HasChange("policies") { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -484,7 +483,7 @@ func resourceIBMKmsKeyUpdate(d *schema.ResourceData, meta interface{}) error { instanceID := crnData[len(crnData)-3] key_id := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -506,7 +505,7 @@ func resourceIBMKmsKeyUpdate(d *schema.ResourceData, meta interface{}) error { err = handlePolicies(d, kpAPI, meta, key_id) if err != nil { - return fmt.Errorf("Could not update policies: %s", err) + return fmt.Errorf("[ERROR] Could not update policies: %s", err) } } return resourceIBMKmsKeyRead(d, meta) @@ -514,7 +513,7 @@ func resourceIBMKmsKeyUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -524,7 +523,7 @@ func resourceIBMKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { instanceID := crnData[len(crnData)-3] keyid := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -551,8 +550,7 @@ func resourceIBMKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { _, err1 := kpAPI.DeleteKey(context.Background(), keyid, kp.ReturnRepresentation, f) if err1 != nil { - return fmt.Errorf( - "Error while deleting: %s", err1) + return fmt.Errorf("[ERROR] Error while deleting: %s", err1) } d.SetId("") return nil @@ -560,7 +558,7 @@ func resourceIBMKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKmsKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return false, err } @@ -571,7 +569,7 @@ func resourceIBMKmsKeyExists(d *schema.ResourceData, meta interface{}) (bool, er instanceID := crnData[len(crnData)-3] keyid := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -629,7 +627,7 @@ func handlePolicies(d *schema.ResourceData, kpAPI *kp.Client, meta interface{}, _, err := kpAPI.SetPolicies(context.Background(), key_id, setRotation, rotationInterval, setDualAuthDelete, dualAuthEnable) if err != nil { - return fmt.Errorf("Error while creating policies: %s", err) + return fmt.Errorf("[ERROR] Error while creating policies: %s", err) } } return nil @@ -644,7 +642,7 @@ func KmsEndpointURL(kpAPI *kp.Client, endpointType string, extensions map[string } endpointURL := fmt.Sprintf("%s/api/v2/keys", exturl.(string)) - url1 := envFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, endpointURL) + url1 := conns.EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, endpointURL) u, err := url.Parse(url1) if err != nil { return nil, fmt.Errorf("[ERROR] Error Parsing KMS EndpointURL") diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_alias.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_alias.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_alias.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_alias.go index 5041916f3b..f9f6381a71 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_alias.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_alias.go @@ -1,16 +1,18 @@ -package ibm +package kms import ( "context" "fmt" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" kp "github.com/IBM/keyprotect-go-client" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMKmskeyAlias() *schema.Resource { +func ResourceIBMKmskeyAlias() *schema.Resource { return &schema.Resource{ Create: resourceIBMKmsKeyAliasCreate, Delete: resourceIBMKmsKeyAliasDelete, @@ -41,7 +43,7 @@ func resourceIBMKmskeyAlias() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", ForceNew: true, }, @@ -50,7 +52,7 @@ func resourceIBMKmskeyAlias() *schema.Resource { } func resourceIBMKmsKeyAliasCreate(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -62,7 +64,7 @@ func resourceIBMKmsKeyAliasCreate(d *schema.ResourceData, meta interface{}) erro } endpointType := d.Get("endpoint_type").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -86,12 +88,11 @@ func resourceIBMKmsKeyAliasCreate(d *schema.ResourceData, meta interface{}) erro keyID := d.Get("key_id").(string) stkey, err := kpAPI.CreateKeyAlias(context.Background(), aliasName, keyID) if err != nil { - return fmt.Errorf( - "Error while creating alias name for the key: %s", err) + return fmt.Errorf("[ERROR] Error while creating alias name for the key: %s", err) } key, err := kpAPI.GetKey(context.Background(), stkey.KeyID) if err != nil { - return fmt.Errorf("Get Key failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Key failed with error: %s", err) } d.SetId(fmt.Sprintf("%s:alias:%s", stkey.Alias, key.CRN)) @@ -99,13 +100,13 @@ func resourceIBMKmsKeyAliasCreate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMKmsKeyAliasRead(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } id := strings.Split(d.Id(), ":alias:") if len(id) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of keyAlias:alias:keyCRN", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of keyAlias:alias:keyCRN", d.Id()) } crn := id[1] crnData := strings.Split(crn, ":") @@ -113,7 +114,7 @@ func resourceIBMKmsKeyAliasRead(d *schema.ResourceData, meta interface{}) error instanceID := crnData[len(crnData)-3] keyid := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -139,7 +140,7 @@ func resourceIBMKmsKeyAliasRead(d *schema.ResourceData, meta interface{}) error d.SetId("") return nil } - return fmt.Errorf("Get Key failed with error while reading policies: %s", err) + return fmt.Errorf("[ERROR] Get Key failed with error while reading policies: %s", err) } else if key.State == 5 { //Refers to Deleted state of the Key d.SetId("") return nil @@ -157,7 +158,7 @@ func resourceIBMKmsKeyAliasRead(d *schema.ResourceData, meta interface{}) error } func resourceIBMKmsKeyAliasDelete(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -168,7 +169,7 @@ func resourceIBMKmsKeyAliasDelete(d *schema.ResourceData, meta interface{}) erro instanceID := crnData[len(crnData)-3] keyid := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_policies.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_policies.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_policies.go index 408333d04c..159cd97a5a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_policies.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_policies.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -12,13 +12,16 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" kp "github.com/IBM/keyprotect-go-client" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMKmskeyPolicies() *schema.Resource { +func ResourceIBMKmskeyPolicies() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMKmsKeyPolicyCreate, ReadContext: resourceIBMKmsKeyPolicyRead, @@ -46,7 +49,7 @@ func resourceIBMKmskeyPolicies() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", ForceNew: true, Default: "public", @@ -92,7 +95,7 @@ func resourceIBMKmskeyPolicies() *schema.Resource { "interval_month": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(1, 12), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 12), Description: "Specifies the key rotation time interval in months", }, }, @@ -144,26 +147,26 @@ func resourceIBMKmskeyPolicies() *schema.Resource { }, }, }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, - Description: "The name of the resource", + Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, - Description: "The crn of the resource", + Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, - Description: "The status of the resource", + Description: "The status of the resource", }, }, } } func resourceIBMKmsKeyPolicyCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return diag.FromErr(err) } @@ -175,7 +178,7 @@ func resourceIBMKmsKeyPolicyCreate(context context.Context, d *schema.ResourceDa endpointType := d.Get("endpoint_type").(string) key_id := d.Get("key_id").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -208,7 +211,7 @@ func resourceIBMKmsKeyPolicyCreate(context context.Context, d *schema.ResourceDa } func resourceIBMKmsKeyPolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return diag.FromErr(err) } @@ -218,7 +221,7 @@ func resourceIBMKmsKeyPolicyRead(context context.Context, d *schema.ResourceData instanceID := crnData[len(crnData)-3] keyid := crnData[len(crnData)-1] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -257,18 +260,18 @@ func resourceIBMKmsKeyPolicyRead(context context.Context, d *schema.ResourceData } else { d.Set("endpoint_type", "public") } - d.Set(ResourceName, key.Name) - d.Set(ResourceCRN, key.CRN) + d.Set(flex.ResourceName, key.Name) + d.Set(flex.ResourceCRN, key.CRN) state := key.State - d.Set(ResourceStatus, strconv.Itoa(state)) - rcontroller, err := getBaseController(meta) + d.Set(flex.ResourceStatus, strconv.Itoa(state)) + rcontroller, err := flex.GetBaseController(meta) if err != nil { return diag.FromErr(err) } id := key.ID crn1 := strings.TrimSuffix(key.CRN, ":key:"+id) - d.Set(ResourceControllerURL, rcontroller+"/services/kms/"+url.QueryEscape(crn1)+"%3A%3A") + d.Set(flex.ResourceControllerURL, rcontroller+"/services/kms/"+url.QueryEscape(crn1)+"%3A%3A") policies, err := kpAPI.GetPolicies(context, keyid) @@ -278,8 +281,8 @@ func resourceIBMKmsKeyPolicyRead(context context.Context, d *schema.ResourceData if len(policies) == 0 { log.Printf("No Policy Configurations read\n") } else { - d.Set("rotation", flattenKeyIndividualPolicy("rotation", policies)) - d.Set("dual_auth_delete", flattenKeyIndividualPolicy("dual_auth_delete", policies)) + d.Set("rotation", flex.FlattenKeyIndividualPolicy("rotation", policies)) + d.Set("dual_auth_delete", flex.FlattenKeyIndividualPolicy("dual_auth_delete", policies)) } return nil @@ -290,7 +293,7 @@ func resourceIBMKmsKeyPolicyUpdate(context context.Context, d *schema.ResourceDa if d.HasChange("rotation") || d.HasChange("dual_auth_delete") { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return diag.FromErr(err) } @@ -302,7 +305,7 @@ func resourceIBMKmsKeyPolicyUpdate(context context.Context, d *schema.ResourceDa } endpointType := d.Get("endpoint_type").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return diag.FromErr(err) } @@ -363,7 +366,7 @@ func resourceHandlePolicies(context context.Context, d *schema.ResourceData, kpA } _, err := kpAPI.SetPolicies(context, key_id, setRotation, rotationInterval, setDualAuthDelete, dualAuthEnable) if err != nil { - return fmt.Errorf("Error while creating policies: %s", err) + return fmt.Errorf("[ERROR] Error while creating policies: %s", err) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_rings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_rings.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_rings.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_rings.go index 466244d891..c0e6d6d5c8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kms_key_rings.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kms_key_rings.go @@ -1,19 +1,21 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" "fmt" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" kp "github.com/IBM/keyprotect-go-client" rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMKmskeyRings() *schema.Resource { +func ResourceIBMKmskeyRings() *schema.Resource { return &schema.Resource{ Create: resourceIBMKmsKeyRingCreate, Delete: resourceIBMKmsKeyRingDelete, @@ -33,13 +35,13 @@ func resourceIBMKmskeyRings() *schema.Resource { Required: true, ForceNew: true, Description: "User defined unique ID for the key ring", - ValidateFunc: InvokeValidator("ibm_kms_key_rings", "key_ring_id"), + ValidateFunc: validate.InvokeValidator("ibm_kms_key_rings", "key_ring_id"), }, "endpoint_type": { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "public or private", ForceNew: true, }, @@ -47,26 +49,26 @@ func resourceIBMKmskeyRings() *schema.Resource { } } -func resourceIBMKeyRingValidator() *ResourceValidator { +func ResourceIBMKeyRingValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "key_ring_id", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-zA-Z0-9-]*$`, MinValueLength: 2, MaxValueLength: 100}) - ibmKeyRingResourceValidator := ResourceValidator{ResourceName: "ibm_kms_key_rings", Schema: validateSchema} + ibmKeyRingResourceValidator := validate.ResourceValidator{ResourceName: "ibm_kms_key_rings", Schema: validateSchema} return &ibmKeyRingResourceValidator } func resourceIBMKmsKeyRingCreate(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -79,7 +81,7 @@ func resourceIBMKmsKeyRingCreate(d *schema.ResourceData, meta interface{}) error endpointType := d.Get("endpoint_type").(string) keyRingID := d.Get("key_ring_id").(string) - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -102,14 +104,12 @@ func resourceIBMKmsKeyRingCreate(d *schema.ResourceData, meta interface{}) error err = kpAPI.CreateKeyRing(context.Background(), keyRingID) if err != nil { - return fmt.Errorf( - "Error while creating key ring : %s", err) + return fmt.Errorf("[ERROR] Error while creating key ring : %s", err) } var keyRing string keyRings, err2 := kpAPI.GetKeyRings(context.Background()) if err2 != nil { - return fmt.Errorf( - "Error while fetching key ring : %s", err2) + return fmt.Errorf("[ERROR] Error while fetching key ring : %s", err2) } for _, v := range keyRings.KeyRings { if v.ID == keyRingID { @@ -124,20 +124,20 @@ func resourceIBMKmsKeyRingCreate(d *schema.ResourceData, meta interface{}) error } func resourceIBMKmsKeyRingRead(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } id := strings.Split(d.Id(), ":keyRing:") if len(id) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of keyRingID:keyRing:InstanceCRN", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of keyRingID:keyRing:InstanceCRN", d.Id()) } crn := id[1] crnData := strings.Split(crn, ":") endpointType := d.Get("endpoint_type").(string) instanceID := crnData[len(crnData)-3] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -163,7 +163,7 @@ func resourceIBMKmsKeyRingRead(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil } - return fmt.Errorf("Get Key Rings failed with error: %s", err) + return fmt.Errorf("[ERROR] Get Key Rings failed with error: %s", err) } d.Set("instance_id", instanceID) @@ -177,7 +177,7 @@ func resourceIBMKmsKeyRingRead(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKmsKeyRingDelete(d *schema.ResourceData, meta interface{}) error { - kpAPI, err := meta.(ClientSession).keyManagementAPI() + kpAPI, err := meta.(conns.ClientSession).KeyManagementAPI() if err != nil { return err } @@ -187,7 +187,7 @@ func resourceIBMKmsKeyRingDelete(d *schema.ResourceData, meta interface{}) error endpointType := d.Get("endpoint_type").(string) instanceID := crnData[len(crnData)-3] - rsConClient, err := meta.(ClientSession).ResourceControllerV2API() + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kp_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kp_key.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kp_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kp_key.go index 52bdec04d1..78bdaf4047 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_kp_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms/resource_ibm_kp_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kms import ( "context" @@ -11,11 +11,13 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" kp "github.com/IBM/keyprotect-go-client" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMkey() *schema.Resource { +func ResourceIBMkey() *schema.Resource { return &schema.Resource{ Create: resourceIBMKeyCreate, Read: resourceIBMKeyRead, @@ -82,30 +84,30 @@ func resourceIBMkey() *schema.Resource { Computed: true, Description: "Crn of the key", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", @@ -115,7 +117,7 @@ func resourceIBMkey() *schema.Resource { } func resourceIBMKeyCreate(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyProtectAPI() + api, err := meta.(conns.ClientSession).KeyProtectAPI() if err != nil { return err } @@ -174,7 +176,7 @@ func resourceIBMKeyCreate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKeyRead(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyProtectAPI() + api, err := meta.(conns.ClientSession).KeyProtectAPI() if err != nil { return err } @@ -198,20 +200,20 @@ func resourceIBMKeyRead(d *schema.ResourceData, meta interface{}) error { d.Set("key_name", key.Name) d.Set("crn", key.CRN) - d.Set(ResourceName, key.Name) - d.Set(ResourceCRN, key.CRN) + d.Set(flex.ResourceName, key.Name) + d.Set(flex.ResourceCRN, key.CRN) state := key.State - d.Set(ResourceStatus, strconv.Itoa(state)) + d.Set(flex.ResourceStatus, strconv.Itoa(state)) - rcontroller, err := getBaseController(meta) + rcontroller, err := flex.GetBaseController(meta) if err != nil { return err } id := key.ID crn1 := strings.TrimSuffix(key.CRN, ":key:"+id) - d.Set(ResourceControllerURL, rcontroller+"/services/kms/"+url.QueryEscape(crn1)+"%3A%3A") + d.Set(flex.ResourceControllerURL, rcontroller+"/services/kms/"+url.QueryEscape(crn1)+"%3A%3A") return nil @@ -227,7 +229,7 @@ func resourceIBMKeyUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKeyDelete(d *schema.ResourceData, meta interface{}) error { - api, err := meta.(ClientSession).keyProtectAPI() + api, err := meta.(conns.ClientSession).KeyProtectAPI() if err != nil { return err } @@ -252,7 +254,7 @@ func resourceIBMKeyDelete(d *schema.ResourceData, meta interface{}) error { } func resourceIBMKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - api, err := meta.(ClientSession).keyProtectAPI() + api, err := meta.(conns.ClientSession).KeyProtectAPI() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/README.md new file mode 100644 index 0000000000..2152dfe7ad --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Kubernetes Services + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Kubernetes Services resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/container_addons) +* IBM API Docs: [IBM API Docs for Kubernetes Services](https://containers.cloud.ibm.com/global/swagger-global-api/) +* IBM Kubernetes Services SDK: [IBM SDK for Kubernetes Services](https://github.com/IBM-Cloud/bluemix-go/tree/master/api/container) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_addons.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_addons.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_addons.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_addons.go index d0d114600b..e632369dd0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_addons.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_addons.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -9,9 +9,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func datasourceIBMContainerAddOns() *schema.Resource { +func DataSourceIBMContainerAddOns() *schema.Resource { return &schema.Resource{ Read: datasourceIBMContainerAddOnsRead, @@ -95,7 +96,7 @@ func datasourceIBMContainerAddOns() *schema.Resource { } } func datasourceIBMContainerAddOnsRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_alb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_alb.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_alb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_alb.go index 3df8ab4248..164f032320 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_alb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_alb.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerALB() *schema.Resource { +func DataSourceIBMContainerALB() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerALBRead, @@ -57,7 +58,7 @@ func dataSourceIBMContainerALB() *schema.Resource { } func dataSourceIBMContainerALBRead(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).ContainerAPI() + albClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_alb_cert.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_alb_cert.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_alb_cert.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_alb_cert.go index cf740525d2..5c2a6f4f82 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_alb_cert.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_alb_cert.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerALBCert() *schema.Resource { +func DataSourceIBMContainerALBCert() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerALBCertRead, @@ -78,7 +79,7 @@ func dataSourceIBMContainerALBCert() *schema.Resource { } func dataSourceIBMContainerALBCertRead(d *schema.ResourceData, meta interface{}) error { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_bind_service.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_bind_service.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_bind_service.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_bind_service.go index 232480ef24..b818e780c1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_bind_service.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_bind_service.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerBindService() *schema.Resource { +func DataSourceIBMContainerBindService() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerBindServiceRead, @@ -48,7 +49,7 @@ func dataSourceIBMContainerBindService() *schema.Resource { } func dataSourceIBMContainerBindServiceRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -61,7 +62,7 @@ func dataSourceIBMContainerBindServiceRead(d *schema.ResourceData, meta interfac } else if serviceInstanceID, ok := d.GetOk("service_instance_id"); ok { serviceInstanceNameID = serviceInstanceID.(string) } else { - return fmt.Errorf("Please set either service_instance_name or service_instance_id") + return fmt.Errorf("[ERROR] Please set either service_instance_name or service_instance_id") } targetEnv, err := getClusterTargetHeader(d, meta) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster.go index 3265244c4f..69a9ee30df 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster.go @@ -1,16 +1,20 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Copyright IBM Corp. 2017, 2022 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" + "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerCluster() *schema.Resource { +func DataSourceIBMContainerCluster() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerClusterRead, @@ -171,7 +175,7 @@ func dataSourceIBMContainerCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "all", - ValidateFunc: validateAllowedStringValue([]string{"private", "public", "all"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"private", "public", "all"}), }, "albs": { Type: schema.TypeList, @@ -308,31 +312,36 @@ func dataSourceIBMContainerCluster() *schema.Resource { Computed: true, Description: "email id of the key owner", }, - ResourceControllerURL: { + "image_security_enforcement": { + Type: schema.TypeBool, + Computed: true, + Description: "True if image security enforcement is enabled", + }, + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -342,7 +351,7 @@ func dataSourceIBMContainerCluster() *schema.Resource { } func dataSourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -366,11 +375,11 @@ func dataSourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) } clusterFields, err := csAPI.Find(name, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving cluster: %s", err) } workerFields, err := wrkAPI.List(name, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } workers := make([]string, len(workerFields)) for i, worker := range workerFields { @@ -382,7 +391,7 @@ func dataSourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) if listBoundedServices { servicesBoundToCluster, err := csAPI.ListServicesBoundToCluster(name, "", targetEnv) if err != nil { - return fmt.Errorf("Error retrieving services bound to cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving services bound to cluster: %s", err) } for _, service := range servicesBoundToCluster { boundedService := make(map[string]interface{}) @@ -396,25 +405,25 @@ func dataSourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) workerPools, err := workerPoolsAPI.ListWorkerPools(name, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving worker pools of the cluster %s: %s", name, err) + return fmt.Errorf("[ERROR] Error retrieving worker pools of the cluster %s: %s", name, err) } albs, err := albsAPI.ListClusterALBs(name, targetEnv) if err != nil && !strings.Contains(err.Error(), "The specified cluster is a lite cluster.") && !strings.Contains(err.Error(), "This operation is not supported for your cluster's version.") && !strings.Contains(err.Error(), "The specified cluster is a free cluster.") { - return fmt.Errorf("Error retrieving alb's of the cluster %s: %s", name, err) + return fmt.Errorf("[ERROR] Error retrieving alb's of the cluster %s: %s", name, err) } filterType := d.Get("alb_type").(string) - filteredAlbs := flattenAlbs(albs, filterType) + filteredAlbs := flex.FlattenAlbs(albs, filterType) d.SetId(clusterFields.ID) d.Set("worker_count", clusterFields.WorkerCount) d.Set("workers", workers) d.Set("region", clusterFields.Region) d.Set("bounded_services", boundedServices) - d.Set("vlans", flattenVlans(clusterFields.Vlans)) + d.Set("vlans", flex.FlattenVlans(clusterFields.Vlans)) d.Set("is_trusted", clusterFields.IsTrusted) - d.Set("worker_pools", flattenWorkerPools(workerPools)) + d.Set("worker_pools", flex.FlattenWorkerPools(workerPools)) d.Set("albs", filteredAlbs) d.Set("resource_group_id", clusterFields.ResourceGroupID) d.Set("public_service_endpoint", clusterFields.PublicServiceEndpointEnabled) @@ -426,23 +435,24 @@ func dataSourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) d.Set("ingress_hostname", clusterFields.IngressHostname) d.Set("ingress_secret", clusterFields.IngressSecretName) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") apikeyAPI := csClient.Apikeys() apikeyConfig, err := apikeyAPI.GetApiKeyInfo(name, targetEnv) if err != nil { - return err + log.Printf("[ERROR] Error in GetApiKeyInfo, %s", err) } d.Set("api_key_id", apikeyConfig.ID) d.Set("api_key_owner_name", apikeyConfig.Name) d.Set("api_key_owner_email", apikeyConfig.Email) - d.Set(ResourceName, clusterFields.Name) - d.Set(ResourceCRN, clusterFields.CRN) - d.Set(ResourceStatus, clusterFields.State) - d.Set(ResourceGroupName, clusterFields.ResourceGroupName) + d.Set("image_security_enforcement", clusterFields.ImageSecurityEnabled) + d.Set(flex.ResourceName, clusterFields.Name) + d.Set(flex.ResourceCRN, clusterFields.CRN) + d.Set(flex.ResourceStatus, clusterFields.State) + d.Set(flex.ResourceGroupName, clusterFields.ResourceGroupName) return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_config.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_config.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_config.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_config.go index 75e27e37d6..3c35f4418b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_config.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_config.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -16,9 +16,10 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMContainerClusterConfig() *schema.Resource { +func DataSourceIBMContainerClusterConfig() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerClusterConfigRead, @@ -121,7 +122,7 @@ func dataSourceIBMContainerClusterConfig() *schema.Resource { } func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -133,13 +134,13 @@ func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interf network := d.Get("network").(bool) clusterId := "Cluster_Config_" + name - ibmMutexKV.Lock(clusterId) - defer ibmMutexKV.Unlock(clusterId) + conns.IbmMutexKV.Lock(clusterId) + defer conns.IbmMutexKV.Unlock(clusterId) if len(configDir) == 0 { configDir, err = homedir.Dir() if err != nil { - return fmt.Errorf("Error fetching homedir: %s", err) + return fmt.Errorf("[ERROR] Error fetching homedir: %s", err) } } configDir, _ = filepath.Abs(configDir) @@ -150,7 +151,7 @@ func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interf expectedDir := v1.ComputeClusterConfigDir(configDir, name, admin) configPath = filepath.Join(expectedDir, "config.yml") if !helpers.FileExists(configPath) { - return fmt.Errorf(`Couldn't find the cluster config at expected path %s. Please set "download" to true to download the new config`, configPath) + return fmt.Errorf(`[ERROR] Couldn't find the cluster config at expected path %s. Please set "download" to true to download the new config`, configPath) } d.Set("config_file_path", configPath) @@ -175,11 +176,11 @@ func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interf } return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { calicoConfigFilePath, clusterKeyDetails, err = csAPI.StoreConfigDetail(name, configDir, admin || true, network, targetEnv) } if err != nil { - return fmt.Errorf("Error downloading the cluster config [%s]: %s", name, err) + return fmt.Errorf("[ERROR] Error downloading the cluster config [%s]: %s", name, err) } d.Set("calico_config_file_path", calicoConfigFilePath) d.Set("admin_key", clusterKeyDetails.AdminKey) @@ -203,11 +204,11 @@ func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interf } return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { clusterKeyDetails, err = csAPI.GetClusterConfigDetail(name, configDir, admin, targetEnv) } if err != nil { - return fmt.Errorf("Error downloading the cluster config [%s]: %s", name, err) + return fmt.Errorf("[ERROR] Error downloading the cluster config [%s]: %s", name, err) } d.Set("admin_key", clusterKeyDetails.AdminKey) d.Set("admin_certificate", clusterKeyDetails.Admin) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_versions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_versions.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_versions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_versions.go index 68a5d3c403..348cb791c5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_versions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_versions.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerClusterVersions() *schema.Resource { +func DataSourceIBMContainerClusterVersions() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerClusterVersionsRead, @@ -61,7 +62,7 @@ func dataSourceIBMContainerClusterVersions() *schema.Resource { } func dataSourceIBMContainerClusterVersionsRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_worker.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_worker.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_worker.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_worker.go index 3dd10f1793..24d7fac8e1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_cluster_worker.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_cluster_worker.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerClusterWorker() *schema.Resource { +func DataSourceIBMContainerClusterWorker() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerClusterWorkerRead, @@ -74,7 +76,7 @@ func dataSourceIBMContainerClusterWorker() *schema.Resource { Optional: true, Description: "ID of the resource group.", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", @@ -84,7 +86,7 @@ func dataSourceIBMContainerClusterWorker() *schema.Resource { } func dataSourceIBMContainerClusterWorkerRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -98,7 +100,7 @@ func dataSourceIBMContainerClusterWorkerRead(d *schema.ResourceData, meta interf workerFields, err := wrkAPI.Get(workerID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving worker: %s", err) + return fmt.Errorf("[ERROR] Error retrieving worker: %s", err) } d.SetId(workerFields.ID) @@ -108,11 +110,11 @@ func dataSourceIBMContainerClusterWorkerRead(d *schema.ResourceData, meta interf d.Set("public_vlan", workerFields.PublicVlan) d.Set("private_ip", workerFields.PrivateIP) d.Set("public_ip", workerFields.PublicIP) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_nlb_dns.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_nlb_dns.go new file mode 100644 index 0000000000..98902bbe65 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_nlb_dns.go @@ -0,0 +1,102 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMContainerNLBDNS() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMContainerNLBDNSRead, + + Schema: map[string]*schema.Schema{ + "cluster": { + Type: schema.TypeString, + Required: true, + Description: "A unique name of the cluster", + }, + "nlb_config": { + Type: schema.TypeList, + Computed: true, + Description: "List of nlb config of cluster", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "secret_name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the secret.", + }, + "secret_status": { + Type: schema.TypeString, + Computed: true, + Description: "Status of Secret.", + }, + "cluster": { + Type: schema.TypeString, + Computed: true, + Description: "Cluster Id.", + }, + "dns_type": { + Type: schema.TypeString, + Computed: true, + Description: "Type of DNS.", + }, + "lb_hostname": { + Type: schema.TypeString, + Computed: true, + Description: "Host Name of load Balancer.", + }, + "nlb_ips": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: " NLB IPs.", + }, + "nlb_sub_domain": { + Type: schema.TypeString, + Computed: true, + Description: "NLB Sub-Domain.", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: " Nlb Type.", + }, + "secret_namespace": { + Type: schema.TypeString, + Computed: true, + Description: "Namespace of Secret.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMContainerNLBDNSRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + name := d.Get("cluster").(string) + + kubeClient, err := meta.(conns.ClientSession).VpcContainerAPI() + if err != nil { + return diag.FromErr(err) + } + + nlbData, err := kubeClient.NlbDns().GetNLBDNSList(name) + if err != nil || nlbData == nil || len(nlbData) < 1 { + return diag.FromErr(fmt.Errorf("[ERROR] Error Listing NLB DNS (%s): %s", name, err)) + } + d.SetId(name) + d.Set("cluster", name) + d.Set("nlb_config", flex.FlattenNlbConfigs(nlbData)) + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_storage_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_storage_attachment.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_storage_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_storage_attachment.go index 002b3fc430..cdef121624 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_storage_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_storage_attachment.go @@ -1,14 +1,15 @@ -package ibm +package kubernetes import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerVpcWorkerVolumeAttachment() *schema.Resource { +func DataSourceIBMContainerVpcWorkerVolumeAttachment() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMContainerVpcWorkerVolumeAttachmentRead, @@ -65,7 +66,7 @@ func dataSourceIBMContainerVpcWorkerVolumeAttachment() *schema.Resource { } func dataSourceIBMContainerVpcWorkerVolumeAttachmentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_alb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_alb.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_alb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_alb.go index 8acd1f6398..41f7307c8d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_alb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_alb.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerVPCClusterALB() *schema.Resource { +func DataSourceIBMContainerVPCClusterALB() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerVpcALBRead, Schema: map[string]*schema.Schema{ @@ -66,7 +67,7 @@ func dataSourceIBMContainerVPCClusterALB() *schema.Resource { } func dataSourceIBMContainerVpcALBRead(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_cluster.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_cluster.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_cluster.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_cluster.go index 3151263341..ff9d69ffaf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_cluster.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_cluster.go @@ -1,13 +1,16 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Copyright IBM Corp. 2017, 2022 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +18,7 @@ const ( _OPENSHIFT = "_openshift" ) -func dataSourceIBMContainerVPCCluster() *schema.Resource { +func DataSourceIBMContainerVPCCluster() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerClusterVPCRead, @@ -115,7 +118,7 @@ func dataSourceIBMContainerVPCCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "all", - ValidateFunc: validateAllowedStringValue([]string{"private", "public", "all"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"private", "public", "all"}), }, "albs": { Type: schema.TypeList, @@ -252,32 +255,36 @@ func dataSourceIBMContainerVPCCluster() *schema.Resource { Computed: true, Description: "email id of the key owner", }, - - ResourceControllerURL: { + "image_security_enforcement": { + Type: schema.TypeBool, + Computed: true, + Description: "True if image security enforcement is enabled", + }, + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -287,7 +294,7 @@ func dataSourceIBMContainerVPCCluster() *schema.Resource { } func dataSourceIBMContainerClusterVPCRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -308,7 +315,7 @@ func dataSourceIBMContainerClusterVPCRead(d *schema.ResourceData, meta interface cls, err := csClient.Clusters().GetCluster(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving container vpc cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving container vpc cluster: %s", err) } d.SetId(cls.ID) @@ -336,7 +343,7 @@ func dataSourceIBMContainerClusterVPCRead(d *schema.ResourceData, meta interface workerFields, err := csClient.Workers().ListWorkers(clusterID, false, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } workers := make([]string, len(workerFields)) for i, worker := range workerFields { @@ -348,33 +355,33 @@ func dataSourceIBMContainerClusterVPCRead(d *schema.ResourceData, meta interface //Get worker pools pools, err := csClient.WorkerPools().ListWorkerPools(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving worker pools for container vpc cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving worker pools for container vpc cluster: %s", err) } - d.Set("worker_pools", flattenVpcWorkerPools(pools)) + d.Set("worker_pools", flex.FlattenVpcWorkerPools(pools)) if !strings.HasSuffix(cls.MasterKubeVersion, _OPENSHIFT) { albs, err := csClient.Albs().ListClusterAlbs(clusterID, targetEnv) if err != nil && !strings.Contains(err.Error(), "The specified cluster is a lite cluster.") { - return fmt.Errorf("Error retrieving alb's of the cluster %s: %s", clusterID, err) + return fmt.Errorf("[ERROR] Error retrieving alb's of the cluster %s: %s", clusterID, err) } filterType := d.Get("alb_type").(string) - filteredAlbs := flattenVpcAlbs(albs, filterType) + filteredAlbs := flex.FlattenVpcAlbs(albs, filterType) d.Set("albs", filteredAlbs) } - tags, err := GetTagsUsingCRN(meta, cls.CRN) + tags, err := flex.GetTagsUsingCRN(meta, cls.CRN) if err != nil { log.Printf( "An error occured during reading of instance (%s) tags : %s", d.Id(), err) } d.Set("tags", tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - csClientv1, err := meta.(ClientSession).ContainerAPI() + csClientv1, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -399,11 +406,12 @@ func dataSourceIBMContainerClusterVPCRead(d *schema.ResourceData, meta interface d.Set("api_key_owner_email", apikeyConfig.Email) } } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") - d.Set(ResourceName, cls.Name) - d.Set(ResourceCRN, cls.CRN) - d.Set(ResourceStatus, cls.State) - d.Set(ResourceGroupName, cls.ResourceGroupName) + d.Set("image_security_enforcement", cls.ImageSecurityEnabled) + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceName, cls.Name) + d.Set(flex.ResourceCRN, cls.CRN) + d.Set(flex.ResourceStatus, cls.State) + d.Set(flex.ResourceGroupName, cls.ResourceGroupName) return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_cluster_worker.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_cluster_worker.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_cluster_worker.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_cluster_worker.go index ea9055b4a9..7d0a4d3ef3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_cluster_worker.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_cluster_worker.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerVPCClusterWorker() *schema.Resource { +func DataSourceIBMContainerVPCClusterWorker() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerVPCClusterWorkerRead, @@ -74,7 +76,7 @@ func dataSourceIBMContainerVPCClusterWorker() *schema.Resource { Optional: true, Description: "ID of the resource group.", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", @@ -84,7 +86,7 @@ func dataSourceIBMContainerVPCClusterWorker() *schema.Resource { } func dataSourceIBMContainerVPCClusterWorkerRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -100,7 +102,7 @@ func dataSourceIBMContainerVPCClusterWorkerRead(d *schema.ResourceData, meta int workerFields, err := wrkAPI.Get(clusterID, workerID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving worker: %s", err) + return fmt.Errorf("[ERROR] Error retrieving worker: %s", err) } d.SetId(workerFields.ID) @@ -109,12 +111,12 @@ func dataSourceIBMContainerVPCClusterWorkerRead(d *schema.ResourceData, meta int d.Set("state", workerFields.Health.State) d.Set("pool_id", workerFields.PoolID) d.Set("pool_name", workerFields.PoolName) - d.Set("network_interfaces", flattenNetworkInterfaces(workerFields.NetworkInterfaces)) - controller, err := getBaseController(meta) + d.Set("network_interfaces", flex.FlattenNetworkInterfaces(workerFields.NetworkInterfaces)) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_worker_pool.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_worker_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_worker_pool.go index 61d9243d3e..95ba423f11 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_vpc_worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_vpc_worker_pool.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerVpcClusterWorkerPool() *schema.Resource { +func DataSourceIBMContainerVpcClusterWorkerPool() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerVpcClusterWorkerPoolRead, Schema: map[string]*schema.Schema{ @@ -67,7 +68,7 @@ func dataSourceIBMContainerVpcClusterWorkerPool() *schema.Resource { } } func dataSourceIBMContainerVpcClusterWorkerPoolRead(d *schema.ResourceData, meta interface{}) error { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_worker_pool.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_worker_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_worker_pool.go index 8ef9e3339f..55a7532425 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_container_worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/data_source_ibm_container_worker_pool.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMContainerWorkerPool() *schema.Resource { +func DataSourceIBMContainerWorkerPool() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMContainerWorkerPoolRead, @@ -105,7 +107,7 @@ func dataSourceIBMContainerWorkerPool() *schema.Resource { } func dataSourceIBMContainerWorkerPoolRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -141,7 +143,7 @@ func dataSourceIBMContainerWorkerPoolRead(d *schema.ResourceData, meta interface if workerPool.Labels != nil { d.Set("labels", workerPool.Labels) } - d.Set("zones", flattenZones(workerPool.Zones)) + d.Set("zones", flex.FlattenZones(workerPool.Zones)) if strings.Contains(machineType, "encrypted") { d.Set("disk_encryption", true) } else { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_addons.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_addons.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_addons.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_addons.go index 49bcb5113a..27522dc787 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_addons.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_addons.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "bytes" @@ -15,10 +15,11 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/bluemix-go/bmxerror" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMContainerAddOns() *schema.Resource { +func ResourceIBMContainerAddOns() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerAddOnsCreate, Read: resourceIBMContainerAddOnsRead, @@ -115,7 +116,7 @@ func resourceIBMContainerAddOns() *schema.Resource { } } func resourceIBMContainerAddOnsCreate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -162,7 +163,7 @@ func expandAddOns(d *schema.ResourceData, meta interface{}, cluster string, targ } } if len(existingAddons) > 0 { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return addOns, err } @@ -174,13 +175,13 @@ func expandAddOns(d *schema.ResourceData, meta interface{}, cluster string, targ if existAddon.Name == ao["name"].(string) { exist = true if existAddon.Version != ao["version"].(string) { - if (ao["version"].(string) == existAddon.TargetVersion) && (StringContains(existAddon.AllowedUpgradeVersion, ao["version"].(string))) { + if flex.StringContains(existAddon.AllowedUpgradeVersion, ao["version"].(string)) { // This block upgrates addon version if addon has `allowed_upgrade_versions` err := updateAddOnVersion(d, meta, ao, cluster, targetEnv) if err != nil { return addOns, err } - } else if (ao["version"].(string) == existAddon.TargetVersion) && (!StringContains(existAddon.AllowedUpgradeVersion, ao["version"].(string))) { + } else if (ao["version"].(string) == existAddon.TargetVersion) && (!flex.StringContains(existAddon.AllowedUpgradeVersion, ao["version"].(string))) { // This block reinstalls addons that dont have upgradation capability //Uninstall AddOn with old version rmParams := v1.ConfigureAddOns{} @@ -232,7 +233,7 @@ func expandAddOns(d *schema.ResourceData, meta interface{}, cluster string, targ return addOns, nil } func updateAddOnVersion(d *schema.ResourceData, meta interface{}, u map[string]interface{}, cluster string, targetEnv v1.ClusterTargetHeader) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -255,7 +256,7 @@ func updateAddOnVersion(d *schema.ResourceData, meta interface{}, u map[string]i return nil } func resourceIBMContainerAddOnsRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -314,7 +315,7 @@ func flattenAddOns(result []v1.AddOn) (resp *schema.Set, err error) { return schema.NewSet(resourceIBMContainerAddonsHash, addOns), nil } func resourceIBMContainerAddOnsUpdate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -341,7 +342,7 @@ func resourceIBMContainerAddOnsUpdate(d *schema.ResourceData, meta interface{}) for _, oA := range os.List() { oldPack := oA.(map[string]interface{}) if (strings.Compare(newPack["name"].(string), oldPack["name"].(string)) == 0) && (strings.Compare(newPack["version"].(string), oldPack["version"].(string)) != 0) { - if (newPack["version"].(string) == oldPack["target_version"].(string)) && (StringContains(expandStringList(oldPack["allowed_upgrade_versions"].([]interface{})), newPack["version"].(string))) { + if flex.StringContains(flex.ExpandStringList(oldPack["allowed_upgrade_versions"].([]interface{})), newPack["version"].(string)) { // This block upgrates addon version if addon has `allowed_upgrade_versions` err := updateAddOnVersion(d, meta, newPack, cluster, targetEnv) if err != nil { @@ -349,7 +350,7 @@ func resourceIBMContainerAddOnsUpdate(d *schema.ResourceData, meta interface{}) } ns.Remove(nA) os.Remove(oA) - } else if (newPack["version"].(string) == oldPack["target_version"].(string)) && (!StringContains(expandStringList(oldPack["allowed_upgrade_versions"].([]interface{})), newPack["version"].(string))) { + } else if (newPack["version"].(string) == oldPack["target_version"].(string)) && (!flex.StringContains(flex.ExpandStringList(oldPack["allowed_upgrade_versions"].([]interface{})), newPack["version"].(string))) { // This block reinstalls addons that dont have upgradation capability //Uninstall AddOn with old version rmParams := v1.ConfigureAddOns{} @@ -438,7 +439,7 @@ func resourceIBMContainerAddOnsUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMContainerAddOnsDelete(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -463,7 +464,7 @@ func resourceIBMContainerAddOnsDelete(d *schema.ResourceData, meta interface{}) return nil } func waitForContainerAddOns(d *schema.ResourceData, meta interface{}, cluster, timeout string) (interface{}, error) { - addOnClient, err := meta.(ClientSession).ContainerAPI() + addOnClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return false, err } @@ -499,7 +500,7 @@ func waitForContainerAddOns(d *schema.ResourceData, meta interface{}, cluster, t } func resourceIBMContainerAddOnsExists(d *schema.ResourceData, meta interface{}) (bool, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return false, err } @@ -530,5 +531,5 @@ func resourceIBMContainerAddonsHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", a["name"].(string))) buf.WriteString(fmt.Sprintf("%s-", a["version"].(string))) - return hashcode.String(buf.String()) + return conns.String(buf.String()) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb.go index 727dfaedef..58e7978d71 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -13,9 +13,10 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func resourceIBMContainerALB() *schema.Resource { +func ResourceIBMContainerALB() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerALBCreate, Read: resourceIBMContainerALBRead, @@ -96,7 +97,7 @@ func resourceIBMContainerALB() *schema.Resource { } func resourceIBMContainerALBCreate(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).ContainerAPI() + albClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -108,7 +109,7 @@ func resourceIBMContainerALBCreate(d *schema.ResourceData, meta interface{}) err } else if v, ok := d.GetOkExists("disable_deployment"); ok { disableDeployment = v.(bool) } else { - return fmt.Errorf("Provide either `enable` or `disable_deployment`") + return fmt.Errorf("[ERROR] Provide either `enable` or `disable_deployment`") } numOfInstances := "2" @@ -126,8 +127,7 @@ func resourceIBMContainerALBCreate(d *schema.ResourceData, meta interface{}) err _, err = waitForClusterAvailable(d, meta, albID) if err != nil { - return fmt.Errorf( - "Error waiting for cluster resources availabilty (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster resources availabilty (%s) : %s", d.Id(), err) } albAPI := albClient.Albs() @@ -142,15 +142,14 @@ func resourceIBMContainerALBCreate(d *schema.ResourceData, meta interface{}) err d.SetId(albID) _, err = waitForContainerALB(d, meta, albID, schema.TimeoutCreate, enable, disableDeployment) if err != nil { - return fmt.Errorf( - "Error waiting for create resource alb (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for create resource alb (%s) : %s", d.Id(), err) } return resourceIBMContainerALBRead(d, meta) } func resourceIBMContainerALBRead(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).ContainerAPI() + albClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -180,7 +179,7 @@ func resourceIBMContainerALBRead(d *schema.ResourceData, meta interface{}) error } func resourceIBMContainerALBUpdate(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).ContainerAPI() + albClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -202,8 +201,7 @@ func resourceIBMContainerALBUpdate(d *schema.ResourceData, meta interface{}) err _, err = waitForClusterAvailable(d, meta, albID) if err != nil { - return fmt.Errorf( - "Error waiting for cluster resources availabilty (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster resources availabilty (%s) : %s", d.Id(), err) } err = albAPI.ConfigureALB(albID, params, disableDeployment, targetEnv) @@ -212,8 +210,7 @@ func resourceIBMContainerALBUpdate(d *schema.ResourceData, meta interface{}) err } _, err = waitForContainerALB(d, meta, albID, schema.TimeoutUpdate, enable, disableDeployment) if err != nil { - return fmt.Errorf( - "Error waiting for updating resource alb (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for updating resource alb (%s) : %s", d.Id(), err) } } @@ -221,7 +218,7 @@ func resourceIBMContainerALBUpdate(d *schema.ResourceData, meta interface{}) err } func waitForContainerALB(d *schema.ResourceData, meta interface{}, albID, timeout string, enable, disableDeployment bool) (interface{}, error) { - albClient, err := meta.(ClientSession).ContainerAPI() + albClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return false, err } @@ -237,16 +234,16 @@ func waitForContainerALB(d *schema.ResourceData, meta interface{}, albID, timeou alb, err := albClient.Albs().GetALB(albID, targetEnv) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The resource alb %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The resource alb %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } if enable { - if alb.Enable == false { + if !alb.Enable { return alb, "pending", nil } } else if disableDeployment { - if alb.Enable == true { + if alb.Enable { return alb, "pending", nil } } @@ -268,7 +265,7 @@ func resourceIBMContainerALBDelete(d *schema.ResourceData, meta interface{}) err // WaitForWorkerAvailable Waits for worker creation func waitForClusterAvailable(d *schema.ResourceData, meta interface{}, albID string) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -304,7 +301,7 @@ func getAlbTargetHeader(d *schema.ResourceData, meta interface{}) (v1.ClusterTar region = v.(string) } - sess, err := meta.(ClientSession).BluemixSession() + sess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return v1.ClusterTargetHeader{}, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb_cert.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb_cert.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb_cert.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb_cert.go index 23b0688142..c74a073e2e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb_cert.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb_cert.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -13,9 +13,11 @@ import ( v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMContainerALBCert() *schema.Resource { +func ResourceIBMContainerALBCert() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerALBCertCreate, Read: resourceIBMContainerALBCertRead, @@ -98,7 +100,7 @@ func resourceIBMContainerALBCert() *schema.Resource { } func resourceIBMContainerALBCertCreate(d *schema.ResourceData, meta interface{}) error { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -128,19 +130,18 @@ func resourceIBMContainerALBCertCreate(d *schema.ResourceData, meta interface{}) d.SetId(fmt.Sprintf("%s/%s/%s", cluster, secretName, response.Namespace)) _, err = waitForContainerALBCert(d, meta, schema.TimeoutCreate) if err != nil { - return fmt.Errorf( - "Error waiting for create resource alb cert (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for create resource alb cert (%s) : %s", d.Id(), err) } return resourceIBMContainerALBCertRead(d, meta) } func resourceIBMContainerALBCertRead(d *schema.ResourceData, meta interface{}) error { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -172,14 +173,14 @@ func resourceIBMContainerALBCertRead(d *schema.ResourceData, meta interface{}) e } func resourceIBMContainerALBCertDelete(d *schema.ResourceData, meta interface{}) error { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } ingressAPI := ingressClient.Ingresses() - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -208,11 +209,11 @@ func resourceIBMContainerALBCertDelete(d *schema.ResourceData, meta interface{}) } func waitForALBCertDelete(d *schema.ResourceData, meta interface{}, timeout string) (interface{}, error) { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -249,11 +250,11 @@ func waitForALBCertDelete(d *schema.ResourceData, meta interface{}, timeout stri } func resourceIBMContainerALBCertUpdate(d *schema.ResourceData, meta interface{}) error { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -282,20 +283,19 @@ func resourceIBMContainerALBCertUpdate(d *schema.ResourceData, meta interface{}) _, err = waitForContainerALBCert(d, meta, schema.TimeoutUpdate) if err != nil { - return fmt.Errorf( - "Error waiting for updating resource alb cert (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for updating resource alb cert (%s) : %s", d.Id(), err) } } return resourceIBMContainerALBCertRead(d, meta) } func resourceIBMContainerALBCertExists(d *schema.ResourceData, meta interface{}) (bool, error) { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -322,11 +322,11 @@ func resourceIBMContainerALBCertExists(d *schema.ResourceData, meta interface{}) } func waitForContainerALBCert(d *schema.ResourceData, meta interface{}, timeout string) (interface{}, error) { - ingressClient, err := meta.(ClientSession).VpcContainerAPI() + ingressClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -351,7 +351,7 @@ func waitForContainerALBCert(d *schema.ResourceData, meta interface{}, timeout s } if alb.Status != "created" { if strings.Contains(alb.Status, "failed") { - return alb, "failed", fmt.Errorf("The resource alb cert %s failed: %v", d.Id(), err) + return alb, "failed", fmt.Errorf("[ERROR] The resource alb cert %s failed: %v", d.Id(), err) } if alb.Status == "updated" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb_create.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb_create.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb_create.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb_create.go index db794f9e60..41d14a1122 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_alb_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_alb_create.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -11,9 +11,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func resourceIBMContainerAlbCreate() *schema.Resource { +func ResourceIBMContainerAlbCreate() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerClassicAlbCreate, Read: resourceIBMContainerALBRead, @@ -113,7 +114,7 @@ func resourceIBMContainerAlbCreate() *schema.Resource { func resourceIBMContainerClassicAlbCreate(d *schema.ResourceData, meta interface{}) error { log.Println("resourceIBMContainerClassicAlbCreate") - albClient, err := meta.(ClientSession).ContainerAPI() + albClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -170,7 +171,7 @@ func resourceIBMContainerClassicAlbCreate(d *schema.ResourceData, meta interface //v1.AlbCreateResp albResp, err := albAPI.CreateALB(params, cluster, targetEnv) if err != nil { - return fmt.Errorf("Error creating ALb to the cluster %s", err) + return fmt.Errorf("[ERROR] Error creating ALb to the cluster %s", err) } d.SetId(albResp.Alb) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_api_key_reset.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_api_key_reset.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_api_key_reset.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_api_key_reset.go index 9461f52326..9b35aee55b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_api_key_reset.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_api_key_reset.go @@ -1,15 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMContainerAPIKeyReset() *schema.Resource { +func ResourceIBMContainerAPIKeyReset() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerAPIKeyResetUpdate, Read: resourceIBMContainerAPIKeyResetRead, @@ -42,7 +44,7 @@ func resourceIBMContainerAPIKeyReset() *schema.Resource { func resourceIBMContainerAPIKeyResetUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("reset_api_key") { - apikeyClient, err := meta.(ClientSession).ContainerAPI() + apikeyClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -58,7 +60,7 @@ func resourceIBMContainerAPIKeyResetUpdate(d *schema.ResourceData, meta interfac return err } if targetEnv.ResourceGroup == "" { - defaultRg, err := defaultResourceGroup(meta) + defaultRg, err := flex.DefaultResourceGroup(meta) if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_bind_service.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_bind_service.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_bind_service.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_bind_service.go index bd5fca1c22..30409b8b4d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_bind_service.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_bind_service.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -9,9 +9,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMContainerBindService() *schema.Resource { +func ResourceIBMContainerBindService() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerBindServiceCreate, Read: resourceIBMContainerBindServiceRead, @@ -90,7 +92,7 @@ func resourceIBMContainerBindService() *schema.Resource { Optional: true, Description: "ID of the resource group.", ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "tags": { Type: schema.TypeSet, @@ -104,16 +106,16 @@ func resourceIBMContainerBindService() *schema.Resource { } func getClusterTargetHeader(d *schema.ResourceData, meta interface{}) (v1.ClusterTargetHeader, error) { - _, err := meta.(ClientSession).BluemixSession() + _, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return v1.ClusterTargetHeader{}, err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return v1.ClusterTargetHeader{}, err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount targetEnv := v1.ClusterTargetHeader{ AccountID: accountID, @@ -128,7 +130,7 @@ func getClusterTargetHeader(d *schema.ResourceData, meta interface{}) (v1.Cluste } func resourceIBMContainerBindServiceCreate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -140,7 +142,7 @@ func resourceIBMContainerBindServiceCreate(d *schema.ResourceData, meta interfac } else if serviceInstanceID, ok := d.GetOk("service_instance_id"); ok { serviceInstanceNameID = serviceInstanceID.(string) } else { - return fmt.Errorf("Please set either service_instance_name or service_instance_id") + return fmt.Errorf("[ERROR] Please set either service_instance_name or service_instance_id") } bindService := v1.ServiceBindRequest{ @@ -175,16 +177,16 @@ func resourceIBMContainerBindServiceUpdate(d *schema.ResourceData, meta interfac } func resourceIBMContainerBindServiceRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } if len(parts) < 3 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of clusterNameID/serviceInstanceNameID/namespaceID", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of clusterNameID/serviceInstanceNameID/namespaceID", d.Id()) } clusterNameID := parts[0] serviceInstanceNameID := parts[1] @@ -210,11 +212,11 @@ func resourceIBMContainerBindServiceRead(d *schema.ResourceData, meta interface{ } func resourceIBMContainerBindServiceDelete(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -228,7 +230,7 @@ func resourceIBMContainerBindServiceDelete(d *schema.ResourceData, meta interfac err = csClient.Clusters().UnBindService(clusterNameID, namespace, serviceInstanceNameID, targetEnv) if err != nil { - return fmt.Errorf("Error unbinding service: %s", err) + return fmt.Errorf("[ERROR] Error unbinding service: %s", err) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_cluster.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_cluster.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_cluster.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_cluster.go index bc961f1689..df91816033 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_cluster.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_cluster.go @@ -1,7 +1,7 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Copyright IBM Corp. 2017, 2022 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "context" @@ -18,6 +18,9 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -47,7 +50,7 @@ const ( const PUBLIC_SUBNET_TYPE = "public" -func resourceIBMContainerCluster() *schema.Resource { +func ResourceIBMContainerCluster() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerClusterCreate, Read: resourceIBMContainerClusterRead, @@ -64,7 +67,7 @@ func resourceIBMContainerCluster() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -121,7 +124,7 @@ func resourceIBMContainerCluster() *schema.Resource { Optional: true, Default: 0, Description: "Number of worker nodes", - ValidateFunc: validateWorkerNum, + ValidateFunc: validate.ValidateWorkerNum, Deprecated: "This field is deprecated", }, @@ -130,7 +133,7 @@ func resourceIBMContainerCluster() *schema.Resource { Optional: true, Default: 1, Description: "The size of the default worker pool", - ValidateFunc: validateWorkerNum, + ValidateFunc: validate.ValidateWorkerNum, }, "labels": { @@ -160,7 +163,7 @@ func resourceIBMContainerCluster() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( "ibm_container_cluster", "worker_taints"), }, @@ -250,7 +253,7 @@ func resourceIBMContainerCluster() *schema.Resource { Type: schema.TypeString, ForceNew: true, Required: true, - ValidateFunc: validateAllowedStringValue([]string{hardwareShared, hardwareDedicated}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{hardwareShared, hardwareDedicated}), Description: "Hardware type", }, @@ -258,7 +261,7 @@ func resourceIBMContainerCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Deprecated: "This field is deprecated", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "public_vlan_id": { Type: schema.TypeString, @@ -296,7 +299,7 @@ func resourceIBMContainerCluster() *schema.Resource { "entitlement": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", }, @@ -310,7 +313,7 @@ func resourceIBMContainerCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Default: ingressReady, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, ValidateFunc: validation.StringInSlice([]string{masterNodeReady, oneWorkerNodeReady, ingressReady}, true), Description: "wait_till can be configured for Master Ready, One worker Ready or Ingress Ready", }, @@ -344,14 +347,14 @@ func resourceIBMContainerCluster() *schema.Resource { Optional: true, ForceNew: true, Default: false, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Boolean value set to true when subnet creation is not required.", }, "is_trusted": { Type: schema.TypeBool, Optional: true, Deprecated: "This field is deprecated", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "server_url": { Type: schema.TypeString, @@ -377,7 +380,7 @@ func resourceIBMContainerCluster() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"slack"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"slack"}), }, "url": { Type: schema.TypeString, @@ -399,7 +402,7 @@ func resourceIBMContainerCluster() *schema.Resource { Optional: true, Description: "ID of the resource group.", Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "org_guid": { @@ -429,8 +432,8 @@ func resourceIBMContainerCluster() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_container_cluster", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_container_cluster", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the resource", }, @@ -563,7 +566,7 @@ func resourceIBMContainerCluster() *schema.Resource { "gateway_enabled": { Type: schema.TypeBool, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Default: false, Description: "Set true for gateway enabled clusters", }, @@ -572,32 +575,37 @@ func resourceIBMContainerCluster() *schema.Resource { Computed: true, Description: "CRN of resource instance", }, - - ResourceControllerURL: { + "image_security_enforcement": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Set true to enable image security enforcement policies", + }, + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -606,32 +614,36 @@ func resourceIBMContainerCluster() *schema.Resource { } } -func resourceIBMContainerClusterValidator() *ResourceValidator { +func ResourceIBMContainerClusterValidator() *validate.ResourceValidator { tainteffects := "NoSchedule,PreferNoSchedule,NoExecute" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "worker_taints", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: tainteffects}) - ibmContainerClusterResourceValidator := ResourceValidator{ResourceName: "ibm_container_cluster", Schema: validateSchema} + ibmContainerClusterResourceValidator := validate.ResourceValidator{ResourceName: "ibm_container_cluster", Schema: validateSchema} return &ibmContainerClusterResourceValidator } func resourceIBMContainerClusterCreate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() + if err != nil { + return err + } + csClientV2, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -652,6 +664,7 @@ func resourceIBMContainerClusterCreate(d *schema.ResourceData, meta interface{}) case hardwareShared: hardware = isolationPublic } + imageSecurityEnabled := d.Get("image_security_enforcement").(bool) params := v1.ClusterCreateRequest{ Name: name, @@ -682,10 +695,10 @@ func resourceIBMContainerClusterCreate(d *schema.ResourceData, meta interface{}) params.PrivateEndpointEnabled = v.(bool) params.GatewayEnabled = gatewayEnabled } else { - return fmt.Errorf("set private_service_endpoint to true for gateway_enabled clusters") + return fmt.Errorf("[ERROR] set private_service_endpoint to true for gateway_enabled clusters") } } else { - return fmt.Errorf("set private_service_endpoint to true for gateway_enabled clusters") + return fmt.Errorf("[ERROR] set private_service_endpoint to true for gateway_enabled clusters") } } if v, ok := d.GetOk("kube_version"); ok { @@ -709,6 +722,17 @@ func resourceIBMContainerClusterCreate(d *schema.ResourceData, meta interface{}) } d.SetId(cls.ID) + targetEnvV2, err := getVpcClusterTargetHeader(d, meta) + if err != nil { + return err + } + if imageSecurityEnabled { + err = csClientV2.Clusters().EnableImageSecurityEnforcement(cls.ID, targetEnvV2) + if err != nil { + return err + } + } + _, err = waitForClusterMasterAvailable(d, meta) if err != nil { return err @@ -725,7 +749,7 @@ func resourceIBMContainerClusterCreate(d *schema.ResourceData, meta interface{}) } func resourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -741,12 +765,12 @@ func resourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) e clusterID := d.Id() cls, err := csClient.Clusters().Find(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving armada cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving armada cluster: %s", err) } workerFields, err := wrkAPI.List(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } workerCount := 0 workers := []map[string]string{} @@ -781,14 +805,14 @@ func resourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) e if poolContains { workersByPool, err := wrkAPI.ListByWorkerPool(clusterID, poolName, false, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers of default worker pool for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers of default worker pool for cluster: %s", err) } // to get the private and public vlan IDs of the gateway enabled cluster. if poolName == computeWorkerPool { gatewayWorkersByPool, err := wrkAPI.ListByWorkerPool(clusterID, gatewayWorkerpool, false, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers of default worker pool for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers of default worker pool for cluster: %s", err) } d.Set("public_vlan_id", gatewayWorkersByPool[0].PublicVlan) d.Set("private_vlan_id", gatewayWorkersByPool[0].PrivateVlan) @@ -823,7 +847,7 @@ func resourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) e if err != nil { return err } - d.Set("labels", IgnoreSystemLabels(defaultWorkerPool.Labels)) + d.Set("labels", flex.IgnoreSystemLabels(defaultWorkerPool.Labels)) zones := defaultWorkerPool.Zones for _, zone := range zones { if zone.ID == cls.DataCenter { @@ -831,13 +855,13 @@ func resourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) e break } } - d.Set("worker_pools", flattenWorkerPools(workerPools)) + d.Set("worker_pools", flex.FlattenWorkerPools(workerPools)) } albs, err := albsAPI.ListClusterALBs(clusterID, targetEnv) if err != nil && !strings.Contains(err.Error(), "The specified cluster is a lite cluster.") && !strings.Contains(err.Error(), "This operation is not supported for your cluster's version.") && !strings.Contains(err.Error(), "The specified cluster is a free cluster.") { - return fmt.Errorf("Error retrieving alb's of the cluster %s: %s", clusterID, err) + return fmt.Errorf("[ERROR] Error retrieving alb's of the cluster %s: %s", clusterID, err) } d.Set("name", cls.Name) @@ -854,34 +878,40 @@ func resourceIBMContainerClusterRead(d *schema.ResourceData, meta interface{}) e } else { d.Set("kube_version", strings.Split(cls.MasterKubeVersion, "_")[0]) } - d.Set("albs", flattenAlbs(albs, "all")) + d.Set("albs", flex.FlattenAlbs(albs, "all")) d.Set("resource_group_id", cls.ResourceGroupID) d.Set("public_service_endpoint", cls.PublicServiceEndpointEnabled) d.Set("private_service_endpoint", cls.PrivateServiceEndpointEnabled) d.Set("public_service_endpoint_url", cls.PublicServiceEndpointURL) d.Set("private_service_endpoint_url", cls.PrivateServiceEndpointURL) d.Set("crn", cls.CRN) - tags, err := GetTagsUsingCRN(meta, cls.CRN) + tags, err := flex.GetTagsUsingCRN(meta, cls.CRN) if err != nil { log.Printf( "An error occured during reading of instance (%s) tags : %s", d.Id(), err) } d.Set("tags", tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") - d.Set(ResourceName, cls.Name) - d.Set(ResourceCRN, cls.CRN) - d.Set(ResourceStatus, cls.State) - d.Set(ResourceGroupName, cls.ResourceGroupName) + d.Set("image_security_enforcement", cls.ImageSecurityEnabled) + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceName, cls.Name) + d.Set(flex.ResourceCRN, cls.CRN) + d.Set(flex.ResourceStatus, cls.State) + d.Set(flex.ResourceGroupName, cls.ResourceGroupName) return nil } func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() + if err != nil { + return err + } + + csClientV2, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -891,6 +921,11 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) return err } + targetEnvV2, err := getVpcClusterTargetHeader(d, meta) + if err != nil { + return err + } + subnetAPI := csClient.Subnets() whkAPI := csClient.WebHooks() wrkAPI := csClient.Workers() @@ -916,8 +951,7 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) } _, err = WaitForClusterVersionUpdate(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for cluster (%s) version to be updated: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster (%s) version to be updated: %s", d.Id(), err) } } // "update_all_workers" deafult is false, enable to true when all worker nodes to be updated @@ -926,7 +960,7 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) if updateAllWorkers || d.HasChange("patch_version") || d.HasChange("retry_patch_version") { workerFields, err := wrkAPI.List(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } waitForWorkerUpdate := d.Get("wait_for_worker_update").(bool) @@ -943,14 +977,13 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) err = wrkAPI.Update(clusterID, w.ID, params, targetEnv) if err != nil { d.Set("patch_version", nil) - return fmt.Errorf("Error updating worker %s: %s", w.ID, err) + return fmt.Errorf("[ERROR] Error updating worker %s: %s", w.ID, err) } if waitForWorkerUpdate { _, err = WaitForWorkerAvailable(d, meta, targetEnv) if err != nil { d.Set("patch_version", nil) - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } } } @@ -1022,18 +1055,15 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) poolSize := d.Get("default_pool_size").(int) err = workerPoolsAPI.ResizeWorkerPool(clusterID, poolName, poolSize, targetEnv) if err != nil { - return fmt.Errorf( - "Error updating the default_pool_size %d: %s", poolSize, err) + return fmt.Errorf("[ERROR] Error updating the default_pool_size %d: %s", poolSize, err) } _, err = WaitForWorkerAvailable(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } } else { - return fmt.Errorf( - "The default worker pool does not exist. Use ibm_container_worker_pool and ibm_container_worker_pool_zone attachment resources to make changes to your cluster, such as adding zones, adding worker nodes, or updating worker nodes..") + return fmt.Errorf("[ERROR] The default worker pool does not exist. Use ibm_container_worker_pool and ibm_container_worker_pool_zone attachment resources to make changes to your cluster, such as adding zones, adding worker nodes, or updating worker nodes") } } @@ -1062,18 +1092,15 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) } err = workerPoolsAPI.UpdateLabelsWorkerPool(clusterID, poolName, labels, targetEnv) if err != nil { - return fmt.Errorf( - "Error updating the labels %s", err) + return fmt.Errorf("[ERROR] Error updating the labels %s", err) } _, err = WaitForWorkerAvailable(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } } else { - return fmt.Errorf( - "The default worker pool does not exist. Use ibm_container_worker_pool and ibm_container_worker_pool_zone attachment resources to make changes to your cluster, such as adding zones, adding worker nodes, or updating worker nodes..") + return fmt.Errorf("[ERROR] The default worker pool does not exist. Use ibm_container_worker_pool and ibm_container_worker_pool_zone attachment resources to make changes to your cluster, such as adding zones, adding worker nodes, or updating worker nodes") } } if d.HasChange("taints") { @@ -1098,7 +1125,7 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) if err != nil { return err } - ClusterClient, err := meta.(ClientSession).VpcContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -1140,21 +1167,19 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) count := oldCount - newCount workerFields, err := wrkAPI.List(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } for i := 0; i < count; i++ { err := wrkAPI.Delete(clusterID, workerFields[i].ID, targetEnv) if err != nil { - return fmt.Errorf( - "Error deleting workers of cluster (%s): %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error deleting workers of cluster (%s): %s", d.Id(), err) } } } _, err = WaitForWorkerAvailable(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } } @@ -1169,23 +1194,22 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) if strings.Compare(newPack["version"].(string), oldPack["version"].(string)) != 0 { cluster, err := clusterAPI.Find(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving cluster %s: %s", clusterID, err) + return fmt.Errorf("[ERROR] Error retrieving cluster %s: %s", clusterID, err) } if newPack["version"].(string) != strings.Split(cluster.MasterKubeVersion, "_")[0] { - return fmt.Errorf("Worker version %s should match the master kube version %s", newPack["version"].(string), strings.Split(cluster.MasterKubeVersion, "_")[0]) + return fmt.Errorf("[ERROR] Worker version %s should match the master kube version %s", newPack["version"].(string), strings.Split(cluster.MasterKubeVersion, "_")[0]) } params := v1.WorkerUpdateParam{ Action: "update", } err = wrkAPI.Update(clusterID, oldPack["id"].(string), params, targetEnv) if err != nil { - return fmt.Errorf("Error updating worker %s: %s", oldPack["id"].(string), err) + return fmt.Errorf("[ERROR] Error updating worker %s: %s", oldPack["id"].(string), err) } _, err = WaitForWorkerAvailable(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } } } @@ -1222,7 +1246,7 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) var publicSubnetAdded bool noSubnet := d.Get("no_subnet").(bool) publicVlanID := d.Get("public_vlan_id").(string) - if noSubnet == false && publicVlanID != "" { + if !noSubnet && publicVlanID != "" { publicSubnetAdded = true } if d.HasChange("subnet_id") { @@ -1262,8 +1286,7 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) if publicSubnetAdded && d.Get("wait_till").(string) == ingressReady { _, err = WaitForSubnetAvailable(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for initializing ingress hostname and secret: %s", err) + return fmt.Errorf("[ERROR] Error waiting for initializing ingress hostname and secret: %s", err) } } @@ -1272,9 +1295,9 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) oldList, newList := d.GetChange("tags") cluster, err := clusterAPI.Find(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving cluster %s: %s", clusterID, err) + return fmt.Errorf("[ERROR] Error retrieving cluster %s: %s", clusterID, err) } - err = UpdateTagsUsingCRN(oldList, newList, meta, cluster.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, cluster.CRN) if err != nil { log.Printf( "An error occured during update of instance (%s) tags: %s", clusterID, err) @@ -1282,6 +1305,18 @@ func resourceIBMContainerClusterUpdate(d *schema.ResourceData, meta interface{}) } + if d.HasChange("image_security_enforcement") && !d.IsNewResource() { + var imageSecurity bool + if v, ok := d.GetOk("image_security_enforcement"); ok { + imageSecurity = v.(bool) + } + if imageSecurity { + csClientV2.Clusters().EnableImageSecurityEnforcement(clusterID, targetEnvV2) + } else { + csClientV2.Clusters().DisableImageSecurityEnforcement(clusterID, targetEnvV2) + } + } + return resourceIBMContainerClusterRead(d, meta) } @@ -1290,7 +1325,7 @@ func getID(d *schema.ResourceData, meta interface{}, clusterID string, oldWorker if err != nil { return "", err } - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return "", err } @@ -1317,7 +1352,7 @@ func getID(d *schema.ResourceData, meta interface{}, clusterID string, oldWorker } } - return "", fmt.Errorf("Unable to get ID of worker") + return "", fmt.Errorf("[ERROR] Unable to get ID of worker") } func resourceIBMContainerClusterDelete(d *schema.ResourceData, meta interface{}) error { @@ -1326,7 +1361,7 @@ func resourceIBMContainerClusterDelete(d *schema.ResourceData, meta interface{}) if err != nil { return err } - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -1334,7 +1369,7 @@ func resourceIBMContainerClusterDelete(d *schema.ResourceData, meta interface{}) forceDeleteStorage := d.Get("force_delete_storage").(bool) err = csClient.Clusters().Delete(clusterID, targetEnv, forceDeleteStorage) if err != nil { - return fmt.Errorf("Error deleting cluster: %s", err) + return fmt.Errorf("[ERROR] Error deleting cluster: %s", err) } _, err = waitForClusterDelete(d, meta) if err != nil { @@ -1348,7 +1383,7 @@ func waitForClusterDelete(d *schema.ResourceData, meta interface{}) (interface{} if err != nil { return nil, err } - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1377,7 +1412,7 @@ func waitForClusterDelete(d *schema.ResourceData, meta interface{}) (interface{} // WaitForClusterAvailable Waits for cluster creation func WaitForClusterAvailable(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1400,7 +1435,7 @@ func clusterStateRefreshFunc(client v1.Clusters, instanceID string, target v1.Cl return func() (interface{}, string, error) { clusterFields, err := client.FindWithOutShowResourcesCompatible(instanceID, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving cluster: %s", err) } // Check active transactions log.Println("Checking cluster") @@ -1419,7 +1454,7 @@ func waitForClusterMasterAvailable(d *schema.ResourceData, meta interface{}) (in if err != nil { return nil, err } - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1431,7 +1466,7 @@ func waitForClusterMasterAvailable(d *schema.ResourceData, meta interface{}) (in Refresh: func() (interface{}, string, error) { clusterFields, err := csClient.Clusters().FindWithOutShowResourcesCompatible(clusterID, targetEnv) if err != nil { - return nil, "", fmt.Errorf("Error retrieving cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving cluster: %s", err) } if clusterFields.MasterStatus == ready { @@ -1453,7 +1488,7 @@ func waitForClusterOneWorkerAvailable(d *schema.ResourceData, meta interface{}) if err != nil { return nil, err } - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1483,7 +1518,7 @@ func waitForClusterOneWorkerAvailable(d *schema.ResourceData, meta interface{}) wrkAPI := csClient.Workers() workersByPool, err := wrkAPI.ListByWorkerPool(clusterID, poolName, false, targetEnv) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers of default worker pool for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers of default worker pool for cluster: %s", err) } if len(workersByPool) == 0 { return workersByPool, "provisioning", nil @@ -1508,7 +1543,7 @@ func waitForClusterOneWorkerAvailable(d *schema.ResourceData, meta interface{}) // WaitForWorkerAvailable Waits for worker creation func WaitForWorkerAvailable(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1531,7 +1566,7 @@ func workerStateRefreshFunc(client v1.Workers, instanceID string, target v1.Clus return func() (interface{}, string, error) { workerFields, err := client.List(instanceID, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } log.Println("Checking workers...") //Done worker has two fields State and Status , so check for those 2 @@ -1547,7 +1582,7 @@ func workerStateRefreshFunc(client v1.Workers, instanceID string, target v1.Clus } func WaitForClusterCreation(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1561,7 +1596,7 @@ func WaitForClusterCreation(d *schema.ResourceData, meta interface{}, target v1. workerFields, err := csClient.Workers().List(ClusterID, target) log.Println("Total workers: ", len(workerFields)) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } log.Println("Checking workers...") //verifying for atleast sing node to be in normal state @@ -1582,7 +1617,7 @@ func WaitForClusterCreation(d *schema.ResourceData, meta interface{}, target v1. } func WaitForSubnetAvailable(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1605,7 +1640,7 @@ func subnetStateRefreshFunc(client v1.Clusters, instanceID string, d *schema.Res return func() (interface{}, string, error) { cluster, err := client.FindWithOutShowResourcesCompatible(instanceID, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving cluster: %s", err) } if cluster.IngressHostname == "" || cluster.IngressSecretName == "" { return cluster, subnetProvisioning, nil @@ -1616,7 +1651,7 @@ func subnetStateRefreshFunc(client v1.Clusters, instanceID string, d *schema.Res // WaitForClusterVersionUpdate Waits for cluster creation func WaitForClusterVersionUpdate(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -1640,7 +1675,7 @@ func clusterVersionRefreshFunc(client v1.Clusters, instanceID string, d *schema. return func() (interface{}, string, error) { clusterFields, err := client.FindWithOutShowResourcesCompatible(instanceID, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving cluster: %s", err) } // Check active transactions kubeversion := d.Get("kube_version").(string) @@ -1656,7 +1691,7 @@ func clusterVersionRefreshFunc(client v1.Clusters, instanceID string, d *schema. func resourceIBMContainerClusterExists(d *schema.ResourceData, meta interface{}) (bool, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_cluster_feature.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_cluster_feature.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_cluster_feature.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_cluster_feature.go index bce5e8429e..909a2b4739 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_cluster_feature.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_cluster_feature.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -12,6 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) const ( @@ -21,7 +23,7 @@ const ( reloadAction = "reload" ) -func resourceIBMContainerClusterFeature() *schema.Resource { +func ResourceIBMContainerClusterFeature() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerClusterFeatureCreate, Read: resourceIBMContainerClusterFeatureRead, @@ -83,7 +85,7 @@ func resourceIBMContainerClusterFeature() *schema.Resource { Optional: true, Description: "ID of the resource group.", Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, }, } @@ -101,7 +103,7 @@ func resourceIBMContainerClusterFeatureCreate(d *schema.ResourceData, meta inter return err } } else { - return fmt.Errorf("The `private_service_endpoint` can not be disabled") + return fmt.Errorf("[ERROR] The `private_service_endpoint` can not be disabled") } d.SetId(cluster) err := reloadCluster(cluster, d.Timeout(schema.TimeoutCreate), d, meta) @@ -132,13 +134,13 @@ func resourceIBMContainerClusterFeatureCreate(d *schema.ResourceData, meta inter } if !isOptionSet { - return fmt.Errorf("Provide either `public_service_endpoint` or `private_service_endpoint` or both.") + return fmt.Errorf("[ERROR] Provide either `public_service_endpoint` or `private_service_endpoint` or both") } return resourceIBMContainerClusterFeatureRead(d, meta) } func reloadCluster(cluster string, timeout time.Duration, d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -159,21 +161,19 @@ func reloadCluster(cluster string, timeout time.Duration, d *schema.ResourceData log.Printf("Waiting for cluster (%s) to be available.", cluster) _, err = WaitForClusterAvailableForFeatureUpdate(cluster, timeout, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for cluster (%s) to become ready: %s", cluster, err) + return fmt.Errorf("[ERROR] Error waiting for cluster (%s) to become ready: %s", cluster, err) } log.Printf("Waiting for workers (%s) to be available.", cluster) _, err = WaitForWorkerAvailableForFeatureUpdate(cluster, timeout, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", cluster, err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", cluster, err) } params := v1.UpdateWorkerCommand{ Action: reloadAction, } workerFields, err := csClient.Workers().List(cluster, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving workers for cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } workers := make([]string, len(workerFields)) for i, worker := range workerFields { @@ -185,13 +185,11 @@ func reloadCluster(cluster string, timeout time.Duration, d *schema.ResourceData } _, err = WaitForClusterAvailableForFeatureUpdate(cluster, timeout, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster (%s) to become ready: %s", d.Id(), err) } _, err = WaitForWorkerAvailableForFeatureUpdate(cluster, timeout, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } } } @@ -200,7 +198,7 @@ func reloadCluster(cluster string, timeout time.Duration, d *schema.ResourceData } func updateCluster(cluster, actionCmd string, timeout time.Duration, d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -214,14 +212,12 @@ func updateCluster(cluster, actionCmd string, timeout time.Duration, d *schema.R log.Printf("Waiting for cluster (%s) to be available.", cluster) _, err = WaitForClusterAvailableForFeatureUpdate(cluster, timeout, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster (%s) to become ready: %s", d.Id(), err) } log.Printf("Waiting for workers (%s) to be available.", cluster) _, err = WaitForWorkerAvailableForFeatureUpdate(cluster, timeout, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to become ready: %s", d.Id(), err) } log.Printf("Calling update with action cmd %s", actionCmd) err = csClient.Clusters().Update(cluster, params, targetEnv) @@ -234,7 +230,7 @@ func updateCluster(cluster, actionCmd string, timeout time.Duration, d *schema.R } func resourceIBMContainerClusterFeatureRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -246,7 +242,7 @@ func resourceIBMContainerClusterFeatureRead(d *schema.ResourceData, meta interfa } cls, err := csClient.Clusters().Find(clusterID, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving armada cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving armada cluster: %s", err) } d.Set("cluster", clusterID) @@ -275,7 +271,7 @@ func resourceIBMContainerClusterFeatureUpdate(d *schema.ResourceData, meta inter return err } } else { - return fmt.Errorf("The `private_service_endpoint` can not be disabled") + return fmt.Errorf("[ERROR] The `private_service_endpoint` can not be disabled") } err := reloadCluster(cluster, d.Timeout(schema.TimeoutUpdate), d, meta) if err != nil { @@ -305,7 +301,7 @@ func resourceIBMContainerClusterFeatureUpdate(d *schema.ResourceData, meta inter } if !isOptionSet { - return fmt.Errorf("Provide either `public_service_endpoint` or `private_service_endpoint` or both.") + return fmt.Errorf("[ERROR] Provide either `public_service_endpoint` or `private_service_endpoint` or both") } return resourceIBMContainerClusterFeatureRead(d, meta) @@ -313,7 +309,7 @@ func resourceIBMContainerClusterFeatureUpdate(d *schema.ResourceData, meta inter // WaitForClusterAvailable Waits for cluster creation func WaitForClusterAvailableForFeatureUpdate(cluster string, timeout time.Duration, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -333,7 +329,7 @@ func WaitForClusterAvailableForFeatureUpdate(cluster string, timeout time.Durati } func WaitForWorkerAvailableForFeatureUpdate(cluster string, timeout time.Duration, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_nlb_dns.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_nlb_dns.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_nlb_dns.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_nlb_dns.go index 8063c254c2..ade1485fbb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_nlb_dns.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_nlb_dns.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "context" @@ -9,11 +9,13 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIbmContainerNlbDns() *schema.Resource { +func ResourceIBMContainerNlbDns() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmContainerNlbDnsCreate, ReadContext: resourceIbmContainerNlbDnsRead, @@ -21,50 +23,50 @@ func resourceIbmContainerNlbDns() *schema.Resource { DeleteContext: resourceIbmContainerNlbDnsDelete, Schema: map[string]*schema.Schema{ - "cluster": &schema.Schema{ + "cluster": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The name or ID of the cluster. To list the clusters that you have access to, use the `GET /v1/clusters` API or run `ibmcloud ks cluster ls`.", }, - "nlb_host": &schema.Schema{ + "nlb_host": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "nlb_ips": &schema.Schema{ + "nlb_ips": { Type: schema.TypeSet, Required: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "nlb_dns_type": &schema.Schema{ + "nlb_dns_type": { Type: schema.TypeString, Computed: true, }, - "nlb_monitor_state": &schema.Schema{ + "nlb_monitor_state": { Type: schema.TypeString, Computed: true, }, - "nlb_ssl_secret_name": &schema.Schema{ + "nlb_ssl_secret_name": { Type: schema.TypeString, Computed: true, }, - "nlb_ssl_secret_status": &schema.Schema{ + "nlb_ssl_secret_status": { Type: schema.TypeString, Computed: true, }, - "nlb_type": &schema.Schema{ + "nlb_type": { Type: schema.TypeString, Computed: true, }, - "secret_namespace": &schema.Schema{ + "secret_namespace": { Type: schema.TypeString, Computed: true, }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "The ID of the resource group that the cluster is in. To check the resource group ID of the cluster, use the GET /v1/clusters/idOrName API. To list available resource group IDs, run ibmcloud resource groups.", }, }, @@ -72,7 +74,7 @@ func resourceIbmContainerNlbDns() *schema.Resource { } func resourceIbmContainerNlbDnsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } @@ -108,38 +110,38 @@ func resourceIbmContainerNlbDnsCreate(context context.Context, d *schema.Resourc func resourceIbmContainerNlbDnsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - kubeClient, err := meta.(ClientSession).VpcContainerAPI() + kubeClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } nlbData, err := kubeClient.NlbDns().GetNLBDNSList(d.Id()) if err != nil || nlbData == nil || len(nlbData) < 1 { - return diag.FromErr(fmt.Errorf("[ERROR] Error Listing NLB DNS (%s): %s", name, err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Listing NLB DNS (%s): %s", d.Id(), err)) } if nlbData != nil { for _, nlbConfig := range nlbData { if err = d.Set("cluster", d.Id()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting cluster: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting cluster: %s", err)) } if err = d.Set("nlb_dns_type", nlbConfig.Nlb.DnsType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting nlb_dns_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting nlb_dns_type: %s", err)) } if err = d.Set("nlb_host", nlbConfig.Nlb.NlbSubdomain); err != nil { - return diag.FromErr(fmt.Errorf("Error setting nlb_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting nlb_host: %s", err)) } if err = d.Set("nlb_ssl_secret_name", nlbConfig.SecretName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting nlb_ssl_secret_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting nlb_ssl_secret_name: %s", err)) } if err = d.Set("nlb_ssl_secret_status", nlbConfig.SecretStatus); err != nil { - return diag.FromErr(fmt.Errorf("Error setting nlb_ssl_secret_status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting nlb_ssl_secret_status: %s", err)) } if err = d.Set("nlb_type", nlbConfig.Nlb.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting nlb_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting nlb_type: %s", err)) } if err = d.Set("secret_namespace", nlbConfig.Nlb.SecretNamespace); err != nil { - return diag.FromErr(fmt.Errorf("Error setting secret_namespace: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting secret_namespace: %s", err)) } } } @@ -148,7 +150,7 @@ func resourceIbmContainerNlbDnsRead(context context.Context, d *schema.ResourceD } func resourceIbmContainerNlbDnsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } @@ -158,7 +160,7 @@ func resourceIbmContainerNlbDnsUpdate(context context.Context, d *schema.Resourc updateDNSWithIPOptions.SetIdOrName(d.Id()) nlbHost := d.Get("nlb_host").(string) - updateDNSWithIPOptions.NlbHost = ptrToString(nlbHost) + updateDNSWithIPOptions.NlbHost = flex.PtrToString(nlbHost) if d.HasChange("nlb_ips") { var remove, add []string @@ -166,8 +168,8 @@ func resourceIbmContainerNlbDnsUpdate(context context.Context, d *schema.Resourc os := o.(*schema.Set) ns := n.(*schema.Set) - remove = expandStringList(os.Difference(ns).List()) - add = expandStringList(ns.Difference(os).List()) + remove = flex.ExpandStringList(os.Difference(ns).List()) + add = flex.ExpandStringList(ns.Difference(os).List()) if len(remove) > 0 { unregisterDNSWithIPOptions := &kubernetesserviceapiv1.UnregisterDNSWithIPOptions{} @@ -202,7 +204,7 @@ func resourceIbmContainerNlbDnsUpdate(context context.Context, d *schema.Resourc } func resourceIbmContainerNlbDnsDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_storage_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_storage_attachment.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_storage_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_storage_attachment.go index 41a4a9de8d..8978d0ac63 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_storage_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_storage_attachment.go @@ -1,4 +1,4 @@ -package ibm +package kubernetes import ( "context" @@ -8,6 +8,8 @@ import ( v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -25,7 +27,7 @@ const ( volumeAttachReclamation = "pending_reclamation" ) -func resourceIBMContainerVpcWorkerVolumeAttachment() *schema.Resource { +func ResourceIBMContainerVpcWorkerVolumeAttachment() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMContainerVpcWorkerVolumeAttachmentCreate, @@ -96,7 +98,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachment() *schema.Resource { func resourceIBMContainerVpcWorkerVolumeAttachmentCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } @@ -130,7 +132,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentCreate(context context.Context } func resourceIBMContainerVpcWorkerVolumeAttachmentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } @@ -141,7 +143,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentRead(context context.Context, return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -163,7 +165,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentRead(context context.Context, } func resourceIBMContainerVpcWorkerVolumeAttachmentDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } @@ -174,7 +176,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentDelete(context context.Context return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -194,13 +196,12 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentDelete(context context.Context d.SetId("") return nil } - return diag.FromErr(fmt.Errorf("Failed to delete the volume attachment: %s", deleteErr)) + return diag.FromErr(fmt.Errorf("[ERROR] Failed to delete the volume attachment: %s", deleteErr)) } _, err = waitForStorageAttachmentDelete(d, meta) if err != nil { - return diag.FromErr(fmt.Errorf( - "Error waiting for storage attachment (%s) to be deleted: %s", d.Id(), err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error waiting for storage attachment (%s) to be deleted: %s", d.Id(), err)) } d.SetId("") @@ -208,7 +209,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentDelete(context context.Context } func resourceIBMContainerVpcWorkerVolumeAttachmentExists(d *schema.ResourceData, meta interface{}) (bool, error) { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } @@ -219,7 +220,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentExists(d *schema.ResourceData, return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -240,7 +241,7 @@ func resourceIBMContainerVpcWorkerVolumeAttachmentExists(d *schema.ResourceData, } func waitforVolumetoAttach(d *schema.ResourceData, meta interface{}) (interface{}, error) { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -252,7 +253,7 @@ func waitforVolumetoAttach(d *schema.ResourceData, meta interface{}) (interface{ return nil, trgetErr } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil, err } @@ -285,7 +286,7 @@ func waitforVolumetoAttach(d *schema.ResourceData, meta interface{}) (interface{ } func waitForStorageAttachmentDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -297,7 +298,7 @@ func waitForStorageAttachmentDelete(d *schema.ResourceData, meta interface{}) (i return nil, trgetErr } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil, err } @@ -315,9 +316,9 @@ func waitForStorageAttachmentDelete(d *schema.ResourceData, meta interface{}) (i if apiErr.StatusCode() == 404 { return volume, "removed", nil } - return nil, "", fmt.Errorf("Reading volume attach %s failed with resp code: %s, err: %v", d.Id(), volume, getErr) + return nil, "", fmt.Errorf("[ERROR] Reading volume attach %s failed with resp code: %s, err: %v", d.Id(), volume, getErr) } - return nil, "", fmt.Errorf("Reading volume attach failed: %s", getErr) + return nil, "", fmt.Errorf("[ERROR] Reading volume attach failed: %s", getErr) } return volume, "inprogress", nil }, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_alb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_alb.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_alb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_alb.go index 812f3da50f..79f827a191 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_alb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_alb.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -10,12 +10,14 @@ import ( v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMContainerVpcALB() *schema.Resource { +func ResourceIBMContainerVpcALB() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerVpcALBEnable, Read: resourceIBMContainerVpcALBRead, @@ -91,7 +93,7 @@ func resourceIBMContainerVpcALB() *schema.Resource { "resource_group_id": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "ID of the resource group.", }, }, @@ -99,7 +101,7 @@ func resourceIBMContainerVpcALB() *schema.Resource { } func resourceIBMContainerVpcALBEnable(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -110,13 +112,12 @@ func resourceIBMContainerVpcALBEnable(d *schema.ResourceData, meta interface{}) } else if v, ok := d.GetOkExists("disable_deployment"); ok { disableDeployment = v.(bool) } else { - return fmt.Errorf("Provide either `enable` or `disable_deployment`") + return fmt.Errorf("[ERROR] Provide either `enable` or `disable_deployment`") } _, err = waitForVpcClusterAvailable(d, meta, albID, schema.TimeoutCreate) if err != nil { - return fmt.Errorf( - "Error waiting for cluster resource availabilty (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster resource availabilty (%s) : %s", d.Id(), err) } params := v2.AlbConfig{ @@ -145,15 +146,14 @@ func resourceIBMContainerVpcALBEnable(d *schema.ResourceData, meta interface{}) d.SetId(albID) _, err = waitForVpcContainerALB(d, meta, albID, schema.TimeoutCreate, enable, disableDeployment) if err != nil { - return fmt.Errorf( - "Error waiting for create resource alb (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for create resource alb (%s) : %s", d.Id(), err) } return resourceIBMContainerVpcALBRead(d, meta) } func resourceIBMContainerVpcALBRead(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -184,7 +184,7 @@ func resourceIBMContainerVpcALBRead(d *schema.ResourceData, meta interface{}) er } func resourceIBMContainerVpcALBUpdate(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -197,8 +197,7 @@ func resourceIBMContainerVpcALBUpdate(d *schema.ResourceData, meta interface{}) _, err = waitForVpcClusterAvailable(d, meta, albID, schema.TimeoutCreate) if err != nil { - return fmt.Errorf( - "Error waiting for cluster resource availabilty (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster resource availabilty (%s) : %s", d.Id(), err) } params := v2.AlbConfig{ @@ -222,8 +221,7 @@ func resourceIBMContainerVpcALBUpdate(d *schema.ResourceData, meta interface{}) _, err = waitForVpcContainerALB(d, meta, albID, schema.TimeoutUpdate, enable, disableDeployment) if err != nil { - return fmt.Errorf( - "Error waiting for updating resource alb (%s) : %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for updating resource alb (%s) : %s", d.Id(), err) } } @@ -231,7 +229,7 @@ func resourceIBMContainerVpcALBUpdate(d *schema.ResourceData, meta interface{}) } func waitForVpcContainerALB(d *schema.ResourceData, meta interface{}, albID, timeout string, enable, disableDeployment bool) (interface{}, error) { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } @@ -243,16 +241,16 @@ func waitForVpcContainerALB(d *schema.ResourceData, meta interface{}, albID, tim alb, err := albClient.Albs().GetAlb(albID, targetEnv) if err != nil { if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() == 404 { - return nil, "", fmt.Errorf("The resource alb %s does not exist anymore: %v", d.Id(), err) + return nil, "", fmt.Errorf("[ERROR] The resource alb %s does not exist anymore: %v", d.Id(), err) } return nil, "", err } if enable { - if alb.Enable == false { + if !alb.Enable { return alb, "pending", nil } } else if disableDeployment { - if alb.Enable == true { + if alb.Enable { return alb, "pending", nil } } @@ -273,7 +271,7 @@ func resourceIBMContainerVpcALBDelete(d *schema.ResourceData, meta interface{}) } func waitForVpcClusterAvailable(d *schema.ResourceData, meta interface{}, albID, timeout string) (interface{}, error) { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_alb_create.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_alb_create.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_alb_create.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_alb_create.go index bb5a277bc3..512657edcf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_alb_create.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_alb_create.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "time" v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMContainerVpcAlbCreateNew() *schema.Resource { +func ResourceIBMContainerVpcAlbCreateNew() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerVpcAlbCreate, Read: resourceIBMContainerVpcALBRead, @@ -101,7 +102,7 @@ func resourceIBMContainerVpcAlbCreateNew() *schema.Resource { func resourceIBMContainerVpcAlbCreate(d *schema.ResourceData, meta interface{}) error { - albClient, err := meta.(ClientSession).VpcContainerAPI() + albClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_cluster.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_cluster.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_cluster.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_cluster.go index c8b150725c..5dcb015e76 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_cluster.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_cluster.go @@ -1,7 +1,7 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Copyright IBM Corp. 2017, 2022 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "context" @@ -20,6 +20,9 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -32,7 +35,7 @@ const ( ingressReady = "IngressReady" ) -func resourceIBMContainerVpcCluster() *schema.Resource { +func ResourceIBMContainerVpcCluster() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerVpcClusterCreate, Read: resourceIBMContainerVpcClusterRead, @@ -43,7 +46,7 @@ func resourceIBMContainerVpcCluster() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -60,7 +63,7 @@ func resourceIBMContainerVpcCluster() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "The cluster name", + Description: "The cluster name", }, "vpc_id": { @@ -215,7 +218,7 @@ func resourceIBMContainerVpcCluster() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( "ibm_container_vpc_cluster", "worker_taints"), }, @@ -233,8 +236,8 @@ func resourceIBMContainerVpcCluster() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_container_vpc_cluster", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_container_vpc_cluster", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags for the resources", }, @@ -242,7 +245,7 @@ func resourceIBMContainerVpcCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Default: ingressReady, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, ValidateFunc: validation.StringInSlice([]string{masterNodeReady, oneWorkerNodeReady, ingressReady}, true), Description: "wait_till can be configured for Master Ready, One worker Ready or Ingress Ready", }, @@ -250,14 +253,14 @@ func resourceIBMContainerVpcCluster() *schema.Resource { "entitlement": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", }, "cos_instance_crn": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "A standard cloud object storage instance CRN to back up the internal registry in your OpenShift on VPC Gen 2 cluster", }, @@ -268,10 +271,10 @@ func resourceIBMContainerVpcCluster() *schema.Resource { Description: "Force the removal of a cluster and its persistent storage. Deleted data cannot be recovered", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, - Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", }, //Get Cluster info Request @@ -350,7 +353,7 @@ func resourceIBMContainerVpcCluster() *schema.Resource { "crn": { Type: schema.TypeString, Computed: true, - Description: "CRN of resource instance", + Description: "CRN of resource instance", }, "ingress_hostname": { @@ -363,28 +366,35 @@ func resourceIBMContainerVpcCluster() *schema.Resource { Sensitive: true, }, - ResourceName: { + "image_security_enforcement": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Set true to enable image security enforcement policies", + }, + + flex.ResourceName: { Type: schema.TypeString, Computed: true, - Description: "The name of the resource", + Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, - Description: "The crn of the resource", + Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, - Description: "The status of the resource", + Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, - Description: "The resource group name in which resource is provisioned", + Description: "The resource group name in which resource is provisioned", }, }, @@ -396,26 +406,26 @@ func resourceIBMContainerVpcCluster() *schema.Resource { } } -func resourceIBMContainerVpcClusterValidator() *ResourceValidator { +func ResourceIBMContainerVpcClusterValidator() *validate.ResourceValidator { tainteffects := "NoSchedule,PreferNoSchedule,NoExecute" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "worker_taints", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: tainteffects}) - ibmContainerVpcClusteresourceValidator := ResourceValidator{ResourceName: "ibm_container_vpc_cluster", Schema: validateSchema} + ibmContainerVpcClusteresourceValidator := validate.ResourceValidator{ResourceName: "ibm_container_vpc_cluster", Schema: validateSchema} return &ibmContainerVpcClusteresourceValidator } @@ -423,7 +433,7 @@ func resourceIBMContainerVpcClusterCreate(d *schema.ResourceData, meta interface vpcProvider := "vpc-gen2" - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -439,6 +449,7 @@ func resourceIBMContainerVpcClusterCreate(d *schema.ResourceData, meta interface vpcID := d.Get("vpc_id").(string) flavor := d.Get("flavor").(string) workerCount := d.Get("worker_count").(int) + imageSecurityEnabled := d.Get("image_security_enforcement").(bool) // timeoutStage will define the timeout stage var timeoutStage string @@ -502,11 +513,19 @@ func resourceIBMContainerVpcClusterCreate(d *schema.ResourceData, meta interface } cls, err := csClient.Clusters().Create(params, targetEnv) - if err != nil { return err } + d.SetId(cls.ID) + + if imageSecurityEnabled { + err = csClient.Clusters().EnableImageSecurityEnforcement(cls.ID, targetEnv) + if err != nil { + return err + } + } + switch strings.ToLower(timeoutStage) { case strings.ToLower(masterNodeReady): @@ -534,7 +553,7 @@ func resourceIBMContainerVpcClusterCreate(d *schema.ResourceData, meta interface func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -553,7 +572,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface if err != nil { return fmt.Errorf("[ERROR] Error retrieving cluster %s: %s", clusterID, err) } - err = UpdateTagsUsingCRN(oldList, newList, meta, cluster.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, cluster.CRN) if err != nil { log.Printf( "An error occured during update of instance (%s) tags: %s", clusterID, err) @@ -599,7 +618,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface if (d.HasChange("kube_version") || d.HasChange("update_all_workers") || d.HasChange("patch_version") || d.HasChange("retry_patch_version")) && !d.IsNewResource() { if d.HasChange("kube_version") { - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -624,12 +643,11 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface } _, err = WaitForVpcClusterVersionUpdate(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "[ERROR] Error waiting for cluster (%s) version to be updated: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster (%s) version to be updated: %s", d.Id(), err) } } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -646,7 +664,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface // Update the worker nodes after master node kube-version is updated. // workers will store the existing workers info to identify the replaced node - workersInfo := make(map[string]int, 0) + workersInfo := make(map[string]int) updateAllWorkers := d.Get("update_all_workers").(bool) if updateAllWorkers || d.HasChange("patch_version") || d.HasChange("retry_patch_version") { @@ -721,7 +739,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface } } - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -740,7 +758,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface if err != nil { return err } - ClusterClient, err := meta.(ClientSession).VpcContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -752,7 +770,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface if d.HasChange("worker_count") && !d.IsNewResource() { count := d.Get("worker_count").(int) - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -800,7 +818,7 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface if len(remove) > 0 { for _, zone := range remove { oldZone := zone.(map[string]interface{}) - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -826,10 +844,22 @@ func resourceIBMContainerVpcClusterUpdate(d *schema.ResourceData, meta interface d.Set("force_delete_storage", forceDeleteStorage) } + if d.HasChange("image_security_enforcement") && !d.IsNewResource() { + var imageSecurity bool + if v, ok := d.GetOk("image_security_enforcement"); ok { + imageSecurity = v.(bool) + } + if imageSecurity { + csClient.Clusters().EnableImageSecurityEnforcement(clusterID, targetEnv) + } else { + csClient.Clusters().DisableImageSecurityEnforcement(clusterID, targetEnv) + } + } + return resourceIBMContainerVpcClusterRead(d, meta) } func WaitForV2WorkerZoneDeleted(clusterNameOrID, workerPoolNameOrID, zone string, meta interface{}, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -863,7 +893,7 @@ func workerPoolV2ZoneDeleteStateRefreshFunc(client v2.Workers, instanceID, worke } func resourceIBMContainerVpcClusterRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -892,7 +922,7 @@ func resourceIBMContainerVpcClusterRead(d *schema.ResourceData, meta interface{} var zones = make([]map[string]interface{}, 0) for _, zone := range workerPool.Zones { for _, subnet := range zone.Subnets { - if subnet.Primary == true { + if subnet.Primary { zoneInfo := map[string]interface{}{ "name": zone.ID, "subnet_id": subnet.ID, @@ -917,7 +947,7 @@ func resourceIBMContainerVpcClusterRead(d *schema.ResourceData, meta interface{} d.Set("kube_version", strings.Split(cls.MasterKubeVersion, "_")[0]) } d.Set("worker_count", workerPool.WorkerCount) - d.Set("worker_labels", IgnoreSystemLabels(workerPool.Labels)) + d.Set("worker_labels", flex.IgnoreSystemLabels(workerPool.Labels)) if cls.Vpcs != nil { d.Set("vpc_id", cls.Vpcs[0]) } @@ -931,7 +961,7 @@ func resourceIBMContainerVpcClusterRead(d *schema.ResourceData, meta interface{} d.Set("state", cls.State) d.Set("ingress_hostname", cls.Ingress.HostName) d.Set("ingress_secret", cls.Ingress.SecretName) - d.Set("albs", flattenVpcAlbs(albs, "all")) + d.Set("albs", flex.FlattenVpcAlbs(albs, "all")) d.Set("resource_group_id", cls.ResourceGroupID) d.Set("public_service_endpoint_url", cls.ServiceEndpoints.PublicServiceEndpointURL) d.Set("private_service_endpoint_url", cls.ServiceEndpoints.PrivateServiceEndpointURL) @@ -940,22 +970,23 @@ func resourceIBMContainerVpcClusterRead(d *schema.ResourceData, meta interface{} } else { d.Set("disable_public_service_endpoint", true) } + d.Set("image_security_enforcement", cls.ImageSecurityEnabled) - tags, err := GetTagsUsingCRN(meta, cls.CRN) + tags, err := flex.GetTagsUsingCRN(meta, cls.CRN) if err != nil { log.Printf( "An error occured during reading of instance (%s) tags : %s", d.Id(), err) } d.Set("tags", tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") - d.Set(ResourceName, cls.Name) - d.Set(ResourceCRN, cls.CRN) - d.Set(ResourceStatus, cls.State) - d.Set(ResourceGroupName, cls.ResourceGroupName) + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceName, cls.Name) + d.Set(flex.ResourceCRN, cls.CRN) + d.Set(flex.ResourceStatus, cls.State) + d.Set(flex.ResourceGroupName, cls.ResourceGroupName) return nil } @@ -966,7 +997,7 @@ func resourceIBMContainerVpcClusterDelete(d *schema.ResourceData, meta interface if err != nil { return err } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -1022,13 +1053,47 @@ func resourceIBMContainerVpcClusterDelete(d *schema.ResourceData, meta interface } return nil } +func vpcClient(meta interface{}) (*vpcv1.VpcV1, error) { + sess, err := meta.(conns.ClientSession).VpcV1API() + return sess, err +} +func isWaitForLBDeleted(lbc *vpcv1.VpcV1, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for (%s) to be deleted.", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"retry", "deleting"}, + Target: []string{"done", "failed"}, + Refresh: isLBDeleteRefreshFunc(lbc, id), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} +func isLBDeleteRefreshFunc(lbc *vpcv1.VpcV1, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + log.Printf("[DEBUG] is lb delete function here") + getLoadBalancerOptions := &vpcv1.GetLoadBalancerOptions{ + ID: &id, + } + lb, response, err := lbc.GetLoadBalancer(getLoadBalancerOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return lb, "done", nil + } + return nil, "failed", fmt.Errorf("[ERROR] The vpc load balancer %s failed to delete: %s\n%s", id, err, response) + } + return lb, "deleting", nil + } +} func waitForVpcClusterDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { targetEnv, err := getVpcClusterTargetHeader(d, meta) if err != nil { return nil, err } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1060,7 +1125,7 @@ func waitForVpcClusterOneWorkerAvailable(d *schema.ResourceData, meta interface{ if err != nil { return nil, err } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1101,7 +1166,7 @@ func waitForVpcClusterMasterAvailable(d *schema.ResourceData, meta interface{}) if err != nil { return nil, err } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1135,7 +1200,7 @@ func waitForVpcClusterIngressAvailable(d *schema.ResourceData, meta interface{}) if err != nil { return nil, err } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1177,7 +1242,7 @@ func getVpcClusterTargetHeader(d *schema.ResourceData, meta interface{}) (v2.Clu func resourceIBMContainerVpcClusterExists(d *schema.ResourceData, meta interface{}) (bool, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } @@ -1200,7 +1265,7 @@ func resourceIBMContainerVpcClusterExists(d *schema.ResourceData, meta interface // WaitForVpcClusterVersionUpdate Waits for cluster creation func WaitForVpcClusterVersionUpdate(d *schema.ResourceData, meta interface{}, target v2.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1238,7 +1303,7 @@ func vpcClusterVersionRefreshFunc(client v2.Clusters, instanceID string, d *sche // WaitForVpcClusterWokersVersionUpdate Waits for Cluster version Update func WaitForVpcClusterWokersVersionUpdate(d *schema.ResourceData, meta interface{}, target v2.ClusterTargetHeader, masterVersion, workerID string) (interface{}, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1274,7 +1339,7 @@ func vpcClusterWorkersVersionRefreshFunc(client v2.Workers, workerID, clusterID func waitForWorkerNodetoDelete(d *schema.ResourceData, meta interface{}, targetEnv v2.ClusterTargetHeader, workerID string) (interface{}, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1302,7 +1367,7 @@ func waitForWorkerNodetoDelete(d *schema.ResourceData, meta interface{}, targetE } func waitForNewWorker(d *schema.ResourceData, meta interface{}, targetEnv v2.ClusterTargetHeader, workersCount int) (interface{}, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -1330,7 +1395,7 @@ func waitForNewWorker(d *schema.ResourceData, meta interface{}, targetEnv v2.Clu } func getNewWorkerID(d *schema.ResourceData, meta interface{}, targetEnv v2.ClusterTargetHeader, workersInfo map[string]int) (string, int, error) { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return "", -1, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_worker_pool.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_worker_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_worker_pool.go index 38f7a0faab..2097faff33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_vpc_worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_vpc_worker_pool.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -15,13 +15,16 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( workerDesired = "deployed" ) -func resourceIBMContainerVpcWorkerPool() *schema.Resource { +func ResourceIBMContainerVpcWorkerPool() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerVpcWorkerPoolCreate, @@ -111,7 +114,7 @@ func resourceIBMContainerVpcWorkerPool() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( "ibm_container_vpc_worker_pool", "worker_taints"), }, @@ -140,10 +143,10 @@ func resourceIBMContainerVpcWorkerPool() *schema.Resource { "entitlement": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "Resource Controller URL", @@ -151,24 +154,24 @@ func resourceIBMContainerVpcWorkerPool() *schema.Resource { }, } } -func resourceContainerVPCWorkerPoolValidator() *ResourceValidator { +func ResourceIBMContainerVPCWorkerPoolValidator() *validate.ResourceValidator { tainteffects := "NoSchedule,PreferNoSchedule,NoExecute" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "worker_taints", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: tainteffects}) - containerVPCWorkerPoolTaintsValidator := ResourceValidator{ResourceName: "ibm_container_vpc_worker_pool", Schema: validateSchema} + containerVPCWorkerPoolTaintsValidator := validate.ResourceValidator{ResourceName: "ibm_container_vpc_worker_pool", Schema: validateSchema} return &containerVPCWorkerPoolTaintsValidator } func resourceIBMContainerVpcWorkerPoolCreate(d *schema.ResourceData, meta interface{}) error { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -240,8 +243,7 @@ func resourceIBMContainerVpcWorkerPoolCreate(d *schema.ResourceData, meta interf //wait for workerpool availability _, err = WaitForWorkerPoolAvailable(d, meta, clusterNameorID, res.ID, d.Timeout(schema.TimeoutCreate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) } return resourceIBMContainerVpcWorkerPoolUpdate(d, meta) @@ -264,7 +266,7 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf if err != nil { return err } - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -272,8 +274,7 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf err = ClusterClient.WorkerPools().UpdateLabelsWorkerPool(clusterNameOrID, workerPoolName, labels, Env) if err != nil { - return fmt.Errorf( - "Error updating the labels: %s", err) + return fmt.Errorf("[ERROR] Error updating the labels: %s", err) } } if d.HasChange("taints") { @@ -285,7 +286,7 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf if err != nil { return err } - ClusterClient, err := meta.(ClientSession).VpcContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -303,7 +304,7 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf if err != nil { return err } - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -311,8 +312,7 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf err = ClusterClient.WorkerPools().ResizeWorkerPool(clusterNameOrID, workerPoolName, count, Env) if err != nil { - return fmt.Errorf( - "Error updating the worker_count %d: %s", count, err) + return fmt.Errorf("[ERROR] Error updating the worker_count %d: %s", count, err) } } @@ -335,7 +335,7 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf remove := os.Difference(ns).List() add := ns.Difference(os).List() if len(add) > 0 { - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -349,12 +349,11 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf } err = csClient.WorkerPools().CreateWorkerPoolZone(zoneParam, targetEnv) if err != nil { - return fmt.Errorf("Error adding zone to conatiner vpc cluster: %s", err) + return fmt.Errorf("[ERROR] Error adding zone to conatiner vpc cluster: %s", err) } _, err = WaitForWorkerPoolAvailable(d, meta, clusterID, workerPoolName, d.Timeout(schema.TimeoutCreate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) } } @@ -362,19 +361,18 @@ func resourceIBMContainerVpcWorkerPoolUpdate(d *schema.ResourceData, meta interf if len(remove) > 0 { for _, zone := range remove { oldZone := zone.(map[string]interface{}) - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } Env := v1.ClusterTargetHeader{ResourceGroup: targetEnv.ResourceGroup} err = ClusterClient.WorkerPools().RemoveZone(clusterID, oldZone["name"].(string), workerPoolName, Env) if err != nil { - return fmt.Errorf("Error deleting zone to conatiner vpc cluster: %s", err) + return fmt.Errorf("[ERROR] Error deleting zone to conatiner vpc cluster: %s", err) } _, err = WaitForV2WorkerZoneDeleted(clusterID, workerPoolName, oldZone["name"].(string), meta, d.Timeout(schema.TimeoutDelete), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for deleting workers of worker pool (%s) of cluster (%s): %s", workerPoolName, clusterID, err) + return fmt.Errorf("[ERROR] Error waiting for deleting workers of worker pool (%s) of cluster (%s): %s", workerPoolName, clusterID, err) } } } @@ -414,11 +412,11 @@ func flattenWorkerPoolTaints(taints v2.GetWorkerPoolResponse) []map[string]inter return taintslist } func resourceIBMContainerVpcWorkerPoolRead(d *schema.ResourceData, meta interface{}) error { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -449,7 +447,7 @@ func resourceIBMContainerVpcWorkerPoolRead(d *schema.ResourceData, meta interfac cls, err := wpClient.Clusters().GetCluster(cluster, targetEnv) if err != nil { - return fmt.Errorf("Error retrieving conatiner vpc cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving conatiner vpc cluster: %s", err) } d.Set("worker_pool_name", workerPool.PoolName) @@ -457,7 +455,7 @@ func resourceIBMContainerVpcWorkerPoolRead(d *schema.ResourceData, meta interfac d.Set("worker_count", workerPool.WorkerCount) d.Set("worker_pool_id", workerPoolID) // d.Set("provider", workerPool.Provider) - d.Set("labels", IgnoreSystemLabels(workerPool.Labels)) + d.Set("labels", flex.IgnoreSystemLabels(workerPool.Labels)) d.Set("zones", zones) d.Set("resource_group_id", cls.ResourceGroupID) d.Set("cluster", cluster) @@ -465,20 +463,20 @@ func resourceIBMContainerVpcWorkerPoolRead(d *schema.ResourceData, meta interfac if workerPool.Taints != nil { d.Set("taints", flattenWorkerPoolTaints(workerPool)) } - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") return nil } func resourceIBMContainerVpcWorkerPoolDelete(d *schema.ResourceData, meta interface{}) error { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -497,24 +495,23 @@ func resourceIBMContainerVpcWorkerPoolDelete(d *schema.ResourceData, meta interf } _, err = WaitForVpcWorkerDelete(clusterNameorID, workerPoolNameorID, meta, d.Timeout(schema.TimeoutDelete), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for removing workers of worker pool (%s) of cluster (%s): %s", workerPoolNameorID, clusterNameorID, err) + return fmt.Errorf("[ERROR] Error waiting for removing workers of worker pool (%s) of cluster (%s): %s", workerPoolNameorID, clusterNameorID, err) } d.SetId("") return nil } func resourceIBMContainerVpcWorkerPoolExists(d *schema.ResourceData, meta interface{}) (bool, error) { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of clusterID/WorkerPoolID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of clusterID/WorkerPoolID", d.Id()) } cluster := parts[0] workerPoolID := parts[1] @@ -534,13 +531,16 @@ func resourceIBMContainerVpcWorkerPoolExists(d *schema.ResourceData, meta interf } return false, fmt.Errorf("[ERROR] Error getting container vpc workerpool: %s", err) } + if strings.Compare(workerPool.Lifecycle.ActualState, "deleted") == 0 { + return false, nil + } return workerPool.ID == workerPoolID, nil } // WaitForWorkerPoolAvailable Waits for worker creation func WaitForWorkerPoolAvailable(d *schema.ResourceData, meta interface{}, clusterNameOrID, workerPoolNameOrID string, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error) { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -563,7 +563,7 @@ func vpcWorkerPoolStateRefreshFunc(client v2.Workers, instanceID string, workerP return func() (interface{}, string, error) { workerFields, err := client.ListByWorkerPool(instanceID, "", false, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } // Check active transactions //Check for worker state to be deployed @@ -581,7 +581,7 @@ func vpcWorkerPoolStateRefreshFunc(client v2.Workers, instanceID string, workerP } func WaitForVpcWorkerDelete(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error) { - wpClient, err := meta.(ClientSession).VpcContainerAPI() + wpClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -602,7 +602,7 @@ func vpcworkerPoolDeleteStateRefreshFunc(client v2.Workers, instanceID, workerPo return func() (interface{}, string, error) { workerFields, err := client.ListByWorkerPool(instanceID, "", true, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } //Done worker has two fields desiredState and actualState , so check for those 2 for _, e := range workerFields { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_worker_pool.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_worker_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_worker_pool.go index 603a9a94cb..a05af795c7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_worker_pool.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -13,9 +13,12 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func resourceIBMContainerWorkerPool() *schema.Resource { +func ResourceIBMContainerWorkerPool() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerWorkerPoolCreate, @@ -53,14 +56,14 @@ func resourceIBMContainerWorkerPool() *schema.Resource { "size_per_zone": { Type: schema.TypeInt, Required: true, - ValidateFunc: validateSizePerZone, + ValidateFunc: validate.ValidateSizePerZone, Description: "Number of nodes per zone", }, "entitlement": { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Entitlement option reduces additional OCP Licence cost in Openshift Clusters", }, @@ -69,7 +72,7 @@ func resourceIBMContainerWorkerPool() *schema.Resource { Optional: true, ForceNew: true, Default: hardwareShared, - ValidateFunc: validateAllowedStringValue([]string{hardwareShared, hardwareDedicated}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{hardwareShared, hardwareDedicated}), Description: "Hardware type", }, @@ -147,7 +150,7 @@ func resourceIBMContainerWorkerPool() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Effect for taint. Accepted values are NoSchedule, PreferNoSchedule and NoExecute.", - ValidateFunc: InvokeValidator( + ValidateFunc: validate.InvokeValidator( "ibm_container_worker_pool", "worker_taints"), }, @@ -168,9 +171,9 @@ func resourceIBMContainerWorkerPool() *schema.Resource { Optional: true, Description: "ID of the resource group.", ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this cluster", @@ -179,23 +182,23 @@ func resourceIBMContainerWorkerPool() *schema.Resource { } } -func resourceContainerWorkerPoolValidator() *ResourceValidator { +func ResourceIBMContainerWorkerPoolValidator() *validate.ResourceValidator { tainteffects := "NoSchedule,PreferNoSchedule,NoExecute" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "worker_taints", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: tainteffects}) - containerWorkerPoolTaintsValidator := ResourceValidator{ResourceName: "ibm_container_worker_pool", Schema: validateSchema} + containerWorkerPoolTaintsValidator := validate.ResourceValidator{ResourceName: "ibm_container_worker_pool", Schema: validateSchema} return &containerWorkerPoolTaintsValidator } func resourceIBMContainerWorkerPoolCreate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -253,11 +256,11 @@ func resourceIBMContainerWorkerPoolCreate(d *schema.ResourceData, meta interface } func resourceIBMContainerWorkerPoolRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -291,28 +294,28 @@ func resourceIBMContainerWorkerPoolRead(d *schema.ResourceData, meta interface{} } d.Set("hardware", hardware) d.Set("state", workerPool.State) - d.Set("labels", IgnoreSystemLabels(workerPool.Labels)) - d.Set("zones", flattenZones(workerPool.Zones)) + d.Set("labels", flex.IgnoreSystemLabels(workerPool.Labels)) + d.Set("zones", flex.FlattenZones(workerPool.Zones)) d.Set("cluster", cluster) if strings.Contains(machineType, "encrypted") { d.Set("disk_encryption", true) } else { d.Set("disk_encryption", false) } - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/kubernetes/clusters") + d.Set(flex.ResourceControllerURL, controller+"/kubernetes/clusters") return nil } func resourceIBMContainerWorkerPoolUpdate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -332,8 +335,7 @@ func resourceIBMContainerWorkerPoolUpdate(d *schema.ResourceData, meta interface _, err = WaitForWorkerNormal(clusterNameorID, workerPoolNameorID, meta, d.Timeout(schema.TimeoutUpdate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of worker pool (%s) of cluster (%s) to become ready: %s", workerPoolNameorID, clusterNameorID, err) + return fmt.Errorf("[ERROR] Error waiting for workers of worker pool (%s) of cluster (%s) to become ready: %s", workerPoolNameorID, clusterNameorID, err) } } if d.HasChange("labels") { @@ -350,8 +352,7 @@ func resourceIBMContainerWorkerPoolUpdate(d *schema.ResourceData, meta interface _, err = WaitForWorkerNormal(clusterNameorID, workerPoolNameorID, meta, d.Timeout(schema.TimeoutUpdate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of worker pool (%s) of cluster (%s) to become ready: %s", workerPoolNameorID, clusterNameorID, err) + return fmt.Errorf("[ERROR] Error waiting for workers of worker pool (%s) of cluster (%s) to become ready: %s", workerPoolNameorID, clusterNameorID, err) } } if d.HasChange("taints") { @@ -361,7 +362,7 @@ func resourceIBMContainerWorkerPoolUpdate(d *schema.ResourceData, meta interface if err != nil { return err } - ClusterClient, err := meta.(ClientSession).VpcContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -375,11 +376,11 @@ func resourceIBMContainerWorkerPoolUpdate(d *schema.ResourceData, meta interface } func resourceIBMContainerWorkerPoolDelete(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -398,23 +399,22 @@ func resourceIBMContainerWorkerPoolDelete(d *schema.ResourceData, meta interface } _, err = WaitForWorkerDelete(clusterNameorID, workerPoolNameorID, meta, d.Timeout(schema.TimeoutUpdate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for removing workers of worker pool (%s) of cluster (%s): %s", workerPoolNameorID, clusterNameorID, err) + return fmt.Errorf("[ERROR] Error waiting for removing workers of worker pool (%s) of cluster (%s): %s", workerPoolNameorID, clusterNameorID, err) } return nil } func resourceIBMContainerWorkerPoolExists(d *schema.ResourceData, meta interface{}) (bool, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of clusterID/WorkerPoolID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of clusterID/WorkerPoolID", d.Id()) } cluster := parts[0] workerPoolID := parts[1] @@ -439,7 +439,7 @@ func resourceIBMContainerWorkerPoolExists(d *schema.ResourceData, meta interface } func WaitForWorkerNormal(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -460,7 +460,7 @@ func workerPoolStateRefreshFunc(client v1.Workers, instanceID, workerPoolNameOrI return func() (interface{}, string, error) { workerFields, err := client.ListByWorkerPool(instanceID, workerPoolNameOrID, false, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } //Done worker has two fields State and Status , so check for those 2 for _, e := range workerFields { @@ -475,7 +475,7 @@ func workerPoolStateRefreshFunc(client v1.Workers, instanceID, workerPoolNameOrI } func WaitForWorkerDelete(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -496,7 +496,7 @@ func workerPoolDeleteStateRefreshFunc(client v1.Workers, instanceID, workerPoolN return func() (interface{}, string, error) { workerFields, err := client.ListByWorkerPool(instanceID, "", true, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } //Done worker has two fields State and Status , so check for those 2 for _, e := range workerFields { @@ -512,16 +512,16 @@ func workerPoolDeleteStateRefreshFunc(client v1.Workers, instanceID, workerPoolN func getWorkerPoolTargetHeader(d *schema.ResourceData, meta interface{}) (v1.ClusterTargetHeader, error) { - _, err := meta.(ClientSession).BluemixSession() + _, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return v1.ClusterTargetHeader{}, err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return v1.ClusterTargetHeader{}, err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount targetEnv := v1.ClusterTargetHeader{ AccountID: accountID, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_worker_pool_zone_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_worker_pool_zone_attachment.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_worker_pool_zone_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_worker_pool_zone_attachment.go index 2add915f71..58ffbb5637 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_container_worker_pool_zone_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_container_worker_pool_zone_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -13,9 +13,11 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMContainerWorkerPoolZoneAttachment() *schema.Resource { +func ResourceIBMContainerWorkerPoolZoneAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMContainerWorkerPoolZoneAttachmentCreate, @@ -69,7 +71,7 @@ func resourceIBMContainerWorkerPoolZoneAttachment() *schema.Resource { Optional: true, Description: "ID of the resource group.", ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, "region": { @@ -88,7 +90,7 @@ func resourceIBMContainerWorkerPoolZoneAttachment() *schema.Resource { Type: schema.TypeBool, Optional: true, Default: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "wait_till_albs can be configured to wait for albs during the worker pool zone attachment.", }, }, @@ -96,7 +98,7 @@ func resourceIBMContainerWorkerPoolZoneAttachment() *schema.Resource { } func resourceIBMContainerWorkerPoolZoneAttachmentCreate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -112,8 +114,7 @@ func resourceIBMContainerWorkerPoolZoneAttachmentCreate(d *schema.ResourceData, } if publicVLAN != "" && privateVLAN == "" { - return fmt.Errorf( - "A private_vlan_id must be specified if a public_vlan_id is specified.") + return fmt.Errorf("[ERROR] A private_vlan_id must be specified if a public_vlan_id is specified.") } workerPoolZoneNetwork := v1.WorkerPoolZoneNetwork{ @@ -143,8 +144,7 @@ func resourceIBMContainerWorkerPoolZoneAttachmentCreate(d *schema.ResourceData, _, err = WaitForWorkerZoneNormal(cluster, workerPool, zone, meta, d.Timeout(schema.TimeoutUpdate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workers of worker pool (%s) of cluster (%s) to become ready: %s", workerPool, cluster, err) + return fmt.Errorf("[ERROR] Error waiting for workers of worker pool (%s) of cluster (%s) to become ready: %s", workerPool, cluster, err) } var waitTillALBs bool @@ -155,8 +155,7 @@ func resourceIBMContainerWorkerPoolZoneAttachmentCreate(d *schema.ResourceData, if waitTillALBs { _, err = waitForWorkerZoneALB(cluster, zone, meta, d.Timeout(schema.TimeoutUpdate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for ALBs in zone (%s) of cluster (%s) to become ready: %s", zone, cluster, err) + return fmt.Errorf("[ERROR] Error waiting for ALBs in zone (%s) of cluster (%s) to become ready: %s", zone, cluster, err) } } @@ -165,11 +164,11 @@ func resourceIBMContainerWorkerPoolZoneAttachmentCreate(d *schema.ResourceData, } func resourceIBMContainerWorkerPoolZoneAttachmentRead(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -206,7 +205,7 @@ func resourceIBMContainerWorkerPoolZoneAttachmentRead(d *schema.ResourceData, me } func resourceIBMContainerWorkerPoolZoneAttachmentUpdate(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -217,14 +216,13 @@ func resourceIBMContainerWorkerPoolZoneAttachmentUpdate(d *schema.ResourceData, privateVLAN := d.Get("private_vlan_id").(string) publicVLAN := d.Get("public_vlan_id").(string) if publicVLAN != "" && privateVLAN == "" { - return fmt.Errorf( - "A private VLAN must be specified if a public VLAN is specified.") + return fmt.Errorf("[ERROR] A private VLAN must be specified if a public VLAN is specified") } targetEnv, err := getWorkerPoolTargetHeader(d, meta) if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -241,12 +239,12 @@ func resourceIBMContainerWorkerPoolZoneAttachmentUpdate(d *schema.ResourceData, } func resourceIBMContainerWorkerPoolZoneAttachmentDelete(d *schema.ResourceData, meta interface{}) error { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -265,24 +263,23 @@ func resourceIBMContainerWorkerPoolZoneAttachmentDelete(d *schema.ResourceData, } _, err = WaitForWorkerZoneDeleted(cluster, workerPool, zone, meta, d.Timeout(schema.TimeoutDelete), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for deleting workers of worker pool (%s) of cluster (%s): %s", workerPool, cluster, err) + return fmt.Errorf("[ERROR] Error waiting for deleting workers of worker pool (%s) of cluster (%s): %s", workerPool, cluster, err) } return nil } func resourceIBMContainerWorkerPoolZoneAttachmentExists(d *schema.ResourceData, meta interface{}) (bool, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) < 3 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of clusterID/WorkerPoolID/ZoneID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of clusterID/WorkerPoolID/ZoneID", d.Id()) } cluster := parts[0] workerPoolID := parts[1] @@ -314,7 +311,7 @@ func resourceIBMContainerWorkerPoolZoneAttachmentExists(d *schema.ResourceData, } func WaitForWorkerZoneNormal(clusterNameOrID, workerPoolNameOrID, zone string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -335,7 +332,7 @@ func workerPoolZoneStateRefreshFunc(client v1.Workers, instanceID, workerPoolNam return func() (interface{}, string, error) { workerFields, err := client.ListByWorkerPool(instanceID, workerPoolNameOrID, false, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } //Done worker has two fields State and Status , so check for those 2 for _, e := range workerFields { @@ -352,7 +349,7 @@ func workerPoolZoneStateRefreshFunc(client v1.Workers, instanceID, workerPoolNam } func WaitForWorkerZoneDeleted(clusterNameOrID, workerPoolNameOrID, zone string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -373,7 +370,7 @@ func workerPoolZoneDeleteStateRefreshFunc(client v1.Workers, instanceID, workerP return func() (interface{}, string, error) { workerFields, err := client.ListByWorkerPool(instanceID, workerPoolNameOrID, true, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s", err) } //Done worker has two fields State and Status , so check for those 2 for _, e := range workerFields { @@ -388,7 +385,7 @@ func workerPoolZoneDeleteStateRefreshFunc(client v1.Workers, instanceID, workerP } func waitForWorkerZoneALB(clusterNameOrID, zone string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -410,7 +407,7 @@ func workerZoneALBStateRefreshFunc(client v1.Albs, instanceID, zone string, targ // Get all ALBs associated with cluster albs, err := client.ListClusterALBs(instanceID, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving ALBs for cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving ALBs for cluster: %s", err) } privateALBsByZone := []v1.ALBConfig{} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ob_logging.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_ob_logging.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ob_logging.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_ob_logging.go index 23cdbd5516..6cd806b471 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ob_logging.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_ob_logging.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -14,6 +14,8 @@ import ( v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) const ( @@ -30,7 +32,7 @@ const ( obLoggingNamespace = "namespace" ) -func resourceIBMObLogging() *schema.Resource { +func ResourceIBMObLogging() *schema.Resource { return &schema.Resource{ Create: resourceIBMLoggingCreate, Read: resourceIBMLoggingRead, @@ -121,7 +123,7 @@ func waitForClusterIntegration(d *schema.ResourceData, meta interface{}, cluster if err != nil { return nil, err } - csClient, err := meta.(ClientSession).VpcContainerAPI() + csClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return nil, err } @@ -147,7 +149,7 @@ func waitForClusterIntegration(d *schema.ResourceData, meta interface{}, cluster } func resourceIBMLoggingCreate(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -202,11 +204,11 @@ func resourceIBMLoggingCreate(d *schema.ResourceData, meta interface{}) error { return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { logging, err = client.Logging().CreateLoggingConfig(params, targetEnv) } if err != nil { - return fmt.Errorf("error latching logging instance to cluster: %w", err) + return fmt.Errorf("[ERROR] Error latching logging instance to cluster: %w", err) } d.SetId(fmt.Sprintf("%s/%s", clusterName, logging.InstanceID)) @@ -215,16 +217,16 @@ func resourceIBMLoggingCreate(d *schema.ResourceData, meta interface{}) error { } func getLoggingTargetHeader(d *schema.ResourceData, meta interface{}) (v2.LoggingTargetHeader, error) { - _, err := meta.(ClientSession).BluemixSession() + _, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return v2.LoggingTargetHeader{}, err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return v2.LoggingTargetHeader{}, err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount targetEnv := v2.LoggingTargetHeader{ AccountID: accountID, @@ -235,17 +237,17 @@ func getLoggingTargetHeader(d *schema.ResourceData, meta interface{}) (v2.Loggin func resourceIBMLoggingRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } if len(parts) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of clusterNameorID/loggingID", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of clusterNameorID/loggingID", d.Id()) } clusterName := parts[0] loggingID := parts[1] @@ -263,7 +265,7 @@ func resourceIBMLoggingRead(d *schema.ResourceData, meta interface{}) error { return nil } } - return fmt.Errorf("Error in GetLoggingConfig: %s", err) + return fmt.Errorf("[ERROR] Error in GetLoggingConfig: %s", err) } d.Set(obLoggingPrivateEndpoint, config.PrivateEndpoint) @@ -284,7 +286,7 @@ func resourceIBMLoggingUpdate(d *schema.ResourceData, meta interface{}) error { hasChanged := false idChanged := false - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -296,7 +298,7 @@ func resourceIBMLoggingUpdate(d *schema.ResourceData, meta interface{}) error { loggingUpdateModel := v2.LoggingUpdateRequest{} - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -342,7 +344,7 @@ func resourceIBMLoggingUpdate(d *schema.ResourceData, meta interface{}) error { } func resourceIBMLoggingDelete(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -352,7 +354,7 @@ func resourceIBMLoggingDelete(d *schema.ResourceData, meta interface{}) error { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -373,7 +375,7 @@ func resourceIBMLoggingDelete(d *schema.ResourceData, meta interface{}) error { return nil } } - return fmt.Errorf("Error in DeleteLoggingConfig: %s", err) + return fmt.Errorf("[ERROR] Error in DeleteLoggingConfig: %s", err) } d.SetId("") return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ob_monitoring.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_ob_monitoring.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ob_monitoring.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_ob_monitoring.go index 532d09331c..ffc562e86f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_ob_monitoring.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes/resource_ibm_ob_monitoring.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package kubernetes import ( "fmt" @@ -14,6 +14,8 @@ import ( v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) const ( @@ -30,7 +32,7 @@ const ( obMonitoringNamespace = "namespace" ) -func resourceIBMObMonitoring() *schema.Resource { +func ResourceIBMObMonitoring() *schema.Resource { return &schema.Resource{ Create: resourceIBMMonitoringCreate, Read: resourceIBMMonitoringRead, @@ -119,7 +121,7 @@ func resourceIBMObMonitoring() *schema.Resource { func resourceIBMMonitoringCreate(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -173,11 +175,11 @@ func resourceIBMMonitoringCreate(d *schema.ResourceData, meta interface{}) error return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { monitoring, err = client.Monitoring().CreateMonitoringConfig(params, targetEnv) } if err != nil { - return fmt.Errorf("error latching monitoring instance to cluster: %w", err) + return fmt.Errorf("[ERROR] Error latching monitoring instance to cluster: %w", err) } d.SetId(fmt.Sprintf("%s/%s", clusterName, monitoring.InstanceID)) @@ -186,16 +188,16 @@ func resourceIBMMonitoringCreate(d *schema.ResourceData, meta interface{}) error } func getMonitoringTargetHeader(d *schema.ResourceData, meta interface{}) (v2.MonitoringTargetHeader, error) { - _, err := meta.(ClientSession).BluemixSession() + _, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return v2.MonitoringTargetHeader{}, err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return v2.MonitoringTargetHeader{}, err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount targetEnv := v2.MonitoringTargetHeader{ AccountID: accountID, @@ -206,17 +208,17 @@ func getMonitoringTargetHeader(d *schema.ResourceData, meta interface{}) (v2.Mon func resourceIBMMonitoringRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } if len(parts) < 2 { - return fmt.Errorf("Incorrect ID %s: Id should be a combination of clusterNameorID/monitoringID", d.Id()) + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of clusterNameorID/monitoringID", d.Id()) } clusterName := parts[0] monitoringID := parts[1] @@ -234,7 +236,7 @@ func resourceIBMMonitoringRead(d *schema.ResourceData, meta interface{}) error { return nil } } - return fmt.Errorf("Error in GetMonitoringConfig: %s", err) + return fmt.Errorf("[ERROR] Error in GetMonitoringConfig: %s", err) } d.Set(obMonitoringPrivateEndpoint, config.PrivateEndpoint) @@ -255,7 +257,7 @@ func resourceIBMMonitoringUpdate(d *schema.ResourceData, meta interface{}) error hasChanged := false idChanged := false - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -267,7 +269,7 @@ func resourceIBMMonitoringUpdate(d *schema.ResourceData, meta interface{}) error monitoringUpdateModel := v2.MonitoringUpdateRequest{} - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -314,7 +316,7 @@ func resourceIBMMonitoringUpdate(d *schema.ResourceData, meta interface{}) error func resourceIBMMonitoringDelete(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(ClientSession).VpcContainerAPI() + client, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return err } @@ -324,7 +326,7 @@ func resourceIBMMonitoringDelete(d *schema.ResourceData, meta interface{}) error return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -346,7 +348,7 @@ func resourceIBMMonitoringDelete(d *schema.ResourceData, meta interface{}) error return nil } } - return fmt.Errorf("Error in DeleteMonitoringConfig: %s", err) + return fmt.Errorf("[ERROR] Error in DeleteMonitoringConfig: %s", err) } d.SetId("") return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/README.md new file mode 100644 index 0000000000..90d76476e5 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Power Systems + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Power Systems resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_cloud_connection) +* IBM API Docs: [IBM API Docs for Power Systems](https://cloud.ibm.com/apidocs/power-cloud) +* IBM Power Systems SDK: [IBM SDK for Power Systems](https://github.com/IBM-Cloud/power-go-client) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_catalog_images.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_catalog_images.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_catalog_images.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_catalog_images.go index 7c437c4551..ffdbbac610 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_catalog_images.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_catalog_images.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -13,13 +13,14 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) /* Datasource to get the list of images that are available when a power instance is created */ -func dataSourceIBMPICatalogImages() *schema.Resource { +func DataSourceIBMPICatalogImages() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPICatalogImagesRead, @@ -115,7 +116,7 @@ func dataSourceIBMPICatalogImages() *schema.Resource { } func dataSourceIBMPICatalogImagesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_connection.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_connection.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_connection.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_connection.go index 86119ca7eb..aad4d102c6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_connection.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -14,6 +14,7 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( @@ -34,7 +35,7 @@ const ( PICloudConnectionVPCCRNs = "vpc_crns" ) -func dataSourceIBMPICloudConnection() *schema.Resource { +func DataSourceIBMPICloudConnection() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPICloudConnectionRead, Schema: map[string]*schema.Schema{ @@ -116,7 +117,7 @@ func dataSourceIBMPICloudConnection() *schema.Resource { } func dataSourceIBMPICloudConnectionRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_connections.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_connections.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_connections.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_connections.go index ce65620eba..d1a1ccd903 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_connections.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_connections.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -9,6 +9,7 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,7 +23,7 @@ Datasource to get the list of Cloud Connections in a power instance const PICloudConnections = "connections" -func dataSourceIBMPICloudConnections() *schema.Resource { +func DataSourceIBMPICloudConnections() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPICloudConnectionsRead, @@ -114,7 +115,7 @@ func dataSourceIBMPICloudConnections() *schema.Resource { } func dataSourceIBMPICloudConnectionsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_instance.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_instance.go index 46eb0a1ff9..f9fa86dcd5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_cloud_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_cloud_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -13,9 +13,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPICloudInstance() *schema.Resource { +func DataSourceIBMPICloudInstance() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPICloudInstanceRead, @@ -101,7 +102,7 @@ func dataSourceIBMPICloudInstance() *schema.Resource { } func dataSourceIBMPICloudInstanceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_dhcp.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcp.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_dhcp.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcp.go index 491c8735c0..668e44c1cb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_dhcp.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcp.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -9,6 +9,7 @@ import ( "log" st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -21,7 +22,7 @@ const ( PIDhcpID = "pi_dhcp_id" ) -func dataSourceIBMPIDhcp() *schema.Resource { +func DataSourceIBMPIDhcp() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIDhcpRead, @@ -71,7 +72,7 @@ func dataSourceIBMPIDhcp() *schema.Resource { } func dataSourceIBMPIDhcpRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_dhcps.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcps.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_dhcps.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcps.go index aaaf0adea6..1507c12db7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_dhcps.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcps.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -9,6 +9,7 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,7 +23,7 @@ Datasource to get the list of dhcp servers in a power instance const PIDhcpServers = "servers" -func dataSourceIBMPIDhcps() *schema.Resource { +func DataSourceIBMPIDhcps() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIDhcpServersRead, @@ -61,7 +62,7 @@ func dataSourceIBMPIDhcps() *schema.Resource { } func dataSourceIBMPIDhcpServersRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_image.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_image.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_image.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_image.go index a2cdc27b3e..c88a51a55e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_image.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_image.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPIImage() *schema.Resource { +func DataSourceIBMPIImage() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIImagesRead, @@ -70,7 +71,7 @@ func dataSourceIBMPIImage() *schema.Resource { } func dataSourceIBMPIImagesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_images.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_images.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_images.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_images.go index 98218dd911..6541c45dc5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_images.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_images.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -21,7 +22,7 @@ import ( Datasource to get the list of images that are available when a power instance is created */ -func dataSourceIBMPIImages() *schema.Resource { +func DataSourceIBMPIImages() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIImagesAllRead, @@ -76,7 +77,7 @@ func dataSourceIBMPIImages() *schema.Resource { } func dataSourceIBMPIImagesAllRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance.go index e60034ec5b..f3b140bfaa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -12,9 +12,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPIInstance() *schema.Resource { +func DataSourceIBMPIInstance() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIInstancesRead, @@ -52,6 +53,39 @@ func dataSourceIBMPIInstance() *schema.Resource { Computed: true, }, "addresses": { + Type: schema.TypeList, + Computed: true, + Deprecated: "This field is deprecated, use networks instead", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip": { + Type: schema.TypeString, + Computed: true, + }, + "macaddress": { + Type: schema.TypeString, + Computed: true, + }, + "network_id": { + Type: schema.TypeString, + Computed: true, + }, + "network_name": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + "external_ip": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "networks": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ @@ -155,7 +189,7 @@ func dataSourceIBMPIInstance() *schema.Resource { func dataSourceIBMPIInstancesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) @@ -176,7 +210,7 @@ func dataSourceIBMPIInstancesRead(ctx context.Context, d *schema.ResourceData, m d.Set("processors", powervmdata.Processors) d.Set("status", powervmdata.Status) d.Set("proctype", powervmdata.ProcType) - d.Set("volumes", powervmdata.VolumeIds) + d.Set("volumes", powervmdata.VolumeIDs) d.Set("minproc", powervmdata.Minproc) d.Set("minmem", powervmdata.Minmem) d.Set("maxproc", powervmdata.Maxproc) @@ -189,6 +223,7 @@ func dataSourceIBMPIInstancesRead(ctx context.Context, d *schema.ResourceData, m d.Set("storage_pool", powervmdata.StoragePool) d.Set("storage_pool_affinity", powervmdata.StoragePoolAffinity) d.Set("license_repository_capacity", powervmdata.LicenseRepositoryCapacity) + d.Set("networks", flattenPvmInstanceNetworks(powervmdata.Networks)) if *powervmdata.PlacementGroup != "none" { d.Set(PIPlacementGroupID, powervmdata.PlacementGroup) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_console_languages.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_console_languages.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_console_languages.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_console_languages.go index 38e95ce652..e5cb5b344d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_console_languages.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_console_languages.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -24,7 +25,7 @@ const ( /* Datasource to get the list of available console languages for an instance */ -func dataSourceIBMPIInstanceConsoleLanguages() *schema.Resource { +func DataSourceIBMPIInstanceConsoleLanguages() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIInstanceConsoleLanguagesRead, Schema: map[string]*schema.Schema{ @@ -64,7 +65,7 @@ func dataSourceIBMPIInstanceConsoleLanguages() *schema.Resource { } func dataSourceIBMPIInstanceConsoleLanguagesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_ip.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_ip.go index e845a77222..0c9f33b5d1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_ip.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -11,12 +11,13 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPIInstanceIP() *schema.Resource { +func DataSourceIBMPIInstanceIP() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIInstancesIPRead, @@ -68,7 +69,7 @@ func dataSourceIBMPIInstanceIP() *schema.Resource { } func dataSourceIBMPIInstancesIPRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_volumes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_volumes.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_volumes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_volumes.go index 3947a55ca6..611ef5cf62 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_instance_volumes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instance_volumes.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -16,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPIInstanceVolumes() *schema.Resource { +func DataSourceIBMPIInstanceVolumes() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIInstanceVolumesRead, @@ -87,7 +88,7 @@ func dataSourceIBMPIInstanceVolumes() *schema.Resource { } func dataSourceIBMPIInstanceVolumesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instances.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instances.go new file mode 100644 index 0000000000..b076f441a9 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_instances.go @@ -0,0 +1,231 @@ +// Copyright IBM Corp. 2017, 2022 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" +) + +func DataSourceIBMPIInstances() *schema.Resource { + + return &schema.Resource{ + ReadContext: dataSourceIBMPIInstancesAllRead, + Schema: map[string]*schema.Schema{ + helpers.PICloudInstanceId: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + + // Computed Attributes + "pvm_instances": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "pvm_instance_id": { + Type: schema.TypeString, + Computed: true, + }, + "memory": { + Type: schema.TypeFloat, + Computed: true, + }, + "processors": { + Type: schema.TypeFloat, + Computed: true, + }, + "health_status": { + Type: schema.TypeString, + Computed: true, + }, + "networks": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip": { + Type: schema.TypeString, + Computed: true, + }, + "macaddress": { + Type: schema.TypeString, + Computed: true, + }, + "network_id": { + Type: schema.TypeString, + Computed: true, + }, + "network_name": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + "external_ip": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "proctype": { + Type: schema.TypeString, + Computed: true, + }, + + "status": { + Type: schema.TypeString, + Computed: true, + }, + + "minproc": { + Type: schema.TypeFloat, + Computed: true, + }, + "minmem": { + Type: schema.TypeFloat, + Computed: true, + }, + "maxproc": { + Type: schema.TypeFloat, + Computed: true, + }, + "maxmem": { + Type: schema.TypeFloat, + Computed: true, + }, + "pin_policy": { + Type: schema.TypeString, + Computed: true, + }, + "virtual_cores_assigned": { + Type: schema.TypeInt, + Computed: true, + }, + "max_virtual_cores": { + Type: schema.TypeInt, + Computed: true, + }, + "min_virtual_cores": { + Type: schema.TypeInt, + Computed: true, + }, + "storage_type": { + Type: schema.TypeString, + Computed: true, + }, + "storage_pool": { + Type: schema.TypeString, + Computed: true, + }, + "storage_pool_affinity": { + Type: schema.TypeBool, + Computed: true, + }, + "license_repository_capacity": { + Type: schema.TypeInt, + Computed: true, + }, + PIPlacementGroupID: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMPIInstancesAllRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := meta.(conns.ClientSession).IBMPISession() + + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + + powerC := instance.NewIBMPIInstanceClient(ctx, sess, cloudInstanceID) + powervmdata, err := powerC.GetAll() + + if err != nil { + return diag.FromErr(err) + } + + var clientgenU, _ = uuid.GenerateUUID() + d.SetId(clientgenU) + d.Set("pvm_instances", flattenPvmInstances(powervmdata.PvmInstances)) + + return nil +} + +func flattenPvmInstances(list []*models.PVMInstanceReference) []map[string]interface{} { + result := make([]map[string]interface{}, 0, len(list)) + for _, i := range list { + + l := map[string]interface{}{ + "pvm_instance_id": *i.PvmInstanceID, + "memory": *i.Memory, + "processors": *i.Processors, + "proctype": *i.ProcType, + "status": *i.Status, + "minproc": i.Minproc, + "minmem": i.Minmem, + "maxproc": i.Maxproc, + "maxmem": i.Maxmem, + "pin_policy": i.PinPolicy, + "virtual_cores_assigned": i.VirtualCores.Assigned, + "max_virtual_cores": i.VirtualCores.Max, + "min_virtual_cores": i.VirtualCores.Min, + "storage_type": i.StorageType, + "storage_pool": i.StoragePool, + "storage_pool_affinity": i.StoragePoolAffinity, + "license_repository_capacity": i.LicenseRepositoryCapacity, + PIPlacementGroupID: i.PlacementGroup, + "networks": flattenPvmInstanceNetworks(i.Networks), + } + + if i.Health != nil { + l["health_status"] = i.Health.Status + } + + result = append(result, l) + + } + return result +} + +func flattenPvmInstanceNetworks(list []*models.PVMInstanceNetwork) (networks []map[string]interface{}) { + if list != nil { + networks = make([]map[string]interface{}, len(list)) + for i, pvmip := range list { + + p := make(map[string]interface{}) + p["ip"] = pvmip.IP + p["network_name"] = pvmip.NetworkName + p["network_id"] = pvmip.NetworkID + p["macaddress"] = pvmip.MacAddress + p["type"] = pvmip.Type + p["external_ip"] = pvmip.ExternalIP + networks[i] = p + } + return networks + } + return +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_key.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_key.go index f37db3bdd5..e41a97f984 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -12,9 +12,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPIKey() *schema.Resource { +func DataSourceIBMPIKey() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIKeyRead, @@ -46,7 +47,7 @@ func dataSourceIBMPIKey() *schema.Resource { } func dataSourceIBMPIKeyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_keys.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_keys.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_keys.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_keys.go index e0ac4b8a34..bfcf0710a7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_keys.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_keys.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -14,6 +14,7 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( @@ -23,7 +24,7 @@ const ( PIKeyDate = "creation_date" ) -func dataSourceIBMPIKeys() *schema.Resource { +func DataSourceIBMPIKeys() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIKeysRead, Schema: map[string]*schema.Schema{ @@ -62,7 +63,7 @@ func dataSourceIBMPIKeys() *schema.Resource { } func dataSourceIBMPIKeysRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_network.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_network.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_network.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_network.go index 20d3af84f0..a080f5a022 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_network.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( //"fmt" @@ -14,9 +14,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPINetwork() *schema.Resource { +func DataSourceIBMPINetwork() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPINetworkRead, @@ -65,8 +66,14 @@ func dataSourceIBMPINetwork() *schema.Resource { Computed: true, }, "name": { - Type: schema.TypeString, + Type: schema.TypeString, + Computed: true, + Deprecated: "This value is deprecated in favor of" + helpers.PINetworkName, + }, + "dns": { + Type: schema.TypeSet, Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "jumbo": { Type: schema.TypeBool, @@ -77,7 +84,7 @@ func dataSourceIBMPINetwork() *schema.Resource { } func dataSourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -113,6 +120,9 @@ func dataSourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, met if networkdata.Name != nil { d.Set("name", networkdata.Name) } + if len(networkdata.DNSServers) > 0 { + d.Set("dns", networkdata.DNSServers) + } d.Set("jumbo", networkdata.Jumbo) return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_network_port.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_network_port.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_network_port.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_network_port.go index a879abdf9a..e98a9c3b1b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_network_port.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_network_port.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" "log" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -18,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPINetworkPort() *schema.Resource { +func DataSourceIBMPINetworkPort() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPINetworkPortsRead, @@ -78,7 +79,7 @@ func dataSourceIBMPINetworkPort() *schema.Resource { } func dataSourceIBMPINetworkPortsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_placement_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_placement_group.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_placement_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_placement_group.go index 1c9138e033..9792aa331d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_placement_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -11,11 +11,12 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPIPlacementGroup() *schema.Resource { +func DataSourceIBMPIPlacementGroup() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIPlacementGroupRead, @@ -47,7 +48,7 @@ func dataSourceIBMPIPlacementGroup() *schema.Resource { func dataSourceIBMPIPlacementGroupRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_placement_groups.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_placement_groups.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_placement_groups.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_placement_groups.go index 523b4d2fdc..345f2bf05c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_placement_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_placement_groups.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -14,13 +14,14 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( PIPlacementGroups = "placement_groups" ) -func dataSourceIBMPIPlacementGroups() *schema.Resource { +func DataSourceIBMPIPlacementGroups() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIPlacementGroupsRead, Schema: map[string]*schema.Schema{ @@ -61,7 +62,7 @@ func dataSourceIBMPIPlacementGroups() *schema.Resource { } func dataSourceIBMPIPlacementGroupsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_public_network.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_public_network.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_public_network.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_public_network.go index c01753ad6e..ca5cc380e2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_public_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_public_network.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( //"fmt" @@ -13,9 +13,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPIPublicNetwork() *schema.Resource { +func DataSourceIBMPIPublicNetwork() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIPublicNetworkRead, @@ -44,7 +45,7 @@ func dataSourceIBMPIPublicNetwork() *schema.Resource { } func dataSourceIBMPIPublicNetworkRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_sap_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_sap_profile.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_sap_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_sap_profile.go index b39bbf3357..43510987d1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_sap_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_sap_profile.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -13,9 +13,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPISAPProfile() *schema.Resource { +func DataSourceIBMPISAPProfile() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPISAPProfileRead, Schema: map[string]*schema.Schema{ @@ -55,7 +56,7 @@ func dataSourceIBMPISAPProfile() *schema.Resource { } func dataSourceIBMPISAPProfileRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_sap_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_sap_profiles.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_sap_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_sap_profiles.go index 6fbdeaabed..d4adc81731 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_sap_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_sap_profiles.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -14,6 +14,7 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( @@ -25,7 +26,7 @@ const ( PISAPProfileType = "type" ) -func dataSourceIBMPISAPProfiles() *schema.Resource { +func DataSourceIBMPISAPProfiles() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPISAPProfilesRead, Schema: map[string]*schema.Schema{ @@ -73,7 +74,7 @@ func dataSourceIBMPISAPProfiles() *schema.Resource { } func dataSourceIBMPISAPProfilesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_snapshot.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_snapshot.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_snapshot.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_snapshot.go index e68346e7a1..b852f1024f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_snapshot.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_snapshot.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -10,13 +10,14 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPISnapshot() *schema.Resource { +func DataSourceIBMPISnapshot() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPISnapshotRead, @@ -86,7 +87,7 @@ func dataSourceIBMPISnapshot() *schema.Resource { func dataSourceIBMPISnapshotRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_snapshots.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_snapshots.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_snapshots.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_snapshots.go index 6fa8e2a16f..273c0fcef8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_snapshots.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_snapshots.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -10,13 +10,14 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPISnapshots() *schema.Resource { +func DataSourceIBMPISnapshots() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPISnapshotsRead, @@ -77,7 +78,7 @@ func dataSourceIBMPISnapshots() *schema.Resource { } func dataSourceIBMPISnapshotsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go new file mode 100644 index 0000000000..1f0c2c1c85 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go @@ -0,0 +1,84 @@ +// Copyright IBM Corp. 2022 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + "fmt" + + "log" + + st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + PIPoolName = "pi_storage_pool" +) + +func DataSourceIBMPIStoragePoolCapacity() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIStoragePoolCapacityRead, + Schema: map[string]*schema.Schema{ + helpers.PICloudInstanceId: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + PIPoolName: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + Description: "Storage pool name", + }, + // Computed Attributes + MaxAllocationSize: { + Type: schema.TypeInt, + Computed: true, + Description: "Maximum allocation storage size (GB)", + }, + StorageType: { + Type: schema.TypeString, + Computed: true, + Description: "Storage type of the storage pool", + }, + TotalCapacity: { + Type: schema.TypeInt, + Computed: true, + Description: "Total pool capacity (GB)", + }, + }, + } +} + +func dataSourceIBMPIStoragePoolCapacityRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + storagePool := d.Get(PIPoolName).(string) + + client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + sp, err := client.GetStoragePoolCapacity(storagePool) + if err != nil { + log.Printf("[ERROR] get storage pool capacity failed %v", err) + return diag.FromErr(err) + } + + d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, storagePool)) + + d.Set(MaxAllocationSize, sp.MaxAllocationSize) + d.Set(StorageType, sp.StorageType) + d.Set(TotalCapacity, sp.TotalCapacity) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go new file mode 100644 index 0000000000..9b22cff7d6 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go @@ -0,0 +1,122 @@ +// Copyright IBM Corp. 2022 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "log" + + st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + MaximumStorageAllocation = "maximum_storage_allocation" + StoragePoolsCapacity = "storage_pools_capacity" + MaxAllocationSize = "max_allocation_size" + PoolName = "pool_name" + StoragePool = "storage_pool" + StorageType = "storage_type" + TotalCapacity = "total_capacity" +) + +func DataSourceIBMPIStoragePoolsCapacity() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIStoragePoolsCapacityRead, + Schema: map[string]*schema.Schema{ + helpers.PICloudInstanceId: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + // Computed Attributes + MaximumStorageAllocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Maximum storage allocation", + }, + StoragePoolsCapacity: { + Type: schema.TypeList, + Computed: true, + Description: "Storage pools capacity", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + MaxAllocationSize: { + Type: schema.TypeInt, + Computed: true, + Description: "Maximum allocation storage size (GB)", + }, + PoolName: { + Type: schema.TypeString, + Computed: true, + Description: "Pool name", + }, + StorageType: { + Type: schema.TypeString, + Computed: true, + Description: "Storage type of the storage pool", + }, + TotalCapacity: { + Type: schema.TypeInt, + Computed: true, + Description: "Total pool capacity (GB)", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMPIStoragePoolsCapacityRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + + client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + spc, err := client.GetAllStoragePoolsCapacity() + if err != nil { + log.Printf("[ERROR] get all storage pools capacity failed %v", err) + return diag.FromErr(err) + } + + var genID, _ = uuid.GenerateUUID() + d.SetId(genID) + + if spc.MaximumStorageAllocation != nil { + msa := spc.MaximumStorageAllocation + data := map[string]interface{}{ + MaxAllocationSize: msa.MaxAllocationSize, + StoragePool: msa.StoragePool, + StorageType: msa.StorageType, + } + d.Set(MaximumStorageAllocation, flex.Flatten(data)) + } + + result := make([]map[string]string, 0, len(spc.StoragePoolsCapacity)) + for _, sp := range spc.StoragePoolsCapacity { + data := map[string]interface{}{ + MaxAllocationSize: sp.MaxAllocationSize, + PoolName: sp.PoolName, + StorageType: sp.StorageType, + TotalCapacity: sp.TotalCapacity, + } + result = append(result, flex.Flatten(data)) + } + d.Set(StoragePoolsCapacity, result) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go new file mode 100644 index 0000000000..f8c0003867 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go @@ -0,0 +1,122 @@ +// Copyright IBM Corp. 2022 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + "fmt" + + "log" + + st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + PITypeName = "pi_storage_type" +) + +func DataSourceIBMPIStorageTypeCapacity() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIStorageTypeCapacityRead, + Schema: map[string]*schema.Schema{ + helpers.PICloudInstanceId: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + PITypeName: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + Description: "Storage type name", + }, + // Computed Attributes + MaximumStorageAllocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Maximum storage allocation", + }, + StoragePoolsCapacity: { + Type: schema.TypeList, + Computed: true, + Description: "Storage pools capacity", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + MaxAllocationSize: { + Type: schema.TypeInt, + Computed: true, + Description: "Maximum allocation storage size (GB)", + }, + PoolName: { + Type: schema.TypeString, + Computed: true, + Description: "Pool name", + }, + StorageType: { + Type: schema.TypeString, + Computed: true, + Description: "Storage type of the storage pool", + }, + TotalCapacity: { + Type: schema.TypeInt, + Computed: true, + Description: "Total pool capacity (GB)", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMPIStorageTypeCapacityRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + storageType := d.Get(PITypeName).(string) + + client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + stc, err := client.GetStorageTypeCapacity(storageType) + if err != nil { + log.Printf("[ERROR] get storage type capacity failed %v", err) + return diag.FromErr(err) + } + + d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, storageType)) + + if stc.MaximumStorageAllocation != nil { + msa := stc.MaximumStorageAllocation + data := map[string]interface{}{ + MaxAllocationSize: msa.MaxAllocationSize, + StoragePool: msa.StoragePool, + StorageType: msa.StorageType, + } + d.Set(MaximumStorageAllocation, flex.Flatten(data)) + } + + result := make([]map[string]string, 0, len(stc.StoragePoolsCapacity)) + for _, sp := range stc.StoragePoolsCapacity { + data := map[string]interface{}{ + MaxAllocationSize: sp.MaxAllocationSize, + PoolName: sp.PoolName, + StorageType: sp.StorageType, + TotalCapacity: sp.TotalCapacity, + } + result = append(result, flex.Flatten(data)) + } + d.Set(StoragePoolsCapacity, result) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go new file mode 100644 index 0000000000..24c5d94dac --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go @@ -0,0 +1,151 @@ +// Copyright IBM Corp. 2022 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + + "log" + + st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +const ( + StorageTypesCapacity = "storage_types_capacity" +) + +func DataSourceIBMPIStorageTypesCapacity() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMPIStorageTypesCapacityRead, + Schema: map[string]*schema.Schema{ + helpers.PICloudInstanceId: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + // Computed Attributes + MaximumStorageAllocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Maximum storage allocation", + }, + StorageTypesCapacity: { + Type: schema.TypeList, + Computed: true, + Description: "Storage types capacity", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + MaximumStorageAllocation: { + Type: schema.TypeMap, + Computed: true, + Description: "Maximum storage allocation", + }, + StoragePoolsCapacity: { + Type: schema.TypeList, + Computed: true, + Description: "Storage pools capacity", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + MaxAllocationSize: { + Type: schema.TypeInt, + Computed: true, + Description: "Maximum allocation storage size (GB)", + }, + PoolName: { + Type: schema.TypeString, + Computed: true, + Description: "Pool name", + }, + StorageType: { + Type: schema.TypeString, + Computed: true, + Description: "Storage type of the storage pool", + }, + TotalCapacity: { + Type: schema.TypeInt, + Computed: true, + Description: "Total pool capacity (GB)", + }, + }, + }, + }, + StorageType: { + Type: schema.TypeString, + Computed: true, + Description: "The storage type", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMPIStorageTypesCapacityRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + + client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + stc, err := client.GetAllStorageTypesCapacity() + if err != nil { + log.Printf("[ERROR] get all storage types capacity failed %v", err) + return diag.FromErr(err) + } + + var genID, _ = uuid.GenerateUUID() + d.SetId(genID) + + if stc.MaximumStorageAllocation != nil { + msa := stc.MaximumStorageAllocation + data := map[string]interface{}{ + MaxAllocationSize: msa.MaxAllocationSize, + StoragePool: msa.StoragePool, + StorageType: msa.StorageType, + } + d.Set(MaximumStorageAllocation, flex.Flatten(data)) + } + stcResult := make([]map[string]interface{}, 0, len(stc.StorageTypesCapacity)) + for _, st := range stc.StorageTypesCapacity { + stResult := map[string]interface{}{} + if st.MaximumStorageAllocation != nil { + msa := st.MaximumStorageAllocation + data := map[string]interface{}{ + MaxAllocationSize: msa.MaxAllocationSize, + StoragePool: msa.StoragePool, + StorageType: msa.StorageType, + } + stResult[MaximumStorageAllocation] = flex.Flatten(data) + } + spc := make([]map[string]string, 0, len(st.StoragePoolsCapacity)) + for _, sp := range st.StoragePoolsCapacity { + data := map[string]interface{}{ + MaxAllocationSize: sp.MaxAllocationSize, + PoolName: sp.PoolName, + StorageType: sp.StorageType, + TotalCapacity: sp.TotalCapacity, + } + spc = append(spc, flex.Flatten(data)) + } + stResult[StoragePoolsCapacity] = spc + stResult[StorageType] = st.StorageType + stcResult = append(stcResult, stResult) + } + + d.Set(StorageTypesCapacity, stcResult) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_tenant.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_tenant.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_tenant.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_tenant.go index 41ed619cde..5aceed866b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_tenant.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_tenant.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -12,10 +12,11 @@ import ( //"fmt" "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceIBMPITenant() *schema.Resource { +func DataSourceIBMPITenant() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPITenantRead, @@ -60,7 +61,7 @@ func dataSourceIBMPITenant() *schema.Resource { } func dataSourceIBMPITenantRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_volume.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_volume.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_volume.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_volume.go index 1eaccb35f2..7974b4dfab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_volume.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( //"fmt" @@ -14,9 +14,10 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func dataSourceIBMPIVolume() *schema.Resource { +func DataSourceIBMPIVolume() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIVolumeRead, Schema: map[string]*schema.Schema{ @@ -66,7 +67,7 @@ func dataSourceIBMPIVolume() *schema.Resource { } func dataSourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_capture.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_capture.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_capture.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_capture.go index 7631ff4172..ed0b73d15e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_capture.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_capture.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -14,6 +14,9 @@ import ( "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -21,7 +24,7 @@ import ( const cloudStorageDestination string = "cloud-storage" const imageCatalogDestination string = "image-catalog" -func resourceIBMPICapture() *schema.Resource { +func ResourceIBMPICapture() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPICaptureCreate, ReadContext: resourceIBMPICaptureRead, @@ -61,7 +64,7 @@ func resourceIBMPICapture() *schema.Resource { Required: true, ForceNew: true, Description: "Destination for the deployable image", - ValidateFunc: validateAllowedStringValue([]string{"image-catalog", "cloud-storage", "both"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"image-catalog", "cloud-storage", "both"}), }, helpers.PIInstanceCaptureVolumeIds: { @@ -70,7 +73,7 @@ func resourceIBMPICapture() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, ForceNew: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "List of Data volume IDs", }, @@ -112,7 +115,7 @@ func resourceIBMPICapture() *schema.Resource { } func resourceIBMPICaptureCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -152,9 +155,9 @@ func resourceIBMPICaptureCreate(ctx context.Context, d *schema.ResourceData, met } if v, ok := d.GetOk(helpers.PIInstanceCaptureVolumeIds); ok { - volids := expandStringList((v.(*schema.Set)).List()) + volids := flex.ExpandStringList((v.(*schema.Set)).List()) if len(volids) > 0 { - captureBody.CaptureVolumeIds = volids + captureBody.CaptureVolumeIDs = volids } } @@ -174,11 +177,11 @@ func resourceIBMPICaptureCreate(ctx context.Context, d *schema.ResourceData, met } func resourceIBMPICaptureRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -207,11 +210,11 @@ func resourceIBMPICaptureRead(ctx context.Context, d *schema.ResourceData, meta } func resourceIBMPICaptureDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_cloud_connection.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_cloud_connection.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_cloud_connection.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_cloud_connection.go index 22a0ee9898..5e8dd7a9d6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_cloud_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_cloud_connection.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -17,9 +17,12 @@ import ( "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func resourceIBMPICloudConnection() *schema.Resource { +func ResourceIBMPICloudConnection() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPICloudConnectionCreate, ReadContext: resourceIBMPICloudConnectionRead, @@ -48,7 +51,7 @@ func resourceIBMPICloudConnection() *schema.Resource { helpers.PICloudConnectionSpeed: { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedIntValue([]int{50, 100, 200, 500, 1000, 2000, 5000, 10000}), + ValidateFunc: validate.ValidateAllowedIntValues([]int{50, 100, 200, 500, 1000, 2000, 5000, 10000}), Description: "Speed of the cloud connection (speed in megabits per second)", }, @@ -68,6 +71,7 @@ func resourceIBMPICloudConnection() *schema.Resource { helpers.PICloudConnectionNetworks: { Type: schema.TypeSet, Optional: true, + Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, Description: "Set of Networks to attach to this cloud connection", }, @@ -140,7 +144,7 @@ func resourceIBMPICloudConnection() *schema.Resource { } func resourceIBMPICloudConnectionCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -161,7 +165,7 @@ func resourceIBMPICloudConnectionCreate(ctx context.Context, d *schema.ResourceD } // networks if v, ok := d.GetOk(helpers.PICloudConnectionNetworks); ok && v.(*schema.Set).Len() > 0 { - body.Subnets = expandStringList(v.(*schema.Set).List()) + body.Subnets = flex.ExpandStringList(v.(*schema.Set).List()) } // classic if v, ok := d.GetOk(helpers.PICloudConnectionClassicEnabled); ok { @@ -187,7 +191,7 @@ func resourceIBMPICloudConnectionCreate(ctx context.Context, d *schema.ResourceD Enabled: vpcEnabled, } if v, ok := d.GetOk(helpers.PICloudConnectionVPCCRNs); ok && v.(*schema.Set).Len() > 0 { - vpcIds := expandStringList(v.(*schema.Set).List()) + vpcIds := flex.ExpandStringList(v.(*schema.Set).List()) vpcs := make([]*models.CloudConnectionVPC, len(vpcIds)) for i, vpcId := range vpcIds { vpcs[i] = &models.CloudConnectionVPC{ @@ -209,7 +213,7 @@ func resourceIBMPICloudConnectionCreate(ctx context.Context, d *schema.ResourceD if cloudConnection != nil { d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *cloudConnection.CloudConnectionID)) } else if cloudConnectionJob != nil { - d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *cloudConnection.CloudConnectionID)) + d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *cloudConnectionJob.CloudConnectionID)) jobID := *cloudConnectionJob.JobRef.ID @@ -224,12 +228,12 @@ func resourceIBMPICloudConnectionCreate(ctx context.Context, d *schema.ResourceD } func resourceIBMPICloudConnectionUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -286,7 +290,7 @@ func resourceIBMPICloudConnectionUpdate(ctx context.Context, d *schema.ResourceD Enabled: vpcEnabled, } if v, ok := d.GetOk(helpers.PICloudConnectionVPCCRNs); ok && v.(*schema.Set).Len() > 0 { - vpcIds := expandStringList(v.(*schema.Set).List()) + vpcIds := flex.ExpandStringList(v.(*schema.Set).List()) vpcs := make([]*models.CloudConnectionVPC, len(vpcIds)) for i, vpcId := range vpcIds { vpcs[i] = &models.CloudConnectionVPC{ @@ -324,7 +328,7 @@ func resourceIBMPICloudConnectionUpdate(ctx context.Context, d *schema.ResourceD toRemove := old.Difference(new) // call network add api for each toAdd - for _, n := range expandStringList(toAdd.List()) { + for _, n := range flex.ExpandStringList(toAdd.List()) { _, jobReference, err := client.AddNetwork(cloudConnectionID, n) if err != nil { return diag.FromErr(err) @@ -338,7 +342,7 @@ func resourceIBMPICloudConnectionUpdate(ctx context.Context, d *schema.ResourceD } // call network delete api for each toRemove - for _, n := range expandStringList(toRemove.List()) { + for _, n := range flex.ExpandStringList(toRemove.List()) { _, jobReference, err := client.DeleteNetwork(cloudConnectionID, n) if err != nil { return diag.FromErr(err) @@ -356,12 +360,12 @@ func resourceIBMPICloudConnectionUpdate(ctx context.Context, d *schema.ResourceD } func resourceIBMPICloudConnectionRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -423,12 +427,12 @@ func resourceIBMPICloudConnectionRead(ctx context.Context, d *schema.ResourceDat return nil } func resourceIBMPICloudConnectionDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_dhcp.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_dhcp.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_dhcp.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_dhcp.go index 18088b271c..e42f556c86 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_dhcp.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_dhcp.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -17,6 +17,8 @@ import ( "github.com/IBM-Cloud/power-go-client/errors" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p" + "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( @@ -32,7 +34,7 @@ const ( PIDhcpInstanceMac = "instance_mac" ) -func resourceIBMPIDhcp() *schema.Resource { +func ResourceIBMPIDhcp() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIDhcpCreate, ReadContext: resourceIBMPIDhcpRead, @@ -52,6 +54,13 @@ func resourceIBMPIDhcp() *schema.Resource { Description: "PI cloud instance ID", ForceNew: true, }, + helpers.PICloudConnectionId: { + Type: schema.TypeString, + Optional: true, + Description: "The cloud connection uuid to connect with DHCP private network", + ForceNew: true, + }, + //Computed Attributes PIDhcpId: { Type: schema.TypeString, @@ -92,15 +101,20 @@ func resourceIBMPIDhcp() *schema.Resource { } func resourceIBMPIDhcpCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + body := &models.DHCPServerCreate{} + if c, ok := d.GetOk(helpers.PICloudConnectionId); ok { + body.CloudConnectionID = c.(string) + } + client := st.NewIBMPIDhcpClient(ctx, sess, cloudInstanceID) - dhcpServer, err := client.Create() + dhcpServer, err := client.Create(body) if err != nil { log.Printf("[DEBUG] create DHCP failed %v", err) return diag.FromErr(err) @@ -117,7 +131,7 @@ func resourceIBMPIDhcpCreate(ctx context.Context, d *schema.ResourceData, meta i } func resourceIBMPIDhcpRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -161,7 +175,7 @@ func resourceIBMPIDhcpRead(ctx context.Context, d *schema.ResourceData, meta int return nil } func resourceIBMPIDhcpDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_ike_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_ike_policy.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_ike_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_ike_policy.go index a4b3b814d4..2d30b0f3b6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_ike_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_ike_policy.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -15,13 +15,15 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( PIPolicyId = "policy_id" ) -func resourceIBMPIIKEPolicy() *schema.Resource { +func ResourceIBMPIIKEPolicy() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIIKEPolicyCreate, ReadContext: resourceIBMPIIKEPolicyRead, @@ -50,25 +52,25 @@ func resourceIBMPIIKEPolicy() *schema.Resource { helpers.PIVPNPolicyDhGroup: { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedIntValue([]int{1, 2, 5, 14, 19, 20, 24}), + ValidateFunc: validate.ValidateAllowedIntValues([]int{1, 2, 5, 14, 19, 20, 24}), Description: "DH group of the IKE Policy", }, helpers.PIVPNPolicyEncryption: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"3des-cbc", "aes-128-cbc", "aes-128-gcm", "aes-192-cbc", "aes-256-cbc", "aes-256-gcm", "des-cbc"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"aes-256-cbc", "aes-192-cbc", "aes-128-cbc", "aes-256-gcm", "aes-128-gcm", "3des-cbc"}), Description: "Encryption of the IKE Policy", }, helpers.PIVPNPolicyKeyLifetime: { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(180, 86400), + ValidateFunc: validate.ValidateAllowedRangeInt(180, 86400), Description: "Policy key lifetime", }, helpers.PIVPNPolicyVersion: { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(1, 2), + ValidateFunc: validate.ValidateAllowedRangeInt(1, 2), Description: "Version of the IKE Policy", }, helpers.PIVPNPolicyPresharedKey: { @@ -82,7 +84,7 @@ func resourceIBMPIIKEPolicy() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "none", - ValidateFunc: validateAllowedStringValue([]string{"none", "sha-256", "sha-384", "sha1"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"sha-256", "sha-384", "sha1", "none"}), Description: "Authentication for the IKE Policy", }, @@ -97,7 +99,7 @@ func resourceIBMPIIKEPolicy() *schema.Resource { } func resourceIBMPIIKEPolicyCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -106,14 +108,15 @@ func resourceIBMPIIKEPolicyCreate(ctx context.Context, d *schema.ResourceData, m name := d.Get(helpers.PIVPNPolicyName).(string) dhGroup := int64(d.Get(helpers.PIVPNPolicyDhGroup).(int)) encryption := d.Get(helpers.PIVPNPolicyEncryption).(string) - keyLifetime := int64(d.Get(helpers.PIVPNPolicyKeyLifetime).(int)) presharedKey := d.Get(helpers.PIVPNPolicyPresharedKey).(string) version := int64(d.Get(helpers.PIVPNPolicyVersion).(int)) + keyLifetime := int64(d.Get(helpers.PIVPNPolicyKeyLifetime).(int)) + klt := models.KeyLifetime(keyLifetime) body := &models.IKEPolicyCreate{ DhGroup: &dhGroup, Encryption: &encryption, - KeyLifetime: models.KeyLifetime(keyLifetime), + KeyLifetime: &klt, Name: &name, PresharedKey: &presharedKey, Version: &version, @@ -136,7 +139,7 @@ func resourceIBMPIIKEPolicyCreate(ctx context.Context, d *schema.ResourceData, m } func resourceIBMPIIKEPolicyUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -187,7 +190,7 @@ func resourceIBMPIIKEPolicyUpdate(ctx context.Context, d *schema.ResourceData, m } func resourceIBMPIIKEPolicyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -223,7 +226,7 @@ func resourceIBMPIIKEPolicyRead(ctx context.Context, d *schema.ResourceData, met } func resourceIBMPIIKEPolicyDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_image.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_image.go new file mode 100644 index 0000000000..3f83a8df26 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_image.go @@ -0,0 +1,395 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package power + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/errors" + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images" + "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" +) + +func ResourceIBMPIImage() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMPIImageCreate, + ReadContext: resourceIBMPIImageRead, + DeleteContext: resourceIBMPIImageDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(60 * time.Minute), + Delete: schema.DefaultTimeout(60 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + helpers.PICloudInstanceId: { + Type: schema.TypeString, + Required: true, + Description: "PI cloud instance ID", + ForceNew: true, + }, + helpers.PIImageName: { + Type: schema.TypeString, + Required: true, + Description: "Image name", + DiffSuppressFunc: flex.ApplyOnce, + ForceNew: true, + }, + helpers.PIImageId: { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{helpers.PIImageId, helpers.PIImageBucketName}, + Description: "Instance image id", + DiffSuppressFunc: flex.ApplyOnce, + ConflictsWith: []string{helpers.PIImageBucketName}, + ForceNew: true, + }, + + // COS import variables + helpers.PIImageBucketName: { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{helpers.PIImageId, helpers.PIImageBucketName}, + Description: "Cloud Object Storage bucket name; bucket-name[/optional/folder]", + ConflictsWith: []string{helpers.PIImageId}, + RequiredWith: []string{helpers.PIImageBucketRegion, helpers.PIImageBucketFileName}, + ForceNew: true, + }, + helpers.PIImageBucketAccess: { + Type: schema.TypeString, + Optional: true, + Description: "Indicates if the bucket has public or private access", + Default: "public", + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), + ConflictsWith: []string{helpers.PIImageId}, + ForceNew: true, + }, + helpers.PIImageAccessKey: { + Type: schema.TypeString, + Optional: true, + Description: "Cloud Object Storage access key; required for buckets with private access", + ForceNew: true, + Sensitive: true, + RequiredWith: []string{helpers.PIImageSecretKey}, + }, + helpers.PIImageSecretKey: { + Type: schema.TypeString, + Optional: true, + Description: "Cloud Object Storage secret key; required for buckets with private access", + ForceNew: true, + Sensitive: true, + RequiredWith: []string{helpers.PIImageAccessKey}, + }, + helpers.PIImageBucketRegion: { + Type: schema.TypeString, + Optional: true, + Description: "Cloud Object Storage region", + ConflictsWith: []string{helpers.PIImageId}, + RequiredWith: []string{helpers.PIImageBucketName}, + ForceNew: true, + }, + helpers.PIImageBucketFileName: { + Type: schema.TypeString, + Optional: true, + Description: "Cloud Object Storage image filename", + ConflictsWith: []string{helpers.PIImageId}, + RequiredWith: []string{helpers.PIImageBucketName}, + ForceNew: true, + }, + helpers.PIImageStorageType: { + Type: schema.TypeString, + Optional: true, + Description: "Type of storage", + ForceNew: true, + }, + helpers.PIImageStoragePool: { + Type: schema.TypeString, + Optional: true, + Description: "Storage pool where the image will be loaded, if provided then pi_image_storage_type and pi_affinity_policy will be ignored", + ForceNew: true, + }, + PIAffinityPolicy: { + Type: schema.TypeString, + Optional: true, + Description: "Affinity policy for image; ignored if pi_image_storage_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", + ValidateFunc: validate.ValidateAllowedStringValues([]string{"affinity", "anti-affinity"}), + ForceNew: true, + }, + PIAffinityVolume: { + Type: schema.TypeString, + Optional: true, + Description: "Volume (ID or Name) to base storage affinity policy against; required if requesting affinity and pi_affinity_instance is not provided", + ConflictsWith: []string{PIAffinityInstance}, + ForceNew: true, + }, + PIAffinityInstance: { + Type: schema.TypeString, + Optional: true, + Description: "PVM Instance (ID or Name) to base storage affinity policy against; required if requesting storage affinity and pi_affinity_volume is not provided", + ConflictsWith: []string{PIAffinityVolume}, + ForceNew: true, + }, + PIAntiAffinityVolumes: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of volumes to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_instances is not provided", + ConflictsWith: []string{PIAntiAffinityInstances}, + ForceNew: true, + }, + PIAntiAffinityInstances: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "List of pvmInstances to base storage anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", + ConflictsWith: []string{PIAntiAffinityVolumes}, + ForceNew: true, + }, + + // Computed Attribute + "image_id": { + Type: schema.TypeString, + Computed: true, + Description: "Image ID", + }, + }, + } +} + +func resourceIBMPIImageCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + log.Printf("Failed to get the session") + return diag.FromErr(err) + } + + cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + imageName := d.Get(helpers.PIImageName).(string) + + client := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) + // image copy + if v, ok := d.GetOk(helpers.PIImageId); ok { + imageid := v.(string) + source := "root-project" + var body = &models.CreateImage{ + ImageName: imageName, + ImageID: imageid, + Source: &source, + } + imageResponse, err := client.Create(body) + if err != nil { + return diag.FromErr(err) + } + + IBMPIImageID := imageResponse.ImageID + d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *IBMPIImageID)) + + _, err = isWaitForIBMPIImageAvailable(ctx, client, *IBMPIImageID, d.Timeout(schema.TimeoutCreate)) + if err != nil { + log.Printf("[DEBUG] err %s", err) + return diag.FromErr(err) + } + } + + // COS image import + if v, ok := d.GetOk(helpers.PIImageBucketName); ok { + bucketName := v.(string) + bucketImageFileName := d.Get(helpers.PIImageBucketFileName).(string) + bucketRegion := d.Get(helpers.PIImageBucketRegion).(string) + bucketAccess := d.Get(helpers.PIImageBucketAccess).(string) + + body := &models.CreateCosImageImportJob{ + ImageName: &imageName, + BucketName: &bucketName, + BucketAccess: &bucketAccess, + ImageFilename: &bucketImageFileName, + Region: &bucketRegion, + } + + if v, ok := d.GetOk(helpers.PIImageAccessKey); ok { + body.AccessKey = v.(string) + } + if v, ok := d.GetOk(helpers.PIImageSecretKey); ok { + body.SecretKey = v.(string) + } + + if v, ok := d.GetOk(helpers.PIImageStorageType); ok { + body.StorageType = v.(string) + } + if v, ok := d.GetOk(helpers.PIImageStoragePool); ok { + body.StoragePool = v.(string) + } + if ap, ok := d.GetOk(PIAffinityPolicy); ok { + policy := ap.(string) + affinity := &models.StorageAffinity{ + AffinityPolicy: &policy, + } + + if policy == "affinity" { + if av, ok := d.GetOk(PIAffinityVolume); ok { + afvol := av.(string) + affinity.AffinityVolume = &afvol + } + if ai, ok := d.GetOk(PIAffinityInstance); ok { + afins := ai.(string) + affinity.AffinityPVMInstance = &afins + } + } else { + if avs, ok := d.GetOk(PIAntiAffinityVolumes); ok { + afvols := flex.ExpandStringList(avs.([]interface{})) + affinity.AntiAffinityVolumes = afvols + } + if ais, ok := d.GetOk(PIAntiAffinityInstances); ok { + afinss := flex.ExpandStringList(ais.([]interface{})) + affinity.AntiAffinityPVMInstances = afinss + } + } + body.StorageAffinity = affinity + } + imageResponse, err := client.CreateCosImage(body) + if err != nil { + return diag.FromErr(err) + } + + jobClient := st.NewIBMPIJobClient(ctx, sess, cloudInstanceID) + _, err = waitForIBMPIJobCompleted(ctx, jobClient, *imageResponse.ID, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return diag.FromErr(err) + } + + // Once the job is completed find by name + image, err := client.Get(imageName) + if err != nil { + return diag.FromErr(err) + } + d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, *image.ImageID)) + } + + return resourceIBMPIImageRead(ctx, d, meta) +} + +func resourceIBMPIImageRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID, imageID, err := splitID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + imageC := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) + imagedata, err := imageC.Get(imageID) + if err != nil { + uErr := errors.Unwrap(err) + switch uErr.(type) { + case *p_cloud_images.PcloudCloudinstancesImagesGetNotFound: + log.Printf("[DEBUG] image does not exist %v", err) + d.SetId("") + return nil + } + log.Printf("[DEBUG] get image failed %v", err) + return diag.FromErr(err) + } + + imageid := *imagedata.ImageID + d.Set("image_id", imageid) + d.Set(helpers.PICloudInstanceId, cloudInstanceID) + + return nil +} + +func resourceIBMPIImageDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID, imageID, err := splitID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + imageC := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) + err = imageC.Delete(imageID) + if err != nil { + return diag.FromErr(err) + } + + d.SetId("") + return nil +} + +func isWaitForIBMPIImageAvailable(ctx context.Context, client *st.IBMPIImageClient, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for Power Image (%s) to be available.", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"retry", helpers.PIImageQueStatus}, + Target: []string{helpers.PIImageActiveStatus}, + Refresh: isIBMPIImageRefreshFunc(ctx, client, id), + Timeout: timeout, + Delay: 20 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForStateContext(ctx) +} + +func isIBMPIImageRefreshFunc(ctx context.Context, client *st.IBMPIImageClient, id string) resource.StateRefreshFunc { + + log.Printf("Calling the isIBMPIImageRefreshFunc Refresh Function....") + return func() (interface{}, string, error) { + image, err := client.Get(id) + if err != nil { + return nil, "", err + } + + if image.State == "active" { + return image, helpers.PIImageActiveStatus, nil + } + + return image, helpers.PIImageQueStatus, nil + } +} + +func waitForIBMPIJobCompleted(ctx context.Context, client *st.IBMPIJobClient, jobID string, timeout time.Duration) (interface{}, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{helpers.JobStatusQueued, helpers.JobStatusReadyForProcessing, helpers.JobStatusInProgress, helpers.JobStatusRunning, helpers.JobStatusWaiting}, + Target: []string{helpers.JobStatusCompleted, helpers.JobStatusFailed}, + Refresh: func() (interface{}, string, error) { + job, err := client.Get(jobID) + if err != nil { + log.Printf("[DEBUG] get job failed %v", err) + return nil, "", fmt.Errorf(errors.GetJobOperationFailed, jobID, err) + } + if job == nil || job.Status == nil { + log.Printf("[DEBUG] get job failed with empty response") + return nil, "", fmt.Errorf("failed to get job status for job id %s", jobID) + } + if *job.Status.State == helpers.JobStatusFailed { + log.Printf("[DEBUG] job status failed with message: %v", job.Status.Message) + return nil, helpers.JobStatusFailed, fmt.Errorf("job status failed for job id %s with message: %v", jobID, job.Status.Message) + } + return job, *job.Status.State, nil + }, + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForStateContext(ctx) +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_image_export.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_image_export.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_image_export.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_image_export.go index b46a57ea6b..ed3df33d6a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_image_export.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_image_export.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -15,9 +15,11 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMPIImageExport() *schema.Resource { +func ResourceIBMPIImageExport() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIImageExportCreate, ReadContext: resourceIBMPIImageExportRead, @@ -40,7 +42,7 @@ func resourceIBMPIImageExport() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Instance image id", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, ForceNew: true, }, helpers.PIImageBucketName: { @@ -75,7 +77,7 @@ func resourceIBMPIImageExport() *schema.Resource { } func resourceIBMPIImageExportCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { log.Printf("Failed to get the session") return diag.FromErr(err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_instance.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_instance.go index 0a0afe5f3e..bf87ca1eaf 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -18,6 +18,9 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -32,7 +35,7 @@ const ( PIInstanceStoragePoolAffinity = "pi_storage_pool_affinity" ) -func resourceIBMPIInstance() *schema.Resource { +func ResourceIBMPIInstance() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIInstanceCreate, ReadContext: resourceIBMPIInstanceRead, @@ -95,7 +98,7 @@ func resourceIBMPIInstance() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "List of PI volumes", }, @@ -121,7 +124,7 @@ func resourceIBMPIInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "Affinity policy for pvm instance being created; ignored if pi_storage_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", - ValidateFunc: validateAllowedStringValue([]string{"affinity", "anti-affinity"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"affinity", "anti-affinity"}), }, PIAffinityVolume: { Type: schema.TypeString, @@ -152,7 +155,7 @@ func resourceIBMPIInstance() *schema.Resource { helpers.PIInstanceStorageConnection: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"vSCSI"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"vSCSI"}), Description: "Storage Connectivity Group for server deployment", }, PIInstanceStoragePoolAffinity: { @@ -164,7 +167,7 @@ func resourceIBMPIInstance() *schema.Resource { PIInstanceNetwork: { Type: schema.TypeList, Required: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "List of one or more networks to attach to the instance", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -217,9 +220,10 @@ func resourceIBMPIInstance() *schema.Resource { Description: "PIN Policy of the Instance", }, helpers.PIInstanceImageId: { - Type: schema.TypeString, - Required: true, - Description: "PI instance image id", + Type: schema.TypeString, + Required: true, + Description: "PI instance image id", + DiffSuppressFunc: flex.ApplyOnce, }, helpers.PIInstanceProcessors: { Type: schema.TypeFloat, @@ -237,7 +241,7 @@ func resourceIBMPIInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"dedicated", "shared", "capped"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"dedicated", "shared", "capped"}), ConflictsWith: []string{PISAPInstanceProfileID}, Description: "Instance processor type", }, @@ -256,16 +260,14 @@ func resourceIBMPIInstance() *schema.Resource { PISAPInstanceProfileID: { Type: schema.TypeString, Optional: true, - ConflictsWith: []string{helpers.PIInstanceProcessors, helpers.PIInstanceMemory, helpers.PIInstanceProcType, helpers.PIInstanceSystemType}, + ConflictsWith: []string{helpers.PIInstanceProcessors, helpers.PIInstanceMemory, helpers.PIInstanceProcType}, Description: "SAP Profile ID for the amount of cores and memory", }, helpers.PIInstanceSystemType: { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"s922", "e880", "e980"}), - ConflictsWith: []string{PISAPInstanceProfileID}, - Description: "PI Instance system type", + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "PI Instance system type", }, helpers.PIInstanceReplicants: { Type: schema.TypeInt, @@ -276,14 +278,14 @@ func resourceIBMPIInstance() *schema.Resource { helpers.PIInstanceReplicationPolicy: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"affinity", "anti-affinity", "none"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"affinity", "anti-affinity", "none"}), Default: "none", Description: "Replication policy for the PI Instance", }, helpers.PIInstanceReplicationScheme: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"prefix", "suffix"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"prefix", "suffix"}), Default: "suffix", Description: "Replication scheme", }, @@ -297,7 +299,7 @@ func resourceIBMPIInstance() *schema.Resource { Optional: true, Description: "Pin Policy of the instance", Default: "none", - ValidateFunc: validateAllowedStringValue([]string{"none", "soft", "hard"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"none", "soft", "hard"}), }, // "reboot_for_resource_change": { @@ -318,7 +320,7 @@ func resourceIBMPIInstance() *schema.Resource { helpers.PIInstanceHealthStatus: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{helpers.PIInstanceHealthOk, helpers.PIInstanceHealthWarning}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{helpers.PIInstanceHealthOk, helpers.PIInstanceHealthWarning}), Default: "OK", Description: "Allow the user to set the status of the lpar so that they can connect to it faster", }, @@ -344,7 +346,7 @@ func resourceIBMPIInstance() *schema.Resource { func resourceIBMPIInstanceCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Now in the PowerVMCreate") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -399,7 +401,7 @@ func resourceIBMPIInstanceCreate(ctx context.Context, d *schema.ResourceData, me } func resourceIBMPIInstanceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -495,7 +497,7 @@ func resourceIBMPIInstanceUpdate(ctx context.Context, d *schema.ResourceData, me return diag.Errorf("the operation cannot be performed when the lpar health in the WARNING State") } - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.Errorf("failed to get the session from the IBM Cloud Service") } @@ -736,7 +738,7 @@ func resourceIBMPIInstanceUpdate(ctx context.Context, d *schema.ResourceData, me } func resourceIBMPIInstanceDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -867,8 +869,8 @@ func isPIInstanceRefreshFuncOff(client *st.IBMPIInstanceClient, id string) resou func stopLparForResourceChange(ctx context.Context, client *st.IBMPIInstanceClient, id string) error { body := &models.PVMInstanceAction{ - //Action: ptrToString("stop"), - Action: ptrToString("immediate-shutdown"), + //Action: flex.PtrToString("stop"), + Action: flex.PtrToString("immediate-shutdown"), } err := client.Action(id, body) if err != nil { @@ -884,7 +886,7 @@ func stopLparForResourceChange(ctx context.Context, client *st.IBMPIInstanceClie func startLparAfterResourceChange(ctx context.Context, client *st.IBMPIInstanceClient, id string) error { body := &models.PVMInstanceAction{ - Action: ptrToString("start"), + Action: flex.PtrToString("start"), } err := client.Action(id, body) if err != nil { @@ -978,7 +980,7 @@ func expandPVMNetworks(networks []interface{}) []*models.PVMInstanceAddNetwork { network := v.(map[string]interface{}) pvmInstanceNetwork := &models.PVMInstanceAddNetwork{ IPAddress: network["ip_address"].(string), - NetworkID: ptrToString(network["network_id"].(string)), + NetworkID: flex.PtrToString(network["network_id"].(string)), } pvmNetworks = append(pvmNetworks, pvmInstanceNetwork) } @@ -1030,9 +1032,9 @@ func createSAPInstance(d *schema.ResourceData, sapClient *st.IBMPISAPInstanceCli } if v, ok := d.GetOk(helpers.PIInstanceVolumeIds); ok { - volids := expandStringList((v.(*schema.Set)).List()) + volids := flex.ExpandStringList((v.(*schema.Set)).List()) if len(volids) > 0 { - body.VolumeIds = volids + body.VolumeIDs = volids } } if p, ok := d.GetOk(helpers.PIInstancePinPolicy); ok { @@ -1055,6 +1057,9 @@ func createSAPInstance(d *schema.ResourceData, sapClient *st.IBMPISAPInstanceCli } body.UserData = userData } + if sys, ok := d.GetOk(helpers.PIInstanceSystemType); ok { + body.SysType = sys.(string) + } if st, ok := d.GetOk(helpers.PIInstanceStorageType); ok { body.StorageType = st.(string) @@ -1080,17 +1085,21 @@ func createSAPInstance(d *schema.ResourceData, sapClient *st.IBMPISAPInstanceCli } } else { if avs, ok := d.GetOk(PIAntiAffinityVolumes); ok { - afvols := expandStringList(avs.([]interface{})) + afvols := flex.ExpandStringList(avs.([]interface{})) affinity.AntiAffinityVolumes = afvols } if ais, ok := d.GetOk(PIAntiAffinityInstances); ok { - afinss := expandStringList(ais.([]interface{})) + afinss := flex.ExpandStringList(ais.([]interface{})) affinity.AntiAffinityPVMInstances = afinss } } body.StorageAffinity = affinity } + if pg, ok := d.GetOk(helpers.PIPlacementGroupID); ok { + body.PlacementGroup = pg.(string) + } + pvmList, err := sapClient.Create(body) if err != nil { return nil, fmt.Errorf("failed to provision: %v", err) @@ -1133,7 +1142,7 @@ func createPVMInstance(d *schema.ResourceData, client *st.IBMPIInstanceClient, i var volids []string if v, ok := d.GetOk(helpers.PIInstanceVolumeIds); ok { - volids = expandStringList((v.(*schema.Set)).List()) + volids = flex.ExpandStringList((v.(*schema.Set)).List()) } var replicants float64 if r, ok := d.GetOk(helpers.PIInstanceReplicants); ok { @@ -1175,14 +1184,14 @@ func createPVMInstance(d *schema.ResourceData, client *st.IBMPIInstanceClient, i //NetworkIds: networks, Processors: &procs, Memory: &mem, - ServerName: ptrToString(name), + ServerName: flex.PtrToString(name), SysType: systype, - ImageID: ptrToString(imageid), - ProcType: ptrToString(processortype), + ImageID: flex.PtrToString(imageid), + ProcType: flex.PtrToString(processortype), Replicants: replicants, UserData: userData, - ReplicantNamingScheme: ptrToString(replicationNamingScheme), - ReplicantAffinityPolicy: ptrToString(replicationpolicy), + ReplicantNamingScheme: flex.PtrToString(replicationNamingScheme), + ReplicantAffinityPolicy: flex.PtrToString(replicationpolicy), Networks: pvmNetworks, Migratable: &migratable, } @@ -1191,7 +1200,7 @@ func createPVMInstance(d *schema.ResourceData, client *st.IBMPIInstanceClient, i body.KeyPairName = sshkey } if len(volids) > 0 { - body.VolumeIds = volids + body.VolumeIDs = volids } if d.Get(helpers.PIInstancePinPolicy) == "soft" || d.Get(helpers.PIInstancePinPolicy) == "hard" { body.PinPolicy = models.PinPolicy(pinpolicy) @@ -1227,11 +1236,11 @@ func createPVMInstance(d *schema.ResourceData, client *st.IBMPIInstanceClient, i } } else { if avs, ok := d.GetOk(PIAntiAffinityVolumes); ok { - afvols := expandStringList(avs.([]interface{})) + afvols := flex.ExpandStringList(avs.([]interface{})) affinity.AntiAffinityVolumes = afvols } if ais, ok := d.GetOk(PIAntiAffinityInstances); ok { - afinss := expandStringList(ais.([]interface{})) + afinss := flex.ExpandStringList(ais.([]interface{})) affinity.AntiAffinityPVMInstances = afinss } } @@ -1278,7 +1287,7 @@ func createPVMInstance(d *schema.ResourceData, client *st.IBMPIInstanceClient, i } func splitID(id string) (id1, id2 string, err error) { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_instance_console_language.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_instance_console_language.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_instance_console_language.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_instance_console_language.go index 3f69cbe121..a825760d04 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_instance_console_language.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_instance_console_language.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -15,13 +15,14 @@ import ( "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) const ( PIConsoleLanguageCode = "pi_language_code" ) -func resourceIBMPIInstanceConsoleLanguage() *schema.Resource { +func ResourceIBMPIInstanceConsoleLanguage() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIInstanceConsoleLanguageCreate, ReadContext: resourceIBMPIInstanceConsoleLanguageRead, @@ -55,7 +56,7 @@ func resourceIBMPIInstanceConsoleLanguage() *schema.Resource { } func resourceIBMPIInstanceConsoleLanguageCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -87,7 +88,7 @@ func resourceIBMPIInstanceConsoleLanguageRead(ctx context.Context, d *schema.Res } func resourceIBMPIInstanceConsoleLanguageUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_ipsec_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_ipsec_policy.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_ipsec_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_ipsec_policy.go index 9907a54221..c18aac4639 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_ipsec_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_ipsec_policy.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -15,9 +15,11 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func resourceIBMPIIPSecPolicy() *schema.Resource { +func ResourceIBMPIIPSecPolicy() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIIPSecPolicyCreate, ReadContext: resourceIBMPIIPSecPolicyRead, @@ -46,19 +48,19 @@ func resourceIBMPIIPSecPolicy() *schema.Resource { helpers.PIVPNPolicyDhGroup: { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedIntValue([]int{1, 2, 5, 14, 19, 20, 24}), + ValidateFunc: validate.ValidateAllowedIntValues([]int{1, 2, 5, 14, 19, 20, 24}), Description: "DH group of the IPSec Policy", }, helpers.PIVPNPolicyEncryption: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"3des-cbc", "aes-128-cbc", "aes-128-gcm", "aes-192-cbc", "aes-256-cbc", "aes-256-gcm", "des-cbc"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"aes-256-cbc", "aes-192-cbc", "aes-128-cbc", "aes-256-gcm", "aes-128-gcm", "3des-cbc"}), Description: "Encryption of the IPSec Policy", }, helpers.PIVPNPolicyKeyLifetime: { Type: schema.TypeInt, Required: true, - ValidateFunc: validateAllowedRangeInt(180, 86400), + ValidateFunc: validate.ValidateAllowedRangeInt(180, 86400), Description: "Policy key lifetime", }, helpers.PIVPNPolicyPFS: { @@ -72,7 +74,7 @@ func resourceIBMPIIPSecPolicy() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "none", - ValidateFunc: validateAllowedStringValue([]string{"hmac-md5-96", "hmac-sha-256-128", "hmac-sha1-96", "none"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"hmac-sha-256-128", "hmac-sha1-96", "none"}), Description: "Authentication for the IPSec Policy", }, @@ -87,7 +89,7 @@ func resourceIBMPIIPSecPolicy() *schema.Resource { } func resourceIBMPIIPSecPolicyCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -96,13 +98,14 @@ func resourceIBMPIIPSecPolicyCreate(ctx context.Context, d *schema.ResourceData, name := d.Get(helpers.PIVPNPolicyName).(string) dhGroup := int64(d.Get(helpers.PIVPNPolicyDhGroup).(int)) encryption := d.Get(helpers.PIVPNPolicyEncryption).(string) - keyLifetime := int64(d.Get(helpers.PIVPNPolicyKeyLifetime).(int)) pfs := d.Get(helpers.PIVPNPolicyPFS).(bool) + keyLifetime := int64(d.Get(helpers.PIVPNPolicyKeyLifetime).(int)) + klt := models.KeyLifetime(keyLifetime) body := &models.IPSecPolicyCreate{ DhGroup: &dhGroup, Encryption: &encryption, - KeyLifetime: models.KeyLifetime(keyLifetime), + KeyLifetime: &klt, Name: &name, Pfs: &pfs, } @@ -124,7 +127,7 @@ func resourceIBMPIIPSecPolicyCreate(ctx context.Context, d *schema.ResourceData, } func resourceIBMPIIPSecPolicyUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -171,7 +174,7 @@ func resourceIBMPIIPSecPolicyUpdate(ctx context.Context, d *schema.ResourceData, } func resourceIBMPIIPSecPolicyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -207,7 +210,7 @@ func resourceIBMPIIPSecPolicyRead(ctx context.Context, d *schema.ResourceData, m } func resourceIBMPIIPSecPolicyDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_key.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_key.go index 32cc5c3b7b..d00a5c7b72 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -15,9 +15,10 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) -func resourceIBMPIKey() *schema.Resource { +func ResourceIBMPIKey() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIKeyCreate, ReadContext: resourceIBMPIKeyRead, @@ -65,7 +66,7 @@ func resourceIBMPIKey() *schema.Resource { } func resourceIBMPIKeyCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -93,7 +94,7 @@ func resourceIBMPIKeyCreate(ctx context.Context, d *schema.ResourceData, meta in func resourceIBMPIKeyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -121,7 +122,7 @@ func resourceIBMPIKeyUpdate(ctx context.Context, d *schema.ResourceData, meta in return resourceIBMPIKeyRead(ctx, d, meta) } func resourceIBMPIKeyDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network.go index 212398eef9..f194401393 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -19,9 +19,12 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) -func resourceIBMPINetwork() *schema.Resource { +func ResourceIBMPINetwork() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPINetworkCreate, ReadContext: resourceIBMPINetworkRead, @@ -31,6 +34,7 @@ func resourceIBMPINetwork() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(60 * time.Minute), + Update: schema.DefaultTimeout(60 * time.Minute), Delete: schema.DefaultTimeout(60 * time.Minute), }, @@ -38,7 +42,7 @@ func resourceIBMPINetwork() *schema.Resource { helpers.PINetworkType: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"vlan", "pub-vlan"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"vlan", "pub-vlan"}), Description: "PI network type", }, helpers.PINetworkName: { @@ -91,14 +95,14 @@ func resourceIBMPINetwork() *schema.Resource { } func resourceIBMPINetworkCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) networkname := d.Get(helpers.PINetworkName).(string) networktype := d.Get(helpers.PINetworkType).(string) - networkdns := expandStringList((d.Get(helpers.PINetworkDNS).(*schema.Set)).List()) + networkdns := flex.ExpandStringList((d.Get(helpers.PINetworkDNS).(*schema.Set)).List()) client := st.NewIBMPINetworkClient(ctx, sess, cloudInstanceID) var body = &models.NetworkCreate{ @@ -149,7 +153,7 @@ func resourceIBMPINetworkCreate(ctx context.Context, d *schema.ResourceData, met } func resourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -178,13 +182,40 @@ func resourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, meta } func resourceIBMPINetworkUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return nil + sess, err := meta.(conns.ClientSession).IBMPISession() + if err != nil { + return diag.FromErr(err) + } + + cloudInstanceID, networkID, err := splitID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + if d.HasChanges(helpers.PINetworkName, helpers.PINetworkDNS) { + networkC := st.NewIBMPINetworkClient(ctx, sess, cloudInstanceID) + body := &models.NetworkUpdate{ + DNSServers: flex.ExpandStringList((d.Get(helpers.PINetworkDNS).(*schema.Set)).List()), + } + + if d.HasChange(helpers.PINetworkName) { + name := d.Get(helpers.PINetworkName).(string) + body.Name = &name + } + + _, err = networkC.Update(networkID, body) + if err != nil { + return diag.FromErr(err) + } + } + + return resourceIBMPINetworkRead(ctx, d, meta) } func resourceIBMPINetworkDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Calling the network delete functions. ") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -224,7 +255,7 @@ func isIBMPINetworkRefreshFunc(client *st.IBMPINetworkClient, id string) resourc return nil, "", err } - if &network.VlanID != nil { + if network.VlanID != nil { return network, "NETWORK_READY", nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network_port.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network_port.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network_port.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network_port.go index 68cdb30084..7cfc10ca03 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network_port.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network_port.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -16,9 +16,11 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMPINetworkPort() *schema.Resource { +func ResourceIBMPINetworkPort() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPINetworkPortCreate, ReadContext: resourceIBMPINetworkPortRead, @@ -73,7 +75,7 @@ func resourceIBMPINetworkPort() *schema.Resource { } func resourceIBMPINetworkPortCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -112,12 +114,12 @@ func resourceIBMPINetworkPortCreate(ctx context.Context, d *schema.ResourceData, } func resourceIBMPINetworkPortRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -148,12 +150,12 @@ func resourceIBMPINetworkPortUpdate(ctx context.Context, d *schema.ResourceData, func resourceIBMPINetworkPortDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Calling the network delete functions. ") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network_port_attach.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network_port_attach.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network_port_attach.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network_port_attach.go index 8686f44ce1..939ca43553 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_network_port_attach.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_network_port_attach.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -15,10 +15,12 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMPINetworkPortAttach() *schema.Resource { +func ResourceIBMPINetworkPortAttach() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPINetworkPortAttachCreate, @@ -67,7 +69,7 @@ func resourceIBMPINetworkPortAttach() *schema.Resource { } func resourceIBMPINetworkPortAttachCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -106,13 +108,13 @@ func resourceIBMPINetworkPortAttachCreate(ctx context.Context, d *schema.Resourc func resourceIBMPINetworkPortAttachRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Calling ther Network Port Attach Read code") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { fmt.Printf("failed to get a session from the IBM Cloud Service %v", err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -144,13 +146,13 @@ func resourceIBMPINetworkPortAttachUpdate(ctx context.Context, d *schema.Resourc func resourceIBMPINetworkPortAttachDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Detaching the network port from the Instance ") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { fmt.Printf("failed to get a session from the IBM Cloud Service %v", err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_operations.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_operations.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_operations.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_operations.go index 6365ef3c37..e365c53faa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_operations.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_operations.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -10,6 +10,9 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -32,7 +35,7 @@ SHUTOFF--> ACTIVE */ -func resourceIBMPIIOperations() *schema.Resource { +func ResourceIBMPIIOperations() *schema.Resource { return &schema.Resource{ Create: resourceIBMPIOperationsCreate, Read: resourceIBMPIOperationsRead, @@ -103,7 +106,7 @@ func resourceIBMPIIOperations() *schema.Resource { helpers.PIInstanceOperationType: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"start", "stop", "hard-reboot", "soft-reboot", "immediate-shutdown"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"start", "stop", "hard-reboot", "soft-reboot", "immediate-shutdown"}), Description: "PI instance operation type", }, @@ -119,7 +122,7 @@ func resourceIBMPIIOperations() *schema.Resource { func resourceIBMPIOperationsCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("Now in the Power Operations Code") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return err } @@ -127,7 +130,7 @@ func resourceIBMPIOperationsCreate(d *schema.ResourceData, meta interface{}) err operation := d.Get(helpers.PIInstanceOperationType).(string) name := d.Get(helpers.PIInstanceOperationServerName).(string) - body := &models.PVMInstanceAction{Action: ptrToString(operation)} + body := &models.PVMInstanceAction{Action: flex.PtrToString(operation)} log.Printf("Calling the IBM PI Operations [ %s ] with on the instance with name [ %s ]", operation, name) client := st.NewIBMPIInstanceClient(context.Background(), sess, powerinstanceid) @@ -139,7 +142,7 @@ func resourceIBMPIOperationsCreate(d *schema.ResourceData, meta interface{}) err err = client.Action(name, body) if err != nil { log.Printf("[DEBUG] err %s", err) - return fmt.Errorf("Failed to perform the operation on the instance %v", err) + return fmt.Errorf("[ERROR] Failed to perform the operation on the instance %v", err) } else { log.Printf("Executed the stop operation on the lpar") @@ -174,7 +177,7 @@ func resourceIBMPIOperationsRead(d *schema.ResourceData, meta interface{}) error log.Printf("Calling the PowerOperations Read code..for instance name %s", d.Get(helpers.PIInstanceOperationServerName).(string)) - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return err } @@ -216,7 +219,7 @@ func resourceIBMPIOperationsDelete(data *schema.ResourceData, meta interface{}) func resourceIBMPIOperationsExists(d *schema.ResourceData, meta interface{}) (bool, error) { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_placement_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_placement_group.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_placement_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_placement_group.go index fbf132808c..e8f6b3d68c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_placement_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -14,6 +14,9 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" models "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" ) @@ -22,7 +25,7 @@ const ( PIPlacementGroupMembers = "members" ) -func resourceIBMPIPlacementGroup() *schema.Resource { +func ResourceIBMPIPlacementGroup() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIPlacementGroupCreate, ReadContext: resourceIBMPIPlacementGroupRead, @@ -47,7 +50,7 @@ func resourceIBMPIPlacementGroup() *schema.Resource { helpers.PIPlacementGroupPolicy: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"affinity", "anti-affinity"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"affinity", "anti-affinity"}), Description: "Policy of the placement group", }, @@ -74,7 +77,7 @@ func resourceIBMPIPlacementGroup() *schema.Resource { } func resourceIBMPIPlacementGroupCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -102,11 +105,11 @@ func resourceIBMPIPlacementGroupCreate(ctx context.Context, d *schema.ResourceDa func resourceIBMPIPlacementGroupRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -134,11 +137,11 @@ func resourceIBMPIPlacementGroupUpdate(ctx context.Context, d *schema.ResourceDa } func resourceIBMPIPlacementGroupDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_snapshot.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_snapshot.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_snapshot.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_snapshot.go index 0aca8aba81..2372e889ed 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_snapshot.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_snapshot.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -16,9 +16,11 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" ) -func resourceIBMPISnapshot() *schema.Resource { +func ResourceIBMPISnapshot() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPISnapshotCreate, ReadContext: resourceIBMPISnapshotRead, @@ -48,7 +50,7 @@ func resourceIBMPISnapshot() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "List of PI volumes", }, helpers.PICloudInstanceId: { @@ -101,14 +103,14 @@ func resourceIBMPISnapshot() *schema.Resource { } func resourceIBMPISnapshotCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) instanceid := d.Get(helpers.PIInstanceName).(string) - volids := expandStringList((d.Get(helpers.PIInstanceVolumeIds).(*schema.Set)).List()) + volids := flex.ExpandStringList((d.Get(helpers.PIInstanceVolumeIds).(*schema.Set)).List()) name := d.Get(helpers.PISnapshotName).(string) var description string @@ -124,7 +126,7 @@ func resourceIBMPISnapshotCreate(ctx context.Context, d *schema.ResourceData, me snapshotBody := &models.SnapshotCreate{Name: &name, Description: description} if len(volids) > 0 { - snapshotBody.VolumeIds = volids + snapshotBody.VolumeIDs = volids } else { log.Printf("no volumeids provided. Will snapshot the entire instance") } @@ -148,7 +150,7 @@ func resourceIBMPISnapshotCreate(ctx context.Context, d *schema.ResourceData, me func resourceIBMPISnapshotRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Calling the Snapshot Read function post create") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -178,7 +180,7 @@ func resourceIBMPISnapshotRead(ctx context.Context, d *schema.ResourceData, meta func resourceIBMPISnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { log.Printf("Calling the IBM Power Snapshot update call") - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -210,7 +212,7 @@ func resourceIBMPISnapshotUpdate(ctx context.Context, d *schema.ResourceData, me } func resourceIBMPISnapshotDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_volume.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_volume.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_volume.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_volume.go index b1b8c82140..21d448c0ed 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_volume.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -17,6 +17,9 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -27,7 +30,7 @@ const ( PIAntiAffinityVolumes = "pi_anti_affinity_volumes" ) -func resourceIBMPIVolume() *schema.Resource { +func ResourceIBMPIVolume() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIVolumeCreate, ReadContext: resourceIBMPIVolumeRead, @@ -66,35 +69,35 @@ func resourceIBMPIVolume() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validateAllowedStringValue([]string{"ssd", "standard", "tier1", "tier3"}), - DiffSuppressFunc: applyOnce, + ValidateFunc: validate.ValidateAllowedStringValues([]string{"ssd", "standard", "tier1", "tier3"}), + DiffSuppressFunc: flex.ApplyOnce, Description: "Type of Disk, required if pi_affinity_policy and pi_volume_pool not provided, otherwise ignored", }, helpers.PIVolumePool: { Type: schema.TypeString, Optional: true, Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Volume pool where the volume will be created; if provided then pi_volume_type and pi_affinity_policy values will be ignored", }, PIAffinityPolicy: { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Affinity policy for data volume being created; ignored if pi_volume_pool provided; for policy affinity requires one of pi_affinity_instance or pi_affinity_volume to be specified; for policy anti-affinity requires one of pi_anti_affinity_instances or pi_anti_affinity_volumes to be specified", - ValidateFunc: InvokeValidator("ibm_pi_volume", "pi_affinity"), + ValidateFunc: validate.InvokeValidator("ibm_pi_volume", "pi_affinity"), }, PIAffinityVolume: { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Volume (ID or Name) to base volume affinity policy against; required if requesting affinity and pi_affinity_instance is not provided", ConflictsWith: []string{PIAffinityInstance}, }, PIAffinityInstance: { Type: schema.TypeString, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "PVM Instance (ID or Name) to base volume affinity policy against; required if requesting affinity and pi_affinity_volume is not provided", ConflictsWith: []string{PIAffinityVolume}, }, @@ -102,7 +105,7 @@ func resourceIBMPIVolume() *schema.Resource { Type: schema.TypeList, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "List of volumes to base volume anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_instances is not provided", ConflictsWith: []string{PIAntiAffinityInstances}, }, @@ -110,7 +113,7 @@ func resourceIBMPIVolume() *schema.Resource { Type: schema.TypeList, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", ConflictsWith: []string{PIAntiAffinityVolumes}, }, @@ -140,25 +143,25 @@ func resourceIBMPIVolume() *schema.Resource { }, } } -func resourceIBMPIVolumeValidator() *ResourceValidator { +func ResourceIBMPIVolumeValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "pi_affinity", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "affinity, anti-affinity"}) - ibmPIVolumeResourceValidator := ResourceValidator{ + ibmPIVolumeResourceValidator := validate.ResourceValidator{ ResourceName: "ibm_pi_volume", Schema: validateSchema} return &ibmPIVolumeResourceValidator } func resourceIBMPIVolumeCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -198,11 +201,11 @@ func resourceIBMPIVolumeCreate(ctx context.Context, d *schema.ResourceData, meta } } else { if avs, ok := d.GetOk(PIAntiAffinityVolumes); ok { - afvols := expandStringList(avs.([]interface{})) + afvols := flex.ExpandStringList(avs.([]interface{})) body.AntiAffinityVolumes = afvols } if ais, ok := d.GetOk(PIAntiAffinityInstances); ok { - afinss := expandStringList(ais.([]interface{})) + afinss := flex.ExpandStringList(ais.([]interface{})) body.AntiAffinityPVMInstances = afinss } } @@ -227,7 +230,7 @@ func resourceIBMPIVolumeCreate(ctx context.Context, d *schema.ResourceData, meta } func resourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -264,7 +267,7 @@ func resourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta i } func resourceIBMPIVolumeUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -300,7 +303,7 @@ func resourceIBMPIVolumeUpdate(ctx context.Context, d *schema.ResourceData, meta } func resourceIBMPIVolumeDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_volume_attach.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_volume_attach.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_volume_attach.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_volume_attach.go index 164c4e384c..cc17613006 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_volume_attach.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_volume_attach.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -13,12 +13,14 @@ import ( st "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMPIVolumeAttach() *schema.Resource { +func ResourceIBMPIVolumeAttach() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIVolumeAttachCreate, ReadContext: resourceIBMPIVolumeAttachRead, @@ -63,7 +65,7 @@ func resourceIBMPIVolumeAttach() *schema.Resource { } func resourceIBMPIVolumeAttachCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -108,12 +110,12 @@ func resourceIBMPIVolumeAttachCreate(ctx context.Context, d *schema.ResourceData } func resourceIBMPIVolumeAttachRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - ids, err := idParts(d.Id()) + ids, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -132,11 +134,11 @@ func resourceIBMPIVolumeAttachRead(ctx context.Context, d *schema.ResourceData, func resourceIBMPIVolumeAttachDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - ids, err := idParts(d.Id()) + ids, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } @@ -190,7 +192,7 @@ func isIBMPIVolumeAttachRefreshFunc(client *st.IBMPIVolumeClient, id, cloudInsta return nil, "", err } - if vol.State == "in-use" && StringContains(vol.PvmInstanceIds, pvmInstanceID) { + if vol.State == "in-use" && flex.StringContains(vol.PvmInstanceIDs, pvmInstanceID) { return vol, helpers.PIVolumeAllowableAttachStatus, nil } @@ -229,7 +231,7 @@ func isIBMPIVolumeDetachRefreshFunc(client *st.IBMPIVolumeClient, id, cloudInsta // Check if Instance ID is in the Volume's Instance list // Also validate the Volume state is 'available' when it is not Sharable // In case of Sharable Volume it can be `in-use` state - if !StringContains(vol.PvmInstanceIds, pvmInstanceID) && + if !flex.StringContains(vol.PvmInstanceIDs, pvmInstanceID) && (*vol.Shareable || (!*vol.Shareable && vol.State == "available")) { return vol, helpers.PIVolumeProvisioningDone, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_vpn_connection.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_vpn_connection.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_vpn_connection.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_vpn_connection.go index 37c698c8cf..97130684b0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_pi_vpn_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/resource_ibm_pi_vpn_connection.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package power import ( "context" @@ -18,6 +18,9 @@ import ( "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections" "github.com/IBM-Cloud/power-go-client/power/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -31,7 +34,7 @@ const ( PIVPNConnectionVpnGatewayAddress = "gateway_address" ) -func resourceIBMPIVPNConnection() *schema.Resource { +func ResourceIBMPIVPNConnection() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMPIVPNConnectionCreate, ReadContext: resourceIBMPIVPNConnectionRead, @@ -70,9 +73,9 @@ func resourceIBMPIVPNConnection() *schema.Resource { helpers.PIVPNConnectionMode: { Type: schema.TypeString, Required: true, - ValidateFunc: validateAllowedStringValue([]string{"policy", "route"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"policy", "route"}), Description: "Mode used by this VPN Connection, either 'policy' or 'route'", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, helpers.PIVPNConnectionNetworks: { Type: schema.TypeSet, @@ -123,7 +126,7 @@ func resourceIBMPIVPNConnection() *schema.Resource { } func resourceIBMPIVPNConnectionCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -134,25 +137,26 @@ func resourceIBMPIVPNConnectionCreate(ctx context.Context, d *schema.ResourceDat ipsecPolicyId := d.Get(helpers.PIVPNIPSecPolicyId).(string) mode := d.Get(helpers.PIVPNConnectionMode).(string) networks := d.Get(helpers.PIVPNConnectionNetworks).(*schema.Set) - peerGatewayAddress := d.Get(helpers.PIVPNConnectionPeerGatewayAddress).(string) peerSubnets := d.Get(helpers.PIVPNConnectionPeerSubnets).(*schema.Set) + peerGatewayAddress := d.Get(helpers.PIVPNConnectionPeerGatewayAddress).(string) + pga := models.PeerGatewayAddress(peerGatewayAddress) body := &models.VPNConnectionCreate{ IkePolicy: &ikePolicyId, IPSecPolicy: &ipsecPolicyId, Mode: &mode, Name: &name, - PeerGatewayAddress: models.PeerGatewayAddress(peerGatewayAddress), + PeerGatewayAddress: &pga, } // networks if networks.Len() > 0 { - body.Networks = expandStringList(networks.List()) + body.Networks = flex.ExpandStringList(networks.List()) } else { return diag.Errorf("%s is a required field", helpers.PIVPNConnectionNetworks) } // peer subnets if peerSubnets.Len() > 0 { - body.PeerSubnets = expandStringList(peerSubnets.List()) + body.PeerSubnets = flex.ExpandStringList(peerSubnets.List()) } else { return diag.Errorf("%s is a required field", helpers.PIVPNConnectionPeerSubnets) } @@ -181,7 +185,7 @@ func resourceIBMPIVPNConnectionCreate(ctx context.Context, d *schema.ResourceDat } func resourceIBMPIVPNConnectionUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -227,7 +231,7 @@ func resourceIBMPIVPNConnectionUpdate(ctx context.Context, d *schema.ResourceDat toAdd := new.Difference(old) toRemove := old.Difference(new) - for _, n := range expandStringList(toAdd.List()) { + for _, n := range flex.ExpandStringList(toAdd.List()) { jobReference, err := client.AddNetwork(vpnConnectionID, n) if err != nil { return diag.FromErr(err) @@ -239,7 +243,7 @@ func resourceIBMPIVPNConnectionUpdate(ctx context.Context, d *schema.ResourceDat } } } - for _, n := range expandStringList(toRemove.List()) { + for _, n := range flex.ExpandStringList(toRemove.List()) { jobReference, err := client.DeleteNetwork(vpnConnectionID, n) if err != nil { return diag.FromErr(err) @@ -261,13 +265,13 @@ func resourceIBMPIVPNConnectionUpdate(ctx context.Context, d *schema.ResourceDat toAdd := new.Difference(old) toRemove := old.Difference(new) - for _, s := range expandStringList(toAdd.List()) { + for _, s := range flex.ExpandStringList(toAdd.List()) { _, err := client.AddSubnet(vpnConnectionID, s) if err != nil { return diag.FromErr(err) } } - for _, s := range expandStringList(toRemove.List()) { + for _, s := range flex.ExpandStringList(toRemove.List()) { _, err := client.DeleteSubnet(vpnConnectionID, s) if err != nil { return diag.FromErr(err) @@ -278,7 +282,7 @@ func resourceIBMPIVPNConnectionUpdate(ctx context.Context, d *schema.ResourceDat } func resourceIBMPIVPNConnectionRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } @@ -316,7 +320,7 @@ func resourceIBMPIVPNConnectionRead(ctx context.Context, d *schema.ResourceData, d.Set(PIVPNConnectionStatus, vpnConnection.Status) d.Set(PIVPNConnectionVpnGatewayAddress, vpnConnection.VpnGatewayAddress) - d.Set(helpers.PIVPNConnectionNetworks, vpnConnection.NetworkIds) + d.Set(helpers.PIVPNConnectionNetworks, vpnConnection.NetworkIDs) d.Set(helpers.PIVPNConnectionPeerSubnets, vpnConnection.PeerSubnets) if vpnConnection.DeadPeerDetection != nil { @@ -333,7 +337,7 @@ func resourceIBMPIVPNConnectionRead(ctx context.Context, d *schema.ResourceData, } func resourceIBMPIVPNConnectionDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).IBMPISession() + sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/README.md new file mode 100644 index 0000000000..2b42dcc152 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Push Notification + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Push Notification resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pn_application_chrome) +* IBM API Docs: [IBM API Docs for Push Notification](https://cloud.ibm.com/apidocs/push-notifications) +* IBM Push Notification SDK: [IBM SDK for Push Notification](https://github.com/IBM/push-notifications-go-sdk/tree/main/pushservicev1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/data_source_ibm_push_notification_chrome.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/data_source_ibm_push_notification_chrome.go new file mode 100644 index 0000000000..f036a6fe96 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/data_source_ibm_push_notification_chrome.go @@ -0,0 +1,65 @@ +package pushnotification + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/push-notifications-go-sdk/pushservicev1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMPNApplicationChrome() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceApplicationChromeRead, + + Schema: map[string]*schema.Schema{ + "guid": { + Type: schema.TypeString, + Required: true, + Description: "Unique guid of the application using the push service.", + }, + "server_key": { + Type: schema.TypeString, + Computed: true, + Description: "A server key that gives the push service an authorized access to Google services that is used for Chrome Web Push.", + }, + "web_site_url": { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", + }, + }, + DeprecationMessage: "This service is deprecated. For more information about the deprecation of this service, see here https://www.ibm.com/cloud/blog/announcements/ibm-push-notifications-deprecation", + } +} + +func dataSourceApplicationChromeRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + pushServiceClient, err := meta.(conns.ClientSession).PushServiceV1() + if err != nil { + return diag.FromErr(err) + } + + getChromeWebConfOptions := &pushservicev1.GetChromeWebConfOptions{} + + guid := d.Get("guid").(string) + getChromeWebConfOptions.SetApplicationID(guid) + + chromeWebConf, response, err := pushServiceClient.GetChromeWebConfWithContext(context, getChromeWebConfOptions) + if err != nil { + log.Printf("[DEBUG] GetChromeWebConfWithContext failed %s\n%d", err, response.StatusCode) + return diag.FromErr(err) + } + + d.SetId(guid) + if err = d.Set("server_key", chromeWebConf.ApiKey); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_key: %s", err)) + } + if err = d.Set("web_site_url", chromeWebConf.WebSiteURL); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting web_site_url: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/resource_ibm_push_notification_chrome.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/resource_ibm_push_notification_chrome.go new file mode 100644 index 0000000000..b705a90ca7 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification/resource_ibm_push_notification_chrome.go @@ -0,0 +1,126 @@ +package pushnotification + +import ( + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/push-notifications-go-sdk/pushservicev1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMPNApplicationChrome() *schema.Resource { + return &schema.Resource{ + Read: resourceApplicationChromeRead, + Create: resourceApplicationChromeCreate, + Update: resourceApplicationChromeUpdate, + Delete: resourceApplicationChromeDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "guid": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Unique guid of the push notification instance.", + }, + "server_key": { + Type: schema.TypeString, + Required: true, + Description: "A server key that gives the push service an authorized access to Google services that is used for Chrome Web Push.", + }, + "web_site_url": { + Type: schema.TypeString, + Required: true, + Description: "The URL of the WebSite / WebApp that should be permitted to subscribe to WebPush.", + }, + }, + DeprecationMessage: "This service is deprecated. For more information about the deprecation of this service, see here https://www.ibm.com/cloud/blog/announcements/ibm-push-notifications-deprecation", + } +} + +func resourceApplicationChromeCreate(d *schema.ResourceData, meta interface{}) error { + pnClient, err := meta.(conns.ClientSession).PushServiceV1() + if err != nil { + return err + } + + serverKey := d.Get("server_key").(string) + websiteURL := d.Get("web_site_url").(string) + guid := d.Get("guid").(string) + + _, response, err := pnClient.SaveChromeWebConf(&pushservicev1.SaveChromeWebConfOptions{ + ApplicationID: &guid, + ApiKey: &serverKey, + WebSiteURL: &websiteURL, + }) + + if err != nil { + d.SetId("") + return fmt.Errorf("[ERROR] Error configuring chrome web platform: %s with response code %d", err, response.StatusCode) + } + d.SetId(guid) + + return resourceApplicationChromeRead(d, meta) +} + +func resourceApplicationChromeUpdate(d *schema.ResourceData, meta interface{}) error { + + if d.HasChanges("server_key", "web_site_url") { + return resourceApplicationChromeCreate(d, meta) + } + return nil +} + +func resourceApplicationChromeRead(d *schema.ResourceData, meta interface{}) error { + pnClient, err := meta.(conns.ClientSession).PushServiceV1() + if err != nil { + return err + } + + guid := d.Id() + + chromeWebConf, response, err := pnClient.GetChromeWebConf(&pushservicev1.GetChromeWebConfOptions{ + ApplicationID: &guid, + }) + + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error fetching chrome web platform configuration: %s with response code %d", err, response.StatusCode) + } + + d.SetId(guid) + + if response.StatusCode == 200 { + d.Set("server_key", *chromeWebConf.ApiKey) + d.Set("web_site_url", *chromeWebConf.WebSiteURL) + } + return nil +} + +func resourceApplicationChromeDelete(d *schema.ResourceData, meta interface{}) error { + pnClient, err := meta.(conns.ClientSession).PushServiceV1() + if err != nil { + return err + } + guid := d.Get("guid").(string) + + response, err := pnClient.DeleteChromeWebConf(&pushservicev1.DeleteChromeWebConfOptions{ + ApplicationID: &guid, + }) + + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error deleting chrome web platform configuration: %s with response code %d", err, response.StatusCode) + } + + d.SetId("") + + return nil + +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/README.md new file mode 100644 index 0000000000..3249b29c67 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Container Registry + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Container Registry resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cr_namespace) +* IBM API Docs: [IBM API Docs for Container Registry](https://cloud.ibm.com/apidocs/container-registry) +* IBM Container Registry SDK: [IBM SDK for Container Registry](https://github.com/IBM/container-registry-go-sdk/tree/main/containerregistryv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cr_namespaces.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/data_source_ibm_cr_namespaces.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cr_namespaces.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/data_source_ibm_cr_namespaces.go index 7f42c5c277..0fca54d7cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_cr_namespaces.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/data_source_ibm_cr_namespaces.go @@ -1,20 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package registry import ( "context" "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/container-registry-go-sdk/containerregistryv1" ) -func dataIBMContainerRegistryNamespaces() *schema.Resource { +func DataIBMContainerRegistryNamespaces() *schema.Resource { return &schema.Resource{ ReadContext: dataIBMContainerRegistryNamespacesRead, @@ -81,7 +82,7 @@ func dataIBMContainerRegistryNamespaces() *schema.Resource { } func dataIBMContainerRegistryNamespacesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } @@ -109,7 +110,7 @@ func dataIBMContainerRegistryNamespacesRead(context context.Context, d *schema.R namespaces = append(namespaces, namespace) } if err = d.Set("namespaces", namespaces); err != nil { - return diag.FromErr(fmt.Errorf("Error setting namespaces: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting namespaces: %s", err)) } d.SetId(time.Now().UTC().String()) return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cr_namespace.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/resource_ibm_cr_namespace.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cr_namespace.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/resource_ibm_cr_namespace.go index f939b0cb44..8761da987e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cr_namespace.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/resource_ibm_cr_namespace.go @@ -1,20 +1,23 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package registry import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/container-registry-go-sdk/containerregistryv1" ) -func resourceIBMCrNamespace() *schema.Resource { +func ResourceIBMCrNamespace() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMCrNamespaceCreate, ReadContext: resourceIBMCrNamespaceRead, @@ -23,60 +26,60 @@ func resourceIBMCrNamespace() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_cr_namespace", "name"), + ValidateFunc: validate.InvokeValidator("ibm_cr_namespace", "name"), Description: "The name of the namespace.", }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Optional: true, Computed: true, ForceNew: true, Description: "The ID of the resource group that the namespace will be created within.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, Optional: true, Description: "List of tags", }, - "account": &schema.Schema{ + "account": { Type: schema.TypeString, Computed: true, Description: "The IBM Cloud account that owns the namespace.", }, - "created_date": &schema.Schema{ + "created_date": { Type: schema.TypeString, Computed: true, Description: "When the namespace was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "If the namespace has been assigned to a resource group, this is the IBM Cloud CRN representing the namespace.", }, - "resource_created_date": &schema.Schema{ + "resource_created_date": { Type: schema.TypeString, Computed: true, Description: "When the namespace was assigned to a resource group.", }, - "updated_date": &schema.Schema{ + "updated_date": { Type: schema.TypeString, Computed: true, Description: "When the namespace was last updated.", }, // HAND-ADDED DEPRECATED FIELDS, TO BE DELETED IN FUTURE - "created_on": &schema.Schema{ + "created_on": { Type: schema.TypeString, Computed: true, Description: "When the namespace was created.", Deprecated: "This field is deprecated", }, - "updated_on": &schema.Schema{ + "updated_on": { Type: schema.TypeString, Computed: true, Description: "When the namespace was last updated.", @@ -86,13 +89,13 @@ func resourceIBMCrNamespace() *schema.Resource { } } -func resourceIBMCrNamespaceValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMCrNamespaceValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$`, MinValueLength: 4, @@ -100,12 +103,12 @@ func resourceIBMCrNamespaceValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_cr_namespace", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_cr_namespace", Schema: validateSchema} return &resourceValidator } func resourceIBMCrNamespaceCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } @@ -116,7 +119,7 @@ func resourceIBMCrNamespaceCreate(context context.Context, d *schema.ResourceDat if _, ok := d.GetOk("resource_group_id"); ok { createNamespaceOptions.SetXAuthResourceGroup(d.Get("resource_group_id").(string)) } else { - defaultRg, err := defaultResourceGroup(meta) + defaultRg, err := flex.DefaultResourceGroup(meta) if err != nil { return diag.FromErr(err) } @@ -135,7 +138,7 @@ func resourceIBMCrNamespaceCreate(context context.Context, d *schema.ResourceDat } func resourceIBMCrNamespaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } @@ -165,32 +168,32 @@ func resourceIBMCrNamespaceRead(context context.Context, d *schema.ResourceData, } if err = d.Set("name", namespaceDetails.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("resource_group_id", namespaceDetails.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group_id: %s", err)) } if err = d.Set("account", namespaceDetails.Account); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account: %s", err)) } if err = d.Set("created_date", namespaceDetails.CreatedDate); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_date: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_date: %s", err)) } if err = d.Set("crn", namespaceDetails.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("resource_created_date", namespaceDetails.ResourceCreatedDate); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_created_date: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_created_date: %s", err)) } if err = d.Set("updated_date", namespaceDetails.UpdatedDate); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_date: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_date: %s", err)) } // HAND-ADDED DEPRECATED FIELDS, TO BE DELETED IN FUTURE if err = d.Set("updated_on", namespaceDetails.UpdatedDate); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_date: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_date: %s", err)) } if err = d.Set("created_on", namespaceDetails.CreatedDate); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_date: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_date: %s", err)) } return nil @@ -202,7 +205,7 @@ func resourceIBMCrNamespaceUpdate(context context.Context, d *schema.ResourceDat } func resourceIBMCrNamespaceDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cr_retention_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/resource_ibm_cr_retention_policy.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cr_retention_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/resource_ibm_cr_retention_policy.go index c4665fb40b..0235ce15b1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_cr_retention_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry/resource_ibm_cr_retention_policy.go @@ -1,20 +1,22 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package registry import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/container-registry-go-sdk/containerregistryv1" ) -func resourceIBMCrRetentionPolicy() *schema.Resource { +func ResourceIBMCrRetentionPolicy() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMCrRetentionPolicyCreate, ReadContext: resourceIBMCrRetentionPolicyRead, @@ -23,17 +25,17 @@ func resourceIBMCrRetentionPolicy() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "namespace": &schema.Schema{ + "namespace": { Type: schema.TypeString, Required: true, Description: "The namespace to which the retention policy is attached.", }, - "images_per_repo": &schema.Schema{ + "images_per_repo": { Type: schema.TypeInt, Required: true, Description: "Determines how many images will be retained for each repository when the retention policy is executed. The value -1 denotes 'Unlimited' (all images are retained).", }, - "retain_untagged": &schema.Schema{ + "retain_untagged": { Type: schema.TypeBool, Optional: true, Default: false, @@ -44,7 +46,7 @@ func resourceIBMCrRetentionPolicy() *schema.Resource { } func resourceIBMCrRetentionPolicyCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } @@ -69,7 +71,7 @@ func resourceIBMCrRetentionPolicyCreate(context context.Context, d *schema.Resou } func resourceIBMCrRetentionPolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } @@ -89,26 +91,26 @@ func resourceIBMCrRetentionPolicyRead(context context.Context, d *schema.Resourc } // A retention policy "does not exist" if `imagesPerRepo` is -1 `retainUntagged` is true - if *retentionPolicy.ImagesPerRepo == -1 && *retentionPolicy.RetainUntagged == true { + if *retentionPolicy.ImagesPerRepo == -1 && *retentionPolicy.RetainUntagged { d.SetId("") return nil } if err = d.Set("namespace", retentionPolicy.Namespace); err != nil { - return diag.FromErr(fmt.Errorf("Error setting namespace: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting namespace: %s", err)) } - if err = d.Set("images_per_repo", intValue(retentionPolicy.ImagesPerRepo)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting images_per_repo: %s", err)) + if err = d.Set("images_per_repo", flex.IntValue(retentionPolicy.ImagesPerRepo)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting images_per_repo: %s", err)) } if err = d.Set("retain_untagged", retentionPolicy.RetainUntagged); err != nil { - return diag.FromErr(fmt.Errorf("Error setting retain_untagged: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting retain_untagged: %s", err)) } return nil } func resourceIBMCrRetentionPolicyUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } @@ -144,7 +146,7 @@ func resourceIBMCrRetentionPolicyUpdate(context context.Context, d *schema.Resou } func resourceIBMCrRetentionPolicyDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - containerRegistryClient, err := meta.(ClientSession).ContainerRegistryV1() + containerRegistryClient, err := meta.(conns.ClientSession).ContainerRegistryV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/README.md new file mode 100644 index 0000000000..e14eaaea63 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Resource Controller + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Resource Controller resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) +* IBM API Docs: [IBM API Docs for Resource Controller](https://cloud.ibm.com/apidocs/resource-controller/resource-controller) +* IBM Resource Controller SDK: [IBM SDK for Resource Controller](https://github.com/IBM/platform-services-go-sdk/tree/main/resourcecontrollerv2) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_instance.go new file mode 100644 index 0000000000..4ad47c9bb8 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_instance.go @@ -0,0 +1,229 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package resourcecontroller + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2" + "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" +) + +func DataSourceIBMResourceInstance() *schema.Resource { + return &schema.Resource{ + Read: DataSourceIBMResourceInstanceRead, + + Schema: map[string]*schema.Schema{ + "name": { + Description: "Resource instance name for example, myobjectstorage", + Type: schema.TypeString, + Required: true, + }, + + "resource_group_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The id of the resource group in which the instance is present", + }, + + "location": { + Description: "The location or the environment in which instance exists", + Optional: true, + Type: schema.TypeString, + Computed: true, + }, + + "service": { + Description: "The service type of the instance", + Optional: true, + Type: schema.TypeString, + Computed: true, + }, + + "plan": { + Description: "The plan type of the instance", + Type: schema.TypeString, + Computed: true, + }, + + "status": { + Description: "The resource instance status", + Type: schema.TypeString, + Computed: true, + }, + + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "CRN of resource instance", + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Description: "Tags of Resource Instance", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "guid": { + Type: schema.TypeString, + Computed: true, + Description: "Guid of resource instance", + }, + + flex.ResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + flex.ResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + flex.ResourceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the resource", + }, + + flex.ResourceGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "The resource group name in which resource is provisioned", + }, + flex.ResourceControllerURL: { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + }, + + "extensions": { + Type: schema.TypeMap, + Computed: true, + Description: "The extended metadata as a map associated with the resource instance.", + }, + }, + } +} + +func DataSourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{}) error { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerAPIV2() + if err != nil { + return err + } + rsAPI := rsConClient.ResourceServiceInstanceV2() + name := d.Get("name").(string) + + rsInstQuery := controllerv2.ServiceInstanceQuery{ + Name: name, + } + + if rsGrpID, ok := d.GetOk("resource_group_id"); ok { + rsInstQuery.ResourceGroupID = rsGrpID.(string) + } else { + defaultRg, err := flex.DefaultResourceGroup(meta) + if err != nil { + return err + } + rsInstQuery.ResourceGroupID = defaultRg + } + + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + if service, ok := d.GetOk("service"); ok { + + serviceOff, err := rsCatRepo.FindByName(service.(string), true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + rsInstQuery.ServiceID = serviceOff[0].ID + } + + var instances []models.ServiceInstanceV2 + + instances, err = rsAPI.ListInstances(rsInstQuery) + if err != nil { + return err + } + var filteredInstances []models.ServiceInstanceV2 + var location string + + if loc, ok := d.GetOk("location"); ok { + location = loc.(string) + for _, instance := range instances { + if flex.GetLocation(instance) == location { + filteredInstances = append(filteredInstances, instance) + } + } + } else { + filteredInstances = instances + } + + if len(filteredInstances) == 0 { + return fmt.Errorf("[ERROR] No resource instance found with name [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) + } + + var instance models.ServiceInstanceV2 + + if len(filteredInstances) > 1 { + return fmt.Errorf("[ERROR] More than one resource instance found with name matching [%s]\nIf not specified please specify more filters like resource_group_id if instance doesn't exists in default group, location or service", name) + } + instance = filteredInstances[0] + + d.SetId(instance.ID) + d.Set("status", instance.State) + d.Set("resource_group_id", instance.ResourceGroupID) + d.Set("location", instance.RegionID) + serviceOff, err := rsCatRepo.GetServiceName(instance.ServiceID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + d.Set("service", serviceOff) + + d.Set(flex.ResourceName, instance.Name) + d.Set(flex.ResourceCRN, instance.Crn.String()) + d.Set(flex.ResourceStatus, instance.State) + d.Set(flex.ResourceGroupName, instance.ResourceGroupName) + d.Set("guid", instance.Guid) + if len(instance.Extensions) == 0 { + d.Set("extensions", instance.Extensions) + } else { + d.Set("extensions", flex.Flatten(instance.Extensions)) + } + + rcontroller, err := flex.GetBaseController(meta) + if err != nil { + return err + } + d.Set(flex.ResourceControllerURL, rcontroller+"/services/") + + servicePlan, err := rsCatRepo.GetServicePlanName(instance.ResourcePlanID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + d.Set("plan", servicePlan) + d.Set("crn", instance.Crn.String()) + tags, err := flex.GetTagsUsingCRN(meta, instance.Crn.String()) + if err != nil { + log.Printf( + "Error on get of resource instance tags (%s) tags: %s", d.Id(), err) + } + d.Set("tags", tags) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_key.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_key.go index f2d9c3d43e..79155d3979 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package resourcecontroller import ( "encoding/json" @@ -11,11 +11,13 @@ import ( "github.com/IBM-Cloud/bluemix-go/crn" "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMResourceKey() *schema.Resource { +func DataSourceIBMResourceKey() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMResourceKeyRead, @@ -66,7 +68,7 @@ func dataSourceIBMResourceKey() *schema.Resource { Computed: true, }, - "most_recent": &schema.Schema{ + "most_recent": { Description: "If true and multiple entries are found, the most recently created resource key is used. " + "If false, an error is returned", Type: schema.TypeBool, @@ -84,7 +86,7 @@ func dataSourceIBMResourceKey() *schema.Resource { } func dataSourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) error { - rsContClient, err := meta.(ClientSession).ResourceControllerAPI() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerAPI() if err != nil { return err } @@ -98,7 +100,7 @@ func dataSourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) erro } var filteredKeys []models.ServiceKey - if d.Get("resource_instance_id") == "" && d.Get("resource_instance_id") == "" { + if d.Get("resource_instance_id") == "" { filteredKeys = keys } else { crn, err := getCRN(d, meta) @@ -114,7 +116,7 @@ func dataSourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) erro } if len(filteredKeys) == 0 { - return fmt.Errorf("No resource keys found with name [%s]", name) + return fmt.Errorf("[ERROR] No resource keys found with name [%s]", name) } var key models.ServiceKey @@ -123,10 +125,9 @@ func dataSourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) erro if mostRecent { key = mostRecentResourceKey(filteredKeys) } else { - return fmt.Errorf( - "More than one resource key found with name matching [%s]. "+ - "Set 'most_recent' to true in your configuration to force the most recent resource key "+ - "to be used", name) + return fmt.Errorf("[ERROR] More than one resource key found with name matching [%s]. "+ + "Set 'most_recent' to true in your configuration to force the most recent resource key "+ + "to be used", name) } } else { key = filteredKeys[0] @@ -140,13 +141,13 @@ func dataSourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) erro d.Set("role", roleCrn[strings.LastIndex(roleCrn, ":")+1:]) } - d.Set("credentials", Flatten(key.Credentials)) + d.Set("credentials", flex.Flatten(key.Credentials)) creds, err := json.Marshal(key.Credentials) if err != nil { - return fmt.Errorf("error marshalling resource key credentials: %s", err) + return fmt.Errorf("[ERROR] Error marshalling resource key credentials: %s", err) } if err = d.Set("credentials_json", string(creds)); err != nil { - return fmt.Errorf("error setting the credentials json: %s", err) + return fmt.Errorf("[ERROR] Error setting the credentials json: %s", err) } d.Set("status", key.State) d.Set("crn", key.Crn.String()) @@ -155,7 +156,7 @@ func dataSourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) erro func getCRN(d *schema.ResourceData, meta interface{}) (*crn.CRN, error) { - rsContClient, err := meta.(ClientSession).ResourceControllerAPI() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerAPI() if err != nil { return nil, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_quota.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_quota.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_quota.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_quota.go index 26d9374a9f..b402306407 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_quota.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/data_source_ibm_resource_quota.go @@ -1,15 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package resourcecontroller import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMResourceQuota() *schema.Resource { +func DataSourceIBMResourceQuota() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMResourceQuotaRead, @@ -59,7 +60,7 @@ func dataSourceIBMResourceQuota() *schema.Resource { } func dataSourceIBMResourceQuotaRead(d *schema.ResourceData, meta interface{}) error { - rsManagementAPI, err := meta.(ClientSession).ResourceManagementAPIv2() + rsManagementAPI, err := meta.(conns.ClientSession).ResourceManagementAPIv2() if err != nil { return err } @@ -67,11 +68,11 @@ func dataSourceIBMResourceQuotaRead(d *schema.ResourceData, meta interface{}) er rsQuotaName := d.Get("name").(string) rsQuotas, err := rsQuota.FindByName(rsQuotaName) if err != nil { - return fmt.Errorf("Error retrieving resource quota: %s", err) + return fmt.Errorf("[ERROR] Error retrieving resource quota: %s", err) } if len(rsQuotas) == 0 { - return fmt.Errorf("Error retrieving resource quota: %s", err) + return fmt.Errorf("[ERROR] Error retrieving resource quota: %s", err) } rsQuotaFields := rsQuotas[0] diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/resource_ibm_resource_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/resource_ibm_resource_instance.go new file mode 100644 index 0000000000..d659ea1406 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/resource_ibm_resource_instance.go @@ -0,0 +1,931 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package resourcecontroller + +import ( + "context" + "encoding/json" + "fmt" + "log" + "os" + "strconv" + "strings" + "time" + + rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/models" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" +) + +const ( + RsInstanceSuccessStatus = "active" + RsInstanceProgressStatus = "in progress" + RsInstanceProvisioningStatus = "provisioning" + RsInstanceInactiveStatus = "inactive" + RsInstanceFailStatus = "failed" + RsInstanceRemovedStatus = "removed" + RsInstanceReclamation = "pending_reclamation" +) + +func ResourceIBMResourceInstance() *schema.Resource { + return &schema.Resource{ + Create: ResourceIBMResourceInstanceCreate, + Read: ResourceIBMResourceInstanceRead, + Update: ResourceIBMResourceInstanceUpdate, + Delete: ResourceIBMResourceInstanceDelete, + Exists: ResourceIBMResourceInstanceExists, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + CustomizeDiff: customdiff.Sequence( + func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { + return flex.ResourceTagsCustomizeDiff(diff) + }, + ), + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "A name for the resource instance", + }, + + "service": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the service offering like cloud-object-storage, kms etc", + }, + + "plan": { + Type: schema.TypeString, + Required: true, + Description: "The plan type of the service", + }, + + "location": { + Description: "The location where the instance available", + Required: true, + ForceNew: true, + Type: schema.TypeString, + }, + + "resource_group_id": { + Description: "The resource group id", + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Computed: true, + }, + + "parameters": { + Type: schema.TypeMap, + Optional: true, + Description: "Arbitrary parameters to pass. Must be a JSON object", + ConflictsWith: []string{"parameters_json"}, + }, + "parameters_json": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"parameters"}, + StateFunc: func(v interface{}) string { + json, err := flex.NormalizeJSONString(v) + if err != nil { + return fmt.Sprintf("%q", err.Error()) + } + return json + }, + Description: "Arbitrary parameters to pass in Json string format", + }, + + "tags": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_resource_instance", "tag")}, + Set: flex.ResourceIBMVPCHash, + }, + + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Status of resource instance", + }, + + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "CRN of resource instance", + }, + + "guid": { + Type: schema.TypeString, + Computed: true, + Description: "Guid of resource instance", + }, + + "service_endpoints": { + Description: "Types of the service endpoints. Possible values are 'public', 'private', 'public-and-private'.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private", "public-and-private"}), + }, + + "dashboard_url": { + Description: "Dashboard URL to access resource.", + Type: schema.TypeString, + Computed: true, + }, + + "plan_history": { + Description: "The plan history of the instance.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "resource_plan_id": { + Type: schema.TypeString, + Computed: true, + }, + "start_date": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "account_id": { + Description: "An alpha-numeric value identifying the account ID.", + Type: schema.TypeString, + Computed: true, + }, + + "resource_group_crn": { + Description: "The long ID (full CRN) of the resource group", + Type: schema.TypeString, + Computed: true, + }, + + "resource_id": { + Description: "The unique ID of the offering", + Type: schema.TypeString, + Computed: true, + }, + + "resource_plan_id": { + Description: "The unique ID of the plan associated with the offering", + Type: schema.TypeString, + Computed: true, + }, + + "target_crn": { + Description: "The full deployment CRN as defined in the global catalog", + Type: schema.TypeString, + Computed: true, + }, + + "state": { + Description: "The current state of the instance.", + Type: schema.TypeString, + Computed: true, + }, + + "type": { + Description: "The type of the instance, e.g. service_instance.", + Type: schema.TypeString, + Computed: true, + }, + + "sub_type": { + Description: "The sub-type of instance, e.g. cfaas .", + Type: schema.TypeString, + Computed: true, + }, + + "allow_cleanup": { + Description: "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + Type: schema.TypeBool, + Computed: true, + }, + + "locked": { + Description: "A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.", + Type: schema.TypeBool, + Computed: true, + }, + + "last_operation": { + Type: schema.TypeMap, + Computed: true, + Description: "The status of the last operation requested on the instance", + }, + + "resource_aliases_url": { + Description: "The relative path to the resource aliases for the instance.", + Type: schema.TypeString, + Computed: true, + }, + + "resource_bindings_url": { + Description: "The relative path to the resource bindings for the instance.", + Type: schema.TypeString, + Computed: true, + }, + + "resource_keys_url": { + Description: "The relative path to the resource keys for the instance.", + Type: schema.TypeString, + Computed: true, + }, + + "created_at": { + Type: schema.TypeString, + Description: "The date when the instance was created.", + Computed: true, + }, + + "created_by": { + Type: schema.TypeString, + Description: "The subject who created the instance.", + Computed: true, + }, + + "update_at": { + Type: schema.TypeString, + Description: "The date when the instance was last updated.", + Computed: true, + }, + + "update_by": { + Type: schema.TypeString, + Description: "The subject who updated the instance.", + Computed: true, + }, + + "deleted_at": { + Type: schema.TypeString, + Description: "The date when the instance was deleted.", + Computed: true, + }, + + "deleted_by": { + Type: schema.TypeString, + Description: "The subject who deleted the instance.", + Computed: true, + }, + + "scheduled_reclaim_at": { + Type: schema.TypeString, + Description: "The date when the instance was scheduled for reclamation.", + Computed: true, + }, + + "scheduled_reclaim_by": { + Type: schema.TypeString, + Description: "The subject who initiated the instance reclamation.", + Computed: true, + }, + + "restored_at": { + Type: schema.TypeString, + Description: "The date when the instance under reclamation was restored.", + Computed: true, + }, + + "restored_by": { + Type: schema.TypeString, + Description: "The subject who restored the instance back from reclamation.", + Computed: true, + }, + + flex.ResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + flex.ResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + flex.ResourceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the resource", + }, + + flex.ResourceGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "The resource group name in which resource is provisioned", + }, + flex.ResourceControllerURL: { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource", + }, + + "extensions": { + Type: schema.TypeMap, + Computed: true, + Description: "The extended metadata as a map associated with the resource instance.", + }, + }, + } +} + +func ResourceIBMResourceInstanceValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "tag", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^[A-Za-z0-9:_ .-]+$`, + MinValueLength: 1, + MaxValueLength: 128}) + + ibmResourceInstanceResourceValidator := validate.ResourceValidator{ResourceName: "ibm_resource_instance", Schema: validateSchema} + return &ibmResourceInstanceResourceValidator +} + +func ResourceIBMResourceInstanceCreate(d *schema.ResourceData, meta interface{}) error { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + + serviceName := d.Get("service").(string) + plan := d.Get("plan").(string) + name := d.Get("name").(string) + location := d.Get("location").(string) + + rsInst := rc.CreateResourceInstanceOptions{ + Name: &name, + } + + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + serviceOff, err := rsCatRepo.FindByName(serviceName, true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + if metadata, ok := serviceOff[0].Metadata.(*models.ServiceResourceMetadata); ok { + if !metadata.Service.RCProvisionable { + return fmt.Errorf("%s cannot be provisioned by resource controller", serviceName) + } + } else { + return fmt.Errorf("[ERROR] Cannot create instance of resource %s\nUse 'ibm_service_instance' if the resource is a Cloud Foundry service", serviceName) + } + + servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + rsInst.ResourcePlanID = &servicePlan + + deployments, err := rsCatRepo.ListDeployments(servicePlan) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving deployment for plan %s : %s", plan, err) + } + if len(deployments) == 0 { + return fmt.Errorf("[ERROR] No deployment found for service plan : %s", plan) + } + deployments, supportedLocations := FilterDeployments(deployments, location) + + if len(deployments) == 0 { + locationList := make([]string, 0, len(supportedLocations)) + for l := range supportedLocations { + locationList = append(locationList, l) + } + return fmt.Errorf("[ERROR] No deployment found for service plan %s at location %s.\nValid location(s) are: %q.\nUse 'ibm_service_instance' if the service is a Cloud Foundry service", plan, location, locationList) + } + + rsInst.Target = &deployments[0].CatalogCRN + + if rsGrpID, ok := d.GetOk("resource_group_id"); ok { + rg := rsGrpID.(string) + rsInst.ResourceGroup = &rg + } else { + defaultRg, err := flex.DefaultResourceGroup(meta) + if err != nil { + return err + } + rsInst.ResourceGroup = &defaultRg + } + + params := map[string]interface{}{} + + if serviceEndpoints, ok := d.GetOk("service_endpoints"); ok { + params["service-endpoints"] = serviceEndpoints.(string) + } + + if parameters, ok := d.GetOk("parameters"); ok { + temp := parameters.(map[string]interface{}) + for k, v := range temp { + if v == "true" || v == "false" { + b, _ := strconv.ParseBool(v.(string)) + params[k] = b + } else if strings.HasPrefix(v.(string), "[") && strings.HasSuffix(v.(string), "]") { + //transform v.(string) to be []string + arrayString := v.(string) + result := []string{} + trimLeft := strings.TrimLeft(arrayString, "[") + trimRight := strings.TrimRight(trimLeft, "]") + if len(trimRight) == 0 { + params[k] = result + } else { + array := strings.Split(trimRight, ",") + for _, a := range array { + result = append(result, strings.Trim(a, "\"")) + } + params[k] = result + } + } else { + params[k] = v + } + } + + } + if s, ok := d.GetOk("parameters_json"); ok { + json.Unmarshal([]byte(s.(string)), ¶ms) + } + + rsInst.Parameters = params + + //Start to create resource instance + instance, resp, err := rsConClient.CreateResourceInstance(&rsInst) + if err != nil { + log.Printf( + "Error when creating resource instance: %s, Instance info NAME->%s, LOCATION->%s, GROUP_ID->%s, PLAN_ID->%s", + err, *rsInst.Name, *rsInst.Target, *rsInst.ResourceGroup, *rsInst.ResourcePlanID) + return fmt.Errorf("[ERROR] Error when creating resource instance: %s with resp code: %s", err, resp) + } + + d.SetId(*instance.ID) + + _, err = waitForResourceInstanceCreate(d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for create resource instance (%s) to be succeeded: %s", d.Id(), err) + } + + v := os.Getenv("IC_ENV_TAGS") + if _, ok := d.GetOk("tags"); ok || v != "" { + oldList, newList := d.GetChange("tags") + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + if err != nil { + log.Printf( + "Error on create of resource instance (%s) tags: %s", d.Id(), err) + } + } + + return ResourceIBMResourceInstanceRead(d, meta) +} +func ResourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{}) error { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + + instanceID := d.Id() + resourceInstanceGet := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving resource instance: %s with resp code: %s", err, resp) + } + + tags, err := flex.GetTagsUsingCRN(meta, *instance.CRN) + if err != nil { + log.Printf( + "Error on get of resource instance tags (%s) tags: %s", d.Id(), err) + } + d.Set("tags", tags) + d.Set("name", instance.Name) + d.Set("status", instance.State) + d.Set("resource_group_id", instance.ResourceGroupID) + if instance.CRN != nil { + location := strings.Split(*instance.CRN, ":") + if len(location) > 5 { + d.Set("location", location[5]) + } + } + d.Set("crn", instance.CRN) + d.Set("dashboard_url", instance.DashboardURL) + + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + serviceOff, err := rsCatRepo.GetServiceName(*instance.ResourceID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + d.Set("service", serviceOff) + + d.Set(flex.ResourceName, instance.Name) + d.Set(flex.ResourceCRN, instance.CRN) + d.Set(flex.ResourceStatus, instance.State) + d.Set(flex.ResourceGroupName, instance.ResourceGroupCRN) + + rcontroller, err := flex.GetBaseController(meta) + if err != nil { + return err + } + d.Set(flex.ResourceControllerURL, rcontroller+"/services/") + + servicePlan, err := rsCatRepo.GetServicePlanName(*instance.ResourcePlanID) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + d.Set("plan", servicePlan) + d.Set("guid", instance.GUID) + if instance.Parameters != nil { + if endpoint, ok := instance.Parameters["service-endpoints"]; ok { + d.Set("service_endpoints", endpoint) + } + } + + if len(instance.Extensions) == 0 { + d.Set("extensions", instance.Extensions) + } else { + d.Set("extensions", flex.Flatten(instance.Extensions)) + } + d.Set("account_id", instance.AccountID) + d.Set("restored_by", instance.RestoredBy) + if instance.RestoredAt != nil { + d.Set("restored_at", instance.RestoredAt.String()) + } + d.Set("scheduled_reclaim_by", instance.ScheduledReclaimBy) + if instance.ScheduledReclaimAt != nil { + d.Set("scheduled_reclaim_at", instance.ScheduledReclaimAt.String()) + } + if instance.DeletedAt != nil { + d.Set("deleted_at", instance.DeletedAt.String()) + } + d.Set("deleted_by", instance.DeletedBy) + if instance.UpdatedAt != nil { + d.Set("update_at", instance.UpdatedAt.String()) + } + if instance.CreatedAt != nil { + d.Set("created_at", instance.CreatedAt.String()) + } + d.Set("update_by", instance.UpdatedBy) + d.Set("created_by", instance.CreatedBy) + d.Set("resource_keys_url", instance.ResourceKeysURL) + d.Set("resource_bindings_url", instance.ResourceBindingsURL) + d.Set("resource_aliases_url", instance.ResourceAliasesURL) + if instance.LastOperation != nil { + d.Set("last_operation", flex.Flatten(instance.LastOperation)) + } + d.Set("locked", instance.Locked) + d.Set("allow_cleanup", instance.AllowCleanup) + d.Set("type", instance.Type) + d.Set("state", instance.State) + d.Set("sub_type", instance.SubType) + d.Set("target_crn", instance.TargetCRN) + d.Set("resource_plan_id", instance.ResourcePlanID) + d.Set("resource_id", instance.ResourceID) + d.Set("resource_group_crn", instance.ResourceGroupCRN) + if instance.PlanHistory != nil { + d.Set("plan_history", flattenPlanHistory(instance.PlanHistory)) + } + + return nil +} + +func ResourceIBMResourceInstanceUpdate(d *schema.ResourceData, meta interface{}) error { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + + instanceID := d.Id() + + resourceInstanceUpdate := rc.UpdateResourceInstanceOptions{ + ID: &instanceID, + } + if d.HasChange("name") { + name := d.Get("name").(string) + resourceInstanceUpdate.Name = &name + } + + if d.HasChange("plan") { + plan := d.Get("plan").(string) + service := d.Get("service").(string) + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() + if err != nil { + return err + } + rsCatRepo := rsCatClient.ResourceCatalog() + + serviceOff, err := rsCatRepo.FindByName(service, true) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving service offering: %s", err) + } + + servicePlan, err := rsCatRepo.GetServicePlanID(serviceOff[0], plan) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving plan: %s", err) + } + + resourceInstanceUpdate.ResourcePlanID = &servicePlan + + } + params := map[string]interface{}{} + + if d.HasChange("service_endpoints") { + endpoint := d.Get("service_endpoints").(string) + params["service-endpoints"] = endpoint + } + + resourceInstanceGet := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + if d.HasChange("parameters") { + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + return fmt.Errorf("[ERROR] Error retrieving resource instance: %s with resp code: %s", err, resp) + } + + if parameters, ok := d.GetOk("parameters"); ok { + temp := parameters.(map[string]interface{}) + for k, v := range temp { + if v == "true" || v == "false" { + b, _ := strconv.ParseBool(v.(string)) + params[k] = b + } else if strings.HasPrefix(v.(string), "[") && strings.HasSuffix(v.(string), "]") { + //transform v.(string) to be []string + result := []string{} + arrayString := v.(string) + trimLeft := strings.TrimLeft(arrayString, "[") + trimRight := strings.TrimRight(trimLeft, "]") + if len(trimRight) == 0 { + params[k] = result + } else { + array := strings.Split(trimRight, ",") + for _, a := range array { + result = append(result, strings.Trim(a, "\"")) + } + params[k] = result + } + + } else { + params[k] = v + } + } + } + serviceEndpoints := d.Get("service_endpoints").(string) + if serviceEndpoints != "" { + endpoint := d.Get("service_endpoints").(string) + params["service-endpoints"] = endpoint + } else if _, ok := instance.Parameters["service-endpoints"]; ok { + params["service-endpoints"] = instance.Parameters["service-endpoints"] + } + + } + + if d.HasChange("service_endpoints") || d.HasChange("parameters") { + resourceInstanceUpdate.Parameters = params + } + if d.HasChange("parameters_json") { + if s, ok := d.GetOk("parameters_json"); ok { + json.Unmarshal([]byte(s.(string)), ¶ms) + resourceInstanceUpdate.Parameters = params + } + } + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + return fmt.Errorf("[ERROR] Error Getting resource instance: %s with resp code: %s", err, resp) + } + + if d.HasChange("tags") { + oldList, newList := d.GetChange("tags") + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + if err != nil { + log.Printf( + "Error on update of resource instance (%s) tags: %s", d.Id(), err) + } + } + + _, resp, err = rsConClient.UpdateResourceInstance(&resourceInstanceUpdate) + if err != nil { + return fmt.Errorf("[ERROR] Error updating resource instance: %s with resp code: %s", err, resp) + } + + _, err = waitForResourceInstanceUpdate(d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for update resource instance (%s) to be succeeded: %s", d.Id(), err) + } + + return ResourceIBMResourceInstanceRead(d, meta) +} + +func ResourceIBMResourceInstanceDelete(d *schema.ResourceData, meta interface{}) error { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return err + } + id := d.Id() + recursive := true + resourceInstanceDelete := rc.DeleteResourceInstanceOptions{ + ID: &id, + Recursive: &recursive, + } + + resp, error := rsConClient.DeleteResourceInstance(&resourceInstanceDelete) + if error != nil { + if resp != nil && resp.StatusCode == 410 { + return nil + } + return fmt.Errorf("[ERROR] Error deleting resource instance: %s with resp code: %s", error, resp) + } + + _, err = waitForResourceInstanceDelete(d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for resource instance (%s) to be deleted: %s", d.Id(), err) + } + + d.SetId("") + + return nil +} +func ResourceIBMResourceInstanceExists(d *schema.ResourceData, meta interface{}) (bool, error) { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + resourceInstanceGet := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + if resp != nil && resp.StatusCode == 404 { + return false, nil + } + return false, fmt.Errorf("[ERROR] Error getting resource instance: %s with resp code: %s", err, resp) + } + if instance != nil && (strings.Contains(*instance.State, "removed") || strings.Contains(*instance.State, RsInstanceReclamation)) { + log.Printf("[WARN] Removing instance from state because it's in removed or pending_reclamation state") + d.SetId("") + return false, nil + } + + return *instance.ID == instanceID, nil +} + +func waitForResourceInstanceCreate(d *schema.ResourceData, meta interface{}) (interface{}, error) { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + resourceInstanceGet := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + + stateConf := &resource.StateChangeConf{ + Pending: []string{RsInstanceProgressStatus, RsInstanceInactiveStatus, RsInstanceProvisioningStatus}, + Target: []string{RsInstanceSuccessStatus}, + Refresh: func() (interface{}, string, error) { + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + if resp != nil && resp.StatusCode == 404 { + return nil, "", fmt.Errorf("[ERROR] The resource instance %s does not exist anymore: %v", d.Id(), err) + } + return nil, "", fmt.Errorf("[ERROR] Get the resource instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) + } + if *instance.State == RsInstanceFailStatus { + return instance, *instance.State, fmt.Errorf("[ERROR] The resource instance %s failed: %v", d.Id(), err) + } + return instance, *instance.State, nil + }, + Timeout: d.Timeout(schema.TimeoutCreate), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func waitForResourceInstanceUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error) { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + resourceInstanceGet := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + + stateConf := &resource.StateChangeConf{ + Pending: []string{RsInstanceProgressStatus, RsInstanceInactiveStatus}, + Target: []string{RsInstanceSuccessStatus}, + Refresh: func() (interface{}, string, error) { + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + if resp != nil && resp.StatusCode == 404 { + return nil, "", fmt.Errorf("[ERROR] The resource instance %s does not exist anymore: %v", d.Id(), err) + } + return nil, "", fmt.Errorf("[ERROR] Get the resource instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) + } + if *instance.State == RsInstanceFailStatus { + return instance, *instance.State, fmt.Errorf("[ERROR] The resource instance %s failed: %v", d.Id(), err) + } + return instance, *instance.State, nil + }, + Timeout: d.Timeout(schema.TimeoutUpdate), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func waitForResourceInstanceDelete(d *schema.ResourceData, meta interface{}) (interface{}, error) { + rsConClient, err := meta.(conns.ClientSession).ResourceControllerV2API() + if err != nil { + return false, err + } + instanceID := d.Id() + resourceInstanceGet := rc.GetResourceInstanceOptions{ + ID: &instanceID, + } + stateConf := &resource.StateChangeConf{ + Pending: []string{RsInstanceProgressStatus, RsInstanceInactiveStatus, RsInstanceSuccessStatus}, + Target: []string{RsInstanceRemovedStatus, RsInstanceReclamation}, + Refresh: func() (interface{}, string, error) { + instance, resp, err := rsConClient.GetResourceInstance(&resourceInstanceGet) + if err != nil { + if resp != nil && resp.StatusCode == 404 { + return instance, RsInstanceSuccessStatus, nil + } + return nil, "", fmt.Errorf("[ERROR] Get the resource instance %s failed with resp code: %s, err: %v", d.Id(), resp, err) + } + if *instance.State == RsInstanceFailStatus { + return instance, *instance.State, fmt.Errorf("[ERROR] The resource instance %s failed to delete: %v", d.Id(), err) + } + return instance, *instance.State, nil + }, + Timeout: d.Timeout(schema.TimeoutDelete), + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func FilterDeployments(deployments []models.ServiceDeployment, location string) ([]models.ServiceDeployment, map[string]bool) { + supportedDeployments := []models.ServiceDeployment{} + supportedLocations := make(map[string]bool) + for _, d := range deployments { + if d.Metadata.RCCompatible { + deploymentLocation := d.Metadata.Deployment.Location + supportedLocations[deploymentLocation] = true + if deploymentLocation == location { + supportedDeployments = append(supportedDeployments, d) + } + } + } + return supportedDeployments, supportedLocations +} + +func flattenPlanHistory(keys []rc.PlanHistoryItem) []interface{} { + var out = make([]interface{}, len(keys)) + for i, k := range keys { + m := make(map[string]interface{}) + m["resource_plan_id"] = k.ResourcePlanID + m["start_date"] = k.StartDate.String() + out[i] = m + } + return out +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/resource_ibm_resource_key.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/resource_ibm_resource_key.go index bb14badc2e..bea2235bf7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller/resource_ibm_resource_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package resourcecontroller import ( "encoding/json" @@ -14,11 +14,12 @@ import ( rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/bluemix-go/bmxerror" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" ) -func resourceIBMResourceKey() *schema.Resource { +func ResourceIBMResourceKey() *schema.Resource { return &schema.Resource{ Create: resourceIBMResourceKeyCreate, Read: resourceIBMResourceKeyRead, @@ -67,7 +68,7 @@ func resourceIBMResourceKey() *schema.Resource { "parameters": { Type: schema.TypeMap, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "Arbitrary parameters to pass. Must be a JSON object", }, @@ -141,7 +142,7 @@ func resourceIBMResourceKey() *schema.Resource { "iam_compatible": { Type: schema.TypeBool, Computed: true, - Description: "Specifies whether the key’s credentials support IAM.", + Description: "Specifies whether the key's credentials support IAM.", }, "resource_instance_url": { @@ -190,7 +191,7 @@ func resourceIBMResourceKey() *schema.Resource { } func resourceIBMResourceKeyCreate(d *schema.ResourceData, meta interface{}) error { - rsContClient, err := meta.(ClientSession).ResourceControllerV2API() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -206,7 +207,7 @@ func resourceIBMResourceKeyCreate(d *schema.ResourceData, meta interface{}) erro } if instanceID == "" && aliasID == "" { - return fmt.Errorf("Provide either `resource_instance_id` or `resource_alias_id`") + return fmt.Errorf("[ERROR] Provide either `resource_instance_id` or `resource_alias_id`") } keyParameters := rc.ResourceKeyPostParameters{} @@ -225,19 +226,19 @@ func resourceIBMResourceKeyCreate(d *schema.ResourceData, meta interface{}) erro resourceInstance, sourceCRN, err := getResourceInstanceAndCRN(d, meta) if err != nil { - return fmt.Errorf("Error creating resource key when get instance and CRN: %s", err) + return fmt.Errorf("[ERROR] Error creating resource key when get instance and CRN: %s", err) } serviceID := resourceInstance.ResourceID - rsCatClient, err := meta.(ClientSession).ResourceCatalogAPI() + rsCatClient, err := meta.(conns.ClientSession).ResourceCatalogAPI() if err != nil { - return fmt.Errorf("Error creating resource key when get ResourceCatalogAPI: %s", err) + return fmt.Errorf("[ERROR] Error creating resource key when get ResourceCatalogAPI: %s", err) } service, err := rsCatClient.ResourceCatalog().Get(*serviceID, true) if err != nil { - return fmt.Errorf("Error creating resource key when get service: %s", err) + return fmt.Errorf("[ERROR] Error creating resource key when get service: %s", err) } resourceKeyCreate := rc.CreateResourceKeyOptions{ @@ -249,7 +250,7 @@ func resourceIBMResourceKeyCreate(d *schema.ResourceData, meta interface{}) erro role := r.(string) serviceRole, err := getRoleFromName(role, service.Name, meta) if err != nil { - return fmt.Errorf("Error creating resource key when get role: %s", err) + return fmt.Errorf("[ERROR] Error creating resource key when get role: %s", err) } keyParameters.SetProperty("role_crn", serviceRole.RoleID) resourceKeyCreate.Role = serviceRole.RoleID @@ -257,7 +258,7 @@ func resourceIBMResourceKeyCreate(d *schema.ResourceData, meta interface{}) erro resourceKey, resp, err := rsContClient.CreateResourceKey(&resourceKeyCreate) if err != nil { - return fmt.Errorf("Error creating resource key: %s with resp code: %s", err, resp) + return fmt.Errorf("[ERROR] Error creating resource key: %s with resp code: %s", err, resp) } d.SetId(*resourceKey.ID) @@ -270,7 +271,7 @@ func resourceIBMResourceKeyUpdate(d *schema.ResourceData, meta interface{}) erro } func resourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) error { - rsContClient, err := meta.(ClientSession).ResourceControllerV2API() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -281,19 +282,19 @@ func resourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) error resourceKey, resp, err := rsContClient.GetResourceKey(&resourceKeyGet) if err != nil || resourceKey == nil { - return fmt.Errorf("Error retrieving resource key: %s with resp : %s", err, resp) + return fmt.Errorf("[ERROR] Error retrieving resource key: %s with resp : %s", err, resp) } var credInterface map[string]interface{} cred, _ := json.Marshal(resourceKey.Credentials) json.Unmarshal(cred, &credInterface) - d.Set("credentials", Flatten(credInterface)) + d.Set("credentials", flex.Flatten(credInterface)) creds, err := json.Marshal(resourceKey.Credentials) if err != nil { - return fmt.Errorf("error marshalling resource key credentials: %s", err) + return fmt.Errorf("[ERROR] Error marshalling resource key credentials: %s", err) } if err = d.Set("credentials_json", string(creds)); err != nil { - return fmt.Errorf("error setting the credentials json: %s", err) + return fmt.Errorf("[ERROR] Error setting the credentials json: %s", err) } d.Set("name", *resourceKey.Name) d.Set("status", *resourceKey.State) @@ -303,7 +304,7 @@ func resourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) error // TODO.S: update client if strings.Contains(roleCrn, ":customRole:") { - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err == nil { var resourceCRN string if resourceKey.CRN != nil { @@ -370,7 +371,7 @@ func resourceIBMResourceKeyRead(d *schema.ResourceData, meta interface{}) error } func resourceIBMResourceKeyDelete(d *schema.ResourceData, meta interface{}) error { - rsContClient, err := meta.(ClientSession).ResourceControllerV2API() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return err } @@ -382,7 +383,7 @@ func resourceIBMResourceKeyDelete(d *schema.ResourceData, meta interface{}) erro resp, err := rsContClient.DeleteResourceKey(&resourceKeyDelete) if err != nil { - return fmt.Errorf("Error deleting resource key: %s with resp code: %s", err, resp) + return fmt.Errorf("[ERROR] Error deleting resource key: %s with resp code: %s", err, resp) } d.SetId("") @@ -391,7 +392,7 @@ func resourceIBMResourceKeyDelete(d *schema.ResourceData, meta interface{}) erro } func resourceIBMResourceKeyExists(d *schema.ResourceData, meta interface{}) (bool, error) { - rsContClient, err := meta.(ClientSession).ResourceControllerV2API() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return false, err } @@ -415,7 +416,7 @@ func resourceIBMResourceKeyExists(d *schema.ResourceData, meta interface{}) (boo } func getResourceInstanceAndCRN(d *schema.ResourceData, meta interface{}) (*rc.ResourceInstance, *string, error) { - rsContClient, err := meta.(ClientSession).ResourceControllerV2API() + rsContClient, err := meta.(conns.ClientSession).ResourceControllerV2API() if err != nil { return nil, nil, err } @@ -456,18 +457,18 @@ func getResourceInstanceAndCRN(d *schema.ResourceData, meta interface{}) (*rc.Re func getRoleFromName(roleName, serviceName string, meta interface{}) (iampolicymanagementv1.PolicyRole, error) { role := iampolicymanagementv1.PolicyRole{} - iamPolicyManagementClient, err := meta.(ClientSession).IAMPolicyManagementV1API() + iamPolicyManagementClient, err := meta.(conns.ClientSession).IAMPolicyManagementV1API() if err != nil { return role, err } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return role, err } listRoleOptions := &iampolicymanagementv1.ListRolesOptions{ - AccountID: &userDetails.userAccount, + AccountID: &userDetails.UserAccount, ServiceName: &serviceName, } @@ -476,40 +477,12 @@ func getRoleFromName(roleName, serviceName string, meta interface{}) (iampolicym return role, err } - roles := mapRoleListToPolicyRoles(*roleList) + roles := flex.MapRoleListToPolicyRoles(*roleList) - role, err = findRoleByName(roles, roleName) + role, err = flex.FindRoleByName(roles, roleName) if err != nil { return iampolicymanagementv1.PolicyRole{}, err } return role, nil } - -func findRoleByName(supported []iampolicymanagementv1.PolicyRole, name string) (iampolicymanagementv1.PolicyRole, error) { - for _, role := range supported { - if role.DisplayName != nil { - if *role.DisplayName == name { - role.DisplayName = nil - return role, nil - } - } - } - supportedRoles := getSupportedRolesStr(supported) - return iampolicymanagementv1.PolicyRole{}, bmxerror.New("RoleDoesnotExist", - fmt.Sprintf("%s was not found. Valid roles are %s", name, supportedRoles)) - -} - -func getSupportedRolesStr(supported []iampolicymanagementv1.PolicyRole) string { - rolesStr := "" - for index, role := range supported { - if index != 0 { - rolesStr += ", " - } - if role.DisplayName != nil { - rolesStr += *role.DisplayName - } - } - return rolesStr -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/README.md new file mode 100644 index 0000000000..46f3c0bb79 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Resource Manager + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Resource Manager resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_group) +* IBM API Docs: [IBM API Docs for Resource Manager](https://cloud.ibm.com/apidocs/resource-controller/resource-manager) +* IBM Resource Manager SDK: [IBM SDK for Resource Manager](https://github.com/IBM/platform-services-go-sdk/tree/main/resourcemanagerv2) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/data_source_ibm_resource_group.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/data_source_ibm_resource_group.go index 31b0a10eb0..c279560a17 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_resource_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/data_source_ibm_resource_group.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package resourcemanager import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" rg "github.com/IBM/platform-services-go-sdk/resourcemanagerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMResourceGroup() *schema.Resource { +func DataSourceIBMResourceGroup() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMResourceGroupRead, @@ -85,7 +86,7 @@ func dataSourceIBMResourceGroup() *schema.Resource { } func dataSourceIBMResourceGroupRead(d *schema.ResourceData, meta interface{}) error { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return err } @@ -102,11 +103,11 @@ func dataSourceIBMResourceGroupRead(d *schema.ResourceData, meta interface{}) er if !defaultGrp && name == "" { return fmt.Errorf("[ERROR] Missing required properties. Need a resource group name, or the is_default true") } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount resourceGroupList := rg.ListResourceGroupsOptions{ AccountID: &accountID, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/resource_ibm_resource_group.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/resource_ibm_resource_group.go index cb84f9e20f..13dac090e0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_resource_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager/resource_ibm_resource_group.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package resourcemanager import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" rg "github.com/IBM/platform-services-go-sdk/resourcemanagerv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMResourceGroup() *schema.Resource { +func ResourceIBMResourceGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMResourceGroupCreate, Read: resourceIBMResourceGroupRead, @@ -90,17 +91,17 @@ func resourceIBMResourceGroup() *schema.Resource { } func resourceIBMResourceGroupCreate(d *schema.ResourceData, meta interface{}) error { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return err } name := d.Get("name").(string) - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return err } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount resourceGroupCreate := rg.CreateResourceGroupOptions{ Name: &name, @@ -109,7 +110,7 @@ func resourceIBMResourceGroupCreate(d *schema.ResourceData, meta interface{}) er resourceGroup, resp, err := rMgtClient.CreateResourceGroup(&resourceGroupCreate) if err != nil { - return fmt.Errorf("Error creating resource group: %s with response code %s", err, resp) + return fmt.Errorf("[ERROR] Error creating resource group: %s with response code %s", err, resp) } d.SetId(*resourceGroup.ID) @@ -118,7 +119,7 @@ func resourceIBMResourceGroupCreate(d *schema.ResourceData, meta interface{}) er } func resourceIBMResourceGroupRead(d *schema.ResourceData, meta interface{}) error { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return err } @@ -134,7 +135,7 @@ func resourceIBMResourceGroupRead(d *schema.ResourceData, meta interface{}) erro d.SetId("") return nil } - return fmt.Errorf("Error retrieving resource group: %s with response code %s", err, resp) + return fmt.Errorf("[ERROR] Error retrieving resource group: %s with response code %s", err, resp) } d.Set("name", *resourceGroup.Name) @@ -178,7 +179,7 @@ func resourceIBMResourceGroupRead(d *schema.ResourceData, meta interface{}) erro } func resourceIBMResourceGroupUpdate(d *schema.ResourceData, meta interface{}) error { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return err } @@ -197,7 +198,7 @@ func resourceIBMResourceGroupUpdate(d *schema.ResourceData, meta interface{}) er if hasChange { _, resp, err := rMgtClient.UpdateResourceGroup(&resourceGroupUpdate) if err != nil { - return fmt.Errorf("Error updating resource group: %s with response code %s", err, resp) + return fmt.Errorf("[ERROR] Error updating resource group: %s with response code %s", err, resp) } } @@ -205,7 +206,7 @@ func resourceIBMResourceGroupUpdate(d *schema.ResourceData, meta interface{}) er } func resourceIBMResourceGroupDelete(d *schema.ResourceData, meta interface{}) error { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return err } @@ -221,7 +222,7 @@ func resourceIBMResourceGroupDelete(d *schema.ResourceData, meta interface{}) er log.Printf("[WARN] Resource Group is not found") return nil } - return fmt.Errorf("Error Deleting resource group: %s with response code %s", err, resp) + return fmt.Errorf("[ERROR] Error Deleting resource group: %s with response code %s", err, resp) } d.SetId("") @@ -230,7 +231,7 @@ func resourceIBMResourceGroupDelete(d *schema.ResourceData, meta interface{}) er } func resourceIBMResourceGroupExists(d *schema.ResourceData, meta interface{}) (bool, error) { - rMgtClient, err := meta.(ClientSession).ResourceManagerV2API() + rMgtClient, err := meta.(conns.ClientSession).ResourceManagerV2API() if err != nil { return false, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/README.md new file mode 100644 index 0000000000..2dc6c8d1bf --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Satellite + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Satellite resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/satellite_location) +* IBM API Docs: [IBM API Docs for Satellite](https://containers.cloud.ibm.com/global/swagger-global-api/) +* IBM Satellite SDK: [IBM SDK for Satellite](https://github.com/IBM-Cloud/container-services-go-sdk) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster.go index 098b5e2202..ba4ed75473 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "fmt" @@ -9,10 +9,16 @@ import ( "strings" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSatelliteCluster() *schema.Resource { +const ( + _OPENSHIFT = "_openshift" +) + +func DataSourceIBMSatelliteCluster() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMSatelliteClusterRead, @@ -157,7 +163,7 @@ func dataSourceIBMSatelliteCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -182,7 +188,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) resourceGrp = v.(string) } - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -195,7 +201,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) clusterFields, response, err := satClient.GetCluster(getSatClusterOptions) if err != nil { - return fmt.Errorf("Error retrieving cluster: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error retrieving cluster: %s\n%s", err, response) } getWorkersOptions := &kubernetesserviceapiv1.GetWorkers1Options{} @@ -205,7 +211,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) } workerFields, response, err := satClient.GetWorkers1(getWorkersOptions) if err != nil { - return fmt.Errorf("Error retrieving workers for satellite cluster: %s", err) + return fmt.Errorf("[ERROR] Error retrieving workers for satellite cluster: %s, %s", err, response) } workers := make([]string, len(workerFields)) for i, worker := range workerFields { @@ -224,7 +230,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) workerPools, response, err := satClient.GetWorkerPools1(getSatWorkerPoolOptions) if err != nil { - return fmt.Errorf("Error retrieving worker pools of the cluster %s: %s\n%s", name, err, response) + return fmt.Errorf("[ERROR] Error retrieving worker pools of the cluster %s: %s\n%s", name, err, response) } d.SetId(*clusterFields.ID) @@ -236,7 +242,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) d.Set("status", *clusterFields.Status) d.Set("workers", workers) - d.Set("worker_pools", flattenSatelliteWorkerPools(workerPools)) + d.Set("worker_pools", flex.FlattenSatelliteWorkerPools(workerPools)) if clusterFields.ServiceEndpoints != nil { d.Set("public_service_endpoint", *clusterFields.ServiceEndpoints.PublicServiceEndpointEnabled) @@ -251,7 +257,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) d.Set("ingress_secret", *clusterFields.Ingress.SecretName) } d.Set("resource_group_id", *clusterFields.ResourceGroup) - d.Set(ResourceGroupName, *clusterFields.ResourceGroupName) + d.Set(flex.ResourceGroupName, *clusterFields.ResourceGroupName) if clusterFields.Lifecycle != nil { d.Set("health", *clusterFields.Lifecycle.MasterHealth) @@ -263,7 +269,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) d.Set("kube_version", strings.Split(*clusterFields.MasterKubeVersion, "_")[0]) } - tags, err := GetTagsUsingCRN(meta, *clusterFields.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *clusterFields.Crn) if err != nil { log.Printf( "An error occured during reading of instance (%s) tags : %s", d.Id(), err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster_worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster_worker_pool.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster_worker_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster_worker_pool.go index a422b2d6a7..519e04771f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster_worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster_worker_pool.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "fmt" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSatelliteClusterWorkerPool() *schema.Resource { +func DataSourceIBMSatelliteClusterWorkerPool() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMSatelliteClusterWorkerPoolRead, Schema: map[string]*schema.Schema{ @@ -104,7 +105,7 @@ func dataSourceIBMSatelliteClusterWorkerPoolRead(d *schema.ResourceData, meta in cluster = v.(string) } - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -125,7 +126,7 @@ func dataSourceIBMSatelliteClusterWorkerPoolRead(d *schema.ResourceData, meta in workerPool, response, err := satClient.GetWorkerPool(getSatWorkerPoolOptions) if err != nil { - return fmt.Errorf("Error retrieving worker pool %s: %s\n%s", name, err, response) + return fmt.Errorf("[ERROR] Error retrieving worker pool %s: %s\n%s", name, err, response) } var zones = make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster_worker_pool_zone_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster_worker_pool_zone_attachment.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster_worker_pool_zone_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster_worker_pool_zone_attachment.go index ec18a09244..556b0a32c5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_cluster_worker_pool_zone_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_cluster_worker_pool_zone_attachment.go @@ -1,4 +1,4 @@ -package ibm +package satellite import ( "context" @@ -6,41 +6,42 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSatelliteClusterWorkerPoolAttachment() *schema.Resource { +func DataSourceIBMSatelliteClusterWorkerPoolAttachment() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSatelliteClusterWorkerPoolAttachmentRead, Schema: map[string]*schema.Schema{ - "cluster": &schema.Schema{ + "cluster": { Type: schema.TypeString, Required: true, Description: "Name or id of the cluster", }, - "worker_pool": &schema.Schema{ + "worker_pool": { Type: schema.TypeString, Required: true, Description: "worker pool name", }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Required: true, Description: "worker pool zone name", }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Optional: true, Description: "The ID of the resource group that the Satellite location is in. To list the resource group ID of the location, use the `GET /v2/satellite/getController` API method.", }, - "worker_count": &schema.Schema{ + "worker_count": { Type: schema.TypeInt, Computed: true, Description: "Number of workers", }, - "autobalance_enabled": &schema.Schema{ + "autobalance_enabled": { Type: schema.TypeBool, Computed: true, Description: "Auto enabled status", @@ -56,7 +57,7 @@ func dataSourceIBMSatelliteClusterWorkerPoolAttachment() *schema.Resource { } func dataSourceIBMSatelliteClusterWorkerPoolAttachmentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_endpoint.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_endpoint.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_endpoint.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_endpoint.go index 0139e18357..6a9709929d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_endpoint.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_endpoint.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -9,106 +9,107 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIbmSatelliteEndpoint() *schema.Resource { +func DataSourceIBMSatelliteEndpoint() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmSatelliteEndpointRead, Schema: map[string]*schema.Schema{ - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Required: true, Description: "The Location ID.", }, - "endpoint_id": &schema.Schema{ + "endpoint_id": { Type: schema.TypeString, Required: true, Description: "The Endpoint ID.", }, - "connection_type": &schema.Schema{ + "connection_type": { Type: schema.TypeString, Computed: true, Description: "The type of the endpoint.", }, - "display_name": &schema.Schema{ + "display_name": { Type: schema.TypeString, Computed: true, Description: "The display name of the endpoint. Endpoint names must start with a letter and end with an alphanumeric character, can contain letters, numbers, and hyphen (-), and must be 63 characters or fewer.", }, - "server_host": &schema.Schema{ + "server_host": { Type: schema.TypeString, Computed: true, Description: "The host name or IP address of the server endpoint. For 'http-tunnel' protocol, server_host can start with '*.' , which means a wildcard to it's sub domains. Such as '*.example.com' can accept request to 'api.example.com' and 'www.example.com'.", }, - "server_port": &schema.Schema{ + "server_port": { Type: schema.TypeInt, Computed: true, Description: "The port number of the server endpoint. For 'http-tunnel' protocol, server_port can be 0, which means any port. Such as 0 is good for 80 (http) and 443 (https).", }, - "sni": &schema.Schema{ + "sni": { Type: schema.TypeString, Computed: true, Description: "The server name indicator (SNI) which used to connect to the server endpoint. Only useful if server side requires SNI.", }, - "client_protocol": &schema.Schema{ + "client_protocol": { Type: schema.TypeString, Computed: true, Description: "The protocol in the client application side.", }, - "client_mutual_auth": &schema.Schema{ + "client_mutual_auth": { Type: schema.TypeBool, Computed: true, Description: "Whether enable mutual auth in the client application side, when client_protocol is 'tls' or 'https', this field is required.", }, - "server_protocol": &schema.Schema{ + "server_protocol": { Type: schema.TypeString, Computed: true, Description: "The protocol in the server application side. This parameter will change to default value if it is omitted even when using PATCH API. If client_protocol is 'udp', server_protocol must be 'udp'. If client_protocol is 'tcp'/'http', server_protocol could be 'tcp'/'tls' and default to 'tcp'. If client_protocol is 'tls'/'https', server_protocol could be 'tcp'/'tls' and default to 'tls'. If client_protocol is 'http-tunnel', server_protocol must be 'tcp'.", }, - "server_mutual_auth": &schema.Schema{ + "server_mutual_auth": { Type: schema.TypeBool, Computed: true, Description: "Whether enable mutual auth in the server application side, when client_protocol is 'tls', this field is required.", }, - "reject_unauth": &schema.Schema{ + "reject_unauth": { Type: schema.TypeBool, Computed: true, Description: "Whether reject any connection to the server application which is not authorized with the list of supplied CAs in the fields certs.server_cert.", }, - "timeout": &schema.Schema{ + "timeout": { Type: schema.TypeInt, Computed: true, Description: "The inactivity timeout in the Endpoint side.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The service or person who created the endpoint. Must be 1000 characters or fewer.", }, - "sources": &schema.Schema{ + "sources": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "source_id": &schema.Schema{ + "source_id": { Type: schema.TypeString, Computed: true, Description: "The Source ID.", }, - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "Whether the source is enabled for the endpoint.", }, - "last_change": &schema.Schema{ + "last_change": { Type: schema.TypeString, Computed: true, Description: "The last time modify the Endpoint configurations.", }, - "pending": &schema.Schema{ + "pending": { Type: schema.TypeBool, Computed: true, Description: "Whether the source has been enabled on this endpoint.", @@ -116,51 +117,51 @@ func dataSourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "connector_port": &schema.Schema{ + "connector_port": { Type: schema.TypeInt, Computed: true, Description: "The connector port.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Service instance associated with this location.", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Computed: true, Description: "The service name of the endpoint.", }, - "client_host": &schema.Schema{ + "client_host": { Type: schema.TypeString, Computed: true, Description: "The hostname which Satellite Link server listen on for the on-location endpoint, or the hostname which the connector server listen on for the on-cloud endpoint destiantion.", }, - "client_port": &schema.Schema{ + "client_port": { Type: schema.TypeInt, Computed: true, Description: "The port which Satellite Link server listen on for the on-location, or the port which the connector server listen on for the on-cloud endpoint destiantion.", }, - "certs": &schema.Schema{ + "certs": { Type: schema.TypeList, //MaxItems: 1, Computed: true, Description: "The certs. Once it is generated, this field will always be defined even it is unused until the cert/key is deleted.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "client": &schema.Schema{ + "client": { Type: schema.TypeList, Computed: true, Description: "The CA which Satellite Link trust when receiving the connection from the client application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cert": &schema.Schema{ + "cert": { Type: schema.TypeList, Computed: true, Description: "The root cert or the self-signed cert of the client application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Computed: true, Description: "The filename of the cert.", @@ -171,19 +172,19 @@ func dataSourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "server": &schema.Schema{ + "server": { Type: schema.TypeList, Computed: true, Description: "The CA which Satellite Link trust when sending the connection to server application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cert": &schema.Schema{ + "cert": { Type: schema.TypeList, Computed: true, Description: "The root cert or the self-signed cert of the server application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Computed: true, Description: "The filename of the cert.", @@ -194,19 +195,19 @@ func dataSourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "connector": &schema.Schema{ + "connector": { Type: schema.TypeList, Computed: true, Description: "The cert which Satellite Link connector provide to identify itself for connecting to the client/server application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cert": &schema.Schema{ + "cert": { Type: schema.TypeList, Computed: true, Description: "The end-entity cert of the connector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Computed: true, Description: "The filename of the cert.", @@ -214,13 +215,13 @@ func dataSourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "key": &schema.Schema{ + "key": { Type: schema.TypeList, Computed: true, Description: "The private key of the connector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Computed: true, Description: "The name of the key.", @@ -234,70 +235,70 @@ func dataSourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "Whether the Endpoint is active or not.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time when the Endpoint is created.", }, - "last_change": &schema.Schema{ + "last_change": { Type: schema.TypeString, Computed: true, Description: "The last time modify the Endpoint configurations.", }, - "performance": &schema.Schema{ + "performance": { Type: schema.TypeList, //MaxItems: 1, Computed: true, Description: "The last performance data of the endpoint.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "connection": &schema.Schema{ + "connection": { Type: schema.TypeInt, Computed: true, Description: "Concurrent connections number of moment when probe read the data.", }, - "rx_bandwidth": &schema.Schema{ + "rx_bandwidth": { Type: schema.TypeInt, Computed: true, Description: "Average Receive (to Cloud) Bandwidth of last two minutes, unit is Byte/s.", }, - "tx_bandwidth": &schema.Schema{ + "tx_bandwidth": { Type: schema.TypeInt, Computed: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes, unit is Byte/s.", }, - "bandwidth": &schema.Schema{ + "bandwidth": { Type: schema.TypeInt, Computed: true, Description: "Average Tatal Bandwidth of last two minutes, unit is Byte/s.", }, - "connectors": &schema.Schema{ + "connectors": { Type: schema.TypeList, Computed: true, Description: "The last performance data of the endpoint from each Connector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "connector": &schema.Schema{ + "connector": { Type: schema.TypeString, Computed: true, Description: "The name of the connector reported the performance data.", }, - "connections": &schema.Schema{ + "connections": { Type: schema.TypeInt, Computed: true, Description: "Concurrent connections number of moment when probe read the data from the Connector.", }, - "rx_bw": &schema.Schema{ + "rx_bw": { Type: schema.TypeInt, Computed: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", }, - "tx_bw": &schema.Schema{ + "tx_bw": { Type: schema.TypeInt, Computed: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", @@ -313,7 +314,7 @@ func dataSourceIbmSatelliteEndpoint() *schema.Resource { } func dataSourceIbmSatelliteEndpointRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } @@ -331,84 +332,84 @@ func dataSourceIbmSatelliteEndpointRead(context context.Context, d *schema.Resou d.SetId(fmt.Sprintf("%s/%s", *endpoint.LocationID, *endpoint.EndpointID)) if err = d.Set("connection_type", endpoint.ConnType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting connection_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting connection_type: %s", err)) } if err = d.Set("display_name", endpoint.DisplayName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting display_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting display_name: %s", err)) } if err = d.Set("server_host", endpoint.ServerHost); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_host: %s", err)) } if err = d.Set("server_port", endpoint.ServerPort); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_port: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_port: %s", err)) } if err = d.Set("sni", endpoint.Sni); err != nil { - return diag.FromErr(fmt.Errorf("Error setting sni: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sni: %s", err)) } if err = d.Set("client_protocol", endpoint.ClientProtocol); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_protocol: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_protocol: %s", err)) } if err = d.Set("client_mutual_auth", endpoint.ClientMutualAuth); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_mutual_auth: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_mutual_auth: %s", err)) } if err = d.Set("server_protocol", endpoint.ServerProtocol); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_protocol: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_protocol: %s", err)) } if err = d.Set("server_mutual_auth", endpoint.ServerMutualAuth); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_mutual_auth: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_mutual_auth: %s", err)) } if err = d.Set("reject_unauth", endpoint.RejectUnauth); err != nil { - return diag.FromErr(fmt.Errorf("Error setting reject_unauth: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting reject_unauth: %s", err)) } if err = d.Set("timeout", endpoint.Timeout); err != nil { - return diag.FromErr(fmt.Errorf("Error setting timeout: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting timeout: %s", err)) } if err = d.Set("created_by", endpoint.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if endpoint.Sources != nil { err = d.Set("sources", dataSourceEndpointFlattenSources(endpoint.Sources)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting sources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sources %s", err)) } } if err = d.Set("connector_port", endpoint.ConnectorPort); err != nil { - return diag.FromErr(fmt.Errorf("Error setting connector_port: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting connector_port: %s", err)) } if err = d.Set("crn", endpoint.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("service_name", endpoint.ServiceName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting service_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting service_name: %s", err)) } if err = d.Set("client_host", endpoint.ClientHost); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_host: %s", err)) } if err = d.Set("client_port", endpoint.ClientPort); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_port: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_port: %s", err)) } if endpoint.Certs != nil { err = d.Set("certs", dataSourceEndpointFlattenCerts(*endpoint.Certs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting certs %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting certs %s", err)) } } if err = d.Set("status", endpoint.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if err = d.Set("created_at", endpoint.CreatedAt); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("last_change", endpoint.LastChange); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_change: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_change: %s", err)) } if endpoint.Performance != nil { err = d.Set("performance", dataSourceEndpointFlattenPerformance(*endpoint.Performance)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting performance %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting performance %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_host_script.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_host_script.go new file mode 100644 index 0000000000..4de71a9496 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_host_script.go @@ -0,0 +1,193 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package satellite + +import ( + "fmt" + "io/ioutil" + "log" + "path/filepath" + "strings" + "time" + + "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + homedir "github.com/mitchellh/go-homedir" +) + +func DataSourceIBMSatelliteAttachHostScript() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMSatelliteAttachHostScriptRead, + + Schema: map[string]*schema.Schema{ + "location": { + Type: schema.TypeString, + Required: true, + Description: "A unique name for the new Satellite location", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "A unique name for the new Satellite location", + }, + "labels": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "List of labels for the attach host", + }, + "host_provider": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"host_provider", "custom_script"}, + }, + "script_dir": { + Description: "The directory where the satellite attach host script to be downloaded. Default is home directory", + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "script_path": { + Description: "The absolute path to the generated host script file", + Type: schema.TypeString, + Computed: true, + }, + "host_script": { + Type: schema.TypeString, + Computed: true, + Description: "Attach host script content", + }, + "custom_script": { + Description: "The custom script that has to be appended to generated host script file", + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"host_provider", "custom_script"}, + }, + }, + } +} + +func dataSourceIBMSatelliteAttachHostScriptRead(d *schema.ResourceData, meta interface{}) error { + var scriptDir string + location := d.Get("location").(string) + hostProvider := d.Get("host_provider").(string) + + if _, ok := d.GetOk("script_dir"); ok { + scriptDir = d.Get("script_dir").(string) + } + + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() + if err != nil { + return err + } + + var locData *kubernetesserviceapiv1.MultishiftGetController + var response *core.DetailedResponse + getSatLocOptions := &kubernetesserviceapiv1.GetSatelliteLocationOptions{ + Controller: &location, + } + + err = resource.Retry(1*time.Minute, func() *resource.RetryError { + locData, response, err = satClient.GetSatelliteLocation(getSatLocOptions) + if err != nil || locData == nil { + if response != nil && response.StatusCode == 404 { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + + if conns.IsResourceTimeoutError(err) { + locData, response, err = satClient.GetSatelliteLocation(getSatLocOptions) + } + if err != nil || locData == nil { + return fmt.Errorf("[ERROR] Error getting Satellite location (%s): %s\n%s", location, err, response) + } + + // script labels + labels := make(map[string]string) + if v, ok := d.GetOk("labels"); ok { + l := v.(*schema.Set) + labels = flex.FlattenHostLabels(l.List()) + d.Set("labels", l) + } + + if len(scriptDir) == 0 { + scriptDir, err = homedir.Dir() + if err != nil { + return fmt.Errorf("[ERROR] Error fetching homedir: %s", err) + } + } + scriptDir, _ = filepath.Abs(scriptDir) + scriptPath := filepath.Join(scriptDir, "addHost.sh") + + //Generate script + createRegOptions := &kubernetesserviceapiv1.AttachSatelliteHostOptions{} + createRegOptions.Controller = locData.ID + createRegOptions.Labels = labels + + resp, err := satClient.AttachSatelliteHost(createRegOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Generating Satellite Registration Script: %s\n%s", err, resp) + } + + lines := strings.Split(string(resp), "\n") + for i, line := range lines { + if strings.Contains(line, "API_URL=") { + i = i + 1 + if script, ok := d.GetOk("custom_script"); ok { + lines[i] = script.(string) + } else { + if strings.ToLower(hostProvider) == "aws" { + lines[i] = "yum update -y\nyum-config-manager --enable '*'\nyum repolist all\nyum install container-selinux -y" + } else if strings.ToLower(hostProvider) == "ibm" { + lines[i] = `subscription-manager refresh +subscription-manager repos --enable rhel-server-rhscl-7-rpms +subscription-manager repos --enable rhel-7-server-optional-rpms +subscription-manager repos --enable rhel-7-server-rh-common-rpms +subscription-manager repos --enable rhel-7-server-supplementary-rpms +subscription-manager repos --enable rhel-7-server-extras-rpms` + } else if strings.ToLower(hostProvider) == "azure" { + lines[i] = fmt.Sprintf(`yum update --disablerepo=* --enablerepo="*microsoft*" -y +yum-config-manager --enable '*' +yum repolist all +yum install container-selinux -y + `) + } else if strings.ToLower(hostProvider) == "google" { + lines[i] = fmt.Sprintf(`yum update --disablerepo=* --enablerepo="*" -y +yum repolist all +yum install container-selinux -y +yum install subscription-manager -y + `) + } else { + lines[i] = "subscription-manager refresh\nyum update -y\n" + } + } + + } + } + + scriptContent := strings.Join(lines, "\n") + err = ioutil.WriteFile(scriptPath, []byte(scriptContent), 0644) + if err != nil { + return fmt.Errorf("[ERROR] Error Creating Satellite Attach Host Script: %s", err) + } + + d.Set("location", location) + d.Set("host_script", scriptContent) + d.Set("host_provider", hostProvider) + d.Set("script_dir", scriptDir) + d.Set("script_path", scriptPath) + d.SetId(*locData.ID) + + log.Printf("[INFO] Generated satellite location script : %s", *locData.Name) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_link.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_link.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_link.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_link.go index 3f255634ee..e62fbe37ff 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_link.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_link.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -9,114 +9,115 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIbmSatelliteLink() *schema.Resource { +func DataSourceIBMSatelliteLink() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmSatelliteLinkRead, Schema: map[string]*schema.Schema{ - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Required: true, Description: "The Location ID.", }, - "ws_endpoint": &schema.Schema{ + "ws_endpoint": { Type: schema.TypeString, Computed: true, Description: "The ws endpoint of the location.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Service instance associated with this location.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the location.", }, - "satellite_link_host": &schema.Schema{ + "satellite_link_host": { Type: schema.TypeString, Computed: true, Description: "Satellite Link hostname of the location.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "Enabled/Disabled.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Timestamp of creation of location.", }, - "last_change": &schema.Schema{ + "last_change": { Type: schema.TypeString, Computed: true, Description: "Timestamp of latest modification of location.", }, - "performance": &schema.Schema{ + "performance": { Type: schema.TypeList, //MaxItems: 1, Computed: true, Description: "The last performance data of the Location.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "tunnels": &schema.Schema{ + "tunnels": { Type: schema.TypeInt, Computed: true, Description: "Tunnels number estbalished from the Location.", }, - "health_status": &schema.Schema{ + "health_status": { Type: schema.TypeString, Computed: true, Description: "Tunnels health status based on the Tunnels number established. Down(0)/Critical(1)/Up(>=2).", }, - "avg_latency": &schema.Schema{ + "avg_latency": { Type: schema.TypeInt, Computed: true, Description: "Average latency calculated form latency of each Connector between Tunnel Server, unit is ms. -1 means no Connector established Tunnel.", }, - "rx_bandwidth": &schema.Schema{ + "rx_bandwidth": { Type: schema.TypeInt, Computed: true, Description: "Average Receive (to Cloud) Bandwidth of last two minutes, unit is Byte/s.", }, - "tx_bandwidth": &schema.Schema{ + "tx_bandwidth": { Type: schema.TypeInt, Computed: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes, unit is Byte/s.", }, - "bandwidth": &schema.Schema{ + "bandwidth": { Type: schema.TypeInt, Computed: true, Description: "Average Tatal Bandwidth of last two minutes, unit is Byte/s.", }, - "connectors": &schema.Schema{ + "connectors": { Type: schema.TypeList, Computed: true, Description: "The last performance data of the Location read from each Connector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "connector": &schema.Schema{ + "connector": { Type: schema.TypeString, Computed: true, Description: "The name of the connector reported the performance data.", }, - "latency": &schema.Schema{ + "latency": { Type: schema.TypeInt, Computed: true, Description: "Latency between Connector and the Tunnel Server it connected.", }, - "rx_bw": &schema.Schema{ + "rx_bw": { Type: schema.TypeInt, Computed: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", }, - "tx_bw": &schema.Schema{ + "tx_bw": { Type: schema.TypeInt, Computed: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", @@ -132,7 +133,7 @@ func dataSourceIbmSatelliteLink() *schema.Resource { } func dataSourceIbmSatelliteLinkRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } @@ -149,31 +150,31 @@ func dataSourceIbmSatelliteLinkRead(context context.Context, d *schema.ResourceD d.SetId(*location.LocationID) if err = d.Set("ws_endpoint", location.WsEndpoint); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ws_endpoint: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ws_endpoint: %s", err)) } if err = d.Set("crn", location.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("description", location.Desc); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("satellite_link_host", location.SatelliteLinkHost); err != nil { - return diag.FromErr(fmt.Errorf("Error setting satellite_link_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting satellite_link_host: %s", err)) } if err = d.Set("status", location.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if err = d.Set("created_at", location.CreatedAt); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("last_change", location.LastChange); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_change: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_change: %s", err)) } if location.Performance != nil { err = d.Set("performance", dataSourceLocationFlattenPerformance(*location.Performance)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting performance %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting performance %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_location.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_location.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_location.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_location.go index a0b740b955..e281bd1b27 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_location.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_location.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "fmt" @@ -9,12 +9,14 @@ import ( "time" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSatelliteLocation() *schema.Resource { +func DataSourceIBMSatelliteLocation() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMSatelliteLocationRead, @@ -56,7 +58,7 @@ func dataSourceIBMSatelliteLocation() *schema.Resource { Computed: true, Description: "ID of the resource group", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "Name of the resource group", @@ -65,7 +67,7 @@ func dataSourceIBMSatelliteLocation() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, }, "host_attached_count": { Type: schema.TypeInt, @@ -138,7 +140,7 @@ func dataSourceIBMSatelliteLocation() *schema.Resource { func dataSourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{}) error { location := d.Get("location").(string) - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -160,11 +162,11 @@ func dataSourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{} return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { instance, response, err = satClient.GetSatelliteLocation(getSatLocOptions) } if err != nil || instance == nil { - return fmt.Errorf("Error retrieving IBM cloud satellite location %s : %s\n%s", location, err, response) + return fmt.Errorf("[ERROR] Error retrieving IBM cloud satellite location %s : %s\n%s", location, err, response) } d.SetId(*instance.ID) @@ -174,7 +176,7 @@ func dataSourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{} d.Set("managed_from", *instance.Datacenter) d.Set("crn", *instance.Crn) d.Set("resource_group_id", *instance.ResourceGroup) - d.Set(ResourceGroupName, *instance.ResourceGroupName) + d.Set(flex.ResourceGroupName, *instance.ResourceGroupName) d.Set("created_on", *instance.CreatedDate) if instance.Hosts != nil { d.Set("host_attached_count", *instance.Hosts.Total) @@ -192,13 +194,13 @@ func dataSourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{} hostList, response, err := satClient.GetSatelliteHosts(getSatHostOptions) if err != nil { - return fmt.Errorf("Error retrieving location hosts %s : %s\n%s", location, err, response) + return fmt.Errorf("[ERROR] Error retrieving location hosts %s : %s\n%s", location, err, response) } if hostList != nil { - d.Set("hosts", flattenSatelliteHosts(hostList)) + d.Set("hosts", flex.FlattenSatelliteHosts(hostList)) } - tags, err := GetTagsUsingCRN(meta, *instance.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *instance.Crn) if err != nil { log.Printf( "An error occured during reading of instance (%s) tags : %s", d.Id(), err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_location_nlb_dns.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_location_nlb_dns.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_location_nlb_dns.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_location_nlb_dns.go index 2c8e2eed4c..6e01b30b2f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_satellite_location_nlb_dns.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_location_nlb_dns.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSatelliteLocationNLBDNS() *schema.Resource { +func DataSourceIBMSatelliteLocationNLBDNS() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSatelliteLocationNLBDNSRead, @@ -84,7 +86,7 @@ func dataSourceIBMSatelliteLocationNLBDNSRead(context context.Context, d *schema location := d.Get("location").(string) - satClient, err := meta.(ClientSession).VpcContainerAPI() + satClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } @@ -95,6 +97,6 @@ func dataSourceIBMSatelliteLocationNLBDNSRead(context context.Context, d *schema } d.SetId(location) d.Set("location", location) - d.Set("nlb_config", flattenNlbConfigs(nlbData)) + d.Set("nlb_config", flex.FlattenNlbConfigs(nlbData)) return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster.go index 6403984b93..156c0f5802 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -13,6 +13,9 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -32,7 +35,7 @@ const ( isWorkerDeployed = "deployed" ) -func resourceIBMSatelliteCluster() *schema.Resource { +func ResourceIBMSatelliteCluster() *schema.Resource { return &schema.Resource{ Create: resourceIBMSatelliteClusterCreate, Read: resourceIBMSatelliteClusterRead, @@ -41,7 +44,7 @@ func resourceIBMSatelliteCluster() *schema.Resource { Importer: &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { ID := d.Id() - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return nil, err } @@ -57,17 +60,17 @@ func resourceIBMSatelliteCluster() *schema.Resource { return nil, fmt.Errorf("Error reading satellite cluster: %s", err) } - d.Set("zones", flattenSatelliteClusterZones(cluster.LocationZones)) + d.Set("zones", flex.FlattenSatelliteClusterZones(cluster.LocationZones)) return []*schema.ResourceData{d}, nil }, }, CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return immutableResourceCustomizeDiff([]string{"name", "location", "resource_group_id", "crn_token"}, diff) + return flex.ImmutableResourceCustomizeDiff([]string{"name", "location", "resource_group_id", "crn_token"}, diff) }, func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -194,7 +197,7 @@ func resourceIBMSatelliteCluster() *schema.Resource { Computed: true, Description: "ID of the resource group.", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -239,8 +242,8 @@ func resourceIBMSatelliteCluster() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_satellite_cluster", "tags")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_satellite_cluster", "tags")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags for the resources", }, "host_labels": { @@ -248,7 +251,7 @@ func resourceIBMSatelliteCluster() *schema.Resource { Optional: true, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Labels that describe a Satellite host for default workerpool", }, "crn_token": { @@ -261,26 +264,26 @@ func resourceIBMSatelliteCluster() *schema.Resource { } } -func resourceIBMSatelliteClusterValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMSatelliteClusterValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tags", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmSatelliteClusteresourceValidator := ResourceValidator{ResourceName: "ibm_satellite_cluster", Schema: validateSchema} + ibmSatelliteClusteresourceValidator := validate.ResourceValidator{ResourceName: "ibm_satellite_cluster", Schema: validateSchema} return &ibmSatelliteClusteresourceValidator } func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) error { var resourceGrp, clusterId string pathParamsMap := make(map[string]string) - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -307,11 +310,10 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) //Wait for location to get normal _, ok := d.GetOk("crn_token") - if ok == false { + if !ok { _, err = waitForLocationNormal(location, d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for getting location (%s) to be normal: %s", location, err) + return fmt.Errorf("[ERROR] Error waiting for getting location (%s) to be normal: %s", location, err) } } @@ -360,7 +362,7 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) if v, ok := d.GetOk("host_labels"); ok { hostLabels := make(map[string]string) hl := v.(*schema.Set) - hostLabels = flattenHostLabels(hl.List()) + hostLabels = flex.FlattenHostLabels(hl.List()) createClusterOptions.Labels = hostLabels } @@ -372,14 +374,14 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) instance, response, err := satClient.CreateSatelliteClusterRemote(createRemoteClusterOptions) if err != nil { - return fmt.Errorf("Error Creating Satellite Cluster for remote location: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Satellite Cluster for remote location: %s\n%s", err, response) } clusterId = *instance.ID log.Printf("[INFO] Created ROKS Satellite Cluster for remote location: %s", clusterId) } else { instance, response, err := satClient.CreateSatelliteCluster(createClusterOptions) if err != nil { - return fmt.Errorf("Error Creating Satellite Cluster: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Satellite Cluster: %s\n%s", err, response) } clusterId = *instance.ID log.Printf("[INFO] Created ROKS Satellite Cluster : %s", clusterId) @@ -407,14 +409,13 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) response, err := satClient.CreateSatelliteWorkerPoolZone(zoneOptions) if err != nil { - return fmt.Errorf("Error Adding Worker Pool Zone : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Adding Worker Pool Zone : %s\n%s", err, response) } } } _, err = WaitForSatelliteWorkerPoolAvailable(d, meta, clusterId, workerPoolName, d.Timeout(schema.TimeoutCreate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for default workerpool (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for default workerpool (%s) to become ready: %s", d.Id(), err) } } } @@ -436,15 +437,14 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) response, err := satClient.V2SetWorkerPoolLabels(wpots) if err != nil { - return fmt.Errorf( - "Error updating the labels: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating the labels: %s\n%s", err, response) } } v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk("tags"); ok || v != "" { getSatClusterOptions := &kubernetesserviceapiv1.GetClusterOptions{ - Cluster: ptrToString(clusterId), + Cluster: flex.PtrToString(clusterId), } cluster, response, err := satClient.GetCluster(getSatClusterOptions) @@ -454,7 +454,7 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) } oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *cluster.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *cluster.Crn) if err != nil { log.Printf( "Error on create of ibm satellite location (%s) tags: %s", d.Id(), err) @@ -464,8 +464,7 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) //Wait for cluster to get warning state _, err = waitForClusterToReady(clusterId, d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for getting cluster (%s) to be warning state: %s", clusterId, err) + return fmt.Errorf("[ERROR] Error waiting for getting cluster (%s) to be warning state: %s", clusterId, err) } return resourceIBMSatelliteClusterRead(d, meta) @@ -473,7 +472,7 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{}) func resourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) error { ID := d.Id() - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -508,7 +507,7 @@ func resourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) e d.Set("ingress_secret", *cluster.Ingress.SecretName) } d.Set("resource_group_id", *cluster.ResourceGroup) - d.Set(ResourceGroupName, *cluster.ResourceGroupName) + d.Set(flex.ResourceGroupName, *cluster.ResourceGroupName) if cluster.ServiceEndpoints != nil { d.Set("public_service_endpoint_url", *cluster.ServiceEndpoints.PublicServiceEndpointURL) d.Set("private_service_endpoint_url", *cluster.ServiceEndpoints.PrivateServiceEndpointURL) @@ -534,14 +533,14 @@ func resourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) e "An error occured while retrieving default workerpool : %s\n%s", err, response) } - tags, err := GetTagsUsingCRN(meta, *cluster.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *cluster.Crn) if err != nil { log.Printf( "An error occured during reading of instance (%s) tags : %s", d.Id(), err) } d.Set("tags", tags) - d.Set("default_worker_pool_labels", IgnoreSystemLabels(workerPool.Labels)) - d.Set("host_labels", flattenWorkerPoolHostLabels(workerPool.HostLabels)) + d.Set("default_worker_pool_labels", flex.IgnoreSystemLabels(workerPool.Labels)) + d.Set("host_labels", flex.FlattenWorkerPoolHostLabels(workerPool.HostLabels)) return nil } @@ -550,12 +549,12 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) clusterID := d.Id() workerPoolName := "default" - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -584,18 +583,17 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) } _, err = WaitForSatelliteClusterVersionUpdate(d, meta, targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for cluster (%s) version to be updated: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for cluster (%s) version to be updated: %s", d.Id(), err) } } - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } workerOpts := satClient.NewGetWorkers1Options(clusterID) workerFields, response, err := satClient.GetWorkers1(workerOpts) if err != nil { - return fmt.Errorf("Error retrieving workerFields %s: %s", err, response) + return fmt.Errorf("[ERROR] Error retrieving workerFields %s: %s", err, response) } getSatClusterOptions := &kubernetesserviceapiv1.GetClusterOptions{ @@ -605,7 +603,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) cluster, response, err := satClient.GetCluster(getSatClusterOptions) if err != nil { - return fmt.Errorf("Error retrieving cluster %s: %s", clusterID, err) + return fmt.Errorf("[ERROR] Error retrieving cluster %s: %s, %s", clusterID, err, response) } waitForWorkerUpdate := d.Get("wait_for_worker_update").(bool) if workerFields != nil { @@ -618,7 +616,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) err = wrkAPI.Update(clusterID, *w.ID, params, targetEnv) if err != nil { d.Set("patch_version", nil) - return fmt.Errorf("Error updating worker %s: %s", *w.ID, err) + return fmt.Errorf("[ERROR] Error updating worker %s: %s", *w.ID, err) } } } @@ -627,8 +625,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) _, err = WaitForSatelliteWorkerVersionUpdate(d, meta, *cluster.MasterKubeVersion, targetEnv) if err != nil { d.Set("patch_version", nil) - return fmt.Errorf( - "Error waiting for workers of cluster (%s) to update kube version: %s", clusterID, err) + return fmt.Errorf("[ERROR] Error waiting for workers of cluster (%s) to update kube version: %s", clusterID, err) } } } @@ -645,8 +642,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) response, err := satClient.V2ResizeWorkerPool(resizeOpts) if err != nil { - return fmt.Errorf( - "Error updating the worker pool size %d: %s\n%s", workerCount, err, response) + return fmt.Errorf("[ERROR] Error updating the worker pool size %d: %s\n%s", workerCount, err, response) } } @@ -666,8 +662,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) } response, err := satClient.V2SetWorkerPoolLabels(wpots) if err != nil { - return fmt.Errorf( - "Error updating the labels: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating the labels: %s\n%s", err, response) } } @@ -681,9 +676,9 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) cluster, response, err := satClient.GetCluster(getSatClusterOptions) if err != nil { - return fmt.Errorf("Error retrieving cluster %s: %s\n%s", clusterID, err, response) + return fmt.Errorf("[ERROR] Error retrieving cluster %s: %s\n%s", clusterID, err, response) } - err = UpdateTagsUsingCRN(oldList, newList, meta, *cluster.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *cluster.Crn) if err != nil { log.Printf( "An error occured during update of instance (%s) tags: %s", clusterID, err) @@ -713,13 +708,12 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) } response, err := satClient.CreateSatelliteWorkerPoolZone(zoneOptions) if err != nil { - return fmt.Errorf("Error Adding Worker Pool Zone : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Adding Worker Pool Zone : %s\n%s", err, response) } } _, err = WaitForSatelliteWorkerPoolAvailable(d, meta, clusterID, workerPoolName, d.Timeout(schema.TimeoutUpdate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) } } if len(remove) > 0 { @@ -733,7 +727,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) } response, err := satClient.RemoveWorkerPoolZone(zoneOptions) if err != nil { - return fmt.Errorf("Error deleting Worker Pool Zone : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting Worker Pool Zone : %s\n%s", err, response) } } } @@ -743,7 +737,7 @@ func resourceIBMSatelliteClusterUpdate(d *schema.ResourceData, meta interface{}) } func resourceIBMSatelliteClusterDelete(d *schema.ResourceData, meta interface{}) error { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -754,14 +748,13 @@ func resourceIBMSatelliteClusterDelete(d *schema.ResourceData, meta interface{}) response, err := satClient.RemoveCluster(removeClusterOptions) if err != nil { - return fmt.Errorf("Error Creating Satellite Location: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Satellite Location: %s\n%s", err, response) } //Wait for cluster to get delete _, err = waitForClusterToDelete(name, d, meta) if err != nil { - return fmt.Errorf( - "Error waiting while deleteing cluster (%s) : %s", name, err) + return fmt.Errorf("[ERROR] Error waiting while deleteing cluster (%s) : %s", name, err) } log.Printf("[INFO] Deleted satellite cluster : %s", name) @@ -771,7 +764,7 @@ func resourceIBMSatelliteClusterDelete(d *schema.ResourceData, meta interface{}) } func waitForLocationNormal(location string, d *schema.ResourceData, meta interface{}) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return false, err } @@ -798,7 +791,7 @@ func waitForLocationNormal(location string, d *schema.ResourceData, meta interfa return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { instance, response, err = satClient.GetSatelliteLocation(getSatLocOptions) } @@ -819,7 +812,7 @@ func waitForLocationNormal(location string, d *schema.ResourceData, meta interfa } func waitForClusterToReady(cluster string, d *schema.ResourceData, meta interface{}) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return false, err } @@ -833,10 +826,10 @@ func waitForClusterToReady(cluster string, d *schema.ResourceData, meta interfac } instance, response, err := satClient.GetCluster(getClusterOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting cluster : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting cluster : %s\n%s", err, response) } if instance != nil && *instance.State == isCluterDeployFailed { - return instance, isCluterDeployFailed, fmt.Errorf("The cluster failed to deploy : %s", cluster) + return instance, isCluterDeployFailed, fmt.Errorf("[ERROR] The cluster failed to deploy : %s", cluster) } if instance != nil && (*instance.State == isClusterNormal || *instance.State == isClusterWarning) { @@ -853,7 +846,7 @@ func waitForClusterToReady(cluster string, d *schema.ResourceData, meta interfac } func waitForClusterToDelete(cluster string, d *schema.ResourceData, meta interface{}) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return false, err } @@ -884,7 +877,7 @@ func waitForClusterToDelete(cluster string, d *schema.ResourceData, meta interfa // WaitForSatelliteWorkerVersionUpdate Waits for worker creation func WaitForSatelliteWorkerVersionUpdate(d *schema.ResourceData, meta interface{}, masterVersion string, target v1.ClusterTargetHeader) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return nil, err } @@ -923,7 +916,7 @@ func WaitForSatelliteWorkerVersionUpdate(d *schema.ResourceData, meta interface{ // WaitForSatelliteClusterVersionUpdate Waits for cluster creation func WaitForSatelliteClusterVersionUpdate(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error) { - csClient, err := meta.(ClientSession).ContainerAPI() + csClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return nil, err } @@ -947,7 +940,7 @@ func satelliteClusterVersionRefreshFunc(client v1.Clusters, instanceID string, d return func() (interface{}, string, error) { clusterFields, err := client.FindWithOutShowResourcesCompatible(instanceID, target) if err != nil { - return nil, "", fmt.Errorf("Error retrieving satellite cluster: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error retrieving satellite cluster: %s", err) } // Check active transactions diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster_worker_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster_worker_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go index a5dccb76a3..0079135499 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster_worker_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "fmt" @@ -12,13 +12,30 @@ import ( v1 "github.com/IBM-Cloud/bluemix-go/api/container/containerv1" v2 "github.com/IBM-Cloud/bluemix-go/api/container/containerv2" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -const workerPoolDesired = "deployed" +const ( + workerPoolDesired = "deployed" + clusterNormal = "normal" + clusterDeletePending = "deleting" + clusterDeleted = "deleted" + workerNormal = "normal" + subnetNormal = "normal" + workerReadyState = "Ready" + workerDeleteState = "deleted" + workerDeletePending = "deleting" + + versionUpdating = "updating" + clusterProvisioning = "provisioning" + workerProvisioning = "provisioning" + subnetProvisioning = "provisioning" +) -func resourceIBMSatelliteClusterWorkerPool() *schema.Resource { +func ResourceIBMSatelliteClusterWorkerPool() *schema.Resource { return &schema.Resource{ Create: resourceIBMSatelliteClusterWorkerPoolCreate, Read: resourceIBMSatelliteClusterWorkerPoolRead, @@ -26,14 +43,14 @@ func resourceIBMSatelliteClusterWorkerPool() *schema.Resource { Delete: resourceIBMSatelliteClusterWorkerPoolDelete, Importer: &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return nil, err } clusterID := parts[0] workerPoolID := parts[1] - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return nil, err } @@ -128,7 +145,7 @@ func resourceIBMSatelliteClusterWorkerPool() *schema.Resource { Optional: true, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Labels that describe a Satellite host", }, "resource_group_id": { @@ -140,9 +157,31 @@ func resourceIBMSatelliteClusterWorkerPool() *schema.Resource { }, } } +func getClusterTargetHeader(d *schema.ResourceData, meta interface{}) (v1.ClusterTargetHeader, error) { + _, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return v1.ClusterTargetHeader{}, err + } + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return v1.ClusterTargetHeader{}, err + } + accountID := userDetails.UserAccount + + targetEnv := v1.ClusterTargetHeader{ + AccountID: accountID, + } + resourceGroup := "" + if v, ok := d.GetOk("resource_group_id"); ok { + resourceGroup = v.(string) + targetEnv.ResourceGroup = resourceGroup + } + return targetEnv, nil +} func resourceIBMSatelliteClusterWorkerPoolCreate(d *schema.ResourceData, meta interface{}) error { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -173,13 +212,13 @@ func resourceIBMSatelliteClusterWorkerPoolCreate(d *schema.ResourceData, meta in if v, ok := d.GetOk("zones"); ok { z := v.(*schema.Set) - createWorkerPoolOptions.Zones = flattenSatelliteWorkerPoolZones(z) + createWorkerPoolOptions.Zones = flex.FlattenSatelliteWorkerPoolZones(z) } hostLabels := make(map[string]string) if v, ok := d.GetOk("host_labels"); ok { hl := v.(*schema.Set) - hostLabels = flattenHostLabels(hl.List()) + hostLabels = flex.FlattenHostLabels(hl.List()) createWorkerPoolOptions.HostLabels = hostLabels } else { createWorkerPoolOptions.HostLabels = hostLabels @@ -212,7 +251,7 @@ func resourceIBMSatelliteClusterWorkerPoolCreate(d *schema.ResourceData, meta in instance, response, err := satClient.CreateSatelliteWorkerPool(createWorkerPoolOptions) if err != nil { - return fmt.Errorf("Error Creating Satellite cluster worker pool: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Satellite cluster worker pool: %s\n%s", err, response) } d.SetId(fmt.Sprintf("%s/%s", cluster, *instance.WorkerPoolID)) @@ -220,22 +259,21 @@ func resourceIBMSatelliteClusterWorkerPoolCreate(d *schema.ResourceData, meta in _, err = WaitForSatelliteWorkerPoolAvailable(d, meta, cluster, *instance.WorkerPoolID, d.Timeout(schema.TimeoutCreate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) } return resourceIBMSatelliteClusterWorkerPoolRead(d, meta) } func resourceIBMSatelliteClusterWorkerPoolRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } clusterID := parts[0] workerPoolID := parts[1] - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -259,21 +297,21 @@ func resourceIBMSatelliteClusterWorkerPoolRead(d *schema.ResourceData, meta inte d.Set("flavor", workerPool.Flavor) d.Set("isolation", workerPool.Isolation) d.Set("worker_count", workerPool.WorkerCount) - d.Set("worker_pool_labels", IgnoreSystemLabels(workerPool.Labels)) - d.Set("host_labels", flattenWorkerPoolHostLabels(workerPool.HostLabels)) + d.Set("worker_pool_labels", flex.IgnoreSystemLabels(workerPool.Labels)) + d.Set("host_labels", flex.FlattenWorkerPoolHostLabels(workerPool.HostLabels)) return nil } func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } clusterNameOrID := parts[0] workerPoolName := parts[1] - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -298,8 +336,7 @@ func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta in } response, err := satClient.V2SetWorkerPoolLabels(wpots) if err != nil { - return fmt.Errorf( - "Error updating the labels: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating the labels: %s\n%s", err, response) } } @@ -311,7 +348,7 @@ func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta in if err != nil { return err } - ClusterClient, err := meta.(ClientSession).ContainerAPI() + ClusterClient, err := meta.(conns.ClientSession).ContainerAPI() if err != nil { return err } @@ -319,8 +356,7 @@ func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta in err = ClusterClient.WorkerPools().ResizeWorkerPool(clusterNameOrID, workerPoolName, count, Env) if err != nil { - return fmt.Errorf( - "Error updating the worker_count %d: %s", count, err) + return fmt.Errorf("[ERROR] Error updating the worker_count %d: %s", count, err) } } @@ -350,13 +386,12 @@ func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta in } response, err := satClient.CreateSatelliteWorkerPoolZone(zoneOptions) if err != nil { - return fmt.Errorf("Error Adding Worker Pool Zone : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Adding Worker Pool Zone : %s\n%s", err, response) } } _, err = WaitForSatelliteWorkerPoolAvailable(d, meta, clusterID, workerPoolName, d.Timeout(schema.TimeoutCreate), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for workerpool (%s) to become ready: %s", d.Id(), err) } } if len(remove) > 0 { @@ -370,7 +405,7 @@ func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta in } response, err := satClient.RemoveWorkerPoolZone(zoneOptions) if err != nil { - return fmt.Errorf("Error deleting Worker Pool Zone : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting Worker Pool Zone : %s\n%s", err, response) } } } @@ -379,14 +414,14 @@ func resourceIBMSatelliteClusterWorkerPoolUpdate(d *schema.ResourceData, meta in } func resourceIBMSatelliteClusterWorkerPoolDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } clusterID := parts[0] workerPoolID := parts[1] - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -406,25 +441,34 @@ func resourceIBMSatelliteClusterWorkerPoolDelete(d *schema.ResourceData, meta in if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Deleting Satellite Cluster WorkerPool: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Satellite Cluster WorkerPool: %s\n%s", err, response) } _, err = WaitForSatelliteWorkerDelete(clusterID, workerPoolID, meta, d.Timeout(schema.TimeoutDelete), targetEnv) if err != nil { - return fmt.Errorf( - "Error waiting for removing workers of worker pool (%s) of cluster (%s): %s", workerPoolID, clusterID, err) + return fmt.Errorf("[ERROR] Error waiting for removing workers of worker pool (%s) of cluster (%s): %s", workerPoolID, clusterID, err) } d.SetId("") return nil } +func getVpcClusterTargetHeader(d *schema.ResourceData, meta interface{}) (v2.ClusterTargetHeader, error) { + targetEnv := v2.ClusterTargetHeader{} + var resourceGroup string + if rg, ok := d.GetOk("resource_group_id"); ok { + resourceGroup = rg.(string) + targetEnv.ResourceGroup = resourceGroup + } + + return targetEnv, nil +} // WaitForSatelliteWorkerPoolAvailable Waits for workerpool deployed func WaitForSatelliteWorkerPoolAvailable(d *schema.ResourceData, meta interface{}, clusterNameOrID, workerPoolNameOrID string, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error) { clusterID := clusterNameOrID workerPoolID := workerPoolNameOrID - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return nil, err } @@ -440,7 +484,7 @@ func WaitForSatelliteWorkerPoolAvailable(d *schema.ResourceData, meta interface{ workers, response, err := satClient.GetWorkers1(getWorkersOptions) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s\n%s", err, response) } //Check active transactions @@ -464,7 +508,7 @@ func WaitForSatelliteWorkerPoolAvailable(d *schema.ResourceData, meta interface{ } func WaitForSatelliteWorkerDelete(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return nil, err } @@ -492,7 +536,7 @@ func satelliteWorkerPoolDeleteStateRefreshFunc(satClient *kubernetesserviceapiv1 workerFields, response, err := satClient.GetWorkers1(getWorkersOptions) if err != nil { - return nil, "", fmt.Errorf("Error retrieving workers for cluster: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error retrieving workers for cluster: %s\n%s", err, response) } //Done worker has two fields desiredState and actualState , so check for those 2 for _, e := range workerFields { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster_worker_pool_zone_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_zone_attachment.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster_worker_pool_zone_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_zone_attachment.go index 566dac075c..cc90597605 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_cluster_worker_pool_zone_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_zone_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -9,11 +9,13 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIbmSatelliteClusterWorkerPoolZoneAttachment() *schema.Resource { +func ResourceIbmSatelliteClusterWorkerPoolZoneAttachment() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmSatelliteClusterWorkerPoolZoneAttachmentCreate, ReadContext: resourceIbmSatelliteClusterWorkerPoolZoneAttachmentRead, @@ -21,28 +23,28 @@ func resourceIbmSatelliteClusterWorkerPoolZoneAttachment() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "cluster": &schema.Schema{ + "cluster": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "worker_pool": &schema.Schema{ + "worker_pool": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Optional: true, ForceNew: true, Description: "The ID of the resource group that the Satellite location is in. To list the resource group ID of the location, use the `GET /v2/satellite/getController` API method.", }, - "autobalance_enabled": &schema.Schema{ + "autobalance_enabled": { Type: schema.TypeBool, Computed: true, }, @@ -62,7 +64,7 @@ func resourceIbmSatelliteClusterWorkerPoolZoneAttachment() *schema.Resource { } func resourceIbmSatelliteClusterWorkerPoolZoneAttachmentCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } @@ -91,12 +93,12 @@ func resourceIbmSatelliteClusterWorkerPoolZoneAttachmentCreate(context context.C } func resourceIbmSatelliteClusterWorkerPoolZoneAttachmentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } @@ -133,12 +135,12 @@ func resourceIbmSatelliteClusterWorkerPoolZoneAttachmentRead(context context.Con } func resourceIbmSatelliteClusterWorkerPoolZoneAttachmentDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return diag.FromErr(err) } - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_endpoint.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_endpoint.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_endpoint.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_endpoint.go index 47107b0b39..d35dbc7fb0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_endpoint.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_endpoint.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -9,13 +9,16 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" ) -func resourceIbmSatelliteEndpoint() *schema.Resource { +func ResourceIBMSatelliteEndpoint() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmSatelliteEndpointCreate, ReadContext: resourceIbmSatelliteEndpointRead, @@ -24,105 +27,105 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Required: true, Description: "The Location ID.", }, - "connection_type": &schema.Schema{ + "connection_type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_satellite_endpoint", "connection_type"), + ValidateFunc: validate.InvokeValidator("ibm_satellite_endpoint", "connection_type"), Description: "The type of the endpoint.", }, - "display_name": &schema.Schema{ + "display_name": { Type: schema.TypeString, Required: true, Description: "The display name of the endpoint. Endpoint names must start with a letter and end with an alphanumeric character, can contain letters, numbers, and hyphen (-), and must be 63 characters or fewer.", }, - "server_host": &schema.Schema{ + "server_host": { Type: schema.TypeString, Required: true, Description: "The host name or IP address of the server endpoint. For 'http-tunnel' protocol, server_host can start with '*.' , which means a wildcard to it's sub domains. Such as '*.example.com' can accept request to 'api.example.com' and 'www.example.com'.", }, - "server_port": &schema.Schema{ + "server_port": { Type: schema.TypeInt, Required: true, Description: "The port number of the server endpoint. For 'http-tunnel' protocol, server_port can be 0, which means any port. Such as 0 is good for 80 (http) and 443 (https).", }, - "sni": &schema.Schema{ + "sni": { Type: schema.TypeString, Optional: true, Description: "The server name indicator (SNI) which used to connect to the server endpoint. Only useful if server side requires SNI.", }, - "client_protocol": &schema.Schema{ + "client_protocol": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_satellite_endpoint", "client_protocol"), + ValidateFunc: validate.InvokeValidator("ibm_satellite_endpoint", "client_protocol"), Description: "The protocol in the client application side.", }, - "client_mutual_auth": &schema.Schema{ + "client_mutual_auth": { Type: schema.TypeBool, Optional: true, Default: false, Description: "Whether enable mutual auth in the client application side, when client_protocol is 'tls' or 'https', this field is required.", }, - "server_protocol": &schema.Schema{ + "server_protocol": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_satellite_endpoint", "server_protocol"), + ValidateFunc: validate.InvokeValidator("ibm_satellite_endpoint", "server_protocol"), Description: "The protocol in the server application side. This parameter will change to default value if it is omitted even when using PATCH API. If client_protocol is 'udp', server_protocol must be 'udp'. If client_protocol is 'tcp'/'http', server_protocol could be 'tcp'/'tls' and default to 'tcp'. If client_protocol is 'tls'/'https', server_protocol could be 'tcp'/'tls' and default to 'tls'. If client_protocol is 'http-tunnel', server_protocol must be 'tcp'.", }, - "server_mutual_auth": &schema.Schema{ + "server_mutual_auth": { Type: schema.TypeBool, Optional: true, Default: false, Description: "Whether enable mutual auth in the server application side, when client_protocol is 'tls', this field is required.", }, - "reject_unauth": &schema.Schema{ + "reject_unauth": { Type: schema.TypeBool, Optional: true, Default: false, Description: "Whether reject any connection to the server application which is not authorized with the list of supplied CAs in the fields certs.server_cert.", }, - "timeout": &schema.Schema{ + "timeout": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_satellite_endpoint", "timeout"), + ValidateFunc: validate.InvokeValidator("ibm_satellite_endpoint", "timeout"), Description: "The inactivity timeout in the Endpoint side.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Optional: true, Description: "The service or person who created the endpoint. Must be 1000 characters or fewer.", }, - "certs": &schema.Schema{ + "certs": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The certs.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "client": &schema.Schema{ + "client": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The CA which Satellite Link trust when receiving the connection from the client application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cert": &schema.Schema{ + "cert": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The root cert or the self-signed cert of the client application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Optional: true, Description: "The filename of the cert.", }, - "file_contents": &schema.Schema{ + "file_contents": { Type: schema.TypeString, Optional: true, Description: "The content of the cert. The certificate file must be in Privacy-enhanced Electronic Mail (PEM) format.", @@ -133,26 +136,26 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "server": &schema.Schema{ + "server": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The CA which Satellite Link trust when sending the connection to server application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cert": &schema.Schema{ + "cert": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The root cert or the self-signed cert of the server application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Optional: true, Description: "The filename of the cert.", }, - "file_contents": &schema.Schema{ + "file_contents": { Type: schema.TypeString, Optional: true, Description: "The content of the cert. The certificate file must be in Privacy-enhanced Electronic Mail (PEM) format.", @@ -163,26 +166,26 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "connector": &schema.Schema{ + "connector": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The cert which Satellite Link connector provide to identify itself for connecting to the client/server application.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cert": &schema.Schema{ + "cert": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The end-entity cert. This is required when the key is defined.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Optional: true, Description: "The filename of the cert.", }, - "file_contents": &schema.Schema{ + "file_contents": { Type: schema.TypeString, Optional: true, Description: "The content of the cert. The certificate file must be in Privacy-enhanced Electronic Mail (PEM) format.", @@ -190,19 +193,19 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "key": &schema.Schema{ + "key": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "The private key of the end-entity certificate. This is required when the cert is defined.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "filename": &schema.Schema{ + "filename": { Type: schema.TypeString, Optional: true, Description: "The name of the key.", }, - "file_contents": &schema.Schema{ + "file_contents": { Type: schema.TypeString, Optional: true, Description: "The content of the key. The private key file must be in Privacy-enhanced Electronic Mail (PEM) format.", @@ -216,27 +219,27 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "sources": &schema.Schema{ + "sources": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "source_id": &schema.Schema{ + "source_id": { Type: schema.TypeString, Optional: true, Description: "The Source ID.", }, - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Optional: true, Description: "Whether the source is enabled for the endpoint.", }, - "last_change": &schema.Schema{ + "last_change": { Type: schema.TypeString, Optional: true, Description: "The last time modify the Endpoint configurations.", }, - "pending": &schema.Schema{ + "pending": { Type: schema.TypeBool, Optional: true, Description: "Whether the source has been enabled on this endpoint.", @@ -244,99 +247,99 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { }, }, }, - "connector_port": &schema.Schema{ + "connector_port": { Type: schema.TypeInt, Computed: true, Description: "The connector port.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Service instance associated with this location.", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Computed: true, Description: "The service name of the endpoint.", }, - "client_host": &schema.Schema{ + "client_host": { Type: schema.TypeString, Computed: true, Description: "The hostname which Satellite Link server listen on for the on-location endpoint, or the hostname which the connector server listen on for the on-cloud endpoint destiantion.", }, - "client_port": &schema.Schema{ + "client_port": { Type: schema.TypeInt, Computed: true, Description: "The port which Satellite Link server listen on for the on-location, or the port which the connector server listen on for the on-cloud endpoint destiantion.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "Whether the Endpoint is active or not.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time when the Endpoint is created.", }, - "last_change": &schema.Schema{ + "last_change": { Type: schema.TypeString, Computed: true, Description: "The last time modify the Endpoint configurations.", }, - "endpoint_id": &schema.Schema{ + "endpoint_id": { Type: schema.TypeString, Computed: true, Description: "The Endpoint ID.", }, - "performance": &schema.Schema{ + "performance": { Type: schema.TypeList, Computed: true, Description: "The last performance data of the endpoint.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "connection": &schema.Schema{ + "connection": { Type: schema.TypeInt, Optional: true, Description: "Concurrent connections number of moment when probe read the data.", }, - "rx_bandwidth": &schema.Schema{ + "rx_bandwidth": { Type: schema.TypeInt, Optional: true, Description: "Average Receive (to Cloud) Bandwidth of last two minutes, unit is Byte/s.", }, - "tx_bandwidth": &schema.Schema{ + "tx_bandwidth": { Type: schema.TypeInt, Optional: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes, unit is Byte/s.", }, - "bandwidth": &schema.Schema{ + "bandwidth": { Type: schema.TypeInt, Optional: true, Description: "Average Tatal Bandwidth of last two minutes, unit is Byte/s.", }, - "connectors": &schema.Schema{ + "connectors": { Type: schema.TypeList, Optional: true, Description: "The last performance data of the endpoint from each Connector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "connector": &schema.Schema{ + "connector": { Type: schema.TypeString, Optional: true, Description: "The name of the connector reported the performance data.", }, - "connections": &schema.Schema{ + "connections": { Type: schema.TypeInt, Optional: true, Description: "Concurrent connections number of moment when probe read the data from the Connector.", }, - "rx_bw": &schema.Schema{ + "rx_bw": { Type: schema.TypeInt, Optional: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", }, - "tx_bw": &schema.Schema{ + "tx_bw": { Type: schema.TypeInt, Optional: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", @@ -351,46 +354,46 @@ func resourceIbmSatelliteEndpoint() *schema.Resource { } } -func resourceIbmSatelliteEndpointValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSatelliteEndpointValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "connection_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "cloud, location", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "client_protocol", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "http, http-tunnel, https, tcp, tls, udp", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "server_protocol", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "tcp, tls, udp", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "timeout", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Optional: true, MinValue: "1", MaxValue: "180", }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_satellite_endpoint", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_satellite_endpoint", Schema: validateSchema} return &resourceValidator } func resourceIbmSatelliteEndpointCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } @@ -573,12 +576,12 @@ func resourceIbmSatelliteEndpointMapToAdditionalNewEndpointRequestCertsConnector } func resourceIbmSatelliteEndpointRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -602,43 +605,43 @@ func resourceIbmSatelliteEndpointRead(context context.Context, d *schema.Resourc } if err = d.Set("location", endpoint.LocationID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("connection_type", endpoint.ConnType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting connection_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting connection_type: %s", err)) } if err = d.Set("display_name", endpoint.DisplayName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting display_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting display_name: %s", err)) } if err = d.Set("server_host", endpoint.ServerHost); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_host: %s", err)) } - if err = d.Set("server_port", intValue(endpoint.ServerPort)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_port: %s", err)) + if err = d.Set("server_port", flex.IntValue(endpoint.ServerPort)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_port: %s", err)) } if err = d.Set("sni", endpoint.Sni); err != nil { - return diag.FromErr(fmt.Errorf("Error setting sni: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sni: %s", err)) } if err = d.Set("client_protocol", endpoint.ClientProtocol); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_protocol: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_protocol: %s", err)) } if err = d.Set("client_mutual_auth", endpoint.ClientMutualAuth); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_mutual_auth: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_mutual_auth: %s", err)) } if err = d.Set("server_protocol", endpoint.ServerProtocol); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_protocol: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_protocol: %s", err)) } if err = d.Set("server_mutual_auth", endpoint.ServerMutualAuth); err != nil { - return diag.FromErr(fmt.Errorf("Error setting server_mutual_auth: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting server_mutual_auth: %s", err)) } if err = d.Set("reject_unauth", endpoint.RejectUnauth); err != nil { - return diag.FromErr(fmt.Errorf("Error setting reject_unauth: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting reject_unauth: %s", err)) } - if err = d.Set("timeout", intValue(endpoint.Timeout)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting timeout: %s", err)) + if err = d.Set("timeout", flex.IntValue(endpoint.Timeout)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting timeout: %s", err)) } if err = d.Set("created_by", endpoint.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if endpoint.Sources != nil { @@ -648,37 +651,37 @@ func resourceIbmSatelliteEndpointRead(context context.Context, d *schema.Resourc sources = append(sources, sourcesItemMap) } if err = d.Set("sources", sources); err != nil { - return diag.FromErr(fmt.Errorf("Error setting sources: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sources: %s", err)) } } - if err = d.Set("connector_port", intValue(endpoint.ConnectorPort)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting connector_port: %s", err)) + if err = d.Set("connector_port", flex.IntValue(endpoint.ConnectorPort)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting connector_port: %s", err)) } if err = d.Set("crn", endpoint.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("service_name", endpoint.ServiceName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting service_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting service_name: %s", err)) } if err = d.Set("client_host", endpoint.ClientHost); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_host: %s", err)) } - if err = d.Set("client_port", intValue(endpoint.ClientPort)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting client_port: %s", err)) + if err = d.Set("client_port", flex.IntValue(endpoint.ClientPort)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting client_port: %s", err)) } if err = d.Set("status", endpoint.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if err = d.Set("created_at", endpoint.CreatedAt); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("last_change", endpoint.LastChange); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_change: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_change: %s", err)) } if endpoint.Performance != nil { performanceMap := resourceIbmSatelliteEndpointEndpointPerformanceToMap(*endpoint.Performance) if err = d.Set("performance", []map[string]interface{}{performanceMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting performance: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting performance: %s", err)) } } @@ -791,10 +794,10 @@ func resourceIbmSatelliteEndpointSourceStatusObjectToMap(sourceStatusObject sate func resourceIbmSatelliteEndpointEndpointPerformanceToMap(endpointPerformance satellitelinkv1.EndpointPerformance) map[string]interface{} { endpointPerformanceMap := map[string]interface{}{} - endpointPerformanceMap["connection"] = intValue(endpointPerformance.Connection) - endpointPerformanceMap["rx_bandwidth"] = intValue(endpointPerformance.RxBandwidth) - endpointPerformanceMap["tx_bandwidth"] = intValue(endpointPerformance.TxBandwidth) - endpointPerformanceMap["bandwidth"] = intValue(endpointPerformance.Bandwidth) + endpointPerformanceMap["connection"] = flex.IntValue(endpointPerformance.Connection) + endpointPerformanceMap["rx_bandwidth"] = flex.IntValue(endpointPerformance.RxBandwidth) + endpointPerformanceMap["tx_bandwidth"] = flex.IntValue(endpointPerformance.TxBandwidth) + endpointPerformanceMap["bandwidth"] = flex.IntValue(endpointPerformance.Bandwidth) if endpointPerformance.Connectors != nil { connectors := []map[string]interface{}{} for _, connectorsItem := range endpointPerformance.Connectors { @@ -811,22 +814,22 @@ func resourceIbmSatelliteEndpointEndpointPerformanceConnectorsItemToMap(endpoint endpointPerformanceConnectorsItemMap := map[string]interface{}{} endpointPerformanceConnectorsItemMap["connector"] = endpointPerformanceConnectorsItem.Connector - endpointPerformanceConnectorsItemMap["connections"] = intValue(endpointPerformanceConnectorsItem.Connections) - endpointPerformanceConnectorsItemMap["rxBW"] = intValue(endpointPerformanceConnectorsItem.RxBW) - endpointPerformanceConnectorsItemMap["txBW"] = intValue(endpointPerformanceConnectorsItem.TxBW) + endpointPerformanceConnectorsItemMap["connections"] = flex.IntValue(endpointPerformanceConnectorsItem.Connections) + endpointPerformanceConnectorsItemMap["rxBW"] = flex.IntValue(endpointPerformanceConnectorsItem.RxBW) + endpointPerformanceConnectorsItemMap["txBW"] = flex.IntValue(endpointPerformanceConnectorsItem.TxBW) return endpointPerformanceConnectorsItemMap } func resourceIbmSatelliteEndpointUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } updateEndpointsOptions := &satellitelinkv1.UpdateEndpointsOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -1005,14 +1008,14 @@ func resourceIbmSatelliteEndpointMapToUpdateEndpointRequestCertsConnectorCert(up } func resourceIbmSatelliteEndpointDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } deleteEndpointsOptions := &satellitelinkv1.DeleteEndpointsOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_host.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_host.go new file mode 100644 index 0000000000..57e161b45f --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_host.go @@ -0,0 +1,349 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package satellite + +import ( + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM-Cloud/bluemix-go/bmxerror" +) + +const ( + hostCluster = "cluster" + hostLocation = "location" + hostID = "host_id" + hostState = "host_state" + hostLabels = "labels" + hostZone = "zone" + hostWorkerPool = "worker_pool" + hostProvider = "host_provider" + + rsHostNormalStatus = "normal" + rsHostProvisioningStatus = "provisioning" + rsHostReadyStatus = "ready" + rsHostUnknownStatus = "unknown" +) + +func ResourceIBMSatelliteHost() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMSatelliteHostCreate, + Read: resourceIBMSatelliteHostRead, + Update: resourceIBMSatelliteHostUpdate, + Delete: resourceIBMSatelliteHostDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(75 * time.Minute), + Read: schema.DefaultTimeout(75 * time.Minute), + Delete: schema.DefaultTimeout(45 * time.Minute), + Update: schema.DefaultTimeout(45 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + hostLocation: { + Type: schema.TypeString, + Required: true, + Description: "The name or ID of the Satellite location", + }, + hostCluster: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The name or ID of a Satellite location or cluster to assign the host to", + }, + hostID: { + Type: schema.TypeString, + Required: true, + Description: "The specific host ID to assign to a Satellite location or cluster", + }, + hostLabels: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "List of labels for the host", + }, + hostZone: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The zone within the cluster to assign the host to", + }, + hostWorkerPool: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The name or ID of the worker pool within the cluster to assign the host to", + }, + hostProvider: { + Type: schema.TypeString, + Optional: true, + Description: "Host Provider", + }, + hostState: { + Type: schema.TypeString, + Computed: true, + Description: "Health status of the host", + }, + "wait_till": { + Type: schema.TypeString, + Optional: true, + Description: "Wait until location is normal", + ValidateFunc: validate.InvokeValidator("ibm_satellite_host", "wait_till"), + }, + }, + } +} + +func ResourceIBMSatelliteHostValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 0) + waitTill := "location_normal" + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "wait_till", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: waitTill}) + + satelliteHostResourceValidator := validate.ResourceValidator{ResourceName: "ibm_satellite_host", Schema: validateSchema} + return &satelliteHostResourceValidator +} +func resourceIBMSatelliteHostCreate(d *schema.ResourceData, meta interface{}) error { + hostName := d.Get(hostID).(string) + location := d.Get(hostLocation).(string) + + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() + if err != nil { + return err + } + + hostAssignOptions := &kubernetesserviceapiv1.CreateSatelliteAssignmentOptions{} + hostAssignOptions.Controller = flex.PtrToString(location) + + if _, ok := d.GetOk(hostCluster); ok { + hostAssignOptions.Cluster = flex.PtrToString(d.Get(hostCluster).(string)) + } else { + hostAssignOptions.Cluster = flex.PtrToString(location) + } + hostAssignOptions.HostID = flex.PtrToString(hostName) + + //Check host attached to location + hostStatus, err := waitForHostAttachment(hostName, location, d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for attaching host (%s) to be succeeded: %s", hostName, err) + } + + labels := make(map[string]string) + if _, ok := d.GetOk(hostLabels); ok { + l := d.Get(hostLabels).(*schema.Set) + labels = flex.FlattenHostLabels(l.List()) + hostAssignOptions.Labels = labels + } else { + hostAssignOptions.Labels = labels + } + + if _, ok := d.GetOk(hostWorkerPool); ok { + hostAssignOptions.Workerpool = flex.PtrToString(d.Get(hostWorkerPool).(string)) + } + + if _, ok := d.GetOk(hostZone); ok { + hostAssignOptions.Zone = flex.PtrToString(d.Get(hostZone).(string)) + } + + if hostStatus == rsHostReadyStatus { + _, response, err := satClient.CreateSatelliteAssignment(hostAssignOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Assigning Satellite Host: %s\n%s", err, response) + } + } + + d.SetId(fmt.Sprintf("%s/%s", location, hostName)) + + //Wait for host to reach normal state + _, err = waitForHostAttachment(hostName, location, d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for host (%s) to get normal state: %s", hostName, err) + } + wait, ok := d.GetOk("wait_till") + if ok && wait.(string) == "location_normal" { + _, err = waitForLocationNormal(location, d, meta) + if err != nil { + return fmt.Errorf("[ERROR] Error waiting for getting location (%s) to be normal: %s", location, err) + } + } + + return resourceIBMSatelliteHostRead(d, meta) +} + +func resourceIBMSatelliteHostRead(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + if len(parts) < 2 { + return fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of location/hostName", d.Id()) + } + location := parts[0] + hostName := parts[1] + + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() + if err != nil { + return err + } + + hostOptions := &kubernetesserviceapiv1.GetSatelliteHostsOptions{ + Controller: &location, + } + hostList, resp, err := satClient.GetSatelliteHosts(hostOptions) + if err != nil { + if resp != nil && resp.StatusCode == 404 { + d.SetId("") + return nil + } + log.Println("resourceIBMSatelliteHostRead : error in getting hostlist :", err, resp) + return err + } + + for _, h := range hostList { + if hostName == *h.Name || hostName == *h.ID { + d.Set(hostLocation, location) + d.Set("host_id", hostName) + + if _, ok := d.GetOk(hostLabels); ok { + l := d.Get(hostLabels).(*schema.Set) + d.Set(hostLabels, l) + } + + if h.Health != nil { + d.Set(hostState, *h.Health.Status) + } + + if _, ok := d.GetOk(hostCluster); ok { + d.Set(hostCluster, d.Get(hostCluster).(string)) + } else { + d.Set(hostCluster, location) + } + + if h.Assignment != nil { + d.Set(hostWorkerPool, *h.Assignment.WorkerPoolName) + d.Set(hostZone, *h.Assignment.Zone) + } + } + } + + return nil +} + +func resourceIBMSatelliteHostUpdate(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + + locationName := parts[0] + hostID := parts[1] + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() + if err != nil { + return err + } + + updateHostOptions := &kubernetesserviceapiv1.UpdateSatelliteHostOptions{} + updateHostOptions.Controller = &locationName + updateHostOptions.HostID = &hostID + + if v, ok := d.GetOk(hostState); ok && v != nil && v.(string) == rsHostReadyStatus { + labels := make(map[string]string) + if _, ok := d.GetOk(hostLabels); ok { + l := d.Get(hostLabels).(*schema.Set) + labels = flex.FlattenHostLabels(l.List()) + updateHostOptions.Labels = labels + } + response, err := satClient.UpdateSatelliteHost(updateHostOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Updating Satellite Host: %s\n%s", err, response) + } + } + + return resourceIBMSatelliteHostRead(d, meta) +} + +func resourceIBMSatelliteHostDelete(d *schema.ResourceData, meta interface{}) error { + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + + location := parts[0] + hostID := parts[1] + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() + if err != nil { + return err + } + + removeSatHostOptions := &kubernetesserviceapiv1.RemoveSatelliteHostOptions{} + removeSatHostOptions.Controller = &location + removeSatHostOptions.HostID = &hostID + + response, err := satClient.RemoveSatelliteHost(removeSatHostOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error Deleting Satellite Host: %s\n%s", err, response) + } + + d.SetId("") + return nil +} + +func waitForHostAttachment(hostName, location string, d *schema.ResourceData, meta interface{}) (interface{}, error) { + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() + if err != nil { + return false, err + } + + stateConf := &resource.StateChangeConf{ + Pending: []string{rsHostProvisioningStatus, rsHostUnknownStatus}, + Target: []string{rsHostReadyStatus, rsHostNormalStatus}, + Refresh: func() (interface{}, string, error) { + attachOptions := &kubernetesserviceapiv1.GetSatelliteHostsOptions{ + Controller: &location, + } + hostList, resp, err := satClient.GetSatelliteHosts(attachOptions) + if err != nil { + if apiErr, ok := err.(bmxerror.RequestFailure); ok && apiErr.StatusCode() != 404 { + return nil, "", fmt.Errorf("[ERROR] The satellite host (%s) failed to attached: %v\n%s", hostName, err, resp) + } + } + + if hostList != nil { + for _, h := range hostList { + if h.Health != nil { + if (hostName == *h.Name) && (*h.Health.Status == rsHostNormalStatus || *h.Health.Status == rsHostReadyStatus) { + return *h.Health.Status, *h.Health.Status, err + } + } + } + } + return hostName, rsHostProvisioningStatus, nil + }, + Timeout: d.Timeout(schema.TimeoutCreate), + Delay: 60 * time.Second, + MinTimeout: 60 * time.Second, + } + + return stateConf.WaitForState() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_link.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_link.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_link.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_link.go index 851ba5546a..c1a91f81c1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_link.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_link.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -10,11 +10,13 @@ import ( "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" "github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIbmSatelliteLink() *schema.Resource { +func ResourceIBMSatelliteLink() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmSatelliteLinkCreate, ReadContext: resourceIbmSatelliteLinkRead, @@ -23,107 +25,107 @@ func resourceIbmSatelliteLink() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "CRN of the Location.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Location ID.", }, - "ws_endpoint": &schema.Schema{ + "ws_endpoint": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The ws endpoint of the location.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the location.", }, - "satellite_link_host": &schema.Schema{ + "satellite_link_host": { Type: schema.TypeString, Computed: true, Description: "Satellite Link hostname of the location.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "Enabled/Disabled.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Timestamp of creation of location.", }, - "last_change": &schema.Schema{ + "last_change": { Type: schema.TypeString, Computed: true, Description: "Timestamp of latest modification of location.", }, - "performance": &schema.Schema{ + "performance": { Type: schema.TypeList, Computed: true, Description: "The last performance data of the Location.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "tunnels": &schema.Schema{ + "tunnels": { Type: schema.TypeInt, Optional: true, Description: "Tunnels number estbalished from the Location.", }, - "health_status": &schema.Schema{ + "health_status": { Type: schema.TypeString, Optional: true, Description: "Tunnels health status based on the Tunnels number established. Down(0)/Critical(1)/Up(>=2).", }, - "avg_latency": &schema.Schema{ + "avg_latency": { Type: schema.TypeInt, Optional: true, Description: "Average latency calculated form latency of each Connector between Tunnel Server, unit is ms. -1 means no Connector established Tunnel.", }, - "rx_bandwidth": &schema.Schema{ + "rx_bandwidth": { Type: schema.TypeInt, Optional: true, Description: "Average Receive (to Cloud) Bandwidth of last two minutes, unit is Byte/s.", }, - "tx_bandwidth": &schema.Schema{ + "tx_bandwidth": { Type: schema.TypeInt, Optional: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes, unit is Byte/s.", }, - "bandwidth": &schema.Schema{ + "bandwidth": { Type: schema.TypeInt, Optional: true, Description: "Average Tatal Bandwidth of last two minutes, unit is Byte/s.", }, - "connectors": &schema.Schema{ + "connectors": { Type: schema.TypeList, Optional: true, Description: "The last performance data of the Location read from each Connector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "connector": &schema.Schema{ + "connector": { Type: schema.TypeString, Optional: true, Description: "The name of the connector reported the performance data.", }, - "latency": &schema.Schema{ + "latency": { Type: schema.TypeInt, Optional: true, Description: "Latency between Connector and the Tunnel Server it connected.", }, - "rx_bw": &schema.Schema{ + "rx_bw": { Type: schema.TypeInt, Optional: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", }, - "tx_bw": &schema.Schema{ + "tx_bw": { Type: schema.TypeInt, Optional: true, Description: "Average Transmitted (to Location) Bandwidth of last two minutes read from the Connector, unit is Byte/s.", @@ -139,7 +141,7 @@ func resourceIbmSatelliteLink() *schema.Resource { } func resourceIbmSatelliteLinkCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } @@ -165,14 +167,14 @@ func resourceIbmSatelliteLinkCreate(context context.Context, d *schema.ResourceD } func resourceIbmSatelliteLinkRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { - return diag.FromErr(fmt.Errorf("SatelliteClientSession failed %s\n", err)) + return diag.FromErr(fmt.Errorf("[ERROR] SatelliteClientSession failed %s", err)) } getLinkOptions := &satellitelinkv1.GetLinkOptions{} @@ -190,7 +192,7 @@ func resourceIbmSatelliteLinkRead(context context.Context, d *schema.ResourceDat } getSatLocOptions := &kubernetesserviceapiv1.GetSatelliteLocationOptions{ - Controller: ptrToString(d.Id()), + Controller: flex.PtrToString(d.Id()), } locInstance, response, err := satClient.GetSatelliteLocation(getSatLocOptions) @@ -204,25 +206,25 @@ func resourceIbmSatelliteLinkRead(context context.Context, d *schema.ResourceDat d.Set("crn", *locInstance.Crn) if err = d.Set("location", link.LocationID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("ws_endpoint", link.WsEndpoint); err != nil { - return diag.FromErr(fmt.Errorf("Error setting ws_endpoint: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting ws_endpoint: %s", err)) } if err = d.Set("description", link.Desc); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("satellite_link_host", link.SatelliteLinkHost); err != nil { - return diag.FromErr(fmt.Errorf("Error setting satellite_link_host: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting satellite_link_host: %s", err)) } if err = d.Set("status", link.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if err = d.Set("created_at", link.CreatedAt); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("last_change", link.LastChange); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_change: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_change: %s", err)) } if link.Performance != nil { performanceMap := resourceIbmSatelliteLinkLocationPerformanceToMap(*link.Performance) @@ -235,15 +237,15 @@ func resourceIbmSatelliteLinkRead(context context.Context, d *schema.ResourceDat func resourceIbmSatelliteLinkLocationPerformanceToMap(locationPerformance satellitelinkv1.LocationPerformance) map[string]interface{} { locationPerformanceMap := map[string]interface{}{} - locationPerformanceMap["tunnels"] = intValue(locationPerformance.Tunnels) + locationPerformanceMap["tunnels"] = flex.IntValue(locationPerformance.Tunnels) if locationPerformance.HealthStatus != nil { locationPerformanceMap["health_status"] = *locationPerformance.HealthStatus } - locationPerformanceMap["avg_latency"] = intValue(locationPerformance.AvgLatency) - locationPerformanceMap["rx_bandwidth"] = intValue(locationPerformance.RxBandwidth) - locationPerformanceMap["tx_bandwidth"] = intValue(locationPerformance.TxBandwidth) - locationPerformanceMap["bandwidth"] = intValue(locationPerformance.Bandwidth) + locationPerformanceMap["avg_latency"] = flex.IntValue(locationPerformance.AvgLatency) + locationPerformanceMap["rx_bandwidth"] = flex.IntValue(locationPerformance.RxBandwidth) + locationPerformanceMap["tx_bandwidth"] = flex.IntValue(locationPerformance.TxBandwidth) + locationPerformanceMap["bandwidth"] = flex.IntValue(locationPerformance.Bandwidth) if locationPerformance.Connectors != nil { connectors := []map[string]interface{}{} for _, connectorsItem := range locationPerformance.Connectors { @@ -263,13 +265,13 @@ func resourceIbmSatelliteLinkLocationPerformanceConnectorsItemToMap(locationPerf locationPerformanceConnectorsItemMap["connector"] = *locationPerformanceConnectorsItem.Connector } if locationPerformanceConnectorsItem.Latency != nil { - locationPerformanceConnectorsItemMap["latency"] = intValue(locationPerformanceConnectorsItem.Latency) + locationPerformanceConnectorsItemMap["latency"] = flex.IntValue(locationPerformanceConnectorsItem.Latency) } if locationPerformanceConnectorsItem.RxBW != nil { - locationPerformanceConnectorsItemMap["rx_bw"] = intValue(locationPerformanceConnectorsItem.RxBW) + locationPerformanceConnectorsItemMap["rx_bw"] = flex.IntValue(locationPerformanceConnectorsItem.RxBW) } if locationPerformanceConnectorsItem.TxBW != nil { - locationPerformanceConnectorsItemMap["tx_bw"] = intValue(locationPerformanceConnectorsItem.TxBW) + locationPerformanceConnectorsItemMap["tx_bw"] = flex.IntValue(locationPerformanceConnectorsItem.TxBW) } log.Println("locationPerformanceConnectorsItemMap ::", locationPerformanceConnectorsItemMap) @@ -277,7 +279,7 @@ func resourceIbmSatelliteLinkLocationPerformanceConnectorsItemToMap(locationPerf } func resourceIbmSatelliteLinkUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } @@ -305,7 +307,7 @@ func resourceIbmSatelliteLinkUpdate(context context.Context, d *schema.ResourceD } func resourceIbmSatelliteLinkDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satelliteLinkClient, err := meta.(ClientSession).SatellitLinkClientSession() + satelliteLinkClient, err := meta.(conns.ClientSession).SatellitLinkClientSession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_location.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_location.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_location.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_location.go index 8192421143..a06d7a168a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_location.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_location.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -11,6 +11,9 @@ import ( "time" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -28,7 +31,7 @@ const ( isLocationDeployFailed = "deploy_failed" ) -func resourceIBMSatelliteLocation() *schema.Resource { +func ResourceIBMSatelliteLocation() *schema.Resource { return &schema.Resource{ Create: resourceIBMSatelliteLocationCreate, Read: resourceIBMSatelliteLocationRead, @@ -37,7 +40,7 @@ func resourceIBMSatelliteLocation() *schema.Resource { Importer: &schema.ResourceImporter{ State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { ID := d.Id() - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return nil, err } @@ -51,17 +54,17 @@ func resourceIBMSatelliteLocation() *schema.Resource { return nil, fmt.Errorf("Error reading satellite location: %s\n%s", err, response) } - d.Set("zones", newStringSet(schema.HashString, instance.WorkerZones)) + d.Set("zones", flex.NewStringSet(schema.HashString, instance.WorkerZones)) return []*schema.ResourceData{d}, nil }, }, CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return immutableResourceCustomizeDiff([]string{satLocation, sateLocZone, "resource_group_id", "zones"}, diff) + return flex.ImmutableResourceCustomizeDiff([]string{satLocation, sateLocZone, "resource_group_id", "zones"}, diff) }, ), @@ -156,15 +159,15 @@ func resourceIBMSatelliteLocation() *schema.Resource { Computed: true, Description: "ID of the resource group.", }, - tags: { + "tags": { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_satellite_location", "tags")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_satellite_location", "tags")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags associated with resource instance", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "Name of the resource group", @@ -204,24 +207,24 @@ func resourceIBMSatelliteLocation() *schema.Resource { } } -func resourceIBMSatelliteLocationValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMSatelliteLocationValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tags", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmSatelliteLocationValidator := ResourceValidator{ResourceName: "ibm_satellite_location", Schema: validateSchema} + ibmSatelliteLocationValidator := validate.ResourceValidator{ResourceName: "ibm_satellite_location", Schema: validateSchema} return &ibmSatelliteLocationValidator } func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{}) error { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -233,11 +236,11 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} createSatLocOptions.Location = &sateLocZone if v, ok := d.GetOk("cos_config"); ok { - createSatLocOptions.CosConfig = expandCosConfig(v.([]interface{})) + createSatLocOptions.CosConfig = flex.ExpandCosConfig(v.([]interface{})) } if v, ok := d.GetOk("cos_credentials"); ok { - createSatLocOptions.CosCredentials = expandCosCredentials(v.([]interface{})) + createSatLocOptions.CosCredentials = flex.ExpandCosCredentials(v.([]interface{})) } if v, ok := d.GetOk("logging_account_id"); ok { @@ -252,7 +255,7 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} if v, ok := d.GetOk("zones"); ok { z := v.(*schema.Set) - createSatLocOptions.Zones = flatterSatelliteZones(z) + createSatLocOptions.Zones = flex.FlattenSatelliteZones(z) } if v, ok := d.GetOk("resource_group_id"); ok && v != nil { @@ -264,7 +267,7 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} instance, response, err := satClient.CreateSatelliteLocation(createSatLocOptions) if err != nil || instance == nil { - return fmt.Errorf("Error Creating Satellite Location: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Satellite Location: %s\n%s", err, response) } d.SetId(*instance.ID) @@ -273,7 +276,7 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk("tags"); ok || v != "" { oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) if err != nil { log.Printf( "Error on create of ibm satellite location (%s) tags: %s", d.Id(), err) @@ -283,8 +286,7 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} //Wait for location to be in ready state _, err = waitForLocationToReady(*instance.ID, d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for location (%s) to reach action required state: %s", *instance.ID, err) + return fmt.Errorf("[ERROR] Error waiting for location (%s) to reach action required state: %s", *instance.ID, err) } return resourceIBMSatelliteLocationRead(d, meta) @@ -292,7 +294,7 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} func resourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{}) error { ID := d.Id() - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -323,14 +325,14 @@ func resourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{}) d.Set("resource_group_id", instance.ResourceGroup) } - tags, err := GetTagsUsingCRN(meta, *instance.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *instance.Crn) if err != nil { log.Printf( "Error on get of ibm satellite location tags (%s) tags: %s", d.Id(), err) } d.Set("tags", tags) d.Set("crn", *instance.Crn) - d.Set(ResourceGroupName, *instance.ResourceGroupName) + d.Set(flex.ResourceGroupName, *instance.ResourceGroupName) if instance.Hosts != nil { d.Set("host_attached_count", *instance.Hosts.Total) d.Set("host_available_count", *instance.Hosts.Available) @@ -346,7 +348,7 @@ func resourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{}) func resourceIBMSatelliteLocationUpdate(d *schema.ResourceData, meta interface{}) error { ID := d.Id() - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -360,9 +362,9 @@ func resourceIBMSatelliteLocationUpdate(d *schema.ResourceData, meta interface{} instance, response, err := satClient.GetSatelliteLocation(getSatLocOptions) if err != nil || instance == nil { - return fmt.Errorf("Error retrieving satellite location: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error retrieving satellite location: %s\n%s", err, response) } - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.Crn) if err != nil { log.Printf( "An error occured during update of instance (%s) tags: %s", ID, err) @@ -372,7 +374,7 @@ func resourceIBMSatelliteLocationUpdate(d *schema.ResourceData, meta interface{} } func resourceIBMSatelliteLocationDelete(d *schema.ResourceData, meta interface{}) error { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return err } @@ -383,14 +385,13 @@ func resourceIBMSatelliteLocationDelete(d *schema.ResourceData, meta interface{} response, err := satClient.RemoveSatelliteLocation(removeSatLocOptions) if err != nil && response.StatusCode != 404 { - return fmt.Errorf("Error Deleting Satellite Location: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Satellite Location: %s\n%s", err, response) } //Wait for location to delete _, err = waitForLocationDelete(name, d, meta) if err != nil { - return fmt.Errorf( - "Error waiting for deleting location instance: %s", err) + return fmt.Errorf("[ERROR] Error waiting for deleting location instance: %s", err) } d.SetId("") @@ -398,7 +399,7 @@ func resourceIBMSatelliteLocationDelete(d *schema.ResourceData, meta interface{} } func waitForLocationDelete(location string, d *schema.ResourceData, meta interface{}) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return false, err } @@ -410,7 +411,7 @@ func waitForLocationDelete(location string, d *schema.ResourceData, meta interfa getSatLocOptions := &kubernetesserviceapiv1.GetSatelliteLocationsOptions{} locations, response, err := satClient.GetSatelliteLocations(getSatLocOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting locations list to delete : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting locations list to delete : %s\n%s", err, response) } isExist := false @@ -421,11 +422,11 @@ func waitForLocationDelete(location string, d *schema.ResourceData, meta interfa return "", isLocationDeleting, nil } } - if isExist == false { + if !isExist { return location, isLocationDeleteDone, nil } } - return nil, "", fmt.Errorf("Failed to delete location : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Failed to delete location : %s\n%s", err, response) }, Timeout: d.Timeout(schema.TimeoutDelete), Delay: 60 * time.Second, @@ -436,7 +437,7 @@ func waitForLocationDelete(location string, d *schema.ResourceData, meta interfa } func waitForLocationToReady(loc string, d *schema.ResourceData, meta interface{}) (interface{}, error) { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return false, err } @@ -446,7 +447,7 @@ func waitForLocationToReady(loc string, d *schema.ResourceData, meta interface{} Target: []string{isLocationReady, isLocationDeployFailed}, Refresh: func() (interface{}, string, error) { getSatLocOptions := &kubernetesserviceapiv1.GetSatelliteLocationOptions{ - Controller: ptrToString(loc), + Controller: flex.PtrToString(loc), } var location *kubernetesserviceapiv1.MultishiftGetController @@ -463,12 +464,12 @@ func waitForLocationToReady(loc string, d *schema.ResourceData, meta interface{} return nil }) - if isResourceTimeoutError(err) { + if conns.IsResourceTimeoutError(err) { location, response, err = satClient.GetSatelliteLocation(getSatLocOptions) } if location != nil && *location.State == isLocationDeployFailed { - return location, isLocationDeployFailed, fmt.Errorf("The location is in failed state: %s", d.Id()) + return location, isLocationDeployFailed, fmt.Errorf("[ERROR] The location is in failed state: %s", d.Id()) } if location != nil && *location.State == isLocationReady { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_location_nlb_dns.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_location_nlb_dns.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_location_nlb_dns.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_location_nlb_dns.go index e425d4e224..dff5b05ab9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_satellite_location_nlb_dns.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/resource_ibm_satellite_location_nlb_dns.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package satellite import ( "context" @@ -9,11 +9,13 @@ import ( "log" "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIbmSatelliteLocationNlbDns() *schema.Resource { +func ResourceIBMSatelliteLocationNlbDns() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmSatelliteLocationNlbDnsCreate, ReadContext: resourceIbmSatelliteLocationNlbDnsRead, @@ -21,12 +23,12 @@ func resourceIbmSatelliteLocationNlbDns() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "ips": &schema.Schema{ + "ips": { Type: schema.TypeSet, Required: true, ForceNew: true, @@ -38,12 +40,12 @@ func resourceIbmSatelliteLocationNlbDns() *schema.Resource { } func resourceIbmSatelliteLocationNlbDnsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - satClient, err := meta.(ClientSession).SatelliteClientSession() + satClient, err := meta.(conns.ClientSession).SatelliteClientSession() if err != nil { return diag.FromErr(err) } - bmxSess, err := meta.(ClientSession).BluemixSession() + bmxSess, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -74,19 +76,19 @@ func resourceIbmSatelliteLocationNlbDnsCreate(context context.Context, d *schema func resourceIbmSatelliteLocationNlbDnsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { ID := d.Id() - nlbClient, err := meta.(ClientSession).VpcContainerAPI() + nlbClient, err := meta.(conns.ClientSession).VpcContainerAPI() if err != nil { return diag.FromErr(err) } nlbAPI := nlbClient.NlbDns() getSatLocationNlbDNSListOptions := &kubernetesserviceapiv1.GetSatLocationNlbDNSListOptions{} - getSatLocationNlbDNSListOptions.Controller = ptrToString(ID) + getSatLocationNlbDNSListOptions.Controller = flex.PtrToString(ID) _, err = nlbAPI.GetLocationNLBDNSList(ID) if err != nil { log.Printf("[DEBUG] GetSatLocationNlbDNSListWithContext failed %s\n", err) - return diag.FromErr(fmt.Errorf("GetSatLocationNlbDNSListWithContext failed %s\n", err)) + return diag.FromErr(fmt.Errorf("[ERROR] GetSatLocationNlbDNSListWithContext failed %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/README.md new file mode 100644 index 0000000000..b6d110aaa9 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/README.md @@ -0,0 +1,12 @@ +# Terraform IBM Provider Security and Compliance Center + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the SCC resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/scc_account_settings) +* IBM API Docs: [IBM API Docs for SCC Admin](https://cloud.ibm.com/apidocs/security-compliance/admin) +* IBM API Docs: [IBM API Docs for SCC Posture Management](https://cloud.ibm.com/apidocs/security-compliance/posture) +* IBM SCC SDK: [IBM SDK for SCC](https://github.com/IBM/scc-go-sdk) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_location.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_location.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_location.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_location.go index 18412396df..832086ec29 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_location.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_location.go @@ -1,65 +1,66 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM/scc-go-sdk/adminserviceapiv1" + "github.com/IBM/scc-go-sdk/v3/adminserviceapiv1" ) -func dataSourceIbmSccAccountLocation() *schema.Resource { +func DataSourceIBMSccAccountLocation() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmSccAccountLocationRead, Schema: map[string]*schema.Schema{ - "location_id": &schema.Schema{ + "location_id": { Type: schema.TypeString, Required: true, Description: "The programatic ID of the location that you want to work in.", }, - "main_endpoint_url": &schema.Schema{ + "main_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The base URL for the service.", }, - "governance_endpoint_url": &schema.Schema{ + "governance_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to call the Configuration Governance APIs.", }, - "results_endpoint_url": &schema.Schema{ + "results_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to get the results for the Configuration Governance component.", }, - "compliance_endpoint_url": &schema.Schema{ + "compliance_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to call the Posture Management APIs.", }, - "analytics_endpoint_url": &schema.Schema{ + "analytics_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to generate analytics for the Posture Management component.", }, - "si_endpoint_url": &schema.Schema{ + "si_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to call the Security Insights APIs.", }, - "regions": &schema.Schema{ + "regions": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The programatic ID of the available regions.", @@ -72,7 +73,7 @@ func dataSourceIbmSccAccountLocation() *schema.Resource { } func dataSourceIbmSccAccountLocationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - adminServiceApiClient, err := meta.(ClientSession).AdminServiceApiV1() + adminServiceApiClient, err := meta.(conns.ClientSession).AdminServiceApiV1() if err != nil { return diag.FromErr(err) } @@ -89,28 +90,28 @@ func dataSourceIbmSccAccountLocationRead(context context.Context, d *schema.Reso d.SetId(*location.ID) if err = d.Set("main_endpoint_url", location.MainEndpointURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting main_endpoint_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting main_endpoint_url: %s", err)) } if err = d.Set("governance_endpoint_url", location.GovernanceEndpointURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting governance_endpoint_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting governance_endpoint_url: %s", err)) } if err = d.Set("results_endpoint_url", location.ResultsEndpointURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting results_endpoint_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting results_endpoint_url: %s", err)) } if err = d.Set("compliance_endpoint_url", location.ComplianceEndpointURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting compliance_endpoint_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting compliance_endpoint_url: %s", err)) } if err = d.Set("analytics_endpoint_url", location.AnalyticsEndpointURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting analytics_endpoint_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting analytics_endpoint_url: %s", err)) } if err = d.Set("si_endpoint_url", location.SiEndpointURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting si_endpoint_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting si_endpoint_url: %s", err)) } if location.Regions != nil { err = d.Set("regions", dataSourceLocationFlattenRegions(location.Regions)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting regions %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting regions %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_location_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_location_settings.go new file mode 100644 index 0000000000..8839786fbd --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_location_settings.go @@ -0,0 +1,59 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package scc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/scc-go-sdk/v3/adminserviceapiv1" +) + +func DataSourceIBMSccAccountLocationSettings() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIbmSccAccountLocationSettingsRead, + + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The programatic ID of the location that you want to work in.", + }, + }, + } +} + +func dataSourceIbmSccAccountLocationSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + adminServiceApiClient, err := meta.(conns.ClientSession).AdminServiceApiV1() + if err != nil { + return diag.FromErr(err) + } + + getSettingsOptions := &adminserviceapiv1.GetSettingsOptions{} + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + + getSettingsOptions.SetAccountID(userDetails.UserAccount) + + locationSettings, response, err := adminServiceApiClient.GetSettingsWithContext(context, getSettingsOptions) + if err != nil { + log.Printf("[DEBUG] GetSettingsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetSettingsWithContext failed %s\n%s", err, response)) + } + + d.SetId(*locationSettings.Location.ID) + if err = d.Set("id", locationSettings.Location.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_locations.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_locations.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_locations.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_locations.go index 15ce42d23d..b1b4367fef 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_account_locations.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_account_locations.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,63 +9,64 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM/scc-go-sdk/adminserviceapiv1" + "github.com/IBM/scc-go-sdk/v3/adminserviceapiv1" ) -func dataSourceIbmSccAccountLocations() *schema.Resource { +func DataSourceIBMSccAccountLocations() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmSccAccountLocationsRead, Schema: map[string]*schema.Schema{ - "locations": &schema.Schema{ + "locations": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The programatic ID of the location that you want to work in.", }, - "main_endpoint_url": &schema.Schema{ + "main_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The base URL for the service.", }, - "governance_endpoint_url": &schema.Schema{ + "governance_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to call the Configuration Governance APIs.", }, - "results_endpoint_url": &schema.Schema{ + "results_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to get the results for the Configuration Governance component.", }, - "compliance_endpoint_url": &schema.Schema{ + "compliance_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to call the Posture Management APIs.", }, - "analytics_endpoint_url": &schema.Schema{ + "analytics_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to generate analytics for the Posture Management component.", }, - "si_endpoint_url": &schema.Schema{ + "si_endpoint_url": { Type: schema.TypeString, Computed: true, Description: "The endpoint that is used to call the Security Insights APIs.", }, - "regions": &schema.Schema{ + "regions": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The programatic ID of the available regions.", @@ -81,7 +82,7 @@ func dataSourceIbmSccAccountLocations() *schema.Resource { } func dataSourceIbmSccAccountLocationsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - adminServiceApiClient, err := meta.(ClientSession).AdminServiceApiV1() + adminServiceApiClient, err := meta.(conns.ClientSession).AdminServiceApiV1() if err != nil { return diag.FromErr(err) } @@ -99,7 +100,7 @@ func dataSourceIbmSccAccountLocationsRead(context context.Context, d *schema.Res if locations.Locations != nil { err = d.Set("locations", dataSourceLocationsFlattenLocations(locations.Locations)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting locations %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting locations %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_group_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_group_profile.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_group_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_group_profile.go index 2060e3b895..40814c6397 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_group_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_group_profile.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -12,30 +12,31 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" //"github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func dataSourceIBMSccPostureGroupProfileDetails() *schema.Resource { +func DataSourceIBMSccPostureGroupProfileDetails() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccPostureGroupProfileDetailsRead, Schema: map[string]*schema.Schema{ - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "The profile ID. This can be obtained from the Security and Compliance Center UI by clicking on the profile name. The URL contains the ID.", }, - "first": &schema.Schema{ + "first": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -43,13 +44,13 @@ func dataSourceIBMSccPostureGroupProfileDetails() *schema.Resource { }, }, }, - "last": &schema.Schema{ + "last": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -57,13 +58,13 @@ func dataSourceIBMSccPostureGroupProfileDetails() *schema.Resource { }, }, }, - "previous": &schema.Schema{ + "previous": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -71,69 +72,69 @@ func dataSourceIBMSccPostureGroupProfileDetails() *schema.Resource { }, }, }, - "controls": &schema.Schema{ + "controls": { Type: schema.TypeList, Computed: true, Description: "Profiles array.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The identifier number of the control.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the control.", }, - "external_control_id": &schema.Schema{ + "external_control_id": { Type: schema.TypeString, Computed: true, Description: "The external identifier number of the control.", }, - "goals": &schema.Schema{ + "goals": { Type: schema.TypeList, Computed: true, Description: "Mapped goals aganist the control identifier.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the goal.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The goal ID.", }, - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Computed: true, Description: "The severity of the goal.", }, - "is_manual": &schema.Schema{ + "is_manual": { Type: schema.TypeBool, Computed: true, Description: "The goal is manual check.", }, - "is_remediable": &schema.Schema{ + "is_remediable": { Type: schema.TypeBool, Computed: true, Description: "The goal is remediable or not.", }, - "is_reversible": &schema.Schema{ + "is_reversible": { Type: schema.TypeBool, Computed: true, Description: "The goal is reversible or not.", }, - "is_automatable": &schema.Schema{ + "is_automatable": { Type: schema.TypeBool, Computed: true, Description: "The goal is automatable or not.", }, - "is_auto_remediable": &schema.Schema{ + "is_auto_remediable": { Type: schema.TypeBool, Computed: true, Description: "The goal is autoremediable or not.", @@ -149,7 +150,7 @@ func dataSourceIBMSccPostureGroupProfileDetails() *schema.Resource { } func dataSourceIBMSccPostureGroupProfileDetailsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } @@ -157,12 +158,12 @@ func dataSourceIBMSccPostureGroupProfileDetailsRead(context context.Context, d * getProfileControlsOptions := &posturemanagementv2.GetProfileControlsOptions{} getProfileControlsOptions.SetProfileID(d.Get("profile_id").(string)) - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount getProfileControlsOptions.SetAccountID(accountID) var controlList *posturemanagementv2.ControlList @@ -191,7 +192,7 @@ func dataSourceIBMSccPostureGroupProfileDetailsRead(context context.Context, d * if controlList.Controls != nil { err = d.Set("controls", dataSourceControlListFlattenControls(controlList.Controls)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting controls %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting controls %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_latest_scans.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_latest_scans.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_latest_scans.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_latest_scans.go index 20219e7c8f..89b969dfd7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_latest_scans.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_latest_scans.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -12,30 +12,31 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func dataSourceIBMSccPostureLatestScans() *schema.Resource { +func DataSourceIBMSccPostureLatestScans() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccPostureListLatestScansRead, Schema: map[string]*schema.Schema{ - "scan_id": &schema.Schema{ + "scan_id": { Type: schema.TypeString, Optional: true, Description: "The ID of the scan.", }, - "first": &schema.Schema{ + "first": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -43,13 +44,13 @@ func dataSourceIBMSccPostureLatestScans() *schema.Resource { }, }, }, - "last": &schema.Schema{ + "last": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -57,13 +58,13 @@ func dataSourceIBMSccPostureLatestScans() *schema.Resource { }, }, }, - "previous": &schema.Schema{ + "previous": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -71,49 +72,49 @@ func dataSourceIBMSccPostureLatestScans() *schema.Resource { }, }, }, - "latest_scans": &schema.Schema{ + "latest_scans": { Type: schema.TypeList, Computed: true, Description: "The details of a scan.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "scan_id": &schema.Schema{ + "scan_id": { Type: schema.TypeString, Computed: true, Description: "The ID of the scan.", }, - "scan_name": &schema.Schema{ + "scan_name": { Type: schema.TypeString, Computed: true, Description: "A system generated name that is the combination of 12 characters in the scope name and 12 characters of a profile name.", }, - "scope_id": &schema.Schema{ + "scope_id": { Type: schema.TypeString, Computed: true, Description: "The scope ID of the scan.", }, - "scope_name": &schema.Schema{ + "scope_name": { Type: schema.TypeString, Computed: true, Description: "The name of the scope.", }, - "profiles": &schema.Schema{ + "profiles": { Type: schema.TypeList, Computed: true, Description: "Profiles array.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the profile.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "An auto-generated unique identifier for the scope.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of profile.", @@ -121,88 +122,88 @@ func dataSourceIBMSccPostureLatestScans() *schema.Resource { }, }, }, - "group_profile_id": &schema.Schema{ + "group_profile_id": { Type: schema.TypeString, Computed: true, Description: "The group ID of profile.", }, - "group_profile_name": &schema.Schema{ + "group_profile_name": { Type: schema.TypeString, Computed: true, Description: "The group name of the profile.", }, - "report_run_by": &schema.Schema{ + "report_run_by": { Type: schema.TypeString, Computed: true, Description: "The entity that ran the report.", }, - "start_time": &schema.Schema{ + "start_time": { Type: schema.TypeString, Computed: true, Description: "The date and time the scan was run.", }, - "report_setting_id": &schema.Schema{ + "report_setting_id": { Type: schema.TypeString, Computed: true, Description: "The unique ID for Scan that is created.", }, - "end_time": &schema.Schema{ + "end_time": { Type: schema.TypeString, Computed: true, Description: "The date and time the scan completed.", }, - "result": &schema.Schema{ + "result": { Type: schema.TypeList, Computed: true, Description: "The result of a scan.The above values will not be avaialble if no scopes are available.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "goals_pass_count": &schema.Schema{ + "goals_pass_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that passed the scan.", }, - "goals_unable_to_perform_count": &schema.Schema{ + "goals_unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that could not be validated. A control is listed as 'Unable to perform' when information about its associated resource can't be collected.", }, - "goals_not_applicable_count": &schema.Schema{ + "goals_not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that are not relevant to the current scan. A scan is listed as 'Not applicable' when information about its associated resource can't be found.", }, - "goals_fail_count": &schema.Schema{ + "goals_fail_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that failed the scan.", }, - "goals_total_count": &schema.Schema{ + "goals_total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of goals that were included in the scan.", }, - "controls_pass_count": &schema.Schema{ + "controls_pass_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that passed the scan.", }, - "controls_fail_count": &schema.Schema{ + "controls_fail_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that failed the scan.", }, - "controls_not_applicable_count": &schema.Schema{ + "controls_not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that are not relevant to the current scan. A scan is listed as 'Not applicable' when information about its associated resource can't be found.", }, - "controls_unable_to_perform_count": &schema.Schema{ + "controls_unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that could not be validated. A control is listed as 'Unable to perform' when information about its associated resource can't be collected.", }, - "controls_total_count": &schema.Schema{ + "controls_total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of controls that were included in the scan.", @@ -218,18 +219,18 @@ func dataSourceIBMSccPostureLatestScans() *schema.Resource { } func dataSourceIBMSccPostureListLatestScansRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } listLatestScansOptions := &posturemanagementv2.ListLatestScansOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount listLatestScansOptions.SetAccountID(accountID) var scanList *posturemanagementv2.ScanList @@ -282,28 +283,28 @@ func dataSourceIBMSccPostureListLatestScansRead(context context.Context, d *sche if scanList.First != nil { err = d.Set("first", dataSourceScanListFlattenFirst(*scanList.First)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting first %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting first %s", err)) } } if scanList.Last != nil { err = d.Set("last", dataSourceScanListFlattenLast(*scanList.Last)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting last %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last %s", err)) } } if scanList.Previous != nil { err = d.Set("previous", dataSourceScanListFlattenPrevious(*scanList.Previous)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting previous %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting previous %s", err)) } } if scanList.LatestScans != nil { err = d.Set("latest_scans", dataSourceScanListFlattenLatestScans(scanList.LatestScans)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting latest_scans %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting latest_scans %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_profile.go new file mode 100644 index 0000000000..6f9d6f3dfa --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_profile.go @@ -0,0 +1,161 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package scc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" +) + +func DataSourceIBMSccPostureProfileDetails() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMSccPostureProfileDetailsRead, + + Schema: map[string]*schema.Schema{ + "profile_id": { + Type: schema.TypeString, + Required: true, + Description: "The id for the given API.", + }, + "profile_type": { + Type: schema.TypeString, + Required: true, + Description: "The profile type ID. This will be 4 for profiles and 6 for group profiles.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The name of the profile.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "A description of the profile.", + }, + "version": { + Type: schema.TypeInt, + Computed: true, + Description: "The version of the profile.", + }, + "created_by": { + Type: schema.TypeString, + Computed: true, + Description: "The user who created the profile.", + }, + "modified_by": { + Type: schema.TypeString, + Computed: true, + Description: "The user who last modified the profile.", + }, + "reason_for_delete": { + Type: schema.TypeString, + Computed: true, + Description: "A reason that you want to delete a profile.", + }, + "base_profile": { + Type: schema.TypeString, + Computed: true, + Description: "The base profile that the controls are pulled from.", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: "The type of profile.", + }, + "no_of_controls": { + Type: schema.TypeInt, + Computed: true, + Description: "no of Controls.", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The time that the profile was created in UTC.", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The time that the profile was most recently modified in UTC.", + }, + "enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "The profile status. If the profile is enabled, the value is true. If the profile is disabled, the value is false.", + }, + }, + } +} + +func dataSourceIBMSccPostureProfileDetailsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() + if err != nil { + return diag.FromErr(err) + } + + getProfileOptions := &posturemanagementv2.GetProfileOptions{} + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) + } + + accountID := userDetails.UserAccount + getProfileOptions.SetAccountID(accountID) + + getProfileOptions.SetID(d.Get("profile_id").(string)) + getProfileOptions.SetProfileType(d.Get("profile_type").(string)) + + profile, response, err := postureManagementClient.GetProfileWithContext(context, getProfileOptions) + if err != nil { + log.Printf("[DEBUG] GetProfileWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetProfileWithContext failed %s\n%s", err, response)) + } + + d.SetId(*profile.ID) + if err = d.Set("name", profile.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + if err = d.Set("description", profile.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + if err = d.Set("version", flex.IntValue(profile.Version)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting version: %s", err)) + } + if err = d.Set("created_by", profile.CreatedBy); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) + } + if err = d.Set("modified_by", profile.ModifiedBy); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting modified_by: %s", err)) + } + if err = d.Set("reason_for_delete", profile.ReasonForDelete); err != nil { + return nil //return diag.FromErr(fmt.Errorf("[ERROR] Error setting reason_for_delete: %s", err)) + } + if err = d.Set("base_profile", profile.BaseProfile); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting base_profile: %s", err)) + } + if err = d.Set("type", profile.Type); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) + } + if err = d.Set("no_of_controls", flex.IntValue(profile.NoOfControls)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting no_of_controls: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(profile.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(profile.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) + } + if err = d.Set("enabled", profile.Enabled); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting enabled: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_profiles.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_profiles.go index b5fd0a8cac..bac9d99fa4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_profiles.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -12,25 +12,26 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func dataSourceIBMSccPostureProfiles() *schema.Resource { +func DataSourceIBMSccPostureProfiles() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccPostureListProfilesRead, Schema: map[string]*schema.Schema{ - "first": &schema.Schema{ + "first": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -38,13 +39,13 @@ func dataSourceIBMSccPostureProfiles() *schema.Resource { }, }, }, - "last": &schema.Schema{ + "last": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -52,13 +53,13 @@ func dataSourceIBMSccPostureProfiles() *schema.Resource { }, }, }, - "previous": &schema.Schema{ + "previous": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -66,73 +67,73 @@ func dataSourceIBMSccPostureProfiles() *schema.Resource { }, }, }, - "profiles": &schema.Schema{ + "profiles": { Type: schema.TypeList, Computed: true, Description: "Profiles.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the profile.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "A description of the profile.", }, - "version": &schema.Schema{ + "version": { Type: schema.TypeInt, Computed: true, Description: "The version of the profile.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The user who created the profile.", }, - "modified_by": &schema.Schema{ + "modified_by": { Type: schema.TypeString, Computed: true, Description: "The user who last modified the profile.", }, - "reason_for_delete": &schema.Schema{ + "reason_for_delete": { Type: schema.TypeString, Computed: true, Description: "A reason that you want to delete a profile.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "An auto-generated unique identifying number of the profile.", }, - "base_profile": &schema.Schema{ + "base_profile": { Type: schema.TypeString, Computed: true, Description: "The base profile that the controls are pulled from.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of profile.", }, - "no_of_controls": &schema.Schema{ + "no_of_controls": { Type: schema.TypeInt, Computed: true, Description: "no of Controls.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time that the profile was created in UTC.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time that the profile was most recently modified in UTC.", }, - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "The profile status. If the profile is enabled, the value is true. If the profile is disabled, the value is false.", @@ -145,18 +146,18 @@ func dataSourceIBMSccPostureProfiles() *schema.Resource { } func dataSourceIBMSccPostureListProfilesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } listProfilesOptions := &posturemanagementv2.ListProfilesOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount listProfilesOptions.SetAccountID(accountID) var profileList *posturemanagementv2.ProfileList @@ -187,28 +188,28 @@ func dataSourceIBMSccPostureListProfilesRead(context context.Context, d *schema. if profileList.First != nil { err = d.Set("first", dataSourceProfileListFlattenFirst(*profileList.First)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting first %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting first %s", err)) } } if profileList.Last != nil { err = d.Set("last", dataSourceProfileListFlattenLast(*profileList.Last)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting last %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last %s", err)) } } if profileList.Previous != nil { err = d.Set("previous", dataSourceProfileListFlattenPrevious(*profileList.Previous)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting previous %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting previous %s", err)) } } if profileList.Profiles != nil { err = d.Set("profiles", dataSourceProfileListFlattenProfiles(profileList.Profiles)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting profiles %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profiles %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scan_summaries.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scan_summaries.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scan_summaries.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scan_summaries.go index 1202c1a74c..fe5ad1339e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scan_summaries.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scan_summaries.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -12,30 +12,31 @@ import ( "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func dataSourceIBMSccPostureScanSummaries() *schema.Resource { +func DataSourceIBMSccPostureScanSummaries() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccPostureScanSummariesRead, Schema: map[string]*schema.Schema{ - "report_setting_id": &schema.Schema{ + "report_setting_id": { Type: schema.TypeString, Required: true, Description: "The report setting ID. This can be obtained from the /validations/latest_scans API call.", }, - "first": &schema.Schema{ + "first": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -43,13 +44,13 @@ func dataSourceIBMSccPostureScanSummaries() *schema.Resource { }, }, }, - "last": &schema.Schema{ + "last": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -57,13 +58,13 @@ func dataSourceIBMSccPostureScanSummaries() *schema.Resource { }, }, }, - "previous": &schema.Schema{ + "previous": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -71,125 +72,125 @@ func dataSourceIBMSccPostureScanSummaries() *schema.Resource { }, }, }, - "summaries": &schema.Schema{ + "summaries": { Type: schema.TypeList, Computed: true, Description: "Summaries.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID of the scan.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "A system generated name that is the combination of 12 characters in the scope name and 12 characters of a profile name.", }, - "scope_id": &schema.Schema{ + "scope_id": { Type: schema.TypeString, Computed: true, Description: "The ID of the scope.", }, - "scope_name": &schema.Schema{ + "scope_name": { Type: schema.TypeString, Computed: true, Description: "The name of the scope.", }, - "report_run_by": &schema.Schema{ + "report_run_by": { Type: schema.TypeString, Computed: true, Description: "The entity that ran the report.", }, - "start_time": &schema.Schema{ + "start_time": { Type: schema.TypeString, Computed: true, Description: "The date and time the scan was run.", }, - "end_time": &schema.Schema{ + "end_time": { Type: schema.TypeString, Computed: true, Description: "The date and time the scan completed.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the collector as it completes a scan.", }, - "profiles": &schema.Schema{ + "profiles": { Type: schema.TypeList, Computed: true, Description: "The list of profiles.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID of the profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the profile.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of profile. To learn more about profile types, check out the [docs] (https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-profiles).", }, - "validation_result": &schema.Schema{ + "validation_result": { Type: schema.TypeList, Computed: true, Description: "The result of a scan.The above values will not be avaialble if no scopes are available.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "goals_pass_count": &schema.Schema{ + "goals_pass_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that passed the scan.", }, - "goals_unable_to_perform_count": &schema.Schema{ + "goals_unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that could not be validated. A control is listed as 'Unable to perform' when information about its associated resource can't be collected.", }, - "goals_not_applicable_count": &schema.Schema{ + "goals_not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that are not relevant to the current scan. A scan is listed as 'Not applicable' when information about its associated resource can't be found.", }, - "goals_fail_count": &schema.Schema{ + "goals_fail_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that failed the scan.", }, - "goals_total_count": &schema.Schema{ + "goals_total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of goals that were included in the scan.", }, - "controls_pass_count": &schema.Schema{ + "controls_pass_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that passed the scan.", }, - "controls_fail_count": &schema.Schema{ + "controls_fail_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that failed the scan.", }, - "controls_not_applicable_count": &schema.Schema{ + "controls_not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that are not relevant to the current scan. A scan is listed as 'Not applicable' when information about its associated resource can't be found.", }, - "controls_unable_to_perform_count": &schema.Schema{ + "controls_unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that could not be validated. A control is listed as 'Unable to perform' when information about its associated resource can't be collected.", }, - "controls_total_count": &schema.Schema{ + "controls_total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of controls that were included in the scan.", @@ -200,79 +201,79 @@ func dataSourceIBMSccPostureScanSummaries() *schema.Resource { }, }, }, - "group_profiles": &schema.Schema{ + "group_profiles": { Type: schema.TypeList, Computed: true, Description: "The list of group profiles.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID of the profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the profile.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of profile. To learn more about profile types, check out the [docs] (https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-profiles).", }, - "validation_result": &schema.Schema{ + "validation_result": { Type: schema.TypeList, Computed: true, Description: "The result of a scan.The above values will not be avaialble if no scopes are available.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "goals_pass_count": &schema.Schema{ + "goals_pass_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that passed the scan.", }, - "goals_unable_to_perform_count": &schema.Schema{ + "goals_unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that could not be validated. A control is listed as 'Unable to perform' when information about its associated resource can't be collected.", }, - "goals_not_applicable_count": &schema.Schema{ + "goals_not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that are not relevant to the current scan. A scan is listed as 'Not applicable' when information about its associated resource can't be found.", }, - "goals_fail_count": &schema.Schema{ + "goals_fail_count": { Type: schema.TypeInt, Computed: true, Description: "The number of goals that failed the scan.", }, - "goals_total_count": &schema.Schema{ + "goals_total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of goals that were included in the scan.", }, - "controls_pass_count": &schema.Schema{ + "controls_pass_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that passed the scan.", }, - "controls_fail_count": &schema.Schema{ + "controls_fail_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that failed the scan.", }, - "controls_not_applicable_count": &schema.Schema{ + "controls_not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that are not relevant to the current scan. A scan is listed as 'Not applicable' when information about its associated resource can't be found.", }, - "controls_unable_to_perform_count": &schema.Schema{ + "controls_unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of controls that could not be validated. A control is listed as 'Unable to perform' when information about its associated resource can't be collected.", }, - "controls_total_count": &schema.Schema{ + "controls_total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of controls that were included in the scan.", @@ -291,18 +292,18 @@ func dataSourceIBMSccPostureScanSummaries() *schema.Resource { } func dataSourceIBMSccPostureScanSummariesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } scanSummariesOptions := &posturemanagementv2.ScanSummariesOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount scanSummariesOptions.SetAccountID(accountID) scanSummariesOptions.SetReportSettingID(d.Get("report_setting_id").(string)) @@ -335,28 +336,28 @@ func dataSourceIBMSccPostureScanSummariesRead(context context.Context, d *schema if summaryList.First != nil { err = d.Set("first", dataSourceSummaryListFlattenFirst(*summaryList.First)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting first %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting first %s", err)) } } if summaryList.Last != nil { err = d.Set("last", dataSourceSummaryListFlattenLast(*summaryList.Last)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting last %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last %s", err)) } } if summaryList.Previous != nil { err = d.Set("previous", dataSourceSummaryListFlattenPrevious(*summaryList.Previous)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting previous %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting previous %s", err)) } } if summaryList.Summaries != nil { err = d.Set("summaries", dataSourceSummaryListFlattenSummaries(summaryList.Summaries)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting summaries %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting summaries %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scan_summary.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scan_summary.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scan_summary.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scan_summary.go index 7d31227822..7bc6b41e89 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scan_summary.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scan_summary.go @@ -1,148 +1,149 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func dataSourceIBMSccPostureScansSummary() *schema.Resource { +func DataSourceIBMSccPostureScansSummary() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccPostureScansSummaryRead, Schema: map[string]*schema.Schema{ - "scan_id": &schema.Schema{ + "scan_id": { Type: schema.TypeString, Required: true, Description: "Your Scan ID.", }, - "profile_id": &schema.Schema{ + "profile_id": { Type: schema.TypeString, Required: true, Description: "The profile ID. This can be obtained from the Security and Compliance Center UI by clicking on the profile name. The URL contains the ID.", }, - "discover_id": &schema.Schema{ + "discover_id": { Type: schema.TypeString, Computed: true, Description: "The scan discovery ID.", }, - "profile_name": &schema.Schema{ + "profile_name": { Type: schema.TypeString, Computed: true, Description: "The scan profile name.", }, - "scope_id": &schema.Schema{ + "scope_id": { Type: schema.TypeString, Computed: true, Description: "The scan summary scope ID.", }, - "controls": &schema.Schema{ + "controls": { Type: schema.TypeList, Computed: true, Description: "The list of controls on the scan summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The scan summary control ID.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The control status.", }, - "external_control_id": &schema.Schema{ + "external_control_id": { Type: schema.TypeString, Computed: true, Description: "The external control ID.", }, - "desciption": &schema.Schema{ + "desciption": { Type: schema.TypeString, Computed: true, Description: "The scan profile name.", }, - "goals": &schema.Schema{ + "goals": { Type: schema.TypeList, Computed: true, Description: "The list of goals on the control.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the goal.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The goal ID.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The goal status.", }, - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Computed: true, Description: "The severity of the goal.", }, - "completed_time": &schema.Schema{ + "completed_time": { Type: schema.TypeString, Computed: true, Description: "The report completed time.", }, - "error": &schema.Schema{ + "error": { Type: schema.TypeString, Computed: true, Description: "The error on goal validation.", }, - "resource_result": &schema.Schema{ + "resource_result": { Type: schema.TypeList, Computed: true, Description: "The list of resource results.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The resource name.", }, - "types": &schema.Schema{ + "types": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The resource control result status.", }, - "display_expected_value": &schema.Schema{ + "display_expected_value": { Type: schema.TypeString, Computed: true, Description: "The expected results of a resource.", }, - "actual_value": &schema.Schema{ + "actual_value": { Type: schema.TypeString, Computed: true, Description: "The actual results of a resource.", }, - "results_info": &schema.Schema{ + "results_info": { Type: schema.TypeString, Computed: true, Description: "The results information.", }, - "not_applicable_reason": &schema.Schema{ + "not_applicable_reason": { Type: schema.TypeString, Computed: true, Description: "The reason for goal not applicable for a resource.", @@ -153,28 +154,28 @@ func dataSourceIBMSccPostureScansSummary() *schema.Resource { }, }, }, - "resource_statistics": &schema.Schema{ + "resource_statistics": { Type: schema.TypeList, Computed: true, Description: "A scans summary controls.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "pass_count": &schema.Schema{ + "pass_count": { Type: schema.TypeInt, Computed: true, Description: "The resource count of pass controls.", }, - "fail_count": &schema.Schema{ + "fail_count": { Type: schema.TypeInt, Computed: true, Description: "The resource count of fail controls.", }, - "unable_to_perform_count": &schema.Schema{ + "unable_to_perform_count": { Type: schema.TypeInt, Computed: true, Description: "The number of resources that were unable to be scanned against a control.", }, - "not_applicable_count": &schema.Schema{ + "not_applicable_count": { Type: schema.TypeInt, Computed: true, Description: "The resource count of not applicable(na) controls.", @@ -190,18 +191,18 @@ func dataSourceIBMSccPostureScansSummary() *schema.Resource { } func dataSourceIBMSccPostureScansSummaryRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } scansSummaryOptions := &posturemanagementv2.ScansSummaryOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount scansSummaryOptions.SetAccountID(accountID) scansSummaryOptions.SetScanID(d.Get("scan_id").(string)) @@ -216,19 +217,19 @@ func dataSourceIBMSccPostureScansSummaryRead(context context.Context, d *schema. d.SetId(*summary.ID) if err = d.Set("discover_id", summary.DiscoverID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting discover_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting discover_id: %s", err)) } if err = d.Set("profile_name", summary.ProfileName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting profile_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile_name: %s", err)) } if err = d.Set("scope_id", summary.ScopeID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting scope_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting scope_id: %s", err)) } if summary.Controls != nil { err = d.Set("controls", dataSourceSummaryFlattenControlsv2(summary.Controls)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting controls %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting controls %s", err)) } } @@ -255,8 +256,8 @@ func dataSourceSummaryControlsToMapv2(controlsItem posturemanagementv2.Control) if controlsItem.ExternalControlID != nil { controlsMap["external_control_id"] = controlsItem.ExternalControlID } - if controlsItem.Desciption != nil { - controlsMap["desciption"] = controlsItem.Desciption + if controlsItem.Description != nil { + controlsMap["description"] = controlsItem.Description } if controlsItem.Goals != nil { goalsList := []map[string]interface{}{} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scope_correlation.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scope_correlation.go new file mode 100644 index 0000000000..ac7336889b --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scope_correlation.go @@ -0,0 +1,89 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package scc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" +) + +func DataSourceIBMSccPostureScopeCorrelation() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMSccPostureScopeCorrelationRead, + + Schema: map[string]*schema.Schema{ + "correlation_id": { + Type: schema.TypeString, + Required: true, + Description: "A correlation_Id is created when a scope is created and discovery task is triggered or when a validation is triggered on a Scope. This is used to get the status of the task(discovery or validation).", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Returns the current status of a task.", + }, + "start_time": { + Type: schema.TypeString, + Computed: true, + Description: "Returns the time that task started.", + }, + "last_heartbeat": { + Type: schema.TypeString, + Computed: true, + Description: "Returns the time that the scope was last updated. This value exists when collector is installed and running.", + }, + }, + } +} + +func dataSourceIBMSccPostureScopeCorrelationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() + if err != nil { + return diag.FromErr(err) + } + + getCorrelationIDOptions := &posturemanagementv2.GetCorrelationIDOptions{} + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) + } + + accountID := userDetails.UserAccount + getCorrelationIDOptions.SetAccountID(accountID) + + getCorrelationIDOptions.SetCorrelationID(d.Get("correlation_id").(string)) + + scopeTaskStatus, response, err := postureManagementClient.GetCorrelationIDWithContext(context, getCorrelationIDOptions) + if err != nil { + log.Printf("[DEBUG] GetCorrelationIDWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetCorrelationIDWithContext failed %s\n%s", err, response)) + } + + d.SetId(dataSourceIBMSccPostureScopeCorrelationID(d)) + if err = d.Set("status", scopeTaskStatus.Status); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) + } + if err = d.Set("start_time", scopeTaskStatus.StartTime); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting start_time: %s", err)) + } + if err = d.Set("last_heartbeat", flex.DateTimeToString(scopeTaskStatus.LastHeartbeat)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_heartbeat: %s", err)) + } + + return nil +} + +// dataSourceIBMScopeCorrelationID returns a reasonable ID for the list. +func dataSourceIBMSccPostureScopeCorrelationID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scopes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scopes.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scopes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scopes.go index 95b06e193f..d2c9923bb8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_posture_scopes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_posture_scopes.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,39 +9,41 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func dataSourceIBMSccPostureScopes() *schema.Resource { +func DataSourceIBMSccPostureScopes() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccPostureListScopesRead, Schema: map[string]*schema.Schema{ - "offset": &schema.Schema{ + "offset": { Type: schema.TypeInt, Computed: true, Description: "The offset of the page.", }, - "limit": &schema.Schema{ + "limit": { Type: schema.TypeInt, Computed: true, Description: "The number of scopes displayed per page.", }, - "total_count": &schema.Schema{ + "total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of scopes. This value is 0 if no scopes are available and below fields will not be available in that case.", }, - "first": &schema.Schema{ + "first": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -49,13 +51,13 @@ func dataSourceIBMSccPostureScopes() *schema.Resource { }, }, }, - "last": &schema.Schema{ + "last": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -63,13 +65,13 @@ func dataSourceIBMSccPostureScopes() *schema.Resource { }, }, }, - "previous": &schema.Schema{ + "previous": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -77,13 +79,13 @@ func dataSourceIBMSccPostureScopes() *schema.Resource { }, }, }, - "next": &schema.Schema{ + "next": { Type: schema.TypeList, Computed: true, Description: "The URL of a page.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL of a page.", @@ -91,224 +93,224 @@ func dataSourceIBMSccPostureScopes() *schema.Resource { }, }, }, - "scopes": &schema.Schema{ + "scopes": { Type: schema.TypeList, Computed: true, Description: "Scopes.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "A detailed description of the scope.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The user who created the scope.", }, - "modified_by": &schema.Schema{ + "modified_by": { Type: schema.TypeString, Computed: true, Description: "The user who most recently modified the scope.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "An auto-generated unique identifier for the scope.", }, - "uuid": &schema.Schema{ + "uuid": { Type: schema.TypeString, Computed: true, Description: "Stores the value of scope_uuid .", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "A unique name for your scope.", }, - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether scope is enabled/disabled.", }, - "credential_type": &schema.Schema{ + "credential_type": { Type: schema.TypeString, Computed: true, Description: "The environment that the scope is targeted to.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The time that the scope was created in UTC.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The time that the scope was last modified in UTC.", }, - "collectors": &schema.Schema{ + "collectors": { Type: schema.TypeList, Computed: true, Description: "Stores the value of collectors .Will be displayed only when value exists.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The id of the collector.", }, - "display_name": &schema.Schema{ + "display_name": { Type: schema.TypeString, Computed: true, Description: "The user-friendly name of the collector.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the collector.", }, - "public_key": &schema.Schema{ + "public_key": { Type: schema.TypeString, Computed: true, Description: "The public key of the collector.Will be used for ssl communciation between collector and orchestrator .This will be populated when collector is installed.", }, - "last_heartbeat": &schema.Schema{ + "last_heartbeat": { Type: schema.TypeString, Computed: true, Description: "Stores the heartbeat time of a controller . This value exists when collector is installed and running.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of collector.", }, - "collector_version": &schema.Schema{ + "collector_version": { Type: schema.TypeString, Computed: true, Description: "The collector version. This field is populated when collector is installed.", }, - "image_version": &schema.Schema{ + "image_version": { Type: schema.TypeString, Computed: true, Description: "The image version of the collector. This field is populated when collector is installed. \".", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the collector.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The id of the user that created the collector.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The ISO Date/Time the collector was created.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The id of the user that modified the collector.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The ISO Date/Time the collector was modified.", }, - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Computed: true, Description: "Identifies whether the collector is enabled or not(deleted).", }, - "registration_code": &schema.Schema{ + "registration_code": { Type: schema.TypeString, Computed: true, Description: "The registration code of the collector.This is will be used for initial authentication during installation of collector.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of the collector.", }, - "credential_public_key": &schema.Schema{ + "credential_public_key": { Type: schema.TypeString, Computed: true, Description: "The credential public key.", }, - "failure_count": &schema.Schema{ + "failure_count": { Type: schema.TypeInt, Computed: true, Description: "The number of times the collector has failed.", }, - "approved_local_gateway_ip": &schema.Schema{ + "approved_local_gateway_ip": { Type: schema.TypeString, Computed: true, Description: "The approved local gateway ip of the collector. This field will be populated only when collector is installed.", }, - "approved_internet_gateway_ip": &schema.Schema{ + "approved_internet_gateway_ip": { Type: schema.TypeString, Computed: true, Description: "The approved internet gateway ip of the collector. This field will be populated only when collector is installed.", }, - "last_failed_local_gateway_ip": &schema.Schema{ + "last_failed_local_gateway_ip": { Type: schema.TypeString, Computed: true, Description: "The failed local gateway ip. This field will be populated only when collector is installed.", }, - "reset_reason": &schema.Schema{ + "reset_reason": { Type: schema.TypeString, Computed: true, Description: "The reason for the collector reset .User resets the collector with a reason for reset. The reason entered by the user is saved in this field .", }, - "hostname": &schema.Schema{ + "hostname": { Type: schema.TypeString, Computed: true, Description: "The collector host name. This field will be populated when collector is installed.This will have fully qualified domain name.", }, - "install_path": &schema.Schema{ + "install_path": { Type: schema.TypeString, Computed: true, Description: "The installation path of the collector. This field will be populated when collector is installed.The value will be folder path.", }, - "use_private_endpoint": &schema.Schema{ + "use_private_endpoint": { Type: schema.TypeBool, Computed: true, Description: "Whether the collector should use a public or private endpoint. This value is generated based on is_public field value during collector creation. If is_public is set to true, this value will be false.", }, - "managed_by": &schema.Schema{ + "managed_by": { Type: schema.TypeString, Computed: true, Description: "The entity that manages the collector.", }, - "trial_expiry": &schema.Schema{ + "trial_expiry": { Type: schema.TypeString, Computed: true, Description: "The trial expiry. This holds the expiry date of registration_code. This field will be populated when collector is installed.", }, - "last_failed_internet_gateway_ip": &schema.Schema{ + "last_failed_internet_gateway_ip": { Type: schema.TypeString, Computed: true, Description: "The failed internet gateway ip of the collector.", }, - "status_description": &schema.Schema{ + "status_description": { Type: schema.TypeString, Computed: true, Description: "The collector status.", }, - "reset_time": &schema.Schema{ + "reset_time": { Type: schema.TypeString, Computed: true, Description: "The ISO Date/Time of the collector reset. This value will be populated when a collector is reset. The data-time when the reset event is occured is captured in this field.", }, - "is_public": &schema.Schema{ + "is_public": { Type: schema.TypeBool, Computed: true, Description: "Determines whether the collector endpoint is accessible on a public network.If set to `true`, the collector connects to resources in your account over a public network. If set to `false`, the collector connects to resources by using a private IP that is accessible only through the IBM Cloud private network.", }, - "is_ubi_image": &schema.Schema{ + "is_ubi_image": { Type: schema.TypeBool, Computed: true, Description: "Determines whether the collector has a Ubi image.", @@ -324,18 +326,18 @@ func dataSourceIBMSccPostureScopes() *schema.Resource { } func dataSourceIBMSccPostureListScopesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } listScopesOptions := &posturemanagementv2.ListScopesOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount listScopesOptions.SetAccountID(accountID) finalList, response, err := postureManagementClient.ListScopesWithContext(context, listScopesOptions) @@ -347,48 +349,48 @@ func dataSourceIBMSccPostureListScopesRead(context context.Context, d *schema.Re scopeList := finalList d.SetId(dataSourceIBMSccPostureListScopesID(d)) - if err = d.Set("offset", intValue(scopeList.Offset)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting offset: %s", err)) + if err = d.Set("offset", flex.IntValue(scopeList.Offset)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting offset: %s", err)) } - if err = d.Set("limit", intValue(scopeList.Limit)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting limit: %s", err)) + if err = d.Set("limit", flex.IntValue(scopeList.Limit)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting limit: %s", err)) } - if err = d.Set("total_count", intValue(scopeList.TotalCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + if err = d.Set("total_count", flex.IntValue(scopeList.TotalCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } if scopeList.First != nil { err = d.Set("first", dataSourceScopeListFlattenFirst(*scopeList.First)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting first %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting first %s", err)) } } if scopeList.Last != nil { err = d.Set("last", dataSourceScopeListFlattenLast(*scopeList.Last)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting last %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last %s", err)) } } if scopeList.Previous != nil { err = d.Set("previous", dataSourceScopeListFlattenPrevious(*scopeList.Previous)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting previous %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting previous %s", err)) } } if scopeList.Next != nil { err = d.Set("next", dataSourceScopeListFlattenNext(*scopeList.Next)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting next %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting next %s", err)) } } if scopeList.Scopes != nil { err = d.Set("scopes", dataSourceScopeListFlattenScopes(scopeList.Scopes)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting scopes %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting scopes %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_note.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_note.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_note.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_note.go index 8ce77c2fa6..95dff07812 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_note.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_note.go @@ -1,64 +1,66 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/scc-go-sdk/findingsv1" ) -func dataSourceIBMSccSiNote() *schema.Resource { +func DataSourceIBMSccSiNote() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccSiNoteRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, }, - "provider_id": &schema.Schema{ + "provider_id": { Type: schema.TypeString, Required: true, Description: "Part of the parent. This field contains the provider ID. For example: providers/{provider_id}.", }, - "note_id": &schema.Schema{ + "note_id": { Type: schema.TypeString, Required: true, Description: "Second part of note `name`: providers/{provider_id}/notes/{note_id}.", }, - "short_description": &schema.Schema{ + "short_description": { Type: schema.TypeString, Computed: true, Description: "A one sentence description of your note.", }, - "long_description": &schema.Schema{ + "long_description": { Type: schema.TypeString, Computed: true, Description: "A more detailed description of your note.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "The type of note. Use this field to filter notes and occurences by kind. - FINDING: The note and occurrence represent a finding. - KPI: The note and occurrence represent a KPI value. - CARD: The note represents a card showing findings and related metric values. - CARD_CONFIGURED: The note represents a card configured for a user account. - SECTION: The note represents a section in a dashboard.", }, - "related_url": &schema.Schema{ + "related_url": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "label": &schema.Schema{ + "label": { Type: schema.TypeString, Computed: true, Description: "Label to describe usage of the URL.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL that you want to associate with the note.", @@ -66,38 +68,38 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "create_time": &schema.Schema{ + "create_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this note was created. This field can be used as a filter in list requests.", }, - "update_time": &schema.Schema{ + "update_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this note was last updated. This field can be used as a filter in list requests.", }, - "shared": &schema.Schema{ + "shared": { Type: schema.TypeBool, Computed: true, Description: "True if this note can be shared by multiple accounts.", }, - "reported_by": &schema.Schema{ + "reported_by": { Type: schema.TypeList, Computed: true, Description: "The entity reporting a note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The id of this reporter.", }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "The title of this reporter.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The url of this reporter.", @@ -105,29 +107,29 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "finding": &schema.Schema{ + "finding": { Type: schema.TypeList, Computed: true, Description: "FindingType provides details about a finding note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Computed: true, Description: "Note provider-assigned severity/impact ranking- LOW: Low Impact- MEDIUM: Medium Impact- HIGH: High Impact- CRITICAL: Critical Impact.", }, - "next_steps": &schema.Schema{ + "next_steps": { Type: schema.TypeList, Computed: true, Description: "Common remediation steps for the finding of this type.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "Title of this next step.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL associated to this next steps.", @@ -138,13 +140,13 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "kpi": &schema.Schema{ + "kpi": { Type: schema.TypeList, Computed: true, Description: "KpiType provides details about a KPI note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "aggregation_type": &schema.Schema{ + "aggregation_type": { Type: schema.TypeString, Computed: true, Description: "The aggregation type of the KPI values. - SUM: A single-value metrics aggregation type that sums up numeric values that are extracted from KPI occurrences.", @@ -152,33 +154,33 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "card": &schema.Schema{ + "card": { Type: schema.TypeList, Computed: true, Description: "Card provides details about a card kind of note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "section": &schema.Schema{ + "section": { Type: schema.TypeString, Computed: true, Description: "The section this card belongs to.", }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "The title of this card.", }, - "subtitle": &schema.Schema{ + "subtitle": { Type: schema.TypeString, Computed: true, Description: "The subtitle of this card.", }, - "order": &schema.Schema{ + "order": { Type: schema.TypeInt, Computed: true, Description: "The order of the card in which it will appear on SA dashboard in the mentioned section.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Computed: true, Description: "The finding note names associated to this card.", @@ -186,62 +188,62 @@ func dataSourceIBMSccSiNote() *schema.Resource { Type: schema.TypeString, }, }, - "requires_configuration": &schema.Schema{ + "requires_configuration": { Type: schema.TypeBool, Computed: true, }, - "badge_text": &schema.Schema{ + "badge_text": { Type: schema.TypeString, Computed: true, Description: "The text associated to the card's badge.", }, - "badge_image": &schema.Schema{ + "badge_image": { Type: schema.TypeString, Computed: true, Description: "The base64 content of the image associated to the card's badge.", }, - "elements": &schema.Schema{ + "elements": { Type: schema.TypeList, Computed: true, Description: "The elements of this card.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Computed: true, Description: "The text of this card element.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "Kind of element- NUMERIC: Single numeric value- BREAKDOWN: Breakdown of numeric values- TIME_SERIES: Time-series of numeric values.", }, - "default_time_range": &schema.Schema{ + "default_time_range": { Type: schema.TypeString, Computed: true, Description: "The default time range of this card element.", }, - "value_type": &schema.Schema{ + "value_type": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "Kind of element- KPI: Kind of value derived from a KPI occurrence.", }, - "kpi_note_name": &schema.Schema{ + "kpi_note_name": { Type: schema.TypeString, Computed: true, Description: "The name of the kpi note associated to the occurrence with the value for this card element value type.", }, - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Computed: true, Description: "The text of this element type.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Computed: true, Description: "the names of the finding note associated that act as filters for counting the occurrences.", @@ -252,28 +254,28 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "value_types": &schema.Schema{ + "value_types": { Type: schema.TypeList, Computed: true, Description: "the value types associated to this card element.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "Kind of element- KPI: Kind of value derived from a KPI occurrence.", }, - "kpi_note_name": &schema.Schema{ + "kpi_note_name": { Type: schema.TypeString, Computed: true, Description: "The name of the kpi note associated to the occurrence with the value for this card element value type.", }, - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Computed: true, Description: "The text of this element type.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Computed: true, Description: "the names of the finding note associated that act as filters for counting the occurrences.", @@ -284,7 +286,7 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "default_interval": &schema.Schema{ + "default_interval": { Type: schema.TypeString, Computed: true, Description: "The default interval of the time series.", @@ -295,18 +297,18 @@ func dataSourceIBMSccSiNote() *schema.Resource { }, }, }, - "section": &schema.Schema{ + "section": { Type: schema.TypeList, Computed: true, Description: "Card provides details about a card kind of note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "The title of this section.", }, - "image": &schema.Schema{ + "image": { Type: schema.TypeString, Computed: true, Description: "The image of this section.", @@ -319,11 +321,11 @@ func dataSourceIBMSccSiNote() *schema.Resource { } func dataSourceIBMSccSiNoteRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -331,7 +333,7 @@ func dataSourceIBMSccSiNoteRead(context context.Context, d *schema.ResourceData, accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -349,63 +351,63 @@ func dataSourceIBMSccSiNoteRead(context context.Context, d *schema.ResourceData, d.SetId(fmt.Sprintf("%s/%s/%s", *findingsClient.AccountID, *getNoteOptions.ProviderID, *getNoteOptions.NoteID)) if err = d.Set("short_description", apiNote.ShortDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting short_description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting short_description: %s", err)) } if err = d.Set("long_description", apiNote.LongDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting long_description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting long_description: %s", err)) } if err = d.Set("kind", apiNote.Kind); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kind: %s", err)) } if apiNote.RelatedURL != nil { err = d.Set("related_url", dataSourceAPINoteFlattenRelatedURL(apiNote.RelatedURL)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting related_url %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting related_url %s", err)) } } - if err = d.Set("create_time", dateTimeToString(apiNote.CreateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting create_time: %s", err)) + if err = d.Set("create_time", flex.DateTimeToString(apiNote.CreateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting create_time: %s", err)) } - if err = d.Set("update_time", dateTimeToString(apiNote.UpdateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting update_time: %s", err)) + if err = d.Set("update_time", flex.DateTimeToString(apiNote.UpdateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting update_time: %s", err)) } if err = d.Set("shared", apiNote.Shared); err != nil { - return diag.FromErr(fmt.Errorf("Error setting shared: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting shared: %s", err)) } if apiNote.ReportedBy != nil { err = d.Set("reported_by", dataSourceAPINoteFlattenReportedBy(*apiNote.ReportedBy)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting reported_by %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting reported_by %s", err)) } } if apiNote.Finding != nil { err = d.Set("finding", dataSourceAPINoteFlattenFinding(*apiNote.Finding)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting finding %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting finding %s", err)) } } if apiNote.Kpi != nil { err = d.Set("kpi", dataSourceAPINoteFlattenKpi(*apiNote.Kpi)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting kpi %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kpi %s", err)) } } if apiNote.Card != nil { err = d.Set("card", dataSourceAPINoteFlattenCard(*apiNote.Card)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting card %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting card %s", err)) } } if apiNote.Section != nil { err = d.Set("section", dataSourceAPINoteFlattenSection(*apiNote.Section)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting section %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting section %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_notes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_notes.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_notes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_notes.go index 66b4368468..95373e2883 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_notes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_notes.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,6 +9,9 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -23,68 +26,68 @@ func ValidatePageSize(val interface{}, key string) (warns []string, errs []error return } -func dataSourceIBMSccSiNotes() *schema.Resource { +func DataSourceIBMSccSiNotes() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccSiNotesRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, }, - "provider_id": &schema.Schema{ + "provider_id": { Type: schema.TypeString, Required: true, Description: "Part of the parent. This field contains the provider ID. For example: providers/{provider_id}.", }, - "page_size": &schema.Schema{ + "page_size": { Type: schema.TypeInt, Optional: true, ValidateFunc: ValidatePageSize, Description: "Number of notes to return in the list.", }, - "page_token": &schema.Schema{ + "page_token": { Type: schema.TypeString, Optional: true, Description: "Token to provide to skip to a particular spot in the list.", }, - "notes": &schema.Schema{ + "notes": { Type: schema.TypeList, Computed: true, Description: "The notes requested.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "note_id": &schema.Schema{ + "note_id": { Type: schema.TypeString, Computed: true, Description: "The id of the note.", }, - "short_description": &schema.Schema{ + "short_description": { Type: schema.TypeString, Computed: true, Description: "A one sentence description of your note.", }, - "long_description": &schema.Schema{ + "long_description": { Type: schema.TypeString, Computed: true, Description: "A more detailed description of your note.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "The type of note. Use this field to filter notes and occurences by kind. - FINDING: The note and occurrence represent a finding. - KPI: The note and occurrence represent a KPI value. - CARD: The note represents a card showing findings and related metric values. - CARD_CONFIGURED: The note represents a card configured for a user account. - SECTION: The note represents a section in a dashboard.", }, - "related_url": &schema.Schema{ + "related_url": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "label": &schema.Schema{ + "label": { Type: schema.TypeString, Computed: true, Description: "Label to describe usage of the URL.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL that you want to associate with the note.", @@ -92,38 +95,38 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "create_time": &schema.Schema{ + "create_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this note was created. This field can be used as a filter in list requests.", }, - "update_time": &schema.Schema{ + "update_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this note was last updated. This field can be used as a filter in list requests.", }, - "shared": &schema.Schema{ + "shared": { Type: schema.TypeBool, Computed: true, Description: "True if this note can be shared by multiple accounts.", }, - "reported_by": &schema.Schema{ + "reported_by": { Type: schema.TypeList, Computed: true, Description: "The entity reporting a note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The id of this reporter.", }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "The title of this reporter.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The url of this reporter.", @@ -131,29 +134,29 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "finding": &schema.Schema{ + "finding": { Type: schema.TypeList, Computed: true, Description: "FindingType provides details about a finding note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Computed: true, Description: "Note provider-assigned severity/impact ranking- LOW: Low Impact- MEDIUM: Medium Impact- HIGH: High Impact- CRITICAL: Critical Impact.", }, - "next_steps": &schema.Schema{ + "next_steps": { Type: schema.TypeList, Computed: true, Description: "Common remediation steps for the finding of this type.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "Title of this next step.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL associated to this next steps.", @@ -164,13 +167,13 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "kpi": &schema.Schema{ + "kpi": { Type: schema.TypeList, Computed: true, Description: "KpiType provides details about a KPI note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "aggregation_type": &schema.Schema{ + "aggregation_type": { Type: schema.TypeString, Computed: true, Description: "The aggregation type of the KPI values. - SUM: A single-value metrics aggregation type that sums up numeric values that are extracted from KPI occurrences.", @@ -178,33 +181,33 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "card": &schema.Schema{ + "card": { Type: schema.TypeList, Computed: true, Description: "Card provides details about a card kind of note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "section": &schema.Schema{ + "section": { Type: schema.TypeString, Computed: true, Description: "The section this card belongs to.", }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "The title of this card.", }, - "subtitle": &schema.Schema{ + "subtitle": { Type: schema.TypeString, Computed: true, Description: "The subtitle of this card.", }, - "order": &schema.Schema{ + "order": { Type: schema.TypeInt, Computed: true, Description: "The order of the card in which it will appear on SA dashboard in the mentioned section.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Computed: true, Description: "The finding note names associated to this card.", @@ -212,62 +215,62 @@ func dataSourceIBMSccSiNotes() *schema.Resource { Type: schema.TypeString, }, }, - "requires_configuration": &schema.Schema{ + "requires_configuration": { Type: schema.TypeBool, Computed: true, }, - "badge_text": &schema.Schema{ + "badge_text": { Type: schema.TypeString, Computed: true, Description: "The text associated to the card's badge.", }, - "badge_image": &schema.Schema{ + "badge_image": { Type: schema.TypeString, Computed: true, Description: "The base64 content of the image associated to the card's badge.", }, - "elements": &schema.Schema{ + "elements": { Type: schema.TypeList, Computed: true, Description: "The elements of this card.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Computed: true, Description: "The text of this card element.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "Kind of element- NUMERIC: Single numeric value- BREAKDOWN: Breakdown of numeric values- TIME_SERIES: Time-series of numeric values.", }, - "default_time_range": &schema.Schema{ + "default_time_range": { Type: schema.TypeString, Computed: true, Description: "The default time range of this card element.", }, - "value_type": &schema.Schema{ + "value_type": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "Kind of element- KPI: Kind of value derived from a KPI occurrence.", }, - "kpi_note_name": &schema.Schema{ + "kpi_note_name": { Type: schema.TypeString, Computed: true, Description: "The name of the kpi note associated to the occurrence with the value for this card element value type.", }, - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Computed: true, Description: "The text of this element type.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Computed: true, Description: "the names of the finding note associated that act as filters for counting the occurrences.", @@ -278,28 +281,28 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "value_types": &schema.Schema{ + "value_types": { Type: schema.TypeList, Computed: true, Description: "the value types associated to this card element.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "Kind of element- KPI: Kind of value derived from a KPI occurrence.", }, - "kpi_note_name": &schema.Schema{ + "kpi_note_name": { Type: schema.TypeString, Computed: true, Description: "The name of the kpi note associated to the occurrence with the value for this card element value type.", }, - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Computed: true, Description: "The text of this element type.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Computed: true, Description: "the names of the finding note associated that act as filters for counting the occurrences.", @@ -310,7 +313,7 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "default_interval": &schema.Schema{ + "default_interval": { Type: schema.TypeString, Computed: true, Description: "The default interval of the time series.", @@ -321,18 +324,18 @@ func dataSourceIBMSccSiNotes() *schema.Resource { }, }, }, - "section": &schema.Schema{ + "section": { Type: schema.TypeList, Computed: true, Description: "Card provides details about a card kind of note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "The title of this section.", }, - "image": &schema.Schema{ + "image": { Type: schema.TypeString, Computed: true, Description: "The image of this section.", @@ -347,25 +350,25 @@ func dataSourceIBMSccSiNotes() *schema.Resource { } } -func dataSourceIBMSccSiNotesValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func DataSourceIBMSccSiNotesValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "page_size", - ValidateFunctionIdentifier: IntBetween, + ValidateFunctionIdentifier: validate.IntBetween, Required: false, MinValue: "2"}) - ibmSccSiNotesDataSourceValidator := ResourceValidator{ResourceName: "ibm_scc_si_notes", Schema: validateSchema} + ibmSccSiNotesDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_si_notes", Schema: validateSchema} return &ibmSccSiNotesDataSourceValidator } func dataSourceIBMSccSiNotesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -373,7 +376,7 @@ func dataSourceIBMSccSiNotesRead(context context.Context, d *schema.ResourceData accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -409,7 +412,7 @@ func dataSourceIBMSccSiNotesRead(context context.Context, d *schema.ResourceData if apiNotes != nil { err = d.Set("notes", dataSourceAPIListNotesResponseFlattenProviders(apiNotes)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting notes %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting notes %s", err)) } } @@ -484,10 +487,10 @@ func dataSourceAPIListNotesResponseProvidersToMap(notesItem findingsv1.APINote) } if notesItem.CreateTime != nil { - notesMap["create_time"] = dateTimeToString(notesItem.CreateTime) + notesMap["create_time"] = flex.DateTimeToString(notesItem.CreateTime) } if notesItem.UpdateTime != nil { - notesMap["update_time"] = dateTimeToString(notesItem.UpdateTime) + notesMap["update_time"] = flex.DateTimeToString(notesItem.UpdateTime) } if notesItem.Shared != nil { notesMap["shared"] = notesItem.Shared diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_occurrence.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_occurrence.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_occurrence.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_occurrence.go index 38d5c82424..3cccc430ad 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_occurrence.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_occurrence.go @@ -1,119 +1,121 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/scc-go-sdk/findingsv1" ) -func dataSourceIBMSccSiOccurrence() *schema.Resource { +func DataSourceIBMSccSiOccurrence() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccSiOccurrenceRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, }, - "provider_id": &schema.Schema{ + "provider_id": { Type: schema.TypeString, Required: true, Description: "Part of the parent. This field contains the provider ID. For example: providers/{provider_id}.", }, - "occurrence_id": &schema.Schema{ + "occurrence_id": { Type: schema.TypeString, Required: true, Description: "Second part of occurrence `name`: providers/{provider_id}/occurrences/{occurrence_id}.", }, - "resource_url": &schema.Schema{ + "resource_url": { Type: schema.TypeString, Computed: true, Description: "The unique URL of the resource, image or the container, for which the `Occurrence` applies. For example, https://gcr.io/provider/image@sha256:foo. This field can be used as a filter in list requests.", }, - "note_name": &schema.Schema{ + "note_name": { Type: schema.TypeString, Computed: true, Description: "An analysis note associated with this image, in the form \"{account_id}/providers/{provider_id}/notes/{note_id}\" This field can be used as a filter in list requests.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "The type of note. Use this field to filter notes and occurences by kind. - FINDING: The note and occurrence represent a finding. - KPI: The note and occurrence represent a KPI value. - CARD: The note represents a card showing findings and related metric values. - CARD_CONFIGURED: The note represents a card configured for a user account. - SECTION: The note represents a section in a dashboard.", }, - "remediation": &schema.Schema{ + "remediation": { Type: schema.TypeString, Computed: true, Description: "A description of actions that can be taken to remedy the `Note`.", }, - "create_time": &schema.Schema{ + "create_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this `Occurrence` was created.", }, - "update_time": &schema.Schema{ + "update_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this `Occurrence` was last updated.", }, - "context": &schema.Schema{ + "context": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ + "region": { Type: schema.TypeString, Computed: true, Description: "The IBM Cloud region.", }, - "resource_crn": &schema.Schema{ + "resource_crn": { Type: schema.TypeString, Computed: true, Description: "The resource CRN (e.g. certificate CRN, image CRN).", }, - "resource_id": &schema.Schema{ + "resource_id": { Type: schema.TypeString, Computed: true, Description: "The resource ID, in case the CRN is not available.", }, - "resource_name": &schema.Schema{ + "resource_name": { Type: schema.TypeString, Computed: true, Description: "The user-friendly resource name.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type name (e.g. Pod, Cluster, Certificate, Image).", }, - "service_crn": &schema.Schema{ + "service_crn": { Type: schema.TypeString, Computed: true, Description: "The service CRN (e.g. CertMgr Instance CRN).", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Computed: true, Description: "The service name (e.g. CertMgr).", }, - "environment_name": &schema.Schema{ + "environment_name": { Type: schema.TypeString, Computed: true, Description: "The name of the environment the occurrence applies to.", }, - "component_name": &schema.Schema{ + "component_name": { Type: schema.TypeString, Computed: true, Description: "The name of the component the occurrence applies to.", }, - "toolchain_id": &schema.Schema{ + "toolchain_id": { Type: schema.TypeString, Computed: true, Description: "The id of the toolchain the occurrence applies to.", @@ -121,34 +123,34 @@ func dataSourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "finding": &schema.Schema{ + "finding": { Type: schema.TypeList, Computed: true, Description: "Finding provides details about a finding occurrence.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Computed: true, Description: "Note provider-assigned severity/impact ranking- LOW: Low Impact- MEDIUM: Medium Impact- HIGH: High Impact- CRITICAL: Critical Impact.", }, - "certainty": &schema.Schema{ + "certainty": { Type: schema.TypeString, Computed: true, Description: "Note provider-assigned confidence on the validity of an occurrence- LOW: Low Certainty- MEDIUM: Medium Certainty- HIGH: High Certainty.", }, - "next_steps": &schema.Schema{ + "next_steps": { Type: schema.TypeList, Computed: true, Description: "Remediation steps for the issues reported in this finding. They override the note's next steps.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "Title of this next step.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL associated to this next steps.", @@ -156,34 +158,34 @@ func dataSourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "network_connection": &schema.Schema{ + "network_connection": { Type: schema.TypeList, Computed: true, Description: "It provides details about a network connection.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "direction": &schema.Schema{ + "direction": { Type: schema.TypeString, Computed: true, Description: "The direction of this network connection.", }, - "protocol": &schema.Schema{ + "protocol": { Type: schema.TypeString, Computed: true, Description: "The protocol of this network connection.", }, - "client": &schema.Schema{ + "client": { Type: schema.TypeList, Computed: true, Description: "It provides details about a socket address.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The IP address of this socket address.", }, - "port": &schema.Schema{ + "port": { Type: schema.TypeInt, Computed: true, Description: "The port number of this socket address.", @@ -191,18 +193,18 @@ func dataSourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "server": &schema.Schema{ + "server": { Type: schema.TypeList, Computed: true, Description: "It provides details about a socket address.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The IP address of this socket address.", }, - "port": &schema.Schema{ + "port": { Type: schema.TypeInt, Computed: true, Description: "The port number of this socket address.", @@ -213,28 +215,28 @@ func dataSourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "data_transferred": &schema.Schema{ + "data_transferred": { Type: schema.TypeList, Computed: true, Description: "It provides details about data transferred between clients and servers.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "client_bytes": &schema.Schema{ + "client_bytes": { Type: schema.TypeInt, Computed: true, Description: "The number of client bytes transferred.", }, - "server_bytes": &schema.Schema{ + "server_bytes": { Type: schema.TypeInt, Computed: true, Description: "The number of server bytes transferred.", }, - "client_packets": &schema.Schema{ + "client_packets": { Type: schema.TypeInt, Computed: true, Description: "The number of client packets transferred.", }, - "server_packets": &schema.Schema{ + "server_packets": { Type: schema.TypeInt, Computed: true, Description: "The number of server packets transferred.", @@ -245,18 +247,18 @@ func dataSourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "kpi": &schema.Schema{ + "kpi": { Type: schema.TypeList, Computed: true, Description: "Kpi provides details about a KPI occurrence.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "value": &schema.Schema{ + "value": { Type: schema.TypeFloat, Computed: true, Description: "The value of this KPI.", }, - "total": &schema.Schema{ + "total": { Type: schema.TypeFloat, Computed: true, Description: "The total value of this KPI.", @@ -269,12 +271,12 @@ func dataSourceIBMSccSiOccurrence() *schema.Resource { } func dataSourceIBMSccSiOccurrenceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -282,7 +284,7 @@ func dataSourceIBMSccSiOccurrenceRead(context context.Context, d *schema.Resourc accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -300,42 +302,42 @@ func dataSourceIBMSccSiOccurrenceRead(context context.Context, d *schema.Resourc d.SetId(fmt.Sprintf("%s/%s/%s", *findingsClient.AccountID, *getOccurrenceOptions.ProviderID, *getOccurrenceOptions.OccurrenceID)) if err = d.Set("resource_url", apiOccurrence.ResourceURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_url: %s", err)) } if err = d.Set("note_name", apiOccurrence.NoteName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting note_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting note_name: %s", err)) } if err = d.Set("kind", apiOccurrence.Kind); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kind: %s", err)) } if err = d.Set("remediation", apiOccurrence.Remediation); err != nil { - return diag.FromErr(fmt.Errorf("Error setting remediation: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting remediation: %s", err)) } - if err = d.Set("create_time", dateTimeToString(apiOccurrence.CreateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting create_time: %s", err)) + if err = d.Set("create_time", flex.DateTimeToString(apiOccurrence.CreateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting create_time: %s", err)) } - if err = d.Set("update_time", dateTimeToString(apiOccurrence.UpdateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting update_time: %s", err)) + if err = d.Set("update_time", flex.DateTimeToString(apiOccurrence.UpdateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting update_time: %s", err)) } if apiOccurrence.Context != nil { err = d.Set("context", dataSourceAPIOccurrenceFlattenContext(*apiOccurrence.Context)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting context %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting context %s", err)) } } if apiOccurrence.Finding != nil { err = d.Set("finding", dataSourceAPIOccurrenceFlattenFinding(*apiOccurrence.Finding)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting finding %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting finding %s", err)) } } if apiOccurrence.Kpi != nil { err = d.Set("kpi", dataSourceAPIOccurrenceFlattenKpi(*apiOccurrence.Kpi)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting kpi %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kpi %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_occurrences.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_occurrences.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_occurrences.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_occurrences.go index 33ae9dacaf..c33ba6eb70 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_occurrences.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_occurrences.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,129 +9,131 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/scc-go-sdk/findingsv1" ) -func dataSourceIBMSccSiOccurrences() *schema.Resource { +func DataSourceIBMSccSiOccurrences() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccSiOccurrencesRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, }, - "provider_id": &schema.Schema{ + "provider_id": { Type: schema.TypeString, Required: true, Description: "Part of the parent. This field contains the provider ID. For example: providers/{provider_id}.", }, - "page_size": &schema.Schema{ + "page_size": { Type: schema.TypeInt, Optional: true, ValidateFunc: ValidatePageSize, Description: "Number of notes to return in the list.", }, - "page_token": &schema.Schema{ + "page_token": { Type: schema.TypeString, Optional: true, Description: "Token to provide to skip to a particular spot in the list.", }, - "occurrences": &schema.Schema{ + "occurrences": { Type: schema.TypeList, Computed: true, Description: "The occurrences requested.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "resource_url": &schema.Schema{ + "resource_url": { Type: schema.TypeString, Computed: true, Description: "The unique URL of the resource, image or the container, for which the `Occurrence` applies. For example, https://gcr.io/provider/image@sha256:foo. This field can be used as a filter in list requests.", }, - "note_name": &schema.Schema{ + "note_name": { Type: schema.TypeString, Computed: true, Description: "An analysis note associated with this image, in the form \"{account_id}/providers/{provider_id}/notes/{note_id}\" This field can be used as a filter in list requests.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Computed: true, Description: "The type of note. Use this field to filter notes and occurences by kind. - FINDING: The note and occurrence represent a finding. - KPI: The note and occurrence represent a KPI value. - CARD: The note represents a card showing findings and related metric values. - CARD_CONFIGURED: The note represents a card configured for a user account. - SECTION: The note represents a section in a dashboard.", }, - "remediation": &schema.Schema{ + "remediation": { Type: schema.TypeString, Computed: true, Description: "A description of actions that can be taken to remedy the `Note`.", }, - "create_time": &schema.Schema{ + "create_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this `Occurrence` was created.", }, - "update_time": &schema.Schema{ + "update_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this `Occurrence` was last updated.", }, - "occurrence_id": &schema.Schema{ + "occurrence_id": { Type: schema.TypeString, Computed: true, Description: "The id of the occurrence.", }, - "context": &schema.Schema{ + "context": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ + "region": { Type: schema.TypeString, Computed: true, Description: "The IBM Cloud region.", }, - "resource_crn": &schema.Schema{ + "resource_crn": { Type: schema.TypeString, Computed: true, Description: "The resource CRN (e.g. certificate CRN, image CRN).", }, - "resource_id": &schema.Schema{ + "resource_id": { Type: schema.TypeString, Computed: true, Description: "The resource ID, in case the CRN is not available.", }, - "resource_name": &schema.Schema{ + "resource_name": { Type: schema.TypeString, Computed: true, Description: "The user-friendly resource name.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type name (e.g. Pod, Cluster, Certificate, Image).", }, - "service_crn": &schema.Schema{ + "service_crn": { Type: schema.TypeString, Computed: true, Description: "The service CRN (e.g. CertMgr Instance CRN).", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Computed: true, Description: "The service name (e.g. CertMgr).", }, - "environment_name": &schema.Schema{ + "environment_name": { Type: schema.TypeString, Computed: true, Description: "The name of the environment the occurrence applies to.", }, - "component_name": &schema.Schema{ + "component_name": { Type: schema.TypeString, Computed: true, Description: "The name of the component the occurrence applies to.", }, - "toolchain_id": &schema.Schema{ + "toolchain_id": { Type: schema.TypeString, Computed: true, Description: "The id of the toolchain the occurrence applies to.", @@ -139,34 +141,34 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { }, }, }, - "finding": &schema.Schema{ + "finding": { Type: schema.TypeList, Computed: true, Description: "Finding provides details about a finding occurrence.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Computed: true, Description: "Note provider-assigned severity/impact ranking- LOW: Low Impact- MEDIUM: Medium Impact- HIGH: High Impact- CRITICAL: Critical Impact.", }, - "certainty": &schema.Schema{ + "certainty": { Type: schema.TypeString, Computed: true, Description: "Note provider-assigned confidence on the validity of an occurrence- LOW: Low Certainty- MEDIUM: Medium Certainty- HIGH: High Certainty.", }, - "next_steps": &schema.Schema{ + "next_steps": { Type: schema.TypeList, Computed: true, Description: "Remediation steps for the issues reported in this finding. They override the note's next steps.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Computed: true, Description: "Title of this next step.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Computed: true, Description: "The URL associated to this next steps.", @@ -174,34 +176,34 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { }, }, }, - "network_connection": &schema.Schema{ + "network_connection": { Type: schema.TypeList, Computed: true, Description: "It provides details about a network connection.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "direction": &schema.Schema{ + "direction": { Type: schema.TypeString, Computed: true, Description: "The direction of this network connection.", }, - "protocol": &schema.Schema{ + "protocol": { Type: schema.TypeString, Computed: true, Description: "The protocol of this network connection.", }, - "client": &schema.Schema{ + "client": { Type: schema.TypeList, Computed: true, Description: "It provides details about a socket address.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The IP address of this socket address.", }, - "port": &schema.Schema{ + "port": { Type: schema.TypeInt, Computed: true, Description: "The port number of this socket address.", @@ -209,18 +211,18 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { }, }, }, - "server": &schema.Schema{ + "server": { Type: schema.TypeList, Computed: true, Description: "It provides details about a socket address.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The IP address of this socket address.", }, - "port": &schema.Schema{ + "port": { Type: schema.TypeInt, Computed: true, Description: "The port number of this socket address.", @@ -231,28 +233,28 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { }, }, }, - "data_transferred": &schema.Schema{ + "data_transferred": { Type: schema.TypeList, Computed: true, Description: "It provides details about data transferred between clients and servers.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "client_bytes": &schema.Schema{ + "client_bytes": { Type: schema.TypeInt, Computed: true, Description: "The number of client bytes transferred.", }, - "server_bytes": &schema.Schema{ + "server_bytes": { Type: schema.TypeInt, Computed: true, Description: "The number of server bytes transferred.", }, - "client_packets": &schema.Schema{ + "client_packets": { Type: schema.TypeInt, Computed: true, Description: "The number of client packets transferred.", }, - "server_packets": &schema.Schema{ + "server_packets": { Type: schema.TypeInt, Computed: true, Description: "The number of server packets transferred.", @@ -263,18 +265,18 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { }, }, }, - "kpi": &schema.Schema{ + "kpi": { Type: schema.TypeList, Computed: true, Description: "Kpi provides details about a KPI occurrence.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "value": &schema.Schema{ + "value": { Type: schema.TypeFloat, Computed: true, Description: "The value of this KPI.", }, - "total": &schema.Schema{ + "total": { Type: schema.TypeFloat, Computed: true, Description: "The total value of this KPI.", @@ -285,7 +287,7 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { }, }, }, - "next_page_token": &schema.Schema{ + "next_page_token": { Type: schema.TypeString, Computed: true, Description: "The next pagination token in the list response. It should be used as`page_token` for the following request. An empty value means no more results.", @@ -294,26 +296,26 @@ func dataSourceIBMSccSiOccurrences() *schema.Resource { } } -func dataSourceIBMSccSiOccurrencesValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func DataSourceIBMSccSiOccurrencesValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "page_size", - ValidateFunctionIdentifier: IntBetween, + ValidateFunctionIdentifier: validate.IntBetween, Required: false, MinValue: "2"}) - ibmSccSiOccurrencesDataSourceValidator := ResourceValidator{ResourceName: "ibm_scc_si_occurrences", Schema: validateSchema} + ibmSccSiOccurrencesDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_si_occurrences", Schema: validateSchema} return &ibmSccSiOccurrencesDataSourceValidator } func dataSourceIBMSccSiOccurrencesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -321,7 +323,7 @@ func dataSourceIBMSccSiOccurrencesRead(context context.Context, d *schema.Resour accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -348,11 +350,11 @@ func dataSourceIBMSccSiOccurrencesRead(context context.Context, d *schema.Resour if apiListOccurrencesResponse.Occurrences != nil { err = d.Set("occurrences", dataSourceAPIListOccurrencesResponseFlattenOccurrences(apiListOccurrencesResponse.Occurrences)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting occurrences %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting occurrences %s", err)) } } if err = d.Set("next_page_token", apiListOccurrencesResponse.NextPageToken); err != nil { - return diag.FromErr(fmt.Errorf("Error setting next_page_token: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting next_page_token: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_providers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_providers.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_providers.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_providers.go index 30b4182ee6..23dc8781b0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_scc_si_providers.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/data_source_ibm_scc_si_providers.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,6 +9,8 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -16,27 +18,27 @@ import ( "github.com/IBM/scc-go-sdk/findingsv1" ) -func dataSourceIBMSccSiProviders() *schema.Resource { +func DataSourceIBMSccSiProviders() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSccSiProvidersRead, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, }, - "providers": &schema.Schema{ + "providers": { Type: schema.TypeList, Computed: true, Description: "The providers requested.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the provider in the form '{account_id}/providers/{provider_id}'.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID of the provider.", @@ -44,18 +46,18 @@ func dataSourceIBMSccSiProviders() *schema.Resource { }, }, }, - "limit": &schema.Schema{ + "limit": { Type: schema.TypeInt, Optional: true, ValidateFunc: ValidatePageSize, Description: "The number of elements returned in the current instance. The default is 200.", }, - "skip": &schema.Schema{ + "skip": { Type: schema.TypeInt, Optional: true, Description: "The offset is the index of the item from which you want to start returning data from. The default is 0.", }, - "total_count": &schema.Schema{ + "total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of providers available.", @@ -65,12 +67,12 @@ func dataSourceIBMSccSiProviders() *schema.Resource { } func dataSourceIBMSccSiProvidersRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -78,7 +80,7 @@ func dataSourceIBMSccSiProvidersRead(context context.Context, d *schema.Resource accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -103,11 +105,11 @@ func dataSourceIBMSccSiProvidersRead(context context.Context, d *schema.Resource if apiProviders != nil { err = d.Set("providers", dataSourceAPIListProvidersResponseFlattenProviders(apiProviders)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting providers %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting providers %s", err)) } } - if err = d.Set("total_count", intValue(totalCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + if err = d.Set("total_count", flex.IntValue(totalCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_account_settings.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_account_settings.go new file mode 100644 index 0000000000..ea31bf8cbb --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_account_settings.go @@ -0,0 +1,118 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package scc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/scc-go-sdk/v3/adminserviceapiv1" +) + +func ResourceIBMSccAccountSettings() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIbmSccAccountSettingsUpdate, + ReadContext: resourceIbmSccAccountSettingsRead, + UpdateContext: resourceIbmSccAccountSettingsUpdate, + DeleteContext: resourceIbmSccAccountSettingsDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "location_id": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_scc_account_settings", "location_id"), + Description: "The programatic ID of the location that you want to work in.", + }, + }, + } +} + +func resourceIbmSccAccountSettingsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + adminServiceClient, err := meta.(conns.ClientSession).AdminServiceApiV1() + if err != nil { + return diag.FromErr(err) + } + + getAccountSettingsOption := &adminserviceapiv1.GetSettingsOptions{} + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + accountID := userDetails.UserAccount + + getAccountSettingsOption.SetAccountID(accountID) + + accountSettings, response, err := adminServiceClient.GetSettingsWithContext(context, getAccountSettingsOption) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + log.Printf("[DEBUG] GetSettingsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetSettingsWithContext failed %s\n%s", err, response)) + } + + d.SetId(*accountSettings.Location.ID) + + return nil + +} + +func resourceIbmSccAccountSettingsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + adminServiceClient, err := meta.(conns.ClientSession).AdminServiceApiV1() + if err != nil { + return diag.FromErr(err) + } + + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(err) + } + accountID := userDetails.UserAccount + + locationID := d.Get("location_id").(string) + updateAccountSettingsOption := &adminserviceapiv1.PatchAccountSettingsOptions{} + updateAccountSettingsOption.SetAccountID(accountID) + updateAccountSettingsOption.SetLocation(&adminserviceapiv1.LocationID{ + ID: core.StringPtr(locationID), + }) + + _, response, err := adminServiceClient.PatchAccountSettingsWithContext(context, updateAccountSettingsOption) + if err != nil { + log.Printf("[DEBUG] PatchAccountSettingsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("PatchAccountSettingsWithContext failed %s\n%s", err, response)) + } + + d.SetId(locationID) + + return resourceIbmSccAccountSettingsRead(context, d, meta) +} + +func ResourceIBMSccAccountSettingsValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 2) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "location_id", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "us, eu, uk", + }, + ) + + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_account_settings", Schema: validateSchema} + return &resourceValidator +} + +func resourceIbmSccAccountSettingsDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_collector.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_collector.go similarity index 76% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_collector.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_collector.go index 80f15e4892..ffb53b718f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_collector.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_collector.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,13 +9,15 @@ import ( "log" "os" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func resourceIBMSccPostureCollectors() *schema.Resource { +func ResourceIBMSccPostureCollectors() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSccPostureCollectorsCreate, ReadContext: resourceIBMSccPostureCollectorsRead, @@ -24,37 +26,37 @@ func resourceIBMSccPostureCollectors() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_collector", "name"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_collector", "name"), Description: "A unique name for your collector.", }, - "is_public": &schema.Schema{ + "is_public": { Type: schema.TypeBool, Required: true, Description: "Determines whether the collector endpoint is accessible on a public network. If set to `true`, the collector connects to resources in your account over a public network. If set to `false`, the collector connects to resources by using a private IP that is accessible only through the IBM Cloud private network.", }, - "managed_by": &schema.Schema{ + "managed_by": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_collector", "managed_by"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_collector", "managed_by"), Description: "Determines whether the collector is an IBM or customer-managed virtual machine. Use `ibm` to allow Security and Compliance Center to create, install, and manage the collector on your behalf. The collector is installed in an OpenShift cluster and approved automatically for use. Use `customer` if you would like to install the collector by using your own virtual machine. For more information, check out the [docs](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-collector).", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Default: "", - ValidateFunc: InvokeValidator("ibm_scc_posture_collector", "description"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_collector", "description"), Description: "A detailed description of the collector.", }, - "passphrase": &schema.Schema{ + "passphrase": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_collector", "passphrase"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_collector", "passphrase"), Description: "To protect the credentials that you add to the service, a passphrase is used to generate a data encryption key. The key is used to securely store your credentials and prevent anyone from accessing them.", }, - "is_ubi_image": &schema.Schema{ + "is_ubi_image": { Type: schema.TypeBool, Optional: true, Description: "Determines whether the collector has a Ubi image.", @@ -63,38 +65,38 @@ func resourceIBMSccPostureCollectors() *schema.Resource { } } -func resourceIBMSccPostureCollectorsValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSccPostureCollectorsValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, MinValueLength: 1, MaxValueLength: 32, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "managed_by", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "customer, ibm", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "description", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[a-zA-Z0-9-\\._,\\s]*$`, MinValueLength: 1, MaxValueLength: 1000, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "passphrase", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[a-zA-Z0-9-\\._,\\s]*$`, MinValueLength: 1, @@ -102,12 +104,12 @@ func resourceIBMSccPostureCollectorsValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_collectors", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_collectors", Schema: validateSchema} return &resourceValidator } func resourceIBMSccPostureCollectorsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } @@ -140,18 +142,18 @@ func resourceIBMSccPostureCollectorsCreate(context context.Context, d *schema.Re } func resourceIBMSccPostureCollectorsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } listCollectorsOptions := &posturemanagementv2.ListCollectorsOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount listCollectorsOptions.SetAccountID(accountID) collectorList, response, err := postureManagementClient.ListCollectorsWithContext(context, listCollectorsOptions) @@ -168,7 +170,7 @@ func resourceIBMSccPostureCollectorsRead(context context.Context, d *schema.Reso } func resourceIBMSccPostureCollectorsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } @@ -193,7 +195,7 @@ func resourceIBMSccPostureCollectorsUpdate(context context.Context, d *schema.Re } func resourceIBMSccPostureCollectorsDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_credential.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_credential.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_credential.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_credential.go index 5e16020997..b6403ef5c8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_posture_credential.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_credential.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" @@ -9,14 +9,16 @@ import ( "log" "os" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/go-sdk-core/v5/core" - "github.com/IBM/scc-go-sdk/posturemanagementv2" + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" ) -func resourceIBMSccPostureCredentials() *schema.Resource { +func ResourceIBMSccPostureCredentials() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSccPostureCredentialsCreate, ReadContext: resourceIBMSccPostureCredentialsRead, @@ -25,30 +27,30 @@ func resourceIBMSccPostureCredentials() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "enabled": &schema.Schema{ + "enabled": { Type: schema.TypeBool, Required: true, Description: "Credentials status enabled/disbaled.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_credential", "type"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_credential", "type"), Description: "Credentials type.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_credential", "name"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_credential", "name"), Description: "Credentials name.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_credential", "description"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_credential", "description"), Description: "Credentials description.", }, - "display_fields": &schema.Schema{ + "display_fields": { Type: schema.TypeList, MinItems: 1, MaxItems: 1, @@ -56,7 +58,7 @@ func resourceIBMSccPostureCredentials() *schema.Resource { Description: "Details the fields on the credential. This will change as per credential type selected.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "ibm_api_key": &schema.Schema{ + "ibm_api_key": { Type: schema.TypeString, Optional: true, Description: "The IBM Cloud API Key. This is mandatory for IBM Credential Type ie when type=ibm_cloud.", @@ -64,7 +66,7 @@ func resourceIBMSccPostureCredentials() *schema.Resource { }, }, }, - "group": &schema.Schema{ + "group": { Type: schema.TypeList, MinItems: 1, MaxItems: 1, @@ -72,12 +74,12 @@ func resourceIBMSccPostureCredentials() *schema.Resource { Description: "Credential group details.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Required: true, Description: "credential group id.", }, - "passphrase": &schema.Schema{ + "passphrase": { Type: schema.TypeString, Required: true, Description: "passphase of the credential.", @@ -85,48 +87,48 @@ func resourceIBMSccPostureCredentials() *schema.Resource { }, }, }, - "purpose": &schema.Schema{ + "purpose": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_posture_credential", "purpose"), + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_credential", "purpose"), Description: "Purpose for which the credential is created.", }, }, } } -func resourceIBMSccPostureCredentialsValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSccPostureCredentialsValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "aws_cloud, azure_cloud, database, ibm_cloud, kerberos_windows, ms_365, openstack_cloud, username_password", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-zA-Z0-9-\\._,\\s]*$`, MinValueLength: 1, MaxValueLength: 255, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "description", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[a-zA-Z0-9-\\._,\\s]*$`, MinValueLength: 1, MaxValueLength: 255, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "purpose", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "discovery_collection, discovery_collection_remediation, discovery_fact_collection, discovery_fact_collection_remediation, remediation", Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, @@ -135,12 +137,12 @@ func resourceIBMSccPostureCredentialsValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_scc_posture_credentials", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_posture_credentials", Schema: validateSchema} return &resourceValidator } func resourceIBMSccPostureCredentialsCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } @@ -199,18 +201,18 @@ func resourceIBMSccPostureCredentialsMapToCredentialGroup(credentialGroupMap map } func resourceIBMSccPostureCredentialsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } listCredentialsOptions := &posturemanagementv2.ListCredentialsOptions{} - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { - return diag.FromErr(fmt.Errorf("Error getting userDetails %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) } - accountID := userDetails.userAccount + accountID := userDetails.UserAccount listCredentialsOptions.SetAccountID(accountID) credentialList, response, err := postureManagementClient.ListCredentialsWithContext(context, listCredentialsOptions) @@ -246,7 +248,7 @@ func resourceIBMCredentialsCredentialGroupToMap(credentialGroup posturemanagemen } func resourceIBMSccPostureCredentialsUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } @@ -282,7 +284,7 @@ func resourceIBMSccPostureCredentialsUpdate(context context.Context, d *schema.R } func resourceIBMSccPostureCredentialsDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - postureManagementClient, err := meta.(ClientSession).PostureManagementV2() + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_scope.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_scope.go new file mode 100644 index 0000000000..a2b3445207 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_posture_scope.go @@ -0,0 +1,214 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package scc + +import ( + "context" + "fmt" + "log" + "os" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/scc-go-sdk/v3/posturemanagementv2" +) + +func ResourceIBMSccPostureScopes() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMSccPostureScopesCreate, + ReadContext: resourceIBMSccPostureScopesRead, + UpdateContext: resourceIBMSccPostureScopesUpdate, + DeleteContext: resourceIBMSccPostureScopesDelete, + Importer: &schema.ResourceImporter{}, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_scope", "name"), + Description: "A unique name for your scope.", + }, + "description": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_scope", "description"), + Description: "A detailed description of the scope.", + }, + "collector_ids": { + Type: schema.TypeList, + Required: true, + Description: "The unique IDs of the collectors that are attached to the scope.", + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "credential_id": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_scope", "credential_id"), + Description: "The unique identifier of the credential.", + }, + "credential_type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_scc_posture_scope", "credential_type"), + Description: "The environment that the scope is targeted to.", + }, + }, + } +} + +func ResourceIBMSccPostureScopesValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "name", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, + MinValueLength: 1, + MaxValueLength: 50, + }, + validate.ValidateSchema{ + Identifier: "description", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, + MinValueLength: 1, + MaxValueLength: 255, + }, + validate.ValidateSchema{ + Identifier: "credential_id", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^[a-zA-Z0-9-\\.,_\\s]*$`, + MinValueLength: 1, + MaxValueLength: 50, + }, + validate.ValidateSchema{ + Identifier: "credential_type", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "aws, azure, gcp, hosted, ibm, on_premise, openstack, services", + }, + ) + + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_posture_scope", Schema: validateSchema} + return &resourceValidator +} + +func resourceIBMSccPostureScopesCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() + if err != nil { + return diag.FromErr(err) + } + + createScopeOptions := &posturemanagementv2.CreateScopeOptions{} + createScopeOptions.SetAccountID(os.Getenv("SCC_POSTURE_ACCOUNT_ID")) + + createScopeOptions.SetName(d.Get("name").(string)) + createScopeOptions.SetDescription(d.Get("description").(string)) + createScopeOptions.SetCollectorIds([]string{"4188"}) //[]string{ + createScopeOptions.SetCredentialID(d.Get("credential_id").(string)) + createScopeOptions.SetCredentialType(d.Get("credential_type").(string)) + + scope, response, err := postureManagementClient.CreateScopeWithContext(context, createScopeOptions) + if err != nil { + log.Printf("[DEBUG] CreateScopeWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("CreateScopeWithContext failed %s\n%s", err, response)) + } + + d.SetId(*scope.ID) + + return resourceIBMSccPostureScopesRead(context, d, meta) +} + +func resourceIBMSccPostureScopesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() + if err != nil { + return diag.FromErr(err) + } + + listScopesOptions := &posturemanagementv2.ListScopesOptions{} + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting userDetails %s", err)) + } + + accountID := userDetails.UserAccount + listScopesOptions.SetAccountID(accountID) + + scopeList, response, err := postureManagementClient.ListScopesWithContext(context, listScopesOptions) + d.SetId(*(scopeList.Scopes[0].ID)) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + log.Printf("[DEBUG] ListScopesWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListScopesWithContext failed %s\n%s", err, response)) + } + + return nil +} + +func resourceIBMSccPostureScopesUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() + if err != nil { + return diag.FromErr(err) + } + + updateScopeDetailsOptions := &posturemanagementv2.UpdateScopeDetailsOptions{} + updateScopeDetailsOptions.SetAccountID(os.Getenv("SCC_POSTURE_ACCOUNT_ID")) + + hasChange := false + + updateScopeDetailsOptions.SetID(d.Id()) + + if d.HasChange("name") { + updateScopeDetailsOptions.SetName(d.Get("name").(string)) + hasChange = true + } + if d.HasChange("description") { + updateScopeDetailsOptions.SetDescription(d.Get("description").(string)) + hasChange = true + } + + if hasChange { + _, response, err := postureManagementClient.UpdateScopeDetailsWithContext(context, updateScopeDetailsOptions) + if err != nil { + log.Printf("[DEBUG] UpdateScopeDetailsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("UpdateScopeDetailsWithContext failed %s\n%s", err, response)) + } + } + + return resourceIBMSccPostureScopesRead(context, d, meta) +} + +func resourceIBMSccPostureScopesDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + postureManagementClient, err := meta.(conns.ClientSession).PostureManagementV2() + if err != nil { + return diag.FromErr(err) + } + + deleteScopeOptions := &posturemanagementv2.DeleteScopeOptions{} + deleteScopeOptions.SetAccountID(os.Getenv("SCC_POSTURE_ACCOUNT_ID")) + + deleteScopeOptions.SetID(d.Id()) + + response, err := postureManagementClient.DeleteScopeWithContext(context, deleteScopeOptions) + if err != nil { + log.Printf("[DEBUG] DeleteScopeWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("DeleteScopeWithContext failed %s\n%s", err, response)) + } + + d.SetId("") + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_si_note.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_si_note.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_si_note.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_si_note.go index 84942cc968..27846901c0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_si_note.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_si_note.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +18,7 @@ import ( "github.com/IBM/scc-go-sdk/findingsv1" ) -func resourceIBMSccSiNote() *schema.Resource { +func ResourceIBMSccSiNote() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSccSiNoteCreate, ReadContext: resourceIBMSccSiNoteRead, @@ -24,41 +27,41 @@ func resourceIBMSccSiNote() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, ForceNew: true, Computed: true, }, - "provider_id": &schema.Schema{ + "provider_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Part of the parent. This field contains the provider ID. For example: providers/{provider_id}.", }, - "short_description": &schema.Schema{ + "short_description": { Type: schema.TypeString, Required: true, Description: "A one sentence description of your note.", }, - "long_description": &schema.Schema{ + "long_description": { Type: schema.TypeString, Required: true, Description: "A more detailed description of your note.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_si_note", "kind"), + ValidateFunc: validate.InvokeValidator("ibm_scc_si_note", "kind"), Description: "The type of note. Use this field to filter notes and occurences by kind. - FINDING: The note and occurrence represent a finding. - KPI: The note and occurrence represent a KPI value. - CARD: The note represents a card showing findings and related metric values. - CARD_CONFIGURED: The note represents a card configured for a user account. - SECTION: The note represents a section in a dashboard.", }, - "note_id": &schema.Schema{ + "note_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The ID of the note.", }, - "reported_by": &schema.Schema{ + "reported_by": { Type: schema.TypeList, MinItems: 1, MaxItems: 1, @@ -66,17 +69,17 @@ func resourceIBMSccSiNote() *schema.Resource { Description: "The entity reporting a note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Required: true, Description: "The id of this reporter.", }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Required: true, Description: "The title of this reporter.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Optional: true, Description: "The url of this reporter.", @@ -84,17 +87,17 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "related_url": &schema.Schema{ + "related_url": { Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "label": &schema.Schema{ + "label": { Type: schema.TypeString, Required: true, Description: "Label to describe usage of the URL.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Required: true, Description: "The URL that you want to associate with the note.", @@ -102,13 +105,13 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "shared": &schema.Schema{ + "shared": { Type: schema.TypeBool, Optional: true, Default: true, Description: "True if this note can be shared by multiple accounts.", }, - "finding": &schema.Schema{ + "finding": { Type: schema.TypeList, MaxItems: 1, Optional: true, @@ -116,23 +119,23 @@ func resourceIBMSccSiNote() *schema.Resource { ExactlyOneOf: []string{"finding", "kpi", "card", "section"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Required: true, Description: "Note provider-assigned severity/impact ranking- LOW: Low Impact- MEDIUM: Medium Impact- HIGH: High Impact- CRITICAL: Critical Impact.", }, - "next_steps": &schema.Schema{ + "next_steps": { Type: schema.TypeList, Optional: true, Description: "Common remediation steps for the finding of this type.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Optional: true, Description: "Title of this next step.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Optional: true, Description: "The URL associated to this next steps.", @@ -143,14 +146,14 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "kpi": &schema.Schema{ + "kpi": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "KpiType provides details about a KPI note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "aggregation_type": &schema.Schema{ + "aggregation_type": { Type: schema.TypeString, Required: true, Description: "The aggregation type of the KPI values. - SUM: A single-value metrics aggregation type that sums up numeric values that are extracted from KPI occurrences.", @@ -158,101 +161,101 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "card": &schema.Schema{ + "card": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Card provides details about a card kind of note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "section": &schema.Schema{ + "section": { Type: schema.TypeString, Required: true, Description: "The section this card belongs to.", }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Required: true, Description: "The title of this card.", }, - "subtitle": &schema.Schema{ + "subtitle": { Type: schema.TypeString, Required: true, Description: "The subtitle of this card.", }, - "order": &schema.Schema{ + "order": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_scc_si_note", "order"), + ValidateFunc: validate.InvokeValidator("ibm_scc_si_note", "order"), Description: "The order of the card in which it will appear on SA dashboard in the mentioned section.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Required: true, Description: "The finding note names associated to this card.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "requires_configuration": &schema.Schema{ + "requires_configuration": { Type: schema.TypeBool, Optional: true, Default: false, }, - "badge_text": &schema.Schema{ + "badge_text": { Type: schema.TypeString, Optional: true, Description: "The text associated to the card's badge.", }, - "badge_image": &schema.Schema{ + "badge_image": { Type: schema.TypeString, Optional: true, Description: "The base64 content of the image associated to the card's badge.", }, - "elements": &schema.Schema{ + "elements": { Type: schema.TypeList, Required: true, Description: "The elements of this card.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Optional: true, Description: "The text of this card element.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Optional: true, Default: "NUMERIC", Description: "Kind of element- NUMERIC: Single numeric value- BREAKDOWN: Breakdown of numeric values- TIME_SERIES: Time-series of numeric values.", }, - "default_time_range": &schema.Schema{ + "default_time_range": { Type: schema.TypeString, Optional: true, Default: "4d", Description: "The default time range of this card element.", }, - "value_type": &schema.Schema{ + "value_type": { Type: schema.TypeList, MaxItems: 1, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Optional: true, Description: "Kind of element- KPI: Kind of value derived from a KPI occurrence.", }, - "kpi_note_name": &schema.Schema{ + "kpi_note_name": { Type: schema.TypeString, Optional: true, Description: "The name of the kpi note associated to the occurrence with the value for this card element value type.", }, - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Optional: true, Default: "label", Description: "The text of this element type.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Optional: true, Description: "the names of the finding note associated that act as filters for counting the occurrences.", @@ -261,29 +264,29 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "value_types": &schema.Schema{ + "value_types": { Type: schema.TypeList, Optional: true, Description: "the value types associated to this card element.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Optional: true, Description: "Kind of element- KPI: Kind of value derived from a KPI occurrence.", }, - "kpi_note_name": &schema.Schema{ + "kpi_note_name": { Type: schema.TypeString, Optional: true, Description: "The name of the kpi note associated to the occurrence with the value for this card element value type.", }, - "text": &schema.Schema{ + "text": { Type: schema.TypeString, Optional: true, Default: "label", Description: "The text of this element type.", }, - "finding_note_names": &schema.Schema{ + "finding_note_names": { Type: schema.TypeList, Optional: true, Description: "the names of the finding note associated that act as filters for counting the occurrences.", @@ -292,7 +295,7 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "default_interval": &schema.Schema{ + "default_interval": { Type: schema.TypeString, Optional: true, Default: "d", @@ -304,19 +307,19 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "section": &schema.Schema{ + "section": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Card provides details about a card kind of note.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Required: true, Description: "The title of this section.", }, - "image": &schema.Schema{ + "image": { Type: schema.TypeString, Required: true, Description: "The image of this section.", @@ -324,12 +327,12 @@ func resourceIBMSccSiNote() *schema.Resource { }, }, }, - "create_time": &schema.Schema{ + "create_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this note was created. This field can be used as a filter in list requests.", }, - "update_time": &schema.Schema{ + "update_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this note was last updated. This field can be used as a filter in list requests.", @@ -338,36 +341,36 @@ func resourceIBMSccSiNote() *schema.Resource { } } -func resourceIBMSccSiNoteValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 2) +func ResourceIBMSccSiNoteValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 2) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "kind", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "CARD, CARD_CONFIGURED, FINDING, KPI, SECTION", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "order", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Required: false, MinValue: "1", MaxValue: "6"}, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_scc_si_note", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_si_note", Schema: validateSchema} return &resourceValidator } func resourceIBMSccSiNoteCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -375,7 +378,7 @@ func resourceIBMSccSiNoteCreate(context context.Context, d *schema.ResourceData, accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -703,14 +706,14 @@ func resourceIBMSccSiNoteMapToSection(sectionMap map[string]interface{}) finding } func resourceIBMSccSiNoteRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } getNoteOptions := &findingsv1.GetNoteOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -733,23 +736,23 @@ func resourceIBMSccSiNoteRead(context context.Context, d *schema.ResourceData, m } if err = d.Set("provider_id", getNoteOptions.ProviderID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting provider_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting provider_id: %s", err)) } if err = d.Set("short_description", apiNote.ShortDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting short_description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting short_description: %s", err)) } if err = d.Set("long_description", apiNote.LongDescription); err != nil { - return diag.FromErr(fmt.Errorf("Error setting long_description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting long_description: %s", err)) } if err = d.Set("kind", apiNote.Kind); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kind: %s", err)) } if err = d.Set("note_id", apiNote.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting note_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting note_id: %s", err)) } reportedByMap := resourceIBMSccSiNoteReporterToMap(*apiNote.ReportedBy) if err = d.Set("reported_by", []map[string]interface{}{reportedByMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting reported_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting reported_by: %s", err)) } if apiNote.RelatedURL != nil { relatedURL := []map[string]interface{}{} @@ -758,42 +761,42 @@ func resourceIBMSccSiNoteRead(context context.Context, d *schema.ResourceData, m relatedURL = append(relatedURL, relatedURLItemMap) } if err = d.Set("related_url", relatedURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting related_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting related_url: %s", err)) } } if err = d.Set("shared", apiNote.Shared); err != nil { - return diag.FromErr(fmt.Errorf("Error setting shared: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting shared: %s", err)) } if apiNote.Finding != nil { findingMap := resourceIBMSccSiNoteFindingTypeToMap(*apiNote.Finding) if err = d.Set("finding", []map[string]interface{}{findingMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting finding: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting finding: %s", err)) } } if apiNote.Kpi != nil { kpiMap := resourceIBMSccSiNoteKpiTypeToMap(*apiNote.Kpi) if err = d.Set("kpi", []map[string]interface{}{kpiMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kpi: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kpi: %s", err)) } } if apiNote.Card != nil { cardIntf := d.Get("card") cardMap := resourceIBMSccSiNoteCardToMap(*apiNote.Card, cardIntf) if err = d.Set("card", []map[string]interface{}{cardMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting card: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting card: %s", err)) } } if apiNote.Section != nil { sectionMap := resourceIBMSccSiNoteSectionToMap(*apiNote.Section) if err = d.Set("section", []map[string]interface{}{sectionMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting section: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting section: %s", err)) } } - if err = d.Set("create_time", dateTimeToString(apiNote.CreateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting create_time: %s", err)) + if err = d.Set("create_time", flex.DateTimeToString(apiNote.CreateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting create_time: %s", err)) } - if err = d.Set("update_time", dateTimeToString(apiNote.UpdateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting update_time: %s", err)) + if err = d.Set("update_time", flex.DateTimeToString(apiNote.UpdateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting update_time: %s", err)) } return nil @@ -865,9 +868,9 @@ func resourceIBMSccSiNoteCardToMap(card findingsv1.Card, cardIntf interface{}) m cardMap["title"] = card.Title cardMap["subtitle"] = card.Subtitle if card.Order != nil { - order := intValue(card.Order) + order := flex.IntValue(card.Order) if order != 0 { - cardMap["order"] = intValue(card.Order) + cardMap["order"] = flex.IntValue(card.Order) } } cardMap["finding_note_names"] = card.FindingNoteNames @@ -1084,14 +1087,14 @@ func resourceIBMSccSiNoteSectionToMap(section findingsv1.Section) map[string]int } func resourceIBMSccSiNoteUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } updateNoteOptions := &findingsv1.UpdateNoteOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -1146,14 +1149,14 @@ func resourceIBMSccSiNoteUpdate(context context.Context, d *schema.ResourceData, } func resourceIBMSccSiNoteDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } deleteNoteOptions := &findingsv1.DeleteNoteOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_si_occurrence.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_si_occurrence.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_si_occurrence.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_si_occurrence.go index 1ebc11fb6c..df2ab89eab 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_scc_si_occurrence.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc/resource_ibm_scc_si_occurrence.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package scc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +18,7 @@ import ( "github.com/IBM/scc-go-sdk/findingsv1" ) -func resourceIBMSccSiOccurrence() *schema.Resource { +func ResourceIBMSccSiOccurrence() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSccSiOccurrenceCreate, ReadContext: resourceIBMSccSiOccurrenceRead, @@ -24,107 +27,107 @@ func resourceIBMSccSiOccurrence() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "account_id": &schema.Schema{ + "account_id": { Type: schema.TypeString, Optional: true, ForceNew: true, Computed: true, }, - "provider_id": &schema.Schema{ + "provider_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "Part of the parent. This field contains the provider ID. For example: providers/{provider_id}.", }, - "note_name": &schema.Schema{ + "note_name": { Type: schema.TypeString, Required: true, Description: "An analysis note associated with this image, in the form \"{account_id}/providers/{provider_id}/notes/{note_id}\" This field can be used as a filter in list requests.", }, - "kind": &schema.Schema{ + "kind": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_scc_si_occurrence", "kind"), + ValidateFunc: validate.InvokeValidator("ibm_scc_si_occurrence", "kind"), Description: "The type of note. Use this field to filter notes and occurences by kind. - FINDING: The note and occurrence represent a finding. - KPI: The note and occurrence represent a KPI value. - CARD: The note represents a card showing findings and related metric values. - CARD_CONFIGURED: The note represents a card configured for a user account. - SECTION: The note represents a section in a dashboard.", }, - "occurrence_id": &schema.Schema{ + "occurrence_id": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The id of the occurrence.", }, - "resource_url": &schema.Schema{ + "resource_url": { Type: schema.TypeString, Optional: true, Description: "The unique URL of the resource, image or the container, for which the `Occurrence` applies. For example, https://gcr.io/provider/image@sha256:foo. This field can be used as a filter in list requests.", }, - "remediation": &schema.Schema{ + "remediation": { Type: schema.TypeString, Optional: true, Description: "A description of actions that can be taken to remedy the `Note`.", }, - "create_time": &schema.Schema{ + "create_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this `Occurrence` was created.", }, - "update_time": &schema.Schema{ + "update_time": { Type: schema.TypeString, Computed: true, Description: "Output only. The time this `Occurrence` was last updated.", }, - "context": &schema.Schema{ + "context": { Type: schema.TypeList, MaxItems: 1, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "region": &schema.Schema{ + "region": { Type: schema.TypeString, Optional: true, Description: "The IBM Cloud region.", }, - "resource_crn": &schema.Schema{ + "resource_crn": { Type: schema.TypeString, Optional: true, Description: "The resource CRN (e.g. certificate CRN, image CRN).", }, - "resource_id": &schema.Schema{ + "resource_id": { Type: schema.TypeString, Optional: true, Description: "The resource ID, in case the CRN is not available.", }, - "resource_name": &schema.Schema{ + "resource_name": { Type: schema.TypeString, Optional: true, Description: "The user-friendly resource name.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Optional: true, Description: "The resource type name (e.g. Pod, Cluster, Certificate, Image).", }, - "service_crn": &schema.Schema{ + "service_crn": { Type: schema.TypeString, Optional: true, Description: "The service CRN (e.g. CertMgr Instance CRN).", }, - "service_name": &schema.Schema{ + "service_name": { Type: schema.TypeString, Optional: true, Description: "The service name (e.g. CertMgr).", }, - "environment_name": &schema.Schema{ + "environment_name": { Type: schema.TypeString, Optional: true, Description: "The name of the environment the occurrence applies to.", }, - "component_name": &schema.Schema{ + "component_name": { Type: schema.TypeString, Optional: true, Description: "The name of the component the occurrence applies to.", }, - "toolchain_id": &schema.Schema{ + "toolchain_id": { Type: schema.TypeString, Optional: true, Description: "The id of the toolchain the occurrence applies to.", @@ -132,7 +135,7 @@ func resourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "finding": &schema.Schema{ + "finding": { Type: schema.TypeList, MaxItems: 1, Optional: true, @@ -140,28 +143,28 @@ func resourceIBMSccSiOccurrence() *schema.Resource { ExactlyOneOf: []string{"finding", "kpi"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "severity": &schema.Schema{ + "severity": { Type: schema.TypeString, Optional: true, Description: "Note provider-assigned severity/impact ranking- LOW: Low Impact- MEDIUM: Medium Impact- HIGH: High Impact- CRITICAL: Critical Impact.", }, - "certainty": &schema.Schema{ + "certainty": { Type: schema.TypeString, Optional: true, Description: "Note provider-assigned confidence on the validity of an occurrence- LOW: Low Certainty- MEDIUM: Medium Certainty- HIGH: High Certainty.", }, - "next_steps": &schema.Schema{ + "next_steps": { Type: schema.TypeList, Optional: true, Description: "Remediation steps for the issues reported in this finding. They override the note's next steps.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Optional: true, Description: "Title of this next step.", }, - "url": &schema.Schema{ + "url": { Type: schema.TypeString, Optional: true, Description: "The URL associated to this next steps.", @@ -169,36 +172,36 @@ func resourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "network_connection": &schema.Schema{ + "network_connection": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "It provides details about a network connection.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "direction": &schema.Schema{ + "direction": { Type: schema.TypeString, Optional: true, Description: "The direction of this network connection.", }, - "protocol": &schema.Schema{ + "protocol": { Type: schema.TypeString, Optional: true, Description: "The protocol of this network connection.", }, - "client": &schema.Schema{ + "client": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "It provides details about a socket address.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Required: true, Description: "The IP address of this socket address.", }, - "port": &schema.Schema{ + "port": { Type: schema.TypeInt, Optional: true, Description: "The port number of this socket address.", @@ -206,19 +209,19 @@ func resourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "server": &schema.Schema{ + "server": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "It provides details about a socket address.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Required: true, Description: "The IP address of this socket address.", }, - "port": &schema.Schema{ + "port": { Type: schema.TypeInt, Optional: true, Description: "The port number of this socket address.", @@ -229,29 +232,29 @@ func resourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "data_transferred": &schema.Schema{ + "data_transferred": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "It provides details about data transferred between clients and servers.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "client_bytes": &schema.Schema{ + "client_bytes": { Type: schema.TypeInt, Optional: true, Description: "The number of client bytes transferred.", }, - "server_bytes": &schema.Schema{ + "server_bytes": { Type: schema.TypeInt, Optional: true, Description: "The number of server bytes transferred.", }, - "client_packets": &schema.Schema{ + "client_packets": { Type: schema.TypeInt, Optional: true, Description: "The number of client packets transferred.", }, - "server_packets": &schema.Schema{ + "server_packets": { Type: schema.TypeInt, Optional: true, Description: "The number of server packets transferred.", @@ -262,19 +265,19 @@ func resourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "kpi": &schema.Schema{ + "kpi": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Kpi provides details about a KPI occurrence.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "value": &schema.Schema{ + "value": { Type: schema.TypeFloat, Required: true, Description: "The value of this KPI.", }, - "total": &schema.Schema{ + "total": { Type: schema.TypeFloat, Optional: true, Description: "The total value of this KPI.", @@ -282,7 +285,7 @@ func resourceIBMSccSiOccurrence() *schema.Resource { }, }, }, - "replace_if_exists": &schema.Schema{ + "replace_if_exists": { Type: schema.TypeBool, Optional: true, Default: false, @@ -292,29 +295,29 @@ func resourceIBMSccSiOccurrence() *schema.Resource { } } -func resourceIBMSccSiOccurrenceValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSccSiOccurrenceValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "kind", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "FINDING, KPI", }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_scc_si_occurrence", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_scc_si_occurrence", Schema: validateSchema} return &resourceValidator } func resourceIBMSccSiOccurrenceCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } - userDetails, err := meta.(ClientSession).BluemixUserDetails() + userDetails, err := meta.(conns.ClientSession).BluemixUserDetails() if err != nil { return diag.FromErr(err) } @@ -322,7 +325,7 @@ func resourceIBMSccSiOccurrenceCreate(context context.Context, d *schema.Resourc accountID := d.Get("account_id").(string) log.Println(fmt.Sprintf("[DEBUG] using specified AccountID %s", accountID)) if accountID == "" { - accountID = userDetails.userAccount + accountID = userDetails.UserAccount log.Println(fmt.Sprintf("[DEBUG] AccountID not spedified, using %s", accountID)) } findingsClient.AccountID = &accountID @@ -512,14 +515,14 @@ func resourceIBMSccSiOccurrenceMapToKpi(kpiMap map[string]interface{}) findingsv } func resourceIBMSccSiOccurrenceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } getOccurrenceOptions := &findingsv1.GetOccurrenceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -542,48 +545,48 @@ func resourceIBMSccSiOccurrenceRead(context context.Context, d *schema.ResourceD } if err = d.Set("provider_id", getOccurrenceOptions.ProviderID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting provider_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting provider_id: %s", err)) } // TODO: handle argument of type bool if err = d.Set("note_name", apiOccurrence.NoteName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting note_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting note_name: %s", err)) } if err = d.Set("kind", apiOccurrence.Kind); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kind: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kind: %s", err)) } if err = d.Set("occurrence_id", apiOccurrence.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting occurrence_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting occurrence_id: %s", err)) } if err = d.Set("resource_url", apiOccurrence.ResourceURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_url: %s", err)) } if err = d.Set("remediation", apiOccurrence.Remediation); err != nil { - return diag.FromErr(fmt.Errorf("Error setting remediation: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting remediation: %s", err)) } - if err = d.Set("create_time", dateTimeToString(apiOccurrence.CreateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting create_time: %s", err)) + if err = d.Set("create_time", flex.DateTimeToString(apiOccurrence.CreateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting create_time: %s", err)) } - if err = d.Set("update_time", dateTimeToString(apiOccurrence.UpdateTime)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting update_time: %s", err)) + if err = d.Set("update_time", flex.DateTimeToString(apiOccurrence.UpdateTime)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting update_time: %s", err)) } if apiOccurrence.Context != nil { contextMap := resourceIBMSccSiOccurrenceContextToMap(*apiOccurrence.Context) if len(contextMap) > 0 { if err = d.Set("context", []map[string]interface{}{contextMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting context: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting context: %s", err)) } } } if apiOccurrence.Finding != nil { findingMap := resourceIBMSccSiOccurrenceFindingToMap(*apiOccurrence.Finding) if err = d.Set("finding", []map[string]interface{}{findingMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting finding: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting finding: %s", err)) } } if apiOccurrence.Kpi != nil { kpiMap := resourceIBMSccSiOccurrenceKpiToMap(*apiOccurrence.Kpi) if err = d.Set("kpi", []map[string]interface{}{kpiMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting kpi: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting kpi: %s", err)) } } if _, ok := d.GetOk("replace_if_exists"); ok { @@ -700,7 +703,7 @@ func resourceIBMSccSiOccurrenceSocketAddressToMap(socketAddress findingsv1.Socke socketAddressMap["address"] = socketAddress.Address if socketAddress.Port != nil { - socketAddressMap["port"] = intValue(socketAddress.Port) + socketAddressMap["port"] = flex.IntValue(socketAddress.Port) } return socketAddressMap @@ -710,16 +713,16 @@ func resourceIBMSccSiOccurrenceDataTransferredToMap(dataTransferred findingsv1.D dataTransferredMap := map[string]interface{}{} if dataTransferred.ClientBytes != nil { - dataTransferredMap["client_bytes"] = intValue(dataTransferred.ClientBytes) + dataTransferredMap["client_bytes"] = flex.IntValue(dataTransferred.ClientBytes) } if dataTransferred.ServerBytes != nil { - dataTransferredMap["server_bytes"] = intValue(dataTransferred.ServerBytes) + dataTransferredMap["server_bytes"] = flex.IntValue(dataTransferred.ServerBytes) } if dataTransferred.ClientPackets != nil { - dataTransferredMap["client_packets"] = intValue(dataTransferred.ClientPackets) + dataTransferredMap["client_packets"] = flex.IntValue(dataTransferred.ClientPackets) } if dataTransferred.ServerPackets != nil { - dataTransferredMap["server_packets"] = intValue(dataTransferred.ServerPackets) + dataTransferredMap["server_packets"] = flex.IntValue(dataTransferred.ServerPackets) } return dataTransferredMap @@ -737,14 +740,14 @@ func resourceIBMSccSiOccurrenceKpiToMap(kpi findingsv1.Kpi) map[string]interface } func resourceIBMSccSiOccurrenceUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } updateOccurrenceOptions := &findingsv1.UpdateOccurrenceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -787,14 +790,14 @@ func resourceIBMSccSiOccurrenceUpdate(context context.Context, d *schema.Resourc } func resourceIBMSccSiOccurrenceDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - findingsClient, err := meta.(ClientSession).FindingsV1() + findingsClient, err := meta.(conns.ClientSession).FindingsV1() if err != nil { return diag.FromErr(err) } deleteOccurrenceOptions := &findingsv1.DeleteOccurrenceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/README.md new file mode 100644 index 0000000000..32e7f0f297 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Schematics + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Schematics resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/schematics_action) +* IBM API Docs: [IBM API Docs for Schematics](https://cloud.ibm.com/apidocs/schematics/schematics) +* IBM Schematics SDK: [IBM SDK for Schematics](https://github.com/IBM/schematics-go-sdk) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_action.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_action.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_action.go index 5d8c80da05..647b26bd8f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_action.go @@ -1,50 +1,52 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func dataSourceIBMSchematicsAction() *schema.Resource { +func DataSourceIBMSchematicsAction() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSchematicsActionRead, Schema: map[string]*schema.Schema{ - "action_id": &schema.Schema{ + "action_id": { Type: schema.TypeString, Required: true, Description: "Action Id. Use GET /actions API to look up the Action Ids in your IBM Cloud account.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique name of your action. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. **Example** you can use the name to stop action.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Action description.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Computed: true, Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "Resource-group name for an action. By default, action is created in default resource group.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Computed: true, Description: "Action tags.", @@ -52,23 +54,23 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "user_state": &schema.Schema{ + "user_state": { Type: schema.TypeList, Computed: true, Description: "User defined status of the Schematics object.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", }, - "set_by": &schema.Schema{ + "set_by": { Type: schema.TypeString, Computed: true, Description: "Name of the User who set the state of the Object.", }, - "set_at": &schema.Schema{ + "set_at": { Type: schema.TypeString, Computed: true, Description: "When the User who set the state of the Object.", @@ -76,54 +78,54 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "source_readme_url": &schema.Schema{ + "source_readme_url": { Type: schema.TypeString, Computed: true, Description: "URL of the `README` file, for the source URL.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeList, Computed: true, Description: "Source of templates, playbooks, or controls.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Computed: true, Description: "Type of source for the Template.", }, - "git": &schema.Schema{ + "git": { Type: schema.TypeList, Computed: true, Description: "Connection details to Git source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "computed_git_repo_url": &schema.Schema{ + "computed_git_repo_url": { Type: schema.TypeString, Computed: true, Description: "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", }, - "git_repo_url": &schema.Schema{ + "git_repo_url": { Type: schema.TypeString, Computed: true, Description: "URL to the GIT Repo that can be used to clone the template.", }, - "git_token": &schema.Schema{ + "git_token": { Type: schema.TypeString, Computed: true, Description: "Personal Access Token to connect to Git URLs.", }, - "git_repo_folder": &schema.Schema{ + "git_repo_folder": { Type: schema.TypeString, Computed: true, Description: "Name of the folder in the Git Repo, that contains the template.", }, - "git_release": &schema.Schema{ + "git_release": { Type: schema.TypeString, Computed: true, Description: "Name of the release tag, used to fetch the Git Repo.", }, - "git_branch": &schema.Schema{ + "git_branch": { Type: schema.TypeString, Computed: true, Description: "Name of the branch, used to fetch the Git Repo.", @@ -131,43 +133,43 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "catalog": &schema.Schema{ + "catalog": { Type: schema.TypeList, Computed: true, Description: "Connection details to IBM Cloud Catalog source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "catalog_name": &schema.Schema{ + "catalog_name": { Type: schema.TypeString, Computed: true, Description: "name of the private catalog.", }, - "offering_name": &schema.Schema{ + "offering_name": { Type: schema.TypeString, Computed: true, Description: "Name of the offering in the IBM Catalog.", }, - "offering_version": &schema.Schema{ + "offering_version": { Type: schema.TypeString, Computed: true, Description: "Version string of the offering in the IBM Catalog.", }, - "offering_kind": &schema.Schema{ + "offering_kind": { Type: schema.TypeString, Computed: true, Description: "Type of the offering, in the IBM Catalog.", }, - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Computed: true, Description: "Id of the offering the IBM Catalog.", }, - "offering_version_id": &schema.Schema{ + "offering_version_id": { Type: schema.TypeString, Computed: true, Description: "Id of the offering version the IBM Catalog.", }, - "offering_repo_url": &schema.Schema{ + "offering_repo_url": { Type: schema.TypeString, Computed: true, Description: "Repo Url of the offering, in the IBM Catalog.", @@ -175,13 +177,13 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "cos_bucket": &schema.Schema{ + "cos_bucket": { Type: schema.TypeList, Computed: true, Description: "Connection details to a IBM Cloud Object Storage bucket.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cos_bucket_url": &schema.Schema{ + "cos_bucket_url": { Type: schema.TypeString, Computed: true, Description: "COS Bucket Url.", @@ -192,49 +194,49 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Computed: true, Description: "Type of source for the Template.", }, - "command_parameter": &schema.Schema{ + "command_parameter": { Type: schema.TypeString, Computed: true, Description: "Schematics job command parameter (playbook-name).", }, - "inventory": &schema.Schema{ + "inventory": { Type: schema.TypeString, Computed: true, Description: "Target inventory record ID, used by the action or ansible playbook.", }, - "credentials": &schema.Schema{ + "credentials": { Type: schema.TypeList, Computed: true, Description: "credentials of the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -242,32 +244,32 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -275,42 +277,42 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -318,7 +320,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -326,18 +328,18 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "bastion": &schema.Schema{ + "bastion": { Type: schema.TypeList, Computed: true, Description: "Describes a bastion resource.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Bastion Name(Unique).", }, - "host": &schema.Schema{ + "host": { Type: schema.TypeString, Computed: true, Description: "Reference to the Inventory resource definition.", @@ -345,34 +347,34 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "bastion_credential": &schema.Schema{ + "bastion_credential": { Type: schema.TypeList, Computed: true, Description: "User editable variable data & system generated reference to value.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -380,32 +382,32 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -413,42 +415,42 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -456,7 +458,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -464,39 +466,39 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "targets_ini": &schema.Schema{ + "targets_ini": { Type: schema.TypeString, Computed: true, Description: "Inventory of host and host group for the playbook in `INI` file format. For example, `\"targets_ini\": \"[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5\"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps).", }, - "action_inputs": &schema.Schema{ + "action_inputs": { Type: schema.TypeList, Computed: true, Description: "Input variables for the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -504,32 +506,32 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -537,42 +539,42 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -580,7 +582,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -588,34 +590,34 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "action_outputs": &schema.Schema{ + "action_outputs": { Type: schema.TypeList, Computed: true, Description: "Output variables for the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -623,32 +625,32 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -656,42 +658,42 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -699,7 +701,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -707,34 +709,34 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Computed: true, Description: "Environment variables for the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -742,32 +744,32 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -775,42 +777,42 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -818,7 +820,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -826,78 +828,78 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "Action ID.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Action Cloud Resource Name.", }, - "account": &schema.Schema{ + "account": { Type: schema.TypeString, Computed: true, Description: "Action account ID.", }, - "source_created_at": &schema.Schema{ + "source_created_at": { Type: schema.TypeString, Computed: true, Description: "Action Playbook Source creation time.", }, - "source_created_by": &schema.Schema{ + "source_created_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of user who created the Action Playbook Source.", }, - "source_updated_at": &schema.Schema{ + "source_updated_at": { Type: schema.TypeString, Computed: true, Description: "The action playbook updation time.", }, - "source_updated_by": &schema.Schema{ + "source_updated_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of user who updated the action playbook source.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Action creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of the user who created an action.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Action updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of the user who updated an action.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeList, Computed: true, Description: "Computed state of the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of automation (workspace or action).", }, - "status_job_id": &schema.Schema{ + "status_job_id": { Type: schema.TypeString, Computed: true, Description: "Job id reference for this status.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "Automation status message - to be displayed along with the status_code.", @@ -905,7 +907,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { }, }, }, - "playbook_names": &schema.Schema{ + "playbook_names": { Type: schema.TypeList, Computed: true, Description: "Playbook names retrieved from the respository.", @@ -913,23 +915,23 @@ func dataSourceIBMSchematicsAction() *schema.Resource { Type: schema.TypeString, }, }, - "sys_lock": &schema.Schema{ + "sys_lock": { Type: schema.TypeList, Computed: true, Description: "System lock status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "sys_locked": &schema.Schema{ + "sys_locked": { Type: schema.TypeBool, Computed: true, Description: "Is the automation locked by a Schematic job ?.", }, - "sys_locked_by": &schema.Schema{ + "sys_locked_by": { Type: schema.TypeString, Computed: true, Description: "Name of the User who performed the job, that lead to the locking of the automation.", }, - "sys_locked_at": &schema.Schema{ + "sys_locked_at": { Type: schema.TypeString, Computed: true, Description: "When the User performed the job that lead to locking of the automation ?.", @@ -942,7 +944,7 @@ func dataSourceIBMSchematicsAction() *schema.Resource { } func dataSourceIBMSchematicsActionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -957,135 +959,135 @@ func dataSourceIBMSchematicsActionRead(context context.Context, d *schema.Resour return diag.FromErr(fmt.Errorf("GetActionWithContext failed %s\n%s", err, response)) } - d.SetId(fmt.Sprintf("%s", *getActionOptions.ActionID)) + d.SetId(*getActionOptions.ActionID) if err = d.Set("name", action.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", action.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("location", action.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("resource_group", action.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } if action.UserState != nil { err = d.Set("user_state", dataSourceActionFlattenUserState(*action.UserState)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting user_state %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting user_state %s", err)) } } if err = d.Set("source_readme_url", action.SourceReadmeURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_readme_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_readme_url: %s", err)) } if action.Source != nil { err = d.Set("source", dataSourceActionFlattenSource(*action.Source)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting source %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source %s", err)) } } if err = d.Set("source_type", action.SourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_type: %s", err)) } if err = d.Set("command_parameter", action.CommandParameter); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_parameter: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_parameter: %s", err)) } if err = d.Set("inventory", action.Inventory); err != nil { - return diag.FromErr(fmt.Errorf("Error setting inventory: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting inventory: %s", err)) } if action.Credentials != nil { err = d.Set("credentials", dataSourceActionFlattenCredentials(action.Credentials)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting credentials %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting credentials %s", err)) } } if action.Bastion != nil { err = d.Set("bastion", dataSourceActionFlattenBastion(*action.Bastion)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting bastion %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting bastion %s", err)) } } if action.BastionCredential != nil { err = d.Set("bastion_credential", dataSourceActionFlattenBastionCredential(*action.BastionCredential)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting bastion_credential %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting bastion_credential %s", err)) } } if err = d.Set("targets_ini", action.TargetsIni); err != nil { - return diag.FromErr(fmt.Errorf("Error setting targets_ini: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting targets_ini: %s", err)) } if action.Inputs != nil { err = d.Set("action_inputs", dataSourceActionFlattenInputs(action.Inputs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting action_inputs %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting action_inputs %s", err)) } } if action.Outputs != nil { err = d.Set("action_outputs", dataSourceActionFlattenOutputs(action.Outputs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting action_outputs %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting action_outputs %s", err)) } } if action.Settings != nil { err = d.Set("settings", dataSourceActionFlattenSettings(action.Settings)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting settings %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting settings %s", err)) } } if err = d.Set("id", action.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } if err = d.Set("crn", action.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("account", action.Account); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account: %s", err)) } - if err = d.Set("source_created_at", dateTimeToString(action.SourceCreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_created_at: %s", err)) + if err = d.Set("source_created_at", flex.DateTimeToString(action.SourceCreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_created_at: %s", err)) } if err = d.Set("source_created_by", action.SourceCreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_created_by: %s", err)) } - if err = d.Set("source_updated_at", dateTimeToString(action.SourceUpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_updated_at: %s", err)) + if err = d.Set("source_updated_at", flex.DateTimeToString(action.SourceUpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_updated_at: %s", err)) } if err = d.Set("source_updated_by", action.SourceUpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_updated_by: %s", err)) } - if err = d.Set("created_at", dateTimeToString(action.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(action.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", action.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(action.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(action.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", action.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } if action.State != nil { err = d.Set("state", dataSourceActionFlattenState(*action.State)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting state %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state %s", err)) } } if action.SysLock != nil { err = d.Set("sys_lock", dataSourceActionFlattenSysLock(*action.SysLock)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting sys_lock %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sys_lock %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_inventory.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_inventory.go new file mode 100644 index 0000000000..5733010ba2 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_inventory.go @@ -0,0 +1,140 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package schematics + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/schematics-go-sdk/schematicsv1" +) + +func DataSourceIBMSchematicsInventory() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMSchematicsInventoryRead, + + Schema: map[string]*schema.Schema{ + "inventory_id": { + Type: schema.TypeString, + Required: true, + Description: "Resource Inventory Id. Use `GET /v2/inventories` API to look up the Resource Inventory definition Ids in your IBM Cloud account.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "Inventory id.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "The description of your Inventory. The description can be up to 2048 characters long in size.", + }, + "location": { + Type: schema.TypeString, + Computed: true, + Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", + }, + "resource_group": { + Type: schema.TypeString, + Computed: true, + Description: "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "Inventory creation time.", + }, + "created_by": { + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who created the Inventory.", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Inventory updation time.", + }, + "updated_by": { + Type: schema.TypeString, + Computed: true, + Description: "Email address of user who updated the Inventory.", + }, + "inventories_ini": { + Type: schema.TypeString, + Computed: true, + Description: "Input inventory of host and host group for the playbook, in the .ini file format.", + }, + "resource_queries": { + Type: schema.TypeList, + Computed: true, + Description: "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceIBMSchematicsInventoryRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() + if err != nil { + return diag.FromErr(err) + } + + getInventoryOptions := &schematicsv1.GetInventoryOptions{} + + getInventoryOptions.SetInventoryID(d.Get("inventory_id").(string)) + + inventoryResourceRecord, response, err := schematicsClient.GetInventoryWithContext(context, getInventoryOptions) + if err != nil { + log.Printf("[DEBUG] GetInventoryWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetInventoryWithContext failed %s\n%s", err, response)) + } + + d.SetId(*getInventoryOptions.InventoryID) + if err = d.Set("name", inventoryResourceRecord.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + if err = d.Set("id", inventoryResourceRecord.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) + } + if err = d.Set("description", inventoryResourceRecord.Description); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) + } + if err = d.Set("location", inventoryResourceRecord.Location); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) + } + if err = d.Set("resource_group", inventoryResourceRecord.ResourceGroup); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(inventoryResourceRecord.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + if err = d.Set("created_by", inventoryResourceRecord.CreatedBy); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) + } + if err = d.Set("updated_at", flex.DateTimeToString(inventoryResourceRecord.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) + } + if err = d.Set("updated_by", inventoryResourceRecord.UpdatedBy); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) + } + if err = d.Set("inventories_ini", inventoryResourceRecord.InventoriesIni); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting inventories_ini: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_job.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_job.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_job.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_job.go index a189e71f63..203b76df6f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_job.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_job.go @@ -1,50 +1,52 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func dataSourceIBMSchematicsJob() *schema.Resource { +func DataSourceIBMSchematicsJob() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSchematicsJobRead, Schema: map[string]*schema.Schema{ - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Required: true, Description: "Job Id. Use `GET /v2/jobs` API to look up the Job Ids in your IBM Cloud account.", }, - "command_object": &schema.Schema{ + "command_object": { Type: schema.TypeString, Computed: true, Description: "Name of the Schematics automation resource.", }, - "command_object_id": &schema.Schema{ + "command_object_id": { Type: schema.TypeString, Computed: true, Description: "Job command object id (workspace-id, action-id).", }, - "command_name": &schema.Schema{ + "command_name": { Type: schema.TypeString, Computed: true, Description: "Schematics job command name.", }, - "command_parameter": &schema.Schema{ + "command_parameter": { Type: schema.TypeString, Computed: true, Description: "Schematics job command parameter (playbook-name).", }, - "command_options": &schema.Schema{ + "command_options": { Type: schema.TypeList, Computed: true, Description: "Command line options for the command.", @@ -52,34 +54,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "job_inputs": &schema.Schema{ + "job_inputs": { Type: schema.TypeList, Computed: true, Description: "Job inputs used by Action or Workspace.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -87,32 +89,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -120,42 +122,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -163,7 +165,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -171,34 +173,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "job_env_settings": &schema.Schema{ + "job_env_settings": { Type: schema.TypeList, Computed: true, Description: "Environment variables used by the Job while performing Action or Workspace.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -206,32 +208,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -239,42 +241,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -282,7 +284,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -290,7 +292,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Computed: true, Description: "User defined tags, while running the job.", @@ -298,141 +300,141 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "Job ID.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Job name, uniquely derived from the related Workspace or Action.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of your job is derived from the related action or workspace. The description can be up to 2048 characters long in size.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Computed: true, Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "Resource-group name derived from the related Workspace or Action.", }, - "submitted_at": &schema.Schema{ + "submitted_at": { Type: schema.TypeString, Computed: true, Description: "Job submission time.", }, - "submitted_by": &schema.Schema{ + "submitted_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who submitted the job.", }, - "start_at": &schema.Schema{ + "start_at": { Type: schema.TypeString, Computed: true, Description: "Job start time.", }, - "end_at": &schema.Schema{ + "end_at": { Type: schema.TypeString, Computed: true, Description: "Job end time.", }, - "duration": &schema.Schema{ + "duration": { Type: schema.TypeString, Computed: true, Description: "Duration of job execution; example 40 sec.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeList, Computed: true, Description: "Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_job_status": &schema.Schema{ + "workspace_job_status": { Type: schema.TypeList, Computed: true, Description: "Workspace Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Computed: true, Description: "Workspace name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "Workspace job status message (eg. App1_Setup_Pending, for a 'Setup' flow in the 'App1' Workspace).", }, - "flow_status": &schema.Schema{ + "flow_status": { Type: schema.TypeList, Computed: true, Description: "Environment Flow JOB Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Computed: true, Description: "flow id.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Computed: true, Description: "flow name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "Flow Job status message - to be displayed along with the status_code;.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Computed: true, Description: "Environment's individual workItem status details;.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Computed: true, Description: "Workspace id.", }, - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Computed: true, Description: "workspace name.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Computed: true, Description: "workspace job id.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "workitem job status message;.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "workitem job status updation timestamp.", @@ -440,7 +442,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -448,38 +450,38 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "template_status": &schema.Schema{ + "template_status": { Type: schema.TypeList, Computed: true, Description: "Workspace Flow Template job status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "template_id": &schema.Schema{ + "template_id": { Type: schema.TypeString, Computed: true, Description: "Template Id.", }, - "template_name": &schema.Schema{ + "template_name": { Type: schema.TypeString, Computed: true, Description: "Template name.", }, - "flow_index": &schema.Schema{ + "flow_index": { Type: schema.TypeInt, Computed: true, Description: "Index of the template in the Flow.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "Template job status message (eg. VPCt1_Apply_Pending, for a 'VPCt1' Template).", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -487,7 +489,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -495,48 +497,48 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "action_job_status": &schema.Schema{ + "action_job_status": { Type: schema.TypeList, Computed: true, Description: "Action Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "action_name": &schema.Schema{ + "action_name": { Type: schema.TypeString, Computed: true, Description: "Action name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "Action Job status message - to be displayed along with the action_status_code.", }, - "bastion_status_code": &schema.Schema{ + "bastion_status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Resources.", }, - "bastion_status_message": &schema.Schema{ + "bastion_status_message": { Type: schema.TypeString, Computed: true, Description: "Bastion status message - to be displayed along with the bastion_status_code;.", }, - "targets_status_code": &schema.Schema{ + "targets_status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Resources.", }, - "targets_status_message": &schema.Schema{ + "targets_status_message": { Type: schema.TypeString, Computed: true, Description: "Aggregated status message for all target resources, to be displayed along with the targets_status_code;.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -544,44 +546,44 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "system_job_status": &schema.Schema{ + "system_job_status": { Type: schema.TypeList, Computed: true, Description: "System Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "system_status_message": &schema.Schema{ + "system_status_message": { Type: schema.TypeString, Computed: true, Description: "System job message.", }, - "system_status_code": &schema.Schema{ + "system_status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "schematics_resource_status": &schema.Schema{ + "schematics_resource_status": { Type: schema.TypeList, Computed: true, Description: "job staus for each schematics resource.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "system job status message.", }, - "schematics_resource_id": &schema.Schema{ + "schematics_resource_id": { Type: schema.TypeString, Computed: true, Description: "id for each resource which is targeted as a part of system job.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -589,7 +591,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -597,64 +599,64 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "flow_job_status": &schema.Schema{ + "flow_job_status": { Type: schema.TypeList, Computed: true, Description: "Environment Flow JOB Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Computed: true, Description: "flow id.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Computed: true, Description: "flow name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "Flow Job status message - to be displayed along with the status_code;.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Computed: true, Description: "Environment's individual workItem status details;.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Computed: true, Description: "Workspace id.", }, - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Computed: true, Description: "workspace name.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Computed: true, Description: "workspace job id.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Computed: true, Description: "workitem job status message;.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "workitem job status updation timestamp.", @@ -662,7 +664,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -673,66 +675,66 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "data": &schema.Schema{ + "data": { Type: schema.TypeList, Computed: true, Description: "Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "job_type": &schema.Schema{ + "job_type": { Type: schema.TypeString, Computed: true, Description: "Type of Job.", }, - "workspace_job_data": &schema.Schema{ + "workspace_job_data": { Type: schema.TypeList, Computed: true, Description: "Workspace Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Computed: true, Description: "Workspace name.", }, - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Computed: true, Description: "Flow Id.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Computed: true, Description: "Flow name.", }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Computed: true, Description: "Input variables data used by the Workspace Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -740,32 +742,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -773,42 +775,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -816,7 +818,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -824,34 +826,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Computed: true, Description: "Output variables data from the Workspace Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -859,32 +861,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -892,42 +894,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -935,7 +937,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -943,34 +945,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Computed: true, Description: "Environment variables used by all the templates in the Workspace.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -978,32 +980,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1011,42 +1013,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1054,7 +1056,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1062,55 +1064,55 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "template_data": &schema.Schema{ + "template_data": { Type: schema.TypeList, Computed: true, Description: "Input / output data of the Template in the Workspace Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "template_id": &schema.Schema{ + "template_id": { Type: schema.TypeString, Computed: true, Description: "Template Id.", }, - "template_name": &schema.Schema{ + "template_name": { Type: schema.TypeString, Computed: true, Description: "Template name.", }, - "flow_index": &schema.Schema{ + "flow_index": { Type: schema.TypeInt, Computed: true, Description: "Index of the template in the Flow.", }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Computed: true, Description: "Job inputs used by the Templates.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -1118,32 +1120,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1151,42 +1153,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1194,7 +1196,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1202,34 +1204,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Computed: true, Description: "Job output from the Templates.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -1237,32 +1239,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1270,42 +1272,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1313,7 +1315,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1321,34 +1323,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Computed: true, Description: "Environment variables used by the template.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -1356,32 +1358,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1389,42 +1391,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1432,7 +1434,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1440,7 +1442,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -1448,7 +1450,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -1456,45 +1458,45 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "action_job_data": &schema.Schema{ + "action_job_data": { Type: schema.TypeList, Computed: true, Description: "Action Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "action_name": &schema.Schema{ + "action_name": { Type: schema.TypeString, Computed: true, Description: "Flow name.", }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Computed: true, Description: "Input variables data used by the Action Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -1502,32 +1504,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1535,42 +1537,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1578,7 +1580,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1586,34 +1588,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Computed: true, Description: "Output variables data from the Action Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -1621,32 +1623,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1654,42 +1656,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1697,7 +1699,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1705,34 +1707,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Computed: true, Description: "Environment variables used by all the templates in the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -1740,32 +1742,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -1773,42 +1775,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -1816,7 +1818,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -1824,68 +1826,68 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", }, - "inventory_record": &schema.Schema{ + "inventory_record": { Type: schema.TypeList, Computed: true, Description: "Complete inventory resource details with user inputs and system generated data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "Inventory id.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of your Inventory. The description can be up to 2048 characters long in size.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Computed: true, Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Inventory creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who created the Inventory.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Inventory updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who updated the Inventory.", }, - "inventories_ini": &schema.Schema{ + "inventories_ini": { Type: schema.TypeString, Computed: true, Description: "Input inventory of host and host group for the playbook, in the .ini file format.", }, - "resource_queries": &schema.Schema{ + "resource_queries": { Type: schema.TypeList, Computed: true, Description: "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", @@ -1896,7 +1898,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "materialized_inventory": &schema.Schema{ + "materialized_inventory": { Type: schema.TypeString, Computed: true, Description: "Materialized inventory details used by the Action Job, in .ini format.", @@ -1904,18 +1906,18 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "system_job_data": &schema.Schema{ + "system_job_data": { Type: schema.TypeList, Computed: true, Description: "Controls Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "key_id": &schema.Schema{ + "key_id": { Type: schema.TypeString, Computed: true, Description: "Key ID for which key event is generated.", }, - "schematics_resource_id": &schema.Schema{ + "schematics_resource_id": { Type: schema.TypeList, Computed: true, Description: "List of the schematics resource id.", @@ -1923,7 +1925,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -1931,91 +1933,91 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "flow_job_data": &schema.Schema{ + "flow_job_data": { Type: schema.TypeList, Computed: true, Description: "Flow Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Computed: true, Description: "Flow ID.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Computed: true, Description: "Flow Name.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Computed: true, Description: "Job data used by each workitem Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "command_object_id": &schema.Schema{ + "command_object_id": { Type: schema.TypeString, Computed: true, Description: "command object id.", }, - "command_object_name": &schema.Schema{ + "command_object_name": { Type: schema.TypeString, Computed: true, Description: "command object name.", }, - "layers": &schema.Schema{ + "layers": { Type: schema.TypeString, Computed: true, Description: "layer name.", }, - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Computed: true, Description: "Type of source for the Template.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeList, Computed: true, Description: "Source of templates, playbooks, or controls.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Computed: true, Description: "Type of source for the Template.", }, - "git": &schema.Schema{ + "git": { Type: schema.TypeList, Computed: true, Description: "Connection details to Git source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "computed_git_repo_url": &schema.Schema{ + "computed_git_repo_url": { Type: schema.TypeString, Computed: true, Description: "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", }, - "git_repo_url": &schema.Schema{ + "git_repo_url": { Type: schema.TypeString, Computed: true, Description: "URL to the GIT Repo that can be used to clone the template.", }, - "git_token": &schema.Schema{ + "git_token": { Type: schema.TypeString, Computed: true, Description: "Personal Access Token to connect to Git URLs.", }, - "git_repo_folder": &schema.Schema{ + "git_repo_folder": { Type: schema.TypeString, Computed: true, Description: "Name of the folder in the Git Repo, that contains the template.", }, - "git_release": &schema.Schema{ + "git_release": { Type: schema.TypeString, Computed: true, Description: "Name of the release tag, used to fetch the Git Repo.", }, - "git_branch": &schema.Schema{ + "git_branch": { Type: schema.TypeString, Computed: true, Description: "Name of the branch, used to fetch the Git Repo.", @@ -2023,43 +2025,43 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "catalog": &schema.Schema{ + "catalog": { Type: schema.TypeList, Computed: true, Description: "Connection details to IBM Cloud Catalog source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "catalog_name": &schema.Schema{ + "catalog_name": { Type: schema.TypeString, Computed: true, Description: "name of the private catalog.", }, - "offering_name": &schema.Schema{ + "offering_name": { Type: schema.TypeString, Computed: true, Description: "Name of the offering in the IBM Catalog.", }, - "offering_version": &schema.Schema{ + "offering_version": { Type: schema.TypeString, Computed: true, Description: "Version string of the offering in the IBM Catalog.", }, - "offering_kind": &schema.Schema{ + "offering_kind": { Type: schema.TypeString, Computed: true, Description: "Type of the offering, in the IBM Catalog.", }, - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Computed: true, Description: "Id of the offering the IBM Catalog.", }, - "offering_version_id": &schema.Schema{ + "offering_version_id": { Type: schema.TypeString, Computed: true, Description: "Id of the offering version the IBM Catalog.", }, - "offering_repo_url": &schema.Schema{ + "offering_repo_url": { Type: schema.TypeString, Computed: true, Description: "Repo Url of the offering, in the IBM Catalog.", @@ -2067,13 +2069,13 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "cos_bucket": &schema.Schema{ + "cos_bucket": { Type: schema.TypeList, Computed: true, Description: "Connection details to a IBM Cloud Object Storage bucket.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cos_bucket_url": &schema.Schema{ + "cos_bucket_url": { Type: schema.TypeString, Computed: true, Description: "COS Bucket Url.", @@ -2084,34 +2086,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Computed: true, Description: "Input variables data for the workItem used in FlowJob.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -2119,32 +2121,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -2152,42 +2154,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -2195,7 +2197,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -2203,34 +2205,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Computed: true, Description: "Output variables for the workItem.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -2238,32 +2240,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -2271,42 +2273,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -2314,7 +2316,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -2322,34 +2324,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Computed: true, Description: "Environment variables for the workItem.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Computed: true, Description: "List of aliases for the variable name.", @@ -2357,32 +2359,32 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Computed: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Computed: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Computed: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", @@ -2390,42 +2392,42 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Computed: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Computed: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Computed: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Computed: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Computed: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Computed: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Computed: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Computed: true, Description: "Source of this meta-data.", @@ -2433,7 +2435,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Computed: true, Description: "Reference link to the variable value By default the expression will point to self.value.", @@ -2441,38 +2443,38 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "last_job": &schema.Schema{ + "last_job": { Type: schema.TypeList, Computed: true, Description: "Status of the last job executed by the workitem.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "command_object": &schema.Schema{ + "command_object": { Type: schema.TypeString, Computed: true, Description: "Name of the Schematics automation resource.", }, - "command_object_name": &schema.Schema{ + "command_object_name": { Type: schema.TypeString, Computed: true, Description: "command object name (workspace_name/action_name).", }, - "command_object_id": &schema.Schema{ + "command_object_id": { Type: schema.TypeString, Computed: true, Description: "Workitem command object id, maps to workspace_id or action_id.", }, - "command_name": &schema.Schema{ + "command_name": { Type: schema.TypeString, Computed: true, Description: "Schematics job command name.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Computed: true, Description: "Workspace job id.", }, - "job_status": &schema.Schema{ + "job_status": { Type: schema.TypeString, Computed: true, Description: "Status of Jobs.", @@ -2480,7 +2482,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -2488,7 +2490,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -2499,18 +2501,18 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "bastion": &schema.Schema{ + "bastion": { Type: schema.TypeList, Computed: true, Description: "Describes a bastion resource.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Bastion Name(Unique).", }, - "host": &schema.Schema{ + "host": { Type: schema.TypeString, Computed: true, Description: "Reference to the Inventory resource definition.", @@ -2518,54 +2520,54 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "log_summary": &schema.Schema{ + "log_summary": { Type: schema.TypeList, Computed: true, Description: "Job log summary record.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Computed: true, Description: "Workspace Id.", }, - "job_type": &schema.Schema{ + "job_type": { Type: schema.TypeString, Computed: true, Description: "Type of Job.", }, - "log_start_at": &schema.Schema{ + "log_start_at": { Type: schema.TypeString, Computed: true, Description: "Job log start timestamp.", }, - "log_analyzed_till": &schema.Schema{ + "log_analyzed_till": { Type: schema.TypeString, Computed: true, Description: "Job log update timestamp.", }, - "elapsed_time": &schema.Schema{ + "elapsed_time": { Type: schema.TypeFloat, Computed: true, Description: "Job log elapsed time (log_analyzed_till - log_start_at).", }, - "log_errors": &schema.Schema{ + "log_errors": { Type: schema.TypeList, Computed: true, Description: "Job log errors.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "error_code": &schema.Schema{ + "error_code": { Type: schema.TypeString, Computed: true, Description: "Error code in the Log.", }, - "error_msg": &schema.Schema{ + "error_msg": { Type: schema.TypeString, Computed: true, Description: "Summary error message in the log.", }, - "error_count": &schema.Schema{ + "error_count": { Type: schema.TypeFloat, Computed: true, Description: "Number of occurrence.", @@ -2573,33 +2575,33 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "repo_download_job": &schema.Schema{ + "repo_download_job": { Type: schema.TypeList, Computed: true, Description: "Repo download Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "scanned_file_count": &schema.Schema{ + "scanned_file_count": { Type: schema.TypeFloat, Computed: true, Description: "Number of files scanned.", }, - "quarantined_file_count": &schema.Schema{ + "quarantined_file_count": { Type: schema.TypeFloat, Computed: true, Description: "Number of files quarantined.", }, - "detected_filetype": &schema.Schema{ + "detected_filetype": { Type: schema.TypeString, Computed: true, Description: "Detected template or data file type.", }, - "inputs_count": &schema.Schema{ + "inputs_count": { Type: schema.TypeString, Computed: true, Description: "Number of inputs detected.", }, - "outputs_count": &schema.Schema{ + "outputs_count": { Type: schema.TypeString, Computed: true, Description: "Number of outputs detected.", @@ -2607,23 +2609,23 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "workspace_job": &schema.Schema{ + "workspace_job": { Type: schema.TypeList, Computed: true, Description: "Workspace Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "resources_add": &schema.Schema{ + "resources_add": { Type: schema.TypeFloat, Computed: true, Description: "Number of resources add.", }, - "resources_modify": &schema.Schema{ + "resources_modify": { Type: schema.TypeFloat, Computed: true, Description: "Number of resources modify.", }, - "resources_destroy": &schema.Schema{ + "resources_destroy": { Type: schema.TypeFloat, Computed: true, Description: "Number of resources destroy.", @@ -2631,58 +2633,58 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "flow_job": &schema.Schema{ + "flow_job": { Type: schema.TypeList, Computed: true, Description: "Flow Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workitems_completed": &schema.Schema{ + "workitems_completed": { Type: schema.TypeFloat, Computed: true, Description: "Number of workitems completed successfully.", }, - "workitems_pending": &schema.Schema{ + "workitems_pending": { Type: schema.TypeFloat, Computed: true, Description: "Number of workitems pending in the flow.", }, - "workitems_failed": &schema.Schema{ + "workitems_failed": { Type: schema.TypeFloat, Computed: true, Description: "Number of workitems failed.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Computed: true, Description: "workspace ID.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Computed: true, Description: "workspace JOB ID.", }, - "resources_add": &schema.Schema{ + "resources_add": { Type: schema.TypeFloat, Computed: true, Description: "Number of resources add.", }, - "resources_modify": &schema.Schema{ + "resources_modify": { Type: schema.TypeFloat, Computed: true, Description: "Number of resources modify.", }, - "resources_destroy": &schema.Schema{ + "resources_destroy": { Type: schema.TypeFloat, Computed: true, Description: "Number of resources destroy.", }, - "log_url": &schema.Schema{ + "log_url": { Type: schema.TypeString, Computed: true, Description: "Log url for job.", @@ -2693,34 +2695,34 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "action_job": &schema.Schema{ + "action_job": { Type: schema.TypeList, Computed: true, Description: "Flow Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target_count": &schema.Schema{ + "target_count": { Type: schema.TypeFloat, Computed: true, Description: "number of targets or hosts.", }, - "task_count": &schema.Schema{ + "task_count": { Type: schema.TypeFloat, Computed: true, Description: "number of tasks in playbook.", }, - "play_count": &schema.Schema{ + "play_count": { Type: schema.TypeFloat, Computed: true, Description: "number of plays in playbook.", }, - "recap": &schema.Schema{ + "recap": { Type: schema.TypeList, Computed: true, Description: "Recap records.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target": &schema.Schema{ + "target": { Type: schema.TypeList, Computed: true, Description: "List of target or host name.", @@ -2728,27 +2730,27 @@ func dataSourceIBMSchematicsJob() *schema.Resource { Type: schema.TypeString, }, }, - "ok": &schema.Schema{ + "ok": { Type: schema.TypeFloat, Computed: true, Description: "Number of OK.", }, - "changed": &schema.Schema{ + "changed": { Type: schema.TypeFloat, Computed: true, Description: "Number of changed.", }, - "failed": &schema.Schema{ + "failed": { Type: schema.TypeFloat, Computed: true, Description: "Number of failed.", }, - "skipped": &schema.Schema{ + "skipped": { Type: schema.TypeFloat, Computed: true, Description: "Number of skipped.", }, - "unreachable": &schema.Schema{ + "unreachable": { Type: schema.TypeFloat, Computed: true, Description: "Number of unreachable.", @@ -2759,23 +2761,23 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "system_job": &schema.Schema{ + "system_job": { Type: schema.TypeList, Computed: true, Description: "System Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target_count": &schema.Schema{ + "target_count": { Type: schema.TypeFloat, Computed: true, Description: "number of targets or hosts.", }, - "success": &schema.Schema{ + "success": { Type: schema.TypeFloat, Computed: true, Description: "Number of passed.", }, - "failed": &schema.Schema{ + "failed": { Type: schema.TypeFloat, Computed: true, Description: "Number of failed.", @@ -2786,22 +2788,22 @@ func dataSourceIBMSchematicsJob() *schema.Resource { }, }, }, - "log_store_url": &schema.Schema{ + "log_store_url": { Type: schema.TypeString, Computed: true, Description: "Job log store URL.", }, - "state_store_url": &schema.Schema{ + "state_store_url": { Type: schema.TypeString, Computed: true, Description: "Job state store URL.", }, - "results_url": &schema.Schema{ + "results_url": { Type: schema.TypeString, Computed: true, Description: "Job results store URL.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -2811,7 +2813,7 @@ func dataSourceIBMSchematicsJob() *schema.Resource { } func dataSourceIBMSchematicsJobRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -2826,102 +2828,102 @@ func dataSourceIBMSchematicsJobRead(context context.Context, d *schema.ResourceD return diag.FromErr(fmt.Errorf("GetJobWithContext failed %s\n%s", err, response)) } - d.SetId(fmt.Sprintf("%s", *getJobOptions.JobID)) + d.SetId(*getJobOptions.JobID) if err = d.Set("command_object", job.CommandObject); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_object: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_object: %s", err)) } if err = d.Set("command_object_id", job.CommandObjectID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_object_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_object_id: %s", err)) } if err = d.Set("command_name", job.CommandName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_name: %s", err)) } if err = d.Set("command_parameter", job.CommandParameter); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_parameter: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_parameter: %s", err)) } if job.Inputs != nil { err = d.Set("job_inputs", dataSourceJobFlattenInputs(job.Inputs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting job_inputs %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting job_inputs %s", err)) } } if job.Settings != nil { err = d.Set("job_env_settings", dataSourceJobFlattenSettings(job.Settings)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting job_env_settings %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting job_env_settings %s", err)) } } if err = d.Set("id", job.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } if err = d.Set("name", job.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", job.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("location", job.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("resource_group", job.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } - if err = d.Set("submitted_at", dateTimeToString(job.SubmittedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting submitted_at: %s", err)) + if err = d.Set("submitted_at", flex.DateTimeToString(job.SubmittedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting submitted_at: %s", err)) } if err = d.Set("submitted_by", job.SubmittedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting submitted_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting submitted_by: %s", err)) } - if err = d.Set("start_at", dateTimeToString(job.StartAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting start_at: %s", err)) + if err = d.Set("start_at", flex.DateTimeToString(job.StartAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting start_at: %s", err)) } - if err = d.Set("end_at", dateTimeToString(job.EndAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting end_at: %s", err)) + if err = d.Set("end_at", flex.DateTimeToString(job.EndAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting end_at: %s", err)) } if err = d.Set("duration", job.Duration); err != nil { - return diag.FromErr(fmt.Errorf("Error setting duration: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting duration: %s", err)) } if job.Status != nil { err = d.Set("status", dataSourceJobFlattenStatus(*job.Status)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting status %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status %s", err)) } } if job.Data != nil { err = d.Set("data", dataSourceJobFlattenData(*job.Data)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting data %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting data %s", err)) } } if job.Bastion != nil { err = d.Set("bastion", dataSourceJobFlattenBastion(*job.Bastion)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting bastion %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting bastion %s", err)) } } if job.LogSummary != nil { err = d.Set("log_summary", dataSourceJobFlattenLogSummary(*job.LogSummary)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting log_summary %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting log_summary %s", err)) } } if err = d.Set("log_store_url", job.LogStoreURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting log_store_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting log_store_url: %s", err)) } if err = d.Set("state_store_url", job.StateStoreURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state_store_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state_store_url: %s", err)) } if err = d.Set("results_url", job.ResultsURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting results_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting results_url: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(job.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(job.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_output.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_output.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_output.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_output.go index 6cbf4b6ed1..92aeb6bd08 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_output.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_output.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "encoding/json" @@ -9,11 +9,13 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/schematics-go-sdk/schematicsv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSchematicsOutput() *schema.Resource { +func DataSourceIBMSchematicsOutput() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMSchematicsOutputRead, @@ -37,7 +39,7 @@ func dataSourceIBMSchematicsOutput() *schema.Resource { Optional: true, Description: "The json output in string", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this Workspace", @@ -47,7 +49,7 @@ func dataSourceIBMSchematicsOutput() *schema.Resource { } func dataSourceIBMSchematicsOutputRead(d *schema.ResourceData, meta interface{}) error { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return err } @@ -88,18 +90,18 @@ func dataSourceIBMSchematicsOutputRead(d *schema.ResourceData, meta interface{}) } if !(found) { - return fmt.Errorf("Error while fetching template id in workspace: %s", workspaceID) + return fmt.Errorf("[ERROR] Error while fetching template id in workspace: %s", workspaceID) } d.Set("output_json", outputJSON) d.SetId(fmt.Sprintf("%s/%s", workspaceID, templateID)) - d.Set("output_values", Flatten(items)) + d.Set("output_values", flex.Flatten(items)) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/schematics") + d.Set(flex.ResourceControllerURL, controller+"/schematics") return nil } @@ -127,10 +129,10 @@ func dataSourceOutputValuesListOutputValuesToMap(outputValuesItem schematicsv1.O outputValuesMap["id"] = outputValuesItem.ID } - m := []Map{} + m := []flex.Map{} for _, outputValues := range outputValuesItem.OutputValues { - m = append(m, Flatten(outputValues.(map[string]interface{}))) + m = append(m, flex.Flatten(outputValues.(map[string]interface{}))) } if outputValuesItem.OutputValues != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_resource_query.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_resource_query.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_resource_query.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_resource_query.go index c0c45f46d5..92e9c92cb1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_resource_query.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_resource_query.go @@ -1,90 +1,92 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func dataSourceIBMSchematicsResourceQuery() *schema.Resource { +func DataSourceIBMSchematicsResourceQuery() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSchematicsResourceQueryRead, Schema: map[string]*schema.Schema{ - "query_id": &schema.Schema{ + "query_id": { Type: schema.TypeString, Required: true, Description: "Resource query Id. Use `GET /v2/resource_query` API to look up the Resource query definition Ids in your IBM Cloud account.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "Resource type (cluster, vsi, icd, vpc).", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Resource query name.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "Resource Query id.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Resource query creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who created the Resource query.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Resource query updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who updated the Resource query.", }, - "queries": &schema.Schema{ + "queries": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "query_type": &schema.Schema{ + "query_type": { Type: schema.TypeString, Computed: true, Description: "Type of the query(workspaces).", }, - "query_condition": &schema.Schema{ + "query_condition": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Name of the resource query param.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Value of the resource query param.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "Description of resource query param variable.", @@ -92,7 +94,7 @@ func dataSourceIBMSchematicsResourceQuery() *schema.Resource { }, }, }, - "query_select": &schema.Schema{ + "query_select": { Type: schema.TypeList, Computed: true, Description: "List of query selection parameters.", @@ -108,7 +110,7 @@ func dataSourceIBMSchematicsResourceQuery() *schema.Resource { } func dataSourceIBMSchematicsResourceQueryRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -123,33 +125,33 @@ func dataSourceIBMSchematicsResourceQueryRead(context context.Context, d *schema return diag.FromErr(fmt.Errorf("GetResourcesQueryWithContext failed %s\n%s", err, response)) } - d.SetId(fmt.Sprintf("%s", *getResourcesQueryOptions.QueryID)) + d.SetId(*getResourcesQueryOptions.QueryID) if err = d.Set("type", resourceQueryRecord.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } if err = d.Set("name", resourceQueryRecord.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("id", resourceQueryRecord.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting id: %s", err)) } - if err = d.Set("created_at", dateTimeToString(resourceQueryRecord.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(resourceQueryRecord.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", resourceQueryRecord.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(resourceQueryRecord.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(resourceQueryRecord.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", resourceQueryRecord.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } if resourceQueryRecord.Queries != nil { err = d.Set("queries", dataSourceResourceQueryRecordFlattenQueries(resourceQueryRecord.Queries)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting queries %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting queries %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_state.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_state.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_state.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_state.go index 30a0310417..13413cb75c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_state.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_state.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "bytes" @@ -11,36 +11,38 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func dataSourceIBMSchematicsState() *schema.Resource { +func DataSourceIBMSchematicsState() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSchematicsStateRead, Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Required: true, Description: "The ID of the workspace for which you want to retrieve the Terraform statefile URL. To find the workspace ID, use the GET /v1/workspaces API.", }, - "template_id": &schema.Schema{ + "template_id": { Type: schema.TypeString, Required: true, Description: "The ID of the Terraform template for which you want to retrieve the Terraform statefile. When you create a workspace, the Terraform template that your workspace points to is assigned a unique ID. To find this ID, use the GET /v1/workspaces API and review the template_data.id value.", }, - "state_store": &schema.Schema{ + "state_store": { Type: schema.TypeString, Computed: true, }, - "state_store_json": &schema.Schema{ + "state_store_json": { Type: schema.TypeString, Computed: true, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this workspace", @@ -50,7 +52,7 @@ func dataSourceIBMSchematicsState() *schema.Resource { } func dataSourceIBMSchematicsStateRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -88,11 +90,11 @@ func dataSourceIBMSchematicsStateRead(context context.Context, d *schema.Resourc stateStoreJSON := string(stateByte[:]) d.Set("state_store_json", stateStoreJSON) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return diag.FromErr(err) } - d.Set(ResourceControllerURL, controller+"/schematics") + d.Set(flex.ResourceControllerURL, controller+"/schematics") return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_workspace.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_workspace.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_workspace.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_workspace.go index 856630728f..f58b964210 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_schematics_workspace.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/data_source_ibm_schematics_workspace.go @@ -1,30 +1,32 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func dataSourceIBMSchematicsWorkspace() *schema.Resource { +func DataSourceIBMSchematicsWorkspace() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSchematicsWorkspaceRead, Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Required: true, Description: "The ID of the workspace. To find the workspace ID, use the `GET /v1/workspaces` API.", }, - "applied_shareddata_ids": &schema.Schema{ + "applied_shareddata_ids": { Type: schema.TypeList, Computed: true, Description: "List of applied shared dataset ID.", @@ -32,53 +34,53 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { Type: schema.TypeString, }, }, - "catalog_ref": &schema.Schema{ + "catalog_ref": { Type: schema.TypeList, Computed: true, Description: "Information about the software template that you chose from the IBM Cloud catalog. This information is returned for IBM Cloud catalog offerings only.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "dry_run": &schema.Schema{ + "dry_run": { Type: schema.TypeBool, Computed: true, Description: "Dry run.", }, - "owning_account": &schema.Schema{ + "owning_account": { Type: schema.TypeString, Computed: true, Description: "Owning account ID of the catalog.", }, - "item_icon_url": &schema.Schema{ + "item_icon_url": { Type: schema.TypeString, Computed: true, Description: "The URL to the icon of the software template in the IBM Cloud catalog.", }, - "item_id": &schema.Schema{ + "item_id": { Type: schema.TypeString, Computed: true, Description: "The ID of the software template that you chose to install from the IBM Cloud catalog. This software is provisioned with Schematics.", }, - "item_name": &schema.Schema{ + "item_name": { Type: schema.TypeString, Computed: true, Description: "The name of the software that you chose to install from the IBM Cloud catalog.", }, - "item_readme_url": &schema.Schema{ + "item_readme_url": { Type: schema.TypeString, Computed: true, Description: "The URL to the readme file of the software template in the IBM Cloud catalog.", }, - "item_url": &schema.Schema{ + "item_url": { Type: schema.TypeString, Computed: true, Description: "The URL to the software template in the IBM Cloud catalog.", }, - "launch_url": &schema.Schema{ + "launch_url": { Type: schema.TypeString, Computed: true, Description: "The URL to the dashboard to access your software.", }, - "offering_version": &schema.Schema{ + "offering_version": { Type: schema.TypeString, Computed: true, Description: "The version of the software template that you chose to install from the IBM Cloud catalog.", @@ -86,78 +88,78 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the workspace was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The user ID that created the workspace.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The workspace CRN.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of the workspace.", }, - "last_health_check_at": &schema.Schema{ + "last_health_check_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the last health check was performed by Schematics.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Computed: true, Description: "The IBM Cloud location where your workspace was provisioned.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the workspace.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "The resource group the workspace was provisioned in.", }, - "runtime_data": &schema.Schema{ + "runtime_data": { Type: schema.TypeList, Computed: true, Description: "Information about the provisioning engine, state file, and runtime logs.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "engine_cmd": &schema.Schema{ + "engine_cmd": { Type: schema.TypeString, Computed: true, Description: "The command that was used to apply the Terraform template or IBM Cloud catalog software template.", }, - "engine_name": &schema.Schema{ + "engine_name": { Type: schema.TypeString, Computed: true, Description: "The provisioning engine that was used to apply the Terraform template or IBM Cloud catalog software template.", }, - "engine_version": &schema.Schema{ + "engine_version": { Type: schema.TypeString, Computed: true, Description: "The version of the provisioning engine that was used.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID that was assigned to your Terraform template or IBM Cloud catalog software template.", }, - "log_store_url": &schema.Schema{ + "log_store_url": { Type: schema.TypeString, Computed: true, Description: "The URL to access the logs that were created during the creation, update, or deletion of your IBM Cloud resources.", }, - "output_values": &schema.Schema{ + "output_values": { Type: schema.TypeList, Computed: true, Description: "List of Output values.", @@ -165,7 +167,7 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { Type: schema.TypeMap, }, }, - "resources": &schema.Schema{ + "resources": { Type: schema.TypeList, Computed: true, Description: "List of resources.", @@ -173,7 +175,7 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { Type: schema.TypeMap, }, }, - "state_store_url": &schema.Schema{ + "state_store_url": { Type: schema.TypeString, Computed: true, Description: "The URL where the Terraform statefile (`terraform.tfstate`) is stored. You can use the statefile to find an overview of IBM Cloud resources that were created by Schematics. Schematics uses the statefile as an inventory list to determine future create, update, or deletion jobs.", @@ -181,23 +183,23 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "shared_data": &schema.Schema{ + "shared_data": { Type: schema.TypeList, Computed: true, Description: "Information about the Target used by the templates originating from IBM Cloud catalog offerings. This information is not relevant when you create a workspace from your own Terraform template.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cluster_id": &schema.Schema{ + "cluster_id": { Type: schema.TypeString, Computed: true, Description: "The ID of the cluster where you want to provision the resources of all IBM Cloud catalog templates that are included in the catalog offering.", }, - "cluster_name": &schema.Schema{ + "cluster_name": { Type: schema.TypeString, Computed: true, Description: "Target cluster name.", }, - "entitlement_keys": &schema.Schema{ + "entitlement_keys": { Type: schema.TypeList, Computed: true, Description: "The entitlement key that you want to use to install IBM Cloud entitled software.", @@ -205,17 +207,17 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { Type: schema.TypeMap, }, }, - "namespace": &schema.Schema{ + "namespace": { Type: schema.TypeString, Computed: true, Description: "The Kubernetes namespace or OpenShift project where the resources of all IBM Cloud catalog templates that are included in the catalog offering are deployed into.", }, - "region": &schema.Schema{ + "region": { Type: schema.TypeString, Computed: true, Description: "The IBM Cloud region that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Computed: true, Description: "The ID of the resource group that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", @@ -223,12 +225,12 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the workspace. **Active**: After you successfully ran your infrastructure code by applying your Terraform execution plan, the state of your workspace changes to `Active`. **Connecting**: Schematics tries to connect to the template in your source repo. If successfully connected, the template is downloaded and metadata, such as input parameters, is extracted. After the template is downloaded, the state of the workspace changes to `Scanning`. **Draft**: The workspace is created without a reference to a GitHub or GitLab repository. **Failed**: If errors occur during the execution of your infrastructure code in IBM Cloud Schematics, your workspace status is set to `Failed`. **Inactive**: The Terraform template was scanned successfully and the workspace creation is complete. You can now start running Schematics plan and apply jobs to provision the IBM Cloud resources that you specified in your template. If you have an `Active` workspace and decide to remove all your resources, your workspace is set to `Inactive` after all your resources are removed. **In progress**: When you instruct IBM Cloud Schematics to run your infrastructure code by applying your Terraform execution plan, the status of our workspace changes to `In progress`. **Scanning**: The download of the Terraform template is complete and vulnerability scanning started. If the scan is successful, the workspace state changes to `Inactive`. If errors in your template are found, the state changes to `Template Error`. **Stopped**: The Schematics plan, apply, or destroy job was cancelled manually. **Template Error**: The Schematics template contains errors and cannot be processed.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Computed: true, Description: "A list of tags that are associated with the workspace.", @@ -236,28 +238,28 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { Type: schema.TypeString, }, }, - "template_env_settings": &schema.Schema{ + "template_env_settings": { Type: schema.TypeList, Computed: true, Description: "List of environment values.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](/docs/schematics?topic=schematics-create-tf-config#declare-variable).", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "If set to `true`, the value of your input variable is protected and not returned in your API response.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Computed: true, Description: "If set to `true`, the value of your input variable is protected and not returned in your API response.", @@ -265,65 +267,65 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "template_git_folder": &schema.Schema{ + "template_git_folder": { Type: schema.TypeString, Computed: true, Description: "The subfolder in your GitHub or GitLab repository where your Terraform template is stored. If your template is stored in the root directory, `.` is returned.", }, - "template_init_state_file": &schema.Schema{ + "template_init_state_file": { Type: schema.TypeString, Computed: true, Description: "Init state file.", }, - "template_type": &schema.Schema{ + "template_type": { Type: schema.TypeString, Computed: true, Description: "The Terraform version that was used to run your Terraform code.", }, - "template_uninstall_script_name": &schema.Schema{ + "template_uninstall_script_name": { Type: schema.TypeString, Computed: true, Description: "Uninstall script name.", }, - "template_values": &schema.Schema{ + "template_values": { Type: schema.TypeString, Computed: true, Description: "A list of variable values that you want to apply during the Helm chart installation. The list must be provided in JSON format, such as `\"\"autoscaling: enabled: true minReplicas: 2\"`. The values that you define here override the default Helm chart values. This field is supported only for IBM Cloud catalog offerings that are provisioned by using the Terraform Helm provider.", }, - "template_values_metadata": &schema.Schema{ + "template_values_metadata": { Type: schema.TypeList, Optional: true, Computed: true, Description: "A list of input variables that are associated with the workspace.", Elem: &schema.Schema{Type: schema.TypeMap}, }, - "template_inputs": &schema.Schema{ + "template_inputs": { Type: schema.TypeList, Computed: true, Description: "Information about the input variables that your template uses.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of your input variable.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The name of the variable.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Computed: true, Description: "If set to `true`, the value of your input variable is protected and not returned in your API response.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "`Terraform v0.11` supports `string`, `list`, `map` data type. For more information, about the syntax, see [Configuring input variables](https://www.terraform.io/docs/configuration-0-11/variables.html).
`Terraform v0.12` additionally, supports `bool`, `number` and complex data types such as `list(type)`, `map(type)`,`object({attribute name=type,..})`, `set(type)`, `tuple([type])`. For more information, about the syntax to use the complex data type, see [Configuring variables](https://www.terraform.io/docs/configuration/variables.html#type-constraints).", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](https://cloud.ibm.com/docs/schematics?topic=schematics-create-tf-config#declare-variable).", @@ -331,60 +333,60 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "template_ref": &schema.Schema{ + "template_ref": { Type: schema.TypeString, Computed: true, Description: "Workspace template ref.", }, - "template_git_branch": &schema.Schema{ + "template_git_branch": { Type: schema.TypeString, Computed: true, Description: "The repository branch.", }, - "template_git_full_url": &schema.Schema{ + "template_git_full_url": { Type: schema.TypeString, Computed: true, Description: "Full repository URL.", }, - "template_git_has_uploadedgitrepotar": &schema.Schema{ + "template_git_has_uploadedgitrepotar": { Type: schema.TypeBool, Optional: true, Computed: true, Description: "Has uploaded Git repository tar.", }, - "template_git_release": &schema.Schema{ + "template_git_release": { Type: schema.TypeString, Computed: true, Description: "The repository release.", }, - "template_git_repo_sha_value": &schema.Schema{ + "template_git_repo_sha_value": { Type: schema.TypeString, Computed: true, Description: "The repository SHA value.", }, - "template_git_repo_url": &schema.Schema{ + "template_git_repo_url": { Type: schema.TypeString, Computed: true, Description: "The repository URL.", }, - "template_git_url": &schema.Schema{ + "template_git_url": { Type: schema.TypeString, Computed: true, Description: "The source URL.", }, - /*"template_type": &schema.Schema{ + /*"template_type": { Type: schema.TypeList, Optional: true, Description: "List of Workspace type.", Elem: &schema.Schema{Type: schema.TypeString}, },*/ - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the workspace was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The user ID that updated the workspace.", @@ -394,53 +396,53 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { Computed: true, Deprecated: "use frozen instead", }, - "frozen": &schema.Schema{ + "frozen": { Type: schema.TypeBool, Computed: true, Description: "If set to true, the workspace is frozen and changes to the workspace are disabled.", }, - "frozen_at": &schema.Schema{ + "frozen_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the workspace was frozen.", }, - "frozen_by": &schema.Schema{ + "frozen_by": { Type: schema.TypeString, Computed: true, Description: "The user ID that froze the workspace.", }, - "is_locked": &schema.Schema{ + "is_locked": { Type: schema.TypeBool, Computed: true, Description: "If set to true, the workspace is locked and disabled for changes.", Deprecated: "Use locked instead", }, - "locked": &schema.Schema{ + "locked": { Type: schema.TypeBool, Computed: true, Description: "If set to true, the workspace is locked and disabled for changes.", }, - "locked_by": &schema.Schema{ + "locked_by": { Type: schema.TypeString, Computed: true, Description: "The user ID that initiated a resource-related job, such as applying or destroying resources, that locked the workspace.", }, - "locked_time": &schema.Schema{ + "locked_time": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the workspace was locked.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "The success or error code that was returned for the last plan, apply, or destroy job that ran against your workspace.", }, - "status_msg": &schema.Schema{ + "status_msg": { Type: schema.TypeString, Computed: true, Description: "The success or error message that was returned for the last plan, apply, or destroy job that ran against your workspace.", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this workspace", @@ -450,7 +452,7 @@ func dataSourceIBMSchematicsWorkspace() *schema.Resource { } func dataSourceIBMSchematicsWorkspaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -465,165 +467,165 @@ func dataSourceIBMSchematicsWorkspaceRead(context context.Context, d *schema.Res return diag.FromErr(fmt.Errorf("GetWorkspaceWithContext failed %s\n%s", err, response)) } - d.SetId(fmt.Sprintf("%s", *getWorkspaceOptions.WID)) + d.SetId(*getWorkspaceOptions.WID) if workspaceResponse.CatalogRef != nil { err = d.Set("catalog_ref", dataSourceWorkspaceResponseFlattenCatalogRef(*workspaceResponse.CatalogRef)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_ref %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_ref %s", err)) } } - if err = d.Set("created_at", dateTimeToString(workspaceResponse.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(workspaceResponse.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", workspaceResponse.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if err = d.Set("crn", workspaceResponse.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("description", workspaceResponse.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } - if err = d.Set("last_health_check_at", dateTimeToString(workspaceResponse.LastHealthCheckAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting last_health_check_at: %s", err)) + if err = d.Set("last_health_check_at", flex.DateTimeToString(workspaceResponse.LastHealthCheckAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting last_health_check_at: %s", err)) } if err = d.Set("location", workspaceResponse.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("name", workspaceResponse.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("resource_group", workspaceResponse.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } if workspaceResponse.RuntimeData != nil { err = d.Set("runtime_data", dataSourceWorkspaceResponseFlattenRuntimeData(workspaceResponse.RuntimeData)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting runtime_data %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting runtime_data %s", err)) } } if workspaceResponse.SharedData != nil { err = d.Set("shared_data", dataSourceWorkspaceResponseFlattenSharedData(*workspaceResponse.SharedData)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting shared_data %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting shared_data %s", err)) } } if err = d.Set("status", workspaceResponse.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if workspaceResponse.TemplateData != nil { templateData := dataSourceWorkspaceResponseFlattenTemplateData(workspaceResponse.TemplateData) if err = d.Set("template_env_settings", templateData[0]["env_values"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading env_values: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading env_values: %s", err)) } if err = d.Set("template_git_folder", templateData[0]["folder"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading folder: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading folder: %s", err)) } if err = d.Set("template_init_state_file", templateData[0]["init_state_file"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading init_state_file: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading init_state_file: %s", err)) } if err = d.Set("template_type", templateData[0]["type"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading type: %s", err)) } if err = d.Set("template_uninstall_script_name", templateData[0]["uninstall_script_name"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading uninstall_script_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading uninstall_script_name: %s", err)) } if err = d.Set("template_values", templateData[0]["values"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading values: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading values: %s", err)) } if err = d.Set("template_values_metadata", templateData[0]["values_metadata"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading values_metadata: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading values_metadata: %s", err)) } if err = d.Set("template_inputs", templateData[0]["variablestore"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading variablestore: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading variablestore: %s", err)) } } if err = d.Set("template_ref", workspaceResponse.TemplateRef); err != nil { - return diag.FromErr(fmt.Errorf("Error setting template_ref: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting template_ref: %s", err)) } if workspaceResponse.TemplateRepo != nil { templateRepoMap := dataSourceWorkspaceResponseFlattenTemplateRepo(*workspaceResponse.TemplateRepo) if err = d.Set("template_git_branch", templateRepoMap[0]["branch"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading branch: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading branch: %s", err)) } if err = d.Set("template_git_release", templateRepoMap[0]["release"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading release: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading release: %s", err)) } if err = d.Set("template_git_repo_sha_value", templateRepoMap[0]["repo_sha_value"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading repo_sha_value: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading repo_sha_value: %s", err)) } if err = d.Set("template_git_repo_url", templateRepoMap[0]["repo_url"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading repo_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading repo_url: %s", err)) } if err = d.Set("template_git_url", templateRepoMap[0]["url"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading url: %s", err)) } if err = d.Set("template_git_has_uploadedgitrepotar", templateRepoMap[0]["has_uploadedgitrepotar"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading has_uploadedgitrepotar: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading has_uploadedgitrepotar: %s", err)) } } /*if err = d.Set("type", workspaceResponse.Type); err != nil { - return fmt.Errorf("Error setting type: %s", err) + return fmt.Errorf("[ERROR] Error setting type: %s", err) }*/ if workspaceResponse.UpdatedAt != nil { if err = d.Set("updated_at", workspaceResponse.UpdatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } } if err = d.Set("updated_by", workspaceResponse.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } if workspaceResponse.WorkspaceStatus != nil { workspaceStatusMap := dataSourceWorkspaceResponseFlattenWorkspaceStatus(*workspaceResponse.WorkspaceStatus) if err = d.Set("is_frozen", workspaceStatusMap[0]["frozen"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen: %s", err)) } if err = d.Set("frozen", workspaceStatusMap[0]["frozen"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen: %s", err)) } if err = d.Set("frozen_at", workspaceStatusMap[0]["frozen_at"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen_at: %s", err)) } if err = d.Set("frozen_by", workspaceStatusMap[0]["frozen_by"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen_by: %s", err)) } if err = d.Set("is_locked", workspaceStatusMap[0]["locked"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked: %s", err)) } if err = d.Set("locked", workspaceStatusMap[0]["locked"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked: %s", err)) } if err = d.Set("locked_by", workspaceStatusMap[0]["locked_by"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked_by: %s", err)) } if err = d.Set("locked_time", workspaceStatusMap[0]["locked_time"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked_time: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked_time: %s", err)) } } if workspaceResponse.WorkspaceStatusMsg != nil { workspaceStatusMsgMap := dataSourceWorkspaceResponseFlattenWorkspaceStatusMsg(*workspaceResponse.WorkspaceStatusMsg) if err = d.Set("status_code", workspaceStatusMsgMap[0]["status_code"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading status_code: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading status_code: %s", err)) } if err = d.Set("status_msg", workspaceStatusMsgMap[0]["status_msg"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading status_msg: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading status_msg: %s", err)) } } - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return diag.FromErr(err) } - d.Set(ResourceControllerURL, controller+"/schematics") + d.Set(flex.ResourceControllerURL, controller+"/schematics") return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_action.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_action.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_action.go index 4da3c26e32..54b0c9beb2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_action.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/go-openapi/strfmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -21,7 +24,7 @@ const ( actionName = "name" ) -func resourceIBMSchematicsAction() *schema.Resource { +func ResourceIBMSchematicsAction() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSchematicsActionCreate, ReadContext: resourceIBMSchematicsActionRead, @@ -30,53 +33,53 @@ func resourceIBMSchematicsAction() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The unique name of your action. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. **Example** you can use the name to stop action.", - ValidateFunc: InvokeValidator("ibm_schematics_action", actionName), + ValidateFunc: validate.InvokeValidator("ibm_schematics_action", actionName), }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Action description.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_schematics_action", "location"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_action", "location"), Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Optional: true, Description: "Resource-group name for an action. By default, action is created in default resource group.", }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, Description: "Action tags.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "user_state": &schema.Schema{ + "user_state": { Type: schema.TypeList, Optional: true, Computed: true, Description: "User defined status of the Schematics object.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Optional: true, Description: "User-defined states * `draft` Object can be modified; can be used by Jobs run by the author, during execution * `live` Object can be modified; can be used by Jobs during execution * `locked` Object cannot be modified; can be used by Jobs during execution * `disable` Object can be modified. cannot be used by Jobs during execution.", }, - "set_by": &schema.Schema{ + "set_by": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Name of the User who set the state of the Object.", }, - "set_at": &schema.Schema{ + "set_at": { Type: schema.TypeString, Optional: true, Computed: true, @@ -85,55 +88,55 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "source_readme_url": &schema.Schema{ + "source_readme_url": { Type: schema.TypeString, Optional: true, Description: "URL of the `README` file, for the source URL.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeList, Optional: true, Description: "Source of templates, playbooks, or controls.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Required: true, Description: "Type of source for the Template.", }, - "git": &schema.Schema{ + "git": { Type: schema.TypeList, Optional: true, Description: "Connection details to Git source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "computed_git_repo_url": &schema.Schema{ + "computed_git_repo_url": { Type: schema.TypeString, Optional: true, Description: "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", }, - "git_repo_url": &schema.Schema{ + "git_repo_url": { Type: schema.TypeString, Optional: true, Description: "URL to the GIT Repo that can be used to clone the template.", ValidateFunc: validation.IsURLWithHTTPorHTTPS, }, - "git_token": &schema.Schema{ + "git_token": { Type: schema.TypeString, Optional: true, Description: "Personal Access Token to connect to Git URLs.", }, - "git_repo_folder": &schema.Schema{ + "git_repo_folder": { Type: schema.TypeString, Optional: true, Description: "Name of the folder in the Git Repo, that contains the template.", }, - "git_release": &schema.Schema{ + "git_release": { Type: schema.TypeString, Optional: true, Description: "Name of the release tag, used to fetch the Git Repo.", }, - "git_branch": &schema.Schema{ + "git_branch": { Type: schema.TypeString, Optional: true, Description: "Name of the branch, used to fetch the Git Repo.", @@ -141,44 +144,44 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "catalog": &schema.Schema{ + "catalog": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Connection details to IBM Cloud Catalog source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "catalog_name": &schema.Schema{ + "catalog_name": { Type: schema.TypeString, Optional: true, Description: "name of the private catalog.", }, - "offering_name": &schema.Schema{ + "offering_name": { Type: schema.TypeString, Optional: true, Description: "Name of the offering in the IBM Catalog.", }, - "offering_version": &schema.Schema{ + "offering_version": { Type: schema.TypeString, Optional: true, Description: "Version string of the offering in the IBM Catalog.", }, - "offering_kind": &schema.Schema{ + "offering_kind": { Type: schema.TypeString, Optional: true, Description: "Type of the offering, in the IBM Catalog.", }, - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Optional: true, Description: "Id of the offering the IBM Catalog.", }, - "offering_version_id": &schema.Schema{ + "offering_version_id": { Type: schema.TypeString, Optional: true, Description: "Id of the offering version the IBM Catalog.", }, - "offering_repo_url": &schema.Schema{ + "offering_repo_url": { Type: schema.TypeString, Optional: true, Description: "Repo Url of the offering, in the IBM Catalog.", @@ -186,14 +189,14 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "cos_bucket": &schema.Schema{ + "cos_bucket": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Connection details to a IBM Cloud Object Storage bucket.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cos_bucket_url": &schema.Schema{ + "cos_bucket_url": { Type: schema.TypeString, Optional: true, Description: "COS Bucket Url.", @@ -204,123 +207,123 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_schematics_action", "source_type"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_action", "source_type"), Description: "Type of source for the Template.", }, - "command_parameter": &schema.Schema{ + "command_parameter": { Type: schema.TypeString, Optional: true, Description: "Schematics job command parameter (playbook-name).", }, - "inventory": &schema.Schema{ + "inventory": { Type: schema.TypeString, Optional: true, Description: "Target inventory record ID, used by the action or ansible playbook.", }, - "credentials": &schema.Schema{ + "credentials": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "credentials of the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -328,7 +331,7 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -337,19 +340,19 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "bastion": &schema.Schema{ + "bastion": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Describes a bastion resource.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Bastion Name(Unique).", }, - "host": &schema.Schema{ + "host": { Type: schema.TypeString, Optional: true, Description: "Reference to the Inventory resource definition.", @@ -357,107 +360,107 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "bastion_credential": &schema.Schema{ + "bastion_credential": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable variable data & system generated reference to value.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -465,7 +468,7 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -474,111 +477,111 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "targets_ini": &schema.Schema{ + "targets_ini": { Type: schema.TypeString, Optional: true, Description: "Inventory of host and host group for the playbook in `INI` file format. For example, `\"targets_ini\": \"[webserverhost] 172.22.192.6 [dbhost] 172.22.192.5\"`. For more information, about an inventory host group syntax, see [Inventory host groups](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-inventory-host-grps).", }, - "action_inputs": &schema.Schema{ + "action_inputs": { Type: schema.TypeList, Optional: true, Description: "Input variables for the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -586,7 +589,7 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -595,106 +598,106 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "action_outputs": &schema.Schema{ + "action_outputs": { Type: schema.TypeList, Optional: true, Description: "Output variables for the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -702,7 +705,7 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -711,106 +714,106 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Optional: true, Description: "Environment variables for the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -818,7 +821,7 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -827,23 +830,23 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "state": &schema.Schema{ + "state": { Type: schema.TypeList, Computed: true, Description: "Computed state of the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of automation (workspace or action).", }, - "status_job_id": &schema.Schema{ + "status_job_id": { Type: schema.TypeString, Optional: true, Description: "Job id reference for this status.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "Automation status message - to be displayed along with the status_code.", @@ -851,24 +854,24 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "sys_lock": &schema.Schema{ + "sys_lock": { Type: schema.TypeList, Optional: true, Computed: true, Description: "System lock status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "sys_locked": &schema.Schema{ + "sys_locked": { Type: schema.TypeBool, Optional: true, Description: "Is the automation locked by a Schematic job ?.", }, - "sys_locked_by": &schema.Schema{ + "sys_locked_by": { Type: schema.TypeString, Optional: true, Description: "Name of the User who performed the job, that lead to the locking of the automation.", }, - "sys_locked_at": &schema.Schema{ + "sys_locked_at": { Type: schema.TypeString, Optional: true, Description: "When the User performed the job that lead to locking of the automation ?.", @@ -876,62 +879,62 @@ func resourceIBMSchematicsAction() *schema.Resource { }, }, }, - "x_github_token": &schema.Schema{ + "x_github_token": { Type: schema.TypeString, Optional: true, Description: "The personal access token to authenticate with your private GitHub or GitLab repository and access your Terraform template.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "Action Cloud Resource Name.", }, - "account": &schema.Schema{ + "account": { Type: schema.TypeString, Computed: true, Description: "Action account ID.", }, - "source_created_at": &schema.Schema{ + "source_created_at": { Type: schema.TypeString, Computed: true, Description: "Action Playbook Source creation time.", }, - "source_created_by": &schema.Schema{ + "source_created_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of user who created the Action Playbook Source.", }, - "source_updated_at": &schema.Schema{ + "source_updated_at": { Type: schema.TypeString, Computed: true, Description: "The action playbook updation time.", }, - "source_updated_by": &schema.Schema{ + "source_updated_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of user who updated the action playbook source.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Action creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of the user who created an action.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Action updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "E-mail address of the user who updated an action.", }, - "playbook_names": &schema.Schema{ + "playbook_names": { Type: schema.TypeList, Computed: true, Description: "Playbook names retrieved from the respository.", @@ -941,38 +944,38 @@ func resourceIBMSchematicsAction() *schema.Resource { } } -func resourceIBMSchematicsActionValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMSchematicsActionValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "location", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "eu-de, eu-gb, us-east, us-south", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "source_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "cos_bucket, external_scm, git_hub, git_hub_enterprise, git_lab, ibm_cloud_catalog, ibm_git_lab, local", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: actionName, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, MinValueLength: 1, MaxValueLength: 65, Optional: true, }) - resourceValidator := ResourceValidator{ResourceName: "ibm_schematics_action", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_schematics_action", Schema: validateSchema} return &resourceValidator } func resourceIBMSchematicsActionCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -992,7 +995,7 @@ func resourceIBMSchematicsActionCreate(context context.Context, d *schema.Resour createActionOptions.SetResourceGroup(d.Get("resource_group").(string)) } if _, ok := d.GetOk("tags"); ok { - createActionOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) + createActionOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) } if _, ok := d.GetOk("user_state"); ok { userState := resourceIBMSchematicsActionMapToUserState(d.Get("user_state.0").(map[string]interface{})) @@ -1311,7 +1314,7 @@ func resourceIBMSchematicsActionMapToSystemLock(systemLockMap map[string]interfa } func resourceIBMSchematicsActionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -1331,47 +1334,47 @@ func resourceIBMSchematicsActionRead(context context.Context, d *schema.Resource } if err = d.Set("name", action.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", action.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("location", action.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("resource_group", action.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } if action.Tags != nil { if err = d.Set("tags", action.Tags); err != nil { - return diag.FromErr(fmt.Errorf("Error setting tags: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting tags: %s", err)) } } if action.UserState != nil { userStateMap := resourceIBMSchematicsActionUserStateToMap(*action.UserState) if err = d.Set("user_state", []map[string]interface{}{userStateMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting user_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting user_state: %s", err)) } } if err = d.Set("source_readme_url", action.SourceReadmeURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_readme_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_readme_url: %s", err)) } if _, ok := d.GetOk("source"); ok { if action.Source != nil { sourceMap := resourceIBMSchematicsActionExternalSourceToMap(*action.Source) if err = d.Set("source", []map[string]interface{}{sourceMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source: %s", err)) } } } if err = d.Set("source_type", action.SourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_type: %s", err)) } if err = d.Set("command_parameter", action.CommandParameter); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_parameter: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_parameter: %s", err)) } if err = d.Set("inventory", action.Inventory); err != nil { - return diag.FromErr(fmt.Errorf("Error setting inventory: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting inventory: %s", err)) } if action.Credentials != nil { credentials := []map[string]interface{}{} @@ -1380,25 +1383,25 @@ func resourceIBMSchematicsActionRead(context context.Context, d *schema.Resource credentials = append(credentials, credentialsItemMap) } if err = d.Set("credentials", credentials); err != nil { - return diag.FromErr(fmt.Errorf("Error setting credentials: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting credentials: %s", err)) } } if _, ok := d.GetOk("bastion"); ok { if action.Bastion != nil { bastionMap := resourceIBMSchematicsActionBastionResourceDefinitionToMap(*action.Bastion) if err = d.Set("bastion", []map[string]interface{}{bastionMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting bastion: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting bastion: %s", err)) } } } if action.BastionCredential != nil { bastionCredentialMap := resourceIBMSchematicsActionVariableDataToMap(*action.BastionCredential) if err = d.Set("bastion_credential", []map[string]interface{}{bastionCredentialMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting bastion_credential: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting bastion_credential: %s", err)) } } if err = d.Set("targets_ini", action.TargetsIni); err != nil { - return diag.FromErr(fmt.Errorf("Error setting targets_ini: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting targets_ini: %s", err)) } if action.Inputs != nil { actionInputs := []map[string]interface{}{} @@ -1407,7 +1410,7 @@ func resourceIBMSchematicsActionRead(context context.Context, d *schema.Resource actionInputs = append(actionInputs, actionInputsItemMap) } if err = d.Set("action_inputs", actionInputs); err != nil { - return diag.FromErr(fmt.Errorf("Error setting action_inputs: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting action_inputs: %s", err)) } } if action.Outputs != nil { @@ -1417,7 +1420,7 @@ func resourceIBMSchematicsActionRead(context context.Context, d *schema.Resource actionOutputs = append(actionOutputs, actionOutputsItemMap) } if err = d.Set("action_outputs", actionOutputs); err != nil { - return diag.FromErr(fmt.Errorf("Error setting action_outputs: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting action_outputs: %s", err)) } } if action.Settings != nil { @@ -1427,54 +1430,54 @@ func resourceIBMSchematicsActionRead(context context.Context, d *schema.Resource settings = append(settings, settingsItemMap) } if err = d.Set("settings", settings); err != nil { - return diag.FromErr(fmt.Errorf("Error setting settings: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting settings: %s", err)) } } if action.State != nil { stateMap := resourceIBMSchematicsActionActionStateToMap(*action.State) if err = d.Set("state", []map[string]interface{}{stateMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state: %s", err)) } } if action.SysLock != nil { sysLockMap := resourceIBMSchematicsActionSystemLockToMap(*action.SysLock) if err = d.Set("sys_lock", []map[string]interface{}{sysLockMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting sys_lock: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting sys_lock: %s", err)) } } if err = d.Set("crn", action.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("account", action.Account); err != nil { - return diag.FromErr(fmt.Errorf("Error setting account: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting account: %s", err)) } - if err = d.Set("source_created_at", dateTimeToString(action.SourceCreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_created_at: %s", err)) + if err = d.Set("source_created_at", flex.DateTimeToString(action.SourceCreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_created_at: %s", err)) } if err = d.Set("source_created_by", action.SourceCreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_created_by: %s", err)) } - if err = d.Set("source_updated_at", dateTimeToString(action.SourceUpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_updated_at: %s", err)) + if err = d.Set("source_updated_at", flex.DateTimeToString(action.SourceUpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_updated_at: %s", err)) } if err = d.Set("source_updated_by", action.SourceUpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source_updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting source_updated_by: %s", err)) } - if err = d.Set("created_at", dateTimeToString(action.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(action.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", action.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(action.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(action.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", action.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } if action.PlaybookNames != nil && len(action.PlaybookNames) > 0 { if err = d.Set("playbook_names", action.PlaybookNames); err != nil { - return diag.FromErr(fmt.Errorf("Error setting playbook_names: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting playbook_names: %s", err)) } } else { d.Set("playbook_names", []string{}) @@ -1630,22 +1633,22 @@ func resourceIBMSchematicsActionVariableMetadataToMap(variableMetadata schematic variableMetadataMap["options"] = variableMetadata.Options } if variableMetadata.MinValue != nil { - variableMetadataMap["min_value"] = intValue(variableMetadata.MinValue) + variableMetadataMap["min_value"] = flex.IntValue(variableMetadata.MinValue) } if variableMetadata.MaxValue != nil { - variableMetadataMap["max_value"] = intValue(variableMetadata.MaxValue) + variableMetadataMap["max_value"] = flex.IntValue(variableMetadata.MaxValue) } if variableMetadata.MinLength != nil { - variableMetadataMap["min_length"] = intValue(variableMetadata.MinLength) + variableMetadataMap["min_length"] = flex.IntValue(variableMetadata.MinLength) } if variableMetadata.MaxLength != nil { - variableMetadataMap["max_length"] = intValue(variableMetadata.MaxLength) + variableMetadataMap["max_length"] = flex.IntValue(variableMetadata.MaxLength) } if variableMetadata.Matches != nil { variableMetadataMap["matches"] = variableMetadata.Matches } if variableMetadata.Position != nil { - variableMetadataMap["position"] = intValue(variableMetadata.Position) + variableMetadataMap["position"] = flex.IntValue(variableMetadata.Position) } if variableMetadata.GroupBy != nil { variableMetadataMap["group_by"] = variableMetadata.GroupBy @@ -1703,7 +1706,7 @@ func resourceIBMSchematicsActionSystemLockToMap(systemLock schematicsv1.SystemLo } func resourceIBMSchematicsActionUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -1731,7 +1734,7 @@ func resourceIBMSchematicsActionUpdate(context context.Context, d *schema.Resour hasChange = true } if d.HasChange("tags") { - updateActionOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) + updateActionOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) hasChange = true } if d.HasChange("user_state") { @@ -1850,7 +1853,7 @@ func resourceIBMSchematicsActionUpdate(context context.Context, d *schema.Resour } func resourceIBMSchematicsActionDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_inventory.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_inventory.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_inventory.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_inventory.go index 3c47cc9007..6fa3ebd080 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_inventory.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_inventory.go @@ -1,20 +1,23 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func resourceIBMSchematicsInventory() *schema.Resource { +func ResourceIBMSchematicsInventory() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSchematicsInventoryCreate, ReadContext: resourceIBMSchematicsInventoryRead, @@ -23,55 +26,55 @@ func resourceIBMSchematicsInventory() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_schematics_inventory", "name"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_inventory", "name"), Description: "The unique name of your Inventory definition. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "The description of your Inventory definition. The description can be up to 2048 characters long in size.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_schematics_inventory", "location"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_inventory", "location"), Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Optional: true, Description: "Resource-group name for the Inventory definition. By default, Inventory definition will be created in Default Resource Group.", }, - "inventories_ini": &schema.Schema{ + "inventories_ini": { Type: schema.TypeString, Optional: true, Description: "Input inventory of host and host group for the playbook, in the `.ini` file format.", }, - "resource_queries": &schema.Schema{ + "resource_queries": { Type: schema.TypeList, Optional: true, Description: "Input resource query definitions that is used to dynamically generate the inventory of host and host group for the playbook.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Inventory creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who created the Inventory.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Inventory updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who updated the Inventory.", @@ -80,32 +83,32 @@ func resourceIBMSchematicsInventory() *schema.Resource { } } -func resourceIBMSchematicsInventoryValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSchematicsInventoryValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, Optional: true, MinValueLength: 3, MaxValueLength: 64, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "location", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "eu-de, eu-gb, us-east, us-south", }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_schematics_inventory", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_schematics_inventory", Schema: validateSchema} return &resourceValidator } func resourceIBMSchematicsInventoryCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -128,7 +131,7 @@ func resourceIBMSchematicsInventoryCreate(context context.Context, d *schema.Res createInventoryOptions.SetInventoriesIni(d.Get("inventories_ini").(string)) } if _, ok := d.GetOk("resource_queries"); ok { - createInventoryOptions.SetResourceQueries(expandStringList(d.Get("resource_queries").([]interface{}))) + createInventoryOptions.SetResourceQueries(flex.ExpandStringList(d.Get("resource_queries").([]interface{}))) } inventoryResourceRecord, response, err := schematicsClient.CreateInventoryWithContext(context, createInventoryOptions) @@ -143,7 +146,7 @@ func resourceIBMSchematicsInventoryCreate(context context.Context, d *schema.Res } func resourceIBMSchematicsInventoryRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -163,43 +166,43 @@ func resourceIBMSchematicsInventoryRead(context context.Context, d *schema.Resou } if err = d.Set("name", inventoryResourceRecord.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", inventoryResourceRecord.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("location", inventoryResourceRecord.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("resource_group", inventoryResourceRecord.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } if err = d.Set("inventories_ini", inventoryResourceRecord.InventoriesIni); err != nil { - return diag.FromErr(fmt.Errorf("Error setting inventories_ini: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting inventories_ini: %s", err)) } if inventoryResourceRecord.ResourceQueries != nil { if err = d.Set("resource_queries", inventoryResourceRecord.ResourceQueries); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_queries: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_queries: %s", err)) } } - if err = d.Set("created_at", dateTimeToString(inventoryResourceRecord.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(inventoryResourceRecord.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", inventoryResourceRecord.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(inventoryResourceRecord.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(inventoryResourceRecord.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", inventoryResourceRecord.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } return nil } func resourceIBMSchematicsInventoryUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -252,7 +255,7 @@ func resourceIBMSchematicsInventoryUpdate(context context.Context, d *schema.Res } func resourceIBMSchematicsInventoryDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_job.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_job.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_job.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_job.go index 0b4790948f..a57aeea7cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_job.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_job.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/go-openapi/strfmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -16,7 +19,7 @@ import ( "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func resourceIBMSchematicsJob() *schema.Resource { +func ResourceIBMSchematicsJob() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSchematicsJobCreate, ReadContext: resourceIBMSchematicsJobRead, @@ -25,134 +28,134 @@ func resourceIBMSchematicsJob() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "command_object": &schema.Schema{ + "command_object": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_schematics_job", "command_object"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_job", "command_object"), Description: "Name of the Schematics automation resource.", }, - "command_object_id": &schema.Schema{ + "command_object_id": { Type: schema.TypeString, Required: true, Description: "Job command object id (workspace-id, action-id).", }, - "command_name": &schema.Schema{ + "command_name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_schematics_job", "command_name"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_job", "command_name"), Description: "Schematics job command name.", }, - "command_parameter": &schema.Schema{ + "command_parameter": { Type: schema.TypeString, Optional: true, Description: "Schematics job command parameter (playbook-name).", }, - "command_options": &schema.Schema{ + "command_options": { Type: schema.TypeList, Optional: true, Description: "Command line options for the command.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "job_inputs": &schema.Schema{ + "job_inputs": { Type: schema.TypeList, Optional: true, Description: "Job inputs used by Action or Workspace.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Required: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -160,7 +163,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -169,106 +172,106 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "job_env_settings": &schema.Schema{ + "job_env_settings": { Type: schema.TypeList, Optional: true, Description: "Environment variables used by the Job while performing Action or Workspace.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Required: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -276,7 +279,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -285,105 +288,105 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, Description: "User defined tags, while running the job.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_schematics_job", "location"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_job", "location"), Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeList, Computed: true, Description: "Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_job_status": &schema.Schema{ + "workspace_job_status": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Workspace Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Optional: true, Description: "Workspace name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "Workspace job status message (eg. App1_Setup_Pending, for a 'Setup' flow in the 'App1' Workspace).", }, - "flow_status": &schema.Schema{ + "flow_status": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Environment Flow JOB Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Optional: true, Description: "flow id.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Optional: true, Description: "flow name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "Flow Job status message - to be displayed along with the status_code;.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Optional: true, Description: "Environment's individual workItem status details;.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Optional: true, Description: "Workspace id.", }, - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Optional: true, Description: "workspace name.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Optional: true, Description: "workspace job id.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "workitem job status message;.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "workitem job status updation timestamp.", @@ -391,7 +394,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -399,38 +402,38 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "template_status": &schema.Schema{ + "template_status": { Type: schema.TypeList, Optional: true, Description: "Workspace Flow Template job status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "template_id": &schema.Schema{ + "template_id": { Type: schema.TypeString, Optional: true, Description: "Template Id.", }, - "template_name": &schema.Schema{ + "template_name": { Type: schema.TypeString, Optional: true, Description: "Template name.", }, - "flow_index": &schema.Schema{ + "flow_index": { Type: schema.TypeInt, Optional: true, Description: "Index of the template in the Flow.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "Template job status message (eg. VPCt1_Apply_Pending, for a 'VPCt1' Template).", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -438,7 +441,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -446,48 +449,48 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "action_job_status": &schema.Schema{ + "action_job_status": { Type: schema.TypeList, Optional: true, Description: "Action Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "action_name": &schema.Schema{ + "action_name": { Type: schema.TypeString, Optional: true, Description: "Action name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "Action Job status message - to be displayed along with the action_status_code.", }, - "bastion_status_code": &schema.Schema{ + "bastion_status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Resources.", }, - "bastion_status_message": &schema.Schema{ + "bastion_status_message": { Type: schema.TypeString, Optional: true, Description: "Bastion status message - to be displayed along with the bastion_status_code;.", }, - "targets_status_code": &schema.Schema{ + "targets_status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Resources.", }, - "targets_status_message": &schema.Schema{ + "targets_status_message": { Type: schema.TypeString, Optional: true, Description: "Aggregated status message for all target resources, to be displayed along with the targets_status_code;.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -495,45 +498,45 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "system_job_status": &schema.Schema{ + "system_job_status": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "System Job Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "system_status_message": &schema.Schema{ + "system_status_message": { Type: schema.TypeString, Optional: true, Description: "System job message.", }, - "system_status_code": &schema.Schema{ + "system_status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "schematics_resource_status": &schema.Schema{ + "schematics_resource_status": { Type: schema.TypeList, Optional: true, Description: "job staus for each schematics resource.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "system job status message.", }, - "schematics_resource_id": &schema.Schema{ + "schematics_resource_id": { Type: schema.TypeString, Optional: true, Description: "id for each resource which is targeted as a part of system job.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -541,7 +544,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -549,65 +552,65 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "flow_job_status": &schema.Schema{ + "flow_job_status": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Environment Flow JOB Status.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Optional: true, Description: "flow id.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Optional: true, Description: "flow name.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "Flow Job status message - to be displayed along with the status_code;.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Optional: true, Description: "Environment's individual workItem status details;.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Optional: true, Description: "Workspace id.", }, - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Optional: true, Description: "workspace name.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Optional: true, Description: "workspace job id.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", }, - "status_message": &schema.Schema{ + "status_message": { Type: schema.TypeString, Optional: true, Description: "workitem job status message;.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "workitem job status updation timestamp.", @@ -615,7 +618,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -626,140 +629,140 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "data": &schema.Schema{ + "data": { Type: schema.TypeList, Optional: true, Description: "Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "job_type": &schema.Schema{ + "job_type": { Type: schema.TypeString, Required: true, Description: "Type of Job.", }, - "workspace_job_data": &schema.Schema{ + "workspace_job_data": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Workspace Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_name": &schema.Schema{ + "workspace_name": { Type: schema.TypeString, Optional: true, Description: "Workspace name.", }, - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Optional: true, Description: "Flow Id.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Optional: true, Description: "Flow name.", }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Optional: true, Description: "Input variables data used by the Workspace Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -767,7 +770,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -776,107 +779,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Optional: true, Description: "Output variables data from the Workspace Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -884,7 +887,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -893,107 +896,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Optional: true, Description: "Environment variables used by all the templates in the Workspace.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1001,7 +1004,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1010,128 +1013,128 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "template_data": &schema.Schema{ + "template_data": { Type: schema.TypeList, Optional: true, Description: "Input / output data of the Template in the Workspace Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "template_id": &schema.Schema{ + "template_id": { Type: schema.TypeString, Optional: true, Description: "Template Id.", }, - "template_name": &schema.Schema{ + "template_name": { Type: schema.TypeString, Optional: true, Description: "Template name.", }, - "flow_index": &schema.Schema{ + "flow_index": { Type: schema.TypeInt, Optional: true, Description: "Index of the template in the Flow.", }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Optional: true, Description: "Job inputs used by the Templates.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1139,7 +1142,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1148,107 +1151,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Optional: true, Description: "Job output from the Templates.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1256,7 +1259,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1265,107 +1268,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Optional: true, Description: "Environment variables used by the template.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1373,7 +1376,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1382,7 +1385,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -1390,7 +1393,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -1398,117 +1401,117 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "action_job_data": &schema.Schema{ + "action_job_data": { Type: schema.TypeList, Optional: true, Description: "Action Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "action_name": &schema.Schema{ + "action_name": { Type: schema.TypeString, Optional: true, Description: "Flow name.", }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Optional: true, Description: "Input variables data used by the Action Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1516,7 +1519,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1525,106 +1528,106 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Optional: true, Description: "Output variables data from the Action Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1632,7 +1635,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1641,106 +1644,106 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Optional: true, Description: "Environment variables used by all the templates in the Action.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -1748,7 +1751,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -1757,74 +1760,74 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", }, - "inventory_record": &schema.Schema{ + "inventory_record": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Complete inventory resource details with user inputs and system generated data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Inventory id.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "The description of your Inventory. The description can be up to 2048 characters long in size.", }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Optional: true, Description: "List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Optional: true, Description: "Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Inventory creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Email address of user who created the Inventory.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Inventory updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Email address of user who updated the Inventory.", }, - "inventories_ini": &schema.Schema{ + "inventories_ini": { Type: schema.TypeString, Optional: true, Description: "Input inventory of host and host group for the playbook, in the .ini file format.", }, - "resource_queries": &schema.Schema{ + "resource_queries": { Type: schema.TypeList, Optional: true, Description: "Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook.", @@ -1833,7 +1836,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "materialized_inventory": &schema.Schema{ + "materialized_inventory": { Type: schema.TypeString, Optional: true, Description: "Materialized inventory details used by the Action Job, in .ini format.", @@ -1841,25 +1844,25 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "system_job_data": &schema.Schema{ + "system_job_data": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Controls Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "key_id": &schema.Schema{ + "key_id": { Type: schema.TypeString, Optional: true, Description: "Key ID for which key event is generated.", }, - "schematics_resource_id": &schema.Schema{ + "schematics_resource_id": { Type: schema.TypeList, Optional: true, Description: "List of the schematics resource id.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -1867,93 +1870,93 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "flow_job_data": &schema.Schema{ + "flow_job_data": { Type: schema.TypeList, Optional: true, Description: "Flow Job data.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "flow_id": &schema.Schema{ + "flow_id": { Type: schema.TypeString, Optional: true, Description: "Flow ID.", }, - "flow_name": &schema.Schema{ + "flow_name": { Type: schema.TypeString, Optional: true, Description: "Flow Name.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Optional: true, Description: "Job data used by each workitem Job.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "command_object_id": &schema.Schema{ + "command_object_id": { Type: schema.TypeString, Optional: true, Description: "command object id.", }, - "command_object_name": &schema.Schema{ + "command_object_name": { Type: schema.TypeString, Optional: true, Description: "command object name.", }, - "layers": &schema.Schema{ + "layers": { Type: schema.TypeString, Optional: true, Description: "layer name.", }, - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Optional: true, Description: "Type of source for the Template.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Source of templates, playbooks, or controls.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "source_type": &schema.Schema{ + "source_type": { Type: schema.TypeString, Required: true, Description: "Type of source for the Template.", }, - "git": &schema.Schema{ + "git": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Connection details to Git source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "computed_git_repo_url": &schema.Schema{ + "computed_git_repo_url": { Type: schema.TypeString, Optional: true, Description: "The Complete URL which is computed by git_repo_url, git_repo_folder and branch.", }, - "git_repo_url": &schema.Schema{ + "git_repo_url": { Type: schema.TypeString, Optional: true, Description: "URL to the GIT Repo that can be used to clone the template.", }, - "git_token": &schema.Schema{ + "git_token": { Type: schema.TypeString, Optional: true, Description: "Personal Access Token to connect to Git URLs.", }, - "git_repo_folder": &schema.Schema{ + "git_repo_folder": { Type: schema.TypeString, Optional: true, Description: "Name of the folder in the Git Repo, that contains the template.", }, - "git_release": &schema.Schema{ + "git_release": { Type: schema.TypeString, Optional: true, Description: "Name of the release tag, used to fetch the Git Repo.", }, - "git_branch": &schema.Schema{ + "git_branch": { Type: schema.TypeString, Optional: true, Description: "Name of the branch, used to fetch the Git Repo.", @@ -1961,44 +1964,44 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "catalog": &schema.Schema{ + "catalog": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Connection details to IBM Cloud Catalog source.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "catalog_name": &schema.Schema{ + "catalog_name": { Type: schema.TypeString, Optional: true, Description: "name of the private catalog.", }, - "offering_name": &schema.Schema{ + "offering_name": { Type: schema.TypeString, Optional: true, Description: "Name of the offering in the IBM Catalog.", }, - "offering_version": &schema.Schema{ + "offering_version": { Type: schema.TypeString, Optional: true, Description: "Version string of the offering in the IBM Catalog.", }, - "offering_kind": &schema.Schema{ + "offering_kind": { Type: schema.TypeString, Optional: true, Description: "Type of the offering, in the IBM Catalog.", }, - "offering_id": &schema.Schema{ + "offering_id": { Type: schema.TypeString, Optional: true, Description: "Id of the offering the IBM Catalog.", }, - "offering_version_id": &schema.Schema{ + "offering_version_id": { Type: schema.TypeString, Optional: true, Description: "Id of the offering version the IBM Catalog.", }, - "offering_repo_url": &schema.Schema{ + "offering_repo_url": { Type: schema.TypeString, Optional: true, Description: "Repo Url of the offering, in the IBM Catalog.", @@ -2006,14 +2009,14 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "cos_bucket": &schema.Schema{ + "cos_bucket": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Connection details to a IBM Cloud Object Storage bucket.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cos_bucket_url": &schema.Schema{ + "cos_bucket_url": { Type: schema.TypeString, Optional: true, Description: "COS Bucket Url.", @@ -2024,107 +2027,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "inputs": &schema.Schema{ + "inputs": { Type: schema.TypeList, Optional: true, Description: "Input variables data for the workItem used in FlowJob.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -2132,7 +2135,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -2141,107 +2144,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "outputs": &schema.Schema{ + "outputs": { Type: schema.TypeList, Optional: true, Description: "Output variables for the workItem.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -2249,7 +2252,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -2258,107 +2261,107 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "settings": &schema.Schema{ + "settings": { Type: schema.TypeList, Optional: true, Description: "Environment variables for the workItem.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the variable.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value for the variable or reference to the value.", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "User editable metadata for the variables.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Description: "Type of the variable.", }, - "aliases": &schema.Schema{ + "aliases": { Type: schema.TypeList, Optional: true, Description: "List of aliases for the variable name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of the meta data.", }, - "default_value": &schema.Schema{ + "default_value": { Type: schema.TypeString, Optional: true, Description: "Default value for the variable, if the override value is not specified.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "Is the variable secure or sensitive ?.", }, - "immutable": &schema.Schema{ + "immutable": { Type: schema.TypeBool, Optional: true, Description: "Is the variable readonly ?.", }, - "hidden": &schema.Schema{ + "hidden": { Type: schema.TypeBool, Optional: true, Description: "If true, the variable will not be displayed on UI or CLI.", }, - "options": &schema.Schema{ + "options": { Type: schema.TypeList, Optional: true, Description: "List of possible values for this variable. If type is integer or date, then the array of string will be converted to array of integers or date during runtime.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "min_value": &schema.Schema{ + "min_value": { Type: schema.TypeInt, Optional: true, Description: "Minimum value of the variable. Applicable for integer type.", }, - "max_value": &schema.Schema{ + "max_value": { Type: schema.TypeInt, Optional: true, Description: "Maximum value of the variable. Applicable for integer type.", }, - "min_length": &schema.Schema{ + "min_length": { Type: schema.TypeInt, Optional: true, Description: "Minimum length of the variable value. Applicable for string type.", }, - "max_length": &schema.Schema{ + "max_length": { Type: schema.TypeInt, Optional: true, Description: "Maximum length of the variable value. Applicable for string type.", }, - "matches": &schema.Schema{ + "matches": { Type: schema.TypeString, Optional: true, Description: "Regex for the variable value.", }, - "position": &schema.Schema{ + "position": { Type: schema.TypeInt, Optional: true, Description: "Relative position of this variable in a list.", }, - "group_by": &schema.Schema{ + "group_by": { Type: schema.TypeString, Optional: true, Description: "Display name of the group this variable belongs to.", }, - "source": &schema.Schema{ + "source": { Type: schema.TypeString, Optional: true, Description: "Source of this meta-data.", @@ -2366,7 +2369,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "link": &schema.Schema{ + "link": { Type: schema.TypeString, Optional: true, Computed: true, @@ -2375,39 +2378,39 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "last_job": &schema.Schema{ + "last_job": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Status of the last job executed by the workitem.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "command_object": &schema.Schema{ + "command_object": { Type: schema.TypeString, Optional: true, Description: "Name of the Schematics automation resource.", }, - "command_object_name": &schema.Schema{ + "command_object_name": { Type: schema.TypeString, Optional: true, Description: "command object name (workspace_name/action_name).", }, - "command_object_id": &schema.Schema{ + "command_object_id": { Type: schema.TypeString, Optional: true, Description: "Workitem command object id, maps to workspace_id or action_id.", }, - "command_name": &schema.Schema{ + "command_name": { Type: schema.TypeString, Optional: true, Description: "Schematics job command name.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Optional: true, Description: "Workspace job id.", }, - "job_status": &schema.Schema{ + "job_status": { Type: schema.TypeString, Optional: true, Description: "Status of Jobs.", @@ -2415,7 +2418,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -2423,7 +2426,7 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Optional: true, Description: "Job status updation timestamp.", @@ -2434,19 +2437,19 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "bastion": &schema.Schema{ + "bastion": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Describes a bastion resource.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Bastion Name(Unique).", }, - "host": &schema.Schema{ + "host": { Type: schema.TypeString, Optional: true, Description: "Reference to the Inventory resource definition.", @@ -2454,60 +2457,60 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "log_summary": &schema.Schema{ + "log_summary": { Type: schema.TypeList, Optional: true, Computed: true, Description: "Job log summary record.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Workspace Id.", }, - "job_type": &schema.Schema{ + "job_type": { Type: schema.TypeString, Optional: true, Description: "Type of Job.", }, - "log_start_at": &schema.Schema{ + "log_start_at": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Job log start timestamp.", }, - "log_analyzed_till": &schema.Schema{ + "log_analyzed_till": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Job log update timestamp.", }, - "elapsed_time": &schema.Schema{ + "elapsed_time": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Job log elapsed time (log_analyzed_till - log_start_at).", }, - "log_errors": &schema.Schema{ + "log_errors": { Type: schema.TypeList, Optional: true, Computed: true, Description: "Job log errors.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "error_code": &schema.Schema{ + "error_code": { Type: schema.TypeString, Optional: true, Description: "Error code in the Log.", }, - "error_msg": &schema.Schema{ + "error_msg": { Type: schema.TypeString, Optional: true, Description: "Summary error message in the log.", }, - "error_count": &schema.Schema{ + "error_count": { Type: schema.TypeFloat, Optional: true, Description: "Number of occurrence.", @@ -2515,37 +2518,37 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "repo_download_job": &schema.Schema{ + "repo_download_job": { Type: schema.TypeList, Optional: true, Description: "Repo download Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "scanned_file_count": &schema.Schema{ + "scanned_file_count": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of files scanned.", }, - "quarantined_file_count": &schema.Schema{ + "quarantined_file_count": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of files quarantined.", }, - "detected_filetype": &schema.Schema{ + "detected_filetype": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Detected template or data file type.", }, - "inputs_count": &schema.Schema{ + "inputs_count": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Number of inputs detected.", }, - "outputs_count": &schema.Schema{ + "outputs_count": { Type: schema.TypeString, Optional: true, Computed: true, @@ -2554,26 +2557,26 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "workspace_job": &schema.Schema{ + "workspace_job": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Workspace Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "resources_add": &schema.Schema{ + "resources_add": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of resources add.", }, - "resources_modify": &schema.Schema{ + "resources_modify": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of resources modify.", }, - "resources_destroy": &schema.Schema{ + "resources_destroy": { Type: schema.TypeFloat, Optional: true, Computed: true, @@ -2582,65 +2585,65 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "flow_job": &schema.Schema{ + "flow_job": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Flow Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workitems_completed": &schema.Schema{ + "workitems_completed": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of workitems completed successfully.", }, - "workitems_pending": &schema.Schema{ + "workitems_pending": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of workitems pending in the flow.", }, - "workitems_failed": &schema.Schema{ + "workitems_failed": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of workitems failed.", }, - "workitems": &schema.Schema{ + "workitems": { Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "workspace_id": &schema.Schema{ + "workspace_id": { Type: schema.TypeString, Optional: true, Description: "workspace ID.", }, - "job_id": &schema.Schema{ + "job_id": { Type: schema.TypeString, Optional: true, Description: "workspace JOB ID.", }, - "resources_add": &schema.Schema{ + "resources_add": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of resources add.", }, - "resources_modify": &schema.Schema{ + "resources_modify": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of resources modify.", }, - "resources_destroy": &schema.Schema{ + "resources_destroy": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "Number of resources destroy.", }, - "log_url": &schema.Schema{ + "log_url": { Type: schema.TypeString, Optional: true, Description: "Log url for job.", @@ -2651,63 +2654,63 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "action_job": &schema.Schema{ + "action_job": { Type: schema.TypeList, Optional: true, Description: "Flow Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target_count": &schema.Schema{ + "target_count": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "number of targets or hosts.", }, - "task_count": &schema.Schema{ + "task_count": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "number of tasks in playbook.", }, - "play_count": &schema.Schema{ + "play_count": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "number of plays in playbook.", }, - "recap": &schema.Schema{ + "recap": { Type: schema.TypeList, Optional: true, Description: "Recap records.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target": &schema.Schema{ + "target": { Type: schema.TypeList, Optional: true, Description: "List of target or host name.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "ok": &schema.Schema{ + "ok": { Type: schema.TypeFloat, Optional: true, Description: "Number of OK.", }, - "changed": &schema.Schema{ + "changed": { Type: schema.TypeFloat, Optional: true, Description: "Number of changed.", }, - "failed": &schema.Schema{ + "failed": { Type: schema.TypeFloat, Optional: true, Description: "Number of failed.", }, - "skipped": &schema.Schema{ + "skipped": { Type: schema.TypeFloat, Optional: true, Description: "Number of skipped.", }, - "unreachable": &schema.Schema{ + "unreachable": { Type: schema.TypeFloat, Optional: true, Description: "Number of unreachable.", @@ -2718,25 +2721,25 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "system_job": &schema.Schema{ + "system_job": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "System Job log summary.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "target_count": &schema.Schema{ + "target_count": { Type: schema.TypeFloat, Optional: true, Computed: true, Description: "number of targets or hosts.", }, - "success": &schema.Schema{ + "success": { Type: schema.TypeFloat, Optional: true, Description: "Number of passed.", }, - "failed": &schema.Schema{ + "failed": { Type: schema.TypeFloat, Optional: true, Description: "Number of failed.", @@ -2747,62 +2750,62 @@ func resourceIBMSchematicsJob() *schema.Resource { }, }, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "Job name, uniquely derived from the related Workspace or Action.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "The description of your job is derived from the related action or workspace. The description can be up to 2048 characters long in size.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "Resource-group name derived from the related Workspace or Action.", }, - "submitted_at": &schema.Schema{ + "submitted_at": { Type: schema.TypeString, Computed: true, Description: "Job submission time.", }, - "submitted_by": &schema.Schema{ + "submitted_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who submitted the job.", }, - "start_at": &schema.Schema{ + "start_at": { Type: schema.TypeString, Computed: true, Description: "Job start time.", }, - "end_at": &schema.Schema{ + "end_at": { Type: schema.TypeString, Computed: true, Description: "Job end time.", }, - "duration": &schema.Schema{ + "duration": { Type: schema.TypeString, Computed: true, Description: "Duration of job execution; example 40 sec.", }, - "log_store_url": &schema.Schema{ + "log_store_url": { Type: schema.TypeString, Computed: true, Description: "Job log store URL.", }, - "state_store_url": &schema.Schema{ + "state_store_url": { Type: schema.TypeString, Computed: true, Description: "Job state store URL.", }, - "results_url": &schema.Schema{ + "results_url": { Type: schema.TypeString, Computed: true, Description: "Job results store URL.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Job status updation timestamp.", @@ -2811,42 +2814,42 @@ func resourceIBMSchematicsJob() *schema.Resource { } } -func resourceIBMSchematicsJobValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSchematicsJobValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "command_object", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "action, environment, system, workspace", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "command_name", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "ansible_playbook_check, ansible_playbook_run, create_action, create_cart, create_environment, create_workspace, delete_action, delete_environment, delete_workspace, environment_init, environment_install, environment_uninstall, patch_action, patch_workspace, put_action, put_environment, put_workspace, repository_process, system_key_delete, system_key_disable, system_key_enable, system_key_restore, system_key_rotate, workspace_apply, workspace_destroy, workspace_plan, workspace_refresh", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "location", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "us, eu, eu-de, eu-gb, us-east, us-south", }) - resourceValidator := ResourceValidator{ResourceName: "ibm_schematics_job", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_schematics_job", Schema: validateSchema} return &resourceValidator } func resourceIBMSchematicsJobCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } - session, err := meta.(ClientSession).BluemixSession() + session, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -2890,7 +2893,7 @@ func resourceIBMSchematicsJobCreate(context context.Context, d *schema.ResourceD createJobOptions.SetSettings(jobEnvSettings) } if _, ok := d.GetOk("tags"); ok { - createJobOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) + createJobOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) } if _, ok := d.GetOk("location"); ok { createJobOptions.SetLocation(d.Get("location").(string)) @@ -3851,7 +3854,7 @@ func resourceIBMSchematicsJobMapToJobLogSummarySystemJob(jobLogSummarySystemJobM } func resourceIBMSchematicsJobRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -3871,22 +3874,22 @@ func resourceIBMSchematicsJobRead(context context.Context, d *schema.ResourceDat } if err = d.Set("command_object", job.CommandObject); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_object: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_object: %s", err)) } if err = d.Set("command_object_id", job.CommandObjectID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_object_id: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_object_id: %s", err)) } if err = d.Set("command_name", job.CommandName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_name: %s", err)) } if _, ok := d.GetOk("command_parameter"); ok { if err = d.Set("command_parameter", d.Get("command_parameter").(string)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_parameter: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_parameter: %s", err)) } } if job.CommandOptions != nil { if err = d.Set("command_options", job.CommandOptions); err != nil { - return diag.FromErr(fmt.Errorf("Error setting command_options: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting command_options: %s", err)) } } if job.Inputs != nil { @@ -3896,7 +3899,7 @@ func resourceIBMSchematicsJobRead(context context.Context, d *schema.ResourceDat jobInputs = append(jobInputs, jobInputsItemMap) } if err = d.Set("job_inputs", jobInputs); err != nil { - return diag.FromErr(fmt.Errorf("Error setting job_inputs: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting job_inputs: %s", err)) } } if job.Settings != nil { @@ -3906,76 +3909,76 @@ func resourceIBMSchematicsJobRead(context context.Context, d *schema.ResourceDat jobEnvSettings = append(jobEnvSettings, jobEnvSettingsItemMap) } if err = d.Set("job_env_settings", jobEnvSettings); err != nil { - return diag.FromErr(fmt.Errorf("Error setting job_env_settings: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting job_env_settings: %s", err)) } } if job.Tags != nil { if err = d.Set("tags", job.Tags); err != nil { - return diag.FromErr(fmt.Errorf("Error setting tags: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting tags: %s", err)) } } if err = d.Set("location", job.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if job.Status != nil { statusMap := resourceIBMSchematicsJobJobStatusToMap(*job.Status) if err = d.Set("status", []map[string]interface{}{statusMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } } if job.Data != nil { dataMap := resourceIBMSchematicsJobJobDataToMap(*job.Data) if err = d.Set("data", []map[string]interface{}{dataMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting data: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting data: %s", err)) } } if job.Bastion != nil { bastionMap := resourceIBMSchematicsJobBastionResourceDefinitionToMap(*job.Bastion) if err = d.Set("bastion", []map[string]interface{}{bastionMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting bastion: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting bastion: %s", err)) } } if job.LogSummary != nil { logSummaryMap := resourceIBMSchematicsJobJobLogSummaryToMap(*job.LogSummary) if err = d.Set("log_summary", []map[string]interface{}{logSummaryMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting log_summary: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting log_summary: %s", err)) } } if err = d.Set("name", job.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("description", job.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("resource_group", job.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } - if err = d.Set("submitted_at", dateTimeToString(job.SubmittedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting submitted_at: %s", err)) + if err = d.Set("submitted_at", flex.DateTimeToString(job.SubmittedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting submitted_at: %s", err)) } if err = d.Set("submitted_by", job.SubmittedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting submitted_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting submitted_by: %s", err)) } - if err = d.Set("start_at", dateTimeToString(job.StartAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting start_at: %s", err)) + if err = d.Set("start_at", flex.DateTimeToString(job.StartAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting start_at: %s", err)) } - if err = d.Set("end_at", dateTimeToString(job.EndAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting end_at: %s", err)) + if err = d.Set("end_at", flex.DateTimeToString(job.EndAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting end_at: %s", err)) } if err = d.Set("duration", job.Duration); err != nil { - return diag.FromErr(fmt.Errorf("Error setting duration: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting duration: %s", err)) } if err = d.Set("log_store_url", job.LogStoreURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting log_store_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting log_store_url: %s", err)) } if err = d.Set("state_store_url", job.StateStoreURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state_store_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state_store_url: %s", err)) } if err = d.Set("results_url", job.ResultsURL); err != nil { - return diag.FromErr(fmt.Errorf("Error setting results_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting results_url: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(job.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(job.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } return nil @@ -4029,22 +4032,22 @@ func resourceIBMSchematicsJobVariableMetadataToMap(variableMetadata schematicsv1 variableMetadataMap["options"] = variableMetadata.Options } if variableMetadata.MinValue != nil { - variableMetadataMap["min_value"] = intValue(variableMetadata.MinValue) + variableMetadataMap["min_value"] = flex.IntValue(variableMetadata.MinValue) } if variableMetadata.MaxValue != nil { - variableMetadataMap["max_value"] = intValue(variableMetadata.MaxValue) + variableMetadataMap["max_value"] = flex.IntValue(variableMetadata.MaxValue) } if variableMetadata.MinLength != nil { - variableMetadataMap["min_length"] = intValue(variableMetadata.MinLength) + variableMetadataMap["min_length"] = flex.IntValue(variableMetadata.MinLength) } if variableMetadata.MaxLength != nil { - variableMetadataMap["max_length"] = intValue(variableMetadata.MaxLength) + variableMetadataMap["max_length"] = flex.IntValue(variableMetadata.MaxLength) } if variableMetadata.Matches != nil { variableMetadataMap["matches"] = variableMetadata.Matches } if variableMetadata.Position != nil { - variableMetadataMap["position"] = intValue(variableMetadata.Position) + variableMetadataMap["position"] = flex.IntValue(variableMetadata.Position) } if variableMetadata.GroupBy != nil { variableMetadataMap["group_by"] = variableMetadata.GroupBy @@ -4177,7 +4180,7 @@ func resourceIBMSchematicsJobJobStatusTemplateToMap(jobStatusTemplate schematics jobStatusTemplateMap["template_name"] = jobStatusTemplate.TemplateName } if jobStatusTemplate.FlowIndex != nil { - jobStatusTemplateMap["flow_index"] = intValue(jobStatusTemplate.FlowIndex) + jobStatusTemplateMap["flow_index"] = flex.IntValue(jobStatusTemplate.FlowIndex) } if jobStatusTemplate.StatusCode != nil { jobStatusTemplateMap["status_code"] = jobStatusTemplate.StatusCode @@ -4356,7 +4359,7 @@ func resourceIBMSchematicsJobJobDataTemplateToMap(jobDataTemplate schematicsv1.J jobDataTemplateMap["template_name"] = jobDataTemplate.TemplateName } if jobDataTemplate.FlowIndex != nil { - jobDataTemplateMap["flow_index"] = intValue(jobDataTemplate.FlowIndex) + jobDataTemplateMap["flow_index"] = flex.IntValue(jobDataTemplate.FlowIndex) } if jobDataTemplate.Inputs != nil { inputs := []map[string]interface{}{} @@ -4915,12 +4918,12 @@ func resourceIBMSchematicsJobJobLogSummarySystemJobToMap(jobLogSummarySystemJob } func resourceIBMSchematicsJobUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } - session, err := meta.(ClientSession).BluemixSession() + session, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } @@ -4945,7 +4948,7 @@ func resourceIBMSchematicsJobUpdate(context context.Context, d *schema.ResourceD updateJobOptions.SetCommandParameter(d.Get("command_parameter").(string)) } if _, ok := d.GetOk("command_options"); ok { - updateJobOptions.SetCommandOptions(expandStringList(d.Get("command_options").([]interface{}))) + updateJobOptions.SetCommandOptions(flex.ExpandStringList(d.Get("command_options").([]interface{}))) } if _, ok := d.GetOk("job_inputs"); ok { var jobInputs []schematicsv1.VariableData @@ -4966,7 +4969,7 @@ func resourceIBMSchematicsJobUpdate(context context.Context, d *schema.ResourceD updateJobOptions.SetSettings(jobEnvSettings) } if _, ok := d.GetOk("tags"); ok { - updateJobOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) + updateJobOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) } if _, ok := d.GetOk("location"); ok { updateJobOptions.SetLocation(d.Get("location").(string)) @@ -5011,12 +5014,12 @@ func resourceIBMSchematicsJobUpdate(context context.Context, d *schema.ResourceD func resourceIBMSchematicsJobDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - session, err := meta.(ClientSession).BluemixSession() + session, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_resource_query.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_resource_query.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_resource_query.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_resource_query.go index 7cba9c00ed..3e06e2e43f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_resource_query.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_resource_query.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +18,7 @@ import ( "github.com/IBM/schematics-go-sdk/schematicsv1" ) -func resourceIBMSchematicsResourceQuery() *schema.Resource { +func ResourceIBMSchematicsResourceQuery() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSchematicsResourceQueryCreate, ReadContext: resourceIBMSchematicsResourceQueryRead, @@ -24,43 +27,43 @@ func resourceIBMSchematicsResourceQuery() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_schematics_resource_query", "type"), + ValidateFunc: validate.InvokeValidator("ibm_schematics_resource_query", "type"), Description: "Resource type (cluster, vsi, icd, vpc).", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Resource query name.", }, - "queries": &schema.Schema{ + "queries": { Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "query_type": &schema.Schema{ + "query_type": { Type: schema.TypeString, Optional: true, Description: "Type of the query(workspaces).", }, - "query_condition": &schema.Schema{ + "query_condition": { Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "Name of the resource query param.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Optional: true, Description: "Value of the resource query param.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "Description of resource query param variable.", @@ -68,7 +71,7 @@ func resourceIBMSchematicsResourceQuery() *schema.Resource { }, }, }, - "query_select": &schema.Schema{ + "query_select": { Type: schema.TypeList, Optional: true, Description: "List of query selection parameters.", @@ -77,22 +80,22 @@ func resourceIBMSchematicsResourceQuery() *schema.Resource { }, }, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "Resource query creation time.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who created the Resource query.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "Resource query updation time.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "Email address of user who updated the Resource query.", @@ -101,24 +104,24 @@ func resourceIBMSchematicsResourceQuery() *schema.Resource { } } -func resourceIBMSchematicsResourceQueryValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMSchematicsResourceQueryValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "vsi", }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_schematics_resource_query", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_schematics_resource_query", Schema: validateSchema} return &resourceValidator } func resourceIBMSchematicsResourceQueryCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -194,7 +197,7 @@ func resourceIBMSchematicsResourceQueryMapToResourceQueryParam(resourceQueryPara } func resourceIBMSchematicsResourceQueryRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -214,10 +217,10 @@ func resourceIBMSchematicsResourceQueryRead(context context.Context, d *schema.R } if err = d.Set("type", resourceQueryRecord.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } if err = d.Set("name", resourceQueryRecord.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if resourceQueryRecord.Queries != nil { queries := []map[string]interface{}{} @@ -226,20 +229,20 @@ func resourceIBMSchematicsResourceQueryRead(context context.Context, d *schema.R queries = append(queries, queriesItemMap) } if err = d.Set("queries", queries); err != nil { - return diag.FromErr(fmt.Errorf("Error setting queries: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting queries: %s", err)) } } - if err = d.Set("created_at", dateTimeToString(resourceQueryRecord.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(resourceQueryRecord.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("created_by", resourceQueryRecord.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } - if err = d.Set("updated_at", dateTimeToString(resourceQueryRecord.UpdatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_at: %s", err)) + if err = d.Set("updated_at", flex.DateTimeToString(resourceQueryRecord.UpdatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_at: %s", err)) } if err = d.Set("updated_by", resourceQueryRecord.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } return nil @@ -284,7 +287,7 @@ func resourceIBMSchematicsResourceQueryResourceQueryParamToMap(resourceQueryPara } func resourceIBMSchematicsResourceQueryUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -318,7 +321,7 @@ func resourceIBMSchematicsResourceQueryUpdate(context context.Context, d *schema } func resourceIBMSchematicsResourceQueryDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_workspace.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_workspace.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_workspace.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_workspace.go index 7ead0532af..ab0559d683 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_schematics_workspace.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics/resource_ibm_schematics_workspace.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package schematics import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -23,7 +26,7 @@ const ( schematicsWorkspaceTemplateType = "template_type" ) -func resourceIBMSchematicsWorkspace() *schema.Resource { +func ResourceIBMSchematicsWorkspace() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMSchematicsWorkspaceCreate, ReadContext: resourceIBMSchematicsWorkspaceRead, @@ -32,60 +35,60 @@ func resourceIBMSchematicsWorkspace() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "applied_shareddata_ids": &schema.Schema{ + "applied_shareddata_ids": { Type: schema.TypeList, Optional: true, Description: "List of applied shared dataset ID.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "catalog_ref": &schema.Schema{ + "catalog_ref": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Information about the software template that you chose from the IBM Cloud catalog. This information is returned for IBM Cloud catalog offerings only.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "dry_run": &schema.Schema{ + "dry_run": { Type: schema.TypeBool, Optional: true, Description: "Dry run.", }, - "owning_account": &schema.Schema{ + "owning_account": { Type: schema.TypeString, Optional: true, Description: "Owning account ID of the catalog.", }, - "item_icon_url": &schema.Schema{ + "item_icon_url": { Type: schema.TypeString, Optional: true, Description: "The URL to the icon of the software template in the IBM Cloud catalog.", }, - "item_id": &schema.Schema{ + "item_id": { Type: schema.TypeString, Optional: true, Description: "The ID of the software template that you chose to install from the IBM Cloud catalog. This software is provisioned with Schematics.", }, - "item_name": &schema.Schema{ + "item_name": { Type: schema.TypeString, Optional: true, Description: "The name of the software that you chose to install from the IBM Cloud catalog.", }, - "item_readme_url": &schema.Schema{ + "item_readme_url": { Type: schema.TypeString, Optional: true, Description: "The URL to the readme file of the software template in the IBM Cloud catalog.", }, - "item_url": &schema.Schema{ + "item_url": { Type: schema.TypeString, Optional: true, Description: "The URL to the software template in the IBM Cloud catalog.", }, - "launch_url": &schema.Schema{ + "launch_url": { Type: schema.TypeString, Optional: true, Description: "The URL to the dashboard to access your software.", }, - "offering_version": &schema.Schema{ + "offering_version": { Type: schema.TypeString, Optional: true, Description: "The version of the software template that you chose to install from the IBM Cloud catalog.", @@ -93,82 +96,82 @@ func resourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "The description of the workspace.", - ValidateFunc: InvokeValidator("ibm_schematics_workspace", schematicsWorkspaceDescription), + ValidateFunc: validate.InvokeValidator("ibm_schematics_workspace", schematicsWorkspaceDescription), }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Optional: true, Description: "The location where you want to create your Schematics workspace and run the Schematics jobs. The location that you enter must match the API endpoint that you use. For example, if you use the Frankfurt API endpoint, you must specify `eu-de` as your location. If you use an API endpoint for a geography and you do not specify a location, Schematics determines the location based on availability.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The name of your workspace. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores. When you create a workspace for your own Terraform template, consider including the microservice component that you set up with your Terraform template and the IBM Cloud environment where you want to deploy your resources in your name.", - ValidateFunc: InvokeValidator("ibm_schematics_workspace", schematicsWorkspaceName), + ValidateFunc: validate.InvokeValidator("ibm_schematics_workspace", schematicsWorkspaceName), }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Optional: true, Description: "The ID of the resource group where you want to provision the workspace.", }, - "shared_data": &schema.Schema{ + "shared_data": { Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "Information about the Target used by the templates originating from the IBM Cloud catalog offerings. This information is not relevant for workspace created using your own Terraform template.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cluster_created_on": &schema.Schema{ + "cluster_created_on": { Type: schema.TypeString, Optional: true, Description: "Cluster created on.", }, - "cluster_id": &schema.Schema{ + "cluster_id": { Type: schema.TypeString, Optional: true, Description: "The ID of the cluster where you want to provision the resources of all IBM Cloud catalog templates that are included in the catalog offering.", }, - "cluster_name": &schema.Schema{ + "cluster_name": { Type: schema.TypeString, Optional: true, Description: "The cluster name.", }, - "cluster_type": &schema.Schema{ + "cluster_type": { Type: schema.TypeString, Optional: true, Description: "The cluster type.", }, - "entitlement_keys": &schema.Schema{ + "entitlement_keys": { Type: schema.TypeList, Optional: true, Description: "The entitlement key that you want to use to install IBM Cloud entitled software.", Elem: &schema.Schema{Type: schema.TypeMap}, }, - "namespace": &schema.Schema{ + "namespace": { Type: schema.TypeString, Optional: true, Description: "The Kubernetes namespace or OpenShift project where the resources of all IBM Cloud catalog templates that are included in the catalog offering are deployed into.", }, - "region": &schema.Schema{ + "region": { Type: schema.TypeString, Optional: true, Description: "The IBM Cloud region that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", }, - "resource_group_id": &schema.Schema{ + "resource_group_id": { Type: schema.TypeString, Optional: true, Description: "The ID of the resource group that you want to use for the resources of all IBM Cloud catalog templates that are included in the catalog offering.", }, - "worker_count": &schema.Schema{ + "worker_count": { Type: schema.TypeInt, Optional: true, Description: "The cluster worker count.", }, - "worker_machine_type": &schema.Schema{ + "worker_machine_type": { Type: schema.TypeString, Optional: true, Description: "The cluster worker type.", @@ -176,83 +179,83 @@ func resourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "tags": &schema.Schema{ + "tags": { Type: schema.TypeList, Optional: true, Description: "A list of tags that are associated with the workspace.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "template_env_settings": &schema.Schema{ + "template_env_settings": { Type: schema.TypeList, Optional: true, Description: "A list of environment variables that you want to apply during the execution of a bash script or Terraform job. This field must be provided as a list of key-value pairs, for example, **TF_LOG=debug**. Each entry will be a map with one entry where `key is the environment variable name and value is value`. You can define environment variables for IBM Cloud catalog offerings that are provisioned by using a bash script. See [example to use special environment variable](https://cloud.ibm.com/docs/schematics?topic=schematics-set-parallelism#parallelism-example) that are supported by Schematics.", Elem: &schema.Schema{Type: schema.TypeMap}, }, - "template_git_folder": &schema.Schema{ + "template_git_folder": { Type: schema.TypeString, Optional: true, Description: "The subfolder in your GitHub or GitLab repository where your Terraform template is stored.", }, - "template_init_state_file": &schema.Schema{ + "template_init_state_file": { Type: schema.TypeString, Optional: true, Description: "The content of an existing Terraform statefile that you want to import in to your workspace. To get the content of a Terraform statefile for a specific Terraform template in an existing workspace, run `ibmcloud terraform state pull --id --template `.", }, - "template_type": &schema.Schema{ + "template_type": { Type: schema.TypeString, Required: true, Description: "The Terraform version that you want to use to run your Terraform code. Enter `terraform_v0.12` to use Terraform version 0.12, and `terraform_v0.11` to use Terraform version 0.11. The Terraform config files are run with Terraform version 0.11. This is a required variable. Make sure that your Terraform config files are compatible with the Terraform version that you select.", - ValidateFunc: InvokeValidator("ibm_schematics_workspace", schematicsWorkspaceTemplateType), + ValidateFunc: validate.InvokeValidator("ibm_schematics_workspace", schematicsWorkspaceTemplateType), }, - "template_uninstall_script_name": &schema.Schema{ + "template_uninstall_script_name": { Type: schema.TypeString, Optional: true, Description: "Uninstall script name.", }, - "template_values": &schema.Schema{ + "template_values": { Type: schema.TypeString, Optional: true, Description: "A list of variable values that you want to apply during the Helm chart installation. The list must be provided in JSON format, such as `\"autoscaling: enabled: true minReplicas: 2\"`. The values that you define here override the default Helm chart values. This field is supported only for IBM Cloud catalog offerings that are provisioned by using the Terraform Helm provider.", }, - "template_values_metadata": &schema.Schema{ + "template_values_metadata": { Type: schema.TypeList, Optional: true, Computed: true, Description: "List of values metadata.", Elem: &schema.Schema{Type: schema.TypeMap}, }, - "template_inputs": &schema.Schema{ + "template_inputs": { Type: schema.TypeList, Optional: true, Description: "VariablesRequest -.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Description: "The description of your input variable.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The name of the variable.", }, - "secure": &schema.Schema{ + "secure": { Type: schema.TypeBool, Optional: true, Description: "If set to `true`, the value of your input variable is protected and not returned in your API response.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Required: true, Description: "`Terraform v0.11` supports `string`, `list`, `map` data type. For more information, about the syntax, see [Configuring input variables](https://www.terraform.io/docs/configuration-0-11/variables.html).
`Terraform v0.12` additionally, supports `bool`, `number` and complex data types such as `list(type)`, `map(type)`,`object({attribute name=type,..})`, `set(type)`, `tuple([type])`. For more information, about the syntax to use the complex data type, see [Configuring variables](https://www.terraform.io/docs/configuration/variables.html#type-constraints).", }, - "use_default": &schema.Schema{ + "use_default": { Type: schema.TypeBool, Optional: true, Description: "Variable uses default value; and is not over-ridden.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Required: true, Description: "Enter the value as a string for the primitive types such as `bool`, `number`, `string`, and `HCL` format for the complex variables, as you provide in a `.tfvars` file. **You need to enter escaped string of `HCL` format for the complex variable value**. For more information, about how to declare variables in a terraform configuration file and provide value to schematics, see [Providing values for the declared variables](/docs/schematics?topic=schematics-create-tf-config#declare-variable).", @@ -260,151 +263,151 @@ func resourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "template_ref": &schema.Schema{ + "template_ref": { Type: schema.TypeString, Optional: true, Description: "Workspace template ref.", }, - "template_git_branch": &schema.Schema{ + "template_git_branch": { Type: schema.TypeString, Optional: true, Description: "The repository branch.", }, - "template_git_release": &schema.Schema{ + "template_git_release": { Type: schema.TypeString, Optional: true, Description: "The repository release.", }, - "template_git_repo_sha_value": &schema.Schema{ + "template_git_repo_sha_value": { Type: schema.TypeString, Optional: true, Description: "The repository SHA value.", }, - "template_git_repo_url": &schema.Schema{ + "template_git_repo_url": { Type: schema.TypeString, Optional: true, Description: "The repository URL.", }, - "template_git_url": &schema.Schema{ + "template_git_url": { Type: schema.TypeString, Optional: true, Description: "The source URL.", ValidateFunc: validation.IsURLWithHTTPorHTTPS, }, - "template_git_has_uploadedgitrepotar": &schema.Schema{ + "template_git_has_uploadedgitrepotar": { Type: schema.TypeBool, Optional: true, Computed: true, Description: "Has uploaded git repo tar", }, - /*"template_type": &schema.Schema{ + /*"template_type": { Type: schema.TypeList, Required: true, Description: "List of Workspace type.", Elem: &schema.Schema{Type: schema.TypeString}, },*/ - "frozen": &schema.Schema{ + "frozen": { Type: schema.TypeBool, Optional: true, Description: "If set to true, the workspace is frozen and changes to the workspace are disabled.", }, - "frozen_at": &schema.Schema{ + "frozen_at": { Type: schema.TypeString, Optional: true, Description: "The timestamp when the workspace was frozen.", }, - "frozen_by": &schema.Schema{ + "frozen_by": { Type: schema.TypeString, Optional: true, Description: "The user ID that froze the workspace.", }, - "locked": &schema.Schema{ + "locked": { Type: schema.TypeBool, Optional: true, Computed: true, Description: "If set to true, the workspace is locked and disabled for changes.", }, - "locked_by": &schema.Schema{ + "locked_by": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The user ID that initiated a resource-related action, such as applying or destroying resources, that locked the workspace.", }, - "locked_time": &schema.Schema{ + "locked_time": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The timestamp when the workspace was locked.", }, - "x_github_token": &schema.Schema{ + "x_github_token": { Type: schema.TypeString, Optional: true, Description: "The personal access token to authenticate with your private GitHub or GitLab repository and access your Terraform template.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the workspace was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The user ID that created the workspace.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The workspace CRN.", }, - "last_health_check_at": &schema.Schema{ + "last_health_check_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the last health check was performed by Schematics.", }, - "runtime_data": &schema.Schema{ + "runtime_data": { Type: schema.TypeList, Computed: true, Description: "Information about the provisioning engine, state file, and runtime logs.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "engine_cmd": &schema.Schema{ + "engine_cmd": { Type: schema.TypeString, Optional: true, Description: "The command that was used to apply the Terraform template or IBM Cloud catalog software template.", }, - "engine_name": &schema.Schema{ + "engine_name": { Type: schema.TypeString, Optional: true, Description: "The provisioning engine that was used to apply the Terraform template or IBM Cloud catalog software template.", }, - "engine_version": &schema.Schema{ + "engine_version": { Type: schema.TypeString, Optional: true, Description: "The version of the provisioning engine that was used.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Optional: true, Description: "The ID that was assigned to your Terraform template or IBM Cloud catalog software template.", }, - "log_store_url": &schema.Schema{ + "log_store_url": { Type: schema.TypeString, Optional: true, Description: "The URL to access the logs that were created during the creation, update, or deletion of your IBM Cloud resources.", }, - "output_values": &schema.Schema{ + "output_values": { Type: schema.TypeList, Optional: true, Description: "List of Output values.", Elem: &schema.Schema{Type: schema.TypeMap}, }, - "resources": &schema.Schema{ + "resources": { Type: schema.TypeList, Optional: true, Description: "List of resources.", Elem: &schema.Schema{Type: schema.TypeMap}, }, - "state_store_url": &schema.Schema{ + "state_store_url": { Type: schema.TypeString, Optional: true, Description: "The URL where the Terraform statefile (`terraform.tfstate`) is stored. You can use the statefile to find an overview of IBM Cloud resources that were created by Schematics. Schematics uses the statefile as an inventory list to determine future create, update, or deletion jobs.", @@ -412,27 +415,27 @@ func resourceIBMSchematicsWorkspace() *schema.Resource { }, }, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the workspace. **Active**: After you successfully ran your infrastructure code by applying your Terraform execution plan, the state of your workspace changes to `Active`. **Connecting**: Schematics tries to connect to the template in your source repo. If successfully connected, the template is downloaded and metadata, such as input parameters, is extracted. After the template is downloaded, the state of the workspace changes to `Scanning`. **Draft**: The workspace is created without a reference to a GitHub or GitLab repository. **Failed**: If errors occur during the execution of your infrastructure code in IBM Cloud Schematics, your workspace status is set to `Failed`. **Inactive**: The Terraform template was scanned successfully and the workspace creation is complete. You can now start running Schematics plan and apply jobs to provision the IBM Cloud resources that you specified in your template. If you have an `Active` workspace and decide to remove all your resources, your workspace is set to `Inactive` after all your resources are removed. **In progress**: When you instruct IBM Cloud Schematics to run your infrastructure code by applying your Terraform execution plan, the status of our workspace changes to `In progress`. **Scanning**: The download of the Terraform template is complete and vulnerability scanning started. If the scan is successful, the workspace state changes to `Inactive`. If errors in your template are found, the state changes to `Template Error`. **Stopped**: The Schematics plan, apply, or destroy job was cancelled manually. **Template Error**: The Schematics template contains errors and cannot be processed.", }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, Description: "The timestamp when the workspace was last updated.", }, - "updated_by": &schema.Schema{ + "updated_by": { Type: schema.TypeString, Computed: true, Description: "The user ID that updated the workspace.", }, - "status_code": &schema.Schema{ + "status_code": { Type: schema.TypeString, Computed: true, Description: "The success or error code that was returned for the last plan, apply, or destroy job that ran against your workspace.", }, - "status_msg": &schema.Schema{ + "status_msg": { Type: schema.TypeString, Computed: true, Description: "The success or error message that was returned for the last plan, apply, or destroy job that ran against your workspace.", @@ -441,42 +444,42 @@ func resourceIBMSchematicsWorkspace() *schema.Resource { } } -func resourceIBMSchematicsWorkspaceValidator() *ResourceValidator { +func ResourceIBMSchematicsWorkspaceValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: schematicsWorkspaceName, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, Regexp: `^[a-zA-Z0-9][a-zA-Z0-9-_ ]*$`, MinValueLength: 1, MaxValueLength: 128, Required: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: schematicsWorkspaceDescription, - ValidateFunctionIdentifier: StringLenBetween, - Type: TypeString, + ValidateFunctionIdentifier: validate.StringLenBetween, + Type: validate.TypeString, MinValueLength: 0, MaxValueLength: 2048, Optional: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: schematicsWorkspaceTemplateType, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, Regexp: `^terraform_v(?:0\.11|0\.12|0\.13|0\.14|0\.15|1\.0)(?:\.\d+)?$`, Default: "[]", Optional: true}) - ibmSchematicsWorkspaceResourceValidator := ResourceValidator{ResourceName: "ibm_schematics_workspace", Schema: validateSchema} + ibmSchematicsWorkspaceResourceValidator := validate.ResourceValidator{ResourceName: "ibm_schematics_workspace", Schema: validateSchema} return &ibmSchematicsWorkspaceResourceValidator } func resourceIBMSchematicsWorkspaceCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -484,7 +487,7 @@ func resourceIBMSchematicsWorkspaceCreate(context context.Context, d *schema.Res createWorkspaceOptions := &schematicsv1.CreateWorkspaceOptions{} if _, ok := d.GetOk("applied_shareddata_ids"); ok { - createWorkspaceOptions.SetAppliedShareddataIds(expandStringList(d.Get("applied_shareddata_ids").([]interface{}))) + createWorkspaceOptions.SetAppliedShareddataIds(flex.ExpandStringList(d.Get("applied_shareddata_ids").([]interface{}))) } if _, ok := d.GetOk("catalog_ref"); ok { catalogRefAttr := d.Get("catalog_ref").([]interface{}) @@ -513,7 +516,7 @@ func resourceIBMSchematicsWorkspaceCreate(context context.Context, d *schema.Res } } if _, ok := d.GetOk("tags"); ok { - createWorkspaceOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) + createWorkspaceOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) } var templateData []schematicsv1.TemplateSourceDataRequest @@ -595,7 +598,7 @@ func resourceIBMSchematicsWorkspaceCreate(context context.Context, d *schema.Res } /*if _, ok := d.GetOk("template_type"); ok { - createWorkspaceOptions.SetType(expandStringList(d.Get("template_type").([]interface{}))) + createWorkspaceOptions.SetType(flex.ExpandStringList(d.Get("template_type").([]interface{}))) }*/ workspaceStatusRequestMap := map[string]interface{}{} hasWorkspaceStatus := false @@ -892,7 +895,7 @@ func resourceIBMSchematicsWorkspaceMapToWorkspaceStatusUpdateRequest(workspaceSt } func resourceIBMSchematicsWorkspaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -913,38 +916,38 @@ func resourceIBMSchematicsWorkspaceRead(context context.Context, d *schema.Resou if workspaceResponse.AppliedShareddataIds != nil { if err = d.Set("applied_shareddata_ids", workspaceResponse.AppliedShareddataIds); err != nil { - return diag.FromErr(fmt.Errorf("Error setting applied_shareddata_ids: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting applied_shareddata_ids: %s", err)) } } if workspaceResponse.CatalogRef != nil { catalogRefMap := resourceIBMSchematicsWorkspaceCatalogRefToMap(*workspaceResponse.CatalogRef) if err = d.Set("catalog_ref", []map[string]interface{}{catalogRefMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting catalog_ref: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting catalog_ref: %s", err)) } } if err = d.Set("description", workspaceResponse.Description); err != nil { - return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting description: %s", err)) } if err = d.Set("location", workspaceResponse.Location); err != nil { - return diag.FromErr(fmt.Errorf("Error setting location: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting location: %s", err)) } if err = d.Set("name", workspaceResponse.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("resource_group", workspaceResponse.ResourceGroup); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } if _, ok := d.GetOk("shared_data"); ok { if workspaceResponse.SharedData != nil { sharedDataMap := resourceIBMSchematicsWorkspaceSharedTargetDataResponseToMap(*workspaceResponse.SharedData) if err = d.Set("shared_data", []map[string]interface{}{sharedDataMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error reading shared_data: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading shared_data: %s", err)) } } } if workspaceResponse.Tags != nil { if err = d.Set("tags", workspaceResponse.Tags); err != nil { - return diag.FromErr(fmt.Errorf("Error setting tags: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting tags: %s", err)) } } if workspaceResponse.TemplateData != nil { @@ -954,95 +957,95 @@ func resourceIBMSchematicsWorkspaceRead(context context.Context, d *schema.Resou templateData = append(templateData, templateDataItemMap) } if err = d.Set("template_env_settings", templateData[0]["env_values"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading env_values: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading env_values: %s", err)) } if err = d.Set("template_git_folder", templateData[0]["folder"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading folder: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading folder: %s", err)) } if err = d.Set("template_init_state_file", templateData[0]["init_state_file"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading init_state_file: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading init_state_file: %s", err)) } if err = d.Set("template_type", templateData[0]["type"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading type: %s", err)) } if err = d.Set("template_uninstall_script_name", templateData[0]["uninstall_script_name"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading uninstall_script_name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading uninstall_script_name: %s", err)) } if err = d.Set("template_values", templateData[0]["values"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading values: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading values: %s", err)) } if err = d.Set("template_values_metadata", templateData[0]["values_metadata"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading values_metadata: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading values_metadata: %s", err)) } if err = d.Set("template_inputs", templateData[0]["variablestore"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading variablestore: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading variablestore: %s", err)) } } if err = d.Set("template_ref", workspaceResponse.TemplateRef); err != nil { - return diag.FromErr(fmt.Errorf("Error setting template_ref: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting template_ref: %s", err)) } if workspaceResponse.TemplateRepo != nil { templateRepoMap := resourceIBMSchematicsWorkspaceTemplateRepoResponseToMap(*workspaceResponse.TemplateRepo) if err = d.Set("template_git_branch", templateRepoMap["branch"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading branch: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading branch: %s", err)) } if err = d.Set("template_git_release", templateRepoMap["release"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading release: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading release: %s", err)) } if err = d.Set("template_git_repo_sha_value", templateRepoMap["repo_sha_value"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading repo_sha_value: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading repo_sha_value: %s", err)) } if err = d.Set("template_git_repo_url", templateRepoMap["repo_url"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading repo_url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading repo_url: %s", err)) } if err = d.Set("template_git_url", templateRepoMap["url"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading url: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading url: %s", err)) } if err = d.Set("template_git_has_uploadedgitrepotar", templateRepoMap["has_uploadedgitrepotar"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading has_uploadedgitrepotar: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading has_uploadedgitrepotar: %s", err)) } } /*if workspaceResponse.Type != nil { if err = d.Set("template_type", workspaceResponse.Type); err != nil { - return fmt.Errorf("Error reading type: %s", err) + return fmt.Errorf("[ERROR] Error reading type: %s", err) } }*/ if workspaceResponse.WorkspaceStatus != nil { workspaceStatusMap := resourceIBMSchematicsWorkspaceWorkspaceStatusResponseToMap(*workspaceResponse.WorkspaceStatus) if err = d.Set("frozen", workspaceStatusMap["frozen"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen: %s", err)) } if err = d.Set("frozen_at", workspaceStatusMap["frozen_at"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen_at: %s", err)) } if err = d.Set("frozen_by", workspaceStatusMap["frozen_by"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading frozen_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading frozen_by: %s", err)) } if err = d.Set("locked", workspaceStatusMap["locked"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked: %s", err)) } if err = d.Set("locked_by", workspaceStatusMap["locked_by"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked_by: %s", err)) } if err = d.Set("locked_time", workspaceStatusMap["locked_time"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading locked_time: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading locked_time: %s", err)) } } if workspaceResponse.CreatedAt != nil { if err = d.Set("created_at", workspaceResponse.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error reading created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading created_at: %s", err)) } } if err = d.Set("created_by", workspaceResponse.CreatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_by: %s", err)) } if err = d.Set("crn", workspaceResponse.Crn); err != nil { - return diag.FromErr(fmt.Errorf("Error reading crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading crn: %s", err)) } if workspaceResponse.LastHealthCheckAt != nil { if err = d.Set("last_health_check_at", workspaceResponse.LastHealthCheckAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error reading last_health_check_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading last_health_check_at: %s", err)) } } if workspaceResponse.RuntimeData != nil { @@ -1052,27 +1055,27 @@ func resourceIBMSchematicsWorkspaceRead(context context.Context, d *schema.Resou runtimeData = append(runtimeData, runtimeDataItemMap) } if err = d.Set("runtime_data", runtimeData); err != nil { - return diag.FromErr(fmt.Errorf("Error setting runtime_data: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting runtime_data: %s", err)) } } if err = d.Set("status", workspaceResponse.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if workspaceResponse.UpdatedAt != nil { if err = d.Set("updated_at", workspaceResponse.UpdatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error reading updated_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading updated_at: %s", err)) } } if err = d.Set("updated_by", workspaceResponse.UpdatedBy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting updated_by: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting updated_by: %s", err)) } if workspaceResponse.WorkspaceStatusMsg != nil { workspaceStatusMsgMap := resourceIBMSchematicsWorkspaceWorkspaceStatusMessageToMap(*workspaceResponse.WorkspaceStatusMsg) if err = d.Set("status_code", workspaceStatusMsgMap["status_code"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading status_code: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading status_code: %s", err)) } if err = d.Set("status_msg", workspaceStatusMsgMap["status_msg"]); err != nil { - return diag.FromErr(fmt.Errorf("Error reading status_msg: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error reading status_msg: %s", err)) } } @@ -1145,7 +1148,7 @@ func resourceIBMSchematicsWorkspaceSharedTargetDataToMap(sharedTargetData schema sharedTargetDataMap["resource_group_id"] = sharedTargetData.ResourceGroupID } if sharedTargetData.WorkerCount != nil { - sharedTargetDataMap["worker_count"] = intValue(sharedTargetData.WorkerCount) + sharedTargetDataMap["worker_count"] = flex.IntValue(sharedTargetData.WorkerCount) } if sharedTargetData.WorkerMachineType != nil { sharedTargetDataMap["worker_machine_type"] = sharedTargetData.WorkerMachineType @@ -1428,7 +1431,7 @@ func resourceIBMSchematicsWorkspaceWorkspaceStatusMessageToMap(workspaceStatusMe } func resourceIBMSchematicsWorkspaceUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } @@ -1478,8 +1481,8 @@ func resourceIBMSchematicsWorkspaceUpdate(context context.Context, d *schema.Res } } if d.HasChange("tags") { - updateWorkspaceOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) - replaceWorkspaceOptions.SetTags(expandStringList(d.Get("tags").([]interface{}))) + updateWorkspaceOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) + replaceWorkspaceOptions.SetTags(flex.ExpandStringList(d.Get("tags").([]interface{}))) hasChange = true metadataChange = true } @@ -1662,12 +1665,12 @@ func resourceIBMSchematicsWorkspaceUpdate(context context.Context, d *schema.Res } func resourceIBMSchematicsWorkspaceDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - schematicsClient, err := meta.(ClientSession).SchematicsV1() + schematicsClient, err := meta.(conns.ClientSession).SchematicsV1() if err != nil { return diag.FromErr(err) } - session, err := meta.(ClientSession).BluemixSession() + session, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/README.md new file mode 100644 index 0000000000..8a457ce67a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Secrets Manager + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the Secrets Manager resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/secrets_manager_secret) +* IBM API Docs: [IBM API Docs for Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) +* IBM Secrets Manager SDK: [IBM SDK for Secrets Manager](https://github.com/IBM/secrets-manager-go-sdk) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_secrets_manager_secret.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/data_source_ibm_secrets_manager_secret.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_secrets_manager_secret.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/data_source_ibm_secrets_manager_secret.go index 30ea6032ac..e523891e86 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_secrets_manager_secret.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/data_source_ibm_secrets_manager_secret.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package secretsmanager import ( "context" @@ -10,12 +10,14 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/secrets-manager-go-sdk/secretsmanagerv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSecretsManagerSecret() *schema.Resource { +func DataSourceIBMSecretsManagerSecret() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSecretsManagerSecretRead, @@ -25,13 +27,13 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { Required: true, Description: "Secrets Manager instance GUID", }, - "secret_type": &schema.Schema{ + "secret_type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeDataSourceValidator("ibm_secrets_manager_secret", "secret_type"), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_secrets_manager_secret", "secret_type"), Description: "The secret type. Supported options include: arbitrary, iam_credentials, username_password.", }, - "secret_id": &schema.Schema{ + "secret_id": { Type: schema.TypeString, Required: true, Description: "The v4 UUID that uniquely identifies the secret.", @@ -39,22 +41,22 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeDataSourceValidator("ibm_secrets_manager_secret", "endpoint_type"), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_secrets_manager_secret", "endpoint_type"), Description: "Endpoint Type. 'public' or 'private'", Default: "public", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "The metadata that describes the resource array.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "collection_type": &schema.Schema{ + "collection_type": { Type: schema.TypeString, Computed: true, Description: "The type of resources in the resource array.", }, - "collection_total": &schema.Schema{ + "collection_total": { Type: schema.TypeInt, Computed: true, Description: "The number of elements in the resource array.", @@ -62,27 +64,27 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { }, }, }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The MIME type that represents the secret.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "A human-readable alias to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret.", }, - "secret_group_id": &schema.Schema{ + "secret_group_id": { Type: schema.TypeString, Computed: true, Description: "The v4 UUID that uniquely identifies the secret group to assign to this secret.If you omit this parameter, your secret is assigned to the `default` secret group.", }, - "labels": &schema.Schema{ + "labels": { Type: schema.TypeList, Computed: true, Description: "Labels that you can use to filter for secrets in your instance.Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.", @@ -90,58 +92,58 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { Type: schema.TypeString, }, }, - "state": &schema.Schema{ + "state": { Type: schema.TypeInt, Computed: true, Description: "The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.", }, - "state_description": &schema.Schema{ + "state_description": { Type: schema.TypeString, Computed: true, Description: "A text representation of the secret state.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource.", }, - "creation_date": &schema.Schema{ + "creation_date": { Type: schema.TypeString, Computed: true, Description: "The date the secret was created. The date format follows RFC 3339.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for the entity that created the secret.", }, - "last_update_date": &schema.Schema{ + "last_update_date": { Type: schema.TypeString, Computed: true, Description: "Updates when the actual secret is modified. The date format follows RFC 3339.", }, - "versions": &schema.Schema{ + "versions": { Type: schema.TypeList, Computed: true, Description: "An array that contains metadata for each secret version.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID of the secret version.", }, - "creation_date": &schema.Schema{ + "creation_date": { Type: schema.TypeString, Computed: true, Description: "The date that the version of the secret was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for the entity that created the secret.", }, - "auto_rotated": &schema.Schema{ + "auto_rotated": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether the version of the secret was created by automatic rotation.", @@ -149,46 +151,46 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { }, }, }, - "expiration_date": &schema.Schema{ + "expiration_date": { Type: schema.TypeString, Computed: true, Description: "The date the secret material expires. The date format follows RFC 3339.You can set an expiration date on supported secret types at their creation. If you create a secret without specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the following secret types:- `arbitrary`- `username_password`.", }, - "payload": &schema.Schema{ + "payload": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The new secret data to assign to an `arbitrary` secret.", }, - "secret_data": &schema.Schema{ + "secret_data": { Type: schema.TypeMap, Sensitive: true, Computed: true, Description: "The secret data object", }, - "username": &schema.Schema{ + "username": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The username to assign to this secret.", }, - "password": &schema.Schema{ + "password": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The password to assign to this secret.", }, - "next_rotation_date": &schema.Schema{ + "next_rotation_date": { Type: schema.TypeString, Computed: true, Description: "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that can be auto-rotated and have an existing rotation policy.", }, - "ttl": &schema.Schema{ + "ttl": { Type: schema.TypeString, Computed: true, Description: "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.", }, - "access_groups": &schema.Schema{ + "access_groups": { Type: schema.TypeList, Computed: true, Description: "The access groups that define the capabilities of the service ID and API key that are generated for an`iam_credentials` secret.**Tip:** To find the ID of an access group, go to **Manage > Access (IAM) > Access groups** in the IBM Cloud console. Select the access group to inspect, and click **Details** to view its ID.", @@ -196,18 +198,18 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { Type: schema.TypeString, }, }, - "api_key": &schema.Schema{ + "api_key": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically. If you want to continue to use the same API key for future read operations, see the `reuse_api_key` field.", }, - "service_id": &schema.Schema{ + "service_id": { Type: schema.TypeString, Computed: true, Description: "The service ID under which the API key (see the `api_key` field) is created. This service ID is added to the access groups that you assign for this secret.", }, - "reuse_api_key": &schema.Schema{ + "reuse_api_key": { Type: schema.TypeBool, Computed: true, Description: "(IAM credentials) Reuse the service ID and API key for future read operations.", @@ -216,42 +218,42 @@ func dataSourceIBMSecretsManagerSecret() *schema.Resource { } } -func datasourceIBMSecretsManagerSecretValidator() *ResourceValidator { +func DataSourceIBMSecretsManagerSecretValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) secretType := "arbitrary, iam_credentials, username_password" endpointType := "public, private" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "secret_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: secretType}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "endpoint_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: endpointType}) - ibmSecretsManagerSecretdatasourceValidator := ResourceValidator{ResourceName: "ibm_secrets_manager_secret", Schema: validateSchema} + ibmSecretsManagerSecretdatasourceValidator := validate.ResourceValidator{ResourceName: "ibm_secrets_manager_secret", Schema: validateSchema} return &ibmSecretsManagerSecretdatasourceValidator } func dataSourceIBMSecretsManagerSecretRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - bluemixSession, err := meta.(ClientSession).BluemixSession() + bluemixSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } region := bluemixSession.Config.Region - secretsManagerClient, err := meta.(ClientSession).SecretsManagerV1() + secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV1() if err != nil { return diag.FromErr(err) } - rContollerClient, err := meta.(ClientSession).ResourceControllerAPIV2() + rContollerClient, err := meta.(conns.ClientSession).ResourceControllerAPIV2() if err != nil { return diag.FromErr(err) } @@ -276,10 +278,10 @@ func dataSourceIBMSecretsManagerSecretRead(context context.Context, d *schema.Re } else { smEndpointURL = "https://" + instanceID + "." + region + ".secrets-manager.appdomain.cloud" } - smUrl := envFallBack([]string{"IBMCLOUD_SECRETS_MANAGER_API_ENDPOINT"}, smEndpointURL) + smUrl := conns.EnvFallBack([]string{"IBMCLOUD_SECRETS_MANAGER_API_ENDPOINT"}, smEndpointURL) secretsManagerClient.Service.Options.URL = smUrl } else { - return diag.FromErr(fmt.Errorf("Invalid or unsupported service Instance")) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid or unsupported service Instance")) } secretType := d.Get("secret_type").(string) @@ -300,7 +302,7 @@ func dataSourceIBMSecretsManagerSecretRead(context context.Context, d *schema.Re if getSecret.Metadata != nil { err = d.Set("metadata", dataSourceGetSecretFlattenMetadata(*getSecret.Metadata)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting metadata %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting metadata %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_secrets_manager_secrets.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/data_source_ibm_secrets_manager_secrets.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_secrets_manager_secrets.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/data_source_ibm_secrets_manager_secrets.go index 0cd0d9ee16..f999d7def7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_secrets_manager_secrets.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager/data_source_ibm_secrets_manager_secrets.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package secretsmanager import ( "context" @@ -10,12 +10,14 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/secrets-manager-go-sdk/secretsmanagerv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMSecretsManagerSecrets() *schema.Resource { +func DataSourceIBMSecretsManagerSecrets() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMSecretsManagerSecretsRead, @@ -25,31 +27,31 @@ func dataSourceIBMSecretsManagerSecrets() *schema.Resource { Required: true, Description: "Secrets Manager instance GUID", }, - "secret_type": &schema.Schema{ + "secret_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeDataSourceValidator("ibm_secrets_manager_secrets", "secret_type"), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_secrets_manager_secrets", "secret_type"), Description: "The secret type. Supported options include: arbitrary, iam_credentials, username_password.", }, "endpoint_type": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeDataSourceValidator("ibm_secrets_manager_secrets", "endpoint_type"), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_secrets_manager_secrets", "endpoint_type"), Description: "Endpoint Type. 'public' or 'private'", Default: "public", }, - "metadata": &schema.Schema{ + "metadata": { Type: schema.TypeList, Computed: true, Description: "The metadata that describes the resource array.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "collection_type": &schema.Schema{ + "collection_type": { Type: schema.TypeString, Computed: true, Description: "The type of resources in the resource array.", }, - "collection_total": &schema.Schema{ + "collection_total": { Type: schema.TypeInt, Computed: true, Description: "The number of elements in the resource array.", @@ -57,38 +59,38 @@ func dataSourceIBMSecretsManagerSecrets() *schema.Resource { }, }, }, - "secrets": &schema.Schema{ + "secrets": { Type: schema.TypeList, Computed: true, Description: "A collection of secret resources.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The MIME type that represents the secret.", }, - "secret_id": &schema.Schema{ + "secret_id": { Type: schema.TypeString, Computed: true, Description: "The v4 UUID that uniquely identifies the secret.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "A human-readable alias to assign to your secret.To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret.", }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, Description: "An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret.", }, - "secret_group_id": &schema.Schema{ + "secret_group_id": { Type: schema.TypeString, Computed: true, Description: "The v4 UUID that uniquely identifies the secret group to assign to this secret.If you omit this parameter, your secret is assigned to the `default` secret group.", }, - "labels": &schema.Schema{ + "labels": { Type: schema.TypeList, Computed: true, Description: "Labels that you can use to filter for secrets in your instance.Up to 30 labels can be created. Labels can be between 2-30 characters, including spaces. Special characters not permitted include the angled bracket, comma, colon, ampersand, and vertical pipe character (|).To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.", @@ -96,63 +98,63 @@ func dataSourceIBMSecretsManagerSecrets() *schema.Resource { Type: schema.TypeString, }, }, - "state": &schema.Schema{ + "state": { Type: schema.TypeInt, Computed: true, Description: "The secret state based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.", }, - "state_description": &schema.Schema{ + "state_description": { Type: schema.TypeString, Computed: true, Description: "A text representation of the secret state.", }, - "secret_type": &schema.Schema{ + "secret_type": { Type: schema.TypeString, Computed: true, Description: "The secret type.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The Cloud Resource Name (CRN) that uniquely identifies your Secrets Manager resource.", }, - "creation_date": &schema.Schema{ + "creation_date": { Type: schema.TypeString, Computed: true, Description: "The date the secret was created. The date format follows RFC 3339.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for the entity that created the secret.", }, - "last_update_date": &schema.Schema{ + "last_update_date": { Type: schema.TypeString, Computed: true, Description: "Updates when the actual secret is modified. The date format follows RFC 3339.", }, - "versions": &schema.Schema{ + "versions": { Type: schema.TypeList, Computed: true, Description: "An array that contains metadata for each secret version.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The ID of the secret version.", }, - "creation_date": &schema.Schema{ + "creation_date": { Type: schema.TypeString, Computed: true, Description: "The date that the version of the secret was created.", }, - "created_by": &schema.Schema{ + "created_by": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for the entity that created the secret.", }, - "auto_rotated": &schema.Schema{ + "auto_rotated": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether the version of the secret was created by automatic rotation.", @@ -160,46 +162,46 @@ func dataSourceIBMSecretsManagerSecrets() *schema.Resource { }, }, }, - "expiration_date": &schema.Schema{ + "expiration_date": { Type: schema.TypeString, Computed: true, Description: "The date the secret material expires. The date format follows RFC 3339.You can set an expiration date on supported secret types at their creation. If you create a secret without specifying an expiration date, the secret does not expire. The `expiration_date` field is supported for the following secret types:- `arbitrary`- `username_password`.", }, - "payload": &schema.Schema{ + "payload": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The new secret data to assign to an `arbitrary` secret.", }, - "secret_data": &schema.Schema{ + "secret_data": { Type: schema.TypeMap, Sensitive: true, Computed: true, Description: "The secret data object", }, - "username": &schema.Schema{ + "username": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The username to assign to this secret.", }, - "password": &schema.Schema{ + "password": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The password to assign to this secret.", }, - "next_rotation_date": &schema.Schema{ + "next_rotation_date": { Type: schema.TypeString, Computed: true, Description: "The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that can be auto-rotated and have an existing rotation policy.", }, - "ttl": &schema.Schema{ + "ttl": { Type: schema.TypeString, Computed: true, Description: "The time-to-live (TTL) or lease duration to assign to generated credentials.For `iam_credentials` secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as `120m` or `24h`.", }, - "access_groups": &schema.Schema{ + "access_groups": { Type: schema.TypeList, Computed: true, Description: "The access groups that define the capabilities of the service ID and API key that are generated for an`iam_credentials` secret.**Tip:** To find the ID of an access group, go to **Manage > Access (IAM) > Access groups** in the IBM Cloud console. Select the access group to inspect, and click **Details** to view its ID.", @@ -207,18 +209,18 @@ func dataSourceIBMSecretsManagerSecrets() *schema.Resource { Type: schema.TypeString, }, }, - "api_key": &schema.Schema{ + "api_key": { Type: schema.TypeString, Computed: true, Sensitive: true, Description: "The API key that is generated for this secret.After the secret reaches the end of its lease (see the `ttl` field), the API key is deleted automatically. If you want to continue to use the same API key for future read operations, see the `reuse_api_key` field.", }, - "service_id": &schema.Schema{ + "service_id": { Type: schema.TypeString, Computed: true, Description: "The service ID under which the API key (see the `api_key` field) is created. This service ID is added to the access groups that you assign for this secret.", }, - "reuse_api_key": &schema.Schema{ + "reuse_api_key": { Type: schema.TypeBool, Computed: true, Description: "(IAM credentials) Reuse the service ID and API key for future read operations.", @@ -230,42 +232,42 @@ func dataSourceIBMSecretsManagerSecrets() *schema.Resource { } } -func datasourceIBMSecretsManagerSecretsValidator() *ResourceValidator { +func DataSourceIBMSecretsManagerSecretsValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) secretType := "arbitrary, iam_credentials, username_password" endpointType := "public, private" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "secret_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: secretType}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "endpoint_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: endpointType}) - ibmSecretsManagerSecretsdatasourceValidator := ResourceValidator{ResourceName: "ibm_secrets_manager_secrets", Schema: validateSchema} + ibmSecretsManagerSecretsdatasourceValidator := validate.ResourceValidator{ResourceName: "ibm_secrets_manager_secrets", Schema: validateSchema} return &ibmSecretsManagerSecretsdatasourceValidator } func dataSourceIBMSecretsManagerSecretsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - bluemixSession, err := meta.(ClientSession).BluemixSession() + bluemixSession, err := meta.(conns.ClientSession).BluemixSession() if err != nil { return diag.FromErr(err) } region := bluemixSession.Config.Region - secretsManagerClient, err := meta.(ClientSession).SecretsManagerV1() + secretsManagerClient, err := meta.(conns.ClientSession).SecretsManagerV1() if err != nil { return diag.FromErr(err) } - rContollerClient, err := meta.(ClientSession).ResourceControllerAPIV2() + rContollerClient, err := meta.(conns.ClientSession).ResourceControllerAPIV2() if err != nil { return diag.FromErr(err) } @@ -290,10 +292,10 @@ func dataSourceIBMSecretsManagerSecretsRead(context context.Context, d *schema.R } else { smEndpointURL = "https://" + instanceID + "." + region + ".secrets-manager.appdomain.cloud" } - smUrl := envFallBack([]string{"IBMCLOUD_SECRETS_MANAGER_API_ENDPOINT"}, smEndpointURL) + smUrl := conns.EnvFallBack([]string{"IBMCLOUD_SECRETS_MANAGER_API_ENDPOINT"}, smEndpointURL) secretsManagerClient.Service.Options.URL = smUrl } else { - return diag.FromErr(fmt.Errorf("Invalid or unsupported service Instance")) + return diag.FromErr(fmt.Errorf("[ERROR] Invalid or unsupported service Instance")) } listAllSecretsOptions := &secretsmanagerv1.ListAllSecretsOptions{} @@ -337,14 +339,14 @@ func dataSourceIBMSecretsManagerSecretsRead(context context.Context, d *schema.R if listSecrets.Metadata != nil { err = d.Set("metadata", dataSourceListSecretsFlattenMetadata(*listSecrets.Metadata)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting metadata %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting metadata %s", err)) } } if listSecrets.Resources != nil { err = d.Set("secrets", dataSourceListSecretsFlattenResources(listSecrets.Resources)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resources %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resources %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/README.md b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/README.md new file mode 100644 index 0000000000..55422f7067 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/README.md @@ -0,0 +1,11 @@ +# Terraform IBM Provider Transit Gateway Services + +This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. + + +## Handy Links +* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! +* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) +* IBM Provider Docs: [One of the TG resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/tg_connection) +* IBM API Docs: [IBM API Docs for TG](https://cloud.ibm.com/apidocs/transit-gateway) +* IBM TG SDK: [IBM SDK for TG](https://github.com/IBM/networking-go-sdk/tree/master/transitgatewayapisv1) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_gateway.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_gateway.go index 2b168a40ec..e8f183eab1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_gateway.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package transitgateway import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/transitgatewayapisv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,9 +15,10 @@ import ( const ( tgConnName = "name" tgConnections = "connections" + ID = "id" ) -func dataSourceIBMTransitGateway() *schema.Resource { +func DataSourceIBMTransitGateway() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMTransitGatewayRead, @@ -25,7 +27,7 @@ func dataSourceIBMTransitGateway() *schema.Resource { Type: schema.TypeString, Required: true, Description: "The Transit Gateway identifier", - ValidateFunc: InvokeValidator("ibm_tg_gateway", tgName), + ValidateFunc: validate.InvokeValidator("ibm_tg_gateway", tgName), }, tgCrn: { Type: schema.TypeString, @@ -147,7 +149,7 @@ func dataSourceIBMTransitGatewayRead(d *schema.ResourceData, meta interface{}) e listTransitGatewaysOptionsModel := &transitgatewayapisv1.ListTransitGatewaysOptions{} listTransitGateways, response, err := client.ListTransitGateways(listTransitGatewaysOptionsModel) if err != nil { - return fmt.Errorf("Error while listing transit gateways %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while listing transit gateways %s\n%s", err, response) } gwName := d.Get(tgName).(string) @@ -176,8 +178,7 @@ func dataSourceIBMTransitGatewayRead(d *schema.ResourceData, meta interface{}) e } if !foundGateway { - return fmt.Errorf( - "Couldn't find any gateway with the specified name: (%s)", gwName) + return fmt.Errorf("[ERROR] Couldn't find any gateway with the specified name: (%s)", gwName) } return dataSourceIBMTransitGatewayConnectionsRead(d, meta) @@ -196,7 +197,7 @@ func dataSourceIBMTransitGatewayConnectionsRead(d *schema.ResourceData, meta int listTransitGatewayConnectionsOptions.SetTransitGatewayID(tgGatewayId) listTGConnections, response, err := client.ListTransitGatewayConnections(listTransitGatewayConnectionsOptions) if err != nil { - return fmt.Errorf("Error while listing transit gateway connections %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while listing transit gateway connections %s\n%s", err, response) } connections := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_gateways.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_gateways.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_gateways.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_gateways.go index 847d0f3999..e0f2bf0adc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_gateways.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_gateways.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package transitgateway import ( "fmt" @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMTransitGateways() *schema.Resource { +func DataSourceIBMTransitGateways() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMTransitGatewaysRead, @@ -75,7 +75,7 @@ func dataSourceIBMTransitGatewaysRead(d *schema.ResourceData, meta interface{}) listTransitGatewaysOptionsModel := &transitgatewayapisv1.ListTransitGatewaysOptions{} listTransitGateways, response, err := client.ListTransitGateways(listTransitGatewaysOptionsModel) if err != nil { - return fmt.Errorf("Error while listing transit gateways %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while listing transit gateways %s\n%s", err, response) } tgws := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_location.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_location.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_location.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_location.go index 727517cc82..e27f7fd96d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_location.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_location.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package transitgateway import ( "fmt" @@ -16,7 +16,7 @@ const ( tgLocationsDisplayName = "display_name" ) -func dataSourceIBMTransitGatewaysLocation() *schema.Resource { +func DataSourceIBMTransitGatewaysLocation() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMTransitGatewaysLocationRead, Schema: map[string]*schema.Schema{ @@ -76,7 +76,7 @@ func dataSourceIBMTransitGatewaysLocationRead(d *schema.ResourceData, meta inter detailGatewayLocationOptionsModel.Name = &locName detailTransitGatewayLocation, response, err := client.GetGatewayLocation(detailGatewayLocationOptionsModel) if err != nil { - return fmt.Errorf("Error while fetching transit gateway detailed location: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while fetching transit gateway detailed location: %s\n%s", err, response) } if detailTransitGatewayLocation != nil { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_locations.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_locations.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_locations.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_locations.go index de0bdb4e91..37b9bbb83d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_tg_locations.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_locations.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package transitgateway import ( "fmt" @@ -18,7 +18,7 @@ const ( tgLocationsType = "type" ) -func dataSourceIBMTransitGatewaysLocations() *schema.Resource { +func DataSourceIBMTransitGatewaysLocations() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMTransitGatewaysLocationsRead, @@ -61,7 +61,7 @@ func dataSourceIBMTransitGatewaysLocationsRead(d *schema.ResourceData, meta inte listTransitGatewayLocationsOptionsModel := &transitgatewayapisv1.ListGatewayLocationsOptions{} listTransitGatewayLocations, response, err := client.ListGatewayLocations(listTransitGatewayLocationsOptionsModel) if err != nil { - return fmt.Errorf("Error while fetching transit gateways locations: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while fetching transit gateways locations: %s\n%s", err, response) } tgLocationsCol := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_route_report.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_route_report.go new file mode 100644 index 0000000000..ef0e994d96 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_route_report.go @@ -0,0 +1,237 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package transitgateway + +import ( + "fmt" + "github.com/IBM/networking-go-sdk/transitgatewayapisv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + tgRouteReport = "route_report" +) + +func DataSourceIBMTransitGatewayRouteReport() *schema.Resource { + + return &schema.Resource{ + Read: dataSourceIBMTransitGatewayRouteReportRead, + Schema: map[string]*schema.Schema{ + tgGatewayId: { + Type: schema.TypeString, + Required: true, + Description: "The Transit Gateway identifier", + }, + tgRouteReport: { + Type: schema.TypeString, + Required: true, + Description: "The Transit Gateway Route Report identifier", + }, + tgRouteReportConnections: { + Type: schema.TypeList, + Description: "Collection of transit gateway connections", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionBgps: { + Type: schema.TypeList, + Description: "Collection of transit gateway connection's bgps", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionBgpAsPath: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionBgpIsUsed: { + Type: schema.TypeBool, + Computed: true, + }, + tgRouteReportConnectionBgpLocalPreference: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionBgpPrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + ID: { + Type: schema.TypeString, + Computed: true, + }, + tgConnName: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionType: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionRoutes: { + Type: schema.TypeList, + Description: "Collection of transit gateway connection's used routes", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionRoutePrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + tgCreatedAt: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportOverlappingRoutes: { + Type: schema.TypeList, + Description: "Collection of transit gateway overlapping routes", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportOverlappingRoutesDetail: { + Type: schema.TypeList, + Description: "Collection of transit gateway overlapping route's details", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgConnectionId: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportOverlappingPrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + tgStatus: { + Type: schema.TypeString, + Computed: true, + }, + tgUpdatedAt: { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceIBMTransitGatewayRouteReportRead(d *schema.ResourceData, meta interface{}) error { + + client, err := transitgatewayClient(meta) + if err != nil { + return err + } + + gatewayId := d.Get(tgGatewayId).(string) + routeReportId := d.Get(tgRouteReport).(string) + + getTransitGatewayRouteReportOptionsModel := &transitgatewayapisv1.GetTransitGatewayRouteReportOptions{} + getTransitGatewayRouteReportOptionsModel.SetTransitGatewayID(gatewayId) + getTransitGatewayRouteReportOptionsModel.SetID(routeReportId) + routeReport, response, err := client.GetTransitGatewayRouteReport(getTransitGatewayRouteReportOptionsModel) + if err != nil { + return fmt.Errorf("Error while retrieving transit gateway route report %s\n%s", err, response) + } + + d.Set(tgRouteReport, routeReport.ID) + d.SetId(*routeReport.ID) + d.Set(tgStatus, routeReport.Status) + d.Set(tgCreatedAt, routeReport.CreatedAt.String()) + if routeReport.UpdatedAt != nil { + d.Set(tgUpdatedAt, routeReport.UpdatedAt.String()) + } + + connections := make([]map[string]interface{}, 0) + for _, connection := range routeReport.Connections { + tgConn := map[string]interface{}{} + + // Set connection info + if connection.ID != nil { + tgConn[ID] = *connection.ID + } + if connection.Name != nil { + tgConn[tgConnName] = *connection.Name + } + if connection.Type != nil { + tgConn[tgRouteReportConnectionType] = *connection.Type + } + + // set bgps + bgps := make([]map[string]interface{}, 0) + for _, bgp := range connection.Bgps { + tgConnBgp := map[string]interface{}{} + + if bgp.AsPath != nil { + tgConnBgp[tgRouteReportConnectionBgpAsPath] = *bgp.AsPath + } + if bgp.IsUsed != nil { + tgConnBgp[tgRouteReportConnectionBgpIsUsed] = *bgp.IsUsed + } + if bgp.LocalPreference != nil { + tgConnBgp[tgRouteReportConnectionBgpLocalPreference] = *bgp.LocalPreference + } + if bgp.Prefix != nil { + tgConnBgp[tgRouteReportConnectionBgpPrefix] = *bgp.Prefix + } + + bgps = append(bgps, tgConnBgp) + } + tgConn[tgRouteReportConnectionBgps] = bgps + + // Set connection routes + routes := make([]map[string]interface{}, 0) + for _, route := range connection.Routes { + tgConnRoute := map[string]interface{}{} + + if route.Prefix != nil { + tgConnRoute[tgRouteReportConnectionRoutePrefix] = *route.Prefix + } + + routes = append(routes, tgConnRoute) + } + tgConn[tgRouteReportConnectionRoutes] = routes + + connections = append(connections, tgConn) + } + d.Set(tgRouteReportConnections, connections) + + // Set overlapping route details + overlappingRoutes := make([]map[string]interface{}, 0) + for _, overlap := range routeReport.OverlappingRoutes { + tgRoutes := map[string]interface{}{} + + routes := make([]map[string]interface{}, 0) + for _, routeDetail := range overlap.Routes { + tgRoutesDetail := map[string]interface{}{} + + if routeDetail.ConnectionID != nil { + tgRoutesDetail[tgConnectionId] = *routeDetail.ConnectionID + } + if routeDetail.Prefix != nil { + tgRoutesDetail[tgRouteReportOverlappingPrefix] = *routeDetail.Prefix + } + + routes = append(routes, tgRoutesDetail) + } + tgRoutes[tgRouteReportOverlappingRoutesDetail] = routes + + overlappingRoutes = append(overlappingRoutes, tgRoutes) + } + d.Set(tgRouteReportOverlappingRoutes, overlappingRoutes) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_route_reports.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_route_reports.go new file mode 100644 index 0000000000..f1ce3b2fbd --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/data_source_ibm_tg_route_reports.go @@ -0,0 +1,273 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package transitgateway + +import ( + "fmt" + "time" + + "github.com/IBM/networking-go-sdk/transitgatewayapisv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + tgRouteReports = "route_reports" + tgRouteReportConnections = "connections" + tgRouteReportOverlappingRoutes = "overlapping_routes" + tgRouteReportOverlappingRoutesDetail = "routes" + tgRouteReportConnectionBgps = "bgps" + tgRouteReportConnectionBgpAsPath = "as_path" + tgRouteReportConnectionBgpIsUsed = "is_used" + tgRouteReportConnectionBgpLocalPreference = "local_preference" + tgRouteReportConnectionBgpPrefix = "prefix" + tgRouteReportConnectionRoutes = "routes" + tgRouteReportConnectionRoutePrefix = "prefix" + tgRouteReportConnectionType = "type" + tgRouteReportOverlappingPrefix = "prefix" +) + +func DataSourceIBMTransitGatewayRouteReports() *schema.Resource { + + return &schema.Resource{ + Read: dataSourceIBMTransitGatewayRouteReportsRead, + Schema: map[string]*schema.Schema{ + + tgGatewayId: { + Type: schema.TypeString, + Required: true, + Description: "The Transit Gateway identifier", + }, + + tgRouteReports: { + Type: schema.TypeList, + Description: "Collection of transit gateway route reports", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgID: { + Type: schema.TypeString, + Computed: true, + }, + + tgRouteReportConnections: { + Type: schema.TypeList, + Description: "Collection of transit gateway connections", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionBgps: { + Type: schema.TypeList, + Description: "Collection of transit gateway connection's bgps", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionBgpAsPath: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionBgpIsUsed: { + Type: schema.TypeBool, + Computed: true, + }, + tgRouteReportConnectionBgpLocalPreference: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionBgpPrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + ID: { + Type: schema.TypeString, + Computed: true, + }, + tgConnName: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionType: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionRoutes: { + Type: schema.TypeList, + Description: "Collection of transit gateway connection's used routes", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionRoutePrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + + tgCreatedAt: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportOverlappingRoutes: { + Type: schema.TypeList, + Description: "Collection of transit gateway overlapping routes", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportOverlappingRoutesDetail: { + Type: schema.TypeList, + Description: "Collection of transit gateway overlapping route's details", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgConnectionId: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportOverlappingPrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + tgStatus: { + Type: schema.TypeString, + Computed: true, + }, + tgUpdatedAt: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMTransitGatewayRouteReportsRead(d *schema.ResourceData, meta interface{}) error { + + client, err := transitgatewayClient(meta) + if err != nil { + return err + } + + gatewayId := d.Get(tgGatewayId).(string) + + listTransitGatewayRouteReportsOptionsModel := &transitgatewayapisv1.ListTransitGatewayRouteReportsOptions{} + listTransitGatewayRouteReportsOptionsModel.SetTransitGatewayID(gatewayId) + listTransitGatewayRouteReports, response, err := client.ListTransitGatewayRouteReports(listTransitGatewayRouteReportsOptionsModel) + if err != nil { + return fmt.Errorf("Error while listing transit gateway route reports %s\n%s", err, response) + } + + reports := make([]map[string]interface{}, 0) + for _, routeReport := range listTransitGatewayRouteReports.RouteReports { + tgReport := map[string]interface{}{} + tgReport[tgID] = routeReport.ID + tgReport[tgCreatedAt] = routeReport.CreatedAt.String() + tgReport[tgStatus] = routeReport.Status + + if routeReport.UpdatedAt != nil { + tgReport[tgUpdatedAt] = routeReport.UpdatedAt.String() + } + + connections := make([]map[string]interface{}, 0) + for _, connection := range routeReport.Connections { + tgConn := map[string]interface{}{} + + // Set connection info + if connection.ID != nil { + tgConn[ID] = *connection.ID + } + if connection.Name != nil { + tgConn[tgConnName] = *connection.Name + } + if connection.Type != nil { + tgConn[tgRouteReportConnectionType] = *connection.Type + } + + // set bgps + bgps := make([]map[string]interface{}, 0) + for _, bgp := range connection.Bgps { + tgConnBgp := map[string]interface{}{} + + if bgp.AsPath != nil { + tgConnBgp[tgRouteReportConnectionBgpAsPath] = *bgp.AsPath + } + if bgp.IsUsed != nil { + tgConnBgp[tgRouteReportConnectionBgpIsUsed] = *bgp.IsUsed + } + if bgp.LocalPreference != nil { + tgConnBgp[tgRouteReportConnectionBgpLocalPreference] = *bgp.LocalPreference + } + if bgp.Prefix != nil { + tgConnBgp[tgRouteReportConnectionBgpPrefix] = *bgp.Prefix + } + + bgps = append(bgps, tgConnBgp) + } + tgConn[tgRouteReportConnectionBgps] = bgps + + // Set connection routes + routes := make([]map[string]interface{}, 0) + for _, route := range connection.Routes { + tgConnRoute := map[string]interface{}{} + + if route.Prefix != nil { + tgConnRoute[tgRouteReportConnectionRoutePrefix] = *route.Prefix + } + + routes = append(routes, tgConnRoute) + } + tgConn[tgRouteReportConnectionRoutes] = routes + + connections = append(connections, tgConn) + } + tgReport[tgRouteReportConnections] = connections + + // Set overlapping route details + overlappingRoutes := make([]map[string]interface{}, 0) + for _, overlap := range routeReport.OverlappingRoutes { + tgRoutes := map[string]interface{}{} + + routes := make([]map[string]interface{}, 0) + for _, routeDetail := range overlap.Routes { + tgRoutesDetail := map[string]interface{}{} + + if routeDetail.ConnectionID != nil { + tgRoutesDetail[tgConnectionId] = *routeDetail.ConnectionID + } + if routeDetail.Prefix != nil { + tgRoutesDetail[tgRouteReportOverlappingPrefix] = *routeDetail.Prefix + } + + routes = append(routes, tgRoutesDetail) + } + tgRoutes[tgRouteReportOverlappingRoutesDetail] = routes + + overlappingRoutes = append(overlappingRoutes, tgRoutes) + } + tgReport[tgRouteReportOverlappingRoutes] = overlappingRoutes + + reports = append(reports, tgReport) + } + d.Set(tgRouteReports, reports) + d.SetId(dataSourceIBMTransitGatewayRouteReportsID(d)) + return nil +} + +// dataSourceIBMTransitGatewayRouteReportsID returns a reasonable ID for a transit gateways list. +func dataSourceIBMTransitGatewayRouteReportsID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_tg_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_tg_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway.go index 1fb9c97b17..170dfeec8b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_tg_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package transitgateway import ( "context" @@ -10,6 +10,9 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/transitgatewayapisv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -35,7 +38,7 @@ const ( isTransitGatewayDeleted = "done" ) -func resourceIBMTransitGateway() *schema.Resource { +func ResourceIBMTransitGateway() *schema.Resource { return &schema.Resource{ Create: resourceIBMTransitGatewayCreate, Read: resourceIBMTransitGatewayRead, @@ -52,7 +55,7 @@ func resourceIBMTransitGateway() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -69,7 +72,7 @@ func resourceIBMTransitGateway() *schema.Resource { Required: true, ForceNew: false, Description: "Name Transit Gateway Services", - ValidateFunc: InvokeValidator("ibm_tg_gateway", tgName), + ValidateFunc: validate.InvokeValidator("ibm_tg_gateway", tgName), }, tgGlobal: { @@ -84,8 +87,8 @@ func resourceIBMTransitGateway() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_tg_gateway", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_tg_gateway", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the transit gateway instance", }, @@ -115,31 +118,31 @@ func resourceIBMTransitGateway() *schema.Resource { Description: "The Status of the resource", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -148,36 +151,36 @@ func resourceIBMTransitGateway() *schema.Resource { } } -func resourceIBMTGValidator() *ResourceValidator { +func ResourceIBMTGValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: tgName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, AllowedValues: `^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$}`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmTGResourceValidator := ResourceValidator{ResourceName: "ibm_tg_gateway", Schema: validateSchema} + ibmTGResourceValidator := validate.ResourceValidator{ResourceName: "ibm_tg_gateway", Schema: validateSchema} return &ibmTGResourceValidator } func transitgatewayClient(meta interface{}) (*transitgatewayapisv1.TransitGatewayApisV1, error) { - sess, err := meta.(ClientSession).TransitGatewayV1API() + sess, err := meta.(conns.ClientSession).TransitGatewayV1API() return sess, err } @@ -220,7 +223,7 @@ func resourceIBMTransitGatewayCreate(d *schema.ResourceData, meta interface{}) e v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(tgGatewayTags); ok || v != "" { oldList, newList := d.GetChange(tgGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *tgw.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *tgw.Crn) if err != nil { log.Printf( "Error on create of transit gateway (%s) tags: %s", d.Id(), err) @@ -251,7 +254,7 @@ func isTransitGatewayRefreshFunc(client *transitgatewayapisv1.TransitGatewayApis } transitGateway, response, err := client.GetTransitGateway(gettgwoptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Transit Gateway: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Transit Gateway: %s\n%s", err, response) } if *transitGateway.Status == "available" || *transitGateway.Status == "failed" { @@ -294,26 +297,26 @@ func resourceIBMTransitGatewayRead(d *schema.ResourceData, meta interface{}) err d.Set(tgGlobal, tgw.Global) d.Set(tgStatus, tgw.Status) - tags, err := GetTagsUsingCRN(meta, *tgw.Crn) + tags, err := flex.GetTagsUsingCRN(meta, *tgw.Crn) if err != nil { log.Printf( "Error on get of transit gateway (%s) tags: %s", d.Id(), err) } d.Set(tgGatewayTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/interconnectivity/transit") - d.Set(ResourceName, *tgw.Name) - d.Set(ResourceCRN, *tgw.Crn) - d.Set(ResourceStatus, *tgw.Status) + d.Set(flex.ResourceControllerURL, controller+"/interconnectivity/transit") + d.Set(flex.ResourceName, *tgw.Name) + d.Set(flex.ResourceCRN, *tgw.Crn) + d.Set(flex.ResourceStatus, *tgw.Status) if tgw.ResourceGroup != nil { rg := tgw.ResourceGroup d.Set(tgResourceGroup, *rg.ID) - d.Set(ResourceGroupName, *rg.ID) + d.Set(flex.ResourceGroupName, *rg.ID) } return nil } @@ -352,7 +355,7 @@ func resourceIBMTransitGatewayUpdate(d *schema.ResourceData, meta interface{}) e } if d.HasChange(tgGatewayTags) { oldList, newList := d.GetChange(tgGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *tgw.Crn) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *tgw.Crn) if err != nil { log.Printf( "Error on update of transit gateway (%s) tags: %s", ID, err) @@ -385,7 +388,7 @@ func resourceIBMTransitGatewayDelete(d *schema.ResourceData, meta interface{}) e if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error deleting Transit Gateway (%s): %s\n%s", ID, err, response) + return fmt.Errorf("[ERROR] Error deleting Transit Gateway (%s): %s\n%s", ID, err, response) } _, err = isWaitForTransitGatewayDeleted(client, ID, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -421,7 +424,7 @@ func isTransitGatewayDeleteRefreshFunc(client *transitgatewayapisv1.TransitGatew if response != nil && response.StatusCode == 404 { return transitGateway, isTransitGatewayDeleted, nil } - return nil, "", fmt.Errorf("Error Getting Transit Gateway: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Transit Gateway: %s\n%s", err, response) } return transitGateway, isTransitGatewayDeleting, err } @@ -446,7 +449,7 @@ func resourceIBMTransitGatewayExists(d *schema.ResourceData, meta interface{}) ( d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting Transit Gateway: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Transit Gateway: %s\n%s", err, response) } return true, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_tg_gateway_connection.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway_connection.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_tg_gateway_connection.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway_connection.go index 0f4b616e01..99cb295ff3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_tg_gateway_connection.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway_connection.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package transitgateway import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/networking-go-sdk/transitgatewayapisv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -39,7 +41,7 @@ const ( tgMtu = "mtu" ) -func resourceIBMTransitGatewayConnection() *schema.Resource { +func ResourceIBMTransitGatewayConnection() *schema.Resource { return &schema.Resource{ Create: resourceIBMTransitGatewayConnectionCreate, Read: resourceIBMTransitGatewayConnectionRead, @@ -70,14 +72,14 @@ func resourceIBMTransitGatewayConnection() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_tg_connection", tgNetworkType), + ValidateFunc: validate.InvokeValidator("ibm_tg_connection", tgNetworkType), Description: "Defines what type of network is connected via this connection. Allowable values (classic,directlink,vpc,gre_tunnel)", }, tgName: { Type: schema.TypeString, Optional: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_tg_connection", tgName), + ValidateFunc: validate.InvokeValidator("ibm_tg_connection", tgName), Description: "The user-defined name for this transit gateway. If unspecified, the name will be the network name (the name of the VPC in the case of network type 'vpc', and the word Classic, in the case of network type 'classic').", }, tgNetworkId: { @@ -163,7 +165,7 @@ func resourceIBMTransitGatewayConnection() *schema.Resource { Computed: true, Description: "Only visible for cross account connections, this field represents the status of the request to connect the given network between accounts.Possible values: [pending,approved,rejected,expired,detached]", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the transit gateway", @@ -171,28 +173,28 @@ func resourceIBMTransitGatewayConnection() *schema.Resource { }, } } -func resourceIBMTransitGatewayConnectionValidator() *ResourceValidator { +func ResourceIBMTransitGatewayConnectionValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) networkType := "classic, directlink, vpc, gre_tunnel" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: tgNetworkType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: networkType}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: tgName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmTransitGatewayConnectionResourceValidator := ResourceValidator{ResourceName: "ibm_tg_connection", Schema: validateSchema} + ibmTransitGatewayConnectionResourceValidator := validate.ResourceValidator{ResourceName: "ibm_tg_connection", Schema: validateSchema} return &ibmTransitGatewayConnectionResourceValidator } @@ -255,7 +257,7 @@ func resourceIBMTransitGatewayConnectionCreate(d *schema.ResourceData, meta inte tgConnections, response, err := client.CreateTransitGatewayConnection(createTransitGatewayConnectionOptions) if err != nil { - return fmt.Errorf("Create Transit Gateway connection err %s\n%s", err, response) + return fmt.Errorf("[ERROR] Create Transit Gateway connection err %s\n%s", err, response) } d.SetId(fmt.Sprintf("%s/%s", gatewayId, *tgConnections.ID)) @@ -289,9 +291,9 @@ func isWaitForTransitGatewayConnectionAvailable(client *transitgatewayapisv1.Tra func isTransitGatewayConnectionRefreshFunc(client *transitgatewayapisv1.TransitGatewayApisV1, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { - return nil, "", fmt.Errorf("Error Getting Transit Gateway connection: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error Getting Transit Gateway connection: %s", err) // return err } @@ -302,7 +304,7 @@ func isTransitGatewayConnectionRefreshFunc(client *transitgatewayapisv1.TransitG getTransitGatewayConnectionOptions.SetID(ID) tgConnection, response, err := client.GetTransitGatewayConnection(getTransitGatewayConnectionOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Transit Gateway Connection (%s): %s\n%s", ID, err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Transit Gateway Connection (%s): %s\n%s", ID, err, response) } if *tgConnection.Status == "attached" || *tgConnection.Status == "failed" { return tgConnection, isTransitGatewayConnectionAttached, nil @@ -317,7 +319,7 @@ func resourceIBMTransitGatewayConnectionRead(d *schema.ResourceData, meta interf if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -334,7 +336,7 @@ func resourceIBMTransitGatewayConnectionRead(d *schema.ResourceData, meta interf d.SetId("") return nil } - return fmt.Errorf("Error Getting Transit Gateway Connection (%s): %s\n%s", ID, err, response) + return fmt.Errorf("[ERROR] Error Getting Transit Gateway Connection (%s): %s\n%s", ID, err, response) } if instance.Name != nil { @@ -368,9 +370,9 @@ func resourceIBMTransitGatewayConnectionRead(d *schema.ResourceData, meta interf } tgw, response, err := client.GetTransitGateway(getTransitGatewayOptions) if err != nil { - return fmt.Errorf("Error Getting Transit Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Transit Gateway : %s\n%s", err, response) } - d.Set(RelatedCRN, *tgw.Crn) + d.Set(flex.RelatedCRN, *tgw.Crn) return nil } @@ -381,7 +383,7 @@ func resourceIBMTransitGatewayConnectionUpdate(d *schema.ResourceData, meta inte if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -396,7 +398,7 @@ func resourceIBMTransitGatewayConnectionUpdate(d *schema.ResourceData, meta inte _, response, err := client.GetTransitGatewayConnection(getTransitGatewayConnectionOptions) if err != nil { - return fmt.Errorf("Error Getting Transit Gateway Connection: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Transit Gateway Connection: %s\n%s", err, response) } updateTransitGatewayConnectionOptions := &transitgatewayapisv1.UpdateTransitGatewayConnectionOptions{} @@ -411,7 +413,7 @@ func resourceIBMTransitGatewayConnectionUpdate(d *schema.ResourceData, meta inte _, response, err = client.UpdateTransitGatewayConnection(updateTransitGatewayConnectionOptions) if err != nil { - return fmt.Errorf("Error in Update Transit Gateway Connection : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in Update Transit Gateway Connection : %s\n%s", err, response) } return resourceIBMTransitGatewayConnectionRead(d, meta) @@ -423,7 +425,7 @@ func resourceIBMTransitGatewayConnectionDelete(d *schema.ResourceData, meta inte if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -440,7 +442,7 @@ func resourceIBMTransitGatewayConnectionDelete(d *schema.ResourceData, meta inte if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error deleting Transit Gateway Connection(%s): %s\n%s", ID, err, response) + return fmt.Errorf("[ERROR] Error deleting Transit Gateway Connection(%s): %s\n%s", ID, err, response) } _, err = isWaitForTransitGatewayConnectionDeleted(client, d.Id(), d.Timeout(schema.TimeoutCreate)) @@ -470,9 +472,9 @@ func isWaitForTransitGatewayConnectionDeleted(client *transitgatewayapisv1.Trans func isTransitGatewayConnectionDeleteRefreshFunc(client *transitgatewayapisv1.TransitGatewayApisV1, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { log.Printf("[DEBUG] tg gateway connection delete function here") - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { - return nil, "", fmt.Errorf("Error Getting Transit Gateway connection: %s", err) + return nil, "", fmt.Errorf("[ERROR] Error Getting Transit Gateway connection: %s", err) } @@ -489,7 +491,7 @@ func isTransitGatewayConnectionDeleteRefreshFunc(client *transitgatewayapisv1.Tr return tgConnection, isTransitGatewayConnectionDeleted, nil } - return nil, "", fmt.Errorf("Error Getting Transit Gateway Connection (%s): %s\n%s", ID, err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Transit Gateway Connection (%s): %s\n%s", ID, err, response) } return tgConnection, isTransitGatewayConnectionDeleting, err } @@ -499,12 +501,12 @@ func resourceIBMTransitGatewayConnectionExists(d *schema.ResourceData, meta inte if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) < 2 { - return false, fmt.Errorf("Incorrect ID %s: Id should be a combination of gatewayID/ConnectionID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: Id should be a combination of gatewayID/ConnectionID", d.Id()) } gatewayId := parts[0] ID := parts[1] @@ -519,7 +521,7 @@ func resourceIBMTransitGatewayConnectionExists(d *schema.ResourceData, meta inte d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting Transit Gateway Connection: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Transit Gateway Connection: %s\n%s", err, response) } return true, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway_route_report.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway_route_report.go new file mode 100644 index 0000000000..fba669fced --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway/resource_ibm_tg_gateway_route_report.go @@ -0,0 +1,366 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package transitgateway + +import ( + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/networking-go-sdk/transitgatewayapisv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + tgRouteReportId = "route_report_id" + + isTransitGatewayRouteReportPending = "pending" + isTransitGatewayRouteReportDone = "complete" +) + +func ResourceIBMTransitGatewayRouteReport() *schema.Resource { + return &schema.Resource{ + Create: resourceIBMTransitGatewayRouteReportCreate, + Read: resourceIBMTransitGatewayRouteReportRead, + Delete: resourceIBMTransitGatewayRouteReportDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + tgGatewayId: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The Transit Gateway identifier", + }, + tgRouteReportId: { + Type: schema.TypeString, + Computed: true, + Description: "The Transit Gateway Route Report identifier", + }, + tgRouteReportConnections: { + Type: schema.TypeList, + Description: "Collection of transit gateway connections", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionBgps: { + Type: schema.TypeList, + Description: "Collection of transit gateway connection's bgps", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionBgpAsPath: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionBgpIsUsed: { + Type: schema.TypeBool, + Computed: true, + }, + tgRouteReportConnectionBgpLocalPreference: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionBgpPrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + ID: { + Type: schema.TypeString, + Computed: true, + }, + tgConnName: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionType: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportConnectionRoutes: { + Type: schema.TypeList, + Description: "Collection of transit gateway connection's used routes", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportConnectionRoutePrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + tgCreatedAt: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportOverlappingRoutes: { + Type: schema.TypeList, + Description: "Collection of transit gateway overlapping routes", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgRouteReportOverlappingRoutesDetail: { + Type: schema.TypeList, + Description: "Collection of transit gateway overlapping route's details", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + tgConnectionId: { + Type: schema.TypeString, + Computed: true, + }, + tgRouteReportOverlappingPrefix: { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + tgStatus: { + Type: schema.TypeString, + Computed: true, + }, + tgUpdatedAt: { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func resourceIBMTransitGatewayRouteReportCreate(d *schema.ResourceData, meta interface{}) error { + client, err := transitgatewayClient(meta) + if err != nil { + return err + } + + createTransitGatewayRouteReportOptions := &transitgatewayapisv1.CreateTransitGatewayRouteReportOptions{} + + gatewayId := d.Get(tgGatewayId).(string) + createTransitGatewayRouteReportOptions.SetTransitGatewayID(gatewayId) + + tgRouteReport, response, err := client.CreateTransitGatewayRouteReport(createTransitGatewayRouteReportOptions) + if err != nil { + return fmt.Errorf("Create Transit Gateway Route Report err %s\n%s", err, response) + } + + d.SetId(fmt.Sprintf("%s/%s", gatewayId, *tgRouteReport.ID)) + d.Set(tgRouteReportId, *tgRouteReport.ID) + + _, err = isWaitForTransitGatewayRouteReportAvailable(client, d.Id(), d.Timeout(schema.TimeoutCreate)) + if err != nil { + return err + } + + return resourceIBMTransitGatewayRouteReportRead(d, meta) +} + +func isWaitForTransitGatewayRouteReportAvailable(client *transitgatewayapisv1.TransitGatewayApisV1, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for transit gateway route report (%s) to be available.", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"retry", isTransitGatewayRouteReportPending}, + Target: []string{isTransitGatewayRouteReportDone, ""}, + Refresh: isTransitGatewayRouteReportRefreshFunc(client, id), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isTransitGatewayRouteReportRefreshFunc(client *transitgatewayapisv1.TransitGatewayApisV1, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + parts, err := flex.IdParts(id) + if err != nil { + return nil, "", fmt.Errorf("Error Getting Transit Gateway Route Report: %s", err) + } + + gatewayId := parts[0] + ID := parts[1] + + getTransitGatewayRouteReportOptions := &transitgatewayapisv1.GetTransitGatewayRouteReportOptions{} + getTransitGatewayRouteReportOptions.SetTransitGatewayID(gatewayId) + getTransitGatewayRouteReportOptions.SetID(ID) + + routeReport, response, getRouteErr := client.GetTransitGatewayRouteReport(getTransitGatewayRouteReportOptions) + if getRouteErr != nil { + return nil, "", fmt.Errorf("Error Getting Transit Gateway Route Report: %s\n%s", err, response) + } + + if *routeReport.Status == "complete" { + return routeReport, isTransitGatewayRouteReportDone, nil + } + + return routeReport, isTransitGatewayRouteReportPending, nil + } +} + +func resourceIBMTransitGatewayRouteReportRead(d *schema.ResourceData, meta interface{}) error { + + client, err := transitgatewayClient(meta) + if err != nil { + return err + } + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + + gatewayId := parts[0] + ID := parts[1] + + getTransitGatewayRouteReportOptions := &transitgatewayapisv1.GetTransitGatewayRouteReportOptions{} + getTransitGatewayRouteReportOptions.SetTransitGatewayID(gatewayId) + getTransitGatewayRouteReportOptions.SetID(ID) + instance, response, err := client.GetTransitGatewayRouteReport(getTransitGatewayRouteReportOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("Error Getting Transit Gateway Route Report (%s): %s\n%s", ID, err, response) + } + + d.Set(tgRouteReportId, *instance.ID) + d.Set(tgGatewayId, gatewayId) + + if instance.Status != nil { + d.Set(tgStatus, *instance.Status) + } + if instance.CreatedAt != nil { + d.Set(tgCreatedAt, instance.CreatedAt.String()) + } + if instance.UpdatedAt != nil { + d.Set(tgUpdatedAt, instance.UpdatedAt.String()) + } + + connections := make([]map[string]interface{}, 0) + for _, connection := range instance.Connections { + tgConn := map[string]interface{}{} + + // Set connection info + if connection.ID != nil { + tgConn[ID] = *connection.ID + } + if connection.Name != nil { + tgConn[tgConnName] = *connection.Name + } + if connection.Type != nil { + tgConn[tgRouteReportConnectionType] = *connection.Type + } + + // set bgps + bgps := make([]map[string]interface{}, 0) + for _, bgp := range connection.Bgps { + tgConnBgp := map[string]interface{}{} + + if bgp.AsPath != nil { + tgConnBgp[tgRouteReportConnectionBgpAsPath] = *bgp.AsPath + } + if bgp.IsUsed != nil { + tgConnBgp[tgRouteReportConnectionBgpIsUsed] = *bgp.IsUsed + } + if bgp.LocalPreference != nil { + tgConnBgp[tgRouteReportConnectionBgpLocalPreference] = *bgp.LocalPreference + } + if bgp.Prefix != nil { + tgConnBgp[tgRouteReportConnectionBgpPrefix] = *bgp.Prefix + } + + bgps = append(bgps, tgConnBgp) + } + tgConn[tgRouteReportConnectionBgps] = bgps + + // Set connection routes + routes := make([]map[string]interface{}, 0) + for _, route := range connection.Routes { + tgConnRoute := map[string]interface{}{} + + if route.Prefix != nil { + tgConnRoute[tgRouteReportConnectionRoutePrefix] = *route.Prefix + } + + routes = append(routes, tgConnRoute) + } + tgConn[tgRouteReportConnectionRoutes] = routes + + connections = append(connections, tgConn) + } + d.Set(tgRouteReportConnections, connections) + + // Set overlapping route details + overlappingRoutes := make([]map[string]interface{}, 0) + for _, overlap := range instance.OverlappingRoutes { + tgRoutes := map[string]interface{}{} + + routes := make([]map[string]interface{}, 0) + for _, routeDetail := range overlap.Routes { + tgRoutesDetail := map[string]interface{}{} + + if routeDetail.ConnectionID != nil { + tgRoutesDetail[tgConnectionId] = *routeDetail.ConnectionID + } + if routeDetail.Prefix != nil { + tgRoutesDetail[tgRouteReportOverlappingPrefix] = *routeDetail.Prefix + } + + routes = append(routes, tgRoutesDetail) + } + tgRoutes[tgRouteReportOverlappingRoutesDetail] = routes + + overlappingRoutes = append(overlappingRoutes, tgRoutes) + } + d.Set(tgRouteReportOverlappingRoutes, overlappingRoutes) + + return nil +} + +func resourceIBMTransitGatewayRouteReportDelete(d *schema.ResourceData, meta interface{}) error { + + client, err := transitgatewayClient(meta) + if err != nil { + return err + } + parts, err := flex.IdParts(d.Id()) + if err != nil { + return err + } + + gatewayId := parts[0] + ID := parts[1] + deleteTransitGatewayRouteReportOptions := &transitgatewayapisv1.DeleteTransitGatewayRouteReportOptions{ + ID: &ID, + } + deleteTransitGatewayRouteReportOptions.SetTransitGatewayID(gatewayId) + response, err := client.DeleteTransitGatewayRouteReport(deleteTransitGatewayRouteReportOptions) + + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("Error deleting Transit Gateway Route Report(%s): %s\n%s", ID, err, response) + } + + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server.go new file mode 100644 index 0000000000..f96b7167fb --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server.go @@ -0,0 +1,600 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "reflect" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMIsBareMetalServer() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerRead, + + Schema: map[string]*schema.Schema{ + "identifier": { + Type: schema.TypeString, + Optional: true, + Computed: true, + AtLeastOneOf: []string{isBareMetalServerName, "identifier"}, + ConflictsWith: []string{isBareMetalServerName}, + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_bare_metal_server", "identifier"), + }, + isBareMetalServerName: { + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: []string{isBareMetalServerName, "identifier"}, + Computed: true, + ConflictsWith: []string{"identifier"}, + ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", isBareMetalServerName), + Description: "Bare metal server name", + }, + isBareMetalServerBandwidth: { + Type: schema.TypeInt, + Computed: true, + Description: "The total bandwidth (in megabits per second)", + }, + isBareMetalServerBootTarget: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerCreatedAt: { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the bare metal server was created", + }, + isBareMetalServerCPU: { + Type: schema.TypeList, + Computed: true, + Description: "The bare metal server CPU configuration", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerCPUArchitecture: { + Type: schema.TypeString, + Computed: true, + Description: "The CPU architecture", + }, + isBareMetalServerCPUCoreCount: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of cores", + }, + isBareMetalServerCpuSocketCount: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of CPU sockets", + }, + isBareMetalServerCpuThreadPerCore: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of hardware threads per core", + }, + }, + }, + }, + isBareMetalServerCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this bare metal server", + }, + isBareMetalServerDisks: { + Type: schema.TypeList, + Computed: true, + Description: "The disks for this bare metal server, including any disks that are associated with the boot_target.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerDiskHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server disk", + }, + isBareMetalServerDiskID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerDiskInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + }, + isBareMetalServerDiskName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this disk", + }, + isBareMetalServerDiskResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type", + }, + isBareMetalServerDiskSize: { + Type: schema.TypeInt, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + }, + }, + }, + }, + isBareMetalServerHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server", + }, + isBareMetalServerMemory: { + Type: schema.TypeInt, + Computed: true, + Description: "The amount of memory, truncated to whole gibibytes", + }, + + isBareMetalServerPrimaryNetworkInterface: { + Type: schema.TypeList, + Computed: true, + Description: "Primary Network interface info", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + Deprecated: "This field is deprected", + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Deprecated: "This URL of the interface", + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Computed: true, + Description: "IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + }, + }, + }, + + isBareMetalServerNetworkInterfaces: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Computed: true, + Description: "IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + }, + }, + }, + + isBareMetalServerKeys: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "SSH key Ids for the bare metal server", + }, + + isBareMetalServerImage: { + Type: schema.TypeString, + Computed: true, + Description: "image name", + }, + isBareMetalServerProfile: { + Type: schema.TypeString, + Computed: true, + Description: "profil name", + }, + + isBareMetalServerZone: { + Type: schema.TypeString, + Computed: true, + Description: "Zone name", + }, + + isBareMetalServerVPC: { + Type: schema.TypeString, + Computed: true, + Description: "The VPC the bare metal server is to be a part of", + }, + + isBareMetalServerResourceGroup: { + Type: schema.TypeString, + Computed: true, + Description: "Resource group name", + }, + isBareMetalServerResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "Resource type name", + }, + + isBareMetalServerStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Bare metal server status", + }, + + isBareMetalServerStatusReasons: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerStatusReasonsCode: { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason", + }, + + isBareMetalServerStatusReasonsMessage: { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason", + }, + }, + }, + }, + isBareMetalServerTags: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", "tag")}, + Set: flex.ResourceIBMVPCHash, + Description: "Tags for the Bare metal server", + }, + }, + } +} + +func DataSourceIBMIsBareMetalServerValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "identifier", + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerName, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) + + ibmISBMSDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_bare_metal_server", Schema: validateSchema} + return &ibmISBMSDataSourceValidator +} + +func dataSourceIBMISBareMetalServerRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Get("identifier").(string) + name := d.Get(isBareMetalServerName).(string) + + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + var bms *vpcv1.BareMetalServer + if id != "" { + options := &vpcv1.GetBareMetalServerOptions{} + options.ID = &id + server, response, err := sess.GetBareMetalServerWithContext(context, options) + if err != nil { + log.Printf("[DEBUG] GetBareMetalServerWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Bare Metal Server (%s): %s\n%s", id, err, response)) + } + bms = server + } else if name != "" { + options := &vpcv1.ListBareMetalServersOptions{} + options.Name = &name + bmservers, response, err := sess.ListBareMetalServersWithContext(context, options) + if err != nil { + log.Printf("[DEBUG] ListBareMetalServersWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error Listing Bare Metal Server (%s): %s\n%s", name, err, response)) + } + if len(bmservers.BareMetalServers) > 0 { + return diag.FromErr(fmt.Errorf("[ERROR] No bare metal servers found with name %s", name)) + } + bms = &bmservers.BareMetalServers[0] + } + + d.SetId(*bms.ID) + d.Set(isBareMetalServerBandwidth, bms.Bandwidth) + bmsBootTargetIntf := bms.BootTarget.(*vpcv1.BareMetalServerBootTarget) + bmsBootTarget := bmsBootTargetIntf.ID + d.Set(isBareMetalServerBootTarget, bmsBootTarget) + + // set keys and image using initialization + + optionsInitialization := &vpcv1.GetBareMetalServerInitializationOptions{ + ID: bms.ID, + } + + initialization, response, err := sess.GetBareMetalServerInitialization(optionsInitialization) + if err != nil || initialization == nil { + return diag.FromErr(fmt.Errorf("[Error] Error getting Bare Metal Server (%s) initialization : %s\n%s", *bms.ID, err, response)) + } + + d.Set(isBareMetalServerImage, initialization.Image.ID) + + keyListList := []string{} + for i := 0; i < len(initialization.Keys); i++ { + keyListList = append(keyListList, string(*(initialization.Keys[i].ID))) + } + d.Set(isBareMetalServerKeys, keyListList) + + cpuList := make([]map[string]interface{}, 0) + if bms.Cpu != nil { + currentCPU := map[string]interface{}{} + currentCPU[isBareMetalServerCPUArchitecture] = *bms.Cpu.Architecture + currentCPU[isBareMetalServerCPUCoreCount] = *bms.Cpu.CoreCount + currentCPU[isBareMetalServerCpuSocketCount] = *bms.Cpu.SocketCount + currentCPU[isBareMetalServerCpuThreadPerCore] = *bms.Cpu.ThreadsPerCore + cpuList = append(cpuList, currentCPU) + } + d.Set(isBareMetalServerCPU, cpuList) + if err = d.Set(isBareMetalServerCreatedAt, bms.CreatedAt.String()); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + if err = d.Set(isBareMetalServerCRN, bms.CRN); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) + } + + diskList := make([]map[string]interface{}, 0) + if bms.Disks != nil { + for _, disk := range bms.Disks { + currentDisk := map[string]interface{}{ + isBareMetalServerDiskHref: disk.Href, + isBareMetalServerDiskID: disk.ID, + isBareMetalServerDiskInterfaceType: disk.InterfaceType, + isBareMetalServerDiskName: disk.Name, + isBareMetalServerDiskResourceType: disk.ResourceType, + isBareMetalServerDiskSize: disk.Size, + } + diskList = append(diskList, currentDisk) + } + } + d.Set(isBareMetalServerDisks, diskList) + if err = d.Set(isBareMetalServerHref, bms.Href); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) + } + if err = d.Set(isBareMetalServerMemory, bms.Memory); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting memory: %s", err)) + } + if err = d.Set(isBareMetalServerName, *bms.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + if err = d.Set("identifier", *bms.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting identifier: %s", err)) + } + //pni + + if bms.PrimaryNetworkInterface != nil { + primaryNicList := make([]map[string]interface{}, 0) + currentPrimNic := map[string]interface{}{} + currentPrimNic["id"] = *bms.PrimaryNetworkInterface.ID + currentPrimNic[isBareMetalServerNicHref] = *bms.PrimaryNetworkInterface.Href + currentPrimNic[isBareMetalServerNicName] = *bms.PrimaryNetworkInterface.Name + currentPrimNic[isBareMetalServerNicHref] = *bms.PrimaryNetworkInterface.Href + currentPrimNic[isBareMetalServerNicSubnet] = *bms.PrimaryNetworkInterface.Subnet.ID + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *bms.PrimaryNetworkInterface.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + currentPrimNic[isBareMetalServerNicPrimaryIP] = primaryIpList + getnicoptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: bms.ID, + ID: bms.PrimaryNetworkInterface.ID, + } + bmsnic, response, err := sess.GetBareMetalServerNetworkInterface(getnicoptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting network interfaces attached to the bare metal server %s\n%s", err, response)) + } + + switch reflect.TypeOf(bmsnic).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + primNic := bmsnic.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + currentPrimNic[isInstanceNicAllowIPSpoofing] = *primNic.AllowIPSpoofing + if len(primNic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(primNic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(primNic.SecurityGroups[i].ID))) + } + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + primNic := bmsnic.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + currentPrimNic[isInstanceNicAllowIPSpoofing] = *primNic.AllowIPSpoofing + + if len(primNic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(primNic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(primNic.SecurityGroups[i].ID))) + } + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + } + + primaryNicList = append(primaryNicList, currentPrimNic) + d.Set(isBareMetalServerPrimaryNetworkInterface, primaryNicList) + } + + //ni + + interfacesList := make([]map[string]interface{}, 0) + for _, intfc := range bms.NetworkInterfaces { + if intfc.ID != nil && *intfc.ID != *bms.PrimaryNetworkInterface.ID { + currentNic := map[string]interface{}{} + currentNic["id"] = *intfc.ID + currentNic[isBareMetalServerNicHref] = *intfc.Href + currentNic[isBareMetalServerNicName] = *intfc.Name + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *intfc.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + currentNic[isBareMetalServerNicPrimaryIP] = primaryIpList + getnicoptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: bms.ID, + ID: intfc.ID, + } + bmsnicintf, response, err := sess.GetBareMetalServerNetworkInterface(getnicoptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting network interfaces attached to the bare metal server %s\n%s", err, response)) + } + + switch reflect.TypeOf(bmsnicintf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + bmsnic := bmsnicintf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + currentNic[isBareMetalServerNicAllowIPSpoofing] = *bmsnic.AllowIPSpoofing + currentNic[isBareMetalServerNicSubnet] = *bmsnic.Subnet.ID + if len(bmsnic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(bmsnic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(bmsnic.SecurityGroups[i].ID))) + } + currentNic[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + bmsnic := bmsnicintf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + currentNic[isBareMetalServerNicAllowIPSpoofing] = *bmsnic.AllowIPSpoofing + currentNic[isBareMetalServerNicSubnet] = *bmsnic.Subnet.ID + if len(bmsnic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(bmsnic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(bmsnic.SecurityGroups[i].ID))) + } + currentNic[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + } + interfacesList = append(interfacesList, currentNic) + } + } + d.Set(isBareMetalServerNetworkInterfaces, interfacesList) + + if err = d.Set(isBareMetalServerProfile, *bms.Profile.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile: %s", err)) + } + if bms.ResourceGroup != nil { + d.Set(isBareMetalServerResourceGroup, *bms.ResourceGroup.ID) + } + if err = d.Set(isBareMetalServerResourceType, bms.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) + } + if err = d.Set(isBareMetalServerStatus, *bms.Status); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) + } + statusReasonsList := make([]map[string]interface{}, 0) + if bms.StatusReasons != nil { + for _, sr := range bms.StatusReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR[isBareMetalServerStatusReasonsCode] = *sr.Code + currentSR[isBareMetalServerStatusReasonsMessage] = *sr.Message + statusReasonsList = append(statusReasonsList, currentSR) + } + } + } + d.Set(isBareMetalServerStatusReasons, statusReasonsList) + + if err = d.Set(isBareMetalServerVPC, *bms.VPC.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vpc: %s", err)) + } + if err = d.Set(isBareMetalServerZone, *bms.Zone.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone: %s", err)) + } + + tags, err := flex.GetTagsUsingCRN(meta, *bms.CRN) + if err != nil { + log.Printf( + "[ERROR] Error on get of resource bare metal server (%s) tags: %s", d.Id(), err) + } + d.Set(isBareMetalServerTags, tags) + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_disk.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_disk.go new file mode 100644 index 0000000000..ad87303cfd --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_disk.go @@ -0,0 +1,96 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerDisk = "disk" +) + +func DataSourceIBMIsBareMetalServerDisk() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerDiskRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + + isBareMetalServerDisk: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server disk identifier", + }, + //disks + + isBareMetalServerDiskHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server disk", + }, + isBareMetalServerDiskID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerDiskInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + }, + isBareMetalServerDiskName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this disk", + }, + isBareMetalServerDiskResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type", + }, + isBareMetalServerDiskSize: { + Type: schema.TypeInt, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + }, + }, + } +} + +func dataSourceIBMISBareMetalServerDiskRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + bareMetalServerDiskID := d.Get(isBareMetalServerDisk).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerDiskOptions{ + BareMetalServerID: &bareMetalServerID, + ID: &bareMetalServerDiskID, + } + + disk, response, err := sess.GetBareMetalServerDiskWithContext(context, options) + if err != nil || disk == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) disk (%s): %s\n%s", bareMetalServerID, bareMetalServerDiskID, err, response)) + } + d.SetId(*disk.ID) + d.Set(isBareMetalServerDiskHref, *disk.Href) + d.Set(isBareMetalServerDiskInterfaceType, *disk.InterfaceType) + d.Set(isBareMetalServerDiskName, *disk.Name) + d.Set(isBareMetalServerDiskResourceType, *disk.ResourceType) + d.Set(isBareMetalServerDiskSize, *disk.Size) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_disks.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_disks.go new file mode 100644 index 0000000000..a1448e1780 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_disks.go @@ -0,0 +1,114 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerID = "bare_metal_server" + isBareMetalServerDiskHref = "href" + isBareMetalServerDiskResourceType = "resource_type" +) + +func DataSourceIBMIsBareMetalServerDisks() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerDisksRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + + //disks + + isBareMetalServerDisks: { + Type: schema.TypeList, + Computed: true, + Description: "A list of bare metal server disks. Disk is a block device that is locally attached to the physical server. By default, the listed disks are sorted by their created_at property values, with the newest disk first.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerDiskHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server disk", + }, + isBareMetalServerDiskID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerDiskInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + }, + isBareMetalServerDiskName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this disk", + }, + isBareMetalServerDiskResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type", + }, + isBareMetalServerDiskSize: { + Type: schema.TypeInt, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMISBareMetalServerDisksRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.ListBareMetalServerDisksOptions{ + BareMetalServerID: &bareMetalServerID, + } + + diskCollection, response, err := sess.ListBareMetalServerDisksWithContext(context, options) + disks := diskCollection.Disks + if err != nil || disks == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) disks: %s\n%s", bareMetalServerID, err, response)) + } + disksInfo := make([]map[string]interface{}, 0) + for _, disk := range disks { + l := map[string]interface{}{ + isBareMetalServerDiskHref: disk.Href, + isBareMetalServerDiskID: disk.ID, + isBareMetalServerDiskInterfaceType: disk.InterfaceType, + isBareMetalServerDiskName: disk.Name, + isBareMetalServerDiskResourceType: disk.ResourceType, + isBareMetalServerDiskSize: disk.Size, + } + disksInfo = append(disksInfo, l) + } + d.SetId(dataSourceIBMISBMSDisksID(d)) + d.Set(isBareMetalServerDisks, disksInfo) + return nil +} + +// dataSourceIBMISBMSProfilesID returns a reasonable ID for a Bare Metal Server Disks list. +func dataSourceIBMISBMSDisksID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_initialization.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_initialization.go new file mode 100644 index 0000000000..97312ca472 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_initialization.go @@ -0,0 +1,229 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/pem" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/ScaleFT/sshkeys" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerImageName = "image_name" + isBareMetalServerUserAccountUserName = "username" + isBareMetalServerUserAccountEncryptionKey = "encryption_key" + isBareMetalServerUserAccountEncPwd = "encrypted_password" + isBareMetalServerUserAccountPassword = "password" + isBareMetalServerPEM = "private_key" + isBareMetalServerPassphrase = "passphrase" + isBareMetalServerUserAccountResourceType = "resource_type" +) + +func DataSourceIBMIsBareMetalServerInitialization() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerInitializationRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + + isBareMetalServerPEM: { + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Description: "Bare Metal Server Private Key file", + }, + + isBareMetalServerPassphrase: { + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Description: "Passphrase for Bare Metal Server Private Key file", + }, + + isBareMetalServerImage: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier of the image the bare metal server was provisioned from", + }, + + isBareMetalServerImageName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined or system-provided name for the image the bare metal server was provisioned from", + }, + + isBareMetalServerUserAccounts: { + Type: schema.TypeList, + Computed: true, + Description: "The user accounts that are created at initialization. There can be multiple account types distinguished by the resource_type attribute.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerUserAccountUserName: { + Type: schema.TypeString, + Computed: true, + Description: "The username for the account created at initialization", + }, + isBareMetalServerUserAccountEncryptionKey: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for the encryption key", + }, + isBareMetalServerUserAccountEncPwd: { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + Description: "The password at initialization, encrypted using encryption_key, and returned base64-encoded", + }, + isBareMetalServerUserAccountPassword: { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + Description: "The password at initialization, encrypted using encryption_key, and returned base64-encoded", + }, + isBareMetalServerUserAccountResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The type of resource referenced : [ host_user_account ]", + }, + }, + }, + }, + + isBareMetalServerKeys: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "SSH key Ids for the bare metal server", + }, + }, + } +} + +func dataSourceIBMISBareMetalServerInitializationRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerInitializationOptions{ + ID: &bareMetalServerID, + } + + initialization, response, err := sess.GetBareMetalServerInitializationWithContext(context, options) + if err != nil || initialization == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) initialization : %s\n%s", bareMetalServerID, err, response)) + } + d.SetId(bareMetalServerID) + if initialization.Image != nil { + d.Set(isBareMetalServerImage, initialization.Image.ID) + d.Set(isBareMetalServerImageName, initialization.Image.Name) + } + + var keys []string + keys = make([]string, 0) + if initialization.Keys != nil { + for _, key := range initialization.Keys { + keys = append(keys, *key.ID) + } + } + d.Set(isBareMetalServerKeys, flex.NewStringSet(schema.HashString, keys)) + accList := make([]map[string]interface{}, 0) + if initialization.UserAccounts != nil { + + for _, accIntf := range initialization.UserAccounts { + acc := accIntf.(*vpcv1.BareMetalServerInitializationUserAccount) + currAccount := map[string]interface{}{ + isBareMetalServerUserAccountUserName: *acc.Username, + } + currAccount[isBareMetalServerUserAccountResourceType] = *acc.ResourceType + currAccount[isBareMetalServerUserAccountEncryptionKey] = *acc.EncryptionKey.CRN + encPassword := base64.StdEncoding.EncodeToString(*acc.EncryptedPassword) + currAccount[isBareMetalServerUserAccountEncPwd] = encPassword + + var rsaKey *rsa.PrivateKey + if privatekey, ok := d.GetOk(isBareMetalServerPEM); ok { + keyFlag := privatekey.(string) + keybytes := []byte(keyFlag) + + if keyFlag != "" { + block, err := pem.Decode(keybytes) + if block == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Failed to load the private key from the given key contents. Instead of the key file path, please make sure the private key is pem format")) + } + isEncrypted := false + switch block.Type { + case "RSA PRIVATE KEY": + isEncrypted = x509.IsEncryptedPEMBlock(block) + case "OPENSSH PRIVATE KEY": + var err error + isEncrypted, err = isOpenSSHPrivKeyEncrypted(block.Bytes) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Failed to check if the provided open ssh key is encrypted or not %s", err)) + } + default: + return diag.FromErr(fmt.Errorf("[ERROR] PEM and OpenSSH private key formats with RSA key type are supported, can not support this key file type: %s", err)) + } + passphrase := "" + var privateKey interface{} + if isEncrypted { + if pass, ok := d.GetOk(isBareMetalServerPassphrase); ok { + passphrase = pass.(string) + } else { + return diag.FromErr(fmt.Errorf("[ERROR] Mandatory field 'passphrase' not provided")) + } + var err error + privateKey, err = sshkeys.ParseEncryptedRawPrivateKey(keybytes, []byte(passphrase)) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Fail to decrypting the private key: %s", err)) + } + } else { + var err error + privateKey, err = sshkeys.ParseEncryptedRawPrivateKey(keybytes, nil) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Fail to decrypting the private key: %s", err)) + } + } + var ok bool + rsaKey, ok = privateKey.(*rsa.PrivateKey) + if !ok { + return diag.FromErr(fmt.Errorf("[ERROR] Failed to convert to RSA private key")) + } + } + } + + if acc.EncryptedPassword != nil { + ciphertext := *acc.EncryptedPassword + password := base64.StdEncoding.EncodeToString(ciphertext) + if rsaKey != nil { + rng := rand.Reader + clearPassword, err := rsa.DecryptPKCS1v15(rng, rsaKey, ciphertext) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Can not decrypt the password with the given key, %s", err)) + } + password = string(clearPassword) + } + currAccount[isBareMetalServerUserAccountPassword] = password + } + accList = append(accList, currAccount) + } + d.Set(isBareMetalServerUserAccounts, accList) + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface.go new file mode 100644 index 0000000000..e865d1aadf --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface.go @@ -0,0 +1,327 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "reflect" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerNicEnableInfraNAT = "enable_infrastructure_nat" + isBareMetalServerNicFloatingIPs = "floating_ips" + isBareMetalServerNicIpAddress = "address" + isBareMetalServerNicIpCRN = "crn" + isBareMetalServerNicIpHref = "href" + isBareMetalServerNicIpID = "id" + isBareMetalServerNicIpName = "name" + isBareMetalServerNicIpAutoDelete = "auto_delete" + isBareMetalServerNicHref = "href" + isBareMetalServerNicID = "network_interface" + isBareMetalServerNicInterfaceType = "interface_type" + isBareMetalServerNicReservedIps = "ips" + isBareMetalServerNicMacAddress = "mac_address" + isBareMetalServerNicPrimaryIP = "primary_ip" + isBareMetalServerNicResourceType = "resource_type" + isBareMetalServerNicStatus = "status" + isBareMetalServerNicType = "type" + isBareMetalServerNicAllowedVlans = "allowed_vlans" + isBareMetalServerNicAllowInterfaceToFloat = "allow_interface_to_float" + isBareMetalServerNicVlan = "vlan" +) + +func DataSourceIBMIsBareMetalServerNetworkInterface() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerNetworkInterfaceRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + + isBareMetalServerNicID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server network interface identifier", + }, + //network interface properties + + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicEnableInfraNAT: { + Type: schema.TypeBool, + Computed: true, + Description: "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + }, + isBareMetalServerNicFloatingIPs: { + Type: schema.TypeList, + Computed: true, + Description: "The floating IPs associated with this network interface.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + + isBareMetalServerNicIpCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this floating IP", + }, + isBareMetalServerNicIpHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this floating IP", + }, + isBareMetalServerNicIpID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this floating IP", + }, + isBareMetalServerNicIpName: { + Type: schema.TypeString, + Computed: true, + Description: "The unique user-defined name for this floating IP", + }, + }, + }, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The network interface type: [ pci, vlan ]", + }, + + isBareMetalServerNicMacAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The MAC address of the interface. If absent, the value is not known.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this network interface", + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + Description: "The network interface port speed in Mbps", + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Computed: true, + Description: "IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type : [ subnet_reserved_ip ]", + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Collection of security groups ids", + }, + + isBareMetalServerNicStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the network interface : [ available, deleting, failed, pending ]", + }, + + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Computed: true, + Description: "The id of the associated subnet", + }, + + isBareMetalServerNicType: { + Type: schema.TypeString, + Computed: true, + Description: "The type of this bare metal server network interface : [ primary, secondary ]", + }, + + isBareMetalServerNicAllowedVlans: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeInt}, + Set: schema.HashInt, + Description: "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + }, + + isBareMetalServerNicAllowInterfaceToFloat: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + }, + + isBareMetalServerNicVlan: { + Type: schema.TypeInt, + Computed: true, + Description: "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", + }, + }, + } +} + +func dataSourceIBMISBareMetalServerNetworkInterfaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + bareMetalServerNicID := d.Get(isBareMetalServerNicID).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerID, + ID: &bareMetalServerNicID, + } + + nicIntf, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil || nicIntf == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface (%s): %s\n%s", bareMetalServerID, bareMetalServerNicID, err, response)) + } + switch reflect.TypeOf(nicIntf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + d.SetId(*nic.ID) + d.Set(isBareMetalServerNicAllowIPSpoofing, *nic.AllowIPSpoofing) + d.Set(isBareMetalServerNicEnableInfraNAT, *nic.EnableInfrastructureNat) + floatingIPList := make([]map[string]interface{}, 0) + if nic.FloatingIps != nil { + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + } + d.Set(isBareMetalServerNicFloatingIPs, floatingIPList) + + d.Set(isBareMetalServerNicHref, *nic.Href) + + d.Set(isBareMetalServerNicID, *nic.ID) + + d.Set(isBareMetalServerNicInterfaceType, *nic.InterfaceType) + + d.Set(isBareMetalServerNicMacAddress, *nic.MacAddress) + d.Set(isBareMetalServerNicName, *nic.Name) + if nic.PortSpeed != nil { + d.Set(isBareMetalServerNicPortSpeed, *nic.PortSpeed) + } + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + d.Set(isBareMetalServerNicPrimaryIP, primaryIpList) + + d.Set(isBareMetalServerNicResourceType, *nic.ResourceType) + if nic.SecurityGroups != nil && len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + d.Set(isBareMetalServerNicSecurityGroups, flex.NewStringSet(schema.HashString, secgrpList)) + } + + d.Set(isBareMetalServerNicStatus, *nic.Status) + + d.Set(isBareMetalServerNicSubnet, *nic.Subnet.ID) + + d.Set(isBareMetalServerNicType, *nic.Type) + + if nic.AllowedVlans != nil { + var out = make([]interface{}, len(nic.AllowedVlans), len(nic.AllowedVlans)) + for i, v := range nic.AllowedVlans { + out[i] = int(v) + } + d.Set(isBareMetalServerNicAllowedVlans, schema.NewSet(schema.HashInt, out)) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + d.SetId(*nic.ID) + d.Set(isBareMetalServerNicAllowIPSpoofing, *nic.AllowIPSpoofing) + d.Set(isBareMetalServerNicEnableInfraNAT, *nic.EnableInfrastructureNat) + + floatingIPList := make([]map[string]interface{}, 0) + if nic.FloatingIps != nil { + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + } + d.Set(isBareMetalServerNicFloatingIPs, floatingIPList) + + d.Set(isBareMetalServerNicHref, *nic.Href) + d.Set(isBareMetalServerNicID, *nic.ID) + d.Set(isBareMetalServerNicInterfaceType, *nic.InterfaceType) + + d.Set(isBareMetalServerNicMacAddress, *nic.MacAddress) + d.Set(isBareMetalServerNicName, *nic.Name) + d.Set(isBareMetalServerNicPortSpeed, *nic.PortSpeed) + + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + d.Set(isBareMetalServerNicPrimaryIP, primaryIpList) + + d.Set(isBareMetalServerNicResourceType, *nic.ResourceType) + + if len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + d.Set(isBareMetalServerNicSecurityGroups, flex.NewStringSet(schema.HashString, secgrpList)) + } + + d.Set(isBareMetalServerNicStatus, *nic.Status) + d.Set(isBareMetalServerNicSubnet, *nic.Subnet.ID) + d.Set(isBareMetalServerNicType, *nic.Type) + d.Set(isBareMetalServerNicAllowInterfaceToFloat, *nic.AllowInterfaceToFloat) + d.Set(isBareMetalServerNicVlan, *nic.Vlan) + } + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface_floating_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface_floating_ip.go new file mode 100644 index 0000000000..7273df41f9 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface_floating_ip.go @@ -0,0 +1,112 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerNetworkInterfaceFloatingIPID = "floating_ip" +) + +func DataSourceIBMIsBareMetalServerNetworkInterfaceFloatingIP() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerNetworkInterfaceFloatingIPRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + isBareMetalServerNetworkInterface: { + Type: schema.TypeString, + Required: true, + Description: "The network interface identifier of bare metal server", + }, + isBareMetalServerNetworkInterfaceFloatingIPID: { + Type: schema.TypeString, + Required: true, + Description: "The floating ip identifier of the network interface associated with the bare metal server", + }, + floatingIPName: { + Type: schema.TypeString, + Computed: true, + Description: "Name of the floating IP", + }, + + floatingIPAddress: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP address", + }, + + floatingIPStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP status", + }, + + floatingIPZone: { + Type: schema.TypeString, + Computed: true, + Description: "Zone name", + }, + + floatingIPTarget: { + Type: schema.TypeString, + Computed: true, + Description: "Target info", + }, + + floatingIPCRN: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP crn", + }, + }, + } +} + +func dataSourceIBMISBareMetalServerNetworkInterfaceFloatingIPRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + nicID := d.Get(isBareMetalServerNetworkInterface).(string) + fipID := d.Get(isBareMetalServerNetworkInterfaceFloatingIPID).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerID, + NetworkInterfaceID: &nicID, + ID: &fipID, + } + + ip, response, err := sess.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching floating IP for bare metal server %s\n%s", err, response)) + } + d.Set(floatingIPName, *ip.Name) + d.Set(floatingIPAddress, *ip.Address) + d.Set(floatingIPStatus, *ip.Status) + d.Set(floatingIPZone, *ip.Zone.Name) + + d.Set(floatingIPCRN, *ip.CRN) + + target, ok := ip.Target.(*vpcv1.FloatingIPTarget) + if ok { + d.Set(floatingIPTarget, target.ID) + } + + d.SetId(*ip.ID) + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface_floating_ips.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface_floating_ips.go new file mode 100644 index 0000000000..52c6a2cc79 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interface_floating_ips.go @@ -0,0 +1,138 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerNetworkInterface = "network_interface" + floatingIPId = "id" +) + +func DataSourceIBMIsBareMetalServerNetworkInterfaceFloatingIPs() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerNetworkInterfaceFloatingIPsRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + isBareMetalServerNetworkInterface: { + Type: schema.TypeString, + Required: true, + Description: "The network interface identifier of bare metal server", + }, + + //floating ip properties + isBareMetalServerNicFloatingIPs: { + Type: schema.TypeList, + Description: "The floating IPs associated with this network interface.", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + floatingIPName: { + Type: schema.TypeString, + Required: true, + Description: "Name of the floating IP", + }, + floatingIPId: { + Type: schema.TypeString, + Required: true, + Description: "ID of the floating IP", + }, + + floatingIPAddress: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP address", + }, + + floatingIPStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP status", + }, + + floatingIPZone: { + Type: schema.TypeString, + Computed: true, + Description: "Zone name", + }, + + floatingIPTarget: { + Type: schema.TypeString, + Computed: true, + Description: "Target info", + }, + + floatingIPCRN: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP crn", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMISBareMetalServerNetworkInterfaceFloatingIPsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + nicID := d.Get(isBareMetalServerNetworkInterface).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + allFloatingIPs := []vpcv1.FloatingIP{} + options := &vpcv1.ListBareMetalServerNetworkInterfaceFloatingIpsOptions{ + BareMetalServerID: &bareMetalServerID, + NetworkInterfaceID: &nicID, + } + + fips, response, err := sess.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching floating IPs for bare metal server %s\n%s", err, response)) + } + allFloatingIPs = append(allFloatingIPs, fips.FloatingIps...) + fipInfo := make([]map[string]interface{}, 0) + for _, ip := range allFloatingIPs { + l := map[string]interface{}{} + + l[floatingIPName] = *ip.Name + l[floatingIPAddress] = *ip.Address + l[floatingIPStatus] = *ip.Status + l[floatingIPZone] = *ip.Zone.Name + + l[floatingIPCRN] = *ip.CRN + + target, ok := ip.Target.(*vpcv1.FloatingIPTarget) + if ok { + l[floatingIPTarget] = target.ID + } + + l[floatingIPId] = *ip.ID + + fipInfo = append(fipInfo, l) + } + d.SetId(dataSourceIBMISBareMetalServerNetworkInterfaceFloatingIPsID(d)) + d.Set(isBareMetalServerNicFloatingIPs, fipInfo) + return nil +} + +// dataSourceIBMISBMSProfilesID returns a reasonable ID for a BMS network interface floating ip list. +func dataSourceIBMISBareMetalServerNetworkInterfaceFloatingIPsID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interfaces.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interfaces.go new file mode 100644 index 0000000000..1a150af9c7 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_network_interfaces.go @@ -0,0 +1,312 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "reflect" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMIsBareMetalServerNetworkInterfaces() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServerNetworkInterfacesRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "The bare metal server identifier", + }, + + //network interface properties + isBareMetalServerNetworkInterfaces: { + Type: schema.TypeList, + Description: "A list of all network interfaces on a bare metal server. A network interface is an abstract representation of a network interface card and connects a bare metal server to a subnet. While each network interface can attach to only one subnet, multiple network interfaces can be created to attach to multiple subnets. Multiple interfaces may also attach to the same subnet.", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicEnableInfraNAT: { + Type: schema.TypeBool, + Computed: true, + Description: "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + }, + isBareMetalServerNicFloatingIPs: { + Type: schema.TypeList, + Computed: true, + Description: "The floating IPs associated with this network interface.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + + isBareMetalServerNicIpCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this floating IP", + }, + isBareMetalServerNicIpHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this floating IP", + }, + isBareMetalServerNicIpID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this floating IP", + }, + isBareMetalServerNicIpName: { + Type: schema.TypeString, + Computed: true, + Description: "The unique user-defined name for this floating IP", + }, + }, + }, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The network interface type: [ pci, vlan ]", + }, + + isBareMetalServerNicMacAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The MAC address of the interface. If absent, the value is not known.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this network interface", + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + Description: "The network interface port speed in Mbps", + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Computed: true, + Description: "title: IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type : [ subnet_reserved_ip ]", + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Collection of security groups ids", + }, + + isBareMetalServerNicStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the network interface : [ available, deleting, failed, pending ]", + }, + + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Computed: true, + Description: "The id of the associated subnet", + }, + + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The id of the network interface", + }, + + isBareMetalServerNicType: { + Type: schema.TypeString, + Computed: true, + Description: "The type of this bare metal server network interface : [ primary, secondary ]", + }, + + isBareMetalServerNicAllowedVlans: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeInt}, + Set: schema.HashInt, + Description: "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + }, + + isBareMetalServerNicAllowInterfaceToFloat: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + }, + + isBareMetalServerNicVlan: { + Type: schema.TypeInt, + Computed: true, + Description: "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMISBareMetalServerNetworkInterfacesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerID := d.Get(isBareMetalServerID).(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.ListBareMetalServerNetworkInterfacesOptions{ + BareMetalServerID: &bareMetalServerID, + } + nics := []vpcv1.BareMetalServerNetworkInterfaceIntf{} + bmsNics, response, err := sess.ListBareMetalServerNetworkInterfacesWithContext(context, options) + if err != nil || bmsNics == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error listing Bare Metal Server (%s) network interfaces : %s\n%s", bareMetalServerID, err, response)) + } + nics = append(nics, bmsNics.NetworkInterfaces...) + nicsInfo := make([]map[string]interface{}, 0) + for _, nicIntf := range nics { + l := map[string]interface{}{} + switch reflect.TypeOf(nicIntf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + l[isBareMetalServerNicAllowIPSpoofing] = *nic.AllowIPSpoofing + l[isBareMetalServerNicEnableInfraNAT] = *nic.EnableInfrastructureNat + if nic.FloatingIps != nil { + floatingIPList := make([]map[string]interface{}, 0) + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + l[isBareMetalServerNicFloatingIPs] = floatingIPList + } + l[isBareMetalServerNicHref] = *nic.Href + l[isBareMetalServerNicInterfaceType] = *nic.InterfaceType + l[isBareMetalServerNicMacAddress] = *nic.MacAddress + l[isBareMetalServerNicName] = *nic.Name + if nic.PortSpeed != nil { + l[isBareMetalServerNicPortSpeed] = *nic.PortSpeed + } + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + l[isBareMetalServerNicPrimaryIP] = primaryIpList + l[isBareMetalServerNicResourceType] = *nic.ResourceType + if nic.SecurityGroups != nil && len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + l[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + + l[isBareMetalServerNicStatus] = *nic.Status + l[isBareMetalServerNicSubnet] = *nic.Subnet.ID + l[isBareMetalServerNicType] = *nic.Type + l["id"] = *nic.ID + + if nic.AllowedVlans != nil { + var out = make([]interface{}, len(nic.AllowedVlans), len(nic.AllowedVlans)) + for i, v := range nic.AllowedVlans { + out[i] = int(v) + } + l[isBareMetalServerNicAllowedVlans] = schema.NewSet(schema.HashInt, out) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + l[isBareMetalServerNicAllowIPSpoofing] = *nic.AllowIPSpoofing + l[isBareMetalServerNicEnableInfraNAT] = *nic.EnableInfrastructureNat + if nic.FloatingIps != nil { + floatingIPList := make([]map[string]interface{}, 0) + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + l[isBareMetalServerNicFloatingIPs] = floatingIPList + } + l[isBareMetalServerNicHref] = *nic.Href + l[isBareMetalServerNicInterfaceType] = *nic.InterfaceType + l[isBareMetalServerNicMacAddress] = *nic.MacAddress + l[isBareMetalServerNicName] = *nic.Name + if nic.PortSpeed != nil { + l[isBareMetalServerNicPortSpeed] = *nic.PortSpeed + } + + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + l[isBareMetalServerNicPrimaryIP] = primaryIpList + l[isBareMetalServerNicResourceType] = *nic.ResourceType + if nic.SecurityGroups != nil && len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + l[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + l[isBareMetalServerNicStatus] = *nic.Status + l[isBareMetalServerNicSubnet] = *nic.Subnet.ID + l[isBareMetalServerNicType] = *nic.Type + l["id"] = *nic.ID + l[isBareMetalServerNicAllowInterfaceToFloat] = *nic.AllowInterfaceToFloat + l[isBareMetalServerNicVlan] = *nic.Vlan + } + } + nicsInfo = append(nicsInfo, l) + } + d.SetId(dataSourceIBMISBareMetalServerNetworkInterfacesID(d)) + d.Set(isBareMetalServerNetworkInterfaces, nicsInfo) + return nil +} + +// dataSourceIBMISBMSProfilesID returns a reasonable ID for a BMS Profile list. +func dataSourceIBMISBareMetalServerNetworkInterfacesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_profile.go new file mode 100644 index 0000000000..9a964211ab --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_profile.go @@ -0,0 +1,432 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerProfileName = "name" + isBareMetalServerProfileBandwidth = "bandwidth" + isBareMetalServerProfileType = "type" + isBareMetalServerProfileValue = "value" + isBareMetalServerProfileCPUArchitecture = "cpu_architecture" + isBareMetalServerProfileCPUCoreCount = "cpu_core_count" + isBareMetalServerProfileCPUSocketCount = "cpu_socket_count" + isBareMetalServerProfileDisks = "disks" + isBareMetalServerProfileDiskQuantity = "quantity" + isBareMetalServerProfileDiskSize = "size" + isBareMetalServerProfileDiskSITs = "supported_interface_types" + isBareMetalServerProfileFamily = "family" + isBareMetalServerProfileHref = "href" + isBareMetalServerProfileMemory = "memory" + isBareMetalServerProfileOS = "os_architecture" + isBareMetalServerProfileValues = "values" + isBareMetalServerProfileDefault = "default" + isBareMetalServerProfileRT = "resource_type" + isBareMetalServerProfileSIFs = "supported_image_flags" + isBareMetalServerProfileSTPMMs = "supported_trusted_platform_module_modes" +) + +func DataSourceIBMIsBareMetalServerProfile() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBMSProfileRead, + + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileName: { + Type: schema.TypeString, + Required: true, + Description: "The name for this bare metal server profile", + }, + + isBareMetalServerProfileFamily: { + Type: schema.TypeString, + Computed: true, + Description: "The product family this bare metal server profile belongs to", + }, + isBareMetalServerProfileHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server profile", + }, + isBareMetalServerProfileBandwidth: { + Type: schema.TypeList, + Computed: true, + Description: "The total bandwidth (in megabits per second) shared across the network interfaces of a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileRT: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type for this bare metal server profile", + }, + + isBareMetalServerProfileCPUArchitecture: { + Type: schema.TypeList, + Computed: true, + Description: "The CPU architecture for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeString, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileCPUSocketCount: { + Type: schema.TypeList, + Computed: true, + Description: "The number of CPU sockets for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileCPUCoreCount: { + Type: schema.TypeList, + Computed: true, + Description: "The CPU core count for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileMemory: { + Type: schema.TypeList, + Computed: true, + Description: "The memory (in gibibytes) for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileSTPMMs: { + Type: schema.TypeList, + Computed: true, + Description: "An array of supported trusted platform module (TPM) modes for this bare metal server profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValues: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + Description: "The supported trusted platform module (TPM) modes", + }, + }, + }, + }, + isBareMetalServerProfileOS: { + Type: schema.TypeList, + Computed: true, + Description: "The supported OS architecture(s) for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileDefault: { + Type: schema.TypeString, + Computed: true, + Description: "The default for this profile field", + }, + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValues: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + Description: "The supported OS architecture(s) for a bare metal server with this profile", + }, + }, + }, + }, + isBareMetalServerProfileDisks: { + Type: schema.TypeList, + Computed: true, + Description: "Collection of the bare metal server profile's disks", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileDiskQuantity: { + Type: schema.TypeList, + Computed: true, + Description: "The number of disks of this configuration for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileDiskSize: { + Type: schema.TypeList, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileDiskSITs: { + Type: schema.TypeList, + Computed: true, + Description: "The disk interface used for attaching the disk.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileDefault: { + Type: schema.TypeString, + Computed: true, + Description: "The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + }, + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + isBareMetalServerProfileValues: { + Type: schema.TypeSet, + Computed: true, + Description: "The supported disk interfaces used for attaching the disk", + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMISBMSProfileRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + name := d.Get("name").(string) + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerProfileOptions{ + Name: &name, + } + bmsProfile, response, err := sess.GetBareMetalServerProfileWithContext(context, options) + if err != nil || bmsProfile == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Bare Metal Server Profile (%s): %s\n%s", name, err, response)) + } + d.SetId(*bmsProfile.Name) + d.Set(isBareMetalServerProfileName, *bmsProfile.Name) + d.Set(isBareMetalServerProfileFamily, *bmsProfile.Family) + d.Set(isBareMetalServerProfileHref, *bmsProfile.Href) + if bmsProfile.Bandwidth != nil { + bwList := make([]map[string]interface{}, 0) + bw := bmsProfile.Bandwidth.(*vpcv1.BareMetalServerProfileBandwidth) + bandwidth := map[string]interface{}{ + isBareMetalServerProfileType: *bw.Type, + isBareMetalServerProfileValue: *bw.Value, + } + bwList = append(bwList, bandwidth) + d.Set(isBareMetalServerProfileBandwidth, bwList) + } + if bmsProfile.CpuArchitecture != nil { + caList := make([]map[string]interface{}, 0) + ca := bmsProfile.CpuArchitecture + architecture := map[string]interface{}{ + isBareMetalServerProfileType: *ca.Type, + isBareMetalServerProfileValue: *ca.Value, + } + caList = append(caList, architecture) + d.Set(isBareMetalServerProfileCPUArchitecture, caList) + } + if bmsProfile.CpuCoreCount != nil { + ccList := make([]map[string]interface{}, 0) + cc := bmsProfile.CpuCoreCount.(*vpcv1.BareMetalServerProfileCpuCoreCount) + coreCount := map[string]interface{}{ + isBareMetalServerProfileType: *cc.Type, + isBareMetalServerProfileValue: *cc.Value, + } + ccList = append(ccList, coreCount) + d.Set(isBareMetalServerProfileCPUCoreCount, ccList) + } + if bmsProfile.CpuSocketCount != nil { + scList := make([]map[string]interface{}, 0) + sc := bmsProfile.CpuSocketCount.(*vpcv1.BareMetalServerProfileCpuSocketCount) + socketCount := map[string]interface{}{ + isBareMetalServerProfileType: *sc.Type, + isBareMetalServerProfileValue: *sc.Value, + } + scList = append(scList, socketCount) + d.Set(isBareMetalServerProfileCPUSocketCount, scList) + } + + if bmsProfile.Memory != nil { + memList := make([]map[string]interface{}, 0) + mem := bmsProfile.Memory.(*vpcv1.BareMetalServerProfileMemory) + m := map[string]interface{}{ + isBareMetalServerProfileType: *mem.Type, + isBareMetalServerProfileValue: *mem.Value, + } + memList = append(memList, m) + d.Set(isBareMetalServerProfileMemory, memList) + } + d.Set(isBareMetalServerProfileRT, *bmsProfile.ResourceType) + if bmsProfile.SupportedTrustedPlatformModuleModes != nil { + list := make([]map[string]interface{}, 0) + var stpmmlist []string + for _, item := range bmsProfile.SupportedTrustedPlatformModuleModes.Values { + stpmmlist = append(stpmmlist, item) + } + m := map[string]interface{}{ + isBareMetalServerProfileType: *bmsProfile.SupportedTrustedPlatformModuleModes.Type, + } + m[isBareMetalServerProfileValues] = stpmmlist + list = append(list, m) + d.Set(isBareMetalServerProfileSTPMMs, list) + } + if bmsProfile.OsArchitecture != nil { + list := make([]map[string]interface{}, 0) + var valuelist []string + for _, item := range bmsProfile.OsArchitecture.Values { + valuelist = append(valuelist, item) + } + m := map[string]interface{}{ + isBareMetalServerProfileDefault: *bmsProfile.OsArchitecture.Default, + isBareMetalServerProfileType: *bmsProfile.OsArchitecture.Type, + } + m[isBareMetalServerProfileValues] = valuelist + list = append(list, m) + d.Set(isBareMetalServerProfileOS, list) + } + + if bmsProfile.Disks != nil { + list := make([]map[string]interface{}, 0) + for _, disk := range bmsProfile.Disks { + qlist := make([]map[string]interface{}, 0) + slist := make([]map[string]interface{}, 0) + sitlist := make([]map[string]interface{}, 0) + quantity := disk.Quantity.(*vpcv1.BareMetalServerProfileDiskQuantity) + q := make(map[string]interface{}) + q[isBareMetalServerProfileType] = *quantity.Type + q[isBareMetalServerProfileValue] = *quantity.Value + qlist = append(qlist, q) + size := disk.Size.(*vpcv1.BareMetalServerProfileDiskSize) + s := map[string]interface{}{ + isBareMetalServerProfileType: *size.Type, + isBareMetalServerProfileValue: *size.Value, + } + slist = append(slist, s) + sit := map[string]interface{}{ + isBareMetalServerProfileDefault: *disk.SupportedInterfaceTypes.Default, + isBareMetalServerProfileType: *disk.SupportedInterfaceTypes.Type, + } + var valuelist []string + for _, item := range disk.SupportedInterfaceTypes.Values { + valuelist = append(valuelist, item) + } + sit[isBareMetalServerProfileValues] = valuelist + sitlist = append(sitlist, sit) + sz := map[string]interface{}{ + isBareMetalServerProfileDiskQuantity: qlist, + isBareMetalServerProfileDiskSize: slist, + isBareMetalServerProfileDiskSITs: sitlist, + } + list = append(list, sz) + } + d.Set(isBareMetalServerProfileDisks, list) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_profiles.go new file mode 100644 index 0000000000..daeb6bacd5 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_server_profiles.go @@ -0,0 +1,449 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerProfiles = "profiles" +) + +func DataSourceIBMIsBareMetalServerProfiles() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsBareMetalServerProfilesRead, + + Schema: map[string]*schema.Schema{ + + isBareMetalServerProfiles: { + Type: schema.TypeList, + Description: "List of BMS profile maps", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + isBareMetalServerProfileName: { + Type: schema.TypeString, + Computed: true, + Description: "The name for this bare metal server profile", + }, + + isBareMetalServerProfileFamily: { + Type: schema.TypeString, + Computed: true, + Description: "The product family this bare metal server profile belongs to", + }, + isBareMetalServerProfileHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server profile", + }, + isBareMetalServerProfileBandwidth: { + Type: schema.TypeList, + Computed: true, + Description: "The total bandwidth (in megabits per second) shared across the network interfaces of a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileRT: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type for this bare metal server profile", + }, + + isBareMetalServerProfileCPUArchitecture: { + Type: schema.TypeList, + Computed: true, + Description: "The CPU architecture for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeString, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileCPUSocketCount: { + Type: schema.TypeList, + Computed: true, + Description: "The number of CPU sockets for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileCPUCoreCount: { + Type: schema.TypeList, + Computed: true, + Description: "The CPU core count for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileMemory: { + Type: schema.TypeList, + Computed: true, + Description: "The memory (in gibibytes) for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileSTPMMs: { + Type: schema.TypeList, + Computed: true, + Description: "An array of supported trusted platform module (TPM) modes for this bare metal server profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValues: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + Description: "The supported trusted platform module (TPM) modes", + }, + }, + }, + }, + isBareMetalServerProfileOS: { + Type: schema.TypeList, + Computed: true, + Description: "The supported OS architecture(s) for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileDefault: { + Type: schema.TypeString, + Computed: true, + Description: "The default for this profile field", + }, + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + + isBareMetalServerProfileValues: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + Description: "The supported OS architecture(s) for a bare metal server with this profile", + }, + }, + }, + }, + isBareMetalServerProfileDisks: { + Type: schema.TypeList, + Computed: true, + Description: "Collection of the bare metal server profile's disks", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileDiskQuantity: { + Type: schema.TypeList, + Computed: true, + Description: "The number of disks of this configuration for a bare metal server with this profile", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + + isBareMetalServerProfileDiskSize: { + Type: schema.TypeList, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + isBareMetalServerProfileValue: { + Type: schema.TypeInt, + Computed: true, + Description: "The value for this profile field", + }, + }, + }, + }, + isBareMetalServerProfileDiskSITs: { + Type: schema.TypeList, + Computed: true, + Description: "The disk interface used for attaching the disk.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerProfileDefault: { + Type: schema.TypeString, + Computed: true, + Description: "The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", + }, + isBareMetalServerProfileType: { + Type: schema.TypeString, + Computed: true, + Description: "The type for this profile field", + }, + isBareMetalServerProfileValues: { + Type: schema.TypeSet, + Computed: true, + Description: "The supported disk interfaces used for attaching the disk", + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsBareMetalServerProfilesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + start := "" + allrecs := []vpcv1.BareMetalServerProfile{} + for { + listBMSProfilesOptions := &vpcv1.ListBareMetalServerProfilesOptions{} + if start != "" { + listBMSProfilesOptions.Start = &start + } + availableProfiles, response, err := sess.ListBareMetalServerProfilesWithContext(context, listBMSProfilesOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching Bare Metal Server Profiles %s\n%s", err, response)) + } + start = flex.GetNext(availableProfiles.Next) + allrecs = append(allrecs, availableProfiles.Profiles...) + if start == "" { + break + } + } + + profilesInfo := make([]map[string]interface{}, 0) + for _, profile := range allrecs { + + l := map[string]interface{}{ + isBareMetalServerProfileName: *profile.Name, + isBareMetalServerProfileFamily: *profile.Family, + } + l[isBareMetalServerProfileHref] = *profile.Href + if profile.Bandwidth != nil { + bwList := make([]map[string]interface{}, 0) + bw := profile.Bandwidth.(*vpcv1.BareMetalServerProfileBandwidth) + bandwidth := map[string]interface{}{ + isBareMetalServerProfileType: *bw.Type, + isBareMetalServerProfileValue: *bw.Value, + } + bwList = append(bwList, bandwidth) + l[isBareMetalServerProfileBandwidth] = bwList + } + if profile.CpuArchitecture != nil { + caList := make([]map[string]interface{}, 0) + ca := profile.CpuArchitecture + architecture := map[string]interface{}{ + isBareMetalServerProfileType: *ca.Type, + isBareMetalServerProfileValue: *ca.Value, + } + caList = append(caList, architecture) + l[isBareMetalServerProfileCPUArchitecture] = caList + } + if profile.CpuCoreCount != nil { + ccList := make([]map[string]interface{}, 0) + cc := profile.CpuCoreCount.(*vpcv1.BareMetalServerProfileCpuCoreCount) + coreCount := map[string]interface{}{ + isBareMetalServerProfileType: *cc.Type, + isBareMetalServerProfileValue: *cc.Value, + } + ccList = append(ccList, coreCount) + l[isBareMetalServerProfileCPUCoreCount] = ccList + } + if profile.CpuSocketCount != nil { + scList := make([]map[string]interface{}, 0) + sc := profile.CpuSocketCount.(*vpcv1.BareMetalServerProfileCpuSocketCount) + socketCount := map[string]interface{}{ + isBareMetalServerProfileType: *sc.Type, + isBareMetalServerProfileValue: *sc.Value, + } + scList = append(scList, socketCount) + l[isBareMetalServerProfileCPUSocketCount] = scList + } + + if profile.Memory != nil { + memList := make([]map[string]interface{}, 0) + mem := profile.Memory.(*vpcv1.BareMetalServerProfileMemory) + m := map[string]interface{}{ + isBareMetalServerProfileType: *mem.Type, + isBareMetalServerProfileValue: *mem.Value, + } + memList = append(memList, m) + l[isBareMetalServerProfileMemory] = memList + } + l[isBareMetalServerProfileRT] = *profile.ResourceType + if profile.SupportedTrustedPlatformModuleModes != nil { + list := make([]map[string]interface{}, 0) + var stpmmlist []string + for _, item := range profile.SupportedTrustedPlatformModuleModes.Values { + stpmmlist = append(stpmmlist, item) + } + m := map[string]interface{}{ + isBareMetalServerProfileType: *profile.SupportedTrustedPlatformModuleModes.Type, + } + m[isBareMetalServerProfileValues] = stpmmlist + list = append(list, m) + l[isBareMetalServerProfileSTPMMs] = list + } + if profile.OsArchitecture != nil { + list := make([]map[string]interface{}, 0) + var valuelist []string + for _, item := range profile.OsArchitecture.Values { + valuelist = append(valuelist, item) + } + m := map[string]interface{}{ + isBareMetalServerProfileDefault: *profile.OsArchitecture.Default, + isBareMetalServerProfileType: *profile.OsArchitecture.Type, + } + m[isBareMetalServerProfileValues] = valuelist + list = append(list, m) + l[isBareMetalServerProfileOS] = list + } + + if profile.Disks != nil { + list := make([]map[string]interface{}, 0) + for _, disk := range profile.Disks { + qlist := make([]map[string]interface{}, 0) + slist := make([]map[string]interface{}, 0) + sitlist := make([]map[string]interface{}, 0) + quantity := disk.Quantity.(*vpcv1.BareMetalServerProfileDiskQuantity) + q := make(map[string]interface{}) + q[isBareMetalServerProfileType] = *quantity.Type + q[isBareMetalServerProfileValue] = *quantity.Value + qlist = append(qlist, q) + size := disk.Size.(*vpcv1.BareMetalServerProfileDiskSize) + s := map[string]interface{}{ + isBareMetalServerProfileType: *size.Type, + isBareMetalServerProfileValue: *size.Value, + } + slist = append(slist, s) + sit := map[string]interface{}{ + isBareMetalServerProfileDefault: *disk.SupportedInterfaceTypes.Default, + isBareMetalServerProfileType: *disk.SupportedInterfaceTypes.Type, + } + var valuelist []string + for _, item := range disk.SupportedInterfaceTypes.Values { + valuelist = append(valuelist, item) + } + sit[isBareMetalServerProfileValues] = valuelist + sitlist = append(sitlist, sit) + sz := map[string]interface{}{ + isBareMetalServerProfileDiskQuantity: qlist, + isBareMetalServerProfileDiskSize: slist, + isBareMetalServerProfileDiskSITs: sitlist, + } + list = append(list, sz) + } + l[isBareMetalServerProfileDisks] = list + } + + profilesInfo = append(profilesInfo, l) + } + d.SetId(dataSourceIBMIsBMSProfilesID(d)) + d.Set(isBareMetalServerProfiles, profilesInfo) + return nil +} + +// dataSourceIBMIsBMSProfilesID returns a reasonable ID for a BMS Profile list. +func dataSourceIBMIsBMSProfilesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go new file mode 100644 index 0000000000..3059f8c49b --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_bare_metal_servers.go @@ -0,0 +1,576 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "reflect" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServers = "servers" +) + +func DataSourceIBMIsBareMetalServers() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISBareMetalServersRead, + + Schema: map[string]*schema.Schema{ + + isBareMetalServers: { + Type: schema.TypeList, + Description: "List of Bare Metal Servers", + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + Description: "Bare metal server id", + }, + isBareMetalServerName: { + Type: schema.TypeString, + Computed: true, + Description: "Bare metal server name", + }, + isBareMetalServerBandwidth: { + Type: schema.TypeInt, + Computed: true, + Description: "The total bandwidth (in megabits per second)", + }, + isBareMetalServerBootTarget: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerCreatedAt: { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the bare metal server was created", + }, + isBareMetalServerCPU: { + Type: schema.TypeList, + Computed: true, + Description: "The bare metal server CPU configuration", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerCPUArchitecture: { + Type: schema.TypeString, + Computed: true, + Description: "The CPU architecture", + }, + isBareMetalServerCPUCoreCount: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of cores", + }, + isBareMetalServerCpuSocketCount: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of CPU sockets", + }, + isBareMetalServerCpuThreadPerCore: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of hardware threads per core", + }, + }, + }, + }, + isBareMetalServerCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this bare metal server", + }, + isBareMetalServerDisks: { + Type: schema.TypeList, + Computed: true, + Description: "The disks for this bare metal server, including any disks that are associated with the boot_target.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerDiskHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server disk", + }, + isBareMetalServerDiskID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerDiskInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + }, + isBareMetalServerDiskName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this disk", + }, + isBareMetalServerDiskResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type", + }, + isBareMetalServerDiskSize: { + Type: schema.TypeInt, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + }, + }, + }, + }, + isBareMetalServerHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server", + }, + isBareMetalServerMemory: { + Type: schema.TypeInt, + Computed: true, + Description: "The amount of memory, truncated to whole gibibytes", + }, + + isBareMetalServerPrimaryNetworkInterface: { + Type: schema.TypeList, + Computed: true, + Description: "Primary Network interface info", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + Deprecated: "This field is deprected", + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Deprecated: "This URL of the interface", + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Computed: true, + Description: "IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + }, + }, + }, + + isBareMetalServerNetworkInterfaces: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Computed: true, + Description: "IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + }, + }, + }, + + isBareMetalServerKeys: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "SSH key Ids for the bare metal server", + }, + + isBareMetalServerImage: { + Type: schema.TypeString, + Computed: true, + Description: "image id", + }, + isBareMetalServerProfile: { + Type: schema.TypeString, + Computed: true, + Description: "profile name", + }, + + isBareMetalServerZone: { + Type: schema.TypeString, + Computed: true, + Description: "Zone name", + }, + + isBareMetalServerVPC: { + Type: schema.TypeString, + Computed: true, + Description: "The VPC the bare metal server is to be a part of", + }, + + isBareMetalServerResourceGroup: { + Type: schema.TypeString, + Computed: true, + Description: "Resource group name", + }, + isBareMetalServerResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "Resource type name", + }, + + isBareMetalServerStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Bare metal server status", + }, + + isBareMetalServerStatusReasons: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerStatusReasonsCode: { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason", + }, + + isBareMetalServerStatusReasonsMessage: { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason", + }, + }, + }, + }, + isBareMetalServerTags: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", "tag")}, + Set: flex.ResourceIBMVPCHash, + Description: "Tags for the Bare metal server", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMISBareMetalServersRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + start := "" + allrecs := []vpcv1.BareMetalServer{} + for { + listBareMetalServersOptions := &vpcv1.ListBareMetalServersOptions{} + if start != "" { + listBareMetalServersOptions.Start = &start + } + availableServers, response, err := sess.ListBareMetalServersWithContext(context, listBareMetalServersOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching Bare Metal Servers %s\n%s", err, response)) + } + start = flex.GetNext(availableServers.Next) + allrecs = append(allrecs, availableServers.BareMetalServers...) + if start == "" { + break + } + } + + serversInfo := make([]map[string]interface{}, 0) + for _, bms := range allrecs { + + l := map[string]interface{}{ + isBareMetalServerName: *bms.Name, + } + l["id"] = *bms.ID + l[isBareMetalServerBandwidth] = *bms.Bandwidth + bmsBootTargetIntf := bms.BootTarget.(*vpcv1.BareMetalServerBootTarget) + bmsBootTarget := bmsBootTargetIntf.ID + l[isBareMetalServerBootTarget] = bmsBootTarget + cpuList := make([]map[string]interface{}, 0) + if bms.Cpu != nil { + currentCPU := map[string]interface{}{} + currentCPU[isBareMetalServerCPUArchitecture] = *bms.Cpu.Architecture + currentCPU[isBareMetalServerCPUCoreCount] = *bms.Cpu.CoreCount + currentCPU[isBareMetalServerCpuSocketCount] = *bms.Cpu.SocketCount + currentCPU[isBareMetalServerCpuThreadPerCore] = *bms.Cpu.ThreadsPerCore + cpuList = append(cpuList, currentCPU) + } + l[isBareMetalServerCPU] = cpuList + l[isBareMetalServerName] = *bms.Name + l[isBareMetalServerCRN] = *bms.CRN + + // disks + + diskList := make([]map[string]interface{}, 0) + if bms.Disks != nil { + for _, disk := range bms.Disks { + currentDisk := map[string]interface{}{ + isBareMetalServerDiskHref: disk.Href, + isBareMetalServerDiskID: disk.ID, + isBareMetalServerDiskInterfaceType: disk.InterfaceType, + isBareMetalServerDiskName: disk.Name, + isBareMetalServerDiskResourceType: disk.ResourceType, + isBareMetalServerDiskSize: disk.Size, + } + diskList = append(diskList, currentDisk) + } + } + l[isBareMetalServerDisks] = diskList + + l[isBareMetalServerHref] = *bms.Href + l[isBareMetalServerMemory] = *bms.Memory + l[isBareMetalServerProfile] = *bms.Profile.Name + //pni + + if bms.PrimaryNetworkInterface != nil && bms.PrimaryNetworkInterface.ID != nil { + primaryNicList := make([]map[string]interface{}, 0) + currentPrimNic := map[string]interface{}{} + currentPrimNic["id"] = *bms.PrimaryNetworkInterface.ID + currentPrimNic[isBareMetalServerNicHref] = *bms.PrimaryNetworkInterface.Href + currentPrimNic[isBareMetalServerNicName] = *bms.PrimaryNetworkInterface.Name + currentPrimNic[isBareMetalServerNicHref] = *bms.PrimaryNetworkInterface.Href + currentPrimNic[isBareMetalServerNicSubnet] = *bms.PrimaryNetworkInterface.Subnet.ID + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *bms.PrimaryNetworkInterface.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + currentPrimNic[isBareMetalServerNicPrimaryIP] = primaryIpList + getnicoptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: bms.ID, + ID: bms.PrimaryNetworkInterface.ID, + } + bmsnic, response, err := sess.GetBareMetalServerNetworkInterface(getnicoptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting network interfaces attached to the bare metal server %s\n%s", err, response)) + } + + switch reflect.TypeOf(bmsnic).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + primNic := bmsnic.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + currentPrimNic[isInstanceNicAllowIPSpoofing] = *primNic.AllowIPSpoofing + if len(primNic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(primNic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(primNic.SecurityGroups[i].ID))) + } + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + primNic := bmsnic.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + currentPrimNic[isInstanceNicAllowIPSpoofing] = *primNic.AllowIPSpoofing + + if len(primNic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(primNic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(primNic.SecurityGroups[i].ID))) + } + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + } + + primaryNicList = append(primaryNicList, currentPrimNic) + l[isBareMetalServerPrimaryNetworkInterface] = primaryNicList + } + + //ni + + interfacesList := make([]map[string]interface{}, 0) + for _, intfc := range bms.NetworkInterfaces { + if intfc.ID != nil && *intfc.ID != *bms.PrimaryNetworkInterface.ID { + currentNic := map[string]interface{}{} + currentNic["id"] = *intfc.ID + currentNic[isBareMetalServerNicHref] = *intfc.Href + currentNic[isBareMetalServerNicName] = *intfc.Name + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *intfc.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + currentNic[isBareMetalServerNicPrimaryIP] = primaryIpList + getnicoptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: bms.ID, + ID: intfc.ID, + } + bmsnicintf, response, err := sess.GetBareMetalServerNetworkInterface(getnicoptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting network interfaces attached to the bare metal server %s\n%s", err, response)) + } + + switch reflect.TypeOf(bmsnicintf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + bmsnic := bmsnicintf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + currentNic[isBareMetalServerNicAllowIPSpoofing] = *bmsnic.AllowIPSpoofing + currentNic[isBareMetalServerNicSubnet] = *bmsnic.Subnet.ID + if len(bmsnic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(bmsnic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(bmsnic.SecurityGroups[i].ID))) + } + currentNic[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + bmsnic := bmsnicintf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + currentNic[isBareMetalServerNicAllowIPSpoofing] = *bmsnic.AllowIPSpoofing + currentNic[isBareMetalServerNicSubnet] = *bmsnic.Subnet.ID + if len(bmsnic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(bmsnic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(bmsnic.SecurityGroups[i].ID))) + } + currentNic[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + } + interfacesList = append(interfacesList, currentNic) + } + } + l[isBareMetalServerNetworkInterfaces] = interfacesList + l[isBareMetalServerCreatedAt] = bms.CreatedAt.String() + + //disks + l[isBareMetalServerResourceType] = *bms.ResourceType + l[isBareMetalServerStatus] = *bms.Status + if bms.StatusReasons != nil { + statusReasonsList := make([]map[string]interface{}, 0) + for _, sr := range bms.StatusReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR[isBareMetalServerStatusReasonsCode] = *sr.Code + currentSR[isBareMetalServerStatusReasonsMessage] = *sr.Message + statusReasonsList = append(statusReasonsList, currentSR) + } + } + l[isBareMetalServerStatusReasons] = statusReasonsList + } + l[isBareMetalServerVPC] = *bms.VPC.ID + l[isBareMetalServerZone] = *bms.Zone.Name + + // set keys and image using initialization + + optionsInitialization := &vpcv1.GetBareMetalServerInitializationOptions{ + ID: bms.ID, + } + + initialization, response, err := sess.GetBareMetalServerInitialization(optionsInitialization) + if err != nil || initialization == nil { + log.Printf("[ERROR] Error getting Bare Metal Server (%s) initialization : %s\n%s", *bms.ID, err, response) + } + + l[isBareMetalServerImage] = *initialization.Image.ID + + keyListList := []string{} + for i := 0; i < len(initialization.Keys); i++ { + keyListList = append(keyListList, string(*(initialization.Keys[i].ID))) + } + l[isBareMetalServerKeys] = keyListList + + tags, err := flex.GetTagsUsingCRN(meta, *bms.CRN) + if err != nil { + log.Printf( + "[ERROR] Error on get of resource bare metal server (%s) tags: %s", *bms.ID, err) + } + l[isBareMetalServerTags] = tags + if bms.ResourceGroup != nil { + l[isBareMetalServerResourceGroup] = *bms.ResourceGroup.ID + } + serversInfo = append(serversInfo, l) + } + d.SetId(dataSourceIBMISBareMetalServersID(d)) + d.Set(isBareMetalServers, serversInfo) + return nil +} + +// dataSourceIBMISBareMetalServersID returns a reasonable ID for a Bare Metal Servers list. +func dataSourceIBMISBareMetalServersID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host.go index c1b58a0c0a..7c1cc34e7d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,50 +9,51 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHost() *schema.Resource { +func DataSourceIbmIsDedicatedHost() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The unique name of this dedicated host", }, - "host_group": &schema.Schema{ + "host_group": { Type: schema.TypeString, Required: true, Description: "The unique identifier of the dedicated host group this dedicated host belongs to", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Optional: true, Computed: true, Description: "The unique identifier of the resource group this dedicated host belongs to", }, - "available_memory": &schema.Schema{ + "available_memory": { Type: schema.TypeInt, Computed: true, Description: "The amount of memory in gibibytes that is currently available for instances.", }, - "available_vcpu": &schema.Schema{ + "available_vcpu": { Type: schema.TypeList, Computed: true, Description: "The available VCPU for the dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "architecture": &schema.Schema{ + "architecture": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture.", }, - "count": &schema.Schema{ + "count": { Type: schema.TypeInt, Computed: true, Description: "The number of VCPUs assigned.", @@ -60,55 +61,55 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the dedicated host was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host.", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the dedicated host's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "available": &schema.Schema{ + "available": { Type: schema.TypeInt, Computed: true, Description: "The remaining space left for instance placement in GB (gigabytes).", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this disk.", }, - "instance_disks": &schema.Schema{ + "instance_disks": { Type: schema.TypeList, Computed: true, Description: "Instance disks that are on this dedicated host disk.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -116,22 +117,22 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", @@ -139,37 +140,37 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of this dedicated host disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined or system-provided name for this disk.", }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host disk is available for instance disk creation.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for this dedicated host disk.", @@ -180,34 +181,34 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "instance_placement_enabled": &schema.Schema{ + "instance_placement_enabled": { Type: schema.TypeBool, Computed: true, Description: "If set to true, instances can be placed on this dedicated host.", }, - "instances": &schema.Schema{ + "instances": { Type: schema.TypeList, Computed: true, Description: "Array of instances that are allocated to this dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this virtual server instance.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -215,17 +216,17 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this virtual server instance.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this virtual server instance (and default system hostname).", @@ -233,28 +234,28 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of the dedicated host resource.", }, - "memory": &schema.Schema{ + "memory": { Type: schema.TypeInt, Computed: true, Description: "The total amount of memory in gibibytes for this host.", }, - "profile": &schema.Schema{ + "profile": { Type: schema.TypeList, Computed: true, Description: "The profile this dedicated host uses.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this dedicated host profile.", @@ -262,38 +263,38 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host is available for instance creation.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "socket_count": &schema.Schema{ + "socket_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of sockets for this host.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The administrative state of the dedicated host.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which the unexpected property value was encountered.", }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on this dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -301,18 +302,18 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "vcpu": &schema.Schema{ + "vcpu": { Type: schema.TypeList, Computed: true, Description: "The total VCPU of the dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "architecture": &schema.Schema{ + "architecture": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture.", }, - "count": &schema.Schema{ + "count": { Type: schema.TypeInt, Computed: true, Description: "The number of VCPUs assigned.", @@ -320,7 +321,7 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Computed: true, Description: "The globally unique name of the zone this dedicated host resides in.", @@ -330,7 +331,7 @@ func dataSourceIbmIsDedicatedHost() *schema.Resource { } func dataSourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -355,100 +356,100 @@ func dataSourceIbmIsDedicatedHostRead(context context.Context, d *schema.Resourc d.SetId(*dedicatedHost.ID) if err = d.Set("available_memory", dedicatedHost.AvailableMemory); err != nil { - return diag.FromErr(fmt.Errorf("Error setting available_memory: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting available_memory: %s", err)) } if dedicatedHost.AvailableVcpu != nil { err = d.Set("available_vcpu", dataSourceDedicatedHostFlattenAvailableVcpu(*dedicatedHost.AvailableVcpu)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting available_vcpu %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting available_vcpu %s", err)) } } if err = d.Set("created_at", dedicatedHost.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", dedicatedHost.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if dedicatedHost.Disks != nil { err = d.Set("disks", dataSourceDedicatedHostFlattenDisks(dedicatedHost.Disks)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting disks %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting disks %s", err)) } } if dedicatedHost.Group != nil { err = d.Set("host_group", *dedicatedHost.Group.ID) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting group %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting group %s", err)) } } if err = d.Set("href", dedicatedHost.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("instance_placement_enabled", dedicatedHost.InstancePlacementEnabled); err != nil { - return diag.FromErr(fmt.Errorf("Error setting instance_placement_enabled: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_placement_enabled: %s", err)) } if dedicatedHost.Instances != nil { err = d.Set("instances", dataSourceDedicatedHostFlattenInstances(dedicatedHost.Instances)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting instances %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instances %s", err)) } } if err = d.Set("lifecycle_state", dedicatedHost.LifecycleState); err != nil { - return diag.FromErr(fmt.Errorf("Error setting lifecycle_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } if err = d.Set("memory", dedicatedHost.Memory); err != nil { - return diag.FromErr(fmt.Errorf("Error setting memory: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting memory: %s", err)) } if err = d.Set("name", dedicatedHost.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if dedicatedHost.Profile != nil { err = d.Set("profile", dataSourceDedicatedHostFlattenProfile(*dedicatedHost.Profile)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting profile %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile %s", err)) } } if err = d.Set("provisionable", dedicatedHost.Provisionable); err != nil { - return diag.FromErr(fmt.Errorf("Error setting provisionable: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting provisionable: %s", err)) } if dedicatedHost.ResourceGroup != nil { err = d.Set("resource_group", *dedicatedHost.ResourceGroup.ID) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group %s", err)) } } if err = d.Set("resource_type", dedicatedHost.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if err = d.Set("socket_count", dedicatedHost.SocketCount); err != nil { - return diag.FromErr(fmt.Errorf("Error setting socket_count: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting socket_count: %s", err)) } if err = d.Set("state", dedicatedHost.State); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state: %s", err)) } if dedicatedHost.SupportedInstanceProfiles != nil { err = d.Set("supported_instance_profiles", dataSourceDedicatedHostFlattenSupportedInstanceProfiles(dedicatedHost.SupportedInstanceProfiles)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting supported_instance_profiles %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting supported_instance_profiles %s", err)) } } if dedicatedHost.Vcpu != nil { err = d.Set("vcpu", dataSourceDedicatedHostFlattenVcpu(*dedicatedHost.Vcpu)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting vcpu %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vcpu %s", err)) } } if dedicatedHost.Zone != nil { err = d.Set("zone", *dedicatedHost.Zone.Name) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting zone %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone %s", err)) } } @@ -456,7 +457,7 @@ func dataSourceIbmIsDedicatedHostRead(context context.Context, d *schema.Resourc } } } - return diag.FromErr(fmt.Errorf("No Dedicated Host found with name %s", name)) + return diag.FromErr(fmt.Errorf("[ERROR] No Dedicated Host found with name %s", name)) } // dataSourceIbmIsDedicatedHostID returns a reasonable ID for the list. diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_disk.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_disk.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_disk.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_disk.go index a09283dc6f..def4fdae5d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_disk.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_disk.go @@ -1,62 +1,63 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHostDisk() *schema.Resource { +func DataSourceIbmIsDedicatedHostDisk() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostDiskRead, Schema: map[string]*schema.Schema{ - "dedicated_host": &schema.Schema{ + "dedicated_host": { Type: schema.TypeString, Required: true, Description: "The dedicated host identifier.", }, - "disk": &schema.Schema{ + "disk": { Type: schema.TypeString, Required: true, Description: "The dedicated host disk identifier.", }, - "available": &schema.Schema{ + "available": { Type: schema.TypeInt, Computed: true, Description: "The remaining space left for instance placement in GB (gigabytes).", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this disk.", }, - "instance_disks": &schema.Schema{ + "instance_disks": { Type: schema.TypeList, Computed: true, Description: "Instance disks that are on this dedicated host disk.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -64,22 +65,22 @@ func dataSourceIbmIsDedicatedHostDisk() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", @@ -87,37 +88,37 @@ func dataSourceIbmIsDedicatedHostDisk() *schema.Resource { }, }, }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of this dedicated host disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined or system-provided name for this disk.", }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host disk is available for instance disk creation.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for this dedicated host disk.", @@ -130,7 +131,7 @@ func dataSourceIbmIsDedicatedHostDisk() *schema.Resource { } func dataSourceIbmIsDedicatedHostDiskRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -148,43 +149,43 @@ func dataSourceIbmIsDedicatedHostDiskRead(context context.Context, d *schema.Res d.SetId(*dedicatedHostDisk.ID) if err = d.Set("available", dedicatedHostDisk.Available); err != nil { - return diag.FromErr(fmt.Errorf("Error setting available: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting available: %s", err)) } if err = d.Set("created_at", dedicatedHostDisk.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("href", dedicatedHostDisk.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if dedicatedHostDisk.InstanceDisks != nil { err = d.Set("instance_disks", dataSourceDedicatedHostDiskFlattenInstanceDisks(dedicatedHostDisk.InstanceDisks)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting instance_disks %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_disks %s", err)) } } if err = d.Set("interface_type", dedicatedHostDisk.InterfaceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting interface_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting interface_type: %s", err)) } if dedicatedHostDisk.LifecycleState != nil { if err = d.Set("lifecycle_state", dedicatedHostDisk.LifecycleState); err != nil { - return diag.FromErr(fmt.Errorf("Error setting lifecycle_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } } if err = d.Set("name", dedicatedHostDisk.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("provisionable", dedicatedHostDisk.Provisionable); err != nil { - return diag.FromErr(fmt.Errorf("Error setting provisionable: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting provisionable: %s", err)) } if err = d.Set("resource_type", dedicatedHostDisk.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if err = d.Set("size", dedicatedHostDisk.Size); err != nil { - return diag.FromErr(fmt.Errorf("Error setting size: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting size: %s", err)) } if err = d.Set("supported_instance_interface_types", dedicatedHostDisk.SupportedInstanceInterfaceTypes); err != nil { - return diag.FromErr(fmt.Errorf("Error setting supported_instance_interface_types: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting supported_instance_interface_types: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_disks.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_disks.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_disks.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_disks.go index 14d503a267..756279b3eb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_disks.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_disks.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,61 +9,62 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHostDisks() *schema.Resource { +func DataSourceIbmIsDedicatedHostDisks() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostDisksRead, Schema: map[string]*schema.Schema{ - "dedicated_host": &schema.Schema{ + "dedicated_host": { Type: schema.TypeString, Required: true, Description: "The dedicated host identifier.", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the dedicated host's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "available": &schema.Schema{ + "available": { Type: schema.TypeInt, Computed: true, Description: "The remaining space left for instance placement in GB (gigabytes).", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this disk.", }, - "instance_disks": &schema.Schema{ + "instance_disks": { Type: schema.TypeList, Computed: true, Description: "Instance disks that are on this dedicated host disk.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -71,22 +72,22 @@ func dataSourceIbmIsDedicatedHostDisks() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", @@ -94,37 +95,37 @@ func dataSourceIbmIsDedicatedHostDisks() *schema.Resource { }, }, }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of this dedicated host disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined or system-provided name for this disk.", }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host disk is available for instance disk creation.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for this dedicated host disk.", @@ -140,7 +141,7 @@ func dataSourceIbmIsDedicatedHostDisks() *schema.Resource { } func dataSourceIbmIsDedicatedHostDisksRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -160,7 +161,7 @@ func dataSourceIbmIsDedicatedHostDisksRead(context context.Context, d *schema.Re if dedicatedHostDiskCollection.Disks != nil { err = d.Set("disks", dataSourceDedicatedHostDiskCollectionFlattenDisks(dedicatedHostDiskCollection.Disks)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting disks %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting disks %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_group.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_group.go index e91a1ef31f..95b61b04fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_group.go @@ -1,62 +1,63 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHostGroup() *schema.Resource { +func DataSourceIbmIsDedicatedHostGroup() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostGroupRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "class": &schema.Schema{ + "class": { Type: schema.TypeString, Computed: true, Description: "The dedicated host profile class for hosts in this group.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the dedicated host group was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host group.", }, - "dedicated_hosts": &schema.Schema{ + "dedicated_hosts": { Type: schema.TypeList, Computed: true, Description: "The dedicated hosts that are in this dedicated host group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -64,22 +65,22 @@ func dataSourceIbmIsDedicatedHostGroup() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", @@ -87,38 +88,38 @@ func dataSourceIbmIsDedicatedHostGroup() *schema.Resource { }, }, }, - "family": &schema.Schema{ + "family": { Type: schema.TypeString, Computed: true, Description: "The dedicated host profile family for hosts in this group.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host group.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "The unique identifier of the resource group for this dedicated host group.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on this dedicated host group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -126,7 +127,7 @@ func dataSourceIbmIsDedicatedHostGroup() *schema.Resource { }, }, }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Computed: true, Description: "The globally unique name of the zone this dedicated host group resides in.", @@ -136,7 +137,7 @@ func dataSourceIbmIsDedicatedHostGroup() *schema.Resource { } func dataSourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -159,59 +160,59 @@ func dataSourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.Re dedicatedHostGroup = data d.SetId(*dedicatedHostGroup.ID) if err = d.Set("class", dedicatedHostGroup.Class); err != nil { - return diag.FromErr(fmt.Errorf("Error setting class: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting class: %s", err)) } if dedicatedHostGroup.CreatedAt != nil { if err = d.Set("created_at", dedicatedHostGroup.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } } if err = d.Set("crn", dedicatedHostGroup.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if dedicatedHostGroup.DedicatedHosts != nil { err = d.Set("dedicated_hosts", dataSourceDedicatedHostGroupFlattenDedicatedHosts(dedicatedHostGroup.DedicatedHosts)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting dedicated_hosts %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting dedicated_hosts %s", err)) } } if err = d.Set("family", dedicatedHostGroup.Family); err != nil { - return diag.FromErr(fmt.Errorf("Error setting family: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting family: %s", err)) } if err = d.Set("href", dedicatedHostGroup.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if dedicatedHostGroup.ResourceGroup != nil { err = d.Set("resource_group", *dedicatedHostGroup.ResourceGroup.ID) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group %s", err)) } } if err = d.Set("resource_type", dedicatedHostGroup.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if dedicatedHostGroup.SupportedInstanceProfiles != nil { err = d.Set("supported_instance_profiles", dataSourceDedicatedHostGroupFlattenSupportedInstanceProfiles(dedicatedHostGroup.SupportedInstanceProfiles)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting supported_instance_profiles %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting supported_instance_profiles %s", err)) } } if dedicatedHostGroup.Zone != nil { err = d.Set("zone", *dedicatedHostGroup.Zone.Name) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting zone %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone %s", err)) } } return nil } } } - return diag.FromErr(fmt.Errorf("No Dedicated Host Group found with name %s", name)) + return diag.FromErr(fmt.Errorf("[ERROR] No Dedicated Host Group found with name %s", name)) } func dataSourceDedicatedHostGroupFlattenDedicatedHosts(result []vpcv1.DedicatedHostReference) (dedicatedHosts []map[string]interface{}) { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_groups.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_groups.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_groups.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_groups.go index 544c38d7e4..414a0fb4d2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_groups.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,56 +9,58 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHostGroups() *schema.Resource { +func DataSourceIbmIsDedicatedHostGroups() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostGroupsRead, Schema: map[string]*schema.Schema{ - "host_groups": &schema.Schema{ + "host_groups": { Type: schema.TypeList, Computed: true, Description: "Collection of dedicated host groups.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "class": &schema.Schema{ + "class": { Type: schema.TypeString, Computed: true, Description: "The dedicated host profile class for hosts in this group.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the dedicated host group was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host group.", }, - "dedicated_hosts": &schema.Schema{ + "dedicated_hosts": { Type: schema.TypeList, Computed: true, Description: "The dedicated hosts that are in this dedicated host group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -66,22 +68,22 @@ func dataSourceIbmIsDedicatedHostGroups() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", @@ -89,48 +91,48 @@ func dataSourceIbmIsDedicatedHostGroups() *schema.Resource { }, }, }, - "family": &schema.Schema{ + "family": { Type: schema.TypeString, Computed: true, Description: "The dedicated host profile family for hosts in this group.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host group.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "The resource group for this dedicated host group.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on this dedicated host group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -138,7 +140,7 @@ func dataSourceIbmIsDedicatedHostGroups() *schema.Resource { }, }, }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Computed: true, Description: "The globally unique name of the zone this dedicated host group resides in.", @@ -146,7 +148,7 @@ func dataSourceIbmIsDedicatedHostGroups() *schema.Resource { }, }, }, - "total_count": &schema.Schema{ + "total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of resources across all pages.", @@ -156,7 +158,7 @@ func dataSourceIbmIsDedicatedHostGroups() *schema.Resource { } func dataSourceIbmIsDedicatedHostGroupsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -173,7 +175,7 @@ func dataSourceIbmIsDedicatedHostGroupsRead(context context.Context, d *schema.R log.Printf("[DEBUG] ListDedicatedHostGroupsWithContext failed %s\n%s", err, response) return diag.FromErr(err) } - start = GetNext(listDedicatedHostGroupsOptions.Next) + start = flex.GetNext(listDedicatedHostGroupsOptions.Next) allrecs = append(allrecs, listDedicatedHostGroupsOptions.Groups...) if start == "" { break @@ -185,11 +187,11 @@ func dataSourceIbmIsDedicatedHostGroupsRead(context context.Context, d *schema.R d.SetId(dataSourceIbmIsDedicatedHostGroupsID(d)) err = d.Set("host_groups", dataSourceDedicatedHostGroupCollectionFlattenGroups(allrecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting groups %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting groups %s", err)) } if err = d.Set("total_count", len(allrecs)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go index 285c3f6261..6adc3fadee 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_profile.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,44 +9,45 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { +func DataSourceIbmIsDedicatedHostProfile() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostProfileRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The globally unique name for this virtual server instance profile.", }, - "class": &schema.Schema{ + "class": { Type: schema.TypeString, Computed: true, Description: "The product class this dedicated host profile belongs to.", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the dedicated host profile's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The interface of the disk for a dedicated host with this profileThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", @@ -54,18 +55,18 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "quantity": &schema.Schema{ + "quantity": { Type: schema.TypeList, Computed: true, Description: "The number of disks of this type for a dedicated host with this profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", @@ -73,18 +74,18 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "size": &schema.Schema{ + "size": { Type: schema.TypeList, Computed: true, Description: "The size of the disk in GB (gigabytes).", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -92,17 +93,17 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for a dedicated host with this profile.", @@ -116,52 +117,52 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "family": &schema.Schema{ + "family": { Type: schema.TypeString, Computed: true, Description: "The product family this dedicated host profile belongs toThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "memory": &schema.Schema{ + "memory": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -172,42 +173,42 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "socket_count": &schema.Schema{ + "socket_count": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -218,18 +219,18 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on dedicated hosts with this profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -237,17 +238,17 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "vcpu_architecture": &schema.Schema{ + "vcpu_architecture": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture for a dedicated host with this profile.", @@ -255,42 +256,42 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { }, }, }, - "vcpu_count": &schema.Schema{ + "vcpu_count": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -306,7 +307,7 @@ func dataSourceIbmIsDedicatedHostProfile() *schema.Resource { } func dataSourceIbmIsDedicatedHostProfileRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -321,60 +322,60 @@ func dataSourceIbmIsDedicatedHostProfileRead(context context.Context, d *schema. return diag.FromErr(err) } if dedicatedHostProfile == nil { - return diag.FromErr(fmt.Errorf("No Dedicated Host Profile found with name %s", name)) + return diag.FromErr(fmt.Errorf("[ERROR] No Dedicated Host Profile found with name %s", name)) } d.SetId(dataSourceIbmIsDedicatedHostProfileID(d)) if err = d.Set("class", dedicatedHostProfile.Class); err != nil { - return diag.FromErr(fmt.Errorf("Error setting class: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting class: %s", err)) } if dedicatedHostProfile.Disks != nil { err = d.Set("disks", dataSourceDedicatedHostProfileFlattenDisks(dedicatedHostProfile.Disks)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting disks %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting disks %s", err)) } } if err = d.Set("family", dedicatedHostProfile.Family); err != nil { - return diag.FromErr(fmt.Errorf("Error setting family: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting family: %s", err)) } if err = d.Set("href", dedicatedHostProfile.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if dedicatedHostProfile.Memory != nil { err = d.Set("memory", dataSourceDedicatedHostProfileFlattenMemory(*dedicatedHostProfile.Memory.(*vpcv1.DedicatedHostProfileMemory))) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting memory %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting memory %s", err)) } } if dedicatedHostProfile.SocketCount != nil { err = d.Set("socket_count", dataSourceDedicatedHostProfileFlattenSocketCount(*dedicatedHostProfile.SocketCount.(*vpcv1.DedicatedHostProfileSocket))) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting socket_count %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting socket_count %s", err)) } } if dedicatedHostProfile.SupportedInstanceProfiles != nil { err = d.Set("supported_instance_profiles", dataSourceDedicatedHostProfileFlattenSupportedInstanceProfiles(dedicatedHostProfile.SupportedInstanceProfiles)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting supported_instance_profiles %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting supported_instance_profiles %s", err)) } } if dedicatedHostProfile.VcpuArchitecture != nil { err = d.Set("vcpu_architecture", dataSourceDedicatedHostProfileFlattenVcpuArchitecture(*dedicatedHostProfile.VcpuArchitecture)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting vcpu_architecture %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vcpu_architecture %s", err)) } } if dedicatedHostProfile.VcpuCount != nil { err = d.Set("vcpu_count", dataSourceDedicatedHostProfileFlattenVcpuCount(*dedicatedHostProfile.VcpuCount.(*vpcv1.DedicatedHostProfileVcpu))) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting vcpu_count %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vcpu_count %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go index ab70cdb96f..fee8a87832 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_host_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_host_profiles.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,45 +9,47 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { +func DataSourceIbmIsDedicatedHostProfiles() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostProfilesRead, Schema: map[string]*schema.Schema{ - "profiles": &schema.Schema{ + "profiles": { Type: schema.TypeList, Computed: true, Description: "Collection of dedicated host profiles.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "class": &schema.Schema{ + "class": { Type: schema.TypeString, Computed: true, Description: "The product class this dedicated host profile belongs to.", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the dedicated host profile's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The interface of the disk for a dedicated host with this profileThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", @@ -55,18 +57,18 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "quantity": &schema.Schema{ + "quantity": { Type: schema.TypeList, Computed: true, Description: "The number of disks of this type for a dedicated host with this profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", @@ -74,18 +76,18 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "size": &schema.Schema{ + "size": { Type: schema.TypeList, Computed: true, Description: "The size of the disk in GB (gigabytes).", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -93,17 +95,17 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for a dedicated host with this profile.", @@ -117,52 +119,52 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "family": &schema.Schema{ + "family": { Type: schema.TypeString, Computed: true, Description: "The product family this dedicated host profile belongs toThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "memory": &schema.Schema{ + "memory": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -173,47 +175,47 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this dedicated host profile.", }, - "socket_count": &schema.Schema{ + "socket_count": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -224,18 +226,18 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on dedicated hosts with this profile.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -243,18 +245,18 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "vcpu_architecture": &schema.Schema{ + "vcpu_architecture": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture for a dedicated host with this profile.", @@ -262,43 +264,43 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "vcpu_count": &schema.Schema{ + "vcpu_count": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -312,7 +314,7 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { }, }, }, - "total_count": &schema.Schema{ + "total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of resources across all pages.", @@ -322,7 +324,7 @@ func dataSourceIbmIsDedicatedHostProfiles() *schema.Resource { } func dataSourceIbmIsDedicatedHostProfilesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -340,7 +342,7 @@ func dataSourceIbmIsDedicatedHostProfilesRead(context context.Context, d *schema log.Printf("[DEBUG] ListDedicatedHostProfilesWithContext failed %s\n%s", err, response) return diag.FromErr(err) } - start = GetNext(dedicatedHostProfileCollection.Next) + start = flex.GetNext(dedicatedHostProfileCollection.Next) allrecs = append(allrecs, dedicatedHostProfileCollection.Profiles...) if start == "" { break @@ -353,11 +355,11 @@ func dataSourceIbmIsDedicatedHostProfilesRead(context context.Context, d *schema err = d.Set("profiles", dataSourceDedicatedHostProfileCollectionFlattenProfiles(allrecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting profiles %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profiles %s", err)) } if err = d.Set("total_count", len(allrecs)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_hosts.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_hosts.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go index 2280c52fb5..5c34e96b97 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_dedicated_hosts.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_dedicated_hosts.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,45 +9,47 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsDedicatedHosts() *schema.Resource { +func DataSourceIbmIsDedicatedHosts() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsDedicatedHostsRead, Schema: map[string]*schema.Schema{ - "host_group": &schema.Schema{ + "host_group": { Type: schema.TypeString, Optional: true, Description: "The unique identifier of the dedicated host group this dedicated host belongs to", }, - "dedicated_hosts": &schema.Schema{ + "dedicated_hosts": { Type: schema.TypeList, Computed: true, Description: "Collection of dedicated hosts.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "available_memory": &schema.Schema{ + "available_memory": { Type: schema.TypeInt, Computed: true, Description: "The amount of memory in gibibytes that is currently available for instances.", }, - "available_vcpu": &schema.Schema{ + "available_vcpu": { Type: schema.TypeList, Computed: true, Description: "The available VCPU for the dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "architecture": &schema.Schema{ + "architecture": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture.", }, - "count": &schema.Schema{ + "count": { Type: schema.TypeInt, Computed: true, Description: "The number of VCPUs assigned.", @@ -55,55 +57,55 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the dedicated host was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host.", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the dedicated host's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "available": &schema.Schema{ + "available": { Type: schema.TypeInt, Computed: true, Description: "The remaining space left for instance placement in GB (gigabytes).", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this disk.", }, - "instance_disks": &schema.Schema{ + "instance_disks": { Type: schema.TypeList, Computed: true, Description: "Instance disks that are on this dedicated host disk.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -111,22 +113,22 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", @@ -134,37 +136,37 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of this dedicated host disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined or system-provided name for this disk.", }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host disk is available for instance disk creation.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for this dedicated host disk.", @@ -175,44 +177,44 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "host_group": &schema.Schema{ + "host_group": { Type: schema.TypeString, Computed: true, Description: "The unique identifier of the dedicated host group this dedicated host is in.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host.", }, - "instance_placement_enabled": &schema.Schema{ + "instance_placement_enabled": { Type: schema.TypeBool, Computed: true, Description: "If set to true, instances can be placed on this dedicated host.", }, - "instances": &schema.Schema{ + "instances": { Type: schema.TypeList, Computed: true, Description: "Array of instances that are allocated to this dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this virtual server instance.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -220,17 +222,17 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this virtual server instance.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this virtual server instance (and default system hostname).", @@ -238,33 +240,33 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of the dedicated host resource.", }, - "memory": &schema.Schema{ + "memory": { Type: schema.TypeInt, Computed: true, Description: "The total amount of memory in gibibytes for this host.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "profile": &schema.Schema{ + "profile": { Type: schema.TypeList, Computed: true, Description: "The profile this dedicated host uses.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this dedicated host profile.", @@ -272,43 +274,43 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host is available for instance creation.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Computed: true, Description: "The unique identifier of the resource group for this dedicated host.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "socket_count": &schema.Schema{ + "socket_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of sockets for this host.", }, - "state": &schema.Schema{ + "state": { Type: schema.TypeString, Computed: true, Description: "The administrative state of the dedicated host.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which the unexpected property value was encountered.", }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on this dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -316,18 +318,18 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "vcpu": &schema.Schema{ + "vcpu": { Type: schema.TypeList, Computed: true, Description: "The total VCPU of the dedicated host.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "architecture": &schema.Schema{ + "architecture": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture.", }, - "count": &schema.Schema{ + "count": { Type: schema.TypeInt, Computed: true, Description: "The number of VCPUs assigned.", @@ -335,7 +337,7 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Computed: true, Description: "The globally unique name of the zone this dedicated host resides in.", @@ -343,7 +345,7 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { }, }, }, - "total_count": &schema.Schema{ + "total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of resources across all pages.", @@ -353,7 +355,7 @@ func dataSourceIbmIsDedicatedHosts() *schema.Resource { } func dataSourceIbmIsDedicatedHostsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -374,7 +376,7 @@ func dataSourceIbmIsDedicatedHostsRead(context context.Context, d *schema.Resour log.Printf("[DEBUG] ListDedicatedHostsWithContext failed %s\n%s", err, response) return diag.FromErr(err) } - start = GetNext(dedicatedHostCollection.Next) + start = flex.GetNext(dedicatedHostCollection.Next) allrecs = append(allrecs, dedicatedHostCollection.DedicatedHosts...) if start == "" { break @@ -387,11 +389,11 @@ func dataSourceIbmIsDedicatedHostsRead(context context.Context, d *schema.Resour err = d.Set("dedicated_hosts", dataSourceDedicatedHostCollectionFlattenDedicatedHosts(allrecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting dedicated_hosts %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting dedicated_hosts %s", err)) } if err = d.Set("total_count", len(allrecs)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_endpoint_gateway_targets.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_endpoint_gateway_targets.go new file mode 100644 index 0000000000..ca8be7918d --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_endpoint_gateway_targets.go @@ -0,0 +1,197 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "net/url" + "strconv" + "strings" + "time" + + "github.com/IBM-Cloud/bluemix-go/api/globalsearch/globalsearchv2" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM/platform-services-go-sdk/catalogmanagementv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isVPEResources = "resources" + isVPEResourceCRN = "crn" + isVPEResourceParent = "parent" + isVPEResourceName = "name" + isVPEResourceEndpointType = "endpoint_type" + isVPEResourceType = "resource_type" + isVPEResourceFullQualifiedDomainNames = "full_qualified_domain_names" + isVPEResourceServiceLocation = "location" +) + +func DataSourceIBMISEndpointGatewayTargets() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMISEndpointGatewayTargetsRead, + + Schema: map[string]*schema.Schema{ + isVPEResources: { + Type: schema.TypeList, + Computed: true, + Description: "List of resources", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isVPEResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "CRN for this specific object", + }, + isVPEResourceParent: { + Type: schema.TypeString, + Computed: true, + Description: "Parent for this specific object", + }, + isVPEResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "Display name in the requested language", + }, + isVPEResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "Resource type of this offering.", + }, + isVPEResourceEndpointType: { + Type: schema.TypeString, + Computed: true, + Description: "Data endpoint type of this offering", + }, + isVPEResourceFullQualifiedDomainNames: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Fully qualified domain names", + }, + isVPEResourceServiceLocation: { + Type: schema.TypeString, + Computed: true, + Description: "Service location of this offering", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMISEndpointGatewayTargetsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bmxSess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return diag.FromErr(err) + } + region := bmxSess.Config.Region + catalogManagementClient, err := meta.(conns.ClientSession).CatalogManagementV1() + if err != nil { + return diag.FromErr(err) + } + resourceInfo := make([]map[string]interface{}, 0) + getCatalogOptions := &catalogmanagementv1.SearchObjectsOptions{} + // query := "kind%3Avpe+AND+svc+AND+parent_id%3Aus-south" + query := fmt.Sprintf("kind:vpe AND svc AND parent_id:%s", region) + getCatalogOptions.Query = &query + digest := false + getCatalogOptions.Digest = &digest + + start := int64(0) + catalog := []catalogmanagementv1.CatalogObject{} + for { + if start != int64(0) { + getCatalogOptions.Offset = &start + } + search, response, err := catalogManagementClient.SearchObjectsWithContext(context, getCatalogOptions) + if err != nil { + log.Printf("[DEBUG] GetCatalogWithContext failed %s\n%s", err, response) + return diag.FromErr(err) + } + next := search.Next + if next == nil { + start = int64(0) + } else { + u, _ := url.Parse(fmt.Sprintf("%s", *next)) + q := u.Query() + start, _ = strconv.ParseInt(q.Get("offset"), 10, 64) + } + catalog = append(catalog, search.Resources...) + if start == int64(0) { + break + } + } + if catalog != nil { + for _, res := range catalog { + l := map[string]interface{}{} + if res.ParentID != nil { + l[isVPEResourceParent] = *res.ParentID + } + l[isVPEResourceType] = "provider_cloud_service" + if res.Label != nil { + l[isVPEResourceName] = *res.Label + } + sl := "" + data := res.Data + if data != nil { + if serviceCrn, ok := data["service_crn"].(string); ok { + if serviceCrn != "" { + l[isVPEResourceCRN] = serviceCrn + crnFs := strings.Split(serviceCrn, ":") + if len(crnFs) > 5 { + sl = crnFs[5] + } + l[isVPEResourceServiceLocation] = sl + } + } + if data["endpoint_type"] != nil { + l[isVPEResourceEndpointType] = data["endpoint_type"] + } + if data["fully_qualified_domain_names"] != nil { + l[isVPEResourceFullQualifiedDomainNames] = data["fully_qualified_domain_names"] + } + } + resourceInfo = append(resourceInfo, l) + } + staticService := map[string]interface{}{} + staticService[isVPEResourceName] = "ibm-ntp-server" + staticService[isVPEResourceType] = "provider_infrastructure_service" + resourceInfo = append(resourceInfo, staticService) + } + queryString := "doc.extensions.virtual_private_endpoints.endpoints.ip_address:*" + fields := []string{"name", "region", "family", "type", "crn", "tags", "organization_guid", "doc.extensions", "doc.resource_group_id", "doc.space_guid", "resource_id"} + getSearchOptions := globalsearchv2.SearchBody{ + Query: queryString, + Fields: fields, + } + globalSearchClient, err := meta.(conns.ClientSession).GlobalSearchAPI() + if err != nil { + return diag.FromErr(err) + } + searchResult, err := globalSearchClient.Searches().PostQuery(getSearchOptions) + if err != nil { + log.Printf("[DEBUG] PostQuery on globalSearchApi for query string %s failed %s", queryString, err) + return diag.FromErr(err) + } + searchItems := searchResult.Items + for _, item := range searchItems { + info := map[string]interface{}{} + info[isVPEResourceName] = item.Name + info[isVPEResourceType] = item.Type + info[isVPEResourceCRN] = item.CRN + resourceInfo = append(resourceInfo, info) + + } + + d.Set(isVPEResources, resourceInfo) + d.SetId(dataSourceIBMISEndpointGatewayTargetsId(d)) + return nil +} +func dataSourceIBMISEndpointGatewayTargetsId(d *schema.ResourceData) string { + return time.Now().UTC().String() +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_floating_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_floating_ip.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_floating_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_floating_ip.go index 3caf53294d..7c834d43bd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_floating_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_floating_ip.go @@ -1,11 +1,12 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -20,7 +21,7 @@ const ( floatingIPCRN = "crn" ) -func dataSourceIBMISFloatingIP() *schema.Resource { +func DataSourceIBMISFloatingIP() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISFloatingIPRead, @@ -66,7 +67,7 @@ func dataSourceIBMISFloatingIP() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Floating IP tags", }, }, @@ -97,9 +98,9 @@ func floatingIPGet(d *schema.ResourceData, meta interface{}, name string) error } floatingIPs, response, err := sess.ListFloatingIps(floatingIPOptions) if err != nil { - return fmt.Errorf("Error Fetching floating IPs %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching floating IPs %s\n%s", err, response) } - start = GetNext(floatingIPs.Next) + start = flex.GetNext(floatingIPs.Next) allFloatingIPs = append(allFloatingIPs, floatingIPs.FloatingIps...) if start == "" { break @@ -121,7 +122,7 @@ func floatingIPGet(d *schema.ResourceData, meta interface{}, name string) error d.Set(floatingIPTarget, target.ID) } - tags, err := GetTagsUsingCRN(meta, *ip.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *ip.CRN) if err != nil { fmt.Printf("Error on get of vpc Floating IP (%s) tags: %s", *ip.Address, err) } @@ -133,6 +134,6 @@ func floatingIPGet(d *schema.ResourceData, meta interface{}, name string) error } } - return fmt.Errorf("No floatingIP found with name %s", name) + return fmt.Errorf("[ERROR] No floatingIP found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_floating_ips.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_floating_ips.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_floating_ips.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_floating_ips.go index 37ffd36463..d1fab8d802 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_floating_ips.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_floating_ips.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,75 +9,76 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMIsFloatingIps() *schema.Resource { +func DataSourceIBMIsFloatingIps() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIsFloatingIpsRead, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The unique user-defined name for this floating IP.", }, - "floating_ips": &schema.Schema{ + "floating_ips": { Type: schema.TypeList, Computed: true, Description: "Collection of floating IPs.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The globally unique IP address.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the floating IP was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this floating IP.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this floating IP.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this floating IP.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this floating IP.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeList, Computed: true, Description: "The resource group for this floating IP.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this resource group.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this resource group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this resource group.", @@ -85,24 +86,24 @@ func dataSourceIBMIsFloatingIps() *schema.Resource { }, }, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the floating IP.", }, - "target": &schema.Schema{ + "target": { Type: schema.TypeList, Computed: true, Description: "The target of this floating IP.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -110,32 +111,32 @@ func dataSourceIBMIsFloatingIps() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this network interface.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this network interface.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this network interface.", }, - "primary_ipv4_address": &schema.Schema{ + "primary_ipv4_address": { Type: schema.TypeString, Computed: true, Description: "The primary IPv4 address.If the address has not yet been selected, the value will be `0.0.0.0`.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this public gateway.", @@ -143,18 +144,18 @@ func dataSourceIBMIsFloatingIps() *schema.Resource { }, }, }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeList, Computed: true, Description: "The zone this floating IP resides in.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this zone.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this zone.", @@ -184,9 +185,9 @@ func dataSourceIBMIsFloatingIpsRead(context context.Context, d *schema.ResourceD floatingIPs, response, err := sess.ListFloatingIps(floatingIPOptions) if err != nil { log.Printf("[DEBUG] Error Fetching floating IPs %s\n%s", err, response) - return diag.FromErr(fmt.Errorf("Error Fetching floating IPs %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Fetching floating IPs %s\n%s", err, response)) } - start = GetNext(floatingIPs.Next) + start = flex.GetNext(floatingIPs.Next) allFloatingIPs = append(allFloatingIPs, floatingIPs.FloatingIps...) if start == "" { break @@ -219,7 +220,7 @@ func dataSourceIBMIsFloatingIpsRead(context context.Context, d *schema.ResourceD if matchFloatingIps != nil { err = d.Set("floating_ips", dataSourceFloatingIPCollectionFlattenFloatingIps(matchFloatingIps)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting floating_ips %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting floating_ips %s", err)) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_flow_log.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_flow_log.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_flow_log.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_flow_log.go index 39e2489d33..a0cdeaab41 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_flow_log.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_flow_log.go @@ -1,20 +1,21 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMIsFlowLog() *schema.Resource { +func DataSourceIBMIsFlowLog() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIsFlowLogRead, @@ -32,53 +33,53 @@ func dataSourceIBMIsFlowLog() *schema.Resource { ExactlyOneOf: []string{"identifier", "name"}, Description: "The flow log collector identifier.", }, - "active": &schema.Schema{ + "active": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this collector is active.", }, - "auto_delete": &schema.Schema{ + "auto_delete": { Type: schema.TypeBool, Computed: true, Description: "If set to `true`, this flow log collector will be automatically deleted when the target is deleted.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the flow log collector was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this flow log collector.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this flow log collector.", }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of the flow log collector.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeList, Computed: true, Description: "The resource group for this flow log collector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this resource group.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this resource group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this resource group.", @@ -86,13 +87,13 @@ func dataSourceIBMIsFlowLog() *schema.Resource { }, }, }, - "storage_bucket": &schema.Schema{ + "storage_bucket": { Type: schema.TypeList, Computed: true, Description: "The Cloud Object Storage bucket where the collected flows are logged.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name of this COS bucket.", @@ -100,19 +101,19 @@ func dataSourceIBMIsFlowLog() *schema.Resource { }, }, }, - "target": &schema.Schema{ + "target": { Type: schema.TypeList, Computed: true, Description: "The target this collector is collecting flow logs for. If the target is an instance,subnet, or VPC, flow logs will not be collected for any network interfaces within thetarget that are themselves the target of a more specific flow log collector.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -120,27 +121,27 @@ func dataSourceIBMIsFlowLog() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this network interface.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this network interface.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this network interface.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this virtual server instance.", @@ -148,24 +149,24 @@ func dataSourceIBMIsFlowLog() *schema.Resource { }, }, }, - "vpc": &schema.Schema{ + "vpc": { Type: schema.TypeList, Computed: true, Description: "The VPC this flow log collector is associated with.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this VPC.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -173,17 +174,17 @@ func dataSourceIBMIsFlowLog() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this VPC.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this VPC.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this VPC.", @@ -215,9 +216,9 @@ func dataSourceIBMIsFlowLogRead(context context.Context, d *schema.ResourceData, } flowlogCollectors, response, err := sess.ListFlowLogCollectors(listOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error Fetching Flow Logs for VPC %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Fetching Flow Logs for VPC %s\n%s", err, response)) } - start = GetNext(flowlogCollectors.Next) + start = flex.GetNext(flowlogCollectors.Next) allrecs = append(allrecs, flowlogCollectors.FlowLogCollectors...) if start == "" { break @@ -230,7 +231,7 @@ func dataSourceIBMIsFlowLogRead(context context.Context, d *schema.ResourceData, } } if flowLogCollector == nil { - return diag.FromErr(fmt.Errorf("No flow log collector found with name (%s)", name)) + return diag.FromErr(fmt.Errorf("[ERROR] No flow log collector found with name (%s)", name)) } } else if identifier != "" { getFlowLogCollectorOptions := &vpcv1.GetFlowLogCollectorOptions{} @@ -247,41 +248,41 @@ func dataSourceIBMIsFlowLogRead(context context.Context, d *schema.ResourceData, d.SetId(*flowLogCollector.ID) if err = d.Set("active", flowLogCollector.Active); err != nil { - return diag.FromErr(fmt.Errorf("Error setting active: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting active: %s", err)) } if err = d.Set("auto_delete", flowLogCollector.AutoDelete); err != nil { - return diag.FromErr(fmt.Errorf("Error setting auto_delete: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting auto_delete: %s", err)) } - if err = d.Set("created_at", dateTimeToString(flowLogCollector.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(flowLogCollector.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", flowLogCollector.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("href", flowLogCollector.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("lifecycle_state", flowLogCollector.LifecycleState); err != nil { - return diag.FromErr(fmt.Errorf("Error setting lifecycle_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } if err = d.Set("name", flowLogCollector.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("identifier", *flowLogCollector.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting identifier: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting identifier: %s", err)) } if flowLogCollector.ResourceGroup != nil { err = d.Set("resource_group", dataSourceFlowLogCollectorFlattenResourceGroup(*flowLogCollector.ResourceGroup)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group %s", err)) } } if flowLogCollector.StorageBucket != nil { err = d.Set("storage_bucket", dataSourceFlowLogCollectorFlattenStorageBucket(*flowLogCollector.StorageBucket)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting storage_bucket %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting storage_bucket %s", err)) } } @@ -290,14 +291,14 @@ func dataSourceIBMIsFlowLogRead(context context.Context, d *schema.ResourceData, target := targetIntf.(*vpcv1.FlowLogCollectorTarget) err = d.Set("target", dataSourceFlowLogCollectorFlattenTarget(*target)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting target %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting target %s", err)) } } if flowLogCollector.VPC != nil { err = d.Set("vpc", dataSourceFlowLogCollectorFlattenVPC(*flowLogCollector.VPC)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting vpc %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vpc %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_flow_logs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_flow_logs.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_flow_logs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_flow_logs.go index 6d9fe2837b..b635deebe4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_flow_logs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_flow_logs.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +16,7 @@ const ( isFlowLogs = "flow_log_collectors" ) -func dataSourceIBMISFlowLogs() *schema.Resource { +func DataSourceIBMISFlowLogs() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISFlowLogsRead, @@ -104,9 +105,9 @@ func dataSourceIBMISFlowLogsRead(d *schema.ResourceData, meta interface{}) error } flowlogCollectors, response, err := sess.ListFlowLogCollectors(listOptions) if err != nil { - return fmt.Errorf("Error Fetching Flow Logs for VPC %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Flow Logs for VPC %s\n%s", err, response) } - start = GetNext(flowlogCollectors.Next) + start = flex.GetNext(flowlogCollectors.Next) allrecs = append(allrecs, flowlogCollectors.FlowLogCollectors...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ike_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ike_policies.go new file mode 100644 index 0000000000..e14ff6c8e2 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ike_policies.go @@ -0,0 +1,310 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsIkePolicies() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsIkePoliciesRead, + + Schema: map[string]*schema.Schema{ + "ike_policies": { + Type: schema.TypeList, + Computed: true, + Description: "Collection of IKE policies.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The authentication algorithm.", + }, + "connections": { + Type: schema.TypeList, + Computed: true, + Description: "The VPN gateway connections that use this IKE policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPN gateway connection.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN connection.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this IKE policy was created.", + }, + "dh_group": { + Type: schema.TypeInt, + Computed: true, + Description: "The Diffie-Hellman group.", + }, + "encryption_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The encryption algorithm.", + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The IKE policy's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this IKE policy.", + }, + "ike_version": { + Type: schema.TypeInt, + Computed: true, + Description: "The IKE protocol version.", + }, + "key_lifetime": { + Type: schema.TypeInt, + Computed: true, + Description: "The key lifetime in seconds.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this IKE policy.", + }, + "negotiation_mode": { + Type: schema.TypeString, + Computed: true, + Description: "The IKE negotiation mode. Only `main` is supported.", + }, + "resource_group": { + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this IKE policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsIkePoliciesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + start := "" + allrecs := []vpcv1.IkePolicy{} + for { + listIkePoliciesOptions := &vpcv1.ListIkePoliciesOptions{} + if start != "" { + listIkePoliciesOptions.Start = &start + } + ikePolicyCollection, response, err := vpcClient.ListIkePoliciesWithContext(context, listIkePoliciesOptions) + if err != nil || ikePolicyCollection == nil { + log.Printf("[DEBUG] ListIkePoliciesWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListIkePoliciesWithContext failed %s\n%s", err, response)) + } + start = flex.GetNext(ikePolicyCollection.Next) + allrecs = append(allrecs, ikePolicyCollection.IkePolicies...) + if start == "" { + break + } + } + + d.SetId(dataSourceIBMIsIkePoliciesID(d)) + + err = d.Set("ike_policies", dataSourceIkePolicyCollectionFlattenIkePolicies(allrecs)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting ike_policies %s", err)) + } + + return nil +} + +// dataSourceIBMIsIkePoliciesID returns a reasonable ID for the list. +func dataSourceIBMIsIkePoliciesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceIkePolicyCollectionFlattenIkePolicies(result []vpcv1.IkePolicy) (ikePolicies []map[string]interface{}) { + for _, ikePoliciesItem := range result { + ikePolicies = append(ikePolicies, dataSourceIkePolicyCollectionIkePoliciesToMap(ikePoliciesItem)) + } + + return ikePolicies +} + +func dataSourceIkePolicyCollectionIkePoliciesToMap(ikePoliciesItem vpcv1.IkePolicy) (ikePoliciesMap map[string]interface{}) { + ikePoliciesMap = map[string]interface{}{} + + if ikePoliciesItem.AuthenticationAlgorithm != nil { + ikePoliciesMap["authentication_algorithm"] = ikePoliciesItem.AuthenticationAlgorithm + } + if ikePoliciesItem.Connections != nil { + connectionsList := []map[string]interface{}{} + for _, connectionsItem := range ikePoliciesItem.Connections { + connectionsList = append(connectionsList, dataSourceIkePolicyCollectionIkePoliciesConnectionsToMap(connectionsItem)) + } + ikePoliciesMap["connections"] = connectionsList + } + if ikePoliciesItem.CreatedAt != nil { + ikePoliciesMap["created_at"] = ikePoliciesItem.CreatedAt.String() + } + if ikePoliciesItem.DhGroup != nil { + ikePoliciesMap["dh_group"] = ikePoliciesItem.DhGroup + } + if ikePoliciesItem.EncryptionAlgorithm != nil { + ikePoliciesMap["encryption_algorithm"] = ikePoliciesItem.EncryptionAlgorithm + } + if ikePoliciesItem.Href != nil { + ikePoliciesMap["href"] = ikePoliciesItem.Href + } + if ikePoliciesItem.ID != nil { + ikePoliciesMap["id"] = ikePoliciesItem.ID + } + if ikePoliciesItem.IkeVersion != nil { + ikePoliciesMap["ike_version"] = ikePoliciesItem.IkeVersion + } + if ikePoliciesItem.KeyLifetime != nil { + ikePoliciesMap["key_lifetime"] = ikePoliciesItem.KeyLifetime + } + if ikePoliciesItem.Name != nil { + ikePoliciesMap["name"] = ikePoliciesItem.Name + } + if ikePoliciesItem.NegotiationMode != nil { + ikePoliciesMap["negotiation_mode"] = ikePoliciesItem.NegotiationMode + } + if ikePoliciesItem.ResourceGroup != nil { + resourceGroupList := []map[string]interface{}{} + resourceGroupMap := dataSourceIkePolicyCollectionIkePoliciesResourceGroupToMap(*ikePoliciesItem.ResourceGroup) + resourceGroupList = append(resourceGroupList, resourceGroupMap) + ikePoliciesMap["resource_group"] = resourceGroupList + } + if ikePoliciesItem.ResourceType != nil { + ikePoliciesMap["resource_type"] = ikePoliciesItem.ResourceType + } + + return ikePoliciesMap +} + +func dataSourceIkePolicyCollectionIkePoliciesConnectionsToMap(connectionsItem vpcv1.VPNGatewayConnectionReference) (connectionsMap map[string]interface{}) { + connectionsMap = map[string]interface{}{} + + if connectionsItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceIkePolicyCollectionConnectionsDeletedToMap(*connectionsItem.Deleted) + deletedList = append(deletedList, deletedMap) + connectionsMap["deleted"] = deletedList + } + if connectionsItem.Href != nil { + connectionsMap["href"] = connectionsItem.Href + } + if connectionsItem.ID != nil { + connectionsMap["id"] = connectionsItem.ID + } + if connectionsItem.Name != nil { + connectionsMap["name"] = connectionsItem.Name + } + if connectionsItem.ResourceType != nil { + connectionsMap["resource_type"] = connectionsItem.ResourceType + } + + return connectionsMap +} + +func dataSourceIkePolicyCollectionConnectionsDeletedToMap(deletedItem vpcv1.VPNGatewayConnectionReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceIkePolicyCollectionIkePoliciesResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + + return resourceGroupMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ike_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ike_policy.go new file mode 100644 index 0000000000..16580ea781 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ike_policy.go @@ -0,0 +1,319 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsIkePolicy() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsIkePolicyRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"name", "ike_policy"}, + Description: "The IKE policy name.", + }, + "ike_policy": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"name", "ike_policy"}, + Description: "The IKE policy identifier.", + }, + "authentication_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The authentication algorithm.", + }, + "connections": { + Type: schema.TypeList, + Computed: true, + Description: "The VPN gateway connections that use this IKE policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPN gateway connection.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN connection.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this IKE policy was created.", + }, + "dh_group": { + Type: schema.TypeInt, + Computed: true, + Description: "The Diffie-Hellman group.", + }, + "encryption_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The encryption algorithm.", + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The IKE policy's canonical URL.", + }, + "ike_version": { + Type: schema.TypeInt, + Computed: true, + Description: "The IKE protocol version.", + }, + "key_lifetime": { + Type: schema.TypeInt, + Computed: true, + Description: "The key lifetime in seconds.", + }, + "negotiation_mode": { + Type: schema.TypeString, + Computed: true, + Description: "The IKE negotiation mode. Only `main` is supported.", + }, + "resource_group": { + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this IKE policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + } +} + +func dataSourceIBMIsIkePolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + name := d.Get("name").(string) + identifier := d.Get("ike_policy").(string) + var ikePolicy *vpcv1.IkePolicy + if name != "" { + start := "" + allrecs := []vpcv1.IkePolicy{} + for { + listIkePoliciesyOptions := &vpcv1.ListIkePoliciesOptions{} + if start != "" { + listIkePoliciesyOptions.Start = &start + } + ikePolicies, response, err := vpcClient.ListIkePolicies(listIkePoliciesyOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("Error Fetching IKE Policies %s\n%s", err, response)) + } + start = flex.GetNext(ikePolicies.Next) + allrecs = append(allrecs, ikePolicies.IkePolicies...) + if start == "" { + break + } + } + ike_policy_found := false + for _, ikePolicyItem := range allrecs { + if *ikePolicyItem.Name == name { + ikePolicy = &ikePolicyItem + ike_policy_found = true + break + } + } + if !ike_policy_found { + log.Printf("[DEBUG] No ike policy found with given name %s", name) + return diag.FromErr(fmt.Errorf("No ike policy found with given name %s", name)) + } + + } else { + getIkePolicyOptions := &vpcv1.GetIkePolicyOptions{} + + getIkePolicyOptions.SetID(identifier) + + ikePolicy1, response, err := vpcClient.GetIkePolicyWithContext(context, getIkePolicyOptions) + if err != nil { + log.Printf("[DEBUG] GetIkePolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetIkePolicyWithContext failed %s\n%s", err, response)) + } + ikePolicy = ikePolicy1 + } + + d.SetId(*ikePolicy.ID) + if err = d.Set("authentication_algorithm", ikePolicy.AuthenticationAlgorithm); err != nil { + return diag.FromErr(fmt.Errorf("Error setting authentication_algorithm: %s", err)) + } + + if ikePolicy.Connections != nil { + err = d.Set("connections", dataSourceIkePolicyFlattenConnections(ikePolicy.Connections)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting connections %s", err)) + } + } + if err = d.Set("created_at", flex.DateTimeToString(ikePolicy.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("dh_group", flex.IntValue(ikePolicy.DhGroup)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting dh_group: %s", err)) + } + if err = d.Set("encryption_algorithm", ikePolicy.EncryptionAlgorithm); err != nil { + return diag.FromErr(fmt.Errorf("Error setting encryption_algorithm: %s", err)) + } + if err = d.Set("href", ikePolicy.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("ike_version", flex.IntValue(ikePolicy.IkeVersion)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting ike_version: %s", err)) + } + if err = d.Set("key_lifetime", flex.IntValue(ikePolicy.KeyLifetime)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting key_lifetime: %s", err)) + } + if err = d.Set("name", ikePolicy.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("negotiation_mode", ikePolicy.NegotiationMode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting negotiation_mode: %s", err)) + } + + if ikePolicy.ResourceGroup != nil { + err = d.Set("resource_group", dataSourceIkePolicyFlattenResourceGroup(*ikePolicy.ResourceGroup)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + } + } + if err = d.Set("resource_type", ikePolicy.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + } + + return nil +} + +func dataSourceIkePolicyFlattenConnections(result []vpcv1.VPNGatewayConnectionReference) (connections []map[string]interface{}) { + for _, connectionsItem := range result { + connections = append(connections, dataSourceIkePolicyConnectionsToMap(connectionsItem)) + } + + return connections +} + +func dataSourceIkePolicyConnectionsToMap(connectionsItem vpcv1.VPNGatewayConnectionReference) (connectionsMap map[string]interface{}) { + connectionsMap = map[string]interface{}{} + + if connectionsItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceIkePolicyConnectionsDeletedToMap(*connectionsItem.Deleted) + deletedList = append(deletedList, deletedMap) + connectionsMap["deleted"] = deletedList + } + if connectionsItem.Href != nil { + connectionsMap["href"] = connectionsItem.Href + } + if connectionsItem.ID != nil { + connectionsMap["id"] = connectionsItem.ID + } + if connectionsItem.Name != nil { + connectionsMap["name"] = connectionsItem.Name + } + if connectionsItem.ResourceType != nil { + connectionsMap["resource_type"] = connectionsItem.ResourceType + } + + return connectionsMap +} + +func dataSourceIkePolicyConnectionsDeletedToMap(deletedItem vpcv1.VPNGatewayConnectionReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceIkePolicyFlattenResourceGroup(result vpcv1.ResourceGroupReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceIkePolicyResourceGroupToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceIkePolicyResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + + return resourceGroupMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_image.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_image.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_image.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_image.go index 0607db00c2..86a07f2942 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_image.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_image.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISImage() *schema.Resource { +func DataSourceIBMISImage() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISImageRead, @@ -33,7 +35,7 @@ func dataSourceIBMISImage() *schema.Resource { "visibility": { Type: schema.TypeString, Optional: true, - ValidateFunc: validateAllowedStringValue([]string{"public", "private"}), + ValidateFunc: validate.ValidateAllowedStringValues([]string{"public", "private"}), Description: "Whether the image is publicly visible or private to the account", }, @@ -122,9 +124,9 @@ func imageGetByName(d *schema.ResourceData, meta interface{}, name, visibility s } availableImages, response, err := sess.ListImages(listImagesOptions) if err != nil { - return fmt.Errorf("Error Fetching Images %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Images %s\n%s", err, response) } - start = GetNext(availableImages.Next) + start = flex.GetNext(availableImages.Next) allrecs = append(allrecs, availableImages.Images...) if start == "" { break @@ -159,7 +161,7 @@ func imageGetByName(d *schema.ResourceData, meta interface{}, name, visibility s } } - return fmt.Errorf("No image found with name %s", name) + return fmt.Errorf("[ERROR] No image found with name %s", name) } func imageGetById(d *schema.ResourceData, meta interface{}, identifier string) error { sess, err := vpcClient(meta) @@ -174,9 +176,9 @@ func imageGetById(d *schema.ResourceData, meta interface{}, identifier string) e image, response, err := sess.GetImage(getImageOptions) if err != nil { if response.StatusCode == 404 { - return fmt.Errorf("No image found with id %s", identifier) + return fmt.Errorf("[ERROR] No image found with id %s", identifier) } - return fmt.Errorf("Error Fetching Images %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Images %s\n%s", err, response) } d.SetId(*image.ID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_images.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_images.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_images.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_images.go index f5536b264f..07e6a0f335 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_images.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_images.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +18,7 @@ const ( isImagesResourceGroupID = "resource_group" ) -func dataSourceIBMISImages() *schema.Resource { +func DataSourceIBMISImages() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISImagesRead, @@ -29,7 +31,7 @@ func dataSourceIBMISImages() *schema.Resource { isImageName: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_image", isImageName), + ValidateFunc: validate.InvokeValidator("ibm_is_image", isImageName), Description: "The name of the image", }, isImageVisibility: { @@ -155,9 +157,9 @@ func imageList(d *schema.ResourceData, meta interface{}) error { } availableImages, response, err := sess.ListImages(listImagesOptions) if err != nil { - return fmt.Errorf("Error Fetching Images %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Images %s\n%s", err, response) } - start = GetNext(availableImages.Next) + start = flex.GetNext(availableImages.Next) allrecs = append(allrecs, availableImages.Images...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance.go index 54d531c459..a4bf5207db 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "bytes" @@ -15,6 +15,7 @@ import ( "log" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/ScaleFT/sshkeys" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -28,18 +29,30 @@ const ( isInstanceInitKeys = "keys" ) -func dataSourceIBMISInstance() *schema.Resource { +func DataSourceIBMISInstance() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceRead, Schema: map[string]*schema.Schema{ + isInstanceAvailablePolicyHostFailure: { + Type: schema.TypeString, + Computed: true, + Description: "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", + }, + isInstanceName: { Type: schema.TypeString, Required: true, Description: "Instance name", }, + isInstanceMetadataServiceEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the metadata service endpoint is available to the virtual server instance", + }, + isInstancePEM: { Type: schema.TypeString, Optional: true, @@ -120,7 +133,7 @@ func dataSourceIBMISInstance() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "list of tags for the instance", }, isInstanceBootVolume: { @@ -380,19 +393,19 @@ func dataSourceIBMISInstance() *schema.Resource { }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -404,13 +417,13 @@ func dataSourceIBMISInstance() *schema.Resource { Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -421,37 +434,37 @@ func dataSourceIBMISInstance() *schema.Resource { Description: "Collection of the instance's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -459,24 +472,24 @@ func dataSourceIBMISInstance() *schema.Resource { }, }, }, - "placement_target": &schema.Schema{ + "placement_target": { Type: schema.TypeList, Computed: true, Description: "The placement restrictions for the virtual server instance.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host group.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -484,22 +497,22 @@ func dataSourceIBMISInstance() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host group.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", @@ -536,9 +549,9 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er } instances, response, err := sess.ListInstances(listInstancesOptions) if err != nil { - return fmt.Errorf("Error Fetching Instances %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Instances %s\n%s", err, response) } - start = GetNext(instances.Next) + start = flex.GetNext(instances.Next) allrecs = append(allrecs, instances.Instances...) if start == "" { break @@ -552,6 +565,12 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er if instance.Profile != nil { d.Set(isInstanceProfile, *instance.Profile.Name) } + if instance.MetadataService != nil { + d.Set(isInstanceMetadataServiceEnabled, instance.MetadataService.Enabled) + } + if instance.AvailabilityPolicy != nil && instance.AvailabilityPolicy.HostFailure != nil { + d.Set(isInstanceAvailablePolicyHostFailure, *instance.AvailabilityPolicy.HostFailure) + } cpuList := make([]map[string]interface{}, 0) if instance.Vcpu != nil { currentCPU := map[string]interface{}{} @@ -607,7 +626,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er } insnic, response, err := sess.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s\n%s", err, response) } currentPrimNic[isInstanceNicSubnet] = *insnic.Subnet.ID if len(insnic.SecurityGroups) != 0 { @@ -615,7 +634,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er for i := 0; i < len(insnic.SecurityGroups); i++ { secgrpList = append(secgrpList, string(*(insnic.SecurityGroups[i].ID))) } - currentPrimNic[isInstanceNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } primaryNicList = append(primaryNicList, currentPrimNic) @@ -636,7 +655,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er } insnic, response, err := sess.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s\n%s", err, response) } currentNic[isInstanceNicSubnet] = *insnic.Subnet.ID if len(insnic.SecurityGroups) != 0 { @@ -644,7 +663,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er for i := 0; i < len(insnic.SecurityGroups); i++ { secgrpList = append(secgrpList, string(*(insnic.SecurityGroups[i].ID))) } - currentNic[isInstanceNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) @@ -667,7 +686,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er if keyFlag != "" { block, err := pem.Decode(keybytes) if block == nil { - return fmt.Errorf("Failed to load the private key from the given key contents. Instead of the key file path, please make sure the private key is pem format") + return fmt.Errorf("[ERROR] Failed to load the private key from the given key contents. Instead of the key file path, please make sure the private key is pem format") } isEncrypted := false switch block.Type { @@ -677,7 +696,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er var err error isEncrypted, err = isOpenSSHPrivKeyEncrypted(block.Bytes) if err != nil { - return fmt.Errorf("Failed to check if the provided open ssh key is encrypted or not %s", err) + return fmt.Errorf("[ERROR] Failed to check if the provided open ssh key is encrypted or not %s", err) } default: return fmt.Errorf("PEM and OpenSSH private key formats with RSA key type are supported, can not support this key file type: %s", err) @@ -705,7 +724,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er var ok bool rsaKey, ok = privateKey.(*rsa.PrivateKey) if !ok { - return fmt.Errorf("Failed to convert to RSA private key") + return fmt.Errorf("[ERROR] Failed to convert to RSA private key") } } } @@ -717,7 +736,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er } initParms, response, err := sess.GetInstanceInitialization(getInstanceInitializationOptions) if err != nil { - return fmt.Errorf("Error Getting instance Initialization: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting instance Initialization: %s\n%s", err, response) } if initParms.Keys != nil { initKeyList := make([]map[string]interface{}, 0) @@ -779,7 +798,7 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er } } } - d.Set(isInstanceVolumes, newStringSet(schema.HashString, volumes)) + d.Set(isInstanceVolumes, flex.NewStringSet(schema.HashString, volumes)) if instance.VolumeAttachments != nil { volList := make([]map[string]interface{}, 0) for _, volume := range instance.VolumeAttachments { @@ -811,30 +830,30 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er bootVolList = append(bootVolList, bootVol) d.Set(isInstanceBootVolume, bootVolList) } - tags, err := GetTagsUsingCRN(meta, *instance.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *instance.CRN) if err != nil { log.Printf( "Error on get of resource vpc Instance (%s) tags: %s", d.Id(), err) } d.Set(isInstanceTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/compute/vs") - d.Set(ResourceName, instance.Name) - d.Set(ResourceCRN, instance.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/compute/vs") + d.Set(flex.ResourceName, instance.Name) + d.Set(flex.ResourceCRN, instance.CRN) d.Set(IsInstanceCRN, instance.CRN) - d.Set(ResourceStatus, instance.Status) + d.Set(flex.ResourceStatus, instance.Status) if instance.ResourceGroup != nil { d.Set(isInstanceResourceGroup, instance.ResourceGroup.ID) - d.Set(ResourceGroupName, instance.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, instance.ResourceGroup.Name) } return nil } } - return fmt.Errorf("No Instance found with name %s", name) + return fmt.Errorf("[ERROR] No Instance found with name %s", name) } const opensshv1Magic = "openssh-key-v1" diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_disk.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_disk.go similarity index 77% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_disk.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_disk.go index d58095dbc0..3fa0368b44 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_disk.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_disk.go @@ -1,60 +1,61 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsInstanceDisk() *schema.Resource { +func DataSourceIbmIsInstanceDisk() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsInstanceDiskRead, Schema: map[string]*schema.Schema{ - "instance": &schema.Schema{ + "instance": { Type: schema.TypeString, Required: true, Description: "The instance identifier.", }, - "disk": &schema.Schema{ + "disk": { Type: schema.TypeString, Required: true, Description: "The instance disk identifier.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -64,7 +65,7 @@ func dataSourceIbmIsInstanceDisk() *schema.Resource { } func dataSourceIbmIsInstanceDiskRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -82,22 +83,22 @@ func dataSourceIbmIsInstanceDiskRead(context context.Context, d *schema.Resource d.SetId(*instanceDisk.ID) if err = d.Set("created_at", instanceDisk.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("href", instanceDisk.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("interface_type", instanceDisk.InterfaceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting interface_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting interface_type: %s", err)) } if err = d.Set("name", instanceDisk.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("resource_type", instanceDisk.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if err = d.Set("size", instanceDisk.Size); err != nil { - return diag.FromErr(fmt.Errorf("Error setting size: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting size: %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_disks.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_disks.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_disks.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_disks.go index 8b96977e31..f42fcc4af8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_disks.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_disks.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,59 +9,60 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsInstanceDisks() *schema.Resource { +func DataSourceIbmIsInstanceDisks() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsInstanceDisksRead, Schema: map[string]*schema.Schema{ - "instance": &schema.Schema{ + "instance": { Type: schema.TypeString, Required: true, Description: "The instance identifier.", }, - isInstanceDisks: &schema.Schema{ + isInstanceDisks: { Type: schema.TypeList, Computed: true, Description: "Collection of the instance's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -74,7 +75,7 @@ func dataSourceIbmIsInstanceDisks() *schema.Resource { } func dataSourceIbmIsInstanceDisksRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -93,7 +94,7 @@ func dataSourceIbmIsInstanceDisksRead(context context.Context, d *schema.Resourc if instanceDiskCollection.Disks != nil { err = d.Set(isInstanceDisks, dataSourceInstanceDiskCollectionFlattenDisks(instanceDiskCollection.Disks)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting disks %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting disks %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group.go index 140b308ae1..88930b423b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroup() *schema.Resource { +func DataSourceIBMISInstanceGroup() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupRead, @@ -105,9 +106,9 @@ func dataSourceIBMISInstanceGroupRead(d *schema.ResourceData, meta interface{}) } instanceGroupsCollection, response, err := sess.ListInstanceGroups(&listInstanceGroupOptions) if err != nil { - return fmt.Errorf("Error Fetching InstanceGroups %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching InstanceGroups %s\n%s", err, response) } - start = GetNext(instanceGroupsCollection.Next) + start = flex.GetNext(instanceGroupsCollection.Next) allrecs = append(allrecs, instanceGroupsCollection.InstanceGroups...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager.go index 2bb898ee48..95070d79f4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroupManager() *schema.Resource { +func DataSourceIBMISInstanceGroupManager() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupManagerRead, @@ -116,9 +117,9 @@ func dataSourceIBMISInstanceGroupManagerRead(d *schema.ResourceData, meta interf } instanceGroupManagerCollections, response, err := sess.ListInstanceGroupManagers(&listInstanceGroupManagerOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Managers %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Managers %s\n%s", err, response) } - start = GetNext(instanceGroupManagerCollections.Next) + start = flex.GetNext(instanceGroupManagerCollections.Next) allrecs = append(allrecs, instanceGroupManagerCollections.Managers...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_action.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_action.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_action.go index 467d5ab01b..8d2873fee3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_action.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroupManagerAction() *schema.Resource { +func DataSourceIBMISInstanceGroupManagerAction() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupManagerActionRead, @@ -154,12 +155,12 @@ func dataSourceIBMISInstanceGroupManagerActionRead(d *schema.ResourceData, meta } instanceGroupManagerActionsCollection, response, err := sess.ListInstanceGroupManagerActions(&listInstanceGroupManagerActionsOptions) if err != nil { - return fmt.Errorf("error Getting InstanceGroup Manager Actions %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Actions %s\n%s", err, response) } if instanceGroupManagerActionsCollection != nil && *instanceGroupManagerActionsCollection.TotalCount == int64(0) { break } - start = GetNext(instanceGroupManagerActionsCollection.Next) + start = flex.GetNext(instanceGroupManagerActionsCollection.Next) allrecs = append(allrecs, instanceGroupManagerActionsCollection.Actions...) if start == "" { break @@ -172,53 +173,53 @@ func dataSourceIBMISInstanceGroupManagerActionRead(d *schema.ResourceData, meta d.SetId(fmt.Sprintf("%s/%s/%s", instanceGroupID, instanceGroupManagerID, *instanceGroupManagerAction.ID)) if err = d.Set("auto_delete", *instanceGroupManagerAction.AutoDelete); err != nil { - return fmt.Errorf("error setting auto_delete: %s", err) + return fmt.Errorf("[ERROR] Error setting auto_delete: %s", err) } - if err = d.Set("auto_delete_timeout", intValue(instanceGroupManagerAction.AutoDeleteTimeout)); err != nil { - return fmt.Errorf("error setting auto_delete_timeout: %s", err) + if err = d.Set("auto_delete_timeout", flex.IntValue(instanceGroupManagerAction.AutoDeleteTimeout)); err != nil { + return fmt.Errorf("[ERROR] Error setting auto_delete_timeout: %s", err) } if err = d.Set("created_at", instanceGroupManagerAction.CreatedAt.String()); err != nil { - return fmt.Errorf("error setting created_at: %s", err) + return fmt.Errorf("[ERROR] Error setting created_at: %s", err) } if err = d.Set("action_id", *instanceGroupManagerAction.ID); err != nil { - return fmt.Errorf("error setting instance_group_manager_action : %s", err) + return fmt.Errorf("[ERROR] Error setting instance_group_manager_action : %s", err) } if err = d.Set("resource_type", *instanceGroupManagerAction.ResourceType); err != nil { - return fmt.Errorf("error setting resource_type: %s", err) + return fmt.Errorf("[ERROR] Error setting resource_type: %s", err) } if err = d.Set("status", *instanceGroupManagerAction.Status); err != nil { - return fmt.Errorf("error setting status: %s", err) + return fmt.Errorf("[ERROR] Error setting status: %s", err) } if err = d.Set("updated_at", instanceGroupManagerAction.UpdatedAt.String()); err != nil { - return fmt.Errorf("error setting updated_at: %s", err) + return fmt.Errorf("[ERROR] Error setting updated_at: %s", err) } if err = d.Set("action_type", *instanceGroupManagerAction.ActionType); err != nil { - return fmt.Errorf("error setting action_type: %s", err) + return fmt.Errorf("[ERROR] Error setting action_type: %s", err) } if instanceGroupManagerAction.CronSpec != nil { if err = d.Set("cron_spec", *instanceGroupManagerAction.CronSpec); err != nil { - return fmt.Errorf("error setting cron_spec: %s", err) + return fmt.Errorf("[ERROR] Error setting cron_spec: %s", err) } } if instanceGroupManagerAction.LastAppliedAt != nil { if err = d.Set("last_applied_at", instanceGroupManagerAction.LastAppliedAt.String()); err != nil { - return fmt.Errorf("error setting last_applied_at: %s", err) + return fmt.Errorf("[ERROR] Error setting last_applied_at: %s", err) } } if instanceGroupManagerAction.NextRunAt != nil { if err = d.Set("next_run_at", instanceGroupManagerAction.NextRunAt.String()); err != nil { - return fmt.Errorf("error setting next_run_at: %s", err) + return fmt.Errorf("[ERROR] Error setting next_run_at: %s", err) } } instanceGroupManagerScheduledActionGroupGroup := instanceGroupManagerAction.Group if instanceGroupManagerScheduledActionGroupGroup != nil && instanceGroupManagerScheduledActionGroupGroup.MembershipCount != nil { - d.Set("membership_count", intValue(instanceGroupManagerScheduledActionGroupGroup.MembershipCount)) + d.Set("membership_count", flex.IntValue(instanceGroupManagerScheduledActionGroupGroup.MembershipCount)) } instanceGroupManagerScheduledActionManagerManagerInt := instanceGroupManagerAction.Manager if instanceGroupManagerScheduledActionManagerManagerInt != nil { @@ -226,9 +227,9 @@ func dataSourceIBMISInstanceGroupManagerActionRead(d *schema.ResourceData, meta if instanceGroupManagerScheduledActionManagerManager != nil && instanceGroupManagerScheduledActionManagerManager.ID != nil { if instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount != nil { - d.Set("max_membership_count", intValue(instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount)) + d.Set("max_membership_count", flex.IntValue(instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount)) } - d.Set("min_membership_count", intValue(instanceGroupManagerScheduledActionManagerManager.MinMembershipCount)) + d.Set("min_membership_count", flex.IntValue(instanceGroupManagerScheduledActionManagerManager.MinMembershipCount)) d.Set("target_manager_name", *instanceGroupManagerScheduledActionManagerManager.Name) d.Set("target_manager", *instanceGroupManagerScheduledActionManagerManager.ID) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_actions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_actions.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_actions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_actions.go index d9f5487a04..02473ec7cc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_actions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_actions.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroupManagerActions() *schema.Resource { +func DataSourceIBMISInstanceGroupManagerActions() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupManagerActionsRead, @@ -170,12 +171,12 @@ func dataSourceIBMISInstanceGroupManagerActionsRead(d *schema.ResourceData, meta } instanceGroupManagerActionsCollection, response, err := sess.ListInstanceGroupManagerActions(&listInstanceGroupManagerActionsOptions) if err != nil { - return fmt.Errorf("error Getting InstanceGroup Manager Actions %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Actions %s\n%s", err, response) } if instanceGroupManagerActionsCollection != nil && *instanceGroupManagerActionsCollection.TotalCount == int64(0) { break } - start = GetNext(instanceGroupManagerActionsCollection.Next) + start = flex.GetNext(instanceGroupManagerActionsCollection.Next) allrecs = append(allrecs, instanceGroupManagerActionsCollection.Actions...) if start == "" { break @@ -189,7 +190,7 @@ func dataSourceIBMISInstanceGroupManagerActionsRead(d *schema.ResourceData, meta action := map[string]interface{}{ "name": *instanceGroupManagerAction.Name, "auto_delete": *instanceGroupManagerAction.AutoDelete, - "auto_delete_timeout": intValue(instanceGroupManagerAction.AutoDeleteTimeout), + "auto_delete_timeout": flex.IntValue(instanceGroupManagerAction.AutoDeleteTimeout), "created_at": instanceGroupManagerAction.CreatedAt.String(), "action_id": *instanceGroupManagerAction.ID, "resource_type": *instanceGroupManagerAction.ResourceType, @@ -208,7 +209,7 @@ func dataSourceIBMISInstanceGroupManagerActionsRead(d *schema.ResourceData, meta } instanceGroupManagerScheduledActionGroupGroup := instanceGroupManagerAction.Group if instanceGroupManagerScheduledActionGroupGroup != nil && instanceGroupManagerScheduledActionGroupGroup.MembershipCount != nil { - action["membership_count"] = intValue(instanceGroupManagerScheduledActionGroupGroup.MembershipCount) + action["membership_count"] = flex.IntValue(instanceGroupManagerScheduledActionGroupGroup.MembershipCount) } instanceGroupManagerScheduledActionManagerManagerInt := instanceGroupManagerAction.Manager if instanceGroupManagerScheduledActionManagerManagerInt != nil { @@ -216,9 +217,9 @@ func dataSourceIBMISInstanceGroupManagerActionsRead(d *schema.ResourceData, meta if instanceGroupManagerScheduledActionManagerManager != nil && instanceGroupManagerScheduledActionManagerManager.ID != nil { if instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount != nil { - action["max_membership_count"] = intValue(instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount) + action["max_membership_count"] = flex.IntValue(instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount) } - action["min_membership_count"] = intValue(instanceGroupManagerScheduledActionManagerManager.MinMembershipCount) + action["min_membership_count"] = flex.IntValue(instanceGroupManagerScheduledActionManagerManager.MinMembershipCount) action["target_manager_name"] = *instanceGroupManagerScheduledActionManagerManager.Name action["target_manager"] = *instanceGroupManagerScheduledActionManagerManager.ID } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_policies.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_policies.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_policies.go index 91634ce108..bbdbe77099 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_policies.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_policies.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroupManagerPolicies() *schema.Resource { +func DataSourceIBMISInstanceGroupManagerPolicies() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupManagerPoliciesRead, @@ -100,9 +101,9 @@ func dataSourceIBMISInstanceGroupManagerPoliciesRead(d *schema.ResourceData, met } instanceGroupManagerPolicyCollection, response, err := sess.ListInstanceGroupManagerPolicies(&listInstanceGroupManagerPoliciesOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Manager Policies %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Policies %s\n%s", err, response) } - start = GetNext(instanceGroupManagerPolicyCollection.Next) + start = flex.GetNext(instanceGroupManagerPolicyCollection.Next) allrecs = append(allrecs, instanceGroupManagerPolicyCollection.Policies...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_policy.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_policy.go index a15aaa7f57..4287407e12 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_manager_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_manager_policy.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroupManagerPolicy() *schema.Resource { +func DataSourceIBMISInstanceGroupManagerPolicy() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupManagerPolicyRead, @@ -84,9 +85,9 @@ func dataSourceIBMISInstanceGroupManagerPolicyRead(d *schema.ResourceData, meta } instanceGroupManagerPolicyCollection, response, err := sess.ListInstanceGroupManagerPolicies(&listInstanceGroupManagerPoliciesOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Manager Policies %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Policies %s\n%s", err, response) } - start = GetNext(instanceGroupManagerPolicyCollection.Next) + start = flex.GetNext(instanceGroupManagerPolicyCollection.Next) allrecs = append(allrecs, instanceGroupManagerPolicyCollection.Policies...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_managers.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_managers.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_managers.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_managers.go index dfec1220e8..fe68e482e8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_managers.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_managers.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceGroupManagers() *schema.Resource { +func DataSourceIBMISInstanceGroupManagers() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupManagersRead, @@ -133,10 +134,10 @@ func dataSourceIBMISInstanceGroupManagersRead(d *schema.ResourceData, meta inter } instanceGroupManagerCollections, response, err := sess.ListInstanceGroupManagers(&listInstanceGroupManagerOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Managers %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Managers %s\n%s", err, response) } - start = GetNext(instanceGroupManagerCollections.Next) + start = flex.GetNext(instanceGroupManagerCollections.Next) allrecs = append(allrecs, instanceGroupManagerCollections.Managers...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_membership.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_membership.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_membership.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_membership.go index 9310f7f013..140416ea23 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_membership.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_membership.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMISInstanceGroupMembership() *schema.Resource { +func DataSourceIBMISInstanceGroupMembership() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupMembershipRead, @@ -115,10 +116,10 @@ func dataSourceIBMISInstanceGroupMembershipRead(d *schema.ResourceData, meta int } instanceGroupMembershipCollection, response, err := sess.ListInstanceGroupMemberships(&listInstanceGroupMembershipsOptions) if err != nil || instanceGroupMembershipCollection == nil { - return fmt.Errorf("Error Getting InstanceGroup Membership Collection %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Membership Collection %s\n%s", err, response) } - start = GetNext(instanceGroupMembershipCollection.Next) + start = flex.GetNext(instanceGroupMembershipCollection.Next) allrecs = append(allrecs, instanceGroupMembershipCollection.Memberships...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_memberships.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_memberships.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_memberships.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_memberships.go index 0445750524..d39476f5cd 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_group_memberships.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_group_memberships.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" @@ -16,7 +17,7 @@ const ( isInstanceGroupMemberships = "memberships" ) -func dataSourceIBMISInstanceGroupMemberships() *schema.Resource { +func DataSourceIBMISInstanceGroupMemberships() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceGroupMembershipsRead, @@ -130,10 +131,10 @@ func dataSourceIBMISInstanceGroupMembershipsRead(d *schema.ResourceData, meta in } instanceGroupMembershipCollection, response, err := sess.ListInstanceGroupMemberships(&listInstanceGroupMembershipsOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Membership Collection %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Membership Collection %s\n%s", err, response) } - start = GetNext(instanceGroupMembershipCollection.Next) + start = flex.GetNext(instanceGroupMembershipCollection.Next) allrecs = append(allrecs, instanceGroupMembershipCollection.Memberships...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_network_interface.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_network_interface.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_network_interface.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_network_interface.go index 75db17376f..5fc422780e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_network_interface.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_network_interface.go @@ -1,67 +1,69 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { +func DataSourceIBMIsInstanceNetworkInterface() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIsInstanceNetworkInterfaceRead, Schema: map[string]*schema.Schema{ - "instance_name": &schema.Schema{ + "instance_name": { Type: schema.TypeString, Required: true, Description: "The instance name.", }, - "network_interface_name": &schema.Schema{ + "network_interface_name": { Type: schema.TypeString, Required: true, Description: "The network interface name.", }, - "allow_ip_spoofing": &schema.Schema{ + "allow_ip_spoofing": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the network interface was created.", }, - "floating_ips": &schema.Schema{ + "floating_ips": { Type: schema.TypeList, Computed: true, Description: "The floating IPs associated with this network interface.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The globally unique IP address.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this floating IP.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -69,17 +71,17 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this floating IP.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this floating IP.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this floating IP.", @@ -87,49 +89,49 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this network interface.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this network interface.", }, - "port_speed": &schema.Schema{ + "port_speed": { Type: schema.TypeInt, Computed: true, Description: "The network interface port speed in Mbps.", }, - "primary_ipv4_address": &schema.Schema{ + "primary_ipv4_address": { Type: schema.TypeString, Computed: true, Description: "The primary IPv4 address.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "security_groups": &schema.Schema{ + "security_groups": { Type: schema.TypeList, Computed: true, Description: "Collection of security groups.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The security group's CRN.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -137,17 +139,17 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The security group's canonical URL.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this security group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", @@ -155,29 +157,29 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the network interface.", }, - "subnet": &schema.Schema{ + "subnet": { Type: schema.TypeList, Computed: true, Description: "The associated subnet.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this subnet.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -185,17 +187,17 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this subnet.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this subnet.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this subnet.", @@ -203,7 +205,7 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of this network interface as it relates to an instance.", @@ -213,7 +215,7 @@ func dataSourceIBMIsInstanceNetworkInterface() *schema.Resource { } func dataSourceIBMIsInstanceNetworkInterfaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -231,9 +233,9 @@ func dataSourceIBMIsInstanceNetworkInterfaceRead(context context.Context, d *sch instances, response, err := vpcClient.ListInstancesWithContext(context, listInstancesOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error Fetching Instances %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Fetching Instances %s\n%s", err, response)) } - start = GetNext(instances.Next) + start = flex.GetNext(instances.Next) allrecs = append(allrecs, instances.Instances...) if start == "" { break @@ -258,52 +260,52 @@ func dataSourceIBMIsInstanceNetworkInterfaceRead(context context.Context, d *sch if *networkInterface.Name == network_interface_name { d.SetId(fmt.Sprintf("%s/%s", ins_id, *networkInterface.ID)) if err = d.Set("allow_ip_spoofing", networkInterface.AllowIPSpoofing); err != nil { - return diag.FromErr(fmt.Errorf("Error setting allow_ip_spoofing: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting allow_ip_spoofing: %s", err)) } - if err = d.Set("created_at", dateTimeToString(networkInterface.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(networkInterface.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if networkInterface.FloatingIps != nil { err = d.Set("floating_ips", dataSourceNetworkInterfaceFlattenFloatingIps(networkInterface.FloatingIps)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting floating_ips %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting floating_ips %s", err)) } } if err = d.Set("href", networkInterface.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("name", networkInterface.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } - if err = d.Set("port_speed", intValue(networkInterface.PortSpeed)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting port_speed: %s", err)) + if err = d.Set("port_speed", flex.IntValue(networkInterface.PortSpeed)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting port_speed: %s", err)) } if err = d.Set("primary_ipv4_address", networkInterface.PrimaryIpv4Address); err != nil { - return diag.FromErr(fmt.Errorf("Error setting primary_ipv4_address: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting primary_ipv4_address: %s", err)) } if err = d.Set("resource_type", networkInterface.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if networkInterface.SecurityGroups != nil { err = d.Set("security_groups", dataSourceNetworkInterfaceFlattenSecurityGroups(networkInterface.SecurityGroups)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting security_groups %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting security_groups %s", err)) } } if err = d.Set("status", networkInterface.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if networkInterface.Subnet != nil { err = d.Set("subnet", dataSourceNetworkInterfaceFlattenSubnet(*networkInterface.Subnet)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting subnet %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subnet %s", err)) } } if err = d.Set("type", networkInterface.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_network_interfaces.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_network_interfaces.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_network_interfaces.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_network_interfaces.go index 02e2cb81ef..cbbfc7f7e9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_network_interfaces.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_network_interfaces.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,61 +9,63 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { +func DataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIsInstanceNetworkInterfacesRead, Schema: map[string]*schema.Schema{ - "instance_name": &schema.Schema{ + "instance_name": { Type: schema.TypeString, Required: true, Description: "The instance name.", }, - "network_interfaces": &schema.Schema{ + "network_interfaces": { Type: schema.TypeList, Computed: true, Description: "Collection of network interfaces.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "allow_ip_spoofing": &schema.Schema{ + "allow_ip_spoofing": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the network interface was created.", }, - "floating_ips": &schema.Schema{ + "floating_ips": { Type: schema.TypeList, Computed: true, Description: "The floating IPs associated with this network interface.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The globally unique IP address.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this floating IP.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -71,17 +73,17 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this floating IP.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this floating IP.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this floating IP.", @@ -89,54 +91,54 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this network interface.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this network interface.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this network interface.", }, - "port_speed": &schema.Schema{ + "port_speed": { Type: schema.TypeInt, Computed: true, Description: "The network interface port speed in Mbps.", }, - "primary_ipv4_address": &schema.Schema{ + "primary_ipv4_address": { Type: schema.TypeString, Computed: true, Description: "The primary IPv4 address.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "security_groups": &schema.Schema{ + "security_groups": { Type: schema.TypeList, Computed: true, Description: "Collection of security groups.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The security group's CRN.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -144,17 +146,17 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The security group's canonical URL.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this security group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", @@ -162,29 +164,29 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the network interface.", }, - "subnet": &schema.Schema{ + "subnet": { Type: schema.TypeList, Computed: true, Description: "The associated subnet.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this subnet.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -192,17 +194,17 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this subnet.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this subnet.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this subnet.", @@ -210,7 +212,7 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of this network interface as it relates to an instance.", @@ -218,7 +220,7 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { }, }, }, - "total_count": &schema.Schema{ + "total_count": { Type: schema.TypeInt, Computed: true, Description: "The total number of resources across all pages.", @@ -228,7 +230,7 @@ func dataSourceIBMIsInstanceNetworkInterfaces() *schema.Resource { } func dataSourceIBMIsInstanceNetworkInterfacesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -246,9 +248,9 @@ func dataSourceIBMIsInstanceNetworkInterfacesRead(context context.Context, d *sc instances, response, err := vpcClient.ListInstances(listInstancesOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error Fetching Instances %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Fetching Instances %s\n%s", err, response)) } - start = GetNext(instances.Next) + start = flex.GetNext(instances.Next) allrecs = append(allrecs, instances.Instances...) if start == "" { break @@ -274,7 +276,7 @@ func dataSourceIBMIsInstanceNetworkInterfacesRead(context context.Context, d *sc if networkInterfaceCollection.NetworkInterfaces != nil { err = d.Set("network_interfaces", dataSourceNetworkInterfaceCollectionFlattenNetworkInterfaces(networkInterfaceCollection.NetworkInterfaces)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting network_interfaces %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting network_interfaces %s", err)) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_profile.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_profile.go index 8972880741..935c886874 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_profile.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "github.com/IBM/vpc-go-sdk/vpcv1" @@ -14,7 +14,7 @@ const ( isInstanceProfileArchitecture = "architecture" ) -func dataSourceIBMISInstanceProfile() *schema.Resource { +func DataSourceIBMISInstanceProfile() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceProfileRead, @@ -37,13 +37,13 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { Description: "The default OS architecture for an instance with this profile.", }, - "architecture_type": &schema.Schema{ + "architecture_type": { Type: schema.TypeString, Computed: true, Description: "The type for the OS architecture.", }, - "architecture_values": &schema.Schema{ + "architecture_values": { Type: schema.TypeList, Computed: true, Description: "The supported OS architecture(s) for an instance with this profile.", @@ -52,42 +52,42 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, - "bandwidth": &schema.Schema{ + "bandwidth": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -104,37 +104,37 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { Description: "GPU count of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -151,12 +151,12 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { Description: "GPU manufacturer of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The possible GPU manufacturer(s) for an instance with this profile", @@ -173,37 +173,37 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { Description: "GPU memory of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -220,12 +220,12 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { Description: "GPU model of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The possible GPU model(s) for an instance with this profile", @@ -236,43 +236,43 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "total_volume_bandwidth": &schema.Schema{ + "total_volume_bandwidth": { Type: schema.TypeList, Computed: true, Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to total_network_bandwidth.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -283,48 +283,48 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the instance profile's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "quantity": &schema.Schema{ + "quantity": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -335,42 +335,42 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "size": &schema.Schema{ + "size": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -381,22 +381,22 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "supported_interface_types": &schema.Schema{ + "supported_interface_types": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "default": &schema.Schema{ + "default": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The supported disk interfaces used for attaching the disk.", @@ -410,47 +410,47 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "memory": &schema.Schema{ + "memory": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -461,17 +461,17 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "port_speed": &schema.Schema{ + "port_speed": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", @@ -479,22 +479,22 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "vcpu_architecture": &schema.Schema{ + "vcpu_architecture": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "default": &schema.Schema{ + "default": { Type: schema.TypeString, Computed: true, Description: "The default VCPU architecture for an instance with this profile.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture for an instance with this profile.", @@ -502,42 +502,42 @@ func dataSourceIBMISInstanceProfile() *schema.Resource { }, }, }, - "vcpu_count": &schema.Schema{ + "vcpu_count": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_profiles.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_profiles.go index 013326071f..8c0abbc580 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_profiles.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -15,7 +15,7 @@ const ( isInstanceProfiles = "profiles" ) -func dataSourceIBMISInstanceProfiles() *schema.Resource { +func DataSourceIBMISInstanceProfiles() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceProfilesRead, @@ -41,13 +41,13 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { Computed: true, Description: "The default OS architecture for an instance with this profile.", }, - "architecture_type": &schema.Schema{ + "architecture_type": { Type: schema.TypeString, Computed: true, Description: "The type for the OS architecture.", }, - "architecture_values": &schema.Schema{ + "architecture_values": { Type: schema.TypeList, Computed: true, Description: "The supported OS architecture(s) for an instance with this profile.", @@ -55,42 +55,42 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { Type: schema.TypeString, }, }, - "bandwidth": &schema.Schema{ + "bandwidth": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -107,37 +107,37 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { Description: "GPU count of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -154,12 +154,12 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { Description: "GPU manufacturer of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The possible GPU manufacturer(s) for an instance with this profile", @@ -176,37 +176,37 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { Description: "GPU memory of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -223,12 +223,12 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { Description: "GPU model of this profile", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The possible GPU model(s) for an instance with this profile", @@ -239,43 +239,43 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "total_volume_bandwidth": &schema.Schema{ + "total_volume_bandwidth": { Type: schema.TypeList, Computed: true, Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to total_network_bandwidth.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -286,48 +286,48 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the instance profile's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "quantity": &schema.Schema{ + "quantity": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -338,42 +338,42 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "size": &schema.Schema{ + "size": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -384,22 +384,22 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "supported_interface_types": &schema.Schema{ + "supported_interface_types": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "default": &schema.Schema{ + "default": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The supported disk interfaces used for attaching the disk.", @@ -413,47 +413,47 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "memory": &schema.Schema{ + "memory": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -464,17 +464,17 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "port_speed": &schema.Schema{ + "port_speed": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", @@ -482,22 +482,22 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "vcpu_architecture": &schema.Schema{ + "vcpu_architecture": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "default": &schema.Schema{ + "default": { Type: schema.TypeString, Computed: true, Description: "The default VCPU architecture for an instance with this profile.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeString, Computed: true, Description: "The VCPU architecture for an instance with this profile.", @@ -505,42 +505,42 @@ func dataSourceIBMISInstanceProfiles() *schema.Resource { }, }, }, - "vcpu_count": &schema.Schema{ + "vcpu_count": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type for this profile field.", }, - "value": &schema.Schema{ + "value": { Type: schema.TypeInt, Computed: true, Description: "The value for this profile field.", }, - "default": &schema.Schema{ + "default": { Type: schema.TypeInt, Computed: true, Description: "The default value for this profile field.", }, - "max": &schema.Schema{ + "max": { Type: schema.TypeInt, Computed: true, Description: "The maximum value for this profile field.", }, - "min": &schema.Schema{ + "min": { Type: schema.TypeInt, Computed: true, Description: "The minimum value for this profile field.", }, - "step": &schema.Schema{ + "step": { Type: schema.TypeInt, Computed: true, Description: "The increment step value for this profile field.", }, - "values": &schema.Schema{ + "values": { Type: schema.TypeList, Computed: true, Description: "The permitted values for this profile field.", @@ -574,7 +574,7 @@ func instanceProfilesList(d *schema.ResourceData, meta interface{}) error { listInstanceProfilesOptions := &vpcv1.ListInstanceProfilesOptions{} availableProfiles, response, err := sess.ListInstanceProfiles(listInstanceProfilesOptions) if err != nil { - return fmt.Errorf("Error Fetching Instance Profiles %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Instance Profiles %s\n%s", err, response) } profilesInfo := make([]map[string]interface{}, 0) for _, profile := range availableProfiles.Profiles { @@ -658,7 +658,7 @@ func instanceProfilesList(d *schema.ResourceData, meta interface{}) error { if profile.Disks != nil { l[isInstanceDisks] = dataSourceInstanceProfileFlattenDisks(profile.Disks) if err != nil { - return fmt.Errorf("Error setting disks %s", err) + return fmt.Errorf("[ERROR] Error setting disks %s", err) } } profilesInfo = append(profilesInfo, l) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_template.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_template.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_template.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_template.go index 85d30bd25b..7ed9d37a06 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_template.go @@ -1,12 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" + "reflect" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -55,7 +58,7 @@ const ( isInstanceTemplateBootVolumeAttachment = "boot_volume_attachment" ) -func dataSourceIBMISInstanceTemplate() *schema.Resource { +func DataSourceIBMISInstanceTemplate() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMISInstanceTemplateRead, Schema: map[string]*schema.Schema{ @@ -101,6 +104,26 @@ func dataSourceIBMISInstanceTemplate() *schema.Resource { Computed: true, Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", }, + isInstanceDefaultTrustedProfileAutoLink: { + Type: schema.TypeBool, + Computed: true, + Description: "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", + }, + isInstanceDefaultTrustedProfileTarget: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", + }, + isInstanceTemplateMetadataServiceEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the metadata service endpoint is available to the virtual server instance", + }, + isInstanceAvailablePolicyHostFailure: { + Type: schema.TypeString, + Computed: true, + Description: "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", + }, isInstanceTemplateVolumeAttachments: { Type: schema.TypeList, Computed: true, @@ -271,7 +294,7 @@ func dataSourceIBMISInstanceTemplate() *schema.Resource { } func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - instanceC, err := meta.(ClientSession).VpcV1API() + instanceC, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -291,6 +314,29 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso d.Set(isInstanceTemplateName, instance.Name) d.Set(isInstanceTemplateUserData, instance.UserData) + if instance.DefaultTrustedProfile != nil { + if instance.DefaultTrustedProfile.AutoLink != nil { + d.Set(isInstanceDefaultTrustedProfileAutoLink, instance.DefaultTrustedProfile.AutoLink) + } + if instance.DefaultTrustedProfile.Target != nil { + switch reflect.TypeOf(instance.DefaultTrustedProfile.Target).String() { + case "*vpcv1.TrustedProfileIdentityTrustedProfileByID": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByID) + d.Set(isInstanceDefaultTrustedProfileTarget, target.ID) + } + case "*vpcv1.TrustedProfileIdentityTrustedProfileByCRN": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByCRN) + d.Set(isInstanceDefaultTrustedProfileTarget, target.CRN) + } + } + } + } + + if instance.AvailabilityPolicy != nil && instance.AvailabilityPolicy.HostFailure != nil { + d.Set(isInstanceTemplateAvailablePolicyHostFailure, *instance.AvailabilityPolicy.HostFailure) + } if instance.Keys != nil { keys := []string{} for _, intfc := range instance.Keys { @@ -299,6 +345,11 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso } d.Set(isInstanceTemplateKeys, keys) } + + if instance.MetadataService != nil { + d.Set(isInstanceTemplateMetadataServiceEnabled, instance.MetadataService.Enabled) + } + if instance.Profile != nil { instanceProfileIntf := instance.Profile identity := instanceProfileIntf.(*vpcv1.InstanceProfileIdentity) @@ -334,7 +385,7 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso secGrpIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*secGrpIdentity.ID)) } - currentPrimNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfaceList = append(interfaceList, currentPrimNic) d.Set(isInstanceTemplatePrimaryNetworkInterface, interfaceList) @@ -359,7 +410,7 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso secGrpIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*secGrpIdentity.ID)) } - currentNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) @@ -465,6 +516,25 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso d.Set(isInstanceTemplateName, instance.Name) d.Set(isInstanceTemplateUserData, instance.UserData) + if instance.DefaultTrustedProfile != nil { + if instance.DefaultTrustedProfile.AutoLink != nil { + d.Set(isInstanceDefaultTrustedProfileAutoLink, instance.DefaultTrustedProfile.AutoLink) + } + if instance.DefaultTrustedProfile.Target != nil { + switch reflect.TypeOf(instance.DefaultTrustedProfile.Target).String() { + case "*vpcv1.TrustedProfileIdentityTrustedProfileByID": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByID) + d.Set(isInstanceDefaultTrustedProfileTarget, target.ID) + } + case "*vpcv1.TrustedProfileIdentityTrustedProfileByCRN": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByCRN) + d.Set(isInstanceDefaultTrustedProfileTarget, target.CRN) + } + } + } + } if instance.Keys != nil { keys := []string{} for _, intfc := range instance.Keys { @@ -473,6 +543,11 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso } d.Set(isInstanceTemplateKeys, keys) } + + if instance.MetadataService != nil { + d.Set(isInstanceTemplateMetadataServiceEnabled, instance.MetadataService.Enabled) + } + if instance.Profile != nil { instanceProfileIntf := instance.Profile identity := instanceProfileIntf.(*vpcv1.InstanceProfileIdentity) @@ -504,7 +579,7 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso secGrpIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*secGrpIdentity.ID)) } - currentPrimNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfaceList = append(interfaceList, currentPrimNic) d.Set(isInstanceTemplatePrimaryNetworkInterface, interfaceList) @@ -529,7 +604,7 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso secGrpIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*secGrpIdentity.ID)) } - currentNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) @@ -624,7 +699,7 @@ func dataSourceIBMISInstanceTemplateRead(context context.Context, d *schema.Reso } } if !flag { - return diag.FromErr(fmt.Errorf("No Instance Template found with name %s", name)) + return diag.FromErr(fmt.Errorf("[ERROR] No Instance Template found with name %s", name)) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_templates.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_templates.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_templates.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_templates.go index 0e5b036af1..8a126ba206 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_templates.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_templates.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( + "reflect" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -81,7 +83,7 @@ const ( isInstanceTemplateVolAttVolume = "volume" ) -func dataSourceIBMISInstanceTemplates() *schema.Resource { +func DataSourceIBMISInstanceTemplates() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceTemplatesRead, Schema: map[string]*schema.Schema{ @@ -95,10 +97,20 @@ func dataSourceIBMISInstanceTemplates() *schema.Resource { Type: schema.TypeString, Computed: true, }, + isInstanceAvailablePolicyHostFailure: { + Type: schema.TypeString, + Computed: true, + Description: "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", + }, isInstanceTemplatesName: { Type: schema.TypeString, Computed: true, }, + isInstanceTemplateMetadataServiceEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the metadata service endpoint is available to the virtual server instance", + }, isInstanceTemplatesHref: { Type: schema.TypeString, Computed: true, @@ -129,6 +141,16 @@ func dataSourceIBMISInstanceTemplates() *schema.Resource { Computed: true, Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", }, + isInstanceDefaultTrustedProfileAutoLink: { + Type: schema.TypeBool, + Computed: true, + Description: "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", + }, + isInstanceDefaultTrustedProfileTarget: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", + }, isInstanceTemplateVolumeAttachments: { Type: schema.TypeList, Computed: true, @@ -178,23 +200,23 @@ func dataSourceIBMISInstanceTemplates() *schema.Resource { }, }, - "placement_target": &schema.Schema{ + "placement_target": { Type: schema.TypeList, Computed: true, Description: "The placement restrictions for the virtual server instance. For the target tobe changed, the instance `status` must be `stopping` or `stopped`.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", @@ -323,11 +345,38 @@ func dataSourceIBMISInstanceTemplatesRead(d *schema.ResourceData, meta interface template[isInstanceTemplateName] = instance.Name template[isInstanceTemplateUserData] = instance.UserData + if instance.DefaultTrustedProfile != nil { + if instance.DefaultTrustedProfile.AutoLink != nil { + template[isInstanceDefaultTrustedProfileAutoLink] = instance.DefaultTrustedProfile.AutoLink + } + if instance.DefaultTrustedProfile.Target != nil { + switch reflect.TypeOf(instance.DefaultTrustedProfile.Target).String() { + case "*vpcv1.TrustedProfileIdentityTrustedProfileByID": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByID) + template[isInstanceDefaultTrustedProfileTarget] = target.ID + } + case "*vpcv1.TrustedProfileIdentityTrustedProfileByCRN": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByCRN) + template[isInstanceDefaultTrustedProfileTarget] = target.CRN + } + } + } + } + if instance.PlacementTarget != nil { placementTargetMap := resourceIbmIsInstanceTemplateInstancePlacementTargetPrototypeToMap(*instance.PlacementTarget.(*vpcv1.InstancePlacementTargetPrototype)) template["placement_target"] = []map[string]interface{}{placementTargetMap} } + if instance.MetadataService != nil { + template[isInstanceTemplateMetadataServiceEnabled] = *instance.MetadataService.Enabled + } + + if instance.AvailabilityPolicy != nil && instance.AvailabilityPolicy.HostFailure != nil { + template[isInstanceTemplateAvailablePolicyHostFailure] = *instance.AvailabilityPolicy.HostFailure + } if instance.Keys != nil { keys := []string{} for _, intfc := range instance.Keys { @@ -371,7 +420,7 @@ func dataSourceIBMISInstanceTemplatesRead(d *schema.ResourceData, meta interface secGrpIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*secGrpIdentity.ID)) } - currentPrimNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfaceList = append(interfaceList, currentPrimNic) template[isInstanceTemplatePrimaryNetworkInterface] = interfaceList @@ -396,7 +445,7 @@ func dataSourceIBMISInstanceTemplatesRead(d *schema.ResourceData, meta interface secGrpIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*secGrpIdentity.ID)) } - currentNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_volume_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_volume_attachment.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_volume_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_volume_attachment.go index 22b4431195..e10c775564 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_volume_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_volume_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -23,7 +23,7 @@ const ( isInstanceVolumeAttVolumeReferenceName = "volume_name" ) -func dataSourceIBMISInstanceVolumeAttachment() *schema.Resource { +func DataSourceIBMISInstanceVolumeAttachment() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceVolumeAttachmentRead, @@ -135,7 +135,7 @@ func instanceVolumeAttachmentGetByName(d *schema.ResourceData, meta interface{}, } volumeAtts, response, err := sess.ListInstanceVolumeAttachments(listInstanceVolumeAttOptions) if err != nil { - return fmt.Errorf("Error fetching Instance volume attachments %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching Instance volume attachments %s\n%s", err, response) } allrecs = append(allrecs, volumeAtts.VolumeAttachments...) for _, volumeAtt := range allrecs { @@ -164,5 +164,5 @@ func instanceVolumeAttachmentGetByName(d *schema.ResourceData, meta interface{}, return nil } } - return fmt.Errorf("No Instance volume attachment found with name %s on instance %s", name, instanceId) + return fmt.Errorf("[ERROR] No Instance volume attachment found with name %s on instance %s", name, instanceId) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_volume_attachments.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_volume_attachments.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_volume_attachments.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_volume_attachments.go index 8e4844af94..e9a0dd0e63 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instance_volume_attachments.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instance_volume_attachments.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISInstanceVolumeAttachments() *schema.Resource { +func DataSourceIBMISInstanceVolumeAttachments() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstanceVolumeAttachmentsRead, @@ -130,7 +130,7 @@ func instanceGetVolumeAttachments(d *schema.ResourceData, meta interface{}, inst } volumeAtts, response, err := sess.ListInstanceVolumeAttachments(listInstanceVolumeAttOptions) if err != nil { - return fmt.Errorf("Error Fetching Instance volume attachments %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Instance volume attachments %s\n%s", err, response) } allrecs = append(allrecs, volumeAtts.VolumeAttachments...) volAttList := make([]map[string]interface{}, 0) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instances.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instances.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instances.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instances.go index 944caee59c..b04661e681 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_instances.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_instances.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +17,7 @@ const ( isInstanceGroupName = "instance_group_name" ) -func dataSourceIBMISInstances() *schema.Resource { +func DataSourceIBMISInstances() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISInstancesRead, @@ -114,12 +115,21 @@ func dataSourceIBMISInstances() *schema.Resource { Computed: true, Description: "Instance memory", }, + isInstanceMetadataServiceEnabled: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether the metadata service endpoint is available to the virtual server instance", + }, "status": { Type: schema.TypeString, Computed: true, Description: "Instance status", }, - + isInstanceAvailablePolicyHostFailure: { + Type: schema.TypeString, + Computed: true, + Description: "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.", + }, isInstanceStatusReasons: { Type: schema.TypeList, Computed: true, @@ -257,24 +267,24 @@ func dataSourceIBMISInstances() *schema.Resource { }, }, }, - "placement_target": &schema.Schema{ + "placement_target": { Type: schema.TypeList, Computed: true, Description: "The placement restrictions for the virtual server instance.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this placement target resource.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -282,22 +292,22 @@ func dataSourceIBMISInstances() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this placement target resource.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this placement target resource.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this placement target resource. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", @@ -424,43 +434,43 @@ func dataSourceIBMISInstances() *schema.Resource { }, }, - isInstanceDisks: &schema.Schema{ + isInstanceDisks: { Type: schema.TypeList, Computed: true, Description: "Collection of the instance's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -537,9 +547,9 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { } instanceGroupsCollection, response, err := sess.ListInstanceGroups(&listInstanceGroupOptions) if err != nil { - return fmt.Errorf("Error Fetching InstanceGroups %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching InstanceGroups %s\n%s", err, response) } - start = GetNext(instanceGroupsCollection.Next) + start = flex.GetNext(instanceGroupsCollection.Next) allrecs = append(allrecs, instanceGroupsCollection.InstanceGroups...) if start == "" { @@ -597,9 +607,9 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { instances, response, err := sess.ListInstances(listInstancesOptions) if err != nil { - return fmt.Errorf("Error Fetching Instances %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Instances %s\n%s", err, response) } - start = GetNext(instances.Next) + start = flex.GetNext(instances.Next) allrecs = append(allrecs, instances.Instances...) if start == "" { break @@ -618,10 +628,10 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { } instanceGroupMembershipCollection, response, err := sess.ListInstanceGroupMemberships(&listInstanceGroupMembershipsOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Membership Collection %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Membership Collection %s\n%s", err, response) } - start = GetNext(instanceGroupMembershipCollection.Next) + start = flex.GetNext(instanceGroupMembershipCollection.Next) for _, membershipItem := range instanceGroupMembershipCollection.Memberships { membershipMap[*membershipItem.Instance.ID] = true } @@ -651,10 +661,17 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { l["crn"] = *instance.CRN l["name"] = *instance.Name l["memory"] = *instance.Memory + if instance.MetadataService != nil { + l[isInstanceMetadataServiceEnabled] = *instance.MetadataService.Enabled + } l["status"] = *instance.Status l["resource_group"] = *instance.ResourceGroup.ID l["vpc"] = *instance.VPC.ID + if instance.AvailabilityPolicy != nil && instance.AvailabilityPolicy.HostFailure != nil { + l[isInstanceAvailablePolicyHostFailure] = *instance.AvailabilityPolicy.HostFailure + } + if instance.PlacementTarget != nil { placementTargetMap := resourceIbmIsInstanceInstancePlacementToMap(*instance.PlacementTarget.(*vpcv1.InstancePlacementTarget)) l["placement_target"] = []map[string]interface{}{placementTargetMap} @@ -728,7 +745,7 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { } insnic, response, err := sess.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s\n%s", err, response) } currentPrimNic[isInstanceNicSubnet] = *insnic.Subnet.ID if len(insnic.SecurityGroups) != 0 { @@ -736,7 +753,7 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { for i := 0; i < len(insnic.SecurityGroups); i++ { secgrpList = append(secgrpList, string(*(insnic.SecurityGroups[i].ID))) } - currentPrimNic[isInstanceNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } primaryNicList = append(primaryNicList, currentPrimNic) @@ -757,7 +774,7 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { } insnic, response, err := sess.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s\n%s", err, response) } currentNic[isInstanceNicSubnet] = *insnic.Subnet.ID if len(insnic.SecurityGroups) != 0 { @@ -765,7 +782,7 @@ func instancesList(d *schema.ResourceData, meta interface{}) error { for i := 0; i < len(insnic.SecurityGroups); i++ { secgrpList = append(secgrpList, string(*(insnic.SecurityGroups[i].ID))) } - currentNic[isInstanceNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ipsec_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ipsec_policies.go new file mode 100644 index 0000000000..37fee725c3 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ipsec_policies.go @@ -0,0 +1,310 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsIpsecPolicies() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsIpsecPoliciesRead, + + Schema: map[string]*schema.Schema{ + "ipsec_policies": { + Type: schema.TypeList, + Computed: true, + Description: "Collection of IPsec policies.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "authentication_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The authentication algorithm.", + }, + "connections": { + Type: schema.TypeList, + Computed: true, + Description: "The VPN gateway connections that use this IPsec policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPN gateway connection.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN connection.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this IPsec policy was created.", + }, + "encapsulation_mode": { + Type: schema.TypeString, + Computed: true, + Description: "The encapsulation mode used. Only `tunnel` is supported.", + }, + "encryption_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The encryption algorithm.", + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The IPsec policy's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this IPsec policy.", + }, + "key_lifetime": { + Type: schema.TypeInt, + Computed: true, + Description: "The key lifetime in seconds.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this IPsec policy.", + }, + "pfs": { + Type: schema.TypeString, + Computed: true, + Description: "Perfect Forward Secrecy.", + }, + "resource_group": { + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this IPsec policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + "transform_protocol": { + Type: schema.TypeString, + Computed: true, + Description: "The transform protocol used. Only `esp` is supported.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsIpsecPoliciesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + start := "" + allrecs := []vpcv1.IPsecPolicy{} + for { + listIpsecPoliciesOptions := &vpcv1.ListIpsecPoliciesOptions{} + if start != "" { + listIpsecPoliciesOptions.Start = &start + } + iPsecPolicyCollection, response, err := vpcClient.ListIpsecPoliciesWithContext(context, listIpsecPoliciesOptions) + if err != nil || iPsecPolicyCollection == nil { + log.Printf("[DEBUG] ListIpsecPoliciesWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListIpsecPoliciesWithContext failed %s\n%s", err, response)) + } + start = flex.GetNext(iPsecPolicyCollection.Next) + allrecs = append(allrecs, iPsecPolicyCollection.IpsecPolicies...) + if start == "" { + break + } + } + + d.SetId(dataSourceIBMIsIpsecPoliciesID(d)) + + err = d.Set("ipsec_policies", dataSourceIPsecPolicyCollectionFlattenIpsecPolicies(allrecs)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting ipsec_policies %s", err)) + } + + return nil +} + +// dataSourceIBMIsIpsecPoliciesID returns a reasonable ID for the list. +func dataSourceIBMIsIpsecPoliciesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceIPsecPolicyCollectionFlattenIpsecPolicies(result []vpcv1.IPsecPolicy) (ipsecPolicies []map[string]interface{}) { + for _, ipsecPoliciesItem := range result { + ipsecPolicies = append(ipsecPolicies, dataSourceIPsecPolicyCollectionIpsecPoliciesToMap(ipsecPoliciesItem)) + } + + return ipsecPolicies +} + +func dataSourceIPsecPolicyCollectionIpsecPoliciesToMap(ipsecPoliciesItem vpcv1.IPsecPolicy) (ipsecPoliciesMap map[string]interface{}) { + ipsecPoliciesMap = map[string]interface{}{} + + if ipsecPoliciesItem.AuthenticationAlgorithm != nil { + ipsecPoliciesMap["authentication_algorithm"] = ipsecPoliciesItem.AuthenticationAlgorithm + } + if ipsecPoliciesItem.Connections != nil { + connectionsList := []map[string]interface{}{} + for _, connectionsItem := range ipsecPoliciesItem.Connections { + connectionsList = append(connectionsList, dataSourceIPsecPolicyCollectionIpsecPoliciesConnectionsToMap(connectionsItem)) + } + ipsecPoliciesMap["connections"] = connectionsList + } + if ipsecPoliciesItem.CreatedAt != nil { + ipsecPoliciesMap["created_at"] = ipsecPoliciesItem.CreatedAt.String() + } + if ipsecPoliciesItem.EncapsulationMode != nil { + ipsecPoliciesMap["encapsulation_mode"] = ipsecPoliciesItem.EncapsulationMode + } + if ipsecPoliciesItem.EncryptionAlgorithm != nil { + ipsecPoliciesMap["encryption_algorithm"] = ipsecPoliciesItem.EncryptionAlgorithm + } + if ipsecPoliciesItem.Href != nil { + ipsecPoliciesMap["href"] = ipsecPoliciesItem.Href + } + if ipsecPoliciesItem.ID != nil { + ipsecPoliciesMap["id"] = ipsecPoliciesItem.ID + } + if ipsecPoliciesItem.KeyLifetime != nil { + ipsecPoliciesMap["key_lifetime"] = ipsecPoliciesItem.KeyLifetime + } + if ipsecPoliciesItem.Name != nil { + ipsecPoliciesMap["name"] = ipsecPoliciesItem.Name + } + if ipsecPoliciesItem.Pfs != nil { + ipsecPoliciesMap["pfs"] = ipsecPoliciesItem.Pfs + } + if ipsecPoliciesItem.ResourceGroup != nil { + resourceGroupList := []map[string]interface{}{} + resourceGroupMap := dataSourceIPsecPolicyCollectionIpsecPoliciesResourceGroupToMap(*ipsecPoliciesItem.ResourceGroup) + resourceGroupList = append(resourceGroupList, resourceGroupMap) + ipsecPoliciesMap["resource_group"] = resourceGroupList + } + if ipsecPoliciesItem.ResourceType != nil { + ipsecPoliciesMap["resource_type"] = ipsecPoliciesItem.ResourceType + } + if ipsecPoliciesItem.TransformProtocol != nil { + ipsecPoliciesMap["transform_protocol"] = ipsecPoliciesItem.TransformProtocol + } + + return ipsecPoliciesMap +} + +func dataSourceIPsecPolicyCollectionIpsecPoliciesConnectionsToMap(connectionsItem vpcv1.VPNGatewayConnectionReference) (connectionsMap map[string]interface{}) { + connectionsMap = map[string]interface{}{} + + if connectionsItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceIPsecPolicyCollectionConnectionsDeletedToMap(*connectionsItem.Deleted) + deletedList = append(deletedList, deletedMap) + connectionsMap["deleted"] = deletedList + } + if connectionsItem.Href != nil { + connectionsMap["href"] = connectionsItem.Href + } + if connectionsItem.ID != nil { + connectionsMap["id"] = connectionsItem.ID + } + if connectionsItem.Name != nil { + connectionsMap["name"] = connectionsItem.Name + } + if connectionsItem.ResourceType != nil { + connectionsMap["resource_type"] = connectionsItem.ResourceType + } + + return connectionsMap +} + +func dataSourceIPsecPolicyCollectionConnectionsDeletedToMap(deletedItem vpcv1.VPNGatewayConnectionReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceIPsecPolicyCollectionIpsecPoliciesResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + + return resourceGroupMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ipsec_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ipsec_policy.go new file mode 100644 index 0000000000..b4a7a64bda --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ipsec_policy.go @@ -0,0 +1,321 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsIpsecPolicy() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsIpsecPolicyRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"name", "ipsec_policy"}, + Description: "The IPsec policy name.", + }, + "ipsec_policy": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"name", "ipsec_policy"}, + Description: "The IPsec policy identifier.", + }, + "authentication_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The authentication algorithm.", + }, + "connections": { + Type: schema.TypeList, + Computed: true, + Description: "The VPN gateway connections that use this IPsec policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPN gateway connection.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN connection.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this IPsec policy was created.", + }, + "encapsulation_mode": { + Type: schema.TypeString, + Computed: true, + Description: "The encapsulation mode used. Only `tunnel` is supported.", + }, + "encryption_algorithm": { + Type: schema.TypeString, + Computed: true, + Description: "The encryption algorithm.", + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The IPsec policy's canonical URL.", + }, + "key_lifetime": { + Type: schema.TypeInt, + Computed: true, + Description: "The key lifetime in seconds.", + }, + + "pfs": { + Type: schema.TypeString, + Computed: true, + Description: "Perfect Forward Secrecy.", + }, + "resource_group": { + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this IPsec policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + "transform_protocol": { + Type: schema.TypeString, + Computed: true, + Description: "The transform protocol used. Only `esp` is supported.", + }, + }, + } +} + +func dataSourceIBMIsIpsecPolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + name := d.Get("name").(string) + identifier := d.Get("ipsec_policy").(string) + var IPSecPolicy *vpcv1.IPsecPolicy + if name != "" { + start := "" + allrecs := []vpcv1.IPsecPolicy{} + for { + listIPSecPoliciesyOptions := &vpcv1.ListIpsecPoliciesOptions{} + if start != "" { + listIPSecPoliciesyOptions.Start = &start + } + ipSecPolicy, response, err := vpcClient.ListIpsecPolicies(listIPSecPoliciesyOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("Error Fetching IPSec Policies %s\n%s", err, response)) + } + start = flex.GetNext(ipSecPolicy.Next) + allrecs = append(allrecs, ipSecPolicy.IpsecPolicies...) + if start == "" { + break + } + } + ipsec_policy_found := false + for _, ipSecPolicyItem := range allrecs { + if *ipSecPolicyItem.Name == name { + IPSecPolicy = &ipSecPolicyItem + ipsec_policy_found = true + break + } + } + + if !ipsec_policy_found { + log.Printf("[DEBUG] No ipsec policy found with given name %s", name) + return diag.FromErr(fmt.Errorf("No ipsec policy found with given name %s", name)) + } + + } else { + getIPSecPolicyOptions := &vpcv1.GetIpsecPolicyOptions{} + + getIPSecPolicyOptions.SetID(identifier) + + ipsecPolicy1, response, err := vpcClient.GetIpsecPolicyWithContext(context, getIPSecPolicyOptions) + if err != nil { + log.Printf("[DEBUG] GetIpsecPolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetIpsecPolicyWithContext failed %s\n%s", err, response)) + } + IPSecPolicy = ipsecPolicy1 + } + + d.SetId(*IPSecPolicy.ID) + if err = d.Set("authentication_algorithm", IPSecPolicy.AuthenticationAlgorithm); err != nil { + return diag.FromErr(fmt.Errorf("Error setting authentication_algorithm: %s", err)) + } + + if IPSecPolicy.Connections != nil { + err = d.Set("connections", dataSourceIPsecPolicyFlattenConnections(IPSecPolicy.Connections)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting connections %s", err)) + } + } + if err = d.Set("created_at", flex.DateTimeToString(IPSecPolicy.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("encapsulation_mode", IPSecPolicy.EncapsulationMode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting encapsulation_mode: %s", err)) + } + if err = d.Set("encryption_algorithm", IPSecPolicy.EncryptionAlgorithm); err != nil { + return diag.FromErr(fmt.Errorf("Error setting encryption_algorithm: %s", err)) + } + if err = d.Set("href", IPSecPolicy.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("key_lifetime", flex.IntValue(IPSecPolicy.KeyLifetime)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting key_lifetime: %s", err)) + } + if err = d.Set("name", IPSecPolicy.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("pfs", IPSecPolicy.Pfs); err != nil { + return diag.FromErr(fmt.Errorf("Error setting pfs: %s", err)) + } + + if IPSecPolicy.ResourceGroup != nil { + err = d.Set("resource_group", dataSourceIPsecPolicyFlattenResourceGroup(*IPSecPolicy.ResourceGroup)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + } + } + if err = d.Set("resource_type", IPSecPolicy.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + } + if err = d.Set("transform_protocol", IPSecPolicy.TransformProtocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting transform_protocol: %s", err)) + } + + return nil +} + +func dataSourceIPsecPolicyFlattenConnections(result []vpcv1.VPNGatewayConnectionReference) (connections []map[string]interface{}) { + for _, connectionsItem := range result { + connections = append(connections, dataSourceIPsecPolicyConnectionsToMap(connectionsItem)) + } + + return connections +} + +func dataSourceIPsecPolicyConnectionsToMap(connectionsItem vpcv1.VPNGatewayConnectionReference) (connectionsMap map[string]interface{}) { + connectionsMap = map[string]interface{}{} + + if connectionsItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceIPsecPolicyConnectionsDeletedToMap(*connectionsItem.Deleted) + deletedList = append(deletedList, deletedMap) + connectionsMap["deleted"] = deletedList + } + if connectionsItem.Href != nil { + connectionsMap["href"] = connectionsItem.Href + } + if connectionsItem.ID != nil { + connectionsMap["id"] = connectionsItem.ID + } + if connectionsItem.Name != nil { + connectionsMap["name"] = connectionsItem.Name + } + if connectionsItem.ResourceType != nil { + connectionsMap["resource_type"] = connectionsItem.ResourceType + } + + return connectionsMap +} + +func dataSourceIPsecPolicyConnectionsDeletedToMap(deletedItem vpcv1.VPNGatewayConnectionReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceIPsecPolicyFlattenResourceGroup(result vpcv1.ResourceGroupReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceIPsecPolicyResourceGroupToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceIPsecPolicyResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + + return resourceGroupMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb.go index a945c115a9..9e79dc97eb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "strconv" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -33,7 +34,7 @@ const ( healthMonitorURLPath = "url_path" ) -func dataSourceIBMISLB() *schema.Resource { +func DataSourceIBMISLB() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISLBRead, @@ -114,7 +115,7 @@ func dataSourceIBMISLB() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Tags associated to Load Balancer", }, @@ -223,19 +224,19 @@ func dataSourceIBMISLB() *schema.Resource { }, }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -269,9 +270,9 @@ func lbGetByName(d *schema.ResourceData, meta interface{}, name string) error { } lbs, response, err := sess.ListLoadBalancers(listLoadBalancersOptions) if err != nil { - return fmt.Errorf("Error Fetching Load Balancers %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Load Balancers %s\n%s", err, response) } - start = GetNext(lbs.Next) + start = flex.GetNext(lbs.Next) allrecs = append(allrecs, lbs.LoadBalancers...) if start == "" { break @@ -412,23 +413,23 @@ func lbGetByName(d *schema.ResourceData, meta interface{}, name string) error { d.Set(isLBResourceGroup, *lb.ResourceGroup.ID) d.Set(isLBHostName, *lb.Hostname) - tags, err := GetTagsUsingCRN(meta, *lb.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *lb.CRN) if err != nil { log.Printf( "Error on get of resource vpc Load Balancer (%s) tags: %s", d.Id(), err) } d.Set(isLBTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/loadBalancers") - d.Set(ResourceName, *lb.Name) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/loadBalancers") + d.Set(flex.ResourceName, *lb.Name) if lb.ResourceGroup != nil { - d.Set(ResourceGroupName, *lb.ResourceGroup.ID) + d.Set(flex.ResourceGroupName, *lb.ResourceGroup.ID) } return nil } } - return fmt.Errorf("No Load balancer found with name %s", name) + return fmt.Errorf("[ERROR] No Load balancer found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener.go new file mode 100644 index 0000000000..e3d1b87181 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener.go @@ -0,0 +1,446 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBListener() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbListenerRead, + + Schema: map[string]*schema.Schema{ + isLBListenerLBID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + isLBListenerID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The listener identifier.", + }, + "accept_proxy_protocol": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). Additional restrictions:- If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must match the `accept_proxy_protocol` value of the `https_redirect` listener.- If this listener is the target of another listener's `https_redirect`, its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value.", + }, + "certificate_instance": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The certificate instance used for SSL termination. It is applicable only to `https`protocol.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this certificate instance.", + }, + }, + }, + }, + "connection_limit": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The connection limit of the listener.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this listener was created.", + }, + "default_pool": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The default pool associated with the listener.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The pool's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this load balancer pool.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener's canonical URL.", + }, + "https_redirect": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If specified, the target listener that requests are redirected to.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "http_status_code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The HTTP status code for this redirect.", + }, + "listener": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer listener.", + }, + }, + }, + }, + "uri": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The redirect relative target URI.", + }, + }, + }, + }, + "policies": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The policies for this listener.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener policy's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy's unique identifier.", + }, + }, + }, + }, + "port": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + }, + "port_max": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive upper bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", + }, + "port_min": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive lower bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this listener.", + }, + }, + } +} + +func dataSourceIBMIsLbListenerRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + getLoadBalancerListenerOptions := &vpcv1.GetLoadBalancerListenerOptions{} + + getLoadBalancerListenerOptions.SetLoadBalancerID(d.Get(isLBListenerLBID).(string)) + getLoadBalancerListenerOptions.SetID(d.Get(isLBListenerID).(string)) + + loadBalancerListener, response, err := vpcClient.GetLoadBalancerListenerWithContext(context, getLoadBalancerListenerOptions) + if err != nil { + log.Printf("[DEBUG] GetLoadBalancerListenerWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetLoadBalancerListenerWithContext failed %s\n%s", err, response)) + } + + d.SetId(*loadBalancerListener.ID) + if err = d.Set("accept_proxy_protocol", loadBalancerListener.AcceptProxyProtocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting accept_proxy_protocol: %s", err)) + } + + if loadBalancerListener.CertificateInstance != nil { + err = d.Set("certificate_instance", dataSourceLoadBalancerListenerFlattenCertificateInstance(*loadBalancerListener.CertificateInstance)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting certificate_instance %s", err)) + } + } + if loadBalancerListener.ConnectionLimit != nil { + if err = d.Set("connection_limit", flex.IntValue(loadBalancerListener.ConnectionLimit)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting connection_limit: %s", err)) + } + } + if err = d.Set("created_at", loadBalancerListener.CreatedAt.String()); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + + if loadBalancerListener.DefaultPool != nil { + err = d.Set("default_pool", dataSourceLoadBalancerListenerFlattenDefaultPool(*loadBalancerListener.DefaultPool)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting default_pool %s", err)) + } + } + if err = d.Set("href", loadBalancerListener.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + + if loadBalancerListener.HTTPSRedirect != nil { + err = d.Set("https_redirect", dataSourceLoadBalancerListenerFlattenHTTPSRedirect(*loadBalancerListener.HTTPSRedirect)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting https_redirect %s", err)) + } + } + + if loadBalancerListener.Policies != nil { + err = d.Set("policies", dataSourceLoadBalancerListenerFlattenPolicies(loadBalancerListener.Policies)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting policies %s", err)) + } + } + if err = d.Set("port", flex.IntValue(loadBalancerListener.Port)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting port: %s", err)) + } + if err = d.Set("port_max", flex.IntValue(loadBalancerListener.PortMax)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting port_max: %s", err)) + } + if err = d.Set("port_min", flex.IntValue(loadBalancerListener.PortMin)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting port_min: %s", err)) + } + if err = d.Set("protocol", loadBalancerListener.Protocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting protocol: %s", err)) + } + if err = d.Set("provisioning_status", loadBalancerListener.ProvisioningStatus); err != nil { + return diag.FromErr(fmt.Errorf("Error setting provisioning_status: %s", err)) + } + + return nil +} + +func dataSourceLoadBalancerListenerFlattenCertificateInstance(result vpcv1.CertificateInstanceReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerListenerCertificateInstanceToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerListenerCertificateInstanceToMap(certificateInstanceItem vpcv1.CertificateInstanceReference) (certificateInstanceMap map[string]interface{}) { + certificateInstanceMap = map[string]interface{}{} + + if certificateInstanceItem.CRN != nil { + certificateInstanceMap["crn"] = certificateInstanceItem.CRN + } + + return certificateInstanceMap +} + +func dataSourceLoadBalancerListenerFlattenDefaultPool(result vpcv1.LoadBalancerPoolReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerListenerDefaultPoolToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerListenerDefaultPoolToMap(defaultPoolItem vpcv1.LoadBalancerPoolReference) (defaultPoolMap map[string]interface{}) { + defaultPoolMap = map[string]interface{}{} + + if defaultPoolItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerDefaultPoolDeletedToMap(*defaultPoolItem.Deleted) + deletedList = append(deletedList, deletedMap) + defaultPoolMap["deleted"] = deletedList + } + if defaultPoolItem.Href != nil { + defaultPoolMap["href"] = defaultPoolItem.Href + } + if defaultPoolItem.ID != nil { + defaultPoolMap["id"] = defaultPoolItem.ID + } + if defaultPoolItem.Name != nil { + defaultPoolMap["name"] = defaultPoolItem.Name + } + + return defaultPoolMap +} + +func dataSourceLoadBalancerListenerDefaultPoolDeletedToMap(deletedItem vpcv1.LoadBalancerPoolReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerFlattenHTTPSRedirect(result vpcv1.LoadBalancerListenerHTTPSRedirect) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerListenerHTTPSRedirectToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerListenerHTTPSRedirectToMap(httpsRedirectItem vpcv1.LoadBalancerListenerHTTPSRedirect) (httpsRedirectMap map[string]interface{}) { + httpsRedirectMap = map[string]interface{}{} + + if httpsRedirectItem.HTTPStatusCode != nil { + httpsRedirectMap["http_status_code"] = httpsRedirectItem.HTTPStatusCode + } + if httpsRedirectItem.Listener != nil { + listenerList := []map[string]interface{}{} + listenerMap := dataSourceLoadBalancerListenerHTTPSRedirectListenerToMap(*httpsRedirectItem.Listener) + listenerList = append(listenerList, listenerMap) + httpsRedirectMap["listener"] = listenerList + } + if httpsRedirectItem.URI != nil { + httpsRedirectMap["uri"] = httpsRedirectItem.URI + } + + return httpsRedirectMap +} + +func dataSourceLoadBalancerListenerHTTPSRedirectListenerToMap(listenerItem vpcv1.LoadBalancerListenerReference) (listenerMap map[string]interface{}) { + listenerMap = map[string]interface{}{} + + if listenerItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerListenerDeletedToMap(*listenerItem.Deleted) + deletedList = append(deletedList, deletedMap) + listenerMap["deleted"] = deletedList + } + if listenerItem.Href != nil { + listenerMap["href"] = listenerItem.Href + } + if listenerItem.ID != nil { + listenerMap["id"] = listenerItem.ID + } + + return listenerMap +} + +func dataSourceLoadBalancerListenerListenerDeletedToMap(deletedItem vpcv1.LoadBalancerListenerReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerFlattenPolicies(result []vpcv1.LoadBalancerListenerPolicyReference) (policies []map[string]interface{}) { + for _, policiesItem := range result { + policies = append(policies, dataSourceLoadBalancerListenerPoliciesToMap(policiesItem)) + } + + return policies +} + +func dataSourceLoadBalancerListenerPoliciesToMap(policiesItem vpcv1.LoadBalancerListenerPolicyReference) (policiesMap map[string]interface{}) { + policiesMap = map[string]interface{}{} + + if policiesItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPoliciesDeletedToMap(*policiesItem.Deleted) + deletedList = append(deletedList, deletedMap) + policiesMap["deleted"] = deletedList + } + if policiesItem.Href != nil { + policiesMap["href"] = policiesItem.Href + } + if policiesItem.ID != nil { + policiesMap["id"] = policiesItem.ID + } + + return policiesMap +} + +func dataSourceLoadBalancerListenerPoliciesDeletedToMap(deletedItem vpcv1.LoadBalancerListenerPolicyReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policies.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policies.go new file mode 100644 index 0000000000..4a3232fce1 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policies.go @@ -0,0 +1,386 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBListenerPolicies() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbListenerPoliciesRead, + + Schema: map[string]*schema.Schema{ + isLBListenerPolicyLBID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + isLBListenerPolicyListenerID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The listener identifier.", + }, + "policies": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of policies.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy action.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the unexpected property value was encountered.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this policy was created.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener policy's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy's unique identifier.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this policy.", + }, + "priority": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "Priority of the policy. Lower value indicates higher priority.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this policy.", + }, + "rules": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The rules for this policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's unique identifier.", + }, + }, + }, + }, + "target": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "- If `action` is `forward`, the response is a `LoadBalancerPoolReference`- If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL`- If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The pool's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this load balancer pool.", + }, + "http_status_code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The HTTP status code for this redirect.", + }, + "url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The redirect target URL.", + }, + "listener": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer listener.", + }, + }, + }, + }, + "uri": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The redirect relative target URI.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbListenerPoliciesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + listLoadBalancerListenerPoliciesOptions := &vpcv1.ListLoadBalancerListenerPoliciesOptions{} + + listLoadBalancerListenerPoliciesOptions.SetLoadBalancerID(d.Get(isLBListenerPolicyLBID).(string)) + listLoadBalancerListenerPoliciesOptions.SetListenerID(d.Get(isLBListenerPolicyListenerID).(string)) + + loadBalancerListenerPolicyCollection, response, err := vpcClient.ListLoadBalancerListenerPoliciesWithContext(context, listLoadBalancerListenerPoliciesOptions) + if err != nil { + log.Printf("[DEBUG] ListLoadBalancerListenerPoliciesWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListLoadBalancerListenerPoliciesWithContext failed %s\n%s", err, response)) + } + + d.SetId(dataSourceIBMIsLbListenerPoliciesID(d)) + + if loadBalancerListenerPolicyCollection.Policies != nil { + err = d.Set("policies", dataSourceLoadBalancerListenerPolicyCollectionFlattenPolicies(loadBalancerListenerPolicyCollection.Policies)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting policies %s", err)) + } + } + + return nil +} + +// dataSourceIBMIsLbListenerPoliciesID returns a reasonable ID for the list. +func dataSourceIBMIsLbListenerPoliciesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceLoadBalancerListenerPolicyCollectionFlattenPolicies(result []vpcv1.LoadBalancerListenerPolicy) (policies []map[string]interface{}) { + for _, policiesItem := range result { + policies = append(policies, dataSourceLoadBalancerListenerPolicyCollectionPoliciesToMap(policiesItem)) + } + + return policies +} + +func dataSourceLoadBalancerListenerPolicyCollectionPoliciesToMap(policiesItem vpcv1.LoadBalancerListenerPolicy) (policiesMap map[string]interface{}) { + policiesMap = map[string]interface{}{} + + if policiesItem.Action != nil { + policiesMap["action"] = policiesItem.Action + } + if policiesItem.CreatedAt != nil { + policiesMap["created_at"] = policiesItem.CreatedAt.String() + } + if policiesItem.Href != nil { + policiesMap["href"] = policiesItem.Href + } + if policiesItem.ID != nil { + policiesMap["id"] = policiesItem.ID + } + if policiesItem.Name != nil { + policiesMap["name"] = policiesItem.Name + } + if policiesItem.Priority != nil { + policiesMap["priority"] = policiesItem.Priority + } + if policiesItem.ProvisioningStatus != nil { + policiesMap["provisioning_status"] = policiesItem.ProvisioningStatus + } + if policiesItem.Rules != nil { + rulesList := []map[string]interface{}{} + for _, rulesItem := range policiesItem.Rules { + rulesList = append(rulesList, dataSourceLoadBalancerListenerPolicyCollectionPoliciesRulesToMap(rulesItem)) + } + policiesMap["rules"] = rulesList + } + if policiesItem.Target != nil { + targetList := []map[string]interface{}{} + target := policiesItem.Target.(*vpcv1.LoadBalancerListenerPolicyTarget) + targetMap := dataSourceLoadBalancerListenerPolicyCollectionPoliciesTargetToMap(*target) + targetList = append(targetList, targetMap) + policiesMap["target"] = targetList + } + + return policiesMap +} + +func dataSourceLoadBalancerListenerPolicyCollectionPoliciesRulesToMap(rulesItem vpcv1.LoadBalancerListenerPolicyRuleReference) (rulesMap map[string]interface{}) { + rulesMap = map[string]interface{}{} + + if rulesItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPolicyCollectionRulesDeletedToMap(*rulesItem.Deleted) + deletedList = append(deletedList, deletedMap) + rulesMap["deleted"] = deletedList + } + if rulesItem.Href != nil { + rulesMap["href"] = rulesItem.Href + } + if rulesItem.ID != nil { + rulesMap["id"] = rulesItem.ID + } + + return rulesMap +} + +func dataSourceLoadBalancerListenerPolicyCollectionRulesDeletedToMap(deletedItem vpcv1.LoadBalancerListenerPolicyRuleReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerPolicyCollectionPoliciesTargetToMap(targetItem vpcv1.LoadBalancerListenerPolicyTarget) (targetMap map[string]interface{}) { + targetMap = map[string]interface{}{} + + if targetItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPolicyCollectionTargetDeletedToMap(*targetItem.Deleted) + deletedList = append(deletedList, deletedMap) + targetMap["deleted"] = deletedList + } + if targetItem.Href != nil { + targetMap["href"] = targetItem.Href + } + if targetItem.ID != nil { + targetMap["id"] = targetItem.ID + } + if targetItem.Name != nil { + targetMap["name"] = targetItem.Name + } + if targetItem.HTTPStatusCode != nil { + targetMap["http_status_code"] = targetItem.HTTPStatusCode + } + if targetItem.URL != nil { + targetMap["url"] = targetItem.URL + } + if targetItem.Listener != nil { + listenerList := []map[string]interface{}{} + listenerMap := dataSourceLoadBalancerListenerPolicyCollectionTargetListenerToMap(*targetItem.Listener) + listenerList = append(listenerList, listenerMap) + targetMap["listener"] = listenerList + } + if targetItem.URI != nil { + targetMap["uri"] = targetItem.URI + } + + return targetMap +} + +func dataSourceLoadBalancerListenerPolicyCollectionTargetDeletedToMap(deletedItem vpcv1.LoadBalancerPoolReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerPolicyCollectionTargetListenerToMap(listenerItem vpcv1.LoadBalancerListenerReference) (listenerMap map[string]interface{}) { + listenerMap = map[string]interface{}{} + + if listenerItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPolicyCollectionListenerDeletedToMap(*listenerItem.Deleted) + deletedList = append(deletedList, deletedMap) + listenerMap["deleted"] = deletedList + } + if listenerItem.Href != nil { + listenerMap["href"] = listenerItem.Href + } + if listenerItem.ID != nil { + listenerMap["id"] = listenerItem.ID + } + + return listenerMap +} + +func dataSourceLoadBalancerListenerPolicyCollectionListenerDeletedToMap(deletedItem vpcv1.LoadBalancerListenerReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy.go new file mode 100644 index 0000000000..9ebd0df2bb --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy.go @@ -0,0 +1,365 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBListenerPolicy() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbListenerPolicyRead, + + Schema: map[string]*schema.Schema{ + isLBListenerPolicyLBID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + isLBListenerPolicyListenerID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The listener identifier.", + }, + isLBListenerPolicyID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The policy identifier.", + }, + "action": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy action.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the unexpected property value was encountered.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this policy was created.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener policy's canonical URL.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this policy.", + }, + "priority": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "Priority of the policy. Lower value indicates higher priority.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this policy.", + }, + "rules": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The rules for this policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's unique identifier.", + }, + }, + }, + }, + "target": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "- If `action` is `forward`, the response is a `LoadBalancerPoolReference`- If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL`- If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The pool's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this load balancer pool.", + }, + "http_status_code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The HTTP status code for this redirect.", + }, + "url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The redirect target URL.", + }, + "listener": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer listener.", + }, + }, + }, + }, + "uri": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The redirect relative target URI.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbListenerPolicyRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + getLoadBalancerListenerPolicyOptions := &vpcv1.GetLoadBalancerListenerPolicyOptions{} + + getLoadBalancerListenerPolicyOptions.SetLoadBalancerID(d.Get(isLBListenerPolicyLBID).(string)) + getLoadBalancerListenerPolicyOptions.SetListenerID(d.Get(isLBListenerPolicyListenerID).(string)) + getLoadBalancerListenerPolicyOptions.SetID(d.Get(isLBListenerPolicyID).(string)) + + loadBalancerListenerPolicy, response, err := vpcClient.GetLoadBalancerListenerPolicyWithContext(context, getLoadBalancerListenerPolicyOptions) + if err != nil { + log.Printf("[DEBUG] GetLoadBalancerListenerPolicyWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetLoadBalancerListenerPolicyWithContext failed %s\n%s", err, response)) + } + d.SetId(*loadBalancerListenerPolicy.ID) + if err = d.Set("action", loadBalancerListenerPolicy.Action); err != nil { + return diag.FromErr(fmt.Errorf("Error setting action: %s", err)) + } + + if err = d.Set("created_at", loadBalancerListenerPolicy.CreatedAt.String()); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("href", loadBalancerListenerPolicy.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("name", loadBalancerListenerPolicy.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("priority", flex.IntValue(loadBalancerListenerPolicy.Priority)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting priority: %s", err)) + } + if err = d.Set("provisioning_status", loadBalancerListenerPolicy.ProvisioningStatus); err != nil { + return diag.FromErr(fmt.Errorf("Error setting provisioning_status: %s", err)) + } + + if loadBalancerListenerPolicy.Rules != nil { + err = d.Set("rules", dataSourceLoadBalancerListenerPolicyFlattenRules(loadBalancerListenerPolicy.Rules)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting rules %s", err)) + } + } + + if loadBalancerListenerPolicy.Target != nil { + target := loadBalancerListenerPolicy.Target.(*vpcv1.LoadBalancerListenerPolicyTarget) + err = d.Set("target", dataSourceLoadBalancerListenerPolicyFlattenTarget(*target)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting target %s", err)) + } + } + + return nil +} + +func dataSourceLoadBalancerListenerPolicyFlattenRules(result []vpcv1.LoadBalancerListenerPolicyRuleReference) (rules []map[string]interface{}) { + for _, rulesItem := range result { + rules = append(rules, dataSourceLoadBalancerListenerPolicyRulesToMap(rulesItem)) + } + + return rules +} + +func dataSourceLoadBalancerListenerPolicyRulesToMap(rulesItem vpcv1.LoadBalancerListenerPolicyRuleReference) (rulesMap map[string]interface{}) { + rulesMap = map[string]interface{}{} + + if rulesItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPolicyRulesDeletedToMap(*rulesItem.Deleted) + deletedList = append(deletedList, deletedMap) + rulesMap["deleted"] = deletedList + } + if rulesItem.Href != nil { + rulesMap["href"] = rulesItem.Href + } + if rulesItem.ID != nil { + rulesMap["id"] = rulesItem.ID + } + + return rulesMap +} + +func dataSourceLoadBalancerListenerPolicyRulesDeletedToMap(deletedItem vpcv1.LoadBalancerListenerPolicyRuleReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerPolicyFlattenTarget(result vpcv1.LoadBalancerListenerPolicyTarget) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerListenerPolicyTargetToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerListenerPolicyTargetToMap(targetItem vpcv1.LoadBalancerListenerPolicyTarget) (targetMap map[string]interface{}) { + targetMap = map[string]interface{}{} + + if targetItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPolicyTargetDeletedToMap(*targetItem.Deleted) + deletedList = append(deletedList, deletedMap) + targetMap["deleted"] = deletedList + } + if targetItem.Href != nil { + targetMap["href"] = targetItem.Href + } + if targetItem.ID != nil { + targetMap["id"] = targetItem.ID + } + if targetItem.Name != nil { + targetMap["name"] = targetItem.Name + } + if targetItem.HTTPStatusCode != nil { + targetMap["http_status_code"] = targetItem.HTTPStatusCode + } + if targetItem.URL != nil { + targetMap["url"] = targetItem.URL + } + if targetItem.Listener != nil { + listenerList := []map[string]interface{}{} + listenerMap := dataSourceLoadBalancerListenerPolicyTargetListenerToMap(*targetItem.Listener) + listenerList = append(listenerList, listenerMap) + targetMap["listener"] = listenerList + } + if targetItem.URI != nil { + targetMap["uri"] = targetItem.URI + } + + return targetMap +} + +func dataSourceLoadBalancerListenerPolicyTargetDeletedToMap(deletedItem vpcv1.LoadBalancerPoolReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerPolicyTargetListenerToMap(listenerItem vpcv1.LoadBalancerListenerReference) (listenerMap map[string]interface{}) { + listenerMap = map[string]interface{}{} + + if listenerItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerPolicyListenerDeletedToMap(*listenerItem.Deleted) + deletedList = append(deletedList, deletedMap) + listenerMap["deleted"] = deletedList + } + if listenerItem.Href != nil { + listenerMap["href"] = listenerItem.Href + } + if listenerItem.ID != nil { + listenerMap["id"] = listenerItem.ID + } + + return listenerMap +} + +func dataSourceLoadBalancerListenerPolicyListenerDeletedToMap(deletedItem vpcv1.LoadBalancerListenerReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy_rule.go new file mode 100644 index 0000000000..76be6381ff --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy_rule.go @@ -0,0 +1,125 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBListenerPolicyRule() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbListenerPolicyRuleRead, + + Schema: map[string]*schema.Schema{ + isLBListenerPolicyRuleLBID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + isLBListenerPolicyRuleListenerID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The listener identifier.", + }, + isLBListenerPolicyRulePolicyID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The policy identifier.", + }, + isLBListenerPolicyRuleid: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The rule identifier.", + }, + "condition": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The condition of the rule.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this rule was created.", + }, + "field": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The field. This is applicable to `header`, `query`, and `body` rule types.If the rule type is `header`, this property is required.If the rule type is `query`, this is optional. If specified and the rule condition is not`matches_regex`, the value must be percent-encoded.If the rule type is `body`, this is optional.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's canonical URL.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this rule.", + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The type of the rule.Body rules are applied to form-encoded request bodies using the `UTF-8` character set.", + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Value to be matched for rule condition.If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded.", + }, + }, + } +} + +func dataSourceIBMIsLbListenerPolicyRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + getLoadBalancerListenerPolicyRuleOptions := &vpcv1.GetLoadBalancerListenerPolicyRuleOptions{} + + getLoadBalancerListenerPolicyRuleOptions.SetLoadBalancerID(d.Get(isLBListenerPolicyRuleLBID).(string)) + getLoadBalancerListenerPolicyRuleOptions.SetListenerID(d.Get(isLBListenerPolicyRuleListenerID).(string)) + getLoadBalancerListenerPolicyRuleOptions.SetPolicyID(d.Get(isLBListenerPolicyRulePolicyID).(string)) + getLoadBalancerListenerPolicyRuleOptions.SetID(d.Get(isLBListenerPolicyRuleid).(string)) + + loadBalancerListenerPolicyRule, response, err := vpcClient.GetLoadBalancerListenerPolicyRuleWithContext(context, getLoadBalancerListenerPolicyRuleOptions) + if err != nil { + log.Printf("[DEBUG] GetLoadBalancerListenerPolicyRuleWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetLoadBalancerListenerPolicyRuleWithContext failed %s\n%s", err, response)) + } + + d.SetId(*loadBalancerListenerPolicyRule.ID) + if err = d.Set("condition", loadBalancerListenerPolicyRule.Condition); err != nil { + return diag.FromErr(fmt.Errorf("Error setting condition: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(loadBalancerListenerPolicyRule.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("field", loadBalancerListenerPolicyRule.Field); err != nil { + return diag.FromErr(fmt.Errorf("Error setting field: %s", err)) + } + if err = d.Set("href", loadBalancerListenerPolicyRule.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("provisioning_status", loadBalancerListenerPolicyRule.ProvisioningStatus); err != nil { + return diag.FromErr(fmt.Errorf("Error setting provisioning_status: %s", err)) + } + if err = d.Set("type", loadBalancerListenerPolicyRule.Type); err != nil { + return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + } + if err = d.Set("value", loadBalancerListenerPolicyRule.Value); err != nil { + return diag.FromErr(fmt.Errorf("Error setting value: %s", err)) + } + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy_rules.go new file mode 100644 index 0000000000..b4f6ecb000 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listener_policy_rules.go @@ -0,0 +1,161 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBListenerPolicyRules() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbListenerPolicyRulesRead, + + Schema: map[string]*schema.Schema{ + isLBListenerPolicyRuleLBID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + isLBListenerPolicyRuleListenerID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The listener identifier.", + }, + isLBListenerPolicyRulePolicyID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The policy identifier.", + }, + "rules": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of rules.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "condition": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The condition of the rule.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this rule was created.", + }, + "field": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The field. This is applicable to `header`, `query`, and `body` rule types.If the rule type is `header`, this property is required.If the rule type is `query`, this is optional. If specified and the rule condition is not`matches_regex`, the value must be percent-encoded.If the rule type is `body`, this is optional.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The rule's unique identifier.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this rule.", + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The type of the rule.Body rules are applied to form-encoded request bodies using the `UTF-8` character set.", + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Value to be matched for rule condition.If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbListenerPolicyRulesRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + listLoadBalancerListenerPolicyRulesOptions := &vpcv1.ListLoadBalancerListenerPolicyRulesOptions{} + listLoadBalancerListenerPolicyRulesOptions.SetLoadBalancerID(d.Get(isLBListenerPolicyRuleLBID).(string)) + listLoadBalancerListenerPolicyRulesOptions.SetListenerID(d.Get(isLBListenerPolicyRuleListenerID).(string)) + listLoadBalancerListenerPolicyRulesOptions.SetPolicyID(d.Get(isLBListenerPolicyRulePolicyID).(string)) + + loadBalancerListenerPolicyRuleCollection, response, err := vpcClient.ListLoadBalancerListenerPolicyRulesWithContext(context, listLoadBalancerListenerPolicyRulesOptions) + if err != nil { + log.Printf("[DEBUG] ListLoadBalancerListenerPolicyRulesWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListLoadBalancerListenerPolicyRulesWithContext failed %s\n%s", err, response)) + } + + d.SetId(dataSourceIBMIsLbListenerPolicyRulesID(d)) + + if loadBalancerListenerPolicyRuleCollection.Rules != nil { + err = d.Set("rules", dataSourceLoadBalancerListenerPolicyRuleCollectionFlattenRules(loadBalancerListenerPolicyRuleCollection.Rules)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting rules %s", err)) + } + } + + return nil +} + +// dataSourceIBMIsLbListenerPolicyRulesID returns a reasonable ID for the list. +func dataSourceIBMIsLbListenerPolicyRulesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceLoadBalancerListenerPolicyRuleCollectionFlattenRules(result []vpcv1.LoadBalancerListenerPolicyRule) (rules []map[string]interface{}) { + for _, rulesItem := range result { + rules = append(rules, dataSourceLoadBalancerListenerPolicyRuleCollectionRulesToMap(rulesItem)) + } + + return rules +} + +func dataSourceLoadBalancerListenerPolicyRuleCollectionRulesToMap(rulesItem vpcv1.LoadBalancerListenerPolicyRule) (rulesMap map[string]interface{}) { + rulesMap = map[string]interface{}{} + if rulesItem.Condition != nil { + rulesMap["condition"] = rulesItem.Condition + } + if rulesItem.CreatedAt != nil { + rulesMap["created_at"] = rulesItem.CreatedAt.String() + } + if rulesItem.Field != nil { + rulesMap["field"] = rulesItem.Field + } + if rulesItem.Href != nil { + rulesMap["href"] = rulesItem.Href + } + if rulesItem.ID != nil { + rulesMap["id"] = rulesItem.ID + } + if rulesItem.ProvisioningStatus != nil { + rulesMap["provisioning_status"] = rulesItem.ProvisioningStatus + } + if rulesItem.Type != nil { + rulesMap["type"] = rulesItem.Type + } + if rulesItem.Value != nil { + rulesMap["value"] = rulesItem.Value + } + + return rulesMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listeners.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listeners.go new file mode 100644 index 0000000000..fc47c762b9 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_listeners.go @@ -0,0 +1,448 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBListeners() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbListenersRead, + + Schema: map[string]*schema.Schema{ + isLBListenerLBID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The load balancer identifier.", + }, + "listeners": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of listeners.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accept_proxy_protocol": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). Additional restrictions:- If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must match the `accept_proxy_protocol` value of the `https_redirect` listener.- If this listener is the target of another listener's `https_redirect`, its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value.", + }, + "certificate_instance": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The certificate instance used for SSL termination. It is applicable only to `https`protocol.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this certificate instance.", + }, + }, + }, + }, + "connection_limit": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The connection limit of the listener.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this listener was created.", + }, + "default_pool": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The default pool associated with the listener.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The pool's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this load balancer pool.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener's canonical URL.", + }, + "https_redirect": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If specified, the target listener that requests are redirected to.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "http_status_code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The HTTP status code for this redirect.", + }, + "listener": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer listener.", + }, + }, + }, + }, + "uri": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The redirect relative target URI.", + }, + }, + }, + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer listener.", + }, + "policies": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The policies for this listener.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener policy's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The policy's unique identifier.", + }, + }, + }, + }, + "port": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + }, + "port_max": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive upper bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", + }, + "port_min": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive lower bound of the range of ports used by this listener.Only load balancers in the `network` family support more than one port per listener.", + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and `protocol` combination.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this listener.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbListenersRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + listLoadBalancerListenersOptions := &vpcv1.ListLoadBalancerListenersOptions{} + + listLoadBalancerListenersOptions.SetLoadBalancerID(d.Get(isLBListenerLBID).(string)) + + loadBalancerListenerCollection, response, err := vpcClient.ListLoadBalancerListenersWithContext(context, listLoadBalancerListenersOptions) + if err != nil { + log.Printf("[DEBUG] ListLoadBalancerListenersWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListLoadBalancerListenersWithContext failed %s\n%s", err, response)) + } + + d.SetId(dataSourceIBMIsLbListenersID(d)) + + if loadBalancerListenerCollection.Listeners != nil { + err = d.Set("listeners", dataSourceLoadBalancerListenerCollectionFlattenListeners(loadBalancerListenerCollection.Listeners)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting listeners %s", err)) + } + } + + return nil +} + +// dataSourceIBMIsLbListenersID returns a reasonable ID for the list. +func dataSourceIBMIsLbListenersID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceLoadBalancerListenerCollectionFlattenListeners(result []vpcv1.LoadBalancerListener) (listeners []map[string]interface{}) { + for _, listenersItem := range result { + listeners = append(listeners, dataSourceLoadBalancerListenerCollectionListenersToMap(listenersItem)) + } + + return listeners +} + +func dataSourceLoadBalancerListenerCollectionListenersToMap(listenersItem vpcv1.LoadBalancerListener) (listenersMap map[string]interface{}) { + listenersMap = map[string]interface{}{} + + if listenersItem.AcceptProxyProtocol != nil { + listenersMap["accept_proxy_protocol"] = listenersItem.AcceptProxyProtocol + } + if listenersItem.CertificateInstance != nil { + certificateInstanceList := []map[string]interface{}{} + certificateInstanceMap := dataSourceLoadBalancerListenerCollectionListenersCertificateInstanceToMap(*listenersItem.CertificateInstance) + certificateInstanceList = append(certificateInstanceList, certificateInstanceMap) + listenersMap["certificate_instance"] = certificateInstanceList + } + if listenersItem.ConnectionLimit != nil { + listenersMap["connection_limit"] = listenersItem.ConnectionLimit + } + if listenersItem.CreatedAt != nil { + listenersMap["created_at"] = listenersItem.CreatedAt.String() + } + if listenersItem.DefaultPool != nil { + defaultPoolList := []map[string]interface{}{} + defaultPoolMap := dataSourceLoadBalancerListenerCollectionListenersDefaultPoolToMap(*listenersItem.DefaultPool) + defaultPoolList = append(defaultPoolList, defaultPoolMap) + listenersMap["default_pool"] = defaultPoolList + } + if listenersItem.Href != nil { + listenersMap["href"] = listenersItem.Href + } + if listenersItem.HTTPSRedirect != nil { + httpsRedirectList := []map[string]interface{}{} + httpsRedirectMap := dataSourceLoadBalancerListenerCollectionListenersHTTPSRedirectToMap(*listenersItem.HTTPSRedirect) + httpsRedirectList = append(httpsRedirectList, httpsRedirectMap) + listenersMap["https_redirect"] = httpsRedirectList + } + if listenersItem.ID != nil { + listenersMap["id"] = listenersItem.ID + } + if listenersItem.Policies != nil { + policiesList := []map[string]interface{}{} + for _, policiesItem := range listenersItem.Policies { + policiesList = append(policiesList, dataSourceLoadBalancerListenerCollectionListenersPoliciesToMap(policiesItem)) + } + listenersMap["policies"] = policiesList + } + if listenersItem.Port != nil { + listenersMap["port"] = listenersItem.Port + } + if listenersItem.PortMax != nil { + listenersMap["port_max"] = listenersItem.PortMax + } + if listenersItem.PortMin != nil { + listenersMap["port_min"] = listenersItem.PortMin + } + if listenersItem.Protocol != nil { + listenersMap["protocol"] = listenersItem.Protocol + } + if listenersItem.ProvisioningStatus != nil { + listenersMap["provisioning_status"] = listenersItem.ProvisioningStatus + } + + return listenersMap +} + +func dataSourceLoadBalancerListenerCollectionListenersCertificateInstanceToMap(certificateInstanceItem vpcv1.CertificateInstanceReference) (certificateInstanceMap map[string]interface{}) { + certificateInstanceMap = map[string]interface{}{} + + if certificateInstanceItem.CRN != nil { + certificateInstanceMap["crn"] = certificateInstanceItem.CRN + } + + return certificateInstanceMap +} + +func dataSourceLoadBalancerListenerCollectionListenersDefaultPoolToMap(defaultPoolItem vpcv1.LoadBalancerPoolReference) (defaultPoolMap map[string]interface{}) { + defaultPoolMap = map[string]interface{}{} + + if defaultPoolItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerCollectionDefaultPoolDeletedToMap(*defaultPoolItem.Deleted) + deletedList = append(deletedList, deletedMap) + defaultPoolMap["deleted"] = deletedList + } + if defaultPoolItem.Href != nil { + defaultPoolMap["href"] = defaultPoolItem.Href + } + if defaultPoolItem.ID != nil { + defaultPoolMap["id"] = defaultPoolItem.ID + } + if defaultPoolItem.Name != nil { + defaultPoolMap["name"] = defaultPoolItem.Name + } + + return defaultPoolMap +} + +func dataSourceLoadBalancerListenerCollectionDefaultPoolDeletedToMap(deletedItem vpcv1.LoadBalancerPoolReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerCollectionListenersHTTPSRedirectToMap(httpsRedirectItem vpcv1.LoadBalancerListenerHTTPSRedirect) (httpsRedirectMap map[string]interface{}) { + httpsRedirectMap = map[string]interface{}{} + + if httpsRedirectItem.HTTPStatusCode != nil { + httpsRedirectMap["http_status_code"] = httpsRedirectItem.HTTPStatusCode + } + if httpsRedirectItem.Listener != nil { + listenerList := []map[string]interface{}{} + listenerMap := dataSourceLoadBalancerListenerCollectionHTTPSRedirectListenerToMap(*httpsRedirectItem.Listener) + listenerList = append(listenerList, listenerMap) + httpsRedirectMap["listener"] = listenerList + } + if httpsRedirectItem.URI != nil { + httpsRedirectMap["uri"] = httpsRedirectItem.URI + } + + return httpsRedirectMap +} + +func dataSourceLoadBalancerListenerCollectionHTTPSRedirectListenerToMap(listenerItem vpcv1.LoadBalancerListenerReference) (listenerMap map[string]interface{}) { + listenerMap = map[string]interface{}{} + + if listenerItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerCollectionListenerDeletedToMap(*listenerItem.Deleted) + deletedList = append(deletedList, deletedMap) + listenerMap["deleted"] = deletedList + } + if listenerItem.Href != nil { + listenerMap["href"] = listenerItem.Href + } + if listenerItem.ID != nil { + listenerMap["id"] = listenerItem.ID + } + + return listenerMap +} + +func dataSourceLoadBalancerListenerCollectionListenerDeletedToMap(deletedItem vpcv1.LoadBalancerListenerReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerListenerCollectionListenersPoliciesToMap(policiesItem vpcv1.LoadBalancerListenerPolicyReference) (policiesMap map[string]interface{}) { + policiesMap = map[string]interface{}{} + + if policiesItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerListenerCollectionPoliciesDeletedToMap(*policiesItem.Deleted) + deletedList = append(deletedList, deletedMap) + policiesMap["deleted"] = deletedList + } + if policiesItem.Href != nil { + policiesMap["href"] = policiesItem.Href + } + if policiesItem.ID != nil { + policiesMap["id"] = policiesItem.ID + } + + return policiesMap +} + +func dataSourceLoadBalancerListenerCollectionPoliciesDeletedToMap(deletedItem vpcv1.LoadBalancerListenerPolicyReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool.go new file mode 100644 index 0000000000..9e1c8870d2 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool.go @@ -0,0 +1,446 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBPool() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbPoolRead, + + Schema: map[string]*schema.Schema{ + "lb": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + "identifier": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"name", "identifier"}, + Description: "The pool identifier.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ExactlyOneOf: []string{"name", "identifier"}, + Description: "The user-defined name for this load balancer pool.", + }, + "algorithm": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The load balancing algorithm.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this pool was created.", + }, + "health_monitor": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The health monitor of this pool.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "delay": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check interval in seconds. Interval must be greater than timeout value.", + }, + "max_retries": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check max retries.", + }, + "port": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check port number. If specified, this overrides the ports specified in the server member resources.", + }, + "timeout": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check timeout in seconds.", + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol type of this load balancer pool health monitor.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which the unexpected property value was encountered.", + }, + "url_path": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health check URL path. Applicable only if the health monitor `type` is `http` or`https`. This value must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1).", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The pool's canonical URL.", + }, + "instance_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The instance group that is managing this pool.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this instance group.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this instance group.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this instance group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this instance group.", + }, + }, + }, + }, + "members": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The backend server members of the pool.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The member's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool member.", + }, + }, + }, + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol used for this load balancer pool.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the unexpected property value was encountered.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this pool.", + }, + "proxy_protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The PROXY protocol setting for this pool:- `v1`: Enabled with version 1 (human-readable header format)- `v2`: Enabled with version 2 (binary header format)- `disabled`: DisabledSupported by load balancers in the `application` family (otherwise always `disabled`).", + }, + "session_persistence": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The session persistence of this pool.The enumerated values for this property are expected to expand in the future. Whenprocessing this property, check for and log unknown values. Optionally haltprocessing and surface the error, or bypass the pool on which the unexpectedproperty value was encountered.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "cookie_name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not allowed.", + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` protocols.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbPoolRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + var loadBalancerPool *vpcv1.LoadBalancerPool + + if v, ok := d.GetOk("identifier"); ok { + getLoadBalancerPoolOptions := &vpcv1.GetLoadBalancerPoolOptions{} + + getLoadBalancerPoolOptions.SetLoadBalancerID(d.Get("lb").(string)) + getLoadBalancerPoolOptions.SetID(v.(string)) + + loadBalancerPoolInfo, response, err := sess.GetLoadBalancerPoolWithContext(context, getLoadBalancerPoolOptions) + if err != nil { + log.Printf("[DEBUG] GetLoadBalancerPoolWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetLoadBalancerPoolWithContext failed %s\n%s", err, response)) + } + loadBalancerPool = loadBalancerPoolInfo + + } else if v, ok := d.GetOk("name"); ok { + listLoadBalancerPoolsOptions := &vpcv1.ListLoadBalancerPoolsOptions{} + + listLoadBalancerPoolsOptions.SetLoadBalancerID(d.Get("lb").(string)) + + loadBalancerPoolCollection, response, err := sess.ListLoadBalancerPoolsWithContext(context, listLoadBalancerPoolsOptions) + if err != nil { + log.Printf("[DEBUG] ListLoadBalancerPoolsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListLoadBalancerPoolsWithContext failed %s\n%s", err, response)) + } + + name := v.(string) + for _, data := range loadBalancerPoolCollection.Pools { + if *data.Name == name { + loadBalancerPool = &data + break + } + } + if loadBalancerPool == nil { + log.Printf("[DEBUG] No LoadBalancerPool found with name (%s)", name) + return diag.FromErr(fmt.Errorf("No LoadBalancerPool found with name (%s)", name)) + } + + } + + d.SetId(*loadBalancerPool.ID) + if err = d.Set("algorithm", loadBalancerPool.Algorithm); err != nil { + return diag.FromErr(fmt.Errorf("Error setting algorithm: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(loadBalancerPool.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + + if loadBalancerPool.HealthMonitor != nil { + err = d.Set("health_monitor", dataSourceLoadBalancerPoolFlattenHealthMonitor(*loadBalancerPool.HealthMonitor)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting health_monitor %s", err)) + } + } + if err = d.Set("href", loadBalancerPool.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + + if loadBalancerPool.InstanceGroup != nil { + err = d.Set("instance_group", dataSourceLoadBalancerPoolFlattenInstanceGroup(*loadBalancerPool.InstanceGroup)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting instance_group %s", err)) + } + } + + if loadBalancerPool.Members != nil { + err = d.Set("members", dataSourceLoadBalancerPoolFlattenMembers(loadBalancerPool.Members)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting members %s", err)) + } + } + + if err = d.Set("identifier", loadBalancerPool.ID); err != nil { + return diag.FromErr(fmt.Errorf("Error setting identifier: %s", err)) + } + + if err = d.Set("name", loadBalancerPool.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("protocol", loadBalancerPool.Protocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting protocol: %s", err)) + } + if err = d.Set("provisioning_status", loadBalancerPool.ProvisioningStatus); err != nil { + return diag.FromErr(fmt.Errorf("Error setting provisioning_status: %s", err)) + } + if err = d.Set("proxy_protocol", loadBalancerPool.ProxyProtocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting proxy_protocol: %s", err)) + } + + if loadBalancerPool.SessionPersistence != nil { + err = d.Set("session_persistence", dataSourceLoadBalancerPoolFlattenSessionPersistence(*loadBalancerPool.SessionPersistence)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting session_persistence %s", err)) + } + } + + return nil +} + +func dataSourceLoadBalancerPoolFlattenHealthMonitor(result vpcv1.LoadBalancerPoolHealthMonitor) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerPoolHealthMonitorToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerPoolHealthMonitorToMap(healthMonitorItem vpcv1.LoadBalancerPoolHealthMonitor) (healthMonitorMap map[string]interface{}) { + healthMonitorMap = map[string]interface{}{} + + if healthMonitorItem.Delay != nil { + healthMonitorMap["delay"] = healthMonitorItem.Delay + } + if healthMonitorItem.MaxRetries != nil { + healthMonitorMap["max_retries"] = healthMonitorItem.MaxRetries + } + if healthMonitorItem.Port != nil { + healthMonitorMap["port"] = healthMonitorItem.Port + } + if healthMonitorItem.Timeout != nil { + healthMonitorMap["timeout"] = healthMonitorItem.Timeout + } + if healthMonitorItem.Type != nil { + healthMonitorMap["type"] = healthMonitorItem.Type + } + if healthMonitorItem.URLPath != nil { + healthMonitorMap["url_path"] = healthMonitorItem.URLPath + } + + return healthMonitorMap +} + +func dataSourceLoadBalancerPoolFlattenInstanceGroup(result vpcv1.InstanceGroupReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerPoolInstanceGroupToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerPoolInstanceGroupToMap(instanceGroupItem vpcv1.InstanceGroupReference) (instanceGroupMap map[string]interface{}) { + instanceGroupMap = map[string]interface{}{} + + if instanceGroupItem.CRN != nil { + instanceGroupMap["crn"] = instanceGroupItem.CRN + } + if instanceGroupItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerPoolInstanceGroupDeletedToMap(*instanceGroupItem.Deleted) + deletedList = append(deletedList, deletedMap) + instanceGroupMap["deleted"] = deletedList + } + if instanceGroupItem.Href != nil { + instanceGroupMap["href"] = instanceGroupItem.Href + } + if instanceGroupItem.ID != nil { + instanceGroupMap["id"] = instanceGroupItem.ID + } + if instanceGroupItem.Name != nil { + instanceGroupMap["name"] = instanceGroupItem.Name + } + + return instanceGroupMap +} + +func dataSourceLoadBalancerPoolInstanceGroupDeletedToMap(deletedItem vpcv1.InstanceGroupReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerPoolFlattenMembers(result []vpcv1.LoadBalancerPoolMemberReference) (members []map[string]interface{}) { + for _, membersItem := range result { + members = append(members, dataSourceLoadBalancerPoolMembersToMap(membersItem)) + } + + return members +} + +func dataSourceLoadBalancerPoolMembersToMap(membersItem vpcv1.LoadBalancerPoolMemberReference) (membersMap map[string]interface{}) { + membersMap = map[string]interface{}{} + + if membersItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerPoolMembersDeletedToMap(*membersItem.Deleted) + deletedList = append(deletedList, deletedMap) + membersMap["deleted"] = deletedList + } + if membersItem.Href != nil { + membersMap["href"] = membersItem.Href + } + if membersItem.ID != nil { + membersMap["id"] = membersItem.ID + } + + return membersMap +} + +func dataSourceLoadBalancerPoolMembersDeletedToMap(deletedItem vpcv1.LoadBalancerPoolMemberReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerPoolFlattenSessionPersistence(result vpcv1.LoadBalancerPoolSessionPersistence) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerPoolSessionPersistenceToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerPoolSessionPersistenceToMap(sessionPersistenceItem vpcv1.LoadBalancerPoolSessionPersistence) (sessionPersistenceMap map[string]interface{}) { + sessionPersistenceMap = map[string]interface{}{} + + if sessionPersistenceItem.CookieName != nil { + sessionPersistenceMap["cookie_name"] = sessionPersistenceItem.CookieName + } + if sessionPersistenceItem.Type != nil { + sessionPersistenceMap["type"] = sessionPersistenceItem.Type + } + + return sessionPersistenceMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool_member.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool_member.go new file mode 100644 index 0000000000..8ccd2550f2 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool_member.go @@ -0,0 +1,213 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIBLBPoolMember() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbPoolMemberRead, + + Schema: map[string]*schema.Schema{ + "lb": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + "pool": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The pool identifier.", + }, + "member": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The member identifier.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this member was created.", + }, + "health": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Health of the server member in the pool.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The member's canonical URL.", + }, + "port": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The port number of the application running in the server member.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this member.", + }, + "target": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The pool member target. Load balancers in the `network` family support virtual serverinstances. Load balancers in the `application` family support IP addresses.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this virtual server instance.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this virtual server instance.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this virtual server instance.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this virtual server instance (and default system hostname).", + }, + "address": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + }, + }, + }, + }, + "weight": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "Weight of the server member. Applicable only if the pool algorithm is`weighted_round_robin`.", + }, + }, + } +} + +func dataSourceIBMIsLbPoolMemberRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + getLoadBalancerPoolMemberOptions := &vpcv1.GetLoadBalancerPoolMemberOptions{} + + getLoadBalancerPoolMemberOptions.SetLoadBalancerID(d.Get("lb").(string)) + getLoadBalancerPoolMemberOptions.SetPoolID(d.Get("pool").(string)) + getLoadBalancerPoolMemberOptions.SetID(d.Get("member").(string)) + + loadBalancerPoolMember, response, err := sess.GetLoadBalancerPoolMemberWithContext(context, getLoadBalancerPoolMemberOptions) + if err != nil { + log.Printf("[DEBUG] GetLoadBalancerPoolMemberWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetLoadBalancerPoolMemberWithContext failed %s\n%s", err, response)) + } + + d.SetId(*loadBalancerPoolMember.ID) + if err = d.Set("created_at", flex.DateTimeToString(loadBalancerPoolMember.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("health", loadBalancerPoolMember.Health); err != nil { + return diag.FromErr(fmt.Errorf("Error setting health: %s", err)) + } + if err = d.Set("href", loadBalancerPoolMember.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("port", flex.IntValue(loadBalancerPoolMember.Port)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting port: %s", err)) + } + if err = d.Set("provisioning_status", loadBalancerPoolMember.ProvisioningStatus); err != nil { + return diag.FromErr(fmt.Errorf("Error setting provisioning_status: %s", err)) + } + + if loadBalancerPoolMember.Target != nil { + target := loadBalancerPoolMember.Target.(*vpcv1.LoadBalancerPoolMemberTarget) + err = d.Set("target", dataSourceLoadBalancerPoolMemberFlattenTarget(*target)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting target %s", err)) + } + } + if err = d.Set("weight", flex.IntValue(loadBalancerPoolMember.Weight)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting weight: %s", err)) + } + + return nil +} + +func dataSourceLoadBalancerPoolMemberFlattenTarget(result vpcv1.LoadBalancerPoolMemberTarget) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceLoadBalancerPoolMemberTargetToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceLoadBalancerPoolMemberTargetToMap(targetItem vpcv1.LoadBalancerPoolMemberTarget) (targetMap map[string]interface{}) { + targetMap = map[string]interface{}{} + + if targetItem.CRN != nil { + targetMap["crn"] = targetItem.CRN + } + if targetItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerPoolMemberTargetDeletedToMap(*targetItem.Deleted) + deletedList = append(deletedList, deletedMap) + targetMap["deleted"] = deletedList + } + if targetItem.Href != nil { + targetMap["href"] = targetItem.Href + } + if targetItem.ID != nil { + targetMap["id"] = targetItem.ID + } + if targetItem.Name != nil { + targetMap["name"] = targetItem.Name + } + if targetItem.Address != nil { + targetMap["address"] = targetItem.Address + } + + return targetMap +} + +func dataSourceLoadBalancerPoolMemberTargetDeletedToMap(deletedItem vpcv1.InstanceReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool_members.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool_members.go new file mode 100644 index 0000000000..8d07993be8 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pool_members.go @@ -0,0 +1,242 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBPoolMembers() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbPoolMembersRead, + + Schema: map[string]*schema.Schema{ + "lb": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + "pool": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The pool identifier.", + }, + "members": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of members.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this member was created.", + }, + "health": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Health of the server member in the pool.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The member's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool member.", + }, + "port": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The port number of the application running in the server member.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this member.", + }, + "target": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The pool member target. Load balancers in the `network` family support virtual serverinstances. Load balancers in the `application` family support IP addresses.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this virtual server instance.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this virtual server instance.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this virtual server instance.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this virtual server instance (and default system hostname).", + }, + "address": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + }, + }, + }, + }, + "weight": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "Weight of the server member. Applicable only if the pool algorithm is`weighted_round_robin`.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbPoolMembersRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + listLoadBalancerPoolMembersOptions := &vpcv1.ListLoadBalancerPoolMembersOptions{} + + listLoadBalancerPoolMembersOptions.SetLoadBalancerID(d.Get("lb").(string)) + listLoadBalancerPoolMembersOptions.SetPoolID(d.Get("pool").(string)) + + loadBalancerPoolMemberCollection, response, err := sess.ListLoadBalancerPoolMembersWithContext(context, listLoadBalancerPoolMembersOptions) + if err != nil { + log.Printf("[DEBUG] ListLoadBalancerPoolMembersWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListLoadBalancerPoolMembersWithContext failed %s\n%s", err, response)) + } + + d.SetId(dataSourceIBMIsLbPoolMembersID(d)) + + if loadBalancerPoolMemberCollection.Members != nil { + err = d.Set("members", dataSourceLoadBalancerPoolMemberCollectionFlattenMembers(loadBalancerPoolMemberCollection.Members)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting members %s", err)) + } + } + + return nil +} + +// dataSourceIBMIsLbPoolMembersID returns a reasonable ID for the list. +func dataSourceIBMIsLbPoolMembersID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceLoadBalancerPoolMemberCollectionFlattenMembers(result []vpcv1.LoadBalancerPoolMember) (members []map[string]interface{}) { + for _, membersItem := range result { + members = append(members, dataSourceLoadBalancerPoolMemberCollectionMembersToMap(membersItem)) + } + + return members +} + +func dataSourceLoadBalancerPoolMemberCollectionMembersToMap(membersItem vpcv1.LoadBalancerPoolMember) (membersMap map[string]interface{}) { + membersMap = map[string]interface{}{} + + if membersItem.CreatedAt != nil { + membersMap["created_at"] = membersItem.CreatedAt.String() + } + if membersItem.Health != nil { + membersMap["health"] = membersItem.Health + } + if membersItem.Href != nil { + membersMap["href"] = membersItem.Href + } + if membersItem.ID != nil { + membersMap["id"] = membersItem.ID + } + if membersItem.Port != nil { + membersMap["port"] = membersItem.Port + } + if membersItem.ProvisioningStatus != nil { + membersMap["provisioning_status"] = membersItem.ProvisioningStatus + } + if membersItem.Target != nil { + targetList := []map[string]interface{}{} + target := membersItem.Target.(*vpcv1.LoadBalancerPoolMemberTarget) + targetMap := dataSourceLoadBalancerPoolMemberCollectionMembersTargetToMap(*target) + targetList = append(targetList, targetMap) + membersMap["target"] = targetList + } + if membersItem.Weight != nil { + membersMap["weight"] = membersItem.Weight + } + + return membersMap +} + +func dataSourceLoadBalancerPoolMemberCollectionMembersTargetToMap(targetItem vpcv1.LoadBalancerPoolMemberTarget) (targetMap map[string]interface{}) { + targetMap = map[string]interface{}{} + + if targetItem.CRN != nil { + targetMap["crn"] = targetItem.CRN + } + if targetItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerPoolMemberCollectionTargetDeletedToMap(*targetItem.Deleted) + deletedList = append(deletedList, deletedMap) + targetMap["deleted"] = deletedList + } + if targetItem.Href != nil { + targetMap["href"] = targetItem.Href + } + if targetItem.ID != nil { + targetMap["id"] = targetItem.ID + } + if targetItem.Name != nil { + targetMap["name"] = targetItem.Name + } + if targetItem.Address != nil { + targetMap["address"] = targetItem.Address + } + + return targetMap +} + +func dataSourceLoadBalancerPoolMemberCollectionTargetDeletedToMap(deletedItem vpcv1.InstanceReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pools.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pools.go new file mode 100644 index 0000000000..7726246568 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_pools.go @@ -0,0 +1,415 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISLBPools() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsLbPoolsRead, + + Schema: map[string]*schema.Schema{ + "lb": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The load balancer identifier.", + }, + "pools": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of pools.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "algorithm": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The load balancing algorithm.", + }, + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this pool was created.", + }, + "health_monitor": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The health monitor of this pool.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "delay": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check interval in seconds. Interval must be greater than timeout value.", + }, + "max_retries": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check max retries.", + }, + "port": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check port number. If specified, this overrides the ports specified in the server member resources.", + }, + "timeout": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The health check timeout in seconds.", + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol type of this load balancer pool health monitor.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which the unexpected property value was encountered.", + }, + "url_path": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The health check URL path. Applicable only if the health monitor `type` is `http` or`https`. This value must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1).", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The pool's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool.", + }, + "instance_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The instance group that is managing this pool.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this instance group.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this instance group.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this instance group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this instance group.", + }, + }, + }, + }, + "members": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The backend server members of the pool.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The member's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this load balancer pool member.", + }, + }, + }, + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this load balancer pool.", + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol used for this load balancer pool.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the unexpected property value was encountered.", + }, + "provisioning_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The provisioning status of this pool.", + }, + "proxy_protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The PROXY protocol setting for this pool:- `v1`: Enabled with version 1 (human-readable header format)- `v2`: Enabled with version 2 (binary header format)- `disabled`: DisabledSupported by load balancers in the `application` family (otherwise always `disabled`).", + }, + "session_persistence": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The session persistence of this pool.The enumerated values for this property are expected to expand in the future. Whenprocessing this property, check for and log unknown values. Optionally haltprocessing and surface the error, or bypass the pool on which the unexpectedproperty value was encountered.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "cookie_name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not allowed.", + }, + "type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` protocols.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsLbPoolsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + listLoadBalancerPoolsOptions := &vpcv1.ListLoadBalancerPoolsOptions{} + + listLoadBalancerPoolsOptions.SetLoadBalancerID(d.Get("lb").(string)) + + loadBalancerPoolCollection, response, err := sess.ListLoadBalancerPoolsWithContext(context, listLoadBalancerPoolsOptions) + if err != nil { + log.Printf("[DEBUG] ListLoadBalancerPoolsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListLoadBalancerPoolsWithContext failed %s\n%s", err, response)) + } + if err = d.Set("lb", d.Get("lb").(string)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting lb: %s", err)) + } + + d.SetId(dataSourceIBMIsLbPoolsID(d)) + + if loadBalancerPoolCollection.Pools != nil { + err = d.Set("pools", dataSourceLoadBalancerPoolCollectionFlattenPools(loadBalancerPoolCollection.Pools)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting pools %s", err)) + } + } + + return nil +} + +// dataSourceIBMIsLbPoolsID returns a reasonable ID for the list. +func dataSourceIBMIsLbPoolsID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceLoadBalancerPoolCollectionFlattenPools(result []vpcv1.LoadBalancerPool) (pools []map[string]interface{}) { + for _, poolsItem := range result { + pools = append(pools, dataSourceLoadBalancerPoolCollectionPoolsToMap(poolsItem)) + } + + return pools +} + +func dataSourceLoadBalancerPoolCollectionPoolsToMap(poolsItem vpcv1.LoadBalancerPool) (poolsMap map[string]interface{}) { + poolsMap = map[string]interface{}{} + + if poolsItem.Algorithm != nil { + poolsMap["algorithm"] = poolsItem.Algorithm + } + if poolsItem.CreatedAt != nil { + poolsMap["created_at"] = poolsItem.CreatedAt.String() + } + if poolsItem.HealthMonitor != nil { + healthMonitorList := []map[string]interface{}{} + healthMonitorMap := dataSourceLoadBalancerPoolCollectionPoolsHealthMonitorToMap(*poolsItem.HealthMonitor) + healthMonitorList = append(healthMonitorList, healthMonitorMap) + poolsMap["health_monitor"] = healthMonitorList + } + if poolsItem.Href != nil { + poolsMap["href"] = poolsItem.Href + } + if poolsItem.ID != nil { + poolsMap["id"] = poolsItem.ID + } + if poolsItem.InstanceGroup != nil { + instanceGroupList := []map[string]interface{}{} + instanceGroupMap := dataSourceLoadBalancerPoolCollectionPoolsInstanceGroupToMap(*poolsItem.InstanceGroup) + instanceGroupList = append(instanceGroupList, instanceGroupMap) + poolsMap["instance_group"] = instanceGroupList + } + if poolsItem.Members != nil { + membersList := []map[string]interface{}{} + for _, membersItem := range poolsItem.Members { + membersList = append(membersList, dataSourceLoadBalancerPoolCollectionPoolsMembersToMap(membersItem)) + } + poolsMap["members"] = membersList + } + if poolsItem.Name != nil { + poolsMap["name"] = poolsItem.Name + } + if poolsItem.Protocol != nil { + poolsMap["protocol"] = poolsItem.Protocol + } + if poolsItem.ProvisioningStatus != nil { + poolsMap["provisioning_status"] = poolsItem.ProvisioningStatus + } + if poolsItem.ProxyProtocol != nil { + poolsMap["proxy_protocol"] = poolsItem.ProxyProtocol + } + if poolsItem.SessionPersistence != nil { + sessionPersistenceList := []map[string]interface{}{} + sessionPersistenceMap := dataSourceLoadBalancerPoolCollectionPoolsSessionPersistenceToMap(*poolsItem.SessionPersistence) + sessionPersistenceList = append(sessionPersistenceList, sessionPersistenceMap) + poolsMap["session_persistence"] = sessionPersistenceList + } + + return poolsMap +} + +func dataSourceLoadBalancerPoolCollectionPoolsHealthMonitorToMap(healthMonitorItem vpcv1.LoadBalancerPoolHealthMonitor) (healthMonitorMap map[string]interface{}) { + healthMonitorMap = map[string]interface{}{} + + if healthMonitorItem.Delay != nil { + healthMonitorMap["delay"] = healthMonitorItem.Delay + } + if healthMonitorItem.MaxRetries != nil { + healthMonitorMap["max_retries"] = healthMonitorItem.MaxRetries + } + if healthMonitorItem.Port != nil { + healthMonitorMap["port"] = healthMonitorItem.Port + } + if healthMonitorItem.Timeout != nil { + healthMonitorMap["timeout"] = healthMonitorItem.Timeout + } + if healthMonitorItem.Type != nil { + healthMonitorMap["type"] = healthMonitorItem.Type + } + if healthMonitorItem.URLPath != nil { + healthMonitorMap["url_path"] = healthMonitorItem.URLPath + } + + return healthMonitorMap +} + +func dataSourceLoadBalancerPoolCollectionPoolsInstanceGroupToMap(instanceGroupItem vpcv1.InstanceGroupReference) (instanceGroupMap map[string]interface{}) { + instanceGroupMap = map[string]interface{}{} + + if instanceGroupItem.CRN != nil { + instanceGroupMap["crn"] = instanceGroupItem.CRN + } + if instanceGroupItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerPoolCollectionInstanceGroupDeletedToMap(*instanceGroupItem.Deleted) + deletedList = append(deletedList, deletedMap) + instanceGroupMap["deleted"] = deletedList + } + if instanceGroupItem.Href != nil { + instanceGroupMap["href"] = instanceGroupItem.Href + } + if instanceGroupItem.ID != nil { + instanceGroupMap["id"] = instanceGroupItem.ID + } + if instanceGroupItem.Name != nil { + instanceGroupMap["name"] = instanceGroupItem.Name + } + + return instanceGroupMap +} + +func dataSourceLoadBalancerPoolCollectionInstanceGroupDeletedToMap(deletedItem vpcv1.InstanceGroupReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerPoolCollectionPoolsMembersToMap(membersItem vpcv1.LoadBalancerPoolMemberReference) (membersMap map[string]interface{}) { + membersMap = map[string]interface{}{} + + if membersItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceLoadBalancerPoolCollectionMembersDeletedToMap(*membersItem.Deleted) + deletedList = append(deletedList, deletedMap) + membersMap["deleted"] = deletedList + } + if membersItem.Href != nil { + membersMap["href"] = membersItem.Href + } + if membersItem.ID != nil { + membersMap["id"] = membersItem.ID + } + + return membersMap +} + +func dataSourceLoadBalancerPoolCollectionMembersDeletedToMap(deletedItem vpcv1.LoadBalancerPoolMemberReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceLoadBalancerPoolCollectionPoolsSessionPersistenceToMap(sessionPersistenceItem vpcv1.LoadBalancerPoolSessionPersistence) (sessionPersistenceMap map[string]interface{}) { + sessionPersistenceMap = map[string]interface{}{} + + if sessionPersistenceItem.CookieName != nil { + sessionPersistenceMap["cookie_name"] = sessionPersistenceItem.CookieName + } + if sessionPersistenceItem.Type != nil { + sessionPersistenceMap["type"] = sessionPersistenceItem.Type + } + + return sessionPersistenceMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lb_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_profiles.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lb_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_profiles.go index 44c6f1b25d..378ae9fb29 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lb_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lb_profiles.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "reflect" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +17,7 @@ const ( isLbsProfiles = "lb_profiles" ) -func dataSourceIBMISLbProfiles() *schema.Resource { +func DataSourceIBMISLbProfiles() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISLbProfilesRead, @@ -75,9 +76,9 @@ func dataSourceIBMISLbProfilesRead(d *schema.ResourceData, meta interface{}) err } profileCollectors, response, err := sess.ListLoadBalancerProfiles(listOptions) if err != nil { - return fmt.Errorf("Error Fetching Load Balancer Profiles for VPC %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Load Balancer Profiles for VPC %s\n%s", err, response) } - start = GetNext(profileCollectors.Next) + start = flex.GetNext(profileCollectors.Next) allrecs = append(allrecs, profileCollectors.Profiles...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lbs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lbs.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lbs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lbs.go index 9dffea10ee..3ce73f7ce9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_lbs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_lbs.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -18,9 +19,10 @@ const ( CreatedAt = "created_at" isLbProfile = "profile" ProvisioningStatus = "provisioning_status" + ID = "id" ) -func dataSourceIBMISLBS() *schema.Resource { +func DataSourceIBMISLBS() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISLBSRead, Schema: map[string]*schema.Schema{ @@ -126,7 +128,7 @@ func dataSourceIBMISLBS() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Tags associated to Load Balancer", }, @@ -192,19 +194,19 @@ func dataSourceIBMISLBS() *schema.Resource { }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -239,9 +241,9 @@ func getLbs(d *schema.ResourceData, meta interface{}) error { } lbs, response, err := sess.ListLoadBalancers(listLoadBalancersOptions) if err != nil { - return fmt.Errorf("Error Fetching Load Balancers %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Load Balancers %s\n%s", err, response) } - start = GetNext(lbs.Next) + start = flex.GetNext(lbs.Next) allrecs = append(allrecs, lbs.LoadBalancers...) if start == "" { break @@ -343,22 +345,22 @@ func getLbs(d *schema.ResourceData, meta interface{}) error { } lbInfo[isLBResourceGroup] = *lb.ResourceGroup.ID lbInfo[isLBHostName] = *lb.Hostname - tags, err := GetTagsUsingCRN(meta, *lb.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *lb.CRN) if err != nil { log.Printf( "Error on get of resource vpc Load Balancer (%s) tags: %s", d.Id(), err) } lbInfo[isLBTags] = tags - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - lbInfo[ResourceControllerURL] = controller + "/vpc-ext/network/loadBalancers" - lbInfo[ResourceName] = *lb.Name + lbInfo[flex.ResourceControllerURL] = controller + "/vpc-ext/network/loadBalancers" + lbInfo[flex.ResourceName] = *lb.Name //log.Printf("*******lbInfo %+v", lbInfo) if lb.ResourceGroup != nil { - lbInfo[ResourceGroupName] = *lb.ResourceGroup.ID + lbInfo[flex.ResourceGroupName] = *lb.ResourceGroup.ID } lbList = append(lbList, lbInfo) // log.Printf("*******lbList %+v", lbList) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl.go index 518dc053e0..5e6e336e5b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,13 +9,15 @@ import ( "log" "reflect" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMIsNetworkACL() *schema.Resource { +func DataSourceIBMIsNetworkACL() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIsNetworkACLRead, @@ -345,7 +347,7 @@ func dataSourceIBMIsNetworkACL() *schema.Resource { } func dataSourceIBMIsNetworkACLRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -371,7 +373,7 @@ func dataSourceIBMIsNetworkACLRead(context context.Context, d *schema.ResourceDa log.Printf("[DEBUG] ListNetworkAclsWithContext failed %s\n%s", err, response) return diag.FromErr(fmt.Errorf("ListNetworkAclsWithContext failed %s\n%s", err, response)) } - start = GetNext(networkACLCollection.Next) + start = flex.GetNext(networkACLCollection.Next) allrecs = append(allrecs, networkACLCollection.NetworkAcls...) if start == "" { break @@ -388,7 +390,7 @@ func dataSourceIBMIsNetworkACLRead(context context.Context, d *schema.ResourceDa if !acl_found { log.Printf("[DEBUG] No networkACL found with given VPC %s and ACL name %s", vpc_name_str, network_acl_name) - return diag.FromErr(fmt.Errorf("No networkACL found with given VPC %s and ACL name %s", vpc_name_str, network_acl_name)) + return diag.FromErr(fmt.Errorf("[ERROR] No networkACL found with given VPC %s and ACL name %s", vpc_name_str, network_acl_name)) } } else { @@ -404,44 +406,44 @@ func dataSourceIBMIsNetworkACLRead(context context.Context, d *schema.ResourceDa networkACL = networkACLInst } d.SetId(*networkACL.ID) - if err = d.Set("created_at", dateTimeToString(networkACL.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(networkACL.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", networkACL.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("href", networkACL.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("name", networkACL.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if networkACL.ResourceGroup != nil { err = d.Set(isNetworkACLResourceGroup, dataSourceNetworkACLFlattenResourceGroup(*networkACL.ResourceGroup)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group %s", err)) } } if networkACL.Rules != nil { err = d.Set(isNetworkACLRules, dataSourceNetworkACLFlattenRules(networkACL.Rules)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting rules %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting rules %s", err)) } } if networkACL.Subnets != nil { err = d.Set("subnets", dataSourceNetworkACLFlattenSubnets(networkACL.Subnets)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting subnets %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subnets %s", err)) } } if networkACL.VPC != nil { err = d.Set("vpc", dataSourceNetworkACLFlattenVPC(*networkACL.VPC)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting vpc %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vpc %s", err)) } } @@ -496,7 +498,7 @@ func dataSourceNetworkACLRulesToMap(rule vpcv1.NetworkACLRuleItemIntf) (rulesMap beforeList = append(beforeList, beforeMap) rulesMap["before"] = beforeList } - rulesMap["created_at"] = dateTimeToString(rulex.CreatedAt) + rulesMap["created_at"] = flex.DateTimeToString(rulex.CreatedAt) rulesMap[isNetworkACLRuleName] = *rulex.Name rulesMap[isNetworkACLRuleAction] = *rulex.Action rulesMap[isNetworkACLRuleIPVersion] = *rulex.IPVersion @@ -526,7 +528,7 @@ func dataSourceNetworkACLRulesToMap(rule vpcv1.NetworkACLRuleItemIntf) (rulesMap beforeList = append(beforeList, beforeMap) rulesMap["before"] = beforeList } - rulesMap["created_at"] = dateTimeToString(rulex.CreatedAt) + rulesMap["created_at"] = flex.DateTimeToString(rulex.CreatedAt) rulesMap[isNetworkACLRuleName] = *rulex.Name rulesMap[isNetworkACLRuleAction] = *rulex.Action rulesMap[isNetworkACLRuleIPVersion] = *rulex.IPVersion @@ -569,7 +571,7 @@ func dataSourceNetworkACLRulesToMap(rule vpcv1.NetworkACLRuleItemIntf) (rulesMap beforeList = append(beforeList, beforeMap) rulesMap["before"] = beforeList } - rulesMap["created_at"] = dateTimeToString(rulex.CreatedAt) + rulesMap["created_at"] = flex.DateTimeToString(rulex.CreatedAt) rulesMap[isNetworkACLRuleName] = *rulex.Name rulesMap[isNetworkACLRuleAction] = *rulex.Action rulesMap[isNetworkACLRuleIPVersion] = *rulex.IPVersion diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl_rule.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl_rule.go index c39f1aa5a6..3e557863ee 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl_rule.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "reflect" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +17,7 @@ const ( isNetworkACLRuleHref = "href" ) -func dataSourceIBMISNetworkACLRule() *schema.Resource { +func DataSourceIBMISNetworkACLRule() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISNetworkACLRuleRead, @@ -38,7 +40,7 @@ func dataSourceIBMISNetworkACLRule() *schema.Resource { isNetworkACLRuleName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleName), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleName), Description: "The user-defined name for this rule", }, isNetworkACLRuleProtocol: { @@ -187,9 +189,9 @@ func nawaclRuleDataGet(d *schema.ResourceData, meta interface{}, name, nwACLID s ruleList, response, err := sess.ListNetworkACLRules(listNetworkACLRulesOptions) if err != nil { - return fmt.Errorf("Error Fetching network acl ruless %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching network acl ruless %s\n%s", err, response) } - start = GetNext(ruleList.Next) + start = flex.GetNext(ruleList.Next) allrecs = append(allrecs, ruleList.Rules...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl_rules.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl_rules.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl_rules.go index 249a94b8a3..279dcdc32c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acl_rules.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acl_rules.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "reflect" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +17,7 @@ const ( isNwACLRules = "rules" ) -func dataSourceIBMISNetworkACLRules() *schema.Resource { +func DataSourceIBMISNetworkACLRules() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISNetworkACLRulesRead, @@ -194,9 +195,9 @@ func networkACLRulesList(d *schema.ResourceData, meta interface{}, nwACLID strin ruleList, response, err := sess.ListNetworkACLRules(listNetworkACLRulesOptions) if err != nil { - return fmt.Errorf("Error Fetching network acl ruless %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching network acl ruless %s\n%s", err, response) } - start = GetNext(ruleList.Next) + start = flex.GetNext(ruleList.Next) allrecs = append(allrecs, ruleList.Rules...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acls.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acls.go similarity index 98% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acls.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acls.go index 2bc5fd0cd5..fdc31577b3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_network_acls.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_network_acls.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,13 +9,15 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIBMIsNetworkAcls() *schema.Resource { +func DataSourceIBMIsNetworkAcls() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMIsNetworkAclsRead, @@ -350,7 +352,7 @@ func dataSourceIBMIsNetworkAcls() *schema.Resource { } func dataSourceIBMIsNetworkAclsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -370,7 +372,7 @@ func dataSourceIBMIsNetworkAclsRead(context context.Context, d *schema.ResourceD log.Printf("[DEBUG] ListNetworkAclsWithContext failed %s\n%s", err, response) return diag.FromErr(fmt.Errorf("ListNetworkAclsWithContext failed %s\n%s", err, response)) } - start = GetNext(networkACLCollection.Next) + start = flex.GetNext(networkACLCollection.Next) allrecs = append(allrecs, networkACLCollection.NetworkAcls...) if start == "" { break @@ -381,7 +383,7 @@ func dataSourceIBMIsNetworkAclsRead(context context.Context, d *schema.ResourceD err = d.Set("network_acls", dataSourceNetworkACLCollectionFlattenNetworkAcls(allrecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting network_acls %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting network_acls %s", err)) } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_operating_system.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_operating_system.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_operating_system.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_operating_system.go index 480000bdd5..b6496cce71 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_operating_system.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_operating_system.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -21,7 +21,7 @@ const ( isOperatingSystemVersion = "version" ) -func dataSourceIBMISOperatingSystem() *schema.Resource { +func DataSourceIBMISOperatingSystem() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISOperatingSystemRead, @@ -93,7 +93,7 @@ func osGet(d *schema.ResourceData, meta interface{}, name string) error { } os, response, err := sess.GetOperatingSystem(getOperatingSystemOptions) if err != nil || os == nil { - return fmt.Errorf("Error Getting Operating System Details %s , %s", err, response) + return fmt.Errorf("[ERROR] Error Getting Operating System Details %s , %s", err, response) } d.Set(isOperatingSystemName, *os.Name) d.SetId(*os.Name) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_operating_systems.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_operating_systems.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_operating_systems.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_operating_systems.go index 5568231dc6..1c68d44b83 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_operating_systems.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_operating_systems.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +16,7 @@ const ( isOperatingSystems = "operating_systems" ) -func dataSourceIBMISOperatingSystems() *schema.Resource { +func DataSourceIBMISOperatingSystems() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISOperatingSystemsRead, @@ -99,9 +100,9 @@ func osList(d *schema.ResourceData, meta interface{}) error { osList, response, err := sess.ListOperatingSystems(listOperatingSystemsOptions) if err != nil { - return fmt.Errorf("Error Fetching operating systems %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching operating systems %s\n%s", err, response) } - start = GetNext(osList.Next) + start = flex.GetNext(osList.Next) allrecs = append(allrecs, osList.OperatingSystems...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_placement_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_placement_group.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_placement_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_placement_group.go index fa7cff6877..eccd1e1754 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_placement_group.go @@ -1,20 +1,22 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsPlacementGroup() *schema.Resource { +func DataSourceIbmIsPlacementGroup() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsPlacementGroupRead, @@ -82,14 +84,14 @@ func dataSourceIbmIsPlacementGroup() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, isPlacementGroupAccessTags: { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "List of access management tags", }, }, @@ -97,7 +99,7 @@ func dataSourceIbmIsPlacementGroup() *schema.Resource { } func dataSourceIbmIsPlacementGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -114,7 +116,7 @@ func dataSourceIbmIsPlacementGroupRead(context context.Context, d *schema.Resour log.Printf("[DEBUG] ListPlacementGroupsWithContext failed %s\n%s", err, response) return diag.FromErr(err) } - start = GetNext(placementGroupCollection.Next) + start = flex.GetNext(placementGroupCollection.Next) allrecs = append(allrecs, placementGroupCollection.PlacementGroups...) if start == "" { break @@ -125,40 +127,40 @@ func dataSourceIbmIsPlacementGroupRead(context context.Context, d *schema.Resour d.SetId(*placementGroup.ID) if err = d.Set("created_at", placementGroup.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", placementGroup.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("href", placementGroup.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("lifecycle_state", placementGroup.LifecycleState); err != nil { - return diag.FromErr(fmt.Errorf("Error setting lifecycle_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } if err = d.Set("name", placementGroup.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if placementGroup.ResourceGroup != nil { err = d.Set("resource_group", dataSourcePlacementGroupFlattenResourceGroup(*placementGroup.ResourceGroup)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group %s", err)) } } if err = d.Set("resource_type", placementGroup.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if err = d.Set("strategy", placementGroup.Strategy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting strategy: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting strategy: %s", err)) } - tags, err := GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isUserTagType) + tags, err := flex.GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isUserTagType) if err != nil { log.Printf( "An error getting placement group (%s) tags : %s", d.Id(), err) } - accesstags, err := GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isAccessTagType) + accesstags, err := flex.GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isAccessTagType) if err != nil { log.Printf( "Error getting placement group (%s) access tags: %s", d.Id(), err) @@ -169,7 +171,7 @@ func dataSourceIbmIsPlacementGroupRead(context context.Context, d *schema.Resour return nil } } - return diag.FromErr(fmt.Errorf("No placement group found with name %s", pgname)) + return diag.FromErr(fmt.Errorf("[ERROR] No placement group found with name %s", pgname)) } func dataSourcePlacementGroupFlattenResourceGroup(result vpcv1.ResourceGroupReference) (finalList []map[string]interface{}) { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_placement_groups.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_placement_groups.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_placement_groups.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_placement_groups.go index 74a10da4c3..d6c470c959 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_placement_groups.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_placement_groups.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,13 +9,15 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsPlacementGroups() *schema.Resource { +func DataSourceIbmIsPlacementGroups() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsPlacementGroupsRead, @@ -94,14 +96,14 @@ func dataSourceIbmIsPlacementGroups() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, isPlacementGroupAccessTags: { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "List of access management tags", }, }, @@ -117,7 +119,7 @@ func dataSourceIbmIsPlacementGroups() *schema.Resource { } func dataSourceIbmIsPlacementGroupsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -134,7 +136,7 @@ func dataSourceIbmIsPlacementGroupsRead(context context.Context, d *schema.Resou log.Printf("[DEBUG] ListPlacementGroupsWithContext failed %s\n%s", err, response) return diag.FromErr(err) } - start = GetNext(placementGroupCollection.Next) + start = flex.GetNext(placementGroupCollection.Next) allrecs = append(allrecs, placementGroupCollection.PlacementGroups...) if start == "" { break @@ -145,10 +147,10 @@ func dataSourceIbmIsPlacementGroupsRead(context context.Context, d *schema.Resou if len(allrecs) > 0 { err = d.Set("placement_groups", dataSourcePlacementGroupCollectionFlattenPlacementGroups(meta, allrecs)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting placement_groups %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting placement_groups %s", err)) } if err = d.Set("total_count", len(allrecs)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting total_count: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting total_count: %s", err)) } } return nil @@ -200,13 +202,13 @@ func dataSourcePlacementGroupCollectionPlacementGroupsToMap(meta interface{}, pl if placementGroupsItem.Strategy != nil { placementGroupsMap["strategy"] = placementGroupsItem.Strategy } - tags, err := GetGlobalTagsUsingCRN(meta, *placementGroupsItem.CRN, "", isUserTagType) + tags, err := flex.GetGlobalTagsUsingCRN(meta, *placementGroupsItem.CRN, "", isUserTagType) if err != nil { log.Printf( "An error getting placement group (%s) tags : %s", *placementGroupsItem.ID, err) } - accesstags, err := GetGlobalTagsUsingCRN(meta, *placementGroupsItem.CRN, "", isAccessTagType) + accesstags, err := flex.GetGlobalTagsUsingCRN(meta, *placementGroupsItem.CRN, "", isAccessTagType) if err != nil { log.Printf( "Error getting placement group (%s) access tags: %s", *placementGroupsItem.ID, err) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_public_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_public_gateway.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_public_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_public_gateway.go index 5f511bd70c..169a2c55cc 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_public_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_public_gateway.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISPublicGateway() *schema.Resource { +func DataSourceIBMISPublicGateway() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISPublicGatewayRead, @@ -57,17 +58,17 @@ func dataSourceIBMISPublicGateway() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Service tags for the public gateway instance", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", @@ -79,19 +80,19 @@ func dataSourceIBMISPublicGateway() *schema.Resource { Description: "The crn of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -122,9 +123,9 @@ func dataSourceIBMISPublicGatewayRead(d *schema.ResourceData, meta interface{}) } publicgws, response, err := sess.ListPublicGateways(listPublicGatewaysOptions) if err != nil { - return fmt.Errorf("Error Fetching public gateways %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching public gateways %s\n%s", err, response) } - start = GetNext(publicgws.Next) + start = flex.GetNext(publicgws.Next) allrecs = append(allrecs, publicgws.PublicGateways...) if start == "" { break @@ -145,27 +146,27 @@ func dataSourceIBMISPublicGatewayRead(d *schema.ResourceData, meta interface{}) d.Set(isPublicGatewayStatus, *publicgw.Status) d.Set(isPublicGatewayZone, *publicgw.Zone.Name) d.Set(isPublicGatewayVPC, *publicgw.VPC.ID) - tags, err := GetTagsUsingCRN(meta, *publicgw.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *publicgw.CRN) if err != nil { log.Printf( "Error on get of vpc public gateway (%s) tags: %s", *publicgw.ID, err) } d.Set(isPublicGatewayTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/publicGateways") - d.Set(ResourceName, *publicgw.Name) - d.Set(ResourceCRN, *publicgw.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/publicGateways") + d.Set(flex.ResourceName, *publicgw.Name) + d.Set(flex.ResourceCRN, *publicgw.CRN) d.Set(isPublicGatewayCRN, *publicgw.CRN) - d.Set(ResourceStatus, *publicgw.Status) + d.Set(flex.ResourceStatus, *publicgw.Status) if publicgw.ResourceGroup != nil { d.Set(isPublicGatewayResourceGroup, *publicgw.ResourceGroup.ID) - d.Set(ResourceGroupName, *publicgw.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *publicgw.ResourceGroup.Name) } return nil } } - return fmt.Errorf("No Public gateway found with name %s", name) + return fmt.Errorf("[ERROR] No Public gateway found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_public_gateways.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_public_gateways.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_public_gateways.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_public_gateways.go index 387e7d476e..c8bb274fe9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_public_gateways.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_public_gateways.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +17,7 @@ const ( isPublicGateways = "public_gateways" ) -func dataSourceIBMISPublicGateways() *schema.Resource { +func DataSourceIBMISPublicGateways() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISPublicGatewaysRead, @@ -73,17 +74,17 @@ func dataSourceIBMISPublicGateways() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Service tags for the public gateway instance", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", @@ -95,19 +96,19 @@ func dataSourceIBMISPublicGateways() *schema.Resource { Description: "The crn of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -148,9 +149,9 @@ func publicGatewaysGet(d *schema.ResourceData, meta interface{}, name string) er } publicgws, response, err := sess.ListPublicGateways(listPublicGatewaysOptions) if err != nil { - return fmt.Errorf("Error Fetching public gateways %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching public gateways %s\n%s", err, response) } - start = GetNext(publicgws.Next) + start = flex.GetNext(publicgws.Next) allrecs = append(allrecs, publicgws.PublicGateways...) if start == "" { break @@ -166,10 +167,10 @@ func publicGatewaysGet(d *schema.ResourceData, meta interface{}, name string) er isPublicGatewayZone: *publicgw.Zone.Name, isPublicGatewayVPC: *publicgw.VPC.ID, - ResourceName: *publicgw.Name, - isPublicGatewayCRN: *publicgw.CRN, - ResourceCRN: *publicgw.CRN, - ResourceStatus: *publicgw.Status, + flex.ResourceName: *publicgw.Name, + isPublicGatewayCRN: *publicgw.CRN, + flex.ResourceCRN: *publicgw.CRN, + flex.ResourceStatus: *publicgw.Status, } if publicgw.FloatingIP != nil { floatIP := map[string]interface{}{ @@ -178,20 +179,20 @@ func publicGatewaysGet(d *schema.ResourceData, meta interface{}, name string) er } l[isPublicGatewayFloatingIP] = floatIP } - tags, err := GetTagsUsingCRN(meta, *publicgw.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *publicgw.CRN) if err != nil { log.Printf( "Error on get of vpc public gateway (%s) tags: %s", *publicgw.ID, err) } l[isPublicGatewayTags] = tags - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - l[ResourceControllerURL] = controller + "/vpc-ext/network/publicGateways" + l[flex.ResourceControllerURL] = controller + "/vpc-ext/network/publicGateways" if publicgw.ResourceGroup != nil { l[isPublicGatewayResourceGroup] = *publicgw.ResourceGroup.ID - l[ResourceGroupName] = *publicgw.ResourceGroup.Name + l[flex.ResourceGroupName] = *publicgw.ResourceGroup.Name } publicgwInfo = append(publicgwInfo, l) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_region.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_region.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_region.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_region.go index f8d6117730..9a7e9fc637 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_region.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_region.go @@ -1,9 +1,10 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -14,7 +15,7 @@ const ( isRegionStatus = "status" ) -func dataSourceIBMISRegion() *schema.Resource { +func DataSourceIBMISRegion() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISRegionRead, @@ -27,7 +28,7 @@ func dataSourceIBMISRegion() *schema.Resource { isRegionName: { Type: schema.TypeString, - Required: true, + Optional: true, }, isRegionStatus: { @@ -41,6 +42,13 @@ func dataSourceIBMISRegion() *schema.Resource { func dataSourceIBMISRegionRead(d *schema.ResourceData, meta interface{}) error { name := d.Get("name").(string) + if name == "" { + bmxSess, err := meta.(conns.ClientSession).BluemixSession() + if err != nil { + return err + } + name = bmxSess.Config.Region + } return regionGet(d, meta, name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_regions.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_regions.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_regions.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_regions.go index a600abf033..f2cf36e87c 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_regions.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_regions.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "time" @@ -15,7 +15,7 @@ const ( isRegionHref = "href" ) -func dataSourceIBMISRegions() *schema.Resource { +func DataSourceIBMISRegions() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISRegionsRead, Schema: map[string]*schema.Schema{ diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group.go index a593dea258..5bc62ebefe 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "reflect" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -29,7 +30,7 @@ const ( isSgCRN = "crn" ) -func dataSourceIBMISSecurityGroup() *schema.Resource { +func DataSourceIBMISSecurityGroup() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSecurityGroupRuleRead, @@ -108,25 +109,25 @@ func dataSourceIBMISSecurityGroup() *schema.Resource { }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -136,7 +137,7 @@ func dataSourceIBMISSecurityGroup() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, @@ -176,12 +177,12 @@ func securityGroupGet(d *schema.ResourceData, meta interface{}, name string) err } sgs, response, err := sess.ListSecurityGroups(listSgOptions) if err != nil || sgs == nil { - return fmt.Errorf("Error Getting Security Groups %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Security Groups %s\n%s", err, response) } if *sgs.TotalCount == int64(0) { break } - start = GetNext(sgs.Next) + start = flex.GetNext(sgs.Next) allrecs = append(allrecs, sgs.SecurityGroups...) if start == "" { @@ -196,7 +197,7 @@ func securityGroupGet(d *schema.ResourceData, meta interface{}, name string) err d.Set(isSgName, *group.Name) d.Set(isSgVPC, *group.VPC.ID) d.Set(isSgCRN, *group.CRN) - tags, err := GetTagsUsingCRN(meta, *group.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *group.CRN) if err != nil { log.Printf( "An error occured during reading of security group (%s) tags : %s", *group.ID, err) @@ -298,25 +299,25 @@ func securityGroupGet(d *schema.ResourceData, meta interface{}, name string) err if group.ResourceGroup != nil { if group.ResourceGroup.Name != nil { - d.Set(ResourceGroupName, *group.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *group.ResourceGroup.Name) } } - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc/network/securityGroups") + d.Set(flex.ResourceControllerURL, controller+"/vpc/network/securityGroups") if group.Name != nil { - d.Set(ResourceName, *group.Name) + d.Set(flex.ResourceName, *group.Name) } if group.CRN != nil { - d.Set(ResourceCRN, *group.CRN) + d.Set(flex.ResourceCRN, *group.CRN) } return nil } } - return fmt.Errorf("No Security Group found with name %s", name) + return fmt.Errorf("[ERROR] No Security Group found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_rule.go new file mode 100644 index 0000000000..39134bc688 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_rule.go @@ -0,0 +1,300 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "reflect" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMIsSecurityGroupRule() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsSecurityGroupRuleRead, + + Schema: map[string]*schema.Schema{ + "security_group": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The security group identifier.", + }, + "security_group_rule": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The rule identifier.", + }, + "direction": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The direction of traffic to enforce, either `inbound` or `outbound`.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this security group rule.", + }, + "ip_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.", + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol to enforce.", + }, + "remote": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source,for outbound rules).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + }, + "cidr_block": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's CRN.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this security group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", + }, + }, + }, + }, + "code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The ICMP traffic code to allow.", + }, + "type": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The ICMP traffic type to allow.", + }, + "port_max": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive upper bound of TCP/UDP port range.", + }, + "port_min": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive lower bound of TCP/UDP port range.", + }, + }, + } +} + +func dataSourceIBMIsSecurityGroupRuleRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + getSecurityGroupRuleOptions := &vpcv1.GetSecurityGroupRuleOptions{} + + getSecurityGroupRuleOptions.SetSecurityGroupID(d.Get("security_group").(string)) + getSecurityGroupRuleOptions.SetID(d.Get("security_group_rule").(string)) + + securityGroupRuleIntf, response, err := vpcClient.GetSecurityGroupRuleWithContext(context, getSecurityGroupRuleOptions) + if err != nil || securityGroupRuleIntf == nil { + log.Printf("[DEBUG] GetSecurityGroupRuleWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetSecurityGroupRuleWithContext failed %s\n%s", err, response)) + } + + switch reflect.TypeOf(securityGroupRuleIntf).String() { + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll": + { + securityGroupRule := securityGroupRuleIntf.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll) + + d.SetId(*securityGroupRule.ID) + if err = d.Set("direction", securityGroupRule.Direction); err != nil { + return diag.FromErr(fmt.Errorf("Error setting direction: %s", err)) + } + if err = d.Set("href", securityGroupRule.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("ip_version", securityGroupRule.IPVersion); err != nil { + return diag.FromErr(fmt.Errorf("Error setting ip_version: %s", err)) + } + if err = d.Set("protocol", securityGroupRule.Protocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting protocol: %s", err)) + } + if securityGroupRule.Remote != nil { + securityGroupRuleRemote, err := dataSourceSecurityGroupRuleFlattenRemote(securityGroupRule.Remote) + if err != nil { + return diag.FromErr(fmt.Errorf("Error flattening securityGroupRule.Remote %s", err)) + } + err = d.Set("remote", securityGroupRuleRemote) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting remote %s", err)) + } + } + + } + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": + { + securityGroupRule := securityGroupRuleIntf.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp) + + d.SetId(*securityGroupRule.ID) + if err = d.Set("direction", securityGroupRule.Direction); err != nil { + return diag.FromErr(fmt.Errorf("Error setting direction: %s", err)) + } + if err = d.Set("href", securityGroupRule.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("ip_version", securityGroupRule.IPVersion); err != nil { + return diag.FromErr(fmt.Errorf("Error setting ip_version: %s", err)) + } + if err = d.Set("protocol", securityGroupRule.Protocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting protocol: %s", err)) + } + if securityGroupRule.Remote != nil { + securityGroupRuleRemote, err := dataSourceSecurityGroupRuleFlattenRemote(securityGroupRule.Remote) + if err != nil { + return diag.FromErr(fmt.Errorf("Error flattening securityGroupRule.Remote %s", err)) + } + err = d.Set("remote", securityGroupRuleRemote) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting remote %s", err)) + } + } + + if err = d.Set("code", flex.IntValue(securityGroupRule.Code)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting code: %s", err)) + } + if err = d.Set("type", flex.IntValue(securityGroupRule.Type)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + } + } + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp": + { + securityGroupRule := securityGroupRuleIntf.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + + d.SetId(*securityGroupRule.ID) + if err = d.Set("direction", securityGroupRule.Direction); err != nil { + return diag.FromErr(fmt.Errorf("Error setting direction: %s", err)) + } + if err = d.Set("href", securityGroupRule.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + if err = d.Set("ip_version", securityGroupRule.IPVersion); err != nil { + return diag.FromErr(fmt.Errorf("Error setting ip_version: %s", err)) + } + if err = d.Set("protocol", securityGroupRule.Protocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting protocol: %s", err)) + } + if securityGroupRule.Remote != nil { + securityGroupRuleRemote, err := dataSourceSecurityGroupRuleFlattenRemote(securityGroupRule.Remote) + if err != nil { + return diag.FromErr(fmt.Errorf("Error flattening securityGroupRule.Remote %s", err)) + } + err = d.Set("remote", securityGroupRuleRemote) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting remote %s", err)) + } + } + if err = d.Set("port_max", flex.IntValue(securityGroupRule.PortMax)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting port_max: %s", err)) + } + if err = d.Set("port_min", flex.IntValue(securityGroupRule.PortMin)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting port_min: %s", err)) + } + } + } + + return nil +} + +func dataSourceSecurityGroupRuleFlattenRemote(m vpcv1.SecurityGroupRuleRemoteIntf) ([]map[string]interface{}, error) { + var ruleList []map[string]interface{} + ruleMap := dataSourceSecurityGroupRuleRemoteToMap(m.(*vpcv1.SecurityGroupRuleRemote)) + ruleList = append(ruleList, ruleMap) + return ruleList, nil +} + +func dataSourceSecurityGroupRuleRemoteToMap(remoteItem *vpcv1.SecurityGroupRuleRemote) (remoteMap map[string]interface{}) { + remoteMap = map[string]interface{}{} + + if remoteItem.Address != nil { + remoteMap["address"] = *remoteItem.Address + } + + if remoteItem.CIDRBlock != nil { + remoteMap["cidr_block"] = *remoteItem.CIDRBlock + } + if remoteItem.CRN != nil { + remoteMap["crn"] = *remoteItem.CRN + } + if remoteItem.Deleted != nil { + remoteDeletedList := []map[string]interface{}{} + remoteDeletedMap := dataSourceSecurityGroupRuleRemoteDeletedToMap(remoteItem.Deleted) + remoteDeletedList = append(remoteDeletedList, remoteDeletedMap) + remoteMap["deleted"] = remoteDeletedList + } + + if remoteItem.Href != nil { + remoteMap["href"] = *remoteItem.Href + } + if remoteItem.ID != nil { + remoteMap["id"] = *remoteItem.ID + } + if remoteItem.Name != nil { + remoteMap["name"] = *remoteItem.Name + } + + return remoteMap +} + +func dataSourceSecurityGroupRuleRemoteDeletedToMap(deletedItem *vpcv1.SecurityGroupReferenceDeleted) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + resultMap["more_info"] = deletedItem.MoreInfo + } + + return resultMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_rules.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_rules.go new file mode 100644 index 0000000000..fb1eb1f900 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_rules.go @@ -0,0 +1,230 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "fmt" + "reflect" + "time" + + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMIsSecurityGroupRules() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMIsSecurityGroupRulesRead, + + Schema: map[string]*schema.Schema{ + "security_group": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The security group identifier.", + }, + "rules": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Array of rules.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "direction": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The direction of traffic to enforce, either `inbound` or `outbound`.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this security group rule.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this security group rule.", + }, + "ip_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.", + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol to enforce.", + }, + "remote": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source,for outbound rules).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + }, + "cidr_block": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's CRN.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this security group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", + }, + }, + }, + }, + "code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The ICMP traffic code to allow.", + }, + "type": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The ICMP traffic type to allow.", + }, + "port_max": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive upper bound of TCP/UDP port range.", + }, + "port_min": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive lower bound of TCP/UDP port range.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsSecurityGroupRulesRead(d *schema.ResourceData, meta interface{}) error { + secGrpId := d.Get("security_group").(string) + sess, err := vpcClient(meta) + if err != nil { + return err + } + + listSecurityGroupRuleOptions := vpcv1.ListSecurityGroupRulesOptions{ + SecurityGroupID: &secGrpId, + } + + ruleList, response, err := sess.ListSecurityGroupRules(&listSecurityGroupRuleOptions) + if err != nil { + return fmt.Errorf("Error fetching security group rules %s\n%s", err, response) + } + + rulesInfo := make([]map[string]interface{}, 0) + for _, rule := range ruleList.Rules { + l := map[string]interface{}{} + switch reflect.TypeOf(rule).String() { + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll": + { + rulex := rule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll) + l["direction"] = *rulex.Direction + l["href"] = *rulex.Href + l["id"] = *rulex.ID + l["ip_version"] = *rulex.IPVersion + l["protocol"] = *rulex.Protocol + // nested map for remote. + if rulex.Remote != nil { + remoteList := []map[string]interface{}{} + remoteMap := dataSourceSecurityGroupRuleRemoteToMap(rulex.Remote.(*vpcv1.SecurityGroupRuleRemote)) + remoteList = append(remoteList, remoteMap) + l["remote"] = remoteList + } + + } + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": + { + rulex := rule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp) + l["direction"] = *rulex.Direction + l["href"] = *rulex.Href + l["id"] = *rulex.ID + l["ip_version"] = *rulex.IPVersion + l["code"] = *rulex.Code + l["protocol"] = *rulex.Protocol + l["type"] = *rulex.Type + // remote + if rulex.Remote != nil { + remoteList := []map[string]interface{}{} + remoteMap := dataSourceSecurityGroupRuleRemoteToMap(rulex.Remote.(*vpcv1.SecurityGroupRuleRemote)) + remoteList = append(remoteList, remoteMap) + l["remote"] = remoteList + } + } + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp": + { + rulex := rule.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + l["direction"] = *rulex.Direction + l["href"] = *rulex.Href + l["id"] = *rulex.ID + l["ip_version"] = *rulex.IPVersion + l["protocol"] = *rulex.Protocol + l["port_max"] = *rulex.PortMax + l["port_min"] = *rulex.PortMin + // remote + if rulex.Remote != nil { + remoteList := []map[string]interface{}{} + remoteMap := dataSourceSecurityGroupRuleRemoteToMap(rulex.Remote.(*vpcv1.SecurityGroupRuleRemote)) + remoteList = append(remoteList, remoteMap) + l["remote"] = remoteList + } + } + } + rulesInfo = append(rulesInfo, l) + } + d.SetId(dataSourceIBMIsSecurityGroupRulesID(d)) + d.Set("rules", rulesInfo) + return nil +} + +// dataSourceIBMIsSecurityGroupRulesID returns a reasonable ID for the list. +func dataSourceIBMIsSecurityGroupRulesID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceSecurityGroupRuleCollectionRemoteDeletedToMap(deletedItem *vpcv1.SecurityGroupReferenceDeleted) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + resultMap["more_info"] = *deletedItem.MoreInfo + } + + return resultMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group_target.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_target.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group_target.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_target.go index 2d29ec9938..9c312e3c33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group_target.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_target.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISSecurityGroupTarget() *schema.Resource { +func DataSourceIBMISSecurityGroupTarget() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSecurityGroupTargetRead, @@ -77,13 +78,13 @@ func dataSourceIBMISSecurityGroupTargetRead(d *schema.ResourceData, meta interfa } groups, response, err := sess.ListSecurityGroupTargets(listSecurityGroupTargetsOptions) if err != nil { - return fmt.Errorf("Error Getting InstanceGroup Managers %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Managers %s\n%s", err, response) } if *groups.TotalCount == int64(0) { break } - start = GetNext(groups.Next) + start = flex.GetNext(groups.Next) allrecs = append(allrecs, groups.Targets...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group_targets.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_targets.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group_targets.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_targets.go index 20e56775a1..df852cdfd8 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_security_group_targets.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_group_targets.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISSecurityGroupTargets() *schema.Resource { +func DataSourceIBMISSecurityGroupTargets() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSecurityGroupTargetsRead, @@ -86,13 +87,13 @@ func dataSourceIBMISSecurityGroupTargetsRead(d *schema.ResourceData, meta interf } groups, response, err := sess.ListSecurityGroupTargets(listSecurityGroupTargetsOptions) if err != nil || groups == nil { - return fmt.Errorf("Error Getting InstanceGroup Managers %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Managers %s\n%s", err, response) } if *groups.TotalCount == int64(0) { break } - start = GetNext(groups.Next) + start = flex.GetNext(groups.Next) allrecs = append(allrecs, groups.Targets...) if start == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_groups.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_groups.go new file mode 100644 index 0000000000..cb9bcb6bb5 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_security_groups.go @@ -0,0 +1,691 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "reflect" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMIsSecurityGroups() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsSecurityGroupsRead, + + Schema: map[string]*schema.Schema{ + "resource_group": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "resource group identifier.", + }, + "vpc_id": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "vpc identifier.", + }, + "vpc_crn": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "vpc crn", + }, + "vpc_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "vpc name.", + }, + "security_groups": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "Collection of security groups.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "created_at": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this security group was created.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's CRN.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this security group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", + }, + "resource_group": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this security group.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "rules": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The rules for this security group. If no rules exist, all traffic will be denied.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "direction": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The direction of traffic to enforce, either `inbound` or `outbound`.", + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this security group rule.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this security group rule.", + }, + "ip_version": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.", + }, + "protocol": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The protocol to enforce.", + }, + "remote": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source,for outbound rules).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + }, + "cidr_block": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's CRN.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The security group's canonical URL.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this security group.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this security group. Names must be unique within the VPC the security group resides in.", + }, + }, + }, + }, + "code": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The ICMP traffic code to allow.", + }, + "type": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The ICMP traffic type to allow.", + }, + "port_max": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive upper bound of TCP/UDP port range.", + }, + "port_min": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "The inclusive lower bound of TCP/UDP port range.", + }, + }, + }, + }, + "targets": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The targets for this security group.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this network interface.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this network interface.", + }, + "resource_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The load balancer's CRN.", + }, + }, + }, + }, + "vpc": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The VPC this security group is a part of.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this VPC.", + }, + "deleted": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this VPC.", + }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPC.", + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique user-defined name for this VPC.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsSecurityGroupsRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + resourceGrp := d.Get("resource_group").(string) + vpcId := d.Get("vpc_id").(string) + vpcCrn := d.Get("vpc_crn").(string) + vpcName := d.Get("vpc_name").(string) + + start := "" + allrecs := []vpcv1.SecurityGroup{} + listSecurityGroupsOptions := &vpcv1.ListSecurityGroupsOptions{} + if resourceGrp != "" { + listSecurityGroupsOptions.ResourceGroupID = &resourceGrp + } + if vpcId != "" { + listSecurityGroupsOptions.VPCID = &vpcId + } + if vpcCrn != "" { + listSecurityGroupsOptions.VPCCRN = &vpcCrn + } + if vpcName != "" { + listSecurityGroupsOptions.VPCName = &vpcName + } + for { + + if start != "" { + listSecurityGroupsOptions.Start = &start + } + securityGroupCollection, response, err := vpcClient.ListSecurityGroupsWithContext(context, listSecurityGroupsOptions) + if err != nil { + log.Printf("[DEBUG] ListSecurityGroupsWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListSecurityGroupsWithContext failed %s\n%s", err, response)) + } + + start = flex.GetNext(securityGroupCollection.Next) + allrecs = append(allrecs, securityGroupCollection.SecurityGroups...) + + if start == "" { + break + } + } + + d.SetId(dataSourceIBMIsSecurityGroupsID(d)) + err = d.Set("security_groups", dataSourceSecurityGroupCollectionFlattenSecurityGroups(allrecs)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting security_groups %s", err)) + } + return nil +} + +// dataSourceIBMIsSecurityGroupsID returns a reasonable ID for the list. +func dataSourceIBMIsSecurityGroupsID(d *schema.ResourceData) string { + return time.Now().UTC().String() +} + +func dataSourceSecurityGroupCollectionFlattenSecurityGroups(modelSlice []vpcv1.SecurityGroup) (result []map[string]interface{}) { + result = []map[string]interface{}{} + for _, securityGroupsItem := range modelSlice { + mapItem := dataSourceSecurityGroupCollectionSecurityGroupsToMap(&securityGroupsItem) + result = append(result, mapItem) + } + return result +} + +func dataSourceSecurityGroupCollectionSecurityGroupsToMap(securityGroupsItem *vpcv1.SecurityGroup) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if securityGroupsItem.CreatedAt != nil { + resultMap["created_at"] = securityGroupsItem.CreatedAt.String() + } + if securityGroupsItem.CRN != nil { + resultMap["crn"] = securityGroupsItem.CRN + } + if securityGroupsItem.Href != nil { + resultMap["href"] = securityGroupsItem.Href + } + if securityGroupsItem.ID != nil { + resultMap["id"] = securityGroupsItem.ID + } + if securityGroupsItem.Name != nil { + resultMap["name"] = securityGroupsItem.Name + } + if securityGroupsItem.ResourceGroup != nil { + var mapSlice []map[string]interface{} + modelMap := dataSourceSecurityGroupCollectionSecurityGroupsResourceGroupToMap(securityGroupsItem.ResourceGroup) + mapSlice = append(mapSlice, modelMap) + resultMap["resource_group"] = mapSlice + } + if securityGroupsItem.Rules != nil { + var mapSlice []map[string]interface{} + for _, listElem := range securityGroupsItem.Rules { + mapElem := dataSourceSecurityGroupCollectionSecurityGroupsRulesToMap(listElem) + mapSlice = append(mapSlice, mapElem) + } + resultMap["rules"] = mapSlice + } + if securityGroupsItem.Targets != nil { + var mapSlice []map[string]interface{} + for _, listElem := range securityGroupsItem.Targets { + mapElem := dataSourceSecurityGroupCollectionSecurityGroupsTargetsToMap(listElem) + mapSlice = append(mapSlice, mapElem) + } + resultMap["targets"] = mapSlice + } + if securityGroupsItem.VPC != nil { + var mapSlice []map[string]interface{} + modelMap := dataSourceSecurityGroupCollectionSecurityGroupsVPCToMap(securityGroupsItem.VPC) + mapSlice = append(mapSlice, modelMap) + resultMap["vpc"] = mapSlice + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionSecurityGroupsResourceGroupToMap(resourceGroupItem *vpcv1.ResourceGroupReference) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resultMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resultMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resultMap["name"] = resourceGroupItem.Name + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionSecurityGroupsRulesToMap(rulesItem vpcv1.SecurityGroupRuleIntf) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + switch reflect.TypeOf(rulesItem).String() { + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll": + { + securityGroupRule := rulesItem.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll) + if securityGroupRule.ID != nil { + resultMap["id"] = securityGroupRule.ID + } + if securityGroupRule.Direction != nil { + resultMap["direction"] = securityGroupRule.Direction + } + if securityGroupRule.Href != nil { + resultMap["href"] = securityGroupRule.Href + } + if securityGroupRule.IPVersion != nil { + resultMap["ip_version"] = securityGroupRule.IPVersion + } + if securityGroupRule.Protocol != nil { + resultMap["protocol"] = securityGroupRule.Protocol + } + if securityGroupRule.Remote != nil { + remoteList := []map[string]interface{}{} + remoteMap := dataSourceSecurityGroupsRemoteToMap(*securityGroupRule.Remote.(*vpcv1.SecurityGroupRuleRemote)) + remoteList = append(remoteList, remoteMap) + resultMap["remote"] = remoteList + } + } + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": + { + securityGroupRule := rulesItem.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp) + if securityGroupRule.ID != nil { + resultMap["id"] = securityGroupRule.ID + } + if securityGroupRule.Direction != nil { + resultMap["direction"] = securityGroupRule.Direction + } + if securityGroupRule.Href != nil { + resultMap["href"] = securityGroupRule.Href + } + if securityGroupRule.IPVersion != nil { + resultMap["ip_version"] = securityGroupRule.IPVersion + } + if securityGroupRule.Protocol != nil { + resultMap["protocol"] = securityGroupRule.Protocol + } + if securityGroupRule.Href != nil { + resultMap["href"] = securityGroupRule.Href + } + if securityGroupRule.Code != nil { + resultMap["code"] = securityGroupRule.Code + } + if securityGroupRule.Type != nil { + resultMap["type"] = securityGroupRule.Type + } + + if securityGroupRule.Remote != nil { + remoteList := []map[string]interface{}{} + remoteMap := dataSourceSecurityGroupsRemoteToMap(*securityGroupRule.Remote.(*vpcv1.SecurityGroupRuleRemote)) + remoteList = append(remoteList, remoteMap) + resultMap["remote"] = remoteList + } + } + case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp": + { + securityGroupRule := rulesItem.(*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + if securityGroupRule.ID != nil { + resultMap["id"] = securityGroupRule.ID + } + if securityGroupRule.Direction != nil { + resultMap["direction"] = securityGroupRule.Direction + } + if securityGroupRule.Href != nil { + resultMap["href"] = securityGroupRule.Href + } + if securityGroupRule.IPVersion != nil { + resultMap["ip_version"] = securityGroupRule.IPVersion + } + if securityGroupRule.Protocol != nil { + resultMap["protocol"] = securityGroupRule.Protocol + } + if securityGroupRule.Href != nil { + resultMap["href"] = securityGroupRule.Href + } + if securityGroupRule.PortMax != nil { + resultMap["port_max"] = securityGroupRule.PortMax + } + if securityGroupRule.PortMin != nil { + resultMap["port_min"] = securityGroupRule.PortMin + } + + if securityGroupRule.Remote != nil { + remoteList := []map[string]interface{}{} + remoteMap := dataSourceSecurityGroupsRemoteToMap(*securityGroupRule.Remote.(*vpcv1.SecurityGroupRuleRemote)) + remoteList = append(remoteList, remoteMap) + resultMap["remote"] = remoteList + } + } + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionRemoteDeletedToMap(deletedItem *vpcv1.SecurityGroupReferenceDeleted) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + resultMap["more_info"] = deletedItem.MoreInfo + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionSecurityGroupsTargetsToMap(targetsItem vpcv1.SecurityGroupTargetReferenceIntf) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + // SecurityGroupTargetReference + switch reflect.TypeOf(targetsItem).String() { + case "*vpcv1.SecurityGroupTargetReference": + { + targetx := targetsItem.(*vpcv1.SecurityGroupTargetReference) + if targetx.Deleted != nil { + targetxDeletedList := []map[string]interface{}{} + targetxDeletedMap := dataSourceSecurityGroupCollectionTargetsDeletedToMap(targetx.Deleted) + targetxDeletedList = append(targetxDeletedList, targetxDeletedMap) + resultMap["deleted"] = targetxDeletedList + } + if targetx.Href != nil { + resultMap["href"] = *targetx.Href + } + if targetx.ID != nil { + resultMap["id"] = *targetx.ID + } + if targetx.Name != nil { + resultMap["name"] = *targetx.Name + } + if targetx.ResourceType != nil { + resultMap["resource_type"] = *targetx.ResourceType + } + + } + case "*vpcv1.SecurityGroupTargetReferenceLoadBalancerReference": + { + targety := targetsItem.(*vpcv1.SecurityGroupTargetReferenceLoadBalancerReference) + if targety.CRN != nil { + resultMap["crn"] = *targety.CRN + } + if targety.Deleted != nil { + targetyDeletedList := []map[string]interface{}{} + targetyDeletedMap := dataSourceSecurityGroupCollectionTargetsDeleted2ToMap(targety.Deleted) + targetyDeletedList = append(targetyDeletedList, targetyDeletedMap) + resultMap["deleted"] = targetyDeletedList + } + if targety.Href != nil { + resultMap["href"] = *targety.Href + } + if targety.ID != nil { + resultMap["id"] = *targety.ID + } + if targety.Name != nil { + resultMap["name"] = *targety.Name + } + } + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionTargetsDeletedToMap(deletedItem *vpcv1.NetworkInterfaceReferenceTargetContextDeleted) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + resultMap["more_info"] = deletedItem.MoreInfo + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionTargetsDeleted2ToMap(deletedItem *vpcv1.LoadBalancerReferenceDeleted) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + resultMap["more_info"] = deletedItem.MoreInfo + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionSecurityGroupsVPCToMap(vpcItem *vpcv1.VPCReference) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if vpcItem.CRN != nil { + resultMap["crn"] = vpcItem.CRN + } + if vpcItem.Deleted != nil { + var mapSlice []map[string]interface{} + modelMap := dataSourceSecurityGroupCollectionVPCDeletedToMap(vpcItem.Deleted) + mapSlice = append(mapSlice, modelMap) + resultMap["deleted"] = mapSlice + } + if vpcItem.Href != nil { + resultMap["href"] = vpcItem.Href + } + if vpcItem.ID != nil { + resultMap["id"] = vpcItem.ID + } + if vpcItem.Name != nil { + resultMap["name"] = vpcItem.Name + } + + return resultMap +} + +func dataSourceSecurityGroupCollectionVPCDeletedToMap(deletedItem *vpcv1.VPCReferenceDeleted) (resultMap map[string]interface{}) { + resultMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + resultMap["more_info"] = deletedItem.MoreInfo + } + + return resultMap +} + +func dataSourceSecurityGroupsRemoteToMap(remoteItem vpcv1.SecurityGroupRuleRemote) (remoteMap map[string]interface{}) { + remoteMap = map[string]interface{}{} + + if remoteItem.Address != nil { + remoteMap["address"] = *remoteItem.Address + } + + if remoteItem.CIDRBlock != nil { + remoteMap["cidr_block"] = *remoteItem.CIDRBlock + } + if remoteItem.CRN != nil { + remoteMap["crn"] = *remoteItem.CRN + } + if remoteItem.Deleted != nil { + remoteDeletedList := []map[string]interface{}{} + remoteDeletedMap := dataSourceSecurityGroupRuleCollectionRemoteDeletedToMap(remoteItem.Deleted) + remoteDeletedList = append(remoteDeletedList, remoteDeletedMap) + remoteMap["deleted"] = remoteDeletedList + } + + if remoteItem.Href != nil { + remoteMap["href"] = *remoteItem.Href + } + if remoteItem.ID != nil { + remoteMap["id"] = *remoteItem.ID + } + if remoteItem.Name != nil { + remoteMap["name"] = *remoteItem.Name + } + return remoteMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_snapshot.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_snapshot.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_snapshot.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_snapshot.go index f8820179e6..928d4b7cea 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_snapshot.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_snapshot.go @@ -1,16 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceSnapshot() *schema.Resource { +func DataSourceSnapshot() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSnapshotRead, @@ -20,14 +22,14 @@ func dataSourceSnapshot() *schema.Resource { Optional: true, ExactlyOneOf: []string{isSnapshotName, "identifier"}, Description: "Snapshot identifier", - ValidateFunc: InvokeDataSourceValidator("ibm_is_snapshot", "identifier"), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_snapshot", "identifier"), }, isSnapshotName: { Type: schema.TypeString, Optional: true, ExactlyOneOf: []string{isSnapshotName, "identifier"}, - ValidateFunc: InvokeDataSourceValidator("ibm_is_snapshot", isSnapshotName), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_snapshot", isSnapshotName), Description: "Snapshot name", }, @@ -97,25 +99,31 @@ func dataSourceSnapshot() *schema.Resource { Computed: true, Description: "The size of the snapshot", }, + + isSnapshotCapturedAt: { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this snapshot was created", + }, }, } } -func dataSourceIBMISSnapshotValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func DataSourceIBMISSnapshotValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "identifier", - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSnapshotName, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) - ibmISSnapshotDataSourceValidator := ResourceValidator{ResourceName: "ibm_is_snapshot", Schema: validateSchema} + ibmISSnapshotDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_snapshot", Schema: validateSchema} return &ibmISSnapshotDataSourceValidator } @@ -144,9 +152,9 @@ func snapshotGetByNameOrID(d *schema.ResourceData, meta interface{}, name, id st } snapshots, response, err := sess.ListSnapshots(listSnapshotOptions) if err != nil { - return fmt.Errorf("Error Fetching snapshots %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching snapshots %s\n%s", err, response) } - start = GetNext(snapshots.Next) + start = flex.GetNext(snapshots.Next) allrecs = append(allrecs, snapshots.Snapshots...) if start == "" { break @@ -164,6 +172,9 @@ func snapshotGetByNameOrID(d *schema.ResourceData, meta interface{}, name, id st d.Set(isSnapshotLCState, *snapshot.LifecycleState) d.Set(isSnapshotResourceType, *snapshot.ResourceType) d.Set(isSnapshotBootable, *snapshot.Bootable) + if snapshot.CapturedAt != nil { + d.Set(isSnapshotCapturedAt, (*snapshot.CapturedAt).String()) + } if snapshot.ResourceGroup != nil && snapshot.ResourceGroup.ID != nil { d.Set(isSnapshotResourceGroup, *snapshot.ResourceGroup.ID) } @@ -179,17 +190,17 @@ func snapshotGetByNameOrID(d *schema.ResourceData, meta interface{}, name, id st return nil } } - return fmt.Errorf("No snapshot found with name %s", name) + return fmt.Errorf("[ERROR] No snapshot found with name %s", name) } else { getSnapshotOptions := &vpcv1.GetSnapshotOptions{ ID: &id, } snapshot, response, err := sess.GetSnapshot(getSnapshotOptions) if err != nil { - return fmt.Errorf("Error fetching snapshot %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching snapshot %s\n%s", err, response) } if (response != nil && response.StatusCode == 404) || snapshot == nil { - return fmt.Errorf("No snapshot found with id %s", id) + return fmt.Errorf("[ERROR] No snapshot found with id %s", id) } d.SetId(*snapshot.ID) d.Set(isSnapshotName, *snapshot.Name) @@ -201,6 +212,9 @@ func snapshotGetByNameOrID(d *schema.ResourceData, meta interface{}, name, id st d.Set(isSnapshotLCState, *snapshot.LifecycleState) d.Set(isSnapshotResourceType, *snapshot.ResourceType) d.Set(isSnapshotBootable, *snapshot.Bootable) + if snapshot.CapturedAt != nil { + d.Set(isSnapshotCapturedAt, (*snapshot.CapturedAt).String()) + } if snapshot.ResourceGroup != nil && snapshot.ResourceGroup.ID != nil { d.Set(isSnapshotResourceGroup, *snapshot.ResourceGroup.ID) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_snapshots.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_snapshots.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_snapshots.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_snapshots.go index 1f82179c04..e0d3713308 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_snapshots.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_snapshots.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +17,7 @@ const ( isSnapshotId = "id" ) -func dataSourceSnapshots() *schema.Resource { +func DataSourceSnapshots() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSnapshotsRead, @@ -129,6 +130,12 @@ func dataSourceSnapshots() *schema.Resource { Computed: true, Description: "The size of the snapshot", }, + + isSnapshotCapturedAt: { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this snapshot was created", + }, }, }, }, @@ -175,9 +182,9 @@ func getSnapshots(d *schema.ResourceData, meta interface{}) error { snapshots, response, err := sess.ListSnapshots(listSnapshotOptions) if err != nil { - return fmt.Errorf("Error fetching snapshots %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching snapshots %s\n%s", err, response) } - start = GetNext(snapshots.Next) + start = flex.GetNext(snapshots.Next) allrecs = append(allrecs, snapshots.Snapshots...) if start == "" { break @@ -198,6 +205,9 @@ func getSnapshots(d *schema.ResourceData, meta interface{}) error { isSnapshotResourceType: *snapshot.ResourceType, isSnapshotBootable: *snapshot.Bootable, } + if snapshot.CapturedAt != nil { + l[isSnapshotCapturedAt] = (*snapshot.CapturedAt).String() + } if snapshot.ResourceGroup != nil && snapshot.ResourceGroup.ID != nil { l[isSnapshotResourceGroup] = *snapshot.ResourceGroup.ID } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_ssh_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ssh_key.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_ssh_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ssh_key.go index ca1c4058be..6b5f46f681 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_ssh_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_ssh_key.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISSSHKey() *schema.Resource { +func DataSourceIBMISSSHKey() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSSHKeyRead, @@ -51,19 +52,19 @@ func dataSourceIBMISSSHKey() *schema.Resource { Description: "The ssh key length", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -75,7 +76,7 @@ func dataSourceIBMISSSHKey() *schema.Resource { Description: "The crn of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -110,9 +111,9 @@ func keyGetByName(d *schema.ResourceData, meta interface{}, name string) error { keys, response, err := sess.ListKeys(listKeysOptions) if err != nil { - return fmt.Errorf("Error fetching Keys %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching Keys %s\n%s", err, response) } - start = GetNext(keys.Next) + start = flex.GetNext(keys.Next) allrecs = append(allrecs, keys.Keys...) if start == "" { break @@ -126,16 +127,16 @@ func keyGetByName(d *schema.ResourceData, meta interface{}, name string) error { d.Set(isKeyType, *key.Type) d.Set(isKeyFingerprint, *key.Fingerprint) d.Set(isKeyLength, *key.Length) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc/compute/sshKeys") - d.Set(ResourceName, *key.Name) - d.Set(ResourceCRN, *key.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc/compute/sshKeys") + d.Set(flex.ResourceName, *key.Name) + d.Set(flex.ResourceCRN, *key.CRN) d.Set(IsKeyCRN, *key.CRN) if key.ResourceGroup != nil { - d.Set(ResourceGroupName, *key.ResourceGroup.ID) + d.Set(flex.ResourceGroupName, *key.ResourceGroup.ID) } if key.PublicKey != nil { d.Set(isKeyPublicKey, *key.PublicKey) @@ -143,5 +144,5 @@ func keyGetByName(d *schema.ResourceData, meta interface{}, name string) error { return nil } } - return fmt.Errorf("No SSH Key found with name %s", name) + return fmt.Errorf("[ERROR] No SSH Key found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet.go new file mode 100644 index 0000000000..ae60e1e77f --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet.go @@ -0,0 +1,262 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func DataSourceIBMISSubnet() *schema.Resource { + return &schema.Resource{ + Read: dataSourceIBMISSubnetRead, + + Schema: map[string]*schema.Schema{ + + "identifier": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{isSubnetName, "identifier"}, + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_subnet", "identifier"), + }, + + isSubnetIpv4CidrBlock: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetAvailableIpv4AddressCount: { + Type: schema.TypeInt, + Computed: true, + }, + + isSubnetTotalIpv4AddressCount: { + Type: schema.TypeInt, + Computed: true, + }, + + isSubnetName: { + Type: schema.TypeString, + Computed: true, + Optional: true, + ExactlyOneOf: []string{isSubnetName, "identifier"}, + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_subnet", isSubnetName), + }, + + isSubnetTags: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + Description: "List of tags", + }, + + isSubnetAccessTags: { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: flex.ResourceIBMVPCHash, + Description: "List of access tags", + }, + + isSubnetCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + isSubnetNetworkACL: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetPublicGateway: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetStatus: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetVPC: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetVPCName: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetZone: { + Type: schema.TypeString, + Computed: true, + }, + + isSubnetResourceGroup: { + Type: schema.TypeString, + Computed: true, + }, + + flex.ResourceControllerURL: { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", + }, + + flex.ResourceName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + flex.ResourceCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + flex.ResourceStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the resource", + }, + + flex.ResourceGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "The resource group name in which resource is provisioned", + }, + }, + } +} + +func DataSourceIBMISSubnetValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "identifier", + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isSubnetName, + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) + + ibmISSubnetDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_subnet", Schema: validateSchema} + return &ibmISSubnetDataSourceValidator +} + +func dataSourceIBMISSubnetRead(d *schema.ResourceData, meta interface{}) error { + err := subnetGetByNameOrID(d, meta) + if err != nil { + return err + } + return nil +} + +func subnetGetByNameOrID(d *schema.ResourceData, meta interface{}) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + var subnet *vpcv1.Subnet + if v, ok := d.GetOk("identifier"); ok { + id := v.(string) + getSubnetOptions := &vpcv1.GetSubnetOptions{ + ID: &id, + } + subnetinfo, response, err := sess.GetSubnet(getSubnetOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Getting Subnet (%s): %s\n%s", id, err, response) + } + subnet = subnetinfo + } else if v, ok := d.GetOk(isSubnetName); ok { + name := v.(string) + start := "" + allrecs := []vpcv1.Subnet{} + getSubnetsListOptions := &vpcv1.ListSubnetsOptions{} + + for { + if start != "" { + getSubnetsListOptions.Start = &start + } + subnetsCollection, response, err := sess.ListSubnets(getSubnetsListOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error Fetching subnets List %s\n%s", err, response) + } + start = flex.GetNext(subnetsCollection.Next) + allrecs = append(allrecs, subnetsCollection.Subnets...) + if start == "" { + break + } + } + + for _, subnetInfo := range allrecs { + if *subnetInfo.Name == name { + subnet = &subnetInfo + break + } + } + if subnet == nil { + return fmt.Errorf("[ERROR] No subnet found with name (%s)", name) + } + } + + d.SetId(*subnet.ID) + d.Set(isSubnetName, *subnet.Name) + d.Set(isSubnetIpv4CidrBlock, *subnet.Ipv4CIDRBlock) + d.Set(isSubnetAvailableIpv4AddressCount, *subnet.AvailableIpv4AddressCount) + d.Set(isSubnetTotalIpv4AddressCount, *subnet.TotalIpv4AddressCount) + if subnet.NetworkACL != nil { + d.Set(isSubnetNetworkACL, *subnet.NetworkACL.ID) + } + if subnet.PublicGateway != nil { + d.Set(isSubnetPublicGateway, *subnet.PublicGateway.ID) + } else { + d.Set(isSubnetPublicGateway, nil) + } + d.Set(isSubnetStatus, *subnet.Status) + d.Set(isSubnetZone, *subnet.Zone.Name) + d.Set(isSubnetVPC, *subnet.VPC.ID) + d.Set(isSubnetVPCName, *subnet.VPC.Name) + + controller, err := flex.GetBaseController(meta) + if err != nil { + return err + } + + tags, err := flex.GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isUserTagType) + if err != nil { + log.Printf( + "An error occured during reading of subnet (%s) tags : %s", d.Id(), err) + } + + accesstags, err := flex.GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isAccessTagType) + if err != nil { + log.Printf( + "Error on get of resource subnet (%s) access tags: %s", d.Id(), err) + } + + d.Set(isSubnetTags, tags) + d.Set(isSubnetAccessTags, accesstags) + d.Set(isSubnetCRN, *subnet.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/subnets") + d.Set(flex.ResourceName, *subnet.Name) + d.Set(flex.ResourceCRN, *subnet.CRN) + d.Set(flex.ResourceStatus, *subnet.Status) + if subnet.ResourceGroup != nil { + d.Set(isSubnetResourceGroup, *subnet.ResourceGroup.ID) + d.Set(flex.ResourceGroupName, *subnet.ResourceGroup.Name) + } + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet_reserved_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet_reserved_ip.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet_reserved_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet_reserved_ip.go index d5c827f1c0..a22ae0b207 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet_reserved_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet_reserved_ip.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -26,7 +26,7 @@ const ( isReservedIPType = "resource_type" ) -func dataSourceIBMISReservedIP() *schema.Resource { +func DataSourceIBMISReservedIP() *schema.Resource { return &schema.Resource{ Read: dataSdataSourceIBMISReservedIPRead, Schema: map[string]*schema.Schema{ @@ -112,7 +112,7 @@ func dataSdataSourceIBMISReservedIPRead(d *schema.ResourceData, meta interface{} reserveIP, response, err := sess.GetSubnetReservedIP(options) if err != nil || response == nil || reserveIP == nil { - return fmt.Errorf("Error fetching the reserved IP %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching the reserved IP %s\n%s", err, response) } d.SetId(*reserveIP.ID) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet_reserved_ips.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet_reserved_ips.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet_reserved_ips.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet_reserved_ips.go index 06eac954ee..938e5aa5c5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnet_reserved_ips.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnet_reserved_ips.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -20,7 +21,7 @@ const ( isReservedIPsCount = "total_count" ) -func dataSourceIBMISReservedIPs() *schema.Resource { +func DataSourceIBMISReservedIPs() *schema.Resource { return &schema.Resource{ Read: dataSdataSourceIBMISReservedIPsRead, Schema: map[string]*schema.Schema{ @@ -124,9 +125,9 @@ func dataSdataSourceIBMISReservedIPsRead(d *schema.ResourceData, meta interface{ result, response, err := sess.ListSubnetReservedIps(options) if err != nil || response == nil || result == nil { - return fmt.Errorf("Error fetching reserved ips %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching reserved ips %s\n%s", err, response) } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.ReservedIps...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnets.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnets.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnets.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnets.go index 3fa4264daf..5d676802fb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_subnets.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_subnets.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "strconv" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -18,7 +19,7 @@ const ( isSubnetRoutingTableName = "routing_table_name" ) -func dataSourceIBMISSubnets() *schema.Resource { +func DataSourceIBMISSubnets() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISSubnetsRead, @@ -150,9 +151,9 @@ func subnetList(d *schema.ResourceData, meta interface{}) error { } subnets, response, err := sess.ListSubnets(options) if err != nil { - return fmt.Errorf("Error Fetching subnets %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching subnets %s\n%s", err, response) } - start = GetNext(subnets.Next) + start = flex.GetNext(subnets.Next) allrecs = append(allrecs, subnets.Subnets...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateway.go similarity index 93% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateway.go index 866913e3d5..dd34937481 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateway.go @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISEndpointGateway() *schema.Resource { +func DataSourceIBMISEndpointGateway() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISEndpointGatewayRead, Importer: &schema.ResourceImporter{}, @@ -134,9 +135,9 @@ func dataSourceIBMISEndpointGatewayRead( } result, response, err := sess.ListEndpointGateways(options) if err != nil { - return fmt.Errorf("Error fetching endpoint gateways %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching endpoint gateways %s\n%s", err, response) } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.EndpointGateways...) if start == "" { break @@ -164,7 +165,7 @@ func dataSourceIBMISEndpointGatewayRead( } } if !found { - return fmt.Errorf("No Virtual Endpoints Gateway found with given name %s", name) + return fmt.Errorf("[ERROR] No Virtual Endpoints Gateway found with given name %s", name) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateway_ips.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateway_ips.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateway_ips.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateway_ips.go index 6a0d79647e..9a3b169609 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateway_ips.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateway_ips.go @@ -1,17 +1,18 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISEndpointGatewayIPs() *schema.Resource { +func DataSourceIBMISEndpointGatewayIPs() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISEndpointGatewayIPsRead, Importer: &schema.ResourceImporter{}, @@ -102,9 +103,9 @@ func dataSourceIBMISEndpointGatewayIPsRead(d *schema.ResourceData, meta interfac } result, response, err := sess.ListEndpointGatewayIps(options) if err != nil { - return fmt.Errorf("Error fetching endpoint gateway ips %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching endpoint gateway ips %s\n%s", err, response) } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.Ips...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateways.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateways.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateways.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateways.go index c7ffe1a8d5..62598549ed 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_virtual_endpoint_gateways.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_virtual_endpoint_gateways.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,7 +17,7 @@ const ( isVirtualEndpointGateways = "virtual_endpoint_gateways" ) -func dataSourceIBMISEndpointGateways() *schema.Resource { +func DataSourceIBMISEndpointGateways() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISEndpointGatewaysRead, Importer: &schema.ResourceImporter{}, @@ -148,9 +149,9 @@ func dataSourceIBMISEndpointGatewaysRead(d *schema.ResourceData, meta interface{ } result, response, err := sess.ListEndpointGateways(options) if err != nil { - return fmt.Errorf("Error fetching endpoint gateways %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching endpoint gateways %s\n%s", err, response) } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.EndpointGateways...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume.go index 48f5e0ff32..785cb44a10 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISVolume() *schema.Resource { +func DataSourceIBMISVolume() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVolumeRead, @@ -20,7 +22,7 @@ func dataSourceIBMISVolume() *schema.Resource { isVolumeName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeDataSourceValidator("ibm_is_subnet", isVolumeName), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_subnet", isVolumeName), Description: "Volume name", }, @@ -109,7 +111,7 @@ func dataSourceIBMISVolume() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the volume instance", }, @@ -119,31 +121,31 @@ func dataSourceIBMISVolume() *schema.Resource { Description: "Identifier of the snapshot from which this volume was cloned", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -152,15 +154,15 @@ func dataSourceIBMISVolume() *schema.Resource { } } -func dataSourceIBMISVolumeValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func DataSourceIBMISVolumeValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVolumeName, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) - ibmISVoulmeDataSourceValidator := ResourceValidator{ResourceName: "ibm_is_volume", Schema: validateSchema} + ibmISVoulmeDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_volume", Schema: validateSchema} return &ibmISVoulmeDataSourceValidator } @@ -197,9 +199,9 @@ func volumeGet(d *schema.ResourceData, meta interface{}, name string) error { listVolumesOptions.Name = &name vols, response, err := sess.ListVolumes(listVolumesOptions) if err != nil { - return fmt.Errorf("Error Fetching volumes %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching volumes %s\n%s", err, response) } - start = GetNext(vols.Next) + start = flex.GetNext(vols.Next) allrecs = append(allrecs, vols.Volumes...) if start == "" { break @@ -236,25 +238,25 @@ func volumeGet(d *schema.ResourceData, meta interface{}, name string) error { } d.Set(isVolumeStatusReasons, statusReasonsList) } - tags, err := GetTagsUsingCRN(meta, *vol.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *vol.CRN) if err != nil { log.Printf( "Error on get of resource vpc volume (%s) tags: %s", d.Id(), err) } d.Set(isVolumeTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/storage/storageVolumes") - d.Set(ResourceName, *vol.Name) - d.Set(ResourceCRN, *vol.CRN) - d.Set(ResourceStatus, *vol.Status) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/storage/storageVolumes") + d.Set(flex.ResourceName, *vol.Name) + d.Set(flex.ResourceCRN, *vol.CRN) + d.Set(flex.ResourceStatus, *vol.Status) if vol.ResourceGroup != nil { - d.Set(ResourceGroupName, vol.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, vol.ResourceGroup.Name) d.Set(isVolumeResourceGroup, *vol.ResourceGroup.ID) } return nil } - return fmt.Errorf("No Volume found with name %s", name) + return fmt.Errorf("[ERROR] No Volume found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume_profile.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume_profile.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume_profile.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume_profile.go index 31eb39aa3b..26dab62937 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume_profile.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume_profile.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "github.com/IBM/vpc-go-sdk/vpcv1" @@ -13,7 +13,7 @@ const ( isVolumeProfileFamily = "family" ) -func dataSourceIBMISVolumeProfile() *schema.Resource { +func DataSourceIBMISVolumeProfile() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVolumeProfileRead, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume_profiles.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume_profiles.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume_profiles.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume_profiles.go index 88d4eb38b9..7315e82f3a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_volume_profiles.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_volume_profiles.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -15,7 +16,7 @@ const ( isVolumeProfiles = "profiles" ) -func dataSourceIBMISVolumeProfiles() *schema.Resource { +func DataSourceIBMISVolumeProfiles() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVolumeProfilesRead, @@ -66,9 +67,9 @@ func volumeProfilesList(d *schema.ResourceData, meta interface{}) error { } availableProfiles, response, err := sess.ListVolumeProfiles(listVolumeProfilesOptions) if err != nil { - return fmt.Errorf("Error Fetching Volume Profiles %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching Volume Profiles %s\n%s", err, response) } - start = GetNext(availableProfiles.Next) + start = flex.GetNext(availableProfiles.Next) allrecs = append(allrecs, availableProfiles.Profiles...) if start == "" { break @@ -78,7 +79,7 @@ func volumeProfilesList(d *schema.ResourceData, meta interface{}) error { // listVolumeProfilesOptions := &vpcv1.ListVolumeProfilesOptions{} // availableProfiles, response, err := sess.ListVolumeProfiles(listVolumeProfilesOptions) // if err != nil { - // return fmt.Errorf("Error Fetching Volume Profiles %s\n%s", err, response) + // return fmt.Errorf("[ERROR] Error Fetching Volume Profiles %s\n%s", err, response) // } profilesInfo := make([]map[string]interface{}, 0) for _, profile := range allrecs { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc.go index 3a6d216755..4e2163aad6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "reflect" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func dataSourceIBMISVPC() *schema.Resource { +func DataSourceIBMISVPC() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVPCRead, @@ -36,7 +38,7 @@ func dataSourceIBMISVPC() *schema.Resource { isVPCName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeDataSourceValidator("ibm_is_subnet", isVPCName), + ValidateFunc: validate.InvokeDataSourceValidator("ibm_is_subnet", isVPCName), }, isVPCDefaultNetworkACLName: { @@ -89,7 +91,7 @@ func dataSourceIBMISVPC() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, }, isVPCCRN: { @@ -98,30 +100,30 @@ func dataSourceIBMISVPC() *schema.Resource { Description: "The crn of the resource", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -273,15 +275,15 @@ func dataSourceIBMISVPC() *schema.Resource { } } -func dataSourceIBMISVpcValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func DataSourceIBMISVpcValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCName, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) - ibmISVpcDataSourceValidator := ResourceValidator{ResourceName: "ibm_is_vpc", Schema: validateSchema} + ibmISVpcDataSourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_vpc", Schema: validateSchema} return &ibmISVpcDataSourceValidator } @@ -308,9 +310,9 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { } vpcs, response, err := sess.ListVpcs(listVpcsOptions) if err != nil { - return fmt.Errorf("Error Fetching vpcs %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching vpcs %s\n%s", err, response) } - start = GetNext(vpcs.Next) + start = flex.GetNext(vpcs.Next) allrecs = append(allrecs, vpcs.Vpcs...) if start == "" { break @@ -343,7 +345,7 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { } else { d.Set(isVPCDefaultSecurityGroup, nil) } - tags, err := GetTagsUsingCRN(meta, *vpc.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *vpc.CRN) if err != nil { log.Printf( "An error occured during reading of vpc (%s) tags : %s", d.Id(), err) @@ -351,16 +353,16 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { d.Set(isVPCTags, tags) d.Set(isVPCCRN, *vpc.CRN) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/vpcs") - d.Set(ResourceName, *vpc.Name) - d.Set(ResourceCRN, *vpc.CRN) - d.Set(ResourceStatus, *vpc.Status) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/vpcs") + d.Set(flex.ResourceName, *vpc.Name) + d.Set(flex.ResourceCRN, *vpc.CRN) + d.Set(flex.ResourceStatus, *vpc.Status) if vpc.ResourceGroup != nil { - d.Set(ResourceGroupName, *vpc.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *vpc.ResourceGroup.Name) } //set the cse ip addresses info if vpc.CseSourceIps != nil { @@ -384,13 +386,13 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { for { if startSub != "" { - options.Start = &start + options.Start = &startSub } s, response, err := sess.ListSubnets(options) if err != nil { - return fmt.Errorf("Error fetching subnets %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching subnets %s\n%s", err, response) } - start = GetNext(s.Next) + startSub = flex.GetNext(s.Next) allrecsSub = append(allrecsSub, s.Subnets...) if startSub == "" { break @@ -414,7 +416,7 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { d.Set(subnetsList, subnetsInfo) } - // adding pagination support for subnets inside vpc + // adding pagination support for sg inside vpc startSg := "" allrecsSg := []vpcv1.SecurityGroup{} @@ -429,12 +431,12 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { } sgs, response, err := sess.ListSecurityGroups(listSgOptions) if err != nil || sgs == nil { - return fmt.Errorf("Error fetching Security Groups %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error fetching Security Groups %s\n%s", err, response) } if *sgs.TotalCount == int64(0) { break } - start = GetNext(sgs.Next) + start = flex.GetNext(sgs.Next) allrecsSg = append(allrecsSg, sgs.SecurityGroups...) if startSg == "" { @@ -552,5 +554,5 @@ func vpcGetByName(d *schema.ResourceData, meta interface{}, name string) error { return nil } } - return fmt.Errorf("No VPC found with name %s", name) + return fmt.Errorf("[ERROR] No VPC found with name %s", name) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_address_prefix.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_address_prefix.go new file mode 100644 index 0000000000..a7d9de1472 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_address_prefix.go @@ -0,0 +1,239 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMIsVPCAddressPrefix() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsVPCAddressPrefixRead, + + Schema: map[string]*schema.Schema{ + "vpc": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpc", "vpc_name"}, + Description: "The VPC identifier.", + }, + "vpc_name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpc", "vpc_name"}, + Description: "The VPC name.", + }, + "address_prefix": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"address_prefix", "address_prefix_name"}, + Description: "The address prefix identifier.", + }, + "address_prefix_name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"address_prefix", "address_prefix_name"}, + Description: "The address prefix name.", + }, + "cidr": { + Type: schema.TypeString, + Computed: true, + Description: "The CIDR block for this prefix.", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the prefix was created.", + }, + "has_subnets": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether subnets exist with addresses from this prefix.", + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this address prefix.", + }, + "is_default": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in.", + }, + "zone": { + Type: schema.TypeList, + Computed: true, + Description: "The zone this address prefix resides in.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this zone.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique name for this zone.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIsVPCAddressPrefixRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + vpc_id := d.Get("vpc").(string) + address_prefix_id := d.Get("address_prefix").(string) + address_prefix_name := d.Get("address_prefix_name").(string) + vpc_name := d.Get("vpc_name").(string) + var addressPrefix *vpcv1.AddressPrefix + if vpc_id == "" { + start := "" + allrecs := []vpcv1.VPC{} + for { + listVpcsOptions := &vpcv1.ListVpcsOptions{} + if start != "" { + listVpcsOptions.Start = &start + } + vpcs, response, err := vpcClient.ListVpcs(listVpcsOptions) + if err != nil { + return diag.FromErr(fmt.Errorf("Error Fetching vpcs %s\n%s", err, response)) + } + start = flex.GetNext(vpcs.Next) + allrecs = append(allrecs, vpcs.Vpcs...) + if start == "" { + break + } + } + vpc_found := false + for _, vpc := range allrecs { + if *vpc.Name == vpc_name { + vpc_id = *vpc.ID + vpc_found = true + break + } + } + if !vpc_found { + log.Printf("[DEBUG] VPC with given name not found %s\n", vpc_name) + return diag.FromErr(fmt.Errorf("VPC with given name not found %s\n", vpc_name)) + } + } + if address_prefix_id != "" { + getVPCAddressPrefixOptions := &vpcv1.GetVPCAddressPrefixOptions{} + + getVPCAddressPrefixOptions.SetVPCID(vpc_id) + getVPCAddressPrefixOptions.SetID(address_prefix_id) + + addressPrefix1, response, err := vpcClient.GetVPCAddressPrefixWithContext(context, getVPCAddressPrefixOptions) + if err != nil { + log.Printf("[DEBUG] GetVPCAddressPrefixWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetVPCAddressPrefixWithContext failed %s\n%s", err, response)) + } + addressPrefix = addressPrefix1 + + } else { + start := "" + allrecs := []vpcv1.AddressPrefix{} + listVpcAddressPrefixesOptions := &vpcv1.ListVPCAddressPrefixesOptions{} + + listVpcAddressPrefixesOptions.SetVPCID(vpc_id) + for { + if start != "" { + listVpcAddressPrefixesOptions.Start = &start + } + addressPrefixCollection, response, err := vpcClient.ListVPCAddressPrefixesWithContext(context, listVpcAddressPrefixesOptions) + if err != nil { + log.Printf("[DEBUG] ListVpcAddressPrefixesWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("ListVpcAddressPrefixesWithContext failed %s\n%s", err, response)) + } + start = flex.GetNext(addressPrefixCollection.Next) + allrecs = append(allrecs, addressPrefixCollection.AddressPrefixes...) + if start == "" { + break + } + } + address_prefix_found := false + for _, addressPrefixItem := range allrecs { + if *addressPrefixItem.Name == address_prefix_name { + addressPrefix = &addressPrefixItem + address_prefix_found = true + break + } + } + if !address_prefix_found { + log.Printf("[DEBUG] Address Prefix with given name not found %s\n", address_prefix_name) + return diag.FromErr(fmt.Errorf("Address Prefix with given name not found %s\n", address_prefix_name)) + } + } + d.SetId(*addressPrefix.ID) + if err = d.Set("cidr", addressPrefix.CIDR); err != nil { + return diag.FromErr(fmt.Errorf("Error setting cidr: %s", err)) + } + + if err = d.Set("created_at", flex.DateTimeToString(addressPrefix.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + + if err = d.Set("has_subnets", addressPrefix.HasSubnets); err != nil { + return diag.FromErr(fmt.Errorf("Error setting has_subnets: %s", err)) + } + + if err = d.Set("href", addressPrefix.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + + if err = d.Set("is_default", addressPrefix.IsDefault); err != nil { + return diag.FromErr(fmt.Errorf("Error setting is_default: %s", err)) + } + + if err = d.Set("name", addressPrefix.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + + zone := []map[string]interface{}{} + if addressPrefix.Zone != nil { + modelMap, err := dataSourceIBMIsVPCAddressPrefixZoneReferenceToMap(addressPrefix.Zone) + if err != nil { + return diag.FromErr(err) + } + zone = append(zone, modelMap) + } + if err = d.Set("zone", zone); err != nil { + return diag.FromErr(fmt.Errorf("Error setting zone %s", err)) + } + + return nil +} + +func dataSourceIBMIsVPCAddressPrefixZoneReferenceToMap(model *vpcv1.ZoneReference) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Href != nil { + modelMap["href"] = model.Href + } + if model.Name != nil { + modelMap["name"] = model.Name + } + return modelMap, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_address_prefixes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_address_prefixes.go similarity index 92% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_address_prefixes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_address_prefixes.go index e3fee92768..172e4ae1cb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_address_prefixes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_address_prefixes.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,80 +9,82 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM/vpc-go-sdk/vpcv1" ) -func dataSourceIbmIsVpcAddressPrefixes() *schema.Resource { +func DataSourceIbmIsVpcAddressPrefixes() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIbmIsVpcAddressPrefixRead, Schema: map[string]*schema.Schema{ - "vpc": &schema.Schema{ + "vpc": { Type: schema.TypeString, Required: true, Description: "The VPC identifier.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Description: "The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in.", }, - "address_prefixes": &schema.Schema{ + "address_prefixes": { Type: schema.TypeList, Computed: true, Description: "Collection of address prefixes.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cidr": &schema.Schema{ + "cidr": { Type: schema.TypeString, Computed: true, Description: "The CIDR block for this prefix.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the prefix was created.", }, - "has_subnets": &schema.Schema{ + "has_subnets": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether subnets exist with addresses from this prefix.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this address prefix.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this address prefix.", }, - "is_default": &schema.Schema{ + "is_default": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in.", }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeList, Computed: true, Description: "The zone this address prefix resides in.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this zone.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this zone.", @@ -99,7 +101,7 @@ func dataSourceIbmIsVpcAddressPrefixes() *schema.Resource { func dataSourceIbmIsVpcAddressPrefixRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -119,7 +121,7 @@ func dataSourceIbmIsVpcAddressPrefixRead(context context.Context, d *schema.Reso log.Printf("[DEBUG] ListVpcAddressPrefixesWithContext failed %s\n%s", err, response) return diag.FromErr(fmt.Errorf("ListVpcAddressPrefixesWithContext failed %s\n%s", err, response)) } - start = GetNext(addressPrefixCollection.Next) + start = flex.GetNext(addressPrefixCollection.Next) allrecs = append(allrecs, addressPrefixCollection.AddressPrefixes...) if start == "" { break @@ -155,7 +157,7 @@ func dataSourceIbmIsVpcAddressPrefixRead(context context.Context, d *schema.Reso if matchAddressPrefixes != nil { err = d.Set("address_prefixes", dataSourceAddressPrefixCollectionFlattenAddressPrefixes(matchAddressPrefixes)) if err != nil { - return diag.FromErr(fmt.Errorf("Error setting address_prefixes %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting address_prefixes %s", err)) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_default_routing_table.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_default_routing_table.go similarity index 98% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_default_routing_table.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_default_routing_table.go index e544e61ba6..4cff866b7a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_default_routing_table.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_default_routing_table.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "log" @@ -25,7 +25,7 @@ const ( isDefaultRTDefault = "is_default" ) -func dataSourceIBMISVPCDefaultRoutingTable() *schema.Resource { +func DataSourceIBMISVPCDefaultRoutingTable() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVPCDefaultRoutingTableGet, Schema: map[string]*schema.Schema{ diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table.go new file mode 100644 index 0000000000..d13c3a7c6d --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table.go @@ -0,0 +1,355 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +const ( + rtRoutes = "routes" + rtCrn = "crn" +) + +func DataSourceIBMIBMIsVPCRoutingTable() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIBMIsVPCRoutingTableRead, + + Schema: map[string]*schema.Schema{ + isVpcID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The VPC identifier.", + }, + rName: &schema.Schema{ + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: []string{rName, isRoutingTableID}, + ConflictsWith: []string{isRoutingTableID}, + Description: "The user-defined name for this routing table.", + }, + isRoutingTableID: &schema.Schema{ + Type: schema.TypeString, + AtLeastOneOf: []string{rName, isRoutingTableID}, + ConflictsWith: []string{rName}, + Optional: true, + Description: "The routing table identifier.", + }, + + rtCreateAt: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this routing table was created.", + }, + rtHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this routing table.", + }, + rtIsDefault: &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this is the default routing table for this VPC.", + }, + rtLifecycleState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the routing table.", + }, + rtResourceType: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + rtRouteDirectLinkIngress: &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this routing table is used to route traffic that originates from[Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + }, + rtRouteTransitGatewayIngress: &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + }, + rtRouteVPCZoneIngress: &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC.Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway connection, the packet will be dropped.", + }, + rtRoutes: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The routes for this routing table.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + rtHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this route.", + }, + rId: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this route.", + }, + rName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this route.", + }, + }, + }, + }, + rtSubnets: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The subnets to which this routing table is attached.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rtCrn: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this subnet.", + }, + rDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + rtHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this subnet.", + }, + rId: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this subnet.", + }, + rName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this subnet.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIBMIsVPCRoutingTableRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + vpcId := d.Get(isVpcID).(string) + rtId := d.Get(isRoutingTableID).(string) + routingTableName := d.Get(rtName).(string) + var routingTable *vpcv1.RoutingTable + if rtId != "" { + getVPCRoutingTableOptions := &vpcv1.GetVPCRoutingTableOptions{ + VPCID: &vpcId, + ID: &rtId, + } + + rt, response, err := vpcClient.GetVPCRoutingTableWithContext(context, getVPCRoutingTableOptions) + if err != nil { + log.Printf("[DEBUG] GetVPCRoutingTableWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] GetVPCRoutingTableWithContext failed %s\n%s", err, response)) + } + routingTable = rt + } else { + start := "" + allrecs := []vpcv1.RoutingTable{} + for { + listOptions := &vpcv1.ListVPCRoutingTablesOptions{ + VPCID: &vpcId, + } + if start != "" { + listOptions.Start = &start + } + result, detail, err := vpcClient.ListVPCRoutingTables(listOptions) + if err != nil { + log.Printf("[ERROR] Error reading list of VPC Routing Tables:%s\n%s", err, detail) + return diag.FromErr(fmt.Errorf("[ERROR] ListVPCRoutingTables failed %s\n%s", err, detail)) + } + start = flex.GetNext(result.Next) + allrecs = append(allrecs, result.RoutingTables...) + if start == "" { + break + } + } + for _, r := range allrecs { + if *r.Name == routingTableName { + routingTable = &r + } + } + } + + d.SetId(*routingTable.ID) + + if err = d.Set(rtCreateAt, flex.DateTimeToString(routingTable.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + + if err = d.Set(isRoutingTableID, routingTable.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting routing_table: %s", err)) + } + + if err = d.Set(rtHref, routingTable.Href); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) + } + + if err = d.Set(rtIsDefault, routingTable.IsDefault); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting is_default: %s", err)) + } + + if err = d.Set(rtLifecycleState, routingTable.LifecycleState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) + } + + if err = d.Set(rName, routingTable.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + + if err = d.Set(rtResourceType, routingTable.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) + } + + if err = d.Set(rtRouteDirectLinkIngress, routingTable.RouteDirectLinkIngress); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting route_direct_link_ingress: %s", err)) + } + + if err = d.Set(rtRouteTransitGatewayIngress, routingTable.RouteTransitGatewayIngress); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting route_transit_gateway_ingress: %s", err)) + } + + if err = d.Set(rtRouteVPCZoneIngress, routingTable.RouteVPCZoneIngress); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting route_vpc_zone_ingress: %s", err)) + } + + routes := []map[string]interface{}{} + if routingTable.Routes != nil { + for _, modelItem := range routingTable.Routes { + modelMap, err := dataSourceIBMIBMIsVPCRoutingTableRouteReferenceToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + routes = append(routes, modelMap) + } + } + if err = d.Set(rtRoutes, routes); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting routes %s", err)) + } + + subnets := []map[string]interface{}{} + if routingTable.Subnets != nil { + for _, modelItem := range routingTable.Subnets { + modelMap, err := dataSourceIBMIBMIsVPCRoutingTableSubnetReferenceToMap(&modelItem) + if err != nil { + return diag.FromErr(err) + } + subnets = append(subnets, modelMap) + } + } + if err = d.Set(rtSubnets, subnets); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subnets %s", err)) + } + + return nil +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteReferenceToMap(model *vpcv1.RouteReference) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.Deleted != nil { + deletedMap, err := dataSourceIBMIBMIsVPCRoutingTableRouteReferenceDeletedToMap(model.Deleted) + if err != nil { + return modelMap, err + } + modelMap[rDeleted] = []map[string]interface{}{deletedMap} + } + if model.Href != nil { + modelMap[rtHref] = *model.Href + } + if model.ID != nil { + modelMap[rId] = *model.ID + } + if model.Name != nil { + modelMap[rName] = *model.Name + } + return modelMap, nil +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteReferenceDeletedToMap(model *vpcv1.RouteReferenceDeleted) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.MoreInfo != nil { + modelMap[rMoreInfo] = *model.MoreInfo + } + return modelMap, nil +} + +func dataSourceIBMIBMIsVPCRoutingTableSubnetReferenceToMap(model *vpcv1.SubnetReference) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.CRN != nil { + modelMap[rtCrn] = *model.CRN + } + if model.Deleted != nil { + deletedMap, err := dataSourceIBMIBMIsVPCRoutingTableSubnetReferenceDeletedToMap(model.Deleted) + if err != nil { + return modelMap, err + } + modelMap[rDeleted] = []map[string]interface{}{deletedMap} + } + if model.Href != nil { + modelMap[rtHref] = *model.Href + } + if model.ID != nil { + modelMap[rId] = *model.ID + } + if model.Name != nil { + modelMap[rName] = *model.Name + } + return modelMap, nil +} + +func dataSourceIBMIBMIsVPCRoutingTableSubnetReferenceDeletedToMap(model *vpcv1.SubnetReferenceDeleted) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.MoreInfo != nil { + modelMap[rMoreInfo] = *model.MoreInfo + } + return modelMap, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table_route.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table_route.go new file mode 100644 index 0000000000..b24bf2f96a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table_route.go @@ -0,0 +1,348 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +const ( + rDeleted = "deleted" + rAddress = "address" + rMoreInfo = "more_info" + rId = "id" +) + +func DataSourceIBMIBMIsVPCRoutingTableRoute() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIBMIsVPCRoutingTableRouteRead, + + Schema: map[string]*schema.Schema{ + isVpcID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The VPC identifier.", + }, + isRoutingTableID: &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "The routing table identifier.", + }, + isRoutingTableRouteID: &schema.Schema{ + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: []string{rName, isRoutingTableRouteID}, + ConflictsWith: []string{rName}, + Description: "The VPC routing table route identifier.", + }, + rName: &schema.Schema{ + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: []string{rName, isRoutingTableRouteID}, + ConflictsWith: []string{isRoutingTableRouteID}, + Description: "The user-defined name for this route.", + }, + rAction: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The action to perform with a packet matching the route:- `delegate`: delegate to the system's built-in routes- `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound routes- `deliver`: deliver the packet to the specified `next_hop`- `drop`: drop the packet.", + }, + rtCreateAt: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The date and time that the route was created.", + }, + rDestination: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The destination of the route.", + }, + rtHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this route.", + }, + rtLifecycleState: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The lifecycle state of the route.", + }, + rNextHop: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If `action` is `deliver`, the next hop that packets will be delivered to. Forother `action` values, its `address` will be `0.0.0.0`.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rAddress: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.", + }, + rDeleted: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rMoreInfo: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + rtHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + rId: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPN gateway connection.", + }, + rName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN connection.", + }, + rtResourceType: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + rZone: &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: "The zone the route applies to. (Traffic from subnets in this zone will besubject to this route.).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rtHref: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The URL for this zone.", + }, + rName: &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "The globally unique name for this zone.", + }, + }, + }, + }, + }, + } +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + vpcID := d.Get(isVpcID).(string) + routingTableId := d.Get("routing_table").(string) + routeId := d.Get("route_id").(string) + routeName := d.Get("name").(string) + var route *vpcv1.Route + + if routeId != "" { + getVPCRoutingTableRouteOptions := &vpcv1.GetVPCRoutingTableRouteOptions{} + getVPCRoutingTableRouteOptions.SetVPCID(vpcID) + getVPCRoutingTableRouteOptions.SetRoutingTableID(routingTableId) + getVPCRoutingTableRouteOptions.SetID(routeId) + + r, response, err := vpcClient.GetVPCRoutingTableRouteWithContext(context, getVPCRoutingTableRouteOptions) + if err != nil { + log.Printf("[DEBUG] GetVPCRoutingTableRouteWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] GetVPCRoutingTableRouteWithContext failed %s\n%s", err, response)) + } + route = r + } else { + start := "" + allrecs := []vpcv1.Route{} + for { + listVpcRoutingTablesRoutesOptions := &vpcv1.ListVPCRoutingTableRoutesOptions{ + VPCID: &vpcID, + RoutingTableID: &routingTableId, + } + + if start != "" { + listVpcRoutingTablesRoutesOptions.Start = &start + } + result, detail, err := vpcClient.ListVPCRoutingTableRoutes(listVpcRoutingTablesRoutesOptions) + if err != nil { + log.Printf("Error reading list of VPC Routing Table Routes:%s\n%s", err, detail) + return diag.FromErr(fmt.Errorf("[ERROR] GetVPCRoutingTableRouteWithContext failed %s\n%s", err, detail)) + } + start = flex.GetNext(result.Next) + allrecs = append(allrecs, result.Routes...) + if start == "" { + break + } + } + + for _, r := range allrecs { + if *r.Name == routeName { + route = &r + } + } + } + + d.SetId(*route.ID) + + if err = d.Set(rAction, route.Action); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting action: %s", err)) + } + + if err = d.Set(rtCreateAt, flex.DateTimeToString(route.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) + } + + if err = d.Set(isRoutingTableRouteID, route.ID); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting route_id: %s", err)) + } + + if err = d.Set(rDestination, route.Destination); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting destination: %s", err)) + } + + if err = d.Set(rtHref, route.Href); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) + } + + if err = d.Set(rtLifecycleState, route.LifecycleState); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) + } + + if err = d.Set(rName, route.Name); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) + } + + nextHop := []map[string]interface{}{} + if route.NextHop != nil { + modelMap, err := dataSourceIBMIBMIsVPCRoutingTableRouteRouteNextHopToMap(route.NextHop) + if err != nil { + return diag.FromErr(err) + } + nextHop = append(nextHop, modelMap) + } + if err = d.Set(rNextHop, nextHop); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting next_hop %s", err)) + } + + zone := []map[string]interface{}{} + if route.Zone != nil { + modelMap, err := dataSourceIBMIBMIsVPCRoutingTableRouteZoneReferenceToMap(route.Zone) + if err != nil { + return diag.FromErr(err) + } + zone = append(zone, modelMap) + } + if err = d.Set(rZone, zone); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone %s", err)) + } + + return nil +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteRouteNextHopToMap(model vpcv1.RouteNextHopIntf) (map[string]interface{}, error) { + if _, ok := model.(*vpcv1.RouteNextHopIP); ok { + return dataSourceIBMIBMIsVPCRoutingTableRouteRouteNextHopIPToMap(model.(*vpcv1.RouteNextHopIP)) + } else if _, ok := model.(*vpcv1.RouteNextHopVPNGatewayConnectionReference); ok { + return dataSourceIBMIBMIsVPCRoutingTableRouteRouteNextHopVPNGatewayConnectionReferenceToMap(model.(*vpcv1.RouteNextHopVPNGatewayConnectionReference)) + } else if _, ok := model.(*vpcv1.RouteNextHop); ok { + modelMap := make(map[string]interface{}) + model := model.(*vpcv1.RouteNextHop) + if model.Address != nil { + modelMap[rAddress] = *model.Address + } + if model.Deleted != nil { + deletedMap, err := dataSourceIBMIBMIsVPCRoutingTableRouteVPNGatewayConnectionReferenceDeletedToMap(model.Deleted) + if err != nil { + return modelMap, err + } + modelMap[rDeleted] = []map[string]interface{}{deletedMap} + } + if model.Href != nil { + modelMap[rtHref] = *model.Href + } + if model.ID != nil { + modelMap[rId] = *model.ID + } + if model.Name != nil { + modelMap[rName] = *model.Name + } + if model.ResourceType != nil { + modelMap[rtResourceType] = *model.ResourceType + } + return modelMap, nil + } else { + return nil, fmt.Errorf("[ERROR] Unrecognized vpcv1.RouteNextHopIntf subtype encountered") + } +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteVPNGatewayConnectionReferenceDeletedToMap(model *vpcv1.VPNGatewayConnectionReferenceDeleted) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.MoreInfo != nil { + modelMap[rMoreInfo] = *model.MoreInfo + } + return modelMap, nil +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteRouteNextHopIPToMap(model *vpcv1.RouteNextHopIP) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.Address != nil { + modelMap[rAddress] = *model.Address + } + return modelMap, nil +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteRouteNextHopVPNGatewayConnectionReferenceToMap(model *vpcv1.RouteNextHopVPNGatewayConnectionReference) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.Deleted != nil { + deletedMap, err := dataSourceIBMIBMIsVPCRoutingTableRouteVPNGatewayConnectionReferenceDeletedToMap(model.Deleted) + if err != nil { + return modelMap, err + } + modelMap[rDeleted] = []map[string]interface{}{deletedMap} + } + if model.Href != nil { + modelMap[rtHref] = *model.Href + } + if model.ID != nil { + modelMap[rId] = *model.ID + } + if model.Name != nil { + modelMap[rName] = *model.Name + } + if model.ResourceType != nil { + modelMap[rtResourceType] = *model.ResourceType + } + return modelMap, nil +} + +func dataSourceIBMIBMIsVPCRoutingTableRouteZoneReferenceToMap(model *vpcv1.ZoneReference) (map[string]interface{}, error) { + modelMap := map[string]interface{}{} + if model.Href != nil { + modelMap[rtHref] = *model.Href + } + if model.Name != nil { + modelMap[rName] = *model.Name + } + return modelMap, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_routing_table_routes.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table_routes.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_routing_table_routes.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table_routes.go index c11c9535ff..dca6cfb49d 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_routing_table_routes.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_table_routes.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -26,7 +27,7 @@ const ( isRoutingTableRoutes = "routes" ) -func dataSourceIBMISVPCRoutingTableRoutes() *schema.Resource { +func DataSourceIBMISVPCRoutingTableRoutes() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVPCRoutingTableRoutesList, Schema: map[string]*schema.Schema{ @@ -118,7 +119,7 @@ func dataSourceIBMISVPCRoutingTableRoutesList(d *schema.ResourceData, meta inter log.Printf("Error reading list of VPC Routing Table Routes:%s\n%s", err, detail) return err } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.Routes...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_routing_tables.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_tables.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_routing_tables.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_tables.go index 8b0d485b29..560c4974df 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpc_routing_tables.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpc_routing_tables.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( //"encoding/json" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -29,7 +30,7 @@ const ( isRoutingTableDefault = "is_default" ) -func dataSourceIBMISVPCRoutingTables() *schema.Resource { +func DataSourceIBMISVPCRoutingTables() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISVPCRoutingTablesList, Schema: map[string]*schema.Schema{ @@ -159,7 +160,7 @@ func dataSourceIBMISVPCRoutingTablesList(d *schema.ResourceData, meta interface{ log.Printf("Error reading list of VPC Routing Tables:%s\n%s", err, detail) return err } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.RoutingTables...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpcs.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpcs.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpcs.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpcs.go index f118e62089..a672a650f5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpcs.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpcs.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( //"encoding/json" @@ -12,6 +12,8 @@ import ( "reflect" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,7 +24,7 @@ const ( isVPCID = "id" ) -func dataSourceIBMISVPCs() *schema.Resource { +func DataSourceIBMISVPCs() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMISVPCListRead, Schema: map[string]*schema.Schema{ @@ -109,7 +111,7 @@ func dataSourceIBMISVPCs() *schema.Resource { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: resourceIBMVPCHash, + Set: flex.ResourceIBMVPCHash, }, isVPCCRN: { @@ -118,30 +120,30 @@ func dataSourceIBMISVPCs() *schema.Resource { Description: "The crn of the resource", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -298,7 +300,7 @@ func dataSourceIBMISVPCs() *schema.Resource { } func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(ClientSession).VpcV1API() + sess, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -315,7 +317,7 @@ func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, log.Printf("Error reading list of VPCs:%s\n%s", err, detail) return diag.FromErr(err) } - start = GetNext(result.Next) + start = flex.GetNext(result.Next) allrecs = append(allrecs, result.Vpcs...) if start == "" { break @@ -326,15 +328,15 @@ func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, for _, vpc := range allrecs { l := map[string]interface{}{ - isVPCID: *vpc.ID, - isVPCName: *vpc.Name, - isVPCClassicAccess: *vpc.ClassicAccess, - isVPCStatus: *vpc.Status, - isVPCCRN: *vpc.CRN, - ResourceName: *vpc.Name, - ResourceCRN: *vpc.CRN, - ResourceStatus: *vpc.Status, - isVPCResourceGroup: *vpc.ResourceGroup.ID, + isVPCID: *vpc.ID, + isVPCName: *vpc.Name, + isVPCClassicAccess: *vpc.ClassicAccess, + isVPCStatus: *vpc.Status, + isVPCCRN: *vpc.CRN, + flex.ResourceName: *vpc.Name, + flex.ResourceCRN: *vpc.CRN, + flex.ResourceStatus: *vpc.Status, + isVPCResourceGroup: *vpc.ResourceGroup.ID, } if vpc.DefaultNetworkACL != nil { @@ -351,21 +353,21 @@ func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, l[isVPCDefaultSecurityGroupName] = *vpc.DefaultSecurityGroup.Name l[isVPCDefaultSecurityGroupCRN] = vpc.DefaultSecurityGroup.CRN } - tags, err := GetTagsUsingCRN(meta, *vpc.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *vpc.CRN) if err != nil { log.Printf( "An error occured during reading of vpc (%s) tags : %s", d.Id(), err) } l[isVPCTags] = tags - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return diag.FromErr(err) } - l[ResourceControllerURL] = controller + "/vpc-ext/network/vpcs" + l[flex.ResourceControllerURL] = controller + "/vpc-ext/network/vpcs" if vpc.ResourceGroup != nil { - l[ResourceGroupName] = *vpc.ResourceGroup.Name + l[flex.ResourceGroupName] = *vpc.ResourceGroup.Name } //set the cse ip addresses info if vpc.CseSourceIps != nil { @@ -388,13 +390,13 @@ func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, options := &vpcv1.ListSubnetsOptions{} for { if startSub != "" { - options.Start = &start + options.Start = &startSub } s, response, err := sess.ListSubnetsWithContext(context, options) if err != nil { - return diag.FromErr(fmt.Errorf("Error fetching subnets %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching subnets %s\n%s", err, response)) } - start = GetNext(s.Next) + startSub = flex.GetNext(s.Next) allrecsSub = append(allrecsSub, s.Subnets...) if startSub == "" { break @@ -418,7 +420,7 @@ func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, l[subnetsList] = subnetsInfo } - // adding pagination support for subnets inside vpc + // adding pagination support for sg inside vpc startSg := "" allrecsSg := []vpcv1.SecurityGroup{} @@ -433,12 +435,12 @@ func dataSourceIBMISVPCListRead(context context.Context, d *schema.ResourceData, } sgs, response, err := sess.ListSecurityGroupsWithContext(context, listSgOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error fetching Security Groups %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching Security Groups %s\n%s", err, response)) } if *sgs.TotalCount == int64(0) { break } - start = GetNext(sgs.Next) + start = flex.GetNext(sgs.Next) allrecsSg = append(allrecsSg, sgs.SecurityGroups...) if startSg == "" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go new file mode 100644 index 0000000000..532d8fca68 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway.go @@ -0,0 +1,454 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISVPNGateway() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsVPNGatewayRead, + + Schema: map[string]*schema.Schema{ + isVPNGatewayID: { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpn_gateway_name", isVPNGatewayID}, + Description: "The VPN gateway identifier.", + }, + "vpn_gateway_name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpn_gateway_name", isVPNGatewayID}, + Description: "The VPN gateway name.", + }, + "connections": { + Type: schema.TypeList, + Computed: true, + Description: "Connections for this VPN gateway.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and provides some supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this VPN gateway connection.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN connection.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this VPN gateway was created.", + }, + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN gateway's CRN.", + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN gateway's canonical URL.", + }, + "members": { + Type: schema.TypeList, + Computed: true, + Description: "Collection of VPN gateway members.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "private_ip_address": { + Type: schema.TypeString, + Computed: true, + Description: "The private IP address assigned to the VPN gateway member. This property will be present only when the VPN gateway status is`available`.", + }, + "public_ip_address": { + Type: schema.TypeString, + Computed: true, + Description: "The public IP address assigned to the VPN gateway member.", + }, + "role": { + Type: schema.TypeString, + Computed: true, + Description: "The high availability role assigned to the VPN gateway member.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the VPN gateway member.", + }, + }, + }, + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN gateway.", + }, + "resource_group": { + Type: schema.TypeList, + Computed: true, + Description: "The resource group for this VPN gateway.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this resource group.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this resource group.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this resource group.", + }, + }, + }, + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the VPN gateway.", + }, + "subnet": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "crn": { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this subnet.", + }, + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and provides some supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this subnet.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this subnet.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this subnet.", + }, + }, + }, + }, + "mode": { + Type: schema.TypeString, + Computed: true, + Description: "Route mode VPN gateway.", + }, + }, + } +} + +func dataSourceIBMIsVPNGatewayRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + + vpn_gateway_name := d.Get("vpn_gateway_name").(string) + vpn_gateway_id := d.Get("vpn_gateway").(string) + vpnGateway := &vpcv1.VPNGateway{} + if vpn_gateway_id != "" { + getVPNGatewayOptions := &vpcv1.GetVPNGatewayOptions{} + + getVPNGatewayOptions.SetID(vpn_gateway_id) + + vpnGatewayIntf, response, err := vpcClient.GetVPNGatewayWithContext(context, getVPNGatewayOptions) + if err != nil || vpnGatewayIntf.(*vpcv1.VPNGateway) == nil { + log.Printf("[DEBUG] GetVPNGatewayWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetVPNGatewayWithContext failed %s\n%s", err, response)) + } + vpnGateway = vpnGatewayIntf.(*vpcv1.VPNGateway) + } else { + listvpnGWOptions := vpcClient.NewListVPNGatewaysOptions() + + start := "" + allrecs := []vpcv1.VPNGatewayIntf{} + for { + if start != "" { + listvpnGWOptions.Start = &start + } + availableVPNGateways, detail, err := vpcClient.ListVPNGatewaysWithContext(context, listvpnGWOptions) + if err != nil || availableVPNGateways == nil { + return diag.FromErr(fmt.Errorf("Error reading list of VPN Gateways:%s\n%s", err, detail)) + } + start = flex.GetNext(availableVPNGateways.Next) + allrecs = append(allrecs, availableVPNGateways.VPNGateways...) + if start == "" { + break + } + } + vpn_gateway_found := false + for _, vpnGatewayIntfItem := range allrecs { + if *vpnGatewayIntfItem.(*vpcv1.VPNGateway).Name == vpn_gateway_name { + vpnGateway = vpnGatewayIntfItem.(*vpcv1.VPNGateway) + vpn_gateway_found = true + break + } + } + if !vpn_gateway_found { + log.Printf("[DEBUG] No vpn gateway found with given name %s", vpn_gateway_name) + return diag.FromErr(fmt.Errorf("No vpn gateway found with given name %s", vpn_gateway_name)) + } + } + d.SetId(*vpnGateway.ID) + + if vpnGateway.Connections != nil { + err = d.Set("connections", dataSourceVPNGatewayFlattenConnections(vpnGateway.Connections)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting connections %s", err)) + } + } + if err = d.Set("created_at", flex.DateTimeToString(vpnGateway.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + if err = d.Set("crn", vpnGateway.CRN); err != nil { + return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + } + if err = d.Set("href", vpnGateway.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + + if vpnGateway.Members != nil { + err = d.Set("members", dataSourceVPNGatewayFlattenMembers(vpnGateway.Members)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting members %s", err)) + } + } + if err = d.Set("name", vpnGateway.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + + if vpnGateway.ResourceGroup != nil { + err = d.Set("resource_group", dataSourceVPNGatewayFlattenResourceGroup(*vpnGateway.ResourceGroup)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_group %s", err)) + } + } + if err = d.Set("resource_type", vpnGateway.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + } + if err = d.Set("status", vpnGateway.Status); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + } + + if vpnGateway.Subnet != nil { + err = d.Set("subnet", dataSourceVPNGatewayFlattenSubnet(*vpnGateway.Subnet)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting subnet %s", err)) + } + } + if err = d.Set("mode", vpnGateway.Mode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting mode: %s", err)) + } + + return nil +} + +func dataSourceVPNGatewayFlattenConnections(result []vpcv1.VPNGatewayConnectionReference) (connections []map[string]interface{}) { + for _, connectionsItem := range result { + connections = append(connections, dataSourceVPNGatewayConnectionsToMap(connectionsItem)) + } + + return connections +} + +func dataSourceVPNGatewayConnectionsToMap(connectionsItem vpcv1.VPNGatewayConnectionReference) (connectionsMap map[string]interface{}) { + connectionsMap = map[string]interface{}{} + + if connectionsItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceVPNGatewayConnectionsDeletedToMap(*connectionsItem.Deleted) + deletedList = append(deletedList, deletedMap) + connectionsMap["deleted"] = deletedList + } + if connectionsItem.Href != nil { + connectionsMap["href"] = connectionsItem.Href + } + if connectionsItem.ID != nil { + connectionsMap["id"] = connectionsItem.ID + } + if connectionsItem.Name != nil { + connectionsMap["name"] = connectionsItem.Name + } + if connectionsItem.ResourceType != nil { + connectionsMap["resource_type"] = connectionsItem.ResourceType + } + + return connectionsMap +} + +func dataSourceVPNGatewayConnectionsDeletedToMap(deletedItem vpcv1.VPNGatewayConnectionReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceVPNGatewayFlattenMembers(result []vpcv1.VPNGatewayMember) (members []map[string]interface{}) { + for _, membersItem := range result { + members = append(members, dataSourceVPNGatewayMembersToMap(membersItem)) + } + + return members +} + +func dataSourceVPNGatewayMembersToMap(membersItem vpcv1.VPNGatewayMember) (membersMap map[string]interface{}) { + membersMap = map[string]interface{}{} + + if membersItem.PrivateIP != nil { + membersMap["private_ip_address"] = membersItem.PrivateIP.Address + } + if membersItem.PublicIP != nil { + membersMap["public_ip_address"] = membersItem.PublicIP.Address + } + if membersItem.Role != nil { + membersMap["role"] = membersItem.Role + } + if membersItem.Status != nil { + membersMap["status"] = membersItem.Status + } + + return membersMap +} + +func dataSourceVPNGatewayFlattenResourceGroup(result vpcv1.ResourceGroupReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceVPNGatewayResourceGroupToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceVPNGatewayResourceGroupToMap(resourceGroupItem vpcv1.ResourceGroupReference) (resourceGroupMap map[string]interface{}) { + resourceGroupMap = map[string]interface{}{} + + if resourceGroupItem.Href != nil { + resourceGroupMap["href"] = resourceGroupItem.Href + } + if resourceGroupItem.ID != nil { + resourceGroupMap["id"] = resourceGroupItem.ID + } + if resourceGroupItem.Name != nil { + resourceGroupMap["name"] = resourceGroupItem.Name + } + + return resourceGroupMap +} + +func dataSourceVPNGatewayFlattenSubnet(result vpcv1.SubnetReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceVPNGatewaySubnetToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceVPNGatewaySubnetToMap(subnetItem vpcv1.SubnetReference) (subnetMap map[string]interface{}) { + subnetMap = map[string]interface{}{} + + if subnetItem.CRN != nil { + subnetMap["crn"] = subnetItem.CRN + } + if subnetItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceVPNGatewaySubnetDeletedToMap(*subnetItem.Deleted) + deletedList = append(deletedList, deletedMap) + subnetMap["deleted"] = deletedList + } + if subnetItem.Href != nil { + subnetMap["href"] = subnetItem.Href + } + if subnetItem.ID != nil { + subnetMap["id"] = subnetItem.ID + } + if subnetItem.Name != nil { + subnetMap["name"] = subnetItem.Name + } + + return subnetMap +} + +func dataSourceVPNGatewaySubnetDeletedToMap(deletedItem vpcv1.SubnetReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go new file mode 100644 index 0000000000..92ac553630 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connection.go @@ -0,0 +1,551 @@ +// Copyright IBM Corp. 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/IBM/vpc-go-sdk/vpcv1" +) + +func DataSourceIBMISVPNGatewayConnection() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceIBMIsVPNGatewayConnectionRead, + + Schema: map[string]*schema.Schema{ + "vpn_gateway": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpn_gateway_name", "vpn_gateway"}, + Description: "The VPN gateway identifier.", + }, + "vpn_gateway_name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpn_gateway_name", "vpn_gateway"}, + Description: "The VPN gateway name.", + }, + "vpn_gateway_connection": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpn_gateway_connection", "vpn_gateway_connection_name"}, + Description: "The VPN gateway connection identifier.", + }, + "vpn_gateway_connection_name": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"vpn_gateway_connection", "vpn_gateway_connection_name"}, + Description: "The VPN gateway connection name.", + }, + "admin_state_up": { + Type: schema.TypeBool, + Computed: true, + Description: "If set to false, the VPN gateway connection is shut down.", + }, + "authentication_mode": { + Type: schema.TypeString, + Computed: true, + Description: "The authentication mode. Only `psk` is currently supported.", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The date and time that this VPN gateway connection was created.", + }, + "dead_peer_detection": { + Type: schema.TypeList, + Computed: true, + Description: "The Dead Peer Detection settings.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action": { + Type: schema.TypeString, + Computed: true, + Description: "Dead Peer Detection actions.", + }, + "interval": { + Type: schema.TypeInt, + Computed: true, + Description: "Dead Peer Detection interval in seconds.", + }, + "timeout": { + Type: schema.TypeInt, + Computed: true, + Description: "Dead Peer Detection timeout in seconds. Must be at least the interval.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The VPN connection's canonical URL.", + }, + "ike_policy": { + Type: schema.TypeList, + Computed: true, + Description: "The IKE policy. If absent, [auto-negotiation isused](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and provides some supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The IKE policy's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this IKE policy.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this IKE policy.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "ipsec_policy": { + Type: schema.TypeList, + Computed: true, + Description: "The IPsec policy. If absent, [auto-negotiation isused](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "deleted": { + Type: schema.TypeList, + Computed: true, + Description: "If present, this property indicates the referenced resource has been deleted and provides some supplementary information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "more_info": { + Type: schema.TypeString, + Computed: true, + Description: "Link to documentation about deleted resources.", + }, + }, + }, + }, + "href": { + Type: schema.TypeString, + Computed: true, + Description: "The IPsec policy's canonical URL.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this IPsec policy.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this IPsec policy.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + }, + }, + }, + "mode": { + Type: schema.TypeString, + Computed: true, + Description: "The mode of the VPN gateway.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this VPN gateway connection.", + }, + "peer_address": { + Type: schema.TypeString, + Computed: true, + Description: "The IP address of the peer VPN gateway.", + }, + "psk": { + Type: schema.TypeString, + Computed: true, + Description: "The preshared key.", + }, + "resource_type": { + Type: schema.TypeString, + Computed: true, + Description: "The resource type.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of a VPN gateway connection.", + }, + "routing_protocol": { + Type: schema.TypeString, + Computed: true, + Description: "Routing protocols are disabled for this VPN gateway connection.", + }, + "tunnels": { + Type: schema.TypeList, + Computed: true, + Description: "The VPN tunnel configuration for this VPN gateway connection (in static route mode).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "public_ip_address": { + Type: schema.TypeString, + Computed: true, + Description: "The IP address of the VPN gateway member in which the tunnel resides.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "The status of the VPN Tunnel.", + }, + }, + }, + }, + "local_cidrs": { + Type: schema.TypeList, + Computed: true, + Description: "The local CIDRs for this resource.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "peer_cidrs": { + Type: schema.TypeList, + Computed: true, + Description: "The peer CIDRs for this resource.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceIBMIsVPNGatewayConnectionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + vpcClient, err := meta.(conns.ClientSession).VpcV1API() + if err != nil { + return diag.FromErr(err) + } + vpn_gateway_id := d.Get("vpn_gateway").(string) + vpn_gateway_name := d.Get("vpn_gateway_name").(string) + vpn_gateway_connection := d.Get("vpn_gateway_connection").(string) + vpn_gateway_connection_name := d.Get("vpn_gateway_connection_name").(string) + + vpnGatewayConnection := &vpcv1.VPNGatewayConnection{} + + if vpn_gateway_name != "" { + listvpnGWOptions := vpcClient.NewListVPNGatewaysOptions() + + start := "" + allrecs := []vpcv1.VPNGatewayIntf{} + for { + if start != "" { + listvpnGWOptions.Start = &start + } + availableVPNGateways, detail, err := vpcClient.ListVPNGatewaysWithContext(context, listvpnGWOptions) + if err != nil || availableVPNGateways == nil { + return diag.FromErr(fmt.Errorf("Error reading list of VPN Gateways:%s\n%s", err, detail)) + } + start = flex.GetNext(availableVPNGateways.Next) + allrecs = append(allrecs, availableVPNGateways.VPNGateways...) + if start == "" { + break + } + } + vpn_gateway_found := false + for _, vpnGatewayIntfItem := range allrecs { + if *vpnGatewayIntfItem.(*vpcv1.VPNGateway).Name == vpn_gateway_name { + vpnGateway := vpnGatewayIntfItem.(*vpcv1.VPNGateway) + vpn_gateway_id = *vpnGateway.ID + vpn_gateway_found = true + break + } + } + if !vpn_gateway_found { + log.Printf("[DEBUG] No vpn gateway and connection found with given name %s", vpn_gateway_name) + return diag.FromErr(fmt.Errorf("No vpn gateway and connection found with given name %s", vpn_gateway_name)) + } + } + + if vpn_gateway_connection_name != "" { + listvpnGWConnectionOptions := vpcClient.NewListVPNGatewayConnectionsOptions(vpn_gateway_id) + + availableVPNGatewayConnections, detail, err := vpcClient.ListVPNGatewayConnections(listvpnGWConnectionOptions) + if err != nil || availableVPNGatewayConnections == nil { + return diag.FromErr(fmt.Errorf("Error reading list of VPN Gateway Connections:%s\n%s", err, detail)) + } + + vpn_gateway_conn_found := false + for _, connectionItem := range availableVPNGatewayConnections.Connections { + connection := connectionItem.(*vpcv1.VPNGatewayConnection) + if *connection.Name == vpn_gateway_connection_name { + vpnGatewayConnection = connection + vpn_gateway_conn_found = true + break + } + } + if !vpn_gateway_conn_found { + return diag.FromErr(fmt.Errorf("VPN gateway connection %s not found", vpn_gateway_connection_name)) + } + } else if vpn_gateway_connection != "" { + getVPNGatewayConnectionOptions := &vpcv1.GetVPNGatewayConnectionOptions{} + + getVPNGatewayConnectionOptions.SetVPNGatewayID(vpn_gateway_id) + getVPNGatewayConnectionOptions.SetID(vpn_gateway_connection) + + vpnGatewayConnectionIntf, response, err := vpcClient.GetVPNGatewayConnectionWithContext(context, getVPNGatewayConnectionOptions) + if err != nil || vpnGatewayConnectionIntf.(*vpcv1.VPNGatewayConnection) == nil { + log.Printf("[DEBUG] GetVPNGatewayConnectionWithContext failed %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("GetVPNGatewayConnectionWithContext failed %s\n%s", err, response)) + } + vpnGatewayConnection = vpnGatewayConnectionIntf.(*vpcv1.VPNGatewayConnection) + } + + d.SetId(fmt.Sprintf("%s/%s", vpn_gateway_id, *vpnGatewayConnection.ID)) + + if err = d.Set("admin_state_up", vpnGatewayConnection.AdminStateUp); err != nil { + return diag.FromErr(fmt.Errorf("Error setting admin_state_up: %s", err)) + } + if err = d.Set("authentication_mode", vpnGatewayConnection.AuthenticationMode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting authentication_mode: %s", err)) + } + if err = d.Set("created_at", flex.DateTimeToString(vpnGatewayConnection.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + } + + if vpnGatewayConnection.DeadPeerDetection != nil { + err = d.Set("dead_peer_detection", dataSourceVPNGatewayConnectionFlattenDeadPeerDetection(*vpnGatewayConnection.DeadPeerDetection)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting dead_peer_detection %s", err)) + } + } + if err = d.Set("href", vpnGatewayConnection.Href); err != nil { + return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + } + + if vpnGatewayConnection.IkePolicy != nil { + err = d.Set("ike_policy", dataSourceVPNGatewayConnectionFlattenIkePolicy(*vpnGatewayConnection.IkePolicy)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting ike_policy %s", err)) + } + } + + if vpnGatewayConnection.IpsecPolicy != nil { + err = d.Set("ipsec_policy", dataSourceVPNGatewayConnectionFlattenIpsecPolicy(*vpnGatewayConnection.IpsecPolicy)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting ipsec_policy %s", err)) + } + } + if err = d.Set("mode", vpnGatewayConnection.Mode); err != nil { + return diag.FromErr(fmt.Errorf("Error setting mode: %s", err)) + } + if err = d.Set("name", vpnGatewayConnection.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if err = d.Set("peer_address", vpnGatewayConnection.PeerAddress); err != nil { + return diag.FromErr(fmt.Errorf("Error setting peer_address: %s", err)) + } + if err = d.Set("psk", vpnGatewayConnection.Psk); err != nil { + return diag.FromErr(fmt.Errorf("Error setting psk: %s", err)) + } + if err = d.Set("resource_type", vpnGatewayConnection.ResourceType); err != nil { + return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + } + if err = d.Set("status", vpnGatewayConnection.Status); err != nil { + return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + } + if err = d.Set("routing_protocol", vpnGatewayConnection.RoutingProtocol); err != nil { + return diag.FromErr(fmt.Errorf("Error setting routing_protocol: %s", err)) + } + + if vpnGatewayConnection.Tunnels != nil { + err = d.Set("tunnels", dataSourceVPNGatewayConnectionFlattenTunnels(vpnGatewayConnection.Tunnels)) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting tunnels %s", err)) + } + } + + if len(vpnGatewayConnection.LocalCIDRs) > 0 { + err = d.Set("local_cidrs", vpnGatewayConnection.LocalCIDRs) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting local CIDRs %s", err)) + } + } + + if len(vpnGatewayConnection.PeerCIDRs) > 0 { + err = d.Set("peer_cidrs", vpnGatewayConnection.PeerCIDRs) + if err != nil { + return diag.FromErr(fmt.Errorf("Error setting Peer CIDRs %s", err)) + } + } + return nil +} + +func dataSourceVPNGatewayConnectionFlattenDeadPeerDetection(result vpcv1.VPNGatewayConnectionDpd) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceVPNGatewayConnectionDeadPeerDetectionToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceVPNGatewayConnectionDeadPeerDetectionToMap(deadPeerDetectionItem vpcv1.VPNGatewayConnectionDpd) (deadPeerDetectionMap map[string]interface{}) { + deadPeerDetectionMap = map[string]interface{}{} + + if deadPeerDetectionItem.Action != nil { + deadPeerDetectionMap["action"] = deadPeerDetectionItem.Action + } + if deadPeerDetectionItem.Interval != nil { + deadPeerDetectionMap["interval"] = deadPeerDetectionItem.Interval + } + if deadPeerDetectionItem.Timeout != nil { + deadPeerDetectionMap["timeout"] = deadPeerDetectionItem.Timeout + } + + return deadPeerDetectionMap +} + +func dataSourceVPNGatewayConnectionFlattenIkePolicy(result vpcv1.IkePolicyReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceVPNGatewayConnectionIkePolicyToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceVPNGatewayConnectionIkePolicyToMap(ikePolicyItem vpcv1.IkePolicyReference) (ikePolicyMap map[string]interface{}) { + ikePolicyMap = map[string]interface{}{} + + if ikePolicyItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceVPNGatewayConnectionIkePolicyDeletedToMap(*ikePolicyItem.Deleted) + deletedList = append(deletedList, deletedMap) + ikePolicyMap["deleted"] = deletedList + } + if ikePolicyItem.Href != nil { + ikePolicyMap["href"] = ikePolicyItem.Href + } + if ikePolicyItem.ID != nil { + ikePolicyMap["id"] = ikePolicyItem.ID + } + if ikePolicyItem.Name != nil { + ikePolicyMap["name"] = ikePolicyItem.Name + } + if ikePolicyItem.ResourceType != nil { + ikePolicyMap["resource_type"] = ikePolicyItem.ResourceType + } + + return ikePolicyMap +} + +func dataSourceVPNGatewayConnectionIkePolicyDeletedToMap(deletedItem vpcv1.IkePolicyReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceVPNGatewayConnectionFlattenIpsecPolicy(result vpcv1.IPsecPolicyReference) (finalList []map[string]interface{}) { + finalList = []map[string]interface{}{} + finalMap := dataSourceVPNGatewayConnectionIpsecPolicyToMap(result) + finalList = append(finalList, finalMap) + + return finalList +} + +func dataSourceVPNGatewayConnectionIpsecPolicyToMap(ipsecPolicyItem vpcv1.IPsecPolicyReference) (ipsecPolicyMap map[string]interface{}) { + ipsecPolicyMap = map[string]interface{}{} + + if ipsecPolicyItem.Deleted != nil { + deletedList := []map[string]interface{}{} + deletedMap := dataSourceVPNGatewayConnectionIpsecPolicyDeletedToMap(*ipsecPolicyItem.Deleted) + deletedList = append(deletedList, deletedMap) + ipsecPolicyMap["deleted"] = deletedList + } + if ipsecPolicyItem.Href != nil { + ipsecPolicyMap["href"] = ipsecPolicyItem.Href + } + if ipsecPolicyItem.ID != nil { + ipsecPolicyMap["id"] = ipsecPolicyItem.ID + } + if ipsecPolicyItem.Name != nil { + ipsecPolicyMap["name"] = ipsecPolicyItem.Name + } + if ipsecPolicyItem.ResourceType != nil { + ipsecPolicyMap["resource_type"] = ipsecPolicyItem.ResourceType + } + + return ipsecPolicyMap +} + +func dataSourceVPNGatewayConnectionIpsecPolicyDeletedToMap(deletedItem vpcv1.IPsecPolicyReferenceDeleted) (deletedMap map[string]interface{}) { + deletedMap = map[string]interface{}{} + + if deletedItem.MoreInfo != nil { + deletedMap["more_info"] = deletedItem.MoreInfo + } + + return deletedMap +} + +func dataSourceVPNGatewayConnectionFlattenTunnels(result []vpcv1.VPNGatewayConnectionStaticRouteModeTunnel) (tunnels []map[string]interface{}) { + for _, tunnelsItem := range result { + tunnels = append(tunnels, dataSourceVPNGatewayConnectionTunnelsToMap(tunnelsItem)) + } + + return tunnels +} + +func dataSourceVPNGatewayConnectionTunnelsToMap(tunnelsItem vpcv1.VPNGatewayConnectionStaticRouteModeTunnel) (tunnelsMap map[string]interface{}) { + tunnelsMap = map[string]interface{}{} + + if tunnelsItem.PublicIP != nil { + tunnelsMap["public_ip_address"] = tunnelsItem.PublicIP.Address + } + if tunnelsItem.Status != nil { + tunnelsMap["status"] = tunnelsItem.Status + } + + return tunnelsMap +} + +func dataSourceVPNGatewayConnectionTunnelsPublicIPToMap(publicIPItem vpcv1.IP) (publicIPMap map[string]interface{}) { + publicIPMap = map[string]interface{}{} + + if publicIPItem.Address != nil { + publicIPMap["address"] = publicIPItem.Address + } + + return publicIPMap +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpn_gateway_connections.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go similarity index 94% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpn_gateway_connections.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go index d594361ed0..b185258331 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpn_gateway_connections.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateway_connections.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -17,7 +18,7 @@ const ( isVPNGatewayConnectionID = "id" ) -func dataSourceIBMISVPNGatewayConnections() *schema.Resource { +func DataSourceIBMISVPNGatewayConnections() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMVPNGatewayConnectionsRead, @@ -163,7 +164,7 @@ func dataSourceIBMVPNGatewayConnectionsRead(d *schema.ResourceData, meta interfa availableVPNGatewayConnections, detail, err := sess.ListVPNGatewayConnections(listvpnGWConnectionOptions) if err != nil { - return fmt.Errorf("Error reading list of VPN Gateway Connections:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of VPN Gateway Connections:%s\n%s", err, detail) } vpngatewayconnections := make([]map[string]interface{}, 0) for _, instance := range availableVPNGatewayConnections.Connections { @@ -184,10 +185,10 @@ func dataSourceIBMVPNGatewayConnectionsRead(d *schema.ResourceData, meta interfa gatewayconnection[isVPNGatewayConnectionIPSECPolicy] = *data.IpsecPolicy.ID } if data.LocalCIDRs != nil { - gatewayconnection[isVPNGatewayConnectionLocalCIDRS] = flattenStringList(data.LocalCIDRs) + gatewayconnection[isVPNGatewayConnectionLocalCIDRS] = flex.FlattenStringList(data.LocalCIDRs) } if data.PeerCIDRs != nil { - gatewayconnection[isVPNGatewayConnectionPeerCIDRS] = flattenStringList(data.PeerCIDRs) + gatewayconnection[isVPNGatewayConnectionPeerCIDRS] = flex.FlattenStringList(data.PeerCIDRs) } gatewayconnection[isVPNGatewayConnectionMode] = *data.Mode gatewayconnection[isVPNGatewayConnectionName] = *data.Name diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpn_gateways.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpn_gateways.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go index cdd5f70d13..30aed92b7a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_vpn_gateways.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_vpn_gateways.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -17,7 +18,7 @@ const ( isVPNGatewayCrn = "crn" ) -func dataSourceIBMISVPNGateways() *schema.Resource { +func DataSourceIBMISVPNGateways() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMVPNGatewaysRead, @@ -128,9 +129,9 @@ func dataSourceIBMVPNGatewaysRead(d *schema.ResourceData, meta interface{}) erro } availableVPNGateways, detail, err := sess.ListVPNGateways(listvpnGWOptions) if err != nil { - return fmt.Errorf("Error reading list of VPN Gateways:%s\n%s", err, detail) + return fmt.Errorf("[ERROR] Error reading list of VPN Gateways:%s\n%s", err, detail) } - start = GetNext(availableVPNGateways.Next) + start = flex.GetNext(availableVPNGateways.Next) allrecs = append(allrecs, availableVPNGateways.VPNGateways...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_zone.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_zone.go similarity index 96% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_zone.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_zone.go index e99158048b..fe89424be4 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_zone.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_zone.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -16,7 +16,7 @@ const ( isZoneStatus = "status" ) -func dataSourceIBMISZone() *schema.Resource { +func DataSourceIBMISZone() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISZoneRead, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_zones.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_zones.go similarity index 97% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_zones.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_zones.go index 5b2c92d546..0772cb4108 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_is_zones.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/data_source_ibm_is_zones.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "time" @@ -14,7 +14,7 @@ const ( isZoneNames = "zones" ) -func dataSourceIBMISZones() *schema.Resource { +func DataSourceIBMISZones() *schema.Resource { return &schema.Resource{ Read: dataSourceIBMISZonesRead, diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server.go new file mode 100644 index 0000000000..891ebd8375 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server.go @@ -0,0 +1,1414 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "os" + "reflect" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerAction = "action" + isBareMetalServerBandwidth = "bandwidth" + isBareMetalServerBootTarget = "boot_target" + isBareMetalServerCreatedAt = "created_at" + isBareMetalServerCPU = "cpu" + isBareMetalServerCPUArchitecture = "architecture" + isBareMetalServerCPUCoreCount = "core_count" + isBareMetalServerCpuSocketCount = "socket_count" + isBareMetalServerCpuThreadPerCore = "threads_per_core" + isBareMetalServerCRN = "crn" + isBareMetalServerDisks = "disks" + isBareMetalServerDiskID = "id" + isBareMetalServerDiskSize = "size" + isBareMetalServerDiskName = "name" + isBareMetalServerDiskInterfaceType = "interface_type" + isBareMetalServerHref = "href" + isBareMetalServerMemory = "memory" + isBareMetalServerTags = "tags" + isBareMetalServerName = "name" + isBareMetalServerNetworkInterfaces = "network_interfaces" + isBareMetalServerPrimaryNetworkInterface = "primary_network_interface" + isBareMetalServerProfile = "profile" + isBareMetalServerResourceGroup = "resource_group" + isBareMetalServerResourceType = "resource_type" + isBareMetalServerStatus = "status" + isBareMetalServerStatusReasons = "status_reasons" + isBareMetalServerVPC = "vpc" + isBareMetalServerZone = "zone" + isBareMetalServerStatusReasonsCode = "code" + isBareMetalServerStatusReasonsMessage = "message" + isBareMetalServerDeleteType = "delete_type" + isBareMetalServerImage = "image" + isBareMetalServerKeys = "keys" + isBareMetalServerUserData = "user_data" + isBareMetalServerNicName = "name" + isBareMetalServerNicPortSpeed = "port_speed" + isBareMetalServerNicAllowIPSpoofing = "allow_ip_spoofing" + isBareMetalServerNicSecurityGroups = "security_groups" + isBareMetalServerNicSubnet = "subnet" + isBareMetalServerUserAccounts = "user_accounts" + isBareMetalServerActionDeleting = "deleting" + isBareMetalServerActionDeleted = "deleted" + isBareMetalServerActionStatusStopping = "stopping" + isBareMetalServerActionStatusStopped = "stopped" + isBareMetalServerActionStatusStarting = "starting" + isBareMetalServerStatusRunning = "running" + isBareMetalServerStatusPending = "pending" + isBareMetalServerStatusRestarting = "restarting" + isBareMetalServerStatusFailed = "failed" +) + +func ResourceIBMIsBareMetalServer() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISBareMetalServerCreate, + ReadContext: resourceIBMISBareMetalServerRead, + UpdateContext: resourceIBMISBareMetalServerUpdate, + DeleteContext: resourceIBMISBareMetalServerDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + CustomizeDiff: customdiff.All( + customdiff.Sequence( + func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { + return flex.ResourceTagsCustomizeDiff(diff) + }, + ), + ), + + Schema: map[string]*schema.Schema{ + + isBareMetalServerName: { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", isBareMetalServerName), + Description: "Bare metal server name", + }, + + isBareMetalServerAction: { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", isBareMetalServerAction), + Description: "This restart/start/stops a bare metal server.", + }, + isBareMetalServerBandwidth: { + Type: schema.TypeInt, + Computed: true, + Description: "The total bandwidth (in megabits per second)", + }, + isBareMetalServerBootTarget: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + + isBareMetalServerCPU: { + Type: schema.TypeList, + Computed: true, + Description: "The bare metal server CPU configuration", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerCPUArchitecture: { + Type: schema.TypeString, + Computed: true, + Description: "The CPU architecture", + }, + isBareMetalServerCPUCoreCount: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of cores", + }, + isBareMetalServerCpuSocketCount: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of CPU sockets", + }, + isBareMetalServerCpuThreadPerCore: { + Type: schema.TypeInt, + Computed: true, + Description: "The total number of hardware threads per core", + }, + }, + }, + }, + isBareMetalServerCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The CRN for this bare metal server", + }, + isBareMetalServerDisks: { + Type: schema.TypeList, + Computed: true, + Description: "The disks for this bare metal server, including any disks that are associated with the boot_target.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerDiskHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server disk", + }, + isBareMetalServerDiskID: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier for this bare metal server disk", + }, + isBareMetalServerDiskInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The disk interface used for attaching the disk. Supported values are [ nvme, sata ]", + }, + isBareMetalServerDiskName: { + Type: schema.TypeString, + Computed: true, + Description: "The user-defined name for this disk", + }, + isBareMetalServerDiskResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type", + }, + isBareMetalServerDiskSize: { + Type: schema.TypeInt, + Computed: true, + Description: "The size of the disk in GB (gigabytes)", + }, + }, + }, + }, + isBareMetalServerHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this bare metal server", + }, + isBareMetalServerMemory: { + Type: schema.TypeInt, + Computed: true, + Description: "The amount of memory, truncated to whole gibibytes", + }, + isBareMetalServerDeleteType: { + Type: schema.TypeString, + Optional: true, + Default: "hard", + Description: "Enables stopping type of the bare metal server before deleting", + }, + isBareMetalServerPrimaryNetworkInterface: { + Type: schema.TypeList, + MinItems: 1, + MaxItems: 1, + Required: true, + Description: "Primary Network interface info", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicEnableInfraNAT: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + }, + isBareMetalServerNicInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The network interface type: [ pci, vlan ]", + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Optional: true, + MinItems: 0, + MaxItems: 1, + Computed: true, + Description: "title: IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates whether IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + isBareMetalServerNicAllowedVlans: { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeInt}, + Set: schema.HashInt, + Description: "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + }, + }, + }, + }, + + isBareMetalServerNetworkInterfaces: { + Type: schema.TypeList, + Optional: true, + DiffSuppressFunc: flex.ApplyOnce, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates whether IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The user-defined name for this network interface. If unspecified, the name will be a hyphenated list of randomly-selected words", + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicEnableInfraNAT: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + DiffSuppressFunc: flex.ApplyOnce, + Description: "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + }, + isBareMetalServerNicInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The network interface type: [ pci, vlan ]", + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + MinItems: 0, + MaxItems: 1, + Optional: true, + Computed: true, + Description: "title: IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Collection of security group ids", + }, + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Required: true, + ForceNew: false, + DiffSuppressFunc: flex.ApplyOnce, + Description: "The associated subnet", + }, + isBareMetalServerNicAllowedVlans: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeInt}, + Set: schema.HashInt, + Description: "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + }, + + isBareMetalServerNicAllowInterfaceToFloat: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + }, + + isBareMetalServerNicVlan: { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", + }, + }, + }, + }, + + isBareMetalServerKeys: { + Type: schema.TypeSet, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + DiffSuppressFunc: flex.ApplyOnce, + Description: "SSH key Ids for the bare metal server", + }, + + isBareMetalServerImage: { + Type: schema.TypeString, + ForceNew: true, + Required: true, + Description: "image id", + }, + isBareMetalServerProfile: { + Type: schema.TypeString, + ForceNew: true, + Required: true, + Description: "profile name", + }, + + isBareMetalServerUserData: { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + Description: "User data given for the bare metal server", + }, + + isBareMetalServerZone: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Zone name", + }, + + isBareMetalServerVPC: { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Description: "The VPC the bare metal server is to be a part of", + }, + + isBareMetalServerResourceGroup: { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Resource group name", + }, + isBareMetalServerResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "Resource type name", + }, + + isBareMetalServerStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Bare metal server status", + }, + + isBareMetalServerStatusReasons: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerStatusReasonsCode: { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason", + }, + + isBareMetalServerStatusReasonsMessage: { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason", + }, + }, + }, + }, + isBareMetalServerTags: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", "tag")}, + Set: flex.ResourceIBMVPCHash, + Description: "Tags for the Bare metal server", + }, + }, + } +} + +func ResourceIBMIsBareMetalServerValidator() *validate.ResourceValidator { + bareMetalServerActions := "start, restart, stop" + validateSchema := make([]validate.ValidateSchema, 1) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, + MinValueLength: 1, + MaxValueLength: 63}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "tag", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^[A-Za-z0-9:_ .-]+$`, + MinValueLength: 1, + MaxValueLength: 128}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerAction, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: bareMetalServerActions}) + ibmISBareMetalServerResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_bare_metal_server", Schema: validateSchema} + return &ibmISBareMetalServerResourceValidator +} + +func resourceIBMISBareMetalServerCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.CreateBareMetalServerOptions{} + var imageStr string + if image, ok := d.GetOk(isBareMetalServerImage); ok { + imageStr = image.(string) + } + keySet := d.Get(isInstanceKeys).(*schema.Set) + if keySet.Len() != 0 { + keyobjs := make([]vpcv1.KeyIdentityIntf, keySet.Len()) + for i, key := range keySet.List() { + keystr := key.(string) + keyobjs[i] = &vpcv1.KeyIdentity{ + ID: &keystr, + } + } + options.Initialization = &vpcv1.BareMetalServerInitializationPrototype{ + Image: &vpcv1.ImageIdentity{ + ID: &imageStr, + }, + Keys: keyobjs, + } + if userdata, ok := d.GetOk(isBareMetalServerUserData); ok { + userdatastr := userdata.(string) + options.Initialization.UserData = &userdatastr + } + } + + if name, ok := d.GetOk(isBareMetalServerName); ok { + nameStr := name.(string) + options.Name = &nameStr + } + + if primnicintf, ok := d.GetOk(isBareMetalServerPrimaryNetworkInterface); ok && len(primnicintf.([]interface{})) > 0 { + primnic := primnicintf.([]interface{})[0].(map[string]interface{}) + subnetintf, _ := primnic[isBareMetalServerNicSubnet] + subnetintfstr := subnetintf.(string) + var primnicobj = &vpcv1.BareMetalServerPrimaryNetworkInterfacePrototype{} + primnicobj.Subnet = &vpcv1.SubnetIdentity{ + ID: &subnetintfstr, + } + name, _ := primnic[isBareMetalServerNicName] + namestr := name.(string) + if namestr != "" { + primnicobj.Name = &namestr + } + + if primaryIpIntf, ok := primnic[isBareMetalServerNicPrimaryIP]; ok && len(primaryIpIntf.([]interface{})) > 0 { + primaryIp := primaryIpIntf.([]interface{})[0].(map[string]interface{}) + reservedIpAddressOk, ok := primaryIp[isBareMetalServerNicIpAddress] + if ok && reservedIpAddressOk.(string) != "" { + reservedIpAddress := reservedIpAddressOk.(string) + primnicobj.PrimaryIpv4Address = &reservedIpAddress + } + } + + allowIPSpoofing, ok := primnic[isBareMetalServerNicAllowIPSpoofing] + + if ok && allowIPSpoofing != nil { + allowIPSpoofingbool := allowIPSpoofing.(bool) + if allowIPSpoofingbool { + primnicobj.AllowIPSpoofing = &allowIPSpoofingbool + } + } + enableInfraNATbool := true + enableInfraNAT, ok := primnic[isBareMetalServerNicEnableInfraNAT] + if ok && enableInfraNAT != nil { + enableInfraNATbool = enableInfraNAT.(bool) + primnicobj.EnableInfrastructureNat = &enableInfraNATbool + } + + secgrpintf, ok := primnic[isBareMetalServerNicSecurityGroups] + if ok { + secgrpSet := secgrpintf.(*schema.Set) + if secgrpSet.Len() != 0 { + var secgrpobjs = make([]vpcv1.SecurityGroupIdentityIntf, secgrpSet.Len()) + for i, secgrpIntf := range secgrpSet.List() { + secgrpIntfstr := secgrpIntf.(string) + secgrpobjs[i] = &vpcv1.SecurityGroupIdentity{ + ID: &secgrpIntfstr, + } + } + primnicobj.SecurityGroups = secgrpobjs + } + } + + if allowedVlansOk, ok := primnic[isBareMetalServerNicAllowedVlans]; ok { + allowedVlansList := allowedVlansOk.(*schema.Set).List() + + allowedVlans := make([]int64, 0, len(allowedVlansList)) + for _, k := range allowedVlansList { + allowedVlans = append(allowedVlans, int64(k.(int))) + } + primnicobj.AllowedVlans = allowedVlans + interfaceType := "pci" + primnicobj.InterfaceType = &interfaceType + } + options.PrimaryNetworkInterface = primnicobj + } + + if nicsintf, ok := d.GetOk(isBareMetalServerNetworkInterfaces); ok { + nics := nicsintf.([]interface{}) + for _, resource := range nics { + nic := resource.(map[string]interface{}) + interfaceType := "" + if allowedVlansOk, ok := nic[isBareMetalServerNicAllowedVlans]; ok { + interfaceType = "pci" + var nicobj = &vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype{} + nicobj.InterfaceType = &interfaceType + + allowedVlansList := allowedVlansOk.(*schema.Set).List() + + allowedVlans := make([]int64, 0, len(allowedVlansList)) + for _, k := range allowedVlansList { + allowedVlans = append(allowedVlans, int64(k.(int))) + } + nicobj.AllowedVlans = allowedVlans + + subnetintf, _ := nic[isBareMetalServerNicSubnet] + subnetintfstr := subnetintf.(string) + nicobj.Subnet = &vpcv1.SubnetIdentity{ + ID: &subnetintfstr, + } + name, _ := nic[isBareMetalServerNicName] + namestr := name.(string) + if namestr != "" { + nicobj.Name = &namestr + } + + enableInfraNAT, ok := nic[isBareMetalServerNicEnableInfraNAT] + enableInfraNATbool := enableInfraNAT.(bool) + if ok { + nicobj.EnableInfrastructureNat = &enableInfraNATbool + } + + if primaryIpIntf, ok := nic[isBareMetalServerNicPrimaryIP]; ok && len(primaryIpIntf.([]interface{})) > 0 { + primaryIp := primaryIpIntf.([]interface{})[0].(map[string]interface{}) + reservedIpAddressOk, ok := primaryIp[isBareMetalServerNicIpAddress] + if ok && reservedIpAddressOk.(string) != "" { + reservedIpAddress := reservedIpAddressOk.(string) + nicobj.PrimaryIpv4Address = &reservedIpAddress + } + } + + allowIPSpoofing, ok := nic[isBareMetalServerNicAllowIPSpoofing] + allowIPSpoofingbool := allowIPSpoofing.(bool) + if ok && allowIPSpoofingbool { + nicobj.AllowIPSpoofing = &allowIPSpoofingbool + } + secgrpintf, ok := nic[isBareMetalServerNicSecurityGroups] + if ok { + secgrpSet := secgrpintf.(*schema.Set) + if secgrpSet.Len() != 0 { + var secgrpobjs = make([]vpcv1.SecurityGroupIdentityIntf, secgrpSet.Len()) + for i, secgrpIntf := range secgrpSet.List() { + secgrpIntfstr := secgrpIntf.(string) + secgrpobjs[i] = &vpcv1.SecurityGroupIdentity{ + ID: &secgrpIntfstr, + } + } + nicobj.SecurityGroups = secgrpobjs + } + } + } else { + interfaceType = "vlan" + var nicobj = &vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{} + nicobj.InterfaceType = &interfaceType + + if aitf, ok := nic[isBareMetalServerNicAllowInterfaceToFloat]; ok { + allowInterfaceToFloat := aitf.(bool) + nicobj.AllowInterfaceToFloat = &allowInterfaceToFloat + } + if vlan, ok := nic[isBareMetalServerNicVlan]; ok { + vlanInt := int64(vlan.(int)) + nicobj.Vlan = &vlanInt + } + + subnetintf, _ := nic[isBareMetalServerNicSubnet] + subnetintfstr := subnetintf.(string) + nicobj.Subnet = &vpcv1.SubnetIdentity{ + ID: &subnetintfstr, + } + name, _ := nic[isBareMetalServerNicName] + namestr := name.(string) + if namestr != "" { + nicobj.Name = &namestr + } + + enableInfraNAT, ok := nic[isBareMetalServerNicEnableInfraNAT] + enableInfraNATbool := enableInfraNAT.(bool) + if ok { + nicobj.EnableInfrastructureNat = &enableInfraNATbool + } + + if primaryIpIntf, ok := nic[isBareMetalServerNicPrimaryIP]; ok && len(primaryIpIntf.([]interface{})) > 0 { + primaryIp := primaryIpIntf.([]interface{})[0].(map[string]interface{}) + reservedIpAddressOk, ok := primaryIp[isBareMetalServerNicIpAddress] + if ok && reservedIpAddressOk.(string) != "" { + reservedIpAddress := reservedIpAddressOk.(string) + nicobj.PrimaryIpv4Address = &reservedIpAddress + } + } + + allowIPSpoofing, ok := nic[isBareMetalServerNicAllowIPSpoofing] + allowIPSpoofingbool := allowIPSpoofing.(bool) + if ok && allowIPSpoofingbool { + nicobj.AllowIPSpoofing = &allowIPSpoofingbool + } + secgrpintf, ok := nic[isBareMetalServerNicSecurityGroups] + if ok { + secgrpSet := secgrpintf.(*schema.Set) + if secgrpSet.Len() != 0 { + var secgrpobjs = make([]vpcv1.SecurityGroupIdentityIntf, secgrpSet.Len()) + for i, secgrpIntf := range secgrpSet.List() { + secgrpIntfstr := secgrpIntf.(string) + secgrpobjs[i] = &vpcv1.SecurityGroupIdentity{ + ID: &secgrpIntfstr, + } + } + nicobj.SecurityGroups = secgrpobjs + } + } + } + } + } + + if rgrp, ok := d.GetOk(isBareMetalServerResourceGroup); ok { + rg := rgrp.(string) + options.ResourceGroup = &vpcv1.ResourceGroupIdentity{ + ID: &rg, + } + } + + if p, ok := d.GetOk(isBareMetalServerProfile); ok { + profile := p.(string) + options.Profile = &vpcv1.BareMetalServerProfileIdentity{ + Name: &profile, + } + } + + if z, ok := d.GetOk(isBareMetalServerZone); ok { + zone := z.(string) + options.Zone = &vpcv1.ZoneIdentity{ + Name: &zone, + } + } + + if v, ok := d.GetOk(isBareMetalServerVPC); ok { + vpc := v.(string) + options.VPC = &vpcv1.VPCIdentity{ + ID: &vpc, + } + } + + bms, response, err := sess.CreateBareMetalServerWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("[DEBUG] Create bare metal server err %s\n%s", err, response)) + } + d.SetId(*bms.ID) + log.Printf("[INFO] Bare Metal Server : %s", *bms.ID) + _, err = isWaitForBareMetalServerAvailable(sess, d.Id(), d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return diag.FromErr(err) + } + v := os.Getenv("IC_ENV_TAGS") + if _, ok := d.GetOk(isBareMetalServerTags); ok || v != "" { + oldList, newList := d.GetChange(isBareMetalServerTags) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *bms.CRN) + if err != nil { + log.Printf( + "[ERROR] Error on create of resource bare metal server (%s) tags: %s", d.Id(), err) + } + } + + return resourceIBMISBareMetalServerRead(context, d, meta) +} + +func resourceIBMISBareMetalServerRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Id() + err := bareMetalServerGet(context, d, meta, id) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func bareMetalServerGet(context context.Context, d *schema.ResourceData, meta interface{}, id string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + options := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := sess.GetBareMetalServerWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s): %s\n%s", id, err, response) + } + d.SetId(*bms.ID) + d.Set(isBareMetalServerBandwidth, bms.Bandwidth) + bmsBootTargetIntf := bms.BootTarget.(*vpcv1.BareMetalServerBootTarget) + bmsBootTarget := bmsBootTargetIntf.ID + d.Set(isBareMetalServerBootTarget, bmsBootTarget) + cpuList := make([]map[string]interface{}, 0) + if bms.Cpu != nil { + currentCPU := map[string]interface{}{} + currentCPU[isBareMetalServerCPUArchitecture] = *bms.Cpu.Architecture + currentCPU[isBareMetalServerCPUCoreCount] = *bms.Cpu.CoreCount + currentCPU[isBareMetalServerCpuSocketCount] = *bms.Cpu.SocketCount + currentCPU[isBareMetalServerCpuThreadPerCore] = *bms.Cpu.ThreadsPerCore + cpuList = append(cpuList, currentCPU) + } + d.Set(isBareMetalServerCPU, cpuList) + d.Set(isBareMetalServerCRN, *bms.CRN) + + diskList := make([]map[string]interface{}, 0) + if bms.Disks != nil { + for _, disk := range bms.Disks { + currentDisk := map[string]interface{}{ + isBareMetalServerDiskHref: disk.Href, + isBareMetalServerDiskID: disk.ID, + isBareMetalServerDiskInterfaceType: disk.InterfaceType, + isBareMetalServerDiskName: disk.Name, + isBareMetalServerDiskResourceType: disk.ResourceType, + isBareMetalServerDiskSize: disk.Size, + } + diskList = append(diskList, currentDisk) + } + } + d.Set(isBareMetalServerDisks, diskList) + d.Set(isBareMetalServerHref, *bms.Href) + d.Set(isBareMetalServerMemory, *bms.Memory) + d.Set(isBareMetalServerName, *bms.Name) + //pni + + if bms.PrimaryNetworkInterface != nil { + primaryNicList := make([]map[string]interface{}, 0) + currentPrimNic := map[string]interface{}{} + currentPrimNic["id"] = *bms.PrimaryNetworkInterface.ID + currentPrimNic[isBareMetalServerNicName] = *bms.PrimaryNetworkInterface.Name + currentPrimNic[isBareMetalServerNicHref] = *bms.PrimaryNetworkInterface.Href + currentPrimNic[isBareMetalServerNicSubnet] = *bms.PrimaryNetworkInterface.Subnet.ID + getnicoptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &id, + ID: bms.PrimaryNetworkInterface.ID, + } + bmsnic, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, getnicoptions) + + if err != nil { + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the bare metal server %s\n%s", err, response) + } + + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *bms.PrimaryNetworkInterface.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + currentPrimNic[isBareMetalServerNicPrimaryIP] = primaryIpList + + switch reflect.TypeOf(bmsnic).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + primNic := bmsnic.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + currentPrimNic[isInstanceNicAllowIPSpoofing] = *primNic.AllowIPSpoofing + currentPrimNic[isBareMetalServerNicEnableInfraNAT] = *primNic.EnableInfrastructureNat + currentPrimNic[isBareMetalServerNicPortSpeed] = *primNic.PortSpeed + if len(primNic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(primNic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(primNic.SecurityGroups[i].ID))) + } + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + + if primNic.AllowedVlans != nil { + var out = make([]interface{}, len(primNic.AllowedVlans), len(primNic.AllowedVlans)) + for i, v := range primNic.AllowedVlans { + out[i] = int(v) + } + currentPrimNic[isBareMetalServerNicAllowedVlans] = schema.NewSet(schema.HashInt, out) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + primNic := bmsnic.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + currentPrimNic[isInstanceNicAllowIPSpoofing] = *primNic.AllowIPSpoofing + currentPrimNic[isBareMetalServerNicEnableInfraNAT] = *primNic.EnableInfrastructureNat + + if len(primNic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(primNic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(primNic.SecurityGroups[i].ID))) + } + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + } + + primaryNicList = append(primaryNicList, currentPrimNic) + d.Set(isBareMetalServerPrimaryNetworkInterface, primaryNicList) + } + + //ni + + interfacesList := make([]map[string]interface{}, 0) + for _, intfc := range bms.NetworkInterfaces { + if *intfc.ID != *bms.PrimaryNetworkInterface.ID { + currentNic := map[string]interface{}{} + currentNic["id"] = *intfc.ID + currentNic[isBareMetalServerNicName] = *intfc.Name + getnicoptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &id, + ID: intfc.ID, + } + bmsnicintf, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, getnicoptions) + if err != nil { + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the bare metal server %s\n%s", err, response) + } + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + isBareMetalServerNicIpAddress: *intfc.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + currentNic[isBareMetalServerNicPrimaryIP] = primaryIpList + switch reflect.TypeOf(bmsnicintf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + bmsnic := bmsnicintf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + currentNic[isBareMetalServerNicAllowIPSpoofing] = *bmsnic.AllowIPSpoofing + currentNic[isBareMetalServerNicEnableInfraNAT] = *bmsnic.EnableInfrastructureNat + currentNic[isBareMetalServerNicSubnet] = *bmsnic.Subnet.ID + currentNic[isBareMetalServerNicPortSpeed] = *bmsnic.PortSpeed + currentNic[isBareMetalServerNicInterfaceType] = "pci" + if len(bmsnic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(bmsnic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(bmsnic.SecurityGroups[i].ID))) + } + currentNic[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + bmsnic := bmsnicintf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + currentNic[isBareMetalServerNicAllowIPSpoofing] = *bmsnic.AllowIPSpoofing + currentNic[isBareMetalServerNicEnableInfraNAT] = *bmsnic.EnableInfrastructureNat + currentNic[isBareMetalServerNicSubnet] = *bmsnic.Subnet.ID + currentNic[isBareMetalServerNicPortSpeed] = *bmsnic.PortSpeed + currentNic[isBareMetalServerNicInterfaceType] = "vlan" + + if len(bmsnic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(bmsnic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(bmsnic.SecurityGroups[i].ID))) + } + currentNic[isBareMetalServerNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) + } + } + } + interfacesList = append(interfacesList, currentNic) + } + } + d.Set(isBareMetalServerNetworkInterfaces, interfacesList) + + d.Set(isBareMetalServerProfile, *bms.Profile.Name) + if bms.ResourceGroup != nil { + d.Set(isBareMetalServerResourceGroup, *bms.ResourceGroup.ID) + } + d.Set(isBareMetalServerResourceType, bms.ResourceType) + d.Set(isBareMetalServerStatus, *bms.Status) + statusReasonsList := make([]map[string]interface{}, 0) + if bms.StatusReasons != nil { + for _, sr := range bms.StatusReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR[isBareMetalServerStatusReasonsCode] = *sr.Code + currentSR[isBareMetalServerStatusReasonsMessage] = *sr.Message + statusReasonsList = append(statusReasonsList, currentSR) + } + } + } + d.Set(isBareMetalServerStatusReasons, statusReasonsList) + d.Set(isBareMetalServerVPC, *bms.VPC.ID) + d.Set(isBareMetalServerZone, *bms.Zone.Name) + + tags, err := flex.GetTagsUsingCRN(meta, *bms.CRN) + if err != nil { + log.Printf( + "[ERROR] Error on get of resource bare metal server (%s) tags: %s", d.Id(), err) + } + d.Set(isBareMetalServerTags, tags) + + return nil +} + +func resourceIBMISBareMetalServerUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + id := d.Id() + + err := bareMetalServerUpdate(context, d, meta, id) + if err != nil { + return diag.FromErr(err) + } + + return resourceIBMISBareMetalServerRead(context, d, meta) +} + +func bareMetalServerUpdate(context context.Context, d *schema.ResourceData, meta interface{}, id string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + + if d.HasChange(isBareMetalServerTags) { + bmscrn := d.Get(isBareMetalServerCRN).(string) + if bmscrn == "" { + options := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := sess.GetBareMetalServerWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s): %s\n%s", id, err, response) + } + bmscrn = *bms.CRN + } + oldList, newList := d.GetChange(isBareMetalServerTags) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, bmscrn) + if err != nil { + log.Printf( + "Error on update of vpc Bare metal server (%s) tags: %s", id, err) + } + } + + options := &vpcv1.UpdateBareMetalServerOptions{ + ID: &id, + } + bmsPatchModel := &vpcv1.BareMetalServerPatch{} + flag := false + + if d.HasChange(isBareMetalServerPrimaryNetworkInterface) { + nicId := d.Get("primary_network_interface.0.id").(string) + bmsNicUpdateOptions := &vpcv1.UpdateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &id, + ID: &nicId, + } + bmsNicPatchModel := &vpcv1.BareMetalServerNetworkInterfacePatch{} + if d.HasChange("primary_network_interface.0.allowed_vlans") { + if allowedVlansOk, ok := d.GetOk("primary_network_interface.0.allowed_vlans"); ok { + allowedVlansList := allowedVlansOk.(*schema.Set).List() + allowedVlans := make([]int64, 0, len(allowedVlansList)) + for _, k := range allowedVlansList { + allowedVlans = append(allowedVlans, int64(k.(int))) + } + bmsNicPatchModel.AllowedVlans = allowedVlans + } + } + if d.HasChange("primary_network_interface.0.allow_ip_spoofing") { + + if allowIpSpoofingOk, ok := d.GetOk("primary_network_interface.0.allow_ip_spoofing"); ok { + allowIpSpoofing := allowIpSpoofingOk.(bool) + if allowIpSpoofing { + bmsNicPatchModel.AllowIPSpoofing = &allowIpSpoofing + } + } + } + if d.HasChange("primary_network_interface.0.enable_infrastructure_nat") { + if enableNatOk, ok := d.GetOk("primary_network_interface.0.enable_infrastructure_nat"); ok { + enableNat := enableNatOk.(bool) + bmsNicPatchModel.EnableInfrastructureNat = &enableNat + } + } + if d.HasChange("primary_network_interface.0.name") { + if nameOk, ok := d.GetOk("primary_network_interface.0.name"); ok { + name := nameOk.(string) + bmsNicPatchModel.Name = &name + } + } + bmsNicPatch, err := bmsNicPatchModel.AsPatch() + if err != nil { + return err + } + bmsNicUpdateOptions.BareMetalServerNetworkInterfacePatch = bmsNicPatch + _, _, err = sess.UpdateBareMetalServerNetworkInterfaceWithContext(context, bmsNicUpdateOptions) + if err != nil { + return err + } + _, err = isWaitForBareMetalServerAvailable(sess, id, d.Timeout(schema.TimeoutUpdate), d) + if err != nil { + return err + } + } + if d.HasChange(isBareMetalServerName) { + flag = true + nameStr := "" + if name, ok := d.GetOk(isBareMetalServerName); ok { + nameStr = name.(string) + } + bmsPatchModel.Name = &nameStr + } + if flag { + bmsPatch, err := bmsPatchModel.AsPatch() + if err != nil { + return fmt.Errorf("[ERROR] Error calling asPatch for BareMetalServerPatch: %s", err) + } + options.BareMetalServerPatch = bmsPatch + _, response, err := sess.UpdateBareMetalServerWithContext(context, options) + if err != nil { + return fmt.Errorf("[ERROR] Error updating Bare Metal Server: %s\n%s", err, response) + } + } + + if d.HasChange(isBareMetalServerAction) { + action := "" + if actionOk, ok := d.GetOk(isBareMetalServerAction); ok { + action = actionOk.(string) + } + if action == "start" { + isBareMetalServerStart(sess, d.Id(), d, 10) + } else if action == "stop" { + isBareMetalServerStop(sess, d.Id(), d, 10) + } else if action == "restart" { + isBareMetalServerRestart(sess, d.Id(), d, 10) + } + } + + return nil +} + +func resourceIBMISBareMetalServerDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Id() + deleteType := "hard" + if dt, ok := d.GetOk(isBareMetalServerDeleteType); ok { + deleteType = dt.(string) + } + err := bareMetalServerDelete(context, d, meta, id, deleteType) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func bareMetalServerDelete(context context.Context, d *schema.ResourceData, meta interface{}, id, deleteType string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + + getBmsOptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := sess.GetBareMetalServerWithContext(context, getBmsOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error Getting Bare Metal Server (%s): %s\n%s", id, err, response) + } + if *bms.Status == "running" { + + options := &vpcv1.StopBareMetalServerOptions{ + ID: bms.ID, + Type: &deleteType, + } + + response, err := sess.StopBareMetalServerWithContext(context, options) + if err != nil && response != nil && response.StatusCode != 204 { + return fmt.Errorf("[ERROR] Error stopping Bare Metal Server (%s): %s\n%s", id, err, response) + } + isWaitForBareMetalServerActionStop(sess, d.Timeout(schema.TimeoutDelete), id, d) + + } + options := &vpcv1.DeleteBareMetalServerOptions{ + ID: &id, + } + response, err = sess.DeleteBareMetalServerWithContext(context, options) + if err != nil { + return fmt.Errorf("[ERROR] Error Deleting Bare Metal Server : %s\n%s", err, response) + } + _, err = isWaitForBareMetalServerDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return err + } + d.SetId("") + return nil +} + +func isWaitForBareMetalServerDeleted(bmsC *vpcv1.VpcV1, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for (%s) to be deleted.", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"retry", isBareMetalServerActionDeleting}, + Target: []string{"done", "", isBareMetalServerActionDeleted, isBareMetalServerStatusFailed}, + Refresh: isBareMetalServerDeleteRefreshFunc(bmsC, id), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isBareMetalServerDeleteRefreshFunc(bmsC *vpcv1.VpcV1, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + bmsgetoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := bmsC.GetBareMetalServer(bmsgetoptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return bms, isBareMetalServerActionDeleted, nil + } + return bms, "", fmt.Errorf("[ERROR] Error Getting Bare Metal Server: %s\n%s", err, response) + } + if *bms.Status == isBareMetalServerStatusFailed { + return bms, *bms.Status, fmt.Errorf("[ERROR] The Bare Metal Server (%s) failed to delete: %v", *bms.ID, err) + } + return bms, isBareMetalServerActionDeleting, err + } +} + +func isWaitForBareMetalServerAvailable(client *vpcv1.VpcV1, id string, timeout time.Duration, d *schema.ResourceData) (interface{}, error) { + log.Printf("Waiting for Bare Metal Server (%s) to be available.", id) + communicator := make(chan interface{}) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerStatusPending, isBareMetalServerActionStatusStarting}, + Target: []string{isBareMetalServerStatusRunning, isBareMetalServerStatusFailed}, + Refresh: isBareMetalServerRefreshFunc(client, id, d, communicator), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForState() +} + +func isBareMetalServerRefreshFunc(client *vpcv1.VpcV1, id string, d *schema.ResourceData, communicator chan interface{}) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + bmsgetoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := client.GetBareMetalServer(bmsgetoptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error getting Bare Metal Server: %s\n%s", err, response) + } + d.Set(isBareMetalServerStatus, *bms.Status) + + select { + case data := <-communicator: + return nil, "", data.(error) + default: + fmt.Println("no message sent") + } + + if *bms.Status == "running" || *bms.Status == "failed" { + // let know the isRestartStartAction() to stop + close(communicator) + if *bms.Status == "failed" { + return bms, *bms.Status, fmt.Errorf("The Bare Metal Server went into failed state") + } + return bms, *bms.Status, nil + + } + return bms, isBareMetalServerStatusPending, nil + } +} + +func isWaitForBareMetalServerActionStop(bmsC *vpcv1.VpcV1, timeout time.Duration, id string, d *schema.ResourceData) (interface{}, error) { + communicator := make(chan interface{}) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerStatusRunning, isBareMetalServerStatusPending, isBareMetalServerActionStatusStopping}, + Target: []string{isBareMetalServerActionStatusStopped, isBareMetalServerStatusFailed, ""}, + Refresh: func() (interface{}, string, error) { + getbmsoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := bmsC.GetBareMetalServer(getbmsoptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error Getting Bare Metal Server: %s\n%s", err, response) + } + select { + case data := <-communicator: + return nil, "", data.(error) + default: + fmt.Println("no message sent") + } + if *bms.Status == isBareMetalServerStatusFailed { + // let know the isRestartStopAction() to stop + close(communicator) + return bms, *bms.Status, fmt.Errorf("[ERROR] The Bare Metal Server %s failed to stop: %v", id, err) + } + return bms, *bms.Status, nil + }, + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isBareMetalServerRestartStopAction(bmsC *vpcv1.VpcV1, id string, d *schema.ResourceData, forceTimeout int, communicator chan interface{}) { + subticker := time.NewTicker(time.Duration(forceTimeout) * time.Minute) + for { + select { + + case <-subticker.C: + log.Println("Bare Metal Server is still in stopping state, retrying to stop with -force") + actiontype := "hard" + createbmssactoptions := &vpcv1.StopBareMetalServerOptions{ + ID: &id, + Type: &actiontype, + } + response, err := bmsC.StopBareMetalServer(createbmssactoptions) + if err != nil { + communicator <- fmt.Errorf("[ERROR] Error retrying Bare Metal Server action stop: %s\n%s", err, response) + return + } + case <-communicator: + // indicates refresh func is reached target and not proceed with the thread) + subticker.Stop() + return + + } + } +} + +func isBareMetalServerStart(bmsC *vpcv1.VpcV1, id string, d *schema.ResourceData, forceTimeout int) (interface{}, error) { + createbmsactoptions := &vpcv1.StartBareMetalServerOptions{ + ID: &id, + } + response, err := bmsC.StartBareMetalServer(createbmsactoptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil, nil + } + return nil, fmt.Errorf("[ERROR] Error creating Bare Metal Server action start : %s\n%s", err, response) + } + _, err = isWaitForBareMetalServerAvailable(bmsC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) + if err != nil { + return nil, err + } + return nil, nil +} +func isBareMetalServerStop(bmsC *vpcv1.VpcV1, id string, d *schema.ResourceData, forceTimeout int) (interface{}, error) { + stoppingType := "soft" + createbmsactoptions := &vpcv1.StopBareMetalServerOptions{ + ID: &id, + Type: &stoppingType, + } + response, err := bmsC.StopBareMetalServer(createbmsactoptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil, nil + } + return nil, fmt.Errorf("[ERROR] Error creating Bare Metal Server Action stop: %s\n%s", err, response) + } + _, err = isWaitForBareMetalServerActionStop(bmsC, d.Timeout(schema.TimeoutUpdate), d.Id(), d) + if err != nil { + return nil, err + } + return nil, nil +} +func isBareMetalServerRestart(bmsC *vpcv1.VpcV1, id string, d *schema.ResourceData, forceTimeout int) (interface{}, error) { + createbmsactoptions := &vpcv1.RestartBareMetalServerOptions{ + ID: &id, + } + response, err := bmsC.RestartBareMetalServer(createbmsactoptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil, nil + } + return nil, fmt.Errorf("[ERROR] Error creating Bare Metal Server action restart: %s\n%s", err, response) + } + _, err = isWaitForBareMetalServerAvailable(bmsC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) + if err != nil { + return nil, err + } + return nil, nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_action.go new file mode 100644 index 0000000000..c193d64583 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_action.go @@ -0,0 +1,344 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerActionAvailable = "available" + isBareMetalServerActionPending = "pending" + isBareMetalServerActionFailed = "failed" + isBareMetalServerStopType = "stop_type" +) + +func ResourceIBMIsBareMetalServerAction() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISBareMetalServerActionCreate, + ReadContext: resourceIBMISBareMetalServerActionRead, + UpdateContext: resourceIBMISBareMetalServerActionUpdate, + DeleteContext: resourceIBMISBareMetalServerActionDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Bare metal server identifier", + }, + isBareMetalServerStopType: { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + Default: "hard", + Description: "The type of stop operation", + }, + isBareMetalServerAction: { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server", isBareMetalServerAction), + Description: "This restart/start/stops a bare metal server.", + }, + isBareMetalServerStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Bare metal server status", + }, + + isBareMetalServerStatusReasons: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerStatusReasonsCode: { + Type: schema.TypeString, + Computed: true, + Description: "A snake case string succinctly identifying the status reason", + }, + + isBareMetalServerStatusReasonsMessage: { + Type: schema.TypeString, + Computed: true, + Description: "An explanation of the status reason", + }, + }, + }, + }, + }, + } +} + +func ResourceIBMISBareMetalServerActionValidator() *validate.ResourceValidator { + bareMetalServerStopTypes := "soft, hard" + bareMetalServerActions := "start, restart, stop" + validateSchema := make([]validate.ValidateSchema, 1) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerAction, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: bareMetalServerActions}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerStopType, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: bareMetalServerStopTypes}) + ibmISBareMetalServerActionResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_bare_metal_server_action", Schema: validateSchema} + return &ibmISBareMetalServerActionResourceValidator +} + +func resourceIBMISBareMetalServerActionCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + bareMetalServerId := "" + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + + bareMetalServerAction := "" + if bmsAction, ok := d.GetOk(isBareMetalServerAction); ok { + bareMetalServerAction = bmsAction.(string) + } + if bareMetalServerAction == "stop" { + bareMetalServerStopType := "hard" + if stopType, ok := d.GetOk(isBareMetalServerStopType); ok { + bareMetalServerStopType = stopType.(string) + } + + createBareMetalServerStopOptions := &vpcv1.StopBareMetalServerOptions{ + ID: &bareMetalServerId, + Type: &bareMetalServerStopType, + } + + _, err = sess.StopBareMetalServerWithContext(context, createBareMetalServerStopOptions) + if err != nil { + return diag.FromErr(err) + } + _, waitErr := isWaitForBareMetalServerActionStop(sess, d.Timeout(schema.TimeoutDelete), bareMetalServerId, d) + if waitErr != nil { + return diag.FromErr(waitErr) + } + } else if bareMetalServerAction == "start" { + + createBareMetalServerStartOptions := &vpcv1.StartBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + _, err := sess.StartBareMetalServerWithContext(context, createBareMetalServerStartOptions) + if err != nil { + return diag.FromErr(err) + } + _, waitErr := isWaitForBareMetalServerActionAvailable(sess, bareMetalServerId, d.Timeout(schema.TimeoutDelete), d) + if waitErr != nil { + return diag.FromErr(waitErr) + } + } else if bareMetalServerAction == "restart" { + createBareMetalServerRestartOptions := &vpcv1.RestartBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + _, err := sess.RestartBareMetalServerWithContext(context, createBareMetalServerRestartOptions) + if err != nil { + return diag.FromErr(err) + } + _, waitErr := isWaitForBareMetalServerActionAvailable(sess, bareMetalServerId, d.Timeout(schema.TimeoutDelete), d) + if waitErr != nil { + return diag.FromErr(waitErr) + } + } + d.SetId(bareMetalServerId) + err = bareMetalServerActionGet(context, sess, bareMetalServerId, d) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func resourceIBMISBareMetalServerActionRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + id := d.Id() + err = bareMetalServerActionGet(context, sess, id, d) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func bareMetalServerActionGet(context context.Context, sess *vpcv1.VpcV1, id string, d *schema.ResourceData) error { + options := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := sess.GetBareMetalServerWithContext(context, options) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s): %s\n%s", id, err, response) + } + d.SetId(*bms.ID) + d.Set(isBareMetalServerStatus, *bms.Status) + statusReasonsList := make([]map[string]interface{}, 0) + if bms.StatusReasons != nil { + for _, sr := range bms.StatusReasons { + currentSR := map[string]interface{}{} + if sr.Code != nil && sr.Message != nil { + currentSR[isBareMetalServerStatusReasonsCode] = *sr.Code + currentSR[isBareMetalServerStatusReasonsMessage] = *sr.Message + statusReasonsList = append(statusReasonsList, currentSR) + } + } + } + d.Set(isBareMetalServerStatusReasons, statusReasonsList) + return nil +} + +func resourceIBMISBareMetalServerActionUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + if d.HasChange(isBareMetalServerAction) { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + bareMetalServerId := d.Id() + + bareMetalServerAction := "" + if bmsAction, ok := d.GetOk(isBareMetalServerAction); ok { + bareMetalServerAction = bmsAction.(string) + } + + if bareMetalServerAction == "stop" { + bareMetalServerStopType := "soft" + if stopType, ok := d.GetOk(isBareMetalServerStopType); ok { + bareMetalServerStopType = stopType.(string) + } + + createBareMetalServerStopOptions := &vpcv1.StopBareMetalServerOptions{ + ID: &bareMetalServerId, + Type: &bareMetalServerStopType, + } + + _, err := sess.StopBareMetalServerWithContext(context, createBareMetalServerStopOptions) + if err != nil { + return diag.FromErr(err) + } + _, waitErr := isWaitForBareMetalServerActionStop(sess, d.Timeout(schema.TimeoutDelete), bareMetalServerId, d) + if waitErr != nil { + return diag.FromErr(waitErr) + } + } else if bareMetalServerAction == "start" { + createBareMetalServerStartOptions := &vpcv1.StartBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + _, err := sess.StartBareMetalServerWithContext(context, createBareMetalServerStartOptions) + if err != nil { + return diag.FromErr(err) + } + _, waitErr := isWaitForBareMetalServerActionAvailable(sess, bareMetalServerId, d.Timeout(schema.TimeoutDelete), d) + if waitErr != nil { + return diag.FromErr(waitErr) + } + } else if bareMetalServerAction == "restart" { + createBareMetalServerRestartOptions := &vpcv1.RestartBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + _, err := sess.RestartBareMetalServerWithContext(context, createBareMetalServerRestartOptions) + if err != nil { + return diag.FromErr(err) + } + _, waitErr := isWaitForBareMetalServerActionAvailable(sess, bareMetalServerId, d.Timeout(schema.TimeoutDelete), d) + if waitErr != nil { + return diag.FromErr(waitErr) + } + } + err = bareMetalServerActionGet(context, sess, bareMetalServerId, d) + if err != nil { + return diag.FromErr(err) + } + } + return nil +} + +func resourceIBMISBareMetalServerActionDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + d.SetId("") + return nil +} + +func isWaitForBareMetalServerActionAvailable(client *vpcv1.VpcV1, id string, timeout time.Duration, d *schema.ResourceData) (interface{}, error) { + log.Printf("Waiting for Bare Metal Server (%s) to be running.", id) + communicator := make(chan interface{}) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerStatusPending, isBareMetalServerActionStatusStarting}, + Target: []string{isBareMetalServerStatusRunning, isBareMetalServerStatusFailed}, + Refresh: isBareMetalServerActionRefreshFunc(client, id, d, communicator), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForState() +} + +func isBareMetalServerActionRefreshFunc(client *vpcv1.VpcV1, id string, d *schema.ResourceData, communicator chan interface{}) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + bmsgetoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := client.GetBareMetalServer(bmsgetoptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error getting Bare Metal Server: %s\n%s", err, response) + } + d.Set(isBareMetalServerStatus, *bms.Status) + + select { + case data := <-communicator: + return nil, "", data.(error) + default: + fmt.Println("no message sent") + } + + if *bms.Status == "running" { + // let know the isRestartStartAction() to stop + close(communicator) + return bms, *bms.Status, nil + + } + if *bms.Status == "failed" { + // let know the isRestartStartAction() to stop + close(communicator) + return bms, *bms.Status, fmt.Errorf("[ERROR] Error Bare Metal Server is in failed state") + + } + return bms, isBareMetalServerStatusPending, nil + } +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_disk.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_disk.go new file mode 100644 index 0000000000..754d42832c --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_disk.go @@ -0,0 +1,200 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMIsBareMetalServerDisk() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISBareMetalServerDiskCreate, + ReadContext: resourceIBMISBareMetalServerDiskRead, + UpdateContext: resourceIBMISBareMetalServerDiskUpdate, + DeleteContext: resourceIBMISBareMetalServerDiskDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "Bare metal server identifier", + }, + isBareMetalServerDisk: { + Type: schema.TypeString, + Required: true, + Description: "Bare metal server disk identifier", + }, + + isBareMetalServerDiskName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Bare metal server disk name", + ValidateFunc: validate.InvokeValidator("ibm_is_bare_metal_server_disk", isBareMetalServerDiskName), + }, + }, + } +} + +func ResourceIBMIsBareMetalServerDiskValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 1) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerDiskName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, + MinValueLength: 1, + MaxValueLength: 63}) + + ibmISBareMetalServerDiskResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_bare_metal_server_disk", Schema: validateSchema} + return &ibmISBareMetalServerDiskResourceValidator +} + +func resourceIBMISBareMetalServerDiskCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + var bareMetalServerId, diskId, diskName string + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + if bmsDiskId, ok := d.GetOk(isBareMetalServerDisk); ok { + diskId = bmsDiskId.(string) + } + if bmsDiskName, ok := d.GetOk(isBareMetalServerDiskName); ok { + diskName = bmsDiskName.(string) + } + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.UpdateBareMetalServerDiskOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &diskId, + } + diskPatchModel := &vpcv1.BareMetalServerDiskPatch{ + Name: &diskName, + } + diskPatch, err := diskPatchModel.AsPatch() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error calling asPatch for BareMetalServerDiskPatch %s", err)) + } + options.BareMetalServerDiskPatch = diskPatch + disk, response, err := sess.UpdateBareMetalServerDiskWithContext(context, options) + if err != nil || disk == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating bare metal server (%s) disk (%s) err %s\n%s", bareMetalServerId, diskId, err, response)) + } + d.SetId(*disk.ID) + err = bareMetalServerDiskGet(context, d, sess, bareMetalServerId, diskId) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func bareMetalServerDiskGet(context context.Context, d *schema.ResourceData, sess *vpcv1.VpcV1, bareMetalServerId, diskId string) error { + + options := &vpcv1.GetBareMetalServerDiskOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &diskId, + } + disk, response, err := sess.GetBareMetalServerDiskWithContext(context, options) + if err != nil || disk == nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return fmt.Errorf("[ERROR] Error fetching bare metal server (%s) disk (%s) err %s\n%s", bareMetalServerId, diskId, err, response) + } + + d.Set(isBareMetalServerID, bareMetalServerId) + d.Set(isBareMetalServerDisk, *disk.ID) + d.Set(isBareMetalServerDiskName, *disk.Name) + + return nil +} + +func resourceIBMISBareMetalServerDiskRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var bareMetalServerId, diskId string + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + if bmsDiskId, ok := d.GetOk(isBareMetalServerDisk); ok { + diskId = bmsDiskId.(string) + } + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + err = bareMetalServerDiskGet(context, d, sess, bareMetalServerId, diskId) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func resourceIBMISBareMetalServerDiskUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + if d.HasChange(isBareMetalServerDiskName) { + var bareMetalServerId, diskId, diskName string + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + if bmsDiskId, ok := d.GetOk(isBareMetalServerDisk); ok { + diskId = bmsDiskId.(string) + } + if bmsDiskName, ok := d.GetOk(isBareMetalServerDiskName); ok { + diskName = bmsDiskName.(string) + } + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.UpdateBareMetalServerDiskOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &diskId, + } + diskPatchModel := &vpcv1.BareMetalServerDiskPatch{ + Name: &diskName, + } + diskPatch, err := diskPatchModel.AsPatch() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error calling asPatch for BareMetalServerDiskPatch %s", err)) + } + options.BareMetalServerDiskPatch = diskPatch + disk, response, err := sess.UpdateBareMetalServerDiskWithContext(context, options) + if err != nil || disk == nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating bare metal server (%s) disk (%s) err %s\n%s", bareMetalServerId, diskId, err, response)) + } + err = bareMetalServerDiskGet(context, d, sess, bareMetalServerId, diskId) + if err != nil { + return diag.FromErr(err) + } + } + return nil +} + +func resourceIBMISBareMetalServerDiskDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + d.SetId("") + + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface.go new file mode 100644 index 0000000000..9c2d41c96a --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface.go @@ -0,0 +1,988 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "reflect" + "strings" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerNetworkInterfaceAvailable = "available" + isBareMetalServerNetworkInterfaceDeleting = "deleting" + isBareMetalServerNetworkInterfacePending = "pending" + isBareMetalServerNetworkInterfacePCIPending = "pci_pending" + isBareMetalServerNetworkInterfaceVlanPending = "vlan_pending" + isBareMetalServerNetworkInterfaceDeleted = "deleted" + isBareMetalServerNetworkInterfaceFailed = "failed" + isBareMetalServerHardStop = "hard_stop" +) + +func ResourceIBMIsBareMetalServerNetworkInterface() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISBareMetalServerNetworkInterfaceCreate, + ReadContext: resourceIBMISBareMetalServerNetworkInterfaceRead, + UpdateContext: resourceIBMISBareMetalServerNetworkInterfaceUpdate, + DeleteContext: resourceIBMISBareMetalServerNetworkInterfaceDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "Bare metal server identifier", + }, + isBareMetalServerNicID: { + Type: schema.TypeString, + Computed: true, + Description: "The bare metal server network interface identifier", + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + }, + isBareMetalServerHardStop: { + Type: schema.TypeBool, + Optional: true, + Default: true, + Description: "Only used for PCI network interfaces, whether to hard/immediately stop server", + }, + isBareMetalServerNicEnableInfraNAT: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + }, + isBareMetalServerNicFloatingIPs: { + Type: schema.TypeList, + Computed: true, + Description: "The floating IPs associated with this network interface.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The network interface type: [ pci, vlan ]", + }, + isBareMetalServerNicMacAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The MAC address of the interface. If absent, the value is not known.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The user-defined name for this network interface", + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + Description: "The network interface port speed in Mbps", + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "title: IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The globally unique IP address", + }, + isBareMetalServerNicIpHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this reserved IP", + }, + isBareMetalServerNicIpID: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The unique identifier for this reserved IP", + }, + isBareMetalServerNicIpName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The unique user-defined name for this reserved IP", + }, + isBareMetalServerNicResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type: [ subnet_reserved_ip ]", + }, + isBareMetalServerNicIpAutoDelete: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "If set to true, this reserved IP will be automatically deleted when the target is deleted or when the reserved IP is unbound.", + }, + }, + }, + }, + isBareMetalServerNicResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type : [ subnet_reserved_ip ]", + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Collection of security groups ids", + }, + + isBareMetalServerNicStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the network interface : [ available, deleting, failed, pending ]", + }, + + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Required: true, + Description: "The id of the associated subnet", + }, + + isBareMetalServerNicType: { + Type: schema.TypeString, + Computed: true, + Description: "The type of this bare metal server network interface : [ primary, secondary ]", + }, + + isBareMetalServerNicAllowedVlans: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ConflictsWith: []string{isBareMetalServerNicAllowInterfaceToFloat, isBareMetalServerNicVlan}, + Elem: &schema.Schema{Type: schema.TypeInt}, + Set: schema.HashInt, + Description: "Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server.", + }, + + isBareMetalServerNicAllowInterfaceToFloat: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + DiffSuppressFunc: flex.ApplyOnce, + ConflictsWith: []string{isBareMetalServerNicAllowedVlans}, + Description: "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + }, + + isBareMetalServerNicVlan: { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ConflictsWith: []string{isBareMetalServerNicAllowedVlans}, + Description: "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", + }, + }, + } +} + +func ResourceIBMIsBareMetalServerNetworkInterfaceValidator() *validate.ResourceValidator { + + validateSchema := make([]validate.ValidateSchema, 1) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isBareMetalServerName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, + MinValueLength: 1, + MaxValueLength: 63}) + + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: "tag", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^[A-Za-z0-9:_ .-]+$`, + MinValueLength: 1, + MaxValueLength: 128}) + + ibmISBareMetalServerNicResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_bare_metal_server_network_interface", Schema: validateSchema} + return &ibmISBareMetalServerNicResourceValidator +} + +func resourceIBMISBareMetalServerNetworkInterfaceCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + bareMetalServerId := "" + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + if allowedVlansOk, ok := d.GetOk(isBareMetalServerNicAllowedVlans); ok { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.CreateBareMetalServerNetworkInterfaceOptions{} + interfaceType := "pci" + // to create pci, server needs to be in stopped state + + getbmsoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + bms, response, err := sess.GetBareMetalServerWithContext(context, getbmsoptions) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error fetching bare metal server (%s) err %s\n%s", bareMetalServerId, err, response)) + } + // failed, pending, restarting, running, starting, stopped, stopping, maintenance + if *bms.Status == "failed" { + return diag.FromErr(fmt.Errorf("[ERROR] Error cannot attach network interface to a failed bare metal server")) + } else if *bms.Status == "running" { + log.Printf("[DEBUG] Stopping bare metal server (%s) to create a PCI network interface", bareMetalServerId) + stopType := "hard" + if d.Get(isBareMetalServerHardStop).(bool) { + stopType = "soft" + } + createstopaction := &vpcv1.StopBareMetalServerOptions{ + ID: &bareMetalServerId, + Type: &stopType, + } + res, err := sess.StopBareMetalServerWithContext(context, createstopaction) + if err != nil || res.StatusCode != 204 { + return diag.FromErr(fmt.Errorf("[ERROR] Error stopping bare metal server (%s) err %s\n%s", bareMetalServerId, err, response)) + } + _, err = isWaitForBareMetalServerStoppedForNIC(sess, bareMetalServerId, d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return diag.FromErr(err) + } + } else if *bms.Status != "stopped" { + return diag.FromErr(fmt.Errorf("[ERROR] Error bare metal server in %s state, please try after some time", *bms.Status)) + } + + nicOptions := &vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype{} + allowedVlansList := allowedVlansOk.(*schema.Set).List() + + allowedVlans := make([]int64, 0, len(allowedVlansList)) + for _, k := range allowedVlansList { + allowedVlans = append(allowedVlans, int64(k.(int))) + } + nicOptions.AllowedVlans = allowedVlans + + if name, ok := d.GetOk(isBareMetalServerNicName); ok { + nameStr := name.(string) + nicOptions.Name = &nameStr + } + nicOptions.InterfaceType = &interfaceType + + if ais, ok := d.GetOk(isBareMetalServerNicAllowIPSpoofing); ok { + allowIPSpoofing := ais.(bool) + if allowIPSpoofing { + nicOptions.AllowIPSpoofing = &allowIPSpoofing + } + } + if ein, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + enableInfrastructureNat := ein.(bool) + nicOptions.EnableInfrastructureNat = &enableInfrastructureNat + } + if subnetOk, ok := d.GetOk(isBareMetalServerNicSubnet); ok { + subnet := subnetOk.(string) + nicOptions.Subnet = &vpcv1.SubnetIdentity{ + ID: &subnet, + } + } + + if primaryIpIntf, ok := d.GetOk(isBareMetalServerNicPrimaryIP); ok && len(primaryIpIntf.([]interface{})) > 0 { + primaryIp := primaryIpIntf.([]interface{})[0].(map[string]interface{}) + + reservedIpAddressOk, ok := primaryIp[isBareMetalServerNicIpAddress] + if ok && reservedIpAddressOk.(string) != "" { + reservedIpAddress := reservedIpAddressOk.(string) + nicOptions.PrimaryIpv4Address = &reservedIpAddress + } + } + + sGroups := d.Get(isBareMetalServerNicSecurityGroups).(*schema.Set).List() + var sGroupList []vpcv1.SecurityGroupIdentityIntf + // Add new allowed_subnets + for _, sGroup := range sGroups { + sGroupStr := sGroup.(string) + sgModel := &vpcv1.SecurityGroupIdentity{ + ID: &sGroupStr, + } + sGroupList = append(sGroupList, sgModel) + } + nicOptions.SecurityGroups = sGroupList + options.BareMetalServerID = &bareMetalServerId + options.BareMetalServerNetworkInterfacePrototype = nicOptions + nic, response, err := sess.CreateBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil || nic == nil { + return diag.FromErr(fmt.Errorf("[DEBUG] Create bare metal server (%s) network interface err %s\n%s", bareMetalServerId, err, response)) + } + err = bareMetalServerNICGet(d, meta, nic, bareMetalServerId) + if err != nil { + return diag.FromErr(err) + } + _, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + log.Printf("[INFO] Bare Metal Server Network Interface : %s", d.Id()) + _, err = isWaitForBareMetalServerNetworkInterfaceAvailable(sess, bareMetalServerId, nicId, d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return diag.FromErr(err) + } + + // restarting the server after PCI creation + log.Printf("[DEBUG] Starting bare metal server (%s) to create a PCI network interface", bareMetalServerId) + + createstartaction := &vpcv1.StartBareMetalServerOptions{ + ID: &bareMetalServerId, + } + res, err := sess.StartBareMetalServerWithContext(context, createstartaction) + if err != nil || res.StatusCode != 204 { + return diag.FromErr(fmt.Errorf("[ERROR] Error starting bare metal server (%s) err %s\n%s", bareMetalServerId, err, response)) + } + _, err = isWaitForBareMetalServerAvailableForNIC(sess, bareMetalServerId, d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return diag.FromErr(err) + } + + } else { + err := createVlanTypeNetworkInterface(context, d, meta, bareMetalServerId) + if err != nil { + return diag.FromErr(err) + } + } + + return nil +} + +func createVlanTypeNetworkInterface(context context.Context, d *schema.ResourceData, meta interface{}, bareMetalServerId string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + options := &vpcv1.CreateBareMetalServerNetworkInterfaceOptions{} + interfaceType := "vlan" + nicOptions := &vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{} + if aitf, ok := d.GetOk(isBareMetalServerNicAllowInterfaceToFloat); ok { + allowInterfaceToFloat := aitf.(bool) + nicOptions.AllowInterfaceToFloat = &allowInterfaceToFloat + } + if vlan, ok := d.GetOk(isBareMetalServerNicVlan); ok { + vlanInt := int64(vlan.(int)) + nicOptions.Vlan = &vlanInt + } + + if name, ok := d.GetOk(isBareMetalServerNicName); ok { + nameStr := name.(string) + nicOptions.Name = &nameStr + } + nicOptions.InterfaceType = &interfaceType + + if ais, ok := d.GetOk(isBareMetalServerNicAllowIPSpoofing); ok { + allowIPSpoofing := ais.(bool) + if allowIPSpoofing { + nicOptions.AllowIPSpoofing = &allowIPSpoofing + } + } + if ein, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + enableInfrastructureNat := ein.(bool) + nicOptions.EnableInfrastructureNat = &enableInfrastructureNat + } + if subnetOk, ok := d.GetOk(isBareMetalServerNicSubnet); ok { + subnet := subnetOk.(string) + nicOptions.Subnet = &vpcv1.SubnetIdentity{ + ID: &subnet, + } + } + + if primaryIpIntf, ok := d.GetOk(isBareMetalServerNicPrimaryIP); ok && len(primaryIpIntf.([]interface{})) > 0 { + primaryIp := primaryIpIntf.([]interface{})[0].(map[string]interface{}) + + reservedIpAddressOk, ok := primaryIp[isBareMetalServerNicIpAddress] + if ok && reservedIpAddressOk.(string) != "" { + reservedIpAddress := reservedIpAddressOk.(string) + nicOptions.PrimaryIpv4Address = &reservedIpAddress + } + } + + sGroups := d.Get(isBareMetalServerNicSecurityGroups).(*schema.Set).List() + var sGroupList []vpcv1.SecurityGroupIdentityIntf + // Add new allowed_subnets + for _, sGroup := range sGroups { + sGroupStr := sGroup.(string) + sgModel := &vpcv1.SecurityGroupIdentity{ + ID: &sGroupStr, + } + sGroupList = append(sGroupList, sgModel) + } + nicOptions.SecurityGroups = sGroupList + options.BareMetalServerID = &bareMetalServerId + options.BareMetalServerNetworkInterfacePrototype = nicOptions + nic, response, err := sess.CreateBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil || nic == nil { + return fmt.Errorf("[DEBUG] Create bare metal server (%s) network interface err %s\n%s", bareMetalServerId, err, response) + } + err = bareMetalServerNICGet(d, meta, nic, bareMetalServerId) + if err != nil { + return err + } + _, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return err + } + log.Printf("[INFO] Bare Metal Server Network Interface : %s", d.Id()) + _, err = isWaitForBareMetalServerNetworkInterfaceAvailable(sess, bareMetalServerId, nicId, d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return err + } + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerId, nicID, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicID, + } + + nicIntf, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil || nicIntf == nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface (%s): %s\n%s", bareMetalServerId, nicID, err, response)) + } + err = bareMetalServerNICGet(d, meta, nicIntf, bareMetalServerId) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func bareMetalServerNICGet(d *schema.ResourceData, meta interface{}, nicIntf interface{}, bareMetalServerId string) error { + switch reflect.TypeOf(nicIntf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + d.SetId(MakeTerraformNICID(bareMetalServerId, *nic.ID)) + d.Set(isBareMetalServerNicAllowIPSpoofing, *nic.AllowIPSpoofing) + d.Set(isBareMetalServerNicID, *nic.ID) + d.Set(isBareMetalServerNicEnableInfraNAT, *nic.EnableInfrastructureNat) + d.Set(isBareMetalServerNicStatus, *nic.Status) + + floatingIPList := make([]map[string]interface{}, 0) + if nic.FloatingIps != nil { + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + } + d.Set(isBareMetalServerNicFloatingIPs, floatingIPList) + + d.Set(isBareMetalServerNicHref, *nic.Href) + d.Set(isBareMetalServerNicInterfaceType, *nic.InterfaceType) + + d.Set(isBareMetalServerNicMacAddress, *nic.MacAddress) + d.Set(isBareMetalServerNicName, *nic.Name) + if nic.PortSpeed != nil { + d.Set(isBareMetalServerNicPortSpeed, *nic.PortSpeed) + } + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + d.Set(isBareMetalServerNicPrimaryIP, primaryIpList) + + d.Set(isBareMetalServerNicResourceType, *nic.ResourceType) + + if nic.SecurityGroups != nil && len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + d.Set(isBareMetalServerNicSecurityGroups, flex.NewStringSet(schema.HashString, secgrpList)) + } + + d.Set(isBareMetalServerNicStatus, *nic.Status) + d.Set(isBareMetalServerNicSubnet, *nic.Subnet.ID) + d.Set(isBareMetalServerNicType, *nic.Type) + if nic.AllowedVlans != nil { + var out = make([]interface{}, len(nic.AllowedVlans), len(nic.AllowedVlans)) + for i, v := range nic.AllowedVlans { + out[i] = int(v) + } + d.Set(isBareMetalServerNicAllowedVlans, schema.NewSet(schema.HashInt, out)) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + d.SetId(MakeTerraformNICID(bareMetalServerId, *nic.ID)) + d.Set(isBareMetalServerNicAllowIPSpoofing, *nic.AllowIPSpoofing) + d.Set(isBareMetalServerNicEnableInfraNAT, *nic.EnableInfrastructureNat) + d.Set(isBareMetalServerNicStatus, *nic.Status) + floatingIPList := make([]map[string]interface{}, 0) + if nic.FloatingIps != nil { + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + } + d.Set(isBareMetalServerNicFloatingIPs, floatingIPList) + + d.Set(isBareMetalServerNicHref, nic.Href) + d.Set(isBareMetalServerNicID, *nic.ID) + d.Set(isBareMetalServerNicInterfaceType, *nic.InterfaceType) + + d.Set(isBareMetalServerNicMacAddress, *nic.MacAddress) + d.Set(isBareMetalServerNicName, *nic.Name) + d.Set(isBareMetalServerNicPortSpeed, nic.PortSpeed) + + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + d.Set(isBareMetalServerNicPrimaryIP, primaryIpList) + + d.Set(isBareMetalServerNicResourceType, nic.ResourceType) + + if len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + d.Set(isBareMetalServerNicSecurityGroups, flex.NewStringSet(schema.HashString, secgrpList)) + } + + d.Set(isBareMetalServerNicStatus, *nic.Status) + d.Set(isBareMetalServerNicSubnet, *nic.Subnet.ID) + d.Set(isBareMetalServerNicType, *nic.Type) + d.Set(isBareMetalServerNicAllowInterfaceToFloat, *nic.AllowInterfaceToFloat) + d.Set(isBareMetalServerNicVlan, *nic.Vlan) + } + } + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + bareMetalServerId, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + options := &vpcv1.UpdateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + nicPatchModel := &vpcv1.BareMetalServerNetworkInterfacePatch{} + flag := false + if d.HasChange(isBareMetalServerNicAllowIPSpoofing) { + flag = true + aisBool := false + if ais, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + aisBool = ais.(bool) + } + nicPatchModel.AllowIPSpoofing = &aisBool + } + if d.HasChange(isBareMetalServerNicAllowedVlans) { + flag = true + + if allowedVlansOk, ok := d.GetOk(isBareMetalServerNicAllowedVlans); ok { + allowedVlansList := allowedVlansOk.(*schema.Set).List() + allowedVlans := make([]int64, 0, len(allowedVlansList)) + for _, k := range allowedVlansList { + allowedVlans = append(allowedVlans, int64(k.(int))) + } + nicPatchModel.AllowedVlans = allowedVlans + } + } + if d.HasChange(isBareMetalServerNicEnableInfraNAT) { + flag = true + einBool := false + if ein, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + einBool = ein.(bool) + } + nicPatchModel.EnableInfrastructureNat = &einBool + } + if d.HasChange(isBareMetalServerNicName) { + flag = true + nameStr := "" + if name, ok := d.GetOk(isBareMetalServerNicName); ok { + nameStr = name.(string) + } + nicPatchModel.Name = &nameStr + } + + if flag { + nicPatchModelAsPatch, err := nicPatchModel.AsPatch() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error calling asPatch for BareMetalServerNetworkInterfacePatch %s", err)) + } + options.BareMetalServerNetworkInterfacePatch = nicPatchModelAsPatch + + nicIntf, response, err := sess.UpdateBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating Bare Metal Server: %s\n%s", err, response)) + } + return diag.FromErr(bareMetalServerNICGet(d, meta, nicIntf, bareMetalServerId)) + } + + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerId, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = bareMetalServerNetworkInterfaceDelete(context, d, meta, bareMetalServerId, nicId) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func bareMetalServerNetworkInterfaceDelete(context context.Context, d *schema.ResourceData, meta interface{}, bareMetalServerId, nicId string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + + getBmsNicOptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + nicIntf, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, getBmsNicOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface(%s) : %s\n%s", bareMetalServerId, nicId, err, response) + } + nicType := "" + switch reflect.TypeOf(nicIntf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nicType = "pci" + log.Printf("[DEBUG] PCI type network interface needs the server in stopped state") + log.Printf("[DEBUG] Stopping the bare metal server %s", bareMetalServerId) + // to delete pci, server needs to be in stopped state + + getbmsoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + bms, response, err := sess.GetBareMetalServerWithContext(context, getbmsoptions) + if err != nil { + return fmt.Errorf("[ERROR] Error fetching bare metal server (%s) err %s\n%s", bareMetalServerId, err, response) + } + // failed, pending, restarting, running, starting, stopped, stopping, maintenance + if *bms.Status == "failed" { + return fmt.Errorf("[ERROR] Error cannot detach network interface from a failed bare metal server") + } else if *bms.Status == "running" { + log.Printf("[DEBUG] Stopping bare metal server (%s) to create a PCI network interface", bareMetalServerId) + stopType := "soft" + if d.Get(isBareMetalServerHardStop).(bool) { + stopType = "hard" + } + createstopaction := &vpcv1.StopBareMetalServerOptions{ + ID: &bareMetalServerId, + Type: &stopType, + } + res, err := sess.StopBareMetalServerWithContext(context, createstopaction) + if err != nil || res.StatusCode != 204 { + return fmt.Errorf("[ERROR] Error stopping bare metal server (%s) err %s\n%s", bareMetalServerId, err, response) + } + _, err = isWaitForBareMetalServerStoppedForNIC(sess, bareMetalServerId, d.Timeout(schema.TimeoutDelete), d) + if err != nil || res.StatusCode != 204 { + return err + } + } else if *bms.Status != "stopped" { + return fmt.Errorf("[ERROR] Error bare metal server in %s state, please try after some time", *bms.Status) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nicType = "vlan" + } + } + + options := &vpcv1.DeleteBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + response, err = sess.DeleteBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil { + return fmt.Errorf("[ERROR] Error Deleting Bare Metal Server (%s) network interface (%s) : %s\n%s", bareMetalServerId, nicId, err, response) + } + _, err = isWaitForBareMetalServerNetworkInterfaceDeleted(sess, bareMetalServerId, nicId, nicType, nicIntf, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return err + } + if nicType == "pci" { + // restarting the server after PCI deletion + log.Printf("[DEBUG] Starting bare metal server (%s) after deleting the PCI network interface", bareMetalServerId) + createstartaction := &vpcv1.StartBareMetalServerOptions{ + ID: &bareMetalServerId, + } + res, err := sess.StartBareMetalServerWithContext(context, createstartaction) + if err != nil || res.StatusCode != 204 { + return fmt.Errorf("[ERROR] Error starting bare metal server (%s) err %s\n%s", bareMetalServerId, err, response) + } + _, err = isWaitForBareMetalServerAvailableForNIC(sess, bareMetalServerId, d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return err + } + } + d.SetId("") + return nil +} + +func isWaitForBareMetalServerNetworkInterfaceDeleted(bmsC *vpcv1.VpcV1, bareMetalServerId, nicId, nicType string, nicIntf vpcv1.BareMetalServerNetworkInterfaceIntf, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for (%s) / (%s) to be deleted.", bareMetalServerId, nicId) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerNetworkInterfaceAvailable, isBareMetalServerNetworkInterfaceDeleting, isBareMetalServerNetworkInterfacePending}, + Target: []string{isBareMetalServerNetworkInterfaceDeleted, isBareMetalServerNetworkInterfaceVlanPending, isBareMetalServerNetworkInterfaceFailed, ""}, + Refresh: isBareMetalServerNetworkInterfaceDeleteRefreshFunc(bmsC, bareMetalServerId, nicId, nicType, nicIntf), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isBareMetalServerNetworkInterfaceDeleteRefreshFunc(bmsC *vpcv1.VpcV1, bareMetalServerId, nicId, nicType string, nicIntf vpcv1.BareMetalServerNetworkInterfaceIntf) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + getBmsNicOptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + bmsNic, response, err := bmsC.GetBareMetalServerNetworkInterface(getBmsNicOptions) + if bmsNic != nil && nicType == "vlan" { + getBmsOptions := &vpcv1.GetBareMetalServerOptions{ + ID: &bareMetalServerId, + } + bms, response, err := bmsC.GetBareMetalServer(getBmsOptions) + if err != nil { + return bmsNic, isBareMetalServerNetworkInterfaceFailed, fmt.Errorf("[ERROR] Error getting Bare Metal Server(%s) : %s\n%s", bareMetalServerId, err, response) + } + if *bms.Status == "stopped" { + return bmsNic, isBareMetalServerNetworkInterfaceVlanPending, fmt.Errorf("[ERROR] Error deleting Bare Metal Server(%s) Network Interface (%s), server in stopped state ", bareMetalServerId, nicId) + } + } + if err != nil { + if response != nil && response.StatusCode == 404 { + return nicIntf, isBareMetalServerNetworkInterfaceDeleted, nil + } + return bmsNic, isBareMetalServerNetworkInterfaceFailed, fmt.Errorf("[ERROR] Error getting Bare Metal Server(%s) Network Interface (%s): %s\n%s", bareMetalServerId, nicId, err, response) + } + return bmsNic, isBareMetalServerNetworkInterfaceDeleting, err + } +} + +func isWaitForBareMetalServerNetworkInterfaceAvailable(client *vpcv1.VpcV1, bareMetalServerId, nicId string, timeout time.Duration, d *schema.ResourceData) (interface{}, error) { + log.Printf("Waiting for Bare Metal Server (%s) Network Interface (%s) to be available.", bareMetalServerId, nicId) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerNetworkInterfacePending}, + Target: []string{isBareMetalServerNetworkInterfaceAvailable, isBareMetalServerNetworkInterfacePCIPending, isBareMetalServerNetworkInterfaceFailed}, + Refresh: isBareMetalServerNetworkInterfaceRefreshFunc(client, bareMetalServerId, nicId, d), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForState() +} + +func isBareMetalServerNetworkInterfaceRefreshFunc(client *vpcv1.VpcV1, bareMetalServerId, nicId string, d *schema.ResourceData) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + getBmsNicOptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + bmsNic, response, err := client.GetBareMetalServerNetworkInterface(getBmsNicOptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) Network Interface (%s) : %s\n%s", bareMetalServerId, nicId, err, response) + } + status := "" + pcipending := false + switch reflect.TypeOf(bmsNic).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nic := bmsNic.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + status = *nic.Status + d.Set(isBareMetalServerNicStatus, *nic.Status) + getBmsOptions := &vpcv1.GetBareMetalServerOptions{ + ID: &bareMetalServerId, + } + bms, response, err := client.GetBareMetalServer(getBmsOptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) : %s\n%s", bareMetalServerId, err, response) + } + if *bms.Status == "stopped" { + pcipending = true + } + + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nic := bmsNic.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + status = *nic.Status + d.Set(isBareMetalServerNicStatus, *nic.Status) + } + } + + if status == "available" || status == "failed" { + return bmsNic, status, nil + } + if pcipending { + return bmsNic, isBareMetalServerNetworkInterfacePCIPending, nil + } + return bmsNic, "pending", nil + } +} + +func MakeTerraformNICID(id1, id2 string) string { + // Include both bare metal sever id and network interface id to create a unique Terraform id. As a bonus, + // we can extract the bare metal sever id as needed for API calls such as READ. + return fmt.Sprintf("%s/%s", id1, id2) +} + +func ParseNICTerraformID(s string) (string, string, error) { + segments := strings.Split(s, "/") + if len(segments) != 2 { + return "", "", fmt.Errorf("invalid terraform Id %s (incorrect number of segments)", s) + } + if segments[0] == "" || segments[1] == "" { + return "", "", fmt.Errorf("invalid terraform Id %s (one or more empty segments)", s) + } + return segments[0], segments[1], nil +} + +func isWaitForBareMetalServerAvailableForNIC(client *vpcv1.VpcV1, id string, timeout time.Duration, d *schema.ResourceData) (interface{}, error) { + log.Printf("Waiting for Bare Metal Server (%s) to be available.", id) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerStatusPending, isBareMetalServerActionStatusStarting, "running"}, + Target: []string{isBareMetalServerStatusRunning, isBareMetalServerStatusFailed}, + Refresh: isBareMetalServerForNICRefreshFunc(client, id, d), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForState() +} + +func isBareMetalServerForNICRefreshFunc(client *vpcv1.VpcV1, id string, d *schema.ResourceData) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + bmsgetoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := client.GetBareMetalServer(bmsgetoptions) + if err != nil { + return nil, "failed", fmt.Errorf("[ERROR] Error getting Bare Metal Server: %s\n%s", err, response) + } + + if *bms.Status == "running" || *bms.Status == "failed" { + return bms, *bms.Status, nil + } + return bms, "pending", nil + } +} + +func isWaitForBareMetalServerStoppedForNIC(client *vpcv1.VpcV1, id string, timeout time.Duration, d *schema.ResourceData) (interface{}, error) { + log.Printf("Waiting for Bare Metal Server (%s) to be stopped.", id) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerStatusPending, isBareMetalServerActionStatusStarting}, + Target: []string{isBareMetalServerActionStatusStopped}, + Refresh: isBareMetalServerForNICStoppedRefreshFunc(client, id, d), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForState() +} + +func isBareMetalServerForNICStoppedRefreshFunc(client *vpcv1.VpcV1, id string, d *schema.ResourceData) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + bmsgetoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &id, + } + bms, response, err := client.GetBareMetalServer(bmsgetoptions) + if err != nil { + return nil, "failed", fmt.Errorf("[ERROR] Error getting Bare Metal Server: %s\n%s", err, response) + } + if *bms.Status == "stopped" || *bms.Status == "failed" { + // let know the isRestartStartAction() to stop + if *bms.Status == "failed" { + return bms, *bms.Status, fmt.Errorf("[ERROR] Error bare metal server in failed state") + } + return bms, "stopped", nil + + } + return bms, isBareMetalServerStatusPending, nil + } +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface_allow_float.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface_allow_float.go new file mode 100644 index 0000000000..2d2aabc2e1 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface_allow_float.go @@ -0,0 +1,594 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "reflect" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMIsBareMetalServerNetworkInterfaceAllowFloat() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISBareMetalServerNetworkInterfaceAllowFloatCreate, + ReadContext: resourceIBMISBareMetalServerNetworkInterfaceAllowFloatRead, + UpdateContext: resourceIBMISBareMetalServerNetworkInterfaceAllowFloatUpdate, + DeleteContext: resourceIBMISBareMetalServerNetworkInterfaceAllowFloatDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: flex.ApplyOnce, + Description: "Bare metal server identifier", + }, + isBareMetalServerNicID: { + Type: schema.TypeString, + Computed: true, + Description: "The bare metal server network interface identifier", + }, + isBareMetalServerNicAllowIPSpoofing: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface.", + }, + isBareMetalServerNicEnableInfraNAT: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations.", + }, + isBareMetalServerNicFloatingIPs: { + Type: schema.TypeList, + Computed: true, + Description: "The floating IPs associated with this network interface.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicHref: { + Type: schema.TypeString, + Computed: true, + Description: "The URL for this network interface", + }, + isBareMetalServerNicInterfaceType: { + Type: schema.TypeString, + Computed: true, + Description: "The network interface type: [ pci, vlan ]", + }, + isBareMetalServerNicMacAddress: { + Type: schema.TypeString, + Computed: true, + Description: "The MAC address of the interface. If absent, the value is not known.", + }, + isBareMetalServerNicName: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The user-defined name for this network interface", + }, + isBareMetalServerNicPortSpeed: { + Type: schema.TypeInt, + Computed: true, + Description: "The network interface port speed in Mbps", + }, + isBareMetalServerNicPrimaryIP: { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "title: IPv4, The IP address. ", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + isBareMetalServerNicIpAddress: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The globally unique IP address", + }, + }, + }, + }, + isBareMetalServerNicResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type : [ subnet_reserved_ip ]", + }, + + isBareMetalServerNicSecurityGroups: { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Collection of security groups ids", + }, + + isBareMetalServerNicStatus: { + Type: schema.TypeString, + Computed: true, + Description: "The status of the network interface : [ available, deleting, failed, pending ]", + }, + + isBareMetalServerNicSubnet: { + Type: schema.TypeString, + Required: true, + Description: "The id of the associated subnet", + }, + + isBareMetalServerNicType: { + Type: schema.TypeString, + Computed: true, + Description: "The type of this bare metal server network interface : [ primary, secondary ]", + }, + isBareMetalServerNicVlan: { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface", + }, + isBareMetalServerNicAllowInterfaceToFloat: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates if the interface can float to any other server within the same resource_group. The interface will float automatically if the network detects a GARP or RARP on another bare metal server in the resource group. Applies only to vlan type interfaces.", + }, + }, + } +} + +func resourceIBMISBareMetalServerNetworkInterfaceAllowFloatCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + bareMetalServerId := "" + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + + err := createVlanTypeNetworkInterfaceAllowFloat(context, d, meta, bareMetalServerId) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func createVlanTypeNetworkInterfaceAllowFloat(context context.Context, d *schema.ResourceData, meta interface{}, bareMetalServerId string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + options := &vpcv1.CreateBareMetalServerNetworkInterfaceOptions{} + interfaceType := "vlan" + nicOptions := &vpcv1.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{} + allowInterfaceToFloat := true + nicOptions.AllowInterfaceToFloat = &allowInterfaceToFloat + if vlan, ok := d.GetOk(isBareMetalServerNicVlan); ok { + vlanInt := int64(vlan.(int)) + nicOptions.Vlan = &vlanInt + } + + if name, ok := d.GetOk(isBareMetalServerNicName); ok { + nameStr := name.(string) + nicOptions.Name = &nameStr + } + nicOptions.InterfaceType = &interfaceType + + if ais, ok := d.GetOk(isBareMetalServerNicAllowIPSpoofing); ok { + allowIPSpoofing := ais.(bool) + if allowIPSpoofing { + nicOptions.AllowIPSpoofing = &allowIPSpoofing + } + } + if ein, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + enableInfrastructureNat := ein.(bool) + nicOptions.EnableInfrastructureNat = &enableInfrastructureNat + } + if subnetOk, ok := d.GetOk(isBareMetalServerNicSubnet); ok { + subnet := subnetOk.(string) + nicOptions.Subnet = &vpcv1.SubnetIdentity{ + ID: &subnet, + } + } + + if primaryIpIntf, ok := d.GetOk(isBareMetalServerNicPrimaryIP); ok && len(primaryIpIntf.([]interface{})) > 0 { + primaryIp := primaryIpIntf.([]interface{})[0].(map[string]interface{}) + + reservedIpAddressOk, ok := primaryIp[isBareMetalServerNicIpAddress] + if ok && reservedIpAddressOk.(string) != "" { + reservedIpAddress := reservedIpAddressOk.(string) + nicOptions.PrimaryIpv4Address = &reservedIpAddress + } + } + + sGroups := d.Get(isBareMetalServerNicSecurityGroups).(*schema.Set).List() + var sGroupList []vpcv1.SecurityGroupIdentityIntf + // Add new allowed_subnets + for _, sGroup := range sGroups { + sGroupStr := sGroup.(string) + sgModel := &vpcv1.SecurityGroupIdentity{ + ID: &sGroupStr, + } + sGroupList = append(sGroupList, sgModel) + } + nicOptions.SecurityGroups = sGroupList + options.BareMetalServerID = &bareMetalServerId + options.BareMetalServerNetworkInterfacePrototype = nicOptions + nic, response, err := sess.CreateBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil || nic == nil { + return fmt.Errorf("[DEBUG] Create bare metal server (%s) network interface err %s\n%s", bareMetalServerId, err, response) + } + err = bareMetalServerNICGet(d, meta, nic, bareMetalServerId) + if err != nil { + return err + } + _, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return err + } + log.Printf("[INFO] Bare Metal Server Network Interface : %s", d.Id()) + _, err = isWaitForBareMetalServerNetworkInterfaceAvailable(sess, bareMetalServerId, nicId, d.Timeout(schema.TimeoutCreate), d) + if err != nil { + return err + } + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceAllowFloatRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerId, nicID, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicID, + } + var nicIntf vpcv1.BareMetalServerNetworkInterfaceIntf + // try to fetch original nic + nicIntf, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, options) + if (err != nil || nicIntf == nil) && response != nil { + //if original nic is not present, try fetching nic without server id + nicIntf, response, err = findNicsWithoutBMS(context, sess, nicID) + // response here can be either nil or not nil and if it returns 404 means nic is deleted + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + // if response returns an error + if err != nil || nicIntf == nil { + if response != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface (%s): %s\n%s", bareMetalServerId, nicID, err, response)) + } else { + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface (%s): %s", bareMetalServerId, nicID, err)) + } + } + } + err = bareMetalServerNICAllowFloatGet(d, meta, nicIntf, bareMetalServerId) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func findNicsWithoutBMS(context context.Context, sess *vpcv1.VpcV1, nicId string) (result vpcv1.BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + // listing all servers + start := "" + allrecs := []vpcv1.BareMetalServer{} + for { + listBareMetalServersOptions := &vpcv1.ListBareMetalServersOptions{} + if start != "" { + listBareMetalServersOptions.Start = &start + } + availableServers, response, err := sess.ListBareMetalServersWithContext(context, listBareMetalServersOptions) + if err != nil { + return nil, nil, fmt.Errorf("[ERROR] Error fetching Bare Metal Servers %s\n%s", err, response) + } + start = flex.GetNext(availableServers.Next) + allrecs = append(allrecs, availableServers.BareMetalServers...) + if start == "" { + break + } + } + // finding nic id each server + for _, server := range allrecs { + nics := server.NetworkInterfaces + for _, nic := range nics { + if *nic.ID == nicId { + options := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: server.ID, + ID: &nicId, + } + //return response of the server nic matches + return sess.GetBareMetalServerNetworkInterfaceWithContext(context, options) + } + } + } + // if not found return nil response and error + return nil, nil, fmt.Errorf("[ERROR] Error Network interface not found") +} + +func bareMetalServerNICAllowFloatGet(d *schema.ResourceData, meta interface{}, nicIntf interface{}, bareMetalServerId string) error { + switch reflect.TypeOf(nicIntf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByPci) + d.SetId(MakeTerraformNICID(bareMetalServerId, *nic.ID)) + d.Set(isBareMetalServerNicAllowIPSpoofing, *nic.AllowIPSpoofing) + d.Set(isBareMetalServerNicEnableInfraNAT, *nic.EnableInfrastructureNat) + d.Set(isBareMetalServerNicStatus, *nic.Status) + + floatingIPList := make([]map[string]interface{}, 0) + if nic.FloatingIps != nil { + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + } + d.Set(isBareMetalServerNicFloatingIPs, floatingIPList) + + d.Set(isBareMetalServerNicHref, *nic.Href) + d.Set(isBareMetalServerNicID, *nic.ID) + d.Set(isBareMetalServerNicInterfaceType, *nic.InterfaceType) + + d.Set(isBareMetalServerNicMacAddress, *nic.MacAddress) + d.Set(isBareMetalServerNicName, *nic.Name) + if nic.PortSpeed != nil { + d.Set(isBareMetalServerNicPortSpeed, *nic.PortSpeed) + } + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + d.Set(isBareMetalServerNicPrimaryIP, primaryIpList) + + d.Set(isBareMetalServerNicResourceType, *nic.ResourceType) + + if nic.SecurityGroups != nil && len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + d.Set(isBareMetalServerNicSecurityGroups, flex.NewStringSet(schema.HashString, secgrpList)) + } + + d.Set(isBareMetalServerNicStatus, *nic.Status) + d.Set(isBareMetalServerNicSubnet, *nic.Subnet.ID) + d.Set(isBareMetalServerNicType, *nic.Type) + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nic := nicIntf.(*vpcv1.BareMetalServerNetworkInterfaceByVlan) + d.SetId(MakeTerraformNICID(bareMetalServerId, *nic.ID)) + d.Set(isBareMetalServerNicAllowIPSpoofing, *nic.AllowIPSpoofing) + d.Set(isBareMetalServerNicEnableInfraNAT, *nic.EnableInfrastructureNat) + d.Set(isBareMetalServerNicStatus, *nic.Status) + floatingIPList := make([]map[string]interface{}, 0) + if nic.FloatingIps != nil { + for _, ip := range nic.FloatingIps { + currentIP := map[string]interface{}{ + isBareMetalServerNicIpID: *ip.ID, + isBareMetalServerNicIpAddress: *ip.Address, + } + floatingIPList = append(floatingIPList, currentIP) + } + } + d.Set(isBareMetalServerNicFloatingIPs, floatingIPList) + + d.Set(isBareMetalServerNicHref, nic.Href) + d.Set(isBareMetalServerNicID, *nic.ID) + d.Set(isBareMetalServerNicInterfaceType, *nic.InterfaceType) + + d.Set(isBareMetalServerNicMacAddress, *nic.MacAddress) + d.Set(isBareMetalServerNicName, *nic.Name) + d.Set(isBareMetalServerNicPortSpeed, nic.PortSpeed) + + primaryIpList := make([]map[string]interface{}, 0) + currentIP := map[string]interface{}{ + + isBareMetalServerNicIpAddress: *nic.PrimaryIpv4Address, + } + primaryIpList = append(primaryIpList, currentIP) + d.Set(isBareMetalServerNicPrimaryIP, primaryIpList) + + d.Set(isBareMetalServerNicResourceType, nic.ResourceType) + + if len(nic.SecurityGroups) != 0 { + secgrpList := []string{} + for i := 0; i < len(nic.SecurityGroups); i++ { + secgrpList = append(secgrpList, string(*(nic.SecurityGroups[i].ID))) + } + d.Set(isBareMetalServerNicSecurityGroups, flex.NewStringSet(schema.HashString, secgrpList)) + } + + d.Set(isBareMetalServerNicStatus, *nic.Status) + d.Set(isBareMetalServerNicSubnet, *nic.Subnet.ID) + d.Set(isBareMetalServerNicType, *nic.Type) + d.Set(isBareMetalServerNicAllowInterfaceToFloat, *nic.AllowInterfaceToFloat) + d.Set(isBareMetalServerNicVlan, *nic.Vlan) + } + } + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceAllowFloatUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + bareMetalServerId, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + options := &vpcv1.UpdateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + nicPatchModel := &vpcv1.BareMetalServerNetworkInterfacePatch{} + flag := false + if d.HasChange(isBareMetalServerNicAllowIPSpoofing) { + flag = true + aisBool := false + if ais, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + aisBool = ais.(bool) + } + nicPatchModel.AllowIPSpoofing = &aisBool + } + if d.HasChange(isBareMetalServerNicEnableInfraNAT) { + flag = true + einBool := false + if ein, ok := d.GetOk(isBareMetalServerNicEnableInfraNAT); ok { + einBool = ein.(bool) + } + nicPatchModel.EnableInfrastructureNat = &einBool + } + if d.HasChange(isBareMetalServerNicName) { + flag = true + nameStr := "" + if name, ok := d.GetOk(isBareMetalServerNicName); ok { + nameStr = name.(string) + } + nicPatchModel.Name = &nameStr + } + + if flag { + nicPatchModelAsPatch, err := nicPatchModel.AsPatch() + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error calling asPatch for BareMetalServerNetworkInterfacePatch %s", err)) + } + options.BareMetalServerNetworkInterfacePatch = nicPatchModelAsPatch + + nicIntf, response, err := sess.UpdateBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating Bare Metal Server: %s\n%s", err, response)) + } + return diag.FromErr(bareMetalServerNICGet(d, meta, nicIntf, bareMetalServerId)) + } + + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceAllowFloatDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerId, nicId, err := ParseNICTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = bareMetalServerNetworkInterfaceAllowFloatDelete(context, d, meta, bareMetalServerId, nicId) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func bareMetalServerNetworkInterfaceAllowFloatDelete(context context.Context, d *schema.ResourceData, meta interface{}, bareMetalServerId, nicId string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + + getBmsNicOptions := &vpcv1.GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + nicIntf, response, err := sess.GetBareMetalServerNetworkInterfaceWithContext(context, getBmsNicOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface(%s) : %s\n%s", bareMetalServerId, nicId, err, response) + } + nicType := "" + switch reflect.TypeOf(nicIntf).String() { + case "*vpcv1.BareMetalServerNetworkInterfaceByPci": + { + nicType = "pci" + log.Printf("[DEBUG] PCI type network interface needs the server in stopped state") + log.Printf("[DEBUG] Stopping the bare metal server %s", bareMetalServerId) + // to delete pci, server needs to be in stopped state + + getbmsoptions := &vpcv1.GetBareMetalServerOptions{ + ID: &bareMetalServerId, + } + + bms, response, err := sess.GetBareMetalServerWithContext(context, getbmsoptions) + if err != nil { + return fmt.Errorf("[ERROR] Error fetching bare metal server (%s) err %s\n%s", bareMetalServerId, err, response) + } + // failed, pending, restarting, running, starting, stopped, stopping, maintenance + if *bms.Status == "failed" { + return fmt.Errorf("[ERROR] Error cannot detach network interface from a failed bare metal server") + } else if *bms.Status == "running" { + log.Printf("[DEBUG] Stopping bare metal server (%s) to create a PCI network interface", bareMetalServerId) + stopType := "soft" + if d.Get(isBareMetalServerHardStop).(bool) { + stopType = "hard" + } + createstopaction := &vpcv1.StopBareMetalServerOptions{ + ID: &bareMetalServerId, + Type: &stopType, + } + res, err := sess.StopBareMetalServerWithContext(context, createstopaction) + if err != nil || res.StatusCode != 204 { + return fmt.Errorf("[ERROR] Error stopping bare metal server (%s) err %s\n%s", bareMetalServerId, err, response) + } + _, err = isWaitForBareMetalServerStoppedForNIC(sess, bareMetalServerId, d.Timeout(schema.TimeoutCreate), d) + if err != nil || res.StatusCode != 204 { + return err + } + } else if *bms.Status != "stopped" { + return fmt.Errorf("[ERROR] Error bare metal server in %s state, please try after some time", *bms.Status) + } + } + case "*vpcv1.BareMetalServerNetworkInterfaceByVlan": + { + nicType = "vlan" + } + } + + options := &vpcv1.DeleteBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: &bareMetalServerId, + ID: &nicId, + } + response, err = sess.DeleteBareMetalServerNetworkInterfaceWithContext(context, options) + if err != nil { + return fmt.Errorf("[ERROR] Error Deleting Bare Metal Server (%s) network interface (%s) : %s\n%s", bareMetalServerId, nicId, err, response) + } + _, err = isWaitForBareMetalServerNetworkInterfaceDeleted(sess, bareMetalServerId, nicId, nicType, nicIntf, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return err + } + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface_floating_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface_floating_ip.go new file mode 100644 index 0000000000..68838fd8db --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_bare_metal_server_network_interface_floating_ip.go @@ -0,0 +1,373 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isBareMetalServerNetworkInterfaceFloatingIpAvailable = "available" + isBareMetalServerNetworkInterfaceFloatingIpDeleting = "deleting" + isBareMetalServerNetworkInterfaceFloatingIpPending = "pending" + isBareMetalServerNetworkInterfacePCIFloatingIpPending = "pci_pending" + isBareMetalServerNetworkInterfaceFloatingIpDeleted = "deleted" + isBareMetalServerNetworkInterfaceFloatingIpFailed = "failed" + isBareMetalServerFloatingIpHardStop = "hard_stop" +) + +func ResourceIBMIsBareMetalServerNetworkInterfaceFloatingIp() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISBareMetalServerNetworkInterfaceFloatingIpCreate, + ReadContext: resourceIBMISBareMetalServerNetworkInterfaceFloatingIpRead, + UpdateContext: resourceIBMISBareMetalServerNetworkInterfaceFloatingIpUpdate, + DeleteContext: resourceIBMISBareMetalServerNetworkInterfaceFloatingIpDelete, + Importer: &schema.ResourceImporter{}, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isBareMetalServerID: { + Type: schema.TypeString, + Required: true, + Description: "Bare metal server identifier", + }, + isBareMetalServerNetworkInterface: { + Type: schema.TypeString, + Required: true, + Description: "Bare metal server network interface identifier", + }, + isBareMetalServerNetworkInterfaceFloatingIPID: { + Type: schema.TypeString, + Required: true, + Description: "The floating ip identifier of the network interface associated with the bare metal server", + }, + floatingIPName: { + Type: schema.TypeString, + Computed: true, + Description: "Name of the floating IP", + }, + + floatingIPAddress: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP address", + }, + + floatingIPStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP status", + }, + + floatingIPZone: { + Type: schema.TypeString, + Computed: true, + Description: "Zone name", + }, + + floatingIPTarget: { + Type: schema.TypeString, + Computed: true, + Description: "Target info", + }, + + floatingIPCRN: { + Type: schema.TypeString, + Computed: true, + Description: "Floating IP crn", + }, + }, + } +} + +func resourceIBMISBareMetalServerNetworkInterfaceFloatingIpCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + bareMetalServerId := "" + if bmsId, ok := d.GetOk(isBareMetalServerID); ok { + bareMetalServerId = bmsId.(string) + } + bareMetalServerNicId := "" + if nicId, ok := d.GetOk(isBareMetalServerNetworkInterface); ok { + if strings.Contains(nicId.(string), "/") { + _, bareMetalServerNicId, err = ParseNICTerraformID(nicId.(string)) + if err != nil { + return diag.FromErr(err) + } + } else { + bareMetalServerNicId = nicId.(string) + } + + } + bareMetalServerNicFipId := "" + if fipId, ok := d.GetOk(isBareMetalServerNetworkInterfaceFloatingIPID); ok { + bareMetalServerNicFipId = fipId.(string) + } + + options := &vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &bareMetalServerNicId, + ID: &bareMetalServerNicFipId, + } + + fip, response, err := sess.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(context, options) + if err != nil || fip == nil { + return diag.FromErr(fmt.Errorf("[DEBUG] Create bare metal server (%s) network interface (%s) floating ip (%s) err %s\n%s", bareMetalServerId, bareMetalServerNicId, bareMetalServerNicFipId, err, response)) + } + d.SetId(MakeTerraformNICFipID(bareMetalServerId, bareMetalServerNicId, *fip.ID)) + err = bareMetalServerNICFipGet(d, fip, bareMetalServerId, bareMetalServerNicId) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceFloatingIpRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerId, nicID, fipId, err := ParseNICFipTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + options := &vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &nicID, + ID: &fipId, + } + + fip, response, err := sess.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context, options) + if err != nil || fip == nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface (%s): %s\n%s", bareMetalServerId, nicID, err, response)) + } + err = bareMetalServerNICFipGet(d, fip, bareMetalServerId, nicID) + if err != nil { + return diag.FromErr(err) + } + return nil +} + +func bareMetalServerNICFipGet(d *schema.ResourceData, fip *vpcv1.FloatingIP, bareMetalServerId, nicId string) error { + + d.SetId(MakeTerraformNICFipID(bareMetalServerId, nicId, *fip.ID)) + d.Set(floatingIPName, *fip.Name) + d.Set(floatingIPAddress, *fip.Address) + d.Set(floatingIPStatus, fip.Status) + d.Set(floatingIPZone, *fip.Zone.Name) + + d.Set(floatingIPCRN, *fip.CRN) + + target, ok := fip.Target.(*vpcv1.FloatingIPTarget) + if ok { + d.Set(floatingIPTarget, target.ID) + } + + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceFloatingIpUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + if d.HasChange(isBareMetalServerNetworkInterfaceFloatingIPID) { + bareMetalServerId, nicId, _, err := ParseNICFipTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + floatingIpId := "" + if fipOk, ok := d.GetOk(isBareMetalServerNetworkInterfaceFloatingIPID); ok { + floatingIpId = fipOk.(string) + } + options := &vpcv1.AddBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &nicId, + ID: &floatingIpId, + } + + fip, response, err := sess.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(context, options) + if err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error updating Bare Metal Server: %s\n%s", err, response)) + } + d.SetId(MakeTerraformNICFipID(bareMetalServerId, nicId, *fip.ID)) + return diag.FromErr(bareMetalServerNICFipGet(d, fip, bareMetalServerId, nicId)) + } + return nil +} + +func resourceIBMISBareMetalServerNetworkInterfaceFloatingIpDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bareMetalServerId, nicId, fipId, err := ParseNICFipTerraformID(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + err = bareMetalServerNetworkInterfaceFipDelete(context, d, meta, bareMetalServerId, nicId, fipId) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func bareMetalServerNetworkInterfaceFipDelete(context context.Context, d *schema.ResourceData, meta interface{}, bareMetalServerId, nicId, fipId string) error { + sess, err := vpcClient(meta) + if err != nil { + return err + } + + getBmsNicFipOptions := &vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &nicId, + ID: &fipId, + } + fip, response, err := sess.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context, getBmsNicFipOptions) + if err != nil || fip == nil { + if response != nil && response.StatusCode == 404 { + return nil + } + return fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) network interface(%s) Floating Ip(%s) : %s\n%s", bareMetalServerId, nicId, fipId, err, response) + } + + options := &vpcv1.RemoveBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &nicId, + ID: &fipId, + } + response, err = sess.RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(context, options) + if err != nil { + return fmt.Errorf("[ERROR] Error Deleting Bare Metal Server (%s) network interface (%s) Floating Ip(%s) : %s\n%s", bareMetalServerId, nicId, fipId, err, response) + } + _, err = isWaitForBareMetalServerNetworkInterfaceFloatingIpDeleted(sess, bareMetalServerId, nicId, fipId, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return err + } + d.SetId("") + return nil +} + +func isWaitForBareMetalServerNetworkInterfaceFloatingIpDeleted(bmsC *vpcv1.VpcV1, bareMetalServerId, nicId, fipId string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for (%s) / (%s) / (%s) to be deleted.", bareMetalServerId, nicId, fipId) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerNetworkInterfaceFloatingIpAvailable, isBareMetalServerNetworkInterfaceFloatingIpDeleting, isBareMetalServerNetworkInterfaceFloatingIpPending}, + Target: []string{isBareMetalServerNetworkInterfaceFloatingIpDeleted, isBareMetalServerNetworkInterfaceFailed, ""}, + Refresh: isBareMetalServerNetworkInterfaceFloatingIpDeleteRefreshFunc(bmsC, bareMetalServerId, nicId, fipId), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isBareMetalServerNetworkInterfaceFloatingIpDeleteRefreshFunc(bmsC *vpcv1.VpcV1, bareMetalServerId, nicId, fipId string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + + getBmsNicFloatingIpOptions := &vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &nicId, + ID: &fipId, + } + fip, response, err := bmsC.GetBareMetalServerNetworkInterfaceFloatingIP(getBmsNicFloatingIpOptions) + + if err != nil { + if response != nil && response.StatusCode == 404 { + return fip, isBareMetalServerNetworkInterfaceFloatingIpDeleted, nil + } + return fip, isBareMetalServerNetworkInterfaceFloatingIpFailed, fmt.Errorf("[ERROR] Error getting Bare Metal Server(%s) Network Interface (%s) FloatingIp(%s) : %s\n%s", bareMetalServerId, nicId, fipId, err, response) + } + return fip, isBareMetalServerNetworkInterfaceFloatingIpDeleting, err + } +} + +func isWaitForBareMetalServerNetworkInterfaceFloatingIpAvailable(client *vpcv1.VpcV1, bareMetalServerId, nicId, fipId string, timeout time.Duration, d *schema.ResourceData) (interface{}, error) { + log.Printf("Waiting for Bare Metal Server (%s) Network Interface (%s) to be available.", bareMetalServerId, nicId) + communicator := make(chan interface{}) + stateConf := &resource.StateChangeConf{ + Pending: []string{isBareMetalServerNetworkInterfaceFloatingIpPending}, + Target: []string{isBareMetalServerNetworkInterfaceFloatingIpAvailable, isBareMetalServerNetworkInterfaceFloatingIpFailed}, + Refresh: isBareMetalServerNetworkInterfaceFloatingIpRefreshFunc(client, bareMetalServerId, nicId, fipId, d, communicator), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + return stateConf.WaitForState() +} + +func isBareMetalServerNetworkInterfaceFloatingIpRefreshFunc(client *vpcv1.VpcV1, bareMetalServerId, nicId, fipId string, d *schema.ResourceData, communicator chan interface{}) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + getBmsNicFloatingIpOptions := &vpcv1.GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: &bareMetalServerId, + NetworkInterfaceID: &nicId, + ID: &fipId, + } + fip, response, err := client.GetBareMetalServerNetworkInterfaceFloatingIP(getBmsNicFloatingIpOptions) + if err != nil { + return nil, "", fmt.Errorf("[ERROR] Error getting Bare Metal Server (%s) Network Interface (%s) FloatingIp(%s) : %s\n%s", bareMetalServerId, nicId, fipId, err, response) + } + status := "" + + status = *fip.Status + d.Set(floatingIPStatus, *fip.Status) + + select { + case data := <-communicator: + return nil, "", data.(error) + default: + fmt.Println("no message sent") + } + + if status == "available" || status == "failed" { + close(communicator) + return fip, status, nil + + } + + return fip, "pending", nil + } +} + +func MakeTerraformNICFipID(id1, id2, id3 string) string { + // Include bare metal sever id, network interface id, floating ip id to create a unique Terraform id. As a bonus, + // we can extract the bare metal sever id as needed for API calls such as READ. + return fmt.Sprintf("%s/%s/%s", id1, id2, id3) +} + +func ParseNICFipTerraformID(s string) (string, string, string, error) { + segments := strings.Split(s, "/") + if len(segments) != 3 { + return "", "", "", fmt.Errorf("invalid terraform Id %s (incorrect number of segments)", s) + } + if segments[0] == "" || segments[1] == "" || segments[2] == "" { + return "", "", "", fmt.Errorf("invalid terraform Id %s (one or more empty segments)", s) + } + return segments[0], segments[1], segments[2], nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host.go index dcf84b4e78..2c2de7651b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,6 +9,9 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -34,7 +37,7 @@ const ( isDedicatedHostStatusFailed = "failed" ) -func resourceIbmIsDedicatedHost() *schema.Resource { +func ResourceIbmIsDedicatedHost() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmIsDedicatedHostCreate, ReadContext: resourceIbmIsDedicatedHostRead, @@ -53,7 +56,7 @@ func resourceIbmIsDedicatedHost() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_dedicated_host", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_dedicated_host", "name"), Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, "profile": { @@ -109,45 +112,45 @@ func resourceIbmIsDedicatedHost() *schema.Resource { Computed: true, Description: "The CRN for this dedicated host.", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Computed: true, Description: "Collection of the dedicated host's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "available": &schema.Schema{ + "available": { Type: schema.TypeInt, Computed: true, Description: "The remaining space left for instance placement in GB (gigabytes).", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this disk.", }, - "instance_disks": &schema.Schema{ + "instance_disks": { Type: schema.TypeList, Computed: true, Description: "Instance disks that are on this dedicated host disk.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -155,22 +158,22 @@ func resourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", @@ -178,37 +181,37 @@ func resourceIbmIsDedicatedHost() *schema.Resource { }, }, }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the diskThe enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "lifecycle_state": &schema.Schema{ + "lifecycle_state": { Type: schema.TypeString, Computed: true, Description: "The lifecycle state of this dedicated host disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined or system-provided name for this disk.", }, - "provisionable": &schema.Schema{ + "provisionable": { Type: schema.TypeBool, Computed: true, Description: "Indicates whether this dedicated host disk is available for instance disk creation.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", }, - "supported_instance_interface_types": &schema.Schema{ + "supported_instance_interface_types": { Type: schema.TypeList, Computed: true, Description: "The instance disk interfaces supported for this dedicated host disk.", @@ -342,25 +345,25 @@ func resourceIbmIsDedicatedHost() *schema.Resource { } } -func resourceIbmIsDedicatedHostValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIbmIsDedicatedHostValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63, }) - resourceValidator := ResourceValidator{ResourceName: "ibm_is_dedicated_host", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_dedicated_host", Schema: validateSchema} return &resourceValidator } func resourceIbmIsDedicatedHostCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -420,7 +423,7 @@ func resourceIbmIsDedicatedHostCreate(context context.Context, d *schema.Resourc } func resourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -439,18 +442,18 @@ func resourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceD return diag.FromErr(err) } - if err = d.Set("available_memory", intValue(dedicatedHost.AvailableMemory)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting available_memory: %s", err)) + if err = d.Set("available_memory", flex.IntValue(dedicatedHost.AvailableMemory)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting available_memory: %s", err)) } availableVcpuMap := resourceIbmIsDedicatedHostVCPUToMap(*dedicatedHost.AvailableVcpu) if err = d.Set("available_vcpu", []map[string]interface{}{availableVcpuMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting available_vcpu: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting available_vcpu: %s", err)) } if err = d.Set("created_at", dedicatedHost.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", dedicatedHost.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } disks := []map[string]interface{}{} for _, disksItem := range dedicatedHost.Disks { @@ -458,15 +461,15 @@ func resourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceD disks = append(disks, disksItemMap) } if err = d.Set("disks", disks); err != nil { - return diag.FromErr(fmt.Errorf("Error setting disks: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting disks: %s", err)) } d.Set("host_group", *dedicatedHost.Group.ID) if err = d.Set("href", dedicatedHost.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("instance_placement_enabled", dedicatedHost.InstancePlacementEnabled); err != nil { - return diag.FromErr(fmt.Errorf("Error setting instance_placement_enabled: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instance_placement_enabled: %s", err)) } instances := []map[string]interface{}{} for _, instancesItem := range dedicatedHost.Instances { @@ -474,35 +477,35 @@ func resourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceD instances = append(instances, instancesItemMap) } if err = d.Set("instances", instances); err != nil { - return diag.FromErr(fmt.Errorf("Error setting instances: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting instances: %s", err)) } if err = d.Set("lifecycle_state", dedicatedHost.LifecycleState); err != nil { - return diag.FromErr(fmt.Errorf("Error setting lifecycle_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } - if err = d.Set("memory", intValue(dedicatedHost.Memory)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting memory: %s", err)) + if err = d.Set("memory", flex.IntValue(dedicatedHost.Memory)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting memory: %s", err)) } if err = d.Set("name", dedicatedHost.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set("profile", *dedicatedHost.Profile.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting profile: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting profile: %s", err)) } if err = d.Set("provisionable", dedicatedHost.Provisionable); err != nil { - return diag.FromErr(fmt.Errorf("Error setting provisionable: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting provisionable: %s", err)) } if err = d.Set("resource_group", *dedicatedHost.ResourceGroup.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } if err = d.Set("resource_type", dedicatedHost.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } - if err = d.Set("socket_count", intValue(dedicatedHost.SocketCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting socket_count: %s", err)) + if err = d.Set("socket_count", flex.IntValue(dedicatedHost.SocketCount)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting socket_count: %s", err)) } if err = d.Set("state", dedicatedHost.State); err != nil { - return diag.FromErr(fmt.Errorf("Error setting state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting state: %s", err)) } supportedInstanceProfiles := []map[string]interface{}{} for _, supportedInstanceProfilesItem := range dedicatedHost.SupportedInstanceProfiles { @@ -510,15 +513,15 @@ func resourceIbmIsDedicatedHostRead(context context.Context, d *schema.ResourceD supportedInstanceProfiles = append(supportedInstanceProfiles, supportedInstanceProfilesItemMap) } if err = d.Set("supported_instance_profiles", supportedInstanceProfiles); err != nil { - return diag.FromErr(fmt.Errorf("Error setting supported_instance_profiles: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting supported_instance_profiles: %s", err)) } vcpuMap := resourceIbmIsDedicatedHostVCPUToMap(*dedicatedHost.Vcpu) if err = d.Set("vcpu", []map[string]interface{}{vcpuMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting vcpu: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting vcpu: %s", err)) } if err = d.Set("zone", *dedicatedHost.Zone.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting zone: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone: %s", err)) } return nil @@ -528,7 +531,7 @@ func resourceIbmIsDedicatedHostVCPUToMap(vCPU vpcv1.Vcpu) map[string]interface{} vCPUMap := map[string]interface{}{} vCPUMap["architecture"] = vCPU.Architecture - vCPUMap["count"] = intValue(vCPU.Count) + vCPUMap["count"] = flex.IntValue(vCPU.Count) return vCPUMap } @@ -566,7 +569,7 @@ func resourceIbmIsDedicatedHostInstanceProfileReferenceToMap(instanceProfileRefe } func resourceIbmIsDedicatedHostUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -615,7 +618,7 @@ func resourceIbmIsDedicatedHostUpdate(context context.Context, d *schema.Resourc } func resourceIbmIsDedicatedHostDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -679,10 +682,10 @@ func isWaitForDedicatedHostDelete(instanceC *vpcv1.VpcV1, d *schema.ResourceData if response != nil && response.StatusCode == 404 { return dedicatedhost, isDedicatedHostDeleteDone, nil } - return nil, "", fmt.Errorf("Error getting dedicated Host: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error getting dedicated Host: %s\n%s", err, response) } if *dedicatedhost.State == isDedicatedHostFailed { - return dedicatedhost, *dedicatedhost.State, fmt.Errorf("The Dedicated host %s failed to delete: %v", d.Id(), err) + return dedicatedhost, *dedicatedhost.State, fmt.Errorf("[ERROR] The Dedicated host %s failed to delete: %v", d.Id(), err) } return dedicatedhost, isDedicatedHostDeleting, nil }, @@ -716,7 +719,7 @@ func isDedicatedHostRefreshFunc(instanceC *vpcv1.VpcV1, id string, d *schema.Res } dhost, response, err := instanceC.GetDedicatedHost(getinsOptions) if dhost == nil || err != nil { - return nil, "", fmt.Errorf("Error getting dedicated host : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error getting dedicated host : %s\n%s", err, response) } d.Set("state", *dhost.State) d.Set("lifecycle_state", *dhost.LifecycleState) @@ -733,7 +736,7 @@ func isDedicatedHostRefreshFunc(instanceC *vpcv1.VpcV1, id string, d *schema.Res func resourceIbmIsDedicatedHostDedicatedHostDiskToMap(dedicatedHostDisk vpcv1.DedicatedHostDisk) map[string]interface{} { dedicatedHostDiskMap := map[string]interface{}{} - dedicatedHostDiskMap["available"] = intValue(dedicatedHostDisk.Available) + dedicatedHostDiskMap["available"] = flex.IntValue(dedicatedHostDisk.Available) dedicatedHostDiskMap["created_at"] = dedicatedHostDisk.CreatedAt.String() dedicatedHostDiskMap["href"] = dedicatedHostDisk.Href dedicatedHostDiskMap["id"] = dedicatedHostDisk.ID @@ -751,7 +754,7 @@ func resourceIbmIsDedicatedHostDedicatedHostDiskToMap(dedicatedHostDisk vpcv1.De dedicatedHostDiskMap["name"] = dedicatedHostDisk.Name dedicatedHostDiskMap["provisionable"] = dedicatedHostDisk.Provisionable dedicatedHostDiskMap["resource_type"] = dedicatedHostDisk.ResourceType - dedicatedHostDiskMap["size"] = intValue(dedicatedHostDisk.Size) + dedicatedHostDiskMap["size"] = flex.IntValue(dedicatedHostDisk.Size) dedicatedHostDiskMap["supported_instance_interface_types"] = dedicatedHostDisk.SupportedInstanceInterfaceTypes return dedicatedHostDiskMap diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host_disk_management.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host_disk_management.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host_disk_management.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host_disk_management.go index 4fa208d44b..1730b84d6a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host_disk_management.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host_disk_management.go @@ -1,18 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const () -func resourceIBMISDedicatedHostDiskManagement() *schema.Resource { +func ResourceIBMISDedicatedHostDiskManagement() *schema.Resource { return &schema.Resource{ Create: resourceIBMisDedicatedHostDiskManagementCreate, Read: resourceIBMisDedicatedHostDiskManagementRead, @@ -27,21 +28,21 @@ func resourceIBMISDedicatedHostDiskManagement() *schema.Resource { ForceNew: true, Description: "ID of the dedicated host for which disks has to be managed", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Required: true, Description: "Disk information that has to be updated.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Required: true, Description: "The unique identifier for this disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_dedicated_host_disk_management", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_dedicated_host_disk_management", "name"), Description: "The user-defined name for this disk. The disk will be updated with this new name", }, }, @@ -51,20 +52,20 @@ func resourceIBMISDedicatedHostDiskManagement() *schema.Resource { } } -func resourceIBMISDedicatedHostDiskManagementValidator() *ResourceValidator { +func ResourceIBMISDedicatedHostDiskManagementValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmISDedicatedHostDiskManagementValidator := ResourceValidator{ResourceName: "ibm_is_dedicated_host_disk_management", Schema: validateSchema} + ibmISDedicatedHostDiskManagementValidator := validate.ResourceValidator{ResourceName: "ibm_is_dedicated_host_disk_management", Schema: validateSchema} return &ibmISDedicatedHostDiskManagementValidator } @@ -91,13 +92,13 @@ func resourceIBMisDedicatedHostDiskManagementCreate(d *schema.ResourceData, meta dedicatedHostDiskPatch, err := dedicatedHostDiskPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for DedicatedHostDiskPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for DedicatedHostDiskPatch: %s", err) } updateDedicatedHostDiskOptions.SetDedicatedHostDiskPatch(dedicatedHostDiskPatch) _, _, err = sess.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions) if err != nil { - return fmt.Errorf("Error calling UpdateDedicatedHostDisk: %s", err) + return fmt.Errorf("[ERROR] Error calling UpdateDedicatedHostDisk: %s", err) } } @@ -128,13 +129,13 @@ func resourceIBMisDedicatedHostDiskManagementUpdate(d *schema.ResourceData, meta dedicatedHostDiskPatch, err := dedicatedHostDiskPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for DedicatedHostDiskPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for DedicatedHostDiskPatch: %s", err) } updateDedicatedHostDiskOptions.SetDedicatedHostDiskPatch(dedicatedHostDiskPatch) _, response, err := sess.UpdateDedicatedHostDisk(updateDedicatedHostDiskOptions) if err != nil { - return fmt.Errorf("Error updating dedicated host disk: %s %s", err, response) + return fmt.Errorf("[ERROR] Error updating dedicated host disk: %s %s", err, response) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host_group.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host_group.go index bd75fe714f..5c769a973e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_dedicated_host_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_dedicated_host_group.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -15,7 +17,7 @@ import ( "github.com/IBM/vpc-go-sdk/vpcv1" ) -func resourceIbmIsDedicatedHostGroup() *schema.Resource { +func ResourceIbmIsDedicatedHostGroup() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmIsDedicatedHostGroupCreate, ReadContext: resourceIbmIsDedicatedHostGroupRead, @@ -24,67 +26,67 @@ func resourceIbmIsDedicatedHostGroup() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "class": &schema.Schema{ + "class": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The dedicated host profile class for hosts in this group.", }, - "family": &schema.Schema{ + "family": { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_dedicated_host_group", "family"), + ValidateFunc: validate.InvokeValidator("ibm_is_dedicated_host_group", "family"), Description: "The dedicated host profile family for hosts in this group.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_dedicated_host_group", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_dedicated_host_group", "name"), Description: "The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_group": &schema.Schema{ + "resource_group": { Type: schema.TypeString, Optional: true, ForceNew: true, Computed: true, Description: "The unique identifier of the resource group to use. If unspecified, the account's [default resourcegroup](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.", }, - "zone": &schema.Schema{ + "zone": { Type: schema.TypeString, Required: true, ForceNew: true, Description: "The globally unique name of the zone this dedicated host group will reside in.", }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the dedicated host group was created.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host group.", }, - "dedicated_hosts": &schema.Schema{ + "dedicated_hosts": { Type: schema.TypeList, Computed: true, Description: "The dedicated hosts that are in this dedicated host group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this dedicated host.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -92,22 +94,22 @@ func resourceIbmIsDedicatedHostGroup() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this dedicated host.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", @@ -115,28 +117,28 @@ func resourceIbmIsDedicatedHostGroup() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this dedicated host group.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", }, - "supported_instance_profiles": &schema.Schema{ + "supported_instance_profiles": { Type: schema.TypeList, Computed: true, Description: "Array of instance profiles that can be used by instances placed on this dedicated host group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this virtual server instance profile.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The globally unique name for this virtual server instance profile.", @@ -148,33 +150,33 @@ func resourceIbmIsDedicatedHostGroup() *schema.Resource { } } -func resourceIbmIsDedicatedHostGroupValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIbmIsDedicatedHostGroupValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "family", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "balanced, compute, memory", }) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63, }) - resourceValidator := ResourceValidator{ResourceName: "ibm_is_dedicated_host_group", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_dedicated_host_group", Schema: validateSchema} return &resourceValidator } func resourceIbmIsDedicatedHostGroupCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -235,7 +237,7 @@ func resourceIbmIsDedicatedHostGroupMapToResourceGroupIdentityByID(resourceGroup } func resourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -255,31 +257,31 @@ func resourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.Reso } if err = d.Set("class", dedicatedHostGroup.Class); err != nil { - return diag.FromErr(fmt.Errorf("Error setting class: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting class: %s", err)) } if err = d.Set("family", dedicatedHostGroup.Family); err != nil { - return diag.FromErr(fmt.Errorf("Error setting family: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting family: %s", err)) } if err = d.Set("name", dedicatedHostGroup.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if dedicatedHostGroup.ResourceGroup != nil { resourceGroupID := *dedicatedHostGroup.ResourceGroup.ID if err = d.Set("resource_group", resourceGroupID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } } if dedicatedHostGroup.Zone != nil { zoneName := *dedicatedHostGroup.Zone.Name if err = d.Set("zone", zoneName); err != nil { - return diag.FromErr(fmt.Errorf("Error setting zone: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting zone: %s", err)) } } if err = d.Set("created_at", dedicatedHostGroup.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", dedicatedHostGroup.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } dedicatedHosts := []map[string]interface{}{} for _, dedicatedHostsItem := range dedicatedHostGroup.DedicatedHosts { @@ -287,13 +289,13 @@ func resourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.Reso dedicatedHosts = append(dedicatedHosts, dedicatedHostsItemMap) } if err = d.Set("dedicated_hosts", dedicatedHosts); err != nil { - return diag.FromErr(fmt.Errorf("Error setting dedicated_hosts: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting dedicated_hosts: %s", err)) } if err = d.Set("href", dedicatedHostGroup.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("resource_type", dedicatedHostGroup.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } supportedInstanceProfiles := []map[string]interface{}{} for _, supportedInstanceProfilesItem := range dedicatedHostGroup.SupportedInstanceProfiles { @@ -301,7 +303,7 @@ func resourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.Reso supportedInstanceProfiles = append(supportedInstanceProfiles, supportedInstanceProfilesItemMap) } if err = d.Set("supported_instance_profiles", supportedInstanceProfiles); err != nil { - return diag.FromErr(fmt.Errorf("Error setting supported_instance_profiles: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting supported_instance_profiles: %s", err)) } return nil @@ -382,7 +384,7 @@ func resourceIbmIsDedicatedHostGroupInstanceProfileReferenceToMap(instanceProfil } func resourceIbmIsDedicatedHostGroupUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -419,7 +421,7 @@ func resourceIbmIsDedicatedHostGroupUpdate(context context.Context, d *schema.Re } func resourceIbmIsDedicatedHostGroupDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_floating_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_floating_ip.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_floating_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_floating_ip.go index 7189b6e233..1de8cb4427 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_floating_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_floating_ip.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,9 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -32,7 +35,7 @@ const ( isFloatingIPDeleted = "done" ) -func resourceIBMISFloatingIP() *schema.Resource { +func ResourceIBMISFloatingIP() *schema.Resource { return &schema.Resource{ Create: resourceIBMISFloatingIPCreate, Read: resourceIBMISFloatingIPRead, @@ -49,7 +52,7 @@ func resourceIBMISFloatingIP() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), customdiff.Sequence( @@ -87,7 +90,7 @@ func resourceIBMISFloatingIP() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_floating_ip", isFloatingIPName), + ValidateFunc: validate.InvokeValidator("ibm_is_floating_ip", isFloatingIPName), Description: "Name of the floating IP", }, @@ -126,24 +129,24 @@ func resourceIBMISFloatingIP() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_floating_ip", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_floating_ip", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Floating IP tags", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -155,13 +158,13 @@ func resourceIBMISFloatingIP() *schema.Resource { Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -171,33 +174,33 @@ func resourceIBMISFloatingIP() *schema.Resource { } func vpcClient(meta interface{}) (*vpcv1.VpcV1, error) { - sess, err := meta.(ClientSession).VpcV1API() + sess, err := meta.(conns.ClientSession).VpcV1API() return sess, err } -func resourceIBMISFloatingIPValidator() *ResourceValidator { +func ResourceIBMISFloatingIPValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isFloatingIPName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISFloatingIPResourceValidator := ResourceValidator{ResourceName: "ibm_is_floating_ip", Schema: validateSchema} + ibmISFloatingIPResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_floating_ip", Schema: validateSchema} return &ibmISFloatingIPResourceValidator } @@ -264,7 +267,7 @@ func fipCreate(d *schema.ResourceData, meta interface{}, name string) error { v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isFloatingIPTags); ok || v != "" { oldList, newList := d.GetChange(isFloatingIPTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *floatingip.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *floatingip.CRN) if err != nil { log.Printf( "Error on create of vpc Floating IP (%s) tags: %s", d.Id(), err) @@ -297,7 +300,7 @@ func fipGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Floating IP (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Floating IP (%s): %s\n%s", id, err, response) } d.Set(isFloatingIPName, *floatingip.Name) @@ -310,23 +313,23 @@ func fipGet(d *schema.ResourceData, meta interface{}, id string) error { } else { d.Set(isFloatingIPTarget, "") } - tags, err := GetTagsUsingCRN(meta, *floatingip.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *floatingip.CRN) if err != nil { log.Printf( "Error on get of vpc Floating IP (%s) tags: %s", d.Id(), err) } d.Set(isFloatingIPTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/floatingIPs") - d.Set(ResourceName, *floatingip.Name) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/floatingIPs") + d.Set(flex.ResourceName, *floatingip.Name) d.Set(isFloatingIPCRN, *floatingip.CRN) - d.Set(ResourceCRN, *floatingip.CRN) - d.Set(ResourceStatus, *floatingip.Status) + d.Set(flex.ResourceCRN, *floatingip.CRN) + d.Set(flex.ResourceStatus, *floatingip.Status) if floatingip.ResourceGroup != nil { - d.Set(ResourceGroupName, floatingip.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, floatingip.ResourceGroup.Name) d.Set(isFloatingIPResourceGroup, floatingip.ResourceGroup.ID) } return nil @@ -352,10 +355,10 @@ func fipUpdate(d *schema.ResourceData, meta interface{}, id string) error { } fip, response, err := sess.GetFloatingIP(options) if err != nil { - return fmt.Errorf("Error getting Floating IP: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Floating IP: %s\n%s", err, response) } oldList, newList := d.GetChange(isFloatingIPTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *fip.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *fip.CRN) if err != nil { log.Printf( "Error on update of vpc Floating IP (%s) tags: %s", id, err) @@ -372,7 +375,7 @@ func fipUpdate(d *schema.ResourceData, meta interface{}, id string) error { hasChanged = true floatingIPPatch, err := floatingIPPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for FloatingIPPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for FloatingIPPatch: %s", err) } options.FloatingIPPatch = floatingIPPatch } @@ -385,14 +388,14 @@ func fipUpdate(d *schema.ResourceData, meta interface{}, id string) error { hasChanged = true floatingIPPatch, err := floatingIPPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for floatingIPPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for floatingIPPatch: %s", err) } options.FloatingIPPatch = floatingIPPatch } if hasChanged { _, response, err := sess.UpdateFloatingIP(options) if err != nil { - return fmt.Errorf("Error updating vpc Floating IP: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating vpc Floating IP: %s\n%s", err, response) } } return nil @@ -421,7 +424,7 @@ func fipDelete(d *schema.ResourceData, meta interface{}, id string) error { return nil } - return fmt.Errorf("Error Getting Floating IP (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Floating IP (%s): %s\n%s", id, err, response) } options := &vpcv1.DeleteFloatingIPOptions{ @@ -429,7 +432,7 @@ func fipDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteFloatingIP(options) if err != nil { - return fmt.Errorf("Error Deleting Floating IP : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Floating IP : %s\n%s", err, response) } _, err = isWaitForFloatingIPDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -458,7 +461,7 @@ func fipExists(d *schema.ResourceData, meta interface{}, id string) (bool, error if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting floating IP: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting floating IP: %s\n%s", err, response) } return true, nil } @@ -489,7 +492,7 @@ func isFloatingIPDeleteRefreshFunc(fip *vpcv1.VpcV1, id string) resource.StateRe if response != nil && response.StatusCode == 404 { return FloatingIP, isFloatingIPDeleted, nil } - return FloatingIP, "", fmt.Errorf("Error Getting Floating IP: %s\n%s", err, response) + return FloatingIP, "", fmt.Errorf("[ERROR] Error Getting Floating IP: %s\n%s", err, response) } return FloatingIP, isFloatingIPDeleting, err } @@ -517,7 +520,7 @@ func isInstanceFloatingIPRefreshFunc(floatingipC *vpcv1.VpcV1, id string) resour } instance, response, err := floatingipC.GetFloatingIP(getfipoptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Floating IP for the instance: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Floating IP for the instance: %s\n%s", err, response) } if *instance.Status == "available" { @@ -543,7 +546,7 @@ func checkIfZoneChanged(oldNic, newNic, currentZone string, floatingipC *vpcv1.V if err != nil { return false } - start = GetNext(instances.Next) + start = flex.GetNext(instances.Next) allrecs = append(allrecs, instances.Instances...) if start == "" { break diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_flow_log.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_flow_log.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_flow_log.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_flow_log.go index 7cfd4a6f00..e8b67fb509 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_flow_log.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_flow_log.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -32,7 +34,7 @@ const ( isFlowLogTags = "tags" ) -func resourceIBMISFlowLog() *schema.Resource { +func ResourceIBMISFlowLog() *schema.Resource { return &schema.Resource{ Create: resourceIBMISFlowLogCreate, Read: resourceIBMISFlowLogRead, @@ -49,7 +51,7 @@ func resourceIBMISFlowLog() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -59,7 +61,7 @@ func resourceIBMISFlowLog() *schema.Resource { Required: true, ForceNew: false, Description: "Flow Log Collector name", - ValidateFunc: InvokeValidator("ibm_is_flow_log", isFlowLogName), + ValidateFunc: validate.InvokeValidator("ibm_is_flow_log", isFlowLogName), }, isFlowLogStorageBucket: { @@ -131,36 +133,36 @@ func resourceIBMISFlowLog() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_flow_log", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_flow_log", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the VPC Flow logs", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -169,30 +171,30 @@ func resourceIBMISFlowLog() *schema.Resource { } } -func resourceIBMISFlowLogValidator() *ResourceValidator { +func ResourceIBMISFlowLogValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isFlowLogName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISFlowLogValidator := ResourceValidator{ResourceName: "ibm_is_flow_log", Schema: validateSchema} + ibmISFlowLogValidator := validate.ResourceValidator{ResourceName: "ibm_is_flow_log", Schema: validateSchema} return &ibmISFlowLogValidator } @@ -238,7 +240,7 @@ func resourceIBMISFlowLogCreate(d *schema.ResourceData, meta interface{}) error v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isFlowLogTags); ok || v != "" { oldList, newList := d.GetChange(isFlowLogTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *flowlogCollector.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *flowlogCollector.CRN) if err != nil { log.Printf( "Error on create of resource vpc flow log (%s) tags: %s", d.Id(), err) @@ -262,7 +264,7 @@ func resourceIBMISFlowLogRead(d *schema.ResourceData, meta interface{}) error { } flowlogCollector, response, err := sess.GetFlowLogCollector(getOptions) if err != nil { - return fmt.Errorf("Error Getting Flow Log Collector: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Flow Log Collector: %s\n%s", err, response) } if flowlogCollector.Name != nil { @@ -304,25 +306,25 @@ func resourceIBMISFlowLogRead(d *schema.ResourceData, meta interface{}) error { d.Set(isFlowLogStorageBucket, *bucket.Name) } - tags, err := GetTagsUsingCRN(meta, *flowlogCollector.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *flowlogCollector.CRN) if err != nil { log.Printf( "Error on get of resource vpc flow log (%s) tags: %s", d.Id(), err) } d.Set(isFlowLogTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/flowLogs") - d.Set(ResourceName, *flowlogCollector.Name) - d.Set(ResourceCRN, *flowlogCollector.CRN) - d.Set(ResourceStatus, *flowlogCollector.LifecycleState) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/flowLogs") + d.Set(flex.ResourceName, *flowlogCollector.Name) + d.Set(flex.ResourceCRN, *flowlogCollector.CRN) + d.Set(flex.ResourceStatus, *flowlogCollector.LifecycleState) if flowlogCollector.ResourceGroup != nil { d.Set(isFlowLogResourceGroup, *flowlogCollector.ResourceGroup.ID) - d.Set(ResourceGroupName, *flowlogCollector.ResourceGroup.ID) + d.Set(flex.ResourceGroupName, *flowlogCollector.ResourceGroup.ID) } return nil @@ -342,12 +344,12 @@ func resourceIBMISFlowLogUpdate(d *schema.ResourceData, meta interface{}) error } flowlogCollector, response, err := sess.GetFlowLogCollector(getOptions) if err != nil { - return fmt.Errorf("Error Getting Flow Log Collector: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Flow Log Collector: %s\n%s", err, response) } if d.HasChange(isFlowLogTags) { oldList, newList := d.GetChange(isFlowLogTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *flowlogCollector.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *flowlogCollector.CRN) if err != nil { log.Printf( "Error on update of resource flow log (%s) tags: %s", *flowlogCollector.ID, err) @@ -366,12 +368,12 @@ func resourceIBMISFlowLogUpdate(d *schema.ResourceData, meta interface{}) error } flowLogCollectorPatch, err := flowLogCollectorPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for FlowLogCollectorPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for FlowLogCollectorPatch: %s", err) } updoptions.FlowLogCollectorPatch = flowLogCollectorPatch _, response, err = sess.UpdateFlowLogCollector(updoptions) if err != nil { - return fmt.Errorf("Error updating flow log collector:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating flow log collector:%s\n%s", err, response) } } @@ -391,7 +393,7 @@ func resourceIBMISFlowLogDelete(d *schema.ResourceData, meta interface{}) error response, err := sess.DeleteFlowLogCollector(delOptions) if err != nil && response.StatusCode != 404 { - return fmt.Errorf("Error deleting flow log collector:%s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting flow log collector:%s\n%s", err, response) } d.SetId("") @@ -411,7 +413,7 @@ func resourceIBMISFlowLogExists(d *schema.ResourceData, meta interface{}) (bool, } _, response, err := sess.GetFlowLogCollector(getOptions) if err != nil && response.StatusCode != 404 { - return false, fmt.Errorf("Error Getting Flow Log Collector : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Flow Log Collector : %s\n%s", err, response) } if response.StatusCode == 404 { d.SetId("") diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ike_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ike_policy.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ike_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ike_policy.go index c58f1ec4a4..cace5e1fa0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ike_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ike_policy.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -27,7 +29,7 @@ const ( isIKEHref = "href" ) -func resourceIBMISIKEPolicy() *schema.Resource { +func ResourceIBMISIKEPolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMISIKEPolicyCreate, Read: resourceIBMISIKEPolicyRead, @@ -40,28 +42,28 @@ func resourceIBMISIKEPolicy() *schema.Resource { isIKEName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ike_policy", isIKEName), + ValidateFunc: validate.InvokeValidator("ibm_is_ike_policy", isIKEName), Description: "IKE name", }, isIKEAuthenticationAlg: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ike_policy", isIKEAuthenticationAlg), + ValidateFunc: validate.InvokeValidator("ibm_is_ike_policy", isIKEAuthenticationAlg), Description: "Authentication algorithm type", }, isIKEEncryptionAlg: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ike_policy", isIKEEncryptionAlg), + ValidateFunc: validate.InvokeValidator("ibm_is_ike_policy", isIKEEncryptionAlg), Description: "Encryption alogorithm type", }, isIKEDhGroup: { Type: schema.TypeInt, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ike_policy", isIKEDhGroup), + ValidateFunc: validate.InvokeValidator("ibm_is_ike_policy", isIKEDhGroup), Description: "IKE DH group", }, @@ -77,14 +79,14 @@ func resourceIBMISIKEPolicy() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 28800, - ValidateFunc: validateKeyLifeTime, + ValidateFunc: validate.ValidateKeyLifeTime, Description: "IKE Key lifetime", }, isIKEVERSION: { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_ike_policy", isIKEVERSION), + ValidateFunc: validate.InvokeValidator("ibm_is_ike_policy", isIKEVERSION), Description: "IKE version", }, @@ -120,18 +122,18 @@ func resourceIBMISIKEPolicy() *schema.Resource { }, }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -140,52 +142,52 @@ func resourceIBMISIKEPolicy() *schema.Resource { } } -func resourceIBMISIKEValidator() *ResourceValidator { +func ResourceIBMISIKEValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) authentication_algorithm := "md5, sha1, sha256, sha512" encryption_algorithm := "triple_des, aes128, aes256" dh_group := "2, 5, 14, 19" ike_version := "1, 2" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIKEName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIKEAuthenticationAlg, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: authentication_algorithm}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIKEEncryptionAlg, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: encryption_algorithm}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIKEDhGroup, - ValidateFunctionIdentifier: ValidateAllowedIntValue, - Type: TypeInt, + ValidateFunctionIdentifier: validate.ValidateAllowedIntValue, + Type: validate.TypeInt, Required: true, AllowedValues: dh_group}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIKEVERSION, - ValidateFunctionIdentifier: ValidateAllowedIntValue, - Type: TypeInt, + ValidateFunctionIdentifier: validate.ValidateAllowedIntValue, + Type: validate.TypeInt, Optional: true, AllowedValues: ike_version}) - ibmISIKEResourceValidator := ResourceValidator{ResourceName: "ibm_is_ike_policy", Schema: validateSchema} + ibmISIKEResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_ike_policy", Schema: validateSchema} return &ibmISIKEResourceValidator } @@ -264,7 +266,7 @@ func ikepGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting IKE Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting IKE Policy(%s): %s\n%s", id, err, response) } d.Set(isIKEName, *ike.Name) @@ -272,7 +274,7 @@ func ikepGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isIKEEncryptionAlg, *ike.EncryptionAlgorithm) if ike.ResourceGroup != nil { d.Set(isIKEResourceGroup, *ike.ResourceGroup.ID) - d.Set(ResourceGroupName, *ike.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *ike.ResourceGroup.Name) } else { d.Set(isIKEResourceGroup, nil) } @@ -294,12 +296,12 @@ func ikepGet(d *schema.ResourceData, meta interface{}, id string) error { } } d.Set(isIKEVPNConnections, connList) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/ikepolicies") - d.Set(ResourceName, *ike.Name) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/ikepolicies") + d.Set(flex.ResourceName, *ike.Name) return nil } @@ -338,13 +340,13 @@ func ikepUpdate(d *schema.ResourceData, meta interface{}, id string) error { ikePolicyPatchModel.IkeVersion = &ikeVersion ikePolicyPatch, err := ikePolicyPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for IkePolicyPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for IkePolicyPatch: %s", err) } options.IkePolicyPatch = ikePolicyPatch _, response, err := sess.UpdateIkePolicy(options) if err != nil { - return fmt.Errorf("Error on update of IKE Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error on update of IKE Policy(%s): %s\n%s", id, err, response) } } return nil @@ -370,7 +372,7 @@ func ikepDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting IKE Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting IKE Policy(%s): %s\n%s", id, err, response) } deleteIkePolicyOptions := &vpcv1.DeleteIkePolicyOptions{ @@ -378,7 +380,7 @@ func ikepDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteIkePolicy(deleteIkePolicyOptions) if err != nil { - return fmt.Errorf("Error Deleting IKE Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Deleting IKE Policy(%s): %s\n%s", id, err, response) } d.SetId("") return nil @@ -403,7 +405,7 @@ func ikepExists(d *schema.ResourceData, meta interface{}, id string) (bool, erro if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting IKE Policy(%s): %s\n%s", id, err, response) + return false, fmt.Errorf("[ERROR] Error getting IKE Policy(%s): %s\n%s", id, err, response) } return true, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_image.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_image.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_image.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_image.go index b89135232b..1827189cac 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_image.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_image.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -40,7 +42,7 @@ const ( isImageDeleted = "done" ) -func resourceIBMISImage() *schema.Resource { +func ResourceIBMISImage() *schema.Resource { return &schema.Resource{ Create: resourceIBMISImageCreate, Read: resourceIBMISImageRead, @@ -57,7 +59,7 @@ func resourceIBMISImage() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -66,7 +68,7 @@ func resourceIBMISImage() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, RequiredWith: []string{isImageOperatingSystem}, ExactlyOneOf: []string{isImageHref, isImageVolume}, Description: "Image Href value", @@ -76,7 +78,7 @@ func resourceIBMISImage() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_image", isImageName), + ValidateFunc: validate.InvokeValidator("ibm_is_image", isImageName), Description: "Image name", }, @@ -96,8 +98,8 @@ func resourceIBMISImage() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_image", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_image", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the image", }, @@ -155,19 +157,19 @@ func resourceIBMISImage() *schema.Resource { Description: "The resource group for this image", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -185,13 +187,13 @@ func resourceIBMISImage() *schema.Resource { Description: "The SHA256 checksum of this image", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -200,28 +202,28 @@ func resourceIBMISImage() *schema.Resource { } } -func resourceIBMISImageValidator() *ResourceValidator { +func ResourceIBMISImageValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isImageName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISImageResourceValidator := ResourceValidator{ResourceName: "ibm_is_image", Schema: validateSchema} + ibmISImageResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_image", Schema: validateSchema} return &ibmISImageResourceValidator } @@ -295,7 +297,7 @@ func imgCreateByFile(d *schema.ResourceData, meta interface{}, href, name, opera v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isImageTags); ok || v != "" { oldList, newList := d.GetChange(isImageTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *image.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *image.CRN) if err != nil { log.Printf( "Error on create of resource vpc Image (%s) tags: %s", d.Id(), err) @@ -320,10 +322,10 @@ func imgCreateByVolume(d *schema.ResourceData, meta interface{}, name, volume st } vol, response, err := sess.GetVolume(options) if err != nil || vol == nil { - return fmt.Errorf("Error retrieving Volume (%s) details: %s\n%s", volume, err, response) + return fmt.Errorf("[ERROR] Error retrieving Volume (%s) details: %s\n%s", volume, err, response) } if vol.VolumeAttachments == nil { - return fmt.Errorf("Error creating Image because the specified source_volume %s is not attached to a virtual server instance ", volume) + return fmt.Errorf("[ERROR] Error creating Image because the specified source_volume %s is not attached to a virtual server instance ", volume) } volAtt := &vol.VolumeAttachments[0] insId = *volAtt.Instance.ID @@ -332,7 +334,7 @@ func imgCreateByVolume(d *schema.ResourceData, meta interface{}, name, volume st } instance, response, err := sess.GetInstance(getinsOptions) if err != nil || instance == nil { - return fmt.Errorf("Error retrieving Instance (%s) to which the source_volume (%s) is attached : %s\n%s", insId, volume, err, response) + return fmt.Errorf("[ERROR] Error retrieving Instance (%s) to which the source_volume (%s) is attached : %s\n%s", insId, volume, err, response) } if instance != nil && *instance.Status == "running" { actiontype := "stop" @@ -342,7 +344,7 @@ func imgCreateByVolume(d *schema.ResourceData, meta interface{}, name, volume st } _, response, err = sess.CreateInstanceAction(createinsactoptions) if err != nil { - return fmt.Errorf("Error stopping Instance (%s) to which the source_volume (%s) is attached : %s\n%s", insId, volume, err, response) + return fmt.Errorf("[ERROR] Error stopping Instance (%s) to which the source_volume (%s) is attached : %s\n%s", insId, volume, err, response) } _, err = isWaitForInstanceActionStop(sess, d.Timeout(schema.TimeoutCreate), insId, d) if err != nil { @@ -384,7 +386,7 @@ func imgCreateByVolume(d *schema.ResourceData, meta interface{}, name, volume st v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isImageTags); ok || v != "" { oldList, newList := d.GetChange(isImageTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *image.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *image.CRN) if err != nil { log.Printf( "Error on create of resource vpc Image (%s) tags: %s", d.Id(), err) @@ -414,7 +416,7 @@ func isImageRefreshFunc(imageC *vpcv1.VpcV1, id string) resource.StateRefreshFun } image, response, err := imageC.GetImage(getimgoptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Image: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Image: %s\n%s", err, response) } if *image.Status == "available" || *image.Status == "failed" { @@ -454,10 +456,10 @@ func imgUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasCha } image, response, err := sess.GetImage(options) if err != nil { - return fmt.Errorf("Error getting Image IP: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Image IP: %s\n%s", err, response) } oldList, newList := d.GetChange(isImageTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *image.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *image.CRN) if err != nil { log.Printf( "Error on update of resource vpc Image (%s) tags: %s", id, err) @@ -472,12 +474,12 @@ func imgUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasCha } imagePatch, err := imagePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for ImagePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for ImagePatch: %s", err) } options.ImagePatch = imagePatch _, response, err := sess.UpdateImage(options) if err != nil { - return fmt.Errorf("Error on update of resource vpc Image: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error on update of resource vpc Image: %s\n%s", err, response) } } return nil @@ -507,7 +509,7 @@ func imgGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Image (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Image (%s): %s\n%s", id, err, response) } // d.Set(isImageArchitecure, image.Architecture) if image.MinimumProvisionedSize != nil { @@ -541,20 +543,20 @@ func imgGet(d *schema.ResourceData, meta interface{}, id string) error { if image.File != nil && image.File.Checksums != nil { d.Set(isImageCheckSum, *image.File.Checksums.Sha256) } - tags, err := GetTagsUsingCRN(meta, *image.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *image.CRN) if err != nil { log.Printf( "Error on get of resource vpc Image (%s) tags: %s", d.Id(), err) } d.Set(isImageTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/compute/image") - d.Set(ResourceName, *image.Name) - d.Set(ResourceStatus, *image.Status) - d.Set(ResourceCRN, *image.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/compute/image") + d.Set(flex.ResourceName, *image.Name) + d.Set(flex.ResourceStatus, *image.Status) + d.Set(flex.ResourceCRN, *image.CRN) d.Set(IsImageCRN, *image.CRN) if image.ResourceGroup != nil { d.Set(isImageResourceGroup, *image.ResourceGroup.ID) @@ -585,7 +587,7 @@ func imgDelete(d *schema.ResourceData, meta interface{}, id string) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Getting Image (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Image (%s): %s\n%s", id, err, response) } options := &vpcv1.DeleteImageOptions{ @@ -593,7 +595,7 @@ func imgDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteImage(options) if err != nil { - return fmt.Errorf("Error Deleting Image : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Image : %s\n%s", err, response) } _, err = isWaitForImageDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -629,7 +631,7 @@ func isImageDeleteRefreshFunc(imageC *vpcv1.VpcV1, id string) resource.StateRefr if response != nil && response.StatusCode == 404 { return image, isImageDeleted, nil } - return image, "", fmt.Errorf("Error Getting Image: %s\n%s", err, response) + return image, "", fmt.Errorf("[ERROR] Error Getting Image: %s\n%s", err, response) } return image, isImageDeleting, err } @@ -653,7 +655,7 @@ func imgExists(d *schema.ResourceData, meta interface{}, id string) (bool, error if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Image: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Image: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance.go index f1ebd4bc65..5569e973af 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance.go @@ -1,15 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" + "encoding/json" "fmt" "log" "os" + "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -71,15 +75,17 @@ const ( isInstanceDeleteDone = "done" isInstanceFailed = "failed" - isInstanceStatusRestarting = "restarting" - isInstanceStatusStarting = "starting" - isInstanceActionStatusStopping = "stopping" - isInstanceActionStatusStopped = "stopped" - isInstanceStatusPending = "pending" - isInstanceStatusRunning = "running" - isInstanceStatusFailed = "failed" + isInstanceStatusRestarting = "restarting" + isInstanceStatusStarting = "starting" + isInstanceActionStatusStopping = "stopping" + isInstanceActionStatusStopped = "stopped" + isInstanceStatusPending = "pending" + isInstanceStatusRunning = "running" + isInstanceStatusFailed = "failed" + isInstanceAvailablePolicyHostFailure = "availability_policy_host_failure" isInstanceBootAttachmentName = "name" + isInstanceBootVolumeId = "volume_id" isInstanceBootSize = "size" isInstanceBootIOPS = "iops" isInstanceBootEncryption = "encryption" @@ -95,9 +101,13 @@ const ( isPlacementTargetDedicatedHostGroup = "dedicated_host_group" isInstancePlacementTarget = "placement_target" isPlacementTargetPlacementGroup = "placement_group" + + isInstanceDefaultTrustedProfileAutoLink = "default_trusted_profile_auto_link" + isInstanceDefaultTrustedProfileTarget = "default_trusted_profile_target" + isInstanceMetadataServiceEnabled = "metadata_service_enabled" ) -func resourceIBMISInstance() *schema.Resource { +func ResourceIBMISInstance() *schema.Resource { return &schema.Resource{ Create: resourceIBMisInstanceCreate, Read: resourceIBMisInstanceRead, @@ -121,7 +131,7 @@ func resourceIBMISInstance() *schema.Resource { d.SetId("") return nil, nil } - return nil, fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return nil, fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } var volumes []string volumes = make([]string, 0) @@ -132,7 +142,7 @@ func resourceIBMISInstance() *schema.Resource { } } } - d.Set(isInstanceVolumes, newStringSet(schema.HashString, volumes)) + d.Set(isInstanceVolumes, flex.NewStringSet(schema.HashString, volumes)) return []*schema.ResourceData{d}, nil }, }, @@ -145,16 +155,23 @@ func resourceIBMISInstance() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), Schema: map[string]*schema.Schema{ + isInstanceAvailablePolicyHostFailure: { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The availability policy to use for this virtual server instance", + }, + isInstanceName: { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_instance", isInstanceName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance", isInstanceName), Description: "Instance name", }, isInstanceVPC: { @@ -193,7 +210,20 @@ func resourceIBMISInstance() *schema.Resource { Optional: true, Description: "Profile info", }, - + isInstanceDefaultTrustedProfileAutoLink: { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Computed: true, + RequiredWith: []string{isInstanceDefaultTrustedProfileTarget}, + Description: "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", + }, + isInstanceDefaultTrustedProfileTarget: { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", + }, isPlacementTargetDedicatedHost: { Type: schema.TypeString, Optional: true, @@ -222,7 +252,7 @@ func resourceIBMISInstance() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_instance", isInstanceTotalVolumeBandwidth), + ValidateFunc: validate.InvokeValidator("ibm_is_instance", isInstanceTotalVolumeBandwidth), Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", }, @@ -243,7 +273,7 @@ func resourceIBMISInstance() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "SSH key Ids for the instance", }, @@ -251,8 +281,8 @@ func resourceIBMISInstance() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_instance", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_instance", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "list of tags for the instance", }, @@ -267,7 +297,7 @@ func resourceIBMISInstance() *schema.Resource { isInstanceAction: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance", isInstanceAction), + ValidateFunc: validate.InvokeValidator("ibm_is_instance", isInstanceAction), Description: "Enables stopping of instance before deleting and waits till deletion is complete", }, @@ -335,7 +365,7 @@ func resourceIBMISInstance() *schema.Resource { isInstanceNicPortSpeed: { Type: schema.TypeInt, Optional: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Deprecated: "This field is deprected", }, isInstanceNicPrimaryIpv4Address: { @@ -422,36 +452,43 @@ func resourceIBMISInstance() *schema.Resource { }, isInstanceBootVolume: { - Type: schema.TypeList, - DiffSuppressFunc: applyOnce, - Optional: true, - Computed: true, - MaxItems: 1, + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ isInstanceBootAttachmentName: { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_instance", isInstanceBootAttachmentName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance", isInstanceBootAttachmentName), + }, + + isInstanceBootVolumeId: { + Type: schema.TypeString, + Computed: true, }, isInstanceVolumeSnapshot: { - Type: schema.TypeString, - RequiredWith: []string{isInstanceZone, isInstancePrimaryNetworkInterface, isInstanceProfile, isInstanceKeys, isInstanceVPC}, - AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot"}, - ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate}, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + RequiredWith: []string{isInstanceZone, isInstancePrimaryNetworkInterface, isInstanceProfile, isInstanceKeys, isInstanceVPC}, + AtLeastOneOf: []string{isInstanceImage, isInstanceSourceTemplate, "boot_volume.0.snapshot"}, + ConflictsWith: []string{isInstanceImage, isInstanceSourceTemplate}, + Optional: true, + DiffSuppressFunc: flex.ApplyOnce, }, isInstanceBootEncryption: { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + DiffSuppressFunc: flex.ApplyOnce, + Computed: true, }, isInstanceBootSize: { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: validate.InvokeValidator("ibm_is_instance", isInstanceBootSize), }, isInstanceBootIOPS: { Type: schema.TypeInt, @@ -565,31 +602,38 @@ func resourceIBMISInstance() *schema.Resource { }, }, }, - ResourceControllerURL: { + isInstanceMetadataServiceEnabled: { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Indicates whether the metadata service endpoint is available to the virtual server instance", + }, + + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -606,37 +650,37 @@ func resourceIBMISInstance() *schema.Resource { Description: "Collection of the instance's disks.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the disk was created.", }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this instance disk.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this instance disk.", }, - "interface_type": &schema.Schema{ + "interface_type": { Type: schema.TypeString, Computed: true, Description: "The disk interface used for attaching the disk.The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The user-defined name for this disk.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "size": &schema.Schema{ + "size": { Type: schema.TypeInt, Computed: true, Description: "The size of the disk in GB (gigabytes).", @@ -650,18 +694,18 @@ func resourceIBMISInstance() *schema.Resource { Description: "The placement restrictions for the virtual server instance.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this placement target.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -669,22 +713,22 @@ func resourceIBMISInstance() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this placement target.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, Description: "The unique identifier for this placement target.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this placement target.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The type of resource referenced.", @@ -696,53 +740,70 @@ func resourceIBMISInstance() *schema.Resource { } } -func resourceIBMISInstanceValidator() *ResourceValidator { +func ResourceIBMISInstanceValidator() *validate.ResourceValidator { actions := "stop, start, reboot" - validateSchema := make([]ValidateSchema, 0) + host_failure := "restart, stop" + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceTotalVolumeBandwidth, - ValidateFunctionIdentifier: IntAtLeast, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntAtLeast, + Type: validate.TypeInt, Optional: true, MinValue: "500"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ + Identifier: isInstanceBootSize, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, + Optional: true, + MinValue: "1", + MaxValue: "250"}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ Identifier: isInstanceAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: actions}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceBootAttachmentName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmISInstanceValidator := ResourceValidator{ResourceName: "ibm_is_instance", Schema: validateSchema} + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isInstanceAvailablePolicyHostFailure, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: host_failure}) + + ibmISInstanceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance", Schema: validateSchema} return &ibmISInstanceValidator } @@ -766,6 +827,31 @@ func instanceCreateByImage(d *schema.ResourceData, meta interface{}, profile, na ID: &vpcID, }, } + if defaultTrustedProfileTargetIntf, ok := d.GetOk(isInstanceDefaultTrustedProfileTarget); ok { + defaultTrustedProfiletarget := defaultTrustedProfileTargetIntf.(string) + + target := &vpcv1.TrustedProfileIdentity{} + if strings.HasPrefix(defaultTrustedProfiletarget, "crn") { + target.CRN = &defaultTrustedProfiletarget + } else { + target.ID = &defaultTrustedProfiletarget + } + instanceproto.DefaultTrustedProfile = &vpcv1.InstanceDefaultTrustedProfilePrototype{ + Target: target, + } + + if defaultTrustedProfileAutoLinkIntf, ok := d.GetOkExists(isInstanceDefaultTrustedProfileAutoLink); ok { + defaultTrustedProfileAutoLink := defaultTrustedProfileAutoLinkIntf.(bool) + instanceproto.DefaultTrustedProfile.AutoLink = &defaultTrustedProfileAutoLink + } + } + if availablePolicyItem, ok := d.GetOk(isInstanceAvailablePolicyHostFailure); ok { + hostFailure := availablePolicyItem.(string) + instanceproto.AvailabilityPolicy = &vpcv1.InstanceAvailabilityPrototype{ + HostFailure: &hostFailure, + } + } + if totalVolBandwidthIntf, ok := d.GetOk(isInstanceTotalVolumeBandwidth); ok { totalVolBandwidthStr := int64(totalVolBandwidthIntf.(int)) instanceproto.TotalVolumeBandwidth = &totalVolBandwidthStr @@ -798,6 +884,12 @@ func instanceCreateByImage(d *schema.ResourceData, meta interface{}, profile, na if namestr != "" && ok { volTemplate.Name = &namestr } + sizeOk, ok := bootvol[isInstanceBootSize] + size := sizeOk.(int) + if size != 0 && ok { + sizeInt64 := int64(size) + volTemplate.Capacity = &sizeInt64 + } enc, ok := bootvol[isInstanceBootEncryption] encstr := enc.(string) if ok && encstr != "" { @@ -928,6 +1020,13 @@ func instanceCreateByImage(d *schema.ResourceData, meta interface{}, profile, na } + metadataServiceEnabled := d.Get(isInstanceMetadataServiceEnabled).(bool) + if metadataServiceEnabled { + instanceproto.MetadataService = &vpcv1.InstanceMetadataServicePrototype{ + Enabled: &metadataServiceEnabled, + } + } + options := &vpcv1.CreateInstanceOptions{ InstancePrototype: instanceproto, } @@ -950,7 +1049,7 @@ func instanceCreateByImage(d *schema.ResourceData, meta interface{}, profile, na v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isInstanceTags); ok || v != "" { oldList, newList := d.GetChange(isInstanceTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "Error on create of resource instance (%s) tags: %s", d.Id(), err) @@ -971,6 +1070,24 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, Name: &name, } + if defaultTrustedProfileTargetIntf, ok := d.GetOk(isInstanceDefaultTrustedProfileTarget); ok { + defaultTrustedProfiletarget := defaultTrustedProfileTargetIntf.(string) + + target := &vpcv1.TrustedProfileIdentity{} + if strings.HasPrefix(defaultTrustedProfiletarget, "crn") { + target.CRN = &defaultTrustedProfiletarget + } else { + target.ID = &defaultTrustedProfiletarget + } + instanceproto.DefaultTrustedProfile = &vpcv1.InstanceDefaultTrustedProfilePrototype{ + Target: target, + } + + if defaultTrustedProfileAutoLinkIntf, ok := d.GetOkExists(isInstanceDefaultTrustedProfileAutoLink); ok { + defaultTrustedProfileAutoLink := defaultTrustedProfileAutoLinkIntf.(bool) + instanceproto.DefaultTrustedProfile.AutoLink = &defaultTrustedProfileAutoLink + } + } if profile != "" { instanceproto.Profile = &vpcv1.InstanceProfileIdentity{ Name: &profile, @@ -1011,7 +1128,12 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, } instanceproto.PlacementTarget = placementGrp } - + if availablePolicyItem, ok := d.GetOk(isInstanceAvailablePolicyHostFailure); ok { + hostFailure := availablePolicyItem.(string) + instanceproto.AvailabilityPolicy = &vpcv1.InstanceAvailabilityPrototype{ + HostFailure: &hostFailure, + } + } if boot, ok := d.GetOk(isInstanceBootVolume); ok { bootvol := boot.([]interface{})[0].(map[string]interface{}) var volTemplate = &vpcv1.VolumePrototypeInstanceByImageContext{} @@ -1020,6 +1142,12 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, if namestr != "" && ok { volTemplate.Name = &namestr } + sizeOk, ok := bootvol[isInstanceBootSize] + size := sizeOk.(int) + if size != 0 && ok { + sizeInt64 := int64(size) + volTemplate.Capacity = &sizeInt64 + } enc, ok := bootvol[isInstanceBootEncryption] encstr := enc.(string) if ok && encstr != "" { @@ -1151,6 +1279,13 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, } + if metadataServiceEnabled, ok := d.GetOkExists(isInstanceMetadataServiceEnabled); ok { + metadataServiceEnabledBool := metadataServiceEnabled.(bool) + instanceproto.MetadataService = &vpcv1.InstanceMetadataServicePrototype{ + Enabled: &metadataServiceEnabledBool, + } + } + options := &vpcv1.CreateInstanceOptions{ InstancePrototype: instanceproto, } @@ -1165,6 +1300,10 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, log.Printf("[INFO] Instance : %s", *instance.ID) d.Set(isInstanceStatus, instance.Status) + if instance.MetadataService != nil { + d.Set(isInstanceMetadataServiceEnabled, instance.MetadataService.Enabled) + } + _, err = isWaitForInstanceAvailable(sess, d.Id(), d.Timeout(schema.TimeoutCreate), d) if err != nil { return err @@ -1173,7 +1312,7 @@ func instanceCreateByTemplate(d *schema.ResourceData, meta interface{}, profile, v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isInstanceTags); ok || v != "" { oldList, newList := d.GetChange(isInstanceTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "Error on create of resource instance (%s) tags: %s", d.Id(), err) @@ -1199,6 +1338,26 @@ func instanceCreateByVolume(d *schema.ResourceData, meta interface{}, profile, n ID: &vpcID, }, } + + if defaultTrustedProfileTargetIntf, ok := d.GetOk(isInstanceDefaultTrustedProfileTarget); ok { + defaultTrustedProfiletarget := defaultTrustedProfileTargetIntf.(string) + + target := &vpcv1.TrustedProfileIdentity{} + if strings.HasPrefix(defaultTrustedProfiletarget, "crn") { + target.CRN = &defaultTrustedProfiletarget + } else { + target.ID = &defaultTrustedProfiletarget + } + instanceproto.DefaultTrustedProfile = &vpcv1.InstanceDefaultTrustedProfilePrototype{ + Target: target, + } + + if defaultTrustedProfileAutoLinkIntf, ok := d.GetOkExists(isInstanceDefaultTrustedProfileAutoLink); ok { + defaultTrustedProfileAutoLink := defaultTrustedProfileAutoLinkIntf.(bool) + instanceproto.DefaultTrustedProfile.AutoLink = &defaultTrustedProfileAutoLink + } + } + if dHostIdInf, ok := d.GetOk(isPlacementTargetDedicatedHost); ok { dHostIdStr := dHostIdInf.(string) dHostPlaementTarget := &vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentity{ @@ -1228,6 +1387,12 @@ func instanceCreateByVolume(d *schema.ResourceData, meta interface{}, profile, n if namestr != "" && ok { volTemplate.Name = &namestr } + sizeOk, ok := bootvol[isInstanceBootSize] + size := sizeOk.(int) + if size != 0 && ok { + sizeInt64 := int64(size) + volTemplate.Capacity = &sizeInt64 + } enc, ok := bootvol[isInstanceBootEncryption] encstr := enc.(string) if ok && encstr != "" { @@ -1367,6 +1532,18 @@ func instanceCreateByVolume(d *schema.ResourceData, meta interface{}, profile, n } } + if availablePolicyItem, ok := d.GetOk(isInstanceAvailablePolicyHostFailure); ok { + hostFailure := availablePolicyItem.(string) + instanceproto.AvailabilityPolicy = &vpcv1.InstanceAvailabilityPrototype{ + HostFailure: &hostFailure, + } + } + metadataServiceEnabled := d.Get(isInstanceMetadataServiceEnabled).(bool) + if metadataServiceEnabled { + instanceproto.MetadataService = &vpcv1.InstanceMetadataServicePrototype{ + Enabled: &metadataServiceEnabled, + } + } options := &vpcv1.CreateInstanceOptions{ InstancePrototype: instanceproto, @@ -1390,7 +1567,7 @@ func instanceCreateByVolume(d *schema.ResourceData, meta interface{}, profile, n v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isInstanceTags); ok || v != "" { oldList, newList := d.GetChange(isInstanceTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "Error on create of resource instance (%s) tags: %s", d.Id(), err) @@ -1458,7 +1635,7 @@ func isInstanceRefreshFunc(instanceC *vpcv1.VpcV1, id string, d *schema.Resource } instance, response, err := instanceC.GetInstance(getinsOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } d.Set(isInstanceStatus, *instance.Status) @@ -1474,7 +1651,12 @@ func isInstanceRefreshFunc(instanceC *vpcv1.VpcV1, id string, d *schema.Resource close(communicator) // taint the instance if status is failed if *instance.Status == "failed" { - return instance, *instance.Status, fmt.Errorf("Instance (%s) went into failed state during the operation \n [WARNING] Running terraform apply again will remove the tainted instance and attempt to create the instance again replacing the previous configuration", *instance.ID) + instanceStatusReason := instance.StatusReasons + out, err := json.MarshalIndent(instanceStatusReason, "", " ") + if err != nil { + return instance, *instance.Status, fmt.Errorf("Instance (%s) went into failed state during the operation \n [WARNING] Running terraform apply again will remove the tainted instance and attempt to create the instance again replacing the previous configuration", *instance.ID) + } + return instance, *instance.Status, fmt.Errorf("Instance (%s) went into failed state during the operation \n (%+v) \n [WARNING] Running terraform apply again will remove the tainted instance and attempt to create the instance again replacing the previous configuration", *instance.ID, string(out)) } return instance, *instance.Status, nil @@ -1498,7 +1680,7 @@ func isRestartStartAction(instanceC *vpcv1.VpcV1, id string, d *schema.ResourceD } _, response, err := instanceC.CreateInstanceAction(createinsactoptions) if err != nil { - communicator <- fmt.Errorf("Error retrying instance action start: %s\n%s", err, response) + communicator <- fmt.Errorf("[ERROR] Error retrying instance action start: %s\n%s", err, response) return } waitTimeout := time.Duration(1) * time.Minute @@ -1510,7 +1692,7 @@ func isRestartStartAction(instanceC *vpcv1.VpcV1, id string, d *schema.ResourceD } _, response, err = instanceC.CreateInstanceAction(createinsactoptions) if err != nil { - communicator <- fmt.Errorf("Error retrying instance action start: %s\n%s", err, response) + communicator <- fmt.Errorf("[ERROR] Error retrying instance action start: %s\n%s", err, response) return } case <-communicator: @@ -1540,15 +1722,31 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { getinsOptions := &vpcv1.GetInstanceOptions{ ID: &id, } + getinsIniOptions := &vpcv1.GetInstanceInitializationOptions{ + ID: &id, + } instance, response, err := instanceC.GetInstance(getinsOptions) if err != nil { if response != nil && response.StatusCode == 404 { d.SetId("") return nil } - return fmt.Errorf("Error getting Instance: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Instance: %s\n%s", err, response) + } + instanceInitialization, response, err := instanceC.GetInstanceInitialization(getinsIniOptions) + if err != nil { + return fmt.Errorf("[ERROR] Error getting Instance initialization details: %s\n%s", err, response) + } + if instanceInitialization.DefaultTrustedProfile != nil && instanceInitialization.DefaultTrustedProfile.AutoLink != nil { + d.Set(isInstanceDefaultTrustedProfileAutoLink, *instanceInitialization.DefaultTrustedProfile.AutoLink) + } + if instanceInitialization.DefaultTrustedProfile != nil && instanceInitialization.DefaultTrustedProfile.Target != nil { + d.Set(isInstanceDefaultTrustedProfileTarget, *instanceInitialization.DefaultTrustedProfile.Target.ID) } + if instance.AvailabilityPolicy != nil && instance.AvailabilityPolicy.HostFailure != nil { + d.Set(isInstanceAvailablePolicyHostFailure, *instance.AvailabilityPolicy.HostFailure) + } d.Set(isInstanceName, *instance.Name) if instance.Profile != nil { d.Set(isInstanceProfile, *instance.Profile.Name) @@ -1598,7 +1796,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { } insnic, response, err := instanceC.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s\n%s", err, response) } currentPrimNic[isInstanceNicAllowIPSpoofing] = *insnic.AllowIPSpoofing currentPrimNic[isInstanceNicSubnet] = *insnic.Subnet.ID @@ -1607,7 +1805,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { for i := 0; i < len(insnic.SecurityGroups); i++ { secgrpList = append(secgrpList, string(*(insnic.SecurityGroups[i].ID))) } - currentPrimNic[isInstanceNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } primaryNicList = append(primaryNicList, currentPrimNic) @@ -1628,7 +1826,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { } insnic, response, err := instanceC.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s\n%s", err, response) } currentNic[isInstanceNicAllowIPSpoofing] = *insnic.AllowIPSpoofing currentNic[isInstanceNicSubnet] = *insnic.Subnet.ID @@ -1637,7 +1835,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { for i := 0; i < len(insnic.SecurityGroups); i++ { secgrpList = append(secgrpList, string(*(insnic.SecurityGroups[i].ID))) } - currentNic[isInstanceNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) @@ -1691,6 +1889,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { bootVol := map[string]interface{}{} if instance.BootVolumeAttachment.Volume != nil { bootVol[isInstanceBootAttachmentName] = *instance.BootVolumeAttachment.Volume.Name + bootVol[isInstanceBootVolumeId] = *instance.BootVolumeAttachment.Volume.ID options := &vpcv1.GetVolumeOptions{ ID: instance.BootVolumeAttachment.Volume.ID, } @@ -1705,32 +1904,37 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { if vol.EncryptionKey != nil { bootVol[isInstanceBootEncryption] = *vol.EncryptionKey.CRN } + if vol.SourceSnapshot != nil { + bootVol[isInstanceVolumeSnapshot] = vol.SourceSnapshot.ID + } } } bootVolList = append(bootVolList, bootVol) d.Set(isInstanceBootVolume, bootVolList) } - tags, err := GetTagsUsingCRN(meta, *instance.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *instance.CRN) if err != nil { log.Printf( "Error on get of resource Instance (%s) tags: %s", d.Id(), err) } d.Set(isInstanceTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/compute/vs") - d.Set(ResourceName, *instance.Name) - d.Set(ResourceCRN, *instance.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/compute/vs") + d.Set(flex.ResourceName, *instance.Name) + d.Set(flex.ResourceCRN, *instance.CRN) d.Set(IsInstanceCRN, *instance.CRN) - d.Set(ResourceStatus, *instance.Status) + d.Set(flex.ResourceStatus, *instance.Status) if instance.ResourceGroup != nil { d.Set(isInstanceResourceGroup, *instance.ResourceGroup.ID) - d.Set(ResourceGroupName, *instance.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *instance.ResourceGroup.Name) + } + if instance.MetadataService != nil { + d.Set(isInstanceMetadataServiceEnabled, instance.MetadataService.Enabled) } - if instance.Disks != nil { disks := []map[string]interface{}{} for _, disksItem := range instance.Disks { @@ -1738,7 +1942,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { disks = append(disks, disksItemMap) } if err = d.Set(isInstanceDisks, disks); err != nil { - return fmt.Errorf("Error setting disks: %s", err) + return fmt.Errorf("[ERROR] Error setting disks: %s", err) } } @@ -1748,7 +1952,7 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error { placementTarget = append(placementTarget, placementTargetMap) } if err = d.Set(isInstancePlacementTarget, placementTarget); err != nil { - return fmt.Errorf("Error setting placement_target: %s", err) + return fmt.Errorf("[ERROR] Error setting placement_target: %s", err) } return nil } @@ -1760,6 +1964,40 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } id := d.Id() + bootVolSize := "boot_volume.0.size" + if d.HasChange(bootVolSize) && !d.IsNewResource() { + old, new := d.GetChange(bootVolSize) + if new.(int) < old.(int) { + return fmt.Errorf("[ERROR] Error while updating boot volume size of the instance, only expansion is possible") + } + bootVol := int64(new.(int)) + volId := d.Get("boot_volume.0.volume_id").(string) + updateVolumeOptions := &vpcv1.UpdateVolumeOptions{ + ID: &volId, + } + volPatchModel := &vpcv1.VolumePatch{ + Capacity: &bootVol, + } + volPatchModelAsPatch, err := volPatchModel.AsPatch() + + if err != nil { + return (fmt.Errorf("[ERROR] Error encountered while apply as patch for boot volume of instance %s", err)) + } + + updateVolumeOptions.VolumePatch = volPatchModelAsPatch + + vol, res, err := instanceC.UpdateVolume(updateVolumeOptions) + + if vol == nil || err != nil { + return (fmt.Errorf("[ERROR] Error encountered while expanding boot volume of instance %s/n%s", err, res)) + } + + _, err = isWaitForVolumeAvailable(instanceC, volId, d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + } + if d.HasChange(isInstanceAction) && !d.IsNewResource() { actiontype := d.Get(isInstanceAction).(string) @@ -1769,14 +2007,14 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } instance, response, err := instanceC.GetInstance(getinsOptions) if err != nil { - return fmt.Errorf("Error Getting Instance (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Instance (%s): %s\n%s", id, err, response) } if (actiontype == "stop" || actiontype == "reboot") && *instance.Status != isInstanceStatusRunning { d.Set(isInstanceAction, nil) - return fmt.Errorf("Error with stop/reboot action: Cannot invoke stop/reboot action while instance is not in running state") + return fmt.Errorf("[ERROR] Error with stop/reboot action: Cannot invoke stop/reboot action while instance is not in running state") } else if actiontype == "start" && *instance.Status != isInstanceActionStatusStopped { d.Set(isInstanceAction, nil) - return fmt.Errorf("Error with start action: Cannot invoke start action while instance is not in stopped state") + return fmt.Errorf("[ERROR] Error with start action: Cannot invoke start action while instance is not in stopped state") } createinsactoptions := &vpcv1.CreateInstanceActionOptions{ InstanceID: &id, @@ -1788,7 +2026,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } _, response, err = instanceC.CreateInstanceAction(createinsactoptions) if err != nil { - return fmt.Errorf("Error Creating Instance Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Instance Action: %s\n%s", err, response) } if actiontype == "stop" { _, err = isWaitForInstanceActionStop(instanceC, d.Timeout(schema.TimeoutUpdate), id, d) @@ -1809,8 +2047,8 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { ov := ovs.(*schema.Set) nv := nvs.(*schema.Set) - remove := expandStringList(ov.Difference(nv).List()) - add := expandStringList(nv.Difference(ov).List()) + remove := flex.ExpandStringList(ov.Difference(nv).List()) + add := flex.ExpandStringList(nv.Difference(ov).List()) var volautoDelete bool if volumeautodeleteIntf, ok := d.GetOk(isInstanceVolAttVolAutoDelete); ok && volumeautodeleteIntf != nil { volautoDelete = volumeautodeleteIntf.(bool) @@ -1827,7 +2065,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } vol, _, err := instanceC.CreateInstanceVolumeAttachment(createvolattoptions) if err != nil { - return fmt.Errorf("Error while attaching volume %q for instance %s: %q", add[i], d.Id(), err) + return fmt.Errorf("[ERROR] Error while attaching volume %q for instance %s: %q", add[i], d.Id(), err) } _, err = isWaitForInstanceVolumeAttached(instanceC, d, id, *vol.ID) if err != nil { @@ -1853,7 +2091,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } _, err := instanceC.DeleteInstanceVolumeAttachment(delvolattoptions) if err != nil { - return fmt.Errorf("Error while removing volume %q for instance %s: %q", remove[i], d.Id(), err) + return fmt.Errorf("[ERROR] Error while removing volume %q for instance %s: %q", remove[i], d.Id(), err) } _, err = isWaitForInstanceVolumeDetached(instanceC, d, d.Id(), *vol.ID) if err != nil { @@ -1870,8 +2108,8 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { ovs, nvs := d.GetChange("primary_network_interface.0.security_groups") ov := ovs.(*schema.Set) nv := nvs.(*schema.Set) - remove := expandStringList(ov.Difference(nv).List()) - add := expandStringList(nv.Difference(ov).List()) + remove := flex.ExpandStringList(ov.Difference(nv).List()) + add := flex.ExpandStringList(nv.Difference(ov).List()) if len(add) > 0 { networkID := d.Get("primary_network_interface.0.id").(string) for i := range add { @@ -1881,7 +2119,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } _, response, err := instanceC.CreateSecurityGroupTargetBinding(createsgnicoptions) if err != nil { - return fmt.Errorf("Error while creating security group %q for primary network interface of instance %s\n%s: %q", add[i], d.Id(), err, response) + return fmt.Errorf("[ERROR] Error while creating security group %q for primary network interface of instance %s\n%s: %q", add[i], d.Id(), err, response) } _, err = isWaitForInstanceAvailable(instanceC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -1899,7 +2137,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } response, err := instanceC.DeleteSecurityGroupTargetBinding(deletesgnicoptions) if err != nil { - return fmt.Errorf("Error while removing security group %q for primary network interface of instance %s\n%s: %q", remove[i], d.Id(), err, response) + return fmt.Errorf("[ERROR] Error while removing security group %q for primary network interface of instance %s\n%s: %q", remove[i], d.Id(), err, response) } _, err = isWaitForInstanceAvailable(instanceC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -1924,13 +2162,13 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } networkInterfacePatch, err := networkInterfacePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for NetworkInterfacePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for NetworkInterfacePatch: %s", err) } updatepnicfoptions.NetworkInterfacePatch = networkInterfacePatch _, response, err := instanceC.UpdateInstanceNetworkInterface(updatepnicfoptions) if err != nil { - return fmt.Errorf("Error while updating name %s for primary network interface of instance %s\n%s: %q", newName, d.Id(), err, response) + return fmt.Errorf("[ERROR] Error while updating name %s for primary network interface of instance %s\n%s: %q", newName, d.Id(), err, response) } _, err = isWaitForInstanceAvailable(instanceC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -1948,8 +2186,8 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { ovs, nvs := d.GetChange(securitygrpKey) ov := ovs.(*schema.Set) nv := nvs.(*schema.Set) - remove := expandStringList(ov.Difference(nv).List()) - add := expandStringList(nv.Difference(ov).List()) + remove := flex.ExpandStringList(ov.Difference(nv).List()) + add := flex.ExpandStringList(nv.Difference(ov).List()) if len(add) > 0 { networkIDKey := fmt.Sprintf("network_interfaces.%d.id", i) networkID := d.Get(networkIDKey).(string) @@ -1960,7 +2198,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } _, response, err := instanceC.CreateSecurityGroupTargetBinding(createsgnicoptions) if err != nil { - return fmt.Errorf("Error while creating security group %q for network interface of instance %s\n%s: %q", add[i], d.Id(), err, response) + return fmt.Errorf("[ERROR] Error while creating security group %q for network interface of instance %s\n%s: %q", add[i], d.Id(), err, response) } _, err = isWaitForInstanceAvailable(instanceC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -1979,7 +2217,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } response, err := instanceC.DeleteSecurityGroupTargetBinding(deletesgnicoptions) if err != nil { - return fmt.Errorf("Error while removing security group %q for network interface of instance %s\n%s: %q", remove[i], d.Id(), err, response) + return fmt.Errorf("[ERROR] Error while removing security group %q for network interface of instance %s\n%s: %q", remove[i], d.Id(), err, response) } _, err = isWaitForInstanceAvailable(instanceC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -2006,13 +2244,13 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } networkInterfacePatch, err := instancePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for NetworkInterfacePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for NetworkInterfacePatch: %s", err) } updatepnicfoptions.NetworkInterfacePatch = networkInterfacePatch _, response, err := instanceC.UpdateInstanceNetworkInterface(updatepnicfoptions) if err != nil { - return fmt.Errorf("Error while updating name %s for network interface of instance %s\n%s: %q", newName, d.Id(), err, response) + return fmt.Errorf("[ERROR] Error while updating name %s for network interface of instance %s\n%s: %q", newName, d.Id(), err, response) } if err != nil { return err @@ -2033,7 +2271,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } instancePatch, err := instancePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch with total volume bandwidth for InstancePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch with total volume bandwidth for InstancePatch: %s", err) } updnetoptions.InstancePatch = instancePatch @@ -2054,7 +2292,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } instancePatch, err := instancePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstancePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstancePatch: %s", err) } updnetoptions.InstancePatch = instancePatch @@ -2064,6 +2302,50 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } } + if d.HasChange(isInstanceMetadataServiceEnabled) && !d.IsNewResource() { + enabled := d.Get(isInstanceMetadataServiceEnabled).(bool) + updatedoptions := &vpcv1.UpdateInstanceOptions{ + ID: &id, + } + instancePatchModel := &vpcv1.InstancePatch{ + MetadataService: &vpcv1.InstanceMetadataServicePatch{ + Enabled: &enabled, + }, + } + instancePatch, err := instancePatchModel.AsPatch() + if err != nil { + return fmt.Errorf("Error calling asPatch for InstancePatch: %s", err) + } + updatedoptions.InstancePatch = instancePatch + + _, _, err = instanceC.UpdateInstance(updatedoptions) + if err != nil { + return err + } + } + if d.HasChange(isInstanceAvailablePolicyHostFailure) && !d.IsNewResource() { + + updatedoptions := &vpcv1.UpdateInstanceOptions{ + ID: &id, + } + availablePolicyHostFailure := d.Get(isInstanceAvailablePolicyHostFailure).(string) + instancePatchModel := &vpcv1.InstancePatch{ + AvailabilityPolicy: &vpcv1.InstanceAvailabilityPolicyPatch{ + HostFailure: &availablePolicyHostFailure, + }, + } + instancePatch, err := instancePatchModel.AsPatch() + if err != nil { + return fmt.Errorf("Error calling asPatch for InstancePatch: %s", err) + } + updatedoptions.InstancePatch = instancePatch + + _, _, err = instanceC.UpdateInstance(updatedoptions) + if err != nil { + return err + } + } + if d.HasChange(isInstanceProfile) && !d.IsNewResource() { getinsOptions := &vpcv1.GetInstanceOptions{ @@ -2075,7 +2357,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Instance (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Instance (%s): %s\n%s", id, err, response) } if instance != nil && *instance.Status == "running" { @@ -2089,7 +2371,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Creating Instance Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Instance Action: %s\n%s", err, response) } _, err = isWaitForInstanceActionStop(instanceC, d.Timeout(schema.TimeoutUpdate), id, d) if err != nil { @@ -2110,13 +2392,13 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } instancePatch, err := instancePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstancePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstancePatch: %s", err) } updnetoptions.InstancePatch = instancePatch _, response, err = instanceC.UpdateInstance(updnetoptions) if err != nil { - return fmt.Errorf("Error in UpdateInstancePatch: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in UpdateInstancePatch: %s\n%s", err, response) } actiontype := "start" @@ -2129,7 +2411,7 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Creating Instance Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Instance Action: %s\n%s", err, response) } _, err = isWaitForInstanceAvailable(instanceC, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -2143,11 +2425,11 @@ func instanceUpdate(d *schema.ResourceData, meta interface{}) error { } instance, response, err := instanceC.GetInstance(getinsOptions) if err != nil { - return fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } if d.HasChange(isInstanceTags) { oldList, newList := d.GetChange(isInstanceTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instance.CRN) if err != nil { log.Printf( "Error on update of resource Instance (%s) tags: %s", d.Id(), err) @@ -2182,7 +2464,7 @@ func instanceDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Instance (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Instance (%s): %s\n%s", id, err, response) } bootvolid := "" @@ -2198,7 +2480,7 @@ func instanceDelete(d *schema.ResourceData, meta interface{}, id string) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Creating Instance Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating Instance Action: %s\n%s", err, response) } _, err = isWaitForInstanceActionStop(instanceC, d.Timeout(schema.TimeoutDelete), id, d) if err != nil { @@ -2209,7 +2491,7 @@ func instanceDelete(d *schema.ResourceData, meta interface{}, id string) error { } vols, response, err := instanceC.ListInstanceVolumeAttachments(listvolattoptions) if err != nil { - return fmt.Errorf("Error Listing volume attachments to the instance: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Listing volume attachments to the instance: %s\n%s", err, response) } for _, vol := range vols.VolumeAttachments { if *vol.Type == "data" { @@ -2219,7 +2501,7 @@ func instanceDelete(d *schema.ResourceData, meta interface{}, id string) error { } _, err := instanceC.DeleteInstanceVolumeAttachment(delvolattoptions) if err != nil { - return fmt.Errorf("Error while removing volume Attachment %q for instance %s: %q", *vol.ID, d.Id(), err) + return fmt.Errorf("[ERROR] Error while removing volume Attachment %q for instance %s: %q", *vol.ID, d.Id(), err) } _, err = isWaitForInstanceVolumeDetached(instanceC, d, d.Id(), *vol.ID) if err != nil { @@ -2278,7 +2560,7 @@ func instanceExists(d *schema.ResourceData, meta interface{}, id string) (bool, if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } return true, nil } @@ -2306,10 +2588,10 @@ func isWaitForInstanceDelete(instanceC *vpcv1.VpcV1, d *schema.ResourceData, id if response != nil && response.StatusCode == 404 { return instance, isInstanceDeleteDone, nil } - return nil, "", fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } if *instance.Status == isInstanceFailed { - return instance, *instance.Status, fmt.Errorf("The instance %s failed to delete: %v", d.Id(), err) + return instance, *instance.Status, fmt.Errorf("[ERROR] The instance %s failed to delete: %v", d.Id(), err) } return instance, isInstanceDeleting, nil }, @@ -2332,7 +2614,7 @@ func isWaitForInstanceActionStop(instanceC *vpcv1.VpcV1, timeout time.Duration, } instance, response, err := instanceC.GetInstance(getinsoptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } select { case data := <-communicator: @@ -2343,7 +2625,7 @@ func isWaitForInstanceActionStop(instanceC *vpcv1.VpcV1, timeout time.Duration, if *instance.Status == isInstanceStatusFailed { // let know the isRestartStopAction() to stop close(communicator) - return instance, *instance.Status, fmt.Errorf("The instance %s failed to stop: %v", id, err) + return instance, *instance.Status, fmt.Errorf("[ERROR] The instance %s failed to stop: %v", id, err) } return instance, *instance.Status, nil }, @@ -2371,7 +2653,7 @@ func isWaitForInstanceActionStart(instanceC *vpcv1.VpcV1, timeout time.Duration, } instance, response, err := instanceC.GetInstance(getinsoptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Instance: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Instance: %s\n%s", err, response) } select { case data := <-communicator: @@ -2382,7 +2664,7 @@ func isWaitForInstanceActionStart(instanceC *vpcv1.VpcV1, timeout time.Duration, if *instance.Status == isInstanceStatusFailed { // let know the isRestartStopAction() to stop close(communicator) - return instance, *instance.Status, fmt.Errorf("The instance %s failed to start: %v", id, err) + return instance, *instance.Status, fmt.Errorf("[ERROR] The instance %s failed to start: %v", id, err) } return instance, *instance.Status, nil }, @@ -2414,7 +2696,7 @@ func isRestartStopAction(instanceC *vpcv1.VpcV1, id string, d *schema.ResourceDa } _, response, err := instanceC.CreateInstanceAction(createinsactoptions) if err != nil { - communicator <- fmt.Errorf("Error retrying instance action stop: %s\n%s", err, response) + communicator <- fmt.Errorf("[ERROR] Error retrying instance action stop: %s\n%s", err, response) return } case <-communicator: @@ -2449,7 +2731,7 @@ func isInstanceVolumeRefreshFunc(instanceC *vpcv1.VpcV1, id, volID string) resou } vol, response, err := instanceC.GetInstanceVolumeAttachment(getvolattoptions) if err != nil { - return nil, "", fmt.Errorf("Error Attaching volume: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Attaching volume: %s\n%s", err, response) } if *vol.Status == isInstanceVolumeAttached { @@ -2475,10 +2757,10 @@ func isWaitForInstanceVolumeDetached(instanceC *vpcv1.VpcV1, d *schema.ResourceD if response != nil && response.StatusCode == 404 { return vol, isInstanceDeleteDone, nil } - return nil, "", fmt.Errorf("Error Detaching: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Detaching: %s\n%s", err, response) } if *vol.Status == isInstanceFailed { - return vol, *vol.Status, fmt.Errorf("The instance %s failed to detach volume %s: %v", d.Id(), volID, err) + return vol, *vol.Status, fmt.Errorf("[ERROR] The instance %s failed to detach volume %s: %v", d.Id(), volID, err) } return vol, isInstanceVolumeDetaching, nil }, @@ -2499,7 +2781,7 @@ func resourceIbmIsInstanceInstanceDiskToMap(instanceDisk vpcv1.InstanceDisk) map instanceDiskMap["interface_type"] = instanceDisk.InterfaceType instanceDiskMap["name"] = instanceDisk.Name instanceDiskMap["resource_type"] = instanceDisk.ResourceType - instanceDiskMap["size"] = intValue(instanceDisk.Size) + instanceDiskMap["size"] = flex.IntValue(instanceDisk.Size) return instanceDiskMap } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_action.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_action.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_action.go index e4e7e49a69..992edb3c92 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_action.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,7 +23,7 @@ const ( isInstanceActionForce = "force_action" ) -func resourceIBMISInstanceAction() *schema.Resource { +func ResourceIBMISInstanceAction() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMISInstanceActionCreate, ReadContext: resourceIBMISInstanceActionRead, @@ -47,7 +48,7 @@ func resourceIBMISInstanceAction() *schema.Resource { isInstanceAction: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_action", isInstanceAction), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_action", isInstanceAction), Description: "This restart/start/stops an instance.", }, isInstanceActionForce: { @@ -85,19 +86,19 @@ func resourceIBMISInstanceAction() *schema.Resource { } } -func resourceIBMISInstanceActionValidator() *ResourceValidator { +func ResourceIBMISInstanceActionValidator() *validate.ResourceValidator { instanceActions := "start, reboot, stop" - validateSchema := make([]ValidateSchema, 1) + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: instanceActions}) - ibmISInstanceActionResourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_action", Schema: validateSchema} + ibmISInstanceActionResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_action", Schema: validateSchema} return &ibmISInstanceActionResourceValidator } @@ -119,14 +120,14 @@ func resourceIBMISInstanceActionCreate(context context.Context, d *schema.Resour } instance, response, err := sess.GetInstance(getinsOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error Getting Instance (%s): %s\n%s", instanceId, err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Instance (%s): %s\n%s", instanceId, err, response)) } if (actiontype == "stop" || actiontype == "reboot") && *instance.Status != isInstanceStatusRunning { d.Set(isInstanceAction, nil) - return diag.FromErr(fmt.Errorf("Error with stop/reboot action: Cannot invoke stop/reboot action while instance is not in running state")) + return diag.FromErr(fmt.Errorf("[ERROR] Error with stop/reboot action: Cannot invoke stop/reboot action while instance is not in running state")) } else if actiontype == "start" && *instance.Status != isInstanceActionStatusStopped { d.Set(isInstanceAction, nil) - return diag.FromErr(fmt.Errorf("Error with start action: Cannot invoke start action while instance is not in stopped state")) + return diag.FromErr(fmt.Errorf("[ERROR] Error with start action: Cannot invoke start action while instance is not in stopped state")) } createinsactoptions := &vpcv1.CreateInstanceActionOptions{ InstanceID: &instanceId, @@ -141,7 +142,7 @@ func resourceIBMISInstanceActionCreate(context context.Context, d *schema.Resour if response != nil && response.StatusCode == 404 { return nil } - return diag.FromErr(fmt.Errorf("Error Creating Instance Action: %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Creating Instance Action: %s\n%s", err, response)) } if actiontype == "stop" { _, err = isWaitForInstanceActionStop(sess, d.Timeout(schema.TimeoutUpdate), instanceId, d) @@ -175,7 +176,7 @@ func resourceIBMISInstanceActionRead(context context.Context, d *schema.Resource d.SetId("") return nil } - return diag.FromErr(fmt.Errorf("Error getting instance (%s): %s\n%s", id, err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error getting instance (%s): %s\n%s", id, err, response)) } d.Set(isInstanceStatus, *instance.Status) @@ -208,14 +209,14 @@ func resourceIBMISInstanceActionUpdate(context context.Context, d *schema.Resour } instance, response, err := sess.GetInstance(getinsOptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error Getting Instance (%s): %s\n%s", id, err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Instance (%s): %s\n%s", id, err, response)) } if (actiontype == "stop" || actiontype == "reboot") && *instance.Status != isInstanceStatusRunning { d.Set(isInstanceAction, nil) - return diag.FromErr(fmt.Errorf("Error with stop/reboot action: Cannot invoke stop/reboot action while instance is not in running state")) + return diag.FromErr(fmt.Errorf("[ERROR] Error with stop/reboot action: Cannot invoke stop/reboot action while instance is not in running state")) } else if actiontype == "start" && *instance.Status != isInstanceActionStatusStopped { d.Set(isInstanceAction, nil) - return diag.FromErr(fmt.Errorf("Error with start action: Cannot invoke start action while instance is not in stopped state")) + return diag.FromErr(fmt.Errorf("[ERROR] Error with start action: Cannot invoke start action while instance is not in stopped state")) } createinsactoptions := &vpcv1.CreateInstanceActionOptions{ InstanceID: &id, @@ -226,7 +227,7 @@ func resourceIBMISInstanceActionUpdate(context context.Context, d *schema.Resour if response != nil && response.StatusCode == 404 { return nil } - return diag.FromErr(fmt.Errorf("Error Creating Instance Action: %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Creating Instance Action: %s\n%s", err, response)) } if actiontype == "stop" { _, err = isWaitForInstanceActionStop(sess, d.Timeout(schema.TimeoutUpdate), id, d) @@ -262,7 +263,7 @@ func resourceIBMISInstanceActionExists(d *schema.ResourceData, meta interface{}) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting instance : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting instance : %s\n%s", err, response) } return true, err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_disk_management.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_disk_management.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_disk_management.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_disk_management.go index fcbf5e4da6..8ce2aea7ff 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_disk_management.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_disk_management.go @@ -1,18 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const () -func resourceIBMISInstanceDiskManagement() *schema.Resource { +func ResourceIBMISInstanceDiskManagement() *schema.Resource { return &schema.Resource{ Create: resourceIBMisInstanceDiskManagementCreate, Read: resourceIBMisInstanceDiskManagementRead, @@ -27,21 +28,21 @@ func resourceIBMISInstanceDiskManagement() *schema.Resource { ForceNew: true, Description: "ID of the instance for which disks has to be managed", }, - "disks": &schema.Schema{ + "disks": { Type: schema.TypeList, Required: true, Description: "Disk information that has to be updated.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Required: true, Description: "The unique identifier for this instance disk.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_disk_management", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_disk_management", "name"), Description: "The user-defined name for this disk. The disk will be updated with this new name", }, }, @@ -51,20 +52,20 @@ func resourceIBMISInstanceDiskManagement() *schema.Resource { } } -func resourceIBMISInstanceDiskManagementValidator() *ResourceValidator { +func ResourceIBMISInstanceDiskManagementValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmISInstanceDiskManagementValidator := ResourceValidator{ResourceName: "ibm_is_instance_disk_management", Schema: validateSchema} + ibmISInstanceDiskManagementValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_disk_management", Schema: validateSchema} return &ibmISInstanceDiskManagementValidator } @@ -92,13 +93,13 @@ func resourceIBMisInstanceDiskManagementCreate(d *schema.ResourceData, meta inte instanceDiskPatch, err := instanceDiskPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstanceDiskPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstanceDiskPatch: %s", err) } updateInstanceDiskOptions.SetInstanceDiskPatch(instanceDiskPatch) _, response, err := sess.UpdateInstanceDisk(updateInstanceDiskOptions) if err != nil { - return fmt.Errorf("Error calling UpdateInstanceDisk: %s %s", err, response) + return fmt.Errorf("[ERROR] Error calling UpdateInstanceDisk: %s %s", err, response) } } @@ -130,13 +131,13 @@ func resourceIBMisInstanceDiskManagementUpdate(d *schema.ResourceData, meta inte instanceDiskPatch, err := instanceDiskPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstanceDiskPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstanceDiskPatch: %s", err) } updateInstanceDiskOptions.SetInstanceDiskPatch(instanceDiskPatch) _, _, err = sess.UpdateInstanceDisk(updateInstanceDiskOptions) if err != nil { - return fmt.Errorf("Error updating instance disk: %s", err) + return fmt.Errorf("[ERROR] Error updating instance disk: %s", err) } } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group.go index ce0f449076..5907c85570 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -11,6 +11,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -26,7 +28,7 @@ const ( DELETING = "deleting" ) -func resourceIBMISInstanceGroup() *schema.Resource { +func ResourceIBMISInstanceGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMISInstanceGroupCreate, Read: resourceIBMISInstanceGroupRead, @@ -37,7 +39,7 @@ func resourceIBMISInstanceGroup() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -52,7 +54,7 @@ func resourceIBMISInstanceGroup() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group", "name"), Description: "The user-defined name for this instance group", }, @@ -66,7 +68,7 @@ func resourceIBMISInstanceGroup() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 0, - ValidateFunc: InvokeValidator("ibm_is_instance_group", "instance_count"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group", "instance_count"), Description: "The number of instances in the instance group", }, @@ -92,7 +94,7 @@ func resourceIBMISInstanceGroup() *schema.Resource { "application_port": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group", "application_port"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group", "application_port"), RequiredWith: []string{"load_balancer", "load_balancer_pool"}, Description: "Used by the instance group when scaling up instances to supply the port for the load balancer pool member.", }, @@ -140,51 +142,51 @@ func resourceIBMISInstanceGroup() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_instance_group", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_instance_group", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags for instance group", }, }, } } -func resourceIBMISInstanceGroupValidator() *ResourceValidator { +func ResourceIBMISInstanceGroupValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "instance_count", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "1000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "application_port", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISInstanceGroupResourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_group", Schema: validateSchema} + ibmISInstanceGroupResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_group", Schema: validateSchema} return &ibmISInstanceGroupResourceValidator } @@ -243,7 +245,7 @@ func resourceIBMISInstanceGroupCreate(d *schema.ResourceData, meta interface{}) instanceGroup, response, err := sess.CreateInstanceGroup(&instanceGroupOptions) if err != nil || instanceGroup == nil { - return fmt.Errorf("Error Creating InstanceGroup: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating InstanceGroup: %s\n%s", err, response) } d.SetId(*instanceGroup.ID) @@ -255,7 +257,7 @@ func resourceIBMISInstanceGroupCreate(d *schema.ResourceData, meta interface{}) v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk("tags"); ok || v != "" { oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instanceGroup.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instanceGroup.CRN) if err != nil { log.Printf( "Error on create of instance group (%s) tags: %s", d.Id(), err) @@ -281,10 +283,10 @@ func resourceIBMISInstanceGroupUpdate(d *schema.ResourceData, meta interface{}) getInstanceGroupOptions := vpcv1.GetInstanceGroupOptions{ID: &instanceGroupID} instanceGroup, response, err := sess.GetInstanceGroup(&getInstanceGroupOptions) if err != nil || instanceGroup == nil { - return fmt.Errorf("Error getting instance group: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting instance group: %s\n%s", err, response) } oldList, newList := d.GetChange("tags") - err = UpdateTagsUsingCRN(oldList, newList, meta, *instanceGroup.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *instanceGroup.CRN) if err != nil { log.Printf( "Error on update of instance group (%s) tags: %s", d.Id(), err) @@ -338,12 +340,12 @@ func resourceIBMISInstanceGroupUpdate(d *schema.ResourceData, meta interface{}) instanceGroupUpdateOptions.ID = &instanceGroupID instanceGroupPatch, err := instanceGroupPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstanceGroupPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstanceGroupPatch: %s", err) } instanceGroupUpdateOptions.InstanceGroupPatch = instanceGroupPatch _, response, err := sess.UpdateInstanceGroup(&instanceGroupUpdateOptions) if err != nil { - return fmt.Errorf("Error Updating InstanceGroup: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating InstanceGroup: %s\n%s", err, response) } // wait for instance group health update with update timeout configured. @@ -369,7 +371,7 @@ func resourceIBMISInstanceGroupRead(d *schema.ResourceData, meta interface{}) er d.SetId("") return nil } - return fmt.Errorf("Error Getting InstanceGroup: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup: %s\n%s", err, response) } d.Set("name", *instanceGroup.Name) d.Set("instance_template", *instanceGroup.InstanceTemplate.ID) @@ -398,7 +400,7 @@ func resourceIBMISInstanceGroupRead(d *schema.ResourceData, meta interface{}) er d.Set("status", *instanceGroup.Status) d.Set("vpc", *instanceGroup.VPC.ID) d.Set("crn", *instanceGroup.CRN) - tags, err := GetTagsUsingCRN(meta, *instanceGroup.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *instanceGroup.CRN) if err != nil { log.Printf( "Error on get of instance group (%s) tags: %s", d.Id(), err) @@ -413,7 +415,7 @@ func getLBStatus(sess *vpcv1.VpcV1, lbId string) (string, error) { } lb, response, err := sess.GetLoadBalancer(getlboptions) if err != nil || lb == nil { - return "", fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return "", fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } return *lb.ProvisioningStatus, nil } @@ -445,14 +447,14 @@ func resourceIBMISInstanceGroupDelete(d *schema.ResourceData, meta interface{}) instanceGroupPatchModel.MembershipCount = &zeroMembers instanceGroupPatch, err := instanceGroupPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for ImagePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for ImagePatch: %s", err) } instanceGroupUpdateOptions.ID = &instanceGroupID instanceGroupUpdateOptions.InstanceGroupPatch = instanceGroupPatch _, response, err = sess.UpdateInstanceGroup(&instanceGroupUpdateOptions) if err != nil { - return fmt.Errorf("Error updating instanceGroup's instance count to 0 : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating instanceGroup's instance count to 0 : %s\n%s", err, response) } _, healthError := waitForHealthyInstanceGroup(instanceGroupID, meta, d.Timeout(schema.TimeoutUpdate)) if healthError != nil { @@ -493,7 +495,7 @@ func resourceIBMISInstanceGroupDelete(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error Deleting the InstanceGroup: %s\n%s", Err, response) + return fmt.Errorf("[ERROR] Error Deleting the InstanceGroup: %s\n%s", Err, response) } _, deleteError := waitForInstanceGroupDelete(d, meta) @@ -515,7 +517,7 @@ func resourceIBMISInstanceGroupExists(d *schema.ResourceData, meta interface{}) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error Getting InstanceGroup: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting InstanceGroup: %s\n%s", err, response) } return true, nil } @@ -534,7 +536,7 @@ func waitForHealthyInstanceGroup(instanceGroupID string, meta interface{}, timeo Refresh: func() (interface{}, string, error) { instanceGroup, response, err := sess.GetInstanceGroup(&getInstanceGroupOptions) if err != nil || instanceGroup == nil { - return nil, SCALING, fmt.Errorf("Error Getting InstanceGroup: %s\n%s", err, response) + return nil, SCALING, fmt.Errorf("[ERROR] Error Getting InstanceGroup: %s\n%s", err, response) } log.Println("Status : ", *instanceGroup.Status) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager.go index af34c17e5a..2cb7fa8a94 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager.go @@ -1,17 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMISInstanceGroupManager() *schema.Resource { +func ResourceIBMISInstanceGroupManager() *schema.Resource { return &schema.Resource{ Create: resourceIBMISInstanceGroupManagerCreate, Read: resourceIBMISInstanceGroupManagerRead, @@ -30,7 +32,7 @@ func resourceIBMISInstanceGroupManager() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager", "name"), Description: "instance group manager name", }, @@ -52,7 +54,7 @@ func resourceIBMISInstanceGroupManager() *schema.Resource { Optional: true, Default: "autoscale", ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager", "manager_type"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager", "manager_type"), Description: "The type of instance group manager.", }, @@ -60,7 +62,7 @@ func resourceIBMISInstanceGroupManager() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 90, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager", "aggregation_window"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager", "aggregation_window"), Description: "The time window in seconds to aggregate metrics prior to evaluation", }, @@ -68,14 +70,14 @@ func resourceIBMISInstanceGroupManager() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 300, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager", "cooldown"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager", "cooldown"), Description: "The duration of time in seconds to pause further scale actions after scaling has taken place", }, "max_membership_count": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager", "max_membership_count"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager", "max_membership_count"), Description: "The maximum number of members in a managed instance group", }, @@ -83,7 +85,7 @@ func resourceIBMISInstanceGroupManager() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager", "min_membership_count"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager", "min_membership_count"), Description: "The minimum number of members in a managed instance group", }, @@ -124,56 +126,56 @@ func resourceIBMISInstanceGroupManager() *schema.Resource { } } -func resourceIBMISInstanceGroupManagerValidator() *ResourceValidator { +func ResourceIBMISInstanceGroupManagerValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) managerType := "autoscale, scheduled" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "manager_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: managerType}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "aggregation_window", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "90", MaxValue: "600"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "cooldown", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "120", MaxValue: "3600"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "max_membership_count", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "1000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "min_membership_count", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "1000"}) - ibmISInstanceGroupManagerResourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_group_manager", Schema: validateSchema} + ibmISInstanceGroupManagerResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_group_manager", Schema: validateSchema} return &ibmISInstanceGroupManagerResourceValidator } @@ -207,7 +209,7 @@ func resourceIBMISInstanceGroupManagerCreate(d *schema.ResourceData, meta interf } instanceGroupManagerIntf, response, err := sess.CreateInstanceGroupManager(&createInstanceGroupManagerOptions) if err != nil || instanceGroupManagerIntf == nil { - return fmt.Errorf("Error creating InstanceGroup manager: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error creating InstanceGroup manager: %s\n%s", err, response) } instanceGroupManager := instanceGroupManagerIntf.(*vpcv1.InstanceGroupManager) d.SetId(fmt.Sprintf("%s/%s", instanceGroupID, *instanceGroupManager.ID)) @@ -259,7 +261,7 @@ func resourceIBMISInstanceGroupManagerCreate(d *schema.ResourceData, meta interf instanceGroupManagerIntf, response, err := sess.CreateInstanceGroupManager(&createInstanceGroupManagerOptions) if err != nil || instanceGroupManagerIntf == nil { - return fmt.Errorf("Error creating InstanceGroup manager: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error creating InstanceGroup manager: %s\n%s", err, response) } instanceGroupManager := instanceGroupManagerIntf.(*vpcv1.InstanceGroupManager) @@ -321,7 +323,7 @@ func resourceIBMISInstanceGroupManagerUpdate(d *schema.ResourceData, meta interf } if changed { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -331,7 +333,7 @@ func resourceIBMISInstanceGroupManagerUpdate(d *schema.ResourceData, meta interf updateInstanceGroupManagerOptions.InstanceGroupID = &instanceGroupID instanceGroupManagerPatch, err := instanceGroupManagerPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstanceGroupManagerPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstanceGroupManagerPatch: %s", err) } updateInstanceGroupManagerOptions.InstanceGroupManagerPatch = instanceGroupManagerPatch @@ -342,7 +344,7 @@ func resourceIBMISInstanceGroupManagerUpdate(d *schema.ResourceData, meta interf _, response, err := sess.UpdateInstanceGroupManager(&updateInstanceGroupManagerOptions) if err != nil { - return fmt.Errorf("Error updating InstanceGroup manager: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating InstanceGroup manager: %s\n%s", err, response) } } return resourceIBMISInstanceGroupManagerRead(d, meta) @@ -354,7 +356,7 @@ func resourceIBMISInstanceGroupManagerRead(d *schema.ResourceData, meta interfac return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -371,7 +373,7 @@ func resourceIBMISInstanceGroupManagerRead(d *schema.ResourceData, meta interfac d.SetId("") return nil } - return fmt.Errorf("Error Getting InstanceGroup Manager: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager: %s\n%s", err, response) } instanceGroupManager := instanceGroupManagerIntf.(*vpcv1.InstanceGroupManager) @@ -426,7 +428,7 @@ func resourceIBMISInstanceGroupManagerDelete(d *schema.ResourceData, meta interf return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -449,7 +451,7 @@ func resourceIBMISInstanceGroupManagerDelete(d *schema.ResourceData, meta interf d.SetId("") return nil } - return fmt.Errorf("Error Deleting the InstanceGroup Manager: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting the InstanceGroup Manager: %s\n%s", err, response) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager_action.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager_action.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager_action.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager_action.go index a435b1fc08..8eb72c5873 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager_action.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager_action.go @@ -1,18 +1,20 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/go-openapi/strfmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMISInstanceGroupManagerAction() *schema.Resource { +func ResourceIBMISInstanceGroupManagerAction() *schema.Resource { return &schema.Resource{ Create: resourceIBMISInstanceGroupManagerActionCreate, Read: resourceIBMISInstanceGroupManagerActionRead, @@ -32,7 +34,7 @@ func resourceIBMISInstanceGroupManagerAction() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_action", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_action", "name"), Description: "instance group manager action name", }, @@ -64,7 +66,7 @@ func resourceIBMISInstanceGroupManagerAction() *schema.Resource { "cron_spec": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_action", "cron_spec"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_action", "cron_spec"), Description: "The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period.", ConflictsWith: []string{"run_at"}, }, @@ -72,15 +74,16 @@ func resourceIBMISInstanceGroupManagerAction() *schema.Resource { "membership_count": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_action", "membership_count"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_action", "membership_count"), Description: "The number of members the instance group should have at the scheduled time.", ConflictsWith: []string{"target_manager", "max_membership_count", "min_membership_count"}, + AtLeastOneOf: []string{"target_manager", "membership_count"}, }, "max_membership_count": { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_action", "max_membership_count"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_action", "max_membership_count"), Description: "The maximum number of members in a managed instance group", ConflictsWith: []string{"membership_count"}, RequiredWith: []string{"target_manager", "min_membership_count"}, @@ -90,7 +93,7 @@ func resourceIBMISInstanceGroupManagerAction() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_action", "min_membership_count"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_action", "min_membership_count"), Description: "The minimum number of members in a managed instance group", ConflictsWith: []string{"membership_count"}, }, @@ -101,6 +104,7 @@ func resourceIBMISInstanceGroupManagerAction() *schema.Resource { Description: "The unique identifier for this instance group manager of type autoscale.", ConflictsWith: []string{"membership_count"}, RequiredWith: []string{"min_membership_count", "max_membership_count"}, + AtLeastOneOf: []string{"target_manager", "membership_count"}, }, "target_manager_name": { @@ -158,49 +162,49 @@ func resourceIBMISInstanceGroupManagerAction() *schema.Resource { } } -func resourceIBMISInstanceGroupManagerActionValidator() *ResourceValidator { +func ResourceIBMISInstanceGroupManagerActionValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "max_membership_count", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "1000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "min_membership_count", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "1000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "cron_spec", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Regexp: `^((((\d+,)+\d+|([\d\*]+(\/|-)\d+)|\d+|\*) ?){5,7})$`, MinValueLength: 9, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "membership_count", - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "100"}) - ibmISInstanceGroupManagerResourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_group_manager_action", Schema: validateSchema} + ibmISInstanceGroupManagerResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_group_manager_action", Schema: validateSchema} return &ibmISInstanceGroupManagerResourceValidator } @@ -228,7 +232,7 @@ func resourceIBMISInstanceGroupManagerActionCreate(d *schema.ResourceData, meta runat := v.(string) datetime, err := strfmt.ParseDateTime(runat) if err != nil { - return fmt.Errorf("error in converting run_at to datetime format %s", err) + return fmt.Errorf("[ERROR] Error in converting run_at to datetime format %s", err) } instanceGroupManagerActionPrototype.RunAt = &datetime } @@ -271,7 +275,7 @@ func resourceIBMISInstanceGroupManagerActionCreate(d *schema.ResourceData, meta instanceGroupManagerActionIntf, response, err := sess.CreateInstanceGroupManagerAction(&instanceGroupManagerActionOptions) if err != nil || instanceGroupManagerActionIntf == nil { - return fmt.Errorf("error creating InstanceGroup manager Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error creating InstanceGroup manager Action: %s\n%s", err, response) } instanceGroupManagerAction := instanceGroupManagerActionIntf.(*vpcv1.InstanceGroupManagerAction) d.SetId(fmt.Sprintf("%s/%s/%s", instanceGroupID, instancegroupmanagerscheduledID, *instanceGroupManagerAction.ID)) @@ -306,7 +310,7 @@ func resourceIBMISInstanceGroupManagerActionUpdate(d *schema.ResourceData, meta runat := d.Get("run_at").(string) datetime, err := strfmt.ParseDateTime(runat) if err != nil { - return fmt.Errorf("error in converting run_at to datetime format %s", err) + return fmt.Errorf("[ERROR] Error in converting run_at to datetime format %s", err) } instanceGroupManagerActionPatchModel.RunAt = &datetime changed = true @@ -337,7 +341,7 @@ func resourceIBMISInstanceGroupManagerActionUpdate(d *schema.ResourceData, meta if changed { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -353,7 +357,7 @@ func resourceIBMISInstanceGroupManagerActionUpdate(d *schema.ResourceData, meta instanceGroupManagerActionPatch, err := instanceGroupManagerActionPatchModel.AsPatch() if err != nil { - return fmt.Errorf("error calling asPatch for instanceGroupManagerActionPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for instanceGroupManagerActionPatch: %s", err) } updateInstanceGroupManagerActionOptions.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatch @@ -363,7 +367,7 @@ func resourceIBMISInstanceGroupManagerActionUpdate(d *schema.ResourceData, meta } _, response, err := sess.UpdateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions) if err != nil { - return fmt.Errorf("error updating InstanceGroup manager action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating InstanceGroup manager action: %s\n%s", err, response) } } return resourceIBMISInstanceGroupManagerRead(d, meta) @@ -375,7 +379,7 @@ func resourceIBMISInstanceGroupManagerActionRead(d *schema.ResourceData, meta in return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -395,61 +399,61 @@ func resourceIBMISInstanceGroupManagerActionRead(d *schema.ResourceData, meta in d.SetId("") return nil } - return fmt.Errorf("error Getting InstanceGroup Manager Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Action: %s\n%s", err, response) } instanceGroupManagerAction := instanceGroupManagerActionIntf.(*vpcv1.InstanceGroupManagerAction) if err = d.Set("auto_delete", *instanceGroupManagerAction.AutoDelete); err != nil { - return fmt.Errorf("error setting auto_delete: %s", err) + return fmt.Errorf("[ERROR] Error setting auto_delete: %s", err) } - if err = d.Set("auto_delete_timeout", intValue(instanceGroupManagerAction.AutoDeleteTimeout)); err != nil { - return fmt.Errorf("error setting auto_delete_timeout: %s", err) + if err = d.Set("auto_delete_timeout", flex.IntValue(instanceGroupManagerAction.AutoDeleteTimeout)); err != nil { + return fmt.Errorf("[ERROR] Error setting auto_delete_timeout: %s", err) } if err = d.Set("created_at", instanceGroupManagerAction.CreatedAt.String()); err != nil { - return fmt.Errorf("error setting created_at: %s", err) + return fmt.Errorf("[ERROR] Error setting created_at: %s", err) } if err = d.Set("action_id", *instanceGroupManagerAction.ID); err != nil { - return fmt.Errorf("error setting instance_group_manager_action : %s", err) + return fmt.Errorf("[ERROR] Error setting instance_group_manager_action : %s", err) } if err = d.Set("name", *instanceGroupManagerAction.Name); err != nil { - return fmt.Errorf("error setting name: %s", err) + return fmt.Errorf("[ERROR] Error setting name: %s", err) } if err = d.Set("resource_type", *instanceGroupManagerAction.ResourceType); err != nil { - return fmt.Errorf("error setting resource_type: %s", err) + return fmt.Errorf("[ERROR] Error setting resource_type: %s", err) } if err = d.Set("status", *instanceGroupManagerAction.Status); err != nil { - return fmt.Errorf("error setting status: %s", err) + return fmt.Errorf("[ERROR] Error setting status: %s", err) } if err = d.Set("updated_at", instanceGroupManagerAction.UpdatedAt.String()); err != nil { - return fmt.Errorf("error setting updated_at: %s", err) + return fmt.Errorf("[ERROR] Error setting updated_at: %s", err) } if err = d.Set("action_type", *instanceGroupManagerAction.ActionType); err != nil { - return fmt.Errorf("error setting action_type: %s", err) + return fmt.Errorf("[ERROR] Error setting action_type: %s", err) } if instanceGroupManagerAction.CronSpec != nil { if err = d.Set("cron_spec", *instanceGroupManagerAction.CronSpec); err != nil { - return fmt.Errorf("error setting cron_spec: %s", err) + return fmt.Errorf("[ERROR] Error setting cron_spec: %s", err) } } if instanceGroupManagerAction.LastAppliedAt != nil { if err = d.Set("last_applied_at", instanceGroupManagerAction.LastAppliedAt.String()); err != nil { - return fmt.Errorf("error setting last_applied_at: %s", err) + return fmt.Errorf("[ERROR] Error setting last_applied_at: %s", err) } } if instanceGroupManagerAction.NextRunAt != nil { if err = d.Set("next_run_at", instanceGroupManagerAction.NextRunAt.String()); err != nil { - return fmt.Errorf("error setting next_run_at: %s", err) + return fmt.Errorf("[ERROR] Error setting next_run_at: %s", err) } } instanceGroupManagerScheduledActionGroupGroup := instanceGroupManagerAction.Group if instanceGroupManagerScheduledActionGroupGroup != nil && instanceGroupManagerScheduledActionGroupGroup.MembershipCount != nil { - d.Set("membership_count", intValue(instanceGroupManagerScheduledActionGroupGroup.MembershipCount)) + d.Set("membership_count", flex.IntValue(instanceGroupManagerScheduledActionGroupGroup.MembershipCount)) } instanceGroupManagerScheduledActionManagerManagerInt := instanceGroupManagerAction.Manager if instanceGroupManagerScheduledActionManagerManagerInt != nil { @@ -457,9 +461,9 @@ func resourceIBMISInstanceGroupManagerActionRead(d *schema.ResourceData, meta in if instanceGroupManagerScheduledActionManagerManager != nil && instanceGroupManagerScheduledActionManagerManager.ID != nil { if instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount != nil { - d.Set("max_membership_count", intValue(instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount)) + d.Set("max_membership_count", flex.IntValue(instanceGroupManagerScheduledActionManagerManager.MaxMembershipCount)) } - d.Set("min_membership_count", intValue(instanceGroupManagerScheduledActionManagerManager.MinMembershipCount)) + d.Set("min_membership_count", flex.IntValue(instanceGroupManagerScheduledActionManagerManager.MinMembershipCount)) d.Set("target_manager_name", *instanceGroupManagerScheduledActionManagerManager.Name) d.Set("target_manager", *instanceGroupManagerScheduledActionManagerManager.ID) } @@ -474,7 +478,7 @@ func resourceIBMISInstanceGroupManagerActionDelete(d *schema.ResourceData, meta return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -498,7 +502,7 @@ func resourceIBMISInstanceGroupManagerActionDelete(d *schema.ResourceData, meta d.SetId("") return nil } - return fmt.Errorf("error Deleting the InstanceGroup Manager Action: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting the InstanceGroup Manager Action: %s\n%s", err, response) } return nil } @@ -510,7 +514,7 @@ func resourceIBMISInstanceGroupManagerActionExists(d *schema.ResourceData, meta return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -529,7 +533,7 @@ func resourceIBMISInstanceGroupManagerActionExists(d *schema.ResourceData, meta if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("error Getting InstanceGroup Manager Action: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Action: %s\n%s", err, response) } return true, nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager_policy.go similarity index 78% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager_policy.go index c21835d7e2..118b4bf5bb 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_manager_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_manager_policy.go @@ -1,16 +1,19 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceIBMISInstanceGroupManagerPolicy() *schema.Resource { +func ResourceIBMISInstanceGroupManagerPolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMISInstanceGroupManagerPolicyCreate, Read: resourceIBMISInstanceGroupManagerPolicyRead, @@ -24,7 +27,7 @@ func resourceIBMISInstanceGroupManagerPolicy() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_policy", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_policy", "name"), Description: "instance group manager policy name", }, @@ -43,7 +46,7 @@ func resourceIBMISInstanceGroupManagerPolicy() *schema.Resource { "metric_type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_policy", "metric_type"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_policy", "metric_type"), Description: "The type of metric to be evaluated", }, @@ -56,7 +59,7 @@ func resourceIBMISInstanceGroupManagerPolicy() *schema.Resource { "policy_type": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_manager_policy", "policy_type"), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_manager_policy", "policy_type"), Description: "The type of Policy for the Instance Group", }, @@ -69,36 +72,36 @@ func resourceIBMISInstanceGroupManagerPolicy() *schema.Resource { } } -func resourceIBMISInstanceGroupManagerPolicyValidator() *ResourceValidator { +func ResourceIBMISInstanceGroupManagerPolicyValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) metricTypes := "cpu,memory,network_in,network_out" policyType := "target" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "metric_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: metricTypes}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "policy_type", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: policyType}) - ibmISInstanceGroupManagerPolicyResourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_group_manager_policy", Schema: validateSchema} + ibmISInstanceGroupManagerPolicyResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_group_manager_policy", Schema: validateSchema} return &ibmISInstanceGroupManagerPolicyResourceValidator } @@ -130,8 +133,8 @@ func resourceIBMISInstanceGroupManagerPolicyCreate(d *schema.ResourceData, meta } isInsGrpKey := "Instance_Group_Key_" + instanceGroupID - ibmMutexKV.Lock(isInsGrpKey) - defer ibmMutexKV.Unlock(isInsGrpKey) + conns.IbmMutexKV.Lock(isInsGrpKey) + defer conns.IbmMutexKV.Unlock(isInsGrpKey) _, healthError := waitForHealthyInstanceGroup(instanceGroupID, meta, d.Timeout(schema.TimeoutCreate)) if healthError != nil { @@ -140,7 +143,7 @@ func resourceIBMISInstanceGroupManagerPolicyCreate(d *schema.ResourceData, meta data, response, err := sess.CreateInstanceGroupManagerPolicy(&createInstanceGroupManagerPolicyOptions) if err != nil || data == nil { - return fmt.Errorf("Error Creating InstanceGroup Manager Policy: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating InstanceGroup Manager Policy: %s\n%s", err, response) } instanceGroupManagerPolicy := data.(*vpcv1.InstanceGroupManagerPolicy) @@ -178,7 +181,7 @@ func resourceIBMISInstanceGroupManagerPolicyUpdate(d *schema.ResourceData, meta } if changed { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -191,8 +194,8 @@ func resourceIBMISInstanceGroupManagerPolicyUpdate(d *schema.ResourceData, meta updateInstanceGroupManagerPolicyOptions.InstanceGroupManagerID = &instanceGroupManagerID isInsGrpKey := "Instance_Group_Key_" + instanceGroupID - ibmMutexKV.Lock(isInsGrpKey) - defer ibmMutexKV.Unlock(isInsGrpKey) + conns.IbmMutexKV.Lock(isInsGrpKey) + defer conns.IbmMutexKV.Unlock(isInsGrpKey) _, healthError := waitForHealthyInstanceGroup(instanceGroupID, meta, d.Timeout(schema.TimeoutUpdate)) if healthError != nil { @@ -201,7 +204,7 @@ func resourceIBMISInstanceGroupManagerPolicyUpdate(d *schema.ResourceData, meta _, response, err := sess.UpdateInstanceGroupManagerPolicy(&updateInstanceGroupManagerPolicyOptions) if err != nil { - return fmt.Errorf("Error Updating InstanceGroup Manager Policy: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating InstanceGroup Manager Policy: %s\n%s", err, response) } } return resourceIBMISInstanceGroupManagerPolicyRead(d, meta) @@ -213,7 +216,7 @@ func resourceIBMISInstanceGroupManagerPolicyRead(d *schema.ResourceData, meta in return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -232,7 +235,7 @@ func resourceIBMISInstanceGroupManagerPolicyRead(d *schema.ResourceData, meta in d.SetId("") return nil } - return fmt.Errorf("Error Getting InstanceGroup Manager Policy: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Policy: %s\n%s", err, response) } instanceGroupManagerPolicy := data.(*vpcv1.InstanceGroupManagerPolicy) d.Set("name", *instanceGroupManagerPolicy.Name) @@ -251,7 +254,7 @@ func resourceIBMISInstanceGroupManagerPolicyDelete(d *schema.ResourceData, meta if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -266,8 +269,8 @@ func resourceIBMISInstanceGroupManagerPolicyDelete(d *schema.ResourceData, meta } isInsGrpKey := "Instance_Group_Key_" + instanceGroupID - ibmMutexKV.Lock(isInsGrpKey) - defer ibmMutexKV.Unlock(isInsGrpKey) + conns.IbmMutexKV.Lock(isInsGrpKey) + defer conns.IbmMutexKV.Unlock(isInsGrpKey) _, healthError := waitForHealthyInstanceGroup(instanceGroupID, meta, d.Timeout(schema.TimeoutDelete)) if healthError != nil { @@ -280,7 +283,7 @@ func resourceIBMISInstanceGroupManagerPolicyDelete(d *schema.ResourceData, meta d.SetId("") return nil } - return fmt.Errorf("Error Deleting the InstanceGroup Manager Policy: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting the InstanceGroup Manager Policy: %s\n%s", err, response) } return nil } @@ -291,13 +294,13 @@ func resourceIBMISInstanceGroupManagerPolicyExists(d *schema.ResourceData, meta return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 3 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of instanceGroupID/instanceGroupManagerID/instanceGroupManagerPolicyID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of instanceGroupID/instanceGroupManagerID/instanceGroupManagerPolicyID", d.Id()) } instanceGroupID := parts[0] instanceGroupManagerID := parts[1] @@ -314,7 +317,7 @@ func resourceIBMISInstanceGroupManagerPolicyExists(d *schema.ResourceData, meta if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error Getting InstanceGroup Manager Policy: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting InstanceGroup Manager Policy: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_membership.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_membership.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_membership.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_membership.go index 20a0e2809a..e109415c8e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_group_membership.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_group_membership.go @@ -1,11 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -26,7 +28,7 @@ const ( isInstanceGroupMembershipStatus = "status" ) -func resourceIBMISInstanceGroupMembership() *schema.Resource { +func ResourceIBMISInstanceGroupMembership() *schema.Resource { return &schema.Resource{ Create: resourceIBMISInstanceGroupMembershipUpdate, Read: resourceIBMISInstanceGroupMembershipRead, @@ -40,19 +42,19 @@ func resourceIBMISInstanceGroupMembership() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_membership", isInstanceGroup), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_membership", isInstanceGroup), Description: "The instance group identifier.", }, isInstanceGroupMembership: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_membership", isInstanceGroupMembership), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_membership", isInstanceGroupMembership), Description: "The unique identifier for this instance group membership.", }, isInstanceGroupMembershipName: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_instance_group_membership", isInstanceGroupMembershipName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_group_membership", isInstanceGroupMembershipName), Description: "The user-defined name for this instance group membership. Names must be unique within the instance group.", }, isInstanceGroupMemershipActionDelete: { @@ -126,37 +128,37 @@ func resourceIBMISInstanceGroupMembership() *schema.Resource { } } -func resourceIBMISInstanceGroupMembershipValidator() *ResourceValidator { +func ResourceIBMISInstanceGroupMembershipValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceGroupMembershipName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceGroup, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[-0-9a-z_]+$`, MinValueLength: 1, MaxValueLength: 64}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceGroupMembership, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[-0-9a-z_]+$`, MinValueLength: 1, MaxValueLength: 64}) - ibmISInstanceGroupMembershipResourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_group_membership", Schema: validateSchema} + ibmISInstanceGroupMembershipResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_group_membership", Schema: validateSchema} return &ibmISInstanceGroupMembershipResourceValidator } @@ -176,7 +178,7 @@ func resourceIBMISInstanceGroupMembershipUpdate(d *schema.ResourceData, meta int instanceGroupMembership, response, err := sess.GetInstanceGroupMembership(&getInstanceGroupMembershipOptions) if err != nil || instanceGroupMembership == nil { - return fmt.Errorf("Error Getting InstanceGroup Membership: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Membership: %s\n%s", err, response) } d.SetId(fmt.Sprintf("%s/%s", instanceGroupID, instanceGroupMembershipID)) @@ -199,12 +201,12 @@ func resourceIBMISInstanceGroupMembershipUpdate(d *schema.ResourceData, meta int updateInstanceGroupMembershipOptions.InstanceGroupID = &instanceGroupID instanceGroupMembershipPatch, err := instanceGroupMembershipPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstanceGroupMembershipPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstanceGroupMembershipPatch: %s", err) } updateInstanceGroupMembershipOptions.InstanceGroupMembershipPatch = instanceGroupMembershipPatch _, response, err := sess.UpdateInstanceGroupMembership(&updateInstanceGroupMembershipOptions) if err != nil { - return fmt.Errorf("Error updating InstanceGroup Membership: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating InstanceGroup Membership: %s\n%s", err, response) } } } @@ -217,7 +219,7 @@ func resourceIBMISInstanceGroupMembershipRead(d *schema.ResourceData, meta inter return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -234,7 +236,7 @@ func resourceIBMISInstanceGroupMembershipRead(d *schema.ResourceData, meta inter d.SetId("") return nil } - return fmt.Errorf("Error Getting InstanceGroup Membership: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting InstanceGroup Membership: %s\n%s", err, response) } d.Set(isInstanceGroupMemershipDeleteInstanceOnMembershipDelete, *instanceGroupMembership.DeleteInstanceOnMembershipDelete) d.Set(isInstanceGroupMembership, *instanceGroupMembership.ID) @@ -274,7 +276,7 @@ func resourceIBMISInstanceGroupMembershipDelete(d *schema.ResourceData, meta int return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -291,7 +293,7 @@ func resourceIBMISInstanceGroupMembershipDelete(d *schema.ResourceData, meta int d.SetId("") return nil } - return fmt.Errorf("Error Deleting the InstanceGroup Membership: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting the InstanceGroup Membership: %s\n%s", err, response) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_network_interface.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_network_interface.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_network_interface.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_network_interface.go index 32abd5db11..f04e65943f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_network_interface.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_network_interface.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,6 +9,9 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -25,7 +28,7 @@ const ( isNetworkInterfaceDeleted = "deleted" ) -func resourceIBMIsInstanceNetworkInterface() *schema.Resource { +func ResourceIBMIsInstanceNetworkInterface() *schema.Resource { return &schema.Resource{ CreateContext: resourceIBMIsInstanceNetworkInterfaceCreate, ReadContext: resourceIBMIsInstanceNetworkInterfaceRead, @@ -34,7 +37,7 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "instance": &schema.Schema{ + "instance": { Type: schema.TypeString, Required: true, ForceNew: true, @@ -55,7 +58,7 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { isInstanceNicName: &schema.Schema{ Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_network_interface", isInstanceNicName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_network_interface", isInstanceNicName), Description: "The user-defined name for this network interface. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, isInstanceNicPrimaryIpv4Address: &schema.Schema{ @@ -63,10 +66,10 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_instance_network_interface", isInstanceNicPrimaryIpv4Address), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_network_interface", isInstanceNicPrimaryIpv4Address), Description: "The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If unspecified, an available address on the subnet will be automatically selected.", }, - "network_interface": &schema.Schema{ + "network_interface": { Type: schema.TypeString, Computed: true, Description: "The globally unique ID of this network interface", @@ -78,7 +81,7 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, Description: "The date and time that the network interface was created.", @@ -94,23 +97,23 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { Description: "The floating IPs associated with this network interface.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "address": &schema.Schema{ + "address": { Type: schema.TypeString, Computed: true, Description: "The globally unique IP address.", }, - "crn": &schema.Schema{ + "crn": { Type: schema.TypeString, Computed: true, Description: "The CRN for this floating IP.", }, - "deleted": &schema.Schema{ + "deleted": { Type: schema.TypeList, Computed: true, Description: "If present, this property indicates the referenced resource has been deleted and providessome supplementary information.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "more_info": &schema.Schema{ + "more_info": { Type: schema.TypeString, Computed: true, Description: "Link to documentation about deleted resources.", @@ -118,17 +121,17 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this floating IP.", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Optional: true, Description: "The unique identifier for this floating IP.", }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, Description: "The unique user-defined name for this floating IP.", @@ -136,27 +139,27 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { }, }, }, - "href": &schema.Schema{ + "href": { Type: schema.TypeString, Computed: true, Description: "The URL for this network interface.", }, - "port_speed": &schema.Schema{ + "port_speed": { Type: schema.TypeInt, Computed: true, Description: "The network interface port speed in Mbps.", }, - "resource_type": &schema.Schema{ + "resource_type": { Type: schema.TypeString, Computed: true, Description: "The resource type.", }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, Description: "The status of the network interface.", }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, Description: "The type of this network interface as it relates to an instance.", @@ -165,33 +168,33 @@ func resourceIBMIsInstanceNetworkInterface() *schema.Resource { } } -func resourceIBMIsInstanceNetworkInterfaceValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIBMIsInstanceNetworkInterfaceValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceNicName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceNicPrimaryIpv4Address, - ValidateFunctionIdentifier: ValidateRegexp, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexp, + Type: validate.TypeString, Optional: true, Regexp: `^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`, }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_is_instance_network_interface", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_network_interface", Schema: validateSchema} return &resourceValidator } func resourceIBMIsInstanceNetworkInterfaceCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -232,8 +235,8 @@ func resourceIBMIsInstanceNetworkInterfaceCreate(context context.Context, d *sch } isNICKey := "instance_network_interface_key_" + instance_id - ibmMutexKV.Lock(isNICKey) - defer ibmMutexKV.Unlock(isNICKey) + conns.IbmMutexKV.Lock(isNICKey) + defer conns.IbmMutexKV.Unlock(isNICKey) networkInterface, response, err := vpcClient.CreateInstanceNetworkInterfaceWithContext(context, createInstanceNetworkInterfaceOptions) if err != nil { @@ -246,7 +249,7 @@ func resourceIBMIsInstanceNetworkInterfaceCreate(context context.Context, d *sch _, err = isWaitForNetworkInterfaceAvailable(vpcClient, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { - return diag.FromErr(fmt.Errorf("Error occured while waiting for network interface %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error occured while waiting for network interface %s", err)) } if floating_ip_Intf, ok := d.GetOk(isInstanceNicFloatingIP); ok && floating_ip_Intf.(string) != "" { @@ -266,7 +269,7 @@ func resourceIBMIsInstanceNetworkInterfaceCreate(context context.Context, d *sch } _, err = isWaitForNetworkInterfaceAvailable(vpcClient, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { - return diag.FromErr(fmt.Errorf("Error occured while waiting for network interface %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error occured while waiting for network interface %s", err)) } } @@ -279,14 +282,14 @@ func resourceIBMIsInstanceNetworkInterfaceCreate(context context.Context, d *sch } func resourceIBMIsInstanceNetworkInterfaceRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } getInstanceNetworkInterfaceOptions := &vpcv1.GetInstanceNetworkInterfaceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -307,27 +310,27 @@ func resourceIBMIsInstanceNetworkInterfaceRead(context context.Context, d *schem d.Set("network_interface", *networkInterface.ID) d.Set("instance", parts[0]) if err = d.Set(isInstanceNicSubnet, *networkInterface.Subnet.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting subnet: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting subnet: %s", err)) } if err = d.Set(isInstanceNicAllowIPSpoofing, *networkInterface.AllowIPSpoofing); err != nil { - return diag.FromErr(fmt.Errorf("Error setting allow_ip_spoofing: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting allow_ip_spoofing: %s", err)) } if err = d.Set(isInstanceNicName, *networkInterface.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if err = d.Set(isInstanceNicPrimaryIpv4Address, *networkInterface.PrimaryIpv4Address); err != nil { - return diag.FromErr(fmt.Errorf("Error setting primary_ipv4_address: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting primary_ipv4_address: %s", err)) } if networkInterface.SecurityGroups != nil && len(networkInterface.SecurityGroups) != 0 { secgrpList := []string{} for _, secGrp := range networkInterface.SecurityGroups { secgrpList = append(secgrpList, string(*(secGrp.ID))) } - d.Set("security_groups", newStringSet(schema.HashString, secgrpList)) + d.Set("security_groups", flex.NewStringSet(schema.HashString, secgrpList)) } - if err = d.Set("created_at", dateTimeToString(networkInterface.CreatedAt)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + if err = d.Set("created_at", flex.DateTimeToString(networkInterface.CreatedAt)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } floatingIps := []map[string]interface{}{} if networkInterface.FloatingIps != nil { @@ -338,22 +341,22 @@ func resourceIBMIsInstanceNetworkInterfaceRead(context context.Context, d *schem } } if err = d.Set(isInstanceNicFloatingIPs, floatingIps); err != nil { - return diag.FromErr(fmt.Errorf("Error setting floating_ips: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting floating_ips: %s", err)) } if err = d.Set("href", networkInterface.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } - if err = d.Set("port_speed", intValue(networkInterface.PortSpeed)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting port_speed: %s", err)) + if err = d.Set("port_speed", flex.IntValue(networkInterface.PortSpeed)); err != nil { + return diag.FromErr(fmt.Errorf("[ERROR] Error setting port_speed: %s", err)) } if err = d.Set("resource_type", networkInterface.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } if err = d.Set("status", networkInterface.Status); err != nil { - return diag.FromErr(fmt.Errorf("Error setting status: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting status: %s", err)) } if err = d.Set("type", networkInterface.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting type: %s", err)) } return nil @@ -384,14 +387,14 @@ func resourceIBMIsInstanceNetworkInterfaceFloatingIPReferenceDeletedToMap(floati } func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } updateInstanceNetworkInterfaceOptions := &vpcv1.UpdateInstanceNetworkInterfaceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } @@ -417,8 +420,8 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch ovs, nvs := d.GetChange(isInstanceNicSecurityGroups) ov := ovs.(*schema.Set) nv := nvs.(*schema.Set) - remove := expandStringList(ov.Difference(nv).List()) - add := expandStringList(nv.Difference(ov).List()) + remove := flex.ExpandStringList(ov.Difference(nv).List()) + add := flex.ExpandStringList(nv.Difference(ov).List()) if len(add) > 0 { for i := range add { createsgnicoptions := &vpcv1.CreateSecurityGroupTargetBindingOptions{ @@ -427,7 +430,7 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch } _, response, err := vpcClient.CreateSecurityGroupTargetBinding(createsgnicoptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error while creating security group %q for network interface of instance %s\n%s: %q", add[i], d.Id(), err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error while creating security group %q for network interface of instance %s\n%s: %q", add[i], d.Id(), err, response)) } _, err = isWaitForInstanceAvailable(vpcClient, instance_id, d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -444,7 +447,7 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch } response, err := vpcClient.DeleteSecurityGroupTargetBinding(deletesgnicoptions) if err != nil { - return diag.FromErr(fmt.Errorf("Error while removing security group %q for network interface of instance %s\n%s: %q", remove[i], d.Id(), err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error while removing security group %q for network interface of instance %s\n%s: %q", remove[i], d.Id(), err, response)) } _, err = isWaitForInstanceAvailable(vpcClient, instance_id, d.Timeout(schema.TimeoutUpdate), d) if err != nil { @@ -456,8 +459,8 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch } if hasChange { isNICKey := "instance_network_interface_key_" + instance_id - ibmMutexKV.Lock(isNICKey) - defer ibmMutexKV.Unlock(isNICKey) + conns.IbmMutexKV.Lock(isNICKey) + defer conns.IbmMutexKV.Unlock(isNICKey) updateInstanceNetworkInterfaceOptions.NetworkInterfacePatch, _ = patchVals.AsPatch() _, response, err := vpcClient.UpdateInstanceNetworkInterfaceWithContext(context, updateInstanceNetworkInterfaceOptions) if err != nil { @@ -477,7 +480,7 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch if response.StatusCode == 404 { log.Println("[DEBUG] The specified floating IP address is not associated with the network interface with the specified identifier. ", err.Error()) } else { - return diag.FromErr(fmt.Errorf("Error de-associating the floating ip %s in network interface %s of instance %s, %s\n%s", floating_ip_id_old.(string), network_interface_id, instance_id, err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error de-associating the floating ip %s in network interface %s of instance %s, %s\n%s", floating_ip_id_old.(string), network_interface_id, instance_id, err, response)) } } } else { @@ -491,7 +494,7 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch d.SetId("") return nil } - return diag.FromErr(fmt.Errorf("Error Getting Floating IP (%s): %s\n%s", floating_ip_id, err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Floating IP (%s): %s\n%s", floating_ip_id, err, response)) } @@ -521,7 +524,7 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch _, err = isWaitForNetworkInterfaceAvailable(vpcClient, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { - return diag.FromErr(fmt.Errorf("Error occured while waiting for network interface %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error occured while waiting for network interface %s", err)) } _, err = isWaitForInstanceAvailable(vpcClient, instance_id, d.Timeout(schema.TimeoutCreate), d) if err != nil { @@ -531,22 +534,22 @@ func resourceIBMIsInstanceNetworkInterfaceUpdate(context context.Context, d *sch } func resourceIBMIsInstanceNetworkInterfaceDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } deleteInstanceNetworkInterfaceOptions := &vpcv1.DeleteInstanceNetworkInterfaceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { return diag.FromErr(err) } instance_id := parts[0] network_intf_id := parts[1] isNICKey := "instance_network_interface_key_" + instance_id - ibmMutexKV.Lock(isNICKey) - defer ibmMutexKV.Unlock(isNICKey) + conns.IbmMutexKV.Lock(isNICKey) + defer conns.IbmMutexKV.Unlock(isNICKey) deleteInstanceNetworkInterfaceOptions.SetInstanceID(instance_id) deleteInstanceNetworkInterfaceOptions.SetID(network_intf_id) @@ -559,7 +562,7 @@ func resourceIBMIsInstanceNetworkInterfaceDelete(context context.Context, d *sch _, err = isWaitForNetworkInterfaceDelete(vpcClient, d.Id(), d.Timeout(schema.TimeoutUpdate), d) if err != nil { - return diag.FromErr(fmt.Errorf("Error occured while waiting for network interface %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error occured while waiting for network interface %s", err)) } _, err = isWaitForInstanceAvailable(vpcClient, instance_id, d.Timeout(schema.TimeoutCreate), d) @@ -591,9 +594,9 @@ func isNetworkInterfaceRefreshFunc(vpcClient *vpcv1.VpcV1, id string, d *schema. return func() (interface{}, string, error) { getInstanceNetworkInterfaceOptions := &vpcv1.GetInstanceNetworkInterfaceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { - return nil, "", fmt.Errorf("Error splitting ID in parts %s", err) + return nil, "", fmt.Errorf("[ERROR] Error splitting ID in parts %s", err) } getInstanceNetworkInterfaceOptions.SetInstanceID(parts[0]) @@ -631,9 +634,9 @@ func isNetworkInterfaceRefreshDeleteFunc(vpcClient *vpcv1.VpcV1, id string, d *s return func() (interface{}, string, error) { getInstanceNetworkInterfaceOptions := &vpcv1.GetInstanceNetworkInterfaceOptions{} - parts, err := sepIdParts(d.Id(), "/") + parts, err := flex.SepIdParts(d.Id(), "/") if err != nil { - return nil, "", fmt.Errorf("Error splitting ID in parts %s", err) + return nil, "", fmt.Errorf("[ERROR] Error splitting ID in parts %s", err) } getInstanceNetworkInterfaceOptions.SetInstanceID(parts[0]) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_template.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_template.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_template.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_template.go index 2ea075831d..85434d0258 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_template.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_template.go @@ -1,12 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" "fmt" + "reflect" + "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -45,9 +49,12 @@ const ( isInstanceTemplateDedicatedHostGroup = "dedicated_host_group" isInstanceTemplateResourceType = "resource_type" isInstanceTemplateVolumeDeleteOnInstanceDelete = "delete_volume_on_instance_delete" + isInstanceTemplateMetadataServiceEnabled = "metadata_service_enabled" + isInstanceTemplateAvailablePolicyHostFailure = "availability_policy_host_failure" + isInstanceTemplateHostFailure = "host_failure" ) -func resourceIBMISInstanceTemplate() *schema.Resource { +func ResourceIBMISInstanceTemplate() *schema.Resource { return &schema.Resource{ Create: resourceIBMisInstanceTemplateCreate, Read: resourceIBMisInstanceTemplateRead, @@ -59,25 +66,41 @@ func resourceIBMISInstanceTemplate() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceVolumeAttachmentValidate(diff) + return flex.ResourceVolumeAttachmentValidate(diff) }), ), Schema: map[string]*schema.Schema{ + isInstanceTemplateAvailablePolicyHostFailure: { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + Description: "The availability policy to use for this virtual server instance", + }, + isInstanceTemplateName: { Type: schema.TypeString, Optional: true, ForceNew: false, - ValidateFunc: validateISName, + ValidateFunc: validate.ValidateISName, Description: "Instance Template name", }, + isInstanceTemplateMetadataServiceEnabled: { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Default: false, + Description: "Indicates whether the metadata service endpoint is available to the virtual server instance", + }, + isInstanceTemplateVPC: { Type: schema.TypeString, ForceNew: true, @@ -99,11 +122,26 @@ func resourceIBMISInstanceTemplate() *schema.Resource { Description: "Profile info", }, + isInstanceDefaultTrustedProfileAutoLink: { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Computed: true, + RequiredWith: []string{isInstanceDefaultTrustedProfileTarget}, + Description: "If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be automatically deleted when the instance is deleted.", + }, + isInstanceDefaultTrustedProfileTarget: { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The unique identifier or CRN of the default IAM trusted profile to use for this virtual server instance.", + }, + isInstanceTotalVolumeBandwidth: { Type: schema.TypeInt, Optional: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_instance_template", isInstanceTotalVolumeBandwidth), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_template", isInstanceTotalVolumeBandwidth), Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes", }, @@ -112,7 +150,7 @@ func resourceIBMISInstanceTemplate() *schema.Resource { Required: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Description: "SSH key Ids for the instance template", }, @@ -154,7 +192,7 @@ func resourceIBMISInstanceTemplate() *schema.Resource { isInstanceTemplateVolAttachmentName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_instance_template", isInstanceTemplateVolAttachmentName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_template", isInstanceTemplateVolAttachmentName), Description: "The user-defined name for this volume attachment.", }, isInstanceTemplateVolAttVol: { @@ -299,7 +337,7 @@ func resourceIBMISInstanceTemplate() *schema.Resource { isInstanceTemplateBootVolume: { Type: schema.TypeList, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Optional: true, Computed: true, MaxItems: 1, @@ -368,27 +406,34 @@ func resourceIBMISInstanceTemplate() *schema.Resource { } } -func resourceIBMISInstanceTemplateValidator() *ResourceValidator { - - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMISInstanceTemplateValidator() *validate.ResourceValidator { + host_failure := "restart, stop" + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceTemplateVolAttachmentName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceTotalVolumeBandwidth, - ValidateFunctionIdentifier: IntAtLeast, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntAtLeast, + Type: validate.TypeInt, Optional: true, MinValue: "500"}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ + Identifier: isInstanceTemplateAvailablePolicyHostFailure, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Optional: true, + AllowedValues: host_failure}) - ibmISInstanceTemplateValidator := ResourceValidator{ResourceName: "ibm_is_instance_template", Schema: validateSchema} + ibmISInstanceTemplateValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_template", Schema: validateSchema} return &ibmISInstanceTemplateValidator } @@ -468,6 +513,36 @@ func instanceTemplateCreate(d *schema.ResourceData, meta interface{}, profile, n instanceproto.Name = &name } + metadataServiceEnabled := d.Get(isInstanceTemplateMetadataServiceEnabled).(bool) + if metadataServiceEnabled { + instanceproto.MetadataService = &vpcv1.InstanceMetadataServicePrototype{ + Enabled: &metadataServiceEnabled, + } + } + if defaultTrustedProfileTargetIntf, ok := d.GetOk(isInstanceDefaultTrustedProfileTarget); ok { + defaultTrustedProfiletarget := defaultTrustedProfileTargetIntf.(string) + + target := &vpcv1.TrustedProfileIdentity{} + if strings.HasPrefix(defaultTrustedProfiletarget, "crn") { + target.CRN = &defaultTrustedProfiletarget + } else { + target.ID = &defaultTrustedProfiletarget + } + instanceproto.DefaultTrustedProfile = &vpcv1.InstanceDefaultTrustedProfilePrototype{ + Target: target, + } + + if defaultTrustedProfileAutoLinkIntf, ok := d.GetOkExists(isInstanceDefaultTrustedProfileAutoLink); ok { + defaultTrustedProfileAutoLink := defaultTrustedProfileAutoLinkIntf.(bool) + instanceproto.DefaultTrustedProfile.AutoLink = &defaultTrustedProfileAutoLink + } + } + if availablePolicyHostFailureIntf, ok := d.GetOk(isInstanceTemplateAvailablePolicyHostFailure); ok { + availablePolicyHostFailure := availablePolicyHostFailureIntf.(string) + instanceproto.AvailabilityPolicy = &vpcv1.InstanceAvailabilityPrototype{ + HostFailure: &availablePolicyHostFailure, + } + } if dHostIdInf, ok := d.GetOk(isPlacementTargetDedicatedHost); ok { dHostIdStr := dHostIdInf.(string) dHostPlaementTarget := &vpcv1.InstancePlacementTargetPrototypeDedicatedHostIdentity{ @@ -710,7 +785,7 @@ func instanceTemplateCreate(d *schema.ResourceData, meta interface{}, profile, n instanceIntf, response, err := sess.CreateInstanceTemplate(options) if err != nil { - return fmt.Errorf("Error creating InstanceTemplate: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error creating InstanceTemplate: %s\n%s", err, response) } instance := instanceIntf.(*vpcv1.InstanceTemplate) d.SetId(*instance.ID) @@ -727,27 +802,53 @@ func instanceTemplateGet(d *schema.ResourceData, meta interface{}, ID string) er } instanceIntf, response, err := instanceC.GetInstanceTemplate(getinsOptions) if err != nil { - return fmt.Errorf("Error Getting Instance template: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Instance template: %s\n%s", err, response) } instance := instanceIntf.(*vpcv1.InstanceTemplate) d.Set(isInstanceTemplateName, *instance.Name) d.Set(isInstanceTemplateCRN, *instance.CRN) + if instance.AvailabilityPolicy != nil && instance.AvailabilityPolicy.HostFailure != nil { + d.Set(isInstanceTemplateAvailablePolicyHostFailure, instance.AvailabilityPolicy.HostFailure) + } if instance.Profile != nil { instanceProfileIntf := instance.Profile identity := instanceProfileIntf.(*vpcv1.InstanceProfileIdentity) d.Set(isInstanceTemplateProfile, *identity.Name) } + if instance.DefaultTrustedProfile != nil { + if instance.DefaultTrustedProfile.AutoLink != nil { + d.Set(isInstanceDefaultTrustedProfileAutoLink, instance.DefaultTrustedProfile.AutoLink) + } + if instance.DefaultTrustedProfile.Target != nil { + switch reflect.TypeOf(instance.DefaultTrustedProfile.Target).String() { + case "*vpcv1.TrustedProfileIdentityTrustedProfileByID": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByID) + d.Set(isInstanceDefaultTrustedProfileTarget, target.ID) + } + case "*vpcv1.TrustedProfileIdentityTrustedProfileByCRN": + { + target := instance.DefaultTrustedProfile.Target.(*vpcv1.TrustedProfileIdentityTrustedProfileByCRN) + d.Set(isInstanceDefaultTrustedProfileTarget, target.CRN) + } + } + } + } + if instance.TotalVolumeBandwidth != nil { d.Set(isInstanceTotalVolumeBandwidth, int(*instance.TotalVolumeBandwidth)) } + if instance.MetadataService != nil { + d.Set(isInstanceTemplateMetadataServiceEnabled, instance.MetadataService.Enabled) + } var placementTargetMap map[string]interface{} if instance.PlacementTarget != nil { placementTargetMap = resourceIbmIsInstanceTemplateInstancePlacementTargetPrototypeToMap(*instance.PlacementTarget.(*vpcv1.InstancePlacementTargetPrototype)) } if err = d.Set(isInstanceTemplatePlacementTarget, []map[string]interface{}{placementTargetMap}); err != nil { - return fmt.Errorf("Error setting placement_target: %s", err) + return fmt.Errorf("[ERROR] Error setting placement_target: %s", err) } if instance.PrimaryNetworkInterface != nil { @@ -770,7 +871,7 @@ func instanceTemplateGet(d *schema.ResourceData, meta interface{}, ID string) er subnetIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*subnetIdentity.ID)) } - currentPrimNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentPrimNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } primaryNicList = append(primaryNicList, currentPrimNic) d.Set(isInstanceTemplatePrimaryNetworkInterface, primaryNicList) @@ -797,7 +898,7 @@ func instanceTemplateGet(d *schema.ResourceData, meta interface{}, ID string) er subnetIdentity := secGrpInf.(*vpcv1.SecurityGroupIdentity) secgrpList = append(secgrpList, string(*subnetIdentity.ID)) } - currentNic[isInstanceTemplateNicSecurityGroups] = newStringSet(schema.HashString, secgrpList) + currentNic[isInstanceTemplateNicSecurityGroups] = flex.NewStringSet(schema.HashString, secgrpList) } interfacesList = append(interfacesList, currentNic) } @@ -911,7 +1012,7 @@ func instanceTemplateUpdate(d *schema.ResourceData, meta interface{}) error { } instanceTemplatePatch, err := instanceTemplatePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for InstanceTemplatePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for InstanceTemplatePatch: %s", err) } updnetoptions.InstanceTemplatePatch = instanceTemplatePatch @@ -952,7 +1053,7 @@ func instanceTemplateExists(d *schema.ResourceData, meta interface{}, ID string) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error Getting InstanceTemplate: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting InstanceTemplate: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_volume_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_volume_attachment.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_volume_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_volume_attachment.go index 93aa2fb1d0..12bc60f210 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_instance_volume_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_instance_volume_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -31,7 +34,7 @@ const ( isInstanceVolProfile = "profile" ) -func resourceIBMISInstanceVolumeAttachment() *schema.Resource { +func ResourceIBMISInstanceVolumeAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMisInstanceVolumeAttachmentCreate, Read: resourceIBMisInstanceVolumeAttachmentRead, @@ -48,7 +51,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceVolumeValidate(diff) + return flex.ResourceVolumeValidate(diff) }), ), Schema: map[string]*schema.Schema{ @@ -56,7 +59,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_instance_volume_attachment", isInstanceId), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceId), Description: "Instance id", }, isInstanceVolAttId: { @@ -69,7 +72,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolAttName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolAttName), Description: "The user-defined name for this volume attachment.", }, @@ -91,7 +94,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { Computed: true, ForceNew: true, ConflictsWith: []string{isInstanceVolIops, isInstanceVolumeAttVolumeReferenceName, isInstanceVolProfile, isInstanceVolCapacity, isInstanceVolumeSnapshot}, - ValidateFunc: InvokeValidator("ibm_is_instance_volume_attachment", isInstanceName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceName), Description: "Instance id", }, @@ -107,7 +110,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolumeAttVolumeReferenceName), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolumeAttVolumeReferenceName), Description: "The unique user-defined name for this volume", }, @@ -116,7 +119,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { Optional: true, ConflictsWith: []string{isInstanceVolAttVol}, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolProfile), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolProfile), Description: "The globally unique name for the volume profile to use for this volume.", }, @@ -126,7 +129,7 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { Computed: true, AtLeastOneOf: []string{isInstanceVolAttVol, isInstanceVolCapacity, isInstanceVolumeSnapshot}, ConflictsWith: []string{isInstanceVolAttVol}, - ValidateFunc: InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolCapacity), + ValidateFunc: validate.InvokeValidator("ibm_is_instance_volume_attachment", isInstanceVolCapacity), Description: "The capacity of the volume in gigabytes. The specified minimum and maximum capacity values for creating or updating volumes may expand in the future.", }, isInstanceVolEncryptionKey: { @@ -188,52 +191,52 @@ func resourceIBMISInstanceVolumeAttachment() *schema.Resource { } } -func resourceIBMISInstanceVolumeAttachmentValidator() *ResourceValidator { +func ResourceIBMISInstanceVolumeAttachmentValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceId, - ValidateFunctionIdentifier: ValidateNoZeroValues, - Type: TypeString}) + ValidateFunctionIdentifier: validate.ValidateNoZeroValues, + Type: validate.TypeString}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceVolAttName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceVolCapacity, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "10", MaxValue: "16000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceVolumeAttVolumeReferenceName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isInstanceVolProfile, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "general-purpose, 5iops-tier, 10iops-tier, custom", }) - ibmISInstanceVolumeAttachmentValidator := ResourceValidator{ResourceName: "ibm_is_instance_volume_attachment", Schema: validateSchema} + ibmISInstanceVolumeAttachmentValidator := validate.ResourceValidator{ResourceName: "ibm_is_instance_volume_attachment", Schema: validateSchema} return &ibmISInstanceVolumeAttachmentValidator } @@ -281,7 +284,7 @@ func instanceVolAttachmentCreate(d *schema.ResourceData, meta interface{}, insta ID: &volSnapshotStr, }) if err != nil { - return fmt.Errorf("Error while getting snapshot details %q for instance %s: %q", volSnapshotStr, d.Id(), err) + return fmt.Errorf("[ERROR] Error while getting snapshot details %q for instance %s: %q", volSnapshotStr, d.Id(), err) } snapCapacity = int64(int(*snapshotGet.MinimumCapacity)) } @@ -329,13 +332,13 @@ func instanceVolAttachmentCreate(d *schema.ResourceData, meta interface{}, insta } isInstanceKey := "instance_key_" + instanceId - ibmMutexKV.Lock(isInstanceKey) - defer ibmMutexKV.Unlock(isInstanceKey) + conns.IbmMutexKV.Lock(isInstanceKey) + defer conns.IbmMutexKV.Unlock(isInstanceKey) instanceVolAtt, response, err := sess.CreateInstanceVolumeAttachment(instanceVolAttproto) if err != nil { log.Printf("[DEBUG] Instance volume attachment create err %s\n%s", err, response) - return fmt.Errorf("Error while attaching volume for instance %s: %q", instanceId, err) + return fmt.Errorf("[ERROR] Error while attaching volume for instance %s: %q", instanceId, err) } d.SetId(makeTerraformVolAttID(instanceId, *instanceVolAtt.ID)) _, err = isWaitForInstanceVolumeAttached(sess, d, instanceId, *instanceVolAtt.ID) @@ -383,7 +386,7 @@ func instanceVolumeAttachmentGet(d *schema.ResourceData, meta interface{}, insta d.SetId("") return nil } - return fmt.Errorf("Error getting Instance volume attachment : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Instance volume attachment : %s\n%s", err, response) } d.Set(isInstanceId, instanceId) @@ -411,7 +414,7 @@ func instanceVolumeAttachmentGet(d *schema.ResourceData, meta interface{}, insta } volumeDetail, _, err := instanceC.GetVolume(getVolOptions) if err != nil || volumeDetail == nil { - return fmt.Errorf("Error while getting volume details of volume %s ", id) + return fmt.Errorf("[ERROR] Error while getting volume details of volume %s ", id) } d.Set(isInstanceVolAttVol, *volumeDetail.ID) @@ -458,7 +461,7 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { if flag { volAttNamePatchModelAsPatch, err := volAttNamePatchModel.AsPatch() if err != nil || volAttNamePatchModelAsPatch == nil { - return fmt.Errorf("Error Instance volume attachment (%s) as patch : %s", id, err) + return fmt.Errorf("[ERROR] Error Instance volume attachment (%s) as patch : %s", id, err) } updateInstanceVolAttOptions.VolumeAttachmentPatch = volAttNamePatchModelAsPatch @@ -480,12 +483,12 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { } volumePatch, err := volumePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for VolumePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for VolumePatch: %s", err) } voloptions.VolumePatch = volumePatch _, response, err := instanceC.UpdateVolume(voloptions) if err != nil { - return fmt.Errorf("Error updating volume name : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating volume name : %s\n%s", err, response) } } @@ -503,7 +506,7 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { } instance, response, err := instanceC.GetInstance(getinsOptions) if err != nil || instance == nil { - return fmt.Errorf("Error retrieving Instance (%s) : %s\n%s", insId, err, response) + return fmt.Errorf("[ERROR] Error retrieving Instance (%s) : %s\n%s", insId, err, response) } if instance != nil && *instance.Status != "running" { @@ -514,7 +517,7 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { } _, response, err = instanceC.CreateInstanceAction(createinsactoptions) if err != nil { - return fmt.Errorf("Error starting Instance (%s) : %s\n%s", insId, err, response) + return fmt.Errorf("[ERROR] Error starting Instance (%s) : %s\n%s", insId, err, response) } _, err = isWaitForInstanceAvailable(instanceC, insId, d.Timeout(schema.TimeoutCreate), d) if err != nil { @@ -541,12 +544,12 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { volumeProfilePatch, err := volumeProfilePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for volumeProfilePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for volumeProfilePatch: %s", err) } updateVolumeProfileOptions.VolumePatch = volumeProfilePatch _, response, err = instanceC.UpdateVolume(updateVolumeProfileOptions) if err != nil { - return fmt.Errorf("Error updating volume profile/iops: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating volume profile/iops: %s\n%s", err, response) } isWaitForVolumeAvailable(instanceC, volId, d.Timeout(schema.TimeoutCreate)) } @@ -560,11 +563,11 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { } vol, response, err := instanceC.GetVolume(getvolumeoptions) if err != nil { - return fmt.Errorf("Error Getting Volume (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Volume (%s): %s\n%s", id, err, response) } if vol.VolumeAttachments == nil || len(vol.VolumeAttachments) == 0 || *vol.VolumeAttachments[0].Name == "" { - return fmt.Errorf("Error volume capacity can't be updated since volume %s is not attached to any instance for VolumePatch", id) + return fmt.Errorf("[ERROR] Error volume capacity can't be updated since volume %s is not attached to any instance for VolumePatch", id) } getinsOptions := &vpcv1.GetInstanceOptions{ @@ -572,7 +575,7 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { } instance, response, err := instanceC.GetInstance(getinsOptions) if err != nil || instance == nil { - return fmt.Errorf("Error retrieving Instance (%s) : %s\n%s", instanceId, err, response) + return fmt.Errorf("[ERROR] Error retrieving Instance (%s) : %s\n%s", instanceId, err, response) } if instance != nil && *instance.Status != "running" { actiontype := "start" @@ -582,10 +585,10 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { } _, response, err = instanceC.CreateInstanceAction(createinsactoptions) if err != nil { - return fmt.Errorf("Error starting Instance (%s) : %s\n%s", instanceId, err, response) + return fmt.Errorf("[ERROR] Error starting Instance (%s) : %s\n%s", instanceId, err, response) } _, err = isWaitForInstanceAvailable(instanceC, instanceId, d.Timeout(schema.TimeoutCreate), d) - return fmt.Errorf("Error starting Instance (%s) : %s\n%s", instanceId, err, response) + return fmt.Errorf("[ERROR] Error starting Instance (%s) : %s\n%s", instanceId, err, response) } capacity := int64(d.Get(isVolumeCapacity).(int)) updateVolumeOptions := &vpcv1.UpdateVolumeOptions{ @@ -595,12 +598,12 @@ func instanceVolAttUpdate(d *schema.ResourceData, meta interface{}) error { volumeCapacityPatchModel.Capacity = &capacity volumeCapacityPatch, err := volumeCapacityPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for volumeCapacityPatchModel: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for volumeCapacityPatchModel: %s", err) } updateVolumeOptions.VolumePatch = volumeCapacityPatch _, response, err = instanceC.UpdateVolume(updateVolumeOptions) if err != nil { - return fmt.Errorf("Error updating volume capacity: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating volume capacity: %s\n%s", err, response) } _, err = isWaitForVolumeAvailable(instanceC, volId, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -631,17 +634,17 @@ func instanceVolAttDelete(d *schema.ResourceData, meta interface{}, instanceId, } isInstanceKey := "instance_key_" + instanceId - ibmMutexKV.Lock(isInstanceKey) - defer ibmMutexKV.Unlock(isInstanceKey) + conns.IbmMutexKV.Lock(isInstanceKey) + defer conns.IbmMutexKV.Unlock(isInstanceKey) _, err = instanceC.DeleteInstanceVolumeAttachment(deleteInstanceVolAttOptions) if err != nil { - return fmt.Errorf("Error while deleting volume attachment (%s) from instance (%s) : %q", id, instanceId, err) + return fmt.Errorf("[ERROR] Error while deleting volume attachment (%s) from instance (%s) : %q", id, instanceId, err) } _, err = isWaitForInstanceVolumeDetached(instanceC, d, instanceId, id) if err != nil { - return fmt.Errorf("Error while deleting volume attachment (%s) from instance (%s) on wait : %q", id, instanceId, err) + return fmt.Errorf("[ERROR] Error while deleting volume attachment (%s) from instance (%s) on wait : %q", id, instanceId, err) } if volDelete { deleteVolumeOptions := &vpcv1.DeleteVolumeOptions{ @@ -649,7 +652,7 @@ func instanceVolAttDelete(d *schema.ResourceData, meta interface{}, instanceId, } response, err := instanceC.DeleteVolume(deleteVolumeOptions) if err != nil { - return fmt.Errorf("Error while deleting volume : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while deleting volume : %s\n%s", err, response) } _, err = isWaitForVolumeDeleted(instanceC, volId, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -706,7 +709,7 @@ func instanceVolAttExists(d *schema.ResourceData, meta interface{}, instanceId, if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Instance volume attachment: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Instance volume attachment: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ipsec_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ipsec_policy.go similarity index 80% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ipsec_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ipsec_policy.go index 08dd03971a..aa74c6ea9f 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ipsec_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ipsec_policy.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -26,7 +28,7 @@ const ( isIPSecVPNConnectionHref = "href" ) -func resourceIBMISIPSecPolicy() *schema.Resource { +func ResourceIBMISIPSecPolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMISIPSecPolicyCreate, Read: resourceIBMISIPSecPolicyRead, @@ -39,28 +41,28 @@ func resourceIBMISIPSecPolicy() *schema.Resource { isIpSecName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ipsec_policy", isIpSecName), + ValidateFunc: validate.InvokeValidator("ibm_is_ipsec_policy", isIpSecName), Description: "IPSEC name", }, isIpSecAuthenticationAlg: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ipsec_policy", isIpSecAuthenticationAlg), + ValidateFunc: validate.InvokeValidator("ibm_is_ipsec_policy", isIpSecAuthenticationAlg), Description: "Authentication alorothm", }, isIpSecEncryptionAlg: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ipsec_policy", isIpSecEncryptionAlg), + ValidateFunc: validate.InvokeValidator("ibm_is_ipsec_policy", isIpSecEncryptionAlg), Description: "Encryption algorithm", }, isIpSecPFS: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_ipsec_policy", isIpSecPFS), + ValidateFunc: validate.InvokeValidator("ibm_is_ipsec_policy", isIpSecPFS), Description: "PFS info", }, @@ -76,7 +78,7 @@ func resourceIBMISIPSecPolicy() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 3600, - ValidateFunc: validateKeyLifeTime, + ValidateFunc: validate.ValidateKeyLifeTime, Description: "IPSEC key lifetime", }, @@ -112,25 +114,25 @@ func resourceIBMISIPSecPolicy() *schema.Resource { }, }, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -139,44 +141,44 @@ func resourceIBMISIPSecPolicy() *schema.Resource { } } -func resourceIBMISIPSECValidator() *ResourceValidator { +func ResourceIBMISIPSECValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) authentication_algorithm := "md5, sha1, sha256, sha512" encryption_algorithm := "triple_des, aes128, aes256" pfs := "disabled, group_2, group_5, group_14" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIpSecName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIpSecAuthenticationAlg, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: authentication_algorithm}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIpSecEncryptionAlg, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: encryption_algorithm}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isIpSecPFS, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: pfs}) - ibmISIPSECResourceValidator := ResourceValidator{ResourceName: "ibm_is_ipsec_policy", Schema: validateSchema} + ibmISIPSECResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_ipsec_policy", Schema: validateSchema} return &ibmISIPSECResourceValidator } @@ -250,14 +252,14 @@ func ipsecpGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting IPSEC Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting IPSEC Policy(%s): %s\n%s", id, err, response) } d.Set(isIpSecName, *ipSec.Name) d.Set(isIpSecAuthenticationAlg, *ipSec.AuthenticationAlgorithm) d.Set(isIpSecEncryptionAlg, *ipSec.EncryptionAlgorithm) if ipSec.ResourceGroup != nil { d.Set(isIPSecResourceGroup, *ipSec.ResourceGroup.ID) - d.Set(ResourceGroupName, *ipSec.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *ipSec.ResourceGroup.Name) } else { d.Set(isIPSecResourceGroup, nil) } @@ -279,13 +281,13 @@ func ipsecpGet(d *schema.ResourceData, meta interface{}, id string) error { } } d.Set(isIPSecVPNConnections, connList) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/ipsecpolicies") - d.Set(ResourceName, *ipSec.Name) - // d.Set(ResourceCRN, *ipSec.Crn) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/ipsecpolicies") + d.Set(flex.ResourceName, *ipSec.Name) + // d.Set(flex.ResourceCRN, *ipSec.Crn) return nil } @@ -325,13 +327,13 @@ func ipsecpUpdate(d *schema.ResourceData, meta interface{}, id string) error { } ipsecPolicyPatch, err := ipsecPolicyPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for IPsecPolicyPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for IPsecPolicyPatch: %s", err) } options.IPsecPolicyPatch = ipsecPolicyPatch _, response, err := sess.UpdateIpsecPolicy(options) if err != nil { - return fmt.Errorf("Error on update of IPSEC Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error on update of IPSEC Policy(%s): %s\n%s", id, err, response) } } return nil @@ -357,14 +359,14 @@ func ipsecpDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting IPSEC Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting IPSEC Policy(%s): %s\n%s", id, err, response) } deleteIpsecPolicyOptions := &vpcv1.DeleteIpsecPolicyOptions{ ID: &id, } response, err = sess.DeleteIpsecPolicy(deleteIpsecPolicyOptions) if err != nil { - return fmt.Errorf("Error Deleting IPSEC Policy(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Deleting IPSEC Policy(%s): %s\n%s", id, err, response) } d.SetId("") return nil @@ -389,7 +391,7 @@ func ipsecpExists(d *schema.ResourceData, meta interface{}, id string) (bool, er if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting IPSEC Policy(%s): %s\n%s", id, err, response) + return false, fmt.Errorf("[ERROR] Error getting IPSEC Policy(%s): %s\n%s", id, err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb.go index 12e4045d43..6f1380a6e6 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -41,7 +43,7 @@ const ( isLBSecurityGroupsSupported = "security_group_supported" ) -func resourceIBMISLB() *schema.Resource { +func ResourceIBMISLB() *schema.Resource { return &schema.Resource{ Create: resourceIBMISLBCreate, Read: resourceIBMISLBRead, @@ -59,12 +61,12 @@ func resourceIBMISLB() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceRouteModeValidate(diff) + return flex.ResourceRouteModeValidate(diff) }), ), @@ -74,7 +76,7 @@ func resourceIBMISLB() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_lb", isLBName), + ValidateFunc: validate.InvokeValidator("ibm_is_lb", isLBName), Description: "Load Balancer name", }, @@ -83,7 +85,7 @@ func resourceIBMISLB() *schema.Resource { ForceNew: true, Optional: true, Default: "public", - ValidateFunc: InvokeValidator("ibm_is_lb", isLBType), + ValidateFunc: validate.InvokeValidator("ibm_is_lb", isLBType), Description: "Load Balancer type", }, @@ -118,6 +120,7 @@ func resourceIBMISLB() *schema.Resource { isLBSubnets: { Type: schema.TypeSet, Required: true, + ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, Description: "Load Balancer subnets list", @@ -145,7 +148,7 @@ func resourceIBMISLB() *schema.Resource { Computed: true, ForceNew: true, Description: "The profile to use for this load balancer.", - ValidateFunc: InvokeValidator("ibm_is_lb", isLBProfile), + ValidateFunc: validate.InvokeValidator("ibm_is_lb", isLBProfile), ConflictsWith: []string{isLBLogging}, }, @@ -153,8 +156,8 @@ func resourceIBMISLB() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_lb", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_lb", "tag")}, + Set: flex.ResourceIBMVPCHash, }, isLBResourceGroup: { @@ -185,19 +188,19 @@ func resourceIBMISLB() *schema.Resource { ConflictsWith: []string{isLBProfile}, }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -206,46 +209,46 @@ func resourceIBMISLB() *schema.Resource { } } -func resourceIBMISLBValidator() *ResourceValidator { +func ResourceIBMISLBValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) lbtype := "public, private" isLBProfileAllowedValues := "network-fixed" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: lbtype}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBProfile, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: false, AllowedValues: isLBProfileAllowedValues}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISLBResourceValidator := ResourceValidator{ResourceName: "ibm_is_lb", Schema: validateSchema} + ibmISLBResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_lb", Schema: validateSchema} return &ibmISLBResourceValidator } @@ -264,7 +267,7 @@ func resourceIBMISLBCreate(d *schema.ResourceData, meta interface{}) error { securityGroups = sg.(*schema.Set) } - // subnets := expandStringList((d.Get(isLBSubnets).(*schema.Set)).List()) + // subnets := flex.ExpandStringList((d.Get(isLBSubnets).(*schema.Set)).List()) var lbType, rg string isPublic := true if types, ok := d.GetOk(isLBType); ok { @@ -350,7 +353,7 @@ func lbCreate(d *schema.ResourceData, meta interface{}, name, lbType, rg string, lb, response, err := sess.CreateLoadBalancer(options) if err != nil { - return fmt.Errorf("Error while creating Load Balancer err %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Load Balancer err %s\n%s", err, response) } d.SetId(*lb.ID) log.Printf("[INFO] Load Balancer : %s", *lb.ID) @@ -361,7 +364,7 @@ func lbCreate(d *schema.ResourceData, meta interface{}, name, lbType, rg string, v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isLBTags); ok || v != "" { oldList, newList := d.GetChange(isLBTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *lb.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *lb.CRN) if err != nil { log.Printf( "Error on create of resource vpc Load Balancer (%s) tags: %s", d.Id(), err) @@ -395,7 +398,7 @@ func lbGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Load Balancer : %s\n%s", err, response) } d.Set(isLBName, *lb.Name) if *lb.IsPublic { @@ -466,20 +469,20 @@ func lbGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isLBResourceGroup, *lb.ResourceGroup.ID) d.Set(isLBHostName, *lb.Hostname) - tags, err := GetTagsUsingCRN(meta, *lb.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *lb.CRN) if err != nil { log.Printf( "Error on get of resource vpc Load Balancer (%s) tags: %s", d.Id(), err) } d.Set(isLBTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/loadBalancers") - d.Set(ResourceName, *lb.Name) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/loadBalancers") + d.Set(flex.ResourceName, *lb.Name) if lb.ResourceGroup != nil { - d.Set(ResourceGroupName, lb.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, lb.ResourceGroup.Name) } return nil } @@ -506,8 +509,8 @@ func resourceIBMISLBUpdate(d *schema.ResourceData, meta interface{}) error { oldSecurityGroups, newSecurityGroups := d.GetChange(isLBSecurityGroups) oSecurityGroups := oldSecurityGroups.(*schema.Set) nSecurityGroups := newSecurityGroups.(*schema.Set) - remove = expandStringList(oSecurityGroups.Difference(nSecurityGroups).List()) - add = expandStringList(nSecurityGroups.Difference(oSecurityGroups).List()) + remove = flex.ExpandStringList(oSecurityGroups.Difference(nSecurityGroups).List()) + add = flex.ExpandStringList(nSecurityGroups.Difference(oSecurityGroups).List()) hasChangedSecurityGroups = true } @@ -530,10 +533,10 @@ func lbUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasChan } lb, response, err := sess.GetLoadBalancer(getLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Load Balancer : %s\n%s", err, response) } oldList, newList := d.GetChange(isLBTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *lb.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *lb.CRN) if err != nil { log.Printf( "Error on update of resource vpc Load Balancer (%s) tags: %s", d.Id(), err) @@ -548,13 +551,13 @@ func lbUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasChan } loadBalancerPatch, err := loadBalancerPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerPatch: %s", err) } updateLoadBalancerOptions.LoadBalancerPatch = loadBalancerPatch _, response, err := sess.UpdateLoadBalancer(updateLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Updating vpc Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating vpc Load Balancer : %s\n%s", err, response) } } if hasChangedLog { @@ -572,13 +575,13 @@ func lbUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasChan } loadBalancerPatch, err := loadBalancerPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerPatch: %s", err) } updateLoadBalancerOptions.LoadBalancerPatch = loadBalancerPatch _, response, err := sess.UpdateLoadBalancer(updateLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Updating vpc Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating vpc Load Balancer : %s\n%s", err, response) } } @@ -591,7 +594,7 @@ func lbUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasChan createSecurityGroupTargetBindingOptions.ID = &id _, response, err := sess.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions) if err != nil { - return fmt.Errorf("Error while creating Security Group Target Binding %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Security Group Target Binding %s\n%s", err, response) } _, err = isWaitForLBAvailable(sess, d.Id(), d.Timeout(schema.TimeoutUpdate)) if err != nil { @@ -611,12 +614,12 @@ func lbUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasChan if response != nil && response.StatusCode == 404 { continue } - return fmt.Errorf("Error Getting Security Group Target for this load balancer (%s): %s\n%s", securityGroupID, err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group Target for this load balancer (%s): %s\n%s", securityGroupID, err, response) } deleteSecurityGroupTargetBindingOptions := sess.NewDeleteSecurityGroupTargetBindingOptions(securityGroupID, id) response, err = sess.DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions) if err != nil { - return fmt.Errorf("Error Deleting Security Group Target for this load balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Security Group Target for this load balancer : %s\n%s", err, response) } _, err = isWaitForLBAvailable(sess, d.Id(), d.Timeout(schema.TimeoutUpdate)) if err != nil { @@ -655,7 +658,7 @@ func lbDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting vpc load balancer(%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting vpc load balancer(%s): %s\n%s", id, err, response) } deleteLoadBalancerOptions := &vpcv1.DeleteLoadBalancerOptions{ @@ -663,7 +666,7 @@ func lbDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteLoadBalancer(deleteLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Deleting vpc load balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting vpc load balancer : %s\n%s", err, response) } _, err = isWaitForLBDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -699,7 +702,7 @@ func isLBDeleteRefreshFunc(lbc *vpcv1.VpcV1, id string) resource.StateRefreshFun if response != nil && response.StatusCode == 404 { return lb, isLBDeleted, nil } - return nil, "failed", fmt.Errorf("The vpc load balancer %s failed to delete: %s\n%s", id, err, response) + return nil, "failed", fmt.Errorf("[ERROR] The vpc load balancer %s failed to delete: %s\n%s", id, err, response) } return lb, isLBDeleting, nil } @@ -726,7 +729,7 @@ func lbExists(d *schema.ResourceData, meta interface{}, id string) (bool, error) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting vpc load balancer: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting vpc load balancer: %s\n%s", err, response) } return true, nil } @@ -754,7 +757,7 @@ func isLBRefreshFunc(sess *vpcv1.VpcV1, lbId string) resource.StateRefreshFunc { } lb, response, err := sess.GetLoadBalancer(getlboptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } if *lb.ProvisioningStatus == "active" || *lb.ProvisioningStatus == "failed" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener.go index e647f746ad..51f93ac2d3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -9,6 +9,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -35,7 +38,7 @@ const ( isLBListenerHTTPSRedirectURI = "https_redirect_uri" ) -func resourceIBMISLBListener() *schema.Resource { +func ResourceIBMISLBListener() *schema.Resource { return &schema.Resource{ Create: resourceIBMISLBListenerCreate, Read: resourceIBMISLBListenerRead, @@ -62,7 +65,7 @@ func resourceIBMISLBListener() *schema.Resource { isLBListenerPort: { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateLBListenerPort, + ValidateFunc: validate.ValidateLBListenerPort, Computed: true, Description: "Loadbalancer listener port", }, @@ -80,7 +83,7 @@ func resourceIBMISLBListener() *schema.Resource { isLBListenerProtocol: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener", isLBListenerProtocol), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener", isLBListenerProtocol), Description: "Loadbalancer protocol", }, @@ -121,7 +124,7 @@ func resourceIBMISLBListener() *schema.Resource { isLBListenerConnectionLimit: { Type: schema.TypeInt, Optional: true, - ValidateFunc: validateLBListenerConnectionLimit, + ValidateFunc: validate.ValidateLBListenerConnectionLimit, Description: "Connection limit for Loadbalancer", }, @@ -161,7 +164,7 @@ func resourceIBMISLBListener() *schema.Resource { Computed: true, }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the LB resource", @@ -170,19 +173,19 @@ func resourceIBMISLBListener() *schema.Resource { } } -func resourceIBMISLBListenerValidator() *ResourceValidator { +func ResourceIBMISLBListenerValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) protocol := "https, http, tcp" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBListenerProtocol, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: protocol}) - ibmISLBListenerResourceValidator := ResourceValidator{ResourceName: "ibm_is_lb_listener", Schema: validateSchema} + ibmISLBListenerResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_lb_listener", Schema: validateSchema} return &ibmISLBListenerResourceValidator } @@ -230,8 +233,8 @@ func resourceIBMISLBListenerCreate(d *schema.ResourceData, meta interface{}) err } isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err := lbListenerCreate(d, meta, lbID, protocol, defPool, certificateCRN, listener, uri, port, connLimit, httpStatusCode) if err != nil { @@ -258,7 +261,7 @@ func lbListenerCreate(d *schema.ResourceData, meta interface{}, lbID, protocol, lb, response, err := sess.GetLoadBalancer(getlboptions) if err != nil || lb == nil { - return fmt.Errorf("Error getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Load Balancer : %s\n%s", err, response) } if lb != nil && *lb.RouteMode && lb.Profile != nil && *lb.Profile.Name == "network-fixed" { @@ -304,24 +307,21 @@ func lbListenerCreate(d *schema.ResourceData, meta interface{}, lbID, protocol, } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } lbListener, response, err := sess.CreateLoadBalancerListener(options) if err != nil { - return fmt.Errorf("Error while creating Load Balanacer Listener err %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Load Balanacer Listener err %s\n%s", err, response) } d.SetId(fmt.Sprintf("%s/%s", lbID, *lbListener.ID)) _, err = isWaitForLBListenerAvailable(sess, lbID, *lbListener.ID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer listener(%s) to become ready: %s", d.Id(), err) + return fmt.Errorf("[ERROR] Error waiting for load balancer listener(%s) to become ready: %s", d.Id(), err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to become ready: %s", lbID, err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to become ready: %s", lbID, err) } log.Printf("[INFO] Load balancer Listener : %s", *lbListener.ID) @@ -352,7 +352,7 @@ func isLBListenerRefreshFunc(sess *vpcv1.VpcV1, lbID, lbListenerID string) resou } lblis, response, err := sess.GetLoadBalancerListener(getLoadBalancerListenerOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Load Balancer Listener: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Load Balancer Listener: %s\n%s", err, response) } if *lblis.ProvisioningStatus == "active" || *lblis.ProvisioningStatus == "failed" { @@ -365,7 +365,7 @@ func isLBListenerRefreshFunc(sess *vpcv1.VpcV1, lbID, lbListenerID string) resou func resourceIBMISLBListenerRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -396,7 +396,7 @@ func lbListenerGet(d *schema.ResourceData, meta interface{}, lbID, lbListenerID d.SetId("") return nil } - return fmt.Errorf("Error Getting Load Balancer Listener : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer Listener : %s\n%s", err, response) } d.Set(isLBListenerLBID, lbID) if lbListener.Port != nil { @@ -433,15 +433,15 @@ func lbListenerGet(d *schema.ResourceData, meta interface{}, lbID, lbListenerID } lb, response, err := sess.GetLoadBalancer(getLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } - d.Set(RelatedCRN, *lb.CRN) + d.Set(flex.RelatedCRN, *lb.CRN) return nil } func resourceIBMISLBListenerUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -544,7 +544,7 @@ func lbListenerUpdate(d *schema.ResourceData, meta interface{}, lbID, lbListener if hasChanged { loadBalancerListenerPatch, err := loadBalancerListenerPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerListenerPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerListenerPatch: %s", err) } if httpsRedirectRemoved { loadBalancerListenerPatch["https_redirect"] = nil @@ -555,8 +555,8 @@ func lbListenerUpdate(d *schema.ResourceData, meta interface{}, lbID, lbListener updateLoadBalancerListenerOptions.LoadBalancerListenerPatch = loadBalancerListenerPatch isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutUpdate)) if err != nil { @@ -565,7 +565,7 @@ func lbListenerUpdate(d *schema.ResourceData, meta interface{}, lbID, lbListener } _, response, err := sess.UpdateLoadBalancerListener(updateLoadBalancerListenerOptions) if err != nil { - return fmt.Errorf("Error Updating Load Balancer Listener : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Load Balancer Listener : %s\n%s", err, response) } _, err = isWaitForLBListenerAvailable(sess, lbID, lbListenerID, d.Timeout(schema.TimeoutUpdate)) @@ -585,7 +585,7 @@ func lbListenerUpdate(d *schema.ResourceData, meta interface{}, lbID, lbListener func resourceIBMISLBListenerDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -594,8 +594,8 @@ func resourceIBMISLBListenerDelete(d *schema.ResourceData, meta interface{}) err lbListenerID := parts[1] isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err = lbListenerDelete(d, meta, lbID, lbListenerID) if err != nil { @@ -621,12 +621,11 @@ func lbListenerDelete(d *schema.ResourceData, meta interface{}, lbID, lbListener d.SetId("") return nil } - return fmt.Errorf("Error Getting vpc load balancer listener(%s): %s\n%s", lbListenerID, err, response) + return fmt.Errorf("[ERROR] Error Getting vpc load balancer listener(%s): %s\n%s", lbListenerID, err, response) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } deleteLoadBalancerListenerOptions := &vpcv1.DeleteLoadBalancerListenerOptions{ LoadBalancerID: &lbID, @@ -634,7 +633,7 @@ func lbListenerDelete(d *schema.ResourceData, meta interface{}, lbID, lbListener } response, err = sess.DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions) if err != nil { - return fmt.Errorf("Error Deleting Load Balancer Pool : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Load Balancer Pool : %s\n%s", err, response) } _, err = isWaitForLBListenerDeleted(sess, lbID, lbListenerID, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -642,8 +641,7 @@ func lbListenerDelete(d *schema.ResourceData, meta interface{}, lbID, lbListener } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error waiting for load balancer (%s) to be active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error waiting for load balancer (%s) to be active: %s", lbID, err) } d.SetId("") @@ -676,7 +674,7 @@ func isLBListenerDeleteRefreshFunc(lbc *vpcv1.VpcV1, lbID, lbListenerID string) if response != nil && response.StatusCode == 404 { return lbLis, isLBListenerDeleted, nil } - return nil, "", fmt.Errorf("The vpc load balancer listener %s failed to delete: %s\n%s", lbListenerID, err, response) + return nil, "", fmt.Errorf("[ERROR] The vpc load balancer listener %s failed to delete: %s\n%s", lbListenerID, err, response) } return lbLis, isLBListenerDeleting, nil } @@ -684,12 +682,12 @@ func isLBListenerDeleteRefreshFunc(lbc *vpcv1.VpcV1, lbID, lbListenerID string) func resourceIBMISLBListenerExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of lbID/lbListenerID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of lbID/lbListenerID", d.Id()) } lbID := parts[0] lbListenerID := parts[1] @@ -714,7 +712,7 @@ func lbListenerExists(d *schema.ResourceData, meta interface{}, lbID, lbListener if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Load balancer Listener: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Load balancer Listener: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener_policy.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener_policy.go similarity index 91% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener_policy.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener_policy.go index 0cab21500a..e8bf3a8d69 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener_policy.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener_policy.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -47,7 +50,7 @@ const ( isLBListenerPolicyHTTPSRedirectListener = "target_https_redirect_listener" ) -func resourceIBMISLBListenerPolicy() *schema.Resource { +func ResourceIBMISLBListenerPolicy() *schema.Resource { return &schema.Resource{ Create: resourceIBMISLBListenerPolicyCreate, Read: resourceIBMISLBListenerPolicyRead, @@ -59,7 +62,7 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceLBListenerPolicyCustomizeDiff(diff) + return flex.ResourceLBListenerPolicyCustomizeDiff(diff) }, ), ), @@ -132,7 +135,7 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener_policy", isLBListenerPolicyAction), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener_policy", isLBListenerPolicyAction), Description: "Policy Action", }, @@ -140,7 +143,7 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { Type: schema.TypeInt, Required: true, ForceNew: false, - ValidateFunc: validateLBListenerPolicyPriority, + ValidateFunc: validate.ValidateLBListenerPolicyPriority, Description: "Listener Policy Priority", }, @@ -149,7 +152,7 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { Optional: true, ForceNew: false, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener_policy", isLBListenerPolicyName), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener_policy", isLBListenerPolicyName), Description: "Policy name", }, @@ -169,28 +172,28 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { isLBListenerPolicyRuleCondition: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRulecondition), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRulecondition), Description: "Condition of the rule", }, isLBListenerPolicyRuleType: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRuleType), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRuleType), Description: "Type of the rule", }, isLBListenerPolicyRuleValue: { Type: schema.TypeString, Required: true, - ValidateFunc: validateStringLength, + ValidateFunc: validate.ValidateStringLength, Description: "Value to be matched for rule condition", }, isLBListenerPolicyRuleField: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateStringLength, + ValidateFunc: validate.ValidateStringLength, Description: "HTTP header field. This is only applicable to rule type.", }, @@ -250,7 +253,7 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { Description: "Listner Policy status", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the LB resource", @@ -259,28 +262,28 @@ func resourceIBMISLBListenerPolicy() *schema.Resource { } } -func resourceIBMISLBListenerPolicyValidator() *ResourceValidator { +func ResourceIBMISLBListenerPolicyValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) action := "forward, redirect, reject, https_redirect" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBListenerPolicyName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBListenerPolicyAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: action}) - ibmISLBListenerPolicyResourceValidator := ResourceValidator{ResourceName: "ibm_is_lb_listener_policy", Schema: validateSchema} + ibmISLBListenerPolicyResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_lb_listener_policy", Schema: validateSchema} return &ibmISLBListenerPolicyResourceValidator } @@ -314,7 +317,7 @@ func resourceIBMISLBListenerPolicyCreate(d *schema.ResourceData, meta interface{ func getListenerID(id string) (string, error) { if strings.Contains(id, "/") { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return "", err } @@ -327,7 +330,7 @@ func getListenerID(id string) (string, error) { func getPoolID(id string) (string, error) { if strings.Contains(id, "/") { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return "", err } @@ -469,8 +472,8 @@ func lbListenerPolicyCreate(d *schema.ResourceData, meta interface{}, lbID, list } isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err = isWaitForLbAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -480,7 +483,7 @@ func lbListenerPolicyCreate(d *schema.ResourceData, meta interface{}, lbID, list policy, response, err := sess.CreateLoadBalancerListenerPolicy(options) if err != nil { - return fmt.Errorf("Error while creating lb listener policy for LB %s: Error %v Response %v", lbID, err, *response) + return fmt.Errorf("[ERROR] Error while creating lb listener policy for LB %s: Error %v Response %v", lbID, err, *response) } d.SetId(fmt.Sprintf("%s/%s/%s", lbID, listenerID, *(policy.ID))) @@ -543,7 +546,7 @@ func isWaitForLbListenerPolicyAvailable(vpc *vpcv1.VpcV1, id string, timeout tim func isLbListenerPolicyRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return nil, "", err } @@ -575,7 +578,7 @@ func isLbListenerPolicyRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.StateRe func resourceIBMISLBListenerPolicyRead(d *schema.ResourceData, meta interface{}) error { ID := d.Id() - parts, err := idParts(ID) + parts, err := flex.IdParts(ID) if err != nil { return err } @@ -606,12 +609,12 @@ func lbListenerPolicyExists(d *schema.ResourceData, meta interface{}, ID string) if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 3 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of lbID/listenerID/policyID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of lbID/listenerID/policyID", d.Id()) } lbID := parts[0] @@ -631,13 +634,13 @@ func lbListenerPolicyExists(d *schema.ResourceData, meta interface{}, ID string) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Load balancer policy: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Load balancer policy: %s\n%s", err, response) } return true, nil } func resourceIBMISLBListenerPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -765,15 +768,15 @@ func lbListenerPolicyUpdate(d *schema.ResourceData, meta interface{}, lbID, list if hasChanged { loadBalancerListenerPolicyPatch, err := loadBalancerListenerPolicyPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerListenerPolicyPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerListenerPolicyPatch: %s", err) } if httpsURIRemoved { loadBalancerListenerPolicyPatch["target"].(map[string]interface{})["uri"] = nil } updatePolicyOptions.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatch isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err = isWaitForLbAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -782,7 +785,7 @@ func lbListenerPolicyUpdate(d *schema.ResourceData, meta interface{}, lbID, list } _, response, err := sess.UpdateLoadBalancerListenerPolicy(&updatePolicyOptions) if err != nil { - return fmt.Errorf("Error Updating in policy : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating in policy : %s\n%s", err, response) } _, err = isWaitForLbListenerPolicyAvailable(sess, d.Id(), d.Timeout(schema.TimeoutCreate)) @@ -796,7 +799,7 @@ func lbListenerPolicyUpdate(d *schema.ResourceData, meta interface{}, lbID, list func resourceIBMISLBListenerPolicyDelete(d *schema.ResourceData, meta interface{}) error { //Retrieve lbId, listenerId and policyID - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -806,8 +809,8 @@ func resourceIBMISLBListenerPolicyDelete(d *schema.ResourceData, meta interface{ policyID := parts[2] isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err = lbListenerPolicyDelete(d, meta, lbID, listenerID, policyID) if err != nil { @@ -855,7 +858,7 @@ func lbListenerPolicyDelete(d *schema.ResourceData, meta interface{}, lbID, list response, err = sess.DeleteLoadBalancerListenerPolicy(deleteLbListenerPolicyOptions) if err != nil { - return fmt.Errorf("Error in lbListenerPolicyDelete: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in lbListenerPolicyDelete: %s\n%s", err, response) } _, err = isWaitForLbListnerPolicyDeleted(sess, d.Id(), d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -881,7 +884,7 @@ func isLbListenerPolicyDeleteRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.S return func() (interface{}, string, error) { //Retrieve lbId, listenerId and policyID - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return nil, isLBListenerPolicyFailed, nil } @@ -1012,9 +1015,9 @@ func lbListenerPolicyGet(d *schema.ResourceData, meta interface{}, lbID, listene } lb, response, err := sess.GetLoadBalancer(getLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } - d.Set(RelatedCRN, *lb.CRN) + d.Set(flex.RelatedCRN, *lb.CRN) return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener_policy_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener_policy_rule.go similarity index 87% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener_policy_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener_policy_rule.go index 1a5475d030..195b8bece3 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_listener_policy_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_listener_policy_rule.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -34,7 +37,7 @@ const ( isLBListenerPolicyRuleProvisioningDone = "done" ) -func resourceIBMISLBListenerPolicyRule() *schema.Resource { +func ResourceIBMISLBListenerPolicyRule() *schema.Resource { return &schema.Resource{ Create: resourceIBMISLBListenerPolicyRuleCreate, Read: resourceIBMISLBListenerPolicyRuleRead, @@ -113,28 +116,28 @@ func resourceIBMISLBListenerPolicyRule() *schema.Resource { isLBListenerPolicyRulecondition: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRulecondition), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRulecondition), Description: "Condition info of the rule.", }, isLBListenerPolicyRuletype: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRuletype), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_listener_policy_rule", isLBListenerPolicyRuletype), Description: "Policy rule type.", }, isLBListenerPolicyRulevalue: { Type: schema.TypeString, Required: true, - ValidateFunc: validateStringLength, + ValidateFunc: validate.ValidateStringLength, Description: "policy rule value info", }, isLBListenerPolicyRulefield: { Type: schema.TypeString, Optional: true, - ValidateFunc: validateStringLength, + ValidateFunc: validate.ValidateStringLength, }, isLBListenerPolicyRuleid: { @@ -147,7 +150,7 @@ func resourceIBMISLBListenerPolicyRule() *schema.Resource { Computed: true, }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the LB resource", @@ -156,27 +159,27 @@ func resourceIBMISLBListenerPolicyRule() *schema.Resource { } } -func resourceIBMISLBListenerPolicyRuleValidator() *ResourceValidator { +func ResourceIBMISLBListenerPolicyRuleValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) condition := "contains, equals, matches_regex" ruletype := "header, hostname, path, body, query" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBListenerPolicyRulecondition, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: condition}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBListenerPolicyRuletype, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: ruletype}) - ibmISLBListenerPolicyRuleResourceValidator := ResourceValidator{ResourceName: "ibm_is_lb_listener_policy_rule", Schema: validateSchema} + ibmISLBListenerPolicyRuleResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_lb_listener_policy_rule", Schema: validateSchema} return &ibmISLBListenerPolicyRuleResourceValidator } @@ -212,7 +215,7 @@ func resourceIBMISLBListenerPolicyRuleCreate(d *schema.ResourceData, meta interf func getLbListenerID(id string) (string, error) { if strings.Contains(id, "/") { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return "", err } @@ -225,7 +228,7 @@ func getLbListenerID(id string) (string, error) { func getLbPolicyID(id string) (string, error) { if strings.Contains(id, "/") { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return "", err } @@ -237,7 +240,7 @@ func getLbPolicyID(id string) (string, error) { } func vpcSdkClient(meta interface{}) (*vpcv1.VpcV1, error) { - sess, err := meta.(ClientSession).VpcV1API() + sess, err := meta.(conns.ClientSession).VpcV1API() return sess, err } @@ -259,8 +262,8 @@ func lbListenerPolicyRuleCreate(d *schema.ResourceData, meta interface{}, lbID, } isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err = isWaitForLoadbalancerAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -270,7 +273,7 @@ func lbListenerPolicyRuleCreate(d *schema.ResourceData, meta interface{}, lbID, rule, response, err := sess.CreateLoadBalancerListenerPolicyRule(options) if err != nil { - return fmt.Errorf("Error while creating lb listener policy for LB %s: Error %v Response %v", lbID, err, *response) + return fmt.Errorf("[ERROR] Error while creating lb listener policy for LB %s: Error %v Response %v", lbID, err, *response) } d.SetId(fmt.Sprintf("%s/%s/%s/%s", lbID, listenerID, policyID, *(rule.ID))) @@ -334,7 +337,7 @@ func isWaitForLbListenerPolicyRuleAvailable(vpc *vpcv1.VpcV1, id string, timeout func isLbListenerPolicyRuleRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return nil, "", err } @@ -368,7 +371,7 @@ func isLbListenerPolicyRuleRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.Sta func resourceIBMISLBListenerPolicyRuleRead(d *schema.ResourceData, meta interface{}) error { ID := d.Id() - parts, err := idParts(ID) + parts, err := flex.IdParts(ID) if err != nil { return err } @@ -400,12 +403,12 @@ func lbListenerPolicyRuleExists(d *schema.ResourceData, meta interface{}, ID str if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 4 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of lbID/listenerID/policyID/ruleID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of lbID/listenerID/policyID/ruleID", d.Id()) } lbID := parts[0] listenerID := parts[1] @@ -426,13 +429,13 @@ func lbListenerPolicyRuleExists(d *schema.ResourceData, meta interface{}, ID str if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting policy: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting policy: %s\n%s", err, response) } return true, nil } func resourceIBMISLBListenerPolicyRuleUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -491,13 +494,13 @@ func lbListenerPolicyRuleUpdate(d *schema.ResourceData, meta interface{}, lbID, if hasChanged { loadBalancerListenerPolicyRulePatch, err := loadBalancerListenerPolicyRulePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerListenerPolicyRulePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerListenerPolicyRulePatch: %s", err) } updatePolicyRuleOptions.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatch isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err = isWaitForLoadbalancerAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -507,7 +510,7 @@ func lbListenerPolicyRuleUpdate(d *schema.ResourceData, meta interface{}, lbID, _, response, err := sess.UpdateLoadBalancerListenerPolicyRule(&updatePolicyRuleOptions) if err != nil { - return fmt.Errorf("Error Updating in policy : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating in policy : %s\n%s", err, response) } _, err = isWaitForLbListenerPolicyRuleAvailable(sess, d.Id(), d.Timeout(schema.TimeoutCreate)) @@ -521,7 +524,7 @@ func lbListenerPolicyRuleUpdate(d *schema.ResourceData, meta interface{}, lbID, func resourceIBMISLBListenerPolicyRuleDelete(d *schema.ResourceData, meta interface{}) error { //Retrieve lbId, listenerId and policyID - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -532,8 +535,8 @@ func resourceIBMISLBListenerPolicyRuleDelete(d *schema.ResourceData, meta interf ruleID := parts[3] isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err = lbListenerPolicyRuleDelete(d, meta, lbID, listenerID, policyID, ruleID) if err != nil { @@ -567,7 +570,7 @@ func lbListenerPolicyRuleDelete(d *schema.ResourceData, meta interface{}, lbID, d.SetId("") return nil } - return fmt.Errorf("Error in LbListenerPolicyGet : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in LbListenerPolicyGet : %s\n%s", err, response) } deleteLbListenerPolicyRuleOptions := &vpcv1.DeleteLoadBalancerListenerPolicyRuleOptions{ @@ -578,7 +581,7 @@ func lbListenerPolicyRuleDelete(d *schema.ResourceData, meta interface{}, lbID, } response, err = sess.DeleteLoadBalancerListenerPolicyRule(deleteLbListenerPolicyRuleOptions) if err != nil { - return fmt.Errorf("Error in lbListenerPolicyRuleDelete: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error in lbListenerPolicyRuleDelete: %s\n%s", err, response) } _, err = isWaitForLbListnerPolicyRuleDeleted(sess, d.Id(), d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -604,7 +607,7 @@ func isLbListenerPolicyRuleDeleteRefreshFunc(vpc *vpcv1.VpcV1, id string) resour return func() (interface{}, string, error) { //Retrieve lbId, listenerId and policyID - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return nil, isLBListenerPolicyFailed, nil } @@ -674,9 +677,9 @@ func lbListenerPolicyRuleGet(d *schema.ResourceData, meta interface{}, lbID, lis } lb, response, err := sess.GetLoadBalancer(getLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } - d.Set(RelatedCRN, *lb.CRN) + d.Set(flex.RelatedCRN, *lb.CRN) return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_pool.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_pool.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_pool.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_pool.go index 2d762312bc..756dfeddc9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_pool.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_pool.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,6 +9,9 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -41,7 +44,7 @@ const ( isLBPool = "pool_id" ) -func resourceIBMISLBPool() *schema.Resource { +func ResourceIBMISLBPool() *schema.Resource { return &schema.Resource{ Create: resourceIBMISLBPoolCreate, Read: resourceIBMISLBPoolRead, @@ -58,7 +61,7 @@ func resourceIBMISLBPool() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceIBMISLBPoolCookieValidate(diff) + return flex.ResourceIBMISLBPoolCookieValidate(diff) }, ), @@ -66,7 +69,7 @@ func resourceIBMISLBPool() *schema.Resource { isLBPoolName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolName), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolName), Description: "Load Balancer Pool name", }, @@ -80,14 +83,14 @@ func resourceIBMISLBPool() *schema.Resource { isLBPoolAlgorithm: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolAlgorithm), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolAlgorithm), Description: "Load Balancer Pool algorithm", }, isLBPoolProtocol: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolProtocol), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolProtocol), Description: "Load Balancer Protocol", }, @@ -112,7 +115,7 @@ func resourceIBMISLBPool() *schema.Resource { isLBPoolHealthType: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolHealthType), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolHealthType), Description: "Load Balancer health type", }, @@ -133,14 +136,14 @@ func resourceIBMISLBPool() *schema.Resource { isLBPoolSessPersistenceType: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolSessPersistenceType), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolSessPersistenceType), Description: "Load Balancer Pool session persisence type.", }, isLBPoolSessPersistenceAppCookieName: { Type: schema.TypeString, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolSessPersistenceAppCookieName), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolSessPersistenceAppCookieName), Description: "Load Balancer Pool session persisence app cookie name.", }, @@ -160,7 +163,7 @@ func resourceIBMISLBPool() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool", isLBPoolProxyProtocol), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool", isLBPoolProxyProtocol), Description: "PROXY protocol setting for this pool", }, @@ -170,7 +173,7 @@ func resourceIBMISLBPool() *schema.Resource { Description: "The LB Pool id", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the LB resource", @@ -179,68 +182,68 @@ func resourceIBMISLBPool() *schema.Resource { } } -func resourceIBMISLBPoolValidator() *ResourceValidator { +func ResourceIBMISLBPoolValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) algorithm := "round_robin, weighted_round_robin, least_connections" protocol := "http, tcp, https" persistanceType := "source_ip, app_cookie, http_cookie" proxyProtocol := "disabled, v1, v2" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolAlgorithm, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: algorithm}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolProtocol, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: protocol}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolHealthType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: protocol}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolProxyProtocol, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: proxyProtocol}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolSessPersistenceAppCookieName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: "^[-A-Za-z0-9!#$%&'*+.^_`~|]+$", MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolSessPersistenceType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: persistanceType}) - ibmISLBPoolResourceValidator := ResourceValidator{ResourceName: "ibm_is_lb_pool", Schema: validateSchema} + ibmISLBPoolResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_lb_pool", Schema: validateSchema} return &ibmISLBPoolResourceValidator } @@ -277,8 +280,8 @@ func resourceIBMISLBPoolCreate(d *schema.ResourceData, meta interface{}) error { healthMonitorPort = int64(hmp.(int)) } isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err := lbPoolCreate(d, meta, name, lbID, algorithm, protocol, healthType, spType, cName, healthMonitorURL, pProtocol, healthDelay, maxRetries, healthTimeOut, healthMonitorPort) if err != nil { @@ -296,8 +299,7 @@ func lbPoolCreate(d *schema.ResourceData, meta interface{}, name, lbID, algorith _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } options := &vpcv1.CreateLoadBalancerPoolOptions{ @@ -339,14 +341,12 @@ func lbPoolCreate(d *schema.ResourceData, meta interface{}, name, lbID, algorith _, err = isWaitForLBPoolActive(sess, lbID, *lbPool.ID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is active: %s", *lbPool.ID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is active: %s", *lbPool.ID, err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } return nil @@ -354,7 +354,7 @@ func lbPoolCreate(d *schema.ResourceData, meta interface{}, name, lbID, algorith func resourceIBMISLBPoolRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -386,7 +386,7 @@ func lbPoolGet(d *schema.ResourceData, meta interface{}, lbID, lbPoolID string) d.SetId("") return nil } - return fmt.Errorf("Error Getting Load Balancer Pool : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer Pool : %s\n%s", err, response) } d.Set(isLBPoolName, *lbPool.Name) d.Set(isLBPool, lbPoolID) @@ -429,15 +429,15 @@ func lbPoolGet(d *schema.ResourceData, meta interface{}, lbID, lbPoolID string) } lb, response, err := sess.GetLoadBalancer(getLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } - d.Set(RelatedCRN, *lb.CRN) + d.Set(flex.RelatedCRN, *lb.CRN) return nil } func resourceIBMISLBPoolUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -526,8 +526,8 @@ func lbPoolUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin loadBalancerPoolPatchModel.Protocol = &protocol isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err := isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutUpdate)) if err != nil { return fmt.Errorf( @@ -542,7 +542,7 @@ func lbPoolUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin LoadBalancerPoolPatch, err := loadBalancerPoolPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerPoolPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerPoolPatch: %s", err) } if sessionPersistenceRemoved { LoadBalancerPoolPatch["session_persistence"] = nil @@ -551,7 +551,7 @@ func lbPoolUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin _, response, err := sess.UpdateLoadBalancerPool(updateLoadBalancerPoolOptions) if err != nil { - return fmt.Errorf("Error Updating Load Balancer Pool : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Load Balancer Pool : %s\n%s", err, response) } _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutUpdate)) @@ -571,7 +571,7 @@ func lbPoolUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin func resourceIBMISLBPoolDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -580,8 +580,8 @@ func resourceIBMISLBPoolDelete(d *schema.ResourceData, meta interface{}) error { lbPoolID := parts[1] isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err = lbPoolDelete(d, meta, lbID, lbPoolID) if err != nil { @@ -606,18 +606,16 @@ func lbPoolDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin d.SetId("") return nil } - return fmt.Errorf("Error Getting vpc load balancer pool(%s): %s\n%s", lbPoolID, err, response) + return fmt.Errorf("[ERROR] Error Getting vpc load balancer pool(%s): %s\n%s", lbPoolID, err, response) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) } deleteLoadBalancerPoolOptions := &vpcv1.DeleteLoadBalancerPoolOptions{ @@ -626,18 +624,16 @@ func lbPoolDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin } response, err = sess.DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions) if err != nil { - return fmt.Errorf("Error Deleting Load Balancer Pool : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Load Balancer Pool : %s\n%s", err, response) } _, err = isWaitForLBPoolDeleted(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is deleted: %s", lbPoolID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is deleted: %s", lbPoolID, err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } d.SetId("") return nil @@ -645,12 +641,12 @@ func lbPoolDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin func resourceIBMISLBPoolExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of lbID/lbPoolID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of lbID/lbPoolID", d.Id()) } lbID := parts[0] @@ -676,7 +672,7 @@ func lbPoolExists(d *schema.ResourceData, meta interface{}, lbID, lbPoolID strin if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Load balancer pool: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Load balancer pool: %s\n%s", err, response) } return true, nil } @@ -705,7 +701,7 @@ func isLBPoolRefreshFunc(sess *vpcv1.VpcV1, lbId, lbPoolId string) resource.Stat } lbPool, response, err := sess.GetLoadBalancerPool(getlbpOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Load Balancer Pool: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Load Balancer Pool: %s\n%s", err, response) } if *lbPool.ProvisioningStatus == isLBPoolActive || *lbPool.ProvisioningStatus == isLBPoolFailed { @@ -743,7 +739,7 @@ func isLBPoolDeleteRefreshFunc(lbc *vpcv1.VpcV1, lbId, lbPoolId string) resource if response != nil && response.StatusCode == 404 { return lbPool, isLBPoolDeleteDone, nil } - return nil, "", fmt.Errorf("The vpc load balancer pool %s failed to delete: %s\n%s", lbPoolId, err, response) + return nil, "", fmt.Errorf("[ERROR] The vpc load balancer pool %s failed to delete: %s\n%s", lbPoolId, err, response) } return lbPool, isLBPoolDeletePending, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_pool_member.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_pool_member.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_pool_member.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_pool_member.go index 2a19d29993..edcdcf4ac2 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_lb_pool_member.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_lb_pool_member.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -9,6 +9,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -29,7 +32,7 @@ const ( isLBPoolUpdating = "updating" ) -func resourceIBMISLBPoolMember() *schema.Resource { +func ResourceIBMISLBPoolMember() *schema.Resource { return &schema.Resource{ Create: resourceIBMISLBPoolMemberCreate, Read: resourceIBMISLBPoolMemberRead, @@ -101,7 +104,7 @@ func resourceIBMISLBPoolMember() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_lb_pool_member", isLBPoolMemberWeight), + ValidateFunc: validate.InvokeValidator("ibm_is_lb_pool_member", isLBPoolMemberWeight), Description: "Load balcner pool member weight", }, @@ -123,7 +126,7 @@ func resourceIBMISLBPoolMember() *schema.Resource { Description: "LB pool member Href value", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the LB resource", @@ -132,19 +135,19 @@ func resourceIBMISLBPoolMember() *schema.Resource { } } -func resourceIBMISLBPoolMemberValidator() *ResourceValidator { +func ResourceIBMISLBPoolMemberValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isLBPoolMemberWeight, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, Optional: true, MinValue: "0", MaxValue: "100"}) - ibmISLBResourceValidator := ResourceValidator{ResourceName: "ibm_is_lb_pool_member", Schema: validateSchema} + ibmISLBResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_lb_pool_member", Schema: validateSchema} return &ibmISLBResourceValidator } @@ -165,8 +168,8 @@ func resourceIBMISLBPoolMemberCreate(d *schema.ResourceData, meta interface{}) e weight = int64(w.(int)) } isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err = lbpMemberCreate(d, meta, lbID, lbPoolID, port64, weight) if err != nil { @@ -183,14 +186,12 @@ func lbpMemberCreate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID st } _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } options := &vpcv1.CreateLoadBalancerPoolMemberOptions{ @@ -229,14 +230,12 @@ func lbpMemberCreate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID st _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutCreate)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } return nil @@ -267,7 +266,7 @@ func isLBPoolMemberRefreshFunc(lbc *vpcv1.VpcV1, lbID, lbPoolID, lbPoolMemID str } lbPoolMem, response, err := lbc.GetLoadBalancerPoolMember(getlbpmoptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Load Balancer Pool Member: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Load Balancer Pool Member: %s\n%s", err, response) } if *lbPoolMem.ProvisioningStatus == isLBPoolMemberActive { @@ -280,7 +279,7 @@ func isLBPoolMemberRefreshFunc(lbc *vpcv1.VpcV1, lbID, lbPoolID, lbPoolMemID str func resourceIBMISLBPoolMemberRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -318,7 +317,7 @@ func lbpmemberGet(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, lbPo d.SetId("") return nil } - return fmt.Errorf("Error Getting Load Balancer Pool Member: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer Pool Member: %s\n%s", err, response) } d.Set(isLBPoolID, lbPoolID) d.Set(isLBID, lbID) @@ -340,15 +339,15 @@ func lbpmemberGet(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, lbPo } lb, response, err := sess.GetLoadBalancer(getLoadBalancerOptions) if err != nil { - return fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } - d.Set(RelatedCRN, *lb.CRN) + d.Set(flex.RelatedCRN, *lb.CRN) return nil } func resourceIBMISLBPoolMemberUpdate(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -377,8 +376,8 @@ func lbpmemberUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l weight := int64(d.Get(isLBPoolMemberWeight).(int)) isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutUpdate)) if err != nil { @@ -424,13 +423,13 @@ func lbpmemberUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l loadBalancerPoolMemberPatch, err := loadBalancerPoolMemberPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for LoadBalancerPoolMemberPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for LoadBalancerPoolMemberPatch: %s", err) } updatelbpmoptions.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatch _, response, err := sess.UpdateLoadBalancerPoolMember(updatelbpmoptions) if err != nil { - return fmt.Errorf("Error Updating Load Balancer Pool Member: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Load Balancer Pool Member: %s\n%s", err, response) } _, err = isWaitForLBPoolMemberAvailable(sess, lbID, lbPoolID, lbPoolMemID, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -454,7 +453,7 @@ func lbpmemberUpdate(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l func resourceIBMISLBPoolMemberDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -464,8 +463,8 @@ func resourceIBMISLBPoolMemberDelete(d *schema.ResourceData, meta interface{}) e lbPoolMemID := parts[2] isLBKey := "load_balancer_key_" + lbID - ibmMutexKV.Lock(isLBKey) - defer ibmMutexKV.Unlock(isLBKey) + conns.IbmMutexKV.Lock(isLBKey) + defer conns.IbmMutexKV.Unlock(isLBKey) err = lbpmemberDelete(d, meta, lbID, lbPoolID, lbPoolMemID) if err != nil { @@ -492,7 +491,7 @@ func lbpmemberDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l d.SetId("") return nil } - return fmt.Errorf("Error Getting Load Balancer Pool Member: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Load Balancer Pool Member: %s\n%s", err, response) } _, err = isWaitForLBPoolMemberAvailable(sess, lbID, lbPoolID, lbPoolMemID, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -501,14 +500,12 @@ func lbpmemberDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } dellbpmoptions := &vpcv1.DeleteLoadBalancerPoolMemberOptions{ @@ -518,7 +515,7 @@ func lbpmemberDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l } response, err = sess.DeleteLoadBalancerPoolMember(dellbpmoptions) if err != nil { - return fmt.Errorf("Error Deleting Load Balancer Pool Member: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Load Balancer Pool Member: %s\n%s", err, response) } _, err = isWaitForLBPoolMemberDeleted(sess, lbID, lbPoolID, lbPoolMemID, d.Timeout(schema.TimeoutDelete)) @@ -528,14 +525,12 @@ func lbpmemberDelete(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l _, err = isWaitForLBPoolActive(sess, lbID, lbPoolID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer pool (%s) is active: %s", lbPoolID, err) } _, err = isWaitForLBAvailable(sess, lbID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for load balancer (%s) is active: %s", lbID, err) + return fmt.Errorf("[ERROR] Error checking for load balancer (%s) is active: %s", lbID, err) } d.SetId("") @@ -570,14 +565,14 @@ func isDeleteLBPoolMemberRefreshFunc(lbc *vpcv1.VpcV1, lbID, lbPoolID, lbPoolMem if response != nil && response.StatusCode == 404 { return lbPoolMem, isLBPoolMemberDeleted, nil } - return nil, "", fmt.Errorf("Error Deleting Load balancer pool member: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Deleting Load balancer pool member: %s\n%s", err, response) } return lbPoolMem, isLBPoolMemberDeletePending, nil } } func resourceIBMISLBPoolMemberExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -611,14 +606,14 @@ func lbpmemberExists(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, l if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Load balancer pool member: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Load balancer pool member: %s\n%s", err, response) } return true, nil } func getPoolId(id string) (string, error) { if strings.Contains(id, "/") { - parts, err := idParts(id) + parts, err := flex.IdParts(id) if err != nil { return "", err } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_network_acl_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_network_acl_rule.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_network_acl_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_network_acl_rule.go index 85f078b359..f39f684351 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_network_acl_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_network_acl_rule.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -11,6 +11,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/IBM/vpc-go-sdk/vpcv1" @@ -23,7 +25,7 @@ const ( isNwACLRuleBefore = "before" ) -func resourceIBMISNetworkACLRule() *schema.Resource { +func ResourceIBMISNetworkACLRule() *schema.Resource { return &schema.Resource{ Create: resourceIBMISNetworkACLRuleCreate, Read: resourceIBMISNetworkACLRuleRead, @@ -38,7 +40,7 @@ func resourceIBMISNetworkACLRule() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -75,14 +77,14 @@ func resourceIBMISNetworkACLRule() *schema.Resource { Optional: true, ForceNew: false, Description: "The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words.", - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleName), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleName), }, isNetworkACLRuleAction: { Type: schema.TypeString, Required: true, ForceNew: false, Description: "Whether to allow or deny matching traffic", - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleAction), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleAction), }, isNetworkACLRuleIPVersion: { Type: schema.TypeString, @@ -94,13 +96,13 @@ func resourceIBMISNetworkACLRule() *schema.Resource { Required: true, ForceNew: false, Description: "The source CIDR block. The CIDR block 0.0.0.0/0 applies to all addresses.", - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSource), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSource), }, isNetworkACLRuleDestination: { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleDestination), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleDestination), Description: "The destination CIDR block. The CIDR block 0.0.0.0/0 applies to all addresses.", }, isNetworkACLRuleDirection: { @@ -108,7 +110,7 @@ func resourceIBMISNetworkACLRule() *schema.Resource { Required: true, ForceNew: false, Description: "Direction of traffic to enforce, either inbound or outbound", - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleDirection), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleDirection), }, isNetworkACLRuleICMP: { Type: schema.TypeList, @@ -122,13 +124,13 @@ func resourceIBMISNetworkACLRule() *schema.Resource { isNetworkACLRuleICMPCode: { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleICMPCode), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleICMPCode), Description: "The ICMP traffic code to allow. Valid values from 0 to 255.", }, isNetworkACLRuleICMPType: { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleICMPType), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleICMPType), Description: "The ICMP traffic type to allow. Valid values from 0 to 254.", }, }, @@ -148,28 +150,28 @@ func resourceIBMISNetworkACLRule() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMax), Description: "The highest port in the range of ports to be matched", }, isNetworkACLRulePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMin), Description: "The lowest port in the range of ports to be matched", }, isNetworkACLRuleSourcePortMax: { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMax), Description: "The highest port in the range of ports to be matched", }, isNetworkACLRuleSourcePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMin), Description: "The lowest port in the range of ports to be matched", }, }, @@ -189,28 +191,28 @@ func resourceIBMISNetworkACLRule() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMax), Description: "The highest port in the range of ports to be matched", }, isNetworkACLRulePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRulePortMin), Description: "The lowest port in the range of ports to be matched", }, isNetworkACLRuleSourcePortMax: { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMax), Description: "The highest port in the range of ports to be matched", }, isNetworkACLRuleSourcePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl_rule", isNetworkACLRuleSourcePortMin), Description: "The lowest port in the range of ports to be matched", }, }, @@ -220,109 +222,109 @@ func resourceIBMISNetworkACLRule() *schema.Resource { } } -func resourceIBMISNetworkACLRuleValidator() *ResourceValidator { +func ResourceIBMISNetworkACLRuleValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) direction := "inbound, outbound" action := "allow, deny" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: action}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleDirection, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: direction}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNwACLID, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleDestination, - ValidateFunctionIdentifier: ValidateIPorCIDR, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateIPorCIDR, + Type: validate.TypeString, Required: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleSource, - ValidateFunctionIdentifier: ValidateIPorCIDR, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateIPorCIDR, + Type: validate.TypeString, Required: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleICMPType, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "254"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleICMPCode, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "255"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRulePortMin, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRulePortMax, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleSourcePortMin, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleSourcePortMax, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISNetworkACLRuleResourceValidator := ResourceValidator{ResourceName: "ibm_is_network_acl_rule", Schema: validateSchema} + ibmISNetworkACLRuleResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_network_acl_rule", Schema: validateSchema} return &ibmISNetworkACLRuleResourceValidator } @@ -441,7 +443,7 @@ func nwaclRuleCreate(d *schema.ResourceData, meta interface{}, nwACLID string) e } nwaclRule, response, err := sess.CreateNetworkACLRule(createNetworkAclRuleOptions) if err != nil || nwaclRule == nil { - return fmt.Errorf("Error Creating network ACL rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating network ACL rule : %s\n%s", err, response) } err = nwaclRuleGet(d, meta, nwACLID, nwaclRule) if err != nil { @@ -469,7 +471,7 @@ func resourceIBMISNetworkACLRuleRead(d *schema.ResourceData, meta interface{}) e d.SetId("") return nil } - return fmt.Errorf("Error getting Network ACL Rule (%s) : %s\n%s", ruleId, err, response) + return fmt.Errorf("[ERROR] Error getting Network ACL Rule (%s) : %s\n%s", ruleId, err, response) } err = nwaclRuleGet(d, meta, nwACLID, nwaclRule) if err != nil { @@ -740,12 +742,12 @@ func nwaclRuleUpdate(d *schema.ResourceData, meta interface{}, id, nwACLId strin if hasChanged { updateNetworkACLOptionsPatch, err := updateNetworkACLOptionsPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for NetworkACLOptionsPatch : %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for NetworkACLOptionsPatch : %s", err) } updateNetworkACLRuleOptions.NetworkACLRulePatch = updateNetworkACLOptionsPatch _, response, err := sess.UpdateNetworkACLRule(updateNetworkACLRuleOptions) if err != nil { - return fmt.Errorf("Error Updating Network ACL Rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Network ACL Rule : %s\n%s", err, response) } } return nil @@ -782,7 +784,7 @@ func nwaclRuleDelete(d *schema.ResourceData, meta interface{}, id, nwACLId strin d.SetId("") return nil } - return fmt.Errorf("Error Getting Network ACL Rule (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Network ACL Rule (%s): %s\n%s", id, err, response) } deleteNetworkAclRuleOptions := &vpcv1.DeleteNetworkACLRuleOptions{ @@ -791,7 +793,7 @@ func nwaclRuleDelete(d *schema.ResourceData, meta interface{}, id, nwACLId strin } response, err = sess.DeleteNetworkACLRule(deleteNetworkAclRuleOptions) if err != nil { - return fmt.Errorf("Error Deleting Network ACL Rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Network ACL Rule : %s\n%s", err, response) } d.SetId("") return nil @@ -811,7 +813,7 @@ func nwaclRuleExists(d *schema.ResourceData, meta interface{}, id, nwACLId strin if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Network ACL Rule: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Network ACL Rule: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_networkacls.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_networkacls.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_networkacls.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_networkacls.go index f5e78e6979..33be8f6df1 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_networkacls.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_networkacls.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -12,6 +12,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/IBM/vpc-go-sdk/vpcv1" @@ -45,7 +47,7 @@ const ( isNetworkACLCRN = "crn" ) -func resourceIBMISNetworkACL() *schema.Resource { +func ResourceIBMISNetworkACL() *schema.Resource { return &schema.Resource{ Create: resourceIBMISNetworkACLCreate, Read: resourceIBMISNetworkACLRead, @@ -61,7 +63,7 @@ func resourceIBMISNetworkACL() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -70,7 +72,7 @@ func resourceIBMISNetworkACL() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLName), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLName), Description: "Network ACL name", }, isNetworkACLVPC: { @@ -90,8 +92,8 @@ func resourceIBMISNetworkACL() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_network_acl", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, @@ -100,24 +102,24 @@ func resourceIBMISNetworkACL() *schema.Resource { Computed: true, Description: "The crn of the resource", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -136,13 +138,13 @@ func resourceIBMISNetworkACL() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleName), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleName), }, isNetworkACLRuleAction: { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleAction), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleAction), }, isNetworkACLRuleIPVersion: { Type: schema.TypeString, @@ -152,20 +154,20 @@ func resourceIBMISNetworkACL() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSource), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSource), }, isNetworkACLRuleDestination: { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleDestination), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleDestination), }, isNetworkACLRuleDirection: { Type: schema.TypeString, Required: true, ForceNew: false, Description: "Direction of traffic to enforce, either inbound or outbound", - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleDirection), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleDirection), }, isNetworkACLSubnets: { Type: schema.TypeInt, @@ -181,12 +183,12 @@ func resourceIBMISNetworkACL() *schema.Resource { isNetworkACLRuleICMPCode: { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleICMPCode), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleICMPCode), }, isNetworkACLRuleICMPType: { Type: schema.TypeInt, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleICMPType), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleICMPType), }, }, }, @@ -203,25 +205,25 @@ func resourceIBMISNetworkACL() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMax), }, isNetworkACLRulePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMin), }, isNetworkACLRuleSourcePortMax: { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMax), }, isNetworkACLRuleSourcePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMin), }, }, }, @@ -238,25 +240,25 @@ func resourceIBMISNetworkACL() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMax), }, isNetworkACLRulePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRulePortMin), }, isNetworkACLRuleSourcePortMax: { Type: schema.TypeInt, Optional: true, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMax), }, isNetworkACLRuleSourcePortMin: { Type: schema.TypeInt, Optional: true, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_network_acl", isNetworkACLRuleSourcePortMin), }, }, }, @@ -268,109 +270,109 @@ func resourceIBMISNetworkACL() *schema.Resource { } } -func resourceIBMISNetworkACLValidator() *ResourceValidator { +func ResourceIBMISNetworkACLValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) direction := "inbound, outbound" action := "allow, deny" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: action}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleDirection, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: direction}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleDestination, - ValidateFunctionIdentifier: ValidateIPorCIDR, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateIPorCIDR, + Type: validate.TypeString, Required: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleSource, - ValidateFunctionIdentifier: ValidateIPorCIDR, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateIPorCIDR, + Type: validate.TypeString, Required: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleICMPType, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "254"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleICMPCode, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "255"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRulePortMin, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRulePortMax, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleSourcePortMin, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isNetworkACLRuleSourcePortMax, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISNetworkACLResourceValidator := ResourceValidator{ResourceName: "ibm_is_network_acl", Schema: validateSchema} + ibmISNetworkACLResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_network_acl", Schema: validateSchema} return &ibmISNetworkACLResourceValidator } @@ -394,7 +396,7 @@ func nwaclCreate(d *schema.ResourceData, meta interface{}, name string) error { if vpcID, ok := d.GetOk(isNetworkACLVPC); ok { vpc = vpcID.(string) } else { - return fmt.Errorf("Required parameter vpc is not set") + return fmt.Errorf("[ERROR] Required parameter vpc is not set") } nwaclTemplate := &vpcv1.NetworkACLPrototype{ @@ -445,7 +447,7 @@ func nwaclCreate(d *schema.ResourceData, meta interface{}, name string) error { v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isNetworkACLTags); ok || v != "" { oldList, newList := d.GetChange(isNetworkACLTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *nwacl.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *nwacl.CRN) if err != nil { log.Printf( "Error on create of resource network acl (%s) tags: %s", d.Id(), err) @@ -477,15 +479,15 @@ func nwaclGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting Network ACL(%s) : %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting Network ACL(%s) : %s\n%s", id, err, response) } d.Set(isNetworkACLName, *nwacl.Name) d.Set(isNetworkACLVPC, *nwacl.VPC.ID) if nwacl.ResourceGroup != nil { d.Set(isNetworkACLResourceGroup, *nwacl.ResourceGroup.ID) - d.Set(ResourceGroupName, *nwacl.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *nwacl.ResourceGroup.Name) } - tags, err := GetTagsUsingCRN(meta, *nwacl.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *nwacl.CRN) if err != nil { log.Printf( "Error on get of resource network acl (%s) tags: %s", d.Id(), err) @@ -573,13 +575,13 @@ func nwaclGet(d *schema.ResourceData, meta interface{}, id string) error { } } d.Set(isNetworkACLRules, rules) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/acl") - d.Set(ResourceName, *nwacl.Name) - // d.Set(ResourceCRN, *nwacl.Crn) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/acl") + d.Set(flex.ResourceName, *nwacl.Name) + // d.Set(flex.ResourceCRN, *nwacl.Crn) return nil } @@ -616,17 +618,17 @@ func nwaclUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasC } networkACLPatch, err := networkACLPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for NetworkACLPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for NetworkACLPatch: %s", err) } updateNetworkACLOptions.NetworkACLPatch = networkACLPatch _, response, err := sess.UpdateNetworkACL(updateNetworkACLOptions) if err != nil { - return fmt.Errorf("Error Updating Network ACL(%s) : %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Updating Network ACL(%s) : %s\n%s", id, err, response) } } if d.HasChange(isNetworkACLTags) { oldList, newList := d.GetChange(isNetworkACLTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, d.Get(isNetworkACLCRN).(string)) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, d.Get(isNetworkACLCRN).(string)) if err != nil { log.Printf( "Error on update of resource network acl (%s) tags: %s", d.Id(), err) @@ -678,7 +680,7 @@ func nwaclDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Network ACL (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Network ACL (%s): %s\n%s", id, err, response) } deleteNetworkAclOptions := &vpcv1.DeleteNetworkACLOptions{ @@ -686,7 +688,7 @@ func nwaclDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteNetworkACL(deleteNetworkAclOptions) if err != nil { - return fmt.Errorf("Error Deleting Network ACL : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Network ACL : %s\n%s", err, response) } d.SetId("") return nil @@ -711,7 +713,7 @@ func nwaclExists(d *schema.ResourceData, meta interface{}, id string) (bool, err if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Network ACL: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Network ACL: %s\n%s", err, response) } return true, nil } @@ -735,9 +737,9 @@ func clearRules(nwaclC *vpcv1.VpcV1, nwaclid string) error { } rawrules, response, err := nwaclC.ListNetworkACLRules(listNetworkAclRulesOptions) if err != nil { - return fmt.Errorf("Error Listing network ACL rules : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Listing network ACL rules : %s\n%s", err, response) } - start = GetNext(rawrules.Next) + start = flex.GetNext(rawrules.Next) allrecs = append(allrecs, rawrules.Rules...) if start == "" { break @@ -762,7 +764,7 @@ func clearRules(nwaclC *vpcv1.VpcV1, nwaclid string) error { response, err := nwaclC.DeleteNetworkACLRule(deleteNetworkAclRuleOptions) if err != nil { - return fmt.Errorf("Error Deleting network ACL rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting network ACL rule : %s\n%s", err, response) } } return nil @@ -773,7 +775,7 @@ func validateInlineRules(rules []interface{}) error { rulex := rule.(map[string]interface{}) action := rulex[isNetworkACLRuleAction].(string) if (action != "allow") && (action != "deny") { - return fmt.Errorf("Invalid action. valid values are allow|deny") + return fmt.Errorf("[ERROR] Invalid action. valid values are allow|deny") } direction := rulex[isNetworkACLRuleDirection].(string) @@ -892,7 +894,7 @@ func createInlineRules(nwaclC *vpcv1.VpcV1, nwaclid string, rules []interface{}) } _, response, err := nwaclC.CreateNetworkACLRule(createNetworkAclRuleOptions) if err != nil { - return fmt.Errorf("Error Creating network ACL rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Creating network ACL rule : %s\n%s", err, response) } } return nil diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_placement_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_placement_group.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_placement_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_placement_group.go index cc04a7b338..73be5d2e19 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_placement_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_placement_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,6 +9,9 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -32,7 +35,7 @@ const ( isPlacementGroupAccessTags = "access_tags" ) -func resourceIbmIsPlacementGroup() *schema.Resource { +func ResourceIbmIsPlacementGroup() *schema.Resource { return &schema.Resource{ CreateContext: resourceIbmIsPlacementGroupCreate, ReadContext: resourceIbmIsPlacementGroupRead, @@ -47,7 +50,7 @@ func resourceIbmIsPlacementGroup() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), Schema: map[string]*schema.Schema{ @@ -55,13 +58,13 @@ func resourceIbmIsPlacementGroup() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_placement_group", "strategy"), + ValidateFunc: validate.InvokeValidator("ibm_is_placement_group", "strategy"), Description: "The strategy for this placement group- `host_spread`: place on different compute hosts- `power_spread`: place on compute hosts that use different power sourcesThe enumerated values for this property may expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the unexpected strategy was encountered.", }, "name": { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_placement_group", "name"), + ValidateFunc: validate.InvokeValidator("ibm_is_placement_group", "name"), Description: "The unique user-defined name for this placement group. If unspecified, the name will be a hyphenated list of randomly-selected words.", }, "resource_group": { @@ -75,16 +78,16 @@ func resourceIbmIsPlacementGroup() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_placement_group", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_placement_group", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, isPlacementGroupAccessTags: { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_placement_group", "accesstag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_placement_group", "accesstag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of access management tags", }, "created_at": { @@ -116,38 +119,38 @@ func resourceIbmIsPlacementGroup() *schema.Resource { } } -func resourceIbmIsPlacementGroupValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 1) +func ResourceIbmIsPlacementGroupValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 1) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "strategy", - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "host_spread, power_spread", }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "name", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128, }, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "accesstag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([ ]*[A-Za-z0-9:_.-]+[ ]*)+$`, MinValueLength: 1, @@ -155,12 +158,12 @@ func resourceIbmIsPlacementGroupValidator() *ResourceValidator { }, ) - resourceValidator := ResourceValidator{ResourceName: "ibm_is_placement_group", Schema: validateSchema} + resourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_placement_group", Schema: validateSchema} return &resourceValidator } func resourceIbmIsPlacementGroupCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -192,7 +195,7 @@ func resourceIbmIsPlacementGroupCreate(context context.Context, d *schema.Resour } if _, ok := d.GetOk(isPlacementGroupTags); ok { oldList, newList := d.GetChange(isPlacementGroupTags) - err = UpdateGlobalTagsUsingCRN(oldList, newList, meta, *placementGroup.CRN, "", isUserTagType) + err = flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, *placementGroup.CRN, "", isUserTagType) if err != nil { log.Printf( "Error creating placement group (%s) tags: %s", d.Id(), err) @@ -202,7 +205,7 @@ func resourceIbmIsPlacementGroupCreate(context context.Context, d *schema.Resour if _, ok := d.GetOk(isPlacementGroupAccessTags); ok { oldList, newList := d.GetChange(isPlacementGroupAccessTags) - err = UpdateGlobalTagsUsingCRN(oldList, newList, meta, *placementGroup.CRN, "", isAccessTagType) + err = flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, *placementGroup.CRN, "", isAccessTagType) if err != nil { log.Printf( "Error creating placement group (%s) access tags: %s", d.Id(), err) @@ -213,7 +216,7 @@ func resourceIbmIsPlacementGroupCreate(context context.Context, d *schema.Resour } func resourceIbmIsPlacementGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -233,38 +236,38 @@ func resourceIbmIsPlacementGroupRead(context context.Context, d *schema.Resource } if err = d.Set("strategy", placementGroup.Strategy); err != nil { - return diag.FromErr(fmt.Errorf("Error setting strategy: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting strategy: %s", err)) } if err = d.Set("name", placementGroup.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting name: %s", err)) } if placementGroup.ResourceGroup != nil { if err = d.Set("resource_group", *placementGroup.ResourceGroup.ID); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_group: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_group: %s", err)) } } if err = d.Set("created_at", placementGroup.CreatedAt.String()); err != nil { - return diag.FromErr(fmt.Errorf("Error setting created_at: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting created_at: %s", err)) } if err = d.Set("crn", placementGroup.CRN); err != nil { - return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting crn: %s", err)) } if err = d.Set("href", placementGroup.Href); err != nil { - return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting href: %s", err)) } if err = d.Set("lifecycle_state", placementGroup.LifecycleState); err != nil { - return diag.FromErr(fmt.Errorf("Error setting lifecycle_state: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting lifecycle_state: %s", err)) } if err = d.Set("resource_type", placementGroup.ResourceType); err != nil { - return diag.FromErr(fmt.Errorf("Error setting resource_type: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error setting resource_type: %s", err)) } - tags, err := GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isUserTagType) + tags, err := flex.GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isUserTagType) if err != nil { log.Printf( "Error getting placement group (%s) tags: %s", d.Id(), err) } - accesstags, err := GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isAccessTagType) + accesstags, err := flex.GetGlobalTagsUsingCRN(meta, *placementGroup.CRN, "", isAccessTagType) if err != nil { log.Printf( "Error getting placement group (%s) access tags: %s", d.Id(), err) @@ -276,7 +279,7 @@ func resourceIbmIsPlacementGroupRead(context context.Context, d *schema.Resource } func resourceIbmIsPlacementGroupUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -308,7 +311,7 @@ func resourceIbmIsPlacementGroupUpdate(context context.Context, d *schema.Resour } if d.HasChange(isPlacementGroupTags) { oldList, newList := d.GetChange(isPlacementGroupTags) - err := UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get("crn").(string), "", isUserTagType) + err := flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get("crn").(string), "", isUserTagType) if err != nil { log.Printf( "Error on update of resource subnet (%s) tags: %s", d.Id(), err) @@ -317,7 +320,7 @@ func resourceIbmIsPlacementGroupUpdate(context context.Context, d *schema.Resour if d.HasChange(isPlacementGroupAccessTags) { oldList, newList := d.GetChange(isPlacementGroupAccessTags) - err := UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get("crn").(string), "", isAccessTagType) + err := flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get("crn").(string), "", isAccessTagType) if err != nil { log.Printf( "Error on update of resource subnet (%s) access tags: %s", d.Id(), err) @@ -327,7 +330,7 @@ func resourceIbmIsPlacementGroupUpdate(context context.Context, d *schema.Resour } func resourceIbmIsPlacementGroupDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - vpcClient, err := meta.(ClientSession).VpcV1API() + vpcClient, err := meta.(conns.ClientSession).VpcV1API() if err != nil { return diag.FromErr(err) } @@ -341,10 +344,10 @@ func resourceIbmIsPlacementGroupDelete(context context.Context, d *schema.Resour if response.StatusCode == 409 { _, err = isWaitForPlacementGroupDeleteRetry(vpcClient, d, d.Id()) if err != nil { - return diag.FromErr(fmt.Errorf("Error deleting PLacementGroup: %s", err)) + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting PLacementGroup: %s", err)) } } else { - return diag.FromErr(fmt.Errorf("Error deleting PLacementGroup: %s\n%s", err, response)) + return diag.FromErr(fmt.Errorf("[ERROR] Error deleting PLacementGroup: %s\n%s", err, response)) } } _, err = isWaitForPlacementGroupDelete(vpcClient, d, d.Id()) @@ -371,12 +374,12 @@ func isWaitForPlacementGroupDelete(vpcClient *vpcv1.VpcV1, d *schema.ResourceDat if response != nil && response.StatusCode == 404 { return placementGroup, isPlacementGroupDeleteDone, nil } else if response != nil && response.StatusCode == 409 { - return placementGroup, *placementGroup.LifecycleState, fmt.Errorf("The PLacementGroup %s failed to delete: %v", id, err) + return placementGroup, *placementGroup.LifecycleState, fmt.Errorf("[ERROR] The PLacementGroup %s failed to delete: %v", id, err) } - return nil, "", fmt.Errorf("Error Getting PLacementGroup: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting PLacementGroup: %s\n%s", err, response) } if *placementGroup.LifecycleState == isPlacementGroupFailed { - return placementGroup, *placementGroup.LifecycleState, fmt.Errorf("The PLacementGroup %s failed to delete: %v", id, err) + return placementGroup, *placementGroup.LifecycleState, fmt.Errorf("[ERROR] The PLacementGroup %s failed to delete: %v", id, err) } return placementGroup, isPlacementGroupDeleting, nil }, @@ -405,7 +408,7 @@ func isWaitForPlacementGroupDeleteRetry(vpcClient *vpcv1.VpcV1, d *schema.Resour } else if response != nil && response.StatusCode == 404 { return response, isPlacementGroupDeleteDone, nil } - return response, "", fmt.Errorf("Error deleting PLacementGroup: %s\n%s", err, response) + return response, "", fmt.Errorf("[ERROR] Error deleting PLacementGroup: %s\n%s", err, response) } return response, isPlacementGroupDeleting, nil }, @@ -439,7 +442,7 @@ func isPlacementGroupRefreshFunc(vpcClient *vpcv1.VpcV1, id string, d *schema.Re } placementGroup, response, err := vpcClient.GetPlacementGroup(getinsOptions) if placementGroup == nil || err != nil { - return nil, "", fmt.Errorf("Error getting placementGroup : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error getting placementGroup : %s\n%s", err, response) } d.Set("lifecycle_state", *placementGroup.LifecycleState) diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_public_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_public_gateway.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_public_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_public_gateway.go index 1e8f72850d..b6d2d55473 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_public_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_public_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -33,7 +35,7 @@ const ( isPublicGatewayResourceGroup = "resource_group" ) -func resourceIBMISPublicGateway() *schema.Resource { +func ResourceIBMISPublicGateway() *schema.Resource { return &schema.Resource{ Create: resourceIBMISPublicGatewayCreate, Read: resourceIBMISPublicGatewayRead, @@ -49,7 +51,7 @@ func resourceIBMISPublicGateway() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -58,7 +60,7 @@ func resourceIBMISPublicGateway() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_public_gateway", isPublicGatewayName), + ValidateFunc: validate.InvokeValidator("ibm_is_public_gateway", isPublicGatewayName), Description: "Name of the Public gateway instance", }, @@ -66,7 +68,7 @@ func resourceIBMISPublicGateway() *schema.Resource { Type: schema.TypeMap, Optional: true, Computed: true, - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, }, isPublicGatewayStatus: { @@ -101,24 +103,24 @@ func resourceIBMISPublicGateway() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_public_gateway", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_public_gateway", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Service tags for the public gateway instance", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -129,13 +131,13 @@ func resourceIBMISPublicGateway() *schema.Resource { Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -144,30 +146,30 @@ func resourceIBMISPublicGateway() *schema.Resource { } } -func resourceIBMISPublicGatewayValidator() *ResourceValidator { +func ResourceIBMISPublicGatewayValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isPublicGatewayName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISPublicGatewayResourceValidator := ResourceValidator{ResourceName: "ibm_is_public_gateway", Schema: validateSchema} + ibmISPublicGatewayResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_public_gateway", Schema: validateSchema} return &ibmISPublicGatewayResourceValidator } @@ -214,7 +216,7 @@ func resourceIBMISPublicGatewayCreate(d *schema.ResourceData, meta interface{}) publicgw, response, err := sess.CreatePublicGateway(options) if err != nil { - return fmt.Errorf("Error while creating Public Gateway %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Public Gateway %s\n%s", err, response) } d.SetId(*publicgw.ID) log.Printf("[INFO] PublicGateway : %s", *publicgw.ID) @@ -227,7 +229,7 @@ func resourceIBMISPublicGatewayCreate(d *schema.ResourceData, meta interface{}) v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isPublicGatewayTags); ok || v != "" { oldList, newList := d.GetChange(isPublicGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *publicgw.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *publicgw.CRN) if err != nil { log.Printf( "Error on create of vpc public gateway (%s) tags: %s", d.Id(), err) @@ -258,7 +260,7 @@ func isPublicGatewayRefreshFunc(publicgwC *vpcv1.VpcV1, id string) resource.Stat } publicgw, response, err := publicgwC.GetPublicGateway(getPublicGatewayOptions) if err != nil { - return nil, "", fmt.Errorf("Error getting Public Gateway : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error getting Public Gateway : %s\n%s", err, response) } if *publicgw.Status == isPublicGatewayProvisioningDone { @@ -284,7 +286,7 @@ func resourceIBMISPublicGatewayRead(d *schema.ResourceData, meta interface{}) er d.SetId("") return nil } - return fmt.Errorf("Error getting Public Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Public Gateway : %s\n%s", err, response) } d.Set(isPublicGatewayName, *publicgw.Name) if publicgw.FloatingIP != nil { @@ -298,24 +300,24 @@ func resourceIBMISPublicGatewayRead(d *schema.ResourceData, meta interface{}) er d.Set(isPublicGatewayStatus, *publicgw.Status) d.Set(isPublicGatewayZone, *publicgw.Zone.Name) d.Set(isPublicGatewayVPC, *publicgw.VPC.ID) - tags, err := GetTagsUsingCRN(meta, *publicgw.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *publicgw.CRN) if err != nil { log.Printf( "Error on get of vpc public gateway (%s) tags: %s", id, err) } d.Set(isPublicGatewayTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/publicGateways") - d.Set(ResourceName, *publicgw.Name) - d.Set(ResourceCRN, *publicgw.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/publicGateways") + d.Set(flex.ResourceName, *publicgw.Name) + d.Set(flex.ResourceCRN, *publicgw.CRN) d.Set(isPublicGatewayCRN, *publicgw.CRN) - d.Set(ResourceStatus, *publicgw.Status) + d.Set(flex.ResourceStatus, *publicgw.Status) if publicgw.ResourceGroup != nil { d.Set(isPublicGatewayResourceGroup, *publicgw.ResourceGroup.ID) - d.Set(ResourceGroupName, *publicgw.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *publicgw.ResourceGroup.Name) } return nil } @@ -340,10 +342,10 @@ func resourceIBMISPublicGatewayUpdate(d *schema.ResourceData, meta interface{}) } publicgw, response, err := sess.GetPublicGateway(getPublicGatewayOptions) if err != nil { - return fmt.Errorf("Error getting Public Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Public Gateway : %s\n%s", err, response) } oldList, newList := d.GetChange(isPublicGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *publicgw.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *publicgw.CRN) if err != nil { log.Printf( "Error on update of resource Public Gateway (%s) tags: %s", id, err) @@ -358,12 +360,12 @@ func resourceIBMISPublicGatewayUpdate(d *schema.ResourceData, meta interface{}) } PublicGatewayPatch, err := PublicGatewayPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for PublicGatewayPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for PublicGatewayPatch: %s", err) } updatePublicGatewayOptions.PublicGatewayPatch = PublicGatewayPatch _, response, err := sess.UpdatePublicGateway(updatePublicGatewayOptions) if err != nil { - return fmt.Errorf("Error Updating Public Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Public Gateway : %s\n%s", err, response) } } return resourceIBMISPublicGatewayRead(d, meta) @@ -385,7 +387,7 @@ func resourceIBMISPublicGatewayDelete(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error Getting Public Gateway (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Public Gateway (%s): %s\n%s", id, err, response) } deletePublicGatewayOptions := &vpcv1.DeletePublicGatewayOptions{ @@ -393,7 +395,7 @@ func resourceIBMISPublicGatewayDelete(d *schema.ResourceData, meta interface{}) } response, err = sess.DeletePublicGateway(deletePublicGatewayOptions) if err != nil { - return fmt.Errorf("Error Deleting Public Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Public Gateway : %s\n%s", err, response) } _, err = isWaitForPublicGatewayDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -429,7 +431,7 @@ func isPublicGatewayDeleteRefreshFunc(pg *vpcv1.VpcV1, id string) resource.State if response != nil && response.StatusCode == 404 { return pgw, isPublicGatewayDeleted, nil } - return nil, "", fmt.Errorf("The Public Gateway %s failed to delete: %s\n%s", id, err, response) + return nil, "", fmt.Errorf("[ERROR] The Public Gateway %s failed to delete: %s\n%s", id, err, response) } return pgw, isPublicGatewayDeleting, nil } @@ -449,7 +451,7 @@ func resourceIBMISPublicGatewayExists(d *schema.ResourceData, meta interface{}) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Public Gateway: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Public Gateway: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group.go index 5ba5ad27fb..8692b5de33 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "reflect" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -24,7 +26,7 @@ const ( isSecurityGroupCRN = "crn" ) -func resourceIBMISSecurityGroup() *schema.Resource { +func ResourceIBMISSecurityGroup() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSecurityGroupCreate, @@ -36,7 +38,7 @@ func resourceIBMISSecurityGroup() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -47,7 +49,7 @@ func resourceIBMISSecurityGroup() *schema.Resource { Optional: true, Computed: true, Description: "Security group name", - ValidateFunc: InvokeValidator("ibm_is_security_group", isSecurityGroupName), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group", isSecurityGroupName), }, isSecurityGroupVPC: { Type: schema.TypeString, @@ -60,8 +62,8 @@ func resourceIBMISSecurityGroup() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_security_group", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_security_group", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, @@ -88,25 +90,25 @@ func resourceIBMISSecurityGroup() *schema.Resource { Description: "Resource Group ID", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -115,30 +117,30 @@ func resourceIBMISSecurityGroup() *schema.Resource { } } -func resourceIBMISSecurityGroupValidator() *ResourceValidator { +func ResourceIBMISSecurityGroupValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISSecurityGroupResourceValidator := ResourceValidator{ResourceName: "ibm_is_security_group", Schema: validateSchema} + ibmISSecurityGroupResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_security_group", Schema: validateSchema} return &ibmISSecurityGroupResourceValidator } @@ -167,13 +169,13 @@ func resourceIBMISSecurityGroupCreate(d *schema.ResourceData, meta interface{}) } sg, response, err := sess.CreateSecurityGroup(createSecurityGroupOptions) if err != nil { - return fmt.Errorf("Error while creating Security Group %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Security Group %s\n%s", err, response) } d.SetId(*sg.ID) v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isSecurityGroupTags); ok || v != "" { oldList, newList := d.GetChange(isSecurityGroupTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *sg.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *sg.CRN) if err != nil { log.Printf( "Error while creating Security Group tags : %s\n%s", *sg.ID, err) @@ -198,9 +200,9 @@ func resourceIBMISSecurityGroupRead(d *schema.ResourceData, meta interface{}) er d.SetId("") return nil } - return fmt.Errorf("Error getting Security Group : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Security Group : %s\n%s", err, response) } - tags, err := GetTagsUsingCRN(meta, *group.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *group.CRN) if err != nil { log.Printf( "Error getting Security Group tags : %s\n%s", d.Id(), err) @@ -301,15 +303,15 @@ func resourceIBMISSecurityGroupRead(d *schema.ResourceData, meta interface{}) er d.SetId(*group.ID) if group.ResourceGroup != nil { d.Set(isSecurityGroupResourceGroup, group.ResourceGroup.ID) - d.Set(ResourceGroupName, group.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, group.ResourceGroup.Name) } - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/securityGroups") - d.Set(ResourceName, *group.Name) - d.Set(ResourceCRN, *group.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/securityGroups") + d.Set(flex.ResourceName, *group.Name) + d.Set(flex.ResourceCRN, *group.CRN) return nil } @@ -324,7 +326,7 @@ func resourceIBMISSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) if d.HasChange(isSecurityGroupTags) { oldList, newList := d.GetChange(isSecurityGroupTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, d.Get(isSecurityGroupCRN).(string)) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, d.Get(isSecurityGroupCRN).(string)) if err != nil { log.Printf( "Error Updating Security Group tags: %s\n%s", d.Id(), err) @@ -347,12 +349,12 @@ func resourceIBMISSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) } securityGroupPatch, err := securityGroupPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for SecurityGroupPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for SecurityGroupPatch: %s", err) } updateSecurityGroupOptions.SecurityGroupPatch = securityGroupPatch _, response, err := sess.UpdateSecurityGroup(updateSecurityGroupOptions) if err != nil { - return fmt.Errorf("Error Updating Security Group : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Security Group : %s\n%s", err, response) } } return resourceIBMISSecurityGroupRead(d, meta) @@ -374,7 +376,7 @@ func resourceIBMISSecurityGroupDelete(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error Getting Security Group (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group (%s): %s\n%s", id, err, response) } start := "" @@ -385,13 +387,13 @@ func resourceIBMISSecurityGroupDelete(d *schema.ResourceData, meta interface{}) groups, response, err := sess.ListSecurityGroupTargets(listSecurityGroupTargetsOptions) if err != nil || groups == nil { - return fmt.Errorf("Error Getting Security Group Targets %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group Targets %s\n%s", err, response) } if *groups.TotalCount == int64(0) { break } - start = GetNext(groups.Next) + start = flex.GetNext(groups.Next) allrecs = append(allrecs, groups.Targets...) if start == "" { @@ -408,7 +410,7 @@ func resourceIBMISSecurityGroupDelete(d *schema.ResourceData, meta interface{}) deleteSecurityGroupTargetBindingOptions := sess.NewDeleteSecurityGroupTargetBindingOptions(id, *securityGroupTargetReference.ID) response, err = sess.DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions) if err != nil { - return fmt.Errorf("Error Deleting Security Group Targets : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Security Group Targets : %s\n%s", err, response) } } @@ -420,7 +422,7 @@ func resourceIBMISSecurityGroupDelete(d *schema.ResourceData, meta interface{}) } response, err = sess.DeleteSecurityGroup(deleteSecurityGroupOptions) if err != nil { - return fmt.Errorf("Error Deleting Security Group : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Security Group : %s\n%s", err, response) } d.SetId("") return nil @@ -441,7 +443,7 @@ func resourceIBMISSecurityGroupExists(d *schema.ResourceData, meta interface{}) if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Security Group: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Security Group: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_network_interface_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_network_interface_attachment.go similarity index 88% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_network_interface_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_network_interface_attachment.go index a5025d36a3..0878e27258 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_network_interface_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_network_interface_attachment.go @@ -1,12 +1,13 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -32,7 +33,7 @@ const ( isSGNICAFloatingIpCRN = "crn" ) -func resourceIBMISSecurityGroupNetworkInterfaceAttachment() *schema.Resource { +func ResourceIBMISSecurityGroupNetworkInterfaceAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSecurityGroupNetworkInterfaceAttachmentCreate, Read: resourceIBMISSecurityGroupNetworkInterfaceAttachmentRead, @@ -144,7 +145,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachment() *schema.Resource { }, }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the Security Group", @@ -167,7 +168,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentCreate(d *schema.Resour } _, response, err := sess.CreateSecurityGroupTargetBinding(options) if err != nil { - return fmt.Errorf("Error while creating SecurityGroup NetworkInterface Binding %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating SecurityGroup NetworkInterface Binding %s\n%s", err, response) } d.SetId(fmt.Sprintf("%s/%s", sgID, nicID)) return resourceIBMISSecurityGroupNetworkInterfaceAttachmentRead(d, meta) @@ -179,7 +180,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentRead(d *schema.Resource if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -196,7 +197,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentRead(d *schema.Resource d.SetId("") return nil } - return fmt.Errorf("Error getting target(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) + return fmt.Errorf("[ERROR] Error getting target(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) } instance_id := strings.Split(*secGroupTarget.(*vpcv1.SecurityGroupTargetReference).Href, "/")[5] net_interf_id := *secGroupTarget.(*vpcv1.SecurityGroupTargetReference).ID @@ -206,7 +207,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentRead(d *schema.Resource } instanceNic, response, err := sess.GetInstanceNetworkInterface(getnicoptions) if err != nil { - return fmt.Errorf("Error getting network interfaces attached to the instance %s %s\n%s", instance_id, err, response) + return fmt.Errorf("[ERROR] Error getting network interfaces attached to the instance %s %s\n%s", instance_id, err, response) } d.Set(isSGNICAGroupId, sgID) d.Set(isSGNICANicId, nicID) @@ -245,9 +246,9 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentRead(d *schema.Resource } sg, response, err := sess.GetSecurityGroup(getSecurityGroupOptions) if err != nil { - return fmt.Errorf("Error Getting Security Group : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group : %s\n%s", err, response) } - d.Set(RelatedCRN, *sg.CRN) + d.Set(flex.RelatedCRN, *sg.CRN) return nil } @@ -256,7 +257,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentDelete(d *schema.Resour if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -274,7 +275,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentDelete(d *schema.Resour d.SetId("") return nil } - return fmt.Errorf("Error getting NetworkInterface(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) + return fmt.Errorf("[ERROR] Error getting NetworkInterface(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) } removeSecurityGroupNetworkInterfaceOptions := &vpcv1.DeleteSecurityGroupTargetBindingOptions{ @@ -283,7 +284,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentDelete(d *schema.Resour } response, err = sess.DeleteSecurityGroupTargetBinding(removeSecurityGroupNetworkInterfaceOptions) if err != nil { - return fmt.Errorf("Error Deleting NetworkInterface(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) + return fmt.Errorf("[ERROR] Error Deleting NetworkInterface(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) } d.SetId("") return nil @@ -294,12 +295,12 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentExists(d *schema.Resour if err != nil { return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of sgID/nicID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of sgID/nicID", d.Id()) } sgID := parts[0] nicID := parts[1] @@ -312,7 +313,7 @@ func resourceIBMISSecurityGroupNetworkInterfaceAttachmentExists(d *schema.Resour if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting NetworkInterface(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) + return false, fmt.Errorf("[ERROR] Error getting NetworkInterface(%s) for the SecurityGroup (%s) : %s\n%s", nicID, sgID, err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_rule.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_rule.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_rule.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_rule.go index fd7fa31a16..fbcf1dd5b7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_rule.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_rule.go @@ -1,13 +1,16 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "reflect" "strings" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -29,7 +32,7 @@ const ( isSecurityGroupRuleID = "rule_id" ) -func resourceIBMISSecurityGroupRule() *schema.Resource { +func ResourceIBMISSecurityGroupRule() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSecurityGroupRuleCreate, @@ -58,7 +61,7 @@ func resourceIBMISSecurityGroupRule() *schema.Resource { Type: schema.TypeString, Required: true, Description: "Direction of traffic to enforce, either inbound or outbound", - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleDirection), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleDirection), }, isSecurityGroupRuleIPVersion: { @@ -66,7 +69,7 @@ func resourceIBMISSecurityGroupRule() *schema.Resource { Optional: true, Description: "IP version: ipv4", Default: isSecurityGroupRuleIPVersionDefault, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleIPVersion), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleIPVersion), }, isSecurityGroupRuleRemote: { @@ -90,13 +93,13 @@ func resourceIBMISSecurityGroupRule() *schema.Resource { Type: schema.TypeInt, Optional: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleType), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleType), }, isSecurityGroupRuleCode: { Type: schema.TypeInt, Optional: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleCode), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRuleCode), }, }, }, @@ -117,14 +120,14 @@ func resourceIBMISSecurityGroupRule() *schema.Resource { Optional: true, ForceNew: false, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMin), }, isSecurityGroupRulePortMax: { Type: schema.TypeInt, Optional: true, ForceNew: false, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMax), }, }, }, @@ -145,20 +148,20 @@ func resourceIBMISSecurityGroupRule() *schema.Resource { Optional: true, ForceNew: false, Default: 1, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMin), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMin), }, isSecurityGroupRulePortMax: { Type: schema.TypeInt, Optional: true, ForceNew: false, Default: 65535, - ValidateFunc: InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMax), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_rule", isSecurityGroupRulePortMax), }, }, }, }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the Security Group", @@ -172,55 +175,55 @@ func resourceIBMISSecurityGroupRule() *schema.Resource { } } -func resourceIBMISSecurityGroupRuleValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMISSecurityGroupRuleValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) direction := "inbound, outbound" ip_version := "ipv4" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupRuleDirection, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: direction}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupRuleIPVersion, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: ip_version}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupRuleType, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "254"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupRuleCode, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "0", MaxValue: "255"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupRulePortMin, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupRulePortMax, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "65535"}) - ibmISSecurityGroupRuleResourceValidator := ResourceValidator{ResourceName: "ibm_is_security_group_rule", Schema: validateSchema} + ibmISSecurityGroupRuleResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_security_group_rule", Schema: validateSchema} return &ibmISSecurityGroupRuleResourceValidator } @@ -235,8 +238,8 @@ func resourceIBMISSecurityGroupRuleCreate(d *schema.ResourceData, meta interface return err } isSecurityGroupRuleKey := "security_group_rule_key_" + parsed.secgrpID - ibmMutexKV.Lock(isSecurityGroupRuleKey) - defer ibmMutexKV.Unlock(isSecurityGroupRuleKey) + conns.IbmMutexKV.Lock(isSecurityGroupRuleKey) + defer conns.IbmMutexKV.Unlock(isSecurityGroupRuleKey) options := &vpcv1.CreateSecurityGroupRuleOptions{ SecurityGroupID: &parsed.secgrpID, @@ -245,7 +248,7 @@ func resourceIBMISSecurityGroupRuleCreate(d *schema.ResourceData, meta interface rule, response, err := sess.CreateSecurityGroupRule(options) if err != nil { - return fmt.Errorf("Error while creating Security Group Rule %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Security Group Rule %s\n%s", err, response) } switch reflect.TypeOf(rule).String() { case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": @@ -293,7 +296,7 @@ func resourceIBMISSecurityGroupRuleRead(d *schema.ResourceData, meta interface{} d.SetId("") return nil } - return fmt.Errorf("Error Getting Security Group Rule (%s): %s\n%s", ruleID, err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group Rule (%s): %s\n%s", ruleID, err, response) } d.Set(isSecurityGroupID, secgrpID) getSecurityGroupOptions := &vpcv1.GetSecurityGroupOptions{ @@ -301,9 +304,9 @@ func resourceIBMISSecurityGroupRuleRead(d *schema.ResourceData, meta interface{} } sg, response, err := sess.GetSecurityGroup(getSecurityGroupOptions) if err != nil { - return fmt.Errorf("Error Getting Security Group : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group : %s\n%s", err, response) } - d.Set(RelatedCRN, *sg.CRN) + d.Set(flex.RelatedCRN, *sg.CRN) switch reflect.TypeOf(sgrule).String() { case "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp": { @@ -412,13 +415,13 @@ func resourceIBMISSecurityGroupRuleUpdate(d *schema.ResourceData, meta interface return err } isSecurityGroupRuleKey := "security_group_rule_key_" + parsed.secgrpID - ibmMutexKV.Lock(isSecurityGroupRuleKey) - defer ibmMutexKV.Unlock(isSecurityGroupRuleKey) + conns.IbmMutexKV.Lock(isSecurityGroupRuleKey) + defer conns.IbmMutexKV.Unlock(isSecurityGroupRuleKey) updateSecurityGroupRuleOptions := sgTemplate _, response, err := sess.UpdateSecurityGroupRule(updateSecurityGroupRuleOptions) if err != nil { - return fmt.Errorf("Error Updating Security Group Rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Security Group Rule : %s\n%s", err, response) } return resourceIBMISSecurityGroupRuleRead(d, meta) } @@ -434,8 +437,8 @@ func resourceIBMISSecurityGroupRuleDelete(d *schema.ResourceData, meta interface } isSecurityGroupRuleKey := "security_group_rule_key_" + secgrpID - ibmMutexKV.Lock(isSecurityGroupRuleKey) - defer ibmMutexKV.Unlock(isSecurityGroupRuleKey) + conns.IbmMutexKV.Lock(isSecurityGroupRuleKey) + defer conns.IbmMutexKV.Unlock(isSecurityGroupRuleKey) getSecurityGroupRuleOptions := &vpcv1.GetSecurityGroupRuleOptions{ SecurityGroupID: &secgrpID, @@ -448,7 +451,7 @@ func resourceIBMISSecurityGroupRuleDelete(d *schema.ResourceData, meta interface d.SetId("") return nil } - return fmt.Errorf("Error Getting Security Group Rule (%s): %s\n%s", ruleID, err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group Rule (%s): %s\n%s", ruleID, err, response) } deleteSecurityGroupRuleOptions := &vpcv1.DeleteSecurityGroupRuleOptions{ @@ -457,7 +460,7 @@ func resourceIBMISSecurityGroupRuleDelete(d *schema.ResourceData, meta interface } response, err = sess.DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions) if err != nil { - return fmt.Errorf("Error Deleting Security Group Rule : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Security Group Rule : %s\n%s", err, response) } d.SetId("") return nil @@ -482,7 +485,7 @@ func resourceIBMISSecurityGroupRuleExists(d *schema.ResourceData, meta interface if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Security Group Rule (%s): %s\n%s", ruleID, err, response) + return false, fmt.Errorf("[ERROR] Error getting Security Group Rule (%s): %s\n%s", ruleID, err, response) } return true, nil } @@ -519,10 +522,10 @@ type parsedIBMISSecurityGroupRuleDictionary struct { } func inferRemoteSecurityGroup(s string) (address, cidr, id string, err error) { - if isSecurityGroupAddress(s) { + if validate.IsSecurityGroupAddress(s) { address = s return - } else if isSecurityGroupCIDR(s) { + } else if validate.IsSecurityGroupCIDR(s) { cidr = s return } else { @@ -586,6 +589,18 @@ func parseIBMISSecurityGroupRuleDictionary(d *schema.ResourceData, tag string, s } else if parsed.remoteSecGrpID != "" { remoteTemplate.ID = &parsed.remoteSecGrpID remoteTemplateUpdate.ID = &parsed.remoteSecGrpID + + // check if remote is actually a SG identifier + getSecurityGroupOptions := &vpcv1.GetSecurityGroupOptions{ + ID: &parsed.remoteSecGrpID, + } + sg, res, err := sess.GetSecurityGroup(getSecurityGroupOptions) + if err != nil || sg == nil { + if res != nil && res.StatusCode == 404 { + return nil, nil, nil, err + } + return nil, nil, nil, fmt.Errorf("Error getting Security Group in remote (%s): %s\n%s", parsed.remoteSecGrpID, err, res) + } } sgTemplate.Remote = remoteTemplate securityGroupRulePatchModel.Remote = remoteTemplateUpdate @@ -662,7 +677,7 @@ func parseIBMISSecurityGroupRuleDictionary(d *schema.ResourceData, tag string, s } securityGroupRulePatch, err := securityGroupRulePatchModel.AsPatch() if err != nil { - return nil, nil, nil, fmt.Errorf("Error calling asPatch for SecurityGroupRulePatch: %s", err) + return nil, nil, nil, fmt.Errorf("[ERROR] Error calling asPatch for SecurityGroupRulePatch: %s", err) } sgTemplateUpdate.SecurityGroupRulePatch = securityGroupRulePatch // log.Printf("[DEBUG] parse tag=%s\n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v \n\t%v ", diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_target.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_target.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_target.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_target.go index ed4f4054c0..de57b5889a 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_security_group_target.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_security_group_target.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -19,7 +21,7 @@ const ( isSecurityGroupResourceType = "resource_type" ) -func resourceIBMISSecurityGroupTarget() *schema.Resource { +func ResourceIBMISSecurityGroupTarget() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSecurityGroupTargetCreate, @@ -47,7 +49,7 @@ func resourceIBMISSecurityGroupTarget() *schema.Resource { Required: true, ForceNew: true, Description: "security group target identifier", - ValidateFunc: InvokeValidator("ibm_is_security_group_target", isSecurityGroupTargetID), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group_target", isSecurityGroupTargetID), }, "name": { @@ -70,28 +72,28 @@ func resourceIBMISSecurityGroupTarget() *schema.Resource { } } -func resourceIBMISSecurityGroupTargetValidator() *ResourceValidator { +func ResourceIBMISSecurityGroupTargetValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSecurityGroupTargetID, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[-0-9a-z_]+$`, MinValueLength: 1, MaxValueLength: 64}, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "security_group", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^[-0-9a-z_]+$`, MinValueLength: 1, MaxValueLength: 64}) - ibmISSecurityGroupResourceValidator := ResourceValidator{ResourceName: "ibm_is_security_group_target", Schema: validateSchema} + ibmISSecurityGroupResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_security_group_target", Schema: validateSchema} return &ibmISSecurityGroupResourceValidator } @@ -111,7 +113,7 @@ func resourceIBMISSecurityGroupTargetCreate(d *schema.ResourceData, meta interfa sg, response, err := sess.CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions) if err != nil || sg == nil { - return fmt.Errorf("error while creating Security Group Target Binding %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating Security Group Target Binding %s\n%s", err, response) } sgtarget := sg.(*vpcv1.SecurityGroupTargetReference) d.SetId(fmt.Sprintf("%s/%s", securityGroupID, *sgtarget.ID)) @@ -134,7 +136,7 @@ func resourceIBMISSecurityGroupTargetRead(d *schema.ResourceData, meta interface return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -152,7 +154,7 @@ func resourceIBMISSecurityGroupTargetRead(d *schema.ResourceData, meta interface d.SetId("") return nil } - return fmt.Errorf("error getting Security Group Target : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Security Group Target : %s\n%s", err, response) } target := data.(*vpcv1.SecurityGroupTargetReference) @@ -171,7 +173,7 @@ func resourceIBMISSecurityGroupTargetDelete(d *schema.ResourceData, meta interfa return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -188,13 +190,13 @@ func resourceIBMISSecurityGroupTargetDelete(d *schema.ResourceData, meta interfa d.SetId("") return nil } - return fmt.Errorf("error Getting Security Group Targets (%s): %s\n%s", securityGroupID, err, response) + return fmt.Errorf("[ERROR] Error Getting Security Group Targets (%s): %s\n%s", securityGroupID, err, response) } deleteSecurityGroupTargetBindingOptions := sess.NewDeleteSecurityGroupTargetBindingOptions(securityGroupID, securityGroupTargetID) response, err = sess.DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions) if err != nil { - return fmt.Errorf("error Deleting Security Group Targets : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Security Group Targets : %s\n%s", err, response) } securityGroupTargetReference := sgt.(*vpcv1.SecurityGroupTargetReference) crn := securityGroupTargetReference.CRN @@ -216,7 +218,7 @@ func resourceIBMISSecurityGroupTargetExists(d *schema.ResourceData, meta interfa return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } @@ -234,7 +236,7 @@ func resourceIBMISSecurityGroupTargetExists(d *schema.ResourceData, meta interfa d.SetId("") return false, nil } - return false, fmt.Errorf("error getting Security Group Target : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Security Group Target : %s\n%s", err, response) } return true, nil @@ -272,7 +274,7 @@ func isLBRemoveRefreshFunc(sess *vpcv1.VpcV1, sgt vpcv1.SecurityGroupTargetRefer } lb, response, err := sess.GetLoadBalancer(getlboptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } if *lb.ProvisioningStatus == "active" || *lb.ProvisioningStatus == "failed" { @@ -281,7 +283,7 @@ func isLBRemoveRefreshFunc(sess *vpcv1.VpcV1, sgt vpcv1.SecurityGroupTargetRefer return sgt, isLBProvisioning, nil } } - return nil, isLBProvisioningDone, fmt.Errorf("error getting Security Group Target : %s\n%s", err, response) + return nil, isLBProvisioningDone, fmt.Errorf("[ERROR] Error getting Security Group Target : %s\n%s", err, response) } return sgt, isLBProvisioning, nil } @@ -310,7 +312,7 @@ func isLBSgTargetRefreshFunc(sess *vpcv1.VpcV1, lbId string) resource.StateRefre } lb, response, err := sess.GetLoadBalancer(getlboptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Load Balancer : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Load Balancer : %s\n%s", err, response) } if *lb.ProvisioningStatus == "active" || *lb.ProvisioningStatus == "failed" { diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_snapshot.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_snapshot.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_snapshot.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_snapshot.go index 09f39a75ae..151d2aa976 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_snapshot.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_snapshot.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,6 +9,8 @@ import ( "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -39,9 +41,10 @@ const ( isSnapshotSuspended = "suspended" isSnapshotUpdating = "updating" isSnapshotWaiting = "waiting" + isSnapshotCapturedAt = "captured_at" ) -func resourceIBMSnapshot() *schema.Resource { +func ResourceIBMSnapshot() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSnapshotCreate, Read: resourceIBMISSnapshotRead, @@ -57,7 +60,7 @@ func resourceIBMSnapshot() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -67,7 +70,7 @@ func resourceIBMSnapshot() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_snapshot", isSnapshotName), + ValidateFunc: validate.InvokeValidator("ibm_is_snapshot", isSnapshotName), Description: "Snapshot name", }, @@ -151,19 +154,19 @@ func resourceIBMSnapshot() *schema.Resource { } } -func resourceIBMISSnapshotValidator() *ResourceValidator { +func ResourceIBMISSnapshotValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSnapshotName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmISSnapshotResourceValidator := ResourceValidator{ResourceName: "ibm_is_snapshot", Schema: validateSchema} + ibmISSnapshotResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_snapshot", Schema: validateSchema} return &ibmISSnapshotResourceValidator } @@ -194,7 +197,7 @@ func resourceIBMISSnapshotCreate(d *schema.ResourceData, meta interface{}) error snapshot, response, err := sess.CreateSnapshot(options) if err != nil || snapshot == nil { - return fmt.Errorf("Error creating Snapshot %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error creating Snapshot %s\n%s", err, response) } d.SetId(*snapshot.ID) @@ -231,7 +234,7 @@ func isSnapshotRefreshFunc(sess *vpcv1.VpcV1, id string) resource.StateRefreshFu } snapshot, response, err := sess.GetSnapshot(getSnapshotOptions) if err != nil { - return nil, isSnapshotFailed, fmt.Errorf("Error getting Snapshot : %s\n%s", err, response) + return nil, isSnapshotFailed, fmt.Errorf("[ERROR] Error getting Snapshot : %s\n%s", err, response) } if *snapshot.LifecycleState == isSnapshotAvailable { @@ -267,7 +270,7 @@ func snapshotGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting Snapshot : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Snapshot : %s\n%s", err, response) } d.SetId(*snapshot.ID) @@ -328,12 +331,12 @@ func snapshotUpdate(d *schema.ResourceData, meta interface{}, id, name string, h } snapshotPatch, err := snapshotPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for SnapshotPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for SnapshotPatch: %s", err) } updateSnapshotOptions.SnapshotPatch = snapshotPatch _, response, err := sess.UpdateSnapshot(updateSnapshotOptions) if err != nil { - return fmt.Errorf("Error updating Snapshot : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating Snapshot : %s\n%s", err, response) } _, err = isWaitForSnapshotUpdate(sess, d.Id(), d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -364,7 +367,7 @@ func isSnapshotUpdateRefreshFunc(sess *vpcv1.VpcV1, id string) resource.StateRef } snapshot, response, err := sess.GetSnapshot(getSnapshotOptions) if err != nil { - return nil, isSnapshotFailed, fmt.Errorf("Error getting Snapshot : %s\n%s", err, response) + return nil, isSnapshotFailed, fmt.Errorf("[ERROR] Error getting Snapshot : %s\n%s", err, response) } if *snapshot.LifecycleState == isSnapshotAvailable || *snapshot.LifecycleState == isSnapshotFailed { @@ -402,7 +405,7 @@ func snapshotDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting Snapshot (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting Snapshot (%s): %s\n%s", id, err, response) } deleteSnapshotOptions := &vpcv1.DeleteSnapshotOptions{ @@ -410,7 +413,7 @@ func snapshotDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteSnapshot(deleteSnapshotOptions) if err != nil { - return fmt.Errorf("Error deleting Snapshot : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting Snapshot : %s\n%s", err, response) } _, err = isWaitForSnapshotDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -446,7 +449,7 @@ func isSnapshotDeleteRefreshFunc(sess *vpcv1.VpcV1, id string) resource.StateRef if response != nil && response.StatusCode == 404 { return snapshot, isSnapshotDeleted, nil } - return nil, isSnapshotFailed, fmt.Errorf("The Snapshot %s failed to delete: %s\n%s", id, err, response) + return nil, isSnapshotFailed, fmt.Errorf("[ERROR] The Snapshot %s failed to delete: %s\n%s", id, err, response) } return snapshot, *snapshot.LifecycleState, nil } @@ -471,7 +474,7 @@ func snapshotExists(d *schema.ResourceData, meta interface{}, id string) (bool, if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Snapshot: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Snapshot: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ssh_key.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ssh_key.go similarity index 79% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ssh_key.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ssh_key.go index 9205ded075..0ead39ea48 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_ssh_key.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_ssh_key.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -9,6 +9,8 @@ import ( "log" "os" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -25,7 +27,7 @@ const ( isKeyResourceGroup = "resource_group" ) -func resourceIBMISSSHKey() *schema.Resource { +func ResourceIBMISSSHKey() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSSHKeyCreate, Read: resourceIBMISSSHKeyRead, @@ -36,7 +38,7 @@ func resourceIBMISSSHKey() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -45,7 +47,7 @@ func resourceIBMISSSHKey() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_security_group", isKeyName), + ValidateFunc: validate.InvokeValidator("ibm_is_security_group", isKeyName), Description: "SSH Key name", }, @@ -77,8 +79,8 @@ func resourceIBMISSSHKey() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_ssh_key", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_ssh_key", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags for SSH key", }, @@ -90,19 +92,19 @@ func resourceIBMISSSHKey() *schema.Resource { Description: "Resource group ID", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -114,7 +116,7 @@ func resourceIBMISSSHKey() *schema.Resource { Description: "The crn of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -123,30 +125,30 @@ func resourceIBMISSSHKey() *schema.Resource { } } -func resourceIBMISSHKeyValidator() *ResourceValidator { +func ResourceIBMISSHKeyValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isKeyName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISSSHKeyResourceValidator := ResourceValidator{ResourceName: "ibm_is_ssh_key", Schema: validateSchema} + ibmISSSHKeyResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_ssh_key", Schema: validateSchema} return &ibmISSSHKeyResourceValidator } @@ -190,7 +192,7 @@ func keyCreate(d *schema.ResourceData, meta interface{}, name, publickey string) v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isKeyTags); ok || v != "" { oldList, newList := d.GetChange(isKeyTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *key.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *key.CRN) if err != nil { log.Printf( "Error on create of vpc SSH Key (%s) tags: %s", d.Id(), err) @@ -224,29 +226,29 @@ func keyGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting SSH Key (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting SSH Key (%s): %s\n%s", id, err, response) } d.Set(isKeyName, *key.Name) d.Set(isKeyPublicKey, *key.PublicKey) d.Set(isKeyType, *key.Type) d.Set(isKeyFingerprint, *key.Fingerprint) d.Set(isKeyLength, *key.Length) - tags, err := GetTagsUsingCRN(meta, *key.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *key.CRN) if err != nil { log.Printf( "Error on get of vpc SSH Key (%s) tags: %s", d.Id(), err) } d.Set(isKeyTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/compute/sshKeys") - d.Set(ResourceName, *key.Name) - d.Set(ResourceCRN, *key.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/compute/sshKeys") + d.Set(flex.ResourceName, *key.Name) + d.Set(flex.ResourceCRN, *key.CRN) d.Set(IsKeyCRN, *key.CRN) if key.ResourceGroup != nil { - d.Set(ResourceGroupName, *key.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *key.ResourceGroup.Name) d.Set(isKeyResourceGroup, *key.ResourceGroup.ID) } return nil @@ -281,10 +283,10 @@ func keyUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasCha } key, response, err := sess.GetKey(options) if err != nil { - return fmt.Errorf("Error getting SSH Key : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting SSH Key : %s\n%s", err, response) } oldList, newList := d.GetChange(isKeyTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *key.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *key.CRN) if err != nil { log.Printf( "Error on update of resource vpc SSH Key (%s) tags: %s", id, err) @@ -299,12 +301,12 @@ func keyUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasCha } keyPatch, err := keyPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for KeyPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for KeyPatch: %s", err) } options.KeyPatch = keyPatch _, response, err := sess.UpdateKey(options) if err != nil { - return fmt.Errorf("Error updating vpc SSH Key: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating vpc SSH Key: %s\n%s", err, response) } } return nil @@ -334,7 +336,7 @@ func keyDelete(d *schema.ResourceData, meta interface{}, id string) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error getting SSH Key (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting SSH Key (%s): %s\n%s", id, err, response) } options := &vpcv1.DeleteKeyOptions{ @@ -342,7 +344,7 @@ func keyDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteKey(options) if err != nil { - return fmt.Errorf("Error deleting SSH Key : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting SSH Key : %s\n%s", err, response) } d.SetId("") return nil @@ -368,7 +370,7 @@ func keyExists(d *schema.ResourceData, meta interface{}, id string) (bool, error if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting SSH Key: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting SSH Key: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet.go similarity index 83% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet.go index 00d147a01e..c1aed21e0e 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -11,6 +11,9 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/IBM/vpc-go-sdk/vpcv1" @@ -45,7 +48,7 @@ const ( isAccessTagType = "access" ) -func resourceIBMISSubnet() *schema.Resource { +func ResourceIBMISSubnet() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSubnetCreate, Read: resourceIBMISSubnetRead, @@ -61,7 +64,7 @@ func resourceIBMISSubnet() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -72,7 +75,7 @@ func resourceIBMISSubnet() *schema.Resource { Optional: true, Computed: true, ConflictsWith: []string{isSubnetTotalIpv4AddressCount}, - ValidateFunc: InvokeValidator("ibm_is_subnet", isSubnetIpv4CidrBlock), + ValidateFunc: validate.InvokeValidator("ibm_is_subnet", isSubnetIpv4CidrBlock), Description: "IPV4 subnet - CIDR block", }, @@ -95,7 +98,7 @@ func resourceIBMISSubnet() *schema.Resource { ForceNew: true, Default: "ipv4", Optional: true, - ValidateFunc: validateIPVersion, + ValidateFunc: validate.ValidateIPVersion, Description: "The IP version(s) to support for this subnet.", }, @@ -103,7 +106,7 @@ func resourceIBMISSubnet() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_subnet", isSubnetName), + ValidateFunc: validate.InvokeValidator("ibm_is_subnet", isSubnetName), Description: "Subnet name", }, @@ -111,8 +114,8 @@ func resourceIBMISSubnet() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_subnet", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_subnet", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, @@ -120,8 +123,8 @@ func resourceIBMISSubnet() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_subnet", "accesstag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_subnet", "accesstag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of access management tags", }, @@ -142,6 +145,7 @@ func resourceIBMISSubnet() *schema.Resource { isSubnetPublicGateway: { Type: schema.TypeString, Optional: true, + Computed: true, ForceNew: false, Description: "Public Gateway of the subnet", }, @@ -181,30 +185,30 @@ func resourceIBMISSubnet() *schema.Resource { Description: "routing table id that is associated with the subnet", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -213,47 +217,47 @@ func resourceIBMISSubnet() *schema.Resource { } } -func resourceIBMISSubnetValidator() *ResourceValidator { +func ResourceIBMISSubnetValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSubnetName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isSubnetIpv4CidrBlock, - ValidateFunctionIdentifier: ValidateCIDRAddress, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateCIDRAddress, + Type: validate.TypeString, ForceNew: true, Optional: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "accesstag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([ ]*[A-Za-z0-9:_.-]+[ ]*)+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISSubnetResourceValidator := ResourceValidator{ResourceName: "ibm_is_subnet", Schema: validateSchema} + ibmISSubnetResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_subnet", Schema: validateSchema} return &ibmISSubnetResourceValidator } @@ -281,8 +285,8 @@ func resourceIBMISSubnetCreate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("only one of %s or %s needs to be provided", isSubnetIpv4CidrBlock, isSubnetTotalIpv4AddressCount) } isSubnetKey := "subnet_key_" + vpc + "_" + zone - ibmMutexKV.Lock(isSubnetKey) - defer ibmMutexKV.Unlock(isSubnetKey) + conns.IbmMutexKV.Lock(isSubnetKey) + defer conns.IbmMutexKV.Unlock(isSubnetKey) acl := "" if nwacl, ok := d.GetOk(isSubnetNetworkACL); ok { @@ -360,7 +364,7 @@ func subnetCreate(d *schema.ResourceData, meta interface{}, name, vpc, zone, ipv subnet, response, err := sess.CreateSubnet(createSubnetOptions) if err != nil { log.Printf("[DEBUG] Subnet err %s\n%s", err, response) - return fmt.Errorf("Error while creating Subnet %s\n%v", err, response) + return fmt.Errorf("[ERROR] Error while creating Subnet %s\n%v", err, response) } d.SetId(*subnet.ID) log.Printf("[INFO] Subnet : %s", *subnet.ID) @@ -371,7 +375,7 @@ func subnetCreate(d *schema.ResourceData, meta interface{}, name, vpc, zone, ipv v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isSubnetTags); ok || v != "" { oldList, newList := d.GetChange(isSubnetTags) - err = UpdateGlobalTagsUsingCRN(oldList, newList, meta, *subnet.CRN, "", isUserTagType) + err = flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, *subnet.CRN, "", isUserTagType) if err != nil { log.Printf( "Error on create of resource subnet (%s) tags: %s", d.Id(), err) @@ -380,7 +384,7 @@ func subnetCreate(d *schema.ResourceData, meta interface{}, name, vpc, zone, ipv if _, ok := d.GetOk(isSubnetAccessTags); ok { oldList, newList := d.GetChange(isSubnetAccessTags) - err = UpdateGlobalTagsUsingCRN(oldList, newList, meta, *subnet.CRN, "", isAccessTagType) + err = flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, *subnet.CRN, "", isAccessTagType) if err != nil { log.Printf( "Error on create of resource subnet (%s) access tags: %s", d.Id(), err) @@ -412,7 +416,7 @@ func isSubnetRefreshFunc(subnetC *vpcv1.VpcV1, id string) resource.StateRefreshF } subnet, response, err := subnetC.GetSubnet(getSubnetOptions) if err != nil { - return nil, "", fmt.Errorf("Error getting Subnet : %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error getting Subnet : %s\n%s", err, response) } if *subnet.Status == "available" || *subnet.Status == "failed" { @@ -448,7 +452,7 @@ func subnetGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Subnet (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Subnet (%s): %s\n%s", id, err, response) } d.Set(isSubnetName, *subnet.Name) d.Set(isSubnetIPVersion, *subnet.IPVersion) @@ -472,18 +476,18 @@ func subnetGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isSubnetZone, *subnet.Zone.Name) d.Set(isSubnetVPC, *subnet.VPC.ID) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - tags, err := GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isUserTagType) + tags, err := flex.GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isUserTagType) if err != nil { log.Printf( "Error on get of resource subnet (%s) tags: %s", d.Id(), err) } - accesstags, err := GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isAccessTagType) + accesstags, err := flex.GetGlobalTagsUsingCRN(meta, *subnet.CRN, "", isAccessTagType) if err != nil { log.Printf( "Error on get of resource subnet (%s) access tags: %s", d.Id(), err) @@ -492,13 +496,13 @@ func subnetGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isSubnetTags, tags) d.Set(isSubnetAccessTags, accesstags) d.Set(isSubnetCRN, *subnet.CRN) - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/subnets") - d.Set(ResourceName, *subnet.Name) - d.Set(ResourceCRN, *subnet.CRN) - d.Set(ResourceStatus, *subnet.Status) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/subnets") + d.Set(flex.ResourceName, *subnet.Name) + d.Set(flex.ResourceCRN, *subnet.CRN) + d.Set(flex.ResourceStatus, *subnet.Status) if subnet.ResourceGroup != nil { d.Set(isSubnetResourceGroup, *subnet.ResourceGroup.ID) - d.Set(ResourceGroupName, *subnet.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *subnet.ResourceGroup.Name) } return nil } @@ -508,7 +512,7 @@ func resourceIBMISSubnetUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange(isSubnetTags) { oldList, newList := d.GetChange(isSubnetTags) - err := UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get(isSubnetCRN).(string), "", isUserTagType) + err := flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get(isSubnetCRN).(string), "", isUserTagType) if err != nil { log.Printf( "Error on update of resource subnet (%s) tags: %s", d.Id(), err) @@ -517,7 +521,7 @@ func resourceIBMISSubnetUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange(isSubnetAccessTags) { oldList, newList := d.GetChange(isSubnetAccessTags) - err := UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get(isSubnetCRN).(string), "", isAccessTagType) + err := flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, d.Get(isSubnetCRN).(string), "", isAccessTagType) if err != nil { log.Printf( "Error on update of resource subnet (%s) access tags: %s", d.Id(), err) @@ -562,7 +566,7 @@ func subnetUpdate(d *schema.ResourceData, meta interface{}, id string) error { } response, err := sess.UnsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions) if err != nil { - return fmt.Errorf("Error Detaching the public gateway attached to the subnet : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Detaching the public gateway attached to the subnet : %s\n%s", err, response) } _, err = isWaitForSubnetAvailable(sess, d.Id(), d.Timeout(schema.TimeoutUpdate)) if err != nil { @@ -577,7 +581,7 @@ func subnetUpdate(d *schema.ResourceData, meta interface{}, id string) error { } _, response, err := sess.SetSubnetPublicGateway(setSubnetPublicGatewayOptions) if err != nil { - return fmt.Errorf("Error Attaching public gateway to the subnet : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Attaching public gateway to the subnet : %s\n%s", err, response) } _, err = isWaitForSubnetAvailable(sess, d.Id(), d.Timeout(schema.TimeoutUpdate)) if err != nil { @@ -607,13 +611,13 @@ func subnetUpdate(d *schema.ResourceData, meta interface{}, id string) error { if hasChanged { subnetPatch, err := subnetPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for SubnetPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for SubnetPatch: %s", err) } updateSubnetOptions.SubnetPatch = subnetPatch updateSubnetOptions.ID = &id _, response, err := sess.UpdateSubnet(updateSubnetOptions) if err != nil { - return fmt.Errorf("Error Updating Subnet : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Subnet : %s\n%s", err, response) } } return nil @@ -644,7 +648,7 @@ func subnetDelete(d *schema.ResourceData, meta interface{}, id string) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Getting Subnet (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Subnet (%s): %s\n%s", id, err, response) } if subnet.PublicGateway != nil { unsetSubnetPublicGatewayOptions := &vpcv1.UnsetSubnetPublicGatewayOptions{ @@ -665,12 +669,13 @@ func subnetDelete(d *schema.ResourceData, meta interface{}, id string) error { response, err = sess.DeleteSubnet(deleteSubnetOptions) if err != nil { if response != nil && response.StatusCode == 409 { + log.Printf("[DEBUG] Delete subnet response status code: 409 conflict, provider will try again. %s", err) _, err = isWaitForSubnetDeleteRetry(sess, d.Id(), d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf("Error Deleting Subnet : %s", err) + return fmt.Errorf("[ERROR] Error Deleting Subnet : %s", err) } } else { - return fmt.Errorf("Error Deleting Subnet : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Subnet : %s\n%s", err, response) } } _, err = isWaitForSubnetDeleted(sess, d.Id(), d.Timeout(schema.TimeoutDelete)) @@ -682,7 +687,7 @@ func subnetDelete(d *schema.ResourceData, meta interface{}, id string) error { } func isWaitForSubnetDeleteRetry(vpcClient *vpcv1.VpcV1, id string, timeout time.Duration) (interface{}, error) { - log.Printf("Retrying subnet (%s) delete", id) + log.Printf("[DEBUG] Retrying subnet (%s) delete", id) stateConf := &resource.StateChangeConf{ Pending: []string{isSubnetInUse}, Target: []string{isSubnetDeleting, isSubnetDeleted, ""}, @@ -690,7 +695,7 @@ func isWaitForSubnetDeleteRetry(vpcClient *vpcv1.VpcV1, id string, timeout time. deleteSubnetOptions := &vpcv1.DeleteSubnetOptions{ ID: &id, } - log.Printf("Retrying subnet (%s) delete", id) + log.Printf("[DEBUG] Retrying subnet (%s) delete", id) response, err := vpcClient.DeleteSubnet(deleteSubnetOptions) if err != nil { if response != nil && response.StatusCode == 409 { @@ -698,7 +703,7 @@ func isWaitForSubnetDeleteRetry(vpcClient *vpcv1.VpcV1, id string, timeout time. } else if response != nil && response.StatusCode == 404 { return response, isSubnetDeleted, nil } - return response, "", fmt.Errorf("Error deleting subnet: %s\n%s", err, response) + return response, "", fmt.Errorf("[ERROR] Error deleting subnet: %s\n%s", err, response) } return response, isSubnetDeleting, nil }, @@ -738,7 +743,7 @@ func isSubnetDeleteRefreshFunc(subnetC *vpcv1.VpcV1, id string) resource.StateRe if response != nil && strings.Contains(err.Error(), "please detach all network interfaces from subnet before deleting it") { return subnet, isSubnetDeleting, nil } - return subnet, "", fmt.Errorf("The Subnet %s failed to delete: %s\n%s", id, err, response) + return subnet, "", fmt.Errorf("[ERROR] The Subnet %s failed to delete: %s\n%s", id, err, response) } return subnet, isSubnetDeleting, err } @@ -763,7 +768,7 @@ func subnetExists(d *schema.ResourceData, meta interface{}, id string) (bool, er if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Subnet: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Subnet: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet_network_acl_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_network_acl_attachment.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet_network_acl_attachment.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_network_acl_attachment.go index b2d538674f..e863770e37 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet_network_acl_attachment.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_network_acl_attachment.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -18,7 +18,7 @@ const ( isNetworkACLID = "network_acl" ) -func resourceIBMISSubnetNetworkACLAttachment() *schema.Resource { +func ResourceIBMISSubnetNetworkACLAttachment() *schema.Resource { return &schema.Resource{ Create: resourceIBMISSubnetNetworkACLAttachmentCreate, Read: resourceIBMISSubnetNetworkACLAttachmentRead, @@ -215,7 +215,7 @@ func resourceIBMISSubnetNetworkACLAttachmentCreate(d *schema.ResourceData, meta if err != nil { log.Printf("[DEBUG] Error while attaching a network ACL to a subnet %s\n%s", err, response) - return fmt.Errorf("Error while attaching a network ACL to a subnet %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while attaching a network ACL to a subnet %s\n%s", err, response) } d.SetId(subnet) log.Printf("[INFO] Network ACL : %s", *resultACL.ID) @@ -241,7 +241,7 @@ func resourceIBMISSubnetNetworkACLAttachmentRead(d *schema.ResourceData, meta in d.SetId("") return nil } - return fmt.Errorf("Error getting subnet's (%s) attached network ACL: %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting subnet's (%s) attached network ACL: %s\n%s", id, err, response) } d.Set(isNetworkACLName, *nwacl.Name) d.Set(isNetworkACLCRN, *nwacl.CRN) @@ -356,7 +356,7 @@ func resourceIBMISSubnetNetworkACLAttachmentUpdate(d *schema.ResourceData, meta if err != nil { log.Printf("[DEBUG] Error while attaching a network ACL to a subnet %s\n%s", err, response) - return fmt.Errorf("Error while attaching a network ACL to a subnet %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while attaching a network ACL to a subnet %s\n%s", err, response) } log.Printf("[INFO] Updated subnet %s with Network ACL : %s", subnet, *resultACL.ID) @@ -383,7 +383,7 @@ func resourceIBMISSubnetNetworkACLAttachmentDelete(d *schema.ResourceData, meta d.SetId("") return nil } - return fmt.Errorf("Error Getting Subnet (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Subnet (%s): %s\n%s", id, err, response) } // Fetch VPC vpcID := *subnet.VPC.ID @@ -397,7 +397,7 @@ func resourceIBMISSubnetNetworkACLAttachmentDelete(d *schema.ResourceData, meta d.SetId("") return nil } - return fmt.Errorf("Error getting VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting VPC : %s\n%s", err, response) } // Fetch default network ACL @@ -415,7 +415,7 @@ func resourceIBMISSubnetNetworkACLAttachmentDelete(d *schema.ResourceData, meta if err != nil { log.Printf("[DEBUG] Error while attaching a network ACL to a subnet %s\n%s", err, response) - return fmt.Errorf("Error while attaching a network ACL to a subnet %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while attaching a network ACL to a subnet %s\n%s", err, response) } log.Printf("[INFO] Updated subnet %s with VPC default Network ACL : %s", id, *resultACL.ID) } else { @@ -440,7 +440,7 @@ func resourceIBMISSubnetNetworkACLAttachmentExists(d *schema.ResourceData, meta if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting subnet's attached network ACL: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting subnet's attached network ACL: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_public_gateway_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_public_gateway_attachment.go new file mode 100644 index 0000000000..058f308f42 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_public_gateway_attachment.go @@ -0,0 +1,334 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + isPublicGatewayID = "public_gateway" + IsPublicGatewayResourceType = "resource_type" + IsPublicGatewayAttachmentAvailable = "available" + IsPublicGatewayAttachmentDeleting = "deleting" + IsPublicGatewayAttachmentFailed = "failed" + IsPublicGatewayAttachmentPending = "pending" +) + +func ResourceIBMISSubnetPublicGatewayAttachment() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISSubnetPublicGatewayAttachmentCreate, + ReadContext: resourceIBMISSubnetPublicGatewayAttachmentRead, + UpdateContext: resourceIBMISSubnetPublicGatewayAttachmentUpdate, + DeleteContext: resourceIBMISSubnetPublicGatewayAttachmentDelete, + Importer: &schema.ResourceImporter{}, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isSubnetID: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The subnet identifier", + }, + + isPublicGatewayID: { + Type: schema.TypeString, + Required: true, + Description: "The unique identifier of public gateway", + }, + + isPublicGatewayName: { + Type: schema.TypeString, + Computed: true, + Description: "Name of the Public gateway instance", + }, + + isPublicGatewayFloatingIP: { + Type: schema.TypeMap, + Computed: true, + }, + + isPublicGatewayStatus: { + Type: schema.TypeString, + Computed: true, + Description: "Public gateway instance status", + }, + + isPublicGatewayResourceGroup: { + Type: schema.TypeString, + Computed: true, + Description: "Public gateway resource group info", + }, + + isPublicGatewayVPC: { + Type: schema.TypeString, + Computed: true, + Description: "Public gateway VPC info", + }, + + isPublicGatewayZone: { + Type: schema.TypeString, + Computed: true, + Description: "Public gateway zone info", + }, + + IsPublicGatewayResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the resource", + }, + + isPublicGatewayCRN: { + Type: schema.TypeString, + Computed: true, + Description: "The crn of the resource", + }, + + flex.ResourceGroupName: { + Type: schema.TypeString, + Computed: true, + Description: "The resource group name in which resource is provisioned", + }, + }, + } +} + +func resourceIBMISSubnetPublicGatewayAttachmentCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + subnet := d.Get(isSubnetID).(string) + publicGateway := d.Get(isPublicGatewayID).(string) + + publicGatewayIdentity := &vpcv1.PublicGatewayIdentity{ + ID: &publicGateway, + } + + // Construct an instance of the SetSubnetPublicGatewayOptions + setSubnetPublicGatewayOptions := &vpcv1.SetSubnetPublicGatewayOptions{ + ID: &subnet, + PublicGatewayIdentity: publicGatewayIdentity, + } + + pg, response, err := sess.SetSubnetPublicGatewayWithContext(context, setSubnetPublicGatewayOptions) + + if err != nil { + log.Printf("[DEBUG] Error while attaching public gateway(%s) to subnet(%s) %s\n%s", publicGateway, subnet, err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error while attaching public gateway(%s) to subnet(%s) %s\n%s", publicGateway, subnet, err, response)) + } + d.SetId(subnet) + _, err = isWaitForSubnetPublicGatewayAvailable(sess, d.Id(), d.Timeout(schema.TimeoutCreate)) + if err != nil { + return diag.FromErr(err) + } + log.Printf("[INFO] Public Gateway : %s", *pg.ID) + log.Printf("[INFO] Subnet ID : %s", subnet) + + return resourceIBMISSubnetPublicGatewayAttachmentRead(context, d, meta) +} + +func resourceIBMISSubnetPublicGatewayAttachmentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Id() + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + getSubnetPublicGatewayOptionsModel := &vpcv1.GetSubnetPublicGatewayOptions{ + ID: &id, + } + pg, response, err := sess.GetSubnetPublicGatewayWithContext(context, getSubnetPublicGatewayOptionsModel) + + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error getting subnet's (%s) attached public gateway: %s\n%s", id, err, response)) + } + d.Set(isPublicGatewayName, pg.Name) + d.Set(isSubnetID, id) + d.Set(isPublicGatewayID, pg.ID) + if pg.FloatingIP != nil { + floatIP := map[string]interface{}{ + "id": *pg.FloatingIP.ID, + isPublicGatewayFloatingIPAddress: *pg.FloatingIP.Address, + } + d.Set(isPublicGatewayFloatingIP, floatIP) + } + d.Set(isPublicGatewayStatus, pg.Status) + if pg.ResourceGroup != nil { + d.Set(isPublicGatewayResourceGroup, *pg.ResourceGroup.ID) + d.Set(flex.ResourceGroupName, *pg.ResourceGroup.Name) + } + d.Set(isPublicGatewayVPC, *pg.VPC.ID) + d.Set(isPublicGatewayZone, *pg.Zone.Name) + d.Set(IsPublicGatewayResourceType, pg.ResourceType) + d.Set(isPublicGatewayCRN, pg.CRN) + + return nil +} + +func resourceIBMISSubnetPublicGatewayAttachmentUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + if d.HasChange(isPublicGatewayID) { + subnet := d.Get(isSubnetID).(string) + publicGateway := d.Get(isPublicGatewayID).(string) + + publicGatewayIdentity := &vpcv1.PublicGatewayIdentity{ + ID: &publicGateway, + } + + // Construct an instance of the SetSubnetPublicGatewayOptions + setSubnetPublicGatewayOptions := &vpcv1.SetSubnetPublicGatewayOptions{ + ID: &subnet, + PublicGatewayIdentity: publicGatewayIdentity, + } + + pg, response, err := sess.SetSubnetPublicGatewayWithContext(context, setSubnetPublicGatewayOptions) + + if err != nil || pg == nil { + log.Printf("[DEBUG] Error while attaching public gateway(%s) to subnet(%s) %s\n%s", publicGateway, subnet, err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error while attaching public gateway(%s) to subnet(%s) %s\n%s", publicGateway, subnet, err, response)) + } + log.Printf("[INFO] Updated subnet %s with public gateway(%s)", subnet, publicGateway) + + d.SetId(subnet) + return resourceIBMISSubnetPublicGatewayAttachmentRead(context, d, meta) + } + + return resourceIBMISSubnetPublicGatewayAttachmentRead(context, d, meta) +} + +func resourceIBMISSubnetPublicGatewayAttachmentDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Id() + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + // Get subnet details + getSubnetOptions := &vpcv1.GetSubnetOptions{ + ID: &id, + } + _, response, err := sess.GetSubnetWithContext(context, getSubnetOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Subnet (%s): %s\n%s", id, err, response)) + } + + // Construct an instance of the UnsetSubnetPublicGatewayOptions model + unsetSubnetPublicGatewayOptions := &vpcv1.UnsetSubnetPublicGatewayOptions{ + ID: &id, + } + res, err := sess.UnsetSubnetPublicGatewayWithContext(context, unsetSubnetPublicGatewayOptions) + + if err != nil { + log.Printf("[DEBUG] Error while detaching public gateway to subnet %s\n%s", err, res) + return diag.FromErr(fmt.Errorf("[ERROR] Error while detaching public gateway to subnet %s\n%s", err, res)) + } + _, err = isWaitForSubnetPublicGatewayDelete(sess, d.Id(), d.Timeout(schema.TimeoutCreate)) + if err != nil { + return diag.FromErr(err) + } + d.SetId("") + return nil +} + +func isWaitForSubnetPublicGatewayAvailable(subnetC *vpcv1.VpcV1, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for subnet (%s) public gateway attachment to be available.", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{IsPublicGatewayAttachmentPending, IsPublicGatewayAttachmentDeleting}, + Target: []string{IsPublicGatewayAttachmentAvailable, IsPublicGatewayAttachmentFailed, ""}, + Refresh: isSubnetPublicGatewayRefreshFunc(subnetC, id), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isSubnetPublicGatewayRefreshFunc(subnetC *vpcv1.VpcV1, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + getSubnetPublicGatewayOptionsModel := &vpcv1.GetSubnetPublicGatewayOptions{ + ID: &id, + } + pg, response, err := subnetC.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel) + + if err != nil { + if response != nil && response.StatusCode == 404 { + return pg, "", fmt.Errorf("[ERROR] Error getting subnet's (%s) attached public gateway: %s\n%s", id, err, response) + } + return pg, "", fmt.Errorf("[ERROR] Error getting subnet's (%s) attached public gateway: %s\n%s", id, err, response) + } + + if *pg.Status == "failed" { + return pg, IsPublicGatewayAttachmentFailed, fmt.Errorf("[ERROR] Error subnet (%s) public gateway attachment failed: %s\n%s", id, err, response) + } + + return pg, *pg.Status, nil + } +} + +func isWaitForSubnetPublicGatewayDelete(subnetC *vpcv1.VpcV1, id string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for subnet (%s) public gateway attachment to be detached.", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{IsPublicGatewayAttachmentPending, IsPublicGatewayAttachmentDeleting}, + Target: []string{IsPublicGatewayAttachmentAvailable, IsPublicGatewayAttachmentFailed, ""}, + Refresh: isSubnetPublicGatewayDeleteRefreshFunc(subnetC, id), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isSubnetPublicGatewayDeleteRefreshFunc(subnetC *vpcv1.VpcV1, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + getSubnetPublicGatewayOptionsModel := &vpcv1.GetSubnetPublicGatewayOptions{ + ID: &id, + } + pg, response, err := subnetC.GetSubnetPublicGateway(getSubnetPublicGatewayOptionsModel) + + if err != nil { + if response != nil && response.StatusCode == 404 { + return pg, "", nil + } + return pg, "", fmt.Errorf("[ERROR] Error getting subnet's (%s) attached public gateway: %s\n%s", id, err, response) + } + + if *pg.Status == "failed" { + return pg, IsPublicGatewayAttachmentFailed, fmt.Errorf("[ERROR] Error subnet (%s) public gateway attachment failed: %s\n%s", id, err, response) + } + + return pg, *pg.Status, nil + } +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet_reserved_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_reserved_ip.go similarity index 84% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet_reserved_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_reserved_ip.go index aa92e49908..5104dc356b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_subnet_reserved_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_reserved_ip.go @@ -1,12 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -19,7 +21,7 @@ const ( isReservedIPTarget = "target" ) -func resourceIBMISReservedIP() *schema.Resource { +func ResourceIBMISReservedIP() *schema.Resource { return &schema.Resource{ Create: resourceIBMISReservedIPCreate, Read: resourceIBMISReservedIPRead, @@ -54,7 +56,7 @@ func resourceIBMISReservedIP() *schema.Resource { Type: schema.TypeString, Computed: true, Optional: true, - ValidateFunc: InvokeValidator("ibm_is_subnet_reserved_ip", isReservedIPName), + ValidateFunc: validate.InvokeValidator("ibm_is_subnet_reserved_ip", isReservedIPName), Description: "The user-defined or system-provided name for this reserved IP.", }, isReservedIPTarget: { @@ -103,20 +105,20 @@ func resourceIBMISReservedIP() *schema.Resource { }, } } -func resourceIBMISSubnetReservedIPValidator() *ResourceValidator { +func ResourceIBMISSubnetReservedIPValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isReservedIPName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) - ibmISSubnetReservedIPCResourceValidator := ResourceValidator{ResourceName: "ibm_is_subnet_reserved_ip", Schema: validateSchema} + ibmISSubnetReservedIPCResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_subnet_reserved_ip", Schema: validateSchema} return &ibmISSubnetReservedIPCResourceValidator } @@ -148,7 +150,7 @@ func resourceIBMISReservedIPCreate(d *schema.ResourceData, meta interface{}) err } rip, response, err := sess.CreateSubnetReservedIP(options) if err != nil || response == nil || rip == nil { - return fmt.Errorf("Error creating the reserved IP: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error creating the reserved IP: %s\n%s", err, response) } // Set id for the reserved IP as combination of subnet ID and reserved IP ID @@ -163,9 +165,9 @@ func resourceIBMISReservedIPRead(d *schema.ResourceData, meta interface{}) error return err } - allIDs, err := idParts(d.Id()) + allIDs, err := flex.IdParts(d.Id()) if err != nil { - return fmt.Errorf("The ID can not be split into subnet ID and reserved IP ID. %s", err) + return fmt.Errorf("[ERROR] The ID can not be split into subnet ID and reserved IP ID. %s", err) } subnetID := allIDs[0] @@ -201,7 +203,7 @@ func resourceIBMISReservedIPUpdate(d *schema.ResourceData, meta interface{}) err return err } - allIDs, err := idParts(d.Id()) + allIDs, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -227,14 +229,14 @@ func resourceIBMISReservedIPUpdate(d *schema.ResourceData, meta interface{}) err reservedIPPatch, err := patch.AsPatch() if err != nil { - return fmt.Errorf("Error updating the reserved IP %s", err) + return fmt.Errorf("[ERROR] Error updating the reserved IP %s", err) } options.ReservedIPPatch = reservedIPPatch _, response, err := sess.UpdateSubnetReservedIP(options) if err != nil { - return fmt.Errorf("Error updating the reserved IP %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating the reserved IP %s\n%s", err, response) } } return resourceIBMISReservedIPRead(d, meta) @@ -255,7 +257,7 @@ func resourceIBMISReservedIPDelete(d *schema.ResourceData, meta interface{}) err if err != nil { return err } - allIDs, err := idParts(d.Id()) + allIDs, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -264,7 +266,7 @@ func resourceIBMISReservedIPDelete(d *schema.ResourceData, meta interface{}) err deleteOptions := sess.NewDeleteSubnetReservedIPOptions(subnetID, reservedIPID) response, err := sess.DeleteSubnetReservedIP(deleteOptions) if err != nil || response == nil { - return fmt.Errorf("Error deleting the reserverd ip %s in subnet %s, %s\n%s", reservedIPID, subnetID, err, response) + return fmt.Errorf("[ERROR] Error deleting the reserverd ip %s in subnet %s, %s\n%s", reservedIPID, subnetID, err, response) } d.SetId("") return nil @@ -287,7 +289,7 @@ func get(d *schema.ResourceData, meta interface{}) (*vpcv1.ReservedIP, error) { if err != nil { return nil, err } - allIDs, err := idParts(d.Id()) + allIDs, err := flex.IdParts(d.Id()) subnetID := allIDs[0] reservedIPID := allIDs[1] options := sess.NewGetSubnetReservedIPOptions(subnetID, reservedIPID) @@ -297,7 +299,7 @@ func get(d *schema.ResourceData, meta interface{}) (*vpcv1.ReservedIP, error) { d.SetId("") return nil, nil } - return nil, fmt.Errorf("Error Getting Reserved IP : %s\n%s", err, response) + return nil, fmt.Errorf("[ERROR] Error Getting Reserved IP : %s\n%s", err, response) } return rip, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_routing_table_attachment.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_routing_table_attachment.go new file mode 100644 index 0000000000..fa9a4b5374 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_subnet_routing_table_attachment.go @@ -0,0 +1,296 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package vpc + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/IBM/vpc-go-sdk/vpcv1" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func ResourceIBMISSubnetRoutingTableAttachment() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceIBMISSubnetRoutingTableAttachmentCreate, + ReadContext: resourceIBMISSubnetRoutingTableAttachmentRead, + UpdateContext: resourceIBMISSubnetRoutingTableAttachmentUpdate, + DeleteContext: resourceIBMISSubnetRoutingTableAttachmentDelete, + Importer: &schema.ResourceImporter{}, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + + isSubnetID: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The subnet identifier", + }, + + isRoutingTableID: { + Type: schema.TypeString, + Required: true, + Description: "The unique identifier of routing table", + }, + + rtRouteDirectLinkIngress: { + Type: schema.TypeBool, + Computed: true, + Description: "If true, this routing table will be used to route traffic that originates from Direct Link to this VPC.", + }, + + rtIsDefault: { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this is the default routing table for this VPC", + }, + rtLifecycleState: { + Type: schema.TypeString, + Computed: true, + Description: "he lifecycle state of the routing table [ deleting, failed, pending, stable, suspended, updating, waiting ]", + }, + + isRoutingTableName: { + Type: schema.TypeString, + Computed: true, + Description: "The name of the routing table", + }, + isRoutingTableResourceType: { + Type: schema.TypeString, + Computed: true, + Description: "The resource type", + }, + + rtRouteTransitGatewayIngress: { + Type: schema.TypeBool, + Computed: true, + Description: "If true, this routing table will be used to route traffic that originates from Transit Gateway to this VPC.", + }, + + rtRouteVPCZoneIngress: { + Type: schema.TypeBool, + Computed: true, + Description: "If true, this routing table will be used to route traffic that originates from subnets in other zones in this VPC.", + }, + + rtSubnets: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rtName: { + Type: schema.TypeString, + Computed: true, + Description: "Subnet name", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "Subnet ID", + }, + }, + }, + }, + + rtRoutes: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + rtName: { + Type: schema.TypeString, + Computed: true, + Description: "route name", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "route ID", + }, + }, + }, + }, + }, + } +} + +func resourceIBMISSubnetRoutingTableAttachmentCreate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + subnet := d.Get(isSubnetID).(string) + routingTable := d.Get(isRoutingTableID).(string) + + // Construct an instance of the RoutingTableIdentityByID model + routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByID) + routingTableIdentityModel.ID = &routingTable + + // Construct an instance of the ReplaceSubnetRoutingTableOptions model + replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions) + replaceSubnetRoutingTableOptionsModel.ID = &subnet + replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel + resultRT, response, err := sess.ReplaceSubnetRoutingTableWithContext(context, replaceSubnetRoutingTableOptionsModel) + + if err != nil { + log.Printf("[DEBUG] Error while attaching a routing table to a subnet %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error while attaching a routing table to a subnet %s\n%s", err, response)) + } + d.SetId(subnet) + log.Printf("[INFO] Routing Table : %s", *resultRT.ID) + log.Printf("[INFO] Subnet ID : %s", subnet) + + return resourceIBMISSubnetRoutingTableAttachmentRead(context, d, meta) +} + +func resourceIBMISSubnetRoutingTableAttachmentRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Id() + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + + getSubnetRoutingTableOptionsModel := &vpcv1.GetSubnetRoutingTableOptions{ + ID: &id, + } + subRT, response, err := sess.GetSubnetRoutingTableWithContext(context, getSubnetRoutingTableOptionsModel) + + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error getting subnet's (%s) attached routing table: %s\n%s", id, err, response)) + } + d.Set(isRoutingTableName, *subRT.Name) + d.Set(isSubnetID, id) + d.Set(isRoutingTableID, *subRT.ID) + d.Set(isRoutingTableResourceType, *subRT.ResourceType) + d.Set(rtRouteDirectLinkIngress, *subRT.RouteDirectLinkIngress) + d.Set(rtIsDefault, *subRT.IsDefault) + d.Set(rtLifecycleState, *subRT.LifecycleState) + d.Set(isRoutingTableResourceType, *subRT.ResourceType) + d.Set(rtRouteTransitGatewayIngress, *subRT.RouteTransitGatewayIngress) + d.Set(rtRouteVPCZoneIngress, *subRT.RouteVPCZoneIngress) + subnets := make([]map[string]interface{}, 0) + + for _, s := range subRT.Subnets { + subnet := make(map[string]interface{}) + subnet[ID] = *s.ID + subnet["name"] = *s.Name + subnets = append(subnets, subnet) + } + d.Set(rtSubnets, subnets) + + routes := make([]map[string]interface{}, 0) + for _, s := range subRT.Routes { + route := make(map[string]interface{}) + route[ID] = *s.ID + route["name"] = *s.Name + routes = append(routes, route) + } + d.Set(rtRoutes, routes) + return nil +} + +func resourceIBMISSubnetRoutingTableAttachmentUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + if d.HasChange(isRoutingTableID) { + subnet := d.Get(isSubnetID).(string) + routingTable := d.Get(isRoutingTableID).(string) + + // Construct an instance of the RoutingTableIdentityByID model + routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByID) + routingTableIdentityModel.ID = &routingTable + + // Construct an instance of the ReplaceSubnetRoutingTableOptions model + replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions) + replaceSubnetRoutingTableOptionsModel.ID = &subnet + replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel + resultRT, response, err := sess.ReplaceSubnetRoutingTableWithContext(context, replaceSubnetRoutingTableOptionsModel) + + if err != nil { + log.Printf("[DEBUG] Error while attaching a routing table to a subnet %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error while attaching a routing table to a subnet %s\n%s", err, response)) + } + log.Printf("[INFO] Updated subnet %s with Routing Table : %s", subnet, *resultRT.ID) + + d.SetId(subnet) + return resourceIBMISSubnetRoutingTableAttachmentRead(context, d, meta) + } + + return resourceIBMISSubnetRoutingTableAttachmentRead(context, d, meta) +} + +func resourceIBMISSubnetRoutingTableAttachmentDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + id := d.Id() + sess, err := vpcClient(meta) + if err != nil { + return diag.FromErr(err) + } + // Set the subnet with VPC default routing table + getSubnetOptions := &vpcv1.GetSubnetOptions{ + ID: &id, + } + subnet, response, err := sess.GetSubnetWithContext(context, getSubnetOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error Getting Subnet (%s): %s\n%s", id, err, response)) + } + // Fetch VPC + vpcID := *subnet.VPC.ID + + getvpcOptions := &vpcv1.GetVPCOptions{ + ID: &vpcID, + } + vpc, response, err := sess.GetVPCWithContext(context, getvpcOptions) + if err != nil { + if response != nil && response.StatusCode == 404 { + d.SetId("") + return nil + } + return diag.FromErr(fmt.Errorf("[ERROR] Error getting VPC : %s\n%s", err, response)) + } + + // Fetch default routing table + if vpc.DefaultRoutingTable != nil { + log.Printf("[DEBUG] vpc default routing table is not null :%s", *vpc.DefaultRoutingTable.ID) + // Construct an instance of the RoutingTableIdentityByID model + routingTableIdentityModel := new(vpcv1.RoutingTableIdentityByID) + routingTableIdentityModel.ID = vpc.DefaultRoutingTable.ID + + // Construct an instance of the ReplaceSubnetRoutingTableOptions model + replaceSubnetRoutingTableOptionsModel := new(vpcv1.ReplaceSubnetRoutingTableOptions) + replaceSubnetRoutingTableOptionsModel.ID = &id + replaceSubnetRoutingTableOptionsModel.RoutingTableIdentity = routingTableIdentityModel + resultRT, response, err := sess.ReplaceSubnetRoutingTableWithContext(context, replaceSubnetRoutingTableOptionsModel) + + if err != nil { + log.Printf("[DEBUG] Error while attaching a routing table to a subnet %s\n%s", err, response) + return diag.FromErr(fmt.Errorf("[ERROR] Error while attaching a routing table to a subnet %s\n%s", err, response)) + } + log.Printf("[INFO] Updated subnet %s with VPC default Routing Table : %s", id, *resultRT.ID) + } else { + log.Printf("[DEBUG] vpc default routing table is null") + } + + d.SetId("") + return nil +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_virtual_endpoint_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_virtual_endpoint_gateway.go similarity index 90% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_virtual_endpoint_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_virtual_endpoint_gateway.go index da4e1c2e7e..93cb5c05df 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_virtual_endpoint_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_virtual_endpoint_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" @@ -40,7 +42,7 @@ const ( isVirtualEndpointGatewaySecurityGroups = "security_groups" ) -func resourceIBMISEndpointGateway() *schema.Resource { +func ResourceIBMISEndpointGateway() *schema.Resource { targetNameFmt := fmt.Sprintf("%s.0.%s", isVirtualEndpointGatewayTarget, isVirtualEndpointGatewayTargetName) targetCRNFmt := fmt.Sprintf("%s.0.%s", isVirtualEndpointGatewayTarget, isVirtualEndpointGatewayTargetCRN) return &schema.Resource{ @@ -53,7 +55,7 @@ func resourceIBMISEndpointGateway() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -68,7 +70,7 @@ func resourceIBMISEndpointGateway() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateISName, + ValidateFunc: validate.InvokeValidator("ibm_is_virtual_endpoint_gateway", isVirtualEndpointGatewayName), Description: "Endpoint gateway name", }, isVirtualEndpointGatewayResourceType: { @@ -116,7 +118,7 @@ func resourceIBMISEndpointGateway() *schema.Resource { Optional: true, Computed: true, Description: "Endpoint gateway IPs", - DiffSuppressFunc: applyOnce, + DiffSuppressFunc: flex.ApplyOnce, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ isVirtualEndpointGatewayIPsID: { @@ -180,7 +182,7 @@ func resourceIBMISEndpointGateway() *schema.Resource { isVirtualEndpointGatewayTargetResourceType: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_virtual_endpoint_gateway", isVirtualEndpointGatewayTargetResourceType), + ValidateFunc: validate.InvokeValidator("ibm_is_virtual_endpoint_gateway", isVirtualEndpointGatewayTargetResourceType), Description: "The target resource type", }, }, @@ -196,34 +198,43 @@ func resourceIBMISEndpointGateway() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_virtual_endpoint_gateway", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_virtual_endpoint_gateway", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags for VPE", }, }, } } -func resourceIBMISEndpointGatewayValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMISEndpointGatewayValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ + Identifier: isVirtualEndpointGatewayName, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Required: true, + Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, + MinValueLength: 1, + MaxValueLength: 63}) + validateSchema = append(validateSchema, + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVirtualEndpointGatewayTargetResourceType, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: true, AllowedValues: "provider_cloud_service, provider_infrastructure_service"}) - ibmEndpointGatewayResourceValidator := ResourceValidator{ResourceName: "ibm_is_virtual_endpoint_gateway", Schema: validateSchema} + ibmEndpointGatewayResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_virtual_endpoint_gateway", Schema: validateSchema} return &ibmEndpointGatewayResourceValidator } @@ -264,7 +275,6 @@ func resourceIBMisVirtualEndpointGatewayCreate(d *schema.ResourceData, meta inte if ips, ok := d.GetOk(isVirtualEndpointGatewayIPs); ok { opt.SetIps(expandIPs(ips.([]interface{}))) } - // Security group option var securityGroups *schema.Set if sg, ok := d.GetOk(isVirtualEndpointGatewaySecurityGroups); ok { @@ -280,7 +290,6 @@ func resourceIBMisVirtualEndpointGatewayCreate(d *schema.ResourceData, meta inte opt.SecurityGroups = securityGroupobjs } } - // Resource group option if resourceGroup, ok := d.GetOk(isVirtualEndpointGatewayResourceGroupID); ok { resourceGroupID := resourceGroup.(string) @@ -301,7 +310,7 @@ func resourceIBMisVirtualEndpointGatewayCreate(d *schema.ResourceData, meta inte v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isVirtualEndpointGatewayTags); ok || v != "" { oldList, newList := d.GetChange(isVirtualEndpointGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *result.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *result.CRN) if err != nil { log.Printf( "Error on create of VPE (%s) tags: %s", d.Id(), err) @@ -331,15 +340,14 @@ func resourceIBMisVirtualEndpointGatewayUpdate(d *schema.ResourceData, meta inte } } - id := d.Id() var remove, add []string if d.HasChange(isVirtualEndpointGatewaySecurityGroups) { o, n := d.GetChange(isVirtualEndpointGatewaySecurityGroups) oSecurityGroups := o.(*schema.Set) nSecurityGroups := n.(*schema.Set) - remove = expandStringList(oSecurityGroups.Difference(nSecurityGroups).List()) - add = expandStringList(nSecurityGroups.Difference(oSecurityGroups).List()) + remove = flex.ExpandStringList(oSecurityGroups.Difference(nSecurityGroups).List()) + add = flex.ExpandStringList(nSecurityGroups.Difference(oSecurityGroups).List()) if len(add) > 0 { for _, sgId := range add { createSecurityGroupTargetBindingOptions := &vpcv1.CreateSecurityGroupTargetBindingOptions{} @@ -381,15 +389,14 @@ func resourceIBMisVirtualEndpointGatewayUpdate(d *schema.ResourceData, meta inte } } - if d.HasChange(isVirtualEndpointGatewayTags) { opt := sess.NewGetEndpointGatewayOptions(d.Id()) result, response, err := sess.GetEndpointGateway(opt) if err != nil { - return fmt.Errorf("Error getting VPE: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting VPE: %s\n%s", err, response) } oldList, newList := d.GetChange(isVirtualEndpointGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *result.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *result.CRN) if err != nil { log.Printf( "Error on update of VPE (%s) tags: %s", d.Id(), err) @@ -428,7 +435,7 @@ func resourceIBMisVirtualEndpointGatewayRead(d *schema.ResourceData, meta interf if result.SecurityGroups != nil { d.Set(isVirtualEndpointGatewaySecurityGroups, flattenDataSourceSecurityGroups(result.SecurityGroups)) } - tags, err := GetTagsUsingCRN(meta, *result.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *result.CRN) if err != nil { log.Printf( "Error on get of VPE (%s) tags: %s", d.Id(), err) @@ -437,6 +444,49 @@ func resourceIBMisVirtualEndpointGatewayRead(d *schema.ResourceData, meta interf return nil } +func flattenDataSourceSecurityGroups(securityGroupList []vpcv1.SecurityGroupReference) interface{} { + securitygroupList := make([]string, 0) + for _, securityGroup := range securityGroupList { + if securityGroup.ID != nil { + securityGroupID := *securityGroup.ID + securitygroupList = append(securitygroupList, securityGroupID) + } + } + return securitygroupList +} + +func isWaitForVirtualEndpointGatewayAvailable(sess *vpcv1.VpcV1, endPointGatewayId string, timeout time.Duration) (interface{}, error) { + log.Printf("Waiting for virtual endpoint gateway (%s) to be available.", endPointGatewayId) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"waiting", "pending", "updating"}, + Target: []string{"stable", "failed", ""}, + Refresh: isVirtualEndpointGatewayRefreshFunc(sess, endPointGatewayId), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + } + + return stateConf.WaitForState() +} + +func isVirtualEndpointGatewayRefreshFunc(sess *vpcv1.VpcV1, endPointGatewayId string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + + opt := sess.NewGetEndpointGatewayOptions(endPointGatewayId) + result, response, err := sess.GetEndpointGateway(opt) + if err != nil { + if response != nil && response.StatusCode == 404 { + return nil, "", fmt.Errorf("Error Getting Virtual Endpoint Gateway : %s\n%s", err, response) + } + } + if *result.LifecycleState == "stable" || *result.LifecycleState == "failed" { + return result, *result.LifecycleState, nil + } + return result, *result.LifecycleState, nil + } +} + func resourceIBMisVirtualEndpointGatewayDelete(d *schema.ResourceData, meta interface{}) error { sess, err := vpcClient(meta) if err != nil { @@ -528,46 +578,3 @@ func flattenEndpointGatewayTarget(target *vpcv1.EndpointGatewayTarget) interface targetSlice = append(targetSlice, targetOutput) return targetSlice } - -func flattenDataSourceSecurityGroups(securityGroupList []vpcv1.SecurityGroupReference) interface{} { - securitygroupList := make([]string, 0) - for _, securityGroup := range securityGroupList { - if securityGroup.ID != nil { - securityGroupID := *securityGroup.ID - securitygroupList = append(securitygroupList, securityGroupID) - } - } - return securitygroupList -} - -func isWaitForVirtualEndpointGatewayAvailable(sess *vpcv1.VpcV1, endPointGatewayId string, timeout time.Duration) (interface{}, error) { - log.Printf("Waiting for virtual endpoint gateway (%s) to be available.", endPointGatewayId) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"waiting", "pending", "updating"}, - Target: []string{"stable", "failed", ""}, - Refresh: isVirtualEndpointGatewayRefreshFunc(sess, endPointGatewayId), - Timeout: timeout, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - } - - return stateConf.WaitForState() -} - -func isVirtualEndpointGatewayRefreshFunc(sess *vpcv1.VpcV1, endPointGatewayId string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - - opt := sess.NewGetEndpointGatewayOptions(endPointGatewayId) - result, response, err := sess.GetEndpointGateway(opt) - if err != nil { - if response != nil && response.StatusCode == 404 { - return nil, "", fmt.Errorf("Error Getting Virtual Endpoint Gateway : %s\n%s", err, response) - } - } - if *result.LifecycleState == "stable" || *result.LifecycleState == "failed" { - return result, *result.LifecycleState, nil - } - return result, *result.LifecycleState, nil - } -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_virtual_endpoint_gateway_ip.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_virtual_endpoint_gateway_ip.go similarity index 95% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_virtual_endpoint_gateway_ip.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_virtual_endpoint_gateway_ip.go index 27449e4b7d..0be1209fe5 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_virtual_endpoint_gateway_ip.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_virtual_endpoint_gateway_ip.go @@ -1,13 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -26,7 +27,7 @@ const ( isVirtualEndpointGatewayIPTargetResourceType = "resource_type" ) -func resourceIBMISEndpointGatewayIP() *schema.Resource { +func ResourceIBMISEndpointGatewayIP() *schema.Resource { return &schema.Resource{ Create: resourceIBMisVirtualEndpointGatewayIPCreate, Read: resourceIBMisVirtualEndpointGatewayIPRead, @@ -128,7 +129,7 @@ func resourceIBMisVirtualEndpointGatewayIPRead(d *schema.ResourceData, meta inte if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -156,7 +157,7 @@ func resourceIBMisVirtualEndpointGatewayIPDelete(d *schema.ResourceData, meta in if err != nil { return err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -178,12 +179,12 @@ func resourceIBMisVirtualEndpointGatewayIPExists(d *schema.ResourceData, meta in return false, err } - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of gatewayID/ipID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of gatewayID/ipID", d.Id()) } gatewayID := parts[0] ipID := parts[1] diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_volume.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_volume.go similarity index 81% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_volume.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_volume.go index c5e730f8a2..90e15345e7 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_volume.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_volume.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -40,7 +42,7 @@ const ( isVolumeBandwidth = "bandwidth" ) -func resourceIBMISVolume() *schema.Resource { +func ResourceIBMISVolume() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVolumeCreate, Read: resourceIBMISVolumeRead, @@ -57,12 +59,12 @@ func resourceIBMISVolume() *schema.Resource { CustomizeDiff: customdiff.All( customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceVolumeValidate(diff) + return flex.ResourceVolumeValidate(diff) }), ), @@ -71,14 +73,14 @@ func resourceIBMISVolume() *schema.Resource { isVolumeName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_volume", isVolumeName), + ValidateFunc: validate.InvokeValidator("ibm_is_volume", isVolumeName), Description: "Volume name", }, isVolumeProfileName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_volume", isVolumeProfileName), + ValidateFunc: validate.InvokeValidator("ibm_is_volume", isVolumeProfileName), Description: "Volume profile name", }, @@ -107,7 +109,7 @@ func resourceIBMISVolume() *schema.Resource { Optional: true, Default: 100, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_volume", isVolumeCapacity), + ValidateFunc: validate.InvokeValidator("ibm_is_volume", isVolumeCapacity), Description: "Volume capacity value", }, isVolumeResourceGroup: { @@ -121,7 +123,7 @@ func resourceIBMISVolume() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_volume", isVolumeIops), + ValidateFunc: validate.InvokeValidator("ibm_is_volume", isVolumeIops), Description: "IOPS value for the Volume", }, isVolumeCrn: { @@ -169,36 +171,36 @@ func resourceIBMISVolume() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_volume", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_volume", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "Tags for the volume instance", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -213,52 +215,52 @@ func resourceIBMISVolume() *schema.Resource { } } -func resourceIBMISVolumeValidator() *ResourceValidator { +func ResourceIBMISVolumeValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVolumeName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVolumeProfileName, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: "general-purpose, 5iops-tier, 10iops-tier, custom", }) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVolumeCapacity, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "10", MaxValue: "16000"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVolumeIops, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "100", MaxValue: "48000"}) - ibmISVolumeResourceValidator := ResourceValidator{ResourceName: "ibm_is_volume", Schema: validateSchema} + ibmISVolumeResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_volume", Schema: validateSchema} return &ibmISVolumeResourceValidator } @@ -333,7 +335,7 @@ func volCreate(d *schema.ResourceData, meta interface{}, volName, profile, zone v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isVolumeTags); ok || v != "" { oldList, newList := d.GetChange(isVolumeTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *vol.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *vol.CRN) if err != nil { log.Printf( "Error on create of resource Volume (%s) tags: %s", d.Id(), err) @@ -366,7 +368,7 @@ func volGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting Volume (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting Volume (%s): %s\n%s", id, err, response) } d.SetId(*vol.ID) d.Set(isVolumeName, *vol.Name) @@ -399,22 +401,22 @@ func volGet(d *schema.ResourceData, meta interface{}, id string) error { } d.Set(isVolumeStatusReasons, statusReasonsList) } - tags, err := GetTagsUsingCRN(meta, *vol.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *vol.CRN) if err != nil { log.Printf( "Error on get of resource vpc volume (%s) tags: %s", d.Id(), err) } d.Set(isVolumeTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc-ext/storage/storageVolumes") - d.Set(ResourceName, *vol.Name) - d.Set(ResourceCRN, *vol.CRN) - d.Set(ResourceStatus, *vol.Status) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/storage/storageVolumes") + d.Set(flex.ResourceName, *vol.Name) + d.Set(flex.ResourceCRN, *vol.CRN) + d.Set(flex.ResourceStatus, *vol.Status) if vol.ResourceGroup != nil { - d.Set(ResourceGroupName, vol.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, vol.ResourceGroup.Name) d.Set(isVolumeResourceGroup, *vol.ResourceGroup.ID) } return nil @@ -460,10 +462,10 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam } vol, response, err := sess.GetVolume(options) if err != nil { - return fmt.Errorf("Error getting Volume : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Volume : %s\n%s", err, response) } oldList, newList := d.GetChange(isVolumeTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *vol.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *vol.CRN) if err != nil { log.Printf( "Error on update of resource vpc volume (%s) tags: %s", id, err) @@ -480,7 +482,7 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam volumeNamePatchModel.Name = &name volumeNamePatch, err := volumeNamePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for volumeNamePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for volumeNamePatch: %s", err) } options.VolumePatch = volumeNamePatch _, _, err = sess.UpdateVolume(options) @@ -499,10 +501,10 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam } vol, response, err := sess.GetVolume(getvoloptions) if err != nil || vol == nil { - return fmt.Errorf("Error retrieving Volume (%s) details: %s\n%s", volId, err, response) + return fmt.Errorf("[ERROR] Error retrieving Volume (%s) details: %s\n%s", volId, err, response) } if vol.VolumeAttachments == nil || len(vol.VolumeAttachments) < 1 { - return fmt.Errorf("Error updating Volume profile/iops because the specified volume %s is not attached to a virtual server instance ", volId) + return fmt.Errorf("[ERROR] Error updating Volume profile/iops because the specified volume %s is not attached to a virtual server instance ", volId) } volAtt := &vol.VolumeAttachments[0] insId := *volAtt.Instance.ID @@ -511,7 +513,7 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam } instance, response, err := sess.GetInstance(getinsOptions) if err != nil || instance == nil { - return fmt.Errorf("Error retrieving Instance (%s) to which the volume (%s) is attached : %s\n%s", insId, volId, err, response) + return fmt.Errorf("[ERROR] Error retrieving Instance (%s) to which the volume (%s) is attached : %s\n%s", insId, volId, err, response) } if instance != nil && *instance.Status != "running" { actiontype := "start" @@ -521,7 +523,7 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam } _, response, err = sess.CreateInstanceAction(createinsactoptions) if err != nil { - return fmt.Errorf("Error starting Instance (%s) to which the volume (%s) is attached : %s\n%s", insId, volId, err, response) + return fmt.Errorf("[ERROR] Error starting Instance (%s) to which the volume (%s) is attached : %s\n%s", insId, volId, err, response) } _, err = isWaitForInstanceAvailable(sess, insId, d.Timeout(schema.TimeoutCreate), d) if err != nil { @@ -544,7 +546,7 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam volumeProfilePatch, err := volumeProfilePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for VolumeProfilePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for VolumeProfilePatch: %s", err) } options.VolumePatch = volumeProfilePatch _, response, err = sess.UpdateVolume(options) @@ -566,10 +568,10 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam d.SetId("") return nil } - return fmt.Errorf("Error Getting Volume (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Volume (%s): %s\n%s", id, err, response) } if vol.VolumeAttachments == nil || len(vol.VolumeAttachments) == 0 || *vol.VolumeAttachments[0].ID == "" { - return fmt.Errorf("Error volume capacity can't be updated since volume %s is not attached to any instance for VolumePatch", id) + return fmt.Errorf("[ERROR] Error volume capacity can't be updated since volume %s is not attached to any instance for VolumePatch", id) } insId := vol.VolumeAttachments[0].Instance.ID getinsOptions := &vpcv1.GetInstanceOptions{ @@ -577,7 +579,7 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam } instance, response, err := sess.GetInstance(getinsOptions) if err != nil || instance == nil { - return fmt.Errorf("Error retrieving Instance (%s) : %s\n%s", *insId, err, response) + return fmt.Errorf("[ERROR] Error retrieving Instance (%s) : %s\n%s", *insId, err, response) } if instance != nil && *instance.Status != "running" { actiontype := "start" @@ -587,7 +589,7 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam } _, response, err = sess.CreateInstanceAction(createinsactoptions) if err != nil { - return fmt.Errorf("Error starting Instance (%s) : %s\n%s", *insId, err, response) + return fmt.Errorf("[ERROR] Error starting Instance (%s) : %s\n%s", *insId, err, response) } _, err = isWaitForInstanceAvailable(sess, *insId, d.Timeout(schema.TimeoutCreate), d) if err != nil { @@ -600,12 +602,12 @@ func volUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasNam volumeCapacityPatch, err := volumeCapacityPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for volumeCapacityPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for volumeCapacityPatch: %s", err) } options.VolumePatch = volumeCapacityPatch _, response, err = sess.UpdateVolume(options) if err != nil { - return fmt.Errorf("Error updating vpc volume: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating vpc volume: %s\n%s", err, response) } _, err = isWaitForVolumeAvailable(sess, d.Id(), d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -640,7 +642,7 @@ func volDelete(d *schema.ResourceData, meta interface{}, id string) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error getting Volume (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error getting Volume (%s): %s\n%s", id, err, response) } if volDetails.VolumeAttachments != nil { @@ -651,7 +653,7 @@ func volDelete(d *schema.ResourceData, meta interface{}, id string) error { } _, err := sess.DeleteInstanceVolumeAttachment(deleteVolumeAttachment) if err != nil { - return fmt.Errorf("Error while removing volume attachment %q for instance %s: %q", *volAtt.ID, *volAtt.Instance.ID, err) + return fmt.Errorf("[ERROR] Error while removing volume attachment %q for instance %s: %q", *volAtt.ID, *volAtt.Instance.ID, err) } _, err = isWaitForInstanceVolumeDetached(sess, d, d.Id(), *volAtt.ID) if err != nil { @@ -666,7 +668,7 @@ func volDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteVolume(options) if err != nil { - return fmt.Errorf("Error deleting Volume : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting Volume : %s\n%s", err, response) } _, err = isWaitForVolumeDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -701,7 +703,7 @@ func isVolumeDeleteRefreshFunc(vol *vpcv1.VpcV1, id string) resource.StateRefres if response != nil && response.StatusCode == 404 { return vol, isVolumeDeleted, nil } - return vol, "", fmt.Errorf("Error getting Volume: %s\n%s", err, response) + return vol, "", fmt.Errorf("[ERROR] Error getting Volume: %s\n%s", err, response) } return vol, isVolumeDeleting, err } @@ -728,7 +730,7 @@ func volExists(d *schema.ResourceData, meta interface{}, id string) (bool, error if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Volume: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Volume: %s\n%s", err, response) } return true, nil } @@ -755,7 +757,7 @@ func isVolumeRefreshFunc(client *vpcv1.VpcV1, id string) resource.StateRefreshFu } vol, response, err := client.GetVolume(volgetoptions) if err != nil { - return nil, "", fmt.Errorf("Error getting volume: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error getting volume: %s\n%s", err, response) } if *vol.Status == "available" { @@ -771,7 +773,7 @@ func deleteAllSnapshots(sess *vpcv1.VpcV1, id string) error { delete_all_snapshots.SourceVolumeID = &id response, err := sess.DeleteSnapshots(delete_all_snapshots) if err != nil { - return fmt.Errorf("Error deleting snapshots from volume %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error deleting snapshots from volume %s\n%s", err, response) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc.go index cdb6eaaa8f..538c71bd98 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc.go @@ -1,16 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( - "bytes" "context" "fmt" "log" "os" "reflect" - "strings" "time" "github.com/IBM/vpc-go-sdk/vpcv1" @@ -18,7 +16,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" ) const ( @@ -61,7 +60,7 @@ const ( isVPCSecurityGroupID = "group_id" ) -func resourceIBMISVPC() *schema.Resource { +func ResourceIBMISVPC() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVPCCreate, Read: resourceIBMISVPCRead, @@ -77,7 +76,7 @@ func resourceIBMISVPC() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -88,7 +87,7 @@ func resourceIBMISVPC() *schema.Resource { Default: "auto", DiffSuppressFunc: suppressNullAddPrefix, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_vpc", isVPCAddressPrefixManagement), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc", isVPCAddressPrefixManagement), Description: "Address Prefix management value", }, @@ -119,7 +118,7 @@ func resourceIBMISVPC() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_vpc", isVPCName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc", isVPCName), Description: "VPC name", }, @@ -127,7 +126,7 @@ func resourceIBMISVPC() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_vpc", isVPCDefaultNetworkACLName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc", isVPCDefaultNetworkACLName), Description: "Default Network ACL name", }, @@ -135,7 +134,7 @@ func resourceIBMISVPC() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_vpc", isVPCDefaultSecurityGroupName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc", isVPCDefaultSecurityGroupName), Description: "Default security group name", }, @@ -155,7 +154,7 @@ func resourceIBMISVPC() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_vpc", isVPCDefaultRoutingTableName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc", isVPCDefaultRoutingTableName), Description: "Default routing table name", }, @@ -182,8 +181,8 @@ func resourceIBMISVPC() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_vpc", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_vpc", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "List of tags", }, @@ -193,30 +192,30 @@ func resourceIBMISVPC() *schema.Resource { Description: "The crn of the resource", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -368,67 +367,67 @@ func resourceIBMISVPC() *schema.Resource { } } -func resourceIBMISVPCValidator() *ResourceValidator { +func ResourceIBMISVPCValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) address_prefix_management := "auto, manual" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCAddressPrefixManagement, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, Default: "auto", AllowedValues: address_prefix_management}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCDefaultNetworkACLName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCDefaultSecurityGroupName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCDefaultRoutingTableName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISVPCResourceValidator := ResourceValidator{ResourceName: "ibm_is_vpc", Schema: validateSchema} + ibmISVPCResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_vpc", Schema: validateSchema} return &ibmISVPCResourceValidator } @@ -477,7 +476,7 @@ func vpcCreate(d *schema.ResourceData, meta interface{}, name, apm, rg string, i vpc, response, err := sess.CreateVPC(options) if err != nil { - return fmt.Errorf("Error while creating VPC %s ", beautifyError(err, response)) + return fmt.Errorf("[ERROR] Error while creating VPC %s ", flex.BeautifyError(err, response)) } d.SetId(*vpc.ID) @@ -501,7 +500,7 @@ func vpcCreate(d *schema.ResourceData, meta interface{}, name, apm, rg string, i v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isVPCTags); ok || v != "" { oldList, newList := d.GetChange(isVPCTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *vpc.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *vpc.CRN) if err != nil { log.Printf( "Error on create of resource vpc (%s) tags: %s", d.Id(), err) @@ -532,7 +531,7 @@ func isVPCRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.StateRefreshFunc { } vpc, response, err := vpc.GetVPC(getvpcOptions) if err != nil { - return nil, isVPCFailed, fmt.Errorf("Error getting VPC : %s\n%s", err, response) + return nil, isVPCFailed, fmt.Errorf("[ERROR] Error getting VPC : %s\n%s", err, response) } if *vpc.Status == isVPCAvailable || *vpc.Status == isVPCFailed { @@ -566,7 +565,7 @@ func vpcGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error getting VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting VPC : %s\n%s", err, response) } d.Set(isVPCName, *vpc.Name) @@ -592,24 +591,24 @@ func vpcGet(d *schema.ResourceData, meta interface{}, id string) error { d.Set(isVPCDefaultRoutingTable, *vpc.DefaultRoutingTable.ID) d.Set(isVPCDefaultRoutingTableName, *vpc.DefaultRoutingTable.Name) } - tags, err := GetTagsUsingCRN(meta, *vpc.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *vpc.CRN) if err != nil { log.Printf( "Error on get of resource vpc (%s) tags: %s", d.Id(), err) } d.Set(isVPCTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } d.Set(isVPCCRN, *vpc.CRN) - d.Set(ResourceControllerURL, controller+"/vpc-ext/network/vpcs") - d.Set(ResourceName, *vpc.Name) - d.Set(ResourceCRN, *vpc.CRN) - d.Set(ResourceStatus, *vpc.Status) + d.Set(flex.ResourceControllerURL, controller+"/vpc-ext/network/vpcs") + d.Set(flex.ResourceName, *vpc.Name) + d.Set(flex.ResourceCRN, *vpc.CRN) + d.Set(flex.ResourceStatus, *vpc.Status) if vpc.ResourceGroup != nil { d.Set(isVPCResourceGroup, *vpc.ResourceGroup.ID) - d.Set(ResourceGroupName, *vpc.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *vpc.ResourceGroup.Name) } //set the cse ip addresses info if vpc.CseSourceIps != nil { @@ -634,9 +633,9 @@ func vpcGet(d *schema.ResourceData, meta interface{}, id string) error { } s, response, err := sess.ListSubnets(options) if err != nil { - return fmt.Errorf("Error Fetching subnets %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Fetching subnets %s\n%s", err, response) } - start = GetNext(s.Next) + start = flex.GetNext(s.Next) allrecs = append(allrecs, s.Subnets...) if start == "" { break @@ -808,10 +807,10 @@ func vpcUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasCha } vpc, response, err := sess.GetVPC(getvpcOptions) if err != nil { - return fmt.Errorf("Error getting VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting VPC : %s\n%s", err, response) } oldList, newList := d.GetChange(isVPCTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *vpc.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *vpc.CRN) if err != nil { log.Printf( "Error on update of resource vpc (%s) tags: %s", d.Id(), err) @@ -843,12 +842,12 @@ func vpcUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasCha } vpcPatch, err := vpcPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for VPCPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for VPCPatch: %s", err) } updateVpcOptions.VPCPatch = vpcPatch _, response, err := sess.UpdateVPC(updateVpcOptions) if err != nil { - return fmt.Errorf("Error Updating VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating VPC : %s\n%s", err, response) } } return nil @@ -879,7 +878,7 @@ func vpcDelete(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting VPC (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting VPC (%s): %s\n%s", id, err, response) } deletevpcOptions := &vpcv1.DeleteVPCOptions{ @@ -887,7 +886,7 @@ func vpcDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteVPC(deletevpcOptions) if err != nil { - return fmt.Errorf("Error Deleting VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting VPC : %s\n%s", err, response) } _, err = isWaitForVPCDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -923,7 +922,7 @@ func isVPCDeleteRefreshFunc(vpc *vpcv1.VpcV1, id string) resource.StateRefreshFu if response != nil && response.StatusCode == 404 { return vpc, isVPCDeleted, nil } - return nil, isVPCFailed, fmt.Errorf("The VPC %s failed to delete: %s\n%s", id, err, response) + return nil, isVPCFailed, fmt.Errorf("[ERROR] The VPC %s failed to delete: %s\n%s", id, err, response) } return vpc, isVPCDeleting, nil @@ -949,17 +948,17 @@ func vpcExists(d *schema.ResourceData, meta interface{}, id string) (bool, error if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting VPC: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting VPC: %s\n%s", err, response) } return true, nil } -func resourceIBMVPCHash(v interface{}) int { - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("%s", - strings.ToLower(v.(string)))) - return hashcode.String(buf.String()) -} +// func ResourceIBMVPCHash(v interface{}) int { +// var buf bytes.Buffer +// buf.WriteString(fmt.Sprintf("%s", +// strings.ToLower(v.(string)))) +// return conns.String(buf.String()) +// } func nwaclNameUpdate(sess *vpcv1.VpcV1, id, name string) error { updateNetworkACLOptions := &vpcv1.UpdateNetworkACLOptions{ @@ -970,12 +969,12 @@ func nwaclNameUpdate(sess *vpcv1.VpcV1, id, name string) error { } networkACLPatch, err := networkACLPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for NetworkACLPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for NetworkACLPatch: %s", err) } updateNetworkACLOptions.NetworkACLPatch = networkACLPatch _, response, err := sess.UpdateNetworkACL(updateNetworkACLOptions) if err != nil { - return fmt.Errorf("Error Updating Network ACL(%s) name : %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Updating Network ACL(%s) name : %s\n%s", id, err, response) } return nil } @@ -989,12 +988,12 @@ func sgNameUpdate(sess *vpcv1.VpcV1, id, name string) error { } securityGroupPatch, err := securityGroupPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for SecurityGroupPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for SecurityGroupPatch: %s", err) } updateSecurityGroupOptions.SecurityGroupPatch = securityGroupPatch _, response, err := sess.UpdateSecurityGroup(updateSecurityGroupOptions) if err != nil { - return fmt.Errorf("Error Updating Security Group name : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Security Group name : %s\n%s", err, response) } return nil } @@ -1007,12 +1006,12 @@ func rtNameUpdate(sess *vpcv1.VpcV1, vpcID, id, name string) error { routingTablePatchModel.Name = &name routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch() if asPatchErr != nil { - return fmt.Errorf("Error calling asPatch for RoutingTablePatchModel: %s", asPatchErr) + return fmt.Errorf("[ERROR] Error calling asPatch for RoutingTablePatchModel: %s", asPatchErr) } updateVpcRoutingTableOptions.RoutingTablePatch = routingTablePatchModelAsPatch _, response, err := sess.UpdateVPCRoutingTable(updateVpcRoutingTableOptions) if err != nil { - return fmt.Errorf("Error Updating Routing table name %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating Routing table name %s\n%s", err, response) } return nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_address_prefix.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_address_prefix.go similarity index 75% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_address_prefix.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_address_prefix.go index f24026b975..c9a1348cc9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_address_prefix.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_address_prefix.go @@ -1,11 +1,14 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -17,9 +20,10 @@ const ( isVPCAddressPrefixVPCID = "vpc" isVPCAddressPrefixHasSubnets = "has_subnets" isVPCAddressPrefixDefault = "is_default" + isAddressPrefix = "address_prefix" ) -func resourceIBMISVpcAddressPrefix() *schema.Resource { +func ResourceIBMISVpcAddressPrefix() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVpcAddressPrefixCreate, Read: resourceIBMISVpcAddressPrefixRead, @@ -33,7 +37,7 @@ func resourceIBMISVpcAddressPrefix() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_address_prefix", isVPCAddressPrefixPrefixName), + ValidateFunc: validate.InvokeValidator("ibm_is_address_prefix", isVPCAddressPrefixPrefixName), Description: "Name", }, isVPCAddressPrefixZoneName: { @@ -47,7 +51,7 @@ func resourceIBMISVpcAddressPrefix() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_address_prefix", isVPCAddressPrefixCIDR), + ValidateFunc: validate.InvokeValidator("ibm_is_address_prefix", isVPCAddressPrefixCIDR), Description: "CIDIR address prefix", }, isVPCAddressPrefixDefault: { @@ -70,43 +74,49 @@ func resourceIBMISVpcAddressPrefix() *schema.Resource { Description: "Boolean value, set to true if VPC instance have subnets", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the VPC resource", }, + + isAddressPrefix: { + Type: schema.TypeString, + Computed: true, + Description: "The unique identifier of the address prefix", + }, }, } } -func resourceIBMISAddressPrefixValidator() *ResourceValidator { +func ResourceIBMISAddressPrefixValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCAddressPrefixPrefixName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCRouteDestinationCIDR, - ValidateFunctionIdentifier: ValidateCIDRAddress, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateCIDRAddress, + Type: validate.TypeString, ForceNew: true, Required: true}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCAddressPrefixCIDR, - ValidateFunctionIdentifier: ValidateOverlappingAddress, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateOverlappingAddress, + Type: validate.TypeString, ForceNew: true, Required: true}) - ibmISAddressPrefixResourceValidator := ResourceValidator{ResourceName: "ibm_is_address_prefix", Schema: validateSchema} + ibmISAddressPrefixResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_address_prefix", Schema: validateSchema} return &ibmISAddressPrefixResourceValidator } @@ -122,8 +132,8 @@ func resourceIBMISVpcAddressPrefixCreate(d *schema.ResourceData, meta interface{ } isVPCAddressPrefixKey := "vpc_address_prefix_key_" + vpcID - ibmMutexKV.Lock(isVPCAddressPrefixKey) - defer ibmMutexKV.Unlock(isVPCAddressPrefixKey) + conns.IbmMutexKV.Lock(isVPCAddressPrefixKey) + defer conns.IbmMutexKV.Unlock(isVPCAddressPrefixKey) err := vpcAddressPrefixCreate(d, meta, prefixName, zoneName, cidr, vpcID, isDefault) if err != nil { @@ -148,16 +158,17 @@ func vpcAddressPrefixCreate(d *schema.ResourceData, meta interface{}, name, zone } addrPrefix, response, err := sess.CreateVPCAddressPrefix(options) if err != nil { - return fmt.Errorf("Error while creating VPC Address Prefix %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating VPC Address Prefix %s\n%s", err, response) } addrPrefixID := *addrPrefix.ID d.SetId(fmt.Sprintf("%s/%s", vpcID, addrPrefixID)) + d.Set(isAddressPrefix, addrPrefixID) return nil } func resourceIBMISVpcAddressPrefixRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -187,7 +198,7 @@ func vpcAddressPrefixGet(d *schema.ResourceData, meta interface{}, vpcID, addrPr d.SetId("") return nil } - return fmt.Errorf("Error Getting VPC Address Prefix (%s): %s\n%s", addrPrefixID, err, response) + return fmt.Errorf("[ERROR] Error Getting VPC Address Prefix (%s): %s\n%s", addrPrefixID, err, response) } d.Set(isVPCAddressPrefixVPCID, vpcID) d.Set(isVPCAddressPrefixDefault, *addrPrefix.IsDefault) @@ -197,14 +208,15 @@ func vpcAddressPrefixGet(d *schema.ResourceData, meta interface{}, vpcID, addrPr } d.Set(isVPCAddressPrefixCIDR, *addrPrefix.CIDR) d.Set(isVPCAddressPrefixHasSubnets, *addrPrefix.HasSubnets) + d.Set(isAddressPrefix, addrPrefixID) getVPCOptions := &vpcv1.GetVPCOptions{ ID: &vpcID, } vpc, response, err := sess.GetVPC(getVPCOptions) if err != nil { - return fmt.Errorf("Error Getting VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting VPC : %s\n%s", err, response) } - d.Set(RelatedCRN, *vpc.CRN) + d.Set(flex.RelatedCRN, *vpc.CRN) return nil } @@ -216,7 +228,7 @@ func resourceIBMISVpcAddressPrefixUpdate(d *schema.ResourceData, meta interface{ hasNameChanged := false hasIsDefaultChanged := false - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -224,8 +236,8 @@ func resourceIBMISVpcAddressPrefixUpdate(d *schema.ResourceData, meta interface{ addrPrefixID := parts[1] isVPCAddressPrefixKey := "vpc_address_prefix_key_" + vpcID - ibmMutexKV.Lock(isVPCAddressPrefixKey) - defer ibmMutexKV.Unlock(isVPCAddressPrefixKey) + conns.IbmMutexKV.Lock(isVPCAddressPrefixKey) + defer conns.IbmMutexKV.Unlock(isVPCAddressPrefixKey) if d.HasChange(isVPCAddressPrefixPrefixName) { name = d.Get(isVPCAddressPrefixPrefixName).(string) @@ -263,12 +275,12 @@ func vpcAddressPrefixUpdate(d *schema.ResourceData, meta interface{}, vpcID, add } addressPrefixPatch, err := addressPrefixPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for AddressPrefixPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for AddressPrefixPatch: %s", err) } updatevpcAddressPrefixoptions.AddressPrefixPatch = addressPrefixPatch _, response, err := sess.UpdateVPCAddressPrefix(updatevpcAddressPrefixoptions) if err != nil { - return fmt.Errorf("Error Updating VPC Address Prefix: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating VPC Address Prefix: %s\n%s", err, response) } } return nil @@ -276,7 +288,7 @@ func vpcAddressPrefixUpdate(d *schema.ResourceData, meta interface{}, vpcID, add func resourceIBMISVpcAddressPrefixDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -284,8 +296,8 @@ func resourceIBMISVpcAddressPrefixDelete(d *schema.ResourceData, meta interface{ addrPrefixID := parts[1] isVPCAddressPrefixKey := "vpc_address_prefix_key_" + vpcID - ibmMutexKV.Lock(isVPCAddressPrefixKey) - defer ibmMutexKV.Unlock(isVPCAddressPrefixKey) + conns.IbmMutexKV.Lock(isVPCAddressPrefixKey) + defer conns.IbmMutexKV.Unlock(isVPCAddressPrefixKey) error := vpcAddressPrefixDelete(d, meta, vpcID, addrPrefixID) if error != nil { @@ -311,7 +323,7 @@ func vpcAddressPrefixDelete(d *schema.ResourceData, meta interface{}, vpcID, add if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Getting VPC Address Prefix (%s): %s\n%s", addrPrefixID, err, response) + return fmt.Errorf("[ERROR] Error Getting VPC Address Prefix (%s): %s\n%s", addrPrefixID, err, response) } deletevpcAddressPrefixOptions := &vpcv1.DeleteVPCAddressPrefixOptions{ @@ -323,7 +335,7 @@ func vpcAddressPrefixDelete(d *schema.ResourceData, meta interface{}, vpcID, add if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Deleting VPC Address Prefix (%s): %s\n%s", addrPrefixID, err, response) + return fmt.Errorf("[ERROR] Error Deleting VPC Address Prefix (%s): %s\n%s", addrPrefixID, err, response) } d.SetId("") return nil @@ -331,9 +343,9 @@ func vpcAddressPrefixDelete(d *schema.ResourceData, meta interface{}, vpcID, add func resourceIBMISVpcAddressPrefixExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of vpcID/addrPrefixID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of vpcID/addrPrefixID", d.Id()) } if err != nil { return false, err @@ -359,7 +371,7 @@ func vpcAddressPrefixExists(d *schema.ResourceData, meta interface{}, vpcID, add if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting VPC Address Prefix: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting VPC Address Prefix: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_route.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_route.go similarity index 82% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_route.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_route.go index 2247a67f57..6f33a4477b 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_route.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_route.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -30,7 +32,7 @@ const ( isRouteStatusDeleted = "deleted" ) -func resourceIBMISVpcRoute() *schema.Resource { +func ResourceIBMISVpcRoute() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVpcRouteCreate, Read: resourceIBMISVpcRouteRead, @@ -49,7 +51,7 @@ func resourceIBMISVpcRoute() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_route", isVPCRouteName), + ValidateFunc: validate.InvokeValidator("ibm_is_route", isVPCRouteName), Description: "VPC route name", }, isVPCRouteLocation: { @@ -63,7 +65,7 @@ func resourceIBMISVpcRoute() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: InvokeValidator("ibm_is_route", isVPCRouteDestinationCIDR), + ValidateFunc: validate.InvokeValidator("ibm_is_route", isVPCRouteDestinationCIDR), Description: "VPC route destination CIDR value", }, @@ -86,7 +88,7 @@ func resourceIBMISVpcRoute() *schema.Resource { Description: "VPC route next hop value", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the VPC resource", @@ -95,27 +97,27 @@ func resourceIBMISVpcRoute() *schema.Resource { } } -func resourceIBMISRouteValidator() *ResourceValidator { +func ResourceIBMISRouteValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCRouteName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPCRouteDestinationCIDR, - ValidateFunctionIdentifier: ValidateCIDRAddress, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateCIDRAddress, + Type: validate.TypeString, ForceNew: true, Required: true}) - ibmISRouteResourceValidator := ResourceValidator{ResourceName: "ibm_is_route", Schema: validateSchema} + ibmISRouteResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_route", Schema: validateSchema} return &ibmISRouteResourceValidator } @@ -151,7 +153,7 @@ func vpcRouteCreate(d *schema.ResourceData, meta interface{}, routeName, zoneNam } route, response, err := sess.CreateVPCRoute(createRouteOptions) if err != nil { - return fmt.Errorf("Error while creating VPC Route err %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error while creating VPC Route err %s\n%s", err, response) } routeID := *route.ID @@ -176,7 +178,7 @@ func isWaitForRouteStable(sess *vpcv1.VpcV1, d *schema.ResourceData, vpcID, rout } route, response, err := sess.GetVPCRoute(getVpcRouteOptions) if err != nil { - return route, "", fmt.Errorf("Error Getting VPC Route: %s\n%s", err, response) + return route, "", fmt.Errorf("[ERROR] Error Getting VPC Route: %s\n%s", err, response) } if *route.LifecycleState == "stable" || *route.LifecycleState == "failed" { @@ -194,7 +196,7 @@ func isWaitForRouteStable(sess *vpcv1.VpcV1, d *schema.ResourceData, vpcID, rout func resourceIBMISVpcRouteRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -223,7 +225,7 @@ func vpcRouteGet(d *schema.ResourceData, meta interface{}, vpcID, routeID string d.SetId("") return nil } - return fmt.Errorf("Error Getting VPC Route (%s): %s\n%s", routeID, err, response) + return fmt.Errorf("[ERROR] Error Getting VPC Route (%s): %s\n%s", routeID, err, response) } d.Set(isVPCRouteVPCID, vpcID) d.Set(isVPCRouteName, route.Name) @@ -239,9 +241,9 @@ func vpcRouteGet(d *schema.ResourceData, meta interface{}, vpcID, routeID string } vpc, response, err := sess.GetVPC(getVPCOptions) if err != nil { - return fmt.Errorf("Error Getting VPC : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting VPC : %s\n%s", err, response) } - d.Set(RelatedCRN, *vpc.CRN) + d.Set(flex.RelatedCRN, *vpc.CRN) return nil } @@ -251,7 +253,7 @@ func resourceIBMISVpcRouteUpdate(d *schema.ResourceData, meta interface{}) error name := "" hasChanged := false - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -286,19 +288,19 @@ func vpcRouteUpdate(d *schema.ResourceData, meta interface{}, vpcID, routeID, na } routePatch, err := routePatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for RoutePatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for RoutePatch: %s", err) } updateVpcRouteOptions.RoutePatch = routePatch _, response, err := sess.UpdateVPCRoute(updateVpcRouteOptions) if err != nil { - return fmt.Errorf("Error Updating VPC Route: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Updating VPC Route: %s\n%s", err, response) } } return nil } func resourceIBMISVpcRouteDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -328,7 +330,7 @@ func vpcRouteDelete(d *schema.ResourceData, meta interface{}, vpcID, routeID str if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Getting VPC Route (%s): %s\n%s", routeID, err, response) + return fmt.Errorf("[ERROR] Error Getting VPC Route (%s): %s\n%s", routeID, err, response) } deleteRouteOptions := &vpcv1.DeleteVPCRouteOptions{ VPCID: &vpcID, @@ -336,7 +338,7 @@ func vpcRouteDelete(d *schema.ResourceData, meta interface{}, vpcID, routeID str } response, err = sess.DeleteVPCRoute(deleteRouteOptions) if err != nil { - return fmt.Errorf("Error Deleting VPC Route: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting VPC Route: %s\n%s", err, response) } _, err = isWaitForVPCRouteDeleted(sess, vpcID, routeID, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -362,7 +364,7 @@ func isWaitForVPCRouteDeleted(sess *vpcv1.VpcV1, vpcID, routeID string, timeout if response != nil && response.StatusCode == 404 { return route, isRouteStatusDeleted, nil } - return route, isRouteStatusDeleting, fmt.Errorf("The VPC route %s failed to delete: %s\n%s", routeID, err, response) + return route, isRouteStatusDeleting, fmt.Errorf("[ERROR] The VPC route %s failed to delete: %s\n%s", routeID, err, response) } return route, isRouteStatusDeleting, nil }, @@ -375,12 +377,12 @@ func isWaitForVPCRouteDeleted(sess *vpcv1.VpcV1, vpcID, routeID string, timeout } func resourceIBMISVpcRouteExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of vpcID/routeID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of vpcID/routeID", d.Id()) } vpcID := parts[0] routeID := parts[1] @@ -402,7 +404,7 @@ func vpcRouteExists(d *schema.ResourceData, meta interface{}, vpcID, routeID str if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting VPC Route: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting VPC Route: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_routing_table.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_routing_table.go similarity index 89% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_routing_table.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_routing_table.go index 274df647cd..62c2d5d6aa 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_routing_table.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_routing_table.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -34,7 +35,7 @@ const ( rtOrigin = "origin" ) -func resourceIBMISVPCRoutingTable() *schema.Resource { +func ResourceIBMISVPCRoutingTable() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVPCRoutingTableCreate, Read: resourceIBMISVPCRoutingTableRead, @@ -81,7 +82,7 @@ func resourceIBMISVPCRoutingTable() *schema.Resource { Optional: true, ForceNew: false, Computed: true, - ValidateFunc: InvokeValidator("ibm_is_vpc_routing_table", rtName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc_routing_table", rtName), Description: "The user-defined name for this routing table.", }, rtID: { @@ -136,30 +137,30 @@ func resourceIBMISVPCRoutingTable() *schema.Resource { } } -func resourceIBMISVPCRoutingTableValidator() *ResourceValidator { +func ResourceIBMISVPCRoutingTableValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) actionAllowedValues := "delegate, delegate_vpc, deliver, drop" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: rtName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: false, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: rtAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: false, AllowedValues: actionAllowedValues}) - ibmISVPCRoutingTableValidator := ResourceValidator{ResourceName: "ibm_is_vpc_routing_table", Schema: validateSchema} + ibmISVPCRoutingTableValidator := validate.ResourceValidator{ResourceName: "ibm_is_vpc_routing_table", Schema: validateSchema} return &ibmISVPCRoutingTableValidator } @@ -211,7 +212,7 @@ func resourceIBMISVPCRoutingTableRead(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } - return fmt.Errorf("Error Getting VPC Routing table: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting VPC Routing table: %s\n%s", err, response) } d.Set(rtID, routeTable.ID) @@ -271,7 +272,7 @@ func resourceIBMISVPCRoutingTableUpdate(d *schema.ResourceData, meta interface{} } routingTablePatchModelAsPatch, asPatchErr := routingTablePatchModel.AsPatch() if asPatchErr != nil { - return fmt.Errorf("Error calling asPatch for RoutingTablePatchModel: %s", asPatchErr) + return fmt.Errorf("[ERROR] Error calling asPatch for RoutingTablePatchModel: %s", asPatchErr) } updateVpcRoutingTableOptions.RoutingTablePatch = routingTablePatchModelAsPatch _, response, err := sess.UpdateVPCRoutingTable(updateVpcRoutingTableOptions) @@ -309,7 +310,7 @@ func resourceIBMISVPCRoutingTableExists(d *schema.ResourceData, meta interface{} idSet := strings.Split(d.Id(), "/") if len(idSet) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of vpcID/routingTableID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of vpcID/routingTableID", d.Id()) } getVpcRoutingTableOptions := sess.NewGetVPCRoutingTableOptions(idSet[0], idSet[1]) _, response, err := sess.GetVPCRoutingTable(getVpcRoutingTableOptions) @@ -318,7 +319,7 @@ func resourceIBMISVPCRoutingTableExists(d *schema.ResourceData, meta interface{} d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting VPC Routing table : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting VPC Routing table : %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_routing_table_route.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_routing_table_route.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_routing_table_route.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_routing_table_route.go index 20d8a56e45..87b0c4fea9 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpc_routing_table_route.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpc_routing_table_route.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -24,7 +25,7 @@ const ( rZone = "zone" ) -func resourceIBMISVPCRoutingTableRoute() *schema.Resource { +func ResourceIBMISVPCRoutingTableRoute() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVPCRoutingTableRouteCreate, Read: resourceIBMISVPCRoutingTableRouteRead, @@ -76,7 +77,7 @@ func resourceIBMISVPCRoutingTableRoute() *schema.Resource { ForceNew: true, Default: "deliver", Description: "The action to perform with a packet matching the route.", - ValidateFunc: InvokeValidator("ibm_is_vpc_routing_table_route", rAction), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc_routing_table_route", rAction), }, rName: { Type: schema.TypeString, @@ -84,7 +85,7 @@ func resourceIBMISVPCRoutingTableRoute() *schema.Resource { ForceNew: false, Computed: true, Description: "The user-defined name for this route.", - ValidateFunc: InvokeValidator("ibm_is_vpc_routing_table_route", rName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpc_routing_table_route", rName), }, rID: { Type: schema.TypeString, @@ -115,30 +116,30 @@ func resourceIBMISVPCRoutingTableRoute() *schema.Resource { } } -func resourceIBMISVPCRoutingTableRouteValidator() *ResourceValidator { +func ResourceIBMISVPCRoutingTableRouteValidator() *validate.ResourceValidator { - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) actionAllowedValues := "delegate, delegate_vpc, deliver, drop" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: rtName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: false, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: rAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: false, AllowedValues: actionAllowedValues}) - ibmVPCRoutingTableRouteValidator := ResourceValidator{ResourceName: "ibm_is_vpc_routing_table_route", Schema: validateSchema} + ibmVPCRoutingTableRouteValidator := validate.ResourceValidator{ResourceName: "ibm_is_vpc_routing_table_route", Schema: validateSchema} return &ibmVPCRoutingTableRouteValidator } @@ -210,7 +211,7 @@ func resourceIBMISVPCRoutingTableRouteRead(d *schema.ResourceData, meta interfac d.SetId("") return nil } - return fmt.Errorf("Error Getting VPC Routing table route: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting VPC Routing table route: %s\n%s", err, response) } d.Set(rID, *route.ID) @@ -253,7 +254,7 @@ func resourceIBMISVPCRoutingTableRouteUpdate(d *schema.ResourceData, meta interf routePatchModelAsPatch, patchErr := routePatchModel.AsPatch() if patchErr != nil { - return fmt.Errorf("Error calling asPatch for VPC Routing Table Route Patch: %s", patchErr) + return fmt.Errorf("[ERROR] Error calling asPatch for VPC Routing Table Route Patch: %s", patchErr) } updateVpcRoutingTableRouteOptions.RoutePatch = routePatchModelAsPatch @@ -293,7 +294,7 @@ func resourceIBMISVPCRoutingTableRouteExists(d *schema.ResourceData, meta interf idSet := strings.Split(d.Id(), "/") if len(idSet) != 3 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of vpcID/routingTableID/routeID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of vpcID/routingTableID/routeID", d.Id()) } getVpcRoutingTableRouteOptions := sess.NewGetVPCRoutingTableRouteOptions(idSet[0], idSet[1], idSet[2]) _, response, err := sess.GetVPCRoutingTableRoute(getVpcRoutingTableRouteOptions) @@ -302,7 +303,7 @@ func resourceIBMISVPCRoutingTableRouteExists(d *schema.ResourceData, meta interf d.SetId("") return false, nil } - return false, fmt.Errorf("Error Getting VPC Routing table route : %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error Getting VPC Routing table route : %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpn_gateway.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpn_gateway.go similarity index 85% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpn_gateway.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpn_gateway.go index 1dac1af713..ab2a9f0360 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpn_gateway.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpn_gateway.go @@ -1,7 +1,7 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "context" @@ -10,6 +10,8 @@ import ( "os" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -36,7 +38,7 @@ const ( isVPNGatewayPrivateIPAddress2 = "private_ip_address2" ) -func resourceIBMISVPNGateway() *schema.Resource { +func ResourceIBMISVPNGateway() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVPNGatewayCreate, Read: resourceIBMISVPNGatewayRead, @@ -52,7 +54,7 @@ func resourceIBMISVPNGateway() *schema.Resource { CustomizeDiff: customdiff.Sequence( func(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - return resourceTagsCustomizeDiff(diff) + return flex.ResourceTagsCustomizeDiff(diff) }, ), @@ -62,7 +64,7 @@ func resourceIBMISVPNGateway() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: false, - ValidateFunc: InvokeValidator("ibm_is_route", isVPNGatewayName), + ValidateFunc: validate.InvokeValidator("ibm_is_route", isVPNGatewayName), Description: "VPN Gateway instance name", }, @@ -115,24 +117,24 @@ func resourceIBMISVPNGateway() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: InvokeValidator("ibm_is_vpn_gateway", "tag")}, - Set: resourceIBMVPCHash, + Elem: &schema.Schema{Type: schema.TypeString, ValidateFunc: validate.InvokeValidator("ibm_is_vpn_gateway", "tag")}, + Set: flex.ResourceIBMVPCHash, Description: "VPN Gateway tags list", }, - ResourceControllerURL: { + flex.ResourceControllerURL: { Type: schema.TypeString, Computed: true, Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about this instance", }, - ResourceName: { + flex.ResourceName: { Type: schema.TypeString, Computed: true, Description: "The name of the resource", }, - ResourceCRN: { + flex.ResourceCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the resource", @@ -144,13 +146,13 @@ func resourceIBMISVPNGateway() *schema.Resource { Description: "The crn of the resource", }, - ResourceStatus: { + flex.ResourceStatus: { Type: schema.TypeString, Computed: true, Description: "The status of the resource", }, - ResourceGroupName: { + flex.ResourceGroupName: { Type: schema.TypeString, Computed: true, Description: "The resource group name in which resource is provisioned", @@ -165,7 +167,7 @@ func resourceIBMISVPNGateway() *schema.Resource { Optional: true, ForceNew: true, Default: "route", - ValidateFunc: InvokeValidator("ibm_is_vpn_gateway", isVPNGatewayMode), + ValidateFunc: validate.InvokeValidator("ibm_is_vpn_gateway", isVPNGatewayMode), Description: "mode in VPN gateway(route/policy)", }, @@ -205,38 +207,38 @@ func resourceIBMISVPNGateway() *schema.Resource { } } -func resourceIBMISVPNGatewayValidator() *ResourceValidator { +func ResourceIBMISVPNGatewayValidator() *validate.ResourceValidator { modeCheckTypes := "route,policy" - validateSchema := make([]ValidateSchema, 0) + validateSchema := make([]validate.ValidateSchema, 0) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPNGatewayName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPNGatewayMode, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Required: false, AllowedValues: modeCheckTypes}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: "tag", - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Optional: true, Regexp: `^[A-Za-z0-9:_ .-]+$`, MinValueLength: 1, MaxValueLength: 128}) - ibmISVPNGatewayResourceValidator := ResourceValidator{ResourceName: "ibm_is_vpn_gateway", Schema: validateSchema} + ibmISVPNGatewayResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_vpn_gateway", Schema: validateSchema} return &ibmISVPNGatewayResourceValidator } @@ -294,7 +296,7 @@ func vpngwCreate(d *schema.ResourceData, meta interface{}, name, subnetID, mode v := os.Getenv("IC_ENV_TAGS") if _, ok := d.GetOk(isVPNGatewayTags); ok || v != "" { oldList, newList := d.GetChange(isVPNGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *vpnGateway.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *vpnGateway.CRN) if err != nil { log.Printf( "Error on create of resource vpc VPN Gateway (%s) tags: %s", d.Id(), err) @@ -325,7 +327,7 @@ func isVpnGatewayRefreshFunc(vpnGateway *vpcv1.VpcV1, id string) resource.StateR } vpnGatewayIntf, response, err := vpnGateway.GetVPNGateway(getVpnGatewayOptions) if err != nil { - return nil, "", fmt.Errorf("Error Getting Vpn Gateway: %s\n%s", err, response) + return nil, "", fmt.Errorf("[ERROR] Error Getting Vpn Gateway: %s\n%s", err, response) } vpnGateway := vpnGatewayIntf.(*vpcv1.VPNGateway) @@ -361,7 +363,7 @@ func vpngwGet(d *schema.ResourceData, meta interface{}, id string) error { d.SetId("") return nil } - return fmt.Errorf("Error Getting Vpn Gateway (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Vpn Gateway (%s): %s\n%s", id, err, response) } vpnGateway := vpnGatewayIntf.(*vpcv1.VPNGateway) @@ -385,23 +387,23 @@ func vpngwGet(d *schema.ResourceData, meta interface{}, id string) error { } } - tags, err := GetTagsUsingCRN(meta, *vpnGateway.CRN) + tags, err := flex.GetTagsUsingCRN(meta, *vpnGateway.CRN) if err != nil { log.Printf( "Error on get of resource vpc VPN Gateway (%s) tags: %s", d.Id(), err) } d.Set(isVPNGatewayTags, tags) - controller, err := getBaseController(meta) + controller, err := flex.GetBaseController(meta) if err != nil { return err } - d.Set(ResourceControllerURL, controller+"/vpc/network/vpngateways") - d.Set(ResourceName, *vpnGateway.Name) - d.Set(ResourceCRN, *vpnGateway.CRN) + d.Set(flex.ResourceControllerURL, controller+"/vpc/network/vpngateways") + d.Set(flex.ResourceName, *vpnGateway.Name) + d.Set(flex.ResourceCRN, *vpnGateway.CRN) d.Set(isVPNGatewayCRN, *vpnGateway.CRN) - d.Set(ResourceStatus, *vpnGateway.Status) + d.Set(flex.ResourceStatus, *vpnGateway.Status) if vpnGateway.ResourceGroup != nil { - d.Set(ResourceGroupName, *vpnGateway.ResourceGroup.Name) + d.Set(flex.ResourceGroupName, *vpnGateway.ResourceGroup.Name) d.Set(isVPNGatewayResourceGroup, *vpnGateway.ResourceGroup.ID) } d.Set(isVPNGatewayMode, *vpnGateway.Mode) @@ -455,12 +457,12 @@ func vpngwUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasC } vpnGatewayIntf, response, err := sess.GetVPNGateway(getVpnGatewayOptions) if err != nil { - return fmt.Errorf("Error getting Volume : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error getting Volume : %s\n%s", err, response) } vpnGateway := vpnGatewayIntf.(*vpcv1.VPNGateway) oldList, newList := d.GetChange(isVPNGatewayTags) - err = UpdateTagsUsingCRN(oldList, newList, meta, *vpnGateway.CRN) + err = flex.UpdateTagsUsingCRN(oldList, newList, meta, *vpnGateway.CRN) if err != nil { log.Printf( "Error on update of resource vpc Vpn Gateway (%s) tags: %s", id, err) @@ -475,12 +477,12 @@ func vpngwUpdate(d *schema.ResourceData, meta interface{}, id, name string, hasC } vpnGatewayPatch, err := vpnGatewayPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for VPNGatewayPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for VPNGatewayPatch: %s", err) } options.VPNGatewayPatch = vpnGatewayPatch _, response, err := sess.UpdateVPNGateway(options) if err != nil { - return fmt.Errorf("Error updating vpc Vpn Gateway: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating vpc Vpn Gateway: %s\n%s", err, response) } } return nil @@ -511,7 +513,7 @@ func vpngwDelete(d *schema.ResourceData, meta interface{}, id string) error { if response != nil && response.StatusCode == 404 { return nil } - return fmt.Errorf("Error Getting Vpn Gateway (%s): %s\n%s", id, err, response) + return fmt.Errorf("[ERROR] Error Getting Vpn Gateway (%s): %s\n%s", id, err, response) } options := &vpcv1.DeleteVPNGatewayOptions{ @@ -519,7 +521,7 @@ func vpngwDelete(d *schema.ResourceData, meta interface{}, id string) error { } response, err = sess.DeleteVPNGateway(options) if err != nil { - return fmt.Errorf("Error Deleting Vpn Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Vpn Gateway : %s\n%s", err, response) } _, err = isWaitForVpnGatewayDeleted(sess, id, d.Timeout(schema.TimeoutDelete)) if err != nil { @@ -554,7 +556,7 @@ func isVpnGatewayDeleteRefreshFunc(vpnGateway *vpcv1.VpcV1, id string) resource. if response != nil && response.StatusCode == 404 { return "", isVPNGatewayDeleted, nil } - return "", "", fmt.Errorf("Error Getting Vpn Gateway: %s\n%s", err, response) + return "", "", fmt.Errorf("[ERROR] Error Getting Vpn Gateway: %s\n%s", err, response) } return vpngw, isVPNGatewayDeleting, err } @@ -580,7 +582,7 @@ func vpngwExists(d *schema.ResourceData, meta interface{}, id string) (bool, err if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Vpn Gatewa: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Vpn Gatewa: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpn_gateway_connections.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go similarity index 86% rename from ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpn_gateway_connections.go rename to ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go index 4c1ed71503..896a3a6c17 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/resource_ibm_is_vpn_gateway_connections.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc/resource_ibm_is_vpn_gateway_connections.go @@ -1,13 +1,15 @@ // Copyright IBM Corp. 2017, 2021 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 -package ibm +package vpc import ( "fmt" "log" "time" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/vpc-go-sdk/vpcv1" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -39,7 +41,7 @@ const ( isVPNGatewayConnectionCreatedat = "created_at" ) -func resourceIBMISVPNGatewayConnection() *schema.Resource { +func ResourceIBMISVPNGatewayConnection() *schema.Resource { return &schema.Resource{ Create: resourceIBMISVPNGatewayConnectionCreate, Read: resourceIBMISVPNGatewayConnectionRead, @@ -57,7 +59,7 @@ func resourceIBMISVPNGatewayConnection() *schema.Resource { isVPNGatewayConnectionName: { Type: schema.TypeString, Required: true, - ValidateFunc: InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionName), + ValidateFunc: validate.InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionName), Description: "VPN Gateway connection name", }, @@ -109,21 +111,21 @@ func resourceIBMISVPNGatewayConnection() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "restart", - ValidateFunc: InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionDeadPeerDetectionAction), + ValidateFunc: validate.InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionDeadPeerDetectionAction), Description: "Action detection for dead peer detection action", }, isVPNGatewayConnectionDeadPeerDetectionInterval: { Type: schema.TypeInt, Optional: true, Default: 2, - ValidateFunc: InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionDeadPeerDetectionInterval), + ValidateFunc: validate.InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionDeadPeerDetectionInterval), Description: "Interval for dead peer detection interval", }, isVPNGatewayConnectionDeadPeerDetectionTimeout: { Type: schema.TypeInt, Optional: true, Default: 10, - ValidateFunc: InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionDeadPeerDetectionTimeout), + ValidateFunc: validate.InvokeValidator("ibm_is_vpn_gateway_connection", isVPNGatewayConnectionDeadPeerDetectionTimeout), Description: "Timeout for dead peer detection", }, @@ -151,7 +153,7 @@ func resourceIBMISVPNGatewayConnection() *schema.Resource { Description: "VPN gateway connection status", }, - RelatedCRN: { + flex.RelatedCRN: { Type: schema.TypeString, Computed: true, Description: "The crn of the VPN Gateway resource", @@ -205,43 +207,43 @@ func resourceIBMISVPNGatewayConnection() *schema.Resource { } } -func resourceIBMISVPNGatewayConnectionValidator() *ResourceValidator { - validateSchema := make([]ValidateSchema, 0) +func ResourceIBMISVPNGatewayConnectionValidator() *validate.ResourceValidator { + validateSchema := make([]validate.ValidateSchema, 0) action := "restart, clear, hold, none" validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPNGatewayConnectionName, - ValidateFunctionIdentifier: ValidateRegexpLen, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, Required: true, Regexp: `^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$`, MinValueLength: 1, MaxValueLength: 63}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPNGatewayConnectionDeadPeerDetectionAction, - ValidateFunctionIdentifier: ValidateAllowedStringValue, - Type: TypeString, + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, Optional: true, AllowedValues: action}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPNGatewayConnectionDeadPeerDetectionInterval, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "1", MaxValue: "86399"}) validateSchema = append(validateSchema, - ValidateSchema{ + validate.ValidateSchema{ Identifier: isVPNGatewayConnectionDeadPeerDetectionTimeout, - ValidateFunctionIdentifier: IntBetween, - Type: TypeInt, + ValidateFunctionIdentifier: validate.IntBetween, + Type: validate.TypeInt, MinValue: "2", MaxValue: "86399"}) - ibmISVPNGatewayConnectionResourceValidator := ResourceValidator{ResourceName: "ibm_is_vpn_gateway_connection", Schema: validateSchema} + ibmISVPNGatewayConnectionResourceValidator := validate.ResourceValidator{ResourceName: "ibm_is_vpn_gateway_connection", Schema: validateSchema} return &ibmISVPNGatewayConnectionResourceValidator } @@ -306,11 +308,11 @@ func vpngwconCreate(d *schema.ResourceData, meta interface{}, name, gatewayID, p } if _, ok := d.GetOk(isVPNGatewayConnectionLocalCIDRS); ok { - localCidrs := expandStringList((d.Get(isVPNGatewayConnectionLocalCIDRS).(*schema.Set)).List()) + localCidrs := flex.ExpandStringList((d.Get(isVPNGatewayConnectionLocalCIDRS).(*schema.Set)).List()) vpnGatewayConnectionPrototypeModel.LocalCIDRs = localCidrs } if _, ok := d.GetOk(isVPNGatewayConnectionPeerCIDRS); ok { - peerCidrs := expandStringList((d.Get(isVPNGatewayConnectionPeerCIDRS).(*schema.Set)).List()) + peerCidrs := flex.ExpandStringList((d.Get(isVPNGatewayConnectionPeerCIDRS).(*schema.Set)).List()) vpnGatewayConnectionPrototypeModel.PeerCIDRs = peerCidrs } @@ -345,7 +347,7 @@ func vpngwconCreate(d *schema.ResourceData, meta interface{}, name, gatewayID, p func resourceIBMISVPNGatewayConnectionRead(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -375,7 +377,7 @@ func vpngwconGet(d *schema.ResourceData, meta interface{}, gID, gConnID string) d.SetId("") return nil } - return fmt.Errorf("Error Getting Vpn Gateway Connection (%s): %s\n%s", gConnID, err, response) + return fmt.Errorf("[ERROR] Error Getting Vpn Gateway Connection (%s): %s\n%s", gConnID, err, response) } d.Set(isVPNGatewayConnection, gConnID) vpnGatewayConnection := vpnGatewayConnectionIntf.(*vpcv1.VPNGatewayConnection) @@ -386,10 +388,10 @@ func vpngwconGet(d *schema.ResourceData, meta interface{}, gID, gConnID string) d.Set(isVPNGatewayConnectionPreSharedKey, *vpnGatewayConnection.Psk) if vpnGatewayConnection.LocalCIDRs != nil { - d.Set(isVPNGatewayConnectionLocalCIDRS, flattenStringList(vpnGatewayConnection.LocalCIDRs)) + d.Set(isVPNGatewayConnectionLocalCIDRS, flex.FlattenStringList(vpnGatewayConnection.LocalCIDRs)) } if vpnGatewayConnection.PeerCIDRs != nil { - d.Set(isVPNGatewayConnectionPeerCIDRS, flattenStringList(vpnGatewayConnection.PeerCIDRs)) + d.Set(isVPNGatewayConnectionPeerCIDRS, flex.FlattenStringList(vpnGatewayConnection.PeerCIDRs)) } if vpnGatewayConnection.IkePolicy != nil { d.Set(isVPNGatewayConnectionIKEPolicy, *vpnGatewayConnection.IkePolicy.ID) @@ -437,17 +439,17 @@ func vpngwconGet(d *schema.ResourceData, meta interface{}, gID, gConnID string) } vpngatewayIntf, response, err := sess.GetVPNGateway(getVPNGatewayOptions) if err != nil { - return fmt.Errorf("Error Getting VPN Gateway : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Getting VPN Gateway : %s\n%s", err, response) } vpngateway := vpngatewayIntf.(*vpcv1.VPNGateway) - d.Set(RelatedCRN, *vpngateway.CRN) + d.Set(flex.RelatedCRN, *vpngateway.CRN) return nil } func resourceIBMISVPNGatewayConnectionUpdate(d *schema.ResourceData, meta interface{}) error { hasChanged := false - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -533,12 +535,12 @@ func vpngwconUpdate(d *schema.ResourceData, meta interface{}, gID, gConnID strin if hasChanged { vpnGatewayConnectionPatch, err := vpnGatewayConnectionPatchModel.AsPatch() if err != nil { - return fmt.Errorf("Error calling asPatch for VPNGatewayConnectionPatch: %s", err) + return fmt.Errorf("[ERROR] Error calling asPatch for VPNGatewayConnectionPatch: %s", err) } updateVpnGatewayConnectionOptions.VPNGatewayConnectionPatch = vpnGatewayConnectionPatch _, response, err := sess.UpdateVPNGatewayConnection(updateVpnGatewayConnectionOptions) if err != nil { - return fmt.Errorf("Error updating Vpn Gateway Connection: %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error updating Vpn Gateway Connection: %s\n%s", err, response) } } return nil @@ -546,7 +548,7 @@ func vpngwconUpdate(d *schema.ResourceData, meta interface{}, gID, gConnID strin func resourceIBMISVPNGatewayConnectionDelete(d *schema.ResourceData, meta interface{}) error { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return err } @@ -577,7 +579,7 @@ func vpngwconDelete(d *schema.ResourceData, meta interface{}, gID, gConnID strin d.SetId("") return nil } - return fmt.Errorf("Error Getting Vpn Gateway Connection(%s): %s\n%s", gConnID, err, response) + return fmt.Errorf("[ERROR] Error Getting Vpn Gateway Connection(%s): %s\n%s", gConnID, err, response) } deleteVpnGatewayConnectionOptions := &vpcv1.DeleteVPNGatewayConnectionOptions{ @@ -586,13 +588,12 @@ func vpngwconDelete(d *schema.ResourceData, meta interface{}, gID, gConnID strin } response, err = sess.DeleteVPNGatewayConnection(deleteVpnGatewayConnectionOptions) if err != nil { - return fmt.Errorf("Error Deleting Vpn Gateway Connection : %s\n%s", err, response) + return fmt.Errorf("[ERROR] Error Deleting Vpn Gateway Connection : %s\n%s", err, response) } _, err = isWaitForVPNGatewayConnectionDeleted(sess, gID, gConnID, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf( - "Error checking for Vpn Gateway Connection (%s) is deleted: %s", gConnID, err) + return fmt.Errorf("[ERROR] Error checking for Vpn Gateway Connection (%s) is deleted: %s", gConnID, err) } d.SetId("") @@ -625,7 +626,7 @@ func isVPNGatewayConnectionDeleteRefreshFunc(vpnGatewayConnection *vpcv1.VpcV1, if response != nil && response.StatusCode == 404 { return "", isVPNGatewayConnectionDeleted, nil } - return "", "", fmt.Errorf("The Vpn Gateway Connection %s failed to delete: %s\n%s", gConnID, err, response) + return "", "", fmt.Errorf("[ERROR] The Vpn Gateway Connection %s failed to delete: %s\n%s", gConnID, err, response) } return vpngwcon, isVPNGatewayConnectionDeleting, nil } @@ -633,12 +634,12 @@ func isVPNGatewayConnectionDeleteRefreshFunc(vpnGatewayConnection *vpcv1.VpcV1, func resourceIBMISVPNGatewayConnectionExists(d *schema.ResourceData, meta interface{}) (bool, error) { - parts, err := idParts(d.Id()) + parts, err := flex.IdParts(d.Id()) if err != nil { return false, err } if len(parts) != 2 { - return false, fmt.Errorf("Incorrect ID %s: ID should be a combination of gID/gConnID", d.Id()) + return false, fmt.Errorf("[ERROR] Incorrect ID %s: ID should be a combination of gID/gConnID", d.Id()) } gID := parts[0] @@ -662,7 +663,7 @@ func vpngwconExists(d *schema.ResourceData, meta interface{}, gID, gConnID strin if response != nil && response.StatusCode == 404 { return false, nil } - return false, fmt.Errorf("Error getting Vpn Gateway Connection: %s\n%s", err, response) + return false, fmt.Errorf("[ERROR] Error getting Vpn Gateway Connection: %s\n%s", err, response) } return true, nil } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/utils.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/utils.go deleted file mode 100644 index 9fd2f645c7..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/utils.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -// Used for retry logic on resource timeout. -func isResourceTimeoutError(err error) bool { - timeoutErr, ok := err.(*resource.TimeoutError) - return ok && timeoutErr.LastError == nil -} -func GetPrivateServiceURLForRegion(region string) (string, error) { - var endpoints = map[string]string{ - "us-south": "https://private.us.icr.io", // us-south - "uk-south": "https://private.uk.icr.io", // uk-south - "eu-gb": "https://private.uk.icr.io", // eu-gb - "eu-central": "https://private.de.icr.io", // eu-central - "eu-de": "https://private.de.icr.io", // eu-de - "ap-north": "https://private.jp.icr.io", // ap-north - "jp-tok": "https://private.jp.icr.io", // jp-tok - "ap-south": "https://private.au.icr.io", // ap-south - "au-syd": "https://private.au.icr.io", // au-syd - "global": "https://private.icr.io", // global - "jp-osa": "https://private.jp2.icr.io", // jp-osa - "ca-tor": "https://private.ca.icr.io", // ca-tor - "br-sao": "https://private.br.icr.io", // br-sao - } - - if url, ok := endpoints[region]; ok { - return url, nil - } - return "", fmt.Errorf("service URL for region '%s' not found", region) -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate/validators.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate/validators.go new file mode 100644 index 0000000000..48d6dd3199 --- /dev/null +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate/validators.go @@ -0,0 +1,1344 @@ +// Copyright IBM Corp. 2017, 2021 All Rights Reserved. +// Licensed under the Mozilla Public License v2.0 + +package validate + +import ( + "encoding/json" + "errors" + "fmt" + "net" + "reflect" + "regexp" + "strconv" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + homedir "github.com/mitchellh/go-homedir" + + "github.com/IBM-Cloud/bluemix-go/helpers" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" +) + +var ( + validHRef *regexp.Regexp +) + +func init() { + validHRef = regexp.MustCompile(`^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$`) +} + +func ValidateSecondaryIPCount(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + if value != 4 && value != 8 { + errors = append(errors, fmt.Errorf( + "%q must be either 4 or 8", k)) + } + return +} + +func validateServiceTags(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + if len(value) > 2048 { + errors = append(errors, fmt.Errorf( + "%q must contain tags whose maximum length is 2048 characters", k)) + } + return +} + +func ValidateAllowedStringValues(validValues []string) schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + input := v.(string) + existed := false + for _, s := range validValues { + if s == input { + existed = true + break + } + } + if !existed { + errors = append(errors, fmt.Errorf( + "%q must contain a value from %#v, got %q", + k, validValues, input)) + } + return + + } +} + +func ValidBucketLifecycleTimestamp(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + _, err := time.Parse(time.RFC3339, fmt.Sprintf("%sT00:00:00Z", value)) + if err != nil { + errors = append(errors, fmt.Errorf( + "%q cannot be parsed as RFC3339 Timestamp Format", value)) + } + + return +} + +func validateRegexpLen(min, max int, regex string) schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + acceptedcharacters, _ := regexp.MatchString(regex, value) + + if acceptedcharacters { + if (len(value) < min) || (len(value) > max) && (min > 0 && max > 0) { + errors = append(errors, fmt.Errorf( + "%q (%q) must contain from %d to %d characters ", k, value, min, max)) + } + } else { + errors = append(errors, fmt.Errorf( + "%q (%q) should match regexp %s ", k, v, regex)) + } + + return + + } +} + +func ValidateAllowedIntValues(is []int) schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + existed := false + for _, i := range is { + if i == value { + existed = true + break + } + } + if !existed { + errors = append(errors, fmt.Errorf( + "%q must contain a valid int value should in array %#v, got %q", + k, is, value)) + } + return + + } +} + +func ValidateAllowedEnterpriseNameValue() schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if len(value) < 3 || len(value) > 60 { + errors = append(errors, fmt.Errorf( + "%q must contain a valid string value with length between 3 and 60", value)) + } + return + + } +} +func ValidateRoutePath(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + //Somehow API allows this + if value == "" { + return + } + + if (len(value) < 2) || (len(value) > 128) { + errors = append(errors, fmt.Errorf( + "%q (%q) must contain from 2 to 128 characters ", k, value)) + } + if !(strings.HasPrefix(value, "/")) { + errors = append(errors, fmt.Errorf( + "%q (%q) must start with a forward slash '/'", k, value)) + + } + if strings.Contains(value, "?") { + errors = append(errors, fmt.Errorf( + "%q (%q) must not contain a '?'", k, value)) + } + + return +} + +func ValidateRoutePort(v interface{}, k string) (ws []string, errors []error) { + return ValidatePortRange(1024, 65535)(v, k) +} + +func validateAppPort(v interface{}, k string) (ws []string, errors []error) { + return ValidatePortRange(1024, 65535)(v, k) +} +func ValidateLBListenerPolicyPriority(v interface{}, k string) (ws []string, errors []error) { + interval := v.(int) + if interval < 1 || interval > 10 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 10", + k)) + } + return +} + +func ValidateStringLength(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if (len(value) < 1) || (len(value) > 128) { + errors = append(errors, fmt.Errorf( + "%q (%q) must contain from 1 to 128 characters ", k, value)) + } + return +} + +func ValidatePortRange(start, end int) func(v interface{}, k string) (ws []string, errors []error) { + f := func(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + if (value < start) || (value > end) { + errors = append(errors, fmt.Errorf( + "%q (%d) must be in the range of %d to %d", k, value, start, end)) + } + return + } + return f +} + +func ValidateDomainName(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if !(strings.Contains(value, ".")) { + errors = append(errors, fmt.Errorf( + "%q (%q) must contain a '.',example.com,foo.example.com", k, value)) + } + + return +} + +func validateAppInstance(v interface{}, k string) (ws []string, errors []error) { + instances := v.(int) + if instances < 0 { + errors = append(errors, fmt.Errorf( + "%q (%q) must be greater than 0", k, instances)) + } + return + +} + +func ValidateWorkerNum(v interface{}, k string) (ws []string, errors []error) { + workerNum := v.(int) + if workerNum <= 0 { + errors = append(errors, fmt.Errorf( + "%q must be greater than 0", k)) + } + return + +} + +func validateAppZipPath(v interface{}, k string) (ws []string, errors []error) { + path := v.(string) + applicationZip, err := homedir.Expand(path) + if err != nil { + errors = append(errors, fmt.Errorf( + "%q (%q) home directory in the given path couldn't be expanded", k, path)) + } + if !helpers.FileExists(applicationZip) { + errors = append(errors, fmt.Errorf( + "%q (%q) doesn't exist", k, path)) + } + + return + +} + +func ValidateNotes(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + if len(value) > 1000 { + errors = append(errors, fmt.Errorf( + "%q should not exceed 1000 characters", k)) + } + return +} + +func ValidatePublicBandwidth(v interface{}, k string) (ws []string, errors []error) { + bandwidth := v.(int) + if bandwidth < 0 { + errors = append(errors, fmt.Errorf( + "%q (%q) must be greater than 0", k, bandwidth)) + return + } + validBandwidths := []int{250, 1000, 5000, 10000, 20000} + for _, b := range validBandwidths { + if b == bandwidth { + return + } + } + errors = append(errors, fmt.Errorf( + "%q (%d) must be one of the value from %d", k, bandwidth, validBandwidths)) + return + +} + +func ValidateMaxConn(v interface{}, k string) (ws []string, errors []error) { + maxConn := v.(int) + if maxConn < 1 || maxConn > 64000 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 64000", + k)) + return + } + return +} + +func ValidateKeyLifeTime(v interface{}, k string) (ws []string, errors []error) { + secs := v.(int) + if secs < 1800 || secs > 86400 { + errors = append(errors, fmt.Errorf( + "%q must be between 1800 and 86400", + k)) + return + } + return +} + +func ValidateWeight(v interface{}, k string) (ws []string, errors []error) { + weight := v.(int) + if weight < 0 || weight > 100 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 100", + k)) + } + return +} + +func ValidateSizePerZone(v interface{}, k string) (ws []string, errors []error) { + sizePerZone := v.(int) + if sizePerZone <= 0 { + errors = append(errors, fmt.Errorf( + "%q must be greater than 0", + k)) + } + return +} + +func ValidateInterval(v interface{}, k string) (ws []string, errors []error) { + interval := v.(int) + if interval < 2 || interval > 60 { + errors = append(errors, fmt.Errorf( + "%q must be between 2 and 60", + k)) + } + return +} + +func ValidateMaxRetries(v interface{}, k string) (ws []string, errors []error) { + maxRetries := v.(int) + if maxRetries < 1 || maxRetries > 10 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 10", + k)) + } + return +} + +func ValidateTimeout(v interface{}, k string) (ws []string, errors []error) { + timeout := v.(int) + if timeout < 1 || timeout > 59 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 59", + k)) + } + return +} + +func ValidateURLPath(v interface{}, k string) (ws []string, errors []error) { + urlPath := v.(string) + if len(urlPath) > 250 || !strings.HasPrefix(urlPath, "/") { + errors = append(errors, fmt.Errorf( + "%q should start with ‘/‘ and has a max length of 250 characters.", + k)) + } + return +} + +func ValidateSecurityRuleDirection(v interface{}, k string) (ws []string, errors []error) { + validDirections := map[string]bool{ + "ingress": true, + "egress": true, + } + + value := v.(string) + _, found := validDirections[value] + if !found { + strarray := make([]string, 0, len(validDirections)) + for key := range validDirections { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid security group rule direction %q. Valid types are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func ValidateSecurityRuleEtherType(v interface{}, k string) (ws []string, errors []error) { + validEtherTypes := map[string]bool{ + "IPv4": true, + "IPv6": true, + } + + value := v.(string) + _, found := validEtherTypes[value] + if !found { + strarray := make([]string, 0, len(validEtherTypes)) + for key := range validEtherTypes { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid security group rule ethernet type %q. Valid types are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +//ValidateIP... +func ValidateIP(v interface{}, k string) (ws []string, errors []error) { + address := v.(string) + if net.ParseIP(address) == nil { + errors = append(errors, fmt.Errorf( + "%q must be a valid ip address", + k)) + } + return +} + +//ValidateCIDR... +func ValidateCIDR(v interface{}, k string) (ws []string, errors []error) { + address := v.(string) + _, _, err := net.ParseCIDR(address) + if err != nil { + errors = append(errors, fmt.Errorf( + "%q must be a valid cidr address", + k)) + } + return +} + +//validateCIDRAddress... +func validateCIDRAddress() schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + address := v.(string) + _, _, err := net.ParseCIDR(address) + if err != nil { + errors = append(errors, fmt.Errorf( + "%q must be a valid cidr address", + k)) + } + return + } +} + +//validateOverlappingAddress... +func validateOverlappingAddress() schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + nonOverlappingCIDR := map[string]bool{ + "127.0.0.0/8": true, + "161.26.0.0/16": true, + "166.8.0.0/14": true, + "169.254.0.0/16": true, + "224.0.0.0/4": true, + } + + address := v.(string) + _, found := nonOverlappingCIDR[address] + if found { + errors = append(errors, fmt.Errorf( + "%q the request is overlapping with reserved address ranges", + k)) + } + return + } +} + +//ValidateRemoteIP... +func ValidateRemoteIP(v interface{}, k string) (ws []string, errors []error) { + _, err1 := ValidateCIDR(v, k) + _, err2 := ValidateIP(v, k) + + if len(err1) != 0 && len(err2) != 0 { + errors = append(errors, fmt.Errorf( + "%q must be a valid remote ip address (cidr or ip)", + k)) + } + return +} + +//validateIPorCIDR... +func validateIPorCIDR() schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + _, err1 := ValidateCIDR(v, k) + _, err2 := ValidateIP(v, k) + + if len(err1) != 0 && len(err2) != 0 { + errors = append(errors, fmt.Errorf( + "%q must be a valid remote ip address (cidr or ip)", + k)) + } + return + } +} + +func ValidateSecurityRuleProtocol(v interface{}, k string) (ws []string, errors []error) { + validProtocols := map[string]bool{ + "icmp": true, + "tcp": true, + "udp": true, + } + + value := v.(string) + _, found := validProtocols[value] + if !found { + strarray := make([]string, 0, len(validProtocols)) + for key := range validProtocols { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid security group rule ethernet type %q. Valid types are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +//func validateJSONString(v interface{}, k string) (ws []string, errors []error) { +// if _, err := flex.NormalizeJSONString(v); err != nil { +// errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) +// } +// if err := validateKeyValue(v); err != nil { +// errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) +// } +// return +//} + +func validateJSONString() schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + if _, err := flex.NormalizeJSONString(v); err != nil { + errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) + } + if err := validateKeyValue(v); err != nil { + errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) + } + return + } +} + +func ValidateRegexps(regex string) schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + acceptedcharacters, _ := regexp.MatchString(regex, value) + + if !acceptedcharacters { + errors = append(errors, fmt.Errorf( + "%q (%q) should match regexp %s ", k, v, regex)) + } + + return + + } +} + +// NoZeroValues is a SchemaValidateFunc which tests if the provided value is +// not a zero value. It's useful in situations where you want to catch +// explicit zero values on things like required fields during validation. +func validateNoZeroValues() schema.SchemaValidateFunc { + return func(i interface{}, k string) (ws []string, errors []error) { + + if reflect.ValueOf(i).Interface() == reflect.Zero(reflect.TypeOf(i)).Interface() { + switch reflect.TypeOf(i).Kind() { + case reflect.String: + errors = append(errors, fmt.Errorf("%s value must not be empty.", k)) + case reflect.Int, reflect.Float64: + errors = append(errors, fmt.Errorf("%s value must not be zero.", k)) + default: + // this validator should only ever be applied to TypeString, TypeInt and TypeFloat + errors = append(errors, fmt.Errorf("can't use NoZeroValues with %T attribute %s", k, i)) + } + } + return + } +} + +func validateBindedPackageName() schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if !(strings.HasPrefix(value, "/")) { + errors = append(errors, fmt.Errorf( + "%q (%q) must start with a forward slash '/'.The package name should be '/whisk.system/cloudant', '/test@in.ibm.com_new/utils' or '/_/utils'", k, value)) + + } + + index := strings.LastIndex(value, "/") + + if index < 2 || index == len(value)-1 { + errors = append(errors, fmt.Errorf( + "%q (%q) is not a valid bind package name.The package name should be '/whisk.system/cloudant','/test@in.ibm.com_new/utils' or '/_/utils'", k, value)) + + } + + return + } +} + +func validateKeyValue(jsonString interface{}) error { + var j [](map[string]interface{}) + if jsonString == nil || jsonString.(string) == "" { + return nil + } + s := jsonString.(string) + err := json.Unmarshal([]byte(s), &j) + if err != nil { + return err + } + for _, v := range j { + _, exists := v["key"] + if !exists { + return errors.New("'key' is missing from json") + } + _, exists = v["value"] + if !exists { + return errors.New("'value' is missing from json") + } + } + return nil +} + +func validateActionName(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if strings.HasPrefix(value, "/") { + errors = append(errors, fmt.Errorf( + "%q (%q) must not start with a forward slash '/'.The action name should be like 'myaction' or utils/cloudant'", k, value)) + + } + + const alphaNumeric = "abcdefghijklmnopqrstuvwxyz0123456789/_@.-" + + for _, char := range value { + if !strings.Contains(alphaNumeric, strings.ToLower(string(char))) { + errors = append(errors, fmt.Errorf( + "%q (%q) The name of the package contains illegal characters", k, value)) + } + } + + return +} + +func validateActionKind(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + kindList := []string{"php:7.3", "nodejs:8", "swift:3", "nodejs", "blackbox", "java", "sequence", "nodejs:10", "python:3", "python", "python:2", "swift", "swift:4.2"} + if !stringInSlice(value, kindList) { + errors = append(errors, fmt.Errorf( + "%q (%q) Invalid kind is provided.Supported list of kinds of actions are (%q)", k, value, kindList)) + } + return +} + +func stringInSlice(str string, list []string) bool { + for _, v := range list { + if v == str { + return true + } + } + return false +} + +func validateFunctionName(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + var validName = regexp.MustCompile(`\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`) + if !validName.MatchString(value) { + errors = append(errors, fmt.Errorf( + "%q (%q) The name contains illegal characters", k, value)) + + } + return +} + +func ValidateStorageType(v interface{}, k string) (ws []string, errors []error) { + validEtherTypes := map[string]bool{ + "Endurance": true, + "Performance": true, + } + + value := v.(string) + _, found := validEtherTypes[value] + if !found { + strarray := make([]string, 0, len(validEtherTypes)) + for key := range validEtherTypes { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid storage type %q. Valid types are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func validateRole(v interface{}, k string) (ws []string, errors []error) { + validRolesTypes := map[string]bool{ + "Writer": true, + "Reader": true, + "Manager": true, + "Administrator": true, + "Operator": true, + "Viewer": true, + "Editor": true, + } + + value := v.(string) + _, found := validRolesTypes[value] + if !found { + strarray := make([]string, 0, len(validRolesTypes)) + for key := range validRolesTypes { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid role %q. Valid roles are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func ValidateDayOfWeek(v interface{}, k string) (ws []string, errors []error) { + validDayTypes := map[string]bool{ + "SUNDAY": true, + "MONDAY": true, + "TUESDAY": true, + "WEDNESDAY": true, + "THURSDAY": true, + "FRIDAY": true, + "SATURDAY": true, + } + + value := v.(string) + _, found := validDayTypes[value] + if !found { + strarray := make([]string, 0, len(validDayTypes)) + for key := range validDayTypes { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid day %q. Valid days are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func ValidateScheduleType(v interface{}, k string) (ws []string, errors []error) { + validSchdTypes := map[string]bool{ + "HOURLY": true, + "DAILY": true, + "WEEKLY": true, + } + + value := v.(string) + _, found := validSchdTypes[value] + if !found { + strarray := make([]string, 0, len(validSchdTypes)) + for key := range validSchdTypes { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid schedule type %q. Valid schedules are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func ValidateHour(start, end int) func(v interface{}, k string) (ws []string, errors []error) { + f := func(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + if (value < start) || (value > end) { + errors = append(errors, fmt.Errorf( + "%q (%d) must be in the range of %d to %d", k, value, start, end)) + } + return + } + return f +} + +func ValidateMinute(start, end int) func(v interface{}, k string) (ws []string, errors []error) { + f := func(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + if (value < start) || (value > end) { + errors = append(errors, fmt.Errorf( + "%q (%d) must be in the range of %d to %d", k, value, start, end)) + } + return + } + return f +} + +func ValidateDatacenterOption(v []interface{}, allowedValues []string) error { + for _, option := range v { + if option == nil { + return fmt.Errorf("Provide a valid `datacenter_choice`") + } + values := option.(map[string]interface{}) + for k := range values { + if !stringInSlice(k, allowedValues) { + return fmt.Errorf( + "%q Invalid values are provided in `datacenter_choice`. Supported list of keys are (%q)", k, allowedValues) + } + + } + } + return nil +} + +func ValidateLBTimeout(v interface{}, k string) (ws []string, errors []error) { + timeout := v.(int) + if timeout <= 0 || timeout > 3600 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 3600", + k)) + } + return +} + +// validateRecordType ensures that the dns record type is valid +func validateRecordType(t string, proxied bool) error { + switch t { + case "A", "AAAA", "CNAME": + return nil + case "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA", "URI": + if !proxied { + return nil + } + default: + return fmt.Errorf( + `Invalid type %q. Valid types are "A", "AAAA", "CNAME", "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA" or "URI".`, t) + } + + return fmt.Errorf("Type %q cannot be proxied", t) +} + +// validateRecordName ensures that based on supplied record type, the name content matches +// Currently only validates A and AAAA types +func validateRecordName(t string, value string) error { + switch t { + case "A": + // Must be ipv4 addr + addr := net.ParseIP(value) + if addr == nil || !strings.Contains(value, ".") { + return fmt.Errorf("A record must be a valid IPv4 address, got: %q", value) + } + case "AAAA": + // Must be ipv6 addr + addr := net.ParseIP(value) + if addr == nil || !strings.Contains(value, ":") { + return fmt.Errorf("AAAA record must be a valid IPv6 address, got: %q", value) + } + case "TXT": + // Must be printable ASCII + for i := 0; i < len(value); i++ { + char := value[i] + if (char < 0x20) || (0x7F < char) { + return fmt.Errorf("TXT record must contain printable ASCII, found: %q", char) + } + } + } + + return nil +} + +func ValidateVLANName(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + if len(value) > 20 { + errors = append(errors, fmt.Errorf( + "Length provided for '%q' is too long. Maximum length is 20 characters", k)) + } + return +} + +func ValidateAuthProtocol(v interface{}, k string) (ws []string, errors []error) { + authProtocol := v.(string) + if authProtocol != "MD5" && authProtocol != "SHA1" && authProtocol != "SHA256" { + errors = append(errors, fmt.Errorf( + "%q auth protocol can be MD5 or SHA1 or SHA256", k)) + } + return +} + +//ValidateIPVersion +func ValidateIPVersion(v interface{}, k string) (ws []string, errors []error) { + validVersions := map[string]bool{ + "ipv4": true, + "ipv6": true, + } + + value := v.(string) + _, found := validVersions[value] + if !found { + strarray := make([]string, 0, len(validVersions)) + for key := range validVersions { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid ip version type %q. Valid types are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func IsSecurityGroupAddress(s string) bool { + return net.ParseIP(s) != nil +} + +func IsSecurityGroupCIDR(s string) bool { + _, _, err := net.ParseCIDR(s) + return err == nil +} + +func isSecurityGroupIdentityByCRN(s string) bool { + segments := strings.Split(s, ":") + return len(segments) == 10 && segments[0] == "crn" +} + +func isSecurityGroupIdentityByHRef(s string) bool { + return validHRef.MatchString(s) +} + +func validateGeneration(v interface{}, k string) (ws []string, errors []error) { + validVersions := map[string]bool{ + "gc": true, + "gt": true, + } + + value := v.(string) + _, found := validVersions[value] + if !found { + strarray := make([]string, 0, len(validVersions)) + for key := range validVersions { + strarray = append(strarray, key) + } + errors = append(errors, fmt.Errorf( + "%q contains an invalid generation type %q. Valid types are %q.", + k, value, strings.Join(strarray, ","))) + } + return +} + +func ValidateEncyptionProtocol(v interface{}, k string) (ws []string, errors []error) { + encyptionProtocol := v.(string) + if encyptionProtocol != "DES" && encyptionProtocol != "3DES" && encyptionProtocol != "AES128" && encyptionProtocol != "AES192" && encyptionProtocol != "AES256" { + errors = append(errors, fmt.Errorf( + "%q encryption protocol can be DES or 3DES or AES128 or AES192 or AES256", k)) + } + return +} + +func validateDeadPeerDetectionInterval(v interface{}, k string) (ws []string, errors []error) { + secs := v.(int) + if secs < 15 || secs > 86399 { + errors = append(errors, fmt.Errorf( + "%q must be between 15 and 86399", + k)) + return + } + return +} + +func ValidateDiffieHellmanGroup(v interface{}, k string) (ws []string, errors []error) { + diffieHellmanGroup := v.(int) + if diffieHellmanGroup != 0 && diffieHellmanGroup != 1 && diffieHellmanGroup != 2 && diffieHellmanGroup != 5 { + errors = append(errors, fmt.Errorf( + "%q Diffie Hellman Group can be 0 or 1 or 2 or 5", k)) + } + return +} + +func ValidateAllowedRangeInt(start, end int) schema.SchemaValidateFunc { + return func(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + if value < start || value > end { + errors = append(errors, fmt.Errorf( + "%q must contain a valid int value should be in range(%d, %d), got %d", + k, start, end, value)) + } + return + } +} + +func validateDeadPeerDetectionTimeout(v interface{}, k string) (ws []string, errors []error) { + secs := v.(int) + if secs < 15 || secs > 86399 { + errors = append(errors, fmt.Errorf( + "%q must be between 15 and 86399", + k)) + return + } + return +} + +func Validatekeylife(v interface{}, k string) (ws []string, errors []error) { + keylife := v.(int) + if keylife < 120 || keylife > 172800 { + errors = append(errors, fmt.Errorf( + "%q keylife value can be between 120 and 172800", k)) + } + return +} + +func ValidateLBListenerPort(v interface{}, k string) (ws []string, errors []error) { + return ValidatePortRange(1, 65535)(v, k) +} + +func ValidateLBListenerConnectionLimit(v interface{}, k string) (ws []string, errors []error) { + conns := v.(int) + if conns < 1 || conns > 15000 { + errors = append(errors, fmt.Errorf( + "%q must be between 1 and 15000", + k)) + return + } + return +} + +//ValidateISName +func ValidateISName(v interface{}, k string) (ws []string, errors []error) { + name := v.(string) + acceptedcharacters, _ := regexp.MatchString(`^[a-z][-a-z0-9]*$`, name) + endwithalphanumeric, _ := regexp.MatchString(`.*[a-z0-9]$`, name) + length := len(name) + if acceptedcharacters == true { + if length <= 40 { + if endwithalphanumeric == true { + if strings.Contains(name, "--") != true { + return + } else { + errors = append(errors, fmt.Errorf( + "%q (%q) should not contain consecutive dash(-)", k, v)) + } + } else { + errors = append(errors, fmt.Errorf( + "%q (%q) should not end with dash(-) ", k, v)) + } + } else { + errors = append(errors, fmt.Errorf( + "%q (%q) should not exceed 40 characters", k, v)) + } + + } else { + errors = append(errors, fmt.Errorf( + "%q (%q) should contain only lowercase alphanumeric,dash and should begin with lowercase character", k, v)) + } + return +} + +// ValidateFunc is honored only when the schema's Type is set to TypeInt, +// TypeFloat, TypeString, TypeBool, or TypeMap. It is ignored for all other types. +// enum to list all the validator functions supported by this tool. +type FunctionIdentifier int + +const ( + IntBetween FunctionIdentifier = iota + IntAtLeast + IntAtMost + ValidateAllowedStringValue + StringLenBetween + ValidateIPorCIDR + ValidateCIDRAddress + ValidateAllowedIntValue + ValidateRegexpLen + ValidateRegexp + ValidateNoZeroValues + ValidateJSONString + ValidateJSONParam + ValidateBindedPackageName + ValidateOverlappingAddress +) + +// MarshalText implements the encoding.TextMarshaler interface. +// Without this function, when FunctionalIdentifier is marshaled, it prints 0,1,2.. instead +// of printing IntBetween, IntAtLeast, IntAtMost.. in JSON Output +func (f FunctionIdentifier) MarshalText() ([]byte, error) { + return []byte(f.String()), nil +} + +// Use stringer tool to generate this later. +func (i FunctionIdentifier) String() string { + return [...]string{"IntBetween", "IntAtLeast", "IntAtMost", "ValidateAllowedStringValue", "StringLenBetween", "ValidateIPorCIDR", "ValidateAllowedIntValue", "ValidateRegexpLen", "ValidateRegexp", "ValidateNoZeroValues", "ValidateJSONString", "ValidateJSONParam", "ValidateBindedPackageName", "ValidateOverlappingAddress"}[i] +} + +// ValueType -- Copied from Terraform for now. You can refer to Terraform ValueType directly. +// ValueType is an enum of the type that can be represented by a schema. +type ValueType int + +const ( + TypeInvalid ValueType = iota + TypeBool + TypeInt + TypeFloat + TypeString +) + +// MarshalText implements the encoding.TextMarshaler interface. +func (vt ValueType) MarshalText() ([]byte, error) { + return []byte(vt.String()), nil +} + +// Use Stringer tool to generate this later. +func (i ValueType) String() string { + return [...]string{"TypeInvalid", "TypeBool", "TypeInt", "TypeFloat", "TypeString"}[i] +} + +// Type of constraints required for validation +type ValueConstraintType int + +const ( + MinValue ValueConstraintType = iota + MaxValue + MinValueLength + MaxValueLength + AllowedValues + MatchesValue +) + +// MarshalText implements the encoding.TextMarshaler interface. +func (vct ValueConstraintType) MarshalText() ([]byte, error) { + return []byte(vct.String()), nil +} + +// Use Stringer tool to generate this later. +func (i ValueConstraintType) String() string { + return [...]string{"MinValue", "MaxValue", "MinValueLength", "MaxValueLength", "AllowedValues", "MatchesValue"}[i] +} + +// Schema is used to describe the validation schema. +type ValidateSchema struct { + + //This is the parameter name. + //Ex: private_subnet in ibm_compute_bare_metal resource + Identifier string + + // this is similar to schema.ValueType + Type ValueType + + // The actual validation function that needs to be invoked. + // Ex: IntBetween, ValidateAllowedIntValues, ValidateAllowedStringValues + ValidateFunctionIdentifier FunctionIdentifier + + MinValue string + MaxValue string + AllowedValues string //Comma separated list of strings. + Matches string + Regexp string + MinValueLength int + MaxValueLength int + + // Is this nullable + Nullable bool + + Optional bool + Required bool + Default interface{} + ForceNew bool +} + +type ResourceValidator struct { + // This is the resource name - Found in provider.go of IBM Terraform provider. + // Ex: ibm_compute_monitor, ibm_compute_bare_metal, ibm_compute_dedicated_host, ibm_cis_global_load_balancer etc., + ResourceName string + + // Array of validator objects. Each object refers to one parameter in the resource provider. + Schema []ValidateSchema +} + +type ValidatorDict struct { + ResourceValidatorDictionary map[string]*ResourceValidator + DataSourceValidatorDictionary map[string]*ResourceValidator +} + +// Resource Validator Dictionary -- For all terraform IBM Resource Providers. +// This is of type - Array of ResourceValidators. +// Each object in this array is a type of map, where key == ResourceName and value == array of ValidateSchema objects. Each of these +// ValidateSchema corresponds to a parameter in the resourceProvider. + +// var validatorDict = Validator() + +var validatorDict ValidatorDict + +func SetValidatorDict(v ValidatorDict) { + validatorDict = v +} + +// This is the main validation function. This function will be used in all the provider code. +func InvokeValidator(resourceName, identifier string) schema.SchemaValidateFunc { + // Loop through dictionary and identify the resource and then the parameter configuration. + var schemaToInvoke ValidateSchema + found := false + resourceItem := validatorDict.ResourceValidatorDictionary[resourceName] + if resourceItem.ResourceName == resourceName { + parameterValidateSchema := resourceItem.Schema + for _, validateSchema := range parameterValidateSchema { + if validateSchema.Identifier == identifier { + schemaToInvoke = validateSchema + found = true + break + } + } + } + + if found { + return invokeValidatorInternal(schemaToInvoke) + } else { + // Add error code later. TODO + return nil + } +} + +func InvokeDataSourceValidator(resourceName, identifier string) schema.SchemaValidateFunc { + // Loop through dictionary and identify the resource and then the parameter configuration. + var schemaToInvoke ValidateSchema + found := false + + dataSourceItem := validatorDict.DataSourceValidatorDictionary[resourceName] + if dataSourceItem.ResourceName == resourceName { + parameterValidateSchema := dataSourceItem.Schema + for _, validateSchema := range parameterValidateSchema { + if validateSchema.Identifier == identifier { + schemaToInvoke = validateSchema + found = true + break + } + } + } + + if found { + return invokeValidatorInternal(schemaToInvoke) + } else { + // Add error code later. TODO + return nil + } +} + +// the function is currently modified to invoke SchemaValidateFunc directly. +// But in terraform, we will just return SchemaValidateFunc as shown below.. So terraform will invoke this func +func invokeValidatorInternal(schema ValidateSchema) schema.SchemaValidateFunc { + + funcIdentifier := schema.ValidateFunctionIdentifier + switch funcIdentifier { + case IntBetween: + minValue := schema.GetValue(MinValue) + maxValue := schema.GetValue(MaxValue) + return validation.IntBetween(minValue.(int), maxValue.(int)) + case IntAtLeast: + minValue := schema.GetValue(MinValue) + return validation.IntAtLeast(minValue.(int)) + case IntAtMost: + maxValue := schema.GetValue(MaxValue) + return validation.IntAtMost(maxValue.(int)) + case ValidateAllowedStringValue: + allowedValues := schema.GetValue(AllowedValues) + return ValidateAllowedStringValues(allowedValues.([]string)) + case StringLenBetween: + return validation.StringLenBetween(schema.MinValueLength, schema.MaxValueLength) + case ValidateIPorCIDR: + return validateIPorCIDR() + case ValidateCIDRAddress: + return validateCIDRAddress() + case ValidateAllowedIntValue: + allowedValues := schema.GetValue(AllowedValues) + return ValidateAllowedIntValues(allowedValues.([]int)) + case ValidateRegexpLen: + return validateRegexpLen(schema.MinValueLength, schema.MaxValueLength, schema.Regexp) + case ValidateRegexp: + return ValidateRegexps(schema.Regexp) + case ValidateNoZeroValues: + return validateNoZeroValues() + case ValidateJSONString: + return validateJSONString() + case ValidateBindedPackageName: + return validateBindedPackageName() + case ValidateOverlappingAddress: + return validateOverlappingAddress() + + default: + return nil + } +} + +// utility functions - Move to different package +func (vs ValidateSchema) GetValue(valueConstraint ValueConstraintType) interface{} { + + var valueToConvert string + switch valueConstraint { + case MinValue: + valueToConvert = vs.MinValue + case MaxValue: + valueToConvert = vs.MaxValue + case AllowedValues: + valueToConvert = vs.AllowedValues + case MatchesValue: + valueToConvert = vs.Matches + } + + switch vs.Type { + case TypeInvalid: + return nil + case TypeBool: + b, err := strconv.ParseBool(valueToConvert) + if err != nil { + return vs.Zero() + } + return b + case TypeInt: + // Convert comma separated string to array + if strings.Contains(valueToConvert, ",") { + var arr2 []int + arr1 := strings.Split(valueToConvert, ",") + for _, ele := range arr1 { + e, err := strconv.Atoi(strings.TrimSpace(ele)) + if err != nil { + return vs.Zero() + } + arr2 = append(arr2, e) + } + return arr2 + } else { + num, err := strconv.Atoi(valueToConvert) + if err != nil { + return vs.Zero() + } + return num + } + + case TypeFloat: + f, err := strconv.ParseFloat(valueToConvert, 32) + if err != nil { + return vs.Zero() + } + return f + case TypeString: + //return valueToConvert + // Convert comma separated string to array + arr := strings.Split(valueToConvert, ",") + for i, ele := range arr { + arr[i] = strings.TrimSpace(ele) + } + return arr + default: + panic(fmt.Sprintf("unknown type %s", vs.Type)) + } +} + +// Zero returns the zero value for a type. +func (vs ValidateSchema) Zero() interface{} { + switch vs.Type { + case TypeInvalid: + return nil + case TypeBool: + return false + case TypeInt: + return make([]string, 0) + case TypeFloat: + return 0.0 + case TypeString: + return make([]int, 0) + default: + panic(fmt.Sprintf("unknown type %s", vs.Type)) + } +} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/validators.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/validators.go deleted file mode 100644 index 8a26e7d3bc..0000000000 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/ibm/validators.go +++ /dev/null @@ -1,1346 +0,0 @@ -// Copyright IBM Corp. 2017, 2021 All Rights Reserved. -// Licensed under the Mozilla Public License v2.0 - -package ibm - -import ( - "encoding/json" - "errors" - "fmt" - "net" - "reflect" - "regexp" - "strconv" - "strings" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - homedir "github.com/mitchellh/go-homedir" - - "github.com/IBM-Cloud/bluemix-go/helpers" -) - -var ( - validHRef *regexp.Regexp -) - -func init() { - validHRef = regexp.MustCompile(`^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$`) -} - -func validateSecondaryIPCount(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value != 4 && value != 8 { - errors = append(errors, fmt.Errorf( - "%q must be either 4 or 8", k)) - } - return -} - -func validateServiceTags(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 2048 { - errors = append(errors, fmt.Errorf( - "%q must contain tags whose maximum length is 2048 characters", k)) - } - return -} - -func validateAllowedStringValue(validValues []string) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - input := v.(string) - existed := false - for _, s := range validValues { - if s == input { - existed = true - break - } - } - if !existed { - errors = append(errors, fmt.Errorf( - "%q must contain a value from %#v, got %q", - k, validValues, input)) - } - return - - } -} - -func validBucketLifecycleTimestamp(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - _, err := time.Parse(time.RFC3339, fmt.Sprintf("%sT00:00:00Z", value)) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q cannot be parsed as RFC3339 Timestamp Format", value)) - } - - return -} - -func validateRegexpLen(min, max int, regex string) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - acceptedcharacters, _ := regexp.MatchString(regex, value) - - if acceptedcharacters { - if (len(value) < min) || (len(value) > max) && (min > 0 && max > 0) { - errors = append(errors, fmt.Errorf( - "%q (%q) must contain from %d to %d characters ", k, value, min, max)) - } - } else { - errors = append(errors, fmt.Errorf( - "%q (%q) should match regexp %s ", k, v, regex)) - } - - return - - } -} - -func validateAllowedIntValue(is []int) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - existed := false - for _, i := range is { - if i == value { - existed = true - break - } - } - if !existed { - errors = append(errors, fmt.Errorf( - "%q must contain a valid int value should in array %#v, got %q", - k, is, value)) - } - return - - } -} - -func validateAllowedEnterpriseNameValue() schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if len(value) < 3 || len(value) > 60 { - errors = append(errors, fmt.Errorf( - "%q must contain a valid string value with length between 3 and 60", value)) - } - return - - } -} -func validateRoutePath(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - //Somehow API allows this - if value == "" { - return - } - - if (len(value) < 2) || (len(value) > 128) { - errors = append(errors, fmt.Errorf( - "%q (%q) must contain from 2 to 128 characters ", k, value)) - } - if !(strings.HasPrefix(value, "/")) { - errors = append(errors, fmt.Errorf( - "%q (%q) must start with a forward slash '/'", k, value)) - - } - if strings.Contains(value, "?") { - errors = append(errors, fmt.Errorf( - "%q (%q) must not contain a '?'", k, value)) - } - - return -} - -func validateRoutePort(v interface{}, k string) (ws []string, errors []error) { - return validatePortRange(1024, 65535)(v, k) -} - -func validateAppPort(v interface{}, k string) (ws []string, errors []error) { - return validatePortRange(1024, 65535)(v, k) -} -func validateLBListenerPolicyPriority(v interface{}, k string) (ws []string, errors []error) { - interval := v.(int) - if interval < 1 || interval > 10 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 10", - k)) - } - return -} - -func validateStringLength(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if (len(value) < 1) || (len(value) > 128) { - errors = append(errors, fmt.Errorf( - "%q (%q) must contain from 1 to 128 characters ", k, value)) - } - return -} - -func validatePortRange(start, end int) func(v interface{}, k string) (ws []string, errors []error) { - f := func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if (value < start) || (value > end) { - errors = append(errors, fmt.Errorf( - "%q (%d) must be in the range of %d to %d", k, value, start, end)) - } - return - } - return f -} - -func validateDomainName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if !(strings.Contains(value, ".")) { - errors = append(errors, fmt.Errorf( - "%q (%q) must contain a '.',example.com,foo.example.com", k, value)) - } - - return -} - -func validateAppInstance(v interface{}, k string) (ws []string, errors []error) { - instances := v.(int) - if instances < 0 { - errors = append(errors, fmt.Errorf( - "%q (%q) must be greater than 0", k, instances)) - } - return - -} - -func validateWorkerNum(v interface{}, k string) (ws []string, errors []error) { - workerNum := v.(int) - if workerNum <= 0 { - errors = append(errors, fmt.Errorf( - "%q must be greater than 0", k)) - } - return - -} - -func validateAppZipPath(v interface{}, k string) (ws []string, errors []error) { - path := v.(string) - applicationZip, err := homedir.Expand(path) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q (%q) home directory in the given path couldn't be expanded", k, path)) - } - if !helpers.FileExists(applicationZip) { - errors = append(errors, fmt.Errorf( - "%q (%q) doesn't exist", k, path)) - } - - return - -} - -func validateNotes(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 1000 { - errors = append(errors, fmt.Errorf( - "%q should not exceed 1000 characters", k)) - } - return -} - -func validatePublicBandwidth(v interface{}, k string) (ws []string, errors []error) { - bandwidth := v.(int) - if bandwidth < 0 { - errors = append(errors, fmt.Errorf( - "%q (%q) must be greater than 0", k, bandwidth)) - return - } - validBandwidths := []int{250, 1000, 5000, 10000, 20000} - for _, b := range validBandwidths { - if b == bandwidth { - return - } - } - errors = append(errors, fmt.Errorf( - "%q (%d) must be one of the value from %d", k, bandwidth, validBandwidths)) - return - -} - -func validateMaxConn(v interface{}, k string) (ws []string, errors []error) { - maxConn := v.(int) - if maxConn < 1 || maxConn > 64000 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 64000", - k)) - return - } - return -} - -func validateKeyLifeTime(v interface{}, k string) (ws []string, errors []error) { - secs := v.(int) - if secs < 1800 || secs > 86400 { - errors = append(errors, fmt.Errorf( - "%q must be between 1800 and 86400", - k)) - return - } - return -} - -func validateWeight(v interface{}, k string) (ws []string, errors []error) { - weight := v.(int) - if weight < 0 || weight > 100 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 100", - k)) - } - return -} - -func validateSizePerZone(v interface{}, k string) (ws []string, errors []error) { - sizePerZone := v.(int) - if sizePerZone <= 0 { - errors = append(errors, fmt.Errorf( - "%q must be greater than 0", - k)) - } - return -} - -func validateInterval(v interface{}, k string) (ws []string, errors []error) { - interval := v.(int) - if interval < 2 || interval > 60 { - errors = append(errors, fmt.Errorf( - "%q must be between 2 and 60", - k)) - } - return -} - -func validateMaxRetries(v interface{}, k string) (ws []string, errors []error) { - maxRetries := v.(int) - if maxRetries < 1 || maxRetries > 10 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 10", - k)) - } - return -} - -func validateTimeout(v interface{}, k string) (ws []string, errors []error) { - timeout := v.(int) - if timeout < 1 || timeout > 59 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 59", - k)) - } - return -} - -func validateURLPath(v interface{}, k string) (ws []string, errors []error) { - urlPath := v.(string) - if len(urlPath) > 250 || !strings.HasPrefix(urlPath, "/") { - errors = append(errors, fmt.Errorf( - "%q should start with ‘/‘ and has a max length of 250 characters.", - k)) - } - return -} - -func validateSecurityRuleDirection(v interface{}, k string) (ws []string, errors []error) { - validDirections := map[string]bool{ - "ingress": true, - "egress": true, - } - - value := v.(string) - _, found := validDirections[value] - if !found { - strarray := make([]string, 0, len(validDirections)) - for key := range validDirections { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid security group rule direction %q. Valid types are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateSecurityRuleEtherType(v interface{}, k string) (ws []string, errors []error) { - validEtherTypes := map[string]bool{ - "IPv4": true, - "IPv6": true, - } - - value := v.(string) - _, found := validEtherTypes[value] - if !found { - strarray := make([]string, 0, len(validEtherTypes)) - for key := range validEtherTypes { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid security group rule ethernet type %q. Valid types are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -//validateIP... -func validateIP(v interface{}, k string) (ws []string, errors []error) { - address := v.(string) - if net.ParseIP(address) == nil { - errors = append(errors, fmt.Errorf( - "%q must be a valid ip address", - k)) - } - return -} - -//validateCIDR... -func validateCIDR(v interface{}, k string) (ws []string, errors []error) { - address := v.(string) - _, _, err := net.ParseCIDR(address) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q must be a valid cidr address", - k)) - } - return -} - -//validateCIDRAddress... -func validateCIDRAddress() schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - address := v.(string) - _, _, err := net.ParseCIDR(address) - if err != nil { - errors = append(errors, fmt.Errorf( - "%q must be a valid cidr address", - k)) - } - return - } -} - -//validateOverlappingAddress... -func validateOverlappingAddress() schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - nonOverlappingCIDR := map[string]bool{ - "127.0.0.0/8": true, - "161.26.0.0/16": true, - "166.8.0.0/14": true, - "169.254.0.0/16": true, - "224.0.0.0/4": true, - } - - address := v.(string) - _, found := nonOverlappingCIDR[address] - if found { - errors = append(errors, fmt.Errorf( - "%q the request is overlapping with reserved address ranges", - k)) - } - return - } -} - -//validateRemoteIP... -func validateRemoteIP(v interface{}, k string) (ws []string, errors []error) { - _, err1 := validateCIDR(v, k) - _, err2 := validateIP(v, k) - - if len(err1) != 0 && len(err2) != 0 { - errors = append(errors, fmt.Errorf( - "%q must be a valid remote ip address (cidr or ip)", - k)) - } - return -} - -//validateIPorCIDR... -func validateIPorCIDR() schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - _, err1 := validateCIDR(v, k) - _, err2 := validateIP(v, k) - - if len(err1) != 0 && len(err2) != 0 { - errors = append(errors, fmt.Errorf( - "%q must be a valid remote ip address (cidr or ip)", - k)) - } - return - } -} - -func validateSecurityRuleProtocol(v interface{}, k string) (ws []string, errors []error) { - validProtocols := map[string]bool{ - "icmp": true, - "tcp": true, - "udp": true, - } - - value := v.(string) - _, found := validProtocols[value] - if !found { - strarray := make([]string, 0, len(validProtocols)) - for key := range validProtocols { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid security group rule ethernet type %q. Valid types are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateNamespace(ns string) error { - os := strings.Split(ns, "_") - if len(os) < 2 || (len(os) == 2 && (len(os[0]) == 0 || len(os[1]) == 0)) { - return fmt.Errorf( - "Namespace is (%s), it must be of the form _, provider can't find the auth key if you use _ as well", ns) - } - return nil -} - -//func validateJSONString(v interface{}, k string) (ws []string, errors []error) { -// if _, err := normalizeJSONString(v); err != nil { -// errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) -// } -// if err := validateKeyValue(v); err != nil { -// errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) -// } -// return -//} - -func validateJSONString() schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - if _, err := normalizeJSONString(v); err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) - } - if err := validateKeyValue(v); err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) - } - return - } -} - -func validateRegexp(regex string) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - acceptedcharacters, _ := regexp.MatchString(regex, value) - - if !acceptedcharacters { - errors = append(errors, fmt.Errorf( - "%q (%q) should match regexp %s ", k, v, regex)) - } - - return - - } -} - -// NoZeroValues is a SchemaValidateFunc which tests if the provided value is -// not a zero value. It's useful in situations where you want to catch -// explicit zero values on things like required fields during validation. -func validateNoZeroValues() schema.SchemaValidateFunc { - return func(i interface{}, k string) (ws []string, errors []error) { - - if reflect.ValueOf(i).Interface() == reflect.Zero(reflect.TypeOf(i)).Interface() { - switch reflect.TypeOf(i).Kind() { - case reflect.String: - errors = append(errors, fmt.Errorf("%s value must not be empty.", k)) - case reflect.Int, reflect.Float64: - errors = append(errors, fmt.Errorf("%s value must not be zero.", k)) - default: - // this validator should only ever be applied to TypeString, TypeInt and TypeFloat - errors = append(errors, fmt.Errorf("can't use NoZeroValues with %T attribute %s", k, i)) - } - } - return - } -} - -func validateBindedPackageName() schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if !(strings.HasPrefix(value, "/")) { - errors = append(errors, fmt.Errorf( - "%q (%q) must start with a forward slash '/'.The package name should be '/whisk.system/cloudant', '/test@in.ibm.com_new/utils' or '/_/utils'", k, value)) - - } - - index := strings.LastIndex(value, "/") - - if index < 2 || index == len(value)-1 { - errors = append(errors, fmt.Errorf( - "%q (%q) is not a valid bind package name.The package name should be '/whisk.system/cloudant','/test@in.ibm.com_new/utils' or '/_/utils'", k, value)) - - } - - return - } -} - -func validateKeyValue(jsonString interface{}) error { - var j [](map[string]interface{}) - if jsonString == nil || jsonString.(string) == "" { - return nil - } - s := jsonString.(string) - err := json.Unmarshal([]byte(s), &j) - if err != nil { - return err - } - for _, v := range j { - _, exists := v["key"] - if !exists { - return errors.New("'key' is missing from json") - } - _, exists = v["value"] - if !exists { - return errors.New("'value' is missing from json") - } - } - return nil -} - -func validateActionName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - if strings.HasPrefix(value, "/") { - errors = append(errors, fmt.Errorf( - "%q (%q) must not start with a forward slash '/'.The action name should be like 'myaction' or utils/cloudant'", k, value)) - - } - - const alphaNumeric = "abcdefghijklmnopqrstuvwxyz0123456789/_@.-" - - for _, char := range value { - if !strings.Contains(alphaNumeric, strings.ToLower(string(char))) { - errors = append(errors, fmt.Errorf( - "%q (%q) The name of the package contains illegal characters", k, value)) - } - } - - return -} - -func validateActionKind(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - kindList := []string{"php:7.3", "nodejs:8", "swift:3", "nodejs", "blackbox", "java", "sequence", "nodejs:10", "python:3", "python", "python:2", "swift", "swift:4.2"} - if !stringInSlice(value, kindList) { - errors = append(errors, fmt.Errorf( - "%q (%q) Invalid kind is provided.Supported list of kinds of actions are (%q)", k, value, kindList)) - } - return -} - -func stringInSlice(str string, list []string) bool { - for _, v := range list { - if v == str { - return true - } - } - return false -} - -func validateFunctionName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - - var validName = regexp.MustCompile(`\A([\w]|[\w][\w@ .-]*[\w@.-]+)\z`) - if !validName.MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q (%q) The name contains illegal characters", k, value)) - - } - return -} - -func validateStorageType(v interface{}, k string) (ws []string, errors []error) { - validEtherTypes := map[string]bool{ - "Endurance": true, - "Performance": true, - } - - value := v.(string) - _, found := validEtherTypes[value] - if !found { - strarray := make([]string, 0, len(validEtherTypes)) - for key := range validEtherTypes { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid storage type %q. Valid types are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateRole(v interface{}, k string) (ws []string, errors []error) { - validRolesTypes := map[string]bool{ - "Writer": true, - "Reader": true, - "Manager": true, - "Administrator": true, - "Operator": true, - "Viewer": true, - "Editor": true, - } - - value := v.(string) - _, found := validRolesTypes[value] - if !found { - strarray := make([]string, 0, len(validRolesTypes)) - for key := range validRolesTypes { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid role %q. Valid roles are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateDayOfWeek(v interface{}, k string) (ws []string, errors []error) { - validDayTypes := map[string]bool{ - "SUNDAY": true, - "MONDAY": true, - "TUESDAY": true, - "WEDNESDAY": true, - "THURSDAY": true, - "FRIDAY": true, - "SATURDAY": true, - } - - value := v.(string) - _, found := validDayTypes[value] - if !found { - strarray := make([]string, 0, len(validDayTypes)) - for key := range validDayTypes { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid day %q. Valid days are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateScheduleType(v interface{}, k string) (ws []string, errors []error) { - validSchdTypes := map[string]bool{ - "HOURLY": true, - "DAILY": true, - "WEEKLY": true, - } - - value := v.(string) - _, found := validSchdTypes[value] - if !found { - strarray := make([]string, 0, len(validSchdTypes)) - for key := range validSchdTypes { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid schedule type %q. Valid schedules are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateHour(start, end int) func(v interface{}, k string) (ws []string, errors []error) { - f := func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if (value < start) || (value > end) { - errors = append(errors, fmt.Errorf( - "%q (%d) must be in the range of %d to %d", k, value, start, end)) - } - return - } - return f -} - -func validateMinute(start, end int) func(v interface{}, k string) (ws []string, errors []error) { - f := func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if (value < start) || (value > end) { - errors = append(errors, fmt.Errorf( - "%q (%d) must be in the range of %d to %d", k, value, start, end)) - } - return - } - return f -} - -func validateDatacenterOption(v []interface{}, allowedValues []string) error { - for _, option := range v { - if option == nil { - return fmt.Errorf("Provide a valid `datacenter_choice`") - } - values := option.(map[string]interface{}) - for k := range values { - if !stringInSlice(k, allowedValues) { - return fmt.Errorf( - "%q Invalid values are provided in `datacenter_choice`. Supported list of keys are (%q)", k, allowedValues) - } - - } - } - return nil -} - -func validateLBTimeout(v interface{}, k string) (ws []string, errors []error) { - timeout := v.(int) - if timeout <= 0 || timeout > 3600 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 3600", - k)) - } - return -} - -// validateRecordType ensures that the dns record type is valid -func validateRecordType(t string, proxied bool) error { - switch t { - case "A", "AAAA", "CNAME": - return nil - case "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA", "URI": - if !proxied { - return nil - } - default: - return fmt.Errorf( - `Invalid type %q. Valid types are "A", "AAAA", "CNAME", "TXT", "SRV", "LOC", "MX", "NS", "SPF", "CAA", "CERT", "DNSKEY", "DS", "NAPTR", "SMIMEA", "SSHFP", "TLSA" or "URI".`, t) - } - - return fmt.Errorf("Type %q cannot be proxied", t) -} - -// validateRecordName ensures that based on supplied record type, the name content matches -// Currently only validates A and AAAA types -func validateRecordName(t string, value string) error { - switch t { - case "A": - // Must be ipv4 addr - addr := net.ParseIP(value) - if addr == nil || !strings.Contains(value, ".") { - return fmt.Errorf("A record must be a valid IPv4 address, got: %q", value) - } - case "AAAA": - // Must be ipv6 addr - addr := net.ParseIP(value) - if addr == nil || !strings.Contains(value, ":") { - return fmt.Errorf("AAAA record must be a valid IPv6 address, got: %q", value) - } - case "TXT": - // Must be printable ASCII - for i := 0; i < len(value); i++ { - char := value[i] - if (char < 0x20) || (0x7F < char) { - return fmt.Errorf("TXT record must contain printable ASCII, found: %q", char) - } - } - } - - return nil -} - -func validateVLANName(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - if len(value) > 20 { - errors = append(errors, fmt.Errorf( - "Length provided for '%q' is too long. Maximum length is 20 characters", k)) - } - return -} - -func validateAuthProtocol(v interface{}, k string) (ws []string, errors []error) { - authProtocol := v.(string) - if authProtocol != "MD5" && authProtocol != "SHA1" && authProtocol != "SHA256" { - errors = append(errors, fmt.Errorf( - "%q auth protocol can be MD5 or SHA1 or SHA256", k)) - } - return -} - -//ValidateIPVersion -func validateIPVersion(v interface{}, k string) (ws []string, errors []error) { - validVersions := map[string]bool{ - "ipv4": true, - "ipv6": true, - } - - value := v.(string) - _, found := validVersions[value] - if !found { - strarray := make([]string, 0, len(validVersions)) - for key := range validVersions { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid ip version type %q. Valid types are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func isSecurityGroupAddress(s string) bool { - return net.ParseIP(s) != nil -} - -func isSecurityGroupCIDR(s string) bool { - _, _, err := net.ParseCIDR(s) - return err == nil -} - -func isSecurityGroupIdentityByCRN(s string) bool { - segments := strings.Split(s, ":") - return len(segments) == 10 && segments[0] == "crn" -} - -func isSecurityGroupIdentityByHRef(s string) bool { - return validHRef.MatchString(s) -} - -func validateGeneration(v interface{}, k string) (ws []string, errors []error) { - validVersions := map[string]bool{ - "gc": true, - "gt": true, - } - - value := v.(string) - _, found := validVersions[value] - if !found { - strarray := make([]string, 0, len(validVersions)) - for key := range validVersions { - strarray = append(strarray, key) - } - errors = append(errors, fmt.Errorf( - "%q contains an invalid generation type %q. Valid types are %q.", - k, value, strings.Join(strarray, ","))) - } - return -} - -func validateEncyptionProtocol(v interface{}, k string) (ws []string, errors []error) { - encyptionProtocol := v.(string) - if encyptionProtocol != "DES" && encyptionProtocol != "3DES" && encyptionProtocol != "AES128" && encyptionProtocol != "AES192" && encyptionProtocol != "AES256" { - errors = append(errors, fmt.Errorf( - "%q encryption protocol can be DES or 3DES or AES128 or AES192 or AES256", k)) - } - return -} - -func validateDeadPeerDetectionInterval(v interface{}, k string) (ws []string, errors []error) { - secs := v.(int) - if secs < 15 || secs > 86399 { - errors = append(errors, fmt.Errorf( - "%q must be between 15 and 86399", - k)) - return - } - return -} - -func validateDiffieHellmanGroup(v interface{}, k string) (ws []string, errors []error) { - diffieHellmanGroup := v.(int) - if diffieHellmanGroup != 0 && diffieHellmanGroup != 1 && diffieHellmanGroup != 2 && diffieHellmanGroup != 5 { - errors = append(errors, fmt.Errorf( - "%q Diffie Hellman Group can be 0 or 1 or 2 or 5", k)) - } - return -} - -func validateAllowedRangeInt(start, end int) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - value := v.(int) - if value < start || value > end { - errors = append(errors, fmt.Errorf( - "%q must contain a valid int value should be in range(%d, %d), got %d", - k, start, end, value)) - } - return - } -} - -func validateDeadPeerDetectionTimeout(v interface{}, k string) (ws []string, errors []error) { - secs := v.(int) - if secs < 15 || secs > 86399 { - errors = append(errors, fmt.Errorf( - "%q must be between 15 and 86399", - k)) - return - } - return -} - -func validatekeylife(v interface{}, k string) (ws []string, errors []error) { - keylife := v.(int) - if keylife < 120 || keylife > 172800 { - errors = append(errors, fmt.Errorf( - "%q keylife value can be between 120 and 172800", k)) - } - return -} - -func validateLBListenerPort(v interface{}, k string) (ws []string, errors []error) { - return validatePortRange(1, 65535)(v, k) -} - -func validateLBListenerConnectionLimit(v interface{}, k string) (ws []string, errors []error) { - conns := v.(int) - if conns < 1 || conns > 15000 { - errors = append(errors, fmt.Errorf( - "%q must be between 1 and 15000", - k)) - return - } - return -} - -//ValidateISName -func validateISName(v interface{}, k string) (ws []string, errors []error) { - name := v.(string) - acceptedcharacters, _ := regexp.MatchString(`^[a-z][-a-z0-9]*$`, name) - endwithalphanumeric, _ := regexp.MatchString(`.*[a-z0-9]$`, name) - length := len(name) - if acceptedcharacters == true { - if length <= 40 { - if endwithalphanumeric == true { - if strings.Contains(name, "--") != true { - return - } else { - errors = append(errors, fmt.Errorf( - "%q (%q) should not contain consecutive dash(-)", k, v)) - } - } else { - errors = append(errors, fmt.Errorf( - "%q (%q) should not end with dash(-) ", k, v)) - } - } else { - errors = append(errors, fmt.Errorf( - "%q (%q) should not exceed 40 characters", k, v)) - } - - } else { - errors = append(errors, fmt.Errorf( - "%q (%q) should contain only lowercase alphanumeric,dash and should begin with lowercase character", k, v)) - } - return -} - -// ValidateFunc is honored only when the schema's Type is set to TypeInt, -// TypeFloat, TypeString, TypeBool, or TypeMap. It is ignored for all other types. -// enum to list all the validator functions supported by this tool. -type FunctionIdentifier int - -const ( - IntBetween FunctionIdentifier = iota - IntAtLeast - IntAtMost - ValidateAllowedStringValue - StringLenBetween - ValidateIPorCIDR - ValidateCIDRAddress - ValidateAllowedIntValue - ValidateRegexpLen - ValidateRegexp - ValidateNoZeroValues - ValidateJSONString - ValidateJSONParam - ValidateBindedPackageName - ValidateOverlappingAddress -) - -// MarshalText implements the encoding.TextMarshaler interface. -// Without this function, when FunctionalIdentifier is marshaled, it prints 0,1,2.. instead -// of printing IntBetween, IntAtLeast, IntAtMost.. in JSON Output -func (f FunctionIdentifier) MarshalText() ([]byte, error) { - return []byte(f.String()), nil -} - -// Use stringer tool to generate this later. -func (i FunctionIdentifier) String() string { - return [...]string{"IntBetween", "IntAtLeast", "IntAtMost", "ValidateAllowedStringValue", "StringLenBetween", "ValidateIPorCIDR", "ValidateAllowedIntValue", "ValidateRegexpLen", "ValidateRegexp", "ValidateNoZeroValues", "ValidateJSONString", "ValidateJSONParam", "ValidateBindedPackageName", "ValidateOverlappingAddress"}[i] -} - -// ValueType -- Copied from Terraform for now. You can refer to Terraform ValueType directly. -// ValueType is an enum of the type that can be represented by a schema. -type ValueType int - -const ( - TypeInvalid ValueType = iota - TypeBool - TypeInt - TypeFloat - TypeString -) - -// MarshalText implements the encoding.TextMarshaler interface. -func (vt ValueType) MarshalText() ([]byte, error) { - return []byte(vt.String()), nil -} - -// Use Stringer tool to generate this later. -func (i ValueType) String() string { - return [...]string{"TypeInvalid", "TypeBool", "TypeInt", "TypeFloat", "TypeString"}[i] -} - -// Type of constraints required for validation -type ValueConstraintType int - -const ( - MinValue ValueConstraintType = iota - MaxValue - MinValueLength - MaxValueLength - AllowedValues - MatchesValue -) - -// MarshalText implements the encoding.TextMarshaler interface. -func (vct ValueConstraintType) MarshalText() ([]byte, error) { - return []byte(vct.String()), nil -} - -// Use Stringer tool to generate this later. -func (i ValueConstraintType) String() string { - return [...]string{"MinValue", "MaxValue", "MinValueLength", "MaxValueLength", "AllowedValues", "MatchesValue"}[i] -} - -// Schema is used to describe the validation schema. -type ValidateSchema struct { - - //This is the parameter name. - //Ex: private_subnet in ibm_compute_bare_metal resource - Identifier string - - // this is similar to schema.ValueType - Type ValueType - - // The actual validation function that needs to be invoked. - // Ex: IntBetween, validateAllowedIntValue, validateAllowedStringValue - ValidateFunctionIdentifier FunctionIdentifier - - MinValue string - MaxValue string - AllowedValues string //Comma separated list of strings. - Matches string - Regexp string - MinValueLength int - MaxValueLength int - - // Is this nullable - Nullable bool - - Optional bool - Required bool - Default interface{} - ForceNew bool -} - -type ResourceValidator struct { - // This is the resource name - Found in provider.go of IBM Terraform provider. - // Ex: ibm_compute_monitor, ibm_compute_bare_metal, ibm_compute_dedicated_host, ibm_cis_global_load_balancer etc., - ResourceName string - - // Array of validator objects. Each object refers to one parameter in the resource provider. - Schema []ValidateSchema -} - -type ValidatorDict struct { - ResourceValidatorDictionary map[string]*ResourceValidator - DataSourceValidatorDictionary map[string]*ResourceValidator -} - -// Resource Validator Dictionary -- For all terraform IBM Resource Providers. -// This is of type - Array of ResourceValidators. -// Each object in this array is a type of map, where key == ResourceName and value == array of ValidateSchema objects. Each of these -// ValidateSchema corresponds to a parameter in the resourceProvider. - -var validatorDict = Validator() - -// This is the main validation function. This function will be used in all the provider code. -func InvokeValidator(resourceName, identifier string) schema.SchemaValidateFunc { - // Loop through dictionary and identify the resource and then the parameter configuration. - var schemaToInvoke ValidateSchema - found := false - resourceItem := validatorDict.ResourceValidatorDictionary[resourceName] - if resourceItem.ResourceName == resourceName { - parameterValidateSchema := resourceItem.Schema - for _, validateSchema := range parameterValidateSchema { - if validateSchema.Identifier == identifier { - schemaToInvoke = validateSchema - found = true - break - } - } - } - - if found { - return invokeValidatorInternal(schemaToInvoke) - } else { - // Add error code later. TODO - return nil - } -} - -func InvokeDataSourceValidator(resourceName, identifier string) schema.SchemaValidateFunc { - // Loop through dictionary and identify the resource and then the parameter configuration. - var schemaToInvoke ValidateSchema - found := false - - dataSourceItem := validatorDict.DataSourceValidatorDictionary[resourceName] - if dataSourceItem.ResourceName == resourceName { - parameterValidateSchema := dataSourceItem.Schema - for _, validateSchema := range parameterValidateSchema { - if validateSchema.Identifier == identifier { - schemaToInvoke = validateSchema - found = true - break - } - } - } - - if found { - return invokeValidatorInternal(schemaToInvoke) - } else { - // Add error code later. TODO - return nil - } -} - -// the function is currently modified to invoke SchemaValidateFunc directly. -// But in terraform, we will just return SchemaValidateFunc as shown below.. So terraform will invoke this func -func invokeValidatorInternal(schema ValidateSchema) schema.SchemaValidateFunc { - - funcIdentifier := schema.ValidateFunctionIdentifier - switch funcIdentifier { - case IntBetween: - minValue := schema.GetValue(MinValue) - maxValue := schema.GetValue(MaxValue) - return validation.IntBetween(minValue.(int), maxValue.(int)) - case IntAtLeast: - minValue := schema.GetValue(MinValue) - return validation.IntAtLeast(minValue.(int)) - case IntAtMost: - maxValue := schema.GetValue(MaxValue) - return validation.IntAtMost(maxValue.(int)) - case ValidateAllowedStringValue: - allowedValues := schema.GetValue(AllowedValues) - return validateAllowedStringValue(allowedValues.([]string)) - case StringLenBetween: - return validation.StringLenBetween(schema.MinValueLength, schema.MaxValueLength) - case ValidateIPorCIDR: - return validateIPorCIDR() - case ValidateCIDRAddress: - return validateCIDRAddress() - case ValidateAllowedIntValue: - allowedValues := schema.GetValue(AllowedValues) - return validateAllowedIntValue(allowedValues.([]int)) - case ValidateRegexpLen: - return validateRegexpLen(schema.MinValueLength, schema.MaxValueLength, schema.Regexp) - case ValidateRegexp: - return validateRegexp(schema.Regexp) - case ValidateNoZeroValues: - return validateNoZeroValues() - case ValidateJSONString: - return validateJSONString() - case ValidateBindedPackageName: - return validateBindedPackageName() - case ValidateOverlappingAddress: - return validateOverlappingAddress() - - default: - return nil - } -} - -// utility functions - Move to different package -func (vs ValidateSchema) GetValue(valueConstraint ValueConstraintType) interface{} { - - var valueToConvert string - switch valueConstraint { - case MinValue: - valueToConvert = vs.MinValue - case MaxValue: - valueToConvert = vs.MaxValue - case AllowedValues: - valueToConvert = vs.AllowedValues - case MatchesValue: - valueToConvert = vs.Matches - } - - switch vs.Type { - case TypeInvalid: - return nil - case TypeBool: - b, err := strconv.ParseBool(valueToConvert) - if err != nil { - return vs.Zero() - } - return b - case TypeInt: - // Convert comma separated string to array - if strings.Contains(valueToConvert, ",") { - var arr2 []int - arr1 := strings.Split(valueToConvert, ",") - for _, ele := range arr1 { - e, err := strconv.Atoi(strings.TrimSpace(ele)) - if err != nil { - return vs.Zero() - } - arr2 = append(arr2, e) - } - return arr2 - } else { - num, err := strconv.Atoi(valueToConvert) - if err != nil { - return vs.Zero() - } - return num - } - - case TypeFloat: - f, err := strconv.ParseFloat(valueToConvert, 32) - if err != nil { - return vs.Zero() - } - return f - case TypeString: - //return valueToConvert - // Convert comma separated string to array - arr := strings.Split(valueToConvert, ",") - for i, ele := range arr { - arr[i] = strings.TrimSpace(ele) - } - return arr - default: - panic(fmt.Sprintf("unknown type %s", vs.Type)) - } -} - -// Zero returns the zero value for a type. -func (vs ValidateSchema) Zero() interface{} { - switch vs.Type { - case TypeInvalid: - return nil - case TypeBool: - return false - case TypeInt: - return make([]string, 0) - case TypeFloat: - return 0.0 - case TypeString: - return make([]int, 0) - default: - panic(fmt.Sprintf("unknown type %s", vs.Type)) - } -} diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/main.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/main.go index 380b5cf1a1..a3769d67d0 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/main.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider" "github.com/IBM-Cloud/terraform-provider-ibm/version" "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" ) @@ -11,6 +11,6 @@ import ( func main() { log.Println("IBM Cloud Provider version", version.Version, version.VersionPrerelease, version.GitCommit) plugin.Serve(&plugin.ServeOpts{ - ProviderFunc: ibm.Provider, + ProviderFunc: provider.Provider, }) } diff --git a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/version/version.go b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/version/version.go index 53b43b7b3b..cfc8360b31 100644 --- a/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/version/version.go +++ b/ibm/vendor/github.com/IBM-Cloud/terraform-provider-ibm/version/version.go @@ -5,7 +5,7 @@ import ( ) // Version is the current provider main version -const Version = "1.38.1" +const Version = "1.40.1" // GitCommit is the git commit that was compiled. This will be filled in by the compiler. var GitCommit string diff --git a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/constants.go b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/constants.go index 923d09ac6a..b02274edfd 100644 --- a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/constants.go +++ b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/constants.go @@ -43,6 +43,7 @@ const ( PROPNAME_AUTH_URL = "AUTH_URL" PROPNAME_AUTH_DISABLE_SSL = "AUTH_DISABLE_SSL" PROPNAME_APIKEY = "APIKEY" + PROPNAME_REFRESH_TOKEN = "REFRESH_TOKEN" // #nosec G101 PROPNAME_CLIENT_ID = "CLIENT_ID" PROPNAME_CLIENT_SECRET = "CLIENT_SECRET" PROPNAME_SCOPE = "SCOPE" diff --git a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/container_authenticator.go b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/container_authenticator.go index 973dcdcf65..ff73283759 100644 --- a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/container_authenticator.go +++ b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/container_authenticator.go @@ -404,7 +404,7 @@ func (authenticator *ContainerAuthenticator) RequestToken() (*IamTokenServerResp // If the user told us to disable SSL verification, then do it now. if authenticator.DisableSSLVerification { transport := &http.Transport{ - /* #nosec G402 */ + // #nosec G402 TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } authenticator.Client.Transport = transport diff --git a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/cp4d_authenticator.go b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/cp4d_authenticator.go index 2dab382f0f..3b0d5aacf7 100644 --- a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/cp4d_authenticator.go +++ b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/cp4d_authenticator.go @@ -303,7 +303,7 @@ func (authenticator *CloudPakForDataAuthenticator) requestToken() (tokenResponse // If the user told us to disable SSL verification, then do it now. if authenticator.DisableSSLVerification { transport := &http.Transport{ - /* #nosec G402 */ + // #nosec G402 TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } authenticator.Client.Transport = transport diff --git a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/iam_authenticator.go b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/iam_authenticator.go index b76d199fe0..6a3247e45e 100644 --- a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/iam_authenticator.go +++ b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/iam_authenticator.go @@ -35,25 +35,28 @@ import ( // type IamAuthenticator struct { - // The apikey used to fetch the bearer token from the IAM token server - // [required]. + // The apikey used to fetch the bearer token from the IAM token server. + // You must specify either ApiKey or RefreshToken. ApiKey string + // The refresh token used to fetch the bearer token from the IAM token server. + // You must specify either ApiKey or RefreshToken. + // If this property is specified, then you also must supply appropriate values + // for the ClientId and ClientSecret properties (i.e. they must be the same + // values that were used to obtain the refresh token). + RefreshToken string + // The URL representing the IAM token server's endpoint; If not specified, // a suitable default value will be used [optional]. URL string // The ClientId and ClientSecret fields are used to form a "basic auth" - // Authorization header for interactions with the IAM token server - - // If neither field is specified, then no Authorization header will be sent - // with token server requests [optional]. These fields are optional, but must - // be specified together. - ClientId string + // Authorization header for interactions with the IAM token server. // If neither field is specified, then no Authorization header will be sent // with token server requests [optional]. These fields are optional, but must // be specified together. + ClientId string ClientSecret string // A flag that indicates whether verification of the server's SSL certificate @@ -85,29 +88,98 @@ var iamNeedsRefreshMutex sync.Mutex const ( // The default (prod) IAM token server base endpoint address. - defaultIamTokenServerEndpoint = "https://iam.cloud.ibm.com" // #nosec G101 - iamGrantTypeApiKey = "urn:ibm:params:oauth:grant-type:apikey" // #nosec G101 + defaultIamTokenServerEndpoint = "https://iam.cloud.ibm.com" // #nosec G101 + iamAuthOperationPathGetToken = "/identity/token" + iamAuthGrantTypeApiKey = "urn:ibm:params:oauth:grant-type:apikey" // #nosec G101 + iamAuthGrantTypeRefreshToken = "refresh_token" // #nosec G101 ) -// NewIamAuthenticator constructs a new IamAuthenticator instance. -func NewIamAuthenticator(apikey string, url string, clientId string, clientSecret string, - disableSSLVerification bool, headers map[string]string) (*IamAuthenticator, error) { - authenticator := &IamAuthenticator{ - ApiKey: apikey, - URL: url, - ClientId: clientId, - ClientSecret: clientSecret, - DisableSSLVerification: disableSSLVerification, - Headers: headers, - } +// IamAuthenticatorBuilder is used to construct an IamAuthenticator instance. +type IamAuthenticatorBuilder struct { + IamAuthenticator +} + +// NewIamAuthenticatorBuilder returns a new builder struct that +// can be used to construct an IamAuthenticator instance. +func NewIamAuthenticatorBuilder() *IamAuthenticatorBuilder { + return &IamAuthenticatorBuilder{} +} + +// SetApiKey sets the ApiKey field in the builder. +func (builder *IamAuthenticatorBuilder) SetApiKey(s string) *IamAuthenticatorBuilder { + builder.IamAuthenticator.ApiKey = s + return builder +} + +// SetRefreshToken sets the RefreshToken field in the builder. +func (builder *IamAuthenticatorBuilder) SetRefreshToken(s string) *IamAuthenticatorBuilder { + builder.IamAuthenticator.RefreshToken = s + return builder +} + +// SetURL sets the URL field in the builder. +func (builder *IamAuthenticatorBuilder) SetURL(s string) *IamAuthenticatorBuilder { + builder.IamAuthenticator.URL = s + return builder +} + +// SetClientIDSecret sets the ClientId and ClientSecret fields in the builder. +func (builder *IamAuthenticatorBuilder) SetClientIDSecret(clientID, clientSecret string) *IamAuthenticatorBuilder { + builder.IamAuthenticator.ClientId = clientID + builder.IamAuthenticator.ClientSecret = clientSecret + return builder +} + +// SetDisableSSLVerification sets the DisableSSLVerification field in the builder. +func (builder *IamAuthenticatorBuilder) SetDisableSSLVerification(b bool) *IamAuthenticatorBuilder { + builder.IamAuthenticator.DisableSSLVerification = b + return builder +} + +// SetScope sets the Scope field in the builder. +func (builder *IamAuthenticatorBuilder) SetScope(s string) *IamAuthenticatorBuilder { + builder.IamAuthenticator.Scope = s + return builder +} + +// SetHeaders sets the Headers field in the builder. +func (builder *IamAuthenticatorBuilder) SetHeaders(headers map[string]string) *IamAuthenticatorBuilder { + builder.IamAuthenticator.Headers = headers + return builder +} + +// SetClient sets the Client field in the builder. +func (builder *IamAuthenticatorBuilder) SetClient(client *http.Client) *IamAuthenticatorBuilder { + builder.IamAuthenticator.Client = client + return builder +} + +// Build() returns a validated instance of the IamAuthenticator with the config that was set in the builder. +func (builder *IamAuthenticatorBuilder) Build() (*IamAuthenticator, error) { // Make sure the config is valid. - err := authenticator.Validate() + err := builder.IamAuthenticator.Validate() if err != nil { return nil, err } - return authenticator, nil + return &builder.IamAuthenticator, nil +} + +// NewIamAuthenticator constructs a new IamAuthenticator instance. +// Deprecated - use the IamAuthenticatorBuilder instead. +func NewIamAuthenticator(apiKey string, url string, clientId string, clientSecret string, + disableSSLVerification bool, headers map[string]string) (*IamAuthenticator, error) { + + authenticator, err := NewIamAuthenticatorBuilder(). + SetApiKey(apiKey). + SetURL(url). + SetClientIDSecret(clientId, clientSecret). + SetDisableSSLVerification(disableSSLVerification). + SetHeaders(headers). + Build() + + return authenticator, err } // newIamAuthenticatorFromMap constructs a new IamAuthenticator instance from a map. @@ -121,12 +193,15 @@ func newIamAuthenticatorFromMap(properties map[string]string) (authenticator *Ia disableSSL = false } - authenticator, err = NewIamAuthenticator(properties[PROPNAME_APIKEY], properties[PROPNAME_AUTH_URL], - properties[PROPNAME_CLIENT_ID], properties[PROPNAME_CLIENT_SECRET], - disableSSL, nil) - if authenticator != nil { - authenticator.Scope = properties[PROPNAME_SCOPE] - } + authenticator, err = NewIamAuthenticatorBuilder(). + SetApiKey(properties[PROPNAME_APIKEY]). + SetRefreshToken(properties[PROPNAME_REFRESH_TOKEN]). + SetURL(properties[PROPNAME_AUTH_URL]). + SetClientIDSecret(properties[PROPNAME_CLIENT_ID], properties[PROPNAME_CLIENT_SECRET]). + SetDisableSSLVerification(disableSSL). + SetScope(properties[PROPNAME_SCOPE]). + Build() + return } @@ -165,23 +240,40 @@ func (authenticator *IamAuthenticator) setTokenData(tokenData *iamTokenData) { defer authenticator.tokenDataMutex.Unlock() authenticator.tokenData = tokenData + + // Next, we should save the just-returned refresh token back to the main + // authenticator struct. + // This is done so that if we were originally configured with + // a refresh token, then we'll be sure to use a "fresh" + // refresh token next time we invoke the "get token" operation. + // This was recommended by the IAM team to avoid problems in the future + // if the token service is changed to invalidate an existing refresh token + // when a new one is generated and returned in the response. + if tokenData != nil { + authenticator.RefreshToken = tokenData.RefreshToken + } } // Validate the authenticator's configuration. // -// Ensures the ApiKey is valid, and the ClientId and ClientSecret pair are -// mutually inclusive. +// Ensures that the ApiKey and RefreshToken properties are mutually exclusive, +// and that the ClientId and ClientSecret properties are mutually inclusive. func (this *IamAuthenticator) Validate() error { - if this.ApiKey == "" { - return fmt.Errorf(ERRORMSG_PROP_MISSING, "ApiKey") + + // The user should specify exactly one of ApiKey or RefreshToken. + if this.ApiKey == "" && this.RefreshToken == "" || + this.ApiKey != "" && this.RefreshToken != "" { + return fmt.Errorf(ERRORMSG_EXCLUSIVE_PROPS_ERROR, "ApiKey", "RefreshToken") } - if HasBadFirstOrLastChar(this.ApiKey) { + if this.ApiKey != "" && HasBadFirstOrLastChar(this.ApiKey) { return fmt.Errorf(ERRORMSG_PROP_INVALID, "ApiKey") } - // Validate ClientId and ClientSecret. They must both be specified togther or neither should be specified. - if this.ClientId == "" && this.ClientSecret == "" { + // Validate ClientId and ClientSecret. + // If RefreshToken is not specified, then both or neither should be specified. + // If RefreshToken is specified, then both must be specified. + if this.ClientId == "" && this.ClientSecret == "" && this.RefreshToken == "" { // Do nothing as this is the valid scenario } else { // Since it is NOT the case that both properties are empty, make sure BOTH are specified. @@ -255,7 +347,6 @@ func (authenticator *IamAuthenticator) invokeRequestTokenData() error { // RequestToken fetches a new access token from the token server. func (authenticator *IamAuthenticator) RequestToken() (*IamTokenServerResponse, error) { - var operationPath = "/identity/token" // Use the default IAM URL if one was not specified by the user. url := authenticator.URL @@ -263,20 +354,31 @@ func (authenticator *IamAuthenticator) RequestToken() (*IamTokenServerResponse, url = defaultIamTokenServerEndpoint } else { // Canonicalize the URL by removing the operation path if it was specified by the user. - url = strings.TrimSuffix(url, operationPath) + url = strings.TrimSuffix(url, iamAuthOperationPathGetToken) } builder := NewRequestBuilder(POST) - _, err := builder.ResolveRequestURL(url, operationPath, nil) + _, err := builder.ResolveRequestURL(url, iamAuthOperationPathGetToken, nil) if err != nil { return nil, err } - builder.AddHeader(CONTENT_TYPE, "application/x-www-form-urlencoded"). - AddHeader(Accept, APPLICATION_JSON). - AddFormData("grant_type", "", "", iamGrantTypeApiKey). - AddFormData("apikey", "", "", authenticator.ApiKey). - AddFormData("response_type", "", "", "cloud_iam") + builder.AddHeader(CONTENT_TYPE, "application/x-www-form-urlencoded") + builder.AddHeader(Accept, APPLICATION_JSON) + builder.AddFormData("response_type", "", "", "cloud_iam") + + if authenticator.ApiKey != "" { + // If ApiKey was configured, then use grant_type "apikey" to obtain an access token. + builder.AddFormData("grant_type", "", "", iamAuthGrantTypeApiKey) + builder.AddFormData("apikey", "", "", authenticator.ApiKey) + } else if authenticator.RefreshToken != "" { + // Otherwise, if RefreshToken was configured then use grant_type "refresh_token". + builder.AddFormData("grant_type", "", "", iamAuthGrantTypeRefreshToken) + builder.AddFormData("refresh_token", "", "", authenticator.RefreshToken) + } else { + // We shouldn't ever get here due to prior validations, but just in case, let's log an error. + return nil, fmt.Errorf(ERRORMSG_EXCLUSIVE_PROPS_ERROR, "ApiKey", "RefreshToken") + } // Add any optional parameters to the request. if authenticator.Scope != "" { @@ -295,6 +397,8 @@ func (authenticator *IamAuthenticator) RequestToken() (*IamTokenServerResponse, // If client id and secret were configured by the user, then set them on the request // as a basic auth header. + // Our previous validation step would have made sure that both values are specified + // if the RefreshToken property was specified. if authenticator.ClientId != "" && authenticator.ClientSecret != "" { req.SetBasicAuth(authenticator.ClientId, authenticator.ClientSecret) } @@ -308,7 +412,7 @@ func (authenticator *IamAuthenticator) RequestToken() (*IamTokenServerResponse, // If the user told us to disable SSL verification, then do it now. if authenticator.DisableSSLVerification { transport := &http.Transport{ - /* #nosec G402 */ + // #nosec G402 TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } authenticator.Client.Transport = transport @@ -378,9 +482,10 @@ type IamTokenServerResponse struct { // iamTokenData : This struct represents the cached information related to a fetched access token. type iamTokenData struct { - AccessToken string - RefreshTime int64 - Expiration int64 + AccessToken string + RefreshToken string + RefreshTime int64 + Expiration int64 } // newIamTokenData: constructs a new IamTokenData instance from the specified IamTokenServerResponse instance. @@ -395,9 +500,10 @@ func newIamTokenData(tokenResponse *IamTokenServerResponse) (*iamTokenData, erro refreshTime := expireTime - int64(float64(timeToLive)*0.2) tokenData := &iamTokenData{ - AccessToken: tokenResponse.AccessToken, - Expiration: expireTime, - RefreshTime: refreshTime, + AccessToken: tokenResponse.AccessToken, + RefreshToken: tokenResponse.RefreshToken, + Expiration: expireTime, + RefreshTime: refreshTime, } return tokenData, nil @@ -425,5 +531,4 @@ func (this *iamTokenData) needsRefresh() bool { } return false - } diff --git a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/version.go b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/version.go index 9042252651..9f8c0a039a 100644 --- a/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/version.go +++ b/ibm/vendor/github.com/IBM/go-sdk-core/v5/core/version.go @@ -15,4 +15,4 @@ package core // limitations under the License. // Version of the SDK -const __VERSION__ = "5.8.2" +const __VERSION__ = "5.9.1" diff --git a/ibm/vendor/github.com/IBM/networking-go-sdk/alertsv1/alerts_v1.go b/ibm/vendor/github.com/IBM/networking-go-sdk/alertsv1/alerts_v1.go new file mode 100644 index 0000000000..f9488e42ad --- /dev/null +++ b/ibm/vendor/github.com/IBM/networking-go-sdk/alertsv1/alerts_v1.go @@ -0,0 +1,1419 @@ +/** + * (C) Copyright IBM Corp. 2022. + * + * 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. + */ + +/* + * IBM OpenAPI SDK Code Generator Version: 3.43.0-49eab5c7-20211117-152138 + */ + +// Package alertsv1 : Operations and models for the AlertsV1 service +package alertsv1 + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "reflect" + "time" + + "github.com/IBM/go-sdk-core/v5/core" + common "github.com/IBM/networking-go-sdk/common" +) + +// AlertsV1 : CIS Alert Policies +// +// API Version: 1.0.0 +type AlertsV1 struct { + Service *core.BaseService + + // Full url-encoded CRN of the service instance. + Crn *string +} + +// DefaultServiceURL is the default URL to make service requests to. +const DefaultServiceURL = "https://api.cis.cloud.ibm.com" + +// DefaultServiceName is the default key used to find external configuration information. +const DefaultServiceName = "alerts" + +// AlertsV1Options : Service options +type AlertsV1Options struct { + ServiceName string + URL string + Authenticator core.Authenticator + + // Full url-encoded CRN of the service instance. + Crn *string `validate:"required"` +} + +// NewAlertsV1UsingExternalConfig : constructs an instance of AlertsV1 with passed in options and external configuration. +func NewAlertsV1UsingExternalConfig(options *AlertsV1Options) (alerts *AlertsV1, err error) { + if options.ServiceName == "" { + options.ServiceName = DefaultServiceName + } + + if options.Authenticator == nil { + options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) + if err != nil { + return + } + } + + alerts, err = NewAlertsV1(options) + if err != nil { + return + } + + err = alerts.Service.ConfigureService(options.ServiceName) + if err != nil { + return + } + + if options.URL != "" { + err = alerts.Service.SetServiceURL(options.URL) + } + return +} + +// NewAlertsV1 : constructs an instance of AlertsV1 with passed in options. +func NewAlertsV1(options *AlertsV1Options) (service *AlertsV1, err error) { + serviceOptions := &core.ServiceOptions{ + URL: DefaultServiceURL, + Authenticator: options.Authenticator, + } + + err = core.ValidateStruct(options, "options") + if err != nil { + return + } + + baseService, err := core.NewBaseService(serviceOptions) + if err != nil { + return + } + + if options.URL != "" { + err = baseService.SetServiceURL(options.URL) + if err != nil { + return + } + } + + service = &AlertsV1{ + Service: baseService, + Crn: options.Crn, + } + + return +} + +// GetServiceURLForRegion returns the service URL to be used for the specified region +func GetServiceURLForRegion(region string) (string, error) { + return "", fmt.Errorf("service does not support regional URLs") +} + +// Clone makes a copy of "alerts" suitable for processing requests. +func (alerts *AlertsV1) Clone() *AlertsV1 { + if core.IsNil(alerts) { + return nil + } + clone := *alerts + clone.Service = alerts.Service.Clone() + return &clone +} + +// SetServiceURL sets the service URL +func (alerts *AlertsV1) SetServiceURL(url string) error { + return alerts.Service.SetServiceURL(url) +} + +// GetServiceURL returns the service URL +func (alerts *AlertsV1) GetServiceURL() string { + return alerts.Service.GetServiceURL() +} + +// SetDefaultHeaders sets HTTP headers to be sent in every request +func (alerts *AlertsV1) SetDefaultHeaders(headers http.Header) { + alerts.Service.SetDefaultHeaders(headers) +} + +// SetEnableGzipCompression sets the service's EnableGzipCompression field +func (alerts *AlertsV1) SetEnableGzipCompression(enableGzip bool) { + alerts.Service.SetEnableGzipCompression(enableGzip) +} + +// GetEnableGzipCompression returns the service's EnableGzipCompression field +func (alerts *AlertsV1) GetEnableGzipCompression() bool { + return alerts.Service.GetEnableGzipCompression() +} + +// EnableRetries enables automatic retries for requests invoked for this service instance. +// If either parameter is specified as 0, then a default value is used instead. +func (alerts *AlertsV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration) { + alerts.Service.EnableRetries(maxRetries, maxRetryInterval) +} + +// DisableRetries disables automatic retries for requests invoked for this service instance. +func (alerts *AlertsV1) DisableRetries() { + alerts.Service.DisableRetries() +} + +// GetAlertPolicies : List alert policies +// List configured alert policies for the CIS instance. +func (alerts *AlertsV1) GetAlertPolicies(getAlertPoliciesOptions *GetAlertPoliciesOptions) (result *ListAlertPoliciesResp, response *core.DetailedResponse, err error) { + return alerts.GetAlertPoliciesWithContext(context.Background(), getAlertPoliciesOptions) +} + +// GetAlertPoliciesWithContext is an alternate form of the GetAlertPolicies method which supports a Context parameter +func (alerts *AlertsV1) GetAlertPoliciesWithContext(ctx context.Context, getAlertPoliciesOptions *GetAlertPoliciesOptions) (result *ListAlertPoliciesResp, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(getAlertPoliciesOptions, "getAlertPoliciesOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *alerts.Crn, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = alerts.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(alerts.Service.Options.URL, `/v1/{crn}/alerting/policies`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getAlertPoliciesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("alerts", "V1", "GetAlertPolicies") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = alerts.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalListAlertPoliciesResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateAlertPolicy : Create an alert policy +// Create a new alert policy for the CIS instance. +func (alerts *AlertsV1) CreateAlertPolicy(createAlertPolicyOptions *CreateAlertPolicyOptions) (result *AlertSuccessResp, response *core.DetailedResponse, err error) { + return alerts.CreateAlertPolicyWithContext(context.Background(), createAlertPolicyOptions) +} + +// CreateAlertPolicyWithContext is an alternate form of the CreateAlertPolicy method which supports a Context parameter +func (alerts *AlertsV1) CreateAlertPolicyWithContext(ctx context.Context, createAlertPolicyOptions *CreateAlertPolicyOptions) (result *AlertSuccessResp, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(createAlertPolicyOptions, "createAlertPolicyOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *alerts.Crn, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = alerts.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(alerts.Service.Options.URL, `/v1/{crn}/alerting/policies`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range createAlertPolicyOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("alerts", "V1", "CreateAlertPolicy") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if createAlertPolicyOptions.Name != nil { + body["name"] = createAlertPolicyOptions.Name + } + if createAlertPolicyOptions.Description != nil { + body["description"] = createAlertPolicyOptions.Description + } + if createAlertPolicyOptions.Enabled != nil { + body["enabled"] = createAlertPolicyOptions.Enabled + } + if createAlertPolicyOptions.AlertType != nil { + body["alert_type"] = createAlertPolicyOptions.AlertType + } + if createAlertPolicyOptions.Mechanisms != nil { + body["mechanisms"] = createAlertPolicyOptions.Mechanisms + } + if createAlertPolicyOptions.Filters != nil { + body["filters"] = createAlertPolicyOptions.Filters + } + if createAlertPolicyOptions.Conditions != nil { + body["conditions"] = createAlertPolicyOptions.Conditions + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = alerts.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAlertSuccessResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// GetAlertPolicy : Get an alert policy +// Get an alert policy for the CIS instance. +func (alerts *AlertsV1) GetAlertPolicy(getAlertPolicyOptions *GetAlertPolicyOptions) (result *GetAlertPolicyResp, response *core.DetailedResponse, err error) { + return alerts.GetAlertPolicyWithContext(context.Background(), getAlertPolicyOptions) +} + +// GetAlertPolicyWithContext is an alternate form of the GetAlertPolicy method which supports a Context parameter +func (alerts *AlertsV1) GetAlertPolicyWithContext(ctx context.Context, getAlertPolicyOptions *GetAlertPolicyOptions) (result *GetAlertPolicyResp, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getAlertPolicyOptions, "getAlertPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getAlertPolicyOptions, "getAlertPolicyOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *alerts.Crn, + "policy_id": *getAlertPolicyOptions.PolicyID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = alerts.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(alerts.Service.Options.URL, `/v1/{crn}/alerting/policies/{policy_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getAlertPolicyOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("alerts", "V1", "GetAlertPolicy") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = alerts.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetAlertPolicyResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// UpdateAlertPolicy : Update an alert policy +// Update an existing alert policy for the CIS instance. +func (alerts *AlertsV1) UpdateAlertPolicy(updateAlertPolicyOptions *UpdateAlertPolicyOptions) (result *AlertSuccessResp, response *core.DetailedResponse, err error) { + return alerts.UpdateAlertPolicyWithContext(context.Background(), updateAlertPolicyOptions) +} + +// UpdateAlertPolicyWithContext is an alternate form of the UpdateAlertPolicy method which supports a Context parameter +func (alerts *AlertsV1) UpdateAlertPolicyWithContext(ctx context.Context, updateAlertPolicyOptions *UpdateAlertPolicyOptions) (result *AlertSuccessResp, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateAlertPolicyOptions, "updateAlertPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateAlertPolicyOptions, "updateAlertPolicyOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *alerts.Crn, + "policy_id": *updateAlertPolicyOptions.PolicyID, + } + + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = alerts.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(alerts.Service.Options.URL, `/v1/{crn}/alerting/policies/{policy_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range updateAlertPolicyOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("alerts", "V1", "UpdateAlertPolicy") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if updateAlertPolicyOptions.Name != nil { + body["name"] = updateAlertPolicyOptions.Name + } + if updateAlertPolicyOptions.Description != nil { + body["description"] = updateAlertPolicyOptions.Description + } + if updateAlertPolicyOptions.Enabled != nil { + body["enabled"] = updateAlertPolicyOptions.Enabled + } + if updateAlertPolicyOptions.AlertType != nil { + body["alert_type"] = updateAlertPolicyOptions.AlertType + } + if updateAlertPolicyOptions.Mechanisms != nil { + body["mechanisms"] = updateAlertPolicyOptions.Mechanisms + } + if updateAlertPolicyOptions.Conditions != nil { + body["conditions"] = updateAlertPolicyOptions.Conditions + } + if updateAlertPolicyOptions.Filters != nil { + body["filters"] = updateAlertPolicyOptions.Filters + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = alerts.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAlertSuccessResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// DeleteAlertPolicy : Delete an alert policy +// Delete an alert policy for the CIS instance. +func (alerts *AlertsV1) DeleteAlertPolicy(deleteAlertPolicyOptions *DeleteAlertPolicyOptions) (result *AlertSuccessResp, response *core.DetailedResponse, err error) { + return alerts.DeleteAlertPolicyWithContext(context.Background(), deleteAlertPolicyOptions) +} + +// DeleteAlertPolicyWithContext is an alternate form of the DeleteAlertPolicy method which supports a Context parameter +func (alerts *AlertsV1) DeleteAlertPolicyWithContext(ctx context.Context, deleteAlertPolicyOptions *DeleteAlertPolicyOptions) (result *AlertSuccessResp, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteAlertPolicyOptions, "deleteAlertPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteAlertPolicyOptions, "deleteAlertPolicyOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *alerts.Crn, + "policy_id": *deleteAlertPolicyOptions.PolicyID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = alerts.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(alerts.Service.Options.URL, `/v1/{crn}/alerting/policies/{policy_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteAlertPolicyOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("alerts", "V1", "DeleteAlertPolicy") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = alerts.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAlertSuccessResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// AlertSuccessRespErrorsItem : AlertSuccessRespErrorsItem struct +type AlertSuccessRespErrorsItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalAlertSuccessRespErrorsItem unmarshals an instance of AlertSuccessRespErrorsItem from the specified map of raw messages. +func UnmarshalAlertSuccessRespErrorsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AlertSuccessRespErrorsItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AlertSuccessRespMessagesItem : AlertSuccessRespMessagesItem struct +type AlertSuccessRespMessagesItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalAlertSuccessRespMessagesItem unmarshals an instance of AlertSuccessRespMessagesItem from the specified map of raw messages. +func UnmarshalAlertSuccessRespMessagesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AlertSuccessRespMessagesItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AlertSuccessRespResult : Container for response information. +type AlertSuccessRespResult struct { + // Policy ID. + ID *string `json:"id" validate:"required"` +} + +// UnmarshalAlertSuccessRespResult unmarshals an instance of AlertSuccessRespResult from the specified map of raw messages. +func UnmarshalAlertSuccessRespResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AlertSuccessRespResult) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CreateAlertPolicyInputMechanisms : Delivery mechanisms for the alert. +type CreateAlertPolicyInputMechanisms struct { + Email []CreateAlertPolicyInputMechanismsEmailItem `json:"email,omitempty"` + + Webhooks []CreateAlertPolicyInputMechanismsWebhooksItem `json:"webhooks,omitempty"` +} + +// UnmarshalCreateAlertPolicyInputMechanisms unmarshals an instance of CreateAlertPolicyInputMechanisms from the specified map of raw messages. +func UnmarshalCreateAlertPolicyInputMechanisms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CreateAlertPolicyInputMechanisms) + err = core.UnmarshalModel(m, "email", &obj.Email, UnmarshalCreateAlertPolicyInputMechanismsEmailItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "webhooks", &obj.Webhooks, UnmarshalCreateAlertPolicyInputMechanismsWebhooksItem) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CreateAlertPolicyInputMechanismsEmailItem : CreateAlertPolicyInputMechanismsEmailItem struct +type CreateAlertPolicyInputMechanismsEmailItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalCreateAlertPolicyInputMechanismsEmailItem unmarshals an instance of CreateAlertPolicyInputMechanismsEmailItem from the specified map of raw messages. +func UnmarshalCreateAlertPolicyInputMechanismsEmailItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CreateAlertPolicyInputMechanismsEmailItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CreateAlertPolicyInputMechanismsWebhooksItem : CreateAlertPolicyInputMechanismsWebhooksItem struct +type CreateAlertPolicyInputMechanismsWebhooksItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalCreateAlertPolicyInputMechanismsWebhooksItem unmarshals an instance of CreateAlertPolicyInputMechanismsWebhooksItem from the specified map of raw messages. +func UnmarshalCreateAlertPolicyInputMechanismsWebhooksItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CreateAlertPolicyInputMechanismsWebhooksItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CreateAlertPolicyOptions : The CreateAlertPolicy options. +type CreateAlertPolicyOptions struct { + // Policy name. + Name *string `json:"name,omitempty"` + + // Policy description. + Description *string `json:"description,omitempty"` + + // Is the alert policy active. + Enabled *bool `json:"enabled,omitempty"` + + // Condition for the alert. + AlertType *string `json:"alert_type,omitempty"` + + // Delivery mechanisms for the alert. + Mechanisms *CreateAlertPolicyInputMechanisms `json:"mechanisms,omitempty"` + + // Optional filters depending for the alert type. + Filters interface{} `json:"filters,omitempty"` + + // Conditions depending on the alert type. HTTP DDOS Attack Alerter does not have any conditions. The Load Balancing + // Pool Enablement Alerter takes conditions that describe for all pools whether the pool is being enabled, disabled, or + // both. This field is not required when creating a new alert. + Conditions interface{} `json:"conditions,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the CreateAlertPolicyOptions.AlertType property. +// Condition for the alert. +const ( + CreateAlertPolicyOptions_AlertType_ClickhouseAlertFwAnomaly = "clickhouse_alert_fw_anomaly" + CreateAlertPolicyOptions_AlertType_ClickhouseAlertFwEntAnomaly = "clickhouse_alert_fw_ent_anomaly" + CreateAlertPolicyOptions_AlertType_DosAttackL7 = "dos_attack_l7" + CreateAlertPolicyOptions_AlertType_G6PoolToggleAlert = "g6_pool_toggle_alert" +) + +// NewCreateAlertPolicyOptions : Instantiate CreateAlertPolicyOptions +func (*AlertsV1) NewCreateAlertPolicyOptions() *CreateAlertPolicyOptions { + return &CreateAlertPolicyOptions{} +} + +// SetName : Allow user to set Name +func (_options *CreateAlertPolicyOptions) SetName(name string) *CreateAlertPolicyOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreateAlertPolicyOptions) SetDescription(description string) *CreateAlertPolicyOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetEnabled : Allow user to set Enabled +func (_options *CreateAlertPolicyOptions) SetEnabled(enabled bool) *CreateAlertPolicyOptions { + _options.Enabled = core.BoolPtr(enabled) + return _options +} + +// SetAlertType : Allow user to set AlertType +func (_options *CreateAlertPolicyOptions) SetAlertType(alertType string) *CreateAlertPolicyOptions { + _options.AlertType = core.StringPtr(alertType) + return _options +} + +// SetMechanisms : Allow user to set Mechanisms +func (_options *CreateAlertPolicyOptions) SetMechanisms(mechanisms *CreateAlertPolicyInputMechanisms) *CreateAlertPolicyOptions { + _options.Mechanisms = mechanisms + return _options +} + +// SetFilters : Allow user to set Filters +func (_options *CreateAlertPolicyOptions) SetFilters(filters interface{}) *CreateAlertPolicyOptions { + _options.Filters = filters + return _options +} + +// SetConditions : Allow user to set Conditions +func (_options *CreateAlertPolicyOptions) SetConditions(conditions interface{}) *CreateAlertPolicyOptions { + _options.Conditions = conditions + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateAlertPolicyOptions) SetHeaders(param map[string]string) *CreateAlertPolicyOptions { + options.Headers = param + return options +} + +// DeleteAlertPolicyOptions : The DeleteAlertPolicy options. +type DeleteAlertPolicyOptions struct { + // Alert policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteAlertPolicyOptions : Instantiate DeleteAlertPolicyOptions +func (*AlertsV1) NewDeleteAlertPolicyOptions(policyID string) *DeleteAlertPolicyOptions { + return &DeleteAlertPolicyOptions{ + PolicyID: core.StringPtr(policyID), + } +} + +// SetPolicyID : Allow user to set PolicyID +func (_options *DeleteAlertPolicyOptions) SetPolicyID(policyID string) *DeleteAlertPolicyOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteAlertPolicyOptions) SetHeaders(param map[string]string) *DeleteAlertPolicyOptions { + options.Headers = param + return options +} + +// GetAlertPoliciesOptions : The GetAlertPolicies options. +type GetAlertPoliciesOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetAlertPoliciesOptions : Instantiate GetAlertPoliciesOptions +func (*AlertsV1) NewGetAlertPoliciesOptions() *GetAlertPoliciesOptions { + return &GetAlertPoliciesOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *GetAlertPoliciesOptions) SetHeaders(param map[string]string) *GetAlertPoliciesOptions { + options.Headers = param + return options +} + +// GetAlertPolicyOptions : The GetAlertPolicy options. +type GetAlertPolicyOptions struct { + // Alert policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetAlertPolicyOptions : Instantiate GetAlertPolicyOptions +func (*AlertsV1) NewGetAlertPolicyOptions(policyID string) *GetAlertPolicyOptions { + return &GetAlertPolicyOptions{ + PolicyID: core.StringPtr(policyID), + } +} + +// SetPolicyID : Allow user to set PolicyID +func (_options *GetAlertPolicyOptions) SetPolicyID(policyID string) *GetAlertPolicyOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetAlertPolicyOptions) SetHeaders(param map[string]string) *GetAlertPolicyOptions { + options.Headers = param + return options +} + +// GetAlertPolicyRespErrorsItem : GetAlertPolicyRespErrorsItem struct +type GetAlertPolicyRespErrorsItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalGetAlertPolicyRespErrorsItem unmarshals an instance of GetAlertPolicyRespErrorsItem from the specified map of raw messages. +func UnmarshalGetAlertPolicyRespErrorsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyRespErrorsItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertPolicyRespMessagesItem : GetAlertPolicyRespMessagesItem struct +type GetAlertPolicyRespMessagesItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalGetAlertPolicyRespMessagesItem unmarshals an instance of GetAlertPolicyRespMessagesItem from the specified map of raw messages. +func UnmarshalGetAlertPolicyRespMessagesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyRespMessagesItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertPolicyRespResult : Container for response information. +type GetAlertPolicyRespResult struct { + // Policy ID. + ID *string `json:"id" validate:"required"` + + // Policy Name. + Name *string `json:"name" validate:"required"` + + // Alert Policy description. + Description *string `json:"description" validate:"required"` + + // Is the alert enabled. + Enabled *bool `json:"enabled" validate:"required"` + + // Condition for the alert. + AlertType *string `json:"alert_type" validate:"required"` + + // Delivery mechanisms for the alert, can include an email, a webhook, or both. + Mechanisms *GetAlertPolicyRespResultMechanisms `json:"mechanisms" validate:"required"` + + // When was the policy first created. + Created *string `json:"created" validate:"required"` + + // When was the policy last modified. + Modified *string `json:"modified" validate:"required"` + + // Optional conditions depending for the alert type. + Conditions interface{} `json:"conditions" validate:"required"` + + // Optional filters depending for the alert type. + Filters interface{} `json:"filters" validate:"required"` +} + +// Constants associated with the GetAlertPolicyRespResult.AlertType property. +// Condition for the alert. +const ( + GetAlertPolicyRespResult_AlertType_ClickhouseAlertFwAnomaly = "clickhouse_alert_fw_anomaly" + GetAlertPolicyRespResult_AlertType_ClickhouseAlertFwEntAnomaly = "clickhouse_alert_fw_ent_anomaly" + GetAlertPolicyRespResult_AlertType_DosAttackL7 = "dos_attack_l7" + GetAlertPolicyRespResult_AlertType_G6PoolToggleAlert = "g6_pool_toggle_alert" +) + +// UnmarshalGetAlertPolicyRespResult unmarshals an instance of GetAlertPolicyRespResult from the specified map of raw messages. +func UnmarshalGetAlertPolicyRespResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyRespResult) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "alert_type", &obj.AlertType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "mechanisms", &obj.Mechanisms, UnmarshalGetAlertPolicyRespResultMechanisms) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created", &obj.Created) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "modified", &obj.Modified) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "conditions", &obj.Conditions) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "filters", &obj.Filters) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertPolicyRespResultMechanisms : Delivery mechanisms for the alert, can include an email, a webhook, or both. +type GetAlertPolicyRespResultMechanisms struct { + Email []GetAlertPolicyRespResultMechanismsEmailItem `json:"email,omitempty"` + + Webhooks []GetAlertPolicyRespResultMechanismsWebhooksItem `json:"webhooks,omitempty"` +} + +// UnmarshalGetAlertPolicyRespResultMechanisms unmarshals an instance of GetAlertPolicyRespResultMechanisms from the specified map of raw messages. +func UnmarshalGetAlertPolicyRespResultMechanisms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyRespResultMechanisms) + err = core.UnmarshalModel(m, "email", &obj.Email, UnmarshalGetAlertPolicyRespResultMechanismsEmailItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "webhooks", &obj.Webhooks, UnmarshalGetAlertPolicyRespResultMechanismsWebhooksItem) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertPolicyRespResultMechanismsEmailItem : GetAlertPolicyRespResultMechanismsEmailItem struct +type GetAlertPolicyRespResultMechanismsEmailItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalGetAlertPolicyRespResultMechanismsEmailItem unmarshals an instance of GetAlertPolicyRespResultMechanismsEmailItem from the specified map of raw messages. +func UnmarshalGetAlertPolicyRespResultMechanismsEmailItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyRespResultMechanismsEmailItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertPolicyRespResultMechanismsWebhooksItem : GetAlertPolicyRespResultMechanismsWebhooksItem struct +type GetAlertPolicyRespResultMechanismsWebhooksItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalGetAlertPolicyRespResultMechanismsWebhooksItem unmarshals an instance of GetAlertPolicyRespResultMechanismsWebhooksItem from the specified map of raw messages. +func UnmarshalGetAlertPolicyRespResultMechanismsWebhooksItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyRespResultMechanismsWebhooksItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesRespErrorsItem : ListAlertPoliciesRespErrorsItem struct +type ListAlertPoliciesRespErrorsItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalListAlertPoliciesRespErrorsItem unmarshals an instance of ListAlertPoliciesRespErrorsItem from the specified map of raw messages. +func UnmarshalListAlertPoliciesRespErrorsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesRespErrorsItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesRespMessagesItem : ListAlertPoliciesRespMessagesItem struct +type ListAlertPoliciesRespMessagesItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalListAlertPoliciesRespMessagesItem unmarshals an instance of ListAlertPoliciesRespMessagesItem from the specified map of raw messages. +func UnmarshalListAlertPoliciesRespMessagesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesRespMessagesItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesRespResultItem : ListAlertPoliciesRespResultItem struct +type ListAlertPoliciesRespResultItem struct { + // Policy ID. + ID *string `json:"id" validate:"required"` + + // Policy Name. + Name *string `json:"name" validate:"required"` + + // Alert Policy description. + Description *string `json:"description" validate:"required"` + + // Is the alert enabled. + Enabled *bool `json:"enabled" validate:"required"` + + // Condition for the alert. + AlertType *string `json:"alert_type" validate:"required"` + + // Delivery mechanisms for the alert, can include an email, a webhook, or both. + Mechanisms *ListAlertPoliciesRespResultItemMechanisms `json:"mechanisms" validate:"required"` + + // When was the policy first created. + Created *string `json:"created" validate:"required"` + + // When was the policy last modified. + Modified *string `json:"modified" validate:"required"` + + // Optional conditions depending for the alert type. + Conditions interface{} `json:"conditions" validate:"required"` + + // Optional filters depending for the alert type. + Filters interface{} `json:"filters" validate:"required"` +} + +// Constants associated with the ListAlertPoliciesRespResultItem.AlertType property. +// Condition for the alert. +const ( + ListAlertPoliciesRespResultItem_AlertType_ClickhouseAlertFwAnomaly = "clickhouse_alert_fw_anomaly" + ListAlertPoliciesRespResultItem_AlertType_ClickhouseAlertFwEntAnomaly = "clickhouse_alert_fw_ent_anomaly" + ListAlertPoliciesRespResultItem_AlertType_DosAttackL7 = "dos_attack_l7" + ListAlertPoliciesRespResultItem_AlertType_G6PoolToggleAlert = "g6_pool_toggle_alert" +) + +// UnmarshalListAlertPoliciesRespResultItem unmarshals an instance of ListAlertPoliciesRespResultItem from the specified map of raw messages. +func UnmarshalListAlertPoliciesRespResultItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesRespResultItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "alert_type", &obj.AlertType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "mechanisms", &obj.Mechanisms, UnmarshalListAlertPoliciesRespResultItemMechanisms) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created", &obj.Created) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "modified", &obj.Modified) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "conditions", &obj.Conditions) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "filters", &obj.Filters) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesRespResultItemMechanisms : Delivery mechanisms for the alert, can include an email, a webhook, or both. +type ListAlertPoliciesRespResultItemMechanisms struct { + Email []ListAlertPoliciesRespResultItemMechanismsEmailItem `json:"email,omitempty"` + + Webhooks []ListAlertPoliciesRespResultItemMechanismsWebhooksItem `json:"webhooks,omitempty"` +} + +// UnmarshalListAlertPoliciesRespResultItemMechanisms unmarshals an instance of ListAlertPoliciesRespResultItemMechanisms from the specified map of raw messages. +func UnmarshalListAlertPoliciesRespResultItemMechanisms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesRespResultItemMechanisms) + err = core.UnmarshalModel(m, "email", &obj.Email, UnmarshalListAlertPoliciesRespResultItemMechanismsEmailItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "webhooks", &obj.Webhooks, UnmarshalListAlertPoliciesRespResultItemMechanismsWebhooksItem) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesRespResultItemMechanismsEmailItem : ListAlertPoliciesRespResultItemMechanismsEmailItem struct +type ListAlertPoliciesRespResultItemMechanismsEmailItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalListAlertPoliciesRespResultItemMechanismsEmailItem unmarshals an instance of ListAlertPoliciesRespResultItemMechanismsEmailItem from the specified map of raw messages. +func UnmarshalListAlertPoliciesRespResultItemMechanismsEmailItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesRespResultItemMechanismsEmailItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesRespResultItemMechanismsWebhooksItem : ListAlertPoliciesRespResultItemMechanismsWebhooksItem struct +type ListAlertPoliciesRespResultItemMechanismsWebhooksItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalListAlertPoliciesRespResultItemMechanismsWebhooksItem unmarshals an instance of ListAlertPoliciesRespResultItemMechanismsWebhooksItem from the specified map of raw messages. +func UnmarshalListAlertPoliciesRespResultItemMechanismsWebhooksItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesRespResultItemMechanismsWebhooksItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// UpdateAlertPolicyInputMechanisms : Delivery mechanisms for the alert, can include an email, a webhook, or both. +type UpdateAlertPolicyInputMechanisms struct { + Email []UpdateAlertPolicyInputMechanismsEmailItem `json:"email,omitempty"` + + Webhooks []UpdateAlertPolicyInputMechanismsWebhooksItem `json:"webhooks,omitempty"` +} + +// UnmarshalUpdateAlertPolicyInputMechanisms unmarshals an instance of UpdateAlertPolicyInputMechanisms from the specified map of raw messages. +func UnmarshalUpdateAlertPolicyInputMechanisms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UpdateAlertPolicyInputMechanisms) + err = core.UnmarshalModel(m, "email", &obj.Email, UnmarshalUpdateAlertPolicyInputMechanismsEmailItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "webhooks", &obj.Webhooks, UnmarshalUpdateAlertPolicyInputMechanismsWebhooksItem) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// UpdateAlertPolicyInputMechanismsEmailItem : UpdateAlertPolicyInputMechanismsEmailItem struct +type UpdateAlertPolicyInputMechanismsEmailItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalUpdateAlertPolicyInputMechanismsEmailItem unmarshals an instance of UpdateAlertPolicyInputMechanismsEmailItem from the specified map of raw messages. +func UnmarshalUpdateAlertPolicyInputMechanismsEmailItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UpdateAlertPolicyInputMechanismsEmailItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// UpdateAlertPolicyInputMechanismsWebhooksItem : UpdateAlertPolicyInputMechanismsWebhooksItem struct +type UpdateAlertPolicyInputMechanismsWebhooksItem struct { + ID *string `json:"id,omitempty"` +} + +// UnmarshalUpdateAlertPolicyInputMechanismsWebhooksItem unmarshals an instance of UpdateAlertPolicyInputMechanismsWebhooksItem from the specified map of raw messages. +func UnmarshalUpdateAlertPolicyInputMechanismsWebhooksItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UpdateAlertPolicyInputMechanismsWebhooksItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// UpdateAlertPolicyOptions : The UpdateAlertPolicy options. +type UpdateAlertPolicyOptions struct { + // Alert policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // Policy name. + Name *string `json:"name,omitempty"` + + // Policy description. + Description *string `json:"description,omitempty"` + + // Is the alert policy active. + Enabled *bool `json:"enabled,omitempty"` + + // Condition for the alert. Use 'dos_attack_l7' to set up an HTTP DDOS Attack Alerter, use 'g6_pool_toggle_alert' to + // set up Load Balancing Pool Enablement Alerter, use 'clickhouse_alert_fw_anomaly' to set up WAF Alerter and + // 'clickhouse_alert_fw_ent_anomaly' to set up Advanced Security Alerter. + AlertType *string `json:"alert_type,omitempty"` + + // Delivery mechanisms for the alert, can include an email, a webhook, or both. + Mechanisms *UpdateAlertPolicyInputMechanisms `json:"mechanisms,omitempty"` + + // Conditions depending on the alert type. HTTP DDOS Attack Alerter does not have any conditions. The Load Balancing + // Pool Enablement Alerter takes conditions that describe for all pools whether the pool is being enabled, disabled, or + // both. + Conditions interface{} `json:"conditions,omitempty"` + + // Optional filters depending for the alert type. HTTP DDOS Attack Alerter does not require any filters. The Load + // Balancing Pool Enablement Alerter requires a list of IDs for the pools and their corresponding alert trigger (set + // whether alerts are recieved on disablement, enablement, or both). The basic WAF Alerter requires a list of zones to + // be monitored. The Advanced Security Alerter requires a list of zones to be monitored as well as a list of services + // to monitor. + Filters interface{} `json:"filters,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the UpdateAlertPolicyOptions.AlertType property. +// Condition for the alert. Use 'dos_attack_l7' to set up an HTTP DDOS Attack Alerter, use 'g6_pool_toggle_alert' to set +// up Load Balancing Pool Enablement Alerter, use 'clickhouse_alert_fw_anomaly' to set up WAF Alerter and +// 'clickhouse_alert_fw_ent_anomaly' to set up Advanced Security Alerter. +const ( + UpdateAlertPolicyOptions_AlertType_ClickhouseAlertFwAnomaly = "clickhouse_alert_fw_anomaly" + UpdateAlertPolicyOptions_AlertType_ClickhouseAlertFwEntAnomaly = "clickhouse_alert_fw_ent_anomaly" + UpdateAlertPolicyOptions_AlertType_DosAttackL7 = "dos_attack_l7" + UpdateAlertPolicyOptions_AlertType_G6PoolToggleAlert = "g6_pool_toggle_alert" +) + +// NewUpdateAlertPolicyOptions : Instantiate UpdateAlertPolicyOptions +func (*AlertsV1) NewUpdateAlertPolicyOptions(policyID string) *UpdateAlertPolicyOptions { + return &UpdateAlertPolicyOptions{ + PolicyID: core.StringPtr(policyID), + } +} + +// SetPolicyID : Allow user to set PolicyID +func (_options *UpdateAlertPolicyOptions) SetPolicyID(policyID string) *UpdateAlertPolicyOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} + +// SetName : Allow user to set Name +func (_options *UpdateAlertPolicyOptions) SetName(name string) *UpdateAlertPolicyOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *UpdateAlertPolicyOptions) SetDescription(description string) *UpdateAlertPolicyOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetEnabled : Allow user to set Enabled +func (_options *UpdateAlertPolicyOptions) SetEnabled(enabled bool) *UpdateAlertPolicyOptions { + _options.Enabled = core.BoolPtr(enabled) + return _options +} + +// SetAlertType : Allow user to set AlertType +func (_options *UpdateAlertPolicyOptions) SetAlertType(alertType string) *UpdateAlertPolicyOptions { + _options.AlertType = core.StringPtr(alertType) + return _options +} + +// SetMechanisms : Allow user to set Mechanisms +func (_options *UpdateAlertPolicyOptions) SetMechanisms(mechanisms *UpdateAlertPolicyInputMechanisms) *UpdateAlertPolicyOptions { + _options.Mechanisms = mechanisms + return _options +} + +// SetConditions : Allow user to set Conditions +func (_options *UpdateAlertPolicyOptions) SetConditions(conditions interface{}) *UpdateAlertPolicyOptions { + _options.Conditions = conditions + return _options +} + +// SetFilters : Allow user to set Filters +func (_options *UpdateAlertPolicyOptions) SetFilters(filters interface{}) *UpdateAlertPolicyOptions { + _options.Filters = filters + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateAlertPolicyOptions) SetHeaders(param map[string]string) *UpdateAlertPolicyOptions { + options.Headers = param + return options +} + +// AlertSuccessResp : Alert Policies Response. +type AlertSuccessResp struct { + // Was operation successful. + Success *bool `json:"success" validate:"required"` + + // Array of errors encountered. + Errors []AlertSuccessRespErrorsItem `json:"errors" validate:"required"` + + // Array of messages returned. + Messages []AlertSuccessRespMessagesItem `json:"messages" validate:"required"` + + // Container for response information. + Result *AlertSuccessRespResult `json:"result" validate:"required"` +} + +// UnmarshalAlertSuccessResp unmarshals an instance of AlertSuccessResp from the specified map of raw messages. +func UnmarshalAlertSuccessResp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AlertSuccessResp) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalAlertSuccessRespErrorsItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "messages", &obj.Messages, UnmarshalAlertSuccessRespMessagesItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalAlertSuccessRespResult) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertPolicyResp : Get Alert Policies Response. +type GetAlertPolicyResp struct { + // Was operation successful. + Success *bool `json:"success" validate:"required"` + + // Array of errors encountered. + Errors []GetAlertPolicyRespErrorsItem `json:"errors" validate:"required"` + + // Array of messages returned. + Messages []GetAlertPolicyRespMessagesItem `json:"messages" validate:"required"` + + // Container for response information. + Result *GetAlertPolicyRespResult `json:"result" validate:"required"` +} + +// UnmarshalGetAlertPolicyResp unmarshals an instance of GetAlertPolicyResp from the specified map of raw messages. +func UnmarshalGetAlertPolicyResp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertPolicyResp) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalGetAlertPolicyRespErrorsItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "messages", &obj.Messages, UnmarshalGetAlertPolicyRespMessagesItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalGetAlertPolicyRespResult) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertPoliciesResp : List Alert Policies Response. +type ListAlertPoliciesResp struct { + // Was operation successful. + Success *bool `json:"success" validate:"required"` + + // Array of errors encountered. + Errors []ListAlertPoliciesRespErrorsItem `json:"errors" validate:"required"` + + // Array of messages returned. + Messages []ListAlertPoliciesRespMessagesItem `json:"messages" validate:"required"` + + // Container for response information. + Result []ListAlertPoliciesRespResultItem `json:"result" validate:"required"` +} + +// UnmarshalListAlertPoliciesResp unmarshals an instance of ListAlertPoliciesResp from the specified map of raw messages. +func UnmarshalListAlertPoliciesResp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertPoliciesResp) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalListAlertPoliciesRespErrorsItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "messages", &obj.Messages, UnmarshalListAlertPoliciesRespMessagesItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalListAlertPoliciesRespResultItem) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} diff --git a/ibm/vendor/github.com/IBM/networking-go-sdk/common/version.go b/ibm/vendor/github.com/IBM/networking-go-sdk/common/version.go index 8821bb6d03..438edb5b72 100644 --- a/ibm/vendor/github.com/IBM/networking-go-sdk/common/version.go +++ b/ibm/vendor/github.com/IBM/networking-go-sdk/common/version.go @@ -17,4 +17,4 @@ package common // Version of the SDK -const Version = "0.23.1" +const Version = "0.26.0" diff --git a/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkproviderv2/direct_link_provider_v2.go b/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkproviderv2/direct_link_provider_v2.go index 370bbb221a..84da500c22 100644 --- a/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkproviderv2/direct_link_provider_v2.go +++ b/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkproviderv2/direct_link_provider_v2.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156 + * IBM OpenAPI SDK Code Generator Version: 3.43.0-49eab5c7-20211117-152138 */ // Package directlinkproviderv2 : Operations and models for the DirectLinkProviderV2 service @@ -37,7 +37,7 @@ import ( // DirectLinkProviderV2 : No description provided (generated by Openapi Generator // https://github.com/openapitools/openapi-generator) // -// Version: __VERSION__ +// API Version: __VERSION__ type DirectLinkProviderV2 struct { Service *core.BaseService @@ -300,6 +300,9 @@ func (directLinkProvider *DirectLinkProviderV2) CreateProviderGatewayWithContext if createProviderGatewayOptions.BgpIbmCidr != nil { body["bgp_ibm_cidr"] = createProviderGatewayOptions.BgpIbmCidr } + if createProviderGatewayOptions.Vlan != nil { + body["vlan"] = createProviderGatewayOptions.Vlan + } _, err = builder.SetBodyContentJSON(body) if err != nil { return @@ -512,6 +515,9 @@ func (directLinkProvider *DirectLinkProviderV2) UpdateProviderGatewayWithContext if updateProviderGatewayOptions.SpeedMbps != nil { body["speed_mbps"] = updateProviderGatewayOptions.SpeedMbps } + if updateProviderGatewayOptions.Vlan != nil { + body["vlan"] = updateProviderGatewayOptions.Vlan + } _, err = builder.SetBodyContentJSON(body) if err != nil { return @@ -666,20 +672,20 @@ type CreateProviderGatewayOptions struct { // // For a 2-byte range, enter a value between 1-64495 or 64999. For a 2-byte or 4-byte range, enter a value between // 131072-4199999999. For a 4-byte range, enter a value between 4201000000-4201064511. - BgpAsn *int64 `validate:"required"` + BgpAsn *int64 `json:"bgp_asn" validate:"required"` // Customer IBM Cloud account ID for the new gateway. A gateway object containing the pending create request will // become available in the specified account. - CustomerAccountID *string `validate:"required"` + CustomerAccountID *string `json:"customer_account_id" validate:"required"` // The unique user-defined name for this gateway. - Name *string `validate:"required"` + Name *string `json:"name" validate:"required"` // Select Port Label for the gateway. - Port *ProviderGatewayPortIdentity `validate:"required"` + Port *ProviderGatewayPortIdentity `json:"port" validate:"required"` // Gateway speed in megabits per second. - SpeedMbps *int64 `validate:"required"` + SpeedMbps *int64 `json:"speed_mbps" validate:"required"` // BGP customer edge router CIDR. // @@ -689,7 +695,7 @@ type CreateProviderGatewayOptions struct { // For manual IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of // "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and // bgp_ibm_cidr must have matching network and subnet mask values. - BgpCerCidr *string + BgpCerCidr *string `json:"bgp_cer_cidr,omitempty"` // BGP IBM CIDR. // @@ -699,10 +705,15 @@ type CreateProviderGatewayOptions struct { // For manual IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of // "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and // bgp_ibm_cidr must have matching network and subnet mask values. - BgpIbmCidr *string + BgpIbmCidr *string `json:"bgp_ibm_cidr,omitempty"` + + // VLAN requested for this gateway. + // + // VLAN provided should be in the range 1 to 4094. + Vlan *int64 `json:"vlan,omitempty"` // When true, perform request validation only and do not create a gateway. - CheckOnly *string + CheckOnly *string `json:"check_only,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -720,51 +731,57 @@ func (*DirectLinkProviderV2) NewCreateProviderGatewayOptions(bgpAsn int64, custo } // SetBgpAsn : Allow user to set BgpAsn -func (options *CreateProviderGatewayOptions) SetBgpAsn(bgpAsn int64) *CreateProviderGatewayOptions { - options.BgpAsn = core.Int64Ptr(bgpAsn) - return options +func (_options *CreateProviderGatewayOptions) SetBgpAsn(bgpAsn int64) *CreateProviderGatewayOptions { + _options.BgpAsn = core.Int64Ptr(bgpAsn) + return _options } // SetCustomerAccountID : Allow user to set CustomerAccountID -func (options *CreateProviderGatewayOptions) SetCustomerAccountID(customerAccountID string) *CreateProviderGatewayOptions { - options.CustomerAccountID = core.StringPtr(customerAccountID) - return options +func (_options *CreateProviderGatewayOptions) SetCustomerAccountID(customerAccountID string) *CreateProviderGatewayOptions { + _options.CustomerAccountID = core.StringPtr(customerAccountID) + return _options } // SetName : Allow user to set Name -func (options *CreateProviderGatewayOptions) SetName(name string) *CreateProviderGatewayOptions { - options.Name = core.StringPtr(name) - return options +func (_options *CreateProviderGatewayOptions) SetName(name string) *CreateProviderGatewayOptions { + _options.Name = core.StringPtr(name) + return _options } // SetPort : Allow user to set Port -func (options *CreateProviderGatewayOptions) SetPort(port *ProviderGatewayPortIdentity) *CreateProviderGatewayOptions { - options.Port = port - return options +func (_options *CreateProviderGatewayOptions) SetPort(port *ProviderGatewayPortIdentity) *CreateProviderGatewayOptions { + _options.Port = port + return _options } // SetSpeedMbps : Allow user to set SpeedMbps -func (options *CreateProviderGatewayOptions) SetSpeedMbps(speedMbps int64) *CreateProviderGatewayOptions { - options.SpeedMbps = core.Int64Ptr(speedMbps) - return options +func (_options *CreateProviderGatewayOptions) SetSpeedMbps(speedMbps int64) *CreateProviderGatewayOptions { + _options.SpeedMbps = core.Int64Ptr(speedMbps) + return _options } // SetBgpCerCidr : Allow user to set BgpCerCidr -func (options *CreateProviderGatewayOptions) SetBgpCerCidr(bgpCerCidr string) *CreateProviderGatewayOptions { - options.BgpCerCidr = core.StringPtr(bgpCerCidr) - return options +func (_options *CreateProviderGatewayOptions) SetBgpCerCidr(bgpCerCidr string) *CreateProviderGatewayOptions { + _options.BgpCerCidr = core.StringPtr(bgpCerCidr) + return _options } // SetBgpIbmCidr : Allow user to set BgpIbmCidr -func (options *CreateProviderGatewayOptions) SetBgpIbmCidr(bgpIbmCidr string) *CreateProviderGatewayOptions { - options.BgpIbmCidr = core.StringPtr(bgpIbmCidr) - return options +func (_options *CreateProviderGatewayOptions) SetBgpIbmCidr(bgpIbmCidr string) *CreateProviderGatewayOptions { + _options.BgpIbmCidr = core.StringPtr(bgpIbmCidr) + return _options +} + +// SetVlan : Allow user to set Vlan +func (_options *CreateProviderGatewayOptions) SetVlan(vlan int64) *CreateProviderGatewayOptions { + _options.Vlan = core.Int64Ptr(vlan) + return _options } // SetCheckOnly : Allow user to set CheckOnly -func (options *CreateProviderGatewayOptions) SetCheckOnly(checkOnly string) *CreateProviderGatewayOptions { - options.CheckOnly = core.StringPtr(checkOnly) - return options +func (_options *CreateProviderGatewayOptions) SetCheckOnly(checkOnly string) *CreateProviderGatewayOptions { + _options.CheckOnly = core.StringPtr(checkOnly) + return _options } // SetHeaders : Allow user to set Headers @@ -776,7 +793,7 @@ func (options *CreateProviderGatewayOptions) SetHeaders(param map[string]string) // DeleteProviderGatewayOptions : The DeleteProviderGateway options. type DeleteProviderGatewayOptions struct { // Direct Link Connect gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -790,9 +807,9 @@ func (*DirectLinkProviderV2) NewDeleteProviderGatewayOptions(id string) *DeleteP } // SetID : Allow user to set ID -func (options *DeleteProviderGatewayOptions) SetID(id string) *DeleteProviderGatewayOptions { - options.ID = core.StringPtr(id) - return options +func (_options *DeleteProviderGatewayOptions) SetID(id string) *DeleteProviderGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -804,7 +821,7 @@ func (options *DeleteProviderGatewayOptions) SetHeaders(param map[string]string) // GetProviderGatewayOptions : The GetProviderGateway options. type GetProviderGatewayOptions struct { // Direct Link Connect gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -818,9 +835,9 @@ func (*DirectLinkProviderV2) NewGetProviderGatewayOptions(id string) *GetProvide } // SetID : Allow user to set ID -func (options *GetProviderGatewayOptions) SetID(id string) *GetProviderGatewayOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetProviderGatewayOptions) SetID(id string) *GetProviderGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -832,7 +849,7 @@ func (options *GetProviderGatewayOptions) SetHeaders(param map[string]string) *G // GetProviderPortOptions : The GetProviderPort options. type GetProviderPortOptions struct { // port identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -846,9 +863,9 @@ func (*DirectLinkProviderV2) NewGetProviderPortOptions(id string) *GetProviderPo } // SetID : Allow user to set ID -func (options *GetProviderPortOptions) SetID(id string) *GetProviderPortOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetProviderPortOptions) SetID(id string) *GetProviderPortOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -860,10 +877,10 @@ func (options *GetProviderPortOptions) SetHeaders(param map[string]string) *GetP // ListProviderGatewaysOptions : The ListProviderGateways options. type ListProviderGatewaysOptions struct { // A server-supplied token determining which resource to start the page on. - Start *string + Start *string `json:"start,omitempty"` // The number of resources to return on a page. - Limit *int64 + Limit *int64 `json:"limit,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -875,15 +892,15 @@ func (*DirectLinkProviderV2) NewListProviderGatewaysOptions() *ListProviderGatew } // SetStart : Allow user to set Start -func (options *ListProviderGatewaysOptions) SetStart(start string) *ListProviderGatewaysOptions { - options.Start = core.StringPtr(start) - return options +func (_options *ListProviderGatewaysOptions) SetStart(start string) *ListProviderGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options } // SetLimit : Allow user to set Limit -func (options *ListProviderGatewaysOptions) SetLimit(limit int64) *ListProviderGatewaysOptions { - options.Limit = core.Int64Ptr(limit) - return options +func (_options *ListProviderGatewaysOptions) SetLimit(limit int64) *ListProviderGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } // SetHeaders : Allow user to set Headers @@ -895,10 +912,10 @@ func (options *ListProviderGatewaysOptions) SetHeaders(param map[string]string) // ListProviderPortsOptions : The ListProviderPorts options. type ListProviderPortsOptions struct { // A server-supplied token determining which resource to start the page on. - Start *string + Start *string `json:"start,omitempty"` // The number of resources to return on a page. - Limit *int64 + Limit *int64 `json:"limit,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -910,15 +927,15 @@ func (*DirectLinkProviderV2) NewListProviderPortsOptions() *ListProviderPortsOpt } // SetStart : Allow user to set Start -func (options *ListProviderPortsOptions) SetStart(start string) *ListProviderPortsOptions { - options.Start = core.StringPtr(start) - return options +func (_options *ListProviderPortsOptions) SetStart(start string) *ListProviderPortsOptions { + _options.Start = core.StringPtr(start) + return _options } // SetLimit : Allow user to set Limit -func (options *ListProviderPortsOptions) SetLimit(limit int64) *ListProviderPortsOptions { - options.Limit = core.Int64Ptr(limit) - return options +func (_options *ListProviderPortsOptions) SetLimit(limit int64) *ListProviderPortsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } // SetHeaders : Allow user to set Headers @@ -987,7 +1004,7 @@ type ProviderGateway struct { // Gateway type. Type *string `json:"type" validate:"required"` - // VLAN allocated for this gateway. + // VLAN for this gateway. Vlan *int64 `json:"vlan,omitempty"` } @@ -1178,6 +1195,14 @@ func UnmarshalProviderGatewayCollection(m map[string]json.RawMessage, result int return } +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ProviderGatewayCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + // ProviderGatewayCollectionFirst : A reference to the first page of resources. type ProviderGatewayCollectionFirst struct { // The URL for the first page of resources. @@ -1226,11 +1251,11 @@ type ProviderGatewayPortIdentity struct { } // NewProviderGatewayPortIdentity : Instantiate ProviderGatewayPortIdentity (Generic Model Constructor) -func (*DirectLinkProviderV2) NewProviderGatewayPortIdentity(id string) (model *ProviderGatewayPortIdentity, err error) { - model = &ProviderGatewayPortIdentity{ +func (*DirectLinkProviderV2) NewProviderGatewayPortIdentity(id string) (_model *ProviderGatewayPortIdentity, err error) { + _model = &ProviderGatewayPortIdentity{ ID: core.StringPtr(id), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -1267,6 +1292,7 @@ func UnmarshalProviderGatewayPortReference(m map[string]json.RawMessage, result // - ProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpdate // - ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPIPUpdate // - ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayBGPASNUpdate +// - ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN type ProviderGatewayUpdateAttributesUpdatesItem struct { // New gateway speed in megabits per second. SpeedMbps *int64 `json:"speed_mbps,omitempty"` @@ -1292,6 +1318,11 @@ type ProviderGatewayUpdateAttributesUpdatesItem struct { // New gateway BGP ASN. BgpAsn *int64 `json:"bgp_asn,omitempty"` + + // VLAN to be updated for this gateway. + // + // VLAN provided should be in the range 1 to 4094. + Vlan *int64 `json:"vlan,omitempty"` } func (*ProviderGatewayUpdateAttributesUpdatesItem) isaProviderGatewayUpdateAttributesUpdatesItem() bool { @@ -1321,6 +1352,10 @@ func UnmarshalProviderGatewayUpdateAttributesUpdatesItem(m map[string]json.RawMe if err != nil { return } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -1422,6 +1457,14 @@ func UnmarshalProviderPortCollection(m map[string]json.RawMessage, result interf return } +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ProviderPortCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + // ProviderPortCollectionFirst : A reference to the first page of resources. type ProviderPortCollectionFirst struct { // The URL for the first page of resources. @@ -1466,11 +1509,11 @@ func UnmarshalProviderPortCollectionNext(m map[string]json.RawMessage, result in // UpdateProviderGatewayOptions : The UpdateProviderGateway options. type UpdateProviderGatewayOptions struct { // Direct Link Connect gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // The autonomous system number (ASN) of Border Gateway Protocol (BGP) configuration for the IBM side of the DL 2.0 // gateway. - BgpAsn *int64 + BgpAsn *int64 `json:"bgp_asn,omitempty"` // BGP customer edge router CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on customer edge // router for the DL 2.0 gateway. Customer edge IP and IBM IP should be in the same network. Updating customer edge @@ -1478,20 +1521,25 @@ type UpdateProviderGatewayOptions struct { // bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", // "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching // network and subnet mask values. - BgpCerCidr *string + BgpCerCidr *string `json:"bgp_cer_cidr,omitempty"` // BGP IBM CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on IBM edge router for the DL 2.0 // gateway. IBM IP and customer edge IP should be in the same network. Updating IBM CIDR should be accompanied with // customer edge router CIDR in the request. Update IBM CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value // must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. // bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values. - BgpIbmCidr *string + BgpIbmCidr *string `json:"bgp_ibm_cidr,omitempty"` // The unique user-defined name for this gateway. - Name *string + Name *string `json:"name,omitempty"` // Gateway speed in megabits per second. - SpeedMbps *int64 + SpeedMbps *int64 `json:"speed_mbps,omitempty"` + + // VLAN to be modified for this gateway. + // + // VLAN provided should be in the range 1 to 4094. + Vlan *int64 `json:"vlan,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -1505,39 +1553,45 @@ func (*DirectLinkProviderV2) NewUpdateProviderGatewayOptions(id string) *UpdateP } // SetID : Allow user to set ID -func (options *UpdateProviderGatewayOptions) SetID(id string) *UpdateProviderGatewayOptions { - options.ID = core.StringPtr(id) - return options +func (_options *UpdateProviderGatewayOptions) SetID(id string) *UpdateProviderGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } // SetBgpAsn : Allow user to set BgpAsn -func (options *UpdateProviderGatewayOptions) SetBgpAsn(bgpAsn int64) *UpdateProviderGatewayOptions { - options.BgpAsn = core.Int64Ptr(bgpAsn) - return options +func (_options *UpdateProviderGatewayOptions) SetBgpAsn(bgpAsn int64) *UpdateProviderGatewayOptions { + _options.BgpAsn = core.Int64Ptr(bgpAsn) + return _options } // SetBgpCerCidr : Allow user to set BgpCerCidr -func (options *UpdateProviderGatewayOptions) SetBgpCerCidr(bgpCerCidr string) *UpdateProviderGatewayOptions { - options.BgpCerCidr = core.StringPtr(bgpCerCidr) - return options +func (_options *UpdateProviderGatewayOptions) SetBgpCerCidr(bgpCerCidr string) *UpdateProviderGatewayOptions { + _options.BgpCerCidr = core.StringPtr(bgpCerCidr) + return _options } // SetBgpIbmCidr : Allow user to set BgpIbmCidr -func (options *UpdateProviderGatewayOptions) SetBgpIbmCidr(bgpIbmCidr string) *UpdateProviderGatewayOptions { - options.BgpIbmCidr = core.StringPtr(bgpIbmCidr) - return options +func (_options *UpdateProviderGatewayOptions) SetBgpIbmCidr(bgpIbmCidr string) *UpdateProviderGatewayOptions { + _options.BgpIbmCidr = core.StringPtr(bgpIbmCidr) + return _options } // SetName : Allow user to set Name -func (options *UpdateProviderGatewayOptions) SetName(name string) *UpdateProviderGatewayOptions { - options.Name = core.StringPtr(name) - return options +func (_options *UpdateProviderGatewayOptions) SetName(name string) *UpdateProviderGatewayOptions { + _options.Name = core.StringPtr(name) + return _options } // SetSpeedMbps : Allow user to set SpeedMbps -func (options *UpdateProviderGatewayOptions) SetSpeedMbps(speedMbps int64) *UpdateProviderGatewayOptions { - options.SpeedMbps = core.Int64Ptr(speedMbps) - return options +func (_options *UpdateProviderGatewayOptions) SetSpeedMbps(speedMbps int64) *UpdateProviderGatewayOptions { + _options.SpeedMbps = core.Int64Ptr(speedMbps) + return _options +} + +// SetVlan : Allow user to set Vlan +func (_options *UpdateProviderGatewayOptions) SetVlan(vlan int64) *UpdateProviderGatewayOptions { + _options.Vlan = core.Int64Ptr(vlan) + return _options } // SetHeaders : Allow user to set Headers @@ -1723,3 +1777,29 @@ func UnmarshalProviderGatewayUpdateAttributesUpdatesItemProviderGatewaySpeedUpda reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } + +// ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN : Update VLAN for this gateway. +// +// VLAN provided should be in the range 1 to 4094. +// This model "extends" ProviderGatewayUpdateAttributesUpdatesItem +type ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN struct { + // VLAN to be updated for this gateway. + // + // VLAN provided should be in the range 1 to 4094. + Vlan *int64 `json:"vlan,omitempty"` +} + +func (*ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN) isaProviderGatewayUpdateAttributesUpdatesItem() bool { + return true +} + +// UnmarshalProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN unmarshals an instance of ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN from the specified map of raw messages. +func UnmarshalProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProviderGatewayUpdateAttributesUpdatesItemProviderGatewayVLAN) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} diff --git a/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkv1/direct_link_v1.go b/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkv1/direct_link_v1.go index c4155967d0..ce0e04fd34 100644 --- a/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkv1/direct_link_v1.go +++ b/ibm/vendor/github.com/IBM/networking-go-sdk/directlinkv1/direct_link_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156 + * IBM OpenAPI SDK Code Generator Version: 3.43.0-49eab5c7-20211117-152138 */ // Package directlinkv1 : Operations and models for the DirectLinkV1 service @@ -38,7 +38,7 @@ import ( // DirectLinkV1 : No description provided (generated by Openapi Generator // https://github.com/openapitools/openapi-generator) // -// Version: __VERSION__ +// API Version: __VERSION__ type DirectLinkV1 struct { Service *core.BaseService @@ -1551,44 +1551,44 @@ func (directLink *DirectLinkV1) UpdateGatewayVirtualConnectionWithContext(ctx co // CreateGatewayActionOptions : The CreateGatewayAction options. type CreateGatewayActionOptions struct { // Direct Link Connect gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Action request. - Action *string `validate:"required"` + Action *string `json:"action" validate:"required"` // Applicable for create_gateway_approve requests to select the gateway's BGP MD5 authentication key. // The key material that you provide must be base64 encoded and original string must be maximum 126 ASCII characters in // length. // To clear the optional `authentication_key` field patch its crn to `""`. - AuthenticationKey *GatewayActionTemplateAuthenticationKey + AuthenticationKey *GatewayActionTemplateAuthenticationKey `json:"authentication_key,omitempty"` // Applicable for create_gateway_approve requests to select the gateway's BFD configuration information. - BfdConfig *GatewayBfdConfigActionTemplate + BfdConfig *GatewayBfdConfigActionTemplate `json:"bfd_config,omitempty"` // Applicable for create_gateway_approve requests to select the type of services this gateway is attached to. Mode // transit indicates this gateway will be attached to Transit Gateway Service and direct means this gateway will be // attached to vpc or classic connection. If unspecified on create_gateway_approve, default value direct is used. The // list of enumerated values for this property may expand in the future. Code and processes using this field must // tolerate unexpected values. - ConnectionMode *string + ConnectionMode *string `json:"connection_mode,omitempty"` // Applicable for create_gateway_approve requests to select the gateway's routing option. Gateways with global routing // (`true`) can connect to networks outside of their associated region. - Global *bool + Global *bool `json:"global,omitempty"` // Applicable for create_gateway_approve requests to select the gateway's metered billing option. When `true` gateway // usage is billed per gigabyte. When `false` there is no per gigabyte usage charge, instead a flat rate is charged // for the gateway. - Metered *bool + Metered *bool `json:"metered,omitempty"` // Set for create_gateway_approve requests to select the gateway's resource group. If unspecified on // create_gateway_approve, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup *ResourceGroupIdentity + ResourceGroup *ResourceGroupIdentity `json:"resource_group,omitempty"` // Specify attribute updates being approved or rejected, update_attributes_approve and update_attributes_reject actions // must provide an updates field that matches the gateway's current pending changes. - Updates []GatewayActionTemplateUpdatesItemIntf + Updates []GatewayActionTemplateUpdatesItemIntf `json:"updates,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -1625,57 +1625,57 @@ func (*DirectLinkV1) NewCreateGatewayActionOptions(id string, action string) *Cr } // SetID : Allow user to set ID -func (options *CreateGatewayActionOptions) SetID(id string) *CreateGatewayActionOptions { - options.ID = core.StringPtr(id) - return options +func (_options *CreateGatewayActionOptions) SetID(id string) *CreateGatewayActionOptions { + _options.ID = core.StringPtr(id) + return _options } // SetAction : Allow user to set Action -func (options *CreateGatewayActionOptions) SetAction(action string) *CreateGatewayActionOptions { - options.Action = core.StringPtr(action) - return options +func (_options *CreateGatewayActionOptions) SetAction(action string) *CreateGatewayActionOptions { + _options.Action = core.StringPtr(action) + return _options } // SetAuthenticationKey : Allow user to set AuthenticationKey -func (options *CreateGatewayActionOptions) SetAuthenticationKey(authenticationKey *GatewayActionTemplateAuthenticationKey) *CreateGatewayActionOptions { - options.AuthenticationKey = authenticationKey - return options +func (_options *CreateGatewayActionOptions) SetAuthenticationKey(authenticationKey *GatewayActionTemplateAuthenticationKey) *CreateGatewayActionOptions { + _options.AuthenticationKey = authenticationKey + return _options } // SetBfdConfig : Allow user to set BfdConfig -func (options *CreateGatewayActionOptions) SetBfdConfig(bfdConfig *GatewayBfdConfigActionTemplate) *CreateGatewayActionOptions { - options.BfdConfig = bfdConfig - return options +func (_options *CreateGatewayActionOptions) SetBfdConfig(bfdConfig *GatewayBfdConfigActionTemplate) *CreateGatewayActionOptions { + _options.BfdConfig = bfdConfig + return _options } // SetConnectionMode : Allow user to set ConnectionMode -func (options *CreateGatewayActionOptions) SetConnectionMode(connectionMode string) *CreateGatewayActionOptions { - options.ConnectionMode = core.StringPtr(connectionMode) - return options +func (_options *CreateGatewayActionOptions) SetConnectionMode(connectionMode string) *CreateGatewayActionOptions { + _options.ConnectionMode = core.StringPtr(connectionMode) + return _options } // SetGlobal : Allow user to set Global -func (options *CreateGatewayActionOptions) SetGlobal(global bool) *CreateGatewayActionOptions { - options.Global = core.BoolPtr(global) - return options +func (_options *CreateGatewayActionOptions) SetGlobal(global bool) *CreateGatewayActionOptions { + _options.Global = core.BoolPtr(global) + return _options } // SetMetered : Allow user to set Metered -func (options *CreateGatewayActionOptions) SetMetered(metered bool) *CreateGatewayActionOptions { - options.Metered = core.BoolPtr(metered) - return options +func (_options *CreateGatewayActionOptions) SetMetered(metered bool) *CreateGatewayActionOptions { + _options.Metered = core.BoolPtr(metered) + return _options } // SetResourceGroup : Allow user to set ResourceGroup -func (options *CreateGatewayActionOptions) SetResourceGroup(resourceGroup *ResourceGroupIdentity) *CreateGatewayActionOptions { - options.ResourceGroup = resourceGroup - return options +func (_options *CreateGatewayActionOptions) SetResourceGroup(resourceGroup *ResourceGroupIdentity) *CreateGatewayActionOptions { + _options.ResourceGroup = resourceGroup + return _options } // SetUpdates : Allow user to set Updates -func (options *CreateGatewayActionOptions) SetUpdates(updates []GatewayActionTemplateUpdatesItemIntf) *CreateGatewayActionOptions { - options.Updates = updates - return options +func (_options *CreateGatewayActionOptions) SetUpdates(updates []GatewayActionTemplateUpdatesItemIntf) *CreateGatewayActionOptions { + _options.Updates = updates + return _options } // SetHeaders : Allow user to set Headers @@ -1687,13 +1687,13 @@ func (options *CreateGatewayActionOptions) SetHeaders(param map[string]string) * // CreateGatewayCompletionNoticeOptions : The CreateGatewayCompletionNotice options. type CreateGatewayCompletionNoticeOptions struct { // Direct Link Dedicated gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Completion notice PDF file. - Upload io.ReadCloser + Upload io.ReadCloser `json:"upload,omitempty"` // The content type of upload. - UploadContentType *string + UploadContentType *string `json:"upload_content_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -1707,21 +1707,21 @@ func (*DirectLinkV1) NewCreateGatewayCompletionNoticeOptions(id string) *CreateG } // SetID : Allow user to set ID -func (options *CreateGatewayCompletionNoticeOptions) SetID(id string) *CreateGatewayCompletionNoticeOptions { - options.ID = core.StringPtr(id) - return options +func (_options *CreateGatewayCompletionNoticeOptions) SetID(id string) *CreateGatewayCompletionNoticeOptions { + _options.ID = core.StringPtr(id) + return _options } // SetUpload : Allow user to set Upload -func (options *CreateGatewayCompletionNoticeOptions) SetUpload(upload io.ReadCloser) *CreateGatewayCompletionNoticeOptions { - options.Upload = upload - return options +func (_options *CreateGatewayCompletionNoticeOptions) SetUpload(upload io.ReadCloser) *CreateGatewayCompletionNoticeOptions { + _options.Upload = upload + return _options } // SetUploadContentType : Allow user to set UploadContentType -func (options *CreateGatewayCompletionNoticeOptions) SetUploadContentType(uploadContentType string) *CreateGatewayCompletionNoticeOptions { - options.UploadContentType = core.StringPtr(uploadContentType) - return options +func (_options *CreateGatewayCompletionNoticeOptions) SetUploadContentType(uploadContentType string) *CreateGatewayCompletionNoticeOptions { + _options.UploadContentType = core.StringPtr(uploadContentType) + return _options } // SetHeaders : Allow user to set Headers @@ -1733,7 +1733,7 @@ func (options *CreateGatewayCompletionNoticeOptions) SetHeaders(param map[string // CreateGatewayOptions : The CreateGateway options. type CreateGatewayOptions struct { // The Direct Link Gateway template. - GatewayTemplate GatewayTemplateIntf `validate:"required"` + GatewayTemplate GatewayTemplateIntf `json:"GatewayTemplate" validate:"required"` // Allows users to set headers on API requests Headers map[string]string @@ -1747,9 +1747,9 @@ func (*DirectLinkV1) NewCreateGatewayOptions(gatewayTemplate GatewayTemplateIntf } // SetGatewayTemplate : Allow user to set GatewayTemplate -func (options *CreateGatewayOptions) SetGatewayTemplate(gatewayTemplate GatewayTemplateIntf) *CreateGatewayOptions { - options.GatewayTemplate = gatewayTemplate - return options +func (_options *CreateGatewayOptions) SetGatewayTemplate(gatewayTemplate GatewayTemplateIntf) *CreateGatewayOptions { + _options.GatewayTemplate = gatewayTemplate + return _options } // SetHeaders : Allow user to set Headers @@ -1761,18 +1761,18 @@ func (options *CreateGatewayOptions) SetHeaders(param map[string]string) *Create // CreateGatewayVirtualConnectionOptions : The CreateGatewayVirtualConnection options. type CreateGatewayVirtualConnectionOptions struct { // Direct Link gateway identifier. - GatewayID *string `validate:"required,ne="` + GatewayID *string `json:"gateway_id" validate:"required,ne="` // The user-defined name for this virtual connection. Virtual connection names are unique within a gateway. This is // the name of the virtual connection itself, the network being connected may have its own name attribute. - Name *string `validate:"required"` + Name *string `json:"name" validate:"required"` // The type of virtual connection. - Type *string `validate:"required"` + Type *string `json:"type" validate:"required"` // Unique identifier of the target network. For type=vpc virtual connections this is the CRN of the target VPC. This // field does not apply to type=classic connections. - NetworkID *string + NetworkID *string `json:"network_id,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -1795,27 +1795,27 @@ func (*DirectLinkV1) NewCreateGatewayVirtualConnectionOptions(gatewayID string, } // SetGatewayID : Allow user to set GatewayID -func (options *CreateGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *CreateGatewayVirtualConnectionOptions { - options.GatewayID = core.StringPtr(gatewayID) - return options +func (_options *CreateGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *CreateGatewayVirtualConnectionOptions { + _options.GatewayID = core.StringPtr(gatewayID) + return _options } // SetName : Allow user to set Name -func (options *CreateGatewayVirtualConnectionOptions) SetName(name string) *CreateGatewayVirtualConnectionOptions { - options.Name = core.StringPtr(name) - return options +func (_options *CreateGatewayVirtualConnectionOptions) SetName(name string) *CreateGatewayVirtualConnectionOptions { + _options.Name = core.StringPtr(name) + return _options } // SetType : Allow user to set Type -func (options *CreateGatewayVirtualConnectionOptions) SetType(typeVar string) *CreateGatewayVirtualConnectionOptions { - options.Type = core.StringPtr(typeVar) - return options +func (_options *CreateGatewayVirtualConnectionOptions) SetType(typeVar string) *CreateGatewayVirtualConnectionOptions { + _options.Type = core.StringPtr(typeVar) + return _options } // SetNetworkID : Allow user to set NetworkID -func (options *CreateGatewayVirtualConnectionOptions) SetNetworkID(networkID string) *CreateGatewayVirtualConnectionOptions { - options.NetworkID = core.StringPtr(networkID) - return options +func (_options *CreateGatewayVirtualConnectionOptions) SetNetworkID(networkID string) *CreateGatewayVirtualConnectionOptions { + _options.NetworkID = core.StringPtr(networkID) + return _options } // SetHeaders : Allow user to set Headers @@ -1858,7 +1858,7 @@ func UnmarshalCrossConnectRouter(m map[string]json.RawMessage, result interface{ // DeleteGatewayOptions : The DeleteGateway options. type DeleteGatewayOptions struct { // Direct Link gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -1872,9 +1872,9 @@ func (*DirectLinkV1) NewDeleteGatewayOptions(id string) *DeleteGatewayOptions { } // SetID : Allow user to set ID -func (options *DeleteGatewayOptions) SetID(id string) *DeleteGatewayOptions { - options.ID = core.StringPtr(id) - return options +func (_options *DeleteGatewayOptions) SetID(id string) *DeleteGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -1886,10 +1886,10 @@ func (options *DeleteGatewayOptions) SetHeaders(param map[string]string) *Delete // DeleteGatewayVirtualConnectionOptions : The DeleteGatewayVirtualConnection options. type DeleteGatewayVirtualConnectionOptions struct { // Direct Link gateway identifier. - GatewayID *string `validate:"required,ne="` + GatewayID *string `json:"gateway_id" validate:"required,ne="` // The virtual connection identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -1904,15 +1904,15 @@ func (*DirectLinkV1) NewDeleteGatewayVirtualConnectionOptions(gatewayID string, } // SetGatewayID : Allow user to set GatewayID -func (options *DeleteGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *DeleteGatewayVirtualConnectionOptions { - options.GatewayID = core.StringPtr(gatewayID) - return options +func (_options *DeleteGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *DeleteGatewayVirtualConnectionOptions { + _options.GatewayID = core.StringPtr(gatewayID) + return _options } // SetID : Allow user to set ID -func (options *DeleteGatewayVirtualConnectionOptions) SetID(id string) *DeleteGatewayVirtualConnectionOptions { - options.ID = core.StringPtr(id) - return options +func (_options *DeleteGatewayVirtualConnectionOptions) SetID(id string) *DeleteGatewayVirtualConnectionOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -2249,11 +2249,11 @@ type GatewayActionTemplateAuthenticationKey struct { } // NewGatewayActionTemplateAuthenticationKey : Instantiate GatewayActionTemplateAuthenticationKey (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayActionTemplateAuthenticationKey(crn string) (model *GatewayActionTemplateAuthenticationKey, err error) { - model = &GatewayActionTemplateAuthenticationKey{ +func (*DirectLinkV1) NewGatewayActionTemplateAuthenticationKey(crn string) (_model *GatewayActionTemplateAuthenticationKey, err error) { + _model = &GatewayActionTemplateAuthenticationKey{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -2273,6 +2273,7 @@ func UnmarshalGatewayActionTemplateAuthenticationKey(m map[string]json.RawMessag // - GatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate // - GatewayActionTemplateUpdatesItemGatewayClientBGPIPUpdate // - GatewayActionTemplateUpdatesItemGatewayClientBGPASNUpdate +// - GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate type GatewayActionTemplateUpdatesItem struct { // New gateway speed in megabits per second. SpeedMbps *int64 `json:"speed_mbps,omitempty"` @@ -2298,6 +2299,9 @@ type GatewayActionTemplateUpdatesItem struct { // New gateway BGP ASN. BgpAsn *int64 `json:"bgp_asn,omitempty"` + + // VLAN to be updated for this gateway. + Vlan *int64 `json:"vlan,omitempty"` } func (*GatewayActionTemplateUpdatesItem) isaGatewayActionTemplateUpdatesItem() bool { @@ -2327,6 +2331,10 @@ func UnmarshalGatewayActionTemplateUpdatesItem(m map[string]json.RawMessage, res if err != nil { return } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -2412,11 +2420,11 @@ type GatewayBfdConfigActionTemplate struct { } // NewGatewayBfdConfigActionTemplate : Instantiate GatewayBfdConfigActionTemplate (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayBfdConfigActionTemplate(interval int64) (model *GatewayBfdConfigActionTemplate, err error) { - model = &GatewayBfdConfigActionTemplate{ +func (*DirectLinkV1) NewGatewayBfdConfigActionTemplate(interval int64) (_model *GatewayBfdConfigActionTemplate, err error) { + _model = &GatewayBfdConfigActionTemplate{ Interval: core.Int64Ptr(interval), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -2446,11 +2454,11 @@ type GatewayBfdConfigTemplate struct { } // NewGatewayBfdConfigTemplate : Instantiate GatewayBfdConfigTemplate (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayBfdConfigTemplate(interval int64) (model *GatewayBfdConfigTemplate, err error) { - model = &GatewayBfdConfigTemplate{ +func (*DirectLinkV1) NewGatewayBfdConfigTemplate(interval int64) (_model *GatewayBfdConfigTemplate, err error) { + _model = &GatewayBfdConfigTemplate{ Interval: core.Int64Ptr(interval), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -2543,6 +2551,7 @@ func UnmarshalGatewayChangeRequest(m map[string]json.RawMessage, result interfac // - GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientSpeedUpdate // - GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPIPUpdate // - GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate +// - GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate type GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem struct { // New gateway speed in megabits per second. SpeedMbps *int64 `json:"speed_mbps,omitempty"` @@ -2568,6 +2577,9 @@ type GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem struct // New gateway BGP ASN. BgpAsn *int64 `json:"bgp_asn,omitempty"` + + // VLAN to be updated for this gateway. + Vlan *int64 `json:"vlan,omitempty"` } func (*GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem) isaGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem() bool { @@ -2597,6 +2609,10 @@ func UnmarshalGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesIte if err != nil { return } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -2606,6 +2622,7 @@ func UnmarshalGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesIte // - GatewayChangeRequestUpdatesItemGatewayClientSpeedUpdate // - GatewayChangeRequestUpdatesItemGatewayClientBGPIPUpdate // - GatewayChangeRequestUpdatesItemGatewayClientBGPASNUpdate +// - GatewayChangeRequestUpdatesItemGatewayClientVLANUpdate type GatewayChangeRequestUpdatesItem struct { // New gateway speed in megabits per second. SpeedMbps *int64 `json:"speed_mbps,omitempty"` @@ -2631,6 +2648,9 @@ type GatewayChangeRequestUpdatesItem struct { // New gateway BGP ASN. BgpAsn *int64 `json:"bgp_asn,omitempty"` + + // VLAN to be updated for this gateway. + Vlan *int64 `json:"vlan,omitempty"` } func (*GatewayChangeRequestUpdatesItem) isaGatewayChangeRequestUpdatesItem() bool { @@ -2660,6 +2680,10 @@ func UnmarshalGatewayChangeRequestUpdatesItem(m map[string]json.RawMessage, resu if err != nil { return } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -2931,11 +2955,11 @@ type GatewayMacsecConfigPatchTemplateFallbackCak struct { } // NewGatewayMacsecConfigPatchTemplateFallbackCak : Instantiate GatewayMacsecConfigPatchTemplateFallbackCak (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayMacsecConfigPatchTemplateFallbackCak(crn string) (model *GatewayMacsecConfigPatchTemplateFallbackCak, err error) { - model = &GatewayMacsecConfigPatchTemplateFallbackCak{ +func (*DirectLinkV1) NewGatewayMacsecConfigPatchTemplateFallbackCak(crn string) (_model *GatewayMacsecConfigPatchTemplateFallbackCak, err error) { + _model = &GatewayMacsecConfigPatchTemplateFallbackCak{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -2962,11 +2986,11 @@ type GatewayMacsecConfigPatchTemplatePrimaryCak struct { } // NewGatewayMacsecConfigPatchTemplatePrimaryCak : Instantiate GatewayMacsecConfigPatchTemplatePrimaryCak (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayMacsecConfigPatchTemplatePrimaryCak(crn string) (model *GatewayMacsecConfigPatchTemplatePrimaryCak, err error) { - model = &GatewayMacsecConfigPatchTemplatePrimaryCak{ +func (*DirectLinkV1) NewGatewayMacsecConfigPatchTemplatePrimaryCak(crn string) (_model *GatewayMacsecConfigPatchTemplatePrimaryCak, err error) { + _model = &GatewayMacsecConfigPatchTemplatePrimaryCak{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3030,12 +3054,12 @@ type GatewayMacsecConfigTemplate struct { } // NewGatewayMacsecConfigTemplate : Instantiate GatewayMacsecConfigTemplate (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayMacsecConfigTemplate(active bool, primaryCak *GatewayMacsecConfigTemplatePrimaryCak) (model *GatewayMacsecConfigTemplate, err error) { - model = &GatewayMacsecConfigTemplate{ +func (*DirectLinkV1) NewGatewayMacsecConfigTemplate(active bool, primaryCak *GatewayMacsecConfigTemplatePrimaryCak) (_model *GatewayMacsecConfigTemplate, err error) { + _model = &GatewayMacsecConfigTemplate{ Active: core.BoolPtr(active), PrimaryCak: primaryCak, } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3073,11 +3097,11 @@ type GatewayMacsecConfigTemplateFallbackCak struct { } // NewGatewayMacsecConfigTemplateFallbackCak : Instantiate GatewayMacsecConfigTemplateFallbackCak (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayMacsecConfigTemplateFallbackCak(crn string) (model *GatewayMacsecConfigTemplateFallbackCak, err error) { - model = &GatewayMacsecConfigTemplateFallbackCak{ +func (*DirectLinkV1) NewGatewayMacsecConfigTemplateFallbackCak(crn string) (_model *GatewayMacsecConfigTemplateFallbackCak, err error) { + _model = &GatewayMacsecConfigTemplateFallbackCak{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3102,11 +3126,11 @@ type GatewayMacsecConfigTemplatePrimaryCak struct { } // NewGatewayMacsecConfigTemplatePrimaryCak : Instantiate GatewayMacsecConfigTemplatePrimaryCak (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayMacsecConfigTemplatePrimaryCak(crn string) (model *GatewayMacsecConfigTemplatePrimaryCak, err error) { - model = &GatewayMacsecConfigTemplatePrimaryCak{ +func (*DirectLinkV1) NewGatewayMacsecConfigTemplatePrimaryCak(crn string) (_model *GatewayMacsecConfigTemplatePrimaryCak, err error) { + _model = &GatewayMacsecConfigTemplatePrimaryCak{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3132,11 +3156,11 @@ type GatewayPatchTemplateAuthenticationKey struct { } // NewGatewayPatchTemplateAuthenticationKey : Instantiate GatewayPatchTemplateAuthenticationKey (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayPatchTemplateAuthenticationKey(crn string) (model *GatewayPatchTemplateAuthenticationKey, err error) { - model = &GatewayPatchTemplateAuthenticationKey{ +func (*DirectLinkV1) NewGatewayPatchTemplateAuthenticationKey(crn string) (_model *GatewayPatchTemplateAuthenticationKey, err error) { + _model = &GatewayPatchTemplateAuthenticationKey{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3175,11 +3199,11 @@ type GatewayPortIdentity struct { } // NewGatewayPortIdentity : Instantiate GatewayPortIdentity (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayPortIdentity(id string) (model *GatewayPortIdentity, err error) { - model = &GatewayPortIdentity{ +func (*DirectLinkV1) NewGatewayPortIdentity(id string) (_model *GatewayPortIdentity, err error) { + _model = &GatewayPortIdentity{ ID: core.StringPtr(id), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3539,11 +3563,11 @@ type GatewayTemplateAuthenticationKey struct { } // NewGatewayTemplateAuthenticationKey : Instantiate GatewayTemplateAuthenticationKey (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayTemplateAuthenticationKey(crn string) (model *GatewayTemplateAuthenticationKey, err error) { - model = &GatewayTemplateAuthenticationKey{ +func (*DirectLinkV1) NewGatewayTemplateAuthenticationKey(crn string) (_model *GatewayTemplateAuthenticationKey, err error) { + _model = &GatewayTemplateAuthenticationKey{ Crn: core.StringPtr(crn), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -3673,7 +3697,7 @@ func UnmarshalGatewayVirtualConnectionCollection(m map[string]json.RawMessage, r // GetGatewayOptions : The GetGateway options. type GetGatewayOptions struct { // Direct Link gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3687,9 +3711,9 @@ func (*DirectLinkV1) NewGetGatewayOptions(id string) *GetGatewayOptions { } // SetID : Allow user to set ID -func (options *GetGatewayOptions) SetID(id string) *GetGatewayOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetGatewayOptions) SetID(id string) *GetGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -3701,10 +3725,10 @@ func (options *GetGatewayOptions) SetHeaders(param map[string]string) *GetGatewa // GetGatewayStatisticsOptions : The GetGatewayStatistics options. type GetGatewayStatisticsOptions struct { // Direct Link gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Specify statistic to retrieve. - Type *string `validate:"required"` + Type *string `json:"type" validate:"required"` // Allows users to set headers on API requests Headers map[string]string @@ -3713,8 +3737,10 @@ type GetGatewayStatisticsOptions struct { // Constants associated with the GetGatewayStatisticsOptions.Type property. // Specify statistic to retrieve. const ( - GetGatewayStatisticsOptions_Type_MacsecMka = "macsec_mka" - GetGatewayStatisticsOptions_Type_MacsecSecurity = "macsec_security" + GetGatewayStatisticsOptions_Type_BfdSession = "bfd_session" + GetGatewayStatisticsOptions_Type_MacsecMkaSession = "macsec_mka_session" + GetGatewayStatisticsOptions_Type_MacsecMkaStatistics = "macsec_mka_statistics" + GetGatewayStatisticsOptions_Type_MacsecPolicy = "macsec_policy" ) // NewGetGatewayStatisticsOptions : Instantiate GetGatewayStatisticsOptions @@ -3726,15 +3752,15 @@ func (*DirectLinkV1) NewGetGatewayStatisticsOptions(id string, typeVar string) * } // SetID : Allow user to set ID -func (options *GetGatewayStatisticsOptions) SetID(id string) *GetGatewayStatisticsOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetGatewayStatisticsOptions) SetID(id string) *GetGatewayStatisticsOptions { + _options.ID = core.StringPtr(id) + return _options } // SetType : Allow user to set Type -func (options *GetGatewayStatisticsOptions) SetType(typeVar string) *GetGatewayStatisticsOptions { - options.Type = core.StringPtr(typeVar) - return options +func (_options *GetGatewayStatisticsOptions) SetType(typeVar string) *GetGatewayStatisticsOptions { + _options.Type = core.StringPtr(typeVar) + return _options } // SetHeaders : Allow user to set Headers @@ -3746,10 +3772,10 @@ func (options *GetGatewayStatisticsOptions) SetHeaders(param map[string]string) // GetGatewayStatusOptions : The GetGatewayStatus options. type GetGatewayStatusOptions struct { // Direct Link gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Specify status to retrieve. - Type *string + Type *string `json:"type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -3771,15 +3797,15 @@ func (*DirectLinkV1) NewGetGatewayStatusOptions(id string) *GetGatewayStatusOpti } // SetID : Allow user to set ID -func (options *GetGatewayStatusOptions) SetID(id string) *GetGatewayStatusOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetGatewayStatusOptions) SetID(id string) *GetGatewayStatusOptions { + _options.ID = core.StringPtr(id) + return _options } // SetType : Allow user to set Type -func (options *GetGatewayStatusOptions) SetType(typeVar string) *GetGatewayStatusOptions { - options.Type = core.StringPtr(typeVar) - return options +func (_options *GetGatewayStatusOptions) SetType(typeVar string) *GetGatewayStatusOptions { + _options.Type = core.StringPtr(typeVar) + return _options } // SetHeaders : Allow user to set Headers @@ -3791,10 +3817,10 @@ func (options *GetGatewayStatusOptions) SetHeaders(param map[string]string) *Get // GetGatewayVirtualConnectionOptions : The GetGatewayVirtualConnection options. type GetGatewayVirtualConnectionOptions struct { // Direct Link gateway identifier. - GatewayID *string `validate:"required,ne="` + GatewayID *string `json:"gateway_id" validate:"required,ne="` // The virtual connection identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3809,15 +3835,15 @@ func (*DirectLinkV1) NewGetGatewayVirtualConnectionOptions(gatewayID string, id } // SetGatewayID : Allow user to set GatewayID -func (options *GetGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *GetGatewayVirtualConnectionOptions { - options.GatewayID = core.StringPtr(gatewayID) - return options +func (_options *GetGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *GetGatewayVirtualConnectionOptions { + _options.GatewayID = core.StringPtr(gatewayID) + return _options } // SetID : Allow user to set ID -func (options *GetGatewayVirtualConnectionOptions) SetID(id string) *GetGatewayVirtualConnectionOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetGatewayVirtualConnectionOptions) SetID(id string) *GetGatewayVirtualConnectionOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -3829,7 +3855,7 @@ func (options *GetGatewayVirtualConnectionOptions) SetHeaders(param map[string]s // GetPortOptions : The GetPort options. type GetPortOptions struct { // The port identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3843,9 +3869,9 @@ func (*DirectLinkV1) NewGetPortOptions(id string) *GetPortOptions { } // SetID : Allow user to set ID -func (options *GetPortOptions) SetID(id string) *GetPortOptions { - options.ID = core.StringPtr(id) - return options +func (_options *GetPortOptions) SetID(id string) *GetPortOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -3857,7 +3883,7 @@ func (options *GetPortOptions) SetHeaders(param map[string]string) *GetPortOptio // ListGatewayCompletionNoticeOptions : The ListGatewayCompletionNotice options. type ListGatewayCompletionNoticeOptions struct { // Direct Link Dedicated gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3871,9 +3897,9 @@ func (*DirectLinkV1) NewListGatewayCompletionNoticeOptions(id string) *ListGatew } // SetID : Allow user to set ID -func (options *ListGatewayCompletionNoticeOptions) SetID(id string) *ListGatewayCompletionNoticeOptions { - options.ID = core.StringPtr(id) - return options +func (_options *ListGatewayCompletionNoticeOptions) SetID(id string) *ListGatewayCompletionNoticeOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -3885,7 +3911,7 @@ func (options *ListGatewayCompletionNoticeOptions) SetHeaders(param map[string]s // ListGatewayLetterOfAuthorizationOptions : The ListGatewayLetterOfAuthorization options. type ListGatewayLetterOfAuthorizationOptions struct { // Direct Link Dedicated gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3899,9 +3925,9 @@ func (*DirectLinkV1) NewListGatewayLetterOfAuthorizationOptions(id string) *List } // SetID : Allow user to set ID -func (options *ListGatewayLetterOfAuthorizationOptions) SetID(id string) *ListGatewayLetterOfAuthorizationOptions { - options.ID = core.StringPtr(id) - return options +func (_options *ListGatewayLetterOfAuthorizationOptions) SetID(id string) *ListGatewayLetterOfAuthorizationOptions { + _options.ID = core.StringPtr(id) + return _options } // SetHeaders : Allow user to set Headers @@ -3913,7 +3939,7 @@ func (options *ListGatewayLetterOfAuthorizationOptions) SetHeaders(param map[str // ListGatewayVirtualConnectionsOptions : The ListGatewayVirtualConnections options. type ListGatewayVirtualConnectionsOptions struct { // Direct Link gateway identifier. - GatewayID *string `validate:"required,ne="` + GatewayID *string `json:"gateway_id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3927,9 +3953,9 @@ func (*DirectLinkV1) NewListGatewayVirtualConnectionsOptions(gatewayID string) * } // SetGatewayID : Allow user to set GatewayID -func (options *ListGatewayVirtualConnectionsOptions) SetGatewayID(gatewayID string) *ListGatewayVirtualConnectionsOptions { - options.GatewayID = core.StringPtr(gatewayID) - return options +func (_options *ListGatewayVirtualConnectionsOptions) SetGatewayID(gatewayID string) *ListGatewayVirtualConnectionsOptions { + _options.GatewayID = core.StringPtr(gatewayID) + return _options } // SetHeaders : Allow user to set Headers @@ -3959,10 +3985,10 @@ func (options *ListGatewaysOptions) SetHeaders(param map[string]string) *ListGat // ListOfferingTypeLocationCrossConnectRoutersOptions : The ListOfferingTypeLocationCrossConnectRouters options. type ListOfferingTypeLocationCrossConnectRoutersOptions struct { // The Direct Link offering type. Only value `"dedicated"` is supported for this API. - OfferingType *string `validate:"required,ne="` + OfferingType *string `json:"offering_type" validate:"required,ne="` // The name of the Direct Link location. - LocationName *string `validate:"required,ne="` + LocationName *string `json:"location_name" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -3983,15 +4009,15 @@ func (*DirectLinkV1) NewListOfferingTypeLocationCrossConnectRoutersOptions(offer } // SetOfferingType : Allow user to set OfferingType -func (options *ListOfferingTypeLocationCrossConnectRoutersOptions) SetOfferingType(offeringType string) *ListOfferingTypeLocationCrossConnectRoutersOptions { - options.OfferingType = core.StringPtr(offeringType) - return options +func (_options *ListOfferingTypeLocationCrossConnectRoutersOptions) SetOfferingType(offeringType string) *ListOfferingTypeLocationCrossConnectRoutersOptions { + _options.OfferingType = core.StringPtr(offeringType) + return _options } // SetLocationName : Allow user to set LocationName -func (options *ListOfferingTypeLocationCrossConnectRoutersOptions) SetLocationName(locationName string) *ListOfferingTypeLocationCrossConnectRoutersOptions { - options.LocationName = core.StringPtr(locationName) - return options +func (_options *ListOfferingTypeLocationCrossConnectRoutersOptions) SetLocationName(locationName string) *ListOfferingTypeLocationCrossConnectRoutersOptions { + _options.LocationName = core.StringPtr(locationName) + return _options } // SetHeaders : Allow user to set Headers @@ -4003,7 +4029,7 @@ func (options *ListOfferingTypeLocationCrossConnectRoutersOptions) SetHeaders(pa // ListOfferingTypeLocationsOptions : The ListOfferingTypeLocations options. type ListOfferingTypeLocationsOptions struct { // The Direct Link offering type. Current supported values are `"dedicated"` and `"connect"`. - OfferingType *string `validate:"required,ne="` + OfferingType *string `json:"offering_type" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -4024,9 +4050,9 @@ func (*DirectLinkV1) NewListOfferingTypeLocationsOptions(offeringType string) *L } // SetOfferingType : Allow user to set OfferingType -func (options *ListOfferingTypeLocationsOptions) SetOfferingType(offeringType string) *ListOfferingTypeLocationsOptions { - options.OfferingType = core.StringPtr(offeringType) - return options +func (_options *ListOfferingTypeLocationsOptions) SetOfferingType(offeringType string) *ListOfferingTypeLocationsOptions { + _options.OfferingType = core.StringPtr(offeringType) + return _options } // SetHeaders : Allow user to set Headers @@ -4038,7 +4064,7 @@ func (options *ListOfferingTypeLocationsOptions) SetHeaders(param map[string]str // ListOfferingTypeSpeedsOptions : The ListOfferingTypeSpeeds options. type ListOfferingTypeSpeedsOptions struct { // The Direct Link offering type. Current supported values are `"dedicated"` and `"connect"`. - OfferingType *string `validate:"required,ne="` + OfferingType *string `json:"offering_type" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string @@ -4059,9 +4085,9 @@ func (*DirectLinkV1) NewListOfferingTypeSpeedsOptions(offeringType string) *List } // SetOfferingType : Allow user to set OfferingType -func (options *ListOfferingTypeSpeedsOptions) SetOfferingType(offeringType string) *ListOfferingTypeSpeedsOptions { - options.OfferingType = core.StringPtr(offeringType) - return options +func (_options *ListOfferingTypeSpeedsOptions) SetOfferingType(offeringType string) *ListOfferingTypeSpeedsOptions { + _options.OfferingType = core.StringPtr(offeringType) + return _options } // SetHeaders : Allow user to set Headers @@ -4073,13 +4099,13 @@ func (options *ListOfferingTypeSpeedsOptions) SetHeaders(param map[string]string // ListPortsOptions : The ListPorts options. type ListPortsOptions struct { // A server-supplied token determining which resource to start the page on. - Start *string + Start *string `json:"start,omitempty"` // The number of resources to return on a page. - Limit *int64 + Limit *int64 `json:"limit,omitempty"` // Direct Link location short name. - LocationName *string + LocationName *string `json:"location_name,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -4091,21 +4117,21 @@ func (*DirectLinkV1) NewListPortsOptions() *ListPortsOptions { } // SetStart : Allow user to set Start -func (options *ListPortsOptions) SetStart(start string) *ListPortsOptions { - options.Start = core.StringPtr(start) - return options +func (_options *ListPortsOptions) SetStart(start string) *ListPortsOptions { + _options.Start = core.StringPtr(start) + return _options } // SetLimit : Allow user to set Limit -func (options *ListPortsOptions) SetLimit(limit int64) *ListPortsOptions { - options.Limit = core.Int64Ptr(limit) - return options +func (_options *ListPortsOptions) SetLimit(limit int64) *ListPortsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } // SetLocationName : Allow user to set LocationName -func (options *ListPortsOptions) SetLocationName(locationName string) *ListPortsOptions { - options.LocationName = core.StringPtr(locationName) - return options +func (_options *ListPortsOptions) SetLocationName(locationName string) *ListPortsOptions { + _options.LocationName = core.StringPtr(locationName) + return _options } // SetHeaders : Allow user to set Headers @@ -4396,6 +4422,14 @@ func UnmarshalPortCollection(m map[string]json.RawMessage, result interface{}) ( return } +// Retrieve the value to be passed to a request to access the next page of results +func (resp *PortCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + // PortsPaginatedCollectionFirst : A reference to the first page of resources. type PortsPaginatedCollectionFirst struct { // The URL for the first page of resources. @@ -4445,11 +4479,11 @@ type ResourceGroupIdentity struct { } // NewResourceGroupIdentity : Instantiate ResourceGroupIdentity (Generic Model Constructor) -func (*DirectLinkV1) NewResourceGroupIdentity(id string) (model *ResourceGroupIdentity, err error) { - model = &ResourceGroupIdentity{ +func (*DirectLinkV1) NewResourceGroupIdentity(id string) (_model *ResourceGroupIdentity, err error) { + _model = &ResourceGroupIdentity{ ID: core.StringPtr(id), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -4484,20 +4518,20 @@ func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interf // UpdateGatewayOptions : The UpdateGateway options. type UpdateGatewayOptions struct { // Direct Link gateway identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // The identity of the standard key to use for BGP MD5 authentication key. // The key material that you provide must be base64 encoded and original string must be maximum 126 ASCII characters in // length. // To clear the optional `authentication_key` field patch its crn to `""`. - AuthenticationKey *GatewayPatchTemplateAuthenticationKey + AuthenticationKey *GatewayPatchTemplateAuthenticationKey `json:"authentication_key,omitempty"` // BFD configuration information. - BfdConfig *GatewayBfdPatchTemplate + BfdConfig *GatewayBfdPatchTemplate `json:"bfd_config,omitempty"` // The autonomous system number (ASN) of Border Gateway Protocol (BGP) configuration for the IBM side of the DL 2.0 // gateway. - BgpAsn *int64 + BgpAsn *int64 `json:"bgp_asn,omitempty"` // BGP customer edge router CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on customer edge // router for the DL 2.0 gateway. @@ -4506,7 +4540,7 @@ type UpdateGatewayOptions struct { // with IBM CIDR in the request. Update customer edge router IP to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the // value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public // CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values. - BgpCerCidr *string + BgpCerCidr *string `json:"bgp_cer_cidr,omitempty"` // BGP IBM CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on IBM edge router for the DL 2.0 // gateway. @@ -4515,33 +4549,33 @@ type UpdateGatewayOptions struct { // edge router CIDR in the request. Update IBM CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must // reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. // bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values. - BgpIbmCidr *string + BgpIbmCidr *string `json:"bgp_ibm_cidr,omitempty"` // Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway // Service and direct means this Gateway will be attached to vpc or classic connection. The list of enumerated values // for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - ConnectionMode *string + ConnectionMode *string `json:"connection_mode,omitempty"` // Gateways with global routing (`true`) can connect to networks outside of their associated region. - Global *bool + Global *bool `json:"global,omitempty"` // Use this field during LOA rejection to provide the reason for the rejection. // // Only allowed for type=dedicated gateways. - LoaRejectReason *string + LoaRejectReason *string `json:"loa_reject_reason,omitempty"` // MACsec configuration information. When patching any macsec_config fields, no other fields may be specified in the // patch request. Contact IBM support for access to MACsec. // // A MACsec config cannot be added to a gateway created without MACsec. - MacsecConfig *GatewayMacsecConfigPatchTemplate + MacsecConfig *GatewayMacsecConfigPatchTemplate `json:"macsec_config,omitempty"` // Metered billing option. When `true` gateway usage is billed per gigabyte. When `false` there is no per gigabyte // usage charge, instead a flat rate is charged for the gateway. - Metered *bool + Metered *bool `json:"metered,omitempty"` // The unique user-defined name for this gateway. - Name *string + Name *string `json:"name,omitempty"` // Gateway operational status. // @@ -4549,13 +4583,13 @@ type UpdateGatewayOptions struct { // When rejecting an LOA, provide reject reasoning in `loa_reject_reason`. // // Only allowed for type=dedicated gateways. - OperationalStatus *string + OperationalStatus *string `json:"operational_status,omitempty"` // Gateway patch panel complete notification from implementation team. - PatchPanelCompletionNotice *string + PatchPanelCompletionNotice *string `json:"patch_panel_completion_notice,omitempty"` // Gateway speed in megabits per second. - SpeedMbps *int64 + SpeedMbps *int64 `json:"speed_mbps,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -4590,93 +4624,93 @@ func (*DirectLinkV1) NewUpdateGatewayOptions(id string) *UpdateGatewayOptions { } // SetID : Allow user to set ID -func (options *UpdateGatewayOptions) SetID(id string) *UpdateGatewayOptions { - options.ID = core.StringPtr(id) - return options +func (_options *UpdateGatewayOptions) SetID(id string) *UpdateGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } // SetAuthenticationKey : Allow user to set AuthenticationKey -func (options *UpdateGatewayOptions) SetAuthenticationKey(authenticationKey *GatewayPatchTemplateAuthenticationKey) *UpdateGatewayOptions { - options.AuthenticationKey = authenticationKey - return options +func (_options *UpdateGatewayOptions) SetAuthenticationKey(authenticationKey *GatewayPatchTemplateAuthenticationKey) *UpdateGatewayOptions { + _options.AuthenticationKey = authenticationKey + return _options } // SetBfdConfig : Allow user to set BfdConfig -func (options *UpdateGatewayOptions) SetBfdConfig(bfdConfig *GatewayBfdPatchTemplate) *UpdateGatewayOptions { - options.BfdConfig = bfdConfig - return options +func (_options *UpdateGatewayOptions) SetBfdConfig(bfdConfig *GatewayBfdPatchTemplate) *UpdateGatewayOptions { + _options.BfdConfig = bfdConfig + return _options } // SetBgpAsn : Allow user to set BgpAsn -func (options *UpdateGatewayOptions) SetBgpAsn(bgpAsn int64) *UpdateGatewayOptions { - options.BgpAsn = core.Int64Ptr(bgpAsn) - return options +func (_options *UpdateGatewayOptions) SetBgpAsn(bgpAsn int64) *UpdateGatewayOptions { + _options.BgpAsn = core.Int64Ptr(bgpAsn) + return _options } // SetBgpCerCidr : Allow user to set BgpCerCidr -func (options *UpdateGatewayOptions) SetBgpCerCidr(bgpCerCidr string) *UpdateGatewayOptions { - options.BgpCerCidr = core.StringPtr(bgpCerCidr) - return options +func (_options *UpdateGatewayOptions) SetBgpCerCidr(bgpCerCidr string) *UpdateGatewayOptions { + _options.BgpCerCidr = core.StringPtr(bgpCerCidr) + return _options } // SetBgpIbmCidr : Allow user to set BgpIbmCidr -func (options *UpdateGatewayOptions) SetBgpIbmCidr(bgpIbmCidr string) *UpdateGatewayOptions { - options.BgpIbmCidr = core.StringPtr(bgpIbmCidr) - return options +func (_options *UpdateGatewayOptions) SetBgpIbmCidr(bgpIbmCidr string) *UpdateGatewayOptions { + _options.BgpIbmCidr = core.StringPtr(bgpIbmCidr) + return _options } // SetConnectionMode : Allow user to set ConnectionMode -func (options *UpdateGatewayOptions) SetConnectionMode(connectionMode string) *UpdateGatewayOptions { - options.ConnectionMode = core.StringPtr(connectionMode) - return options +func (_options *UpdateGatewayOptions) SetConnectionMode(connectionMode string) *UpdateGatewayOptions { + _options.ConnectionMode = core.StringPtr(connectionMode) + return _options } // SetGlobal : Allow user to set Global -func (options *UpdateGatewayOptions) SetGlobal(global bool) *UpdateGatewayOptions { - options.Global = core.BoolPtr(global) - return options +func (_options *UpdateGatewayOptions) SetGlobal(global bool) *UpdateGatewayOptions { + _options.Global = core.BoolPtr(global) + return _options } // SetLoaRejectReason : Allow user to set LoaRejectReason -func (options *UpdateGatewayOptions) SetLoaRejectReason(loaRejectReason string) *UpdateGatewayOptions { - options.LoaRejectReason = core.StringPtr(loaRejectReason) - return options +func (_options *UpdateGatewayOptions) SetLoaRejectReason(loaRejectReason string) *UpdateGatewayOptions { + _options.LoaRejectReason = core.StringPtr(loaRejectReason) + return _options } // SetMacsecConfig : Allow user to set MacsecConfig -func (options *UpdateGatewayOptions) SetMacsecConfig(macsecConfig *GatewayMacsecConfigPatchTemplate) *UpdateGatewayOptions { - options.MacsecConfig = macsecConfig - return options +func (_options *UpdateGatewayOptions) SetMacsecConfig(macsecConfig *GatewayMacsecConfigPatchTemplate) *UpdateGatewayOptions { + _options.MacsecConfig = macsecConfig + return _options } // SetMetered : Allow user to set Metered -func (options *UpdateGatewayOptions) SetMetered(metered bool) *UpdateGatewayOptions { - options.Metered = core.BoolPtr(metered) - return options +func (_options *UpdateGatewayOptions) SetMetered(metered bool) *UpdateGatewayOptions { + _options.Metered = core.BoolPtr(metered) + return _options } // SetName : Allow user to set Name -func (options *UpdateGatewayOptions) SetName(name string) *UpdateGatewayOptions { - options.Name = core.StringPtr(name) - return options +func (_options *UpdateGatewayOptions) SetName(name string) *UpdateGatewayOptions { + _options.Name = core.StringPtr(name) + return _options } // SetOperationalStatus : Allow user to set OperationalStatus -func (options *UpdateGatewayOptions) SetOperationalStatus(operationalStatus string) *UpdateGatewayOptions { - options.OperationalStatus = core.StringPtr(operationalStatus) - return options +func (_options *UpdateGatewayOptions) SetOperationalStatus(operationalStatus string) *UpdateGatewayOptions { + _options.OperationalStatus = core.StringPtr(operationalStatus) + return _options } // SetPatchPanelCompletionNotice : Allow user to set PatchPanelCompletionNotice -func (options *UpdateGatewayOptions) SetPatchPanelCompletionNotice(patchPanelCompletionNotice string) *UpdateGatewayOptions { - options.PatchPanelCompletionNotice = core.StringPtr(patchPanelCompletionNotice) - return options +func (_options *UpdateGatewayOptions) SetPatchPanelCompletionNotice(patchPanelCompletionNotice string) *UpdateGatewayOptions { + _options.PatchPanelCompletionNotice = core.StringPtr(patchPanelCompletionNotice) + return _options } // SetSpeedMbps : Allow user to set SpeedMbps -func (options *UpdateGatewayOptions) SetSpeedMbps(speedMbps int64) *UpdateGatewayOptions { - options.SpeedMbps = core.Int64Ptr(speedMbps) - return options +func (_options *UpdateGatewayOptions) SetSpeedMbps(speedMbps int64) *UpdateGatewayOptions { + _options.SpeedMbps = core.Int64Ptr(speedMbps) + return _options } // SetHeaders : Allow user to set Headers @@ -4688,19 +4722,19 @@ func (options *UpdateGatewayOptions) SetHeaders(param map[string]string) *Update // UpdateGatewayVirtualConnectionOptions : The UpdateGatewayVirtualConnection options. type UpdateGatewayVirtualConnectionOptions struct { // Direct Link gateway identifier. - GatewayID *string `validate:"required,ne="` + GatewayID *string `json:"gateway_id" validate:"required,ne="` // The virtual connection identifier. - ID *string `validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // The user-defined name for this virtual connection. Virtual connection names are unique within a gateway. This is // the name of the virtual connection itself, the network being connected may have its own name attribute. - Name *string + Name *string `json:"name,omitempty"` // Status of the virtual connection. Virtual connections that span IBM Cloud Accounts are created in approval_pending // status. The owner of the target network can accept or reject connection requests by patching status to attached or // rejected respectively. - Status *string + Status *string `json:"status,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -4724,27 +4758,27 @@ func (*DirectLinkV1) NewUpdateGatewayVirtualConnectionOptions(gatewayID string, } // SetGatewayID : Allow user to set GatewayID -func (options *UpdateGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *UpdateGatewayVirtualConnectionOptions { - options.GatewayID = core.StringPtr(gatewayID) - return options +func (_options *UpdateGatewayVirtualConnectionOptions) SetGatewayID(gatewayID string) *UpdateGatewayVirtualConnectionOptions { + _options.GatewayID = core.StringPtr(gatewayID) + return _options } // SetID : Allow user to set ID -func (options *UpdateGatewayVirtualConnectionOptions) SetID(id string) *UpdateGatewayVirtualConnectionOptions { - options.ID = core.StringPtr(id) - return options +func (_options *UpdateGatewayVirtualConnectionOptions) SetID(id string) *UpdateGatewayVirtualConnectionOptions { + _options.ID = core.StringPtr(id) + return _options } // SetName : Allow user to set Name -func (options *UpdateGatewayVirtualConnectionOptions) SetName(name string) *UpdateGatewayVirtualConnectionOptions { - options.Name = core.StringPtr(name) - return options +func (_options *UpdateGatewayVirtualConnectionOptions) SetName(name string) *UpdateGatewayVirtualConnectionOptions { + _options.Name = core.StringPtr(name) + return _options } // SetStatus : Allow user to set Status -func (options *UpdateGatewayVirtualConnectionOptions) SetStatus(status string) *UpdateGatewayVirtualConnectionOptions { - options.Status = core.StringPtr(status) - return options +func (_options *UpdateGatewayVirtualConnectionOptions) SetStatus(status string) *UpdateGatewayVirtualConnectionOptions { + _options.Status = core.StringPtr(status) + return _options } // SetHeaders : Allow user to set Headers @@ -4840,6 +4874,30 @@ func UnmarshalGatewayActionTemplateUpdatesItemGatewayClientSpeedUpdate(m map[str return } +// GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate : Update VLAN for this gateway +// +// VLAN provided should be in the range 1 to 4094. +// This model "extends" GatewayActionTemplateUpdatesItem +type GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate struct { + // VLAN to be updated for this gateway. + Vlan *int64 `json:"vlan,omitempty"` +} + +func (*GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate) isaGatewayActionTemplateUpdatesItem() bool { + return true +} + +// UnmarshalGatewayActionTemplateUpdatesItemGatewayClientVLANUpdate unmarshals an instance of GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate from the specified map of raw messages. +func UnmarshalGatewayActionTemplateUpdatesItemGatewayClientVLANUpdate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GatewayActionTemplateUpdatesItemGatewayClientVLANUpdate) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientBGPASNUpdate : The autonomous system number (ASN) of Border Gateway Protocol // (BGP) configuration for the IBM side of the DL 2.0 gateway. // This model "extends" GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem @@ -4927,6 +4985,30 @@ func UnmarshalGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesIte return } +// GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate : Update VLAN for this gateway +// +// VLAN provided should be in the range 1 to 4094. +// This model "extends" GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem +type GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate struct { + // VLAN to be updated for this gateway. + Vlan *int64 `json:"vlan,omitempty"` +} + +func (*GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate) isaGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItem() bool { + return true +} + +// UnmarshalGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate unmarshals an instance of GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate from the specified map of raw messages. +func UnmarshalGatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GatewayChangeRequestGatewayClientGatewayUpdateAttributesUpdatesItemGatewayClientVLANUpdate) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // GatewayChangeRequestUpdatesItemGatewayClientBGPASNUpdate : The autonomous system number (ASN) of Border Gateway Protocol // (BGP) configuration for the IBM side of the DL 2.0 gateway. // This model "extends" GatewayChangeRequestUpdatesItem @@ -5014,6 +5096,30 @@ func UnmarshalGatewayChangeRequestUpdatesItemGatewayClientSpeedUpdate(m map[stri return } +// GatewayChangeRequestUpdatesItemGatewayClientVLANUpdate : Update VLAN for this gateway +// +// VLAN provided should be in the range 1 to 4094. +// This model "extends" GatewayChangeRequestUpdatesItem +type GatewayChangeRequestUpdatesItemGatewayClientVLANUpdate struct { + // VLAN to be updated for this gateway. + Vlan *int64 `json:"vlan,omitempty"` +} + +func (*GatewayChangeRequestUpdatesItemGatewayClientVLANUpdate) isaGatewayChangeRequestUpdatesItem() bool { + return true +} + +// UnmarshalGatewayChangeRequestUpdatesItemGatewayClientVLANUpdate unmarshals an instance of GatewayChangeRequestUpdatesItemGatewayClientVLANUpdate from the specified map of raw messages. +func UnmarshalGatewayChangeRequestUpdatesItemGatewayClientVLANUpdate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GatewayChangeRequestUpdatesItemGatewayClientVLANUpdate) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // GatewayChangeRequestGatewayClientGatewayCreate : gateway create. // This model "extends" GatewayChangeRequest type GatewayChangeRequestGatewayClientGatewayCreate struct { @@ -5341,8 +5447,8 @@ const ( ) // NewGatewayTemplateGatewayTypeConnectTemplate : Instantiate GatewayTemplateGatewayTypeConnectTemplate (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayTemplateGatewayTypeConnectTemplate(bgpAsn int64, global bool, metered bool, name string, speedMbps int64, typeVar string, port *GatewayPortIdentity) (model *GatewayTemplateGatewayTypeConnectTemplate, err error) { - model = &GatewayTemplateGatewayTypeConnectTemplate{ +func (*DirectLinkV1) NewGatewayTemplateGatewayTypeConnectTemplate(bgpAsn int64, global bool, metered bool, name string, speedMbps int64, typeVar string, port *GatewayPortIdentity) (_model *GatewayTemplateGatewayTypeConnectTemplate, err error) { + _model = &GatewayTemplateGatewayTypeConnectTemplate{ BgpAsn: core.Int64Ptr(bgpAsn), Global: core.BoolPtr(global), Metered: core.BoolPtr(metered), @@ -5351,7 +5457,7 @@ func (*DirectLinkV1) NewGatewayTemplateGatewayTypeConnectTemplate(bgpAsn int64, Type: core.StringPtr(typeVar), Port: port, } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } @@ -5523,8 +5629,8 @@ const ( ) // NewGatewayTemplateGatewayTypeDedicatedTemplate : Instantiate GatewayTemplateGatewayTypeDedicatedTemplate (Generic Model Constructor) -func (*DirectLinkV1) NewGatewayTemplateGatewayTypeDedicatedTemplate(bgpAsn int64, global bool, metered bool, name string, speedMbps int64, typeVar string, carrierName string, crossConnectRouter string, customerName string, locationName string) (model *GatewayTemplateGatewayTypeDedicatedTemplate, err error) { - model = &GatewayTemplateGatewayTypeDedicatedTemplate{ +func (*DirectLinkV1) NewGatewayTemplateGatewayTypeDedicatedTemplate(bgpAsn int64, global bool, metered bool, name string, speedMbps int64, typeVar string, carrierName string, crossConnectRouter string, customerName string, locationName string) (_model *GatewayTemplateGatewayTypeDedicatedTemplate, err error) { + _model = &GatewayTemplateGatewayTypeDedicatedTemplate{ BgpAsn: core.Int64Ptr(bgpAsn), Global: core.BoolPtr(global), Metered: core.BoolPtr(metered), @@ -5536,7 +5642,7 @@ func (*DirectLinkV1) NewGatewayTemplateGatewayTypeDedicatedTemplate(bgpAsn int64 CustomerName: core.StringPtr(customerName), LocationName: core.StringPtr(locationName), } - err = core.ValidateStruct(model, "required parameters") + err = core.ValidateStruct(_model, "required parameters") return } diff --git a/ibm/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go b/ibm/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go index f03d50545c..cc7362cf40 100644 --- a/ibm/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go +++ b/ibm/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.40.0-910cf8c2-20211006-154754 + * IBM OpenAPI SDK Code Generator Version: 3.41.1-790c0dfc-20211021-231519 */ // Package transitgatewayapisv1 : Operations and models for the TransitGatewayApisV1 service @@ -238,6 +238,246 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c return } +// ListTransitGatewayRouteReports : List route reports +// Retrieve all route reports for the specified Transit Gateway. There will normally be at most one completed report +// and one pending report. Additionally, completed route reports are written to IBM Cloud Activity Tracker. +func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReports(listTransitGatewayRouteReportsOptions *ListTransitGatewayRouteReportsOptions) (result *RouteReportCollection, response *core.DetailedResponse, err error) { + return transitGatewayApis.ListTransitGatewayRouteReportsWithContext(context.Background(), listTransitGatewayRouteReportsOptions) +} + +// ListTransitGatewayRouteReportsWithContext is an alternate form of the ListTransitGatewayRouteReports method which supports a Context parameter +func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWithContext(ctx context.Context, listTransitGatewayRouteReportsOptions *ListTransitGatewayRouteReportsOptions) (result *RouteReportCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listTransitGatewayRouteReportsOptions, "listTransitGatewayRouteReportsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listTransitGatewayRouteReportsOptions, "listTransitGatewayRouteReportsOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "transit_gateway_id": *listTransitGatewayRouteReportsOptions.TransitGatewayID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range listTransitGatewayRouteReportsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayRouteReports") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*transitGatewayApis.Version)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = transitGatewayApis.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReportCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateTransitGatewayRouteReport : Request a route report +// Request route report generation. While report generation is in progress, additional requests to generate a report +// are ignored and return the current pending report. +func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReport(createTransitGatewayRouteReportOptions *CreateTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { + return transitGatewayApis.CreateTransitGatewayRouteReportWithContext(context.Background(), createTransitGatewayRouteReportOptions) +} + +// CreateTransitGatewayRouteReportWithContext is an alternate form of the CreateTransitGatewayRouteReport method which supports a Context parameter +func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportWithContext(ctx context.Context, createTransitGatewayRouteReportOptions *CreateTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createTransitGatewayRouteReportOptions, "createTransitGatewayRouteReportOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createTransitGatewayRouteReportOptions, "createTransitGatewayRouteReportOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "transit_gateway_id": *createTransitGatewayRouteReportOptions.TransitGatewayID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range createTransitGatewayRouteReportOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*transitGatewayApis.Version)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = transitGatewayApis.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReport) + if err != nil { + return + } + response.Result = result + } + + return +} + +// DeleteTransitGatewayRouteReport : Delete route report +// Delete a route report. +func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReport(deleteTransitGatewayRouteReportOptions *DeleteTransitGatewayRouteReportOptions) (response *core.DetailedResponse, err error) { + return transitGatewayApis.DeleteTransitGatewayRouteReportWithContext(context.Background(), deleteTransitGatewayRouteReportOptions) +} + +// DeleteTransitGatewayRouteReportWithContext is an alternate form of the DeleteTransitGatewayRouteReport method which supports a Context parameter +func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportWithContext(ctx context.Context, deleteTransitGatewayRouteReportOptions *DeleteTransitGatewayRouteReportOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteTransitGatewayRouteReportOptions, "deleteTransitGatewayRouteReportOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteTransitGatewayRouteReportOptions, "deleteTransitGatewayRouteReportOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "transit_gateway_id": *deleteTransitGatewayRouteReportOptions.TransitGatewayID, + "id": *deleteTransitGatewayRouteReportOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteTransitGatewayRouteReportOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*transitGatewayApis.Version)) + + request, err := builder.Build() + if err != nil { + return + } + + response, err = transitGatewayApis.Service.Request(request, nil) + + return +} + +// GetTransitGatewayRouteReport : Retrieve route report +// Retrieve a route report. +func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReport(getTransitGatewayRouteReportOptions *GetTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { + return transitGatewayApis.GetTransitGatewayRouteReportWithContext(context.Background(), getTransitGatewayRouteReportOptions) +} + +// GetTransitGatewayRouteReportWithContext is an alternate form of the GetTransitGatewayRouteReport method which supports a Context parameter +func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWithContext(ctx context.Context, getTransitGatewayRouteReportOptions *GetTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getTransitGatewayRouteReportOptions, "getTransitGatewayRouteReportOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getTransitGatewayRouteReportOptions, "getTransitGatewayRouteReportOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "transit_gateway_id": *getTransitGatewayRouteReportOptions.TransitGatewayID, + "id": *getTransitGatewayRouteReportOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getTransitGatewayRouteReportOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*transitGatewayApis.Version)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = transitGatewayApis.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReport) + if err != nil { + return + } + response.Result = result + } + + return +} + // ListTransitGateways : Retrieves all Transit Gateways // List all Transit Gateways in account the caller is authorized to view. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGateways(listTransitGatewaysOptions *ListTransitGatewaysOptions) (result *TransitGatewayCollection, response *core.DetailedResponse, err error) { @@ -747,7 +987,7 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi pathParamsMap := map[string]string{ "transit_gateway_id": *deleteTransitGatewayConnectionOptions.TransitGatewayID, - "id": *deleteTransitGatewayConnectionOptions.ID, + "id": *deleteTransitGatewayConnectionOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) @@ -798,7 +1038,7 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC pathParamsMap := map[string]string{ "transit_gateway_id": *getTransitGatewayConnectionOptions.TransitGatewayID, - "id": *getTransitGatewayConnectionOptions.ID, + "id": *getTransitGatewayConnectionOptions.ID, } builder := core.NewRequestBuilder(core.GET) @@ -861,7 +1101,7 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi pathParamsMap := map[string]string{ "transit_gateway_id": *updateTransitGatewayConnectionOptions.TransitGatewayID, - "id": *updateTransitGatewayConnectionOptions.ID, + "id": *updateTransitGatewayConnectionOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) @@ -934,7 +1174,7 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc pathParamsMap := map[string]string{ "transit_gateway_id": *createTransitGatewayConnectionActionsOptions.TransitGatewayID, - "id": *createTransitGatewayConnectionActionsOptions.ID, + "id": *createTransitGatewayConnectionActionsOptions.ID, } builder := core.NewRequestBuilder(core.POST) @@ -1111,15 +1351,15 @@ type CreateTransitGatewayConnectionActionsOptions struct { // The action that is to be performed against the connection request. const ( CreateTransitGatewayConnectionActionsOptions_Action_Approve = "approve" - CreateTransitGatewayConnectionActionsOptions_Action_Reject = "reject" + CreateTransitGatewayConnectionActionsOptions_Action_Reject = "reject" ) // NewCreateTransitGatewayConnectionActionsOptions : Instantiate CreateTransitGatewayConnectionActionsOptions func (*TransitGatewayApisV1) NewCreateTransitGatewayConnectionActionsOptions(transitGatewayID string, id string, action string) *CreateTransitGatewayConnectionActionsOptions { return &CreateTransitGatewayConnectionActionsOptions{ TransitGatewayID: core.StringPtr(transitGatewayID), - ID: core.StringPtr(id), - Action: core.StringPtr(action), + ID: core.StringPtr(id), + Action: core.StringPtr(action), } } @@ -1210,17 +1450,17 @@ type CreateTransitGatewayConnectionOptions struct { // Defines what type of network is connected via this connection. For access to gre_tunnel connections contact IBM // support. const ( - CreateTransitGatewayConnectionOptions_NetworkType_Classic = "classic" + CreateTransitGatewayConnectionOptions_NetworkType_Classic = "classic" CreateTransitGatewayConnectionOptions_NetworkType_Directlink = "directlink" - CreateTransitGatewayConnectionOptions_NetworkType_GreTunnel = "gre_tunnel" - CreateTransitGatewayConnectionOptions_NetworkType_Vpc = "vpc" + CreateTransitGatewayConnectionOptions_NetworkType_GreTunnel = "gre_tunnel" + CreateTransitGatewayConnectionOptions_NetworkType_Vpc = "vpc" ) // NewCreateTransitGatewayConnectionOptions : Instantiate CreateTransitGatewayConnectionOptions func (*TransitGatewayApisV1) NewCreateTransitGatewayConnectionOptions(transitGatewayID string, networkType string) *CreateTransitGatewayConnectionOptions { return &CreateTransitGatewayConnectionOptions{ TransitGatewayID: core.StringPtr(transitGatewayID), - NetworkType: core.StringPtr(networkType), + NetworkType: core.StringPtr(networkType), } } @@ -1325,7 +1565,7 @@ type CreateTransitGatewayOptions struct { func (*TransitGatewayApisV1) NewCreateTransitGatewayOptions(location string, name string) *CreateTransitGatewayOptions { return &CreateTransitGatewayOptions{ Location: core.StringPtr(location), - Name: core.StringPtr(name), + Name: core.StringPtr(name), } } @@ -1359,6 +1599,34 @@ func (options *CreateTransitGatewayOptions) SetHeaders(param map[string]string) return options } +// CreateTransitGatewayRouteReportOptions : The CreateTransitGatewayRouteReport options. +type CreateTransitGatewayRouteReportOptions struct { + // The Transit Gateway identifier. + TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateTransitGatewayRouteReportOptions : Instantiate CreateTransitGatewayRouteReportOptions +func (*TransitGatewayApisV1) NewCreateTransitGatewayRouteReportOptions(transitGatewayID string) *CreateTransitGatewayRouteReportOptions { + return &CreateTransitGatewayRouteReportOptions{ + TransitGatewayID: core.StringPtr(transitGatewayID), + } +} + +// SetTransitGatewayID : Allow user to set TransitGatewayID +func (_options *CreateTransitGatewayRouteReportOptions) SetTransitGatewayID(transitGatewayID string) *CreateTransitGatewayRouteReportOptions { + _options.TransitGatewayID = core.StringPtr(transitGatewayID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateTransitGatewayRouteReportOptions) SetHeaders(param map[string]string) *CreateTransitGatewayRouteReportOptions { + options.Headers = param + return options +} + // DeleteTransitGatewayConnectionOptions : The DeleteTransitGatewayConnection options. type DeleteTransitGatewayConnectionOptions struct { // The Transit Gateway identifier. @@ -1375,7 +1643,7 @@ type DeleteTransitGatewayConnectionOptions struct { func (*TransitGatewayApisV1) NewDeleteTransitGatewayConnectionOptions(transitGatewayID string, id string) *DeleteTransitGatewayConnectionOptions { return &DeleteTransitGatewayConnectionOptions{ TransitGatewayID: core.StringPtr(transitGatewayID), - ID: core.StringPtr(id), + ID: core.StringPtr(id), } } @@ -1425,6 +1693,44 @@ func (options *DeleteTransitGatewayOptions) SetHeaders(param map[string]string) return options } +// DeleteTransitGatewayRouteReportOptions : The DeleteTransitGatewayRouteReport options. +type DeleteTransitGatewayRouteReportOptions struct { + // The Transit Gateway identifier. + TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` + + // Route report identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteTransitGatewayRouteReportOptions : Instantiate DeleteTransitGatewayRouteReportOptions +func (*TransitGatewayApisV1) NewDeleteTransitGatewayRouteReportOptions(transitGatewayID string, id string) *DeleteTransitGatewayRouteReportOptions { + return &DeleteTransitGatewayRouteReportOptions{ + TransitGatewayID: core.StringPtr(transitGatewayID), + ID: core.StringPtr(id), + } +} + +// SetTransitGatewayID : Allow user to set TransitGatewayID +func (_options *DeleteTransitGatewayRouteReportOptions) SetTransitGatewayID(transitGatewayID string) *DeleteTransitGatewayRouteReportOptions { + _options.TransitGatewayID = core.StringPtr(transitGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteTransitGatewayRouteReportOptions) SetID(id string) *DeleteTransitGatewayRouteReportOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteTransitGatewayRouteReportOptions) SetHeaders(param map[string]string) *DeleteTransitGatewayRouteReportOptions { + options.Headers = param + return options +} + // GetGatewayLocationOptions : The GetGatewayLocation options. type GetGatewayLocationOptions struct { // The Transit Gateway location Name. @@ -1469,7 +1775,7 @@ type GetTransitGatewayConnectionOptions struct { func (*TransitGatewayApisV1) NewGetTransitGatewayConnectionOptions(transitGatewayID string, id string) *GetTransitGatewayConnectionOptions { return &GetTransitGatewayConnectionOptions{ TransitGatewayID: core.StringPtr(transitGatewayID), - ID: core.StringPtr(id), + ID: core.StringPtr(id), } } @@ -1519,6 +1825,44 @@ func (options *GetTransitGatewayOptions) SetHeaders(param map[string]string) *Ge return options } +// GetTransitGatewayRouteReportOptions : The GetTransitGatewayRouteReport options. +type GetTransitGatewayRouteReportOptions struct { + // The Transit Gateway identifier. + TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` + + // Route report identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetTransitGatewayRouteReportOptions : Instantiate GetTransitGatewayRouteReportOptions +func (*TransitGatewayApisV1) NewGetTransitGatewayRouteReportOptions(transitGatewayID string, id string) *GetTransitGatewayRouteReportOptions { + return &GetTransitGatewayRouteReportOptions{ + TransitGatewayID: core.StringPtr(transitGatewayID), + ID: core.StringPtr(id), + } +} + +// SetTransitGatewayID : Allow user to set TransitGatewayID +func (_options *GetTransitGatewayRouteReportOptions) SetTransitGatewayID(transitGatewayID string) *GetTransitGatewayRouteReportOptions { + _options.TransitGatewayID = core.StringPtr(transitGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetTransitGatewayRouteReportOptions) SetID(id string) *GetTransitGatewayRouteReportOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetTransitGatewayRouteReportOptions) SetHeaders(param map[string]string) *GetTransitGatewayRouteReportOptions { + options.Headers = param + return options +} + // ListConnectionsOptions : The ListConnections options. type ListConnectionsOptions struct { // The maximum number of resources to return per page. @@ -1609,6 +1953,34 @@ func (options *ListTransitGatewayConnectionsOptions) SetHeaders(param map[string return options } +// ListTransitGatewayRouteReportsOptions : The ListTransitGatewayRouteReports options. +type ListTransitGatewayRouteReportsOptions struct { + // The Transit Gateway identifier. + TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListTransitGatewayRouteReportsOptions : Instantiate ListTransitGatewayRouteReportsOptions +func (*TransitGatewayApisV1) NewListTransitGatewayRouteReportsOptions(transitGatewayID string) *ListTransitGatewayRouteReportsOptions { + return &ListTransitGatewayRouteReportsOptions{ + TransitGatewayID: core.StringPtr(transitGatewayID), + } +} + +// SetTransitGatewayID : Allow user to set TransitGatewayID +func (_options *ListTransitGatewayRouteReportsOptions) SetTransitGatewayID(transitGatewayID string) *ListTransitGatewayRouteReportsOptions { + _options.TransitGatewayID = core.StringPtr(transitGatewayID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListTransitGatewayRouteReportsOptions) SetHeaders(param map[string]string) *ListTransitGatewayRouteReportsOptions { + options.Headers = param + return options +} + // ListTransitGatewaysOptions : The ListTransitGateways options. type ListTransitGatewaysOptions struct { // The maximum number of resources to return per page. @@ -1696,6 +2068,225 @@ func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interf return } +// RouteReport : route report. +type RouteReport struct { + // Array of connections with their routes. + Connections []RouteReportConnection `json:"connections" validate:"required"` + + // Date and time route report was requested. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // Report identifier. + ID *string `json:"id" validate:"required"` + + // Array of overlapping routes. + OverlappingRoutes []RouteReportOverlappingRouteGroup `json:"overlapping_routes" validate:"required"` + + // Route report status. The list of enumerated values for this property may expand in the future. Code and processes + // using this field must tolerate unexpected values. + Status *string `json:"status" validate:"required"` + + // Date and time route report was last modified. + UpdatedAt *strfmt.DateTime `json:"updated_at,omitempty"` +} + +// Constants associated with the RouteReport.Status property. +// Route report status. The list of enumerated values for this property may expand in the future. Code and processes +// using this field must tolerate unexpected values. +const ( + RouteReport_Status_Complete = "complete" + RouteReport_Status_Pending = "pending" +) + +// UnmarshalRouteReport unmarshals an instance of RouteReport from the specified map of raw messages. +func UnmarshalRouteReport(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReport) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalRouteReportConnection) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "overlapping_routes", &obj.OverlappingRoutes, UnmarshalRouteReportOverlappingRouteGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteReportCollection : route reports. +type RouteReportCollection struct { + // Array of route reports. + RouteReports []RouteReport `json:"route_reports" validate:"required"` +} + +// UnmarshalRouteReportCollection unmarshals an instance of RouteReportCollection from the specified map of raw messages. +func UnmarshalRouteReportCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReportCollection) + err = core.UnmarshalModel(m, "route_reports", &obj.RouteReports, UnmarshalRouteReport) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteReportConnection : route report connection. +type RouteReportConnection struct { + // Array of connection's bgps. + Bgps []RouteReportConnectionBgp `json:"bgps,omitempty"` + + // connection ID. + ID *string `json:"id,omitempty"` + + // connection name. + Name *string `json:"name,omitempty"` + + // Array of connection's routes. + Routes []RouteReportConnectionRoute `json:"routes,omitempty"` + + // connection type. + Type *string `json:"type,omitempty"` +} + +// UnmarshalRouteReportConnection unmarshals an instance of RouteReportConnection from the specified map of raw messages. +func UnmarshalRouteReportConnection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReportConnection) + err = core.UnmarshalModel(m, "bgps", &obj.Bgps, UnmarshalRouteReportConnectionBgp) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReportConnectionRoute) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteReportConnectionBgp : connection bgp details. +type RouteReportConnectionBgp struct { + // AS path. + AsPath *string `json:"as_path,omitempty"` + + // Indicates whether current route is used or not. + IsUsed *bool `json:"is_used,omitempty"` + + // local preference. + LocalPreference *string `json:"local_preference,omitempty"` + + // prefix. + Prefix *string `json:"prefix,omitempty"` +} + +// UnmarshalRouteReportConnectionBgp unmarshals an instance of RouteReportConnectionBgp from the specified map of raw messages. +func UnmarshalRouteReportConnectionBgp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReportConnectionBgp) + err = core.UnmarshalPrimitive(m, "as_path", &obj.AsPath) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "is_used", &obj.IsUsed) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "local_preference", &obj.LocalPreference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteReportConnectionRoute : connection used route. +type RouteReportConnectionRoute struct { + // prefix. + Prefix *string `json:"prefix,omitempty"` +} + +// UnmarshalRouteReportConnectionRoute unmarshals an instance of RouteReportConnectionRoute from the specified map of raw messages. +func UnmarshalRouteReportConnectionRoute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReportConnectionRoute) + err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteReportOverlappingRoute : overlapping route details. +type RouteReportOverlappingRoute struct { + // connection ID. + ConnectionID *string `json:"connection_id,omitempty"` + + // overlapping prefix. + Prefix *string `json:"prefix,omitempty"` +} + +// UnmarshalRouteReportOverlappingRoute unmarshals an instance of RouteReportOverlappingRoute from the specified map of raw messages. +func UnmarshalRouteReportOverlappingRoute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReportOverlappingRoute) + err = core.UnmarshalPrimitive(m, "connection_id", &obj.ConnectionID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteReportOverlappingRouteGroup : Collection of overlapping route. +type RouteReportOverlappingRouteGroup struct { + // Array of overlapping connection/prefix pairs. + Routes []RouteReportOverlappingRoute `json:"routes,omitempty"` +} + +// UnmarshalRouteReportOverlappingRouteGroup unmarshals an instance of RouteReportOverlappingRouteGroup from the specified map of raw messages. +func UnmarshalRouteReportOverlappingRouteGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReportOverlappingRouteGroup) + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReportOverlappingRoute) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TSCollection : A list of Transit Gateway locations. type TSCollection struct { // Collection of Transit Gateway locations. @@ -1897,10 +2488,10 @@ type TransitConnection struct { // Defines what type of network is connected via this connection. The list of enumerated values for this property may // expand in the future. Code and processes using this field must tolerate unexpected values. const ( - TransitConnection_NetworkType_Classic = "classic" + TransitConnection_NetworkType_Classic = "classic" TransitConnection_NetworkType_Directlink = "directlink" - TransitConnection_NetworkType_GreTunnel = "gre_tunnel" - TransitConnection_NetworkType_Vpc = "vpc" + TransitConnection_NetworkType_GreTunnel = "gre_tunnel" + TransitConnection_NetworkType_Vpc = "vpc" ) // Constants associated with the TransitConnection.RequestStatus property. @@ -1910,8 +2501,8 @@ const ( const ( TransitConnection_RequestStatus_Approved = "approved" TransitConnection_RequestStatus_Detached = "detached" - TransitConnection_RequestStatus_Expired = "expired" - TransitConnection_RequestStatus_Pending = "pending" + TransitConnection_RequestStatus_Expired = "expired" + TransitConnection_RequestStatus_Pending = "pending" TransitConnection_RequestStatus_Rejected = "rejected" ) @@ -1919,12 +2510,12 @@ const ( // Connection state. The list of enumerated values for this property may expand in the future. Code and processes using // this field must tolerate unexpected values. const ( - TransitConnection_Status_Attached = "attached" - TransitConnection_Status_Deleting = "deleting" - TransitConnection_Status_Detached = "detached" + TransitConnection_Status_Attached = "attached" + TransitConnection_Status_Deleting = "deleting" + TransitConnection_Status_Detached = "detached" TransitConnection_Status_Detaching = "detaching" - TransitConnection_Status_Failed = "failed" - TransitConnection_Status_Pending = "pending" + TransitConnection_Status_Failed = "failed" + TransitConnection_Status_Pending = "pending" ) // UnmarshalTransitConnection unmarshals an instance of TransitConnection from the specified map of raw messages. @@ -2134,9 +2725,9 @@ type TransitGateway struct { // processes using this field must tolerate unexpected values. const ( TransitGateway_Status_Available = "available" - TransitGateway_Status_Deleting = "deleting" - TransitGateway_Status_Failed = "failed" - TransitGateway_Status_Pending = "pending" + TransitGateway_Status_Deleting = "deleting" + TransitGateway_Status_Failed = "failed" + TransitGateway_Status_Pending = "pending" ) // UnmarshalTransitGateway unmarshals an instance of TransitGateway from the specified map of raw messages. @@ -2357,10 +2948,10 @@ type TransitGatewayConnectionCust struct { // Defines what type of network is connected via this connection. The list of enumerated values for this property may // expand in the future. Code and processes using this field must tolerate unexpected values. const ( - TransitGatewayConnectionCust_NetworkType_Classic = "classic" + TransitGatewayConnectionCust_NetworkType_Classic = "classic" TransitGatewayConnectionCust_NetworkType_Directlink = "directlink" - TransitGatewayConnectionCust_NetworkType_GreTunnel = "gre_tunnel" - TransitGatewayConnectionCust_NetworkType_Vpc = "vpc" + TransitGatewayConnectionCust_NetworkType_GreTunnel = "gre_tunnel" + TransitGatewayConnectionCust_NetworkType_Vpc = "vpc" ) // Constants associated with the TransitGatewayConnectionCust.RequestStatus property. @@ -2370,8 +2961,8 @@ const ( const ( TransitGatewayConnectionCust_RequestStatus_Approved = "approved" TransitGatewayConnectionCust_RequestStatus_Detached = "detached" - TransitGatewayConnectionCust_RequestStatus_Expired = "expired" - TransitGatewayConnectionCust_RequestStatus_Pending = "pending" + TransitGatewayConnectionCust_RequestStatus_Expired = "expired" + TransitGatewayConnectionCust_RequestStatus_Pending = "pending" TransitGatewayConnectionCust_RequestStatus_Rejected = "rejected" ) @@ -2379,12 +2970,12 @@ const ( // Connection's current configuration state. The list of enumerated values for this property may expand in the future. // Code and processes using this field must tolerate unexpected values. const ( - TransitGatewayConnectionCust_Status_Attached = "attached" - TransitGatewayConnectionCust_Status_Deleting = "deleting" - TransitGatewayConnectionCust_Status_Detached = "detached" + TransitGatewayConnectionCust_Status_Attached = "attached" + TransitGatewayConnectionCust_Status_Deleting = "deleting" + TransitGatewayConnectionCust_Status_Detached = "detached" TransitGatewayConnectionCust_Status_Detaching = "detaching" - TransitGatewayConnectionCust_Status_Failed = "failed" - TransitGatewayConnectionCust_Status_Pending = "pending" + TransitGatewayConnectionCust_Status_Failed = "failed" + TransitGatewayConnectionCust_Status_Pending = "pending" ) // UnmarshalTransitGatewayConnectionCust unmarshals an instance of TransitGatewayConnectionCust from the specified map of raw messages. @@ -2535,7 +3126,7 @@ type UpdateTransitGatewayConnectionOptions struct { func (*TransitGatewayApisV1) NewUpdateTransitGatewayConnectionOptions(transitGatewayID string, id string) *UpdateTransitGatewayConnectionOptions { return &UpdateTransitGatewayConnectionOptions{ TransitGatewayID: core.StringPtr(transitGatewayID), - ID: core.StringPtr(id), + ID: core.StringPtr(id), } } @@ -2616,6 +3207,7 @@ type ZoneIdentity struct { // Availability zone name. Name *string `json:"name,omitempty"` } + func (*ZoneIdentity) isaZoneIdentity() bool { return true } diff --git a/ibm/vendor/github.com/IBM/networking-go-sdk/webhooksv1/webhooks_v1.go b/ibm/vendor/github.com/IBM/networking-go-sdk/webhooksv1/webhooks_v1.go new file mode 100644 index 0000000000..125649d2f7 --- /dev/null +++ b/ibm/vendor/github.com/IBM/networking-go-sdk/webhooksv1/webhooks_v1.go @@ -0,0 +1,921 @@ +/** + * (C) Copyright IBM Corp. 2021. + * + * 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. + */ + +/* + * IBM OpenAPI SDK Code Generator Version: 3.43.0-49eab5c7-20211117-152138 + */ + +// Package webhooksv1 : Operations and models for the WebhooksV1 service +package webhooksv1 + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "reflect" + "time" + + "github.com/IBM/go-sdk-core/v5/core" + common "github.com/IBM/networking-go-sdk/common" +) + +// WebhooksV1 : CIS Alert Webhooks +// +// API Version: 1.0.0 +type WebhooksV1 struct { + Service *core.BaseService + + // Full url-encoded CRN of the service instance. + Crn *string +} + +// DefaultServiceURL is the default URL to make service requests to. +const DefaultServiceURL = "https://api.cis.cloud.ibm.com" + +// DefaultServiceName is the default key used to find external configuration information. +const DefaultServiceName = "webhooks" + +// WebhooksV1Options : Service options +type WebhooksV1Options struct { + ServiceName string + URL string + Authenticator core.Authenticator + + // Full url-encoded CRN of the service instance. + Crn *string `validate:"required"` +} + +// NewWebhooksV1UsingExternalConfig : constructs an instance of WebhooksV1 with passed in options and external configuration. +func NewWebhooksV1UsingExternalConfig(options *WebhooksV1Options) (webhooks *WebhooksV1, err error) { + if options.ServiceName == "" { + options.ServiceName = DefaultServiceName + } + + if options.Authenticator == nil { + options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) + if err != nil { + return + } + } + + webhooks, err = NewWebhooksV1(options) + if err != nil { + return + } + + err = webhooks.Service.ConfigureService(options.ServiceName) + if err != nil { + return + } + + if options.URL != "" { + err = webhooks.Service.SetServiceURL(options.URL) + } + return +} + +// NewWebhooksV1 : constructs an instance of WebhooksV1 with passed in options. +func NewWebhooksV1(options *WebhooksV1Options) (service *WebhooksV1, err error) { + serviceOptions := &core.ServiceOptions{ + URL: DefaultServiceURL, + Authenticator: options.Authenticator, + } + + err = core.ValidateStruct(options, "options") + if err != nil { + return + } + + baseService, err := core.NewBaseService(serviceOptions) + if err != nil { + return + } + + if options.URL != "" { + err = baseService.SetServiceURL(options.URL) + if err != nil { + return + } + } + + service = &WebhooksV1{ + Service: baseService, + Crn: options.Crn, + } + + return +} + +// GetServiceURLForRegion returns the service URL to be used for the specified region +func GetServiceURLForRegion(region string) (string, error) { + return "", fmt.Errorf("service does not support regional URLs") +} + +// Clone makes a copy of "webhooks" suitable for processing requests. +func (webhooks *WebhooksV1) Clone() *WebhooksV1 { + if core.IsNil(webhooks) { + return nil + } + clone := *webhooks + clone.Service = webhooks.Service.Clone() + return &clone +} + +// SetServiceURL sets the service URL +func (webhooks *WebhooksV1) SetServiceURL(url string) error { + return webhooks.Service.SetServiceURL(url) +} + +// GetServiceURL returns the service URL +func (webhooks *WebhooksV1) GetServiceURL() string { + return webhooks.Service.GetServiceURL() +} + +// SetDefaultHeaders sets HTTP headers to be sent in every request +func (webhooks *WebhooksV1) SetDefaultHeaders(headers http.Header) { + webhooks.Service.SetDefaultHeaders(headers) +} + +// SetEnableGzipCompression sets the service's EnableGzipCompression field +func (webhooks *WebhooksV1) SetEnableGzipCompression(enableGzip bool) { + webhooks.Service.SetEnableGzipCompression(enableGzip) +} + +// GetEnableGzipCompression returns the service's EnableGzipCompression field +func (webhooks *WebhooksV1) GetEnableGzipCompression() bool { + return webhooks.Service.GetEnableGzipCompression() +} + +// EnableRetries enables automatic retries for requests invoked for this service instance. +// If either parameter is specified as 0, then a default value is used instead. +func (webhooks *WebhooksV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration) { + webhooks.Service.EnableRetries(maxRetries, maxRetryInterval) +} + +// DisableRetries disables automatic retries for requests invoked for this service instance. +func (webhooks *WebhooksV1) DisableRetries() { + webhooks.Service.DisableRetries() +} + +// ListWebhooks : List alert webhooks +// List configured alert webhooks for the CIS instance. +func (webhooks *WebhooksV1) ListWebhooks(listWebhooksOptions *ListWebhooksOptions) (result *ListAlertWebhooksResp, response *core.DetailedResponse, err error) { + return webhooks.ListWebhooksWithContext(context.Background(), listWebhooksOptions) +} + +// ListWebhooksWithContext is an alternate form of the ListWebhooks method which supports a Context parameter +func (webhooks *WebhooksV1) ListWebhooksWithContext(ctx context.Context, listWebhooksOptions *ListWebhooksOptions) (result *ListAlertWebhooksResp, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listWebhooksOptions, "listWebhooksOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *webhooks.Crn, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = webhooks.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(webhooks.Service.Options.URL, `/v1/{crn}/alerting/destinations/webhooks`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range listWebhooksOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("webhooks", "V1", "ListWebhooks") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = webhooks.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalListAlertWebhooksResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateAlertWebhook : Create an alert webhook +// Create a new alert webhook for the CIS instance. +func (webhooks *WebhooksV1) CreateAlertWebhook(createAlertWebhookOptions *CreateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error) { + return webhooks.CreateAlertWebhookWithContext(context.Background(), createAlertWebhookOptions) +} + +// CreateAlertWebhookWithContext is an alternate form of the CreateAlertWebhook method which supports a Context parameter +func (webhooks *WebhooksV1) CreateAlertWebhookWithContext(ctx context.Context, createAlertWebhookOptions *CreateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(createAlertWebhookOptions, "createAlertWebhookOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *webhooks.Crn, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = webhooks.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(webhooks.Service.Options.URL, `/v1/{crn}/alerting/destinations/webhooks`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range createAlertWebhookOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("webhooks", "V1", "CreateAlertWebhook") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if createAlertWebhookOptions.Name != nil { + body["name"] = createAlertWebhookOptions.Name + } + if createAlertWebhookOptions.URL != nil { + body["url"] = createAlertWebhookOptions.URL + } + if createAlertWebhookOptions.Secret != nil { + body["secret"] = createAlertWebhookOptions.Secret + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = webhooks.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalWebhookSuccessResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// GetWebhook : Get an alert webhook +// Get an alert webhook for the CIS instance. +func (webhooks *WebhooksV1) GetWebhook(getWebhookOptions *GetWebhookOptions) (result *GetAlertWebhookResp, response *core.DetailedResponse, err error) { + return webhooks.GetWebhookWithContext(context.Background(), getWebhookOptions) +} + +// GetWebhookWithContext is an alternate form of the GetWebhook method which supports a Context parameter +func (webhooks *WebhooksV1) GetWebhookWithContext(ctx context.Context, getWebhookOptions *GetWebhookOptions) (result *GetAlertWebhookResp, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getWebhookOptions, "getWebhookOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getWebhookOptions, "getWebhookOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *webhooks.Crn, + "webhook_id": *getWebhookOptions.WebhookID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = webhooks.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(webhooks.Service.Options.URL, `/v1/{crn}/alerting/destinations/webhooks/{webhook_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getWebhookOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("webhooks", "V1", "GetWebhook") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = webhooks.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetAlertWebhookResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// UpdateAlertWebhook : Update an alert webhook +// Update an existing alert webhook for the CIS instance. +func (webhooks *WebhooksV1) UpdateAlertWebhook(updateAlertWebhookOptions *UpdateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error) { + return webhooks.UpdateAlertWebhookWithContext(context.Background(), updateAlertWebhookOptions) +} + +// UpdateAlertWebhookWithContext is an alternate form of the UpdateAlertWebhook method which supports a Context parameter +func (webhooks *WebhooksV1) UpdateAlertWebhookWithContext(ctx context.Context, updateAlertWebhookOptions *UpdateAlertWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateAlertWebhookOptions, "updateAlertWebhookOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateAlertWebhookOptions, "updateAlertWebhookOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *webhooks.Crn, + "webhook_id": *updateAlertWebhookOptions.WebhookID, + } + + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = webhooks.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(webhooks.Service.Options.URL, `/v1/{crn}/alerting/destinations/webhooks/{webhook_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range updateAlertWebhookOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("webhooks", "V1", "UpdateAlertWebhook") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if updateAlertWebhookOptions.Name != nil { + body["name"] = updateAlertWebhookOptions.Name + } + if updateAlertWebhookOptions.URL != nil { + body["url"] = updateAlertWebhookOptions.URL + } + if updateAlertWebhookOptions.Secret != nil { + body["secret"] = updateAlertWebhookOptions.Secret + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = webhooks.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalWebhookSuccessResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// DeleteWebhook : Delete an alert webhook +// Delete an alert webhook for the CIS instance. +func (webhooks *WebhooksV1) DeleteWebhook(deleteWebhookOptions *DeleteWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error) { + return webhooks.DeleteWebhookWithContext(context.Background(), deleteWebhookOptions) +} + +// DeleteWebhookWithContext is an alternate form of the DeleteWebhook method which supports a Context parameter +func (webhooks *WebhooksV1) DeleteWebhookWithContext(ctx context.Context, deleteWebhookOptions *DeleteWebhookOptions) (result *WebhookSuccessResp, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteWebhookOptions, "deleteWebhookOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteWebhookOptions, "deleteWebhookOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "crn": *webhooks.Crn, + "webhook_id": *deleteWebhookOptions.WebhookID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = webhooks.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(webhooks.Service.Options.URL, `/v1/{crn}/alerting/destinations/webhooks/{webhook_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteWebhookOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("webhooks", "V1", "DeleteWebhook") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = webhooks.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalWebhookSuccessResp) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateAlertWebhookOptions : The CreateAlertWebhook options. +type CreateAlertWebhookOptions struct { + // Webhook Name. + Name *string `json:"name,omitempty"` + + // Webhook url. + URL *string `json:"url,omitempty"` + + // The optional secret or API key needed to use the webhook. + Secret *string `json:"secret,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateAlertWebhookOptions : Instantiate CreateAlertWebhookOptions +func (*WebhooksV1) NewCreateAlertWebhookOptions() *CreateAlertWebhookOptions { + return &CreateAlertWebhookOptions{} +} + +// SetName : Allow user to set Name +func (_options *CreateAlertWebhookOptions) SetName(name string) *CreateAlertWebhookOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetURL : Allow user to set URL +func (_options *CreateAlertWebhookOptions) SetURL(url string) *CreateAlertWebhookOptions { + _options.URL = core.StringPtr(url) + return _options +} + +// SetSecret : Allow user to set Secret +func (_options *CreateAlertWebhookOptions) SetSecret(secret string) *CreateAlertWebhookOptions { + _options.Secret = core.StringPtr(secret) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateAlertWebhookOptions) SetHeaders(param map[string]string) *CreateAlertWebhookOptions { + options.Headers = param + return options +} + +// DeleteWebhookOptions : The DeleteWebhook options. +type DeleteWebhookOptions struct { + // Alert webhook identifier. + WebhookID *string `json:"webhook_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteWebhookOptions : Instantiate DeleteWebhookOptions +func (*WebhooksV1) NewDeleteWebhookOptions(webhookID string) *DeleteWebhookOptions { + return &DeleteWebhookOptions{ + WebhookID: core.StringPtr(webhookID), + } +} + +// SetWebhookID : Allow user to set WebhookID +func (_options *DeleteWebhookOptions) SetWebhookID(webhookID string) *DeleteWebhookOptions { + _options.WebhookID = core.StringPtr(webhookID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteWebhookOptions) SetHeaders(param map[string]string) *DeleteWebhookOptions { + options.Headers = param + return options +} + +// GetAlertWebhookRespResult : Container for response information. +type GetAlertWebhookRespResult struct { + // Webhook ID. + ID *string `json:"id" validate:"required"` + + // Webhook Name. + Name *string `json:"name" validate:"required"` + + // Webhook url. + URL *string `json:"url" validate:"required"` + + // Webhook type. + Type *string `json:"type" validate:"required"` + + // When was the webhook created. + CreatedAt *string `json:"created_at" validate:"required"` + + // When was the webhook last used successfully. + LastSuccess *string `json:"last_success" validate:"required"` + + // When was the webhook last used and failed. + LastFailure *string `json:"last_failure" validate:"required"` +} + +// UnmarshalGetAlertWebhookRespResult unmarshals an instance of GetAlertWebhookRespResult from the specified map of raw messages. +func UnmarshalGetAlertWebhookRespResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertWebhookRespResult) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_success", &obj.LastSuccess) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_failure", &obj.LastFailure) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetWebhookOptions : The GetWebhook options. +type GetWebhookOptions struct { + // Alert webhook identifier. + WebhookID *string `json:"webhook_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetWebhookOptions : Instantiate GetWebhookOptions +func (*WebhooksV1) NewGetWebhookOptions(webhookID string) *GetWebhookOptions { + return &GetWebhookOptions{ + WebhookID: core.StringPtr(webhookID), + } +} + +// SetWebhookID : Allow user to set WebhookID +func (_options *GetWebhookOptions) SetWebhookID(webhookID string) *GetWebhookOptions { + _options.WebhookID = core.StringPtr(webhookID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetWebhookOptions) SetHeaders(param map[string]string) *GetWebhookOptions { + options.Headers = param + return options +} + +// ListAlertWebhooksRespResultItem : ListAlertWebhooksRespResultItem struct +type ListAlertWebhooksRespResultItem struct { + // Webhook ID. + ID *string `json:"id" validate:"required"` + + // Webhook Name. + Name *string `json:"name" validate:"required"` + + // Webhook url. + URL *string `json:"url" validate:"required"` + + // Webhook type. + Type *string `json:"type" validate:"required"` + + // When was the webhook created. + CreatedAt *string `json:"created_at" validate:"required"` + + // When was the webhook last used successfully. + LastSuccess *string `json:"last_success" validate:"required"` + + // When was the webhook last used and failed. + LastFailure *string `json:"last_failure" validate:"required"` +} + +// UnmarshalListAlertWebhooksRespResultItem unmarshals an instance of ListAlertWebhooksRespResultItem from the specified map of raw messages. +func UnmarshalListAlertWebhooksRespResultItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertWebhooksRespResultItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_success", &obj.LastSuccess) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_failure", &obj.LastFailure) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListWebhooksOptions : The ListWebhooks options. +type ListWebhooksOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListWebhooksOptions : Instantiate ListWebhooksOptions +func (*WebhooksV1) NewListWebhooksOptions() *ListWebhooksOptions { + return &ListWebhooksOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListWebhooksOptions) SetHeaders(param map[string]string) *ListWebhooksOptions { + options.Headers = param + return options +} + +// UpdateAlertWebhookOptions : The UpdateAlertWebhook options. +type UpdateAlertWebhookOptions struct { + // Alert webhook identifier. + WebhookID *string `json:"webhook_id" validate:"required,ne="` + + // Webhook Name. + Name *string `json:"name,omitempty"` + + // Webhook url. + URL *string `json:"url,omitempty"` + + // The optional secret or API key needed to use the webhook. + Secret *string `json:"secret,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateAlertWebhookOptions : Instantiate UpdateAlertWebhookOptions +func (*WebhooksV1) NewUpdateAlertWebhookOptions(webhookID string) *UpdateAlertWebhookOptions { + return &UpdateAlertWebhookOptions{ + WebhookID: core.StringPtr(webhookID), + } +} + +// SetWebhookID : Allow user to set WebhookID +func (_options *UpdateAlertWebhookOptions) SetWebhookID(webhookID string) *UpdateAlertWebhookOptions { + _options.WebhookID = core.StringPtr(webhookID) + return _options +} + +// SetName : Allow user to set Name +func (_options *UpdateAlertWebhookOptions) SetName(name string) *UpdateAlertWebhookOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetURL : Allow user to set URL +func (_options *UpdateAlertWebhookOptions) SetURL(url string) *UpdateAlertWebhookOptions { + _options.URL = core.StringPtr(url) + return _options +} + +// SetSecret : Allow user to set Secret +func (_options *UpdateAlertWebhookOptions) SetSecret(secret string) *UpdateAlertWebhookOptions { + _options.Secret = core.StringPtr(secret) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateAlertWebhookOptions) SetHeaders(param map[string]string) *UpdateAlertWebhookOptions { + options.Headers = param + return options +} + +// WebhookSuccessRespResult : Container for response information. +type WebhookSuccessRespResult struct { + // Webhook ID. + ID *string `json:"id" validate:"required"` +} + +// UnmarshalWebhookSuccessRespResult unmarshals an instance of WebhookSuccessRespResult from the specified map of raw messages. +func UnmarshalWebhookSuccessRespResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(WebhookSuccessRespResult) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetAlertWebhookResp : Get Alert Webhooks Response. +type GetAlertWebhookResp struct { + // Was operation successful. + Success *bool `json:"success" validate:"required"` + + // Array of errors encountered. + Errors [][]string `json:"errors" validate:"required"` + + // Array of messages returned. + Messages [][]string `json:"messages" validate:"required"` + + // Container for response information. + Result *GetAlertWebhookRespResult `json:"result" validate:"required"` +} + +// UnmarshalGetAlertWebhookResp unmarshals an instance of GetAlertWebhookResp from the specified map of raw messages. +func UnmarshalGetAlertWebhookResp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(GetAlertWebhookResp) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) + if err != nil { + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalGetAlertWebhookRespResult) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ListAlertWebhooksResp : List Alert Webhooks Response. +type ListAlertWebhooksResp struct { + // Was operation successful. + Success *bool `json:"success" validate:"required"` + + // Array of errors encountered. + Errors [][]string `json:"errors" validate:"required"` + + // Array of messages returned. + Messages [][]string `json:"messages" validate:"required"` + + // Container for response information. + Result []ListAlertWebhooksRespResultItem `json:"result" validate:"required"` +} + +// UnmarshalListAlertWebhooksResp unmarshals an instance of ListAlertWebhooksResp from the specified map of raw messages. +func UnmarshalListAlertWebhooksResp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ListAlertWebhooksResp) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) + if err != nil { + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalListAlertWebhooksRespResultItem) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// WebhookSuccessResp : Alert Webhooks Response. +type WebhookSuccessResp struct { + // Was operation successful. + Success *bool `json:"success" validate:"required"` + + // Array of errors encountered. + Errors [][]string `json:"errors" validate:"required"` + + // Array of messages returned. + Messages [][]string `json:"messages" validate:"required"` + + // Container for response information. + Result *WebhookSuccessRespResult `json:"result" validate:"required"` +} + +// UnmarshalWebhookSuccessResp unmarshals an instance of WebhookSuccessResp from the specified map of raw messages. +func UnmarshalWebhookSuccessResp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(WebhookSuccessResp) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) + if err != nil { + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalWebhookSuccessRespResult) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} diff --git a/ibm/vendor/github.com/IBM/scc-go-sdk/adminserviceapiv1/admin_service_api_v1.go b/ibm/vendor/github.com/IBM/scc-go-sdk/adminserviceapiv1/admin_service_api_v1.go deleted file mode 100644 index 542f0ecf5b..0000000000 --- a/ibm/vendor/github.com/IBM/scc-go-sdk/adminserviceapiv1/admin_service_api_v1.go +++ /dev/null @@ -1,682 +0,0 @@ -/** - * (C) Copyright IBM Corp. 2021. - * - * 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. - */ - -/* - * IBM OpenAPI SDK Code Generator Version: 3.34.0-e2a502a2-20210616-185634 - */ - -// Package adminserviceapiv1 : Operations and models for the AdminServiceApiV1 service -package adminserviceapiv1 - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "reflect" - "time" - - "github.com/IBM/go-sdk-core/v5/core" - common "github.com/IBM/scc-go-sdk/common" -) - -// AdminServiceApiV1 : This is an API for the Admin Service -// -// Version: 1.0.0 -type AdminServiceApiV1 struct { - Service *core.BaseService -} - -// DefaultServiceURL is the default URL to make service requests to. -const DefaultServiceURL = "https://admin-service-api.cloud.ibm.com" - -// DefaultServiceName is the default key used to find external configuration information. -const DefaultServiceName = "admin_service_api" - -// AdminServiceApiV1Options : Service options -type AdminServiceApiV1Options struct { - ServiceName string - URL string - Authenticator core.Authenticator -} - -// NewAdminServiceApiV1UsingExternalConfig : constructs an instance of AdminServiceApiV1 with passed in options and external configuration. -func NewAdminServiceApiV1UsingExternalConfig(options *AdminServiceApiV1Options) (adminServiceApi *AdminServiceApiV1, err error) { - if options.ServiceName == "" { - options.ServiceName = DefaultServiceName - } - - if options.Authenticator == nil { - options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) - if err != nil { - return - } - } - - adminServiceApi, err = NewAdminServiceApiV1(options) - if err != nil { - return - } - - err = adminServiceApi.Service.ConfigureService(options.ServiceName) - if err != nil { - return - } - - if options.URL != "" { - err = adminServiceApi.Service.SetServiceURL(options.URL) - } - return -} - -// NewAdminServiceApiV1 : constructs an instance of AdminServiceApiV1 with passed in options. -func NewAdminServiceApiV1(options *AdminServiceApiV1Options) (service *AdminServiceApiV1, err error) { - serviceOptions := &core.ServiceOptions{ - URL: DefaultServiceURL, - Authenticator: options.Authenticator, - } - - baseService, err := core.NewBaseService(serviceOptions) - if err != nil { - return - } - - if options.URL != "" { - err = baseService.SetServiceURL(options.URL) - if err != nil { - return - } - } - - service = &AdminServiceApiV1{ - Service: baseService, - } - - return -} - -// GetServiceURLForRegion returns the service URL to be used for the specified region -func GetServiceURLForRegion(region string) (string, error) { - return "", fmt.Errorf("service does not support regional URLs") -} - -// Clone makes a copy of "adminServiceApi" suitable for processing requests. -func (adminServiceApi *AdminServiceApiV1) Clone() *AdminServiceApiV1 { - if core.IsNil(adminServiceApi) { - return nil - } - clone := *adminServiceApi - clone.Service = adminServiceApi.Service.Clone() - return &clone -} - -// SetServiceURL sets the service URL -func (adminServiceApi *AdminServiceApiV1) SetServiceURL(url string) error { - return adminServiceApi.Service.SetServiceURL(url) -} - -// GetServiceURL returns the service URL -func (adminServiceApi *AdminServiceApiV1) GetServiceURL() string { - return adminServiceApi.Service.GetServiceURL() -} - -// SetDefaultHeaders sets HTTP headers to be sent in every request -func (adminServiceApi *AdminServiceApiV1) SetDefaultHeaders(headers http.Header) { - adminServiceApi.Service.SetDefaultHeaders(headers) -} - -// SetEnableGzipCompression sets the service's EnableGzipCompression field -func (adminServiceApi *AdminServiceApiV1) SetEnableGzipCompression(enableGzip bool) { - adminServiceApi.Service.SetEnableGzipCompression(enableGzip) -} - -// GetEnableGzipCompression returns the service's EnableGzipCompression field -func (adminServiceApi *AdminServiceApiV1) GetEnableGzipCompression() bool { - return adminServiceApi.Service.GetEnableGzipCompression() -} - -// EnableRetries enables automatic retries for requests invoked for this service instance. -// If either parameter is specified as 0, then a default value is used instead. -func (adminServiceApi *AdminServiceApiV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration) { - adminServiceApi.Service.EnableRetries(maxRetries, maxRetryInterval) -} - -// DisableRetries disables automatic retries for requests invoked for this service instance. -func (adminServiceApi *AdminServiceApiV1) DisableRetries() { - adminServiceApi.Service.DisableRetries() -} - -// GetSettings : View account settings -// View the current settings for a specific account. -func (adminServiceApi *AdminServiceApiV1) GetSettings(getSettingsOptions *GetSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { - return adminServiceApi.GetSettingsWithContext(context.Background(), getSettingsOptions) -} - -// GetSettingsWithContext is an alternate form of the GetSettings method which supports a Context parameter -func (adminServiceApi *AdminServiceApiV1) GetSettingsWithContext(ctx context.Context, getSettingsOptions *GetSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSettingsOptions, "getSettingsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getSettingsOptions, "getSettingsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "account_id": *getSettingsOptions.AccountID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/accounts/{account_id}/settings`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getSettingsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "GetSettings") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = adminServiceApi.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettings) - if err != nil { - return - } - response.Result = result - } - - return -} - -// PatchAccountSettings : Update account settings -// Update the settings for a specific account. -func (adminServiceApi *AdminServiceApiV1) PatchAccountSettings(patchAccountSettingsOptions *PatchAccountSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { - return adminServiceApi.PatchAccountSettingsWithContext(context.Background(), patchAccountSettingsOptions) -} - -// PatchAccountSettingsWithContext is an alternate form of the PatchAccountSettings method which supports a Context parameter -func (adminServiceApi *AdminServiceApiV1) PatchAccountSettingsWithContext(ctx context.Context, patchAccountSettingsOptions *PatchAccountSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(patchAccountSettingsOptions, "patchAccountSettingsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(patchAccountSettingsOptions, "patchAccountSettingsOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "account_id": *patchAccountSettingsOptions.AccountID, - } - - builder := core.NewRequestBuilder(core.PATCH) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/accounts/{account_id}/settings`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range patchAccountSettingsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "PatchAccountSettings") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - body := make(map[string]interface{}) - if patchAccountSettingsOptions.Location != nil { - body["location"] = patchAccountSettingsOptions.Location - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = adminServiceApi.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettings) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListLocations : View available locations -// View the available locations in which the data that is generated by the Security and Compliance Center can be -// managed. -func (adminServiceApi *AdminServiceApiV1) ListLocations(listLocationsOptions *ListLocationsOptions) (result *Locations, response *core.DetailedResponse, err error) { - return adminServiceApi.ListLocationsWithContext(context.Background(), listLocationsOptions) -} - -// ListLocationsWithContext is an alternate form of the ListLocations method which supports a Context parameter -func (adminServiceApi *AdminServiceApiV1) ListLocationsWithContext(ctx context.Context, listLocationsOptions *ListLocationsOptions) (result *Locations, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLocationsOptions, "listLocationsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/locations`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listLocationsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "ListLocations") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = adminServiceApi.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLocations) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetLocation : View the details of a location -// View the endpoints and regions that are available for a specific region. -func (adminServiceApi *AdminServiceApiV1) GetLocation(getLocationOptions *GetLocationOptions) (result *Location, response *core.DetailedResponse, err error) { - return adminServiceApi.GetLocationWithContext(context.Background(), getLocationOptions) -} - -// GetLocationWithContext is an alternate form of the GetLocation method which supports a Context parameter -func (adminServiceApi *AdminServiceApiV1) GetLocationWithContext(ctx context.Context, getLocationOptions *GetLocationOptions) (result *Location, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLocationOptions, "getLocationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLocationOptions, "getLocationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "location_id": *getLocationOptions.LocationID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/locations/{location_id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getLocationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "GetLocation") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = adminServiceApi.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLocation) - if err != nil { - return - } - response.Result = result - } - - return -} - -// AccountSettings : Account settings. -type AccountSettings struct { - // Location settings. - Location *LocationID `json:"location" validate:"required"` -} - -// NewAccountSettings : Instantiate AccountSettings (Generic Model Constructor) -func (*AdminServiceApiV1) NewAccountSettings(location *LocationID) (_model *AccountSettings, err error) { - _model = &AccountSettings{ - Location: location, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalAccountSettings unmarshals an instance of AccountSettings from the specified map of raw messages. -func UnmarshalAccountSettings(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettings) - err = core.UnmarshalModel(m, "location", &obj.Location, UnmarshalLocationID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetLocationOptions : The GetLocation options. -type GetLocationOptions struct { - // The programatic ID of the location that you want to work in. - LocationID *string `validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the GetLocationOptions.LocationID property. -// The programatic ID of the location that you want to work in. -const ( - GetLocationOptions_LocationID_Eu = "eu" - GetLocationOptions_LocationID_Uk = "uk" - GetLocationOptions_LocationID_Us = "us" -) - -// NewGetLocationOptions : Instantiate GetLocationOptions -func (*AdminServiceApiV1) NewGetLocationOptions(locationID string) *GetLocationOptions { - return &GetLocationOptions{ - LocationID: core.StringPtr(locationID), - } -} - -// SetLocationID : Allow user to set LocationID -func (_options *GetLocationOptions) SetLocationID(locationID string) *GetLocationOptions { - _options.LocationID = core.StringPtr(locationID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLocationOptions) SetHeaders(param map[string]string) *GetLocationOptions { - options.Headers = param - return options -} - -// GetSettingsOptions : The GetSettings options. -type GetSettingsOptions struct { - // The ID of the managing account. - AccountID *string `validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetSettingsOptions : Instantiate GetSettingsOptions -func (*AdminServiceApiV1) NewGetSettingsOptions(accountID string) *GetSettingsOptions { - return &GetSettingsOptions{ - AccountID: core.StringPtr(accountID), - } -} - -// SetAccountID : Allow user to set AccountID -func (_options *GetSettingsOptions) SetAccountID(accountID string) *GetSettingsOptions { - _options.AccountID = core.StringPtr(accountID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetSettingsOptions) SetHeaders(param map[string]string) *GetSettingsOptions { - options.Headers = param - return options -} - -// ListLocationsOptions : The ListLocations options. -type ListLocationsOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListLocationsOptions : Instantiate ListLocationsOptions -func (*AdminServiceApiV1) NewListLocationsOptions() *ListLocationsOptions { - return &ListLocationsOptions{} -} - -// SetHeaders : Allow user to set Headers -func (options *ListLocationsOptions) SetHeaders(param map[string]string) *ListLocationsOptions { - options.Headers = param - return options -} - -// Location : The location that your account is current set to use. -type Location struct { - // The programatic ID of the location that you want to work in. - ID *string `json:"id,omitempty"` - - MainEndpointURL *string `json:"main_endpoint_url,omitempty"` - - GovernanceEndpointURL *string `json:"governance_endpoint_url,omitempty"` - - ResultsEndpointURL *string `json:"results_endpoint_url,omitempty"` - - ComplianceEndpointURL *string `json:"compliance_endpoint_url,omitempty"` - - AnalyticsEndpointURL *string `json:"analytics_endpoint_url,omitempty"` - - SiEndpointURL *string `json:"si_endpoint_url,omitempty"` - - Regions []Region `json:"regions,omitempty"` -} - -// Constants associated with the Location.ID property. -// The programatic ID of the location that you want to work in. -const ( - Location_ID_Eu = "eu" - Location_ID_Uk = "uk" - Location_ID_Us = "us" -) - -// UnmarshalLocation unmarshals an instance of Location from the specified map of raw messages. -func UnmarshalLocation(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Location) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "main_endpoint_url", &obj.MainEndpointURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "governance_endpoint_url", &obj.GovernanceEndpointURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "results_endpoint_url", &obj.ResultsEndpointURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "compliance_endpoint_url", &obj.ComplianceEndpointURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "analytics_endpoint_url", &obj.AnalyticsEndpointURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "si_endpoint_url", &obj.SiEndpointURL) - if err != nil { - return - } - err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LocationID : Location settings. -type LocationID struct { - // The programatic ID of the location that you want to work in. - ID *string `json:"id" validate:"required"` -} - -// Constants associated with the LocationID.ID property. -// The programatic ID of the location that you want to work in. -const ( - LocationID_ID_Eu = "eu" - LocationID_ID_Uk = "uk" - LocationID_ID_Us = "us" -) - -// NewLocationID : Instantiate LocationID (Generic Model Constructor) -func (*AdminServiceApiV1) NewLocationID(id string) (_model *LocationID, err error) { - _model = &LocationID{ - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLocationID unmarshals an instance of LocationID from the specified map of raw messages. -func UnmarshalLocationID(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LocationID) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Locations : An array of available locations. -type Locations struct { - Locations []Location `json:"locations" validate:"required"` -} - -// UnmarshalLocations unmarshals an instance of Locations from the specified map of raw messages. -func UnmarshalLocations(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Locations) - err = core.UnmarshalModel(m, "locations", &obj.Locations, UnmarshalLocation) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PatchAccountSettingsOptions : The PatchAccountSettings options. -type PatchAccountSettingsOptions struct { - // The ID of the managing account. - AccountID *string `validate:"required,ne="` - - // Location settings. - Location *LocationID `validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewPatchAccountSettingsOptions : Instantiate PatchAccountSettingsOptions -func (*AdminServiceApiV1) NewPatchAccountSettingsOptions(accountID string, location *LocationID) *PatchAccountSettingsOptions { - return &PatchAccountSettingsOptions{ - AccountID: core.StringPtr(accountID), - Location: location, - } -} - -// SetAccountID : Allow user to set AccountID -func (_options *PatchAccountSettingsOptions) SetAccountID(accountID string) *PatchAccountSettingsOptions { - _options.AccountID = core.StringPtr(accountID) - return _options -} - -// SetLocation : Allow user to set Location -func (_options *PatchAccountSettingsOptions) SetLocation(location *LocationID) *PatchAccountSettingsOptions { - _options.Location = location - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *PatchAccountSettingsOptions) SetHeaders(param map[string]string) *PatchAccountSettingsOptions { - options.Headers = param - return options -} - -// Region : Region. -type Region struct { - ID *string `json:"id" validate:"required"` -} - -// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. -func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Region) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} diff --git a/ibm/vendor/github.com/IBM/scc-go-sdk/v3/LICENSE b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/LICENSE @@ -0,0 +1,201 @@ + 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/ibm/vendor/github.com/IBM/scc-go-sdk/v3/adminserviceapiv1/admin_service_api_v1.go b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/adminserviceapiv1/admin_service_api_v1.go new file mode 100644 index 0000000000..4432a19978 --- /dev/null +++ b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/adminserviceapiv1/admin_service_api_v1.go @@ -0,0 +1,862 @@ +/** + * (C) Copyright IBM Corp. 2022. + * + * 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. + */ + +/* + * IBM OpenAPI SDK Code Generator Version: 3.43.3-d49d4b21-20220104-223519 + */ + +// Package adminserviceapiv1 : Operations and models for the AdminServiceApiV1 service +package adminserviceapiv1 + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "reflect" + "time" + + "github.com/IBM/go-sdk-core/v5/core" + common "github.com/IBM/scc-go-sdk/v3/common" +) + +// AdminServiceApiV1 : This is an API for the Admin Service +// +// API Version: 1.0.0 +type AdminServiceApiV1 struct { + Service *core.BaseService +} + +// DefaultServiceURL is the default URL to make service requests to. +const DefaultServiceURL = "https://us.compliance.cloud.ibm.com" + +// DefaultServiceName is the default key used to find external configuration information. +const DefaultServiceName = "admin_service_api" + +// AdminServiceApiV1Options : Service options +type AdminServiceApiV1Options struct { + ServiceName string + URL string + Authenticator core.Authenticator +} + +// NewAdminServiceApiV1UsingExternalConfig : constructs an instance of AdminServiceApiV1 with passed in options and external configuration. +func NewAdminServiceApiV1UsingExternalConfig(options *AdminServiceApiV1Options) (adminServiceApi *AdminServiceApiV1, err error) { + if options.ServiceName == "" { + options.ServiceName = DefaultServiceName + } + + if options.Authenticator == nil { + options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) + if err != nil { + return + } + } + + adminServiceApi, err = NewAdminServiceApiV1(options) + if err != nil { + return + } + + err = adminServiceApi.Service.ConfigureService(options.ServiceName) + if err != nil { + return + } + + if options.URL != "" { + err = adminServiceApi.Service.SetServiceURL(options.URL) + } + return +} + +// NewAdminServiceApiV1 : constructs an instance of AdminServiceApiV1 with passed in options. +func NewAdminServiceApiV1(options *AdminServiceApiV1Options) (service *AdminServiceApiV1, err error) { + serviceOptions := &core.ServiceOptions{ + URL: DefaultServiceURL, + Authenticator: options.Authenticator, + } + + baseService, err := core.NewBaseService(serviceOptions) + if err != nil { + return + } + + if options.URL != "" { + err = baseService.SetServiceURL(options.URL) + if err != nil { + return + } + } + + service = &AdminServiceApiV1{ + Service: baseService, + } + + return +} + +// GetServiceURLForRegion returns the service URL to be used for the specified region +func GetServiceURLForRegion(region string) (string, error) { + var endpoints = map[string]string{ + "us-south": "https://us.compliance.cloud.ibm.com", + "us-east": "https://us.compliance.cloud.ibm.com", + "eu-de": "https://eu.compliance.cloud.ibm.com", + "eu-gb": "https://uk.compliance.cloud.ibm.com", + } + + if url, ok := endpoints[region]; ok { + return url, nil + } + return "", fmt.Errorf("service URL for region '%s' not found", region) +} + +// Clone makes a copy of "adminServiceApi" suitable for processing requests. +func (adminServiceApi *AdminServiceApiV1) Clone() *AdminServiceApiV1 { + if core.IsNil(adminServiceApi) { + return nil + } + clone := *adminServiceApi + clone.Service = adminServiceApi.Service.Clone() + return &clone +} + +// SetServiceURL sets the service URL +func (adminServiceApi *AdminServiceApiV1) SetServiceURL(url string) error { + return adminServiceApi.Service.SetServiceURL(url) +} + +// GetServiceURL returns the service URL +func (adminServiceApi *AdminServiceApiV1) GetServiceURL() string { + return adminServiceApi.Service.GetServiceURL() +} + +// SetDefaultHeaders sets HTTP headers to be sent in every request +func (adminServiceApi *AdminServiceApiV1) SetDefaultHeaders(headers http.Header) { + adminServiceApi.Service.SetDefaultHeaders(headers) +} + +// SetEnableGzipCompression sets the service's EnableGzipCompression field +func (adminServiceApi *AdminServiceApiV1) SetEnableGzipCompression(enableGzip bool) { + adminServiceApi.Service.SetEnableGzipCompression(enableGzip) +} + +// GetEnableGzipCompression returns the service's EnableGzipCompression field +func (adminServiceApi *AdminServiceApiV1) GetEnableGzipCompression() bool { + return adminServiceApi.Service.GetEnableGzipCompression() +} + +// EnableRetries enables automatic retries for requests invoked for this service instance. +// If either parameter is specified as 0, then a default value is used instead. +func (adminServiceApi *AdminServiceApiV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration) { + adminServiceApi.Service.EnableRetries(maxRetries, maxRetryInterval) +} + +// DisableRetries disables automatic retries for requests invoked for this service instance. +func (adminServiceApi *AdminServiceApiV1) DisableRetries() { + adminServiceApi.Service.DisableRetries() +} + +// GetSettings : View account settings +// View the current settings for a specific account. +func (adminServiceApi *AdminServiceApiV1) GetSettings(getSettingsOptions *GetSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { + return adminServiceApi.GetSettingsWithContext(context.Background(), getSettingsOptions) +} + +// GetSettingsWithContext is an alternate form of the GetSettings method which supports a Context parameter +func (adminServiceApi *AdminServiceApiV1) GetSettingsWithContext(ctx context.Context, getSettingsOptions *GetSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSettingsOptions, "getSettingsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getSettingsOptions, "getSettingsOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "account_id": *getSettingsOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/accounts/{account_id}/settings`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getSettingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "GetSettings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = adminServiceApi.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettings) + if err != nil { + return + } + response.Result = result + } + + return +} + +// PatchAccountSettings : Update account settings +// Update the settings for a specific account. +func (adminServiceApi *AdminServiceApiV1) PatchAccountSettings(patchAccountSettingsOptions *PatchAccountSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { + return adminServiceApi.PatchAccountSettingsWithContext(context.Background(), patchAccountSettingsOptions) +} + +// PatchAccountSettingsWithContext is an alternate form of the PatchAccountSettings method which supports a Context parameter +func (adminServiceApi *AdminServiceApiV1) PatchAccountSettingsWithContext(ctx context.Context, patchAccountSettingsOptions *PatchAccountSettingsOptions) (result *AccountSettings, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(patchAccountSettingsOptions, "patchAccountSettingsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(patchAccountSettingsOptions, "patchAccountSettingsOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "account_id": *patchAccountSettingsOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/accounts/{account_id}/settings`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range patchAccountSettingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "PatchAccountSettings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if patchAccountSettingsOptions.Location != nil { + body["location"] = patchAccountSettingsOptions.Location + } + if patchAccountSettingsOptions.EventNotifications != nil { + body["event_notifications"] = patchAccountSettingsOptions.EventNotifications + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = adminServiceApi.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettings) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ListLocations : View available locations +// View the available locations in which the data that is generated by the Security and Compliance Center can be +// managed. +func (adminServiceApi *AdminServiceApiV1) ListLocations(listLocationsOptions *ListLocationsOptions) (result *Locations, response *core.DetailedResponse, err error) { + return adminServiceApi.ListLocationsWithContext(context.Background(), listLocationsOptions) +} + +// ListLocationsWithContext is an alternate form of the ListLocations method which supports a Context parameter +func (adminServiceApi *AdminServiceApiV1) ListLocationsWithContext(ctx context.Context, listLocationsOptions *ListLocationsOptions) (result *Locations, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listLocationsOptions, "listLocationsOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/locations`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listLocationsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "ListLocations") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = adminServiceApi.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLocations) + if err != nil { + return + } + response.Result = result + } + + return +} + +// GetLocation : View the details of a location +// View the endpoints and regions that are available for a specific region. +func (adminServiceApi *AdminServiceApiV1) GetLocation(getLocationOptions *GetLocationOptions) (result *Location, response *core.DetailedResponse, err error) { + return adminServiceApi.GetLocationWithContext(context.Background(), getLocationOptions) +} + +// GetLocationWithContext is an alternate form of the GetLocation method which supports a Context parameter +func (adminServiceApi *AdminServiceApiV1) GetLocationWithContext(ctx context.Context, getLocationOptions *GetLocationOptions) (result *Location, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLocationOptions, "getLocationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLocationOptions, "getLocationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "location_id": *getLocationOptions.LocationID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/locations/{location_id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getLocationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "GetLocation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = adminServiceApi.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLocation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// SendTestEvent : Send test event +// Send a test event using your configured Event Notifications instance. +func (adminServiceApi *AdminServiceApiV1) SendTestEvent(sendTestEventOptions *SendTestEventOptions) (result *TestEvent, response *core.DetailedResponse, err error) { + return adminServiceApi.SendTestEventWithContext(context.Background(), sendTestEventOptions) +} + +// SendTestEventWithContext is an alternate form of the SendTestEvent method which supports a Context parameter +func (adminServiceApi *AdminServiceApiV1) SendTestEventWithContext(ctx context.Context, sendTestEventOptions *SendTestEventOptions) (result *TestEvent, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(sendTestEventOptions, "sendTestEventOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(sendTestEventOptions, "sendTestEventOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "account_id": *sendTestEventOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = adminServiceApi.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(adminServiceApi.Service.Options.URL, `/admin/v1/accounts/{account_id}/test_event`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range sendTestEventOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("admin_service_api", "V1", "SendTestEvent") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = adminServiceApi.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTestEvent) + if err != nil { + return + } + response.Result = result + } + + return +} + +// AccountSettings : Account settings. +type AccountSettings struct { + // Location settings. + Location *LocationID `json:"location,omitempty"` + + // The Event Notification settings to register. + EventNotifications *NotificationsRegistration `json:"event_notifications,omitempty"` +} + +// UnmarshalAccountSettings unmarshals an instance of AccountSettings from the specified map of raw messages. +func UnmarshalAccountSettings(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettings) + err = core.UnmarshalModel(m, "location", &obj.Location, UnmarshalLocationID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "event_notifications", &obj.EventNotifications, UnmarshalNotificationsRegistration) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// GetLocationOptions : The GetLocation options. +type GetLocationOptions struct { + // The programatic ID of the location that you want to work in. + LocationID *string `json:"location_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the GetLocationOptions.LocationID property. +// The programatic ID of the location that you want to work in. +const ( + GetLocationOptions_LocationID_Eu = "eu" + GetLocationOptions_LocationID_Uk = "uk" + GetLocationOptions_LocationID_Us = "us" +) + +// NewGetLocationOptions : Instantiate GetLocationOptions +func (*AdminServiceApiV1) NewGetLocationOptions(locationID string) *GetLocationOptions { + return &GetLocationOptions{ + LocationID: core.StringPtr(locationID), + } +} + +// SetLocationID : Allow user to set LocationID +func (_options *GetLocationOptions) SetLocationID(locationID string) *GetLocationOptions { + _options.LocationID = core.StringPtr(locationID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetLocationOptions) SetHeaders(param map[string]string) *GetLocationOptions { + options.Headers = param + return options +} + +// GetSettingsOptions : The GetSettings options. +type GetSettingsOptions struct { + // The ID of the managing account. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSettingsOptions : Instantiate GetSettingsOptions +func (*AdminServiceApiV1) NewGetSettingsOptions(accountID string) *GetSettingsOptions { + return &GetSettingsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *GetSettingsOptions) SetAccountID(accountID string) *GetSettingsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSettingsOptions) SetHeaders(param map[string]string) *GetSettingsOptions { + options.Headers = param + return options +} + +// ListLocationsOptions : The ListLocations options. +type ListLocationsOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLocationsOptions : Instantiate ListLocationsOptions +func (*AdminServiceApiV1) NewListLocationsOptions() *ListLocationsOptions { + return &ListLocationsOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListLocationsOptions) SetHeaders(param map[string]string) *ListLocationsOptions { + options.Headers = param + return options +} + +// Location : The location that your account is current set to use. +type Location struct { + // The programatic ID of the location that you want to work in. + ID *string `json:"id,omitempty"` + + // The base URL for the service. + MainEndpointURL *string `json:"main_endpoint_url,omitempty"` + + // The endpoint that is used to call the Configuration Governance APIs. + GovernanceEndpointURL *string `json:"governance_endpoint_url,omitempty"` + + // The endpoint that is used to get the results for the Configuration Governance component. + ResultsEndpointURL *string `json:"results_endpoint_url,omitempty"` + + // The endpoint that is used to call the Posture Management APIs. + ComplianceEndpointURL *string `json:"compliance_endpoint_url,omitempty"` + + // The endpoint that is used to generate analytics for the Posture Management component. + AnalyticsEndpointURL *string `json:"analytics_endpoint_url,omitempty"` + + // The endpoint that is used to call the Security Insights APIs. + SiEndpointURL *string `json:"si_endpoint_url,omitempty"` + + Regions []Region `json:"regions,omitempty"` +} + +// Constants associated with the Location.ID property. +// The programatic ID of the location that you want to work in. +const ( + Location_ID_Eu = "eu" + Location_ID_Uk = "uk" + Location_ID_Us = "us" +) + +// UnmarshalLocation unmarshals an instance of Location from the specified map of raw messages. +func UnmarshalLocation(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Location) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "main_endpoint_url", &obj.MainEndpointURL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "governance_endpoint_url", &obj.GovernanceEndpointURL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "results_endpoint_url", &obj.ResultsEndpointURL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "compliance_endpoint_url", &obj.ComplianceEndpointURL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "analytics_endpoint_url", &obj.AnalyticsEndpointURL) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "si_endpoint_url", &obj.SiEndpointURL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LocationID : Location settings. +type LocationID struct { + // The programatic ID of the location that you want to work in. + ID *string `json:"id" validate:"required"` +} + +// Constants associated with the LocationID.ID property. +// The programatic ID of the location that you want to work in. +const ( + LocationID_ID_Eu = "eu" + LocationID_ID_Uk = "uk" + LocationID_ID_Us = "us" +) + +// NewLocationID : Instantiate LocationID (Generic Model Constructor) +func (*AdminServiceApiV1) NewLocationID(id string) (_model *LocationID, err error) { + _model = &LocationID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLocationID unmarshals an instance of LocationID from the specified map of raw messages. +func UnmarshalLocationID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LocationID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Locations : An array of available locations. +type Locations struct { + Locations []Location `json:"locations" validate:"required"` +} + +// UnmarshalLocations unmarshals an instance of Locations from the specified map of raw messages. +func UnmarshalLocations(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Locations) + err = core.UnmarshalModel(m, "locations", &obj.Locations, UnmarshalLocation) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NotificationsRegistration : The Event Notification settings to register. +type NotificationsRegistration struct { + // The Cloud Resource Name (CRN) of the Event Notifications instance that you want to connect. + InstanceCrn *string `json:"instance_crn" validate:"required"` + + // The name to register as a source in your Event Notifications instance. + SourceName *string `json:"source_name,omitempty"` + + // An optional description for the source in your Event Notifications instance. + SourceDescription *string `json:"source_description,omitempty"` +} + +// NewNotificationsRegistration : Instantiate NotificationsRegistration (Generic Model Constructor) +func (*AdminServiceApiV1) NewNotificationsRegistration(instanceCrn string) (_model *NotificationsRegistration, err error) { + _model = &NotificationsRegistration{ + InstanceCrn: core.StringPtr(instanceCrn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalNotificationsRegistration unmarshals an instance of NotificationsRegistration from the specified map of raw messages. +func UnmarshalNotificationsRegistration(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NotificationsRegistration) + err = core.UnmarshalPrimitive(m, "instance_crn", &obj.InstanceCrn) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_name", &obj.SourceName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "source_description", &obj.SourceDescription) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PatchAccountSettingsOptions : The PatchAccountSettings options. +type PatchAccountSettingsOptions struct { + // The ID of the managing account. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Location settings. + Location *LocationID `json:"location,omitempty"` + + // The Event Notification settings to register. + EventNotifications *NotificationsRegistration `json:"event_notifications,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewPatchAccountSettingsOptions : Instantiate PatchAccountSettingsOptions +func (*AdminServiceApiV1) NewPatchAccountSettingsOptions(accountID string) *PatchAccountSettingsOptions { + return &PatchAccountSettingsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *PatchAccountSettingsOptions) SetAccountID(accountID string) *PatchAccountSettingsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetLocation : Allow user to set Location +func (_options *PatchAccountSettingsOptions) SetLocation(location *LocationID) *PatchAccountSettingsOptions { + _options.Location = location + return _options +} + +// SetEventNotifications : Allow user to set EventNotifications +func (_options *PatchAccountSettingsOptions) SetEventNotifications(eventNotifications *NotificationsRegistration) *PatchAccountSettingsOptions { + _options.EventNotifications = eventNotifications + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *PatchAccountSettingsOptions) SetHeaders(param map[string]string) *PatchAccountSettingsOptions { + options.Headers = param + return options +} + +// Region : The region or regions that are available for each location. Be sure to use the correct region ID when making your API +// call. +type Region struct { + // The programatic ID of the available regions. + ID *string `json:"id" validate:"required"` +} + +// Constants associated with the Region.ID property. +// The programatic ID of the available regions. +const ( + Region_ID_Eu = "eu" + Region_ID_Uk = "uk" + Region_ID_Us = "us" +) + +// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. +func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Region) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SendTestEventOptions : The SendTestEvent options. +type SendTestEventOptions struct { + // The ID of the managing account. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewSendTestEventOptions : Instantiate SendTestEventOptions +func (*AdminServiceApiV1) NewSendTestEventOptions(accountID string) *SendTestEventOptions { + return &SendTestEventOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *SendTestEventOptions) SetAccountID(accountID string) *SendTestEventOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *SendTestEventOptions) SetHeaders(param map[string]string) *SendTestEventOptions { + options.Headers = param + return options +} + +// TestEvent : The details of a test event response. +type TestEvent struct { + // Indicates whether the event was received by Event Notifications. + Success *bool `json:"success" validate:"required"` +} + +// UnmarshalTestEvent unmarshals an instance of TestEvent from the specified map of raw messages. +func UnmarshalTestEvent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TestEvent) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} diff --git a/ibm/vendor/github.com/IBM/scc-go-sdk/v3/common/headers.go b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/common/headers.go new file mode 100644 index 0000000000..9f90f3d853 --- /dev/null +++ b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/common/headers.go @@ -0,0 +1,82 @@ +/** + * (C) Copyright IBM Corp. 2019, 2020. + * + * 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 common + +import ( + "fmt" + "runtime" +) + +const ( + sdkName = "scc-go-sdk" + headerNameUserAgent = "User-Agent" +) + +// +// GetSdkHeaders - returns the set of SDK-specific headers to be included in an outgoing request. +// +// This function is invoked by generated service methods (i.e. methods which implement the REST API operations +// defined within the API definition). The purpose of this function is to give the SDK implementor the opportunity +// to provide SDK-specific HTTP headers that will be sent with an outgoing REST API request. +// This function is invoked for each invocation of a generated service method, +// so the set of HTTP headers could be request-specific. +// As an optimization, if your SDK will be returning the same set of HTTP headers for each invocation of this +// function, it is recommended that you initialize the returned map just once (perhaps by using +// lazy initialization) and simply return it each time the function is invoked, instead of building it each time +// as in the example below. +// +// If you plan to gather metrics for your SDK, the User-Agent header value must +// be a string similar to the following: +// my-go-sdk/0.0.1 (lang=go; arch=x86_64; os=Linux; go.version=1.12.9) +// +// In the example above, the analytics tool will parse the user-agent header and +// use the following properties: +// "my-go-sdk" - the name of your sdk +// "0.0.1"- the version of your sdk +// "lang=go" - the language of the current sdk +// "arch=x86_64; os=Linux; go.version=1.12.9" - system information +// +// Note: It is very important that the sdk name ends with the string `-sdk`, +// as the analytics data collector uses this to gather usage data. +// +// Parameters: +// serviceName - the name of the service as defined in the API definition (e.g. "MyService1") +// serviceVersion - the version of the service as defined in the API definition (e.g. "V1") +// operationId - the operationId as defined in the API definition (e.g. getContext) +// +// Returns: +// a Map which contains the set of headers to be included in the REST API request +// +func GetSdkHeaders(serviceName string, serviceVersion string, operationId string) map[string]string { + sdkHeaders := make(map[string]string) + + sdkHeaders[headerNameUserAgent] = GetUserAgentInfo() + + return sdkHeaders +} + +var userAgent string = fmt.Sprintf("%s/%s %s", sdkName, Version, GetSystemInfo()) + +func GetUserAgentInfo() string { + return userAgent +} + +var systemInfo = fmt.Sprintf("(lang=go; arch=%s; os=%s; go.version=%s)", runtime.GOARCH, runtime.GOOS, runtime.Version()) + +func GetSystemInfo() string { + return systemInfo +} diff --git a/ibm/vendor/github.com/IBM/scc-go-sdk/v3/common/version.go b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/common/version.go new file mode 100644 index 0000000000..59a96e58f2 --- /dev/null +++ b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/common/version.go @@ -0,0 +1,20 @@ +/** + * (C) Copyright IBM Corp. 2019, 2020. + * + * 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 common + +// Version of the SDK +const Version = "3.1.6" diff --git a/ibm/vendor/github.com/IBM/scc-go-sdk/posturemanagementv1/posture_management_v1.go b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/posturemanagementv1/posture_management_v1.go similarity index 99% rename from ibm/vendor/github.com/IBM/scc-go-sdk/posturemanagementv1/posture_management_v1.go rename to ibm/vendor/github.com/IBM/scc-go-sdk/v3/posturemanagementv1/posture_management_v1.go index a04187e334..0701a319dd 100644 --- a/ibm/vendor/github.com/IBM/scc-go-sdk/posturemanagementv1/posture_management_v1.go +++ b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/posturemanagementv1/posture_management_v1.go @@ -32,7 +32,7 @@ import ( "time" "github.com/IBM/go-sdk-core/v5/core" - common "github.com/IBM/scc-go-sdk/common" + common "github.com/IBM/scc-go-sdk/v3/common" "github.com/go-openapi/strfmt" ) @@ -133,6 +133,15 @@ func NewPostureManagementV1(options *PostureManagementV1Options) (service *Postu // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { + var endpoints = map[string]string{ + "us-south": "https://us.compliance.cloud.ibm.com", + "us-east": "https://us.compliance.cloud.ibm.com", + "eu-de": "https://eu.compliance.cloud.ibm.com", + } + + if url, ok := endpoints[region]; ok { + return url, nil + } return "", fmt.Errorf("service does not support regional URLs") } diff --git a/ibm/vendor/github.com/IBM/scc-go-sdk/posturemanagementv2/posture_management_v2.go b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/posturemanagementv2/posture_management_v2.go similarity index 89% rename from ibm/vendor/github.com/IBM/scc-go-sdk/posturemanagementv2/posture_management_v2.go rename to ibm/vendor/github.com/IBM/scc-go-sdk/v3/posturemanagementv2/posture_management_v2.go index fe49c4c951..a61bab47f3 100644 --- a/ibm/vendor/github.com/IBM/scc-go-sdk/posturemanagementv2/posture_management_v2.go +++ b/ibm/vendor/github.com/IBM/scc-go-sdk/v3/posturemanagementv2/posture_management_v2.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ import ( "time" "github.com/IBM/go-sdk-core/v5/core" - common "github.com/IBM/scc-go-sdk/common" + common "github.com/IBM/scc-go-sdk/v3/common" "github.com/go-openapi/strfmt" ) @@ -121,6 +121,15 @@ func NewPostureManagementV2(options *PostureManagementV2Options) (service *Postu // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { + var endpoints = map[string]string{ + "us-south": "https://us.compliance.cloud.ibm.com", + "us-east": "https://us.compliance.cloud.ibm.com", + "eu-de": "https://eu.compliance.cloud.ibm.com", + } + + if url, ok := endpoints[region]; ok { + return url, nil + } return "", fmt.Errorf("service does not support regional URLs") } @@ -176,8 +185,8 @@ func (postureManagement *PostureManagementV2) DisableRetries() { } // CreateCredential : Add a credential -// Add an existing credential that can be used by a collector to access your resources in order to gather information -// about your configurations, validate them, and initiate any remediation where possible. +// Add an existing credential that can be used by a collector to access your resources to gather information about your +// configurations, validate them, and initiate any remediation where possible. func (postureManagement *PostureManagementV2) CreateCredential(createCredentialOptions *CreateCredentialOptions) (result *Credential, response *core.DetailedResponse, err error) { return postureManagement.CreateCredentialWithContext(context.Background(), createCredentialOptions) } @@ -268,7 +277,7 @@ func (postureManagement *PostureManagementV2) CreateCredentialWithContext(ctx co } // ListCredentials : List credentials -// List the credentials results that are available in your account. +// List the credentials that were previously added to the Security and Compliance Center. func (postureManagement *PostureManagementV2) ListCredentials(listCredentialsOptions *ListCredentialsOptions) (result *CredentialList, response *core.DetailedResponse, err error) { return postureManagement.ListCredentialsWithContext(context.Background(), listCredentialsOptions) } @@ -333,7 +342,7 @@ func (postureManagement *PostureManagementV2) ListCredentialsWithContext(ctx con } // GetCredential : View credential details -// View a stored credential details including its name, type, and secret. +// View the details of a stored credential, which include its name, type, and secret. func (postureManagement *PostureManagementV2) GetCredential(getCredentialOptions *GetCredentialOptions) (result *Credential, response *core.DetailedResponse, err error) { return postureManagement.GetCredentialWithContext(context.Background(), getCredentialOptions) } @@ -400,7 +409,7 @@ func (postureManagement *PostureManagementV2) GetCredentialWithContext(ctx conte } // UpdateCredential : Update a credential -// Update the way a credential is stored in the Security and Compliance Center, or update the credential itself. +// Update the way that a credential is stored in the Security and Compliance Center, or update the credential itself. func (postureManagement *PostureManagementV2) UpdateCredential(updateCredentialOptions *UpdateCredentialOptions) (result *Credential, response *core.DetailedResponse, err error) { return postureManagement.UpdateCredentialWithContext(context.Background(), updateCredentialOptions) } @@ -636,7 +645,7 @@ func (postureManagement *PostureManagementV2) CreateCollectorWithContext(ctx con } // ListCollectors : List collectors -// View a list of all of the collectors that are avilable in your account and their current status. +// View a list of all of the collectors that are available in your account and their status. func (postureManagement *PostureManagementV2) ListCollectors(listCollectorsOptions *ListCollectorsOptions) (result *CollectorList, response *core.DetailedResponse, err error) { return postureManagement.ListCollectorsWithContext(context.Background(), listCollectorsOptions) } @@ -890,8 +899,8 @@ func (postureManagement *PostureManagementV2) DeleteCollectorWithContext(ctx con } // ImportProfiles : Import profile -// Import a profile that you've formatted locally. For more information about the way in which your profile must be -// formatted, see [the docs](/docs/security-compliance?topic=security-compliance-custom-profiles#CSV-format). +// Import a profile that you formatted locally. For more information about how your profile must be formatted, see [the +// docs](/docs/security-compliance?topic=security-compliance-custom-profiles#CSV-format). func (postureManagement *PostureManagementV2) ImportProfiles(importProfilesOptions *ImportProfilesOptions) (result *BasicResult, response *core.DetailedResponse, err error) { return postureManagement.ImportProfilesWithContext(context.Background(), importProfilesOptions) } @@ -1599,8 +1608,8 @@ func (postureManagement *PostureManagementV2) GetScopeDetailsWithContext(ctx con return } -// UpdateScopeDetails : Update Scope -// Updates the Scope details. +// UpdateScopeDetails : Update scope +// Update a scope's details. func (postureManagement *PostureManagementV2) UpdateScopeDetails(updateScopeDetailsOptions *UpdateScopeDetailsOptions) (result *Scope, response *core.DetailedResponse, err error) { return postureManagement.UpdateScopeDetailsWithContext(context.Background(), updateScopeDetailsOptions) } @@ -1734,8 +1743,8 @@ func (postureManagement *PostureManagementV2) DeleteScopeWithContext(ctx context return } -// GetScopeTimeline : Get scope timelines -// Gives the list of events for a given scope like Discovery, fact collection. +// GetScopeTimeline : Get scope event history +// Get the list of events for a scope such as the last discovery or fact collection. func (postureManagement *PostureManagementV2) GetScopeTimeline(getScopeTimelineOptions *GetScopeTimelineOptions) (result *EventList, response *core.DetailedResponse, err error) { return postureManagement.GetScopeTimelineWithContext(context.Background(), getScopeTimelineOptions) } @@ -2092,9 +2101,10 @@ func (postureManagement *PostureManagementV2) ReplaceScopeDetailsCollectorWithCo return } -// GetCorrelationID : Get status of a scope by giving correlation ID -// This API is used to track any task completion. In case of scope creation, using this API we can check the status of -// discovery task and in case of scan trigger we can check the status of validation task. +// GetCorrelationID : Get status of a scope +// Get the status of any task. By providing a correlation ID, you can track the status of any task that is running or +// completed. So, for example, you can check the status of an initial discovery after scope creation or the status of +// validation after a scan is triggered. func (postureManagement *PostureManagementV2) GetCorrelationID(getCorrelationIDOptions *GetCorrelationIDOptions) (result *ScopeTaskStatus, response *core.DetailedResponse, err error) { return postureManagement.GetCorrelationIDWithContext(context.Background(), getCorrelationIDOptions) } @@ -2227,8 +2237,8 @@ func (postureManagement *PostureManagementV2) ListLatestScansWithContext(ctx con // CreateValidation : Initiate a validation scan // Validation scans determine a specified scope's adherence to regulatory controls by validating the configuration of -// the resources in your scope to the attached profile. To initiate a scan, you must have configured a collector, -// provided credentials, and completed both a fact collection and discovery scan. [Learn +// the resources in your scope to the attached profile. To initiate a scan, you must configure a collector, provided +// credentials, and completed both a fact collection and discovery scan. [Learn // more](/docs/security-compliance?topic=security-compliance-schedule-scan). func (postureManagement *PostureManagementV2) CreateValidation(createValidationOptions *CreateValidationOptions) (result *Result, response *core.DetailedResponse, err error) { return postureManagement.CreateValidationWithContext(context.Background(), createValidationOptions) @@ -2467,7 +2477,7 @@ type ApplicabilityCriteria struct { // The software that the profile applies to. SoftwareDetails interface{} `json:"software_details,omitempty"` - // The operatoring system that the profile applies to. + // The operating system that the profile applies to. OsDetails interface{} `json:"os_details,omitempty"` // Any additional details about the profile. @@ -2555,6 +2565,9 @@ type BasicResult struct { // The result of the operation. Result *bool `json:"result" validate:"required"` + + // Id of created Profile. + ProfileID *string `json:"profile_id,omitempty"` } // UnmarshalBasicResult unmarshals an instance of BasicResult from the specified map of raw messages. @@ -2568,13 +2581,17 @@ func UnmarshalBasicResult(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } + err = core.UnmarshalPrimitive(m, "profile_id", &obj.ProfileID) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } // Collector : The details of a collector. type Collector struct { - // The id of the collector. + // The ID of the collector. ID *string `json:"id" validate:"required"` // The user-friendly name of the collector. @@ -2583,106 +2600,107 @@ type Collector struct { // The name of the collector. Name *string `json:"name" validate:"required"` - // The public key of the collector.Will be used for ssl communciation between collector and orchestrator .This will be - // populated when collector is installed. + // The public key of the collector. The key is used for SSL communication between collector and orchestrator. This + // property is populated when the collector is installed. PublicKey *string `json:"public_key,omitempty"` - // Stores the heartbeat time of a controller . This value exists when collector is installed and running. + // The heartbeat time of the controller. This value exists when the collector is installed and running. LastHeartbeat *strfmt.DateTime `json:"last_heartbeat,omitempty"` - // The status of collector. + // The status of the collector. Status *string `json:"status" validate:"required"` - // The collector version. This field is populated when collector is installed. + // The collector version. This field is populated when the collector is installed. CollectorVersion *string `json:"collector_version,omitempty"` - // The image version of the collector. This field is populated when collector is installed. ". + // The image version of the collector. This field is populated when the collector is installed.". ImageVersion *string `json:"image_version,omitempty"` // The description of the collector. Description *string `json:"description" validate:"required"` - // The id of the user that created the collector. + // The ID of the user that created the collector. CreatedBy *string `json:"created_by" validate:"required"` - // The ISO Date/Time the collector was created. + // The ISO date and time when the collector was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The id of the user that modified the collector. + // The ID of the user that modified the collector. UpdatedBy *string `json:"updated_by" validate:"required"` - // The ISO Date/Time the collector was modified. + // The ISO date and time when the collector was modified. UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // Identifies whether the collector is enabled or not(deleted). + // The indication of whether the collector is enabled or not(deleted). Enabled *bool `json:"enabled" validate:"required"` - // The registration code of the collector.This is will be used for initial authentication during installation of + // The registration code of the collector. The code is used for initial authentication during the installation of the // collector. RegistrationCode *string `json:"registration_code" validate:"required"` // The type of the collector. Type *string `json:"type" validate:"required"` - // The credential public key. + // The credential's public key. CredentialPublicKey *string `json:"credential_public_key,omitempty"` - // The number of times the collector has failed. + // The number of times that the collector failed. FailureCount *int64 `json:"failure_count" validate:"required"` - // The approved local gateway ip of the collector. This field will be populated only when collector is installed. + // The approved local gateway IP of the collector. The IP is populated only when the collector is installed. ApprovedLocalGatewayIP *string `json:"approved_local_gateway_ip,omitempty"` - // The approved internet gateway ip of the collector. This field will be populated only when collector is installed. + // The approved internet gateway IP of the collector. The IP is populated only when the collector is installed. ApprovedInternetGatewayIP *string `json:"approved_internet_gateway_ip,omitempty"` - // The failed local gateway ip. This field will be populated only when collector is installed. + // The failed local gateway IP. The IP is populated only when the collector is installed. LastFailedLocalGatewayIP *string `json:"last_failed_local_gateway_ip,omitempty"` - // The reason for the collector reset .User resets the collector with a reason for reset. The reason entered by the - // user is saved in this field . + // The reason for the collector reset. User resets the collector with a reason for reset. The reason that is entered by + // the user is saved in this field . ResetReason *string `json:"reset_reason,omitempty"` - // The collector host name. This field will be populated when collector is installed.This will have fully qualified - // domain name. + // The collector hostname. The hostname is populated when the collector is installed. The fully qualified domain name + // is included. Hostname *string `json:"hostname,omitempty"` - // The installation path of the collector. This field will be populated when collector is installed.The value will be - // folder path. + // The installation path of the collector. This field is populated when the collector is installed. The value includes + // the folder path. InstallPath *string `json:"install_path,omitempty"` - // Whether the collector should use a public or private endpoint. This value is generated based on is_public field - // value during collector creation. If is_public is set to true, this value will be false. + // The indication of whether the collector uses a public or private endpoint. This value is generated based on the + // `is_public` field value during collector creation. If `is_public` is set to true, the `use_private_endpoint` value + // is false. UsePrivateEndpoint *bool `json:"use_private_endpoint" validate:"required"` // The entity that manages the collector. ManagedBy *string `json:"managed_by" validate:"required"` - // The trial expiry. This holds the expiry date of registration_code. This field will be populated when collector is + // The trial expiry indicates the expiry date of `registration_code`. This field is populated when the collector is // installed. TrialExpiry *strfmt.DateTime `json:"trial_expiry,omitempty"` - // The failed internet gateway ip of the collector. + // The failed internet gateway IP of the collector. LastFailedInternetGatewayIP *string `json:"last_failed_internet_gateway_ip,omitempty"` // The collector status. StatusDescription *string `json:"status_description" validate:"required"` - // The ISO Date/Time of the collector reset. This value will be populated when a collector is reset. The data-time when - // the reset event is occured is captured in this field. + // The ISO date and time of the collector reset. This value is populated when a collector is reset. The data-time when + // the reset event occurs is captured in this field. ResetTime *strfmt.DateTime `json:"reset_time,omitempty"` - // Determines whether the collector endpoint is accessible on a public network.If set to `true`, the collector connects - // to resources in your account over a public network. If set to `false`, the collector connects to resources by using - // a private IP that is accessible only through the IBM Cloud private network. + // An indication of whether the collector endpoint is accessible on a public network. If set to `true`, the collector + // connects to resources in your account over a public network. If set to `false`, the collector connects to resources + // by using a private IP that is accessible only through the IBM Cloud private network. IsPublic *bool `json:"is_public" validate:"required"` - // Determines whether the collector has a Ubi image. + // An indication of whether the collector has a UBI image. IsUbiImage *bool `json:"is_ubi_image,omitempty"` } // Constants associated with the Collector.Status property. -// The status of collector. +// The status of the collector. const ( CollectorStatusActiveConst = "active" CollectorStatusApprovalRequiredConst = "approval_required" @@ -2849,16 +2867,16 @@ func UnmarshalCollector(m map[string]json.RawMessage, result interface{}) (err e return } -// CollectorList : The response to a list collectors request. +// CollectorList : The response to a request to list collectors. type CollectorList struct { // The offset from the start of the list (0-based). Offset *int64 `json:"offset" validate:"required"` - // The number of items to return. + // The number of items that are returned. Limit *int64 `json:"limit" validate:"required"` - // The total number of items in the list. This will have value as 0 when no collectors are available and below values - // will not be populated in that case. + // The total number of items that are in the list. The field's value is 0 when no collectors are available and the + // details are not populated in that case. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -2873,7 +2891,7 @@ type CollectorList struct { // The URL of a page. Previous *PageLink `json:"previous,omitempty"` - // The array of items returned. + // The array of items that are returned. Collectors []Collector `json:"collectors" validate:"required"` } @@ -2918,10 +2936,10 @@ func UnmarshalCollectorList(m map[string]json.RawMessage, result interface{}) (e // CollectorUpdate : The instance of the collector update. type CollectorUpdate struct { - // The user-friendly name of the collector. + // The display name of the collector. DisplayName *string `json:"display_name,omitempty"` - // The desciption of the collector. + // The description of the collector. Description *string `json:"description,omitempty"` } @@ -2950,7 +2968,7 @@ func (collectorUpdate *CollectorUpdate) AsPatch() (_patch map[string]interface{} return } -// Control : A scans summary controls. +// Control : A scan's summary controls. type Control struct { // The scan summary control ID. ID *string `json:"id,omitempty"` @@ -2962,12 +2980,12 @@ type Control struct { ExternalControlID *string `json:"external_control_id,omitempty"` // The scan profile name. - Desciption *string `json:"desciption,omitempty"` + Description *string `json:"description,omitempty"` - // The list of goals on the control. + // The list of goals that are on the control. Goals []Goal `json:"goals,omitempty"` - // A scans summary controls. + // A scan's summary controls. ResourceStatistics *ResourceStatistics `json:"resource_statistics,omitempty"` } @@ -2993,7 +3011,7 @@ func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err err if err != nil { return } - err = core.UnmarshalPrimitive(m, "desciption", &obj.Desciption) + err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { return } @@ -3020,7 +3038,7 @@ type ControlItem struct { // The external identifier number of the control. ExternalControlID *string `json:"external_control_id" validate:"required"` - // Mapped goals aganist the control identifier. + // The goals that are mapped against the control identifier. Goals []GoalItem `json:"goals" validate:"required"` } @@ -3047,15 +3065,15 @@ func UnmarshalControlItem(m map[string]json.RawMessage, result interface{}) (err return } -// ControlList : The details of controls for the given profile. +// ControlList : The details of the controls for the profile. type ControlList struct { // The offset of the page. Offset *int64 `json:"offset" validate:"required"` - // The number of profiles displayed per page. + // The number of profiles that are displayed per page. Limit *int64 `json:"limit" validate:"required"` - // The total number of profiles.If no profiles are available this will be 0 and below fields will not be populated. + // The total number of profiles. If no profiles are available, the count is 0 and the detail fields are not populated. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -3135,15 +3153,16 @@ type CreateCollectorOptions struct { // A unique name for your collector. Name *string `json:"name" validate:"required"` - // Determines whether the collector endpoint is accessible on a public network. If set to `true`, the collector - // connects to resources in your account over a public network. If set to `false`, the collector connects to resources - // by using a private IP that is accessible only through the IBM Cloud private network. + // The parameter `is_public` determines whether the collector endpoint is accessible on a public network. If set to + // `true`, the collector connects to resources that are in your account over a public network. If set to `false`, the + // collector connects to your resources by using a private IP that is accessible only through the IBM Cloud private + // network. IsPublic *bool `json:"is_public" validate:"required"` - // Determines whether the collector is an IBM or customer-managed virtual machine. Use `ibm` to allow Security and - // Compliance Center to create, install, and manage the collector on your behalf. The collector is installed in an - // OpenShift cluster and approved automatically for use. Use `customer` if you would like to install the collector by - // using your own virtual machine. For more information, check out the + // The parameter `managed_by` determines whether the collector is an IBM or customer-managed virtual machine. Use `ibm` + // to allow Security and Compliance Center to create, install, and manage the collector on your behalf. The collector + // is installed in an Red Hat OpenShift cluster and approved automatically for use. Use `customer` if you would like to + // install the collector by using your own virtual machine. For more information, check out the // [docs](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-collector). ManagedBy *string `json:"managed_by" validate:"required"` @@ -3154,7 +3173,7 @@ type CreateCollectorOptions struct { // key is used to securely store your credentials and prevent anyone from accessing them. Passphrase *string `json:"passphrase,omitempty"` - // Determines whether the collector has a Ubi image. + // The parameter `is_ubi_image` determines whether the collector has a UBI image. IsUbiImage *bool `json:"is_ubi_image,omitempty"` // Your IBM Cloud account ID. @@ -3169,10 +3188,10 @@ type CreateCollectorOptions struct { } // Constants associated with the CreateCollectorOptions.ManagedBy property. -// Determines whether the collector is an IBM or customer-managed virtual machine. Use `ibm` to allow Security and -// Compliance Center to create, install, and manage the collector on your behalf. The collector is installed in an -// OpenShift cluster and approved automatically for use. Use `customer` if you would like to install the collector by -// using your own virtual machine. For more information, check out the +// The parameter `managed_by` determines whether the collector is an IBM or customer-managed virtual machine. Use `ibm` +// to allow Security and Compliance Center to create, install, and manage the collector on your behalf. The collector is +// installed in an Red Hat OpenShift cluster and approved automatically for use. Use `customer` if you would like to +// install the collector by using your own virtual machine. For more information, check out the // [docs](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-collector). const ( CreateCollectorOptionsManagedByCustomerConst = "customer" @@ -3244,25 +3263,25 @@ func (options *CreateCollectorOptions) SetHeaders(param map[string]string) *Crea // CreateCredentialOptions : The CreateCredential options. type CreateCredentialOptions struct { - // Credentials status enabled/disbaled. + // The status of credentials is enabled or disabled. Enabled *bool `json:"enabled" validate:"required"` - // Credentials type. + // The type of credential. Type *string `json:"type" validate:"required"` - // Credentials name. + // The name of the credential. Name *string `json:"name" validate:"required"` - // Credentials description. + // The description of the credential. Description *string `json:"description" validate:"required"` - // Details the fields on the credential. This will change as per credential type selected. + // The details of the credential. The details change as the selected credential type varies. DisplayFields *NewCredentialDisplayFields `json:"display_fields" validate:"required"` - // Credential group details. + // The details of the credential group. Group *CredentialGroup `json:"group" validate:"required"` - // Purpose for which the credential is created. + // The purpose for which the credential is created. Purpose *string `json:"purpose" validate:"required"` // Your IBM Cloud account ID. @@ -3277,7 +3296,7 @@ type CreateCredentialOptions struct { } // Constants associated with the CreateCredentialOptions.Type property. -// Credentials type. +// The type of credential. const ( CreateCredentialOptionsTypeAwsCloudConst = "aws_cloud" CreateCredentialOptionsTypeAzureCloudConst = "azure_cloud" @@ -3286,11 +3305,12 @@ const ( CreateCredentialOptionsTypeKerberosWindowsConst = "kerberos_windows" CreateCredentialOptionsTypeMs365Const = "ms_365" CreateCredentialOptionsTypeOpenstackCloudConst = "openstack_cloud" + CreateCredentialOptionsTypeUserNamePemConst = "user_name_pem" CreateCredentialOptionsTypeUsernamePasswordConst = "username_password" ) // Constants associated with the CreateCredentialOptions.Purpose property. -// Purpose for which the credential is created. +// The purpose for which the credential is created. const ( CreateCredentialOptionsPurposeDiscoveryCollectionConst = "discovery_collection" CreateCredentialOptionsPurposeDiscoveryCollectionRemediationConst = "discovery_collection_remediation" @@ -3389,12 +3409,12 @@ type CreateScopeOptions struct { // The environment that the scope is targeted to. CredentialType *string `json:"credential_type" validate:"required"` - // Stores the value of Frequency. This is used in case of on-prem Scope if the user wants to schedule a discovery - // task.The unit is seconds. Example if a user wants to trigger discovery every hour, this value will be set to 3600. + // The frequency of the scope. `interval` is used with on-prem scope if the user wants to schedule a discovery task. + // The unit is seconds. For example, if a user wants to trigger discovery every hour, this value is set to 3600. Interval *int64 `json:"interval,omitempty"` - // Stores the value of Discovery Scheduled.This is used in case of on-prem Scope if the user wants to schedule a - // discovery task. + // The discovery scheduled for the scope. `is_discovery_scheduled` is used with on-prem scope if the user wants to + // schedule a discovery task. IsDiscoveryScheduled *bool `json:"is_discovery_scheduled,omitempty"` // Your IBM Cloud account ID. @@ -3558,47 +3578,47 @@ func (options *CreateValidationOptions) SetHeaders(param map[string]string) *Cre return options } -// Credential : gets the credential details. +// Credential : Get the credential details. type Credential struct { - // Credentials status enabled/disbaled. + // The status of the credential is enabled or disabled. Enabled *bool `json:"enabled" validate:"required"` - // Credentials ID. + // The credential's ID. ID *string `json:"id" validate:"required"` - // Credentials type. + // The credential's type. Type *string `json:"type" validate:"required"` - // Credentials name. + // The credential's name. Name *string `json:"name" validate:"required"` - // Credentials description. + // The credential's description. Description *string `json:"description" validate:"required"` - // Details the fields on the credential. This will change as per credential type selected. + // The details of the credential. The details change as the selected credential type changes. DisplayFields *CredentialDisplayFields `json:"display_fields" validate:"required"` - // ID of the user who created the credentials. + // The ID of the user who created the credentials. CreatedBy *string `json:"created_by" validate:"required"` - // The time that the credentials was created in UTC. + // The time of creation of the credentials in UTC. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The modified time that the credentials was modified in UTC. + // The modified time of the credentials in UTC. UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // ID of the user who modified the credentials. + // The ID of the user who modified the credentials. UpdatedBy *string `json:"updated_by" validate:"required"` - // Credential group details. + // The details of the credential group. Group *CredentialGroup `json:"group" validate:"required"` - // Purpose for which the credential is created. + // The purpose for which the credential is created. Purpose *string `json:"purpose" validate:"required"` } // Constants associated with the Credential.Type property. -// Credentials type. +// The credential's type. const ( CredentialTypeAwsCloudConst = "aws_cloud" CredentialTypeAzureCloudConst = "azure_cloud" @@ -3611,7 +3631,7 @@ const ( ) // Constants associated with the Credential.Purpose property. -// Purpose for which the credential is created. +// The purpose for which the credential is created. const ( CredentialPurposeDiscoveryCollectionConst = "discovery_collection" CredentialPurposeDiscoveryCollectionRemediationConst = "discovery_collection_remediation" @@ -3675,73 +3695,80 @@ func UnmarshalCredential(m map[string]json.RawMessage, result interface{}) (err return } -// CredentialDisplayFields : Details the fields on the credential. This will change as per credential type selected. +// CredentialDisplayFields : The details of the credential. The details change as the selected credential type changes. type CredentialDisplayFields struct { - // The IBM Cloud API Key. This is mandatory for IBM Credential Type. + // The IBM Cloud API key. The API key is mandatory when IBM is the credential type. IBMAPIKey *string `json:"ibm_api_key,omitempty"` - // AWS client Id.This is mandatory for AWS Cloud. + // The Amazon Web Services client ID. The client ID is mandatory when AWS Cloud is the credential type. AwsClientID *string `json:"aws_client_id,omitempty"` - // AWS client secret.This is mandatory for AWS Cloud. + // The Amazon Web Services client secret. The secret is mandatory when AWS Cloud is the credential type. AwsClientSecret *string `json:"aws_client_secret,omitempty"` - // AWS region. + // The Amazon Web Services region. The region is mandatory when AWS Cloud is the credential type. AwsRegion *string `json:"aws_region,omitempty"` // AWS arn value. AwsArn *string `json:"aws_arn,omitempty"` - // username of the user.This is mandatory for DataBase, Kerbros,OpenStack Credentials. + // The username of the user. The username is mandatory when the credential type is DataBase, Kerberos, or OpenStack. Username *string `json:"username,omitempty"` - // password of the user.This is mandatory for DataBase, Kerbros,OpenStack Credentials. + // The password of the user. The password is mandatory when the credential type is DataBase, Kerberos, or OpenStack. Password *string `json:"password,omitempty"` - // Azure client Id. This is mandatory for Azure Credential type. + // The Microsoft Azure client ID. The client ID is mandatory when Azure is the credential type. AzureClientID *string `json:"azure_client_id,omitempty"` - // Azure client secret.This is mandatory for Azure Credential type. + // The Microsoft Azure client secret. The secret is mandatory when Azure is the credential type. AzureClientSecret *string `json:"azure_client_secret,omitempty"` - // Azure subscription Id.This is mandatory for Azure Credential type. + // The Microsoft Azure subscription ID. The subscription ID is mandatory when Azure is the credential type. AzureSubscriptionID *string `json:"azure_subscription_id,omitempty"` - // Azure resource group. + // The Microsoft Azure resource group. The resource group is mandatory when Azure is the credential type. AzureResourceGroup *string `json:"azure_resource_group,omitempty"` - // Database name.This is mandatory for Database Credential type. + // The Database name. The name is mandatory when Database is the credential type. DatabaseName *string `json:"database_name,omitempty"` - // Kerberos windows auth type.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows auth type. The auth type is mandatory when Kerberos is the credential type. WinrmAuthtype *string `json:"winrm_authtype,omitempty"` - // Kerberos windows ssl.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows SSL. The SSL is mandatory when Kerberos is the credential type. WinrmUsessl *string `json:"winrm_usessl,omitempty"` - // Kerberos windows port.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows port. The port is mandatory when Kerberos is the credential type. WinrmPort *string `json:"winrm_port,omitempty"` - // The MS365 client Id.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 client ID. The client ID is mandatory when Microsoft 365 is the credential type. Ms365ClientID *string `json:"ms_365_client_id,omitempty"` - // The MS365 client secret.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 client secret. The secret is mandatory when Microsoft 365 is the credential type. Ms365ClientSecret *string `json:"ms_365_client_secret,omitempty"` - // The MS365 tenantId.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 tenant ID. The tenant ID is mandatory when Microsoft 365 is the credential type. Ms365TenantID *string `json:"ms_365_tenant_id,omitempty"` - // auth url of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The auth url of the OpenStack cloud. The auth url is mandatory when OpenStack is the credential type. AuthURL *string `json:"auth_url,omitempty"` - // Project name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The project name of the OpenStack cloud. The project name is mandatory when OpenStack is the credential type. ProjectName *string `json:"project_name,omitempty"` - // user domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The user domain name of the OpenStack cloud. The domain name is mandatory when OpenStack is the credential type. UserDomainName *string `json:"user_domain_name,omitempty"` - // project domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The project domain name of the OpenStack cloud. The project domain name is mandatory when OpenStack is the + // credential type. ProjectDomainName *string `json:"project_domain_name,omitempty"` + + // The user pem file name. + PemFileName *string `json:"pem_file_name,omitempty"` + + // The base64 encoded form of pem.Will be displayed a xxxxxx. + PemData *string `json:"pem_data,omitempty"` } // UnmarshalCredentialDisplayFields unmarshals an instance of CredentialDisplayFields from the specified map of raw messages. @@ -3835,16 +3862,24 @@ func UnmarshalCredentialDisplayFields(m map[string]json.RawMessage, result inter if err != nil { return } + err = core.UnmarshalPrimitive(m, "pem_file_name", &obj.PemFileName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "pem_data", &obj.PemData) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// CredentialGroup : Credential group details. +// CredentialGroup : The details of the credential group. type CredentialGroup struct { - // credential group id. + // The credential group ID. ID *string `json:"id" validate:"required"` - // passphase of the credential. + // The passphrase of the credential. Passphrase *string `json:"passphrase" validate:"required"` } @@ -3878,11 +3913,11 @@ type CredentialList struct { // The offset of the page. Offset *int64 `json:"offset" validate:"required"` - // The number of credentials displayed per page. + // The number of credentials that are displayed per page. Limit *int64 `json:"limit" validate:"required"` - // The total number of credentials in the list.This will be 0 if no credentials are available and below fields will not - // be populated in that case. + // The total number of credentials that are in the list. The number is 0 if no credentials are available and the detail + // fields of the credentials are not populated in that case. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -3897,7 +3932,7 @@ type CredentialList struct { // The URL of a page. Next *PageLink `json:"next,omitempty"` - // The details of a credentials. + // The details of a credential. Credentials []Credential `json:"credentials" validate:"required"` } @@ -3959,7 +3994,7 @@ func (resp *CredentialList) GetNextOffset() (*int64, error) { // DeleteCollectorOptions : The DeleteCollector options. type DeleteCollectorOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4006,7 +4041,7 @@ func (options *DeleteCollectorOptions) SetHeaders(param map[string]string) *Dele // DeleteCredentialOptions : The DeleteCredential options. type DeleteCredentialOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4053,7 +4088,7 @@ func (options *DeleteCredentialOptions) SetHeaders(param map[string]string) *Del // DeleteProfileOptions : The DeleteProfile options. type DeleteProfileOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4100,7 +4135,7 @@ func (options *DeleteProfileOptions) SetHeaders(param map[string]string) *Delete // DeleteScopeOptions : The DeleteScope options. type DeleteScopeOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4145,9 +4180,9 @@ func (options *DeleteScopeOptions) SetHeaders(param map[string]string) *DeleteSc return options } -// EventItem : Event. +// EventItem : Th event details. type EventItem struct { - // The eventId for the given scope . + // The event ID for the scope. ID *string `json:"id" validate:"required"` // The time that the event was created in UTC for this scope. @@ -4156,28 +4191,28 @@ type EventItem struct { // The time that the event was last updated in UTC for this scope. UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // Task type.This will have 2 values - fact_collection and discovery. + // The task type. The task type has two values (fact_collection and discovery). TaskType *string `json:"task_type" validate:"required"` - // The status of the event . + // The status of the event. Status *string `json:"status" validate:"required"` - // Indicates whether data is available for this event . + // Data is available for this event. DataAvailable *bool `json:"data_available" validate:"required"` - // The status of the event . + // The status of the event. StatusMessage *string `json:"status_message" validate:"required"` } // Constants associated with the EventItem.TaskType property. -// Task type.This will have 2 values - fact_collection and discovery. +// The task type. The task type has two values (fact_collection and discovery). const ( EventItemTaskTypeDiscoveryConst = "discovery" EventItemTaskTypeFactCollectionConst = "fact_collection" ) // Constants associated with the EventItem.Status property. -// The status of the event . +// The status of the event. const ( EventItemStatusAbortTaskRequestCompletedConst = "abort_task_request_completed" EventItemStatusAbortTaskRequestFailedConst = "abort_task_request_failed" @@ -4274,9 +4309,9 @@ func UnmarshalEventItem(m map[string]json.RawMessage, result interface{}) (err e return } -// EventList : Event list. +// EventList : The list of events. type EventList struct { - // Events for a given scope. + // The events for a given scope. Events []EventItem `json:"events,omitempty"` } @@ -4293,7 +4328,7 @@ func UnmarshalEventList(m map[string]json.RawMessage, result interface{}) (err e // GetCollectorOptions : The GetCollector options. type GetCollectorOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4340,8 +4375,8 @@ func (options *GetCollectorOptions) SetHeaders(param map[string]string) *GetColl // GetCorrelationIDOptions : The GetCorrelationID options. type GetCorrelationIDOptions struct { - // A correlation_Id is created when a scope is created and discovery task is triggered or when a validation is - // triggered on a Scope. This is used to get the status of the task(discovery or validation). + // Get the status of a task such as discovery or validation. A correlation ID is created when a scope is created and + // discovery or validation is triggered for a scope. CorrelationID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4388,7 +4423,7 @@ func (options *GetCorrelationIDOptions) SetHeaders(param map[string]string) *Get // GetCredentialOptions : The GetCredential options. type GetCredentialOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4435,8 +4470,8 @@ func (options *GetCredentialOptions) SetHeaders(param map[string]string) *GetCre // GetGroupProfileControlsOptions : The GetGroupProfileControls options. type GetGroupProfileControlsOptions struct { - // The group ID. This can be obtained from Profile list API call. In Profile list API call, the records which have - // type='profile_group' are the groups. The Id of that object gives group_id. + // The group ID. The ID can be obtained from the profile list API call. In the profile list API call, the records that + // have type='profile_group' are the groups. The ID of that object displays group_id. GroupID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4501,7 +4536,7 @@ func (options *GetGroupProfileControlsOptions) SetHeaders(param map[string]strin // GetProfileControlsOptions : The GetProfileControls options. type GetProfileControlsOptions struct { - // The profile ID. This can be obtained from the Security and Compliance Center UI by clicking on the profile name. The + // The profile ID. The ID can be obtained from the Security and Compliance Center UI by clicking the profile name. The // URL contains the ID. ProfileID *string `json:"-" validate:"required,ne="` @@ -4567,10 +4602,10 @@ func (options *GetProfileControlsOptions) SetHeaders(param map[string]string) *G // GetProfileOptions : The GetProfile options. type GetProfileOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` - // The profile type ID. This will be 4 for profiles and 6 for group profiles. + // The profile type name. The name can be authored/custom/predefined for profiles and profile_group for group profiles. ProfileType *string `json:"-" validate:"required"` // Your IBM Cloud account ID. @@ -4584,6 +4619,15 @@ type GetProfileOptions struct { Headers map[string]string } +// Constants associated with the GetProfileOptions.ProfileType property. +// The profile type name. The name can be authored/custom/predefined for profiles and profile_group for group profiles. +const ( + GetProfileOptionsProfileTypeAuthoredConst = "authored" + GetProfileOptionsProfileTypeCustomConst = "custom" + GetProfileOptionsProfileTypePredefinedConst = "predefined" + GetProfileOptionsProfileTypeProfileGroupConst = "profile_group" +) + // NewGetProfileOptions : Instantiate GetProfileOptions func (*PostureManagementV2) NewGetProfileOptions(id string, profileType string) *GetProfileOptions { return &GetProfileOptions{ @@ -4718,7 +4762,7 @@ func (options *GetScopeDetailsCredentialsOptions) SetHeaders(param map[string]st // GetScopeDetailsOptions : The GetScopeDetails options. type GetScopeDetailsOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // Your IBM Cloud account ID. @@ -4810,7 +4854,7 @@ func (options *GetScopeTimelineOptions) SetHeaders(param map[string]string) *Get return options } -// Goal : The goals on goals list. +// Goal : The goals that are on the goals list. type Goal struct { // The description of the goal. Description *string `json:"description,omitempty"` @@ -4824,10 +4868,10 @@ type Goal struct { // The severity of the goal. Severity *string `json:"severity,omitempty"` - // The report completed time. + // The report's time of completion. CompletedTime *strfmt.DateTime `json:"completed_time,omitempty"` - // The error on goal validation. + // The error that occurred on goal validation. Error *string `json:"error,omitempty"` // The list of resource results. @@ -4891,10 +4935,10 @@ type GoalApplicabilityCriteria struct { // A list of resources that a profile can be used with. Resource []string `json:"resource,omitempty"` - // The type of environment that a profile is able to be applied to. + // The type of environment that a profile can be applied to. EnvironmentCategory []string `json:"environment_category,omitempty"` - // The type of resource that a profile is able to be applied to. + // The type of resource that a profile can be applied to. ResourceCategory []string `json:"resource_category,omitempty"` // The resource type that the profile applies to. @@ -4918,7 +4962,7 @@ type GoalApplicabilityCriteria struct { // The type of resource that your scope is targeted to. ResourceCategoryDescription map[string]string `json:"resource_category_description,omitempty"` - // A further classification of the type of resource that your scope is targeted to. + // The type of resource that your scope is targeted to. ResourceTypeDescription map[string]string `json:"resource_type_description,omitempty"` // The resource that is scanned as part of your scope. @@ -4984,7 +5028,7 @@ func UnmarshalGoalApplicabilityCriteria(m map[string]json.RawMessage, result int return } -// GoalItem : The goals on goals list. +// GoalItem : The details of the goal. type GoalItem struct { // The description of the goal. Description *string `json:"description" validate:"required"` @@ -4995,7 +5039,7 @@ type GoalItem struct { // The severity of the goal. Severity *string `json:"severity" validate:"required"` - // The goal is manual check. + // The goal is manually checked. IsManual *bool `json:"is_manual" validate:"required"` // The goal is remediable or not. @@ -5331,77 +5375,84 @@ func (options *ListScopesOptions) SetHeaders(param map[string]string) *ListScope return options } -// NewCredentialDisplayFields : Details the fields on the credential. This will change as per credential type selected. +// NewCredentialDisplayFields : The details of the credential. The details change as the selected credential type varies. type NewCredentialDisplayFields struct { - // The IBM Cloud API Key. This is mandatory for IBM Credential Type ie when type=ibm_cloud. + // The IBM Cloud API Key. The API key is mandatory when IBM is selected as the credential type. IBMAPIKey *string `json:"ibm_api_key,omitempty"` - // AWS client Id.This is mandatory for AWS Cloud ie when type=aws_cloud. + // The Amazon Web Services client ID. The client ID is mandatory when AWS Cloud is selected as the credential type. AwsClientID *string `json:"aws_client_id,omitempty"` - // AWS client secret.This is mandatory for AWS Cloud ie when type=aws_cloud. + // The Amazon Web Services client secret. The client secret is mandatory when AWS Cloud is selected as the credential + // type. AwsClientSecret *string `json:"aws_client_secret,omitempty"` - // AWS region.This is used for AWS Cloud ie when type=aws_cloud. + // The Amazon Web Services region. The region is used when AWS Cloud is selected as the credential type. AwsRegion *string `json:"aws_region,omitempty"` - // AWS arn value.This is used for AWS Cloud ie when type=aws_cloud. + // The Amazon Web Services arn value. The arn value is used when AWS Cloud is selected as the credential type. AwsArn *string `json:"aws_arn,omitempty"` - // username of the user.This is mandatory for DataBase(ie type=database), Kerbros(ie - // type=kerberos_windows),OpenStack(ie type=openstack_cloud) and Username-Password(type=username_password) Credentials. + // The username of the user. The username is mandatory when the credential type is DataBase, Kerberos, OpenStack, and + // Username-Password. Username *string `json:"username,omitempty"` - // password of the user.This is mandatory for DataBase(ie type=database), Kerbros(ie - // type=kerberos_windows),OpenStack(ie type=openstack_cloud) and Username-Password(type=username_password) Credentials. + // The password of the user. The password is mandatory when the credential type is DataBase, Kerberos, OpenStack, and + // Username-Password. Password *string `json:"password,omitempty"` - // Azure client Id. This is mandatory for Azure Credential type ie when type=azure_cloud. + // The Microsoft Azure client ID. The client ID is mandatory when Azure is selected as the credential type. AzureClientID *string `json:"azure_client_id,omitempty"` - // Azure client secret.This is mandatory for Azure Credential type ie when type=azure_cloud. + // The Microsoft Azure client secret. The secret is mandatory when the type of credential is set to Azure. AzureClientSecret *string `json:"azure_client_secret,omitempty"` - // Azure subscription Id.This is mandatory for Azure Credential type ie when type=azure_cloud. + // The Microsoft Azure subscription ID. The subscription ID is mandatory when the type of credential is set to Azure. AzureSubscriptionID *string `json:"azure_subscription_id,omitempty"` - // Azure resource group.This field is used for Azure Credential type ie when type=azure_cloud. + // The Microsoft Azure resource group. The resource group is used when Azure is the credential type. AzureResourceGroup *string `json:"azure_resource_group,omitempty"` - // Database name.This is mandatory for Database Credential type ie when type=database. + // The database name. The database name is mandatory when Database is the credential type. DatabaseName *string `json:"database_name,omitempty"` - // Kerberos windows auth type.This is mandatory for Windows Kerberos Credential type ie when type=kerberos_windows. + // The Kerberos Windows authentication type. The authentication type is mandatory when the credential type is Kerberos + // Windows. WinrmAuthtype *string `json:"winrm_authtype,omitempty"` - // Kerberos windows ssl.This is mandatory for Windows Kerberos Credential type ie when type=kerberos_windows. + // The Kerberos Windows SSL. The SSL is mandatory when the credential type is Kerberos Windows. WinrmUsessl *string `json:"winrm_usessl,omitempty"` - // Kerberos windows port.This is mandatory for Windows Kerberos Credential type ie when type=kerberos_windows. + // The Kerberos Windows port. The port is mandatory When Kerberos Windows is the credential type. WinrmPort *string `json:"winrm_port,omitempty"` - // The MS365 client Id.This is mandatory for Windows MS365 Credential type ie when type=ms_365. + // The Microsoft 365 client ID. The client ID is mandatory when Microsoft 365 is the credential type. Ms365ClientID *string `json:"ms_365_client_id,omitempty"` - // The MS365 client secret.This is mandatory for Windows MS365 Credential type ie when type=ms_365. + // The Microsoft 365 client secret. The secret is mandatory when Microsoft 365 is the credential type. Ms365ClientSecret *string `json:"ms_365_client_secret,omitempty"` - // The MS365 tenantId.This is mandatory for Windows MS365 Credential type ie when type=ms_365. + // The Microsoft 365 tenant ID. The tenant ID is mandatory when Microsoft 365 is the credential type. Ms365TenantID *string `json:"ms_365_tenant_id,omitempty"` - // auth url of the Open Stack cloud.This is mandatory for Open Stack Credential type ie when type=openstack_cloud. + // The auth url of the OpenStack cloud. The auth url is mandatory when OpenStack is the credential type. AuthURL *string `json:"auth_url,omitempty"` - // Project name of the Open Stack cloud.This is mandatory for Open Stack Credential type ie when type=openstack_cloud. + // The project name of the OpenStack cloud. The project name is mandatory when OpenStack is the credential type. ProjectName *string `json:"project_name,omitempty"` - // user domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type ie when - // type=openstack_cloud. + // The user domain name of the OpenStack cloud. The domain name is mandatory when OpenStack is the credential type. UserDomainName *string `json:"user_domain_name,omitempty"` - // project domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type ie when - // type=openstack_cloud. + // The project domain name of the OpenStack cloud. The project domain name is mandatory when OpenStack is the + // credential type. ProjectDomainName *string `json:"project_domain_name,omitempty"` + + // The user pem file name. + PemFileName *string `json:"pem_file_name,omitempty"` + + // The base64 encoded form of pem. + PemData *string `json:"pem_data,omitempty"` } // UnmarshalNewCredentialDisplayFields unmarshals an instance of NewCredentialDisplayFields from the specified map of raw messages. @@ -5495,6 +5546,14 @@ func UnmarshalNewCredentialDisplayFields(m map[string]json.RawMessage, result in if err != nil { return } + err = core.UnmarshalPrimitive(m, "pem_file_name", &obj.PemFileName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "pem_data", &obj.PemData) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -5533,7 +5592,7 @@ type Profile struct { // The user who last modified the profile. ModifiedBy *string `json:"modified_by" validate:"required"` - // A reason that you want to delete a profile. + // A reason why you want to delete a profile. ReasonForDelete *string `json:"reason_for_delete" validate:"required"` // The criteria that defines how a profile applies. @@ -5564,6 +5623,7 @@ type Profile struct { // Constants associated with the Profile.Type property. // The type of profile. const ( + ProfileTypeAuthoredConst = "authored" ProfileTypeCustomConst = "custom" ProfileTypePredefinedConst = "predefined" ProfileTypeTemplateGroupConst = "template_group" @@ -5679,8 +5739,7 @@ type ProfileList struct { // The number of profiles displayed per page. Limit *int64 `json:"limit" validate:"required"` - // The total number of profiles. This value is 0 if no profiles are available and below fields will not be available in - // that case. + // The total number of profiles. If no profiles are available, the value of this field is 0. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -5763,17 +5822,17 @@ type ProfileResult struct { // The name of the profile. Name *string `json:"name" validate:"required"` - // The type of profile. To learn more about profile types, check out the [docs] - // (https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-profiles). + // The type of profile. To learn more about profile types, check out the + // [docs](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-profiles). Type *string `json:"type" validate:"required"` - // The result of a scan.The above values will not be avaialble if no scopes are available. + // The result of a scan. The controls values are not available if no scopes are available. ValidationResult *ScanResult `json:"validation_result" validate:"required"` } // Constants associated with the ProfileResult.Type property. -// The type of profile. To learn more about profile types, check out the [docs] -// (https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-profiles). +// The type of profile. To learn more about profile types, check out the +// [docs](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-profiles). const ( ProfileResultTypeAuthoredConst = "authored" ProfileResultTypeCustomConst = "custom" @@ -5812,7 +5871,7 @@ type ReplaceScopeDetailsCollectorOptions struct { // The unique identifier that is used to trace an entire Scope request. ScopeID *string `json:"-" validate:"required,ne="` - // Stores the value of collector_ids . + // The collector IDs of the scope. CollectorIds []string `json:"collector_ids" validate:"required"` // Your IBM Cloud account ID. @@ -5869,10 +5928,10 @@ type ReplaceScopeDetailsCredentialsOptions struct { // The unique identifier that is used to trace an entire Scope request. ScopeID *string `json:"-" validate:"required,ne="` - // Stores the value of credentialId . + // The credential ID of the scope. CredentialID *string `json:"credential_id" validate:"required"` - // Stores the value of credential_attribute . + // The credential attribute of the scope. CredentialAttribute *string `json:"credential_attribute,omitempty"` // Your IBM Cloud account ID. @@ -5938,7 +5997,7 @@ type ResourceResult struct { // The resource type. Types *string `json:"types,omitempty"` - // The resource control result status. + // The result status of resource control. Status *string `json:"status,omitempty"` // The expected results of a resource. @@ -5950,12 +6009,12 @@ type ResourceResult struct { // The results information. ResultsInfo *string `json:"results_info,omitempty"` - // The reason for goal not applicable for a resource. + // The reason why a goal is not applicable to a resource. NotApplicableReason *string `json:"not_applicable_reason,omitempty"` } // Constants associated with the ResourceResult.Status property. -// The resource control result status. +// The result status of resource control. const ( ResourceResultStatusPassConst = "pass" ResourceResultStatusUnableToPerformConst = "unable_to_perform" @@ -5996,7 +6055,7 @@ func UnmarshalResourceResult(m map[string]json.RawMessage, result interface{}) ( return } -// ResourceStatistics : A scans summary controls. +// ResourceStatistics : A scan's summary controls. type ResourceStatistics struct { // The resource count of pass controls. PassCount *int64 `json:"pass_count,omitempty"` @@ -6007,7 +6066,7 @@ type ResourceStatistics struct { // The number of resources that were unable to be scanned against a control. UnableToPerformCount *int64 `json:"unable_to_perform_count,omitempty"` - // The resource count of not applicable(na) controls. + // The resource count of controls that are not applicable. NotApplicableCount *int64 `json:"not_applicable_count,omitempty"` } @@ -6063,7 +6122,7 @@ type ScanItem struct { // The ID of the scan. ScanID *string `json:"scan_id" validate:"required"` - // A system generated name that is the combination of 12 characters in the scope name and 12 characters of a profile + // A system-generated name that is the combination of 12 characters in the scope name and 12 characters of a profile // name. ScanName *string `json:"scan_name" validate:"required"` @@ -6088,13 +6147,13 @@ type ScanItem struct { // The date and time the scan was run. StartTime *strfmt.DateTime `json:"start_time" validate:"required"` - // The unique ID for Scan that is created. + // The unique ID for the scan that is created. ReportSettingID *string `json:"report_setting_id,omitempty"` - // The date and time the scan completed. + // The date and time when the scan completed. EndTime *strfmt.DateTime `json:"end_time" validate:"required"` - // The result of a scan.The above values will not be avaialble if no scopes are available. + // The result of a scan. The controls values are not available if no scopes are available. Result *ScanResult `json:"result" validate:"required"` } @@ -6158,11 +6217,11 @@ type ScanList struct { // The offset of the page. Offset *int64 `json:"offset" validate:"required"` - // The number of scans displayed per page. + // The number of scans that are displayed per page. Limit *int64 `json:"limit" validate:"required"` - // The total number of scans in the list. This value will be 0 when no scans are available and below fields will not be - // displayed in taht case. + // The total number of scans that are in the list. This value is 0 when no scans are available and the detail fields + // are not displayed in that case. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -6237,13 +6296,13 @@ func (resp *ScanList) GetNextOffset() (*int64, error) { return core.Int64Ptr(offsetValue), nil } -// ScanResult : The result of a scan.The above values will not be avaialble if no scopes are available. +// ScanResult : The result of a scan. The controls values are not available if no scopes are available. type ScanResult struct { // The number of goals that passed the scan. GoalsPassCount *int64 `json:"goals_pass_count" validate:"required"` - // The number of goals that could not be validated. A control is listed as 'Unable to perform' when information about - // its associated resource can't be collected. + // The number of goals that can't be validated. A control is listed as 'Unable to perform' when information about its + // associated resource can't be collected. GoalsUnableToPerformCount *int64 `json:"goals_unable_to_perform_count" validate:"required"` // The number of goals that are not relevant to the current scan. A scan is listed as 'Not applicable' when information @@ -6266,11 +6325,11 @@ type ScanResult struct { // information about its associated resource can't be found. ControlsNotApplicableCount *int64 `json:"controls_not_applicable_count" validate:"required"` - // The number of controls that could not be validated. A control is listed as 'Unable to perform' when information - // about its associated resource can't be collected. + // The number of controls that can't be validated. A control is listed as 'Unable to perform' when information about + // its associated resource can't be collected. ControlsUnableToPerformCount *int64 `json:"controls_unable_to_perform_count" validate:"required"` - // The total number of controls that were included in the scan. + // The total number of controls that are included in the scan. ControlsTotalCount *int64 `json:"controls_total_count" validate:"required"` } @@ -6323,7 +6382,7 @@ func UnmarshalScanResult(m map[string]json.RawMessage, result interface{}) (err // ScanSummariesOptions : The ScanSummaries options. type ScanSummariesOptions struct { - // The report setting ID. This can be obtained from the /validations/latest_scans API call. + // The report setting ID. The ID can be obtained from the /validations/latest_scans API call. ReportSettingID *string `json:"-" validate:"required"` // Your IBM Cloud account ID. @@ -6391,7 +6450,7 @@ type ScansSummaryOptions struct { // Your Scan ID. ScanID *string `json:"-" validate:"required,ne="` - // The profile ID. This can be obtained from the Security and Compliance Center UI by clicking on the profile name. The + // The profile ID. The ID can be obtained from the Security and Compliance Center UI by clicking the profile name. The // URL contains the ID. ProfileID *string `json:"-" validate:"required"` @@ -6444,147 +6503,147 @@ func (options *ScansSummaryOptions) SetHeaders(param map[string]string) *ScansSu return options } -// Scope : Stores the value of ScopeDetails . +// Scope : Get the details of the scope. type Scope struct { - // Stores the value of scope_id . + // The ID of the scope. ID *string `json:"id" validate:"required"` - // Stores the value of scope_name . + // The name of the scope. Name *string `json:"name" validate:"required"` - // Stores the value of scope_uuid .Will be displayed only when value exists. + // The UUID of the scope. The unique user ID is displayed only when the value exists. UUID *string `json:"uuid,omitempty"` - // Stores the value of partner_uuid .Will be displayed only when value exists. + // The partner_uuid of the scope. The ID is displayed only when the value exists. PartnerUUID *string `json:"partner_uuid,omitempty"` - // Stores the value of scope_description .Will be displayed only when value exists. + // The description of the scope. The description is displayed only when the value exists. Description *string `json:"description,omitempty"` - // Stores the value of scope_org_id .Will be displayed only when value exists. + // The organization ID of the scope. The organization ID is displayed only when the value exists. OrgID *int64 `json:"org_id,omitempty"` - // Stores the value of scope_cloud_type_id .Will be displayed only when value exists. + // The cloud type ID of the scope. The ID is displayed only when the value exists. CloudTypeID *int64 `json:"cloud_type_id,omitempty"` - // Stores the value of scope_tld_credential_id .Will be displayed only when value exists. + // The credential ID of the scope. The ID is displayed only when the value exists. TldCredentialID *int64 `json:"tld_credential_id,omitempty"` - // Stores the value of scope_status .Will be displayed only when value exists. + // The status of the scope. The status is displayed only when the value exists. Status *string `json:"status,omitempty"` - // Stores the value of scope_status_msg .Will be displayed only when value exists. + // The status message of the scope. The message is displayed only when the value exists. StatusMsg *string `json:"status_msg,omitempty"` - // Stores the value of scope_subset_selected .Will be displayed only when value exists. + // The subset-selected field of the scope. The field is displayed only when the value exists. SubsetSelected *bool `json:"subset_selected,omitempty"` - // Stores the value of scope_enabled .Will be displayed only when value exists. + // The enabled field of the scope. The field is displayed only when the value exists. Enabled *bool `json:"enabled,omitempty"` - // Stores the value of scope_last_discover_start_time .Will be displayed only when value exists. + // The last discover start time of the scope. The time is displayed only when the value exists. LastDiscoverStartTime *string `json:"last_discover_start_time,omitempty"` - // Stores the value of scope_last_discover_completed_time .Will be displayed only when value exists. + // The last discover completed time of the scope. The time is displayed only when the value exists. LastDiscoverCompletedTime *string `json:"last_discover_completed_time,omitempty"` - // Stores the value of scope_last_successful_discover_start_time .Will be displayed only when value exists. + // The last successful discover start time of the scope. The time is displayed only when the value exists. LastSuccessfulDiscoverStartTime *string `json:"last_successful_discover_start_time,omitempty"` - // Stores the value of scope_last_successful_discover_completed_time .Will be displayed only when value exists. + // The last successful discover completed time of the scope. The time is displayed only when the value exists. LastSuccessfulDiscoverCompletedTime *string `json:"last_successful_discover_completed_time,omitempty"` - // Stores the value of scope_task_type .Will be displayed only when value exists. + // The task type of the scope. The task type is displayed only when the value exists. TaskType *string `json:"task_type,omitempty"` - // Stores the value of scope_tasks .Will be displayed only when value exists. + // The tasks of the scope. The tasks are displayed only when the value exists. Tasks []ScopeDetailsGatewayTask `json:"tasks,omitempty"` - // Stores the value of scope_status_updated_time .Will be displayed only when value exists. + // The status updated time of the scope. The time is displayed only when the value exists. StatusUpdatedTime *string `json:"status_updated_time,omitempty"` - // Stores the value of collectors_by_type .Will be displayed only when value exists. + // The collectors by type of the scope. The collectors are displayed only when the values exist. CollectorsByType map[string][]Collector `json:"collectors_by_type,omitempty"` - // Stores the value of scope_credentials_by_type .Will be displayed only when value exists. + // The credentials by type of the scope. The credentials are displayed only when the values exist. CredentialsByType map[string][]ScopeDetailsCredential `json:"credentials_by_type,omitempty"` - // Stores the value of scope_credentials_by_sub_categeory_type .Will be displayed only when value exists. + // The credentials by sub category type of the scope. The credentials are displayed only when the values exist. CredentialsBySubCategeoryType map[string][]ScopeDetailsCredential `json:"credentials_by_sub_categeory_type,omitempty"` - // Stores the value of scope_sub_categories_by_type .Will be displayed only when value exists. + // The sub categories by type of the scope. The categories are displayed only when the values exist. SubCategoriesByType map[string][]string `json:"sub_categories_by_type,omitempty"` - // Stores the value of scope_resource_groups .Will be displayed only when value exists. + // The resource groups of the scope. The resource groups are displayed only when the values exist. ResourceGroups *string `json:"resource_groups,omitempty"` - // Stores the value of scope_region_names .Will be displayed only when value exists. + // The region names of the scope. The names are displayed only when the values exist. RegionNames *string `json:"region_names,omitempty"` - // Stores the value of scope_cloud_type .Will be displayed only when value exists. + // The cloud type of the scope. The cloud type is displayed only when the value exists. CloudType *string `json:"cloud_type,omitempty"` - // Stores the value of scope_env_sub_category .Will be displayed only when value exists. + // The env sub category of the scope. The category is displayed only when the value exists. EnvSubCategory *string `json:"env_sub_category,omitempty"` - // Stores the value of ScopeDetailsCredential . + // The credential details of the scope. TldCredentail *ScopeDetailsCredential `json:"tld_credentail,omitempty"` - // Stores the value of collectors .Will be displayed only when value exists. + // The collectors of the scope. The collectors are displayed only when the values exist. Collectors []Collector `json:"collectors,omitempty"` - // Stores the value of scope_first_level_scoped_data .Will be displayed only when value exists. + // The first-level scoped data of the scope. The data is displayed only when the value exists. FirstLevelScopedData []ScopeDetailsAssetData `json:"first_level_scoped_data,omitempty"` - // Stores the value of scope_discovery_methods .Will be displayed only when value exists. + // The discovery methods of the scope. The methods are displayed only when the values exist. DiscoveryMethods []string `json:"discovery_methods,omitempty"` - // Stores the value of scope_discovery_method .Will be displayed only when value exists. + // The discovery method of the scope. The method is displayed only when the value exists. DiscoveryMethod *string `json:"discovery_method,omitempty"` - // Stores the value of scope_file_type .Will be displayed only when value exists. + // The file type of the scope. The type is displayed only when the value exists. FileType *string `json:"file_type,omitempty"` - // Stores the value of scope_file_format .Will be displayed only when value exists. + // The file format of the scope. The format is displayed only when the value exists. FileFormat *string `json:"file_format,omitempty"` - // Stores the value of scope_created_by .Will be displayed only when value exists. + // The user who created the scope. The user is displayed only when the value exists. CreatedBy *string `json:"created_by,omitempty"` - // Stores the value of scope_created_on .Will be displayed only when value exists. + // The date of creation of the scope. The date is displayed only when the value exists. CreatedAt *string `json:"created_at,omitempty"` - // Stores the value of scope_modified_by .Will be displayed only when value exists. + // The user who modified the scope. The user is displayed only when the value exists. ModifiedBy *string `json:"modified_by,omitempty"` - // Stores the value of scope_modified_on .Will be displayed only when value exists. + // The modified date of the scope. The date is displayed only when the value exists. ModifiedAt *string `json:"modified_at,omitempty"` - // Stores the value of scope_is_discovery_scheduled .Will be displayed only when value exists. + // The scheduled discovery configuration of the scope. The data is displayed only when the value exists. IsDiscoveryScheduled *bool `json:"is_discovery_scheduled,omitempty"` - // Stores the value of scope_freq .Will be displayed only when value exists. + // The interval of the scope. The interval is displayed only when the value exists. Interval *int64 `json:"interval,omitempty"` - // Stores the value of scope_discovery_setting_id .Will be displayed only when value exists. + // The discovery setting ID of the scope. The ID is displayed only when the value exists. DiscoverySettingID *int64 `json:"discovery_setting_id,omitempty"` - // Stores the value of scope_include_new_eagerly .Will be displayed only when value exists. + // The `include_new_eagerly` of the scope. The data is displayed only when the value exists. IncludeNewEagerly *bool `json:"include_new_eagerly,omitempty"` - // Stores the value of scope_type .Will be displayed only when value exists. + // The type of the scope. The type is displayed only when the value exists. Type *string `json:"type,omitempty"` - // A correlation_Id is created when a scope is created and discovery task is triggered or when a validation is - // triggered on a Scope. This is used to get the status of the task(discovery or validation). + // Get the status of a task such as discovery or validation. A correlation ID is created when a scope is created and + // discovery or validation is triggered for a scope. CorrelationID *string `json:"correlation_id,omitempty"` - // Stores the value of scope_credential_attributes .Will be displayed only when value exists. + // The credential attributes of the scope. The attributes are displayed only when the value exists. CredentialAttributes *string `json:"credential_attributes,omitempty"` } // Constants associated with the Scope.Status property. -// Stores the value of scope_status .Will be displayed only when value exists. +// The status of the scope. The status is displayed only when the value exists. const ( ScopeStatusAbortTaskRequestCompletedConst = "abort_task_request_completed" ScopeStatusAbortTaskRequestFailedConst = "abort_task_request_failed" @@ -6648,7 +6707,7 @@ const ( ) // Constants associated with the Scope.TaskType property. -// Stores the value of scope_task_type .Will be displayed only when value exists. +// The task type of the scope. The task type is displayed only when the value exists. const ( ScopeTaskTypeAborttasksConst = "aborttasks" ScopeTaskTypeCertRegularValidationConst = "cert_regular_validation" @@ -6670,13 +6729,13 @@ const ( ) // Constants associated with the Scope.SubCategoriesByType property. -// Stores the value of scope_sub_categories_by_type .Will be displayed only when value exists. +// The sub categories by type of the scope. The categories are displayed only when the values exist. const ( ScopeSubCategoriesByTypeMs365Const = "ms_365" ) // Constants associated with the Scope.Type property. -// Stores the value of scope_type .Will be displayed only when value exists. +// The type of the scope. The type is displayed only when the value exists. const ( ScopeTypeInventoryConst = "inventory" ScopeTypeValidationConst = "validation" @@ -6869,9 +6928,9 @@ func UnmarshalScope(m map[string]json.RawMessage, result interface{}) (err error return } -// ScopeCollector : Stores the value of Scope Collector Details . +// ScopeCollector : The collector details of the scope. type ScopeCollector struct { - // Stores the value of collector_ids . + // The collector IDs of the scope. CollectorIds []string `json:"collector_ids" validate:"required"` } @@ -6895,12 +6954,12 @@ func UnmarshalScopeCollector(m map[string]json.RawMessage, result interface{}) ( return } -// ScopeCredential : Stores the value of Scope Credential . +// ScopeCredential : The details of the scope credential. type ScopeCredential struct { - // Stores the value of credential_attribute . + // The credential attribute of the scope. CredentialAttribute *string `json:"credential_attribute,omitempty"` - // Stores the value of credentialId . + // The credential ID of the scope. CredentialID *string `json:"credential_id" validate:"required"` } @@ -6928,69 +6987,69 @@ func UnmarshalScopeCredential(m map[string]json.RawMessage, result interface{}) return } -// ScopeDetailsAssetData : Stores the value of ScopeDetailsAssetData. +// ScopeDetailsAssetData : The asset data details of the scope. type ScopeDetailsAssetData struct { - // Stores the value of scope_object . + // The asset object of the scope. ScopeObject *string `json:"scope_object,omitempty"` - // Stores the value of scope_init_scope . + // The initial value of the scope. ScopeInitScope *string `json:"scope_init_scope,omitempty"` - // Stores the value of scope . + // The asset of the scope. Scope *string `json:"scope,omitempty"` - // Stores the value of scope_changed . + // The changed value of the scope. ScopeChanged *bool `json:"scope_changed,omitempty"` - // Stores the value of scope_id . + // The ID of the scope. ScopeID *string `json:"scope_id,omitempty"` - // Stores the value of scope_properties . + // The properties of the scope. ScopeProperties *string `json:"scope_properties,omitempty"` - // Stores the value of scope_overlay . + // The overlay of the scope. ScopeOverlay *string `json:"scope_overlay,omitempty"` - // Stores the value of scope_new_found . + // The newfound value of the scope. ScopeNewFound *bool `json:"scope_new_found,omitempty"` - // Stores the value of scope_discovery_status . + // The discovery status of the scope. ScopeDiscoveryStatus interface{} `json:"scope_discovery_status,omitempty"` - // Stores the value of scope_fact_status . + // The fact status of the scope. ScopeFactStatus interface{} `json:"scope_fact_status,omitempty"` - // Stores the value of scope_facts . + // The facts of the scope. ScopeFacts *string `json:"scope_facts,omitempty"` - // Stores the value of scope_list_members . + // The list members of the scope. ScopeListMembers interface{} `json:"scope_list_members,omitempty"` - // Stores the value of scope_children . + // The children of the scope. ScopeChildren interface{} `json:"scope_children,omitempty"` - // Stores the value of scope_resource_category . + // The resource category of the scope. ScopeResourceCategory *string `json:"scope_resource_category,omitempty"` - // Stores the value of scope_resource_type . + // The resource type of the scope. ScopeResourceType *string `json:"scope_resource_type,omitempty"` - // Stores the value of scope_resource . + // The resource of the scope. ScopeResource *string `json:"scope_resource,omitempty"` - // Stores the value of scope_resource_attributes . + // The resource attributes of the scope. ScopeResourceAttributes interface{} `json:"scope_resource_attributes,omitempty"` - // Stores the value of scope_drift . + // The drift of the scope. ScopeDrift *string `json:"scope_drift,omitempty"` - // Stores the value of scope_parse_status . + // The parse status of the scope. ScopeParseStatus *string `json:"scope_parse_status,omitempty"` - // Stores the value of scope_transformed_facts . + // The transformed facts of the scope. ScopeTransformedFacts interface{} `json:"scope_transformed_facts,omitempty"` - // Stores the value of scope_collector_id . + // The collector ID of the scope. ScopeCollectorID *int64 `json:"scope_collector_id,omitempty"` } @@ -7085,48 +7144,48 @@ func UnmarshalScopeDetailsAssetData(m map[string]json.RawMessage, result interfa return } -// ScopeDetailsCredential : Stores the value of ScopeDetailsCredential . +// ScopeDetailsCredential : The credential details of the scope. type ScopeDetailsCredential struct { - // Stores the value of credential_id . + // The credential ID of the scope. ID *string `json:"id,omitempty"` - // Stores the value of credential_name . + // The credential name of the scope. Name *string `json:"name,omitempty"` - // Stores the value of credential_uuid . + // The credential uuid of the scope. UUID *string `json:"uuid,omitempty"` - // Stores the value of credential_type . + // The credential type of the scope. Type *string `json:"type,omitempty"` - // Stores the value of credential_data . + // The credential data of the scope. Data interface{} `json:"data,omitempty"` - // Details the fields on the credential. This will change as per credential type selected. + // The display fields of the credential. The fields change based on the selected credential type. DisplayFields *ScopeDetailsCredentialDisplayFields `json:"display_fields,omitempty"` - // Stores the value of credential_version_timestamp . + // The credential version timestamp of the scope. VersionTimestamp interface{} `json:"version_timestamp,omitempty"` - // Stores the value of credential_description . + // The credential description of the scope. Description *string `json:"description,omitempty"` - // Stores the value of credential_is_enabled . + // The configuration of whether the scope's credential is enabled. IsEnabled *bool `json:"is_enabled,omitempty"` - // Stores the value of credential_gateway_key . + // The credential gateway key of the scope. GatewayKey *string `json:"gateway_key,omitempty"` - // Stores the value of credential_credential_group . + // The credential group of the scope. CredentialGroup interface{} `json:"credential_group,omitempty"` - // Stores the value of credential_enabled_credential_group . + // The configuration of whether the scope's credential group is enabled. EnabledCredentialGroup *bool `json:"enabled_credential_group,omitempty"` - // Stores the value of credential_groups . + // The credential groups of the scope. Groups []CredentialGroup `json:"groups,omitempty"` - // Stores the value of credential_purpose . + // The credential purpose of the scope. Purpose *string `json:"purpose,omitempty"` } @@ -7193,72 +7252,77 @@ func UnmarshalScopeDetailsCredential(m map[string]json.RawMessage, result interf return } -// ScopeDetailsCredentialDisplayFields : Details the fields on the credential. This will change as per credential type selected. +// ScopeDetailsCredentialDisplayFields : The display fields of the credential. The fields change based on the selected credential type. type ScopeDetailsCredentialDisplayFields struct { - // The IBM Cloud API Key. This is mandatory for IBM Credential Type. + // The IBM Cloud API Key. The API key is mandatory for the IBM Credential type. IBMAPIKey *string `json:"ibm_api_key,omitempty"` - // AWS client Id.This is mandatory for AWS Cloud. + // The Amazon Web Services client ID. The client ID is mandatory when AWS Cloud is selected as the credential type. AwsClientID *string `json:"aws_client_id,omitempty"` - // AWS client secret.This is mandatory for AWS Cloud. + // The Amazon Web Services client secret. The client secret is mandatory when AWS Cloud is selected as the credential + // type. AwsClientSecret *string `json:"aws_client_secret,omitempty"` - // AWS region. + // The Amazon Web Services region. The region is used when AWS Cloud is selected as the credential type. AwsRegion *string `json:"aws_region,omitempty"` - // AWS arn value. + // The Amazon Web Services arn value. The arn value is used when AWS Cloud is selected as the credential type. AwsArn *string `json:"aws_arn,omitempty"` - // username of the user.This is mandatory for DataBase, Kerbros,OpenStack Credentials. + // The username of the user. The username is mandatory when the credential type is DataBase, Kerberos, OpenStack, and + // Username-Password. Username *string `json:"username,omitempty"` - // password of the user.This is mandatory for DataBase, Kerbros,OpenStack Credentials. + // The password of the user. The password is mandatory when the credential type is DataBase, Kerberos, OpenStack, and + // Username-Password. Password *string `json:"password,omitempty"` - // Azure client Id. This is mandatory for Azure Credential type. + // The Microsoft Azure client ID. The client ID is mandatory when Azure is selected as the credential type. AzureClientID *string `json:"azure_client_id,omitempty"` - // Azure client secret.This is mandatory for Azure Credential type. + // The Microsoft Azure client secret. The secret is mandatory when the type of credential is set to Azure. AzureClientSecret *string `json:"azure_client_secret,omitempty"` - // Azure subscription Id.This is mandatory for Azure Credential type. + // The Microsoft Azure subscription ID. The subscription ID is mandatory when the type of credential is set to Azure. AzureSubscriptionID *string `json:"azure_subscription_id,omitempty"` - // Azure resource group. + // The Microsoft Azure resource group. The resource group is used when Azure is the credential type. AzureResourceGroup *string `json:"azure_resource_group,omitempty"` - // Database name.This is mandatory for Database Credential type. + // The database name. The database name is mandatory when Database is the credential type. DatabaseName *string `json:"database_name,omitempty"` - // Kerberos windows auth type.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows authentication type. The authentication type is mandatory when the credential type is Kerberos + // Windows. WinrmAuthtype *string `json:"winrm_authtype,omitempty"` - // Kerberos windows ssl.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows SSL. The SSL is mandatory when the credential type is Kerberos Windows. WinrmUsessl *string `json:"winrm_usessl,omitempty"` - // Kerberos windows port.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows port. The port is mandatory When Kerberos Windows is the credential type. WinrmPort *string `json:"winrm_port,omitempty"` - // The MS365 client Id.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 client ID. The client ID is mandatory when Microsoft 365 is the credential type. Ms365ClientID *string `json:"ms_365_client_id,omitempty"` - // The MS365 client secret.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 client secret. The secret is mandatory when Microsoft 365 is the credential type. Ms365ClientSecret *string `json:"ms_365_client_secret,omitempty"` - // The MS365 tenantId.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 tenant ID. The tenant ID is mandatory when Microsoft 365 is the credential type. Ms365TenantID *string `json:"ms_365_tenant_id,omitempty"` - // auth url of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The auth url of the OpenStack cloud. The auth url is mandatory when OpenStack is the credential type. AuthURL *string `json:"auth_url,omitempty"` - // Project name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The project name of the OpenStack cloud. The project name is mandatory when OpenStack is the credential type. ProjectName *string `json:"project_name,omitempty"` - // user domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The user domain name of the OpenStack cloud. The domain name is mandatory when OpenStack is the credential type. UserDomainName *string `json:"user_domain_name,omitempty"` - // project domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The project domain name of the OpenStack cloud. The project domain name is mandatory when OpenStack is the + // credential type. ProjectDomainName *string `json:"project_domain_name,omitempty"` } @@ -7357,53 +7421,53 @@ func UnmarshalScopeDetailsCredentialDisplayFields(m map[string]json.RawMessage, return } -// ScopeDetailsGatewayTask : Stores the value of ScopeDetailsGatewayTask . +// ScopeDetailsGatewayTask : The gateway task details of the scope. type ScopeDetailsGatewayTask struct { - // Stores the value of task_logs . + // The task logs of the scope. TaskLogs []TaskLogs `json:"task_logs,omitempty"` - // Stores the value of task_id . + // The task ID of the scope. TaskID *int64 `json:"task_id,omitempty"` - // Stores the value of task_gateway_id . + // The task gateway ID of the scope. TaskGatewayID *int64 `json:"task_gateway_id,omitempty"` - // Stores the value of task_gateway_name . + // The task gateway name of the scope. TaskGatewayName *string `json:"task_gateway_name,omitempty"` - // Stores the value of task_task_type . + // The task type of the scope. TaskTaskType *string `json:"task_task_type,omitempty"` - // Stores the value of task_gateway_schema_id . + // The task gateway schema ID of the scope. TaskGatewaySchemaID *int64 `json:"task_gateway_schema_id,omitempty"` - // Stores the value of task_schema_name . + // The task schema name of the scope. TaskSchemaName *string `json:"task_schema_name,omitempty"` - // Stores the value of task_discover_id . + // The task-discover ID of the scope. TaskDiscoverID *int64 `json:"task_discover_id,omitempty"` - // Stores the value of task_status . + // The task status of the scope. TaskStatus *string `json:"task_status,omitempty"` - // Stores the value of task_status_msg . + // The task status message of the scope. TaskStatusMsg *string `json:"task_status_msg,omitempty"` - // Stores the value of task_start_time . + // The task start time of the scope. TaskStartTime *int64 `json:"task_start_time,omitempty"` - // Stores the value of task_updated_time . + // The task updated time of the scope. TaskUpdatedTime *int64 `json:"task_updated_time,omitempty"` - // Stores the value of task_derived_status . + // The task derived status of the scope. TaskDerivedStatus *string `json:"task_derived_status,omitempty"` - // Stores the value of task_created_by . + // The user who created the task that is associated with scope. TaskCreatedBy *string `json:"task_created_by,omitempty"` } // Constants associated with the ScopeDetailsGatewayTask.TaskTaskType property. -// Stores the value of task_task_type . +// The task type of the scope. const ( ScopeDetailsGatewayTaskTaskTaskTypeAborttasksConst = "aborttasks" ScopeDetailsGatewayTaskTaskTaskTypeCertRegularValidationConst = "cert_regular_validation" @@ -7425,7 +7489,7 @@ const ( ) // Constants associated with the ScopeDetailsGatewayTask.TaskStatus property. -// Stores the value of task_status . +// The task status of the scope. const ( ScopeDetailsGatewayTaskTaskStatusAbortTaskRequestCompletedConst = "abort_task_request_completed" ScopeDetailsGatewayTaskTaskStatusAbortTaskRequestFailedConst = "abort_task_request_failed" @@ -7489,7 +7553,7 @@ const ( ) // Constants associated with the ScopeDetailsGatewayTask.TaskDerivedStatus property. -// Stores the value of task_derived_status . +// The task derived status of the scope. const ( ScopeDetailsGatewayTaskTaskDerivedStatusAbortTaskRequestCompletedConst = "abort_task_request_completed" ScopeDetailsGatewayTaskTaskDerivedStatusAbortTaskRequestFailedConst = "abort_task_request_failed" @@ -7629,13 +7693,13 @@ type ScopeItem struct { // An auto-generated unique identifier for the scope. ID *string `json:"id" validate:"required"` - // Stores the value of scope_uuid . + // The unique user ID of the scope. UUID *string `json:"uuid" validate:"required"` // A unique name for your scope. Name *string `json:"name" validate:"required"` - // Indicates whether scope is enabled/disabled. + // The scope is enabled or disabled. Enabled *bool `json:"enabled" validate:"required"` // The environment that the scope is targeted to. @@ -7647,7 +7711,7 @@ type ScopeItem struct { // The time that the scope was last modified in UTC. UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // Stores the value of collectors .Will be displayed only when value exists. + // The collectors of the scope. The collectors are displayed only when the values exist. Collectors []Collector `json:"collectors" validate:"required"` } @@ -7720,11 +7784,11 @@ type ScopeList struct { // The offset of the page. Offset *int64 `json:"offset" validate:"required"` - // The number of scopes displayed per page. + // The number of scopes that are displayed per page. Limit *int64 `json:"limit" validate:"required"` - // The total number of scopes. This value is 0 if no scopes are available and below fields will not be available in - // that case. + // The total number of scopes. The value is 0 if no scopes are available. The detail fields are not available in that + // case. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -7782,18 +7846,18 @@ func UnmarshalScopeList(m map[string]json.RawMessage, result interface{}) (err e return } -// ScopeTaskStatus : Returns the current task list for the collectors attached to the scope. +// ScopeTaskStatus : Get the current task list for the collectors that are attached to the scope. type ScopeTaskStatus struct { - // Returns the correlation ID. + // The correlation ID. CorrelationID *string `json:"correlation_id" validate:"required"` - // Returns the current status of a task. + // The status of a task. Status *string `json:"status" validate:"required"` - // Returns the time that task started. + // The time that the task started. StartTime *string `json:"start_time" validate:"required"` - // Returns the time that the scope was last updated. This value exists when collector is installed and running. + // The time that the scope was last updated. This value exists when a collector is installed and running. LastHeartbeat *strfmt.DateTime `json:"last_heartbeat" validate:"required"` } @@ -7820,7 +7884,7 @@ func UnmarshalScopeTaskStatus(m map[string]json.RawMessage, result interface{}) return } -// Summary : A list of scans summary. +// Summary : A list of scans summary. type Summary struct { // The scan ID. ID *string `json:"id" validate:"required"` @@ -7837,7 +7901,7 @@ type Summary struct { // The scan summary scope ID. ScopeID *string `json:"scope_id" validate:"required"` - // The list of controls on the scan summary. + // The list of controls that are on the scan summary. Controls []Control `json:"controls" validate:"required"` } @@ -7872,12 +7936,12 @@ func UnmarshalSummary(m map[string]json.RawMessage, result interface{}) (err err return } -// SummaryItem : The result of a scan summeries. +// SummaryItem : The result of a scan summary. type SummaryItem struct { // The ID of the scan. ID *string `json:"id" validate:"required"` - // A system generated name that is the combination of 12 characters in the scope name and 12 characters of a profile + // A system-generated name that is the combination of 12 characters in the scope name and 12 characters in a profile // name. Name *string `json:"name" validate:"required"` @@ -7890,10 +7954,10 @@ type SummaryItem struct { // The entity that ran the report. ReportRunBy *string `json:"report_run_by" validate:"required"` - // The date and time the scan was run. + // The date and time that the scan was run. StartTime *strfmt.DateTime `json:"start_time" validate:"required"` - // The date and time the scan completed. + // The date and time that the scan completed. EndTime *strfmt.DateTime `json:"end_time" validate:"required"` // The status of the collector as it completes a scan. @@ -8003,10 +8067,10 @@ type SummaryList struct { // The offset of the page. Offset *int64 `json:"offset" validate:"required"` - // The number of scans displayed per page. + // The number of scans that are displayed per page. Limit *int64 `json:"limit" validate:"required"` - // The total number of scans available in the list of summaries. + // The total number of scans that are available in the list of summaries. TotalCount *int64 `json:"total_count" validate:"required"` // The URL of a page. @@ -8081,7 +8145,7 @@ func (resp *SummaryList) GetNextOffset() (*int64, error) { return core.Int64Ptr(offsetValue), nil } -// TaskLogs : Returns the logs for the tasks that have run. +// TaskLogs : The logs for the tasks that you ran. type TaskLogs struct { } @@ -8094,7 +8158,7 @@ func UnmarshalTaskLogs(m map[string]json.RawMessage, result interface{}) (err er // UpdateCollectorOptions : The UpdateCollector options. type UpdateCollectorOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // JSON Merge-Patch content for update_collector. @@ -8149,73 +8213,80 @@ func (options *UpdateCollectorOptions) SetHeaders(param map[string]string) *Upda return options } -// UpdateCredentialDisplayFields : Details the fields on the credential. This will change as per credential type selected. +// UpdateCredentialDisplayFields : The details of the credential. The details change as the selected credential type varies. type UpdateCredentialDisplayFields struct { - // The IBM Cloud API Key. This is mandatory for IBM Credential Type. + // The IBM Cloud API key. The API key is mandatory when IBM is the credential type. IBMAPIKey *string `json:"ibm_api_key,omitempty"` - // AWS client Id.This is mandatory for AWS Cloud. + // The Amazon Web Services client ID. The client ID is mandatory when AWS Cloud is the credential type. AwsClientID *string `json:"aws_client_id,omitempty"` - // AWS client secret.This is mandatory for AWS Cloud. + // The Amazon Web Services client secret. The secret is mandatory when AWS Cloud is the credential type. AwsClientSecret *string `json:"aws_client_secret,omitempty"` - // AWS region. + // The Amazon Web Services region. The region is mandatory when AWS Cloud is the credential type. AwsRegion *string `json:"aws_region,omitempty"` - // AWS arn value. + // The Amazon Web Services arn value. The arn value is mandatory when AWS Cloud is the credential type. AwsArn *string `json:"aws_arn,omitempty"` - // username of the user.This is mandatory for DataBase, Kerbros,OpenStack Credentials. + // The username of the user. The username is mandatory when the credential type is DataBase, Kerberos, or OpenStack. Username *string `json:"username,omitempty"` - // password of the user.This is mandatory for DataBase, Kerbros,OpenStack Credentials. + // The password of the user. The password is mandatory for DataBase, Kerberos, OpenStack credentials. Password *string `json:"password,omitempty"` - // Azure client Id. This is mandatory for Azure Credential type. + // The Microsoft Azure client ID. The client ID is mandatory when Azure is the credential type. AzureClientID *string `json:"azure_client_id,omitempty"` - // Azure client secret.This is mandatory for Azure Credential type. + // The Microsoft Azure client secret. The secret is mandatory when Azure is the credential type. AzureClientSecret *string `json:"azure_client_secret,omitempty"` - // Azure subscription Id.This is mandatory for Azure Credential type. + // The Microsoft Azure subscription ID. The subscription ID is mandatory when Azure is the credential type. AzureSubscriptionID *string `json:"azure_subscription_id,omitempty"` - // Azure resource group. + // The Microsoft Azure resource group. The resource group is mandatory when Azure is the credential type. AzureResourceGroup *string `json:"azure_resource_group,omitempty"` - // Database name.This is mandatory for Database Credential type. + // The Database name. The name is mandatory when Database is the credential type. DatabaseName *string `json:"database_name,omitempty"` - // Kerberos windows auth type.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows auth type. The auth type is mandatory when Kerberos is the credential type. WinrmAuthtype *string `json:"winrm_authtype,omitempty"` - // Kerberos windows ssl.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows SSL. The SSL is mandatory when Kerberos is the credential type. WinrmUsessl *string `json:"winrm_usessl,omitempty"` - // Kerberos windows port.This is mandatory for Windows Kerberos Credential type. + // The Kerberos Windows port. The port is mandatory when Kerberos is the credential type. WinrmPort *string `json:"winrm_port,omitempty"` - // The MS365 client Id.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 client ID. The client ID is mandatory when Microsoft 365 is the credential type. Ms365ClientID *string `json:"ms_365_client_id,omitempty"` - // The MS365 client secret.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 client secret. The secret is mandatory when Microsoft 365 is the credential type. Ms365ClientSecret *string `json:"ms_365_client_secret,omitempty"` - // The MS365 tenantId.This is mandatory for Windows MS365 Credential type. + // The Microsoft 365 tenant ID. The tenant ID is mandatory when Microsoft 365 is the credential type. Ms365TenantID *string `json:"ms_365_tenant_id,omitempty"` - // auth url of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The auth url of the OpenStack cloud. The auth url is mandatory when OpenStack is the credential type. AuthURL *string `json:"auth_url,omitempty"` - // Project name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The project name of the OpenStack cloud. The project name is mandatory when OpenStack is the credential type. ProjectName *string `json:"project_name,omitempty"` - // user domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The user domain name of the OpenStack cloud. The domain name is mandatory when OpenStack is the credential type. UserDomainName *string `json:"user_domain_name,omitempty"` - // project domain name of the Open Stack cloud.This is mandatory for Open Stack Credential type. + // The project domain name of the OpenStack cloud. The project domain name is mandatory when OpenStack is the + // credential type. ProjectDomainName *string `json:"project_domain_name,omitempty"` + + // The user pem file name. + PemFileName *string `json:"pem_file_name,omitempty"` + + // The base64 encoded form of pem. + PemData *string `json:"pem_data,omitempty"` } // UnmarshalUpdateCredentialDisplayFields unmarshals an instance of UpdateCredentialDisplayFields from the specified map of raw messages. @@ -8309,31 +8380,39 @@ func UnmarshalUpdateCredentialDisplayFields(m map[string]json.RawMessage, result if err != nil { return } + err = core.UnmarshalPrimitive(m, "pem_file_name", &obj.PemFileName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "pem_data", &obj.PemData) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } // UpdateCredentialOptions : The UpdateCredential options. type UpdateCredentialOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` - // Credentials status enabled/disbaled. + // The status of the credential is enabled or disabled. Enabled *bool `json:"enabled,omitempty"` - // Credentials type. + // The credential's type. Type *string `json:"type,omitempty"` - // Credentials name. + // The credential's name. Name *string `json:"name,omitempty"` - // Credentials description. + // The credential's description. Description *string `json:"description,omitempty"` - // Details the fields on the credential. This will change as per credential type selected. + // The details of the credential. The details change as the selected credential type varies. DisplayFields *UpdateCredentialDisplayFields `json:"display_fields,omitempty"` - // Purpose for which the credential is created. + // The purpose for which the credential is created. Purpose *string `json:"purpose,omitempty"` // Your IBM Cloud account ID. @@ -8348,7 +8427,7 @@ type UpdateCredentialOptions struct { } // Constants associated with the UpdateCredentialOptions.Type property. -// Credentials type. +// The credential's type. const ( UpdateCredentialOptionsTypeAwsCloudConst = "aws_cloud" UpdateCredentialOptionsTypeAzureCloudConst = "azure_cloud" @@ -8357,11 +8436,12 @@ const ( UpdateCredentialOptionsTypeKerberosWindowsConst = "kerberos_windows" UpdateCredentialOptionsTypeMs365Const = "ms_365" UpdateCredentialOptionsTypeOpenstackCloudConst = "openstack_cloud" + UpdateCredentialOptionsTypeUserNamePemConst = "user_name_pem" UpdateCredentialOptionsTypeUsernamePasswordConst = "username_password" ) // Constants associated with the UpdateCredentialOptions.Purpose property. -// Purpose for which the credential is created. +// The purpose for which the credential is created. const ( UpdateCredentialOptionsPurposeDiscoveryCollectionConst = "discovery_collection" UpdateCredentialOptionsPurposeDiscoveryCollectionRemediationConst = "discovery_collection_remediation" @@ -8439,7 +8519,7 @@ func (options *UpdateCredentialOptions) SetHeaders(param map[string]string) *Upd // UpdateProfilesOptions : The UpdateProfiles options. type UpdateProfilesOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` // The name of the profile. @@ -8451,14 +8531,15 @@ type UpdateProfilesOptions struct { // The base profile that the controls are pulled from. BaseProfile *string `json:"base_profile,omitempty"` - // The type of profile. Seed profiles will have type as 'predefined',user generated profiles will be of type 'custom'. + // The type of profile. Seed profiles have the type set as 'predefined' and user-generated profiles have the type set + // as 'custom'. Type *string `json:"type,omitempty"` // The profile status. If the profile is enabled, the value is true. If the profile is disabled, the value is false. IsEnabled *bool `json:"is_enabled,omitempty"` - // A list of goal/control ids needs to be updated in the profile.These values can be retrieved from - // profiles/{profile_id}/controls API call where profile_id of the base_profile should be provided. + // A list of goal and control IDs that needs to be updated in the profile. These values can be retrieved from the + // profiles/{profile_id}/controls API. The `profile_id` of the `base_profile` must be provided. ControlIds []string `json:"control_ids,omitempty"` // Your IBM Cloud account ID. @@ -8473,7 +8554,8 @@ type UpdateProfilesOptions struct { } // Constants associated with the UpdateProfilesOptions.Type property. -// The type of profile. Seed profiles will have type as 'predefined',user generated profiles will be of type 'custom'. +// The type of profile. Seed profiles have the type set as 'predefined' and user-generated profiles have the type set as +// 'custom'. const ( UpdateProfilesOptionsTypeCustomConst = "custom" UpdateProfilesOptionsTypePredefinedConst = "predefined" @@ -8548,13 +8630,13 @@ func (options *UpdateProfilesOptions) SetHeaders(param map[string]string) *Updat // UpdateScopeDetailsOptions : The UpdateScopeDetails options. type UpdateScopeDetailsOptions struct { - // The id for the given API. + // The ID for the API. ID *string `json:"-" validate:"required,ne="` - // Stores the value of scope_name . + // The name of the scope. Name *string `json:"name,omitempty"` - // Stores the value of scope_description. + // The description of the scope. Description *string `json:"description,omitempty"` // Your IBM Cloud account ID. diff --git a/ibm/vendor/github.com/IBM/vpc-go-sdk/common/version.go b/ibm/vendor/github.com/IBM/vpc-go-sdk/common/version.go index 623548bdac..51e84866c5 100644 --- a/ibm/vendor/github.com/IBM/vpc-go-sdk/common/version.go +++ b/ibm/vendor/github.com/IBM/vpc-go-sdk/common/version.go @@ -1,4 +1,4 @@ package common // Version of the SDK -const Version = "0.6.0" +const Version = "0.17.0" diff --git a/ibm/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/ibm/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go index 6985abedc8..5c9de3f938 100644 --- a/ibm/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/ibm/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.43.2-e01bd7ca-20211209-144508 + * IBM OpenAPI SDK Code Generator Version: 3.44.0-98838c07-20220128-151531 */ // Package vpcv1 : Operations and models for the VpcV1 service @@ -37,12 +37,12 @@ import ( // VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual // server instances, along with subnets, volumes, load balancers, and more. // -// API Version: 2022-01-25 +// API Version: 2022-02-26 type VpcV1 struct { Service *core.BaseService - // Requests the API version as of a date, in format `YYYY-MM-DD`. Any date between `2019-01-01` and the current date - // may be specified. Specify the current date to request the latest version. + // Requests the API version as of a date, in format `YYYY-MM-DD`. Any date between + // `2019-01-01` and the current date may be specified. Specify the current date to request the latest version. Version *string // The infrastructure generation for the request. For the API behavior documented here, use @@ -62,8 +62,8 @@ type VpcV1Options struct { URL string Authenticator core.Authenticator - // Requests the API version as of a date, in format `YYYY-MM-DD`. Any date between `2019-01-01` and the current date - // may be specified. Specify the current date to request the latest version. + // Requests the API version as of a date, in format `YYYY-MM-DD`. Any date between + // `2019-01-01` and the current date may be specified. Specify the current date to request the latest version. Version *string } @@ -121,7 +121,7 @@ func NewVpcV1(options *VpcV1Options) (service *VpcV1, err error) { } if options.Version == nil { - options.Version = core.StringPtr("2022-01-25") + options.Version = core.StringPtr("2022-02-26") } service = &VpcV1{ @@ -9093,16 +9093,16 @@ func (vpc *VpcV1) UpdatePlacementGroupWithContext(ctx context.Context, updatePla return } -// ListVolumeProfiles : List all volume profiles -// This request lists all volume profiles available in the region. A volume profile specifies the performance -// characteristics and pricing model for a volume. -func (vpc *VpcV1) ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListVolumeProfilesWithContext(context.Background(), listVolumeProfilesOptions) +// ListBareMetalServerProfiles : List all bare metal server profiles +// This request lists all bare metal server profiles available in the region. A bare metal server profile specifies the +// performance characteristics and pricing model for a bare metal server. +func (vpc *VpcV1) ListBareMetalServerProfiles(listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerProfilesWithContext(context.Background(), listBareMetalServerProfilesOptions) } -// ListVolumeProfilesWithContext is an alternate form of the ListVolumeProfiles method which supports a Context parameter -func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVolumeProfilesOptions, "listVolumeProfilesOptions") +// ListBareMetalServerProfilesWithContext is an alternate form of the ListBareMetalServerProfiles method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerProfilesWithContext(ctx context.Context, listBareMetalServerProfilesOptions *ListBareMetalServerProfilesOptions) (result *BareMetalServerProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listBareMetalServerProfilesOptions, "listBareMetalServerProfilesOptions") if err != nil { return } @@ -9110,16 +9110,16 @@ func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeP builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles`, nil) if err != nil { return } - for headerName, headerValue := range listVolumeProfilesOptions.Headers { + for headerName, headerValue := range listBareMetalServerProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumeProfiles") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9127,11 +9127,11 @@ func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeP builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVolumeProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVolumeProfilesOptions.Start)) + if listBareMetalServerProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServerProfilesOptions.Start)) } - if listVolumeProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVolumeProfilesOptions.Limit)) + if listBareMetalServerProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerProfilesOptions.Limit)) } request, err := builder.Build() @@ -9145,7 +9145,7 @@ func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfileCollection) if err != nil { return } @@ -9155,40 +9155,40 @@ func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeP return } -// GetVolumeProfile : Retrieve a volume profile -// This request retrieves a single volume profile specified by the name in the URL. -func (vpc *VpcV1) GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { - return vpc.GetVolumeProfileWithContext(context.Background(), getVolumeProfileOptions) +// GetBareMetalServerProfile : Retrieve a bare metal server profile +// This request retrieves a single bare metal server profile specified by the name in the URL. +func (vpc *VpcV1) GetBareMetalServerProfile(getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerProfileWithContext(context.Background(), getBareMetalServerProfileOptions) } -// GetVolumeProfileWithContext is an alternate form of the GetVolumeProfile method which supports a Context parameter -func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVolumeProfileOptions, "getVolumeProfileOptions cannot be nil") +// GetBareMetalServerProfileWithContext is an alternate form of the GetBareMetalServerProfile method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerProfileWithContext(ctx context.Context, getBareMetalServerProfileOptions *GetBareMetalServerProfileOptions) (result *BareMetalServerProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVolumeProfileOptions, "getVolumeProfileOptions") + err = core.ValidateStruct(getBareMetalServerProfileOptions, "getBareMetalServerProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getVolumeProfileOptions.Name, + "name": *getBareMetalServerProfileOptions.Name, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_server/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVolumeProfileOptions.Headers { + for headerName, headerValue := range getBareMetalServerProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolumeProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9208,7 +9208,7 @@ func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProf return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerProfile) if err != nil { return } @@ -9218,16 +9218,15 @@ func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProf return } -// ListVolumes : List all volumes -// This request lists all volumes in the region. Volumes are network-connected block storage devices that may be -// attached to one or more instances in the same region. -func (vpc *VpcV1) ListVolumes(listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { - return vpc.ListVolumesWithContext(context.Background(), listVolumesOptions) +// ListBareMetalServers : List all bare metal servers +// This request lists all bare metal servers in the region. +func (vpc *VpcV1) ListBareMetalServers(listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServersWithContext(context.Background(), listBareMetalServersOptions) } -// ListVolumesWithContext is an alternate form of the ListVolumes method which supports a Context parameter -func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVolumesOptions, "listVolumesOptions") +// ListBareMetalServersWithContext is an alternate form of the ListBareMetalServers method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServersWithContext(ctx context.Context, listBareMetalServersOptions *ListBareMetalServersOptions) (result *BareMetalServerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listBareMetalServersOptions, "listBareMetalServersOptions") if err != nil { return } @@ -9235,16 +9234,16 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers`, nil) if err != nil { return } - for headerName, headerValue := range listVolumesOptions.Headers { + for headerName, headerValue := range listBareMetalServersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumes") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServers") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9252,17 +9251,38 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVolumesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVolumesOptions.Start)) + if listBareMetalServersOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServersOptions.Start)) } - if listVolumesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVolumesOptions.Limit)) + if listBareMetalServersOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServersOptions.Limit)) } - if listVolumesOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listVolumesOptions.Name)) + if listBareMetalServersOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listBareMetalServersOptions.ResourceGroupID)) } - if listVolumesOptions.ZoneName != nil { - builder.AddQuery("zone.name", fmt.Sprint(*listVolumesOptions.ZoneName)) + if listBareMetalServersOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listBareMetalServersOptions.Name)) + } + if listBareMetalServersOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listBareMetalServersOptions.VPCID)) + } + if listBareMetalServersOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listBareMetalServersOptions.VPCCRN)) + } + if listBareMetalServersOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listBareMetalServersOptions.VPCName)) + } + if listBareMetalServersOptions.NetworkInterfacesSubnetID != nil { + builder.AddQuery("network_interfaces.subnet.id", fmt.Sprint(*listBareMetalServersOptions.NetworkInterfacesSubnetID)) + } + if listBareMetalServersOptions.NetworkInterfacesSubnetCRN != nil { + builder.AddQuery("network_interfaces.subnet.crn", fmt.Sprint(*listBareMetalServersOptions.NetworkInterfacesSubnetCRN)) + } + if listBareMetalServersOptions.NetworkInterfacesSubnetName != nil { + builder.AddQuery("network_interfaces.subnet.name", fmt.Sprint(*listBareMetalServersOptions.NetworkInterfacesSubnetName)) + } + if listBareMetalServersOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listBareMetalServersOptions.Sort)) } request, err := builder.Build() @@ -9276,7 +9296,7 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerCollection) if err != nil { return } @@ -9286,20 +9306,21 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions return } -// CreateVolume : Create a volume -// This request creates a new volume from a volume prototype object. The prototype object is structured in the same way -// as a retrieved volume, and contains the information necessary to create the new volume. -func (vpc *VpcV1) CreateVolume(createVolumeOptions *CreateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.CreateVolumeWithContext(context.Background(), createVolumeOptions) +// CreateBareMetalServer : Create a bare metal server +// This request provisions a new bare metal server from a prototype object. The prototype object is structured in the +// same way as a retrieved bare metal server, and contains the information necessary to provision the new bare metal +// server. The bare metal server is automatically started. +func (vpc *VpcV1) CreateBareMetalServer(createBareMetalServerOptions *CreateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + return vpc.CreateBareMetalServerWithContext(context.Background(), createBareMetalServerOptions) } -// CreateVolumeWithContext is an alternate form of the CreateVolume method which supports a Context parameter -func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptions *CreateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVolumeOptions, "createVolumeOptions cannot be nil") +// CreateBareMetalServerWithContext is an alternate form of the CreateBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) CreateBareMetalServerWithContext(ctx context.Context, createBareMetalServerOptions *CreateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createBareMetalServerOptions, "createBareMetalServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVolumeOptions, "createVolumeOptions") + err = core.ValidateStruct(createBareMetalServerOptions, "createBareMetalServerOptions") if err != nil { return } @@ -9307,16 +9328,16 @@ func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptio builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers`, nil) if err != nil { return } - for headerName, headerValue := range createVolumeOptions.Headers { + for headerName, headerValue := range createBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVolume") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9326,7 +9347,32 @@ func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptio builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createVolumeOptions.VolumePrototype) + body := make(map[string]interface{}) + if createBareMetalServerOptions.Initialization != nil { + body["initialization"] = createBareMetalServerOptions.Initialization + } + if createBareMetalServerOptions.PrimaryNetworkInterface != nil { + body["primary_network_interface"] = createBareMetalServerOptions.PrimaryNetworkInterface + } + if createBareMetalServerOptions.Profile != nil { + body["profile"] = createBareMetalServerOptions.Profile + } + if createBareMetalServerOptions.Zone != nil { + body["zone"] = createBareMetalServerOptions.Zone + } + if createBareMetalServerOptions.Name != nil { + body["name"] = createBareMetalServerOptions.Name + } + if createBareMetalServerOptions.NetworkInterfaces != nil { + body["network_interfaces"] = createBareMetalServerOptions.NetworkInterfaces + } + if createBareMetalServerOptions.ResourceGroup != nil { + body["resource_group"] = createBareMetalServerOptions.ResourceGroup + } + if createBareMetalServerOptions.VPC != nil { + body["vpc"] = createBareMetalServerOptions.VPC + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -9342,7 +9388,7 @@ func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) if err != nil { return } @@ -9352,92 +9398,121 @@ func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptio return } -// DeleteVolume : Delete a volume -// This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not be -// attached to any instances. -func (vpc *VpcV1) DeleteVolume(deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVolumeWithContext(context.Background(), deleteVolumeOptions) +// CreateBareMetalServerConsoleAccessToken : Create a console access token for a bare metal server +// This request creates a new single-use console access token for a bare metal server. All console configuration is +// provided at token create time, and the token is subsequently used in the `access_token` query parameter for the +// WebSocket request. The access token is only valid for a short period of time, and a maximum of one token is valid +// for a given bare metal server at a time. +func (vpc *VpcV1) CreateBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions *CreateBareMetalServerConsoleAccessTokenOptions) (result *BareMetalServerConsoleAccessToken, response *core.DetailedResponse, err error) { + return vpc.CreateBareMetalServerConsoleAccessTokenWithContext(context.Background(), createBareMetalServerConsoleAccessTokenOptions) } -// DeleteVolumeWithContext is an alternate form of the DeleteVolume method which supports a Context parameter -func (vpc *VpcV1) DeleteVolumeWithContext(ctx context.Context, deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVolumeOptions, "deleteVolumeOptions cannot be nil") +// CreateBareMetalServerConsoleAccessTokenWithContext is an alternate form of the CreateBareMetalServerConsoleAccessToken method which supports a Context parameter +func (vpc *VpcV1) CreateBareMetalServerConsoleAccessTokenWithContext(ctx context.Context, createBareMetalServerConsoleAccessTokenOptions *CreateBareMetalServerConsoleAccessTokenOptions) (result *BareMetalServerConsoleAccessToken, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createBareMetalServerConsoleAccessTokenOptions, "createBareMetalServerConsoleAccessTokenOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVolumeOptions, "deleteVolumeOptions") + err = core.ValidateStruct(createBareMetalServerConsoleAccessTokenOptions, "createBareMetalServerConsoleAccessTokenOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteVolumeOptions.ID, + "bare_metal_server_id": *createBareMetalServerConsoleAccessTokenOptions.BareMetalServerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/console_access_token`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVolumeOptions.Headers { + for headerName, headerValue := range createBareMetalServerConsoleAccessTokenOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVolume") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerConsoleAccessToken") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createBareMetalServerConsoleAccessTokenOptions.ConsoleType != nil { + body["console_type"] = createBareMetalServerConsoleAccessTokenOptions.ConsoleType + } + if createBareMetalServerConsoleAccessTokenOptions.Force != nil { + body["force"] = createBareMetalServerConsoleAccessTokenOptions.Force + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerConsoleAccessToken) + if err != nil { + return + } + response.Result = result + } return } -// GetVolume : Retrieve a volume -// This request retrieves a single volume specified by the identifier in the URL. -func (vpc *VpcV1) GetVolume(getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.GetVolumeWithContext(context.Background(), getVolumeOptions) +// ListBareMetalServerDisks : List all disks on a bare metal server +// This request lists all disks on a bare metal server. A disk is a block device that is locally attached to the +// physical server. By default, the listed disks are sorted by their `created_at` property values, with the newest disk +// first. +func (vpc *VpcV1) ListBareMetalServerDisks(listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerDisksWithContext(context.Background(), listBareMetalServerDisksOptions) } -// GetVolumeWithContext is an alternate form of the GetVolume method which supports a Context parameter -func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVolumeOptions, "getVolumeOptions cannot be nil") +// ListBareMetalServerDisksWithContext is an alternate form of the ListBareMetalServerDisks method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerDisksWithContext(ctx context.Context, listBareMetalServerDisksOptions *ListBareMetalServerDisksOptions) (result *BareMetalServerDiskCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVolumeOptions, "getVolumeOptions") + err = core.ValidateStruct(listBareMetalServerDisksOptions, "listBareMetalServerDisksOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVolumeOptions.ID, + "bare_metal_server_id": *listBareMetalServerDisksOptions.BareMetalServerID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVolumeOptions.Headers { + for headerName, headerValue := range listBareMetalServerDisksOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolume") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerDisks") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9457,7 +9532,7 @@ func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *Ge return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDiskCollection) if err != nil { return } @@ -9467,55 +9542,49 @@ func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *Ge return } -// UpdateVolume : Update a volume -// This request updates a volume with the information in a provided volume patch. The volume patch object is structured -// in the same way as a retrieved volume and contains only the information to be updated. -func (vpc *VpcV1) UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - return vpc.UpdateVolumeWithContext(context.Background(), updateVolumeOptions) +// GetBareMetalServerDisk : Retrieve a bare metal server disk +// This request retrieves a single disk specified by the identifier in the URL. +func (vpc *VpcV1) GetBareMetalServerDisk(getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerDiskWithContext(context.Background(), getBareMetalServerDiskOptions) } -// UpdateVolumeWithContext is an alternate form of the UpdateVolume method which supports a Context parameter -func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVolumeOptions, "updateVolumeOptions cannot be nil") +// GetBareMetalServerDiskWithContext is an alternate form of the GetBareMetalServerDisk method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerDiskWithContext(ctx context.Context, getBareMetalServerDiskOptions *GetBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVolumeOptions, "updateVolumeOptions") + err = core.ValidateStruct(getBareMetalServerDiskOptions, "getBareMetalServerDiskOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateVolumeOptions.ID, + "bare_metal_server_id": *getBareMetalServerDiskOptions.BareMetalServerID, + "id": *getBareMetalServerDiskOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVolumeOptions.Headers { + for headerName, headerValue := range getBareMetalServerDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVolume") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVolumeOptions.VolumePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -9527,7 +9596,7 @@ func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) if err != nil { return } @@ -9537,81 +9606,113 @@ func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptio return } -// DeleteSnapshots : Delete a filtered collection of snapshots -// This request deletes all snapshots created from a specific source volume. -func (vpc *VpcV1) DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotsWithContext(context.Background(), deleteSnapshotsOptions) +// UpdateBareMetalServerDisk : Update a bare metal server disk +// This request updates the bare metal server disk with the information in a provided patch. +func (vpc *VpcV1) UpdateBareMetalServerDisk(updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerDiskWithContext(context.Background(), updateBareMetalServerDiskOptions) } -// DeleteSnapshotsWithContext is an alternate form of the DeleteSnapshots method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotsWithContext(ctx context.Context, deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotsOptions, "deleteSnapshotsOptions cannot be nil") +// UpdateBareMetalServerDiskWithContext is an alternate form of the UpdateBareMetalServerDisk method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerDiskWithContext(ctx context.Context, updateBareMetalServerDiskOptions *UpdateBareMetalServerDiskOptions) (result *BareMetalServerDisk, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSnapshotsOptions, "deleteSnapshotsOptions") + err = core.ValidateStruct(updateBareMetalServerDiskOptions, "updateBareMetalServerDiskOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.DELETE) + pathParamsMap := map[string]string{ + "bare_metal_server_id": *updateBareMetalServerDiskOptions.BareMetalServerID, + "id": *updateBareMetalServerDiskOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/disks/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSnapshotsOptions.Headers { + for headerName, headerValue := range updateBareMetalServerDiskOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshots") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerDisk") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - builder.AddQuery("source_volume.id", fmt.Sprint(*deleteSnapshotsOptions.SourceVolumeID)) + + _, err = builder.SetBodyContentJSON(updateBareMetalServerDiskOptions.BareMetalServerDiskPatch) + if err != nil { + return + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerDisk) + if err != nil { + return + } + response.Result = result + } return } -// ListSnapshots : List all snapshots -// This request lists all snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is -// created. -func (vpc *VpcV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { - return vpc.ListSnapshotsWithContext(context.Background(), listSnapshotsOptions) +// ListBareMetalServerNetworkInterfaces : List all network interfaces on a bare metal server +// This request lists all network interfaces on a bare metal server. A network interface is an abstract representation +// of a network interface card and connects a bare metal server to a subnet. While each network interface can attach to +// only one subnet, multiple network interfaces can be created to attach to multiple subnets. Multiple interfaces may +// also attach to the same subnet. +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerNetworkInterfacesWithContext(context.Background(), listBareMetalServerNetworkInterfacesOptions) } -// ListSnapshotsWithContext is an alternate form of the ListSnapshots method which supports a Context parameter -func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSnapshotsOptions, "listSnapshotsOptions") +// ListBareMetalServerNetworkInterfacesWithContext is an alternate form of the ListBareMetalServerNetworkInterfaces method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerNetworkInterfacesWithContext(ctx context.Context, listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listBareMetalServerNetworkInterfacesOptions, "listBareMetalServerNetworkInterfacesOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "bare_metal_server_id": *listBareMetalServerNetworkInterfacesOptions.BareMetalServerID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listSnapshotsOptions.Headers { + for headerName, headerValue := range listBareMetalServerNetworkInterfacesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshots") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaces") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9619,32 +9720,11 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSnapshotsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSnapshotsOptions.Start)) - } - if listSnapshotsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSnapshotsOptions.Limit)) - } - if listSnapshotsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotsOptions.ResourceGroupID)) - } - if listSnapshotsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listSnapshotsOptions.Name)) - } - if listSnapshotsOptions.SourceVolumeID != nil { - builder.AddQuery("source_volume.id", fmt.Sprint(*listSnapshotsOptions.SourceVolumeID)) - } - if listSnapshotsOptions.SourceVolumeCRN != nil { - builder.AddQuery("source_volume.crn", fmt.Sprint(*listSnapshotsOptions.SourceVolumeCRN)) - } - if listSnapshotsOptions.SourceImageID != nil { - builder.AddQuery("source_image.id", fmt.Sprint(*listSnapshotsOptions.SourceImageID)) + if listBareMetalServerNetworkInterfacesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Start)) } - if listSnapshotsOptions.SourceImageCRN != nil { - builder.AddQuery("source_image.crn", fmt.Sprint(*listSnapshotsOptions.SourceImageCRN)) - } - if listSnapshotsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listSnapshotsOptions.Sort)) + if listBareMetalServerNetworkInterfacesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listBareMetalServerNetworkInterfacesOptions.Limit)) } request, err := builder.Build() @@ -9658,7 +9738,7 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterfaceCollection) if err != nil { return } @@ -9668,37 +9748,43 @@ func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOpt return } -// CreateSnapshot : Create a snapshot -// This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same -// way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. -func (vpc *VpcV1) CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.CreateSnapshotWithContext(context.Background(), createSnapshotOptions) +// CreateBareMetalServerNetworkInterface : Create a network interface on a bare metal server +// This request creates a new network interface from a network interface prototype object. The prototype object is +// structured in the same way as a retrieved network interface, and contains the information necessary to create the new +// network interface. Any subnet in the bare metal server's VPC may be specified, even if it is already attached to +// another network interface. Addresses on the network interface must be within the specified subnet's CIDR blocks. +func (vpc *VpcV1) CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + return vpc.CreateBareMetalServerNetworkInterfaceWithContext(context.Background(), createBareMetalServerNetworkInterfaceOptions) } -// CreateSnapshotWithContext is an alternate form of the CreateSnapshot method which supports a Context parameter -func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSnapshotOptions, "createSnapshotOptions cannot be nil") +// CreateBareMetalServerNetworkInterfaceWithContext is an alternate form of the CreateBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) CreateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSnapshotOptions, "createSnapshotOptions") + err = core.ValidateStruct(createBareMetalServerNetworkInterfaceOptions, "createBareMetalServerNetworkInterfaceOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "bare_metal_server_id": *createBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + } + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSnapshotOptions.Headers { + for headerName, headerValue := range createBareMetalServerNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateBareMetalServerNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9708,17 +9794,7 @@ func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotO builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createSnapshotOptions.SourceVolume != nil { - body["source_volume"] = createSnapshotOptions.SourceVolume - } - if createSnapshotOptions.Name != nil { - body["name"] = createSnapshotOptions.Name - } - if createSnapshotOptions.ResourceGroup != nil { - body["resource_group"] = createSnapshotOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(createBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePrototype) if err != nil { return } @@ -9734,7 +9810,7 @@ func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) if err != nil { return } @@ -9744,40 +9820,42 @@ func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotO return } -// DeleteSnapshot : Delete a snapshot -// This request deletes a snapshot. This operation cannot be reversed. -func (vpc *VpcV1) DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSnapshotWithContext(context.Background(), deleteSnapshotOptions) +// DeleteBareMetalServerNetworkInterface : Delete a network interface +// This request deletes a network interface. This operation cannot be reversed. Any floating IPs associated with the +// network interface are implicitly disassociated. The primary network interface is not allowed to be deleted. +func (vpc *VpcV1) DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteBareMetalServerNetworkInterfaceWithContext(context.Background(), deleteBareMetalServerNetworkInterfaceOptions) } -// DeleteSnapshotWithContext is an alternate form of the DeleteSnapshot method which supports a Context parameter -func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSnapshotOptions, "deleteSnapshotOptions cannot be nil") +// DeleteBareMetalServerNetworkInterfaceWithContext is an alternate form of the DeleteBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) DeleteBareMetalServerNetworkInterfaceWithContext(ctx context.Context, deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteBareMetalServerNetworkInterfaceOptions, "deleteBareMetalServerNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSnapshotOptions, "deleteSnapshotOptions") + err = core.ValidateStruct(deleteBareMetalServerNetworkInterfaceOptions, "deleteBareMetalServerNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteSnapshotOptions.ID, + "bare_metal_server_id": *deleteBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + "id": *deleteBareMetalServerNetworkInterfaceOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSnapshotOptions.Headers { + for headerName, headerValue := range deleteBareMetalServerNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServerNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9795,40 +9873,41 @@ func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotO return } -// GetSnapshot : Retrieve a snapshot -// This request retrieves a single snapshot specified by the identifier in the URL. -func (vpc *VpcV1) GetSnapshot(getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.GetSnapshotWithContext(context.Background(), getSnapshotOptions) +// GetBareMetalServerNetworkInterface : Retrieve a network interface +// This request retrieves a single network interface specified by the identifier in the URL. +func (vpc *VpcV1) GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerNetworkInterfaceWithContext(context.Background(), getBareMetalServerNetworkInterfaceOptions) } -// GetSnapshotWithContext is an alternate form of the GetSnapshot method which supports a Context parameter -func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSnapshotOptions, "getSnapshotOptions cannot be nil") +// GetBareMetalServerNetworkInterfaceWithContext is an alternate form of the GetBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSnapshotOptions, "getSnapshotOptions") + err = core.ValidateStruct(getBareMetalServerNetworkInterfaceOptions, "getBareMetalServerNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSnapshotOptions.ID, + "bare_metal_server_id": *getBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + "id": *getBareMetalServerNetworkInterfaceOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSnapshotOptions.Headers { + for headerName, headerValue := range getBareMetalServerNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9848,7 +9927,7 @@ func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) if err != nil { return } @@ -9858,40 +9937,43 @@ func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions return } -// UpdateSnapshot : Update a snapshot -// This request updates a snapshot's name. -func (vpc *VpcV1) UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - return vpc.UpdateSnapshotWithContext(context.Background(), updateSnapshotOptions) +// UpdateBareMetalServerNetworkInterface : Update a network interface +// This request updates a network interface with the information provided in a network interface patch object. The +// network interface patch object is structured in the same way as a retrieved network interface and needs to contain +// only the information to be updated. +func (vpc *VpcV1) UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerNetworkInterfaceWithContext(context.Background(), updateBareMetalServerNetworkInterfaceOptions) } -// UpdateSnapshotWithContext is an alternate form of the UpdateSnapshot method which supports a Context parameter -func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSnapshotOptions, "updateSnapshotOptions cannot be nil") +// UpdateBareMetalServerNetworkInterfaceWithContext is an alternate form of the UpdateBareMetalServerNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerNetworkInterfaceWithContext(ctx context.Context, updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateSnapshotOptions, "updateSnapshotOptions") + err = core.ValidateStruct(updateBareMetalServerNetworkInterfaceOptions, "updateBareMetalServerNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateSnapshotOptions.ID, + "bare_metal_server_id": *updateBareMetalServerNetworkInterfaceOptions.BareMetalServerID, + "id": *updateBareMetalServerNetworkInterfaceOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateSnapshotOptions.Headers { + for headerName, headerValue := range updateBareMetalServerNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshot") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServerNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9901,7 +9983,7 @@ func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotO builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateSnapshotOptions.SnapshotPatch) + _, err = builder.SetBodyContentJSON(updateBareMetalServerNetworkInterfaceOptions.BareMetalServerNetworkInterfacePatch) if err != nil { return } @@ -9917,7 +9999,7 @@ func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerNetworkInterface) if err != nil { return } @@ -9927,36 +10009,41 @@ func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotO return } -// ListRegions : List all regions -// This request lists all regions. Each region is a separate geographic area that contains multiple isolated zones. -// Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other zones -// in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault isolation -// available. Resources deployed within a single region also benefit from the low latency afforded by geographic -// proximity. -func (vpc *VpcV1) ListRegions(listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { - return vpc.ListRegionsWithContext(context.Background(), listRegionsOptions) +// ListBareMetalServerNetworkInterfaceFloatingIps : List all floating IPs associated with a network interface +// This request lists all floating IPs associated with a network interface. +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { + return vpc.ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(context.Background(), listBareMetalServerNetworkInterfaceFloatingIpsOptions) } -// ListRegionsWithContext is an alternate form of the ListRegions method which supports a Context parameter -func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listRegionsOptions, "listRegionsOptions") +// ListBareMetalServerNetworkInterfaceFloatingIpsWithContext is an alternate form of the ListBareMetalServerNetworkInterfaceFloatingIps method which supports a Context parameter +func (vpc *VpcV1) ListBareMetalServerNetworkInterfaceFloatingIpsWithContext(ctx context.Context, listBareMetalServerNetworkInterfaceFloatingIpsOptions *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) (result *FloatingIPUnpaginatedCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listBareMetalServerNetworkInterfaceFloatingIpsOptions, "listBareMetalServerNetworkInterfaceFloatingIpsOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "bare_metal_server_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.BareMetalServerID, + "network_interface_id": *listBareMetalServerNetworkInterfaceFloatingIpsOptions.NetworkInterfaceID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listRegionsOptions.Headers { + for headerName, headerValue := range listBareMetalServerNetworkInterfaceFloatingIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegions") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListBareMetalServerNetworkInterfaceFloatingIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -9976,7 +10063,7 @@ func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPUnpaginatedCollection) if err != nil { return } @@ -9986,44 +10073,45 @@ func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions return } -// GetRegion : Retrieve a region -// This request retrieves a single region specified by the name in the URL. -func (vpc *VpcV1) GetRegion(getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { - return vpc.GetRegionWithContext(context.Background(), getRegionOptions) +// RemoveBareMetalServerNetworkInterfaceFloatingIP : Disassociate a floating IP from a network interface +// This request disassociates the specified floating IP from the specified network interface. +func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIP(removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), removeBareMetalServerNetworkInterfaceFloatingIPOptions) } -// GetRegionWithContext is an alternate form of the GetRegion method which supports a Context parameter -func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getRegionOptions, "getRegionOptions cannot be nil") +// RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the RemoveBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) RemoveBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, removeBareMetalServerNetworkInterfaceFloatingIPOptions *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getRegionOptions, "getRegionOptions") + err = core.ValidateStruct(removeBareMetalServerNetworkInterfaceFloatingIPOptions, "removeBareMetalServerNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getRegionOptions.Name, + "bare_metal_server_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, + "network_interface_id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *removeBareMetalServerNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getRegionOptions.Headers { + for headerName, headerValue := range removeBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegion") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveBareMetalServerNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -10033,57 +10121,48 @@ func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *Ge return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegion) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListRegionZones : List all zones in a region -// This request lists all zones in a region. Zones represent logically-isolated data centers with high-bandwidth and -// low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. -func (vpc *VpcV1) ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { - return vpc.ListRegionZonesWithContext(context.Background(), listRegionZonesOptions) +// GetBareMetalServerNetworkInterfaceFloatingIP : Retrieve associated floating IP +// This request a retrieves a specified floating IP address if it is associated with the network interface and bare +// metal server specified in the URL. +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIP(getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), getBareMetalServerNetworkInterfaceFloatingIPOptions) } -// ListRegionZonesWithContext is an alternate form of the ListRegionZones method which supports a Context parameter -func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listRegionZonesOptions, "listRegionZonesOptions cannot be nil") +// GetBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the GetBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, getBareMetalServerNetworkInterfaceFloatingIPOptions *GetBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listRegionZonesOptions, "listRegionZonesOptions") + err = core.ValidateStruct(getBareMetalServerNetworkInterfaceFloatingIPOptions, "getBareMetalServerNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "region_name": *listRegionZonesOptions.RegionName, + "bare_metal_server_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, + "network_interface_id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *getBareMetalServerNetworkInterfaceFloatingIPOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listRegionZonesOptions.Headers { + for headerName, headerValue := range getBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegionZones") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10103,7 +10182,7 @@ func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZone return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZoneCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -10113,41 +10192,45 @@ func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZone return } -// GetRegionZone : Retrieve a zone -// This request retrieves a single zone specified by the region and zone names in the URL. -func (vpc *VpcV1) GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { - return vpc.GetRegionZoneWithContext(context.Background(), getRegionZoneOptions) +// AddBareMetalServerNetworkInterfaceFloatingIP : Associate a floating IP with a network interface +// This request associates the specified floating IP with the specified network interface. If +// `enable_infrastructure_nat` is `false`, this adds the IP to any existing associations. If `enable_infrastructure_nat` +// is `true`, this replaces any existing association. For this request to succeed, the existing floating IP must not be +// required by another resource, such as a public gateway. A request body is not required, and if provided, is ignored. +func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIP(addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.AddBareMetalServerNetworkInterfaceFloatingIPWithContext(context.Background(), addBareMetalServerNetworkInterfaceFloatingIPOptions) } -// GetRegionZoneWithContext is an alternate form of the GetRegionZone method which supports a Context parameter -func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getRegionZoneOptions, "getRegionZoneOptions cannot be nil") +// AddBareMetalServerNetworkInterfaceFloatingIPWithContext is an alternate form of the AddBareMetalServerNetworkInterfaceFloatingIP method which supports a Context parameter +func (vpc *VpcV1) AddBareMetalServerNetworkInterfaceFloatingIPWithContext(ctx context.Context, addBareMetalServerNetworkInterfaceFloatingIPOptions *AddBareMetalServerNetworkInterfaceFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getRegionZoneOptions, "getRegionZoneOptions") + err = core.ValidateStruct(addBareMetalServerNetworkInterfaceFloatingIPOptions, "addBareMetalServerNetworkInterfaceFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "region_name": *getRegionZoneOptions.RegionName, - "name": *getRegionZoneOptions.Name, + "bare_metal_server_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.BareMetalServerID, + "network_interface_id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.NetworkInterfaceID, + "id": *addBareMetalServerNetworkInterfaceFloatingIPOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getRegionZoneOptions.Headers { + for headerName, headerValue := range addBareMetalServerNetworkInterfaceFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegionZone") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddBareMetalServerNetworkInterfaceFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10167,7 +10250,7 @@ func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZone) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -10177,51 +10260,100 @@ func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOpt return } -// ListPublicGateways : List all public gateways -// This request lists all public gateways in the region. A public gateway is a virtual network device associated with a -// VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the -// same zone only. -func (vpc *VpcV1) ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListPublicGatewaysWithContext(context.Background(), listPublicGatewaysOptions) +// DeleteBareMetalServer : Delete a bare metal server +// This request deletes a bare metal server. This operation cannot be reversed. Any floating IPs associated with the +// bare metal server's network interfaces are implicitly disassociated. +func (vpc *VpcV1) DeleteBareMetalServer(deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteBareMetalServerWithContext(context.Background(), deleteBareMetalServerOptions) } -// ListPublicGatewaysWithContext is an alternate form of the ListPublicGateways method which supports a Context parameter -func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listPublicGatewaysOptions, "listPublicGatewaysOptions") +// DeleteBareMetalServerWithContext is an alternate form of the DeleteBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) DeleteBareMetalServerWithContext(ctx context.Context, deleteBareMetalServerOptions *DeleteBareMetalServerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteBareMetalServerOptions, "deleteBareMetalServerOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteBareMetalServerOptions, "deleteBareMetalServerOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "id": *deleteBareMetalServerOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listPublicGatewaysOptions.Headers { + for headerName, headerValue := range deleteBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPublicGateways") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listPublicGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listPublicGatewaysOptions.Start)) + + request, err := builder.Build() + if err != nil { + return } - if listPublicGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listPublicGatewaysOptions.Limit)) + + response, err = vpc.Service.Request(request, nil) + + return +} + +// GetBareMetalServer : Retrieve a bare metal server +// This request retrieves a single bare metal server specified by the identifier in the URL. +func (vpc *VpcV1) GetBareMetalServer(getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerWithContext(context.Background(), getBareMetalServerOptions) +} + +// GetBareMetalServerWithContext is an alternate form of the GetBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerWithContext(ctx context.Context, getBareMetalServerOptions *GetBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerOptions, "getBareMetalServerOptions cannot be nil") + if err != nil { + return } - if listPublicGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listPublicGatewaysOptions.ResourceGroupID)) + err = core.ValidateStruct(getBareMetalServerOptions, "getBareMetalServerOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *getBareMetalServerOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) + if err != nil { + return } + for headerName, headerValue := range getBareMetalServerOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServer") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + request, err := builder.Build() if err != nil { return @@ -10233,7 +10365,7 @@ func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicG return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGatewayCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) if err != nil { return } @@ -10243,67 +10375,51 @@ func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicG return } -// CreatePublicGateway : Create a public gateway -// This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must -// not already have a public gateway in the specified zone. -// -// If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound to -// the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway must -// be explicitly attached to each subnet it will provide connectivity for. -func (vpc *VpcV1) CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.CreatePublicGatewayWithContext(context.Background(), createPublicGatewayOptions) +// UpdateBareMetalServer : Update a bare metal server +// This request updates a bare metal server with the information in a provided patch. The bare metal server patch object +// is structured in the same way as a retrieved bare metal server and contains only the information to be updated. +func (vpc *VpcV1) UpdateBareMetalServer(updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + return vpc.UpdateBareMetalServerWithContext(context.Background(), updateBareMetalServerOptions) } -// CreatePublicGatewayWithContext is an alternate form of the CreatePublicGateway method which supports a Context parameter -func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createPublicGatewayOptions, "createPublicGatewayOptions cannot be nil") +// UpdateBareMetalServerWithContext is an alternate form of the UpdateBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) UpdateBareMetalServerWithContext(ctx context.Context, updateBareMetalServerOptions *UpdateBareMetalServerOptions) (result *BareMetalServer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateBareMetalServerOptions, "updateBareMetalServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createPublicGatewayOptions, "createPublicGatewayOptions") + err = core.ValidateStruct(updateBareMetalServerOptions, "updateBareMetalServerOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "id": *updateBareMetalServerOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createPublicGatewayOptions.Headers { + for headerName, headerValue := range updateBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreatePublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createPublicGatewayOptions.VPC != nil { - body["vpc"] = createPublicGatewayOptions.VPC - } - if createPublicGatewayOptions.Zone != nil { - body["zone"] = createPublicGatewayOptions.Zone - } - if createPublicGatewayOptions.FloatingIP != nil { - body["floating_ip"] = createPublicGatewayOptions.FloatingIP - } - if createPublicGatewayOptions.Name != nil { - body["name"] = createPublicGatewayOptions.Name - } - if createPublicGatewayOptions.ResourceGroup != nil { - body["resource_group"] = createPublicGatewayOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateBareMetalServerOptions.BareMetalServerPatch) if err != nil { return } @@ -10319,7 +10435,7 @@ func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPubl return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServer) if err != nil { return } @@ -10329,97 +10445,46 @@ func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPubl return } -// DeletePublicGateway : Delete a public gateway -// This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public -// gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the -// floating IP was created when the public gateway was created, it will be deleted. -func (vpc *VpcV1) DeletePublicGateway(deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeletePublicGatewayWithContext(context.Background(), deletePublicGatewayOptions) +// GetBareMetalServerInitialization : Retrieve initialization configuration for a bare metal server +// This request retrieves configuration variables used to initialize the bare metal server, such as the image used, SSH +// keys, and any configured usernames and passwords. These attributes can subsequently be changed manually by the user +// and so are not guaranteed to be current. +func (vpc *VpcV1) GetBareMetalServerInitialization(getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { + return vpc.GetBareMetalServerInitializationWithContext(context.Background(), getBareMetalServerInitializationOptions) } -// DeletePublicGatewayWithContext is an alternate form of the DeletePublicGateway method which supports a Context parameter -func (vpc *VpcV1) DeletePublicGatewayWithContext(ctx context.Context, deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deletePublicGatewayOptions, "deletePublicGatewayOptions cannot be nil") +// GetBareMetalServerInitializationWithContext is an alternate form of the GetBareMetalServerInitialization method which supports a Context parameter +func (vpc *VpcV1) GetBareMetalServerInitializationWithContext(ctx context.Context, getBareMetalServerInitializationOptions *GetBareMetalServerInitializationOptions) (result *BareMetalServerInitialization, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deletePublicGatewayOptions, "deletePublicGatewayOptions") + err = core.ValidateStruct(getBareMetalServerInitializationOptions, "getBareMetalServerInitializationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deletePublicGatewayOptions.ID, + "id": *getBareMetalServerInitializationOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/initialization`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deletePublicGatewayOptions.Headers { + for headerName, headerValue := range getBareMetalServerInitializationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeletePublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetBareMetalServerInitialization") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// GetPublicGateway : Retrieve a public gateway -// This request retrieves a single public gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.GetPublicGatewayWithContext(context.Background(), getPublicGatewayOptions) -} - -// GetPublicGatewayWithContext is an alternate form of the GetPublicGateway method which supports a Context parameter -func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getPublicGatewayOptions, "getPublicGatewayOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getPublicGatewayOptions, "getPublicGatewayOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getPublicGatewayOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getPublicGatewayOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetPublicGateway") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -10435,7 +10500,7 @@ func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGate return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBareMetalServerInitialization) if err != nil { return } @@ -10445,247 +10510,160 @@ func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGate return } -// UpdatePublicGateway : Update a public gateway -// This request updates a public gateway's name. -func (vpc *VpcV1) UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - return vpc.UpdatePublicGatewayWithContext(context.Background(), updatePublicGatewayOptions) +// RestartBareMetalServer : Restart a bare metal server +// This request restarts a bare metal server. It will run immediately regardless of the state of the server. +func (vpc *VpcV1) RestartBareMetalServer(restartBareMetalServerOptions *RestartBareMetalServerOptions) (response *core.DetailedResponse, err error) { + return vpc.RestartBareMetalServerWithContext(context.Background(), restartBareMetalServerOptions) } -// UpdatePublicGatewayWithContext is an alternate form of the UpdatePublicGateway method which supports a Context parameter -func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updatePublicGatewayOptions, "updatePublicGatewayOptions cannot be nil") +// RestartBareMetalServerWithContext is an alternate form of the RestartBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) RestartBareMetalServerWithContext(ctx context.Context, restartBareMetalServerOptions *RestartBareMetalServerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(restartBareMetalServerOptions, "restartBareMetalServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updatePublicGatewayOptions, "updatePublicGatewayOptions") + err = core.ValidateStruct(restartBareMetalServerOptions, "restartBareMetalServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updatePublicGatewayOptions.ID, + "id": *restartBareMetalServerOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/restart`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updatePublicGatewayOptions.Headers { + for headerName, headerValue := range restartBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePublicGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RestartBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updatePublicGatewayOptions.PublicGatewayPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListFloatingIps : List all floating IPs -// This request lists all floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet -// to an instance. -func (vpc *VpcV1) ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { - return vpc.ListFloatingIpsWithContext(context.Background(), listFloatingIpsOptions) +// StartBareMetalServer : Start a bare metal server +// This request starts a bare metal server. It will run immediately provided the server is stopped. +func (vpc *VpcV1) StartBareMetalServer(startBareMetalServerOptions *StartBareMetalServerOptions) (response *core.DetailedResponse, err error) { + return vpc.StartBareMetalServerWithContext(context.Background(), startBareMetalServerOptions) } -// ListFloatingIpsWithContext is an alternate form of the ListFloatingIps method which supports a Context parameter -func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listFloatingIpsOptions, "listFloatingIpsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) - if err != nil { - return - } - - for headerName, headerValue := range listFloatingIpsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFloatingIps") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listFloatingIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listFloatingIpsOptions.Start)) - } - if listFloatingIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listFloatingIpsOptions.Limit)) - } - if listFloatingIpsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listFloatingIpsOptions.ResourceGroupID)) - } - - request, err := builder.Build() +// StartBareMetalServerWithContext is an alternate form of the StartBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) StartBareMetalServerWithContext(ctx context.Context, startBareMetalServerOptions *StartBareMetalServerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(startBareMetalServerOptions, "startBareMetalServerOptions cannot be nil") if err != nil { return } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) + err = core.ValidateStruct(startBareMetalServerOptions, "startBareMetalServerOptions") if err != nil { return } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// CreateFloatingIP : Reserve a floating IP -// This request reserves a new floating IP. -func (vpc *VpcV1) CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.CreateFloatingIPWithContext(context.Background(), createFloatingIPOptions) -} -// CreateFloatingIPWithContext is an alternate form of the CreateFloatingIP method which supports a Context parameter -func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createFloatingIPOptions, "createFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createFloatingIPOptions, "createFloatingIPOptions") - if err != nil { - return + pathParamsMap := map[string]string{ + "id": *startBareMetalServerOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/start`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createFloatingIPOptions.Headers { + for headerName, headerValue := range startBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "StartBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createFloatingIPOptions.FloatingIPPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteFloatingIP : Release a floating IP -// This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this -// request to succeed, the floating IP must not be required by another resource, such as a public gateway. -func (vpc *VpcV1) DeleteFloatingIP(deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteFloatingIPWithContext(context.Background(), deleteFloatingIPOptions) +// StopBareMetalServer : Stop a bare metal server +// This request stops a bare metal server. It will run immediately provided the server is running. Note: A soft stop may +// not complete as it relies on the operating system to perform the operation. +func (vpc *VpcV1) StopBareMetalServer(stopBareMetalServerOptions *StopBareMetalServerOptions) (response *core.DetailedResponse, err error) { + return vpc.StopBareMetalServerWithContext(context.Background(), stopBareMetalServerOptions) } -// DeleteFloatingIPWithContext is an alternate form of the DeleteFloatingIP method which supports a Context parameter -func (vpc *VpcV1) DeleteFloatingIPWithContext(ctx context.Context, deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteFloatingIPOptions, "deleteFloatingIPOptions cannot be nil") +// StopBareMetalServerWithContext is an alternate form of the StopBareMetalServer method which supports a Context parameter +func (vpc *VpcV1) StopBareMetalServerWithContext(ctx context.Context, stopBareMetalServerOptions *StopBareMetalServerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(stopBareMetalServerOptions, "stopBareMetalServerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteFloatingIPOptions, "deleteFloatingIPOptions") + err = core.ValidateStruct(stopBareMetalServerOptions, "stopBareMetalServerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteFloatingIPOptions.ID, + "id": *stopBareMetalServerOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/bare_metal_servers/{id}/stop`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteFloatingIPOptions.Headers { + for headerName, headerValue := range stopBareMetalServerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "StopBareMetalServer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if stopBareMetalServerOptions.Type != nil { + body["type"] = stopBareMetalServerOptions.Type + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -10696,40 +10674,33 @@ func (vpc *VpcV1) DeleteFloatingIPWithContext(ctx context.Context, deleteFloatin return } -// GetFloatingIP : Retrieve a floating IP -// This request retrieves a single floating IP specified by the identifier in the URL. -func (vpc *VpcV1) GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.GetFloatingIPWithContext(context.Background(), getFloatingIPOptions) +// ListVolumeProfiles : List all volume profiles +// This request lists all volume profiles available in the region. A volume profile specifies the performance +// characteristics and pricing model for a volume. +func (vpc *VpcV1) ListVolumeProfiles(listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListVolumeProfilesWithContext(context.Background(), listVolumeProfilesOptions) } -// GetFloatingIPWithContext is an alternate form of the GetFloatingIP method which supports a Context parameter -func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getFloatingIPOptions, "getFloatingIPOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getFloatingIPOptions, "getFloatingIPOptions") +// ListVolumeProfilesWithContext is an alternate form of the ListVolumeProfiles method which supports a Context parameter +func (vpc *VpcV1) ListVolumeProfilesWithContext(ctx context.Context, listVolumeProfilesOptions *ListVolumeProfilesOptions) (result *VolumeProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVolumeProfilesOptions, "listVolumeProfilesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *getFloatingIPOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles`, nil) if err != nil { return } - for headerName, headerValue := range getFloatingIPOptions.Headers { + for headerName, headerValue := range listVolumeProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumeProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10737,6 +10708,12 @@ func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOpt builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVolumeProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVolumeProfilesOptions.Start)) + } + if listVolumeProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVolumeProfilesOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -10749,7 +10726,7 @@ func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfileCollection) if err != nil { return } @@ -10759,54 +10736,48 @@ func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOpt return } -// UpdateFloatingIP : Update a floating IP -// This request updates a floating IP's name and/or target. -func (vpc *VpcV1) UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - return vpc.UpdateFloatingIPWithContext(context.Background(), updateFloatingIPOptions) +// GetVolumeProfile : Retrieve a volume profile +// This request retrieves a single volume profile specified by the name in the URL. +func (vpc *VpcV1) GetVolumeProfile(getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { + return vpc.GetVolumeProfileWithContext(context.Background(), getVolumeProfileOptions) } -// UpdateFloatingIPWithContext is an alternate form of the UpdateFloatingIP method which supports a Context parameter -func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateFloatingIPOptions, "updateFloatingIPOptions cannot be nil") +// GetVolumeProfileWithContext is an alternate form of the GetVolumeProfile method which supports a Context parameter +func (vpc *VpcV1) GetVolumeProfileWithContext(ctx context.Context, getVolumeProfileOptions *GetVolumeProfileOptions) (result *VolumeProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVolumeProfileOptions, "getVolumeProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateFloatingIPOptions, "updateFloatingIPOptions") + err = core.ValidateStruct(getVolumeProfileOptions, "getVolumeProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateFloatingIPOptions.ID, + "name": *getVolumeProfileOptions.Name, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volume/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateFloatingIPOptions.Headers { + for headerName, headerValue := range getVolumeProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFloatingIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolumeProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateFloatingIPOptions.FloatingIPPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -10818,7 +10789,7 @@ func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatin return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeProfile) if err != nil { return } @@ -10828,17 +10799,16 @@ func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatin return } -// ListNetworkAcls : List all network ACLs -// This request lists all network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules -// for all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that -// reverse traffic in response to allowed traffic is not automatically permitted. -func (vpc *VpcV1) ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { - return vpc.ListNetworkAclsWithContext(context.Background(), listNetworkAclsOptions) +// ListVolumes : List all volumes +// This request lists all volumes in the region. Volumes are network-connected block storage devices that may be +// attached to one or more instances in the same region. +func (vpc *VpcV1) ListVolumes(listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { + return vpc.ListVolumesWithContext(context.Background(), listVolumesOptions) } -// ListNetworkAclsWithContext is an alternate form of the ListNetworkAcls method which supports a Context parameter -func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listNetworkAclsOptions, "listNetworkAclsOptions") +// ListVolumesWithContext is an alternate form of the ListVolumes method which supports a Context parameter +func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions *ListVolumesOptions) (result *VolumeCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVolumesOptions, "listVolumesOptions") if err != nil { return } @@ -10846,16 +10816,16 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) if err != nil { return } - for headerName, headerValue := range listNetworkAclsOptions.Headers { + for headerName, headerValue := range listVolumesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkAcls") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumes") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10863,14 +10833,17 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkAclsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkAclsOptions.Start)) + if listVolumesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVolumesOptions.Start)) } - if listNetworkAclsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkAclsOptions.Limit)) + if listVolumesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVolumesOptions.Limit)) } - if listNetworkAclsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listNetworkAclsOptions.ResourceGroupID)) + if listVolumesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listVolumesOptions.Name)) + } + if listVolumesOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listVolumesOptions.ZoneName)) } request, err := builder.Build() @@ -10884,7 +10857,7 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeCollection) if err != nil { return } @@ -10894,16 +10867,20 @@ func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAcl return } -// CreateNetworkACL : Create a network ACL -// This request creates a new network ACL from a network ACL prototype object. The prototype object is structured in the -// same way as a retrieved network ACL, and contains the information necessary to create the new network ACL. -func (vpc *VpcV1) CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.CreateNetworkACLWithContext(context.Background(), createNetworkACLOptions) +// CreateVolume : Create a volume +// This request creates a new volume from a volume prototype object. The prototype object is structured in the same way +// as a retrieved volume, and contains the information necessary to create the new volume. +func (vpc *VpcV1) CreateVolume(createVolumeOptions *CreateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + return vpc.CreateVolumeWithContext(context.Background(), createVolumeOptions) } -// CreateNetworkACLWithContext is an alternate form of the CreateNetworkACL method which supports a Context parameter -func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(createNetworkACLOptions, "createNetworkACLOptions") +// CreateVolumeWithContext is an alternate form of the CreateVolume method which supports a Context parameter +func (vpc *VpcV1) CreateVolumeWithContext(ctx context.Context, createVolumeOptions *CreateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVolumeOptions, "createVolumeOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createVolumeOptions, "createVolumeOptions") if err != nil { return } @@ -10911,16 +10888,16 @@ func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetwork builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes`, nil) if err != nil { return } - for headerName, headerValue := range createNetworkACLOptions.Headers { + for headerName, headerValue := range createVolumeOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVolume") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -10930,11 +10907,9 @@ func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetwork builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if createNetworkACLOptions.NetworkACLPrototype != nil { - _, err = builder.SetBodyContentJSON(createNetworkACLOptions.NetworkACLPrototype) - if err != nil { - return - } + _, err = builder.SetBodyContentJSON(createVolumeOptions.VolumePrototype) + if err != nil { + return } request, err := builder.Build() @@ -10948,7 +10923,7 @@ func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetwork return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) if err != nil { return } @@ -10958,41 +10933,41 @@ func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetwork return } -// DeleteNetworkACL : Delete a network ACL -// This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL -// must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. -func (vpc *VpcV1) DeleteNetworkACL(deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteNetworkACLWithContext(context.Background(), deleteNetworkACLOptions) +// DeleteVolume : Delete a volume +// This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not be +// attached to any instances. +func (vpc *VpcV1) DeleteVolume(deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVolumeWithContext(context.Background(), deleteVolumeOptions) } -// DeleteNetworkACLWithContext is an alternate form of the DeleteNetworkACL method which supports a Context parameter -func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteNetworkACLOptions, "deleteNetworkACLOptions cannot be nil") +// DeleteVolumeWithContext is an alternate form of the DeleteVolume method which supports a Context parameter +func (vpc *VpcV1) DeleteVolumeWithContext(ctx context.Context, deleteVolumeOptions *DeleteVolumeOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVolumeOptions, "deleteVolumeOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteNetworkACLOptions, "deleteNetworkACLOptions") + err = core.ValidateStruct(deleteVolumeOptions, "deleteVolumeOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteNetworkACLOptions.ID, + "id": *deleteVolumeOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteNetworkACLOptions.Headers { + for headerName, headerValue := range deleteVolumeOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVolume") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11010,40 +10985,40 @@ func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetwork return } -// GetNetworkACL : Retrieve a network ACL -// This request retrieves a single network ACL specified by the identifier in the URL. -func (vpc *VpcV1) GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.GetNetworkACLWithContext(context.Background(), getNetworkACLOptions) +// GetVolume : Retrieve a volume +// This request retrieves a single volume specified by the identifier in the URL. +func (vpc *VpcV1) GetVolume(getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + return vpc.GetVolumeWithContext(context.Background(), getVolumeOptions) } -// GetNetworkACLWithContext is an alternate form of the GetNetworkACL method which supports a Context parameter -func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkACLOptions, "getNetworkACLOptions cannot be nil") +// GetVolumeWithContext is an alternate form of the GetVolume method which supports a Context parameter +func (vpc *VpcV1) GetVolumeWithContext(ctx context.Context, getVolumeOptions *GetVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVolumeOptions, "getVolumeOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getNetworkACLOptions, "getNetworkACLOptions") + err = core.ValidateStruct(getVolumeOptions, "getVolumeOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getNetworkACLOptions.ID, + "id": *getVolumeOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getNetworkACLOptions.Headers { + for headerName, headerValue := range getVolumeOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolume") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11063,7 +11038,7 @@ func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) if err != nil { return } @@ -11073,40 +11048,41 @@ func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOpt return } -// UpdateNetworkACL : Update a network ACL -// This request updates a network ACL's name. -func (vpc *VpcV1) UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - return vpc.UpdateNetworkACLWithContext(context.Background(), updateNetworkACLOptions) +// UpdateVolume : Update a volume +// This request updates a volume with the information in a provided volume patch. The volume patch object is structured +// in the same way as a retrieved volume and contains only the information to be updated. +func (vpc *VpcV1) UpdateVolume(updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + return vpc.UpdateVolumeWithContext(context.Background(), updateVolumeOptions) } -// UpdateNetworkACLWithContext is an alternate form of the UpdateNetworkACL method which supports a Context parameter -func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateNetworkACLOptions, "updateNetworkACLOptions cannot be nil") +// UpdateVolumeWithContext is an alternate form of the UpdateVolume method which supports a Context parameter +func (vpc *VpcV1) UpdateVolumeWithContext(ctx context.Context, updateVolumeOptions *UpdateVolumeOptions) (result *Volume, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVolumeOptions, "updateVolumeOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateNetworkACLOptions, "updateNetworkACLOptions") + err = core.ValidateStruct(updateVolumeOptions, "updateVolumeOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateNetworkACLOptions.ID, + "id": *updateVolumeOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateNetworkACLOptions.Headers { + for headerName, headerValue := range updateVolumeOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACL") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVolume") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11116,7 +11092,7 @@ func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetwork builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateNetworkACLOptions.NetworkACLPatch) + _, err = builder.SetBodyContentJSON(updateVolumeOptions.VolumePatch) if err != nil { return } @@ -11132,7 +11108,7 @@ func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetwork return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolume) if err != nil { return } @@ -11142,114 +11118,168 @@ func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetwork return } -// ListNetworkACLRules : List all rules for a network ACL -// This request lists all rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and -// a destination CIDR block over a particular protocol and port range. -func (vpc *VpcV1) ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListNetworkACLRulesWithContext(context.Background(), listNetworkACLRulesOptions) +// DeleteSnapshots : Delete a filtered collection of snapshots +// This request deletes all snapshots created from a specific source volume. +func (vpc *VpcV1) DeleteSnapshots(deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSnapshotsWithContext(context.Background(), deleteSnapshotsOptions) } -// ListNetworkACLRulesWithContext is an alternate form of the ListNetworkACLRules method which supports a Context parameter -func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listNetworkACLRulesOptions, "listNetworkACLRulesOptions cannot be nil") +// DeleteSnapshotsWithContext is an alternate form of the DeleteSnapshots method which supports a Context parameter +func (vpc *VpcV1) DeleteSnapshotsWithContext(ctx context.Context, deleteSnapshotsOptions *DeleteSnapshotsOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSnapshotsOptions, "deleteSnapshotsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listNetworkACLRulesOptions, "listNetworkACLRulesOptions") + err = core.ValidateStruct(deleteSnapshotsOptions, "deleteSnapshotsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "network_acl_id": *listNetworkACLRulesOptions.NetworkACLID, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) if err != nil { return } - for headerName, headerValue := range listNetworkACLRulesOptions.Headers { + for headerName, headerValue := range deleteSnapshotsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkACLRules") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshots") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listNetworkACLRulesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listNetworkACLRulesOptions.Start)) - } - if listNetworkACLRulesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listNetworkACLRulesOptions.Limit)) - } - if listNetworkACLRulesOptions.Direction != nil { - builder.AddQuery("direction", fmt.Sprint(*listNetworkACLRulesOptions.Direction)) - } + builder.AddQuery("source_volume.id", fmt.Sprint(*deleteSnapshotsOptions.SourceVolumeID)) request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRuleCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateNetworkACLRule : Create a rule for a network ACL -// This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the -// same way as a retrieved rule, and contains the information necessary to create the new rule. -func (vpc *VpcV1) CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.CreateNetworkACLRuleWithContext(context.Background(), createNetworkACLRuleOptions) +// ListSnapshots : List all snapshots +// This request lists all snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is +// created. +func (vpc *VpcV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { + return vpc.ListSnapshotsWithContext(context.Background(), listSnapshotsOptions) } -// CreateNetworkACLRuleWithContext is an alternate form of the CreateNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createNetworkACLRuleOptions, "createNetworkACLRuleOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(createNetworkACLRuleOptions, "createNetworkACLRuleOptions") +// ListSnapshotsWithContext is an alternate form of the ListSnapshots method which supports a Context parameter +func (vpc *VpcV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *SnapshotCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSnapshotsOptions, "listSnapshotsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "network_acl_id": *createNetworkACLRuleOptions.NetworkACLID, - } - - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) if err != nil { return } - for headerName, headerValue := range createNetworkACLRuleOptions.Headers { + for headerName, headerValue := range listSnapshotsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSnapshots") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSnapshotsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSnapshotsOptions.Start)) + } + if listSnapshotsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSnapshotsOptions.Limit)) + } + if listSnapshotsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSnapshotsOptions.ResourceGroupID)) + } + if listSnapshotsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listSnapshotsOptions.Name)) + } + if listSnapshotsOptions.SourceVolumeID != nil { + builder.AddQuery("source_volume.id", fmt.Sprint(*listSnapshotsOptions.SourceVolumeID)) + } + if listSnapshotsOptions.SourceVolumeCRN != nil { + builder.AddQuery("source_volume.crn", fmt.Sprint(*listSnapshotsOptions.SourceVolumeCRN)) + } + if listSnapshotsOptions.SourceImageID != nil { + builder.AddQuery("source_image.id", fmt.Sprint(*listSnapshotsOptions.SourceImageID)) + } + if listSnapshotsOptions.SourceImageCRN != nil { + builder.AddQuery("source_image.crn", fmt.Sprint(*listSnapshotsOptions.SourceImageCRN)) + } + if listSnapshotsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listSnapshotsOptions.Sort)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshotCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateSnapshot : Create a snapshot +// This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the same +// way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. +func (vpc *VpcV1) CreateSnapshot(createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + return vpc.CreateSnapshotWithContext(context.Background(), createSnapshotOptions) +} + +// CreateSnapshotWithContext is an alternate form of the CreateSnapshot method which supports a Context parameter +func (vpc *VpcV1) CreateSnapshotWithContext(ctx context.Context, createSnapshotOptions *CreateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSnapshotOptions, "createSnapshotOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createSnapshotOptions, "createSnapshotOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots`, nil) + if err != nil { + return + } + + for headerName, headerValue := range createSnapshotOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11259,7 +11289,17 @@ func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNet builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createNetworkACLRuleOptions.NetworkACLRulePrototype) + body := make(map[string]interface{}) + if createSnapshotOptions.SourceVolume != nil { + body["source_volume"] = createSnapshotOptions.SourceVolume + } + if createSnapshotOptions.Name != nil { + body["name"] = createSnapshotOptions.Name + } + if createSnapshotOptions.ResourceGroup != nil { + body["resource_group"] = createSnapshotOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -11275,7 +11315,7 @@ func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNet return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) if err != nil { return } @@ -11285,41 +11325,40 @@ func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNet return } -// DeleteNetworkACLRule : Delete a network ACL rule -// This request deletes a rule. This operation cannot be reversed. -func (vpc *VpcV1) DeleteNetworkACLRule(deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteNetworkACLRuleWithContext(context.Background(), deleteNetworkACLRuleOptions) +// DeleteSnapshot : Delete a snapshot +// This request deletes a snapshot. This operation cannot be reversed. +func (vpc *VpcV1) DeleteSnapshot(deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSnapshotWithContext(context.Background(), deleteSnapshotOptions) } -// DeleteNetworkACLRuleWithContext is an alternate form of the DeleteNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions cannot be nil") +// DeleteSnapshotWithContext is an alternate form of the DeleteSnapshot method which supports a Context parameter +func (vpc *VpcV1) DeleteSnapshotWithContext(ctx context.Context, deleteSnapshotOptions *DeleteSnapshotOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSnapshotOptions, "deleteSnapshotOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions") + err = core.ValidateStruct(deleteSnapshotOptions, "deleteSnapshotOptions") if err != nil { return } pathParamsMap := map[string]string{ - "network_acl_id": *deleteNetworkACLRuleOptions.NetworkACLID, - "id": *deleteNetworkACLRuleOptions.ID, + "id": *deleteSnapshotOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteNetworkACLRuleOptions.Headers { + for headerName, headerValue := range deleteSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11337,41 +11376,40 @@ func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNet return } -// GetNetworkACLRule : Retrieve a network ACL rule -// This request retrieves a single rule specified by the identifier in the URL. -func (vpc *VpcV1) GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.GetNetworkACLRuleWithContext(context.Background(), getNetworkACLRuleOptions) +// GetSnapshot : Retrieve a snapshot +// This request retrieves a single snapshot specified by the identifier in the URL. +func (vpc *VpcV1) GetSnapshot(getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + return vpc.GetSnapshotWithContext(context.Background(), getSnapshotOptions) } -// GetNetworkACLRuleWithContext is an alternate form of the GetNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNetworkACLRuleOptions, "getNetworkACLRuleOptions cannot be nil") +// GetSnapshotWithContext is an alternate form of the GetSnapshot method which supports a Context parameter +func (vpc *VpcV1) GetSnapshotWithContext(ctx context.Context, getSnapshotOptions *GetSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSnapshotOptions, "getSnapshotOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getNetworkACLRuleOptions, "getNetworkACLRuleOptions") + err = core.ValidateStruct(getSnapshotOptions, "getSnapshotOptions") if err != nil { return } pathParamsMap := map[string]string{ - "network_acl_id": *getNetworkACLRuleOptions.NetworkACLID, - "id": *getNetworkACLRuleOptions.ID, + "id": *getSnapshotOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getNetworkACLRuleOptions.Headers { + for headerName, headerValue := range getSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11391,7 +11429,7 @@ func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkAC return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) if err != nil { return } @@ -11401,42 +11439,40 @@ func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkAC return } -// UpdateNetworkACLRule : Update a network ACL rule -// This request updates a rule with the information in a provided rule patch. The rule patch object contains only the -// information to be updated. The request will fail if the information is not applicable to the rule's protocol. -func (vpc *VpcV1) UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateNetworkACLRuleWithContext(context.Background(), updateNetworkACLRuleOptions) +// UpdateSnapshot : Update a snapshot +// This request updates a snapshot's name. +func (vpc *VpcV1) UpdateSnapshot(updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + return vpc.UpdateSnapshotWithContext(context.Background(), updateSnapshotOptions) } -// UpdateNetworkACLRuleWithContext is an alternate form of the UpdateNetworkACLRule method which supports a Context parameter -func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions cannot be nil") +// UpdateSnapshotWithContext is an alternate form of the UpdateSnapshot method which supports a Context parameter +func (vpc *VpcV1) UpdateSnapshotWithContext(ctx context.Context, updateSnapshotOptions *UpdateSnapshotOptions) (result *Snapshot, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSnapshotOptions, "updateSnapshotOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions") + err = core.ValidateStruct(updateSnapshotOptions, "updateSnapshotOptions") if err != nil { return } pathParamsMap := map[string]string{ - "network_acl_id": *updateNetworkACLRuleOptions.NetworkACLID, - "id": *updateNetworkACLRuleOptions.ID, + "id": *updateSnapshotOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/snapshots/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateNetworkACLRuleOptions.Headers { + for headerName, headerValue := range updateSnapshotOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACLRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSnapshot") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11446,7 +11482,7 @@ func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNet builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateNetworkACLRuleOptions.NetworkACLRulePatch) + _, err = builder.SetBodyContentJSON(updateSnapshotOptions.SnapshotPatch) if err != nil { return } @@ -11462,7 +11498,7 @@ func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNet return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSnapshot) if err != nil { return } @@ -11472,18 +11508,19 @@ func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNet return } -// ListSecurityGroups : List all security groups -// This request lists all security groups in the region. Security groups provide a way to apply IP filtering rules to -// instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to security -// groups define which traffic the security group permits. Security group rules are stateful such that reverse traffic -// in response to allowed traffic is automatically permitted. -func (vpc *VpcV1) ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupsWithContext(context.Background(), listSecurityGroupsOptions) +// ListRegions : List all regions +// This request lists all regions. Each region is a separate geographic area that contains multiple isolated zones. +// Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other zones +// in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault isolation +// available. Resources deployed within a single region also benefit from the low latency afforded by geographic +// proximity. +func (vpc *VpcV1) ListRegions(listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { + return vpc.ListRegionsWithContext(context.Background(), listRegionsOptions) } -// ListSecurityGroupsWithContext is an alternate form of the ListSecurityGroups method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listSecurityGroupsOptions, "listSecurityGroupsOptions") +// ListRegionsWithContext is an alternate form of the ListRegions method which supports a Context parameter +func (vpc *VpcV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions *ListRegionsOptions) (result *RegionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listRegionsOptions, "listRegionsOptions") if err != nil { return } @@ -11491,16 +11528,16 @@ func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurit builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions`, nil) if err != nil { return } - for headerName, headerValue := range listSecurityGroupsOptions.Headers { + for headerName, headerValue := range listRegionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroups") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegions") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11508,24 +11545,6 @@ func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurit builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupsOptions.Start)) - } - if listSecurityGroupsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupsOptions.Limit)) - } - if listSecurityGroupsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listSecurityGroupsOptions.ResourceGroupID)) - } - if listSecurityGroupsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listSecurityGroupsOptions.VPCID)) - } - if listSecurityGroupsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listSecurityGroupsOptions.VPCCRN)) - } - if listSecurityGroupsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listSecurityGroupsOptions.VPCName)) - } request, err := builder.Build() if err != nil { @@ -11538,7 +11557,7 @@ func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurit return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionCollection) if err != nil { return } @@ -11548,67 +11567,48 @@ func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurit return } -// CreateSecurityGroup : Create a security group -// This request creates a new security group from a security group prototype object. The prototype object is structured -// in the same way as a retrieved security group, and contains the information necessary to create the new security -// group. If security group rules are included in the prototype object, those rules will be added to the security group. -// Each security group is scoped to one VPC. Only network interfaces on instances in that VPC can be added to the -// security group. -func (vpc *VpcV1) CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupWithContext(context.Background(), createSecurityGroupOptions) +// GetRegion : Retrieve a region +// This request retrieves a single region specified by the name in the URL. +func (vpc *VpcV1) GetRegion(getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { + return vpc.GetRegionWithContext(context.Background(), getRegionOptions) } -// CreateSecurityGroupWithContext is an alternate form of the CreateSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupOptions, "createSecurityGroupOptions cannot be nil") +// GetRegionWithContext is an alternate form of the GetRegion method which supports a Context parameter +func (vpc *VpcV1) GetRegionWithContext(ctx context.Context, getRegionOptions *GetRegionOptions) (result *Region, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRegionOptions, "getRegionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSecurityGroupOptions, "createSecurityGroupOptions") + err = core.ValidateStruct(getRegionOptions, "getRegionOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "name": *getRegionOptions.Name, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSecurityGroupOptions.Headers { + for headerName, headerValue := range getRegionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegion") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createSecurityGroupOptions.VPC != nil { - body["vpc"] = createSecurityGroupOptions.VPC - } - if createSecurityGroupOptions.Name != nil { - body["name"] = createSecurityGroupOptions.Name - } - if createSecurityGroupOptions.ResourceGroup != nil { - body["resource_group"] = createSecurityGroupOptions.ResourceGroup - } - if createSecurityGroupOptions.Rules != nil { - body["rules"] = createSecurityGroupOptions.Rules - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -11620,7 +11620,7 @@ func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecu return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegion) if err != nil { return } @@ -11630,45 +11630,45 @@ func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecu return } -// DeleteSecurityGroup : Delete a security group -// This request deletes a security group. A security group cannot be deleted if it is referenced by any network -// interfaces or other security group rules. Additionally, a VPC's default security group cannot be deleted. This -// operation cannot be reversed. -func (vpc *VpcV1) DeleteSecurityGroup(deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupWithContext(context.Background(), deleteSecurityGroupOptions) +// ListRegionZones : List all zones in a region +// This request lists all zones in a region. Zones represent logically-isolated data centers with high-bandwidth and +// low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. +func (vpc *VpcV1) ListRegionZones(listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { + return vpc.ListRegionZonesWithContext(context.Background(), listRegionZonesOptions) } -// DeleteSecurityGroupWithContext is an alternate form of the DeleteSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupWithContext(ctx context.Context, deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupOptions, "deleteSecurityGroupOptions cannot be nil") +// ListRegionZonesWithContext is an alternate form of the ListRegionZones method which supports a Context parameter +func (vpc *VpcV1) ListRegionZonesWithContext(ctx context.Context, listRegionZonesOptions *ListRegionZonesOptions) (result *ZoneCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRegionZonesOptions, "listRegionZonesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSecurityGroupOptions, "deleteSecurityGroupOptions") + err = core.ValidateStruct(listRegionZonesOptions, "listRegionZonesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteSecurityGroupOptions.ID, + "region_name": *listRegionZonesOptions.RegionName, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSecurityGroupOptions.Headers { + for headerName, headerValue := range listRegionZonesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListRegionZones") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -11678,45 +11678,57 @@ func (vpc *VpcV1) DeleteSecurityGroupWithContext(ctx context.Context, deleteSecu return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZoneCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetSecurityGroup : Retrieve a security group -// This request retrieves a single security group specified by the identifier in the URL path. -func (vpc *VpcV1) GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupWithContext(context.Background(), getSecurityGroupOptions) +// GetRegionZone : Retrieve a zone +// This request retrieves a single zone specified by the region and zone names in the URL. +func (vpc *VpcV1) GetRegionZone(getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { + return vpc.GetRegionZoneWithContext(context.Background(), getRegionZoneOptions) } -// GetSecurityGroupWithContext is an alternate form of the GetSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupOptions, "getSecurityGroupOptions cannot be nil") +// GetRegionZoneWithContext is an alternate form of the GetRegionZone method which supports a Context parameter +func (vpc *VpcV1) GetRegionZoneWithContext(ctx context.Context, getRegionZoneOptions *GetRegionZoneOptions) (result *Zone, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRegionZoneOptions, "getRegionZoneOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupOptions, "getSecurityGroupOptions") + err = core.ValidateStruct(getRegionZoneOptions, "getRegionZoneOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getSecurityGroupOptions.ID, + "region_name": *getRegionZoneOptions.RegionName, + "name": *getRegionZoneOptions.Name, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/regions/{region_name}/zones/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupOptions.Headers { + for headerName, headerValue := range getRegionZoneOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetRegionZone") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11736,7 +11748,7 @@ func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGr return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalZone) if err != nil { return } @@ -11746,54 +11758,49 @@ func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGr return } -// UpdateSecurityGroup : Update a security group -// This request updates a security group with the information provided in a security group patch object. The security -// group patch object is structured in the same way as a retrieved security group and contains only the information to -// be updated. -func (vpc *VpcV1) UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - return vpc.UpdateSecurityGroupWithContext(context.Background(), updateSecurityGroupOptions) +// ListPublicGateways : List all public gateways +// This request lists all public gateways in the region. A public gateway is a virtual network device associated with a +// VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the +// same zone only. +func (vpc *VpcV1) ListPublicGateways(listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { + return vpc.ListPublicGatewaysWithContext(context.Background(), listPublicGatewaysOptions) } -// UpdateSecurityGroupWithContext is an alternate form of the UpdateSecurityGroup method which supports a Context parameter -func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSecurityGroupOptions, "updateSecurityGroupOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(updateSecurityGroupOptions, "updateSecurityGroupOptions") +// ListPublicGatewaysWithContext is an alternate form of the ListPublicGateways method which supports a Context parameter +func (vpc *VpcV1) ListPublicGatewaysWithContext(ctx context.Context, listPublicGatewaysOptions *ListPublicGatewaysOptions) (result *PublicGatewayCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listPublicGatewaysOptions, "listPublicGatewaysOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *updateSecurityGroupOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) if err != nil { return } - for headerName, headerValue := range updateSecurityGroupOptions.Headers { + for headerName, headerValue := range listPublicGatewaysOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroup") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListPublicGateways") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - _, err = builder.SetBodyContentJSON(updateSecurityGroupOptions.SecurityGroupPatch) - if err != nil { - return + if listPublicGatewaysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listPublicGatewaysOptions.Start)) + } + if listPublicGatewaysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listPublicGatewaysOptions.Limit)) + } + if listPublicGatewaysOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listPublicGatewaysOptions.ResourceGroupID)) } request, err := builder.Build() @@ -11807,7 +11814,7 @@ func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecu return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGatewayCollection) if err != nil { return } @@ -11817,53 +11824,69 @@ func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecu return } -// ListSecurityGroupNetworkInterfaces : List all network interfaces associated with a security group -// This request lists all network interfaces associated with a security group, to which the rules in the security group -// are applied. -func (vpc *VpcV1) ListSecurityGroupNetworkInterfaces(listSecurityGroupNetworkInterfacesOptions *ListSecurityGroupNetworkInterfacesOptions) (result *NetworkInterfaceCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupNetworkInterfacesWithContext(context.Background(), listSecurityGroupNetworkInterfacesOptions) +// CreatePublicGateway : Create a public gateway +// This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must +// not already have a public gateway in the specified zone. +// +// If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound to +// the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway must +// be explicitly attached to each subnet it will provide connectivity for. +func (vpc *VpcV1) CreatePublicGateway(createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.CreatePublicGatewayWithContext(context.Background(), createPublicGatewayOptions) } -// ListSecurityGroupNetworkInterfacesWithContext is an alternate form of the ListSecurityGroupNetworkInterfaces method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupNetworkInterfacesWithContext(ctx context.Context, listSecurityGroupNetworkInterfacesOptions *ListSecurityGroupNetworkInterfacesOptions) (result *NetworkInterfaceCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupNetworkInterfacesOptions, "listSecurityGroupNetworkInterfacesOptions cannot be nil") +// CreatePublicGatewayWithContext is an alternate form of the CreatePublicGateway method which supports a Context parameter +func (vpc *VpcV1) CreatePublicGatewayWithContext(ctx context.Context, createPublicGatewayOptions *CreatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createPublicGatewayOptions, "createPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listSecurityGroupNetworkInterfacesOptions, "listSecurityGroupNetworkInterfacesOptions") + err = core.ValidateStruct(createPublicGatewayOptions, "createPublicGatewayOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupNetworkInterfacesOptions.SecurityGroupID, - } - - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways`, nil) if err != nil { return } - for headerName, headerValue := range listSecurityGroupNetworkInterfacesOptions.Headers { + for headerName, headerValue := range createPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupNetworkInterfaces") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreatePublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupNetworkInterfacesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupNetworkInterfacesOptions.Start)) + + body := make(map[string]interface{}) + if createPublicGatewayOptions.VPC != nil { + body["vpc"] = createPublicGatewayOptions.VPC } - if listSecurityGroupNetworkInterfacesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupNetworkInterfacesOptions.Limit)) + if createPublicGatewayOptions.Zone != nil { + body["zone"] = createPublicGatewayOptions.Zone + } + if createPublicGatewayOptions.FloatingIP != nil { + body["floating_ip"] = createPublicGatewayOptions.FloatingIP + } + if createPublicGatewayOptions.Name != nil { + body["name"] = createPublicGatewayOptions.Name + } + if createPublicGatewayOptions.ResourceGroup != nil { + body["resource_group"] = createPublicGatewayOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } request, err := builder.Build() @@ -11877,7 +11900,7 @@ func (vpc *VpcV1) ListSecurityGroupNetworkInterfacesWithContext(ctx context.Cont return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterfaceCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -11887,44 +11910,42 @@ func (vpc *VpcV1) ListSecurityGroupNetworkInterfacesWithContext(ctx context.Cont return } -// RemoveSecurityGroupNetworkInterface : Remove a network interface from a security group -// This request removes a network interface from a security group. Security groups are stateful, so any changes to a -// network interface's security groups are applied to new connections. Existing connections are not affected. If the -// network interface being removed has no other security groups, it will be attached to the VPC's default security -// group. -func (vpc *VpcV1) RemoveSecurityGroupNetworkInterface(removeSecurityGroupNetworkInterfaceOptions *RemoveSecurityGroupNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveSecurityGroupNetworkInterfaceWithContext(context.Background(), removeSecurityGroupNetworkInterfaceOptions) +// DeletePublicGateway : Delete a public gateway +// This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public +// gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the +// floating IP was created when the public gateway was created, it will be deleted. +func (vpc *VpcV1) DeletePublicGateway(deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.DeletePublicGatewayWithContext(context.Background(), deletePublicGatewayOptions) } -// RemoveSecurityGroupNetworkInterfaceWithContext is an alternate form of the RemoveSecurityGroupNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) RemoveSecurityGroupNetworkInterfaceWithContext(ctx context.Context, removeSecurityGroupNetworkInterfaceOptions *RemoveSecurityGroupNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeSecurityGroupNetworkInterfaceOptions, "removeSecurityGroupNetworkInterfaceOptions cannot be nil") +// DeletePublicGatewayWithContext is an alternate form of the DeletePublicGateway method which supports a Context parameter +func (vpc *VpcV1) DeletePublicGatewayWithContext(ctx context.Context, deletePublicGatewayOptions *DeletePublicGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deletePublicGatewayOptions, "deletePublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeSecurityGroupNetworkInterfaceOptions, "removeSecurityGroupNetworkInterfaceOptions") + err = core.ValidateStruct(deletePublicGatewayOptions, "deletePublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *removeSecurityGroupNetworkInterfaceOptions.SecurityGroupID, - "id": *removeSecurityGroupNetworkInterfaceOptions.ID, + "id": *deletePublicGatewayOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeSecurityGroupNetworkInterfaceOptions.Headers { + for headerName, headerValue := range deletePublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveSecurityGroupNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeletePublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11942,42 +11963,40 @@ func (vpc *VpcV1) RemoveSecurityGroupNetworkInterfaceWithContext(ctx context.Con return } -// GetSecurityGroupNetworkInterface : Retrieve a network interface in a security group -// This request retrieves a single network interface specified by the identifier in the URL path. The network interface -// must be an existing member of the security group. -func (vpc *VpcV1) GetSecurityGroupNetworkInterface(getSecurityGroupNetworkInterfaceOptions *GetSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupNetworkInterfaceWithContext(context.Background(), getSecurityGroupNetworkInterfaceOptions) +// GetPublicGateway : Retrieve a public gateway +// This request retrieves a single public gateway specified by the identifier in the URL. +func (vpc *VpcV1) GetPublicGateway(getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.GetPublicGatewayWithContext(context.Background(), getPublicGatewayOptions) } -// GetSecurityGroupNetworkInterfaceWithContext is an alternate form of the GetSecurityGroupNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupNetworkInterfaceWithContext(ctx context.Context, getSecurityGroupNetworkInterfaceOptions *GetSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupNetworkInterfaceOptions, "getSecurityGroupNetworkInterfaceOptions cannot be nil") +// GetPublicGatewayWithContext is an alternate form of the GetPublicGateway method which supports a Context parameter +func (vpc *VpcV1) GetPublicGatewayWithContext(ctx context.Context, getPublicGatewayOptions *GetPublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getPublicGatewayOptions, "getPublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupNetworkInterfaceOptions, "getSecurityGroupNetworkInterfaceOptions") + err = core.ValidateStruct(getPublicGatewayOptions, "getPublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupNetworkInterfaceOptions.SecurityGroupID, - "id": *getSecurityGroupNetworkInterfaceOptions.ID, + "id": *getPublicGatewayOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupNetworkInterfaceOptions.Headers { + for headerName, headerValue := range getPublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetPublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -11997,7 +12016,7 @@ func (vpc *VpcV1) GetSecurityGroupNetworkInterfaceWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -12007,51 +12026,54 @@ func (vpc *VpcV1) GetSecurityGroupNetworkInterfaceWithContext(ctx context.Contex return } -// AddSecurityGroupNetworkInterface : Add a network interface to a security group -// This request adds an existing network interface to an existing security group. When a network interface is added to a -// security group, the security group rules are applied to the network interface. A request body is not required, and if -// provided, is ignored. -func (vpc *VpcV1) AddSecurityGroupNetworkInterface(addSecurityGroupNetworkInterfaceOptions *AddSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - return vpc.AddSecurityGroupNetworkInterfaceWithContext(context.Background(), addSecurityGroupNetworkInterfaceOptions) +// UpdatePublicGateway : Update a public gateway +// This request updates a public gateway's name. +func (vpc *VpcV1) UpdatePublicGateway(updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + return vpc.UpdatePublicGatewayWithContext(context.Background(), updatePublicGatewayOptions) } -// AddSecurityGroupNetworkInterfaceWithContext is an alternate form of the AddSecurityGroupNetworkInterface method which supports a Context parameter -func (vpc *VpcV1) AddSecurityGroupNetworkInterfaceWithContext(ctx context.Context, addSecurityGroupNetworkInterfaceOptions *AddSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addSecurityGroupNetworkInterfaceOptions, "addSecurityGroupNetworkInterfaceOptions cannot be nil") +// UpdatePublicGatewayWithContext is an alternate form of the UpdatePublicGateway method which supports a Context parameter +func (vpc *VpcV1) UpdatePublicGatewayWithContext(ctx context.Context, updatePublicGatewayOptions *UpdatePublicGatewayOptions) (result *PublicGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updatePublicGatewayOptions, "updatePublicGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addSecurityGroupNetworkInterfaceOptions, "addSecurityGroupNetworkInterfaceOptions") + err = core.ValidateStruct(updatePublicGatewayOptions, "updatePublicGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *addSecurityGroupNetworkInterfaceOptions.SecurityGroupID, - "id": *addSecurityGroupNetworkInterfaceOptions.ID, + "id": *updatePublicGatewayOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/public_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range addSecurityGroupNetworkInterfaceOptions.Headers { + for headerName, headerValue := range updatePublicGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddSecurityGroupNetworkInterface") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdatePublicGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updatePublicGatewayOptions.PublicGatewayPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -12063,7 +12085,7 @@ func (vpc *VpcV1) AddSecurityGroupNetworkInterfaceWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPublicGateway) if err != nil { return } @@ -12073,42 +12095,33 @@ func (vpc *VpcV1) AddSecurityGroupNetworkInterfaceWithContext(ctx context.Contex return } -// ListSecurityGroupRules : List all rules in a security group -// This request lists all rules in a security group. These rules define what traffic the security group permits. -// Security group rules are stateful, such that reverse traffic in response to allowed traffic is automatically -// permitted. -func (vpc *VpcV1) ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupRulesWithContext(context.Background(), listSecurityGroupRulesOptions) +// ListFloatingIps : List all floating IPs +// This request lists all floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet +// to an instance. +func (vpc *VpcV1) ListFloatingIps(listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { + return vpc.ListFloatingIpsWithContext(context.Background(), listFloatingIpsOptions) } -// ListSecurityGroupRulesWithContext is an alternate form of the ListSecurityGroupRules method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions") +// ListFloatingIpsWithContext is an alternate form of the ListFloatingIps method which supports a Context parameter +func (vpc *VpcV1) ListFloatingIpsWithContext(ctx context.Context, listFloatingIpsOptions *ListFloatingIpsOptions) (result *FloatingIPCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listFloatingIpsOptions, "listFloatingIpsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupRulesOptions.SecurityGroupID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) if err != nil { return } - for headerName, headerValue := range listSecurityGroupRulesOptions.Headers { + for headerName, headerValue := range listFloatingIpsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupRules") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFloatingIps") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12116,6 +12129,15 @@ func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSec builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listFloatingIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listFloatingIpsOptions.Start)) + } + if listFloatingIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listFloatingIpsOptions.Limit)) + } + if listFloatingIpsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listFloatingIpsOptions.ResourceGroupID)) + } request, err := builder.Build() if err != nil { @@ -12128,7 +12150,7 @@ func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSec return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRuleCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIPCollection) if err != nil { return } @@ -12138,45 +12160,36 @@ func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSec return } -// CreateSecurityGroupRule : Create a rule for a security group -// This request creates a new security group rule from a security group rule prototype object. The prototype object is -// structured in the same way as a retrieved security group rule and contains the information necessary to create the -// rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in the -// security group. Rules specify which IP traffic a security group should allow. Security group rules are stateful, such -// that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP traffic -// on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. -func (vpc *VpcV1) CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupRuleWithContext(context.Background(), createSecurityGroupRuleOptions) +// CreateFloatingIP : Reserve a floating IP +// This request reserves a new floating IP. +func (vpc *VpcV1) CreateFloatingIP(createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.CreateFloatingIPWithContext(context.Background(), createFloatingIPOptions) } -// CreateSecurityGroupRuleWithContext is an alternate form of the CreateSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions cannot be nil") +// CreateFloatingIPWithContext is an alternate form of the CreateFloatingIP method which supports a Context parameter +func (vpc *VpcV1) CreateFloatingIPWithContext(ctx context.Context, createFloatingIPOptions *CreateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createFloatingIPOptions, "createFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions") + err = core.ValidateStruct(createFloatingIPOptions, "createFloatingIPOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "security_group_id": *createSecurityGroupRuleOptions.SecurityGroupID, - } - builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips`, nil) if err != nil { return } - for headerName, headerValue := range createSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range createFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12186,7 +12199,7 @@ func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, create builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createSecurityGroupRuleOptions.SecurityGroupRulePrototype) + _, err = builder.SetBodyContentJSON(createFloatingIPOptions.FloatingIPPrototype) if err != nil { return } @@ -12202,7 +12215,7 @@ func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, create return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -12212,42 +12225,41 @@ func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, create return } -// DeleteSecurityGroupRule : Delete a security group rule -// This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will -// not end existing connections allowed by that rule. -func (vpc *VpcV1) DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupRuleWithContext(context.Background(), deleteSecurityGroupRuleOptions) +// DeleteFloatingIP : Release a floating IP +// This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this +// request to succeed, the floating IP must not be required by another resource, such as a public gateway. +func (vpc *VpcV1) DeleteFloatingIP(deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteFloatingIPWithContext(context.Background(), deleteFloatingIPOptions) } -// DeleteSecurityGroupRuleWithContext is an alternate form of the DeleteSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupRuleWithContext(ctx context.Context, deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions cannot be nil") +// DeleteFloatingIPWithContext is an alternate form of the DeleteFloatingIP method which supports a Context parameter +func (vpc *VpcV1) DeleteFloatingIPWithContext(ctx context.Context, deleteFloatingIPOptions *DeleteFloatingIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteFloatingIPOptions, "deleteFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions") + err = core.ValidateStruct(deleteFloatingIPOptions, "deleteFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *deleteSecurityGroupRuleOptions.SecurityGroupID, - "id": *deleteSecurityGroupRuleOptions.ID, + "id": *deleteFloatingIPOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range deleteFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12265,41 +12277,40 @@ func (vpc *VpcV1) DeleteSecurityGroupRuleWithContext(ctx context.Context, delete return } -// GetSecurityGroupRule : Retrieve a security group rule -// This request retrieves a single security group rule specified by the identifier in the URL path. -func (vpc *VpcV1) GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupRuleWithContext(context.Background(), getSecurityGroupRuleOptions) +// GetFloatingIP : Retrieve a floating IP +// This request retrieves a single floating IP specified by the identifier in the URL. +func (vpc *VpcV1) GetFloatingIP(getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.GetFloatingIPWithContext(context.Background(), getFloatingIPOptions) } -// GetSecurityGroupRuleWithContext is an alternate form of the GetSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions cannot be nil") +// GetFloatingIPWithContext is an alternate form of the GetFloatingIP method which supports a Context parameter +func (vpc *VpcV1) GetFloatingIPWithContext(ctx context.Context, getFloatingIPOptions *GetFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getFloatingIPOptions, "getFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions") + err = core.ValidateStruct(getFloatingIPOptions, "getFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupRuleOptions.SecurityGroupID, - "id": *getSecurityGroupRuleOptions.ID, + "id": *getFloatingIPOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range getFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12319,7 +12330,7 @@ func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecuri return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -12329,43 +12340,40 @@ func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecuri return } -// UpdateSecurityGroupRule : Update a security group rule -// This request updates a security group rule with the information in a provided rule patch object. The rule patch -// object contains only the information to be updated. The request will fail if the information is not applicable to the -// rule's protocol. -func (vpc *VpcV1) UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateSecurityGroupRuleWithContext(context.Background(), updateSecurityGroupRuleOptions) +// UpdateFloatingIP : Update a floating IP +// This request updates a floating IP's name and/or target. +func (vpc *VpcV1) UpdateFloatingIP(updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + return vpc.UpdateFloatingIPWithContext(context.Background(), updateFloatingIPOptions) } -// UpdateSecurityGroupRuleWithContext is an alternate form of the UpdateSecurityGroupRule method which supports a Context parameter -func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions cannot be nil") +// UpdateFloatingIPWithContext is an alternate form of the UpdateFloatingIP method which supports a Context parameter +func (vpc *VpcV1) UpdateFloatingIPWithContext(ctx context.Context, updateFloatingIPOptions *UpdateFloatingIPOptions) (result *FloatingIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateFloatingIPOptions, "updateFloatingIPOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions") + err = core.ValidateStruct(updateFloatingIPOptions, "updateFloatingIPOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *updateSecurityGroupRuleOptions.SecurityGroupID, - "id": *updateSecurityGroupRuleOptions.ID, + "id": *updateFloatingIPOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/floating_ips/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateSecurityGroupRuleOptions.Headers { + for headerName, headerValue := range updateFloatingIPOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroupRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFloatingIP") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12375,7 +12383,7 @@ func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, update builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateSecurityGroupRuleOptions.SecurityGroupRulePatch) + _, err = builder.SetBodyContentJSON(updateFloatingIPOptions.FloatingIPPatch) if err != nil { return } @@ -12391,7 +12399,7 @@ func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, update return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFloatingIP) if err != nil { return } @@ -12401,53 +12409,113 @@ func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, update return } -// ListSecurityGroupTargets : List all targets associated with a security group -// This request lists all targets associated with a security group, to which the rules in the security group are -// applied. -func (vpc *VpcV1) ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { - return vpc.ListSecurityGroupTargetsWithContext(context.Background(), listSecurityGroupTargetsOptions) +// ListNetworkAcls : List all network ACLs +// This request lists all network ACLs in the region. A network ACL defines a set of packet filtering (5-tuple) rules +// for all traffic in and out of a subnet. Both allow and deny rules can be defined, and rules are stateless such that +// reverse traffic in response to allowed traffic is not automatically permitted. +func (vpc *VpcV1) ListNetworkAcls(listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { + return vpc.ListNetworkAclsWithContext(context.Background(), listNetworkAclsOptions) } -// ListSecurityGroupTargetsWithContext is an alternate form of the ListSecurityGroupTargets method which supports a Context parameter -func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions cannot be nil") +// ListNetworkAclsWithContext is an alternate form of the ListNetworkAcls method which supports a Context parameter +func (vpc *VpcV1) ListNetworkAclsWithContext(ctx context.Context, listNetworkAclsOptions *ListNetworkAclsOptions) (result *NetworkACLCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listNetworkAclsOptions, "listNetworkAclsOptions") if err != nil { return } - err = core.ValidateStruct(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions") + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) if err != nil { return } - pathParamsMap := map[string]string{ - "security_group_id": *listSecurityGroupTargetsOptions.SecurityGroupID, + for headerName, headerValue := range listNetworkAclsOptions.Headers { + builder.AddHeader(headerName, headerValue) } - builder := core.NewRequestBuilder(core.GET) + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkAcls") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listNetworkAclsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listNetworkAclsOptions.Start)) + } + if listNetworkAclsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listNetworkAclsOptions.Limit)) + } + if listNetworkAclsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listNetworkAclsOptions.ResourceGroupID)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateNetworkACL : Create a network ACL +// This request creates a new network ACL from a network ACL prototype object. The prototype object is structured in the +// same way as a retrieved network ACL, and contains the information necessary to create the new network ACL. +func (vpc *VpcV1) CreateNetworkACL(createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.CreateNetworkACLWithContext(context.Background(), createNetworkACLOptions) +} + +// CreateNetworkACLWithContext is an alternate form of the CreateNetworkACL method which supports a Context parameter +func (vpc *VpcV1) CreateNetworkACLWithContext(ctx context.Context, createNetworkACLOptions *CreateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(createNetworkACLOptions, "createNetworkACLOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls`, nil) if err != nil { return } - for headerName, headerValue := range listSecurityGroupTargetsOptions.Headers { + for headerName, headerValue := range createNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupTargets") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listSecurityGroupTargetsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listSecurityGroupTargetsOptions.Start)) - } - if listSecurityGroupTargetsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupTargetsOptions.Limit)) + + if createNetworkACLOptions.NetworkACLPrototype != nil { + _, err = builder.SetBodyContentJSON(createNetworkACLOptions.NetworkACLPrototype) + if err != nil { + return + } } request, err := builder.Build() @@ -12461,7 +12529,7 @@ func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listS return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -12471,49 +12539,41 @@ func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listS return } -// DeleteSecurityGroupTargetBinding : Remove a target from a security group -// This request removes a target from a security group. For this request to succeed, the target must be attached to at -// least one other security group. The specified target identifier can be: -// -// - A network interface identifier -// - An application load balancer identifier -// - An endpoint gateway identifier -// -// Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing -// connections are not affected. -func (vpc *VpcV1) DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteSecurityGroupTargetBindingWithContext(context.Background(), deleteSecurityGroupTargetBindingOptions) +// DeleteNetworkACL : Delete a network ACL +// This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL +// must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. +func (vpc *VpcV1) DeleteNetworkACL(deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteNetworkACLWithContext(context.Background(), deleteNetworkACLOptions) } -// DeleteSecurityGroupTargetBindingWithContext is an alternate form of the DeleteSecurityGroupTargetBinding method which supports a Context parameter -func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Context, deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions cannot be nil") +// DeleteNetworkACLWithContext is an alternate form of the DeleteNetworkACL method which supports a Context parameter +func (vpc *VpcV1) DeleteNetworkACLWithContext(ctx context.Context, deleteNetworkACLOptions *DeleteNetworkACLOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteNetworkACLOptions, "deleteNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions") + err = core.ValidateStruct(deleteNetworkACLOptions, "deleteNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *deleteSecurityGroupTargetBindingOptions.SecurityGroupID, - "id": *deleteSecurityGroupTargetBindingOptions.ID, + "id": *deleteNetworkACLOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteSecurityGroupTargetBindingOptions.Headers { + for headerName, headerValue := range deleteNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupTargetBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12531,42 +12591,40 @@ func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Contex return } -// GetSecurityGroupTarget : Retrieve a security group target -// This request retrieves a single target specified by the identifier in the URL path. The target must be an existing -// target of the security group. -func (vpc *VpcV1) GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - return vpc.GetSecurityGroupTargetWithContext(context.Background(), getSecurityGroupTargetOptions) +// GetNetworkACL : Retrieve a network ACL +// This request retrieves a single network ACL specified by the identifier in the URL. +func (vpc *VpcV1) GetNetworkACL(getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.GetNetworkACLWithContext(context.Background(), getNetworkACLOptions) } -// GetSecurityGroupTargetWithContext is an alternate form of the GetSecurityGroupTarget method which supports a Context parameter -func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions cannot be nil") +// GetNetworkACLWithContext is an alternate form of the GetNetworkACL method which supports a Context parameter +func (vpc *VpcV1) GetNetworkACLWithContext(ctx context.Context, getNetworkACLOptions *GetNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getNetworkACLOptions, "getNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions") + err = core.ValidateStruct(getNetworkACLOptions, "getNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *getSecurityGroupTargetOptions.SecurityGroupID, - "id": *getSecurityGroupTargetOptions.ID, + "id": *getNetworkACLOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getSecurityGroupTargetOptions.Headers { + for headerName, headerValue := range getNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupTarget") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12586,7 +12644,7 @@ func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecu return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -12596,56 +12654,54 @@ func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecu return } -// CreateSecurityGroupTargetBinding : Add a target to a security group -// This request adds a resource to an existing security group. The specified target identifier can be: -// -// - A network interface identifier -// - An application load balancer identifier -// - An endpoint gateway identifier -// -// When a target is added to a security group, the security group rules are applied to the target. A request body is not -// required, and if provided, is ignored. -func (vpc *VpcV1) CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - return vpc.CreateSecurityGroupTargetBindingWithContext(context.Background(), createSecurityGroupTargetBindingOptions) +// UpdateNetworkACL : Update a network ACL +// This request updates a network ACL's name. +func (vpc *VpcV1) UpdateNetworkACL(updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + return vpc.UpdateNetworkACLWithContext(context.Background(), updateNetworkACLOptions) } -// CreateSecurityGroupTargetBindingWithContext is an alternate form of the CreateSecurityGroupTargetBinding method which supports a Context parameter -func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Context, createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions cannot be nil") +// UpdateNetworkACLWithContext is an alternate form of the UpdateNetworkACL method which supports a Context parameter +func (vpc *VpcV1) UpdateNetworkACLWithContext(ctx context.Context, updateNetworkACLOptions *UpdateNetworkACLOptions) (result *NetworkACL, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateNetworkACLOptions, "updateNetworkACLOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions") + err = core.ValidateStruct(updateNetworkACLOptions, "updateNetworkACLOptions") if err != nil { return } pathParamsMap := map[string]string{ - "security_group_id": *createSecurityGroupTargetBindingOptions.SecurityGroupID, - "id": *createSecurityGroupTargetBindingOptions.ID, + "id": *updateNetworkACLOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createSecurityGroupTargetBindingOptions.Headers { + for headerName, headerValue := range updateNetworkACLOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupTargetBinding") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACL") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateNetworkACLOptions.NetworkACLPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -12657,7 +12713,7 @@ func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACL) if err != nil { return } @@ -12667,32 +12723,41 @@ func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Contex return } -// ListIkePolicies : List all IKE policies -// This request lists all IKE policies in the region. -func (vpc *VpcV1) ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListIkePoliciesWithContext(context.Background(), listIkePoliciesOptions) +// ListNetworkACLRules : List all rules for a network ACL +// This request lists all rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and +// a destination CIDR block over a particular protocol and port range. +func (vpc *VpcV1) ListNetworkACLRules(listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { + return vpc.ListNetworkACLRulesWithContext(context.Background(), listNetworkACLRulesOptions) } -// ListIkePoliciesWithContext is an alternate form of the ListIkePolicies method which supports a Context parameter -func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listIkePoliciesOptions, "listIkePoliciesOptions") +// ListNetworkACLRulesWithContext is an alternate form of the ListNetworkACLRules method which supports a Context parameter +func (vpc *VpcV1) ListNetworkACLRulesWithContext(ctx context.Context, listNetworkACLRulesOptions *ListNetworkACLRulesOptions) (result *NetworkACLRuleCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listNetworkACLRulesOptions, "listNetworkACLRulesOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listNetworkACLRulesOptions, "listNetworkACLRulesOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "network_acl_id": *listNetworkACLRulesOptions.NetworkACLID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listIkePoliciesOptions.Headers { + for headerName, headerValue := range listNetworkACLRulesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListNetworkACLRules") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12700,11 +12765,14 @@ func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePolicie builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listIkePoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listIkePoliciesOptions.Start)) + if listNetworkACLRulesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listNetworkACLRulesOptions.Start)) } - if listIkePoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listIkePoliciesOptions.Limit)) + if listNetworkACLRulesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listNetworkACLRulesOptions.Limit)) + } + if listNetworkACLRulesOptions.Direction != nil { + builder.AddQuery("direction", fmt.Sprint(*listNetworkACLRulesOptions.Direction)) } request, err := builder.Build() @@ -12718,7 +12786,7 @@ func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePolicie return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRuleCollection) if err != nil { return } @@ -12728,36 +12796,41 @@ func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePolicie return } -// CreateIkePolicy : Create an IKE policy -// This request creates a new IKE policy. -func (vpc *VpcV1) CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.CreateIkePolicyWithContext(context.Background(), createIkePolicyOptions) +// CreateNetworkACLRule : Create a rule for a network ACL +// This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the +// same way as a retrieved rule, and contains the information necessary to create the new rule. +func (vpc *VpcV1) CreateNetworkACLRule(createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + return vpc.CreateNetworkACLRuleWithContext(context.Background(), createNetworkACLRuleOptions) } -// CreateIkePolicyWithContext is an alternate form of the CreateIkePolicy method which supports a Context parameter -func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createIkePolicyOptions, "createIkePolicyOptions cannot be nil") +// CreateNetworkACLRuleWithContext is an alternate form of the CreateNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) CreateNetworkACLRuleWithContext(ctx context.Context, createNetworkACLRuleOptions *CreateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createNetworkACLRuleOptions, "createNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createIkePolicyOptions, "createIkePolicyOptions") + err = core.ValidateStruct(createNetworkACLRuleOptions, "createNetworkACLRuleOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "network_acl_id": *createNetworkACLRuleOptions.NetworkACLID, + } + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createIkePolicyOptions.Headers { + for headerName, headerValue := range createNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12767,29 +12840,7 @@ func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolic builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createIkePolicyOptions.AuthenticationAlgorithm != nil { - body["authentication_algorithm"] = createIkePolicyOptions.AuthenticationAlgorithm - } - if createIkePolicyOptions.DhGroup != nil { - body["dh_group"] = createIkePolicyOptions.DhGroup - } - if createIkePolicyOptions.EncryptionAlgorithm != nil { - body["encryption_algorithm"] = createIkePolicyOptions.EncryptionAlgorithm - } - if createIkePolicyOptions.IkeVersion != nil { - body["ike_version"] = createIkePolicyOptions.IkeVersion - } - if createIkePolicyOptions.KeyLifetime != nil { - body["key_lifetime"] = createIkePolicyOptions.KeyLifetime - } - if createIkePolicyOptions.Name != nil { - body["name"] = createIkePolicyOptions.Name - } - if createIkePolicyOptions.ResourceGroup != nil { - body["resource_group"] = createIkePolicyOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(createNetworkACLRuleOptions.NetworkACLRulePrototype) if err != nil { return } @@ -12805,7 +12856,7 @@ func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolic return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) if err != nil { return } @@ -12815,41 +12866,41 @@ func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolic return } -// DeleteIkePolicy : Delete an IKE policy -// This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not be -// any VPN gateway connections using this policy. -func (vpc *VpcV1) DeleteIkePolicy(deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteIkePolicyWithContext(context.Background(), deleteIkePolicyOptions) +// DeleteNetworkACLRule : Delete a network ACL rule +// This request deletes a rule. This operation cannot be reversed. +func (vpc *VpcV1) DeleteNetworkACLRule(deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteNetworkACLRuleWithContext(context.Background(), deleteNetworkACLRuleOptions) } -// DeleteIkePolicyWithContext is an alternate form of the DeleteIkePolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteIkePolicyWithContext(ctx context.Context, deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteIkePolicyOptions, "deleteIkePolicyOptions cannot be nil") +// DeleteNetworkACLRuleWithContext is an alternate form of the DeleteNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) DeleteNetworkACLRuleWithContext(ctx context.Context, deleteNetworkACLRuleOptions *DeleteNetworkACLRuleOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteIkePolicyOptions, "deleteIkePolicyOptions") + err = core.ValidateStruct(deleteNetworkACLRuleOptions, "deleteNetworkACLRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteIkePolicyOptions.ID, + "network_acl_id": *deleteNetworkACLRuleOptions.NetworkACLID, + "id": *deleteNetworkACLRuleOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteIkePolicyOptions.Headers { + for headerName, headerValue := range deleteNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12867,40 +12918,41 @@ func (vpc *VpcV1) DeleteIkePolicyWithContext(ctx context.Context, deleteIkePolic return } -// GetIkePolicy : Retrieve an IKE policy -// This request retrieves a single IKE policy specified by the identifier in the URL. -func (vpc *VpcV1) GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.GetIkePolicyWithContext(context.Background(), getIkePolicyOptions) +// GetNetworkACLRule : Retrieve a network ACL rule +// This request retrieves a single rule specified by the identifier in the URL. +func (vpc *VpcV1) GetNetworkACLRule(getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + return vpc.GetNetworkACLRuleWithContext(context.Background(), getNetworkACLRuleOptions) } -// GetIkePolicyWithContext is an alternate form of the GetIkePolicy method which supports a Context parameter -func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getIkePolicyOptions, "getIkePolicyOptions cannot be nil") +// GetNetworkACLRuleWithContext is an alternate form of the GetNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) GetNetworkACLRuleWithContext(ctx context.Context, getNetworkACLRuleOptions *GetNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getNetworkACLRuleOptions, "getNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getIkePolicyOptions, "getIkePolicyOptions") + err = core.ValidateStruct(getNetworkACLRuleOptions, "getNetworkACLRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getIkePolicyOptions.ID, + "network_acl_id": *getNetworkACLRuleOptions.NetworkACLID, + "id": *getNetworkACLRuleOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getIkePolicyOptions.Headers { + for headerName, headerValue := range getNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12920,7 +12972,7 @@ func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptio return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) if err != nil { return } @@ -12930,40 +12982,42 @@ func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptio return } -// UpdateIkePolicy : Update an IKE policy -// This request updates the properties of an existing IKE policy. -func (vpc *VpcV1) UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateIkePolicyWithContext(context.Background(), updateIkePolicyOptions) +// UpdateNetworkACLRule : Update a network ACL rule +// This request updates a rule with the information in a provided rule patch. The rule patch object contains only the +// information to be updated. The request will fail if the information is not applicable to the rule's protocol. +func (vpc *VpcV1) UpdateNetworkACLRule(updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateNetworkACLRuleWithContext(context.Background(), updateNetworkACLRuleOptions) } -// UpdateIkePolicyWithContext is an alternate form of the UpdateIkePolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateIkePolicyOptions, "updateIkePolicyOptions cannot be nil") +// UpdateNetworkACLRuleWithContext is an alternate form of the UpdateNetworkACLRule method which supports a Context parameter +func (vpc *VpcV1) UpdateNetworkACLRuleWithContext(ctx context.Context, updateNetworkACLRuleOptions *UpdateNetworkACLRuleOptions) (result NetworkACLRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateIkePolicyOptions, "updateIkePolicyOptions") + err = core.ValidateStruct(updateNetworkACLRuleOptions, "updateNetworkACLRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateIkePolicyOptions.ID, + "network_acl_id": *updateNetworkACLRuleOptions.NetworkACLID, + "id": *updateNetworkACLRuleOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/network_acls/{network_acl_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateIkePolicyOptions.Headers { + for headerName, headerValue := range updateNetworkACLRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIkePolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateNetworkACLRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -12973,7 +13027,7 @@ func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolic builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateIkePolicyOptions.IkePolicyPatch) + _, err = builder.SetBodyContentJSON(updateNetworkACLRuleOptions.NetworkACLRulePatch) if err != nil { return } @@ -12989,7 +13043,7 @@ func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolic return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkACLRule) if err != nil { return } @@ -12999,40 +13053,35 @@ func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolic return } -// ListIkePolicyConnections : List all VPN gateway connections that use a specified IKE policy -// This request lists all VPN gateway connections that use a policy. -func (vpc *VpcV1) ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListIkePolicyConnectionsWithContext(context.Background(), listIkePolicyConnectionsOptions) +// ListSecurityGroups : List all security groups +// This request lists all security groups in the region. Security groups provide a way to apply IP filtering rules to +// instances in the associated VPC. With security groups, all traffic is denied by default, and rules added to security +// groups define which traffic the security group permits. Security group rules are stateful such that reverse traffic +// in response to allowed traffic is automatically permitted. +func (vpc *VpcV1) ListSecurityGroups(listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupsWithContext(context.Background(), listSecurityGroupsOptions) } -// ListIkePolicyConnectionsWithContext is an alternate form of the ListIkePolicyConnections method which supports a Context parameter -func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions") +// ListSecurityGroupsWithContext is an alternate form of the ListSecurityGroups method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupsWithContext(ctx context.Context, listSecurityGroupsOptions *ListSecurityGroupsOptions) (result *SecurityGroupCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listSecurityGroupsOptions, "listSecurityGroupsOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "id": *listIkePolicyConnectionsOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) if err != nil { return } - for headerName, headerValue := range listIkePolicyConnectionsOptions.Headers { + for headerName, headerValue := range listSecurityGroupsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicyConnections") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroups") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13040,66 +13089,23 @@ func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listI builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ListIpsecPolicies : List all IPsec policies -// This request lists all IPsec policies in the region. -func (vpc *VpcV1) ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListIpsecPoliciesWithContext(context.Background(), listIpsecPoliciesOptions) -} - -// ListIpsecPoliciesWithContext is an alternate form of the ListIpsecPolicies method which supports a Context parameter -func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listIpsecPoliciesOptions, "listIpsecPoliciesOptions") - if err != nil { - return + if listSecurityGroupsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSecurityGroupsOptions.Start)) } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) - if err != nil { - return + if listSecurityGroupsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupsOptions.Limit)) } - - for headerName, headerValue := range listIpsecPoliciesOptions.Headers { - builder.AddHeader(headerName, headerValue) + if listSecurityGroupsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listSecurityGroupsOptions.ResourceGroupID)) } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicies") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) + if listSecurityGroupsOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listSecurityGroupsOptions.VPCID)) } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listIpsecPoliciesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listIpsecPoliciesOptions.Start)) + if listSecurityGroupsOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listSecurityGroupsOptions.VPCCRN)) } - if listIpsecPoliciesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listIpsecPoliciesOptions.Limit)) + if listSecurityGroupsOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listSecurityGroupsOptions.VPCName)) } request, err := builder.Build() @@ -13113,7 +13119,7 @@ func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPol return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupCollection) if err != nil { return } @@ -13123,19 +13129,23 @@ func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPol return } -// CreateIpsecPolicy : Create an IPsec policy -// This request creates a new IPsec policy. -func (vpc *VpcV1) CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateIpsecPolicyWithContext(context.Background(), createIpsecPolicyOptions) +// CreateSecurityGroup : Create a security group +// This request creates a new security group from a security group prototype object. The prototype object is structured +// in the same way as a retrieved security group, and contains the information necessary to create the new security +// group. If security group rules are included in the prototype object, those rules will be added to the security group. +// Each security group is scoped to one VPC. Only network interfaces on instances in that VPC can be added to the +// security group. +func (vpc *VpcV1) CreateSecurityGroup(createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + return vpc.CreateSecurityGroupWithContext(context.Background(), createSecurityGroupOptions) } -// CreateIpsecPolicyWithContext is an alternate form of the CreateIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createIpsecPolicyOptions, "createIpsecPolicyOptions cannot be nil") +// CreateSecurityGroupWithContext is an alternate form of the CreateSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) CreateSecurityGroupWithContext(ctx context.Context, createSecurityGroupOptions *CreateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSecurityGroupOptions, "createSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createIpsecPolicyOptions, "createIpsecPolicyOptions") + err = core.ValidateStruct(createSecurityGroupOptions, "createSecurityGroupOptions") if err != nil { return } @@ -13143,16 +13153,16 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups`, nil) if err != nil { return } - for headerName, headerValue := range createIpsecPolicyOptions.Headers { + for headerName, headerValue := range createSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13163,23 +13173,17 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) body := make(map[string]interface{}) - if createIpsecPolicyOptions.AuthenticationAlgorithm != nil { - body["authentication_algorithm"] = createIpsecPolicyOptions.AuthenticationAlgorithm - } - if createIpsecPolicyOptions.EncryptionAlgorithm != nil { - body["encryption_algorithm"] = createIpsecPolicyOptions.EncryptionAlgorithm - } - if createIpsecPolicyOptions.Pfs != nil { - body["pfs"] = createIpsecPolicyOptions.Pfs + if createSecurityGroupOptions.VPC != nil { + body["vpc"] = createSecurityGroupOptions.VPC } - if createIpsecPolicyOptions.KeyLifetime != nil { - body["key_lifetime"] = createIpsecPolicyOptions.KeyLifetime + if createSecurityGroupOptions.Name != nil { + body["name"] = createSecurityGroupOptions.Name } - if createIpsecPolicyOptions.Name != nil { - body["name"] = createIpsecPolicyOptions.Name + if createSecurityGroupOptions.ResourceGroup != nil { + body["resource_group"] = createSecurityGroupOptions.ResourceGroup } - if createIpsecPolicyOptions.ResourceGroup != nil { - body["resource_group"] = createIpsecPolicyOptions.ResourceGroup + if createSecurityGroupOptions.Rules != nil { + body["rules"] = createSecurityGroupOptions.Rules } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -13197,7 +13201,7 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) if err != nil { return } @@ -13207,41 +13211,42 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP return } -// DeleteIpsecPolicy : Delete an IPsec policy -// This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must not -// be any VPN gateway connections using this policy. -func (vpc *VpcV1) DeleteIpsecPolicy(deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteIpsecPolicyWithContext(context.Background(), deleteIpsecPolicyOptions) +// DeleteSecurityGroup : Delete a security group +// This request deletes a security group. A security group cannot be deleted if it is referenced by any network +// interfaces or other security group rules. Additionally, a VPC's default security group cannot be deleted. This +// operation cannot be reversed. +func (vpc *VpcV1) DeleteSecurityGroup(deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSecurityGroupWithContext(context.Background(), deleteSecurityGroupOptions) } -// DeleteIpsecPolicyWithContext is an alternate form of the DeleteIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions cannot be nil") +// DeleteSecurityGroupWithContext is an alternate form of the DeleteSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) DeleteSecurityGroupWithContext(ctx context.Context, deleteSecurityGroupOptions *DeleteSecurityGroupOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSecurityGroupOptions, "deleteSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions") + err = core.ValidateStruct(deleteSecurityGroupOptions, "deleteSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteIpsecPolicyOptions.ID, + "id": *deleteSecurityGroupOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteIpsecPolicyOptions.Headers { + for headerName, headerValue := range deleteSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13259,40 +13264,40 @@ func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecP return } -// GetIpsecPolicy : Retrieve an IPsec policy -// This request retrieves a single IPsec policy specified by the identifier in the URL. -func (vpc *VpcV1) GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.GetIpsecPolicyWithContext(context.Background(), getIpsecPolicyOptions) +// GetSecurityGroup : Retrieve a security group +// This request retrieves a single security group specified by the identifier in the URL path. +func (vpc *VpcV1) GetSecurityGroup(getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupWithContext(context.Background(), getSecurityGroupOptions) } -// GetIpsecPolicyWithContext is an alternate form of the GetIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getIpsecPolicyOptions, "getIpsecPolicyOptions cannot be nil") +// GetSecurityGroupWithContext is an alternate form of the GetSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupWithContext(ctx context.Context, getSecurityGroupOptions *GetSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupOptions, "getSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getIpsecPolicyOptions, "getIpsecPolicyOptions") + err = core.ValidateStruct(getSecurityGroupOptions, "getSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getIpsecPolicyOptions.ID, + "id": *getSecurityGroupOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getIpsecPolicyOptions.Headers { + for headerName, headerValue := range getSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13312,7 +13317,7 @@ func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyO return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) if err != nil { return } @@ -13322,40 +13327,42 @@ func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyO return } -// UpdateIpsecPolicy : Update an IPsec policy -// This request updates the properties of an existing IPsec policy. -func (vpc *VpcV1) UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateIpsecPolicyWithContext(context.Background(), updateIpsecPolicyOptions) +// UpdateSecurityGroup : Update a security group +// This request updates a security group with the information provided in a security group patch object. The security +// group patch object is structured in the same way as a retrieved security group and contains only the information to +// be updated. +func (vpc *VpcV1) UpdateSecurityGroup(updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + return vpc.UpdateSecurityGroupWithContext(context.Background(), updateSecurityGroupOptions) } -// UpdateIpsecPolicyWithContext is an alternate form of the UpdateIpsecPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateIpsecPolicyOptions, "updateIpsecPolicyOptions cannot be nil") +// UpdateSecurityGroupWithContext is an alternate form of the UpdateSecurityGroup method which supports a Context parameter +func (vpc *VpcV1) UpdateSecurityGroupWithContext(ctx context.Context, updateSecurityGroupOptions *UpdateSecurityGroupOptions) (result *SecurityGroup, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSecurityGroupOptions, "updateSecurityGroupOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateIpsecPolicyOptions, "updateIpsecPolicyOptions") + err = core.ValidateStruct(updateSecurityGroupOptions, "updateSecurityGroupOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateIpsecPolicyOptions.ID, + "id": *updateSecurityGroupOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateIpsecPolicyOptions.Headers { + for headerName, headerValue := range updateSecurityGroupOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIpsecPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroup") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13365,7 +13372,7 @@ func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecP builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateIpsecPolicyOptions.IPsecPolicyPatch) + _, err = builder.SetBodyContentJSON(updateSecurityGroupOptions.SecurityGroupPatch) if err != nil { return } @@ -13381,7 +13388,7 @@ func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecP return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroup) if err != nil { return } @@ -13391,40 +13398,41 @@ func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecP return } -// ListIpsecPolicyConnections : List all VPN gateway connections that use a specified IPsec policy -// This request lists all VPN gateway connections that use a policy. -func (vpc *VpcV1) ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListIpsecPolicyConnectionsWithContext(context.Background(), listIpsecPolicyConnectionsOptions) +// ListSecurityGroupNetworkInterfaces : List all network interfaces associated with a security group +// This request lists all network interfaces associated with a security group, to which the rules in the security group +// are applied. +func (vpc *VpcV1) ListSecurityGroupNetworkInterfaces(listSecurityGroupNetworkInterfacesOptions *ListSecurityGroupNetworkInterfacesOptions) (result *NetworkInterfaceCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupNetworkInterfacesWithContext(context.Background(), listSecurityGroupNetworkInterfacesOptions) } -// ListIpsecPolicyConnectionsWithContext is an alternate form of the ListIpsecPolicyConnections method which supports a Context parameter -func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions cannot be nil") +// ListSecurityGroupNetworkInterfacesWithContext is an alternate form of the ListSecurityGroupNetworkInterfaces method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupNetworkInterfacesWithContext(ctx context.Context, listSecurityGroupNetworkInterfacesOptions *ListSecurityGroupNetworkInterfacesOptions) (result *NetworkInterfaceCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSecurityGroupNetworkInterfacesOptions, "listSecurityGroupNetworkInterfacesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions") + err = core.ValidateStruct(listSecurityGroupNetworkInterfacesOptions, "listSecurityGroupNetworkInterfacesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *listIpsecPolicyConnectionsOptions.ID, + "security_group_id": *listSecurityGroupNetworkInterfacesOptions.SecurityGroupID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listIpsecPolicyConnectionsOptions.Headers { + for headerName, headerValue := range listSecurityGroupNetworkInterfacesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicyConnections") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupNetworkInterfaces") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13432,6 +13440,12 @@ func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, lis builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSecurityGroupNetworkInterfacesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSecurityGroupNetworkInterfacesOptions.Start)) + } + if listSecurityGroupNetworkInterfacesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupNetworkInterfacesOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -13444,7 +13458,7 @@ func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, lis return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterfaceCollection) if err != nil { return } @@ -13454,117 +13468,105 @@ func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, lis return } -// ListVPNGateways : List all VPN gateways -// This request lists all VPN gateways in the region. -func (vpc *VpcV1) ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewaysWithContext(context.Background(), listVPNGatewaysOptions) +// RemoveSecurityGroupNetworkInterface : Remove a network interface from a security group +// This request removes a network interface from a security group. Security groups are stateful, so any changes to a +// network interface's security groups are applied to new connections. Existing connections are not affected. If the +// network interface being removed has no other security groups, it will be attached to the VPC's default security +// group. +func (vpc *VpcV1) RemoveSecurityGroupNetworkInterface(removeSecurityGroupNetworkInterfaceOptions *RemoveSecurityGroupNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveSecurityGroupNetworkInterfaceWithContext(context.Background(), removeSecurityGroupNetworkInterfaceOptions) } -// ListVPNGatewaysWithContext is an alternate form of the ListVPNGateways method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listVPNGatewaysOptions, "listVPNGatewaysOptions") +// RemoveSecurityGroupNetworkInterfaceWithContext is an alternate form of the RemoveSecurityGroupNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) RemoveSecurityGroupNetworkInterfaceWithContext(ctx context.Context, removeSecurityGroupNetworkInterfaceOptions *RemoveSecurityGroupNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeSecurityGroupNetworkInterfaceOptions, "removeSecurityGroupNetworkInterfaceOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(removeSecurityGroupNetworkInterfaceOptions, "removeSecurityGroupNetworkInterfaceOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.GET) + pathParamsMap := map[string]string{ + "security_group_id": *removeSecurityGroupNetworkInterfaceOptions.SecurityGroupID, + "id": *removeSecurityGroupNetworkInterfaceOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewaysOptions.Headers { + for headerName, headerValue := range removeSecurityGroupNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGateways") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveSecurityGroupNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listVPNGatewaysOptions.Start)) - } - if listVPNGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listVPNGatewaysOptions.Limit)) - } - if listVPNGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNGatewaysOptions.ResourceGroupID)) - } - if listVPNGatewaysOptions.Mode != nil { - builder.AddQuery("mode", fmt.Sprint(*listVPNGatewaysOptions.Mode)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateVPNGateway : Create a VPN gateway -// This request creates a new VPN gateway. -func (vpc *VpcV1) CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.CreateVPNGatewayWithContext(context.Background(), createVPNGatewayOptions) +// GetSecurityGroupNetworkInterface : Retrieve a network interface in a security group +// This request retrieves a single network interface specified by the identifier in the URL path. The network interface +// must be an existing member of the security group. +func (vpc *VpcV1) GetSecurityGroupNetworkInterface(getSecurityGroupNetworkInterfaceOptions *GetSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupNetworkInterfaceWithContext(context.Background(), getSecurityGroupNetworkInterfaceOptions) } -// CreateVPNGatewayWithContext is an alternate form of the CreateVPNGateway method which supports a Context parameter -func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNGatewayOptions, "createVPNGatewayOptions cannot be nil") +// GetSecurityGroupNetworkInterfaceWithContext is an alternate form of the GetSecurityGroupNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupNetworkInterfaceWithContext(ctx context.Context, getSecurityGroupNetworkInterfaceOptions *GetSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupNetworkInterfaceOptions, "getSecurityGroupNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPNGatewayOptions, "createVPNGatewayOptions") + err = core.ValidateStruct(getSecurityGroupNetworkInterfaceOptions, "getSecurityGroupNetworkInterfaceOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "security_group_id": *getSecurityGroupNetworkInterfaceOptions.SecurityGroupID, + "id": *getSecurityGroupNetworkInterfaceOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPNGatewayOptions.Headers { + for headerName, headerValue := range getSecurityGroupNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createVPNGatewayOptions.VPNGatewayPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -13576,7 +13578,7 @@ func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGate return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) if err != nil { return } @@ -13586,45 +13588,47 @@ func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGate return } -// DeleteVPNGateway : Delete a VPN gateway -// This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway -// must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as a -// next hop. -func (vpc *VpcV1) DeleteVPNGateway(deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNGatewayWithContext(context.Background(), deleteVPNGatewayOptions) +// AddSecurityGroupNetworkInterface : Add a network interface to a security group +// This request adds an existing network interface to an existing security group. When a network interface is added to a +// security group, the security group rules are applied to the network interface. A request body is not required, and if +// provided, is ignored. +func (vpc *VpcV1) AddSecurityGroupNetworkInterface(addSecurityGroupNetworkInterfaceOptions *AddSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + return vpc.AddSecurityGroupNetworkInterfaceWithContext(context.Background(), addSecurityGroupNetworkInterfaceOptions) } -// DeleteVPNGatewayWithContext is an alternate form of the DeleteVPNGateway method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNGatewayOptions, "deleteVPNGatewayOptions cannot be nil") +// AddSecurityGroupNetworkInterfaceWithContext is an alternate form of the AddSecurityGroupNetworkInterface method which supports a Context parameter +func (vpc *VpcV1) AddSecurityGroupNetworkInterfaceWithContext(ctx context.Context, addSecurityGroupNetworkInterfaceOptions *AddSecurityGroupNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addSecurityGroupNetworkInterfaceOptions, "addSecurityGroupNetworkInterfaceOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPNGatewayOptions, "deleteVPNGatewayOptions") + err = core.ValidateStruct(addSecurityGroupNetworkInterfaceOptions, "addSecurityGroupNetworkInterfaceOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteVPNGatewayOptions.ID, + "security_group_id": *addSecurityGroupNetworkInterfaceOptions.SecurityGroupID, + "id": *addSecurityGroupNetworkInterfaceOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/network_interfaces/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPNGatewayOptions.Headers { + for headerName, headerValue := range addSecurityGroupNetworkInterfaceOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddSecurityGroupNetworkInterface") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -13634,45 +13638,58 @@ func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGate return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNetworkInterface) + if err != nil { + return + } + response.Result = result + } return } -// GetVPNGateway : Retrieve a VPN gateway -// This request retrieves a single VPN gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.GetVPNGatewayWithContext(context.Background(), getVPNGatewayOptions) +// ListSecurityGroupRules : List all rules in a security group +// This request lists all rules in a security group. These rules define what traffic the security group permits. +// Security group rules are stateful, such that reverse traffic in response to allowed traffic is automatically +// permitted. +func (vpc *VpcV1) ListSecurityGroupRules(listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupRulesWithContext(context.Background(), listSecurityGroupRulesOptions) } -// GetVPNGatewayWithContext is an alternate form of the GetVPNGateway method which supports a Context parameter -func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNGatewayOptions, "getVPNGatewayOptions cannot be nil") +// ListSecurityGroupRulesWithContext is an alternate form of the ListSecurityGroupRules method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupRulesWithContext(ctx context.Context, listSecurityGroupRulesOptions *ListSecurityGroupRulesOptions) (result *SecurityGroupRuleCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNGatewayOptions, "getVPNGatewayOptions") + err = core.ValidateStruct(listSecurityGroupRulesOptions, "listSecurityGroupRulesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getVPNGatewayOptions.ID, + "security_group_id": *listSecurityGroupRulesOptions.SecurityGroupID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNGatewayOptions.Headers { + for headerName, headerValue := range listSecurityGroupRulesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupRules") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -13692,7 +13709,7 @@ func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRuleCollection) if err != nil { return } @@ -13702,50 +13719,55 @@ func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOpt return } -// UpdateVPNGateway : Update a VPN gateway -// This request updates the properties of an existing VPN gateway. -func (vpc *VpcV1) UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNGatewayWithContext(context.Background(), updateVPNGatewayOptions) +// CreateSecurityGroupRule : Create a rule for a security group +// This request creates a new security group rule from a security group rule prototype object. The prototype object is +// structured in the same way as a retrieved security group rule and contains the information necessary to create the +// rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in the +// security group. Rules specify which IP traffic a security group will allow. Security group rules are stateful, such +// that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP traffic +// on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. +func (vpc *VpcV1) CreateSecurityGroupRule(createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + return vpc.CreateSecurityGroupRuleWithContext(context.Background(), createSecurityGroupRuleOptions) } -// UpdateVPNGatewayWithContext is an alternate form of the UpdateVPNGateway method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNGatewayOptions, "updateVPNGatewayOptions cannot be nil") +// CreateSecurityGroupRuleWithContext is an alternate form of the CreateSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) CreateSecurityGroupRuleWithContext(ctx context.Context, createSecurityGroupRuleOptions *CreateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPNGatewayOptions, "updateVPNGatewayOptions") + err = core.ValidateStruct(createSecurityGroupRuleOptions, "createSecurityGroupRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateVPNGatewayOptions.ID, + "security_group_id": *createSecurityGroupRuleOptions.SecurityGroupID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPNGatewayOptions.Headers { + for headerName, headerValue := range createSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPNGatewayOptions.VPNGatewayPatch) + _, err = builder.SetBodyContentJSON(createSecurityGroupRuleOptions.SecurityGroupRulePrototype) if err != nil { return } @@ -13761,7 +13783,7 @@ func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGate return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) if err != nil { return } @@ -13771,120 +13793,102 @@ func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGate return } -// ListVPNGatewayConnections : List all connections of a VPN gateway -// This request lists all connections of a VPN gateway. -func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionsWithContext(context.Background(), listVPNGatewayConnectionsOptions) +// DeleteSecurityGroupRule : Delete a security group rule +// This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will +// not end existing connections allowed by that rule. +func (vpc *VpcV1) DeleteSecurityGroupRule(deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSecurityGroupRuleWithContext(context.Background(), deleteSecurityGroupRuleOptions) } -// ListVPNGatewayConnectionsWithContext is an alternate form of the ListVPNGatewayConnections method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions cannot be nil") +// DeleteSecurityGroupRuleWithContext is an alternate form of the DeleteSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) DeleteSecurityGroupRuleWithContext(ctx context.Context, deleteSecurityGroupRuleOptions *DeleteSecurityGroupRuleOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions") + err = core.ValidateStruct(deleteSecurityGroupRuleOptions, "deleteSecurityGroupRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionsOptions.VPNGatewayID, + "security_group_id": *deleteSecurityGroupRuleOptions.SecurityGroupID, + "id": *deleteSecurityGroupRuleOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewayConnectionsOptions.Headers { + for headerName, headerValue := range deleteSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnections") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listVPNGatewayConnectionsOptions.Status != nil { - builder.AddQuery("status", fmt.Sprint(*listVPNGatewayConnectionsOptions.Status)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateVPNGatewayConnection : Create a connection for a VPN gateway -// This request creates a new VPN gateway connection. -func (vpc *VpcV1) CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.CreateVPNGatewayConnectionWithContext(context.Background(), createVPNGatewayConnectionOptions) +// GetSecurityGroupRule : Retrieve a security group rule +// This request retrieves a single security group rule specified by the identifier in the URL path. +func (vpc *VpcV1) GetSecurityGroupRule(getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupRuleWithContext(context.Background(), getSecurityGroupRuleOptions) } -// CreateVPNGatewayConnectionWithContext is an alternate form of the CreateVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions cannot be nil") +// GetSecurityGroupRuleWithContext is an alternate form of the GetSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupRuleWithContext(ctx context.Context, getSecurityGroupRuleOptions *GetSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions") + err = core.ValidateStruct(getSecurityGroupRuleOptions, "getSecurityGroupRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *createVPNGatewayConnectionOptions.VPNGatewayID, + "security_group_id": *getSecurityGroupRuleOptions.SecurityGroupID, + "id": *getSecurityGroupRuleOptions.ID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range getSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(createVPNGatewayConnectionOptions.VPNGatewayConnectionPrototype) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -13896,7 +13900,7 @@ func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, cre return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) if err != nil { return } @@ -13906,94 +13910,113 @@ func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, cre return } -// DeleteVPNGatewayConnection : Delete a VPN gateway connection -// This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, there -// must not be VPC routes using this VPN connection as a next hop. -func (vpc *VpcV1) DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteVPNGatewayConnectionWithContext(context.Background(), deleteVPNGatewayConnectionOptions) +// UpdateSecurityGroupRule : Update a security group rule +// This request updates a security group rule with the information in a provided rule patch object. The rule patch +// object contains only the information to be updated. The request will fail if the information is not applicable to the +// rule's protocol. +func (vpc *VpcV1) UpdateSecurityGroupRule(updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateSecurityGroupRuleWithContext(context.Background(), updateSecurityGroupRuleOptions) } -// DeleteVPNGatewayConnectionWithContext is an alternate form of the DeleteVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions cannot be nil") +// UpdateSecurityGroupRuleWithContext is an alternate form of the UpdateSecurityGroupRule method which supports a Context parameter +func (vpc *VpcV1) UpdateSecurityGroupRuleWithContext(ctx context.Context, updateSecurityGroupRuleOptions *UpdateSecurityGroupRuleOptions) (result SecurityGroupRuleIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions") + err = core.ValidateStruct(updateSecurityGroupRuleOptions, "updateSecurityGroupRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *deleteVPNGatewayConnectionOptions.VPNGatewayID, - "id": *deleteVPNGatewayConnectionOptions.ID, + "security_group_id": *updateSecurityGroupRuleOptions.SecurityGroupID, + "id": *updateSecurityGroupRuleOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range updateSecurityGroupRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateSecurityGroupRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateSecurityGroupRuleOptions.SecurityGroupRulePatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupRule) + if err != nil { + return + } + response.Result = result + } return } -// GetVPNGatewayConnection : Retrieve a VPN gateway connection -// This request retrieves a single VPN gateway connection specified by the identifier in the URL. -func (vpc *VpcV1) GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.GetVPNGatewayConnectionWithContext(context.Background(), getVPNGatewayConnectionOptions) +// ListSecurityGroupTargets : List all targets associated with a security group +// This request lists all targets associated with a security group, to which the rules in the security group are +// applied. +func (vpc *VpcV1) ListSecurityGroupTargets(listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { + return vpc.ListSecurityGroupTargetsWithContext(context.Background(), listSecurityGroupTargetsOptions) } -// GetVPNGatewayConnectionWithContext is an alternate form of the GetVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions cannot be nil") +// ListSecurityGroupTargetsWithContext is an alternate form of the ListSecurityGroupTargets method which supports a Context parameter +func (vpc *VpcV1) ListSecurityGroupTargetsWithContext(ctx context.Context, listSecurityGroupTargetsOptions *ListSecurityGroupTargetsOptions) (result *SecurityGroupTargetCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions") + err = core.ValidateStruct(listSecurityGroupTargetsOptions, "listSecurityGroupTargetsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *getVPNGatewayConnectionOptions.VPNGatewayID, - "id": *getVPNGatewayConnectionOptions.ID, + "security_group_id": *listSecurityGroupTargetsOptions.SecurityGroupID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range listSecurityGroupTargetsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListSecurityGroupTargets") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14001,6 +14024,12 @@ func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPN builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listSecurityGroupTargetsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listSecurityGroupTargetsOptions.Start)) + } + if listSecurityGroupTargetsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listSecurityGroupTargetsOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -14013,7 +14042,7 @@ func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPN return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetCollection) if err != nil { return } @@ -14023,111 +14052,102 @@ func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPN return } -// UpdateVPNGatewayConnection : Update a VPN gateway connection -// This request updates the properties of an existing VPN gateway connection. -func (vpc *VpcV1) UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - return vpc.UpdateVPNGatewayConnectionWithContext(context.Background(), updateVPNGatewayConnectionOptions) +// DeleteSecurityGroupTargetBinding : Remove a target from a security group +// This request removes a target from a security group. For this request to succeed, the target must be attached to at +// least one other security group. The specified target identifier can be: +// +// - A network interface identifier +// - An application load balancer identifier +// - An endpoint gateway identifier +// +// Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing +// connections are not affected. +func (vpc *VpcV1) DeleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteSecurityGroupTargetBindingWithContext(context.Background(), deleteSecurityGroupTargetBindingOptions) } -// UpdateVPNGatewayConnectionWithContext is an alternate form of the UpdateVPNGatewayConnection method which supports a Context parameter -func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions cannot be nil") +// DeleteSecurityGroupTargetBindingWithContext is an alternate form of the DeleteSecurityGroupTargetBinding method which supports a Context parameter +func (vpc *VpcV1) DeleteSecurityGroupTargetBindingWithContext(ctx context.Context, deleteSecurityGroupTargetBindingOptions *DeleteSecurityGroupTargetBindingOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions") + err = core.ValidateStruct(deleteSecurityGroupTargetBindingOptions, "deleteSecurityGroupTargetBindingOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *updateVPNGatewayConnectionOptions.VPNGatewayID, - "id": *updateVPNGatewayConnectionOptions.ID, + "security_group_id": *deleteSecurityGroupTargetBindingOptions.SecurityGroupID, + "id": *deleteSecurityGroupTargetBindingOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateVPNGatewayConnectionOptions.Headers { + for headerName, headerValue := range deleteSecurityGroupTargetBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGatewayConnection") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteSecurityGroupTargetBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateVPNGatewayConnectionOptions.VPNGatewayConnectionPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListVPNGatewayConnectionLocalCIDRs : List all local CIDRs for a VPN gateway connection -// This request lists all local CIDRs for a VPN gateway connection. -func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRs(listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionLocalCIDRsWithContext(context.Background(), listVPNGatewayConnectionLocalCIDRsOptions) +// GetSecurityGroupTarget : Retrieve a security group target +// This request retrieves a single target specified by the identifier in the URL path. The target must be an existing +// target of the security group. +func (vpc *VpcV1) GetSecurityGroupTarget(getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + return vpc.GetSecurityGroupTargetWithContext(context.Background(), getSecurityGroupTargetOptions) } -// ListVPNGatewayConnectionLocalCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionLocalCIDRs method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions cannot be nil") +// GetSecurityGroupTargetWithContext is an alternate form of the GetSecurityGroupTarget method which supports a Context parameter +func (vpc *VpcV1) GetSecurityGroupTargetWithContext(ctx context.Context, getSecurityGroupTargetOptions *GetSecurityGroupTargetOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions") + err = core.ValidateStruct(getSecurityGroupTargetOptions, "getSecurityGroupTargetOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionLocalCIDRsOptions.VPNGatewayID, - "id": *listVPNGatewayConnectionLocalCIDRsOptions.ID, + "security_group_id": *getSecurityGroupTargetOptions.SecurityGroupID, + "id": *getSecurityGroupTargetOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewayConnectionLocalCIDRsOptions.Headers { + for headerName, headerValue := range getSecurityGroupTargetOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionLocalCIDRs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetSecurityGroupTarget") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14147,7 +14167,7 @@ func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Cont return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionLocalCIDRs) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) if err != nil { return } @@ -14157,46 +14177,52 @@ func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Cont return } -// RemoveVPNGatewayConnectionLocalCIDR : Remove a local CIDR from a VPN gateway connection -// This request removes a CIDR from a VPN gateway connection. -func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDR(removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVPNGatewayConnectionLocalCIDRWithContext(context.Background(), removeVPNGatewayConnectionLocalCIDROptions) +// CreateSecurityGroupTargetBinding : Add a target to a security group +// This request adds a resource to an existing security group. The specified target identifier can be: +// +// - A network interface identifier +// - An application load balancer identifier +// - An endpoint gateway identifier +// +// When a target is added to a security group, the security group rules are applied to the target. A request body is not +// required, and if provided, is ignored. +func (vpc *VpcV1) CreateSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + return vpc.CreateSecurityGroupTargetBindingWithContext(context.Background(), createSecurityGroupTargetBindingOptions) } -// RemoveVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions cannot be nil") +// CreateSecurityGroupTargetBindingWithContext is an alternate form of the CreateSecurityGroupTargetBinding method which supports a Context parameter +func (vpc *VpcV1) CreateSecurityGroupTargetBindingWithContext(ctx context.Context, createSecurityGroupTargetBindingOptions *CreateSecurityGroupTargetBindingOptions) (result SecurityGroupTargetReferenceIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions") + err = core.ValidateStruct(createSecurityGroupTargetBindingOptions, "createSecurityGroupTargetBindingOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *removeVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *removeVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *removeVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *removeVPNGatewayConnectionLocalCIDROptions.PrefixLength, + "security_group_id": *createSecurityGroupTargetBindingOptions.SecurityGroupID, + "id": *createSecurityGroupTargetBindingOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/security_groups/{security_group_id}/targets/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeVPNGatewayConnectionLocalCIDROptions.Headers { + for headerName, headerValue := range createSecurityGroupTargetBindingOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionLocalCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateSecurityGroupTargetBinding") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -14206,159 +14232,208 @@ func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDRWithContext(ctx context.Con return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalSecurityGroupTargetReference) + if err != nil { + return + } + response.Result = result + } return } -// CheckVPNGatewayConnectionLocalCIDR : Check if the specified local CIDR exists on a VPN gateway connection -// This request succeeds if a CIDR exists on the specified VPN gateway connection and fails otherwise. -func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDR(checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.CheckVPNGatewayConnectionLocalCIDRWithContext(context.Background(), checkVPNGatewayConnectionLocalCIDROptions) +// ListIkePolicies : List all IKE policies +// This request lists all IKE policies in the region. +func (vpc *VpcV1) ListIkePolicies(listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListIkePoliciesWithContext(context.Background(), listIkePoliciesOptions) } -// CheckVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions") +// ListIkePoliciesWithContext is an alternate form of the ListIkePolicies method which supports a Context parameter +func (vpc *VpcV1) ListIkePoliciesWithContext(ctx context.Context, listIkePoliciesOptions *ListIkePoliciesOptions) (result *IkePolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listIkePoliciesOptions, "listIkePoliciesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_gateway_id": *checkVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *checkVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *checkVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *checkVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) if err != nil { return } - for headerName, headerValue := range checkVPNGatewayConnectionLocalCIDROptions.Headers { + for headerName, headerValue := range listIkePoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionLocalCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listIkePoliciesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listIkePoliciesOptions.Start)) + } + if listIkePoliciesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listIkePoliciesOptions.Limit)) + } request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicyCollection) + if err != nil { + return + } + response.Result = result + } return } -// AddVPNGatewayConnectionLocalCIDR : Set a local CIDR on a VPN gateway connection -// This request adds the specified CIDR to the specified VPN gateway connection. A request body is not required, and if -// provided, is ignored. This request succeeds if the CIDR already exists on the specified VPN gateway connection. -func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDR(addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.AddVPNGatewayConnectionLocalCIDRWithContext(context.Background(), addVPNGatewayConnectionLocalCIDROptions) +// CreateIkePolicy : Create an IKE policy +// This request creates a new IKE policy. +func (vpc *VpcV1) CreateIkePolicy(createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + return vpc.CreateIkePolicyWithContext(context.Background(), createIkePolicyOptions) } -// AddVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the AddVPNGatewayConnectionLocalCIDR method which supports a Context parameter -func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions cannot be nil") +// CreateIkePolicyWithContext is an alternate form of the CreateIkePolicy method which supports a Context parameter +func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolicyOptions *CreateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createIkePolicyOptions, "createIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions") + err = core.ValidateStruct(createIkePolicyOptions, "createIkePolicyOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "vpn_gateway_id": *addVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, - "id": *addVPNGatewayConnectionLocalCIDROptions.ID, - "cidr_prefix": *addVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, - "prefix_length": *addVPNGatewayConnectionLocalCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies`, nil) if err != nil { return } - for headerName, headerValue := range addVPNGatewayConnectionLocalCIDROptions.Headers { + for headerName, headerValue := range createIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionLocalCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createIkePolicyOptions.AuthenticationAlgorithm != nil { + body["authentication_algorithm"] = createIkePolicyOptions.AuthenticationAlgorithm + } + if createIkePolicyOptions.DhGroup != nil { + body["dh_group"] = createIkePolicyOptions.DhGroup + } + if createIkePolicyOptions.EncryptionAlgorithm != nil { + body["encryption_algorithm"] = createIkePolicyOptions.EncryptionAlgorithm + } + if createIkePolicyOptions.IkeVersion != nil { + body["ike_version"] = createIkePolicyOptions.IkeVersion + } + if createIkePolicyOptions.KeyLifetime != nil { + body["key_lifetime"] = createIkePolicyOptions.KeyLifetime + } + if createIkePolicyOptions.Name != nil { + body["name"] = createIkePolicyOptions.Name + } + if createIkePolicyOptions.ResourceGroup != nil { + body["resource_group"] = createIkePolicyOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + if err != nil { + return + } + response.Result = result + } return } -// ListVPNGatewayConnectionPeerCIDRs : List all peer CIDRs for a VPN gateway connection -// This request lists all peer CIDRs for a VPN gateway connection. -func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRs(listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { - return vpc.ListVPNGatewayConnectionPeerCIDRsWithContext(context.Background(), listVPNGatewayConnectionPeerCIDRsOptions) +// DeleteIkePolicy : Delete an IKE policy +// This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not be +// any VPN gateway connections using this policy. +func (vpc *VpcV1) DeleteIkePolicy(deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteIkePolicyWithContext(context.Background(), deleteIkePolicyOptions) } -// ListVPNGatewayConnectionPeerCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionPeerCIDRs method which supports a Context parameter -func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions cannot be nil") +// DeleteIkePolicyWithContext is an alternate form of the DeleteIkePolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteIkePolicyWithContext(ctx context.Context, deleteIkePolicyOptions *DeleteIkePolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteIkePolicyOptions, "deleteIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions") + err = core.ValidateStruct(deleteIkePolicyOptions, "deleteIkePolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *listVPNGatewayConnectionPeerCIDRsOptions.VPNGatewayID, - "id": *listVPNGatewayConnectionPeerCIDRsOptions.ID, + "id": *deleteIkePolicyOptions.ID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listVPNGatewayConnectionPeerCIDRsOptions.Headers { + for headerName, headerValue := range deleteIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionPeerCIDRs") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -14368,62 +14443,49 @@ func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Conte return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionPeerCIDRs) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// RemoveVPNGatewayConnectionPeerCIDR : Remove a peer CIDR from a VPN gateway connection -// This request removes a CIDR from a VPN gateway connection. -func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDR(removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveVPNGatewayConnectionPeerCIDRWithContext(context.Background(), removeVPNGatewayConnectionPeerCIDROptions) +// GetIkePolicy : Retrieve an IKE policy +// This request retrieves a single IKE policy specified by the identifier in the URL. +func (vpc *VpcV1) GetIkePolicy(getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + return vpc.GetIkePolicyWithContext(context.Background(), getIkePolicyOptions) } -// RemoveVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions cannot be nil") +// GetIkePolicyWithContext is an alternate form of the GetIkePolicy method which supports a Context parameter +func (vpc *VpcV1) GetIkePolicyWithContext(ctx context.Context, getIkePolicyOptions *GetIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getIkePolicyOptions, "getIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions") + err = core.ValidateStruct(getIkePolicyOptions, "getIkePolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *removeVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *removeVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *removeVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *removeVPNGatewayConnectionPeerCIDROptions.PrefixLength, + "id": *getIkePolicyOptions.ID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeVPNGatewayConnectionPeerCIDROptions.Headers { + for headerName, headerValue := range getIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionPeerCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -14433,161 +14495,70 @@ func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Cont return } - response, err = vpc.Service.Request(request, nil) - - return -} - -// CheckVPNGatewayConnectionPeerCIDR : Check if the specified peer CIDR exists on a VPN gateway connection -// This request succeeds if a CIDR exists on the specified VPN gateway connection and fails otherwise. -func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDR(checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.CheckVPNGatewayConnectionPeerCIDRWithContext(context.Background(), checkVPNGatewayConnectionPeerCIDROptions) -} - -// CheckVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "vpn_gateway_id": *checkVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *checkVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *checkVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *checkVPNGatewayConnectionPeerCIDROptions.PrefixLength, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - - for headerName, headerValue := range checkVPNGatewayConnectionPeerCIDROptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionPeerCIDR") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - request, err := builder.Build() - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) + if err != nil { + return + } + response.Result = result } - response, err = vpc.Service.Request(request, nil) - return } -// AddVPNGatewayConnectionPeerCIDR : Set a peer CIDR on a VPN gateway connection -// This request adds the specified CIDR to the specified VPN gateway connection. A request body is not required, and if -// provided, is ignored. This request succeeds if the CIDR already exists on the specified VPN gateway connection. -func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDR(addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - return vpc.AddVPNGatewayConnectionPeerCIDRWithContext(context.Background(), addVPNGatewayConnectionPeerCIDROptions) +// UpdateIkePolicy : Update an IKE policy +// This request updates the properties of an existing IKE policy. +func (vpc *VpcV1) UpdateIkePolicy(updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + return vpc.UpdateIkePolicyWithContext(context.Background(), updateIkePolicyOptions) } -// AddVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the AddVPNGatewayConnectionPeerCIDR method which supports a Context parameter -func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions cannot be nil") +// UpdateIkePolicyWithContext is an alternate form of the UpdateIkePolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateIkePolicyWithContext(ctx context.Context, updateIkePolicyOptions *UpdateIkePolicyOptions) (result *IkePolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateIkePolicyOptions, "updateIkePolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions") + err = core.ValidateStruct(updateIkePolicyOptions, "updateIkePolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "vpn_gateway_id": *addVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, - "id": *addVPNGatewayConnectionPeerCIDROptions.ID, - "cidr_prefix": *addVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, - "prefix_length": *addVPNGatewayConnectionPeerCIDROptions.PrefixLength, + "id": *updateIkePolicyOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range addVPNGatewayConnectionPeerCIDROptions.Headers { + for headerName, headerValue := range updateIkePolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionPeerCIDR") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIkePolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - request, err := builder.Build() - if err != nil { - return - } - - response, err = vpc.Service.Request(request, nil) - - return -} - -// ListLoadBalancerProfiles : List all load balancer profiles -// This request lists all load balancer profiles available in the region. A load balancer profile specifies the -// performance characteristics and pricing model for a load balancer. -func (vpc *VpcV1) ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerProfilesWithContext(context.Background(), listLoadBalancerProfilesOptions) -} - -// ListLoadBalancerProfilesWithContext is an alternate form of the ListLoadBalancerProfiles method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLoadBalancerProfilesOptions, "listLoadBalancerProfilesOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles`, nil) + _, err = builder.SetBodyContentJSON(updateIkePolicyOptions.IkePolicyPatch) if err != nil { return } - for headerName, headerValue := range listLoadBalancerProfilesOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerProfiles") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listLoadBalancerProfilesOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listLoadBalancerProfilesOptions.Start)) - } - if listLoadBalancerProfilesOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listLoadBalancerProfilesOptions.Limit)) - } - request, err := builder.Build() if err != nil { return @@ -14599,7 +14570,7 @@ func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listL return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfileCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIkePolicy) if err != nil { return } @@ -14609,40 +14580,40 @@ func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listL return } -// GetLoadBalancerProfile : Retrieve a load balancer profile -// This request retrieves a load balancer profile specified by the name in the URL. -func (vpc *VpcV1) GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerProfileWithContext(context.Background(), getLoadBalancerProfileOptions) +// ListIkePolicyConnections : List all VPN gateway connections that use a specified IKE policy +// This request lists all VPN gateway connections that use a policy. +func (vpc *VpcV1) ListIkePolicyConnections(listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + return vpc.ListIkePolicyConnectionsWithContext(context.Background(), listIkePolicyConnectionsOptions) } -// GetLoadBalancerProfileWithContext is an alternate form of the GetLoadBalancerProfile method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions cannot be nil") +// ListIkePolicyConnectionsWithContext is an alternate form of the ListIkePolicyConnections method which supports a Context parameter +func (vpc *VpcV1) ListIkePolicyConnectionsWithContext(ctx context.Context, listIkePolicyConnectionsOptions *ListIkePolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions") + err = core.ValidateStruct(listIkePolicyConnectionsOptions, "listIkePolicyConnectionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "name": *getLoadBalancerProfileOptions.Name, + "id": *listIkePolicyConnectionsOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles/{name}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ike_policies/{id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerProfileOptions.Headers { + for headerName, headerValue := range listIkePolicyConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerProfile") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIkePolicyConnections") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14662,7 +14633,7 @@ func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoad return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfile) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) if err != nil { return } @@ -14672,15 +14643,15 @@ func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoad return } -// ListLoadBalancers : List all load balancers -// This request lists all load balancers in the region. -func (vpc *VpcV1) ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancersWithContext(context.Background(), listLoadBalancersOptions) +// ListIpsecPolicies : List all IPsec policies +// This request lists all IPsec policies in the region. +func (vpc *VpcV1) ListIpsecPolicies(listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListIpsecPoliciesWithContext(context.Background(), listIpsecPoliciesOptions) } -// ListLoadBalancersWithContext is an alternate form of the ListLoadBalancers method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listLoadBalancersOptions, "listLoadBalancersOptions") +// ListIpsecPoliciesWithContext is an alternate form of the ListIpsecPolicies method which supports a Context parameter +func (vpc *VpcV1) ListIpsecPoliciesWithContext(ctx context.Context, listIpsecPoliciesOptions *ListIpsecPoliciesOptions) (result *IPsecPolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listIpsecPoliciesOptions, "listIpsecPoliciesOptions") if err != nil { return } @@ -14688,16 +14659,16 @@ func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBala builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) if err != nil { return } - for headerName, headerValue := range listLoadBalancersOptions.Headers { + for headerName, headerValue := range listIpsecPoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancers") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14705,11 +14676,11 @@ func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBala builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listLoadBalancersOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listLoadBalancersOptions.Start)) + if listIpsecPoliciesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listIpsecPoliciesOptions.Start)) } - if listLoadBalancersOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listLoadBalancersOptions.Limit)) + if listIpsecPoliciesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listIpsecPoliciesOptions.Limit)) } request, err := builder.Build() @@ -14723,7 +14694,7 @@ func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBala return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicyCollection) if err != nil { return } @@ -14733,19 +14704,19 @@ func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBala return } -// CreateLoadBalancer : Create a load balancer -// This request creates and provisions a new load balancer. -func (vpc *VpcV1) CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerWithContext(context.Background(), createLoadBalancerOptions) +// CreateIpsecPolicy : Create an IPsec policy +// This request creates a new IPsec policy. +func (vpc *VpcV1) CreateIpsecPolicy(createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + return vpc.CreateIpsecPolicyWithContext(context.Background(), createIpsecPolicyOptions) } -// CreateLoadBalancerWithContext is an alternate form of the CreateLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerOptions, "createLoadBalancerOptions cannot be nil") +// CreateIpsecPolicyWithContext is an alternate form of the CreateIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecPolicyOptions *CreateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createIpsecPolicyOptions, "createIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerOptions, "createLoadBalancerOptions") + err = core.ValidateStruct(createIpsecPolicyOptions, "createIpsecPolicyOptions") if err != nil { return } @@ -14753,16 +14724,16 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies`, nil) if err != nil { return } - for headerName, headerValue := range createLoadBalancerOptions.Headers { + for headerName, headerValue := range createIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14773,35 +14744,23 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) body := make(map[string]interface{}) - if createLoadBalancerOptions.IsPublic != nil { - body["is_public"] = createLoadBalancerOptions.IsPublic - } - if createLoadBalancerOptions.Subnets != nil { - body["subnets"] = createLoadBalancerOptions.Subnets - } - if createLoadBalancerOptions.Listeners != nil { - body["listeners"] = createLoadBalancerOptions.Listeners - } - if createLoadBalancerOptions.Logging != nil { - body["logging"] = createLoadBalancerOptions.Logging - } - if createLoadBalancerOptions.Name != nil { - body["name"] = createLoadBalancerOptions.Name + if createIpsecPolicyOptions.AuthenticationAlgorithm != nil { + body["authentication_algorithm"] = createIpsecPolicyOptions.AuthenticationAlgorithm } - if createLoadBalancerOptions.Pools != nil { - body["pools"] = createLoadBalancerOptions.Pools + if createIpsecPolicyOptions.EncryptionAlgorithm != nil { + body["encryption_algorithm"] = createIpsecPolicyOptions.EncryptionAlgorithm } - if createLoadBalancerOptions.Profile != nil { - body["profile"] = createLoadBalancerOptions.Profile + if createIpsecPolicyOptions.Pfs != nil { + body["pfs"] = createIpsecPolicyOptions.Pfs } - if createLoadBalancerOptions.ResourceGroup != nil { - body["resource_group"] = createLoadBalancerOptions.ResourceGroup + if createIpsecPolicyOptions.KeyLifetime != nil { + body["key_lifetime"] = createIpsecPolicyOptions.KeyLifetime } - if createLoadBalancerOptions.RouteMode != nil { - body["route_mode"] = createLoadBalancerOptions.RouteMode + if createIpsecPolicyOptions.Name != nil { + body["name"] = createIpsecPolicyOptions.Name } - if createLoadBalancerOptions.SecurityGroups != nil { - body["security_groups"] = createLoadBalancerOptions.SecurityGroups + if createIpsecPolicyOptions.ResourceGroup != nil { + body["resource_group"] = createIpsecPolicyOptions.ResourceGroup } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -14819,7 +14778,7 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) if err != nil { return } @@ -14829,40 +14788,41 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB return } -// DeleteLoadBalancer : Delete a load balancer -// This request deletes a load balancer. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerWithContext(context.Background(), deleteLoadBalancerOptions) +// DeleteIpsecPolicy : Delete an IPsec policy +// This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must not +// be any VPN gateway connections using this policy. +func (vpc *VpcV1) DeleteIpsecPolicy(deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteIpsecPolicyWithContext(context.Background(), deleteIpsecPolicyOptions) } -// DeleteLoadBalancerWithContext is an alternate form of the DeleteLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerWithContext(ctx context.Context, deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerOptions, "deleteLoadBalancerOptions cannot be nil") +// DeleteIpsecPolicyWithContext is an alternate form of the DeleteIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteIpsecPolicyWithContext(ctx context.Context, deleteIpsecPolicyOptions *DeleteIpsecPolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerOptions, "deleteLoadBalancerOptions") + err = core.ValidateStruct(deleteIpsecPolicyOptions, "deleteIpsecPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteLoadBalancerOptions.ID, + "id": *deleteIpsecPolicyOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerOptions.Headers { + for headerName, headerValue := range deleteIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14880,40 +14840,40 @@ func (vpc *VpcV1) DeleteLoadBalancerWithContext(ctx context.Context, deleteLoadB return } -// GetLoadBalancer : Retrieve a load balancer -// This request retrieves a single load balancer specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerWithContext(context.Background(), getLoadBalancerOptions) +// GetIpsecPolicy : Retrieve an IPsec policy +// This request retrieves a single IPsec policy specified by the identifier in the URL. +func (vpc *VpcV1) GetIpsecPolicy(getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + return vpc.GetIpsecPolicyWithContext(context.Background(), getIpsecPolicyOptions) } -// GetLoadBalancerWithContext is an alternate form of the GetLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerOptions, "getLoadBalancerOptions cannot be nil") +// GetIpsecPolicyWithContext is an alternate form of the GetIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) GetIpsecPolicyWithContext(ctx context.Context, getIpsecPolicyOptions *GetIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getIpsecPolicyOptions, "getIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerOptions, "getLoadBalancerOptions") + err = core.ValidateStruct(getIpsecPolicyOptions, "getIpsecPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getLoadBalancerOptions.ID, + "id": *getIpsecPolicyOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerOptions.Headers { + for headerName, headerValue := range getIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14933,7 +14893,7 @@ func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalance return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) if err != nil { return } @@ -14943,40 +14903,40 @@ func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalance return } -// UpdateLoadBalancer : Update a load balancer -// This request updates a load balancer. -func (vpc *VpcV1) UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerWithContext(context.Background(), updateLoadBalancerOptions) +// UpdateIpsecPolicy : Update an IPsec policy +// This request updates the properties of an existing IPsec policy. +func (vpc *VpcV1) UpdateIpsecPolicy(updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + return vpc.UpdateIpsecPolicyWithContext(context.Background(), updateIpsecPolicyOptions) } -// UpdateLoadBalancerWithContext is an alternate form of the UpdateLoadBalancer method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerOptions, "updateLoadBalancerOptions cannot be nil") +// UpdateIpsecPolicyWithContext is an alternate form of the UpdateIpsecPolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateIpsecPolicyWithContext(ctx context.Context, updateIpsecPolicyOptions *UpdateIpsecPolicyOptions) (result *IPsecPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateIpsecPolicyOptions, "updateIpsecPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerOptions, "updateLoadBalancerOptions") + err = core.ValidateStruct(updateIpsecPolicyOptions, "updateIpsecPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateLoadBalancerOptions.ID, + "id": *updateIpsecPolicyOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerOptions.Headers { + for headerName, headerValue := range updateIpsecPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancer") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateIpsecPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -14986,7 +14946,7 @@ func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadB builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerOptions.LoadBalancerPatch) + _, err = builder.SetBodyContentJSON(updateIpsecPolicyOptions.IPsecPolicyPatch) if err != nil { return } @@ -15002,7 +14962,7 @@ func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadB return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIPsecPolicy) if err != nil { return } @@ -15012,40 +14972,40 @@ func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadB return } -// GetLoadBalancerStatistics : List all statistics of a load balancer -// This request lists statistics of a load balancer. -func (vpc *VpcV1) GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerStatisticsWithContext(context.Background(), getLoadBalancerStatisticsOptions) +// ListIpsecPolicyConnections : List all VPN gateway connections that use a specified IPsec policy +// This request lists all VPN gateway connections that use a policy. +func (vpc *VpcV1) ListIpsecPolicyConnections(listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + return vpc.ListIpsecPolicyConnectionsWithContext(context.Background(), listIpsecPolicyConnectionsOptions) } -// GetLoadBalancerStatisticsWithContext is an alternate form of the GetLoadBalancerStatistics method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions cannot be nil") +// ListIpsecPolicyConnectionsWithContext is an alternate form of the ListIpsecPolicyConnections method which supports a Context parameter +func (vpc *VpcV1) ListIpsecPolicyConnectionsWithContext(ctx context.Context, listIpsecPolicyConnectionsOptions *ListIpsecPolicyConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions") + err = core.ValidateStruct(listIpsecPolicyConnectionsOptions, "listIpsecPolicyConnectionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getLoadBalancerStatisticsOptions.ID, + "id": *listIpsecPolicyConnectionsOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}/statistics`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/ipsec_policies/{id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerStatisticsOptions.Headers { + for headerName, headerValue := range listIpsecPolicyConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerStatistics") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListIpsecPolicyConnections") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15065,7 +15025,7 @@ func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getL return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerStatistics) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) if err != nil { return } @@ -15075,40 +15035,32 @@ func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getL return } -// ListLoadBalancerListeners : List all listeners for a load balancer -// This request lists all listeners for a load balancer. -func (vpc *VpcV1) ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenersWithContext(context.Background(), listLoadBalancerListenersOptions) +// ListVPNGateways : List all VPN gateways +// This request lists all VPN gateways in the region. +func (vpc *VpcV1) ListVPNGateways(listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewaysWithContext(context.Background(), listVPNGatewaysOptions) } -// ListLoadBalancerListenersWithContext is an alternate form of the ListLoadBalancerListeners method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions") +// ListVPNGatewaysWithContext is an alternate form of the ListVPNGateways method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewaysWithContext(ctx context.Context, listVPNGatewaysOptions *ListVPNGatewaysOptions) (result *VPNGatewayCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listVPNGatewaysOptions, "listVPNGatewaysOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenersOptions.LoadBalancerID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) if err != nil { return } - for headerName, headerValue := range listLoadBalancerListenersOptions.Headers { + for headerName, headerValue := range listVPNGatewaysOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListeners") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGateways") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15116,6 +15068,18 @@ func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, list builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPNGatewaysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNGatewaysOptions.Start)) + } + if listVPNGatewaysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNGatewaysOptions.Limit)) + } + if listVPNGatewaysOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listVPNGatewaysOptions.ResourceGroupID)) + } + if listVPNGatewaysOptions.Mode != nil { + builder.AddQuery("mode", fmt.Sprint(*listVPNGatewaysOptions.Mode)) + } request, err := builder.Build() if err != nil { @@ -15128,7 +15092,7 @@ func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, list return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayCollection) if err != nil { return } @@ -15138,40 +15102,36 @@ func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, list return } -// CreateLoadBalancerListener : Create a listener for a load balancer -// This request creates a new listener for a load balancer. -func (vpc *VpcV1) CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerWithContext(context.Background(), createLoadBalancerListenerOptions) +// CreateVPNGateway : Create a VPN gateway +// This request creates a new VPN gateway. +func (vpc *VpcV1) CreateVPNGateway(createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + return vpc.CreateVPNGatewayWithContext(context.Background(), createVPNGatewayOptions) } -// CreateLoadBalancerListenerWithContext is an alternate form of the CreateLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions cannot be nil") +// CreateVPNGatewayWithContext is an alternate form of the CreateVPNGateway method which supports a Context parameter +func (vpc *VpcV1) CreateVPNGatewayWithContext(ctx context.Context, createVPNGatewayOptions *CreateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPNGatewayOptions, "createVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions") + err = core.ValidateStruct(createVPNGatewayOptions, "createVPNGatewayOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerOptions.LoadBalancerID, - } - builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways`, nil) if err != nil { return } - for headerName, headerValue := range createLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range createVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15181,38 +15141,7 @@ func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, cre builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createLoadBalancerListenerOptions.Protocol != nil { - body["protocol"] = createLoadBalancerListenerOptions.Protocol - } - if createLoadBalancerListenerOptions.AcceptProxyProtocol != nil { - body["accept_proxy_protocol"] = createLoadBalancerListenerOptions.AcceptProxyProtocol - } - if createLoadBalancerListenerOptions.CertificateInstance != nil { - body["certificate_instance"] = createLoadBalancerListenerOptions.CertificateInstance - } - if createLoadBalancerListenerOptions.ConnectionLimit != nil { - body["connection_limit"] = createLoadBalancerListenerOptions.ConnectionLimit - } - if createLoadBalancerListenerOptions.DefaultPool != nil { - body["default_pool"] = createLoadBalancerListenerOptions.DefaultPool - } - if createLoadBalancerListenerOptions.HTTPSRedirect != nil { - body["https_redirect"] = createLoadBalancerListenerOptions.HTTPSRedirect - } - if createLoadBalancerListenerOptions.Policies != nil { - body["policies"] = createLoadBalancerListenerOptions.Policies - } - if createLoadBalancerListenerOptions.Port != nil { - body["port"] = createLoadBalancerListenerOptions.Port - } - if createLoadBalancerListenerOptions.PortMax != nil { - body["port_max"] = createLoadBalancerListenerOptions.PortMax - } - if createLoadBalancerListenerOptions.PortMin != nil { - body["port_min"] = createLoadBalancerListenerOptions.PortMin - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(createVPNGatewayOptions.VPNGatewayPrototype) if err != nil { return } @@ -15228,7 +15157,7 @@ func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, cre return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) if err != nil { return } @@ -15238,42 +15167,42 @@ func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, cre return } -// DeleteLoadBalancerListener : Delete a load balancer listener -// This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, the -// listener must not be the target of another load balancer listener. -func (vpc *VpcV1) DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerWithContext(context.Background(), deleteLoadBalancerListenerOptions) +// DeleteVPNGateway : Delete a VPN gateway +// This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway +// must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as a +// next hop. +func (vpc *VpcV1) DeleteVPNGateway(deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNGatewayWithContext(context.Background(), deleteVPNGatewayOptions) } -// DeleteLoadBalancerListenerWithContext is an alternate form of the DeleteLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions cannot be nil") +// DeleteVPNGatewayWithContext is an alternate form of the DeleteVPNGateway method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNGatewayWithContext(ctx context.Context, deleteVPNGatewayOptions *DeleteVPNGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNGatewayOptions, "deleteVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions") + err = core.ValidateStruct(deleteVPNGatewayOptions, "deleteVPNGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerOptions.LoadBalancerID, - "id": *deleteLoadBalancerListenerOptions.ID, + "id": *deleteVPNGatewayOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range deleteVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15291,41 +15220,40 @@ func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, del return } -// GetLoadBalancerListener : Retrieve a load balancer listener -// This request retrieves a single listener specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerWithContext(context.Background(), getLoadBalancerListenerOptions) +// GetVPNGateway : Retrieve a VPN gateway +// This request retrieves a single VPN gateway specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNGateway(getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + return vpc.GetVPNGatewayWithContext(context.Background(), getVPNGatewayOptions) } -// GetLoadBalancerListenerWithContext is an alternate form of the GetLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions cannot be nil") +// GetVPNGatewayWithContext is an alternate form of the GetVPNGateway method which supports a Context parameter +func (vpc *VpcV1) GetVPNGatewayWithContext(ctx context.Context, getVPNGatewayOptions *GetVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNGatewayOptions, "getVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions") + err = core.ValidateStruct(getVPNGatewayOptions, "getVPNGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerOptions.LoadBalancerID, - "id": *getLoadBalancerListenerOptions.ID, + "id": *getVPNGatewayOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range getVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15345,7 +15273,7 @@ func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoa return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) if err != nil { return } @@ -15355,41 +15283,40 @@ func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoa return } -// UpdateLoadBalancerListener : Update a load balancer listener -// This request updates a load balancer listener from a listener patch. -func (vpc *VpcV1) UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerWithContext(context.Background(), updateLoadBalancerListenerOptions) +// UpdateVPNGateway : Update a VPN gateway +// This request updates the properties of an existing VPN gateway. +func (vpc *VpcV1) UpdateVPNGateway(updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateVPNGatewayWithContext(context.Background(), updateVPNGatewayOptions) } -// UpdateLoadBalancerListenerWithContext is an alternate form of the UpdateLoadBalancerListener method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions cannot be nil") +// UpdateVPNGatewayWithContext is an alternate form of the UpdateVPNGateway method which supports a Context parameter +func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGatewayOptions *UpdateVPNGatewayOptions) (result VPNGatewayIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPNGatewayOptions, "updateVPNGatewayOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions") + err = core.ValidateStruct(updateVPNGatewayOptions, "updateVPNGatewayOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerOptions.LoadBalancerID, - "id": *updateLoadBalancerListenerOptions.ID, + "id": *updateVPNGatewayOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerListenerOptions.Headers { + for headerName, headerValue := range updateVPNGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListener") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGateway") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15399,7 +15326,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, upd builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerOptions.LoadBalancerListenerPatch) + _, err = builder.SetBodyContentJSON(updateVPNGatewayOptions.VPNGatewayPatch) if err != nil { return } @@ -15415,7 +15342,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, upd return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGateway) if err != nil { return } @@ -15425,41 +15352,40 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, upd return } -// ListLoadBalancerListenerPolicies : List all policies for a load balancer listener -// This request lists all policies for a load balancer listener. -func (vpc *VpcV1) ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenerPoliciesWithContext(context.Background(), listLoadBalancerListenerPoliciesOptions) +// ListVPNGatewayConnections : List all connections of a VPN gateway +// This request lists all connections of a VPN gateway. +func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewayConnectionsWithContext(context.Background(), listVPNGatewayConnectionsOptions) } -// ListLoadBalancerListenerPoliciesWithContext is an alternate form of the ListLoadBalancerListenerPolicies method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Context, listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions cannot be nil") +// ListVPNGatewayConnectionsWithContext is an alternate form of the ListVPNGatewayConnections method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayConnectionsWithContext(ctx context.Context, listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions") + err = core.ValidateStruct(listVPNGatewayConnectionsOptions, "listVPNGatewayConnectionsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenerPoliciesOptions.LoadBalancerID, - "listener_id": *listLoadBalancerListenerPoliciesOptions.ListenerID, + "vpn_gateway_id": *listVPNGatewayConnectionsOptions.VPNGatewayID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerListenerPoliciesOptions.Headers { + for headerName, headerValue := range listVPNGatewayConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicies") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnections") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15467,6 +15393,9 @@ func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Contex builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listVPNGatewayConnectionsOptions.Status != nil { + builder.AddQuery("status", fmt.Sprint(*listVPNGatewayConnectionsOptions.Status)) + } request, err := builder.Build() if err != nil { @@ -15479,7 +15408,7 @@ func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionCollection) if err != nil { return } @@ -15489,41 +15418,40 @@ func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Contex return } -// CreateLoadBalancerListenerPolicy : Create a policy for a load balancer listener -// Creates a new policy for a load balancer listener. -func (vpc *VpcV1) CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerPolicyWithContext(context.Background(), createLoadBalancerListenerPolicyOptions) +// CreateVPNGatewayConnection : Create a connection for a VPN gateway +// This request creates a new VPN gateway connection. +func (vpc *VpcV1) CreateVPNGatewayConnection(createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + return vpc.CreateVPNGatewayConnectionWithContext(context.Background(), createVPNGatewayConnectionOptions) } -// CreateLoadBalancerListenerPolicyWithContext is an alternate form of the CreateLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Context, createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions cannot be nil") +// CreateVPNGatewayConnectionWithContext is an alternate form of the CreateVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) CreateVPNGatewayConnectionWithContext(ctx context.Context, createVPNGatewayConnectionOptions *CreateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(createVPNGatewayConnectionOptions, "createVPNGatewayConnectionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *createLoadBalancerListenerPolicyOptions.ListenerID, + "vpn_gateway_id": *createVPNGatewayConnectionOptions.VPNGatewayID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range createVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15533,23 +15461,7 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Contex builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createLoadBalancerListenerPolicyOptions.Action != nil { - body["action"] = createLoadBalancerListenerPolicyOptions.Action - } - if createLoadBalancerListenerPolicyOptions.Priority != nil { - body["priority"] = createLoadBalancerListenerPolicyOptions.Priority - } - if createLoadBalancerListenerPolicyOptions.Name != nil { - body["name"] = createLoadBalancerListenerPolicyOptions.Name - } - if createLoadBalancerListenerPolicyOptions.Rules != nil { - body["rules"] = createLoadBalancerListenerPolicyOptions.Rules - } - if createLoadBalancerListenerPolicyOptions.Target != nil { - body["target"] = createLoadBalancerListenerPolicyOptions.Target - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(createVPNGatewayConnectionOptions.VPNGatewayConnectionPrototype) if err != nil { return } @@ -15565,7 +15477,7 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -15575,42 +15487,42 @@ func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } -// DeleteLoadBalancerListenerPolicy : Delete a load balancer listener policy -// Deletes a policy of the load balancer listener. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerPolicyWithContext(context.Background(), deleteLoadBalancerListenerPolicyOptions) +// DeleteVPNGatewayConnection : Delete a VPN gateway connection +// This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, there +// must not be VPC routes using this VPN connection as a next hop. +func (vpc *VpcV1) DeleteVPNGatewayConnection(deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteVPNGatewayConnectionWithContext(context.Background(), deleteVPNGatewayConnectionOptions) } -// DeleteLoadBalancerListenerPolicyWithContext is an alternate form of the DeleteLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions cannot be nil") +// DeleteVPNGatewayConnectionWithContext is an alternate form of the DeleteVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, deleteVPNGatewayConnectionOptions *DeleteVPNGatewayConnectionOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(deleteVPNGatewayConnectionOptions, "deleteVPNGatewayConnectionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *deleteLoadBalancerListenerPolicyOptions.ListenerID, - "id": *deleteLoadBalancerListenerPolicyOptions.ID, + "vpn_gateway_id": *deleteVPNGatewayConnectionOptions.VPNGatewayID, + "id": *deleteVPNGatewayConnectionOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15628,42 +15540,41 @@ func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyWithContext(ctx context.Contex return } -// GetLoadBalancerListenerPolicy : Retrieve a load balancer listener policy -// Retrieve a single policy specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerPolicyWithContext(context.Background(), getLoadBalancerListenerPolicyOptions) +// GetVPNGatewayConnection : Retrieve a VPN gateway connection +// This request retrieves a single VPN gateway connection specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNGatewayConnection(getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + return vpc.GetVPNGatewayConnectionWithContext(context.Background(), getVPNGatewayConnectionOptions) } -// GetLoadBalancerListenerPolicyWithContext is an alternate form of the GetLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions cannot be nil") +// GetVPNGatewayConnectionWithContext is an alternate form of the GetVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) GetVPNGatewayConnectionWithContext(ctx context.Context, getVPNGatewayConnectionOptions *GetVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(getVPNGatewayConnectionOptions, "getVPNGatewayConnectionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *getLoadBalancerListenerPolicyOptions.ListenerID, - "id": *getLoadBalancerListenerPolicyOptions.ID, + "vpn_gateway_id": *getVPNGatewayConnectionOptions.VPNGatewayID, + "id": *getVPNGatewayConnectionOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range getVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15683,7 +15594,7 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -15693,42 +15604,41 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, return } -// UpdateLoadBalancerListenerPolicy : Update a load balancer listener policy -// Updates a policy from a policy patch. -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerPolicyWithContext(context.Background(), updateLoadBalancerListenerPolicyOptions) +// UpdateVPNGatewayConnection : Update a VPN gateway connection +// This request updates the properties of an existing VPN gateway connection. +func (vpc *VpcV1) UpdateVPNGatewayConnection(updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + return vpc.UpdateVPNGatewayConnectionWithContext(context.Background(), updateVPNGatewayConnectionOptions) } -// UpdateLoadBalancerListenerPolicyWithContext is an alternate form of the UpdateLoadBalancerListenerPolicy method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Context, updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions cannot be nil") +// UpdateVPNGatewayConnectionWithContext is an alternate form of the UpdateVPNGatewayConnection method which supports a Context parameter +func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, updateVPNGatewayConnectionOptions *UpdateVPNGatewayConnectionOptions) (result VPNGatewayConnectionIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions") + err = core.ValidateStruct(updateVPNGatewayConnectionOptions, "updateVPNGatewayConnectionOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerPolicyOptions.LoadBalancerID, - "listener_id": *updateLoadBalancerListenerPolicyOptions.ListenerID, - "id": *updateLoadBalancerListenerPolicyOptions.ID, + "vpn_gateway_id": *updateVPNGatewayConnectionOptions.VPNGatewayID, + "id": *updateVPNGatewayConnectionOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerListenerPolicyOptions.Headers { + for headerName, headerValue := range updateVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicy") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVPNGatewayConnection") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15738,7 +15648,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Contex builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyOptions.LoadBalancerListenerPolicyPatch) + _, err = builder.SetBodyContentJSON(updateVPNGatewayConnectionOptions.VPNGatewayConnectionPatch) if err != nil { return } @@ -15754,7 +15664,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnection) if err != nil { return } @@ -15764,42 +15674,41 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Contex return } -// ListLoadBalancerListenerPolicyRules : List all rules of a load balancer listener policy -// This request lists all rules of a load balancer listener policy. -func (vpc *VpcV1) ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerListenerPolicyRulesWithContext(context.Background(), listLoadBalancerListenerPolicyRulesOptions) +// ListVPNGatewayConnectionLocalCIDRs : List all local CIDRs for a VPN gateway connection +// This request lists all local CIDRs for a VPN gateway connection. +func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRs(listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewayConnectionLocalCIDRsWithContext(context.Background(), listVPNGatewayConnectionLocalCIDRsOptions) } -// ListLoadBalancerListenerPolicyRulesWithContext is an alternate form of the ListLoadBalancerListenerPolicyRules method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Context, listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions cannot be nil") +// ListVPNGatewayConnectionLocalCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionLocalCIDRs method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayConnectionLocalCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionLocalCIDRsOptions *ListVPNGatewayConnectionLocalCIDRsOptions) (result *VPNGatewayConnectionLocalCIDRs, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions") + err = core.ValidateStruct(listVPNGatewayConnectionLocalCIDRsOptions, "listVPNGatewayConnectionLocalCIDRsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerListenerPolicyRulesOptions.LoadBalancerID, - "listener_id": *listLoadBalancerListenerPolicyRulesOptions.ListenerID, - "policy_id": *listLoadBalancerListenerPolicyRulesOptions.PolicyID, + "vpn_gateway_id": *listVPNGatewayConnectionLocalCIDRsOptions.VPNGatewayID, + "id": *listVPNGatewayConnectionLocalCIDRsOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerListenerPolicyRulesOptions.Headers { + for headerName, headerValue := range listVPNGatewayConnectionLocalCIDRsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicyRules") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionLocalCIDRs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15819,7 +15728,7 @@ func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Con return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRuleCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionLocalCIDRs) if err != nil { return } @@ -15829,127 +15738,97 @@ func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Con return } -// CreateLoadBalancerListenerPolicyRule : Create a rule for a load balancer listener policy -// Creates a new rule for the load balancer listener policy. -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerListenerPolicyRuleWithContext(context.Background(), createLoadBalancerListenerPolicyRuleOptions) +// RemoveVPNGatewayConnectionLocalCIDR : Remove a local CIDR from a VPN gateway connection +// This request removes a CIDR from a VPN gateway connection. +func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDR(removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveVPNGatewayConnectionLocalCIDRWithContext(context.Background(), removeVPNGatewayConnectionLocalCIDROptions) } -// CreateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the CreateLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions cannot be nil") +// RemoveVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionLocalCIDR method which supports a Context parameter +func (vpc *VpcV1) RemoveVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionLocalCIDROptions *RemoveVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(removeVPNGatewayConnectionLocalCIDROptions, "removeVPNGatewayConnectionLocalCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *createLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *createLoadBalancerListenerPolicyRuleOptions.PolicyID, + "vpn_gateway_id": *removeVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, + "id": *removeVPNGatewayConnectionLocalCIDROptions.ID, + "cidr_prefix": *removeVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, + "prefix_length": *removeVPNGatewayConnectionLocalCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range removeVPNGatewayConnectionLocalCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionLocalCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createLoadBalancerListenerPolicyRuleOptions.Condition != nil { - body["condition"] = createLoadBalancerListenerPolicyRuleOptions.Condition - } - if createLoadBalancerListenerPolicyRuleOptions.Type != nil { - body["type"] = createLoadBalancerListenerPolicyRuleOptions.Type - } - if createLoadBalancerListenerPolicyRuleOptions.Value != nil { - body["value"] = createLoadBalancerListenerPolicyRuleOptions.Value - } - if createLoadBalancerListenerPolicyRuleOptions.Field != nil { - body["field"] = createLoadBalancerListenerPolicyRuleOptions.Field - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteLoadBalancerListenerPolicyRule : Delete a load balancer listener policy rule -// Deletes a rule from the load balancer listener policy. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerListenerPolicyRuleWithContext(context.Background(), deleteLoadBalancerListenerPolicyRuleOptions) +// CheckVPNGatewayConnectionLocalCIDR : Check if the specified local CIDR exists on a VPN gateway connection +// This request succeeds if a CIDR exists on the specified VPN gateway connection and fails otherwise. +func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDR(checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.CheckVPNGatewayConnectionLocalCIDRWithContext(context.Background(), checkVPNGatewayConnectionLocalCIDROptions) } -// DeleteLoadBalancerListenerPolicyRuleWithContext is an alternate form of the DeleteLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions cannot be nil") +// CheckVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionLocalCIDR method which supports a Context parameter +func (vpc *VpcV1) CheckVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionLocalCIDROptions *CheckVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(checkVPNGatewayConnectionLocalCIDROptions, "checkVPNGatewayConnectionLocalCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *deleteLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *deleteLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *deleteLoadBalancerListenerPolicyRuleOptions.ID, + "vpn_gateway_id": *checkVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, + "id": *checkVPNGatewayConnectionLocalCIDROptions.ID, + "cidr_prefix": *checkVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, + "prefix_length": *checkVPNGatewayConnectionLocalCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range checkVPNGatewayConnectionLocalCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionLocalCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -15967,47 +15846,47 @@ func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } -// GetLoadBalancerListenerPolicyRule : Retrieve a load balancer listener policy rule -// Retrieves a single rule specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerListenerPolicyRuleWithContext(context.Background(), getLoadBalancerListenerPolicyRuleOptions) +// AddVPNGatewayConnectionLocalCIDR : Set a local CIDR on a VPN gateway connection +// This request adds the specified CIDR to the specified VPN gateway connection. A request body is not required, and if +// provided, is ignored. This request succeeds if the CIDR already exists on the specified VPN gateway connection. +func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDR(addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.AddVPNGatewayConnectionLocalCIDRWithContext(context.Background(), addVPNGatewayConnectionLocalCIDROptions) } -// GetLoadBalancerListenerPolicyRuleWithContext is an alternate form of the GetLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions cannot be nil") +// AddVPNGatewayConnectionLocalCIDRWithContext is an alternate form of the AddVPNGatewayConnectionLocalCIDR method which supports a Context parameter +func (vpc *VpcV1) AddVPNGatewayConnectionLocalCIDRWithContext(ctx context.Context, addVPNGatewayConnectionLocalCIDROptions *AddVPNGatewayConnectionLocalCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(addVPNGatewayConnectionLocalCIDROptions, "addVPNGatewayConnectionLocalCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *getLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *getLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *getLoadBalancerListenerPolicyRuleOptions.ID, + "vpn_gateway_id": *addVPNGatewayConnectionLocalCIDROptions.VPNGatewayID, + "id": *addVPNGatewayConnectionLocalCIDROptions.ID, + "cidr_prefix": *addVPNGatewayConnectionLocalCIDROptions.CIDRPrefix, + "prefix_length": *addVPNGatewayConnectionLocalCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range addVPNGatewayConnectionLocalCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionLocalCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -16017,73 +15896,54 @@ func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Conte return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// UpdateLoadBalancerListenerPolicyRule : Update a load balancer listener policy rule -// Updates a rule of the load balancer listener policy. -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerListenerPolicyRuleWithContext(context.Background(), updateLoadBalancerListenerPolicyRuleOptions) +// ListVPNGatewayConnectionPeerCIDRs : List all peer CIDRs for a VPN gateway connection +// This request lists all peer CIDRs for a VPN gateway connection. +func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRs(listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { + return vpc.ListVPNGatewayConnectionPeerCIDRsWithContext(context.Background(), listVPNGatewayConnectionPeerCIDRsOptions) } -// UpdateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the UpdateLoadBalancerListenerPolicyRule method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions cannot be nil") +// ListVPNGatewayConnectionPeerCIDRsWithContext is an alternate form of the ListVPNGatewayConnectionPeerCIDRs method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayConnectionPeerCIDRsWithContext(ctx context.Context, listVPNGatewayConnectionPeerCIDRsOptions *ListVPNGatewayConnectionPeerCIDRsOptions) (result *VPNGatewayConnectionPeerCIDRs, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions") + err = core.ValidateStruct(listVPNGatewayConnectionPeerCIDRsOptions, "listVPNGatewayConnectionPeerCIDRsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, - "listener_id": *updateLoadBalancerListenerPolicyRuleOptions.ListenerID, - "policy_id": *updateLoadBalancerListenerPolicyRuleOptions.PolicyID, - "id": *updateLoadBalancerListenerPolicyRuleOptions.ID, + "vpn_gateway_id": *listVPNGatewayConnectionPeerCIDRsOptions.VPNGatewayID, + "id": *listVPNGatewayConnectionPeerCIDRsOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerListenerPolicyRuleOptions.Headers { + for headerName, headerValue := range listVPNGatewayConnectionPeerCIDRsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicyRule") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayConnectionPeerCIDRs") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerListenerPolicyRulePatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -16095,7 +15955,7 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayConnectionPeerCIDRs) if err != nil { return } @@ -16105,44 +15965,46 @@ func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Co return } -// ListLoadBalancerPools : List all pools of a load balancer -// This request lists all pools of a load balancer. -func (vpc *VpcV1) ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerPoolsWithContext(context.Background(), listLoadBalancerPoolsOptions) +// RemoveVPNGatewayConnectionPeerCIDR : Remove a peer CIDR from a VPN gateway connection +// This request removes a CIDR from a VPN gateway connection. +func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDR(removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveVPNGatewayConnectionPeerCIDRWithContext(context.Background(), removeVPNGatewayConnectionPeerCIDROptions) } -// ListLoadBalancerPoolsWithContext is an alternate form of the ListLoadBalancerPools method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions cannot be nil") +// RemoveVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the RemoveVPNGatewayConnectionPeerCIDR method which supports a Context parameter +func (vpc *VpcV1) RemoveVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, removeVPNGatewayConnectionPeerCIDROptions *RemoveVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions") + err = core.ValidateStruct(removeVPNGatewayConnectionPeerCIDROptions, "removeVPNGatewayConnectionPeerCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerPoolsOptions.LoadBalancerID, + "vpn_gateway_id": *removeVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, + "id": *removeVPNGatewayConnectionPeerCIDROptions.ID, + "cidr_prefix": *removeVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, + "prefix_length": *removeVPNGatewayConnectionPeerCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listLoadBalancerPoolsOptions.Headers { + for headerName, headerValue := range removeVPNGatewayConnectionPeerCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPools") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayConnectionPeerCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -16152,149 +16014,103 @@ func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoad return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolCollection) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// CreateLoadBalancerPool : Create a load balancer pool -// This request creates a new pool from a pool prototype object. -func (vpc *VpcV1) CreateLoadBalancerPool(createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerPoolWithContext(context.Background(), createLoadBalancerPoolOptions) +// CheckVPNGatewayConnectionPeerCIDR : Check if the specified peer CIDR exists on a VPN gateway connection +// This request succeeds if a CIDR exists on the specified VPN gateway connection and fails otherwise. +func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDR(checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.CheckVPNGatewayConnectionPeerCIDRWithContext(context.Background(), checkVPNGatewayConnectionPeerCIDROptions) } -// CreateLoadBalancerPoolWithContext is an alternate form of the CreateLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerPoolWithContext(ctx context.Context, createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerPoolOptions, "createLoadBalancerPoolOptions cannot be nil") +// CheckVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the CheckVPNGatewayConnectionPeerCIDR method which supports a Context parameter +func (vpc *VpcV1) CheckVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, checkVPNGatewayConnectionPeerCIDROptions *CheckVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerPoolOptions, "createLoadBalancerPoolOptions") + err = core.ValidateStruct(checkVPNGatewayConnectionPeerCIDROptions, "checkVPNGatewayConnectionPeerCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerPoolOptions.LoadBalancerID, + "vpn_gateway_id": *checkVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, + "id": *checkVPNGatewayConnectionPeerCIDROptions.ID, + "cidr_prefix": *checkVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, + "prefix_length": *checkVPNGatewayConnectionPeerCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range checkVPNGatewayConnectionPeerCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayConnectionPeerCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createLoadBalancerPoolOptions.Algorithm != nil { - body["algorithm"] = createLoadBalancerPoolOptions.Algorithm - } - if createLoadBalancerPoolOptions.HealthMonitor != nil { - body["health_monitor"] = createLoadBalancerPoolOptions.HealthMonitor - } - if createLoadBalancerPoolOptions.Protocol != nil { - body["protocol"] = createLoadBalancerPoolOptions.Protocol - } - if createLoadBalancerPoolOptions.Members != nil { - body["members"] = createLoadBalancerPoolOptions.Members - } - if createLoadBalancerPoolOptions.Name != nil { - body["name"] = createLoadBalancerPoolOptions.Name - } - if createLoadBalancerPoolOptions.ProxyProtocol != nil { - body["proxy_protocol"] = createLoadBalancerPoolOptions.ProxyProtocol - } - if createLoadBalancerPoolOptions.SessionPersistence != nil { - body["session_persistence"] = createLoadBalancerPoolOptions.SessionPersistence - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// DeleteLoadBalancerPool : Delete a load balancer pool -// This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the -// default pool for any listener in the load balancer. -func (vpc *VpcV1) DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerPoolWithContext(context.Background(), deleteLoadBalancerPoolOptions) +// AddVPNGatewayConnectionPeerCIDR : Set a peer CIDR on a VPN gateway connection +// This request adds the specified CIDR to the specified VPN gateway connection. A request body is not required, and if +// provided, is ignored. This request succeeds if the CIDR already exists on the specified VPN gateway connection. +func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDR(addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + return vpc.AddVPNGatewayConnectionPeerCIDRWithContext(context.Background(), addVPNGatewayConnectionPeerCIDROptions) } -// DeleteLoadBalancerPoolWithContext is an alternate form of the DeleteLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerPoolWithContext(ctx context.Context, deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions cannot be nil") +// AddVPNGatewayConnectionPeerCIDRWithContext is an alternate form of the AddVPNGatewayConnectionPeerCIDR method which supports a Context parameter +func (vpc *VpcV1) AddVPNGatewayConnectionPeerCIDRWithContext(ctx context.Context, addVPNGatewayConnectionPeerCIDROptions *AddVPNGatewayConnectionPeerCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions") + err = core.ValidateStruct(addVPNGatewayConnectionPeerCIDROptions, "addVPNGatewayConnectionPeerCIDROptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerPoolOptions.LoadBalancerID, - "id": *deleteLoadBalancerPoolOptions.ID, + "vpn_gateway_id": *addVPNGatewayConnectionPeerCIDROptions.VPNGatewayID, + "id": *addVPNGatewayConnectionPeerCIDROptions.ID, + "cidr_prefix": *addVPNGatewayConnectionPeerCIDROptions.CIDRPrefix, + "prefix_length": *addVPNGatewayConnectionPeerCIDROptions.PrefixLength, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range addVPNGatewayConnectionPeerCIDROptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayConnectionPeerCIDR") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16312,41 +16128,33 @@ func (vpc *VpcV1) DeleteLoadBalancerPoolWithContext(ctx context.Context, deleteL return } -// GetLoadBalancerPool : Retrieve a load balancer pool -// This request retrieves a single pool specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerPoolWithContext(context.Background(), getLoadBalancerPoolOptions) +// ListLoadBalancerProfiles : List all load balancer profiles +// This request lists all load balancer profiles available in the region. A load balancer profile specifies the +// performance characteristics and pricing model for a load balancer. +func (vpc *VpcV1) ListLoadBalancerProfiles(listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerProfilesWithContext(context.Background(), listLoadBalancerProfilesOptions) } -// GetLoadBalancerPoolWithContext is an alternate form of the GetLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions") +// ListLoadBalancerProfilesWithContext is an alternate form of the ListLoadBalancerProfiles method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerProfilesWithContext(ctx context.Context, listLoadBalancerProfilesOptions *ListLoadBalancerProfilesOptions) (result *LoadBalancerProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listLoadBalancerProfilesOptions, "listLoadBalancerProfilesOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerPoolOptions.LoadBalancerID, - "id": *getLoadBalancerPoolOptions.ID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles`, nil) if err != nil { return } - for headerName, headerValue := range getLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range listLoadBalancerProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16354,6 +16162,12 @@ func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBal builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listLoadBalancerProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listLoadBalancerProfilesOptions.Start)) + } + if listLoadBalancerProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listLoadBalancerProfilesOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -16366,7 +16180,7 @@ func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBal return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfileCollection) if err != nil { return } @@ -16376,55 +16190,48 @@ func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBal return } -// UpdateLoadBalancerPool : Update a load balancer pool -// This request updates a load balancer pool from a pool patch. -func (vpc *VpcV1) UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerPoolWithContext(context.Background(), updateLoadBalancerPoolOptions) +// GetLoadBalancerProfile : Retrieve a load balancer profile +// This request retrieves a load balancer profile specified by the name in the URL. +func (vpc *VpcV1) GetLoadBalancerProfile(getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerProfileWithContext(context.Background(), getLoadBalancerProfileOptions) } -// UpdateLoadBalancerPoolWithContext is an alternate form of the UpdateLoadBalancerPool method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions cannot be nil") +// GetLoadBalancerProfileWithContext is an alternate form of the GetLoadBalancerProfile method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerProfileWithContext(ctx context.Context, getLoadBalancerProfileOptions *GetLoadBalancerProfileOptions) (result *LoadBalancerProfile, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions") + err = core.ValidateStruct(getLoadBalancerProfileOptions, "getLoadBalancerProfileOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerPoolOptions.LoadBalancerID, - "id": *updateLoadBalancerPoolOptions.ID, + "name": *getLoadBalancerProfileOptions.Name, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancer/profiles/{name}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerPoolOptions.Headers { + for headerName, headerValue := range getLoadBalancerProfileOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPool") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerProfile") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolOptions.LoadBalancerPoolPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -16436,7 +16243,7 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateL return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerProfile) if err != nil { return } @@ -16446,41 +16253,32 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateL return } -// ListLoadBalancerPoolMembers : List all members of a load balancer pool -// This request lists all members of a load balancer pool. -func (vpc *VpcV1) ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - return vpc.ListLoadBalancerPoolMembersWithContext(context.Background(), listLoadBalancerPoolMembersOptions) +// ListLoadBalancers : List all load balancers +// This request lists all load balancers in the region. +func (vpc *VpcV1) ListLoadBalancers(listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancersWithContext(context.Background(), listLoadBalancersOptions) } -// ListLoadBalancerPoolMembersWithContext is an alternate form of the ListLoadBalancerPoolMembers method which supports a Context parameter -func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions") +// ListLoadBalancersWithContext is an alternate form of the ListLoadBalancers method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancersWithContext(ctx context.Context, listLoadBalancersOptions *ListLoadBalancersOptions) (result *LoadBalancerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listLoadBalancersOptions, "listLoadBalancersOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *listLoadBalancerPoolMembersOptions.LoadBalancerID, - "pool_id": *listLoadBalancerPoolMembersOptions.PoolID, - } - builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) if err != nil { return } - for headerName, headerValue := range listLoadBalancerPoolMembersOptions.Headers { + for headerName, headerValue := range listLoadBalancersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPoolMembers") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancers") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16488,6 +16286,12 @@ func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, li builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listLoadBalancersOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listLoadBalancersOptions.Start)) + } + if listLoadBalancersOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listLoadBalancersOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -16500,7 +16304,7 @@ func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, li return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerCollection) if err != nil { return } @@ -16510,41 +16314,36 @@ func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, li return } -// CreateLoadBalancerPoolMember : Create a member in a load balancer pool -// This request creates a new member and adds the member to the pool. -func (vpc *VpcV1) CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.CreateLoadBalancerPoolMemberWithContext(context.Background(), createLoadBalancerPoolMemberOptions) +// CreateLoadBalancer : Create a load balancer +// This request creates and provisions a new load balancer. +func (vpc *VpcV1) CreateLoadBalancer(createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerWithContext(context.Background(), createLoadBalancerOptions) } -// CreateLoadBalancerPoolMemberWithContext is an alternate form of the CreateLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) CreateLoadBalancerPoolMemberWithContext(ctx context.Context, createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions cannot be nil") +// CreateLoadBalancerWithContext is an alternate form of the CreateLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadBalancerOptions *CreateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerOptions, "createLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(createLoadBalancerOptions, "createLoadBalancerOptions") if err != nil { return } - pathParamsMap := map[string]string{ - "load_balancer_id": *createLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *createLoadBalancerPoolMemberOptions.PoolID, - } - builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers`, nil) if err != nil { return } - for headerName, headerValue := range createLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range createLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16555,89 +16354,35 @@ func (vpc *VpcV1) CreateLoadBalancerPoolMemberWithContext(ctx context.Context, c builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) body := make(map[string]interface{}) - if createLoadBalancerPoolMemberOptions.Port != nil { - body["port"] = createLoadBalancerPoolMemberOptions.Port - } - if createLoadBalancerPoolMemberOptions.Target != nil { - body["target"] = createLoadBalancerPoolMemberOptions.Target - } - if createLoadBalancerPoolMemberOptions.Weight != nil { - body["weight"] = createLoadBalancerPoolMemberOptions.Weight - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return + if createLoadBalancerOptions.IsPublic != nil { + body["is_public"] = createLoadBalancerOptions.IsPublic } - - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return + if createLoadBalancerOptions.Subnets != nil { + body["subnets"] = createLoadBalancerOptions.Subnets } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) - if err != nil { - return - } - response.Result = result + if createLoadBalancerOptions.Listeners != nil { + body["listeners"] = createLoadBalancerOptions.Listeners } - - return -} - -// ReplaceLoadBalancerPoolMembers : Replace load balancer pool members -// This request replaces the existing members of the load balancer pool with new members created from the collection of -// member prototype objects. -func (vpc *VpcV1) ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - return vpc.ReplaceLoadBalancerPoolMembersWithContext(context.Background(), replaceLoadBalancerPoolMembersOptions) -} - -// ReplaceLoadBalancerPoolMembersWithContext is an alternate form of the ReplaceLoadBalancerPoolMembers method which supports a Context parameter -func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions cannot be nil") - if err != nil { - return + if createLoadBalancerOptions.Logging != nil { + body["logging"] = createLoadBalancerOptions.Logging } - err = core.ValidateStruct(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions") - if err != nil { - return + if createLoadBalancerOptions.Name != nil { + body["name"] = createLoadBalancerOptions.Name } - - pathParamsMap := map[string]string{ - "load_balancer_id": *replaceLoadBalancerPoolMembersOptions.LoadBalancerID, - "pool_id": *replaceLoadBalancerPoolMembersOptions.PoolID, + if createLoadBalancerOptions.Pools != nil { + body["pools"] = createLoadBalancerOptions.Pools } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) - if err != nil { - return + if createLoadBalancerOptions.Profile != nil { + body["profile"] = createLoadBalancerOptions.Profile } - - for headerName, headerValue := range replaceLoadBalancerPoolMembersOptions.Headers { - builder.AddHeader(headerName, headerValue) + if createLoadBalancerOptions.ResourceGroup != nil { + body["resource_group"] = createLoadBalancerOptions.ResourceGroup } - - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceLoadBalancerPoolMembers") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) + if createLoadBalancerOptions.RouteMode != nil { + body["route_mode"] = createLoadBalancerOptions.RouteMode } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*vpc.Version)) - builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - - body := make(map[string]interface{}) - if replaceLoadBalancerPoolMembersOptions.Members != nil { - body["members"] = replaceLoadBalancerPoolMembersOptions.Members + if createLoadBalancerOptions.SecurityGroups != nil { + body["security_groups"] = createLoadBalancerOptions.SecurityGroups } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -16655,7 +16400,7 @@ func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) if err != nil { return } @@ -16665,42 +16410,40 @@ func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, return } -// DeleteLoadBalancerPoolMember : Delete a load balancer pool member -// This request deletes a member from the pool. This operation cannot be reversed. -func (vpc *VpcV1) DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteLoadBalancerPoolMemberWithContext(context.Background(), deleteLoadBalancerPoolMemberOptions) +// DeleteLoadBalancer : Delete a load balancer +// This request deletes a load balancer. This operation cannot be reversed. +func (vpc *VpcV1) DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerWithContext(context.Background(), deleteLoadBalancerOptions) } -// DeleteLoadBalancerPoolMemberWithContext is an alternate form of the DeleteLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) DeleteLoadBalancerPoolMemberWithContext(ctx context.Context, deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteLoadBalancerPoolMemberOptions, "deleteLoadBalancerPoolMemberOptions cannot be nil") +// DeleteLoadBalancerWithContext is an alternate form of the DeleteLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerWithContext(ctx context.Context, deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerOptions, "deleteLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteLoadBalancerPoolMemberOptions, "deleteLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(deleteLoadBalancerOptions, "deleteLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *deleteLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *deleteLoadBalancerPoolMemberOptions.PoolID, - "id": *deleteLoadBalancerPoolMemberOptions.ID, + "id": *deleteLoadBalancerOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16718,42 +16461,40 @@ func (vpc *VpcV1) DeleteLoadBalancerPoolMemberWithContext(ctx context.Context, d return } -// GetLoadBalancerPoolMember : Retrieve a load balancer pool member -// This request retrieves a single member specified by the identifier in the URL path. -func (vpc *VpcV1) GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.GetLoadBalancerPoolMemberWithContext(context.Background(), getLoadBalancerPoolMemberOptions) +// GetLoadBalancer : Retrieve a load balancer +// This request retrieves a single load balancer specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancer(getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerWithContext(context.Background(), getLoadBalancerOptions) } -// GetLoadBalancerPoolMemberWithContext is an alternate form of the GetLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions cannot be nil") +// GetLoadBalancerWithContext is an alternate form of the GetLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerWithContext(ctx context.Context, getLoadBalancerOptions *GetLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerOptions, "getLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(getLoadBalancerOptions, "getLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *getLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *getLoadBalancerPoolMemberOptions.PoolID, - "id": *getLoadBalancerPoolMemberOptions.ID, + "id": *getLoadBalancerOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range getLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16773,7 +16514,7 @@ func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getL return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) if err != nil { return } @@ -16783,42 +16524,40 @@ func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getL return } -// UpdateLoadBalancerPoolMember : Update a load balancer pool member -// This request updates an existing member from a member patch. -func (vpc *VpcV1) UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - return vpc.UpdateLoadBalancerPoolMemberWithContext(context.Background(), updateLoadBalancerPoolMemberOptions) +// UpdateLoadBalancer : Update a load balancer +// This request updates a load balancer. +func (vpc *VpcV1) UpdateLoadBalancer(updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerWithContext(context.Background(), updateLoadBalancerOptions) } -// UpdateLoadBalancerPoolMemberWithContext is an alternate form of the UpdateLoadBalancerPoolMember method which supports a Context parameter -func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions cannot be nil") +// UpdateLoadBalancerWithContext is an alternate form of the UpdateLoadBalancer method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerWithContext(ctx context.Context, updateLoadBalancerOptions *UpdateLoadBalancerOptions) (result *LoadBalancer, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerOptions, "updateLoadBalancerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions") + err = core.ValidateStruct(updateLoadBalancerOptions, "updateLoadBalancerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "load_balancer_id": *updateLoadBalancerPoolMemberOptions.LoadBalancerID, - "pool_id": *updateLoadBalancerPoolMemberOptions.PoolID, - "id": *updateLoadBalancerPoolMemberOptions.ID, + "id": *updateLoadBalancerOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateLoadBalancerPoolMemberOptions.Headers { + for headerName, headerValue := range updateLoadBalancerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPoolMember") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancer") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16828,7 +16567,7 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, u builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolMemberOptions.LoadBalancerPoolMemberPatch) + _, err = builder.SetBodyContentJSON(updateLoadBalancerOptions.LoadBalancerPatch) if err != nil { return } @@ -16844,7 +16583,7 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, u return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancer) if err != nil { return } @@ -16854,33 +16593,40 @@ func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, u return } -// ListEndpointGateways : List all endpoint gateways -// This request lists all endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to -// a target outside the VPC. -func (vpc *VpcV1) ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { - return vpc.ListEndpointGatewaysWithContext(context.Background(), listEndpointGatewaysOptions) +// GetLoadBalancerStatistics : List all statistics of a load balancer +// This request lists statistics of a load balancer. +func (vpc *VpcV1) GetLoadBalancerStatistics(getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerStatisticsWithContext(context.Background(), getLoadBalancerStatisticsOptions) } -// ListEndpointGatewaysWithContext is an alternate form of the ListEndpointGateways method which supports a Context parameter -func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listEndpointGatewaysOptions, "listEndpointGatewaysOptions") +// GetLoadBalancerStatisticsWithContext is an alternate form of the GetLoadBalancerStatistics method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerStatisticsWithContext(ctx context.Context, getLoadBalancerStatisticsOptions *GetLoadBalancerStatisticsOptions) (result *LoadBalancerStatistics, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLoadBalancerStatisticsOptions, "getLoadBalancerStatisticsOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "id": *getLoadBalancerStatisticsOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{id}/statistics`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listEndpointGatewaysOptions.Headers { + for headerName, headerValue := range getLoadBalancerStatisticsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGateways") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerStatistics") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -16888,18 +16634,6 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listEndpointGatewaysOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listEndpointGatewaysOptions.Name)) - } - if listEndpointGatewaysOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listEndpointGatewaysOptions.Start)) - } - if listEndpointGatewaysOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewaysOptions.Limit)) - } - if listEndpointGatewaysOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listEndpointGatewaysOptions.ResourceGroupID)) - } request, err := builder.Build() if err != nil { @@ -16912,7 +16646,7 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerStatistics) if err != nil { return } @@ -16922,70 +16656,48 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo return } -// CreateEndpointGateway : Create an endpoint gateway -// This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target -// outside the VPC. -func (vpc *VpcV1) CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.CreateEndpointGatewayWithContext(context.Background(), createEndpointGatewayOptions) +// ListLoadBalancerListeners : List all listeners for a load balancer +// This request lists all listeners for a load balancer. +func (vpc *VpcV1) ListLoadBalancerListeners(listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerListenersWithContext(context.Background(), listLoadBalancerListenersOptions) } -// CreateEndpointGatewayWithContext is an alternate form of the CreateEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createEndpointGatewayOptions, "createEndpointGatewayOptions cannot be nil") +// ListLoadBalancerListenersWithContext is an alternate form of the ListLoadBalancerListeners method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerListenersWithContext(ctx context.Context, listLoadBalancerListenersOptions *ListLoadBalancerListenersOptions) (result *LoadBalancerListenerCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createEndpointGatewayOptions, "createEndpointGatewayOptions") + err = core.ValidateStruct(listLoadBalancerListenersOptions, "listLoadBalancerListenersOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "load_balancer_id": *listLoadBalancerListenersOptions.LoadBalancerID, + } + + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createEndpointGatewayOptions.Headers { + for headerName, headerValue := range listLoadBalancerListenersOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListeners") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createEndpointGatewayOptions.Target != nil { - body["target"] = createEndpointGatewayOptions.Target - } - if createEndpointGatewayOptions.VPC != nil { - body["vpc"] = createEndpointGatewayOptions.VPC - } - if createEndpointGatewayOptions.Ips != nil { - body["ips"] = createEndpointGatewayOptions.Ips - } - if createEndpointGatewayOptions.Name != nil { - body["name"] = createEndpointGatewayOptions.Name - } - if createEndpointGatewayOptions.ResourceGroup != nil { - body["resource_group"] = createEndpointGatewayOptions.ResourceGroup - } - if createEndpointGatewayOptions.SecurityGroups != nil { - body["security_groups"] = createEndpointGatewayOptions.SecurityGroups - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return @@ -16997,7 +16709,7 @@ func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEn return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerCollection) if err != nil { return } @@ -17007,55 +16719,83 @@ func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEn return } -// ListEndpointGatewayIps : List all reserved IPs bound to an endpoint gateway -// This request lists all reserved IPs bound to an endpoint gateway. -func (vpc *VpcV1) ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { - return vpc.ListEndpointGatewayIpsWithContext(context.Background(), listEndpointGatewayIpsOptions) +// CreateLoadBalancerListener : Create a listener for a load balancer +// This request creates a new listener for a load balancer. +func (vpc *VpcV1) CreateLoadBalancerListener(createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerListenerWithContext(context.Background(), createLoadBalancerListenerOptions) } -// ListEndpointGatewayIpsWithContext is an alternate form of the ListEndpointGatewayIps method which supports a Context parameter -func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions cannot be nil") +// CreateLoadBalancerListenerWithContext is an alternate form of the CreateLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerListenerWithContext(ctx context.Context, createLoadBalancerListenerOptions *CreateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions") + err = core.ValidateStruct(createLoadBalancerListenerOptions, "createLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *listEndpointGatewayIpsOptions.EndpointGatewayID, + "load_balancer_id": *createLoadBalancerListenerOptions.LoadBalancerID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listEndpointGatewayIpsOptions.Headers { + for headerName, headerValue := range createLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayIps") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listEndpointGatewayIpsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayIpsOptions.Start)) + + body := make(map[string]interface{}) + if createLoadBalancerListenerOptions.Protocol != nil { + body["protocol"] = createLoadBalancerListenerOptions.Protocol } - if listEndpointGatewayIpsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayIpsOptions.Limit)) + if createLoadBalancerListenerOptions.AcceptProxyProtocol != nil { + body["accept_proxy_protocol"] = createLoadBalancerListenerOptions.AcceptProxyProtocol } - if listEndpointGatewayIpsOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listEndpointGatewayIpsOptions.Sort)) + if createLoadBalancerListenerOptions.CertificateInstance != nil { + body["certificate_instance"] = createLoadBalancerListenerOptions.CertificateInstance + } + if createLoadBalancerListenerOptions.ConnectionLimit != nil { + body["connection_limit"] = createLoadBalancerListenerOptions.ConnectionLimit + } + if createLoadBalancerListenerOptions.DefaultPool != nil { + body["default_pool"] = createLoadBalancerListenerOptions.DefaultPool + } + if createLoadBalancerListenerOptions.HTTPSRedirect != nil { + body["https_redirect"] = createLoadBalancerListenerOptions.HTTPSRedirect + } + if createLoadBalancerListenerOptions.Policies != nil { + body["policies"] = createLoadBalancerListenerOptions.Policies + } + if createLoadBalancerListenerOptions.Port != nil { + body["port"] = createLoadBalancerListenerOptions.Port + } + if createLoadBalancerListenerOptions.PortMax != nil { + body["port_max"] = createLoadBalancerListenerOptions.PortMax + } + if createLoadBalancerListenerOptions.PortMin != nil { + body["port_min"] = createLoadBalancerListenerOptions.PortMin + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } request, err := builder.Build() @@ -17069,7 +16809,7 @@ func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEnd return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionEndpointGatewayContext) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) if err != nil { return } @@ -17079,42 +16819,42 @@ func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEnd return } -// RemoveEndpointGatewayIP : Unbind a reserved IP from an endpoint gateway -// This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has -// `auto_delete` set to `true`, the reserved IP will be deleted. -func (vpc *VpcV1) RemoveEndpointGatewayIP(removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { - return vpc.RemoveEndpointGatewayIPWithContext(context.Background(), removeEndpointGatewayIPOptions) +// DeleteLoadBalancerListener : Delete a load balancer listener +// This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, the +// listener must not be the target of another load balancer listener. +func (vpc *VpcV1) DeleteLoadBalancerListener(deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerListenerWithContext(context.Background(), deleteLoadBalancerListenerOptions) } -// RemoveEndpointGatewayIPWithContext is an alternate form of the RemoveEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions cannot be nil") +// DeleteLoadBalancerListenerWithContext is an alternate form of the DeleteLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerListenerWithContext(ctx context.Context, deleteLoadBalancerListenerOptions *DeleteLoadBalancerListenerOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions") + err = core.ValidateStruct(deleteLoadBalancerListenerOptions, "deleteLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *removeEndpointGatewayIPOptions.EndpointGatewayID, - "id": *removeEndpointGatewayIPOptions.ID, + "load_balancer_id": *deleteLoadBalancerListenerOptions.LoadBalancerID, + "id": *deleteLoadBalancerListenerOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range removeEndpointGatewayIPOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveEndpointGatewayIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -17132,42 +16872,41 @@ func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, remove return } -// GetEndpointGatewayIP : Retrieve a reserved IP bound to an endpoint gateway -// This request a retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the -// URL. -func (vpc *VpcV1) GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.GetEndpointGatewayIPWithContext(context.Background(), getEndpointGatewayIPOptions) +// GetLoadBalancerListener : Retrieve a load balancer listener +// This request retrieves a single listener specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerListener(getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerListenerWithContext(context.Background(), getLoadBalancerListenerOptions) } -// GetEndpointGatewayIPWithContext is an alternate form of the GetEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions cannot be nil") +// GetLoadBalancerListenerWithContext is an alternate form of the GetLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerListenerWithContext(ctx context.Context, getLoadBalancerListenerOptions *GetLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions") + err = core.ValidateStruct(getLoadBalancerListenerOptions, "getLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *getEndpointGatewayIPOptions.EndpointGatewayID, - "id": *getEndpointGatewayIPOptions.ID, + "load_balancer_id": *getLoadBalancerListenerOptions.LoadBalancerID, + "id": *getLoadBalancerListenerOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getEndpointGatewayIPOptions.Headers { + for headerName, headerValue := range getLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -17187,7 +16926,7 @@ func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpoi return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) if err != nil { return } @@ -17197,52 +16936,55 @@ func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpoi return } -// AddEndpointGatewayIP : Bind a reserved IP to an endpoint gateway -// This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: -// -// - must currently be unbound -// - must not be in the same zone as any other reserved IP bound to the endpoint gateway. -func (vpc *VpcV1) AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - return vpc.AddEndpointGatewayIPWithContext(context.Background(), addEndpointGatewayIPOptions) +// UpdateLoadBalancerListener : Update a load balancer listener +// This request updates a load balancer listener from a listener patch. +func (vpc *VpcV1) UpdateLoadBalancerListener(updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerListenerWithContext(context.Background(), updateLoadBalancerListenerOptions) } -// AddEndpointGatewayIPWithContext is an alternate form of the AddEndpointGatewayIP method which supports a Context parameter -func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions cannot be nil") +// UpdateLoadBalancerListenerWithContext is an alternate form of the UpdateLoadBalancerListener method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerListenerWithContext(ctx context.Context, updateLoadBalancerListenerOptions *UpdateLoadBalancerListenerOptions) (result *LoadBalancerListener, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions") + err = core.ValidateStruct(updateLoadBalancerListenerOptions, "updateLoadBalancerListenerOptions") if err != nil { return } pathParamsMap := map[string]string{ - "endpoint_gateway_id": *addEndpointGatewayIPOptions.EndpointGatewayID, - "id": *addEndpointGatewayIPOptions.ID, + "load_balancer_id": *updateLoadBalancerListenerOptions.LoadBalancerID, + "id": *updateLoadBalancerListenerOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range addEndpointGatewayIPOptions.Headers { + for headerName, headerValue := range updateLoadBalancerListenerOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddEndpointGatewayIP") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListener") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerOptions.LoadBalancerListenerPatch) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -17254,7 +16996,7 @@ func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpoi return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListener) if err != nil { return } @@ -17264,46 +17006,45 @@ func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpoi return } -// DeleteEndpointGateway : Delete an endpoint gateway -// This request deletes an endpoint gateway. This operation cannot be reversed. -// -// Reserved IPs that were bound to the endpoint gateway will be released if their -// `auto_delete` property is set to true. -func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) +// ListLoadBalancerListenerPolicies : List all policies for a load balancer listener +// This request lists all policies for a load balancer listener. +func (vpc *VpcV1) ListLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerListenerPoliciesWithContext(context.Background(), listLoadBalancerListenerPoliciesOptions) } -// DeleteEndpointGatewayWithContext is an alternate form of the DeleteEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions cannot be nil") +// ListLoadBalancerListenerPoliciesWithContext is an alternate form of the ListLoadBalancerListenerPolicies method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerListenerPoliciesWithContext(ctx context.Context, listLoadBalancerListenerPoliciesOptions *ListLoadBalancerListenerPoliciesOptions) (result *LoadBalancerListenerPolicyCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions") + err = core.ValidateStruct(listLoadBalancerListenerPoliciesOptions, "listLoadBalancerListenerPoliciesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteEndpointGatewayOptions.ID, + "load_balancer_id": *listLoadBalancerListenerPoliciesOptions.LoadBalancerID, + "listener_id": *listLoadBalancerListenerPoliciesOptions.ListenerID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteEndpointGatewayOptions.Headers { + for headerName, headerValue := range listLoadBalancerListenerPoliciesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicies") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -17313,53 +17054,87 @@ func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEn return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetEndpointGateway : Retrieve an endpoint gateway -// This request retrieves a single endpoint gateway specified by the identifier in the URL. -func (vpc *VpcV1) GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.GetEndpointGatewayWithContext(context.Background(), getEndpointGatewayOptions) +// CreateLoadBalancerListenerPolicy : Create a policy for a load balancer listener +// Creates a new policy for a load balancer listener. +func (vpc *VpcV1) CreateLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerListenerPolicyWithContext(context.Background(), createLoadBalancerListenerPolicyOptions) } -// GetEndpointGatewayWithContext is an alternate form of the GetEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEndpointGatewayOptions, "getEndpointGatewayOptions cannot be nil") +// CreateLoadBalancerListenerPolicyWithContext is an alternate form of the CreateLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerListenerPolicyWithContext(ctx context.Context, createLoadBalancerListenerPolicyOptions *CreateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getEndpointGatewayOptions, "getEndpointGatewayOptions") + err = core.ValidateStruct(createLoadBalancerListenerPolicyOptions, "createLoadBalancerListenerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getEndpointGatewayOptions.ID, + "load_balancer_id": *createLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *createLoadBalancerListenerPolicyOptions.ListenerID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getEndpointGatewayOptions.Headers { + for headerName, headerValue := range createLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createLoadBalancerListenerPolicyOptions.Action != nil { + body["action"] = createLoadBalancerListenerPolicyOptions.Action + } + if createLoadBalancerListenerPolicyOptions.Priority != nil { + body["priority"] = createLoadBalancerListenerPolicyOptions.Priority + } + if createLoadBalancerListenerPolicyOptions.Name != nil { + body["name"] = createLoadBalancerListenerPolicyOptions.Name + } + if createLoadBalancerListenerPolicyOptions.Rules != nil { + body["rules"] = createLoadBalancerListenerPolicyOptions.Rules + } + if createLoadBalancerListenerPolicyOptions.Target != nil { + body["target"] = createLoadBalancerListenerPolicyOptions.Target + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -17371,7 +17146,7 @@ func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpoint return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) if err != nil { return } @@ -17381,102 +17156,95 @@ func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpoint return } -// UpdateEndpointGateway : Update an endpoint gateway -// This request updates an endpoint gateway's name. -func (vpc *VpcV1) UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - return vpc.UpdateEndpointGatewayWithContext(context.Background(), updateEndpointGatewayOptions) +// DeleteLoadBalancerListenerPolicy : Delete a load balancer listener policy +// Deletes a policy of the load balancer listener. This operation cannot be reversed. +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerListenerPolicyWithContext(context.Background(), deleteLoadBalancerListenerPolicyOptions) } -// UpdateEndpointGatewayWithContext is an alternate form of the UpdateEndpointGateway method which supports a Context parameter -func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateEndpointGatewayOptions, "updateEndpointGatewayOptions cannot be nil") +// DeleteLoadBalancerListenerPolicyWithContext is an alternate form of the DeleteLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyOptions *DeleteLoadBalancerListenerPolicyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateEndpointGatewayOptions, "updateEndpointGatewayOptions") + err = core.ValidateStruct(deleteLoadBalancerListenerPolicyOptions, "deleteLoadBalancerListenerPolicyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateEndpointGatewayOptions.ID, + "load_balancer_id": *deleteLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *deleteLoadBalancerListenerPolicyOptions.ListenerID, + "id": *deleteLoadBalancerListenerPolicyOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateEndpointGatewayOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGateway") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateEndpointGatewayOptions.EndpointGatewayPatch) - if err != nil { - return - } - request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = vpc.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) - if err != nil { - return - } - response.Result = result - } + response, err = vpc.Service.Request(request, nil) return } -// ListFlowLogCollectors : List all flow log collectors -// This request lists all flow log collectors in the region. A flow log collector summarizes data sent over one or more -// network interfaces within a VPC, depending on the chosen target. -func (vpc *VpcV1) ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { - return vpc.ListFlowLogCollectorsWithContext(context.Background(), listFlowLogCollectorsOptions) +// GetLoadBalancerListenerPolicy : Retrieve a load balancer listener policy +// Retrieve a single policy specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerListenerPolicyWithContext(context.Background(), getLoadBalancerListenerPolicyOptions) } -// ListFlowLogCollectorsWithContext is an alternate form of the ListFlowLogCollectors method which supports a Context parameter -func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listFlowLogCollectorsOptions, "listFlowLogCollectorsOptions") +// GetLoadBalancerListenerPolicyWithContext is an alternate form of the GetLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerListenerPolicyWithContext(ctx context.Context, getLoadBalancerListenerPolicyOptions *GetLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLoadBalancerListenerPolicyOptions, "getLoadBalancerListenerPolicyOptions") if err != nil { return } + pathParamsMap := map[string]string{ + "load_balancer_id": *getLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *getLoadBalancerListenerPolicyOptions.ListenerID, + "id": *getLoadBalancerListenerPolicyOptions.ID, + } + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range listFlowLogCollectorsOptions.Headers { + for headerName, headerValue := range getLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFlowLogCollectors") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -17484,33 +17252,6 @@ func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlow builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - if listFlowLogCollectorsOptions.Start != nil { - builder.AddQuery("start", fmt.Sprint(*listFlowLogCollectorsOptions.Start)) - } - if listFlowLogCollectorsOptions.Limit != nil { - builder.AddQuery("limit", fmt.Sprint(*listFlowLogCollectorsOptions.Limit)) - } - if listFlowLogCollectorsOptions.ResourceGroupID != nil { - builder.AddQuery("resource_group.id", fmt.Sprint(*listFlowLogCollectorsOptions.ResourceGroupID)) - } - if listFlowLogCollectorsOptions.Name != nil { - builder.AddQuery("name", fmt.Sprint(*listFlowLogCollectorsOptions.Name)) - } - if listFlowLogCollectorsOptions.VPCID != nil { - builder.AddQuery("vpc.id", fmt.Sprint(*listFlowLogCollectorsOptions.VPCID)) - } - if listFlowLogCollectorsOptions.VPCCRN != nil { - builder.AddQuery("vpc.crn", fmt.Sprint(*listFlowLogCollectorsOptions.VPCCRN)) - } - if listFlowLogCollectorsOptions.VPCName != nil { - builder.AddQuery("vpc.name", fmt.Sprint(*listFlowLogCollectorsOptions.VPCName)) - } - if listFlowLogCollectorsOptions.TargetID != nil { - builder.AddQuery("target.id", fmt.Sprint(*listFlowLogCollectorsOptions.TargetID)) - } - if listFlowLogCollectorsOptions.TargetResourceType != nil { - builder.AddQuery("target.resource_type", fmt.Sprint(*listFlowLogCollectorsOptions.TargetResourceType)) - } request, err := builder.Build() if err != nil { @@ -17523,7 +17264,7 @@ func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlow return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollectorCollection) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) if err != nil { return } @@ -17533,64 +17274,52 @@ func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlow return } -// CreateFlowLogCollector : Create a flow log collector -// This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype -// object is structured in the same way as a retrieved flow log collector, and contains the information necessary to -// create and start the new flow log collector. -func (vpc *VpcV1) CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.CreateFlowLogCollectorWithContext(context.Background(), createFlowLogCollectorOptions) +// UpdateLoadBalancerListenerPolicy : Update a load balancer listener policy +// Updates a policy from a policy patch. +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerListenerPolicyWithContext(context.Background(), updateLoadBalancerListenerPolicyOptions) } -// CreateFlowLogCollectorWithContext is an alternate form of the CreateFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createFlowLogCollectorOptions, "createFlowLogCollectorOptions cannot be nil") +// UpdateLoadBalancerListenerPolicyWithContext is an alternate form of the UpdateLoadBalancerListenerPolicy method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyWithContext(ctx context.Context, updateLoadBalancerListenerPolicyOptions *UpdateLoadBalancerListenerPolicyOptions) (result *LoadBalancerListenerPolicy, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createFlowLogCollectorOptions, "createFlowLogCollectorOptions") + err = core.ValidateStruct(updateLoadBalancerListenerPolicyOptions, "updateLoadBalancerListenerPolicyOptions") if err != nil { return } - builder := core.NewRequestBuilder(core.POST) + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerListenerPolicyOptions.LoadBalancerID, + "listener_id": *updateLoadBalancerListenerPolicyOptions.ListenerID, + "id": *updateLoadBalancerListenerPolicyOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range createFlowLogCollectorOptions.Headers { + for headerName, headerValue := range updateLoadBalancerListenerPolicyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicy") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - body := make(map[string]interface{}) - if createFlowLogCollectorOptions.StorageBucket != nil { - body["storage_bucket"] = createFlowLogCollectorOptions.StorageBucket - } - if createFlowLogCollectorOptions.Target != nil { - body["target"] = createFlowLogCollectorOptions.Target - } - if createFlowLogCollectorOptions.Active != nil { - body["active"] = createFlowLogCollectorOptions.Active - } - if createFlowLogCollectorOptions.Name != nil { - body["name"] = createFlowLogCollectorOptions.Name - } - if createFlowLogCollectorOptions.ResourceGroup != nil { - body["resource_group"] = createFlowLogCollectorOptions.ResourceGroup - } - _, err = builder.SetBodyContentJSON(body) + _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyOptions.LoadBalancerListenerPolicyPatch) if err != nil { return } @@ -17606,7 +17335,7 @@ func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createF return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicy) if err != nil { return } @@ -17616,45 +17345,46 @@ func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createF return } -// DeleteFlowLogCollector : Delete a flow log collector -// This request stops and deletes a flow log collector. This operation cannot be reversed. -// -// Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. -func (vpc *VpcV1) DeleteFlowLogCollector(deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { - return vpc.DeleteFlowLogCollectorWithContext(context.Background(), deleteFlowLogCollectorOptions) +// ListLoadBalancerListenerPolicyRules : List all rules of a load balancer listener policy +// This request lists all rules of a load balancer listener policy. +func (vpc *VpcV1) ListLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerListenerPolicyRulesWithContext(context.Background(), listLoadBalancerListenerPolicyRulesOptions) } -// DeleteFlowLogCollectorWithContext is an alternate form of the DeleteFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) DeleteFlowLogCollectorWithContext(ctx context.Context, deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions cannot be nil") +// ListLoadBalancerListenerPolicyRulesWithContext is an alternate form of the ListLoadBalancerListenerPolicyRules method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerListenerPolicyRulesWithContext(ctx context.Context, listLoadBalancerListenerPolicyRulesOptions *ListLoadBalancerListenerPolicyRulesOptions) (result *LoadBalancerListenerPolicyRuleCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions") + err = core.ValidateStruct(listLoadBalancerListenerPolicyRulesOptions, "listLoadBalancerListenerPolicyRulesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteFlowLogCollectorOptions.ID, + "load_balancer_id": *listLoadBalancerListenerPolicyRulesOptions.LoadBalancerID, + "listener_id": *listLoadBalancerListenerPolicyRulesOptions.ListenerID, + "policy_id": *listLoadBalancerListenerPolicyRulesOptions.PolicyID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteFlowLogCollectorOptions.Headers { + for headerName, headerValue := range listLoadBalancerListenerPolicyRulesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerListenerPolicyRules") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -17664,53 +17394,85 @@ func (vpc *VpcV1) DeleteFlowLogCollectorWithContext(ctx context.Context, deleteF return } - response, err = vpc.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRuleCollection) + if err != nil { + return + } + response.Result = result + } return } -// GetFlowLogCollector : Retrieve a flow log collector -// This request retrieves a single flow log collector specified by the identifier in the URL. -func (vpc *VpcV1) GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.GetFlowLogCollectorWithContext(context.Background(), getFlowLogCollectorOptions) +// CreateLoadBalancerListenerPolicyRule : Create a rule for a load balancer listener policy +// Creates a new rule for the load balancer listener policy. +func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerListenerPolicyRuleWithContext(context.Background(), createLoadBalancerListenerPolicyRuleOptions) } -// GetFlowLogCollectorWithContext is an alternate form of the GetFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getFlowLogCollectorOptions, "getFlowLogCollectorOptions cannot be nil") +// CreateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the CreateLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, createLoadBalancerListenerPolicyRuleOptions *CreateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getFlowLogCollectorOptions, "getFlowLogCollectorOptions") + err = core.ValidateStruct(createLoadBalancerListenerPolicyRuleOptions, "createLoadBalancerListenerPolicyRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getFlowLogCollectorOptions.ID, + "load_balancer_id": *createLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *createLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *createLoadBalancerListenerPolicyRuleOptions.PolicyID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getFlowLogCollectorOptions.Headers { + for headerName, headerValue := range createLoadBalancerListenerPolicyRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerListenerPolicyRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + body := make(map[string]interface{}) + if createLoadBalancerListenerPolicyRuleOptions.Condition != nil { + body["condition"] = createLoadBalancerListenerPolicyRuleOptions.Condition + } + if createLoadBalancerListenerPolicyRuleOptions.Type != nil { + body["type"] = createLoadBalancerListenerPolicyRuleOptions.Type + } + if createLoadBalancerListenerPolicyRuleOptions.Value != nil { + body["value"] = createLoadBalancerListenerPolicyRuleOptions.Value + } + if createLoadBalancerListenerPolicyRuleOptions.Field != nil { + body["field"] = createLoadBalancerListenerPolicyRuleOptions.Field + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + request, err := builder.Build() if err != nil { return @@ -17722,7 +17484,7 @@ func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLog return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) if err != nil { return } @@ -17732,56 +17494,105 @@ func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLog return } -// UpdateFlowLogCollector : Update a flow log collector -// This request updates a flow log collector with the information in a provided flow log collector patch. The flow log -// collector patch object is structured in the same way as a retrieved flow log collector and contains only the -// information to be updated. -func (vpc *VpcV1) UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - return vpc.UpdateFlowLogCollectorWithContext(context.Background(), updateFlowLogCollectorOptions) +// DeleteLoadBalancerListenerPolicyRule : Delete a load balancer listener policy rule +// Deletes a rule from the load balancer listener policy. This operation cannot be reversed. +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerListenerPolicyRuleWithContext(context.Background(), deleteLoadBalancerListenerPolicyRuleOptions) } -// UpdateFlowLogCollectorWithContext is an alternate form of the UpdateFlowLogCollector method which supports a Context parameter -func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions cannot be nil") +// DeleteLoadBalancerListenerPolicyRuleWithContext is an alternate form of the DeleteLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, deleteLoadBalancerListenerPolicyRuleOptions *DeleteLoadBalancerListenerPolicyRuleOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions") + err = core.ValidateStruct(deleteLoadBalancerListenerPolicyRuleOptions, "deleteLoadBalancerListenerPolicyRuleOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateFlowLogCollectorOptions.ID, - } - - builder := core.NewRequestBuilder(core.PATCH) + "load_balancer_id": *deleteLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *deleteLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *deleteLoadBalancerListenerPolicyRuleOptions.PolicyID, + "id": *deleteLoadBalancerListenerPolicyRuleOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = vpc.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateFlowLogCollectorOptions.Headers { + for headerName, headerValue := range deleteLoadBalancerListenerPolicyRuleOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFlowLogCollector") + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerListenerPolicyRule") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/merge-patch+json") builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - _, err = builder.SetBodyContentJSON(updateFlowLogCollectorOptions.FlowLogCollectorPatch) + request, err := builder.Build() + if err != nil { + return + } + + response, err = vpc.Service.Request(request, nil) + + return +} + +// GetLoadBalancerListenerPolicyRule : Retrieve a load balancer listener policy rule +// Retrieves a single rule specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerListenerPolicyRuleWithContext(context.Background(), getLoadBalancerListenerPolicyRuleOptions) +} + +// GetLoadBalancerListenerPolicyRuleWithContext is an alternate form of the GetLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, getLoadBalancerListenerPolicyRuleOptions *GetLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLoadBalancerListenerPolicyRuleOptions, "getLoadBalancerListenerPolicyRuleOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "load_balancer_id": *getLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *getLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *getLoadBalancerListenerPolicyRuleOptions.PolicyID, + "id": *getLoadBalancerListenerPolicyRuleOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) if err != nil { return } + for headerName, headerValue := range getLoadBalancerListenerPolicyRuleOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerListenerPolicyRule") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + request, err := builder.Build() if err != nil { return @@ -17793,7 +17604,7 @@ func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateF return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) if err != nil { return } @@ -17803,3676 +17614,3872 @@ func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateF return } -// AddEndpointGatewayIPOptions : The AddEndpointGatewayIP options. -type AddEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// UpdateLoadBalancerListenerPolicyRule : Update a load balancer listener policy rule +// Updates a rule of the load balancer listener policy. +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerListenerPolicyRuleWithContext(context.Background(), updateLoadBalancerListenerPolicyRuleOptions) } -// NewAddEndpointGatewayIPOptions : Instantiate AddEndpointGatewayIPOptions -func (*VpcV1) NewAddEndpointGatewayIPOptions(endpointGatewayID string, id string) *AddEndpointGatewayIPOptions { - return &AddEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), +// UpdateLoadBalancerListenerPolicyRuleWithContext is an alternate form of the UpdateLoadBalancerListenerPolicyRule method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerListenerPolicyRuleWithContext(ctx context.Context, updateLoadBalancerListenerPolicyRuleOptions *UpdateLoadBalancerListenerPolicyRuleOptions) (result *LoadBalancerListenerPolicyRule, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions cannot be nil") + if err != nil { + return } -} - -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *AddEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *AddEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddEndpointGatewayIPOptions) SetID(id string) *AddEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddEndpointGatewayIPOptions) SetHeaders(param map[string]string) *AddEndpointGatewayIPOptions { - options.Headers = param - return options -} - -// AddInstanceNetworkInterfaceFloatingIPOptions : The AddInstanceNetworkInterfaceFloatingIP options. -type AddInstanceNetworkInterfaceFloatingIPOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddInstanceNetworkInterfaceFloatingIPOptions : Instantiate AddInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewAddInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *AddInstanceNetworkInterfaceFloatingIPOptions { - return &AddInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), + err = core.ValidateStruct(updateLoadBalancerListenerPolicyRuleOptions, "updateLoadBalancerListenerPolicyRuleOptions") + if err != nil { + return } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *AddInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options -} - -// AddSecurityGroupNetworkInterfaceOptions : The AddSecurityGroupNetworkInterface options. -type AddSecurityGroupNetworkInterfaceOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddSecurityGroupNetworkInterfaceOptions : Instantiate AddSecurityGroupNetworkInterfaceOptions -func (*VpcV1) NewAddSecurityGroupNetworkInterfaceOptions(securityGroupID string, id string) *AddSecurityGroupNetworkInterfaceOptions { - return &AddSecurityGroupNetworkInterfaceOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerID, + "listener_id": *updateLoadBalancerListenerPolicyRuleOptions.ListenerID, + "policy_id": *updateLoadBalancerListenerPolicyRuleOptions.PolicyID, + "id": *updateLoadBalancerListenerPolicyRuleOptions.ID, } -} - -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *AddSecurityGroupNetworkInterfaceOptions) SetSecurityGroupID(securityGroupID string) *AddSecurityGroupNetworkInterfaceOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} -// SetID : Allow user to set ID -func (_options *AddSecurityGroupNetworkInterfaceOptions) SetID(id string) *AddSecurityGroupNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddSecurityGroupNetworkInterfaceOptions) SetHeaders(param map[string]string) *AddSecurityGroupNetworkInterfaceOptions { - options.Headers = param - return options -} - -// AddVPNGatewayConnectionLocalCIDROptions : The AddVPNGatewayConnectionLocalCIDR options. -type AddVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddVPNGatewayConnectionLocalCIDROptions : Instantiate AddVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewAddVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { - return &AddVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}`, pathParamsMap) + if err != nil { + return } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetID(id string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} - -// AddVPNGatewayConnectionPeerCIDROptions : The AddVPNGatewayConnectionPeerCIDR options. -type AddVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewAddVPNGatewayConnectionPeerCIDROptions : Instantiate AddVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewAddVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { - return &AddVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), + for headerName, headerValue := range updateLoadBalancerListenerPolicyRuleOptions.Headers { + builder.AddHeader(headerName, headerValue) } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetID(id string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options -} - -// SetPrefixLength : Allow user to set PrefixLength -func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *AddVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} - -// AddressPrefix : AddressPrefix struct -type AddressPrefix struct { - // The CIDR block for this prefix. - CIDR *string `json:"cidr" validate:"required"` - - // The date and time that the prefix was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // Indicates whether subnets exist with addresses from this prefix. - HasSubnets *bool `json:"has_subnets" validate:"required"` - - // The URL for this address prefix. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this address prefix. - ID *string `json:"id" validate:"required"` - - // Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically - // created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected - // words, but may be updated with a user-specified name. - IsDefault *bool `json:"is_default" validate:"required"` - // The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in. - Name *string `json:"name" validate:"required"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerListenerPolicyRule") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") - // The zone this address prefix resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// UnmarshalAddressPrefix unmarshals an instance of AddressPrefix from the specified map of raw messages. -func UnmarshalAddressPrefix(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefix) - err = core.UnmarshalPrimitive(m, "cidr", &obj.CIDR) + _, err = builder.SetBodyContentJSON(updateLoadBalancerListenerPolicyRuleOptions.LoadBalancerListenerPolicyRulePatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalPrimitive(m, "has_subnets", &obj.HasSubnets) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerListenerPolicyRule) + if err != nil { + return + } + response.Result = result } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + + return +} + +// ListLoadBalancerPools : List all pools of a load balancer +// This request lists all pools of a load balancer. +func (vpc *VpcV1) ListLoadBalancerPools(listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerPoolsWithContext(context.Background(), listLoadBalancerPoolsOptions) +} + +// ListLoadBalancerPoolsWithContext is an alternate form of the ListLoadBalancerPools method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerPoolsWithContext(ctx context.Context, listLoadBalancerPoolsOptions *ListLoadBalancerPoolsOptions) (result *LoadBalancerPoolCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) + err = core.ValidateStruct(listLoadBalancerPoolsOptions, "listLoadBalancerPoolsOptions") if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + + pathParamsMap := map[string]string{ + "load_balancer_id": *listLoadBalancerPoolsOptions.LoadBalancerID, } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AddressPrefixCollection : AddressPrefixCollection struct -type AddressPrefixCollection struct { - // Collection of address prefixes. - AddressPrefixes []AddressPrefix `json:"address_prefixes" validate:"required"` - // A link to the first page of resources. - First *AddressPrefixCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + for headerName, headerValue := range listLoadBalancerPoolsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *AddressPrefixCollectionNext `json:"next,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPools") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// UnmarshalAddressPrefixCollection unmarshals an instance of AddressPrefixCollection from the specified map of raw messages. -func UnmarshalAddressPrefixCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollection) - err = core.UnmarshalModel(m, "address_prefixes", &obj.AddressPrefixes, UnmarshalAddressPrefix) + request, err := builder.Build() if err != nil { return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalAddressPrefixCollectionFirst) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolCollection) + if err != nil { + return + } + response.Result = result } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalAddressPrefixCollectionNext) + + return +} + +// CreateLoadBalancerPool : Create a load balancer pool +// This request creates a new pool from a pool prototype object. +func (vpc *VpcV1) CreateLoadBalancerPool(createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerPoolWithContext(context.Background(), createLoadBalancerPoolOptions) +} + +// CreateLoadBalancerPoolWithContext is an alternate form of the CreateLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerPoolWithContext(ctx context.Context, createLoadBalancerPoolOptions *CreateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerPoolOptions, "createLoadBalancerPoolOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.ValidateStruct(createLoadBalancerPoolOptions, "createLoadBalancerPoolOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// Retrieve the value to be passed to a request to access the next page of results -func (resp *AddressPrefixCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + pathParamsMap := map[string]string{ + "load_balancer_id": *createLoadBalancerPoolOptions.LoadBalancerID, } - return start, nil -} - -// AddressPrefixCollectionFirst : A link to the first page of resources. -type AddressPrefixCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} -// UnmarshalAddressPrefixCollectionFirst unmarshals an instance of AddressPrefixCollectionFirst from the specified map of raw messages. -func UnmarshalAddressPrefixCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools`, pathParamsMap) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AddressPrefixCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type AddressPrefixCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + for headerName, headerValue := range createLoadBalancerPoolOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// UnmarshalAddressPrefixCollectionNext unmarshals an instance of AddressPrefixCollectionNext from the specified map of raw messages. -func UnmarshalAddressPrefixCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPool") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + body := make(map[string]interface{}) + if createLoadBalancerPoolOptions.Algorithm != nil { + body["algorithm"] = createLoadBalancerPoolOptions.Algorithm + } + if createLoadBalancerPoolOptions.HealthMonitor != nil { + body["health_monitor"] = createLoadBalancerPoolOptions.HealthMonitor + } + if createLoadBalancerPoolOptions.Protocol != nil { + body["protocol"] = createLoadBalancerPoolOptions.Protocol + } + if createLoadBalancerPoolOptions.Members != nil { + body["members"] = createLoadBalancerPoolOptions.Members + } + if createLoadBalancerPoolOptions.Name != nil { + body["name"] = createLoadBalancerPoolOptions.Name + } + if createLoadBalancerPoolOptions.ProxyProtocol != nil { + body["proxy_protocol"] = createLoadBalancerPoolOptions.ProxyProtocol + } + if createLoadBalancerPoolOptions.SessionPersistence != nil { + body["session_persistence"] = createLoadBalancerPoolOptions.SessionPersistence + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) + if err != nil { + return + } + response.Result = result + } + return } -// AddressPrefixPatch : AddressPrefixPatch struct -type AddressPrefixPatch struct { - // Indicates whether this is the default prefix for this zone in this VPC. Updating to true makes this prefix the - // default prefix for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. - // Updating to false removes the default prefix for this zone in this VPC. - IsDefault *bool `json:"is_default,omitempty"` - - // The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in. - Name *string `json:"name,omitempty"` +// DeleteLoadBalancerPool : Delete a load balancer pool +// This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the +// default pool for any listener in the load balancer. +func (vpc *VpcV1) DeleteLoadBalancerPool(deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerPoolWithContext(context.Background(), deleteLoadBalancerPoolOptions) } -// UnmarshalAddressPrefixPatch unmarshals an instance of AddressPrefixPatch from the specified map of raw messages. -func UnmarshalAddressPrefixPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AddressPrefixPatch) - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) +// DeleteLoadBalancerPoolWithContext is an alternate form of the DeleteLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerPoolWithContext(ctx context.Context, deleteLoadBalancerPoolOptions *DeleteLoadBalancerPoolOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions cannot be nil") if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.ValidateStruct(deleteLoadBalancerPoolOptions, "deleteLoadBalancerPoolOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AsPatch returns a generic map representation of the AddressPrefixPatch -func (addressPrefixPatch *AddressPrefixPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(addressPrefixPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + pathParamsMap := map[string]string{ + "load_balancer_id": *deleteLoadBalancerPoolOptions.LoadBalancerID, + "id": *deleteLoadBalancerPoolOptions.ID, } - return -} -// CertificateInstanceIdentity : Identifies a certificate instance by a unique property. -// Models which "extend" this model: -// - CertificateInstanceIdentityByCRN -type CertificateInstanceIdentity struct { - // The CRN for this certificate instance. - CRN *string `json:"crn,omitempty"` -} + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + if err != nil { + return + } -func (*CertificateInstanceIdentity) isaCertificateInstanceIdentity() bool { - return true -} + for headerName, headerValue := range deleteLoadBalancerPoolOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -type CertificateInstanceIdentityIntf interface { - isaCertificateInstanceIdentity() bool -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPool") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } -// UnmarshalCertificateInstanceIdentity unmarshals an instance of CertificateInstanceIdentity from the specified map of raw messages. -func UnmarshalCertificateInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + response, err = vpc.Service.Request(request, nil) + return } -// CertificateInstanceReference : CertificateInstanceReference struct -type CertificateInstanceReference struct { - // The CRN for this certificate instance. - CRN *string `json:"crn" validate:"required"` +// GetLoadBalancerPool : Retrieve a load balancer pool +// This request retrieves a single pool specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerPool(getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerPoolWithContext(context.Background(), getLoadBalancerPoolOptions) } -// UnmarshalCertificateInstanceReference unmarshals an instance of CertificateInstanceReference from the specified map of raw messages. -func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CertificateInstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// GetLoadBalancerPoolWithContext is an alternate form of the GetLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerPoolWithContext(ctx context.Context, getLoadBalancerPoolOptions *GetLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLoadBalancerPoolOptions, "getLoadBalancerPoolOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// CheckVPNGatewayConnectionLocalCIDROptions : The CheckVPNGatewayConnectionLocalCIDR options. -type CheckVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + pathParamsMap := map[string]string{ + "load_balancer_id": *getLoadBalancerPoolOptions.LoadBalancerID, + "id": *getLoadBalancerPoolOptions.ID, + } - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + if err != nil { + return + } - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + for headerName, headerValue := range getLoadBalancerPoolOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPool") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // Allows users to set headers on API requests - Headers map[string]string -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// NewCheckVPNGatewayConnectionLocalCIDROptions : Instantiate CheckVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewCheckVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { - return &CheckVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), + request, err := builder.Build() + if err != nil { + return } -} -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) + if err != nil { + return + } + response.Result = result + } -// SetID : Allow user to set ID -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetID(id string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options + return } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// UpdateLoadBalancerPool : Update a load balancer pool +// This request updates a load balancer pool from a pool patch. +func (vpc *VpcV1) UpdateLoadBalancerPool(updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerPoolWithContext(context.Background(), updateLoadBalancerPoolOptions) } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} +// UpdateLoadBalancerPoolWithContext is an alternate form of the UpdateLoadBalancerPool method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerPoolWithContext(ctx context.Context, updateLoadBalancerPoolOptions *UpdateLoadBalancerPoolOptions) (result *LoadBalancerPool, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateLoadBalancerPoolOptions, "updateLoadBalancerPoolOptions") + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *CheckVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options -} + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerPoolOptions.LoadBalancerID, + "id": *updateLoadBalancerPoolOptions.ID, + } -// CheckVPNGatewayConnectionPeerCIDROptions : The CheckVPNGatewayConnectionPeerCIDR options. -type CheckVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{id}`, pathParamsMap) + if err != nil { + return + } - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + for headerName, headerValue := range updateLoadBalancerPoolOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPool") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolOptions.LoadBalancerPoolPatch) + if err != nil { + return + } -// NewCheckVPNGatewayConnectionPeerCIDROptions : Instantiate CheckVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewCheckVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { - return &CheckVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), + request, err := builder.Build() + if err != nil { + return } -} -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPool) + if err != nil { + return + } + response.Result = result + } -// SetID : Allow user to set ID -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetID(id string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options + return } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// ListLoadBalancerPoolMembers : List all members of a load balancer pool +// This request lists all members of a load balancer pool. +func (vpc *VpcV1) ListLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + return vpc.ListLoadBalancerPoolMembersWithContext(context.Background(), listLoadBalancerPoolMembersOptions) } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options -} +// ListLoadBalancerPoolMembersWithContext is an alternate form of the ListLoadBalancerPoolMembers method which supports a Context parameter +func (vpc *VpcV1) ListLoadBalancerPoolMembersWithContext(ctx context.Context, listLoadBalancerPoolMembersOptions *ListLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listLoadBalancerPoolMembersOptions, "listLoadBalancerPoolMembersOptions") + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *CheckVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} + pathParamsMap := map[string]string{ + "load_balancer_id": *listLoadBalancerPoolMembersOptions.LoadBalancerID, + "pool_id": *listLoadBalancerPoolMembersOptions.PoolID, + } -// CloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. -// Models which "extend" this model: -// - CloudObjectStorageBucketIdentityByName -type CloudObjectStorageBucketIdentity struct { - // The globally unique name of this COS bucket. - Name *string `json:"name,omitempty"` -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + if err != nil { + return + } -func (*CloudObjectStorageBucketIdentity) isaCloudObjectStorageBucketIdentity() bool { - return true -} + for headerName, headerValue := range listLoadBalancerPoolMembersOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -type CloudObjectStorageBucketIdentityIntf interface { - isaCloudObjectStorageBucketIdentity() bool -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListLoadBalancerPoolMembers") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") -// UnmarshalCloudObjectStorageBucketIdentity unmarshals an instance of CloudObjectStorageBucketIdentity from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) + if err != nil { + return + } + response.Result = result + } + return } -// CloudObjectStorageBucketReference : CloudObjectStorageBucketReference struct -type CloudObjectStorageBucketReference struct { - // The globally unique name of this COS bucket. - Name *string `json:"name" validate:"required"` +// CreateLoadBalancerPoolMember : Create a member in a load balancer pool +// This request creates a new member and adds the member to the pool. +func (vpc *VpcV1) CreateLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + return vpc.CreateLoadBalancerPoolMemberWithContext(context.Background(), createLoadBalancerPoolMemberOptions) } -// UnmarshalCloudObjectStorageBucketReference unmarshals an instance of CloudObjectStorageBucketReference from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// CreateLoadBalancerPoolMemberWithContext is an alternate form of the CreateLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) CreateLoadBalancerPoolMemberWithContext(ctx context.Context, createLoadBalancerPoolMemberOptions *CreateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createLoadBalancerPoolMemberOptions, "createLoadBalancerPoolMemberOptions") if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// CreateDedicatedHostGroupOptions : The CreateDedicatedHostGroup options. -type CreateDedicatedHostGroupOptions struct { - // The dedicated host profile class for hosts in this group. - Class *string `json:"class,omitempty"` + pathParamsMap := map[string]string{ + "load_balancer_id": *createLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *createLoadBalancerPoolMemberOptions.PoolID, + } - // The dedicated host profile family for hosts in this group. - Family *string `json:"family,omitempty"` + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + if err != nil { + return + } - // The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` + for headerName, headerValue := range createLoadBalancerPoolMemberOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateLoadBalancerPoolMember") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") - // The zone this dedicated host group will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + body := make(map[string]interface{}) + if createLoadBalancerPoolMemberOptions.Port != nil { + body["port"] = createLoadBalancerPoolMemberOptions.Port + } + if createLoadBalancerPoolMemberOptions.Target != nil { + body["target"] = createLoadBalancerPoolMemberOptions.Target + } + if createLoadBalancerPoolMemberOptions.Weight != nil { + body["weight"] = createLoadBalancerPoolMemberOptions.Weight + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } -// Constants associated with the CreateDedicatedHostGroupOptions.Family property. -// The dedicated host profile family for hosts in this group. -const ( - CreateDedicatedHostGroupOptionsFamilyBalancedConst = "balanced" - CreateDedicatedHostGroupOptionsFamilyComputeConst = "compute" - CreateDedicatedHostGroupOptionsFamilyMemoryConst = "memory" -) + request, err := builder.Build() + if err != nil { + return + } -// NewCreateDedicatedHostGroupOptions : Instantiate CreateDedicatedHostGroupOptions -func (*VpcV1) NewCreateDedicatedHostGroupOptions() *CreateDedicatedHostGroupOptions { - return &CreateDedicatedHostGroupOptions{} -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + response.Result = result + } -// SetClass : Allow user to set Class -func (_options *CreateDedicatedHostGroupOptions) SetClass(class string) *CreateDedicatedHostGroupOptions { - _options.Class = core.StringPtr(class) - return _options + return } -// SetFamily : Allow user to set Family -func (_options *CreateDedicatedHostGroupOptions) SetFamily(family string) *CreateDedicatedHostGroupOptions { - _options.Family = core.StringPtr(family) - return _options +// ReplaceLoadBalancerPoolMembers : Replace load balancer pool members +// This request replaces the existing members of the load balancer pool with new members created from the collection of +// member prototype objects. +func (vpc *VpcV1) ReplaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + return vpc.ReplaceLoadBalancerPoolMembersWithContext(context.Background(), replaceLoadBalancerPoolMembersOptions) } -// SetName : Allow user to set Name -func (_options *CreateDedicatedHostGroupOptions) SetName(name string) *CreateDedicatedHostGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} +// ReplaceLoadBalancerPoolMembersWithContext is an alternate form of the ReplaceLoadBalancerPoolMembers method which supports a Context parameter +func (vpc *VpcV1) ReplaceLoadBalancerPoolMembersWithContext(ctx context.Context, replaceLoadBalancerPoolMembersOptions *ReplaceLoadBalancerPoolMembersOptions) (result *LoadBalancerPoolMemberCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(replaceLoadBalancerPoolMembersOptions, "replaceLoadBalancerPoolMembersOptions") + if err != nil { + return + } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateDedicatedHostGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateDedicatedHostGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} + pathParamsMap := map[string]string{ + "load_balancer_id": *replaceLoadBalancerPoolMembersOptions.LoadBalancerID, + "pool_id": *replaceLoadBalancerPoolMembersOptions.PoolID, + } -// SetZone : Allow user to set Zone -func (_options *CreateDedicatedHostGroupOptions) SetZone(zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { - _options.Zone = zone - return _options -} + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members`, pathParamsMap) + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *CreateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *CreateDedicatedHostGroupOptions { - options.Headers = param - return options -} + for headerName, headerValue := range replaceLoadBalancerPoolMembersOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// CreateDedicatedHostOptions : The CreateDedicatedHost options. -type CreateDedicatedHostOptions struct { - // The dedicated host prototype object. - DedicatedHostPrototype DedicatedHostPrototypeIntf `json:"DedicatedHostPrototype" validate:"required"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ReplaceLoadBalancerPoolMembers") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") - // Allows users to set headers on API requests - Headers map[string]string -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// NewCreateDedicatedHostOptions : Instantiate CreateDedicatedHostOptions -func (*VpcV1) NewCreateDedicatedHostOptions(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { - return &CreateDedicatedHostOptions{ - DedicatedHostPrototype: dedicatedHostPrototype, + body := make(map[string]interface{}) + if replaceLoadBalancerPoolMembersOptions.Members != nil { + body["members"] = replaceLoadBalancerPoolMembersOptions.Members + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return } -} -// SetDedicatedHostPrototype : Allow user to set DedicatedHostPrototype -func (_options *CreateDedicatedHostOptions) SetDedicatedHostPrototype(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { - _options.DedicatedHostPrototype = dedicatedHostPrototype - return _options -} + request, err := builder.Build() + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *CreateDedicatedHostOptions) SetHeaders(param map[string]string) *CreateDedicatedHostOptions { - options.Headers = param - return options + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMemberCollection) + if err != nil { + return + } + response.Result = result + } + + return } -// CreateEndpointGatewayOptions : The CreateEndpointGateway options. -type CreateEndpointGatewayOptions struct { - // The target for this endpoint gateway. - Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` +// DeleteLoadBalancerPoolMember : Delete a load balancer pool member +// This request deletes a member from the pool. This operation cannot be reversed. +func (vpc *VpcV1) DeleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteLoadBalancerPoolMemberWithContext(context.Background(), deleteLoadBalancerPoolMemberOptions) +} - // The VPC this endpoint gateway will serve. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` +// DeleteLoadBalancerPoolMemberWithContext is an alternate form of the DeleteLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) DeleteLoadBalancerPoolMemberWithContext(ctx context.Context, deleteLoadBalancerPoolMemberOptions *DeleteLoadBalancerPoolMemberOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteLoadBalancerPoolMemberOptions, "deleteLoadBalancerPoolMemberOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteLoadBalancerPoolMemberOptions, "deleteLoadBalancerPoolMemberOptions") + if err != nil { + return + } - // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. - Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` + pathParamsMap := map[string]string{ + "load_balancer_id": *deleteLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *deleteLoadBalancerPoolMemberOptions.PoolID, + "id": *deleteLoadBalancerPoolMemberOptions.ID, + } - // The user-defined name for this endpoint gateway. If unspecified, the name will be a hyphenated list of - // randomly-selected words. Names must be unique within the VPC this endpoint gateway is serving. - Name *string `json:"name,omitempty"` + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + if err != nil { + return + } - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + for headerName, headerValue := range deleteLoadBalancerPoolMemberOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The security groups to use for this endpoint gateway. If unspecified, the VPC's default security group is used. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteLoadBalancerPoolMember") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Allows users to set headers on API requests - Headers map[string]string -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// NewCreateEndpointGatewayOptions : Instantiate CreateEndpointGatewayOptions -func (*VpcV1) NewCreateEndpointGatewayOptions(target EndpointGatewayTargetPrototypeIntf, vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { - return &CreateEndpointGatewayOptions{ - Target: target, - VPC: vpc, + request, err := builder.Build() + if err != nil { + return } -} -// SetTarget : Allow user to set Target -func (_options *CreateEndpointGatewayOptions) SetTarget(target EndpointGatewayTargetPrototypeIntf) *CreateEndpointGatewayOptions { - _options.Target = target - return _options -} + response, err = vpc.Service.Request(request, nil) -// SetVPC : Allow user to set VPC -func (_options *CreateEndpointGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { - _options.VPC = vpc - return _options + return } -// SetIps : Allow user to set Ips -func (_options *CreateEndpointGatewayOptions) SetIps(ips []EndpointGatewayReservedIPIntf) *CreateEndpointGatewayOptions { - _options.Ips = ips - return _options +// GetLoadBalancerPoolMember : Retrieve a load balancer pool member +// This request retrieves a single member specified by the identifier in the URL path. +func (vpc *VpcV1) GetLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + return vpc.GetLoadBalancerPoolMemberWithContext(context.Background(), getLoadBalancerPoolMemberOptions) } -// SetName : Allow user to set Name -func (_options *CreateEndpointGatewayOptions) SetName(name string) *CreateEndpointGatewayOptions { - _options.Name = core.StringPtr(name) - return _options -} +// GetLoadBalancerPoolMemberWithContext is an alternate form of the GetLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) GetLoadBalancerPoolMemberWithContext(ctx context.Context, getLoadBalancerPoolMemberOptions *GetLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getLoadBalancerPoolMemberOptions, "getLoadBalancerPoolMemberOptions") + if err != nil { + return + } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateEndpointGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateEndpointGatewayOptions { - _options.ResourceGroup = resourceGroup - return _options -} + pathParamsMap := map[string]string{ + "load_balancer_id": *getLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *getLoadBalancerPoolMemberOptions.PoolID, + "id": *getLoadBalancerPoolMemberOptions.ID, + } -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateEndpointGatewayOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateEndpointGatewayOptions { - _options.SecurityGroups = securityGroups - return _options -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + if err != nil { + return + } -// SetHeaders : Allow user to set Headers -func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayOptions { - options.Headers = param - return options -} + for headerName, headerValue := range getLoadBalancerPoolMemberOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// CreateFloatingIPOptions : The CreateFloatingIP options. -type CreateFloatingIPOptions struct { - // The floating IP prototype object. - FloatingIPPrototype FloatingIPPrototypeIntf `json:"FloatingIPPrototype" validate:"required"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetLoadBalancerPoolMember") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // Allows users to set headers on API requests - Headers map[string]string -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// NewCreateFloatingIPOptions : Instantiate CreateFloatingIPOptions -func (*VpcV1) NewCreateFloatingIPOptions(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { - return &CreateFloatingIPOptions{ - FloatingIPPrototype: floatingIPPrototype, + request, err := builder.Build() + if err != nil { + return } -} -// SetFloatingIPPrototype : Allow user to set FloatingIPPrototype -func (_options *CreateFloatingIPOptions) SetFloatingIPPrototype(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { - _options.FloatingIPPrototype = floatingIPPrototype - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + response.Result = result + } -// SetHeaders : Allow user to set Headers -func (options *CreateFloatingIPOptions) SetHeaders(param map[string]string) *CreateFloatingIPOptions { - options.Headers = param - return options + return } -// CreateFlowLogCollectorOptions : The CreateFlowLogCollector options. -type CreateFlowLogCollectorOptions struct { - // The Cloud Object Storage bucket where the collected flows will be logged. - // The bucket must exist and an IAM service authorization must grant - // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer - // access to the bucket. - StorageBucket CloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` - - // The target this collector will collect flow logs for. If the target is an instance, - // subnet, or VPC, flow logs will not be collected for any network interfaces within the - // target that are themselves the target of a more specific flow log collector. - Target FlowLogCollectorTargetPrototypeIntf `json:"target" validate:"required"` +// UpdateLoadBalancerPoolMember : Update a load balancer pool member +// This request updates an existing member from a member patch. +func (vpc *VpcV1) UpdateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + return vpc.UpdateLoadBalancerPoolMemberWithContext(context.Background(), updateLoadBalancerPoolMemberOptions) +} - // Indicates whether this collector will be active upon creation. - Active *bool `json:"active,omitempty"` +// UpdateLoadBalancerPoolMemberWithContext is an alternate form of the UpdateLoadBalancerPoolMember method which supports a Context parameter +func (vpc *VpcV1) UpdateLoadBalancerPoolMemberWithContext(ctx context.Context, updateLoadBalancerPoolMemberOptions *UpdateLoadBalancerPoolMemberOptions) (result *LoadBalancerPoolMember, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateLoadBalancerPoolMemberOptions, "updateLoadBalancerPoolMemberOptions") + if err != nil { + return + } - // The unique user-defined name for this flow log collector. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` + pathParamsMap := map[string]string{ + "load_balancer_id": *updateLoadBalancerPoolMemberOptions.LoadBalancerID, + "pool_id": *updateLoadBalancerPoolMemberOptions.PoolID, + "id": *updateLoadBalancerPoolMemberOptions.ID, + } - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}`, pathParamsMap) + if err != nil { + return + } - // Allows users to set headers on API requests - Headers map[string]string -} + for headerName, headerValue := range updateLoadBalancerPoolMemberOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// NewCreateFlowLogCollectorOptions : Instantiate CreateFlowLogCollectorOptions -func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket CloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { - return &CreateFlowLogCollectorOptions{ - StorageBucket: storageBucket, - Target: target, + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateLoadBalancerPoolMember") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } -} + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") -// SetStorageBucket : Allow user to set StorageBucket -func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket CloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { - _options.StorageBucket = storageBucket - return _options -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// SetTarget : Allow user to set Target -func (_options *CreateFlowLogCollectorOptions) SetTarget(target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { - _options.Target = target - return _options -} + _, err = builder.SetBodyContentJSON(updateLoadBalancerPoolMemberOptions.LoadBalancerPoolMemberPatch) + if err != nil { + return + } -// SetActive : Allow user to set Active -func (_options *CreateFlowLogCollectorOptions) SetActive(active bool) *CreateFlowLogCollectorOptions { - _options.Active = core.BoolPtr(active) - return _options -} + request, err := builder.Build() + if err != nil { + return + } -// SetName : Allow user to set Name -func (_options *CreateFlowLogCollectorOptions) SetName(name string) *CreateFlowLogCollectorOptions { - _options.Name = core.StringPtr(name) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalLoadBalancerPoolMember) + if err != nil { + return + } + response.Result = result + } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateFlowLogCollectorOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateFlowLogCollectorOptions { - _options.ResourceGroup = resourceGroup - return _options + return } -// SetHeaders : Allow user to set Headers -func (options *CreateFlowLogCollectorOptions) SetHeaders(param map[string]string) *CreateFlowLogCollectorOptions { - options.Headers = param - return options +// ListEndpointGateways : List all endpoint gateways +// This request lists all endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to +// a target outside the VPC. +func (vpc *VpcV1) ListEndpointGateways(listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { + return vpc.ListEndpointGatewaysWithContext(context.Background(), listEndpointGatewaysOptions) } -// CreateIkePolicyOptions : The CreateIkePolicy options. -type CreateIkePolicyOptions struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group" validate:"required"` - - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` +// ListEndpointGatewaysWithContext is an alternate form of the ListEndpointGateways method which supports a Context parameter +func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpointGatewaysOptions *ListEndpointGatewaysOptions) (result *EndpointGatewayCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listEndpointGatewaysOptions, "listEndpointGatewaysOptions") + if err != nil { + return + } - // The user-defined name for this IKE policy. - Name *string `json:"name,omitempty"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + if err != nil { + return + } - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + for headerName, headerValue := range listEndpointGatewaysOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // Allows users to set headers on API requests - Headers map[string]string -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGateways") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") -// Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - CreateIkePolicyOptionsAuthenticationAlgorithmMd5Const = "md5" - CreateIkePolicyOptionsAuthenticationAlgorithmSha1Const = "sha1" - CreateIkePolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" - CreateIkePolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" -) + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listEndpointGatewaysOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listEndpointGatewaysOptions.Name)) + } + if listEndpointGatewaysOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listEndpointGatewaysOptions.Start)) + } + if listEndpointGatewaysOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewaysOptions.Limit)) + } + if listEndpointGatewaysOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listEndpointGatewaysOptions.ResourceGroupID)) + } -// Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - CreateIkePolicyOptionsEncryptionAlgorithmAes128Const = "aes128" - CreateIkePolicyOptionsEncryptionAlgorithmAes256Const = "aes256" - CreateIkePolicyOptionsEncryptionAlgorithmTripleDesConst = "triple_des" -) + request, err := builder.Build() + if err != nil { + return + } -// NewCreateIkePolicyOptions : Instantiate CreateIkePolicyOptions -func (*VpcV1) NewCreateIkePolicyOptions(authenticationAlgorithm string, dhGroup int64, encryptionAlgorithm string, ikeVersion int64) *CreateIkePolicyOptions { - return &CreateIkePolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - DhGroup: core.Int64Ptr(dhGroup), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - IkeVersion: core.Int64Ptr(ikeVersion), + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayCollection) + if err != nil { + return + } + response.Result = result } -} -// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm -func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIkePolicyOptions { - _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) - return _options + return } -// SetDhGroup : Allow user to set DhGroup -func (_options *CreateIkePolicyOptions) SetDhGroup(dhGroup int64) *CreateIkePolicyOptions { - _options.DhGroup = core.Int64Ptr(dhGroup) - return _options +// CreateEndpointGateway : Create an endpoint gateway +// This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target +// outside the VPC. +func (vpc *VpcV1) CreateEndpointGateway(createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + return vpc.CreateEndpointGatewayWithContext(context.Background(), createEndpointGatewayOptions) } -// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm -func (_options *CreateIkePolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIkePolicyOptions { - _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) - return _options -} - -// SetIkeVersion : Allow user to set IkeVersion -func (_options *CreateIkePolicyOptions) SetIkeVersion(ikeVersion int64) *CreateIkePolicyOptions { - _options.IkeVersion = core.Int64Ptr(ikeVersion) - return _options -} +// CreateEndpointGatewayWithContext is an alternate form of the CreateEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEndpointGatewayOptions *CreateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createEndpointGatewayOptions, "createEndpointGatewayOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createEndpointGatewayOptions, "createEndpointGatewayOptions") + if err != nil { + return + } -// SetKeyLifetime : Allow user to set KeyLifetime -func (_options *CreateIkePolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIkePolicyOptions { - _options.KeyLifetime = core.Int64Ptr(keyLifetime) - return _options -} + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways`, nil) + if err != nil { + return + } -// SetName : Allow user to set Name -func (_options *CreateIkePolicyOptions) SetName(name string) *CreateIkePolicyOptions { - _options.Name = core.StringPtr(name) - return _options -} + for headerName, headerValue := range createEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateIkePolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIkePolicyOptions { - _options.ResourceGroup = resourceGroup - return _options -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") -// SetHeaders : Allow user to set Headers -func (options *CreateIkePolicyOptions) SetHeaders(param map[string]string) *CreateIkePolicyOptions { - options.Headers = param - return options -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// CreateImageOptions : The CreateImage options. -type CreateImageOptions struct { - // The image prototype object. - ImagePrototype ImagePrototypeIntf `json:"ImagePrototype" validate:"required"` + body := make(map[string]interface{}) + if createEndpointGatewayOptions.Target != nil { + body["target"] = createEndpointGatewayOptions.Target + } + if createEndpointGatewayOptions.VPC != nil { + body["vpc"] = createEndpointGatewayOptions.VPC + } + if createEndpointGatewayOptions.Ips != nil { + body["ips"] = createEndpointGatewayOptions.Ips + } + if createEndpointGatewayOptions.Name != nil { + body["name"] = createEndpointGatewayOptions.Name + } + if createEndpointGatewayOptions.ResourceGroup != nil { + body["resource_group"] = createEndpointGatewayOptions.ResourceGroup + } + if createEndpointGatewayOptions.SecurityGroups != nil { + body["security_groups"] = createEndpointGatewayOptions.SecurityGroups + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } - // Allows users to set headers on API requests - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + return + } -// NewCreateImageOptions : Instantiate CreateImageOptions -func (*VpcV1) NewCreateImageOptions(imagePrototype ImagePrototypeIntf) *CreateImageOptions { - return &CreateImageOptions{ - ImagePrototype: imagePrototype, + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + if err != nil { + return + } + response.Result = result } -} -// SetImagePrototype : Allow user to set ImagePrototype -func (_options *CreateImageOptions) SetImagePrototype(imagePrototype ImagePrototypeIntf) *CreateImageOptions { - _options.ImagePrototype = imagePrototype - return _options + return } -// SetHeaders : Allow user to set Headers -func (options *CreateImageOptions) SetHeaders(param map[string]string) *CreateImageOptions { - options.Headers = param - return options +// ListEndpointGatewayIps : List all reserved IPs bound to an endpoint gateway +// This request lists all reserved IPs bound to an endpoint gateway. +func (vpc *VpcV1) ListEndpointGatewayIps(listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { + return vpc.ListEndpointGatewayIpsWithContext(context.Background(), listEndpointGatewayIpsOptions) } -// CreateInstanceActionOptions : The CreateInstanceAction options. -type CreateInstanceActionOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// ListEndpointGatewayIpsWithContext is an alternate form of the ListEndpointGatewayIps method which supports a Context parameter +func (vpc *VpcV1) ListEndpointGatewayIpsWithContext(ctx context.Context, listEndpointGatewayIpsOptions *ListEndpointGatewayIpsOptions) (result *ReservedIPCollectionEndpointGatewayContext, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(listEndpointGatewayIpsOptions, "listEndpointGatewayIpsOptions") + if err != nil { + return + } - // The type of action. - Type *string `json:"type" validate:"required"` + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *listEndpointGatewayIpsOptions.EndpointGatewayID, + } - // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - Force *bool `json:"force,omitempty"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips`, pathParamsMap) + if err != nil { + return + } - // Allows users to set headers on API requests - Headers map[string]string -} + for headerName, headerValue := range listEndpointGatewayIpsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// Constants associated with the CreateInstanceActionOptions.Type property. -// The type of action. -const ( - CreateInstanceActionOptionsTypeRebootConst = "reboot" - CreateInstanceActionOptionsTypeStartConst = "start" - CreateInstanceActionOptionsTypeStopConst = "stop" -) + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayIps") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") -// NewCreateInstanceActionOptions : Instantiate CreateInstanceActionOptions -func (*VpcV1) NewCreateInstanceActionOptions(instanceID string, typeVar string) *CreateInstanceActionOptions { - return &CreateInstanceActionOptions{ - InstanceID: core.StringPtr(instanceID), - Type: core.StringPtr(typeVar), + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listEndpointGatewayIpsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayIpsOptions.Start)) + } + if listEndpointGatewayIpsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayIpsOptions.Limit)) + } + if listEndpointGatewayIpsOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listEndpointGatewayIpsOptions.Sort)) } -} -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceActionOptions) SetInstanceID(instanceID string) *CreateInstanceActionOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} + request, err := builder.Build() + if err != nil { + return + } -// SetType : Allow user to set Type -func (_options *CreateInstanceActionOptions) SetType(typeVar string) *CreateInstanceActionOptions { - _options.Type = core.StringPtr(typeVar) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIPCollectionEndpointGatewayContext) + if err != nil { + return + } + response.Result = result + } -// SetForce : Allow user to set Force -func (_options *CreateInstanceActionOptions) SetForce(force bool) *CreateInstanceActionOptions { - _options.Force = core.BoolPtr(force) - return _options + return } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceActionOptions) SetHeaders(param map[string]string) *CreateInstanceActionOptions { - options.Headers = param - return options +// RemoveEndpointGatewayIP : Unbind a reserved IP from an endpoint gateway +// This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has +// `auto_delete` set to `true`, the reserved IP will be deleted. +func (vpc *VpcV1) RemoveEndpointGatewayIP(removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { + return vpc.RemoveEndpointGatewayIPWithContext(context.Background(), removeEndpointGatewayIPOptions) } -// CreateInstanceConsoleAccessTokenOptions : The CreateInstanceConsoleAccessToken options. -type CreateInstanceConsoleAccessTokenOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` +// RemoveEndpointGatewayIPWithContext is an alternate form of the RemoveEndpointGatewayIP method which supports a Context parameter +func (vpc *VpcV1) RemoveEndpointGatewayIPWithContext(ctx context.Context, removeEndpointGatewayIPOptions *RemoveEndpointGatewayIPOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(removeEndpointGatewayIPOptions, "removeEndpointGatewayIPOptions") + if err != nil { + return + } - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force,omitempty"` + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *removeEndpointGatewayIPOptions.EndpointGatewayID, + "id": *removeEndpointGatewayIPOptions.ID, + } - // Allows users to set headers on API requests - Headers map[string]string -} + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + if err != nil { + return + } -// Constants associated with the CreateInstanceConsoleAccessTokenOptions.ConsoleType property. -// The instance console type for which this token may be used. -const ( - CreateInstanceConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" - CreateInstanceConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" -) + for headerName, headerValue := range removeEndpointGatewayIPOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// NewCreateInstanceConsoleAccessTokenOptions : Instantiate CreateInstanceConsoleAccessTokenOptions -func (*VpcV1) NewCreateInstanceConsoleAccessTokenOptions(instanceID string, consoleType string) *CreateInstanceConsoleAccessTokenOptions { - return &CreateInstanceConsoleAccessTokenOptions{ - InstanceID: core.StringPtr(instanceID), - ConsoleType: core.StringPtr(consoleType), + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveEndpointGatewayIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } -} -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceConsoleAccessTokenOptions) SetInstanceID(instanceID string) *CreateInstanceConsoleAccessTokenOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// SetConsoleType : Allow user to set ConsoleType -func (_options *CreateInstanceConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateInstanceConsoleAccessTokenOptions { - _options.ConsoleType = core.StringPtr(consoleType) - return _options -} + request, err := builder.Build() + if err != nil { + return + } -// SetForce : Allow user to set Force -func (_options *CreateInstanceConsoleAccessTokenOptions) SetForce(force bool) *CreateInstanceConsoleAccessTokenOptions { - _options.Force = core.BoolPtr(force) - return _options + response, err = vpc.Service.Request(request, nil) + + return } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateInstanceConsoleAccessTokenOptions { - options.Headers = param - return options +// GetEndpointGatewayIP : Retrieve a reserved IP bound to an endpoint gateway +// This request a retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the +// URL. +func (vpc *VpcV1) GetEndpointGatewayIP(getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.GetEndpointGatewayIPWithContext(context.Background(), getEndpointGatewayIPOptions) } -// CreateInstanceGroupManagerActionOptions : The CreateInstanceGroupManagerAction options. -type CreateInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// GetEndpointGatewayIPWithContext is an alternate form of the GetEndpointGatewayIP method which supports a Context parameter +func (vpc *VpcV1) GetEndpointGatewayIPWithContext(ctx context.Context, getEndpointGatewayIPOptions *GetEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getEndpointGatewayIPOptions, "getEndpointGatewayIPOptions") + if err != nil { + return + } - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *getEndpointGatewayIPOptions.EndpointGatewayID, + "id": *getEndpointGatewayIPOptions.ID, + } - // The instance group manager action prototype object. - InstanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf `json:"InstanceGroupManagerActionPrototype" validate:"required"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + if err != nil { + return + } - // Allows users to set headers on API requests - Headers map[string]string -} + for headerName, headerValue := range getEndpointGatewayIPOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// NewCreateInstanceGroupManagerActionOptions : Instantiate CreateInstanceGroupManagerActionOptions -func (*VpcV1) NewCreateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { - return &CreateInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - InstanceGroupManagerActionPrototype: instanceGroupManagerActionPrototype, + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } -} + builder.AddHeader("Accept", "application/json") -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} + request, err := builder.Build() + if err != nil { + return + } -// SetInstanceGroupManagerActionPrototype : Allow user to set InstanceGroupManagerActionPrototype -func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPrototype(instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototype - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + if err != nil { + return + } + response.Result = result + } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerActionOptions { - options.Headers = param - return options + return } -// CreateInstanceGroupManagerOptions : The CreateInstanceGroupManager options. -type CreateInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager prototype object. - InstanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf `json:"InstanceGroupManagerPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// AddEndpointGatewayIP : Bind a reserved IP to an endpoint gateway +// This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: +// +// - must currently be unbound +// - must not be in the same zone as any other reserved IP bound to the endpoint gateway. +func (vpc *VpcV1) AddEndpointGatewayIP(addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + return vpc.AddEndpointGatewayIPWithContext(context.Background(), addEndpointGatewayIPOptions) } -// NewCreateInstanceGroupManagerOptions : Instantiate CreateInstanceGroupManagerOptions -func (*VpcV1) NewCreateInstanceGroupManagerOptions(instanceGroupID string, instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { - return &CreateInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerPrototype: instanceGroupManagerPrototype, +// AddEndpointGatewayIPWithContext is an alternate form of the AddEndpointGatewayIP method which supports a Context parameter +func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpointGatewayIPOptions *AddEndpointGatewayIPOptions) (result *ReservedIP, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(addEndpointGatewayIPOptions, "addEndpointGatewayIPOptions") + if err != nil { + return } -} - -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} -// SetInstanceGroupManagerPrototype : Allow user to set InstanceGroupManagerPrototype -func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupManagerPrototype(instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { - _options.InstanceGroupManagerPrototype = instanceGroupManagerPrototype - return _options -} + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *addEndpointGatewayIPOptions.EndpointGatewayID, + "id": *addEndpointGatewayIPOptions.ID, + } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerOptions { - options.Headers = param - return options -} + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/ips/{id}`, pathParamsMap) + if err != nil { + return + } -// CreateInstanceGroupManagerPolicyOptions : The CreateInstanceGroupManagerPolicy options. -type CreateInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + for headerName, headerValue := range addEndpointGatewayIPOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddEndpointGatewayIP") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // The instance group manager policy prototype object. - InstanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf `json:"InstanceGroupManagerPolicyPrototype" validate:"required"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + return + } -// NewCreateInstanceGroupManagerPolicyOptions : Instantiate CreateInstanceGroupManagerPolicyOptions -func (*VpcV1) NewCreateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { - return &CreateInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - InstanceGroupManagerPolicyPrototype: instanceGroupManagerPolicyPrototype, + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservedIP) + if err != nil { + return + } + response.Result = result } -} -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options + return } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +// DeleteEndpointGateway : Delete an endpoint gateway +// This request deletes an endpoint gateway. This operation cannot be reversed. +// +// Reserved IPs that were bound to the endpoint gateway will be released if their +// `auto_delete` property is set to true. +func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) } -// SetInstanceGroupManagerPolicyPrototype : Allow user to set InstanceGroupManagerPolicyPrototype -func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerPolicyOptions { - options.Headers = param - return options -} +// DeleteEndpointGatewayWithContext is an alternate form of the DeleteEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) DeleteEndpointGatewayWithContext(ctx context.Context, deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteEndpointGatewayOptions, "deleteEndpointGatewayOptions") + if err != nil { + return + } -// CreateInstanceGroupOptions : The CreateInstanceGroup options. -type CreateInstanceGroupOptions struct { - // Identifies an instance template by a unique property. - InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template" validate:"required"` + pathParamsMap := map[string]string{ + "id": *deleteEndpointGatewayOptions.ID, + } - // The subnets to use when creating new instances. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + if err != nil { + return + } - // Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the - // port for the load balancer pool member. - ApplicationPort *int64 `json:"application_port,omitempty"` + for headerName, headerValue := range deleteEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The load balancer that the load balancer pool used by this group - // is in. Required when using a load balancer pool. - LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // If specified, the load balancer pool will be managed by this - // group. Instances created by this group will have a new load - // balancer pool member in that pool created. Must be used with - // `application_port`. - LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count,omitempty"` + request, err := builder.Build() + if err != nil { + return + } - // The user-defined name for this instance group. - Name *string `json:"name,omitempty"` + response, err = vpc.Service.Request(request, nil) - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + return +} - // Allows users to set headers on API requests - Headers map[string]string +// GetEndpointGateway : Retrieve an endpoint gateway +// This request retrieves a single endpoint gateway specified by the identifier in the URL. +func (vpc *VpcV1) GetEndpointGateway(getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + return vpc.GetEndpointGatewayWithContext(context.Background(), getEndpointGatewayOptions) } -// NewCreateInstanceGroupOptions : Instantiate CreateInstanceGroupOptions -func (*VpcV1) NewCreateInstanceGroupOptions(instanceTemplate InstanceTemplateIdentityIntf, subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { - return &CreateInstanceGroupOptions{ - InstanceTemplate: instanceTemplate, - Subnets: subnets, +// GetEndpointGatewayWithContext is an alternate form of the GetEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) GetEndpointGatewayWithContext(ctx context.Context, getEndpointGatewayOptions *GetEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEndpointGatewayOptions, "getEndpointGatewayOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getEndpointGatewayOptions, "getEndpointGatewayOptions") + if err != nil { + return } -} -// SetInstanceTemplate : Allow user to set InstanceTemplate -func (_options *CreateInstanceGroupOptions) SetInstanceTemplate(instanceTemplate InstanceTemplateIdentityIntf) *CreateInstanceGroupOptions { - _options.InstanceTemplate = instanceTemplate - return _options -} + pathParamsMap := map[string]string{ + "id": *getEndpointGatewayOptions.ID, + } -// SetSubnets : Allow user to set Subnets -func (_options *CreateInstanceGroupOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { - _options.Subnets = subnets - return _options -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + if err != nil { + return + } -// SetApplicationPort : Allow user to set ApplicationPort -func (_options *CreateInstanceGroupOptions) SetApplicationPort(applicationPort int64) *CreateInstanceGroupOptions { - _options.ApplicationPort = core.Int64Ptr(applicationPort) - return _options -} + for headerName, headerValue := range getEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// SetLoadBalancer : Allow user to set LoadBalancer -func (_options *CreateInstanceGroupOptions) SetLoadBalancer(loadBalancer LoadBalancerIdentityIntf) *CreateInstanceGroupOptions { - _options.LoadBalancer = loadBalancer - return _options -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") -// SetLoadBalancerPool : Allow user to set LoadBalancerPool -func (_options *CreateInstanceGroupOptions) SetLoadBalancerPool(loadBalancerPool LoadBalancerPoolIdentityIntf) *CreateInstanceGroupOptions { - _options.LoadBalancerPool = loadBalancerPool - return _options -} + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) -// SetMembershipCount : Allow user to set MembershipCount -func (_options *CreateInstanceGroupOptions) SetMembershipCount(membershipCount int64) *CreateInstanceGroupOptions { - _options.MembershipCount = core.Int64Ptr(membershipCount) - return _options -} + request, err := builder.Build() + if err != nil { + return + } -// SetName : Allow user to set Name -func (_options *CreateInstanceGroupOptions) SetName(name string) *CreateInstanceGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + if err != nil { + return + } + response.Result = result + } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateInstanceGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateInstanceGroupOptions { - _options.ResourceGroup = resourceGroup - return _options + return } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceGroupOptions) SetHeaders(param map[string]string) *CreateInstanceGroupOptions { - options.Headers = param - return options +// UpdateEndpointGateway : Update an endpoint gateway +// This request updates an endpoint gateway's name. +func (vpc *VpcV1) UpdateEndpointGateway(updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + return vpc.UpdateEndpointGatewayWithContext(context.Background(), updateEndpointGatewayOptions) } -// CreateInstanceNetworkInterfaceOptions : The CreateInstanceNetworkInterface options. -type CreateInstanceNetworkInterfaceOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// UpdateEndpointGatewayWithContext is an alternate form of the UpdateEndpointGateway method which supports a Context parameter +func (vpc *VpcV1) UpdateEndpointGatewayWithContext(ctx context.Context, updateEndpointGatewayOptions *UpdateEndpointGatewayOptions) (result *EndpointGateway, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateEndpointGatewayOptions, "updateEndpointGatewayOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateEndpointGatewayOptions, "updateEndpointGatewayOptions") + if err != nil { + return + } - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + pathParamsMap := map[string]string{ + "id": *updateEndpointGatewayOptions.ID, + } - // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this - // interface. If true, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{id}`, pathParamsMap) + if err != nil { + return + } - // The user-defined name for network interface. Names must be unique within the instance the network interface resides - // in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + for headerName, headerValue := range updateEndpointGatewayOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If - // unspecified, an available address on the subnet will be automatically selected. - PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGateway") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") - // Collection of security groups. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string -} + _, err = builder.SetBodyContentJSON(updateEndpointGatewayOptions.EndpointGatewayPatch) + if err != nil { + return + } -// NewCreateInstanceNetworkInterfaceOptions : Instantiate CreateInstanceNetworkInterfaceOptions -func (*VpcV1) NewCreateInstanceNetworkInterfaceOptions(instanceID string, subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - return &CreateInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - Subnet: subnet, + request, err := builder.Build() + if err != nil { + return } -} -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGateway) + if err != nil { + return + } + response.Result = result + } -// SetSubnet : Allow user to set Subnet -func (_options *CreateInstanceNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - _options.Subnet = subnet - return _options + return } -// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing -func (_options *CreateInstanceNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateInstanceNetworkInterfaceOptions { - _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) - return _options +// ListFlowLogCollectors : List all flow log collectors +// This request lists all flow log collectors in the region. A flow log collector summarizes data sent over one or more +// network interfaces within a VPC, depending on the chosen target. +func (vpc *VpcV1) ListFlowLogCollectors(listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { + return vpc.ListFlowLogCollectorsWithContext(context.Background(), listFlowLogCollectorsOptions) } -// SetName : Allow user to set Name -func (_options *CreateInstanceNetworkInterfaceOptions) SetName(name string) *CreateInstanceNetworkInterfaceOptions { - _options.Name = core.StringPtr(name) - return _options -} +// ListFlowLogCollectorsWithContext is an alternate form of the ListFlowLogCollectors method which supports a Context parameter +func (vpc *VpcV1) ListFlowLogCollectorsWithContext(ctx context.Context, listFlowLogCollectorsOptions *ListFlowLogCollectorsOptions) (result *FlowLogCollectorCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listFlowLogCollectorsOptions, "listFlowLogCollectorsOptions") + if err != nil { + return + } -// SetPrimaryIpv4Address : Allow user to set PrimaryIpv4Address -func (_options *CreateInstanceNetworkInterfaceOptions) SetPrimaryIpv4Address(primaryIpv4Address string) *CreateInstanceNetworkInterfaceOptions { - _options.PrimaryIpv4Address = core.StringPtr(primaryIpv4Address) - return _options -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) + if err != nil { + return + } -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateInstanceNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateInstanceNetworkInterfaceOptions { - _options.SecurityGroups = securityGroups - return _options -} + for headerName, headerValue := range listFlowLogCollectorsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkInterfaceOptions { - options.Headers = param - return options -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListFlowLogCollectors") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") -// CreateInstanceOptions : The CreateInstance options. -type CreateInstanceOptions struct { - // The instance prototype object. - InstancePrototype InstancePrototypeIntf `json:"InstancePrototype" validate:"required"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listFlowLogCollectorsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listFlowLogCollectorsOptions.Start)) + } + if listFlowLogCollectorsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listFlowLogCollectorsOptions.Limit)) + } + if listFlowLogCollectorsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listFlowLogCollectorsOptions.ResourceGroupID)) + } + if listFlowLogCollectorsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listFlowLogCollectorsOptions.Name)) + } + if listFlowLogCollectorsOptions.VPCID != nil { + builder.AddQuery("vpc.id", fmt.Sprint(*listFlowLogCollectorsOptions.VPCID)) + } + if listFlowLogCollectorsOptions.VPCCRN != nil { + builder.AddQuery("vpc.crn", fmt.Sprint(*listFlowLogCollectorsOptions.VPCCRN)) + } + if listFlowLogCollectorsOptions.VPCName != nil { + builder.AddQuery("vpc.name", fmt.Sprint(*listFlowLogCollectorsOptions.VPCName)) + } + if listFlowLogCollectorsOptions.TargetID != nil { + builder.AddQuery("target.id", fmt.Sprint(*listFlowLogCollectorsOptions.TargetID)) + } + if listFlowLogCollectorsOptions.TargetResourceType != nil { + builder.AddQuery("target.resource_type", fmt.Sprint(*listFlowLogCollectorsOptions.TargetResourceType)) + } - // Allows users to set headers on API requests - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + return + } -// NewCreateInstanceOptions : Instantiate CreateInstanceOptions -func (*VpcV1) NewCreateInstanceOptions(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { - return &CreateInstanceOptions{ - InstancePrototype: instancePrototype, + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollectorCollection) + if err != nil { + return + } + response.Result = result } -} -// SetInstancePrototype : Allow user to set InstancePrototype -func (_options *CreateInstanceOptions) SetInstancePrototype(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { - _options.InstancePrototype = instancePrototype - return _options + return } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceOptions) SetHeaders(param map[string]string) *CreateInstanceOptions { - options.Headers = param - return options +// CreateFlowLogCollector : Create a flow log collector +// This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype +// object is structured in the same way as a retrieved flow log collector, and contains the information necessary to +// create and start the new flow log collector. +func (vpc *VpcV1) CreateFlowLogCollector(createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + return vpc.CreateFlowLogCollectorWithContext(context.Background(), createFlowLogCollectorOptions) } -// CreateInstanceTemplateOptions : The CreateInstanceTemplate options. -type CreateInstanceTemplateOptions struct { - // The instance template prototype object. - InstanceTemplatePrototype InstanceTemplatePrototypeIntf `json:"InstanceTemplatePrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// CreateFlowLogCollectorWithContext is an alternate form of the CreateFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) CreateFlowLogCollectorWithContext(ctx context.Context, createFlowLogCollectorOptions *CreateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createFlowLogCollectorOptions, "createFlowLogCollectorOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createFlowLogCollectorOptions, "createFlowLogCollectorOptions") + if err != nil { + return + } -// NewCreateInstanceTemplateOptions : Instantiate CreateInstanceTemplateOptions -func (*VpcV1) NewCreateInstanceTemplateOptions(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { - return &CreateInstanceTemplateOptions{ - InstanceTemplatePrototype: instanceTemplatePrototype, + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors`, nil) + if err != nil { + return } -} -// SetInstanceTemplatePrototype : Allow user to set InstanceTemplatePrototype -func (_options *CreateInstanceTemplateOptions) SetInstanceTemplatePrototype(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { - _options.InstanceTemplatePrototype = instanceTemplatePrototype - return _options -} + for headerName, headerValue := range createFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceTemplateOptions) SetHeaders(param map[string]string) *CreateInstanceTemplateOptions { - options.Headers = param - return options -} + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") -// CreateInstanceVolumeAttachmentOptions : The CreateInstanceVolumeAttachment options. -type CreateInstanceVolumeAttachmentOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` + body := make(map[string]interface{}) + if createFlowLogCollectorOptions.StorageBucket != nil { + body["storage_bucket"] = createFlowLogCollectorOptions.StorageBucket + } + if createFlowLogCollectorOptions.Target != nil { + body["target"] = createFlowLogCollectorOptions.Target + } + if createFlowLogCollectorOptions.Active != nil { + body["active"] = createFlowLogCollectorOptions.Active + } + if createFlowLogCollectorOptions.Name != nil { + body["name"] = createFlowLogCollectorOptions.Name + } + if createFlowLogCollectorOptions.ResourceGroup != nil { + body["resource_group"] = createFlowLogCollectorOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + request, err := builder.Build() + if err != nil { + return + } - // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment - // resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + if err != nil { + return + } + response.Result = result + } - // Allows users to set headers on API requests - Headers map[string]string + return } -// NewCreateInstanceVolumeAttachmentOptions : Instantiate CreateInstanceVolumeAttachmentOptions -func (*VpcV1) NewCreateInstanceVolumeAttachmentOptions(instanceID string, volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { - return &CreateInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - Volume: volume, - } +// DeleteFlowLogCollector : Delete a flow log collector +// This request stops and deletes a flow log collector. This operation cannot be reversed. +// +// Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. +func (vpc *VpcV1) DeleteFlowLogCollector(deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { + return vpc.DeleteFlowLogCollectorWithContext(context.Background(), deleteFlowLogCollectorOptions) } -// SetInstanceID : Allow user to set InstanceID -func (_options *CreateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} +// DeleteFlowLogCollectorWithContext is an alternate form of the DeleteFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) DeleteFlowLogCollectorWithContext(ctx context.Context, deleteFlowLogCollectorOptions *DeleteFlowLogCollectorOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteFlowLogCollectorOptions, "deleteFlowLogCollectorOptions") + if err != nil { + return + } -// SetVolume : Allow user to set Volume -func (_options *CreateInstanceVolumeAttachmentOptions) SetVolume(volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { - _options.Volume = volume - return _options -} + pathParamsMap := map[string]string{ + "id": *deleteFlowLogCollectorOptions.ID, + } -// SetDeleteVolumeOnInstanceDelete : Allow user to set DeleteVolumeOnInstanceDelete -func (_options *CreateInstanceVolumeAttachmentOptions) SetDeleteVolumeOnInstanceDelete(deleteVolumeOnInstanceDelete bool) *CreateInstanceVolumeAttachmentOptions { - _options.DeleteVolumeOnInstanceDelete = core.BoolPtr(deleteVolumeOnInstanceDelete) - return _options -} + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + if err != nil { + return + } -// SetName : Allow user to set Name -func (_options *CreateInstanceVolumeAttachmentOptions) SetName(name string) *CreateInstanceVolumeAttachmentOptions { - _options.Name = core.StringPtr(name) - return _options + for headerName, headerValue := range deleteFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + response, err = vpc.Service.Request(request, nil) + + return } -// SetHeaders : Allow user to set Headers -func (options *CreateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceVolumeAttachmentOptions { - options.Headers = param - return options +// GetFlowLogCollector : Retrieve a flow log collector +// This request retrieves a single flow log collector specified by the identifier in the URL. +func (vpc *VpcV1) GetFlowLogCollector(getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + return vpc.GetFlowLogCollectorWithContext(context.Background(), getFlowLogCollectorOptions) } -// CreateIpsecPolicyOptions : The CreateIpsecPolicy options. -type CreateIpsecPolicyOptions struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` +// GetFlowLogCollectorWithContext is an alternate form of the GetFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) GetFlowLogCollectorWithContext(ctx context.Context, getFlowLogCollectorOptions *GetFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getFlowLogCollectorOptions, "getFlowLogCollectorOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getFlowLogCollectorOptions, "getFlowLogCollectorOptions") + if err != nil { + return + } - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + pathParamsMap := map[string]string{ + "id": *getFlowLogCollectorOptions.ID, + } - // Perfect Forward Secrecy. - Pfs *string `json:"pfs" validate:"required"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + if err != nil { + return + } - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` + for headerName, headerValue := range getFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // The user-defined name for this IPsec policy. - Name *string `json:"name,omitempty"` + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) - // Allows users to set headers on API requests - Headers map[string]string + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + if err != nil { + return + } + response.Result = result + } + + return } -// Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - CreateIpsecPolicyOptionsAuthenticationAlgorithmMd5Const = "md5" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha1Const = "sha1" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" - CreateIpsecPolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" -) +// UpdateFlowLogCollector : Update a flow log collector +// This request updates a flow log collector with the information in a provided flow log collector patch. The flow log +// collector patch object is structured in the same way as a retrieved flow log collector and contains only the +// information to be updated. +func (vpc *VpcV1) UpdateFlowLogCollector(updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + return vpc.UpdateFlowLogCollectorWithContext(context.Background(), updateFlowLogCollectorOptions) +} -// Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - CreateIpsecPolicyOptionsEncryptionAlgorithmAes128Const = "aes128" - CreateIpsecPolicyOptionsEncryptionAlgorithmAes256Const = "aes256" - CreateIpsecPolicyOptionsEncryptionAlgorithmTripleDesConst = "triple_des" -) +// UpdateFlowLogCollectorWithContext is an alternate form of the UpdateFlowLogCollector method which supports a Context parameter +func (vpc *VpcV1) UpdateFlowLogCollectorWithContext(ctx context.Context, updateFlowLogCollectorOptions *UpdateFlowLogCollectorOptions) (result *FlowLogCollector, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateFlowLogCollectorOptions, "updateFlowLogCollectorOptions") + if err != nil { + return + } -// Constants associated with the CreateIpsecPolicyOptions.Pfs property. -// Perfect Forward Secrecy. -const ( - CreateIpsecPolicyOptionsPfsDisabledConst = "disabled" - CreateIpsecPolicyOptionsPfsGroup14Const = "group_14" - CreateIpsecPolicyOptionsPfsGroup19Const = "group_19" - CreateIpsecPolicyOptionsPfsGroup2Const = "group_2" - CreateIpsecPolicyOptionsPfsGroup5Const = "group_5" -) + pathParamsMap := map[string]string{ + "id": *updateFlowLogCollectorOptions.ID, + } -// NewCreateIpsecPolicyOptions : Instantiate CreateIpsecPolicyOptions -func (*VpcV1) NewCreateIpsecPolicyOptions(authenticationAlgorithm string, encryptionAlgorithm string, pfs string) *CreateIpsecPolicyOptions { - return &CreateIpsecPolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - Pfs: core.StringPtr(pfs), + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/flow_log_collectors/{id}`, pathParamsMap) + if err != nil { + return } -} -// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm -func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIpsecPolicyOptions { - _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) - return _options + for headerName, headerValue := range updateFlowLogCollectorOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateFlowLogCollector") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + _, err = builder.SetBodyContentJSON(updateFlowLogCollectorOptions.FlowLogCollectorPatch) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalFlowLogCollector) + if err != nil { + return + } + response.Result = result + } + + return } -// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm -func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIpsecPolicyOptions { - _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) - return _options +// AddBareMetalServerNetworkInterfaceFloatingIPOptions : The AddBareMetalServerNetworkInterfaceFloatingIP options. +type AddBareMetalServerNetworkInterfaceFloatingIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// SetPfs : Allow user to set Pfs -func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { - _options.Pfs = core.StringPtr(pfs) - return _options +// NewAddBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate AddBareMetalServerNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewAddBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + return &AddBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } } -// SetKeyLifetime : Allow user to set KeyLifetime -func (_options *CreateIpsecPolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIpsecPolicyOptions { - _options.KeyLifetime = core.Int64Ptr(keyLifetime) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } -// SetName : Allow user to set Name -func (_options *CreateIpsecPolicyOptions) SetName(name string) *CreateIpsecPolicyOptions { - _options.Name = core.StringPtr(name) +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) return _options } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateIpsecPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIpsecPolicyOptions { - _options.ResourceGroup = resourceGroup +// SetID : Allow user to set ID +func (_options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateIpsecPolicyOptions) SetHeaders(param map[string]string) *CreateIpsecPolicyOptions { +func (options *AddBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddBareMetalServerNetworkInterfaceFloatingIPOptions { options.Headers = param return options } -// CreateKeyOptions : The CreateKey options. -type CreateKeyOptions struct { - // A unique public SSH key to import, in OpenSSH format (consisting of three space-separated fields: the algorithm - // name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is - // imported. - PublicKey *string `json:"public_key" validate:"required"` - - // The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected - // words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// AddEndpointGatewayIPOptions : The AddEndpointGatewayIP options. +type AddEndpointGatewayIPOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - // The crypto-system used by this key. - Type *string `json:"type,omitempty"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateKeyOptions.Type property. -// The crypto-system used by this key. -const ( - CreateKeyOptionsTypeRsaConst = "rsa" -) - -// NewCreateKeyOptions : Instantiate CreateKeyOptions -func (*VpcV1) NewCreateKeyOptions(publicKey string) *CreateKeyOptions { - return &CreateKeyOptions{ - PublicKey: core.StringPtr(publicKey), +// NewAddEndpointGatewayIPOptions : Instantiate AddEndpointGatewayIPOptions +func (*VpcV1) NewAddEndpointGatewayIPOptions(endpointGatewayID string, id string) *AddEndpointGatewayIPOptions { + return &AddEndpointGatewayIPOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), } } -// SetPublicKey : Allow user to set PublicKey -func (_options *CreateKeyOptions) SetPublicKey(publicKey string) *CreateKeyOptions { - _options.PublicKey = core.StringPtr(publicKey) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateKeyOptions) SetName(name string) *CreateKeyOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateKeyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateKeyOptions { - _options.ResourceGroup = resourceGroup +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *AddEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *AddEndpointGatewayIPOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) return _options } -// SetType : Allow user to set Type -func (_options *CreateKeyOptions) SetType(typeVar string) *CreateKeyOptions { - _options.Type = core.StringPtr(typeVar) +// SetID : Allow user to set ID +func (_options *AddEndpointGatewayIPOptions) SetID(id string) *AddEndpointGatewayIPOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateKeyOptions) SetHeaders(param map[string]string) *CreateKeyOptions { +func (options *AddEndpointGatewayIPOptions) SetHeaders(param map[string]string) *AddEndpointGatewayIPOptions { options.Headers = param return options } -// CreateLoadBalancerListenerOptions : The CreateLoadBalancerListener options. -type CreateLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// AddInstanceNetworkInterfaceFloatingIPOptions : The AddInstanceNetworkInterfaceFloatingIP options. +type AddInstanceNetworkInterfaceFloatingIPOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // Additional restrictions: - // - If this load balancer is in the `network` family, the protocol must be `tcp`. - // - If this listener has `https_redirect` specified, the protocol must be `http`. - // - If this listener is a listener's `https_redirect` target, the protocol must be `https`. - Protocol *string `json:"protocol" validate:"required"` + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The certificate instance used for SSL termination. It is applicable only to `https` - // protocol. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// NewAddInstanceNetworkInterfaceFloatingIPOptions : Instantiate AddInstanceNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewAddInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *AddInstanceNetworkInterfaceFloatingIPOptions { + return &AddInstanceNetworkInterfaceFloatingIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } +} - // The default pool associated with the listener. The specified pool must: - // - // - Belong to this load balancer - // - Have the same `protocol` as this listener - // - Not already be the default pool for another listener. - DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *AddInstanceNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} - // The policy prototype objects for this listener. - Policies []LoadBalancerListenerPolicyPrototype `json:"policies,omitempty"` +// SetID : Allow user to set ID +func (_options *AddInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *AddInstanceNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *AddInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *AddInstanceNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled support different values for `port_min` and - // `port_max`. When route mode is enabled, the value - // `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` +// AddSecurityGroupNetworkInterfaceOptions : The AddSecurityGroupNetworkInterface options. +type AddSecurityGroupNetworkInterfaceOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateLoadBalancerListenerOptions.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// Additional restrictions: -// - If this load balancer is in the `network` family, the protocol must be `tcp`. -// - If this listener has `https_redirect` specified, the protocol must be `http`. -// - If this listener is a listener's `https_redirect` target, the protocol must be `https`. -const ( - CreateLoadBalancerListenerOptionsProtocolHTTPConst = "http" - CreateLoadBalancerListenerOptionsProtocolHTTPSConst = "https" - CreateLoadBalancerListenerOptionsProtocolTCPConst = "tcp" -) - -// NewCreateLoadBalancerListenerOptions : Instantiate CreateLoadBalancerListenerOptions -func (*VpcV1) NewCreateLoadBalancerListenerOptions(loadBalancerID string, protocol string) *CreateLoadBalancerListenerOptions { - return &CreateLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - Protocol: core.StringPtr(protocol), +// NewAddSecurityGroupNetworkInterfaceOptions : Instantiate AddSecurityGroupNetworkInterfaceOptions +func (*VpcV1) NewAddSecurityGroupNetworkInterfaceOptions(securityGroupID string, id string) *AddSecurityGroupNetworkInterfaceOptions { + return &AddSecurityGroupNetworkInterfaceOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *AddSecurityGroupNetworkInterfaceOptions) SetSecurityGroupID(securityGroupID string) *AddSecurityGroupNetworkInterfaceOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) return _options } -// SetProtocol : Allow user to set Protocol -func (_options *CreateLoadBalancerListenerOptions) SetProtocol(protocol string) *CreateLoadBalancerListenerOptions { - _options.Protocol = core.StringPtr(protocol) +// SetID : Allow user to set ID +func (_options *AddSecurityGroupNetworkInterfaceOptions) SetID(id string) *AddSecurityGroupNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) return _options } -// SetAcceptProxyProtocol : Allow user to set AcceptProxyProtocol -func (_options *CreateLoadBalancerListenerOptions) SetAcceptProxyProtocol(acceptProxyProtocol bool) *CreateLoadBalancerListenerOptions { - _options.AcceptProxyProtocol = core.BoolPtr(acceptProxyProtocol) - return _options +// SetHeaders : Allow user to set Headers +func (options *AddSecurityGroupNetworkInterfaceOptions) SetHeaders(param map[string]string) *AddSecurityGroupNetworkInterfaceOptions { + options.Headers = param + return options } -// SetCertificateInstance : Allow user to set CertificateInstance -func (_options *CreateLoadBalancerListenerOptions) SetCertificateInstance(certificateInstance CertificateInstanceIdentityIntf) *CreateLoadBalancerListenerOptions { - _options.CertificateInstance = certificateInstance - return _options -} +// AddVPNGatewayConnectionLocalCIDROptions : The AddVPNGatewayConnectionLocalCIDR options. +type AddVPNGatewayConnectionLocalCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` -// SetConnectionLimit : Allow user to set ConnectionLimit -func (_options *CreateLoadBalancerListenerOptions) SetConnectionLimit(connectionLimit int64) *CreateLoadBalancerListenerOptions { - _options.ConnectionLimit = core.Int64Ptr(connectionLimit) - return _options -} + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` -// SetDefaultPool : Allow user to set DefaultPool -func (_options *CreateLoadBalancerListenerOptions) SetDefaultPool(defaultPool LoadBalancerPoolIdentityIntf) *CreateLoadBalancerListenerOptions { - _options.DefaultPool = defaultPool - return _options + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// SetHTTPSRedirect : Allow user to set HTTPSRedirect -func (_options *CreateLoadBalancerListenerOptions) SetHTTPSRedirect(httpsRedirect *LoadBalancerListenerHTTPSRedirectPrototype) *CreateLoadBalancerListenerOptions { - _options.HTTPSRedirect = httpsRedirect - return _options +// NewAddVPNGatewayConnectionLocalCIDROptions : Instantiate AddVPNGatewayConnectionLocalCIDROptions +func (*VpcV1) NewAddVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { + return &AddVPNGatewayConnectionLocalCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), + } } -// SetPolicies : Allow user to set Policies -func (_options *CreateLoadBalancerListenerOptions) SetPolicies(policies []LoadBalancerListenerPolicyPrototype) *CreateLoadBalancerListenerOptions { - _options.Policies = policies +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetPort : Allow user to set Port -func (_options *CreateLoadBalancerListenerOptions) SetPort(port int64) *CreateLoadBalancerListenerOptions { - _options.Port = core.Int64Ptr(port) +// SetID : Allow user to set ID +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetID(id string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.ID = core.StringPtr(id) return _options } -// SetPortMax : Allow user to set PortMax -func (_options *CreateLoadBalancerListenerOptions) SetPortMax(portMax int64) *CreateLoadBalancerListenerOptions { - _options.PortMax = core.Int64Ptr(portMax) +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) return _options } -// SetPortMin : Allow user to set PortMin -func (_options *CreateLoadBalancerListenerOptions) SetPortMin(portMin int64) *CreateLoadBalancerListenerOptions { - _options.PortMin = core.Int64Ptr(portMin) +// SetPrefixLength : Allow user to set PrefixLength +func (_options *AddVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionLocalCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerOptions { +func (options *AddVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionLocalCIDROptions { options.Headers = param return options } -// CreateLoadBalancerListenerPolicyOptions : The CreateLoadBalancerListenerPolicy options. -type CreateLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` - - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` +// AddVPNGatewayConnectionPeerCIDROptions : The AddVPNGatewayConnectionPeerCIDR options. +type AddVPNGatewayConnectionPeerCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. - Name *string `json:"name,omitempty"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // The rule prototype objects for this policy. - Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// Constants associated with the CreateLoadBalancerListenerPolicyOptions.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. -const ( - CreateLoadBalancerListenerPolicyOptionsActionForwardConst = "forward" - CreateLoadBalancerListenerPolicyOptionsActionHTTPSRedirectConst = "https_redirect" - CreateLoadBalancerListenerPolicyOptionsActionRedirectConst = "redirect" - CreateLoadBalancerListenerPolicyOptionsActionRejectConst = "reject" -) - -// NewCreateLoadBalancerListenerPolicyOptions : Instantiate CreateLoadBalancerListenerPolicyOptions -func (*VpcV1) NewCreateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, action string, priority int64) *CreateLoadBalancerListenerPolicyOptions { - return &CreateLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - Action: core.StringPtr(action), - Priority: core.Int64Ptr(priority), +// NewAddVPNGatewayConnectionPeerCIDROptions : Instantiate AddVPNGatewayConnectionPeerCIDROptions +func (*VpcV1) NewAddVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { + return &AddVPNGatewayConnectionPeerCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *CreateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateLoadBalancerListenerPolicyOptions) SetAction(action string) *CreateLoadBalancerListenerPolicyOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetPriority : Allow user to set Priority -func (_options *CreateLoadBalancerListenerPolicyOptions) SetPriority(priority int64) *CreateLoadBalancerListenerPolicyOptions { - _options.Priority = core.Int64Ptr(priority) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerListenerPolicyOptions) SetName(name string) *CreateLoadBalancerListenerPolicyOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetID(id string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.ID = core.StringPtr(id) return _options } -// SetRules : Allow user to set Rules -func (_options *CreateLoadBalancerListenerPolicyOptions) SetRules(rules []LoadBalancerListenerPolicyRulePrototype) *CreateLoadBalancerListenerPolicyOptions { - _options.Rules = rules +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) return _options } -// SetTarget : Allow user to set Target -func (_options *CreateLoadBalancerListenerPolicyOptions) SetTarget(target LoadBalancerListenerPolicyTargetPrototypeIntf) *CreateLoadBalancerListenerPolicyOptions { - _options.Target = target +// SetPrefixLength : Allow user to set PrefixLength +func (_options *AddVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *AddVPNGatewayConnectionPeerCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyOptions { +func (options *AddVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayConnectionPeerCIDROptions { options.Headers = param return options } -// CreateLoadBalancerListenerPolicyRuleOptions : The CreateLoadBalancerListenerPolicyRule options. -type CreateLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// AddressPrefix : AddressPrefix struct +type AddressPrefix struct { + // The CIDR block for this prefix. + CIDR *string `json:"cidr" validate:"required"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The date and time that the prefix was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // Indicates whether subnets exist with addresses from this prefix. + HasSubnets *bool `json:"has_subnets" validate:"required"` - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` + // The URL for this address prefix. + Href *string `json:"href" validate:"required"` - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` + // The unique identifier for this address prefix. + ID *string `json:"id" validate:"required"` - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` + // Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically + // created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected + // words, but may be updated with a user-specified name. + IsDefault *bool `json:"is_default" validate:"required"` - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` + // The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The zone this address prefix resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Condition property. -// The condition of the rule. -const ( - CreateLoadBalancerListenerPolicyRuleOptionsConditionContainsConst = "contains" - CreateLoadBalancerListenerPolicyRuleOptionsConditionEqualsConst = "equals" - CreateLoadBalancerListenerPolicyRuleOptionsConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - CreateLoadBalancerListenerPolicyRuleOptionsTypeBodyConst = "body" - CreateLoadBalancerListenerPolicyRuleOptionsTypeHeaderConst = "header" - CreateLoadBalancerListenerPolicyRuleOptionsTypeHostnameConst = "hostname" - CreateLoadBalancerListenerPolicyRuleOptionsTypePathConst = "path" - CreateLoadBalancerListenerPolicyRuleOptionsTypeQueryConst = "query" -) - -// NewCreateLoadBalancerListenerPolicyRuleOptions : Instantiate CreateLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewCreateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, condition string, typeVar string, value string) *CreateLoadBalancerListenerPolicyRuleOptions { - return &CreateLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - Condition: core.StringPtr(condition), - Type: core.StringPtr(typeVar), - Value: core.StringPtr(value), +// UnmarshalAddressPrefix unmarshals an instance of AddressPrefix from the specified map of raw messages. +func UnmarshalAddressPrefix(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefix) + err = core.UnmarshalPrimitive(m, "cidr", &obj.CIDR) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "has_subnets", &obj.HasSubnets) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} +// AddressPrefixCollection : AddressPrefixCollection struct +type AddressPrefixCollection struct { + // Collection of address prefixes. + AddressPrefixes []AddressPrefix `json:"address_prefixes" validate:"required"` -// SetListenerID : Allow user to set ListenerID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options -} + // A link to the first page of resources. + First *AddressPrefixCollectionFirst `json:"first" validate:"required"` -// SetPolicyID : Allow user to set PolicyID -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// SetCondition : Allow user to set Condition -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetCondition(condition string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Condition = core.StringPtr(condition) - return _options -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *AddressPrefixCollectionNext `json:"next,omitempty"` -// SetType : Allow user to set Type -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetType(typeVar string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Type = core.StringPtr(typeVar) - return _options + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetValue : Allow user to set Value -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetValue(value string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Value = core.StringPtr(value) - return _options +// UnmarshalAddressPrefixCollection unmarshals an instance of AddressPrefixCollection from the specified map of raw messages. +func UnmarshalAddressPrefixCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixCollection) + err = core.UnmarshalModel(m, "address_prefixes", &obj.AddressPrefixes, UnmarshalAddressPrefix) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalAddressPrefixCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalAddressPrefixCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetField : Allow user to set Field -func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetField(field string) *CreateLoadBalancerListenerPolicyRuleOptions { - _options.Field = core.StringPtr(field) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *AddressPrefixCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options +// AddressPrefixCollectionFirst : A link to the first page of resources. +type AddressPrefixCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// CreateLoadBalancerOptions : The CreateLoadBalancer options. -type CreateLoadBalancerOptions struct { - // Indicates whether this load balancer is public or private. - // - // At present, if route mode is enabled, the load balancer must be private. - IsPublic *bool `json:"is_public" validate:"required"` +// UnmarshalAddressPrefixCollectionFirst unmarshals an instance of AddressPrefixCollectionFirst from the specified map of raw messages. +func UnmarshalAddressPrefixCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The subnets to provision this load balancer. - Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` +// AddressPrefixCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type AddressPrefixCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The listeners of this load balancer. - Listeners []LoadBalancerListenerPrototypeLoadBalancerContext `json:"listeners,omitempty"` +// UnmarshalAddressPrefixCollectionNext unmarshals an instance of AddressPrefixCollectionNext from the specified map of raw messages. +func UnmarshalAddressPrefixCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The logging configuration to use for this load balancer. See [VPC Datapath - // Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) - // on the logging format, fields and permitted values. - // - // To activate logging, the load balancer profile must support the specified logging - // type. - Logging *LoadBalancerLogging `json:"logging,omitempty"` +// AddressPrefixPatch : AddressPrefixPatch struct +type AddressPrefixPatch struct { + // Indicates whether this is the default prefix for this zone in this VPC. Updating to true makes this prefix the + // default prefix for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. + // Updating to false removes the default prefix for this zone in this VPC. + IsDefault *bool `json:"is_default,omitempty"` - // The user-defined name for this load balancer. If unspecified, the name will be a hyphenated list of - // randomly-selected words. + // The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in. Name *string `json:"name,omitempty"` +} - // The pools of this load balancer. - Pools []LoadBalancerPoolPrototype `json:"pools,omitempty"` - - // The profile to use for this load balancer. - Profile LoadBalancerProfileIdentityIntf `json:"profile,omitempty"` +// UnmarshalAddressPrefixPatch unmarshals an instance of AddressPrefixPatch from the specified map of raw messages. +func UnmarshalAddressPrefixPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AddressPrefixPatch) + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// AsPatch returns a generic map representation of the AddressPrefixPatch +func (addressPrefixPatch *AddressPrefixPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(addressPrefixPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // Indicates whether route mode is enabled for this load balancer. - // - // At present, public load balancers are not supported with route mode enabled. - RouteMode *bool `json:"route_mode,omitempty"` +// BareMetalServer : BareMetalServer struct +type BareMetalServer struct { + // The total bandwidth (in megabits per second) shared across the bare metal server's network interfaces. + Bandwidth *int64 `json:"bandwidth" validate:"required"` - // The security groups to use for this load balancer. - // - // The load balancer profile must support security groups. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The possible resource types for this property are expected to expand in the future. + BootTarget BareMetalServerBootTargetIntf `json:"boot_target" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The bare metal server CPU configuration. + Cpu *BareMetalServerCpu `json:"cpu" validate:"required"` -// NewCreateLoadBalancerOptions : Instantiate CreateLoadBalancerOptions -func (*VpcV1) NewCreateLoadBalancerOptions(isPublic bool, subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { - return &CreateLoadBalancerOptions{ - IsPublic: core.BoolPtr(isPublic), - Subnets: subnets, - } -} + // The date and time that the bare metal server was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetIsPublic : Allow user to set IsPublic -func (_options *CreateLoadBalancerOptions) SetIsPublic(isPublic bool) *CreateLoadBalancerOptions { - _options.IsPublic = core.BoolPtr(isPublic) - return _options -} + // The CRN for this bare metal server. + CRN *string `json:"crn" validate:"required"` -// SetSubnets : Allow user to set Subnets -func (_options *CreateLoadBalancerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { - _options.Subnets = subnets - return _options -} + // The disks for this bare metal server, including any disks that are associated with the + // `boot_target`. + Disks []BareMetalServerDisk `json:"disks" validate:"required"` -// SetListeners : Allow user to set Listeners -func (_options *CreateLoadBalancerOptions) SetListeners(listeners []LoadBalancerListenerPrototypeLoadBalancerContext) *CreateLoadBalancerOptions { - _options.Listeners = listeners - return _options -} + // Indicates whether secure boot is enabled. If enabled, the image must support secure boot or the server will fail to + // boot. + EnableSecureBoot *bool `json:"enable_secure_boot" validate:"required"` -// SetLogging : Allow user to set Logging -func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLogging) *CreateLoadBalancerOptions { - _options.Logging = logging - return _options -} + // The URL for this bare metal server. + Href *string `json:"href" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerOptions) SetName(name string) *CreateLoadBalancerOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The unique identifier for this bare metal server. + ID *string `json:"id" validate:"required"` -// SetPools : Allow user to set Pools -func (_options *CreateLoadBalancerOptions) SetPools(pools []LoadBalancerPoolPrototype) *CreateLoadBalancerOptions { - _options.Pools = pools - return _options -} + // The amount of memory, truncated to whole gibibytes. + Memory *int64 `json:"memory" validate:"required"` -// SetProfile : Allow user to set Profile -func (_options *CreateLoadBalancerOptions) SetProfile(profile LoadBalancerProfileIdentityIntf) *CreateLoadBalancerOptions { - _options.Profile = profile - return _options -} + // The user-defined name for this bare metal server (and default system hostname). + Name *string `json:"name" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateLoadBalancerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateLoadBalancerOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // The network interfaces for this bare metal server, including the primary network interface. + NetworkInterfaces []NetworkInterfaceBareMetalServerContextReference `json:"network_interfaces" validate:"required"` -// SetRouteMode : Allow user to set RouteMode -func (_options *CreateLoadBalancerOptions) SetRouteMode(routeMode bool) *CreateLoadBalancerOptions { - _options.RouteMode = core.BoolPtr(routeMode) - return _options -} + // Primary network interface. + PrimaryNetworkInterface *NetworkInterfaceBareMetalServerContextReference `json:"primary_network_interface" validate:"required"` -// SetSecurityGroups : Allow user to set SecurityGroups -func (_options *CreateLoadBalancerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateLoadBalancerOptions { - _options.SecurityGroups = securityGroups - return _options -} + // The profile this bare metal server uses. + Profile *BareMetalServerProfileReference `json:"profile" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerOptions { - options.Headers = param - return options -} + // The resource group for this bare metal server. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// CreateLoadBalancerPoolMemberOptions : The CreateLoadBalancerPoolMember options. -type CreateLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // The status of the bare metal server. + Status *string `json:"status" validate:"required"` - // The port the member will receive load balancer traffic on. - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. + // The reasons for the current status (if any). // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port" validate:"required"` + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []BareMetalServerStatusReason `json:"status_reasons" validate:"required"` - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` + TrustedPlatformModule *BareMetalServerTrustedPlatformModule `json:"trusted_platform_module" validate:"required"` - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` + // The VPC this bare metal server resides in. + VPC *VPCReference `json:"vpc" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The zone this bare metal server resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// NewCreateLoadBalancerPoolMemberOptions : Instantiate CreateLoadBalancerPoolMemberOptions -func (*VpcV1) NewCreateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { - return &CreateLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - Port: core.Int64Ptr(port), - Target: target, - } -} +// Constants associated with the BareMetalServer.ResourceType property. +// The resource type. +const ( + BareMetalServerResourceTypeBareMetalServerConst = "bare_metal_server" +) -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *CreateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *CreateLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} - -// SetPort : Allow user to set Port -func (_options *CreateLoadBalancerPoolMemberOptions) SetPort(port int64) *CreateLoadBalancerPoolMemberOptions { - _options.Port = core.Int64Ptr(port) - return _options -} - -// SetTarget : Allow user to set Target -func (_options *CreateLoadBalancerPoolMemberOptions) SetTarget(target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { - _options.Target = target - return _options -} - -// SetWeight : Allow user to set Weight -func (_options *CreateLoadBalancerPoolMemberOptions) SetWeight(weight int64) *CreateLoadBalancerPoolMemberOptions { - _options.Weight = core.Int64Ptr(weight) - return _options -} +// Constants associated with the BareMetalServer.Status property. +// The status of the bare metal server. +const ( + BareMetalServerStatusFailedConst = "failed" + BareMetalServerStatusMaintenanceConst = "maintenance" + BareMetalServerStatusPendingConst = "pending" + BareMetalServerStatusRestartingConst = "restarting" + BareMetalServerStatusRunningConst = "running" + BareMetalServerStatusStartingConst = "starting" + BareMetalServerStatusStoppedConst = "stopped" + BareMetalServerStatusStoppingConst = "stopping" +) -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolMemberOptions { - options.Headers = param - return options +// UnmarshalBareMetalServer unmarshals an instance of BareMetalServer from the specified map of raw messages. +func UnmarshalBareMetalServer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServer) + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_target", &obj.BootTarget, UnmarshalBareMetalServerBootTarget) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu", &obj.Cpu, UnmarshalBareMetalServerCpu) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceBareMetalServerContextReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceBareMetalServerContextReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalBareMetalServerProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalBareMetalServerStatusReason) + if err != nil { + return + } + err = core.UnmarshalModel(m, "trusted_platform_module", &obj.TrustedPlatformModule, UnmarshalBareMetalServerTrustedPlatformModule) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateLoadBalancerPoolOptions : The CreateLoadBalancerPool options. -type CreateLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` +// BareMetalServerBootTarget : The possible resource types for this property are expected to expand in the future. +// Models which "extend" this model: +// - BareMetalServerBootTargetBareMetalServerDiskReference +type BareMetalServerBootTarget struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` - // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers - // in the `application` family support `tcp`, `http`, and - // `https`. - Protocol *string `json:"protocol" validate:"required"` + // The URL for this bare metal server disk. + Href *string `json:"href,omitempty"` - // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` - // tuple cannot be shared by a pool member of any other load balancer in the same VPC. - Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` + // The unique identifier for this bare metal server disk. + ID *string `json:"id,omitempty"` - // The user-defined name for this load balancer pool. If unspecified, the name will be a hyphenated list of - // randomly-selected words. + // The user-defined name for this disk. Name *string `json:"name,omitempty"` - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` - - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// Constants associated with the CreateLoadBalancerPoolOptions.Algorithm property. -// The load balancing algorithm. +// Constants associated with the BareMetalServerBootTarget.ResourceType property. +// The resource type. const ( - CreateLoadBalancerPoolOptionsAlgorithmLeastConnectionsConst = "least_connections" - CreateLoadBalancerPoolOptionsAlgorithmRoundRobinConst = "round_robin" - CreateLoadBalancerPoolOptionsAlgorithmWeightedRoundRobinConst = "weighted_round_robin" + BareMetalServerBootTargetResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" ) -// Constants associated with the CreateLoadBalancerPoolOptions.Protocol property. -// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers -// in the `application` family support `tcp`, `http`, and -// `https`. -const ( - CreateLoadBalancerPoolOptionsProtocolHTTPConst = "http" - CreateLoadBalancerPoolOptionsProtocolHTTPSConst = "https" - CreateLoadBalancerPoolOptionsProtocolTCPConst = "tcp" -) +func (*BareMetalServerBootTarget) isaBareMetalServerBootTarget() bool { + return true +} -// Constants associated with the CreateLoadBalancerPoolOptions.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - CreateLoadBalancerPoolOptionsProxyProtocolDisabledConst = "disabled" - CreateLoadBalancerPoolOptionsProxyProtocolV1Const = "v1" - CreateLoadBalancerPoolOptionsProxyProtocolV2Const = "v2" -) +type BareMetalServerBootTargetIntf interface { + isaBareMetalServerBootTarget() bool +} -// NewCreateLoadBalancerPoolOptions : Instantiate CreateLoadBalancerPoolOptions -func (*VpcV1) NewCreateLoadBalancerPoolOptions(loadBalancerID string, algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) *CreateLoadBalancerPoolOptions { - return &CreateLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - Algorithm: core.StringPtr(algorithm), - HealthMonitor: healthMonitor, - Protocol: core.StringPtr(protocol), +// UnmarshalBareMetalServerBootTarget unmarshals an instance of BareMetalServerBootTarget from the specified map of raw messages. +func UnmarshalBareMetalServerBootTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerBootTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *CreateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} +// BareMetalServerCpu : The bare metal server CPU configuration. +type BareMetalServerCpu struct { + // The CPU architecture. + Architecture *string `json:"architecture" validate:"required"` -// SetAlgorithm : Allow user to set Algorithm -func (_options *CreateLoadBalancerPoolOptions) SetAlgorithm(algorithm string) *CreateLoadBalancerPoolOptions { - _options.Algorithm = core.StringPtr(algorithm) - return _options -} + // The total number of cores. + CoreCount *int64 `json:"core_count" validate:"required"` -// SetHealthMonitor : Allow user to set HealthMonitor -func (_options *CreateLoadBalancerPoolOptions) SetHealthMonitor(healthMonitor *LoadBalancerPoolHealthMonitorPrototype) *CreateLoadBalancerPoolOptions { - _options.HealthMonitor = healthMonitor - return _options -} + // The total number of CPU sockets. + SocketCount *int64 `json:"socket_count" validate:"required"` -// SetProtocol : Allow user to set Protocol -func (_options *CreateLoadBalancerPoolOptions) SetProtocol(protocol string) *CreateLoadBalancerPoolOptions { - _options.Protocol = core.StringPtr(protocol) - return _options + // The total number of hardware threads per core. + ThreadsPerCore *int64 `json:"threads_per_core" validate:"required"` } -// SetMembers : Allow user to set Members -func (_options *CreateLoadBalancerPoolOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *CreateLoadBalancerPoolOptions { - _options.Members = members - return _options +// UnmarshalBareMetalServerCpu unmarshals an instance of BareMetalServerCpu from the specified map of raw messages. +func UnmarshalBareMetalServerCpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCpu) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "core_count", &obj.CoreCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "threads_per_core", &obj.ThreadsPerCore) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *CreateLoadBalancerPoolOptions) SetName(name string) *CreateLoadBalancerPoolOptions { - _options.Name = core.StringPtr(name) - return _options -} +// BareMetalServerCollection : BareMetalServerCollection struct +type BareMetalServerCollection struct { + // Collection of bare metal servers. + BareMetalServers []BareMetalServer `json:"bare_metal_servers" validate:"required"` -// SetProxyProtocol : Allow user to set ProxyProtocol -func (_options *CreateLoadBalancerPoolOptions) SetProxyProtocol(proxyProtocol string) *CreateLoadBalancerPoolOptions { - _options.ProxyProtocol = core.StringPtr(proxyProtocol) - return _options -} + // A link to the first page of resources. + First *BareMetalServerCollectionFirst `json:"first" validate:"required"` -// SetSessionPersistence : Allow user to set SessionPersistence -func (_options *CreateLoadBalancerPoolOptions) SetSessionPersistence(sessionPersistence *LoadBalancerPoolSessionPersistencePrototype) *CreateLoadBalancerPoolOptions { - _options.SessionPersistence = sessionPersistence - return _options + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *BareMetalServerCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerCollection unmarshals an instance of BareMetalServerCollection from the specified map of raw messages. +func UnmarshalBareMetalServerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCollection) + err = core.UnmarshalModel(m, "bare_metal_servers", &obj.BareMetalServers, UnmarshalBareMetalServer) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateNetworkACLOptions : The CreateNetworkACL options. -type CreateNetworkACLOptions struct { - // The network ACL prototype object. - NetworkACLPrototype NetworkACLPrototypeIntf `json:"NetworkACLPrototype,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *BareMetalServerCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // Allows users to set headers on API requests - Headers map[string]string +// BareMetalServerCollectionFirst : A link to the first page of resources. +type BareMetalServerCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewCreateNetworkACLOptions : Instantiate CreateNetworkACLOptions -func (*VpcV1) NewCreateNetworkACLOptions() *CreateNetworkACLOptions { - return &CreateNetworkACLOptions{} +// UnmarshalBareMetalServerCollectionFirst unmarshals an instance of BareMetalServerCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetNetworkACLPrototype : Allow user to set NetworkACLPrototype -func (_options *CreateNetworkACLOptions) SetNetworkACLPrototype(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { - _options.NetworkACLPrototype = networkACLPrototype - return _options +// BareMetalServerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateNetworkACLOptions) SetHeaders(param map[string]string) *CreateNetworkACLOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerCollectionNext unmarshals an instance of BareMetalServerCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateNetworkACLRuleOptions : The CreateNetworkACLRule options. -type CreateNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` +// BareMetalServerConsoleAccessToken : The bare metal server console access token information. +type BareMetalServerConsoleAccessToken struct { + // A URL safe single-use token used to access the console WebSocket. + AccessToken *string `json:"access_token" validate:"required"` - // The network ACL rule prototype object. - NetworkACLRulePrototype NetworkACLRulePrototypeIntf `json:"NetworkACLRulePrototype" validate:"required"` + // The bare metal server console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The date and time that the access token was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The date and time that the access token will expire. + ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` + + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force" validate:"required"` + + // The URL to access this bare metal server console. + Href *string `json:"href" validate:"required"` } -// NewCreateNetworkACLRuleOptions : Instantiate CreateNetworkACLRuleOptions -func (*VpcV1) NewCreateNetworkACLRuleOptions(networkACLID string, networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { - return &CreateNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - NetworkACLRulePrototype: networkACLRulePrototype, +// Constants associated with the BareMetalServerConsoleAccessToken.ConsoleType property. +// The bare metal server console type for which this token may be used. +const ( + BareMetalServerConsoleAccessTokenConsoleTypeSerialConst = "serial" + BareMetalServerConsoleAccessTokenConsoleTypeVncConst = "vnc" +) + +// UnmarshalBareMetalServerConsoleAccessToken unmarshals an instance of BareMetalServerConsoleAccessToken from the specified map of raw messages. +func UnmarshalBareMetalServerConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerConsoleAccessToken) + err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "force", &obj.Force) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *CreateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *CreateNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} +// BareMetalServerDisk : BareMetalServerDisk struct +type BareMetalServerDisk struct { + // The date and time that the disk was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetNetworkACLRulePrototype : Allow user to set NetworkACLRulePrototype -func (_options *CreateNetworkACLRuleOptions) SetNetworkACLRulePrototype(networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { - _options.NetworkACLRulePrototype = networkACLRulePrototype - return _options -} + // The URL for this bare metal server disk. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateNetworkACLRuleOptions) SetHeaders(param map[string]string) *CreateNetworkACLRuleOptions { - options.Headers = param - return options -} + // The unique identifier for this bare metal server disk. + ID *string `json:"id" validate:"required"` -// CreatePlacementGroupOptions : The CreatePlacementGroup options. -type CreatePlacementGroupOptions struct { - // The strategy for this placement group - // - `host_spread`: place on different compute hosts - // - `power_spread`: place on compute hosts that use different power sources + // The disk interface used for attaching the disk. // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the - // unexpected strategy was encountered. - Strategy *string `json:"strategy" validate:"required"` + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` - // The unique user-defined name for this placement group. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` + // The user-defined name for this disk. + Name *string `json:"name" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The size of the disk in GB (gigabytes). + Size *int64 `json:"size" validate:"required"` } -// Constants associated with the CreatePlacementGroupOptions.Strategy property. -// The strategy for this placement group -// - `host_spread`: place on different compute hosts -// - `power_spread`: place on compute hosts that use different power sources +// Constants associated with the BareMetalServerDisk.InterfaceType property. +// The disk interface used for attaching the disk. // -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the -// unexpected strategy was encountered. +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. const ( - CreatePlacementGroupOptionsStrategyHostSpreadConst = "host_spread" - CreatePlacementGroupOptionsStrategyPowerSpreadConst = "power_spread" + BareMetalServerDiskInterfaceTypeNvmeConst = "nvme" + BareMetalServerDiskInterfaceTypeSataConst = "sata" ) -// NewCreatePlacementGroupOptions : Instantiate CreatePlacementGroupOptions -func (*VpcV1) NewCreatePlacementGroupOptions(strategy string) *CreatePlacementGroupOptions { - return &CreatePlacementGroupOptions{ - Strategy: core.StringPtr(strategy), - } -} +// Constants associated with the BareMetalServerDisk.ResourceType property. +// The resource type. +const ( + BareMetalServerDiskResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" +) -// SetStrategy : Allow user to set Strategy -func (_options *CreatePlacementGroupOptions) SetStrategy(strategy string) *CreatePlacementGroupOptions { - _options.Strategy = core.StringPtr(strategy) - return _options +// UnmarshalBareMetalServerDisk unmarshals an instance of BareMetalServerDisk from the specified map of raw messages. +func UnmarshalBareMetalServerDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDisk) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "size", &obj.Size) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *CreatePlacementGroupOptions) SetName(name string) *CreatePlacementGroupOptions { - _options.Name = core.StringPtr(name) - return _options +// BareMetalServerDiskCollection : BareMetalServerDiskCollection struct +type BareMetalServerDiskCollection struct { + // Collection of the bare metal server's disks. + Disks []BareMetalServerDisk `json:"disks" validate:"required"` } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreatePlacementGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePlacementGroupOptions { - _options.ResourceGroup = resourceGroup - return _options +// UnmarshalBareMetalServerDiskCollection unmarshals an instance of BareMetalServerDiskCollection from the specified map of raw messages. +func UnmarshalBareMetalServerDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDiskCollection) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerDisk) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreatePlacementGroupOptions) SetHeaders(param map[string]string) *CreatePlacementGroupOptions { - options.Headers = param - return options +// BareMetalServerDiskPatch : BareMetalServerDiskPatch struct +type BareMetalServerDiskPatch struct { + // The user-defined name for this disk. + Name *string `json:"name,omitempty"` } -// CreatePublicGatewayOptions : The CreatePublicGateway options. -type CreatePublicGatewayOptions struct { - // The VPC this public gateway will serve. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The zone this public gateway will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - FloatingIP PublicGatewayFloatingIPPrototypeIntf `json:"floating_ip,omitempty"` - - // The user-defined name for this public gateway. Names must be unique within the VPC the public gateway resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalBareMetalServerDiskPatch unmarshals an instance of BareMetalServerDiskPatch from the specified map of raw messages. +func UnmarshalBareMetalServerDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDiskPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewCreatePublicGatewayOptions : Instantiate CreatePublicGatewayOptions -func (*VpcV1) NewCreatePublicGatewayOptions(vpc VPCIdentityIntf, zone ZoneIdentityIntf) *CreatePublicGatewayOptions { - return &CreatePublicGatewayOptions{ - VPC: vpc, - Zone: zone, +// AsPatch returns a generic map representation of the BareMetalServerDiskPatch +func (bareMetalServerDiskPatch *BareMetalServerDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerDiskPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } + return } -// SetVPC : Allow user to set VPC -func (_options *CreatePublicGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreatePublicGatewayOptions { - _options.VPC = vpc - return _options +// BareMetalServerDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type BareMetalServerDiskReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetZone : Allow user to set Zone -func (_options *CreatePublicGatewayOptions) SetZone(zone ZoneIdentityIntf) *CreatePublicGatewayOptions { - _options.Zone = zone - return _options +// UnmarshalBareMetalServerDiskReferenceDeleted unmarshals an instance of BareMetalServerDiskReferenceDeleted from the specified map of raw messages. +func UnmarshalBareMetalServerDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerDiskReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetFloatingIP : Allow user to set FloatingIP -func (_options *CreatePublicGatewayOptions) SetFloatingIP(floatingIP PublicGatewayFloatingIPPrototypeIntf) *CreatePublicGatewayOptions { - _options.FloatingIP = floatingIP - return _options -} +// BareMetalServerInitialization : BareMetalServerInitialization struct +type BareMetalServerInitialization struct { + // The image the bare metal server was provisioned from. + Image *ImageReference `json:"image" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreatePublicGatewayOptions) SetName(name string) *CreatePublicGatewayOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The public SSH keys used at initialization. + Keys []KeyReference `json:"keys" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreatePublicGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePublicGatewayOptions { - _options.ResourceGroup = resourceGroup - return _options + // The user accounts that are created at initialization. There can be multiple account types distinguished by the + // `resource_type` property. + UserAccounts []BareMetalServerInitializationUserAccountIntf `json:"user_accounts" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) *CreatePublicGatewayOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerInitialization unmarshals an instance of BareMetalServerInitialization from the specified map of raw messages. +func UnmarshalBareMetalServerInitialization(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitialization) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "user_accounts", &obj.UserAccounts, UnmarshalBareMetalServerInitializationUserAccount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateSecurityGroupOptions : The CreateSecurityGroup options. -type CreateSecurityGroupOptions struct { - // The VPC this security group is to be a part of. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` - - // The user-defined name for this security group. If unspecified, the name will be a hyphenated list of - // randomly-selected words. Names must be unique within the VPC the security group resides in. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// BareMetalServerInitializationPrototype : BareMetalServerInitializationPrototype struct +type BareMetalServerInitializationPrototype struct { + // The image to be used when provisioning the bare metal server. + Image ImageIdentityIntf `json:"image" validate:"required"` - // The prototype objects for rules to be created for this security group. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []SecurityGroupRulePrototypeIntf `json:"rules,omitempty"` + // The public SSH keys to install on the bare metal server. Keys will be made available to the bare metal server as + // cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the + // administrative user. + // + // For Windows images, at least one key must be specified, and one will be chosen to encrypt the administrator + // password. Keys are optional for other images, but if no keys are specified, the instance will be inaccessible unless + // the specified image provides another means of access. + Keys []KeyIdentityIntf `json:"keys" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // User data to be made available when initializing the bare metal server. + UserData *string `json:"user_data,omitempty"` } -// NewCreateSecurityGroupOptions : Instantiate CreateSecurityGroupOptions -func (*VpcV1) NewCreateSecurityGroupOptions(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { - return &CreateSecurityGroupOptions{ - VPC: vpc, +// NewBareMetalServerInitializationPrototype : Instantiate BareMetalServerInitializationPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerInitializationPrototype(image ImageIdentityIntf, keys []KeyIdentityIntf) (_model *BareMetalServerInitializationPrototype, err error) { + _model = &BareMetalServerInitializationPrototype{ + Image: image, + Keys: keys, } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetVPC : Allow user to set VPC -func (_options *CreateSecurityGroupOptions) SetVPC(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { - _options.VPC = vpc - return _options +// UnmarshalBareMetalServerInitializationPrototype unmarshals an instance of BareMetalServerInitializationPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerInitializationPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitializationPrototype) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *CreateSecurityGroupOptions) SetName(name string) *CreateSecurityGroupOptions { - _options.Name = core.StringPtr(name) - return _options -} +// BareMetalServerInitializationUserAccount : BareMetalServerInitializationUserAccount struct +// Models which "extend" this model: +// - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount +type BareMetalServerInitializationUserAccount struct { + // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. + EncryptedPassword *[]byte `json:"encrypted_password,omitempty"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateSecurityGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSecurityGroupOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // The public SSH key used to encrypt the password. + EncryptionKey *KeyReference `json:"encryption_key,omitempty"` -// SetRules : Allow user to set Rules -func (_options *CreateSecurityGroupOptions) SetRules(rules []SecurityGroupRulePrototypeIntf) *CreateSecurityGroupOptions { - _options.Rules = rules - return _options -} + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupOptions) SetHeaders(param map[string]string) *CreateSecurityGroupOptions { - options.Headers = param - return options + // The username for the account created at initialization. + Username *string `json:"username,omitempty"` } -// CreateSecurityGroupRuleOptions : The CreateSecurityGroupRule options. -type CreateSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The properties of the security group rule to be created. - SecurityGroupRulePrototype SecurityGroupRulePrototypeIntf `json:"SecurityGroupRulePrototype" validate:"required"` +// Constants associated with the BareMetalServerInitializationUserAccount.ResourceType property. +// The resource type. +const ( + BareMetalServerInitializationUserAccountResourceTypeHostUserAccountConst = "host_user_account" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*BareMetalServerInitializationUserAccount) isaBareMetalServerInitializationUserAccount() bool { + return true } -// NewCreateSecurityGroupRuleOptions : Instantiate CreateSecurityGroupRuleOptions -func (*VpcV1) NewCreateSecurityGroupRuleOptions(securityGroupID string, securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { - return &CreateSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - SecurityGroupRulePrototype: securityGroupRulePrototype, - } +type BareMetalServerInitializationUserAccountIntf interface { + isaBareMetalServerInitializationUserAccount() bool } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options +// UnmarshalBareMetalServerInitializationUserAccount unmarshals an instance of BareMetalServerInitializationUserAccount from the specified map of raw messages. +func UnmarshalBareMetalServerInitializationUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitializationUserAccount) + err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "username", &obj.Username) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupRulePrototype : Allow user to set SecurityGroupRulePrototype -func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupRulePrototype(securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { - _options.SecurityGroupRulePrototype = securityGroupRulePrototype - return _options -} +// BareMetalServerNetworkInterface : BareMetalServerNetworkInterface struct +// Models which "extend" this model: +// - BareMetalServerNetworkInterfaceByPci +// - BareMetalServerNetworkInterfaceByVlan +type BareMetalServerNetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *CreateSecurityGroupRuleOptions { - options.Headers = param - return options -} + // The date and time that the network interface was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// CreateSecurityGroupTargetBindingOptions : The CreateSecurityGroupTargetBinding options. -type CreateSecurityGroupTargetBindingOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. + // + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` + // The floating IPs associated with this network interface. + FloatingIps []FloatingIPReference `json:"floating_ips,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The URL for this network interface. + Href *string `json:"href" validate:"required"` -// NewCreateSecurityGroupTargetBindingOptions : Instantiate CreateSecurityGroupTargetBindingOptions -func (*VpcV1) NewCreateSecurityGroupTargetBindingOptions(securityGroupID string, id string) *CreateSecurityGroupTargetBindingOptions { - return &CreateSecurityGroupTargetBindingOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } -} + // The unique identifier for this network interface. + ID *string `json:"id" validate:"required"` -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *CreateSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupTargetBindingOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` -// SetID : Allow user to set ID -func (_options *CreateSecurityGroupTargetBindingOptions) SetID(id string) *CreateSecurityGroupTargetBindingOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The MAC address of the interface. If absent, the value is not known. + MacAddress *string `json:"mac_address" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *CreateSecurityGroupTargetBindingOptions { - options.Headers = param - return options -} + // The user-defined name for this network interface. + Name *string `json:"name" validate:"required"` -// CreateSnapshotOptions : The CreateSnapshot options. -type CreateSnapshotOptions struct { - // The volume to snapshot. - SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` + // The network interface port speed in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` - // The unique user-defined name for this snapshot. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The security groups targeting this network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` -// NewCreateSnapshotOptions : Instantiate CreateSnapshotOptions -func (*VpcV1) NewCreateSnapshotOptions(sourceVolume VolumeIdentityIntf) *CreateSnapshotOptions { - return &CreateSnapshotOptions{ - SourceVolume: sourceVolume, - } -} + // The status of the network interface. + Status *string `json:"status" validate:"required"` -// SetSourceVolume : Allow user to set SourceVolume -func (_options *CreateSnapshotOptions) SetSourceVolume(sourceVolume VolumeIdentityIntf) *CreateSnapshotOptions { - _options.SourceVolume = sourceVolume - return _options -} + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateSnapshotOptions) SetName(name string) *CreateSnapshotOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The type of this bare metal server network interface. + Type *string `json:"type" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateSnapshotOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSnapshotOptions { - _options.ResourceGroup = resourceGroup - return _options -} + // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in + // the `allowed_vlans` array for one PCI type adapter per bare metal server. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` + + // Indicates if the interface can float to any other server within the same + // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal + // server in the resource group. Applies only to `vlan` type interfaces. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` + + // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + Vlan *int64 `json:"vlan,omitempty"` +} + +// Constants associated with the BareMetalServerNetworkInterface.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +const ( + BareMetalServerNetworkInterfaceInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfaceInterfaceTypeVlanConst = "vlan" +) -// SetHeaders : Allow user to set Headers -func (options *CreateSnapshotOptions) SetHeaders(param map[string]string) *CreateSnapshotOptions { - options.Headers = param - return options -} +// Constants associated with the BareMetalServerNetworkInterface.ResourceType property. +// The resource type. +const ( + BareMetalServerNetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" +) -// CreateSubnetOptions : The CreateSubnet options. -type CreateSubnetOptions struct { - // The subnet prototype object. - SubnetPrototype SubnetPrototypeIntf `json:"SubnetPrototype" validate:"required"` +// Constants associated with the BareMetalServerNetworkInterface.Status property. +// The status of the network interface. +const ( + BareMetalServerNetworkInterfaceStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceStatusPendingConst = "pending" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the BareMetalServerNetworkInterface.Type property. +// The type of this bare metal server network interface. +const ( + BareMetalServerNetworkInterfaceTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceTypeSecondaryConst = "secondary" +) -// NewCreateSubnetOptions : Instantiate CreateSubnetOptions -func (*VpcV1) NewCreateSubnetOptions(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { - return &CreateSubnetOptions{ - SubnetPrototype: subnetPrototype, - } +func (*BareMetalServerNetworkInterface) isaBareMetalServerNetworkInterface() bool { + return true } -// SetSubnetPrototype : Allow user to set SubnetPrototype -func (_options *CreateSubnetOptions) SetSubnetPrototype(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { - _options.SubnetPrototype = subnetPrototype - return _options +type BareMetalServerNetworkInterfaceIntf interface { + isaBareMetalServerNetworkInterface() bool } -// SetHeaders : Allow user to set Headers -func (options *CreateSubnetOptions) SetHeaders(param map[string]string) *CreateSubnetOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerNetworkInterface unmarshals an instance of BareMetalServerNetworkInterface from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "interface_type", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") + return + } + if discValue == "pci" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByPci) + } else if discValue == "vlan" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfaceByVlan) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) + } + return } -// CreateSubnetReservedIPOptions : The CreateSubnetReservedIP options. -type CreateSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` +// BareMetalServerNetworkInterfaceCollection : BareMetalServerNetworkInterfaceCollection struct +type BareMetalServerNetworkInterfaceCollection struct { + // A link to the first page of resources. + First *BareMetalServerNetworkInterfaceCollectionFirst `json:"first" validate:"required"` - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected - // words. Names must be unique within the subnet the reserved IP resides in. Names beginning with `ibm-` are reserved - // for provider-owned resources. - Name *string `json:"name,omitempty"` + // Collection of network interfaces. + NetworkInterfaces []BareMetalServerNetworkInterfaceIntf `json:"network_interfaces" validate:"required"` - // The target this reserved IP is to be bound to. The target must be an endpoint gateway not - // already bound to a reserved IP in the subnet's zone. - Target ReservedIPTargetPrototypeIntf `json:"target,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *BareMetalServerNetworkInterfaceCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewCreateSubnetReservedIPOptions : Instantiate CreateSubnetReservedIPOptions -func (*VpcV1) NewCreateSubnetReservedIPOptions(subnetID string) *CreateSubnetReservedIPOptions { - return &CreateSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), +// UnmarshalBareMetalServerNetworkInterfaceCollection unmarshals an instance of BareMetalServerNetworkInterfaceCollection from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerNetworkInterfaceCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalBareMetalServerNetworkInterface) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerNetworkInterfaceCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSubnetID : Allow user to set SubnetID -func (_options *CreateSubnetReservedIPOptions) SetSubnetID(subnetID string) *CreateSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *BareMetalServerNetworkInterfaceCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetAutoDelete : Allow user to set AutoDelete -func (_options *CreateSubnetReservedIPOptions) SetAutoDelete(autoDelete bool) *CreateSubnetReservedIPOptions { - _options.AutoDelete = core.BoolPtr(autoDelete) - return _options +// BareMetalServerNetworkInterfaceCollectionFirst : A link to the first page of resources. +type BareMetalServerNetworkInterfaceCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetName : Allow user to set Name -func (_options *CreateSubnetReservedIPOptions) SetName(name string) *CreateSubnetReservedIPOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalBareMetalServerNetworkInterfaceCollectionFirst unmarshals an instance of BareMetalServerNetworkInterfaceCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetTarget : Allow user to set Target -func (_options *CreateSubnetReservedIPOptions) SetTarget(target ReservedIPTargetPrototypeIntf) *CreateSubnetReservedIPOptions { - _options.Target = target - return _options +// BareMetalServerNetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerNetworkInterfaceCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *CreateSubnetReservedIPOptions) SetHeaders(param map[string]string) *CreateSubnetReservedIPOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerNetworkInterfaceCollectionNext unmarshals an instance of BareMetalServerNetworkInterfaceCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateVolumeOptions : The CreateVolume options. -type CreateVolumeOptions struct { - // The volume prototype object. - VolumePrototype VolumePrototypeIntf `json:"VolumePrototype" validate:"required"` +// BareMetalServerNetworkInterfacePatch : BareMetalServerNetworkInterfacePatch struct +type BareMetalServerNetworkInterfacePatch struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in + // the `allowed_vlans` array for one PCI type adapter per bare metal server. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` -// NewCreateVolumeOptions : Instantiate CreateVolumeOptions -func (*VpcV1) NewCreateVolumeOptions(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { - return &CreateVolumeOptions{ - VolumePrototype: volumePrototype, - } + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. + // + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. + Name *string `json:"name,omitempty"` } -// SetVolumePrototype : Allow user to set VolumePrototype -func (_options *CreateVolumeOptions) SetVolumePrototype(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { - _options.VolumePrototype = volumePrototype - return _options +// UnmarshalBareMetalServerNetworkInterfacePatch unmarshals an instance of BareMetalServerNetworkInterfacePatch from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePatch) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreateVolumeOptions) SetHeaders(param map[string]string) *CreateVolumeOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the BareMetalServerNetworkInterfacePatch +func (bareMetalServerNetworkInterfacePatch *BareMetalServerNetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerNetworkInterfacePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// CreateVPCAddressPrefixOptions : The CreateVPCAddressPrefix options. -type CreateVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// BareMetalServerNetworkInterfacePrototype : BareMetalServerNetworkInterfacePrototype struct +// Models which "extend" this model: +// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype +// - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype +type BareMetalServerNetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The IPv4 range of the address prefix, expressed in CIDR format. The request must not overlap with any existing - // address prefixes in the VPC or any of the following reserved address ranges: - // - `127.0.0.0/8` (IPv4 loopback addresses) - // - `161.26.0.0/16` (IBM services) - // - `166.8.0.0/14` (Cloud Service Endpoints) - // - `169.254.0.0/16` (IPv4 link-local addresses) - // - `224.0.0.0/4` (IPv4 multicast addresses) + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. // - // The prefix length of the address prefix's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). - CIDR *string `json:"cidr" validate:"required"` - - // The zone this address prefix will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` - - // Indicates whether this will be the default address prefix for this zone in this VPC. If `true`, the VPC must not - // have a default address prefix for this zone. - IsDefault *bool `json:"is_default,omitempty"` + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` - // The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If + // unspecified, an available address on the subnet will be automatically selected. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` -// NewCreateVPCAddressPrefixOptions : Instantiate CreateVPCAddressPrefixOptions -func (*VpcV1) NewCreateVPCAddressPrefixOptions(vpcID string, cidr string, zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { - return &CreateVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - CIDR: core.StringPtr(cidr), - Zone: zone, - } -} + // The security groups to use for this network interface. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCAddressPrefixOptions) SetVPCID(vpcID string) *CreateVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + + // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in + // the `allowed_vlans` array for one PCI type adapter per bare metal server. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` + + // Indicates if the interface can float to any other server within the same + // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal + // server in the resource group. Applies only to `vlan` type interfaces. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` + + // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + Vlan *int64 `json:"vlan,omitempty"` +} + +// Constants associated with the BareMetalServerNetworkInterfacePrototype.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +const ( + BareMetalServerNetworkInterfacePrototypeInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfacePrototypeInterfaceTypeVlanConst = "vlan" +) + +func (*BareMetalServerNetworkInterfacePrototype) isaBareMetalServerNetworkInterfacePrototype() bool { + return true } -// SetCIDR : Allow user to set CIDR -func (_options *CreateVPCAddressPrefixOptions) SetCIDR(cidr string) *CreateVPCAddressPrefixOptions { - _options.CIDR = core.StringPtr(cidr) - return _options +type BareMetalServerNetworkInterfacePrototypeIntf interface { + isaBareMetalServerNetworkInterfacePrototype() bool } -// SetZone : Allow user to set Zone -func (_options *CreateVPCAddressPrefixOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { - _options.Zone = zone - return _options +// UnmarshalBareMetalServerNetworkInterfacePrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "interface_type", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'interface_type': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'interface_type' not found in JSON object") + return + } + if discValue == "pci" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) + } else if discValue == "vlan" { + err = core.UnmarshalModel(m, "", result, UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'interface_type': %s", discValue) + } + return } -// SetIsDefault : Allow user to set IsDefault -func (_options *CreateVPCAddressPrefixOptions) SetIsDefault(isDefault bool) *CreateVPCAddressPrefixOptions { - _options.IsDefault = core.BoolPtr(isDefault) - return _options +// BareMetalServerPatch : BareMetalServerPatch struct +type BareMetalServerPatch struct { + // The user-defined name for this bare metal server (and default system hostname). + Name *string `json:"name,omitempty"` } -// SetName : Allow user to set Name -func (_options *CreateVPCAddressPrefixOptions) SetName(name string) *CreateVPCAddressPrefixOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalBareMetalServerPatch unmarshals an instance of BareMetalServerPatch from the specified map of raw messages. +func UnmarshalBareMetalServerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *CreateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *CreateVPCAddressPrefixOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the BareMetalServerPatch +func (bareMetalServerPatch *BareMetalServerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(bareMetalServerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// CreateVPCOptions : The CreateVPC options. -type CreateVPCOptions struct { - // Indicates whether a default address prefix should be automatically created for each zone in this VPC. If `manual`, - // this VPC will be created with no default address prefixes. - // - // This property's value is used only when creating the VPC. Since address prefixes are managed identically regardless - // of whether they were automatically created, the value is not preserved as a VPC property. - AddressPrefixManagement *string `json:"address_prefix_management,omitempty"` +// BareMetalServerPrimaryNetworkInterfacePrototype : BareMetalServerPrimaryNetworkInterfacePrototype struct +type BareMetalServerPrimaryNetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Indicates whether this VPC should be connected to Classic Infrastructure. If true, this VPC's resources will have - // private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be - // connected in this way. This value is set at creation and subsequently immutable. - ClassicAccess *bool `json:"classic_access,omitempty"` + // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in + // the `allowed_vlans` array for one PCI type adapter per bare metal server. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` - // The unique user-defined name for this VPC. If unspecified, the name will be a hyphenated list of randomly-selected - // words. + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. + // + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + InterfaceType *string `json:"interface_type,omitempty"` + + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If + // unspecified, an available address on the subnet will be automatically selected. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The security groups to use for this network interface. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` } -// Constants associated with the CreateVPCOptions.AddressPrefixManagement property. -// Indicates whether a default address prefix should be automatically created for each zone in this VPC. If `manual`, -// this VPC will be created with no default address prefixes. -// -// This property's value is used only when creating the VPC. Since address prefixes are managed identically regardless -// of whether they were automatically created, the value is not preserved as a VPC property. +// Constants associated with the BareMetalServerPrimaryNetworkInterfacePrototype.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. const ( - CreateVPCOptionsAddressPrefixManagementAutoConst = "auto" - CreateVPCOptionsAddressPrefixManagementManualConst = "manual" + BareMetalServerPrimaryNetworkInterfacePrototypeInterfaceTypePciConst = "pci" ) -// NewCreateVPCOptions : Instantiate CreateVPCOptions -func (*VpcV1) NewCreateVPCOptions() *CreateVPCOptions { - return &CreateVPCOptions{} +// NewBareMetalServerPrimaryNetworkInterfacePrototype : Instantiate BareMetalServerPrimaryNetworkInterfacePrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerPrimaryNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *BareMetalServerPrimaryNetworkInterfacePrototype, err error) { + _model = &BareMetalServerPrimaryNetworkInterfacePrototype{ + Subnet: subnet, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetAddressPrefixManagement : Allow user to set AddressPrefixManagement -func (_options *CreateVPCOptions) SetAddressPrefixManagement(addressPrefixManagement string) *CreateVPCOptions { - _options.AddressPrefixManagement = core.StringPtr(addressPrefixManagement) - return _options +// UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype unmarshals an instance of BareMetalServerPrimaryNetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalBareMetalServerPrimaryNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerPrimaryNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetClassicAccess : Allow user to set ClassicAccess -func (_options *CreateVPCOptions) SetClassicAccess(classicAccess bool) *CreateVPCOptions { - _options.ClassicAccess = core.BoolPtr(classicAccess) - return _options -} +// BareMetalServerProfile : BareMetalServerProfile struct +type BareMetalServerProfile struct { + Bandwidth BareMetalServerProfileBandwidthIntf `json:"bandwidth" validate:"required"` -// SetName : Allow user to set Name -func (_options *CreateVPCOptions) SetName(name string) *CreateVPCOptions { - _options.Name = core.StringPtr(name) - return _options -} + CpuArchitecture *BareMetalServerProfileCpuArchitecture `json:"cpu_architecture" validate:"required"` -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateVPCOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPCOptions { - _options.ResourceGroup = resourceGroup - return _options -} + CpuCoreCount BareMetalServerProfileCpuCoreCountIntf `json:"cpu_core_count" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *CreateVPCOptions) SetHeaders(param map[string]string) *CreateVPCOptions { - options.Headers = param - return options -} + CpuSocketCount BareMetalServerProfileCpuSocketCountIntf `json:"cpu_socket_count" validate:"required"` -// CreateVPCRouteOptions : The CreateVPCRoute options. -type CreateVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // Collection of the bare metal server profile's disks. + Disks []BareMetalServerProfileDisk `json:"disks" validate:"required"` - // The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if - // both routes have an `action` of `deliver` and the - // `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` + // The product family this bare metal server profile belongs to. + Family *string `json:"family" validate:"required"` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The URL for this bare metal server profile. + Href *string `json:"href" validate:"required"` - // The action to perform with a packet matching the route: - // - `delegate`: delegate to the system's built-in routes - // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - // routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` + Memory BareMetalServerProfileMemoryIntf `json:"memory" validate:"required"` - // The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. - // Names must be unique within the VPC routing table the route resides in. - Name *string `json:"name,omitempty"` + // The name for this bare metal server profile. + Name *string `json:"name" validate:"required"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, it must be omitted or specified as `0.0.0.0`. - NextHop RouteNextHopPrototypeIntf `json:"next_hop,omitempty"` + OsArchitecture *BareMetalServerProfileOsArchitecture `json:"os_architecture" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The supported trusted platform module (TPM) modes for this bare metal server profile. + SupportedTrustedPlatformModuleModes *BareMetalServerProfileSupportedTrustedPlatformModuleModes `json:"supported_trusted_platform_module_modes" validate:"required"` } -// Constants associated with the CreateVPCRouteOptions.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to the system's built-in routes -// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound -// routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. +// Constants associated with the BareMetalServerProfile.ResourceType property. +// The resource type. const ( - CreateVPCRouteOptionsActionDelegateConst = "delegate" - CreateVPCRouteOptionsActionDelegateVPCConst = "delegate_vpc" - CreateVPCRouteOptionsActionDeliverConst = "deliver" - CreateVPCRouteOptionsActionDropConst = "drop" + BareMetalServerProfileResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" ) -// NewCreateVPCRouteOptions : Instantiate CreateVPCRouteOptions -func (*VpcV1) NewCreateVPCRouteOptions(vpcID string, destination string, zone ZoneIdentityIntf) *CreateVPCRouteOptions { - return &CreateVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - Destination: core.StringPtr(destination), - Zone: zone, +// UnmarshalBareMetalServerProfile unmarshals an instance of BareMetalServerProfile from the specified map of raw messages. +func UnmarshalBareMetalServerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfile) + err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalBareMetalServerProfileBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu_architecture", &obj.CpuArchitecture, UnmarshalBareMetalServerProfileCpuArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu_core_count", &obj.CpuCoreCount, UnmarshalBareMetalServerProfileCpuCoreCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cpu_socket_count", &obj.CpuSocketCount, UnmarshalBareMetalServerProfileCpuSocketCount) + if err != nil { + return } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalBareMetalServerProfileDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalBareMetalServerProfileMemory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalBareMetalServerProfileOsArchitecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_trusted_platform_module_modes", &obj.SupportedTrustedPlatformModuleModes, UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRouteOptions) SetVPCID(vpcID string) *CreateVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} +// BareMetalServerProfileBandwidth : BareMetalServerProfileBandwidth struct +// Models which "extend" this model: +// - BareMetalServerProfileBandwidthFixed +// - BareMetalServerProfileBandwidthRange +// - BareMetalServerProfileBandwidthEnum +// - BareMetalServerProfileBandwidthDependent +type BareMetalServerProfileBandwidth struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetDestination : Allow user to set Destination -func (_options *CreateVPCRouteOptions) SetDestination(destination string) *CreateVPCRouteOptions { - _options.Destination = core.StringPtr(destination) - return _options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// SetZone : Allow user to set Zone -func (_options *CreateVPCRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRouteOptions { - _options.Zone = zone - return _options -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// SetAction : Allow user to set Action -func (_options *CreateVPCRouteOptions) SetAction(action string) *CreateVPCRouteOptions { - _options.Action = core.StringPtr(action) - return _options -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// SetName : Allow user to set Name -func (_options *CreateVPCRouteOptions) SetName(name string) *CreateVPCRouteOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetNextHop : Allow user to set NextHop -func (_options *CreateVPCRouteOptions) SetNextHop(nextHop RouteNextHopPrototypeIntf) *CreateVPCRouteOptions { - _options.NextHop = nextHop - return _options -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *CreateVPCRouteOptions) SetHeaders(param map[string]string) *CreateVPCRouteOptions { - options.Headers = param - return options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// CreateVPCRoutingTableOptions : The CreateVPCRoutingTable options. -type CreateVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The user-defined name for this routing table. Names must be unique within the VPC the routing table resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from [Direct - // Link](https://cloud.ibm.com/docs/dl/) to this VPC. For this to succeed, the VPC must not already have a routing - // table with this property set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from [Transit - // Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. For this to succeed, the VPC must not already - // have a routing table with this property set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - // - // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled - // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing - // table. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` - - // If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in - // this VPC. For this to succeed, the VPC must not already have a routing table with this property set to `true`. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` - - // The prototype objects for routes to create for this routing table. If unspecified, the routing table will be created - // with no routes. - Routes []RoutePrototype `json:"routes,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the BareMetalServerProfileBandwidth.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthTypeFixedConst = "fixed" +) -// NewCreateVPCRoutingTableOptions : Instantiate CreateVPCRoutingTableOptions -func (*VpcV1) NewCreateVPCRoutingTableOptions(vpcID string) *CreateVPCRoutingTableOptions { - return &CreateVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - } +func (*BareMetalServerProfileBandwidth) isaBareMetalServerProfileBandwidth() bool { + return true } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRoutingTableOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +type BareMetalServerProfileBandwidthIntf interface { + isaBareMetalServerProfileBandwidth() bool } -// SetName : Allow user to set Name -func (_options *CreateVPCRoutingTableOptions) SetName(name string) *CreateVPCRoutingTableOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalBareMetalServerProfileBandwidth unmarshals an instance of BareMetalServerProfileBandwidth from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidth) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRouteDirectLinkIngress : Allow user to set RouteDirectLinkIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteDirectLinkIngress(routeDirectLinkIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteDirectLinkIngress = core.BoolPtr(routeDirectLinkIngress) - return _options -} +// BareMetalServerProfileCpuArchitecture : BareMetalServerProfileCpuArchitecture struct +type BareMetalServerProfileCpuArchitecture struct { + // The default CPU architecture for a bare metal server with this profile. + Default *string `json:"default,omitempty"` -// SetRouteTransitGatewayIngress : Allow user to set RouteTransitGatewayIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteTransitGatewayIngress(routeTransitGatewayIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteTransitGatewayIngress = core.BoolPtr(routeTransitGatewayIngress) - return _options -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetRouteVPCZoneIngress : Allow user to set RouteVPCZoneIngress -func (_options *CreateVPCRoutingTableOptions) SetRouteVPCZoneIngress(routeVPCZoneIngress bool) *CreateVPCRoutingTableOptions { - _options.RouteVPCZoneIngress = core.BoolPtr(routeVPCZoneIngress) - return _options + // The CPU architecture for a bare metal server with this profile. + Value *string `json:"value" validate:"required"` } -// SetRoutes : Allow user to set Routes -func (_options *CreateVPCRoutingTableOptions) SetRoutes(routes []RoutePrototype) *CreateVPCRoutingTableOptions { - _options.Routes = routes - return _options -} +// Constants associated with the BareMetalServerProfileCpuArchitecture.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuArchitectureTypeFixedConst = "fixed" +) -// SetHeaders : Allow user to set Headers -func (options *CreateVPCRoutingTableOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableOptions { - options.Headers = param - return options +// UnmarshalBareMetalServerProfileCpuArchitecture unmarshals an instance of BareMetalServerProfileCpuArchitecture from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CreateVPCRoutingTableRouteOptions : The CreateVPCRoutingTableRoute options. -type CreateVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` +// BareMetalServerProfileCpuCoreCount : BareMetalServerProfileCpuCoreCount struct +// Models which "extend" this model: +// - BareMetalServerProfileCpuCoreCountFixed +// - BareMetalServerProfileCpuCoreCountRange +// - BareMetalServerProfileCpuCoreCountEnum +// - BareMetalServerProfileCpuCoreCountDependent +type BareMetalServerProfileCpuCoreCount struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if - // both routes have an `action` of `deliver` and the - // `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The action to perform with a packet matching the route: - // - `delegate`: delegate to the system's built-in routes - // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - // routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. - // Names must be unique within the VPC routing table the route resides in. - Name *string `json:"name,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, it must be omitted or specified as `0.0.0.0`. - NextHop RouteNextHopPrototypeIntf `json:"next_hop,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the CreateVPCRoutingTableRouteOptions.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to the system's built-in routes -// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound -// routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. +// Constants associated with the BareMetalServerProfileCpuCoreCount.Type property. +// The type for this profile field. const ( - CreateVPCRoutingTableRouteOptionsActionDelegateConst = "delegate" - CreateVPCRoutingTableRouteOptionsActionDelegateVPCConst = "delegate_vpc" - CreateVPCRoutingTableRouteOptionsActionDeliverConst = "deliver" - CreateVPCRoutingTableRouteOptionsActionDropConst = "drop" + BareMetalServerProfileCpuCoreCountTypeFixedConst = "fixed" ) -// NewCreateVPCRoutingTableRouteOptions : Instantiate CreateVPCRoutingTableRouteOptions -func (*VpcV1) NewCreateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, destination string, zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { - return &CreateVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - Destination: core.StringPtr(destination), - Zone: zone, - } +func (*BareMetalServerProfileCpuCoreCount) isaBareMetalServerProfileCpuCoreCount() bool { + return true } -// SetVPCID : Allow user to set VPCID -func (_options *CreateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +type BareMetalServerProfileCpuCoreCountIntf interface { + isaBareMetalServerProfileCpuCoreCount() bool } -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *CreateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *CreateVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} - -// SetDestination : Allow user to set Destination -func (_options *CreateVPCRoutingTableRouteOptions) SetDestination(destination string) *CreateVPCRoutingTableRouteOptions { - _options.Destination = core.StringPtr(destination) - return _options -} - -// SetZone : Allow user to set Zone -func (_options *CreateVPCRoutingTableRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { - _options.Zone = zone - return _options -} - -// SetAction : Allow user to set Action -func (_options *CreateVPCRoutingTableRouteOptions) SetAction(action string) *CreateVPCRoutingTableRouteOptions { - _options.Action = core.StringPtr(action) - return _options -} - -// SetName : Allow user to set Name -func (_options *CreateVPCRoutingTableRouteOptions) SetName(name string) *CreateVPCRoutingTableRouteOptions { - _options.Name = core.StringPtr(name) - return _options -} - -// SetNextHop : Allow user to set NextHop -func (_options *CreateVPCRoutingTableRouteOptions) SetNextHop(nextHop RouteNextHopPrototypeIntf) *CreateVPCRoutingTableRouteOptions { - _options.NextHop = nextHop - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableRouteOptions { - options.Headers = param - return options -} - -// CreateVPNGatewayConnectionOptions : The CreateVPNGatewayConnection options. -type CreateVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection prototype object. - VPNGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf `json:"VPNGatewayConnectionPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVPNGatewayConnectionOptions : Instantiate CreateVPNGatewayConnectionOptions -func (*VpcV1) NewCreateVPNGatewayConnectionOptions(vpnGatewayID string, vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { - return &CreateVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - VPNGatewayConnectionPrototype: vpnGatewayConnectionPrototype, - } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *CreateVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetVPNGatewayConnectionPrototype : Allow user to set VPNGatewayConnectionPrototype -func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPrototype(vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { - _options.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *CreateVPNGatewayConnectionOptions { - options.Headers = param - return options -} - -// CreateVPNGatewayOptions : The CreateVPNGateway options. -type CreateVPNGatewayOptions struct { - // The VPN gateway prototype object. - VPNGatewayPrototype VPNGatewayPrototypeIntf `json:"VPNGatewayPrototype" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewCreateVPNGatewayOptions : Instantiate CreateVPNGatewayOptions -func (*VpcV1) NewCreateVPNGatewayOptions(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { - return &CreateVPNGatewayOptions{ - VPNGatewayPrototype: vpnGatewayPrototype, - } -} - -// SetVPNGatewayPrototype : Allow user to set VPNGatewayPrototype -func (_options *CreateVPNGatewayOptions) SetVPNGatewayPrototype(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { - _options.VPNGatewayPrototype = vpnGatewayPrototype - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *CreateVPNGatewayOptions) SetHeaders(param map[string]string) *CreateVPNGatewayOptions { - options.Headers = param - return options -} - -// DedicatedHost : DedicatedHost struct -type DedicatedHost struct { - // The amount of memory in gibibytes that is currently available for instances. - AvailableMemory *int64 `json:"available_memory" validate:"required"` - - // The available VCPU for the dedicated host. - AvailableVcpu *Vcpu `json:"available_vcpu" validate:"required"` - - // The date and time that the dedicated host was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` - - // Collection of the dedicated host's disks. - Disks []DedicatedHostDisk `json:"disks" validate:"required"` - - // The dedicated host group this dedicated host is in. - Group *DedicatedHostGroupReference `json:"group" validate:"required"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` - - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled" validate:"required"` - - // The instances that are allocated to this dedicated host. - Instances []InstanceReference `json:"instances" validate:"required"` - - // The lifecycle state of the dedicated host. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The total amount of memory in gibibytes for this host. - Memory *int64 `json:"memory" validate:"required"` - - // The unique user-defined name for this dedicated host. - Name *string `json:"name" validate:"required"` - - // The profile this dedicated host uses. - Profile *DedicatedHostProfileReference `json:"profile" validate:"required"` - - // Indicates whether this dedicated host is available for instance creation. - Provisionable *bool `json:"provisionable" validate:"required"` - - // The resource group for this dedicated host. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The total number of sockets for this host. - SocketCount *int64 `json:"socket_count" validate:"required"` - - // The administrative state of the dedicated host. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which - // the unexpected property value was encountered. - State *string `json:"state" validate:"required"` - - // The instance profiles usable by instances placed on this dedicated host. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - // The total VCPU of the dedicated host. - Vcpu *Vcpu `json:"vcpu" validate:"required"` - - // The zone this dedicated host resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the DedicatedHost.LifecycleState property. -// The lifecycle state of the dedicated host. -const ( - DedicatedHostLifecycleStateDeletingConst = "deleting" - DedicatedHostLifecycleStateFailedConst = "failed" - DedicatedHostLifecycleStatePendingConst = "pending" - DedicatedHostLifecycleStateStableConst = "stable" - DedicatedHostLifecycleStateSuspendedConst = "suspended" - DedicatedHostLifecycleStateUpdatingConst = "updating" - DedicatedHostLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the DedicatedHost.ResourceType property. -// The resource type. -const ( - DedicatedHostResourceTypeDedicatedHostConst = "dedicated_host" -) - -// Constants associated with the DedicatedHost.State property. -// The administrative state of the dedicated host. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which -// the unexpected property value was encountered. -const ( - DedicatedHostStateAvailableConst = "available" - DedicatedHostStateDegradedConst = "degraded" - DedicatedHostStateMigratingConst = "migrating" - DedicatedHostStateUnavailableConst = "unavailable" -) - -// UnmarshalDedicatedHost unmarshals an instance of DedicatedHost from the specified map of raw messages. -func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHost) - err = core.UnmarshalPrimitive(m, "available_memory", &obj.AvailableMemory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "available_vcpu", &obj.AvailableVcpu, UnmarshalVcpu) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) +// UnmarshalBareMetalServerProfileCpuCoreCount unmarshals an instance of BareMetalServerProfileCpuCoreCount from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstanceReference) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileReference) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileCpuSocketCount : BareMetalServerProfileCpuSocketCount struct +// Models which "extend" this model: +// - BareMetalServerProfileCpuSocketCountFixed +// - BareMetalServerProfileCpuSocketCountRange +// - BareMetalServerProfileCpuSocketCountEnum +// - BareMetalServerProfileCpuSocketCountDependent +type BareMetalServerProfileCpuSocketCount struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the BareMetalServerProfileCpuSocketCount.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuSocketCountTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileCpuSocketCount) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +type BareMetalServerProfileCpuSocketCountIntf interface { + isaBareMetalServerProfileCpuSocketCount() bool +} + +// UnmarshalBareMetalServerProfileCpuSocketCount unmarshals an instance of BareMetalServerProfileCpuSocketCount from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "state", &obj.State) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalVcpu) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -21480,41 +21487,41 @@ func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (e return } -// DedicatedHostCollection : DedicatedHostCollection struct -type DedicatedHostCollection struct { - // Collection of dedicated hosts. - DedicatedHosts []DedicatedHost `json:"dedicated_hosts" validate:"required"` - +// BareMetalServerProfileCollection : BareMetalServerProfileCollection struct +type BareMetalServerProfileCollection struct { // A link to the first page of resources. - First *DedicatedHostCollectionFirst `json:"first" validate:"required"` + First *BareMetalServerProfileCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *DedicatedHostCollectionNext `json:"next,omitempty"` + Next *BareMetalServerProfileCollectionNext `json:"next,omitempty"` + + // Collection of bare metal server profiles. + Profiles []BareMetalServerProfile `json:"profiles" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalDedicatedHostCollection unmarshals an instance of DedicatedHostCollection from the specified map of raw messages. -func UnmarshalDedicatedHostCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollection) - err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHost) +// UnmarshalBareMetalServerProfileCollection unmarshals an instance of BareMetalServerProfileCollection from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalBareMetalServerProfileCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostCollectionFirst) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalBareMetalServerProfileCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostCollectionNext) + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalBareMetalServerProfile) if err != nil { return } @@ -21527,7 +21534,7 @@ func UnmarshalDedicatedHostCollection(m map[string]json.RawMessage, result inter } // Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostCollection) GetNextStart() (*string, error) { +func (resp *BareMetalServerProfileCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -21538,15 +21545,15 @@ func (resp *DedicatedHostCollection) GetNextStart() (*string, error) { return start, nil } -// DedicatedHostCollectionFirst : A link to the first page of resources. -type DedicatedHostCollectionFirst struct { +// BareMetalServerProfileCollectionFirst : A link to the first page of resources. +type BareMetalServerProfileCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalDedicatedHostCollectionFirst unmarshals an instance of DedicatedHostCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollectionFirst) +// UnmarshalBareMetalServerProfileCollectionFirst unmarshals an instance of BareMetalServerProfileCollectionFirst from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -21555,15 +21562,15 @@ func UnmarshalDedicatedHostCollectionFirst(m map[string]json.RawMessage, result return } -// DedicatedHostCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostCollectionNext struct { +// BareMetalServerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type BareMetalServerProfileCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalDedicatedHostCollectionNext unmarshals an instance of DedicatedHostCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostCollectionNext) +// UnmarshalBareMetalServerProfileCollectionNext unmarshals an instance of BareMetalServerProfileCollectionNext from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -21572,136 +21579,183 @@ func UnmarshalDedicatedHostCollectionNext(m map[string]json.RawMessage, result i return } -// DedicatedHostDisk : DedicatedHostDisk struct -type DedicatedHostDisk struct { - // The remaining space left for instance placement in GB (gigabytes). - Available *int64 `json:"available" validate:"required"` - - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// BareMetalServerProfileDisk : Disks provided by this profile. +type BareMetalServerProfileDisk struct { + Quantity BareMetalServerProfileDiskQuantityIntf `json:"quantity" validate:"required"` - // The URL for this disk. - Href *string `json:"href" validate:"required"` + Size BareMetalServerProfileDiskSizeIntf `json:"size" validate:"required"` - // The unique identifier for this disk. - ID *string `json:"id" validate:"required"` + SupportedInterfaceTypes *BareMetalServerProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` +} - // Instance disks that are on this dedicated host disk. - InstanceDisks []InstanceDiskReference `json:"instance_disks" validate:"required"` +// UnmarshalBareMetalServerProfileDisk unmarshals an instance of BareMetalServerProfileDisk from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDisk) + err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalBareMetalServerProfileDiskQuantity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalBareMetalServerProfileDiskSize) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalBareMetalServerProfileDiskSupportedInterfaces) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The disk interface used for attaching the disk - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` +// BareMetalServerProfileDiskQuantity : BareMetalServerProfileDiskQuantity struct +// Models which "extend" this model: +// - BareMetalServerProfileDiskQuantityFixed +// - BareMetalServerProfileDiskQuantityRange +// - BareMetalServerProfileDiskQuantityEnum +// - BareMetalServerProfileDiskQuantityDependent +type BareMetalServerProfileDiskQuantity struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The lifecycle state of this dedicated host disk. - LifecycleState *string `json:"lifecycle_state,omitempty"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The user-defined or system-provided name for this disk. - Name *string `json:"name" validate:"required"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Indicates whether this dedicated host disk is available for instance disk creation. - Provisionable *bool `json:"provisionable" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // The instance disk interfaces supported for this dedicated host disk. - SupportedInstanceInterfaceTypes []string `json:"supported_instance_interface_types" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the DedicatedHostDisk.InterfaceType property. -// The disk interface used for attaching the disk -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostDiskInterfaceTypeNvmeConst = "nvme" -) - -// Constants associated with the DedicatedHostDisk.LifecycleState property. -// The lifecycle state of this dedicated host disk. +// Constants associated with the BareMetalServerProfileDiskQuantity.Type property. +// The type for this profile field. const ( - DedicatedHostDiskLifecycleStateDeletingConst = "deleting" - DedicatedHostDiskLifecycleStateFailedConst = "failed" - DedicatedHostDiskLifecycleStatePendingConst = "pending" - DedicatedHostDiskLifecycleStateStableConst = "stable" - DedicatedHostDiskLifecycleStateSuspendedConst = "suspended" - DedicatedHostDiskLifecycleStateUpdatingConst = "updating" - DedicatedHostDiskLifecycleStateWaitingConst = "waiting" + BareMetalServerProfileDiskQuantityTypeFixedConst = "fixed" ) -// Constants associated with the DedicatedHostDisk.ResourceType property. -// The resource type. -const ( - DedicatedHostDiskResourceTypeDedicatedHostDiskConst = "dedicated_host_disk" -) +func (*BareMetalServerProfileDiskQuantity) isaBareMetalServerProfileDiskQuantity() bool { + return true +} -// Constants associated with the DedicatedHostDisk.SupportedInstanceInterfaceTypes property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostDiskSupportedInstanceInterfaceTypesNvmeConst = "nvme" - DedicatedHostDiskSupportedInstanceInterfaceTypesVirtioBlkConst = "virtio_blk" -) +type BareMetalServerProfileDiskQuantityIntf interface { + isaBareMetalServerProfileDiskQuantity() bool +} -// UnmarshalDedicatedHostDisk unmarshals an instance of DedicatedHostDisk from the specified map of raw messages. -func UnmarshalDedicatedHostDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDisk) - err = core.UnmarshalPrimitive(m, "available", &obj.Available) +// UnmarshalBareMetalServerProfileDiskQuantity unmarshals an instance of BareMetalServerProfileDiskQuantity from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "instance_disks", &obj.InstanceDisks, UnmarshalInstanceDiskReference) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileDiskSize : BareMetalServerProfileDiskSize struct +// Models which "extend" this model: +// - BareMetalServerProfileDiskSizeFixed +// - BareMetalServerProfileDiskSizeRange +// - BareMetalServerProfileDiskSizeEnum +// - BareMetalServerProfileDiskSizeDependent +type BareMetalServerProfileDiskSize struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` + + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the BareMetalServerProfileDiskSize.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileDiskSize) isaBareMetalServerProfileDiskSize() bool { + return true +} + +type BareMetalServerProfileDiskSizeIntf interface { + isaBareMetalServerProfileDiskSize() bool +} + +// UnmarshalBareMetalServerProfileDiskSize unmarshals an instance of BareMetalServerProfileDiskSize from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSize) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -21709,151 +21763,62 @@ func UnmarshalDedicatedHostDisk(m map[string]json.RawMessage, result interface{} return } -// DedicatedHostDiskCollection : DedicatedHostDiskCollection struct -type DedicatedHostDiskCollection struct { - // Collection of the dedicated host's disks. - Disks []DedicatedHostDisk `json:"disks" validate:"required"` -} - -// UnmarshalDedicatedHostDiskCollection unmarshals an instance of DedicatedHostDiskCollection from the specified map of raw messages. -func UnmarshalDedicatedHostDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostDiskPatch : DedicatedHostDiskPatch struct -type DedicatedHostDiskPatch struct { - // The user-defined name for this disk. - Name *string `json:"name,omitempty"` -} +// BareMetalServerProfileDiskSupportedInterfaces : BareMetalServerProfileDiskSupportedInterfaces struct +type BareMetalServerProfileDiskSupportedInterfaces struct { + // The disk interface used for attaching the disk. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Default *string `json:"default" validate:"required"` -// UnmarshalDedicatedHostDiskPatch unmarshals an instance of DedicatedHostDiskPatch from the specified map of raw messages. -func UnmarshalDedicatedHostDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// AsPatch returns a generic map representation of the DedicatedHostDiskPatch -func (dedicatedHostDiskPatch *DedicatedHostDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return + // The supported disk interfaces used for attaching the disk. + Values []string `json:"values" validate:"required"` } -// DedicatedHostGroup : DedicatedHostGroup struct -type DedicatedHostGroup struct { - // The dedicated host profile class for hosts in this group. - Class *string `json:"class" validate:"required"` - - // The date and time that the dedicated host group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // The dedicated hosts that are in this dedicated host group. - DedicatedHosts []DedicatedHostReference `json:"dedicated_hosts" validate:"required"` - - // The dedicated host profile family for hosts in this group. - Family *string `json:"family" validate:"required"` - - // The URL for this dedicated host group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` - - // The unique user-defined name for this dedicated host group. - Name *string `json:"name" validate:"required"` - - // The resource group for this dedicated host group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The instance profiles usable by instances placed on this dedicated host group. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - // The zone this dedicated host group resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} +// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Default property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" + BareMetalServerProfileDiskSupportedInterfacesDefaultSataConst = "sata" +) -// Constants associated with the DedicatedHostGroup.Family property. -// The dedicated host profile family for hosts in this group. +// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Type property. +// The type for this profile field. const ( - DedicatedHostGroupFamilyBalancedConst = "balanced" - DedicatedHostGroupFamilyComputeConst = "compute" - DedicatedHostGroupFamilyMemoryConst = "memory" + BareMetalServerProfileDiskSupportedInterfacesTypeEnumConst = "enum" ) -// Constants associated with the DedicatedHostGroup.ResourceType property. -// The resource type. +// Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Values property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. const ( - DedicatedHostGroupResourceTypeDedicatedHostGroupConst = "dedicated_host_group" + BareMetalServerProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" + BareMetalServerProfileDiskSupportedInterfacesValuesSataConst = "sata" ) -// UnmarshalDedicatedHostGroup unmarshals an instance of DedicatedHostGroup from the specified map of raw messages. -func UnmarshalDedicatedHostGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroup) - err = core.UnmarshalPrimitive(m, "class", &obj.Class) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHostReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) +// UnmarshalBareMetalServerProfileDiskSupportedInterfaces unmarshals an instance of BareMetalServerProfileDiskSupportedInterfaces from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -21861,90 +21826,33 @@ func UnmarshalDedicatedHostGroup(m map[string]json.RawMessage, result interface{ return } -// DedicatedHostGroupCollection : DedicatedHostGroupCollection struct -type DedicatedHostGroupCollection struct { - // A link to the first page of resources. - First *DedicatedHostGroupCollectionFirst `json:"first" validate:"required"` - - // Collection of dedicated host groups. - Groups []DedicatedHostGroup `json:"groups" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostGroupCollectionNext `json:"next,omitempty"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} +// BareMetalServerProfileIdentity : Identifies a bare metal server profile by a unique property. +// Models which "extend" this model: +// - BareMetalServerProfileIdentityByName +// - BareMetalServerProfileIdentityByHref +type BareMetalServerProfileIdentity struct { + // The name for this bare metal server profile. + Name *string `json:"name,omitempty"` -// UnmarshalDedicatedHostGroupCollection unmarshals an instance of DedicatedHostGroupCollection from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "groups", &obj.Groups, UnmarshalDedicatedHostGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The URL for this bare metal server profile. + Href *string `json:"href,omitempty"` } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +func (*BareMetalServerProfileIdentity) isaBareMetalServerProfileIdentity() bool { + return true } -// DedicatedHostGroupCollectionFirst : A link to the first page of resources. -type DedicatedHostGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +type BareMetalServerProfileIdentityIntf interface { + isaBareMetalServerProfileIdentity() bool } -// UnmarshalDedicatedHostGroupCollectionFirst unmarshals an instance of DedicatedHostGroupCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBareMetalServerProfileIdentity unmarshals an instance of BareMetalServerProfileIdentity from the specified map of raw messages. +func UnmarshalBareMetalServerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalDedicatedHostGroupCollectionNext unmarshals an instance of DedicatedHostGroupCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -21953,59 +21861,77 @@ func UnmarshalDedicatedHostGroupCollectionNext(m map[string]json.RawMessage, res return } -// DedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// BareMetalServerProfileMemory : BareMetalServerProfileMemory struct // Models which "extend" this model: -// - DedicatedHostGroupIdentityByID -// - DedicatedHostGroupIdentityByCRN -// - DedicatedHostGroupIdentityByHref -type DedicatedHostGroupIdentity struct { - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` +// - BareMetalServerProfileMemoryFixed +// - BareMetalServerProfileMemoryRange +// - BareMetalServerProfileMemoryEnum +// - BareMetalServerProfileMemoryDependent +type BareMetalServerProfileMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -func (*DedicatedHostGroupIdentity) isaDedicatedHostGroupIdentity() bool { +// Constants associated with the BareMetalServerProfileMemory.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileMemory) isaBareMetalServerProfileMemory() bool { return true } -type DedicatedHostGroupIdentityIntf interface { - isaDedicatedHostGroupIdentity() bool +type BareMetalServerProfileMemoryIntf interface { + isaBareMetalServerProfileMemory() bool } -// UnmarshalDedicatedHostGroupIdentity unmarshals an instance of DedicatedHostGroupIdentity from the specified map of raw messages. -func UnmarshalDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalBareMetalServerProfileMemory unmarshals an instance of BareMetalServerProfileMemory from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// DedicatedHostGroupPatch : DedicatedHostGroupPatch struct -type DedicatedHostGroupPatch struct { - // The unique user-defined name for this dedicated host group. - Name *string `json:"name,omitempty"` -} - -// UnmarshalDedicatedHostGroupPatch unmarshals an instance of DedicatedHostGroupPatch from the specified map of raw messages. -func UnmarshalDedicatedHostGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -22013,33 +21939,36 @@ func UnmarshalDedicatedHostGroupPatch(m map[string]json.RawMessage, result inter return } -// AsPatch returns a generic map representation of the DedicatedHostGroupPatch -func (dedicatedHostGroupPatch *DedicatedHostGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// BareMetalServerProfileOsArchitecture : BareMetalServerProfileOsArchitecture struct +type BareMetalServerProfileOsArchitecture struct { + // The default OS architecture for a bare metal server with this profile. + Default *string `json:"default" validate:"required"` -// DedicatedHostGroupPrototypeDedicatedHostByZoneContext : DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct -type DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct { - // The unique user-defined name for this dedicated host group. - Name *string `json:"name,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The resource group to use. If unspecified, the host's resource group is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The supported OS architecture(s) for a bare metal server with this profile. + Values []string `json:"values" validate:"required"` } -// UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext unmarshals an instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext from the specified map of raw messages. -func UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupPrototypeDedicatedHostByZoneContext) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// Constants associated with the BareMetalServerProfileOsArchitecture.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileOsArchitectureTypeEnumConst = "enum" +) + +// UnmarshalBareMetalServerProfileOsArchitecture unmarshals an instance of BareMetalServerProfileOsArchitecture from the specified map of raw messages. +func UnmarshalBareMetalServerProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileOsArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -22047,53 +21976,31 @@ func UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(m map[string return } -// DedicatedHostGroupReference : DedicatedHostGroupReference struct -type DedicatedHostGroupReference struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host group. +// BareMetalServerProfileReference : BareMetalServerProfileReference struct +type BareMetalServerProfileReference struct { + // The URL for this bare metal server profile. Href *string `json:"href" validate:"required"` - // The unique identifier for this dedicated host group. - ID *string `json:"id" validate:"required"` - - // The unique user-defined name for this dedicated host group. + // The name for this bare metal server profile. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the DedicatedHostGroupReference.ResourceType property. +// Constants associated with the BareMetalServerProfileReference.ResourceType property. // The resource type. const ( - DedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" + BareMetalServerProfileReferenceResourceTypeBareMetalServerProfileConst = "bare_metal_server_profile" ) -// UnmarshalDedicatedHostGroupReference unmarshals an instance of DedicatedHostGroupReference from the specified map of raw messages. -func UnmarshalDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } +// UnmarshalBareMetalServerProfileReference unmarshals an instance of BareMetalServerProfileReference from the specified map of raw messages. +func UnmarshalBareMetalServerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -22106,17 +22013,42 @@ func UnmarshalDedicatedHostGroupReference(m map[string]json.RawMessage, result i return } -// DedicatedHostGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type DedicatedHostGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// BareMetalServerProfileSupportedTrustedPlatformModuleModes : The supported trusted platform module (TPM) modes for this bare metal server profile. +type BareMetalServerProfileSupportedTrustedPlatformModuleModes struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported trusted platform module (TPM) modes. + Values []string `json:"values" validate:"required"` } -// UnmarshalDedicatedHostGroupReferenceDeleted unmarshals an instance of DedicatedHostGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileSupportedTrustedPlatformModuleModesTypeEnumConst = "enum" +) + +// Constants associated with the BareMetalServerProfileSupportedTrustedPlatformModuleModes.Values property. +// The mode for the trusted platform module (TPM): +// - `tpm_2`: Standard TPM 2 capabilities +// - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT) +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesTpm2Const = "tpm_2" + BareMetalServerProfileSupportedTrustedPlatformModuleModesValuesTpm2WithTxtConst = "tpm_2_with_txt" +) + +// UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes unmarshals an instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes from the specified map of raw messages. +func UnmarshalBareMetalServerProfileSupportedTrustedPlatformModuleModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileSupportedTrustedPlatformModuleModes) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -22124,125 +22056,137 @@ func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, r return } -// DedicatedHostPatch : DedicatedHostPatch struct -type DedicatedHostPatch struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` +// BareMetalServerStatusReason : BareMetalServerStatusReason struct +type BareMetalServerStatusReason struct { + // The status reason code: + // - `cannot_start`: Failed to start due to an internal error + // - `cannot_start_capacity`: Insufficient capacity within the selected zone + // - `cannot_start_compute`: An error occurred while allocating compute resources + // - `cannot_start_ip_address`: An error occurred while allocating an IP address + // - `cannot_start_network`: An error occurred while allocating network resources. + Code *string `json:"code" validate:"required"` - // The unique user-defined name for this dedicated host. - Name *string `json:"name,omitempty"` + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -// UnmarshalDedicatedHostPatch unmarshals an instance of DedicatedHostPatch from the specified map of raw messages. -func UnmarshalDedicatedHostPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPatch) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) +// Constants associated with the BareMetalServerStatusReason.Code property. +// The status reason code: +// - `cannot_start`: Failed to start due to an internal error +// - `cannot_start_capacity`: Insufficient capacity within the selected zone +// - `cannot_start_compute`: An error occurred while allocating compute resources +// - `cannot_start_ip_address`: An error occurred while allocating an IP address +// - `cannot_start_network`: An error occurred while allocating network resources. +const ( + BareMetalServerStatusReasonCodeCannotStartConst = "cannot_start" + BareMetalServerStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" + BareMetalServerStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" + BareMetalServerStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" + BareMetalServerStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" +) + +// UnmarshalBareMetalServerStatusReason unmarshals an instance of BareMetalServerStatusReason from the specified map of raw messages. +func UnmarshalBareMetalServerStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the DedicatedHostPatch -func (dedicatedHostPatch *DedicatedHostPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(dedicatedHostPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// DedicatedHostProfile : DedicatedHostProfile struct -type DedicatedHostProfile struct { - // The product class this dedicated host profile belongs to. - Class *string `json:"class" validate:"required"` - - // Collection of the dedicated host profile's disks. - Disks []DedicatedHostProfileDisk `json:"disks" validate:"required"` +// BareMetalServerTrustedPlatformModule : BareMetalServerTrustedPlatformModule struct +type BareMetalServerTrustedPlatformModule struct { + // Indicates whether the trusted platform module (TPM) is enabled. If enabled, `mode` will also be set. + Enabled *bool `json:"enabled" validate:"required"` - // The product family this dedicated host profile belongs to + // The mode for the trusted platform module (TPM): + // - `tpm_2`: Standard TPM 2 capabilities + // - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT) // // The enumerated values for this property are expected to expand in the future. When processing this property, check // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the // unexpected property value was encountered. - Family *string `json:"family" validate:"required"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - Memory DedicatedHostProfileMemoryIntf `json:"memory" validate:"required"` - - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` - - SocketCount DedicatedHostProfileSocketIntf `json:"socket_count" validate:"required"` - - // The instance profiles usable by instances placed on dedicated hosts with this profile. - SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - - VcpuArchitecture *DedicatedHostProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` - - VcpuCount DedicatedHostProfileVcpuIntf `json:"vcpu_count" validate:"required"` + Mode *string `json:"mode,omitempty"` } -// Constants associated with the DedicatedHostProfile.Family property. -// The product family this dedicated host profile belongs to +// Constants associated with the BareMetalServerTrustedPlatformModule.Mode property. +// The mode for the trusted platform module (TPM): +// - `tpm_2`: Standard TPM 2 capabilities +// - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT) // // The enumerated values for this property are expected to expand in the future. When processing this property, check // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the // unexpected property value was encountered. const ( - DedicatedHostProfileFamilyBalancedConst = "balanced" - DedicatedHostProfileFamilyComputeConst = "compute" - DedicatedHostProfileFamilyMemoryConst = "memory" + BareMetalServerTrustedPlatformModuleModeTpm2Const = "tpm_2" + BareMetalServerTrustedPlatformModuleModeTpm2WithTxtConst = "tpm_2_with_txt" ) -// UnmarshalDedicatedHostProfile unmarshals an instance of DedicatedHostProfile from the specified map of raw messages. -func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfile) - err = core.UnmarshalPrimitive(m, "class", &obj.Class) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostProfileDisk) +// UnmarshalBareMetalServerTrustedPlatformModule unmarshals an instance of BareMetalServerTrustedPlatformModule from the specified map of raw messages. +func UnmarshalBareMetalServerTrustedPlatformModule(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerTrustedPlatformModule) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) if err != nil { return } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CertificateInstanceIdentity : Identifies a certificate instance by a unique property. +// Models which "extend" this model: +// - CertificateInstanceIdentityByCRN +type CertificateInstanceIdentity struct { + // The CRN for this certificate instance. + CRN *string `json:"crn,omitempty"` +} + +func (*CertificateInstanceIdentity) isaCertificateInstanceIdentity() bool { + return true +} + +type CertificateInstanceIdentityIntf interface { + isaCertificateInstanceIdentity() bool +} + +// UnmarshalCertificateInstanceIdentity unmarshals an instance of CertificateInstanceIdentity from the specified map of raw messages. +func UnmarshalCertificateInstanceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CertificateInstanceIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalDedicatedHostProfileMemory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "socket_count", &obj.SocketCount, UnmarshalDedicatedHostProfileSocket) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalDedicatedHostProfileVcpuArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalDedicatedHostProfileVcpu) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CertificateInstanceReference : CertificateInstanceReference struct +type CertificateInstanceReference struct { + // The CRN for this certificate instance. + CRN *string `json:"crn" validate:"required"` +} + +// UnmarshalCertificateInstanceReference unmarshals an instance of CertificateInstanceReference from the specified map of raw messages. +func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CertificateInstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -22250,201 +22194,142 @@ func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interfac return } -// DedicatedHostProfileCollection : DedicatedHostProfileCollection struct -type DedicatedHostProfileCollection struct { - // A link to the first page of resources. - First *DedicatedHostProfileCollectionFirst `json:"first" validate:"required"` +// CheckVPNGatewayConnectionLocalCIDROptions : The CheckVPNGatewayConnectionLocalCIDR options. +type CheckVPNGatewayConnectionLocalCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *DedicatedHostProfileCollectionNext `json:"next,omitempty"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - // Collection of dedicated host profiles. - Profiles []DedicatedHostProfile `json:"profiles" validate:"required"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostProfileCollection unmarshals an instance of DedicatedHostProfileCollection from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostProfileCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostProfileCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalDedicatedHostProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewCheckVPNGatewayConnectionLocalCIDROptions : Instantiate CheckVPNGatewayConnectionLocalCIDROptions +func (*VpcV1) NewCheckVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { + return &CheckVPNGatewayConnectionLocalCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *DedicatedHostProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options } -// DedicatedHostProfileCollectionFirst : A link to the first page of resources. -type DedicatedHostProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetID(id string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalDedicatedHostProfileCollectionFirst unmarshals an instance of DedicatedHostProfileCollectionFirst from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) + return _options } -// DedicatedHostProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type DedicatedHostProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetPrefixLength : Allow user to set PrefixLength +func (_options *CheckVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionLocalCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) + return _options } -// UnmarshalDedicatedHostProfileCollectionNext unmarshals an instance of DedicatedHostProfileCollectionNext from the specified map of raw messages. -func UnmarshalDedicatedHostProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CheckVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionLocalCIDROptions { + options.Headers = param + return options } -// DedicatedHostProfileDisk : Disks provided by this profile. -type DedicatedHostProfileDisk struct { - InterfaceType *DedicatedHostProfileDiskInterface `json:"interface_type" validate:"required"` +// CheckVPNGatewayConnectionPeerCIDROptions : The CheckVPNGatewayConnectionPeerCIDR options. +type CheckVPNGatewayConnectionPeerCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // The number of disks of this type for a dedicated host with this profile. - Quantity *DedicatedHostProfileDiskQuantity `json:"quantity" validate:"required"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // The size of the disk in GB (gigabytes). - Size *DedicatedHostProfileDiskSize `json:"size" validate:"required"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - SupportedInstanceInterfaceTypes *DedicatedHostProfileDiskSupportedInterfaces `json:"supported_instance_interface_types" validate:"required"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostProfileDisk unmarshals an instance of DedicatedHostProfileDisk from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDisk) - err = core.UnmarshalModel(m, "interface_type", &obj.InterfaceType, UnmarshalDedicatedHostProfileDiskInterface) - if err != nil { - return - } - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalDedicatedHostProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalDedicatedHostProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes, UnmarshalDedicatedHostProfileDiskSupportedInterfaces) - if err != nil { - return +// NewCheckVPNGatewayConnectionPeerCIDROptions : Instantiate CheckVPNGatewayConnectionPeerCIDROptions +func (*VpcV1) NewCheckVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { + return &CheckVPNGatewayConnectionPeerCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostProfileDiskInterface : DedicatedHostProfileDiskInterface struct -type DedicatedHostProfileDiskInterface struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} - // The interface of the disk for a dedicated host with this profile - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Value *string `json:"value" validate:"required"` +// SetID : Allow user to set ID +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetID(id string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.ID = core.StringPtr(id) + return _options } -// Constants associated with the DedicatedHostProfileDiskInterface.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskInterfaceTypeFixedConst = "fixed" -) +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) + return _options +} -// Constants associated with the DedicatedHostProfileDiskInterface.Value property. -// The interface of the disk for a dedicated host with this profile -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - DedicatedHostProfileDiskInterfaceValueNvmeConst = "nvme" -) +// SetPrefixLength : Allow user to set PrefixLength +func (_options *CheckVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *CheckVPNGatewayConnectionPeerCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) + return _options +} -// UnmarshalDedicatedHostProfileDiskInterface unmarshals an instance of DedicatedHostProfileDiskInterface from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskInterface) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CheckVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayConnectionPeerCIDROptions { + options.Headers = param + return options } -// DedicatedHostProfileDiskQuantity : The number of disks of this type for a dedicated host with this profile. -type DedicatedHostProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// CloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. +// Models which "extend" this model: +// - CloudObjectStorageBucketIdentityByName +type CloudObjectStorageBucketIdentity struct { + // The globally unique name of this COS bucket. + Name *string `json:"name,omitempty"` +} - // The value for this profile field. - Value *int64 `json:"value" validate:"required"` +func (*CloudObjectStorageBucketIdentity) isaCloudObjectStorageBucketIdentity() bool { + return true } -// Constants associated with the DedicatedHostProfileDiskQuantity.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskQuantityTypeFixedConst = "fixed" -) +type CloudObjectStorageBucketIdentityIntf interface { + isaCloudObjectStorageBucketIdentity() bool +} -// UnmarshalDedicatedHostProfileDiskQuantity unmarshals an instance of DedicatedHostProfileDiskQuantity from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalCloudObjectStorageBucketIdentity unmarshals an instance of CloudObjectStorageBucketIdentity from the specified map of raw messages. +func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageBucketIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -22452,29 +22337,16 @@ func UnmarshalDedicatedHostProfileDiskQuantity(m map[string]json.RawMessage, res return } -// DedicatedHostProfileDiskSize : The size of the disk in GB (gigabytes). -type DedicatedHostProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The size of the disk in GB (gigabytes). - Value *int64 `json:"value" validate:"required"` +// CloudObjectStorageBucketReference : CloudObjectStorageBucketReference struct +type CloudObjectStorageBucketReference struct { + // The globally unique name of this COS bucket. + Name *string `json:"name" validate:"required"` } -// Constants associated with the DedicatedHostProfileDiskSize.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskSizeTypeFixedConst = "fixed" -) - -// UnmarshalDedicatedHostProfileDiskSize unmarshals an instance of DedicatedHostProfileDiskSize from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalCloudObjectStorageBucketReference unmarshals an instance of CloudObjectStorageBucketReference from the specified map of raw messages. +func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(CloudObjectStorageBucketReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -22482,2873 +22354,3157 @@ func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result return } -// DedicatedHostProfileDiskSupportedInterfaces : DedicatedHostProfileDiskSupportedInterfaces struct -type DedicatedHostProfileDiskSupportedInterfaces struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// CreateBareMetalServerConsoleAccessTokenOptions : The CreateBareMetalServerConsoleAccessToken options. +type CreateBareMetalServerConsoleAccessTokenOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The instance disk interfaces supported for a dedicated host with this profile. - Value []string `json:"value" validate:"required"` -} + // The bare metal server console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` -// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileDiskSupportedInterfacesTypeFixedConst = "fixed" -) + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force,omitempty"` -// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Value property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the CreateBareMetalServerConsoleAccessTokenOptions.ConsoleType property. +// The bare metal server console type for which this token may be used. const ( - DedicatedHostProfileDiskSupportedInterfacesValueNvmeConst = "nvme" - DedicatedHostProfileDiskSupportedInterfacesValueVirtioBlkConst = "virtio_blk" + CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" + CreateBareMetalServerConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" ) -// UnmarshalDedicatedHostProfileDiskSupportedInterfaces unmarshals an instance of DedicatedHostProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalDedicatedHostProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return +// NewCreateBareMetalServerConsoleAccessTokenOptions : Instantiate CreateBareMetalServerConsoleAccessTokenOptions +func (*VpcV1) NewCreateBareMetalServerConsoleAccessTokenOptions(bareMetalServerID string, consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { + return &CreateBareMetalServerConsoleAccessTokenOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ConsoleType: core.StringPtr(consoleType), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostProfileIdentity : Identifies a dedicated host profile by a unique property. -// Models which "extend" this model: -// - DedicatedHostProfileIdentityByName -// - DedicatedHostProfileIdentityByHref -type DedicatedHostProfileIdentity struct { - // The globally unique name for this dedicated host profile. - Name *string `json:"name,omitempty"` - - // The URL for this dedicated host profile. - Href *string `json:"href,omitempty"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerConsoleAccessTokenOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -func (*DedicatedHostProfileIdentity) isaDedicatedHostProfileIdentity() bool { - return true +// SetConsoleType : Allow user to set ConsoleType +func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateBareMetalServerConsoleAccessTokenOptions { + _options.ConsoleType = core.StringPtr(consoleType) + return _options } -type DedicatedHostProfileIdentityIntf interface { - isaDedicatedHostProfileIdentity() bool +// SetForce : Allow user to set Force +func (_options *CreateBareMetalServerConsoleAccessTokenOptions) SetForce(force bool) *CreateBareMetalServerConsoleAccessTokenOptions { + _options.Force = core.BoolPtr(force) + return _options } -// UnmarshalDedicatedHostProfileIdentity unmarshals an instance of DedicatedHostProfileIdentity from the specified map of raw messages. -func UnmarshalDedicatedHostProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateBareMetalServerConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateBareMetalServerConsoleAccessTokenOptions { + options.Headers = param + return options } -// DedicatedHostProfileMemory : DedicatedHostProfileMemory struct -// Models which "extend" this model: -// - DedicatedHostProfileMemoryFixed -// - DedicatedHostProfileMemoryRange -// - DedicatedHostProfileMemoryEnum -// - DedicatedHostProfileMemoryDependent -type DedicatedHostProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// CreateBareMetalServerNetworkInterfaceOptions : The CreateBareMetalServerNetworkInterface options. +type CreateBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The network interface prototype object. + BareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf `json:"BareMetalServerNetworkInterfacePrototype" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostProfileMemory.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileMemoryTypeFixedConst = "fixed" -) +// NewCreateBareMetalServerNetworkInterfaceOptions : Instantiate CreateBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewCreateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { + return &CreateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + BareMetalServerNetworkInterfacePrototype: bareMetalServerNetworkInterfacePrototype, + } +} -func (*DedicatedHostProfileMemory) isaDedicatedHostProfileMemory() bool { - return true +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *CreateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -type DedicatedHostProfileMemoryIntf interface { - isaDedicatedHostProfileMemory() bool +// SetBareMetalServerNetworkInterfacePrototype : Allow user to set BareMetalServerNetworkInterfacePrototype +func (_options *CreateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototype BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerNetworkInterfacePrototype = bareMetalServerNetworkInterfacePrototype + return _options } -// UnmarshalDedicatedHostProfileMemory unmarshals an instance of DedicatedHostProfileMemory from the specified map of raw messages. -func UnmarshalDedicatedHostProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateBareMetalServerNetworkInterfaceOptions { + options.Headers = param + return options } -// DedicatedHostProfileReference : DedicatedHostProfileReference struct -type DedicatedHostProfileReference struct { - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` +// CreateBareMetalServerOptions : The CreateBareMetalServer options. +type CreateBareMetalServerOptions struct { + Initialization *BareMetalServerInitializationPrototype `json:"initialization" validate:"required"` - // The globally unique name for this dedicated host profile. - Name *string `json:"name" validate:"required"` -} + // Primary network interface for the bare metal server. + PrimaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` -// UnmarshalDedicatedHostProfileReference unmarshals an instance of DedicatedHostProfileReference from the specified map of raw messages. -func UnmarshalDedicatedHostProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The profile to use for this bare metal server. + Profile BareMetalServerProfileIdentityIntf `json:"profile" validate:"required"` -// DedicatedHostProfileSocket : DedicatedHostProfileSocket struct -// Models which "extend" this model: -// - DedicatedHostProfileSocketFixed -// - DedicatedHostProfileSocketRange -// - DedicatedHostProfileSocketEnum -// - DedicatedHostProfileSocketDependent -type DedicatedHostProfileSocket struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` + // The zone this bare metal server will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The unique user-defined name for this bare metal server (and default system hostname). If unspecified, the name will + // be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The additional network interfaces to create for the bare metal server. + NetworkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf `json:"network_interfaces,omitempty"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The VPC the bare metal server is to be a part of. If specified, it must match the + // VPC referenced by the subnets of the server's network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` +// NewCreateBareMetalServerOptions : Instantiate CreateBareMetalServerOptions +func (*VpcV1) NewCreateBareMetalServerOptions(initialization *BareMetalServerInitializationPrototype, primaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype, profile BareMetalServerProfileIdentityIntf, zone ZoneIdentityIntf) *CreateBareMetalServerOptions { + return &CreateBareMetalServerOptions{ + Initialization: initialization, + PrimaryNetworkInterface: primaryNetworkInterface, + Profile: profile, + Zone: zone, + } } -// Constants associated with the DedicatedHostProfileSocket.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileSocketTypeFixedConst = "fixed" -) +// SetInitialization : Allow user to set Initialization +func (_options *CreateBareMetalServerOptions) SetInitialization(initialization *BareMetalServerInitializationPrototype) *CreateBareMetalServerOptions { + _options.Initialization = initialization + return _options +} -func (*DedicatedHostProfileSocket) isaDedicatedHostProfileSocket() bool { - return true +// SetPrimaryNetworkInterface : Allow user to set PrimaryNetworkInterface +func (_options *CreateBareMetalServerOptions) SetPrimaryNetworkInterface(primaryNetworkInterface *BareMetalServerPrimaryNetworkInterfacePrototype) *CreateBareMetalServerOptions { + _options.PrimaryNetworkInterface = primaryNetworkInterface + return _options } -type DedicatedHostProfileSocketIntf interface { - isaDedicatedHostProfileSocket() bool +// SetProfile : Allow user to set Profile +func (_options *CreateBareMetalServerOptions) SetProfile(profile BareMetalServerProfileIdentityIntf) *CreateBareMetalServerOptions { + _options.Profile = profile + return _options } -// UnmarshalDedicatedHostProfileSocket unmarshals an instance of DedicatedHostProfileSocket from the specified map of raw messages. -func UnmarshalDedicatedHostProfileSocket(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileSocket) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetZone : Allow user to set Zone +func (_options *CreateBareMetalServerOptions) SetZone(zone ZoneIdentityIntf) *CreateBareMetalServerOptions { + _options.Zone = zone + return _options } -// DedicatedHostProfileVcpu : DedicatedHostProfileVcpu struct -// Models which "extend" this model: -// - DedicatedHostProfileVcpuFixed -// - DedicatedHostProfileVcpuRange -// - DedicatedHostProfileVcpuEnum -// - DedicatedHostProfileVcpuDependent -type DedicatedHostProfileVcpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetName : Allow user to set Name +func (_options *CreateBareMetalServerOptions) SetName(name string) *CreateBareMetalServerOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// SetNetworkInterfaces : Allow user to set NetworkInterfaces +func (_options *CreateBareMetalServerOptions) SetNetworkInterfaces(networkInterfaces []BareMetalServerNetworkInterfacePrototypeIntf) *CreateBareMetalServerOptions { + _options.NetworkInterfaces = networkInterfaces + return _options +} - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateBareMetalServerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateBareMetalServerOptions { + _options.ResourceGroup = resourceGroup + return _options +} - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// SetVPC : Allow user to set VPC +func (_options *CreateBareMetalServerOptions) SetVPC(vpc VPCIdentityIntf) *CreateBareMetalServerOptions { + _options.VPC = vpc + return _options +} - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *CreateBareMetalServerOptions) SetHeaders(param map[string]string) *CreateBareMetalServerOptions { + options.Headers = param + return options +} - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` +// CreateDedicatedHostGroupOptions : The CreateDedicatedHostGroup options. +type CreateDedicatedHostGroupOptions struct { + // The dedicated host profile class for hosts in this group. + Class *string `json:"class,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The dedicated host profile family for hosts in this group. + Family *string `json:"family,omitempty"` + + // The unique user-defined name for this dedicated host group. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The zone this dedicated host group will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DedicatedHostProfileVcpu.Type property. -// The type for this profile field. +// Constants associated with the CreateDedicatedHostGroupOptions.Family property. +// The dedicated host profile family for hosts in this group. const ( - DedicatedHostProfileVcpuTypeFixedConst = "fixed" + CreateDedicatedHostGroupOptionsFamilyBalancedConst = "balanced" + CreateDedicatedHostGroupOptionsFamilyComputeConst = "compute" + CreateDedicatedHostGroupOptionsFamilyMemoryConst = "memory" ) -func (*DedicatedHostProfileVcpu) isaDedicatedHostProfileVcpu() bool { - return true +// NewCreateDedicatedHostGroupOptions : Instantiate CreateDedicatedHostGroupOptions +func (*VpcV1) NewCreateDedicatedHostGroupOptions() *CreateDedicatedHostGroupOptions { + return &CreateDedicatedHostGroupOptions{} } -type DedicatedHostProfileVcpuIntf interface { - isaDedicatedHostProfileVcpu() bool +// SetClass : Allow user to set Class +func (_options *CreateDedicatedHostGroupOptions) SetClass(class string) *CreateDedicatedHostGroupOptions { + _options.Class = core.StringPtr(class) + return _options } -// UnmarshalDedicatedHostProfileVcpu unmarshals an instance of DedicatedHostProfileVcpu from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetFamily : Allow user to set Family +func (_options *CreateDedicatedHostGroupOptions) SetFamily(family string) *CreateDedicatedHostGroupOptions { + _options.Family = core.StringPtr(family) + return _options } -// DedicatedHostProfileVcpuArchitecture : DedicatedHostProfileVcpuArchitecture struct -type DedicatedHostProfileVcpuArchitecture struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateDedicatedHostGroupOptions) SetName(name string) *CreateDedicatedHostGroupOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The VCPU architecture for a dedicated host with this profile. - Value *string `json:"value" validate:"required"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateDedicatedHostGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateDedicatedHostGroupOptions { + _options.ResourceGroup = resourceGroup + return _options } -// Constants associated with the DedicatedHostProfileVcpuArchitecture.Type property. -// The type for this profile field. -const ( - DedicatedHostProfileVcpuArchitectureTypeFixedConst = "fixed" -) +// SetZone : Allow user to set Zone +func (_options *CreateDedicatedHostGroupOptions) SetZone(zone ZoneIdentityIntf) *CreateDedicatedHostGroupOptions { + _options.Zone = zone + return _options +} -// UnmarshalDedicatedHostProfileVcpuArchitecture unmarshals an instance of DedicatedHostProfileVcpuArchitecture from the specified map of raw messages. -func UnmarshalDedicatedHostProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostProfileVcpuArchitecture) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return +// SetHeaders : Allow user to set Headers +func (options *CreateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *CreateDedicatedHostGroupOptions { + options.Headers = param + return options +} + +// CreateDedicatedHostOptions : The CreateDedicatedHost options. +type CreateDedicatedHostOptions struct { + // The dedicated host prototype object. + DedicatedHostPrototype DedicatedHostPrototypeIntf `json:"DedicatedHostPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateDedicatedHostOptions : Instantiate CreateDedicatedHostOptions +func (*VpcV1) NewCreateDedicatedHostOptions(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { + return &CreateDedicatedHostOptions{ + DedicatedHostPrototype: dedicatedHostPrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DedicatedHostPrototype : DedicatedHostPrototype struct -// Models which "extend" this model: -// - DedicatedHostPrototypeDedicatedHostByGroup -// - DedicatedHostPrototypeDedicatedHostByZone -type DedicatedHostPrototype struct { - // If set to true, instances can be placed on this dedicated host. - InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` +// SetDedicatedHostPrototype : Allow user to set DedicatedHostPrototype +func (_options *CreateDedicatedHostOptions) SetDedicatedHostPrototype(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions { + _options.DedicatedHostPrototype = dedicatedHostPrototype + return _options +} - // The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *CreateDedicatedHostOptions) SetHeaders(param map[string]string) *CreateDedicatedHostOptions { + options.Headers = param + return options +} - // The profile to use for this dedicated host. - Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` +// CreateEndpointGatewayOptions : The CreateEndpointGateway options. +type CreateEndpointGatewayOptions struct { + // The target for this endpoint gateway. + Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` + + // The VPC this endpoint gateway will serve. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` + + // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. + Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` + + // The user-defined name for this endpoint gateway. If unspecified, the name will be a hyphenated list of + // randomly-selected words. Names must be unique within the VPC this endpoint gateway is serving. + Name *string `json:"name,omitempty"` // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The dedicated host group for this dedicated host. - Group DedicatedHostGroupIdentityIntf `json:"group,omitempty"` + // The security groups to use for this endpoint gateway. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The zone this dedicated host will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*DedicatedHostPrototype) isaDedicatedHostPrototype() bool { - return true +// NewCreateEndpointGatewayOptions : Instantiate CreateEndpointGatewayOptions +func (*VpcV1) NewCreateEndpointGatewayOptions(target EndpointGatewayTargetPrototypeIntf, vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { + return &CreateEndpointGatewayOptions{ + Target: target, + VPC: vpc, + } } -type DedicatedHostPrototypeIntf interface { - isaDedicatedHostPrototype() bool +// SetTarget : Allow user to set Target +func (_options *CreateEndpointGatewayOptions) SetTarget(target EndpointGatewayTargetPrototypeIntf) *CreateEndpointGatewayOptions { + _options.Target = target + return _options } -// UnmarshalDedicatedHostPrototype unmarshals an instance of DedicatedHostPrototype from the specified map of raw messages. -func UnmarshalDedicatedHostPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostPrototype) - err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetVPC : Allow user to set VPC +func (_options *CreateEndpointGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { + _options.VPC = vpc + return _options } -// DedicatedHostReference : DedicatedHostReference struct -type DedicatedHostReference struct { - // The CRN for this dedicated host. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this dedicated host. - ID *string `json:"id" validate:"required"` +// SetIps : Allow user to set Ips +func (_options *CreateEndpointGatewayOptions) SetIps(ips []EndpointGatewayReservedIPIntf) *CreateEndpointGatewayOptions { + _options.Ips = ips + return _options +} - // The unique user-defined name for this dedicated host. - Name *string `json:"name" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateEndpointGatewayOptions) SetName(name string) *CreateEndpointGatewayOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateEndpointGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateEndpointGatewayOptions { + _options.ResourceGroup = resourceGroup + return _options } -// Constants associated with the DedicatedHostReference.ResourceType property. -// The resource type. -const ( - DedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" -) +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateEndpointGatewayOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateEndpointGatewayOptions { + _options.SecurityGroups = securityGroups + return _options +} -// UnmarshalDedicatedHostReference unmarshals an instance of DedicatedHostReference from the specified map of raw messages. -func UnmarshalDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayOptions { + options.Headers = param + return options } -// DedicatedHostReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type DedicatedHostReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// CreateFloatingIPOptions : The CreateFloatingIP options. +type CreateFloatingIPOptions struct { + // The floating IP prototype object. + FloatingIPPrototype FloatingIPPrototypeIntf `json:"FloatingIPPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDedicatedHostReferenceDeleted unmarshals an instance of DedicatedHostReferenceDeleted from the specified map of raw messages. -func UnmarshalDedicatedHostReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DedicatedHostReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewCreateFloatingIPOptions : Instantiate CreateFloatingIPOptions +func (*VpcV1) NewCreateFloatingIPOptions(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { + return &CreateFloatingIPOptions{ + FloatingIPPrototype: floatingIPPrototype, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DefaultNetworkACL : DefaultNetworkACL struct -type DefaultNetworkACL struct { - // The date and time that the network ACL was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` +// SetFloatingIPPrototype : Allow user to set FloatingIPPrototype +func (_options *CreateFloatingIPOptions) SetFloatingIPPrototype(floatingIPPrototype FloatingIPPrototypeIntf) *CreateFloatingIPOptions { + _options.FloatingIPPrototype = floatingIPPrototype + return _options +} - // The URL for this network ACL. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateFloatingIPOptions) SetHeaders(param map[string]string) *CreateFloatingIPOptions { + options.Headers = param + return options +} - // The unique identifier for this network ACL. - ID *string `json:"id" validate:"required"` +// CreateFlowLogCollectorOptions : The CreateFlowLogCollector options. +type CreateFlowLogCollectorOptions struct { + // The Cloud Object Storage bucket where the collected flows will be logged. + // The bucket must exist and an IAM service authorization must grant + // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer + // access to the bucket. + StorageBucket CloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` - // The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words - // at creation, but may be user-specified with a subsequent request. - Name *string `json:"name" validate:"required"` + // The target this collector will collect flow logs for. If the target is an instance, + // subnet, or VPC, flow logs will not be collected for any network interfaces within the + // target that are themselves the target of a more specific flow log collector. + Target FlowLogCollectorTargetPrototypeIntf `json:"target" validate:"required"` - // The resource group for the default network ACL for a VPC. Set to the VPC's - // resource group at creation. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // Indicates whether this collector will be active upon creation. + Active *bool `json:"active,omitempty"` - // The ordered rules for the default network ACL for a VPC. Defaults to two rules which allow all inbound and outbound - // traffic, respectively. Rules for the default network ACL may be changed, added, or removed. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + // The unique user-defined name for this flow log collector. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` - // The subnets to which this network ACL is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The VPC this network ACL is a part of. - VPC *VPCReference `json:"vpc" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalDefaultNetworkACL unmarshals an instance of DefaultNetworkACL from the specified map of raw messages. -func UnmarshalDefaultNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultNetworkACL) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return +// NewCreateFlowLogCollectorOptions : Instantiate CreateFlowLogCollectorOptions +func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket CloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { + return &CreateFlowLogCollectorOptions{ + StorageBucket: storageBucket, + Target: target, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DefaultRoutingTable : DefaultRoutingTable struct -type DefaultRoutingTable struct { - // The date and time that this routing table was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetStorageBucket : Allow user to set StorageBucket +func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket CloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { + _options.StorageBucket = storageBucket + return _options +} - // The URL for this routing table. - Href *string `json:"href" validate:"required"` +// SetTarget : Allow user to set Target +func (_options *CreateFlowLogCollectorOptions) SetTarget(target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { + _options.Target = target + return _options +} - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` +// SetActive : Allow user to set Active +func (_options *CreateFlowLogCollectorOptions) SetActive(active bool) *CreateFlowLogCollectorOptions { + _options.Active = core.BoolPtr(active) + return _options +} - // Indicates whether this is the default routing table for this VPC. - IsDefault *bool `json:"is_default" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateFlowLogCollectorOptions) SetName(name string) *CreateFlowLogCollectorOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The lifecycle state of the routing table. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateFlowLogCollectorOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateFlowLogCollectorOptions { + _options.ResourceGroup = resourceGroup + return _options +} - // The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected - // words at creation, but may be user-specified with a subsequent request. - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateFlowLogCollectorOptions) SetHeaders(param map[string]string) *CreateFlowLogCollectorOptions { + options.Headers = param + return options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// CreateIkePolicyOptions : The CreateIkePolicy options. +type CreateIkePolicyOptions struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` + // The Diffie-Hellman group. + DhGroup *int64 `json:"dh_group" validate:"required"` - // Indicates whether this routing table is used to route traffic that originates from from [Transit - // Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version" validate:"required"` - // The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, - // changed, or removed with a subsequent request. - Routes []RouteReference `json:"routes" validate:"required"` + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The subnets to which this routing table is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The user-defined name for this IKE policy. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the DefaultRoutingTable.LifecycleState property. -// The lifecycle state of the routing table. +// Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithm property. +// The authentication algorithm. const ( - DefaultRoutingTableLifecycleStateDeletingConst = "deleting" - DefaultRoutingTableLifecycleStateFailedConst = "failed" - DefaultRoutingTableLifecycleStatePendingConst = "pending" - DefaultRoutingTableLifecycleStateStableConst = "stable" - DefaultRoutingTableLifecycleStateSuspendedConst = "suspended" - DefaultRoutingTableLifecycleStateUpdatingConst = "updating" - DefaultRoutingTableLifecycleStateWaitingConst = "waiting" + CreateIkePolicyOptionsAuthenticationAlgorithmMd5Const = "md5" + CreateIkePolicyOptionsAuthenticationAlgorithmSha1Const = "sha1" + CreateIkePolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" + CreateIkePolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" ) -// Constants associated with the DefaultRoutingTable.ResourceType property. -// The resource type. +// Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithm property. +// The encryption algorithm. const ( - DefaultRoutingTableResourceTypeRoutingTableConst = "routing_table" + CreateIkePolicyOptionsEncryptionAlgorithmAes128Const = "aes128" + CreateIkePolicyOptionsEncryptionAlgorithmAes256Const = "aes256" + CreateIkePolicyOptionsEncryptionAlgorithmTripleDesConst = "triple_des" ) -// UnmarshalDefaultRoutingTable unmarshals an instance of DefaultRoutingTable from the specified map of raw messages. -func UnmarshalDefaultRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultRoutingTable) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return +// NewCreateIkePolicyOptions : Instantiate CreateIkePolicyOptions +func (*VpcV1) NewCreateIkePolicyOptions(authenticationAlgorithm string, dhGroup int64, encryptionAlgorithm string, ikeVersion int64) *CreateIkePolicyOptions { + return &CreateIkePolicyOptions{ + AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), + DhGroup: core.Int64Ptr(dhGroup), + EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), + IkeVersion: core.Int64Ptr(ikeVersion), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// DefaultSecurityGroup : DefaultSecurityGroup struct -type DefaultSecurityGroup struct { - // The date and time that this security group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The name of the default security group created for a VPC. The name will be a hyphenated list of randomly-selected - // words at creation, but may be user-specified with a subsequent request. - Name *string `json:"name" validate:"required"` - - // The resource group for this security group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The rules for the default security group for a VPC. Defaults to allowing all outbound traffic, and allowing all - // inbound traffic from other interfaces in the VPC's default security group. Rules for the default security group may - // be changed, added or removed. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` +// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm +func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIkePolicyOptions { + _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) + return _options +} - // The VPC this security group is a part of. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetDhGroup : Allow user to set DhGroup +func (_options *CreateIkePolicyOptions) SetDhGroup(dhGroup int64) *CreateIkePolicyOptions { + _options.DhGroup = core.Int64Ptr(dhGroup) + return _options } -// UnmarshalDefaultSecurityGroup unmarshals an instance of DefaultSecurityGroup from the specified map of raw messages. -func UnmarshalDefaultSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(DefaultSecurityGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm +func (_options *CreateIkePolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIkePolicyOptions { + _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) + return _options } -// DeleteDedicatedHostGroupOptions : The DeleteDedicatedHostGroup options. -type DeleteDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` +// SetIkeVersion : Allow user to set IkeVersion +func (_options *CreateIkePolicyOptions) SetIkeVersion(ikeVersion int64) *CreateIkePolicyOptions { + _options.IkeVersion = core.Int64Ptr(ikeVersion) + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetKeyLifetime : Allow user to set KeyLifetime +func (_options *CreateIkePolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIkePolicyOptions { + _options.KeyLifetime = core.Int64Ptr(keyLifetime) + return _options } -// NewDeleteDedicatedHostGroupOptions : Instantiate DeleteDedicatedHostGroupOptions -func (*VpcV1) NewDeleteDedicatedHostGroupOptions(id string) *DeleteDedicatedHostGroupOptions { - return &DeleteDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - } +// SetName : Allow user to set Name +func (_options *CreateIkePolicyOptions) SetName(name string) *CreateIkePolicyOptions { + _options.Name = core.StringPtr(name) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteDedicatedHostGroupOptions) SetID(id string) *DeleteDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateIkePolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIkePolicyOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteDedicatedHostGroupOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostGroupOptions { +func (options *CreateIkePolicyOptions) SetHeaders(param map[string]string) *CreateIkePolicyOptions { options.Headers = param return options } -// DeleteDedicatedHostOptions : The DeleteDedicatedHost options. -type DeleteDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateImageOptions : The CreateImage options. +type CreateImageOptions struct { + // The image prototype object. + ImagePrototype ImagePrototypeIntf `json:"ImagePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteDedicatedHostOptions : Instantiate DeleteDedicatedHostOptions -func (*VpcV1) NewDeleteDedicatedHostOptions(id string) *DeleteDedicatedHostOptions { - return &DeleteDedicatedHostOptions{ - ID: core.StringPtr(id), +// NewCreateImageOptions : Instantiate CreateImageOptions +func (*VpcV1) NewCreateImageOptions(imagePrototype ImagePrototypeIntf) *CreateImageOptions { + return &CreateImageOptions{ + ImagePrototype: imagePrototype, } } -// SetID : Allow user to set ID -func (_options *DeleteDedicatedHostOptions) SetID(id string) *DeleteDedicatedHostOptions { - _options.ID = core.StringPtr(id) +// SetImagePrototype : Allow user to set ImagePrototype +func (_options *CreateImageOptions) SetImagePrototype(imagePrototype ImagePrototypeIntf) *CreateImageOptions { + _options.ImagePrototype = imagePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteDedicatedHostOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostOptions { +func (options *CreateImageOptions) SetHeaders(param map[string]string) *CreateImageOptions { options.Headers = param return options } -// DeleteEndpointGatewayOptions : The DeleteEndpointGateway options. -type DeleteEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateInstanceActionOptions : The CreateInstanceAction options. +type CreateInstanceActionOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The type of action. + Type *string `json:"type" validate:"required"` + + // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. + Force *bool `json:"force,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteEndpointGatewayOptions : Instantiate DeleteEndpointGatewayOptions -func (*VpcV1) NewDeleteEndpointGatewayOptions(id string) *DeleteEndpointGatewayOptions { - return &DeleteEndpointGatewayOptions{ - ID: core.StringPtr(id), +// Constants associated with the CreateInstanceActionOptions.Type property. +// The type of action. +const ( + CreateInstanceActionOptionsTypeRebootConst = "reboot" + CreateInstanceActionOptionsTypeStartConst = "start" + CreateInstanceActionOptionsTypeStopConst = "stop" +) + +// NewCreateInstanceActionOptions : Instantiate CreateInstanceActionOptions +func (*VpcV1) NewCreateInstanceActionOptions(instanceID string, typeVar string) *CreateInstanceActionOptions { + return &CreateInstanceActionOptions{ + InstanceID: core.StringPtr(instanceID), + Type: core.StringPtr(typeVar), } } -// SetID : Allow user to set ID -func (_options *DeleteEndpointGatewayOptions) SetID(id string) *DeleteEndpointGatewayOptions { - _options.ID = core.StringPtr(id) +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceActionOptions) SetInstanceID(instanceID string) *CreateInstanceActionOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayOptions { - options.Headers = param - return options -} - -// DeleteFloatingIPOptions : The DeleteFloatingIP options. -type DeleteFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteFloatingIPOptions : Instantiate DeleteFloatingIPOptions -func (*VpcV1) NewDeleteFloatingIPOptions(id string) *DeleteFloatingIPOptions { - return &DeleteFloatingIPOptions{ - ID: core.StringPtr(id), - } +// SetType : Allow user to set Type +func (_options *CreateInstanceActionOptions) SetType(typeVar string) *CreateInstanceActionOptions { + _options.Type = core.StringPtr(typeVar) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteFloatingIPOptions) SetID(id string) *DeleteFloatingIPOptions { - _options.ID = core.StringPtr(id) +// SetForce : Allow user to set Force +func (_options *CreateInstanceActionOptions) SetForce(force bool) *CreateInstanceActionOptions { + _options.Force = core.BoolPtr(force) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteFloatingIPOptions) SetHeaders(param map[string]string) *DeleteFloatingIPOptions { +func (options *CreateInstanceActionOptions) SetHeaders(param map[string]string) *CreateInstanceActionOptions { options.Headers = param return options } -// DeleteFlowLogCollectorOptions : The DeleteFlowLogCollector options. -type DeleteFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateInstanceConsoleAccessTokenOptions : The CreateInstanceConsoleAccessToken options. +type CreateInstanceConsoleAccessTokenOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The instance console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` + + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteFlowLogCollectorOptions : Instantiate DeleteFlowLogCollectorOptions -func (*VpcV1) NewDeleteFlowLogCollectorOptions(id string) *DeleteFlowLogCollectorOptions { - return &DeleteFlowLogCollectorOptions{ - ID: core.StringPtr(id), +// Constants associated with the CreateInstanceConsoleAccessTokenOptions.ConsoleType property. +// The instance console type for which this token may be used. +const ( + CreateInstanceConsoleAccessTokenOptionsConsoleTypeSerialConst = "serial" + CreateInstanceConsoleAccessTokenOptionsConsoleTypeVncConst = "vnc" +) + +// NewCreateInstanceConsoleAccessTokenOptions : Instantiate CreateInstanceConsoleAccessTokenOptions +func (*VpcV1) NewCreateInstanceConsoleAccessTokenOptions(instanceID string, consoleType string) *CreateInstanceConsoleAccessTokenOptions { + return &CreateInstanceConsoleAccessTokenOptions{ + InstanceID: core.StringPtr(instanceID), + ConsoleType: core.StringPtr(consoleType), } } -// SetID : Allow user to set ID -func (_options *DeleteFlowLogCollectorOptions) SetID(id string) *DeleteFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceConsoleAccessTokenOptions) SetInstanceID(instanceID string) *CreateInstanceConsoleAccessTokenOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteFlowLogCollectorOptions) SetHeaders(param map[string]string) *DeleteFlowLogCollectorOptions { - options.Headers = param - return options -} - -// DeleteIkePolicyOptions : The DeleteIkePolicy options. -type DeleteIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteIkePolicyOptions : Instantiate DeleteIkePolicyOptions -func (*VpcV1) NewDeleteIkePolicyOptions(id string) *DeleteIkePolicyOptions { - return &DeleteIkePolicyOptions{ - ID: core.StringPtr(id), - } +// SetConsoleType : Allow user to set ConsoleType +func (_options *CreateInstanceConsoleAccessTokenOptions) SetConsoleType(consoleType string) *CreateInstanceConsoleAccessTokenOptions { + _options.ConsoleType = core.StringPtr(consoleType) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteIkePolicyOptions) SetID(id string) *DeleteIkePolicyOptions { - _options.ID = core.StringPtr(id) +// SetForce : Allow user to set Force +func (_options *CreateInstanceConsoleAccessTokenOptions) SetForce(force bool) *CreateInstanceConsoleAccessTokenOptions { + _options.Force = core.BoolPtr(force) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteIkePolicyOptions) SetHeaders(param map[string]string) *DeleteIkePolicyOptions { +func (options *CreateInstanceConsoleAccessTokenOptions) SetHeaders(param map[string]string) *CreateInstanceConsoleAccessTokenOptions { options.Headers = param return options } -// DeleteImageOptions : The DeleteImage options. -type DeleteImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateInstanceGroupManagerActionOptions : The CreateInstanceGroupManagerAction options. +type CreateInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager action prototype object. + InstanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf `json:"InstanceGroupManagerActionPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteImageOptions : Instantiate DeleteImageOptions -func (*VpcV1) NewDeleteImageOptions(id string) *DeleteImageOptions { - return &DeleteImageOptions{ - ID: core.StringPtr(id), +// NewCreateInstanceGroupManagerActionOptions : Instantiate CreateInstanceGroupManagerActionOptions +func (*VpcV1) NewCreateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { + return &CreateInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + InstanceGroupManagerActionPrototype: instanceGroupManagerActionPrototype, } } -// SetID : Allow user to set ID -func (_options *DeleteImageOptions) SetID(id string) *DeleteImageOptions { - _options.ID = core.StringPtr(id) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} + +// SetInstanceGroupManagerActionPrototype : Allow user to set InstanceGroupManagerActionPrototype +func (_options *CreateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPrototype(instanceGroupManagerActionPrototype InstanceGroupManagerActionPrototypeIntf) *CreateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerActionPrototype = instanceGroupManagerActionPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteImageOptions) SetHeaders(param map[string]string) *DeleteImageOptions { +func (options *CreateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerActionOptions { options.Headers = param return options } -// DeleteInstanceGroupLoadBalancerOptions : The DeleteInstanceGroupLoadBalancer options. -type DeleteInstanceGroupLoadBalancerOptions struct { +// CreateInstanceGroupManagerOptions : The CreateInstanceGroupManager options. +type CreateInstanceGroupManagerOptions struct { // The instance group identifier. InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The instance group manager prototype object. + InstanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf `json:"InstanceGroupManagerPrototype" validate:"required"` + // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceGroupLoadBalancerOptions : Instantiate DeleteInstanceGroupLoadBalancerOptions -func (*VpcV1) NewDeleteInstanceGroupLoadBalancerOptions(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { - return &DeleteInstanceGroupLoadBalancerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), +// NewCreateInstanceGroupManagerOptions : Instantiate CreateInstanceGroupManagerOptions +func (*VpcV1) NewCreateInstanceGroupManagerOptions(instanceGroupID string, instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { + return &CreateInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerPrototype: instanceGroupManagerPrototype, } } // SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupLoadBalancerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { +func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerOptions { _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupLoadBalancerOptions { +// SetInstanceGroupManagerPrototype : Allow user to set InstanceGroupManagerPrototype +func (_options *CreateInstanceGroupManagerOptions) SetInstanceGroupManagerPrototype(instanceGroupManagerPrototype InstanceGroupManagerPrototypeIntf) *CreateInstanceGroupManagerOptions { + _options.InstanceGroupManagerPrototype = instanceGroupManagerPrototype + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerOptions { options.Headers = param return options } -// DeleteInstanceGroupManagerActionOptions : The DeleteInstanceGroupManagerAction options. -type DeleteInstanceGroupManagerActionOptions struct { +// CreateInstanceGroupManagerPolicyOptions : The CreateInstanceGroupManagerPolicy options. +type CreateInstanceGroupManagerPolicyOptions struct { // The instance group identifier. InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` // The instance group manager identifier. InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` + // The instance group manager policy prototype object. + InstanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf `json:"InstanceGroupManagerPolicyPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceGroupManagerActionOptions : Instantiate DeleteInstanceGroupManagerActionOptions -func (*VpcV1) NewDeleteInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerActionOptions { - return &DeleteInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), +// NewCreateInstanceGroupManagerPolicyOptions : Instantiate CreateInstanceGroupManagerPolicyOptions +func (*VpcV1) NewCreateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { + return &CreateInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + InstanceGroupManagerPolicyPrototype: instanceGroupManagerPolicyPrototype, } } // SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerActionOptions { +func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *CreateInstanceGroupManagerPolicyOptions { _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } // SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerActionOptions { +func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *CreateInstanceGroupManagerPolicyOptions { _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerActionOptions) SetID(id string) *DeleteInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) +// SetInstanceGroupManagerPolicyPrototype : Allow user to set InstanceGroupManagerPolicyPrototype +func (_options *CreateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototype InstanceGroupManagerPolicyPrototypeIntf) *CreateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerPolicyPrototype = instanceGroupManagerPolicyPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerActionOptions { +func (options *CreateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *CreateInstanceGroupManagerPolicyOptions { options.Headers = param return options } -// DeleteInstanceGroupManagerOptions : The DeleteInstanceGroupManager options. -type DeleteInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// `CreateInstanceGroupOptions` : The CreateInstanceGroup options. +type CreateInstanceGroupOptions struct { + // Instance template to use when creating new instances. + // + // Instance groups are not compatible with instance templates that specify `true` for + // `default_trusted_profile.auto_link`. + InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template" validate:"required"` -// NewDeleteInstanceGroupManagerOptions : Instantiate DeleteInstanceGroupManagerOptions -func (*VpcV1) NewDeleteInstanceGroupManagerOptions(instanceGroupID string, id string) *DeleteInstanceGroupManagerOptions { - return &DeleteInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } -} + // The subnets to use when creating new instances. + Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the + // port for the load balancer pool member. + ApplicationPort *int64 `json:"application_port,omitempty"` -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerOptions) SetID(id string) *DeleteInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The load balancer that the load balancer pool used by this group + // is in. Required when using a load balancer pool. + LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerOptions { - options.Headers = param - return options -} + // If specified, the load balancer pool will be managed by this + // group. Instances created by this group will have a new load + // balancer pool member in that pool created. Must be used with + // `application_port`. + LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` -// DeleteInstanceGroupManagerPolicyOptions : The DeleteInstanceGroupManagerPolicy options. -type DeleteInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The number of instances in the instance group. + MembershipCount *int64 `json:"membership_count,omitempty"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The unique user-defined name for this instance group. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceGroupManagerPolicyOptions : Instantiate DeleteInstanceGroupManagerPolicyOptions -func (*VpcV1) NewDeleteInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerPolicyOptions { - return &DeleteInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), +// NewCreateInstanceGroupOptions : Instantiate CreateInstanceGroupOptions +func (*VpcV1) NewCreateInstanceGroupOptions(instanceTemplate InstanceTemplateIdentityIntf, subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { + return &CreateInstanceGroupOptions{ + InstanceTemplate: instanceTemplate, + Subnets: subnets, } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) +// SetInstanceTemplate : Allow user to set InstanceTemplate +func (_options *CreateInstanceGroupOptions) SetInstanceTemplate(instanceTemplate InstanceTemplateIdentityIntf) *CreateInstanceGroupOptions { + _options.InstanceTemplate = instanceTemplate return _options } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) +// SetSubnets : Allow user to set Subnets +func (_options *CreateInstanceGroupOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateInstanceGroupOptions { + _options.Subnets = subnets return _options } -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupManagerPolicyOptions) SetID(id string) *DeleteInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) +// SetApplicationPort : Allow user to set ApplicationPort +func (_options *CreateInstanceGroupOptions) SetApplicationPort(applicationPort int64) *CreateInstanceGroupOptions { + _options.ApplicationPort = core.Int64Ptr(applicationPort) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerPolicyOptions { - options.Headers = param - return options +// SetLoadBalancer : Allow user to set LoadBalancer +func (_options *CreateInstanceGroupOptions) SetLoadBalancer(loadBalancer LoadBalancerIdentityIntf) *CreateInstanceGroupOptions { + _options.LoadBalancer = loadBalancer + return _options } -// DeleteInstanceGroupMembershipOptions : The DeleteInstanceGroupMembership options. -type DeleteInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// SetLoadBalancerPool : Allow user to set LoadBalancerPool +func (_options *CreateInstanceGroupOptions) SetLoadBalancerPool(loadBalancerPool LoadBalancerPoolIdentityIntf) *CreateInstanceGroupOptions { + _options.LoadBalancerPool = loadBalancerPool + return _options } -// NewDeleteInstanceGroupMembershipOptions : Instantiate DeleteInstanceGroupMembershipOptions -func (*VpcV1) NewDeleteInstanceGroupMembershipOptions(instanceGroupID string, id string) *DeleteInstanceGroupMembershipOptions { - return &DeleteInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } +// SetMembershipCount : Allow user to set MembershipCount +func (_options *CreateInstanceGroupOptions) SetMembershipCount(membershipCount int64) *CreateInstanceGroupOptions { + _options.MembershipCount = core.Int64Ptr(membershipCount) + return _options } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) +// SetName : Allow user to set Name +func (_options *CreateInstanceGroupOptions) SetName(name string) *CreateInstanceGroupOptions { + _options.Name = core.StringPtr(name) return _options } -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupMembershipOptions) SetID(id string) *DeleteInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateInstanceGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateInstanceGroupOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipOptions { +func (options *CreateInstanceGroupOptions) SetHeaders(param map[string]string) *CreateInstanceGroupOptions { options.Headers = param return options } -// DeleteInstanceGroupMembershipsOptions : The DeleteInstanceGroupMemberships options. -type DeleteInstanceGroupMembershipsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// CreateInstanceNetworkInterfaceOptions : The CreateInstanceNetworkInterface options. +type CreateInstanceNetworkInterfaceOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // Allows users to set headers on API requests - Headers map[string]string -} + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -// NewDeleteInstanceGroupMembershipsOptions : Instantiate DeleteInstanceGroupMembershipsOptions -func (*VpcV1) NewDeleteInstanceGroupMembershipsOptions(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { - return &DeleteInstanceGroupMembershipsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *DeleteInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipsOptions { - options.Headers = param - return options -} + // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If + // unspecified, an available address on the subnet will be automatically selected. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` -// DeleteInstanceGroupOptions : The DeleteInstanceGroup options. -type DeleteInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` + // The security groups to use for this network interface. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceGroupOptions : Instantiate DeleteInstanceGroupOptions -func (*VpcV1) NewDeleteInstanceGroupOptions(id string) *DeleteInstanceGroupOptions { - return &DeleteInstanceGroupOptions{ - ID: core.StringPtr(id), +// NewCreateInstanceNetworkInterfaceOptions : Instantiate CreateInstanceNetworkInterfaceOptions +func (*VpcV1) NewCreateInstanceNetworkInterfaceOptions(instanceID string, subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { + return &CreateInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + Subnet: subnet, } } -// SetID : Allow user to set ID -func (_options *DeleteInstanceGroupOptions) SetID(id string) *DeleteInstanceGroupOptions { - _options.ID = core.StringPtr(id) +// SetInstanceID : Allow user to set InstanceID +func (_options *CreateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *CreateInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceGroupOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupOptions { - options.Headers = param - return options +// SetSubnet : Allow user to set Subnet +func (_options *CreateInstanceNetworkInterfaceOptions) SetSubnet(subnet SubnetIdentityIntf) *CreateInstanceNetworkInterfaceOptions { + _options.Subnet = subnet + return _options } -// DeleteInstanceNetworkInterfaceOptions : The DeleteInstanceNetworkInterface options. -type DeleteInstanceNetworkInterfaceOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The network interface identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// SetAllowIPSpoofing : Allow user to set AllowIPSpoofing +func (_options *CreateInstanceNetworkInterfaceOptions) SetAllowIPSpoofing(allowIPSpoofing bool) *CreateInstanceNetworkInterfaceOptions { + _options.AllowIPSpoofing = core.BoolPtr(allowIPSpoofing) + return _options } -// NewDeleteInstanceNetworkInterfaceOptions : Instantiate DeleteInstanceNetworkInterfaceOptions -func (*VpcV1) NewDeleteInstanceNetworkInterfaceOptions(instanceID string, id string) *DeleteInstanceNetworkInterfaceOptions { - return &DeleteInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } +// SetName : Allow user to set Name +func (_options *CreateInstanceNetworkInterfaceOptions) SetName(name string) *CreateInstanceNetworkInterfaceOptions { + _options.Name = core.StringPtr(name) + return _options } -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) +// SetPrimaryIpv4Address : Allow user to set PrimaryIpv4Address +func (_options *CreateInstanceNetworkInterfaceOptions) SetPrimaryIpv4Address(primaryIpv4Address string) *CreateInstanceNetworkInterfaceOptions { + _options.PrimaryIpv4Address = core.StringPtr(primaryIpv4Address) return _options } -// SetID : Allow user to set ID -func (_options *DeleteInstanceNetworkInterfaceOptions) SetID(id string) *DeleteInstanceNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateInstanceNetworkInterfaceOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateInstanceNetworkInterfaceOptions { + _options.SecurityGroups = securityGroups return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkInterfaceOptions { +func (options *CreateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *CreateInstanceNetworkInterfaceOptions { options.Headers = param return options } -// DeleteInstanceOptions : The DeleteInstance options. -type DeleteInstanceOptions struct { - // The instance identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateInstanceOptions : The CreateInstance options. +type CreateInstanceOptions struct { + // The instance prototype object. + InstancePrototype InstancePrototypeIntf `json:"InstancePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceOptions : Instantiate DeleteInstanceOptions -func (*VpcV1) NewDeleteInstanceOptions(id string) *DeleteInstanceOptions { - return &DeleteInstanceOptions{ - ID: core.StringPtr(id), +// NewCreateInstanceOptions : Instantiate CreateInstanceOptions +func (*VpcV1) NewCreateInstanceOptions(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { + return &CreateInstanceOptions{ + InstancePrototype: instancePrototype, } } -// SetID : Allow user to set ID -func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { - _options.ID = core.StringPtr(id) +// SetInstancePrototype : Allow user to set InstancePrototype +func (_options *CreateInstanceOptions) SetInstancePrototype(instancePrototype InstancePrototypeIntf) *CreateInstanceOptions { + _options.InstancePrototype = instancePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { +func (options *CreateInstanceOptions) SetHeaders(param map[string]string) *CreateInstanceOptions { options.Headers = param return options } -// DeleteInstanceTemplateOptions : The DeleteInstanceTemplate options. -type DeleteInstanceTemplateOptions struct { - // The instance template identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateInstanceTemplateOptions : The CreateInstanceTemplate options. +type CreateInstanceTemplateOptions struct { + // The instance template prototype object. + InstanceTemplatePrototype InstanceTemplatePrototypeIntf `json:"InstanceTemplatePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceTemplateOptions : Instantiate DeleteInstanceTemplateOptions -func (*VpcV1) NewDeleteInstanceTemplateOptions(id string) *DeleteInstanceTemplateOptions { - return &DeleteInstanceTemplateOptions{ - ID: core.StringPtr(id), +// NewCreateInstanceTemplateOptions : Instantiate CreateInstanceTemplateOptions +func (*VpcV1) NewCreateInstanceTemplateOptions(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { + return &CreateInstanceTemplateOptions{ + InstanceTemplatePrototype: instanceTemplatePrototype, } } -// SetID : Allow user to set ID -func (_options *DeleteInstanceTemplateOptions) SetID(id string) *DeleteInstanceTemplateOptions { - _options.ID = core.StringPtr(id) +// SetInstanceTemplatePrototype : Allow user to set InstanceTemplatePrototype +func (_options *CreateInstanceTemplateOptions) SetInstanceTemplatePrototype(instanceTemplatePrototype InstanceTemplatePrototypeIntf) *CreateInstanceTemplateOptions { + _options.InstanceTemplatePrototype = instanceTemplatePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteInstanceTemplateOptions) SetHeaders(param map[string]string) *DeleteInstanceTemplateOptions { +func (options *CreateInstanceTemplateOptions) SetHeaders(param map[string]string) *CreateInstanceTemplateOptions { options.Headers = param return options } -// DeleteInstanceVolumeAttachmentOptions : The DeleteInstanceVolumeAttachment options. -type DeleteInstanceVolumeAttachmentOptions struct { +// CreateInstanceVolumeAttachmentOptions : The CreateInstanceVolumeAttachment options. +type CreateInstanceVolumeAttachmentOptions struct { // The instance identifier. InstanceID *string `json:"instance_id" validate:"required,ne="` - // The volume attachment identifier. - ID *string `json:"id" validate:"required,ne="` + // An existing volume to attach to the instance, or a prototype object for a new volume. + Volume VolumeAttachmentPrototypeVolumeIntf `json:"volume" validate:"required"` + + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + + // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment + // resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteInstanceVolumeAttachmentOptions : Instantiate DeleteInstanceVolumeAttachmentOptions -func (*VpcV1) NewDeleteInstanceVolumeAttachmentOptions(instanceID string, id string) *DeleteInstanceVolumeAttachmentOptions { - return &DeleteInstanceVolumeAttachmentOptions{ +// NewCreateInstanceVolumeAttachmentOptions : Instantiate CreateInstanceVolumeAttachmentOptions +func (*VpcV1) NewCreateInstanceVolumeAttachmentOptions(instanceID string, volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { + return &CreateInstanceVolumeAttachmentOptions{ InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), + Volume: volume, } } // SetInstanceID : Allow user to set InstanceID -func (_options *DeleteInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceVolumeAttachmentOptions { +func (_options *CreateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *CreateInstanceVolumeAttachmentOptions { _options.InstanceID = core.StringPtr(instanceID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteInstanceVolumeAttachmentOptions) SetID(id string) *DeleteInstanceVolumeAttachmentOptions { - _options.ID = core.StringPtr(id) +// SetVolume : Allow user to set Volume +func (_options *CreateInstanceVolumeAttachmentOptions) SetVolume(volume VolumeAttachmentPrototypeVolumeIntf) *CreateInstanceVolumeAttachmentOptions { + _options.Volume = volume return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceVolumeAttachmentOptions { - options.Headers = param - return options -} - -// DeleteIpsecPolicyOptions : The DeleteIpsecPolicy options. -type DeleteIpsecPolicyOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteIpsecPolicyOptions : Instantiate DeleteIpsecPolicyOptions -func (*VpcV1) NewDeleteIpsecPolicyOptions(id string) *DeleteIpsecPolicyOptions { - return &DeleteIpsecPolicyOptions{ - ID: core.StringPtr(id), - } +// SetDeleteVolumeOnInstanceDelete : Allow user to set DeleteVolumeOnInstanceDelete +func (_options *CreateInstanceVolumeAttachmentOptions) SetDeleteVolumeOnInstanceDelete(deleteVolumeOnInstanceDelete bool) *CreateInstanceVolumeAttachmentOptions { + _options.DeleteVolumeOnInstanceDelete = core.BoolPtr(deleteVolumeOnInstanceDelete) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteIpsecPolicyOptions) SetID(id string) *DeleteIpsecPolicyOptions { - _options.ID = core.StringPtr(id) +// SetName : Allow user to set Name +func (_options *CreateInstanceVolumeAttachmentOptions) SetName(name string) *CreateInstanceVolumeAttachmentOptions { + _options.Name = core.StringPtr(name) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteIpsecPolicyOptions) SetHeaders(param map[string]string) *DeleteIpsecPolicyOptions { +func (options *CreateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *CreateInstanceVolumeAttachmentOptions { options.Headers = param return options } -// DeleteKeyOptions : The DeleteKey options. -type DeleteKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateIpsecPolicyOptions : The CreateIpsecPolicy options. +type CreateIpsecPolicyOptions struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + + // Perfect Forward Secrecy. + Pfs *string `json:"pfs" validate:"required"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` + + // The user-defined name for this IPsec policy. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteKeyOptions : Instantiate DeleteKeyOptions -func (*VpcV1) NewDeleteKeyOptions(id string) *DeleteKeyOptions { - return &DeleteKeyOptions{ - ID: core.StringPtr(id), +// Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithm property. +// The authentication algorithm. +const ( + CreateIpsecPolicyOptionsAuthenticationAlgorithmMd5Const = "md5" + CreateIpsecPolicyOptionsAuthenticationAlgorithmSha1Const = "sha1" + CreateIpsecPolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" + CreateIpsecPolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" +) + +// Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + CreateIpsecPolicyOptionsEncryptionAlgorithmAes128Const = "aes128" + CreateIpsecPolicyOptionsEncryptionAlgorithmAes256Const = "aes256" + CreateIpsecPolicyOptionsEncryptionAlgorithmTripleDesConst = "triple_des" +) + +// Constants associated with the CreateIpsecPolicyOptions.Pfs property. +// Perfect Forward Secrecy. +const ( + CreateIpsecPolicyOptionsPfsDisabledConst = "disabled" + CreateIpsecPolicyOptionsPfsGroup14Const = "group_14" + CreateIpsecPolicyOptionsPfsGroup19Const = "group_19" + CreateIpsecPolicyOptionsPfsGroup2Const = "group_2" + CreateIpsecPolicyOptionsPfsGroup5Const = "group_5" +) + +// NewCreateIpsecPolicyOptions : Instantiate CreateIpsecPolicyOptions +func (*VpcV1) NewCreateIpsecPolicyOptions(authenticationAlgorithm string, encryptionAlgorithm string, pfs string) *CreateIpsecPolicyOptions { + return &CreateIpsecPolicyOptions{ + AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), + EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), + Pfs: core.StringPtr(pfs), } } -// SetID : Allow user to set ID -func (_options *DeleteKeyOptions) SetID(id string) *DeleteKeyOptions { - _options.ID = core.StringPtr(id) +// SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm +func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIpsecPolicyOptions { + _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteKeyOptions) SetHeaders(param map[string]string) *DeleteKeyOptions { - options.Headers = param - return options +// SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm +func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIpsecPolicyOptions { + _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) + return _options } -// DeleteLoadBalancerListenerOptions : The DeleteLoadBalancerListener options. -type DeleteLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// SetPfs : Allow user to set Pfs +func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { + _options.Pfs = core.StringPtr(pfs) + return _options } -// NewDeleteLoadBalancerListenerOptions : Instantiate DeleteLoadBalancerListenerOptions -func (*VpcV1) NewDeleteLoadBalancerListenerOptions(loadBalancerID string, id string) *DeleteLoadBalancerListenerOptions { - return &DeleteLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - } +// SetKeyLifetime : Allow user to set KeyLifetime +func (_options *CreateIpsecPolicyOptions) SetKeyLifetime(keyLifetime int64) *CreateIpsecPolicyOptions { + _options.KeyLifetime = core.Int64Ptr(keyLifetime) + return _options } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetName : Allow user to set Name +func (_options *CreateIpsecPolicyOptions) SetName(name string) *CreateIpsecPolicyOptions { + _options.Name = core.StringPtr(name) return _options } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerOptions) SetID(id string) *DeleteLoadBalancerListenerOptions { - _options.ID = core.StringPtr(id) +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateIpsecPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIpsecPolicyOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerOptions { +func (options *CreateIpsecPolicyOptions) SetHeaders(param map[string]string) *CreateIpsecPolicyOptions { options.Headers = param return options } -// DeleteLoadBalancerListenerPolicyOptions : The DeleteLoadBalancerListenerPolicy options. -type DeleteLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` +// CreateKeyOptions : The CreateKey options. +type CreateKeyOptions struct { + // A unique public SSH key to import, in OpenSSH format (consisting of three space-separated fields: the algorithm + // name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is + // imported. + PublicKey *string `json:"public_key" validate:"required"` - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected + // words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The crypto-system used by this key. + Type *string `json:"type,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteLoadBalancerListenerPolicyOptions : Instantiate DeleteLoadBalancerListenerPolicyOptions -func (*VpcV1) NewDeleteLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *DeleteLoadBalancerListenerPolicyOptions { - return &DeleteLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), +// Constants associated with the CreateKeyOptions.Type property. +// The crypto-system used by this key. +const ( + CreateKeyOptionsTypeRsaConst = "rsa" +) + +// NewCreateKeyOptions : Instantiate CreateKeyOptions +func (*VpcV1) NewCreateKeyOptions(publicKey string) *CreateKeyOptions { + return &CreateKeyOptions{ + PublicKey: core.StringPtr(publicKey), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetPublicKey : Allow user to set PublicKey +func (_options *CreateKeyOptions) SetPublicKey(publicKey string) *CreateKeyOptions { + _options.PublicKey = core.StringPtr(publicKey) return _options } -// SetListenerID : Allow user to set ListenerID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) +// SetName : Allow user to set Name +func (_options *CreateKeyOptions) SetName(name string) *CreateKeyOptions { + _options.Name = core.StringPtr(name) return _options } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerPolicyOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateKeyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateKeyOptions { + _options.ResourceGroup = resourceGroup + return _options +} + +// SetType : Allow user to set Type +func (_options *CreateKeyOptions) SetType(typeVar string) *CreateKeyOptions { + _options.Type = core.StringPtr(typeVar) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyOptions { +func (options *CreateKeyOptions) SetHeaders(param map[string]string) *CreateKeyOptions { options.Headers = param return options } -// DeleteLoadBalancerListenerPolicyRuleOptions : The DeleteLoadBalancerListenerPolicyRule options. -type DeleteLoadBalancerListenerPolicyRuleOptions struct { +// CreateLoadBalancerListenerOptions : The CreateLoadBalancerListener options. +type CreateLoadBalancerListenerOptions struct { // The load balancer identifier. LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + // Additional restrictions: + // - If this load balancer is in the `network` family, the protocol must be `tcp`. + // - If this listener has `https_redirect` specified, the protocol must be `http`. + // - If this listener is a listener's `https_redirect` target, the protocol must be `https`. + Protocol *string `json:"protocol" validate:"required"` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The certificate instance used for SSL termination. It is applicable only to `https` + // protocol. + CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` + + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` + + // The default pool for this listener. The specified pool must: + // + // - Belong to this load balancer + // - Have the same `protocol` as this listener, or have a compatible protocol. + // At present, the compatible protocols are `http` and `https`. + // - Not already be the `default_pool` for another listener. + DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` + + // The target listener that requests will be redirected to. This listener must have a + // `protocol` of `http`, and the target listener must have a `protocol` of `https`. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPrototype `json:"https_redirect,omitempty"` + + // The policy prototype objects for this listener. + Policies []LoadBalancerListenerPolicyPrototype `json:"policies,omitempty"` + + // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must + // have a unique `port` and `protocol` combination. + // + // Not supported for load balancers operating with route mode enabled. + Port *int64 `json:"port,omitempty"` + + // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `65535` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `1` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMin *int64 `json:"port_min,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteLoadBalancerListenerPolicyRuleOptions : Instantiate DeleteLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewDeleteLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *DeleteLoadBalancerListenerPolicyRuleOptions { - return &DeleteLoadBalancerListenerPolicyRuleOptions{ +// Constants associated with the CreateLoadBalancerListenerOptions.Protocol property. +// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. +// Additional restrictions: +// - If this load balancer is in the `network` family, the protocol must be `tcp`. +// - If this listener has `https_redirect` specified, the protocol must be `http`. +// - If this listener is a listener's `https_redirect` target, the protocol must be `https`. +const ( + CreateLoadBalancerListenerOptionsProtocolHTTPConst = "http" + CreateLoadBalancerListenerOptionsProtocolHTTPSConst = "https" + CreateLoadBalancerListenerOptionsProtocolTCPConst = "tcp" +) + +// NewCreateLoadBalancerListenerOptions : Instantiate CreateLoadBalancerListenerOptions +func (*VpcV1) NewCreateLoadBalancerListenerOptions(loadBalancerID string, protocol string) *CreateLoadBalancerListenerOptions { + return &CreateLoadBalancerListenerOptions{ LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), + Protocol: core.StringPtr(protocol), } } // SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { +func (_options *CreateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerOptions { _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetListenerID : Allow user to set ListenerID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) +// SetProtocol : Allow user to set Protocol +func (_options *CreateLoadBalancerListenerOptions) SetProtocol(protocol string) *CreateLoadBalancerListenerOptions { + _options.Protocol = core.StringPtr(protocol) return _options } -// SetPolicyID : Allow user to set PolicyID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) +// SetAcceptProxyProtocol : Allow user to set AcceptProxyProtocol +func (_options *CreateLoadBalancerListenerOptions) SetAcceptProxyProtocol(acceptProxyProtocol bool) *CreateLoadBalancerListenerOptions { + _options.AcceptProxyProtocol = core.BoolPtr(acceptProxyProtocol) return _options } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) +// SetCertificateInstance : Allow user to set CertificateInstance +func (_options *CreateLoadBalancerListenerOptions) SetCertificateInstance(certificateInstance CertificateInstanceIdentityIntf) *CreateLoadBalancerListenerOptions { + _options.CertificateInstance = certificateInstance return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options +// SetConnectionLimit : Allow user to set ConnectionLimit +func (_options *CreateLoadBalancerListenerOptions) SetConnectionLimit(connectionLimit int64) *CreateLoadBalancerListenerOptions { + _options.ConnectionLimit = core.Int64Ptr(connectionLimit) + return _options } -// DeleteLoadBalancerOptions : The DeleteLoadBalancer options. -type DeleteLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` +// SetDefaultPool : Allow user to set DefaultPool +func (_options *CreateLoadBalancerListenerOptions) SetDefaultPool(defaultPool LoadBalancerPoolIdentityIntf) *CreateLoadBalancerListenerOptions { + _options.DefaultPool = defaultPool + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetHTTPSRedirect : Allow user to set HTTPSRedirect +func (_options *CreateLoadBalancerListenerOptions) SetHTTPSRedirect(httpsRedirect *LoadBalancerListenerHTTPSRedirectPrototype) *CreateLoadBalancerListenerOptions { + _options.HTTPSRedirect = httpsRedirect + return _options } -// NewDeleteLoadBalancerOptions : Instantiate DeleteLoadBalancerOptions -func (*VpcV1) NewDeleteLoadBalancerOptions(id string) *DeleteLoadBalancerOptions { - return &DeleteLoadBalancerOptions{ - ID: core.StringPtr(id), - } +// SetPolicies : Allow user to set Policies +func (_options *CreateLoadBalancerListenerOptions) SetPolicies(policies []LoadBalancerListenerPolicyPrototype) *CreateLoadBalancerListenerOptions { + _options.Policies = policies + return _options } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerOptions) SetID(id string) *DeleteLoadBalancerOptions { - _options.ID = core.StringPtr(id) +// SetPort : Allow user to set Port +func (_options *CreateLoadBalancerListenerOptions) SetPort(port int64) *CreateLoadBalancerListenerOptions { + _options.Port = core.Int64Ptr(port) + return _options +} + +// SetPortMax : Allow user to set PortMax +func (_options *CreateLoadBalancerListenerOptions) SetPortMax(portMax int64) *CreateLoadBalancerListenerOptions { + _options.PortMax = core.Int64Ptr(portMax) + return _options +} + +// SetPortMin : Allow user to set PortMin +func (_options *CreateLoadBalancerListenerOptions) SetPortMin(portMin int64) *CreateLoadBalancerListenerOptions { + _options.PortMin = core.Int64Ptr(portMin) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerOptions { +func (options *CreateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerOptions { options.Headers = param return options } -// DeleteLoadBalancerPoolMemberOptions : The DeleteLoadBalancerPoolMember options. -type DeleteLoadBalancerPoolMemberOptions struct { +// CreateLoadBalancerListenerPolicyOptions : The CreateLoadBalancerListenerPolicy options. +type CreateLoadBalancerListenerPolicyOptions struct { // The load balancer identifier. LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` - // The member identifier. - ID *string `json:"id" validate:"required,ne="` + // The policy action. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` + + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority" validate:"required"` + + // The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. + Name *string `json:"name,omitempty"` + + // The rule prototype objects for this policy. + Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` + + // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. + // - If `action` is `https_redirect`, specify a + // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteLoadBalancerPoolMemberOptions : Instantiate DeleteLoadBalancerPoolMemberOptions -func (*VpcV1) NewDeleteLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *DeleteLoadBalancerPoolMemberOptions { - return &DeleteLoadBalancerPoolMemberOptions{ +// Constants associated with the CreateLoadBalancerListenerPolicyOptions.Action property. +// The policy action. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. +const ( + CreateLoadBalancerListenerPolicyOptionsActionForwardConst = "forward" + CreateLoadBalancerListenerPolicyOptionsActionHTTPSRedirectConst = "https_redirect" + CreateLoadBalancerListenerPolicyOptionsActionRedirectConst = "redirect" + CreateLoadBalancerListenerPolicyOptionsActionRejectConst = "reject" +) + +// NewCreateLoadBalancerListenerPolicyOptions : Instantiate CreateLoadBalancerListenerPolicyOptions +func (*VpcV1) NewCreateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, action string, priority int64) *CreateLoadBalancerListenerPolicyOptions { + return &CreateLoadBalancerListenerPolicyOptions{ LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), + ListenerID: core.StringPtr(listenerID), + Action: core.StringPtr(action), + Priority: core.Int64Ptr(priority), } } // SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolMemberOptions { +func (_options *CreateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyOptions { _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetPoolID : Allow user to set PoolID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *DeleteLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) +// SetListenerID : Allow user to set ListenerID +func (_options *CreateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerPoolMemberOptions) SetID(id string) *DeleteLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) +// SetAction : Allow user to set Action +func (_options *CreateLoadBalancerListenerPolicyOptions) SetAction(action string) *CreateLoadBalancerListenerPolicyOptions { + _options.Action = core.StringPtr(action) + return _options +} + +// SetPriority : Allow user to set Priority +func (_options *CreateLoadBalancerListenerPolicyOptions) SetPriority(priority int64) *CreateLoadBalancerListenerPolicyOptions { + _options.Priority = core.Int64Ptr(priority) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateLoadBalancerListenerPolicyOptions) SetName(name string) *CreateLoadBalancerListenerPolicyOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetRules : Allow user to set Rules +func (_options *CreateLoadBalancerListenerPolicyOptions) SetRules(rules []LoadBalancerListenerPolicyRulePrototype) *CreateLoadBalancerListenerPolicyOptions { + _options.Rules = rules + return _options +} + +// SetTarget : Allow user to set Target +func (_options *CreateLoadBalancerListenerPolicyOptions) SetTarget(target LoadBalancerListenerPolicyTargetPrototypeIntf) *CreateLoadBalancerListenerPolicyOptions { + _options.Target = target return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolMemberOptions { +func (options *CreateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyOptions { options.Headers = param return options } -// DeleteLoadBalancerPoolOptions : The DeleteLoadBalancerPool options. -type DeleteLoadBalancerPoolOptions struct { +// CreateLoadBalancerListenerPolicyRuleOptions : The CreateLoadBalancerListenerPolicyRule options. +type CreateLoadBalancerListenerPolicyRuleOptions struct { // The load balancer identifier. LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The condition of the rule. + Condition *string `json:"condition" validate:"required"` + + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type" validate:"required"` + + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value" validate:"required"` + + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteLoadBalancerPoolOptions : Instantiate DeleteLoadBalancerPoolOptions -func (*VpcV1) NewDeleteLoadBalancerPoolOptions(loadBalancerID string, id string) *DeleteLoadBalancerPoolOptions { - return &DeleteLoadBalancerPoolOptions{ +// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Condition property. +// The condition of the rule. +const ( + CreateLoadBalancerListenerPolicyRuleOptionsConditionContainsConst = "contains" + CreateLoadBalancerListenerPolicyRuleOptionsConditionEqualsConst = "equals" + CreateLoadBalancerListenerPolicyRuleOptionsConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the CreateLoadBalancerListenerPolicyRuleOptions.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + CreateLoadBalancerListenerPolicyRuleOptionsTypeBodyConst = "body" + CreateLoadBalancerListenerPolicyRuleOptionsTypeHeaderConst = "header" + CreateLoadBalancerListenerPolicyRuleOptionsTypeHostnameConst = "hostname" + CreateLoadBalancerListenerPolicyRuleOptionsTypePathConst = "path" + CreateLoadBalancerListenerPolicyRuleOptionsTypeQueryConst = "query" +) + +// NewCreateLoadBalancerListenerPolicyRuleOptions : Instantiate CreateLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewCreateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, condition string, typeVar string, value string) *CreateLoadBalancerListenerPolicyRuleOptions { + return &CreateLoadBalancerListenerPolicyRuleOptions{ LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + Condition: core.StringPtr(condition), + Type: core.StringPtr(typeVar), + Value: core.StringPtr(value), } } // SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *DeleteLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolOptions { +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerListenerPolicyRuleOptions { _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteLoadBalancerPoolOptions) SetID(id string) *DeleteLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) +// SetListenerID : Allow user to set ListenerID +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteLoadBalancerPoolOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolOptions { - options.Headers = param - return options +// SetPolicyID : Allow user to set PolicyID +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options } -// DeleteNetworkACLOptions : The DeleteNetworkACL options. -type DeleteNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` +// SetCondition : Allow user to set Condition +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetCondition(condition string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Condition = core.StringPtr(condition) + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetType : Allow user to set Type +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetType(typeVar string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Type = core.StringPtr(typeVar) + return _options } -// NewDeleteNetworkACLOptions : Instantiate DeleteNetworkACLOptions -func (*VpcV1) NewDeleteNetworkACLOptions(id string) *DeleteNetworkACLOptions { - return &DeleteNetworkACLOptions{ - ID: core.StringPtr(id), - } +// SetValue : Allow user to set Value +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetValue(value string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Value = core.StringPtr(value) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteNetworkACLOptions) SetID(id string) *DeleteNetworkACLOptions { - _options.ID = core.StringPtr(id) +// SetField : Allow user to set Field +func (_options *CreateLoadBalancerListenerPolicyRuleOptions) SetField(field string) *CreateLoadBalancerListenerPolicyRuleOptions { + _options.Field = core.StringPtr(field) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteNetworkACLOptions) SetHeaders(param map[string]string) *DeleteNetworkACLOptions { +func (options *CreateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *CreateLoadBalancerListenerPolicyRuleOptions { options.Headers = param return options } -// DeleteNetworkACLRuleOptions : The DeleteNetworkACLRule options. -type DeleteNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` +// CreateLoadBalancerOptions : The CreateLoadBalancer options. +type CreateLoadBalancerOptions struct { + // Indicates whether this load balancer is public or private. + // + // At present, if route mode is enabled, the load balancer must be private. + IsPublic *bool `json:"is_public" validate:"required"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The subnets to provision this load balancer. + Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The listeners of this load balancer. + Listeners []LoadBalancerListenerPrototypeLoadBalancerContext `json:"listeners,omitempty"` -// NewDeleteNetworkACLRuleOptions : Instantiate DeleteNetworkACLRuleOptions -func (*VpcV1) NewDeleteNetworkACLRuleOptions(networkACLID string, id string) *DeleteNetworkACLRuleOptions { - return &DeleteNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), - } -} + // The logging configuration to use for this load balancer. See [VPC Datapath + // Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) + // on the logging format, fields and permitted values. + // + // To activate logging, the load balancer profile must support the specified logging + // type. + Logging *LoadBalancerLogging `json:"logging,omitempty"` -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *DeleteNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *DeleteNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} + // The user-defined name for this load balancer. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` -// SetID : Allow user to set ID -func (_options *DeleteNetworkACLRuleOptions) SetID(id string) *DeleteNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The pools of this load balancer. + Pools []LoadBalancerPoolPrototype `json:"pools,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *DeleteNetworkACLRuleOptions) SetHeaders(param map[string]string) *DeleteNetworkACLRuleOptions { - options.Headers = param - return options -} + // The profile to use for this load balancer. + Profile LoadBalancerProfileIdentityIntf `json:"profile,omitempty"` -// DeletePlacementGroupOptions : The DeletePlacementGroup options. -type DeletePlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Indicates whether route mode is enabled for this load balancer. + // + // At present, public load balancers are not supported with route mode enabled. + RouteMode *bool `json:"route_mode,omitempty"` + + // The security groups to use for this load balancer. If unspecified, the VPC's default security group is used. + // + // The load balancer profile must support security groups. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeletePlacementGroupOptions : Instantiate DeletePlacementGroupOptions -func (*VpcV1) NewDeletePlacementGroupOptions(id string) *DeletePlacementGroupOptions { - return &DeletePlacementGroupOptions{ - ID: core.StringPtr(id), +// NewCreateLoadBalancerOptions : Instantiate CreateLoadBalancerOptions +func (*VpcV1) NewCreateLoadBalancerOptions(isPublic bool, subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { + return &CreateLoadBalancerOptions{ + IsPublic: core.BoolPtr(isPublic), + Subnets: subnets, } } -// SetID : Allow user to set ID -func (_options *DeletePlacementGroupOptions) SetID(id string) *DeletePlacementGroupOptions { - _options.ID = core.StringPtr(id) +// SetIsPublic : Allow user to set IsPublic +func (_options *CreateLoadBalancerOptions) SetIsPublic(isPublic bool) *CreateLoadBalancerOptions { + _options.IsPublic = core.BoolPtr(isPublic) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeletePlacementGroupOptions) SetHeaders(param map[string]string) *DeletePlacementGroupOptions { - options.Headers = param - return options +// SetSubnets : Allow user to set Subnets +func (_options *CreateLoadBalancerOptions) SetSubnets(subnets []SubnetIdentityIntf) *CreateLoadBalancerOptions { + _options.Subnets = subnets + return _options } -// DeletePublicGatewayOptions : The DeletePublicGateway options. -type DeletePublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// SetListeners : Allow user to set Listeners +func (_options *CreateLoadBalancerOptions) SetListeners(listeners []LoadBalancerListenerPrototypeLoadBalancerContext) *CreateLoadBalancerOptions { + _options.Listeners = listeners + return _options } -// NewDeletePublicGatewayOptions : Instantiate DeletePublicGatewayOptions -func (*VpcV1) NewDeletePublicGatewayOptions(id string) *DeletePublicGatewayOptions { - return &DeletePublicGatewayOptions{ - ID: core.StringPtr(id), - } +// SetLogging : Allow user to set Logging +func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLogging) *CreateLoadBalancerOptions { + _options.Logging = logging + return _options } -// SetID : Allow user to set ID -func (_options *DeletePublicGatewayOptions) SetID(id string) *DeletePublicGatewayOptions { - _options.ID = core.StringPtr(id) +// SetName : Allow user to set Name +func (_options *CreateLoadBalancerOptions) SetName(name string) *CreateLoadBalancerOptions { + _options.Name = core.StringPtr(name) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) *DeletePublicGatewayOptions { - options.Headers = param - return options +// SetPools : Allow user to set Pools +func (_options *CreateLoadBalancerOptions) SetPools(pools []LoadBalancerPoolPrototype) *CreateLoadBalancerOptions { + _options.Pools = pools + return _options } -// DeleteSecurityGroupOptions : The DeleteSecurityGroup options. -type DeleteSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` +// SetProfile : Allow user to set Profile +func (_options *CreateLoadBalancerOptions) SetProfile(profile LoadBalancerProfileIdentityIntf) *CreateLoadBalancerOptions { + _options.Profile = profile + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateLoadBalancerOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateLoadBalancerOptions { + _options.ResourceGroup = resourceGroup + return _options } -// NewDeleteSecurityGroupOptions : Instantiate DeleteSecurityGroupOptions -func (*VpcV1) NewDeleteSecurityGroupOptions(id string) *DeleteSecurityGroupOptions { - return &DeleteSecurityGroupOptions{ - ID: core.StringPtr(id), - } +// SetRouteMode : Allow user to set RouteMode +func (_options *CreateLoadBalancerOptions) SetRouteMode(routeMode bool) *CreateLoadBalancerOptions { + _options.RouteMode = core.BoolPtr(routeMode) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupOptions) SetID(id string) *DeleteSecurityGroupOptions { - _options.ID = core.StringPtr(id) +// SetSecurityGroups : Allow user to set SecurityGroups +func (_options *CreateLoadBalancerOptions) SetSecurityGroups(securityGroups []SecurityGroupIdentityIntf) *CreateLoadBalancerOptions { + _options.SecurityGroups = securityGroups return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupOptions { +func (options *CreateLoadBalancerOptions) SetHeaders(param map[string]string) *CreateLoadBalancerOptions { options.Headers = param return options } -// DeleteSecurityGroupRuleOptions : The DeleteSecurityGroupRule options. -type DeleteSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` +// CreateLoadBalancerPoolMemberOptions : The CreateLoadBalancerPoolMember options. +type CreateLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` + + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) + // + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. + // + // The port must be unique across all members for all pools associated with this pool's listener. + Port *int64 `json:"port" validate:"required"` + + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. + Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` + + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteSecurityGroupRuleOptions : Instantiate DeleteSecurityGroupRuleOptions -func (*VpcV1) NewDeleteSecurityGroupRuleOptions(securityGroupID string, id string) *DeleteSecurityGroupRuleOptions { - return &DeleteSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// NewCreateLoadBalancerPoolMemberOptions : Instantiate CreateLoadBalancerPoolMemberOptions +func (*VpcV1) NewCreateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { + return &CreateLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + Port: core.Int64Ptr(port), + Target: target, } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *DeleteSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupRuleOptions) SetID(id string) *DeleteSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) +// SetPoolID : Allow user to set PoolID +func (_options *CreateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *CreateLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupRuleOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupRuleOptions { - options.Headers = param - return options -} - -// DeleteSecurityGroupTargetBindingOptions : The DeleteSecurityGroupTargetBinding options. -type DeleteSecurityGroupTargetBindingOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The security group target identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteSecurityGroupTargetBindingOptions : Instantiate DeleteSecurityGroupTargetBindingOptions -func (*VpcV1) NewDeleteSecurityGroupTargetBindingOptions(securityGroupID string, id string) *DeleteSecurityGroupTargetBindingOptions { - return &DeleteSecurityGroupTargetBindingOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - } +// SetPort : Allow user to set Port +func (_options *CreateLoadBalancerPoolMemberOptions) SetPort(port int64) *CreateLoadBalancerPoolMemberOptions { + _options.Port = core.Int64Ptr(port) + return _options } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *DeleteSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupTargetBindingOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) +// SetTarget : Allow user to set Target +func (_options *CreateLoadBalancerPoolMemberOptions) SetTarget(target LoadBalancerPoolMemberTargetPrototypeIntf) *CreateLoadBalancerPoolMemberOptions { + _options.Target = target return _options } -// SetID : Allow user to set ID -func (_options *DeleteSecurityGroupTargetBindingOptions) SetID(id string) *DeleteSecurityGroupTargetBindingOptions { - _options.ID = core.StringPtr(id) +// SetWeight : Allow user to set Weight +func (_options *CreateLoadBalancerPoolMemberOptions) SetWeight(weight int64) *CreateLoadBalancerPoolMemberOptions { + _options.Weight = core.Int64Ptr(weight) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupTargetBindingOptions { +func (options *CreateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolMemberOptions { options.Headers = param return options } -// DeleteSnapshotOptions : The DeleteSnapshot options. -type DeleteSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateLoadBalancerPoolOptions : The CreateLoadBalancerPool options. +type CreateLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The load balancing algorithm. + Algorithm *string `json:"algorithm" validate:"required"` + + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` + + // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers + // in the `application` family support `tcp`, `http`, and + // `https`. + Protocol *string `json:"protocol" validate:"required"` + + // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` + // tuple cannot be shared by a pool member of any other load balancer in the same VPC. + Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` + + // The user-defined name for this load balancer pool. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled + // + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol,omitempty"` + + // The session persistence of this pool. + SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteSnapshotOptions : Instantiate DeleteSnapshotOptions -func (*VpcV1) NewDeleteSnapshotOptions(id string) *DeleteSnapshotOptions { - return &DeleteSnapshotOptions{ - ID: core.StringPtr(id), +// Constants associated with the CreateLoadBalancerPoolOptions.Algorithm property. +// The load balancing algorithm. +const ( + CreateLoadBalancerPoolOptionsAlgorithmLeastConnectionsConst = "least_connections" + CreateLoadBalancerPoolOptionsAlgorithmRoundRobinConst = "round_robin" + CreateLoadBalancerPoolOptionsAlgorithmWeightedRoundRobinConst = "weighted_round_robin" +) + +// Constants associated with the CreateLoadBalancerPoolOptions.Protocol property. +// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers +// in the `application` family support `tcp`, `http`, and +// `https`. +const ( + CreateLoadBalancerPoolOptionsProtocolHTTPConst = "http" + CreateLoadBalancerPoolOptionsProtocolHTTPSConst = "https" + CreateLoadBalancerPoolOptionsProtocolTCPConst = "tcp" +) + +// Constants associated with the CreateLoadBalancerPoolOptions.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + CreateLoadBalancerPoolOptionsProxyProtocolDisabledConst = "disabled" + CreateLoadBalancerPoolOptionsProxyProtocolV1Const = "v1" + CreateLoadBalancerPoolOptionsProxyProtocolV2Const = "v2" +) + +// NewCreateLoadBalancerPoolOptions : Instantiate CreateLoadBalancerPoolOptions +func (*VpcV1) NewCreateLoadBalancerPoolOptions(loadBalancerID string, algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) *CreateLoadBalancerPoolOptions { + return &CreateLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + Algorithm: core.StringPtr(algorithm), + HealthMonitor: healthMonitor, + Protocol: core.StringPtr(protocol), } } -// SetID : Allow user to set ID -func (_options *DeleteSnapshotOptions) SetID(id string) *DeleteSnapshotOptions { - _options.ID = core.StringPtr(id) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *CreateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *CreateLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotOptions) SetHeaders(param map[string]string) *DeleteSnapshotOptions { - options.Headers = param - return options +// SetAlgorithm : Allow user to set Algorithm +func (_options *CreateLoadBalancerPoolOptions) SetAlgorithm(algorithm string) *CreateLoadBalancerPoolOptions { + _options.Algorithm = core.StringPtr(algorithm) + return _options } -// DeleteSnapshotsOptions : The DeleteSnapshots options. -type DeleteSnapshotsOptions struct { - // Filters the collection to resources with the source volume with the specified identifier. - SourceVolumeID *string `json:"source_volume.id" validate:"required"` +// SetHealthMonitor : Allow user to set HealthMonitor +func (_options *CreateLoadBalancerPoolOptions) SetHealthMonitor(healthMonitor *LoadBalancerPoolHealthMonitorPrototype) *CreateLoadBalancerPoolOptions { + _options.HealthMonitor = healthMonitor + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetProtocol : Allow user to set Protocol +func (_options *CreateLoadBalancerPoolOptions) SetProtocol(protocol string) *CreateLoadBalancerPoolOptions { + _options.Protocol = core.StringPtr(protocol) + return _options } -// NewDeleteSnapshotsOptions : Instantiate DeleteSnapshotsOptions -func (*VpcV1) NewDeleteSnapshotsOptions(sourceVolumeID string) *DeleteSnapshotsOptions { - return &DeleteSnapshotsOptions{ - SourceVolumeID: core.StringPtr(sourceVolumeID), - } +// SetMembers : Allow user to set Members +func (_options *CreateLoadBalancerPoolOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *CreateLoadBalancerPoolOptions { + _options.Members = members + return _options } -// SetSourceVolumeID : Allow user to set SourceVolumeID -func (_options *DeleteSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *DeleteSnapshotsOptions { - _options.SourceVolumeID = core.StringPtr(sourceVolumeID) +// SetName : Allow user to set Name +func (_options *CreateLoadBalancerPoolOptions) SetName(name string) *CreateLoadBalancerPoolOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetProxyProtocol : Allow user to set ProxyProtocol +func (_options *CreateLoadBalancerPoolOptions) SetProxyProtocol(proxyProtocol string) *CreateLoadBalancerPoolOptions { + _options.ProxyProtocol = core.StringPtr(proxyProtocol) + return _options +} + +// SetSessionPersistence : Allow user to set SessionPersistence +func (_options *CreateLoadBalancerPoolOptions) SetSessionPersistence(sessionPersistence *LoadBalancerPoolSessionPersistencePrototype) *CreateLoadBalancerPoolOptions { + _options.SessionPersistence = sessionPersistence return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteSnapshotsOptions) SetHeaders(param map[string]string) *DeleteSnapshotsOptions { +func (options *CreateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *CreateLoadBalancerPoolOptions { options.Headers = param return options } -// DeleteSubnetOptions : The DeleteSubnet options. -type DeleteSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateNetworkACLOptions : The CreateNetworkACL options. +type CreateNetworkACLOptions struct { + // The network ACL prototype object. + NetworkACLPrototype NetworkACLPrototypeIntf `json:"NetworkACLPrototype,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteSubnetOptions : Instantiate DeleteSubnetOptions -func (*VpcV1) NewDeleteSubnetOptions(id string) *DeleteSubnetOptions { - return &DeleteSubnetOptions{ - ID: core.StringPtr(id), - } +// NewCreateNetworkACLOptions : Instantiate CreateNetworkACLOptions +func (*VpcV1) NewCreateNetworkACLOptions() *CreateNetworkACLOptions { + return &CreateNetworkACLOptions{} } -// SetID : Allow user to set ID -func (_options *DeleteSubnetOptions) SetID(id string) *DeleteSubnetOptions { - _options.ID = core.StringPtr(id) +// SetNetworkACLPrototype : Allow user to set NetworkACLPrototype +func (_options *CreateNetworkACLOptions) SetNetworkACLPrototype(networkACLPrototype NetworkACLPrototypeIntf) *CreateNetworkACLOptions { + _options.NetworkACLPrototype = networkACLPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteSubnetOptions) SetHeaders(param map[string]string) *DeleteSubnetOptions { +func (options *CreateNetworkACLOptions) SetHeaders(param map[string]string) *CreateNetworkACLOptions { options.Headers = param return options } -// DeleteSubnetReservedIPOptions : The DeleteSubnetReservedIP options. -type DeleteSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` +// CreateNetworkACLRuleOptions : The CreateNetworkACLRule options. +type CreateNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` + // The network ACL rule prototype object. + NetworkACLRulePrototype NetworkACLRulePrototypeIntf `json:"NetworkACLRulePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteSubnetReservedIPOptions : Instantiate DeleteSubnetReservedIPOptions -func (*VpcV1) NewDeleteSubnetReservedIPOptions(subnetID string, id string) *DeleteSubnetReservedIPOptions { - return &DeleteSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), +// NewCreateNetworkACLRuleOptions : Instantiate CreateNetworkACLRuleOptions +func (*VpcV1) NewCreateNetworkACLRuleOptions(networkACLID string, networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { + return &CreateNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + NetworkACLRulePrototype: networkACLRulePrototype, } } -// SetSubnetID : Allow user to set SubnetID -func (_options *DeleteSubnetReservedIPOptions) SetSubnetID(subnetID string) *DeleteSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *CreateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *CreateNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteSubnetReservedIPOptions) SetID(id string) *DeleteSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) +// SetNetworkACLRulePrototype : Allow user to set NetworkACLRulePrototype +func (_options *CreateNetworkACLRuleOptions) SetNetworkACLRulePrototype(networkACLRulePrototype NetworkACLRulePrototypeIntf) *CreateNetworkACLRuleOptions { + _options.NetworkACLRulePrototype = networkACLRulePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteSubnetReservedIPOptions) SetHeaders(param map[string]string) *DeleteSubnetReservedIPOptions { +func (options *CreateNetworkACLRuleOptions) SetHeaders(param map[string]string) *CreateNetworkACLRuleOptions { options.Headers = param return options } -// DeleteVolumeOptions : The DeleteVolume options. -type DeleteVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` +// CreatePlacementGroupOptions : The CreatePlacementGroup options. +type CreatePlacementGroupOptions struct { + // The strategy for this placement group + // - `host_spread`: place on different compute hosts + // - `power_spread`: place on compute hosts that use different power sources + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the + // unexpected strategy was encountered. + Strategy *string `json:"strategy" validate:"required"` + + // The unique user-defined name for this placement group. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVolumeOptions : Instantiate DeleteVolumeOptions -func (*VpcV1) NewDeleteVolumeOptions(id string) *DeleteVolumeOptions { - return &DeleteVolumeOptions{ - ID: core.StringPtr(id), +// Constants associated with the CreatePlacementGroupOptions.Strategy property. +// The strategy for this placement group +// - `host_spread`: place on different compute hosts +// - `power_spread`: place on compute hosts that use different power sources +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the +// unexpected strategy was encountered. +const ( + CreatePlacementGroupOptionsStrategyHostSpreadConst = "host_spread" + CreatePlacementGroupOptionsStrategyPowerSpreadConst = "power_spread" +) + +// NewCreatePlacementGroupOptions : Instantiate CreatePlacementGroupOptions +func (*VpcV1) NewCreatePlacementGroupOptions(strategy string) *CreatePlacementGroupOptions { + return &CreatePlacementGroupOptions{ + Strategy: core.StringPtr(strategy), } } -// SetID : Allow user to set ID -func (_options *DeleteVolumeOptions) SetID(id string) *DeleteVolumeOptions { - _options.ID = core.StringPtr(id) +// SetStrategy : Allow user to set Strategy +func (_options *CreatePlacementGroupOptions) SetStrategy(strategy string) *CreatePlacementGroupOptions { + _options.Strategy = core.StringPtr(strategy) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreatePlacementGroupOptions) SetName(name string) *CreatePlacementGroupOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreatePlacementGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePlacementGroupOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVolumeOptions) SetHeaders(param map[string]string) *DeleteVolumeOptions { +func (options *CreatePlacementGroupOptions) SetHeaders(param map[string]string) *CreatePlacementGroupOptions { options.Headers = param return options } -// DeleteVPCAddressPrefixOptions : The DeleteVPCAddressPrefix options. -type DeleteVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// CreatePublicGatewayOptions : The CreatePublicGateway options. +type CreatePublicGatewayOptions struct { + // The VPC this public gateway will serve. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` + // The zone this public gateway will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + FloatingIP PublicGatewayFloatingIPPrototypeIntf `json:"floating_ip,omitempty"` + + // The user-defined name for this public gateway. Names must be unique within the VPC the public gateway resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPCAddressPrefixOptions : Instantiate DeleteVPCAddressPrefixOptions -func (*VpcV1) NewDeleteVPCAddressPrefixOptions(vpcID string, id string) *DeleteVPCAddressPrefixOptions { - return &DeleteVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewCreatePublicGatewayOptions : Instantiate CreatePublicGatewayOptions +func (*VpcV1) NewCreatePublicGatewayOptions(vpc VPCIdentityIntf, zone ZoneIdentityIntf) *CreatePublicGatewayOptions { + return &CreatePublicGatewayOptions{ + VPC: vpc, + Zone: zone, } } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCAddressPrefixOptions) SetVPCID(vpcID string) *DeleteVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetVPC : Allow user to set VPC +func (_options *CreatePublicGatewayOptions) SetVPC(vpc VPCIdentityIntf) *CreatePublicGatewayOptions { + _options.VPC = vpc return _options } -// SetID : Allow user to set ID -func (_options *DeleteVPCAddressPrefixOptions) SetID(id string) *DeleteVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) +// SetZone : Allow user to set Zone +func (_options *CreatePublicGatewayOptions) SetZone(zone ZoneIdentityIntf) *CreatePublicGatewayOptions { + _options.Zone = zone return _options } -// SetHeaders : Allow user to set Headers -func (options *DeleteVPCAddressPrefixOptions) SetHeaders(param map[string]string) *DeleteVPCAddressPrefixOptions { - options.Headers = param - return options -} - -// DeleteVPCOptions : The DeleteVPC options. -type DeleteVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// SetFloatingIP : Allow user to set FloatingIP +func (_options *CreatePublicGatewayOptions) SetFloatingIP(floatingIP PublicGatewayFloatingIPPrototypeIntf) *CreatePublicGatewayOptions { + _options.FloatingIP = floatingIP + return _options } -// NewDeleteVPCOptions : Instantiate DeleteVPCOptions -func (*VpcV1) NewDeleteVPCOptions(id string) *DeleteVPCOptions { - return &DeleteVPCOptions{ - ID: core.StringPtr(id), - } +// SetName : Allow user to set Name +func (_options *CreatePublicGatewayOptions) SetName(name string) *CreatePublicGatewayOptions { + _options.Name = core.StringPtr(name) + return _options } -// SetID : Allow user to set ID -func (_options *DeleteVPCOptions) SetID(id string) *DeleteVPCOptions { - _options.ID = core.StringPtr(id) +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreatePublicGatewayOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreatePublicGatewayOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPCOptions) SetHeaders(param map[string]string) *DeleteVPCOptions { +func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) *CreatePublicGatewayOptions { options.Headers = param return options } -// DeleteVPCRouteOptions : The DeleteVPCRoute options. -type DeleteVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The route identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateSecurityGroupOptions : The CreateSecurityGroup options. +type CreateSecurityGroupOptions struct { + // The VPC this security group is to be a part of. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` + + // The user-defined name for this security group. If unspecified, the name will be a hyphenated list of + // randomly-selected words. Names must be unique within the VPC the security group resides in. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // The prototype objects for rules to be created for this security group. If unspecified, no rules will be created, + // resulting in all traffic being denied. + Rules []SecurityGroupRulePrototypeIntf `json:"rules,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPCRouteOptions : Instantiate DeleteVPCRouteOptions -func (*VpcV1) NewDeleteVPCRouteOptions(vpcID string, id string) *DeleteVPCRouteOptions { - return &DeleteVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewCreateSecurityGroupOptions : Instantiate CreateSecurityGroupOptions +func (*VpcV1) NewCreateSecurityGroupOptions(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { + return &CreateSecurityGroupOptions{ + VPC: vpc, } } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRouteOptions) SetVPCID(vpcID string) *DeleteVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetVPC : Allow user to set VPC +func (_options *CreateSecurityGroupOptions) SetVPC(vpc VPCIdentityIntf) *CreateSecurityGroupOptions { + _options.VPC = vpc return _options } -// SetID : Allow user to set ID -func (_options *DeleteVPCRouteOptions) SetID(id string) *DeleteVPCRouteOptions { - _options.ID = core.StringPtr(id) +// SetName : Allow user to set Name +func (_options *CreateSecurityGroupOptions) SetName(name string) *CreateSecurityGroupOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateSecurityGroupOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSecurityGroupOptions { + _options.ResourceGroup = resourceGroup + return _options +} + +// SetRules : Allow user to set Rules +func (_options *CreateSecurityGroupOptions) SetRules(rules []SecurityGroupRulePrototypeIntf) *CreateSecurityGroupOptions { + _options.Rules = rules return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPCRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRouteOptions { +func (options *CreateSecurityGroupOptions) SetHeaders(param map[string]string) *CreateSecurityGroupOptions { options.Headers = param return options } -// DeleteVPCRoutingTableOptions : The DeleteVPCRoutingTable options. -type DeleteVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// CreateSecurityGroupRuleOptions : The CreateSecurityGroupRule options. +type CreateSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` + // The properties of the security group rule to be created. + SecurityGroupRulePrototype SecurityGroupRulePrototypeIntf `json:"SecurityGroupRulePrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPCRoutingTableOptions : Instantiate DeleteVPCRoutingTableOptions -func (*VpcV1) NewDeleteVPCRoutingTableOptions(vpcID string, id string) *DeleteVPCRoutingTableOptions { - return &DeleteVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewCreateSecurityGroupRuleOptions : Instantiate CreateSecurityGroupRuleOptions +func (*VpcV1) NewCreateSecurityGroupRuleOptions(securityGroupID string, securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { + return &CreateSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + SecurityGroupRulePrototype: securityGroupRulePrototype, } } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRoutingTableOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) return _options } -// SetID : Allow user to set ID -func (_options *DeleteVPCRoutingTableOptions) SetID(id string) *DeleteVPCRoutingTableOptions { - _options.ID = core.StringPtr(id) +// SetSecurityGroupRulePrototype : Allow user to set SecurityGroupRulePrototype +func (_options *CreateSecurityGroupRuleOptions) SetSecurityGroupRulePrototype(securityGroupRulePrototype SecurityGroupRulePrototypeIntf) *CreateSecurityGroupRuleOptions { + _options.SecurityGroupRulePrototype = securityGroupRulePrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPCRoutingTableOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableOptions { +func (options *CreateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *CreateSecurityGroupRuleOptions { options.Headers = param return options } -// DeleteVPCRoutingTableRouteOptions : The DeleteVPCRoutingTableRoute options. -type DeleteVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` +// CreateSecurityGroupTargetBindingOptions : The CreateSecurityGroupTargetBinding options. +type CreateSecurityGroupTargetBindingOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The VPC routing table route identifier. + // The security group target identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPCRoutingTableRouteOptions : Instantiate DeleteVPCRoutingTableRouteOptions -func (*VpcV1) NewDeleteVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *DeleteVPCRoutingTableRouteOptions { - return &DeleteVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), +// NewCreateSecurityGroupTargetBindingOptions : Instantiate CreateSecurityGroupTargetBindingOptions +func (*VpcV1) NewCreateSecurityGroupTargetBindingOptions(securityGroupID string, id string) *CreateSecurityGroupTargetBindingOptions { + return &CreateSecurityGroupTargetBindingOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *DeleteVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *DeleteVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *DeleteVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *CreateSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *CreateSecurityGroupTargetBindingOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) return _options } // SetID : Allow user to set ID -func (_options *DeleteVPCRoutingTableRouteOptions) SetID(id string) *DeleteVPCRoutingTableRouteOptions { +func (_options *CreateSecurityGroupTargetBindingOptions) SetID(id string) *CreateSecurityGroupTargetBindingOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableRouteOptions { +func (options *CreateSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *CreateSecurityGroupTargetBindingOptions { options.Headers = param return options } -// DeleteVPNGatewayConnectionOptions : The DeleteVPNGatewayConnection options. -type DeleteVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// CreateSnapshotOptions : The CreateSnapshot options. +type CreateSnapshotOptions struct { + // The volume to snapshot. + SourceVolume VolumeIdentityIntf `json:"source_volume" validate:"required"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique user-defined name for this snapshot. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNGatewayConnectionOptions : Instantiate DeleteVPNGatewayConnectionOptions -func (*VpcV1) NewDeleteVPNGatewayConnectionOptions(vpnGatewayID string, id string) *DeleteVPNGatewayConnectionOptions { - return &DeleteVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), +// NewCreateSnapshotOptions : Instantiate CreateSnapshotOptions +func (*VpcV1) NewCreateSnapshotOptions(sourceVolume VolumeIdentityIntf) *CreateSnapshotOptions { + return &CreateSnapshotOptions{ + SourceVolume: sourceVolume, } } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *DeleteVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *DeleteVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) +// SetSourceVolume : Allow user to set SourceVolume +func (_options *CreateSnapshotOptions) SetSourceVolume(sourceVolume VolumeIdentityIntf) *CreateSnapshotOptions { + _options.SourceVolume = sourceVolume return _options } -// SetID : Allow user to set ID -func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGatewayConnectionOptions { - _options.ID = core.StringPtr(id) +// SetName : Allow user to set Name +func (_options *CreateSnapshotOptions) SetName(name string) *CreateSnapshotOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateSnapshotOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateSnapshotOptions { + _options.ResourceGroup = resourceGroup return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { +func (options *CreateSnapshotOptions) SetHeaders(param map[string]string) *CreateSnapshotOptions { options.Headers = param return options } -// DeleteVPNGatewayOptions : The DeleteVPNGateway options. -type DeleteVPNGatewayOptions struct { - // The VPN gateway identifier. - ID *string `json:"id" validate:"required,ne="` +// CreateSubnetOptions : The CreateSubnet options. +type CreateSubnetOptions struct { + // The subnet prototype object. + SubnetPrototype SubnetPrototypeIntf `json:"SubnetPrototype" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewDeleteVPNGatewayOptions : Instantiate DeleteVPNGatewayOptions -func (*VpcV1) NewDeleteVPNGatewayOptions(id string) *DeleteVPNGatewayOptions { - return &DeleteVPNGatewayOptions{ - ID: core.StringPtr(id), +// NewCreateSubnetOptions : Instantiate CreateSubnetOptions +func (*VpcV1) NewCreateSubnetOptions(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { + return &CreateSubnetOptions{ + SubnetPrototype: subnetPrototype, } } -// SetID : Allow user to set ID -func (_options *DeleteVPNGatewayOptions) SetID(id string) *DeleteVPNGatewayOptions { - _options.ID = core.StringPtr(id) +// SetSubnetPrototype : Allow user to set SubnetPrototype +func (_options *CreateSubnetOptions) SetSubnetPrototype(subnetPrototype SubnetPrototypeIntf) *CreateSubnetOptions { + _options.SubnetPrototype = subnetPrototype return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteVPNGatewayOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayOptions { +func (options *CreateSubnetOptions) SetHeaders(param map[string]string) *CreateSubnetOptions { options.Headers = param return options } -// EncryptionKeyIdentity : Identifies an encryption key by a unique property. -// Models which "extend" this model: -// - EncryptionKeyIdentityByCRN -type EncryptionKeyIdentity struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn,omitempty"` -} +// CreateSubnetReservedIPOptions : The CreateSubnetReservedIP options. +type CreateSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` -func (*EncryptionKeyIdentity) isaEncryptionKeyIdentity() bool { - return true -} + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` -type EncryptionKeyIdentityIntf interface { - isaEncryptionKeyIdentity() bool + // The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected + // words. Names must be unique within the subnet the reserved IP resides in. Names beginning with `ibm-` are reserved + // for provider-owned resources. + Name *string `json:"name,omitempty"` + + // The target this reserved IP is to be bound to. The target must be an endpoint gateway not + // already bound to a reserved IP in the subnet's zone. + Target ReservedIPTargetPrototypeIntf `json:"target,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEncryptionKeyIdentity unmarshals an instance of EncryptionKeyIdentity from the specified map of raw messages. -func UnmarshalEncryptionKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyIdentity) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +// NewCreateSubnetReservedIPOptions : Instantiate CreateSubnetReservedIPOptions +func (*VpcV1) NewCreateSubnetReservedIPOptions(subnetID string) *CreateSubnetReservedIPOptions { + return &CreateSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EncryptionKeyReference : EncryptionKeyReference struct -type EncryptionKeyReference struct { - // The CRN of the [Key Protect Root - // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto - // Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. - CRN *string `json:"crn" validate:"required"` +// SetSubnetID : Allow user to set SubnetID +func (_options *CreateSubnetReservedIPOptions) SetSubnetID(subnetID string) *CreateSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options } -// UnmarshalEncryptionKeyReference unmarshals an instance of EncryptionKeyReference from the specified map of raw messages. -func UnmarshalEncryptionKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EncryptionKeyReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetAutoDelete : Allow user to set AutoDelete +func (_options *CreateSubnetReservedIPOptions) SetAutoDelete(autoDelete bool) *CreateSubnetReservedIPOptions { + _options.AutoDelete = core.BoolPtr(autoDelete) + return _options } -// EndpointGateway : EndpointGateway struct -type EndpointGateway struct { - // The date and time that the endpoint gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this endpoint gateway. - CRN *string `json:"crn" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateSubnetReservedIPOptions) SetName(name string) *CreateSubnetReservedIPOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The health of this resource. - // - `ok`: No abnormal behavior detected - // - `degraded`: Experiencing compromised performance, capacity, or connectivity - // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated - // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a - // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also - // have this state. - HealthState *string `json:"health_state" validate:"required"` +// SetTarget : Allow user to set Target +func (_options *CreateSubnetReservedIPOptions) SetTarget(target ReservedIPTargetPrototypeIntf) *CreateSubnetReservedIPOptions { + _options.Target = target + return _options +} - // The URL for this endpoint gateway. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateSubnetReservedIPOptions) SetHeaders(param map[string]string) *CreateSubnetReservedIPOptions { + options.Headers = param + return options +} - // The unique identifier for this endpoint gateway. - ID *string `json:"id" validate:"required"` +// CreateVolumeOptions : The CreateVolume options. +type CreateVolumeOptions struct { + // The volume prototype object. + VolumePrototype VolumePrototypeIntf `json:"VolumePrototype" validate:"required"` - // The reserved IPs bound to this endpoint gateway. - Ips []ReservedIPReference `json:"ips" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The lifecycle state of the endpoint gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` +// NewCreateVolumeOptions : Instantiate CreateVolumeOptions +func (*VpcV1) NewCreateVolumeOptions(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { + return &CreateVolumeOptions{ + VolumePrototype: volumePrototype, + } +} - // The unique user-defined name for this endpoint gateway. - Name *string `json:"name" validate:"required"` +// SetVolumePrototype : Allow user to set VolumePrototype +func (_options *CreateVolumeOptions) SetVolumePrototype(volumePrototype VolumePrototypeIntf) *CreateVolumeOptions { + _options.VolumePrototype = volumePrototype + return _options +} - // The resource group for this endpoint gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateVolumeOptions) SetHeaders(param map[string]string) *CreateVolumeOptions { + options.Headers = param + return options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// CreateVPCAddressPrefixOptions : The CreateVPCAddressPrefix options. +type CreateVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The security groups targeting this endpoint gateway. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + // The IPv4 range of the address prefix, expressed in CIDR format. The request must not overlap with any existing + // address prefixes in the VPC or any of the following reserved address ranges: + // - `127.0.0.0/8` (IPv4 loopback addresses) + // - `161.26.0.0/16` (IBM services) + // - `166.8.0.0/14` (Cloud Service Endpoints) + // - `169.254.0.0/16` (IPv4 link-local addresses) + // - `224.0.0.0/4` (IPv4 multicast addresses) + // + // The prefix length of the address prefix's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). + CIDR *string `json:"cidr" validate:"required"` - // The fully qualified domain name for the target service. - ServiceEndpoint *string `json:"service_endpoint,omitempty"` + // The zone this address prefix will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The fully qualified domain names for the target service. - ServiceEndpoints []string `json:"service_endpoints" validate:"required"` + // Indicates whether this will be the default address prefix for this zone in this VPC. If `true`, the VPC must not + // have a default address prefix for this zone. + IsDefault *bool `json:"is_default,omitempty"` - // The target for this endpoint gateway. - Target EndpointGatewayTargetIntf `json:"target" validate:"required"` + // The user-defined name for this address prefix. Names must be unique within the VPC the address prefix resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The VPC this endpoint gateway is serving. - VPC *VPCReference `json:"vpc" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the EndpointGateway.HealthState property. -// The health of this resource. -// - `ok`: No abnormal behavior detected -// - `degraded`: Experiencing compromised performance, capacity, or connectivity -// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated -// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle -// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this -// state. -const ( - EndpointGatewayHealthStateDegradedConst = "degraded" - EndpointGatewayHealthStateFaultedConst = "faulted" - EndpointGatewayHealthStateInapplicableConst = "inapplicable" - EndpointGatewayHealthStateOkConst = "ok" -) - -// Constants associated with the EndpointGateway.LifecycleState property. -// The lifecycle state of the endpoint gateway. -const ( - EndpointGatewayLifecycleStateDeletingConst = "deleting" - EndpointGatewayLifecycleStateFailedConst = "failed" - EndpointGatewayLifecycleStatePendingConst = "pending" - EndpointGatewayLifecycleStateStableConst = "stable" - EndpointGatewayLifecycleStateSuspendedConst = "suspended" - EndpointGatewayLifecycleStateUpdatingConst = "updating" - EndpointGatewayLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the EndpointGateway.ResourceType property. -// The resource type. -const ( - EndpointGatewayResourceTypeEndpointGatewayConst = "endpoint_gateway" -) - -// UnmarshalEndpointGateway unmarshals an instance of EndpointGateway from the specified map of raw messages. -func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGateway) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "service_endpoints", &obj.ServiceEndpoints) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return +// NewCreateVPCAddressPrefixOptions : Instantiate CreateVPCAddressPrefixOptions +func (*VpcV1) NewCreateVPCAddressPrefixOptions(vpcID string, cidr string, zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { + return &CreateVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + CIDR: core.StringPtr(cidr), + Zone: zone, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayCollection : EndpointGatewayCollection struct -type EndpointGatewayCollection struct { - // Collection of endpoint gateways. - EndpointGateways []EndpointGateway `json:"endpoint_gateways" validate:"required"` +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCAddressPrefixOptions) SetVPCID(vpcID string) *CreateVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // A link to the first page of resources. - First *EndpointGatewayCollectionFirst `json:"first" validate:"required"` +// SetCIDR : Allow user to set CIDR +func (_options *CreateVPCAddressPrefixOptions) SetCIDR(cidr string) *CreateVPCAddressPrefixOptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetZone : Allow user to set Zone +func (_options *CreateVPCAddressPrefixOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCAddressPrefixOptions { + _options.Zone = zone + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *EndpointGatewayCollectionNext `json:"next,omitempty"` +// SetIsDefault : Allow user to set IsDefault +func (_options *CreateVPCAddressPrefixOptions) SetIsDefault(isDefault bool) *CreateVPCAddressPrefixOptions { + _options.IsDefault = core.BoolPtr(isDefault) + return _options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// SetName : Allow user to set Name +func (_options *CreateVPCAddressPrefixOptions) SetName(name string) *CreateVPCAddressPrefixOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalEndpointGatewayCollection unmarshals an instance of EndpointGatewayCollection from the specified map of raw messages. -func UnmarshalEndpointGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollection) - err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGateway) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalEndpointGatewayCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalEndpointGatewayCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *CreateVPCAddressPrefixOptions { + options.Headers = param + return options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *EndpointGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} +// CreateVPCOptions : The CreateVPC options. +type CreateVPCOptions struct { + // Indicates whether a default address prefix will be automatically created for each zone in this VPC. If `manual`, + // this VPC will be created with no default address prefixes. + // + // Since address prefixes are managed identically regardless of whether they were automatically created, the value is + // not preserved as a VPC property. + AddressPrefixManagement *string `json:"address_prefix_management,omitempty"` -// EndpointGatewayCollectionFirst : A link to the first page of resources. -type EndpointGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + // Indicates whether this VPC will be connected to Classic Infrastructure. If true, this VPC's resources will have + // private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be + // connected in this way. This value is set at creation and subsequently immutable. + ClassicAccess *bool `json:"classic_access,omitempty"` -// UnmarshalEndpointGatewayCollectionFirst unmarshals an instance of EndpointGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalEndpointGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The unique user-defined name for this VPC. If unspecified, the name will be a hyphenated list of randomly-selected + // words. + Name *string `json:"name,omitempty"` -// EndpointGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type EndpointGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalEndpointGatewayCollectionNext unmarshals an instance of EndpointGatewayCollectionNext from the specified map of raw messages. -func UnmarshalEndpointGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// Constants associated with the CreateVPCOptions.AddressPrefixManagement property. +// Indicates whether a default address prefix will be automatically created for each zone in this VPC. If `manual`, this +// VPC will be created with no default address prefixes. +// +// Since address prefixes are managed identically regardless of whether they were automatically created, the value is +// not preserved as a VPC property. +const ( + CreateVPCOptionsAddressPrefixManagementAutoConst = "auto" + CreateVPCOptionsAddressPrefixManagementManualConst = "manual" +) + +// NewCreateVPCOptions : Instantiate CreateVPCOptions +func (*VpcV1) NewCreateVPCOptions() *CreateVPCOptions { + return &CreateVPCOptions{} } -// EndpointGatewayPatch : EndpointGatewayPatch struct -type EndpointGatewayPatch struct { - // The user-defined name for this endpoint gateway. Names must be unique within the VPC this endpoint gateway is - // serving. - Name *string `json:"name,omitempty"` +// SetAddressPrefixManagement : Allow user to set AddressPrefixManagement +func (_options *CreateVPCOptions) SetAddressPrefixManagement(addressPrefixManagement string) *CreateVPCOptions { + _options.AddressPrefixManagement = core.StringPtr(addressPrefixManagement) + return _options } -// UnmarshalEndpointGatewayPatch unmarshals an instance of EndpointGatewayPatch from the specified map of raw messages. -func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetClassicAccess : Allow user to set ClassicAccess +func (_options *CreateVPCOptions) SetClassicAccess(classicAccess bool) *CreateVPCOptions { + _options.ClassicAccess = core.BoolPtr(classicAccess) + return _options } -// AsPatch returns a generic map representation of the EndpointGatewayPatch -func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(endpointGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetName : Allow user to set Name +func (_options *CreateVPCOptions) SetName(name string) *CreateVPCOptions { + _options.Name = core.StringPtr(name) + return _options } -// EndpointGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type EndpointGatewayReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateVPCOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateVPCOptions { + _options.ResourceGroup = resourceGroup + return _options } -// UnmarshalEndpointGatewayReferenceDeleted unmarshals an instance of EndpointGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalEndpointGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *CreateVPCOptions) SetHeaders(param map[string]string) *CreateVPCOptions { + options.Headers = param + return options } -// EndpointGatewayReservedIP : A reserved IP to bind to the endpoint gateway. This can be specified using an existing reserved IP, or a prototype -// object for a new reserved IP. The reserved IP will be bound to the endpoint gateway to function as a virtual private -// endpoint for the service. -// Models which "extend" this model: -// - EndpointGatewayReservedIPReservedIPIdentity -// - EndpointGatewayReservedIPReservedIPPrototypeTargetContext -type EndpointGatewayReservedIP struct { - // The unique identifier for this reserved IP. - ID *string `json:"id,omitempty"` +// CreateVPCRouteOptions : The CreateVPCRoute options. +type CreateVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The URL for this reserved IP. - Href *string `json:"href,omitempty"` + // The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if + // both routes have an `action` of `deliver` and the + // `next_hop` is an IP address. + Destination *string `json:"destination" validate:"required"` - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` + // The zone to apply the route to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected - // words. Names must be unique within the subnet the reserved IP resides in. Names beginning with `ibm-` are reserved - // for provider-owned resources. + // The action to perform with a packet matching the route: + // - `delegate`: delegate to the system's built-in routes + // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound + // routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action,omitempty"` + + // The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. + // Names must be unique within the VPC routing table the route resides in. Name *string `json:"name,omitempty"` - // The subnet in which to create this reserved IP. - Subnet SubnetIdentityIntf `json:"subnet,omitempty"` -} + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, it must be omitted or specified as `0.0.0.0`. + NextHop RouteNextHopPrototypeIntf `json:"next_hop,omitempty"` -func (*EndpointGatewayReservedIP) isaEndpointGatewayReservedIP() bool { - return true + // Allows users to set headers on API requests + Headers map[string]string } -type EndpointGatewayReservedIPIntf interface { - isaEndpointGatewayReservedIP() bool -} +// Constants associated with the CreateVPCRouteOptions.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to the system's built-in routes +// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound +// routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + CreateVPCRouteOptionsActionDelegateConst = "delegate" + CreateVPCRouteOptionsActionDelegateVPCConst = "delegate_vpc" + CreateVPCRouteOptionsActionDeliverConst = "deliver" + CreateVPCRouteOptionsActionDropConst = "drop" +) -// UnmarshalEndpointGatewayReservedIP unmarshals an instance of EndpointGatewayReservedIP from the specified map of raw messages. -func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayReservedIP) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - return +// NewCreateVPCRouteOptions : Instantiate CreateVPCRouteOptions +func (*VpcV1) NewCreateVPCRouteOptions(vpcID string, destination string, zone ZoneIdentityIntf) *CreateVPCRouteOptions { + return &CreateVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + Destination: core.StringPtr(destination), + Zone: zone, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// EndpointGatewayTarget : The target for this endpoint gateway. -// Models which "extend" this model: -// - EndpointGatewayTargetProviderCloudServiceReference -// - EndpointGatewayTargetProviderInfrastructureServiceReference -type EndpointGatewayTarget struct { - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` - - // The type of target. - ResourceType *string `json:"resource_type,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCRouteOptions) SetVPCID(vpcID string) *CreateVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - Name *string `json:"name,omitempty"` +// SetDestination : Allow user to set Destination +func (_options *CreateVPCRouteOptions) SetDestination(destination string) *CreateVPCRouteOptions { + _options.Destination = core.StringPtr(destination) + return _options } -// Constants associated with the EndpointGatewayTarget.ResourceType property. -// The type of target. -const ( - EndpointGatewayTargetResourceTypeProviderCloudServiceConst = "provider_cloud_service" -) +// SetZone : Allow user to set Zone +func (_options *CreateVPCRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRouteOptions { + _options.Zone = zone + return _options +} -func (*EndpointGatewayTarget) isaEndpointGatewayTarget() bool { - return true +// SetAction : Allow user to set Action +func (_options *CreateVPCRouteOptions) SetAction(action string) *CreateVPCRouteOptions { + _options.Action = core.StringPtr(action) + return _options } -type EndpointGatewayTargetIntf interface { - isaEndpointGatewayTarget() bool +// SetName : Allow user to set Name +func (_options *CreateVPCRouteOptions) SetName(name string) *CreateVPCRouteOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalEndpointGatewayTarget unmarshals an instance of EndpointGatewayTarget from the specified map of raw messages. -func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EndpointGatewayTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetNextHop : Allow user to set NextHop +func (_options *CreateVPCRouteOptions) SetNextHop(nextHop RouteNextHopPrototypeIntf) *CreateVPCRouteOptions { + _options.NextHop = nextHop + return _options } -// EndpointGatewayTargetPrototype : The target for this endpoint gateway. -// Models which "extend" this model: -// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity -// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity -type EndpointGatewayTargetPrototype struct { - // The type of target for this endpoint gateway. - ResourceType *string `json:"resource_type" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateVPCRouteOptions) SetHeaders(param map[string]string) *CreateVPCRouteOptions { + options.Headers = param + return options +} - // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. - CRN *string `json:"crn,omitempty"` +// CreateVPCRoutingTableOptions : The CreateVPCRoutingTable options. +type CreateVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The name of a provider infrastructure service. Must be: - // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + // The user-defined name for this routing table. Names must be unique within the VPC the routing table resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` + + // If set to `true`, this routing table will be used to route traffic that originates from [Direct + // Link](https://cloud.ibm.com/docs/dl/) to this VPC. For this to succeed, the VPC must not already have a routing + // table with this property set to `true`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` + + // If set to `true`, this routing table will be used to route traffic that originates from [Transit + // Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. For this to succeed, the VPC must not already + // have a routing table with this property set to `true`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + // + // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled + // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing + // table. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` + + // If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in + // this VPC. For this to succeed, the VPC must not already have a routing table with this property set to `true`. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` + + // The prototype objects for routes to create for this routing table. If unspecified, the routing table will be created + // with no routes. + Routes []RoutePrototype `json:"routes,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the EndpointGatewayTargetPrototype.ResourceType property. -// The type of target for this endpoint gateway. -const ( - EndpointGatewayTargetPrototypeResourceTypeProviderCloudServiceConst = "provider_cloud_service" - EndpointGatewayTargetPrototypeResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" -) +// NewCreateVPCRoutingTableOptions : Instantiate CreateVPCRoutingTableOptions +func (*VpcV1) NewCreateVPCRoutingTableOptions(vpcID string) *CreateVPCRoutingTableOptions { + return &CreateVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), + } +} -func (*EndpointGatewayTargetPrototype) isaEndpointGatewayTargetPrototype() bool { - return true +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCRoutingTableOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options } -type EndpointGatewayTargetPrototypeIntf interface { - isaEndpointGatewayTargetPrototype() bool +// SetName : Allow user to set Name +func (_options *CreateVPCRoutingTableOptions) SetName(name string) *CreateVPCRoutingTableOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalEndpointGatewayTargetPrototype unmarshals an instance of EndpointGatewayTargetPrototype from the specified map of raw messages. -func UnmarshalEndpointGatewayTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "resource_type", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'resource_type': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'resource_type' not found in JSON object") - return - } - if discValue == "provider_cloud_service" { - err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity) - } else if discValue == "provider_infrastructure_service" { - err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'resource_type': %s", discValue) - } - return +// SetRouteDirectLinkIngress : Allow user to set RouteDirectLinkIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteDirectLinkIngress(routeDirectLinkIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteDirectLinkIngress = core.BoolPtr(routeDirectLinkIngress) + return _options } -// FloatingIP : FloatingIP struct -type FloatingIP struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` +// SetRouteTransitGatewayIngress : Allow user to set RouteTransitGatewayIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteTransitGatewayIngress(routeTransitGatewayIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteTransitGatewayIngress = core.BoolPtr(routeTransitGatewayIngress) + return _options +} - // The date and time that the floating IP was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetRouteVPCZoneIngress : Allow user to set RouteVPCZoneIngress +func (_options *CreateVPCRoutingTableOptions) SetRouteVPCZoneIngress(routeVPCZoneIngress bool) *CreateVPCRoutingTableOptions { + _options.RouteVPCZoneIngress = core.BoolPtr(routeVPCZoneIngress) + return _options +} - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` +// SetRoutes : Allow user to set Routes +func (_options *CreateVPCRoutingTableOptions) SetRoutes(routes []RoutePrototype) *CreateVPCRoutingTableOptions { + _options.Routes = routes + return _options +} - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *CreateVPCRoutingTableOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableOptions { + options.Headers = param + return options +} - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` +// CreateVPCRoutingTableRouteOptions : The CreateVPCRoutingTableRoute options. +type CreateVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The unique user-defined name for this floating IP. - Name *string `json:"name" validate:"required"` + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - // The resource group for this floating IP. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if + // both routes have an `action` of `deliver` and the + // `next_hop` is an IP address. + Destination *string `json:"destination" validate:"required"` - // The status of the floating IP. - Status *string `json:"status" validate:"required"` + // The zone to apply the route to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The target of this floating IP. - Target FloatingIPTargetIntf `json:"target,omitempty"` + // The action to perform with a packet matching the route: + // - `delegate`: delegate to the system's built-in routes + // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound + // routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action,omitempty"` - // The zone this floating IP resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. + // Names must be unique within the VPC routing table the route resides in. + Name *string `json:"name,omitempty"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, it must be omitted or specified as `0.0.0.0`. + NextHop RouteNextHopPrototypeIntf `json:"next_hop,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the FloatingIP.Status property. -// The status of the floating IP. +// Constants associated with the CreateVPCRoutingTableRouteOptions.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to the system's built-in routes +// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound +// routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. const ( - FloatingIPStatusAvailableConst = "available" - FloatingIPStatusDeletingConst = "deleting" - FloatingIPStatusFailedConst = "failed" - FloatingIPStatusPendingConst = "pending" + CreateVPCRoutingTableRouteOptionsActionDelegateConst = "delegate" + CreateVPCRoutingTableRouteOptionsActionDelegateVPCConst = "delegate_vpc" + CreateVPCRoutingTableRouteOptionsActionDeliverConst = "deliver" + CreateVPCRoutingTableRouteOptionsActionDropConst = "drop" ) -// UnmarshalFloatingIP unmarshals an instance of FloatingIP from the specified map of raw messages. -func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// NewCreateVPCRoutingTableRouteOptions : Instantiate CreateVPCRoutingTableRouteOptions +func (*VpcV1) NewCreateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, destination string, zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { + return &CreateVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + Destination: core.StringPtr(destination), + Zone: zone, + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *CreateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *CreateVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *CreateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *CreateVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options +} + +// SetDestination : Allow user to set Destination +func (_options *CreateVPCRoutingTableRouteOptions) SetDestination(destination string) *CreateVPCRoutingTableRouteOptions { + _options.Destination = core.StringPtr(destination) + return _options +} + +// SetZone : Allow user to set Zone +func (_options *CreateVPCRoutingTableRouteOptions) SetZone(zone ZoneIdentityIntf) *CreateVPCRoutingTableRouteOptions { + _options.Zone = zone + return _options +} + +// SetAction : Allow user to set Action +func (_options *CreateVPCRoutingTableRouteOptions) SetAction(action string) *CreateVPCRoutingTableRouteOptions { + _options.Action = core.StringPtr(action) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateVPCRoutingTableRouteOptions) SetName(name string) *CreateVPCRoutingTableRouteOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetNextHop : Allow user to set NextHop +func (_options *CreateVPCRoutingTableRouteOptions) SetNextHop(nextHop RouteNextHopPrototypeIntf) *CreateVPCRoutingTableRouteOptions { + _options.NextHop = nextHop + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *CreateVPCRoutingTableRouteOptions { + options.Headers = param + return options +} + +// CreateVPNGatewayConnectionOptions : The CreateVPNGatewayConnection options. +type CreateVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection prototype object. + VPNGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf `json:"VPNGatewayConnectionPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateVPNGatewayConnectionOptions : Instantiate CreateVPNGatewayConnectionOptions +func (*VpcV1) NewCreateVPNGatewayConnectionOptions(vpnGatewayID string, vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { + return &CreateVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + VPNGatewayConnectionPrototype: vpnGatewayConnectionPrototype, + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *CreateVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetVPNGatewayConnectionPrototype : Allow user to set VPNGatewayConnectionPrototype +func (_options *CreateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPrototype(vpnGatewayConnectionPrototype VPNGatewayConnectionPrototypeIntf) *CreateVPNGatewayConnectionOptions { + _options.VPNGatewayConnectionPrototype = vpnGatewayConnectionPrototype + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *CreateVPNGatewayConnectionOptions { + options.Headers = param + return options +} + +// CreateVPNGatewayOptions : The CreateVPNGateway options. +type CreateVPNGatewayOptions struct { + // The VPN gateway prototype object. + VPNGatewayPrototype VPNGatewayPrototypeIntf `json:"VPNGatewayPrototype" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewCreateVPNGatewayOptions : Instantiate CreateVPNGatewayOptions +func (*VpcV1) NewCreateVPNGatewayOptions(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { + return &CreateVPNGatewayOptions{ + VPNGatewayPrototype: vpnGatewayPrototype, + } +} + +// SetVPNGatewayPrototype : Allow user to set VPNGatewayPrototype +func (_options *CreateVPNGatewayOptions) SetVPNGatewayPrototype(vpnGatewayPrototype VPNGatewayPrototypeIntf) *CreateVPNGatewayOptions { + _options.VPNGatewayPrototype = vpnGatewayPrototype + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateVPNGatewayOptions) SetHeaders(param map[string]string) *CreateVPNGatewayOptions { + options.Headers = param + return options +} + +// DedicatedHost : DedicatedHost struct +type DedicatedHost struct { + // The amount of memory in gibibytes that is currently available for instances. + AvailableMemory *int64 `json:"available_memory" validate:"required"` + + // The available VCPU for the dedicated host. + AvailableVcpu *Vcpu `json:"available_vcpu" validate:"required"` + + // The date and time that the dedicated host was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` + + // Collection of the dedicated host's disks. + Disks []DedicatedHostDisk `json:"disks" validate:"required"` + + // The dedicated host group this dedicated host is in. + Group *DedicatedHostGroupReference `json:"group" validate:"required"` + + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` + + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled" validate:"required"` + + // The instances that are allocated to this dedicated host. + Instances []InstanceReference `json:"instances" validate:"required"` + + // The lifecycle state of the dedicated host. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The total amount of memory in gibibytes for this host. + Memory *int64 `json:"memory" validate:"required"` + + // The unique user-defined name for this dedicated host. + Name *string `json:"name" validate:"required"` + + // The profile this dedicated host uses. + Profile *DedicatedHostProfileReference `json:"profile" validate:"required"` + + // Indicates whether this dedicated host is available for instance creation. + Provisionable *bool `json:"provisionable" validate:"required"` + + // The resource group for this dedicated host. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The total number of sockets for this host. + SocketCount *int64 `json:"socket_count" validate:"required"` + + // The administrative state of the dedicated host. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which + // the unexpected property value was encountered. + State *string `json:"state" validate:"required"` + + // The instance profiles usable by instances placed on this dedicated host. + SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` + + // The total VCPU of the dedicated host. + Vcpu *Vcpu `json:"vcpu" validate:"required"` + + // The zone this dedicated host resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the DedicatedHost.LifecycleState property. +// The lifecycle state of the dedicated host. +const ( + DedicatedHostLifecycleStateDeletingConst = "deleting" + DedicatedHostLifecycleStateFailedConst = "failed" + DedicatedHostLifecycleStatePendingConst = "pending" + DedicatedHostLifecycleStateStableConst = "stable" + DedicatedHostLifecycleStateSuspendedConst = "suspended" + DedicatedHostLifecycleStateUpdatingConst = "updating" + DedicatedHostLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the DedicatedHost.ResourceType property. +// The resource type. +const ( + DedicatedHostResourceTypeDedicatedHostConst = "dedicated_host" +) + +// Constants associated with the DedicatedHost.State property. +// The administrative state of the dedicated host. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the dedicated host on which +// the unexpected property value was encountered. +const ( + DedicatedHostStateAvailableConst = "available" + DedicatedHostStateDegradedConst = "degraded" + DedicatedHostStateMigratingConst = "migrating" + DedicatedHostStateUnavailableConst = "unavailable" +) + +// UnmarshalDedicatedHost unmarshals an instance of DedicatedHost from the specified map of raw messages. +func UnmarshalDedicatedHost(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHost) + err = core.UnmarshalPrimitive(m, "available_memory", &obj.AvailableMemory) + if err != nil { + return + } + err = core.UnmarshalModel(m, "available_vcpu", &obj.AvailableVcpu, UnmarshalVcpu) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -25356,6 +25512,14 @@ func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupReference) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -25364,58 +25528,59 @@ func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstanceReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTarget) + err = core.UnmarshalPrimitive(m, "socket_count", &obj.SocketCount) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPByTargetNetworkInterfaceIdentity : The network interface this floating IP is to be bound to. -// Models which "extend" this model: -// - FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByID -// - FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref -type FloatingIPByTargetNetworkInterfaceIdentity struct { - // The unique identifier for this network interface. - ID *string `json:"id,omitempty"` - - // The URL for this network interface. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPByTargetNetworkInterfaceIdentity) isaFloatingIPByTargetNetworkInterfaceIdentity() bool { - return true -} - -type FloatingIPByTargetNetworkInterfaceIdentityIntf interface { - isaFloatingIPByTargetNetworkInterfaceIdentity() bool -} - -// UnmarshalFloatingIPByTargetNetworkInterfaceIdentity unmarshals an instance of FloatingIPByTargetNetworkInterfaceIdentity from the specified map of raw messages. -func UnmarshalFloatingIPByTargetNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPByTargetNetworkInterfaceIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalVcpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -25423,33 +25588,33 @@ func UnmarshalFloatingIPByTargetNetworkInterfaceIdentity(m map[string]json.RawMe return } -// FloatingIPCollection : FloatingIPCollection struct -type FloatingIPCollection struct { - // A link to the first page of resources. - First *FloatingIPCollectionFirst `json:"first" validate:"required"` +// DedicatedHostCollection : DedicatedHostCollection struct +type DedicatedHostCollection struct { + // Collection of dedicated hosts. + DedicatedHosts []DedicatedHost `json:"dedicated_hosts" validate:"required"` - // Collection of floating IPs. - FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` + // A link to the first page of resources. + First *DedicatedHostCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *FloatingIPCollectionNext `json:"next,omitempty"` + Next *DedicatedHostCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalFloatingIPCollection unmarshals an instance of FloatingIPCollection from the specified map of raw messages. -func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionFirst) +// UnmarshalDedicatedHostCollection unmarshals an instance of DedicatedHostCollection from the specified map of raw messages. +func UnmarshalDedicatedHostCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostCollection) + err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHost) if err != nil { return } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostCollectionFirst) if err != nil { return } @@ -25457,7 +25622,7 @@ func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostCollectionNext) if err != nil { return } @@ -25470,7 +25635,7 @@ func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interfac } // Retrieve the value to be passed to a request to access the next page of results -func (resp *FloatingIPCollection) GetNextStart() (*string, error) { +func (resp *DedicatedHostCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -25481,15 +25646,15 @@ func (resp *FloatingIPCollection) GetNextStart() (*string, error) { return start, nil } -// FloatingIPCollectionFirst : A link to the first page of resources. -type FloatingIPCollectionFirst struct { +// DedicatedHostCollectionFirst : A link to the first page of resources. +type DedicatedHostCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalFloatingIPCollectionFirst unmarshals an instance of FloatingIPCollectionFirst from the specified map of raw messages. -func UnmarshalFloatingIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionFirst) +// UnmarshalDedicatedHostCollectionFirst unmarshals an instance of DedicatedHostCollectionFirst from the specified map of raw messages. +func UnmarshalDedicatedHostCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -25498,15 +25663,15 @@ func UnmarshalFloatingIPCollectionFirst(m map[string]json.RawMessage, result int return } -// FloatingIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type FloatingIPCollectionNext struct { +// DedicatedHostCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type DedicatedHostCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalFloatingIPCollectionNext unmarshals an instance of FloatingIPCollectionNext from the specified map of raw messages. -func UnmarshalFloatingIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPCollectionNext) +// UnmarshalDedicatedHostCollectionNext unmarshals an instance of DedicatedHostCollectionNext from the specified map of raw messages. +func UnmarshalDedicatedHostCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -25515,135 +25680,116 @@ func UnmarshalFloatingIPCollectionNext(m map[string]json.RawMessage, result inte return } -// FloatingIPPatch : FloatingIPPatch struct -type FloatingIPPatch struct { - // The unique user-defined name for this floating IP. - Name *string `json:"name,omitempty"` +// DedicatedHostDisk : DedicatedHostDisk struct +type DedicatedHostDisk struct { + // The remaining space left for instance placement in GB (gigabytes). + Available *int64 `json:"available" validate:"required"` - // The network interface to bind the floating IP to, replacing any existing binding. For - // this request to succeed, the floating IP must not be required by another resource, such - // as a public gateway. - Target FloatingIPTargetPatchIntf `json:"target,omitempty"` -} + // The date and time that the disk was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// UnmarshalFloatingIPPatch unmarshals an instance of FloatingIPPatch from the specified map of raw messages. -func UnmarshalFloatingIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPatch) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The URL for this disk. + Href *string `json:"href" validate:"required"` -// AsPatch returns a generic map representation of the FloatingIPPatch -func (floatingIPPatch *FloatingIPPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(floatingIPPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} + // The unique identifier for this disk. + ID *string `json:"id" validate:"required"` -// FloatingIPPrototype : FloatingIPPrototype struct -// Models which "extend" this model: -// - FloatingIPPrototypeFloatingIPByZone -// - FloatingIPPrototypeFloatingIPByTarget -type FloatingIPPrototype struct { - // The unique user-defined name for this floating IP. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` + // Instance disks that are on this dedicated host disk. + InstanceDisks []InstanceDiskReference `json:"instance_disks" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The disk interface used for attaching the disk + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` - // The zone this floating IP will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // The lifecycle state of this dedicated host disk. + LifecycleState *string `json:"lifecycle_state,omitempty"` - // The network interface this floating IP is to be bound to. - Target FloatingIPByTargetNetworkInterfaceIdentityIntf `json:"target,omitempty"` -} + // The user-defined or system-provided name for this disk. + Name *string `json:"name" validate:"required"` -func (*FloatingIPPrototype) isaFloatingIPPrototype() bool { - return true -} + // Indicates whether this dedicated host disk is available for instance disk creation. + Provisionable *bool `json:"provisionable" validate:"required"` -type FloatingIPPrototypeIntf interface { - isaFloatingIPPrototype() bool + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The size of the disk in GB (gigabytes). + Size *int64 `json:"size" validate:"required"` + + // The instance disk interfaces supported for this dedicated host disk. + SupportedInstanceInterfaceTypes []string `json:"supported_instance_interface_types" validate:"required"` } -// UnmarshalFloatingIPPrototype unmarshals an instance of FloatingIPPrototype from the specified map of raw messages. -func UnmarshalFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// Constants associated with the DedicatedHostDisk.InterfaceType property. +// The disk interface used for attaching the disk +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostDiskInterfaceTypeNvmeConst = "nvme" +) + +// Constants associated with the DedicatedHostDisk.LifecycleState property. +// The lifecycle state of this dedicated host disk. +const ( + DedicatedHostDiskLifecycleStateDeletingConst = "deleting" + DedicatedHostDiskLifecycleStateFailedConst = "failed" + DedicatedHostDiskLifecycleStatePendingConst = "pending" + DedicatedHostDiskLifecycleStateStableConst = "stable" + DedicatedHostDiskLifecycleStateSuspendedConst = "suspended" + DedicatedHostDiskLifecycleStateUpdatingConst = "updating" + DedicatedHostDiskLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the DedicatedHostDisk.ResourceType property. +// The resource type. +const ( + DedicatedHostDiskResourceTypeDedicatedHostDiskConst = "dedicated_host_disk" +) + +// Constants associated with the DedicatedHostDisk.SupportedInstanceInterfaceTypes property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostDiskSupportedInstanceInterfaceTypesNvmeConst = "nvme" + DedicatedHostDiskSupportedInstanceInterfaceTypesVirtioBlkConst = "virtio_blk" +) + +// UnmarshalDedicatedHostDisk unmarshals an instance of DedicatedHostDisk from the specified map of raw messages. +func UnmarshalDedicatedHostDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostDisk) + err = core.UnmarshalPrimitive(m, "available", &obj.Available) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPByTargetNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPReference : FloatingIPReference struct -type FloatingIPReference struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` - - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` - - // The unique user-defined name for this floating IP. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalFloatingIPReference unmarshals an instance of FloatingIPReference from the specified map of raw messages. -func UnmarshalFloatingIPReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPReference) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) + err = core.UnmarshalModel(m, "instance_disks", &obj.InstanceDisks, UnmarshalInstanceDiskReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } @@ -25651,100 +25797,19 @@ func UnmarshalFloatingIPReference(m map[string]json.RawMessage, result interface if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type FloatingIPReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalFloatingIPReferenceDeleted unmarshals an instance of FloatingIPReferenceDeleted from the specified map of raw messages. -func UnmarshalFloatingIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// FloatingIPTarget : The target of this floating IP. -// Models which "extend" this model: -// - FloatingIPTargetNetworkInterfaceReference -// - FloatingIPTargetPublicGatewayReference -type FloatingIPTarget struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this network interface. - Href *string `json:"href,omitempty"` - - // The unique identifier for this network interface. - ID *string `json:"id,omitempty"` - - // The user-defined name for this network interface. - Name *string `json:"name,omitempty"` - - // The primary IPv4 address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` - - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` -} - -// Constants associated with the FloatingIPTarget.ResourceType property. -// The resource type. -const ( - FloatingIPTargetResourceTypeNetworkInterfaceConst = "network_interface" -) - -func (*FloatingIPTarget) isaFloatingIPTarget() bool { - return true -} - -type FloatingIPTargetIntf interface { - isaFloatingIPTarget() bool -} - -// UnmarshalFloatingIPTarget unmarshals an instance of FloatingIPTarget from the specified map of raw messages. -func UnmarshalFloatingIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "provisionable", &obj.Provisionable) if err != nil { return } - err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes) if err != nil { return } @@ -25752,35 +25817,16 @@ func UnmarshalFloatingIPTarget(m map[string]json.RawMessage, result interface{}) return } -// FloatingIPTargetPatch : The network interface to bind the floating IP to, replacing any existing binding. For this request to succeed, the -// floating IP must not be required by another resource, such as a public gateway. -// Models which "extend" this model: -// - FloatingIPTargetPatchNetworkInterfaceIdentityByID -// - FloatingIPTargetPatchNetworkInterfaceIdentityByHref -type FloatingIPTargetPatch struct { - // The unique identifier for this network interface. - ID *string `json:"id,omitempty"` - - // The URL for this network interface. - Href *string `json:"href,omitempty"` -} - -func (*FloatingIPTargetPatch) isaFloatingIPTargetPatch() bool { - return true -} - -type FloatingIPTargetPatchIntf interface { - isaFloatingIPTargetPatch() bool +// DedicatedHostDiskCollection : DedicatedHostDiskCollection struct +type DedicatedHostDiskCollection struct { + // Collection of the dedicated host's disks. + Disks []DedicatedHostDisk `json:"disks" validate:"required"` } -// UnmarshalFloatingIPTargetPatch unmarshals an instance of FloatingIPTargetPatch from the specified map of raw messages. -func UnmarshalFloatingIPTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPTargetPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalDedicatedHostDiskCollection unmarshals an instance of DedicatedHostDiskCollection from the specified map of raw messages. +func UnmarshalDedicatedHostDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostDiskCollection) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostDisk) if err != nil { return } @@ -25788,16 +25834,16 @@ func UnmarshalFloatingIPTargetPatch(m map[string]json.RawMessage, result interfa return } -// FloatingIPUnpaginatedCollection : FloatingIPUnpaginatedCollection struct -type FloatingIPUnpaginatedCollection struct { - // Collection of floating IPs. - FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` +// DedicatedHostDiskPatch : DedicatedHostDiskPatch struct +type DedicatedHostDiskPatch struct { + // The user-defined name for this disk. + Name *string `json:"name,omitempty"` } -// UnmarshalFloatingIPUnpaginatedCollection unmarshals an instance of FloatingIPUnpaginatedCollection from the specified map of raw messages. -func UnmarshalFloatingIPUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FloatingIPUnpaginatedCollection) - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) +// UnmarshalDedicatedHostDiskPatch unmarshals an instance of DedicatedHostDiskPatch from the specified map of raw messages. +func UnmarshalDedicatedHostDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostDiskPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -25805,88 +25851,97 @@ func UnmarshalFloatingIPUnpaginatedCollection(m map[string]json.RawMessage, resu return } -// FlowLogCollector : FlowLogCollector struct -type FlowLogCollector struct { - // Indicates whether this collector is active. - Active *bool `json:"active" validate:"required"` +// AsPatch returns a generic map representation of the DedicatedHostDiskPatch +func (dedicatedHostDiskPatch *DedicatedHostDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(dedicatedHostDiskPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // Indicates whether this flow log collector will be automatically deleted when `target` is deleted. At present, this - // is always `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` +// DedicatedHostGroup : DedicatedHostGroup struct +type DedicatedHostGroup struct { + // The dedicated host profile class for hosts in this group. + Class *string `json:"class" validate:"required"` - // The date and time that the flow log collector was created. + // The date and time that the dedicated host group was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this flow log collector. + // The CRN for this dedicated host group. CRN *string `json:"crn" validate:"required"` - // The URL for this flow log collector. + // The dedicated hosts that are in this dedicated host group. + DedicatedHosts []DedicatedHostReference `json:"dedicated_hosts" validate:"required"` + + // The dedicated host profile family for hosts in this group. + Family *string `json:"family" validate:"required"` + + // The URL for this dedicated host group. Href *string `json:"href" validate:"required"` - // The unique identifier for this flow log collector. + // The unique identifier for this dedicated host group. ID *string `json:"id" validate:"required"` - // The lifecycle state of the flow log collector. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The unique user-defined name for this flow log collector. + // The unique user-defined name for this dedicated host group. Name *string `json:"name" validate:"required"` - // The resource group for this flow log collector. + // The resource group for this dedicated host group. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The Cloud Object Storage bucket where the collected flows are logged. - StorageBucket *CloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The target this collector is collecting flow logs for. If the target is an instance, - // subnet, or VPC, flow logs will not be collected for any network interfaces within the - // target that are themselves the target of a more specific flow log collector. - Target FlowLogCollectorTargetIntf `json:"target" validate:"required"` + // The instance profiles usable by instances placed on this dedicated host group. + SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` - // The VPC this flow log collector is associated with. - VPC *VPCReference `json:"vpc" validate:"required"` + // The zone this dedicated host group resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the FlowLogCollector.LifecycleState property. -// The lifecycle state of the flow log collector. +// Constants associated with the DedicatedHostGroup.Family property. +// The dedicated host profile family for hosts in this group. const ( - FlowLogCollectorLifecycleStateDeletingConst = "deleting" - FlowLogCollectorLifecycleStateFailedConst = "failed" - FlowLogCollectorLifecycleStatePendingConst = "pending" - FlowLogCollectorLifecycleStateStableConst = "stable" - FlowLogCollectorLifecycleStateSuspendedConst = "suspended" - FlowLogCollectorLifecycleStateUpdatingConst = "updating" - FlowLogCollectorLifecycleStateWaitingConst = "waiting" + DedicatedHostGroupFamilyBalancedConst = "balanced" + DedicatedHostGroupFamilyComputeConst = "compute" + DedicatedHostGroupFamilyMemoryConst = "memory" ) -// UnmarshalFlowLogCollector unmarshals an instance of FlowLogCollector from the specified map of raw messages. -func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollector) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) +// Constants associated with the DedicatedHostGroup.ResourceType property. +// The resource type. +const ( + DedicatedHostGroupResourceTypeDedicatedHostGroupConst = "dedicated_host_group" +) + +// UnmarshalDedicatedHostGroup unmarshals an instance of DedicatedHostGroup from the specified map of raw messages. +func UnmarshalDedicatedHostGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroup) + err = core.UnmarshalPrimitive(m, "class", &obj.Class) if err != nil { return } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "dedicated_hosts", &obj.DedicatedHosts, UnmarshalDedicatedHostReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -25898,15 +25953,15 @@ func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalCloudObjectStorageBucketReference) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFlowLogCollectorTarget) + err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -25914,33 +25969,33 @@ func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) return } -// FlowLogCollectorCollection : FlowLogCollectorCollection struct -type FlowLogCollectorCollection struct { +// DedicatedHostGroupCollection : DedicatedHostGroupCollection struct +type DedicatedHostGroupCollection struct { // A link to the first page of resources. - First *FlowLogCollectorCollectionFirst `json:"first" validate:"required"` + First *DedicatedHostGroupCollectionFirst `json:"first" validate:"required"` - // Collection of flow log collectors. - FlowLogCollectors []FlowLogCollector `json:"flow_log_collectors" validate:"required"` + // Collection of dedicated host groups. + Groups []DedicatedHostGroup `json:"groups" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *FlowLogCollectorCollectionNext `json:"next,omitempty"` + Next *DedicatedHostGroupCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalFlowLogCollectorCollection unmarshals an instance of FlowLogCollectorCollection from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFlowLogCollectorCollectionFirst) +// UnmarshalDedicatedHostGroupCollection unmarshals an instance of DedicatedHostGroupCollection from the specified map of raw messages. +func UnmarshalDedicatedHostGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostGroupCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "flow_log_collectors", &obj.FlowLogCollectors, UnmarshalFlowLogCollector) + err = core.UnmarshalModel(m, "groups", &obj.Groups, UnmarshalDedicatedHostGroup) if err != nil { return } @@ -25948,7 +26003,7 @@ func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result in if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFlowLogCollectorCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostGroupCollectionNext) if err != nil { return } @@ -25961,7 +26016,7 @@ func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result in } // Retrieve the value to be passed to a request to access the next page of results -func (resp *FlowLogCollectorCollection) GetNextStart() (*string, error) { +func (resp *DedicatedHostGroupCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -25972,15 +26027,15 @@ func (resp *FlowLogCollectorCollection) GetNextStart() (*string, error) { return start, nil } -// FlowLogCollectorCollectionFirst : A link to the first page of resources. -type FlowLogCollectorCollectionFirst struct { +// DedicatedHostGroupCollectionFirst : A link to the first page of resources. +type DedicatedHostGroupCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalFlowLogCollectorCollectionFirst unmarshals an instance of FlowLogCollectorCollectionFirst from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollectionFirst) +// UnmarshalDedicatedHostGroupCollectionFirst unmarshals an instance of DedicatedHostGroupCollectionFirst from the specified map of raw messages. +func UnmarshalDedicatedHostGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -25989,15 +26044,15 @@ func UnmarshalFlowLogCollectorCollectionFirst(m map[string]json.RawMessage, resu return } -// FlowLogCollectorCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type FlowLogCollectorCollectionNext struct { +// DedicatedHostGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type DedicatedHostGroupCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalFlowLogCollectorCollectionNext unmarshals an instance of FlowLogCollectorCollectionNext from the specified map of raw messages. -func UnmarshalFlowLogCollectorCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorCollectionNext) +// UnmarshalDedicatedHostGroupCollectionNext unmarshals an instance of DedicatedHostGroupCollectionNext from the specified map of raw messages. +func UnmarshalDedicatedHostGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -26006,23 +26061,58 @@ func UnmarshalFlowLogCollectorCollectionNext(m map[string]json.RawMessage, resul return } -// FlowLogCollectorPatch : FlowLogCollectorPatch struct -type FlowLogCollectorPatch struct { - // Indicates whether this collector is active. Updating to false deactivates the collector and updating to true - // activates the collector. - Active *bool `json:"active,omitempty"` +// DedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// Models which "extend" this model: +// - DedicatedHostGroupIdentityByID +// - DedicatedHostGroupIdentityByCRN +// - DedicatedHostGroupIdentityByHref +type DedicatedHostGroupIdentity struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` - // The unique user-defined name for this flow log collector. - Name *string `json:"name,omitempty"` + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` } -// UnmarshalFlowLogCollectorPatch unmarshals an instance of FlowLogCollectorPatch from the specified map of raw messages. -func UnmarshalFlowLogCollectorPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorPatch) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) +func (*DedicatedHostGroupIdentity) isaDedicatedHostGroupIdentity() bool { + return true +} + +type DedicatedHostGroupIdentityIntf interface { + isaDedicatedHostGroupIdentity() bool +} + +// UnmarshalDedicatedHostGroupIdentity unmarshals an instance of DedicatedHostGroupIdentity from the specified map of raw messages. +func UnmarshalDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostGroupPatch : DedicatedHostGroupPatch struct +type DedicatedHostGroupPatch struct { + // The unique user-defined name for this dedicated host group. + Name *string `json:"name,omitempty"` +} + +// UnmarshalDedicatedHostGroupPatch unmarshals an instance of DedicatedHostGroupPatch from the specified map of raw messages. +func UnmarshalDedicatedHostGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -26031,63 +26121,76 @@ func UnmarshalFlowLogCollectorPatch(m map[string]json.RawMessage, result interfa return } -// AsPatch returns a generic map representation of the FlowLogCollectorPatch -func (flowLogCollectorPatch *FlowLogCollectorPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the DedicatedHostGroupPatch +func (dedicatedHostGroupPatch *DedicatedHostGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(flowLogCollectorPatch) + jsonData, err = json.Marshal(dedicatedHostGroupPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// FlowLogCollectorTarget : The target this collector is collecting flow logs for. If the target is an instance, subnet, or VPC, flow logs will -// not be collected for any network interfaces within the target that are themselves the target of a more specific flow -// log collector. -// Models which "extend" this model: -// - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext -// - FlowLogCollectorTargetInstanceReference -// - FlowLogCollectorTargetSubnetReference -// - FlowLogCollectorTargetVPCReference -type FlowLogCollectorTarget struct { +// DedicatedHostGroupPrototypeDedicatedHostByZoneContext : DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct +type DedicatedHostGroupPrototypeDedicatedHostByZoneContext struct { + // The unique user-defined name for this dedicated host group. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the host's resource group is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +} + +// UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext unmarshals an instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext from the specified map of raw messages. +func UnmarshalDedicatedHostGroupPrototypeDedicatedHostByZoneContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupPrototypeDedicatedHostByZoneContext) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DedicatedHostGroupReference : DedicatedHostGroupReference struct +type DedicatedHostGroupReference struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` + Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` - // The URL for this network interface. - Href *string `json:"href,omitempty"` + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` - // The unique identifier for this network interface. - ID *string `json:"id,omitempty"` + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` - // The user-defined name for this network interface. - Name *string `json:"name,omitempty"` + // The unique user-defined name for this dedicated host group. + Name *string `json:"name" validate:"required"` // The resource type. - ResourceType *string `json:"resource_type,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the FlowLogCollectorTarget.ResourceType property. +// Constants associated with the DedicatedHostGroupReference.ResourceType property. // The resource type. const ( - FlowLogCollectorTargetResourceTypeNetworkInterfaceConst = "network_interface" + DedicatedHostGroupReferenceResourceTypeDedicatedHostGroupConst = "dedicated_host_group" ) -func (*FlowLogCollectorTarget) isaFlowLogCollectorTarget() bool { - return true -} - -type FlowLogCollectorTargetIntf interface { - isaFlowLogCollectorTarget() bool -} - -// UnmarshalFlowLogCollectorTarget unmarshals an instance of FlowLogCollectorTarget from the specified map of raw messages. -func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) +// UnmarshalDedicatedHostGroupReference unmarshals an instance of DedicatedHostGroupReference from the specified map of raw messages. +func UnmarshalDedicatedHostGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) if err != nil { return } @@ -26107,53 +26210,21 @@ func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interf if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// FlowLogCollectorTargetPrototype : The target this collector will collect flow logs for. If the target is an instance, subnet, or VPC, flow logs will -// not be collected for any network interfaces within the target that are themselves the target of a more specific flow -// log collector. -// Models which "extend" this model: -// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity -// - FlowLogCollectorTargetPrototypeInstanceIdentity -// - FlowLogCollectorTargetPrototypeSubnetIdentity -// - FlowLogCollectorTargetPrototypeVPCIdentity -type FlowLogCollectorTargetPrototype struct { - // The unique identifier for this network interface. - ID *string `json:"id,omitempty"` - - // The URL for this network interface. - Href *string `json:"href,omitempty"` - - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` -} - -func (*FlowLogCollectorTargetPrototype) isaFlowLogCollectorTargetPrototype() bool { - return true -} - -type FlowLogCollectorTargetPrototypeIntf interface { - isaFlowLogCollectorTargetPrototype() bool +// DedicatedHostGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type DedicatedHostGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalFlowLogCollectorTargetPrototype unmarshals an instance of FlowLogCollectorTargetPrototype from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalDedicatedHostGroupReferenceDeleted unmarshals an instance of DedicatedHostGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalDedicatedHostGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -26161,624 +26232,1151 @@ func UnmarshalFlowLogCollectorTargetPrototype(m map[string]json.RawMessage, resu return } -// GetDedicatedHostDiskOptions : The GetDedicatedHostDisk options. -type GetDedicatedHostDiskOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - - // The dedicated host disk identifier. - ID *string `json:"id" validate:"required,ne="` +// DedicatedHostPatch : DedicatedHostPatch struct +type DedicatedHostPatch struct { + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The unique user-defined name for this dedicated host. + Name *string `json:"name,omitempty"` } -// NewGetDedicatedHostDiskOptions : Instantiate GetDedicatedHostDiskOptions -func (*VpcV1) NewGetDedicatedHostDiskOptions(dedicatedHostID string, id string) *GetDedicatedHostDiskOptions { - return &GetDedicatedHostDiskOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostPatch unmarshals an instance of DedicatedHostPatch from the specified map of raw messages. +func UnmarshalDedicatedHostPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostPatch) + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *GetDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *GetDedicatedHostDiskOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} - -// SetID : Allow user to set ID -func (_options *GetDedicatedHostDiskOptions) SetID(id string) *GetDedicatedHostDiskOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostDiskOptions) SetHeaders(param map[string]string) *GetDedicatedHostDiskOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the DedicatedHostPatch +func (dedicatedHostPatch *DedicatedHostPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(dedicatedHostPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// GetDedicatedHostGroupOptions : The GetDedicatedHostGroup options. -type GetDedicatedHostGroupOptions struct { - // The dedicated host group identifier. - ID *string `json:"id" validate:"required,ne="` +// DedicatedHostProfile : DedicatedHostProfile struct +type DedicatedHostProfile struct { + // The product class this dedicated host profile belongs to. + Class *string `json:"class" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Collection of the dedicated host profile's disks. + Disks []DedicatedHostProfileDisk `json:"disks" validate:"required"` -// NewGetDedicatedHostGroupOptions : Instantiate GetDedicatedHostGroupOptions -func (*VpcV1) NewGetDedicatedHostGroupOptions(id string) *GetDedicatedHostGroupOptions { - return &GetDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - } -} + // The product family this dedicated host profile belongs to + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Family *string `json:"family" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetDedicatedHostGroupOptions) SetID(id string) *GetDedicatedHostGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostGroupOptions) SetHeaders(param map[string]string) *GetDedicatedHostGroupOptions { - options.Headers = param - return options -} + Memory DedicatedHostProfileMemoryIntf `json:"memory" validate:"required"` -// GetDedicatedHostOptions : The GetDedicatedHost options. -type GetDedicatedHostOptions struct { - // The dedicated host identifier. - ID *string `json:"id" validate:"required,ne="` + // The globally unique name for this dedicated host profile. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + SocketCount DedicatedHostProfileSocketIntf `json:"socket_count" validate:"required"` -// NewGetDedicatedHostOptions : Instantiate GetDedicatedHostOptions -func (*VpcV1) NewGetDedicatedHostOptions(id string) *GetDedicatedHostOptions { - return &GetDedicatedHostOptions{ - ID: core.StringPtr(id), - } -} + // The instance profiles usable by instances placed on dedicated hosts with this profile. + SupportedInstanceProfiles []InstanceProfileReference `json:"supported_instance_profiles" validate:"required"` -// SetID : Allow user to set ID -func (_options *GetDedicatedHostOptions) SetID(id string) *GetDedicatedHostOptions { - _options.ID = core.StringPtr(id) - return _options -} + VcpuArchitecture *DedicatedHostProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostOptions) SetHeaders(param map[string]string) *GetDedicatedHostOptions { - options.Headers = param - return options + VcpuCount DedicatedHostProfileVcpuIntf `json:"vcpu_count" validate:"required"` } -// GetDedicatedHostProfileOptions : The GetDedicatedHostProfile options. -type GetDedicatedHostProfileOptions struct { - // The dedicated host profile name. - Name *string `json:"name" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfile.Family property. +// The product family this dedicated host profile belongs to +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileFamilyBalancedConst = "balanced" + DedicatedHostProfileFamilyComputeConst = "compute" + DedicatedHostProfileFamilyMemoryConst = "memory" +) -// NewGetDedicatedHostProfileOptions : Instantiate GetDedicatedHostProfileOptions -func (*VpcV1) NewGetDedicatedHostProfileOptions(name string) *GetDedicatedHostProfileOptions { - return &GetDedicatedHostProfileOptions{ - Name: core.StringPtr(name), +// UnmarshalDedicatedHostProfile unmarshals an instance of DedicatedHostProfile from the specified map of raw messages. +func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfile) + err = core.UnmarshalPrimitive(m, "class", &obj.Class) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalDedicatedHostProfileDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalDedicatedHostProfileMemory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "socket_count", &obj.SocketCount, UnmarshalDedicatedHostProfileSocket) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_instance_profiles", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalDedicatedHostProfileVcpuArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalDedicatedHostProfileVcpu) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *GetDedicatedHostProfileOptions) SetName(name string) *GetDedicatedHostProfileOptions { - _options.Name = core.StringPtr(name) - return _options -} +// DedicatedHostProfileCollection : DedicatedHostProfileCollection struct +type DedicatedHostProfileCollection struct { + // A link to the first page of resources. + First *DedicatedHostProfileCollectionFirst `json:"first" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetDedicatedHostProfileOptions) SetHeaders(param map[string]string) *GetDedicatedHostProfileOptions { - options.Headers = param - return options -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// GetEndpointGatewayIPOptions : The GetEndpointGatewayIP options. -type GetEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *DedicatedHostProfileCollectionNext `json:"next,omitempty"` - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` + // Collection of dedicated host profiles. + Profiles []DedicatedHostProfile `json:"profiles" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewGetEndpointGatewayIPOptions : Instantiate GetEndpointGatewayIPOptions -func (*VpcV1) NewGetEndpointGatewayIPOptions(endpointGatewayID string, id string) *GetEndpointGatewayIPOptions { - return &GetEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileCollection unmarshals an instance of DedicatedHostProfileCollection from the specified map of raw messages. +func UnmarshalDedicatedHostProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalDedicatedHostProfileCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalDedicatedHostProfileCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalDedicatedHostProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *GetEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *DedicatedHostProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetID : Allow user to set ID -func (_options *GetEndpointGatewayIPOptions) SetID(id string) *GetEndpointGatewayIPOptions { - _options.ID = core.StringPtr(id) - return _options +// DedicatedHostProfileCollectionFirst : A link to the first page of resources. +type DedicatedHostProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetEndpointGatewayIPOptions) SetHeaders(param map[string]string) *GetEndpointGatewayIPOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostProfileCollectionFirst unmarshals an instance of DedicatedHostProfileCollectionFirst from the specified map of raw messages. +func UnmarshalDedicatedHostProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetEndpointGatewayOptions : The GetEndpointGateway options. -type GetEndpointGatewayOptions struct { - // The endpoint gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +// DedicatedHostProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type DedicatedHostProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewGetEndpointGatewayOptions : Instantiate GetEndpointGatewayOptions -func (*VpcV1) NewGetEndpointGatewayOptions(id string) *GetEndpointGatewayOptions { - return &GetEndpointGatewayOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileCollectionNext unmarshals an instance of DedicatedHostProfileCollectionNext from the specified map of raw messages. +func UnmarshalDedicatedHostProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetEndpointGatewayOptions) SetID(id string) *GetEndpointGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDisk : Disks provided by this profile. +type DedicatedHostProfileDisk struct { + InterfaceType *DedicatedHostProfileDiskInterface `json:"interface_type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *GetEndpointGatewayOptions { - options.Headers = param - return options -} + // The number of disks of this type for a dedicated host with this profile. + Quantity *DedicatedHostProfileDiskQuantity `json:"quantity" validate:"required"` -// GetFloatingIPOptions : The GetFloatingIP options. -type GetFloatingIPOptions struct { - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` + // The size of the disk in GB (gigabytes). + Size *DedicatedHostProfileDiskSize `json:"size" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + SupportedInstanceInterfaceTypes *DedicatedHostProfileDiskSupportedInterfaces `json:"supported_instance_interface_types" validate:"required"` } -// NewGetFloatingIPOptions : Instantiate GetFloatingIPOptions -func (*VpcV1) NewGetFloatingIPOptions(id string) *GetFloatingIPOptions { - return &GetFloatingIPOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDisk unmarshals an instance of DedicatedHostProfileDisk from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDisk) + err = core.UnmarshalModel(m, "interface_type", &obj.InterfaceType, UnmarshalDedicatedHostProfileDiskInterface) + if err != nil { + return + } + err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalDedicatedHostProfileDiskQuantity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalDedicatedHostProfileDiskSize) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_instance_interface_types", &obj.SupportedInstanceInterfaceTypes, UnmarshalDedicatedHostProfileDiskSupportedInterfaces) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetFloatingIPOptions) SetID(id string) *GetFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskInterface : DedicatedHostProfileDiskInterface struct +type DedicatedHostProfileDiskInterface struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetFloatingIPOptions) SetHeaders(param map[string]string) *GetFloatingIPOptions { - options.Headers = param - return options + // The interface of the disk for a dedicated host with this profile + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Value *string `json:"value" validate:"required"` } -// GetFlowLogCollectorOptions : The GetFlowLogCollector options. -type GetFlowLogCollectorOptions struct { - // The flow log collector identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the DedicatedHostProfileDiskInterface.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskInterfaceTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskInterface.Value property. +// The interface of the disk for a dedicated host with this profile +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileDiskInterfaceValueNvmeConst = "nvme" +) -// NewGetFlowLogCollectorOptions : Instantiate GetFlowLogCollectorOptions -func (*VpcV1) NewGetFlowLogCollectorOptions(id string) *GetFlowLogCollectorOptions { - return &GetFlowLogCollectorOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskInterface unmarshals an instance of DedicatedHostProfileDiskInterface from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskInterface) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetFlowLogCollectorOptions) SetID(id string) *GetFlowLogCollectorOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskQuantity : The number of disks of this type for a dedicated host with this profile. +type DedicatedHostProfileDiskQuantity struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetFlowLogCollectorOptions) SetHeaders(param map[string]string) *GetFlowLogCollectorOptions { - options.Headers = param - return options + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// GetIkePolicyOptions : The GetIkePolicy options. -type GetIkePolicyOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskQuantity.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskQuantityTypeFixedConst = "fixed" +) -// NewGetIkePolicyOptions : Instantiate GetIkePolicyOptions -func (*VpcV1) NewGetIkePolicyOptions(id string) *GetIkePolicyOptions { - return &GetIkePolicyOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskQuantity unmarshals an instance of DedicatedHostProfileDiskQuantity from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetIkePolicyOptions) SetID(id string) *GetIkePolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostProfileDiskSize : The size of the disk in GB (gigabytes). +type DedicatedHostProfileDiskSize struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *GetIkePolicyOptions) SetHeaders(param map[string]string) *GetIkePolicyOptions { - options.Headers = param - return options + // The size of the disk in GB (gigabytes). + Value *int64 `json:"value" validate:"required"` } -// GetImageOptions : The GetImage options. -type GetImageOptions struct { - // The image identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the DedicatedHostProfileDiskSize.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskSizeTypeFixedConst = "fixed" +) -// NewGetImageOptions : Instantiate GetImageOptions -func (*VpcV1) NewGetImageOptions(id string) *GetImageOptions { - return &GetImageOptions{ - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileDiskSize unmarshals an instance of DedicatedHostProfileDiskSize from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskSize) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetImageOptions) SetID(id string) *GetImageOptions { - _options.ID = core.StringPtr(id) - return _options +// DedicatedHostProfileDiskSupportedInterfaces : DedicatedHostProfileDiskSupportedInterfaces struct +type DedicatedHostProfileDiskSupportedInterfaces struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The instance disk interfaces supported for a dedicated host with this profile. + Value []string `json:"value" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetImageOptions) SetHeaders(param map[string]string) *GetImageOptions { - options.Headers = param - return options -} - -// GetInstanceDiskOptions : The GetInstanceDisk options. -type GetInstanceDiskOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileDiskSupportedInterfacesTypeFixedConst = "fixed" +) - // The instance disk identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the DedicatedHostProfileDiskSupportedInterfaces.Value property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + DedicatedHostProfileDiskSupportedInterfacesValueNvmeConst = "nvme" + DedicatedHostProfileDiskSupportedInterfacesValueVirtioBlkConst = "virtio_blk" +) - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalDedicatedHostProfileDiskSupportedInterfaces unmarshals an instance of DedicatedHostProfileDiskSupportedInterfaces from the specified map of raw messages. +func UnmarshalDedicatedHostProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewGetInstanceDiskOptions : Instantiate GetInstanceDiskOptions -func (*VpcV1) NewGetInstanceDiskOptions(instanceID string, id string) *GetInstanceDiskOptions { - return &GetInstanceDiskOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - } +// DedicatedHostProfileIdentity : Identifies a dedicated host profile by a unique property. +// Models which "extend" this model: +// - DedicatedHostProfileIdentityByName +// - DedicatedHostProfileIdentityByHref +type DedicatedHostProfileIdentity struct { + // The globally unique name for this dedicated host profile. + Name *string `json:"name,omitempty"` + + // The URL for this dedicated host profile. + Href *string `json:"href,omitempty"` } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceDiskOptions) SetInstanceID(instanceID string) *GetInstanceDiskOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +func (*DedicatedHostProfileIdentity) isaDedicatedHostProfileIdentity() bool { + return true } -// SetID : Allow user to set ID -func (_options *GetInstanceDiskOptions) SetID(id string) *GetInstanceDiskOptions { - _options.ID = core.StringPtr(id) - return _options +type DedicatedHostProfileIdentityIntf interface { + isaDedicatedHostProfileIdentity() bool } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceDiskOptions) SetHeaders(param map[string]string) *GetInstanceDiskOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostProfileIdentity unmarshals an instance of DedicatedHostProfileIdentity from the specified map of raw messages. +func UnmarshalDedicatedHostProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetInstanceGroupManagerActionOptions : The GetInstanceGroupManagerAction options. -type GetInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// DedicatedHostProfileMemory : DedicatedHostProfileMemory struct +// Models which "extend" this model: +// - DedicatedHostProfileMemoryFixed +// - DedicatedHostProfileMemoryRange +// - DedicatedHostProfileMemoryEnum +// - DedicatedHostProfileMemoryDependent +type DedicatedHostProfileMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The instance group manager action identifier. - ID *string `json:"id" validate:"required,ne="` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// NewGetInstanceGroupManagerActionOptions : Instantiate GetInstanceGroupManagerActionOptions -func (*VpcV1) NewGetInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerActionOptions { - return &GetInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerActionOptions) SetID(id string) *GetInstanceGroupManagerActionOptions { - _options.ID = core.StringPtr(id) - return _options +// Constants associated with the DedicatedHostProfileMemory.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileMemoryTypeFixedConst = "fixed" +) + +func (*DedicatedHostProfileMemory) isaDedicatedHostProfileMemory() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerActionOptions { - options.Headers = param - return options +type DedicatedHostProfileMemoryIntf interface { + isaDedicatedHostProfileMemory() bool } -// GetInstanceGroupManagerOptions : The GetInstanceGroupManager options. -type GetInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// UnmarshalDedicatedHostProfileMemory unmarshals an instance of DedicatedHostProfileMemory from the specified map of raw messages. +func UnmarshalDedicatedHostProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The instance group manager identifier. - ID *string `json:"id" validate:"required,ne="` +// DedicatedHostProfileReference : DedicatedHostProfileReference struct +type DedicatedHostProfileReference struct { + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The globally unique name for this dedicated host profile. + Name *string `json:"name" validate:"required"` } -// NewGetInstanceGroupManagerOptions : Instantiate GetInstanceGroupManagerOptions -func (*VpcV1) NewGetInstanceGroupManagerOptions(instanceGroupID string, id string) *GetInstanceGroupManagerOptions { - return &GetInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), +// UnmarshalDedicatedHostProfileReference unmarshals an instance of DedicatedHostProfileReference from the specified map of raw messages. +func UnmarshalDedicatedHostProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} +// DedicatedHostProfileSocket : DedicatedHostProfileSocket struct +// Models which "extend" this model: +// - DedicatedHostProfileSocketFixed +// - DedicatedHostProfileSocketRange +// - DedicatedHostProfileSocketEnum +// - DedicatedHostProfileSocketDependent +type DedicatedHostProfileSocket struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerOptions) SetID(id string) *GetInstanceGroupManagerOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerOptions { - options.Headers = param - return options -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// GetInstanceGroupManagerPolicyOptions : The GetInstanceGroupManagerPolicy options. -type GetInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // The instance group manager policy identifier. - ID *string `json:"id" validate:"required,ne="` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// NewGetInstanceGroupManagerPolicyOptions : Instantiate GetInstanceGroupManagerPolicyOptions -func (*VpcV1) NewGetInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerPolicyOptions { - return &GetInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - } -} +// Constants associated with the DedicatedHostProfileSocket.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileSocketTypeFixedConst = "fixed" +) -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +func (*DedicatedHostProfileSocket) isaDedicatedHostProfileSocket() bool { + return true } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +type DedicatedHostProfileSocketIntf interface { + isaDedicatedHostProfileSocket() bool } -// SetID : Allow user to set ID -func (_options *GetInstanceGroupManagerPolicyOptions) SetID(id string) *GetInstanceGroupManagerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalDedicatedHostProfileSocket unmarshals an instance of DedicatedHostProfileSocket from the specified map of raw messages. +func UnmarshalDedicatedHostProfileSocket(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileSocket) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerPolicyOptions { - options.Headers = param - return options -} +// DedicatedHostProfileVcpu : DedicatedHostProfileVcpu struct +// Models which "extend" this model: +// - DedicatedHostProfileVcpuFixed +// - DedicatedHostProfileVcpuRange +// - DedicatedHostProfileVcpuEnum +// - DedicatedHostProfileVcpuDependent +type DedicatedHostProfileVcpu struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// GetInstanceGroupMembershipOptions : The GetInstanceGroupMembership options. -type GetInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The instance group membership identifier. - ID *string `json:"id" validate:"required,ne="` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// NewGetInstanceGroupMembershipOptions : Instantiate GetInstanceGroupMembershipOptions -func (*VpcV1) NewGetInstanceGroupMembershipOptions(instanceGroupID string, id string) *GetInstanceGroupMembershipOptions { - return &GetInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - } + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *GetInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// Constants associated with the DedicatedHostProfileVcpu.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuTypeFixedConst = "fixed" +) + +func (*DedicatedHostProfileVcpu) isaDedicatedHostProfileVcpu() bool { + return true } -// SetID : Allow user to set ID -func (_options *GetInstanceGroupMembershipOptions) SetID(id string) *GetInstanceGroupMembershipOptions { - _options.ID = core.StringPtr(id) - return _options +type DedicatedHostProfileVcpuIntf interface { + isaDedicatedHostProfileVcpu() bool } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *GetInstanceGroupMembershipOptions { - options.Headers = param - return options +// UnmarshalDedicatedHostProfileVcpu unmarshals an instance of DedicatedHostProfileVcpu from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpu) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetInstanceGroupOptions : The GetInstanceGroup options. -type GetInstanceGroupOptions struct { - // The instance group identifier. - ID *string `json:"id" validate:"required,ne="` +// DedicatedHostProfileVcpuArchitecture : DedicatedHostProfileVcpuArchitecture struct +type DedicatedHostProfileVcpuArchitecture struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The VCPU architecture for a dedicated host with this profile. + Value *string `json:"value" validate:"required"` } -// NewGetInstanceGroupOptions : Instantiate GetInstanceGroupOptions -func (*VpcV1) NewGetInstanceGroupOptions(id string) *GetInstanceGroupOptions { - return &GetInstanceGroupOptions{ - ID: core.StringPtr(id), +// Constants associated with the DedicatedHostProfileVcpuArchitecture.Type property. +// The type for this profile field. +const ( + DedicatedHostProfileVcpuArchitectureTypeFixedConst = "fixed" +) + +// UnmarshalDedicatedHostProfileVcpuArchitecture unmarshals an instance of DedicatedHostProfileVcpuArchitecture from the specified map of raw messages. +func UnmarshalDedicatedHostProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostProfileVcpuArchitecture) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetInstanceGroupOptions) SetID(id string) *GetInstanceGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} +// DedicatedHostPrototype : DedicatedHostPrototype struct +// Models which "extend" this model: +// - DedicatedHostPrototypeDedicatedHostByGroup +// - DedicatedHostPrototypeDedicatedHostByZone +type DedicatedHostPrototype struct { + // If set to true, instances can be placed on this dedicated host. + InstancePlacementEnabled *bool `json:"instance_placement_enabled,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *GetInstanceGroupOptions) SetHeaders(param map[string]string) *GetInstanceGroupOptions { - options.Headers = param - return options -} + // The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` -// GetInstanceInitializationOptions : The GetInstanceInitialization options. -type GetInstanceInitializationOptions struct { - // The instance identifier. - ID *string `json:"id" validate:"required,ne="` + // The profile to use for this dedicated host. + Profile DedicatedHostProfileIdentityIntf `json:"profile" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// NewGetInstanceInitializationOptions : Instantiate GetInstanceInitializationOptions -func (*VpcV1) NewGetInstanceInitializationOptions(id string) *GetInstanceInitializationOptions { - return &GetInstanceInitializationOptions{ - ID: core.StringPtr(id), - } + // The dedicated host group for this dedicated host. + Group DedicatedHostGroupIdentityIntf `json:"group,omitempty"` + + // The zone this dedicated host will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } -// SetID : Allow user to set ID -func (_options *GetInstanceInitializationOptions) SetID(id string) *GetInstanceInitializationOptions { - _options.ID = core.StringPtr(id) - return _options +func (*DedicatedHostPrototype) isaDedicatedHostPrototype() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceInitializationOptions) SetHeaders(param map[string]string) *GetInstanceInitializationOptions { - options.Headers = param - return options +type DedicatedHostPrototypeIntf interface { + isaDedicatedHostPrototype() bool } -// GetInstanceNetworkInterfaceFloatingIPOptions : The GetInstanceNetworkInterfaceFloatingIP options. -type GetInstanceNetworkInterfaceFloatingIPOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// UnmarshalDedicatedHostPrototype unmarshals an instance of DedicatedHostPrototype from the specified map of raw messages. +func UnmarshalDedicatedHostPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostPrototype) + err = core.UnmarshalPrimitive(m, "instance_placement_enabled", &obj.InstancePlacementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalDedicatedHostProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalDedicatedHostGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` +// DedicatedHostReference : DedicatedHostReference struct +type DedicatedHostReference struct { + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *DedicatedHostReferenceDeleted `json:"deleted,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` + + // The unique user-defined name for this dedicated host. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewGetInstanceNetworkInterfaceFloatingIPOptions : Instantiate GetInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceFloatingIPOptions { - return &GetInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), +// Constants associated with the DedicatedHostReference.ResourceType property. +// The resource type. +const ( + DedicatedHostReferenceResourceTypeDedicatedHostConst = "dedicated_host" +) + +// UnmarshalDedicatedHostReference unmarshals an instance of DedicatedHostReference from the specified map of raw messages. +func UnmarshalDedicatedHostReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// DedicatedHostReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type DedicatedHostReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options +// UnmarshalDedicatedHostReferenceDeleted unmarshals an instance of DedicatedHostReferenceDeleted from the specified map of raw messages. +func UnmarshalDedicatedHostReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DedicatedHostReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *GetInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options +// DefaultNetworkACL : DefaultNetworkACL struct +type DefaultNetworkACL struct { + // The date and time that the network ACL was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` + + // The URL for this network ACL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL. + ID *string `json:"id" validate:"required"` + + // The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words + // at creation, but may be user-specified with a subsequent request. + Name *string `json:"name" validate:"required"` + + // The resource group for the default network ACL for a VPC. Set to the VPC's + // resource group at creation. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The ordered rules for the default network ACL for a VPC. Defaults to two rules which allow all inbound and outbound + // traffic, respectively. Rules for the default network ACL may be changed, added, or removed. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + + // The subnets to which this network ACL is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // The VPC this network ACL is a part of. + VPC *VPCReference `json:"vpc" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options +// UnmarshalDefaultNetworkACL unmarshals an instance of DefaultNetworkACL from the specified map of raw messages. +func UnmarshalDefaultNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DefaultNetworkACL) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetInstanceNetworkInterfaceOptions : The GetInstanceNetworkInterface options. -type GetInstanceNetworkInterfaceOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// DefaultRoutingTable : DefaultRoutingTable struct +type DefaultRoutingTable struct { + // The date and time that this routing table was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this routing table. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this routing table. + ID *string `json:"id" validate:"required"` + + // Indicates whether this is the default routing table for this VPC. + IsDefault *bool `json:"is_default" validate:"required"` + + // The lifecycle state of the routing table. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected + // words at creation, but may be user-specified with a subsequent request. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from + // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from from [Transit + // Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this + // VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` + + // The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, + // changed, or removed with a subsequent request. + Routes []RouteReference `json:"routes" validate:"required"` + + // The subnets to which this routing table is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` +} + +// Constants associated with the DefaultRoutingTable.LifecycleState property. +// The lifecycle state of the routing table. +const ( + DefaultRoutingTableLifecycleStateDeletingConst = "deleting" + DefaultRoutingTableLifecycleStateFailedConst = "failed" + DefaultRoutingTableLifecycleStatePendingConst = "pending" + DefaultRoutingTableLifecycleStateStableConst = "stable" + DefaultRoutingTableLifecycleStateSuspendedConst = "suspended" + DefaultRoutingTableLifecycleStateUpdatingConst = "updating" + DefaultRoutingTableLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the DefaultRoutingTable.ResourceType property. +// The resource type. +const ( + DefaultRoutingTableResourceTypeRoutingTableConst = "routing_table" +) + +// UnmarshalDefaultRoutingTable unmarshals an instance of DefaultRoutingTable from the specified map of raw messages. +func UnmarshalDefaultRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DefaultRoutingTable) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DefaultSecurityGroup : DefaultSecurityGroup struct +type DefaultSecurityGroup struct { + // The date and time that this security group was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` + + // The security group's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group. + ID *string `json:"id" validate:"required"` + + // The name of the default security group created for a VPC. The name will be a hyphenated list of randomly-selected + // words at creation, but may be user-specified with a subsequent request. + Name *string `json:"name" validate:"required"` + + // The resource group for this security group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The rules for the default security group for a VPC. Defaults to allowing all outbound traffic, and allowing all + // inbound traffic from other interfaces in the VPC's default security group. Rules for the default security group may + // be changed, added or removed. + Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` + + // The VPC this security group is a part of. + VPC *VPCReference `json:"vpc" validate:"required"` +} + +// UnmarshalDefaultSecurityGroup unmarshals an instance of DefaultSecurityGroup from the specified map of raw messages. +func UnmarshalDefaultSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DefaultSecurityGroup) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DeleteBareMetalServerNetworkInterfaceOptions : The DeleteBareMetalServerNetworkInterface options. +type DeleteBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` // The network interface identifier. ID *string `json:"id" validate:"required,ne="` @@ -26787,1240 +27385,1374 @@ type GetInstanceNetworkInterfaceOptions struct { Headers map[string]string } -// NewGetInstanceNetworkInterfaceOptions : Instantiate GetInstanceNetworkInterfaceOptions -func (*VpcV1) NewGetInstanceNetworkInterfaceOptions(instanceID string, id string) *GetInstanceNetworkInterfaceOptions { - return &GetInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), +// NewDeleteBareMetalServerNetworkInterfaceOptions : Instantiate DeleteBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewDeleteBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *DeleteBareMetalServerNetworkInterfaceOptions { + return &DeleteBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *DeleteBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) return _options } // SetID : Allow user to set ID -func (_options *GetInstanceNetworkInterfaceOptions) SetID(id string) *GetInstanceNetworkInterfaceOptions { +func (_options *DeleteBareMetalServerNetworkInterfaceOptions) SetID(id string) *DeleteBareMetalServerNetworkInterfaceOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceOptions { +func (options *DeleteBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerNetworkInterfaceOptions { options.Headers = param return options } -// GetInstanceOptions : The GetInstance options. -type GetInstanceOptions struct { - // The instance identifier. +// DeleteBareMetalServerOptions : The DeleteBareMetalServer options. +type DeleteBareMetalServerOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceOptions : Instantiate GetInstanceOptions -func (*VpcV1) NewGetInstanceOptions(id string) *GetInstanceOptions { - return &GetInstanceOptions{ +// NewDeleteBareMetalServerOptions : Instantiate DeleteBareMetalServerOptions +func (*VpcV1) NewDeleteBareMetalServerOptions(id string) *DeleteBareMetalServerOptions { + return &DeleteBareMetalServerOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetInstanceOptions) SetID(id string) *GetInstanceOptions { +func (_options *DeleteBareMetalServerOptions) SetID(id string) *DeleteBareMetalServerOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceOptions) SetHeaders(param map[string]string) *GetInstanceOptions { +func (options *DeleteBareMetalServerOptions) SetHeaders(param map[string]string) *DeleteBareMetalServerOptions { options.Headers = param return options } -// GetInstanceProfileOptions : The GetInstanceProfile options. -type GetInstanceProfileOptions struct { - // The instance profile name. - Name *string `json:"name" validate:"required,ne="` +// DeleteDedicatedHostGroupOptions : The DeleteDedicatedHostGroup options. +type DeleteDedicatedHostGroupOptions struct { + // The dedicated host group identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceProfileOptions : Instantiate GetInstanceProfileOptions -func (*VpcV1) NewGetInstanceProfileOptions(name string) *GetInstanceProfileOptions { - return &GetInstanceProfileOptions{ - Name: core.StringPtr(name), +// NewDeleteDedicatedHostGroupOptions : Instantiate DeleteDedicatedHostGroupOptions +func (*VpcV1) NewDeleteDedicatedHostGroupOptions(id string) *DeleteDedicatedHostGroupOptions { + return &DeleteDedicatedHostGroupOptions{ + ID: core.StringPtr(id), } } -// SetName : Allow user to set Name -func (_options *GetInstanceProfileOptions) SetName(name string) *GetInstanceProfileOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *DeleteDedicatedHostGroupOptions) SetID(id string) *DeleteDedicatedHostGroupOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceProfileOptions) SetHeaders(param map[string]string) *GetInstanceProfileOptions { +func (options *DeleteDedicatedHostGroupOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostGroupOptions { options.Headers = param return options } -// GetInstanceTemplateOptions : The GetInstanceTemplate options. -type GetInstanceTemplateOptions struct { - // The instance template identifier. +// DeleteDedicatedHostOptions : The DeleteDedicatedHost options. +type DeleteDedicatedHostOptions struct { + // The dedicated host identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceTemplateOptions : Instantiate GetInstanceTemplateOptions -func (*VpcV1) NewGetInstanceTemplateOptions(id string) *GetInstanceTemplateOptions { - return &GetInstanceTemplateOptions{ +// NewDeleteDedicatedHostOptions : Instantiate DeleteDedicatedHostOptions +func (*VpcV1) NewDeleteDedicatedHostOptions(id string) *DeleteDedicatedHostOptions { + return &DeleteDedicatedHostOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetInstanceTemplateOptions) SetID(id string) *GetInstanceTemplateOptions { +func (_options *DeleteDedicatedHostOptions) SetID(id string) *DeleteDedicatedHostOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceTemplateOptions) SetHeaders(param map[string]string) *GetInstanceTemplateOptions { +func (options *DeleteDedicatedHostOptions) SetHeaders(param map[string]string) *DeleteDedicatedHostOptions { options.Headers = param return options } -// GetInstanceVolumeAttachmentOptions : The GetInstanceVolumeAttachment options. -type GetInstanceVolumeAttachmentOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The volume attachment identifier. +// DeleteEndpointGatewayOptions : The DeleteEndpointGateway options. +type DeleteEndpointGatewayOptions struct { + // The endpoint gateway identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetInstanceVolumeAttachmentOptions : Instantiate GetInstanceVolumeAttachmentOptions -func (*VpcV1) NewGetInstanceVolumeAttachmentOptions(instanceID string, id string) *GetInstanceVolumeAttachmentOptions { - return &GetInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), +// NewDeleteEndpointGatewayOptions : Instantiate DeleteEndpointGatewayOptions +func (*VpcV1) NewDeleteEndpointGatewayOptions(id string) *DeleteEndpointGatewayOptions { + return &DeleteEndpointGatewayOptions{ + ID: core.StringPtr(id), } } -// SetInstanceID : Allow user to set InstanceID -func (_options *GetInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetInstanceVolumeAttachmentOptions) SetID(id string) *GetInstanceVolumeAttachmentOptions { +func (_options *DeleteEndpointGatewayOptions) SetID(id string) *DeleteEndpointGatewayOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceVolumeAttachmentOptions { +func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayOptions { options.Headers = param return options } -// GetIpsecPolicyOptions : The GetIpsecPolicy options. -type GetIpsecPolicyOptions struct { - // The IPsec policy identifier. +// DeleteFloatingIPOptions : The DeleteFloatingIP options. +type DeleteFloatingIPOptions struct { + // The floating IP identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetIpsecPolicyOptions : Instantiate GetIpsecPolicyOptions -func (*VpcV1) NewGetIpsecPolicyOptions(id string) *GetIpsecPolicyOptions { - return &GetIpsecPolicyOptions{ +// NewDeleteFloatingIPOptions : Instantiate DeleteFloatingIPOptions +func (*VpcV1) NewDeleteFloatingIPOptions(id string) *DeleteFloatingIPOptions { + return &DeleteFloatingIPOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetIpsecPolicyOptions) SetID(id string) *GetIpsecPolicyOptions { +func (_options *DeleteFloatingIPOptions) SetID(id string) *DeleteFloatingIPOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetIpsecPolicyOptions) SetHeaders(param map[string]string) *GetIpsecPolicyOptions { +func (options *DeleteFloatingIPOptions) SetHeaders(param map[string]string) *DeleteFloatingIPOptions { options.Headers = param return options } -// GetKeyOptions : The GetKey options. -type GetKeyOptions struct { - // The key identifier. - ID *string `json:"id" validate:"required,ne="` - +// DeleteFlowLogCollectorOptions : The DeleteFlowLogCollector options. +type DeleteFlowLogCollectorOptions struct { + // The flow log collector identifier. + ID *string `json:"id" validate:"required,ne="` + // Allows users to set headers on API requests Headers map[string]string } -// NewGetKeyOptions : Instantiate GetKeyOptions -func (*VpcV1) NewGetKeyOptions(id string) *GetKeyOptions { - return &GetKeyOptions{ +// NewDeleteFlowLogCollectorOptions : Instantiate DeleteFlowLogCollectorOptions +func (*VpcV1) NewDeleteFlowLogCollectorOptions(id string) *DeleteFlowLogCollectorOptions { + return &DeleteFlowLogCollectorOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetKeyOptions) SetID(id string) *GetKeyOptions { +func (_options *DeleteFlowLogCollectorOptions) SetID(id string) *DeleteFlowLogCollectorOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetKeyOptions) SetHeaders(param map[string]string) *GetKeyOptions { +func (options *DeleteFlowLogCollectorOptions) SetHeaders(param map[string]string) *DeleteFlowLogCollectorOptions { options.Headers = param return options } -// GetLoadBalancerListenerOptions : The GetLoadBalancerListener options. -type GetLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. +// DeleteIkePolicyOptions : The DeleteIkePolicy options. +type DeleteIkePolicyOptions struct { + // The IKE policy identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerListenerOptions : Instantiate GetLoadBalancerListenerOptions -func (*VpcV1) NewGetLoadBalancerListenerOptions(loadBalancerID string, id string) *GetLoadBalancerListenerOptions { - return &GetLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), +// NewDeleteIkePolicyOptions : Instantiate DeleteIkePolicyOptions +func (*VpcV1) NewDeleteIkePolicyOptions(id string) *DeleteIkePolicyOptions { + return &DeleteIkePolicyOptions{ + ID: core.StringPtr(id), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerOptions) SetID(id string) *GetLoadBalancerListenerOptions { +func (_options *DeleteIkePolicyOptions) SetID(id string) *DeleteIkePolicyOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerOptions { +func (options *DeleteIkePolicyOptions) SetHeaders(param map[string]string) *DeleteIkePolicyOptions { options.Headers = param return options } -// GetLoadBalancerListenerPolicyOptions : The GetLoadBalancerListenerPolicy options. -type GetLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` - - // The policy identifier. +// DeleteImageOptions : The DeleteImage options. +type DeleteImageOptions struct { + // The image identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerListenerPolicyOptions : Instantiate GetLoadBalancerListenerPolicyOptions -func (*VpcV1) NewGetLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *GetLoadBalancerListenerPolicyOptions { - return &GetLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), +// NewDeleteImageOptions : Instantiate DeleteImageOptions +func (*VpcV1) NewDeleteImageOptions(id string) *DeleteImageOptions { + return &DeleteImageOptions{ + ID: core.StringPtr(id), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetID : Allow user to set ID +func (_options *DeleteImageOptions) SetID(id string) *DeleteImageOptions { + _options.ID = core.StringPtr(id) return _options } -// SetListenerID : Allow user to set ListenerID -func (_options *GetLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +// SetHeaders : Allow user to set Headers +func (options *DeleteImageOptions) SetHeaders(param map[string]string) *DeleteImageOptions { + options.Headers = param + return options } -// SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerPolicyOptions) SetID(id string) *GetLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) +// DeleteInstanceGroupLoadBalancerOptions : The DeleteInstanceGroupLoadBalancer options. +type DeleteInstanceGroupLoadBalancerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteInstanceGroupLoadBalancerOptions : Instantiate DeleteInstanceGroupLoadBalancerOptions +func (*VpcV1) NewDeleteInstanceGroupLoadBalancerOptions(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { + return &DeleteInstanceGroupLoadBalancerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupLoadBalancerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupLoadBalancerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyOptions { +func (options *DeleteInstanceGroupLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupLoadBalancerOptions { options.Headers = param return options } -// GetLoadBalancerListenerPolicyRuleOptions : The GetLoadBalancerListenerPolicyRule options. -type GetLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` +// DeleteInstanceGroupManagerActionOptions : The DeleteInstanceGroupManagerAction options. +type DeleteInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The rule identifier. + // The instance group manager action identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerListenerPolicyRuleOptions : Instantiate GetLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewGetLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *GetLoadBalancerListenerPolicyRuleOptions { - return &GetLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), +// NewDeleteInstanceGroupManagerActionOptions : Instantiate DeleteInstanceGroupManagerActionOptions +func (*VpcV1) NewDeleteInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerActionOptions { + return &DeleteInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetListenerID : Allow user to set ListenerID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } -// SetPolicyID : Allow user to set PolicyID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *GetLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *DeleteInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) return _options } // SetID : Allow user to set ID -func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetID(id string) *GetLoadBalancerListenerPolicyRuleOptions { +func (_options *DeleteInstanceGroupManagerActionOptions) SetID(id string) *DeleteInstanceGroupManagerActionOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyRuleOptions { +func (options *DeleteInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerActionOptions { options.Headers = param return options } -// GetLoadBalancerOptions : The GetLoadBalancer options. -type GetLoadBalancerOptions struct { - // The load balancer identifier. +// DeleteInstanceGroupManagerOptions : The DeleteInstanceGroupManager options. +type DeleteInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerOptions : Instantiate GetLoadBalancerOptions -func (*VpcV1) NewGetLoadBalancerOptions(id string) *GetLoadBalancerOptions { - return &GetLoadBalancerOptions{ - ID: core.StringPtr(id), +// NewDeleteInstanceGroupManagerOptions : Instantiate DeleteInstanceGroupManagerOptions +func (*VpcV1) NewDeleteInstanceGroupManagerOptions(instanceGroupID string, id string) *DeleteInstanceGroupManagerOptions { + return &DeleteInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), } } +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetLoadBalancerOptions) SetID(id string) *GetLoadBalancerOptions { +func (_options *DeleteInstanceGroupManagerOptions) SetID(id string) *DeleteInstanceGroupManagerOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerOptions) SetHeaders(param map[string]string) *GetLoadBalancerOptions { +func (options *DeleteInstanceGroupManagerOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerOptions { options.Headers = param return options } -// GetLoadBalancerPoolMemberOptions : The GetLoadBalancerPoolMember options. -type GetLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// DeleteInstanceGroupManagerPolicyOptions : The DeleteInstanceGroupManagerPolicy options. +type DeleteInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The member identifier. + // The instance group manager policy identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerPoolMemberOptions : Instantiate GetLoadBalancerPoolMemberOptions -func (*VpcV1) NewGetLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *GetLoadBalancerPoolMemberOptions { - return &GetLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), +// NewDeleteInstanceGroupManagerPolicyOptions : Instantiate DeleteInstanceGroupManagerPolicyOptions +func (*VpcV1) NewDeleteInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *DeleteInstanceGroupManagerPolicyOptions { + return &DeleteInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } -// SetPoolID : Allow user to set PoolID -func (_options *GetLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *GetLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *DeleteInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *DeleteInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) return _options } // SetID : Allow user to set ID -func (_options *GetLoadBalancerPoolMemberOptions) SetID(id string) *GetLoadBalancerPoolMemberOptions { +func (_options *DeleteInstanceGroupManagerPolicyOptions) SetID(id string) *DeleteInstanceGroupManagerPolicyOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolMemberOptions { +func (options *DeleteInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupManagerPolicyOptions { options.Headers = param return options } -// GetLoadBalancerPoolOptions : The GetLoadBalancerPool options. -type GetLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// DeleteInstanceGroupMembershipOptions : The DeleteInstanceGroupMembership options. +type DeleteInstanceGroupMembershipOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The pool identifier. + // The instance group membership identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerPoolOptions : Instantiate GetLoadBalancerPoolOptions -func (*VpcV1) NewGetLoadBalancerPoolOptions(loadBalancerID string, id string) *GetLoadBalancerPoolOptions { - return &GetLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), +// NewDeleteInstanceGroupMembershipOptions : Instantiate DeleteInstanceGroupMembershipOptions +func (*VpcV1) NewDeleteInstanceGroupMembershipOptions(instanceGroupID string, id string) *DeleteInstanceGroupMembershipOptions { + return &DeleteInstanceGroupMembershipOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *GetLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } // SetID : Allow user to set ID -func (_options *GetLoadBalancerPoolOptions) SetID(id string) *GetLoadBalancerPoolOptions { +func (_options *DeleteInstanceGroupMembershipOptions) SetID(id string) *DeleteInstanceGroupMembershipOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerPoolOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolOptions { +func (options *DeleteInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipOptions { options.Headers = param return options } -// GetLoadBalancerProfileOptions : The GetLoadBalancerProfile options. -type GetLoadBalancerProfileOptions struct { - // The load balancer profile name. - Name *string `json:"name" validate:"required,ne="` +// DeleteInstanceGroupMembershipsOptions : The DeleteInstanceGroupMemberships options. +type DeleteInstanceGroupMembershipsOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerProfileOptions : Instantiate GetLoadBalancerProfileOptions -func (*VpcV1) NewGetLoadBalancerProfileOptions(name string) *GetLoadBalancerProfileOptions { - return &GetLoadBalancerProfileOptions{ - Name: core.StringPtr(name), +// NewDeleteInstanceGroupMembershipsOptions : Instantiate DeleteInstanceGroupMembershipsOptions +func (*VpcV1) NewDeleteInstanceGroupMembershipsOptions(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { + return &DeleteInstanceGroupMembershipsOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), } } -// SetName : Allow user to set Name -func (_options *GetLoadBalancerProfileOptions) SetName(name string) *GetLoadBalancerProfileOptions { - _options.Name = core.StringPtr(name) +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *DeleteInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *DeleteInstanceGroupMembershipsOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerProfileOptions) SetHeaders(param map[string]string) *GetLoadBalancerProfileOptions { +func (options *DeleteInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupMembershipsOptions { options.Headers = param return options } -// GetLoadBalancerStatisticsOptions : The GetLoadBalancerStatistics options. -type GetLoadBalancerStatisticsOptions struct { - // The load balancer identifier. +// DeleteInstanceGroupOptions : The DeleteInstanceGroup options. +type DeleteInstanceGroupOptions struct { + // The instance group identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetLoadBalancerStatisticsOptions : Instantiate GetLoadBalancerStatisticsOptions -func (*VpcV1) NewGetLoadBalancerStatisticsOptions(id string) *GetLoadBalancerStatisticsOptions { - return &GetLoadBalancerStatisticsOptions{ +// NewDeleteInstanceGroupOptions : Instantiate DeleteInstanceGroupOptions +func (*VpcV1) NewDeleteInstanceGroupOptions(id string) *DeleteInstanceGroupOptions { + return &DeleteInstanceGroupOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetLoadBalancerStatisticsOptions) SetID(id string) *GetLoadBalancerStatisticsOptions { +func (_options *DeleteInstanceGroupOptions) SetID(id string) *DeleteInstanceGroupOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetLoadBalancerStatisticsOptions) SetHeaders(param map[string]string) *GetLoadBalancerStatisticsOptions { +func (options *DeleteInstanceGroupOptions) SetHeaders(param map[string]string) *DeleteInstanceGroupOptions { options.Headers = param return options } -// GetNetworkACLOptions : The GetNetworkACL options. -type GetNetworkACLOptions struct { - // The network ACL identifier. +// DeleteInstanceNetworkInterfaceOptions : The DeleteInstanceNetworkInterface options. +type DeleteInstanceNetworkInterfaceOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The network interface identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetNetworkACLOptions : Instantiate GetNetworkACLOptions -func (*VpcV1) NewGetNetworkACLOptions(id string) *GetNetworkACLOptions { - return &GetNetworkACLOptions{ - ID: core.StringPtr(id), +// NewDeleteInstanceNetworkInterfaceOptions : Instantiate DeleteInstanceNetworkInterfaceOptions +func (*VpcV1) NewDeleteInstanceNetworkInterfaceOptions(instanceID string, id string) *DeleteInstanceNetworkInterfaceOptions { + return &DeleteInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), } } +// SetInstanceID : Allow user to set InstanceID +func (_options *DeleteInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *DeleteInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetNetworkACLOptions) SetID(id string) *GetNetworkACLOptions { +func (_options *DeleteInstanceNetworkInterfaceOptions) SetID(id string) *DeleteInstanceNetworkInterfaceOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetNetworkACLOptions) SetHeaders(param map[string]string) *GetNetworkACLOptions { +func (options *DeleteInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *DeleteInstanceNetworkInterfaceOptions { options.Headers = param return options } -// GetNetworkACLRuleOptions : The GetNetworkACLRule options. -type GetNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - - // The rule identifier. +// DeleteInstanceOptions : The DeleteInstance options. +type DeleteInstanceOptions struct { + // The instance identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetNetworkACLRuleOptions : Instantiate GetNetworkACLRuleOptions -func (*VpcV1) NewGetNetworkACLRuleOptions(networkACLID string, id string) *GetNetworkACLRuleOptions { - return &GetNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), +// NewDeleteInstanceOptions : Instantiate DeleteInstanceOptions +func (*VpcV1) NewDeleteInstanceOptions(id string) *DeleteInstanceOptions { + return &DeleteInstanceOptions{ + ID: core.StringPtr(id), } } -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *GetNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *GetNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetNetworkACLRuleOptions) SetID(id string) *GetNetworkACLRuleOptions { +func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetNetworkACLRuleOptions) SetHeaders(param map[string]string) *GetNetworkACLRuleOptions { +func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { options.Headers = param return options } -// GetOperatingSystemOptions : The GetOperatingSystem options. -type GetOperatingSystemOptions struct { - // The operating system name. - Name *string `json:"name" validate:"required,ne="` +// DeleteInstanceTemplateOptions : The DeleteInstanceTemplate options. +type DeleteInstanceTemplateOptions struct { + // The instance template identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetOperatingSystemOptions : Instantiate GetOperatingSystemOptions -func (*VpcV1) NewGetOperatingSystemOptions(name string) *GetOperatingSystemOptions { - return &GetOperatingSystemOptions{ - Name: core.StringPtr(name), +// NewDeleteInstanceTemplateOptions : Instantiate DeleteInstanceTemplateOptions +func (*VpcV1) NewDeleteInstanceTemplateOptions(id string) *DeleteInstanceTemplateOptions { + return &DeleteInstanceTemplateOptions{ + ID: core.StringPtr(id), } } -// SetName : Allow user to set Name -func (_options *GetOperatingSystemOptions) SetName(name string) *GetOperatingSystemOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *DeleteInstanceTemplateOptions) SetID(id string) *DeleteInstanceTemplateOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetOperatingSystemOptions) SetHeaders(param map[string]string) *GetOperatingSystemOptions { +func (options *DeleteInstanceTemplateOptions) SetHeaders(param map[string]string) *DeleteInstanceTemplateOptions { options.Headers = param return options } -// GetPlacementGroupOptions : The GetPlacementGroup options. -type GetPlacementGroupOptions struct { - // The placement group identifier. +// DeleteInstanceVolumeAttachmentOptions : The DeleteInstanceVolumeAttachment options. +type DeleteInstanceVolumeAttachmentOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The volume attachment identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetPlacementGroupOptions : Instantiate GetPlacementGroupOptions -func (*VpcV1) NewGetPlacementGroupOptions(id string) *GetPlacementGroupOptions { - return &GetPlacementGroupOptions{ - ID: core.StringPtr(id), +// NewDeleteInstanceVolumeAttachmentOptions : Instantiate DeleteInstanceVolumeAttachmentOptions +func (*VpcV1) NewDeleteInstanceVolumeAttachmentOptions(instanceID string, id string) *DeleteInstanceVolumeAttachmentOptions { + return &DeleteInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), } } +// SetInstanceID : Allow user to set InstanceID +func (_options *DeleteInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *DeleteInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetPlacementGroupOptions) SetID(id string) *GetPlacementGroupOptions { +func (_options *DeleteInstanceVolumeAttachmentOptions) SetID(id string) *DeleteInstanceVolumeAttachmentOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetPlacementGroupOptions) SetHeaders(param map[string]string) *GetPlacementGroupOptions { +func (options *DeleteInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *DeleteInstanceVolumeAttachmentOptions { options.Headers = param return options } -// GetPublicGatewayOptions : The GetPublicGateway options. -type GetPublicGatewayOptions struct { - // The public gateway identifier. +// DeleteIpsecPolicyOptions : The DeleteIpsecPolicy options. +type DeleteIpsecPolicyOptions struct { + // The IPsec policy identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetPublicGatewayOptions : Instantiate GetPublicGatewayOptions -func (*VpcV1) NewGetPublicGatewayOptions(id string) *GetPublicGatewayOptions { - return &GetPublicGatewayOptions{ +// NewDeleteIpsecPolicyOptions : Instantiate DeleteIpsecPolicyOptions +func (*VpcV1) NewDeleteIpsecPolicyOptions(id string) *DeleteIpsecPolicyOptions { + return &DeleteIpsecPolicyOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetPublicGatewayOptions) SetID(id string) *GetPublicGatewayOptions { +func (_options *DeleteIpsecPolicyOptions) SetID(id string) *DeleteIpsecPolicyOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetPublicGatewayOptions) SetHeaders(param map[string]string) *GetPublicGatewayOptions { +func (options *DeleteIpsecPolicyOptions) SetHeaders(param map[string]string) *DeleteIpsecPolicyOptions { options.Headers = param return options } -// GetRegionOptions : The GetRegion options. -type GetRegionOptions struct { - // The region name. - Name *string `json:"name" validate:"required,ne="` +// DeleteKeyOptions : The DeleteKey options. +type DeleteKeyOptions struct { + // The key identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetRegionOptions : Instantiate GetRegionOptions -func (*VpcV1) NewGetRegionOptions(name string) *GetRegionOptions { - return &GetRegionOptions{ - Name: core.StringPtr(name), +// NewDeleteKeyOptions : Instantiate DeleteKeyOptions +func (*VpcV1) NewDeleteKeyOptions(id string) *DeleteKeyOptions { + return &DeleteKeyOptions{ + ID: core.StringPtr(id), } } -// SetName : Allow user to set Name -func (_options *GetRegionOptions) SetName(name string) *GetRegionOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *DeleteKeyOptions) SetID(id string) *DeleteKeyOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetRegionOptions) SetHeaders(param map[string]string) *GetRegionOptions { +func (options *DeleteKeyOptions) SetHeaders(param map[string]string) *DeleteKeyOptions { options.Headers = param return options } -// GetRegionZoneOptions : The GetRegionZone options. -type GetRegionZoneOptions struct { - // The region name. - RegionName *string `json:"region_name" validate:"required,ne="` +// DeleteLoadBalancerListenerOptions : The DeleteLoadBalancerListener options. +type DeleteLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The zone name. - Name *string `json:"name" validate:"required,ne="` + // The listener identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetRegionZoneOptions : Instantiate GetRegionZoneOptions -func (*VpcV1) NewGetRegionZoneOptions(regionName string, name string) *GetRegionZoneOptions { - return &GetRegionZoneOptions{ - RegionName: core.StringPtr(regionName), - Name: core.StringPtr(name), +// NewDeleteLoadBalancerListenerOptions : Instantiate DeleteLoadBalancerListenerOptions +func (*VpcV1) NewDeleteLoadBalancerListenerOptions(loadBalancerID string, id string) *DeleteLoadBalancerListenerOptions { + return &DeleteLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), } } -// SetRegionName : Allow user to set RegionName -func (_options *GetRegionZoneOptions) SetRegionName(regionName string) *GetRegionZoneOptions { - _options.RegionName = core.StringPtr(regionName) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetName : Allow user to set Name -func (_options *GetRegionZoneOptions) SetName(name string) *GetRegionZoneOptions { - _options.Name = core.StringPtr(name) +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerListenerOptions) SetID(id string) *DeleteLoadBalancerListenerOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetRegionZoneOptions { +func (options *DeleteLoadBalancerListenerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerOptions { options.Headers = param return options } -// GetSecurityGroupNetworkInterfaceOptions : The GetSecurityGroupNetworkInterface options. -type GetSecurityGroupNetworkInterfaceOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` +// DeleteLoadBalancerListenerPolicyOptions : The DeleteLoadBalancerListenerPolicy options. +type DeleteLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The network interface identifier. + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSecurityGroupNetworkInterfaceOptions : Instantiate GetSecurityGroupNetworkInterfaceOptions -func (*VpcV1) NewGetSecurityGroupNetworkInterfaceOptions(securityGroupID string, id string) *GetSecurityGroupNetworkInterfaceOptions { - return &GetSecurityGroupNetworkInterfaceOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// NewDeleteLoadBalancerListenerPolicyOptions : Instantiate DeleteLoadBalancerListenerPolicyOptions +func (*VpcV1) NewDeleteLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *DeleteLoadBalancerListenerPolicyOptions { + return &DeleteLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + ID: core.StringPtr(id), } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupNetworkInterfaceOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupNetworkInterfaceOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } -// SetID : Allow user to set ID -func (_options *GetSecurityGroupNetworkInterfaceOptions) SetID(id string) *GetSecurityGroupNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) +// SetListenerID : Allow user to set ListenerID +func (_options *DeleteLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerListenerPolicyOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyOptions { + _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetSecurityGroupNetworkInterfaceOptions { +func (options *DeleteLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyOptions { options.Headers = param return options } -// GetSecurityGroupOptions : The GetSecurityGroup options. -type GetSecurityGroupOptions struct { - // The security group identifier. +// DeleteLoadBalancerListenerPolicyRuleOptions : The DeleteLoadBalancerListenerPolicyRule options. +type DeleteLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The rule identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSecurityGroupOptions : Instantiate GetSecurityGroupOptions -func (*VpcV1) NewGetSecurityGroupOptions(id string) *GetSecurityGroupOptions { - return &GetSecurityGroupOptions{ +// NewDeleteLoadBalancerListenerPolicyRuleOptions : Instantiate DeleteLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewDeleteLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *DeleteLoadBalancerListenerPolicyRuleOptions { + return &DeleteLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + ID: core.StringPtr(id), + } +} + +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetListenerID : Allow user to set ListenerID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} + +// SetPolicyID : Allow user to set PolicyID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteLoadBalancerListenerPolicyRuleOptions) SetID(id string) *DeleteLoadBalancerListenerPolicyRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerListenerPolicyRuleOptions { + options.Headers = param + return options +} + +// DeleteLoadBalancerOptions : The DeleteLoadBalancer options. +type DeleteLoadBalancerOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteLoadBalancerOptions : Instantiate DeleteLoadBalancerOptions +func (*VpcV1) NewDeleteLoadBalancerOptions(id string) *DeleteLoadBalancerOptions { + return &DeleteLoadBalancerOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetSecurityGroupOptions) SetID(id string) *GetSecurityGroupOptions { +func (_options *DeleteLoadBalancerOptions) SetID(id string) *DeleteLoadBalancerOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupOptions) SetHeaders(param map[string]string) *GetSecurityGroupOptions { +func (options *DeleteLoadBalancerOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerOptions { options.Headers = param return options } -// GetSecurityGroupRuleOptions : The GetSecurityGroupRule options. -type GetSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` +// DeleteLoadBalancerPoolMemberOptions : The DeleteLoadBalancerPoolMember options. +type DeleteLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The rule identifier. + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` + + // The member identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSecurityGroupRuleOptions : Instantiate GetSecurityGroupRuleOptions -func (*VpcV1) NewGetSecurityGroupRuleOptions(securityGroupID string, id string) *GetSecurityGroupRuleOptions { - return &GetSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// NewDeleteLoadBalancerPoolMemberOptions : Instantiate DeleteLoadBalancerPoolMemberOptions +func (*VpcV1) NewDeleteLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *DeleteLoadBalancerPoolMemberOptions { + return &DeleteLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + ID: core.StringPtr(id), } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetPoolID : Allow user to set PoolID +func (_options *DeleteLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *DeleteLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) return _options } // SetID : Allow user to set ID -func (_options *GetSecurityGroupRuleOptions) SetID(id string) *GetSecurityGroupRuleOptions { +func (_options *DeleteLoadBalancerPoolMemberOptions) SetID(id string) *DeleteLoadBalancerPoolMemberOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupRuleOptions) SetHeaders(param map[string]string) *GetSecurityGroupRuleOptions { +func (options *DeleteLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolMemberOptions { options.Headers = param return options } -// GetSecurityGroupTargetOptions : The GetSecurityGroupTarget options. -type GetSecurityGroupTargetOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` +// DeleteLoadBalancerPoolOptions : The DeleteLoadBalancerPool options. +type DeleteLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The security group target identifier. + // The pool identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSecurityGroupTargetOptions : Instantiate GetSecurityGroupTargetOptions -func (*VpcV1) NewGetSecurityGroupTargetOptions(securityGroupID string, id string) *GetSecurityGroupTargetOptions { - return &GetSecurityGroupTargetOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// NewDeleteLoadBalancerPoolOptions : Instantiate DeleteLoadBalancerPoolOptions +func (*VpcV1) NewDeleteLoadBalancerPoolOptions(loadBalancerID string, id string) *DeleteLoadBalancerPoolOptions { + return &DeleteLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), } } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *GetSecurityGroupTargetOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupTargetOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *DeleteLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *DeleteLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) return _options } // SetID : Allow user to set ID -func (_options *GetSecurityGroupTargetOptions) SetID(id string) *GetSecurityGroupTargetOptions { +func (_options *DeleteLoadBalancerPoolOptions) SetID(id string) *DeleteLoadBalancerPoolOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSecurityGroupTargetOptions) SetHeaders(param map[string]string) *GetSecurityGroupTargetOptions { +func (options *DeleteLoadBalancerPoolOptions) SetHeaders(param map[string]string) *DeleteLoadBalancerPoolOptions { options.Headers = param return options } -// GetSnapshotOptions : The GetSnapshot options. -type GetSnapshotOptions struct { - // The snapshot identifier. +// DeleteNetworkACLOptions : The DeleteNetworkACL options. +type DeleteNetworkACLOptions struct { + // The network ACL identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSnapshotOptions : Instantiate GetSnapshotOptions -func (*VpcV1) NewGetSnapshotOptions(id string) *GetSnapshotOptions { - return &GetSnapshotOptions{ +// NewDeleteNetworkACLOptions : Instantiate DeleteNetworkACLOptions +func (*VpcV1) NewDeleteNetworkACLOptions(id string) *DeleteNetworkACLOptions { + return &DeleteNetworkACLOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetSnapshotOptions) SetID(id string) *GetSnapshotOptions { +func (_options *DeleteNetworkACLOptions) SetID(id string) *DeleteNetworkACLOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSnapshotOptions) SetHeaders(param map[string]string) *GetSnapshotOptions { +func (options *DeleteNetworkACLOptions) SetHeaders(param map[string]string) *DeleteNetworkACLOptions { options.Headers = param return options } -// GetSubnetNetworkACLOptions : The GetSubnetNetworkACL options. -type GetSubnetNetworkACLOptions struct { - // The subnet identifier. +// DeleteNetworkACLRuleOptions : The DeleteNetworkACLRule options. +type DeleteNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + + // The rule identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSubnetNetworkACLOptions : Instantiate GetSubnetNetworkACLOptions -func (*VpcV1) NewGetSubnetNetworkACLOptions(id string) *GetSubnetNetworkACLOptions { - return &GetSubnetNetworkACLOptions{ +// NewDeleteNetworkACLRuleOptions : Instantiate DeleteNetworkACLRuleOptions +func (*VpcV1) NewDeleteNetworkACLRuleOptions(networkACLID string, id string) *DeleteNetworkACLRuleOptions { + return &DeleteNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + ID: core.StringPtr(id), + } +} + +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *DeleteNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *DeleteNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteNetworkACLRuleOptions) SetID(id string) *DeleteNetworkACLRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteNetworkACLRuleOptions) SetHeaders(param map[string]string) *DeleteNetworkACLRuleOptions { + options.Headers = param + return options +} + +// DeletePlacementGroupOptions : The DeletePlacementGroup options. +type DeletePlacementGroupOptions struct { + // The placement group identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeletePlacementGroupOptions : Instantiate DeletePlacementGroupOptions +func (*VpcV1) NewDeletePlacementGroupOptions(id string) *DeletePlacementGroupOptions { + return &DeletePlacementGroupOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetSubnetNetworkACLOptions) SetID(id string) *GetSubnetNetworkACLOptions { +func (_options *DeletePlacementGroupOptions) SetID(id string) *DeletePlacementGroupOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSubnetNetworkACLOptions) SetHeaders(param map[string]string) *GetSubnetNetworkACLOptions { +func (options *DeletePlacementGroupOptions) SetHeaders(param map[string]string) *DeletePlacementGroupOptions { options.Headers = param return options } -// GetSubnetOptions : The GetSubnet options. -type GetSubnetOptions struct { - // The subnet identifier. +// DeletePublicGatewayOptions : The DeletePublicGateway options. +type DeletePublicGatewayOptions struct { + // The public gateway identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSubnetOptions : Instantiate GetSubnetOptions -func (*VpcV1) NewGetSubnetOptions(id string) *GetSubnetOptions { - return &GetSubnetOptions{ +// NewDeletePublicGatewayOptions : Instantiate DeletePublicGatewayOptions +func (*VpcV1) NewDeletePublicGatewayOptions(id string) *DeletePublicGatewayOptions { + return &DeletePublicGatewayOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetSubnetOptions) SetID(id string) *GetSubnetOptions { +func (_options *DeletePublicGatewayOptions) SetID(id string) *DeletePublicGatewayOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSubnetOptions) SetHeaders(param map[string]string) *GetSubnetOptions { +func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) *DeletePublicGatewayOptions { options.Headers = param return options } -// GetSubnetPublicGatewayOptions : The GetSubnetPublicGateway options. -type GetSubnetPublicGatewayOptions struct { - // The subnet identifier. +// DeleteSecurityGroupOptions : The DeleteSecurityGroup options. +type DeleteSecurityGroupOptions struct { + // The security group identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSubnetPublicGatewayOptions : Instantiate GetSubnetPublicGatewayOptions -func (*VpcV1) NewGetSubnetPublicGatewayOptions(id string) *GetSubnetPublicGatewayOptions { - return &GetSubnetPublicGatewayOptions{ +// NewDeleteSecurityGroupOptions : Instantiate DeleteSecurityGroupOptions +func (*VpcV1) NewDeleteSecurityGroupOptions(id string) *DeleteSecurityGroupOptions { + return &DeleteSecurityGroupOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetSubnetPublicGatewayOptions) SetID(id string) *GetSubnetPublicGatewayOptions { +func (_options *DeleteSecurityGroupOptions) SetID(id string) *DeleteSecurityGroupOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *GetSubnetPublicGatewayOptions { +func (options *DeleteSecurityGroupOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupOptions { options.Headers = param return options } -// GetSubnetReservedIPOptions : The GetSubnetReservedIP options. -type GetSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` +// DeleteSecurityGroupRuleOptions : The DeleteSecurityGroupRule options. +type DeleteSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The reserved IP identifier. + // The rule identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSubnetReservedIPOptions : Instantiate GetSubnetReservedIPOptions -func (*VpcV1) NewGetSubnetReservedIPOptions(subnetID string, id string) *GetSubnetReservedIPOptions { - return &GetSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), +// NewDeleteSecurityGroupRuleOptions : Instantiate DeleteSecurityGroupRuleOptions +func (*VpcV1) NewDeleteSecurityGroupRuleOptions(securityGroupID string, id string) *DeleteSecurityGroupRuleOptions { + return &DeleteSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } } -// SetSubnetID : Allow user to set SubnetID -func (_options *GetSubnetReservedIPOptions) SetSubnetID(subnetID string) *GetSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *DeleteSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) return _options } // SetID : Allow user to set ID -func (_options *GetSubnetReservedIPOptions) SetID(id string) *GetSubnetReservedIPOptions { +func (_options *DeleteSecurityGroupRuleOptions) SetID(id string) *DeleteSecurityGroupRuleOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSubnetReservedIPOptions) SetHeaders(param map[string]string) *GetSubnetReservedIPOptions { +func (options *DeleteSecurityGroupRuleOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupRuleOptions { options.Headers = param return options } -// GetSubnetRoutingTableOptions : The GetSubnetRoutingTable options. -type GetSubnetRoutingTableOptions struct { - // The subnet identifier. +// DeleteSecurityGroupTargetBindingOptions : The DeleteSecurityGroupTargetBinding options. +type DeleteSecurityGroupTargetBindingOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // The security group target identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetSubnetRoutingTableOptions : Instantiate GetSubnetRoutingTableOptions -func (*VpcV1) NewGetSubnetRoutingTableOptions(id string) *GetSubnetRoutingTableOptions { - return &GetSubnetRoutingTableOptions{ - ID: core.StringPtr(id), +// NewDeleteSecurityGroupTargetBindingOptions : Instantiate DeleteSecurityGroupTargetBindingOptions +func (*VpcV1) NewDeleteSecurityGroupTargetBindingOptions(securityGroupID string, id string) *DeleteSecurityGroupTargetBindingOptions { + return &DeleteSecurityGroupTargetBindingOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } } +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *DeleteSecurityGroupTargetBindingOptions) SetSecurityGroupID(securityGroupID string) *DeleteSecurityGroupTargetBindingOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetSubnetRoutingTableOptions) SetID(id string) *GetSubnetRoutingTableOptions { +func (_options *DeleteSecurityGroupTargetBindingOptions) SetID(id string) *DeleteSecurityGroupTargetBindingOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetSubnetRoutingTableOptions) SetHeaders(param map[string]string) *GetSubnetRoutingTableOptions { +func (options *DeleteSecurityGroupTargetBindingOptions) SetHeaders(param map[string]string) *DeleteSecurityGroupTargetBindingOptions { options.Headers = param return options } -// GetVolumeOptions : The GetVolume options. -type GetVolumeOptions struct { - // The volume identifier. +// DeleteSnapshotOptions : The DeleteSnapshot options. +type DeleteSnapshotOptions struct { + // The snapshot identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVolumeOptions : Instantiate GetVolumeOptions -func (*VpcV1) NewGetVolumeOptions(id string) *GetVolumeOptions { - return &GetVolumeOptions{ +// NewDeleteSnapshotOptions : Instantiate DeleteSnapshotOptions +func (*VpcV1) NewDeleteSnapshotOptions(id string) *DeleteSnapshotOptions { + return &DeleteSnapshotOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVolumeOptions) SetID(id string) *GetVolumeOptions { +func (_options *DeleteSnapshotOptions) SetID(id string) *DeleteSnapshotOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVolumeOptions) SetHeaders(param map[string]string) *GetVolumeOptions { +func (options *DeleteSnapshotOptions) SetHeaders(param map[string]string) *DeleteSnapshotOptions { options.Headers = param return options } -// GetVolumeProfileOptions : The GetVolumeProfile options. -type GetVolumeProfileOptions struct { - // The volume profile name. - Name *string `json:"name" validate:"required,ne="` +// DeleteSnapshotsOptions : The DeleteSnapshots options. +type DeleteSnapshotsOptions struct { + // Filters the collection to resources with the source volume with the specified identifier. + SourceVolumeID *string `json:"source_volume.id" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVolumeProfileOptions : Instantiate GetVolumeProfileOptions -func (*VpcV1) NewGetVolumeProfileOptions(name string) *GetVolumeProfileOptions { - return &GetVolumeProfileOptions{ - Name: core.StringPtr(name), +// NewDeleteSnapshotsOptions : Instantiate DeleteSnapshotsOptions +func (*VpcV1) NewDeleteSnapshotsOptions(sourceVolumeID string) *DeleteSnapshotsOptions { + return &DeleteSnapshotsOptions{ + SourceVolumeID: core.StringPtr(sourceVolumeID), } } -// SetName : Allow user to set Name -func (_options *GetVolumeProfileOptions) SetName(name string) *GetVolumeProfileOptions { - _options.Name = core.StringPtr(name) +// SetSourceVolumeID : Allow user to set SourceVolumeID +func (_options *DeleteSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *DeleteSnapshotsOptions { + _options.SourceVolumeID = core.StringPtr(sourceVolumeID) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVolumeProfileOptions) SetHeaders(param map[string]string) *GetVolumeProfileOptions { +func (options *DeleteSnapshotsOptions) SetHeaders(param map[string]string) *DeleteSnapshotsOptions { options.Headers = param return options } -// GetVPCAddressPrefixOptions : The GetVPCAddressPrefix options. -type GetVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The prefix identifier. +// DeleteSubnetOptions : The DeleteSubnet options. +type DeleteSubnetOptions struct { + // The subnet identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCAddressPrefixOptions : Instantiate GetVPCAddressPrefixOptions -func (*VpcV1) NewGetVPCAddressPrefixOptions(vpcID string, id string) *GetVPCAddressPrefixOptions { - return &GetVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), +// NewDeleteSubnetOptions : Instantiate DeleteSubnetOptions +func (*VpcV1) NewDeleteSubnetOptions(id string) *DeleteSubnetOptions { + return &DeleteSubnetOptions{ + ID: core.StringPtr(id), } } -// SetVPCID : Allow user to set VPCID -func (_options *GetVPCAddressPrefixOptions) SetVPCID(vpcID string) *GetVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - // SetID : Allow user to set ID -func (_options *GetVPCAddressPrefixOptions) SetID(id string) *GetVPCAddressPrefixOptions { +func (_options *DeleteSubnetOptions) SetID(id string) *DeleteSubnetOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCAddressPrefixOptions) SetHeaders(param map[string]string) *GetVPCAddressPrefixOptions { +func (options *DeleteSubnetOptions) SetHeaders(param map[string]string) *DeleteSubnetOptions { options.Headers = param return options } -// GetVPCDefaultNetworkACLOptions : The GetVPCDefaultNetworkACL options. -type GetVPCDefaultNetworkACLOptions struct { - // The VPC identifier. +// DeleteSubnetReservedIPOptions : The DeleteSubnetReservedIP options. +type DeleteSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` + + // The reserved IP identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDefaultNetworkACLOptions : Instantiate GetVPCDefaultNetworkACLOptions -func (*VpcV1) NewGetVPCDefaultNetworkACLOptions(id string) *GetVPCDefaultNetworkACLOptions { - return &GetVPCDefaultNetworkACLOptions{ - ID: core.StringPtr(id), +// NewDeleteSubnetReservedIPOptions : Instantiate DeleteSubnetReservedIPOptions +func (*VpcV1) NewDeleteSubnetReservedIPOptions(subnetID string, id string) *DeleteSubnetReservedIPOptions { + return &DeleteSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), + ID: core.StringPtr(id), } } +// SetSubnetID : Allow user to set SubnetID +func (_options *DeleteSubnetReservedIPOptions) SetSubnetID(subnetID string) *DeleteSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetVPCDefaultNetworkACLOptions) SetID(id string) *GetVPCDefaultNetworkACLOptions { +func (_options *DeleteSubnetReservedIPOptions) SetID(id string) *DeleteSubnetReservedIPOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultNetworkACLOptions) SetHeaders(param map[string]string) *GetVPCDefaultNetworkACLOptions { +func (options *DeleteSubnetReservedIPOptions) SetHeaders(param map[string]string) *DeleteSubnetReservedIPOptions { options.Headers = param return options } -// GetVPCDefaultRoutingTableOptions : The GetVPCDefaultRoutingTable options. -type GetVPCDefaultRoutingTableOptions struct { - // The VPC identifier. +// DeleteVolumeOptions : The DeleteVolume options. +type DeleteVolumeOptions struct { + // The volume identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDefaultRoutingTableOptions : Instantiate GetVPCDefaultRoutingTableOptions -func (*VpcV1) NewGetVPCDefaultRoutingTableOptions(id string) *GetVPCDefaultRoutingTableOptions { - return &GetVPCDefaultRoutingTableOptions{ +// NewDeleteVolumeOptions : Instantiate DeleteVolumeOptions +func (*VpcV1) NewDeleteVolumeOptions(id string) *DeleteVolumeOptions { + return &DeleteVolumeOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPCDefaultRoutingTableOptions) SetID(id string) *GetVPCDefaultRoutingTableOptions { +func (_options *DeleteVolumeOptions) SetID(id string) *DeleteVolumeOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCDefaultRoutingTableOptions { +func (options *DeleteVolumeOptions) SetHeaders(param map[string]string) *DeleteVolumeOptions { options.Headers = param return options } -// GetVPCDefaultSecurityGroupOptions : The GetVPCDefaultSecurityGroup options. -type GetVPCDefaultSecurityGroupOptions struct { +// DeleteVPCAddressPrefixOptions : The DeleteVPCAddressPrefix options. +type DeleteVPCAddressPrefixOptions struct { // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The prefix identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewGetVPCDefaultSecurityGroupOptions : Instantiate GetVPCDefaultSecurityGroupOptions -func (*VpcV1) NewGetVPCDefaultSecurityGroupOptions(id string) *GetVPCDefaultSecurityGroupOptions { - return &GetVPCDefaultSecurityGroupOptions{ - ID: core.StringPtr(id), +// NewDeleteVPCAddressPrefixOptions : Instantiate DeleteVPCAddressPrefixOptions +func (*VpcV1) NewDeleteVPCAddressPrefixOptions(vpcID string, id string) *DeleteVPCAddressPrefixOptions { + return &DeleteVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } } +// SetVPCID : Allow user to set VPCID +func (_options *DeleteVPCAddressPrefixOptions) SetVPCID(vpcID string) *DeleteVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + // SetID : Allow user to set ID -func (_options *GetVPCDefaultSecurityGroupOptions) SetID(id string) *GetVPCDefaultSecurityGroupOptions { +func (_options *DeleteVPCAddressPrefixOptions) SetID(id string) *DeleteVPCAddressPrefixOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCDefaultSecurityGroupOptions) SetHeaders(param map[string]string) *GetVPCDefaultSecurityGroupOptions { +func (options *DeleteVPCAddressPrefixOptions) SetHeaders(param map[string]string) *DeleteVPCAddressPrefixOptions { options.Headers = param return options } -// GetVPCOptions : The GetVPC options. -type GetVPCOptions struct { +// DeleteVPCOptions : The DeleteVPC options. +type DeleteVPCOptions struct { // The VPC identifier. ID *string `json:"id" validate:"required,ne="` @@ -28028,27 +28760,27 @@ type GetVPCOptions struct { Headers map[string]string } -// NewGetVPCOptions : Instantiate GetVPCOptions -func (*VpcV1) NewGetVPCOptions(id string) *GetVPCOptions { - return &GetVPCOptions{ +// NewDeleteVPCOptions : Instantiate DeleteVPCOptions +func (*VpcV1) NewDeleteVPCOptions(id string) *DeleteVPCOptions { + return &DeleteVPCOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPCOptions) SetID(id string) *GetVPCOptions { +func (_options *DeleteVPCOptions) SetID(id string) *DeleteVPCOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCOptions) SetHeaders(param map[string]string) *GetVPCOptions { +func (options *DeleteVPCOptions) SetHeaders(param map[string]string) *DeleteVPCOptions { options.Headers = param return options } -// GetVPCRouteOptions : The GetVPCRoute options. -type GetVPCRouteOptions struct { +// DeleteVPCRouteOptions : The DeleteVPCRoute options. +type DeleteVPCRouteOptions struct { // The VPC identifier. VPCID *string `json:"vpc_id" validate:"required,ne="` @@ -28059,34 +28791,34 @@ type GetVPCRouteOptions struct { Headers map[string]string } -// NewGetVPCRouteOptions : Instantiate GetVPCRouteOptions -func (*VpcV1) NewGetVPCRouteOptions(vpcID string, id string) *GetVPCRouteOptions { - return &GetVPCRouteOptions{ +// NewDeleteVPCRouteOptions : Instantiate DeleteVPCRouteOptions +func (*VpcV1) NewDeleteVPCRouteOptions(vpcID string, id string) *DeleteVPCRouteOptions { + return &DeleteVPCRouteOptions{ VPCID: core.StringPtr(vpcID), ID: core.StringPtr(id), } } // SetVPCID : Allow user to set VPCID -func (_options *GetVPCRouteOptions) SetVPCID(vpcID string) *GetVPCRouteOptions { +func (_options *DeleteVPCRouteOptions) SetVPCID(vpcID string) *DeleteVPCRouteOptions { _options.VPCID = core.StringPtr(vpcID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCRouteOptions) SetID(id string) *GetVPCRouteOptions { +func (_options *DeleteVPCRouteOptions) SetID(id string) *DeleteVPCRouteOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCRouteOptions) SetHeaders(param map[string]string) *GetVPCRouteOptions { +func (options *DeleteVPCRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRouteOptions { options.Headers = param return options } -// GetVPCRoutingTableOptions : The GetVPCRoutingTable options. -type GetVPCRoutingTableOptions struct { +// DeleteVPCRoutingTableOptions : The DeleteVPCRoutingTable options. +type DeleteVPCRoutingTableOptions struct { // The VPC identifier. VPCID *string `json:"vpc_id" validate:"required,ne="` @@ -28097,34 +28829,34 @@ type GetVPCRoutingTableOptions struct { Headers map[string]string } -// NewGetVPCRoutingTableOptions : Instantiate GetVPCRoutingTableOptions -func (*VpcV1) NewGetVPCRoutingTableOptions(vpcID string, id string) *GetVPCRoutingTableOptions { - return &GetVPCRoutingTableOptions{ +// NewDeleteVPCRoutingTableOptions : Instantiate DeleteVPCRoutingTableOptions +func (*VpcV1) NewDeleteVPCRoutingTableOptions(vpcID string, id string) *DeleteVPCRoutingTableOptions { + return &DeleteVPCRoutingTableOptions{ VPCID: core.StringPtr(vpcID), ID: core.StringPtr(id), } } // SetVPCID : Allow user to set VPCID -func (_options *GetVPCRoutingTableOptions) SetVPCID(vpcID string) *GetVPCRoutingTableOptions { +func (_options *DeleteVPCRoutingTableOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableOptions { _options.VPCID = core.StringPtr(vpcID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCRoutingTableOptions) SetID(id string) *GetVPCRoutingTableOptions { +func (_options *DeleteVPCRoutingTableOptions) SetID(id string) *DeleteVPCRoutingTableOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableOptions { +func (options *DeleteVPCRoutingTableOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableOptions { options.Headers = param return options } -// GetVPCRoutingTableRouteOptions : The GetVPCRoutingTableRoute options. -type GetVPCRoutingTableRouteOptions struct { +// DeleteVPCRoutingTableRouteOptions : The DeleteVPCRoutingTableRoute options. +type DeleteVPCRoutingTableRouteOptions struct { // The VPC identifier. VPCID *string `json:"vpc_id" validate:"required,ne="` @@ -28138,9 +28870,9 @@ type GetVPCRoutingTableRouteOptions struct { Headers map[string]string } -// NewGetVPCRoutingTableRouteOptions : Instantiate GetVPCRoutingTableRouteOptions -func (*VpcV1) NewGetVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *GetVPCRoutingTableRouteOptions { - return &GetVPCRoutingTableRouteOptions{ +// NewDeleteVPCRoutingTableRouteOptions : Instantiate DeleteVPCRoutingTableRouteOptions +func (*VpcV1) NewDeleteVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *DeleteVPCRoutingTableRouteOptions { + return &DeleteVPCRoutingTableRouteOptions{ VPCID: core.StringPtr(vpcID), RoutingTableID: core.StringPtr(routingTableID), ID: core.StringPtr(id), @@ -28148,31 +28880,31 @@ func (*VpcV1) NewGetVPCRoutingTableRouteOptions(vpcID string, routingTableID str } // SetVPCID : Allow user to set VPCID -func (_options *GetVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *GetVPCRoutingTableRouteOptions { +func (_options *DeleteVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *DeleteVPCRoutingTableRouteOptions { _options.VPCID = core.StringPtr(vpcID) return _options } // SetRoutingTableID : Allow user to set RoutingTableID -func (_options *GetVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *GetVPCRoutingTableRouteOptions { +func (_options *DeleteVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *DeleteVPCRoutingTableRouteOptions { _options.RoutingTableID = core.StringPtr(routingTableID) return _options } // SetID : Allow user to set ID -func (_options *GetVPCRoutingTableRouteOptions) SetID(id string) *GetVPCRoutingTableRouteOptions { +func (_options *DeleteVPCRoutingTableRouteOptions) SetID(id string) *DeleteVPCRoutingTableRouteOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableRouteOptions { +func (options *DeleteVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *DeleteVPCRoutingTableRouteOptions { options.Headers = param return options } -// GetVPNGatewayConnectionOptions : The GetVPNGatewayConnection options. -type GetVPNGatewayConnectionOptions struct { +// DeleteVPNGatewayConnectionOptions : The DeleteVPNGatewayConnection options. +type DeleteVPNGatewayConnectionOptions struct { // The VPN gateway identifier. VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` @@ -28183,34 +28915,34 @@ type GetVPNGatewayConnectionOptions struct { Headers map[string]string } -// NewGetVPNGatewayConnectionOptions : Instantiate GetVPNGatewayConnectionOptions -func (*VpcV1) NewGetVPNGatewayConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayConnectionOptions { - return &GetVPNGatewayConnectionOptions{ +// NewDeleteVPNGatewayConnectionOptions : Instantiate DeleteVPNGatewayConnectionOptions +func (*VpcV1) NewDeleteVPNGatewayConnectionOptions(vpnGatewayID string, id string) *DeleteVPNGatewayConnectionOptions { + return &DeleteVPNGatewayConnectionOptions{ VPNGatewayID: core.StringPtr(vpnGatewayID), ID: core.StringPtr(id), } } // SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *GetVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayConnectionOptions { +func (_options *DeleteVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *DeleteVPNGatewayConnectionOptions { _options.VPNGatewayID = core.StringPtr(vpnGatewayID) return _options } // SetID : Allow user to set ID -func (_options *GetVPNGatewayConnectionOptions) SetID(id string) *GetVPNGatewayConnectionOptions { +func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGatewayConnectionOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayConnectionOptions { +func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { options.Headers = param return options } -// GetVPNGatewayOptions : The GetVPNGateway options. -type GetVPNGatewayOptions struct { +// DeleteVPNGatewayOptions : The DeleteVPNGateway options. +type DeleteVPNGatewayOptions struct { // The VPN gateway identifier. ID *string `json:"id" validate:"required,ne="` @@ -28218,148 +28950,220 @@ type GetVPNGatewayOptions struct { Headers map[string]string } -// NewGetVPNGatewayOptions : Instantiate GetVPNGatewayOptions -func (*VpcV1) NewGetVPNGatewayOptions(id string) *GetVPNGatewayOptions { - return &GetVPNGatewayOptions{ +// NewDeleteVPNGatewayOptions : Instantiate DeleteVPNGatewayOptions +func (*VpcV1) NewDeleteVPNGatewayOptions(id string) *DeleteVPNGatewayOptions { + return &DeleteVPNGatewayOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (_options *GetVPNGatewayOptions) SetID(id string) *GetVPNGatewayOptions { +func (_options *DeleteVPNGatewayOptions) SetID(id string) *DeleteVPNGatewayOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPNGatewayOptions { +func (options *DeleteVPNGatewayOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayOptions { options.Headers = param return options } -// IkePolicy : IkePolicy struct -type IkePolicy struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` +// EncryptionKeyIdentity : Identifies an encryption key by a unique property. +// Models which "extend" this model: +// - EncryptionKeyIdentityByCRN +type EncryptionKeyIdentity struct { + // The CRN of the [Key Protect Root + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto + // Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + CRN *string `json:"crn,omitempty"` +} - // The VPN gateway connections that use this IKE policy. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` +func (*EncryptionKeyIdentity) isaEncryptionKeyIdentity() bool { + return true +} - // The date and time that this IKE policy was created. +type EncryptionKeyIdentityIntf interface { + isaEncryptionKeyIdentity() bool +} + +// UnmarshalEncryptionKeyIdentity unmarshals an instance of EncryptionKeyIdentity from the specified map of raw messages. +func UnmarshalEncryptionKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EncryptionKeyReference : EncryptionKeyReference struct +type EncryptionKeyReference struct { + // The CRN of the [Key Protect Root + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto + // Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + CRN *string `json:"crn" validate:"required"` +} + +// UnmarshalEncryptionKeyReference unmarshals an instance of EncryptionKeyReference from the specified map of raw messages. +func UnmarshalEncryptionKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EncryptionKeyReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGateway : EndpointGateway struct +type EndpointGateway struct { + // The date and time that the endpoint gateway was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group" validate:"required"` + // The CRN for this endpoint gateway. + CRN *string `json:"crn" validate:"required"` - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` - // The IKE policy's canonical URL. + // The URL for this endpoint gateway. Href *string `json:"href" validate:"required"` - // The unique identifier for this IKE policy. + // The unique identifier for this endpoint gateway. ID *string `json:"id" validate:"required"` - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` + // The reserved IPs bound to this endpoint gateway. + Ips []ReservedIPReference `json:"ips" validate:"required"` - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime" validate:"required"` + // The lifecycle state of the endpoint gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The user-defined name for this IKE policy. + // The unique user-defined name for this endpoint gateway. Name *string `json:"name" validate:"required"` - // The IKE negotiation mode. Only `main` is supported. - NegotiationMode *string `json:"negotiation_mode" validate:"required"` - - // The resource group for this IKE policy. + // The resource group for this endpoint gateway. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` -} -// Constants associated with the IkePolicy.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - IkePolicyAuthenticationAlgorithmMd5Const = "md5" - IkePolicyAuthenticationAlgorithmSha1Const = "sha1" - IkePolicyAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyAuthenticationAlgorithmSha512Const = "sha512" -) + // The security groups targeting this endpoint gateway. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` -// Constants associated with the IkePolicy.EncryptionAlgorithm property. -// The encryption algorithm. + // The fully qualified domain name for the target service. + ServiceEndpoint *string `json:"service_endpoint,omitempty"` + + // The fully qualified domain names for the target service. + ServiceEndpoints []string `json:"service_endpoints" validate:"required"` + + // The target for this endpoint gateway. + Target EndpointGatewayTargetIntf `json:"target" validate:"required"` + + // The VPC this endpoint gateway is serving. + VPC *VPCReference `json:"vpc" validate:"required"` +} + +// Constants associated with the EndpointGateway.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. const ( - IkePolicyEncryptionAlgorithmAes128Const = "aes128" - IkePolicyEncryptionAlgorithmAes256Const = "aes256" - IkePolicyEncryptionAlgorithmTripleDesConst = "triple_des" + EndpointGatewayHealthStateDegradedConst = "degraded" + EndpointGatewayHealthStateFaultedConst = "faulted" + EndpointGatewayHealthStateInapplicableConst = "inapplicable" + EndpointGatewayHealthStateOkConst = "ok" ) -// Constants associated with the IkePolicy.NegotiationMode property. -// The IKE negotiation mode. Only `main` is supported. +// Constants associated with the EndpointGateway.LifecycleState property. +// The lifecycle state of the endpoint gateway. const ( - IkePolicyNegotiationModeMainConst = "main" + EndpointGatewayLifecycleStateDeletingConst = "deleting" + EndpointGatewayLifecycleStateFailedConst = "failed" + EndpointGatewayLifecycleStatePendingConst = "pending" + EndpointGatewayLifecycleStateStableConst = "stable" + EndpointGatewayLifecycleStateSuspendedConst = "suspended" + EndpointGatewayLifecycleStateUpdatingConst = "updating" + EndpointGatewayLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the IkePolicy.ResourceType property. +// Constants associated with the EndpointGateway.ResourceType property. // The resource type. const ( - IkePolicyResourceTypeIkePolicyConst = "ike_policy" + EndpointGatewayResourceTypeEndpointGatewayConst = "endpoint_gateway" ) -// UnmarshalIkePolicy unmarshals an instance of IkePolicy from the specified map of raw messages. -func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicy) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) +// UnmarshalEndpointGateway unmarshals an instance of EndpointGateway from the specified map of raw messages. +func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGateway) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIPReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "negotiation_mode", &obj.NegotiationMode) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "service_endpoints", &obj.ServiceEndpoints) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayTarget) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -28367,33 +29171,33 @@ func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err e return } -// IkePolicyCollection : IkePolicyCollection struct -type IkePolicyCollection struct { - // A link to the first page of resources. - First *IkePolicyCollectionFirst `json:"first" validate:"required"` +// EndpointGatewayCollection : EndpointGatewayCollection struct +type EndpointGatewayCollection struct { + // Collection of endpoint gateways. + EndpointGateways []EndpointGateway `json:"endpoint_gateways" validate:"required"` - // Collection of IKE policies. - IkePolicies []IkePolicy `json:"ike_policies" validate:"required"` + // A link to the first page of resources. + First *EndpointGatewayCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *IkePolicyCollectionNext `json:"next,omitempty"` + Next *EndpointGatewayCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalIkePolicyCollection unmarshals an instance of IkePolicyCollection from the specified map of raw messages. -func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIkePolicyCollectionFirst) +// UnmarshalEndpointGatewayCollection unmarshals an instance of EndpointGatewayCollection from the specified map of raw messages. +func UnmarshalEndpointGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayCollection) + err = core.UnmarshalModel(m, "endpoint_gateways", &obj.EndpointGateways, UnmarshalEndpointGateway) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policies", &obj.IkePolicies, UnmarshalIkePolicy) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalEndpointGatewayCollectionFirst) if err != nil { return } @@ -28401,7 +29205,7 @@ func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIkePolicyCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalEndpointGatewayCollectionNext) if err != nil { return } @@ -28414,7 +29218,7 @@ func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface } // Retrieve the value to be passed to a request to access the next page of results -func (resp *IkePolicyCollection) GetNextStart() (*string, error) { +func (resp *EndpointGatewayCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -28425,67 +29229,50 @@ func (resp *IkePolicyCollection) GetNextStart() (*string, error) { return start, nil } -// IkePolicyPatch : IkePolicyPatch struct -type IkePolicyPatch struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - - // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group,omitempty"` - - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version,omitempty"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` - - // The user-defined name for this IKE policy. - Name *string `json:"name,omitempty"` +// EndpointGatewayCollectionFirst : A link to the first page of resources. +type EndpointGatewayCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// Constants associated with the IkePolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - IkePolicyPatchAuthenticationAlgorithmMd5Const = "md5" - IkePolicyPatchAuthenticationAlgorithmSha1Const = "sha1" - IkePolicyPatchAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyPatchAuthenticationAlgorithmSha512Const = "sha512" -) - -// Constants associated with the IkePolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - IkePolicyPatchEncryptionAlgorithmAes128Const = "aes128" - IkePolicyPatchEncryptionAlgorithmAes256Const = "aes256" - IkePolicyPatchEncryptionAlgorithmTripleDesConst = "triple_des" -) - -// UnmarshalIkePolicyPatch unmarshals an instance of IkePolicyPatch from the specified map of raw messages. -func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyPatch) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) +// UnmarshalEndpointGatewayCollectionFirst unmarshals an instance of EndpointGatewayCollectionFirst from the specified map of raw messages. +func UnmarshalEndpointGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type EndpointGatewayCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalEndpointGatewayCollectionNext unmarshals an instance of EndpointGatewayCollectionNext from the specified map of raw messages. +func UnmarshalEndpointGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayPatch : EndpointGatewayPatch struct +type EndpointGatewayPatch struct { + // The user-defined name for this endpoint gateway. Names must be unique within the VPC this endpoint gateway is + // serving. + Name *string `json:"name,omitempty"` +} + +// UnmarshalEndpointGatewayPatch unmarshals an instance of EndpointGatewayPatch from the specified map of raw messages. +func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -28494,45 +29281,72 @@ func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) ( return } -// AsPatch returns a generic map representation of the IkePolicyPatch -func (ikePolicyPatch *IkePolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the EndpointGatewayPatch +func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(ikePolicyPatch) + jsonData, err = json.Marshal(endpointGatewayPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// IkePolicyReference : IkePolicyReference struct -type IkePolicyReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *IkePolicyReferenceDeleted `json:"deleted,omitempty"` +// EndpointGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type EndpointGatewayReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} - // The IKE policy's canonical URL. - Href *string `json:"href" validate:"required"` +// UnmarshalEndpointGatewayReferenceDeleted unmarshals an instance of EndpointGatewayReferenceDeleted from the specified map of raw messages. +func UnmarshalEndpointGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The unique identifier for this IKE policy. - ID *string `json:"id" validate:"required"` +// EndpointGatewayReservedIP : A reserved IP to bind to the endpoint gateway. This can be specified using an existing reserved IP, or a prototype +// object for a new reserved IP. The reserved IP will be bound to the endpoint gateway to function as a virtual private +// endpoint for the service. +// Models which "extend" this model: +// - EndpointGatewayReservedIPReservedIPIdentity +// - EndpointGatewayReservedIPReservedIPPrototypeTargetContext +type EndpointGatewayReservedIP struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` - // The user-defined name for this IKE policy. - Name *string `json:"name" validate:"required"` + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // The user-defined name for this reserved IP. If unspecified, the name will be a hyphenated list of randomly-selected + // words. Names must be unique within the subnet the reserved IP resides in. Names beginning with `ibm-` are reserved + // for provider-owned resources. + Name *string `json:"name,omitempty"` + + // The subnet in which to create this reserved IP. + Subnet SubnetIdentityIntf `json:"subnet,omitempty"` } -// Constants associated with the IkePolicyReference.ResourceType property. -// The resource type. -const ( - IkePolicyReferenceResourceTypeIkePolicyConst = "ike_policy" -) +func (*EndpointGatewayReservedIP) isaEndpointGatewayReservedIP() bool { + return true +} -// UnmarshalIkePolicyReference unmarshals an instance of IkePolicyReference from the specified map of raw messages. -func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIkePolicyReferenceDeleted) +type EndpointGatewayReservedIPIntf interface { + isaEndpointGatewayReservedIP() bool +} + +// UnmarshalEndpointGatewayReservedIP unmarshals an instance of EndpointGatewayReservedIP from the specified map of raw messages. +func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayReservedIP) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -28540,7 +29354,7 @@ func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{ if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } @@ -28548,7 +29362,7 @@ func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{ if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } @@ -28556,20 +29370,48 @@ func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{ return } -// IP : IP struct -type IP struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` +// EndpointGatewayTarget : The target for this endpoint gateway. +// Models which "extend" this model: +// - EndpointGatewayTargetProviderCloudServiceReference +// - EndpointGatewayTargetProviderInfrastructureServiceReference +type EndpointGatewayTarget struct { + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn,omitempty"` + + // The type of target. + ResourceType *string `json:"resource_type,omitempty"` + + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name,omitempty"` } -// UnmarshalIP unmarshals an instance of IP from the specified map of raw messages. -func UnmarshalIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// Constants associated with the EndpointGatewayTarget.ResourceType property. +// The type of target. +const ( + EndpointGatewayTargetResourceTypeProviderCloudServiceConst = "provider_cloud_service" +) + +func (*EndpointGatewayTarget) isaEndpointGatewayTarget() bool { + return true +} + +type EndpointGatewayTargetIntf interface { + isaEndpointGatewayTarget() bool +} + +// UnmarshalEndpointGatewayTarget unmarshals an instance of EndpointGatewayTarget from the specified map of raw messages. +func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -28577,101 +29419,106 @@ func UnmarshalIP(m map[string]json.RawMessage, result interface{}) (err error) { return } -// IPsecPolicy : IPsecPolicy struct -type IPsecPolicy struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` +// EndpointGatewayTargetPrototype : The target for this endpoint gateway. +// Models which "extend" this model: +// - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity +// - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity +type EndpointGatewayTargetPrototype struct { + // The type of target for this endpoint gateway. + ResourceType *string `json:"resource_type" validate:"required"` - // The VPN gateway connections that use this IPsec policy. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` + // The CRN for this provider cloud service, or the CRN for the user's instance of a provider cloud service. + CRN *string `json:"crn,omitempty"` - // The date and time that this IPsec policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The name of a provider infrastructure service. Must be: + // - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + Name *string `json:"name,omitempty"` +} - // The encapsulation mode used. Only `tunnel` is supported. - EncapsulationMode *string `json:"encapsulation_mode" validate:"required"` +// Constants associated with the EndpointGatewayTargetPrototype.ResourceType property. +// The type of target for this endpoint gateway. +const ( + EndpointGatewayTargetPrototypeResourceTypeProviderCloudServiceConst = "provider_cloud_service" + EndpointGatewayTargetPrototypeResourceTypeProviderInfrastructureServiceConst = "provider_infrastructure_service" +) - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` +func (*EndpointGatewayTargetPrototype) isaEndpointGatewayTargetPrototype() bool { + return true +} - // The IPsec policy's canonical URL. - Href *string `json:"href" validate:"required"` +type EndpointGatewayTargetPrototypeIntf interface { + isaEndpointGatewayTargetPrototype() bool +} - // The unique identifier for this IPsec policy. - ID *string `json:"id" validate:"required"` - - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime" validate:"required"` +// UnmarshalEndpointGatewayTargetPrototype unmarshals an instance of EndpointGatewayTargetPrototype from the specified map of raw messages. +func UnmarshalEndpointGatewayTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "resource_type", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'resource_type': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'resource_type' not found in JSON object") + return + } + if discValue == "provider_cloud_service" { + err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderCloudServiceIdentity) + } else if discValue == "provider_infrastructure_service" { + err = core.UnmarshalModel(m, "", result, UnmarshalEndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'resource_type': %s", discValue) + } + return +} - // The user-defined name for this IPsec policy. - Name *string `json:"name" validate:"required"` +// FloatingIP : FloatingIP struct +type FloatingIP struct { + // The globally unique IP address. + Address *string `json:"address" validate:"required"` - // Perfect Forward Secrecy. - Pfs *string `json:"pfs" validate:"required"` + // The date and time that the floating IP was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The resource group for this IPsec policy. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The CRN for this floating IP. + CRN *string `json:"crn" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The URL for this floating IP. + Href *string `json:"href" validate:"required"` - // The transform protocol used. Only `esp` is supported. - TransformProtocol *string `json:"transform_protocol" validate:"required"` -} + // The unique identifier for this floating IP. + ID *string `json:"id" validate:"required"` -// Constants associated with the IPsecPolicy.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - IPsecPolicyAuthenticationAlgorithmMd5Const = "md5" - IPsecPolicyAuthenticationAlgorithmSha1Const = "sha1" - IPsecPolicyAuthenticationAlgorithmSha256Const = "sha256" - IPsecPolicyAuthenticationAlgorithmSha512Const = "sha512" -) + // The unique user-defined name for this floating IP. + Name *string `json:"name" validate:"required"` -// Constants associated with the IPsecPolicy.EncapsulationMode property. -// The encapsulation mode used. Only `tunnel` is supported. -const ( - IPsecPolicyEncapsulationModeTunnelConst = "tunnel" -) + // The resource group for this floating IP. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// Constants associated with the IPsecPolicy.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - IPsecPolicyEncryptionAlgorithmAes128Const = "aes128" - IPsecPolicyEncryptionAlgorithmAes256Const = "aes256" - IPsecPolicyEncryptionAlgorithmTripleDesConst = "triple_des" -) + // The status of the floating IP. + Status *string `json:"status" validate:"required"` -// Constants associated with the IPsecPolicy.Pfs property. -// Perfect Forward Secrecy. -const ( - IPsecPolicyPfsDisabledConst = "disabled" - IPsecPolicyPfsGroup14Const = "group_14" - IPsecPolicyPfsGroup19Const = "group_19" - IPsecPolicyPfsGroup2Const = "group_2" - IPsecPolicyPfsGroup5Const = "group_5" -) + // The target of this floating IP. + Target FloatingIPTargetIntf `json:"target,omitempty"` -// Constants associated with the IPsecPolicy.ResourceType property. -// The resource type. -const ( - IPsecPolicyResourceTypeIpsecPolicyConst = "ipsec_policy" -) + // The zone this floating IP resides in. + Zone *ZoneReference `json:"zone" validate:"required"` +} -// Constants associated with the IPsecPolicy.TransformProtocol property. -// The transform protocol used. Only `esp` is supported. +// Constants associated with the FloatingIP.Status property. +// The status of the floating IP. const ( - IPsecPolicyTransformProtocolEspConst = "esp" + FloatingIPStatusAvailableConst = "available" + FloatingIPStatusDeletingConst = "deleting" + FloatingIPStatusFailedConst = "failed" + FloatingIPStatusPendingConst = "pending" ) -// UnmarshalIPsecPolicy unmarshals an instance of IPsecPolicy from the specified map of raw messages. -func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicy) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) +// UnmarshalFloatingIP unmarshals an instance of FloatingIP from the specified map of raw messages. +func UnmarshalFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -28679,43 +29526,70 @@ func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalPrimitive(m, "encapsulation_mode", &obj.EncapsulationMode) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTarget) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// FloatingIPByTargetNetworkInterfaceIdentity : The network interface this floating IP is to be bound to. +// Models which "extend" this model: +// - FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByID +// - FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref +type FloatingIPByTargetNetworkInterfaceIdentity struct { + // The unique identifier for this network interface. + ID *string `json:"id,omitempty"` + + // The URL for this network interface. + Href *string `json:"href,omitempty"` +} + +func (*FloatingIPByTargetNetworkInterfaceIdentity) isaFloatingIPByTargetNetworkInterfaceIdentity() bool { + return true +} + +type FloatingIPByTargetNetworkInterfaceIdentityIntf interface { + isaFloatingIPByTargetNetworkInterfaceIdentity() bool +} + +// UnmarshalFloatingIPByTargetNetworkInterfaceIdentity unmarshals an instance of FloatingIPByTargetNetworkInterfaceIdentity from the specified map of raw messages. +func UnmarshalFloatingIPByTargetNetworkInterfaceIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPByTargetNetworkInterfaceIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "transform_protocol", &obj.TransformProtocol) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -28723,33 +29597,33 @@ func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err return } -// IPsecPolicyCollection : IPsecPolicyCollection struct -type IPsecPolicyCollection struct { +// FloatingIPCollection : FloatingIPCollection struct +type FloatingIPCollection struct { // A link to the first page of resources. - First *IPsecPolicyCollectionFirst `json:"first" validate:"required"` + First *FloatingIPCollectionFirst `json:"first" validate:"required"` - // Collection of IPsec policies. - IpsecPolicies []IPsecPolicy `json:"ipsec_policies" validate:"required"` + // Collection of floating IPs. + FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *IPsecPolicyCollectionNext `json:"next,omitempty"` + Next *FloatingIPCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalIPsecPolicyCollection unmarshals an instance of IPsecPolicyCollection from the specified map of raw messages. -func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIPsecPolicyCollectionFirst) +// UnmarshalFloatingIPCollection unmarshals an instance of FloatingIPCollection from the specified map of raw messages. +func UnmarshalFloatingIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFloatingIPCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policies", &obj.IpsecPolicies, UnmarshalIPsecPolicy) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) if err != nil { return } @@ -28757,7 +29631,7 @@ func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interfa if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIPsecPolicyCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFloatingIPCollectionNext) if err != nil { return } @@ -28770,7 +29644,7 @@ func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interfa } // Retrieve the value to be passed to a request to access the next page of results -func (resp *IPsecPolicyCollection) GetNextStart() (*string, error) { +func (resp *FloatingIPCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -28781,15 +29655,15 @@ func (resp *IPsecPolicyCollection) GetNextStart() (*string, error) { return start, nil } -// IPsecPolicyCollectionFirst : A link to the first page of resources. -type IPsecPolicyCollectionFirst struct { +// FloatingIPCollectionFirst : A link to the first page of resources. +type FloatingIPCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalIPsecPolicyCollectionFirst unmarshals an instance of IPsecPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalIPsecPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollectionFirst) +// UnmarshalFloatingIPCollectionFirst unmarshals an instance of FloatingIPCollectionFirst from the specified map of raw messages. +func UnmarshalFloatingIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -28798,15 +29672,15 @@ func UnmarshalIPsecPolicyCollectionFirst(m map[string]json.RawMessage, result in return } -// IPsecPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type IPsecPolicyCollectionNext struct { +// FloatingIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type FloatingIPCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalIPsecPolicyCollectionNext unmarshals an instance of IPsecPolicyCollectionNext from the specified map of raw messages. -func UnmarshalIPsecPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyCollectionNext) +// UnmarshalFloatingIPCollectionNext unmarshals an instance of FloatingIPCollectionNext from the specified map of raw messages. +func UnmarshalFloatingIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -28815,71 +29689,86 @@ func UnmarshalIPsecPolicyCollectionNext(m map[string]json.RawMessage, result int return } -// IPsecPolicyPatch : IPsecPolicyPatch struct -type IPsecPolicyPatch struct { - // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` +// FloatingIPPatch : FloatingIPPatch struct +type FloatingIPPatch struct { + // The unique user-defined name for this floating IP. + Name *string `json:"name,omitempty"` - // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` + // The network interface to bind the floating IP to, replacing any existing binding. For + // this request to succeed, the floating IP must not be required by another resource, such + // as a public gateway. + Target FloatingIPTargetPatchIntf `json:"target,omitempty"` +} - // The key lifetime in seconds. - KeyLifetime *int64 `json:"key_lifetime,omitempty"` +// UnmarshalFloatingIPPatch unmarshals an instance of FloatingIPPatch from the specified map of raw messages. +func UnmarshalFloatingIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPTargetPatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The user-defined name for this IPsec policy. +// AsPatch returns a generic map representation of the FloatingIPPatch +func (floatingIPPatch *FloatingIPPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(floatingIPPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// FloatingIPPrototype : FloatingIPPrototype struct +// Models which "extend" this model: +// - FloatingIPPrototypeFloatingIPByZone +// - FloatingIPPrototypeFloatingIPByTarget +type FloatingIPPrototype struct { + // The unique user-defined name for this floating IP. If unspecified, the name will be a hyphenated list of + // randomly-selected words. Name *string `json:"name,omitempty"` - // Perfect Forward Secrecy. - Pfs *string `json:"pfs,omitempty"` -} + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm. -const ( - IPsecPolicyPatchAuthenticationAlgorithmMd5Const = "md5" - IPsecPolicyPatchAuthenticationAlgorithmSha1Const = "sha1" - IPsecPolicyPatchAuthenticationAlgorithmSha256Const = "sha256" - IPsecPolicyPatchAuthenticationAlgorithmSha512Const = "sha512" -) + // The zone this floating IP will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` -// Constants associated with the IPsecPolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm. -const ( - IPsecPolicyPatchEncryptionAlgorithmAes128Const = "aes128" - IPsecPolicyPatchEncryptionAlgorithmAes256Const = "aes256" - IPsecPolicyPatchEncryptionAlgorithmTripleDesConst = "triple_des" -) + // The network interface this floating IP is to be bound to. + Target FloatingIPByTargetNetworkInterfaceIdentityIntf `json:"target,omitempty"` +} -// Constants associated with the IPsecPolicyPatch.Pfs property. -// Perfect Forward Secrecy. -const ( - IPsecPolicyPatchPfsDisabledConst = "disabled" - IPsecPolicyPatchPfsGroup14Const = "group_14" - IPsecPolicyPatchPfsGroup19Const = "group_19" - IPsecPolicyPatchPfsGroup2Const = "group_2" - IPsecPolicyPatchPfsGroup5Const = "group_5" -) +func (*FloatingIPPrototype) isaFloatingIPPrototype() bool { + return true +} -// UnmarshalIPsecPolicyPatch unmarshals an instance of IPsecPolicyPatch from the specified map of raw messages. -func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyPatch) - err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) +type FloatingIPPrototypeIntf interface { + isaFloatingIPPrototype() bool +} + +// UnmarshalFloatingIPPrototype unmarshals an instance of FloatingIPPrototype from the specified map of raw messages. +func UnmarshalFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFloatingIPByTargetNetworkInterfaceIdentity) if err != nil { return } @@ -28887,61 +29776,52 @@ func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) return } -// AsPatch returns a generic map representation of the IPsecPolicyPatch -func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(iPsecPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// FloatingIPReference : FloatingIPReference struct +type FloatingIPReference struct { + // The globally unique IP address. + Address *string `json:"address" validate:"required"` + + // The CRN for this floating IP. + CRN *string `json:"crn" validate:"required"` -// IPsecPolicyReference : IPsecPolicyReference struct -type IPsecPolicyReference struct { // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *IPsecPolicyReferenceDeleted `json:"deleted,omitempty"` + Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` - // The IPsec policy's canonical URL. + // The URL for this floating IP. Href *string `json:"href" validate:"required"` - // The unique identifier for this IPsec policy. + // The unique identifier for this floating IP. ID *string `json:"id" validate:"required"` - // The user-defined name for this IPsec policy. + // The unique user-defined name for this floating IP. Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the IPsecPolicyReference.ResourceType property. -// The resource type. -const ( - IPsecPolicyReferenceResourceTypeIpsecPolicyConst = "ipsec_policy" -) - -// UnmarshalIPsecPolicyReference unmarshals an instance of IPsecPolicyReference from the specified map of raw messages. -func UnmarshalIPsecPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIPsecPolicyReferenceDeleted) +// UnmarshalFloatingIPReference unmarshals an instance of FloatingIPReference from the specified map of raw messages. +func UnmarshalFloatingIPReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPReference) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -28949,16 +29829,16 @@ func UnmarshalIPsecPolicyReference(m map[string]json.RawMessage, result interfac return } -// IPsecPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// FloatingIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type IPsecPolicyReferenceDeleted struct { +type FloatingIPReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalIPsecPolicyReferenceDeleted unmarshals an instance of IPsecPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalIPsecPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IPsecPolicyReferenceDeleted) +// UnmarshalFloatingIPReferenceDeleted unmarshals an instance of FloatingIPReferenceDeleted from the specified map of raw messages. +func UnmarshalFloatingIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -28967,32 +29847,113 @@ func UnmarshalIPsecPolicyReferenceDeleted(m map[string]json.RawMessage, result i return } -// IkePolicyCollectionFirst : A link to the first page of resources. -type IkePolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// FloatingIPTarget : The target of this floating IP. +// Models which "extend" this model: +// - FloatingIPTargetNetworkInterfaceReference +// - FloatingIPTargetPublicGatewayReference +type FloatingIPTarget struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this network interface. + Href *string `json:"href,omitempty"` + + // The unique identifier for this network interface. + ID *string `json:"id,omitempty"` + + // The user-defined name for this network interface. + Name *string `json:"name,omitempty"` + + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` + + // The CRN for this public gateway. + CRN *string `json:"crn,omitempty"` } -// UnmarshalIkePolicyCollectionFirst unmarshals an instance of IkePolicyCollectionFirst from the specified map of raw messages. -func UnmarshalIkePolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollectionFirst) +// Constants associated with the FloatingIPTarget.ResourceType property. +// The resource type. +const ( + FloatingIPTargetResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*FloatingIPTarget) isaFloatingIPTarget() bool { + return true +} + +type FloatingIPTargetIntf interface { + isaFloatingIPTarget() bool +} + +// UnmarshalFloatingIPTarget unmarshals an instance of FloatingIPTarget from the specified map of raw messages. +func UnmarshalFloatingIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// IkePolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type IkePolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// FloatingIPTargetPatch : The network interface to bind the floating IP to, replacing any existing binding. For this request to succeed, the +// floating IP must not be required by another resource, such as a public gateway. +// Models which "extend" this model: +// - FloatingIPTargetPatchNetworkInterfaceIdentityByID +// - FloatingIPTargetPatchNetworkInterfaceIdentityByHref +type FloatingIPTargetPatch struct { + // The unique identifier for this network interface. + ID *string `json:"id,omitempty"` + + // The URL for this network interface. + Href *string `json:"href,omitempty"` } -// UnmarshalIkePolicyCollectionNext unmarshals an instance of IkePolicyCollectionNext from the specified map of raw messages. -func UnmarshalIkePolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyCollectionNext) +func (*FloatingIPTargetPatch) isaFloatingIPTargetPatch() bool { + return true +} + +type FloatingIPTargetPatchIntf interface { + isaFloatingIPTargetPatch() bool +} + +// UnmarshalFloatingIPTargetPatch unmarshals an instance of FloatingIPTargetPatch from the specified map of raw messages. +func UnmarshalFloatingIPTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -29001,17 +29962,16 @@ func UnmarshalIkePolicyCollectionNext(m map[string]json.RawMessage, result inter return } -// IkePolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type IkePolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// FloatingIPUnpaginatedCollection : FloatingIPUnpaginatedCollection struct +type FloatingIPUnpaginatedCollection struct { + // Collection of floating IPs. + FloatingIps []FloatingIP `json:"floating_ips" validate:"required"` } -// UnmarshalIkePolicyReferenceDeleted unmarshals an instance of IkePolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalIkePolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IkePolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalFloatingIPUnpaginatedCollection unmarshals an instance of FloatingIPUnpaginatedCollection from the specified map of raw messages. +func UnmarshalFloatingIPUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FloatingIPUnpaginatedCollection) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIP) if err != nil { return } @@ -29019,138 +29979,76 @@ func UnmarshalIkePolicyReferenceDeleted(m map[string]json.RawMessage, result int return } -// Image : Image struct -type Image struct { - // The date and time that the image was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` +// FlowLogCollector : FlowLogCollector struct +type FlowLogCollector struct { + // Indicates whether this collector is active. + Active *bool `json:"active" validate:"required"` - // The type of encryption used on the image. - Encryption *string `json:"encryption" validate:"required"` + // Indicates whether this flow log collector will be automatically deleted when `target` is deleted. At present, this + // is always `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // The key that will be used to encrypt volumes created from this image (unless an - // alternate `encryption_key` is specified at volume creation). - // - // This property will be present for images with an `encryption` type of `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` + // The date and time that the flow log collector was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Details for the stored image file. - File *ImageFile `json:"file" validate:"required"` + // The CRN for this flow log collector. + CRN *string `json:"crn" validate:"required"` - // The URL for this image. + // The URL for this flow log collector. Href *string `json:"href" validate:"required"` - // The unique identifier for this image. + // The unique identifier for this flow log collector. ID *string `json:"id" validate:"required"` - // The minimum size (in gigabytes) of a volume onto which this image may be provisioned. - // - // This property may be absent if the image has a `status` of `pending`, `tentative`, or - // `failed`. - MinimumProvisionedSize *int64 `json:"minimum_provisioned_size,omitempty"` + // The lifecycle state of the flow log collector. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The user-defined or system-provided name for this image. + // The unique user-defined name for this flow log collector. Name *string `json:"name" validate:"required"` - // The operating system included in this image. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` - - // The resource group for this image. + // The resource group for this flow log collector. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The volume used to create this image (this may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - // If absent, this image was not created from a volume. - SourceVolume *VolumeReference `json:"source_volume,omitempty"` - - // The status of this image - // - available: image can be used (provisionable) - // - deleting: image is being deleted, and can no longer be used to provision new - // resources - // - deprecated: image can be used, but is slated to become `obsolete` (provisionable) - // - failed: image is corrupt or did not pass validation - // - obsolete: image can no longer be used to provision new resources - // - pending: image is being imported and is not yet `available` - // - tentative: image import has timed out (contact support) - // - unusable: image cannot be used (see `status_reasons[]` for possible remediation) - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the - // unexpected property value was encountered. - Status *string `json:"status" validate:"required"` + // The Cloud Object Storage bucket where the collected flows are logged. + StorageBucket *CloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []ImageStatusReason `json:"status_reasons" validate:"required"` + // The target this collector is collecting flow logs for. If the target is an instance, + // subnet, or VPC, flow logs will not be collected for any network interfaces within the + // target that are themselves the target of a more specific flow log collector. + Target FlowLogCollectorTargetIntf `json:"target" validate:"required"` - // Whether the image is publicly visible or private to the account. - Visibility *string `json:"visibility" validate:"required"` + // The VPC this flow log collector is associated with. + VPC *VPCReference `json:"vpc" validate:"required"` } -// Constants associated with the Image.Encryption property. -// The type of encryption used on the image. -const ( - ImageEncryptionNoneConst = "none" - ImageEncryptionUserManagedConst = "user_managed" -) - -// Constants associated with the Image.Status property. -// The status of this image -// - available: image can be used (provisionable) -// - deleting: image is being deleted, and can no longer be used to provision new -// resources -// - deprecated: image can be used, but is slated to become `obsolete` (provisionable) -// - failed: image is corrupt or did not pass validation -// - obsolete: image can no longer be used to provision new resources -// - pending: image is being imported and is not yet `available` -// - tentative: image import has timed out (contact support) -// - unusable: image cannot be used (see `status_reasons[]` for possible remediation) -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the -// unexpected property value was encountered. -const ( - ImageStatusAvailableConst = "available" - ImageStatusDeletingConst = "deleting" - ImageStatusDeprecatedConst = "deprecated" - ImageStatusFailedConst = "failed" - ImageStatusPendingConst = "pending" - ImageStatusTentativeConst = "tentative" - ImageStatusUnusableConst = "unusable" -) - -// Constants associated with the Image.Visibility property. -// Whether the image is publicly visible or private to the account. +// Constants associated with the FlowLogCollector.LifecycleState property. +// The lifecycle state of the flow log collector. const ( - ImageVisibilityPrivateConst = "private" - ImageVisibilityPublicConst = "public" + FlowLogCollectorLifecycleStateDeletingConst = "deleting" + FlowLogCollectorLifecycleStateFailedConst = "failed" + FlowLogCollectorLifecycleStatePendingConst = "pending" + FlowLogCollectorLifecycleStateStableConst = "stable" + FlowLogCollectorLifecycleStateSuspendedConst = "suspended" + FlowLogCollectorLifecycleStateUpdatingConst = "updating" + FlowLogCollectorLifecycleStateWaitingConst = "waiting" ) -// UnmarshalImage unmarshals an instance of Image from the specified map of raw messages. -func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Image) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalFlowLogCollector unmarshals an instance of FlowLogCollector from the specified map of raw messages. +func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollector) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFile) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -29162,7 +30060,7 @@ func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error if err != nil { return } - err = core.UnmarshalPrimitive(m, "minimum_provisioned_size", &obj.MinimumProvisionedSize) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } @@ -29170,27 +30068,19 @@ func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error if err != nil { return } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalCloudObjectStorageBucketReference) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageStatusReason) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalFlowLogCollectorTarget) if err != nil { return } - err = core.UnmarshalPrimitive(m, "visibility", &obj.Visibility) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -29198,30 +30088,33 @@ func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error return } -// ImageCollection : ImageCollection struct -type ImageCollection struct { +// FlowLogCollectorCollection : FlowLogCollectorCollection struct +type FlowLogCollectorCollection struct { // A link to the first page of resources. - First *ImageCollectionFirst `json:"first" validate:"required"` + First *FlowLogCollectorCollectionFirst `json:"first" validate:"required"` - // Collection of images. - Images []Image `json:"images" validate:"required"` + // Collection of flow log collectors. + FlowLogCollectors []FlowLogCollector `json:"flow_log_collectors" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *ImageCollectionNext `json:"next,omitempty"` + Next *FlowLogCollectorCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalImageCollection unmarshals an instance of ImageCollection from the specified map of raw messages. -func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalImageCollectionFirst) +// UnmarshalFlowLogCollectorCollection unmarshals an instance of FlowLogCollectorCollection from the specified map of raw messages. +func UnmarshalFlowLogCollectorCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFlowLogCollectorCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "images", &obj.Images, UnmarshalImage) + err = core.UnmarshalModel(m, "flow_log_collectors", &obj.FlowLogCollectors, UnmarshalFlowLogCollector) if err != nil { return } @@ -29229,7 +30122,11 @@ func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalImageCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalFlowLogCollectorCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -29238,7 +30135,7 @@ func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) } // Retrieve the value to be passed to a request to access the next page of results -func (resp *ImageCollection) GetNextStart() (*string, error) { +func (resp *FlowLogCollectorCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -29249,15 +30146,15 @@ func (resp *ImageCollection) GetNextStart() (*string, error) { return start, nil } -// ImageCollectionFirst : A link to the first page of resources. -type ImageCollectionFirst struct { +// FlowLogCollectorCollectionFirst : A link to the first page of resources. +type FlowLogCollectorCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalImageCollectionFirst unmarshals an instance of ImageCollectionFirst from the specified map of raw messages. -func UnmarshalImageCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollectionFirst) +// UnmarshalFlowLogCollectorCollectionFirst unmarshals an instance of FlowLogCollectorCollectionFirst from the specified map of raw messages. +func UnmarshalFlowLogCollectorCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -29266,88 +30163,15 @@ func UnmarshalImageCollectionFirst(m map[string]json.RawMessage, result interfac return } -// ImageCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ImageCollectionNext struct { +// FlowLogCollectorCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type FlowLogCollectorCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalImageCollectionNext unmarshals an instance of ImageCollectionNext from the specified map of raw messages. -func UnmarshalImageCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageFile : ImageFile struct -type ImageFile struct { - // Checksums for this image file. - // - // This property may be absent if the associated image has a `status` of `pending` or - // `failed`. - Checksums *ImageFileChecksums `json:"checksums,omitempty"` - - // The size of the stored image file rounded up to the next gigabyte. - // - // This property may be absent if the associated image has a `status` of `pending` or - // `failed`. - Size *int64 `json:"size,omitempty"` -} - -// UnmarshalImageFile unmarshals an instance of ImageFile from the specified map of raw messages. -func UnmarshalImageFile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFile) - err = core.UnmarshalModel(m, "checksums", &obj.Checksums, UnmarshalImageFileChecksums) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageFileChecksums : ImageFileChecksums struct -type ImageFileChecksums struct { - // The SHA256 fingerprint of the image file. - Sha256 *string `json:"sha256,omitempty"` -} - -// UnmarshalImageFileChecksums unmarshals an instance of ImageFileChecksums from the specified map of raw messages. -func UnmarshalImageFileChecksums(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFileChecksums) - err = core.UnmarshalPrimitive(m, "sha256", &obj.Sha256) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImageFilePrototype : ImageFilePrototype struct -type ImageFilePrototype struct { - // The Cloud Object Store (COS) location of the image file. - Href *string `json:"href" validate:"required"` -} - -// NewImageFilePrototype : Instantiate ImageFilePrototype (Generic Model Constructor) -func (*VpcV1) NewImageFilePrototype(href string) (_model *ImageFilePrototype, err error) { - _model = &ImageFilePrototype{ - Href: core.StringPtr(href), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalImageFilePrototype unmarshals an instance of ImageFilePrototype from the specified map of raw messages. -func UnmarshalImageFilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageFilePrototype) +// UnmarshalFlowLogCollectorCollectionNext unmarshals an instance of FlowLogCollectorCollectionNext from the specified map of raw messages. +func UnmarshalFlowLogCollectorCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -29356,58 +30180,23 @@ func UnmarshalImageFilePrototype(m map[string]json.RawMessage, result interface{ return } -// ImageIdentity : Identifies an image by a unique property. -// Models which "extend" this model: -// - ImageIdentityByID -// - ImageIdentityByCRN -// - ImageIdentityByHref -type ImageIdentity struct { - // The unique identifier for this image. - ID *string `json:"id,omitempty"` - - // The CRN for this image. - CRN *string `json:"crn,omitempty"` - - // The URL for this image. - Href *string `json:"href,omitempty"` -} - -func (*ImageIdentity) isaImageIdentity() bool { - return true -} +// FlowLogCollectorPatch : FlowLogCollectorPatch struct +type FlowLogCollectorPatch struct { + // Indicates whether this collector is active. Updating to false deactivates the collector and updating to true + // activates the collector. + Active *bool `json:"active,omitempty"` -type ImageIdentityIntf interface { - isaImageIdentity() bool + // The unique user-defined name for this flow log collector. + Name *string `json:"name,omitempty"` } -// UnmarshalImageIdentity unmarshals an instance of ImageIdentity from the specified map of raw messages. -func UnmarshalImageIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalFlowLogCollectorPatch unmarshals an instance of FlowLogCollectorPatch from the specified map of raw messages. +func UnmarshalFlowLogCollectorPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorPatch) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ImagePatch : ImagePatch struct -type ImagePatch struct { - // The unique user-defined name for this image. Names starting with `ibm-` are not allowed. - Name *string `json:"name,omitempty"` -} - -// UnmarshalImagePatch unmarshals an instance of ImagePatch from the specified map of raw messages. -func UnmarshalImagePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -29416,99 +30205,83 @@ func UnmarshalImagePatch(m map[string]json.RawMessage, result interface{}) (err return } -// AsPatch returns a generic map representation of the ImagePatch -func (imagePatch *ImagePatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the FlowLogCollectorPatch +func (flowLogCollectorPatch *FlowLogCollectorPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(imagePatch) + jsonData, err = json.Marshal(flowLogCollectorPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// ImagePrototype : ImagePrototype struct +// FlowLogCollectorTarget : The target this collector is collecting flow logs for. If the target is an instance, subnet, or VPC, flow logs will +// not be collected for any network interfaces within the target that are themselves the target of a more specific flow +// log collector. // Models which "extend" this model: -// - ImagePrototypeImageByFile -// - ImagePrototypeImageBySourceVolume -type ImagePrototype struct { - // The unique user-defined name for this image. Names starting with `ibm-` are not allowed. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext +// - FlowLogCollectorTargetInstanceReference +// - FlowLogCollectorTargetSubnetReference +// - FlowLogCollectorTargetVPCReference +type FlowLogCollectorTarget struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. - // - // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be - // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the - // [Hyper Protect Crypto Service](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` + // The URL for this network interface. + Href *string `json:"href,omitempty"` - // The root key that was used to wrap the data key (which is ultimately represented as - // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes - // created from this image (unless an alternate `encryption_key` is specified at volume - // creation). - // - // If unspecified, the imported image is treated as unencrypted. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // The unique identifier for this network interface. + ID *string `json:"id,omitempty"` - // The file from which to create the image. - File *ImageFilePrototype `json:"file,omitempty"` + // The user-defined name for this network interface. + Name *string `json:"name,omitempty"` - // The [supported operating - // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this - // image. - OperatingSystem OperatingSystemIdentityIntf `json:"operating_system,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` - // The volume from which to create the image. The specified volume must: - // - Originate from an image, which will be used to populate this image's - // operating system information. - // - Not be `active` or `busy`. - // - // During image creation, the specified volume may briefly become `busy`. - SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` } -func (*ImagePrototype) isaImagePrototype() bool { +// Constants associated with the FlowLogCollectorTarget.ResourceType property. +// The resource type. +const ( + FlowLogCollectorTargetResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*FlowLogCollectorTarget) isaFlowLogCollectorTarget() bool { return true } -type ImagePrototypeIntf interface { - isaImagePrototype() bool +type FlowLogCollectorTargetIntf interface { + isaFlowLogCollectorTarget() bool } -// UnmarshalImagePrototype unmarshals an instance of ImagePrototype from the specified map of raw messages. -func UnmarshalImagePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImagePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) +// UnmarshalFlowLogCollectorTarget unmarshals an instance of FlowLogCollectorTarget from the specified map of raw messages. +func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -29516,33 +30289,37 @@ func UnmarshalImagePrototype(m map[string]json.RawMessage, result interface{}) ( return } -// ImageReference : ImageReference struct -type ImageReference struct { - // The CRN for this image. - CRN *string `json:"crn" validate:"required"` +// FlowLogCollectorTargetPrototype : The target this collector will collect flow logs for. If the target is an instance, subnet, or VPC, flow logs will +// not be collected for any network interfaces within the target that are themselves the target of a more specific flow +// log collector. +// Models which "extend" this model: +// - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity +// - FlowLogCollectorTargetPrototypeInstanceIdentity +// - FlowLogCollectorTargetPrototypeSubnetIdentity +// - FlowLogCollectorTargetPrototypeVPCIdentity +type FlowLogCollectorTargetPrototype struct { + // The unique identifier for this network interface. + ID *string `json:"id,omitempty"` - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *ImageReferenceDeleted `json:"deleted,omitempty"` + // The URL for this network interface. + Href *string `json:"href,omitempty"` - // The URL for this image. - Href *string `json:"href" validate:"required"` + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` +} - // The unique identifier for this image. - ID *string `json:"id" validate:"required"` +func (*FlowLogCollectorTargetPrototype) isaFlowLogCollectorTargetPrototype() bool { + return true +} - // The user-defined or system-provided name for this image. - Name *string `json:"name" validate:"required"` +type FlowLogCollectorTargetPrototypeIntf interface { + isaFlowLogCollectorTargetPrototype() bool } -// UnmarshalImageReference unmarshals an instance of ImageReference from the specified map of raw messages. -func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalImageReferenceDeleted) +// UnmarshalFlowLogCollectorTargetPrototype unmarshals an instance of FlowLogCollectorTargetPrototype from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -29550,11 +30327,7 @@ func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -29562,3350 +30335,2413 @@ func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) ( return } -// ImageReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type ImageReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// GetBareMetalServerDiskOptions : The GetBareMetalServerDisk options. +type GetBareMetalServerDiskOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server disk identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalImageReferenceDeleted unmarshals an instance of ImageReferenceDeleted from the specified map of raw messages. -func UnmarshalImageReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewGetBareMetalServerDiskOptions : Instantiate GetBareMetalServerDiskOptions +func (*VpcV1) NewGetBareMetalServerDiskOptions(bareMetalServerID string, id string) *GetBareMetalServerDiskOptions { + return &GetBareMetalServerDiskOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ImageStatusReason : ImageStatusReason struct -type ImageStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerDiskOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetBareMetalServerDiskOptions) SetID(id string) *GetBareMetalServerDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetBareMetalServerDiskOptions) SetHeaders(param map[string]string) *GetBareMetalServerDiskOptions { + options.Headers = param + return options } -// Constants associated with the ImageStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - ImageStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - ImageStatusReasonCodeEncryptionKeyDisabledConst = "encryption_key_disabled" - ImageStatusReasonCodeImageRequestInProgressConst = "image_request_in_progress" - ImageStatusReasonCodeImageRequestQueuedConst = "image_request_queued" -) +// GetBareMetalServerInitializationOptions : The GetBareMetalServerInitialization options. +type GetBareMetalServerInitializationOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalImageStatusReason unmarshals an instance of ImageStatusReason from the specified map of raw messages. -func UnmarshalImageStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ImageStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// Instance : Instance struct -type Instance struct { - // The total bandwidth (in megabits per second) shared across the virtual server instance's network interfaces and - // storage volumes. - Bandwidth *int64 `json:"bandwidth" validate:"required"` +// NewGetBareMetalServerInitializationOptions : Instantiate GetBareMetalServerInitializationOptions +func (*VpcV1) NewGetBareMetalServerInitializationOptions(id string) *GetBareMetalServerInitializationOptions { + return &GetBareMetalServerInitializationOptions{ + ID: core.StringPtr(id), + } +} - // Boot volume attachment. - BootVolumeAttachment *VolumeAttachmentReferenceInstanceContext `json:"boot_volume_attachment" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetBareMetalServerInitializationOptions) SetID(id string) *GetBareMetalServerInitializationOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The date and time that the virtual server instance was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetBareMetalServerInitializationOptions) SetHeaders(param map[string]string) *GetBareMetalServerInitializationOptions { + options.Headers = param + return options +} - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` +// GetBareMetalServerNetworkInterfaceFloatingIPOptions : The GetBareMetalServerNetworkInterfaceFloatingIP options. +type GetBareMetalServerNetworkInterfaceFloatingIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // If present, the dedicated host this virtual server instance has been placed on. - DedicatedHost *DedicatedHostReference `json:"dedicated_host,omitempty"` + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // The instance disks for this virtual server instance. - Disks []InstanceDisk `json:"disks" validate:"required"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The virtual server instance GPU configuration. - Gpu *InstanceGpu `json:"gpu,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` +// NewGetBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate GetBareMetalServerNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewGetBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + return &GetBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } +} - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} - // The image the virtual server instance was provisioned from. - Image *ImageReference `json:"image,omitempty"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} - // The amount of memory, truncated to whole gibibytes. - Memory *int64 `json:"memory" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The user-defined name for this virtual server instance (and default system hostname). - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} - // The network interfaces for this virtual server instance, including the primary network interface. - NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` +// GetBareMetalServerNetworkInterfaceOptions : The GetBareMetalServerNetworkInterface options. +type GetBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The placement restrictions for the virtual server instance. - PlacementTarget InstancePlacementTargetIntf `json:"placement_target,omitempty"` + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` - // Primary network interface. - PrimaryNetworkInterface *NetworkInterfaceInstanceContextReference `json:"primary_network_interface" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The profile for this virtual server instance. - Profile *InstanceProfileReference `json:"profile" validate:"required"` +// NewGetBareMetalServerNetworkInterfaceOptions : Instantiate GetBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewGetBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string) *GetBareMetalServerNetworkInterfaceOptions { + return &GetBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), + } +} - // The resource group for this instance. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *GetBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *GetBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} - // Indicates whether the state of the virtual server instance permits a start request. - Startable *bool `json:"startable" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetBareMetalServerNetworkInterfaceOptions) SetID(id string) *GetBareMetalServerNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The status of the virtual server instance. - Status *string `json:"status" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetBareMetalServerNetworkInterfaceOptions { + options.Headers = param + return options +} - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []InstanceStatusReason `json:"status_reasons" validate:"required"` +// GetBareMetalServerOptions : The GetBareMetalServer options. +type GetBareMetalServerOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces. - TotalNetworkBandwidth *int64 `json:"total_network_bandwidth" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth" validate:"required"` +// NewGetBareMetalServerOptions : Instantiate GetBareMetalServerOptions +func (*VpcV1) NewGetBareMetalServerOptions(id string) *GetBareMetalServerOptions { + return &GetBareMetalServerOptions{ + ID: core.StringPtr(id), + } +} - // The virtual server instance VCPU configuration. - Vcpu *InstanceVcpu `json:"vcpu" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetBareMetalServerOptions) SetID(id string) *GetBareMetalServerOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The volume attachments for this virtual server instance, including the boot volume attachment. - VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetBareMetalServerOptions) SetHeaders(param map[string]string) *GetBareMetalServerOptions { + options.Headers = param + return options +} - // The VPC this virtual server instance resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// GetBareMetalServerProfileOptions : The GetBareMetalServerProfile options. +type GetBareMetalServerProfileOptions struct { + // The bare metal server profile name. + Name *string `json:"name" validate:"required,ne="` - // The zone this virtual server instance resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the Instance.Status property. -// The status of the virtual server instance. -const ( - InstanceStatusDeletingConst = "deleting" - InstanceStatusFailedConst = "failed" - InstanceStatusPausedConst = "paused" - InstanceStatusPausingConst = "pausing" - InstanceStatusPendingConst = "pending" - InstanceStatusRestartingConst = "restarting" - InstanceStatusResumingConst = "resuming" - InstanceStatusRunningConst = "running" - InstanceStatusStartingConst = "starting" - InstanceStatusStoppedConst = "stopped" - InstanceStatusStoppingConst = "stopping" -) - -// UnmarshalInstance unmarshals an instance of Instance from the specified map of raw messages. -func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Instance) - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentReferenceInstanceContext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dedicated_host", &obj.DedicatedHost, UnmarshalDedicatedHostReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu", &obj.Gpu, UnmarshalInstanceGpu) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceInstanceContextReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTarget) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceInstanceContextReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "startable", &obj.Startable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalInstanceStatusReason) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_network_bandwidth", &obj.TotalNetworkBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceInstanceContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return +// NewGetBareMetalServerProfileOptions : Instantiate GetBareMetalServerProfileOptions +func (*VpcV1) NewGetBareMetalServerProfileOptions(name string) *GetBareMetalServerProfileOptions { + return &GetBareMetalServerProfileOptions{ + Name: core.StringPtr(name), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceAction : InstanceAction struct -type InstanceAction struct { - // The date and time that the action was completed. - CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - - // The date and time that the action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - Force *bool `json:"force,omitempty"` - - // The URL for this instance action. - Href *string `json:"href" validate:"required"` +// SetName : Allow user to set Name +func (_options *GetBareMetalServerProfileOptions) SetName(name string) *GetBareMetalServerProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The identifier for this instance action. - ID *string `json:"id" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetBareMetalServerProfileOptions) SetHeaders(param map[string]string) *GetBareMetalServerProfileOptions { + options.Headers = param + return options +} - // The date and time that the action was started. - StartedAt *strfmt.DateTime `json:"started_at,omitempty"` +// GetDedicatedHostDiskOptions : The GetDedicatedHostDisk options. +type GetDedicatedHostDiskOptions struct { + // The dedicated host identifier. + DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` - // The current status of this action. - Status *string `json:"status" validate:"required"` + // The dedicated host disk identifier. + ID *string `json:"id" validate:"required,ne="` - // The type of action. - Type *string `json:"type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceAction.Status property. -// The current status of this action. -const ( - InstanceActionStatusCompletedConst = "completed" - InstanceActionStatusFailedConst = "failed" - InstanceActionStatusPendingConst = "pending" - InstanceActionStatusRunningConst = "running" -) - -// Constants associated with the InstanceAction.Type property. -// The type of action. -const ( - InstanceActionTypeRebootConst = "reboot" - InstanceActionTypeStartConst = "start" - InstanceActionTypeStopConst = "stop" -) - -// UnmarshalInstanceAction unmarshals an instance of InstanceAction from the specified map of raw messages. -func UnmarshalInstanceAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceAction) - err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return +// NewGetDedicatedHostDiskOptions : Instantiate GetDedicatedHostDiskOptions +func (*VpcV1) NewGetDedicatedHostDiskOptions(dedicatedHostID string, id string) *GetDedicatedHostDiskOptions { + return &GetDedicatedHostDiskOptions{ + DedicatedHostID: core.StringPtr(dedicatedHostID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceCollection : InstanceCollection struct -type InstanceCollection struct { - // A link to the first page of resources. - First *InstanceCollectionFirst `json:"first" validate:"required"` +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *GetDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *GetDedicatedHostDiskOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} - // Collection of virtual server instances. - Instances []Instance `json:"instances" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetDedicatedHostDiskOptions) SetID(id string) *GetDedicatedHostDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetDedicatedHostDiskOptions) SetHeaders(param map[string]string) *GetDedicatedHostDiskOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceCollectionNext `json:"next,omitempty"` +// GetDedicatedHostGroupOptions : The GetDedicatedHostGroup options. +type GetDedicatedHostGroupOptions struct { + // The dedicated host group identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceCollection unmarshals an instance of InstanceCollection from the specified map of raw messages. -func UnmarshalInstanceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstance) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetDedicatedHostGroupOptions : Instantiate GetDedicatedHostGroupOptions +func (*VpcV1) NewGetDedicatedHostGroupOptions(id string) *GetDedicatedHostGroupOptions { + return &GetDedicatedHostGroupOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *GetDedicatedHostGroupOptions) SetID(id string) *GetDedicatedHostGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceCollectionFirst : A link to the first page of resources. -type InstanceCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetDedicatedHostGroupOptions) SetHeaders(param map[string]string) *GetDedicatedHostGroupOptions { + options.Headers = param + return options } -// UnmarshalInstanceCollectionFirst unmarshals an instance of InstanceCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// GetDedicatedHostOptions : The GetDedicatedHost options. +type GetDedicatedHostOptions struct { + // The dedicated host identifier. + ID *string `json:"id" validate:"required,ne="` -// InstanceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceCollectionNext unmarshals an instance of InstanceCollectionNext from the specified map of raw messages. -func UnmarshalInstanceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewGetDedicatedHostOptions : Instantiate GetDedicatedHostOptions +func (*VpcV1) NewGetDedicatedHostOptions(id string) *GetDedicatedHostOptions { + return &GetDedicatedHostOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceConsoleAccessToken : The instance console access token information. -type InstanceConsoleAccessToken struct { - // A URL safe single-use token used to access the console WebSocket. - AccessToken *string `json:"access_token" validate:"required"` - - // The instance console type for which this token may be used. - ConsoleType *string `json:"console_type" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetDedicatedHostOptions) SetID(id string) *GetDedicatedHostOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The date and time that the access token was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetDedicatedHostOptions) SetHeaders(param map[string]string) *GetDedicatedHostOptions { + options.Headers = param + return options +} - // The date and time that the access token will expire. - ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` +// GetDedicatedHostProfileOptions : The GetDedicatedHostProfile options. +type GetDedicatedHostProfileOptions struct { + // The dedicated host profile name. + Name *string `json:"name" validate:"required,ne="` - // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has - // no effect on VNC consoles. - Force *bool `json:"force" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The URL to access this instance console. - Href *string `json:"href" validate:"required"` +// NewGetDedicatedHostProfileOptions : Instantiate GetDedicatedHostProfileOptions +func (*VpcV1) NewGetDedicatedHostProfileOptions(name string) *GetDedicatedHostProfileOptions { + return &GetDedicatedHostProfileOptions{ + Name: core.StringPtr(name), + } } -// Constants associated with the InstanceConsoleAccessToken.ConsoleType property. -// The instance console type for which this token may be used. -const ( - InstanceConsoleAccessTokenConsoleTypeSerialConst = "serial" - InstanceConsoleAccessTokenConsoleTypeVncConst = "vnc" -) +// SetName : Allow user to set Name +func (_options *GetDedicatedHostProfileOptions) SetName(name string) *GetDedicatedHostProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} -// UnmarshalInstanceConsoleAccessToken unmarshals an instance of InstanceConsoleAccessToken from the specified map of raw messages. -func UnmarshalInstanceConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceConsoleAccessToken) - err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "force", &obj.Force) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetDedicatedHostProfileOptions) SetHeaders(param map[string]string) *GetDedicatedHostProfileOptions { + options.Headers = param + return options } -// InstanceDisk : InstanceDisk struct -type InstanceDisk struct { - // The date and time that the disk was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// GetEndpointGatewayIPOptions : The GetEndpointGatewayIP options. +type GetEndpointGatewayIPOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - // The URL for this instance disk. - Href *string `json:"href" validate:"required"` + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this instance disk. - ID *string `json:"id" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The disk interface used for attaching the disk. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - InterfaceType *string `json:"interface_type" validate:"required"` +// NewGetEndpointGatewayIPOptions : Instantiate GetEndpointGatewayIPOptions +func (*VpcV1) NewGetEndpointGatewayIPOptions(endpointGatewayID string, id string) *GetEndpointGatewayIPOptions { + return &GetEndpointGatewayIPOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } +} - // The user-defined name for this disk. - Name *string `json:"name" validate:"required"` +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *GetEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayIPOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetEndpointGatewayIPOptions) SetID(id string) *GetEndpointGatewayIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The size of the disk in GB (gigabytes). - Size *int64 `json:"size" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetEndpointGatewayIPOptions) SetHeaders(param map[string]string) *GetEndpointGatewayIPOptions { + options.Headers = param + return options } -// Constants associated with the InstanceDisk.InterfaceType property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceDiskInterfaceTypeNvmeConst = "nvme" - InstanceDiskInterfaceTypeVirtioBlkConst = "virtio_blk" -) +// GetEndpointGatewayOptions : The GetEndpointGateway options. +type GetEndpointGatewayOptions struct { + // The endpoint gateway identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the InstanceDisk.ResourceType property. -// The resource type. -const ( - InstanceDiskResourceTypeInstanceDiskConst = "instance_disk" -) + // Allows users to set headers on API requests + Headers map[string]string +} -// UnmarshalInstanceDisk unmarshals an instance of InstanceDisk from the specified map of raw messages. -func UnmarshalInstanceDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDisk) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return +// NewGetEndpointGatewayOptions : Instantiate GetEndpointGatewayOptions +func (*VpcV1) NewGetEndpointGatewayOptions(id string) *GetEndpointGatewayOptions { + return &GetEndpointGatewayOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceDiskCollection : InstanceDiskCollection struct -type InstanceDiskCollection struct { - // Collection of the instance's disks. - Disks []InstanceDisk `json:"disks" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetEndpointGatewayOptions) SetID(id string) *GetEndpointGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceDiskCollection unmarshals an instance of InstanceDiskCollection from the specified map of raw messages. -func UnmarshalInstanceDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskCollection) - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *GetEndpointGatewayOptions { + options.Headers = param + return options } -// InstanceDiskPatch : InstanceDiskPatch struct -type InstanceDiskPatch struct { - // The user-defined name for this disk. - Name *string `json:"name,omitempty"` -} +// GetFloatingIPOptions : The GetFloatingIP options. +type GetFloatingIPOptions struct { + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalInstanceDiskPatch unmarshals an instance of InstanceDiskPatch from the specified map of raw messages. -func UnmarshalInstanceDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// AsPatch returns a generic map representation of the InstanceDiskPatch -func (instanceDiskPatch *InstanceDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceDiskPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// NewGetFloatingIPOptions : Instantiate GetFloatingIPOptions +func (*VpcV1) NewGetFloatingIPOptions(id string) *GetFloatingIPOptions { + return &GetFloatingIPOptions{ + ID: core.StringPtr(id), } - return } -// InstanceDiskReference : InstanceDiskReference struct -type InstanceDiskReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceDiskReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *GetFloatingIPOptions) SetID(id string) *GetFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this instance disk. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetFloatingIPOptions) SetHeaders(param map[string]string) *GetFloatingIPOptions { + options.Headers = param + return options +} - // The unique identifier for this instance disk. - ID *string `json:"id" validate:"required"` +// GetFlowLogCollectorOptions : The GetFlowLogCollector options. +type GetFlowLogCollectorOptions struct { + // The flow log collector identifier. + ID *string `json:"id" validate:"required,ne="` - // The user-defined name for this disk. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// NewGetFlowLogCollectorOptions : Instantiate GetFlowLogCollectorOptions +func (*VpcV1) NewGetFlowLogCollectorOptions(id string) *GetFlowLogCollectorOptions { + return &GetFlowLogCollectorOptions{ + ID: core.StringPtr(id), + } } -// Constants associated with the InstanceDiskReference.ResourceType property. -// The resource type. -const ( - InstanceDiskReferenceResourceTypeInstanceDiskConst = "instance_disk" -) +// SetID : Allow user to set ID +func (_options *GetFlowLogCollectorOptions) SetID(id string) *GetFlowLogCollectorOptions { + _options.ID = core.StringPtr(id) + return _options +} -// UnmarshalInstanceDiskReference unmarshals an instance of InstanceDiskReference from the specified map of raw messages. -func UnmarshalInstanceDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceDiskReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetFlowLogCollectorOptions) SetHeaders(param map[string]string) *GetFlowLogCollectorOptions { + options.Headers = param + return options } -// InstanceDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type InstanceDiskReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// GetIkePolicyOptions : The GetIkePolicy options. +type GetIkePolicyOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceDiskReferenceDeleted unmarshals an instance of InstanceDiskReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceDiskReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewGetIkePolicyOptions : Instantiate GetIkePolicyOptions +func (*VpcV1) NewGetIkePolicyOptions(id string) *GetIkePolicyOptions { + return &GetIkePolicyOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGpu : The virtual server instance GPU configuration. -type InstanceGpu struct { - // The number of GPUs assigned to the instance. - Count *int64 `json:"count" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetIkePolicyOptions) SetID(id string) *GetIkePolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The GPU manufacturer. - Manufacturer *string `json:"manufacturer" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetIkePolicyOptions) SetHeaders(param map[string]string) *GetIkePolicyOptions { + options.Headers = param + return options +} - // The overall amount of GPU memory in GiB (gibibytes). - Memory *int64 `json:"memory" validate:"required"` +// GetImageOptions : The GetImage options. +type GetImageOptions struct { + // The image identifier. + ID *string `json:"id" validate:"required,ne="` - // The GPU model. - Model *string `json:"model" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGpu unmarshals an instance of InstanceGpu from the specified map of raw messages. -func UnmarshalInstanceGpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGpu) - err = core.UnmarshalPrimitive(m, "count", &obj.Count) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "model", &obj.Model) - if err != nil { - return +// NewGetImageOptions : Instantiate GetImageOptions +func (*VpcV1) NewGetImageOptions(id string) *GetImageOptions { + return &GetImageOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroup : InstanceGroup struct -type InstanceGroup struct { - // Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the - // port for the load balancer pool member. - ApplicationPort *int64 `json:"application_port,omitempty"` +// SetID : Allow user to set ID +func (_options *GetImageOptions) SetID(id string) *GetImageOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The date and time that the instance group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetImageOptions) SetHeaders(param map[string]string) *GetImageOptions { + options.Headers = param + return options +} - // The CRN for this instance group. - CRN *string `json:"crn" validate:"required"` +// GetInstanceDiskOptions : The GetInstanceDisk options. +type GetInstanceDiskOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The URL for this instance group. - Href *string `json:"href" validate:"required"` + // The instance disk identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this instance group. - ID *string `json:"id" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The template used to create new instances for this group. - InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` +// NewGetInstanceDiskOptions : Instantiate GetInstanceDiskOptions +func (*VpcV1) NewGetInstanceDiskOptions(instanceID string, id string) *GetInstanceDiskOptions { + return &GetInstanceDiskOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + } +} - // The load balancer pool managed by this group. Instances created - // by this group will have a new load balancer pool member in that - // pool created. - LoadBalancerPool *LoadBalancerPoolReference `json:"load_balancer_pool,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceDiskOptions) SetInstanceID(instanceID string) *GetInstanceDiskOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The managers for the instance group. - Managers []InstanceGroupManagerReference `json:"managers" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceDiskOptions) SetID(id string) *GetInstanceDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceDiskOptions) SetHeaders(param map[string]string) *GetInstanceDiskOptions { + options.Headers = param + return options +} - // The user-defined name for this instance group. - Name *string `json:"name" validate:"required"` +// GetInstanceGroupManagerActionOptions : The GetInstanceGroupManagerAction options. +type GetInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The status of the instance group - // - `deleting`: Group is being deleted - // - `healthy`: Group has `membership_count` instances - // - `scaling`: Instances in the group are being created or deleted to reach - // `membership_count` - // - `unhealthy`: Group is unable to reach `membership_count` instances. - Status *string `json:"status" validate:"required"` + // The instance group manager action identifier. + ID *string `json:"id" validate:"required,ne="` - // The subnets to use when creating new instances. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The date and time that the instance group was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` +// NewGetInstanceGroupManagerActionOptions : Instantiate GetInstanceGroupManagerActionOptions +func (*VpcV1) NewGetInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerActionOptions { + return &GetInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), + } +} - // The VPC the instance group resides in. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// Constants associated with the InstanceGroup.Status property. -// The status of the instance group -// - `deleting`: Group is being deleted -// - `healthy`: Group has `membership_count` instances -// - `scaling`: Instances in the group are being created or deleted to reach -// `membership_count` -// - `unhealthy`: Group is unable to reach `membership_count` instances. -const ( - InstanceGroupStatusDeletingConst = "deleting" - InstanceGroupStatusHealthyConst = "healthy" - InstanceGroupStatusScalingConst = "scaling" - InstanceGroupStatusUnhealthyConst = "unhealthy" -) +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *GetInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} -// UnmarshalInstanceGroup unmarshals an instance of InstanceGroup from the specified map of raw messages. -func UnmarshalInstanceGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroup) - err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManagerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetInstanceGroupManagerActionOptions) SetID(id string) *GetInstanceGroupManagerActionOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupCollection : InstanceGroupCollection struct -type InstanceGroupCollection struct { - // A link to the first page of resources. - First *InstanceGroupCollectionFirst `json:"first" validate:"required"` - - // Collection of instance groups. - InstanceGroups []InstanceGroup `json:"instance_groups" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerActionOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// GetInstanceGroupManagerOptions : The GetInstanceGroupManager options. +type GetInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupCollectionNext `json:"next,omitempty"` + // The instance group manager identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupCollection unmarshals an instance of InstanceGroupCollection from the specified map of raw messages. -func UnmarshalInstanceGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_groups", &obj.InstanceGroups, UnmarshalInstanceGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetInstanceGroupManagerOptions : Instantiate GetInstanceGroupManagerOptions +func (*VpcV1) NewGetInstanceGroupManagerOptions(instanceGroupID string, id string) *GetInstanceGroupManagerOptions { + return &GetInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// InstanceGroupCollectionFirst : A link to the first page of resources. -type InstanceGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceGroupManagerOptions) SetID(id string) *GetInstanceGroupManagerOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupCollectionFirst unmarshals an instance of InstanceGroupCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupManagerOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerOptions { + options.Headers = param + return options } -// InstanceGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// GetInstanceGroupManagerPolicyOptions : The GetInstanceGroupManagerPolicy options. +type GetInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // The instance group manager policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupCollectionNext unmarshals an instance of InstanceGroupCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewGetInstanceGroupManagerPolicyOptions : Instantiate GetInstanceGroupManagerPolicyOptions +func (*VpcV1) NewGetInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string) *GetInstanceGroupManagerPolicyOptions { + return &GetInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManager : InstanceGroupManager struct -// Models which "extend" this model: -// - InstanceGroupManagerAutoScale -// - InstanceGroupManagerScheduled -type InstanceGroupManager struct { - // The date and time that the instance group manager was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled" validate:"required"` +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *GetInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *GetInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} - // The user-defined name for this instance group manager. Names must be unique within the instance group. - Name *string `json:"name" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceGroupManagerPolicyOptions) SetID(id string) *GetInstanceGroupManagerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The date and time that the instance group manager was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *GetInstanceGroupManagerPolicyOptions { + options.Headers = param + return options +} - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` +// GetInstanceGroupMembershipOptions : The GetInstanceGroupMembership options. +type GetInstanceGroupMembershipOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` + // The instance group membership identifier. + ID *string `json:"id" validate:"required,ne="` - // The type of instance group manager. - ManagerType *string `json:"manager_type,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` +// NewGetInstanceGroupMembershipOptions : Instantiate GetInstanceGroupMembershipOptions +func (*VpcV1) NewGetInstanceGroupMembershipOptions(instanceGroupID string, id string) *GetInstanceGroupMembershipOptions { + return &GetInstanceGroupMembershipOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), + } +} - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *GetInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *GetInstanceGroupMembershipOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // The policies of the instance group manager. - Policies []InstanceGroupManagerPolicyReference `json:"policies,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceGroupMembershipOptions) SetID(id string) *GetInstanceGroupMembershipOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The actions of the instance group manager. - Actions []InstanceGroupManagerActionReference `json:"actions,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *GetInstanceGroupMembershipOptions { + options.Headers = param + return options } -// Constants associated with the InstanceGroupManager.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerManagerTypeAutoscaleConst = "autoscale" -) +// GetInstanceGroupOptions : The GetInstanceGroup options. +type GetInstanceGroupOptions struct { + // The instance group identifier. + ID *string `json:"id" validate:"required,ne="` -func (*InstanceGroupManager) isaInstanceGroupManager() bool { - return true + // Allows users to set headers on API requests + Headers map[string]string } -type InstanceGroupManagerIntf interface { - isaInstanceGroupManager() bool +// NewGetInstanceGroupOptions : Instantiate GetInstanceGroupOptions +func (*VpcV1) NewGetInstanceGroupOptions(id string) *GetInstanceGroupOptions { + return &GetInstanceGroupOptions{ + ID: core.StringPtr(id), + } } -// UnmarshalInstanceGroupManager unmarshals an instance of InstanceGroupManager from the specified map of raw messages. -func UnmarshalInstanceGroupManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManager) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetInstanceGroupOptions) SetID(id string) *GetInstanceGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerAction : InstanceGroupManagerAction struct -// Models which "extend" this model: -// - InstanceGroupManagerActionScheduledAction -type InstanceGroupManagerAction struct { - // Indicates whether this scheduled action will be automatically deleted after it has completed and - // `auto_delete_timeout` hours have passed. At present, this is always - // `true`, but may be modifiable in the future. - AutoDelete *bool `json:"auto_delete" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceGroupOptions) SetHeaders(param map[string]string) *GetInstanceGroupOptions { + options.Headers = param + return options +} - // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically - // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the - // future. - AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` +// GetInstanceInitializationOptions : The GetInstanceInitialization options. +type GetInstanceInitializationOptions struct { + // The instance identifier. + ID *string `json:"id" validate:"required,ne="` - // The date and time that the instance group manager action was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` +// NewGetInstanceInitializationOptions : Instantiate GetInstanceInitializationOptions +func (*VpcV1) NewGetInstanceInitializationOptions(id string) *GetInstanceInitializationOptions { + return &GetInstanceInitializationOptions{ + ID: core.StringPtr(id), + } +} - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetInstanceInitializationOptions) SetID(id string) *GetInstanceInitializationOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceInitializationOptions) SetHeaders(param map[string]string) *GetInstanceInitializationOptions { + options.Headers = param + return options +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// GetInstanceNetworkInterfaceFloatingIPOptions : The GetInstanceNetworkInterfaceFloatingIP options. +type GetInstanceNetworkInterfaceFloatingIPOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The status of the instance group action - // - `active`: Action is ready to be run - // - `completed`: Action was completed successfully - // - `failed`: Action could not be completed successfully - // - `incompatible`: Action parameters are not compatible with the group or manager - // - `omitted`: Action was not applied because this action's manager was disabled. - Status *string `json:"status" validate:"required"` + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // The date and time that the instance group manager action was modified. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // The type of action for the instance group. - ActionType *string `json:"action_type,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` +// NewGetInstanceNetworkInterfaceFloatingIPOptions : Instantiate GetInstanceNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewGetInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *GetInstanceNetworkInterfaceFloatingIPOptions { + return &GetInstanceNetworkInterfaceFloatingIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), + } +} - // The date and time the scheduled action was last applied. If absent, the action has never been applied. - LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run - // time. - NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *GetInstanceNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} - Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *GetInstanceNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options } -// Constants associated with the InstanceGroupManagerAction.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) +// GetInstanceNetworkInterfaceOptions : The GetInstanceNetworkInterface options. +type GetInstanceNetworkInterfaceOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` -// Constants associated with the InstanceGroupManagerAction.Status property. -// The status of the instance group action -// - `active`: Action is ready to be run -// - `completed`: Action was completed successfully -// - `failed`: Action could not be completed successfully -// - `incompatible`: Action parameters are not compatible with the group or manager -// - `omitted`: Action was not applied because this action's manager was disabled. -const ( - InstanceGroupManagerActionStatusActiveConst = "active" - InstanceGroupManagerActionStatusCompletedConst = "completed" - InstanceGroupManagerActionStatusFailedConst = "failed" - InstanceGroupManagerActionStatusIncompatibleConst = "incompatible" - InstanceGroupManagerActionStatusOmittedConst = "omitted" -) + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the InstanceGroupManagerAction.ActionType property. -// The type of action for the instance group. -const ( - InstanceGroupManagerActionActionTypeScheduledConst = "scheduled" -) + // Allows users to set headers on API requests + Headers map[string]string +} -func (*InstanceGroupManagerAction) isaInstanceGroupManagerAction() bool { - return true +// NewGetInstanceNetworkInterfaceOptions : Instantiate GetInstanceNetworkInterfaceOptions +func (*VpcV1) NewGetInstanceNetworkInterfaceOptions(instanceID string, id string) *GetInstanceNetworkInterfaceOptions { + return &GetInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + } } -type InstanceGroupManagerActionIntf interface { - isaInstanceGroupManagerAction() bool +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *GetInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// UnmarshalInstanceGroupManagerAction unmarshals an instance of InstanceGroupManagerAction from the specified map of raw messages. -func UnmarshalInstanceGroupManagerAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerAction) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionGroupPatch : InstanceGroupManagerActionGroupPatch struct -type InstanceGroupManagerActionGroupPatch struct { - // The number of members the instance group should have at the scheduled time. - MembershipCount *int64 `json:"membership_count,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceNetworkInterfaceOptions) SetID(id string) *GetInstanceNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupManagerActionGroupPatch unmarshals an instance of InstanceGroupManagerActionGroupPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionGroupPatch) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetInstanceNetworkInterfaceOptions { + options.Headers = param + return options } -// InstanceGroupManagerActionManagerPatch : InstanceGroupManagerActionManagerPatch struct -type InstanceGroupManagerActionManagerPatch struct { - // The maximum number of members the instance group should have at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` +// GetInstanceOptions : The GetInstance options. +type GetInstanceOptions struct { + // The instance identifier. + ID *string `json:"id" validate:"required,ne="` - // The minimum number of members the instance group should have at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerActionManagerPatch unmarshals an instance of InstanceGroupManagerActionManagerPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionManagerPatch) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return +// NewGetInstanceOptions : Instantiate GetInstanceOptions +func (*VpcV1) NewGetInstanceOptions(id string) *GetInstanceOptions { + return &GetInstanceOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerActionPatch : InstanceGroupManagerActionPatch struct -type InstanceGroupManagerActionPatch struct { - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerActionGroupPatch `json:"group,omitempty"` +// SetID : Allow user to set ID +func (_options *GetInstanceOptions) SetID(id string) *GetInstanceOptions { + _options.ID = core.StringPtr(id) + return _options +} - Manager *InstanceGroupManagerActionManagerPatch `json:"manager,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceOptions) SetHeaders(param map[string]string) *GetInstanceOptions { + options.Headers = param + return options +} - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. - Name *string `json:"name,omitempty"` +// GetInstanceProfileOptions : The GetInstanceProfile options. +type GetInstanceProfileOptions struct { + // The instance profile name. + Name *string `json:"name" validate:"required,ne="` - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerActionPatch unmarshals an instance of InstanceGroupManagerActionPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPatch) - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerActionGroupPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerActionManagerPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return +// NewGetInstanceProfileOptions : Instantiate GetInstanceProfileOptions +func (*VpcV1) NewGetInstanceProfileOptions(name string) *GetInstanceProfileOptions { + return &GetInstanceProfileOptions{ + Name: core.StringPtr(name), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the InstanceGroupManagerActionPatch -func (instanceGroupManagerActionPatch *InstanceGroupManagerActionPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerActionPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetName : Allow user to set Name +func (_options *GetInstanceProfileOptions) SetName(name string) *GetInstanceProfileOptions { + _options.Name = core.StringPtr(name) + return _options } -// InstanceGroupManagerActionPrototype : InstanceGroupManagerActionPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototype struct { - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetInstanceProfileOptions) SetHeaders(param map[string]string) *GetInstanceProfileOptions { + options.Headers = param + return options +} - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` +// GetInstanceTemplateOptions : The GetInstanceTemplate options. +type GetInstanceTemplateOptions struct { + // The instance template identifier. + ID *string `json:"id" validate:"required,ne="` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { - return true +// NewGetInstanceTemplateOptions : Instantiate GetInstanceTemplateOptions +func (*VpcV1) NewGetInstanceTemplateOptions(id string) *GetInstanceTemplateOptions { + return &GetInstanceTemplateOptions{ + ID: core.StringPtr(id), + } } -type InstanceGroupManagerActionPrototypeIntf interface { - isaInstanceGroupManagerActionPrototype() bool +// SetID : Allow user to set ID +func (_options *GetInstanceTemplateOptions) SetID(id string) *GetInstanceTemplateOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupManagerActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceTemplateOptions) SetHeaders(param map[string]string) *GetInstanceTemplateOptions { + options.Headers = param + return options } -// InstanceGroupManagerActionReference : InstanceGroupManagerActionReference struct -type InstanceGroupManagerActionReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceGroupManagerActionReferenceDeleted `json:"deleted,omitempty"` +// GetInstanceVolumeAttachmentOptions : The GetInstanceVolumeAttachment options. +type GetInstanceVolumeAttachmentOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The URL for this instance group manager action. - Href *string `json:"href" validate:"required"` + // The volume attachment identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this instance group manager action. - ID *string `json:"id" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. - Name *string `json:"name" validate:"required"` +// NewGetInstanceVolumeAttachmentOptions : Instantiate GetInstanceVolumeAttachmentOptions +func (*VpcV1) NewGetInstanceVolumeAttachmentOptions(instanceID string, id string) *GetInstanceVolumeAttachmentOptions { + return &GetInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + } +} - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *GetInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *GetInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// Constants associated with the InstanceGroupManagerActionReference.ResourceType property. -// The resource type. -const ( - InstanceGroupManagerActionReferenceResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" -) +// SetID : Allow user to set ID +func (_options *GetInstanceVolumeAttachmentOptions) SetID(id string) *GetInstanceVolumeAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options +} -// UnmarshalInstanceGroupManagerActionReference unmarshals an instance of InstanceGroupManagerActionReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerActionReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *GetInstanceVolumeAttachmentOptions { + options.Headers = param + return options } -// InstanceGroupManagerActionReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type InstanceGroupManagerActionReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// GetIpsecPolicyOptions : The GetIpsecPolicy options. +type GetIpsecPolicyOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerActionReferenceDeleted unmarshals an instance of InstanceGroupManagerActionReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// NewGetIpsecPolicyOptions : Instantiate GetIpsecPolicyOptions +func (*VpcV1) NewGetIpsecPolicyOptions(id string) *GetIpsecPolicyOptions { + return &GetIpsecPolicyOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerActionsCollection : InstanceGroupManagerActionsCollection struct -type InstanceGroupManagerActionsCollection struct { - // Collection of instance group manager actions. - Actions []InstanceGroupManagerActionIntf `json:"actions" validate:"required"` - - // A link to the first page of resources. - First *InstanceGroupManagerActionsCollectionFirst `json:"first" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetIpsecPolicyOptions) SetID(id string) *GetIpsecPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetIpsecPolicyOptions) SetHeaders(param map[string]string) *GetIpsecPolicyOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerActionsCollectionNext `json:"next,omitempty"` +// GetKeyOptions : The GetKey options. +type GetKeyOptions struct { + // The key identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerActionsCollection unmarshals an instance of InstanceGroupManagerActionsCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollection) - err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerAction) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerActionsCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerActionsCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetKeyOptions : Instantiate GetKeyOptions +func (*VpcV1) NewGetKeyOptions(id string) *GetKeyOptions { + return &GetKeyOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerActionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *GetKeyOptions) SetID(id string) *GetKeyOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerActionsCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerActionsCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetKeyOptions) SetHeaders(param map[string]string) *GetKeyOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupManagerActionsCollectionFirst unmarshals an instance of InstanceGroupManagerActionsCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// GetLoadBalancerListenerOptions : The GetLoadBalancerListener options. +type GetLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetLoadBalancerListenerOptions : Instantiate GetLoadBalancerListenerOptions +func (*VpcV1) NewGetLoadBalancerListenerOptions(loadBalancerID string, id string) *GetLoadBalancerListenerOptions { + return &GetLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerActionsCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerActionsCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalInstanceGroupManagerActionsCollectionNext unmarshals an instance of InstanceGroupManagerActionsCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionsCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionsCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetLoadBalancerListenerOptions) SetID(id string) *GetLoadBalancerListenerOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerCollection : InstanceGroupManagerCollection struct -type InstanceGroupManagerCollection struct { - // A link to the first page of resources. - First *InstanceGroupManagerCollectionFirst `json:"first" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerListenerOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// GetLoadBalancerListenerPolicyOptions : The GetLoadBalancerListenerPolicy options. +type GetLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // Collection of instance group managers. - Managers []InstanceGroupManagerIntf `json:"managers" validate:"required"` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerCollectionNext `json:"next,omitempty"` + // The policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerCollection unmarshals an instance of InstanceGroupManagerCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return +// NewGetLoadBalancerListenerPolicyOptions : Instantiate GetLoadBalancerListenerPolicyOptions +func (*VpcV1) NewGetLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string) *GetLoadBalancerListenerPolicyOptions { + return &GetLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + ID: core.StringPtr(id), } - err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManager) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil } -// InstanceGroupManagerCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalInstanceGroupManagerCollectionFirst unmarshals an instance of InstanceGroupManagerCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetListenerID : Allow user to set ListenerID +func (_options *GetLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options } -// InstanceGroupManagerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerListenerPolicyOptions) SetID(id string) *GetLoadBalancerListenerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupManagerCollectionNext unmarshals an instance of InstanceGroupManagerCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyOptions { + options.Headers = param + return options } -// InstanceGroupManagerPatch : InstanceGroupManagerPatch struct -type InstanceGroupManagerPatch struct { - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` +// GetLoadBalancerListenerPolicyRuleOptions : The GetLoadBalancerListenerPolicyRule options. +type GetLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` - // The user-defined name for this instance group manager. Names must be unique within the instance group. - Name *string `json:"name,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerPatch unmarshals an instance of InstanceGroupManagerPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPatch) - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewGetLoadBalancerListenerPolicyRuleOptions : Instantiate GetLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewGetLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string) *GetLoadBalancerListenerPolicyRuleOptions { + return &GetLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the InstanceGroupManagerPatch -func (instanceGroupManagerPatch *InstanceGroupManagerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// InstanceGroupManagerPolicy : InstanceGroupManagerPolicy struct -// Models which "extend" this model: -// - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy -type InstanceGroupManagerPolicy struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` - - // The user-defined name for this instance group manager policy. Names must be unique within the instance group - // manager. - Name *string `json:"name" validate:"required"` - - // The date and time that the instance group manager policy was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` +// SetListenerID : Allow user to set ListenerID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` +// SetPolicyID : Allow user to set PolicyID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} - // The type of policy for the instance group. - PolicyType *string `json:"policy_type,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerListenerPolicyRuleOptions) SetID(id string) *GetLoadBalancerListenerPolicyRuleOptions { + _options.ID = core.StringPtr(id) + return _options } -// Constants associated with the InstanceGroupManagerPolicy.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyMetricTypeNetworkOutConst = "network_out" -) +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *GetLoadBalancerListenerPolicyRuleOptions { + options.Headers = param + return options +} -// Constants associated with the InstanceGroupManagerPolicy.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPolicyTypeTargetConst = "target" -) +// GetLoadBalancerOptions : The GetLoadBalancer options. +type GetLoadBalancerOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` -func (*InstanceGroupManagerPolicy) isaInstanceGroupManagerPolicy() bool { - return true + // Allows users to set headers on API requests + Headers map[string]string } -type InstanceGroupManagerPolicyIntf interface { - isaInstanceGroupManagerPolicy() bool +// NewGetLoadBalancerOptions : Instantiate GetLoadBalancerOptions +func (*VpcV1) NewGetLoadBalancerOptions(id string) *GetLoadBalancerOptions { + return &GetLoadBalancerOptions{ + ID: core.StringPtr(id), + } } -// UnmarshalInstanceGroupManagerPolicy unmarshals an instance of InstanceGroupManagerPolicy from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicy) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetLoadBalancerOptions) SetID(id string) *GetLoadBalancerOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerPolicyCollection : InstanceGroupManagerPolicyCollection struct -type InstanceGroupManagerPolicyCollection struct { - // A link to the first page of resources. - First *InstanceGroupManagerPolicyCollectionFirst `json:"first" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerOptions) SetHeaders(param map[string]string) *GetLoadBalancerOptions { + options.Headers = param + return options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// GetLoadBalancerPoolMemberOptions : The GetLoadBalancerPoolMember options. +type GetLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupManagerPolicyCollectionNext `json:"next,omitempty"` + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` - // Collection of instance group manager policies. - Policies []InstanceGroupManagerPolicyIntf `json:"policies" validate:"required"` + // The member identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerPolicyCollection unmarshals an instance of InstanceGroupManagerPolicyCollection from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerPolicyCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerPolicyCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetLoadBalancerPoolMemberOptions : Instantiate GetLoadBalancerPoolMemberOptions +func (*VpcV1) NewGetLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string) *GetLoadBalancerPoolMemberOptions { + return &GetLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupManagerPolicyCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// InstanceGroupManagerPolicyCollectionFirst : A link to the first page of resources. -type InstanceGroupManagerPolicyCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetPoolID : Allow user to set PoolID +func (_options *GetLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *GetLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) + return _options } -// UnmarshalInstanceGroupManagerPolicyCollectionFirst unmarshals an instance of InstanceGroupManagerPolicyCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetLoadBalancerPoolMemberOptions) SetID(id string) *GetLoadBalancerPoolMemberOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupManagerPolicyCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolMemberOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupManagerPolicyCollectionNext unmarshals an instance of InstanceGroupManagerPolicyCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// GetLoadBalancerPoolOptions : The GetLoadBalancerPool options. +type GetLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The pool identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetLoadBalancerPoolOptions : Instantiate GetLoadBalancerPoolOptions +func (*VpcV1) NewGetLoadBalancerPoolOptions(loadBalancerID string, id string) *GetLoadBalancerPoolOptions { + return &GetLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerPolicyPatch : InstanceGroupManagerPolicyPatch struct -type InstanceGroupManagerPolicyPatch struct { - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *GetLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *GetLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` +// SetID : Allow user to set ID +func (_options *GetLoadBalancerPoolOptions) SetID(id string) *GetLoadBalancerPoolOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The user-defined name for this instance group manager policy. Names must be unique within the instance group - // manager. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerPoolOptions) SetHeaders(param map[string]string) *GetLoadBalancerPoolOptions { + options.Headers = param + return options } -// Constants associated with the InstanceGroupManagerPolicyPatch.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPatchMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPatchMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPatchMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPatchMetricTypeNetworkOutConst = "network_out" -) +// GetLoadBalancerProfileOptions : The GetLoadBalancerProfile options. +type GetLoadBalancerProfileOptions struct { + // The load balancer profile name. + Name *string `json:"name" validate:"required,ne="` -// UnmarshalInstanceGroupManagerPolicyPatch unmarshals an instance of InstanceGroupManagerPolicyPatch from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPatch) - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // Allows users to set headers on API requests + Headers map[string]string } -// AsPatch returns a generic map representation of the InstanceGroupManagerPolicyPatch -func (instanceGroupManagerPolicyPatch *InstanceGroupManagerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupManagerPolicyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// NewGetLoadBalancerProfileOptions : Instantiate GetLoadBalancerProfileOptions +func (*VpcV1) NewGetLoadBalancerProfileOptions(name string) *GetLoadBalancerProfileOptions { + return &GetLoadBalancerProfileOptions{ + Name: core.StringPtr(name), } - return } -// InstanceGroupManagerPolicyPrototype : InstanceGroupManagerPolicyPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype -type InstanceGroupManagerPolicyPrototype struct { - // The user-defined name for this instance group manager policy. Names must be unique within the instance group - // manager. - Name *string `json:"name,omitempty"` +// SetName : Allow user to set Name +func (_options *GetLoadBalancerProfileOptions) SetName(name string) *GetLoadBalancerProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The type of metric to be evaluated. - MetricType *string `json:"metric_type,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerProfileOptions) SetHeaders(param map[string]string) *GetLoadBalancerProfileOptions { + options.Headers = param + return options +} - // The metric value to be evaluated. - MetricValue *int64 `json:"metric_value,omitempty"` +// GetLoadBalancerStatisticsOptions : The GetLoadBalancerStatistics options. +type GetLoadBalancerStatisticsOptions struct { + // The load balancer identifier. + ID *string `json:"id" validate:"required,ne="` - // The type of policy for the instance group. - PolicyType *string `json:"policy_type,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceGroupManagerPolicyPrototype.MetricType property. -// The type of metric to be evaluated. -const ( - InstanceGroupManagerPolicyPrototypeMetricTypeCpuConst = "cpu" - InstanceGroupManagerPolicyPrototypeMetricTypeMemoryConst = "memory" - InstanceGroupManagerPolicyPrototypeMetricTypeNetworkInConst = "network_in" - InstanceGroupManagerPolicyPrototypeMetricTypeNetworkOutConst = "network_out" -) +// NewGetLoadBalancerStatisticsOptions : Instantiate GetLoadBalancerStatisticsOptions +func (*VpcV1) NewGetLoadBalancerStatisticsOptions(id string) *GetLoadBalancerStatisticsOptions { + return &GetLoadBalancerStatisticsOptions{ + ID: core.StringPtr(id), + } +} -// Constants associated with the InstanceGroupManagerPolicyPrototype.PolicyType property. -// The type of policy for the instance group. -const ( - InstanceGroupManagerPolicyPrototypePolicyTypeTargetConst = "target" -) +// SetID : Allow user to set ID +func (_options *GetLoadBalancerStatisticsOptions) SetID(id string) *GetLoadBalancerStatisticsOptions { + _options.ID = core.StringPtr(id) + return _options +} -func (*InstanceGroupManagerPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetLoadBalancerStatisticsOptions) SetHeaders(param map[string]string) *GetLoadBalancerStatisticsOptions { + options.Headers = param + return options } -type InstanceGroupManagerPolicyPrototypeIntf interface { - isaInstanceGroupManagerPolicyPrototype() bool +// GetNetworkACLOptions : The GetNetworkACL options. +type GetNetworkACLOptions struct { + // The network ACL identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) - if err != nil { - return +// NewGetNetworkACLOptions : Instantiate GetNetworkACLOptions +func (*VpcV1) NewGetNetworkACLOptions(id string) *GetNetworkACLOptions { + return &GetNetworkACLOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerPolicyReference : InstanceGroupManagerPolicyReference struct -type InstanceGroupManagerPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceGroupManagerPolicyReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *GetNetworkACLOptions) SetID(id string) *GetNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this instance group manager policy. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetNetworkACLOptions) SetHeaders(param map[string]string) *GetNetworkACLOptions { + options.Headers = param + return options +} - // The unique identifier for this instance group manager policy. - ID *string `json:"id" validate:"required"` +// GetNetworkACLRuleOptions : The GetNetworkACLRule options. +type GetNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` - // The user-defined name for this instance group manager policy. Names must be unique within the instance group - // manager. - Name *string `json:"name" validate:"required"` + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerPolicyReference unmarshals an instance of InstanceGroupManagerPolicyReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerPolicyReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewGetNetworkACLRuleOptions : Instantiate GetNetworkACLRuleOptions +func (*VpcV1) NewGetNetworkACLRuleOptions(networkACLID string, id string) *GetNetworkACLRuleOptions { + return &GetNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type InstanceGroupManagerPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *GetNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *GetNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options } -// UnmarshalInstanceGroupManagerPolicyReferenceDeleted unmarshals an instance of InstanceGroupManagerPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetNetworkACLRuleOptions) SetID(id string) *GetNetworkACLRuleOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerPrototype : InstanceGroupManagerPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype -// - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype -type InstanceGroupManagerPrototype struct { - // Indicates whether this manager will control the instance group. - ManagementEnabled *bool `json:"management_enabled,omitempty"` - - // The user-defined name for this instance group manager. Names must be unique within the instance group. - Name *string `json:"name,omitempty"` - - // The time window in seconds to aggregate metrics prior to evaluation. - AggregationWindow *int64 `json:"aggregation_window,omitempty"` - - // The duration of time in seconds to pause further scale actions after scaling has taken place. - Cooldown *int64 `json:"cooldown,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetNetworkACLRuleOptions) SetHeaders(param map[string]string) *GetNetworkACLRuleOptions { + options.Headers = param + return options +} - // The type of instance group manager. - ManagerType *string `json:"manager_type,omitempty"` +// GetOperatingSystemOptions : The GetOperatingSystem options. +type GetOperatingSystemOptions struct { + // The operating system name. + Name *string `json:"name" validate:"required,ne="` - // The maximum number of members in a managed instance group. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The minimum number of members in a managed instance group. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// NewGetOperatingSystemOptions : Instantiate GetOperatingSystemOptions +func (*VpcV1) NewGetOperatingSystemOptions(name string) *GetOperatingSystemOptions { + return &GetOperatingSystemOptions{ + Name: core.StringPtr(name), + } } -// Constants associated with the InstanceGroupManagerPrototype.ManagerType property. -// The type of instance group manager. -const ( - InstanceGroupManagerPrototypeManagerTypeAutoscaleConst = "autoscale" -) +// SetName : Allow user to set Name +func (_options *GetOperatingSystemOptions) SetName(name string) *GetOperatingSystemOptions { + _options.Name = core.StringPtr(name) + return _options +} -func (*InstanceGroupManagerPrototype) isaInstanceGroupManagerPrototype() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetOperatingSystemOptions) SetHeaders(param map[string]string) *GetOperatingSystemOptions { + options.Headers = param + return options } -type InstanceGroupManagerPrototypeIntf interface { - isaInstanceGroupManagerPrototype() bool +// GetPlacementGroupOptions : The GetPlacementGroup options. +type GetPlacementGroupOptions struct { + // The placement group identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerPrototype unmarshals an instance of InstanceGroupManagerPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerPrototype) - err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return +// NewGetPlacementGroupOptions : Instantiate GetPlacementGroupOptions +func (*VpcV1) NewGetPlacementGroupOptions(id string) *GetPlacementGroupOptions { + return &GetPlacementGroupOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerReference : InstanceGroupManagerReference struct -type InstanceGroupManagerReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *GetPlacementGroupOptions) SetID(id string) *GetPlacementGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this instance group manager. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetPlacementGroupOptions) SetHeaders(param map[string]string) *GetPlacementGroupOptions { + options.Headers = param + return options +} - // The unique identifier for this instance group manager. - ID *string `json:"id" validate:"required"` +// GetPublicGatewayOptions : The GetPublicGateway options. +type GetPublicGatewayOptions struct { + // The public gateway identifier. + ID *string `json:"id" validate:"required,ne="` - // The user-defined name for this instance group manager. Names must be unique within the instance group. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerReference unmarshals an instance of InstanceGroupManagerReference from the specified map of raw messages. -func UnmarshalInstanceGroupManagerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewGetPublicGatewayOptions : Instantiate GetPublicGatewayOptions +func (*VpcV1) NewGetPublicGatewayOptions(id string) *GetPublicGatewayOptions { + return &GetPublicGatewayOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type InstanceGroupManagerReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetPublicGatewayOptions) SetID(id string) *GetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupManagerReferenceDeleted unmarshals an instance of InstanceGroupManagerReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupManagerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetPublicGatewayOptions) SetHeaders(param map[string]string) *GetPublicGatewayOptions { + options.Headers = param + return options } -// InstanceGroupManagerScheduledActionGroup : InstanceGroupManagerScheduledActionGroup struct -type InstanceGroupManagerScheduledActionGroup struct { - // The number of members the instance group should have at the scheduled time. - MembershipCount *int64 `json:"membership_count" validate:"required"` +// GetRegionOptions : The GetRegion options. +type GetRegionOptions struct { + // The region name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupManagerScheduledActionGroup unmarshals an instance of InstanceGroupManagerScheduledActionGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionGroup) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return +// NewGetRegionOptions : Instantiate GetRegionOptions +func (*VpcV1) NewGetRegionOptions(name string) *GetRegionOptions { + return &GetRegionOptions{ + Name: core.StringPtr(name), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerScheduledActionGroupPrototype : InstanceGroupManagerScheduledActionGroupPrototype struct -type InstanceGroupManagerScheduledActionGroupPrototype struct { - // The number of members the instance group should have at the scheduled time. - MembershipCount *int64 `json:"membership_count" validate:"required"` +// SetName : Allow user to set Name +func (_options *GetRegionOptions) SetName(name string) *GetRegionOptions { + _options.Name = core.StringPtr(name) + return _options } -// NewInstanceGroupManagerScheduledActionGroupPrototype : Instantiate InstanceGroupManagerScheduledActionGroupPrototype (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerScheduledActionGroupPrototype(membershipCount int64) (_model *InstanceGroupManagerScheduledActionGroupPrototype, err error) { - _model = &InstanceGroupManagerScheduledActionGroupPrototype{ - MembershipCount: core.Int64Ptr(membershipCount), - } - err = core.ValidateStruct(_model, "required parameters") - return +// SetHeaders : Allow user to set Headers +func (options *GetRegionOptions) SetHeaders(param map[string]string) *GetRegionOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupManagerScheduledActionGroupPrototype unmarshals an instance of InstanceGroupManagerScheduledActionGroupPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionGroupPrototype) - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return +// GetRegionZoneOptions : The GetRegionZone options. +type GetRegionZoneOptions struct { + // The region name. + RegionName *string `json:"region_name" validate:"required,ne="` + + // The zone name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetRegionZoneOptions : Instantiate GetRegionZoneOptions +func (*VpcV1) NewGetRegionZoneOptions(regionName string, name string) *GetRegionZoneOptions { + return &GetRegionZoneOptions{ + RegionName: core.StringPtr(regionName), + Name: core.StringPtr(name), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupManagerScheduledActionManager : InstanceGroupManagerScheduledActionManager struct -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerAutoScale -type InstanceGroupManagerScheduledActionManager struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` +// SetRegionName : Allow user to set RegionName +func (_options *GetRegionZoneOptions) SetRegionName(regionName string) *GetRegionZoneOptions { + _options.RegionName = core.StringPtr(regionName) + return _options +} - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` +// SetName : Allow user to set Name +func (_options *GetRegionZoneOptions) SetName(name string) *GetRegionZoneOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetRegionZoneOptions { + options.Headers = param + return options +} - // The user-defined name for this instance group manager. Names must be unique within the instance group. - Name *string `json:"name,omitempty"` +// GetSecurityGroupNetworkInterfaceOptions : The GetSecurityGroupNetworkInterface options. +type GetSecurityGroupNetworkInterfaceOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The maximum number of members the instance group should have at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` - // The minimum number of members the instance group should have at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*InstanceGroupManagerScheduledActionManager) isaInstanceGroupManagerScheduledActionManager() bool { - return true +// NewGetSecurityGroupNetworkInterfaceOptions : Instantiate GetSecurityGroupNetworkInterfaceOptions +func (*VpcV1) NewGetSecurityGroupNetworkInterfaceOptions(securityGroupID string, id string) *GetSecurityGroupNetworkInterfaceOptions { + return &GetSecurityGroupNetworkInterfaceOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), + } } -type InstanceGroupManagerScheduledActionManagerIntf interface { - isaInstanceGroupManagerScheduledActionManager() bool +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *GetSecurityGroupNetworkInterfaceOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupNetworkInterfaceOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options } -// UnmarshalInstanceGroupManagerScheduledActionManager unmarshals an instance of InstanceGroupManagerScheduledActionManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManager) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetSecurityGroupNetworkInterfaceOptions) SetID(id string) *GetSecurityGroupNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupManagerScheduledActionManagerPrototype : InstanceGroupManagerScheduledActionManagerPrototype struct -// Models which "extend" this model: -// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype -type InstanceGroupManagerScheduledActionManagerPrototype struct { - // The maximum number of members the instance group should have at the scheduled time. - MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - - // The minimum number of members the instance group should have at the scheduled time. - MinMembershipCount *int64 `json:"min_membership_count,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupNetworkInterfaceOptions) SetHeaders(param map[string]string) *GetSecurityGroupNetworkInterfaceOptions { + options.Headers = param + return options +} - // The unique identifier for this instance group manager. - ID *string `json:"id,omitempty"` +// GetSecurityGroupOptions : The GetSecurityGroup options. +type GetSecurityGroupOptions struct { + // The security group identifier. + ID *string `json:"id" validate:"required,ne="` - // The URL for this instance group manager. - Href *string `json:"href,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*InstanceGroupManagerScheduledActionManagerPrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { - return true +// NewGetSecurityGroupOptions : Instantiate GetSecurityGroupOptions +func (*VpcV1) NewGetSecurityGroupOptions(id string) *GetSecurityGroupOptions { + return &GetSecurityGroupOptions{ + ID: core.StringPtr(id), + } } -type InstanceGroupManagerScheduledActionManagerPrototypeIntf interface { - isaInstanceGroupManagerScheduledActionManagerPrototype() bool +// SetID : Allow user to set ID +func (_options *GetSecurityGroupOptions) SetID(id string) *GetSecurityGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupManagerScheduledActionManagerPrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototype from the specified map of raw messages. -func UnmarshalInstanceGroupManagerScheduledActionManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerScheduledActionManagerPrototype) - err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupOptions) SetHeaders(param map[string]string) *GetSecurityGroupOptions { + options.Headers = param + return options } -// InstanceGroupMembership : InstanceGroupMembership struct -type InstanceGroupMembership struct { - // The date and time that the instance group manager policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// GetSecurityGroupRuleOptions : The GetSecurityGroupRule options. +type GetSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // If set to true, when deleting the membership the instance will also be deleted. - DeleteInstanceOnMembershipDelete *bool `json:"delete_instance_on_membership_delete" validate:"required"` + // The rule identifier. + ID *string `json:"id" validate:"required,ne="` - // The URL for this instance group membership. - Href *string `json:"href" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The unique identifier for this instance group membership. - ID *string `json:"id" validate:"required"` +// NewGetSecurityGroupRuleOptions : Instantiate GetSecurityGroupRuleOptions +func (*VpcV1) NewGetSecurityGroupRuleOptions(securityGroupID string, id string) *GetSecurityGroupRuleOptions { + return &GetSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), + } +} - Instance *InstanceReference `json:"instance" validate:"required"` +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *GetSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} - InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetSecurityGroupRuleOptions) SetID(id string) *GetSecurityGroupRuleOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The user-defined name for this instance group membership. Names must be unique within the instance group. - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupRuleOptions) SetHeaders(param map[string]string) *GetSecurityGroupRuleOptions { + options.Headers = param + return options +} - PoolMember *LoadBalancerPoolMemberReference `json:"pool_member,omitempty"` +// GetSecurityGroupTargetOptions : The GetSecurityGroupTarget options. +type GetSecurityGroupTargetOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The status of the instance group membership - // - `deleting`: Membership is deleting dependent resources - // - `failed`: Membership was unable to maintain dependent resources - // - `healthy`: Membership is active and serving in the group - // - `pending`: Membership is waiting for dependent resources - // - `unhealthy`: Membership has unhealthy dependent resources. - Status *string `json:"status" validate:"required"` + // The security group target identifier. + ID *string `json:"id" validate:"required,ne="` - // The date and time that the instance group membership was updated. - UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the InstanceGroupMembership.Status property. -// The status of the instance group membership -// - `deleting`: Membership is deleting dependent resources -// - `failed`: Membership was unable to maintain dependent resources -// - `healthy`: Membership is active and serving in the group -// - `pending`: Membership is waiting for dependent resources -// - `unhealthy`: Membership has unhealthy dependent resources. -const ( - InstanceGroupMembershipStatusDeletingConst = "deleting" - InstanceGroupMembershipStatusFailedConst = "failed" - InstanceGroupMembershipStatusHealthyConst = "healthy" - InstanceGroupMembershipStatusPendingConst = "pending" - InstanceGroupMembershipStatusUnhealthyConst = "unhealthy" -) - -// UnmarshalInstanceGroupMembership unmarshals an instance of InstanceGroupMembership from the specified map of raw messages. -func UnmarshalInstanceGroupMembership(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembership) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "delete_instance_on_membership_delete", &obj.DeleteInstanceOnMembershipDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pool_member", &obj.PoolMember, UnmarshalLoadBalancerPoolMemberReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) - if err != nil { - return +// NewGetSecurityGroupTargetOptions : Instantiate GetSecurityGroupTargetOptions +func (*VpcV1) NewGetSecurityGroupTargetOptions(securityGroupID string, id string) *GetSecurityGroupTargetOptions { + return &GetSecurityGroupTargetOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupMembershipCollection : InstanceGroupMembershipCollection struct -type InstanceGroupMembershipCollection struct { - // A link to the first page of resources. - First *InstanceGroupMembershipCollectionFirst `json:"first" validate:"required"` +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *GetSecurityGroupTargetOptions) SetSecurityGroupID(securityGroupID string) *GetSecurityGroupTargetOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetSecurityGroupTargetOptions) SetID(id string) *GetSecurityGroupTargetOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Collection of instance group memberships. - Memberships []InstanceGroupMembership `json:"memberships" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetSecurityGroupTargetOptions) SetHeaders(param map[string]string) *GetSecurityGroupTargetOptions { + options.Headers = param + return options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceGroupMembershipCollectionNext `json:"next,omitempty"` +// GetSnapshotOptions : The GetSnapshot options. +type GetSnapshotOptions struct { + // The snapshot identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupMembershipCollection unmarshals an instance of InstanceGroupMembershipCollection from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupMembershipCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memberships", &obj.Memberships, UnmarshalInstanceGroupMembership) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupMembershipCollectionNext) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewGetSnapshotOptions : Instantiate GetSnapshotOptions +func (*VpcV1) NewGetSnapshotOptions(id string) *GetSnapshotOptions { + return &GetSnapshotOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *InstanceGroupMembershipCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetID : Allow user to set ID +func (_options *GetSnapshotOptions) SetID(id string) *GetSnapshotOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceGroupMembershipCollectionFirst : A link to the first page of resources. -type InstanceGroupMembershipCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetSnapshotOptions) SetHeaders(param map[string]string) *GetSnapshotOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupMembershipCollectionFirst unmarshals an instance of InstanceGroupMembershipCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// GetSubnetNetworkACLOptions : The GetSubnetNetworkACL options. +type GetSubnetNetworkACLOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` -// InstanceGroupMembershipCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceGroupMembershipCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupMembershipCollectionNext unmarshals an instance of InstanceGroupMembershipCollectionNext from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewGetSubnetNetworkACLOptions : Instantiate GetSubnetNetworkACLOptions +func (*VpcV1) NewGetSubnetNetworkACLOptions(id string) *GetSubnetNetworkACLOptions { + return &GetSubnetNetworkACLOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupMembershipPatch : InstanceGroupMembershipPatch struct -type InstanceGroupMembershipPatch struct { - // The user-defined name for this instance group membership. Names must be unique within the instance group. - Name *string `json:"name,omitempty"` +// SetID : Allow user to set ID +func (_options *GetSubnetNetworkACLOptions) SetID(id string) *GetSubnetNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupMembershipPatch unmarshals an instance of InstanceGroupMembershipPatch from the specified map of raw messages. -func UnmarshalInstanceGroupMembershipPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupMembershipPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetSubnetNetworkACLOptions) SetHeaders(param map[string]string) *GetSubnetNetworkACLOptions { + options.Headers = param + return options } -// AsPatch returns a generic map representation of the InstanceGroupMembershipPatch -func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupMembershipPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// GetSubnetOptions : The GetSubnet options. +type GetSubnetOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSubnetOptions : Instantiate GetSubnetOptions +func (*VpcV1) NewGetSubnetOptions(id string) *GetSubnetOptions { + return &GetSubnetOptions{ + ID: core.StringPtr(id), } - return } -// InstanceGroupPatch : To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. -type InstanceGroupPatch struct { - // Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the - // port for the load balancer pool member. - ApplicationPort *int64 `json:"application_port,omitempty"` +// SetID : Allow user to set ID +func (_options *GetSubnetOptions) SetID(id string) *GetSubnetOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Identifies an instance template by a unique property. - InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetSubnetOptions) SetHeaders(param map[string]string) *GetSubnetOptions { + options.Headers = param + return options +} - // The load balancer that the load balancer pool used by this group - // is in. Required when using a load balancer pool. - LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` +// GetSubnetPublicGatewayOptions : The GetSubnetPublicGateway options. +type GetSubnetPublicGatewayOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` - // If specified, the load balancer pool will be managed by this - // group. Instances created by this group will have a new load - // balancer pool member in that pool created. Must be used with - // `application_port`. - LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The number of instances in the instance group. - MembershipCount *int64 `json:"membership_count,omitempty"` +// NewGetSubnetPublicGatewayOptions : Instantiate GetSubnetPublicGatewayOptions +func (*VpcV1) NewGetSubnetPublicGatewayOptions(id string) *GetSubnetPublicGatewayOptions { + return &GetSubnetPublicGatewayOptions{ + ID: core.StringPtr(id), + } +} - // The user-defined name for this instance group. - Name *string `json:"name,omitempty"` +// SetID : Allow user to set ID +func (_options *GetSubnetPublicGatewayOptions) SetID(id string) *GetSubnetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The subnets to use when creating new instances. - Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *GetSubnetPublicGatewayOptions { + options.Headers = param + return options } -// UnmarshalInstanceGroupPatch unmarshals an instance of InstanceGroupPatch from the specified map of raw messages. -func UnmarshalInstanceGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupPatch) - err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) - if err != nil { - return - } - err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer", &obj.LoadBalancer, UnmarshalLoadBalancerIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// GetSubnetReservedIPOptions : The GetSubnetReservedIP options. +type GetSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` + + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// AsPatch returns a generic map representation of the InstanceGroupPatch -func (instanceGroupPatch *InstanceGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// NewGetSubnetReservedIPOptions : Instantiate GetSubnetReservedIPOptions +func (*VpcV1) NewGetSubnetReservedIPOptions(subnetID string, id string) *GetSubnetReservedIPOptions { + return &GetSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), + ID: core.StringPtr(id), } - return } -// InstanceGroupReference : InstanceGroupReference struct -type InstanceGroupReference struct { - // The CRN for this instance group. - CRN *string `json:"crn" validate:"required"` +// SetSubnetID : Allow user to set SubnetID +func (_options *GetSubnetReservedIPOptions) SetSubnetID(subnetID string) *GetSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options +} - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceGroupReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *GetSubnetReservedIPOptions) SetID(id string) *GetSubnetReservedIPOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this instance group. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetSubnetReservedIPOptions) SetHeaders(param map[string]string) *GetSubnetReservedIPOptions { + options.Headers = param + return options +} - // The unique identifier for this instance group. - ID *string `json:"id" validate:"required"` +// GetSubnetRoutingTableOptions : The GetSubnetRoutingTable options. +type GetSubnetRoutingTableOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` - // The user-defined name for this instance group. - Name *string `json:"name" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceGroupReference unmarshals an instance of InstanceGroupReference from the specified map of raw messages. -func UnmarshalInstanceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewGetSubnetRoutingTableOptions : Instantiate GetSubnetRoutingTableOptions +func (*VpcV1) NewGetSubnetRoutingTableOptions(id string) *GetSubnetRoutingTableOptions { + return &GetSubnetRoutingTableOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type InstanceGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetSubnetRoutingTableOptions) SetID(id string) *GetSubnetRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceGroupReferenceDeleted unmarshals an instance of InstanceGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetSubnetRoutingTableOptions) SetHeaders(param map[string]string) *GetSubnetRoutingTableOptions { + options.Headers = param + return options } -// InstanceInitialization : InstanceInitialization struct -type InstanceInitialization struct { - // The public SSH keys used at instance initialization. - Keys []KeyReference `json:"keys" validate:"required"` +// GetVolumeOptions : The GetVolume options. +type GetVolumeOptions struct { + // The volume identifier. + ID *string `json:"id" validate:"required,ne="` - Password *InstanceInitializationPassword `json:"password,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceInitialization unmarshals an instance of InstanceInitialization from the specified map of raw messages. -func UnmarshalInstanceInitialization(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitialization) - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "password", &obj.Password, UnmarshalInstanceInitializationPassword) - if err != nil { - return +// NewGetVolumeOptions : Instantiate GetVolumeOptions +func (*VpcV1) NewGetVolumeOptions(id string) *GetVolumeOptions { + return &GetVolumeOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceInitializationPassword : InstanceInitializationPassword struct -type InstanceInitializationPassword struct { - // The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. - EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetVolumeOptions) SetID(id string) *GetVolumeOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The public SSH key used to encrypt the administrator password. - EncryptionKey *KeyIdentityByFingerprint `json:"encryption_key" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetVolumeOptions) SetHeaders(param map[string]string) *GetVolumeOptions { + options.Headers = param + return options } -// UnmarshalInstanceInitializationPassword unmarshals an instance of InstanceInitializationPassword from the specified map of raw messages. -func UnmarshalInstanceInitializationPassword(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceInitializationPassword) - err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyIdentityByFingerprint) - if err != nil { - return +// GetVolumeProfileOptions : The GetVolumeProfile options. +type GetVolumeProfileOptions struct { + // The volume profile name. + Name *string `json:"name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetVolumeProfileOptions : Instantiate GetVolumeProfileOptions +func (*VpcV1) NewGetVolumeProfileOptions(name string) *GetVolumeProfileOptions { + return &GetVolumeProfileOptions{ + Name: core.StringPtr(name), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstancePatch : InstancePatch struct -type InstancePatch struct { - // The user-defined name for this virtual server instance (and default system hostname). - Name *string `json:"name,omitempty"` - - // The profile to use for this virtual server instance. For the profile to be changed, - // the instance `status` must be `stopping` or `stopped`. In addition, the requested - // profile must: - // - Have matching instance disk support. Any disks associated with the current profile - // will be deleted, and any disks associated with the requested profile will be - // created. - // - Be compatible with any `placement_target` constraints. For example, if the - // instance is placed on a dedicated host, the requested profile `family` must be - // the same as the dedicated host `family`. - Profile InstancePatchProfileIntf `json:"profile,omitempty"` +// SetName : Allow user to set Name +func (_options *GetVolumeProfileOptions) SetName(name string) *GetVolumeProfileOptions { + _options.Name = core.StringPtr(name) + return _options +} - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetVolumeProfileOptions) SetHeaders(param map[string]string) *GetVolumeProfileOptions { + options.Headers = param + return options } -// UnmarshalInstancePatch unmarshals an instance of InstancePatch from the specified map of raw messages. -func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstancePatchProfile) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// GetVPCAddressPrefixOptions : The GetVPCAddressPrefix options. +type GetVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The prefix identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// AsPatch returns a generic map representation of the InstancePatch -func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instancePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// NewGetVPCAddressPrefixOptions : Instantiate GetVPCAddressPrefixOptions +func (*VpcV1) NewGetVPCAddressPrefixOptions(vpcID string, id string) *GetVPCAddressPrefixOptions { + return &GetVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), } - return } -// InstancePatchProfile : The profile to use for this virtual server instance. For the profile to be changed, the instance `status` must be -// `stopping` or `stopped`. In addition, the requested profile must: -// - Have matching instance disk support. Any disks associated with the current profile -// will be deleted, and any disks associated with the requested profile will be -// created. -// - Be compatible with any `placement_target` constraints. For example, if the -// instance is placed on a dedicated host, the requested profile `family` must be -// the same as the dedicated host `family`. -// Models which "extend" this model: -// - InstancePatchProfileInstanceProfileIdentityByName -// - InstancePatchProfileInstanceProfileIdentityByHref -type InstancePatchProfile struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCAddressPrefixOptions) SetVPCID(vpcID string) *GetVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *GetVPCAddressPrefixOptions) SetID(id string) *GetVPCAddressPrefixOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*InstancePatchProfile) isaInstancePatchProfile() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetVPCAddressPrefixOptions) SetHeaders(param map[string]string) *GetVPCAddressPrefixOptions { + options.Headers = param + return options } -type InstancePatchProfileIntf interface { - isaInstancePatchProfile() bool +// GetVPCDefaultNetworkACLOptions : The GetVPCDefaultNetworkACL options. +type GetVPCDefaultNetworkACLOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstancePatchProfile unmarshals an instance of InstancePatchProfile from the specified map of raw messages. -func UnmarshalInstancePatchProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePatchProfile) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewGetVPCDefaultNetworkACLOptions : Instantiate GetVPCDefaultNetworkACLOptions +func (*VpcV1) NewGetVPCDefaultNetworkACLOptions(id string) *GetVPCDefaultNetworkACLOptions { + return &GetVPCDefaultNetworkACLOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstancePlacementTarget : InstancePlacementTarget struct -// Models which "extend" this model: -// - InstancePlacementTargetDedicatedHostGroupReference -// - InstancePlacementTargetDedicatedHostReference -// - InstancePlacementTargetPlacementGroupReference -type InstancePlacementTarget struct { - // The CRN for this dedicated host group. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *GetVPCDefaultNetworkACLOptions) SetID(id string) *GetVPCDefaultNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this dedicated host group. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetVPCDefaultNetworkACLOptions) SetHeaders(param map[string]string) *GetVPCDefaultNetworkACLOptions { + options.Headers = param + return options +} - // The unique identifier for this dedicated host group. - ID *string `json:"id,omitempty"` +// GetVPCDefaultRoutingTableOptions : The GetVPCDefaultRoutingTable options. +type GetVPCDefaultRoutingTableOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique user-defined name for this dedicated host group. - Name *string `json:"name,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` +// NewGetVPCDefaultRoutingTableOptions : Instantiate GetVPCDefaultRoutingTableOptions +func (*VpcV1) NewGetVPCDefaultRoutingTableOptions(id string) *GetVPCDefaultRoutingTableOptions { + return &GetVPCDefaultRoutingTableOptions{ + ID: core.StringPtr(id), + } } -// Constants associated with the InstancePlacementTarget.ResourceType property. -// The resource type. -const ( - InstancePlacementTargetResourceTypeDedicatedHostGroupConst = "dedicated_host_group" -) +// SetID : Allow user to set ID +func (_options *GetVPCDefaultRoutingTableOptions) SetID(id string) *GetVPCDefaultRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options +} -func (*InstancePlacementTarget) isaInstancePlacementTarget() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetVPCDefaultRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCDefaultRoutingTableOptions { + options.Headers = param + return options } -type InstancePlacementTargetIntf interface { - isaInstancePlacementTarget() bool +// GetVPCDefaultSecurityGroupOptions : The GetVPCDefaultSecurityGroup options. +type GetVPCDefaultSecurityGroupOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstancePlacementTarget unmarshals an instance of InstancePlacementTarget from the specified map of raw messages. -func UnmarshalInstancePlacementTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewGetVPCDefaultSecurityGroupOptions : Instantiate GetVPCDefaultSecurityGroupOptions +func (*VpcV1) NewGetVPCDefaultSecurityGroupOptions(id string) *GetVPCDefaultSecurityGroupOptions { + return &GetVPCDefaultSecurityGroupOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstancePlacementTargetPrototype : InstancePlacementTargetPrototype struct -// Models which "extend" this model: -// - InstancePlacementTargetPrototypeDedicatedHostIdentity -// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentity -// - InstancePlacementTargetPrototypePlacementGroupIdentity -type InstancePlacementTargetPrototype struct { - // The unique identifier for this dedicated host. - ID *string `json:"id,omitempty"` - - // The CRN for this dedicated host. - CRN *string `json:"crn,omitempty"` - - // The URL for this dedicated host. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *GetVPCDefaultSecurityGroupOptions) SetID(id string) *GetVPCDefaultSecurityGroupOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*InstancePlacementTargetPrototype) isaInstancePlacementTargetPrototype() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetVPCDefaultSecurityGroupOptions) SetHeaders(param map[string]string) *GetVPCDefaultSecurityGroupOptions { + options.Headers = param + return options } -type InstancePlacementTargetPrototypeIntf interface { - isaInstancePlacementTargetPrototype() bool +// GetVPCOptions : The GetVPC options. +type GetVPCOptions struct { + // The VPC identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstancePlacementTargetPrototype unmarshals an instance of InstancePlacementTargetPrototype from the specified map of raw messages. -func UnmarshalInstancePlacementTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePlacementTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewGetVPCOptions : Instantiate GetVPCOptions +func (*VpcV1) NewGetVPCOptions(id string) *GetVPCOptions { + return &GetVPCOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceProfile : InstanceProfile struct -type InstanceProfile struct { - Bandwidth InstanceProfileBandwidthIntf `json:"bandwidth" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetVPCOptions) SetID(id string) *GetVPCOptions { + _options.ID = core.StringPtr(id) + return _options +} - // Collection of the instance profile's disks. - Disks []InstanceProfileDisk `json:"disks" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetVPCOptions) SetHeaders(param map[string]string) *GetVPCOptions { + options.Headers = param + return options +} - // The product family this virtual server instance profile belongs to. - Family *string `json:"family,omitempty"` +// GetVPCRouteOptions : The GetVPCRoute options. +type GetVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - GpuCount InstanceProfileGpuIntf `json:"gpu_count,omitempty"` + // The route identifier. + ID *string `json:"id" validate:"required,ne="` - GpuManufacturer *InstanceProfileGpuManufacturer `json:"gpu_manufacturer,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - GpuMemory InstanceProfileGpuMemoryIntf `json:"gpu_memory,omitempty"` +// NewGetVPCRouteOptions : Instantiate GetVPCRouteOptions +func (*VpcV1) NewGetVPCRouteOptions(vpcID string, id string) *GetVPCRouteOptions { + return &GetVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + } +} - GpuModel *InstanceProfileGpuModel `json:"gpu_model,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCRouteOptions) SetVPCID(vpcID string) *GetVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The URL for this virtual server instance profile. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetVPCRouteOptions) SetID(id string) *GetVPCRouteOptions { + _options.ID = core.StringPtr(id) + return _options +} - Memory InstanceProfileMemoryIntf `json:"memory" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetVPCRouteOptions) SetHeaders(param map[string]string) *GetVPCRouteOptions { + options.Headers = param + return options +} - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` +// GetVPCRoutingTableOptions : The GetVPCRoutingTable options. +type GetVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - OsArchitecture *InstanceProfileOsArchitecture `json:"os_architecture" validate:"required"` + // The routing table identifier. + ID *string `json:"id" validate:"required,ne="` - PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` +// NewGetVPCRoutingTableOptions : Instantiate GetVPCRoutingTableOptions +func (*VpcV1) NewGetVPCRoutingTableOptions(vpcID string, id string) *GetVPCRoutingTableOptions { + return &GetVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + } +} - VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCRoutingTableOptions) SetVPCID(vpcID string) *GetVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` +// SetID : Allow user to set ID +func (_options *GetVPCRoutingTableOptions) SetID(id string) *GetVPCRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalInstanceProfile unmarshals an instance of InstanceProfile from the specified map of raw messages. -func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfile) - err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalInstanceProfileBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceProfileDisk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_count", &obj.GpuCount, UnmarshalInstanceProfileGpu) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_manufacturer", &obj.GpuManufacturer, UnmarshalInstanceProfileGpuManufacturer) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_memory", &obj.GpuMemory, UnmarshalInstanceProfileGpuMemory) - if err != nil { - return - } - err = core.UnmarshalModel(m, "gpu_model", &obj.GpuModel, UnmarshalInstanceProfileGpuModel) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalInstanceProfileMemory) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalInstanceProfileOsArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "port_speed", &obj.PortSpeed, UnmarshalInstanceProfilePortSpeed) - if err != nil { - return - } - err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalInstanceProfileVcpuArchitecture) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalInstanceProfileVcpu) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *GetVPCRoutingTableOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableOptions { + options.Headers = param + return options } -// InstanceProfileBandwidth : InstanceProfileBandwidth struct -// Models which "extend" this model: -// - InstanceProfileBandwidthFixed -// - InstanceProfileBandwidthRange -// - InstanceProfileBandwidthEnum -// - InstanceProfileBandwidthDependent -type InstanceProfileBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// GetVPCRoutingTableRouteOptions : The GetVPCRoutingTableRoute options. +type GetVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The VPC routing table route identifier. + ID *string `json:"id" validate:"required,ne="` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// NewGetVPCRoutingTableRouteOptions : Instantiate GetVPCRoutingTableRouteOptions +func (*VpcV1) NewGetVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string) *GetVPCRoutingTableRouteOptions { + return &GetVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + ID: core.StringPtr(id), + } +} - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` +// SetVPCID : Allow user to set VPCID +func (_options *GetVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *GetVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *GetVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *GetVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options } -// Constants associated with the InstanceProfileBandwidth.Type property. -// The type for this profile field. -const ( - InstanceProfileBandwidthTypeFixedConst = "fixed" -) +// SetID : Allow user to set ID +func (_options *GetVPCRoutingTableRouteOptions) SetID(id string) *GetVPCRoutingTableRouteOptions { + _options.ID = core.StringPtr(id) + return _options +} -func (*InstanceProfileBandwidth) isaInstanceProfileBandwidth() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *GetVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *GetVPCRoutingTableRouteOptions { + options.Headers = param + return options } -type InstanceProfileBandwidthIntf interface { - isaInstanceProfileBandwidth() bool +// GetVPNGatewayConnectionOptions : The GetVPNGatewayConnection options. +type GetVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceProfileBandwidth unmarshals an instance of InstanceProfileBandwidth from the specified map of raw messages. -func UnmarshalInstanceProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) - if err != nil { - return +// NewGetVPNGatewayConnectionOptions : Instantiate GetVPNGatewayConnectionOptions +func (*VpcV1) NewGetVPNGatewayConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayConnectionOptions { + return &GetVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceProfileCollection : InstanceProfileCollection struct -type InstanceProfileCollection struct { - // Collection of virtual server instance profiles. - Profiles []InstanceProfile `json:"profiles" validate:"required"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *GetVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options } -// UnmarshalInstanceProfileCollection unmarshals an instance of InstanceProfileCollection from the specified map of raw messages. -func UnmarshalInstanceProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileCollection) - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalInstanceProfile) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *GetVPNGatewayConnectionOptions) SetID(id string) *GetVPNGatewayConnectionOptions { + _options.ID = core.StringPtr(id) + return _options } -// InstanceProfileDisk : Disks provided by this profile. -type InstanceProfileDisk struct { - Quantity InstanceProfileDiskQuantityIntf `json:"quantity" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *GetVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayConnectionOptions { + options.Headers = param + return options +} - Size InstanceProfileDiskSizeIntf `json:"size" validate:"required"` +// GetVPNGatewayOptions : The GetVPNGateway options. +type GetVPNGatewayOptions struct { + // The VPN gateway identifier. + ID *string `json:"id" validate:"required,ne="` - SupportedInterfaceTypes *InstanceProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalInstanceProfileDisk unmarshals an instance of InstanceProfileDisk from the specified map of raw messages. -func UnmarshalInstanceProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDisk) - err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalInstanceProfileDiskQuantity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalInstanceProfileDiskSize) - if err != nil { - return - } - err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalInstanceProfileDiskSupportedInterfaces) - if err != nil { - return +// NewGetVPNGatewayOptions : Instantiate GetVPNGatewayOptions +func (*VpcV1) NewGetVPNGatewayOptions(id string) *GetVPNGatewayOptions { + return &GetVPNGatewayOptions{ + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// InstanceProfileDiskQuantity : InstanceProfileDiskQuantity struct -// Models which "extend" this model: -// - InstanceProfileDiskQuantityFixed -// - InstanceProfileDiskQuantityRange -// - InstanceProfileDiskQuantityEnum -// - InstanceProfileDiskQuantityDependent -type InstanceProfileDiskQuantity struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// SetID : Allow user to set ID +func (_options *GetVPNGatewayOptions) SetID(id string) *GetVPNGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPNGatewayOptions { + options.Headers = param + return options +} - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// IkePolicy : IkePolicy struct +type IkePolicy struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The VPN gateway connections that use this IKE policy. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The date and time that this IKE policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The Diffie-Hellman group. + DhGroup *int64 `json:"dh_group" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + + // The IKE policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IKE policy. + ID *string `json:"id" validate:"required"` + + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version" validate:"required"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime" validate:"required"` + + // The user-defined name for this IKE policy. + Name *string `json:"name" validate:"required"` + + // The IKE negotiation mode. Only `main` is supported. + NegotiationMode *string `json:"negotiation_mode" validate:"required"` + + // The resource group for this IKE policy. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the InstanceProfileDiskQuantity.Type property. -// The type for this profile field. +// Constants associated with the IkePolicy.AuthenticationAlgorithm property. +// The authentication algorithm. const ( - InstanceProfileDiskQuantityTypeFixedConst = "fixed" + IkePolicyAuthenticationAlgorithmMd5Const = "md5" + IkePolicyAuthenticationAlgorithmSha1Const = "sha1" + IkePolicyAuthenticationAlgorithmSha256Const = "sha256" + IkePolicyAuthenticationAlgorithmSha512Const = "sha512" ) -func (*InstanceProfileDiskQuantity) isaInstanceProfileDiskQuantity() bool { - return true -} +// Constants associated with the IkePolicy.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + IkePolicyEncryptionAlgorithmAes128Const = "aes128" + IkePolicyEncryptionAlgorithmAes256Const = "aes256" + IkePolicyEncryptionAlgorithmTripleDesConst = "triple_des" +) -type InstanceProfileDiskQuantityIntf interface { - isaInstanceProfileDiskQuantity() bool -} +// Constants associated with the IkePolicy.NegotiationMode property. +// The IKE negotiation mode. Only `main` is supported. +const ( + IkePolicyNegotiationModeMainConst = "main" +) -// UnmarshalInstanceProfileDiskQuantity unmarshals an instance of InstanceProfileDiskQuantity from the specified map of raw messages. -func UnmarshalInstanceProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskQuantity) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// Constants associated with the IkePolicy.ResourceType property. +// The resource type. +const ( + IkePolicyResourceTypeIkePolicyConst = "ike_policy" +) + +// UnmarshalIkePolicy unmarshals an instance of IkePolicy from the specified map of raw messages. +func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicy) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileDiskSize : InstanceProfileDiskSize struct -// Models which "extend" this model: -// - InstanceProfileDiskSizeFixed -// - InstanceProfileDiskSizeRange -// - InstanceProfileDiskSizeEnum -// - InstanceProfileDiskSizeDependent -type InstanceProfileDiskSize struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileDiskSize.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSizeTypeFixedConst = "fixed" -) - -func (*InstanceProfileDiskSize) isaInstanceProfileDiskSize() bool { - return true -} - -type InstanceProfileDiskSizeIntf interface { - isaInstanceProfileDiskSize() bool -} - -// UnmarshalInstanceProfileDiskSize unmarshals an instance of InstanceProfileDiskSize from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSize) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "negotiation_mode", &obj.NegotiationMode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -32913,62 +32749,45 @@ func UnmarshalInstanceProfileDiskSize(m map[string]json.RawMessage, result inter return } -// InstanceProfileDiskSupportedInterfaces : InstanceProfileDiskSupportedInterfaces struct -type InstanceProfileDiskSupportedInterfaces struct { - // The disk interface used for attaching the disk. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected property value was encountered. - Default *string `json:"default" validate:"required"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// IkePolicyCollection : IkePolicyCollection struct +type IkePolicyCollection struct { + // A link to the first page of resources. + First *IkePolicyCollectionFirst `json:"first" validate:"required"` - // The supported disk interfaces used for attaching the disk. - Values []string `json:"values" validate:"required"` -} + // Collection of IKE policies. + IkePolicies []IkePolicy `json:"ike_policies" validate:"required"` -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Default property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" - InstanceProfileDiskSupportedInterfacesDefaultVirtioBlkConst = "virtio_blk" -) + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Type property. -// The type for this profile field. -const ( - InstanceProfileDiskSupportedInterfacesTypeEnumConst = "enum" -) + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *IkePolicyCollectionNext `json:"next,omitempty"` -// Constants associated with the InstanceProfileDiskSupportedInterfaces.Values property. -// The disk interface used for attaching the disk. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the -// unexpected property value was encountered. -const ( - InstanceProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" - InstanceProfileDiskSupportedInterfacesValuesVirtioBlkConst = "virtio_blk" -) + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} -// UnmarshalInstanceProfileDiskSupportedInterfaces unmarshals an instance of InstanceProfileDiskSupportedInterfaces from the specified map of raw messages. -func UnmarshalInstanceProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileDiskSupportedInterfaces) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalIkePolicyCollection unmarshals an instance of IkePolicyCollection from the specified map of raw messages. +func UnmarshalIkePolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIkePolicyCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "ike_policies", &obj.IkePolicies, UnmarshalIkePolicy) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIkePolicyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -32976,77 +32795,80 @@ func UnmarshalInstanceProfileDiskSupportedInterfaces(m map[string]json.RawMessag return } -// InstanceProfileGpu : InstanceProfileGpu struct -// Models which "extend" this model: -// - InstanceProfileGpuFixed -// - InstanceProfileGpuRange -// - InstanceProfileGpuEnum -// - InstanceProfileGpuDependent -type InstanceProfileGpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *IkePolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// IkePolicyPatch : IkePolicyPatch struct +type IkePolicyPatch struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The Diffie-Hellman group. + DhGroup *int64 `json:"dh_group,omitempty"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The user-defined name for this IKE policy. + Name *string `json:"name,omitempty"` } -// Constants associated with the InstanceProfileGpu.Type property. -// The type for this profile field. +// Constants associated with the IkePolicyPatch.AuthenticationAlgorithm property. +// The authentication algorithm. const ( - InstanceProfileGpuTypeFixedConst = "fixed" + IkePolicyPatchAuthenticationAlgorithmMd5Const = "md5" + IkePolicyPatchAuthenticationAlgorithmSha1Const = "sha1" + IkePolicyPatchAuthenticationAlgorithmSha256Const = "sha256" + IkePolicyPatchAuthenticationAlgorithmSha512Const = "sha512" ) -func (*InstanceProfileGpu) isaInstanceProfileGpu() bool { - return true -} - -type InstanceProfileGpuIntf interface { - isaInstanceProfileGpu() bool -} +// Constants associated with the IkePolicyPatch.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + IkePolicyPatchEncryptionAlgorithmAes128Const = "aes128" + IkePolicyPatchEncryptionAlgorithmAes256Const = "aes256" + IkePolicyPatchEncryptionAlgorithmTripleDesConst = "triple_des" +) -// UnmarshalInstanceProfileGpu unmarshals an instance of InstanceProfileGpu from the specified map of raw messages. -func UnmarshalInstanceProfileGpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalIkePolicyPatch unmarshals an instance of IkePolicyPatch from the specified map of raw messages. +func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyPatch) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -33054,29 +32876,61 @@ func UnmarshalInstanceProfileGpu(m map[string]json.RawMessage, result interface{ return } -// InstanceProfileGpuManufacturer : InstanceProfileGpuManufacturer struct -type InstanceProfileGpuManufacturer struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// AsPatch returns a generic map representation of the IkePolicyPatch +func (ikePolicyPatch *IkePolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(ikePolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The possible GPU manufacturer(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` +// IkePolicyReference : IkePolicyReference struct +type IkePolicyReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *IkePolicyReferenceDeleted `json:"deleted,omitempty"` + + // The IKE policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IKE policy. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this IKE policy. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the InstanceProfileGpuManufacturer.Type property. -// The type for this profile field. +// Constants associated with the IkePolicyReference.ResourceType property. +// The resource type. const ( - InstanceProfileGpuManufacturerTypeEnumConst = "enum" + IkePolicyReferenceResourceTypeIkePolicyConst = "ike_policy" ) -// UnmarshalInstanceProfileGpuManufacturer unmarshals an instance of InstanceProfileGpuManufacturer from the specified map of raw messages. -func UnmarshalInstanceProfileGpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuManufacturer) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalIkePolicyReference unmarshals an instance of IkePolicyReference from the specified map of raw messages. +func UnmarshalIkePolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIkePolicyReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -33084,77 +32938,166 @@ func UnmarshalInstanceProfileGpuManufacturer(m map[string]json.RawMessage, resul return } -// InstanceProfileGpuMemory : InstanceProfileGpuMemory struct -// Models which "extend" this model: -// - InstanceProfileGpuMemoryFixed -// - InstanceProfileGpuMemoryRange -// - InstanceProfileGpuMemoryEnum -// - InstanceProfileGpuMemoryDependent -type InstanceProfileGpuMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// IP : IP struct +type IP struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` +} - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` +// UnmarshalIP unmarshals an instance of IP from the specified map of raw messages. +func UnmarshalIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` +// IPsecPolicy : IPsecPolicy struct +type IPsecPolicy struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The VPN gateway connections that use this IPsec policy. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The date and time that this IPsec policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The encapsulation mode used. Only `tunnel` is supported. + EncapsulationMode *string `json:"encapsulation_mode" validate:"required"` + + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + + // The IPsec policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IPsec policy. + ID *string `json:"id" validate:"required"` + + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime" validate:"required"` + + // The user-defined name for this IPsec policy. + Name *string `json:"name" validate:"required"` + + // Perfect Forward Secrecy. + Pfs *string `json:"pfs" validate:"required"` + + // The resource group for this IPsec policy. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The transform protocol used. Only `esp` is supported. + TransformProtocol *string `json:"transform_protocol" validate:"required"` } -// Constants associated with the InstanceProfileGpuMemory.Type property. -// The type for this profile field. +// Constants associated with the IPsecPolicy.AuthenticationAlgorithm property. +// The authentication algorithm. const ( - InstanceProfileGpuMemoryTypeFixedConst = "fixed" + IPsecPolicyAuthenticationAlgorithmMd5Const = "md5" + IPsecPolicyAuthenticationAlgorithmSha1Const = "sha1" + IPsecPolicyAuthenticationAlgorithmSha256Const = "sha256" + IPsecPolicyAuthenticationAlgorithmSha512Const = "sha512" ) -func (*InstanceProfileGpuMemory) isaInstanceProfileGpuMemory() bool { - return true -} +// Constants associated with the IPsecPolicy.EncapsulationMode property. +// The encapsulation mode used. Only `tunnel` is supported. +const ( + IPsecPolicyEncapsulationModeTunnelConst = "tunnel" +) -type InstanceProfileGpuMemoryIntf interface { - isaInstanceProfileGpuMemory() bool -} +// Constants associated with the IPsecPolicy.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + IPsecPolicyEncryptionAlgorithmAes128Const = "aes128" + IPsecPolicyEncryptionAlgorithmAes256Const = "aes256" + IPsecPolicyEncryptionAlgorithmTripleDesConst = "triple_des" +) -// UnmarshalInstanceProfileGpuMemory unmarshals an instance of InstanceProfileGpuMemory from the specified map of raw messages. -func UnmarshalInstanceProfileGpuMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// Constants associated with the IPsecPolicy.Pfs property. +// Perfect Forward Secrecy. +const ( + IPsecPolicyPfsDisabledConst = "disabled" + IPsecPolicyPfsGroup14Const = "group_14" + IPsecPolicyPfsGroup19Const = "group_19" + IPsecPolicyPfsGroup2Const = "group_2" + IPsecPolicyPfsGroup5Const = "group_5" +) + +// Constants associated with the IPsecPolicy.ResourceType property. +// The resource type. +const ( + IPsecPolicyResourceTypeIpsecPolicyConst = "ipsec_policy" +) + +// Constants associated with the IPsecPolicy.TransformProtocol property. +// The transform protocol used. Only `esp` is supported. +const ( + IPsecPolicyTransformProtocolEspConst = "esp" +) + +// UnmarshalIPsecPolicy unmarshals an instance of IPsecPolicy from the specified map of raw messages. +func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicy) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "encapsulation_mode", &obj.EncapsulationMode) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "transform_protocol", &obj.TransformProtocol) if err != nil { return } @@ -33162,29 +33105,45 @@ func UnmarshalInstanceProfileGpuMemory(m map[string]json.RawMessage, result inte return } -// InstanceProfileGpuModel : InstanceProfileGpuModel struct -type InstanceProfileGpuModel struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// IPsecPolicyCollection : IPsecPolicyCollection struct +type IPsecPolicyCollection struct { + // A link to the first page of resources. + First *IPsecPolicyCollectionFirst `json:"first" validate:"required"` - // The possible GPU model(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` -} + // Collection of IPsec policies. + IpsecPolicies []IPsecPolicy `json:"ipsec_policies" validate:"required"` -// Constants associated with the InstanceProfileGpuModel.Type property. -// The type for this profile field. -const ( - InstanceProfileGpuModelTypeEnumConst = "enum" -) + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// UnmarshalInstanceProfileGpuModel unmarshals an instance of InstanceProfileGpuModel from the specified map of raw messages. -func UnmarshalInstanceProfileGpuModel(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileGpuModel) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *IPsecPolicyCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalIPsecPolicyCollection unmarshals an instance of IPsecPolicyCollection from the specified map of raw messages. +func UnmarshalIPsecPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalIPsecPolicyCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "ipsec_policies", &obj.IpsecPolicies, UnmarshalIPsecPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalIPsecPolicyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -33192,33 +33151,44 @@ func UnmarshalInstanceProfileGpuModel(m map[string]json.RawMessage, result inter return } -// InstanceProfileIdentity : Identifies an instance profile by a unique property. -// Models which "extend" this model: -// - InstanceProfileIdentityByName -// - InstanceProfileIdentityByHref -type InstanceProfileIdentity struct { - // The globally unique name for this virtual server instance profile. - Name *string `json:"name,omitempty"` - - // The URL for this virtual server instance profile. - Href *string `json:"href,omitempty"` -} - -func (*InstanceProfileIdentity) isaInstanceProfileIdentity() bool { - return true +// Retrieve the value to be passed to a request to access the next page of results +func (resp *IPsecPolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -type InstanceProfileIdentityIntf interface { - isaInstanceProfileIdentity() bool +// IPsecPolicyCollectionFirst : A link to the first page of resources. +type IPsecPolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalInstanceProfileIdentity unmarshals an instance of InstanceProfileIdentity from the specified map of raw messages. -func UnmarshalInstanceProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalIPsecPolicyCollectionFirst unmarshals an instance of IPsecPolicyCollectionFirst from the specified map of raw messages. +func UnmarshalIPsecPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IPsecPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type IPsecPolicyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalIPsecPolicyCollectionNext unmarshals an instance of IPsecPolicyCollectionNext from the specified map of raw messages. +func UnmarshalIPsecPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -33227,77 +33197,71 @@ func UnmarshalInstanceProfileIdentity(m map[string]json.RawMessage, result inter return } -// InstanceProfileMemory : InstanceProfileMemory struct -// Models which "extend" this model: -// - InstanceProfileMemoryFixed -// - InstanceProfileMemoryRange -// - InstanceProfileMemoryEnum -// - InstanceProfileMemoryDependent -type InstanceProfileMemory struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` +// IPsecPolicyPatch : IPsecPolicyPatch struct +type IPsecPolicyPatch struct { + // The authentication algorithm. + AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The encryption algorithm. + EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // The key lifetime in seconds. + KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The user-defined name for this IPsec policy. + Name *string `json:"name,omitempty"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // Perfect Forward Secrecy. + Pfs *string `json:"pfs,omitempty"` } -// Constants associated with the InstanceProfileMemory.Type property. -// The type for this profile field. +// Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithm property. +// The authentication algorithm. const ( - InstanceProfileMemoryTypeFixedConst = "fixed" + IPsecPolicyPatchAuthenticationAlgorithmMd5Const = "md5" + IPsecPolicyPatchAuthenticationAlgorithmSha1Const = "sha1" + IPsecPolicyPatchAuthenticationAlgorithmSha256Const = "sha256" + IPsecPolicyPatchAuthenticationAlgorithmSha512Const = "sha512" ) -func (*InstanceProfileMemory) isaInstanceProfileMemory() bool { - return true -} +// Constants associated with the IPsecPolicyPatch.EncryptionAlgorithm property. +// The encryption algorithm. +const ( + IPsecPolicyPatchEncryptionAlgorithmAes128Const = "aes128" + IPsecPolicyPatchEncryptionAlgorithmAes256Const = "aes256" + IPsecPolicyPatchEncryptionAlgorithmTripleDesConst = "triple_des" +) -type InstanceProfileMemoryIntf interface { - isaInstanceProfileMemory() bool -} +// Constants associated with the IPsecPolicyPatch.Pfs property. +// Perfect Forward Secrecy. +const ( + IPsecPolicyPatchPfsDisabledConst = "disabled" + IPsecPolicyPatchPfsGroup14Const = "group_14" + IPsecPolicyPatchPfsGroup19Const = "group_19" + IPsecPolicyPatchPfsGroup2Const = "group_2" + IPsecPolicyPatchPfsGroup5Const = "group_5" +) -// UnmarshalInstanceProfileMemory unmarshals an instance of InstanceProfileMemory from the specified map of raw messages. -func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileMemory) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalIPsecPolicyPatch unmarshals an instance of IPsecPolicyPatch from the specified map of raw messages. +func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyPatch) + err = core.UnmarshalPrimitive(m, "authentication_algorithm", &obj.AuthenticationAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "pfs", &obj.Pfs) if err != nil { return } @@ -33305,36 +33269,61 @@ func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interfa return } -// InstanceProfileOsArchitecture : InstanceProfileOsArchitecture struct -type InstanceProfileOsArchitecture struct { - // The default OS architecture for an instance with this profile. - Default *string `json:"default" validate:"required"` +// AsPatch returns a generic map representation of the IPsecPolicyPatch +func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(iPsecPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The type for this profile field. - Type *string `json:"type" validate:"required"` +// IPsecPolicyReference : IPsecPolicyReference struct +type IPsecPolicyReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *IPsecPolicyReferenceDeleted `json:"deleted,omitempty"` - // The supported OS architecture(s) for an instance with this profile. - Values []string `json:"values" validate:"required"` + // The IPsec policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this IPsec policy. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this IPsec policy. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the InstanceProfileOsArchitecture.Type property. -// The type for this profile field. +// Constants associated with the IPsecPolicyReference.ResourceType property. +// The resource type. const ( - InstanceProfileOsArchitectureTypeEnumConst = "enum" + IPsecPolicyReferenceResourceTypeIpsecPolicyConst = "ipsec_policy" ) -// UnmarshalInstanceProfileOsArchitecture unmarshals an instance of InstanceProfileOsArchitecture from the specified map of raw messages. -func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileOsArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalIPsecPolicyReference unmarshals an instance of IPsecPolicyReference from the specified map of raw messages. +func UnmarshalIPsecPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalIPsecPolicyReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -33342,40 +33331,34 @@ func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result return } -// InstanceProfilePortSpeed : InstanceProfilePortSpeed struct -// Models which "extend" this model: -// - InstanceProfilePortSpeedFixed -// - InstanceProfilePortSpeedDependent -type InstanceProfilePortSpeed struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` +// IPsecPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type IPsecPolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// Constants associated with the InstanceProfilePortSpeed.Type property. -// The type for this profile field. -const ( - InstanceProfilePortSpeedTypeFixedConst = "fixed" -) - -func (*InstanceProfilePortSpeed) isaInstanceProfilePortSpeed() bool { - return true +// UnmarshalIPsecPolicyReferenceDeleted unmarshals an instance of IPsecPolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalIPsecPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IPsecPolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type InstanceProfilePortSpeedIntf interface { - isaInstanceProfilePortSpeed() bool +// IkePolicyCollectionFirst : A link to the first page of resources. +type IkePolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalInstanceProfilePortSpeed unmarshals an instance of InstanceProfilePortSpeed from the specified map of raw messages. -func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfilePortSpeed) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) +// UnmarshalIkePolicyCollectionFirst unmarshals an instance of IkePolicyCollectionFirst from the specified map of raw messages. +func UnmarshalIkePolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -33383,23 +33366,34 @@ func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result inte return } -// InstanceProfileReference : InstanceProfileReference struct -type InstanceProfileReference struct { - // The URL for this virtual server instance profile. +// IkePolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type IkePolicyCollectionNext struct { + // The URL for a page of resources. Href *string `json:"href" validate:"required"` - - // The globally unique name for this virtual server instance profile. - Name *string `json:"name" validate:"required"` } -// UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. -func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileReference) +// UnmarshalIkePolicyCollectionNext unmarshals an instance of IkePolicyCollectionNext from the specified map of raw messages. +func UnmarshalIkePolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IkePolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type IkePolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalIkePolicyReferenceDeleted unmarshals an instance of IkePolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalIkePolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IkePolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -33407,192 +33401,178 @@ func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result inte return } -// InstanceProfileVcpu : InstanceProfileVcpu struct -// Models which "extend" this model: -// - InstanceProfileVcpuFixed -// - InstanceProfileVcpuRange -// - InstanceProfileVcpuEnum -// - InstanceProfileVcpuDependent -type InstanceProfileVcpu struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// Image : Image struct +type Image struct { + // The date and time that the image was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The value for this profile field. - Value *int64 `json:"value,omitempty"` + // The CRN for this image. + CRN *string `json:"crn" validate:"required"` - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` + // The type of encryption used on the image. + Encryption *string `json:"encryption" validate:"required"` - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` + // The key that will be used to encrypt volumes created from this image (unless an + // alternate `encryption_key` is specified at volume creation). + // + // This property will be present for images with an `encryption` type of `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` + // Details for the stored image file. + File *ImageFile `json:"file" validate:"required"` - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` + // The URL for this image. + Href *string `json:"href" validate:"required"` - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` + // The unique identifier for this image. + ID *string `json:"id" validate:"required"` + + // The minimum size (in gigabytes) of a volume onto which this image may be provisioned. + // + // This property may be absent if the image has a `status` of `pending`, `tentative`, or + // `failed`. + MinimumProvisionedSize *int64 `json:"minimum_provisioned_size,omitempty"` + + // The user-defined or system-provided name for this image. + Name *string `json:"name" validate:"required"` + + // The operating system included in this image. + OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` + + // The resource group for this image. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The volume used to create this image (this may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + // If absent, this image was not created from a volume. + SourceVolume *VolumeReference `json:"source_volume,omitempty"` + + // The status of this image + // - available: image can be used (provisionable) + // - deleting: image is being deleted, and can no longer be used to provision new + // resources + // - deprecated: image can be used, but is slated to become `obsolete` (provisionable) + // - failed: image is corrupt or did not pass validation + // - obsolete: image can no longer be used to provision new resources + // - pending: image is being imported and is not yet `available` + // - tentative: image import has timed out (contact support) + // - unusable: image cannot be used (see `status_reasons[]` for possible remediation) + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the + // unexpected property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ImageStatusReason `json:"status_reasons" validate:"required"` + + // Whether the image is publicly visible or private to the account. + Visibility *string `json:"visibility" validate:"required"` } -// Constants associated with the InstanceProfileVcpu.Type property. -// The type for this profile field. +// Constants associated with the Image.Encryption property. +// The type of encryption used on the image. const ( - InstanceProfileVcpuTypeFixedConst = "fixed" + ImageEncryptionNoneConst = "none" + ImageEncryptionUserManagedConst = "user_managed" ) -func (*InstanceProfileVcpu) isaInstanceProfileVcpu() bool { - return true -} +// Constants associated with the Image.Status property. +// The status of this image +// - available: image can be used (provisionable) +// - deleting: image is being deleted, and can no longer be used to provision new +// resources +// - deprecated: image can be used, but is slated to become `obsolete` (provisionable) +// - failed: image is corrupt or did not pass validation +// - obsolete: image can no longer be used to provision new resources +// - pending: image is being imported and is not yet `available` +// - tentative: image import has timed out (contact support) +// - unusable: image cannot be used (see `status_reasons[]` for possible remediation) +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the image on which the +// unexpected property value was encountered. +const ( + ImageStatusAvailableConst = "available" + ImageStatusDeletingConst = "deleting" + ImageStatusDeprecatedConst = "deprecated" + ImageStatusFailedConst = "failed" + ImageStatusPendingConst = "pending" + ImageStatusTentativeConst = "tentative" + ImageStatusUnusableConst = "unusable" +) -type InstanceProfileVcpuIntf interface { - isaInstanceProfileVcpu() bool -} +// Constants associated with the Image.Visibility property. +// Whether the image is publicly visible or private to the account. +const ( + ImageVisibilityPrivateConst = "private" + ImageVisibilityPublicConst = "public" +) -// UnmarshalInstanceProfileVcpu unmarshals an instance of InstanceProfileVcpu from the specified map of raw messages. -func UnmarshalInstanceProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpu) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) +// UnmarshalImage unmarshals an instance of Image from the specified map of raw messages. +func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Image) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFile) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVcpuArchitecture : InstanceProfileVcpuArchitecture struct -type InstanceProfileVcpuArchitecture struct { - // The default VCPU architecture for an instance with this profile. - Default *string `json:"default,omitempty"` - - // The type for this profile field. - Type *string `json:"type" validate:"required"` - - // The VCPU architecture for an instance with this profile. - Value *string `json:"value" validate:"required"` -} - -// Constants associated with the InstanceProfileVcpuArchitecture.Type property. -// The type for this profile field. -const ( - InstanceProfileVcpuArchitectureTypeFixedConst = "fixed" -) - -// UnmarshalInstanceProfileVcpuArchitecture unmarshals an instance of InstanceProfileVcpuArchitecture from the specified map of raw messages. -func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVcpuArchitecture) - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "minimum_provisioned_size", &obj.MinimumProvisionedSize) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceProfileVolumeBandwidth : InstanceProfileVolumeBandwidth struct -// Models which "extend" this model: -// - InstanceProfileVolumeBandwidthFixed -// - InstanceProfileVolumeBandwidthRange -// - InstanceProfileVolumeBandwidthEnum -// - InstanceProfileVolumeBandwidthDependent -type InstanceProfileVolumeBandwidth struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *int64 `json:"value,omitempty"` - - // The default value for this profile field. - Default *int64 `json:"default,omitempty"` - - // The maximum value for this profile field. - Max *int64 `json:"max,omitempty"` - - // The minimum value for this profile field. - Min *int64 `json:"min,omitempty"` - - // The increment step value for this profile field. - Step *int64 `json:"step,omitempty"` - - // The permitted values for this profile field. - Values []int64 `json:"values,omitempty"` -} - -// Constants associated with the InstanceProfileVolumeBandwidth.Type property. -// The type for this profile field. -const ( - InstanceProfileVolumeBandwidthTypeFixedConst = "fixed" -) - -func (*InstanceProfileVolumeBandwidth) isaInstanceProfileVolumeBandwidth() bool { - return true -} - -type InstanceProfileVolumeBandwidthIntf interface { - isaInstanceProfileVolumeBandwidth() bool -} - -// UnmarshalInstanceProfileVolumeBandwidth unmarshals an instance of InstanceProfileVolumeBandwidth from the specified map of raw messages. -func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceProfileVolumeBandwidth) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) if err != nil { return } - err = core.UnmarshalPrimitive(m, "default", &obj.Default) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "max", &obj.Max) + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "min", &obj.Min) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "step", &obj.Step) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalImageStatusReason) if err != nil { return } - err = core.UnmarshalPrimitive(m, "values", &obj.Values) + err = core.UnmarshalPrimitive(m, "visibility", &obj.Visibility) if err != nil { return } @@ -33600,142 +33580,157 @@ func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, resul return } -// InstancePrototype : InstancePrototype struct -// Models which "extend" this model: -// - InstancePrototypeInstanceByImage -// - InstancePrototypeInstanceByVolume -// - InstancePrototypeInstanceBySourceTemplate -type InstancePrototype struct { - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The additional network interfaces to create for the virtual server instance. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The profile to use for this virtual server instance. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // User data to be made available when setting up the virtual server instance. - UserData *string `json:"user_data,omitempty"` - - // The volume attachments for this virtual server instance. - VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` - - // The VPC the virtual server instance is to be a part of. If specified, it must match - // the VPC referenced by the subnets of the instance's network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` - - // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` +// ImageCollection : ImageCollection struct +type ImageCollection struct { + // A link to the first page of resources. + First *ImageCollectionFirst `json:"first" validate:"required"` - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` -} + // Collection of images. + Images []Image `json:"images" validate:"required"` -func (*InstancePrototype) isaInstancePrototype() bool { - return true -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -type InstancePrototypeIntf interface { - isaInstancePrototype() bool + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ImageCollectionNext `json:"next,omitempty"` } -// UnmarshalInstancePrototype unmarshals an instance of InstancePrototype from the specified map of raw messages. -func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstancePrototype) - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) +// UnmarshalImageCollection unmarshals an instance of ImageCollection from the specified map of raw messages. +func UnmarshalImageCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalImageCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalModel(m, "images", &obj.Images, UnmarshalImage) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalImageCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ImageCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) + return start, nil +} + +// ImageCollectionFirst : A link to the first page of resources. +type ImageCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalImageCollectionFirst unmarshals an instance of ImageCollectionFirst from the specified map of raw messages. +func UnmarshalImageCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ImageCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalImageCollectionNext unmarshals an instance of ImageCollectionNext from the specified map of raw messages. +func UnmarshalImageCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageFile : ImageFile struct +type ImageFile struct { + // Checksums for this image file. + // + // This property may be absent if the associated image has a `status` of `pending` or + // `failed`. + Checksums *ImageFileChecksums `json:"checksums,omitempty"` + + // The size of the stored image file rounded up to the next gigabyte. + // + // This property may be absent if the associated image has a `status` of `pending` or + // `failed`. + Size *int64 `json:"size,omitempty"` +} + +// UnmarshalImageFile unmarshals an instance of ImageFile from the specified map of raw messages. +func UnmarshalImageFile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageFile) + err = core.UnmarshalModel(m, "checksums", &obj.Checksums, UnmarshalImageFileChecksums) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageFileChecksums : ImageFileChecksums struct +type ImageFileChecksums struct { + // The SHA256 fingerprint of the image file. + Sha256 *string `json:"sha256,omitempty"` +} + +// UnmarshalImageFileChecksums unmarshals an instance of ImageFileChecksums from the specified map of raw messages. +func UnmarshalImageFileChecksums(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageFileChecksums) + err = core.UnmarshalPrimitive(m, "sha256", &obj.Sha256) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageFilePrototype : ImageFilePrototype struct +type ImageFilePrototype struct { + // The Cloud Object Store (COS) location of the image file. + Href *string `json:"href" validate:"required"` +} + +// NewImageFilePrototype : Instantiate ImageFilePrototype (Generic Model Constructor) +func (*VpcV1) NewImageFilePrototype(href string) (_model *ImageFilePrototype, err error) { + _model = &ImageFilePrototype{ + Href: core.StringPtr(href), } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalImageFilePrototype unmarshals an instance of ImageFilePrototype from the specified map of raw messages. +func UnmarshalImageFilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageFilePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -33743,33 +33738,38 @@ func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{} return } -// InstanceReference : InstanceReference struct -type InstanceReference struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn" validate:"required"` +// ImageIdentity : Identifies an image by a unique property. +// Models which "extend" this model: +// - ImageIdentityByID +// - ImageIdentityByCRN +// - ImageIdentityByHref +type ImageIdentity struct { + // The unique identifier for this image. + ID *string `json:"id,omitempty"` - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` + // The CRN for this image. + CRN *string `json:"crn,omitempty"` - // The URL for this virtual server instance. - Href *string `json:"href" validate:"required"` + // The URL for this image. + Href *string `json:"href,omitempty"` +} - // The unique identifier for this virtual server instance. - ID *string `json:"id" validate:"required"` +func (*ImageIdentity) isaImageIdentity() bool { + return true +} - // The user-defined name for this virtual server instance (and default system hostname). - Name *string `json:"name" validate:"required"` +type ImageIdentityIntf interface { + isaImageIdentity() bool } -// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. -func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalImageIdentity unmarshals an instance of ImageIdentity from the specified map of raw messages. +func UnmarshalImageIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -33777,29 +33777,20 @@ func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{} if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type InstanceReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// ImagePatch : ImagePatch struct +type ImagePatch struct { + // The unique user-defined name for this image. Names starting with `ibm-` are not allowed. + Name *string `json:"name,omitempty"` } -// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalImagePatch unmarshals an instance of ImagePatch from the specified map of raw messages. +func UnmarshalImagePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImagePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -33807,11 +33798,175 @@ func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result inte return } -// InstanceStatusReason : InstanceStatusReason struct -type InstanceStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - +// AsPatch returns a generic map representation of the ImagePatch +func (imagePatch *ImagePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(imagePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// ImagePrototype : ImagePrototype struct +// Models which "extend" this model: +// - ImagePrototypeImageByFile +// - ImagePrototypeImageBySourceVolume +type ImagePrototype struct { + // The unique user-defined name for this image. Names starting with `ibm-` are not allowed. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. + // + // That representation is created by wrapping the key's value with the `encryption_key` root key (which must also be + // specified), using either [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or the + // [Hyper Protect Crypto Service](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + // + // If unspecified, the imported image is treated as unencrypted. + EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` + + // The root key that was used to wrap the data key (which is ultimately represented as + // `encrypted_data_key`). Additionally, the root key will be used to encrypt volumes + // created from this image (unless an alternate `encryption_key` is specified at volume + // creation). + // + // If unspecified, the imported image is treated as unencrypted. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The file from which to create the image. + File *ImageFilePrototype `json:"file,omitempty"` + + // The [supported operating + // system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this + // image. + OperatingSystem OperatingSystemIdentityIntf `json:"operating_system,omitempty"` + + // The volume from which to create the image. The specified volume must: + // - Originate from an image, which will be used to populate this image's + // operating system information. + // - Not be `active` or `busy`. + // + // During image creation, the specified volume may briefly become `busy`. + SourceVolume VolumeIdentityIntf `json:"source_volume,omitempty"` +} + +func (*ImagePrototype) isaImagePrototype() bool { + return true +} + +type ImagePrototypeIntf interface { + isaImagePrototype() bool +} + +// UnmarshalImagePrototype unmarshals an instance of ImagePrototype from the specified map of raw messages. +func UnmarshalImagePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImagePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "encrypted_data_key", &obj.EncryptedDataKey) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "file", &obj.File, UnmarshalImageFilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageReference : ImageReference struct +type ImageReference struct { + // The CRN for this image. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *ImageReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this image. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this image. + ID *string `json:"id" validate:"required"` + + // The user-defined or system-provided name for this image. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalImageReference unmarshals an instance of ImageReference from the specified map of raw messages. +func UnmarshalImageReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalImageReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type ImageReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalImageReferenceDeleted unmarshals an instance of ImageReferenceDeleted from the specified map of raw messages. +func UnmarshalImageReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ImageStatusReason : ImageStatusReason struct +type ImageStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + // An explanation of the status reason. Message *string `json:"message" validate:"required"` @@ -33819,23 +33974,18 @@ type InstanceStatusReason struct { MoreInfo *string `json:"more_info,omitempty"` } -// Constants associated with the InstanceStatusReason.Code property. +// Constants associated with the ImageStatusReason.Code property. // A snake case string succinctly identifying the status reason. const ( - InstanceStatusReasonCodeCannotStartConst = "cannot_start" - InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" - InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" - InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" - InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" + ImageStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" + ImageStatusReasonCodeEncryptionKeyDisabledConst = "encryption_key_disabled" + ImageStatusReasonCodeImageRequestInProgressConst = "image_request_in_progress" + ImageStatusReasonCodeImageRequestQueuedConst = "image_request_queued" ) -// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. -func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceStatusReason) +// UnmarshalImageStatusReason unmarshals an instance of ImageStatusReason from the specified map of raw messages. +func UnmarshalImageStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ImageStatusReason) err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return @@ -33852,91 +34002,131 @@ func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interfac return } -// InstanceTemplate : InstanceTemplate struct -// Models which "extend" this model: -// - InstanceTemplateInstanceByImage -// - InstanceTemplateInstanceByVolume -type InstanceTemplate struct { - // The date and time that the instance template was created. +// Instance : Instance struct +type Instance struct { + // The availability policy for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicy `json:"availability_policy" validate:"required"` + + // The total bandwidth (in megabits per second) shared across the virtual server instance's network interfaces and + // storage volumes. + Bandwidth *int64 `json:"bandwidth" validate:"required"` + + // Boot volume attachment. + BootVolumeAttachment *VolumeAttachmentReferenceInstanceContext `json:"boot_volume_attachment" validate:"required"` + + // The date and time that the virtual server instance was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this instance template. + // The CRN for this virtual server instance. CRN *string `json:"crn" validate:"required"` - // The URL for this instance template. + // If present, the dedicated host this virtual server instance has been placed on. + DedicatedHost *DedicatedHostReference `json:"dedicated_host,omitempty"` + + // The instance disks for this virtual server instance. + Disks []InstanceDisk `json:"disks" validate:"required"` + + // The virtual server instance GPU configuration. + Gpu *InstanceGpu `json:"gpu,omitempty"` + + // The URL for this virtual server instance. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance template. + // The unique identifier for this virtual server instance. ID *string `json:"id" validate:"required"` - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` + // The image the virtual server instance was provisioned from. + Image *ImageReference `json:"image,omitempty"` - // The unique user-defined name for this instance template. + // The amount of memory, truncated to whole gibibytes. + Memory *int64 `json:"memory" validate:"required"` + + // The metadata service configuration. + MetadataService *InstanceMetadataService `json:"metadata_service" validate:"required"` + + // The user-defined name for this virtual server instance (and default system hostname). Name *string `json:"name" validate:"required"` - // The additional network interfaces to create for the virtual server instance. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + // The network interfaces for this virtual server instance, including the primary network interface. + NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` + // The placement restrictions for the virtual server instance. + PlacementTarget InstancePlacementTargetIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + // Primary network interface. + PrimaryNetworkInterface *NetworkInterfaceInstanceContextReference `json:"primary_network_interface" validate:"required"` - // The resource group for this instance template. + // The profile for this virtual server instance. + Profile *InstanceProfileReference `json:"profile" validate:"required"` + + // The resource group for this instance. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + // Indicates whether the state of the virtual server instance permits a start request. + Startable *bool `json:"startable" validate:"required"` - // User data to be made available when setting up the virtual server instance. - UserData *string `json:"user_data,omitempty"` + // The status of the virtual server instance. + Status *string `json:"status" validate:"required"` - // The volume attachments for this virtual server instance. - VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []InstanceStatusReason `json:"status_reasons" validate:"required"` - // The VPC the virtual server instance is to be a part of. If specified, it must match - // the VPC referenced by the subnets of the instance's network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces. + TotalNetworkBandwidth *int64 `json:"total_network_bandwidth" validate:"required"` - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth" validate:"required"` - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` + // The virtual server instance VCPU configuration. + Vcpu *InstanceVcpu `json:"vcpu" validate:"required"` - // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The volume attachments for this virtual server instance, including the boot volume attachment. + VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` -} + // The VPC this virtual server instance resides in. + VPC *VPCReference `json:"vpc" validate:"required"` -func (*InstanceTemplate) isaInstanceTemplate() bool { - return true + // The zone this virtual server instance resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -type InstanceTemplateIntf interface { - isaInstanceTemplate() bool -} +// Constants associated with the Instance.Status property. +// The status of the virtual server instance. +const ( + InstanceStatusDeletingConst = "deleting" + InstanceStatusFailedConst = "failed" + InstanceStatusPausedConst = "paused" + InstanceStatusPausingConst = "pausing" + InstanceStatusPendingConst = "pending" + InstanceStatusRestartingConst = "restarting" + InstanceStatusResumingConst = "resuming" + InstanceStatusRunningConst = "running" + InstanceStatusStartingConst = "starting" + InstanceStatusStoppedConst = "stopped" + InstanceStatusStoppingConst = "stopping" +) -// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. -func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplate) +// UnmarshalInstance unmarshals an instance of Instance from the specified map of raw messages. +func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Instance) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentReferenceInstanceContext) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -33945,6 +34135,18 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "dedicated_host", &obj.DedicatedHost, UnmarshalDedicatedHostReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu", &obj.Gpu, UnmarshalInstanceGpu) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -33953,7 +34155,15 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataService) if err != nil { return } @@ -33961,15 +34171,19 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceInstanceContextReference) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTarget) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfaceInstanceContextReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileReference) if err != nil { return } @@ -33977,35 +34191,39 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "startable", &obj.Startable) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalInstanceStatusReason) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "total_network_bandwidth", &obj.TotalNetworkBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpu) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceInstanceContext) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -34013,45 +34231,82 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) return } -// InstanceTemplateCollection : InstanceTemplateCollection struct -type InstanceTemplateCollection struct { - // A link to the first page of resources. - First *InstanceTemplateCollectionFirst `json:"first" validate:"required"` +// InstanceAction : InstanceAction struct +type InstanceAction struct { + // The date and time that the action was completed. + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The date and time that the action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *InstanceTemplateCollectionNext `json:"next,omitempty"` + // If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. + Force *bool `json:"force,omitempty"` - // Collection of instance templates. - Templates []InstanceTemplateIntf `json:"templates" validate:"required"` + // The URL for this instance action. + Href *string `json:"href" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The identifier for this instance action. + ID *string `json:"id" validate:"required"` + + // The date and time that the action was started. + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // The current status of this action. + Status *string `json:"status" validate:"required"` + + // The type of action. + Type *string `json:"type" validate:"required"` } -// UnmarshalInstanceTemplateCollection unmarshals an instance of InstanceTemplateCollection from the specified map of raw messages. -func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceTemplateCollectionFirst) +// Constants associated with the InstanceAction.Status property. +// The current status of this action. +const ( + InstanceActionStatusCompletedConst = "completed" + InstanceActionStatusFailedConst = "failed" + InstanceActionStatusPendingConst = "pending" + InstanceActionStatusRunningConst = "running" +) + +// Constants associated with the InstanceAction.Type property. +// The type of action. +const ( + InstanceActionTypeRebootConst = "reboot" + InstanceActionTypeStartConst = "start" + InstanceActionTypeStopConst = "stop" +) + +// UnmarshalInstanceAction unmarshals an instance of InstanceAction from the specified map of raw messages. +func UnmarshalInstanceAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAction) + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceTemplateCollectionNext) + err = core.UnmarshalPrimitive(m, "force", &obj.Force) if err != nil { return } - err = core.UnmarshalModel(m, "templates", &obj.Templates, UnmarshalInstanceTemplate) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -34059,16 +34314,35 @@ func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result in return } -// InstanceTemplateCollectionFirst : A link to the first page of resources. -type InstanceTemplateCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// InstanceAvailabilityPolicy : InstanceAvailabilityPolicy struct +type InstanceAvailabilityPolicy struct { + // The action to perform if the compute host experiences a failure. + // - `restart`: Automatically restart the virtual server instance after host failure + // - `stop`: Leave the virtual server instance stopped after host failure + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the + // unexpected property value was encountered. + HostFailure *string `json:"host_failure" validate:"required"` } -// UnmarshalInstanceTemplateCollectionFirst unmarshals an instance of InstanceTemplateCollectionFirst from the specified map of raw messages. -func UnmarshalInstanceTemplateCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the InstanceAvailabilityPolicy.HostFailure property. +// The action to perform if the compute host experiences a failure. +// - `restart`: Automatically restart the virtual server instance after host failure +// - `stop`: Leave the virtual server instance stopped after host failure +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the +// unexpected property value was encountered. +const ( + InstanceAvailabilityPolicyHostFailureRestartConst = "restart" + InstanceAvailabilityPolicyHostFailureStopConst = "stop" +) + +// UnmarshalInstanceAvailabilityPolicy unmarshals an instance of InstanceAvailabilityPolicy from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPolicy) + err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) if err != nil { return } @@ -34076,16 +34350,35 @@ func UnmarshalInstanceTemplateCollectionFirst(m map[string]json.RawMessage, resu return } -// InstanceTemplateCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type InstanceTemplateCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// InstanceAvailabilityPolicyPatch : InstanceAvailabilityPolicyPatch struct +type InstanceAvailabilityPolicyPatch struct { + // The action to perform if the compute host experiences a failure. + // - `restart`: Automatically restart the virtual server instance after host failure + // - `stop`: Leave the virtual server instance stopped after host failure + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the + // unexpected property value was encountered. + HostFailure *string `json:"host_failure,omitempty"` } -// UnmarshalInstanceTemplateCollectionNext unmarshals an instance of InstanceTemplateCollectionNext from the specified map of raw messages. -func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the InstanceAvailabilityPolicyPatch.HostFailure property. +// The action to perform if the compute host experiences a failure. +// - `restart`: Automatically restart the virtual server instance after host failure +// - `stop`: Leave the virtual server instance stopped after host failure +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the +// unexpected property value was encountered. +const ( + InstanceAvailabilityPolicyPatchHostFailureRestartConst = "restart" + InstanceAvailabilityPolicyPatchHostFailureStopConst = "stop" +) + +// UnmarshalInstanceAvailabilityPolicyPatch unmarshals an instance of InstanceAvailabilityPolicyPatch from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPolicyPatch) + err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) if err != nil { return } @@ -34093,42 +34386,81 @@ func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, resul return } -// InstanceTemplateIdentity : Identifies an instance template by a unique property. -// Models which "extend" this model: -// - InstanceTemplateIdentityByID -// - InstanceTemplateIdentityByHref -// - InstanceTemplateIdentityByCRN -type InstanceTemplateIdentity struct { - // The unique identifier for this instance template. - ID *string `json:"id,omitempty"` +// InstanceAvailabilityPrototype : InstanceAvailabilityPrototype struct +type InstanceAvailabilityPrototype struct { + // The action to perform if the compute host experiences a failure. + // - `restart`: Automatically restart the virtual server instance after host failure + // - `stop`: Leave the virtual server instance stopped after host failure + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the + // unexpected property value was encountered. + HostFailure *string `json:"host_failure,omitempty"` +} - // The URL for this instance template. - Href *string `json:"href,omitempty"` +// Constants associated with the InstanceAvailabilityPrototype.HostFailure property. +// The action to perform if the compute host experiences a failure. +// - `restart`: Automatically restart the virtual server instance after host failure +// - `stop`: Leave the virtual server instance stopped after host failure +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the instance on which the +// unexpected property value was encountered. +const ( + InstanceAvailabilityPrototypeHostFailureRestartConst = "restart" + InstanceAvailabilityPrototypeHostFailureStopConst = "stop" +) - // The CRN for this instance template. - CRN *string `json:"crn,omitempty"` +// UnmarshalInstanceAvailabilityPrototype unmarshals an instance of InstanceAvailabilityPrototype from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPrototype) + err = core.UnmarshalPrimitive(m, "host_failure", &obj.HostFailure) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -func (*InstanceTemplateIdentity) isaInstanceTemplateIdentity() bool { - return true -} +// InstanceCollection : InstanceCollection struct +type InstanceCollection struct { + // A link to the first page of resources. + First *InstanceCollectionFirst `json:"first" validate:"required"` -type InstanceTemplateIdentityIntf interface { - isaInstanceTemplateIdentity() bool + // Collection of virtual server instances. + Instances []Instance `json:"instances" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalInstanceTemplateIdentity unmarshals an instance of InstanceTemplateIdentity from the specified map of raw messages. -func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceCollection unmarshals an instance of InstanceCollection from the specified map of raw messages. +func UnmarshalInstanceCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "instances", &obj.Instances, UnmarshalInstance) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -34136,16 +34468,28 @@ func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result inte return } -// InstanceTemplatePatch : InstanceTemplatePatch struct -type InstanceTemplatePatch struct { - // The unique user-defined name for this instance template. - Name *string `json:"name,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// UnmarshalInstanceTemplatePatch unmarshals an instance of InstanceTemplatePatch from the specified map of raw messages. -func UnmarshalInstanceTemplatePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// InstanceCollectionFirst : A link to the first page of resources. +type InstanceCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceCollectionFirst unmarshals an instance of InstanceCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -34153,152 +34497,191 @@ func UnmarshalInstanceTemplatePatch(m map[string]json.RawMessage, result interfa return } -// AsPatch returns a generic map representation of the InstanceTemplatePatch -func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(instanceTemplatePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// InstanceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalInstanceCollectionNext unmarshals an instance of InstanceCollectionNext from the specified map of raw messages. +func UnmarshalInstanceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceTemplatePrototype : InstanceTemplatePrototype struct -// Models which "extend" this model: -// - InstanceTemplatePrototypeInstanceByImage -// - InstanceTemplatePrototypeInstanceByVolume -// - InstanceTemplatePrototypeInstanceBySourceTemplate -type InstanceTemplatePrototype struct { - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The additional network interfaces to create for the virtual server instance. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The profile to use for this virtual server instance. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // User data to be made available when setting up the virtual server instance. - UserData *string `json:"user_data,omitempty"` - - // The volume attachments for this virtual server instance. - VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` - - // The VPC the virtual server instance is to be a part of. If specified, it must match - // the VPC referenced by the subnets of the instance's network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` +// InstanceConsoleAccessToken : The instance console access token information. +type InstanceConsoleAccessToken struct { + // A URL safe single-use token used to access the console WebSocket. + AccessToken *string `json:"access_token" validate:"required"` - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` + // The instance console type for which this token may be used. + ConsoleType *string `json:"console_type" validate:"required"` - // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The date and time that the access token was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // The date and time that the access token will expire. + ExpiresAt *strfmt.DateTime `json:"expires_at" validate:"required"` - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` -} + // Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has + // no effect on VNC consoles. + Force *bool `json:"force" validate:"required"` -func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { - return true + // The URL to access this instance console. + Href *string `json:"href" validate:"required"` } -type InstanceTemplatePrototypeIntf interface { - isaInstanceTemplatePrototype() bool -} +// Constants associated with the InstanceConsoleAccessToken.ConsoleType property. +// The instance console type for which this token may be used. +const ( + InstanceConsoleAccessTokenConsoleTypeSerialConst = "serial" + InstanceConsoleAccessTokenConsoleTypeVncConst = "vnc" +) -// UnmarshalInstanceTemplatePrototype unmarshals an instance of InstanceTemplatePrototype from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototype) - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) +// UnmarshalInstanceConsoleAccessToken unmarshals an instance of InstanceConsoleAccessToken from the specified map of raw messages. +func UnmarshalInstanceConsoleAccessToken(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceConsoleAccessToken) + err = core.UnmarshalPrimitive(m, "access_token", &obj.AccessToken) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "console_type", &obj.ConsoleType) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "force", &obj.Force) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDefaultTrustedProfilePrototype : InstanceDefaultTrustedProfilePrototype struct +type InstanceDefaultTrustedProfilePrototype struct { + // If set to `true`, the system will create a link to the specified `target` trusted profile during instance creation. + // Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be + // automatically deleted when the instance is deleted. + AutoLink *bool `json:"auto_link,omitempty"` + + // The default IAM trusted profile to use for this virtual server instance. + Target TrustedProfileIdentityIntf `json:"target" validate:"required"` +} + +// NewInstanceDefaultTrustedProfilePrototype : Instantiate InstanceDefaultTrustedProfilePrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceDefaultTrustedProfilePrototype(target TrustedProfileIdentityIntf) (_model *InstanceDefaultTrustedProfilePrototype, err error) { + _model = &InstanceDefaultTrustedProfilePrototype{ + Target: target, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalInstanceDefaultTrustedProfilePrototype unmarshals an instance of InstanceDefaultTrustedProfilePrototype from the specified map of raw messages. +func UnmarshalInstanceDefaultTrustedProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDefaultTrustedProfilePrototype) + err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) if err != nil { return } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDisk : InstanceDisk struct +type InstanceDisk struct { + // The date and time that the disk was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this instance disk. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance disk. + ID *string `json:"id" validate:"required"` + + // The disk interface used for attaching the disk. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + InterfaceType *string `json:"interface_type" validate:"required"` + + // The user-defined name for this disk. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The size of the disk in GB (gigabytes). + Size *int64 `json:"size" validate:"required"` +} + +// Constants associated with the InstanceDisk.InterfaceType property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceDiskInterfaceTypeNvmeConst = "nvme" + InstanceDiskInterfaceTypeVirtioBlkConst = "virtio_blk" +) + +// Constants associated with the InstanceDisk.ResourceType property. +// The resource type. +const ( + InstanceDiskResourceTypeInstanceDiskConst = "instance_disk" +) + +// UnmarshalInstanceDisk unmarshals an instance of InstanceDisk from the specified map of raw messages. +func UnmarshalInstanceDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDisk) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } @@ -34306,33 +34689,79 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int return } -// InstanceTemplateReference : InstanceTemplateReference struct -type InstanceTemplateReference struct { - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` +// InstanceDiskCollection : InstanceDiskCollection struct +type InstanceDiskCollection struct { + // Collection of the instance's disks. + Disks []InstanceDisk `json:"disks" validate:"required"` +} + +// UnmarshalInstanceDiskCollection unmarshals an instance of InstanceDiskCollection from the specified map of raw messages. +func UnmarshalInstanceDiskCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskCollection) + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceDisk) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceDiskPatch : InstanceDiskPatch struct +type InstanceDiskPatch struct { + // The user-defined name for this disk. + Name *string `json:"name,omitempty"` +} + +// UnmarshalInstanceDiskPatch unmarshals an instance of InstanceDiskPatch from the specified map of raw messages. +func UnmarshalInstanceDiskPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the InstanceDiskPatch +func (instanceDiskPatch *InstanceDiskPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceDiskPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} +// InstanceDiskReference : InstanceDiskReference struct +type InstanceDiskReference struct { // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *InstanceTemplateReferenceDeleted `json:"deleted,omitempty"` + Deleted *InstanceDiskReferenceDeleted `json:"deleted,omitempty"` - // The URL for this instance template. + // The URL for this instance disk. Href *string `json:"href" validate:"required"` - // The unique identifier for this instance template. + // The unique identifier for this instance disk. ID *string `json:"id" validate:"required"` - // The unique user-defined name for this instance template. + // The user-defined name for this disk. Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalInstanceTemplateReference unmarshals an instance of InstanceTemplateReference from the specified map of raw messages. -func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceTemplateReferenceDeleted) +// Constants associated with the InstanceDiskReference.ResourceType property. +// The resource type. +const ( + InstanceDiskReferenceResourceTypeInstanceDiskConst = "instance_disk" +) + +// UnmarshalInstanceDiskReference unmarshals an instance of InstanceDiskReference from the specified map of raw messages. +func UnmarshalInstanceDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceDiskReferenceDeleted) if err != nil { return } @@ -34348,20 +34777,24 @@ func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result int if err != nil { return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// InstanceTemplateReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// InstanceDiskReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type InstanceTemplateReferenceDeleted struct { +type InstanceDiskReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalInstanceTemplateReferenceDeleted unmarshals an instance of InstanceTemplateReferenceDeleted from the specified map of raw messages. -func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateReferenceDeleted) +// UnmarshalInstanceDiskReferenceDeleted unmarshals an instance of InstanceDiskReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceDiskReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceDiskReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -34370,23 +34803,37 @@ func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, res return } -// InstanceVcpu : The virtual server instance VCPU configuration. -type InstanceVcpu struct { - // The VCPU architecture. - Architecture *string `json:"architecture" validate:"required"` - - // The number of VCPUs assigned. +// InstanceGpu : The virtual server instance GPU configuration. +type InstanceGpu struct { + // The number of GPUs assigned to the instance. Count *int64 `json:"count" validate:"required"` + + // The GPU manufacturer. + Manufacturer *string `json:"manufacturer" validate:"required"` + + // The overall amount of GPU memory in GiB (gibibytes). + Memory *int64 `json:"memory" validate:"required"` + + // The GPU model. + Model *string `json:"model" validate:"required"` } -// UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. -func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceVcpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) +// UnmarshalInstanceGpu unmarshals an instance of InstanceGpu from the specified map of raw messages. +func UnmarshalInstanceGpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGpu) + err = core.UnmarshalPrimitive(m, "count", &obj.Count) if err != nil { return } - err = core.UnmarshalPrimitive(m, "count", &obj.Count) + err = core.UnmarshalPrimitive(m, "manufacturer", &obj.Manufacturer) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "memory", &obj.Memory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "model", &obj.Model) if err != nil { return } @@ -34394,59 +34841,87 @@ func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (er return } -// Key : Key struct -type Key struct { - // The date and time that the key was created. +// InstanceGroup : InstanceGroup struct +type InstanceGroup struct { + // Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the + // port for the load balancer pool member. + ApplicationPort *int64 `json:"application_port,omitempty"` + + // The date and time that the instance group was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this key. + // The CRN for this instance group. CRN *string `json:"crn" validate:"required"` - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` - - // The URL for this key. + // The URL for this instance group. Href *string `json:"href" validate:"required"` - // The unique identifier for this key. + // The unique identifier for this instance group. ID *string `json:"id" validate:"required"` - // The length of this key (in bits). - Length *int64 `json:"length" validate:"required"` + // The template used to create new instances for this group. + InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` - // The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected - // words. - Name *string `json:"name" validate:"required"` + // The load balancer pool managed by this group. Instances created + // by this group will have a new load balancer pool member in that + // pool created. + LoadBalancerPool *LoadBalancerPoolReference `json:"load_balancer_pool,omitempty"` - // The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. - PublicKey *string `json:"public_key" validate:"required"` + // The managers for the instance group. + Managers []InstanceGroupManagerReference `json:"managers" validate:"required"` + + // The number of instances in the instance group. + MembershipCount *int64 `json:"membership_count" validate:"required"` + + // The user-defined name for this instance group. + Name *string `json:"name" validate:"required"` - // The resource group for this key. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The crypto-system used by this key. - Type *string `json:"type" validate:"required"` + // The status of the instance group + // - `deleting`: Group is being deleted + // - `healthy`: Group has `membership_count` instances + // - `scaling`: Instances in the group are being created or deleted to reach + // `membership_count` + // - `unhealthy`: Group is unable to reach `membership_count` instances. + Status *string `json:"status" validate:"required"` + + // The subnets to use when creating new instances. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // The date and time that the instance group was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The VPC the instance group resides in. + VPC *VPCReference `json:"vpc" validate:"required"` } -// Constants associated with the Key.Type property. -// The crypto-system used by this key. +// Constants associated with the InstanceGroup.Status property. +// The status of the instance group +// - `deleting`: Group is being deleted +// - `healthy`: Group has `membership_count` instances +// - `scaling`: Instances in the group are being created or deleted to reach +// `membership_count` +// - `unhealthy`: Group is unable to reach `membership_count` instances. const ( - KeyTypeRsaConst = "rsa" + InstanceGroupStatusDeletingConst = "deleting" + InstanceGroupStatusHealthyConst = "healthy" + InstanceGroupStatusScalingConst = "scaling" + InstanceGroupStatusUnhealthyConst = "unhealthy" ) -// UnmarshalKey unmarshals an instance of Key from the specified map of raw messages. -func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Key) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalInstanceGroup unmarshals an instance of InstanceGroup from the specified map of raw messages. +func UnmarshalInstanceGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroup) + err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -34458,15 +34933,23 @@ func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) if err != nil { return } - err = core.UnmarshalPrimitive(m, "length", &obj.Length) + err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "public_key", &obj.PublicKey) + err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManagerReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -34474,7 +34957,19 @@ func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -34482,33 +34977,33 @@ func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) return } -// KeyCollection : KeyCollection struct -type KeyCollection struct { +// InstanceGroupCollection : InstanceGroupCollection struct +type InstanceGroupCollection struct { // A link to the first page of resources. - First *KeyCollectionFirst `json:"first" validate:"required"` + First *InstanceGroupCollectionFirst `json:"first" validate:"required"` - // Collection of keys. - Keys []Key `json:"keys" validate:"required"` + // Collection of instance groups. + InstanceGroups []InstanceGroup `json:"instance_groups" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *KeyCollectionNext `json:"next,omitempty"` + Next *InstanceGroupCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalKeyCollection unmarshals an instance of KeyCollection from the specified map of raw messages. -func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalKeyCollectionFirst) +// UnmarshalInstanceGroupCollection unmarshals an instance of InstanceGroupCollection from the specified map of raw messages. +func UnmarshalInstanceGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKey) + err = core.UnmarshalModel(m, "instance_groups", &obj.InstanceGroups, UnmarshalInstanceGroup) if err != nil { return } @@ -34516,7 +35011,7 @@ func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalKeyCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupCollectionNext) if err != nil { return } @@ -34529,7 +35024,7 @@ func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (e } // Retrieve the value to be passed to a request to access the next page of results -func (resp *KeyCollection) GetNextStart() (*string, error) { +func (resp *InstanceGroupCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -34540,15 +35035,15 @@ func (resp *KeyCollection) GetNextStart() (*string, error) { return start, nil } -// KeyCollectionFirst : A link to the first page of resources. -type KeyCollectionFirst struct { +// InstanceGroupCollectionFirst : A link to the first page of resources. +type InstanceGroupCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalKeyCollectionFirst unmarshals an instance of KeyCollectionFirst from the specified map of raw messages. -func UnmarshalKeyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollectionFirst) +// UnmarshalInstanceGroupCollectionFirst unmarshals an instance of InstanceGroupCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -34557,15 +35052,15 @@ func UnmarshalKeyCollectionFirst(m map[string]json.RawMessage, result interface{ return } -// KeyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type KeyCollectionNext struct { +// InstanceGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalKeyCollectionNext unmarshals an instance of KeyCollectionNext from the specified map of raw messages. -func UnmarshalKeyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyCollectionNext) +// UnmarshalInstanceGroupCollectionNext unmarshals an instance of InstanceGroupCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -34574,120 +35069,230 @@ func UnmarshalKeyCollectionNext(m map[string]json.RawMessage, result interface{} return } -// KeyIdentity : Identifies a key by a unique property. +// InstanceGroupManager : InstanceGroupManager struct // Models which "extend" this model: -// - KeyIdentityByID -// - KeyIdentityByCRN -// - KeyIdentityByHref -// - KeyIdentityByFingerprint -type KeyIdentity struct { - // The unique identifier for this key. - ID *string `json:"id,omitempty"` +// - InstanceGroupManagerAutoScale +// - InstanceGroupManagerScheduled +type InstanceGroupManager struct { + // The date and time that the instance group manager was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The CRN for this key. - CRN *string `json:"crn,omitempty"` + // The URL for this instance group manager. + Href *string `json:"href" validate:"required"` - // The URL for this key. - Href *string `json:"href,omitempty"` + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint,omitempty"` + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled" validate:"required"` + + // The user-defined name for this instance group manager. + Name *string `json:"name" validate:"required"` + + // The date and time that the instance group manager was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` + + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` + + // The type of instance group manager. + ManagerType *string `json:"manager_type,omitempty"` + + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` + + // The policies of the instance group manager. + Policies []InstanceGroupManagerPolicyReference `json:"policies,omitempty"` + + // The actions of the instance group manager. + Actions []InstanceGroupManagerActionReference `json:"actions,omitempty"` } -func (*KeyIdentity) isaKeyIdentity() bool { +// Constants associated with the InstanceGroupManager.ManagerType property. +// The type of instance group manager. +const ( + InstanceGroupManagerManagerTypeAutoscaleConst = "autoscale" +) + +func (*InstanceGroupManager) isaInstanceGroupManager() bool { return true } -type KeyIdentityIntf interface { - isaKeyIdentity() bool +type InstanceGroupManagerIntf interface { + isaInstanceGroupManager() bool } -// UnmarshalKeyIdentity unmarshals an instance of KeyIdentity from the specified map of raw messages. -func UnmarshalKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalInstanceGroupManager unmarshals an instance of InstanceGroupManager from the specified map of raw messages. +func UnmarshalInstanceGroupManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManager) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// KeyPatch : KeyPatch struct -type KeyPatch struct { - // The user-defined name for this key. - Name *string `json:"name,omitempty"` -} - -// UnmarshalKeyPatch unmarshals an instance of KeyPatch from the specified map of raw messages. -func UnmarshalKeyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the KeyPatch -func (keyPatch *KeyPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(keyPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerActionReference) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// KeyReference : KeyReference struct -type KeyReference struct { - // The CRN for this key. - CRN *string `json:"crn" validate:"required"` +// InstanceGroupManagerAction : InstanceGroupManagerAction struct +// Models which "extend" this model: +// - InstanceGroupManagerActionScheduledAction +type InstanceGroupManagerAction struct { + // Indicates whether this scheduled action will be automatically deleted after it has completed and + // `auto_delete_timeout` hours have passed. At present, this is always + // `true`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *KeyReferenceDeleted `json:"deleted,omitempty"` + // If `auto_delete` is `true`, and this scheduled action has finished, the hours after which it will be automatically + // deleted. If the value is `0`, the action will be deleted once it has finished. This value may be modifiable in the + // future. + AutoDeleteTimeout *int64 `json:"auto_delete_timeout" validate:"required"` - // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always - // `SHA256`). - Fingerprint *string `json:"fingerprint" validate:"required"` + // The date and time that the instance group manager action was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this key. + // The URL for this instance group manager action. Href *string `json:"href" validate:"required"` - // The unique identifier for this key. + // The unique identifier for this instance group manager action. ID *string `json:"id" validate:"required"` - // The user-defined name for this key. + // The user-defined name for this instance group manager action. Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the instance group action + // - `active`: Action is ready to be run + // - `completed`: Action was completed successfully + // - `failed`: Action could not be completed successfully + // - `incompatible`: Action parameters are not compatible with the group or manager + // - `omitted`: Action was not applied because this action's manager was disabled. + Status *string `json:"status" validate:"required"` + + // The date and time that the instance group manager action was modified. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` + + // The type of action for the instance group. + ActionType *string `json:"action_type,omitempty"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` + + // The date and time the scheduled action was last applied. If absent, the action has never been applied. + LastAppliedAt *strfmt.DateTime `json:"last_applied_at,omitempty"` + + // The date and time the scheduled action will next run. If absent, the system is currently calculating the next run + // time. + NextRunAt *strfmt.DateTime `json:"next_run_at,omitempty"` + + Group *InstanceGroupManagerScheduledActionGroup `json:"group,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerIntf `json:"manager,omitempty"` } -// UnmarshalKeyReference unmarshals an instance of KeyReference from the specified map of raw messages. -func UnmarshalKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// Constants associated with the InstanceGroupManagerAction.ResourceType property. +// The resource type. +const ( + InstanceGroupManagerActionResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" +) + +// Constants associated with the InstanceGroupManagerAction.Status property. +// The status of the instance group action +// - `active`: Action is ready to be run +// - `completed`: Action was completed successfully +// - `failed`: Action could not be completed successfully +// - `incompatible`: Action parameters are not compatible with the group or manager +// - `omitted`: Action was not applied because this action's manager was disabled. +const ( + InstanceGroupManagerActionStatusActiveConst = "active" + InstanceGroupManagerActionStatusCompletedConst = "completed" + InstanceGroupManagerActionStatusFailedConst = "failed" + InstanceGroupManagerActionStatusIncompatibleConst = "incompatible" + InstanceGroupManagerActionStatusOmittedConst = "omitted" +) + +// Constants associated with the InstanceGroupManagerAction.ActionType property. +// The type of action for the instance group. +const ( + InstanceGroupManagerActionActionTypeScheduledConst = "scheduled" +) + +func (*InstanceGroupManagerAction) isaInstanceGroupManagerAction() bool { + return true +} + +type InstanceGroupManagerActionIntf interface { + isaInstanceGroupManagerAction() bool +} + +// UnmarshalInstanceGroupManagerAction unmarshals an instance of InstanceGroupManagerAction from the specified map of raw messages. +func UnmarshalInstanceGroupManagerAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerAction) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalKeyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "auto_delete_timeout", &obj.AutoDeleteTimeout) if err != nil { return } - err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -34703,21 +35308,56 @@ func UnmarshalKeyReference(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "action_type", &obj.ActionType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "last_applied_at", &obj.LastAppliedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "next_run_at", &obj.NextRunAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroup) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManager) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// KeyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type KeyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// InstanceGroupManagerActionGroupPatch : InstanceGroupManagerActionGroupPatch struct +type InstanceGroupManagerActionGroupPatch struct { + // The desired number of instance group members at the scheduled time. + MembershipCount *int64 `json:"membership_count,omitempty"` } -// UnmarshalKeyReferenceDeleted unmarshals an instance of KeyReferenceDeleted from the specified map of raw messages. -func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(KeyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalInstanceGroupManagerActionGroupPatch unmarshals an instance of InstanceGroupManagerActionGroupPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionGroupPatch) + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) if err != nil { return } @@ -34725,2801 +35365,3847 @@ func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface return } -// ListDedicatedHostDisksOptions : The ListDedicatedHostDisks options. -type ListDedicatedHostDisksOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` +// InstanceGroupManagerActionManagerPatch : InstanceGroupManagerActionManagerPatch struct +type InstanceGroupManagerActionManagerPatch struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` } -// NewListDedicatedHostDisksOptions : Instantiate ListDedicatedHostDisksOptions -func (*VpcV1) NewListDedicatedHostDisksOptions(dedicatedHostID string) *ListDedicatedHostDisksOptions { - return &ListDedicatedHostDisksOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), +// UnmarshalInstanceGroupManagerActionManagerPatch unmarshals an instance of InstanceGroupManagerActionManagerPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionManagerPatch) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *ListDedicatedHostDisksOptions) SetDedicatedHostID(dedicatedHostID string) *ListDedicatedHostDisksOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostDisksOptions) SetHeaders(param map[string]string) *ListDedicatedHostDisksOptions { - options.Headers = param - return options -} - -// ListDedicatedHostGroupsOptions : The ListDedicatedHostGroups options. -type ListDedicatedHostGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// InstanceGroupManagerActionPatch : InstanceGroupManagerActionPatch struct +type InstanceGroupManagerActionPatch struct { + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + Group *InstanceGroupManagerActionGroupPatch `json:"group,omitempty"` - // Filters the collection to resources in the zone with the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + Manager *InstanceGroupManagerActionManagerPatch `json:"manager,omitempty"` - // Filters the collection to resources with the exact specified name. + // The user-defined name for this instance group manager action. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` } -// NewListDedicatedHostGroupsOptions : Instantiate ListDedicatedHostGroupsOptions -func (*VpcV1) NewListDedicatedHostGroupsOptions() *ListDedicatedHostGroupsOptions { - return &ListDedicatedHostGroupsOptions{} +// UnmarshalInstanceGroupManagerActionPatch unmarshals an instance of InstanceGroupManagerActionPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPatch) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerActionGroupPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerActionManagerPatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostGroupsOptions) SetStart(start string) *ListDedicatedHostGroupsOptions { - _options.Start = core.StringPtr(start) - return _options +// AsPatch returns a generic map representation of the InstanceGroupManagerActionPatch +func (instanceGroupManagerActionPatch *InstanceGroupManagerActionPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupManagerActionPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostGroupsOptions) SetLimit(limit int64) *ListDedicatedHostGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// InstanceGroupManagerActionPrototype : InstanceGroupManagerActionPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototype struct { + // The user-defined name for this instance group manager action. Names must be unique within the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListDedicatedHostGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` -// SetZoneName : Allow user to set ZoneName -func (_options *ListDedicatedHostGroupsOptions) SetZoneName(zoneName string) *ListDedicatedHostGroupsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` -// SetName : Allow user to set Name -func (_options *ListDedicatedHostGroupsOptions) SetName(name string) *ListDedicatedHostGroupsOptions { - _options.Name = core.StringPtr(name) - return _options + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostGroupsOptions) SetHeaders(param map[string]string) *ListDedicatedHostGroupsOptions { - options.Headers = param - return options +func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { + return true } -// ListDedicatedHostProfilesOptions : The ListDedicatedHostProfiles options. -type ListDedicatedHostProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +type InstanceGroupManagerActionPrototypeIntf interface { + isaInstanceGroupManagerActionPrototype() bool +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalInstanceGroupManagerActionPrototype unmarshals an instance of InstanceGroupManagerActionPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListDedicatedHostProfilesOptions : Instantiate ListDedicatedHostProfilesOptions -func (*VpcV1) NewListDedicatedHostProfilesOptions() *ListDedicatedHostProfilesOptions { - return &ListDedicatedHostProfilesOptions{} -} +// InstanceGroupManagerActionReference : InstanceGroupManagerActionReference struct +type InstanceGroupManagerActionReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceGroupManagerActionReferenceDeleted `json:"deleted,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostProfilesOptions) SetStart(start string) *ListDedicatedHostProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The URL for this instance group manager action. + Href *string `json:"href" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostProfilesOptions) SetLimit(limit int64) *ListDedicatedHostProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The unique identifier for this instance group manager action. + ID *string `json:"id" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostProfilesOptions) SetHeaders(param map[string]string) *ListDedicatedHostProfilesOptions { - options.Headers = param - return options + // The user-defined name for this instance group manager action. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// ListDedicatedHostsOptions : The ListDedicatedHosts options. -type ListDedicatedHostsOptions struct { - // Filters the collection to dedicated host groups with the specified identifier. - DedicatedHostGroupID *string `json:"dedicated_host_group.id,omitempty"` +// Constants associated with the InstanceGroupManagerActionReference.ResourceType property. +// The resource type. +const ( + InstanceGroupManagerActionReferenceResourceTypeInstanceGroupManagerActionConst = "instance_group_manager_action" +) - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// UnmarshalInstanceGroupManagerActionReference unmarshals an instance of InstanceGroupManagerActionReference from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerActionReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// InstanceGroupManagerActionReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type InstanceGroupManagerActionReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// UnmarshalInstanceGroupManagerActionReferenceDeleted unmarshals an instance of InstanceGroupManagerActionReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources in the zone with the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` +// InstanceGroupManagerActionsCollection : InstanceGroupManagerActionsCollection struct +type InstanceGroupManagerActionsCollection struct { + // Collection of instance group manager actions. + Actions []InstanceGroupManagerActionIntf `json:"actions" validate:"required"` - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` + // A link to the first page of resources. + First *InstanceGroupManagerActionsCollectionFirst `json:"first" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// NewListDedicatedHostsOptions : Instantiate ListDedicatedHostsOptions -func (*VpcV1) NewListDedicatedHostsOptions() *ListDedicatedHostsOptions { - return &ListDedicatedHostsOptions{} -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupManagerActionsCollectionNext `json:"next,omitempty"` -// SetDedicatedHostGroupID : Allow user to set DedicatedHostGroupID -func (_options *ListDedicatedHostsOptions) SetDedicatedHostGroupID(dedicatedHostGroupID string) *ListDedicatedHostsOptions { - _options.DedicatedHostGroupID = core.StringPtr(dedicatedHostGroupID) - return _options + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// SetStart : Allow user to set Start -func (_options *ListDedicatedHostsOptions) SetStart(start string) *ListDedicatedHostsOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalInstanceGroupManagerActionsCollection unmarshals an instance of InstanceGroupManagerActionsCollection from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionsCollection) + err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalInstanceGroupManagerAction) + if err != nil { + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerActionsCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerActionsCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListDedicatedHostsOptions) SetLimit(limit int64) *ListDedicatedHostsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupManagerActionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListDedicatedHostsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// InstanceGroupManagerActionsCollectionFirst : A link to the first page of resources. +type InstanceGroupManagerActionsCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetZoneName : Allow user to set ZoneName -func (_options *ListDedicatedHostsOptions) SetZoneName(zoneName string) *ListDedicatedHostsOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options +// UnmarshalInstanceGroupManagerActionsCollectionFirst unmarshals an instance of InstanceGroupManagerActionsCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionsCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionsCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *ListDedicatedHostsOptions) SetName(name string) *ListDedicatedHostsOptions { - _options.Name = core.StringPtr(name) - return _options +// InstanceGroupManagerActionsCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupManagerActionsCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListDedicatedHostsOptions) SetHeaders(param map[string]string) *ListDedicatedHostsOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupManagerActionsCollectionNext unmarshals an instance of InstanceGroupManagerActionsCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionsCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionsCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListEndpointGatewayIpsOptions : The ListEndpointGatewayIps options. -type ListEndpointGatewayIpsOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` +// InstanceGroupManagerCollection : InstanceGroupManagerCollection struct +type InstanceGroupManagerCollection struct { + // A link to the first page of resources. + First *InstanceGroupManagerCollectionFirst `json:"first" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // Collection of instance group managers. + Managers []InstanceGroupManagerIntf `json:"managers" validate:"required"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupManagerCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// Constants associated with the ListEndpointGatewayIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListEndpointGatewayIpsOptionsSortAddressConst = "address" - ListEndpointGatewayIpsOptionsSortCreatedAtConst = "created_at" - ListEndpointGatewayIpsOptionsSortNameConst = "name" -) - -// NewListEndpointGatewayIpsOptions : Instantiate ListEndpointGatewayIpsOptions -func (*VpcV1) NewListEndpointGatewayIpsOptions(endpointGatewayID string) *ListEndpointGatewayIpsOptions { - return &ListEndpointGatewayIpsOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), +// UnmarshalInstanceGroupManagerCollection unmarshals an instance of InstanceGroupManagerCollection from the specified map of raw messages. +func UnmarshalInstanceGroupManagerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "managers", &obj.Managers, UnmarshalInstanceGroupManager) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerCollectionNext) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *ListEndpointGatewayIpsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayIpsOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupManagerCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetStart : Allow user to set Start -func (_options *ListEndpointGatewayIpsOptions) SetStart(start string) *ListEndpointGatewayIpsOptions { - _options.Start = core.StringPtr(start) - return _options +// InstanceGroupManagerCollectionFirst : A link to the first page of resources. +type InstanceGroupManagerCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListEndpointGatewayIpsOptions) SetLimit(limit int64) *ListEndpointGatewayIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstanceGroupManagerCollectionFirst unmarshals an instance of InstanceGroupManagerCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupManagerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSort : Allow user to set Sort -func (_options *ListEndpointGatewayIpsOptions) SetSort(sort string) *ListEndpointGatewayIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options +// InstanceGroupManagerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupManagerCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayIpsOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupManagerCollectionNext unmarshals an instance of InstanceGroupManagerCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupManagerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListEndpointGatewaysOptions : The ListEndpointGateways options. -type ListEndpointGatewaysOptions struct { - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` +// InstanceGroupManagerPatch : InstanceGroupManagerPatch struct +type InstanceGroupManagerPatch struct { + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` -// NewListEndpointGatewaysOptions : Instantiate ListEndpointGatewaysOptions -func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { - return &ListEndpointGatewaysOptions{} + // The user-defined name for this instance group manager. + Name *string `json:"name,omitempty"` } -// SetName : Allow user to set Name -func (_options *ListEndpointGatewaysOptions) SetName(name string) *ListEndpointGatewaysOptions { - _options.Name = core.StringPtr(name) - return _options +// UnmarshalInstanceGroupManagerPatch unmarshals an instance of InstanceGroupManagerPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPatch) + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListEndpointGatewaysOptions) SetStart(start string) *ListEndpointGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options +// AsPatch returns a generic map representation of the InstanceGroupManagerPatch +func (instanceGroupManagerPatch *InstanceGroupManagerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupManagerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetLimit : Allow user to set Limit -func (_options *ListEndpointGatewaysOptions) SetLimit(limit int64) *ListEndpointGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// InstanceGroupManagerPolicy : InstanceGroupManagerPolicy struct +// Models which "extend" this model: +// - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy +type InstanceGroupManagerPolicy struct { + // The date and time that the instance group manager policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListEndpointGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListEndpointGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The URL for this instance group manager policy. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListEndpointGatewaysOptions) SetHeaders(param map[string]string) *ListEndpointGatewaysOptions { - options.Headers = param - return options -} + // The unique identifier for this instance group manager policy. + ID *string `json:"id" validate:"required"` -// ListFloatingIpsOptions : The ListFloatingIps options. -type ListFloatingIpsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The user-defined name for this instance group manager policy. + Name *string `json:"name" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The date and time that the instance group manager policy was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The type of metric to be evaluated. + MetricType *string `json:"metric_type,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value,omitempty"` -// NewListFloatingIpsOptions : Instantiate ListFloatingIpsOptions -func (*VpcV1) NewListFloatingIpsOptions() *ListFloatingIpsOptions { - return &ListFloatingIpsOptions{} + // The type of policy for the instance group. + PolicyType *string `json:"policy_type,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListFloatingIpsOptions) SetStart(start string) *ListFloatingIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// Constants associated with the InstanceGroupManagerPolicy.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyMetricTypeNetworkOutConst = "network_out" +) -// SetLimit : Allow user to set Limit -func (_options *ListFloatingIpsOptions) SetLimit(limit int64) *ListFloatingIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// Constants associated with the InstanceGroupManagerPolicy.PolicyType property. +// The type of policy for the instance group. +const ( + InstanceGroupManagerPolicyPolicyTypeTargetConst = "target" +) -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListFloatingIpsOptions) SetResourceGroupID(resourceGroupID string) *ListFloatingIpsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +func (*InstanceGroupManagerPolicy) isaInstanceGroupManagerPolicy() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *ListFloatingIpsOptions) SetHeaders(param map[string]string) *ListFloatingIpsOptions { - options.Headers = param - return options +type InstanceGroupManagerPolicyIntf interface { + isaInstanceGroupManagerPolicy() bool } -// ListFlowLogCollectorsOptions : The ListFlowLogCollectors options. -type ListFlowLogCollectorsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` - - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` - - // Filters the collection to resources in the VPC with the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` +// UnmarshalInstanceGroupManagerPolicy unmarshals an instance of InstanceGroupManagerPolicy from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicy) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources in the VPC with the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` +// InstanceGroupManagerPolicyCollection : InstanceGroupManagerPolicyCollection struct +type InstanceGroupManagerPolicyCollection struct { + // A link to the first page of resources. + First *InstanceGroupManagerPolicyCollectionFirst `json:"first" validate:"required"` - // Filters the collection to resources in the VPC with the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Filters the collection to flow log collectors that target the specified resource. - TargetID *string `json:"target.id,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupManagerPolicyCollectionNext `json:"next,omitempty"` - // Filters the collection to flow log collectors that target the specified resource type. - TargetResourceType *string `json:"target.resource_type,omitempty"` + // Collection of instance group manager policies. + Policies []InstanceGroupManagerPolicyIntf `json:"policies" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// Constants associated with the ListFlowLogCollectorsOptions.TargetResourceType property. -// Filters the collection to flow log collectors that target the specified resource type. -const ( - ListFlowLogCollectorsOptionsTargetResourceTypeInstanceConst = "instance" - ListFlowLogCollectorsOptionsTargetResourceTypeNetworkInterfaceConst = "network_interface" - ListFlowLogCollectorsOptionsTargetResourceTypeSubnetConst = "subnet" - ListFlowLogCollectorsOptionsTargetResourceTypeVPCConst = "vpc" -) - -// NewListFlowLogCollectorsOptions : Instantiate ListFlowLogCollectorsOptions -func (*VpcV1) NewListFlowLogCollectorsOptions() *ListFlowLogCollectorsOptions { - return &ListFlowLogCollectorsOptions{} +// UnmarshalInstanceGroupManagerPolicyCollection unmarshals an instance of InstanceGroupManagerPolicyCollection from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupManagerPolicyCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupManagerPolicyCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalInstanceGroupManagerPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListFlowLogCollectorsOptions) SetStart(start string) *ListFlowLogCollectorsOptions { - _options.Start = core.StringPtr(start) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupManagerPolicyCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetLimit : Allow user to set Limit -func (_options *ListFlowLogCollectorsOptions) SetLimit(limit int64) *ListFlowLogCollectorsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// InstanceGroupManagerPolicyCollectionFirst : A link to the first page of resources. +type InstanceGroupManagerPolicyCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListFlowLogCollectorsOptions) SetResourceGroupID(resourceGroupID string) *ListFlowLogCollectorsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// UnmarshalInstanceGroupManagerPolicyCollectionFirst unmarshals an instance of InstanceGroupManagerPolicyCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetName : Allow user to set Name -func (_options *ListFlowLogCollectorsOptions) SetName(name string) *ListFlowLogCollectorsOptions { - _options.Name = core.StringPtr(name) - return _options +// InstanceGroupManagerPolicyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupManagerPolicyCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetVPCID : Allow user to set VPCID -func (_options *ListFlowLogCollectorsOptions) SetVPCID(vpcID string) *ListFlowLogCollectorsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// UnmarshalInstanceGroupManagerPolicyCollectionNext unmarshals an instance of InstanceGroupManagerPolicyCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListFlowLogCollectorsOptions) SetVPCCRN(vpcCRN string) *ListFlowLogCollectorsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} +// InstanceGroupManagerPolicyPatch : InstanceGroupManagerPolicyPatch struct +type InstanceGroupManagerPolicyPatch struct { + // The type of metric to be evaluated. + MetricType *string `json:"metric_type,omitempty"` -// SetVPCName : Allow user to set VPCName -func (_options *ListFlowLogCollectorsOptions) SetVPCName(vpcName string) *ListFlowLogCollectorsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value,omitempty"` -// SetTargetID : Allow user to set TargetID -func (_options *ListFlowLogCollectorsOptions) SetTargetID(targetID string) *ListFlowLogCollectorsOptions { - _options.TargetID = core.StringPtr(targetID) - return _options + // The user-defined name for this instance group manager policy. + Name *string `json:"name,omitempty"` } -// SetTargetResourceType : Allow user to set TargetResourceType -func (_options *ListFlowLogCollectorsOptions) SetTargetResourceType(targetResourceType string) *ListFlowLogCollectorsOptions { - _options.TargetResourceType = core.StringPtr(targetResourceType) - return _options +// Constants associated with the InstanceGroupManagerPolicyPatch.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyPatchMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyPatchMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyPatchMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyPatchMetricTypeNetworkOutConst = "network_out" +) + +// UnmarshalInstanceGroupManagerPolicyPatch unmarshals an instance of InstanceGroupManagerPolicyPatch from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyPatch) + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListFlowLogCollectorsOptions) SetHeaders(param map[string]string) *ListFlowLogCollectorsOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the InstanceGroupManagerPolicyPatch +func (instanceGroupManagerPolicyPatch *InstanceGroupManagerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupManagerPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// ListIkePoliciesOptions : The ListIkePolicies options. -type ListIkePoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceGroupManagerPolicyPrototype : InstanceGroupManagerPolicyPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype +type InstanceGroupManagerPolicyPrototype struct { + // The user-defined name for this instance group manager policy. Names must be unique within the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The type of metric to be evaluated. + MetricType *string `json:"metric_type,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The metric value to be evaluated. + MetricValue *int64 `json:"metric_value,omitempty"` -// NewListIkePoliciesOptions : Instantiate ListIkePoliciesOptions -func (*VpcV1) NewListIkePoliciesOptions() *ListIkePoliciesOptions { - return &ListIkePoliciesOptions{} + // The type of policy for the instance group. + PolicyType *string `json:"policy_type,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListIkePoliciesOptions) SetStart(start string) *ListIkePoliciesOptions { - _options.Start = core.StringPtr(start) - return _options +// Constants associated with the InstanceGroupManagerPolicyPrototype.MetricType property. +// The type of metric to be evaluated. +const ( + InstanceGroupManagerPolicyPrototypeMetricTypeCpuConst = "cpu" + InstanceGroupManagerPolicyPrototypeMetricTypeMemoryConst = "memory" + InstanceGroupManagerPolicyPrototypeMetricTypeNetworkInConst = "network_in" + InstanceGroupManagerPolicyPrototypeMetricTypeNetworkOutConst = "network_out" +) + +// Constants associated with the InstanceGroupManagerPolicyPrototype.PolicyType property. +// The type of policy for the instance group. +const ( + InstanceGroupManagerPolicyPrototypePolicyTypeTargetConst = "target" +) + +func (*InstanceGroupManagerPolicyPrototype) isaInstanceGroupManagerPolicyPrototype() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListIkePoliciesOptions) SetLimit(limit int64) *ListIkePoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type InstanceGroupManagerPolicyPrototypeIntf interface { + isaInstanceGroupManagerPolicyPrototype() bool } -// SetHeaders : Allow user to set Headers -func (options *ListIkePoliciesOptions) SetHeaders(param map[string]string) *ListIkePoliciesOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupManagerPolicyPrototype unmarshals an instance of InstanceGroupManagerPolicyPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_type", &obj.MetricType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "metric_value", &obj.MetricValue) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListIkePolicyConnectionsOptions : The ListIkePolicyConnections options. -type ListIkePolicyConnectionsOptions struct { - // The IKE policy identifier. - ID *string `json:"id" validate:"required,ne="` +// InstanceGroupManagerPolicyReference : InstanceGroupManagerPolicyReference struct +type InstanceGroupManagerPolicyReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceGroupManagerPolicyReferenceDeleted `json:"deleted,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this instance group manager policy. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager policy. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this instance group manager policy. + Name *string `json:"name" validate:"required"` } -// NewListIkePolicyConnectionsOptions : Instantiate ListIkePolicyConnectionsOptions -func (*VpcV1) NewListIkePolicyConnectionsOptions(id string) *ListIkePolicyConnectionsOptions { - return &ListIkePolicyConnectionsOptions{ - ID: core.StringPtr(id), +// UnmarshalInstanceGroupManagerPolicyReference unmarshals an instance of InstanceGroupManagerPolicyReference from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerPolicyReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *ListIkePolicyConnectionsOptions) SetID(id string) *ListIkePolicyConnectionsOptions { - _options.ID = core.StringPtr(id) - return _options +// InstanceGroupManagerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type InstanceGroupManagerPolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListIkePolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIkePolicyConnectionsOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupManagerPolicyReferenceDeleted unmarshals an instance of InstanceGroupManagerPolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListImagesOptions : The ListImages options. -type ListImagesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceGroupManagerPrototype : InstanceGroupManagerPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype +// - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype +type InstanceGroupManagerPrototype struct { + // Indicates whether this manager will control the instance group. + ManagementEnabled *bool `json:"management_enabled,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The user-defined name for this instance group manager. Names must be unique within the instance group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The time window in seconds to aggregate metrics prior to evaluation. + AggregationWindow *int64 `json:"aggregation_window,omitempty"` - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` + // The duration of time in seconds to pause further scale actions after scaling has taken place. + Cooldown *int64 `json:"cooldown,omitempty"` - // Filters the collection to images with the specified `visibility`. - Visibility *string `json:"visibility,omitempty"` + // The type of instance group manager. + ManagerType *string `json:"manager_type,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The maximum number of members in a managed instance group. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` + + // The minimum number of members in a managed instance group. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` } -// Constants associated with the ListImagesOptions.Visibility property. -// Filters the collection to images with the specified `visibility`. +// Constants associated with the InstanceGroupManagerPrototype.ManagerType property. +// The type of instance group manager. const ( - ListImagesOptionsVisibilityPrivateConst = "private" - ListImagesOptionsVisibilityPublicConst = "public" + InstanceGroupManagerPrototypeManagerTypeAutoscaleConst = "autoscale" ) -// NewListImagesOptions : Instantiate ListImagesOptions -func (*VpcV1) NewListImagesOptions() *ListImagesOptions { - return &ListImagesOptions{} +func (*InstanceGroupManagerPrototype) isaInstanceGroupManagerPrototype() bool { + return true } -// SetStart : Allow user to set Start -func (_options *ListImagesOptions) SetStart(start string) *ListImagesOptions { - _options.Start = core.StringPtr(start) - return _options +type InstanceGroupManagerPrototypeIntf interface { + isaInstanceGroupManagerPrototype() bool } -// SetLimit : Allow user to set Limit -func (_options *ListImagesOptions) SetLimit(limit int64) *ListImagesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstanceGroupManagerPrototype unmarshals an instance of InstanceGroupManagerPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerPrototype) + err = core.UnmarshalPrimitive(m, "management_enabled", &obj.ManagementEnabled) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "aggregation_window", &obj.AggregationWindow) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cooldown", &obj.Cooldown) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "manager_type", &obj.ManagerType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListImagesOptions) SetResourceGroupID(resourceGroupID string) *ListImagesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// InstanceGroupManagerReference : InstanceGroupManagerReference struct +type InstanceGroupManagerReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` -// SetName : Allow user to set Name -func (_options *ListImagesOptions) SetName(name string) *ListImagesOptions { - _options.Name = core.StringPtr(name) - return _options + // The URL for this instance group manager. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group manager. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this instance group manager. + Name *string `json:"name" validate:"required"` } -// SetVisibility : Allow user to set Visibility -func (_options *ListImagesOptions) SetVisibility(visibility string) *ListImagesOptions { - _options.Visibility = core.StringPtr(visibility) - return _options +// UnmarshalInstanceGroupManagerReference unmarshals an instance of InstanceGroupManagerReference from the specified map of raw messages. +func UnmarshalInstanceGroupManagerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListImagesOptions) SetHeaders(param map[string]string) *ListImagesOptions { - options.Headers = param - return options +// InstanceGroupManagerReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type InstanceGroupManagerReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// ListInstanceDisksOptions : The ListInstanceDisks options. -type ListInstanceDisksOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// UnmarshalInstanceGroupManagerReferenceDeleted unmarshals an instance of InstanceGroupManagerReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupManagerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Allows users to set headers on API requests - Headers map[string]string +// InstanceGroupManagerScheduledActionGroup : InstanceGroupManagerScheduledActionGroup struct +type InstanceGroupManagerScheduledActionGroup struct { + // The desired number of instance group members at the scheduled time. + MembershipCount *int64 `json:"membership_count" validate:"required"` } -// NewListInstanceDisksOptions : Instantiate ListInstanceDisksOptions -func (*VpcV1) NewListInstanceDisksOptions(instanceID string) *ListInstanceDisksOptions { - return &ListInstanceDisksOptions{ - InstanceID: core.StringPtr(instanceID), +// UnmarshalInstanceGroupManagerScheduledActionGroup unmarshals an instance of InstanceGroupManagerScheduledActionGroup from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionGroup) + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceDisksOptions) SetInstanceID(instanceID string) *ListInstanceDisksOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// InstanceGroupManagerScheduledActionGroupPrototype : InstanceGroupManagerScheduledActionGroupPrototype struct +type InstanceGroupManagerScheduledActionGroupPrototype struct { + // The desired number of instance group members at the scheduled time. + MembershipCount *int64 `json:"membership_count" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceDisksOptions) SetHeaders(param map[string]string) *ListInstanceDisksOptions { - options.Headers = param - return options +// NewInstanceGroupManagerScheduledActionGroupPrototype : Instantiate InstanceGroupManagerScheduledActionGroupPrototype (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerScheduledActionGroupPrototype(membershipCount int64) (_model *InstanceGroupManagerScheduledActionGroupPrototype, err error) { + _model = &InstanceGroupManagerScheduledActionGroupPrototype{ + MembershipCount: core.Int64Ptr(membershipCount), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// ListInstanceGroupManagerActionsOptions : The ListInstanceGroupManagerActions options. -type ListInstanceGroupManagerActionsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` +// UnmarshalInstanceGroupManagerScheduledActionGroupPrototype unmarshals an instance of InstanceGroupManagerScheduledActionGroupPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionGroupPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionGroupPrototype) + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceGroupManagerScheduledActionManager : InstanceGroupManagerScheduledActionManager struct +// Models which "extend" this model: +// - InstanceGroupManagerScheduledActionManagerAutoScale +type InstanceGroupManagerScheduledActionManager struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceGroupManagerReferenceDeleted `json:"deleted,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The URL for this instance group manager. + Href *string `json:"href,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The unique identifier for this instance group manager. + ID *string `json:"id,omitempty"` -// NewListInstanceGroupManagerActionsOptions : Instantiate ListInstanceGroupManagerActionsOptions -func (*VpcV1) NewListInstanceGroupManagerActionsOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { - return &ListInstanceGroupManagerActionsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - } -} + // The user-defined name for this instance group manager. + Name *string `json:"name,omitempty"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerActionsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagerActionsOptions) SetStart(start string) *ListInstanceGroupManagerActionsOptions { - _options.Start = core.StringPtr(start) - return _options +func (*InstanceGroupManagerScheduledActionManager) isaInstanceGroupManagerScheduledActionManager() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagerActionsOptions) SetLimit(limit int64) *ListInstanceGroupManagerActionsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type InstanceGroupManagerScheduledActionManagerIntf interface { + isaInstanceGroupManagerScheduledActionManager() bool } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagerActionsOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerActionsOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupManagerScheduledActionManager unmarshals an instance of InstanceGroupManagerScheduledActionManager from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManager) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupManagerReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceGroupManagerPoliciesOptions : The ListInstanceGroupManagerPolicies options. -type ListInstanceGroupManagerPoliciesOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` +// InstanceGroupManagerScheduledActionManagerPrototype : InstanceGroupManagerScheduledActionManagerPrototype struct +// Models which "extend" this model: +// - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype +type InstanceGroupManagerScheduledActionManagerPrototype struct { + // The desired maximum number of instance group members at the scheduled time. + MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The desired minimum number of instance group members at the scheduled time. + MinMembershipCount *int64 `json:"min_membership_count,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The unique identifier for this instance group manager. + ID *string `json:"id,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this instance group manager. + Href *string `json:"href,omitempty"` } -// NewListInstanceGroupManagerPoliciesOptions : Instantiate ListInstanceGroupManagerPoliciesOptions -func (*VpcV1) NewListInstanceGroupManagerPoliciesOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { - return &ListInstanceGroupManagerPoliciesOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - } +func (*InstanceGroupManagerScheduledActionManagerPrototype) isaInstanceGroupManagerScheduledActionManagerPrototype() bool { + return true } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerPoliciesOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +type InstanceGroupManagerScheduledActionManagerPrototypeIntf interface { + isaInstanceGroupManagerScheduledActionManagerPrototype() bool } -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options +// UnmarshalInstanceGroupManagerScheduledActionManagerPrototype unmarshals an instance of InstanceGroupManagerScheduledActionManagerPrototype from the specified map of raw messages. +func UnmarshalInstanceGroupManagerScheduledActionManagerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerScheduledActionManagerPrototype) + err = core.UnmarshalPrimitive(m, "max_membership_count", &obj.MaxMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min_membership_count", &obj.MinMembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagerPoliciesOptions) SetStart(start string) *ListInstanceGroupManagerPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} +// InstanceGroupMembership : InstanceGroupMembership struct +type InstanceGroupMembership struct { + // The date and time that the instance group manager policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagerPoliciesOptions) SetLimit(limit int64) *ListInstanceGroupManagerPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // If set to true, when deleting the membership the instance will also be deleted. + DeleteInstanceOnMembershipDelete *bool `json:"delete_instance_on_membership_delete" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagerPoliciesOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerPoliciesOptions { - options.Headers = param - return options -} + // The URL for this instance group membership. + Href *string `json:"href" validate:"required"` -// ListInstanceGroupManagersOptions : The ListInstanceGroupManagers options. -type ListInstanceGroupManagersOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + // The unique identifier for this instance group membership. + ID *string `json:"id" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + Instance *InstanceReference `json:"instance" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + InstanceTemplate *InstanceTemplateReference `json:"instance_template" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The user-defined name for this instance group membership. Names must be unique within the instance group. + Name *string `json:"name" validate:"required"` -// NewListInstanceGroupManagersOptions : Instantiate ListInstanceGroupManagersOptions -func (*VpcV1) NewListInstanceGroupManagersOptions(instanceGroupID string) *ListInstanceGroupManagersOptions { - return &ListInstanceGroupManagersOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - } -} + PoolMember *LoadBalancerPoolMemberReference `json:"pool_member,omitempty"` -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupManagersOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagersOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} + // The status of the instance group membership + // - `deleting`: Membership is deleting dependent resources + // - `failed`: Membership was unable to maintain dependent resources + // - `healthy`: Membership is active and serving in the group + // - `pending`: Membership is waiting for dependent resources + // - `unhealthy`: Membership has unhealthy dependent resources. + Status *string `json:"status" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupManagersOptions) SetStart(start string) *ListInstanceGroupManagersOptions { - _options.Start = core.StringPtr(start) - return _options + // The date and time that the instance group membership was updated. + UpdatedAt *strfmt.DateTime `json:"updated_at" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupManagersOptions) SetLimit(limit int64) *ListInstanceGroupManagersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// Constants associated with the InstanceGroupMembership.Status property. +// The status of the instance group membership +// - `deleting`: Membership is deleting dependent resources +// - `failed`: Membership was unable to maintain dependent resources +// - `healthy`: Membership is active and serving in the group +// - `pending`: Membership is waiting for dependent resources +// - `unhealthy`: Membership has unhealthy dependent resources. +const ( + InstanceGroupMembershipStatusDeletingConst = "deleting" + InstanceGroupMembershipStatusFailedConst = "failed" + InstanceGroupMembershipStatusHealthyConst = "healthy" + InstanceGroupMembershipStatusPendingConst = "pending" + InstanceGroupMembershipStatusUnhealthyConst = "unhealthy" +) -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupManagersOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagersOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupMembership unmarshals an instance of InstanceGroupMembership from the specified map of raw messages. +func UnmarshalInstanceGroupMembership(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembership) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "delete_instance_on_membership_delete", &obj.DeleteInstanceOnMembershipDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool_member", &obj.PoolMember, UnmarshalLoadBalancerPoolMemberReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceGroupMembershipsOptions : The ListInstanceGroupMemberships options. -type ListInstanceGroupMembershipsOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// InstanceGroupMembershipCollection : InstanceGroupMembershipCollection struct +type InstanceGroupMembershipCollection struct { + // A link to the first page of resources. + First *InstanceGroupMembershipCollectionFirst `json:"first" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // Collection of instance group memberships. + Memberships []InstanceGroupMembership `json:"memberships" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceGroupMembershipCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewListInstanceGroupMembershipsOptions : Instantiate ListInstanceGroupMembershipsOptions -func (*VpcV1) NewListInstanceGroupMembershipsOptions(instanceGroupID string) *ListInstanceGroupMembershipsOptions { - return &ListInstanceGroupMembershipsOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), +// UnmarshalInstanceGroupMembershipCollection unmarshals an instance of InstanceGroupMembershipCollection from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceGroupMembershipCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memberships", &obj.Memberships, UnmarshalInstanceGroupMembership) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceGroupMembershipCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *ListInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupMembershipsOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *InstanceGroupMembershipCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupMembershipsOptions) SetStart(start string) *ListInstanceGroupMembershipsOptions { - _options.Start = core.StringPtr(start) - return _options +// InstanceGroupMembershipCollectionFirst : A link to the first page of resources. +type InstanceGroupMembershipCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupMembershipsOptions) SetLimit(limit int64) *ListInstanceGroupMembershipsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstanceGroupMembershipCollectionFirst unmarshals an instance of InstanceGroupMembershipCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *ListInstanceGroupMembershipsOptions { - options.Headers = param - return options +// InstanceGroupMembershipCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceGroupMembershipCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// ListInstanceGroupsOptions : The ListInstanceGroups options. -type ListInstanceGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalInstanceGroupMembershipCollectionNext unmarshals an instance of InstanceGroupMembershipCollectionNext from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListInstanceGroupsOptions : Instantiate ListInstanceGroupsOptions -func (*VpcV1) NewListInstanceGroupsOptions() *ListInstanceGroupsOptions { - return &ListInstanceGroupsOptions{} +// InstanceGroupMembershipPatch : InstanceGroupMembershipPatch struct +type InstanceGroupMembershipPatch struct { + // The user-defined name for this instance group membership. Names must be unique within the instance group. + Name *string `json:"name,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListInstanceGroupsOptions) SetStart(start string) *ListInstanceGroupsOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalInstanceGroupMembershipPatch unmarshals an instance of InstanceGroupMembershipPatch from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListInstanceGroupsOptions) SetLimit(limit int64) *ListInstanceGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// AsPatch returns a generic map representation of the InstanceGroupMembershipPatch +func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupMembershipPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceGroupsOptions) SetHeaders(param map[string]string) *ListInstanceGroupsOptions { - options.Headers = param - return options -} +// InstanceGroupPatch : To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. +type InstanceGroupPatch struct { + // Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the + // port for the load balancer pool member. + ApplicationPort *int64 `json:"application_port,omitempty"` -// ListInstanceNetworkInterfaceFloatingIpsOptions : The ListInstanceNetworkInterfaceFloatingIps options. -type ListInstanceNetworkInterfaceFloatingIpsOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // Instance template to use when creating new instances. + // + // Instance groups are not compatible with instance templates that specify `true` for + // `default_trusted_profile.auto_link`. + InstanceTemplate InstanceTemplateIdentityIntf `json:"instance_template,omitempty"` - // The network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + // The load balancer that the load balancer pool used by this group + // is in. Required when using a load balancer pool. + LoadBalancer LoadBalancerIdentityIntf `json:"load_balancer,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // If specified, the load balancer pool will be managed by this + // group. Instances created by this group will have a new load + // balancer pool member in that pool created. Must be used with + // `application_port`. + LoadBalancerPool LoadBalancerPoolIdentityIntf `json:"load_balancer_pool,omitempty"` + + // The number of instances in the instance group. + MembershipCount *int64 `json:"membership_count,omitempty"` + + // The user-defined name for this instance group. + Name *string `json:"name,omitempty"` + + // The subnets to use when creating new instances. + Subnets []SubnetIdentityIntf `json:"subnets,omitempty"` } -// NewListInstanceNetworkInterfaceFloatingIpsOptions : Instantiate ListInstanceNetworkInterfaceFloatingIpsOptions -func (*VpcV1) NewListInstanceNetworkInterfaceFloatingIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - return &ListInstanceNetworkInterfaceFloatingIpsOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), +// UnmarshalInstanceGroupPatch unmarshals an instance of InstanceGroupPatch from the specified map of raw messages. +func UnmarshalInstanceGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupPatch) + err = core.UnmarshalPrimitive(m, "application_port", &obj.ApplicationPort) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_template", &obj.InstanceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancer", &obj.LoadBalancer, UnmarshalLoadBalancerIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancer_pool", &obj.LoadBalancerPool, UnmarshalLoadBalancerPoolIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "membership_count", &obj.MembershipCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetIdentity) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// AsPatch returns a generic map representation of the InstanceGroupPatch +func (instanceGroupPatch *InstanceGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} +// InstanceGroupReference : InstanceGroupReference struct +type InstanceGroupReference struct { + // The CRN for this instance group. + CRN *string `json:"crn" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceFloatingIpsOptions { - options.Headers = param - return options -} + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceGroupReferenceDeleted `json:"deleted,omitempty"` -// ListInstanceNetworkInterfacesOptions : The ListInstanceNetworkInterfaces options. -type ListInstanceNetworkInterfacesOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` + // The URL for this instance group. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The unique identifier for this instance group. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this instance group. + Name *string `json:"name" validate:"required"` } -// NewListInstanceNetworkInterfacesOptions : Instantiate ListInstanceNetworkInterfacesOptions -func (*VpcV1) NewListInstanceNetworkInterfacesOptions(instanceID string) *ListInstanceNetworkInterfacesOptions { - return &ListInstanceNetworkInterfacesOptions{ - InstanceID: core.StringPtr(instanceID), +// UnmarshalInstanceGroupReference unmarshals an instance of InstanceGroupReference from the specified map of raw messages. +func UnmarshalInstanceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceGroupReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceNetworkInterfacesOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfacesOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// InstanceGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type InstanceGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfacesOptions { - options.Headers = param - return options +// UnmarshalInstanceGroupReferenceDeleted unmarshals an instance of InstanceGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceProfilesOptions : The ListInstanceProfiles options. -type ListInstanceProfilesOptions struct { +// InstanceInitialization : InstanceInitialization struct +type InstanceInitialization struct { + // The default trusted profile configuration specified at virtual server instance + // creation. If absent, no default trusted profile was specified. + DefaultTrustedProfile *InstanceInitializationDefaultTrustedProfile `json:"default_trusted_profile,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The public SSH keys used at instance initialization. + Keys []KeyReference `json:"keys" validate:"required"` -// NewListInstanceProfilesOptions : Instantiate ListInstanceProfilesOptions -func (*VpcV1) NewListInstanceProfilesOptions() *ListInstanceProfilesOptions { - return &ListInstanceProfilesOptions{} + Password *InstanceInitializationPassword `json:"password,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceProfilesOptions) SetHeaders(param map[string]string) *ListInstanceProfilesOptions { - options.Headers = param - return options +// UnmarshalInstanceInitialization unmarshals an instance of InstanceInitialization from the specified map of raw messages. +func UnmarshalInstanceInitialization(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceInitialization) + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceInitializationDefaultTrustedProfile) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "password", &obj.Password, UnmarshalInstanceInitializationPassword) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceTemplatesOptions : The ListInstanceTemplates options. -type ListInstanceTemplatesOptions struct { - - // Allows users to set headers on API requests - Headers map[string]string -} +// InstanceInitializationDefaultTrustedProfile : InstanceInitializationDefaultTrustedProfile struct +type InstanceInitializationDefaultTrustedProfile struct { + // If set to `true`, the system created a link to the specified `target` trusted profile during instance creation. + // Regardless of whether a link was created by the system or manually using the IAM Identity service, it will be + // automatically deleted when the instance is deleted. + AutoLink *bool `json:"auto_link" validate:"required"` -// NewListInstanceTemplatesOptions : Instantiate ListInstanceTemplatesOptions -func (*VpcV1) NewListInstanceTemplatesOptions() *ListInstanceTemplatesOptions { - return &ListInstanceTemplatesOptions{} + // The default IAM trusted profile to use for this virtual server instance. + Target *TrustedProfileReference `json:"target" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceTemplatesOptions) SetHeaders(param map[string]string) *ListInstanceTemplatesOptions { - options.Headers = param - return options +// UnmarshalInstanceInitializationDefaultTrustedProfile unmarshals an instance of InstanceInitializationDefaultTrustedProfile from the specified map of raw messages. +func UnmarshalInstanceInitializationDefaultTrustedProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceInitializationDefaultTrustedProfile) + err = core.UnmarshalPrimitive(m, "auto_link", &obj.AutoLink) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalTrustedProfileReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstanceVolumeAttachmentsOptions : The ListInstanceVolumeAttachments options. -type ListInstanceVolumeAttachmentsOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// InstanceInitializationPassword : InstanceInitializationPassword struct +type InstanceInitializationPassword struct { + // The administrator password at initialization, encrypted using `encryption_key`, and returned base64-encoded. + EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The public SSH key used to encrypt the administrator password. + EncryptionKey *KeyIdentityByFingerprint `json:"encryption_key" validate:"required"` } -// NewListInstanceVolumeAttachmentsOptions : Instantiate ListInstanceVolumeAttachmentsOptions -func (*VpcV1) NewListInstanceVolumeAttachmentsOptions(instanceID string) *ListInstanceVolumeAttachmentsOptions { - return &ListInstanceVolumeAttachmentsOptions{ - InstanceID: core.StringPtr(instanceID), +// UnmarshalInstanceInitializationPassword unmarshals an instance of InstanceInitializationPassword from the specified map of raw messages. +func UnmarshalInstanceInitializationPassword(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceInitializationPassword) + err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyIdentityByFingerprint) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ListInstanceVolumeAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceVolumeAttachmentsOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options +// InstanceMetadataService : InstanceMetadataService struct +type InstanceMetadataService struct { + // Indicates whether the metadata service endpoint is available to the virtual server instance. + Enabled *bool `json:"enabled" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListInstanceVolumeAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceVolumeAttachmentsOptions { - options.Headers = param - return options +// UnmarshalInstanceMetadataService unmarshals an instance of InstanceMetadataService from the specified map of raw messages. +func UnmarshalInstanceMetadataService(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceMetadataService) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListInstancesOptions : The ListInstances options. -type ListInstancesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceMetadataServicePatch : InstanceMetadataServicePatch struct +type InstanceMetadataServicePatch struct { + // Indicates whether the metadata service endpoint is available to the virtual server instance. + Enabled *bool `json:"enabled,omitempty"` +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// UnmarshalInstanceMetadataServicePatch unmarshals an instance of InstanceMetadataServicePatch from the specified map of raw messages. +func UnmarshalInstanceMetadataServicePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceMetadataServicePatch) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// InstanceMetadataServicePrototype : InstanceMetadataServicePrototype struct +type InstanceMetadataServicePrototype struct { + // Indicates whether the metadata service endpoint is available to the virtual server instance. + Enabled *bool `json:"enabled,omitempty"` +} - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` +// UnmarshalInstanceMetadataServicePrototype unmarshals an instance of InstanceMetadataServicePrototype from the specified map of raw messages. +func UnmarshalInstanceMetadataServicePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceMetadataServicePrototype) + err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources in the VPC with the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` +// InstancePatch : InstancePatch struct +type InstancePatch struct { + // The availability policy for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPolicyPatch `json:"availability_policy,omitempty"` - // Filters the collection to resources in the VPC with the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` + // The metadata service configuration. + MetadataService *InstanceMetadataServicePatch `json:"metadata_service,omitempty"` - // Filters the collection to resources in the VPC with the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // The user-defined name for this virtual server instance (and default system hostname). + Name *string `json:"name,omitempty"` - // Filters the collection to instances on the dedicated host with the specified identifier. - DedicatedHostID *string `json:"dedicated_host.id,omitempty"` + // The placement restrictions to use for the virtual server instance. For the placement + // restrictions to be changed, the instance `status` must be `stopping` or `stopped`. + PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` - // Filters the collection to instances on the dedicated host with the specified CRN. - DedicatedHostCRN *string `json:"dedicated_host.crn,omitempty"` + // The profile to use for this virtual server instance. For the profile to be changed, + // the instance `status` must be `stopping` or `stopped`. In addition, the requested + // profile must: + // - Have matching instance disk support. Any disks associated with the current profile + // will be deleted, and any disks associated with the requested profile will be + // created. + // - Be compatible with any `placement_target` constraints. For example, if the + // instance is placed on a dedicated host, the requested profile `family` must be + // the same as the dedicated host `family`. + Profile InstancePatchProfileIntf `json:"profile,omitempty"` - // Filters the collection to instances on the dedicated host with the specified name. - DedicatedHostName *string `json:"dedicated_host.name,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` +} - // Filters the collection to instances in the placement group with the specified identifier. - PlacementGroupID *string `json:"placement_group.id,omitempty"` +// UnmarshalInstancePatch unmarshals an instance of InstancePatch from the specified map of raw messages. +func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePatch) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstancePatchProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to instances in the placement group with the specified CRN. - PlacementGroupCRN *string `json:"placement_group.crn,omitempty"` +// AsPatch returns a generic map representation of the InstancePatch +func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instancePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // Filters the collection to instances in the placement group with the specified name. - PlacementGroupName *string `json:"placement_group.name,omitempty"` +// InstancePatchProfile : The profile to use for this virtual server instance. For the profile to be changed, the instance `status` must be +// `stopping` or `stopped`. In addition, the requested profile must: +// - Have matching instance disk support. Any disks associated with the current profile +// will be deleted, and any disks associated with the requested profile will be +// created. +// - Be compatible with any `placement_target` constraints. For example, if the +// instance is placed on a dedicated host, the requested profile `family` must be +// the same as the dedicated host `family`. +// Models which "extend" this model: +// - InstancePatchProfileInstanceProfileIdentityByName +// - InstancePatchProfileInstanceProfileIdentityByHref +type InstancePatchProfile struct { + // The globally unique name for this virtual server instance profile. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this virtual server instance profile. + Href *string `json:"href,omitempty"` } -// NewListInstancesOptions : Instantiate ListInstancesOptions -func (*VpcV1) NewListInstancesOptions() *ListInstancesOptions { - return &ListInstancesOptions{} +func (*InstancePatchProfile) isaInstancePatchProfile() bool { + return true } -// SetStart : Allow user to set Start -func (_options *ListInstancesOptions) SetStart(start string) *ListInstancesOptions { - _options.Start = core.StringPtr(start) - return _options +type InstancePatchProfileIntf interface { + isaInstancePatchProfile() bool } -// SetLimit : Allow user to set Limit -func (_options *ListInstancesOptions) SetLimit(limit int64) *ListInstancesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstancePatchProfile unmarshals an instance of InstancePatchProfile from the specified map of raw messages. +func UnmarshalInstancePatchProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePatchProfile) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListInstancesOptions) SetResourceGroupID(resourceGroupID string) *ListInstancesOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// InstancePlacementTarget : InstancePlacementTarget struct +// Models which "extend" this model: +// - InstancePlacementTargetDedicatedHostGroupReference +// - InstancePlacementTargetDedicatedHostReference +// - InstancePlacementTargetPlacementGroupReference +type InstancePlacementTarget struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` -// SetName : Allow user to set Name -func (_options *ListInstancesOptions) SetName(name string) *ListInstancesOptions { - _options.Name = core.StringPtr(name) - return _options -} + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *DedicatedHostGroupReferenceDeleted `json:"deleted,omitempty"` -// SetVPCID : Allow user to set VPCID -func (_options *ListInstancesOptions) SetVPCID(vpcID string) *ListInstancesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListInstancesOptions) SetVPCCRN(vpcCRN string) *ListInstancesOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` -// SetVPCName : Allow user to set VPCName -func (_options *ListInstancesOptions) SetVPCName(vpcName string) *ListInstancesOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} + // The unique user-defined name for this dedicated host group. + Name *string `json:"name,omitempty"` -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *ListInstancesOptions) SetDedicatedHostID(dedicatedHostID string) *ListInstancesOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) - return _options + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// SetDedicatedHostCRN : Allow user to set DedicatedHostCRN -func (_options *ListInstancesOptions) SetDedicatedHostCRN(dedicatedHostCRN string) *ListInstancesOptions { - _options.DedicatedHostCRN = core.StringPtr(dedicatedHostCRN) - return _options -} +// Constants associated with the InstancePlacementTarget.ResourceType property. +// The resource type. +const ( + InstancePlacementTargetResourceTypeDedicatedHostGroupConst = "dedicated_host_group" +) -// SetDedicatedHostName : Allow user to set DedicatedHostName -func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName string) *ListInstancesOptions { - _options.DedicatedHostName = core.StringPtr(dedicatedHostName) - return _options +func (*InstancePlacementTarget) isaInstancePlacementTarget() bool { + return true } -// SetPlacementGroupID : Allow user to set PlacementGroupID -func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { - _options.PlacementGroupID = core.StringPtr(placementGroupID) - return _options +type InstancePlacementTargetIntf interface { + isaInstancePlacementTarget() bool } -// SetPlacementGroupCRN : Allow user to set PlacementGroupCRN -func (_options *ListInstancesOptions) SetPlacementGroupCRN(placementGroupCRN string) *ListInstancesOptions { - _options.PlacementGroupCRN = core.StringPtr(placementGroupCRN) - return _options +// UnmarshalInstancePlacementTarget unmarshals an instance of InstancePlacementTarget from the specified map of raw messages. +func UnmarshalInstancePlacementTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDedicatedHostGroupReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPlacementGroupName : Allow user to set PlacementGroupName -func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName string) *ListInstancesOptions { - _options.PlacementGroupName = core.StringPtr(placementGroupName) - return _options -} +// InstancePlacementTargetPatch : InstancePlacementTargetPatch struct +// Models which "extend" this model: +// - InstancePlacementTargetPatchDedicatedHostIdentity +// - InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatch struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { - options.Headers = param - return options -} + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` -// ListIpsecPoliciesOptions : The ListIpsecPolicies options. -type ListIpsecPoliciesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +func (*InstancePlacementTargetPatch) isaInstancePlacementTargetPatch() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type InstancePlacementTargetPatchIntf interface { + isaInstancePlacementTargetPatch() bool } -// NewListIpsecPoliciesOptions : Instantiate ListIpsecPoliciesOptions -func (*VpcV1) NewListIpsecPoliciesOptions() *ListIpsecPoliciesOptions { - return &ListIpsecPoliciesOptions{} +// UnmarshalInstancePlacementTargetPatch unmarshals an instance of InstancePlacementTargetPatch from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListIpsecPoliciesOptions) SetStart(start string) *ListIpsecPoliciesOptions { - _options.Start = core.StringPtr(start) - return _options -} +// InstancePlacementTargetPrototype : InstancePlacementTargetPrototype struct +// Models which "extend" this model: +// - InstancePlacementTargetPrototypeDedicatedHostIdentity +// - InstancePlacementTargetPrototypeDedicatedHostGroupIdentity +// - InstancePlacementTargetPrototypePlacementGroupIdentity +type InstancePlacementTargetPrototype struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListIpsecPoliciesOptions) SetLimit(limit int64) *ListIpsecPoliciesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListIpsecPoliciesOptions) SetHeaders(param map[string]string) *ListIpsecPoliciesOptions { - options.Headers = param - return options + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` } -// ListIpsecPolicyConnectionsOptions : The ListIpsecPolicyConnections options. -type ListIpsecPolicyConnectionsOptions struct { - // The IPsec policy identifier. - ID *string `json:"id" validate:"required,ne="` +func (*InstancePlacementTargetPrototype) isaInstancePlacementTargetPrototype() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type InstancePlacementTargetPrototypeIntf interface { + isaInstancePlacementTargetPrototype() bool } -// NewListIpsecPolicyConnectionsOptions : Instantiate ListIpsecPolicyConnectionsOptions -func (*VpcV1) NewListIpsecPolicyConnectionsOptions(id string) *ListIpsecPolicyConnectionsOptions { - return &ListIpsecPolicyConnectionsOptions{ - ID: core.StringPtr(id), +// UnmarshalInstancePlacementTargetPrototype unmarshals an instance of InstancePlacementTargetPrototype from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *ListIpsecPolicyConnectionsOptions) SetID(id string) *ListIpsecPolicyConnectionsOptions { - _options.ID = core.StringPtr(id) - return _options -} +// InstanceProfile : InstanceProfile struct +type InstanceProfile struct { + Bandwidth InstanceProfileBandwidthIntf `json:"bandwidth" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListIpsecPolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIpsecPolicyConnectionsOptions { - options.Headers = param - return options -} + // Collection of the instance profile's disks. + Disks []InstanceProfileDisk `json:"disks" validate:"required"` -// ListKeysOptions : The ListKeys options. -type ListKeysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The product family this virtual server instance profile belongs to. + Family *string `json:"family,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + GpuCount InstanceProfileGpuIntf `json:"gpu_count,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + GpuManufacturer *InstanceProfileGpuManufacturer `json:"gpu_manufacturer,omitempty"` -// NewListKeysOptions : Instantiate ListKeysOptions -func (*VpcV1) NewListKeysOptions() *ListKeysOptions { - return &ListKeysOptions{} -} + GpuMemory InstanceProfileGpuMemoryIntf `json:"gpu_memory,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListKeysOptions) SetStart(start string) *ListKeysOptions { - _options.Start = core.StringPtr(start) - return _options -} + GpuModel *InstanceProfileGpuModel `json:"gpu_model,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListKeysOptions) SetLimit(limit int64) *ListKeysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListKeysOptions) SetHeaders(param map[string]string) *ListKeysOptions { - options.Headers = param - return options -} + Memory InstanceProfileMemoryIntf `json:"memory" validate:"required"` -// ListLoadBalancerListenerPoliciesOptions : The ListLoadBalancerListenerPolicies options. -type ListLoadBalancerListenerPoliciesOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + OsArchitecture *InstanceProfileOsArchitecture `json:"os_architecture" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` -// NewListLoadBalancerListenerPoliciesOptions : Instantiate ListLoadBalancerListenerPoliciesOptions -func (*VpcV1) NewListLoadBalancerListenerPoliciesOptions(loadBalancerID string, listenerID string) *ListLoadBalancerListenerPoliciesOptions { - return &ListLoadBalancerListenerPoliciesOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - } -} + TotalVolumeBandwidth InstanceProfileVolumeBandwidthIntf `json:"total_volume_bandwidth" validate:"required"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenerPoliciesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPoliciesOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` -// SetListenerID : Allow user to set ListenerID -func (_options *ListLoadBalancerListenerPoliciesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPoliciesOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options + VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenerPoliciesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPoliciesOptions { - options.Headers = param - return options +// UnmarshalInstanceProfile unmarshals an instance of InstanceProfile from the specified map of raw messages. +func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfile) + err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalInstanceProfileBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "disks", &obj.Disks, UnmarshalInstanceProfileDisk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_count", &obj.GpuCount, UnmarshalInstanceProfileGpu) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_manufacturer", &obj.GpuManufacturer, UnmarshalInstanceProfileGpuManufacturer) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_memory", &obj.GpuMemory, UnmarshalInstanceProfileGpuMemory) + if err != nil { + return + } + err = core.UnmarshalModel(m, "gpu_model", &obj.GpuModel, UnmarshalInstanceProfileGpuModel) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "memory", &obj.Memory, UnmarshalInstanceProfileMemory) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "os_architecture", &obj.OsArchitecture, UnmarshalInstanceProfileOsArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "port_speed", &obj.PortSpeed, UnmarshalInstanceProfilePortSpeed) + if err != nil { + return + } + err = core.UnmarshalModel(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth, UnmarshalInstanceProfileVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_architecture", &obj.VcpuArchitecture, UnmarshalInstanceProfileVcpuArchitecture) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalInstanceProfileVcpu) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListLoadBalancerListenerPolicyRulesOptions : The ListLoadBalancerListenerPolicyRules options. -type ListLoadBalancerListenerPolicyRulesOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// InstanceProfileBandwidth : InstanceProfileBandwidth struct +// Models which "extend" this model: +// - InstanceProfileBandwidthFixed +// - InstanceProfileBandwidthRange +// - InstanceProfileBandwidthEnum +// - InstanceProfileBandwidthDependent +type InstanceProfileBandwidth struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// NewListLoadBalancerListenerPolicyRulesOptions : Instantiate ListLoadBalancerListenerPolicyRulesOptions -func (*VpcV1) NewListLoadBalancerListenerPolicyRulesOptions(loadBalancerID string, listenerID string, policyID string) *ListLoadBalancerListenerPolicyRulesOptions { - return &ListLoadBalancerListenerPolicyRulesOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - } -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetListenerID : Allow user to set ListenerID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetPolicyID : Allow user to set PolicyID -func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetPolicyID(policyID string) *ListLoadBalancerListenerPolicyRulesOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} +// Constants associated with the InstanceProfileBandwidth.Type property. +// The type for this profile field. +const ( + InstanceProfileBandwidthTypeFixedConst = "fixed" +) -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenerPolicyRulesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPolicyRulesOptions { - options.Headers = param - return options +func (*InstanceProfileBandwidth) isaInstanceProfileBandwidth() bool { + return true } -// ListLoadBalancerListenersOptions : The ListLoadBalancerListeners options. -type ListLoadBalancerListenersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +type InstanceProfileBandwidthIntf interface { + isaInstanceProfileBandwidth() bool } -// NewListLoadBalancerListenersOptions : Instantiate ListLoadBalancerListenersOptions -func (*VpcV1) NewListLoadBalancerListenersOptions(loadBalancerID string) *ListLoadBalancerListenersOptions { - return &ListLoadBalancerListenersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), +// UnmarshalInstanceProfileBandwidth unmarshals an instance of InstanceProfileBandwidth from the specified map of raw messages. +func UnmarshalInstanceProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileBandwidth) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerListenersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// InstanceProfileCollection : InstanceProfileCollection struct +type InstanceProfileCollection struct { + // Collection of virtual server instance profiles. + Profiles []InstanceProfile `json:"profiles" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerListenersOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenersOptions { - options.Headers = param - return options +// UnmarshalInstanceProfileCollection unmarshals an instance of InstanceProfileCollection from the specified map of raw messages. +func UnmarshalInstanceProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileCollection) + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalInstanceProfile) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListLoadBalancerPoolMembersOptions : The ListLoadBalancerPoolMembers options. -type ListLoadBalancerPoolMembersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// InstanceProfileDisk : Disks provided by this profile. +type InstanceProfileDisk struct { + Quantity InstanceProfileDiskQuantityIntf `json:"quantity" validate:"required"` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + Size InstanceProfileDiskSizeIntf `json:"size" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + SupportedInterfaceTypes *InstanceProfileDiskSupportedInterfaces `json:"supported_interface_types" validate:"required"` } -// NewListLoadBalancerPoolMembersOptions : Instantiate ListLoadBalancerPoolMembersOptions -func (*VpcV1) NewListLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string) *ListLoadBalancerPoolMembersOptions { - return &ListLoadBalancerPoolMembersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), +// UnmarshalInstanceProfileDisk unmarshals an instance of InstanceProfileDisk from the specified map of raw messages. +func UnmarshalInstanceProfileDisk(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDisk) + err = core.UnmarshalModel(m, "quantity", &obj.Quantity, UnmarshalInstanceProfileDiskQuantity) + if err != nil { + return } + err = core.UnmarshalModel(m, "size", &obj.Size, UnmarshalInstanceProfileDiskSize) + if err != nil { + return + } + err = core.UnmarshalModel(m, "supported_interface_types", &obj.SupportedInterfaceTypes, UnmarshalInstanceProfileDiskSupportedInterfaces) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolMembersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - -// SetPoolID : Allow user to set PoolID -func (_options *ListLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ListLoadBalancerPoolMembersOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} +// InstanceProfileDiskQuantity : InstanceProfileDiskQuantity struct +// Models which "extend" this model: +// - InstanceProfileDiskQuantityFixed +// - InstanceProfileDiskQuantityRange +// - InstanceProfileDiskQuantityEnum +// - InstanceProfileDiskQuantityDependent +type InstanceProfileDiskQuantity struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolMembersOptions { - options.Headers = param - return options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// ListLoadBalancerPoolsOptions : The ListLoadBalancerPools options. -type ListLoadBalancerPoolsOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// NewListLoadBalancerPoolsOptions : Instantiate ListLoadBalancerPoolsOptions -func (*VpcV1) NewListLoadBalancerPoolsOptions(loadBalancerID string) *ListLoadBalancerPoolsOptions { - return &ListLoadBalancerPoolsOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - } -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ListLoadBalancerPoolsOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolsOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerPoolsOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolsOptions { - options.Headers = param - return options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// ListLoadBalancerProfilesOptions : The ListLoadBalancerProfiles options. -type ListLoadBalancerProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the InstanceProfileDiskQuantity.Type property. +// The type for this profile field. +const ( + InstanceProfileDiskQuantityTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*InstanceProfileDiskQuantity) isaInstanceProfileDiskQuantity() bool { + return true } -// NewListLoadBalancerProfilesOptions : Instantiate ListLoadBalancerProfilesOptions -func (*VpcV1) NewListLoadBalancerProfilesOptions() *ListLoadBalancerProfilesOptions { - return &ListLoadBalancerProfilesOptions{} +type InstanceProfileDiskQuantityIntf interface { + isaInstanceProfileDiskQuantity() bool } -// SetStart : Allow user to set Start -func (_options *ListLoadBalancerProfilesOptions) SetStart(start string) *ListLoadBalancerProfilesOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalInstanceProfileDiskQuantity unmarshals an instance of InstanceProfileDiskQuantity from the specified map of raw messages. +func UnmarshalInstanceProfileDiskQuantity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskQuantity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListLoadBalancerProfilesOptions) SetLimit(limit int64) *ListLoadBalancerProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// InstanceProfileDiskSize : InstanceProfileDiskSize struct +// Models which "extend" this model: +// - InstanceProfileDiskSizeFixed +// - InstanceProfileDiskSizeRange +// - InstanceProfileDiskSizeEnum +// - InstanceProfileDiskSizeDependent +type InstanceProfileDiskSize struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancerProfilesOptions) SetHeaders(param map[string]string) *ListLoadBalancerProfilesOptions { - options.Headers = param - return options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// ListLoadBalancersOptions : The ListLoadBalancers options. -type ListLoadBalancersOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// NewListLoadBalancersOptions : Instantiate ListLoadBalancersOptions -func (*VpcV1) NewListLoadBalancersOptions() *ListLoadBalancersOptions { - return &ListLoadBalancersOptions{} -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListLoadBalancersOptions) SetStart(start string) *ListLoadBalancersOptions { - _options.Start = core.StringPtr(start) - return _options + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetLimit : Allow user to set Limit -func (_options *ListLoadBalancersOptions) SetLimit(limit int64) *ListLoadBalancersOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// Constants associated with the InstanceProfileDiskSize.Type property. +// The type for this profile field. +const ( + InstanceProfileDiskSizeTypeFixedConst = "fixed" +) -// SetHeaders : Allow user to set Headers -func (options *ListLoadBalancersOptions) SetHeaders(param map[string]string) *ListLoadBalancersOptions { - options.Headers = param - return options +func (*InstanceProfileDiskSize) isaInstanceProfileDiskSize() bool { + return true } -// ListNetworkACLRulesOptions : The ListNetworkACLRules options. -type ListNetworkACLRulesOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` +type InstanceProfileDiskSizeIntf interface { + isaInstanceProfileDiskSize() bool +} - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// UnmarshalInstanceProfileDiskSize unmarshals an instance of InstanceProfileDiskSize from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSize) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// InstanceProfileDiskSupportedInterfaces : InstanceProfileDiskSupportedInterfaces struct +type InstanceProfileDiskSupportedInterfaces struct { + // The disk interface used for attaching the disk. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Default *string `json:"default" validate:"required"` - // Filters the collection to rules with the specified direction. - Direction *string `json:"direction,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The supported disk interfaces used for attaching the disk. + Values []string `json:"values" validate:"required"` } -// Constants associated with the ListNetworkACLRulesOptions.Direction property. -// Filters the collection to rules with the specified direction. +// Constants associated with the InstanceProfileDiskSupportedInterfaces.Default property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. const ( - ListNetworkACLRulesOptionsDirectionInboundConst = "inbound" - ListNetworkACLRulesOptionsDirectionOutboundConst = "outbound" + InstanceProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" + InstanceProfileDiskSupportedInterfacesDefaultVirtioBlkConst = "virtio_blk" ) -// NewListNetworkACLRulesOptions : Instantiate ListNetworkACLRulesOptions -func (*VpcV1) NewListNetworkACLRulesOptions(networkACLID string) *ListNetworkACLRulesOptions { - return &ListNetworkACLRulesOptions{ - NetworkACLID: core.StringPtr(networkACLID), - } -} +// Constants associated with the InstanceProfileDiskSupportedInterfaces.Type property. +// The type for this profile field. +const ( + InstanceProfileDiskSupportedInterfacesTypeEnumConst = "enum" +) -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *ListNetworkACLRulesOptions) SetNetworkACLID(networkACLID string) *ListNetworkACLRulesOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} +// Constants associated with the InstanceProfileDiskSupportedInterfaces.Values property. +// The disk interface used for attaching the disk. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceProfileDiskSupportedInterfacesValuesNvmeConst = "nvme" + InstanceProfileDiskSupportedInterfacesValuesVirtioBlkConst = "virtio_blk" +) -// SetStart : Allow user to set Start -func (_options *ListNetworkACLRulesOptions) SetStart(start string) *ListNetworkACLRulesOptions { - _options.Start = core.StringPtr(start) - return _options +// UnmarshalInstanceProfileDiskSupportedInterfaces unmarshals an instance of InstanceProfileDiskSupportedInterfaces from the specified map of raw messages. +func UnmarshalInstanceProfileDiskSupportedInterfaces(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileDiskSupportedInterfaces) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLimit : Allow user to set Limit -func (_options *ListNetworkACLRulesOptions) SetLimit(limit int64) *ListNetworkACLRulesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} +// InstanceProfileGpu : InstanceProfileGpu struct +// Models which "extend" this model: +// - InstanceProfileGpuFixed +// - InstanceProfileGpuRange +// - InstanceProfileGpuEnum +// - InstanceProfileGpuDependent +type InstanceProfileGpu struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetDirection : Allow user to set Direction -func (_options *ListNetworkACLRulesOptions) SetDirection(direction string) *ListNetworkACLRulesOptions { - _options.Direction = core.StringPtr(direction) - return _options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListNetworkACLRulesOptions) SetHeaders(param map[string]string) *ListNetworkACLRulesOptions { - options.Headers = param - return options -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// ListNetworkAclsOptions : The ListNetworkAcls options. -type ListNetworkAclsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// NewListNetworkAclsOptions : Instantiate ListNetworkAclsOptions -func (*VpcV1) NewListNetworkAclsOptions() *ListNetworkAclsOptions { - return &ListNetworkAclsOptions{} -} +// Constants associated with the InstanceProfileGpu.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuTypeFixedConst = "fixed" +) -// SetStart : Allow user to set Start -func (_options *ListNetworkAclsOptions) SetStart(start string) *ListNetworkAclsOptions { - _options.Start = core.StringPtr(start) - return _options +func (*InstanceProfileGpu) isaInstanceProfileGpu() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListNetworkAclsOptions) SetLimit(limit int64) *ListNetworkAclsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type InstanceProfileGpuIntf interface { + isaInstanceProfileGpu() bool } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListNetworkAclsOptions) SetResourceGroupID(resourceGroupID string) *ListNetworkAclsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +// UnmarshalInstanceProfileGpu unmarshals an instance of InstanceProfileGpu from the specified map of raw messages. +func UnmarshalInstanceProfileGpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpu) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ListNetworkAclsOptions) SetHeaders(param map[string]string) *ListNetworkAclsOptions { - options.Headers = param - return options -} +// InstanceProfileGpuManufacturer : InstanceProfileGpuManufacturer struct +type InstanceProfileGpuManufacturer struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// ListOperatingSystemsOptions : The ListOperatingSystems options. -type ListOperatingSystemsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The possible GPU manufacturer(s) for an instance with this profile. + Values []string `json:"values" validate:"required"` +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the InstanceProfileGpuManufacturer.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuManufacturerTypeEnumConst = "enum" +) - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalInstanceProfileGpuManufacturer unmarshals an instance of InstanceProfileGpuManufacturer from the specified map of raw messages. +func UnmarshalInstanceProfileGpuManufacturer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuManufacturer) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListOperatingSystemsOptions : Instantiate ListOperatingSystemsOptions -func (*VpcV1) NewListOperatingSystemsOptions() *ListOperatingSystemsOptions { - return &ListOperatingSystemsOptions{} -} +// InstanceProfileGpuMemory : InstanceProfileGpuMemory struct +// Models which "extend" this model: +// - InstanceProfileGpuMemoryFixed +// - InstanceProfileGpuMemoryRange +// - InstanceProfileGpuMemoryEnum +// - InstanceProfileGpuMemoryDependent +type InstanceProfileGpuMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListOperatingSystemsOptions) SetStart(start string) *ListOperatingSystemsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListOperatingSystemsOptions) SetLimit(limit int64) *ListOperatingSystemsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListOperatingSystemsOptions) SetHeaders(param map[string]string) *ListOperatingSystemsOptions { - options.Headers = param - return options -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// ListPlacementGroupsOptions : The ListPlacementGroups options. -type ListPlacementGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// NewListPlacementGroupsOptions : Instantiate ListPlacementGroupsOptions -func (*VpcV1) NewListPlacementGroupsOptions() *ListPlacementGroupsOptions { - return &ListPlacementGroupsOptions{} -} +// Constants associated with the InstanceProfileGpuMemory.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuMemoryTypeFixedConst = "fixed" +) -// SetStart : Allow user to set Start -func (_options *ListPlacementGroupsOptions) SetStart(start string) *ListPlacementGroupsOptions { - _options.Start = core.StringPtr(start) - return _options +func (*InstanceProfileGpuMemory) isaInstanceProfileGpuMemory() bool { + return true } -// SetLimit : Allow user to set Limit -func (_options *ListPlacementGroupsOptions) SetLimit(limit int64) *ListPlacementGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type InstanceProfileGpuMemoryIntf interface { + isaInstanceProfileGpuMemory() bool } -// SetHeaders : Allow user to set Headers -func (options *ListPlacementGroupsOptions) SetHeaders(param map[string]string) *ListPlacementGroupsOptions { - options.Headers = param - return options +// UnmarshalInstanceProfileGpuMemory unmarshals an instance of InstanceProfileGpuMemory from the specified map of raw messages. +func UnmarshalInstanceProfileGpuMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListPublicGatewaysOptions : The ListPublicGateways options. -type ListPublicGatewaysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceProfileGpuModel : InstanceProfileGpuModel struct +type InstanceProfileGpuModel struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The possible GPU model(s) for an instance with this profile. + Values []string `json:"values" validate:"required"` +} - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// Constants associated with the InstanceProfileGpuModel.Type property. +// The type for this profile field. +const ( + InstanceProfileGpuModelTypeEnumConst = "enum" +) - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalInstanceProfileGpuModel unmarshals an instance of InstanceProfileGpuModel from the specified map of raw messages. +func UnmarshalInstanceProfileGpuModel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileGpuModel) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewListPublicGatewaysOptions : Instantiate ListPublicGatewaysOptions -func (*VpcV1) NewListPublicGatewaysOptions() *ListPublicGatewaysOptions { - return &ListPublicGatewaysOptions{} -} +// InstanceProfileIdentity : Identifies an instance profile by a unique property. +// Models which "extend" this model: +// - InstanceProfileIdentityByName +// - InstanceProfileIdentityByHref +type InstanceProfileIdentity struct { + // The globally unique name for this virtual server instance profile. + Name *string `json:"name,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListPublicGatewaysOptions) SetStart(start string) *ListPublicGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options + // The URL for this virtual server instance profile. + Href *string `json:"href,omitempty"` } -// SetLimit : Allow user to set Limit -func (_options *ListPublicGatewaysOptions) SetLimit(limit int64) *ListPublicGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +func (*InstanceProfileIdentity) isaInstanceProfileIdentity() bool { + return true } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListPublicGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListPublicGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +type InstanceProfileIdentityIntf interface { + isaInstanceProfileIdentity() bool } -// SetHeaders : Allow user to set Headers -func (options *ListPublicGatewaysOptions) SetHeaders(param map[string]string) *ListPublicGatewaysOptions { - options.Headers = param - return options +// UnmarshalInstanceProfileIdentity unmarshals an instance of InstanceProfileIdentity from the specified map of raw messages. +func UnmarshalInstanceProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListRegionZonesOptions : The ListRegionZones options. -type ListRegionZonesOptions struct { - // The region name. - RegionName *string `json:"region_name" validate:"required,ne="` +// InstanceProfileMemory : InstanceProfileMemory struct +// Models which "extend" this model: +// - InstanceProfileMemoryFixed +// - InstanceProfileMemoryRange +// - InstanceProfileMemoryEnum +// - InstanceProfileMemoryDependent +type InstanceProfileMemory struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The value for this profile field. + Value *int64 `json:"value,omitempty"` -// NewListRegionZonesOptions : Instantiate ListRegionZonesOptions -func (*VpcV1) NewListRegionZonesOptions(regionName string) *ListRegionZonesOptions { - return &ListRegionZonesOptions{ - RegionName: core.StringPtr(regionName), - } -} + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` -// SetRegionName : Allow user to set RegionName -func (_options *ListRegionZonesOptions) SetRegionName(regionName string) *ListRegionZonesOptions { - _options.RegionName = core.StringPtr(regionName) - return _options -} + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListRegionZonesOptions) SetHeaders(param map[string]string) *ListRegionZonesOptions { - options.Headers = param - return options -} + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` -// ListRegionsOptions : The ListRegions options. -type ListRegionsOptions struct { + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// NewListRegionsOptions : Instantiate ListRegionsOptions -func (*VpcV1) NewListRegionsOptions() *ListRegionsOptions { - return &ListRegionsOptions{} -} +// Constants associated with the InstanceProfileMemory.Type property. +// The type for this profile field. +const ( + InstanceProfileMemoryTypeFixedConst = "fixed" +) -// SetHeaders : Allow user to set Headers -func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegionsOptions { - options.Headers = param - return options +func (*InstanceProfileMemory) isaInstanceProfileMemory() bool { + return true } -// ListSecurityGroupNetworkInterfacesOptions : The ListSecurityGroupNetworkInterfaces options. -type ListSecurityGroupNetworkInterfacesOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +type InstanceProfileMemoryIntf interface { + isaInstanceProfileMemory() bool } -// NewListSecurityGroupNetworkInterfacesOptions : Instantiate ListSecurityGroupNetworkInterfacesOptions -func (*VpcV1) NewListSecurityGroupNetworkInterfacesOptions(securityGroupID string) *ListSecurityGroupNetworkInterfacesOptions { - return &ListSecurityGroupNetworkInterfacesOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), +// UnmarshalInstanceProfileMemory unmarshals an instance of InstanceProfileMemory from the specified map of raw messages. +func UnmarshalInstanceProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileMemory) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupNetworkInterfacesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupNetworkInterfacesOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupNetworkInterfacesOptions) SetStart(start string) *ListSecurityGroupNetworkInterfacesOptions { - _options.Start = core.StringPtr(start) - return _options -} +// InstanceProfileOsArchitecture : InstanceProfileOsArchitecture struct +type InstanceProfileOsArchitecture struct { + // The default OS architecture for an instance with this profile. + Default *string `json:"default" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupNetworkInterfacesOptions) SetLimit(limit int64) *ListSecurityGroupNetworkInterfacesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListSecurityGroupNetworkInterfacesOptions { - options.Headers = param - return options + // The supported OS architecture(s) for an instance with this profile. + Values []string `json:"values" validate:"required"` } -// ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. -type ListSecurityGroupRulesOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the InstanceProfileOsArchitecture.Type property. +// The type for this profile field. +const ( + InstanceProfileOsArchitectureTypeEnumConst = "enum" +) -// NewListSecurityGroupRulesOptions : Instantiate ListSecurityGroupRulesOptions -func (*VpcV1) NewListSecurityGroupRulesOptions(securityGroupID string) *ListSecurityGroupRulesOptions { - return &ListSecurityGroupRulesOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), +// UnmarshalInstanceProfileOsArchitecture unmarshals an instance of InstanceProfileOsArchitecture from the specified map of raw messages. +func UnmarshalInstanceProfileOsArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileOsArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupRulesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupRulesOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} +// InstanceProfilePortSpeed : InstanceProfilePortSpeed struct +// Models which "extend" this model: +// - InstanceProfilePortSpeedFixed +// - InstanceProfilePortSpeedDependent +type InstanceProfilePortSpeed struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupRulesOptions) SetHeaders(param map[string]string) *ListSecurityGroupRulesOptions { - options.Headers = param - return options + // The value for this profile field. + Value *int64 `json:"value,omitempty"` } -// ListSecurityGroupTargetsOptions : The ListSecurityGroupTargets options. -type ListSecurityGroupTargetsOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the InstanceProfilePortSpeed.Type property. +// The type for this profile field. +const ( + InstanceProfilePortSpeedTypeFixedConst = "fixed" +) - // Allows users to set headers on API requests - Headers map[string]string +func (*InstanceProfilePortSpeed) isaInstanceProfilePortSpeed() bool { + return true } -// NewListSecurityGroupTargetsOptions : Instantiate ListSecurityGroupTargetsOptions -func (*VpcV1) NewListSecurityGroupTargetsOptions(securityGroupID string) *ListSecurityGroupTargetsOptions { - return &ListSecurityGroupTargetsOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - } +type InstanceProfilePortSpeedIntf interface { + isaInstanceProfilePortSpeed() bool } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *ListSecurityGroupTargetsOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupTargetsOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options +// UnmarshalInstanceProfilePortSpeed unmarshals an instance of InstanceProfilePortSpeed from the specified map of raw messages. +func UnmarshalInstanceProfilePortSpeed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfilePortSpeed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupTargetsOptions) SetStart(start string) *ListSecurityGroupTargetsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// InstanceProfileReference : InstanceProfileReference struct +type InstanceProfileReference struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupTargetsOptions) SetLimit(limit int64) *ListSecurityGroupTargetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupTargetsOptions) SetHeaders(param map[string]string) *ListSecurityGroupTargetsOptions { - options.Headers = param - return options +// UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. +func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListSecurityGroupsOptions : The ListSecurityGroups options. -type ListSecurityGroupsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// InstanceProfileVcpu : InstanceProfileVcpu struct +// Models which "extend" this model: +// - InstanceProfileVcpuFixed +// - InstanceProfileVcpuRange +// - InstanceProfileVcpuEnum +// - InstanceProfileVcpuDependent +type InstanceProfileVcpu struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // Filters the collection to resources in the VPC with the specified identifier. - VPCID *string `json:"vpc.id,omitempty"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Filters the collection to resources in the VPC with the specified CRN. - VPCCRN *string `json:"vpc.crn,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // Filters the collection to resources in the VPC with the exact specified name. - VPCName *string `json:"vpc.name,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` -// NewListSecurityGroupsOptions : Instantiate ListSecurityGroupsOptions -func (*VpcV1) NewListSecurityGroupsOptions() *ListSecurityGroupsOptions { - return &ListSecurityGroupsOptions{} + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// SetStart : Allow user to set Start -func (_options *ListSecurityGroupsOptions) SetStart(start string) *ListSecurityGroupsOptions { - _options.Start = core.StringPtr(start) - return _options -} +// Constants associated with the InstanceProfileVcpu.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuTypeFixedConst = "fixed" +) -// SetLimit : Allow user to set Limit -func (_options *ListSecurityGroupsOptions) SetLimit(limit int64) *ListSecurityGroupsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +func (*InstanceProfileVcpu) isaInstanceProfileVcpu() bool { + return true } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSecurityGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSecurityGroupsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options +type InstanceProfileVcpuIntf interface { + isaInstanceProfileVcpu() bool } -// SetVPCID : Allow user to set VPCID -func (_options *ListSecurityGroupsOptions) SetVPCID(vpcID string) *ListSecurityGroupsOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// UnmarshalInstanceProfileVcpu unmarshals an instance of InstanceProfileVcpu from the specified map of raw messages. +func UnmarshalInstanceProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpu) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCCRN : Allow user to set VPCCRN -func (_options *ListSecurityGroupsOptions) SetVPCCRN(vpcCRN string) *ListSecurityGroupsOptions { - _options.VPCCRN = core.StringPtr(vpcCRN) - return _options -} +// InstanceProfileVcpuArchitecture : InstanceProfileVcpuArchitecture struct +type InstanceProfileVcpuArchitecture struct { + // The default VCPU architecture for an instance with this profile. + Default *string `json:"default,omitempty"` -// SetVPCName : Allow user to set VPCName -func (_options *ListSecurityGroupsOptions) SetVPCName(vpcName string) *ListSecurityGroupsOptions { - _options.VPCName = core.StringPtr(vpcName) - return _options -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListSecurityGroupsOptions) SetHeaders(param map[string]string) *ListSecurityGroupsOptions { - options.Headers = param - return options + // The VCPU architecture for an instance with this profile. + Value *string `json:"value" validate:"required"` } -// ListSnapshotsOptions : The ListSnapshots options. -type ListSnapshotsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// Constants associated with the InstanceProfileVcpuArchitecture.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuArchitectureTypeFixedConst = "fixed" +) - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` +// UnmarshalInstanceProfileVcpuArchitecture unmarshals an instance of InstanceProfileVcpuArchitecture from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuArchitecture) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` +// InstanceProfileVolumeBandwidth : InstanceProfileVolumeBandwidth struct +// Models which "extend" this model: +// - InstanceProfileVolumeBandwidthFixed +// - InstanceProfileVolumeBandwidthRange +// - InstanceProfileVolumeBandwidthEnum +// - InstanceProfileVolumeBandwidthDependent +type InstanceProfileVolumeBandwidth struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // Filters the collection to resources with the source volume with the specified identifier. - SourceVolumeID *string `json:"source_volume.id,omitempty"` + // The value for this profile field. + Value *int64 `json:"value,omitempty"` - // Filters the collection to resources with the source volume with the specified CRN. - SourceVolumeCRN *string `json:"source_volume.crn,omitempty"` + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` - // Filters the collection to resources with the source image with the specified identifier. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // source image or any existent source image, respectively. - SourceImageID *string `json:"source_image.id,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` - // Filters the collection to resources with the source volume with the specified CRN. - // - // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no - // source image or any existent source image, respectively. - SourceImageCRN *string `json:"source_image.crn,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` } -// Constants associated with the ListSnapshotsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. +// Constants associated with the InstanceProfileVolumeBandwidth.Type property. +// The type for this profile field. const ( - ListSnapshotsOptionsSortCreatedAtConst = "created_at" - ListSnapshotsOptionsSortNameConst = "name" + InstanceProfileVolumeBandwidthTypeFixedConst = "fixed" ) -// NewListSnapshotsOptions : Instantiate ListSnapshotsOptions -func (*VpcV1) NewListSnapshotsOptions() *ListSnapshotsOptions { - return &ListSnapshotsOptions{} -} - -// SetStart : Allow user to set Start -func (_options *ListSnapshotsOptions) SetStart(start string) *ListSnapshotsOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListSnapshotsOptions) SetLimit(limit int64) *ListSnapshotsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} - -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSnapshotsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} - -// SetName : Allow user to set Name -func (_options *ListSnapshotsOptions) SetName(name string) *ListSnapshotsOptions { - _options.Name = core.StringPtr(name) - return _options +func (*InstanceProfileVolumeBandwidth) isaInstanceProfileVolumeBandwidth() bool { + return true } -// SetSourceVolumeID : Allow user to set SourceVolumeID -func (_options *ListSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *ListSnapshotsOptions { - _options.SourceVolumeID = core.StringPtr(sourceVolumeID) - return _options +type InstanceProfileVolumeBandwidthIntf interface { + isaInstanceProfileVolumeBandwidth() bool } -// SetSourceVolumeCRN : Allow user to set SourceVolumeCRN -func (_options *ListSnapshotsOptions) SetSourceVolumeCRN(sourceVolumeCRN string) *ListSnapshotsOptions { - _options.SourceVolumeCRN = core.StringPtr(sourceVolumeCRN) - return _options +// UnmarshalInstanceProfileVolumeBandwidth unmarshals an instance of InstanceProfileVolumeBandwidth from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidth) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSourceImageID : Allow user to set SourceImageID -func (_options *ListSnapshotsOptions) SetSourceImageID(sourceImageID string) *ListSnapshotsOptions { - _options.SourceImageID = core.StringPtr(sourceImageID) - return _options -} +// InstancePrototype : InstancePrototype struct +// Models which "extend" this model: +// - InstancePrototypeInstanceByImage +// - InstancePrototypeInstanceByVolume +// - InstancePrototypeInstanceBySourceTemplate +type InstancePrototype struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` -// SetSourceImageCRN : Allow user to set SourceImageCRN -func (_options *ListSnapshotsOptions) SetSourceImageCRN(sourceImageCRN string) *ListSnapshotsOptions { - _options.SourceImageCRN = core.StringPtr(sourceImageCRN) - return _options -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// SetSort : Allow user to set Sort -func (_options *ListSnapshotsOptions) SetSort(sort string) *ListSnapshotsOptions { - _options.Sort = core.StringPtr(sort) - return _options -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListSnapshotsOptions) SetHeaders(param map[string]string) *ListSnapshotsOptions { - options.Headers = param - return options -} + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` -// ListSubnetReservedIpsOptions : The ListSubnetReservedIps options. -type ListSubnetReservedIpsOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The additional network interfaces to create for the virtual server instance. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The placement restrictions to use for the virtual server instance. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name - // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property - // in descending order, and the value `name` sorts it by the `name` property in ascending order. - Sort *string `json:"sort,omitempty"` + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will + // be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// Constants associated with the ListSubnetReservedIpsOptions.Sort property. -// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name -// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property -// in descending order, and the value `name` sorts it by the `name` property in ascending order. -const ( - ListSubnetReservedIpsOptionsSortAddressConst = "address" - ListSubnetReservedIpsOptionsSortCreatedAtConst = "created_at" - ListSubnetReservedIpsOptionsSortNameConst = "name" -) + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -// NewListSubnetReservedIpsOptions : Instantiate ListSubnetReservedIpsOptions -func (*VpcV1) NewListSubnetReservedIpsOptions(subnetID string) *ListSubnetReservedIpsOptions { - return &ListSubnetReservedIpsOptions{ - SubnetID: core.StringPtr(subnetID), - } -} + // User data to be made available when setting up the virtual server instance. + UserData *string `json:"user_data,omitempty"` -// SetSubnetID : Allow user to set SubnetID -func (_options *ListSubnetReservedIpsOptions) SetSubnetID(subnetID string) *ListSubnetReservedIpsOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} + // The volume attachments for this virtual server instance. + VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListSubnetReservedIpsOptions) SetStart(start string) *ListSubnetReservedIpsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The VPC the virtual server instance is to be a part of. If specified, it must match + // the VPC referenced by the subnets of the instance's network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListSubnetReservedIpsOptions) SetLimit(limit int64) *ListSubnetReservedIpsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` + + // Primary network interface. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` } -// SetSort : Allow user to set Sort -func (_options *ListSubnetReservedIpsOptions) SetSort(sort string) *ListSubnetReservedIpsOptions { - _options.Sort = core.StringPtr(sort) - return _options +func (*InstancePrototype) isaInstancePrototype() bool { + return true } -// SetHeaders : Allow user to set Headers -func (options *ListSubnetReservedIpsOptions) SetHeaders(param map[string]string) *ListSubnetReservedIpsOptions { - options.Headers = param - return options +type InstancePrototypeIntf interface { + isaInstancePrototype() bool } -// ListSubnetsOptions : The ListSubnets options. -type ListSubnetsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// UnmarshalInstancePrototype unmarshals an instance of InstancePrototype from the specified map of raw messages. +func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototype) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` +// InstanceReference : InstanceReference struct +type InstanceReference struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn" validate:"required"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - // Filters the collection to subnets attached to the routing table with the specified identifier. - RoutingTableID *string `json:"routing_table.id,omitempty"` + // The URL for this virtual server instance. + Href *string `json:"href" validate:"required"` - // Filters the collection to subnets attached to the routing table with the specified name. - RoutingTableName *string `json:"routing_table.name,omitempty"` + // The unique identifier for this virtual server instance. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The user-defined name for this virtual server instance (and default system hostname). + Name *string `json:"name" validate:"required"` } -// NewListSubnetsOptions : Instantiate ListSubnetsOptions -func (*VpcV1) NewListSubnetsOptions() *ListSubnetsOptions { - return &ListSubnetsOptions{} +// UnmarshalInstanceReference unmarshals an instance of InstanceReference from the specified map of raw messages. +func UnmarshalInstanceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListSubnetsOptions) SetStart(start string) *ListSubnetsOptions { - _options.Start = core.StringPtr(start) - return _options +// InstanceReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type InstanceReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListSubnetsOptions) SetLimit(limit int64) *ListSubnetsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstanceReferenceDeleted unmarshals an instance of InstanceReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListSubnetsOptions) SetResourceGroupID(resourceGroupID string) *ListSubnetsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// InstanceStatusReason : InstanceStatusReason struct +type InstanceStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *ListSubnetsOptions) SetRoutingTableID(routingTableID string) *ListSubnetsOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` -// SetRoutingTableName : Allow user to set RoutingTableName -func (_options *ListSubnetsOptions) SetRoutingTableName(routingTableName string) *ListSubnetsOptions { - _options.RoutingTableName = core.StringPtr(routingTableName) - return _options + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListSubnetsOptions) SetHeaders(param map[string]string) *ListSubnetsOptions { - options.Headers = param - return options +// Constants associated with the InstanceStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + InstanceStatusReasonCodeCannotStartConst = "cannot_start" + InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" + InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" + InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" + InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" + InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" + InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" + InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" + InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" + InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" +) + +// UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. +func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVolumeProfilesOptions : The ListVolumeProfiles options. -type ListVolumeProfilesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceTemplate : InstanceTemplate struct +// Models which "extend" this model: +// - InstanceTemplateInstanceByImage +// - InstanceTemplateInstanceByVolume +type InstanceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The date and time that the instance template was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` -// NewListVolumeProfilesOptions : Instantiate ListVolumeProfilesOptions -func (*VpcV1) NewListVolumeProfilesOptions() *ListVolumeProfilesOptions { - return &ListVolumeProfilesOptions{} -} + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListVolumeProfilesOptions) SetStart(start string) *ListVolumeProfilesOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The URL for this instance template. + Href *string `json:"href" validate:"required"` -// SetLimit : Allow user to set Limit -func (_options *ListVolumeProfilesOptions) SetLimit(limit int64) *ListVolumeProfilesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ListVolumeProfilesOptions) SetHeaders(param map[string]string) *ListVolumeProfilesOptions { - options.Headers = param - return options -} + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` -// ListVolumesOptions : The ListVolumes options. -type ListVolumesOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The unique user-defined name for this instance template. + Name *string `json:"name" validate:"required"` - // Filters the collection to resources with the exact specified name. - Name *string `json:"name,omitempty"` + // The additional network interfaces to create for the virtual server instance. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - // Filters the collection to resources in the zone with the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + // The placement restrictions to use for the virtual server instance. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will + // be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -// NewListVolumesOptions : Instantiate ListVolumesOptions -func (*VpcV1) NewListVolumesOptions() *ListVolumesOptions { - return &ListVolumesOptions{} -} + // The resource group for this instance template. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// SetStart : Allow user to set Start -func (_options *ListVolumesOptions) SetStart(start string) *ListVolumesOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListVolumesOptions) SetLimit(limit int64) *ListVolumesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // User data to be made available when setting up the virtual server instance. + UserData *string `json:"user_data,omitempty"` -// SetName : Allow user to set Name -func (_options *ListVolumesOptions) SetName(name string) *ListVolumesOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The volume attachments for this virtual server instance. + VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` -// SetZoneName : Allow user to set ZoneName -func (_options *ListVolumesOptions) SetZoneName(zoneName string) *ListVolumesOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} + // The VPC the virtual server instance is to be a part of. If specified, it must match + // the VPC referenced by the subnets of the instance's network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListVolumesOptions) SetHeaders(param map[string]string) *ListVolumesOptions { - options.Headers = param - return options -} + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` -// ListVPCAddressPrefixesOptions : The ListVPCAddressPrefixes options. -type ListVPCAddressPrefixesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // Primary network interface. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` +} - // Allows users to set headers on API requests - Headers map[string]string +func (*InstanceTemplate) isaInstanceTemplate() bool { + return true } -// NewListVPCAddressPrefixesOptions : Instantiate ListVPCAddressPrefixesOptions -func (*VpcV1) NewListVPCAddressPrefixesOptions(vpcID string) *ListVPCAddressPrefixesOptions { - return &ListVPCAddressPrefixesOptions{ - VPCID: core.StringPtr(vpcID), - } -} - -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCAddressPrefixesOptions) SetVPCID(vpcID string) *ListVPCAddressPrefixesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCAddressPrefixesOptions) SetStart(start string) *ListVPCAddressPrefixesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCAddressPrefixesOptions) SetLimit(limit int64) *ListVPCAddressPrefixesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +type InstanceTemplateIntf interface { + isaInstanceTemplate() bool } -// SetHeaders : Allow user to set Headers -func (options *ListVPCAddressPrefixesOptions) SetHeaders(param map[string]string) *ListVPCAddressPrefixesOptions { - options.Headers = param - return options +// UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. +func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVPCRoutesOptions : The ListVPCRoutes options. -type ListVPCRoutesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// InstanceTemplateCollection : InstanceTemplateCollection struct +type InstanceTemplateCollection struct { + // A link to the first page of resources. + First *InstanceTemplateCollectionFirst `json:"first" validate:"required"` - // Filters the collection to resources in the zone with the exact specified name. - ZoneName *string `json:"zone.name,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *InstanceTemplateCollectionNext `json:"next,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // Collection of instance templates. + Templates []InstanceTemplateIntf `json:"templates" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewListVPCRoutesOptions : Instantiate ListVPCRoutesOptions -func (*VpcV1) NewListVPCRoutesOptions(vpcID string) *ListVPCRoutesOptions { - return &ListVPCRoutesOptions{ - VPCID: core.StringPtr(vpcID), +// UnmarshalInstanceTemplateCollection unmarshals an instance of InstanceTemplateCollection from the specified map of raw messages. +func UnmarshalInstanceTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalInstanceTemplateCollectionFirst) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalInstanceTemplateCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "templates", &obj.Templates, UnmarshalInstanceTemplate) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetZoneName : Allow user to set ZoneName -func (_options *ListVPCRoutesOptions) SetZoneName(zoneName string) *ListVPCRoutesOptions { - _options.ZoneName = core.StringPtr(zoneName) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCRoutesOptions) SetStart(start string) *ListVPCRoutesOptions { - _options.Start = core.StringPtr(start) - return _options -} - -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutesOptions) SetLimit(limit int64) *ListVPCRoutesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// InstanceTemplateCollectionFirst : A link to the first page of resources. +type InstanceTemplateCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListVPCRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutesOptions { - options.Headers = param - return options +// UnmarshalInstanceTemplateCollectionFirst unmarshals an instance of InstanceTemplateCollectionFirst from the specified map of raw messages. +func UnmarshalInstanceTemplateCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ListVPCRoutingTableRoutesOptions : The ListVPCRoutingTableRoutes options. -type ListVPCRoutingTableRoutesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// InstanceTemplateCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type InstanceTemplateCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewListVPCRoutingTableRoutesOptions : Instantiate ListVPCRoutingTableRoutesOptions -func (*VpcV1) NewListVPCRoutingTableRoutesOptions(vpcID string, routingTableID string) *ListVPCRoutingTableRoutesOptions { - return &ListVPCRoutingTableRoutesOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), +// UnmarshalInstanceTemplateCollectionNext unmarshals an instance of InstanceTemplateCollectionNext from the specified map of raw messages. +func UnmarshalInstanceTemplateCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutingTableRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutingTableRoutesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *ListVPCRoutingTableRoutesOptions) SetRoutingTableID(routingTableID string) *ListVPCRoutingTableRoutesOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options -} +// InstanceTemplateIdentity : Identifies an instance template by a unique property. +// Models which "extend" this model: +// - InstanceTemplateIdentityByID +// - InstanceTemplateIdentityByHref +// - InstanceTemplateIdentityByCRN +type InstanceTemplateIdentity struct { + // The unique identifier for this instance template. + ID *string `json:"id,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListVPCRoutingTableRoutesOptions) SetStart(start string) *ListVPCRoutingTableRoutesOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The URL for this instance template. + Href *string `json:"href,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutingTableRoutesOptions) SetLimit(limit int64) *ListVPCRoutingTableRoutesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options + // The CRN for this instance template. + CRN *string `json:"crn,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListVPCRoutingTableRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTableRoutesOptions { - options.Headers = param - return options +func (*InstanceTemplateIdentity) isaInstanceTemplateIdentity() bool { + return true } -// ListVPCRoutingTablesOptions : The ListVPCRoutingTables options. -type ListVPCRoutingTablesOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` - - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` - - // Filters the collection to routing tables with the specified `is_default` value. - IsDefault *bool `json:"is_default,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +type InstanceTemplateIdentityIntf interface { + isaInstanceTemplateIdentity() bool } -// NewListVPCRoutingTablesOptions : Instantiate ListVPCRoutingTablesOptions -func (*VpcV1) NewListVPCRoutingTablesOptions(vpcID string) *ListVPCRoutingTablesOptions { - return &ListVPCRoutingTablesOptions{ - VPCID: core.StringPtr(vpcID), +// UnmarshalInstanceTemplateIdentity unmarshals an instance of InstanceTemplateIdentity from the specified map of raw messages. +func UnmarshalInstanceTemplateIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *ListVPCRoutingTablesOptions) SetVPCID(vpcID string) *ListVPCRoutingTablesOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetStart : Allow user to set Start -func (_options *ListVPCRoutingTablesOptions) SetStart(start string) *ListVPCRoutingTablesOptions { - _options.Start = core.StringPtr(start) - return _options +// InstanceTemplatePatch : InstanceTemplatePatch struct +type InstanceTemplatePatch struct { + // The unique user-defined name for this instance template. + Name *string `json:"name,omitempty"` } -// SetLimit : Allow user to set Limit -func (_options *ListVPCRoutingTablesOptions) SetLimit(limit int64) *ListVPCRoutingTablesOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstanceTemplatePatch unmarshals an instance of InstanceTemplatePatch from the specified map of raw messages. +func UnmarshalInstanceTemplatePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetIsDefault : Allow user to set IsDefault -func (_options *ListVPCRoutingTablesOptions) SetIsDefault(isDefault bool) *ListVPCRoutingTablesOptions { - _options.IsDefault = core.BoolPtr(isDefault) - return _options +// AsPatch returns a generic map representation of the InstanceTemplatePatch +func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(instanceTemplatePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ListVPCRoutingTablesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTablesOptions { - options.Headers = param - return options -} +// InstanceTemplatePrototype : InstanceTemplatePrototype struct +// Models which "extend" this model: +// - InstanceTemplatePrototypeInstanceByImage +// - InstanceTemplatePrototypeInstanceByVolume +// - InstanceTemplatePrototypeInstanceBySourceTemplate +type InstanceTemplatePrototype struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` -// ListVpcsOptions : The ListVpcs options. -type ListVpcsOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` + // The default trusted profile configuration to use for this virtual server instance + // + // This property's value is used when provisioning the virtual server instance, but not + // subsequently managed. Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + // property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the + // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as + // SSH authorized keys for the administrative user. + // + // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator + // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if + // no keys are specified, the instance will be inaccessible unless the specified image provides another means of + // access. + // + // This property's value is used when provisioning the virtual server instance, but not subsequently managed. + // Accordingly, it is reflected as an [instance + // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + Keys []KeyIdentityIntf `json:"keys,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - // Filters the collection to VPCs with the specified `classic_access` value. - ClassicAccess *bool `json:"classic_access,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The additional network interfaces to create for the virtual server instance. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` -// NewListVpcsOptions : Instantiate ListVpcsOptions -func (*VpcV1) NewListVpcsOptions() *ListVpcsOptions { - return &ListVpcsOptions{} -} + // The placement restrictions to use for the virtual server instance. + PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` -// SetStart : Allow user to set Start -func (_options *ListVpcsOptions) SetStart(start string) *ListVpcsOptions { - _options.Start = core.StringPtr(start) - return _options -} + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will + // be used, but this default value is expected to change in the future. + Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` -// SetLimit : Allow user to set Limit -func (_options *ListVpcsOptions) SetLimit(limit int64) *ListVpcsOptions { - _options.Limit = core.Int64Ptr(limit) - return _options -} + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVpcsOptions) SetResourceGroupID(resourceGroupID string) *ListVpcsOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in + // this value will result in a corresponding decrease to + // `total_network_bandwidth`. + TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` -// SetClassicAccess : Allow user to set ClassicAccess -func (_options *ListVpcsOptions) SetClassicAccess(classicAccess bool) *ListVpcsOptions { - _options.ClassicAccess = core.BoolPtr(classicAccess) - return _options -} + // User data to be made available when setting up the virtual server instance. + UserData *string `json:"user_data,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOptions { - options.Headers = param - return options -} + // The volume attachments for this virtual server instance. + VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` -// ListVPNGatewayConnectionLocalCIDRsOptions : The ListVPNGatewayConnectionLocalCIDRs options. -type ListVPNGatewayConnectionLocalCIDRsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + // The VPC the virtual server instance is to be a part of. If specified, it must match + // the VPC referenced by the subnets of the instance's network interfaces. + VPC VPCIdentityIntf `json:"vpc,omitempty"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The boot volume attachment for the virtual server instance. + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` -// NewListVPNGatewayConnectionLocalCIDRsOptions : Instantiate ListVPNGatewayConnectionLocalCIDRsOptions -func (*VpcV1) NewListVPNGatewayConnectionLocalCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionLocalCIDRsOptions { - return &ListVPNGatewayConnectionLocalCIDRsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - } -} + // Primary network interface. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionLocalCIDRsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} + // The zone this virtual server instance will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` -// SetID : Allow user to set ID -func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionLocalCIDRsOptions { - _options.ID = core.StringPtr(id) - return _options + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionLocalCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionLocalCIDRsOptions { - options.Headers = param - return options +func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { + return true } -// ListVPNGatewayConnectionPeerCIDRsOptions : The ListVPNGatewayConnectionPeerCIDRs options. -type ListVPNGatewayConnectionPeerCIDRsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string +type InstanceTemplatePrototypeIntf interface { + isaInstanceTemplatePrototype() bool } -// NewListVPNGatewayConnectionPeerCIDRsOptions : Instantiate ListVPNGatewayConnectionPeerCIDRsOptions -func (*VpcV1) NewListVPNGatewayConnectionPeerCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionPeerCIDRsOptions { - return &ListVPNGatewayConnectionPeerCIDRsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), +// UnmarshalInstanceTemplatePrototype unmarshals an instance of InstanceTemplatePrototype from the specified map of raw messages. +func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplatePrototype) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return } -} - -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionPeerCIDRsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionPeerCIDRsOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionPeerCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionPeerCIDRsOptions { - options.Headers = param - return options -} - -// ListVPNGatewayConnectionsOptions : The ListVPNGatewayConnections options. -type ListVPNGatewayConnectionsOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - - // Filters the collection to VPN gateway connections with the specified status. - Status *string `json:"status,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewListVPNGatewayConnectionsOptions : Instantiate ListVPNGatewayConnectionsOptions -func (*VpcV1) NewListVPNGatewayConnectionsOptions(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { - return &ListVPNGatewayConnectionsOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *ListVPNGatewayConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} - -// SetStatus : Allow user to set Status -func (_options *ListVPNGatewayConnectionsOptions) SetStatus(status string) *ListVPNGatewayConnectionsOptions { - _options.Status = core.StringPtr(status) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewayConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionsOptions { - options.Headers = param - return options -} - -// ListVPNGatewaysOptions : The ListVPNGateways options. -type ListVPNGatewaysOptions struct { - // A server-provided token determining what resource to start the page on. - Start *string `json:"start,omitempty"` +// InstanceTemplateReference : InstanceTemplateReference struct +type InstanceTemplateReference struct { + // The CRN for this instance template. + CRN *string `json:"crn" validate:"required"` - // The number of resources to return on a page. - Limit *int64 `json:"limit,omitempty"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *InstanceTemplateReferenceDeleted `json:"deleted,omitempty"` - // Filters the collection to resources in the resource group with the specified identifier. - ResourceGroupID *string `json:"resource_group.id,omitempty"` + // The URL for this instance template. + Href *string `json:"href" validate:"required"` - // Filters the collection to VPN gateways with the specified mode. - Mode *string `json:"mode,omitempty"` + // The unique identifier for this instance template. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The unique user-defined name for this instance template. + Name *string `json:"name" validate:"required"` } -// Constants associated with the ListVPNGatewaysOptions.Mode property. -// Filters the collection to VPN gateways with the specified mode. -const ( - ListVPNGatewaysOptionsModePolicyConst = "policy" - ListVPNGatewaysOptionsModeRouteConst = "route" -) - -// NewListVPNGatewaysOptions : Instantiate ListVPNGatewaysOptions -func (*VpcV1) NewListVPNGatewaysOptions() *ListVPNGatewaysOptions { - return &ListVPNGatewaysOptions{} +// UnmarshalInstanceTemplateReference unmarshals an instance of InstanceTemplateReference from the specified map of raw messages. +func UnmarshalInstanceTemplateReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceTemplateReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetStart : Allow user to set Start -func (_options *ListVPNGatewaysOptions) SetStart(start string) *ListVPNGatewaysOptions { - _options.Start = core.StringPtr(start) - return _options +// InstanceTemplateReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type InstanceTemplateReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetLimit : Allow user to set Limit -func (_options *ListVPNGatewaysOptions) SetLimit(limit int64) *ListVPNGatewaysOptions { - _options.Limit = core.Int64Ptr(limit) - return _options +// UnmarshalInstanceTemplateReferenceDeleted unmarshals an instance of InstanceTemplateReferenceDeleted from the specified map of raw messages. +func UnmarshalInstanceTemplateReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceTemplateReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetResourceGroupID : Allow user to set ResourceGroupID -func (_options *ListVPNGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListVPNGatewaysOptions { - _options.ResourceGroupID = core.StringPtr(resourceGroupID) - return _options -} +// InstanceVcpu : The virtual server instance VCPU configuration. +type InstanceVcpu struct { + // The VCPU architecture. + Architecture *string `json:"architecture" validate:"required"` -// SetMode : Allow user to set Mode -func (_options *ListVPNGatewaysOptions) SetMode(mode string) *ListVPNGatewaysOptions { - _options.Mode = core.StringPtr(mode) - return _options + // The number of VCPUs assigned. + Count *int64 `json:"count" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ListVPNGatewaysOptions) SetHeaders(param map[string]string) *ListVPNGatewaysOptions { - options.Headers = param - return options +// UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. +func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceVcpu) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// LoadBalancer : LoadBalancer struct -type LoadBalancer struct { - // The date and time that this load balancer was created. +// Key : Key struct +type Key struct { + // The date and time that the key was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The load balancer's CRN. + // The CRN for this key. CRN *string `json:"crn" validate:"required"` - // Fully qualified domain name assigned to this load balancer. - Hostname *string `json:"hostname" validate:"required"` + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint" validate:"required"` - // The load balancer's canonical URL. + // The URL for this key. Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer. + // The unique identifier for this key. ID *string `json:"id" validate:"required"` - // The type of this load balancer, public or private. - IsPublic *bool `json:"is_public" validate:"required"` - - // The listeners of this load balancer. - Listeners []LoadBalancerListenerReference `json:"listeners" validate:"required"` - - // The logging configuration for this load balancer. - Logging *LoadBalancerLogging `json:"logging" validate:"required"` + // The length of this key (in bits). + Length *int64 `json:"length" validate:"required"` - // The unique user-defined name for this load balancer. + // The unique user-defined name for this key. If unspecified, the name will be a hyphenated list of randomly-selected + // words. Name *string `json:"name" validate:"required"` - // The operating status of this load balancer. - OperatingStatus *string `json:"operating_status" validate:"required"` - - // The pools of this load balancer. - Pools []LoadBalancerPoolReference `json:"pools" validate:"required"` - - // The private IP addresses assigned to this load balancer. - PrivateIps []IP `json:"private_ips" validate:"required"` - - // The profile to use for this load balancer. - Profile *LoadBalancerProfileReference `json:"profile" validate:"required"` - - // The provisioning status of this load balancer. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The public IP addresses assigned to this load balancer. - // - // Applicable only for public load balancers. - PublicIps []IP `json:"public_ips" validate:"required"` + // The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. + PublicKey *string `json:"public_key" validate:"required"` - // The resource group for this load balancer. + // The resource group for this key. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // Indicates whether route mode is enabled for this load balancer. - // - // At present, public load balancers are not supported with route mode enabled. - RouteMode *bool `json:"route_mode" validate:"required"` - - // The security groups targeting this load balancer. - // - // Applicable only for load balancers that support security groups. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // Indicates whether this load balancer supports security groups. - SecurityGroupsSupported *bool `json:"security_groups_supported" validate:"required"` - - // The subnets this load balancer is part of. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The crypto-system used by this key. + Type *string `json:"type" validate:"required"` } -// Constants associated with the LoadBalancer.OperatingStatus property. -// The operating status of this load balancer. -const ( - LoadBalancerOperatingStatusOfflineConst = "offline" - LoadBalancerOperatingStatusOnlineConst = "online" -) - -// Constants associated with the LoadBalancer.ProvisioningStatus property. -// The provisioning status of this load balancer. +// Constants associated with the Key.Type property. +// The crypto-system used by this key. const ( - LoadBalancerProvisioningStatusActiveConst = "active" - LoadBalancerProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerProvisioningStatusFailedConst = "failed" - LoadBalancerProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerProvisioningStatusUpdatePendingConst = "update_pending" + KeyTypeRsaConst = "rsa" ) -// UnmarshalLoadBalancer unmarshals an instance of LoadBalancer from the specified map of raw messages. -func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancer) +// UnmarshalKey unmarshals an instance of Key from the specified map of raw messages. +func UnmarshalKey(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Key) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -37528,7 +39214,7 @@ func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) if err != nil { return } @@ -37540,15 +39226,7 @@ func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "is_public", &obj.IsPublic) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) + err = core.UnmarshalPrimitive(m, "length", &obj.Length) if err != nil { return } @@ -37556,27 +39234,7 @@ func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "operating_status", &obj.OperatingStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPoolReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalIP) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalLoadBalancerProfileReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_ips", &obj.PublicIps, UnmarshalIP) + err = core.UnmarshalPrimitive(m, "public_key", &obj.PublicKey) if err != nil { return } @@ -37584,19 +39242,7 @@ func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "route_mode", &obj.RouteMode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "security_groups_supported", &obj.SecurityGroupsSupported) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -37604,41 +39250,41 @@ func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (er return } -// LoadBalancerCollection : LoadBalancerCollection struct -type LoadBalancerCollection struct { +// KeyCollection : KeyCollection struct +type KeyCollection struct { // A link to the first page of resources. - First *LoadBalancerCollectionFirst `json:"first" validate:"required"` + First *KeyCollectionFirst `json:"first" validate:"required"` + + // Collection of keys. + Keys []Key `json:"keys" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` - // Collection of load balancers. - LoadBalancers []LoadBalancer `json:"load_balancers" validate:"required"` - // A link to the next page of resources. This property is present for all pages // except the last page. - Next *LoadBalancerCollectionNext `json:"next,omitempty"` + Next *KeyCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerCollection unmarshals an instance of LoadBalancerCollection from the specified map of raw messages. -func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerCollectionFirst) +// UnmarshalKeyCollection unmarshals an instance of KeyCollection from the specified map of raw messages. +func UnmarshalKeyCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalKeyCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKey) if err != nil { return } - err = core.UnmarshalModel(m, "load_balancers", &obj.LoadBalancers, UnmarshalLoadBalancer) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalKeyCollectionNext) if err != nil { return } @@ -37651,7 +39297,7 @@ func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interf } // Retrieve the value to be passed to a request to access the next page of results -func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { +func (resp *KeyCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -37662,15 +39308,15 @@ func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { return start, nil } -// LoadBalancerCollectionFirst : A link to the first page of resources. -type LoadBalancerCollectionFirst struct { +// KeyCollectionFirst : A link to the first page of resources. +type KeyCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerCollectionFirst unmarshals an instance of LoadBalancerCollectionFirst from the specified map of raw messages. -func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollectionFirst) +// UnmarshalKeyCollectionFirst unmarshals an instance of KeyCollectionFirst from the specified map of raw messages. +func UnmarshalKeyCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -37679,15 +39325,15 @@ func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result i return } -// LoadBalancerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type LoadBalancerCollectionNext struct { +// KeyCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type KeyCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerCollectionNext unmarshals an instance of LoadBalancerCollectionNext from the specified map of raw messages. -func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerCollectionNext) +// UnmarshalKeyCollectionNext unmarshals an instance of KeyCollectionNext from the specified map of raw messages. +func UnmarshalKeyCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -37696,33 +39342,38 @@ func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result in return } -// LoadBalancerIdentity : Identifies a load balancer by a unique property. +// KeyIdentity : Identifies a key by a unique property. // Models which "extend" this model: -// - LoadBalancerIdentityByID -// - LoadBalancerIdentityByCRN -// - LoadBalancerIdentityByHref -type LoadBalancerIdentity struct { - // The unique identifier for this load balancer. +// - KeyIdentityByID +// - KeyIdentityByCRN +// - KeyIdentityByHref +// - KeyIdentityByFingerprint +type KeyIdentity struct { + // The unique identifier for this key. ID *string `json:"id,omitempty"` - // The load balancer's CRN. + // The CRN for this key. CRN *string `json:"crn,omitempty"` - // The load balancer's canonical URL. + // The URL for this key. Href *string `json:"href,omitempty"` + + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint,omitempty"` } -func (*LoadBalancerIdentity) isaLoadBalancerIdentity() bool { +func (*KeyIdentity) isaKeyIdentity() bool { return true } -type LoadBalancerIdentityIntf interface { - isaLoadBalancerIdentity() bool +type KeyIdentityIntf interface { + isaKeyIdentity() bool } -// UnmarshalLoadBalancerIdentity unmarshals an instance of LoadBalancerIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerIdentity) +// UnmarshalKeyIdentity unmarshals an instance of KeyIdentity from the specified map of raw messages. +func UnmarshalKeyIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -37735,108 +39386,76 @@ func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interfac if err != nil { return } + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListener : LoadBalancerListener struct -type LoadBalancerListener struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol" validate:"required"` +// KeyPatch : KeyPatch struct +type KeyPatch struct { + // The user-defined name for this key. + Name *string `json:"name,omitempty"` +} - // The certificate instance used for SSL termination. It is applicable only to `https` - // protocol. - CertificateInstance *CertificateInstanceReference `json:"certificate_instance,omitempty"` +// UnmarshalKeyPatch unmarshals an instance of KeyPatch from the specified map of raw messages. +func UnmarshalKeyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// AsPatch returns a generic map representation of the KeyPatch +func (keyPatch *KeyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(keyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The date and time that this listener was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// KeyReference : KeyReference struct +type KeyReference struct { + // The CRN for this key. + CRN *string `json:"crn" validate:"required"` - // The default pool associated with the listener. - DefaultPool *LoadBalancerPoolReference `json:"default_pool,omitempty"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *KeyReferenceDeleted `json:"deleted,omitempty"` - // The listener's canonical URL. - Href *string `json:"href" validate:"required"` + // The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always + // `SHA256`). + Fingerprint *string `json:"fingerprint" validate:"required"` - // If specified, the target listener that requests are redirected to. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirect `json:"https_redirect,omitempty"` + // The URL for this key. + Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer listener. + // The unique identifier for this key. ID *string `json:"id" validate:"required"` - // The policies for this listener. - Policies []LoadBalancerListenerPolicyReference `json:"policies,omitempty"` - - // The listener port number, or the inclusive lower bound of the port range. - Port *int64 `json:"port" validate:"required"` - - // The inclusive upper bound of the range of ports used by this listener. - // - // Only load balancers in the `network` family support more than one port per listener. - PortMax *int64 `json:"port_max" validate:"required"` - - // The inclusive lower bound of the range of ports used by this listener. - // - // Only load balancers in the `network` family support more than one port per listener. - PortMin *int64 `json:"port_min" validate:"required"` - - // The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` - // family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and - // `protocol` combination. - Protocol *string `json:"protocol" validate:"required"` - - // The provisioning status of this listener. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + // The user-defined name for this key. + Name *string `json:"name" validate:"required"` } -// Constants associated with the LoadBalancerListener.Protocol property. -// The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` -// family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and -// `protocol` combination. -const ( - LoadBalancerListenerProtocolHTTPConst = "http" - LoadBalancerListenerProtocolHTTPSConst = "https" - LoadBalancerListenerProtocolTCPConst = "tcp" -) - -// Constants associated with the LoadBalancerListener.ProvisioningStatus property. -// The provisioning status of this listener. -const ( - LoadBalancerListenerProvisioningStatusActiveConst = "active" - LoadBalancerListenerProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerProvisioningStatusFailedConst = "failed" - LoadBalancerListenerProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerListenerProvisioningStatusUpdatePendingConst = "update_pending" -) - -// UnmarshalLoadBalancerListener unmarshals an instance of LoadBalancerListener from the specified map of raw messages. -func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListener) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) +// UnmarshalKeyReference unmarshals an instance of KeyReference from the specified map of raw messages. +func UnmarshalKeyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalKeyReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolReference) + err = core.UnmarshalPrimitive(m, "fingerprint", &obj.Fingerprint) if err != nil { return } @@ -37844,35 +39463,11 @@ func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirect) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -37880,16 +39475,17 @@ func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interfac return } -// LoadBalancerListenerCollection : LoadBalancerListenerCollection struct -type LoadBalancerListenerCollection struct { - // Collection of listeners. - Listeners []LoadBalancerListener `json:"listeners" validate:"required"` +// KeyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type KeyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalLoadBalancerListenerCollection unmarshals an instance of LoadBalancerListenerCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerCollection) - err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListener) +// UnmarshalKeyReferenceDeleted unmarshals an instance of KeyReferenceDeleted from the specified map of raw messages. +func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KeyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -37897,381 +39493,3832 @@ func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, resul return } -// LoadBalancerListenerHTTPSRedirect : LoadBalancerListenerHTTPSRedirect struct -type LoadBalancerListenerHTTPSRedirect struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` - - Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` +// ListBareMetalServerDisksOptions : The ListBareMetalServerDisks options. +type ListBareMetalServerDisksOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerHTTPSRedirect from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirect) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return +// NewListBareMetalServerDisksOptions : Instantiate ListBareMetalServerDisksOptions +func (*VpcV1) NewListBareMetalServerDisksOptions(bareMetalServerID string) *ListBareMetalServerDisksOptions { + return &ListBareMetalServerDisksOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// LoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerHTTPSRedirectPatch struct -type LoadBalancerListenerHTTPSRedirectPatch struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerDisksOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerDisksOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -// UnmarshalLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirectPatch) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerDisksOptions) SetHeaders(param map[string]string) *ListBareMetalServerDisksOptions { + options.Headers = param + return options } -// LoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerHTTPSRedirectPrototype struct -type LoadBalancerListenerHTTPSRedirectPrototype struct { - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` +// ListBareMetalServerNetworkInterfaceFloatingIpsOptions : The ListBareMetalServerNetworkInterfaceFloatingIps options. +type ListBareMetalServerNetworkInterfaceFloatingIpsOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// NewLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerHTTPSRedirectPrototype, err error) { - _model = &LoadBalancerListenerHTTPSRedirectPrototype{ - HTTPStatusCode: core.Int64Ptr(httpStatusCode), - Listener: listener, +// NewListBareMetalServerNetworkInterfaceFloatingIpsOptions : Instantiate ListBareMetalServerNetworkInterfaceFloatingIpsOptions +func (*VpcV1) NewListBareMetalServerNetworkInterfaceFloatingIpsOptions(bareMetalServerID string, networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + return &ListBareMetalServerNetworkInterfaceFloatingIpsOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), } - err = core.ValidateStruct(_model, "required parameters") - return } -// UnmarshalLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerHTTPSRedirectPrototype) - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -// LoadBalancerListenerIdentity : Identifies a load balancer listener by a unique property. -// Models which "extend" this model: -// - LoadBalancerListenerIdentityByID -// - LoadBalancerListenerIdentityByHref -type LoadBalancerListenerIdentity struct { - // The unique identifier for this load balancer listener. - ID *string `json:"id,omitempty"` - - // The listener's canonical URL. - Href *string `json:"href,omitempty"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options } -func (*LoadBalancerListenerIdentity) isaLoadBalancerListenerIdentity() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfaceFloatingIpsOptions { + options.Headers = param + return options } -type LoadBalancerListenerIdentityIntf interface { - isaLoadBalancerListenerIdentity() bool +// ListBareMetalServerNetworkInterfacesOptions : The ListBareMetalServerNetworkInterfaces options. +type ListBareMetalServerNetworkInterfacesOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalLoadBalancerListenerIdentity unmarshals an instance of LoadBalancerListenerIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerListenerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewListBareMetalServerNetworkInterfacesOptions : Instantiate ListBareMetalServerNetworkInterfacesOptions +func (*VpcV1) NewListBareMetalServerNetworkInterfacesOptions(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { + return &ListBareMetalServerNetworkInterfacesOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// LoadBalancerListenerPatch : LoadBalancerListenerPatch struct -type LoadBalancerListenerPatch struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` - - // The certificate instance used for SSL termination. It is applicable only to `https` - // protocol. - CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *ListBareMetalServerNetworkInterfacesOptions) SetBareMetalServerID(bareMetalServerID string) *ListBareMetalServerNetworkInterfacesOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// SetStart : Allow user to set Start +func (_options *ListBareMetalServerNetworkInterfacesOptions) SetStart(start string) *ListBareMetalServerNetworkInterfacesOptions { + _options.Start = core.StringPtr(start) + return _options +} - // The default pool associated with the listener. The specified pool must: - // - // - Belong to this load balancer - // - Have the same `protocol` as this listener - // - Not already be the default pool for another listener. - DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServerNetworkInterfacesOptions) SetLimit(limit int64) *ListBareMetalServerNetworkInterfacesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} - // The target listener that requests will be redirected to. This listener must have a - // `protocol` of `http`, and the target listener must have a `protocol` of `https`. - // Specify `null` to remove any existing https redirect. - HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPatch `json:"https_redirect,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListBareMetalServerNetworkInterfacesOptions { + options.Headers = param + return options +} - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` +// ListBareMetalServerProfilesOptions : The ListBareMetalServerProfiles options. +type ListBareMetalServerProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled support different values for `port_min` and - // `port_max`. When route mode is enabled, the value - // `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. - // Additional restrictions: - // - If this load balancer is in the `network` family, the protocol must be `tcp`. - // - If this listener has `https_redirect` specified, the protocol must be `http`. - // - If this listener is a listener's `https_redirect` target, the protocol must be `https`. - Protocol *string `json:"protocol,omitempty"` +// NewListBareMetalServerProfilesOptions : Instantiate ListBareMetalServerProfilesOptions +func (*VpcV1) NewListBareMetalServerProfilesOptions() *ListBareMetalServerProfilesOptions { + return &ListBareMetalServerProfilesOptions{} } -// Constants associated with the LoadBalancerListenerPatch.Protocol property. -// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. -// Additional restrictions: -// - If this load balancer is in the `network` family, the protocol must be `tcp`. -// - If this listener has `https_redirect` specified, the protocol must be `http`. -// - If this listener is a listener's `https_redirect` target, the protocol must be `https`. -const ( - LoadBalancerListenerPatchProtocolHTTPConst = "http" - LoadBalancerListenerPatchProtocolHTTPSConst = "https" - LoadBalancerListenerPatchProtocolTCPConst = "tcp" -) +// SetStart : Allow user to set Start +func (_options *ListBareMetalServerProfilesOptions) SetStart(start string) *ListBareMetalServerProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} -// UnmarshalLoadBalancerListenerPatch unmarshals an instance of LoadBalancerListenerPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPatch) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) - if err != nil { - return - } - err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServerProfilesOptions) SetLimit(limit int64) *ListBareMetalServerProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// AsPatch returns a generic map representation of the LoadBalancerListenerPatch -func (loadBalancerListenerPatch *LoadBalancerListenerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServerProfilesOptions) SetHeaders(param map[string]string) *ListBareMetalServerProfilesOptions { + options.Headers = param + return options } -// LoadBalancerListenerPolicy : LoadBalancerListenerPolicy struct -type LoadBalancerListenerPolicy struct { - // The policy action. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the - // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` +// ListBareMetalServersOptions : The ListBareMetalServers options. +type ListBareMetalServersOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` - // The date and time that this policy was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` - // The listener policy's canonical URL. - Href *string `json:"href" validate:"required"` + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` - // The policy's unique identifier. - ID *string `json:"id" validate:"required"` + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` - // The user-defined name for this policy. - Name *string `json:"name" validate:"required"` + // Filters the collection to resources in the VPC with the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` + // Filters the collection to resources in the VPC with the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` - // The provisioning status of this policy. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + // Filters the collection to resources in the VPC with the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` - // The rules for this policy. - Rules []LoadBalancerListenerPolicyRuleReference `json:"rules" validate:"required"` + // Filters the collection to bare metal servers on the subnet with the specified identifier. + NetworkInterfacesSubnetID *string `json:"network_interfaces.subnet.id,omitempty"` - // - If `action` is `forward`, the response is a `LoadBalancerPoolReference` - // - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` - // - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. - Target LoadBalancerListenerPolicyTargetIntf `json:"target,omitempty"` + // Filters the collection to bare metal servers on the subnet with the specified CRN. + NetworkInterfacesSubnetCRN *string `json:"network_interfaces.subnet.crn,omitempty"` + + // Filters the collection to bare metal servers on the subnet with the specified name. + NetworkInterfacesSubnetName *string `json:"network_interfaces.subnet.name,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the LoadBalancerListenerPolicy.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. +// Constants associated with the ListBareMetalServersOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. const ( - LoadBalancerListenerPolicyActionForwardConst = "forward" - LoadBalancerListenerPolicyActionHTTPSRedirectConst = "https_redirect" - LoadBalancerListenerPolicyActionRedirectConst = "redirect" - LoadBalancerListenerPolicyActionRejectConst = "reject" + ListBareMetalServersOptionsSortCreatedAtConst = "created_at" + ListBareMetalServersOptionsSortNameConst = "name" ) -// Constants associated with the LoadBalancerListenerPolicy.ProvisioningStatus property. -// The provisioning status of this policy. -const ( - LoadBalancerListenerPolicyProvisioningStatusActiveConst = "active" - LoadBalancerListenerPolicyProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerPolicyProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerPolicyProvisioningStatusFailedConst = "failed" - LoadBalancerListenerPolicyProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerListenerPolicyProvisioningStatusUpdatePendingConst = "update_pending" -) +// NewListBareMetalServersOptions : Instantiate ListBareMetalServersOptions +func (*VpcV1) NewListBareMetalServersOptions() *ListBareMetalServersOptions { + return &ListBareMetalServersOptions{} +} -// UnmarshalLoadBalancerListenerPolicy unmarshals an instance of LoadBalancerListenerPolicy from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicy) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRuleReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTarget) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetStart : Allow user to set Start +func (_options *ListBareMetalServersOptions) SetStart(start string) *ListBareMetalServersOptions { + _options.Start = core.StringPtr(start) + return _options } -// LoadBalancerListenerPolicyCollection : LoadBalancerListenerPolicyCollection struct -type LoadBalancerListenerPolicyCollection struct { - // Collection of policies. - Policies []LoadBalancerListenerPolicy `json:"policies" validate:"required"` +// SetLimit : Allow user to set Limit +func (_options *ListBareMetalServersOptions) SetLimit(limit int64) *ListBareMetalServersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options } -// UnmarshalLoadBalancerListenerPolicyCollection unmarshals an instance of LoadBalancerListenerPolicyCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListBareMetalServersOptions) SetResourceGroupID(resourceGroupID string) *ListBareMetalServersOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListBareMetalServersOptions) SetName(name string) *ListBareMetalServersOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListBareMetalServersOptions) SetVPCID(vpcID string) *ListBareMetalServersOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListBareMetalServersOptions) SetVPCCRN(vpcCRN string) *ListBareMetalServersOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListBareMetalServersOptions) SetVPCName(vpcName string) *ListBareMetalServersOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetNetworkInterfacesSubnetID : Allow user to set NetworkInterfacesSubnetID +func (_options *ListBareMetalServersOptions) SetNetworkInterfacesSubnetID(networkInterfacesSubnetID string) *ListBareMetalServersOptions { + _options.NetworkInterfacesSubnetID = core.StringPtr(networkInterfacesSubnetID) + return _options +} + +// SetNetworkInterfacesSubnetCRN : Allow user to set NetworkInterfacesSubnetCRN +func (_options *ListBareMetalServersOptions) SetNetworkInterfacesSubnetCRN(networkInterfacesSubnetCRN string) *ListBareMetalServersOptions { + _options.NetworkInterfacesSubnetCRN = core.StringPtr(networkInterfacesSubnetCRN) + return _options +} + +// SetNetworkInterfacesSubnetName : Allow user to set NetworkInterfacesSubnetName +func (_options *ListBareMetalServersOptions) SetNetworkInterfacesSubnetName(networkInterfacesSubnetName string) *ListBareMetalServersOptions { + _options.NetworkInterfacesSubnetName = core.StringPtr(networkInterfacesSubnetName) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListBareMetalServersOptions) SetSort(sort string) *ListBareMetalServersOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListBareMetalServersOptions) SetHeaders(param map[string]string) *ListBareMetalServersOptions { + options.Headers = param + return options +} + +// ListDedicatedHostDisksOptions : The ListDedicatedHostDisks options. +type ListDedicatedHostDisksOptions struct { + // The dedicated host identifier. + DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostDisksOptions : Instantiate ListDedicatedHostDisksOptions +func (*VpcV1) NewListDedicatedHostDisksOptions(dedicatedHostID string) *ListDedicatedHostDisksOptions { + return &ListDedicatedHostDisksOptions{ + DedicatedHostID: core.StringPtr(dedicatedHostID), + } +} + +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *ListDedicatedHostDisksOptions) SetDedicatedHostID(dedicatedHostID string) *ListDedicatedHostDisksOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostDisksOptions) SetHeaders(param map[string]string) *ListDedicatedHostDisksOptions { + options.Headers = param + return options +} + +// ListDedicatedHostGroupsOptions : The ListDedicatedHostGroups options. +type ListDedicatedHostGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources in the zone with the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostGroupsOptions : Instantiate ListDedicatedHostGroupsOptions +func (*VpcV1) NewListDedicatedHostGroupsOptions() *ListDedicatedHostGroupsOptions { + return &ListDedicatedHostGroupsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListDedicatedHostGroupsOptions) SetStart(start string) *ListDedicatedHostGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListDedicatedHostGroupsOptions) SetLimit(limit int64) *ListDedicatedHostGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListDedicatedHostGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostGroupsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListDedicatedHostGroupsOptions) SetZoneName(zoneName string) *ListDedicatedHostGroupsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListDedicatedHostGroupsOptions) SetName(name string) *ListDedicatedHostGroupsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostGroupsOptions) SetHeaders(param map[string]string) *ListDedicatedHostGroupsOptions { + options.Headers = param + return options +} + +// ListDedicatedHostProfilesOptions : The ListDedicatedHostProfiles options. +type ListDedicatedHostProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostProfilesOptions : Instantiate ListDedicatedHostProfilesOptions +func (*VpcV1) NewListDedicatedHostProfilesOptions() *ListDedicatedHostProfilesOptions { + return &ListDedicatedHostProfilesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListDedicatedHostProfilesOptions) SetStart(start string) *ListDedicatedHostProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListDedicatedHostProfilesOptions) SetLimit(limit int64) *ListDedicatedHostProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostProfilesOptions) SetHeaders(param map[string]string) *ListDedicatedHostProfilesOptions { + options.Headers = param + return options +} + +// ListDedicatedHostsOptions : The ListDedicatedHosts options. +type ListDedicatedHostsOptions struct { + // Filters the collection to dedicated host groups with the specified identifier. + DedicatedHostGroupID *string `json:"dedicated_host_group.id,omitempty"` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources in the zone with the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListDedicatedHostsOptions : Instantiate ListDedicatedHostsOptions +func (*VpcV1) NewListDedicatedHostsOptions() *ListDedicatedHostsOptions { + return &ListDedicatedHostsOptions{} +} + +// SetDedicatedHostGroupID : Allow user to set DedicatedHostGroupID +func (_options *ListDedicatedHostsOptions) SetDedicatedHostGroupID(dedicatedHostGroupID string) *ListDedicatedHostsOptions { + _options.DedicatedHostGroupID = core.StringPtr(dedicatedHostGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListDedicatedHostsOptions) SetStart(start string) *ListDedicatedHostsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListDedicatedHostsOptions) SetLimit(limit int64) *ListDedicatedHostsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListDedicatedHostsOptions) SetResourceGroupID(resourceGroupID string) *ListDedicatedHostsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListDedicatedHostsOptions) SetZoneName(zoneName string) *ListDedicatedHostsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListDedicatedHostsOptions) SetName(name string) *ListDedicatedHostsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListDedicatedHostsOptions) SetHeaders(param map[string]string) *ListDedicatedHostsOptions { + options.Headers = param + return options +} + +// ListEndpointGatewayIpsOptions : The ListEndpointGatewayIps options. +type ListEndpointGatewayIpsOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListEndpointGatewayIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListEndpointGatewayIpsOptionsSortAddressConst = "address" + ListEndpointGatewayIpsOptionsSortCreatedAtConst = "created_at" + ListEndpointGatewayIpsOptionsSortNameConst = "name" +) + +// NewListEndpointGatewayIpsOptions : Instantiate ListEndpointGatewayIpsOptions +func (*VpcV1) NewListEndpointGatewayIpsOptions(endpointGatewayID string) *ListEndpointGatewayIpsOptions { + return &ListEndpointGatewayIpsOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *ListEndpointGatewayIpsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayIpsOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListEndpointGatewayIpsOptions) SetStart(start string) *ListEndpointGatewayIpsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListEndpointGatewayIpsOptions) SetLimit(limit int64) *ListEndpointGatewayIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListEndpointGatewayIpsOptions) SetSort(sort string) *ListEndpointGatewayIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayIpsOptions { + options.Headers = param + return options +} + +// ListEndpointGatewaysOptions : The ListEndpointGateways options. +type ListEndpointGatewaysOptions struct { + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListEndpointGatewaysOptions : Instantiate ListEndpointGatewaysOptions +func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { + return &ListEndpointGatewaysOptions{} +} + +// SetName : Allow user to set Name +func (_options *ListEndpointGatewaysOptions) SetName(name string) *ListEndpointGatewaysOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListEndpointGatewaysOptions) SetStart(start string) *ListEndpointGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListEndpointGatewaysOptions) SetLimit(limit int64) *ListEndpointGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListEndpointGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListEndpointGatewaysOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListEndpointGatewaysOptions) SetHeaders(param map[string]string) *ListEndpointGatewaysOptions { + options.Headers = param + return options +} + +// ListFloatingIpsOptions : The ListFloatingIps options. +type ListFloatingIpsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListFloatingIpsOptions : Instantiate ListFloatingIpsOptions +func (*VpcV1) NewListFloatingIpsOptions() *ListFloatingIpsOptions { + return &ListFloatingIpsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListFloatingIpsOptions) SetStart(start string) *ListFloatingIpsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListFloatingIpsOptions) SetLimit(limit int64) *ListFloatingIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListFloatingIpsOptions) SetResourceGroupID(resourceGroupID string) *ListFloatingIpsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListFloatingIpsOptions) SetHeaders(param map[string]string) *ListFloatingIpsOptions { + options.Headers = param + return options +} + +// ListFlowLogCollectorsOptions : The ListFlowLogCollectors options. +type ListFlowLogCollectorsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources in the VPC with the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources in the VPC with the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources in the VPC with the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Filters the collection to flow log collectors that target the specified resource. + TargetID *string `json:"target.id,omitempty"` + + // Filters the collection to flow log collectors that target the specified resource type. + TargetResourceType *string `json:"target.resource_type,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListFlowLogCollectorsOptions.TargetResourceType property. +// Filters the collection to flow log collectors that target the specified resource type. +const ( + ListFlowLogCollectorsOptionsTargetResourceTypeInstanceConst = "instance" + ListFlowLogCollectorsOptionsTargetResourceTypeNetworkInterfaceConst = "network_interface" + ListFlowLogCollectorsOptionsTargetResourceTypeSubnetConst = "subnet" + ListFlowLogCollectorsOptionsTargetResourceTypeVPCConst = "vpc" +) + +// NewListFlowLogCollectorsOptions : Instantiate ListFlowLogCollectorsOptions +func (*VpcV1) NewListFlowLogCollectorsOptions() *ListFlowLogCollectorsOptions { + return &ListFlowLogCollectorsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListFlowLogCollectorsOptions) SetStart(start string) *ListFlowLogCollectorsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListFlowLogCollectorsOptions) SetLimit(limit int64) *ListFlowLogCollectorsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListFlowLogCollectorsOptions) SetResourceGroupID(resourceGroupID string) *ListFlowLogCollectorsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListFlowLogCollectorsOptions) SetName(name string) *ListFlowLogCollectorsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListFlowLogCollectorsOptions) SetVPCID(vpcID string) *ListFlowLogCollectorsOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListFlowLogCollectorsOptions) SetVPCCRN(vpcCRN string) *ListFlowLogCollectorsOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListFlowLogCollectorsOptions) SetVPCName(vpcName string) *ListFlowLogCollectorsOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetTargetID : Allow user to set TargetID +func (_options *ListFlowLogCollectorsOptions) SetTargetID(targetID string) *ListFlowLogCollectorsOptions { + _options.TargetID = core.StringPtr(targetID) + return _options +} + +// SetTargetResourceType : Allow user to set TargetResourceType +func (_options *ListFlowLogCollectorsOptions) SetTargetResourceType(targetResourceType string) *ListFlowLogCollectorsOptions { + _options.TargetResourceType = core.StringPtr(targetResourceType) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListFlowLogCollectorsOptions) SetHeaders(param map[string]string) *ListFlowLogCollectorsOptions { + options.Headers = param + return options +} + +// ListIkePoliciesOptions : The ListIkePolicies options. +type ListIkePoliciesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIkePoliciesOptions : Instantiate ListIkePoliciesOptions +func (*VpcV1) NewListIkePoliciesOptions() *ListIkePoliciesOptions { + return &ListIkePoliciesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListIkePoliciesOptions) SetStart(start string) *ListIkePoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListIkePoliciesOptions) SetLimit(limit int64) *ListIkePoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIkePoliciesOptions) SetHeaders(param map[string]string) *ListIkePoliciesOptions { + options.Headers = param + return options +} + +// ListIkePolicyConnectionsOptions : The ListIkePolicyConnections options. +type ListIkePolicyConnectionsOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIkePolicyConnectionsOptions : Instantiate ListIkePolicyConnectionsOptions +func (*VpcV1) NewListIkePolicyConnectionsOptions(id string) *ListIkePolicyConnectionsOptions { + return &ListIkePolicyConnectionsOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ListIkePolicyConnectionsOptions) SetID(id string) *ListIkePolicyConnectionsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIkePolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIkePolicyConnectionsOptions { + options.Headers = param + return options +} + +// ListImagesOptions : The ListImages options. +type ListImagesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to images with the specified `visibility`. + Visibility *string `json:"visibility,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListImagesOptions.Visibility property. +// Filters the collection to images with the specified `visibility`. +const ( + ListImagesOptionsVisibilityPrivateConst = "private" + ListImagesOptionsVisibilityPublicConst = "public" +) + +// NewListImagesOptions : Instantiate ListImagesOptions +func (*VpcV1) NewListImagesOptions() *ListImagesOptions { + return &ListImagesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListImagesOptions) SetStart(start string) *ListImagesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListImagesOptions) SetLimit(limit int64) *ListImagesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListImagesOptions) SetResourceGroupID(resourceGroupID string) *ListImagesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListImagesOptions) SetName(name string) *ListImagesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVisibility : Allow user to set Visibility +func (_options *ListImagesOptions) SetVisibility(visibility string) *ListImagesOptions { + _options.Visibility = core.StringPtr(visibility) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListImagesOptions) SetHeaders(param map[string]string) *ListImagesOptions { + options.Headers = param + return options +} + +// ListInstanceDisksOptions : The ListInstanceDisks options. +type ListInstanceDisksOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceDisksOptions : Instantiate ListInstanceDisksOptions +func (*VpcV1) NewListInstanceDisksOptions(instanceID string) *ListInstanceDisksOptions { + return &ListInstanceDisksOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceDisksOptions) SetInstanceID(instanceID string) *ListInstanceDisksOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceDisksOptions) SetHeaders(param map[string]string) *ListInstanceDisksOptions { + options.Headers = param + return options +} + +// ListInstanceGroupManagerActionsOptions : The ListInstanceGroupManagerActions options. +type ListInstanceGroupManagerActionsOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupManagerActionsOptions : Instantiate ListInstanceGroupManagerActionsOptions +func (*VpcV1) NewListInstanceGroupManagerActionsOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { + return &ListInstanceGroupManagerActionsOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerActionsOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *ListInstanceGroupManagerActionsOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerActionsOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupManagerActionsOptions) SetStart(start string) *ListInstanceGroupManagerActionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupManagerActionsOptions) SetLimit(limit int64) *ListInstanceGroupManagerActionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupManagerActionsOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerActionsOptions { + options.Headers = param + return options +} + +// ListInstanceGroupManagerPoliciesOptions : The ListInstanceGroupManagerPolicies options. +type ListInstanceGroupManagerPoliciesOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupManagerPoliciesOptions : Instantiate ListInstanceGroupManagerPoliciesOptions +func (*VpcV1) NewListInstanceGroupManagerPoliciesOptions(instanceGroupID string, instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { + return &ListInstanceGroupManagerPoliciesOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagerPoliciesOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *ListInstanceGroupManagerPoliciesOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *ListInstanceGroupManagerPoliciesOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupManagerPoliciesOptions) SetStart(start string) *ListInstanceGroupManagerPoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupManagerPoliciesOptions) SetLimit(limit int64) *ListInstanceGroupManagerPoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupManagerPoliciesOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagerPoliciesOptions { + options.Headers = param + return options +} + +// ListInstanceGroupManagersOptions : The ListInstanceGroupManagers options. +type ListInstanceGroupManagersOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupManagersOptions : Instantiate ListInstanceGroupManagersOptions +func (*VpcV1) NewListInstanceGroupManagersOptions(instanceGroupID string) *ListInstanceGroupManagersOptions { + return &ListInstanceGroupManagersOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupManagersOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupManagersOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupManagersOptions) SetStart(start string) *ListInstanceGroupManagersOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupManagersOptions) SetLimit(limit int64) *ListInstanceGroupManagersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupManagersOptions) SetHeaders(param map[string]string) *ListInstanceGroupManagersOptions { + options.Headers = param + return options +} + +// ListInstanceGroupMembershipsOptions : The ListInstanceGroupMemberships options. +type ListInstanceGroupMembershipsOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupMembershipsOptions : Instantiate ListInstanceGroupMembershipsOptions +func (*VpcV1) NewListInstanceGroupMembershipsOptions(instanceGroupID string) *ListInstanceGroupMembershipsOptions { + return &ListInstanceGroupMembershipsOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + } +} + +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *ListInstanceGroupMembershipsOptions) SetInstanceGroupID(instanceGroupID string) *ListInstanceGroupMembershipsOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupMembershipsOptions) SetStart(start string) *ListInstanceGroupMembershipsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupMembershipsOptions) SetLimit(limit int64) *ListInstanceGroupMembershipsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupMembershipsOptions) SetHeaders(param map[string]string) *ListInstanceGroupMembershipsOptions { + options.Headers = param + return options +} + +// ListInstanceGroupsOptions : The ListInstanceGroups options. +type ListInstanceGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceGroupsOptions : Instantiate ListInstanceGroupsOptions +func (*VpcV1) NewListInstanceGroupsOptions() *ListInstanceGroupsOptions { + return &ListInstanceGroupsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListInstanceGroupsOptions) SetStart(start string) *ListInstanceGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceGroupsOptions) SetLimit(limit int64) *ListInstanceGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceGroupsOptions) SetHeaders(param map[string]string) *ListInstanceGroupsOptions { + options.Headers = param + return options +} + +// ListInstanceNetworkInterfaceFloatingIpsOptions : The ListInstanceNetworkInterfaceFloatingIps options. +type ListInstanceNetworkInterfaceFloatingIpsOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceNetworkInterfaceFloatingIpsOptions : Instantiate ListInstanceNetworkInterfaceFloatingIpsOptions +func (*VpcV1) NewListInstanceNetworkInterfaceFloatingIpsOptions(instanceID string, networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + return &ListInstanceNetworkInterfaceFloatingIpsOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetNetworkInterfaceID(networkInterfaceID string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceNetworkInterfaceFloatingIpsOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfaceFloatingIpsOptions { + options.Headers = param + return options +} + +// ListInstanceNetworkInterfacesOptions : The ListInstanceNetworkInterfaces options. +type ListInstanceNetworkInterfacesOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceNetworkInterfacesOptions : Instantiate ListInstanceNetworkInterfacesOptions +func (*VpcV1) NewListInstanceNetworkInterfacesOptions(instanceID string) *ListInstanceNetworkInterfacesOptions { + return &ListInstanceNetworkInterfacesOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceNetworkInterfacesOptions) SetInstanceID(instanceID string) *ListInstanceNetworkInterfacesOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListInstanceNetworkInterfacesOptions { + options.Headers = param + return options +} + +// ListInstanceProfilesOptions : The ListInstanceProfiles options. +type ListInstanceProfilesOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceProfilesOptions : Instantiate ListInstanceProfilesOptions +func (*VpcV1) NewListInstanceProfilesOptions() *ListInstanceProfilesOptions { + return &ListInstanceProfilesOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceProfilesOptions) SetHeaders(param map[string]string) *ListInstanceProfilesOptions { + options.Headers = param + return options +} + +// ListInstanceTemplatesOptions : The ListInstanceTemplates options. +type ListInstanceTemplatesOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceTemplatesOptions : Instantiate ListInstanceTemplatesOptions +func (*VpcV1) NewListInstanceTemplatesOptions() *ListInstanceTemplatesOptions { + return &ListInstanceTemplatesOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceTemplatesOptions) SetHeaders(param map[string]string) *ListInstanceTemplatesOptions { + options.Headers = param + return options +} + +// ListInstanceVolumeAttachmentsOptions : The ListInstanceVolumeAttachments options. +type ListInstanceVolumeAttachmentsOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstanceVolumeAttachmentsOptions : Instantiate ListInstanceVolumeAttachmentsOptions +func (*VpcV1) NewListInstanceVolumeAttachmentsOptions(instanceID string) *ListInstanceVolumeAttachmentsOptions { + return &ListInstanceVolumeAttachmentsOptions{ + InstanceID: core.StringPtr(instanceID), + } +} + +// SetInstanceID : Allow user to set InstanceID +func (_options *ListInstanceVolumeAttachmentsOptions) SetInstanceID(instanceID string) *ListInstanceVolumeAttachmentsOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstanceVolumeAttachmentsOptions) SetHeaders(param map[string]string) *ListInstanceVolumeAttachmentsOptions { + options.Headers = param + return options +} + +// ListInstancesOptions : The ListInstances options. +type ListInstancesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources in the VPC with the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources in the VPC with the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources in the VPC with the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Filters the collection to instances on the dedicated host with the specified identifier. + DedicatedHostID *string `json:"dedicated_host.id,omitempty"` + + // Filters the collection to instances on the dedicated host with the specified CRN. + DedicatedHostCRN *string `json:"dedicated_host.crn,omitempty"` + + // Filters the collection to instances on the dedicated host with the specified name. + DedicatedHostName *string `json:"dedicated_host.name,omitempty"` + + // Filters the collection to instances in the placement group with the specified identifier. + PlacementGroupID *string `json:"placement_group.id,omitempty"` + + // Filters the collection to instances in the placement group with the specified CRN. + PlacementGroupCRN *string `json:"placement_group.crn,omitempty"` + + // Filters the collection to instances in the placement group with the specified name. + PlacementGroupName *string `json:"placement_group.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListInstancesOptions : Instantiate ListInstancesOptions +func (*VpcV1) NewListInstancesOptions() *ListInstancesOptions { + return &ListInstancesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListInstancesOptions) SetStart(start string) *ListInstancesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstancesOptions) SetLimit(limit int64) *ListInstancesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListInstancesOptions) SetResourceGroupID(resourceGroupID string) *ListInstancesOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListInstancesOptions) SetName(name string) *ListInstancesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListInstancesOptions) SetVPCID(vpcID string) *ListInstancesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListInstancesOptions) SetVPCCRN(vpcCRN string) *ListInstancesOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListInstancesOptions) SetVPCName(vpcName string) *ListInstancesOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *ListInstancesOptions) SetDedicatedHostID(dedicatedHostID string) *ListInstancesOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} + +// SetDedicatedHostCRN : Allow user to set DedicatedHostCRN +func (_options *ListInstancesOptions) SetDedicatedHostCRN(dedicatedHostCRN string) *ListInstancesOptions { + _options.DedicatedHostCRN = core.StringPtr(dedicatedHostCRN) + return _options +} + +// SetDedicatedHostName : Allow user to set DedicatedHostName +func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName string) *ListInstancesOptions { + _options.DedicatedHostName = core.StringPtr(dedicatedHostName) + return _options +} + +// SetPlacementGroupID : Allow user to set PlacementGroupID +func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { + _options.PlacementGroupID = core.StringPtr(placementGroupID) + return _options +} + +// SetPlacementGroupCRN : Allow user to set PlacementGroupCRN +func (_options *ListInstancesOptions) SetPlacementGroupCRN(placementGroupCRN string) *ListInstancesOptions { + _options.PlacementGroupCRN = core.StringPtr(placementGroupCRN) + return _options +} + +// SetPlacementGroupName : Allow user to set PlacementGroupName +func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName string) *ListInstancesOptions { + _options.PlacementGroupName = core.StringPtr(placementGroupName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { + options.Headers = param + return options +} + +// ListIpsecPoliciesOptions : The ListIpsecPolicies options. +type ListIpsecPoliciesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIpsecPoliciesOptions : Instantiate ListIpsecPoliciesOptions +func (*VpcV1) NewListIpsecPoliciesOptions() *ListIpsecPoliciesOptions { + return &ListIpsecPoliciesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListIpsecPoliciesOptions) SetStart(start string) *ListIpsecPoliciesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListIpsecPoliciesOptions) SetLimit(limit int64) *ListIpsecPoliciesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIpsecPoliciesOptions) SetHeaders(param map[string]string) *ListIpsecPoliciesOptions { + options.Headers = param + return options +} + +// ListIpsecPolicyConnectionsOptions : The ListIpsecPolicyConnections options. +type ListIpsecPolicyConnectionsOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListIpsecPolicyConnectionsOptions : Instantiate ListIpsecPolicyConnectionsOptions +func (*VpcV1) NewListIpsecPolicyConnectionsOptions(id string) *ListIpsecPolicyConnectionsOptions { + return &ListIpsecPolicyConnectionsOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ListIpsecPolicyConnectionsOptions) SetID(id string) *ListIpsecPolicyConnectionsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListIpsecPolicyConnectionsOptions) SetHeaders(param map[string]string) *ListIpsecPolicyConnectionsOptions { + options.Headers = param + return options +} + +// ListKeysOptions : The ListKeys options. +type ListKeysOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListKeysOptions : Instantiate ListKeysOptions +func (*VpcV1) NewListKeysOptions() *ListKeysOptions { + return &ListKeysOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListKeysOptions) SetStart(start string) *ListKeysOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListKeysOptions) SetLimit(limit int64) *ListKeysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListKeysOptions) SetHeaders(param map[string]string) *ListKeysOptions { + options.Headers = param + return options +} + +// ListLoadBalancerListenerPoliciesOptions : The ListLoadBalancerListenerPolicies options. +type ListLoadBalancerListenerPoliciesOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerListenerPoliciesOptions : Instantiate ListLoadBalancerListenerPoliciesOptions +func (*VpcV1) NewListLoadBalancerListenerPoliciesOptions(loadBalancerID string, listenerID string) *ListLoadBalancerListenerPoliciesOptions { + return &ListLoadBalancerListenerPoliciesOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + } +} + +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerListenerPoliciesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPoliciesOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetListenerID : Allow user to set ListenerID +func (_options *ListLoadBalancerListenerPoliciesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPoliciesOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerListenerPoliciesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPoliciesOptions { + options.Headers = param + return options +} + +// ListLoadBalancerListenerPolicyRulesOptions : The ListLoadBalancerListenerPolicyRules options. +type ListLoadBalancerListenerPolicyRulesOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerListenerPolicyRulesOptions : Instantiate ListLoadBalancerListenerPolicyRulesOptions +func (*VpcV1) NewListLoadBalancerListenerPolicyRulesOptions(loadBalancerID string, listenerID string, policyID string) *ListLoadBalancerListenerPolicyRulesOptions { + return &ListLoadBalancerListenerPolicyRulesOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + } +} + +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenerPolicyRulesOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetListenerID : Allow user to set ListenerID +func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetListenerID(listenerID string) *ListLoadBalancerListenerPolicyRulesOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} + +// SetPolicyID : Allow user to set PolicyID +func (_options *ListLoadBalancerListenerPolicyRulesOptions) SetPolicyID(policyID string) *ListLoadBalancerListenerPolicyRulesOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerListenerPolicyRulesOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenerPolicyRulesOptions { + options.Headers = param + return options +} + +// ListLoadBalancerListenersOptions : The ListLoadBalancerListeners options. +type ListLoadBalancerListenersOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerListenersOptions : Instantiate ListLoadBalancerListenersOptions +func (*VpcV1) NewListLoadBalancerListenersOptions(loadBalancerID string) *ListLoadBalancerListenersOptions { + return &ListLoadBalancerListenersOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + } +} + +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerListenersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerListenersOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerListenersOptions) SetHeaders(param map[string]string) *ListLoadBalancerListenersOptions { + options.Headers = param + return options +} + +// ListLoadBalancerPoolMembersOptions : The ListLoadBalancerPoolMembers options. +type ListLoadBalancerPoolMembersOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerPoolMembersOptions : Instantiate ListLoadBalancerPoolMembersOptions +func (*VpcV1) NewListLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string) *ListLoadBalancerPoolMembersOptions { + return &ListLoadBalancerPoolMembersOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + } +} + +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolMembersOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetPoolID : Allow user to set PoolID +func (_options *ListLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ListLoadBalancerPoolMembersOptions { + _options.PoolID = core.StringPtr(poolID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolMembersOptions { + options.Headers = param + return options +} + +// ListLoadBalancerPoolsOptions : The ListLoadBalancerPools options. +type ListLoadBalancerPoolsOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerPoolsOptions : Instantiate ListLoadBalancerPoolsOptions +func (*VpcV1) NewListLoadBalancerPoolsOptions(loadBalancerID string) *ListLoadBalancerPoolsOptions { + return &ListLoadBalancerPoolsOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + } +} + +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ListLoadBalancerPoolsOptions) SetLoadBalancerID(loadBalancerID string) *ListLoadBalancerPoolsOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerPoolsOptions) SetHeaders(param map[string]string) *ListLoadBalancerPoolsOptions { + options.Headers = param + return options +} + +// ListLoadBalancerProfilesOptions : The ListLoadBalancerProfiles options. +type ListLoadBalancerProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancerProfilesOptions : Instantiate ListLoadBalancerProfilesOptions +func (*VpcV1) NewListLoadBalancerProfilesOptions() *ListLoadBalancerProfilesOptions { + return &ListLoadBalancerProfilesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListLoadBalancerProfilesOptions) SetStart(start string) *ListLoadBalancerProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListLoadBalancerProfilesOptions) SetLimit(limit int64) *ListLoadBalancerProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancerProfilesOptions) SetHeaders(param map[string]string) *ListLoadBalancerProfilesOptions { + options.Headers = param + return options +} + +// ListLoadBalancersOptions : The ListLoadBalancers options. +type ListLoadBalancersOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListLoadBalancersOptions : Instantiate ListLoadBalancersOptions +func (*VpcV1) NewListLoadBalancersOptions() *ListLoadBalancersOptions { + return &ListLoadBalancersOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListLoadBalancersOptions) SetStart(start string) *ListLoadBalancersOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListLoadBalancersOptions) SetLimit(limit int64) *ListLoadBalancersOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListLoadBalancersOptions) SetHeaders(param map[string]string) *ListLoadBalancersOptions { + options.Headers = param + return options +} + +// ListNetworkACLRulesOptions : The ListNetworkACLRules options. +type ListNetworkACLRulesOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to rules with the specified direction. + Direction *string `json:"direction,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListNetworkACLRulesOptions.Direction property. +// Filters the collection to rules with the specified direction. +const ( + ListNetworkACLRulesOptionsDirectionInboundConst = "inbound" + ListNetworkACLRulesOptionsDirectionOutboundConst = "outbound" +) + +// NewListNetworkACLRulesOptions : Instantiate ListNetworkACLRulesOptions +func (*VpcV1) NewListNetworkACLRulesOptions(networkACLID string) *ListNetworkACLRulesOptions { + return &ListNetworkACLRulesOptions{ + NetworkACLID: core.StringPtr(networkACLID), + } +} + +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *ListNetworkACLRulesOptions) SetNetworkACLID(networkACLID string) *ListNetworkACLRulesOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListNetworkACLRulesOptions) SetStart(start string) *ListNetworkACLRulesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListNetworkACLRulesOptions) SetLimit(limit int64) *ListNetworkACLRulesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetDirection : Allow user to set Direction +func (_options *ListNetworkACLRulesOptions) SetDirection(direction string) *ListNetworkACLRulesOptions { + _options.Direction = core.StringPtr(direction) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListNetworkACLRulesOptions) SetHeaders(param map[string]string) *ListNetworkACLRulesOptions { + options.Headers = param + return options +} + +// ListNetworkAclsOptions : The ListNetworkAcls options. +type ListNetworkAclsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListNetworkAclsOptions : Instantiate ListNetworkAclsOptions +func (*VpcV1) NewListNetworkAclsOptions() *ListNetworkAclsOptions { + return &ListNetworkAclsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListNetworkAclsOptions) SetStart(start string) *ListNetworkAclsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListNetworkAclsOptions) SetLimit(limit int64) *ListNetworkAclsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListNetworkAclsOptions) SetResourceGroupID(resourceGroupID string) *ListNetworkAclsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListNetworkAclsOptions) SetHeaders(param map[string]string) *ListNetworkAclsOptions { + options.Headers = param + return options +} + +// ListOperatingSystemsOptions : The ListOperatingSystems options. +type ListOperatingSystemsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListOperatingSystemsOptions : Instantiate ListOperatingSystemsOptions +func (*VpcV1) NewListOperatingSystemsOptions() *ListOperatingSystemsOptions { + return &ListOperatingSystemsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListOperatingSystemsOptions) SetStart(start string) *ListOperatingSystemsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListOperatingSystemsOptions) SetLimit(limit int64) *ListOperatingSystemsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListOperatingSystemsOptions) SetHeaders(param map[string]string) *ListOperatingSystemsOptions { + options.Headers = param + return options +} + +// ListPlacementGroupsOptions : The ListPlacementGroups options. +type ListPlacementGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListPlacementGroupsOptions : Instantiate ListPlacementGroupsOptions +func (*VpcV1) NewListPlacementGroupsOptions() *ListPlacementGroupsOptions { + return &ListPlacementGroupsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListPlacementGroupsOptions) SetStart(start string) *ListPlacementGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListPlacementGroupsOptions) SetLimit(limit int64) *ListPlacementGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListPlacementGroupsOptions) SetHeaders(param map[string]string) *ListPlacementGroupsOptions { + options.Headers = param + return options +} + +// ListPublicGatewaysOptions : The ListPublicGateways options. +type ListPublicGatewaysOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListPublicGatewaysOptions : Instantiate ListPublicGatewaysOptions +func (*VpcV1) NewListPublicGatewaysOptions() *ListPublicGatewaysOptions { + return &ListPublicGatewaysOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListPublicGatewaysOptions) SetStart(start string) *ListPublicGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListPublicGatewaysOptions) SetLimit(limit int64) *ListPublicGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListPublicGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListPublicGatewaysOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListPublicGatewaysOptions) SetHeaders(param map[string]string) *ListPublicGatewaysOptions { + options.Headers = param + return options +} + +// ListRegionZonesOptions : The ListRegionZones options. +type ListRegionZonesOptions struct { + // The region name. + RegionName *string `json:"region_name" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListRegionZonesOptions : Instantiate ListRegionZonesOptions +func (*VpcV1) NewListRegionZonesOptions(regionName string) *ListRegionZonesOptions { + return &ListRegionZonesOptions{ + RegionName: core.StringPtr(regionName), + } +} + +// SetRegionName : Allow user to set RegionName +func (_options *ListRegionZonesOptions) SetRegionName(regionName string) *ListRegionZonesOptions { + _options.RegionName = core.StringPtr(regionName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListRegionZonesOptions) SetHeaders(param map[string]string) *ListRegionZonesOptions { + options.Headers = param + return options +} + +// ListRegionsOptions : The ListRegions options. +type ListRegionsOptions struct { + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListRegionsOptions : Instantiate ListRegionsOptions +func (*VpcV1) NewListRegionsOptions() *ListRegionsOptions { + return &ListRegionsOptions{} +} + +// SetHeaders : Allow user to set Headers +func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegionsOptions { + options.Headers = param + return options +} + +// ListSecurityGroupNetworkInterfacesOptions : The ListSecurityGroupNetworkInterfaces options. +type ListSecurityGroupNetworkInterfacesOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListSecurityGroupNetworkInterfacesOptions : Instantiate ListSecurityGroupNetworkInterfacesOptions +func (*VpcV1) NewListSecurityGroupNetworkInterfacesOptions(securityGroupID string) *ListSecurityGroupNetworkInterfacesOptions { + return &ListSecurityGroupNetworkInterfacesOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + } +} + +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *ListSecurityGroupNetworkInterfacesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupNetworkInterfacesOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListSecurityGroupNetworkInterfacesOptions) SetStart(start string) *ListSecurityGroupNetworkInterfacesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListSecurityGroupNetworkInterfacesOptions) SetLimit(limit int64) *ListSecurityGroupNetworkInterfacesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupNetworkInterfacesOptions) SetHeaders(param map[string]string) *ListSecurityGroupNetworkInterfacesOptions { + options.Headers = param + return options +} + +// ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. +type ListSecurityGroupRulesOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListSecurityGroupRulesOptions : Instantiate ListSecurityGroupRulesOptions +func (*VpcV1) NewListSecurityGroupRulesOptions(securityGroupID string) *ListSecurityGroupRulesOptions { + return &ListSecurityGroupRulesOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + } +} + +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *ListSecurityGroupRulesOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupRulesOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupRulesOptions) SetHeaders(param map[string]string) *ListSecurityGroupRulesOptions { + options.Headers = param + return options +} + +// ListSecurityGroupTargetsOptions : The ListSecurityGroupTargets options. +type ListSecurityGroupTargetsOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListSecurityGroupTargetsOptions : Instantiate ListSecurityGroupTargetsOptions +func (*VpcV1) NewListSecurityGroupTargetsOptions(securityGroupID string) *ListSecurityGroupTargetsOptions { + return &ListSecurityGroupTargetsOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + } +} + +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *ListSecurityGroupTargetsOptions) SetSecurityGroupID(securityGroupID string) *ListSecurityGroupTargetsOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListSecurityGroupTargetsOptions) SetStart(start string) *ListSecurityGroupTargetsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListSecurityGroupTargetsOptions) SetLimit(limit int64) *ListSecurityGroupTargetsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupTargetsOptions) SetHeaders(param map[string]string) *ListSecurityGroupTargetsOptions { + options.Headers = param + return options +} + +// ListSecurityGroupsOptions : The ListSecurityGroups options. +type ListSecurityGroupsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources in the VPC with the specified identifier. + VPCID *string `json:"vpc.id,omitempty"` + + // Filters the collection to resources in the VPC with the specified CRN. + VPCCRN *string `json:"vpc.crn,omitempty"` + + // Filters the collection to resources in the VPC with the exact specified name. + VPCName *string `json:"vpc.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListSecurityGroupsOptions : Instantiate ListSecurityGroupsOptions +func (*VpcV1) NewListSecurityGroupsOptions() *ListSecurityGroupsOptions { + return &ListSecurityGroupsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListSecurityGroupsOptions) SetStart(start string) *ListSecurityGroupsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListSecurityGroupsOptions) SetLimit(limit int64) *ListSecurityGroupsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSecurityGroupsOptions) SetResourceGroupID(resourceGroupID string) *ListSecurityGroupsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListSecurityGroupsOptions) SetVPCID(vpcID string) *ListSecurityGroupsOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetVPCCRN : Allow user to set VPCCRN +func (_options *ListSecurityGroupsOptions) SetVPCCRN(vpcCRN string) *ListSecurityGroupsOptions { + _options.VPCCRN = core.StringPtr(vpcCRN) + return _options +} + +// SetVPCName : Allow user to set VPCName +func (_options *ListSecurityGroupsOptions) SetVPCName(vpcName string) *ListSecurityGroupsOptions { + _options.VPCName = core.StringPtr(vpcName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSecurityGroupsOptions) SetHeaders(param map[string]string) *ListSecurityGroupsOptions { + options.Headers = param + return options +} + +// ListSnapshotsOptions : The ListSnapshots options. +type ListSnapshotsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with the source volume with the specified identifier. + SourceVolumeID *string `json:"source_volume.id,omitempty"` + + // Filters the collection to resources with the source volume with the specified CRN. + SourceVolumeCRN *string `json:"source_volume.crn,omitempty"` + + // Filters the collection to resources with the source image with the specified identifier. + // + // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no + // source image or any existent source image, respectively. + SourceImageID *string `json:"source_image.id,omitempty"` + + // Filters the collection to resources with the source volume with the specified CRN. + // + // This parameter also supports the values `null` and `not:null` which filter the collection to resources which have no + // source image or any existent source image, respectively. + SourceImageCRN *string `json:"source_image.crn,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListSnapshotsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListSnapshotsOptionsSortCreatedAtConst = "created_at" + ListSnapshotsOptionsSortNameConst = "name" +) + +// NewListSnapshotsOptions : Instantiate ListSnapshotsOptions +func (*VpcV1) NewListSnapshotsOptions() *ListSnapshotsOptions { + return &ListSnapshotsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListSnapshotsOptions) SetStart(start string) *ListSnapshotsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListSnapshotsOptions) SetLimit(limit int64) *ListSnapshotsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSnapshotsOptions) SetResourceGroupID(resourceGroupID string) *ListSnapshotsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListSnapshotsOptions) SetName(name string) *ListSnapshotsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetSourceVolumeID : Allow user to set SourceVolumeID +func (_options *ListSnapshotsOptions) SetSourceVolumeID(sourceVolumeID string) *ListSnapshotsOptions { + _options.SourceVolumeID = core.StringPtr(sourceVolumeID) + return _options +} + +// SetSourceVolumeCRN : Allow user to set SourceVolumeCRN +func (_options *ListSnapshotsOptions) SetSourceVolumeCRN(sourceVolumeCRN string) *ListSnapshotsOptions { + _options.SourceVolumeCRN = core.StringPtr(sourceVolumeCRN) + return _options +} + +// SetSourceImageID : Allow user to set SourceImageID +func (_options *ListSnapshotsOptions) SetSourceImageID(sourceImageID string) *ListSnapshotsOptions { + _options.SourceImageID = core.StringPtr(sourceImageID) + return _options +} + +// SetSourceImageCRN : Allow user to set SourceImageCRN +func (_options *ListSnapshotsOptions) SetSourceImageCRN(sourceImageCRN string) *ListSnapshotsOptions { + _options.SourceImageCRN = core.StringPtr(sourceImageCRN) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListSnapshotsOptions) SetSort(sort string) *ListSnapshotsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSnapshotsOptions) SetHeaders(param map[string]string) *ListSnapshotsOptions { + options.Headers = param + return options +} + +// ListSubnetReservedIpsOptions : The ListSubnetReservedIps options. +type ListSubnetReservedIpsOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name + // to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property + // in descending order, and the value `name` sorts it by the `name` property in ascending order. + Sort *string `json:"sort,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListSubnetReservedIpsOptions.Sort property. +// Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name +// to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property +// in descending order, and the value `name` sorts it by the `name` property in ascending order. +const ( + ListSubnetReservedIpsOptionsSortAddressConst = "address" + ListSubnetReservedIpsOptionsSortCreatedAtConst = "created_at" + ListSubnetReservedIpsOptionsSortNameConst = "name" +) + +// NewListSubnetReservedIpsOptions : Instantiate ListSubnetReservedIpsOptions +func (*VpcV1) NewListSubnetReservedIpsOptions(subnetID string) *ListSubnetReservedIpsOptions { + return &ListSubnetReservedIpsOptions{ + SubnetID: core.StringPtr(subnetID), + } +} + +// SetSubnetID : Allow user to set SubnetID +func (_options *ListSubnetReservedIpsOptions) SetSubnetID(subnetID string) *ListSubnetReservedIpsOptions { + _options.SubnetID = core.StringPtr(subnetID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListSubnetReservedIpsOptions) SetStart(start string) *ListSubnetReservedIpsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListSubnetReservedIpsOptions) SetLimit(limit int64) *ListSubnetReservedIpsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetSort : Allow user to set Sort +func (_options *ListSubnetReservedIpsOptions) SetSort(sort string) *ListSubnetReservedIpsOptions { + _options.Sort = core.StringPtr(sort) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSubnetReservedIpsOptions) SetHeaders(param map[string]string) *ListSubnetReservedIpsOptions { + options.Headers = param + return options +} + +// ListSubnetsOptions : The ListSubnets options. +type ListSubnetsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to subnets attached to the routing table with the specified identifier. + RoutingTableID *string `json:"routing_table.id,omitempty"` + + // Filters the collection to subnets attached to the routing table with the specified name. + RoutingTableName *string `json:"routing_table.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListSubnetsOptions : Instantiate ListSubnetsOptions +func (*VpcV1) NewListSubnetsOptions() *ListSubnetsOptions { + return &ListSubnetsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListSubnetsOptions) SetStart(start string) *ListSubnetsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListSubnetsOptions) SetLimit(limit int64) *ListSubnetsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListSubnetsOptions) SetResourceGroupID(resourceGroupID string) *ListSubnetsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *ListSubnetsOptions) SetRoutingTableID(routingTableID string) *ListSubnetsOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options +} + +// SetRoutingTableName : Allow user to set RoutingTableName +func (_options *ListSubnetsOptions) SetRoutingTableName(routingTableName string) *ListSubnetsOptions { + _options.RoutingTableName = core.StringPtr(routingTableName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListSubnetsOptions) SetHeaders(param map[string]string) *ListSubnetsOptions { + options.Headers = param + return options +} + +// ListVolumeProfilesOptions : The ListVolumeProfiles options. +type ListVolumeProfilesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVolumeProfilesOptions : Instantiate ListVolumeProfilesOptions +func (*VpcV1) NewListVolumeProfilesOptions() *ListVolumeProfilesOptions { + return &ListVolumeProfilesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListVolumeProfilesOptions) SetStart(start string) *ListVolumeProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVolumeProfilesOptions) SetLimit(limit int64) *ListVolumeProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVolumeProfilesOptions) SetHeaders(param map[string]string) *ListVolumeProfilesOptions { + options.Headers = param + return options +} + +// ListVolumesOptions : The ListVolumes options. +type ListVolumesOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources in the zone with the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVolumesOptions : Instantiate ListVolumesOptions +func (*VpcV1) NewListVolumesOptions() *ListVolumesOptions { + return &ListVolumesOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListVolumesOptions) SetStart(start string) *ListVolumesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVolumesOptions) SetLimit(limit int64) *ListVolumesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListVolumesOptions) SetName(name string) *ListVolumesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListVolumesOptions) SetZoneName(zoneName string) *ListVolumesOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVolumesOptions) SetHeaders(param map[string]string) *ListVolumesOptions { + options.Headers = param + return options +} + +// ListVPCAddressPrefixesOptions : The ListVPCAddressPrefixes options. +type ListVPCAddressPrefixesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPCAddressPrefixesOptions : Instantiate ListVPCAddressPrefixesOptions +func (*VpcV1) NewListVPCAddressPrefixesOptions(vpcID string) *ListVPCAddressPrefixesOptions { + return &ListVPCAddressPrefixesOptions{ + VPCID: core.StringPtr(vpcID), + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCAddressPrefixesOptions) SetVPCID(vpcID string) *ListVPCAddressPrefixesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVPCAddressPrefixesOptions) SetStart(start string) *ListVPCAddressPrefixesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPCAddressPrefixesOptions) SetLimit(limit int64) *ListVPCAddressPrefixesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPCAddressPrefixesOptions) SetHeaders(param map[string]string) *ListVPCAddressPrefixesOptions { + options.Headers = param + return options +} + +// ListVPCRoutesOptions : The ListVPCRoutes options. +type ListVPCRoutesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // Filters the collection to resources in the zone with the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPCRoutesOptions : Instantiate ListVPCRoutesOptions +func (*VpcV1) NewListVPCRoutesOptions(vpcID string) *ListVPCRoutesOptions { + return &ListVPCRoutesOptions{ + VPCID: core.StringPtr(vpcID), + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListVPCRoutesOptions) SetZoneName(zoneName string) *ListVPCRoutesOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVPCRoutesOptions) SetStart(start string) *ListVPCRoutesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPCRoutesOptions) SetLimit(limit int64) *ListVPCRoutesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPCRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutesOptions { + options.Headers = param + return options +} + +// ListVPCRoutingTableRoutesOptions : The ListVPCRoutingTableRoutes options. +type ListVPCRoutingTableRoutesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPCRoutingTableRoutesOptions : Instantiate ListVPCRoutingTableRoutesOptions +func (*VpcV1) NewListVPCRoutingTableRoutesOptions(vpcID string, routingTableID string) *ListVPCRoutingTableRoutesOptions { + return &ListVPCRoutingTableRoutesOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCRoutingTableRoutesOptions) SetVPCID(vpcID string) *ListVPCRoutingTableRoutesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *ListVPCRoutingTableRoutesOptions) SetRoutingTableID(routingTableID string) *ListVPCRoutingTableRoutesOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVPCRoutingTableRoutesOptions) SetStart(start string) *ListVPCRoutingTableRoutesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPCRoutingTableRoutesOptions) SetLimit(limit int64) *ListVPCRoutingTableRoutesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPCRoutingTableRoutesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTableRoutesOptions { + options.Headers = param + return options +} + +// ListVPCRoutingTablesOptions : The ListVPCRoutingTables options. +type ListVPCRoutingTablesOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to routing tables with the specified `is_default` value. + IsDefault *bool `json:"is_default,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPCRoutingTablesOptions : Instantiate ListVPCRoutingTablesOptions +func (*VpcV1) NewListVPCRoutingTablesOptions(vpcID string) *ListVPCRoutingTablesOptions { + return &ListVPCRoutingTablesOptions{ + VPCID: core.StringPtr(vpcID), + } +} + +// SetVPCID : Allow user to set VPCID +func (_options *ListVPCRoutingTablesOptions) SetVPCID(vpcID string) *ListVPCRoutingTablesOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVPCRoutingTablesOptions) SetStart(start string) *ListVPCRoutingTablesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPCRoutingTablesOptions) SetLimit(limit int64) *ListVPCRoutingTablesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetIsDefault : Allow user to set IsDefault +func (_options *ListVPCRoutingTablesOptions) SetIsDefault(isDefault bool) *ListVPCRoutingTablesOptions { + _options.IsDefault = core.BoolPtr(isDefault) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPCRoutingTablesOptions) SetHeaders(param map[string]string) *ListVPCRoutingTablesOptions { + options.Headers = param + return options +} + +// ListVpcsOptions : The ListVpcs options. +type ListVpcsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to VPCs with the specified `classic_access` value. + ClassicAccess *bool `json:"classic_access,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVpcsOptions : Instantiate ListVpcsOptions +func (*VpcV1) NewListVpcsOptions() *ListVpcsOptions { + return &ListVpcsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListVpcsOptions) SetStart(start string) *ListVpcsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVpcsOptions) SetLimit(limit int64) *ListVpcsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListVpcsOptions) SetResourceGroupID(resourceGroupID string) *ListVpcsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetClassicAccess : Allow user to set ClassicAccess +func (_options *ListVpcsOptions) SetClassicAccess(classicAccess bool) *ListVpcsOptions { + _options.ClassicAccess = core.BoolPtr(classicAccess) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOptions { + options.Headers = param + return options +} + +// ListVPNGatewayConnectionLocalCIDRsOptions : The ListVPNGatewayConnectionLocalCIDRs options. +type ListVPNGatewayConnectionLocalCIDRsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPNGatewayConnectionLocalCIDRsOptions : Instantiate ListVPNGatewayConnectionLocalCIDRsOptions +func (*VpcV1) NewListVPNGatewayConnectionLocalCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionLocalCIDRsOptions { + return &ListVPNGatewayConnectionLocalCIDRsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionLocalCIDRsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *ListVPNGatewayConnectionLocalCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionLocalCIDRsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayConnectionLocalCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionLocalCIDRsOptions { + options.Headers = param + return options +} + +// ListVPNGatewayConnectionPeerCIDRsOptions : The ListVPNGatewayConnectionPeerCIDRs options. +type ListVPNGatewayConnectionPeerCIDRsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPNGatewayConnectionPeerCIDRsOptions : Instantiate ListVPNGatewayConnectionPeerCIDRsOptions +func (*VpcV1) NewListVPNGatewayConnectionPeerCIDRsOptions(vpnGatewayID string, id string) *ListVPNGatewayConnectionPeerCIDRsOptions { + return &ListVPNGatewayConnectionPeerCIDRsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionPeerCIDRsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *ListVPNGatewayConnectionPeerCIDRsOptions) SetID(id string) *ListVPNGatewayConnectionPeerCIDRsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayConnectionPeerCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionPeerCIDRsOptions { + options.Headers = param + return options +} + +// ListVPNGatewayConnectionsOptions : The ListVPNGatewayConnections options. +type ListVPNGatewayConnectionsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // Filters the collection to VPN gateway connections with the specified status. + Status *string `json:"status,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListVPNGatewayConnectionsOptions : Instantiate ListVPNGatewayConnectionsOptions +func (*VpcV1) NewListVPNGatewayConnectionsOptions(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { + return &ListVPNGatewayConnectionsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayConnectionsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetStatus : Allow user to set Status +func (_options *ListVPNGatewayConnectionsOptions) SetStatus(status string) *ListVPNGatewayConnectionsOptions { + _options.Status = core.StringPtr(status) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayConnectionsOptions { + options.Headers = param + return options +} + +// ListVPNGatewaysOptions : The ListVPNGateways options. +type ListVPNGatewaysOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources in the resource group with the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to VPN gateways with the specified mode. + Mode *string `json:"mode,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the ListVPNGatewaysOptions.Mode property. +// Filters the collection to VPN gateways with the specified mode. +const ( + ListVPNGatewaysOptionsModePolicyConst = "policy" + ListVPNGatewaysOptionsModeRouteConst = "route" +) + +// NewListVPNGatewaysOptions : Instantiate ListVPNGatewaysOptions +func (*VpcV1) NewListVPNGatewaysOptions() *ListVPNGatewaysOptions { + return &ListVPNGatewaysOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListVPNGatewaysOptions) SetStart(start string) *ListVPNGatewaysOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPNGatewaysOptions) SetLimit(limit int64) *ListVPNGatewaysOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListVPNGatewaysOptions) SetResourceGroupID(resourceGroupID string) *ListVPNGatewaysOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetMode : Allow user to set Mode +func (_options *ListVPNGatewaysOptions) SetMode(mode string) *ListVPNGatewaysOptions { + _options.Mode = core.StringPtr(mode) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewaysOptions) SetHeaders(param map[string]string) *ListVPNGatewaysOptions { + options.Headers = param + return options +} + +// LoadBalancer : LoadBalancer struct +type LoadBalancer struct { + // The date and time that this load balancer was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The load balancer's CRN. + CRN *string `json:"crn" validate:"required"` + + // Fully qualified domain name assigned to this load balancer. + Hostname *string `json:"hostname" validate:"required"` + + // The load balancer's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this load balancer. + ID *string `json:"id" validate:"required"` + + // The type of this load balancer, public or private. + IsPublic *bool `json:"is_public" validate:"required"` + + // The listeners of this load balancer. + Listeners []LoadBalancerListenerReference `json:"listeners" validate:"required"` + + // The logging configuration for this load balancer. + Logging *LoadBalancerLogging `json:"logging" validate:"required"` + + // The unique user-defined name for this load balancer. + Name *string `json:"name" validate:"required"` + + // The operating status of this load balancer. + OperatingStatus *string `json:"operating_status" validate:"required"` + + // The pools of this load balancer. + Pools []LoadBalancerPoolReference `json:"pools" validate:"required"` + + // The private IP addresses assigned to this load balancer. + PrivateIps []IP `json:"private_ips" validate:"required"` + + // The profile to use for this load balancer. + Profile *LoadBalancerProfileReference `json:"profile" validate:"required"` + + // The provisioning status of this load balancer. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + + // The public IP addresses assigned to this load balancer. + // + // Applicable only for public load balancers. + PublicIps []IP `json:"public_ips" validate:"required"` + + // The resource group for this load balancer. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // Indicates whether route mode is enabled for this load balancer. + // + // At present, public load balancers are not supported with route mode enabled. + RouteMode *bool `json:"route_mode" validate:"required"` + + // The security groups targeting this load balancer. + // + // Applicable only for load balancers that support security groups. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + + // Indicates whether this load balancer supports security groups. + SecurityGroupsSupported *bool `json:"security_groups_supported" validate:"required"` + + // The subnets this load balancer is part of. + Subnets []SubnetReference `json:"subnets" validate:"required"` +} + +// Constants associated with the LoadBalancer.OperatingStatus property. +// The operating status of this load balancer. +const ( + LoadBalancerOperatingStatusOfflineConst = "offline" + LoadBalancerOperatingStatusOnlineConst = "online" +) + +// Constants associated with the LoadBalancer.ProvisioningStatus property. +// The provisioning status of this load balancer. +const ( + LoadBalancerProvisioningStatusActiveConst = "active" + LoadBalancerProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerProvisioningStatusFailedConst = "failed" + LoadBalancerProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerProvisioningStatusUpdatePendingConst = "update_pending" +) + +// UnmarshalLoadBalancer unmarshals an instance of LoadBalancer from the specified map of raw messages. +func UnmarshalLoadBalancer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancer) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "hostname", &obj.Hostname) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "is_public", &obj.IsPublic) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListenerReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "operating_status", &obj.OperatingStatus) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPoolReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "private_ips", &obj.PrivateIps, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalLoadBalancerProfileReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + if err != nil { + return + } + err = core.UnmarshalModel(m, "public_ips", &obj.PublicIps, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "route_mode", &obj.RouteMode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "security_groups_supported", &obj.SecurityGroupsSupported) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerCollection : LoadBalancerCollection struct +type LoadBalancerCollection struct { + // A link to the first page of resources. + First *LoadBalancerCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // Collection of load balancers. + LoadBalancers []LoadBalancer `json:"load_balancers" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *LoadBalancerCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalLoadBalancerCollection unmarshals an instance of LoadBalancerCollection from the specified map of raw messages. +func UnmarshalLoadBalancerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "load_balancers", &obj.LoadBalancers, UnmarshalLoadBalancer) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *LoadBalancerCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// LoadBalancerCollectionFirst : A link to the first page of resources. +type LoadBalancerCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalLoadBalancerCollectionFirst unmarshals an instance of LoadBalancerCollectionFirst from the specified map of raw messages. +func UnmarshalLoadBalancerCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type LoadBalancerCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalLoadBalancerCollectionNext unmarshals an instance of LoadBalancerCollectionNext from the specified map of raw messages. +func UnmarshalLoadBalancerCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerIdentity : Identifies a load balancer by a unique property. +// Models which "extend" this model: +// - LoadBalancerIdentityByID +// - LoadBalancerIdentityByCRN +// - LoadBalancerIdentityByHref +type LoadBalancerIdentity struct { + // The unique identifier for this load balancer. + ID *string `json:"id,omitempty"` + + // The load balancer's CRN. + CRN *string `json:"crn,omitempty"` + + // The load balancer's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*LoadBalancerIdentity) isaLoadBalancerIdentity() bool { + return true +} + +type LoadBalancerIdentityIntf interface { + isaLoadBalancerIdentity() bool +} + +// UnmarshalLoadBalancerIdentity unmarshals an instance of LoadBalancerIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListener : LoadBalancerListener struct +type LoadBalancerListener struct { + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol" validate:"required"` + + // The certificate instance used for SSL termination. It is applicable only to `https` + // protocol. + CertificateInstance *CertificateInstanceReference `json:"certificate_instance,omitempty"` + + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` + + // The date and time that this listener was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The default pool for this listener. If absent, this listener has no default pool. + DefaultPool *LoadBalancerPoolReference `json:"default_pool,omitempty"` + + // The listener's canonical URL. + Href *string `json:"href" validate:"required"` + + // If specified, the target listener that requests are redirected to. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirect `json:"https_redirect,omitempty"` + + // The unique identifier for this load balancer listener. + ID *string `json:"id" validate:"required"` + + // The policies for this listener. + Policies []LoadBalancerListenerPolicyReference `json:"policies,omitempty"` + + // The listener port number, or the inclusive lower bound of the port range. + Port *int64 `json:"port" validate:"required"` + + // The inclusive upper bound of the range of ports used by this listener. + // + // At present, only load balancers in the `network` family support more than one port per listener. + PortMax *int64 `json:"port_max" validate:"required"` + + // The inclusive lower bound of the range of ports used by this listener. + // + // At present, only load balancers in the `network` family support more than one port per listener. + PortMin *int64 `json:"port_min" validate:"required"` + + // The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` + // family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and + // `protocol` combination. + Protocol *string `json:"protocol" validate:"required"` + + // The provisioning status of this listener. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` +} + +// Constants associated with the LoadBalancerListener.Protocol property. +// The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` +// family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and +// `protocol` combination. +const ( + LoadBalancerListenerProtocolHTTPConst = "http" + LoadBalancerListenerProtocolHTTPSConst = "https" + LoadBalancerListenerProtocolTCPConst = "tcp" +) + +// Constants associated with the LoadBalancerListener.ProvisioningStatus property. +// The provisioning status of this listener. +const ( + LoadBalancerListenerProvisioningStatusActiveConst = "active" + LoadBalancerListenerProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerListenerProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerListenerProvisioningStatusFailedConst = "failed" + LoadBalancerListenerProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerListenerProvisioningStatusUpdatePendingConst = "update_pending" +) + +// UnmarshalLoadBalancerListener unmarshals an instance of LoadBalancerListener from the specified map of raw messages. +func UnmarshalLoadBalancerListener(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListener) + err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirect) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicyReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerCollection : LoadBalancerListenerCollection struct +type LoadBalancerListenerCollection struct { + // Collection of listeners. + Listeners []LoadBalancerListener `json:"listeners" validate:"required"` +} + +// UnmarshalLoadBalancerListenerCollection unmarshals an instance of LoadBalancerListenerCollection from the specified map of raw messages. +func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerCollection) + err = core.UnmarshalModel(m, "listeners", &obj.Listeners, UnmarshalLoadBalancerListener) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerHTTPSRedirect : LoadBalancerListenerHTTPSRedirect struct +type LoadBalancerListenerHTTPSRedirect struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` + + Listener *LoadBalancerListenerReference `json:"listener" validate:"required"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +// UnmarshalLoadBalancerListenerHTTPSRedirect unmarshals an instance of LoadBalancerListenerHTTPSRedirect from the specified map of raw messages. +func UnmarshalLoadBalancerListenerHTTPSRedirect(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerHTTPSRedirect) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerHTTPSRedirectPatch : LoadBalancerListenerHTTPSRedirectPatch struct +type LoadBalancerListenerHTTPSRedirectPatch struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +// UnmarshalLoadBalancerListenerHTTPSRedirectPatch unmarshals an instance of LoadBalancerListenerHTTPSRedirectPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerHTTPSRedirectPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerHTTPSRedirectPatch) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerHTTPSRedirectPrototype : LoadBalancerListenerHTTPSRedirectPrototype struct +type LoadBalancerListenerHTTPSRedirectPrototype struct { + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code" validate:"required"` + + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener" validate:"required"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +// NewLoadBalancerListenerHTTPSRedirectPrototype : Instantiate LoadBalancerListenerHTTPSRedirectPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerHTTPSRedirectPrototype(httpStatusCode int64, listener LoadBalancerListenerIdentityIntf) (_model *LoadBalancerListenerHTTPSRedirectPrototype, err error) { + _model = &LoadBalancerListenerHTTPSRedirectPrototype{ + HTTPStatusCode: core.Int64Ptr(httpStatusCode), + Listener: listener, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerHTTPSRedirectPrototype unmarshals an instance of LoadBalancerListenerHTTPSRedirectPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerHTTPSRedirectPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerHTTPSRedirectPrototype) + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerIdentity : Identifies a load balancer listener by a unique property. +// Models which "extend" this model: +// - LoadBalancerListenerIdentityByID +// - LoadBalancerListenerIdentityByHref +type LoadBalancerListenerIdentity struct { + // The unique identifier for this load balancer listener. + ID *string `json:"id,omitempty"` + + // The listener's canonical URL. + Href *string `json:"href,omitempty"` +} + +func (*LoadBalancerListenerIdentity) isaLoadBalancerListenerIdentity() bool { + return true +} + +type LoadBalancerListenerIdentityIntf interface { + isaLoadBalancerListenerIdentity() bool +} + +// UnmarshalLoadBalancerListenerIdentity unmarshals an instance of LoadBalancerListenerIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerListenerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPatch : LoadBalancerListenerPatch struct +type LoadBalancerListenerPatch struct { + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` + + // The certificate instance used for SSL termination. It is applicable only to `https` + // protocol. + CertificateInstance CertificateInstanceIdentityIntf `json:"certificate_instance,omitempty"` + + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` + + // The default pool for this listener. The specified pool must: + // + // - Belong to this load balancer + // - Have the same `protocol` as this listener, or have a compatible protocol. + // At present, the compatible protocols are `http` and `https`. + // - Not already be the `default_pool` for another listener + // + // Specify `null` to remove an existing default pool. + DefaultPool LoadBalancerPoolIdentityIntf `json:"default_pool,omitempty"` + + // The target listener that requests will be redirected to. This listener must have a + // `protocol` of `http`, and the target listener must have a `protocol` of `https`. + // + // Specify `null` to remove any existing https redirect. + HTTPSRedirect *LoadBalancerListenerHTTPSRedirectPatch `json:"https_redirect,omitempty"` + + // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must + // have a unique `port` and `protocol` combination. + // + // Not supported for load balancers operating with route mode enabled. + Port *int64 `json:"port,omitempty"` + + // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `65535` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `1` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMin *int64 `json:"port_min,omitempty"` + + // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + // Additional restrictions: + // - If this load balancer is in the `network` family, the protocol must be `tcp`. + // - If this listener has `https_redirect` specified, the protocol must be `http`. + // - If this listener is a listener's `https_redirect` target, the protocol must be `https`. + Protocol *string `json:"protocol,omitempty"` +} + +// Constants associated with the LoadBalancerListenerPatch.Protocol property. +// The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. +// Additional restrictions: +// - If this load balancer is in the `network` family, the protocol must be `tcp`. +// - If this listener has `https_redirect` specified, the protocol must be `http`. +// - If this listener is a listener's `https_redirect` target, the protocol must be `https`. +const ( + LoadBalancerListenerPatchProtocolHTTPConst = "http" + LoadBalancerListenerPatchProtocolHTTPSConst = "https" + LoadBalancerListenerPatchProtocolTCPConst = "tcp" +) + +// UnmarshalLoadBalancerListenerPatch unmarshals an instance of LoadBalancerListenerPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPatch) + err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "certificate_instance", &obj.CertificateInstance, UnmarshalCertificateInstanceIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "https_redirect", &obj.HTTPSRedirect, UnmarshalLoadBalancerListenerHTTPSRedirectPatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the LoadBalancerListenerPatch +func (loadBalancerListenerPatch *LoadBalancerListenerPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerListenerPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// LoadBalancerListenerPolicy : LoadBalancerListenerPolicy struct +type LoadBalancerListenerPolicy struct { + // The policy action. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` + + // The date and time that this policy was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The listener policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The policy's unique identifier. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this policy. + Name *string `json:"name" validate:"required"` + + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority" validate:"required"` + + // The provisioning status of this policy. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + + // The rules for this policy. + Rules []LoadBalancerListenerPolicyRuleReference `json:"rules" validate:"required"` + + // - If `action` is `forward`, the response is a `LoadBalancerPoolReference` + // - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` + // - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. + Target LoadBalancerListenerPolicyTargetIntf `json:"target,omitempty"` +} + +// Constants associated with the LoadBalancerListenerPolicy.Action property. +// The policy action. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. +const ( + LoadBalancerListenerPolicyActionForwardConst = "forward" + LoadBalancerListenerPolicyActionHTTPSRedirectConst = "https_redirect" + LoadBalancerListenerPolicyActionRedirectConst = "redirect" + LoadBalancerListenerPolicyActionRejectConst = "reject" +) + +// Constants associated with the LoadBalancerListenerPolicy.ProvisioningStatus property. +// The provisioning status of this policy. +const ( + LoadBalancerListenerPolicyProvisioningStatusActiveConst = "active" + LoadBalancerListenerPolicyProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerListenerPolicyProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerListenerPolicyProvisioningStatusFailedConst = "failed" + LoadBalancerListenerPolicyProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerListenerPolicyProvisioningStatusUpdatePendingConst = "update_pending" +) + +// UnmarshalLoadBalancerListenerPolicy unmarshals an instance of LoadBalancerListenerPolicy from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicy(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicy) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRuleReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTarget) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyCollection : LoadBalancerListenerPolicyCollection struct +type LoadBalancerListenerPolicyCollection struct { + // Collection of policies. + Policies []LoadBalancerListenerPolicy `json:"policies" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyCollection unmarshals an instance of LoadBalancerListenerPolicyCollection from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyCollection(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(LoadBalancerListenerPolicyCollection) err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalLoadBalancerListenerPolicy) if err != nil { @@ -38281,33 +43328,855 @@ func UnmarshalLoadBalancerListenerPolicyCollection(m map[string]json.RawMessage, return } -// LoadBalancerListenerPolicyPatch : LoadBalancerListenerPolicyPatch struct -type LoadBalancerListenerPolicyPatch struct { - // The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. - Name *string `json:"name,omitempty"` +// LoadBalancerListenerPolicyPatch : LoadBalancerListenerPolicyPatch struct +type LoadBalancerListenerPolicyPatch struct { + // The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. + Name *string `json:"name,omitempty"` + + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority,omitempty"` + + // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. + // - If `action` is `https_redirect`, specify a + // `LoadBalancerListenerPolicyHTTPSRedirectPatch`. + Target LoadBalancerListenerPolicyTargetPatchIntf `json:"target,omitempty"` +} + +// UnmarshalLoadBalancerListenerPolicyPatch unmarshals an instance of LoadBalancerListenerPolicyPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyPatch +func (loadBalancerListenerPolicyPatch *LoadBalancerListenerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerListenerPolicyPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// LoadBalancerListenerPolicyPrototype : LoadBalancerListenerPolicyPrototype struct +type LoadBalancerListenerPolicyPrototype struct { + // The policy action. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // unexpected property value was encountered. + Action *string `json:"action" validate:"required"` + + // The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. + Name *string `json:"name,omitempty"` + + // Priority of the policy. Lower value indicates higher priority. + Priority *int64 `json:"priority" validate:"required"` + + // The rule prototype objects for this policy. + Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` + + // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. + // - If `action` is `https_redirect`, specify a + // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` +} + +// Constants associated with the LoadBalancerListenerPolicyPrototype.Action property. +// The policy action. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the +// unexpected property value was encountered. +const ( + LoadBalancerListenerPolicyPrototypeActionForwardConst = "forward" + LoadBalancerListenerPolicyPrototypeActionHTTPSRedirectConst = "https_redirect" + LoadBalancerListenerPolicyPrototypeActionRedirectConst = "redirect" + LoadBalancerListenerPolicyPrototypeActionRejectConst = "reject" +) + +// NewLoadBalancerListenerPolicyPrototype : Instantiate LoadBalancerListenerPolicyPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPolicyPrototype(action string, priority int64) (_model *LoadBalancerListenerPolicyPrototype, err error) { + _model = &LoadBalancerListenerPolicyPrototype{ + Action: core.StringPtr(action), + Priority: core.Int64Ptr(priority), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerPolicyPrototype unmarshals an instance of LoadBalancerListenerPolicyPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRulePrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPrototype) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyReference : LoadBalancerListenerPolicyReference struct +type LoadBalancerListenerPolicyReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *LoadBalancerListenerPolicyReferenceDeleted `json:"deleted,omitempty"` + + // The listener policy's canonical URL. + Href *string `json:"href" validate:"required"` + + // The policy's unique identifier. + ID *string `json:"id" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyReference unmarshals an instance of LoadBalancerListenerPolicyReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type LoadBalancerListenerPolicyReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRule : LoadBalancerListenerPolicyRule struct +type LoadBalancerListenerPolicyRule struct { + // The condition of the rule. + Condition *string `json:"condition" validate:"required"` + + // The date and time that this rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` + + // The rule's canonical URL. + Href *string `json:"href" validate:"required"` + + // The rule's unique identifier. + ID *string `json:"id" validate:"required"` + + // The provisioning status of this rule. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` + + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type" validate:"required"` + + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the LoadBalancerListenerPolicyRule.Condition property. +// The condition of the rule. +const ( + LoadBalancerListenerPolicyRuleConditionContainsConst = "contains" + LoadBalancerListenerPolicyRuleConditionEqualsConst = "equals" + LoadBalancerListenerPolicyRuleConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the LoadBalancerListenerPolicyRule.ProvisioningStatus property. +// The provisioning status of this rule. +const ( + LoadBalancerListenerPolicyRuleProvisioningStatusActiveConst = "active" + LoadBalancerListenerPolicyRuleProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerListenerPolicyRuleProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerListenerPolicyRuleProvisioningStatusFailedConst = "failed" + LoadBalancerListenerPolicyRuleProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerListenerPolicyRuleProvisioningStatusUpdatePendingConst = "update_pending" +) + +// Constants associated with the LoadBalancerListenerPolicyRule.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + LoadBalancerListenerPolicyRuleTypeBodyConst = "body" + LoadBalancerListenerPolicyRuleTypeHeaderConst = "header" + LoadBalancerListenerPolicyRuleTypeHostnameConst = "hostname" + LoadBalancerListenerPolicyRuleTypePathConst = "path" + LoadBalancerListenerPolicyRuleTypeQueryConst = "query" +) + +// UnmarshalLoadBalancerListenerPolicyRule unmarshals an instance of LoadBalancerListenerPolicyRule from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRule) + err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "field", &obj.Field) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRuleCollection : LoadBalancerListenerPolicyRuleCollection struct +type LoadBalancerListenerPolicyRuleCollection struct { + // Collection of rules. + Rules []LoadBalancerListenerPolicyRule `json:"rules" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyRuleCollection unmarshals an instance of LoadBalancerListenerPolicyRuleCollection from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRuleCollection) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRule) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRulePatch : LoadBalancerListenerPolicyRulePatch struct +type LoadBalancerListenerPolicyRulePatch struct { + // The condition of the rule. + Condition *string `json:"condition,omitempty"` + + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` + + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type,omitempty"` + + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value,omitempty"` +} + +// Constants associated with the LoadBalancerListenerPolicyRulePatch.Condition property. +// The condition of the rule. +const ( + LoadBalancerListenerPolicyRulePatchConditionContainsConst = "contains" + LoadBalancerListenerPolicyRulePatchConditionEqualsConst = "equals" + LoadBalancerListenerPolicyRulePatchConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the LoadBalancerListenerPolicyRulePatch.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + LoadBalancerListenerPolicyRulePatchTypeBodyConst = "body" + LoadBalancerListenerPolicyRulePatchTypeHeaderConst = "header" + LoadBalancerListenerPolicyRulePatchTypeHostnameConst = "hostname" + LoadBalancerListenerPolicyRulePatchTypePathConst = "path" + LoadBalancerListenerPolicyRulePatchTypeQueryConst = "query" +) + +// UnmarshalLoadBalancerListenerPolicyRulePatch unmarshals an instance of LoadBalancerListenerPolicyRulePatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRulePatch) + err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "field", &obj.Field) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyRulePatch +func (loadBalancerListenerPolicyRulePatch *LoadBalancerListenerPolicyRulePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerListenerPolicyRulePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// LoadBalancerListenerPolicyRulePrototype : LoadBalancerListenerPolicyRulePrototype struct +type LoadBalancerListenerPolicyRulePrototype struct { + // The condition of the rule. + Condition *string `json:"condition" validate:"required"` + + // The field. This is applicable to `header`, `query`, and `body` rule types. + // + // If the rule type is `header`, this property is required. + // + // If the rule type is `query`, this is optional. If specified and the rule condition is not + // `matches_regex`, the value must be percent-encoded. + // + // If the rule type is `body`, this is optional. + Field *string `json:"field,omitempty"` + + // The type of the rule. + // + // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. + Type *string `json:"type" validate:"required"` + + // Value to be matched for rule condition. + // + // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Condition property. +// The condition of the rule. +const ( + LoadBalancerListenerPolicyRulePrototypeConditionContainsConst = "contains" + LoadBalancerListenerPolicyRulePrototypeConditionEqualsConst = "equals" + LoadBalancerListenerPolicyRulePrototypeConditionMatchesRegexConst = "matches_regex" +) + +// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Type property. +// The type of the rule. +// +// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +const ( + LoadBalancerListenerPolicyRulePrototypeTypeBodyConst = "body" + LoadBalancerListenerPolicyRulePrototypeTypeHeaderConst = "header" + LoadBalancerListenerPolicyRulePrototypeTypeHostnameConst = "hostname" + LoadBalancerListenerPolicyRulePrototypeTypePathConst = "path" + LoadBalancerListenerPolicyRulePrototypeTypeQueryConst = "query" +) + +// NewLoadBalancerListenerPolicyRulePrototype : Instantiate LoadBalancerListenerPolicyRulePrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPolicyRulePrototype(condition string, typeVar string, value string) (_model *LoadBalancerListenerPolicyRulePrototype, err error) { + _model = &LoadBalancerListenerPolicyRulePrototype{ + Condition: core.StringPtr(condition), + Type: core.StringPtr(typeVar), + Value: core.StringPtr(value), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerPolicyRulePrototype unmarshals an instance of LoadBalancerListenerPolicyRulePrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRulePrototype) + err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "field", &obj.Field) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRuleReference : LoadBalancerListenerPolicyRuleReference struct +type LoadBalancerListenerPolicyRuleReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *LoadBalancerListenerPolicyRuleReferenceDeleted `json:"deleted,omitempty"` + + // The rule's canonical URL. + Href *string `json:"href" validate:"required"` + + // The rule's unique identifier. + ID *string `json:"id" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyRuleReference unmarshals an instance of LoadBalancerListenerPolicyRuleReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRuleReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type LoadBalancerListenerPolicyRuleReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyRuleReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyRuleReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyTarget : - If `action` is `forward`, the response is a `LoadBalancerPoolReference` +// - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` +// - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. +// Models which "extend" this model: +// - LoadBalancerListenerPolicyTargetLoadBalancerPoolReference +// - LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL +// - LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect +type LoadBalancerListenerPolicyTarget struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` + + // The pool's canonical URL. + Href *string `json:"href,omitempty"` + + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` + + // The user-defined name for this load balancer pool. + Name *string `json:"name,omitempty"` + + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // The redirect target URL. + URL *string `json:"url,omitempty"` + + Listener *LoadBalancerListenerReference `json:"listener,omitempty"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +func (*LoadBalancerListenerPolicyTarget) isaLoadBalancerListenerPolicyTarget() bool { + return true +} + +type LoadBalancerListenerPolicyTargetIntf interface { + isaLoadBalancerListenerPolicyTarget() bool +} + +// UnmarshalLoadBalancerListenerPolicyTarget unmarshals an instance of LoadBalancerListenerPolicyTarget from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTarget) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyTargetPatch : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. +// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. +// - If `action` is `https_redirect`, specify a +// `LoadBalancerListenerPolicyHTTPSRedirectPatch`. +// Models which "extend" this model: +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch +// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch +type LoadBalancerListenerPolicyTargetPatch struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` + + // The pool's canonical URL. + Href *string `json:"href,omitempty"` + + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // The redirect target URL. + URL *string `json:"url,omitempty"` + + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +func (*LoadBalancerListenerPolicyTargetPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { + return true +} + +type LoadBalancerListenerPolicyTargetPatchIntf interface { + isaLoadBalancerListenerPolicyTargetPatch() bool +} + +// UnmarshalLoadBalancerListenerPolicyTargetPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatch from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPolicyTargetPrototype : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. +// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. +// - If `action` is `https_redirect`, specify a +// `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. +// Models which "extend" this model: +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype +// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype +type LoadBalancerListenerPolicyTargetPrototype struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` + + // The pool's canonical URL. + Href *string `json:"href,omitempty"` + + // The HTTP status code for this redirect. + HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + + // The redirect target URL. + URL *string `json:"url,omitempty"` + + // Identifies a load balancer listener by a unique property. + Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + + // The redirect relative target URI. + URI *string `json:"uri,omitempty"` +} + +func (*LoadBalancerListenerPolicyTargetPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { + return true +} + +type LoadBalancerListenerPolicyTargetPrototypeIntf interface { + isaLoadBalancerListenerPolicyTargetPrototype() bool +} + +// UnmarshalLoadBalancerListenerPolicyTargetPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPolicyTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url", &obj.URL) + if err != nil { + return + } + err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerPrototypeLoadBalancerContext : LoadBalancerListenerPrototypeLoadBalancerContext struct +type LoadBalancerListenerPrototypeLoadBalancerContext struct { + // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in + // the `application` family (otherwise always `false`). Additional restrictions: + // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must + // match the `accept_proxy_protocol` value of the `https_redirect` listener. + // - If this listener is the target of another listener's `https_redirect`, its + // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` + + // The connection limit of the listener. + ConnectionLimit *int64 `json:"connection_limit,omitempty"` + + // The default pool for this listener. If specified, the pool's protocol must match the + // listener's protocol, or the protocols must be compatible. At present, the compatible + // protocols are `http` and `https`. + // + // If unspecified, this listener will be created with no default pool, but one may be + // subsequently set. + DefaultPool *LoadBalancerPoolIdentityByName `json:"default_pool,omitempty"` + + // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must + // have a unique `port` and `protocol` combination. + // + // Not supported for load balancers operating with route mode enabled. + Port *int64 `json:"port,omitempty"` + + // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `65535` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. + // + // At present, only load balancers operating with route mode enabled, and public load balancers in the `network` family + // support different values for `port_min` and + // `port_max`. When route mode is enabled, the value `1` must be specified. + // + // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the + // same protocol. + PortMin *int64 `json:"port_min,omitempty"` + + // The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` + // family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and + // `protocol` combination. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the LoadBalancerListenerPrototypeLoadBalancerContext.Protocol property. +// The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` +// family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and +// `protocol` combination. +const ( + LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPConst = "http" + LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPSConst = "https" + LoadBalancerListenerPrototypeLoadBalancerContextProtocolTCPConst = "tcp" +) + +// NewLoadBalancerListenerPrototypeLoadBalancerContext : Instantiate LoadBalancerListenerPrototypeLoadBalancerContext (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerListenerPrototypeLoadBalancerContext(protocol string) (_model *LoadBalancerListenerPrototypeLoadBalancerContext, err error) { + _model = &LoadBalancerListenerPrototypeLoadBalancerContext{ + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext unmarshals an instance of LoadBalancerListenerPrototypeLoadBalancerContext from the specified map of raw messages. +func UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerPrototypeLoadBalancerContext) + err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentityByName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerListenerReference : LoadBalancerListenerReference struct +type LoadBalancerListenerReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *LoadBalancerListenerReferenceDeleted `json:"deleted,omitempty"` - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority,omitempty"` + // The listener's canonical URL. + Href *string `json:"href" validate:"required"` - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPatch`. - Target LoadBalancerListenerPolicyTargetPatchIntf `json:"target,omitempty"` + // The unique identifier for this load balancer listener. + ID *string `json:"id" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyPatch unmarshals an instance of LoadBalancerListenerPolicyPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalLoadBalancerListenerReference unmarshals an instance of LoadBalancerListenerReference from the specified map of raw messages. +func UnmarshalLoadBalancerListenerReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -38315,84 +44184,484 @@ func UnmarshalLoadBalancerListenerPolicyPatch(m map[string]json.RawMessage, resu return } -// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyPatch -func (loadBalancerListenerPolicyPatch *LoadBalancerListenerPolicyPatch) AsPatch() (_patch map[string]interface{}, err error) { +// LoadBalancerListenerReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type LoadBalancerListenerReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalLoadBalancerListenerReferenceDeleted unmarshals an instance of LoadBalancerListenerReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerListenerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerLogging : The logging configuration for this load balancer. +type LoadBalancerLogging struct { + // The datapath logging configuration for this load balancer. + Datapath *LoadBalancerLoggingDatapath `json:"datapath,omitempty"` +} + +// UnmarshalLoadBalancerLogging unmarshals an instance of LoadBalancerLogging from the specified map of raw messages. +func UnmarshalLoadBalancerLogging(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLogging) + err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapath) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerLoggingDatapath : The datapath logging configuration for this load balancer. +type LoadBalancerLoggingDatapath struct { + // Indicates whether datapath logging is active for this load balancer. + Active *bool `json:"active" validate:"required"` +} + +// NewLoadBalancerLoggingDatapath : Instantiate LoadBalancerLoggingDatapath (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerLoggingDatapath(active bool) (_model *LoadBalancerLoggingDatapath, err error) { + _model = &LoadBalancerLoggingDatapath{ + Active: core.BoolPtr(active), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages. +func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerLoggingDatapath) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerPatch : LoadBalancerPatch struct +type LoadBalancerPatch struct { + // The logging configuration to use for this load balancer. + // + // To activate logging, the load balancer profile must support the specified logging type. + Logging *LoadBalancerLogging `json:"logging,omitempty"` + + // The unique user-defined name for this load balancer. + Name *string `json:"name,omitempty"` +} + +// UnmarshalLoadBalancerPatch unmarshals an instance of LoadBalancerPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPatch) + err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the LoadBalancerPatch +func (loadBalancerPatch *LoadBalancerPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPolicyPatch) + jsonData, err = json.Marshal(loadBalancerPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// LoadBalancerListenerPolicyPrototype : LoadBalancerListenerPolicyPrototype struct -type LoadBalancerListenerPolicyPrototype struct { - // The policy action. +// LoadBalancerPool : LoadBalancerPool struct +type LoadBalancerPool struct { + // The load balancing algorithm. + Algorithm *string `json:"algorithm" validate:"required"` + + // The date and time that this pool was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitor `json:"health_monitor" validate:"required"` + + // The pool's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this load balancer pool. + ID *string `json:"id" validate:"required"` + + // The instance group that is managing this pool. + InstanceGroup *InstanceGroupReference `json:"instance_group,omitempty"` + + // The backend server members of the pool. + Members []LoadBalancerPoolMemberReference `json:"members,omitempty"` + + // The user-defined name for this load balancer pool. + Name *string `json:"name" validate:"required"` + + // The protocol used for this load balancer pool. // // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the + // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the // unexpected property value was encountered. - Action *string `json:"action" validate:"required"` + Protocol *string `json:"protocol" validate:"required"` - // The user-defined name for this policy. Names must be unique within the load balancer listener the policy resides in. - Name *string `json:"name,omitempty"` + // The provisioning status of this pool. + ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - // Priority of the policy. Lower value indicates higher priority. - Priority *int64 `json:"priority" validate:"required"` + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled + // + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol" validate:"required"` + + // The session persistence of this pool. + // + // The enumerated values for this property are expected to expand in the future. When + // processing this property, check for and log unknown values. Optionally halt + // processing and surface the error, or bypass the pool on which the unexpected + // property value was encountered. + SessionPersistence *LoadBalancerPoolSessionPersistence `json:"session_persistence,omitempty"` +} + +// Constants associated with the LoadBalancerPool.Algorithm property. +// The load balancing algorithm. +const ( + LoadBalancerPoolAlgorithmLeastConnectionsConst = "least_connections" + LoadBalancerPoolAlgorithmRoundRobinConst = "round_robin" + LoadBalancerPoolAlgorithmWeightedRoundRobinConst = "weighted_round_robin" +) + +// Constants associated with the LoadBalancerPool.Protocol property. +// The protocol used for this load balancer pool. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the +// unexpected property value was encountered. +const ( + LoadBalancerPoolProtocolHTTPConst = "http" + LoadBalancerPoolProtocolHTTPSConst = "https" + LoadBalancerPoolProtocolTCPConst = "tcp" +) + +// Constants associated with the LoadBalancerPool.ProvisioningStatus property. +// The provisioning status of this pool. +const ( + LoadBalancerPoolProvisioningStatusActiveConst = "active" + LoadBalancerPoolProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerPoolProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerPoolProvisioningStatusFailedConst = "failed" + LoadBalancerPoolProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerPoolProvisioningStatusUpdatePendingConst = "update_pending" +) + +// Constants associated with the LoadBalancerPool.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + LoadBalancerPoolProxyProtocolDisabledConst = "disabled" + LoadBalancerPoolProxyProtocolV1Const = "v1" + LoadBalancerPoolProxyProtocolV2Const = "v2" +) + +// UnmarshalLoadBalancerPool unmarshals an instance of LoadBalancerPool from the specified map of raw messages. +func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPool) + err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitor) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistence) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerPoolCollection : LoadBalancerPoolCollection struct +type LoadBalancerPoolCollection struct { + // Collection of pools. + Pools []LoadBalancerPool `json:"pools" validate:"required"` +} + +// UnmarshalLoadBalancerPoolCollection unmarshals an instance of LoadBalancerPoolCollection from the specified map of raw messages. +func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolCollection) + err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPool) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerPoolHealthMonitor : LoadBalancerPoolHealthMonitor struct +type LoadBalancerPoolHealthMonitor struct { + // The health check interval in seconds. Interval must be greater than timeout value. + Delay *int64 `json:"delay" validate:"required"` + + // The health check max retries. + MaxRetries *int64 `json:"max_retries" validate:"required"` + + // The health check port number. If specified, this overrides the ports specified in the server member resources. + Port *int64 `json:"port,omitempty"` + + // The health check timeout in seconds. + Timeout *int64 `json:"timeout" validate:"required"` + + // The protocol type of this load balancer pool health monitor. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which + // the unexpected property value was encountered. + Type *string `json:"type" validate:"required"` + + // The health check URL path. Applicable only if the health monitor `type` is `http` or + // `https`. This value must be in the format of an [origin-form request + // target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + URLPath *string `json:"url_path,omitempty"` +} + +// Constants associated with the LoadBalancerPoolHealthMonitor.Type property. +// The protocol type of this load balancer pool health monitor. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which +// the unexpected property value was encountered. +const ( + LoadBalancerPoolHealthMonitorTypeHTTPConst = "http" + LoadBalancerPoolHealthMonitorTypeHTTPSConst = "https" + LoadBalancerPoolHealthMonitorTypeTCPConst = "tcp" +) + +// UnmarshalLoadBalancerPoolHealthMonitor unmarshals an instance of LoadBalancerPoolHealthMonitor from the specified map of raw messages. +func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolHealthMonitor) + err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerPoolHealthMonitorPatch : LoadBalancerPoolHealthMonitorPatch struct +type LoadBalancerPoolHealthMonitorPatch struct { + // The health check interval in seconds. Interval must be greater than timeout value. + Delay *int64 `json:"delay" validate:"required"` + + // The health check max retries. + MaxRetries *int64 `json:"max_retries" validate:"required"` + + // The health check port number. If specified, this overrides the ports specified in the server member resources. + // Specify `null` to remove an existing port value. + Port *int64 `json:"port,omitempty"` + + // The health check timeout in seconds. + Timeout *int64 `json:"timeout" validate:"required"` + + // The protocol type of this load balancer pool health monitor. + Type *string `json:"type" validate:"required"` + + // The health check URL path. Applicable only if the health monitor `type` is `http` or + // `https`. This value must be in the format of an [origin-form request + // target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + URLPath *string `json:"url_path,omitempty"` +} + +// Constants associated with the LoadBalancerPoolHealthMonitorPatch.Type property. +// The protocol type of this load balancer pool health monitor. +const ( + LoadBalancerPoolHealthMonitorPatchTypeHTTPConst = "http" + LoadBalancerPoolHealthMonitorPatchTypeHTTPSConst = "https" + LoadBalancerPoolHealthMonitorPatchTypeTCPConst = "tcp" +) + +// NewLoadBalancerPoolHealthMonitorPatch : Instantiate LoadBalancerPoolHealthMonitorPatch (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolHealthMonitorPatch(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPatch, err error) { + _model = &LoadBalancerPoolHealthMonitorPatch{ + Delay: core.Int64Ptr(delay), + MaxRetries: core.Int64Ptr(maxRetries), + Timeout: core.Int64Ptr(timeout), + Type: core.StringPtr(typeVar), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerPoolHealthMonitorPatch unmarshals an instance of LoadBalancerPoolHealthMonitorPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolHealthMonitorPatch) + err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerPoolHealthMonitorPrototype : LoadBalancerPoolHealthMonitorPrototype struct +type LoadBalancerPoolHealthMonitorPrototype struct { + // The health check interval in seconds. Interval must be greater than timeout value. + Delay *int64 `json:"delay" validate:"required"` + + // The health check max retries. + MaxRetries *int64 `json:"max_retries" validate:"required"` + + // The health check port number. If specified, this overrides the ports specified in the server member resources. + Port *int64 `json:"port,omitempty"` + + // The health check timeout in seconds. + Timeout *int64 `json:"timeout" validate:"required"` - // The rule prototype objects for this policy. - Rules []LoadBalancerListenerPolicyRulePrototype `json:"rules,omitempty"` + // The protocol type of this load balancer pool health monitor. + Type *string `json:"type" validate:"required"` - // - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - // - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. - // - If `action` is `https_redirect`, specify a - // `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - Target LoadBalancerListenerPolicyTargetPrototypeIntf `json:"target,omitempty"` + // The health check URL path. Applicable only if the health monitor `type` is `http` or + // `https`. This value must be in the format of an [origin-form request + // target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + URLPath *string `json:"url_path,omitempty"` } -// Constants associated with the LoadBalancerListenerPolicyPrototype.Action property. -// The policy action. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the policy on which the -// unexpected property value was encountered. +// Constants associated with the LoadBalancerPoolHealthMonitorPrototype.Type property. +// The protocol type of this load balancer pool health monitor. const ( - LoadBalancerListenerPolicyPrototypeActionForwardConst = "forward" - LoadBalancerListenerPolicyPrototypeActionHTTPSRedirectConst = "https_redirect" - LoadBalancerListenerPolicyPrototypeActionRedirectConst = "redirect" - LoadBalancerListenerPolicyPrototypeActionRejectConst = "reject" + LoadBalancerPoolHealthMonitorPrototypeTypeHTTPConst = "http" + LoadBalancerPoolHealthMonitorPrototypeTypeHTTPSConst = "https" + LoadBalancerPoolHealthMonitorPrototypeTypeTCPConst = "tcp" ) -// NewLoadBalancerListenerPolicyPrototype : Instantiate LoadBalancerListenerPolicyPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyPrototype(action string, priority int64) (_model *LoadBalancerListenerPolicyPrototype, err error) { - _model = &LoadBalancerListenerPolicyPrototype{ - Action: core.StringPtr(action), - Priority: core.Int64Ptr(priority), +// NewLoadBalancerPoolHealthMonitorPrototype : Instantiate LoadBalancerPoolHealthMonitorPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolHealthMonitorPrototype(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPrototype, err error) { + _model = &LoadBalancerPoolHealthMonitorPrototype{ + Delay: core.Int64Ptr(delay), + MaxRetries: core.Int64Ptr(maxRetries), + Timeout: core.Int64Ptr(timeout), + Type: core.StringPtr(typeVar), } err = core.ValidateStruct(_model, "required parameters") return } -// UnmarshalLoadBalancerListenerPolicyPrototype unmarshals an instance of LoadBalancerListenerPolicyPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalLoadBalancerPoolHealthMonitorPrototype unmarshals an instance of LoadBalancerPoolHealthMonitorPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolHealthMonitorPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolHealthMonitorPrototype) + err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) if err != nil { return } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRulePrototype) + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerListenerPolicyTargetPrototype) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) if err != nil { return } @@ -38400,23 +44669,30 @@ func UnmarshalLoadBalancerListenerPolicyPrototype(m map[string]json.RawMessage, return } -// LoadBalancerListenerPolicyReference : LoadBalancerListenerPolicyReference struct -type LoadBalancerListenerPolicyReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *LoadBalancerListenerPolicyReferenceDeleted `json:"deleted,omitempty"` +// LoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. +// Models which "extend" this model: +// - LoadBalancerPoolIdentityByID +// - LoadBalancerPoolIdentityByHref +type LoadBalancerPoolIdentity struct { + // The unique identifier for this load balancer pool. + ID *string `json:"id,omitempty"` - // The listener policy's canonical URL. - Href *string `json:"href" validate:"required"` + // The pool's canonical URL. + Href *string `json:"href,omitempty"` +} - // The policy's unique identifier. - ID *string `json:"id" validate:"required"` +func (*LoadBalancerPoolIdentity) isaLoadBalancerPoolIdentity() bool { + return true } -// UnmarshalLoadBalancerListenerPolicyReference unmarshals an instance of LoadBalancerListenerPolicyReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyReferenceDeleted) +type LoadBalancerPoolIdentityIntf interface { + isaLoadBalancerPoolIdentity() bool +} + +// UnmarshalLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerPoolIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -38424,25 +44700,29 @@ func UnmarshalLoadBalancerListenerPolicyReference(m map[string]json.RawMessage, if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListenerPolicyReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type LoadBalancerListenerPolicyReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// LoadBalancerPoolIdentityByName : LoadBalancerPoolIdentityByName struct +type LoadBalancerPoolIdentityByName struct { + // The user-defined name for this load balancer pool. + Name *string `json:"name" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// NewLoadBalancerPoolIdentityByName : Instantiate LoadBalancerPoolIdentityByName (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolIdentityByName(name string) (_model *LoadBalancerPoolIdentityByName, err error) { + _model = &LoadBalancerPoolIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalLoadBalancerPoolIdentityByName unmarshals an instance of LoadBalancerPoolIdentityByName from the specified map of raw messages. +func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -38450,87 +44730,67 @@ func UnmarshalLoadBalancerListenerPolicyReferenceDeleted(m map[string]json.RawMe return } -// LoadBalancerListenerPolicyRule : LoadBalancerListenerPolicyRule struct -type LoadBalancerListenerPolicyRule struct { - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The date and time that this rule was created. +// LoadBalancerPoolMember : LoadBalancerPoolMember struct +type LoadBalancerPoolMember struct { + // The date and time that this member was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. - // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. - // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` + // Health of the server member in the pool. + Health *string `json:"health" validate:"required"` - // The rule's canonical URL. + // The member's canonical URL. Href *string `json:"href" validate:"required"` - // The rule's unique identifier. + // The unique identifier for this load balancer pool member. ID *string `json:"id" validate:"required"` - // The provisioning status of this rule. + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) + // + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. + Port *int64 `json:"port" validate:"required"` + + // The provisioning status of this member. ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. + Target LoadBalancerPoolMemberTargetIntf `json:"target" validate:"required"` - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` } -// Constants associated with the LoadBalancerListenerPolicyRule.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRuleConditionContainsConst = "contains" - LoadBalancerListenerPolicyRuleConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRuleConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRule.ProvisioningStatus property. -// The provisioning status of this rule. +// Constants associated with the LoadBalancerPoolMember.Health property. +// Health of the server member in the pool. const ( - LoadBalancerListenerPolicyRuleProvisioningStatusActiveConst = "active" - LoadBalancerListenerPolicyRuleProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusFailedConst = "failed" - LoadBalancerListenerPolicyRuleProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerListenerPolicyRuleProvisioningStatusUpdatePendingConst = "update_pending" + LoadBalancerPoolMemberHealthFaultedConst = "faulted" + LoadBalancerPoolMemberHealthOkConst = "ok" + LoadBalancerPoolMemberHealthUnknownConst = "unknown" ) -// Constants associated with the LoadBalancerListenerPolicyRule.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. +// Constants associated with the LoadBalancerPoolMember.ProvisioningStatus property. +// The provisioning status of this member. const ( - LoadBalancerListenerPolicyRuleTypeBodyConst = "body" - LoadBalancerListenerPolicyRuleTypeHeaderConst = "header" - LoadBalancerListenerPolicyRuleTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRuleTypePathConst = "path" - LoadBalancerListenerPolicyRuleTypeQueryConst = "query" + LoadBalancerPoolMemberProvisioningStatusActiveConst = "active" + LoadBalancerPoolMemberProvisioningStatusCreatePendingConst = "create_pending" + LoadBalancerPoolMemberProvisioningStatusDeletePendingConst = "delete_pending" + LoadBalancerPoolMemberProvisioningStatusFailedConst = "failed" + LoadBalancerPoolMemberProvisioningStatusMaintenancePendingConst = "maintenance_pending" + LoadBalancerPoolMemberProvisioningStatusUpdatePendingConst = "update_pending" ) -// UnmarshalLoadBalancerListenerPolicyRule unmarshals an instance of LoadBalancerListenerPolicyRule from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRule) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) - if err != nil { - return - } +// UnmarshalLoadBalancerPoolMember unmarshals an instance of LoadBalancerPoolMember from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMember) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) + err = core.UnmarshalPrimitive(m, "health", &obj.Health) if err != nil { return } @@ -38542,15 +44802,19 @@ func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, resul if err != nil { return } + err = core.UnmarshalPrimitive(m, "port", &obj.Port) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTarget) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) if err != nil { return } @@ -38558,16 +44822,16 @@ func UnmarshalLoadBalancerListenerPolicyRule(m map[string]json.RawMessage, resul return } -// LoadBalancerListenerPolicyRuleCollection : LoadBalancerListenerPolicyRuleCollection struct -type LoadBalancerListenerPolicyRuleCollection struct { - // Collection of rules. - Rules []LoadBalancerListenerPolicyRule `json:"rules" validate:"required"` +// LoadBalancerPoolMemberCollection : LoadBalancerPoolMemberCollection struct +type LoadBalancerPoolMemberCollection struct { + // Collection of members. + Members []LoadBalancerPoolMember `json:"members" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyRuleCollection unmarshals an instance of LoadBalancerListenerPolicyRuleCollection from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleCollection) - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalLoadBalancerListenerPolicyRule) +// UnmarshalLoadBalancerPoolMemberCollection unmarshals an instance of LoadBalancerPoolMemberCollection from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberCollection) + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMember) if err != nil { return } @@ -38575,68 +44839,39 @@ func UnmarshalLoadBalancerListenerPolicyRuleCollection(m map[string]json.RawMess return } -// LoadBalancerListenerPolicyRulePatch : LoadBalancerListenerPolicyRulePatch struct -type LoadBalancerListenerPolicyRulePatch struct { - // The condition of the rule. - Condition *string `json:"condition,omitempty"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. +// LoadBalancerPoolMemberPatch : LoadBalancerPoolMemberPatch struct +type LoadBalancerPoolMemberPatch struct { + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` + // The port must be unique across all members for all pools associated with this pool's listener. + Port *int64 `json:"port,omitempty"` - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type,omitempty"` + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. + Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target,omitempty"` - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value,omitempty"` + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` } -// Constants associated with the LoadBalancerListenerPolicyRulePatch.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRulePatchConditionContainsConst = "contains" - LoadBalancerListenerPolicyRulePatchConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRulePatchConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRulePatch.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRulePatchTypeBodyConst = "body" - LoadBalancerListenerPolicyRulePatchTypeHeaderConst = "header" - LoadBalancerListenerPolicyRulePatchTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRulePatchTypePathConst = "path" - LoadBalancerListenerPolicyRulePatchTypeQueryConst = "query" -) - -// UnmarshalLoadBalancerListenerPolicyRulePatch unmarshals an instance of LoadBalancerListenerPolicyRulePatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRulePatch) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) +// UnmarshalLoadBalancerPoolMemberPatch unmarshals an instance of LoadBalancerPoolMemberPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberPatch) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) if err != nil { return } @@ -38644,89 +44879,59 @@ func UnmarshalLoadBalancerListenerPolicyRulePatch(m map[string]json.RawMessage, return } -// AsPatch returns a generic map representation of the LoadBalancerListenerPolicyRulePatch -func (loadBalancerListenerPolicyRulePatch *LoadBalancerListenerPolicyRulePatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the LoadBalancerPoolMemberPatch +func (loadBalancerPoolMemberPatch *LoadBalancerPoolMemberPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(loadBalancerListenerPolicyRulePatch) + jsonData, err = json.Marshal(loadBalancerPoolMemberPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// LoadBalancerListenerPolicyRulePrototype : LoadBalancerListenerPolicyRulePrototype struct -type LoadBalancerListenerPolicyRulePrototype struct { - // The condition of the rule. - Condition *string `json:"condition" validate:"required"` - - // The field. This is applicable to `header`, `query`, and `body` rule types. - // - // If the rule type is `header`, this property is required. +// LoadBalancerPoolMemberPrototype : LoadBalancerPoolMemberPrototype struct +type LoadBalancerPoolMemberPrototype struct { + // The port the member will receive load balancer traffic on. Applies only to load balancer traffic received on a + // listener with a single port. (If the traffic is received on a listener with a port range, the member will receive + // the traffic on the same port the listener received it on.) // - // If the rule type is `query`, this is optional. If specified and the rule condition is not - // `matches_regex`, the value must be percent-encoded. + // This port will also be used for health checks unless the `port` property of + // `health_monitor` property is specified. // - // If the rule type is `body`, this is optional. - Field *string `json:"field,omitempty"` + // The port must be unique across all members for all pools associated with this pool's listener. + Port *int64 `json:"port" validate:"required"` - // The type of the rule. - // - // Body rules are applied to form-encoded request bodies using the `UTF-8` character set. - Type *string `json:"type" validate:"required"` + // The pool member target. Load balancers in the `network` family support virtual server + // instances. Load balancers in the `application` family support IP addresses. + Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` - // Value to be matched for rule condition. - // - // If the rule type is `query` and the rule condition is not `matches_regex`, the value must be percent-encoded. - Value *string `json:"value" validate:"required"` + // Weight of the server member. Applicable only if the pool algorithm is + // `weighted_round_robin`. + Weight *int64 `json:"weight,omitempty"` } -// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Condition property. -// The condition of the rule. -const ( - LoadBalancerListenerPolicyRulePrototypeConditionContainsConst = "contains" - LoadBalancerListenerPolicyRulePrototypeConditionEqualsConst = "equals" - LoadBalancerListenerPolicyRulePrototypeConditionMatchesRegexConst = "matches_regex" -) - -// Constants associated with the LoadBalancerListenerPolicyRulePrototype.Type property. -// The type of the rule. -// -// Body rules are applied to form-encoded request bodies using the `UTF-8` character set. -const ( - LoadBalancerListenerPolicyRulePrototypeTypeBodyConst = "body" - LoadBalancerListenerPolicyRulePrototypeTypeHeaderConst = "header" - LoadBalancerListenerPolicyRulePrototypeTypeHostnameConst = "hostname" - LoadBalancerListenerPolicyRulePrototypeTypePathConst = "path" - LoadBalancerListenerPolicyRulePrototypeTypeQueryConst = "query" -) - -// NewLoadBalancerListenerPolicyRulePrototype : Instantiate LoadBalancerListenerPolicyRulePrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPolicyRulePrototype(condition string, typeVar string, value string) (_model *LoadBalancerListenerPolicyRulePrototype, err error) { - _model = &LoadBalancerListenerPolicyRulePrototype{ - Condition: core.StringPtr(condition), - Type: core.StringPtr(typeVar), - Value: core.StringPtr(value), +// NewLoadBalancerPoolMemberPrototype : Instantiate LoadBalancerPoolMemberPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberPrototype(port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) (_model *LoadBalancerPoolMemberPrototype, err error) { + _model = &LoadBalancerPoolMemberPrototype{ + Port: core.Int64Ptr(port), + Target: target, } err = core.ValidateStruct(_model, "required parameters") return } -// UnmarshalLoadBalancerListenerPolicyRulePrototype unmarshals an instance of LoadBalancerListenerPolicyRulePrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRulePrototype) - err = core.UnmarshalPrimitive(m, "condition", &obj.Condition) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "field", &obj.Field) +// UnmarshalLoadBalancerPoolMemberPrototype unmarshals an instance of LoadBalancerPoolMemberPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberPrototype) + err = core.UnmarshalPrimitive(m, "port", &obj.Port) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) if err != nil { return } @@ -38734,23 +44939,23 @@ func UnmarshalLoadBalancerListenerPolicyRulePrototype(m map[string]json.RawMessa return } -// LoadBalancerListenerPolicyRuleReference : LoadBalancerListenerPolicyRuleReference struct -type LoadBalancerListenerPolicyRuleReference struct { +// LoadBalancerPoolMemberReference : LoadBalancerPoolMemberReference struct +type LoadBalancerPoolMemberReference struct { // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *LoadBalancerListenerPolicyRuleReferenceDeleted `json:"deleted,omitempty"` + Deleted *LoadBalancerPoolMemberReferenceDeleted `json:"deleted,omitempty"` - // The rule's canonical URL. + // The member's canonical URL. Href *string `json:"href" validate:"required"` - // The rule's unique identifier. + // The unique identifier for this load balancer pool member. ID *string `json:"id" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyRuleReference unmarshals an instance of LoadBalancerListenerPolicyRuleReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted) +// UnmarshalLoadBalancerPoolMemberReference unmarshals an instance of LoadBalancerPoolMemberReference from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolMemberReferenceDeleted) if err != nil { return } @@ -38766,16 +44971,16 @@ func UnmarshalLoadBalancerListenerPolicyRuleReference(m map[string]json.RawMessa return } -// LoadBalancerListenerPolicyRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// LoadBalancerPoolMemberReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type LoadBalancerListenerPolicyRuleReferenceDeleted struct { +type LoadBalancerPoolMemberReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted unmarshals an instance of LoadBalancerListenerPolicyRuleReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyRuleReferenceDeleted) +// UnmarshalLoadBalancerPoolMemberReferenceDeleted unmarshals an instance of LoadBalancerPoolMemberReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -38784,79 +44989,68 @@ func UnmarshalLoadBalancerListenerPolicyRuleReferenceDeleted(m map[string]json.R return } -// LoadBalancerListenerPolicyTarget : - If `action` is `forward`, the response is a `LoadBalancerPoolReference` -// - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` -// - If `action` is `https_redirect`, the response is a `LoadBalancerListenerHTTPSRedirect`. +// LoadBalancerPoolMemberTarget : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in +// the `application` family support IP addresses. // Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetLoadBalancerPoolReference -// - LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL -// - LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect -type LoadBalancerListenerPolicyTarget struct { +// - LoadBalancerPoolMemberTargetInstanceReference +// - LoadBalancerPoolMemberTargetIP +type LoadBalancerPoolMemberTarget struct { + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` + // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` + Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - // The pool's canonical URL. + // The URL for this virtual server instance. Href *string `json:"href,omitempty"` - // The unique identifier for this load balancer pool. + // The unique identifier for this virtual server instance. ID *string `json:"id,omitempty"` - // The user-defined name for this load balancer pool. + // The user-defined name for this virtual server instance (and default system hostname). Name *string `json:"name,omitempty"` - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` - - // The redirect target URL. - URL *string `json:"url,omitempty"` - - Listener *LoadBalancerListenerReference `json:"listener,omitempty"` - - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` } -func (*LoadBalancerListenerPolicyTarget) isaLoadBalancerListenerPolicyTarget() bool { +func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { return true } -type LoadBalancerListenerPolicyTargetIntf interface { - isaLoadBalancerListenerPolicyTarget() bool +type LoadBalancerPoolMemberTargetIntf interface { + isaLoadBalancerPoolMemberTarget() bool } -// UnmarshalLoadBalancerListenerPolicyTarget unmarshals an instance of LoadBalancerListenerPolicyTarget from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTarget) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalLoadBalancerPoolMemberTarget unmarshals an instance of LoadBalancerPoolMemberTarget from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -38864,66 +45058,53 @@ func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, res return } -// LoadBalancerListenerPolicyTargetPatch : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. -// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. -// - If `action` is `https_redirect`, specify a -// `LoadBalancerListenerPolicyHTTPSRedirectPatch`. +// LoadBalancerPoolMemberTargetPrototype : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in +// the `application` family support IP addresses. // Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch -// - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch -type LoadBalancerListenerPolicyTargetPatch struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` - - // The pool's canonical URL. - Href *string `json:"href,omitempty"` - - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` +// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity +// - LoadBalancerPoolMemberTargetPrototypeIP +type LoadBalancerPoolMemberTargetPrototype struct { + // The unique identifier for this virtual server instance. + ID *string `json:"id,omitempty"` - // The redirect target URL. - URL *string `json:"url,omitempty"` + // The CRN for this virtual server instance. + CRN *string `json:"crn,omitempty"` - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + // The URL for this virtual server instance. + Href *string `json:"href,omitempty"` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` } -func (*LoadBalancerListenerPolicyTargetPatch) isaLoadBalancerListenerPolicyTargetPatch() bool { +func (*LoadBalancerPoolMemberTargetPrototype) isaLoadBalancerPoolMemberTargetPrototype() bool { return true } -type LoadBalancerListenerPolicyTargetPatchIntf interface { - isaLoadBalancerListenerPolicyTargetPatch() bool +type LoadBalancerPoolMemberTargetPrototypeIntf interface { + isaLoadBalancerPoolMemberTargetPrototype() bool } -// UnmarshalLoadBalancerListenerPolicyTargetPatch unmarshals an instance of LoadBalancerListenerPolicyTargetPatch from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPatch) +// UnmarshalLoadBalancerPoolMemberTargetPrototype unmarshals an instance of LoadBalancerPoolMemberTargetPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototype) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -38931,66 +45112,97 @@ func UnmarshalLoadBalancerListenerPolicyTargetPatch(m map[string]json.RawMessage return } -// LoadBalancerListenerPolicyTargetPrototype : - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. -// - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPrototype`. -// - If `action` is `https_redirect`, specify a -// `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. -// Models which "extend" this model: -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype -// - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype -type LoadBalancerListenerPolicyTargetPrototype struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` +// LoadBalancerPoolPatch : LoadBalancerPoolPatch struct +type LoadBalancerPoolPatch struct { + // The load balancing algorithm. + Algorithm *string `json:"algorithm,omitempty"` - // The pool's canonical URL. - Href *string `json:"href,omitempty"` + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitorPatch `json:"health_monitor,omitempty"` - // The HTTP status code for this redirect. - HTTPStatusCode *int64 `json:"http_status_code,omitempty"` + // The user-defined name for this load balancer pool. + Name *string `json:"name,omitempty"` - // The redirect target URL. - URL *string `json:"url,omitempty"` + // The protocol to use for this load balancer pool. Load balancers in the `network` family support `tcp`. Load + // balancers in the `application` family support `tcp`, `http`, and + // `https`. + // + // If this pool is associated with a load balancer listener, the specified protocol must be compatible with the + // listener's protocol. At present, the compatible protocols are + // `http` and `https`. + Protocol *string `json:"protocol,omitempty"` - // Identifies a load balancer listener by a unique property. - Listener LoadBalancerListenerIdentityIntf `json:"listener,omitempty"` + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled + // + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol,omitempty"` - // The redirect relative target URI. - URI *string `json:"uri,omitempty"` + // The session persistence of this pool. + SessionPersistence *LoadBalancerPoolSessionPersistencePatch `json:"session_persistence,omitempty"` } -func (*LoadBalancerListenerPolicyTargetPrototype) isaLoadBalancerListenerPolicyTargetPrototype() bool { - return true -} +// Constants associated with the LoadBalancerPoolPatch.Algorithm property. +// The load balancing algorithm. +const ( + LoadBalancerPoolPatchAlgorithmLeastConnectionsConst = "least_connections" + LoadBalancerPoolPatchAlgorithmRoundRobinConst = "round_robin" + LoadBalancerPoolPatchAlgorithmWeightedRoundRobinConst = "weighted_round_robin" +) -type LoadBalancerListenerPolicyTargetPrototypeIntf interface { - isaLoadBalancerListenerPolicyTargetPrototype() bool -} +// Constants associated with the LoadBalancerPoolPatch.Protocol property. +// The protocol to use for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers +// in the `application` family support `tcp`, `http`, and +// `https`. +// +// If this pool is associated with a load balancer listener, the specified protocol must be compatible with the +// listener's protocol. At present, the compatible protocols are +// `http` and `https`. +const ( + LoadBalancerPoolPatchProtocolHTTPConst = "http" + LoadBalancerPoolPatchProtocolHTTPSConst = "https" + LoadBalancerPoolPatchProtocolTCPConst = "tcp" +) -// UnmarshalLoadBalancerListenerPolicyTargetPrototype unmarshals an instance of LoadBalancerListenerPolicyTargetPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPolicyTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// Constants associated with the LoadBalancerPoolPatch.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + LoadBalancerPoolPatchProxyProtocolDisabledConst = "disabled" + LoadBalancerPoolPatchProxyProtocolV1Const = "v1" + LoadBalancerPoolPatchProxyProtocolV2Const = "v2" +) + +// UnmarshalLoadBalancerPoolPatch unmarshals an instance of LoadBalancerPoolPatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolPatch) + err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "http_status_code", &obj.HTTPStatusCode) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url", &obj.URL) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalModel(m, "listener", &obj.Listener, UnmarshalLoadBalancerListenerIdentity) + err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "uri", &obj.URI) + err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePatch) if err != nil { return } @@ -38998,100 +45210,119 @@ func UnmarshalLoadBalancerListenerPolicyTargetPrototype(m map[string]json.RawMes return } -// LoadBalancerListenerPrototypeLoadBalancerContext : LoadBalancerListenerPrototypeLoadBalancerContext struct -type LoadBalancerListenerPrototypeLoadBalancerContext struct { - // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in - // the `application` family (otherwise always `false`). Additional restrictions: - // - If this listener has `https_redirect` specified, its `accept_proxy_protocol` value must - // match the `accept_proxy_protocol` value of the `https_redirect` listener. - // - If this listener is the target of another listener's `https_redirect`, its - // `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - AcceptProxyProtocol *bool `json:"accept_proxy_protocol,omitempty"` +// AsPatch returns a generic map representation of the LoadBalancerPoolPatch +func (loadBalancerPoolPatch *LoadBalancerPoolPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(loadBalancerPoolPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} - // The connection limit of the listener. - ConnectionLimit *int64 `json:"connection_limit,omitempty"` +// LoadBalancerPoolPrototype : LoadBalancerPoolPrototype struct +type LoadBalancerPoolPrototype struct { + // The load balancing algorithm. + Algorithm *string `json:"algorithm" validate:"required"` - // The default pool associated with the listener. - DefaultPool *LoadBalancerPoolIdentityByName `json:"default_pool,omitempty"` + // The health monitor of this pool. + HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` - // The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must - // have a unique `port` and `protocol` combination. - // - // Not supported for load balancers operating with route mode enabled. - Port *int64 `json:"port,omitempty"` + // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` + // tuple cannot be shared by a pool member of any other load balancer in the same VPC. + Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` - // The inclusive upper bound of the range of ports used by this listener. Must not be less than `port_min`. - // - // At present, only load balancers operating with route mode enabled support different values for `port_min` and - // `port_max`. When route mode is enabled, the value - // `65535` must be specified. - // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMax *int64 `json:"port_max,omitempty"` + // The user-defined name for this load balancer pool. If unspecified, the name will be a hyphenated list of + // randomly-selected words. + Name *string `json:"name,omitempty"` - // The inclusive lower bound of the range of ports used by this listener. Must not be greater than `port_max`. - // - // At present, only load balancers operating with route mode enabled support different values for `port_min` and - // `port_max`. When route mode is enabled, the value `1` must be specified. + // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers + // in the `application` family support `tcp`, `http`, and + // `https`. + Protocol *string `json:"protocol" validate:"required"` + + // The PROXY protocol setting for this pool: + // - `v1`: Enabled with version 1 (human-readable header format) + // - `v2`: Enabled with version 2 (binary header format) + // - `disabled`: Disabled // - // The specified port range must not overlap with port ranges used by other listeners for this load balancer using the - // same protocol. - PortMin *int64 `json:"port_min,omitempty"` + // Supported by load balancers in the `application` family (otherwise always `disabled`). + ProxyProtocol *string `json:"proxy_protocol,omitempty"` - // The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` - // family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and - // `protocol` combination. - Protocol *string `json:"protocol" validate:"required"` + // The session persistence of this pool. + SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` } -// Constants associated with the LoadBalancerListenerPrototypeLoadBalancerContext.Protocol property. -// The listener protocol. Load balancers in the `network` family support `tcp`. Load balancers in the `application` -// family support `tcp`, `http`, and `https`. Each listener in the load balancer must have a unique `port` and -// `protocol` combination. +// Constants associated with the LoadBalancerPoolPrototype.Algorithm property. +// The load balancing algorithm. const ( - LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPConst = "http" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolHTTPSConst = "https" - LoadBalancerListenerPrototypeLoadBalancerContextProtocolTCPConst = "tcp" + LoadBalancerPoolPrototypeAlgorithmLeastConnectionsConst = "least_connections" + LoadBalancerPoolPrototypeAlgorithmRoundRobinConst = "round_robin" + LoadBalancerPoolPrototypeAlgorithmWeightedRoundRobinConst = "weighted_round_robin" ) -// NewLoadBalancerListenerPrototypeLoadBalancerContext : Instantiate LoadBalancerListenerPrototypeLoadBalancerContext (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerListenerPrototypeLoadBalancerContext(protocol string) (_model *LoadBalancerListenerPrototypeLoadBalancerContext, err error) { - _model = &LoadBalancerListenerPrototypeLoadBalancerContext{ - Protocol: core.StringPtr(protocol), +// Constants associated with the LoadBalancerPoolPrototype.Protocol property. +// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers +// in the `application` family support `tcp`, `http`, and +// `https`. +const ( + LoadBalancerPoolPrototypeProtocolHTTPConst = "http" + LoadBalancerPoolPrototypeProtocolHTTPSConst = "https" + LoadBalancerPoolPrototypeProtocolTCPConst = "tcp" +) + +// Constants associated with the LoadBalancerPoolPrototype.ProxyProtocol property. +// The PROXY protocol setting for this pool: +// - `v1`: Enabled with version 1 (human-readable header format) +// - `v2`: Enabled with version 2 (binary header format) +// - `disabled`: Disabled +// +// Supported by load balancers in the `application` family (otherwise always `disabled`). +const ( + LoadBalancerPoolPrototypeProxyProtocolDisabledConst = "disabled" + LoadBalancerPoolPrototypeProxyProtocolV1Const = "v1" + LoadBalancerPoolPrototypeProxyProtocolV2Const = "v2" +) + +// NewLoadBalancerPoolPrototype : Instantiate LoadBalancerPoolPrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolPrototype(algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) (_model *LoadBalancerPoolPrototype, err error) { + _model = &LoadBalancerPoolPrototype{ + Algorithm: core.StringPtr(algorithm), + HealthMonitor: healthMonitor, + Protocol: core.StringPtr(protocol), } err = core.ValidateStruct(_model, "required parameters") return } -// UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext unmarshals an instance of LoadBalancerListenerPrototypeLoadBalancerContext from the specified map of raw messages. -func UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerPrototypeLoadBalancerContext) - err = core.UnmarshalPrimitive(m, "accept_proxy_protocol", &obj.AcceptProxyProtocol) +// UnmarshalLoadBalancerPoolPrototype unmarshals an instance of LoadBalancerPoolPrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolPrototype) + err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) if err != nil { return } - err = core.UnmarshalPrimitive(m, "connection_limit", &obj.ConnectionLimit) + err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "default_pool", &obj.DefaultPool, UnmarshalLoadBalancerPoolIdentityByName) + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberPrototype) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePrototype) if err != nil { return } @@ -39099,23 +45330,26 @@ func UnmarshalLoadBalancerListenerPrototypeLoadBalancerContext(m map[string]json return } -// LoadBalancerListenerReference : LoadBalancerListenerReference struct -type LoadBalancerListenerReference struct { +// LoadBalancerPoolReference : LoadBalancerPoolReference struct +type LoadBalancerPoolReference struct { // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *LoadBalancerListenerReferenceDeleted `json:"deleted,omitempty"` + Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` - // The listener's canonical URL. + // The pool's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer listener. + // The unique identifier for this load balancer pool. ID *string `json:"id" validate:"required"` + + // The user-defined name for this load balancer pool. + Name *string `json:"name" validate:"required"` } -// UnmarshalLoadBalancerListenerReference unmarshals an instance of LoadBalancerListenerReference from the specified map of raw messages. -func UnmarshalLoadBalancerListenerReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerListenerReferenceDeleted) +// UnmarshalLoadBalancerPoolReference unmarshals an instance of LoadBalancerPoolReference from the specified map of raw messages. +func UnmarshalLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) if err != nil { return } @@ -39127,20 +45361,24 @@ func UnmarshalLoadBalancerListenerReference(m map[string]json.RawMessage, result if err != nil { return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerListenerReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// LoadBalancerPoolReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type LoadBalancerListenerReferenceDeleted struct { +type LoadBalancerPoolReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalLoadBalancerListenerReferenceDeleted unmarshals an instance of LoadBalancerListenerReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerListenerReferenceDeleted) +// UnmarshalLoadBalancerPoolReferenceDeleted unmarshals an instance of LoadBalancerPoolReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerPoolReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -39149,42 +45387,34 @@ func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage, return } -// LoadBalancerLogging : The logging configuration for this load balancer. -type LoadBalancerLogging struct { - // The datapath logging configuration for this load balancer. - Datapath *LoadBalancerLoggingDatapath `json:"datapath,omitempty"` -} +// LoadBalancerPoolSessionPersistence : LoadBalancerPoolSessionPersistence struct +type LoadBalancerPoolSessionPersistence struct { + // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not + // allowed. + CookieName *string `json:"cookie_name,omitempty"` -// UnmarshalLoadBalancerLogging unmarshals an instance of LoadBalancerLogging from the specified map of raw messages. -func UnmarshalLoadBalancerLogging(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLogging) - err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapath) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` + // protocols. + Type *string `json:"type" validate:"required"` } -// LoadBalancerLoggingDatapath : The datapath logging configuration for this load balancer. -type LoadBalancerLoggingDatapath struct { - // Indicates whether datapath logging is active for this load balancer. - Active *bool `json:"active" validate:"required"` -} +// Constants associated with the LoadBalancerPoolSessionPersistence.Type property. +// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` +// protocols. +const ( + LoadBalancerPoolSessionPersistenceTypeAppCookieConst = "app_cookie" + LoadBalancerPoolSessionPersistenceTypeHTTPCookieConst = "http_cookie" + LoadBalancerPoolSessionPersistenceTypeSourceIPConst = "source_ip" +) -// NewLoadBalancerLoggingDatapath : Instantiate LoadBalancerLoggingDatapath (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerLoggingDatapath(active bool) (_model *LoadBalancerLoggingDatapath, err error) { - _model = &LoadBalancerLoggingDatapath{ - Active: core.BoolPtr(active), +// UnmarshalLoadBalancerPoolSessionPersistence unmarshals an instance of LoadBalancerPoolSessionPersistence from the specified map of raw messages. +func UnmarshalLoadBalancerPoolSessionPersistence(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolSessionPersistence) + err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages. -func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerLoggingDatapath) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -39192,25 +45422,34 @@ func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result i return } -// LoadBalancerPatch : LoadBalancerPatch struct -type LoadBalancerPatch struct { - // The logging configuration to use for this load balancer. - // - // To activate logging, the load balancer profile must support the specified logging type. - Logging *LoadBalancerLogging `json:"logging,omitempty"` +// LoadBalancerPoolSessionPersistencePatch : The session persistence configuration. Specify `null` to remove any existing session persistence configuration. +type LoadBalancerPoolSessionPersistencePatch struct { + // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not + // allowed. + CookieName *string `json:"cookie_name,omitempty"` - // The unique user-defined name for this load balancer. - Name *string `json:"name,omitempty"` + // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` + // protocols. + Type *string `json:"type,omitempty"` } -// UnmarshalLoadBalancerPatch unmarshals an instance of LoadBalancerPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPatch) - err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging) +// Constants associated with the LoadBalancerPoolSessionPersistencePatch.Type property. +// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` +// protocols. +const ( + LoadBalancerPoolSessionPersistencePatchTypeAppCookieConst = "app_cookie" + LoadBalancerPoolSessionPersistencePatchTypeHTTPCookieConst = "http_cookie" + LoadBalancerPoolSessionPersistencePatchTypeSourceIPConst = "source_ip" +) + +// UnmarshalLoadBalancerPoolSessionPersistencePatch unmarshals an instance of LoadBalancerPoolSessionPersistencePatch from the specified map of raw messages. +func UnmarshalLoadBalancerPoolSessionPersistencePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolSessionPersistencePatch) + err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -39218,125 +45457,73 @@ func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{} return } -// AsPatch returns a generic map representation of the LoadBalancerPatch -func (loadBalancerPatch *LoadBalancerPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerPool : LoadBalancerPool struct -type LoadBalancerPool struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` - - // The date and time that this pool was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitor `json:"health_monitor" validate:"required"` - - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` - - // The instance group that is managing this pool. - InstanceGroup *InstanceGroupReference `json:"instance_group,omitempty"` - - // The backend server members of the pool. - Members []LoadBalancerPoolMemberReference `json:"members,omitempty"` - - // The user-defined name for this load balancer pool. - Name *string `json:"name" validate:"required"` - - // The protocol used for this load balancer pool. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the - // unexpected property value was encountered. - Protocol *string `json:"protocol" validate:"required"` - - // The provisioning status of this pool. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol" validate:"required"` +// LoadBalancerPoolSessionPersistencePrototype : LoadBalancerPoolSessionPersistencePrototype struct +type LoadBalancerPoolSessionPersistencePrototype struct { + // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not + // allowed. + CookieName *string `json:"cookie_name,omitempty"` - // The session persistence of this pool. - // - // The enumerated values for this property are expected to expand in the future. When - // processing this property, check for and log unknown values. Optionally halt - // processing and surface the error, or bypass the pool on which the unexpected - // property value was encountered. - SessionPersistence *LoadBalancerPoolSessionPersistence `json:"session_persistence,omitempty"` + // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` + // protocols. + Type *string `json:"type" validate:"required"` } -// Constants associated with the LoadBalancerPool.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the LoadBalancerPool.Protocol property. -// The protocol used for this load balancer pool. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the -// unexpected property value was encountered. -const ( - LoadBalancerPoolProtocolHTTPConst = "http" - LoadBalancerPoolProtocolHTTPSConst = "https" - LoadBalancerPoolProtocolTCPConst = "tcp" -) - -// Constants associated with the LoadBalancerPool.ProvisioningStatus property. -// The provisioning status of this pool. +// Constants associated with the LoadBalancerPoolSessionPersistencePrototype.Type property. +// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` +// protocols. const ( - LoadBalancerPoolProvisioningStatusActiveConst = "active" - LoadBalancerPoolProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerPoolProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerPoolProvisioningStatusFailedConst = "failed" - LoadBalancerPoolProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerPoolProvisioningStatusUpdatePendingConst = "update_pending" + LoadBalancerPoolSessionPersistencePrototypeTypeAppCookieConst = "app_cookie" + LoadBalancerPoolSessionPersistencePrototypeTypeHTTPCookieConst = "http_cookie" + LoadBalancerPoolSessionPersistencePrototypeTypeSourceIPConst = "source_ip" ) -// Constants associated with the LoadBalancerPool.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - LoadBalancerPoolProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolProxyProtocolV1Const = "v1" - LoadBalancerPoolProxyProtocolV2Const = "v2" -) +// NewLoadBalancerPoolSessionPersistencePrototype : Instantiate LoadBalancerPoolSessionPersistencePrototype (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolSessionPersistencePrototype(typeVar string) (_model *LoadBalancerPoolSessionPersistencePrototype, err error) { + _model = &LoadBalancerPoolSessionPersistencePrototype{ + Type: core.StringPtr(typeVar), + } + err = core.ValidateStruct(_model, "required parameters") + return +} -// UnmarshalLoadBalancerPool unmarshals an instance of LoadBalancerPool from the specified map of raw messages. -func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPool) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) +// UnmarshalLoadBalancerPoolSessionPersistencePrototype unmarshals an instance of LoadBalancerPoolSessionPersistencePrototype from the specified map of raw messages. +func UnmarshalLoadBalancerPoolSessionPersistencePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolSessionPersistencePrototype) + err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitor) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerProfile : LoadBalancerProfile struct +type LoadBalancerProfile struct { + // The product family this load balancer profile belongs to. + Family *string `json:"family" validate:"required"` + + // The URL for this load balancer profile. + Href *string `json:"href" validate:"required"` + + // Indicates which logging type(s) are supported for a load balancer with this profile. + LoggingSupported *LoadBalancerProfileLoggingSupported `json:"logging_supported" validate:"required"` + + // The globally unique name for this load balancer profile. + Name *string `json:"name" validate:"required"` + + RouteModeSupported LoadBalancerProfileRouteModeSupportedIntf `json:"route_mode_supported" validate:"required"` + + SecurityGroupsSupported LoadBalancerProfileSecurityGroupsSupportedIntf `json:"security_groups_supported" validate:"required"` +} + +// UnmarshalLoadBalancerProfile unmarshals an instance of LoadBalancerProfile from the specified map of raw messages. +func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfile) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) if err != nil { return } @@ -39344,35 +45531,65 @@ func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "logging_supported", &obj.LoggingSupported, UnmarshalLoadBalancerProfileLoggingSupported) if err != nil { return } - err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberReference) + err = core.UnmarshalModel(m, "route_mode_supported", &obj.RouteModeSupported, UnmarshalLoadBalancerProfileRouteModeSupported) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "security_groups_supported", &obj.SecurityGroupsSupported, UnmarshalLoadBalancerProfileSecurityGroupsSupported) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerProfileCollection : LoadBalancerProfileCollection struct +type LoadBalancerProfileCollection struct { + // A link to the first page of resources. + First *LoadBalancerProfileCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *LoadBalancerProfileCollectionNext `json:"next,omitempty"` + + // Collection of load balancer profiles. + Profiles []LoadBalancerProfile `json:"profiles" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalLoadBalancerProfileCollection unmarshals an instance of LoadBalancerProfileCollection from the specified map of raw messages. +func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerProfileCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerProfileCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistence) + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalLoadBalancerProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -39380,16 +45597,28 @@ func UnmarshalLoadBalancerPool(m map[string]json.RawMessage, result interface{}) return } -// LoadBalancerPoolCollection : LoadBalancerPoolCollection struct -type LoadBalancerPoolCollection struct { - // Collection of pools. - Pools []LoadBalancerPool `json:"pools" validate:"required"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *LoadBalancerProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// UnmarshalLoadBalancerPoolCollection unmarshals an instance of LoadBalancerPoolCollection from the specified map of raw messages. -func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolCollection) - err = core.UnmarshalModel(m, "pools", &obj.Pools, UnmarshalLoadBalancerPool) +// LoadBalancerProfileCollectionFirst : A link to the first page of resources. +type LoadBalancerProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalLoadBalancerProfileCollectionFirst unmarshals an instance of LoadBalancerProfileCollectionFirst from the specified map of raw messages. +func UnmarshalLoadBalancerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -39397,69 +45626,51 @@ func UnmarshalLoadBalancerPoolCollection(m map[string]json.RawMessage, result in return } -// LoadBalancerPoolHealthMonitor : LoadBalancerPoolHealthMonitor struct -type LoadBalancerPoolHealthMonitor struct { - // The health check interval in seconds. Interval must be greater than timeout value. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` +// LoadBalancerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type LoadBalancerProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The health check port number. If specified, this overrides the ports specified in the server member resources. - Port *int64 `json:"port,omitempty"` +// UnmarshalLoadBalancerProfileCollectionNext unmarshals an instance of LoadBalancerProfileCollectionNext from the specified map of raw messages. +func UnmarshalLoadBalancerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The health check timeout in seconds. - Timeout *int64 `json:"timeout" validate:"required"` +// LoadBalancerProfileIdentity : Identifies a load balancer profile by a unique property. +// Models which "extend" this model: +// - LoadBalancerProfileIdentityByName +// - LoadBalancerProfileIdentityByHref +type LoadBalancerProfileIdentity struct { + // The globally unique name for this load balancer profile. + Name *string `json:"name,omitempty"` - // The protocol type of this load balancer pool health monitor. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which - // the unexpected property value was encountered. - Type *string `json:"type" validate:"required"` + // The URL for this load balancer profile. + Href *string `json:"href,omitempty"` +} - // The health check URL path. Applicable only if the health monitor `type` is `http` or - // `https`. This value must be in the format of an [origin-form request - // target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` +func (*LoadBalancerProfileIdentity) isaLoadBalancerProfileIdentity() bool { + return true } -// Constants associated with the LoadBalancerPoolHealthMonitor.Type property. -// The protocol type of this load balancer pool health monitor. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the health monitor on which -// the unexpected property value was encountered. -const ( - LoadBalancerPoolHealthMonitorTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorTypeTCPConst = "tcp" -) +type LoadBalancerProfileIdentityIntf interface { + isaLoadBalancerProfileIdentity() bool +} -// UnmarshalLoadBalancerPoolHealthMonitor unmarshals an instance of LoadBalancerPoolHealthMonitor from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitor) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalLoadBalancerProfileIdentity unmarshals an instance of LoadBalancerProfileIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -39467,74 +45678,60 @@ func UnmarshalLoadBalancerPoolHealthMonitor(m map[string]json.RawMessage, result return } -// LoadBalancerPoolHealthMonitorPatch : LoadBalancerPoolHealthMonitorPatch struct -type LoadBalancerPoolHealthMonitorPatch struct { - // The health check interval in seconds. Interval must be greater than timeout value. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` - - // The health check port number. If specified, this overrides the ports specified in the server member resources. - // Specify `null` to remove an existing port value. - Port *int64 `json:"port,omitempty"` - - // The health check timeout in seconds. - Timeout *int64 `json:"timeout" validate:"required"` - - // The protocol type of this load balancer pool health monitor. +// LoadBalancerProfileLoggingSupported : Indicates which logging type(s) are supported for a load balancer with this profile. +type LoadBalancerProfileLoggingSupported struct { + // The type for this profile field. Type *string `json:"type" validate:"required"` - // The health check URL path. Applicable only if the health monitor `type` is `http` or - // `https`. This value must be in the format of an [origin-form request - // target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` + // The supported logging type(s) for a load balancer with this profile. + Value []string `json:"value" validate:"required"` } -// Constants associated with the LoadBalancerPoolHealthMonitorPatch.Type property. -// The protocol type of this load balancer pool health monitor. +// Constants associated with the LoadBalancerProfileLoggingSupported.Type property. +// The type for this profile field. const ( - LoadBalancerPoolHealthMonitorPatchTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorPatchTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorPatchTypeTCPConst = "tcp" + LoadBalancerProfileLoggingSupportedTypeFixedConst = "fixed" ) -// NewLoadBalancerPoolHealthMonitorPatch : Instantiate LoadBalancerPoolHealthMonitorPatch (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolHealthMonitorPatch(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPatch, err error) { - _model = &LoadBalancerPoolHealthMonitorPatch{ - Delay: core.Int64Ptr(delay), - MaxRetries: core.Int64Ptr(maxRetries), - Timeout: core.Int64Ptr(timeout), - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolHealthMonitorPatch unmarshals an instance of LoadBalancerPoolHealthMonitorPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitorPatch) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) +// UnmarshalLoadBalancerProfileLoggingSupported unmarshals an instance of LoadBalancerProfileLoggingSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileLoggingSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileLoggingSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LoadBalancerProfileReference : LoadBalancerProfileReference struct +type LoadBalancerProfileReference struct { + // The product family this load balancer profile belongs to. + Family *string `json:"family" validate:"required"` + + // The URL for this load balancer profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this load balancer profile. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalLoadBalancerProfileReference unmarshals an instance of LoadBalancerProfileReference from the specified map of raw messages. +func UnmarshalLoadBalancerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileReference) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -39542,73 +45739,40 @@ func UnmarshalLoadBalancerPoolHealthMonitorPatch(m map[string]json.RawMessage, r return } -// LoadBalancerPoolHealthMonitorPrototype : LoadBalancerPoolHealthMonitorPrototype struct -type LoadBalancerPoolHealthMonitorPrototype struct { - // The health check interval in seconds. Interval must be greater than timeout value. - Delay *int64 `json:"delay" validate:"required"` - - // The health check max retries. - MaxRetries *int64 `json:"max_retries" validate:"required"` - - // The health check port number. If specified, this overrides the ports specified in the server member resources. - Port *int64 `json:"port,omitempty"` - - // The health check timeout in seconds. - Timeout *int64 `json:"timeout" validate:"required"` - - // The protocol type of this load balancer pool health monitor. - Type *string `json:"type" validate:"required"` +// LoadBalancerProfileRouteModeSupported : LoadBalancerProfileRouteModeSupported struct +// Models which "extend" this model: +// - LoadBalancerProfileRouteModeSupportedFixed +// - LoadBalancerProfileRouteModeSupportedDependent +type LoadBalancerProfileRouteModeSupported struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The health check URL path. Applicable only if the health monitor `type` is `http` or - // `https`. This value must be in the format of an [origin-form request - // target](https://tools.ietf.org/html/rfc7230#section-5.3.1). - URLPath *string `json:"url_path,omitempty"` + // The value for this profile field. + Value *bool `json:"value,omitempty"` } -// Constants associated with the LoadBalancerPoolHealthMonitorPrototype.Type property. -// The protocol type of this load balancer pool health monitor. +// Constants associated with the LoadBalancerProfileRouteModeSupported.Type property. +// The type for this profile field. const ( - LoadBalancerPoolHealthMonitorPrototypeTypeHTTPConst = "http" - LoadBalancerPoolHealthMonitorPrototypeTypeHTTPSConst = "https" - LoadBalancerPoolHealthMonitorPrototypeTypeTCPConst = "tcp" + LoadBalancerProfileRouteModeSupportedTypeFixedConst = "fixed" ) -// NewLoadBalancerPoolHealthMonitorPrototype : Instantiate LoadBalancerPoolHealthMonitorPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolHealthMonitorPrototype(delay int64, maxRetries int64, timeout int64, typeVar string) (_model *LoadBalancerPoolHealthMonitorPrototype, err error) { - _model = &LoadBalancerPoolHealthMonitorPrototype{ - Delay: core.Int64Ptr(delay), - MaxRetries: core.Int64Ptr(maxRetries), - Timeout: core.Int64Ptr(timeout), - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*LoadBalancerProfileRouteModeSupported) isaLoadBalancerProfileRouteModeSupported() bool { + return true } -// UnmarshalLoadBalancerPoolHealthMonitorPrototype unmarshals an instance of LoadBalancerPoolHealthMonitorPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolHealthMonitorPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolHealthMonitorPrototype) - err = core.UnmarshalPrimitive(m, "delay", &obj.Delay) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "max_retries", &obj.MaxRetries) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) - if err != nil { - return - } +type LoadBalancerProfileRouteModeSupportedIntf interface { + isaLoadBalancerProfileRouteModeSupported() bool +} + +// UnmarshalLoadBalancerProfileRouteModeSupported unmarshals an instance of LoadBalancerProfileRouteModeSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileRouteModeSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileRouteModeSupported) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "url_path", &obj.URLPath) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -39616,34 +45780,40 @@ func UnmarshalLoadBalancerPoolHealthMonitorPrototype(m map[string]json.RawMessag return } -// LoadBalancerPoolIdentity : Identifies a load balancer pool by a unique property. +// LoadBalancerProfileSecurityGroupsSupported : LoadBalancerProfileSecurityGroupsSupported struct // Models which "extend" this model: -// - LoadBalancerPoolIdentityByID -// - LoadBalancerPoolIdentityByHref -type LoadBalancerPoolIdentity struct { - // The unique identifier for this load balancer pool. - ID *string `json:"id,omitempty"` +// - LoadBalancerProfileSecurityGroupsSupportedFixed +// - LoadBalancerProfileSecurityGroupsSupportedDependent +type LoadBalancerProfileSecurityGroupsSupported struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` - // The pool's canonical URL. - Href *string `json:"href,omitempty"` + // The value for this profile field. + Value *bool `json:"value,omitempty"` } -func (*LoadBalancerPoolIdentity) isaLoadBalancerPoolIdentity() bool { +// Constants associated with the LoadBalancerProfileSecurityGroupsSupported.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileSecurityGroupsSupportedTypeFixedConst = "fixed" +) + +func (*LoadBalancerProfileSecurityGroupsSupported) isaLoadBalancerProfileSecurityGroupsSupported() bool { return true } -type LoadBalancerPoolIdentityIntf interface { - isaLoadBalancerPoolIdentity() bool +type LoadBalancerProfileSecurityGroupsSupportedIntf interface { + isaLoadBalancerProfileSecurityGroupsSupported() bool } -// UnmarshalLoadBalancerPoolIdentity unmarshals an instance of LoadBalancerPoolIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalLoadBalancerProfileSecurityGroupsSupported unmarshals an instance of LoadBalancerProfileSecurityGroupsSupported from the specified map of raw messages. +func UnmarshalLoadBalancerProfileSecurityGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileSecurityGroupsSupported) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -39651,25 +45821,55 @@ func UnmarshalLoadBalancerPoolIdentity(m map[string]json.RawMessage, result inte return } -// LoadBalancerPoolIdentityByName : LoadBalancerPoolIdentityByName struct -type LoadBalancerPoolIdentityByName struct { - // The user-defined name for this load balancer pool. - Name *string `json:"name" validate:"required"` +// LoadBalancerReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type LoadBalancerReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// NewLoadBalancerPoolIdentityByName : Instantiate LoadBalancerPoolIdentityByName (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolIdentityByName(name string) (_model *LoadBalancerPoolIdentityByName, err error) { - _model = &LoadBalancerPoolIdentityByName{ - Name: core.StringPtr(name), +// UnmarshalLoadBalancerReferenceDeleted unmarshals an instance of LoadBalancerReferenceDeleted from the specified map of raw messages. +func UnmarshalLoadBalancerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// UnmarshalLoadBalancerPoolIdentityByName unmarshals an instance of LoadBalancerPoolIdentityByName from the specified map of raw messages. -func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// LoadBalancerStatistics : LoadBalancerStatistics struct +type LoadBalancerStatistics struct { + // Number of active connections of this load balancer. + ActiveConnections *int64 `json:"active_connections" validate:"required"` + + // Current connection rate (connections per second) of this load balancer. + ConnectionRate *float32 `json:"connection_rate" validate:"required"` + + // Total number of data processed (bytes) of this load balancer within current calendar month. + DataProcessedThisMonth *int64 `json:"data_processed_this_month" validate:"required"` + + // Current throughput (Mbps) of this load balancer. + Throughput *float32 `json:"throughput" validate:"required"` +} + +// UnmarshalLoadBalancerStatistics unmarshals an instance of LoadBalancerStatistics from the specified map of raw messages. +func UnmarshalLoadBalancerStatistics(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerStatistics) + err = core.UnmarshalPrimitive(m, "active_connections", &obj.ActiveConnections) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "connection_rate", &obj.ConnectionRate) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "data_processed_this_month", &obj.DataProcessedThisMonth) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "throughput", &obj.Throughput) if err != nil { return } @@ -39677,65 +45877,44 @@ func UnmarshalLoadBalancerPoolIdentityByName(m map[string]json.RawMessage, resul return } -// LoadBalancerPoolMember : LoadBalancerPoolMember struct -type LoadBalancerPoolMember struct { - // The date and time that this member was created. +// NetworkACL : NetworkACL struct +type NetworkACL struct { + // The date and time that the network ACL was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Health of the server member in the pool. - Health *string `json:"health" validate:"required"` + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` - // The member's canonical URL. + // The URL for this network ACL. Href *string `json:"href" validate:"required"` - // The unique identifier for this load balancer pool member. + // The unique identifier for this network ACL. ID *string `json:"id" validate:"required"` - // The port the member will receive load balancer traffic on. - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - Port *int64 `json:"port" validate:"required"` - - // The provisioning status of this member. - ProvisioningStatus *string `json:"provisioning_status" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. - Target LoadBalancerPoolMemberTargetIntf `json:"target" validate:"required"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` -} - -// Constants associated with the LoadBalancerPoolMember.Health property. -// Health of the server member in the pool. -const ( - LoadBalancerPoolMemberHealthFaultedConst = "faulted" - LoadBalancerPoolMemberHealthOkConst = "ok" - LoadBalancerPoolMemberHealthUnknownConst = "unknown" -) + // The user-defined name for this network ACL. + Name *string `json:"name" validate:"required"` -// Constants associated with the LoadBalancerPoolMember.ProvisioningStatus property. -// The provisioning status of this member. -const ( - LoadBalancerPoolMemberProvisioningStatusActiveConst = "active" - LoadBalancerPoolMemberProvisioningStatusCreatePendingConst = "create_pending" - LoadBalancerPoolMemberProvisioningStatusDeletePendingConst = "delete_pending" - LoadBalancerPoolMemberProvisioningStatusFailedConst = "failed" - LoadBalancerPoolMemberProvisioningStatusMaintenancePendingConst = "maintenance_pending" - LoadBalancerPoolMemberProvisioningStatusUpdatePendingConst = "update_pending" -) + // The resource group for this network ACL. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// UnmarshalLoadBalancerPoolMember unmarshals an instance of LoadBalancerPoolMember from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMember) + // The ordered rules for this network ACL. If no rules exist, all traffic will be denied. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + + // The subnets to which this network ACL is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` + + // The VPC this network ACL is a part of. + VPC *VPCReference `json:"vpc" validate:"required"` +} + +// UnmarshalNetworkACL unmarshals an instance of NetworkACL from the specified map of raw messages. +func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACL) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "health", &obj.Health) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -39747,36 +45926,23 @@ func UnmarshalLoadBalancerPoolMember(m map[string]json.RawMessage, result interf if err != nil { return } - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "provisioning_status", &obj.ProvisioningStatus) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTarget) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) if err != nil { return } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolMemberCollection : LoadBalancerPoolMemberCollection struct -type LoadBalancerPoolMemberCollection struct { - // Collection of members. - Members []LoadBalancerPoolMember `json:"members" validate:"required"` -} - -// UnmarshalLoadBalancerPoolMemberCollection unmarshals an instance of LoadBalancerPoolMemberCollection from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberCollection) - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMember) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -39784,95 +45950,45 @@ func UnmarshalLoadBalancerPoolMemberCollection(m map[string]json.RawMessage, res return } -// LoadBalancerPoolMemberPatch : LoadBalancerPoolMemberPatch struct -type LoadBalancerPoolMemberPatch struct { - // The port the member will receive load balancer traffic on. - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port,omitempty"` +// NetworkACLCollection : NetworkACLCollection struct +type NetworkACLCollection struct { + // A link to the first page of resources. + First *NetworkACLCollectionFirst `json:"first" validate:"required"` - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` + // Collection of network ACLs. + NetworkAcls []NetworkACL `json:"network_acls" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *NetworkACLCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerPoolMemberPatch unmarshals an instance of LoadBalancerPoolMemberPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberPatch) - err = core.UnmarshalPrimitive(m, "port", &obj.Port) - if err != nil { - return - } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) +// UnmarshalNetworkACLCollection unmarshals an instance of NetworkACLCollection from the specified map of raw messages. +func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the LoadBalancerPoolMemberPatch -func (loadBalancerPoolMemberPatch *LoadBalancerPoolMemberPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPoolMemberPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// LoadBalancerPoolMemberPrototype : LoadBalancerPoolMemberPrototype struct -type LoadBalancerPoolMemberPrototype struct { - // The port the member will receive load balancer traffic on. - // - // This port will also be used for health checks unless the `port` property of - // `health_monitor` property is specified. - // - // The port must be unique across all members for all pools associated with this pool's listener. - Port *int64 `json:"port" validate:"required"` - - // The pool member target. Load balancers in the `network` family support virtual server - // instances. Load balancers in the `application` family support IP addresses. - Target LoadBalancerPoolMemberTargetPrototypeIntf `json:"target" validate:"required"` - - // Weight of the server member. Applicable only if the pool algorithm is - // `weighted_round_robin`. - Weight *int64 `json:"weight,omitempty"` -} - -// NewLoadBalancerPoolMemberPrototype : Instantiate LoadBalancerPoolMemberPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolMemberPrototype(port int64, target LoadBalancerPoolMemberTargetPrototypeIntf) (_model *LoadBalancerPoolMemberPrototype, err error) { - _model = &LoadBalancerPoolMemberPrototype{ - Port: core.Int64Ptr(port), - Target: target, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalLoadBalancerPoolMemberPrototype unmarshals an instance of LoadBalancerPoolMemberPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberPrototype) - err = core.UnmarshalPrimitive(m, "port", &obj.Port) + err = core.UnmarshalModel(m, "network_acls", &obj.NetworkAcls, UnmarshalNetworkACL) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalLoadBalancerPoolMemberTargetPrototype) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "weight", &obj.Weight) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -39880,49 +45996,45 @@ func UnmarshalLoadBalancerPoolMemberPrototype(m map[string]json.RawMessage, resu return } -// LoadBalancerPoolMemberReference : LoadBalancerPoolMemberReference struct -type LoadBalancerPoolMemberReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *LoadBalancerPoolMemberReferenceDeleted `json:"deleted,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *NetworkACLCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // The member's canonical URL. +// NetworkACLCollectionFirst : A link to the first page of resources. +type NetworkACLCollectionFirst struct { + // The URL for a page of resources. Href *string `json:"href" validate:"required"` - - // The unique identifier for this load balancer pool member. - ID *string `json:"id" validate:"required"` } -// UnmarshalLoadBalancerPoolMemberReference unmarshals an instance of LoadBalancerPoolMemberReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolMemberReferenceDeleted) - if err != nil { - return - } +// UnmarshalNetworkACLCollectionFirst unmarshals an instance of NetworkACLCollectionFirst from the specified map of raw messages. +func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerPoolMemberReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type LoadBalancerPoolMemberReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// NetworkACLCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type NetworkACLCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalLoadBalancerPoolMemberReferenceDeleted unmarshals an instance of LoadBalancerPoolMemberReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// UnmarshalNetworkACLCollectionNext unmarshals an instance of NetworkACLCollectionNext from the specified map of raw messages. +func UnmarshalNetworkACLCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -39930,52 +46042,38 @@ func UnmarshalLoadBalancerPoolMemberReferenceDeleted(m map[string]json.RawMessag return } -// LoadBalancerPoolMemberTarget : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in -// the `application` family support IP addresses. +// NetworkACLIdentity : Identifies a network ACL by a unique property. // Models which "extend" this model: -// - LoadBalancerPoolMemberTargetInstanceReference -// - LoadBalancerPoolMemberTargetIP -type LoadBalancerPoolMemberTarget struct { - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *InstanceReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` - - // The unique identifier for this virtual server instance. +// - NetworkACLIdentityByID +// - NetworkACLIdentityByCRN +// - NetworkACLIdentityByHref +type NetworkACLIdentity struct { + // The unique identifier for this network ACL. ID *string `json:"id,omitempty"` - // The user-defined name for this virtual server instance (and default system hostname). - Name *string `json:"name,omitempty"` + // The CRN for this network ACL. + CRN *string `json:"crn,omitempty"` - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` + // The URL for this network ACL. + Href *string `json:"href,omitempty"` } -func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { +func (*NetworkACLIdentity) isaNetworkACLIdentity() bool { return true } -type LoadBalancerPoolMemberTargetIntf interface { - isaLoadBalancerPoolMemberTarget() bool +type NetworkACLIdentityIntf interface { + isaNetworkACLIdentity() bool } -// UnmarshalLoadBalancerPoolMemberTarget unmarshals an instance of LoadBalancerPoolMemberTarget from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalNetworkACLIdentity unmarshals an instance of NetworkACLIdentity from the specified map of raw messages. +func UnmarshalNetworkACLIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalInstanceReferenceDeleted) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -39983,69 +46081,89 @@ func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLPatch : NetworkACLPatch struct +type NetworkACLPatch struct { + // The user-defined name for this network ACL. Names must be unique within the VPC the network ACL resides in. + Name *string `json:"name,omitempty"` +} + +// UnmarshalNetworkACLPatch unmarshals an instance of NetworkACLPatch from the specified map of raw messages. +func UnmarshalNetworkACLPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerPoolMemberTargetPrototype : The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in -// the `application` family support IP addresses. +// AsPatch returns a generic map representation of the NetworkACLPatch +func (networkACLPatch *NetworkACLPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(networkACLPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// NetworkACLPrototype : NetworkACLPrototype struct // Models which "extend" this model: -// - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity -// - LoadBalancerPoolMemberTargetPrototypeIP -type LoadBalancerPoolMemberTargetPrototype struct { - // The unique identifier for this virtual server instance. - ID *string `json:"id,omitempty"` +// - NetworkACLPrototypeNetworkACLByRules +// - NetworkACLPrototypeNetworkACLBySourceNetworkACL +type NetworkACLPrototype struct { + // The user-defined name for this network ACL. Names must be unique within the VPC the network ACL resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The CRN for this virtual server instance. - CRN *string `json:"crn,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The URL for this virtual server instance. - Href *string `json:"href,omitempty"` + // The VPC this network ACL is to be a part of. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` + // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, + // resulting in all traffic being denied. + Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` + + // Network ACL to copy rules from. + SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl,omitempty"` } -func (*LoadBalancerPoolMemberTargetPrototype) isaLoadBalancerPoolMemberTargetPrototype() bool { +func (*NetworkACLPrototype) isaNetworkACLPrototype() bool { return true } -type LoadBalancerPoolMemberTargetPrototypeIntf interface { - isaLoadBalancerPoolMemberTargetPrototype() bool +type NetworkACLPrototypeIntf interface { + isaNetworkACLPrototype() bool } -// UnmarshalLoadBalancerPoolMemberTargetPrototype unmarshals an instance of LoadBalancerPoolMemberTargetPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalNetworkACLPrototype unmarshals an instance of NetworkACLPrototype from the specified map of raw messages. +func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) if err != nil { return } @@ -40053,93 +46171,45 @@ func UnmarshalLoadBalancerPoolMemberTargetPrototype(m map[string]json.RawMessage return } -// LoadBalancerPoolPatch : LoadBalancerPoolPatch struct -type LoadBalancerPoolPatch struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm,omitempty"` - - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPatch `json:"health_monitor,omitempty"` +// NetworkACLReference : NetworkACLReference struct +type NetworkACLReference struct { + // The CRN for this network ACL. + CRN *string `json:"crn" validate:"required"` - // The user-defined name for this load balancer pool. - Name *string `json:"name,omitempty"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkACLReferenceDeleted `json:"deleted,omitempty"` - // The protocol used for this load balancer pool. - // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the - // unexpected property value was encountered. - Protocol *string `json:"protocol,omitempty"` + // The URL for this network ACL. + Href *string `json:"href" validate:"required"` - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` + // The unique identifier for this network ACL. + ID *string `json:"id" validate:"required"` - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePatch `json:"session_persistence,omitempty"` + // The user-defined name for this network ACL. + Name *string `json:"name" validate:"required"` } -// Constants associated with the LoadBalancerPoolPatch.Algorithm property. -// The load balancing algorithm. -const ( - LoadBalancerPoolPatchAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolPatchAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolPatchAlgorithmWeightedRoundRobinConst = "weighted_round_robin" -) - -// Constants associated with the LoadBalancerPoolPatch.Protocol property. -// The protocol used for this load balancer pool. -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the pool on which the -// unexpected property value was encountered. -const ( - LoadBalancerPoolPatchProtocolHTTPConst = "http" - LoadBalancerPoolPatchProtocolHTTPSConst = "https" - LoadBalancerPoolPatchProtocolTCPConst = "tcp" -) - -// Constants associated with the LoadBalancerPoolPatch.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). -const ( - LoadBalancerPoolPatchProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolPatchProxyProtocolV1Const = "v1" - LoadBalancerPoolPatchProxyProtocolV2Const = "v2" -) - -// UnmarshalLoadBalancerPoolPatch unmarshals an instance of LoadBalancerPoolPatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolPatch) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) - if err != nil { - return - } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPatch) +// UnmarshalNetworkACLReference unmarshals an instance of NetworkACLReference from the specified map of raw messages. +func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -40147,119 +46217,203 @@ func UnmarshalLoadBalancerPoolPatch(m map[string]json.RawMessage, result interfa return } -// AsPatch returns a generic map representation of the LoadBalancerPoolPatch -func (loadBalancerPoolPatch *LoadBalancerPoolPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(loadBalancerPoolPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// NetworkACLReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type NetworkACLReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalNetworkACLReferenceDeleted unmarshals an instance of NetworkACLReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerPoolPrototype : LoadBalancerPoolPrototype struct -type LoadBalancerPoolPrototype struct { - // The load balancing algorithm. - Algorithm *string `json:"algorithm" validate:"required"` +// NetworkACLRule : NetworkACLRule struct +// Models which "extend" this model: +// - NetworkACLRuleNetworkACLRuleProtocolTcpudp +// - NetworkACLRuleNetworkACLRuleProtocolIcmp +// - NetworkACLRuleNetworkACLRuleProtocolAll +type NetworkACLRule struct { + // Whether to allow or deny matching traffic. + Action *string `json:"action" validate:"required"` - // The health monitor of this pool. - HealthMonitor *LoadBalancerPoolHealthMonitorPrototype `json:"health_monitor" validate:"required"` + // The rule that this rule is immediately before. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` - // The members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` - // tuple cannot be shared by a pool member of any other load balancer in the same VPC. - Members []LoadBalancerPoolMemberPrototype `json:"members,omitempty"` + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The user-defined name for this load balancer pool. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` + // The destination CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Destination *string `json:"destination" validate:"required"` - // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers - // in the `application` family support `tcp`, `http`, and - // `https`. + // Whether the traffic to be matched is `inbound` or `outbound`. + Direction *string `json:"direction" validate:"required"` + + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` + + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` + + // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name" validate:"required"` + + // The protocol to enforce. Protocol *string `json:"protocol" validate:"required"` - // The PROXY protocol setting for this pool: - // - `v1`: Enabled with version 1 (human-readable header format) - // - `v2`: Enabled with version 2 (binary header format) - // - `disabled`: Disabled - // - // Supported by load balancers in the `application` family (otherwise always `disabled`). - ProxyProtocol *string `json:"proxy_protocol,omitempty"` + // The source CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Source *string `json:"source" validate:"required"` + + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` + + // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also + // specified. + Code *int64 `json:"code,omitempty"` - // The session persistence of this pool. - SessionPersistence *LoadBalancerPoolSessionPersistencePrototype `json:"session_persistence,omitempty"` + // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + Type *int64 `json:"type,omitempty"` } -// Constants associated with the LoadBalancerPoolPrototype.Algorithm property. -// The load balancing algorithm. +// Constants associated with the NetworkACLRule.Action property. +// Whether to allow or deny matching traffic. const ( - LoadBalancerPoolPrototypeAlgorithmLeastConnectionsConst = "least_connections" - LoadBalancerPoolPrototypeAlgorithmRoundRobinConst = "round_robin" - LoadBalancerPoolPrototypeAlgorithmWeightedRoundRobinConst = "weighted_round_robin" + NetworkACLRuleActionAllowConst = "allow" + NetworkACLRuleActionDenyConst = "deny" ) -// Constants associated with the LoadBalancerPoolPrototype.Protocol property. -// The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers -// in the `application` family support `tcp`, `http`, and -// `https`. +// Constants associated with the NetworkACLRule.Direction property. +// Whether the traffic to be matched is `inbound` or `outbound`. const ( - LoadBalancerPoolPrototypeProtocolHTTPConst = "http" - LoadBalancerPoolPrototypeProtocolHTTPSConst = "https" - LoadBalancerPoolPrototypeProtocolTCPConst = "tcp" + NetworkACLRuleDirectionInboundConst = "inbound" + NetworkACLRuleDirectionOutboundConst = "outbound" ) -// Constants associated with the LoadBalancerPoolPrototype.ProxyProtocol property. -// The PROXY protocol setting for this pool: -// - `v1`: Enabled with version 1 (human-readable header format) -// - `v2`: Enabled with version 2 (binary header format) -// - `disabled`: Disabled -// -// Supported by load balancers in the `application` family (otherwise always `disabled`). +// Constants associated with the NetworkACLRule.IPVersion property. +// The IP version for this rule. const ( - LoadBalancerPoolPrototypeProxyProtocolDisabledConst = "disabled" - LoadBalancerPoolPrototypeProxyProtocolV1Const = "v1" - LoadBalancerPoolPrototypeProxyProtocolV2Const = "v2" + NetworkACLRuleIPVersionIpv4Const = "ipv4" + NetworkACLRuleIPVersionIpv6Const = "ipv6" ) -// NewLoadBalancerPoolPrototype : Instantiate LoadBalancerPoolPrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolPrototype(algorithm string, healthMonitor *LoadBalancerPoolHealthMonitorPrototype, protocol string) (_model *LoadBalancerPoolPrototype, err error) { - _model = &LoadBalancerPoolPrototype{ - Algorithm: core.StringPtr(algorithm), - HealthMonitor: healthMonitor, - Protocol: core.StringPtr(protocol), - } - err = core.ValidateStruct(_model, "required parameters") - return +func (*NetworkACLRule) isaNetworkACLRule() bool { + return true } -// UnmarshalLoadBalancerPoolPrototype unmarshals an instance of LoadBalancerPoolPrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolPrototype) - err = core.UnmarshalPrimitive(m, "algorithm", &obj.Algorithm) +type NetworkACLRuleIntf interface { + isaNetworkACLRule() bool +} + +// UnmarshalNetworkACLRule unmarshals an instance of NetworkACLRule from the specified map of raw messages. +func UnmarshalNetworkACLRule(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalModel(m, "health_monitor", &obj.HealthMonitor, UnmarshalLoadBalancerPoolHealthMonitorPrototype) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalLoadBalancerPoolMemberPrototype) - if err != nil { - return + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + return +} + +// NetworkACLRuleBeforePatch : The rule to move this rule immediately before. Specify `null` to move this rule after all existing rules. +// Models which "extend" this model: +// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID +// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref +type NetworkACLRuleBeforePatch struct { + // The unique identifier for this network ACL rule. + ID *string `json:"id,omitempty"` + + // The URL for this network ACL rule. + Href *string `json:"href,omitempty"` +} + +func (*NetworkACLRuleBeforePatch) isaNetworkACLRuleBeforePatch() bool { + return true +} + +type NetworkACLRuleBeforePatchIntf interface { + isaNetworkACLRuleBeforePatch() bool +} + +// UnmarshalNetworkACLRuleBeforePatch unmarshals an instance of NetworkACLRuleBeforePatch from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "proxy_protocol", &obj.ProxyProtocol) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. If omitted, this rule will be inserted after all existing rules. +// Models which "extend" this model: +// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID +// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref +type NetworkACLRuleBeforePrototype struct { + // The unique identifier for this network ACL rule. + ID *string `json:"id,omitempty"` + + // The URL for this network ACL rule. + Href *string `json:"href,omitempty"` +} + +func (*NetworkACLRuleBeforePrototype) isaNetworkACLRuleBeforePrototype() bool { + return true +} + +type NetworkACLRuleBeforePrototypeIntf interface { + isaNetworkACLRuleBeforePrototype() bool +} + +// UnmarshalNetworkACLRuleBeforePrototype unmarshals an instance of NetworkACLRuleBeforePrototype from the specified map of raw messages. +func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleBeforePrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "session_persistence", &obj.SessionPersistence, UnmarshalLoadBalancerPoolSessionPersistencePrototype) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -40267,56 +46421,45 @@ func UnmarshalLoadBalancerPoolPrototype(m map[string]json.RawMessage, result int return } -// LoadBalancerPoolReference : LoadBalancerPoolReference struct -type LoadBalancerPoolReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *LoadBalancerPoolReferenceDeleted `json:"deleted,omitempty"` +// NetworkACLRuleCollection : NetworkACLRuleCollection struct +type NetworkACLRuleCollection struct { + // A link to the first page of resources. + First *NetworkACLRuleCollectionFirst `json:"first" validate:"required"` - // The pool's canonical URL. - Href *string `json:"href" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The unique identifier for this load balancer pool. - ID *string `json:"id" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *NetworkACLRuleCollectionNext `json:"next,omitempty"` - // The user-defined name for this load balancer pool. - Name *string `json:"name" validate:"required"` + // Ordered collection of network ACL rules. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalLoadBalancerPoolReference unmarshals an instance of LoadBalancerPoolReference from the specified map of raw messages. -func UnmarshalLoadBalancerPoolReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalLoadBalancerPoolReferenceDeleted) +// UnmarshalNetworkACLRuleCollection unmarshals an instance of NetworkACLRuleCollection from the specified map of raw messages. +func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLRuleCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLRuleCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerPoolReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type LoadBalancerPoolReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalLoadBalancerPoolReferenceDeleted unmarshals an instance of LoadBalancerPoolReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerPoolReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -40324,34 +46467,28 @@ func UnmarshalLoadBalancerPoolReferenceDeleted(m map[string]json.RawMessage, res return } -// LoadBalancerPoolSessionPersistence : LoadBalancerPoolSessionPersistence struct -type LoadBalancerPoolSessionPersistence struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type" validate:"required"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// Constants associated with the LoadBalancerPoolSessionPersistence.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistenceTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistenceTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistenceTypeSourceIPConst = "source_ip" -) +// NetworkACLRuleCollectionFirst : A link to the first page of resources. +type NetworkACLRuleCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} -// UnmarshalLoadBalancerPoolSessionPersistence unmarshals an instance of LoadBalancerPoolSessionPersistence from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistence(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistence) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLRuleCollectionFirst unmarshals an instance of NetworkACLRuleCollectionFirst from the specified map of raw messages. +func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -40359,34 +46496,16 @@ func UnmarshalLoadBalancerPoolSessionPersistence(m map[string]json.RawMessage, r return } -// LoadBalancerPoolSessionPersistencePatch : The session persistence configuration. Specify `null` to remove any existing session persistence configuration. -type LoadBalancerPoolSessionPersistencePatch struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` - - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type,omitempty"` +// NetworkACLRuleCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type NetworkACLRuleCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// Constants associated with the LoadBalancerPoolSessionPersistencePatch.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. -const ( - LoadBalancerPoolSessionPersistencePatchTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistencePatchTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistencePatchTypeSourceIPConst = "source_ip" -) - -// UnmarshalLoadBalancerPoolSessionPersistencePatch unmarshals an instance of LoadBalancerPoolSessionPersistencePatch from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistencePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistencePatch) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLRuleCollectionNext unmarshals an instance of NetworkACLRuleCollectionNext from the specified map of raw messages. +func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -40394,139 +46513,225 @@ func UnmarshalLoadBalancerPoolSessionPersistencePatch(m map[string]json.RawMessa return } -// LoadBalancerPoolSessionPersistencePrototype : LoadBalancerPoolSessionPersistencePrototype struct -type LoadBalancerPoolSessionPersistencePrototype struct { - // The session persistence cookie name. Applicable only for type `app_cookie`. Names starting with `IBM` are not - // allowed. - CookieName *string `json:"cookie_name,omitempty"` +// NetworkACLRuleItem : NetworkACLRuleItem struct +// Models which "extend" this model: +// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp +// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp +// - NetworkACLRuleItemNetworkACLRuleProtocolAll +type NetworkACLRuleItem struct { + // Whether to allow or deny matching traffic. + Action *string `json:"action" validate:"required"` - // The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` - // protocols. - Type *string `json:"type" validate:"required"` + // The rule that this rule is immediately before. In a rule collection, this always + // refers to the next item in the collection. If absent, this is the last rule. + Before *NetworkACLRuleReference `json:"before,omitempty"` + + // The date and time that the rule was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The destination CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Destination *string `json:"destination" validate:"required"` + + // Whether the traffic to be matched is `inbound` or `outbound`. + Direction *string `json:"direction" validate:"required"` + + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` + + // The IP version for this rule. + IPVersion *string `json:"ip_version" validate:"required"` + + // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The source CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Source *string `json:"source" validate:"required"` + + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` + + // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also + // specified. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + Type *int64 `json:"type,omitempty"` } -// Constants associated with the LoadBalancerPoolSessionPersistencePrototype.Type property. -// The session persistence type. The `http_cookie` and `app_cookie` types are applicable only to the `http` and `https` -// protocols. +// Constants associated with the NetworkACLRuleItem.Action property. +// Whether to allow or deny matching traffic. const ( - LoadBalancerPoolSessionPersistencePrototypeTypeAppCookieConst = "app_cookie" - LoadBalancerPoolSessionPersistencePrototypeTypeHTTPCookieConst = "http_cookie" - LoadBalancerPoolSessionPersistencePrototypeTypeSourceIPConst = "source_ip" + NetworkACLRuleItemActionAllowConst = "allow" + NetworkACLRuleItemActionDenyConst = "deny" ) -// NewLoadBalancerPoolSessionPersistencePrototype : Instantiate LoadBalancerPoolSessionPersistencePrototype (Generic Model Constructor) -func (*VpcV1) NewLoadBalancerPoolSessionPersistencePrototype(typeVar string) (_model *LoadBalancerPoolSessionPersistencePrototype, err error) { - _model = &LoadBalancerPoolSessionPersistencePrototype{ - Type: core.StringPtr(typeVar), - } - err = core.ValidateStruct(_model, "required parameters") - return +// Constants associated with the NetworkACLRuleItem.Direction property. +// Whether the traffic to be matched is `inbound` or `outbound`. +const ( + NetworkACLRuleItemDirectionInboundConst = "inbound" + NetworkACLRuleItemDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleItem.IPVersion property. +// The IP version for this rule. +const ( + NetworkACLRuleItemIPVersionIpv4Const = "ipv4" + NetworkACLRuleItemIPVersionIpv6Const = "ipv6" +) + +func (*NetworkACLRuleItem) isaNetworkACLRuleItem() bool { + return true } -// UnmarshalLoadBalancerPoolSessionPersistencePrototype unmarshals an instance of LoadBalancerPoolSessionPersistencePrototype from the specified map of raw messages. -func UnmarshalLoadBalancerPoolSessionPersistencePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolSessionPersistencePrototype) - err = core.UnmarshalPrimitive(m, "cookie_name", &obj.CookieName) +type NetworkACLRuleItemIntf interface { + isaNetworkACLRuleItem() bool +} + +// UnmarshalNetworkACLRuleItem unmarshals an instance of NetworkACLRuleItem from the specified map of raw messages. +func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } return } -// LoadBalancerProfile : LoadBalancerProfile struct -type LoadBalancerProfile struct { - // The product family this load balancer profile belongs to. - Family *string `json:"family" validate:"required"` +// NetworkACLRulePatch : NetworkACLRulePatch struct +type NetworkACLRulePatch struct { + // Whether to allow or deny matching traffic. + Action *string `json:"action,omitempty"` - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` + // The rule to move this rule immediately before. Specify `null` to move this rule after + // all existing rules. + Before NetworkACLRuleBeforePatchIntf `json:"before,omitempty"` - // Indicates which logging type(s) are supported for a load balancer with this profile. - LoggingSupported *LoadBalancerProfileLoggingSupported `json:"logging_supported" validate:"required"` + // The ICMP traffic code to allow. + Code *int64 `json:"code,omitempty"` - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` + // The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Destination *string `json:"destination,omitempty"` - RouteModeSupported LoadBalancerProfileRouteModeSupportedIntf `json:"route_mode_supported" validate:"required"` + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - SecurityGroupsSupported LoadBalancerProfileSecurityGroupsSupportedIntf `json:"security_groups_supported" validate:"required"` + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + + // Whether the traffic to be matched is `inbound` or `outbound`. + Direction *string `json:"direction,omitempty"` + + // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. + Name *string `json:"name,omitempty"` + + // The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Source *string `json:"source,omitempty"` + + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` + + // The ICMP traffic type to allow. + Type *int64 `json:"type,omitempty"` } -// UnmarshalLoadBalancerProfile unmarshals an instance of LoadBalancerProfile from the specified map of raw messages. -func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfile) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) +// Constants associated with the NetworkACLRulePatch.Action property. +// Whether to allow or deny matching traffic. +const ( + NetworkACLRulePatchActionAllowConst = "allow" + NetworkACLRulePatchActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRulePatch.Direction property. +// Whether the traffic to be matched is `inbound` or `outbound`. +const ( + NetworkACLRulePatchDirectionInboundConst = "inbound" + NetworkACLRulePatchDirectionOutboundConst = "outbound" +) + +// UnmarshalNetworkACLRulePatch unmarshals an instance of NetworkACLRulePatch from the specified map of raw messages. +func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePatch) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePatch) if err != nil { return } - err = core.UnmarshalModel(m, "logging_supported", &obj.LoggingSupported, UnmarshalLoadBalancerProfileLoggingSupported) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) if err != nil { return } - err = core.UnmarshalModel(m, "route_mode_supported", &obj.RouteModeSupported, UnmarshalLoadBalancerProfileRouteModeSupported) + err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups_supported", &obj.SecurityGroupsSupported, UnmarshalLoadBalancerProfileSecurityGroupsSupported) + err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileCollection : LoadBalancerProfileCollection struct -type LoadBalancerProfileCollection struct { - // A link to the first page of resources. - First *LoadBalancerProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *LoadBalancerProfileCollectionNext `json:"next,omitempty"` - - // Collection of load balancer profiles. - Profiles []LoadBalancerProfile `json:"profiles" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalLoadBalancerProfileCollection unmarshals an instance of LoadBalancerProfileCollection from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalLoadBalancerProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "source", &obj.Source) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalLoadBalancerProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) if err != nil { return } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalLoadBalancerProfile) + err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -40534,223 +46739,240 @@ func UnmarshalLoadBalancerProfileCollection(m map[string]json.RawMessage, result return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *LoadBalancerProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// AsPatch returns a generic map representation of the NetworkACLRulePatch +func (networkACLRulePatch *NetworkACLRulePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(networkACLRulePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } - return start, nil + return } -// LoadBalancerProfileCollectionFirst : A link to the first page of resources. -type LoadBalancerProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} +// NetworkACLRulePrototype : NetworkACLRulePrototype struct +// Models which "extend" this model: +// - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudp +// - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmp +// - NetworkACLRulePrototypeNetworkACLRuleProtocolAll +type NetworkACLRulePrototype struct { + // Whether to allow or deny matching traffic. + Action *string `json:"action" validate:"required"` -// UnmarshalLoadBalancerProfileCollectionFirst unmarshals an instance of LoadBalancerProfileCollectionFirst from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The rule to insert this rule immediately before. If omitted, this rule will be + // inserted after all existing rules. + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` -// LoadBalancerProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type LoadBalancerProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} + // The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Destination *string `json:"destination" validate:"required"` -// UnmarshalLoadBalancerProfileCollectionNext unmarshals an instance of LoadBalancerProfileCollectionNext from the specified map of raw messages. -func UnmarshalLoadBalancerProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // Whether the traffic to be matched is `inbound` or `outbound`. + Direction *string `json:"direction" validate:"required"` -// LoadBalancerProfileIdentity : Identifies a load balancer profile by a unique property. -// Models which "extend" this model: -// - LoadBalancerProfileIdentityByName -// - LoadBalancerProfileIdentityByHref -type LoadBalancerProfileIdentity struct { - // The globally unique name for this load balancer profile. + // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The URL for this load balancer profile. - Href *string `json:"href,omitempty"` -} + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` -func (*LoadBalancerProfileIdentity) isaLoadBalancerProfileIdentity() bool { - return true -} + // The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Source *string `json:"source" validate:"required"` -type LoadBalancerProfileIdentityIntf interface { - isaLoadBalancerProfileIdentity() bool -} + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` -// UnmarshalLoadBalancerProfileIdentity unmarshals an instance of LoadBalancerProfileIdentity from the specified map of raw messages. -func UnmarshalLoadBalancerProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` -// LoadBalancerProfileLoggingSupported : Indicates which logging type(s) are supported for a load balancer with this profile. -type LoadBalancerProfileLoggingSupported struct { - // The type for this profile field. - Type *string `json:"type" validate:"required"` + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` - // The supported logging type(s) for a load balancer with this profile. - Value []string `json:"value" validate:"required"` + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` + + // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also + // specified. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + Type *int64 `json:"type,omitempty"` } -// Constants associated with the LoadBalancerProfileLoggingSupported.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRulePrototype.Action property. +// Whether to allow or deny matching traffic. const ( - LoadBalancerProfileLoggingSupportedTypeFixedConst = "fixed" + NetworkACLRulePrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeActionDenyConst = "deny" ) -// UnmarshalLoadBalancerProfileLoggingSupported unmarshals an instance of LoadBalancerProfileLoggingSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileLoggingSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileLoggingSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// LoadBalancerProfileReference : LoadBalancerProfileReference struct -type LoadBalancerProfileReference struct { - // The product family this load balancer profile belongs to. - Family *string `json:"family" validate:"required"` +// Constants associated with the NetworkACLRulePrototype.Direction property. +// Whether the traffic to be matched is `inbound` or `outbound`. +const ( + NetworkACLRulePrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeDirectionOutboundConst = "outbound" +) - // The URL for this load balancer profile. - Href *string `json:"href" validate:"required"` +func (*NetworkACLRulePrototype) isaNetworkACLRulePrototype() bool { + return true +} - // The globally unique name for this load balancer profile. - Name *string `json:"name" validate:"required"` +type NetworkACLRulePrototypeIntf interface { + isaNetworkACLRulePrototype() bool } -// UnmarshalLoadBalancerProfileReference unmarshals an instance of LoadBalancerProfileReference from the specified map of raw messages. -func UnmarshalLoadBalancerProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileReference) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) +// UnmarshalNetworkACLRulePrototype unmarshals an instance of NetworkACLRulePrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LoadBalancerProfileRouteModeSupported : LoadBalancerProfileRouteModeSupported struct +// NetworkACLRulePrototypeNetworkACLContext : NetworkACLRulePrototypeNetworkACLContext struct // Models which "extend" this model: -// - LoadBalancerProfileRouteModeSupportedFixed -// - LoadBalancerProfileRouteModeSupportedDependent -type LoadBalancerProfileRouteModeSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudp +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmp +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll +type NetworkACLRulePrototypeNetworkACLContext struct { + // Whether to allow or deny matching traffic. + Action *string `json:"action" validate:"required"` - // The value for this profile field. - Value *bool `json:"value,omitempty"` + // The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Destination *string `json:"destination" validate:"required"` + + // Whether the traffic to be matched is `inbound` or `outbound`. + Direction *string `json:"direction" validate:"required"` + + // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. + Source *string `json:"source" validate:"required"` + + // The inclusive upper bound of TCP/UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + + // The inclusive upper bound of TCP/UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` + + // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also + // specified. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. + Type *int64 `json:"type,omitempty"` } -// Constants associated with the LoadBalancerProfileRouteModeSupported.Type property. -// The type for this profile field. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Action property. +// Whether to allow or deny matching traffic. const ( - LoadBalancerProfileRouteModeSupportedTypeFixedConst = "fixed" + NetworkACLRulePrototypeNetworkACLContextActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextActionDenyConst = "deny" ) -func (*LoadBalancerProfileRouteModeSupported) isaLoadBalancerProfileRouteModeSupported() bool { +// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Direction property. +// Whether the traffic to be matched is `inbound` or `outbound`. +const ( + NetworkACLRulePrototypeNetworkACLContextDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextDirectionOutboundConst = "outbound" +) + +func (*NetworkACLRulePrototypeNetworkACLContext) isaNetworkACLRulePrototypeNetworkACLContext() bool { return true } -type LoadBalancerProfileRouteModeSupportedIntf interface { - isaLoadBalancerProfileRouteModeSupported() bool +type NetworkACLRulePrototypeNetworkACLContextIntf interface { + isaNetworkACLRulePrototypeNetworkACLContext() bool } -// UnmarshalLoadBalancerProfileRouteModeSupported unmarshals an instance of LoadBalancerProfileRouteModeSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileRouteModeSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileRouteModeSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLRulePrototypeNetworkACLContext unmarshals an instance of NetworkACLRulePrototypeNetworkACLContext from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContext(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } return } -// LoadBalancerProfileSecurityGroupsSupported : LoadBalancerProfileSecurityGroupsSupported struct -// Models which "extend" this model: -// - LoadBalancerProfileSecurityGroupsSupportedFixed -// - LoadBalancerProfileSecurityGroupsSupportedDependent -type LoadBalancerProfileSecurityGroupsSupported struct { - // The type for this profile field. - Type *string `json:"type,omitempty"` - - // The value for this profile field. - Value *bool `json:"value,omitempty"` -} +// NetworkACLRuleReference : NetworkACLRuleReference struct +type NetworkACLRuleReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkACLRuleReferenceDeleted `json:"deleted,omitempty"` -// Constants associated with the LoadBalancerProfileSecurityGroupsSupported.Type property. -// The type for this profile field. -const ( - LoadBalancerProfileSecurityGroupsSupportedTypeFixedConst = "fixed" -) + // The URL for this network ACL rule. + Href *string `json:"href" validate:"required"` -func (*LoadBalancerProfileSecurityGroupsSupported) isaLoadBalancerProfileSecurityGroupsSupported() bool { - return true -} + // The unique identifier for this network ACL rule. + ID *string `json:"id" validate:"required"` -type LoadBalancerProfileSecurityGroupsSupportedIntf interface { - isaLoadBalancerProfileSecurityGroupsSupported() bool + // The user-defined name for this network ACL rule. + Name *string `json:"name" validate:"required"` } -// UnmarshalLoadBalancerProfileSecurityGroupsSupported unmarshals an instance of LoadBalancerProfileSecurityGroupsSupported from the specified map of raw messages. -func UnmarshalLoadBalancerProfileSecurityGroupsSupported(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerProfileSecurityGroupsSupported) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalNetworkACLRuleReference unmarshals an instance of NetworkACLRuleReference from the specified map of raw messages. +func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLRuleReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -40758,16 +46980,16 @@ func UnmarshalLoadBalancerProfileSecurityGroupsSupported(m map[string]json.RawMe return } -// LoadBalancerReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// NetworkACLRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type LoadBalancerReferenceDeleted struct { +type NetworkACLRuleReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalLoadBalancerReferenceDeleted unmarshals an instance of LoadBalancerReferenceDeleted from the specified map of raw messages. -func UnmarshalLoadBalancerReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerReferenceDeleted) +// UnmarshalNetworkACLRuleReferenceDeleted unmarshals an instance of NetworkACLRuleReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -40776,37 +46998,125 @@ func UnmarshalLoadBalancerReferenceDeleted(m map[string]json.RawMessage, result return } -// LoadBalancerStatistics : LoadBalancerStatistics struct -type LoadBalancerStatistics struct { - // Number of active connections of this load balancer. - ActiveConnections *int64 `json:"active_connections" validate:"required"` +// NetworkInterface : NetworkInterface struct +type NetworkInterface struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // Current connection rate (connections per second) of this load balancer. - ConnectionRate *float32 `json:"connection_rate" validate:"required"` + // The date and time that the network interface was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // Total number of data processed (bytes) of this load balancer within current calendar month. - DataProcessedThisMonth *int64 `json:"data_processed_this_month" validate:"required"` + // The floating IPs associated with this network interface. + FloatingIps []FloatingIPReference `json:"floating_ips,omitempty"` - // Current throughput (Mbps) of this load balancer. - Throughput *float32 `json:"throughput" validate:"required"` + // The URL for this network interface. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network interface. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this network interface. + Name *string `json:"name" validate:"required"` + + // The network interface port speed in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` + + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The security groups targeting this network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` + + // The status of the network interface. + Status *string `json:"status" validate:"required"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The type of this network interface as it relates to an instance. + Type *string `json:"type" validate:"required"` } -// UnmarshalLoadBalancerStatistics unmarshals an instance of LoadBalancerStatistics from the specified map of raw messages. -func UnmarshalLoadBalancerStatistics(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerStatistics) - err = core.UnmarshalPrimitive(m, "active_connections", &obj.ActiveConnections) +// Constants associated with the NetworkInterface.ResourceType property. +// The resource type. +const ( + NetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" +) + +// Constants associated with the NetworkInterface.Status property. +// The status of the network interface. +const ( + NetworkInterfaceStatusAvailableConst = "available" + NetworkInterfaceStatusDeletingConst = "deleting" + NetworkInterfaceStatusFailedConst = "failed" + NetworkInterfaceStatusPendingConst = "pending" +) + +// Constants associated with the NetworkInterface.Type property. +// The type of this network interface as it relates to an instance. +const ( + NetworkInterfaceTypePrimaryConst = "primary" + NetworkInterfaceTypeSecondaryConst = "secondary" +) + +// UnmarshalNetworkInterface unmarshals an instance of NetworkInterface from the specified map of raw messages. +func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterface) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalPrimitive(m, "connection_rate", &obj.ConnectionRate) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "data_processed_this_month", &obj.DataProcessedThisMonth) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "throughput", &obj.Throughput) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -40814,44 +47124,43 @@ func UnmarshalLoadBalancerStatistics(m map[string]json.RawMessage, result interf return } -// NetworkACL : NetworkACL struct -type NetworkACL struct { - // The date and time that the network ACL was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` +// NetworkInterfaceBareMetalServerContextReference : NetworkInterfaceBareMetalServerContextReference struct +type NetworkInterfaceBareMetalServerContextReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkInterfaceBareMetalServerContextReferenceDeleted `json:"deleted,omitempty"` - // The URL for this network ACL. + // The URL for this network interface. Href *string `json:"href" validate:"required"` - // The unique identifier for this network ACL. + // The unique identifier for this network interface. ID *string `json:"id" validate:"required"` - // The user-defined name for this network ACL. + // The user-defined name for this network interface. Name *string `json:"name" validate:"required"` - // The resource group for this network ACL. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The ordered rules for this network ACL. If no rules exist, all traffic will be denied. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The subnets to which this network ACL is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` - // The VPC this network ACL is a part of. - VPC *VPCReference `json:"vpc" validate:"required"` -} + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` -// UnmarshalNetworkACL unmarshals an instance of NetworkACL from the specified map of raw messages. -func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACL) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` +} + +// Constants associated with the NetworkInterfaceBareMetalServerContextReference.ResourceType property. +// The resource type. +const ( + NetworkInterfaceBareMetalServerContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +// UnmarshalNetworkInterfaceBareMetalServerContextReference unmarshals an instance of NetworkInterfaceBareMetalServerContextReference from the specified map of raw messages. +func UnmarshalNetworkInterfaceBareMetalServerContextReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceBareMetalServerContextReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted) if err != nil { return } @@ -40867,19 +47176,33 @@ func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkInterfaceBareMetalServerContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type NetworkInterfaceBareMetalServerContextReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted unmarshals an instance of NetworkInterfaceBareMetalServerContextReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceBareMetalServerContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceBareMetalServerContextReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -40887,29 +47210,29 @@ func UnmarshalNetworkACL(m map[string]json.RawMessage, result interface{}) (err return } -// NetworkACLCollection : NetworkACLCollection struct -type NetworkACLCollection struct { +// NetworkInterfaceCollection : NetworkInterfaceCollection struct +type NetworkInterfaceCollection struct { // A link to the first page of resources. - First *NetworkACLCollectionFirst `json:"first" validate:"required"` + First *NetworkInterfaceCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` - // Collection of network ACLs. - NetworkAcls []NetworkACL `json:"network_acls" validate:"required"` + // Collection of network interfaces. + NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *NetworkACLCollectionNext `json:"next,omitempty"` + Next *NetworkInterfaceCollectionNext `json:"next,omitempty"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalNetworkACLCollection unmarshals an instance of NetworkACLCollection from the specified map of raw messages. -func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLCollectionFirst) +// UnmarshalNetworkInterfaceCollection unmarshals an instance of NetworkInterfaceCollection from the specified map of raw messages. +func UnmarshalNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkInterfaceCollectionFirst) if err != nil { return } @@ -40917,11 +47240,11 @@ func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "network_acls", &obj.NetworkAcls, UnmarshalNetworkACL) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkInterfaceCollectionNext) if err != nil { return } @@ -40934,7 +47257,7 @@ func UnmarshalNetworkACLCollection(m map[string]json.RawMessage, result interfac } // Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkACLCollection) GetNextStart() (*string, error) { +func (resp *NetworkInterfaceCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -40945,15 +47268,15 @@ func (resp *NetworkACLCollection) GetNextStart() (*string, error) { return start, nil } -// NetworkACLCollectionFirst : A link to the first page of resources. -type NetworkACLCollectionFirst struct { +// NetworkInterfaceCollectionFirst : A link to the first page of resources. +type NetworkInterfaceCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLCollectionFirst unmarshals an instance of NetworkACLCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollectionFirst) +// UnmarshalNetworkInterfaceCollectionFirst unmarshals an instance of NetworkInterfaceCollectionFirst from the specified map of raw messages. +func UnmarshalNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -40962,15 +47285,15 @@ func UnmarshalNetworkACLCollectionFirst(m map[string]json.RawMessage, result int return } -// NetworkACLCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkACLCollectionNext struct { +// NetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type NetworkInterfaceCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLCollectionNext unmarshals an instance of NetworkACLCollectionNext from the specified map of raw messages. -func UnmarshalNetworkACLCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLCollectionNext) +// UnmarshalNetworkInterfaceCollectionNext unmarshals an instance of NetworkInterfaceCollectionNext from the specified map of raw messages. +func UnmarshalNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -40979,42 +47302,67 @@ func UnmarshalNetworkACLCollectionNext(m map[string]json.RawMessage, result inte return } -// NetworkACLIdentity : Identifies a network ACL by a unique property. -// Models which "extend" this model: -// - NetworkACLIdentityByID -// - NetworkACLIdentityByCRN -// - NetworkACLIdentityByHref -type NetworkACLIdentity struct { - // The unique identifier for this network ACL. - ID *string `json:"id,omitempty"` +// NetworkInterfaceInstanceContextReference : NetworkInterfaceInstanceContextReference struct +type NetworkInterfaceInstanceContextReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkInterfaceInstanceContextReferenceDeleted `json:"deleted,omitempty"` - // The CRN for this network ACL. - CRN *string `json:"crn,omitempty"` + // The URL for this network interface. + Href *string `json:"href" validate:"required"` - // The URL for this network ACL. - Href *string `json:"href,omitempty"` -} + // The unique identifier for this network interface. + ID *string `json:"id" validate:"required"` -func (*NetworkACLIdentity) isaNetworkACLIdentity() bool { - return true -} + // The user-defined name for this network interface. + Name *string `json:"name" validate:"required"` -type NetworkACLIdentityIntf interface { - isaNetworkACLIdentity() bool + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` } -// UnmarshalNetworkACLIdentity unmarshals an instance of NetworkACLIdentity from the specified map of raw messages. -func UnmarshalNetworkACLIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLIdentity) +// Constants associated with the NetworkInterfaceInstanceContextReference.ResourceType property. +// The resource type. +const ( + NetworkInterfaceInstanceContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +// UnmarshalNetworkInterfaceInstanceContextReference unmarshals an instance of NetworkInterfaceInstanceContextReference from the specified map of raw messages. +func UnmarshalNetworkInterfaceInstanceContextReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceInstanceContextReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceInstanceContextReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } @@ -41022,15 +47370,42 @@ func UnmarshalNetworkACLIdentity(m map[string]json.RawMessage, result interface{ return } -// NetworkACLPatch : NetworkACLPatch struct -type NetworkACLPatch struct { - // The user-defined name for this network ACL. Names must be unique within the VPC the network ACL resides in. +// NetworkInterfaceInstanceContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type NetworkInterfaceInstanceContextReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalNetworkInterfaceInstanceContextReferenceDeleted unmarshals an instance of NetworkInterfaceInstanceContextReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceInstanceContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceInstanceContextReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkInterfacePatch : NetworkInterfacePatch struct +type NetworkInterfacePatch struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. Name *string `json:"name,omitempty"` } -// UnmarshalNetworkACLPatch unmarshals an instance of NetworkACLPatch from the specified map of raw messages. -func UnmarshalNetworkACLPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPatch) +// UnmarshalNetworkInterfacePatch unmarshals an instance of NetworkInterfacePatch from the specified map of raw messages. +func UnmarshalNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfacePatch) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -41039,68 +47414,66 @@ func UnmarshalNetworkACLPatch(m map[string]json.RawMessage, result interface{}) return } -// AsPatch returns a generic map representation of the NetworkACLPatch -func (networkACLPatch *NetworkACLPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the NetworkInterfacePatch +func (networkInterfacePatch *NetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(networkACLPatch) + jsonData, err = json.Marshal(networkInterfacePatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// NetworkACLPrototype : NetworkACLPrototype struct -// Models which "extend" this model: -// - NetworkACLPrototypeNetworkACLByRules -// - NetworkACLPrototypeNetworkACLBySourceNetworkACL -type NetworkACLPrototype struct { - // The user-defined name for this network ACL. Names must be unique within the VPC the network ACL resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// NetworkInterfacePrototype : NetworkInterfacePrototype struct +type NetworkInterfacePrototype struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The VPC this network ACL is to be a part of. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, - // resulting in all traffic being denied. - Rules []NetworkACLRulePrototypeNetworkACLContextIntf `json:"rules,omitempty"` + // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If + // unspecified, an available address on the subnet will be automatically selected. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` - // Network ACL to copy rules from. - SourceNetworkACL NetworkACLIdentityIntf `json:"source_network_acl,omitempty"` -} + // The security groups to use for this network interface. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` -func (*NetworkACLPrototype) isaNetworkACLPrototype() bool { - return true + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` } -type NetworkACLPrototypeIntf interface { - isaNetworkACLPrototype() bool +// NewNetworkInterfacePrototype : Instantiate NetworkInterfacePrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *NetworkInterfacePrototype, err error) { + _model = &NetworkInterfacePrototype{ + Subnet: subnet, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalNetworkACLPrototype unmarshals an instance of NetworkACLPrototype from the specified map of raw messages. -func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLPrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalNetworkInterfacePrototype unmarshals an instance of NetworkInterfacePrototype from the specified map of raw messages. +func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfacePrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRulePrototypeNetworkACLContext) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "source_network_acl", &obj.SourceNetworkACL, UnmarshalNetworkACLIdentity) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } @@ -41108,33 +47481,40 @@ func UnmarshalNetworkACLPrototype(m map[string]json.RawMessage, result interface return } -// NetworkACLReference : NetworkACLReference struct -type NetworkACLReference struct { - // The CRN for this network ACL. - CRN *string `json:"crn" validate:"required"` - +// NetworkInterfaceReference : NetworkInterfaceReference struct +type NetworkInterfaceReference struct { // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *NetworkACLReferenceDeleted `json:"deleted,omitempty"` + Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` - // The URL for this network ACL. + // The URL for this network interface. Href *string `json:"href" validate:"required"` - // The unique identifier for this network ACL. + // The unique identifier for this network interface. ID *string `json:"id" validate:"required"` - // The user-defined name for this network ACL. + // The user-defined name for this network interface. Name *string `json:"name" validate:"required"` + + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalNetworkACLReference unmarshals an instance of NetworkACLReference from the specified map of raw messages. -func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLReferenceDeleted) +// Constants associated with the NetworkInterfaceReference.ResourceType property. +// The resource type. +const ( + NetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +// UnmarshalNetworkInterfaceReference unmarshals an instance of NetworkInterfaceReference from the specified map of raw messages. +func UnmarshalNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) if err != nil { return } @@ -41150,20 +47530,28 @@ func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface if err != nil { return } + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// NetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type NetworkACLReferenceDeleted struct { +type NetworkInterfaceReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalNetworkACLReferenceDeleted unmarshals an instance of NetworkACLReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLReferenceDeleted) +// UnmarshalNetworkInterfaceReferenceDeleted unmarshals an instance of NetworkInterfaceReferenceDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -41172,181 +47560,84 @@ func UnmarshalNetworkACLReferenceDeleted(m map[string]json.RawMessage, result in return } -// NetworkACLRule : NetworkACLRule struct -// Models which "extend" this model: -// - NetworkACLRuleNetworkACLRuleProtocolTcpudp -// - NetworkACLRuleNetworkACLRuleProtocolIcmp -// - NetworkACLRuleNetworkACLRuleProtocolAll -type NetworkACLRule struct { - // Whether to allow or deny matching traffic. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Destination *string `json:"destination" validate:"required"` - - // Whether the traffic to be matched is `inbound` or `outbound`. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - // specified. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. - Type *int64 `json:"type,omitempty"` +// NetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type NetworkInterfaceReferenceTargetContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// Constants associated with the NetworkACLRule.Action property. -// Whether to allow or deny matching traffic. -const ( - NetworkACLRuleActionAllowConst = "allow" - NetworkACLRuleActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRule.Direction property. -// Whether the traffic to be matched is `inbound` or `outbound`. -const ( - NetworkACLRuleDirectionInboundConst = "inbound" - NetworkACLRuleDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRule.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleIPVersionIpv4Const = "ipv4" - NetworkACLRuleIPVersionIpv6Const = "ipv6" -) - -func (*NetworkACLRule) isaNetworkACLRule() bool { - return true +// UnmarshalNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of NetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. +func UnmarshalNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceReferenceTargetContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type NetworkACLRuleIntf interface { - isaNetworkACLRule() bool +// NetworkInterfaceUnpaginatedCollection : NetworkInterfaceUnpaginatedCollection struct +type NetworkInterfaceUnpaginatedCollection struct { + // Collection of network interfaces. + NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` } -// UnmarshalNetworkACLRule unmarshals an instance of NetworkACLRule from the specified map of raw messages. -func UnmarshalNetworkACLRule(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalNetworkInterfaceUnpaginatedCollection unmarshals an instance of NetworkInterfaceUnpaginatedCollection from the specified map of raw messages. +func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkInterfaceUnpaginatedCollection) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRuleBeforePatch : The rule to move this rule immediately before. Specify `null` to move this rule after all existing rules. -// Models which "extend" this model: -// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByID -// - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref -type NetworkACLRuleBeforePatch struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id,omitempty"` +// OperatingSystem : OperatingSystem struct +type OperatingSystem struct { + // The operating system architecture. + Architecture *string `json:"architecture" validate:"required"` - // The URL for this network ACL rule. - Href *string `json:"href,omitempty"` -} + // Images with this operating system can only be used on dedicated hosts or dedicated host groups. + DedicatedHostOnly *bool `json:"dedicated_host_only" validate:"required"` -func (*NetworkACLRuleBeforePatch) isaNetworkACLRuleBeforePatch() bool { - return true -} + // A unique, display-friendly name for the operating system. + DisplayName *string `json:"display_name" validate:"required"` -type NetworkACLRuleBeforePatchIntf interface { - isaNetworkACLRuleBeforePatch() bool + // The name of the software family this operating system belongs to. + Family *string `json:"family" validate:"required"` + + // The URL for this operating system. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this operating system. + Name *string `json:"name" validate:"required"` + + // The vendor of the operating system. + Vendor *string `json:"vendor" validate:"required"` + + // The major release version of this operating system. + Version *string `json:"version" validate:"required"` } -// UnmarshalNetworkACLRuleBeforePatch unmarshals an instance of NetworkACLRuleBeforePatch from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalOperatingSystem unmarshals an instance of OperatingSystem from the specified map of raw messages. +func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystem) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "dedicated_host_only", &obj.DedicatedHostOnly) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. If omitted, this rule will be inserted after all existing rules. -// Models which "extend" this model: -// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID -// - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref -type NetworkACLRuleBeforePrototype struct { - // The unique identifier for this network ACL rule. - ID *string `json:"id,omitempty"` - - // The URL for this network ACL rule. - Href *string `json:"href,omitempty"` -} - -func (*NetworkACLRuleBeforePrototype) isaNetworkACLRuleBeforePrototype() bool { - return true -} - -type NetworkACLRuleBeforePrototypeIntf interface { - isaNetworkACLRuleBeforePrototype() bool -} - -// UnmarshalNetworkACLRuleBeforePrototype unmarshals an instance of NetworkACLRuleBeforePrototype from the specified map of raw messages. -func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleBeforePrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "family", &obj.Family) if err != nil { return } @@ -41354,33 +47645,42 @@ func UnmarshalNetworkACLRuleBeforePrototype(m map[string]json.RawMessage, result if err != nil { return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vendor", &obj.Vendor) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRuleCollection : NetworkACLRuleCollection struct -type NetworkACLRuleCollection struct { +// OperatingSystemCollection : OperatingSystemCollection struct +type OperatingSystemCollection struct { // A link to the first page of resources. - First *NetworkACLRuleCollectionFirst `json:"first" validate:"required"` + First *OperatingSystemCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *NetworkACLRuleCollectionNext `json:"next,omitempty"` - - // Ordered collection of network ACL rules. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + Next *OperatingSystemCollectionNext `json:"next,omitempty"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Collection of operating systems. + OperatingSystems []OperatingSystem `json:"operating_systems" validate:"required"` } -// UnmarshalNetworkACLRuleCollection unmarshals an instance of NetworkACLRuleCollection from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkACLRuleCollectionFirst) +// UnmarshalOperatingSystemCollection unmarshals an instance of OperatingSystemCollection from the specified map of raw messages. +func UnmarshalOperatingSystemCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalOperatingSystemCollectionFirst) if err != nil { return } @@ -41388,15 +47688,11 @@ func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result inte if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkACLRuleCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalOperatingSystemCollectionNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "operating_systems", &obj.OperatingSystems, UnmarshalOperatingSystem) if err != nil { return } @@ -41405,7 +47701,7 @@ func UnmarshalNetworkACLRuleCollection(m map[string]json.RawMessage, result inte } // Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { +func (resp *OperatingSystemCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -41416,15 +47712,15 @@ func (resp *NetworkACLRuleCollection) GetNextStart() (*string, error) { return start, nil } -// NetworkACLRuleCollectionFirst : A link to the first page of resources. -type NetworkACLRuleCollectionFirst struct { +// OperatingSystemCollectionFirst : A link to the first page of resources. +type OperatingSystemCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLRuleCollectionFirst unmarshals an instance of NetworkACLRuleCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollectionFirst) +// UnmarshalOperatingSystemCollectionFirst unmarshals an instance of OperatingSystemCollectionFirst from the specified map of raw messages. +func UnmarshalOperatingSystemCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -41433,15 +47729,15 @@ func UnmarshalNetworkACLRuleCollectionFirst(m map[string]json.RawMessage, result return } -// NetworkACLRuleCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkACLRuleCollectionNext struct { +// OperatingSystemCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type OperatingSystemCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkACLRuleCollectionNext unmarshals an instance of NetworkACLRuleCollectionNext from the specified map of raw messages. -func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleCollectionNext) +// UnmarshalOperatingSystemCollectionNext unmarshals an instance of OperatingSystemCollectionNext from the specified map of raw messages. +func UnmarshalOperatingSystemCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -41450,205 +47746,152 @@ func UnmarshalNetworkACLRuleCollectionNext(m map[string]json.RawMessage, result return } -// NetworkACLRuleItem : NetworkACLRuleItem struct +// OperatingSystemIdentity : Identifies an operating system by a unique property. // Models which "extend" this model: -// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp -// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp -// - NetworkACLRuleItemNetworkACLRuleProtocolAll -type NetworkACLRuleItem struct { - // Whether to allow or deny matching traffic. - Action *string `json:"action" validate:"required"` - - // The rule that this rule is immediately before. In a rule collection, this always - // refers to the next item in the collection. If absent, this is the last rule. - Before *NetworkACLRuleReference `json:"before,omitempty"` - - // The date and time that the rule was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The destination CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Destination *string `json:"destination" validate:"required"` - - // Whether the traffic to be matched is `inbound` or `outbound`. - Direction *string `json:"direction" validate:"required"` - - // The URL for this network ACL rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name" validate:"required"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - // specified. - Code *int64 `json:"code,omitempty"` +// - OperatingSystemIdentityByName +// - OperatingSystemIdentityByHref +type OperatingSystemIdentity struct { + // The globally unique name for this operating system. + Name *string `json:"name,omitempty"` - // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. - Type *int64 `json:"type,omitempty"` + // The URL for this operating system. + Href *string `json:"href,omitempty"` } -// Constants associated with the NetworkACLRuleItem.Action property. -// Whether to allow or deny matching traffic. -const ( - NetworkACLRuleItemActionAllowConst = "allow" - NetworkACLRuleItemActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRuleItem.Direction property. -// Whether the traffic to be matched is `inbound` or `outbound`. -const ( - NetworkACLRuleItemDirectionInboundConst = "inbound" - NetworkACLRuleItemDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRuleItem.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleItemIPVersionIpv4Const = "ipv4" - NetworkACLRuleItemIPVersionIpv6Const = "ipv6" -) - -func (*NetworkACLRuleItem) isaNetworkACLRuleItem() bool { +func (*OperatingSystemIdentity) isaOperatingSystemIdentity() bool { return true } -type NetworkACLRuleItemIntf interface { - isaNetworkACLRuleItem() bool +type OperatingSystemIdentityIntf interface { + isaOperatingSystemIdentity() bool } -// UnmarshalNetworkACLRuleItem unmarshals an instance of NetworkACLRuleItem from the specified map of raw messages. -func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalOperatingSystemIdentity unmarshals an instance of OperatingSystemIdentity from the specified map of raw messages. +func UnmarshalOperatingSystemIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRulePatch : NetworkACLRulePatch struct -type NetworkACLRulePatch struct { - // Whether to allow or deny matching traffic. - Action *string `json:"action,omitempty"` +// OperatingSystemReference : OperatingSystemReference struct +type OperatingSystemReference struct { + // The URL for this operating system. + Href *string `json:"href" validate:"required"` - // The rule to move this rule immediately before. Specify `null` to move this rule after - // all existing rules. - Before NetworkACLRuleBeforePatchIntf `json:"before,omitempty"` + // The globally unique name for this operating system. + Name *string `json:"name" validate:"required"` +} - // The ICMP traffic code to allow. - Code *int64 `json:"code,omitempty"` +// UnmarshalOperatingSystemReference unmarshals an instance of OperatingSystemReference from the specified map of raw messages. +func UnmarshalOperatingSystemReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OperatingSystemReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Destination *string `json:"destination,omitempty"` +// PlacementGroup : PlacementGroup struct +type PlacementGroup struct { + // The date and time that the placement group was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + // The CRN for this placement group. + CRN *string `json:"crn" validate:"required"` - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + // The URL for this placement group. + Href *string `json:"href" validate:"required"` - // Whether the traffic to be matched is `inbound` or `outbound`. - Direction *string `json:"direction,omitempty"` + // The unique identifier for this placement group. + ID *string `json:"id" validate:"required"` - // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. - Name *string `json:"name,omitempty"` + // The lifecycle state of the placement group. + LifecycleState *string `json:"lifecycle_state" validate:"required"` - // The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Source *string `json:"source,omitempty"` + // The user-defined name for this placement group. + Name *string `json:"name" validate:"required"` - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` + // The resource group for this placement group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The ICMP traffic type to allow. - Type *int64 `json:"type,omitempty"` + // The strategy for this placement group + // - `host_spread`: place on different compute hosts + // - `power_spread`: place on compute hosts that use different power sources + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the + // unexpected strategy was encountered. + Strategy *string `json:"strategy" validate:"required"` } -// Constants associated with the NetworkACLRulePatch.Action property. -// Whether to allow or deny matching traffic. +// Constants associated with the PlacementGroup.LifecycleState property. +// The lifecycle state of the placement group. const ( - NetworkACLRulePatchActionAllowConst = "allow" - NetworkACLRulePatchActionDenyConst = "deny" + PlacementGroupLifecycleStateDeletingConst = "deleting" + PlacementGroupLifecycleStateFailedConst = "failed" + PlacementGroupLifecycleStatePendingConst = "pending" + PlacementGroupLifecycleStateStableConst = "stable" + PlacementGroupLifecycleStateSuspendedConst = "suspended" + PlacementGroupLifecycleStateUpdatingConst = "updating" + PlacementGroupLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the NetworkACLRulePatch.Direction property. -// Whether the traffic to be matched is `inbound` or `outbound`. +// Constants associated with the PlacementGroup.ResourceType property. +// The resource type. const ( - NetworkACLRulePatchDirectionInboundConst = "inbound" - NetworkACLRulePatchDirectionOutboundConst = "outbound" + PlacementGroupResourceTypePlacementGroupConst = "placement_group" ) -// UnmarshalNetworkACLRulePatch unmarshals an instance of NetworkACLRulePatch from the specified map of raw messages. -func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePatch) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +// Constants associated with the PlacementGroup.Strategy property. +// The strategy for this placement group +// - `host_spread`: place on different compute hosts +// - `power_spread`: place on compute hosts that use different power sources +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the +// unexpected strategy was encountered. +const ( + PlacementGroupStrategyHostSpreadConst = "host_spread" + PlacementGroupStrategyPowerSpreadConst = "power_spread" +) + +// UnmarshalPlacementGroup unmarshals an instance of PlacementGroup from the specified map of raw messages. +func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroup) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } @@ -41656,19 +47899,15 @@ func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface if err != nil { return } - err = core.UnmarshalPrimitive(m, "source", &obj.Source) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "strategy", &obj.Strategy) if err != nil { return } @@ -41676,239 +47915,107 @@ func UnmarshalNetworkACLRulePatch(m map[string]json.RawMessage, result interface return } -// AsPatch returns a generic map representation of the NetworkACLRulePatch -func (networkACLRulePatch *NetworkACLRulePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkACLRulePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// NetworkACLRulePrototype : NetworkACLRulePrototype struct -// Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudp -// - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmp -// - NetworkACLRulePrototypeNetworkACLRuleProtocolAll -type NetworkACLRulePrototype struct { - // Whether to allow or deny matching traffic. - Action *string `json:"action" validate:"required"` - - // The rule to insert this rule immediately before. If omitted, this rule will be - // inserted after all existing rules. - Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - - // The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Destination *string `json:"destination" validate:"required"` - - // Whether the traffic to be matched is `inbound` or `outbound`. - Direction *string `json:"direction" validate:"required"` - - // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - // specified. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. - Type *int64 `json:"type,omitempty"` -} - -// Constants associated with the NetworkACLRulePrototype.Action property. -// Whether to allow or deny matching traffic. -const ( - NetworkACLRulePrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRulePrototype.Direction property. -// Whether the traffic to be matched is `inbound` or `outbound`. -const ( - NetworkACLRulePrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeDirectionOutboundConst = "outbound" -) - -func (*NetworkACLRulePrototype) isaNetworkACLRulePrototype() bool { - return true -} - -type NetworkACLRulePrototypeIntf interface { - isaNetworkACLRulePrototype() bool -} - -// UnmarshalNetworkACLRulePrototype unmarshals an instance of NetworkACLRulePrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) - if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - return - } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) - } - return -} - -// NetworkACLRulePrototypeNetworkACLContext : NetworkACLRulePrototypeNetworkACLContext struct -// Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudp -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmp -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll -type NetworkACLRulePrototypeNetworkACLContext struct { - // Whether to allow or deny matching traffic. - Action *string `json:"action" validate:"required"` - - // The destination IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Destination *string `json:"destination" validate:"required"` - - // Whether the traffic to be matched is `inbound` or `outbound`. - Direction *string `json:"direction" validate:"required"` - - // The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If - // unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block. The CIDR block `0.0.0.0/0` applies to all addresses. - Source *string `json:"source" validate:"required"` - - // The inclusive upper bound of TCP/UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of TCP/UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of TCP/UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` - - // The ICMP traffic code to allow. If unspecified, all codes are allowed. This can only be specified if type is also - // specified. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to allow. If unspecified, all types are allowed by this rule. - Type *int64 `json:"type,omitempty"` -} +// PlacementGroupCollection : PlacementGroupCollection struct +type PlacementGroupCollection struct { + // A link to the first page of resources. + First *PlacementGroupCollectionFirst `json:"first" validate:"required"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Action property. -// Whether to allow or deny matching traffic. -const ( - NetworkACLRulePrototypeNetworkACLContextActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextActionDenyConst = "deny" -) + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -// Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Direction property. -// Whether the traffic to be matched is `inbound` or `outbound`. -const ( - NetworkACLRulePrototypeNetworkACLContextDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextDirectionOutboundConst = "outbound" -) + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *PlacementGroupCollectionNext `json:"next,omitempty"` -func (*NetworkACLRulePrototypeNetworkACLContext) isaNetworkACLRulePrototypeNetworkACLContext() bool { - return true -} + // Collection of placement groups. + PlacementGroups []PlacementGroup `json:"placement_groups" validate:"required"` -type NetworkACLRulePrototypeNetworkACLContextIntf interface { - isaNetworkACLRulePrototypeNetworkACLContext() bool + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalNetworkACLRulePrototypeNetworkACLContext unmarshals an instance of NetworkACLRulePrototypeNetworkACLContext from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContext(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalPlacementGroupCollection unmarshals an instance of PlacementGroupCollection from the specified map of raw messages. +func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPlacementGroupCollectionFirst) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPlacementGroupCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "placement_groups", &obj.PlacementGroups, UnmarshalPlacementGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkACLRuleReference : NetworkACLRuleReference struct -type NetworkACLRuleReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *NetworkACLRuleReferenceDeleted `json:"deleted,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *PlacementGroupCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} - // The URL for this network ACL rule. +// PlacementGroupCollectionFirst : A link to the first page of resources. +type PlacementGroupCollectionFirst struct { + // The URL for a page of resources. Href *string `json:"href" validate:"required"` - - // The unique identifier for this network ACL rule. - ID *string `json:"id" validate:"required"` - - // The user-defined name for this network ACL rule. - Name *string `json:"name" validate:"required"` } -// UnmarshalNetworkACLRuleReference unmarshals an instance of NetworkACLRuleReference from the specified map of raw messages. -func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkACLRuleReferenceDeleted) - if err != nil { - return - } +// UnmarshalPlacementGroupCollectionFirst unmarshals an instance of PlacementGroupCollectionFirst from the specified map of raw messages. +func UnmarshalPlacementGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PlacementGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type PlacementGroupCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalPlacementGroupCollectionNext unmarshals an instance of PlacementGroupCollectionNext from the specified map of raw messages. +func UnmarshalPlacementGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PlacementGroupPatch : PlacementGroupPatch struct +type PlacementGroupPatch struct { + // The user-defined name for this placement group. + Name *string `json:"name,omitempty"` +} + +// UnmarshalPlacementGroupPatch unmarshals an instance of PlacementGroupPatch from the specified map of raw messages. +func UnmarshalPlacementGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -41917,16 +48024,26 @@ func UnmarshalNetworkACLRuleReference(m map[string]json.RawMessage, result inter return } -// NetworkACLRuleReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// AsPatch returns a generic map representation of the PlacementGroupPatch +func (placementGroupPatch *PlacementGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(placementGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// PlacementGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type NetworkACLRuleReferenceDeleted struct { +type PlacementGroupReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalNetworkACLRuleReferenceDeleted unmarshals an instance of NetworkACLRuleReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleReferenceDeleted) +// UnmarshalPlacementGroupReferenceDeleted unmarshals an instance of PlacementGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalPlacementGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PlacementGroupReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -41935,85 +48052,69 @@ func UnmarshalNetworkACLRuleReferenceDeleted(m map[string]json.RawMessage, resul return } -// NetworkInterface : NetworkInterface struct -type NetworkInterface struct { - // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this - // interface. If true, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - - // The date and time that the network interface was created. +// PublicGateway : PublicGateway struct +type PublicGateway struct { + // The date and time that the public gateway was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The floating IPs associated with this network interface. - FloatingIps []FloatingIPReference `json:"floating_ips,omitempty"` + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` - // The URL for this network interface. + // The floating IP bound to this public gateway. + FloatingIP *PublicGatewayFloatingIP `json:"floating_ip" validate:"required"` + + // The URL for this public gateway. Href *string `json:"href" validate:"required"` - // The unique identifier for this network interface. + // The unique identifier for this public gateway. ID *string `json:"id" validate:"required"` - // The user-defined name for this network interface. + // The user-defined name for this public gateway. Name *string `json:"name" validate:"required"` - // The network interface port speed in Mbps. - PortSpeed *int64 `json:"port_speed" validate:"required"` - - // The primary IPv4 address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` + // The resource group for this public gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // Collection of security groups. - SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - - // The status of the network interface. + // The status of the volume. Status *string `json:"status" validate:"required"` - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The VPC this public gateway serves. + VPC *VPCReference `json:"vpc" validate:"required"` - // The type of this network interface as it relates to an instance. - Type *string `json:"type" validate:"required"` + // The zone this public gateway resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the NetworkInterface.ResourceType property. +// Constants associated with the PublicGateway.ResourceType property. // The resource type. const ( - NetworkInterfaceResourceTypeNetworkInterfaceConst = "network_interface" -) - -// Constants associated with the NetworkInterface.Status property. -// The status of the network interface. -const ( - NetworkInterfaceStatusAvailableConst = "available" - NetworkInterfaceStatusDeletingConst = "deleting" - NetworkInterfaceStatusFailedConst = "failed" - NetworkInterfaceStatusPendingConst = "pending" + PublicGatewayResourceTypePublicGatewayConst = "public_gateway" ) -// Constants associated with the NetworkInterface.Type property. -// The type of this network interface as it relates to an instance. +// Constants associated with the PublicGateway.Status property. +// The status of the volume. const ( - NetworkInterfaceTypePrimaryConst = "primary" - NetworkInterfaceTypeSecondaryConst = "secondary" + PublicGatewayStatusAvailableConst = "available" + PublicGatewayStatusDeletingConst = "deleting" + PublicGatewayStatusFailedConst = "failed" + PublicGatewayStatusPendingConst = "pending" ) -// UnmarshalNetworkInterface unmarshals an instance of NetworkInterface from the specified map of raw messages. -func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterface) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +// UnmarshalPublicGateway unmarshals an instance of PublicGateway from the specified map of raw messages. +func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGateway) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) + err = core.UnmarshalModel(m, "floating_ip", &obj.FloatingIP, UnmarshalPublicGatewayFloatingIP) if err != nil { return } @@ -42029,11 +48130,7 @@ func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } @@ -42041,19 +48138,15 @@ func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { return } @@ -42061,29 +48154,29 @@ func UnmarshalNetworkInterface(m map[string]json.RawMessage, result interface{}) return } -// NetworkInterfaceCollection : NetworkInterfaceCollection struct -type NetworkInterfaceCollection struct { +// PublicGatewayCollection : PublicGatewayCollection struct +type PublicGatewayCollection struct { // A link to the first page of resources. - First *NetworkInterfaceCollectionFirst `json:"first" validate:"required"` + First *PublicGatewayCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` - // Collection of network interfaces. - NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` - // A link to the next page of resources. This property is present for all pages // except the last page. - Next *NetworkInterfaceCollectionNext `json:"next,omitempty"` + Next *PublicGatewayCollectionNext `json:"next,omitempty"` + + // Collection of public gateways. + PublicGateways []PublicGateway `json:"public_gateways" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalNetworkInterfaceCollection unmarshals an instance of NetworkInterfaceCollection from the specified map of raw messages. -func UnmarshalNetworkInterfaceCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalNetworkInterfaceCollectionFirst) +// UnmarshalPublicGatewayCollection unmarshals an instance of PublicGatewayCollection from the specified map of raw messages. +func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPublicGatewayCollectionFirst) if err != nil { return } @@ -42091,11 +48184,11 @@ func UnmarshalNetworkInterfaceCollection(m map[string]json.RawMessage, result in if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPublicGatewayCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNetworkInterfaceCollectionNext) + err = core.UnmarshalModel(m, "public_gateways", &obj.PublicGateways, UnmarshalPublicGateway) if err != nil { return } @@ -42108,7 +48201,7 @@ func UnmarshalNetworkInterfaceCollection(m map[string]json.RawMessage, result in } // Retrieve the value to be passed to a request to access the next page of results -func (resp *NetworkInterfaceCollection) GetNextStart() (*string, error) { +func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -42119,15 +48212,15 @@ func (resp *NetworkInterfaceCollection) GetNextStart() (*string, error) { return start, nil } -// NetworkInterfaceCollectionFirst : A link to the first page of resources. -type NetworkInterfaceCollectionFirst struct { +// PublicGatewayCollectionFirst : A link to the first page of resources. +type PublicGatewayCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkInterfaceCollectionFirst unmarshals an instance of NetworkInterfaceCollectionFirst from the specified map of raw messages. -func UnmarshalNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceCollectionFirst) +// UnmarshalPublicGatewayCollectionFirst unmarshals an instance of PublicGatewayCollectionFirst from the specified map of raw messages. +func UnmarshalPublicGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -42136,15 +48229,15 @@ func UnmarshalNetworkInterfaceCollectionFirst(m map[string]json.RawMessage, resu return } -// NetworkInterfaceCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type NetworkInterfaceCollectionNext struct { +// PublicGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type PublicGatewayCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalNetworkInterfaceCollectionNext unmarshals an instance of NetworkInterfaceCollectionNext from the specified map of raw messages. -func UnmarshalNetworkInterfaceCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceCollectionNext) +// UnmarshalPublicGatewayCollectionNext unmarshals an instance of PublicGatewayCollectionNext from the specified map of raw messages. +func UnmarshalPublicGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -42153,67 +48246,52 @@ func UnmarshalNetworkInterfaceCollectionNext(m map[string]json.RawMessage, resul return } -// NetworkInterfaceInstanceContextReference : NetworkInterfaceInstanceContextReference struct -type NetworkInterfaceInstanceContextReference struct { +// PublicGatewayFloatingIP : The floating IP bound to this public gateway. +type PublicGatewayFloatingIP struct { + // The globally unique IP address. + Address *string `json:"address" validate:"required"` + + // The CRN for this floating IP. + CRN *string `json:"crn" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *NetworkInterfaceInstanceContextReferenceDeleted `json:"deleted,omitempty"` + Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` - // The URL for this network interface. + // The URL for this floating IP. Href *string `json:"href" validate:"required"` - // The unique identifier for this network interface. + // The unique identifier for this floating IP. ID *string `json:"id" validate:"required"` - // The user-defined name for this network interface. + // The unique user-defined name for this floating IP. Name *string `json:"name" validate:"required"` - - // The primary IPv4 address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The associated subnet. - Subnet *SubnetReference `json:"subnet" validate:"required"` } -// Constants associated with the NetworkInterfaceInstanceContextReference.ResourceType property. -// The resource type. -const ( - NetworkInterfaceInstanceContextReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) - -// UnmarshalNetworkInterfaceInstanceContextReference unmarshals an instance of NetworkInterfaceInstanceContextReference from the specified map of raw messages. -func UnmarshalNetworkInterfaceInstanceContextReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceInstanceContextReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceInstanceContextReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalPublicGatewayFloatingIP unmarshals an instance of PublicGatewayFloatingIP from the specified map of raw messages. +func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayFloatingIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -42221,39 +48299,56 @@ func UnmarshalNetworkInterfaceInstanceContextReference(m map[string]json.RawMess return } -// NetworkInterfaceInstanceContextReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type NetworkInterfaceInstanceContextReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} +// PublicGatewayFloatingIPPrototype : PublicGatewayFloatingIPPrototype struct +// Models which "extend" this model: +// - PublicGatewayFloatingIPPrototypeFloatingIPIdentity +// - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext +type PublicGatewayFloatingIPPrototype struct { + // The unique identifier for this floating IP. + ID *string `json:"id,omitempty"` -// UnmarshalNetworkInterfaceInstanceContextReferenceDeleted unmarshals an instance of NetworkInterfaceInstanceContextReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceInstanceContextReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceInstanceContextReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The CRN for this floating IP. + CRN *string `json:"crn,omitempty"` -// NetworkInterfacePatch : NetworkInterfacePatch struct -type NetworkInterfacePatch struct { - // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this - // interface. If true, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` + // The URL for this floating IP. + Href *string `json:"href,omitempty"` - // The user-defined name for network interface. Names must be unique within the instance the network interface resides - // in. + // The globally unique IP address. + Address *string `json:"address,omitempty"` + + // The unique user-defined name for this floating IP. If unspecified, the name will be a hyphenated list of + // randomly-selected words. Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` } -// UnmarshalNetworkInterfacePatch unmarshals an instance of NetworkInterfacePatch from the specified map of raw messages. -func UnmarshalNetworkInterfacePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfacePatch) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) +func (*PublicGatewayFloatingIPPrototype) isaPublicGatewayFloatingIPPrototype() bool { + return true +} + +type PublicGatewayFloatingIPPrototypeIntf interface { + isaPublicGatewayFloatingIPPrototype() bool +} + +// UnmarshalPublicGatewayFloatingIPPrototype unmarshals an instance of PublicGatewayFloatingIPPrototype from the specified map of raw messages. +func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayFloatingIPPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } @@ -42261,70 +48356,67 @@ func UnmarshalNetworkInterfacePatch(m map[string]json.RawMessage, result interfa if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the NetworkInterfacePatch -func (networkInterfacePatch *NetworkInterfacePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(networkInterfacePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// NetworkInterfacePrototype : NetworkInterfacePrototype struct -type NetworkInterfacePrototype struct { - // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this - // interface. If true, source IP spoofing is allowed on this interface. - AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - - // The user-defined name for network interface. Names must be unique within the instance the network interface resides - // in. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` +// PublicGatewayIdentity : Identifies a public gateway by a unique property. +// Models which "extend" this model: +// - PublicGatewayIdentityPublicGatewayIdentityByID +// - PublicGatewayIdentityPublicGatewayIdentityByCRN +// - PublicGatewayIdentityPublicGatewayIdentityByHref +type PublicGatewayIdentity struct { + // The unique identifier for this public gateway. + ID *string `json:"id,omitempty"` - // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If - // unspecified, an available address on the subnet will be automatically selected. - PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` + // The CRN for this public gateway. + CRN *string `json:"crn,omitempty"` - // Collection of security groups. - SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` + // The URL for this public gateway. + Href *string `json:"href,omitempty"` +} - // The associated subnet. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` +func (*PublicGatewayIdentity) isaPublicGatewayIdentity() bool { + return true } -// NewNetworkInterfacePrototype : Instantiate NetworkInterfacePrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkInterfacePrototype(subnet SubnetIdentityIntf) (_model *NetworkInterfacePrototype, err error) { - _model = &NetworkInterfacePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - return +type PublicGatewayIdentityIntf interface { + isaPublicGatewayIdentity() bool } -// UnmarshalNetworkInterfacePrototype unmarshals an instance of NetworkInterfacePrototype from the specified map of raw messages. -func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfacePrototype) - err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalPublicGatewayIdentity unmarshals an instance of PublicGatewayIdentity from the specified map of raw messages. +func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PublicGatewayPatch : PublicGatewayPatch struct +type PublicGatewayPatch struct { + // The user-defined name for this public gateway. Names must be unique within the VPC the public gateway resides in. + Name *string `json:"name,omitempty"` +} + +// UnmarshalPublicGatewayPatch unmarshals an instance of PublicGatewayPatch from the specified map of raw messages. +func UnmarshalPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -42332,40 +48424,52 @@ func UnmarshalNetworkInterfacePrototype(m map[string]json.RawMessage, result int return } -// NetworkInterfaceReference : NetworkInterfaceReference struct -type NetworkInterfaceReference struct { +// AsPatch returns a generic map representation of the PublicGatewayPatch +func (publicGatewayPatch *PublicGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(publicGatewayPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// PublicGatewayReference : PublicGatewayReference struct +type PublicGatewayReference struct { + // The CRN for this public gateway. + CRN *string `json:"crn" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *NetworkInterfaceReferenceDeleted `json:"deleted,omitempty"` + Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` - // The URL for this network interface. + // The URL for this public gateway. Href *string `json:"href" validate:"required"` - // The unique identifier for this network interface. + // The unique identifier for this public gateway. ID *string `json:"id" validate:"required"` - // The user-defined name for this network interface. + // The user-defined name for this public gateway. Name *string `json:"name" validate:"required"` - // The primary IPv4 address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the NetworkInterfaceReference.ResourceType property. +// Constants associated with the PublicGatewayReference.ResourceType property. // The resource type. const ( - NetworkInterfaceReferenceResourceTypeNetworkInterfaceConst = "network_interface" + PublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" ) -// UnmarshalNetworkInterfaceReference unmarshals an instance of NetworkInterfaceReference from the specified map of raw messages. -func UnmarshalNetworkInterfaceReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceDeleted) +// UnmarshalPublicGatewayReference unmarshals an instance of PublicGatewayReference from the specified map of raw messages. +func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) if err != nil { return } @@ -42381,10 +48485,6 @@ func UnmarshalNetworkInterfaceReference(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return @@ -42393,16 +48493,16 @@ func UnmarshalNetworkInterfaceReference(m map[string]json.RawMessage, result int return } -// NetworkInterfaceReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// PublicGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type NetworkInterfaceReferenceDeleted struct { +type PublicGatewayReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalNetworkInterfaceReferenceDeleted unmarshals an instance of NetworkInterfaceReferenceDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReferenceDeleted) +// UnmarshalPublicGatewayReferenceDeleted unmarshals an instance of PublicGatewayReferenceDeleted from the specified map of raw messages. +func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PublicGatewayReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -42411,17 +48511,44 @@ func UnmarshalNetworkInterfaceReferenceDeleted(m map[string]json.RawMessage, res return } -// NetworkInterfaceReferenceTargetContextDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type NetworkInterfaceReferenceTargetContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// Region : Region struct +type Region struct { + // The API endpoint for this region. + Endpoint *string `json:"endpoint" validate:"required"` + + // The URL for this region. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this region. + Name *string `json:"name" validate:"required"` + + // The availability status of this region. + Status *string `json:"status" validate:"required"` } -// UnmarshalNetworkInterfaceReferenceTargetContextDeleted unmarshals an instance of NetworkInterfaceReferenceTargetContextDeleted from the specified map of raw messages. -func UnmarshalNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceReferenceTargetContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// Constants associated with the Region.Status property. +// The availability status of this region. +const ( + RegionStatusAvailableConst = "available" + RegionStatusUnavailableConst = "unavailable" +) + +// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. +func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Region) + err = core.UnmarshalPrimitive(m, "endpoint", &obj.Endpoint) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } @@ -42429,16 +48556,16 @@ func UnmarshalNetworkInterfaceReferenceTargetContextDeleted(m map[string]json.Ra return } -// NetworkInterfaceUnpaginatedCollection : NetworkInterfaceUnpaginatedCollection struct -type NetworkInterfaceUnpaginatedCollection struct { - // Collection of network interfaces. - NetworkInterfaces []NetworkInterface `json:"network_interfaces" validate:"required"` +// RegionCollection : RegionCollection struct +type RegionCollection struct { + // Collection of regions. + Regions []Region `json:"regions" validate:"required"` } -// UnmarshalNetworkInterfaceUnpaginatedCollection unmarshals an instance of NetworkInterfaceUnpaginatedCollection from the specified map of raw messages. -func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkInterfaceUnpaginatedCollection) - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterface) +// UnmarshalRegionCollection unmarshals an instance of RegionCollection from the specified map of raw messages. +func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionCollection) + err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) if err != nil { return } @@ -42446,52 +48573,18 @@ func UnmarshalNetworkInterfaceUnpaginatedCollection(m map[string]json.RawMessage return } -// OperatingSystem : OperatingSystem struct -type OperatingSystem struct { - // The operating system architecture. - Architecture *string `json:"architecture" validate:"required"` - - // Images with this operating system can only be used on dedicated hosts or dedicated host groups. - DedicatedHostOnly *bool `json:"dedicated_host_only" validate:"required"` - - // A unique, display-friendly name for the operating system. - DisplayName *string `json:"display_name" validate:"required"` - - // The name of the software family this operating system belongs to. - Family *string `json:"family" validate:"required"` - - // The URL for this operating system. +// RegionReference : RegionReference struct +type RegionReference struct { + // The URL for this region. Href *string `json:"href" validate:"required"` - // The globally unique name for this operating system. + // The globally unique name for this region. Name *string `json:"name" validate:"required"` - - // The vendor of the operating system. - Vendor *string `json:"vendor" validate:"required"` - - // The major release version of this operating system. - Version *string `json:"version" validate:"required"` } -// UnmarshalOperatingSystem unmarshals an instance of OperatingSystem from the specified map of raw messages. -func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystem) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dedicated_host_only", &obj.DedicatedHostOnly) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "family", &obj.Family) - if err != nil { - return - } +// UnmarshalRegionReference unmarshals an instance of RegionReference from the specified map of raw messages. +func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -42500,472 +48593,484 @@ func UnmarshalOperatingSystem(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "vendor", &obj.Vendor) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// OperatingSystemCollection : OperatingSystemCollection struct -type OperatingSystemCollection struct { - // A link to the first page of resources. - First *OperatingSystemCollectionFirst `json:"first" validate:"required"` +// RemoveBareMetalServerNetworkInterfaceFloatingIPOptions : The RemoveBareMetalServerNetworkInterfaceFloatingIP options. +type RemoveBareMetalServerNetworkInterfaceFloatingIPOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *OperatingSystemCollectionNext `json:"next,omitempty"` + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` - // Collection of operating systems. - OperatingSystems []OperatingSystem `json:"operating_systems" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalOperatingSystemCollection unmarshals an instance of OperatingSystemCollection from the specified map of raw messages. -func UnmarshalOperatingSystemCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalOperatingSystemCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalOperatingSystemCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_systems", &obj.OperatingSystems, UnmarshalOperatingSystem) - if err != nil { - return +// NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions : Instantiate RemoveBareMetalServerNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewRemoveBareMetalServerNetworkInterfaceFloatingIPOptions(bareMetalServerID string, networkInterfaceID string, id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + return &RemoveBareMetalServerNetworkInterfaceFloatingIPOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *OperatingSystemCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetBareMetalServerID(bareMetalServerID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -// OperatingSystemCollectionFirst : A link to the first page of resources. -type OperatingSystemCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options } -// UnmarshalOperatingSystemCollectionFirst unmarshals an instance of OperatingSystemCollectionFirst from the specified map of raw messages. -func UnmarshalOperatingSystemCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options } -// OperatingSystemCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type OperatingSystemCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveBareMetalServerNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options } -// UnmarshalOperatingSystemCollectionNext unmarshals an instance of OperatingSystemCollectionNext from the specified map of raw messages. -func UnmarshalOperatingSystemCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// RemoveEndpointGatewayIPOptions : The RemoveEndpointGatewayIP options. +type RemoveEndpointGatewayIPOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The reserved IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewRemoveEndpointGatewayIPOptions : Instantiate RemoveEndpointGatewayIPOptions +func (*VpcV1) NewRemoveEndpointGatewayIPOptions(endpointGatewayID string, id string) *RemoveEndpointGatewayIPOptions { + return &RemoveEndpointGatewayIPOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// OperatingSystemIdentity : Identifies an operating system by a unique property. -// Models which "extend" this model: -// - OperatingSystemIdentityByName -// - OperatingSystemIdentityByHref -type OperatingSystemIdentity struct { - // The globally unique name for this operating system. - Name *string `json:"name,omitempty"` +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *RemoveEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *RemoveEndpointGatewayIPOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} - // The URL for this operating system. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *RemoveEndpointGatewayIPOptions) SetID(id string) *RemoveEndpointGatewayIPOptions { + _options.ID = core.StringPtr(id) + return _options } -func (*OperatingSystemIdentity) isaOperatingSystemIdentity() bool { - return true +// SetHeaders : Allow user to set Headers +func (options *RemoveEndpointGatewayIPOptions) SetHeaders(param map[string]string) *RemoveEndpointGatewayIPOptions { + options.Headers = param + return options } -type OperatingSystemIdentityIntf interface { - isaOperatingSystemIdentity() bool +// RemoveInstanceNetworkInterfaceFloatingIPOptions : The RemoveInstanceNetworkInterfaceFloatingIP options. +type RemoveInstanceNetworkInterfaceFloatingIPOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` + + // The network interface identifier. + NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalOperatingSystemIdentity unmarshals an instance of OperatingSystemIdentity from the specified map of raw messages. -func UnmarshalOperatingSystemIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewRemoveInstanceNetworkInterfaceFloatingIPOptions : Instantiate RemoveInstanceNetworkInterfaceFloatingIPOptions +func (*VpcV1) NewRemoveInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + return &RemoveInstanceNetworkInterfaceFloatingIPOptions{ + InstanceID: core.StringPtr(instanceID), + NetworkInterfaceID: core.StringPtr(networkInterfaceID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// OperatingSystemReference : OperatingSystemReference struct -type OperatingSystemReference struct { - // The URL for this operating system. - Href *string `json:"href" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} - // The globally unique name for this operating system. - Name *string `json:"name" validate:"required"` +// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID +func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) + return _options } -// UnmarshalOperatingSystemReference unmarshals an instance of OperatingSystemReference from the specified map of raw messages. -func UnmarshalOperatingSystemReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(OperatingSystemReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// SetID : Allow user to set ID +func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { + options.Headers = param + return options +} + +// RemoveSecurityGroupNetworkInterfaceOptions : The RemoveSecurityGroupNetworkInterface options. +type RemoveSecurityGroupNetworkInterfaceOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` + + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewRemoveSecurityGroupNetworkInterfaceOptions : Instantiate RemoveSecurityGroupNetworkInterfaceOptions +func (*VpcV1) NewRemoveSecurityGroupNetworkInterfaceOptions(securityGroupID string, id string) *RemoveSecurityGroupNetworkInterfaceOptions { + return &RemoveSecurityGroupNetworkInterfaceOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// PlacementGroup : PlacementGroup struct -type PlacementGroup struct { - // The date and time that the placement group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *RemoveSecurityGroupNetworkInterfaceOptions) SetSecurityGroupID(securityGroupID string) *RemoveSecurityGroupNetworkInterfaceOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) + return _options +} - // The CRN for this placement group. - CRN *string `json:"crn" validate:"required"` +// SetID : Allow user to set ID +func (_options *RemoveSecurityGroupNetworkInterfaceOptions) SetID(id string) *RemoveSecurityGroupNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The URL for this placement group. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *RemoveSecurityGroupNetworkInterfaceOptions) SetHeaders(param map[string]string) *RemoveSecurityGroupNetworkInterfaceOptions { + options.Headers = param + return options +} - // The unique identifier for this placement group. - ID *string `json:"id" validate:"required"` +// RemoveVPNGatewayConnectionLocalCIDROptions : The RemoveVPNGatewayConnectionLocalCIDR options. +type RemoveVPNGatewayConnectionLocalCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` - // The lifecycle state of the placement group. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` - // The user-defined name for this placement group. - Name *string `json:"name" validate:"required"` + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` - // The resource group for this placement group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The strategy for this placement group - // - `host_spread`: place on different compute hosts - // - `power_spread`: place on compute hosts that use different power sources - // - // The enumerated values for this property may expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the - // unexpected strategy was encountered. - Strategy *string `json:"strategy" validate:"required"` +// NewRemoveVPNGatewayConnectionLocalCIDROptions : Instantiate RemoveVPNGatewayConnectionLocalCIDROptions +func (*VpcV1) NewRemoveVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { + return &RemoveVPNGatewayConnectionLocalCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), + } } -// Constants associated with the PlacementGroup.LifecycleState property. -// The lifecycle state of the placement group. -const ( - PlacementGroupLifecycleStateDeletingConst = "deleting" - PlacementGroupLifecycleStateFailedConst = "failed" - PlacementGroupLifecycleStatePendingConst = "pending" - PlacementGroupLifecycleStateStableConst = "stable" - PlacementGroupLifecycleStateSuspendedConst = "suspended" - PlacementGroupLifecycleStateUpdatingConst = "updating" - PlacementGroupLifecycleStateWaitingConst = "waiting" -) +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} -// Constants associated with the PlacementGroup.ResourceType property. -// The resource type. -const ( - PlacementGroupResourceTypePlacementGroupConst = "placement_group" -) +// SetID : Allow user to set ID +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the PlacementGroup.Strategy property. -// The strategy for this placement group -// - `host_spread`: place on different compute hosts -// - `power_spread`: place on compute hosts that use different power sources -// -// The enumerated values for this property may expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the -// unexpected strategy was encountered. -const ( - PlacementGroupStrategyHostSpreadConst = "host_spread" - PlacementGroupStrategyPowerSpreadConst = "power_spread" -) +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) + return _options +} -// UnmarshalPlacementGroup unmarshals an instance of PlacementGroup from the specified map of raw messages. -func UnmarshalPlacementGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "strategy", &obj.Strategy) - if err != nil { - return +// SetPrefixLength : Allow user to set PrefixLength +func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *RemoveVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionLocalCIDROptions { + options.Headers = param + return options +} + +// RemoveVPNGatewayConnectionPeerCIDROptions : The RemoveVPNGatewayConnectionPeerCIDR options. +type RemoveVPNGatewayConnectionPeerCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // The address prefix part of the CIDR. + CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + + // The prefix length part of the CIDR. + PrefixLength *string `json:"prefix_length" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewRemoveVPNGatewayConnectionPeerCIDROptions : Instantiate RemoveVPNGatewayConnectionPeerCIDROptions +func (*VpcV1) NewRemoveVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { + return &RemoveVPNGatewayConnectionPeerCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + CIDRPrefix: core.StringPtr(cidrPrefix), + PrefixLength: core.StringPtr(prefixLength), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// PlacementGroupCollection : PlacementGroupCollection struct -type PlacementGroupCollection struct { - // A link to the first page of resources. - First *PlacementGroupCollectionFirst `json:"first" validate:"required"` +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetID : Allow user to set ID +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.ID = core.StringPtr(id) + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *PlacementGroupCollectionNext `json:"next,omitempty"` +// SetCIDRPrefix : Allow user to set CIDRPrefix +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.CIDRPrefix = core.StringPtr(cidrPrefix) + return _options +} - // Collection of placement groups. - PlacementGroups []PlacementGroup `json:"placement_groups" validate:"required"` +// SetPrefixLength : Allow user to set PrefixLength +func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { + _options.PrefixLength = core.StringPtr(prefixLength) + return _options +} - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *RemoveVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionPeerCIDROptions { + options.Headers = param + return options } -// UnmarshalPlacementGroupCollection unmarshals an instance of PlacementGroupCollection from the specified map of raw messages. -func UnmarshalPlacementGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPlacementGroupCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPlacementGroupCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_groups", &obj.PlacementGroups, UnmarshalPlacementGroup) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// ReplaceLoadBalancerPoolMembersOptions : The ReplaceLoadBalancerPoolMembers options. +type ReplaceLoadBalancerPoolMembersOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` + + // The member prototype objects for this pool. + Members []LoadBalancerPoolMemberPrototype `json:"members" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *PlacementGroupCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// NewReplaceLoadBalancerPoolMembersOptions : Instantiate ReplaceLoadBalancerPoolMembersOptions +func (*VpcV1) NewReplaceLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string, members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { + return &ReplaceLoadBalancerPoolMembersOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + Members: members, } - return start, nil } -// PlacementGroupCollectionFirst : A link to the first page of resources. -type PlacementGroupCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *ReplaceLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ReplaceLoadBalancerPoolMembersOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalPlacementGroupCollectionFirst unmarshals an instance of PlacementGroupCollectionFirst from the specified map of raw messages. -func UnmarshalPlacementGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetPoolID : Allow user to set PoolID +func (_options *ReplaceLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ReplaceLoadBalancerPoolMembersOptions { + _options.PoolID = core.StringPtr(poolID) + return _options } -// PlacementGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type PlacementGroupCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetMembers : Allow user to set Members +func (_options *ReplaceLoadBalancerPoolMembersOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { + _options.Members = members + return _options } -// UnmarshalPlacementGroupCollectionNext unmarshals an instance of PlacementGroupCollectionNext from the specified map of raw messages. -func UnmarshalPlacementGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ReplaceLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ReplaceLoadBalancerPoolMembersOptions { + options.Headers = param + return options } -// PlacementGroupPatch : PlacementGroupPatch struct -type PlacementGroupPatch struct { - // The user-defined name for this placement group. - Name *string `json:"name,omitempty"` +// ReplaceSubnetNetworkACLOptions : The ReplaceSubnetNetworkACL options. +type ReplaceSubnetNetworkACLOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // The network ACL identity. + NetworkACLIdentity NetworkACLIdentityIntf `json:"NetworkACLIdentity" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalPlacementGroupPatch unmarshals an instance of PlacementGroupPatch from the specified map of raw messages. -func UnmarshalPlacementGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewReplaceSubnetNetworkACLOptions : Instantiate ReplaceSubnetNetworkACLOptions +func (*VpcV1) NewReplaceSubnetNetworkACLOptions(id string, networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { + return &ReplaceSubnetNetworkACLOptions{ + ID: core.StringPtr(id), + NetworkACLIdentity: networkACLIdentity, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the PlacementGroupPatch -func (placementGroupPatch *PlacementGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(placementGroupPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetID : Allow user to set ID +func (_options *ReplaceSubnetNetworkACLOptions) SetID(id string) *ReplaceSubnetNetworkACLOptions { + _options.ID = core.StringPtr(id) + return _options } -// PlacementGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type PlacementGroupReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetNetworkACLIdentity : Allow user to set NetworkACLIdentity +func (_options *ReplaceSubnetNetworkACLOptions) SetNetworkACLIdentity(networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { + _options.NetworkACLIdentity = networkACLIdentity + return _options } -// UnmarshalPlacementGroupReferenceDeleted unmarshals an instance of PlacementGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalPlacementGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PlacementGroupReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// SetHeaders : Allow user to set Headers +func (options *ReplaceSubnetNetworkACLOptions) SetHeaders(param map[string]string) *ReplaceSubnetNetworkACLOptions { + options.Headers = param + return options +} + +// ReplaceSubnetRoutingTableOptions : The ReplaceSubnetRoutingTable options. +type ReplaceSubnetRoutingTableOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // The routing table identity. + RoutingTableIdentity RoutingTableIdentityIntf `json:"RoutingTableIdentity" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewReplaceSubnetRoutingTableOptions : Instantiate ReplaceSubnetRoutingTableOptions +func (*VpcV1) NewReplaceSubnetRoutingTableOptions(id string, routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { + return &ReplaceSubnetRoutingTableOptions{ + ID: core.StringPtr(id), + RoutingTableIdentity: routingTableIdentity, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// PublicGateway : PublicGateway struct -type PublicGateway struct { - // The date and time that the public gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` +// SetID : Allow user to set ID +func (_options *ReplaceSubnetRoutingTableOptions) SetID(id string) *ReplaceSubnetRoutingTableOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` +// SetRoutingTableIdentity : Allow user to set RoutingTableIdentity +func (_options *ReplaceSubnetRoutingTableOptions) SetRoutingTableIdentity(routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { + _options.RoutingTableIdentity = routingTableIdentity + return _options +} - // The floating IP bound to this public gateway. - FloatingIP *PublicGatewayFloatingIP `json:"floating_ip" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]string) *ReplaceSubnetRoutingTableOptions { + options.Headers = param + return options +} - // The URL for this public gateway. +// ReservedIP : ReservedIP struct +type ReservedIP struct { + // The IP address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` + + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete" validate:"required"` + + // The date and time that the reserved IP was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this reserved IP. Href *string `json:"href" validate:"required"` - // The unique identifier for this public gateway. + // The unique identifier for this reserved IP. ID *string `json:"id" validate:"required"` - // The user-defined name for this public gateway. + // The user-defined or system-provided name for this reserved IP. Name *string `json:"name" validate:"required"` - // The resource group for this public gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The owner of a reserved IP, defining whether it is managed by the user or the provider. + Owner *string `json:"owner" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The status of the volume. - Status *string `json:"status" validate:"required"` - - // The VPC this public gateway serves. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The zone this public gateway resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The target of this reserved IP. + Target ReservedIPTargetIntf `json:"target,omitempty"` } -// Constants associated with the PublicGateway.ResourceType property. -// The resource type. +// Constants associated with the ReservedIP.Owner property. +// The owner of a reserved IP, defining whether it is managed by the user or the provider. const ( - PublicGatewayResourceTypePublicGatewayConst = "public_gateway" + ReservedIPOwnerProviderConst = "provider" + ReservedIPOwnerUserConst = "user" ) -// Constants associated with the PublicGateway.Status property. -// The status of the volume. +// Constants associated with the ReservedIP.ResourceType property. +// The resource type. const ( - PublicGatewayStatusAvailableConst = "available" - PublicGatewayStatusDeletingConst = "deleting" - PublicGatewayStatusFailedConst = "failed" - PublicGatewayStatusPendingConst = "pending" + ReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) -// UnmarshalPublicGateway unmarshals an instance of PublicGateway from the specified map of raw messages. -func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGateway) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalReservedIP unmarshals an instance of ReservedIP from the specified map of raw messages. +func UnmarshalReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) if err != nil { return } - err = core.UnmarshalModel(m, "floating_ip", &obj.FloatingIP, UnmarshalPublicGatewayFloatingIP) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } @@ -42981,7 +49086,7 @@ func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + err = core.UnmarshalPrimitive(m, "owner", &obj.Owner) if err != nil { return } @@ -42989,15 +49094,7 @@ func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalReservedIPTarget) if err != nil { return } @@ -43005,29 +49102,29 @@ func UnmarshalPublicGateway(m map[string]json.RawMessage, result interface{}) (e return } -// PublicGatewayCollection : PublicGatewayCollection struct -type PublicGatewayCollection struct { +// ReservedIPCollection : ReservedIPCollection struct +type ReservedIPCollection struct { // A link to the first page of resources. - First *PublicGatewayCollectionFirst `json:"first" validate:"required"` + First *ReservedIPCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *PublicGatewayCollectionNext `json:"next,omitempty"` + Next *ReservedIPCollectionNext `json:"next,omitempty"` - // Collection of public gateways. - PublicGateways []PublicGateway `json:"public_gateways" validate:"required"` + // Collection of reserved IPs in this subnet. + ReservedIps []ReservedIP `json:"reserved_ips" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalPublicGatewayCollection unmarshals an instance of PublicGatewayCollection from the specified map of raw messages. -func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPublicGatewayCollectionFirst) +// UnmarshalReservedIPCollection unmarshals an instance of ReservedIPCollection from the specified map of raw messages. +func UnmarshalReservedIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionFirst) if err != nil { return } @@ -43035,11 +49132,11 @@ func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPublicGatewayCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "public_gateways", &obj.PublicGateways, UnmarshalPublicGateway) + err = core.UnmarshalModel(m, "reserved_ips", &obj.ReservedIps, UnmarshalReservedIP) if err != nil { return } @@ -43052,7 +49149,7 @@ func UnmarshalPublicGatewayCollection(m map[string]json.RawMessage, result inter } // Retrieve the value to be passed to a request to access the next page of results -func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { +func (resp *ReservedIPCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -43063,86 +49160,45 @@ func (resp *PublicGatewayCollection) GetNextStart() (*string, error) { return start, nil } -// PublicGatewayCollectionFirst : A link to the first page of resources. -type PublicGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalPublicGatewayCollectionFirst unmarshals an instance of PublicGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalPublicGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type PublicGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalPublicGatewayCollectionNext unmarshals an instance of PublicGatewayCollectionNext from the specified map of raw messages. -func UnmarshalPublicGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PublicGatewayFloatingIP : The floating IP bound to this public gateway. -type PublicGatewayFloatingIP struct { - // The globally unique IP address. - Address *string `json:"address" validate:"required"` - - // The CRN for this floating IP. - CRN *string `json:"crn" validate:"required"` +// ReservedIPCollectionEndpointGatewayContext : ReservedIPCollectionEndpointGatewayContext struct +type ReservedIPCollectionEndpointGatewayContext struct { + // A link to the first page of resources. + First *ReservedIPCollectionEndpointGatewayContextFirst `json:"first" validate:"required"` - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *FloatingIPReferenceDeleted `json:"deleted,omitempty"` + // Collection of reserved IPs bound to an endpoint gateway. + Ips []ReservedIP `json:"ips" validate:"required"` - // The URL for this floating IP. - Href *string `json:"href" validate:"required"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The unique identifier for this floating IP. - ID *string `json:"id" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservedIPCollectionEndpointGatewayContextNext `json:"next,omitempty"` - // The unique user-defined name for this floating IP. - Name *string `json:"name" validate:"required"` + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalPublicGatewayFloatingIP unmarshals an instance of PublicGatewayFloatingIP from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalReservedIPCollectionEndpointGatewayContext unmarshals an instance of ReservedIPCollectionEndpointGatewayContext from the specified map of raw messages. +func UnmarshalReservedIPCollectionEndpointGatewayContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionEndpointGatewayContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionEndpointGatewayContextFirst) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalFloatingIPReferenceDeleted) + err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionEndpointGatewayContextNext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -43150,64 +49206,45 @@ func UnmarshalPublicGatewayFloatingIP(m map[string]json.RawMessage, result inter return } -// PublicGatewayFloatingIPPrototype : PublicGatewayFloatingIPPrototype struct -// Models which "extend" this model: -// - PublicGatewayFloatingIPPrototypeFloatingIPIdentity -// - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext -type PublicGatewayFloatingIPPrototype struct { - // The unique identifier for this floating IP. - ID *string `json:"id,omitempty"` - - // The CRN for this floating IP. - CRN *string `json:"crn,omitempty"` - - // The URL for this floating IP. - Href *string `json:"href,omitempty"` - - // The globally unique IP address. - Address *string `json:"address,omitempty"` - - // The unique user-defined name for this floating IP. If unspecified, the name will be a hyphenated list of - // randomly-selected words. - Name *string `json:"name,omitempty"` - - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -} - -func (*PublicGatewayFloatingIPPrototype) isaPublicGatewayFloatingIPPrototype() bool { - return true +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservedIPCollectionEndpointGatewayContext) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -type PublicGatewayFloatingIPPrototypeIntf interface { - isaPublicGatewayFloatingIPPrototype() bool +// ReservedIPCollectionEndpointGatewayContextFirst : A link to the first page of resources. +type ReservedIPCollectionEndpointGatewayContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalPublicGatewayFloatingIPPrototype unmarshals an instance of PublicGatewayFloatingIPPrototype from the specified map of raw messages. -func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayFloatingIPPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } +// UnmarshalReservedIPCollectionEndpointGatewayContextFirst unmarshals an instance of ReservedIPCollectionEndpointGatewayContextFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionEndpointGatewayContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionEndpointGatewayContextFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservedIPCollectionEndpointGatewayContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionEndpointGatewayContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservedIPCollectionEndpointGatewayContextNext unmarshals an instance of ReservedIPCollectionEndpointGatewayContextNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionEndpointGatewayContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionEndpointGatewayContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -43215,41 +49252,32 @@ func UnmarshalPublicGatewayFloatingIPPrototype(m map[string]json.RawMessage, res return } -// PublicGatewayIdentity : Identifies a public gateway by a unique property. -// Models which "extend" this model: -// - PublicGatewayIdentityPublicGatewayIdentityByID -// - PublicGatewayIdentityPublicGatewayIdentityByCRN -// - PublicGatewayIdentityPublicGatewayIdentityByHref -type PublicGatewayIdentity struct { - // The unique identifier for this public gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this public gateway. - Href *string `json:"href,omitempty"` +// ReservedIPCollectionFirst : A link to the first page of resources. +type ReservedIPCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -func (*PublicGatewayIdentity) isaPublicGatewayIdentity() bool { - return true +// UnmarshalReservedIPCollectionFirst unmarshals an instance of ReservedIPCollectionFirst from the specified map of raw messages. +func UnmarshalReservedIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type PublicGatewayIdentityIntf interface { - isaPublicGatewayIdentity() bool +// ReservedIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservedIPCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// UnmarshalPublicGatewayIdentity unmarshals an instance of PublicGatewayIdentity from the specified map of raw messages. -func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } +// UnmarshalReservedIPCollectionNext unmarshals an instance of ReservedIPCollectionNext from the specified map of raw messages. +func UnmarshalReservedIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -43258,15 +49286,24 @@ func UnmarshalPublicGatewayIdentity(m map[string]json.RawMessage, result interfa return } -// PublicGatewayPatch : PublicGatewayPatch struct -type PublicGatewayPatch struct { - // The user-defined name for this public gateway. Names must be unique within the VPC the public gateway resides in. +// ReservedIPPatch : ReservedIPPatch struct +type ReservedIPPatch struct { + // Indicates whether this reserved IP member will be automatically deleted when either + // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. + AutoDelete *bool `json:"auto_delete,omitempty"` + + // The user-defined name for this reserved IP. Names must be unique within the subnet the reserved IP resides in. Names + // beginning with `ibm-` are reserved for provider-owned resources. Name *string `json:"name,omitempty"` } -// UnmarshalPublicGatewayPatch unmarshals an instance of PublicGatewayPatch from the specified map of raw messages. -func UnmarshalPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayPatch) +// UnmarshalReservedIPPatch unmarshals an instance of ReservedIPPatch from the specified map of raw messages. +func UnmarshalReservedIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPPatch) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -43275,52 +49312,58 @@ func UnmarshalPublicGatewayPatch(m map[string]json.RawMessage, result interface{ return } -// AsPatch returns a generic map representation of the PublicGatewayPatch -func (publicGatewayPatch *PublicGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the ReservedIPPatch +func (reservedIPPatch *ReservedIPPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(publicGatewayPatch) + jsonData, err = json.Marshal(reservedIPPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// PublicGatewayReference : PublicGatewayReference struct -type PublicGatewayReference struct { - // The CRN for this public gateway. - CRN *string `json:"crn" validate:"required"` +// ReservedIPReference : ReservedIPReference struct +type ReservedIPReference struct { + // The IP address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address" validate:"required"` // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *PublicGatewayReferenceDeleted `json:"deleted,omitempty"` + Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` - // The URL for this public gateway. + // The URL for this reserved IP. Href *string `json:"href" validate:"required"` - // The unique identifier for this public gateway. + // The unique identifier for this reserved IP. ID *string `json:"id" validate:"required"` - // The user-defined name for this public gateway. + // The user-defined or system-provided name for this reserved IP. Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the PublicGatewayReference.ResourceType property. +// Constants associated with the ReservedIPReference.ResourceType property. // The resource type. const ( - PublicGatewayReferenceResourceTypePublicGatewayConst = "public_gateway" + ReservedIPReferenceResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) -// UnmarshalPublicGatewayReference unmarshals an instance of PublicGatewayReference from the specified map of raw messages. -func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalReservedIPReference unmarshals an instance of ReservedIPReference from the specified map of raw messages. +func UnmarshalReservedIPReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPReference) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalPublicGatewayReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) if err != nil { return } @@ -43344,16 +49387,16 @@ func UnmarshalPublicGatewayReference(m map[string]json.RawMessage, result interf return } -// PublicGatewayReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// ReservedIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type PublicGatewayReferenceDeleted struct { +type ReservedIPReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalPublicGatewayReferenceDeleted unmarshals an instance of PublicGatewayReferenceDeleted from the specified map of raw messages. -func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PublicGatewayReferenceDeleted) +// UnmarshalReservedIPReferenceDeleted unmarshals an instance of ReservedIPReferenceDeleted from the specified map of raw messages. +func UnmarshalReservedIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -43362,32 +49405,52 @@ func UnmarshalPublicGatewayReferenceDeleted(m map[string]json.RawMessage, result return } -// Region : Region struct -type Region struct { - // The API endpoint for this region. - Endpoint *string `json:"endpoint" validate:"required"` +// ReservedIPTarget : The target of this reserved IP. +// Models which "extend" this model: +// - ReservedIPTargetEndpointGatewayReference +type ReservedIPTarget struct { + // The CRN for this endpoint gateway. + CRN *string `json:"crn,omitempty"` - // The URL for this region. - Href *string `json:"href" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` - // The globally unique name for this region. - Name *string `json:"name" validate:"required"` + // The URL for this endpoint gateway. + Href *string `json:"href,omitempty"` - // The availability status of this region. - Status *string `json:"status" validate:"required"` + // The unique identifier for this endpoint gateway. + ID *string `json:"id,omitempty"` + + // The unique user-defined name for this endpoint gateway. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// Constants associated with the Region.Status property. -// The availability status of this region. +// Constants associated with the ReservedIPTarget.ResourceType property. +// The resource type. const ( - RegionStatusAvailableConst = "available" - RegionStatusUnavailableConst = "unavailable" + ReservedIPTargetResourceTypeEndpointGatewayConst = "endpoint_gateway" ) -// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. -func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Region) - err = core.UnmarshalPrimitive(m, "endpoint", &obj.Endpoint) +func (*ReservedIPTarget) isaReservedIPTarget() bool { + return true +} + +type ReservedIPTargetIntf interface { + isaReservedIPTarget() bool +} + +// UnmarshalReservedIPTarget unmarshals an instance of ReservedIPTarget from the specified map of raw messages. +func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) if err != nil { return } @@ -43395,11 +49458,15 @@ func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err erro if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -43407,16 +49474,41 @@ func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err erro return } -// RegionCollection : RegionCollection struct -type RegionCollection struct { - // Collection of regions. - Regions []Region `json:"regions" validate:"required"` +// ReservedIPTargetPrototype : The target this reserved IP is to be bound to. The target must be an endpoint gateway not already bound to a reserved +// IP in the subnet's zone. +// Models which "extend" this model: +// - ReservedIPTargetPrototypeEndpointGatewayIdentity +type ReservedIPTargetPrototype struct { + // The unique identifier for this endpoint gateway. + ID *string `json:"id,omitempty"` + + // The CRN for this endpoint gateway. + CRN *string `json:"crn,omitempty"` + + // The URL for this endpoint gateway. + Href *string `json:"href,omitempty"` } -// UnmarshalRegionCollection unmarshals an instance of RegionCollection from the specified map of raw messages. -func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionCollection) - err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) +func (*ReservedIPTargetPrototype) isaReservedIPTargetPrototype() bool { + return true +} + +type ReservedIPTargetPrototypeIntf interface { + isaReservedIPTargetPrototype() bool +} + +// UnmarshalReservedIPTargetPrototype unmarshals an instance of ReservedIPTargetPrototype from the specified map of raw messages. +func UnmarshalReservedIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservedIPTargetPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -43424,22 +49516,57 @@ func UnmarshalRegionCollection(m map[string]json.RawMessage, result interface{}) return } -// RegionReference : RegionReference struct -type RegionReference struct { - // The URL for this region. +// ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource +// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. +// Models which "extend" this model: +// - ResourceGroupIdentityByID +type ResourceGroupIdentity struct { + // The unique identifier for this resource group. + ID *string `json:"id,omitempty"` +} + +func (*ResourceGroupIdentity) isaResourceGroupIdentity() bool { + return true +} + +type ResourceGroupIdentityIntf interface { + isaResourceGroupIdentity() bool +} + +// UnmarshalResourceGroupIdentity unmarshals an instance of ResourceGroupIdentity from the specified map of raw messages. +func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ResourceGroupReference : ResourceGroupReference struct +type ResourceGroupReference struct { + // The URL for this resource group. Href *string `json:"href" validate:"required"` - // The globally unique name for this region. + // The unique identifier for this resource group. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this resource group. Name *string `json:"name" validate:"required"` } -// UnmarshalRegionReference unmarshals an instance of RegionReference from the specified map of raw messages. -func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RegionReference) +// UnmarshalResourceGroupReference unmarshals an instance of ResourceGroupReference from the specified map of raw messages. +func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceGroupReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -43448,431 +49575,593 @@ func UnmarshalRegionReference(m map[string]json.RawMessage, result interface{}) return } -// RemoveEndpointGatewayIPOptions : The RemoveEndpointGatewayIP options. -type RemoveEndpointGatewayIPOptions struct { - // The endpoint gateway identifier. - EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` - - // The reserved IP identifier. +// RestartBareMetalServerOptions : The RestartBareMetalServer options. +type RestartBareMetalServerOptions struct { + // The bare metal server identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } -// NewRemoveEndpointGatewayIPOptions : Instantiate RemoveEndpointGatewayIPOptions -func (*VpcV1) NewRemoveEndpointGatewayIPOptions(endpointGatewayID string, id string) *RemoveEndpointGatewayIPOptions { - return &RemoveEndpointGatewayIPOptions{ - EndpointGatewayID: core.StringPtr(endpointGatewayID), - ID: core.StringPtr(id), +// NewRestartBareMetalServerOptions : Instantiate RestartBareMetalServerOptions +func (*VpcV1) NewRestartBareMetalServerOptions(id string) *RestartBareMetalServerOptions { + return &RestartBareMetalServerOptions{ + ID: core.StringPtr(id), } } -// SetEndpointGatewayID : Allow user to set EndpointGatewayID -func (_options *RemoveEndpointGatewayIPOptions) SetEndpointGatewayID(endpointGatewayID string) *RemoveEndpointGatewayIPOptions { - _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) - return _options -} - // SetID : Allow user to set ID -func (_options *RemoveEndpointGatewayIPOptions) SetID(id string) *RemoveEndpointGatewayIPOptions { +func (_options *RestartBareMetalServerOptions) SetID(id string) *RestartBareMetalServerOptions { _options.ID = core.StringPtr(id) return _options } // SetHeaders : Allow user to set Headers -func (options *RemoveEndpointGatewayIPOptions) SetHeaders(param map[string]string) *RemoveEndpointGatewayIPOptions { +func (options *RestartBareMetalServerOptions) SetHeaders(param map[string]string) *RestartBareMetalServerOptions { options.Headers = param return options } -// RemoveInstanceNetworkInterfaceFloatingIPOptions : The RemoveInstanceNetworkInterfaceFloatingIP options. -type RemoveInstanceNetworkInterfaceFloatingIPOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// Route : Route struct +type Route struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to the system's built-in routes + // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound + // routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` - // The network interface identifier. - NetworkInterfaceID *string `json:"network_interface_id" validate:"required,ne="` + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The floating IP identifier. - ID *string `json:"id" validate:"required,ne="` + // The destination of the route. + Destination *string `json:"destination" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The URL for this route. + Href *string `json:"href" validate:"required"` -// NewRemoveInstanceNetworkInterfaceFloatingIPOptions : Instantiate RemoveInstanceNetworkInterfaceFloatingIPOptions -func (*VpcV1) NewRemoveInstanceNetworkInterfaceFloatingIPOptions(instanceID string, networkInterfaceID string, id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - return &RemoveInstanceNetworkInterfaceFloatingIPOptions{ - InstanceID: core.StringPtr(instanceID), - NetworkInterfaceID: core.StringPtr(networkInterfaceID), - ID: core.StringPtr(id), - } -} + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` -// SetInstanceID : Allow user to set InstanceID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetInstanceID(instanceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` -// SetNetworkInterfaceID : Allow user to set NetworkInterfaceID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetNetworkInterfaceID(networkInterfaceID string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.NetworkInterfaceID = core.StringPtr(networkInterfaceID) - return _options -} + // The user-defined name for this route. + Name *string `json:"name" validate:"required"` -// SetID : Allow user to set ID -func (_options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetID(id string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - _options.ID = core.StringPtr(id) - return _options -} + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *RemoveInstanceNetworkInterfaceFloatingIPOptions) SetHeaders(param map[string]string) *RemoveInstanceNetworkInterfaceFloatingIPOptions { - options.Headers = param - return options + // The zone the route applies to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone *ZoneReference `json:"zone" validate:"required"` } -// RemoveSecurityGroupNetworkInterfaceOptions : The RemoveSecurityGroupNetworkInterface options. -type RemoveSecurityGroupNetworkInterfaceOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The network interface identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the Route.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to the system's built-in routes +// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound +// routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + RouteActionDelegateConst = "delegate" + RouteActionDelegateVPCConst = "delegate_vpc" + RouteActionDeliverConst = "deliver" + RouteActionDropConst = "drop" +) - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the Route.LifecycleState property. +// The lifecycle state of the route. +const ( + RouteLifecycleStateDeletingConst = "deleting" + RouteLifecycleStateFailedConst = "failed" + RouteLifecycleStatePendingConst = "pending" + RouteLifecycleStateStableConst = "stable" + RouteLifecycleStateSuspendedConst = "suspended" + RouteLifecycleStateUpdatingConst = "updating" + RouteLifecycleStateWaitingConst = "waiting" +) -// NewRemoveSecurityGroupNetworkInterfaceOptions : Instantiate RemoveSecurityGroupNetworkInterfaceOptions -func (*VpcV1) NewRemoveSecurityGroupNetworkInterfaceOptions(securityGroupID string, id string) *RemoveSecurityGroupNetworkInterfaceOptions { - return &RemoveSecurityGroupNetworkInterfaceOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), +// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. +func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Route) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *RemoveSecurityGroupNetworkInterfaceOptions) SetSecurityGroupID(securityGroupID string) *RemoveSecurityGroupNetworkInterfaceOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *RemoveSecurityGroupNetworkInterfaceOptions) SetID(id string) *RemoveSecurityGroupNetworkInterfaceOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *RemoveSecurityGroupNetworkInterfaceOptions) SetHeaders(param map[string]string) *RemoveSecurityGroupNetworkInterfaceOptions { - options.Headers = param - return options -} - -// RemoveVPNGatewayConnectionLocalCIDROptions : The RemoveVPNGatewayConnectionLocalCIDR options. -type RemoveVPNGatewayConnectionLocalCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// RouteCollection : RouteCollection struct +type RouteCollection struct { + // A link to the first page of resources. + First *RouteCollectionFirst `json:"first" validate:"required"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *RouteCollectionNext `json:"next,omitempty"` - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + // Collection of routes. + Routes []Route `json:"routes" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// NewRemoveVPNGatewayConnectionLocalCIDROptions : Instantiate RemoveVPNGatewayConnectionLocalCIDROptions -func (*VpcV1) NewRemoveVPNGatewayConnectionLocalCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { - return &RemoveVPNGatewayConnectionLocalCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), +// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. +func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RouteCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetID : Allow user to set ID -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.ID = core.StringPtr(id) - return _options +// RouteCollectionFirst : A link to the first page of resources. +type RouteCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. +func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *RemoveVPNGatewayConnectionLocalCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionLocalCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options +// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type RouteCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *RemoveVPNGatewayConnectionLocalCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionLocalCIDROptions { - options.Headers = param - return options +// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. +func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// RemoveVPNGatewayConnectionPeerCIDROptions : The RemoveVPNGatewayConnectionPeerCIDR options. -type RemoveVPNGatewayConnectionPeerCIDROptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// RouteNextHop : RouteNextHop struct +// Models which "extend" this model: +// - RouteNextHopIP +// - RouteNextHopVPNGatewayConnectionReference +type RouteNextHop struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - // The address prefix part of the CIDR. - CIDRPrefix *string `json:"cidr_prefix" validate:"required,ne="` + // The VPN connection's canonical URL. + Href *string `json:"href,omitempty"` - // The prefix length part of the CIDR. - PrefixLength *string `json:"prefix_length" validate:"required,ne="` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The user-defined name for this VPN connection. + Name *string `json:"name,omitempty"` -// NewRemoveVPNGatewayConnectionPeerCIDROptions : Instantiate RemoveVPNGatewayConnectionPeerCIDROptions -func (*VpcV1) NewRemoveVPNGatewayConnectionPeerCIDROptions(vpnGatewayID string, id string, cidrPrefix string, prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { - return &RemoveVPNGatewayConnectionPeerCIDROptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - CIDRPrefix: core.StringPtr(cidrPrefix), - PrefixLength: core.StringPtr(prefixLength), - } + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} +// Constants associated with the RouteNextHop.ResourceType property. +// The resource type. +const ( + RouteNextHopResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) -// SetID : Allow user to set ID -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetID(id string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.ID = core.StringPtr(id) - return _options +func (*RouteNextHop) isaRouteNextHop() bool { + return true } -// SetCIDRPrefix : Allow user to set CIDRPrefix -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetCIDRPrefix(cidrPrefix string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.CIDRPrefix = core.StringPtr(cidrPrefix) - return _options +type RouteNextHopIntf interface { + isaRouteNextHop() bool } -// SetPrefixLength : Allow user to set PrefixLength -func (_options *RemoveVPNGatewayConnectionPeerCIDROptions) SetPrefixLength(prefixLength string) *RemoveVPNGatewayConnectionPeerCIDROptions { - _options.PrefixLength = core.StringPtr(prefixLength) - return _options +// UnmarshalRouteNextHop unmarshals an instance of RouteNextHop from the specified map of raw messages. +func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHop) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *RemoveVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayConnectionPeerCIDROptions { - options.Headers = param - return options -} +// RouteNextHopPrototype : The next hop packets will be routed to. +// Models which "extend" this model: +// - RouteNextHopPrototypeRouteNextHopIP +// - RouteNextHopPrototypeVPNGatewayConnectionIdentity +type RouteNextHopPrototype struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` -// ReplaceLoadBalancerPoolMembersOptions : The ReplaceLoadBalancerPoolMembers options. -type ReplaceLoadBalancerPoolMembersOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id,omitempty"` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // The VPN connection's canonical URL. + Href *string `json:"href,omitempty"` +} - // The member prototype objects for this pool. - Members []LoadBalancerPoolMemberPrototype `json:"members" validate:"required"` +func (*RouteNextHopPrototype) isaRouteNextHopPrototype() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type RouteNextHopPrototypeIntf interface { + isaRouteNextHopPrototype() bool } -// NewReplaceLoadBalancerPoolMembersOptions : Instantiate ReplaceLoadBalancerPoolMembersOptions -func (*VpcV1) NewReplaceLoadBalancerPoolMembersOptions(loadBalancerID string, poolID string, members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { - return &ReplaceLoadBalancerPoolMembersOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - Members: members, +// UnmarshalRouteNextHopPrototype unmarshals an instance of RouteNextHopPrototype from the specified map of raw messages. +func UnmarshalRouteNextHopPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteNextHopPrototype) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetLoadBalancerID(loadBalancerID string) *ReplaceLoadBalancerPoolMembersOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// RoutePatch : RoutePatch struct +type RoutePatch struct { + // The user-defined name for this route. Names must be unique within the VPC routing table the route resides in. + Name *string `json:"name,omitempty"` } -// SetPoolID : Allow user to set PoolID -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetPoolID(poolID string) *ReplaceLoadBalancerPoolMembersOptions { - _options.PoolID = core.StringPtr(poolID) - return _options +// UnmarshalRoutePatch unmarshals an instance of RoutePatch from the specified map of raw messages. +func UnmarshalRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetMembers : Allow user to set Members -func (_options *ReplaceLoadBalancerPoolMembersOptions) SetMembers(members []LoadBalancerPoolMemberPrototype) *ReplaceLoadBalancerPoolMembersOptions { - _options.Members = members - return _options +// AsPatch returns a generic map representation of the RoutePatch +func (routePatch *RoutePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(routePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ReplaceLoadBalancerPoolMembersOptions) SetHeaders(param map[string]string) *ReplaceLoadBalancerPoolMembersOptions { - options.Headers = param - return options -} +// RoutePrototype : RoutePrototype struct +type RoutePrototype struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to the system's built-in routes + // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound + // routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action,omitempty"` -// ReplaceSubnetNetworkACLOptions : The ReplaceSubnetNetworkACL options. -type ReplaceSubnetNetworkACLOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` + // The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if + // both routes have an `action` of `deliver` and the + // `next_hop` is an IP address. + Destination *string `json:"destination" validate:"required"` - // The network ACL identity. - NetworkACLIdentity NetworkACLIdentityIntf `json:"NetworkACLIdentity" validate:"required"` + // The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. + // Names must be unique within the VPC routing table the route resides in. + Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, it must be omitted or specified as `0.0.0.0`. + NextHop RouteNextHopPrototypeIntf `json:"next_hop,omitempty"` -// NewReplaceSubnetNetworkACLOptions : Instantiate ReplaceSubnetNetworkACLOptions -func (*VpcV1) NewReplaceSubnetNetworkACLOptions(id string, networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { - return &ReplaceSubnetNetworkACLOptions{ - ID: core.StringPtr(id), - NetworkACLIdentity: networkACLIdentity, - } + // The zone to apply the route to. (Traffic from subnets in this zone will be + // subject to this route.). + Zone ZoneIdentityIntf `json:"zone" validate:"required"` } -// SetID : Allow user to set ID -func (_options *ReplaceSubnetNetworkACLOptions) SetID(id string) *ReplaceSubnetNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the RoutePrototype.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to the system's built-in routes +// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound +// routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + RoutePrototypeActionDelegateConst = "delegate" + RoutePrototypeActionDelegateVPCConst = "delegate_vpc" + RoutePrototypeActionDeliverConst = "deliver" + RoutePrototypeActionDropConst = "drop" +) -// SetNetworkACLIdentity : Allow user to set NetworkACLIdentity -func (_options *ReplaceSubnetNetworkACLOptions) SetNetworkACLIdentity(networkACLIdentity NetworkACLIdentityIntf) *ReplaceSubnetNetworkACLOptions { - _options.NetworkACLIdentity = networkACLIdentity - return _options +// NewRoutePrototype : Instantiate RoutePrototype (Generic Model Constructor) +func (*VpcV1) NewRoutePrototype(destination string, zone ZoneIdentityIntf) (_model *RoutePrototype, err error) { + _model = &RoutePrototype{ + Destination: core.StringPtr(destination), + Zone: zone, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// SetHeaders : Allow user to set Headers -func (options *ReplaceSubnetNetworkACLOptions) SetHeaders(param map[string]string) *ReplaceSubnetNetworkACLOptions { - options.Headers = param - return options +// UnmarshalRoutePrototype unmarshals an instance of RoutePrototype from the specified map of raw messages. +func UnmarshalRoutePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutePrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHopPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ReplaceSubnetRoutingTableOptions : The ReplaceSubnetRoutingTable options. -type ReplaceSubnetRoutingTableOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` +// RouteReference : RouteReference struct +type RouteReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *RouteReferenceDeleted `json:"deleted,omitempty"` - // The routing table identity. - RoutingTableIdentity RoutingTableIdentityIntf `json:"RoutingTableIdentity" validate:"required"` + // The URL for this route. + Href *string `json:"href" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` -// NewReplaceSubnetRoutingTableOptions : Instantiate ReplaceSubnetRoutingTableOptions -func (*VpcV1) NewReplaceSubnetRoutingTableOptions(id string, routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { - return &ReplaceSubnetRoutingTableOptions{ - ID: core.StringPtr(id), - RoutingTableIdentity: routingTableIdentity, - } + // The user-defined name for this route. + Name *string `json:"name" validate:"required"` } -// SetID : Allow user to set ID -func (_options *ReplaceSubnetRoutingTableOptions) SetID(id string) *ReplaceSubnetRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalRouteReference unmarshals an instance of RouteReference from the specified map of raw messages. +func UnmarshalRouteReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRouteReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRoutingTableIdentity : Allow user to set RoutingTableIdentity -func (_options *ReplaceSubnetRoutingTableOptions) SetRoutingTableIdentity(routingTableIdentity RoutingTableIdentityIntf) *ReplaceSubnetRoutingTableOptions { - _options.RoutingTableIdentity = routingTableIdentity - return _options +// RouteReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type RouteReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]string) *ReplaceSubnetRoutingTableOptions { - options.Headers = param - return options +// UnmarshalRouteReferenceDeleted unmarshals an instance of RouteReferenceDeleted from the specified map of raw messages. +func UnmarshalRouteReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ReservedIP : ReservedIP struct -type ReservedIP struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete" validate:"required"` - - // The date and time that the reserved IP was created. +// RoutingTable : RoutingTable struct +type RoutingTable struct { + // The date and time that this routing table was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The URL for this reserved IP. + // The URL for this routing table. Href *string `json:"href" validate:"required"` - // The unique identifier for this reserved IP. + // The unique identifier for this routing table. ID *string `json:"id" validate:"required"` - // The user-defined or system-provided name for this reserved IP. - Name *string `json:"name" validate:"required"` + // Indicates whether this is the default routing table for this VPC. + IsDefault *bool `json:"is_default" validate:"required"` - // The owner of a reserved IP, defining whether it is managed by the user or the provider. - Owner *string `json:"owner" validate:"required"` + // The lifecycle state of the routing table. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The user-defined name for this routing table. + Name *string `json:"name" validate:"required"` // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - // The target of this reserved IP. - Target ReservedIPTargetIntf `json:"target,omitempty"` + // Indicates whether this routing table is used to route traffic that originates from + // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from from [Transit + // Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` + + // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this + // VPC. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` + + // The routes for this routing table. + Routes []RouteReference `json:"routes" validate:"required"` + + // The subnets to which this routing table is attached. + Subnets []SubnetReference `json:"subnets" validate:"required"` } -// Constants associated with the ReservedIP.Owner property. -// The owner of a reserved IP, defining whether it is managed by the user or the provider. +// Constants associated with the RoutingTable.LifecycleState property. +// The lifecycle state of the routing table. const ( - ReservedIPOwnerProviderConst = "provider" - ReservedIPOwnerUserConst = "user" + RoutingTableLifecycleStateDeletingConst = "deleting" + RoutingTableLifecycleStateFailedConst = "failed" + RoutingTableLifecycleStatePendingConst = "pending" + RoutingTableLifecycleStateStableConst = "stable" + RoutingTableLifecycleStateSuspendedConst = "suspended" + RoutingTableLifecycleStateUpdatingConst = "updating" + RoutingTableLifecycleStateWaitingConst = "waiting" ) -// Constants associated with the ReservedIP.ResourceType property. +// Constants associated with the RoutingTable.ResourceType property. // The resource type. const ( - ReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" + RoutingTableResourceTypeRoutingTableConst = "routing_table" ) -// UnmarshalReservedIP unmarshals an instance of ReservedIP from the specified map of raw messages. -func UnmarshalReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) - if err != nil { - return - } +// UnmarshalRoutingTable unmarshals an instance of RoutingTable from the specified map of raw messages. +func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTable) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -43885,65 +50174,39 @@ func UnmarshalReservedIP(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) if err != nil { return } - err = core.UnmarshalPrimitive(m, "owner", &obj.Owner) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalReservedIPTarget) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReservedIPCollection : ReservedIPCollection struct -type ReservedIPCollection struct { - // A link to the first page of resources. - First *ReservedIPCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *ReservedIPCollectionNext `json:"next,omitempty"` - - // Collection of reserved IPs in this subnet. - ReservedIps []ReservedIP `json:"reserved_ips" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalReservedIPCollection unmarshals an instance of ReservedIPCollection from the specified map of raw messages. -func UnmarshalReservedIPCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionFirst) + err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionNext) + err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) if err != nil { return } - err = core.UnmarshalModel(m, "reserved_ips", &obj.ReservedIps, UnmarshalReservedIP) + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) if err != nil { return } @@ -43951,53 +50214,41 @@ func UnmarshalReservedIPCollection(m map[string]json.RawMessage, result interfac return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// ReservedIPCollectionEndpointGatewayContext : ReservedIPCollectionEndpointGatewayContext struct -type ReservedIPCollectionEndpointGatewayContext struct { +// RoutingTableCollection : RoutingTableCollection struct +type RoutingTableCollection struct { // A link to the first page of resources. - First *ReservedIPCollectionEndpointGatewayContextFirst `json:"first" validate:"required"` - - // Collection of reserved IPs bound to an endpoint gateway. - Ips []ReservedIP `json:"ips" validate:"required"` + First *RoutingTableCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *ReservedIPCollectionEndpointGatewayContextNext `json:"next,omitempty"` + Next *RoutingTableCollectionNext `json:"next,omitempty"` + + // Collection of routing tables. + RoutingTables []RoutingTable `json:"routing_tables" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalReservedIPCollectionEndpointGatewayContext unmarshals an instance of ReservedIPCollectionEndpointGatewayContext from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservedIPCollectionEndpointGatewayContextFirst) +// UnmarshalRoutingTableCollection unmarshals an instance of RoutingTableCollection from the specified map of raw messages. +func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRoutingTableCollectionFirst) if err != nil { return } - err = core.UnmarshalModel(m, "ips", &obj.Ips, UnmarshalReservedIP) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRoutingTableCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservedIPCollectionEndpointGatewayContextNext) + err = core.UnmarshalModel(m, "routing_tables", &obj.RoutingTables, UnmarshalRoutingTable) if err != nil { return } @@ -44010,7 +50261,7 @@ func UnmarshalReservedIPCollectionEndpointGatewayContext(m map[string]json.RawMe } // Retrieve the value to be passed to a request to access the next page of results -func (resp *ReservedIPCollectionEndpointGatewayContext) GetNextStart() (*string, error) { +func (resp *RoutingTableCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -44021,15 +50272,15 @@ func (resp *ReservedIPCollectionEndpointGatewayContext) GetNextStart() (*string, return start, nil } -// ReservedIPCollectionEndpointGatewayContextFirst : A link to the first page of resources. -type ReservedIPCollectionEndpointGatewayContextFirst struct { +// RoutingTableCollectionFirst : A link to the first page of resources. +type RoutingTableCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalReservedIPCollectionEndpointGatewayContextFirst unmarshals an instance of ReservedIPCollectionEndpointGatewayContextFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContextFirst) +// UnmarshalRoutingTableCollectionFirst unmarshals an instance of RoutingTableCollectionFirst from the specified map of raw messages. +func UnmarshalRoutingTableCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -44038,15 +50289,15 @@ func UnmarshalReservedIPCollectionEndpointGatewayContextFirst(m map[string]json. return } -// ReservedIPCollectionEndpointGatewayContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionEndpointGatewayContextNext struct { +// RoutingTableCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type RoutingTableCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalReservedIPCollectionEndpointGatewayContextNext unmarshals an instance of ReservedIPCollectionEndpointGatewayContextNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionEndpointGatewayContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionEndpointGatewayContextNext) +// UnmarshalRoutingTableCollectionNext unmarshals an instance of RoutingTableCollectionNext from the specified map of raw messages. +func UnmarshalRoutingTableCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -44055,59 +50306,34 @@ func UnmarshalReservedIPCollectionEndpointGatewayContextNext(m map[string]json.R return } -// ReservedIPCollectionFirst : A link to the first page of resources. -type ReservedIPCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalReservedIPCollectionFirst unmarshals an instance of ReservedIPCollectionFirst from the specified map of raw messages. -func UnmarshalReservedIPCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} +// RoutingTableIdentity : Identifies a routing table by a unique property. +// Models which "extend" this model: +// - RoutingTableIdentityByID +// - RoutingTableIdentityByHref +type RoutingTableIdentity struct { + // The unique identifier for this routing table. + ID *string `json:"id,omitempty"` -// ReservedIPCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type ReservedIPCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` + // The URL for this routing table. + Href *string `json:"href,omitempty"` } -// UnmarshalReservedIPCollectionNext unmarshals an instance of ReservedIPCollectionNext from the specified map of raw messages. -func UnmarshalReservedIPCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +func (*RoutingTableIdentity) isaRoutingTableIdentity() bool { + return true } -// ReservedIPPatch : ReservedIPPatch struct -type ReservedIPPatch struct { - // Indicates whether this reserved IP member will be automatically deleted when either - // `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - AutoDelete *bool `json:"auto_delete,omitempty"` - - // The user-defined name for this reserved IP. Names must be unique within the subnet the reserved IP resides in. Names - // beginning with `ibm-` are reserved for provider-owned resources. - Name *string `json:"name,omitempty"` +type RoutingTableIdentityIntf interface { + isaRoutingTableIdentity() bool } -// UnmarshalReservedIPPatch unmarshals an instance of ReservedIPPatch from the specified map of raw messages. -func UnmarshalReservedIPPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPPatch) - err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) +// UnmarshalRoutingTableIdentity unmarshals an instance of RoutingTableIdentity from the specified map of raw messages. +func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -44115,74 +50341,65 @@ func UnmarshalReservedIPPatch(m map[string]json.RawMessage, result interface{}) return } -// AsPatch returns a generic map representation of the ReservedIPPatch -func (reservedIPPatch *ReservedIPPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(reservedIPPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// RoutingTablePatch : RoutingTablePatch struct +type RoutingTablePatch struct { + // The user-defined name for this routing table. Names must be unique within the VPC the routing table resides in. + Name *string `json:"name,omitempty"` -// ReservedIPReference : ReservedIPReference struct -type ReservedIPReference struct { - // The IP address. - // - // If the address has not yet been selected, the value will be `0.0.0.0`. + // Indicates whether this routing table is used to route traffic that originates from + // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true` selects this routing table, provided + // no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this + // routing table. Updating to `false` deselects this routing table. // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *ReservedIPReferenceDeleted `json:"deleted,omitempty"` - - // The URL for this reserved IP. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this reserved IP. - ID *string `json:"id" validate:"required"` + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` - // The user-defined or system-provided name for this reserved IP. - Name *string `json:"name" validate:"required"` + // Indicates whether this routing table is used to route traffic that originates from + // [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. Updating to + // `true` selects this routing table, provided no other routing table in the VPC already has this property set to + // `true`, and no subnets are attached to this routing table. Updating to `false` deselects this routing table. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + // + // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled + // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing + // table. + RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this + // VPC. Updating to `true` selects this routing table, provided no other routing table in the VPC already has this + // property set to `true`, and no subnets are attached to this routing table. Updating to `false` deselects this + // routing table. + // + // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of + // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. + // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway + // connection, the packet will be dropped. + RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` } -// Constants associated with the ReservedIPReference.ResourceType property. -// The resource type. -const ( - ReservedIPReferenceResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" -) - -// UnmarshalReservedIPReference unmarshals an instance of ReservedIPReference from the specified map of raw messages. -func UnmarshalReservedIPReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPReference) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservedIPReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalRoutingTablePatch unmarshals an instance of RoutingTablePatch from the specified map of raw messages. +func UnmarshalRoutingTablePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTablePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) if err != nil { return } @@ -44190,70 +50407,45 @@ func UnmarshalReservedIPReference(m map[string]json.RawMessage, result interface return } -// ReservedIPReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type ReservedIPReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalReservedIPReferenceDeleted unmarshals an instance of ReservedIPReferenceDeleted from the specified map of raw messages. -func UnmarshalReservedIPReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return +// AsPatch returns a generic map representation of the RoutingTablePatch +func (routingTablePatch *RoutingTablePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(routingTablePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ReservedIPTarget : The target of this reserved IP. -// Models which "extend" this model: -// - ReservedIPTargetEndpointGatewayReference -type ReservedIPTarget struct { - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` - +// RoutingTableReference : RoutingTableReference struct +type RoutingTableReference struct { // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *EndpointGatewayReferenceDeleted `json:"deleted,omitempty"` + Deleted *RoutingTableReferenceDeleted `json:"deleted,omitempty"` - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` + // The URL for this routing table. + Href *string `json:"href" validate:"required"` - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` + // The unique identifier for this routing table. + ID *string `json:"id" validate:"required"` - // The unique user-defined name for this endpoint gateway. - Name *string `json:"name,omitempty"` + // The user-defined name for this routing table. + Name *string `json:"name" validate:"required"` // The resource type. - ResourceType *string `json:"resource_type,omitempty"` + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the ReservedIPTarget.ResourceType property. +// Constants associated with the RoutingTableReference.ResourceType property. // The resource type. const ( - ReservedIPTargetResourceTypeEndpointGatewayConst = "endpoint_gateway" + RoutingTableReferenceResourceTypeRoutingTableConst = "routing_table" ) -func (*ReservedIPTarget) isaReservedIPTarget() bool { - return true -} - -type ReservedIPTargetIntf interface { - isaReservedIPTarget() bool -} - -// UnmarshalReservedIPTarget unmarshals an instance of ReservedIPTarget from the specified map of raw messages. -func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTarget) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalEndpointGatewayReferenceDeleted) +// UnmarshalRoutingTableReference unmarshals an instance of RoutingTableReference from the specified map of raw messages. +func UnmarshalRoutingTableReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRoutingTableReferenceDeleted) if err != nil { return } @@ -44277,100 +50469,17 @@ func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) return } -// ReservedIPTargetPrototype : The target this reserved IP is to be bound to. The target must be an endpoint gateway not already bound to a reserved -// IP in the subnet's zone. -// Models which "extend" this model: -// - ReservedIPTargetPrototypeEndpointGatewayIdentity -type ReservedIPTargetPrototype struct { - // The unique identifier for this endpoint gateway. - ID *string `json:"id,omitempty"` - - // The CRN for this endpoint gateway. - CRN *string `json:"crn,omitempty"` - - // The URL for this endpoint gateway. - Href *string `json:"href,omitempty"` -} - -func (*ReservedIPTargetPrototype) isaReservedIPTargetPrototype() bool { - return true -} - -type ReservedIPTargetPrototypeIntf interface { - isaReservedIPTargetPrototype() bool -} - -// UnmarshalReservedIPTargetPrototype unmarshals an instance of ReservedIPTargetPrototype from the specified map of raw messages. -func UnmarshalReservedIPTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ReservedIPTargetPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource -// group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. -// Models which "extend" this model: -// - ResourceGroupIdentityByID -type ResourceGroupIdentity struct { - // The unique identifier for this resource group. - ID *string `json:"id,omitempty"` -} - -func (*ResourceGroupIdentity) isaResourceGroupIdentity() bool { - return true -} - -type ResourceGroupIdentityIntf interface { - isaResourceGroupIdentity() bool -} - -// UnmarshalResourceGroupIdentity unmarshals an instance of ResourceGroupIdentity from the specified map of raw messages. -func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceGroupReference : ResourceGroupReference struct -type ResourceGroupReference struct { - // The URL for this resource group. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this resource group. - ID *string `json:"id" validate:"required"` - - // The user-defined name for this resource group. - Name *string `json:"name" validate:"required"` +// RoutingTableReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type RoutingTableReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalResourceGroupReference unmarshals an instance of ResourceGroupReference from the specified map of raw messages. -func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceGroupReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalRoutingTableReferenceDeleted unmarshals an instance of RoutingTableReferenceDeleted from the specified map of raw messages. +func UnmarshalRoutingTableReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoutingTableReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -44378,81 +50487,47 @@ func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interf return } -// Route : Route struct -type Route struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to the system's built-in routes - // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - // routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // The date and time that the route was created. +// SecurityGroup : SecurityGroup struct +type SecurityGroup struct { + // The date and time that this security group was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The destination of the route. - Destination *string `json:"destination" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` - // The URL for this route. + // The security group's canonical URL. Href *string `json:"href" validate:"required"` - // The unique identifier for this route. + // The unique identifier for this security group. ID *string `json:"id" validate:"required"` - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The user-defined name for this route. + // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. Name *string `json:"name" validate:"required"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + // The network interfaces for this security group. + NetworkInterfaces []NetworkInterfaceReference `json:"network_interfaces" validate:"required"` - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` -} + // The resource group for this security group. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` -// Constants associated with the Route.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to the system's built-in routes -// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound -// routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RouteActionDelegateConst = "delegate" - RouteActionDelegateVPCConst = "delegate_vpc" - RouteActionDeliverConst = "deliver" - RouteActionDropConst = "drop" -) + // The rules for this security group. If no rules exist, all traffic will be denied. + Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` -// Constants associated with the Route.LifecycleState property. -// The lifecycle state of the route. -const ( - RouteLifecycleStateDeletingConst = "deleting" - RouteLifecycleStateFailedConst = "failed" - RouteLifecycleStatePendingConst = "pending" - RouteLifecycleStateStableConst = "stable" - RouteLifecycleStateSuspendedConst = "suspended" - RouteLifecycleStateUpdatingConst = "updating" - RouteLifecycleStateWaitingConst = "waiting" -) + // The targets for this security group. + Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` -// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. -func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Route) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } + // The VPC this security group is a part of. + VPC *VPCReference `json:"vpc" validate:"required"` +} + +// UnmarshalSecurityGroup unmarshals an instance of SecurityGroup from the specified map of raw messages. +func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroup) err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -44464,19 +50539,27 @@ func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error if err != nil { return } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceReference) if err != nil { return } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) + if err != nil { + return + } + err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { return } @@ -44484,29 +50567,29 @@ func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error return } -// RouteCollection : RouteCollection struct -type RouteCollection struct { +// SecurityGroupCollection : SecurityGroupCollection struct +type SecurityGroupCollection struct { // A link to the first page of resources. - First *RouteCollectionFirst `json:"first" validate:"required"` + First *SecurityGroupCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *RouteCollectionNext `json:"next,omitempty"` + Next *SecurityGroupCollectionNext `json:"next,omitempty"` - // Collection of routes. - Routes []Route `json:"routes" validate:"required"` + // Collection of security groups. + SecurityGroups []SecurityGroup `json:"security_groups" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. -func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) +// UnmarshalSecurityGroupCollection unmarshals an instance of SecurityGroupCollection from the specified map of raw messages. +func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupCollectionFirst) if err != nil { return } @@ -44514,11 +50597,11 @@ func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroup) if err != nil { return } @@ -44531,7 +50614,7 @@ func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) } // Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollection) GetNextStart() (*string, error) { +func (resp *SecurityGroupCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -44542,15 +50625,15 @@ func (resp *RouteCollection) GetNextStart() (*string, error) { return start, nil } -// RouteCollectionFirst : A link to the first page of resources. -type RouteCollectionFirst struct { +// SecurityGroupCollectionFirst : A link to the first page of resources. +type SecurityGroupCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. -func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionFirst) +// UnmarshalSecurityGroupCollectionFirst unmarshals an instance of SecurityGroupCollectionFirst from the specified map of raw messages. +func UnmarshalSecurityGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -44559,15 +50642,15 @@ func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interfac return } -// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionNext struct { +// SecurityGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SecurityGroupCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. -func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionNext) +// UnmarshalSecurityGroupCollectionNext unmarshals an instance of SecurityGroupCollectionNext from the specified map of raw messages. +func UnmarshalSecurityGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -44576,57 +50659,103 @@ func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface return } -// RouteNextHop : RouteNextHop struct +// SecurityGroupIdentity : Identifies a security group by a unique property. // Models which "extend" this model: -// - RouteNextHopIP -// - RouteNextHopVPNGatewayConnectionReference -type RouteNextHop struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// - SecurityGroupIdentityByID +// - SecurityGroupIdentityByCRN +// - SecurityGroupIdentityByHref +type SecurityGroupIdentity struct { + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` + // The security group's CRN. + CRN *string `json:"crn,omitempty"` - // The VPN connection's canonical URL. + // The security group's canonical URL. Href *string `json:"href,omitempty"` +} - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` +func (*SecurityGroupIdentity) isaSecurityGroupIdentity() bool { + return true +} - // The user-defined name for this VPN connection. - Name *string `json:"name,omitempty"` +type SecurityGroupIdentityIntf interface { + isaSecurityGroupIdentity() bool +} - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` +// UnmarshalSecurityGroupIdentity unmarshals an instance of SecurityGroupIdentity from the specified map of raw messages. +func UnmarshalSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// Constants associated with the RouteNextHop.ResourceType property. -// The resource type. -const ( - RouteNextHopResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) +// SecurityGroupPatch : SecurityGroupPatch struct +type SecurityGroupPatch struct { + // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. + Name *string `json:"name,omitempty"` +} -func (*RouteNextHop) isaRouteNextHop() bool { - return true +// UnmarshalSecurityGroupPatch unmarshals an instance of SecurityGroupPatch from the specified map of raw messages. +func UnmarshalSecurityGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -type RouteNextHopIntf interface { - isaRouteNextHop() bool +// AsPatch returns a generic map representation of the SecurityGroupPatch +func (securityGroupPatch *SecurityGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(securityGroupPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// UnmarshalRouteNextHop unmarshals an instance of RouteNextHop from the specified map of raw messages. -func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHop) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// SecurityGroupReference : SecurityGroupReference struct +type SecurityGroupReference struct { + // The security group's CRN. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` + + // The security group's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalSecurityGroupReference unmarshals an instance of SecurityGroupReference from the specified map of raw messages. +func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) if err != nil { return } @@ -44642,7 +50771,21 @@ func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type SecurityGroupReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalSecurityGroupReferenceDeleted unmarshals an instance of SecurityGroupReferenceDeleted from the specified map of raw messages. +func UnmarshalSecurityGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -44650,45 +50793,108 @@ func UnmarshalRouteNextHop(m map[string]json.RawMessage, result interface{}) (er return } -// RouteNextHopPrototype : The next hop packets will be routed to. +// SecurityGroupRule : SecurityGroupRule struct // Models which "extend" this model: -// - RouteNextHopPrototypeRouteNextHopIP -// - RouteNextHopPrototypeVPNGatewayConnectionIdentity -type RouteNextHopPrototype struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// - SecurityGroupRuleSecurityGroupRuleProtocolAll +// - SecurityGroupRuleSecurityGroupRuleProtocolIcmp +// - SecurityGroupRuleSecurityGroupRuleProtocolTcpudp +type SecurityGroupRule struct { + // The direction of traffic to enforce, either `inbound` or `outbound`. + Direction *string `json:"direction" validate:"required"` - // The unique identifier for this VPN gateway connection. - ID *string `json:"id,omitempty"` + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` - // The VPN connection's canonical URL. - Href *string `json:"href,omitempty"` + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version" validate:"required"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The IP addresses or security groups from which this rule allows traffic (or to which, + // for outbound rules). Can be specified as an IP address, a CIDR block, or a security + // group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source, + // for outbound rules). + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The ICMP traffic code to allow. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to allow. + Type *int64 `json:"type,omitempty"` + + // The inclusive upper bound of TCP/UDP port range. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP port range. + PortMin *int64 `json:"port_min,omitempty"` } -func (*RouteNextHopPrototype) isaRouteNextHopPrototype() bool { +// Constants associated with the SecurityGroupRule.Direction property. +// The direction of traffic to enforce, either `inbound` or `outbound`. +const ( + SecurityGroupRuleDirectionInboundConst = "inbound" + SecurityGroupRuleDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRule.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRuleIPVersionIpv4Const = "ipv4" +) + +func (*SecurityGroupRule) isaSecurityGroupRule() bool { return true } -type RouteNextHopPrototypeIntf interface { - isaRouteNextHopPrototype() bool +type SecurityGroupRuleIntf interface { + isaSecurityGroupRule() bool } -// UnmarshalRouteNextHopPrototype unmarshals an instance of RouteNextHopPrototype from the specified map of raw messages. -func UnmarshalRouteNextHopPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteNextHopPrototype) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalSecurityGroupRule unmarshals an instance of SecurityGroupRule from the specified map of raw messages. +func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } + return +} + +// SecurityGroupRuleCollection : Collection of rules in a security group. +type SecurityGroupRuleCollection struct { + // Array of rules. + Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` +} + +// UnmarshalSecurityGroupRuleCollection unmarshals an instance of SecurityGroupRuleCollection from the specified map of raw messages. +func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleCollection) + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) if err != nil { return } @@ -44696,16 +50902,80 @@ func UnmarshalRouteNextHopPrototype(m map[string]json.RawMessage, result interfa return } -// RoutePatch : RoutePatch struct -type RoutePatch struct { - // The user-defined name for this route. Names must be unique within the VPC routing table the route resides in. - Name *string `json:"name,omitempty"` +// SecurityGroupRulePatch : SecurityGroupRulePatch struct +type SecurityGroupRulePatch struct { + // The ICMP traffic code to allow. Specify `null` to remove an existing ICMP traffic code value. + Code *int64 `json:"code,omitempty"` + + // The direction of traffic to enforce, either `inbound` or `outbound`. + Direction *string `json:"direction,omitempty"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` + + // The inclusive upper bound of the protocol port range. Specify `null` to clear an existing upper bound. If a lower + // bound has been set, the upper bound must also be set, and must not be smaller. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of the protocol port range. Specify `null` to clear an existing lower bound. If an upper + // bound has been set, the lower bound must also be set, and must not be larger. + PortMin *int64 `json:"port_min,omitempty"` + + // The IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to + // any source, for outbound rules). + Remote SecurityGroupRuleRemotePatchIntf `json:"remote,omitempty"` + + // The ICMP traffic type to allow. Specify `null` to remove an existing ICMP traffic type value. + Type *int64 `json:"type,omitempty"` } -// UnmarshalRoutePatch unmarshals an instance of RoutePatch from the specified map of raw messages. -func UnmarshalRoutePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// Constants associated with the SecurityGroupRulePatch.Direction property. +// The direction of traffic to enforce, either `inbound` or `outbound`. +const ( + SecurityGroupRulePatchDirectionInboundConst = "inbound" + SecurityGroupRulePatchDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRulePatch.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRulePatchIPVersionIpv4Const = "ipv4" +) + +// UnmarshalSecurityGroupRulePatch unmarshals an instance of SecurityGroupRulePatch from the specified map of raw messages. +func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePatch) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + if err != nil { + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -44713,88 +50983,175 @@ func UnmarshalRoutePatch(m map[string]json.RawMessage, result interface{}) (err return } -// AsPatch returns a generic map representation of the RoutePatch -func (routePatch *RoutePatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the SecurityGroupRulePatch +func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(routePatch) + jsonData, err = json.Marshal(securityGroupRulePatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// RoutePrototype : RoutePrototype struct -type RoutePrototype struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to the system's built-in routes - // - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound - // routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action,omitempty"` +// SecurityGroupRulePrototype : SecurityGroupRulePrototype struct +// Models which "extend" this model: +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp +type SecurityGroupRulePrototype struct { + // The direction of traffic to enforce, either `inbound` or `outbound`. + Direction *string `json:"direction" validate:"required"` + + // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they + // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses + // (network interfaces) in that group matching this IP version. + IPVersion *string `json:"ip_version,omitempty"` + + // The protocol to enforce. + Protocol *string `json:"protocol" validate:"required"` + + // The IP addresses or security groups from which this rule will allow traffic (or to + // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + // security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow traffic + // from any source (or to any source, for outbound rules). + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + + // The ICMP traffic code to allow. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to allow. + Type *int64 `json:"type,omitempty"` + + // The inclusive upper bound of TCP/UDP port range. + PortMax *int64 `json:"port_max,omitempty"` + + // The inclusive lower bound of TCP/UDP port range. + PortMin *int64 `json:"port_min,omitempty"` +} + +// Constants associated with the SecurityGroupRulePrototype.Direction property. +// The direction of traffic to enforce, either `inbound` or `outbound`. +const ( + SecurityGroupRulePrototypeDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRulePrototype.IPVersion property. +// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they +// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses +// (network interfaces) in that group matching this IP version. +const ( + SecurityGroupRulePrototypeIPVersionIpv4Const = "ipv4" +) + +func (*SecurityGroupRulePrototype) isaSecurityGroupRulePrototype() bool { + return true +} + +type SecurityGroupRulePrototypeIntf interface { + isaSecurityGroupRulePrototype() bool +} + +// UnmarshalSecurityGroupRulePrototype unmarshals an instance of SecurityGroupRulePrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + // Retrieve discriminator value to determine correct "subclass". + var discValue string + err = core.UnmarshalPrimitive(m, "protocol", &discValue) + if err != nil { + err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) + return + } + if discValue == "" { + err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + return + } + if discValue == "all" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) + } else { + err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + } + return +} + +// SecurityGroupRuleRemote : The IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). Can be +// specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` allows traffic from any +// source (or to any source, for outbound rules). +// Models which "extend" this model: +// - SecurityGroupRuleRemoteIP +// - SecurityGroupRuleRemoteCIDR +// - SecurityGroupRuleRemoteSecurityGroupReference +type SecurityGroupRuleRemote struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` + + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block,omitempty"` + + // The security group's CRN. + CRN *string `json:"crn,omitempty"` - // The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if - // both routes have an `action` of `deliver` and the - // `next_hop` is an IP address. - Destination *string `json:"destination" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - // The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. - // Names must be unique within the VPC routing table the route resides in. - Name *string `json:"name,omitempty"` + // The security group's canonical URL. + Href *string `json:"href,omitempty"` - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, it must be omitted or specified as `0.0.0.0`. - NextHop RouteNextHopPrototypeIntf `json:"next_hop,omitempty"` + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. + Name *string `json:"name,omitempty"` } -// Constants associated with the RoutePrototype.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to the system's built-in routes -// - `delegate_vpc`: delegate to the system's built-in routes, ignoring Internet-bound -// routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RoutePrototypeActionDelegateConst = "delegate" - RoutePrototypeActionDelegateVPCConst = "delegate_vpc" - RoutePrototypeActionDeliverConst = "deliver" - RoutePrototypeActionDropConst = "drop" -) +func (*SecurityGroupRuleRemote) isaSecurityGroupRuleRemote() bool { + return true +} -// NewRoutePrototype : Instantiate RoutePrototype (Generic Model Constructor) -func (*VpcV1) NewRoutePrototype(destination string, zone ZoneIdentityIntf) (_model *RoutePrototype, err error) { - _model = &RoutePrototype{ - Destination: core.StringPtr(destination), - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return +type SecurityGroupRuleRemoteIntf interface { + isaSecurityGroupRuleRemote() bool } -// UnmarshalRoutePrototype unmarshals an instance of RoutePrototype from the specified map of raw messages. -func UnmarshalRoutePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutePrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalSecurityGroupRuleRemote unmarshals an instance of SecurityGroupRuleRemote from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemote) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHopPrototype) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -44802,30 +51159,52 @@ func UnmarshalRoutePrototype(m map[string]json.RawMessage, result interface{}) ( return } -// RouteReference : RouteReference struct -type RouteReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *RouteReferenceDeleted `json:"deleted,omitempty"` +// SecurityGroupRuleRemotePatch : The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be +// specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic from +// any source (or to any source, for outbound rules). +// Models which "extend" this model: +// - SecurityGroupRuleRemotePatchIP +// - SecurityGroupRuleRemotePatchCIDR +// - SecurityGroupRuleRemotePatchSecurityGroupIdentity +type SecurityGroupRuleRemotePatch struct { + // The IP address. + // + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` - // The URL for this route. - Href *string `json:"href" validate:"required"` + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block,omitempty"` - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // The user-defined name for this route. - Name *string `json:"name" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn,omitempty"` + + // The security group's canonical URL. + Href *string `json:"href,omitempty"` } -// UnmarshalRouteReference unmarshals an instance of RouteReference from the specified map of raw messages. -func UnmarshalRouteReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRouteReferenceDeleted) +func (*SecurityGroupRuleRemotePatch) isaSecurityGroupRuleRemotePatch() bool { + return true +} + +type SecurityGroupRuleRemotePatchIntf interface { + isaSecurityGroupRuleRemotePatch() bool +} + +// UnmarshalSecurityGroupRuleRemotePatch unmarshals an instance of SecurityGroupRuleRemotePatch from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatch) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } @@ -44833,25 +51212,11 @@ func UnmarshalRouteReference(m map[string]json.RawMessage, result interface{}) ( if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type RouteReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalRouteReferenceDeleted unmarshals an instance of RouteReferenceDeleted from the specified map of raw messages. -func UnmarshalRouteReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -44859,89 +51224,52 @@ func UnmarshalRouteReferenceDeleted(m map[string]json.RawMessage, result interfa return } -// RoutingTable : RoutingTable struct -type RoutingTable struct { - // The date and time that this routing table was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The URL for this routing table. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this routing table. - ID *string `json:"id" validate:"required"` - - // Indicates whether this is the default routing table for this VPC. - IsDefault *bool `json:"is_default" validate:"required"` - - // The lifecycle state of the routing table. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The user-defined name for this routing table. - Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. +// SecurityGroupRuleRemotePrototype : The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be +// specified as an IP address, a CIDR block, or a security group. If omitted, a CIDR block of `0.0.0.0/0` will be used +// to allow traffic from any source (or to any source, for outbound rules). +// Models which "extend" this model: +// - SecurityGroupRuleRemotePrototypeIP +// - SecurityGroupRuleRemotePrototypeCIDR +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentity +type SecurityGroupRuleRemotePrototype struct { + // The IP address. // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress" validate:"required"` + // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify + // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the + // error, or bypass the resource on which the unexpected IP address format was encountered. + Address *string `json:"address,omitempty"` - // Indicates whether this routing table is used to route traffic that originates from from [Transit - // Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress" validate:"required"` + // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this + // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt + // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. + CIDRBlock *string `json:"cidr_block,omitempty"` - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress" validate:"required"` + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` - // The routes for this routing table. - Routes []RouteReference `json:"routes" validate:"required"` + // The security group's CRN. + CRN *string `json:"crn,omitempty"` - // The subnets to which this routing table is attached. - Subnets []SubnetReference `json:"subnets" validate:"required"` + // The security group's canonical URL. + Href *string `json:"href,omitempty"` } -// Constants associated with the RoutingTable.LifecycleState property. -// The lifecycle state of the routing table. -const ( - RoutingTableLifecycleStateDeletingConst = "deleting" - RoutingTableLifecycleStateFailedConst = "failed" - RoutingTableLifecycleStatePendingConst = "pending" - RoutingTableLifecycleStateStableConst = "stable" - RoutingTableLifecycleStateSuspendedConst = "suspended" - RoutingTableLifecycleStateUpdatingConst = "updating" - RoutingTableLifecycleStateWaitingConst = "waiting" -) +func (*SecurityGroupRuleRemotePrototype) isaSecurityGroupRuleRemotePrototype() bool { + return true +} -// Constants associated with the RoutingTable.ResourceType property. -// The resource type. -const ( - RoutingTableResourceTypeRoutingTableConst = "routing_table" -) +type SecurityGroupRuleRemotePrototypeIntf interface { + isaSecurityGroupRuleRemotePrototype() bool +} -// UnmarshalRoutingTable unmarshals an instance of RoutingTable from the specified map of raw messages. -func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTable) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalSecurityGroupRuleRemotePrototype unmarshals an instance of SecurityGroupRuleRemotePrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototype) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { return } @@ -44949,39 +51277,11 @@ func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } - err = core.UnmarshalPrimitive(m, "is_default", &obj.IsDefault) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnetReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -44989,29 +51289,29 @@ func UnmarshalRoutingTable(m map[string]json.RawMessage, result interface{}) (er return } -// RoutingTableCollection : RoutingTableCollection struct -type RoutingTableCollection struct { +// SecurityGroupTargetCollection : SecurityGroupTargetCollection struct +type SecurityGroupTargetCollection struct { // A link to the first page of resources. - First *RoutingTableCollectionFirst `json:"first" validate:"required"` + First *SecurityGroupTargetCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *RoutingTableCollectionNext `json:"next,omitempty"` + Next *SecurityGroupTargetCollectionNext `json:"next,omitempty"` - // Collection of routing tables. - RoutingTables []RoutingTable `json:"routing_tables" validate:"required"` + // Collection of targets for this security group. + Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalRoutingTableCollection unmarshals an instance of RoutingTableCollection from the specified map of raw messages. -func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRoutingTableCollectionFirst) +// UnmarshalSecurityGroupTargetCollection unmarshals an instance of SecurityGroupTargetCollection from the specified map of raw messages. +func UnmarshalSecurityGroupTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupTargetCollectionFirst) if err != nil { return } @@ -45019,11 +51319,11 @@ func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interf if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRoutingTableCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupTargetCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "routing_tables", &obj.RoutingTables, UnmarshalRoutingTable) + err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) if err != nil { return } @@ -45036,7 +51336,7 @@ func UnmarshalRoutingTableCollection(m map[string]json.RawMessage, result interf } // Retrieve the value to be passed to a request to access the next page of results -func (resp *RoutingTableCollection) GetNextStart() (*string, error) { +func (resp *SecurityGroupTargetCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -45047,15 +51347,15 @@ func (resp *RoutingTableCollection) GetNextStart() (*string, error) { return start, nil } -// RoutingTableCollectionFirst : A link to the first page of resources. -type RoutingTableCollectionFirst struct { +// SecurityGroupTargetCollectionFirst : A link to the first page of resources. +type SecurityGroupTargetCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalRoutingTableCollectionFirst unmarshals an instance of RoutingTableCollectionFirst from the specified map of raw messages. -func UnmarshalRoutingTableCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollectionFirst) +// UnmarshalSecurityGroupTargetCollectionFirst unmarshals an instance of SecurityGroupTargetCollectionFirst from the specified map of raw messages. +func UnmarshalSecurityGroupTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -45064,15 +51364,15 @@ func UnmarshalRoutingTableCollectionFirst(m map[string]json.RawMessage, result i return } -// RoutingTableCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RoutingTableCollectionNext struct { +// SecurityGroupTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SecurityGroupTargetCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalRoutingTableCollectionNext unmarshals an instance of RoutingTableCollectionNext from the specified map of raw messages. -func UnmarshalRoutingTableCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableCollectionNext) +// UnmarshalSecurityGroupTargetCollectionNext unmarshals an instance of SecurityGroupTargetCollectionNext from the specified map of raw messages. +func UnmarshalSecurityGroupTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -45081,30 +51381,52 @@ func UnmarshalRoutingTableCollectionNext(m map[string]json.RawMessage, result in return } -// RoutingTableIdentity : Identifies a routing table by a unique property. +// SecurityGroupTargetReference : The resource types that can be security group targets are expected to expand in the future. When iterating over +// security group targets, do not assume that every target resource will be from a known set of resource types. +// Optionally halt processing and surface an error, or bypass resources of unrecognized types. // Models which "extend" this model: -// - RoutingTableIdentityByID -// - RoutingTableIdentityByHref -type RoutingTableIdentity struct { - // The unique identifier for this routing table. - ID *string `json:"id,omitempty"` +// - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext +// - SecurityGroupTargetReferenceLoadBalancerReference +// - SecurityGroupTargetReferenceEndpointGatewayReference +type SecurityGroupTargetReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` - // The URL for this routing table. + // The URL for this network interface. Href *string `json:"href,omitempty"` + + // The unique identifier for this network interface. + ID *string `json:"id,omitempty"` + + // The user-defined name for this network interface. + Name *string `json:"name,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` + + // The load balancer's CRN. + CRN *string `json:"crn,omitempty"` } -func (*RoutingTableIdentity) isaRoutingTableIdentity() bool { +// Constants associated with the SecurityGroupTargetReference.ResourceType property. +// The resource type. +const ( + SecurityGroupTargetReferenceResourceTypeNetworkInterfaceConst = "network_interface" +) + +func (*SecurityGroupTargetReference) isaSecurityGroupTargetReference() bool { return true } -type RoutingTableIdentityIntf interface { - isaRoutingTableIdentity() bool +type SecurityGroupTargetReferenceIntf interface { + isaSecurityGroupTargetReference() bool } -// UnmarshalRoutingTableIdentity unmarshals an instance of RoutingTableIdentity from the specified map of raw messages. -func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalSecurityGroupTargetReference unmarshals an instance of SecurityGroupTargetReference from the specified map of raw messages. +func UnmarshalSecurityGroupTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupTargetReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) if err != nil { return } @@ -45112,69 +51434,19 @@ func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interfac if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTablePatch : RoutingTablePatch struct -type RoutingTablePatch struct { - // The user-defined name for this routing table. Names must be unique within the VPC the routing table resides in. - Name *string `json:"name,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true` selects this routing table, provided - // no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this - // routing table. Updating to `false` deselects this routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteDirectLinkIngress *bool `json:"route_direct_link_ingress,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from - // [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. Updating to - // `true` selects this routing table, provided no other routing table in the VPC already has this property set to - // `true`, and no subnets are attached to this routing table. Updating to `false` deselects this routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - // - // If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled - // for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to this routing - // table. - RouteTransitGatewayIngress *bool `json:"route_transit_gateway_ingress,omitempty"` - - // Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this - // VPC. Updating to `true` selects this routing table, provided no other routing table in the VPC already has this - // property set to `true`, and no subnets are attached to this routing table. Updating to `false` deselects this - // routing table. - // - // Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of - // `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges. - // Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP address or a VPN gateway - // connection, the packet will be dropped. - RouteVPCZoneIngress *bool `json:"route_vpc_zone_ingress,omitempty"` -} - -// UnmarshalRoutingTablePatch unmarshals an instance of RoutingTablePatch from the specified map of raw messages. -func UnmarshalRoutingTablePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTablePatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "route_direct_link_ingress", &obj.RouteDirectLinkIngress) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "route_transit_gateway_ingress", &obj.RouteTransitGatewayIngress) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "route_vpc_zone_ingress", &obj.RouteVPCZoneIngress) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -45182,135 +51454,179 @@ func UnmarshalRoutingTablePatch(m map[string]json.RawMessage, result interface{} return } -// AsPatch returns a generic map representation of the RoutingTablePatch -func (routingTablePatch *RoutingTablePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(routingTablePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// SetSubnetPublicGatewayOptions : The SetSubnetPublicGateway options. +type SetSubnetPublicGatewayOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // The public gateway identity. + PublicGatewayIdentity PublicGatewayIdentityIntf `json:"PublicGatewayIdentity" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewSetSubnetPublicGatewayOptions : Instantiate SetSubnetPublicGatewayOptions +func (*VpcV1) NewSetSubnetPublicGatewayOptions(id string, publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { + return &SetSubnetPublicGatewayOptions{ + ID: core.StringPtr(id), + PublicGatewayIdentity: publicGatewayIdentity, } - return } -// RoutingTableReference : RoutingTableReference struct -type RoutingTableReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *RoutingTableReferenceDeleted `json:"deleted,omitempty"` +// SetID : Allow user to set ID +func (_options *SetSubnetPublicGatewayOptions) SetID(id string) *SetSubnetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetPublicGatewayIdentity : Allow user to set PublicGatewayIdentity +func (_options *SetSubnetPublicGatewayOptions) SetPublicGatewayIdentity(publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { + _options.PublicGatewayIdentity = publicGatewayIdentity + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *SetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *SetSubnetPublicGatewayOptions { + options.Headers = param + return options +} + +// Snapshot : Snapshot struct +type Snapshot struct { + // Indicates if a boot volume attachment can be created with a volume created from this snapshot. + Bootable *bool `json:"bootable" validate:"required"` + + // The date and time the data capture for this snapshot was completed. + // + // If absent, this snapshot's data has not yet been captured. Additionally, this property may be absent for snapshots + // created before 1 January 2022. + CapturedAt *strfmt.DateTime `json:"captured_at,omitempty"` + + // The date and time that this snapshot was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this snapshot. + CRN *string `json:"crn" validate:"required"` + + // Indicates whether this snapshot can be deleted. This value will always be `true`. + Deletable *bool `json:"deletable" validate:"required"` + + // The type of encryption used on the source volume. + Encryption *string `json:"encryption" validate:"required"` + + // The root key used to wrap the data encryption key for the source volume. + // + // This property will be present for volumes with an `encryption` type of + // `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` - // The URL for this routing table. + // The URL for this snapshot. Href *string `json:"href" validate:"required"` - // The unique identifier for this routing table. + // The unique identifier for this snapshot. ID *string `json:"id" validate:"required"` - // The user-defined name for this routing table. + // The lifecycle state of this snapshot. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the + // capacity of the `source_volume`. + MinimumCapacity *int64 `json:"minimum_capacity" validate:"required"` + + // The user-defined name for this snapshot. Name *string `json:"name" validate:"required"` + // The operating system included in this image. + OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` + + // The resource group for this snapshot. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The size of this snapshot rounded up to the next gigabyte. + Size *int64 `json:"size" validate:"required"` + + // If present, the image from which the data on this volume was most directly + // provisioned. + SourceImage *ImageReference `json:"source_image,omitempty"` + + // The source volume this snapshot was created from (may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + SourceVolume *VolumeReference `json:"source_volume" validate:"required"` } -// Constants associated with the RoutingTableReference.ResourceType property. +// Constants associated with the Snapshot.Encryption property. +// The type of encryption used on the source volume. +const ( + SnapshotEncryptionProviderManagedConst = "provider_managed" + SnapshotEncryptionUserManagedConst = "user_managed" +) + +// Constants associated with the Snapshot.LifecycleState property. +// The lifecycle state of this snapshot. +const ( + SnapshotLifecycleStateDeletingConst = "deleting" + SnapshotLifecycleStateFailedConst = "failed" + SnapshotLifecycleStatePendingConst = "pending" + SnapshotLifecycleStateStableConst = "stable" + SnapshotLifecycleStateSuspendedConst = "suspended" + SnapshotLifecycleStateUpdatingConst = "updating" + SnapshotLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Snapshot.ResourceType property. // The resource type. const ( - RoutingTableReferenceResourceTypeRoutingTableConst = "routing_table" + SnapshotResourceTypeSnapshotConst = "snapshot" ) -// UnmarshalRoutingTableReference unmarshals an instance of RoutingTableReference from the specified map of raw messages. -func UnmarshalRoutingTableReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalRoutingTableReferenceDeleted) +// UnmarshalSnapshot unmarshals an instance of Snapshot from the specified map of raw messages. +func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Snapshot) + err = core.UnmarshalPrimitive(m, "bootable", &obj.Bootable) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "captured_at", &obj.CapturedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "deletable", &obj.Deletable) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RoutingTableReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type RoutingTableReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalRoutingTableReferenceDeleted unmarshals an instance of RoutingTableReferenceDeleted from the specified map of raw messages. -func UnmarshalRoutingTableReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoutingTableReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroup : SecurityGroup struct -type SecurityGroup struct { - // The date and time that this security group was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The security group's CRN. - CRN *string `json:"crn" validate:"required"` - - // The security group's canonical URL. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group. - ID *string `json:"id" validate:"required"` - - // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. - Name *string `json:"name" validate:"required"` - - // The network interfaces for this security group. - NetworkInterfaces []NetworkInterfaceReference `json:"network_interfaces" validate:"required"` - - // The resource group for this security group. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The rules for this security group. If no rules exist, all traffic will be denied. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` - - // The targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` - - // The VPC this security group is a part of. - VPC *VPCReference `json:"vpc" validate:"required"` -} - -// UnmarshalSecurityGroup unmarshals an instance of SecurityGroup from the specified map of raw messages. -func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroup) - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "minimum_capacity", &obj.MinimumCapacity) if err != nil { return } @@ -45318,7 +51634,7 @@ func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfaceReference) + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) if err != nil { return } @@ -45326,15 +51642,19 @@ func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) + err = core.UnmarshalPrimitive(m, "size", &obj.Size) if err != nil { return } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) if err != nil { return } @@ -45342,29 +51662,29 @@ func UnmarshalSecurityGroup(m map[string]json.RawMessage, result interface{}) (e return } -// SecurityGroupCollection : SecurityGroupCollection struct -type SecurityGroupCollection struct { +// SnapshotCollection : SnapshotCollection struct +type SnapshotCollection struct { // A link to the first page of resources. - First *SecurityGroupCollectionFirst `json:"first" validate:"required"` + First *SnapshotCollectionFirst `json:"first" validate:"required"` // The maximum number of resources that can be returned by the request. Limit *int64 `json:"limit" validate:"required"` // A link to the next page of resources. This property is present for all pages // except the last page. - Next *SecurityGroupCollectionNext `json:"next,omitempty"` + Next *SnapshotCollectionNext `json:"next,omitempty"` - // Collection of security groups. - SecurityGroups []SecurityGroup `json:"security_groups" validate:"required"` + // Collection of snapshots. + Snapshots []Snapshot `json:"snapshots" validate:"required"` // The total number of resources across all pages. TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalSecurityGroupCollection unmarshals an instance of SecurityGroupCollection from the specified map of raw messages. -func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupCollectionFirst) +// UnmarshalSnapshotCollection unmarshals an instance of SnapshotCollection from the specified map of raw messages. +func UnmarshalSnapshotCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotCollectionFirst) if err != nil { return } @@ -45372,11 +51692,11 @@ func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result inter if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupCollectionNext) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotCollectionNext) if err != nil { return } - err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroup) + err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshot) if err != nil { return } @@ -45389,7 +51709,7 @@ func UnmarshalSecurityGroupCollection(m map[string]json.RawMessage, result inter } // Retrieve the value to be passed to a request to access the next page of results -func (resp *SecurityGroupCollection) GetNextStart() (*string, error) { +func (resp *SnapshotCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -45400,15 +51720,15 @@ func (resp *SecurityGroupCollection) GetNextStart() (*string, error) { return start, nil } -// SecurityGroupCollectionFirst : A link to the first page of resources. -type SecurityGroupCollectionFirst struct { +// SnapshotCollectionFirst : A link to the first page of resources. +type SnapshotCollectionFirst struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalSecurityGroupCollectionFirst unmarshals an instance of SecurityGroupCollectionFirst from the specified map of raw messages. -func UnmarshalSecurityGroupCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollectionFirst) +// UnmarshalSnapshotCollectionFirst unmarshals an instance of SnapshotCollectionFirst from the specified map of raw messages. +func UnmarshalSnapshotCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCollectionFirst) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -45417,15 +51737,15 @@ func UnmarshalSecurityGroupCollectionFirst(m map[string]json.RawMessage, result return } -// SecurityGroupCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SecurityGroupCollectionNext struct { +// SnapshotCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SnapshotCollectionNext struct { // The URL for a page of resources. Href *string `json:"href" validate:"required"` } -// UnmarshalSecurityGroupCollectionNext unmarshals an instance of SecurityGroupCollectionNext from the specified map of raw messages. -func UnmarshalSecurityGroupCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupCollectionNext) +// UnmarshalSnapshotCollectionNext unmarshals an instance of SnapshotCollectionNext from the specified map of raw messages. +func UnmarshalSnapshotCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotCollectionNext) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -45434,33 +51754,33 @@ func UnmarshalSecurityGroupCollectionNext(m map[string]json.RawMessage, result i return } -// SecurityGroupIdentity : Identifies a security group by a unique property. +// SnapshotIdentity : Identifies a snapshot by a unique property. // Models which "extend" this model: -// - SecurityGroupIdentityByID -// - SecurityGroupIdentityByCRN -// - SecurityGroupIdentityByHref -type SecurityGroupIdentity struct { - // The unique identifier for this security group. +// - SnapshotIdentityByID +// - SnapshotIdentityByCRN +// - SnapshotIdentityByHref +type SnapshotIdentity struct { + // The unique identifier for this snapshot. ID *string `json:"id,omitempty"` - // The security group's CRN. + // The CRN for this snapshot. CRN *string `json:"crn,omitempty"` - // The security group's canonical URL. + // The URL for this snapshot. Href *string `json:"href,omitempty"` } -func (*SecurityGroupIdentity) isaSecurityGroupIdentity() bool { +func (*SnapshotIdentity) isaSnapshotIdentity() bool { return true } -type SecurityGroupIdentityIntf interface { - isaSecurityGroupIdentity() bool +type SnapshotIdentityIntf interface { + isaSnapshotIdentity() bool } -// UnmarshalSecurityGroupIdentity unmarshals an instance of SecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupIdentity) +// UnmarshalSnapshotIdentity unmarshals an instance of SnapshotIdentity from the specified map of raw messages. +func UnmarshalSnapshotIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -45477,15 +51797,15 @@ func UnmarshalSecurityGroupIdentity(m map[string]json.RawMessage, result interfa return } -// SecurityGroupPatch : SecurityGroupPatch struct -type SecurityGroupPatch struct { - // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. +// SnapshotPatch : SnapshotPatch struct +type SnapshotPatch struct { + // The user-defined name for this snapshot. Name *string `json:"name,omitempty"` } -// UnmarshalSecurityGroupPatch unmarshals an instance of SecurityGroupPatch from the specified map of raw messages. -func UnmarshalSecurityGroupPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupPatch) +// UnmarshalSnapshotPatch unmarshals an instance of SnapshotPatch from the specified map of raw messages. +func UnmarshalSnapshotPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -45494,43 +51814,52 @@ func UnmarshalSecurityGroupPatch(m map[string]json.RawMessage, result interface{ return } -// AsPatch returns a generic map representation of the SecurityGroupPatch -func (securityGroupPatch *SecurityGroupPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the SnapshotPatch +func (snapshotPatch *SnapshotPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(securityGroupPatch) + jsonData, err = json.Marshal(snapshotPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// SecurityGroupReference : SecurityGroupReference struct -type SecurityGroupReference struct { - // The security group's CRN. +// SnapshotReference : SnapshotReference struct +type SnapshotReference struct { + // The CRN for this snapshot. CRN *string `json:"crn" validate:"required"` // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` + Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` - // The security group's canonical URL. + // The URL for this snapshot. Href *string `json:"href" validate:"required"` - // The unique identifier for this security group. + // The unique identifier for this snapshot. ID *string `json:"id" validate:"required"` - // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. + // The user-defined name for this snapshot. Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalSecurityGroupReference unmarshals an instance of SecurityGroupReference from the specified map of raw messages. -func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupReference) +// Constants associated with the SnapshotReference.ResourceType property. +// The resource type. +const ( + SnapshotReferenceResourceTypeSnapshotConst = "snapshot" +) + +// UnmarshalSnapshotReference unmarshals an instance of SnapshotReference from the specified map of raw messages. +func UnmarshalSnapshotReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) if err != nil { return } @@ -45546,20 +51875,24 @@ func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interf if err != nil { return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// SnapshotReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type SecurityGroupReferenceDeleted struct { +type SnapshotReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalSecurityGroupReferenceDeleted unmarshals an instance of SecurityGroupReferenceDeleted from the specified map of raw messages. -func UnmarshalSecurityGroupReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupReferenceDeleted) +// UnmarshalSnapshotReferenceDeleted unmarshals an instance of SnapshotReferenceDeleted from the specified map of raw messages. +func UnmarshalSnapshotReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SnapshotReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -45568,108 +51901,292 @@ func UnmarshalSecurityGroupReferenceDeleted(m map[string]json.RawMessage, result return } -// SecurityGroupRule : SecurityGroupRule struct -// Models which "extend" this model: -// - SecurityGroupRuleSecurityGroupRuleProtocolAll -// - SecurityGroupRuleSecurityGroupRuleProtocolIcmp -// - SecurityGroupRuleSecurityGroupRuleProtocolTcpudp -type SecurityGroupRule struct { - // The direction of traffic to enforce, either `inbound` or `outbound`. - Direction *string `json:"direction" validate:"required"` +// StartBareMetalServerOptions : The StartBareMetalServer options. +type StartBareMetalServerOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` - // The URL for this security group rule. + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewStartBareMetalServerOptions : Instantiate StartBareMetalServerOptions +func (*VpcV1) NewStartBareMetalServerOptions(id string) *StartBareMetalServerOptions { + return &StartBareMetalServerOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *StartBareMetalServerOptions) SetID(id string) *StartBareMetalServerOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *StartBareMetalServerOptions) SetHeaders(param map[string]string) *StartBareMetalServerOptions { + options.Headers = param + return options +} + +// StopBareMetalServerOptions : The StopBareMetalServer options. +type StopBareMetalServerOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` + + // The type of stop operation: + // - `soft`: signal running operating system to quiesce and shutdown cleanly + // - `hard`: immediately stop the server. + Type *string `json:"type" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the StopBareMetalServerOptions.Type property. +// The type of stop operation: +// - `soft`: signal running operating system to quiesce and shutdown cleanly +// - `hard`: immediately stop the server. +const ( + StopBareMetalServerOptionsTypeHardConst = "hard" + StopBareMetalServerOptionsTypeSoftConst = "soft" +) + +// NewStopBareMetalServerOptions : Instantiate StopBareMetalServerOptions +func (*VpcV1) NewStopBareMetalServerOptions(id string, typeVar string) *StopBareMetalServerOptions { + return &StopBareMetalServerOptions{ + ID: core.StringPtr(id), + Type: core.StringPtr(typeVar), + } +} + +// SetID : Allow user to set ID +func (_options *StopBareMetalServerOptions) SetID(id string) *StopBareMetalServerOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetType : Allow user to set Type +func (_options *StopBareMetalServerOptions) SetType(typeVar string) *StopBareMetalServerOptions { + _options.Type = core.StringPtr(typeVar) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *StopBareMetalServerOptions) SetHeaders(param map[string]string) *StopBareMetalServerOptions { + options.Headers = param + return options +} + +// Subnet : Subnet struct +type Subnet struct { + // The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the + // provider. + AvailableIpv4AddressCount *int64 `json:"available_ipv4_address_count" validate:"required"` + + // The date and time that the subnet was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this subnet. + CRN *string `json:"crn" validate:"required"` + + // The URL for this subnet. Href *string `json:"href" validate:"required"` - // The unique identifier for this security group rule. + // The unique identifier for this subnet. ID *string `json:"id" validate:"required"` - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. + // The IP version(s) supported by this subnet. IPVersion *string `json:"ip_version" validate:"required"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The IPv4 range of the subnet, expressed in CIDR format. + Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` - // The IP addresses or security groups from which this rule allows traffic (or to which, - // for outbound rules). Can be specified as an IP address, a CIDR block, or a security - // group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source, - // for outbound rules). - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + // The user-defined name for this subnet. + Name *string `json:"name" validate:"required"` - // The ICMP traffic code to allow. - Code *int64 `json:"code,omitempty"` + // The network ACL for this subnet. + NetworkACL *NetworkACLReference `json:"network_acl" validate:"required"` - // The ICMP traffic type to allow. - Type *int64 `json:"type,omitempty"` + // The public gateway to use for internet-bound traffic for this subnet. + PublicGateway *PublicGatewayReference `json:"public_gateway,omitempty"` - // The inclusive upper bound of TCP/UDP port range. - PortMax *int64 `json:"port_max,omitempty"` + // The resource group for this subnet. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The inclusive lower bound of TCP/UDP port range. - PortMin *int64 `json:"port_min,omitempty"` + // The routing table for this subnet. + RoutingTable *RoutingTableReference `json:"routing_table" validate:"required"` + + // The status of the subnet. + Status *string `json:"status" validate:"required"` + + // The total number of IPv4 addresses in this subnet. + // + // Note: This is calculated as 2(32 − prefix length). For example, the prefix length `/24` gives:
+ // 2(32 − 24) = 28 = 256 addresses. + TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` + + // The VPC this subnet is a part of. + VPC *VPCReference `json:"vpc" validate:"required"` + + // The zone this subnet resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the SecurityGroupRule.Direction property. -// The direction of traffic to enforce, either `inbound` or `outbound`. +// Constants associated with the Subnet.IPVersion property. +// The IP version(s) supported by this subnet. const ( - SecurityGroupRuleDirectionInboundConst = "inbound" - SecurityGroupRuleDirectionOutboundConst = "outbound" + SubnetIPVersionIpv4Const = "ipv4" ) -// Constants associated with the SecurityGroupRule.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. +// Constants associated with the Subnet.Status property. +// The status of the subnet. const ( - SecurityGroupRuleIPVersionIpv4Const = "ipv4" + SubnetStatusAvailableConst = "available" + SubnetStatusDeletingConst = "deleting" + SubnetStatusFailedConst = "failed" + SubnetStatusPendingConst = "pending" ) -func (*SecurityGroupRule) isaSecurityGroupRule() bool { - return true -} +// UnmarshalSubnet unmarshals an instance of Subnet from the specified map of raw messages. +func UnmarshalSubnet(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Subnet) + err = core.UnmarshalPrimitive(m, "available_ipv4_address_count", &obj.AvailableIpv4AddressCount) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SubnetCollection : SubnetCollection struct +type SubnetCollection struct { + // A link to the first page of resources. + First *SubnetCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *SubnetCollectionNext `json:"next,omitempty"` -type SecurityGroupRuleIntf interface { - isaSecurityGroupRule() bool + // Collection of subnets. + Subnets []Subnet `json:"subnets" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalSecurityGroupRule unmarshals an instance of SecurityGroupRule from the specified map of raw messages. -func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalSubnetCollection unmarshals an instance of SubnetCollection from the specified map of raw messages. +func UnmarshalSubnetCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSubnetCollectionFirst) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSubnetCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnet) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupRuleCollection : Collection of rules in a security group. -type SecurityGroupRuleCollection struct { - // Array of rules. - Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *SubnetCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// UnmarshalSecurityGroupRuleCollection unmarshals an instance of SecurityGroupRuleCollection from the specified map of raw messages. -func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleCollection) - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalSecurityGroupRule) +// SubnetCollectionFirst : A link to the first page of resources. +type SubnetCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalSubnetCollectionFirst unmarshals an instance of SubnetCollectionFirst from the specified map of raw messages. +func UnmarshalSubnetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -45677,80 +52194,99 @@ func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result i return } -// SecurityGroupRulePatch : SecurityGroupRulePatch struct -type SecurityGroupRulePatch struct { - // The ICMP traffic code to allow. Specify `null` to remove an existing ICMP traffic code value. - Code *int64 `json:"code,omitempty"` - - // The direction of traffic to enforce, either `inbound` or `outbound`. - Direction *string `json:"direction,omitempty"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. - IPVersion *string `json:"ip_version,omitempty"` +// SubnetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type SubnetCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The inclusive upper bound of the protocol port range. Specify `null` to clear an existing upper bound. If a lower - // bound has been set, the upper bound must also be set, and must not be smaller. - PortMax *int64 `json:"port_max,omitempty"` +// UnmarshalSubnetCollectionNext unmarshals an instance of SubnetCollectionNext from the specified map of raw messages. +func UnmarshalSubnetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The inclusive lower bound of the protocol port range. Specify `null` to clear an existing lower bound. If an upper - // bound has been set, the lower bound must also be set, and must not be larger. - PortMin *int64 `json:"port_min,omitempty"` +// SubnetIdentity : Identifies a subnet by a unique property. +// Models which "extend" this model: +// - SubnetIdentityByID +// - SubnetIdentityByCRN +// - SubnetIdentityByHref +type SubnetIdentity struct { + // The unique identifier for this subnet. + ID *string `json:"id,omitempty"` - // The IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - // any source, for outbound rules). - Remote SecurityGroupRuleRemotePatchIntf `json:"remote,omitempty"` + // The CRN for this subnet. + CRN *string `json:"crn,omitempty"` - // The ICMP traffic type to allow. Specify `null` to remove an existing ICMP traffic type value. - Type *int64 `json:"type,omitempty"` + // The URL for this subnet. + Href *string `json:"href,omitempty"` } -// Constants associated with the SecurityGroupRulePatch.Direction property. -// The direction of traffic to enforce, either `inbound` or `outbound`. -const ( - SecurityGroupRulePatchDirectionInboundConst = "inbound" - SecurityGroupRulePatchDirectionOutboundConst = "outbound" -) +func (*SubnetIdentity) isaSubnetIdentity() bool { + return true +} -// Constants associated with the SecurityGroupRulePatch.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. -const ( - SecurityGroupRulePatchIPVersionIpv4Const = "ipv4" -) +type SubnetIdentityIntf interface { + isaSubnetIdentity() bool +} -// UnmarshalSecurityGroupRulePatch unmarshals an instance of SecurityGroupRulePatch from the specified map of raw messages. -func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePatch) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) +// UnmarshalSubnetIdentity unmarshals an instance of SubnetIdentity from the specified map of raw messages. +func UnmarshalSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SubnetPatch : SubnetPatch struct +type SubnetPatch struct { + // The user-defined name for this subnet. Names must be unique within the VPC the subnet resides in. + Name *string `json:"name,omitempty"` + + // The network ACL to use for this subnet. + NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` + + // The public gateway to use for internet-bound traffic for this subnet. + PublicGateway SubnetPublicGatewayPatchIntf `json:"public_gateway,omitempty"` + + // The routing table to use for this subnet. The routing table properties + // `route_direct_link_ingress`, `route_transit_gateway_ingress`, and + // `route_vpc_zone_ingress` must be `false`. + RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` +} + +// UnmarshalSubnetPatch unmarshals an instance of SubnetPatch from the specified map of raw messages. +func UnmarshalSubnetPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePatch) + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalSubnetPublicGatewayPatch) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) if err != nil { return } @@ -45758,175 +52294,116 @@ func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interf return } -// AsPatch returns a generic map representation of the SecurityGroupRulePatch -func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the SubnetPatch +func (subnetPatch *SubnetPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(securityGroupRulePatch) + jsonData, err = json.Marshal(subnetPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// SecurityGroupRulePrototype : SecurityGroupRulePrototype struct +// SubnetPrototype : SubnetPrototype struct // Models which "extend" this model: -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp -type SecurityGroupRulePrototype struct { - // The direction of traffic to enforce, either `inbound` or `outbound`. - Direction *string `json:"direction" validate:"required"` - - // The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they - // are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses - // (network interfaces) in that group matching this IP version. +// - SubnetPrototypeSubnetByTotalCount +// - SubnetPrototypeSubnetByCIDR +type SubnetPrototype struct { + // The IP version(s) to support for this subnet. IPVersion *string `json:"ip_version,omitempty"` - // The protocol to enforce. - Protocol *string `json:"protocol" validate:"required"` + // The user-defined name for this subnet. Names must be unique within the VPC the subnet resides in. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The IP addresses or security groups from which this rule will allow traffic (or to - // which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - // security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow traffic - // from any source (or to any source, for outbound rules). - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + // The network ACL to use for this subnet. + NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - // The ICMP traffic code to allow. - Code *int64 `json:"code,omitempty"` + // The public gateway to use for internet-bound traffic for this subnet. If + // unspecified, the subnet will not be attached to a public gateway. + PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` - // The ICMP traffic type to allow. - Type *int64 `json:"type,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The inclusive upper bound of TCP/UDP port range. - PortMax *int64 `json:"port_max,omitempty"` + // The routing table to use for this subnet. If unspecified, the default routing table + // for the VPC is used. The routing table properties `route_direct_link_ingress`, + // `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. + RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` - // The inclusive lower bound of TCP/UDP port range. - PortMin *int64 `json:"port_min,omitempty"` -} + // The VPC the subnet is to be a part of. + VPC VPCIdentityIntf `json:"vpc" validate:"required"` -// Constants associated with the SecurityGroupRulePrototype.Direction property. -// The direction of traffic to enforce, either `inbound` or `outbound`. -const ( - SecurityGroupRulePrototypeDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeDirectionOutboundConst = "outbound" -) + // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the + // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. + TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count,omitempty"` -// Constants associated with the SecurityGroupRulePrototype.IPVersion property. -// The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they -// are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses -// (network interfaces) in that group matching this IP version. + // The zone this subnet will reside in. + Zone ZoneIdentityIntf `json:"zone,omitempty"` + + // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` + // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing + // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of + // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix + // that contains the subnet's IPv4 CIDR. + Ipv4CIDRBlock *string `json:"ipv4_cidr_block,omitempty"` +} + +// Constants associated with the SubnetPrototype.IPVersion property. +// The IP version(s) to support for this subnet. const ( - SecurityGroupRulePrototypeIPVersionIpv4Const = "ipv4" + SubnetPrototypeIPVersionIpv4Const = "ipv4" ) -func (*SecurityGroupRulePrototype) isaSecurityGroupRulePrototype() bool { +func (*SubnetPrototype) isaSubnetPrototype() bool { return true } -type SecurityGroupRulePrototypeIntf interface { - isaSecurityGroupRulePrototype() bool +type SubnetPrototypeIntf interface { + isaSubnetPrototype() bool } -// UnmarshalSecurityGroupRulePrototype unmarshals an instance of SecurityGroupRulePrototype from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - // Retrieve discriminator value to determine correct "subclass". - var discValue string - err = core.UnmarshalPrimitive(m, "protocol", &discValue) +// UnmarshalSubnetPrototype unmarshals an instance of SubnetPrototype from the specified map of raw messages. +func UnmarshalSubnetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPrototype) + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { - err = fmt.Errorf("error unmarshalling discriminator property 'protocol': %s", err.Error()) return } - if discValue == "" { - err = fmt.Errorf("required discriminator property 'protocol' not found in JSON object") + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp) - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp) - } else { - err = fmt.Errorf("unrecognized value for discriminator property 'protocol': %s", discValue) + err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) + if err != nil { + return } - return -} - -// SecurityGroupRuleRemote : The IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). Can be -// specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` allows traffic from any -// source (or to any source, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemoteIP -// - SecurityGroupRuleRemoteCIDR -// - SecurityGroupRuleRemoteSecurityGroupReference -type SecurityGroupRuleRemote struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The security group's CRN. - CRN *string `json:"crn,omitempty"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *SecurityGroupReferenceDeleted `json:"deleted,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` - - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The user-defined name for this security group. Names must be unique within the VPC the security group resides in. - Name *string `json:"name,omitempty"` -} - -func (*SecurityGroupRuleRemote) isaSecurityGroupRuleRemote() bool { - return true -} - -type SecurityGroupRuleRemoteIntf interface { - isaSecurityGroupRuleRemote() bool -} - -// UnmarshalSecurityGroupRuleRemote unmarshals an instance of SecurityGroupRuleRemote from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemote) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) + err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSecurityGroupReferenceDeleted) + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) if err != nil { return } @@ -45934,120 +52411,136 @@ func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result inter return } -// SecurityGroupRuleRemotePatch : The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be -// specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic from -// any source (or to any source, for outbound rules). +// SubnetPublicGatewayPatch : The public gateway to use for internet-bound traffic for this subnet. // Models which "extend" this model: -// - SecurityGroupRuleRemotePatchIP -// - SecurityGroupRuleRemotePatchCIDR -// - SecurityGroupRuleRemotePatchSecurityGroupIdentity -type SecurityGroupRuleRemotePatch struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` - - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` - - // The unique identifier for this security group. +// - SubnetPublicGatewayPatchPublicGatewayIdentityByID +// - SubnetPublicGatewayPatchPublicGatewayIdentityByCRN +// - SubnetPublicGatewayPatchPublicGatewayIdentityByHref +type SubnetPublicGatewayPatch struct { + // The unique identifier for this public gateway. ID *string `json:"id,omitempty"` - // The security group's CRN. + // The CRN for this public gateway. CRN *string `json:"crn,omitempty"` - // The security group's canonical URL. + // The URL for this public gateway. Href *string `json:"href,omitempty"` } -func (*SecurityGroupRuleRemotePatch) isaSecurityGroupRuleRemotePatch() bool { +func (*SubnetPublicGatewayPatch) isaSubnetPublicGatewayPatch() bool { return true } -type SecurityGroupRuleRemotePatchIntf interface { - isaSecurityGroupRuleRemotePatch() bool +type SubnetPublicGatewayPatchIntf interface { + isaSubnetPublicGatewayPatch() bool } -// UnmarshalSecurityGroupRuleRemotePatch unmarshals an instance of SecurityGroupRuleRemotePatch from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatch) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalSubnetPublicGatewayPatch unmarshals an instance of SubnetPublicGatewayPatch from the specified map of raw messages. +func UnmarshalSubnetPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetPublicGatewayPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SubnetReference : SubnetReference struct +type SubnetReference struct { + // The CRN for this subnet. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this subnet. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this subnet. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this subnet. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalSubnetReference unmarshals an instance of SubnetReference from the specified map of raw messages. +func UnmarshalSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupRuleRemotePrototype : The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be -// specified as an IP address, a CIDR block, or a security group. If omitted, a CIDR block of `0.0.0.0/0` will be used -// to allow traffic from any source (or to any source, for outbound rules). -// Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeIP -// - SecurityGroupRuleRemotePrototypeCIDR -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentity -type SecurityGroupRuleRemotePrototype struct { - // The IP address. - // - // This property may add support for IPv6 addresses in the future. When processing a value in this property, verify - // that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the - // error, or bypass the resource on which the unexpected IP address format was encountered. - Address *string `json:"address,omitempty"` +// SubnetReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type SubnetReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} - // The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this - // property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt - // processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered. - CIDRBlock *string `json:"cidr_block,omitempty"` +// UnmarshalSubnetReferenceDeleted unmarshals an instance of SubnetReferenceDeleted from the specified map of raw messages. +func UnmarshalSubnetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SubnetReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The unique identifier for this security group. +// TrustedProfileIdentity : Identifies a trusted profile by a unique property. +// Models which "extend" this model: +// - TrustedProfileIdentityTrustedProfileByID +// - TrustedProfileIdentityTrustedProfileByCRN +type TrustedProfileIdentity struct { + // The unique identifier for this trusted profile. ID *string `json:"id,omitempty"` - // The security group's CRN. + // The CRN for this trusted profile. CRN *string `json:"crn,omitempty"` - - // The security group's canonical URL. - Href *string `json:"href,omitempty"` } -func (*SecurityGroupRuleRemotePrototype) isaSecurityGroupRuleRemotePrototype() bool { +func (*TrustedProfileIdentity) isaTrustedProfileIdentity() bool { return true } -type SecurityGroupRuleRemotePrototypeIntf interface { - isaSecurityGroupRuleRemotePrototype() bool -} - -// UnmarshalSecurityGroupRuleRemotePrototype unmarshals an instance of SecurityGroupRuleRemotePrototype from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototype) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - return - } +type TrustedProfileIdentityIntf interface { + isaTrustedProfileIdentity() bool +} + +// UnmarshalTrustedProfileIdentity unmarshals an instance of TrustedProfileIdentity from the specified map of raw messages. +func UnmarshalTrustedProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return @@ -46056,53 +52549,40 @@ func UnmarshalSecurityGroupRuleRemotePrototype(m map[string]json.RawMessage, res if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SecurityGroupTargetCollection : SecurityGroupTargetCollection struct -type SecurityGroupTargetCollection struct { - // A link to the first page of resources. - First *SecurityGroupTargetCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SecurityGroupTargetCollectionNext `json:"next,omitempty"` +// TrustedProfileReference : TrustedProfileReference struct +type TrustedProfileReference struct { + // The CRN for this trusted profile. + CRN *string `json:"crn" validate:"required"` - // Collection of targets for this security group. - Targets []SecurityGroupTargetReferenceIntf `json:"targets" validate:"required"` + // The unique identifier for this trusted profile. + ID *string `json:"id" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// UnmarshalSecurityGroupTargetCollection unmarshals an instance of SecurityGroupTargetCollection from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSecurityGroupTargetCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSecurityGroupTargetCollectionNext) +// Constants associated with the TrustedProfileReference.ResourceType property. +// The resource type. +const ( + TrustedProfileReferenceResourceTypeTrustedProfileConst = "trusted_profile" +) + +// UnmarshalTrustedProfileReference unmarshals an instance of TrustedProfileReference from the specified map of raw messages. +func UnmarshalTrustedProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "targets", &obj.Targets, UnmarshalSecurityGroupTargetReference) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } @@ -46110,3070 +52590,3601 @@ func UnmarshalSecurityGroupTargetCollection(m map[string]json.RawMessage, result return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SecurityGroupTargetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// UnsetSubnetPublicGatewayOptions : The UnsetSubnetPublicGateway options. +type UnsetSubnetPublicGatewayOptions struct { + // The subnet identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUnsetSubnetPublicGatewayOptions : Instantiate UnsetSubnetPublicGatewayOptions +func (*VpcV1) NewUnsetSubnetPublicGatewayOptions(id string) *UnsetSubnetPublicGatewayOptions { + return &UnsetSubnetPublicGatewayOptions{ + ID: core.StringPtr(id), } - return start, nil } -// SecurityGroupTargetCollectionFirst : A link to the first page of resources. -type SecurityGroupTargetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetID : Allow user to set ID +func (_options *UnsetSubnetPublicGatewayOptions) SetID(id string) *UnsetSubnetPublicGatewayOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupTargetCollectionFirst unmarshals an instance of SecurityGroupTargetCollectionFirst from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UnsetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *UnsetSubnetPublicGatewayOptions { + options.Headers = param + return options } -// SecurityGroupTargetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SecurityGroupTargetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// UpdateBareMetalServerDiskOptions : The UpdateBareMetalServerDisk options. +type UpdateBareMetalServerDiskOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` + + // The bare metal server disk identifier. + ID *string `json:"id" validate:"required,ne="` + + // The bare metal server disk patch. + BareMetalServerDiskPatch map[string]interface{} `json:"BareMetalServerDisk_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSecurityGroupTargetCollectionNext unmarshals an instance of SecurityGroupTargetCollectionNext from the specified map of raw messages. -func UnmarshalSecurityGroupTargetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateBareMetalServerDiskOptions : Instantiate UpdateBareMetalServerDiskOptions +func (*VpcV1) NewUpdateBareMetalServerDiskOptions(bareMetalServerID string, id string, bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { + return &UpdateBareMetalServerDiskOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), + BareMetalServerDiskPatch: bareMetalServerDiskPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SecurityGroupTargetReference : The resource types that can be security group targets are expected to expand in the future. When iterating over -// security group targets, do not assume that every target resource will be from a known set of resource types. -// Optionally halt processing and surface an error, or bypass resources of unrecognized types. -// Models which "extend" this model: -// - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext -// - SecurityGroupTargetReferenceLoadBalancerReference -// - SecurityGroupTargetReferenceEndpointGatewayReference -type SecurityGroupTargetReference struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *NetworkInterfaceReferenceTargetContextDeleted `json:"deleted,omitempty"` +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerDiskOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options +} - // The URL for this network interface. - Href *string `json:"href,omitempty"` +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerDiskOptions) SetID(id string) *UpdateBareMetalServerDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The unique identifier for this network interface. - ID *string `json:"id,omitempty"` +// SetBareMetalServerDiskPatch : Allow user to set BareMetalServerDiskPatch +func (_options *UpdateBareMetalServerDiskOptions) SetBareMetalServerDiskPatch(bareMetalServerDiskPatch map[string]interface{}) *UpdateBareMetalServerDiskOptions { + _options.BareMetalServerDiskPatch = bareMetalServerDiskPatch + return _options +} - // The user-defined name for this network interface. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerDiskOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerDiskOptions { + options.Headers = param + return options +} - // The resource type. - ResourceType *string `json:"resource_type,omitempty"` +// UpdateBareMetalServerNetworkInterfaceOptions : The UpdateBareMetalServerNetworkInterface options. +type UpdateBareMetalServerNetworkInterfaceOptions struct { + // The bare metal server identifier. + BareMetalServerID *string `json:"bare_metal_server_id" validate:"required,ne="` - // The load balancer's CRN. - CRN *string `json:"crn,omitempty"` + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` + + // The network interface patch. + BareMetalServerNetworkInterfacePatch map[string]interface{} `json:"BareMetalServerNetworkInterface_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the SecurityGroupTargetReference.ResourceType property. -// The resource type. -const ( - SecurityGroupTargetReferenceResourceTypeNetworkInterfaceConst = "network_interface" -) +// NewUpdateBareMetalServerNetworkInterfaceOptions : Instantiate UpdateBareMetalServerNetworkInterfaceOptions +func (*VpcV1) NewUpdateBareMetalServerNetworkInterfaceOptions(bareMetalServerID string, id string, bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { + return &UpdateBareMetalServerNetworkInterfaceOptions{ + BareMetalServerID: core.StringPtr(bareMetalServerID), + ID: core.StringPtr(id), + BareMetalServerNetworkInterfacePatch: bareMetalServerNetworkInterfacePatch, + } +} -func (*SecurityGroupTargetReference) isaSecurityGroupTargetReference() bool { - return true +// SetBareMetalServerID : Allow user to set BareMetalServerID +func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerID(bareMetalServerID string) *UpdateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerID = core.StringPtr(bareMetalServerID) + return _options } -type SecurityGroupTargetReferenceIntf interface { - isaSecurityGroupTargetReference() bool +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetID(id string) *UpdateBareMetalServerNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSecurityGroupTargetReference unmarshals an instance of SecurityGroupTargetReference from the specified map of raw messages. -func UnmarshalSecurityGroupTargetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupTargetReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalNetworkInterfaceReferenceTargetContextDeleted) - if err != nil { - return +// SetBareMetalServerNetworkInterfacePatch : Allow user to set BareMetalServerNetworkInterfacePatch +func (_options *UpdateBareMetalServerNetworkInterfaceOptions) SetBareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatch map[string]interface{}) *UpdateBareMetalServerNetworkInterfaceOptions { + _options.BareMetalServerNetworkInterfacePatch = bareMetalServerNetworkInterfacePatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerNetworkInterfaceOptions { + options.Headers = param + return options +} + +// UpdateBareMetalServerOptions : The UpdateBareMetalServer options. +type UpdateBareMetalServerOptions struct { + // The bare metal server identifier. + ID *string `json:"id" validate:"required,ne="` + + // The bare metal server patch. + BareMetalServerPatch map[string]interface{} `json:"BareMetalServer_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateBareMetalServerOptions : Instantiate UpdateBareMetalServerOptions +func (*VpcV1) NewUpdateBareMetalServerOptions(id string, bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { + return &UpdateBareMetalServerOptions{ + ID: core.StringPtr(id), + BareMetalServerPatch: bareMetalServerPatch, } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *UpdateBareMetalServerOptions) SetID(id string) *UpdateBareMetalServerOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetBareMetalServerPatch : Allow user to set BareMetalServerPatch +func (_options *UpdateBareMetalServerOptions) SetBareMetalServerPatch(bareMetalServerPatch map[string]interface{}) *UpdateBareMetalServerOptions { + _options.BareMetalServerPatch = bareMetalServerPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateBareMetalServerOptions) SetHeaders(param map[string]string) *UpdateBareMetalServerOptions { + options.Headers = param + return options +} + +// UpdateDedicatedHostDiskOptions : The UpdateDedicatedHostDisk options. +type UpdateDedicatedHostDiskOptions struct { + // The dedicated host identifier. + DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` + + // The dedicated host disk identifier. + ID *string `json:"id" validate:"required,ne="` + + // The dedicated host disk patch. + DedicatedHostDiskPatch map[string]interface{} `json:"DedicatedHostDisk_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateDedicatedHostDiskOptions : Instantiate UpdateDedicatedHostDiskOptions +func (*VpcV1) NewUpdateDedicatedHostDiskOptions(dedicatedHostID string, id string, dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { + return &UpdateDedicatedHostDiskOptions{ + DedicatedHostID: core.StringPtr(dedicatedHostID), + ID: core.StringPtr(id), + DedicatedHostDiskPatch: dedicatedHostDiskPatch, } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return +} + +// SetDedicatedHostID : Allow user to set DedicatedHostID +func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *UpdateDedicatedHostDiskOptions { + _options.DedicatedHostID = core.StringPtr(dedicatedHostID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateDedicatedHostDiskOptions) SetID(id string) *UpdateDedicatedHostDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetDedicatedHostDiskPatch : Allow user to set DedicatedHostDiskPatch +func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostDiskPatch(dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { + _options.DedicatedHostDiskPatch = dedicatedHostDiskPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateDedicatedHostDiskOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostDiskOptions { + options.Headers = param + return options +} + +// UpdateDedicatedHostGroupOptions : The UpdateDedicatedHostGroup options. +type UpdateDedicatedHostGroupOptions struct { + // The dedicated host group identifier. + ID *string `json:"id" validate:"required,ne="` + + // The dedicated host group patch. + DedicatedHostGroupPatch map[string]interface{} `json:"DedicatedHostGroup_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateDedicatedHostGroupOptions : Instantiate UpdateDedicatedHostGroupOptions +func (*VpcV1) NewUpdateDedicatedHostGroupOptions(id string, dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { + return &UpdateDedicatedHostGroupOptions{ + ID: core.StringPtr(id), + DedicatedHostGroupPatch: dedicatedHostGroupPatch, } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *UpdateDedicatedHostGroupOptions) SetID(id string) *UpdateDedicatedHostGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetDedicatedHostGroupPatch : Allow user to set DedicatedHostGroupPatch +func (_options *UpdateDedicatedHostGroupOptions) SetDedicatedHostGroupPatch(dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { + _options.DedicatedHostGroupPatch = dedicatedHostGroupPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostGroupOptions { + options.Headers = param + return options +} + +// UpdateDedicatedHostOptions : The UpdateDedicatedHost options. +type UpdateDedicatedHostOptions struct { + // The dedicated host identifier. + ID *string `json:"id" validate:"required,ne="` + + // The dedicated host patch. + DedicatedHostPatch map[string]interface{} `json:"DedicatedHost_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateDedicatedHostOptions : Instantiate UpdateDedicatedHostOptions +func (*VpcV1) NewUpdateDedicatedHostOptions(id string, dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { + return &UpdateDedicatedHostOptions{ + ID: core.StringPtr(id), + DedicatedHostPatch: dedicatedHostPatch, } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *UpdateDedicatedHostOptions) SetID(id string) *UpdateDedicatedHostOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetDedicatedHostPatch : Allow user to set DedicatedHostPatch +func (_options *UpdateDedicatedHostOptions) SetDedicatedHostPatch(dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { + _options.DedicatedHostPatch = dedicatedHostPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateDedicatedHostOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostOptions { + options.Headers = param + return options +} + +// UpdateEndpointGatewayOptions : The UpdateEndpointGateway options. +type UpdateEndpointGatewayOptions struct { + // The endpoint gateway identifier. + ID *string `json:"id" validate:"required,ne="` + + // The endpoint gateway patch. + EndpointGatewayPatch map[string]interface{} `json:"EndpointGateway_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateEndpointGatewayOptions : Instantiate UpdateEndpointGatewayOptions +func (*VpcV1) NewUpdateEndpointGatewayOptions(id string, endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { + return &UpdateEndpointGatewayOptions{ + ID: core.StringPtr(id), + EndpointGatewayPatch: endpointGatewayPatch, } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return +} + +// SetID : Allow user to set ID +func (_options *UpdateEndpointGatewayOptions) SetID(id string) *UpdateEndpointGatewayOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetEndpointGatewayPatch : Allow user to set EndpointGatewayPatch +func (_options *UpdateEndpointGatewayOptions) SetEndpointGatewayPatch(endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { + _options.EndpointGatewayPatch = endpointGatewayPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayOptions { + options.Headers = param + return options +} + +// UpdateFloatingIPOptions : The UpdateFloatingIP options. +type UpdateFloatingIPOptions struct { + // The floating IP identifier. + ID *string `json:"id" validate:"required,ne="` + + // The floating IP patch. + FloatingIPPatch map[string]interface{} `json:"FloatingIP_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateFloatingIPOptions : Instantiate UpdateFloatingIPOptions +func (*VpcV1) NewUpdateFloatingIPOptions(id string, floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { + return &UpdateFloatingIPOptions{ + ID: core.StringPtr(id), + FloatingIPPatch: floatingIPPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SetSubnetPublicGatewayOptions : The SetSubnetPublicGateway options. -type SetSubnetPublicGatewayOptions struct { - // The subnet identifier. +// SetID : Allow user to set ID +func (_options *UpdateFloatingIPOptions) SetID(id string) *UpdateFloatingIPOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetFloatingIPPatch : Allow user to set FloatingIPPatch +func (_options *UpdateFloatingIPOptions) SetFloatingIPPatch(floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { + _options.FloatingIPPatch = floatingIPPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateFloatingIPOptions) SetHeaders(param map[string]string) *UpdateFloatingIPOptions { + options.Headers = param + return options +} + +// UpdateFlowLogCollectorOptions : The UpdateFlowLogCollector options. +type UpdateFlowLogCollectorOptions struct { + // The flow log collector identifier. ID *string `json:"id" validate:"required,ne="` - // The public gateway identity. - PublicGatewayIdentity PublicGatewayIdentityIntf `json:"PublicGatewayIdentity" validate:"required"` + // The flow log collector patch. + FlowLogCollectorPatch map[string]interface{} `json:"FlowLogCollector_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewSetSubnetPublicGatewayOptions : Instantiate SetSubnetPublicGatewayOptions -func (*VpcV1) NewSetSubnetPublicGatewayOptions(id string, publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { - return &SetSubnetPublicGatewayOptions{ +// NewUpdateFlowLogCollectorOptions : Instantiate UpdateFlowLogCollectorOptions +func (*VpcV1) NewUpdateFlowLogCollectorOptions(id string, flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { + return &UpdateFlowLogCollectorOptions{ ID: core.StringPtr(id), - PublicGatewayIdentity: publicGatewayIdentity, + FlowLogCollectorPatch: flowLogCollectorPatch, } } // SetID : Allow user to set ID -func (_options *SetSubnetPublicGatewayOptions) SetID(id string) *SetSubnetPublicGatewayOptions { +func (_options *UpdateFlowLogCollectorOptions) SetID(id string) *UpdateFlowLogCollectorOptions { _options.ID = core.StringPtr(id) return _options } -// SetPublicGatewayIdentity : Allow user to set PublicGatewayIdentity -func (_options *SetSubnetPublicGatewayOptions) SetPublicGatewayIdentity(publicGatewayIdentity PublicGatewayIdentityIntf) *SetSubnetPublicGatewayOptions { - _options.PublicGatewayIdentity = publicGatewayIdentity +// SetFlowLogCollectorPatch : Allow user to set FlowLogCollectorPatch +func (_options *UpdateFlowLogCollectorOptions) SetFlowLogCollectorPatch(flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { + _options.FlowLogCollectorPatch = flowLogCollectorPatch return _options } // SetHeaders : Allow user to set Headers -func (options *SetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *SetSubnetPublicGatewayOptions { +func (options *UpdateFlowLogCollectorOptions) SetHeaders(param map[string]string) *UpdateFlowLogCollectorOptions { options.Headers = param return options } -// Snapshot : Snapshot struct -type Snapshot struct { - // Indicates if a boot volume attachment can be created with a volume created from this snapshot. - Bootable *bool `json:"bootable" validate:"required"` +// UpdateIkePolicyOptions : The UpdateIkePolicy options. +type UpdateIkePolicyOptions struct { + // The IKE policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The date and time the data capture for this snapshot was completed. - // - // If absent, this snapshot's data has not yet been captured. Additionally, this property may be absent for snapshots - // created before 1 January 2022. - CapturedAt *strfmt.DateTime `json:"captured_at,omitempty"` + // The IKE policy patch. + IkePolicyPatch map[string]interface{} `json:"IKEPolicy_patch" validate:"required"` - // The date and time that this snapshot was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The CRN for this snapshot. - CRN *string `json:"crn" validate:"required"` +// NewUpdateIkePolicyOptions : Instantiate UpdateIkePolicyOptions +func (*VpcV1) NewUpdateIkePolicyOptions(id string, ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { + return &UpdateIkePolicyOptions{ + ID: core.StringPtr(id), + IkePolicyPatch: ikePolicyPatch, + } +} - // Indicates whether this snapshot can be deleted. This value will always be `true`. - Deletable *bool `json:"deletable" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateIkePolicyOptions) SetID(id string) *UpdateIkePolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The type of encryption used on the source volume. - Encryption *string `json:"encryption" validate:"required"` +// SetIkePolicyPatch : Allow user to set IkePolicyPatch +func (_options *UpdateIkePolicyOptions) SetIkePolicyPatch(ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { + _options.IkePolicyPatch = ikePolicyPatch + return _options +} - // The root key used to wrap the data encryption key for the source volume. - // - // This property will be present for volumes with an `encryption` type of - // `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateIkePolicyOptions) SetHeaders(param map[string]string) *UpdateIkePolicyOptions { + options.Headers = param + return options +} - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` +// UpdateImageOptions : The UpdateImage options. +type UpdateImageOptions struct { + // The image identifier. + ID *string `json:"id" validate:"required,ne="` - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` + // The image patch. + ImagePatch map[string]interface{} `json:"Image_patch" validate:"required"` - // The lifecycle state of this snapshot. - LifecycleState *string `json:"lifecycle_state" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateImageOptions : Instantiate UpdateImageOptions +func (*VpcV1) NewUpdateImageOptions(id string, imagePatch map[string]interface{}) *UpdateImageOptions { + return &UpdateImageOptions{ + ID: core.StringPtr(id), + ImagePatch: imagePatch, + } +} - // The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the - // capacity of the `source_volume`. - MinimumCapacity *int64 `json:"minimum_capacity" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateImageOptions) SetID(id string) *UpdateImageOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The user-defined name for this snapshot. - Name *string `json:"name" validate:"required"` +// SetImagePatch : Allow user to set ImagePatch +func (_options *UpdateImageOptions) SetImagePatch(imagePatch map[string]interface{}) *UpdateImageOptions { + _options.ImagePatch = imagePatch + return _options +} - // The operating system included in this image. - OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateImageOptions) SetHeaders(param map[string]string) *UpdateImageOptions { + options.Headers = param + return options +} - // The resource group for this snapshot. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` +// UpdateInstanceDiskOptions : The UpdateInstanceDisk options. +type UpdateInstanceDiskOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The instance disk identifier. + ID *string `json:"id" validate:"required,ne="` - // The size of this snapshot rounded up to the next gigabyte. - Size *int64 `json:"size" validate:"required"` + // The instance disk patch. + InstanceDiskPatch map[string]interface{} `json:"InstanceDisk_patch" validate:"required"` - // If present, the image from which the data on this volume was most directly - // provisioned. - SourceImage *ImageReference `json:"source_image,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The source volume this snapshot was created from (may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - SourceVolume *VolumeReference `json:"source_volume" validate:"required"` +// NewUpdateInstanceDiskOptions : Instantiate UpdateInstanceDiskOptions +func (*VpcV1) NewUpdateInstanceDiskOptions(instanceID string, id string, instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { + return &UpdateInstanceDiskOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + InstanceDiskPatch: instanceDiskPatch, + } } -// Constants associated with the Snapshot.Encryption property. -// The type of encryption used on the source volume. -const ( - SnapshotEncryptionProviderManagedConst = "provider_managed" - SnapshotEncryptionUserManagedConst = "user_managed" -) +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceDiskOptions) SetInstanceID(instanceID string) *UpdateInstanceDiskOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} -// Constants associated with the Snapshot.LifecycleState property. -// The lifecycle state of this snapshot. -const ( - SnapshotLifecycleStateDeletingConst = "deleting" - SnapshotLifecycleStateFailedConst = "failed" - SnapshotLifecycleStatePendingConst = "pending" - SnapshotLifecycleStateStableConst = "stable" - SnapshotLifecycleStateSuspendedConst = "suspended" - SnapshotLifecycleStateUpdatingConst = "updating" - SnapshotLifecycleStateWaitingConst = "waiting" -) +// SetID : Allow user to set ID +func (_options *UpdateInstanceDiskOptions) SetID(id string) *UpdateInstanceDiskOptions { + _options.ID = core.StringPtr(id) + return _options +} -// Constants associated with the Snapshot.ResourceType property. -// The resource type. -const ( - SnapshotResourceTypeSnapshotConst = "snapshot" -) +// SetInstanceDiskPatch : Allow user to set InstanceDiskPatch +func (_options *UpdateInstanceDiskOptions) SetInstanceDiskPatch(instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { + _options.InstanceDiskPatch = instanceDiskPatch + return _options +} -// UnmarshalSnapshot unmarshals an instance of Snapshot from the specified map of raw messages. -func UnmarshalSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Snapshot) - err = core.UnmarshalPrimitive(m, "bootable", &obj.Bootable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "captured_at", &obj.CapturedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "deletable", &obj.Deletable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "minimum_capacity", &obj.MinimumCapacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystem) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "size", &obj.Size) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_volume", &obj.SourceVolume, UnmarshalVolumeReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceDiskOptions) SetHeaders(param map[string]string) *UpdateInstanceDiskOptions { + options.Headers = param + return options } -// SnapshotCollection : SnapshotCollection struct -type SnapshotCollection struct { - // A link to the first page of resources. - First *SnapshotCollectionFirst `json:"first" validate:"required"` +// UpdateInstanceGroupManagerActionOptions : The UpdateInstanceGroupManagerAction options. +type UpdateInstanceGroupManagerActionOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SnapshotCollectionNext `json:"next,omitempty"` + // The instance group manager action identifier. + ID *string `json:"id" validate:"required,ne="` - // Collection of snapshots. - Snapshots []Snapshot `json:"snapshots" validate:"required"` + // The instance group manager action patch. + InstanceGroupManagerActionPatch map[string]interface{} `json:"InstanceGroupManagerAction_patch" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSnapshotCollection unmarshals an instance of SnapshotCollection from the specified map of raw messages. -func UnmarshalSnapshotCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSnapshotCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSnapshotCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "snapshots", &obj.Snapshots, UnmarshalSnapshot) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return +// NewUpdateInstanceGroupManagerActionOptions : Instantiate UpdateInstanceGroupManagerActionOptions +func (*VpcV1) NewUpdateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { + return &UpdateInstanceGroupManagerActionOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), + InstanceGroupManagerActionPatch: instanceGroupManagerActionPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SnapshotCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerActionOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// SnapshotCollectionFirst : A link to the first page of resources. -type SnapshotCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options } -// UnmarshalSnapshotCollectionFirst unmarshals an instance of SnapshotCollectionFirst from the specified map of raw messages. -func UnmarshalSnapshotCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupManagerActionOptions) SetID(id string) *UpdateInstanceGroupManagerActionOptions { + _options.ID = core.StringPtr(id) + return _options } -// SnapshotCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SnapshotCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceGroupManagerActionPatch : Allow user to set InstanceGroupManagerActionPatch +func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPatch(instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { + _options.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatch + return _options } -// UnmarshalSnapshotCollectionNext unmarshals an instance of SnapshotCollectionNext from the specified map of raw messages. -func UnmarshalSnapshotCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerActionOptions { + options.Headers = param + return options } -// SnapshotIdentity : Identifies a snapshot by a unique property. -// Models which "extend" this model: -// - SnapshotIdentityByID -// - SnapshotIdentityByCRN -// - SnapshotIdentityByHref -type SnapshotIdentity struct { - // The unique identifier for this snapshot. - ID *string `json:"id,omitempty"` - - // The CRN for this snapshot. - CRN *string `json:"crn,omitempty"` +// UpdateInstanceGroupManagerOptions : The UpdateInstanceGroupManager options. +type UpdateInstanceGroupManagerOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The URL for this snapshot. - Href *string `json:"href,omitempty"` -} + // The instance group manager identifier. + ID *string `json:"id" validate:"required,ne="` -func (*SnapshotIdentity) isaSnapshotIdentity() bool { - return true -} + // The instance group manager patch. + InstanceGroupManagerPatch map[string]interface{} `json:"InstanceGroupManager_patch" validate:"required"` -type SnapshotIdentityIntf interface { - isaSnapshotIdentity() bool + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSnapshotIdentity unmarshals an instance of SnapshotIdentity from the specified map of raw messages. -func UnmarshalSnapshotIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// NewUpdateInstanceGroupManagerOptions : Instantiate UpdateInstanceGroupManagerOptions +func (*VpcV1) NewUpdateInstanceGroupManagerOptions(instanceGroupID string, id string, instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { + return &UpdateInstanceGroupManagerOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), + InstanceGroupManagerPatch: instanceGroupManagerPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SnapshotPatch : SnapshotPatch struct -type SnapshotPatch struct { - // The user-defined name for this snapshot. - Name *string `json:"name,omitempty"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// UnmarshalSnapshotPatch unmarshals an instance of SnapshotPatch from the specified map of raw messages. -func UnmarshalSnapshotPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupManagerOptions) SetID(id string) *UpdateInstanceGroupManagerOptions { + _options.ID = core.StringPtr(id) + return _options } -// AsPatch returns a generic map representation of the SnapshotPatch -func (snapshotPatch *SnapshotPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(snapshotPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetInstanceGroupManagerPatch : Allow user to set InstanceGroupManagerPatch +func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupManagerPatch(instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { + _options.InstanceGroupManagerPatch = instanceGroupManagerPatch + return _options } -// SnapshotReference : SnapshotReference struct -type SnapshotReference struct { - // The CRN for this snapshot. - CRN *string `json:"crn" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerOptions { + options.Headers = param + return options +} - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *SnapshotReferenceDeleted `json:"deleted,omitempty"` +// UpdateInstanceGroupManagerPolicyOptions : The UpdateInstanceGroupManagerPolicy options. +type UpdateInstanceGroupManagerPolicyOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The URL for this snapshot. - Href *string `json:"href" validate:"required"` + // The instance group manager identifier. + InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - // The unique identifier for this snapshot. - ID *string `json:"id" validate:"required"` + // The instance group manager policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The user-defined name for this snapshot. - Name *string `json:"name" validate:"required"` + // The instance group manager policy patch. + InstanceGroupManagerPolicyPatch map[string]interface{} `json:"InstanceGroupManagerPolicy_patch" validate:"required"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string } -// Constants associated with the SnapshotReference.ResourceType property. -// The resource type. -const ( - SnapshotReferenceResourceTypeSnapshotConst = "snapshot" -) - -// UnmarshalSnapshotReference unmarshals an instance of SnapshotReference from the specified map of raw messages. -func UnmarshalSnapshotReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSnapshotReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) - if err != nil { - return +// NewUpdateInstanceGroupManagerPolicyOptions : Instantiate UpdateInstanceGroupManagerPolicyOptions +func (*VpcV1) NewUpdateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { + return &UpdateInstanceGroupManagerPolicyOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), + ID: core.StringPtr(id), + InstanceGroupManagerPolicyPatch: instanceGroupManagerPolicyPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SnapshotReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type SnapshotReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options } -// UnmarshalSnapshotReferenceDeleted unmarshals an instance of SnapshotReferenceDeleted from the specified map of raw messages. -func UnmarshalSnapshotReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SnapshotReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) + return _options } -// Subnet : Subnet struct -type Subnet struct { - // The number of IPv4 addresses in this subnet that are not in-use, and have not been reserved by the user or the - // provider. - AvailableIpv4AddressCount *int64 `json:"available_ipv4_address_count" validate:"required"` - - // The date and time that the subnet was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` - - // The URL for this subnet. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetID(id string) *UpdateInstanceGroupManagerPolicyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The IP version(s) supported by this subnet. - IPVersion *string `json:"ip_version" validate:"required"` +// SetInstanceGroupManagerPolicyPatch : Allow user to set InstanceGroupManagerPolicyPatch +func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { + _options.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatch + return _options +} - // The IPv4 range of the subnet, expressed in CIDR format. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerPolicyOptions { + options.Headers = param + return options +} - // The user-defined name for this subnet. - Name *string `json:"name" validate:"required"` +// UpdateInstanceGroupMembershipOptions : The UpdateInstanceGroupMembership options. +type UpdateInstanceGroupMembershipOptions struct { + // The instance group identifier. + InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - // The network ACL for this subnet. - NetworkACL *NetworkACLReference `json:"network_acl" validate:"required"` + // The instance group membership identifier. + ID *string `json:"id" validate:"required,ne="` - // The public gateway to use for internet-bound traffic for this subnet. - PublicGateway *PublicGatewayReference `json:"public_gateway,omitempty"` + // The instance group membership patch. + InstanceGroupMembershipPatch map[string]interface{} `json:"InstanceGroupMembership_patch" validate:"required"` - // The resource group for this subnet. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The routing table for this subnet. - RoutingTable *RoutingTableReference `json:"routing_table" validate:"required"` +// NewUpdateInstanceGroupMembershipOptions : Instantiate UpdateInstanceGroupMembershipOptions +func (*VpcV1) NewUpdateInstanceGroupMembershipOptions(instanceGroupID string, id string, instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { + return &UpdateInstanceGroupMembershipOptions{ + InstanceGroupID: core.StringPtr(instanceGroupID), + ID: core.StringPtr(id), + InstanceGroupMembershipPatch: instanceGroupMembershipPatch, + } +} - // The status of the subnet. - Status *string `json:"status" validate:"required"` +// SetInstanceGroupID : Allow user to set InstanceGroupID +func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupMembershipOptions { + _options.InstanceGroupID = core.StringPtr(instanceGroupID) + return _options +} - // The total number of IPv4 addresses in this subnet. - // - // Note: This is calculated as 2(32 − prefix length). For example, the prefix length `/24` gives:
- // 2(32 − 24) = 28 = 256 addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupMembershipOptions) SetID(id string) *UpdateInstanceGroupMembershipOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The VPC this subnet is a part of. - VPC *VPCReference `json:"vpc" validate:"required"` +// SetInstanceGroupMembershipPatch : Allow user to set InstanceGroupMembershipPatch +func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupMembershipPatch(instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { + _options.InstanceGroupMembershipPatch = instanceGroupMembershipPatch + return _options +} - // The zone this subnet resides in. - Zone *ZoneReference `json:"zone" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupMembershipOptions { + options.Headers = param + return options } -// Constants associated with the Subnet.IPVersion property. -// The IP version(s) supported by this subnet. -const ( - SubnetIPVersionIpv4Const = "ipv4" -) +// UpdateInstanceGroupOptions : The UpdateInstanceGroup options. +type UpdateInstanceGroupOptions struct { + // The instance group identifier. + ID *string `json:"id" validate:"required,ne="` -// Constants associated with the Subnet.Status property. -// The status of the subnet. -const ( - SubnetStatusAvailableConst = "available" - SubnetStatusDeletingConst = "deleting" - SubnetStatusFailedConst = "failed" - SubnetStatusPendingConst = "pending" -) + // The instance group patch. + InstanceGroupPatch map[string]interface{} `json:"InstanceGroup_patch" validate:"required"` -// UnmarshalSubnet unmarshals an instance of Subnet from the specified map of raw messages. -func UnmarshalSubnet(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Subnet) - err = core.UnmarshalPrimitive(m, "available_ipv4_address_count", &obj.AvailableIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateInstanceGroupOptions : Instantiate UpdateInstanceGroupOptions +func (*VpcV1) NewUpdateInstanceGroupOptions(id string, instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { + return &UpdateInstanceGroupOptions{ + ID: core.StringPtr(id), + InstanceGroupPatch: instanceGroupPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SubnetCollection : SubnetCollection struct -type SubnetCollection struct { - // A link to the first page of resources. - First *SubnetCollectionFirst `json:"first" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateInstanceGroupOptions) SetID(id string) *UpdateInstanceGroupOptions { + _options.ID = core.StringPtr(id) + return _options +} - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// SetInstanceGroupPatch : Allow user to set InstanceGroupPatch +func (_options *UpdateInstanceGroupOptions) SetInstanceGroupPatch(instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { + _options.InstanceGroupPatch = instanceGroupPatch + return _options +} - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *SubnetCollectionNext `json:"next,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceGroupOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupOptions { + options.Headers = param + return options +} - // Collection of subnets. - Subnets []Subnet `json:"subnets" validate:"required"` +// UpdateInstanceNetworkInterfaceOptions : The UpdateInstanceNetworkInterface options. +type UpdateInstanceNetworkInterfaceOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} + // The network interface identifier. + ID *string `json:"id" validate:"required,ne="` -// UnmarshalSubnetCollection unmarshals an instance of SubnetCollection from the specified map of raw messages. -func UnmarshalSubnetCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalSubnetCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalSubnetCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "subnets", &obj.Subnets, UnmarshalSubnet) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // The network interface patch. + NetworkInterfacePatch map[string]interface{} `json:"NetworkInterface_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *SubnetCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err +// NewUpdateInstanceNetworkInterfaceOptions : Instantiate UpdateInstanceNetworkInterfaceOptions +func (*VpcV1) NewUpdateInstanceNetworkInterfaceOptions(instanceID string, id string, networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { + return &UpdateInstanceNetworkInterfaceOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + NetworkInterfacePatch: networkInterfacePatch, } - return start, nil } -// SubnetCollectionFirst : A link to the first page of resources. -type SubnetCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkInterfaceOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options } -// UnmarshalSubnetCollectionFirst unmarshals an instance of SubnetCollectionFirst from the specified map of raw messages. -func UnmarshalSubnetCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceNetworkInterfaceOptions) SetID(id string) *UpdateInstanceNetworkInterfaceOptions { + _options.ID = core.StringPtr(id) + return _options } -// SubnetCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type SubnetCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// SetNetworkInterfacePatch : Allow user to set NetworkInterfacePatch +func (_options *UpdateInstanceNetworkInterfaceOptions) SetNetworkInterfacePatch(networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { + _options.NetworkInterfacePatch = networkInterfacePatch + return _options } -// UnmarshalSubnetCollectionNext unmarshals an instance of SubnetCollectionNext from the specified map of raw messages. -func UnmarshalSubnetCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkInterfaceOptions { + options.Headers = param + return options } -// SubnetIdentity : Identifies a subnet by a unique property. -// Models which "extend" this model: -// - SubnetIdentityByID -// - SubnetIdentityByCRN -// - SubnetIdentityByHref -type SubnetIdentity struct { - // The unique identifier for this subnet. - ID *string `json:"id,omitempty"` +// UpdateInstanceOptions : The UpdateInstance options. +type UpdateInstanceOptions struct { + // The instance identifier. + ID *string `json:"id" validate:"required,ne="` - // The CRN for this subnet. - CRN *string `json:"crn,omitempty"` + // The instance patch. + InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` - // The URL for this subnet. - Href *string `json:"href,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*SubnetIdentity) isaSubnetIdentity() bool { - return true +// NewUpdateInstanceOptions : Instantiate UpdateInstanceOptions +func (*VpcV1) NewUpdateInstanceOptions(id string, instancePatch map[string]interface{}) *UpdateInstanceOptions { + return &UpdateInstanceOptions{ + ID: core.StringPtr(id), + InstancePatch: instancePatch, + } } -type SubnetIdentityIntf interface { - isaSubnetIdentity() bool +// SetID : Allow user to set ID +func (_options *UpdateInstanceOptions) SetID(id string) *UpdateInstanceOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSubnetIdentity unmarshals an instance of SubnetIdentity from the specified map of raw messages. -func UnmarshalSubnetIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetInstancePatch : Allow user to set InstancePatch +func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string]interface{}) *UpdateInstanceOptions { + _options.InstancePatch = instancePatch + return _options } -// SubnetPatch : SubnetPatch struct -type SubnetPatch struct { - // The user-defined name for this subnet. Names must be unique within the VPC the subnet resides in. - Name *string `json:"name,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { + options.Headers = param + return options +} - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` +// UpdateInstanceTemplateOptions : The UpdateInstanceTemplate options. +type UpdateInstanceTemplateOptions struct { + // The instance template identifier. + ID *string `json:"id" validate:"required,ne="` - // The public gateway to use for internet-bound traffic for this subnet. - PublicGateway SubnetPublicGatewayPatchIntf `json:"public_gateway,omitempty"` + // The instance template patch. + InstanceTemplatePatch map[string]interface{} `json:"InstanceTemplate_patch" validate:"required"` - // The routing table to use for this subnet. The routing table properties - // `route_direct_link_ingress`, `route_transit_gateway_ingress`, and - // `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSubnetPatch unmarshals an instance of SubnetPatch from the specified map of raw messages. -func UnmarshalSubnetPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalSubnetPublicGatewayPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return +// NewUpdateInstanceTemplateOptions : Instantiate UpdateInstanceTemplateOptions +func (*VpcV1) NewUpdateInstanceTemplateOptions(id string, instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { + return &UpdateInstanceTemplateOptions{ + ID: core.StringPtr(id), + InstanceTemplatePatch: instanceTemplatePatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// AsPatch returns a generic map representation of the SubnetPatch -func (subnetPatch *SubnetPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(subnetPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return +// SetID : Allow user to set ID +func (_options *UpdateInstanceTemplateOptions) SetID(id string) *UpdateInstanceTemplateOptions { + _options.ID = core.StringPtr(id) + return _options } -// SubnetPrototype : SubnetPrototype struct -// Models which "extend" this model: -// - SubnetPrototypeSubnetByTotalCount -// - SubnetPrototypeSubnetByCIDR -type SubnetPrototype struct { - // The IP version(s) to support for this subnet. - IPVersion *string `json:"ip_version,omitempty"` - - // The user-defined name for this subnet. Names must be unique within the VPC the subnet resides in. If unspecified, - // the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The network ACL to use for this subnet. - NetworkACL NetworkACLIdentityIntf `json:"network_acl,omitempty"` - - // The public gateway to use for internet-bound traffic for this subnet. If - // unspecified, the subnet will not be attached to a public gateway. - PublicGateway PublicGatewayIdentityIntf `json:"public_gateway,omitempty"` +// SetInstanceTemplatePatch : Allow user to set InstanceTemplatePatch +func (_options *UpdateInstanceTemplateOptions) SetInstanceTemplatePatch(instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { + _options.InstanceTemplatePatch = instanceTemplatePatch + return _options +} - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceTemplateOptions) SetHeaders(param map[string]string) *UpdateInstanceTemplateOptions { + options.Headers = param + return options +} - // The routing table to use for this subnet. If unspecified, the default routing table - // for the VPC is used. The routing table properties `route_direct_link_ingress`, - // `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - RoutingTable RoutingTableIdentityIntf `json:"routing_table,omitempty"` +// UpdateInstanceVolumeAttachmentOptions : The UpdateInstanceVolumeAttachment options. +type UpdateInstanceVolumeAttachmentOptions struct { + // The instance identifier. + InstanceID *string `json:"instance_id" validate:"required,ne="` - // The VPC the subnet is to be a part of. - VPC VPCIdentityIntf `json:"vpc" validate:"required"` + // The volume attachment identifier. + ID *string `json:"id" validate:"required,ne="` - // The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the - // specified zone, and that prefix must have a free CIDR range with at least this number of addresses. - TotalIpv4AddressCount *int64 `json:"total_ipv4_address_count,omitempty"` + // The volume attachment patch. + VolumeAttachmentPatch map[string]interface{} `json:"VolumeAttachment_patch" validate:"required"` - // The zone this subnet will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` - // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing - // address prefix in the VPC. The subnet will be created in the zone of the address prefix that contains the IPv4 CIDR. - // If zone is specified, it must match the zone of the address prefix that contains the subnet's IPv4 CIDR. - Ipv4CIDRBlock *string `json:"ipv4_cidr_block,omitempty"` +// NewUpdateInstanceVolumeAttachmentOptions : Instantiate UpdateInstanceVolumeAttachmentOptions +func (*VpcV1) NewUpdateInstanceVolumeAttachmentOptions(instanceID string, id string, volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { + return &UpdateInstanceVolumeAttachmentOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(id), + VolumeAttachmentPatch: volumeAttachmentPatch, + } } -// Constants associated with the SubnetPrototype.IPVersion property. -// The IP version(s) to support for this subnet. -const ( - SubnetPrototypeIPVersionIpv4Const = "ipv4" -) +// SetInstanceID : Allow user to set InstanceID +func (_options *UpdateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceVolumeAttachmentOptions { + _options.InstanceID = core.StringPtr(instanceID) + return _options +} -func (*SubnetPrototype) isaSubnetPrototype() bool { - return true +// SetID : Allow user to set ID +func (_options *UpdateInstanceVolumeAttachmentOptions) SetID(id string) *UpdateInstanceVolumeAttachmentOptions { + _options.ID = core.StringPtr(id) + return _options } -type SubnetPrototypeIntf interface { - isaSubnetPrototype() bool +// SetVolumeAttachmentPatch : Allow user to set VolumeAttachmentPatch +func (_options *UpdateInstanceVolumeAttachmentOptions) SetVolumeAttachmentPatch(volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { + _options.VolumeAttachmentPatch = volumeAttachmentPatch + return _options } -// UnmarshalSubnetPrototype unmarshals an instance of SubnetPrototype from the specified map of raw messages. -func UnmarshalSubnetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPrototype) - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_acl", &obj.NetworkACL, UnmarshalNetworkACLIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "public_gateway", &obj.PublicGateway, UnmarshalPublicGatewayIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routing_table", &obj.RoutingTable, UnmarshalRoutingTableIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_ipv4_address_count", &obj.TotalIpv4AddressCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ipv4_cidr_block", &obj.Ipv4CIDRBlock) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *UpdateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceVolumeAttachmentOptions { + options.Headers = param + return options } -// SubnetPublicGatewayPatch : The public gateway to use for internet-bound traffic for this subnet. -// Models which "extend" this model: -// - SubnetPublicGatewayPatchPublicGatewayIdentityByID -// - SubnetPublicGatewayPatchPublicGatewayIdentityByCRN -// - SubnetPublicGatewayPatchPublicGatewayIdentityByHref -type SubnetPublicGatewayPatch struct { - // The unique identifier for this public gateway. - ID *string `json:"id,omitempty"` +// UpdateIpsecPolicyOptions : The UpdateIpsecPolicy options. +type UpdateIpsecPolicyOptions struct { + // The IPsec policy identifier. + ID *string `json:"id" validate:"required,ne="` - // The CRN for this public gateway. - CRN *string `json:"crn,omitempty"` + // The IPsec policy patch. + IPsecPolicyPatch map[string]interface{} `json:"IPsecPolicy_patch" validate:"required"` - // The URL for this public gateway. - Href *string `json:"href,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string } -func (*SubnetPublicGatewayPatch) isaSubnetPublicGatewayPatch() bool { - return true +// NewUpdateIpsecPolicyOptions : Instantiate UpdateIpsecPolicyOptions +func (*VpcV1) NewUpdateIpsecPolicyOptions(id string, iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { + return &UpdateIpsecPolicyOptions{ + ID: core.StringPtr(id), + IPsecPolicyPatch: iPsecPolicyPatch, + } } -type SubnetPublicGatewayPatchIntf interface { - isaSubnetPublicGatewayPatch() bool +// SetID : Allow user to set ID +func (_options *UpdateIpsecPolicyOptions) SetID(id string) *UpdateIpsecPolicyOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnmarshalSubnetPublicGatewayPatch unmarshals an instance of SubnetPublicGatewayPatch from the specified map of raw messages. -func UnmarshalSubnetPublicGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetPublicGatewayPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return +// SetIPsecPolicyPatch : Allow user to set IPsecPolicyPatch +func (_options *UpdateIpsecPolicyOptions) SetIPsecPolicyPatch(iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { + _options.IPsecPolicyPatch = iPsecPolicyPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateIpsecPolicyOptions) SetHeaders(param map[string]string) *UpdateIpsecPolicyOptions { + options.Headers = param + return options +} + +// UpdateKeyOptions : The UpdateKey options. +type UpdateKeyOptions struct { + // The key identifier. + ID *string `json:"id" validate:"required,ne="` + + // The key patch. + KeyPatch map[string]interface{} `json:"Key_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateKeyOptions : Instantiate UpdateKeyOptions +func (*VpcV1) NewUpdateKeyOptions(id string, keyPatch map[string]interface{}) *UpdateKeyOptions { + return &UpdateKeyOptions{ + ID: core.StringPtr(id), + KeyPatch: keyPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SubnetReference : SubnetReference struct -type SubnetReference struct { - // The CRN for this subnet. - CRN *string `json:"crn" validate:"required"` +// SetID : Allow user to set ID +func (_options *UpdateKeyOptions) SetID(id string) *UpdateKeyOptions { + _options.ID = core.StringPtr(id) + return _options +} - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *SubnetReferenceDeleted `json:"deleted,omitempty"` +// SetKeyPatch : Allow user to set KeyPatch +func (_options *UpdateKeyOptions) SetKeyPatch(keyPatch map[string]interface{}) *UpdateKeyOptions { + _options.KeyPatch = keyPatch + return _options +} - // The URL for this subnet. - Href *string `json:"href" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *UpdateKeyOptions) SetHeaders(param map[string]string) *UpdateKeyOptions { + options.Headers = param + return options +} - // The unique identifier for this subnet. - ID *string `json:"id" validate:"required"` +// UpdateLoadBalancerListenerOptions : The UpdateLoadBalancerListener options. +type UpdateLoadBalancerListenerOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The user-defined name for this subnet. - Name *string `json:"name" validate:"required"` + // The listener identifier. + ID *string `json:"id" validate:"required,ne="` + + // The load balancer listener patch. + LoadBalancerListenerPatch map[string]interface{} `json:"LoadBalancerListener_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string } -// UnmarshalSubnetReference unmarshals an instance of SubnetReference from the specified map of raw messages. -func UnmarshalSubnetReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalSubnetReferenceDeleted) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return +// NewUpdateLoadBalancerListenerOptions : Instantiate UpdateLoadBalancerListenerOptions +func (*VpcV1) NewUpdateLoadBalancerListenerOptions(loadBalancerID string, id string, loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { + return &UpdateLoadBalancerListenerOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), + LoadBalancerListenerPatch: loadBalancerListenerPatch, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// SubnetReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type SubnetReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options } -// UnmarshalSubnetReferenceDeleted unmarshals an instance of SubnetReferenceDeleted from the specified map of raw messages. -func UnmarshalSubnetReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SubnetReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetID : Allow user to set ID +func (_options *UpdateLoadBalancerListenerOptions) SetID(id string) *UpdateLoadBalancerListenerOptions { + _options.ID = core.StringPtr(id) + return _options } -// UnsetSubnetPublicGatewayOptions : The UnsetSubnetPublicGateway options. -type UnsetSubnetPublicGatewayOptions struct { - // The subnet identifier. +// SetLoadBalancerListenerPatch : Allow user to set LoadBalancerListenerPatch +func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerListenerPatch(loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { + _options.LoadBalancerListenerPatch = loadBalancerListenerPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerOptions { + options.Headers = param + return options +} + +// UpdateLoadBalancerListenerPolicyOptions : The UpdateLoadBalancerListenerPolicy options. +type UpdateLoadBalancerListenerPolicyOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. ID *string `json:"id" validate:"required,ne="` + // The listener policy patch. + LoadBalancerListenerPolicyPatch map[string]interface{} `json:"LoadBalancerListenerPolicy_patch" validate:"required"` + // Allows users to set headers on API requests Headers map[string]string } -// NewUnsetSubnetPublicGatewayOptions : Instantiate UnsetSubnetPublicGatewayOptions -func (*VpcV1) NewUnsetSubnetPublicGatewayOptions(id string) *UnsetSubnetPublicGatewayOptions { - return &UnsetSubnetPublicGatewayOptions{ - ID: core.StringPtr(id), +// NewUpdateLoadBalancerListenerPolicyOptions : Instantiate UpdateLoadBalancerListenerPolicyOptions +func (*VpcV1) NewUpdateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string, loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { + return &UpdateLoadBalancerListenerPolicyOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + ID: core.StringPtr(id), + LoadBalancerListenerPolicyPatch: loadBalancerListenerPolicyPatch, } } +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetListenerID : Allow user to set ListenerID +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} + // SetID : Allow user to set ID -func (_options *UnsetSubnetPublicGatewayOptions) SetID(id string) *UnsetSubnetPublicGatewayOptions { +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyOptions { _options.ID = core.StringPtr(id) return _options } +// SetLoadBalancerListenerPolicyPatch : Allow user to set LoadBalancerListenerPolicyPatch +func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { + _options.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatch + return _options +} + // SetHeaders : Allow user to set Headers -func (options *UnsetSubnetPublicGatewayOptions) SetHeaders(param map[string]string) *UnsetSubnetPublicGatewayOptions { +func (options *UpdateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyOptions { options.Headers = param return options } -// UpdateDedicatedHostDiskOptions : The UpdateDedicatedHostDisk options. -type UpdateDedicatedHostDiskOptions struct { - // The dedicated host identifier. - DedicatedHostID *string `json:"dedicated_host_id" validate:"required,ne="` +// UpdateLoadBalancerListenerPolicyRuleOptions : The UpdateLoadBalancerListenerPolicyRule options. +type UpdateLoadBalancerListenerPolicyRuleOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - // The dedicated host disk identifier. + // The listener identifier. + ListenerID *string `json:"listener_id" validate:"required,ne="` + + // The policy identifier. + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The rule identifier. ID *string `json:"id" validate:"required,ne="` - // The dedicated host disk patch. - DedicatedHostDiskPatch map[string]interface{} `json:"DedicatedHostDisk_patch" validate:"required"` + // The listener policy rule patch. + LoadBalancerListenerPolicyRulePatch map[string]interface{} `json:"LoadBalancerListenerPolicyRule_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateDedicatedHostDiskOptions : Instantiate UpdateDedicatedHostDiskOptions -func (*VpcV1) NewUpdateDedicatedHostDiskOptions(dedicatedHostID string, id string, dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { - return &UpdateDedicatedHostDiskOptions{ - DedicatedHostID: core.StringPtr(dedicatedHostID), - ID: core.StringPtr(id), - DedicatedHostDiskPatch: dedicatedHostDiskPatch, +// NewUpdateLoadBalancerListenerPolicyRuleOptions : Instantiate UpdateLoadBalancerListenerPolicyRuleOptions +func (*VpcV1) NewUpdateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string, loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { + return &UpdateLoadBalancerListenerPolicyRuleOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ListenerID: core.StringPtr(listenerID), + PolicyID: core.StringPtr(policyID), + ID: core.StringPtr(id), + LoadBalancerListenerPolicyRulePatch: loadBalancerListenerPolicyRulePatch, } } -// SetDedicatedHostID : Allow user to set DedicatedHostID -func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostID(dedicatedHostID string) *UpdateDedicatedHostDiskOptions { - _options.DedicatedHostID = core.StringPtr(dedicatedHostID) +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetListenerID : Allow user to set ListenerID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.ListenerID = core.StringPtr(listenerID) + return _options +} + +// SetPolicyID : Allow user to set PolicyID +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.PolicyID = core.StringPtr(policyID) return _options } // SetID : Allow user to set ID -func (_options *UpdateDedicatedHostDiskOptions) SetID(id string) *UpdateDedicatedHostDiskOptions { +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyRuleOptions { _options.ID = core.StringPtr(id) return _options } -// SetDedicatedHostDiskPatch : Allow user to set DedicatedHostDiskPatch -func (_options *UpdateDedicatedHostDiskOptions) SetDedicatedHostDiskPatch(dedicatedHostDiskPatch map[string]interface{}) *UpdateDedicatedHostDiskOptions { - _options.DedicatedHostDiskPatch = dedicatedHostDiskPatch +// SetLoadBalancerListenerPolicyRulePatch : Allow user to set LoadBalancerListenerPolicyRulePatch +func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { + _options.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostDiskOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostDiskOptions { +func (options *UpdateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyRuleOptions { options.Headers = param return options } -// UpdateDedicatedHostGroupOptions : The UpdateDedicatedHostGroup options. -type UpdateDedicatedHostGroupOptions struct { - // The dedicated host group identifier. +// UpdateLoadBalancerOptions : The UpdateLoadBalancer options. +type UpdateLoadBalancerOptions struct { + // The load balancer identifier. ID *string `json:"id" validate:"required,ne="` - // The dedicated host group patch. - DedicatedHostGroupPatch map[string]interface{} `json:"DedicatedHostGroup_patch" validate:"required"` + // The load balancer patch. + LoadBalancerPatch map[string]interface{} `json:"LoadBalancer_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateDedicatedHostGroupOptions : Instantiate UpdateDedicatedHostGroupOptions -func (*VpcV1) NewUpdateDedicatedHostGroupOptions(id string, dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { - return &UpdateDedicatedHostGroupOptions{ - ID: core.StringPtr(id), - DedicatedHostGroupPatch: dedicatedHostGroupPatch, +// NewUpdateLoadBalancerOptions : Instantiate UpdateLoadBalancerOptions +func (*VpcV1) NewUpdateLoadBalancerOptions(id string, loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { + return &UpdateLoadBalancerOptions{ + ID: core.StringPtr(id), + LoadBalancerPatch: loadBalancerPatch, } } // SetID : Allow user to set ID -func (_options *UpdateDedicatedHostGroupOptions) SetID(id string) *UpdateDedicatedHostGroupOptions { +func (_options *UpdateLoadBalancerOptions) SetID(id string) *UpdateLoadBalancerOptions { _options.ID = core.StringPtr(id) return _options } -// SetDedicatedHostGroupPatch : Allow user to set DedicatedHostGroupPatch -func (_options *UpdateDedicatedHostGroupOptions) SetDedicatedHostGroupPatch(dedicatedHostGroupPatch map[string]interface{}) *UpdateDedicatedHostGroupOptions { - _options.DedicatedHostGroupPatch = dedicatedHostGroupPatch +// SetLoadBalancerPatch : Allow user to set LoadBalancerPatch +func (_options *UpdateLoadBalancerOptions) SetLoadBalancerPatch(loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { + _options.LoadBalancerPatch = loadBalancerPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostGroupOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostGroupOptions { +func (options *UpdateLoadBalancerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerOptions { options.Headers = param return options } -// UpdateDedicatedHostOptions : The UpdateDedicatedHost options. -type UpdateDedicatedHostOptions struct { - // The dedicated host identifier. +// UpdateLoadBalancerPoolMemberOptions : The UpdateLoadBalancerPoolMember options. +type UpdateLoadBalancerPoolMemberOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The pool identifier. + PoolID *string `json:"pool_id" validate:"required,ne="` + + // The member identifier. ID *string `json:"id" validate:"required,ne="` - // The dedicated host patch. - DedicatedHostPatch map[string]interface{} `json:"DedicatedHost_patch" validate:"required"` + // The load balancer pool member patch. + LoadBalancerPoolMemberPatch map[string]interface{} `json:"LoadBalancerPoolMember_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateDedicatedHostOptions : Instantiate UpdateDedicatedHostOptions -func (*VpcV1) NewUpdateDedicatedHostOptions(id string, dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { - return &UpdateDedicatedHostOptions{ - ID: core.StringPtr(id), - DedicatedHostPatch: dedicatedHostPatch, +// NewUpdateLoadBalancerPoolMemberOptions : Instantiate UpdateLoadBalancerPoolMemberOptions +func (*VpcV1) NewUpdateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string, loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { + return &UpdateLoadBalancerPoolMemberOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + PoolID: core.StringPtr(poolID), + ID: core.StringPtr(id), + LoadBalancerPoolMemberPatch: loadBalancerPoolMemberPatch, } } +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolMemberOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + +// SetPoolID : Allow user to set PoolID +func (_options *UpdateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *UpdateLoadBalancerPoolMemberOptions { + _options.PoolID = core.StringPtr(poolID) + return _options +} + // SetID : Allow user to set ID -func (_options *UpdateDedicatedHostOptions) SetID(id string) *UpdateDedicatedHostOptions { +func (_options *UpdateLoadBalancerPoolMemberOptions) SetID(id string) *UpdateLoadBalancerPoolMemberOptions { _options.ID = core.StringPtr(id) return _options } -// SetDedicatedHostPatch : Allow user to set DedicatedHostPatch -func (_options *UpdateDedicatedHostOptions) SetDedicatedHostPatch(dedicatedHostPatch map[string]interface{}) *UpdateDedicatedHostOptions { - _options.DedicatedHostPatch = dedicatedHostPatch +// SetLoadBalancerPoolMemberPatch : Allow user to set LoadBalancerPoolMemberPatch +func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerPoolMemberPatch(loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { + _options.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateDedicatedHostOptions) SetHeaders(param map[string]string) *UpdateDedicatedHostOptions { +func (options *UpdateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolMemberOptions { options.Headers = param return options } -// UpdateEndpointGatewayOptions : The UpdateEndpointGateway options. -type UpdateEndpointGatewayOptions struct { - // The endpoint gateway identifier. +// UpdateLoadBalancerPoolOptions : The UpdateLoadBalancerPool options. +type UpdateLoadBalancerPoolOptions struct { + // The load balancer identifier. + LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + + // The pool identifier. ID *string `json:"id" validate:"required,ne="` - // The endpoint gateway patch. - EndpointGatewayPatch map[string]interface{} `json:"EndpointGateway_patch" validate:"required"` + // The load balancer pool patch. + LoadBalancerPoolPatch map[string]interface{} `json:"LoadBalancerPool_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateEndpointGatewayOptions : Instantiate UpdateEndpointGatewayOptions -func (*VpcV1) NewUpdateEndpointGatewayOptions(id string, endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { - return &UpdateEndpointGatewayOptions{ - ID: core.StringPtr(id), - EndpointGatewayPatch: endpointGatewayPatch, +// NewUpdateLoadBalancerPoolOptions : Instantiate UpdateLoadBalancerPoolOptions +func (*VpcV1) NewUpdateLoadBalancerPoolOptions(loadBalancerID string, id string, loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { + return &UpdateLoadBalancerPoolOptions{ + LoadBalancerID: core.StringPtr(loadBalancerID), + ID: core.StringPtr(id), + LoadBalancerPoolPatch: loadBalancerPoolPatch, } } +// SetLoadBalancerID : Allow user to set LoadBalancerID +func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolOptions { + _options.LoadBalancerID = core.StringPtr(loadBalancerID) + return _options +} + // SetID : Allow user to set ID -func (_options *UpdateEndpointGatewayOptions) SetID(id string) *UpdateEndpointGatewayOptions { +func (_options *UpdateLoadBalancerPoolOptions) SetID(id string) *UpdateLoadBalancerPoolOptions { _options.ID = core.StringPtr(id) return _options } -// SetEndpointGatewayPatch : Allow user to set EndpointGatewayPatch -func (_options *UpdateEndpointGatewayOptions) SetEndpointGatewayPatch(endpointGatewayPatch map[string]interface{}) *UpdateEndpointGatewayOptions { - _options.EndpointGatewayPatch = endpointGatewayPatch +// SetLoadBalancerPoolPatch : Allow user to set LoadBalancerPoolPatch +func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerPoolPatch(loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { + _options.LoadBalancerPoolPatch = loadBalancerPoolPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayOptions { +func (options *UpdateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolOptions { options.Headers = param return options } -// UpdateFloatingIPOptions : The UpdateFloatingIP options. -type UpdateFloatingIPOptions struct { - // The floating IP identifier. +// UpdateNetworkACLOptions : The UpdateNetworkACL options. +type UpdateNetworkACLOptions struct { + // The network ACL identifier. ID *string `json:"id" validate:"required,ne="` - // The floating IP patch. - FloatingIPPatch map[string]interface{} `json:"FloatingIP_patch" validate:"required"` + // The network ACL patch. + NetworkACLPatch map[string]interface{} `json:"NetworkACL_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateFloatingIPOptions : Instantiate UpdateFloatingIPOptions -func (*VpcV1) NewUpdateFloatingIPOptions(id string, floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { - return &UpdateFloatingIPOptions{ +// NewUpdateNetworkACLOptions : Instantiate UpdateNetworkACLOptions +func (*VpcV1) NewUpdateNetworkACLOptions(id string, networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { + return &UpdateNetworkACLOptions{ ID: core.StringPtr(id), - FloatingIPPatch: floatingIPPatch, + NetworkACLPatch: networkACLPatch, } } // SetID : Allow user to set ID -func (_options *UpdateFloatingIPOptions) SetID(id string) *UpdateFloatingIPOptions { +func (_options *UpdateNetworkACLOptions) SetID(id string) *UpdateNetworkACLOptions { _options.ID = core.StringPtr(id) return _options } -// SetFloatingIPPatch : Allow user to set FloatingIPPatch -func (_options *UpdateFloatingIPOptions) SetFloatingIPPatch(floatingIPPatch map[string]interface{}) *UpdateFloatingIPOptions { - _options.FloatingIPPatch = floatingIPPatch +// SetNetworkACLPatch : Allow user to set NetworkACLPatch +func (_options *UpdateNetworkACLOptions) SetNetworkACLPatch(networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { + _options.NetworkACLPatch = networkACLPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateFloatingIPOptions) SetHeaders(param map[string]string) *UpdateFloatingIPOptions { +func (options *UpdateNetworkACLOptions) SetHeaders(param map[string]string) *UpdateNetworkACLOptions { options.Headers = param return options } -// UpdateFlowLogCollectorOptions : The UpdateFlowLogCollector options. -type UpdateFlowLogCollectorOptions struct { - // The flow log collector identifier. +// UpdateNetworkACLRuleOptions : The UpdateNetworkACLRule options. +type UpdateNetworkACLRuleOptions struct { + // The network ACL identifier. + NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + + // The rule identifier. ID *string `json:"id" validate:"required,ne="` - // The flow log collector patch. - FlowLogCollectorPatch map[string]interface{} `json:"FlowLogCollector_patch" validate:"required"` + // The network ACL rule patch. + NetworkACLRulePatch map[string]interface{} `json:"NetworkACLRule_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateFlowLogCollectorOptions : Instantiate UpdateFlowLogCollectorOptions -func (*VpcV1) NewUpdateFlowLogCollectorOptions(id string, flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { - return &UpdateFlowLogCollectorOptions{ - ID: core.StringPtr(id), - FlowLogCollectorPatch: flowLogCollectorPatch, +// NewUpdateNetworkACLRuleOptions : Instantiate UpdateNetworkACLRuleOptions +func (*VpcV1) NewUpdateNetworkACLRuleOptions(networkACLID string, id string, networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { + return &UpdateNetworkACLRuleOptions{ + NetworkACLID: core.StringPtr(networkACLID), + ID: core.StringPtr(id), + NetworkACLRulePatch: networkACLRulePatch, } } +// SetNetworkACLID : Allow user to set NetworkACLID +func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *UpdateNetworkACLRuleOptions { + _options.NetworkACLID = core.StringPtr(networkACLID) + return _options +} + // SetID : Allow user to set ID -func (_options *UpdateFlowLogCollectorOptions) SetID(id string) *UpdateFlowLogCollectorOptions { +func (_options *UpdateNetworkACLRuleOptions) SetID(id string) *UpdateNetworkACLRuleOptions { _options.ID = core.StringPtr(id) return _options } -// SetFlowLogCollectorPatch : Allow user to set FlowLogCollectorPatch -func (_options *UpdateFlowLogCollectorOptions) SetFlowLogCollectorPatch(flowLogCollectorPatch map[string]interface{}) *UpdateFlowLogCollectorOptions { - _options.FlowLogCollectorPatch = flowLogCollectorPatch +// SetNetworkACLRulePatch : Allow user to set NetworkACLRulePatch +func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLRulePatch(networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { + _options.NetworkACLRulePatch = networkACLRulePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateFlowLogCollectorOptions) SetHeaders(param map[string]string) *UpdateFlowLogCollectorOptions { +func (options *UpdateNetworkACLRuleOptions) SetHeaders(param map[string]string) *UpdateNetworkACLRuleOptions { options.Headers = param return options } -// UpdateIkePolicyOptions : The UpdateIkePolicy options. -type UpdateIkePolicyOptions struct { - // The IKE policy identifier. +// UpdatePlacementGroupOptions : The UpdatePlacementGroup options. +type UpdatePlacementGroupOptions struct { + // The placement group identifier. ID *string `json:"id" validate:"required,ne="` - // The IKE policy patch. - IkePolicyPatch map[string]interface{} `json:"IKEPolicy_patch" validate:"required"` + // The placement group patch. + PlacementGroupPatch map[string]interface{} `json:"PlacementGroup_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateIkePolicyOptions : Instantiate UpdateIkePolicyOptions -func (*VpcV1) NewUpdateIkePolicyOptions(id string, ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { - return &UpdateIkePolicyOptions{ - ID: core.StringPtr(id), - IkePolicyPatch: ikePolicyPatch, +// NewUpdatePlacementGroupOptions : Instantiate UpdatePlacementGroupOptions +func (*VpcV1) NewUpdatePlacementGroupOptions(id string, placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { + return &UpdatePlacementGroupOptions{ + ID: core.StringPtr(id), + PlacementGroupPatch: placementGroupPatch, } } // SetID : Allow user to set ID -func (_options *UpdateIkePolicyOptions) SetID(id string) *UpdateIkePolicyOptions { +func (_options *UpdatePlacementGroupOptions) SetID(id string) *UpdatePlacementGroupOptions { _options.ID = core.StringPtr(id) return _options } -// SetIkePolicyPatch : Allow user to set IkePolicyPatch -func (_options *UpdateIkePolicyOptions) SetIkePolicyPatch(ikePolicyPatch map[string]interface{}) *UpdateIkePolicyOptions { - _options.IkePolicyPatch = ikePolicyPatch +// SetPlacementGroupPatch : Allow user to set PlacementGroupPatch +func (_options *UpdatePlacementGroupOptions) SetPlacementGroupPatch(placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { + _options.PlacementGroupPatch = placementGroupPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateIkePolicyOptions) SetHeaders(param map[string]string) *UpdateIkePolicyOptions { +func (options *UpdatePlacementGroupOptions) SetHeaders(param map[string]string) *UpdatePlacementGroupOptions { options.Headers = param return options } -// UpdateImageOptions : The UpdateImage options. -type UpdateImageOptions struct { - // The image identifier. +// UpdatePublicGatewayOptions : The UpdatePublicGateway options. +type UpdatePublicGatewayOptions struct { + // The public gateway identifier. ID *string `json:"id" validate:"required,ne="` - // The image patch. - ImagePatch map[string]interface{} `json:"Image_patch" validate:"required"` + // The public gateway patch. + PublicGatewayPatch map[string]interface{} `json:"PublicGateway_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateImageOptions : Instantiate UpdateImageOptions -func (*VpcV1) NewUpdateImageOptions(id string, imagePatch map[string]interface{}) *UpdateImageOptions { - return &UpdateImageOptions{ - ID: core.StringPtr(id), - ImagePatch: imagePatch, +// NewUpdatePublicGatewayOptions : Instantiate UpdatePublicGatewayOptions +func (*VpcV1) NewUpdatePublicGatewayOptions(id string, publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { + return &UpdatePublicGatewayOptions{ + ID: core.StringPtr(id), + PublicGatewayPatch: publicGatewayPatch, } } // SetID : Allow user to set ID -func (_options *UpdateImageOptions) SetID(id string) *UpdateImageOptions { +func (_options *UpdatePublicGatewayOptions) SetID(id string) *UpdatePublicGatewayOptions { _options.ID = core.StringPtr(id) return _options } -// SetImagePatch : Allow user to set ImagePatch -func (_options *UpdateImageOptions) SetImagePatch(imagePatch map[string]interface{}) *UpdateImageOptions { - _options.ImagePatch = imagePatch +// SetPublicGatewayPatch : Allow user to set PublicGatewayPatch +func (_options *UpdatePublicGatewayOptions) SetPublicGatewayPatch(publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { + _options.PublicGatewayPatch = publicGatewayPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateImageOptions) SetHeaders(param map[string]string) *UpdateImageOptions { +func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) *UpdatePublicGatewayOptions { options.Headers = param return options } -// UpdateInstanceDiskOptions : The UpdateInstanceDisk options. -type UpdateInstanceDiskOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The instance disk identifier. +// UpdateSecurityGroupOptions : The UpdateSecurityGroup options. +type UpdateSecurityGroupOptions struct { + // The security group identifier. ID *string `json:"id" validate:"required,ne="` - // The instance disk patch. - InstanceDiskPatch map[string]interface{} `json:"InstanceDisk_patch" validate:"required"` + // The security group patch. + SecurityGroupPatch map[string]interface{} `json:"SecurityGroup_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceDiskOptions : Instantiate UpdateInstanceDiskOptions -func (*VpcV1) NewUpdateInstanceDiskOptions(instanceID string, id string, instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { - return &UpdateInstanceDiskOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - InstanceDiskPatch: instanceDiskPatch, +// NewUpdateSecurityGroupOptions : Instantiate UpdateSecurityGroupOptions +func (*VpcV1) NewUpdateSecurityGroupOptions(id string, securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { + return &UpdateSecurityGroupOptions{ + ID: core.StringPtr(id), + SecurityGroupPatch: securityGroupPatch, } } -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceDiskOptions) SetInstanceID(instanceID string) *UpdateInstanceDiskOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - // SetID : Allow user to set ID -func (_options *UpdateInstanceDiskOptions) SetID(id string) *UpdateInstanceDiskOptions { +func (_options *UpdateSecurityGroupOptions) SetID(id string) *UpdateSecurityGroupOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceDiskPatch : Allow user to set InstanceDiskPatch -func (_options *UpdateInstanceDiskOptions) SetInstanceDiskPatch(instanceDiskPatch map[string]interface{}) *UpdateInstanceDiskOptions { - _options.InstanceDiskPatch = instanceDiskPatch +// SetSecurityGroupPatch : Allow user to set SecurityGroupPatch +func (_options *UpdateSecurityGroupOptions) SetSecurityGroupPatch(securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { + _options.SecurityGroupPatch = securityGroupPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceDiskOptions) SetHeaders(param map[string]string) *UpdateInstanceDiskOptions { +func (options *UpdateSecurityGroupOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupOptions { options.Headers = param return options } -// UpdateInstanceGroupManagerActionOptions : The UpdateInstanceGroupManagerAction options. -type UpdateInstanceGroupManagerActionOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` +// UpdateSecurityGroupRuleOptions : The UpdateSecurityGroupRule options. +type UpdateSecurityGroupRuleOptions struct { + // The security group identifier. + SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - // The instance group manager action identifier. + // The rule identifier. ID *string `json:"id" validate:"required,ne="` - // The instance group manager action patch. - InstanceGroupManagerActionPatch map[string]interface{} `json:"InstanceGroupManagerAction_patch" validate:"required"` + // The security group rule patch. + SecurityGroupRulePatch map[string]interface{} `json:"SecurityGroupRule_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceGroupManagerActionOptions : Instantiate UpdateInstanceGroupManagerActionOptions -func (*VpcV1) NewUpdateInstanceGroupManagerActionOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { - return &UpdateInstanceGroupManagerActionOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - InstanceGroupManagerActionPatch: instanceGroupManagerActionPatch, +// NewUpdateSecurityGroupRuleOptions : Instantiate UpdateSecurityGroupRuleOptions +func (*VpcV1) NewUpdateSecurityGroupRuleOptions(securityGroupID string, id string, securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { + return &UpdateSecurityGroupRuleOptions{ + SecurityGroupID: core.StringPtr(securityGroupID), + ID: core.StringPtr(id), + SecurityGroupRulePatch: securityGroupRulePatch, } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) +// SetSecurityGroupID : Allow user to set SecurityGroupID +func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *UpdateSecurityGroupRuleOptions { + _options.SecurityGroupID = core.StringPtr(securityGroupID) return _options } // SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerActionOptions) SetID(id string) *UpdateInstanceGroupManagerActionOptions { +func (_options *UpdateSecurityGroupRuleOptions) SetID(id string) *UpdateSecurityGroupRuleOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceGroupManagerActionPatch : Allow user to set InstanceGroupManagerActionPatch -func (_options *UpdateInstanceGroupManagerActionOptions) SetInstanceGroupManagerActionPatch(instanceGroupManagerActionPatch map[string]interface{}) *UpdateInstanceGroupManagerActionOptions { - _options.InstanceGroupManagerActionPatch = instanceGroupManagerActionPatch +// SetSecurityGroupRulePatch : Allow user to set SecurityGroupRulePatch +func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupRulePatch(securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { + _options.SecurityGroupRulePatch = securityGroupRulePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerActionOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerActionOptions { +func (options *UpdateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupRuleOptions { options.Headers = param return options } -// UpdateInstanceGroupManagerOptions : The UpdateInstanceGroupManager options. -type UpdateInstanceGroupManagerOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. +// UpdateSnapshotOptions : The UpdateSnapshot options. +type UpdateSnapshotOptions struct { + // The snapshot identifier. ID *string `json:"id" validate:"required,ne="` - // The instance group manager patch. - InstanceGroupManagerPatch map[string]interface{} `json:"InstanceGroupManager_patch" validate:"required"` + // The snapshot patch. + SnapshotPatch map[string]interface{} `json:"Snapshot_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceGroupManagerOptions : Instantiate UpdateInstanceGroupManagerOptions -func (*VpcV1) NewUpdateInstanceGroupManagerOptions(instanceGroupID string, id string, instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { - return &UpdateInstanceGroupManagerOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - InstanceGroupManagerPatch: instanceGroupManagerPatch, +// NewUpdateSnapshotOptions : Instantiate UpdateSnapshotOptions +func (*VpcV1) NewUpdateSnapshotOptions(id string, snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { + return &UpdateSnapshotOptions{ + ID: core.StringPtr(id), + SnapshotPatch: snapshotPatch, } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - // SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerOptions) SetID(id string) *UpdateInstanceGroupManagerOptions { +func (_options *UpdateSnapshotOptions) SetID(id string) *UpdateSnapshotOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceGroupManagerPatch : Allow user to set InstanceGroupManagerPatch -func (_options *UpdateInstanceGroupManagerOptions) SetInstanceGroupManagerPatch(instanceGroupManagerPatch map[string]interface{}) *UpdateInstanceGroupManagerOptions { - _options.InstanceGroupManagerPatch = instanceGroupManagerPatch +// SetSnapshotPatch : Allow user to set SnapshotPatch +func (_options *UpdateSnapshotOptions) SetSnapshotPatch(snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { + _options.SnapshotPatch = snapshotPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerOptions { +func (options *UpdateSnapshotOptions) SetHeaders(param map[string]string) *UpdateSnapshotOptions { options.Headers = param return options } -// UpdateInstanceGroupManagerPolicyOptions : The UpdateInstanceGroupManagerPolicy options. -type UpdateInstanceGroupManagerPolicyOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` - - // The instance group manager identifier. - InstanceGroupManagerID *string `json:"instance_group_manager_id" validate:"required,ne="` - - // The instance group manager policy identifier. +// UpdateSubnetOptions : The UpdateSubnet options. +type UpdateSubnetOptions struct { + // The subnet identifier. ID *string `json:"id" validate:"required,ne="` - // The instance group manager policy patch. - InstanceGroupManagerPolicyPatch map[string]interface{} `json:"InstanceGroupManagerPolicy_patch" validate:"required"` + // The subnet patch. + SubnetPatch map[string]interface{} `json:"Subnet_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceGroupManagerPolicyOptions : Instantiate UpdateInstanceGroupManagerPolicyOptions -func (*VpcV1) NewUpdateInstanceGroupManagerPolicyOptions(instanceGroupID string, instanceGroupManagerID string, id string, instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { - return &UpdateInstanceGroupManagerPolicyOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - InstanceGroupManagerID: core.StringPtr(instanceGroupManagerID), - ID: core.StringPtr(id), - InstanceGroupManagerPolicyPatch: instanceGroupManagerPolicyPatch, +// NewUpdateSubnetOptions : Instantiate UpdateSubnetOptions +func (*VpcV1) NewUpdateSubnetOptions(id string, subnetPatch map[string]interface{}) *UpdateSubnetOptions { + return &UpdateSubnetOptions{ + ID: core.StringPtr(id), + SubnetPatch: subnetPatch, } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) - return _options -} - -// SetInstanceGroupManagerID : Allow user to set InstanceGroupManagerID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerID(instanceGroupManagerID string) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerID = core.StringPtr(instanceGroupManagerID) - return _options -} - // SetID : Allow user to set ID -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetID(id string) *UpdateInstanceGroupManagerPolicyOptions { +func (_options *UpdateSubnetOptions) SetID(id string) *UpdateSubnetOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceGroupManagerPolicyPatch : Allow user to set InstanceGroupManagerPolicyPatch -func (_options *UpdateInstanceGroupManagerPolicyOptions) SetInstanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatch map[string]interface{}) *UpdateInstanceGroupManagerPolicyOptions { - _options.InstanceGroupManagerPolicyPatch = instanceGroupManagerPolicyPatch +// SetSubnetPatch : Allow user to set SubnetPatch +func (_options *UpdateSubnetOptions) SetSubnetPatch(subnetPatch map[string]interface{}) *UpdateSubnetOptions { + _options.SubnetPatch = subnetPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupManagerPolicyOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupManagerPolicyOptions { +func (options *UpdateSubnetOptions) SetHeaders(param map[string]string) *UpdateSubnetOptions { options.Headers = param return options } -// UpdateInstanceGroupMembershipOptions : The UpdateInstanceGroupMembership options. -type UpdateInstanceGroupMembershipOptions struct { - // The instance group identifier. - InstanceGroupID *string `json:"instance_group_id" validate:"required,ne="` +// UpdateSubnetReservedIPOptions : The UpdateSubnetReservedIP options. +type UpdateSubnetReservedIPOptions struct { + // The subnet identifier. + SubnetID *string `json:"subnet_id" validate:"required,ne="` - // The instance group membership identifier. + // The reserved IP identifier. ID *string `json:"id" validate:"required,ne="` - // The instance group membership patch. - InstanceGroupMembershipPatch map[string]interface{} `json:"InstanceGroupMembership_patch" validate:"required"` + // The reserved IP patch. + ReservedIPPatch map[string]interface{} `json:"ReservedIP_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceGroupMembershipOptions : Instantiate UpdateInstanceGroupMembershipOptions -func (*VpcV1) NewUpdateInstanceGroupMembershipOptions(instanceGroupID string, id string, instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { - return &UpdateInstanceGroupMembershipOptions{ - InstanceGroupID: core.StringPtr(instanceGroupID), - ID: core.StringPtr(id), - InstanceGroupMembershipPatch: instanceGroupMembershipPatch, +// NewUpdateSubnetReservedIPOptions : Instantiate UpdateSubnetReservedIPOptions +func (*VpcV1) NewUpdateSubnetReservedIPOptions(subnetID string, id string, reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { + return &UpdateSubnetReservedIPOptions{ + SubnetID: core.StringPtr(subnetID), + ID: core.StringPtr(id), + ReservedIPPatch: reservedIPPatch, } } -// SetInstanceGroupID : Allow user to set InstanceGroupID -func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupID(instanceGroupID string) *UpdateInstanceGroupMembershipOptions { - _options.InstanceGroupID = core.StringPtr(instanceGroupID) +// SetSubnetID : Allow user to set SubnetID +func (_options *UpdateSubnetReservedIPOptions) SetSubnetID(subnetID string) *UpdateSubnetReservedIPOptions { + _options.SubnetID = core.StringPtr(subnetID) return _options } // SetID : Allow user to set ID -func (_options *UpdateInstanceGroupMembershipOptions) SetID(id string) *UpdateInstanceGroupMembershipOptions { +func (_options *UpdateSubnetReservedIPOptions) SetID(id string) *UpdateSubnetReservedIPOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceGroupMembershipPatch : Allow user to set InstanceGroupMembershipPatch -func (_options *UpdateInstanceGroupMembershipOptions) SetInstanceGroupMembershipPatch(instanceGroupMembershipPatch map[string]interface{}) *UpdateInstanceGroupMembershipOptions { - _options.InstanceGroupMembershipPatch = instanceGroupMembershipPatch +// SetReservedIPPatch : Allow user to set ReservedIPPatch +func (_options *UpdateSubnetReservedIPOptions) SetReservedIPPatch(reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { + _options.ReservedIPPatch = reservedIPPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupMembershipOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupMembershipOptions { +func (options *UpdateSubnetReservedIPOptions) SetHeaders(param map[string]string) *UpdateSubnetReservedIPOptions { options.Headers = param return options } -// UpdateInstanceGroupOptions : The UpdateInstanceGroup options. -type UpdateInstanceGroupOptions struct { - // The instance group identifier. +// UpdateVolumeOptions : The UpdateVolume options. +type UpdateVolumeOptions struct { + // The volume identifier. ID *string `json:"id" validate:"required,ne="` - // The instance group patch. - InstanceGroupPatch map[string]interface{} `json:"InstanceGroup_patch" validate:"required"` + // The volume patch. + VolumePatch map[string]interface{} `json:"Volume_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceGroupOptions : Instantiate UpdateInstanceGroupOptions -func (*VpcV1) NewUpdateInstanceGroupOptions(id string, instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { - return &UpdateInstanceGroupOptions{ - ID: core.StringPtr(id), - InstanceGroupPatch: instanceGroupPatch, +// NewUpdateVolumeOptions : Instantiate UpdateVolumeOptions +func (*VpcV1) NewUpdateVolumeOptions(id string, volumePatch map[string]interface{}) *UpdateVolumeOptions { + return &UpdateVolumeOptions{ + ID: core.StringPtr(id), + VolumePatch: volumePatch, } } // SetID : Allow user to set ID -func (_options *UpdateInstanceGroupOptions) SetID(id string) *UpdateInstanceGroupOptions { +func (_options *UpdateVolumeOptions) SetID(id string) *UpdateVolumeOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceGroupPatch : Allow user to set InstanceGroupPatch -func (_options *UpdateInstanceGroupOptions) SetInstanceGroupPatch(instanceGroupPatch map[string]interface{}) *UpdateInstanceGroupOptions { - _options.InstanceGroupPatch = instanceGroupPatch +// SetVolumePatch : Allow user to set VolumePatch +func (_options *UpdateVolumeOptions) SetVolumePatch(volumePatch map[string]interface{}) *UpdateVolumeOptions { + _options.VolumePatch = volumePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceGroupOptions) SetHeaders(param map[string]string) *UpdateInstanceGroupOptions { +func (options *UpdateVolumeOptions) SetHeaders(param map[string]string) *UpdateVolumeOptions { options.Headers = param return options } -// UpdateInstanceNetworkInterfaceOptions : The UpdateInstanceNetworkInterface options. -type UpdateInstanceNetworkInterfaceOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// UpdateVPCAddressPrefixOptions : The UpdateVPCAddressPrefix options. +type UpdateVPCAddressPrefixOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The network interface identifier. + // The prefix identifier. ID *string `json:"id" validate:"required,ne="` - // The network interface patch. - NetworkInterfacePatch map[string]interface{} `json:"NetworkInterface_patch" validate:"required"` + // The prefix patch. + AddressPrefixPatch map[string]interface{} `json:"AddressPrefix_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceNetworkInterfaceOptions : Instantiate UpdateInstanceNetworkInterfaceOptions -func (*VpcV1) NewUpdateInstanceNetworkInterfaceOptions(instanceID string, id string, networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { - return &UpdateInstanceNetworkInterfaceOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - NetworkInterfacePatch: networkInterfacePatch, +// NewUpdateVPCAddressPrefixOptions : Instantiate UpdateVPCAddressPrefixOptions +func (*VpcV1) NewUpdateVPCAddressPrefixOptions(vpcID string, id string, addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { + return &UpdateVPCAddressPrefixOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + AddressPrefixPatch: addressPrefixPatch, } } -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceNetworkInterfaceOptions) SetInstanceID(instanceID string) *UpdateInstanceNetworkInterfaceOptions { - _options.InstanceID = core.StringPtr(instanceID) +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCAddressPrefixOptions) SetVPCID(vpcID string) *UpdateVPCAddressPrefixOptions { + _options.VPCID = core.StringPtr(vpcID) return _options } // SetID : Allow user to set ID -func (_options *UpdateInstanceNetworkInterfaceOptions) SetID(id string) *UpdateInstanceNetworkInterfaceOptions { +func (_options *UpdateVPCAddressPrefixOptions) SetID(id string) *UpdateVPCAddressPrefixOptions { _options.ID = core.StringPtr(id) return _options } -// SetNetworkInterfacePatch : Allow user to set NetworkInterfacePatch -func (_options *UpdateInstanceNetworkInterfaceOptions) SetNetworkInterfacePatch(networkInterfacePatch map[string]interface{}) *UpdateInstanceNetworkInterfaceOptions { - _options.NetworkInterfacePatch = networkInterfacePatch +// SetAddressPrefixPatch : Allow user to set AddressPrefixPatch +func (_options *UpdateVPCAddressPrefixOptions) SetAddressPrefixPatch(addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { + _options.AddressPrefixPatch = addressPrefixPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateInstanceNetworkInterfaceOptions { +func (options *UpdateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *UpdateVPCAddressPrefixOptions { options.Headers = param return options } -// UpdateInstanceOptions : The UpdateInstance options. -type UpdateInstanceOptions struct { - // The instance identifier. +// UpdateVPCOptions : The UpdateVPC options. +type UpdateVPCOptions struct { + // The VPC identifier. ID *string `json:"id" validate:"required,ne="` - // The instance patch. - InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` + // The VPC patch. + VPCPatch map[string]interface{} `json:"VPC_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceOptions : Instantiate UpdateInstanceOptions -func (*VpcV1) NewUpdateInstanceOptions(id string, instancePatch map[string]interface{}) *UpdateInstanceOptions { - return &UpdateInstanceOptions{ - ID: core.StringPtr(id), - InstancePatch: instancePatch, +// NewUpdateVPCOptions : Instantiate UpdateVPCOptions +func (*VpcV1) NewUpdateVPCOptions(id string, vpcPatch map[string]interface{}) *UpdateVPCOptions { + return &UpdateVPCOptions{ + ID: core.StringPtr(id), + VPCPatch: vpcPatch, } } // SetID : Allow user to set ID -func (_options *UpdateInstanceOptions) SetID(id string) *UpdateInstanceOptions { +func (_options *UpdateVPCOptions) SetID(id string) *UpdateVPCOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstancePatch : Allow user to set InstancePatch -func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string]interface{}) *UpdateInstanceOptions { - _options.InstancePatch = instancePatch +// SetVPCPatch : Allow user to set VPCPatch +func (_options *UpdateVPCOptions) SetVPCPatch(vpcPatch map[string]interface{}) *UpdateVPCOptions { + _options.VPCPatch = vpcPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { +func (options *UpdateVPCOptions) SetHeaders(param map[string]string) *UpdateVPCOptions { options.Headers = param return options } -// UpdateInstanceTemplateOptions : The UpdateInstanceTemplate options. -type UpdateInstanceTemplateOptions struct { - // The instance template identifier. +// UpdateVPCRouteOptions : The UpdateVPCRoute options. +type UpdateVPCRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The route identifier. ID *string `json:"id" validate:"required,ne="` - // The instance template patch. - InstanceTemplatePatch map[string]interface{} `json:"InstanceTemplate_patch" validate:"required"` + // The route patch. + RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceTemplateOptions : Instantiate UpdateInstanceTemplateOptions -func (*VpcV1) NewUpdateInstanceTemplateOptions(id string, instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { - return &UpdateInstanceTemplateOptions{ - ID: core.StringPtr(id), - InstanceTemplatePatch: instanceTemplatePatch, +// NewUpdateVPCRouteOptions : Instantiate UpdateVPCRouteOptions +func (*VpcV1) NewUpdateVPCRouteOptions(vpcID string, id string, routePatch map[string]interface{}) *UpdateVPCRouteOptions { + return &UpdateVPCRouteOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + RoutePatch: routePatch, } } +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCRouteOptions) SetVPCID(vpcID string) *UpdateVPCRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + // SetID : Allow user to set ID -func (_options *UpdateInstanceTemplateOptions) SetID(id string) *UpdateInstanceTemplateOptions { +func (_options *UpdateVPCRouteOptions) SetID(id string) *UpdateVPCRouteOptions { _options.ID = core.StringPtr(id) return _options } -// SetInstanceTemplatePatch : Allow user to set InstanceTemplatePatch -func (_options *UpdateInstanceTemplateOptions) SetInstanceTemplatePatch(instanceTemplatePatch map[string]interface{}) *UpdateInstanceTemplateOptions { - _options.InstanceTemplatePatch = instanceTemplatePatch +// SetRoutePatch : Allow user to set RoutePatch +func (_options *UpdateVPCRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRouteOptions { + _options.RoutePatch = routePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceTemplateOptions) SetHeaders(param map[string]string) *UpdateInstanceTemplateOptions { +func (options *UpdateVPCRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRouteOptions { options.Headers = param return options } -// UpdateInstanceVolumeAttachmentOptions : The UpdateInstanceVolumeAttachment options. -type UpdateInstanceVolumeAttachmentOptions struct { - // The instance identifier. - InstanceID *string `json:"instance_id" validate:"required,ne="` +// UpdateVPCRoutingTableOptions : The UpdateVPCRoutingTable options. +type UpdateVPCRoutingTableOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` - // The volume attachment identifier. + // The routing table identifier. ID *string `json:"id" validate:"required,ne="` - // The volume attachment patch. - VolumeAttachmentPatch map[string]interface{} `json:"VolumeAttachment_patch" validate:"required"` + // The routing table patch. + RoutingTablePatch map[string]interface{} `json:"RoutingTable_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateInstanceVolumeAttachmentOptions : Instantiate UpdateInstanceVolumeAttachmentOptions -func (*VpcV1) NewUpdateInstanceVolumeAttachmentOptions(instanceID string, id string, volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { - return &UpdateInstanceVolumeAttachmentOptions{ - InstanceID: core.StringPtr(instanceID), - ID: core.StringPtr(id), - VolumeAttachmentPatch: volumeAttachmentPatch, +// NewUpdateVPCRoutingTableOptions : Instantiate UpdateVPCRoutingTableOptions +func (*VpcV1) NewUpdateVPCRoutingTableOptions(vpcID string, id string, routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { + return &UpdateVPCRoutingTableOptions{ + VPCID: core.StringPtr(vpcID), + ID: core.StringPtr(id), + RoutingTablePatch: routingTablePatch, } } -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateInstanceVolumeAttachmentOptions) SetInstanceID(instanceID string) *UpdateInstanceVolumeAttachmentOptions { - _options.InstanceID = core.StringPtr(instanceID) +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCRoutingTableOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableOptions { + _options.VPCID = core.StringPtr(vpcID) return _options } // SetID : Allow user to set ID -func (_options *UpdateInstanceVolumeAttachmentOptions) SetID(id string) *UpdateInstanceVolumeAttachmentOptions { +func (_options *UpdateVPCRoutingTableOptions) SetID(id string) *UpdateVPCRoutingTableOptions { _options.ID = core.StringPtr(id) return _options } -// SetVolumeAttachmentPatch : Allow user to set VolumeAttachmentPatch -func (_options *UpdateInstanceVolumeAttachmentOptions) SetVolumeAttachmentPatch(volumeAttachmentPatch map[string]interface{}) *UpdateInstanceVolumeAttachmentOptions { - _options.VolumeAttachmentPatch = volumeAttachmentPatch +// SetRoutingTablePatch : Allow user to set RoutingTablePatch +func (_options *UpdateVPCRoutingTableOptions) SetRoutingTablePatch(routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { + _options.RoutingTablePatch = routingTablePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateInstanceVolumeAttachmentOptions) SetHeaders(param map[string]string) *UpdateInstanceVolumeAttachmentOptions { +func (options *UpdateVPCRoutingTableOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableOptions { options.Headers = param return options } -// UpdateIpsecPolicyOptions : The UpdateIpsecPolicy options. -type UpdateIpsecPolicyOptions struct { - // The IPsec policy identifier. +// UpdateVPCRoutingTableRouteOptions : The UpdateVPCRoutingTableRoute options. +type UpdateVPCRoutingTableRouteOptions struct { + // The VPC identifier. + VPCID *string `json:"vpc_id" validate:"required,ne="` + + // The routing table identifier. + RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` + + // The VPC routing table route identifier. ID *string `json:"id" validate:"required,ne="` - // The IPsec policy patch. - IPsecPolicyPatch map[string]interface{} `json:"IPsecPolicy_patch" validate:"required"` + // The VPC route patch. + RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateIpsecPolicyOptions : Instantiate UpdateIpsecPolicyOptions -func (*VpcV1) NewUpdateIpsecPolicyOptions(id string, iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { - return &UpdateIpsecPolicyOptions{ - ID: core.StringPtr(id), - IPsecPolicyPatch: iPsecPolicyPatch, +// NewUpdateVPCRoutingTableRouteOptions : Instantiate UpdateVPCRoutingTableRouteOptions +func (*VpcV1) NewUpdateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string, routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { + return &UpdateVPCRoutingTableRouteOptions{ + VPCID: core.StringPtr(vpcID), + RoutingTableID: core.StringPtr(routingTableID), + ID: core.StringPtr(id), + RoutePatch: routePatch, } } +// SetVPCID : Allow user to set VPCID +func (_options *UpdateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableRouteOptions { + _options.VPCID = core.StringPtr(vpcID) + return _options +} + +// SetRoutingTableID : Allow user to set RoutingTableID +func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *UpdateVPCRoutingTableRouteOptions { + _options.RoutingTableID = core.StringPtr(routingTableID) + return _options +} + // SetID : Allow user to set ID -func (_options *UpdateIpsecPolicyOptions) SetID(id string) *UpdateIpsecPolicyOptions { +func (_options *UpdateVPCRoutingTableRouteOptions) SetID(id string) *UpdateVPCRoutingTableRouteOptions { _options.ID = core.StringPtr(id) return _options } -// SetIPsecPolicyPatch : Allow user to set IPsecPolicyPatch -func (_options *UpdateIpsecPolicyOptions) SetIPsecPolicyPatch(iPsecPolicyPatch map[string]interface{}) *UpdateIpsecPolicyOptions { - _options.IPsecPolicyPatch = iPsecPolicyPatch +// SetRoutePatch : Allow user to set RoutePatch +func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { + _options.RoutePatch = routePatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateIpsecPolicyOptions) SetHeaders(param map[string]string) *UpdateIpsecPolicyOptions { +func (options *UpdateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableRouteOptions { options.Headers = param return options } -// UpdateKeyOptions : The UpdateKey options. -type UpdateKeyOptions struct { - // The key identifier. +// UpdateVPNGatewayConnectionOptions : The UpdateVPNGatewayConnection options. +type UpdateVPNGatewayConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway connection identifier. ID *string `json:"id" validate:"required,ne="` - // The key patch. - KeyPatch map[string]interface{} `json:"Key_patch" validate:"required"` + // The VPN gateway connection patch. + VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateKeyOptions : Instantiate UpdateKeyOptions -func (*VpcV1) NewUpdateKeyOptions(id string, keyPatch map[string]interface{}) *UpdateKeyOptions { - return &UpdateKeyOptions{ - ID: core.StringPtr(id), - KeyPatch: keyPatch, +// NewUpdateVPNGatewayConnectionOptions : Instantiate UpdateVPNGatewayConnectionOptions +func (*VpcV1) NewUpdateVPNGatewayConnectionOptions(vpnGatewayID string, id string, vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { + return &UpdateVPNGatewayConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + VPNGatewayConnectionPatch: vpnGatewayConnectionPatch, } } +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *UpdateVPNGatewayConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + // SetID : Allow user to set ID -func (_options *UpdateKeyOptions) SetID(id string) *UpdateKeyOptions { +func (_options *UpdateVPNGatewayConnectionOptions) SetID(id string) *UpdateVPNGatewayConnectionOptions { _options.ID = core.StringPtr(id) return _options } -// SetKeyPatch : Allow user to set KeyPatch -func (_options *UpdateKeyOptions) SetKeyPatch(keyPatch map[string]interface{}) *UpdateKeyOptions { - _options.KeyPatch = keyPatch +// SetVPNGatewayConnectionPatch : Allow user to set VPNGatewayConnectionPatch +func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch(vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { + _options.VPNGatewayConnectionPatch = vpnGatewayConnectionPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateKeyOptions) SetHeaders(param map[string]string) *UpdateKeyOptions { +func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { options.Headers = param return options } -// UpdateLoadBalancerListenerOptions : The UpdateLoadBalancerListener options. -type UpdateLoadBalancerListenerOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` - - // The listener identifier. +// UpdateVPNGatewayOptions : The UpdateVPNGateway options. +type UpdateVPNGatewayOptions struct { + // The VPN gateway identifier. ID *string `json:"id" validate:"required,ne="` - // The load balancer listener patch. - LoadBalancerListenerPatch map[string]interface{} `json:"LoadBalancerListener_patch" validate:"required"` + // The VPN gateway patch. + VPNGatewayPatch map[string]interface{} `json:"VPNGateway_patch" validate:"required"` // Allows users to set headers on API requests Headers map[string]string } -// NewUpdateLoadBalancerListenerOptions : Instantiate UpdateLoadBalancerListenerOptions -func (*VpcV1) NewUpdateLoadBalancerListenerOptions(loadBalancerID string, id string, loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { - return &UpdateLoadBalancerListenerOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - LoadBalancerListenerPatch: loadBalancerListenerPatch, +// NewUpdateVPNGatewayOptions : Instantiate UpdateVPNGatewayOptions +func (*VpcV1) NewUpdateVPNGatewayOptions(id string, vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { + return &UpdateVPNGatewayOptions{ + ID: core.StringPtr(id), + VPNGatewayPatch: vpnGatewayPatch, } } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options -} - // SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerOptions) SetID(id string) *UpdateLoadBalancerListenerOptions { +func (_options *UpdateVPNGatewayOptions) SetID(id string) *UpdateVPNGatewayOptions { _options.ID = core.StringPtr(id) return _options } -// SetLoadBalancerListenerPatch : Allow user to set LoadBalancerListenerPatch -func (_options *UpdateLoadBalancerListenerOptions) SetLoadBalancerListenerPatch(loadBalancerListenerPatch map[string]interface{}) *UpdateLoadBalancerListenerOptions { - _options.LoadBalancerListenerPatch = loadBalancerListenerPatch +// SetVPNGatewayPatch : Allow user to set VPNGatewayPatch +func (_options *UpdateVPNGatewayOptions) SetVPNGatewayPatch(vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { + _options.VPNGatewayPatch = vpnGatewayPatch return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerOptions { +func (options *UpdateVPNGatewayOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayOptions { options.Headers = param return options } -// UpdateLoadBalancerListenerPolicyOptions : The UpdateLoadBalancerListenerPolicy options. -type UpdateLoadBalancerListenerPolicyOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// Vcpu : The VCPU configuration. +type Vcpu struct { + // The VCPU architecture. + Architecture *string `json:"architecture" validate:"required"` - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` + // The number of VCPUs assigned. + Count *int64 `json:"count" validate:"required"` +} - // The policy identifier. - ID *string `json:"id" validate:"required,ne="` +// UnmarshalVcpu unmarshals an instance of Vcpu from the specified map of raw messages. +func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Vcpu) + err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The listener policy patch. - LoadBalancerListenerPolicyPatch map[string]interface{} `json:"LoadBalancerListenerPolicy_patch" validate:"required"` +// VPC : VPC struct +type VPC struct { + // Indicates whether this VPC is connected to Classic Infrastructure. If true, this VPC's resources have private + // network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected + // in this way. This value is set at creation and subsequently immutable. + ClassicAccess *bool `json:"classic_access" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The date and time that the VPC was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` + + // The CSE ([Cloud Service Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) source IP + // addresses for the VPC. The VPC will have one CSE source IP address per zone. + CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` + + // The default network ACL to use for subnets created in this VPC. + DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` + + // The default routing table to use for subnets created in this VPC. + DefaultRoutingTable *RoutingTableReference `json:"default_routing_table" validate:"required"` + + // The default security group to use for network interfaces created in this VPC. + DefaultSecurityGroup *SecurityGroupReference `json:"default_security_group" validate:"required"` + + // The URL for this VPC. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` + + // The unique user-defined name for this VPC. + Name *string `json:"name" validate:"required"` + + // The resource group for this VPC. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The status of this VPC. + Status *string `json:"status" validate:"required"` } -// NewUpdateLoadBalancerListenerPolicyOptions : Instantiate UpdateLoadBalancerListenerPolicyOptions -func (*VpcV1) NewUpdateLoadBalancerListenerPolicyOptions(loadBalancerID string, listenerID string, id string, loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { - return &UpdateLoadBalancerListenerPolicyOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - ID: core.StringPtr(id), - LoadBalancerListenerPolicyPatch: loadBalancerListenerPolicyPatch, +// Constants associated with the VPC.Status property. +// The status of this VPC. +const ( + VPCStatusAvailableConst = "available" + VPCStatusDeletingConst = "deleting" + VPCStatusFailedConst = "failed" + VPCStatusPendingConst = "pending" +) + +// UnmarshalVPC unmarshals an instance of VPC from the specified map of raw messages. +func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPC) + err = core.UnmarshalPrimitive(m, "classic_access", &obj.ClassicAccess) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cse_source_ips", &obj.CseSourceIps, UnmarshalVpccseSourceIP) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_network_acl", &obj.DefaultNetworkACL, UnmarshalNetworkACLReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_routing_table", &obj.DefaultRoutingTable, UnmarshalRoutingTableReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_security_group", &obj.DefaultSecurityGroup, UnmarshalSecurityGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// VpccseSourceIP : VpccseSourceIP struct +type VpccseSourceIP struct { + // The cloud service endpoint source IP address for this zone. + IP *IP `json:"ip" validate:"required"` + + // The zone this cloud service endpoint source IP resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// SetListenerID : Allow user to set ListenerID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +// UnmarshalVpccseSourceIP unmarshals an instance of VpccseSourceIP from the specified map of raw messages. +func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VpccseSourceIP) + err = core.UnmarshalModel(m, "ip", &obj.IP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyOptions { - _options.ID = core.StringPtr(id) - return _options +// VPCCollection : VPCCollection struct +type VPCCollection struct { + // A link to the first page of resources. + First *VPCCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VPCCollectionNext `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` + + // Collection of VPCs. + Vpcs []VPC `json:"vpcs" validate:"required"` } -// SetLoadBalancerListenerPolicyPatch : Allow user to set LoadBalancerListenerPolicyPatch -func (_options *UpdateLoadBalancerListenerPolicyOptions) SetLoadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyOptions { - _options.LoadBalancerListenerPolicyPatch = loadBalancerListenerPolicyPatch - return _options +// UnmarshalVPCCollection unmarshals an instance of VPCCollection from the specified map of raw messages. +func UnmarshalVPCCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPCCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPCCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpcs", &obj.Vpcs, UnmarshalVPC) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerPolicyOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyOptions { - options.Headers = param - return options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPCCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// UpdateLoadBalancerListenerPolicyRuleOptions : The UpdateLoadBalancerListenerPolicyRule options. -type UpdateLoadBalancerListenerPolicyRuleOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// VPCCollectionFirst : A link to the first page of resources. +type VPCCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The listener identifier. - ListenerID *string `json:"listener_id" validate:"required,ne="` +// UnmarshalVPCCollectionFirst unmarshals an instance of VPCCollectionFirst from the specified map of raw messages. +func UnmarshalVPCCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The policy identifier. - PolicyID *string `json:"policy_id" validate:"required,ne="` +// VPCCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPCCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` +// UnmarshalVPCCollectionNext unmarshals an instance of VPCCollectionNext from the specified map of raw messages. +func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The listener policy rule patch. - LoadBalancerListenerPolicyRulePatch map[string]interface{} `json:"LoadBalancerListenerPolicyRule_patch" validate:"required"` +// VPCIdentity : Identifies a VPC by a unique property. +// Models which "extend" this model: +// - VPCIdentityByID +// - VPCIdentityByCRN +// - VPCIdentityByHref +type VPCIdentity struct { + // The unique identifier for this VPC. + ID *string `json:"id,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The CRN for this VPC. + CRN *string `json:"crn,omitempty"` -// NewUpdateLoadBalancerListenerPolicyRuleOptions : Instantiate UpdateLoadBalancerListenerPolicyRuleOptions -func (*VpcV1) NewUpdateLoadBalancerListenerPolicyRuleOptions(loadBalancerID string, listenerID string, policyID string, id string, loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { - return &UpdateLoadBalancerListenerPolicyRuleOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ListenerID: core.StringPtr(listenerID), - PolicyID: core.StringPtr(policyID), - ID: core.StringPtr(id), - LoadBalancerListenerPolicyRulePatch: loadBalancerListenerPolicyRulePatch, - } + // The URL for this VPC. + Href *string `json:"href,omitempty"` } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +func (*VPCIdentity) isaVPCIdentity() bool { + return true } -// SetListenerID : Allow user to set ListenerID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetListenerID(listenerID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.ListenerID = core.StringPtr(listenerID) - return _options +type VPCIdentityIntf interface { + isaVPCIdentity() bool } -// SetPolicyID : Allow user to set PolicyID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetPolicyID(policyID string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options +// UnmarshalVPCIdentity unmarshals an instance of VPCIdentity from the specified map of raw messages. +func UnmarshalVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetID(id string) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.ID = core.StringPtr(id) - return _options +// VPCPatch : VPCPatch struct +type VPCPatch struct { + // The unique user-defined name for this VPC. + Name *string `json:"name,omitempty"` } -// SetLoadBalancerListenerPolicyRulePatch : Allow user to set LoadBalancerListenerPolicyRulePatch -func (_options *UpdateLoadBalancerListenerPolicyRuleOptions) SetLoadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatch map[string]interface{}) *UpdateLoadBalancerListenerPolicyRuleOptions { - _options.LoadBalancerListenerPolicyRulePatch = loadBalancerListenerPolicyRulePatch - return _options +// UnmarshalVPCPatch unmarshals an instance of VPCPatch from the specified map of raw messages. +func UnmarshalVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerListenerPolicyRuleOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerListenerPolicyRuleOptions { - options.Headers = param - return options +// AsPatch returns a generic map representation of the VPCPatch +func (vpcPatch *VPCPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpcPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// UpdateLoadBalancerOptions : The UpdateLoadBalancer options. -type UpdateLoadBalancerOptions struct { - // The load balancer identifier. - ID *string `json:"id" validate:"required,ne="` +// VPCReference : VPCReference struct +type VPCReference struct { + // The CRN for this VPC. + CRN *string `json:"crn" validate:"required"` - // The load balancer patch. - LoadBalancerPatch map[string]interface{} `json:"LoadBalancer_patch" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string + // The URL for this VPC. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPC. + ID *string `json:"id" validate:"required"` + + // The unique user-defined name for this VPC. + Name *string `json:"name" validate:"required"` } -// NewUpdateLoadBalancerOptions : Instantiate UpdateLoadBalancerOptions -func (*VpcV1) NewUpdateLoadBalancerOptions(id string, loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { - return &UpdateLoadBalancerOptions{ - ID: core.StringPtr(id), - LoadBalancerPatch: loadBalancerPatch, +// UnmarshalVPCReference unmarshals an instance of VPCReference from the specified map of raw messages. +func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerOptions) SetID(id string) *UpdateLoadBalancerOptions { - _options.ID = core.StringPtr(id) - return _options +// VPCReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type VPCReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetLoadBalancerPatch : Allow user to set LoadBalancerPatch -func (_options *UpdateLoadBalancerOptions) SetLoadBalancerPatch(loadBalancerPatch map[string]interface{}) *UpdateLoadBalancerOptions { - _options.LoadBalancerPatch = loadBalancerPatch - return _options +// UnmarshalVPCReferenceDeleted unmarshals an instance of VPCReferenceDeleted from the specified map of raw messages. +func UnmarshalVPCReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPCReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerOptions { - options.Headers = param - return options -} +// VPNGateway : VPNGateway struct +// Models which "extend" this model: +// - VPNGatewayRouteMode +// - VPNGatewayPolicyMode +type VPNGateway struct { + // Connections for this VPN gateway. + Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` + + // The date and time that this VPN gateway was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The VPN gateway's CRN. + CRN *string `json:"crn" validate:"required"` + + // The VPN gateway's canonical URL. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` -// UpdateLoadBalancerPoolMemberOptions : The UpdateLoadBalancerPoolMember options. -type UpdateLoadBalancerPoolMemberOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` + // Collection of VPN gateway members. + Members []VPNGatewayMember `json:"members" validate:"required"` - // The pool identifier. - PoolID *string `json:"pool_id" validate:"required,ne="` + // The user-defined name for this VPN gateway. + Name *string `json:"name" validate:"required"` - // The member identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource group for this VPN gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The load balancer pool member patch. - LoadBalancerPoolMemberPatch map[string]interface{} `json:"LoadBalancerPoolMember_patch" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The status of the VPN gateway. + Status *string `json:"status" validate:"required"` -// NewUpdateLoadBalancerPoolMemberOptions : Instantiate UpdateLoadBalancerPoolMemberOptions -func (*VpcV1) NewUpdateLoadBalancerPoolMemberOptions(loadBalancerID string, poolID string, id string, loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { - return &UpdateLoadBalancerPoolMemberOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - PoolID: core.StringPtr(poolID), - ID: core.StringPtr(id), - LoadBalancerPoolMemberPatch: loadBalancerPoolMemberPatch, - } -} + Subnet *SubnetReference `json:"subnet" validate:"required"` -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolMemberOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options + // Route mode VPN gateway. + Mode *string `json:"mode,omitempty"` } -// SetPoolID : Allow user to set PoolID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetPoolID(poolID string) *UpdateLoadBalancerPoolMemberOptions { - _options.PoolID = core.StringPtr(poolID) - return _options -} +// Constants associated with the VPNGateway.ResourceType property. +// The resource type. +const ( + VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" +) -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerPoolMemberOptions) SetID(id string) *UpdateLoadBalancerPoolMemberOptions { - _options.ID = core.StringPtr(id) - return _options +// Constants associated with the VPNGateway.Status property. +// The status of the VPN gateway. +const ( + VPNGatewayStatusAvailableConst = "available" + VPNGatewayStatusDeletingConst = "deleting" + VPNGatewayStatusFailedConst = "failed" + VPNGatewayStatusPendingConst = "pending" +) + +// Constants associated with the VPNGateway.Mode property. +// Route mode VPN gateway. +const ( + VPNGatewayModeRouteConst = "route" +) + +func (*VPNGateway) isaVPNGateway() bool { + return true } -// SetLoadBalancerPoolMemberPatch : Allow user to set LoadBalancerPoolMemberPatch -func (_options *UpdateLoadBalancerPoolMemberOptions) SetLoadBalancerPoolMemberPatch(loadBalancerPoolMemberPatch map[string]interface{}) *UpdateLoadBalancerPoolMemberOptions { - _options.LoadBalancerPoolMemberPatch = loadBalancerPoolMemberPatch - return _options +type VPNGatewayIntf interface { + isaVPNGateway() bool } -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerPoolMemberOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolMemberOptions { - options.Headers = param - return options +// UnmarshalVPNGateway unmarshals an instance of VPNGateway from the specified map of raw messages. +func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGateway) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateLoadBalancerPoolOptions : The UpdateLoadBalancerPool options. -type UpdateLoadBalancerPoolOptions struct { - // The load balancer identifier. - LoadBalancerID *string `json:"load_balancer_id" validate:"required,ne="` +// VPNGatewayCollection : VPNGatewayCollection struct +type VPNGatewayCollection struct { + // A link to the first page of resources. + First *VPNGatewayCollectionFirst `json:"first" validate:"required"` - // The pool identifier. - ID *string `json:"id" validate:"required,ne="` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // The load balancer pool patch. - LoadBalancerPoolPatch map[string]interface{} `json:"LoadBalancerPool_patch" validate:"required"` + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VPNGatewayCollectionNext `json:"next,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` -// NewUpdateLoadBalancerPoolOptions : Instantiate UpdateLoadBalancerPoolOptions -func (*VpcV1) NewUpdateLoadBalancerPoolOptions(loadBalancerID string, id string, loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { - return &UpdateLoadBalancerPoolOptions{ - LoadBalancerID: core.StringPtr(loadBalancerID), - ID: core.StringPtr(id), - LoadBalancerPoolPatch: loadBalancerPoolPatch, - } + // Collection of VPN gateways. + VPNGateways []VPNGatewayIntf `json:"vpn_gateways" validate:"required"` } -// SetLoadBalancerID : Allow user to set LoadBalancerID -func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerID(loadBalancerID string) *UpdateLoadBalancerPoolOptions { - _options.LoadBalancerID = core.StringPtr(loadBalancerID) - return _options +// UnmarshalVPNGatewayCollection unmarshals an instance of VPNGatewayCollection from the specified map of raw messages. +func UnmarshalVPNGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNGatewayCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNGatewayCollectionNext) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + err = core.UnmarshalModel(m, "vpn_gateways", &obj.VPNGateways, UnmarshalVPNGateway) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateLoadBalancerPoolOptions) SetID(id string) *UpdateLoadBalancerPoolOptions { - _options.ID = core.StringPtr(id) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPNGatewayCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// SetLoadBalancerPoolPatch : Allow user to set LoadBalancerPoolPatch -func (_options *UpdateLoadBalancerPoolOptions) SetLoadBalancerPoolPatch(loadBalancerPoolPatch map[string]interface{}) *UpdateLoadBalancerPoolOptions { - _options.LoadBalancerPoolPatch = loadBalancerPoolPatch - return _options +// VPNGatewayCollectionFirst : A link to the first page of resources. +type VPNGatewayCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateLoadBalancerPoolOptions) SetHeaders(param map[string]string) *UpdateLoadBalancerPoolOptions { - options.Headers = param - return options +// UnmarshalVPNGatewayCollectionFirst unmarshals an instance of VPNGatewayCollectionFirst from the specified map of raw messages. +func UnmarshalVPNGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateNetworkACLOptions : The UpdateNetworkACL options. -type UpdateNetworkACLOptions struct { - // The network ACL identifier. - ID *string `json:"id" validate:"required,ne="` - - // The network ACL patch. - NetworkACLPatch map[string]interface{} `json:"NetworkACL_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// VPNGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VPNGatewayCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` } -// NewUpdateNetworkACLOptions : Instantiate UpdateNetworkACLOptions -func (*VpcV1) NewUpdateNetworkACLOptions(id string, networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { - return &UpdateNetworkACLOptions{ - ID: core.StringPtr(id), - NetworkACLPatch: networkACLPatch, +// UnmarshalVPNGatewayCollectionNext unmarshals an instance of VPNGatewayCollectionNext from the specified map of raw messages. +func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateNetworkACLOptions) SetID(id string) *UpdateNetworkACLOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnection : VPNGatewayConnection struct +// Models which "extend" this model: +// - VPNGatewayConnectionStaticRouteMode +// - VPNGatewayConnectionPolicyMode +type VPNGatewayConnection struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up" validate:"required"` -// SetNetworkACLPatch : Allow user to set NetworkACLPatch -func (_options *UpdateNetworkACLOptions) SetNetworkACLPatch(networkACLPatch map[string]interface{}) *UpdateNetworkACLOptions { - _options.NetworkACLPatch = networkACLPatch - return _options -} + // The authentication mode. Only `psk` is currently supported. + AuthenticationMode *string `json:"authentication_mode" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateNetworkACLOptions) SetHeaders(param map[string]string) *UpdateNetworkACLOptions { - options.Headers = param - return options -} + // The date and time that this VPN gateway connection was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// UpdateNetworkACLRuleOptions : The UpdateNetworkACLRule options. -type UpdateNetworkACLRuleOptions struct { - // The network ACL identifier. - NetworkACLID *string `json:"network_acl_id" validate:"required,ne="` + // The Dead Peer Detection settings. + DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` + // The VPN connection's canonical URL. + Href *string `json:"href" validate:"required"` - // The network ACL rule patch. - NetworkACLRulePatch map[string]interface{} `json:"NetworkACLRule_patch" validate:"required"` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The IKE policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` -// NewUpdateNetworkACLRuleOptions : Instantiate UpdateNetworkACLRuleOptions -func (*VpcV1) NewUpdateNetworkACLRuleOptions(networkACLID string, id string, networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { - return &UpdateNetworkACLRuleOptions{ - NetworkACLID: core.StringPtr(networkACLID), - ID: core.StringPtr(id), - NetworkACLRulePatch: networkACLRulePatch, - } -} + // The IPsec policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` -// SetNetworkACLID : Allow user to set NetworkACLID -func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLID(networkACLID string) *UpdateNetworkACLRuleOptions { - _options.NetworkACLID = core.StringPtr(networkACLID) - return _options -} + // The mode of the VPN gateway. + Mode *string `json:"mode" validate:"required"` -// SetID : Allow user to set ID -func (_options *UpdateNetworkACLRuleOptions) SetID(id string) *UpdateNetworkACLRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The user-defined name for this VPN gateway connection. + Name *string `json:"name" validate:"required"` -// SetNetworkACLRulePatch : Allow user to set NetworkACLRulePatch -func (_options *UpdateNetworkACLRuleOptions) SetNetworkACLRulePatch(networkACLRulePatch map[string]interface{}) *UpdateNetworkACLRuleOptions { - _options.NetworkACLRulePatch = networkACLRulePatch - return _options -} + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *UpdateNetworkACLRuleOptions) SetHeaders(param map[string]string) *UpdateNetworkACLRuleOptions { - options.Headers = param - return options -} + // The preshared key. + Psk *string `json:"psk" validate:"required"` -// UpdatePlacementGroupOptions : The UpdatePlacementGroup options. -type UpdatePlacementGroupOptions struct { - // The placement group identifier. - ID *string `json:"id" validate:"required,ne="` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The placement group patch. - PlacementGroupPatch map[string]interface{} `json:"PlacementGroup_patch" validate:"required"` + // The status of a VPN gateway connection. + Status *string `json:"status" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` -// NewUpdatePlacementGroupOptions : Instantiate UpdatePlacementGroupOptions -func (*VpcV1) NewUpdatePlacementGroupOptions(id string, placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { - return &UpdatePlacementGroupOptions{ - ID: core.StringPtr(id), - PlacementGroupPatch: placementGroupPatch, - } -} + // The VPN tunnel configuration for this VPN gateway connection (in static route mode). + Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels,omitempty"` -// SetID : Allow user to set ID -func (_options *UpdatePlacementGroupOptions) SetID(id string) *UpdatePlacementGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs,omitempty"` -// SetPlacementGroupPatch : Allow user to set PlacementGroupPatch -func (_options *UpdatePlacementGroupOptions) SetPlacementGroupPatch(placementGroupPatch map[string]interface{}) *UpdatePlacementGroupOptions { - _options.PlacementGroupPatch = placementGroupPatch - return _options + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdatePlacementGroupOptions) SetHeaders(param map[string]string) *UpdatePlacementGroupOptions { - options.Headers = param - return options -} +// Constants associated with the VPNGatewayConnection.AuthenticationMode property. +// The authentication mode. Only `psk` is currently supported. +const ( + VPNGatewayConnectionAuthenticationModePskConst = "psk" +) -// UpdatePublicGatewayOptions : The UpdatePublicGateway options. -type UpdatePublicGatewayOptions struct { - // The public gateway identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the VPNGatewayConnection.Mode property. +// The mode of the VPN gateway. +const ( + VPNGatewayConnectionModePolicyConst = "policy" + VPNGatewayConnectionModeRouteConst = "route" +) - // The public gateway patch. - PublicGatewayPatch map[string]interface{} `json:"PublicGateway_patch" validate:"required"` +// Constants associated with the VPNGatewayConnection.ResourceType property. +// The resource type. +const ( + VPNGatewayConnectionResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) - // Allows users to set headers on API requests - Headers map[string]string +// Constants associated with the VPNGatewayConnection.Status property. +// The status of a VPN gateway connection. +const ( + VPNGatewayConnectionStatusDownConst = "down" + VPNGatewayConnectionStatusUpConst = "up" +) + +// Constants associated with the VPNGatewayConnection.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. +const ( + VPNGatewayConnectionRoutingProtocolNoneConst = "none" +) + +func (*VPNGatewayConnection) isaVPNGatewayConnection() bool { + return true } -// NewUpdatePublicGatewayOptions : Instantiate UpdatePublicGatewayOptions -func (*VpcV1) NewUpdatePublicGatewayOptions(id string, publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { - return &UpdatePublicGatewayOptions{ - ID: core.StringPtr(id), - PublicGatewayPatch: publicGatewayPatch, - } +type VPNGatewayConnectionIntf interface { + isaVPNGatewayConnection() bool } -// SetID : Allow user to set ID -func (_options *UpdatePublicGatewayOptions) SetID(id string) *UpdatePublicGatewayOptions { - _options.ID = core.StringPtr(id) - return _options +// UnmarshalVPNGatewayConnection unmarshals an instance of VPNGatewayConnection from the specified map of raw messages. +func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnection) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPublicGatewayPatch : Allow user to set PublicGatewayPatch -func (_options *UpdatePublicGatewayOptions) SetPublicGatewayPatch(publicGatewayPatch map[string]interface{}) *UpdatePublicGatewayOptions { - _options.PublicGatewayPatch = publicGatewayPatch - return _options +// VPNGatewayConnectionCollection : Collection of VPN gateway connections in a VPN gateway. +type VPNGatewayConnectionCollection struct { + // Array of VPN gateway connections. + Connections []VPNGatewayConnectionIntf `json:"connections" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) *UpdatePublicGatewayOptions { - options.Headers = param - return options +// UnmarshalVPNGatewayConnectionCollection unmarshals an instance of VPNGatewayConnectionCollection from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionCollection) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnection) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateSecurityGroupOptions : The UpdateSecurityGroup options. -type UpdateSecurityGroupOptions struct { - // The security group identifier. - ID *string `json:"id" validate:"required,ne="` +// VPNGatewayConnectionDpd : The Dead Peer Detection settings. +type VPNGatewayConnectionDpd struct { + // Dead Peer Detection actions. + Action *string `json:"action" validate:"required"` - // The security group patch. - SecurityGroupPatch map[string]interface{} `json:"SecurityGroup_patch" validate:"required"` + // Dead Peer Detection interval in seconds. + Interval *int64 `json:"interval" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // Dead Peer Detection timeout in seconds. Must be at least the interval. + Timeout *int64 `json:"timeout" validate:"required"` } -// NewUpdateSecurityGroupOptions : Instantiate UpdateSecurityGroupOptions -func (*VpcV1) NewUpdateSecurityGroupOptions(id string, securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { - return &UpdateSecurityGroupOptions{ - ID: core.StringPtr(id), - SecurityGroupPatch: securityGroupPatch, +// Constants associated with the VPNGatewayConnectionDpd.Action property. +// Dead Peer Detection actions. +const ( + VPNGatewayConnectionDpdActionClearConst = "clear" + VPNGatewayConnectionDpdActionHoldConst = "hold" + VPNGatewayConnectionDpdActionNoneConst = "none" + VPNGatewayConnectionDpdActionRestartConst = "restart" +) + +// UnmarshalVPNGatewayConnectionDpd unmarshals an instance of VPNGatewayConnectionDpd from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDpd(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDpd) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateSecurityGroupOptions) SetID(id string) *UpdateSecurityGroupOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionDpdPatch : The Dead Peer Detection settings. +type VPNGatewayConnectionDpdPatch struct { + // Dead Peer Detection actions. + Action *string `json:"action,omitempty"` -// SetSecurityGroupPatch : Allow user to set SecurityGroupPatch -func (_options *UpdateSecurityGroupOptions) SetSecurityGroupPatch(securityGroupPatch map[string]interface{}) *UpdateSecurityGroupOptions { - _options.SecurityGroupPatch = securityGroupPatch - return _options -} + // Dead Peer Detection interval in seconds. + Interval *int64 `json:"interval,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateSecurityGroupOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupOptions { - options.Headers = param - return options + // Dead Peer Detection timeout in seconds. Must be at least the interval. + Timeout *int64 `json:"timeout,omitempty"` } -// UpdateSecurityGroupRuleOptions : The UpdateSecurityGroupRule options. -type UpdateSecurityGroupRuleOptions struct { - // The security group identifier. - SecurityGroupID *string `json:"security_group_id" validate:"required,ne="` - - // The rule identifier. - ID *string `json:"id" validate:"required,ne="` - - // The security group rule patch. - SecurityGroupRulePatch map[string]interface{} `json:"SecurityGroupRule_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the VPNGatewayConnectionDpdPatch.Action property. +// Dead Peer Detection actions. +const ( + VPNGatewayConnectionDpdPatchActionClearConst = "clear" + VPNGatewayConnectionDpdPatchActionHoldConst = "hold" + VPNGatewayConnectionDpdPatchActionNoneConst = "none" + VPNGatewayConnectionDpdPatchActionRestartConst = "restart" +) -// NewUpdateSecurityGroupRuleOptions : Instantiate UpdateSecurityGroupRuleOptions -func (*VpcV1) NewUpdateSecurityGroupRuleOptions(securityGroupID string, id string, securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { - return &UpdateSecurityGroupRuleOptions{ - SecurityGroupID: core.StringPtr(securityGroupID), - ID: core.StringPtr(id), - SecurityGroupRulePatch: securityGroupRulePatch, +// UnmarshalVPNGatewayConnectionDpdPatch unmarshals an instance of VPNGatewayConnectionDpdPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDpdPatch) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSecurityGroupID : Allow user to set SecurityGroupID -func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupID(securityGroupID string) *UpdateSecurityGroupRuleOptions { - _options.SecurityGroupID = core.StringPtr(securityGroupID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateSecurityGroupRuleOptions) SetID(id string) *UpdateSecurityGroupRuleOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionDpdPrototype : The Dead Peer Detection settings. +type VPNGatewayConnectionDpdPrototype struct { + // Dead Peer Detection actions. + Action *string `json:"action,omitempty"` -// SetSecurityGroupRulePatch : Allow user to set SecurityGroupRulePatch -func (_options *UpdateSecurityGroupRuleOptions) SetSecurityGroupRulePatch(securityGroupRulePatch map[string]interface{}) *UpdateSecurityGroupRuleOptions { - _options.SecurityGroupRulePatch = securityGroupRulePatch - return _options -} + // Dead Peer Detection interval in seconds. + Interval *int64 `json:"interval,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateSecurityGroupRuleOptions) SetHeaders(param map[string]string) *UpdateSecurityGroupRuleOptions { - options.Headers = param - return options + // Dead Peer Detection timeout in seconds. Must be at least the interval. + Timeout *int64 `json:"timeout,omitempty"` } -// UpdateSnapshotOptions : The UpdateSnapshot options. -type UpdateSnapshotOptions struct { - // The snapshot identifier. - ID *string `json:"id" validate:"required,ne="` - - // The snapshot patch. - SnapshotPatch map[string]interface{} `json:"Snapshot_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the VPNGatewayConnectionDpdPrototype.Action property. +// Dead Peer Detection actions. +const ( + VPNGatewayConnectionDpdPrototypeActionClearConst = "clear" + VPNGatewayConnectionDpdPrototypeActionHoldConst = "hold" + VPNGatewayConnectionDpdPrototypeActionNoneConst = "none" + VPNGatewayConnectionDpdPrototypeActionRestartConst = "restart" +) -// NewUpdateSnapshotOptions : Instantiate UpdateSnapshotOptions -func (*VpcV1) NewUpdateSnapshotOptions(id string, snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { - return &UpdateSnapshotOptions{ - ID: core.StringPtr(id), - SnapshotPatch: snapshotPatch, +// UnmarshalVPNGatewayConnectionDpdPrototype unmarshals an instance of VPNGatewayConnectionDpdPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDpdPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateSnapshotOptions) SetID(id string) *UpdateSnapshotOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionIkePolicyPatch : The IKE policy to use. Specify `null` to remove any existing policy, [resulting in +// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). +// Models which "extend" this model: +// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID +// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref +type VPNGatewayConnectionIkePolicyPatch struct { + // The unique identifier for this IKE policy. + ID *string `json:"id,omitempty"` -// SetSnapshotPatch : Allow user to set SnapshotPatch -func (_options *UpdateSnapshotOptions) SetSnapshotPatch(snapshotPatch map[string]interface{}) *UpdateSnapshotOptions { - _options.SnapshotPatch = snapshotPatch - return _options + // The IKE policy's canonical URL. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateSnapshotOptions) SetHeaders(param map[string]string) *UpdateSnapshotOptions { - options.Headers = param - return options +func (*VPNGatewayConnectionIkePolicyPatch) isaVPNGatewayConnectionIkePolicyPatch() bool { + return true } -// UpdateSubnetOptions : The UpdateSubnet options. -type UpdateSubnetOptions struct { - // The subnet identifier. - ID *string `json:"id" validate:"required,ne="` - - // The subnet patch. - SubnetPatch map[string]interface{} `json:"Subnet_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type VPNGatewayConnectionIkePolicyPatchIntf interface { + isaVPNGatewayConnectionIkePolicyPatch() bool } -// NewUpdateSubnetOptions : Instantiate UpdateSubnetOptions -func (*VpcV1) NewUpdateSubnetOptions(id string, subnetPatch map[string]interface{}) *UpdateSubnetOptions { - return &UpdateSubnetOptions{ - ID: core.StringPtr(id), - SubnetPatch: subnetPatch, +// UnmarshalVPNGatewayConnectionIkePolicyPatch unmarshals an instance of VPNGatewayConnectionIkePolicyPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateSubnetOptions) SetID(id string) *UpdateSubnetOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionIkePolicyPrototype : The IKE policy to use. If unspecified, [auto-negotiation will be +// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). +// Models which "extend" this model: +// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID +// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref +type VPNGatewayConnectionIkePolicyPrototype struct { + // The unique identifier for this IKE policy. + ID *string `json:"id,omitempty"` -// SetSubnetPatch : Allow user to set SubnetPatch -func (_options *UpdateSubnetOptions) SetSubnetPatch(subnetPatch map[string]interface{}) *UpdateSubnetOptions { - _options.SubnetPatch = subnetPatch - return _options + // The IKE policy's canonical URL. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateSubnetOptions) SetHeaders(param map[string]string) *UpdateSubnetOptions { - options.Headers = param - return options +func (*VPNGatewayConnectionIkePolicyPrototype) isaVPNGatewayConnectionIkePolicyPrototype() bool { + return true } -// UpdateSubnetReservedIPOptions : The UpdateSubnetReservedIP options. -type UpdateSubnetReservedIPOptions struct { - // The subnet identifier. - SubnetID *string `json:"subnet_id" validate:"required,ne="` - - // The reserved IP identifier. - ID *string `json:"id" validate:"required,ne="` - - // The reserved IP patch. - ReservedIPPatch map[string]interface{} `json:"ReservedIP_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type VPNGatewayConnectionIkePolicyPrototypeIntf interface { + isaVPNGatewayConnectionIkePolicyPrototype() bool } -// NewUpdateSubnetReservedIPOptions : Instantiate UpdateSubnetReservedIPOptions -func (*VpcV1) NewUpdateSubnetReservedIPOptions(subnetID string, id string, reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { - return &UpdateSubnetReservedIPOptions{ - SubnetID: core.StringPtr(subnetID), - ID: core.StringPtr(id), - ReservedIPPatch: reservedIPPatch, +// UnmarshalVPNGatewayConnectionIkePolicyPrototype unmarshals an instance of VPNGatewayConnectionIkePolicyPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIkePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIkePolicyPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetSubnetID : Allow user to set SubnetID -func (_options *UpdateSubnetReservedIPOptions) SetSubnetID(subnetID string) *UpdateSubnetReservedIPOptions { - _options.SubnetID = core.StringPtr(subnetID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateSubnetReservedIPOptions) SetID(id string) *UpdateSubnetReservedIPOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionIPsecPolicyPatch : The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in +// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). +// Models which "extend" this model: +// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID +// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref +type VPNGatewayConnectionIPsecPolicyPatch struct { + // The unique identifier for this IPsec policy. + ID *string `json:"id,omitempty"` -// SetReservedIPPatch : Allow user to set ReservedIPPatch -func (_options *UpdateSubnetReservedIPOptions) SetReservedIPPatch(reservedIPPatch map[string]interface{}) *UpdateSubnetReservedIPOptions { - _options.ReservedIPPatch = reservedIPPatch - return _options + // The IPsec policy's canonical URL. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateSubnetReservedIPOptions) SetHeaders(param map[string]string) *UpdateSubnetReservedIPOptions { - options.Headers = param - return options +func (*VPNGatewayConnectionIPsecPolicyPatch) isaVPNGatewayConnectionIPsecPolicyPatch() bool { + return true } -// UpdateVolumeOptions : The UpdateVolume options. -type UpdateVolumeOptions struct { - // The volume identifier. - ID *string `json:"id" validate:"required,ne="` - - // The volume patch. - VolumePatch map[string]interface{} `json:"Volume_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type VPNGatewayConnectionIPsecPolicyPatchIntf interface { + isaVPNGatewayConnectionIPsecPolicyPatch() bool } -// NewUpdateVolumeOptions : Instantiate UpdateVolumeOptions -func (*VpcV1) NewUpdateVolumeOptions(id string, volumePatch map[string]interface{}) *UpdateVolumeOptions { - return &UpdateVolumeOptions{ - ID: core.StringPtr(id), - VolumePatch: volumePatch, +// UnmarshalVPNGatewayConnectionIPsecPolicyPatch unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPatch) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateVolumeOptions) SetID(id string) *UpdateVolumeOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionIPsecPolicyPrototype : The IPsec policy to use. If unspecified, [auto-negotiation will be +// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). +// Models which "extend" this model: +// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID +// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref +type VPNGatewayConnectionIPsecPolicyPrototype struct { + // The unique identifier for this IPsec policy. + ID *string `json:"id,omitempty"` -// SetVolumePatch : Allow user to set VolumePatch -func (_options *UpdateVolumeOptions) SetVolumePatch(volumePatch map[string]interface{}) *UpdateVolumeOptions { - _options.VolumePatch = volumePatch - return _options + // The IPsec policy's canonical URL. + Href *string `json:"href,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateVolumeOptions) SetHeaders(param map[string]string) *UpdateVolumeOptions { - options.Headers = param - return options +func (*VPNGatewayConnectionIPsecPolicyPrototype) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { + return true } -// UpdateVPCAddressPrefixOptions : The UpdateVPCAddressPrefix options. -type UpdateVPCAddressPrefixOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The prefix identifier. - ID *string `json:"id" validate:"required,ne="` - - // The prefix patch. - AddressPrefixPatch map[string]interface{} `json:"AddressPrefix_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +type VPNGatewayConnectionIPsecPolicyPrototypeIntf interface { + isaVPNGatewayConnectionIPsecPolicyPrototype() bool } -// NewUpdateVPCAddressPrefixOptions : Instantiate UpdateVPCAddressPrefixOptions -func (*VpcV1) NewUpdateVPCAddressPrefixOptions(vpcID string, id string, addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { - return &UpdateVPCAddressPrefixOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - AddressPrefixPatch: addressPrefixPatch, +// UnmarshalVPNGatewayConnectionIPsecPolicyPrototype unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionIPsecPolicyPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCAddressPrefixOptions) SetVPCID(vpcID string) *UpdateVPCAddressPrefixOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options -} - -// SetID : Allow user to set ID -func (_options *UpdateVPCAddressPrefixOptions) SetID(id string) *UpdateVPCAddressPrefixOptions { - _options.ID = core.StringPtr(id) - return _options +// VPNGatewayConnectionLocalCIDRs : VPNGatewayConnectionLocalCIDRs struct +type VPNGatewayConnectionLocalCIDRs struct { + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs,omitempty"` } -// SetAddressPrefixPatch : Allow user to set AddressPrefixPatch -func (_options *UpdateVPCAddressPrefixOptions) SetAddressPrefixPatch(addressPrefixPatch map[string]interface{}) *UpdateVPCAddressPrefixOptions { - _options.AddressPrefixPatch = addressPrefixPatch - return _options +// UnmarshalVPNGatewayConnectionLocalCIDRs unmarshals an instance of VPNGatewayConnectionLocalCIDRs from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionLocalCIDRs) + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCAddressPrefixOptions) SetHeaders(param map[string]string) *UpdateVPCAddressPrefixOptions { - options.Headers = param - return options -} +// VPNGatewayConnectionPatch : VPNGatewayConnectionPatch struct +// Models which "extend" this model: +// - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch +type VPNGatewayConnectionPatch struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` -// UpdateVPCOptions : The UpdateVPC options. -type UpdateVPCOptions struct { - // The VPC identifier. - ID *string `json:"id" validate:"required,ne="` + // The Dead Peer Detection settings. + DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` - // The VPC patch. - VPCPatch map[string]interface{} `json:"VPC_patch" validate:"required"` + // The IKE policy to use. Specify `null` to remove any existing policy, [resulting in + // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in + // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` -// NewUpdateVPCOptions : Instantiate UpdateVPCOptions -func (*VpcV1) NewUpdateVPCOptions(id string, vpcPatch map[string]interface{}) *UpdateVPCOptions { - return &UpdateVPCOptions{ - ID: core.StringPtr(id), - VPCPatch: vpcPatch, - } -} + // The user-defined name for this VPN gateway connection. + Name *string `json:"name,omitempty"` -// SetID : Allow user to set ID -func (_options *UpdateVPCOptions) SetID(id string) *UpdateVPCOptions { - _options.ID = core.StringPtr(id) - return _options -} + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address,omitempty"` -// SetVPCPatch : Allow user to set VPCPatch -func (_options *UpdateVPCOptions) SetVPCPatch(vpcPatch map[string]interface{}) *UpdateVPCOptions { - _options.VPCPatch = vpcPatch - return _options -} + // The preshared key. + Psk *string `json:"psk,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCOptions) SetHeaders(param map[string]string) *UpdateVPCOptions { - options.Headers = param - return options + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` } -// UpdateVPCRouteOptions : The UpdateVPCRoute options. -type UpdateVPCRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` - - // The route identifier. - ID *string `json:"id" validate:"required,ne="` +// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. +const ( + VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" +) - // The route patch. - RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` +func (*VPNGatewayConnectionPatch) isaVPNGatewayConnectionPatch() bool { + return true +} - // Allows users to set headers on API requests - Headers map[string]string +type VPNGatewayConnectionPatchIntf interface { + isaVPNGatewayConnectionPatch() bool } -// NewUpdateVPCRouteOptions : Instantiate UpdateVPCRouteOptions -func (*VpcV1) NewUpdateVPCRouteOptions(vpcID string, id string, routePatch map[string]interface{}) *UpdateVPCRouteOptions { - return &UpdateVPCRouteOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - RoutePatch: routePatch, +// UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPatch) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + if err != nil { + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRouteOptions) SetVPCID(vpcID string) *UpdateVPCRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// AsPatch returns a generic map representation of the VPNGatewayConnectionPatch +func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpnGatewayConnectionPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -// SetID : Allow user to set ID -func (_options *UpdateVPCRouteOptions) SetID(id string) *UpdateVPCRouteOptions { - _options.ID = core.StringPtr(id) - return _options +// VPNGatewayConnectionPeerCIDRs : VPNGatewayConnectionPeerCIDRs struct +type VPNGatewayConnectionPeerCIDRs struct { + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs,omitempty"` } -// SetRoutePatch : Allow user to set RoutePatch -func (_options *UpdateVPCRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRouteOptions { - _options.RoutePatch = routePatch - return _options +// UnmarshalVPNGatewayConnectionPeerCIDRs unmarshals an instance of VPNGatewayConnectionPeerCIDRs from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerCIDRs) + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRouteOptions { - options.Headers = param - return options -} +// VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct +// Models which "extend" this model: +// - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype +// - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype +type VPNGatewayConnectionPrototype struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` -// UpdateVPCRoutingTableOptions : The UpdateVPCRoutingTable options. -type UpdateVPCRoutingTableOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` + // The Dead Peer Detection settings. + DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - // The routing table identifier. - ID *string `json:"id" validate:"required,ne="` + // The IKE policy to use. If unspecified, [auto-negotiation will be + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - // The routing table patch. - RoutingTablePatch map[string]interface{} `json:"RoutingTable_patch" validate:"required"` + // The IPsec policy to use. If unspecified, [auto-negotiation will be + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The user-defined name for this VPN gateway connection. + Name *string `json:"name,omitempty"` -// NewUpdateVPCRoutingTableOptions : Instantiate UpdateVPCRoutingTableOptions -func (*VpcV1) NewUpdateVPCRoutingTableOptions(vpcID string, id string, routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { - return &UpdateVPCRoutingTableOptions{ - VPCID: core.StringPtr(vpcID), - ID: core.StringPtr(id), - RoutingTablePatch: routingTablePatch, - } -} + // The IP address of the peer VPN gateway. + PeerAddress *string `json:"peer_address" validate:"required"` -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRoutingTableOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options + // The preshared key. + Psk *string `json:"psk" validate:"required"` + + // Routing protocols are disabled for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol,omitempty"` + + // The local CIDRs for this resource. + LocalCIDRs []string `json:"local_cidrs,omitempty"` + + // The peer CIDRs for this resource. + PeerCIDRs []string `json:"peer_cidrs,omitempty"` } -// SetID : Allow user to set ID -func (_options *UpdateVPCRoutingTableOptions) SetID(id string) *UpdateVPCRoutingTableOptions { - _options.ID = core.StringPtr(id) - return _options +// Constants associated with the VPNGatewayConnectionPrototype.RoutingProtocol property. +// Routing protocols are disabled for this VPN gateway connection. +const ( + VPNGatewayConnectionPrototypeRoutingProtocolNoneConst = "none" +) + +func (*VPNGatewayConnectionPrototype) isaVPNGatewayConnectionPrototype() bool { + return true } -// SetRoutingTablePatch : Allow user to set RoutingTablePatch -func (_options *UpdateVPCRoutingTableOptions) SetRoutingTablePatch(routingTablePatch map[string]interface{}) *UpdateVPCRoutingTableOptions { - _options.RoutingTablePatch = routingTablePatch - return _options +type VPNGatewayConnectionPrototypeIntf interface { + isaVPNGatewayConnectionPrototype() bool } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRoutingTableOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableOptions { - options.Headers = param - return options +// UnmarshalVPNGatewayConnectionPrototype unmarshals an instance of VPNGatewayConnectionPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPrototype) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + if err != nil { + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UpdateVPCRoutingTableRouteOptions : The UpdateVPCRoutingTableRoute options. -type UpdateVPCRoutingTableRouteOptions struct { - // The VPC identifier. - VPCID *string `json:"vpc_id" validate:"required,ne="` +// VPNGatewayConnectionReference : VPNGatewayConnectionReference struct +type VPNGatewayConnectionReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` - // The routing table identifier. - RoutingTableID *string `json:"routing_table_id" validate:"required,ne="` + // The VPN connection's canonical URL. + Href *string `json:"href" validate:"required"` - // The VPC routing table route identifier. - ID *string `json:"id" validate:"required,ne="` + // The unique identifier for this VPN gateway connection. + ID *string `json:"id" validate:"required"` - // The VPC route patch. - RoutePatch map[string]interface{} `json:"Route_patch" validate:"required"` + // The user-defined name for this VPN connection. + Name *string `json:"name" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// NewUpdateVPCRoutingTableRouteOptions : Instantiate UpdateVPCRoutingTableRouteOptions -func (*VpcV1) NewUpdateVPCRoutingTableRouteOptions(vpcID string, routingTableID string, id string, routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { - return &UpdateVPCRoutingTableRouteOptions{ - VPCID: core.StringPtr(vpcID), - RoutingTableID: core.StringPtr(routingTableID), - ID: core.StringPtr(id), - RoutePatch: routePatch, +// Constants associated with the VPNGatewayConnectionReference.ResourceType property. +// The resource type. +const ( + VPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) + +// UnmarshalVPNGatewayConnectionReference unmarshals an instance of VPNGatewayConnectionReference from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetVPCID : Allow user to set VPCID -func (_options *UpdateVPCRoutingTableRouteOptions) SetVPCID(vpcID string) *UpdateVPCRoutingTableRouteOptions { - _options.VPCID = core.StringPtr(vpcID) - return _options +// VPNGatewayConnectionReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type VPNGatewayConnectionReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// SetRoutingTableID : Allow user to set RoutingTableID -func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutingTableID(routingTableID string) *UpdateVPCRoutingTableRouteOptions { - _options.RoutingTableID = core.StringPtr(routingTableID) - return _options +// UnmarshalVPNGatewayConnectionReferenceDeleted unmarshals an instance of VPNGatewayConnectionReferenceDeleted from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *UpdateVPCRoutingTableRouteOptions) SetID(id string) *UpdateVPCRoutingTableRouteOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayConnectionStaticRouteModeTunnel : VPNGatewayConnectionStaticRouteModeTunnel struct +type VPNGatewayConnectionStaticRouteModeTunnel struct { + // The IP address of the VPN gateway member in which the tunnel resides. + PublicIP *IP `json:"public_ip" validate:"required"` -// SetRoutePatch : Allow user to set RoutePatch -func (_options *UpdateVPCRoutingTableRouteOptions) SetRoutePatch(routePatch map[string]interface{}) *UpdateVPCRoutingTableRouteOptions { - _options.RoutePatch = routePatch - return _options + // The status of the VPN Tunnel. + Status *string `json:"status" validate:"required"` } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPCRoutingTableRouteOptions) SetHeaders(param map[string]string) *UpdateVPCRoutingTableRouteOptions { - options.Headers = param - return options -} +// Constants associated with the VPNGatewayConnectionStaticRouteModeTunnel.Status property. +// The status of the VPN Tunnel. +const ( + VPNGatewayConnectionStaticRouteModeTunnelStatusDownConst = "down" + VPNGatewayConnectionStaticRouteModeTunnelStatusUpConst = "up" +) -// UpdateVPNGatewayConnectionOptions : The UpdateVPNGatewayConnection options. -type UpdateVPNGatewayConnectionOptions struct { - // The VPN gateway identifier. - VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` +// UnmarshalVPNGatewayConnectionStaticRouteModeTunnel unmarshals an instance of VPNGatewayConnectionStaticRouteModeTunnel from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionStaticRouteModeTunnel) + err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The VPN gateway connection identifier. - ID *string `json:"id" validate:"required,ne="` +// VPNGatewayMember : VPNGatewayMember struct +type VPNGatewayMember struct { + // The private IP address assigned to the VPN gateway member. This + // property will be present only when the VPN gateway status is + // `available`. + PrivateIP *IP `json:"private_ip,omitempty"` - // The VPN gateway connection patch. - VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` + // The public IP address assigned to the VPN gateway member. + PublicIP *IP `json:"public_ip" validate:"required"` - // Allows users to set headers on API requests - Headers map[string]string -} + // The high availability role assigned to the VPN gateway member. + Role *string `json:"role" validate:"required"` -// NewUpdateVPNGatewayConnectionOptions : Instantiate UpdateVPNGatewayConnectionOptions -func (*VpcV1) NewUpdateVPNGatewayConnectionOptions(vpnGatewayID string, id string, vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { - return &UpdateVPNGatewayConnectionOptions{ - VPNGatewayID: core.StringPtr(vpnGatewayID), - ID: core.StringPtr(id), - VPNGatewayConnectionPatch: vpnGatewayConnectionPatch, - } + // The status of the VPN gateway member. + Status *string `json:"status" validate:"required"` } -// SetVPNGatewayID : Allow user to set VPNGatewayID -func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *UpdateVPNGatewayConnectionOptions { - _options.VPNGatewayID = core.StringPtr(vpnGatewayID) - return _options -} +// Constants associated with the VPNGatewayMember.Role property. +// The high availability role assigned to the VPN gateway member. +const ( + VPNGatewayMemberRoleActiveConst = "active" + VPNGatewayMemberRoleStandbyConst = "standby" +) -// SetID : Allow user to set ID -func (_options *UpdateVPNGatewayConnectionOptions) SetID(id string) *UpdateVPNGatewayConnectionOptions { - _options.ID = core.StringPtr(id) - return _options -} +// Constants associated with the VPNGatewayMember.Status property. +// The status of the VPN gateway member. +const ( + VPNGatewayMemberStatusAvailableConst = "available" + VPNGatewayMemberStatusDeletingConst = "deleting" + VPNGatewayMemberStatusFailedConst = "failed" + VPNGatewayMemberStatusPendingConst = "pending" +) -// SetVPNGatewayConnectionPatch : Allow user to set VPNGatewayConnectionPatch -func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch(vpnGatewayConnectionPatch map[string]interface{}) *UpdateVPNGatewayConnectionOptions { - _options.VPNGatewayConnectionPatch = vpnGatewayConnectionPatch - return _options +// UnmarshalVPNGatewayMember unmarshals an instance of VPNGatewayMember from the specified map of raw messages. +func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayMember) + err = core.UnmarshalModel(m, "private_ip", &obj.PrivateIP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "role", &obj.Role) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { - options.Headers = param - return options +// VPNGatewayPatch : VPNGatewayPatch struct +type VPNGatewayPatch struct { + // The user-defined name for this VPN gateway. + Name *string `json:"name,omitempty"` } -// UpdateVPNGatewayOptions : The UpdateVPNGateway options. -type UpdateVPNGatewayOptions struct { - // The VPN gateway identifier. - ID *string `json:"id" validate:"required,ne="` - - // The VPN gateway patch. - VPNGatewayPatch map[string]interface{} `json:"VPNGateway_patch" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// UnmarshalVPNGatewayPatch unmarshals an instance of VPNGatewayPatch from the specified map of raw messages. +func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// NewUpdateVPNGatewayOptions : Instantiate UpdateVPNGatewayOptions -func (*VpcV1) NewUpdateVPNGatewayOptions(id string, vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { - return &UpdateVPNGatewayOptions{ - ID: core.StringPtr(id), - VPNGatewayPatch: vpnGatewayPatch, +// AsPatch returns a generic map representation of the VPNGatewayPatch +func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(vpnGatewayPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) } + return } -// SetID : Allow user to set ID -func (_options *UpdateVPNGatewayOptions) SetID(id string) *UpdateVPNGatewayOptions { - _options.ID = core.StringPtr(id) - return _options -} +// VPNGatewayPrototype : VPNGatewayPrototype struct +// Models which "extend" this model: +// - VPNGatewayPrototypeVPNGatewayRouteModePrototype +// - VPNGatewayPrototypeVPNGatewayPolicyModePrototype +type VPNGatewayPrototype struct { + // The user-defined name for this VPN gateway. + Name *string `json:"name,omitempty"` -// SetVPNGatewayPatch : Allow user to set VPNGatewayPatch -func (_options *UpdateVPNGatewayOptions) SetVPNGatewayPatch(vpnGatewayPatch map[string]interface{}) *UpdateVPNGatewayOptions { - _options.VPNGatewayPatch = vpnGatewayPatch - return _options -} + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *UpdateVPNGatewayOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayOptions { - options.Headers = param - return options + // Identifies a subnet by a unique property. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + + // Route mode VPN gateway. + Mode *string `json:"mode,omitempty"` } -// Vcpu : The VCPU configuration. -type Vcpu struct { - // The VCPU architecture. - Architecture *string `json:"architecture" validate:"required"` +// Constants associated with the VPNGatewayPrototype.Mode property. +// Route mode VPN gateway. +const ( + VPNGatewayPrototypeModeRouteConst = "route" +) + +func (*VPNGatewayPrototype) isaVPNGatewayPrototype() bool { + return true +} - // The number of VCPUs assigned. - Count *int64 `json:"count" validate:"required"` +type VPNGatewayPrototypeIntf interface { + isaVPNGatewayPrototype() bool } -// UnmarshalVcpu unmarshals an instance of Vcpu from the specified map of raw messages. -func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Vcpu) - err = core.UnmarshalPrimitive(m, "architecture", &obj.Architecture) +// UnmarshalVPNGatewayPrototype unmarshals an instance of VPNGatewayPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "count", &obj.Count) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { return } @@ -49181,85 +56192,142 @@ func UnmarshalVcpu(m map[string]json.RawMessage, result interface{}) (err error) return } -// VPC : VPC struct -type VPC struct { - // Indicates whether this VPC is connected to Classic Infrastructure. If true, this VPC's resources have private - // network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected - // in this way. This value is set at creation and subsequently immutable. - ClassicAccess *bool `json:"classic_access" validate:"required"` +// Volume : Volume struct +type Volume struct { + // Indicates whether a running virtual server instance has an attachment to this volume. + Active *bool `json:"active" validate:"required"` - // The date and time that the VPC was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // The maximum bandwidth (in megabits per second) for the volume. + Bandwidth *int64 `json:"bandwidth" validate:"required"` - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` + // Indicates whether this volume is performing an operation that must be serialized. This must be `false` to perform an + // operation that is specified to require serialization. + Busy *bool `json:"busy" validate:"required"` - // The CSE ([Cloud Service Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) source IP - // addresses for the VPC. The VPC will have one CSE source IP address per zone. - CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity" validate:"required"` - // The default network ACL to use for subnets created in this VPC. - DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` + // The date and time that the volume was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The default routing table to use for subnets created in this VPC. - DefaultRoutingTable *RoutingTableReference `json:"default_routing_table" validate:"required"` + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` - // The default security group to use for network interfaces created in this VPC. - DefaultSecurityGroup *SecurityGroupReference `json:"default_security_group" validate:"required"` + // The type of encryption used on the volume. + Encryption *string `json:"encryption" validate:"required"` - // The URL for this VPC. + // The root key used to wrap the data encryption key for the volume. + // + // This property will be present for volumes with an `encryption` type of + // `user_managed`. + EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` + + // The URL for this volume. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPC. + // The unique identifier for this volume. ID *string `json:"id" validate:"required"` - // The unique user-defined name for this VPC. + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops" validate:"required"` + + // The unique user-defined name for this volume. Name *string `json:"name" validate:"required"` - // The resource group for this VPC. + // The operating system associated with this volume. If absent, this volume was not + // created from an image, or the image did not include an operating system. + OperatingSystem *OperatingSystemReference `json:"operating_system,omitempty"` + + // The profile this volume uses. + Profile *VolumeProfileReference `json:"profile" validate:"required"` + + // The resource group for this volume. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The status of this VPC. + // The image from which this volume was created (this may be + // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + // If absent, this volume was not created from an image. + SourceImage *ImageReference `json:"source_image,omitempty"` + + // The snapshot from which this volume was cloned. + SourceSnapshot *SnapshotReference `json:"source_snapshot,omitempty"` + + // The status of the volume. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected + // property value was encountered. Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []VolumeStatusReason `json:"status_reasons" validate:"required"` + + // The volume attachments for this volume. + VolumeAttachments []VolumeAttachmentReferenceVolumeContext `json:"volume_attachments" validate:"required"` + + // The zone this volume resides in. + Zone *ZoneReference `json:"zone" validate:"required"` } -// Constants associated with the VPC.Status property. -// The status of this VPC. +// Constants associated with the Volume.Encryption property. +// The type of encryption used on the volume. const ( - VPCStatusAvailableConst = "available" - VPCStatusDeletingConst = "deleting" - VPCStatusFailedConst = "failed" - VPCStatusPendingConst = "pending" + VolumeEncryptionProviderManagedConst = "provider_managed" + VolumeEncryptionUserManagedConst = "user_managed" ) -// UnmarshalVPC unmarshals an instance of VPC from the specified map of raw messages. -func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPC) - err = core.UnmarshalPrimitive(m, "classic_access", &obj.ClassicAccess) +// Constants associated with the Volume.Status property. +// The status of the volume. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected +// property value was encountered. +const ( + VolumeStatusAvailableConst = "available" + VolumeStatusFailedConst = "failed" + VolumeStatusPendingConst = "pending" + VolumeStatusPendingDeletionConst = "pending_deletion" + VolumeStatusUnusableConst = "unusable" +) + +// UnmarshalVolume unmarshals an instance of Volume from the specified map of raw messages. +func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Volume) + err = core.UnmarshalPrimitive(m, "active", &obj.Active) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "busy", &obj.Busy) if err != nil { return } - err = core.UnmarshalModel(m, "cse_source_ips", &obj.CseSourceIps, UnmarshalVpccseSourceIP) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalModel(m, "default_network_acl", &obj.DefaultNetworkACL, UnmarshalNetworkACLReference) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "default_routing_table", &obj.DefaultRoutingTable, UnmarshalRoutingTableReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalModel(m, "default_security_group", &obj.DefaultSecurityGroup, UnmarshalSecurityGroupReference) + err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) if err != nil { return } @@ -49271,35 +56339,43 @@ func UnmarshalVPC(m map[string]json.RawMessage, result interface{}) (err error) if err != nil { return } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } + err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileReference) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return } + err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotReference) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VpccseSourceIP : VpccseSourceIP struct -type VpccseSourceIP struct { - // The cloud service endpoint source IP address for this zone. - IP *IP `json:"ip" validate:"required"` - - // The zone this cloud service endpoint source IP resides in. - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// UnmarshalVpccseSourceIP unmarshals an instance of VpccseSourceIP from the specified map of raw messages. -func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VpccseSourceIP) - err = core.UnmarshalModel(m, "ip", &obj.IP, UnmarshalIP) + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeStatusReason) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceVolumeContext) if err != nil { return } @@ -49311,74 +56387,98 @@ func UnmarshalVpccseSourceIP(m map[string]json.RawMessage, result interface{}) ( return } -// VPCCollection : VPCCollection struct -type VPCCollection struct { - // A link to the first page of resources. - First *VPCCollectionFirst `json:"first" validate:"required"` +// VolumeAttachment : VolumeAttachment struct +type VolumeAttachment struct { + // The maximum bandwidth (in megabits per second) for the volume when attached to this instance. This may be lower than + // the volume bandwidth depending on the configuration of the instance. + Bandwidth *int64 `json:"bandwidth" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The date and time that the volume was attached. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPCCollectionNext `json:"next,omitempty"` + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // Information about how the volume is exposed to the instance operating system. + // + // This property may be absent if the volume attachment's `status` is not `attached`. + Device *VolumeAttachmentDevice `json:"device,omitempty"` - // Collection of VPCs. - Vpcs []VPC `json:"vpcs" validate:"required"` + // The URL for this volume attachment. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this volume attachment. + ID *string `json:"id" validate:"required"` + + // The user-defined name for this volume attachment. + Name *string `json:"name" validate:"required"` + + // The status of this volume attachment. + Status *string `json:"status" validate:"required"` + + // The type of volume attachment. + Type *string `json:"type" validate:"required"` + + // The attached volume. + Volume *VolumeReference `json:"volume" validate:"required"` } -// UnmarshalVPCCollection unmarshals an instance of VPCCollection from the specified map of raw messages. -func UnmarshalVPCCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPCCollectionFirst) +// Constants associated with the VolumeAttachment.Status property. +// The status of this volume attachment. +const ( + VolumeAttachmentStatusAttachedConst = "attached" + VolumeAttachmentStatusAttachingConst = "attaching" + VolumeAttachmentStatusDeletingConst = "deleting" + VolumeAttachmentStatusDetachingConst = "detaching" +) + +// Constants associated with the VolumeAttachment.Type property. +// The type of volume attachment. +const ( + VolumeAttachmentTypeBootConst = "boot" + VolumeAttachmentTypeDataConst = "data" +) + +// UnmarshalVolumeAttachment unmarshals an instance of VolumeAttachment from the specified map of raw messages. +func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachment) + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPCCollectionNext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) if err != nil { return } - err = core.UnmarshalModel(m, "vpcs", &obj.Vpcs, UnmarshalVPC) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPCCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } - return start, nil -} - -// VPCCollectionFirst : A link to the first page of resources. -type VPCCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPCCollectionFirst unmarshals an instance of VPCCollectionFirst from the specified map of raw messages. -func UnmarshalVPCCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReference) if err != nil { return } @@ -49386,16 +56486,16 @@ func UnmarshalVPCCollectionFirst(m map[string]json.RawMessage, result interface{ return } -// VPCCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPCCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// VolumeAttachmentCollection : VolumeAttachmentCollection struct +type VolumeAttachmentCollection struct { + // Collection of volume attachments. + VolumeAttachments []VolumeAttachment `json:"volume_attachments" validate:"required"` } -// UnmarshalVPCCollectionNext unmarshals an instance of VPCCollectionNext from the specified map of raw messages. -func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVolumeAttachmentCollection unmarshals an instance of VolumeAttachmentCollection from the specified map of raw messages. +func UnmarshalVolumeAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentCollection) + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachment) if err != nil { return } @@ -49403,58 +56503,40 @@ func UnmarshalVPCCollectionNext(m map[string]json.RawMessage, result interface{} return } -// VPCIdentity : Identifies a VPC by a unique property. -// Models which "extend" this model: -// - VPCIdentityByID -// - VPCIdentityByCRN -// - VPCIdentityByHref -type VPCIdentity struct { - // The unique identifier for this VPC. +// VolumeAttachmentDevice : VolumeAttachmentDevice struct +type VolumeAttachmentDevice struct { + // A unique identifier for the device which is exposed to the instance operating system. ID *string `json:"id,omitempty"` - - // The CRN for this VPC. - CRN *string `json:"crn,omitempty"` - - // The URL for this VPC. - Href *string `json:"href,omitempty"` -} - -func (*VPCIdentity) isaVPCIdentity() bool { - return true } -type VPCIdentityIntf interface { - isaVPCIdentity() bool -} - -// UnmarshalVPCIdentity unmarshals an instance of VPCIdentity from the specified map of raw messages. -func UnmarshalVPCIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCIdentity) +// UnmarshalVolumeAttachmentDevice unmarshals an instance of VolumeAttachmentDevice from the specified map of raw messages. +func UnmarshalVolumeAttachmentDevice(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentDevice) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VPCPatch : VPCPatch struct -type VPCPatch struct { - // The unique user-defined name for this VPC. +// VolumeAttachmentPatch : VolumeAttachmentPatch struct +type VolumeAttachmentPatch struct { + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + + // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment + // resides in. Name *string `json:"name,omitempty"` } -// UnmarshalVPCPatch unmarshals an instance of VPCPatch from the specified map of raw messages. -func UnmarshalVPCPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCPatch) +// UnmarshalVolumeAttachmentPatch unmarshals an instance of VolumeAttachmentPatch from the specified map of raw messages. +func UnmarshalVolumeAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPatch) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -49463,51 +56545,83 @@ func UnmarshalVPCPatch(m map[string]json.RawMessage, result interface{}) (err er return } -// AsPatch returns a generic map representation of the VPCPatch -func (vpcPatch *VPCPatch) AsPatch() (_patch map[string]interface{}, err error) { +// AsPatch returns a generic map representation of the VolumeAttachmentPatch +func (volumeAttachmentPatch *VolumeAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { var jsonData []byte - jsonData, err = json.Marshal(vpcPatch) + jsonData, err = json.Marshal(volumeAttachmentPatch) if err == nil { err = json.Unmarshal(jsonData, &_patch) } return } -// VPCReference : VPCReference struct -type VPCReference struct { - // The CRN for this VPC. - CRN *string `json:"crn" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *VPCReferenceDeleted `json:"deleted,omitempty"` +// VolumeAttachmentPrototypeInstanceByImageContext : VolumeAttachmentPrototypeInstanceByImageContext struct +type VolumeAttachmentPrototypeInstanceByImageContext struct { + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - // The URL for this VPC. - Href *string `json:"href" validate:"required"` + // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment + // resides in. + Name *string `json:"name,omitempty"` - // The unique identifier for this VPC. - ID *string `json:"id" validate:"required"` + // A prototype object for a new volume. + Volume *VolumePrototypeInstanceByImageContext `json:"volume" validate:"required"` +} - // The unique user-defined name for this VPC. - Name *string `json:"name" validate:"required"` +// NewVolumeAttachmentPrototypeInstanceByImageContext : Instantiate VolumeAttachmentPrototypeInstanceByImageContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByImageContext(volume *VolumePrototypeInstanceByImageContext) (_model *VolumeAttachmentPrototypeInstanceByImageContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceByImageContext{ + Volume: volume, + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalVPCReference unmarshals an instance of VPCReference from the specified map of raw messages. -func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalVolumeAttachmentPrototypeInstanceByImageContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByImageContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPCReferenceDeleted) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceByImageContext) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeAttachmentPrototypeInstanceByVolumeContext : VolumeAttachmentPrototypeInstanceByVolumeContext struct +type VolumeAttachmentPrototypeInstanceByVolumeContext struct { + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + + // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment + // resides in. + Name *string `json:"name,omitempty"` + + // An existing volume to attach to the instance, or a prototype object for a new volume. + Volume VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf `json:"volume" validate:"required"` +} + +// NewVolumeAttachmentPrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentPrototypeInstanceByVolumeContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf) (_model *VolumeAttachmentPrototypeInstanceByVolumeContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceByVolumeContext{ + Volume: volume, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByVolumeContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceByVolumeContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) if err != nil { return } @@ -49515,21 +56629,48 @@ func UnmarshalVPCReference(m map[string]json.RawMessage, result interface{}) (er if err != nil { return } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VPCReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type VPCReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// VolumeAttachmentPrototypeInstanceContext : VolumeAttachmentPrototypeInstanceContext struct +type VolumeAttachmentPrototypeInstanceContext struct { + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + + // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment + // resides in. + Name *string `json:"name,omitempty"` + + // An existing volume to attach to the instance, or a prototype object for a new volume. + Volume VolumeAttachmentVolumePrototypeInstanceContextIntf `json:"volume" validate:"required"` } -// UnmarshalVPCReferenceDeleted unmarshals an instance of VPCReferenceDeleted from the specified map of raw messages. -func UnmarshalVPCReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPCReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// NewVolumeAttachmentPrototypeInstanceContext : Instantiate VolumeAttachmentPrototypeInstanceContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceContext(volume VolumeAttachmentVolumePrototypeInstanceContextIntf) (_model *VolumeAttachmentPrototypeInstanceContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceContext{ + Volume: volume, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalVolumeAttachmentPrototypeInstanceContext unmarshals an instance of VolumeAttachmentPrototypeInstanceContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentVolumePrototypeInstanceContext) if err != nil { return } @@ -49537,84 +56678,55 @@ func UnmarshalVPCReferenceDeleted(m map[string]json.RawMessage, result interface return } -// VPNGateway : VPNGateway struct +// VolumeAttachmentPrototypeVolume : An existing volume to attach to the instance, or a prototype object for a new volume. // Models which "extend" this model: -// - VPNGatewayRouteMode -// - VPNGatewayPolicyMode -type VPNGateway struct { - // Connections for this VPN gateway. - Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` - - // The date and time that this VPN gateway was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The VPN gateway's CRN. - CRN *string `json:"crn" validate:"required"` - - // The VPN gateway's canonical URL. - Href *string `json:"href" validate:"required"` +// - VolumeAttachmentPrototypeVolumeVolumeIdentity +// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext +type VolumeAttachmentPrototypeVolume struct { + // The unique identifier for this volume. + ID *string `json:"id,omitempty"` - // The unique identifier for this VPN gateway. - ID *string `json:"id" validate:"required"` + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` - // Collection of VPN gateway members. - Members []VPNGatewayMember `json:"members" validate:"required"` + // The URL for this volume. + Href *string `json:"href,omitempty"` - // The user-defined name for this VPN gateway. - Name *string `json:"name" validate:"required"` + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + // The unique user-defined name for this volume. + Name *string `json:"name,omitempty"` - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` + // The profile to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` - // The status of the VPN gateway. - Status *string `json:"status" validate:"required"` + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` - Subnet *SubnetReference `json:"subnet" validate:"required"` + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` } -// Constants associated with the VPNGateway.ResourceType property. -// The resource type. -const ( - VPNGatewayResourceTypeVPNGatewayConst = "vpn_gateway" -) - -// Constants associated with the VPNGateway.Status property. -// The status of the VPN gateway. -const ( - VPNGatewayStatusAvailableConst = "available" - VPNGatewayStatusDeletingConst = "deleting" - VPNGatewayStatusFailedConst = "failed" - VPNGatewayStatusPendingConst = "pending" -) - -// Constants associated with the VPNGateway.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayModeRouteConst = "route" -) - -func (*VPNGateway) isaVPNGateway() bool { +func (*VolumeAttachmentPrototypeVolume) isaVolumeAttachmentPrototypeVolume() bool { return true } -type VPNGatewayIntf interface { - isaVPNGateway() bool +type VolumeAttachmentPrototypeVolumeIntf interface { + isaVolumeAttachmentPrototypeVolume() bool } -// UnmarshalVPNGateway unmarshals an instance of VPNGateway from the specified map of raw messages. -func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGateway) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) +// UnmarshalVolumeAttachmentPrototypeVolume unmarshals an instance of VolumeAttachmentPrototypeVolume from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeVolume) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } @@ -49626,11 +56738,7 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } @@ -49638,23 +56746,19 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) if err != nil { return } @@ -49662,74 +56766,54 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err return } -// VPNGatewayCollection : VPNGatewayCollection struct -type VPNGatewayCollection struct { - // A link to the first page of resources. - First *VPNGatewayCollectionFirst `json:"first" validate:"required"` +// VolumeAttachmentReferenceInstanceContext : VolumeAttachmentReferenceInstanceContext struct +type VolumeAttachmentReferenceInstanceContext struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *VolumeAttachmentReferenceInstanceContextDeleted `json:"deleted,omitempty"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // Information about how the volume is exposed to the instance operating system. + // + // This property may be absent if the volume attachment's `status` is not `attached`. + Device *VolumeAttachmentDevice `json:"device,omitempty"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VPNGatewayCollectionNext `json:"next,omitempty"` + // The URL for this volume attachment. + Href *string `json:"href" validate:"required"` - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` + // The unique identifier for this volume attachment. + ID *string `json:"id" validate:"required"` - // Collection of VPN gateways. - VPNGateways []VPNGatewayIntf `json:"vpn_gateways" validate:"required"` + // The user-defined name for this volume attachment. + Name *string `json:"name" validate:"required"` + + // The attached volume. + Volume *VolumeReference `json:"volume" validate:"required"` } -// UnmarshalVPNGatewayCollection unmarshals an instance of VPNGatewayCollection from the specified map of raw messages. -func UnmarshalVPNGatewayCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVPNGatewayCollectionFirst) +// UnmarshalVolumeAttachmentReferenceInstanceContext unmarshals an instance of VolumeAttachmentReferenceInstanceContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceInstanceContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceInstanceContextDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVPNGatewayCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "vpn_gateways", &obj.VPNGateways, UnmarshalVPNGateway) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VPNGatewayCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// VPNGatewayCollectionFirst : A link to the first page of resources. -type VPNGatewayCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVPNGatewayCollectionFirst unmarshals an instance of VPNGatewayCollectionFirst from the specified map of raw messages. -func UnmarshalVPNGatewayCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReference) if err != nil { return } @@ -49737,16 +56821,17 @@ func UnmarshalVPNGatewayCollectionFirst(m map[string]json.RawMessage, result int return } -// VPNGatewayCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VPNGatewayCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// VolumeAttachmentReferenceInstanceContextDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type VolumeAttachmentReferenceInstanceContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalVPNGatewayCollectionNext unmarshals an instance of VPNGatewayCollectionNext from the specified map of raw messages. -func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalVolumeAttachmentReferenceInstanceContextDeleted unmarshals an instance of VolumeAttachmentReferenceInstanceContextDeleted from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceInstanceContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -49754,124 +56839,55 @@ func UnmarshalVPNGatewayCollectionNext(m map[string]json.RawMessage, result inte return } -// VPNGatewayConnection : VPNGatewayConnection struct -// Models which "extend" this model: -// - VPNGatewayConnectionStaticRouteMode -// - VPNGatewayConnectionPolicyMode -type VPNGatewayConnection struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up" validate:"required"` - - // The authentication mode. Only `psk` is currently supported. - AuthenticationMode *string `json:"authentication_mode" validate:"required"` +// VolumeAttachmentReferenceVolumeContext : VolumeAttachmentReferenceVolumeContext struct +type VolumeAttachmentReferenceVolumeContext struct { + // If set to true, when deleting the instance the volume will also be deleted. + DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` - // The date and time that this VPN gateway connection was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *VolumeAttachmentReferenceVolumeContextDeleted `json:"deleted,omitempty"` - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` + // Information about how the volume is exposed to the instance operating system. + // + // This property may be absent if the volume attachment's `status` is not `attached`. + Device *VolumeAttachmentDevice `json:"device,omitempty"` - // The VPN connection's canonical URL. + // The URL for this volume attachment. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPN gateway connection. + // The unique identifier for this volume attachment. ID *string `json:"id" validate:"required"` - // The IKE policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` - - // The IPsec policy. If absent, [auto-negotiation is - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` - - // The mode of the VPN gateway. - Mode *string `json:"mode" validate:"required"` + // The attached instance. + Instance *InstanceReference `json:"instance" validate:"required"` - // The user-defined name for this VPN gateway connection. + // The user-defined name for this volume attachment. Name *string `json:"name" validate:"required"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The preshared key. - Psk *string `json:"psk" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` - - // The status of a VPN gateway connection. - Status *string `json:"status" validate:"required"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` - - // The VPN tunnel configuration for this VPN gateway connection (in static route mode). - Tunnels []VPNGatewayConnectionStaticRouteModeTunnel `json:"tunnels,omitempty"` - - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` - - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` + // The type of volume attachment. + Type *string `json:"type" validate:"required"` } -// Constants associated with the VPNGatewayConnection.AuthenticationMode property. -// The authentication mode. Only `psk` is currently supported. -const ( - VPNGatewayConnectionAuthenticationModePskConst = "psk" -) - -// Constants associated with the VPNGatewayConnection.Mode property. -// The mode of the VPN gateway. -const ( - VPNGatewayConnectionModePolicyConst = "policy" - VPNGatewayConnectionModeRouteConst = "route" -) - -// Constants associated with the VPNGatewayConnection.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -// Constants associated with the VPNGatewayConnection.Status property. -// The status of a VPN gateway connection. -const ( - VPNGatewayConnectionStatusDownConst = "down" - VPNGatewayConnectionStatusUpConst = "up" -) - -// Constants associated with the VPNGatewayConnection.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. +// Constants associated with the VolumeAttachmentReferenceVolumeContext.Type property. +// The type of volume attachment. const ( - VPNGatewayConnectionRoutingProtocolNoneConst = "none" + VolumeAttachmentReferenceVolumeContextTypeBootConst = "boot" + VolumeAttachmentReferenceVolumeContextTypeDataConst = "data" ) -func (*VPNGatewayConnection) isaVPNGatewayConnection() bool { - return true -} - -type VPNGatewayConnectionIntf interface { - isaVPNGatewayConnection() bool -} - -// UnmarshalVPNGatewayConnection unmarshals an instance of VPNGatewayConnection from the specified map of raw messages. -func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnection) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) +// UnmarshalVolumeAttachmentReferenceVolumeContext unmarshals an instance of VolumeAttachmentReferenceVolumeContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceVolumeContext) + err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceVolumeContextDeleted) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) + err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) if err != nil { return } @@ -49883,15 +56899,7 @@ func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) if err != nil { return } @@ -49899,35 +56907,93 @@ func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interfac if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeAttachmentReferenceVolumeContextDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// information. +type VolumeAttachmentReferenceVolumeContextDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalVolumeAttachmentReferenceVolumeContextDeleted unmarshals an instance of VolumeAttachmentReferenceVolumeContextDeleted from the specified map of raw messages. +func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentReferenceVolumeContextDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeAttachmentVolumePrototypeInstanceByVolumeContext : An existing volume to attach to the instance, or a prototype object for a new volume. +// Models which "extend" this model: +// - VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext +type VolumeAttachmentVolumePrototypeInstanceByVolumeContext struct { + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. + // + // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. + Capacity *int64 `json:"capacity,omitempty"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the snapshot's `encryption_key` will be used. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` + + // The unique user-defined name for this volume. + Name *string `json:"name,omitempty"` + + // The profile to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` + + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` +} + +func (*VolumeAttachmentVolumePrototypeInstanceByVolumeContext) isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool { + return true +} + +type VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf interface { + isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool +} + +// UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentVolumePrototypeInstanceByVolumeContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentVolumePrototypeInstanceByVolumeContext) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionStaticRouteModeTunnel) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) if err != nil { return } @@ -49935,56 +57001,87 @@ func UnmarshalVPNGatewayConnection(m map[string]json.RawMessage, result interfac return } -// VPNGatewayConnectionCollection : Collection of VPN gateway connections in a VPN gateway. -type VPNGatewayConnectionCollection struct { - // Array of VPN gateway connections. - Connections []VPNGatewayConnectionIntf `json:"connections" validate:"required"` -} +// VolumeAttachmentVolumePrototypeInstanceContext : An existing volume to attach to the instance, or a prototype object for a new volume. +// Models which "extend" this model: +// - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity +// - VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext +type VolumeAttachmentVolumePrototypeInstanceContext struct { + // The unique identifier for this volume. + ID *string `json:"id,omitempty"` -// UnmarshalVPNGatewayConnectionCollection unmarshals an instance of VPNGatewayConnectionCollection from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionCollection) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnection) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` -// VPNGatewayConnectionDpd : The Dead Peer Detection settings. -type VPNGatewayConnectionDpd struct { - // Dead Peer Detection actions. - Action *string `json:"action" validate:"required"` + // The URL for this volume. + Href *string `json:"href,omitempty"` - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval" validate:"required"` + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout" validate:"required"` + // The unique user-defined name for this volume. + Name *string `json:"name,omitempty"` + + // The profile to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` + + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` } -// Constants associated with the VPNGatewayConnectionDpd.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdActionClearConst = "clear" - VPNGatewayConnectionDpdActionHoldConst = "hold" - VPNGatewayConnectionDpdActionNoneConst = "none" - VPNGatewayConnectionDpdActionRestartConst = "restart" -) +func (*VolumeAttachmentVolumePrototypeInstanceContext) isaVolumeAttachmentVolumePrototypeInstanceContext() bool { + return true +} -// UnmarshalVPNGatewayConnectionDpd unmarshals an instance of VPNGatewayConnectionDpd from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpd(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpd) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +type VolumeAttachmentVolumePrototypeInstanceContextIntf interface { + isaVolumeAttachmentVolumePrototypeInstanceContext() bool +} + +// UnmarshalVolumeAttachmentVolumePrototypeInstanceContext unmarshals an instance of VolumeAttachmentVolumePrototypeInstanceContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentVolumePrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentVolumePrototypeInstanceContext) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) if err != nil { return } @@ -49992,39 +57089,38 @@ func UnmarshalVPNGatewayConnectionDpd(m map[string]json.RawMessage, result inter return } -// VPNGatewayConnectionDpdPatch : The Dead Peer Detection settings. -type VPNGatewayConnectionDpdPatch struct { - // Dead Peer Detection actions. - Action *string `json:"action,omitempty"` +// VolumeCollection : VolumeCollection struct +type VolumeCollection struct { + // A link to the first page of resources. + First *VolumeCollectionFirst `json:"first" validate:"required"` - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval,omitempty"` + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout,omitempty"` -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VolumeCollectionNext `json:"next,omitempty"` -// Constants associated with the VPNGatewayConnectionDpdPatch.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdPatchActionClearConst = "clear" - VPNGatewayConnectionDpdPatchActionHoldConst = "hold" - VPNGatewayConnectionDpdPatchActionNoneConst = "none" - VPNGatewayConnectionDpdPatchActionRestartConst = "restart" -) + // Collection of volumes. + Volumes []Volume `json:"volumes" validate:"required"` +} -// UnmarshalVPNGatewayConnectionDpdPatch unmarshals an instance of VPNGatewayConnectionDpdPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpdPatch) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) +// UnmarshalVolumeCollection unmarshals an instance of VolumeCollection from the specified map of raw messages. +func UnmarshalVolumeCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "volumes", &obj.Volumes, UnmarshalVolume) if err != nil { return } @@ -50032,39 +57128,45 @@ func UnmarshalVPNGatewayConnectionDpdPatch(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionDpdPrototype : The Dead Peer Detection settings. -type VPNGatewayConnectionDpdPrototype struct { - // Dead Peer Detection actions. - Action *string `json:"action,omitempty"` - - // Dead Peer Detection interval in seconds. - Interval *int64 `json:"interval,omitempty"` - - // Dead Peer Detection timeout in seconds. Must be at least the interval. - Timeout *int64 `json:"timeout,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VolumeCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// Constants associated with the VPNGatewayConnectionDpdPrototype.Action property. -// Dead Peer Detection actions. -const ( - VPNGatewayConnectionDpdPrototypeActionClearConst = "clear" - VPNGatewayConnectionDpdPrototypeActionHoldConst = "hold" - VPNGatewayConnectionDpdPrototypeActionNoneConst = "none" - VPNGatewayConnectionDpdPrototypeActionRestartConst = "restart" -) +// VolumeCollectionFirst : A link to the first page of resources. +type VolumeCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} -// UnmarshalVPNGatewayConnectionDpdPrototype unmarshals an instance of VPNGatewayConnectionDpdPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionDpdPrototype) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "interval", &obj.Interval) +// UnmarshalVolumeCollectionFirst unmarshals an instance of VolumeCollectionFirst from the specified map of raw messages. +func UnmarshalVolumeCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "timeout", &obj.Timeout) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VolumeCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalVolumeCollectionNext unmarshals an instance of VolumeCollectionNext from the specified map of raw messages. +func UnmarshalVolumeCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -50072,34 +57174,41 @@ func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, res return } -// VPNGatewayConnectionIkePolicyPatch : The IKE policy to use. Specify `null` to remove any existing policy, [resulting in -// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). +// VolumeIdentity : Identifies a volume by a unique property. // Models which "extend" this model: -// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByID -// - VPNGatewayConnectionIkePolicyPatchIkePolicyIdentityByHref -type VPNGatewayConnectionIkePolicyPatch struct { - // The unique identifier for this IKE policy. +// - VolumeIdentityByID +// - VolumeIdentityByCRN +// - VolumeIdentityByHref +type VolumeIdentity struct { + // The unique identifier for this volume. ID *string `json:"id,omitempty"` - // The IKE policy's canonical URL. + // The CRN for this volume. + CRN *string `json:"crn,omitempty"` + + // The URL for this volume. Href *string `json:"href,omitempty"` } -func (*VPNGatewayConnectionIkePolicyPatch) isaVPNGatewayConnectionIkePolicyPatch() bool { +func (*VolumeIdentity) isaVolumeIdentity() bool { return true } -type VPNGatewayConnectionIkePolicyPatchIntf interface { - isaVPNGatewayConnectionIkePolicyPatch() bool +type VolumeIdentityIntf interface { + isaVolumeIdentity() bool } -// UnmarshalVPNGatewayConnectionIkePolicyPatch unmarshals an instance of VPNGatewayConnectionIkePolicyPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPatch) +// UnmarshalVolumeIdentity unmarshals an instance of VolumeIdentity from the specified map of raw messages. +func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -50108,35 +57217,44 @@ func UnmarshalVPNGatewayConnectionIkePolicyPatch(m map[string]json.RawMessage, r return } -// VPNGatewayConnectionIkePolicyPrototype : The IKE policy to use. If unspecified, [auto-negotiation will be -// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). -// Models which "extend" this model: -// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByID -// - VPNGatewayConnectionIkePolicyPrototypeIkePolicyIdentityByHref -type VPNGatewayConnectionIkePolicyPrototype struct { - // The unique identifier for this IKE policy. - ID *string `json:"id,omitempty"` +// VolumePatch : VolumePatch struct +type VolumePatch struct { + // The capacity to use for the volume (in gigabytes). The volume must be attached to a running virtual server instance, + // and the specified value must not be less than the current capacity. Additionally, if the volume is attached as a + // boot volume, the maximum value is 250 gigabytes. + // + // The minimum and maximum capacity limits for creating or updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` - // The IKE policy's canonical URL. - Href *string `json:"href,omitempty"` -} + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. + Iops *int64 `json:"iops,omitempty"` -func (*VPNGatewayConnectionIkePolicyPrototype) isaVPNGatewayConnectionIkePolicyPrototype() bool { - return true -} + // The unique user-defined name for this volume. + Name *string `json:"name,omitempty"` -type VPNGatewayConnectionIkePolicyPrototypeIntf interface { - isaVPNGatewayConnectionIkePolicyPrototype() bool + // The profile to use for this volume. The requested profile must be in the same + // `family` as the current profile. The volume must be attached as a data volume to a + // running virtual server instance. + Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` } -// UnmarshalVPNGatewayConnectionIkePolicyPrototype unmarshals an instance of VPNGatewayConnectionIkePolicyPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIkePolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIkePolicyPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVolumePatch unmarshals an instance of VolumePatch from the specified map of raw messages. +func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePatch) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } @@ -50144,31 +57262,47 @@ func UnmarshalVPNGatewayConnectionIkePolicyPrototype(m map[string]json.RawMessag return } -// VPNGatewayConnectionIPsecPolicyPatch : The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in -// auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). -// Models which "extend" this model: -// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByID -// - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref -type VPNGatewayConnectionIPsecPolicyPatch struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id,omitempty"` - - // The IPsec policy's canonical URL. - Href *string `json:"href,omitempty"` +// AsPatch returns a generic map representation of the VolumePatch +func (volumePatch *VolumePatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(volumePatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return } -func (*VPNGatewayConnectionIPsecPolicyPatch) isaVPNGatewayConnectionIPsecPolicyPatch() bool { - return true -} +// VolumeProfile : VolumeProfile struct +type VolumeProfile struct { + // The product family this volume profile belongs to. + // + // The enumerated values for this property will expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the + // unexpected property value was encountered. + Family *string `json:"family" validate:"required"` -type VPNGatewayConnectionIPsecPolicyPatchIntf interface { - isaVPNGatewayConnectionIPsecPolicyPatch() bool + // The URL for this volume profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this volume profile. + Name *string `json:"name" validate:"required"` } -// UnmarshalVPNGatewayConnectionIPsecPolicyPatch unmarshals an instance of VPNGatewayConnectionIPsecPolicyPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPatch) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// Constants associated with the VolumeProfile.Family property. +// The product family this volume profile belongs to. +// +// The enumerated values for this property will expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the +// unexpected property value was encountered. +const ( + VolumeProfileFamilyCustomConst = "custom" + VolumeProfileFamilyTieredConst = "tiered" +) + +// UnmarshalVolumeProfile unmarshals an instance of VolumeProfile from the specified map of raw messages. +func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfile) + err = core.UnmarshalPrimitive(m, "family", &obj.Family) if err != nil { return } @@ -50176,39 +57310,53 @@ func UnmarshalVPNGatewayConnectionIPsecPolicyPatch(m map[string]json.RawMessage, if err != nil { return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VPNGatewayConnectionIPsecPolicyPrototype : The IPsec policy to use. If unspecified, [auto-negotiation will be -// used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). -// Models which "extend" this model: -// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID -// - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref -type VPNGatewayConnectionIPsecPolicyPrototype struct { - // The unique identifier for this IPsec policy. - ID *string `json:"id,omitempty"` +// VolumeProfileCollection : VolumeProfileCollection struct +type VolumeProfileCollection struct { + // A link to the first page of resources. + First *VolumeProfileCollectionFirst `json:"first" validate:"required"` - // The IPsec policy's canonical URL. - Href *string `json:"href,omitempty"` -} + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` -func (*VPNGatewayConnectionIPsecPolicyPrototype) isaVPNGatewayConnectionIPsecPolicyPrototype() bool { - return true -} + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *VolumeProfileCollectionNext `json:"next,omitempty"` -type VPNGatewayConnectionIPsecPolicyPrototypeIntf interface { - isaVPNGatewayConnectionIPsecPolicyPrototype() bool + // Collection of volume profiles. + Profiles []VolumeProfile `json:"profiles" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } -// UnmarshalVPNGatewayConnectionIPsecPolicyPrototype unmarshals an instance of VPNGatewayConnectionIPsecPolicyPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionIPsecPolicyPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalVolumeProfileCollection unmarshals an instance of VolumeProfileCollection from the specified map of raw messages. +func UnmarshalVolumeProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeProfileCollectionFirst) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeProfileCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalVolumeProfile) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } @@ -50216,16 +57364,28 @@ func UnmarshalVPNGatewayConnectionIPsecPolicyPrototype(m map[string]json.RawMess return } -// VPNGatewayConnectionLocalCIDRs : VPNGatewayConnectionLocalCIDRs struct -type VPNGatewayConnectionLocalCIDRs struct { - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VolumeProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil } -// UnmarshalVPNGatewayConnectionLocalCIDRs unmarshals an instance of VPNGatewayConnectionLocalCIDRs from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionLocalCIDRs) - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) +// VolumeProfileCollectionFirst : A link to the first page of resources. +type VolumeProfileCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalVolumeProfileCollectionFirst unmarshals an instance of VolumeProfileCollectionFirst from the specified map of raw messages. +func UnmarshalVolumeProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -50233,83 +57393,51 @@ func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, resul return } -// VPNGatewayConnectionPatch : VPNGatewayConnectionPatch struct -// Models which "extend" this model: -// - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch -type VPNGatewayConnectionPatch struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` - - // The IKE policy to use. Specify `null` to remove any existing policy, [resulting in - // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` +// VolumeProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type VolumeProfileCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} - // The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in - // auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` +// UnmarshalVolumeProfileCollectionNext unmarshals an instance of VolumeProfileCollectionNext from the specified map of raw messages. +func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The user-defined name for this VPN gateway connection. +// VolumeProfileIdentity : Identifies a volume profile by a unique property. +// Models which "extend" this model: +// - VolumeProfileIdentityByName +// - VolumeProfileIdentityByHref +type VolumeProfileIdentity struct { + // The globally unique name for this volume profile. Name *string `json:"name,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address,omitempty"` - - // The preshared key. - Psk *string `json:"psk,omitempty"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` + // The URL for this volume profile. + Href *string `json:"href,omitempty"` } -// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" -) - -func (*VPNGatewayConnectionPatch) isaVPNGatewayConnectionPatch() bool { +func (*VolumeProfileIdentity) isaVolumeProfileIdentity() bool { return true } -type VPNGatewayConnectionPatchIntf interface { - isaVPNGatewayConnectionPatch() bool +type VolumeProfileIdentityIntf interface { + isaVolumeProfileIdentity() bool } -// UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPatch) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) - if err != nil { - return - } +// UnmarshalVolumeProfileIdentity unmarshals an instance of VolumeProfileIdentity from the specified map of raw messages. +func UnmarshalVolumeProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileIdentity) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -50317,26 +57445,23 @@ func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result int return } -// AsPatch returns a generic map representation of the VPNGatewayConnectionPatch -func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayConnectionPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} +// VolumeProfileReference : VolumeProfileReference struct +type VolumeProfileReference struct { + // The URL for this volume profile. + Href *string `json:"href" validate:"required"` -// VPNGatewayConnectionPeerCIDRs : VPNGatewayConnectionPeerCIDRs struct -type VPNGatewayConnectionPeerCIDRs struct { - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` + // The globally unique name for this volume profile. + Name *string `json:"name" validate:"required"` } -// UnmarshalVPNGatewayConnectionPeerCIDRs unmarshals an instance of VPNGatewayConnectionPeerCIDRs from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerCIDRs) - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) +// UnmarshalVolumeProfileReference unmarshals an instance of VolumeProfileReference from the specified map of raw messages. +func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeProfileReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -50344,98 +57469,134 @@ func UnmarshalVPNGatewayConnectionPeerCIDRs(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct +// VolumePrototype : VolumePrototype struct // Models which "extend" this model: -// - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype -// - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype -type VPNGatewayConnectionPrototype struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - // The Dead Peer Detection settings. - DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` - - // The IKE policy to use. If unspecified, [auto-negotiation will be - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` - - // The IPsec policy to use. If unspecified, [auto-negotiation will be - // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` +// - VolumePrototypeVolumeByCapacity +type VolumePrototype struct { + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` - // The user-defined name for this VPN gateway connection. + // The unique user-defined name for this volume. Name *string `json:"name,omitempty"` - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address" validate:"required"` - - // The preshared key. - Psk *string `json:"psk" validate:"required"` + // The profile to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The local CIDRs for this resource. - LocalCIDRs []string `json:"local_cidrs,omitempty"` + // The zone this volume will reside in. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` - // The peer CIDRs for this resource. - PeerCIDRs []string `json:"peer_cidrs,omitempty"` -} + // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or + // updating volumes may expand in the future. + Capacity *int64 `json:"capacity,omitempty"` -// Constants associated with the VPNGatewayConnectionPrototype.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPrototypeRoutingProtocolNoneConst = "none" -) + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` +} -func (*VPNGatewayConnectionPrototype) isaVPNGatewayConnectionPrototype() bool { +func (*VolumePrototype) isaVolumePrototype() bool { return true } -type VPNGatewayConnectionPrototypeIntf interface { - isaVPNGatewayConnectionPrototype() bool +type VolumePrototypeIntf interface { + isaVolumePrototype() bool } -// UnmarshalVPNGatewayConnectionPrototype unmarshals an instance of VPNGatewayConnectionPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPrototype) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) +// UnmarshalVolumePrototype unmarshals an instance of VolumePrototype from the specified map of raw messages. +func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototype) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { return } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumePrototypeInstanceByImageContext : VolumePrototypeInstanceByImageContext struct +type VolumePrototypeInstanceByImageContext struct { + // The capacity to use for the volume (in gigabytes). Must be at least the image's + // `minimum_provisioned_size`. The maximum value may increase in the future. + // + // If unspecified, the capacity will be the image's `minimum_provisioned_size`. + Capacity *int64 `json:"capacity,omitempty"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, and the image is encrypted, the image's `encryption_key` will be + // used. Otherwise, the `encryption` type for the volume will be `provider_managed`. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` + + // The unique user-defined name for this volume. + Name *string `json:"name,omitempty"` + + // The profile to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` +} + +// NewVolumePrototypeInstanceByImageContext : Instantiate VolumePrototypeInstanceByImageContext (Generic Model Constructor) +func (*VpcV1) NewVolumePrototypeInstanceByImageContext(profile VolumeProfileIdentityIntf) (_model *VolumePrototypeInstanceByImageContext, err error) { + _model = &VolumePrototypeInstanceByImageContext{ + Profile: profile, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalVolumePrototypeInstanceByImageContext unmarshals an instance of VolumePrototypeInstanceByImageContext from the specified map of raw messages. +func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "local_cidrs", &obj.LocalCIDRs) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "peer_cidrs", &obj.PeerCIDRs) + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) if err != nil { return } @@ -50443,51 +57604,45 @@ func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionReference : VPNGatewayConnectionReference struct -type VPNGatewayConnectionReference struct { +// VolumeReference : VolumeReference struct +type VolumeReference struct { + // The CRN for this volume. + CRN *string `json:"crn" validate:"required"` + // If present, this property indicates the referenced resource has been deleted and provides // some supplementary information. - Deleted *VPNGatewayConnectionReferenceDeleted `json:"deleted,omitempty"` + Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` - // The VPN connection's canonical URL. + // The URL for this volume. Href *string `json:"href" validate:"required"` - // The unique identifier for this VPN gateway connection. + // The unique identifier for this volume. ID *string `json:"id" validate:"required"` - // The user-defined name for this VPN connection. + // The unique user-defined name for this volume. Name *string `json:"name" validate:"required"` - - // The resource type. - ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the VPNGatewayConnectionReference.ResourceType property. -// The resource type. -const ( - VPNGatewayConnectionReferenceResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" -) - -// UnmarshalVPNGatewayConnectionReference unmarshals an instance of VPNGatewayConnectionReference from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionReference) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVPNGatewayConnectionReferenceDeleted) +// UnmarshalVolumeReference unmarshals an instance of VolumeReference from the specified map of raw messages. +func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -50495,16 +57650,16 @@ func UnmarshalVPNGatewayConnectionReference(m map[string]json.RawMessage, result return } -// VPNGatewayConnectionReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary +// VolumeReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary // information. -type VPNGatewayConnectionReferenceDeleted struct { +type VolumeReferenceDeleted struct { // Link to documentation about deleted resources. MoreInfo *string `json:"more_info" validate:"required"` } -// UnmarshalVPNGatewayConnectionReferenceDeleted unmarshals an instance of VPNGatewayConnectionReferenceDeleted from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionReferenceDeleted) +// UnmarshalVolumeReferenceDeleted unmarshals an instance of VolumeReferenceDeleted from the specified map of raw messages. +func UnmarshalVolumeReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeReferenceDeleted) err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return @@ -50513,30 +57668,36 @@ func UnmarshalVPNGatewayConnectionReferenceDeleted(m map[string]json.RawMessage, return } -// VPNGatewayConnectionStaticRouteModeTunnel : VPNGatewayConnectionStaticRouteModeTunnel struct -type VPNGatewayConnectionStaticRouteModeTunnel struct { - // The IP address of the VPN gateway member in which the tunnel resides. - PublicIP *IP `json:"public_ip" validate:"required"` +// VolumeStatusReason : VolumeStatusReason struct +type VolumeStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` - // The status of the VPN Tunnel. - Status *string `json:"status" validate:"required"` + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` } -// Constants associated with the VPNGatewayConnectionStaticRouteModeTunnel.Status property. -// The status of the VPN Tunnel. +// Constants associated with the VolumeStatusReason.Code property. +// A snake case string succinctly identifying the status reason. const ( - VPNGatewayConnectionStaticRouteModeTunnelStatusDownConst = "down" - VPNGatewayConnectionStaticRouteModeTunnelStatusUpConst = "up" + VolumeStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" ) -// UnmarshalVPNGatewayConnectionStaticRouteModeTunnel unmarshals an instance of VPNGatewayConnectionStaticRouteModeTunnel from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionStaticRouteModeTunnel) - err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) +// UnmarshalVolumeStatusReason unmarshals an instance of VolumeStatusReason from the specified map of raw messages. +func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { return } @@ -50544,51 +57705,41 @@ func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMes return } -// VPNGatewayMember : VPNGatewayMember struct -type VPNGatewayMember struct { - // The private IP address assigned to the VPN gateway member. This - // property will be present only when the VPN gateway status is - // `available`. - PrivateIP *IP `json:"private_ip,omitempty"` +// Zone : Zone struct +type Zone struct { + // The URL for this zone. + Href *string `json:"href" validate:"required"` - // The public IP address assigned to the VPN gateway member. - PublicIP *IP `json:"public_ip" validate:"required"` + // The globally unique name for this zone. + Name *string `json:"name" validate:"required"` - // The high availability role assigned to the VPN gateway member. - Role *string `json:"role" validate:"required"` + // The region this zone resides in. + Region *RegionReference `json:"region" validate:"required"` - // The status of the VPN gateway member. + // The availability status of this zone. Status *string `json:"status" validate:"required"` } -// Constants associated with the VPNGatewayMember.Role property. -// The high availability role assigned to the VPN gateway member. -const ( - VPNGatewayMemberRoleActiveConst = "active" - VPNGatewayMemberRoleStandbyConst = "standby" -) - -// Constants associated with the VPNGatewayMember.Status property. -// The status of the VPN gateway member. +// Constants associated with the Zone.Status property. +// The availability status of this zone. const ( - VPNGatewayMemberStatusAvailableConst = "available" - VPNGatewayMemberStatusDeletingConst = "deleting" - VPNGatewayMemberStatusFailedConst = "failed" - VPNGatewayMemberStatusPendingConst = "pending" + ZoneStatusAvailableConst = "available" + ZoneStatusImpairedConst = "impaired" + ZoneStatusUnavailableConst = "unavailable" ) -// UnmarshalVPNGatewayMember unmarshals an instance of VPNGatewayMember from the specified map of raw messages. -func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayMember) - err = core.UnmarshalModel(m, "private_ip", &obj.PrivateIP, UnmarshalIP) +// UnmarshalZone unmarshals an instance of Zone from the specified map of raw messages. +func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Zone) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "role", &obj.Role) + err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) if err != nil { return } @@ -50600,16 +57751,16 @@ func UnmarshalVPNGatewayMember(m map[string]json.RawMessage, result interface{}) return } -// VPNGatewayPatch : VPNGatewayPatch struct -type VPNGatewayPatch struct { - // The user-defined name for this VPN gateway. - Name *string `json:"name,omitempty"` +// ZoneCollection : ZoneCollection struct +type ZoneCollection struct { + // Collection of zones. + Zones []Zone `json:"zones" validate:"required"` } -// UnmarshalVPNGatewayPatch unmarshals an instance of VPNGatewayPatch from the specified map of raw messages. -func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPatch) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalZoneCollection unmarshals an instance of ZoneCollection from the specified map of raw messages. +func UnmarshalZoneCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneCollection) + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZone) if err != nil { return } @@ -50617,65 +57768,58 @@ func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) return } -// AsPatch returns a generic map representation of the VPNGatewayPatch -func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VPNGatewayPrototype : VPNGatewayPrototype struct +// ZoneIdentity : Identifies a zone by a unique property. // Models which "extend" this model: -// - VPNGatewayPrototypeVPNGatewayRouteModePrototype -// - VPNGatewayPrototypeVPNGatewayPolicyModePrototype -type VPNGatewayPrototype struct { - // The user-defined name for this VPN gateway. +// - ZoneIdentityByName +// - ZoneIdentityByHref +type ZoneIdentity struct { + // The globally unique name for this zone. Name *string `json:"name,omitempty"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // Identifies a subnet by a unique property. - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // Route mode VPN gateway. - Mode *string `json:"mode,omitempty"` + // The URL for this zone. + Href *string `json:"href,omitempty"` } -// Constants associated with the VPNGatewayPrototype.Mode property. -// Route mode VPN gateway. -const ( - VPNGatewayPrototypeModeRouteConst = "route" -) - -func (*VPNGatewayPrototype) isaVPNGatewayPrototype() bool { +func (*ZoneIdentity) isaZoneIdentity() bool { return true } -type VPNGatewayPrototypeIntf interface { - isaVPNGatewayPrototype() bool +type ZoneIdentityIntf interface { + isaZoneIdentity() bool } -// UnmarshalVPNGatewayPrototype unmarshals an instance of VPNGatewayPrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototype) +// UnmarshalZoneIdentity unmarshals an instance of ZoneIdentity from the specified map of raw messages. +func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneIdentity) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ZoneReference : ZoneReference struct +type ZoneReference struct { + // The URL for this zone. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this zone. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalZoneReference unmarshals an instance of ZoneReference from the specified map of raw messages. +func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ZoneReference) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } @@ -50683,142 +57827,40 @@ func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface return } -// Volume : Volume struct -type Volume struct { - // Indicates whether a running virtual server instance has an attachment to this volume. - Active *bool `json:"active" validate:"required"` - - // The maximum bandwidth (in megabits per second) for the volume. - Bandwidth *int64 `json:"bandwidth" validate:"required"` - - // Indicates whether this volume is performing an operation that must be serialized. This must be `false` to perform an - // operation that is specified to require serialization. - Busy *bool `json:"busy" validate:"required"` - - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity" validate:"required"` - - // The date and time that the volume was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` - - // The type of encryption used on the volume. - Encryption *string `json:"encryption" validate:"required"` - - // The root key used to wrap the data encryption key for the volume. - // - // This property will be present for volumes with an `encryption` type of - // `user_managed`. - EncryptionKey *EncryptionKeyReference `json:"encryption_key,omitempty"` +// BareMetalServerBootTargetBareMetalServerDiskReference : BareMetalServerBootTargetBareMetalServerDiskReference struct +// This model "extends" BareMetalServerBootTarget +type BareMetalServerBootTargetBareMetalServerDiskReference struct { + // If present, this property indicates the referenced resource has been deleted and provides + // some supplementary information. + Deleted *BareMetalServerDiskReferenceDeleted `json:"deleted,omitempty"` - // The URL for this volume. + // The URL for this bare metal server disk. Href *string `json:"href" validate:"required"` - // The unique identifier for this volume. + // The unique identifier for this bare metal server disk. ID *string `json:"id" validate:"required"` - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops" validate:"required"` - - // The unique user-defined name for this volume. + // The user-defined name for this disk. Name *string `json:"name" validate:"required"` - // The operating system associated with this volume. If absent, this volume was not - // created from an image, or the image did not include an operating system. - OperatingSystem *OperatingSystemReference `json:"operating_system,omitempty"` - - // The profile this volume uses. - Profile *VolumeProfileReference `json:"profile" validate:"required"` - - // The resource group for this volume. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The image from which this volume was created (this may be - // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - // If absent, this volume was not created from an image. - SourceImage *ImageReference `json:"source_image,omitempty"` - - // The snapshot from which this volume was cloned. - SourceSnapshot *SnapshotReference `json:"source_snapshot,omitempty"` - - // The status of the volume. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected - // property value was encountered. - Status *string `json:"status" validate:"required"` - - // The reasons for the current status (if any). - // - // The enumerated reason code values for this property will expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the - // unexpected reason code was encountered. - StatusReasons []VolumeStatusReason `json:"status_reasons" validate:"required"` - - // The volume attachments for this volume. - VolumeAttachments []VolumeAttachmentReferenceVolumeContext `json:"volume_attachments" validate:"required"` - - // The zone this volume resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } -// Constants associated with the Volume.Encryption property. -// The type of encryption used on the volume. +// Constants associated with the BareMetalServerBootTargetBareMetalServerDiskReference.ResourceType property. +// The resource type. const ( - VolumeEncryptionProviderManagedConst = "provider_managed" - VolumeEncryptionUserManagedConst = "user_managed" + BareMetalServerBootTargetBareMetalServerDiskReferenceResourceTypeBareMetalServerDiskConst = "bare_metal_server_disk" ) -// Constants associated with the Volume.Status property. -// The status of the volume. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the volume on which the unexpected -// property value was encountered. -const ( - VolumeStatusAvailableConst = "available" - VolumeStatusFailedConst = "failed" - VolumeStatusPendingConst = "pending" - VolumeStatusPendingDeletionConst = "pending_deletion" - VolumeStatusUnusableConst = "unusable" -) +func (*BareMetalServerBootTargetBareMetalServerDiskReference) isaBareMetalServerBootTarget() bool { + return true +} -// UnmarshalVolume unmarshals an instance of Volume from the specified map of raw messages. -func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Volume) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "busy", &obj.Busy) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "encryption", &obj.Encryption) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyReference) +// UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference unmarshals an instance of BareMetalServerBootTargetBareMetalServerDiskReference from the specified map of raw messages. +func UnmarshalBareMetalServerBootTargetBareMetalServerDiskReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerBootTargetBareMetalServerDiskReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalBareMetalServerDiskReferenceDeleted) if err != nil { return } @@ -50830,47 +57872,60 @@ func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err erro if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "operating_system", &obj.OperatingSystem, UnmarshalOperatingSystemReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_image", &obj.SourceImage, UnmarshalImageReference) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotReference) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount : BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct +// This model "extends" BareMetalServerInitializationUserAccount +type BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount struct { + // The password at initialization, encrypted using `encryption_key`, and returned base64-encoded. + EncryptedPassword *[]byte `json:"encrypted_password" validate:"required"` + + // The public SSH key used to encrypt the password. + EncryptionKey *KeyReference `json:"encryption_key" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The username for the account created at initialization. + Username *string `json:"username" validate:"required"` +} + +// Constants associated with the BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.ResourceType property. +// The resource type. +const ( + BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccountResourceTypeHostUserAccountConst = "host_user_account" +) + +func (*BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) isaBareMetalServerInitializationUserAccount() bool { + return true +} + +// UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount unmarshals an instance of BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount from the specified map of raw messages. +func UnmarshalBareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount) + err = core.UnmarshalPrimitive(m, "encrypted_password", &obj.EncryptedPassword) if err != nil { return } - err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeStatusReason) + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalKeyReference) if err != nil { return } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentReferenceVolumeContext) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + err = core.UnmarshalPrimitive(m, "username", &obj.Username) if err != nil { return } @@ -50878,62 +57933,130 @@ func UnmarshalVolume(m map[string]json.RawMessage, result interface{}) (err erro return } -// VolumeAttachment : VolumeAttachment struct -type VolumeAttachment struct { - // The maximum bandwidth (in megabits per second) for the volume when attached to this instance. This may be lower than - // the volume bandwidth depending on the configuration of the instance. - Bandwidth *int64 `json:"bandwidth" validate:"required"` +// BareMetalServerNetworkInterfaceByPci : BareMetalServerNetworkInterfaceByPci struct +// This model "extends" BareMetalServerNetworkInterface +type BareMetalServerNetworkInterfaceByPci struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // The date and time that the volume was attached. + // The date and time that the network interface was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. + // + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` + + // The floating IPs associated with this network interface. + FloatingIps []FloatingIPReference `json:"floating_ips,omitempty"` + + // The URL for this network interface. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this network interface. + ID *string `json:"id" validate:"required"` + + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` + + // The MAC address of the interface. If absent, the value is not known. + MacAddress *string `json:"mac_address" validate:"required"` + + // The user-defined name for this network interface. + Name *string `json:"name" validate:"required"` + + // The network interface port speed in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` - // Information about how the volume is exposed to the instance operating system. + // The primary IPv4 address. // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The user-defined name for this volume attachment. - Name *string `json:"name" validate:"required"` + // The security groups targeting this network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - // The status of this volume attachment. + // The status of the network interface. Status *string `json:"status" validate:"required"` - // The type of volume attachment. + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The type of this bare metal server network interface. Type *string `json:"type" validate:"required"` - // The attached volume. - Volume *VolumeReference `json:"volume" validate:"required"` -} + // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in + // the `allowed_vlans` array for one PCI type adapter per bare metal server. + AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` +} + +// Constants associated with the BareMetalServerNetworkInterfaceByPci.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +const ( + BareMetalServerNetworkInterfaceByPciInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfaceByPciInterfaceTypeVlanConst = "vlan" +) -// Constants associated with the VolumeAttachment.Status property. -// The status of this volume attachment. +// Constants associated with the BareMetalServerNetworkInterfaceByPci.ResourceType property. +// The resource type. const ( - VolumeAttachmentStatusAttachedConst = "attached" - VolumeAttachmentStatusAttachingConst = "attaching" - VolumeAttachmentStatusDeletingConst = "deleting" - VolumeAttachmentStatusDetachingConst = "detaching" + BareMetalServerNetworkInterfaceByPciResourceTypeNetworkInterfaceConst = "network_interface" ) -// Constants associated with the VolumeAttachment.Type property. -// The type of volume attachment. +// Constants associated with the BareMetalServerNetworkInterfaceByPci.Status property. +// The status of the network interface. const ( - VolumeAttachmentTypeBootConst = "boot" - VolumeAttachmentTypeDataConst = "data" + BareMetalServerNetworkInterfaceByPciStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceByPciStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceByPciStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceByPciStatusPendingConst = "pending" ) -// UnmarshalVolumeAttachment unmarshals an instance of VolumeAttachment from the specified map of raw messages. -func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachment) - err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) +// Constants associated with the BareMetalServerNetworkInterfaceByPci.Type property. +// The type of this bare metal server network interface. +const ( + BareMetalServerNetworkInterfaceByPciTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceByPciTypeSecondaryConst = "secondary" +) + +func (*BareMetalServerNetworkInterfaceByPci) isaBareMetalServerNetworkInterface() bool { + return true +} + +// UnmarshalBareMetalServerNetworkInterfaceByPci unmarshals an instance of BareMetalServerNetworkInterfaceByPci from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceByPci(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceByPci) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } @@ -50941,11 +58064,11 @@ func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) if err != nil { return } @@ -50957,129 +58080,47 @@ func UnmarshalVolumeAttachment(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReference) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentCollection : VolumeAttachmentCollection struct -type VolumeAttachmentCollection struct { - // Collection of volume attachments. - VolumeAttachments []VolumeAttachment `json:"volume_attachments" validate:"required"` -} - -// UnmarshalVolumeAttachmentCollection unmarshals an instance of VolumeAttachmentCollection from the specified map of raw messages. -func UnmarshalVolumeAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentCollection) - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachment) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentDevice : VolumeAttachmentDevice struct -type VolumeAttachmentDevice struct { - // A unique identifier for the device which is exposed to the instance operating system. - ID *string `json:"id,omitempty"` -} - -// UnmarshalVolumeAttachmentDevice unmarshals an instance of VolumeAttachmentDevice from the specified map of raw messages. -func UnmarshalVolumeAttachmentDevice(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentDevice) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentPatch : VolumeAttachmentPatch struct -type VolumeAttachmentPatch struct { - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment - // resides in. - Name *string `json:"name,omitempty"` -} - -// UnmarshalVolumeAttachmentPatch unmarshals an instance of VolumeAttachmentPatch from the specified map of raw messages. -func UnmarshalVolumeAttachmentPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPatch) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VolumeAttachmentPatch -func (volumeAttachmentPatch *VolumeAttachmentPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(volumeAttachmentPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - -// VolumeAttachmentPrototypeInstanceByImageContext : VolumeAttachmentPrototypeInstanceByImageContext struct -type VolumeAttachmentPrototypeInstanceByImageContext struct { - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` - - // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment - // resides in. - Name *string `json:"name,omitempty"` - - // A prototype object for a new volume. - Volume *VolumePrototypeInstanceByImageContext `json:"volume" validate:"required"` -} - -// NewVolumeAttachmentPrototypeInstanceByImageContext : Instantiate VolumeAttachmentPrototypeInstanceByImageContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByImageContext(volume *VolumePrototypeInstanceByImageContext) (_model *VolumeAttachmentPrototypeInstanceByImageContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByImageContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalVolumeAttachmentPrototypeInstanceByImageContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByImageContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByImageContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceByImageContext) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } @@ -51087,141 +58128,146 @@ func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json. return } -// VolumeAttachmentPrototypeInstanceByVolumeContext : VolumeAttachmentPrototypeInstanceByVolumeContext struct -type VolumeAttachmentPrototypeInstanceByVolumeContext struct { - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` +// BareMetalServerNetworkInterfaceByVlan : BareMetalServerNetworkInterfaceByVlan struct +// This model "extends" BareMetalServerNetworkInterface +type BareMetalServerNetworkInterfaceByVlan struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` - // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment - // resides in. - Name *string `json:"name,omitempty"` + // The date and time that the network interface was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf `json:"volume" validate:"required"` -} + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. + // + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` -// NewVolumeAttachmentPrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentPrototypeInstanceByVolumeContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf) (_model *VolumeAttachmentPrototypeInstanceByVolumeContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByVolumeContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The floating IPs associated with this network interface. + FloatingIps []FloatingIPReference `json:"floating_ips,omitempty"` -// UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByVolumeContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The URL for this network interface. + Href *string `json:"href" validate:"required"` -// VolumeAttachmentPrototypeInstanceContext : VolumeAttachmentPrototypeInstanceContext struct -type VolumeAttachmentPrototypeInstanceContext struct { - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` + // The unique identifier for this network interface. + ID *string `json:"id" validate:"required"` - // The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment - // resides in. - Name *string `json:"name,omitempty"` + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentVolumePrototypeInstanceContextIntf `json:"volume" validate:"required"` -} + // The MAC address of the interface. If absent, the value is not known. + MacAddress *string `json:"mac_address" validate:"required"` -// NewVolumeAttachmentPrototypeInstanceContext : Instantiate VolumeAttachmentPrototypeInstanceContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceContext(volume VolumeAttachmentVolumePrototypeInstanceContextIntf) (_model *VolumeAttachmentPrototypeInstanceContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceContext{ - Volume: volume, - } - err = core.ValidateStruct(_model, "required parameters") - return -} + // The user-defined name for this network interface. + Name *string `json:"name" validate:"required"` -// UnmarshalVolumeAttachmentPrototypeInstanceContext unmarshals an instance of VolumeAttachmentPrototypeInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentVolumePrototypeInstanceContext) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + // The network interface port speed in Mbps. + PortSpeed *int64 `json:"port_speed" validate:"required"` -// VolumeAttachmentPrototypeVolume : An existing volume to attach to the instance, or a prototype object for a new volume. -// Models which "extend" this model: -// - VolumeAttachmentPrototypeVolumeVolumeIdentity -// - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext -type VolumeAttachmentPrototypeVolume struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` + // The primary IPv4 address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + PrimaryIpv4Address *string `json:"primary_ipv4_address" validate:"required"` - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` - // The URL for this volume. - Href *string `json:"href,omitempty"` + // The security groups targeting this network interface. + SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` + // The status of the network interface. + Status *string `json:"status" validate:"required"` - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` + // The associated subnet. + Subnet *SubnetReference `json:"subnet" validate:"required"` - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` + // The type of this bare metal server network interface. + Type *string `json:"type" validate:"required"` - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` + // Indicates if the interface can float to any other server within the same + // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal + // server in the resource group. Applies only to `vlan` type interfaces. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float" validate:"required"` + + // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + Vlan *int64 `json:"vlan" validate:"required"` +} + +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +const ( + BareMetalServerNetworkInterfaceByVlanInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfaceByVlanInterfaceTypeVlanConst = "vlan" +) - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.ResourceType property. +// The resource type. +const ( + BareMetalServerNetworkInterfaceByVlanResourceTypeNetworkInterfaceConst = "network_interface" +) - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Status property. +// The status of the network interface. +const ( + BareMetalServerNetworkInterfaceByVlanStatusAvailableConst = "available" + BareMetalServerNetworkInterfaceByVlanStatusDeletingConst = "deleting" + BareMetalServerNetworkInterfaceByVlanStatusFailedConst = "failed" + BareMetalServerNetworkInterfaceByVlanStatusPendingConst = "pending" +) -func (*VolumeAttachmentPrototypeVolume) isaVolumeAttachmentPrototypeVolume() bool { - return true -} +// Constants associated with the BareMetalServerNetworkInterfaceByVlan.Type property. +// The type of this bare metal server network interface. +const ( + BareMetalServerNetworkInterfaceByVlanTypePrimaryConst = "primary" + BareMetalServerNetworkInterfaceByVlanTypeSecondaryConst = "secondary" +) -type VolumeAttachmentPrototypeVolumeIntf interface { - isaVolumeAttachmentPrototypeVolume() bool +func (*BareMetalServerNetworkInterfaceByVlan) isaBareMetalServerNetworkInterface() bool { + return true } -// UnmarshalVolumeAttachmentPrototypeVolume unmarshals an instance of VolumeAttachmentPrototypeVolume from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeVolume) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalBareMetalServerNetworkInterfaceByVlan unmarshals an instance of BareMetalServerNetworkInterfaceByVlan from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfaceByVlan(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfaceByVlan) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) + if err != nil { + return + } + err = core.UnmarshalModel(m, "floating_ips", &obj.FloatingIps, UnmarshalFloatingIPReference) if err != nil { return } @@ -51229,100 +58275,55 @@ func UnmarshalVolumeAttachmentPrototypeVolume(m map[string]json.RawMessage, resu if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "mac_address", &obj.MacAddress) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "port_speed", &obj.PortSpeed) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceInstanceContext : VolumeAttachmentReferenceInstanceContext struct -type VolumeAttachmentReferenceInstanceContext struct { - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *VolumeAttachmentReferenceInstanceContextDeleted `json:"deleted,omitempty"` - - // Information about how the volume is exposed to the instance operating system. - // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` - - // The user-defined name for this volume attachment. - Name *string `json:"name" validate:"required"` - - // The attached volume. - Volume *VolumeReference `json:"volume" validate:"required"` -} - -// UnmarshalVolumeAttachmentReferenceInstanceContext unmarshals an instance of VolumeAttachmentReferenceInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceInstanceContext) - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceInstanceContextDeleted) + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { return } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeReference) + err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceInstanceContextDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type VolumeAttachmentReferenceInstanceContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeAttachmentReferenceInstanceContextDeleted unmarshals an instance of VolumeAttachmentReferenceInstanceContextDeleted from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceInstanceContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -51330,93 +58331,119 @@ func UnmarshalVolumeAttachmentReferenceInstanceContextDeleted(m map[string]json. return } -// VolumeAttachmentReferenceVolumeContext : VolumeAttachmentReferenceVolumeContext struct -type VolumeAttachmentReferenceVolumeContext struct { - // If set to true, when deleting the instance the volume will also be deleted. - DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete" validate:"required"` - - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *VolumeAttachmentReferenceVolumeContextDeleted `json:"deleted,omitempty"` +// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct +// This model "extends" BareMetalServerNetworkInterfacePrototype +type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // Information about how the volume is exposed to the instance operating system. + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. // - // This property may be absent if the volume attachment's `status` is not `attached`. - Device *VolumeAttachmentDevice `json:"device,omitempty"` - - // The URL for this volume attachment. - Href *string `json:"href" validate:"required"` + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` - // The unique identifier for this volume attachment. - ID *string `json:"id" validate:"required"` + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` - // The attached instance. - Instance *InstanceReference `json:"instance" validate:"required"` + // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If + // unspecified, an available address on the subnet will be automatically selected. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` - // The user-defined name for this volume attachment. - Name *string `json:"name" validate:"required"` + // The security groups to use for this network interface. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` - // The type of volume attachment. - Type *string `json:"type" validate:"required"` -} + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -// Constants associated with the VolumeAttachmentReferenceVolumeContext.Type property. -// The type of volume attachment. + // Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in + // the `allowed_vlans` array for one PCI type adapter per bare metal server. + AllowedVlans []int64 `json:"allowed_vlans,omitempty"` +} + +// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. const ( - VolumeAttachmentReferenceVolumeContextTypeBootConst = "boot" - VolumeAttachmentReferenceVolumeContextTypeDataConst = "data" + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototypeInterfaceTypeVlanConst = "vlan" ) -// UnmarshalVolumeAttachmentReferenceVolumeContext unmarshals an instance of VolumeAttachmentReferenceVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceVolumeContext) - err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) - if err != nil { - return +// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(interfaceType string, subnet SubnetIdentityIntf) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype, err error) { + _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype{ + InterfaceType: core.StringPtr(interfaceType), + Subnet: subnet, } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeAttachmentReferenceVolumeContextDeleted) + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { + return true +} + +// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "device", &obj.Device, UnmarshalVolumeAttachmentDevice) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "instance", &obj.Instance, UnmarshalInstanceReference) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) if err != nil { return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VolumeAttachmentReferenceVolumeContextDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type VolumeAttachmentReferenceVolumeContextDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` -} - -// UnmarshalVolumeAttachmentReferenceVolumeContextDeleted unmarshals an instance of VolumeAttachmentReferenceVolumeContextDeleted from the specified map of raw messages. -func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentReferenceVolumeContextDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + err = core.UnmarshalPrimitive(m, "allowed_vlans", &obj.AllowedVlans) if err != nil { return } @@ -51424,55 +58451,104 @@ func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.Ra return } -// VolumeAttachmentVolumePrototypeInstanceByVolumeContext : An existing volume to attach to the instance, or a prototype object for a new volume. -// Models which "extend" this model: -// - VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext -type VolumeAttachmentVolumePrototypeInstanceByVolumeContext struct { - // The capacity to use for the volume (in gigabytes). The only allowed value is the source snapshot's - // `minimum_capacity`, but the allowed values are expected to expand in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` +// BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct +// This model "extends" BareMetalServerNetworkInterfacePrototype +type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype struct { + // Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this + // interface. If true, source IP spoofing is allowed on this interface. + AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` - // The root key to use to wrap the data encryption key for the volume. + // If `true`: + // - The VPC infrastructure performs any needed NAT operations. + // - A single floating IP can be assigned to the network interface. // - // If unspecified, the snapshot's `encryption_key` will be used. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` + // If `false`: + // - The packet is passed unmodified to/from the network interface, + // allowing the workload to perform any needed NAT operations. + // - Multiple floating IPs can be assigned to the network interface. + // - `allow_ip_spoofing` must be set to `false`. + EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` + + // The network interface type: + // - `pci`: a physical PCI device which can only be created or deleted when the bare metal + // server is stopped + // - Has an `allowed_vlans` property which controls the VLANs that will be permitted + // to use the pci interface + // - Cannot directly use an IEEE 802.1q VLAN tag. + // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array + // of `allowed_vlans`. + // - Must use an IEEE 802.1q tag. + // - Has its own security groups and does not inherit those of the PCI device through + // which traffic flows. + InterfaceType *string `json:"interface_type" validate:"required"` - // The unique user-defined name for this volume. + // The user-defined name for network interface. Names must be unique within the instance the network interface resides + // in. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` + // The primary IPv4 address. If specified, it must be an available address on the network interface's subnet. If + // unspecified, an available address on the subnet will be automatically selected. + PrimaryIpv4Address *string `json:"primary_ipv4_address,omitempty"` - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} + // The security groups to use for this network interface. If unspecified, the VPC's default security group is used. + SecurityGroups []SecurityGroupIdentityIntf `json:"security_groups,omitempty"` -func (*VolumeAttachmentVolumePrototypeInstanceByVolumeContext) isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool { - return true -} + // The associated subnet. + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` -type VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf interface { - isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool + // Indicates if the interface can float to any other server within the same + // `resource_group`. The interface will float automatically if the network detects a GARP or RARP on another bare metal + // server in the resource group. Applies only to `vlan` type interfaces. + AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` + + // Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. + Vlan *int64 `json:"vlan" validate:"required"` +} + +// Constants associated with the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype.InterfaceType property. +// The network interface type: +// - `pci`: a physical PCI device which can only be created or deleted when the bare metal +// server is stopped +// - Has an `allowed_vlans` property which controls the VLANs that will be permitted +// to use the pci interface +// - Cannot directly use an IEEE 802.1q VLAN tag. +// - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array +// of `allowed_vlans`. +// - Must use an IEEE 802.1q tag. +// - Has its own security groups and does not inherit those of the PCI device through +// which traffic flows. +const ( + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeInterfaceTypePciConst = "pci" + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototypeInterfaceTypeVlanConst = "vlan" +) + +// NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype : Instantiate BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(interfaceType string, subnet SubnetIdentityIntf, vlan int64) (_model *BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype, err error) { + _model = &BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype{ + InterfaceType: core.StringPtr(interfaceType), + Subnet: subnet, + Vlan: core.Int64Ptr(vlan), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentVolumePrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentVolumePrototypeInstanceByVolumeContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) +func (*BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) isaBareMetalServerNetworkInterfacePrototype() bool { + return true +} + +// UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype unmarshals an instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype from the specified map of raw messages. +func UnmarshalBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVlanPrototype) + err = core.UnmarshalPrimitive(m, "allow_ip_spoofing", &obj.AllowIPSpoofing) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "enable_infrastructure_nat", &obj.EnableInfrastructureNat) if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + err = core.UnmarshalPrimitive(m, "interface_type", &obj.InterfaceType) if err != nil { return } @@ -51480,11 +58556,23 @@ func UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext(m map[strin if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "primary_ipv4_address", &obj.PrimaryIpv4Address) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalModel(m, "security_groups", &obj.SecurityGroups, UnmarshalSecurityGroupIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "allow_interface_to_float", &obj.AllowInterfaceToFloat) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "vlan", &obj.Vlan) if err != nil { return } @@ -51492,87 +58580,107 @@ func UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext(m map[strin return } -// VolumeAttachmentVolumePrototypeInstanceContext : An existing volume to attach to the instance, or a prototype object for a new volume. -// Models which "extend" this model: -// - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity -// - VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext -type VolumeAttachmentVolumePrototypeInstanceContext struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` - - // The URL for this volume. - Href *string `json:"href,omitempty"` +// BareMetalServerProfileBandwidthDependent : The total bandwidth shared across the network interfaces of a bare metal server with this profile depends on its +// configuration. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` +// Constants associated with the BareMetalServerProfileBandwidthDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthDependentTypeDependentConst = "dependent" +) - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` +func (*BareMetalServerProfileBandwidthDependent) isaBareMetalServerProfileBandwidth() bool { + return true +} - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` +// UnmarshalBareMetalServerProfileBandwidthDependent unmarshals an instance of BareMetalServerProfileBandwidthDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` +// BareMetalServerProfileBandwidthEnum : The permitted total bandwidth values (in megabits per second) shared across the network interfaces of a bare metal +// server with this profile. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -func (*VolumeAttachmentVolumePrototypeInstanceContext) isaVolumeAttachmentVolumePrototypeInstanceContext() bool { - return true -} +// Constants associated with the BareMetalServerProfileBandwidthEnum.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthEnumTypeEnumConst = "enum" +) -type VolumeAttachmentVolumePrototypeInstanceContextIntf interface { - isaVolumeAttachmentVolumePrototypeInstanceContext() bool +func (*BareMetalServerProfileBandwidthEnum) isaBareMetalServerProfileBandwidth() bool { + return true } -// UnmarshalVolumeAttachmentVolumePrototypeInstanceContext unmarshals an instance of VolumeAttachmentVolumePrototypeInstanceContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentVolumePrototypeInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentVolumePrototypeInstanceContext) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBareMetalServerProfileBandwidthEnum unmarshals an instance of BareMetalServerProfileBandwidthEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileBandwidthFixed : The total bandwidth (in megabits per second) shared across the network interfaces of a bare metal server with this +// profile. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileBandwidthFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileBandwidthFixed) isaBareMetalServerProfileBandwidth() bool { + return true +} + +// UnmarshalBareMetalServerProfileBandwidthFixed unmarshals an instance of BareMetalServerProfileBandwidthFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -51580,38 +58688,56 @@ func UnmarshalVolumeAttachmentVolumePrototypeInstanceContext(m map[string]json.R return } -// VolumeCollection : VolumeCollection struct -type VolumeCollection struct { - // A link to the first page of resources. - First *VolumeCollectionFirst `json:"first" validate:"required"` +// BareMetalServerProfileBandwidthRange : The permitted total bandwidth range (in megabits per second) shared across the network interfaces of a bare metal +// server with this profile. +// This model "extends" BareMetalServerProfileBandwidth +type BareMetalServerProfileBandwidthRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VolumeCollectionNext `json:"next,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // Collection of volumes. - Volumes []Volume `json:"volumes" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVolumeCollection unmarshals an instance of VolumeCollection from the specified map of raw messages. -func UnmarshalVolumeCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeCollectionFirst) +// Constants associated with the BareMetalServerProfileBandwidthRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileBandwidthRangeTypeRangeConst = "range" +) + +func (*BareMetalServerProfileBandwidthRange) isaBareMetalServerProfileBandwidth() bool { + return true +} + +// UnmarshalBareMetalServerProfileBandwidthRange unmarshals an instance of BareMetalServerProfileBandwidthRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileBandwidthRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeCollectionNext) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "volumes", &obj.Volumes, UnmarshalVolume) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -51619,28 +58745,27 @@ func UnmarshalVolumeCollection(m map[string]json.RawMessage, result interface{}) return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil +// BareMetalServerProfileCpuCoreCountDependent : The CPU core count for a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// VolumeCollectionFirst : A link to the first page of resources. -type VolumeCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// Constants associated with the BareMetalServerProfileCpuCoreCountDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuCoreCountDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileCpuCoreCountDependent) isaBareMetalServerProfileCpuCoreCount() bool { + return true } -// UnmarshalVolumeCollectionFirst unmarshals an instance of VolumeCollectionFirst from the specified map of raw messages. -func UnmarshalVolumeCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// UnmarshalBareMetalServerProfileCpuCoreCountDependent unmarshals an instance of BareMetalServerProfileCpuCoreCountDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -51648,16 +58773,41 @@ func UnmarshalVolumeCollectionFirst(m map[string]json.RawMessage, result interfa return } -// VolumeCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VolumeCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// BareMetalServerProfileCpuCoreCountEnum : The permitted values for CPU cores for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// UnmarshalVolumeCollectionNext unmarshals an instance of VolumeCollectionNext from the specified map of raw messages. -func UnmarshalVolumeCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the BareMetalServerProfileCpuCoreCountEnum.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuCoreCountEnumTypeEnumConst = "enum" +) + +func (*BareMetalServerProfileCpuCoreCountEnum) isaBareMetalServerProfileCpuCoreCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuCoreCountEnum unmarshals an instance of BareMetalServerProfileCpuCoreCountEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -51665,42 +58815,34 @@ func UnmarshalVolumeCollectionNext(m map[string]json.RawMessage, result interfac return } -// VolumeIdentity : Identifies a volume by a unique property. -// Models which "extend" this model: -// - VolumeIdentityByID -// - VolumeIdentityByCRN -// - VolumeIdentityByHref -type VolumeIdentity struct { - // The unique identifier for this volume. - ID *string `json:"id,omitempty"` - - // The CRN for this volume. - CRN *string `json:"crn,omitempty"` +// BareMetalServerProfileCpuCoreCountFixed : The CPU core count for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The URL for this volume. - Href *string `json:"href,omitempty"` + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -func (*VolumeIdentity) isaVolumeIdentity() bool { - return true -} +// Constants associated with the BareMetalServerProfileCpuCoreCountFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuCoreCountFixedTypeFixedConst = "fixed" +) -type VolumeIdentityIntf interface { - isaVolumeIdentity() bool +func (*BareMetalServerProfileCpuCoreCountFixed) isaBareMetalServerProfileCpuCoreCount() bool { + return true } -// UnmarshalVolumeIdentity unmarshals an instance of VolumeIdentity from the specified map of raw messages. -func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// UnmarshalBareMetalServerProfileCpuCoreCountFixed unmarshals an instance of BareMetalServerProfileCpuCoreCountFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -51708,43 +58850,55 @@ func UnmarshalVolumeIdentity(m map[string]json.RawMessage, result interface{}) ( return } -// VolumePatch : VolumePatch struct -type VolumePatch struct { - // The capacity to use for the volume (in gigabytes). The volume must be attached as a data volume to a running virtual - // server instance, and the specified value must not be less than the current capacity. - // - // The minimum and maximum capacity limits for creating or updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` +// BareMetalServerProfileCpuCoreCountRange : The permitted range for the number of CPU cores for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuCoreCount +type BareMetalServerProfileCpuCoreCountRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. - Iops *int64 `json:"iops,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The profile to use for this volume. The requested profile must be in the same - // `family` as the current profile. The volume must be attached as a data volume to a - // running virtual server instance. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVolumePatch unmarshals an instance of VolumePatch from the specified map of raw messages. -func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePatch) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) +// Constants associated with the BareMetalServerProfileCpuCoreCountRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuCoreCountRangeTypeRangeConst = "range" +) + +func (*BareMetalServerProfileCpuCoreCountRange) isaBareMetalServerProfileCpuCoreCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuCoreCountRange unmarshals an instance of BareMetalServerProfileCpuCoreCountRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuCoreCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuCoreCountRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -51752,55 +58906,69 @@ func UnmarshalVolumePatch(m map[string]json.RawMessage, result interface{}) (err return } -// AsPatch returns a generic map representation of the VolumePatch -func (volumePatch *VolumePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(volumePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) +// BareMetalServerProfileCpuSocketCountDependent : The CPU socket count for a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileCpuSocketCountDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuSocketCountDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileCpuSocketCountDependent) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuSocketCountDependent unmarshals an instance of BareMetalServerProfileCpuSocketCountDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// VolumeProfile : VolumeProfile struct -type VolumeProfile struct { - // The product family this volume profile belongs to. - // - // The enumerated values for this property will expand in the future. When processing this property, check for and log - // unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the - // unexpected property value was encountered. - Family *string `json:"family" validate:"required"` +// BareMetalServerProfileCpuSocketCountEnum : The permitted values for CPU sockets for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the VolumeProfile.Family property. -// The product family this volume profile belongs to. -// -// The enumerated values for this property will expand in the future. When processing this property, check for and log -// unknown values. Optionally halt processing and surface the error, or bypass the volume profile on which the -// unexpected property value was encountered. +// Constants associated with the BareMetalServerProfileCpuSocketCountEnum.Type property. +// The type for this profile field. const ( - VolumeProfileFamilyCustomConst = "custom" - VolumeProfileFamilyTieredConst = "tiered" + BareMetalServerProfileCpuSocketCountEnumTypeEnumConst = "enum" ) -// UnmarshalVolumeProfile unmarshals an instance of VolumeProfile from the specified map of raw messages. -func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfile) - err = core.UnmarshalPrimitive(m, "family", &obj.Family) +func (*BareMetalServerProfileCpuSocketCountEnum) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuSocketCountEnum unmarshals an instance of BareMetalServerProfileCpuSocketCountEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -51808,74 +58976,90 @@ func UnmarshalVolumeProfile(m map[string]json.RawMessage, result interface{}) (e return } -// VolumeProfileCollection : VolumeProfileCollection struct -type VolumeProfileCollection struct { - // A link to the first page of resources. - First *VolumeProfileCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` +// BareMetalServerProfileCpuSocketCountFixed : The number of CPU sockets for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *VolumeProfileCollectionNext `json:"next,omitempty"` + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} - // Collection of volume profiles. - Profiles []VolumeProfile `json:"profiles" validate:"required"` +// Constants associated with the BareMetalServerProfileCpuSocketCountFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuSocketCountFixedTypeFixedConst = "fixed" +) - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` +func (*BareMetalServerProfileCpuSocketCountFixed) isaBareMetalServerProfileCpuSocketCount() bool { + return true } -// UnmarshalVolumeProfileCollection unmarshals an instance of VolumeProfileCollection from the specified map of raw messages. -func UnmarshalVolumeProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalVolumeProfileCollectionFirst) +// UnmarshalBareMetalServerProfileCpuSocketCountFixed unmarshals an instance of BareMetalServerProfileCpuSocketCountFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalVolumeProfileCollectionNext) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileCpuSocketCountRange : The permitted range for the number of CPU sockets for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileCpuSocketCount +type BareMetalServerProfileCpuSocketCountRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileCpuSocketCountRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileCpuSocketCountRangeTypeRangeConst = "range" +) + +func (*BareMetalServerProfileCpuSocketCountRange) isaBareMetalServerProfileCpuSocketCount() bool { + return true +} + +// UnmarshalBareMetalServerProfileCpuSocketCountRange unmarshals an instance of BareMetalServerProfileCpuSocketCountRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileCpuSocketCountRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileCpuSocketCountRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalVolumeProfile) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeProfileCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return } - return start, nil -} - -// VolumeProfileCollectionFirst : A link to the first page of resources. -type VolumeProfileCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalVolumeProfileCollectionFirst unmarshals an instance of VolumeProfileCollectionFirst from the specified map of raw messages. -func UnmarshalVolumeProfileCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -51883,16 +59067,28 @@ func UnmarshalVolumeProfileCollectionFirst(m map[string]json.RawMessage, result return } -// VolumeProfileCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type VolumeProfileCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` +// BareMetalServerProfileDiskQuantityDependent : The number of disks of this configuration for a bare metal server with this profile depends on its bare metal server +// configuration. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVolumeProfileCollectionNext unmarshals an instance of VolumeProfileCollectionNext from the specified map of raw messages. -func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the BareMetalServerProfileDiskQuantityDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileDiskQuantityDependent) isaBareMetalServerProfileDiskQuantity() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskQuantityDependent unmarshals an instance of BareMetalServerProfileDiskQuantityDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -51900,34 +59096,41 @@ func UnmarshalVolumeProfileCollectionNext(m map[string]json.RawMessage, result i return } -// VolumeProfileIdentity : Identifies a volume profile by a unique property. -// Models which "extend" this model: -// - VolumeProfileIdentityByName -// - VolumeProfileIdentityByHref -type VolumeProfileIdentity struct { - // The globally unique name for this volume profile. - Name *string `json:"name,omitempty"` +// BareMetalServerProfileDiskQuantityEnum : The permitted the number of disks of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The URL for this volume profile. - Href *string `json:"href,omitempty"` -} + // The type for this profile field. + Type *string `json:"type" validate:"required"` -func (*VolumeProfileIdentity) isaVolumeProfileIdentity() bool { - return true + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -type VolumeProfileIdentityIntf interface { - isaVolumeProfileIdentity() bool +// Constants associated with the BareMetalServerProfileDiskQuantityEnum.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityEnumTypeEnumConst = "enum" +) + +func (*BareMetalServerProfileDiskQuantityEnum) isaBareMetalServerProfileDiskQuantity() bool { + return true } -// UnmarshalVolumeProfileIdentity unmarshals an instance of VolumeProfileIdentity from the specified map of raw messages. -func UnmarshalVolumeProfileIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBareMetalServerProfileDiskQuantityEnum unmarshals an instance of BareMetalServerProfileDiskQuantityEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -51935,23 +59138,34 @@ func UnmarshalVolumeProfileIdentity(m map[string]json.RawMessage, result interfa return } -// VolumeProfileReference : VolumeProfileReference struct -type VolumeProfileReference struct { - // The URL for this volume profile. - Href *string `json:"href" validate:"required"` +// BareMetalServerProfileDiskQuantityFixed : The number of disks of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The globally unique name for this volume profile. - Name *string `json:"name" validate:"required"` + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// UnmarshalVolumeProfileReference unmarshals an instance of VolumeProfileReference from the specified map of raw messages. -func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeProfileReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) +// Constants associated with the BareMetalServerProfileDiskQuantityFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileDiskQuantityFixed) isaBareMetalServerProfileDiskQuantity() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskQuantityFixed unmarshals an instance of BareMetalServerProfileDiskQuantityFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -51959,73 +59173,84 @@ func UnmarshalVolumeProfileReference(m map[string]json.RawMessage, result interf return } -// VolumePrototype : VolumePrototype struct -// Models which "extend" this model: -// - VolumePrototypeVolumeByCapacity -type VolumePrototype struct { - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` - - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` +// BareMetalServerProfileDiskQuantityRange : The permitted range for the number of disks of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskQuantity +type BareMetalServerProfileDiskQuantityRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The resource group to use. If unspecified, the account's [default resource - // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The zone this volume will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or - // updating volumes may expand in the future. - Capacity *int64 `json:"capacity,omitempty"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -func (*VolumePrototype) isaVolumePrototype() bool { - return true -} +// Constants associated with the BareMetalServerProfileDiskQuantityRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskQuantityRangeTypeRangeConst = "range" +) -type VolumePrototypeIntf interface { - isaVolumePrototype() bool +func (*BareMetalServerProfileDiskQuantityRange) isaBareMetalServerProfileDiskQuantity() bool { + return true } -// UnmarshalVolumePrototype unmarshals an instance of VolumePrototype from the specified map of raw messages. -func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototype) - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBareMetalServerProfileDiskQuantityRange unmarshals an instance of BareMetalServerProfileDiskQuantityRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskQuantityRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskQuantityRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileDiskSizeDependent : The disk size in GB (gigabytes) of this configuration for a bare metal server with this profile depends on its bare +// metal server configuration. +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileDiskSizeDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileDiskSizeDependent) isaBareMetalServerProfileDiskSize() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskSizeDependent unmarshals an instance of BareMetalServerProfileDiskSizeDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -52033,60 +59258,76 @@ func UnmarshalVolumePrototype(m map[string]json.RawMessage, result interface{}) return } -// VolumePrototypeInstanceByImageContext : VolumePrototypeInstanceByImageContext struct -type VolumePrototypeInstanceByImageContext struct { - // The capacity to use for the volume (in gigabytes). The only allowed value is the image's `minimum_provisioned_size`, - // but the allowed values are expected to expand in the future. - // - // If unspecified, the capacity will be the image's `minimum_provisioned_size`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, and the image is encrypted, the image's `encryption_key` will be - // used. Otherwise, the `encryption` type for the volume will be `provider_managed`. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` +// BareMetalServerProfileDiskSizeEnum : The permitted disk size in GB (gigabytes) of this configuration for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// NewVolumePrototypeInstanceByImageContext : Instantiate VolumePrototypeInstanceByImageContext (Generic Model Constructor) -func (*VpcV1) NewVolumePrototypeInstanceByImageContext(profile VolumeProfileIdentityIntf) (_model *VolumePrototypeInstanceByImageContext, err error) { - _model = &VolumePrototypeInstanceByImageContext{ - Profile: profile, - } - err = core.ValidateStruct(_model, "required parameters") - return +// Constants associated with the BareMetalServerProfileDiskSizeEnum.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeEnumTypeEnumConst = "enum" +) + +func (*BareMetalServerProfileDiskSizeEnum) isaBareMetalServerProfileDiskSize() bool { + return true } -// UnmarshalVolumePrototypeInstanceByImageContext unmarshals an instance of VolumePrototypeInstanceByImageContext from the specified map of raw messages. -func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumePrototypeInstanceByImageContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) +// UnmarshalBareMetalServerProfileDiskSizeEnum unmarshals an instance of BareMetalServerProfileDiskSizeEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileDiskSizeFixed : The size of the disk in GB (gigabytes). +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileDiskSizeFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileDiskSizeFixed) isaBareMetalServerProfileDiskSize() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskSizeFixed unmarshals an instance of BareMetalServerProfileDiskSizeFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -52094,45 +59335,56 @@ func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage return } -// VolumeReference : VolumeReference struct -type VolumeReference struct { - // The CRN for this volume. - CRN *string `json:"crn" validate:"required"` +// BareMetalServerProfileDiskSizeRange : The permitted range for the disk size of this configuration in GB (gigabytes) for a bare metal server with this +// profile. +// This model "extends" BareMetalServerProfileDiskSize +type BareMetalServerProfileDiskSizeRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // If present, this property indicates the referenced resource has been deleted and provides - // some supplementary information. - Deleted *VolumeReferenceDeleted `json:"deleted,omitempty"` + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` - // The URL for this volume. - Href *string `json:"href" validate:"required"` + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` - // The unique identifier for this volume. - ID *string `json:"id" validate:"required"` + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` - // The unique user-defined name for this volume. - Name *string `json:"name" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -// UnmarshalVolumeReference unmarshals an instance of VolumeReference from the specified map of raw messages. -func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReference) - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) +// Constants associated with the BareMetalServerProfileDiskSizeRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileDiskSizeRangeTypeRangeConst = "range" +) + +func (*BareMetalServerProfileDiskSizeRange) isaBareMetalServerProfileDiskSize() bool { + return true +} + +// UnmarshalBareMetalServerProfileDiskSizeRange unmarshals an instance of BareMetalServerProfileDiskSizeRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileDiskSizeRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileDiskSizeRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalVolumeReferenceDeleted) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -52140,17 +59392,30 @@ func UnmarshalVolumeReference(m map[string]json.RawMessage, result interface{}) return } -// VolumeReferenceDeleted : If present, this property indicates the referenced resource has been deleted and provides some supplementary -// information. -type VolumeReferenceDeleted struct { - // Link to documentation about deleted resources. - MoreInfo *string `json:"more_info" validate:"required"` +// BareMetalServerProfileIdentityByHref : BareMetalServerProfileIdentityByHref struct +// This model "extends" BareMetalServerProfileIdentity +type BareMetalServerProfileIdentityByHref struct { + // The URL for this bare metal server profile. + Href *string `json:"href" validate:"required"` } -// UnmarshalVolumeReferenceDeleted unmarshals an instance of VolumeReferenceDeleted from the specified map of raw messages. -func UnmarshalVolumeReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeReferenceDeleted) - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) +// NewBareMetalServerProfileIdentityByHref : Instantiate BareMetalServerProfileIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerProfileIdentityByHref(href string) (_model *BareMetalServerProfileIdentityByHref, err error) { + _model = &BareMetalServerProfileIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*BareMetalServerProfileIdentityByHref) isaBareMetalServerProfileIdentity() bool { + return true +} + +// UnmarshalBareMetalServerProfileIdentityByHref unmarshals an instance of BareMetalServerProfileIdentityByHref from the specified map of raw messages. +func UnmarshalBareMetalServerProfileIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return } @@ -52158,36 +59423,58 @@ func UnmarshalVolumeReferenceDeleted(m map[string]json.RawMessage, result interf return } -// VolumeStatusReason : VolumeStatusReason struct -type VolumeStatusReason struct { - // A snake case string succinctly identifying the status reason. - Code *string `json:"code" validate:"required"` - - // An explanation of the status reason. - Message *string `json:"message" validate:"required"` +// BareMetalServerProfileIdentityByName : BareMetalServerProfileIdentityByName struct +// This model "extends" BareMetalServerProfileIdentity +type BareMetalServerProfileIdentityByName struct { + // The name for this bare metal server profile. + Name *string `json:"name" validate:"required"` +} - // Link to documentation about this status reason. - MoreInfo *string `json:"more_info,omitempty"` +// NewBareMetalServerProfileIdentityByName : Instantiate BareMetalServerProfileIdentityByName (Generic Model Constructor) +func (*VpcV1) NewBareMetalServerProfileIdentityByName(name string) (_model *BareMetalServerProfileIdentityByName, err error) { + _model = &BareMetalServerProfileIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// Constants associated with the VolumeStatusReason.Code property. -// A snake case string succinctly identifying the status reason. -const ( - VolumeStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" -) +func (*BareMetalServerProfileIdentityByName) isaBareMetalServerProfileIdentity() bool { + return true +} -// UnmarshalVolumeStatusReason unmarshals an instance of VolumeStatusReason from the specified map of raw messages. -func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeStatusReason) - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) +// UnmarshalBareMetalServerProfileIdentityByName unmarshals an instance of BareMetalServerProfileIdentityByName from the specified map of raw messages. +func UnmarshalBareMetalServerProfileIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BareMetalServerProfileMemoryDependent : The memory value for a bare metal server with this profile depends on its configuration. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the BareMetalServerProfileMemoryDependent.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryDependentTypeDependentConst = "dependent" +) + +func (*BareMetalServerProfileMemoryDependent) isaBareMetalServerProfileMemory() bool { + return true +} + +// UnmarshalBareMetalServerProfileMemoryDependent unmarshals an instance of BareMetalServerProfileMemoryDependent from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -52195,45 +59482,41 @@ func UnmarshalVolumeStatusReason(m map[string]json.RawMessage, result interface{ return } -// Zone : Zone struct -type Zone struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` +// BareMetalServerProfileMemoryEnum : The permitted memory values (in gibibytes) for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The region this zone resides in. - Region *RegionReference `json:"region" validate:"required"` + // The type for this profile field. + Type *string `json:"type" validate:"required"` - // The availability status of this zone. - Status *string `json:"status" validate:"required"` + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` } -// Constants associated with the Zone.Status property. -// The availability status of this zone. +// Constants associated with the BareMetalServerProfileMemoryEnum.Type property. +// The type for this profile field. const ( - ZoneStatusAvailableConst = "available" - ZoneStatusImpairedConst = "impaired" - ZoneStatusUnavailableConst = "unavailable" + BareMetalServerProfileMemoryEnumTypeEnumConst = "enum" ) -// UnmarshalZone unmarshals an instance of Zone from the specified map of raw messages. -func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Zone) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +func (*BareMetalServerProfileMemoryEnum) isaBareMetalServerProfileMemory() bool { + return true +} + +// UnmarshalBareMetalServerProfileMemoryEnum unmarshals an instance of BareMetalServerProfileMemoryEnum from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalModel(m, "region", &obj.Region, UnmarshalRegionReference) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + err = core.UnmarshalPrimitive(m, "values", &obj.Values) if err != nil { return } @@ -52241,16 +59524,34 @@ func UnmarshalZone(m map[string]json.RawMessage, result interface{}) (err error) return } -// ZoneCollection : ZoneCollection struct -type ZoneCollection struct { - // Collection of zones. - Zones []Zone `json:"zones" validate:"required"` +// BareMetalServerProfileMemoryFixed : The memory (in gibibytes) for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` } -// UnmarshalZoneCollection unmarshals an instance of ZoneCollection from the specified map of raw messages. -func UnmarshalZoneCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneCollection) - err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZone) +// Constants associated with the BareMetalServerProfileMemoryFixed.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryFixedTypeFixedConst = "fixed" +) + +func (*BareMetalServerProfileMemoryFixed) isaBareMetalServerProfileMemory() bool { + return true +} + +// UnmarshalBareMetalServerProfileMemoryFixed unmarshals an instance of BareMetalServerProfileMemoryFixed from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -52258,58 +59559,55 @@ func UnmarshalZoneCollection(m map[string]json.RawMessage, result interface{}) ( return } -// ZoneIdentity : Identifies a zone by a unique property. -// Models which "extend" this model: -// - ZoneIdentityByName -// - ZoneIdentityByHref -type ZoneIdentity struct { - // The globally unique name for this zone. - Name *string `json:"name,omitempty"` +// BareMetalServerProfileMemoryRange : The permitted memory range (in gibibytes) for a bare metal server with this profile. +// This model "extends" BareMetalServerProfileMemory +type BareMetalServerProfileMemoryRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` - // The URL for this zone. - Href *string `json:"href,omitempty"` -} + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` -func (*ZoneIdentity) isaZoneIdentity() bool { - return true + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` } -type ZoneIdentityIntf interface { - isaZoneIdentity() bool +// Constants associated with the BareMetalServerProfileMemoryRange.Type property. +// The type for this profile field. +const ( + BareMetalServerProfileMemoryRangeTypeRangeConst = "range" +) + +func (*BareMetalServerProfileMemoryRange) isaBareMetalServerProfileMemory() bool { + return true } -// UnmarshalZoneIdentity unmarshals an instance of ZoneIdentity from the specified map of raw messages. -func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalBareMetalServerProfileMemoryRange unmarshals an instance of BareMetalServerProfileMemoryRange from the specified map of raw messages. +func UnmarshalBareMetalServerProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BareMetalServerProfileMemoryRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) if err != nil { return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ZoneReference : ZoneReference struct -type ZoneReference struct { - // The URL for this zone. - Href *string `json:"href" validate:"required"` - - // The globally unique name for this zone. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalZoneReference unmarshals an instance of ZoneReference from the specified map of raw messages. -func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ZoneReference) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + err = core.UnmarshalPrimitive(m, "min", &obj.Min) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } @@ -54412,7 +61710,7 @@ func UnmarshalImagePrototypeImageBySourceVolume(m map[string]json.RawMessage, re // This model "extends" InstanceGroupManagerActionPrototype type InstanceGroupManagerActionPrototypeScheduledActionPrototype struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The date and time the scheduled action will run. @@ -54492,8 +61790,7 @@ type InstanceGroupManagerActionScheduledAction struct { // The unique identifier for this instance group manager action. ID *string `json:"id" validate:"required"` - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // The user-defined name for this instance group manager action. Name *string `json:"name" validate:"required"` // The resource type. @@ -54651,7 +61948,7 @@ type InstanceGroupManagerAutoScale struct { // Indicates whether this manager will control the instance group. ManagementEnabled *bool `json:"management_enabled" validate:"required"` - // The user-defined name for this instance group manager. Names must be unique within the instance group. + // The user-defined name for this instance group manager. Name *string `json:"name" validate:"required"` // The date and time that the instance group manager was updated. @@ -54745,7 +62042,7 @@ func UnmarshalInstanceGroupManagerAutoScale(m map[string]json.RawMessage, result // This model "extends" InstanceGroupManagerPolicyPrototype type InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype struct { // The user-defined name for this instance group manager policy. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The type of metric to be evaluated. @@ -54823,8 +62120,7 @@ type InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy struct { // The unique identifier for this instance group manager policy. ID *string `json:"id" validate:"required"` - // The user-defined name for this instance group manager policy. Names must be unique within the instance group - // manager. + // The user-defined name for this instance group manager policy. Name *string `json:"name" validate:"required"` // The date and time that the instance group manager policy was updated. @@ -54904,7 +62200,8 @@ type InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype struct // Indicates whether this manager will control the instance group. ManagementEnabled *bool `json:"management_enabled,omitempty"` - // The user-defined name for this instance group manager. Names must be unique within the instance group. + // The user-defined name for this instance group manager. Names must be unique within the instance group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The time window in seconds to aggregate metrics prior to evaluation. @@ -54984,7 +62281,8 @@ type InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype struct // Indicates whether this manager will control the instance group. ManagementEnabled *bool `json:"management_enabled,omitempty"` - // The user-defined name for this instance group manager. Names must be unique within the instance group. + // The user-defined name for this instance group manager. Names must be unique within the instance group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The type of instance group manager. @@ -55044,7 +62342,7 @@ type InstanceGroupManagerScheduled struct { // Indicates whether this manager will control the instance group. ManagementEnabled *bool `json:"management_enabled" validate:"required"` - // The user-defined name for this instance group manager. Names must be unique within the instance group. + // The user-defined name for this instance group manager. Name *string `json:"name" validate:"required"` // The date and time that the instance group manager was updated. @@ -55119,13 +62417,13 @@ type InstanceGroupManagerScheduledActionManagerAutoScale struct { // The unique identifier for this instance group manager. ID *string `json:"id" validate:"required"` - // The user-defined name for this instance group manager. Names must be unique within the instance group. + // The user-defined name for this instance group manager. Name *string `json:"name" validate:"required"` - // The maximum number of members the instance group should have at the scheduled time. + // The desired maximum number of instance group members at the scheduled time. MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // The minimum number of members the instance group should have at the scheduled time. + // The desired minimum number of instance group members at the scheduled time. MinMembershipCount *int64 `json:"min_membership_count,omitempty"` } @@ -55172,10 +62470,10 @@ func UnmarshalInstanceGroupManagerScheduledActionManagerAutoScale(m map[string]j // - InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref // This model "extends" InstanceGroupManagerScheduledActionManagerPrototype type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype struct { - // The maximum number of members the instance group should have at the scheduled time. + // The desired maximum number of instance group members at the scheduled time. MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // The minimum number of members the instance group should have at the scheduled time. + // The desired minimum number of instance group members at the scheduled time. MinMembershipCount *int64 `json:"min_membership_count,omitempty"` // The unique identifier for this instance group manager. @@ -55283,6 +62581,104 @@ func UnmarshalInstancePatchProfileInstanceProfileIdentityByName(m map[string]jso return } +// InstancePlacementTargetPatchDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID +// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN +// - InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref +// This model "extends" InstancePlacementTargetPatch +type InstancePlacementTargetPatchDedicatedHostGroupIdentity struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host group. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host group. + Href *string `json:"href,omitempty"` +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +type InstancePlacementTargetPatchDedicatedHostGroupIdentityIntf interface { + InstancePlacementTargetPatchIntf + isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentity) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostIdentity : Identifies a dedicated host by a unique property. +// Models which "extend" this model: +// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID +// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN +// - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref +// This model "extends" InstancePlacementTargetPatch +type InstancePlacementTargetPatchDedicatedHostIdentity struct { + // The unique identifier for this dedicated host. + ID *string `json:"id,omitempty"` + + // The CRN for this dedicated host. + CRN *string `json:"crn,omitempty"` + + // The URL for this dedicated host. + Href *string `json:"href,omitempty"` +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { + return true +} + +type InstancePlacementTargetPatchDedicatedHostIdentityIntf interface { + InstancePlacementTargetPatchIntf + isaInstancePlacementTargetPatchDedicatedHostIdentity() bool +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentity) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentity from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstancePlacementTargetPrototypeDedicatedHostGroupIdentity : Identifies a dedicated host group by a unique property. // Models which "extend" this model: // - InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID @@ -57046,6 +64442,14 @@ func UnmarshalInstanceProfileVolumeBandwidthRange(m map[string]json.RawMessage, // InstancePrototypeInstanceByImage : InstancePrototypeInstanceByImage struct // This model "extends" InstancePrototype type InstancePrototypeInstanceByImage struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as // SSH authorized keys for the administrative user. @@ -57060,6 +64464,9 @@ type InstancePrototypeInstanceByImage struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -57070,7 +64477,8 @@ type InstancePrototypeInstanceByImage struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -57121,10 +64529,22 @@ func (*InstancePrototypeInstanceByImage) isaInstancePrototype() bool { // UnmarshalInstancePrototypeInstanceByImage unmarshals an instance of InstancePrototypeInstanceByImage from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByImage) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -57184,6 +64604,14 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res // InstancePrototypeInstanceBySourceTemplate : InstancePrototypeInstanceBySourceTemplate struct // This model "extends" InstancePrototype type InstancePrototypeInstanceBySourceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as // SSH authorized keys for the administrative user. @@ -57198,6 +64626,9 @@ type InstancePrototypeInstanceBySourceTemplate struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -57208,7 +64639,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -57260,10 +64692,22 @@ func (*InstancePrototypeInstanceBySourceTemplate) isaInstancePrototype() bool { // UnmarshalInstancePrototypeInstanceBySourceTemplate unmarshals an instance of InstancePrototypeInstanceBySourceTemplate from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceBySourceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -57327,6 +64771,14 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes // InstancePrototypeInstanceByVolume : InstancePrototypeInstanceByVolume struct // This model "extends" InstancePrototype type InstancePrototypeInstanceByVolume struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as // SSH authorized keys for the administrative user. @@ -57341,6 +64793,9 @@ type InstancePrototypeInstanceByVolume struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -57351,7 +64806,8 @@ type InstancePrototypeInstanceByVolume struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -57399,10 +64855,22 @@ func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { // UnmarshalInstancePrototypeInstanceByVolume unmarshals an instance of InstancePrototypeInstanceByVolume from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByVolume) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -57551,6 +65019,14 @@ func UnmarshalInstanceTemplateIdentityByID(m map[string]json.RawMessage, result // InstanceTemplatePrototypeInstanceByImage : InstanceTemplatePrototypeInstanceByImage struct // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceByImage struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as // SSH authorized keys for the administrative user. @@ -57565,6 +65041,9 @@ type InstanceTemplatePrototypeInstanceByImage struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -57575,7 +65054,8 @@ type InstanceTemplatePrototypeInstanceByImage struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -57626,10 +65106,22 @@ func (*InstanceTemplatePrototypeInstanceByImage) isaInstanceTemplatePrototype() // UnmarshalInstanceTemplatePrototypeInstanceByImage unmarshals an instance of InstanceTemplatePrototypeInstanceByImage from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceByImage(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceByImage) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -57689,6 +65181,14 @@ func UnmarshalInstanceTemplatePrototypeInstanceByImage(m map[string]json.RawMess // InstanceTemplatePrototypeInstanceBySourceTemplate : InstanceTemplatePrototypeInstanceBySourceTemplate struct // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceBySourceTemplate struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as // SSH authorized keys for the administrative user. @@ -57703,6 +65203,9 @@ type InstanceTemplatePrototypeInstanceBySourceTemplate struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -57713,7 +65216,8 @@ type InstanceTemplatePrototypeInstanceBySourceTemplate struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -57765,10 +65269,22 @@ func (*InstanceTemplatePrototypeInstanceBySourceTemplate) isaInstanceTemplatePro // UnmarshalInstanceTemplatePrototypeInstanceBySourceTemplate unmarshals an instance of InstanceTemplatePrototypeInstanceBySourceTemplate from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceBySourceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -57832,6 +65348,14 @@ func UnmarshalInstanceTemplatePrototypeInstanceBySourceTemplate(m map[string]jso // InstanceTemplatePrototypeInstanceByVolume : InstanceTemplatePrototypeInstanceByVolume struct // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceByVolume struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as // SSH authorized keys for the administrative user. @@ -57846,6 +65370,9 @@ type InstanceTemplatePrototypeInstanceByVolume struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -57856,7 +65383,8 @@ type InstanceTemplatePrototypeInstanceByVolume struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -57904,10 +65432,22 @@ func (*InstanceTemplatePrototypeInstanceByVolume) isaInstanceTemplatePrototype() // UnmarshalInstanceTemplatePrototypeInstanceByVolume unmarshals an instance of InstanceTemplatePrototypeInstanceByVolume from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceByVolume) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -57963,12 +65503,20 @@ func UnmarshalInstanceTemplatePrototypeInstanceByVolume(m map[string]json.RawMes // InstanceTemplateInstanceByImage : InstanceTemplateInstanceByImage struct // This model "extends" InstanceTemplate type InstanceTemplateInstanceByImage struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The CRN for this instance template. CRN *string `json:"crn" validate:"required"` + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The URL for this instance template. Href *string `json:"href" validate:"required"` @@ -57989,6 +65537,9 @@ type InstanceTemplateInstanceByImage struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this instance template. Name *string `json:"name" validate:"required"` @@ -57998,7 +65549,8 @@ type InstanceTemplateInstanceByImage struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` // The resource group for this instance template. @@ -58039,6 +65591,10 @@ func (*InstanceTemplateInstanceByImage) isaInstanceTemplate() bool { // UnmarshalInstanceTemplateInstanceByImage unmarshals an instance of InstanceTemplateInstanceByImage from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByImage(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByImage) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -58047,6 +65603,10 @@ func UnmarshalInstanceTemplateInstanceByImage(m map[string]json.RawMessage, resu if err != nil { return } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -58059,6 +65619,10 @@ func UnmarshalInstanceTemplateInstanceByImage(m map[string]json.RawMessage, resu if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -58118,12 +65682,20 @@ func UnmarshalInstanceTemplateInstanceByImage(m map[string]json.RawMessage, resu // InstanceTemplateInstanceByVolume : InstanceTemplateInstanceByVolume struct // This model "extends" InstanceTemplate type InstanceTemplateInstanceByVolume struct { + // The availability policy to use for this virtual server instance. + AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` + // The date and time that the instance template was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The CRN for this instance template. CRN *string `json:"crn" validate:"required"` + // The default trusted profile configuration to use for this virtual server instance This property's value is used + // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an + // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` + // The URL for this instance template. Href *string `json:"href" validate:"required"` @@ -58144,6 +65716,9 @@ type InstanceTemplateInstanceByVolume struct { // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. Keys []KeyIdentityIntf `json:"keys,omitempty"` + // Configuration options for the instance metadata service. + MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` + // The unique user-defined name for this instance template. Name *string `json:"name" validate:"required"` @@ -58153,7 +65728,8 @@ type InstanceTemplateInstanceByVolume struct { // The placement restrictions to use for the virtual server instance. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - // The profile to use for this virtual server instance. + // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value + // is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` // The resource group for this instance template. @@ -58191,6 +65767,10 @@ func (*InstanceTemplateInstanceByVolume) isaInstanceTemplate() bool { // UnmarshalInstanceTemplateInstanceByVolume unmarshals an instance of InstanceTemplateInstanceByVolume from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByVolume) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { return @@ -58199,6 +65779,10 @@ func UnmarshalInstanceTemplateInstanceByVolume(m map[string]json.RawMessage, res if err != nil { return } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -58211,6 +65795,10 @@ func UnmarshalInstanceTemplateInstanceByVolume(m map[string]json.RawMessage, res if err != nil { return } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -63045,8 +70633,9 @@ type SubnetPrototypeSubnetByCIDR struct { // The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` // (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must fall within an existing - // address prefix in the VPC. The subnet will be created in the zone of the address prefix that contains the IPv4 CIDR. - // If zone is specified, it must match the zone of the address prefix that contains the subnet's IPv4 CIDR. + // address prefix in the VPC and must not overlap with any existing subnet. The subnet will be created in the zone of + // the address prefix that contains the IPv4 CIDR. If zone is specified, it must match the zone of the address prefix + // that contains the subnet's IPv4 CIDR. Ipv4CIDRBlock *string `json:"ipv4_cidr_block" validate:"required"` // The zone this subnet will reside in. @@ -63308,6 +70897,68 @@ func UnmarshalSubnetPublicGatewayPatchPublicGatewayIdentityByID(m map[string]jso return } +// TrustedProfileIdentityTrustedProfileByCRN : TrustedProfileIdentityTrustedProfileByCRN struct +// This model "extends" TrustedProfileIdentity +type TrustedProfileIdentityTrustedProfileByCRN struct { + // The CRN for this trusted profile. + CRN *string `json:"crn" validate:"required"` +} + +// NewTrustedProfileIdentityTrustedProfileByCRN : Instantiate TrustedProfileIdentityTrustedProfileByCRN (Generic Model Constructor) +func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByCRN(crn string) (_model *TrustedProfileIdentityTrustedProfileByCRN, err error) { + _model = &TrustedProfileIdentityTrustedProfileByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*TrustedProfileIdentityTrustedProfileByCRN) isaTrustedProfileIdentity() bool { + return true +} + +// UnmarshalTrustedProfileIdentityTrustedProfileByCRN unmarshals an instance of TrustedProfileIdentityTrustedProfileByCRN from the specified map of raw messages. +func UnmarshalTrustedProfileIdentityTrustedProfileByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileIdentityTrustedProfileByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TrustedProfileIdentityTrustedProfileByID : TrustedProfileIdentityTrustedProfileByID struct +// This model "extends" TrustedProfileIdentity +type TrustedProfileIdentityTrustedProfileByID struct { + // The unique identifier for this trusted profile. + ID *string `json:"id" validate:"required"` +} + +// NewTrustedProfileIdentityTrustedProfileByID : Instantiate TrustedProfileIdentityTrustedProfileByID (Generic Model Constructor) +func (*VpcV1) NewTrustedProfileIdentityTrustedProfileByID(id string) (_model *TrustedProfileIdentityTrustedProfileByID, err error) { + _model = &TrustedProfileIdentityTrustedProfileByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*TrustedProfileIdentityTrustedProfileByID) isaTrustedProfileIdentity() bool { + return true +} + +// UnmarshalTrustedProfileIdentityTrustedProfileByID unmarshals an instance of TrustedProfileIdentityTrustedProfileByID from the specified map of raw messages. +func UnmarshalTrustedProfileIdentityTrustedProfileByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TrustedProfileIdentityTrustedProfileByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPCIdentityByCRN : VPCIdentityByCRN struct // This model "extends" VPCIdentity type VPCIdentityByCRN struct { @@ -64693,8 +72344,8 @@ func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(m ma // VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext : VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext struct // This model "extends" VolumeAttachmentVolumePrototypeInstanceByVolumeContext type VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext struct { - // The capacity to use for the volume (in gigabytes). The only allowed value is the source snapshot's - // `minimum_capacity`, but the allowed values are expected to expand in the future. + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. // // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. Capacity *int64 `json:"capacity,omitempty"` @@ -65743,7 +73394,7 @@ func UnmarshalFlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByID(m map[st // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min @@ -65802,7 +73453,7 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The date and time the scheduled action will run. @@ -65875,8 +73526,7 @@ type InstanceGroupManagerActionScheduledActionGroupTarget struct { // The unique identifier for this instance group manager action. ID *string `json:"id" validate:"required"` - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // The user-defined name for this instance group manager action. Name *string `json:"name" validate:"required"` // The resource type. @@ -66030,8 +73680,7 @@ type InstanceGroupManagerActionScheduledActionManagerTarget struct { // The unique identifier for this instance group manager action. ID *string `json:"id" validate:"required"` - // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // The user-defined name for this instance group manager action. Name *string `json:"name" validate:"required"` // The resource type. @@ -66166,10 +73815,10 @@ func UnmarshalInstanceGroupManagerActionScheduledActionManagerTarget(m map[strin // InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct // This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref struct { - // The maximum number of members the instance group should have at the scheduled time. + // The desired maximum number of instance group members at the scheduled time. MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // The minimum number of members the instance group should have at the scheduled time. + // The desired minimum number of instance group members at the scheduled time. MinMembershipCount *int64 `json:"min_membership_count,omitempty"` // The URL for this instance group manager. @@ -66215,10 +73864,10 @@ func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScaleProtot // InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID : InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct // This model "extends" InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype type InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByID struct { - // The maximum number of members the instance group should have at the scheduled time. + // The desired maximum number of instance group members at the scheduled time. MaxMembershipCount *int64 `json:"max_membership_count,omitempty"` - // The minimum number of members the instance group should have at the scheduled time. + // The desired minimum number of instance group members at the scheduled time. MinMembershipCount *int64 `json:"min_membership_count,omitempty"` // The unique identifier for this instance group manager. @@ -66261,6 +73910,216 @@ func UnmarshalInstanceGroupManagerScheduledActionManagerPrototypeAutoScaleProtot return } +// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { + // The CRN for this dedicated host group. + CRN *string `json:"crn" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref struct { + // The URL for this dedicated host group. + Href *string `json:"href" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostGroupIdentity +type InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID struct { + // The unique identifier for this dedicated host group. + ID *string `json:"id" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatchDedicatedHostGroupIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity +type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN struct { + // The CRN for this dedicated host. + CRN *string `json:"crn" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(crn string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity +type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref struct { + // The URL for this dedicated host. + Href *string `json:"href" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(href string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct +// This model "extends" InstancePlacementTargetPatchDedicatedHostIdentity +type InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID struct { + // The unique identifier for this dedicated host. + ID *string `json:"id" validate:"required"` +} + +// NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID : Instantiate InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID (Generic Model Constructor) +func (*VpcV1) NewInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(id string) (_model *InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID, err error) { + _model = &InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatchDedicatedHostIdentity() bool { + return true +} + +func (*InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) isaInstancePlacementTargetPatch() bool { + return true +} + +// UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID unmarshals an instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID from the specified map of raw messages. +func UnmarshalInstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN : InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct // This model "extends" InstancePlacementTargetPrototypeDedicatedHostGroupIdentity type InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN struct { @@ -67532,8 +75391,8 @@ type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototyp // The profile to use for this volume. Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - // The capacity to use for the volume (in gigabytes). The only allowed value is the source snapshot's - // `minimum_capacity`, but the allowed values are expected to expand in the future. + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. // // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. Capacity *int64 `json:"capacity,omitempty"` @@ -67782,8 +75641,8 @@ type VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContex // The profile to use for this volume. Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - // The capacity to use for the volume (in gigabytes). The only allowed value is the source snapshot's - // `minimum_capacity`, but the allowed values are expected to expand in the future. + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. // // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. Capacity *int64 `json:"capacity,omitempty"` @@ -67850,7 +75709,7 @@ func UnmarshalVolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInsta // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min @@ -67904,7 +75763,7 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min @@ -67958,7 +75817,7 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The date and time the scheduled action will run. @@ -68011,7 +75870,7 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct { // The user-defined name for this instance group manager action. Names must be unique within the instance group - // manager. + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The date and time the scheduled action will run. diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/LICENSE.txt b/ibm/vendor/github.com/aws/aws-sdk-go/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/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/ibm/vendor/github.com/aws/aws-sdk-go/NOTICE.txt b/ibm/vendor/github.com/aws/aws-sdk-go/NOTICE.txt deleted file mode 100644 index 899129ecc4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/NOTICE.txt +++ /dev/null @@ -1,3 +0,0 @@ -AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. -Copyright 2014-2015 Stripe, Inc. diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go deleted file mode 100644 index 1c49674290..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go deleted file mode 100644 index 99849c0e19..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go +++ /dev/null @@ -1,164 +0,0 @@ -// Package awserr represents API error interface accessors for the SDK. -package awserr - -// An Error wraps lower level errors with code, message and an original error. -// The underlying concrete error type may also satisfy other interfaces which -// can be to used to obtain more specific information about the error. -// -// Calling Error() or String() will always include the full information about -// an error based on its underlying type. -// -// Example: -// -// output, err := s3manage.Upload(svc, input, opts) -// if err != nil { -// if awsErr, ok := err.(awserr.Error); ok { -// // Get error details -// log.Println("Error:", awsErr.Code(), awsErr.Message()) -// -// // Prints out full error message, including original error if there was one. -// log.Println("Error:", awsErr.Error()) -// -// // Get original error -// if origErr := awsErr.OrigErr(); origErr != nil { -// // operate on original error. -// } -// } else { -// fmt.Println(err.Error()) -// } -// } -// -type Error interface { - // Satisfy the generic error interface. - error - - // Returns the short phrase depicting the classification of the error. - Code() string - - // Returns the error details message. - Message() string - - // Returns the original error if one was set. Nil is returned if not set. - OrigErr() error -} - -// BatchError is a batch of errors which also wraps lower level errors with -// code, message, and original errors. Calling Error() will include all errors -// that occurred in the batch. -// -// Deprecated: Replaced with BatchedErrors. Only defined for backwards -// compatibility. -type BatchError interface { - // Satisfy the generic error interface. - error - - // Returns the short phrase depicting the classification of the error. - Code() string - - // Returns the error details message. - Message() string - - // Returns the original error if one was set. Nil is returned if not set. - OrigErrs() []error -} - -// BatchedErrors is a batch of errors which also wraps lower level errors with -// code, message, and original errors. Calling Error() will include all errors -// that occurred in the batch. -// -// Replaces BatchError -type BatchedErrors interface { - // Satisfy the base Error interface. - Error - - // Returns the original error if one was set. Nil is returned if not set. - OrigErrs() []error -} - -// New returns an Error object described by the code, message, and origErr. -// -// If origErr satisfies the Error interface it will not be wrapped within a new -// Error object and will instead be returned. -func New(code, message string, origErr error) Error { - var errs []error - if origErr != nil { - errs = append(errs, origErr) - } - return newBaseError(code, message, errs) -} - -// NewBatchError returns an BatchedErrors with a collection of errors as an -// array of errors. -func NewBatchError(code, message string, errs []error) BatchedErrors { - return newBaseError(code, message, errs) -} - -// A RequestFailure is an interface to extract request failure information from -// an Error such as the request ID of the failed request returned by a service. -// RequestFailures may not always have a requestID value if the request failed -// prior to reaching the service such as a connection error. -// -// Example: -// -// output, err := s3manage.Upload(svc, input, opts) -// if err != nil { -// if reqerr, ok := err.(RequestFailure); ok { -// log.Println("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID()) -// } else { -// log.Println("Error:", err.Error()) -// } -// } -// -// Combined with awserr.Error: -// -// output, err := s3manage.Upload(svc, input, opts) -// if err != nil { -// if awsErr, ok := err.(awserr.Error); ok { -// // Generic AWS Error with Code, Message, and original error (if any) -// fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) -// -// if reqErr, ok := err.(awserr.RequestFailure); ok { -// // A service error occurred -// fmt.Println(reqErr.StatusCode(), reqErr.RequestID()) -// } -// } else { -// fmt.Println(err.Error()) -// } -// } -// -type RequestFailure interface { - Error - - // The status code of the HTTP response. - StatusCode() int - - // The request ID returned by the service for a request failure. This will - // be empty if no request ID is available such as the request failed due - // to a connection error. - RequestID() string -} - -// NewRequestFailure returns a wrapped error with additional information for -// request status code, and service requestID. -// -// Should be used to wrap all request which involve service requests. Even if -// the request failed without a service response, but had an HTTP status code -// that may be meaningful. -func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure { - return newRequestError(err, statusCode, reqID) -} - -// UnmarshalError provides the interface for the SDK failing to unmarshal data. -type UnmarshalError interface { - awsError - Bytes() []byte -} - -// NewUnmarshalError returns an initialized UnmarshalError error wrapper adding -// the bytes that fail to unmarshal to the error. -func NewUnmarshalError(err error, msg string, bytes []byte) UnmarshalError { - return &unmarshalError{ - awsError: New("UnmarshalError", msg, err), - bytes: bytes, - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go deleted file mode 100644 index 9cf7eaf400..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go +++ /dev/null @@ -1,221 +0,0 @@ -package awserr - -import ( - "encoding/hex" - "fmt" -) - -// SprintError returns a string of the formatted error code. -// -// Both extra and origErr are optional. If they are included their lines -// will be added, but if they are not included their lines will be ignored. -func SprintError(code, message, extra string, origErr error) string { - msg := fmt.Sprintf("%s: %s", code, message) - if extra != "" { - msg = fmt.Sprintf("%s\n\t%s", msg, extra) - } - if origErr != nil { - msg = fmt.Sprintf("%s\ncaused by: %s", msg, origErr.Error()) - } - return msg -} - -// A baseError wraps the code and message which defines an error. It also -// can be used to wrap an original error object. -// -// Should be used as the root for errors satisfying the awserr.Error. Also -// for any error which does not fit into a specific error wrapper type. -type baseError struct { - // Classification of error - code string - - // Detailed information about error - message string - - // Optional original error this error is based off of. Allows building - // chained errors. - errs []error -} - -// newBaseError returns an error object for the code, message, and errors. -// -// code is a short no whitespace phrase depicting the classification of -// the error that is being created. -// -// message is the free flow string containing detailed information about the -// error. -// -// origErrs is the error objects which will be nested under the new errors to -// be returned. -func newBaseError(code, message string, origErrs []error) *baseError { - b := &baseError{ - code: code, - message: message, - errs: origErrs, - } - - return b -} - -// Error returns the string representation of the error. -// -// See ErrorWithExtra for formatting. -// -// Satisfies the error interface. -func (b baseError) Error() string { - size := len(b.errs) - if size > 0 { - return SprintError(b.code, b.message, "", errorList(b.errs)) - } - - return SprintError(b.code, b.message, "", nil) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (b baseError) String() string { - return b.Error() -} - -// Code returns the short phrase depicting the classification of the error. -func (b baseError) Code() string { - return b.code -} - -// Message returns the error details message. -func (b baseError) Message() string { - return b.message -} - -// OrigErr returns the original error if one was set. Nil is returned if no -// error was set. This only returns the first element in the list. If the full -// list is needed, use BatchedErrors. -func (b baseError) OrigErr() error { - switch len(b.errs) { - case 0: - return nil - case 1: - return b.errs[0] - default: - if err, ok := b.errs[0].(Error); ok { - return NewBatchError(err.Code(), err.Message(), b.errs[1:]) - } - return NewBatchError("BatchedErrors", - "multiple errors occurred", b.errs) - } -} - -// OrigErrs returns the original errors if one was set. An empty slice is -// returned if no error was set. -func (b baseError) OrigErrs() []error { - return b.errs -} - -// So that the Error interface type can be included as an anonymous field -// in the requestError struct and not conflict with the error.Error() method. -type awsError Error - -// A requestError wraps a request or service error. -// -// Composed of baseError for code, message, and original error. -type requestError struct { - awsError - statusCode int - requestID string - bytes []byte -} - -// newRequestError returns a wrapped error with additional information for -// request status code, and service requestID. -// -// Should be used to wrap all request which involve service requests. Even if -// the request failed without a service response, but had an HTTP status code -// that may be meaningful. -// -// Also wraps original errors via the baseError. -func newRequestError(err Error, statusCode int, requestID string) *requestError { - return &requestError{ - awsError: err, - statusCode: statusCode, - requestID: requestID, - } -} - -// Error returns the string representation of the error. -// Satisfies the error interface. -func (r requestError) Error() string { - extra := fmt.Sprintf("status code: %d, request id: %s", - r.statusCode, r.requestID) - return SprintError(r.Code(), r.Message(), extra, r.OrigErr()) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (r requestError) String() string { - return r.Error() -} - -// StatusCode returns the wrapped status code for the error -func (r requestError) StatusCode() int { - return r.statusCode -} - -// RequestID returns the wrapped requestID -func (r requestError) RequestID() string { - return r.requestID -} - -// OrigErrs returns the original errors if one was set. An empty slice is -// returned if no error was set. -func (r requestError) OrigErrs() []error { - if b, ok := r.awsError.(BatchedErrors); ok { - return b.OrigErrs() - } - return []error{r.OrigErr()} -} - -type unmarshalError struct { - awsError - bytes []byte -} - -// Error returns the string representation of the error. -// Satisfies the error interface. -func (e unmarshalError) Error() string { - extra := hex.Dump(e.bytes) - return SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (e unmarshalError) String() string { - return e.Error() -} - -// Bytes returns the bytes that failed to unmarshal. -func (e unmarshalError) Bytes() []byte { - return e.bytes -} - -// An error list that satisfies the golang interface -type errorList []error - -// Error returns the string representation of the error. -// -// Satisfies the error interface. -func (e errorList) Error() string { - msg := "" - // How do we want to handle the array size being zero - if size := len(e); size > 0 { - for i := 0; i < size; i++ { - msg += e[i].Error() - // We check the next index to see if it is within the slice. - // If it is, then we append a newline. We do this, because unit tests - // could be broken with the additional '\n' - if i+1 < size { - msg += "\n" - } - } - } - return msg -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go deleted file mode 100644 index 1a3d106d5c..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go +++ /dev/null @@ -1,108 +0,0 @@ -package awsutil - -import ( - "io" - "reflect" - "time" -) - -// Copy deeply copies a src structure to dst. Useful for copying request and -// response structures. -// -// Can copy between structs of different type, but will only copy fields which -// are assignable, and exist in both structs. Fields which are not assignable, -// or do not exist in both structs are ignored. -func Copy(dst, src interface{}) { - dstval := reflect.ValueOf(dst) - if !dstval.IsValid() { - panic("Copy dst cannot be nil") - } - - rcopy(dstval, reflect.ValueOf(src), true) -} - -// CopyOf returns a copy of src while also allocating the memory for dst. -// src must be a pointer type or this operation will fail. -func CopyOf(src interface{}) (dst interface{}) { - dsti := reflect.New(reflect.TypeOf(src).Elem()) - dst = dsti.Interface() - rcopy(dsti, reflect.ValueOf(src), true) - return -} - -// rcopy performs a recursive copy of values from the source to destination. -// -// root is used to skip certain aspects of the copy which are not valid -// for the root node of a object. -func rcopy(dst, src reflect.Value, root bool) { - if !src.IsValid() { - return - } - - switch src.Kind() { - case reflect.Ptr: - if _, ok := src.Interface().(io.Reader); ok { - if dst.Kind() == reflect.Ptr && dst.Elem().CanSet() { - dst.Elem().Set(src) - } else if dst.CanSet() { - dst.Set(src) - } - } else { - e := src.Type().Elem() - if dst.CanSet() && !src.IsNil() { - if _, ok := src.Interface().(*time.Time); !ok { - dst.Set(reflect.New(e)) - } else { - tempValue := reflect.New(e) - tempValue.Elem().Set(src.Elem()) - // Sets time.Time's unexported values - dst.Set(tempValue) - } - } - if src.Elem().IsValid() { - // Keep the current root state since the depth hasn't changed - rcopy(dst.Elem(), src.Elem(), root) - } - } - case reflect.Struct: - t := dst.Type() - for i := 0; i < t.NumField(); i++ { - name := t.Field(i).Name - srcVal := src.FieldByName(name) - dstVal := dst.FieldByName(name) - if srcVal.IsValid() && dstVal.CanSet() { - rcopy(dstVal, srcVal, false) - } - } - case reflect.Slice: - if src.IsNil() { - break - } - - s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap()) - dst.Set(s) - for i := 0; i < src.Len(); i++ { - rcopy(dst.Index(i), src.Index(i), false) - } - case reflect.Map: - if src.IsNil() { - break - } - - s := reflect.MakeMap(src.Type()) - dst.Set(s) - for _, k := range src.MapKeys() { - v := src.MapIndex(k) - v2 := reflect.New(v.Type()).Elem() - rcopy(v2, v, false) - dst.SetMapIndex(k, v2) - } - default: - // Assign the value if possible. If its not assignable, the value would - // need to be converted and the impact of that may be unexpected, or is - // not compatible with the dst type. - if src.Type().AssignableTo(dst.Type()) { - dst.Set(src) - } - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go deleted file mode 100644 index 142a7a01c5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go +++ /dev/null @@ -1,27 +0,0 @@ -package awsutil - -import ( - "reflect" -) - -// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. -// In addition to this, this method will also dereference the input values if -// possible so the DeepEqual performed will not fail if one parameter is a -// pointer and the other is not. -// -// DeepEqual will not perform indirection of nested values of the input parameters. -func DeepEqual(a, b interface{}) bool { - ra := reflect.Indirect(reflect.ValueOf(a)) - rb := reflect.Indirect(reflect.ValueOf(b)) - - if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { - // If the elements are both nil, and of the same type they are equal - // If they are of different types they are not equal - return reflect.TypeOf(a) == reflect.TypeOf(b) - } else if raValid != rbValid { - // Both values must be valid to be equal - return false - } - - return reflect.DeepEqual(ra.Interface(), rb.Interface()) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go deleted file mode 100644 index a4eb6a7f43..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ /dev/null @@ -1,221 +0,0 @@ -package awsutil - -import ( - "reflect" - "regexp" - "strconv" - "strings" - - "github.com/jmespath/go-jmespath" -) - -var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) - -// rValuesAtPath returns a slice of values found in value v. The values -// in v are explored recursively so all nested values are collected. -func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value { - pathparts := strings.Split(path, "||") - if len(pathparts) > 1 { - for _, pathpart := range pathparts { - vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm) - if len(vals) > 0 { - return vals - } - } - return nil - } - - values := []reflect.Value{reflect.Indirect(reflect.ValueOf(v))} - components := strings.Split(path, ".") - for len(values) > 0 && len(components) > 0 { - var index *int64 - var indexStar bool - c := strings.TrimSpace(components[0]) - if c == "" { // no actual component, illegal syntax - return nil - } else if caseSensitive && c != "*" && strings.ToLower(c[0:1]) == c[0:1] { - // TODO normalize case for user - return nil // don't support unexported fields - } - - // parse this component - if m := indexRe.FindStringSubmatch(c); m != nil { - c = m[1] - if m[2] == "" { - index = nil - indexStar = true - } else { - i, _ := strconv.ParseInt(m[2], 10, 32) - index = &i - indexStar = false - } - } - - nextvals := []reflect.Value{} - for _, value := range values { - // pull component name out of struct member - if value.Kind() != reflect.Struct { - continue - } - - if c == "*" { // pull all members - for i := 0; i < value.NumField(); i++ { - if f := reflect.Indirect(value.Field(i)); f.IsValid() { - nextvals = append(nextvals, f) - } - } - continue - } - - value = value.FieldByNameFunc(func(name string) bool { - if c == name { - return true - } else if !caseSensitive && strings.EqualFold(name, c) { - return true - } - return false - }) - - if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 { - if !value.IsNil() { - value.Set(reflect.Zero(value.Type())) - } - return []reflect.Value{value} - } - - if createPath && value.Kind() == reflect.Ptr && value.IsNil() { - // TODO if the value is the terminus it should not be created - // if the value to be set to its position is nil. - value.Set(reflect.New(value.Type().Elem())) - value = value.Elem() - } else { - value = reflect.Indirect(value) - } - - if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !createPath && value.IsNil() { - value = reflect.ValueOf(nil) - } - } - - if value.IsValid() { - nextvals = append(nextvals, value) - } - } - values = nextvals - - if indexStar || index != nil { - nextvals = []reflect.Value{} - for _, valItem := range values { - value := reflect.Indirect(valItem) - if value.Kind() != reflect.Slice { - continue - } - - if indexStar { // grab all indices - for i := 0; i < value.Len(); i++ { - idx := reflect.Indirect(value.Index(i)) - if idx.IsValid() { - nextvals = append(nextvals, idx) - } - } - continue - } - - // pull out index - i := int(*index) - if i >= value.Len() { // check out of bounds - if createPath { - // TODO resize slice - } else { - continue - } - } else if i < 0 { // support negative indexing - i = value.Len() + i - } - value = reflect.Indirect(value.Index(i)) - - if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !createPath && value.IsNil() { - value = reflect.ValueOf(nil) - } - } - - if value.IsValid() { - nextvals = append(nextvals, value) - } - } - values = nextvals - } - - components = components[1:] - } - return values -} - -// ValuesAtPath returns a list of values at the case insensitive lexical -// path inside of a structure. -func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { - result, err := jmespath.Search(path, i) - if err != nil { - return nil, err - } - - v := reflect.ValueOf(result) - if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) { - return nil, nil - } - if s, ok := result.([]interface{}); ok { - return s, err - } - if v.Kind() == reflect.Map && v.Len() == 0 { - return nil, nil - } - if v.Kind() == reflect.Slice { - out := make([]interface{}, v.Len()) - for i := 0; i < v.Len(); i++ { - out[i] = v.Index(i).Interface() - } - return out, nil - } - - return []interface{}{result}, nil -} - -// SetValueAtPath sets a value at the case insensitive lexical path inside -// of a structure. -func SetValueAtPath(i interface{}, path string, v interface{}) { - rvals := rValuesAtPath(i, path, true, false, v == nil) - for _, rval := range rvals { - if rval.Kind() == reflect.Ptr && rval.IsNil() { - continue - } - setValue(rval, v) - } -} - -func setValue(dstVal reflect.Value, src interface{}) { - if dstVal.Kind() == reflect.Ptr { - dstVal = reflect.Indirect(dstVal) - } - srcVal := reflect.ValueOf(src) - - if !srcVal.IsValid() { // src is literal nil - if dstVal.CanAddr() { - // Convert to pointer so that pointer's value can be nil'ed - // dstVal = dstVal.Addr() - } - dstVal.Set(reflect.Zero(dstVal.Type())) - - } else if srcVal.Kind() == reflect.Ptr { - if srcVal.IsNil() { - srcVal = reflect.Zero(dstVal.Type()) - } else { - srcVal = reflect.ValueOf(src).Elem() - } - dstVal.Set(srcVal) - } else { - dstVal.Set(srcVal) - } - -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go deleted file mode 100644 index 710eb432f8..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go +++ /dev/null @@ -1,113 +0,0 @@ -package awsutil - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strings" -) - -// Prettify returns the string representation of a value. -func Prettify(i interface{}) string { - var buf bytes.Buffer - prettify(reflect.ValueOf(i), 0, &buf) - return buf.String() -} - -// prettify will recursively walk value v to build a textual -// representation of the value. -func prettify(v reflect.Value, indent int, buf *bytes.Buffer) { - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Struct: - strtype := v.Type().String() - if strtype == "time.Time" { - fmt.Fprintf(buf, "%s", v.Interface()) - break - } else if strings.HasPrefix(strtype, "io.") { - buf.WriteString("") - break - } - - buf.WriteString("{\n") - - names := []string{} - for i := 0; i < v.Type().NumField(); i++ { - name := v.Type().Field(i).Name - f := v.Field(i) - if name[0:1] == strings.ToLower(name[0:1]) { - continue // ignore unexported fields - } - if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() { - continue // ignore unset fields - } - names = append(names, name) - } - - for i, n := range names { - val := v.FieldByName(n) - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(n + ": ") - prettify(val, indent+2, buf) - - if i < len(names)-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - case reflect.Slice: - strtype := v.Type().String() - if strtype == "[]uint8" { - fmt.Fprintf(buf, " len %d", v.Len()) - break - } - - nl, id, id2 := "", "", "" - if v.Len() > 3 { - nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) - } - buf.WriteString("[" + nl) - for i := 0; i < v.Len(); i++ { - buf.WriteString(id2) - prettify(v.Index(i), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString("," + nl) - } - } - - buf.WriteString(nl + id + "]") - case reflect.Map: - buf.WriteString("{\n") - - for i, k := range v.MapKeys() { - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(k.String() + ": ") - prettify(v.MapIndex(k), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - default: - if !v.IsValid() { - fmt.Fprint(buf, "") - return - } - format := "%v" - switch v.Interface().(type) { - case string: - format = "%q" - case io.ReadSeeker, io.Reader: - format = "buffer(%p)" - } - fmt.Fprintf(buf, format, v.Interface()) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go deleted file mode 100644 index 645df2450f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go +++ /dev/null @@ -1,88 +0,0 @@ -package awsutil - -import ( - "bytes" - "fmt" - "reflect" - "strings" -) - -// StringValue returns the string representation of a value. -func StringValue(i interface{}) string { - var buf bytes.Buffer - stringValue(reflect.ValueOf(i), 0, &buf) - return buf.String() -} - -func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Struct: - buf.WriteString("{\n") - - for i := 0; i < v.Type().NumField(); i++ { - ft := v.Type().Field(i) - fv := v.Field(i) - - if ft.Name[0:1] == strings.ToLower(ft.Name[0:1]) { - continue // ignore unexported fields - } - if (fv.Kind() == reflect.Ptr || fv.Kind() == reflect.Slice) && fv.IsNil() { - continue // ignore unset fields - } - - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(ft.Name + ": ") - - if tag := ft.Tag.Get("sensitive"); tag == "true" { - buf.WriteString("") - } else { - stringValue(fv, indent+2, buf) - } - - buf.WriteString(",\n") - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - case reflect.Slice: - nl, id, id2 := "", "", "" - if v.Len() > 3 { - nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) - } - buf.WriteString("[" + nl) - for i := 0; i < v.Len(); i++ { - buf.WriteString(id2) - stringValue(v.Index(i), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString("," + nl) - } - } - - buf.WriteString(nl + id + "]") - case reflect.Map: - buf.WriteString("{\n") - - for i, k := range v.MapKeys() { - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(k.String() + ": ") - stringValue(v.MapIndex(k), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - default: - format := "%v" - switch v.Interface().(type) { - case string: - format = "%q" - } - fmt.Fprintf(buf, format, v.Interface()) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/client.go deleted file mode 100644 index 03334d6920..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ /dev/null @@ -1,97 +0,0 @@ -package client - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" -) - -// A Config provides configuration to a service client instance. -type Config struct { - Config *aws.Config - Handlers request.Handlers - PartitionID string - Endpoint string - SigningRegion string - SigningName string - - // States that the signing name did not come from a modeled source but - // was derived based on other data. Used by service client constructors - // to determine if the signin name can be overridden based on metadata the - // service has. - SigningNameDerived bool -} - -// ConfigProvider provides a generic way for a service client to receive -// the ClientConfig without circular dependencies. -type ConfigProvider interface { - ClientConfig(serviceName string, cfgs ...*aws.Config) Config -} - -// ConfigNoResolveEndpointProvider same as ConfigProvider except it will not -// resolve the endpoint automatically. The service client's endpoint must be -// provided via the aws.Config.Endpoint field. -type ConfigNoResolveEndpointProvider interface { - ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) Config -} - -// A Client implements the base client request and response handling -// used by all service clients. -type Client struct { - request.Retryer - metadata.ClientInfo - - Config aws.Config - Handlers request.Handlers -} - -// New will return a pointer to a new initialized service client. -func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client { - svc := &Client{ - Config: cfg, - ClientInfo: info, - Handlers: handlers.Copy(), - } - - switch retryer, ok := cfg.Retryer.(request.Retryer); { - case ok: - svc.Retryer = retryer - case cfg.Retryer != nil && cfg.Logger != nil: - s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer) - cfg.Logger.Log(s) - fallthrough - default: - maxRetries := aws.IntValue(cfg.MaxRetries) - if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = DefaultRetryerMaxNumRetries - } - svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} - } - - svc.AddDebugHandlers() - - for _, option := range options { - option(svc) - } - - return svc -} - -// NewRequest returns a new Request pointer for the service API -// operation and parameters. -func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request { - return request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data) -} - -// AddDebugHandlers injects debug logging handlers into the service to log request -// debug information. -func (c *Client) AddDebugHandlers() { - if !c.Config.LogLevel.AtLeast(aws.LogDebug) { - return - } - - c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler) - c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go deleted file mode 100644 index 9f6af19dd4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go +++ /dev/null @@ -1,177 +0,0 @@ -package client - -import ( - "math" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkrand" -) - -// DefaultRetryer implements basic retry logic using exponential backoff for -// most services. If you want to implement custom retry logic, you can implement the -// request.Retryer interface. -// -type DefaultRetryer struct { - // Num max Retries is the number of max retries that will be performed. - // By default, this is zero. - NumMaxRetries int - - // MinRetryDelay is the minimum retry delay after which retry will be performed. - // If not set, the value is 0ns. - MinRetryDelay time.Duration - - // MinThrottleRetryDelay is the minimum retry delay when throttled. - // If not set, the value is 0ns. - MinThrottleDelay time.Duration - - // MaxRetryDelay is the maximum retry delay before which retry must be performed. - // If not set, the value is 0ns. - MaxRetryDelay time.Duration - - // MaxThrottleDelay is the maximum retry delay when throttled. - // If not set, the value is 0ns. - MaxThrottleDelay time.Duration -} - -const ( - // DefaultRetryerMaxNumRetries sets maximum number of retries - DefaultRetryerMaxNumRetries = 3 - - // DefaultRetryerMinRetryDelay sets minimum retry delay - DefaultRetryerMinRetryDelay = 30 * time.Millisecond - - // DefaultRetryerMinThrottleDelay sets minimum delay when throttled - DefaultRetryerMinThrottleDelay = 500 * time.Millisecond - - // DefaultRetryerMaxRetryDelay sets maximum retry delay - DefaultRetryerMaxRetryDelay = 300 * time.Second - - // DefaultRetryerMaxThrottleDelay sets maximum delay when throttled - DefaultRetryerMaxThrottleDelay = 300 * time.Second -) - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API request. -func (d DefaultRetryer) MaxRetries() int { - return d.NumMaxRetries -} - -// setRetryerDefaults sets the default values of the retryer if not set -func (d *DefaultRetryer) setRetryerDefaults() { - if d.MinRetryDelay == 0 { - d.MinRetryDelay = DefaultRetryerMinRetryDelay - } - if d.MaxRetryDelay == 0 { - d.MaxRetryDelay = DefaultRetryerMaxRetryDelay - } - if d.MinThrottleDelay == 0 { - d.MinThrottleDelay = DefaultRetryerMinThrottleDelay - } - if d.MaxThrottleDelay == 0 { - d.MaxThrottleDelay = DefaultRetryerMaxThrottleDelay - } -} - -// RetryRules returns the delay duration before retrying this request again -func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { - - // if number of max retries is zero, no retries will be performed. - if d.NumMaxRetries == 0 { - return 0 - } - - // Sets default value for retryer members - d.setRetryerDefaults() - - // minDelay is the minimum retryer delay - minDelay := d.MinRetryDelay - - var initialDelay time.Duration - - isThrottle := r.IsErrorThrottle() - if isThrottle { - if delay, ok := getRetryAfterDelay(r); ok { - initialDelay = delay - } - minDelay = d.MinThrottleDelay - } - - retryCount := r.RetryCount - - // maxDelay the maximum retryer delay - maxDelay := d.MaxRetryDelay - - if isThrottle { - maxDelay = d.MaxThrottleDelay - } - - var delay time.Duration - - // Logic to cap the retry count based on the minDelay provided - actualRetryCount := int(math.Log2(float64(minDelay))) + 1 - if actualRetryCount < 63-retryCount { - delay = time.Duration(1< maxDelay { - delay = getJitterDelay(maxDelay / 2) - } - } else { - delay = getJitterDelay(maxDelay / 2) - } - return delay + initialDelay -} - -// getJitterDelay returns a jittered delay for retry -func getJitterDelay(duration time.Duration) time.Duration { - return time.Duration(sdkrand.SeededRand.Int63n(int64(duration)) + int64(duration)) -} - -// ShouldRetry returns true if the request should be retried. -func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { - - // ShouldRetry returns false if number of max retries is 0. - if d.NumMaxRetries == 0 { - return false - } - - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable != nil { - return *r.Retryable - } - return r.IsErrorRetryable() || r.IsErrorThrottle() -} - -// This will look in the Retry-After header, RFC 7231, for how long -// it will wait before attempting another request -func getRetryAfterDelay(r *request.Request) (time.Duration, bool) { - if !canUseRetryAfterHeader(r) { - return 0, false - } - - delayStr := r.HTTPResponse.Header.Get("Retry-After") - if len(delayStr) == 0 { - return 0, false - } - - delay, err := strconv.Atoi(delayStr) - if err != nil { - return 0, false - } - - return time.Duration(delay) * time.Second, true -} - -// Will look at the status code to see if the retry header pertains to -// the status code. -func canUseRetryAfterHeader(r *request.Request) bool { - switch r.HTTPResponse.StatusCode { - case 429: - case 503: - default: - return false - } - - return true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go deleted file mode 100644 index 8958c32d4e..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go +++ /dev/null @@ -1,194 +0,0 @@ -package client - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http/httputil" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -const logReqMsg = `DEBUG: Request %s/%s Details: ----[ REQUEST POST-SIGN ]----------------------------- -%s ------------------------------------------------------` - -const logReqErrMsg = `DEBUG ERROR: Request %s/%s: ----[ REQUEST DUMP ERROR ]----------------------------- -%s -------------------------------------------------------` - -type logWriter struct { - // Logger is what we will use to log the payload of a response. - Logger aws.Logger - // buf stores the contents of what has been read - buf *bytes.Buffer -} - -func (logger *logWriter) Write(b []byte) (int, error) { - return logger.buf.Write(b) -} - -type teeReaderCloser struct { - // io.Reader will be a tee reader that is used during logging. - // This structure will read from a body and write the contents to a logger. - io.Reader - // Source is used just to close when we are done reading. - Source io.ReadCloser -} - -func (reader *teeReaderCloser) Close() error { - return reader.Source.Close() -} - -// LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent -// to a service. Will include the HTTP request body if the LogLevel of the -// request matches LogDebugWithHTTPBody. -var LogHTTPRequestHandler = request.NamedHandler{ - Name: "awssdk.client.LogRequest", - Fn: logRequest, -} - -func logRequest(r *request.Request) { - logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) - bodySeekable := aws.IsReaderSeekable(r.Body) - - b, err := httputil.DumpRequestOut(r.HTTPRequest, logBody) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - if logBody { - if !bodySeekable { - r.SetReaderBody(aws.ReadSeekCloser(r.HTTPRequest.Body)) - } - // Reset the request body because dumpRequest will re-wrap the - // r.HTTPRequest's Body as a NoOpCloser and will not be reset after - // read by the HTTP client reader. - if err := r.Error; err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - } - - r.Config.Logger.Log(fmt.Sprintf(logReqMsg, - r.ClientInfo.ServiceName, r.Operation.Name, string(b))) -} - -// LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent -// to a service. Will only log the HTTP request's headers. The request payload -// will not be read. -var LogHTTPRequestHeaderHandler = request.NamedHandler{ - Name: "awssdk.client.LogRequestHeader", - Fn: logRequestHeader, -} - -func logRequestHeader(r *request.Request) { - b, err := httputil.DumpRequestOut(r.HTTPRequest, false) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - r.Config.Logger.Log(fmt.Sprintf(logReqMsg, - r.ClientInfo.ServiceName, r.Operation.Name, string(b))) -} - -const logRespMsg = `DEBUG: Response %s/%s Details: ----[ RESPONSE ]-------------------------------------- -%s ------------------------------------------------------` - -const logRespErrMsg = `DEBUG ERROR: Response %s/%s: ----[ RESPONSE DUMP ERROR ]----------------------------- -%s ------------------------------------------------------` - -// LogHTTPResponseHandler is a SDK request handler to log the HTTP response -// received from a service. Will include the HTTP response body if the LogLevel -// of the request matches LogDebugWithHTTPBody. -var LogHTTPResponseHandler = request.NamedHandler{ - Name: "awssdk.client.LogResponse", - Fn: logResponse, -} - -func logResponse(r *request.Request) { - lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} - - if r.HTTPResponse == nil { - lw.Logger.Log(fmt.Sprintf(logRespErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, "request's HTTPResponse is nil")) - return - } - - logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) - if logBody { - r.HTTPResponse.Body = &teeReaderCloser{ - Reader: io.TeeReader(r.HTTPResponse.Body, lw), - Source: r.HTTPResponse.Body, - } - } - - handlerFn := func(req *request.Request) { - b, err := httputil.DumpResponse(req.HTTPResponse, false) - if err != nil { - lw.Logger.Log(fmt.Sprintf(logRespErrMsg, - req.ClientInfo.ServiceName, req.Operation.Name, err)) - return - } - - lw.Logger.Log(fmt.Sprintf(logRespMsg, - req.ClientInfo.ServiceName, req.Operation.Name, string(b))) - - if logBody { - b, err := ioutil.ReadAll(lw.buf) - if err != nil { - lw.Logger.Log(fmt.Sprintf(logRespErrMsg, - req.ClientInfo.ServiceName, req.Operation.Name, err)) - return - } - - lw.Logger.Log(string(b)) - } - } - - const handlerName = "awsdk.client.LogResponse.ResponseBody" - - r.Handlers.Unmarshal.SetBackNamed(request.NamedHandler{ - Name: handlerName, Fn: handlerFn, - }) - r.Handlers.UnmarshalError.SetBackNamed(request.NamedHandler{ - Name: handlerName, Fn: handlerFn, - }) -} - -// LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP -// response received from a service. Will only log the HTTP response's headers. -// The response payload will not be read. -var LogHTTPResponseHeaderHandler = request.NamedHandler{ - Name: "awssdk.client.LogResponseHeader", - Fn: logResponseHeader, -} - -func logResponseHeader(r *request.Request) { - if r.Config.Logger == nil { - return - } - - b, err := httputil.DumpResponse(r.HTTPResponse, false) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - r.Config.Logger.Log(fmt.Sprintf(logRespMsg, - r.ClientInfo.ServiceName, r.Operation.Name, string(b))) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go deleted file mode 100644 index 0c48f72e08..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go +++ /dev/null @@ -1,14 +0,0 @@ -package metadata - -// ClientInfo wraps immutable data from the client.Client structure. -type ClientInfo struct { - ServiceName string - ServiceID string - APIVersion string - PartitionID string - Endpoint string - SigningName string - SigningRegion string - JSONVersion string - TargetPrefix string -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go deleted file mode 100644 index 881d575f01..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws/request" -) - -// NoOpRetryer provides a retryer that performs no retries. -// It should be used when we do not want retries to be performed. -type NoOpRetryer struct{} - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API; For NoOpRetryer the MaxRetries will always be zero. -func (d NoOpRetryer) MaxRetries() int { - return 0 -} - -// ShouldRetry will always return false for NoOpRetryer, as it should never retry. -func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { - return false -} - -// RetryRules returns the delay duration before retrying this request again; -// since NoOpRetryer does not retry, RetryRules always returns 0. -func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { - return 0 -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/config.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/config.go deleted file mode 100644 index 39fa6d5fe7..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ /dev/null @@ -1,605 +0,0 @@ -package aws - -import ( - "net/http" - "time" - - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/endpoints" -) - -// UseServiceDefaultRetries instructs the config to use the service's own -// default number of retries. This will be the default action if -// Config.MaxRetries is nil also. -const UseServiceDefaultRetries = -1 - -// RequestRetryer is an alias for a type that implements the request.Retryer -// interface. -type RequestRetryer interface{} - -// A Config provides service configuration for service clients. By default, -// all clients will use the defaults.DefaultConfig structure. -// -// // Create Session with MaxRetries configuration to be shared by multiple -// // service clients. -// sess := session.Must(session.NewSession(&aws.Config{ -// MaxRetries: aws.Int(3), -// })) -// -// // Create S3 service client with a specific Region. -// svc := s3.New(sess, &aws.Config{ -// Region: aws.String("us-west-2"), -// }) -type Config struct { - // Enables verbose error printing of all credential chain errors. - // Should be used when wanting to see all errors while attempting to - // retrieve credentials. - CredentialsChainVerboseErrors *bool - - // The credentials object to use when signing requests. Defaults to a - // chain of credential providers to search for credentials in environment - // variables, shared credential file, and EC2 Instance Roles. - Credentials *credentials.Credentials - - // An optional endpoint URL (hostname only or fully qualified URI) - // that overrides the default generated endpoint for a client. Set this - // to `nil` or the value to `""` to use the default generated endpoint. - // - // Note: You must still provide a `Region` value when specifying an - // endpoint for a client. - Endpoint *string - - // The resolver to use for looking up endpoints for AWS service clients - // to use based on region. - EndpointResolver endpoints.Resolver - - // EnforceShouldRetryCheck is used in the AfterRetryHandler to always call - // ShouldRetry regardless of whether or not if request.Retryable is set. - // This will utilize ShouldRetry method of custom retryers. If EnforceShouldRetryCheck - // is not set, then ShouldRetry will only be called if request.Retryable is nil. - // Proper handling of the request.Retryable field is important when setting this field. - EnforceShouldRetryCheck *bool - - // The region to send requests to. This parameter is required and must - // be configured globally or on a per-client basis unless otherwise - // noted. A full list of regions is found in the "Regions and Endpoints" - // document. - // - // See http://docs.aws.amazon.com/general/latest/gr/rande.html for AWS - // Regions and Endpoints. - Region *string - - // Set this to `true` to disable SSL when sending requests. Defaults - // to `false`. - DisableSSL *bool - - // The HTTP client to use when sending requests. Defaults to - // `http.DefaultClient`. - HTTPClient *http.Client - - // An integer value representing the logging level. The default log level - // is zero (LogOff), which represents no logging. To enable logging set - // to a LogLevel Value. - LogLevel *LogLevelType - - // The logger writer interface to write logging messages to. Defaults to - // standard out. - Logger Logger - - // The maximum number of times that a request will be retried for failures. - // Defaults to -1, which defers the max retry setting to the service - // specific configuration. - MaxRetries *int - - // Retryer guides how HTTP requests should be retried in case of - // recoverable failures. - // - // When nil or the value does not implement the request.Retryer interface, - // the client.DefaultRetryer will be used. - // - // When both Retryer and MaxRetries are non-nil, the former is used and - // the latter ignored. - // - // To set the Retryer field in a type-safe manner and with chaining, use - // the request.WithRetryer helper function: - // - // cfg := request.WithRetryer(aws.NewConfig(), myRetryer) - // - Retryer RequestRetryer - - // Disables semantic parameter validation, which validates input for - // missing required fields and/or other semantic request input errors. - DisableParamValidation *bool - - // Disables the computation of request and response checksums, e.g., - // CRC32 checksums in Amazon DynamoDB. - DisableComputeChecksums *bool - - // Set this to `true` to force the request to use path-style addressing, - // i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client - // will use virtual hosted bucket addressing when possible - // (`http://BUCKET.s3.amazonaws.com/KEY`). - // - // Note: This configuration option is specific to the Amazon S3 service. - // - // See http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html - // for Amazon S3: Virtual Hosting of Buckets - S3ForcePathStyle *bool - - // Set this to `true` to disable the SDK adding the `Expect: 100-Continue` - // header to PUT requests over 2MB of content. 100-Continue instructs the - // HTTP client not to send the body until the service responds with a - // `continue` status. This is useful to prevent sending the request body - // until after the request is authenticated, and validated. - // - // http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html - // - // 100-Continue is only enabled for Go 1.6 and above. See `http.Transport`'s - // `ExpectContinueTimeout` for information on adjusting the continue wait - // timeout. https://golang.org/pkg/net/http/#Transport - // - // You should use this flag to disable 100-Continue if you experience issues - // with proxies or third party S3 compatible services. - S3Disable100Continue *bool - - // Set this to `true` to enable S3 Accelerate feature. For all operations - // compatible with S3 Accelerate will use the accelerate endpoint for - // requests. Requests not compatible will fall back to normal S3 requests. - // - // The bucket must be enable for accelerate to be used with S3 client with - // accelerate enabled. If the bucket is not enabled for accelerate an error - // will be returned. The bucket name must be DNS compatible to also work - // with accelerate. - S3UseAccelerate *bool - - // S3DisableContentMD5Validation config option is temporarily disabled, - // For S3 GetObject API calls, #1837. - // - // Set this to `true` to disable the S3 service client from automatically - // adding the ContentMD5 to S3 Object Put and Upload API calls. This option - // will also disable the SDK from performing object ContentMD5 validation - // on GetObject API calls. - S3DisableContentMD5Validation *bool - - // Set this to `true` to have the S3 service client to use the region specified - // in the ARN, when an ARN is provided as an argument to a bucket parameter. - S3UseARNRegion *bool - - // Set this to `true` to enable the SDK to unmarshal API response header maps to - // normalized lower case map keys. - // - // For example S3's X-Amz-Meta prefixed header will be unmarshaled to lower case - // Metadata member's map keys. The value of the header in the map is unaffected. - LowerCaseHeaderMaps *bool - - // Set this to `true` to disable the EC2Metadata client from overriding the - // default http.Client's Timeout. This is helpful if you do not want the - // EC2Metadata client to create a new http.Client. This options is only - // meaningful if you're not already using a custom HTTP client with the - // SDK. Enabled by default. - // - // Must be set and provided to the session.NewSession() in order to disable - // the EC2Metadata overriding the timeout for default credentials chain. - // - // Example: - // sess := session.Must(session.NewSession(aws.NewConfig() - // .WithEC2MetadataDisableTimeoutOverride(true))) - // - // svc := s3.New(sess) - // - EC2MetadataDisableTimeoutOverride *bool - - // Instructs the endpoint to be generated for a service client to - // be the dual stack endpoint. The dual stack endpoint will support - // both IPv4 and IPv6 addressing. - // - // Setting this for a service which does not support dual stack will fail - // to make requests. It is not recommended to set this value on the session - // as it will apply to all service clients created with the session. Even - // services which don't support dual stack endpoints. - // - // If the Endpoint config value is also provided the UseDualStack flag - // will be ignored. - // - // Only supported with. - // - // sess := session.Must(session.NewSession()) - // - // svc := s3.New(sess, &aws.Config{ - // UseDualStack: aws.Bool(true), - // }) - UseDualStack *bool - - // SleepDelay is an override for the func the SDK will call when sleeping - // during the lifecycle of a request. Specifically this will be used for - // request delays. This value should only be used for testing. To adjust - // the delay of a request see the aws/client.DefaultRetryer and - // aws/request.Retryer. - // - // SleepDelay will prevent any Context from being used for canceling retry - // delay of an API operation. It is recommended to not use SleepDelay at all - // and specify a Retryer instead. - SleepDelay func(time.Duration) - - // DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests. - // Will default to false. This would only be used for empty directory names in s3 requests. - // - // Example: - // sess := session.Must(session.NewSession(&aws.Config{ - // DisableRestProtocolURICleaning: aws.Bool(true), - // })) - // - // svc := s3.New(sess) - // out, err := svc.GetObject(&s3.GetObjectInput { - // Bucket: aws.String("bucketname"), - // Key: aws.String("//foo//bar//moo"), - // }) - DisableRestProtocolURICleaning *bool - - // EnableEndpointDiscovery will allow for endpoint discovery on operations that - // have the definition in its model. By default, endpoint discovery is off. - // To use EndpointDiscovery, Endpoint should be unset or set to an empty string. - // - // Example: - // sess := session.Must(session.NewSession(&aws.Config{ - // EnableEndpointDiscovery: aws.Bool(true), - // })) - // - // svc := s3.New(sess) - // out, err := svc.GetObject(&s3.GetObjectInput { - // Bucket: aws.String("bucketname"), - // Key: aws.String("/foo/bar/moo"), - // }) - EnableEndpointDiscovery *bool - - // DisableEndpointHostPrefix will disable the SDK's behavior of prefixing - // request endpoint hosts with modeled information. - // - // Disabling this feature is useful when you want to use local endpoints - // for testing that do not support the modeled host prefix pattern. - DisableEndpointHostPrefix *bool - - // STSRegionalEndpoint will enable regional or legacy endpoint resolving - STSRegionalEndpoint endpoints.STSRegionalEndpoint - - // S3UsEast1RegionalEndpoint will enable regional or legacy endpoint resolving - S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint -} - -// NewConfig returns a new Config pointer that can be chained with builder -// methods to set multiple configuration values inline without using pointers. -// -// // Create Session with MaxRetries configuration to be shared by multiple -// // service clients. -// sess := session.Must(session.NewSession(aws.NewConfig(). -// WithMaxRetries(3), -// )) -// -// // Create S3 service client with a specific Region. -// svc := s3.New(sess, aws.NewConfig(). -// WithRegion("us-west-2"), -// ) -func NewConfig() *Config { - return &Config{} -} - -// WithCredentialsChainVerboseErrors sets a config verbose errors boolean and returning -// a Config pointer. -func (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config { - c.CredentialsChainVerboseErrors = &verboseErrs - return c -} - -// WithCredentials sets a config Credentials value returning a Config pointer -// for chaining. -func (c *Config) WithCredentials(creds *credentials.Credentials) *Config { - c.Credentials = creds - return c -} - -// WithEndpoint sets a config Endpoint value returning a Config pointer for -// chaining. -func (c *Config) WithEndpoint(endpoint string) *Config { - c.Endpoint = &endpoint - return c -} - -// WithEndpointResolver sets a config EndpointResolver value returning a -// Config pointer for chaining. -func (c *Config) WithEndpointResolver(resolver endpoints.Resolver) *Config { - c.EndpointResolver = resolver - return c -} - -// WithRegion sets a config Region value returning a Config pointer for -// chaining. -func (c *Config) WithRegion(region string) *Config { - c.Region = ®ion - return c -} - -// WithDisableSSL sets a config DisableSSL value returning a Config pointer -// for chaining. -func (c *Config) WithDisableSSL(disable bool) *Config { - c.DisableSSL = &disable - return c -} - -// WithHTTPClient sets a config HTTPClient value returning a Config pointer -// for chaining. -func (c *Config) WithHTTPClient(client *http.Client) *Config { - c.HTTPClient = client - return c -} - -// WithMaxRetries sets a config MaxRetries value returning a Config pointer -// for chaining. -func (c *Config) WithMaxRetries(max int) *Config { - c.MaxRetries = &max - return c -} - -// WithDisableParamValidation sets a config DisableParamValidation value -// returning a Config pointer for chaining. -func (c *Config) WithDisableParamValidation(disable bool) *Config { - c.DisableParamValidation = &disable - return c -} - -// WithDisableComputeChecksums sets a config DisableComputeChecksums value -// returning a Config pointer for chaining. -func (c *Config) WithDisableComputeChecksums(disable bool) *Config { - c.DisableComputeChecksums = &disable - return c -} - -// WithLogLevel sets a config LogLevel value returning a Config pointer for -// chaining. -func (c *Config) WithLogLevel(level LogLevelType) *Config { - c.LogLevel = &level - return c -} - -// WithLogger sets a config Logger value returning a Config pointer for -// chaining. -func (c *Config) WithLogger(logger Logger) *Config { - c.Logger = logger - return c -} - -// WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config -// pointer for chaining. -func (c *Config) WithS3ForcePathStyle(force bool) *Config { - c.S3ForcePathStyle = &force - return c -} - -// WithS3Disable100Continue sets a config S3Disable100Continue value returning -// a Config pointer for chaining. -func (c *Config) WithS3Disable100Continue(disable bool) *Config { - c.S3Disable100Continue = &disable - return c -} - -// WithS3UseAccelerate sets a config S3UseAccelerate value returning a Config -// pointer for chaining. -func (c *Config) WithS3UseAccelerate(enable bool) *Config { - c.S3UseAccelerate = &enable - return c - -} - -// WithS3DisableContentMD5Validation sets a config -// S3DisableContentMD5Validation value returning a Config pointer for chaining. -func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config { - c.S3DisableContentMD5Validation = &enable - return c - -} - -// WithS3UseARNRegion sets a config S3UseARNRegion value and -// returning a Config pointer for chaining -func (c *Config) WithS3UseARNRegion(enable bool) *Config { - c.S3UseARNRegion = &enable - return c -} - -// WithUseDualStack sets a config UseDualStack value returning a Config -// pointer for chaining. -func (c *Config) WithUseDualStack(enable bool) *Config { - c.UseDualStack = &enable - return c -} - -// WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value -// returning a Config pointer for chaining. -func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config { - c.EC2MetadataDisableTimeoutOverride = &enable - return c -} - -// WithSleepDelay overrides the function used to sleep while waiting for the -// next retry. Defaults to time.Sleep. -func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config { - c.SleepDelay = fn - return c -} - -// WithEndpointDiscovery will set whether or not to use endpoint discovery. -func (c *Config) WithEndpointDiscovery(t bool) *Config { - c.EnableEndpointDiscovery = &t - return c -} - -// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix -// when making requests. -func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config { - c.DisableEndpointHostPrefix = &t - return c -} - -// WithSTSRegionalEndpoint will set whether or not to use regional endpoint flag -// when resolving the endpoint for a service -func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config { - c.STSRegionalEndpoint = sre - return c -} - -// WithS3UsEast1RegionalEndpoint will set whether or not to use regional endpoint flag -// when resolving the endpoint for a service -func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEndpoint) *Config { - c.S3UsEast1RegionalEndpoint = sre - return c -} - -// WithLowerCaseHeaderMaps sets a config LowerCaseHeaderMaps value -// returning a Config pointer for chaining. -func (c *Config) WithLowerCaseHeaderMaps(t bool) *Config { - c.LowerCaseHeaderMaps = &t - return c -} - -// WithDisableRestProtocolURICleaning sets a config DisableRestProtocolURICleaning value -// returning a Config pointer for chaining. -func (c *Config) WithDisableRestProtocolURICleaning(t bool) *Config { - c.DisableRestProtocolURICleaning = &t - return c -} - -// MergeIn merges the passed in configs into the existing config object. -func (c *Config) MergeIn(cfgs ...*Config) { - for _, other := range cfgs { - mergeInConfig(c, other) - } -} - -func mergeInConfig(dst *Config, other *Config) { - if other == nil { - return - } - - if other.CredentialsChainVerboseErrors != nil { - dst.CredentialsChainVerboseErrors = other.CredentialsChainVerboseErrors - } - - if other.Credentials != nil { - dst.Credentials = other.Credentials - } - - if other.Endpoint != nil { - dst.Endpoint = other.Endpoint - } - - if other.EndpointResolver != nil { - dst.EndpointResolver = other.EndpointResolver - } - - if other.Region != nil { - dst.Region = other.Region - } - - if other.DisableSSL != nil { - dst.DisableSSL = other.DisableSSL - } - - if other.HTTPClient != nil { - dst.HTTPClient = other.HTTPClient - } - - if other.LogLevel != nil { - dst.LogLevel = other.LogLevel - } - - if other.Logger != nil { - dst.Logger = other.Logger - } - - if other.MaxRetries != nil { - dst.MaxRetries = other.MaxRetries - } - - if other.Retryer != nil { - dst.Retryer = other.Retryer - } - - if other.DisableParamValidation != nil { - dst.DisableParamValidation = other.DisableParamValidation - } - - if other.DisableComputeChecksums != nil { - dst.DisableComputeChecksums = other.DisableComputeChecksums - } - - if other.S3ForcePathStyle != nil { - dst.S3ForcePathStyle = other.S3ForcePathStyle - } - - if other.S3Disable100Continue != nil { - dst.S3Disable100Continue = other.S3Disable100Continue - } - - if other.S3UseAccelerate != nil { - dst.S3UseAccelerate = other.S3UseAccelerate - } - - if other.S3DisableContentMD5Validation != nil { - dst.S3DisableContentMD5Validation = other.S3DisableContentMD5Validation - } - - if other.S3UseARNRegion != nil { - dst.S3UseARNRegion = other.S3UseARNRegion - } - - if other.UseDualStack != nil { - dst.UseDualStack = other.UseDualStack - } - - if other.EC2MetadataDisableTimeoutOverride != nil { - dst.EC2MetadataDisableTimeoutOverride = other.EC2MetadataDisableTimeoutOverride - } - - if other.SleepDelay != nil { - dst.SleepDelay = other.SleepDelay - } - - if other.DisableRestProtocolURICleaning != nil { - dst.DisableRestProtocolURICleaning = other.DisableRestProtocolURICleaning - } - - if other.EnforceShouldRetryCheck != nil { - dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck - } - - if other.EnableEndpointDiscovery != nil { - dst.EnableEndpointDiscovery = other.EnableEndpointDiscovery - } - - if other.DisableEndpointHostPrefix != nil { - dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix - } - - if other.STSRegionalEndpoint != endpoints.UnsetSTSEndpoint { - dst.STSRegionalEndpoint = other.STSRegionalEndpoint - } - - if other.S3UsEast1RegionalEndpoint != endpoints.UnsetS3UsEast1Endpoint { - dst.S3UsEast1RegionalEndpoint = other.S3UsEast1RegionalEndpoint - } - - if other.LowerCaseHeaderMaps != nil { - dst.LowerCaseHeaderMaps = other.LowerCaseHeaderMaps - } -} - -// Copy will return a shallow copy of the Config object. If any additional -// configurations are provided they will be merged into the new config returned. -func (c *Config) Copy(cfgs ...*Config) *Config { - dst := &Config{} - dst.MergeIn(c) - - for _, cfg := range cfgs { - dst.MergeIn(cfg) - } - - return dst -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go deleted file mode 100644 index 2866f9a7fb..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build !go1.9 - -package aws - -import "time" - -// Context is an copy of the Go v1.7 stdlib's context.Context interface. -// It is represented as a SDK interface to enable you to use the "WithContext" -// API methods with Go v1.6 and a Context type such as golang.org/x/net/context. -// -// See https://golang.org/pkg/context on how to use contexts. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - Value(key interface{}) interface{} -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go deleted file mode 100644 index 3718b26e10..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build go1.9 - -package aws - -import "context" - -// Context is an alias of the Go stdlib's context.Context interface. -// It can be used within the SDK's API operation "WithContext" methods. -// -// See https://golang.org/pkg/context on how to use contexts. -type Context = context.Context diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go deleted file mode 100644 index 2f9446333a..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build !go1.7 - -package aws - -import ( - "github.com/aws/aws-sdk-go/internal/context" -) - -// BackgroundContext returns a context that will never be canceled, has no -// values, and no deadline. This context is used by the SDK to provide -// backwards compatibility with non-context API operations and functionality. -// -// Go 1.6 and before: -// This context function is equivalent to context.Background in the Go stdlib. -// -// Go 1.7 and later: -// The context returned will be the value returned by context.Background() -// -// See https://golang.org/pkg/context for more information on Contexts. -func BackgroundContext() Context { - return context.BackgroundCtx -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go deleted file mode 100644 index 9c29f29af1..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build go1.7 - -package aws - -import "context" - -// BackgroundContext returns a context that will never be canceled, has no -// values, and no deadline. This context is used by the SDK to provide -// backwards compatibility with non-context API operations and functionality. -// -// Go 1.6 and before: -// This context function is equivalent to context.Background in the Go stdlib. -// -// Go 1.7 and later: -// The context returned will be the value returned by context.Background() -// -// See https://golang.org/pkg/context for more information on Contexts. -func BackgroundContext() Context { - return context.Background() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go deleted file mode 100644 index 304fd15612..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go +++ /dev/null @@ -1,24 +0,0 @@ -package aws - -import ( - "time" -) - -// SleepWithContext will wait for the timer duration to expire, or the context -// is canceled. Which ever happens first. If the context is canceled the Context's -// error will be returned. -// -// Expects Context to always return a non-nil error if the Done channel is closed. -func SleepWithContext(ctx Context, dur time.Duration) error { - t := time.NewTimer(dur) - defer t.Stop() - - select { - case <-t.C: - break - case <-ctx.Done(): - return ctx.Err() - } - - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go deleted file mode 100644 index 4e076c1837..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go +++ /dev/null @@ -1,918 +0,0 @@ -package aws - -import "time" - -// String returns a pointer to the string value passed in. -func String(v string) *string { - return &v -} - -// StringValue returns the value of the string pointer passed in or -// "" if the pointer is nil. -func StringValue(v *string) string { - if v != nil { - return *v - } - return "" -} - -// StringSlice converts a slice of string values into a slice of -// string pointers -func StringSlice(src []string) []*string { - dst := make([]*string, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// StringValueSlice converts a slice of string pointers into a slice of -// string values -func StringValueSlice(src []*string) []string { - dst := make([]string, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// StringMap converts a string map of string values into a string -// map of string pointers -func StringMap(src map[string]string) map[string]*string { - dst := make(map[string]*string) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// StringValueMap converts a string map of string pointers into a string -// map of string values -func StringValueMap(src map[string]*string) map[string]string { - dst := make(map[string]string) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Bool returns a pointer to the bool value passed in. -func Bool(v bool) *bool { - return &v -} - -// BoolValue returns the value of the bool pointer passed in or -// false if the pointer is nil. -func BoolValue(v *bool) bool { - if v != nil { - return *v - } - return false -} - -// BoolSlice converts a slice of bool values into a slice of -// bool pointers -func BoolSlice(src []bool) []*bool { - dst := make([]*bool, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// BoolValueSlice converts a slice of bool pointers into a slice of -// bool values -func BoolValueSlice(src []*bool) []bool { - dst := make([]bool, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// BoolMap converts a string map of bool values into a string -// map of bool pointers -func BoolMap(src map[string]bool) map[string]*bool { - dst := make(map[string]*bool) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// BoolValueMap converts a string map of bool pointers into a string -// map of bool values -func BoolValueMap(src map[string]*bool) map[string]bool { - dst := make(map[string]bool) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int returns a pointer to the int value passed in. -func Int(v int) *int { - return &v -} - -// IntValue returns the value of the int pointer passed in or -// 0 if the pointer is nil. -func IntValue(v *int) int { - if v != nil { - return *v - } - return 0 -} - -// IntSlice converts a slice of int values into a slice of -// int pointers -func IntSlice(src []int) []*int { - dst := make([]*int, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// IntValueSlice converts a slice of int pointers into a slice of -// int values -func IntValueSlice(src []*int) []int { - dst := make([]int, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// IntMap converts a string map of int values into a string -// map of int pointers -func IntMap(src map[string]int) map[string]*int { - dst := make(map[string]*int) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// IntValueMap converts a string map of int pointers into a string -// map of int values -func IntValueMap(src map[string]*int) map[string]int { - dst := make(map[string]int) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint returns a pointer to the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintValue returns the value of the uint pointer passed in or -// 0 if the pointer is nil. -func UintValue(v *uint) uint { - if v != nil { - return *v - } - return 0 -} - -// UintSlice converts a slice of uint values uinto a slice of -// uint pointers -func UintSlice(src []uint) []*uint { - dst := make([]*uint, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// UintValueSlice converts a slice of uint pointers uinto a slice of -// uint values -func UintValueSlice(src []*uint) []uint { - dst := make([]uint, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// UintMap converts a string map of uint values uinto a string -// map of uint pointers -func UintMap(src map[string]uint) map[string]*uint { - dst := make(map[string]*uint) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// UintValueMap converts a string map of uint pointers uinto a string -// map of uint values -func UintValueMap(src map[string]*uint) map[string]uint { - dst := make(map[string]uint) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int8 returns a pointer to the int8 value passed in. -func Int8(v int8) *int8 { - return &v -} - -// Int8Value returns the value of the int8 pointer passed in or -// 0 if the pointer is nil. -func Int8Value(v *int8) int8 { - if v != nil { - return *v - } - return 0 -} - -// Int8Slice converts a slice of int8 values into a slice of -// int8 pointers -func Int8Slice(src []int8) []*int8 { - dst := make([]*int8, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int8ValueSlice converts a slice of int8 pointers into a slice of -// int8 values -func Int8ValueSlice(src []*int8) []int8 { - dst := make([]int8, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int8Map converts a string map of int8 values into a string -// map of int8 pointers -func Int8Map(src map[string]int8) map[string]*int8 { - dst := make(map[string]*int8) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int8ValueMap converts a string map of int8 pointers into a string -// map of int8 values -func Int8ValueMap(src map[string]*int8) map[string]int8 { - dst := make(map[string]int8) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int16 returns a pointer to the int16 value passed in. -func Int16(v int16) *int16 { - return &v -} - -// Int16Value returns the value of the int16 pointer passed in or -// 0 if the pointer is nil. -func Int16Value(v *int16) int16 { - if v != nil { - return *v - } - return 0 -} - -// Int16Slice converts a slice of int16 values into a slice of -// int16 pointers -func Int16Slice(src []int16) []*int16 { - dst := make([]*int16, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int16ValueSlice converts a slice of int16 pointers into a slice of -// int16 values -func Int16ValueSlice(src []*int16) []int16 { - dst := make([]int16, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int16Map converts a string map of int16 values into a string -// map of int16 pointers -func Int16Map(src map[string]int16) map[string]*int16 { - dst := make(map[string]*int16) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int16ValueMap converts a string map of int16 pointers into a string -// map of int16 values -func Int16ValueMap(src map[string]*int16) map[string]int16 { - dst := make(map[string]int16) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int32 returns a pointer to the int32 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Value returns the value of the int32 pointer passed in or -// 0 if the pointer is nil. -func Int32Value(v *int32) int32 { - if v != nil { - return *v - } - return 0 -} - -// Int32Slice converts a slice of int32 values into a slice of -// int32 pointers -func Int32Slice(src []int32) []*int32 { - dst := make([]*int32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int32ValueSlice converts a slice of int32 pointers into a slice of -// int32 values -func Int32ValueSlice(src []*int32) []int32 { - dst := make([]int32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int32Map converts a string map of int32 values into a string -// map of int32 pointers -func Int32Map(src map[string]int32) map[string]*int32 { - dst := make(map[string]*int32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int32ValueMap converts a string map of int32 pointers into a string -// map of int32 values -func Int32ValueMap(src map[string]*int32) map[string]int32 { - dst := make(map[string]int32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int64 returns a pointer to the int64 value passed in. -func Int64(v int64) *int64 { - return &v -} - -// Int64Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int64Value(v *int64) int64 { - if v != nil { - return *v - } - return 0 -} - -// Int64Slice converts a slice of int64 values into a slice of -// int64 pointers -func Int64Slice(src []int64) []*int64 { - dst := make([]*int64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int64ValueSlice converts a slice of int64 pointers into a slice of -// int64 values -func Int64ValueSlice(src []*int64) []int64 { - dst := make([]int64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int64Map converts a string map of int64 values into a string -// map of int64 pointers -func Int64Map(src map[string]int64) map[string]*int64 { - dst := make(map[string]*int64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int64ValueMap converts a string map of int64 pointers into a string -// map of int64 values -func Int64ValueMap(src map[string]*int64) map[string]int64 { - dst := make(map[string]int64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint8 returns a pointer to the uint8 value passed in. -func Uint8(v uint8) *uint8 { - return &v -} - -// Uint8Value returns the value of the uint8 pointer passed in or -// 0 if the pointer is nil. -func Uint8Value(v *uint8) uint8 { - if v != nil { - return *v - } - return 0 -} - -// Uint8Slice converts a slice of uint8 values into a slice of -// uint8 pointers -func Uint8Slice(src []uint8) []*uint8 { - dst := make([]*uint8, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint8ValueSlice converts a slice of uint8 pointers into a slice of -// uint8 values -func Uint8ValueSlice(src []*uint8) []uint8 { - dst := make([]uint8, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint8Map converts a string map of uint8 values into a string -// map of uint8 pointers -func Uint8Map(src map[string]uint8) map[string]*uint8 { - dst := make(map[string]*uint8) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint8ValueMap converts a string map of uint8 pointers into a string -// map of uint8 values -func Uint8ValueMap(src map[string]*uint8) map[string]uint8 { - dst := make(map[string]uint8) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint16 returns a pointer to the uint16 value passed in. -func Uint16(v uint16) *uint16 { - return &v -} - -// Uint16Value returns the value of the uint16 pointer passed in or -// 0 if the pointer is nil. -func Uint16Value(v *uint16) uint16 { - if v != nil { - return *v - } - return 0 -} - -// Uint16Slice converts a slice of uint16 values into a slice of -// uint16 pointers -func Uint16Slice(src []uint16) []*uint16 { - dst := make([]*uint16, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint16ValueSlice converts a slice of uint16 pointers into a slice of -// uint16 values -func Uint16ValueSlice(src []*uint16) []uint16 { - dst := make([]uint16, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint16Map converts a string map of uint16 values into a string -// map of uint16 pointers -func Uint16Map(src map[string]uint16) map[string]*uint16 { - dst := make(map[string]*uint16) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint16ValueMap converts a string map of uint16 pointers into a string -// map of uint16 values -func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { - dst := make(map[string]uint16) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint32 returns a pointer to the uint32 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Value returns the value of the uint32 pointer passed in or -// 0 if the pointer is nil. -func Uint32Value(v *uint32) uint32 { - if v != nil { - return *v - } - return 0 -} - -// Uint32Slice converts a slice of uint32 values into a slice of -// uint32 pointers -func Uint32Slice(src []uint32) []*uint32 { - dst := make([]*uint32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint32ValueSlice converts a slice of uint32 pointers into a slice of -// uint32 values -func Uint32ValueSlice(src []*uint32) []uint32 { - dst := make([]uint32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint32Map converts a string map of uint32 values into a string -// map of uint32 pointers -func Uint32Map(src map[string]uint32) map[string]*uint32 { - dst := make(map[string]*uint32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint32ValueMap converts a string map of uint32 pointers into a string -// map of uint32 values -func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { - dst := make(map[string]uint32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint64 returns a pointer to the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Value returns the value of the uint64 pointer passed in or -// 0 if the pointer is nil. -func Uint64Value(v *uint64) uint64 { - if v != nil { - return *v - } - return 0 -} - -// Uint64Slice converts a slice of uint64 values into a slice of -// uint64 pointers -func Uint64Slice(src []uint64) []*uint64 { - dst := make([]*uint64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint64ValueSlice converts a slice of uint64 pointers into a slice of -// uint64 values -func Uint64ValueSlice(src []*uint64) []uint64 { - dst := make([]uint64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint64Map converts a string map of uint64 values into a string -// map of uint64 pointers -func Uint64Map(src map[string]uint64) map[string]*uint64 { - dst := make(map[string]*uint64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint64ValueMap converts a string map of uint64 pointers into a string -// map of uint64 values -func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { - dst := make(map[string]uint64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float32 returns a pointer to the float32 value passed in. -func Float32(v float32) *float32 { - return &v -} - -// Float32Value returns the value of the float32 pointer passed in or -// 0 if the pointer is nil. -func Float32Value(v *float32) float32 { - if v != nil { - return *v - } - return 0 -} - -// Float32Slice converts a slice of float32 values into a slice of -// float32 pointers -func Float32Slice(src []float32) []*float32 { - dst := make([]*float32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float32ValueSlice converts a slice of float32 pointers into a slice of -// float32 values -func Float32ValueSlice(src []*float32) []float32 { - dst := make([]float32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float32Map converts a string map of float32 values into a string -// map of float32 pointers -func Float32Map(src map[string]float32) map[string]*float32 { - dst := make(map[string]*float32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float32ValueMap converts a string map of float32 pointers into a string -// map of float32 values -func Float32ValueMap(src map[string]*float32) map[string]float32 { - dst := make(map[string]float32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float64 returns a pointer to the float64 value passed in. -func Float64(v float64) *float64 { - return &v -} - -// Float64Value returns the value of the float64 pointer passed in or -// 0 if the pointer is nil. -func Float64Value(v *float64) float64 { - if v != nil { - return *v - } - return 0 -} - -// Float64Slice converts a slice of float64 values into a slice of -// float64 pointers -func Float64Slice(src []float64) []*float64 { - dst := make([]*float64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float64ValueSlice converts a slice of float64 pointers into a slice of -// float64 values -func Float64ValueSlice(src []*float64) []float64 { - dst := make([]float64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float64Map converts a string map of float64 values into a string -// map of float64 pointers -func Float64Map(src map[string]float64) map[string]*float64 { - dst := make(map[string]*float64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float64ValueMap converts a string map of float64 pointers into a string -// map of float64 values -func Float64ValueMap(src map[string]*float64) map[string]float64 { - dst := make(map[string]float64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Time returns a pointer to the time.Time value passed in. -func Time(v time.Time) *time.Time { - return &v -} - -// TimeValue returns the value of the time.Time pointer passed in or -// time.Time{} if the pointer is nil. -func TimeValue(v *time.Time) time.Time { - if v != nil { - return *v - } - return time.Time{} -} - -// SecondsTimeValue converts an int64 pointer to a time.Time value -// representing seconds since Epoch or time.Time{} if the pointer is nil. -func SecondsTimeValue(v *int64) time.Time { - if v != nil { - return time.Unix((*v / 1000), 0) - } - return time.Time{} -} - -// MillisecondsTimeValue converts an int64 pointer to a time.Time value -// representing milliseconds sinch Epoch or time.Time{} if the pointer is nil. -func MillisecondsTimeValue(v *int64) time.Time { - if v != nil { - return time.Unix(0, (*v * 1000000)) - } - return time.Time{} -} - -// TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". -// The result is undefined if the Unix time cannot be represented by an int64. -// Which includes calling TimeUnixMilli on a zero Time is undefined. -// -// This utility is useful for service API's such as CloudWatch Logs which require -// their unix time values to be in milliseconds. -// -// See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information. -func TimeUnixMilli(t time.Time) int64 { - return t.UnixNano() / int64(time.Millisecond/time.Nanosecond) -} - -// TimeSlice converts a slice of time.Time values into a slice of -// time.Time pointers -func TimeSlice(src []time.Time) []*time.Time { - dst := make([]*time.Time, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// TimeValueSlice converts a slice of time.Time pointers into a slice of -// time.Time values -func TimeValueSlice(src []*time.Time) []time.Time { - dst := make([]time.Time, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// TimeMap converts a string map of time.Time values into a string -// map of time.Time pointers -func TimeMap(src map[string]time.Time) map[string]*time.Time { - dst := make(map[string]*time.Time) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// TimeValueMap converts a string map of time.Time pointers into a string -// map of time.Time values -func TimeValueMap(src map[string]*time.Time) map[string]time.Time { - dst := make(map[string]time.Time) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go deleted file mode 100644 index d95a5eb540..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ /dev/null @@ -1,232 +0,0 @@ -package corehandlers - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "regexp" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" -) - -// Interface for matching types which also have a Len method. -type lener interface { - Len() int -} - -// BuildContentLengthHandler builds the content length of a request based on the body, -// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable -// to determine request body length and no "Content-Length" was specified it will panic. -// -// The Content-Length will only be added to the request if the length of the body -// is greater than 0. If the body is empty or the current `Content-Length` -// header is <= 0, the header will also be stripped. -var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) { - var length int64 - - if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { - length, _ = strconv.ParseInt(slength, 10, 64) - } else { - if r.Body != nil { - var err error - length, err = aws.SeekerLen(r.Body) - if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "failed to get request body's length", err) - return - } - } - } - - if length > 0 { - r.HTTPRequest.ContentLength = length - r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length)) - } else { - r.HTTPRequest.ContentLength = 0 - r.HTTPRequest.Header.Del("Content-Length") - } -}} - -var reStatusCode = regexp.MustCompile(`^(\d{3})`) - -// ValidateReqSigHandler is a request handler to ensure that the request's -// signature doesn't expire before it is sent. This can happen when a request -// is built and signed significantly before it is sent. Or significant delays -// occur when retrying requests that would cause the signature to expire. -var ValidateReqSigHandler = request.NamedHandler{ - Name: "core.ValidateReqSigHandler", - Fn: func(r *request.Request) { - // Unsigned requests are not signed - if r.Config.Credentials == credentials.AnonymousCredentials { - return - } - - signedTime := r.Time - if !r.LastSignedAt.IsZero() { - signedTime = r.LastSignedAt - } - - // 5 minutes to allow for some clock skew/delays in transmission. - // Would be improved with aws/aws-sdk-go#423 - if signedTime.Add(5 * time.Minute).After(time.Now()) { - return - } - - fmt.Println("request expired, resigning") - r.Sign() - }, -} - -// SendHandler is a request handler to send service request using HTTP client. -var SendHandler = request.NamedHandler{ - Name: "core.SendHandler", - Fn: func(r *request.Request) { - sender := sendFollowRedirects - if r.DisableFollowRedirects { - sender = sendWithoutFollowRedirects - } - - if request.NoBody == r.HTTPRequest.Body { - // Strip off the request body if the NoBody reader was used as a - // place holder for a request body. This prevents the SDK from - // making requests with a request body when it would be invalid - // to do so. - // - // Use a shallow copy of the http.Request to ensure the race condition - // of transport on Body will not trigger - reqOrig, reqCopy := r.HTTPRequest, *r.HTTPRequest - reqCopy.Body = nil - r.HTTPRequest = &reqCopy - defer func() { - r.HTTPRequest = reqOrig - }() - } - - var err error - r.HTTPResponse, err = sender(r) - if err != nil { - handleSendError(r, err) - } - }, -} - -func sendFollowRedirects(r *request.Request) (*http.Response, error) { - return r.Config.HTTPClient.Do(r.HTTPRequest) -} - -func sendWithoutFollowRedirects(r *request.Request) (*http.Response, error) { - transport := r.Config.HTTPClient.Transport - if transport == nil { - transport = http.DefaultTransport - } - - return transport.RoundTrip(r.HTTPRequest) -} - -func handleSendError(r *request.Request, err error) { - // Prevent leaking if an HTTPResponse was returned. Clean up - // the body. - if r.HTTPResponse != nil { - r.HTTPResponse.Body.Close() - } - // Capture the case where url.Error is returned for error processing - // response. e.g. 301 without location header comes back as string - // error and r.HTTPResponse is nil. Other URL redirect errors will - // comeback in a similar method. - if e, ok := err.(*url.Error); ok && e.Err != nil { - if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { - code, _ := strconv.ParseInt(s[1], 10, 64) - r.HTTPResponse = &http.Response{ - StatusCode: int(code), - Status: http.StatusText(int(code)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - return - } - } - if r.HTTPResponse == nil { - // Add a dummy request response object to ensure the HTTPResponse - // value is consistent. - r.HTTPResponse = &http.Response{ - StatusCode: int(0), - Status: http.StatusText(int(0)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - } - // Catch all request errors, and let the default retrier determine - // if the error is retryable. - r.Error = awserr.New(request.ErrCodeRequestError, "send request failed", err) - - // Override the error with a context canceled error, if that was canceled. - ctx := r.Context() - select { - case <-ctx.Done(): - r.Error = awserr.New(request.CanceledErrorCode, - "request context canceled", ctx.Err()) - r.Retryable = aws.Bool(false) - default: - } -} - -// ValidateResponseHandler is a request handler to validate service response. -var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { - if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { - // this may be replaced by an UnmarshalError handler - r.Error = awserr.New("UnknownError", "unknown error", nil) - } -}} - -// AfterRetryHandler performs final checks to determine if the request should -// be retried and how long to delay. -var AfterRetryHandler = request.NamedHandler{ - Name: "core.AfterRetryHandler", - Fn: func(r *request.Request) { - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { - r.Retryable = aws.Bool(r.ShouldRetry(r)) - } - - if r.WillRetry() { - r.RetryDelay = r.RetryRules(r) - - if sleepFn := r.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(r.RetryDelay) - } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { - r.Error = awserr.New(request.CanceledErrorCode, - "request context canceled", err) - r.Retryable = aws.Bool(false) - return - } - - // when the expired token exception occurs the credentials - // need to be expired locally so that the next request to - // get credentials will trigger a credentials refresh. - if r.IsErrorExpired() { - r.Config.Credentials.Expire() - } - - r.RetryCount++ - r.Error = nil - } - }} - -// ValidateEndpointHandler is a request handler to validate a request had the -// appropriate Region and Endpoint set. Will set r.Error if the endpoint or -// region is not valid. -var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) { - if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" { - r.Error = aws.ErrMissingRegion - } else if r.ClientInfo.Endpoint == "" { - // Was any endpoint provided by the user, or one was derived by the - // SDK's endpoint resolver? - r.Error = aws.ErrMissingEndpoint - } -}} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go deleted file mode 100644 index 7d50b1557c..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go +++ /dev/null @@ -1,17 +0,0 @@ -package corehandlers - -import "github.com/aws/aws-sdk-go/aws/request" - -// ValidateParametersHandler is a request handler to validate the input parameters. -// Validating parameters only has meaning if done prior to the request being sent. -var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { - if !r.ParamsFilled() { - return - } - - if v, ok := r.Params.(request.Validator); ok { - if err := v.Validate(); err != nil { - r.Error = err - } - } -}} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go deleted file mode 100644 index ab69c7a6f3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go +++ /dev/null @@ -1,37 +0,0 @@ -package corehandlers - -import ( - "os" - "runtime" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// SDKVersionUserAgentHandler is a request handler for adding the SDK Version -// to the user agent. -var SDKVersionUserAgentHandler = request.NamedHandler{ - Name: "core.SDKVersionUserAgentHandler", - Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, - runtime.Version(), runtime.GOOS, runtime.GOARCH), -} - -const execEnvVar = `AWS_EXECUTION_ENV` -const execEnvUAKey = `exec-env` - -// AddHostExecEnvUserAgentHander is a request handler appending the SDK's -// execution environment to the user agent. -// -// If the environment variable AWS_EXECUTION_ENV is set, its value will be -// appended to the user agent string. -var AddHostExecEnvUserAgentHander = request.NamedHandler{ - Name: "core.AddHostExecEnvUserAgentHander", - Fn: func(r *request.Request) { - v := os.Getenv(execEnvVar) - if len(v) == 0 { - return - } - - request.AddToUserAgent(r, execEnvUAKey+"/"+v) - }, -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go deleted file mode 100644 index 3ad1e798df..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go +++ /dev/null @@ -1,100 +0,0 @@ -package credentials - -import ( - "github.com/aws/aws-sdk-go/aws/awserr" -) - -var ( - // ErrNoValidProvidersFoundInChain Is returned when there are no valid - // providers in the ChainProvider. - // - // This has been deprecated. For verbose error messaging set - // aws.Config.CredentialsChainVerboseErrors to true. - ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", - `no valid providers in chain. Deprecated. - For verbose messaging see aws.Config.CredentialsChainVerboseErrors`, - nil) -) - -// A ChainProvider will search for a provider which returns credentials -// and cache that provider until Retrieve is called again. -// -// The ChainProvider provides a way of chaining multiple providers together -// which will pick the first available using priority order of the Providers -// in the list. -// -// If none of the Providers retrieve valid credentials Value, ChainProvider's -// Retrieve() will return the error ErrNoValidProvidersFoundInChain. -// -// If a Provider is found which returns valid credentials Value ChainProvider -// will cache that Provider for all calls to IsExpired(), until Retrieve is -// called again. -// -// Example of ChainProvider to be used with an EnvProvider and EC2RoleProvider. -// In this example EnvProvider will first check if any credentials are available -// via the environment variables. If there are none ChainProvider will check -// the next Provider in the list, EC2RoleProvider in this case. If EC2RoleProvider -// does not return any credentials ChainProvider will return the error -// ErrNoValidProvidersFoundInChain -// -// creds := credentials.NewChainCredentials( -// []credentials.Provider{ -// &credentials.EnvProvider{}, -// &ec2rolecreds.EC2RoleProvider{ -// Client: ec2metadata.New(sess), -// }, -// }) -// -// // Usage of ChainCredentials with aws.Config -// svc := ec2.New(session.Must(session.NewSession(&aws.Config{ -// Credentials: creds, -// }))) -// -type ChainProvider struct { - Providers []Provider - curr Provider - VerboseErrors bool -} - -// NewChainCredentials returns a pointer to a new Credentials object -// wrapping a chain of providers. -func NewChainCredentials(providers []Provider) *Credentials { - return NewCredentials(&ChainProvider{ - Providers: append([]Provider{}, providers...), - }) -} - -// Retrieve returns the credentials value or error if no provider returned -// without error. -// -// If a provider is found it will be cached and any calls to IsExpired() -// will return the expired state of the cached provider. -func (c *ChainProvider) Retrieve() (Value, error) { - var errs []error - for _, p := range c.Providers { - creds, err := p.Retrieve() - if err == nil { - c.curr = p - return creds, nil - } - errs = append(errs, err) - } - c.curr = nil - - var err error - err = ErrNoValidProvidersFoundInChain - if c.VerboseErrors { - err = awserr.NewBatchError("NoCredentialProviders", "no valid providers in chain", errs) - } - return Value{}, err -} - -// IsExpired will returned the expired state of the currently cached provider -// if there is one. If there is no current provider, true will be returned. -func (c *ChainProvider) IsExpired() bool { - if c.curr != nil { - return c.curr.IsExpired() - } - - return true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go deleted file mode 100644 index 5852b26487..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build !go1.7 - -package credentials - -import ( - "github.com/aws/aws-sdk-go/internal/context" -) - -// backgroundContext returns a context that will never be canceled, has no -// values, and no deadline. This context is used by the SDK to provide -// backwards compatibility with non-context API operations and functionality. -// -// Go 1.6 and before: -// This context function is equivalent to context.Background in the Go stdlib. -// -// Go 1.7 and later: -// The context returned will be the value returned by context.Background() -// -// See https://golang.org/pkg/context for more information on Contexts. -func backgroundContext() Context { - return context.BackgroundCtx -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go deleted file mode 100644 index 388b215418..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build go1.7 - -package credentials - -import "context" - -// backgroundContext returns a context that will never be canceled, has no -// values, and no deadline. This context is used by the SDK to provide -// backwards compatibility with non-context API operations and functionality. -// -// Go 1.6 and before: -// This context function is equivalent to context.Background in the Go stdlib. -// -// Go 1.7 and later: -// The context returned will be the value returned by context.Background() -// -// See https://golang.org/pkg/context for more information on Contexts. -func backgroundContext() Context { - return context.Background() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.5.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.5.go deleted file mode 100644 index 8152a864ad..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.5.go +++ /dev/null @@ -1,39 +0,0 @@ -// +build !go1.9 - -package credentials - -import "time" - -// Context is an copy of the Go v1.7 stdlib's context.Context interface. -// It is represented as a SDK interface to enable you to use the "WithContext" -// API methods with Go v1.6 and a Context type such as golang.org/x/net/context. -// -// This type, aws.Context, and context.Context are equivalent. -// -// See https://golang.org/pkg/context on how to use contexts. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - Value(key interface{}) interface{} -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go deleted file mode 100644 index 4356edb3d5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build go1.9 - -package credentials - -import "context" - -// Context is an alias of the Go stdlib's context.Context interface. -// It can be used within the SDK's API operation "WithContext" methods. -// -// This type, aws.Context, and context.Context are equivalent. -// -// See https://golang.org/pkg/context on how to use contexts. -type Context = context.Context diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go deleted file mode 100644 index a880a3de8f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ /dev/null @@ -1,383 +0,0 @@ -// Package credentials provides credential retrieval and management -// -// The Credentials is the primary method of getting access to and managing -// credentials Values. Using dependency injection retrieval of the credential -// values is handled by a object which satisfies the Provider interface. -// -// By default the Credentials.Get() will cache the successful result of a -// Provider's Retrieve() until Provider.IsExpired() returns true. At which -// point Credentials will call Provider's Retrieve() to get new credential Value. -// -// The Provider is responsible for determining when credentials Value have expired. -// It is also important to note that Credentials will always call Retrieve the -// first time Credentials.Get() is called. -// -// Example of using the environment variable credentials. -// -// creds := credentials.NewEnvCredentials() -// -// // Retrieve the credentials value -// credValue, err := creds.Get() -// if err != nil { -// // handle error -// } -// -// Example of forcing credentials to expire and be refreshed on the next Get(). -// This may be helpful to proactively expire credentials and refresh them sooner -// than they would naturally expire on their own. -// -// creds := credentials.NewCredentials(&ec2rolecreds.EC2RoleProvider{}) -// creds.Expire() -// credsValue, err := creds.Get() -// // New credentials will be retrieved instead of from cache. -// -// -// Custom Provider -// -// Each Provider built into this package also provides a helper method to generate -// a Credentials pointer setup with the provider. To use a custom Provider just -// create a type which satisfies the Provider interface and pass it to the -// NewCredentials method. -// -// type MyProvider struct{} -// func (m *MyProvider) Retrieve() (Value, error) {...} -// func (m *MyProvider) IsExpired() bool {...} -// -// creds := credentials.NewCredentials(&MyProvider{}) -// credValue, err := creds.Get() -// -package credentials - -import ( - "fmt" - "sync" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/sync/singleflight" -) - -// AnonymousCredentials is an empty Credential object that can be used as -// dummy placeholder credentials for requests that do not need signed. -// -// This Credentials can be used to configure a service to not sign requests -// when making service API calls. For example, when accessing public -// s3 buckets. -// -// svc := s3.New(session.Must(session.NewSession(&aws.Config{ -// Credentials: credentials.AnonymousCredentials, -// }))) -// // Access public S3 buckets. -var AnonymousCredentials = NewStaticCredentials("", "", "") - -// A Value is the AWS credentials value for individual credential fields. -type Value struct { - // AWS Access key ID - AccessKeyID string - - // AWS Secret Access Key - SecretAccessKey string - - // AWS Session Token - SessionToken string - - // Provider used to get credentials - ProviderName string -} - -// HasKeys returns if the credentials Value has both AccessKeyID and -// SecretAccessKey value set. -func (v Value) HasKeys() bool { - return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0 -} - -// A Provider is the interface for any component which will provide credentials -// Value. A provider is required to manage its own Expired state, and what to -// be expired means. -// -// The Provider should not need to implement its own mutexes, because -// that will be managed by Credentials. -type Provider interface { - // Retrieve returns nil if it successfully retrieved the value. - // Error is returned if the value were not obtainable, or empty. - Retrieve() (Value, error) - - // IsExpired returns if the credentials are no longer valid, and need - // to be retrieved. - IsExpired() bool -} - -// ProviderWithContext is a Provider that can retrieve credentials with a Context -type ProviderWithContext interface { - Provider - - RetrieveWithContext(Context) (Value, error) -} - -// An Expirer is an interface that Providers can implement to expose the expiration -// time, if known. If the Provider cannot accurately provide this info, -// it should not implement this interface. -type Expirer interface { - // The time at which the credentials are no longer valid - ExpiresAt() time.Time -} - -// An ErrorProvider is a stub credentials provider that always returns an error -// this is used by the SDK when construction a known provider is not possible -// due to an error. -type ErrorProvider struct { - // The error to be returned from Retrieve - Err error - - // The provider name to set on the Retrieved returned Value - ProviderName string -} - -// Retrieve will always return the error that the ErrorProvider was created with. -func (p ErrorProvider) Retrieve() (Value, error) { - return Value{ProviderName: p.ProviderName}, p.Err -} - -// IsExpired will always return not expired. -func (p ErrorProvider) IsExpired() bool { - return false -} - -// A Expiry provides shared expiration logic to be used by credentials -// providers to implement expiry functionality. -// -// The best method to use this struct is as an anonymous field within the -// provider's struct. -// -// Example: -// type EC2RoleProvider struct { -// Expiry -// ... -// } -type Expiry struct { - // The date/time when to expire on - expiration time.Time - - // If set will be used by IsExpired to determine the current time. - // Defaults to time.Now if CurrentTime is not set. Available for testing - // to be able to mock out the current time. - CurrentTime func() time.Time -} - -// SetExpiration sets the expiration IsExpired will check when called. -// -// If window is greater than 0 the expiration time will be reduced by the -// window value. -// -// Using a window is helpful to trigger credentials to expire sooner than -// the expiration time given to ensure no requests are made with expired -// tokens. -func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) { - // Passed in expirations should have the monotonic clock values stripped. - // This ensures time comparisons will be based on wall-time. - e.expiration = expiration.Round(0) - if window > 0 { - e.expiration = e.expiration.Add(-window) - } -} - -// IsExpired returns if the credentials are expired. -func (e *Expiry) IsExpired() bool { - curTime := e.CurrentTime - if curTime == nil { - curTime = time.Now - } - return e.expiration.Before(curTime()) -} - -// ExpiresAt returns the expiration time of the credential -func (e *Expiry) ExpiresAt() time.Time { - return e.expiration -} - -// A Credentials provides concurrency safe retrieval of AWS credentials Value. -// Credentials will cache the credentials value until they expire. Once the value -// expires the next Get will attempt to retrieve valid credentials. -// -// Credentials is safe to use across multiple goroutines and will manage the -// synchronous state so the Providers do not need to implement their own -// synchronization. -// -// The first Credentials.Get() will always call Provider.Retrieve() to get the -// first instance of the credentials Value. All calls to Get() after that -// will return the cached credentials Value until IsExpired() returns true. -type Credentials struct { - sf singleflight.Group - - m sync.RWMutex - creds Value - provider Provider -} - -// NewCredentials returns a pointer to a new Credentials with the provider set. -func NewCredentials(provider Provider) *Credentials { - c := &Credentials{ - provider: provider, - } - return c -} - -// GetWithContext returns the credentials value, or error if the credentials -// Value failed to be retrieved. Will return early if the passed in context is -// canceled. -// -// Will return the cached credentials Value if it has not expired. If the -// credentials Value has expired the Provider's Retrieve() will be called -// to refresh the credentials. -// -// If Credentials.Expire() was called the credentials Value will be force -// expired, and the next call to Get() will cause them to be refreshed. -// -// Passed in Context is equivalent to aws.Context, and context.Context. -func (c *Credentials) GetWithContext(ctx Context) (Value, error) { - // Check if credentials are cached, and not expired. - select { - case curCreds, ok := <-c.asyncIsExpired(): - // ok will only be true, of the credentials were not expired. ok will - // be false and have no value if the credentials are expired. - if ok { - return curCreds, nil - } - case <-ctx.Done(): - return Value{}, awserr.New("RequestCanceled", - "request context canceled", ctx.Err()) - } - - // Cannot pass context down to the actual retrieve, because the first - // context would cancel the whole group when there is not direct - // association of items in the group. - resCh := c.sf.DoChan("", func() (interface{}, error) { - return c.singleRetrieve(&suppressedContext{ctx}) - }) - select { - case res := <-resCh: - return res.Val.(Value), res.Err - case <-ctx.Done(): - return Value{}, awserr.New("RequestCanceled", - "request context canceled", ctx.Err()) - } -} - -func (c *Credentials) singleRetrieve(ctx Context) (interface{}, error) { - c.m.Lock() - defer c.m.Unlock() - - if curCreds := c.creds; !c.isExpiredLocked(curCreds) { - return curCreds, nil - } - - var creds Value - var err error - if p, ok := c.provider.(ProviderWithContext); ok { - creds, err = p.RetrieveWithContext(ctx) - } else { - creds, err = c.provider.Retrieve() - } - if err == nil { - c.creds = creds - } - - return creds, err -} - -// Get returns the credentials value, or error if the credentials Value failed -// to be retrieved. -// -// Will return the cached credentials Value if it has not expired. If the -// credentials Value has expired the Provider's Retrieve() will be called -// to refresh the credentials. -// -// If Credentials.Expire() was called the credentials Value will be force -// expired, and the next call to Get() will cause them to be refreshed. -func (c *Credentials) Get() (Value, error) { - return c.GetWithContext(backgroundContext()) -} - -// Expire expires the credentials and forces them to be retrieved on the -// next call to Get(). -// -// This will override the Provider's expired state, and force Credentials -// to call the Provider's Retrieve(). -func (c *Credentials) Expire() { - c.m.Lock() - defer c.m.Unlock() - - c.creds = Value{} -} - -// IsExpired returns if the credentials are no longer valid, and need -// to be retrieved. -// -// If the Credentials were forced to be expired with Expire() this will -// reflect that override. -func (c *Credentials) IsExpired() bool { - c.m.RLock() - defer c.m.RUnlock() - - return c.isExpiredLocked(c.creds) -} - -// asyncIsExpired returns a channel of credentials Value. If the channel is -// closed the credentials are expired and credentials value are not empty. -func (c *Credentials) asyncIsExpired() <-chan Value { - ch := make(chan Value, 1) - go func() { - c.m.RLock() - defer c.m.RUnlock() - - if curCreds := c.creds; !c.isExpiredLocked(curCreds) { - ch <- curCreds - } - - close(ch) - }() - - return ch -} - -// isExpiredLocked helper method wrapping the definition of expired credentials. -func (c *Credentials) isExpiredLocked(creds interface{}) bool { - return creds == nil || creds.(Value) == Value{} || c.provider.IsExpired() -} - -// ExpiresAt provides access to the functionality of the Expirer interface of -// the underlying Provider, if it supports that interface. Otherwise, it returns -// an error. -func (c *Credentials) ExpiresAt() (time.Time, error) { - c.m.RLock() - defer c.m.RUnlock() - - expirer, ok := c.provider.(Expirer) - if !ok { - return time.Time{}, awserr.New("ProviderNotExpirer", - fmt.Sprintf("provider %s does not support ExpiresAt()", - c.creds.ProviderName), - nil) - } - if c.creds == (Value{}) { - // set expiration time to the distant past - return time.Time{}, nil - } - return expirer.ExpiresAt(), nil -} - -type suppressedContext struct { - Context -} - -func (s *suppressedContext) Deadline() (deadline time.Time, ok bool) { - return time.Time{}, false -} - -func (s *suppressedContext) Done() <-chan struct{} { - return nil -} - -func (s *suppressedContext) Err() error { - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go deleted file mode 100644 index 92af5b7250..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go +++ /dev/null @@ -1,188 +0,0 @@ -package ec2rolecreds - -import ( - "bufio" - "encoding/json" - "fmt" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkuri" -) - -// ProviderName provides a name of EC2Role provider -const ProviderName = "EC2RoleProvider" - -// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if -// those credentials are expired. -// -// Example how to configure the EC2RoleProvider with custom http Client, Endpoint -// or ExpiryWindow -// -// p := &ec2rolecreds.EC2RoleProvider{ -// // Pass in a custom timeout to be used when requesting -// // IAM EC2 Role credentials. -// Client: ec2metadata.New(sess, aws.Config{ -// HTTPClient: &http.Client{Timeout: 10 * time.Second}, -// }), -// -// // Do not use early expiry of credentials. If a non zero value is -// // specified the credentials will be expired early -// ExpiryWindow: 0, -// } -type EC2RoleProvider struct { - credentials.Expiry - - // Required EC2Metadata client to use when connecting to EC2 metadata service. - Client *ec2metadata.EC2Metadata - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration -} - -// NewCredentials returns a pointer to a new Credentials object wrapping -// the EC2RoleProvider. Takes a ConfigProvider to create a EC2Metadata client. -// The ConfigProvider is satisfied by the session.Session type. -func NewCredentials(c client.ConfigProvider, options ...func(*EC2RoleProvider)) *credentials.Credentials { - p := &EC2RoleProvider{ - Client: ec2metadata.New(c), - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping -// the EC2RoleProvider. Takes a EC2Metadata client to use when connecting to EC2 -// metadata service. -func NewCredentialsWithClient(client *ec2metadata.EC2Metadata, options ...func(*EC2RoleProvider)) *credentials.Credentials { - p := &EC2RoleProvider{ - Client: client, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// Retrieve retrieves credentials from the EC2 service. -// Error will be returned if the request fails, or unable to extract -// the desired credentials. -func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) { - return m.RetrieveWithContext(aws.BackgroundContext()) -} - -// RetrieveWithContext retrieves credentials from the EC2 service. -// Error will be returned if the request fails, or unable to extract -// the desired credentials. -func (m *EC2RoleProvider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) { - credsList, err := requestCredList(ctx, m.Client) - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - - if len(credsList) == 0 { - return credentials.Value{ProviderName: ProviderName}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) - } - credsName := credsList[0] - - roleCreds, err := requestCred(ctx, m.Client, credsName) - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - - m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow) - - return credentials.Value{ - AccessKeyID: roleCreds.AccessKeyID, - SecretAccessKey: roleCreds.SecretAccessKey, - SessionToken: roleCreds.Token, - ProviderName: ProviderName, - }, nil -} - -// A ec2RoleCredRespBody provides the shape for unmarshaling credential -// request responses. -type ec2RoleCredRespBody struct { - // Success State - Expiration time.Time - AccessKeyID string - SecretAccessKey string - Token string - - // Error state - Code string - Message string -} - -const iamSecurityCredsPath = "iam/security-credentials/" - -// requestCredList requests a list of credentials from the EC2 service. -// If there are no credentials, or there is an error making or receiving the request -func requestCredList(ctx aws.Context, client *ec2metadata.EC2Metadata) ([]string, error) { - resp, err := client.GetMetadataWithContext(ctx, iamSecurityCredsPath) - if err != nil { - return nil, awserr.New("EC2RoleRequestError", "no EC2 instance role found", err) - } - - credsList := []string{} - s := bufio.NewScanner(strings.NewReader(resp)) - for s.Scan() { - credsList = append(credsList, s.Text()) - } - - if err := s.Err(); err != nil { - return nil, awserr.New(request.ErrCodeSerialization, - "failed to read EC2 instance role from metadata service", err) - } - - return credsList, nil -} - -// requestCred requests the credentials for a specific credentials from the EC2 service. -// -// If the credentials cannot be found, or there is an error reading the response -// and error will be returned. -func requestCred(ctx aws.Context, client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) { - resp, err := client.GetMetadataWithContext(ctx, sdkuri.PathJoin(iamSecurityCredsPath, credsName)) - if err != nil { - return ec2RoleCredRespBody{}, - awserr.New("EC2RoleRequestError", - fmt.Sprintf("failed to get %s EC2 instance role credentials", credsName), - err) - } - - respCreds := ec2RoleCredRespBody{} - if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil { - return ec2RoleCredRespBody{}, - awserr.New(request.ErrCodeSerialization, - fmt.Sprintf("failed to decode %s EC2 instance role credentials", credsName), - err) - } - - if respCreds.Code != "Success" { - // If an error code was returned something failed requesting the role. - return ec2RoleCredRespBody{}, awserr.New(respCreds.Code, respCreds.Message, nil) - } - - return respCreds, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go deleted file mode 100644 index 785f30d8e6..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go +++ /dev/null @@ -1,210 +0,0 @@ -// Package endpointcreds provides support for retrieving credentials from an -// arbitrary HTTP endpoint. -// -// The credentials endpoint Provider can receive both static and refreshable -// credentials that will expire. Credentials are static when an "Expiration" -// value is not provided in the endpoint's response. -// -// Static credentials will never expire once they have been retrieved. The format -// of the static credentials response: -// { -// "AccessKeyId" : "MUA...", -// "SecretAccessKey" : "/7PC5om....", -// } -// -// Refreshable credentials will expire within the "ExpiryWindow" of the Expiration -// value in the response. The format of the refreshable credentials response: -// { -// "AccessKeyId" : "MUA...", -// "SecretAccessKey" : "/7PC5om....", -// "Token" : "AQoDY....=", -// "Expiration" : "2016-02-25T06:03:31Z" -// } -// -// Errors should be returned in the following format and only returned with 400 -// or 500 HTTP status codes. -// { -// "code": "ErrorCode", -// "message": "Helpful error message." -// } -package endpointcreds - -import ( - "encoding/json" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" -) - -// ProviderName is the name of the credentials provider. -const ProviderName = `CredentialsEndpointProvider` - -// Provider satisfies the credentials.Provider interface, and is a client to -// retrieve credentials from an arbitrary endpoint. -type Provider struct { - staticCreds bool - credentials.Expiry - - // Requires a AWS Client to make HTTP requests to the endpoint with. - // the Endpoint the request will be made to is provided by the aws.Config's - // Endpoint value. - Client *client.Client - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration - - // Optional authorization token value if set will be used as the value of - // the Authorization header of the endpoint credential request. - AuthorizationToken string -} - -// NewProviderClient returns a credentials Provider for retrieving AWS credentials -// from arbitrary endpoint. -func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) credentials.Provider { - p := &Provider{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "CredentialsEndpoint", - Endpoint: endpoint, - }, - handlers, - ), - } - - p.Client.Handlers.Unmarshal.PushBack(unmarshalHandler) - p.Client.Handlers.UnmarshalError.PushBack(unmarshalError) - p.Client.Handlers.Validate.Clear() - p.Client.Handlers.Validate.PushBack(validateEndpointHandler) - - for _, option := range options { - option(p) - } - - return p -} - -// NewCredentialsClient returns a pointer to a new Credentials object -// wrapping the endpoint credentials Provider. -func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { - return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) -} - -// IsExpired returns true if the credentials retrieved are expired, or not yet -// retrieved. -func (p *Provider) IsExpired() bool { - if p.staticCreds { - return false - } - return p.Expiry.IsExpired() -} - -// Retrieve will attempt to request the credentials from the endpoint the Provider -// was configured for. And error will be returned if the retrieval fails. -func (p *Provider) Retrieve() (credentials.Value, error) { - return p.RetrieveWithContext(aws.BackgroundContext()) -} - -// RetrieveWithContext will attempt to request the credentials from the endpoint the Provider -// was configured for. And error will be returned if the retrieval fails. -func (p *Provider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) { - resp, err := p.getCredentials(ctx) - if err != nil { - return credentials.Value{ProviderName: ProviderName}, - awserr.New("CredentialsEndpointError", "failed to load credentials", err) - } - - if resp.Expiration != nil { - p.SetExpiration(*resp.Expiration, p.ExpiryWindow) - } else { - p.staticCreds = true - } - - return credentials.Value{ - AccessKeyID: resp.AccessKeyID, - SecretAccessKey: resp.SecretAccessKey, - SessionToken: resp.Token, - ProviderName: ProviderName, - }, nil -} - -type getCredentialsOutput struct { - Expiration *time.Time - AccessKeyID string - SecretAccessKey string - Token string -} - -type errorOutput struct { - Code string `json:"code"` - Message string `json:"message"` -} - -func (p *Provider) getCredentials(ctx aws.Context) (*getCredentialsOutput, error) { - op := &request.Operation{ - Name: "GetCredentials", - HTTPMethod: "GET", - } - - out := &getCredentialsOutput{} - req := p.Client.NewRequest(op, nil, out) - req.SetContext(ctx) - req.HTTPRequest.Header.Set("Accept", "application/json") - if authToken := p.AuthorizationToken; len(authToken) != 0 { - req.HTTPRequest.Header.Set("Authorization", authToken) - } - - return out, req.Send() -} - -func validateEndpointHandler(r *request.Request) { - if len(r.ClientInfo.Endpoint) == 0 { - r.Error = aws.ErrMissingEndpoint - } -} - -func unmarshalHandler(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - out := r.Data.(*getCredentialsOutput) - if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&out); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, - "failed to decode endpoint credentials", - err, - ) - } -} - -func unmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - var errOut errorOutput - err := jsonutil.UnmarshalJSONError(&errOut, r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to decode error message", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - // Response body format is not consistent between metadata endpoints. - // Grab the error message as a string and include that as the source error - r.Error = awserr.New(errOut.Code, errOut.Message, nil) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go deleted file mode 100644 index 54c5cf7333..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go +++ /dev/null @@ -1,74 +0,0 @@ -package credentials - -import ( - "os" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// EnvProviderName provides a name of Env provider -const EnvProviderName = "EnvProvider" - -var ( - // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be - // found in the process's environment. - ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) - - // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key - // can't be found in the process's environment. - ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) -) - -// A EnvProvider retrieves credentials from the environment variables of the -// running process. Environment credentials never expire. -// -// Environment variables used: -// -// * Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY -// -// * Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY -type EnvProvider struct { - retrieved bool -} - -// NewEnvCredentials returns a pointer to a new Credentials object -// wrapping the environment variable provider. -func NewEnvCredentials() *Credentials { - return NewCredentials(&EnvProvider{}) -} - -// Retrieve retrieves the keys from the environment. -func (e *EnvProvider) Retrieve() (Value, error) { - e.retrieved = false - - id := os.Getenv("AWS_ACCESS_KEY_ID") - if id == "" { - id = os.Getenv("AWS_ACCESS_KEY") - } - - secret := os.Getenv("AWS_SECRET_ACCESS_KEY") - if secret == "" { - secret = os.Getenv("AWS_SECRET_KEY") - } - - if id == "" { - return Value{ProviderName: EnvProviderName}, ErrAccessKeyIDNotFound - } - - if secret == "" { - return Value{ProviderName: EnvProviderName}, ErrSecretAccessKeyNotFound - } - - e.retrieved = true - return Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: os.Getenv("AWS_SESSION_TOKEN"), - ProviderName: EnvProviderName, - }, nil -} - -// IsExpired returns if the credentials have been retrieved. -func (e *EnvProvider) IsExpired() bool { - return !e.retrieved -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini deleted file mode 100644 index 7fc91d9d20..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini +++ /dev/null @@ -1,12 +0,0 @@ -[default] -aws_access_key_id = accessKey -aws_secret_access_key = secret -aws_session_token = token - -[no_token] -aws_access_key_id = accessKey -aws_secret_access_key = secret - -[with_colon] -aws_access_key_id: accessKey -aws_secret_access_key: secret diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go deleted file mode 100644 index e624836002..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go +++ /dev/null @@ -1,426 +0,0 @@ -/* -Package processcreds is a credential Provider to retrieve `credential_process` -credentials. - -WARNING: The following describes a method of sourcing credentials from an external -process. This can potentially be dangerous, so proceed with caution. Other -credential providers should be preferred if at all possible. If using this -option, you should make sure that the config file is as locked down as possible -using security best practices for your operating system. - -You can use credentials from a `credential_process` in a variety of ways. - -One way is to setup your shared config file, located in the default -location, with the `credential_process` key and the command you want to be -called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable -(e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file. - - [default] - credential_process = /command/to/call - -Creating a new session will use the credential process to retrieve credentials. -NOTE: If there are credentials in the profile you are using, the credential -process will not be used. - - // Initialize a session to load credentials. - sess, _ := session.NewSession(&aws.Config{ - Region: aws.String("us-east-1")}, - ) - - // Create S3 service client to use the credentials. - svc := s3.New(sess) - -Another way to use the `credential_process` method is by using -`credentials.NewCredentials()` and providing a command to be executed to -retrieve credentials: - - // Create credentials using the ProcessProvider. - creds := processcreds.NewCredentials("/path/to/command") - - // Create service client value configured for credentials. - svc := s3.New(sess, &aws.Config{Credentials: creds}) - -You can set a non-default timeout for the `credential_process` with another -constructor, `credentials.NewCredentialsTimeout()`, providing the timeout. To -set a one minute timeout: - - // Create credentials using the ProcessProvider. - creds := processcreds.NewCredentialsTimeout( - "/path/to/command", - time.Duration(500) * time.Millisecond) - -If you need more control, you can set any configurable options in the -credentials using one or more option functions. For example, you can set a two -minute timeout, a credential duration of 60 minutes, and a maximum stdout -buffer size of 2k. - - creds := processcreds.NewCredentials( - "/path/to/command", - func(opt *ProcessProvider) { - opt.Timeout = time.Duration(2) * time.Minute - opt.Duration = time.Duration(60) * time.Minute - opt.MaxBufSize = 2048 - }) - -You can also use your own `exec.Cmd`: - - // Create an exec.Cmd - myCommand := exec.Command("/path/to/command") - - // Create credentials using your exec.Cmd and custom timeout - creds := processcreds.NewCredentialsCommand( - myCommand, - func(opt *processcreds.ProcessProvider) { - opt.Timeout = time.Duration(1) * time.Second - }) -*/ -package processcreds - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "runtime" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -const ( - // ProviderName is the name this credentials provider will label any - // returned credentials Value with. - ProviderName = `ProcessProvider` - - // ErrCodeProcessProviderParse error parsing process output - ErrCodeProcessProviderParse = "ProcessProviderParseError" - - // ErrCodeProcessProviderVersion version error in output - ErrCodeProcessProviderVersion = "ProcessProviderVersionError" - - // ErrCodeProcessProviderRequired required attribute missing in output - ErrCodeProcessProviderRequired = "ProcessProviderRequiredError" - - // ErrCodeProcessProviderExecution execution of command failed - ErrCodeProcessProviderExecution = "ProcessProviderExecutionError" - - // errMsgProcessProviderTimeout process took longer than allowed - errMsgProcessProviderTimeout = "credential process timed out" - - // errMsgProcessProviderProcess process error - errMsgProcessProviderProcess = "error in credential_process" - - // errMsgProcessProviderParse problem parsing output - errMsgProcessProviderParse = "parse failed of credential_process output" - - // errMsgProcessProviderVersion version error in output - errMsgProcessProviderVersion = "wrong version in process output (not 1)" - - // errMsgProcessProviderMissKey missing access key id in output - errMsgProcessProviderMissKey = "missing AccessKeyId in process output" - - // errMsgProcessProviderMissSecret missing secret acess key in output - errMsgProcessProviderMissSecret = "missing SecretAccessKey in process output" - - // errMsgProcessProviderPrepareCmd prepare of command failed - errMsgProcessProviderPrepareCmd = "failed to prepare command" - - // errMsgProcessProviderEmptyCmd command must not be empty - errMsgProcessProviderEmptyCmd = "command must not be empty" - - // errMsgProcessProviderPipe failed to initialize pipe - errMsgProcessProviderPipe = "failed to initialize pipe" - - // DefaultDuration is the default amount of time in minutes that the - // credentials will be valid for. - DefaultDuration = time.Duration(15) * time.Minute - - // DefaultBufSize limits buffer size from growing to an enormous - // amount due to a faulty process. - DefaultBufSize = int(8 * sdkio.KibiByte) - - // DefaultTimeout default limit on time a process can run. - DefaultTimeout = time.Duration(1) * time.Minute -) - -// ProcessProvider satisfies the credentials.Provider interface, and is a -// client to retrieve credentials from a process. -type ProcessProvider struct { - staticCreds bool - credentials.Expiry - originalCommand []string - - // Expiry duration of the credentials. Defaults to 15 minutes if not set. - Duration time.Duration - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration - - // A string representing an os command that should return a JSON with - // credential information. - command *exec.Cmd - - // MaxBufSize limits memory usage from growing to an enormous - // amount due to a faulty process. - MaxBufSize int - - // Timeout limits the time a process can run. - Timeout time.Duration -} - -// NewCredentials returns a pointer to a new Credentials object wrapping the -// ProcessProvider. The credentials will expire every 15 minutes by default. -func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials { - p := &ProcessProvider{ - command: exec.Command(command), - Duration: DefaultDuration, - Timeout: DefaultTimeout, - MaxBufSize: DefaultBufSize, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// NewCredentialsTimeout returns a pointer to a new Credentials object with -// the specified command and timeout, and default duration and max buffer size. -func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials { - p := NewCredentials(command, func(opt *ProcessProvider) { - opt.Timeout = timeout - }) - - return p -} - -// NewCredentialsCommand returns a pointer to a new Credentials object with -// the specified command, and default timeout, duration and max buffer size. -func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials { - p := &ProcessProvider{ - command: command, - Duration: DefaultDuration, - Timeout: DefaultTimeout, - MaxBufSize: DefaultBufSize, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -type credentialProcessResponse struct { - Version int - AccessKeyID string `json:"AccessKeyId"` - SecretAccessKey string - SessionToken string - Expiration *time.Time -} - -// Retrieve executes the 'credential_process' and returns the credentials. -func (p *ProcessProvider) Retrieve() (credentials.Value, error) { - out, err := p.executeCredentialProcess() - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - - // Serialize and validate response - resp := &credentialProcessResponse{} - if err = json.Unmarshal(out, resp); err != nil { - return credentials.Value{ProviderName: ProviderName}, awserr.New( - ErrCodeProcessProviderParse, - fmt.Sprintf("%s: %s", errMsgProcessProviderParse, string(out)), - err) - } - - if resp.Version != 1 { - return credentials.Value{ProviderName: ProviderName}, awserr.New( - ErrCodeProcessProviderVersion, - errMsgProcessProviderVersion, - nil) - } - - if len(resp.AccessKeyID) == 0 { - return credentials.Value{ProviderName: ProviderName}, awserr.New( - ErrCodeProcessProviderRequired, - errMsgProcessProviderMissKey, - nil) - } - - if len(resp.SecretAccessKey) == 0 { - return credentials.Value{ProviderName: ProviderName}, awserr.New( - ErrCodeProcessProviderRequired, - errMsgProcessProviderMissSecret, - nil) - } - - // Handle expiration - p.staticCreds = resp.Expiration == nil - if resp.Expiration != nil { - p.SetExpiration(*resp.Expiration, p.ExpiryWindow) - } - - return credentials.Value{ - ProviderName: ProviderName, - AccessKeyID: resp.AccessKeyID, - SecretAccessKey: resp.SecretAccessKey, - SessionToken: resp.SessionToken, - }, nil -} - -// IsExpired returns true if the credentials retrieved are expired, or not yet -// retrieved. -func (p *ProcessProvider) IsExpired() bool { - if p.staticCreds { - return false - } - return p.Expiry.IsExpired() -} - -// prepareCommand prepares the command to be executed. -func (p *ProcessProvider) prepareCommand() error { - - var cmdArgs []string - if runtime.GOOS == "windows" { - cmdArgs = []string{"cmd.exe", "/C"} - } else { - cmdArgs = []string{"sh", "-c"} - } - - if len(p.originalCommand) == 0 { - p.originalCommand = make([]string, len(p.command.Args)) - copy(p.originalCommand, p.command.Args) - - // check for empty command because it succeeds - if len(strings.TrimSpace(p.originalCommand[0])) < 1 { - return awserr.New( - ErrCodeProcessProviderExecution, - fmt.Sprintf( - "%s: %s", - errMsgProcessProviderPrepareCmd, - errMsgProcessProviderEmptyCmd), - nil) - } - } - - cmdArgs = append(cmdArgs, p.originalCommand...) - p.command = exec.Command(cmdArgs[0], cmdArgs[1:]...) - p.command.Env = os.Environ() - - return nil -} - -// executeCredentialProcess starts the credential process on the OS and -// returns the results or an error. -func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) { - - if err := p.prepareCommand(); err != nil { - return nil, err - } - - // Setup the pipes - outReadPipe, outWritePipe, err := os.Pipe() - if err != nil { - return nil, awserr.New( - ErrCodeProcessProviderExecution, - errMsgProcessProviderPipe, - err) - } - - p.command.Stderr = os.Stderr // display stderr on console for MFA - p.command.Stdout = outWritePipe // get creds json on process's stdout - p.command.Stdin = os.Stdin // enable stdin for MFA - - output := bytes.NewBuffer(make([]byte, 0, p.MaxBufSize)) - - stdoutCh := make(chan error, 1) - go readInput( - io.LimitReader(outReadPipe, int64(p.MaxBufSize)), - output, - stdoutCh) - - execCh := make(chan error, 1) - go executeCommand(*p.command, execCh) - - finished := false - var errors []error - for !finished { - select { - case readError := <-stdoutCh: - errors = appendError(errors, readError) - finished = true - case execError := <-execCh: - err := outWritePipe.Close() - errors = appendError(errors, err) - errors = appendError(errors, execError) - if errors != nil { - return output.Bytes(), awserr.NewBatchError( - ErrCodeProcessProviderExecution, - errMsgProcessProviderProcess, - errors) - } - case <-time.After(p.Timeout): - finished = true - return output.Bytes(), awserr.NewBatchError( - ErrCodeProcessProviderExecution, - errMsgProcessProviderTimeout, - errors) // errors can be nil - } - } - - out := output.Bytes() - - if runtime.GOOS == "windows" { - // windows adds slashes to quotes - out = []byte(strings.Replace(string(out), `\"`, `"`, -1)) - } - - return out, nil -} - -// appendError conveniently checks for nil before appending slice -func appendError(errors []error, err error) []error { - if err != nil { - return append(errors, err) - } - return errors -} - -func executeCommand(cmd exec.Cmd, exec chan error) { - // Start the command - err := cmd.Start() - if err == nil { - err = cmd.Wait() - } - - exec <- err -} - -func readInput(r io.Reader, w io.Writer, read chan error) { - tee := io.TeeReader(r, w) - - _, err := ioutil.ReadAll(tee) - - if err == io.EOF { - err = nil - } - - read <- err // will only arrive here when write end of pipe is closed -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go deleted file mode 100644 index 22b5c5d9f3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go +++ /dev/null @@ -1,151 +0,0 @@ -package credentials - -import ( - "fmt" - "os" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/ini" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -// SharedCredsProviderName provides a name of SharedCreds provider -const SharedCredsProviderName = "SharedCredentialsProvider" - -var ( - // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. - ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil) -) - -// A SharedCredentialsProvider retrieves access key pair (access key ID, -// secret access key, and session token if present) credentials from the current -// user's home directory, and keeps track if those credentials are expired. -// -// Profile ini file example: $HOME/.aws/credentials -type SharedCredentialsProvider struct { - // Path to the shared credentials file. - // - // If empty will look for "AWS_SHARED_CREDENTIALS_FILE" env variable. If the - // env value is empty will default to current user's home directory. - // Linux/OSX: "$HOME/.aws/credentials" - // Windows: "%USERPROFILE%\.aws\credentials" - Filename string - - // AWS Profile to extract credentials from the shared credentials file. If empty - // will default to environment variable "AWS_PROFILE" or "default" if - // environment variable is also not set. - Profile string - - // retrieved states if the credentials have been successfully retrieved. - retrieved bool -} - -// NewSharedCredentials returns a pointer to a new Credentials object -// wrapping the Profile file provider. -func NewSharedCredentials(filename, profile string) *Credentials { - return NewCredentials(&SharedCredentialsProvider{ - Filename: filename, - Profile: profile, - }) -} - -// Retrieve reads and extracts the shared credentials from the current -// users home directory. -func (p *SharedCredentialsProvider) Retrieve() (Value, error) { - p.retrieved = false - - filename, err := p.filename() - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, err - } - - creds, err := loadProfile(filename, p.profile()) - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, err - } - - p.retrieved = true - return creds, nil -} - -// IsExpired returns if the shared credentials have expired. -func (p *SharedCredentialsProvider) IsExpired() bool { - return !p.retrieved -} - -// loadProfiles loads from the file pointed to by shared credentials filename for profile. -// The credentials retrieved from the profile will be returned or error. Error will be -// returned if it fails to read from the file, or the data is invalid. -func loadProfile(filename, profile string) (Value, error) { - config, err := ini.OpenFile(filename) - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err) - } - - iniProfile, ok := config.GetSection(profile) - if !ok { - return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", nil) - } - - id := iniProfile.String("aws_access_key_id") - if len(id) == 0 { - return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsAccessKey", - fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), - nil) - } - - secret := iniProfile.String("aws_secret_access_key") - if len(secret) == 0 { - return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsSecret", - fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), - nil) - } - - // Default to empty string if not found - token := iniProfile.String("aws_session_token") - - return Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: token, - ProviderName: SharedCredsProviderName, - }, nil -} - -// filename returns the filename to use to read AWS shared credentials. -// -// Will return an error if the user's home directory path cannot be found. -func (p *SharedCredentialsProvider) filename() (string, error) { - if len(p.Filename) != 0 { - return p.Filename, nil - } - - if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); len(p.Filename) != 0 { - return p.Filename, nil - } - - if home := shareddefaults.UserHomeDir(); len(home) == 0 { - // Backwards compatibility of home directly not found error being returned. - // This error is too verbose, failure when opening the file would of been - // a better error to return. - return "", ErrSharedCredentialsHomeNotFound - } - - p.Filename = shareddefaults.SharedCredentialsFilename() - - return p.Filename, nil -} - -// profile returns the AWS shared credentials profile. If empty will read -// environment variable "AWS_PROFILE". If that is not set profile will -// return "default". -func (p *SharedCredentialsProvider) profile() string { - if p.Profile == "" { - p.Profile = os.Getenv("AWS_PROFILE") - } - if p.Profile == "" { - p.Profile = "default" - } - - return p.Profile -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go deleted file mode 100644 index 18c940ab3c..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go +++ /dev/null @@ -1,60 +0,0 @@ -// Package ssocreds provides a credential provider for retrieving temporary AWS credentials using an SSO access token. -// -// IMPORTANT: The provider in this package does not initiate or perform the AWS SSO login flow. The SDK provider -// expects that you have already performed the SSO login flow using AWS CLI using the "aws sso login" command, or by -// some other mechanism. The provider must find a valid non-expired access token for the AWS SSO user portal URL in -// ~/.aws/sso/cache. If a cached token is not found, it is expired, or the file is malformed an error will be returned. -// -// Loading AWS SSO credentials with the AWS shared configuration file -// -// You can use configure AWS SSO credentials from the AWS shared configuration file by -// providing the specifying the required keys in the profile: -// -// sso_account_id -// sso_region -// sso_role_name -// sso_start_url -// -// For example, the following defines a profile "devsso" and specifies the AWS SSO parameters that defines the target -// account, role, sign-on portal, and the region where the user portal is located. Note: all SSO arguments must be -// provided, or an error will be returned. -// -// [profile devsso] -// sso_start_url = https://my-sso-portal.awsapps.com/start -// sso_role_name = SSOReadOnlyRole -// sso_region = us-east-1 -// sso_account_id = 123456789012 -// -// Using the config module, you can load the AWS SDK shared configuration, and specify that this profile be used to -// retrieve credentials. For example: -// -// sess, err := session.NewSessionWithOptions(session.Options{ -// SharedConfigState: session.SharedConfigEnable, -// Profile: "devsso", -// }) -// if err != nil { -// return err -// } -// -// Programmatically loading AWS SSO credentials directly -// -// You can programmatically construct the AWS SSO Provider in your application, and provide the necessary information -// to load and retrieve temporary credentials using an access token from ~/.aws/sso/cache. -// -// svc := sso.New(sess, &aws.Config{ -// Region: aws.String("us-west-2"), // Client Region must correspond to the AWS SSO user portal region -// }) -// -// provider := ssocreds.NewCredentialsWithClient(svc, "123456789012", "SSOReadOnlyRole", "https://my-sso-portal.awsapps.com/start") -// -// credentials, err := provider.Get() -// if err != nil { -// return err -// } -// -// Additional Resources -// -// Configuring the AWS CLI to use AWS Single Sign-On: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html -// -// AWS Single Sign-On User Guide: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html -package ssocreds diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go deleted file mode 100644 index ceca7dceec..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !windows - -package ssocreds - -import "os" - -func getHomeDirectory() string { - return os.Getenv("HOME") -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go deleted file mode 100644 index eb48f61e5b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go +++ /dev/null @@ -1,7 +0,0 @@ -package ssocreds - -import "os" - -func getHomeDirectory() string { - return os.Getenv("USERPROFILE") -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go deleted file mode 100644 index 6eda2a5557..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go +++ /dev/null @@ -1,180 +0,0 @@ -package ssocreds - -import ( - "crypto/sha1" - "encoding/hex" - "encoding/json" - "fmt" - "io/ioutil" - "path/filepath" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/service/sso" - "github.com/aws/aws-sdk-go/service/sso/ssoiface" -) - -// ErrCodeSSOProviderInvalidToken is the code type that is returned if loaded token has expired or is otherwise invalid. -// To refresh the SSO session run aws sso login with the corresponding profile. -const ErrCodeSSOProviderInvalidToken = "SSOProviderInvalidToken" - -const invalidTokenMessage = "the SSO session has expired or is invalid" - -func init() { - nowTime = time.Now - defaultCacheLocation = defaultCacheLocationImpl -} - -var nowTime func() time.Time - -// ProviderName is the name of the provider used to specify the source of credentials. -const ProviderName = "SSOProvider" - -var defaultCacheLocation func() string - -func defaultCacheLocationImpl() string { - return filepath.Join(getHomeDirectory(), ".aws", "sso", "cache") -} - -// Provider is an AWS credential provider that retrieves temporary AWS credentials by exchanging an SSO login token. -type Provider struct { - credentials.Expiry - - // The Client which is configured for the AWS Region where the AWS SSO user portal is located. - Client ssoiface.SSOAPI - - // The AWS account that is assigned to the user. - AccountID string - - // The role name that is assigned to the user. - RoleName string - - // The URL that points to the organization's AWS Single Sign-On (AWS SSO) user portal. - StartURL string -} - -// NewCredentials returns a new AWS Single Sign-On (AWS SSO) credential provider. The ConfigProvider is expected to be configured -// for the AWS Region where the AWS SSO user portal is located. -func NewCredentials(configProvider client.ConfigProvider, accountID, roleName, startURL string, optFns ...func(provider *Provider)) *credentials.Credentials { - return NewCredentialsWithClient(sso.New(configProvider), accountID, roleName, startURL, optFns...) -} - -// NewCredentialsWithClient returns a new AWS Single Sign-On (AWS SSO) credential provider. The provided client is expected to be configured -// for the AWS Region where the AWS SSO user portal is located. -func NewCredentialsWithClient(client ssoiface.SSOAPI, accountID, roleName, startURL string, optFns ...func(provider *Provider)) *credentials.Credentials { - p := &Provider{ - Client: client, - AccountID: accountID, - RoleName: roleName, - StartURL: startURL, - } - - for _, fn := range optFns { - fn(p) - } - - return credentials.NewCredentials(p) -} - -// Retrieve retrieves temporary AWS credentials from the configured Amazon Single Sign-On (AWS SSO) user portal -// by exchanging the accessToken present in ~/.aws/sso/cache. -func (p *Provider) Retrieve() (credentials.Value, error) { - return p.RetrieveWithContext(aws.BackgroundContext()) -} - -// RetrieveWithContext retrieves temporary AWS credentials from the configured Amazon Single Sign-On (AWS SSO) user portal -// by exchanging the accessToken present in ~/.aws/sso/cache. -func (p *Provider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) { - tokenFile, err := loadTokenFile(p.StartURL) - if err != nil { - return credentials.Value{}, err - } - - output, err := p.Client.GetRoleCredentialsWithContext(ctx, &sso.GetRoleCredentialsInput{ - AccessToken: &tokenFile.AccessToken, - AccountId: &p.AccountID, - RoleName: &p.RoleName, - }) - if err != nil { - return credentials.Value{}, err - } - - expireTime := time.Unix(0, aws.Int64Value(output.RoleCredentials.Expiration)*int64(time.Millisecond)).UTC() - p.SetExpiration(expireTime, 0) - - return credentials.Value{ - AccessKeyID: aws.StringValue(output.RoleCredentials.AccessKeyId), - SecretAccessKey: aws.StringValue(output.RoleCredentials.SecretAccessKey), - SessionToken: aws.StringValue(output.RoleCredentials.SessionToken), - ProviderName: ProviderName, - }, nil -} - -func getCacheFileName(url string) (string, error) { - hash := sha1.New() - _, err := hash.Write([]byte(url)) - if err != nil { - return "", err - } - return strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json", nil -} - -type rfc3339 time.Time - -func (r *rfc3339) UnmarshalJSON(bytes []byte) error { - var value string - - if err := json.Unmarshal(bytes, &value); err != nil { - return err - } - - parse, err := time.Parse(time.RFC3339, value) - if err != nil { - return fmt.Errorf("expected RFC3339 timestamp: %v", err) - } - - *r = rfc3339(parse) - - return nil -} - -type token struct { - AccessToken string `json:"accessToken"` - ExpiresAt rfc3339 `json:"expiresAt"` - Region string `json:"region,omitempty"` - StartURL string `json:"startUrl,omitempty"` -} - -func (t token) Expired() bool { - return nowTime().Round(0).After(time.Time(t.ExpiresAt)) -} - -func loadTokenFile(startURL string) (t token, err error) { - key, err := getCacheFileName(startURL) - if err != nil { - return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) - } - - fileBytes, err := ioutil.ReadFile(filepath.Join(defaultCacheLocation(), key)) - if err != nil { - return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) - } - - if err := json.Unmarshal(fileBytes, &t); err != nil { - return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) - } - - if len(t.AccessToken) == 0 { - return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, nil) - } - - if t.Expired() { - return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, nil) - } - - return t, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go deleted file mode 100644 index cbba1e3d56..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go +++ /dev/null @@ -1,57 +0,0 @@ -package credentials - -import ( - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// StaticProviderName provides a name of Static provider -const StaticProviderName = "StaticProvider" - -var ( - // ErrStaticCredentialsEmpty is emitted when static credentials are empty. - ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) -) - -// A StaticProvider is a set of credentials which are set programmatically, -// and will never expire. -type StaticProvider struct { - Value -} - -// NewStaticCredentials returns a pointer to a new Credentials object -// wrapping a static credentials value provider. Token is only required -// for temporary security credentials retrieved via STS, otherwise an empty -// string can be passed for this parameter. -func NewStaticCredentials(id, secret, token string) *Credentials { - return NewCredentials(&StaticProvider{Value: Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: token, - }}) -} - -// NewStaticCredentialsFromCreds returns a pointer to a new Credentials object -// wrapping the static credentials value provide. Same as NewStaticCredentials -// but takes the creds Value instead of individual fields -func NewStaticCredentialsFromCreds(creds Value) *Credentials { - return NewCredentials(&StaticProvider{Value: creds}) -} - -// Retrieve returns the credentials or error if the credentials are invalid. -func (s *StaticProvider) Retrieve() (Value, error) { - if s.AccessKeyID == "" || s.SecretAccessKey == "" { - return Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty - } - - if len(s.Value.ProviderName) == 0 { - s.Value.ProviderName = StaticProviderName - } - return s.Value, nil -} - -// IsExpired returns if the credentials are expired. -// -// For StaticProvider, the credentials never expired. -func (s *StaticProvider) IsExpired() bool { - return false -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go deleted file mode 100644 index e42c5cdbb2..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -Package stscreds are credential Providers to retrieve STS AWS credentials. - -STS provides multiple ways to retrieve credentials which can be used when making -future AWS service API operation calls. - -The SDK will ensure that per instance of credentials.Credentials all requests -to refresh the credentials will be synchronized. But, the SDK is unable to -ensure synchronous usage of the AssumeRoleProvider if the value is shared -between multiple Credentials, Sessions or service clients. - -Assume Role - -To assume an IAM role using STS with the SDK you can create a new Credentials -with the SDKs's stscreds package. - - // Initial credentials loaded from SDK's default credential chain. Such as - // the environment, shared credentials (~/.aws/credentials), or EC2 Instance - // Role. These credentials will be used to to make the STS Assume Role API. - sess := session.Must(session.NewSession()) - - // Create the credentials from AssumeRoleProvider to assume the role - // referenced by the "myRoleARN" ARN. - creds := stscreds.NewCredentials(sess, "myRoleArn") - - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess, &aws.Config{Credentials: creds}) - -Assume Role with static MFA Token - -To assume an IAM role with a MFA token you can either specify a MFA token code -directly or provide a function to prompt the user each time the credentials -need to refresh the role's credentials. Specifying the TokenCode should be used -for short lived operations that will not need to be refreshed, and when you do -not want to have direct control over the user provides their MFA token. - -With TokenCode the AssumeRoleProvider will be not be able to refresh the role's -credentials. - - // Create the credentials from AssumeRoleProvider to assume the role - // referenced by the "myRoleARN" ARN using the MFA token code provided. - creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) { - p.SerialNumber = aws.String("myTokenSerialNumber") - p.TokenCode = aws.String("00000000") - }) - - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess, &aws.Config{Credentials: creds}) - -Assume Role with MFA Token Provider - -To assume an IAM role with MFA for longer running tasks where the credentials -may need to be refreshed setting the TokenProvider field of AssumeRoleProvider -will allow the credential provider to prompt for new MFA token code when the -role's credentials need to be refreshed. - -The StdinTokenProvider function is available to prompt on stdin to retrieve -the MFA token code from the user. You can also implement custom prompts by -satisfing the TokenProvider function signature. - -Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will -have undesirable results as the StdinTokenProvider will not be synchronized. A -single Credentials with an AssumeRoleProvider can be shared safely. - - // Create the credentials from AssumeRoleProvider to assume the role - // referenced by the "myRoleARN" ARN. Prompting for MFA token from stdin. - creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) { - p.SerialNumber = aws.String("myTokenSerialNumber") - p.TokenProvider = stscreds.StdinTokenProvider - }) - - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess, &aws.Config{Credentials: creds}) - -*/ -package stscreds - -import ( - "fmt" - "os" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkrand" - "github.com/aws/aws-sdk-go/service/sts" -) - -// StdinTokenProvider will prompt on stderr and read from stdin for a string value. -// An error is returned if reading from stdin fails. -// -// Use this function go read MFA tokens from stdin. The function makes no attempt -// to make atomic prompts from stdin across multiple gorouties. -// -// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will -// have undesirable results as the StdinTokenProvider will not be synchronized. A -// single Credentials with an AssumeRoleProvider can be shared safely -// -// Will wait forever until something is provided on the stdin. -func StdinTokenProvider() (string, error) { - var v string - fmt.Fprintf(os.Stderr, "Assume Role MFA token code: ") - _, err := fmt.Scanln(&v) - - return v, err -} - -// ProviderName provides a name of AssumeRole provider -const ProviderName = "AssumeRoleProvider" - -// AssumeRoler represents the minimal subset of the STS client API used by this provider. -type AssumeRoler interface { - AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) -} - -type assumeRolerWithContext interface { - AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error) -} - -// DefaultDuration is the default amount of time in minutes that the credentials -// will be valid for. -var DefaultDuration = time.Duration(15) * time.Minute - -// AssumeRoleProvider retrieves temporary credentials from the STS service, and -// keeps track of their expiration time. -// -// This credential provider will be used by the SDKs default credential change -// when shared configuration is enabled, and the shared config or shared credentials -// file configure assume role. See Session docs for how to do this. -// -// AssumeRoleProvider does not provide any synchronization and it is not safe -// to share this value across multiple Credentials, Sessions, or service clients -// without also sharing the same Credentials instance. -type AssumeRoleProvider struct { - credentials.Expiry - - // STS client to make assume role request with. - Client AssumeRoler - - // Role to be assumed. - RoleARN string - - // Session name, if you wish to reuse the credentials elsewhere. - RoleSessionName string - - // Optional, you can pass tag key-value pairs to your session. These tags are called session tags. - Tags []*sts.Tag - - // A list of keys for session tags that you want to set as transitive. - // If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. - TransitiveTagKeys []*string - - // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. - Duration time.Duration - - // Optional ExternalID to pass along, defaults to nil if not set. - ExternalID *string - - // The policy plain text must be 2048 bytes or shorter. However, an internal - // conversion compresses it into a packed binary format with a separate limit. - // The PackedPolicySize response element indicates by percentage how close to - // the upper size limit the policy is, with 100% equaling the maximum allowed - // size. - Policy *string - - // The ARNs of IAM managed policies you want to use as managed session policies. - // The policies must exist in the same account as the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's identity-based - // policy and the session policies. You can use the role's temporary credentials - // in subsequent AWS API calls to access resources in the account that owns - // the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - PolicyArns []*sts.PolicyDescriptorType - - // The identification number of the MFA device that is associated with the user - // who is making the AssumeRole call. Specify this value if the trust policy - // of the role being assumed includes a condition that requires MFA authentication. - // The value is either the serial number for a hardware device (such as GAHT12345678) - // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). - SerialNumber *string - - // The value provided by the MFA device, if the trust policy of the role being - // assumed requires MFA (that is, if the policy includes a condition that tests - // for MFA). If the role being assumed requires MFA and if the TokenCode value - // is missing or expired, the AssumeRole call returns an "access denied" error. - // - // If SerialNumber is set and neither TokenCode nor TokenProvider are also - // set an error will be returned. - TokenCode *string - - // Async method of providing MFA token code for assuming an IAM role with MFA. - // The value returned by the function will be used as the TokenCode in the Retrieve - // call. See StdinTokenProvider for a provider that prompts and reads from stdin. - // - // This token provider will be called when ever the assumed role's - // credentials need to be refreshed when SerialNumber is also set and - // TokenCode is not set. - // - // If both TokenCode and TokenProvider is set, TokenProvider will be used and - // TokenCode is ignored. - TokenProvider func() (string, error) - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration - - // MaxJitterFrac reduces the effective Duration of each credential requested - // by a random percentage between 0 and MaxJitterFraction. MaxJitterFrac must - // have a value between 0 and 1. Any other value may lead to expected behavior. - // With a MaxJitterFrac value of 0, default) will no jitter will be used. - // - // For example, with a Duration of 30m and a MaxJitterFrac of 0.1, the - // AssumeRole call will be made with an arbitrary Duration between 27m and - // 30m. - // - // MaxJitterFrac should not be negative. - MaxJitterFrac float64 -} - -// NewCredentials returns a pointer to a new Credentials value wrapping the -// AssumeRoleProvider. The credentials will expire every 15 minutes and the -// role will be named after a nanosecond timestamp of this operation. The -// Credentials value will attempt to refresh the credentials using the provider -// when Credentials.Get is called, if the cached credentials are expiring. -// -// Takes a Config provider to create the STS client. The ConfigProvider is -// satisfied by the session.Session type. -// -// It is safe to share the returned Credentials with multiple Sessions and -// service clients. All access to the credentials and refreshing them -// will be synchronized. -func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { - p := &AssumeRoleProvider{ - Client: sts.New(c), - RoleARN: roleARN, - Duration: DefaultDuration, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// NewCredentialsWithClient returns a pointer to a new Credentials value wrapping the -// AssumeRoleProvider. The credentials will expire every 15 minutes and the -// role will be named after a nanosecond timestamp of this operation. The -// Credentials value will attempt to refresh the credentials using the provider -// when Credentials.Get is called, if the cached credentials are expiring. -// -// Takes an AssumeRoler which can be satisfied by the STS client. -// -// It is safe to share the returned Credentials with multiple Sessions and -// service clients. All access to the credentials and refreshing them -// will be synchronized. -func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { - p := &AssumeRoleProvider{ - Client: svc, - RoleARN: roleARN, - Duration: DefaultDuration, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// Retrieve generates a new set of temporary credentials using STS. -func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { - return p.RetrieveWithContext(aws.BackgroundContext()) -} - -// RetrieveWithContext generates a new set of temporary credentials using STS. -func (p *AssumeRoleProvider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) { - // Apply defaults where parameters are not set. - if p.RoleSessionName == "" { - // Try to work out a role name that will hopefully end up unique. - p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano()) - } - if p.Duration == 0 { - // Expire as often as AWS permits. - p.Duration = DefaultDuration - } - jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration)) - input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), - RoleArn: aws.String(p.RoleARN), - RoleSessionName: aws.String(p.RoleSessionName), - ExternalId: p.ExternalID, - Tags: p.Tags, - PolicyArns: p.PolicyArns, - TransitiveTagKeys: p.TransitiveTagKeys, - } - if p.Policy != nil { - input.Policy = p.Policy - } - if p.SerialNumber != nil { - if p.TokenCode != nil { - input.SerialNumber = p.SerialNumber - input.TokenCode = p.TokenCode - } else if p.TokenProvider != nil { - input.SerialNumber = p.SerialNumber - code, err := p.TokenProvider() - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - input.TokenCode = aws.String(code) - } else { - return credentials.Value{ProviderName: ProviderName}, - awserr.New("AssumeRoleTokenNotAvailable", - "assume role with MFA enabled, but neither TokenCode nor TokenProvider are set", nil) - } - } - - var roleOutput *sts.AssumeRoleOutput - var err error - - if c, ok := p.Client.(assumeRolerWithContext); ok { - roleOutput, err = c.AssumeRoleWithContext(ctx, input) - } else { - roleOutput, err = p.Client.AssumeRole(input) - } - - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - - // We will proactively generate new credentials before they expire. - p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow) - - return credentials.Value{ - AccessKeyID: *roleOutput.Credentials.AccessKeyId, - SecretAccessKey: *roleOutput.Credentials.SecretAccessKey, - SessionToken: *roleOutput.Credentials.SessionToken, - ProviderName: ProviderName, - }, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go deleted file mode 100644 index cefe2a76d4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go +++ /dev/null @@ -1,154 +0,0 @@ -package stscreds - -import ( - "fmt" - "io/ioutil" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/service/sts" - "github.com/aws/aws-sdk-go/service/sts/stsiface" -) - -const ( - // ErrCodeWebIdentity will be used as an error code when constructing - // a new error to be returned during session creation or retrieval. - ErrCodeWebIdentity = "WebIdentityErr" - - // WebIdentityProviderName is the web identity provider name - WebIdentityProviderName = "WebIdentityCredentials" -) - -// now is used to return a time.Time object representing -// the current time. This can be used to easily test and -// compare test values. -var now = time.Now - -// TokenFetcher shuold return WebIdentity token bytes or an error -type TokenFetcher interface { - FetchToken(credentials.Context) ([]byte, error) -} - -// FetchTokenPath is a path to a WebIdentity token file -type FetchTokenPath string - -// FetchToken returns a token by reading from the filesystem -func (f FetchTokenPath) FetchToken(ctx credentials.Context) ([]byte, error) { - data, err := ioutil.ReadFile(string(f)) - if err != nil { - errMsg := fmt.Sprintf("unable to read file at %s", f) - return nil, awserr.New(ErrCodeWebIdentity, errMsg, err) - } - return data, nil -} - -// WebIdentityRoleProvider is used to retrieve credentials using -// an OIDC token. -type WebIdentityRoleProvider struct { - credentials.Expiry - PolicyArns []*sts.PolicyDescriptorType - - // Duration the STS credentials will be valid for. Truncated to seconds. - // If unset, the assumed role will use AssumeRoleWithWebIdentity's default - // expiry duration. See - // https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#STS.AssumeRoleWithWebIdentity - // for more information. - Duration time.Duration - - // The amount of time the credentials will be refreshed before they expire. - // This is useful refresh credentials before they expire to reduce risk of - // using credentials as they expire. If unset, will default to no expiry - // window. - ExpiryWindow time.Duration - - client stsiface.STSAPI - - tokenFetcher TokenFetcher - roleARN string - roleSessionName string -} - -// NewWebIdentityCredentials will return a new set of credentials with a given -// configuration, role arn, and token file path. -func NewWebIdentityCredentials(c client.ConfigProvider, roleARN, roleSessionName, path string) *credentials.Credentials { - svc := sts.New(c) - p := NewWebIdentityRoleProvider(svc, roleARN, roleSessionName, path) - return credentials.NewCredentials(p) -} - -// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the -// provided stsiface.STSAPI -func NewWebIdentityRoleProvider(svc stsiface.STSAPI, roleARN, roleSessionName, path string) *WebIdentityRoleProvider { - return NewWebIdentityRoleProviderWithToken(svc, roleARN, roleSessionName, FetchTokenPath(path)) -} - -// NewWebIdentityRoleProviderWithToken will return a new WebIdentityRoleProvider with the -// provided stsiface.STSAPI and a TokenFetcher -func NewWebIdentityRoleProviderWithToken(svc stsiface.STSAPI, roleARN, roleSessionName string, tokenFetcher TokenFetcher) *WebIdentityRoleProvider { - return &WebIdentityRoleProvider{ - client: svc, - tokenFetcher: tokenFetcher, - roleARN: roleARN, - roleSessionName: roleSessionName, - } -} - -// Retrieve will attempt to assume a role from a token which is located at -// 'WebIdentityTokenFilePath' specified destination and if that is empty an -// error will be returned. -func (p *WebIdentityRoleProvider) Retrieve() (credentials.Value, error) { - return p.RetrieveWithContext(aws.BackgroundContext()) -} - -// RetrieveWithContext will attempt to assume a role from a token which is located at -// 'WebIdentityTokenFilePath' specified destination and if that is empty an -// error will be returned. -func (p *WebIdentityRoleProvider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) { - b, err := p.tokenFetcher.FetchToken(ctx) - if err != nil { - return credentials.Value{}, awserr.New(ErrCodeWebIdentity, "failed fetching WebIdentity token: ", err) - } - - sessionName := p.roleSessionName - if len(sessionName) == 0 { - // session name is used to uniquely identify a session. This simply - // uses unix time in nanoseconds to uniquely identify sessions. - sessionName = strconv.FormatInt(now().UnixNano(), 10) - } - - var duration *int64 - if p.Duration != 0 { - duration = aws.Int64(int64(p.Duration / time.Second)) - } - - req, resp := p.client.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ - PolicyArns: p.PolicyArns, - RoleArn: &p.roleARN, - RoleSessionName: &sessionName, - WebIdentityToken: aws.String(string(b)), - DurationSeconds: duration, - }) - - req.SetContext(ctx) - - // InvalidIdentityToken error is a temporary error that can occur - // when assuming an Role with a JWT web identity token. - req.RetryErrorCodes = append(req.RetryErrorCodes, sts.ErrCodeInvalidIdentityTokenException) - if err := req.Send(); err != nil { - return credentials.Value{}, awserr.New(ErrCodeWebIdentity, "failed to retrieve credentials", err) - } - - p.SetExpiration(aws.TimeValue(resp.Credentials.Expiration), p.ExpiryWindow) - - value := credentials.Value{ - AccessKeyID: aws.StringValue(resp.Credentials.AccessKeyId), - SecretAccessKey: aws.StringValue(resp.Credentials.SecretAccessKey), - SessionToken: aws.StringValue(resp.Credentials.SessionToken), - ProviderName: WebIdentityProviderName, - } - return value, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go deleted file mode 100644 index 25a66d1dda..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go +++ /dev/null @@ -1,69 +0,0 @@ -// Package csm provides the Client Side Monitoring (CSM) client which enables -// sending metrics via UDP connection to the CSM agent. This package provides -// control options, and configuration for the CSM client. The client can be -// controlled manually, or automatically via the SDK's Session configuration. -// -// Enabling CSM client via SDK's Session configuration -// -// The CSM client can be enabled automatically via SDK's Session configuration. -// The SDK's session configuration enables the CSM client if the AWS_CSM_PORT -// environment variable is set to a non-empty value. -// -// The configuration options for the CSM client via the SDK's session -// configuration are: -// -// * AWS_CSM_PORT= -// The port number the CSM agent will receive metrics on. -// -// * AWS_CSM_HOST= -// The hostname, or IP address the CSM agent will receive metrics on. -// Without port number. -// -// Manually enabling the CSM client -// -// The CSM client can be started, paused, and resumed manually. The Start -// function will enable the CSM client to publish metrics to the CSM agent. It -// is safe to call Start concurrently, but if Start is called additional times -// with different ClientID or address it will panic. -// -// r, err := csm.Start("clientID", ":31000") -// if err != nil { -// panic(fmt.Errorf("failed starting CSM: %v", err)) -// } -// -// When controlling the CSM client manually, you must also inject its request -// handlers into the SDK's Session configuration for the SDK's API clients to -// publish metrics. -// -// sess, err := session.NewSession(&aws.Config{}) -// if err != nil { -// panic(fmt.Errorf("failed loading session: %v", err)) -// } -// -// // Add CSM client's metric publishing request handlers to the SDK's -// // Session Configuration. -// r.InjectHandlers(&sess.Handlers) -// -// Controlling CSM client -// -// Once the CSM client has been enabled the Get function will return a Reporter -// value that you can use to pause and resume the metrics published to the CSM -// agent. If Get function is called before the reporter is enabled with the -// Start function or via SDK's Session configuration nil will be returned. -// -// The Pause method can be called to stop the CSM client publishing metrics to -// the CSM agent. The Continue method will resume metric publishing. -// -// // Get the CSM client Reporter. -// r := csm.Get() -// -// // Will pause monitoring -// r.Pause() -// resp, err = client.GetObject(&s3.GetObjectInput{ -// Bucket: aws.String("bucket"), -// Key: aws.String("key"), -// }) -// -// // Resume monitoring -// r.Continue() -package csm diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go deleted file mode 100644 index 4b19e2800e..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go +++ /dev/null @@ -1,89 +0,0 @@ -package csm - -import ( - "fmt" - "strings" - "sync" -) - -var ( - lock sync.Mutex -) - -const ( - // DefaultPort is used when no port is specified. - DefaultPort = "31000" - - // DefaultHost is the host that will be used when none is specified. - DefaultHost = "127.0.0.1" -) - -// AddressWithDefaults returns a CSM address built from the host and port -// values. If the host or port is not set, default values will be used -// instead. If host is "localhost" it will be replaced with "127.0.0.1". -func AddressWithDefaults(host, port string) string { - if len(host) == 0 || strings.EqualFold(host, "localhost") { - host = DefaultHost - } - - if len(port) == 0 { - port = DefaultPort - } - - // Only IP6 host can contain a colon - if strings.Contains(host, ":") { - return "[" + host + "]:" + port - } - - return host + ":" + port -} - -// Start will start a long running go routine to capture -// client side metrics. Calling start multiple time will only -// start the metric listener once and will panic if a different -// client ID or port is passed in. -// -// r, err := csm.Start("clientID", "127.0.0.1:31000") -// if err != nil { -// panic(fmt.Errorf("expected no error, but received %v", err)) -// } -// sess := session.NewSession() -// r.InjectHandlers(sess.Handlers) -// -// svc := s3.New(sess) -// out, err := svc.GetObject(&s3.GetObjectInput{ -// Bucket: aws.String("bucket"), -// Key: aws.String("key"), -// }) -func Start(clientID string, url string) (*Reporter, error) { - lock.Lock() - defer lock.Unlock() - - if sender == nil { - sender = newReporter(clientID, url) - } else { - if sender.clientID != clientID { - panic(fmt.Errorf("inconsistent client IDs. %q was expected, but received %q", sender.clientID, clientID)) - } - - if sender.url != url { - panic(fmt.Errorf("inconsistent URLs. %q was expected, but received %q", sender.url, url)) - } - } - - if err := connect(url); err != nil { - sender = nil - return nil, err - } - - return sender, nil -} - -// Get will return a reporter if one exists, if one does not exist, nil will -// be returned. -func Get() *Reporter { - lock.Lock() - defer lock.Unlock() - - return sender -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go deleted file mode 100644 index 5bacc791a1..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go +++ /dev/null @@ -1,109 +0,0 @@ -package csm - -import ( - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" -) - -type metricTime time.Time - -func (t metricTime) MarshalJSON() ([]byte, error) { - ns := time.Duration(time.Time(t).UnixNano()) - return []byte(strconv.FormatInt(int64(ns/time.Millisecond), 10)), nil -} - -type metric struct { - ClientID *string `json:"ClientId,omitempty"` - API *string `json:"Api,omitempty"` - Service *string `json:"Service,omitempty"` - Timestamp *metricTime `json:"Timestamp,omitempty"` - Type *string `json:"Type,omitempty"` - Version *int `json:"Version,omitempty"` - - AttemptCount *int `json:"AttemptCount,omitempty"` - Latency *int `json:"Latency,omitempty"` - - Fqdn *string `json:"Fqdn,omitempty"` - UserAgent *string `json:"UserAgent,omitempty"` - AttemptLatency *int `json:"AttemptLatency,omitempty"` - - SessionToken *string `json:"SessionToken,omitempty"` - Region *string `json:"Region,omitempty"` - AccessKey *string `json:"AccessKey,omitempty"` - HTTPStatusCode *int `json:"HttpStatusCode,omitempty"` - XAmzID2 *string `json:"XAmzId2,omitempty"` - XAmzRequestID *string `json:"XAmznRequestId,omitempty"` - - AWSException *string `json:"AwsException,omitempty"` - AWSExceptionMessage *string `json:"AwsExceptionMessage,omitempty"` - SDKException *string `json:"SdkException,omitempty"` - SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"` - - FinalHTTPStatusCode *int `json:"FinalHttpStatusCode,omitempty"` - FinalAWSException *string `json:"FinalAwsException,omitempty"` - FinalAWSExceptionMessage *string `json:"FinalAwsExceptionMessage,omitempty"` - FinalSDKException *string `json:"FinalSdkException,omitempty"` - FinalSDKExceptionMessage *string `json:"FinalSdkExceptionMessage,omitempty"` - - DestinationIP *string `json:"DestinationIp,omitempty"` - ConnectionReused *int `json:"ConnectionReused,omitempty"` - - AcquireConnectionLatency *int `json:"AcquireConnectionLatency,omitempty"` - ConnectLatency *int `json:"ConnectLatency,omitempty"` - RequestLatency *int `json:"RequestLatency,omitempty"` - DNSLatency *int `json:"DnsLatency,omitempty"` - TCPLatency *int `json:"TcpLatency,omitempty"` - SSLLatency *int `json:"SslLatency,omitempty"` - - MaxRetriesExceeded *int `json:"MaxRetriesExceeded,omitempty"` -} - -func (m *metric) TruncateFields() { - m.ClientID = truncateString(m.ClientID, 255) - m.UserAgent = truncateString(m.UserAgent, 256) - - m.AWSException = truncateString(m.AWSException, 128) - m.AWSExceptionMessage = truncateString(m.AWSExceptionMessage, 512) - - m.SDKException = truncateString(m.SDKException, 128) - m.SDKExceptionMessage = truncateString(m.SDKExceptionMessage, 512) - - m.FinalAWSException = truncateString(m.FinalAWSException, 128) - m.FinalAWSExceptionMessage = truncateString(m.FinalAWSExceptionMessage, 512) - - m.FinalSDKException = truncateString(m.FinalSDKException, 128) - m.FinalSDKExceptionMessage = truncateString(m.FinalSDKExceptionMessage, 512) -} - -func truncateString(v *string, l int) *string { - if v != nil && len(*v) > l { - nv := (*v)[:l] - return &nv - } - - return v -} - -func (m *metric) SetException(e metricException) { - switch te := e.(type) { - case awsException: - m.AWSException = aws.String(te.exception) - m.AWSExceptionMessage = aws.String(te.message) - case sdkException: - m.SDKException = aws.String(te.exception) - m.SDKExceptionMessage = aws.String(te.message) - } -} - -func (m *metric) SetFinalException(e metricException) { - switch te := e.(type) { - case awsException: - m.FinalAWSException = aws.String(te.exception) - m.FinalAWSExceptionMessage = aws.String(te.message) - case sdkException: - m.FinalSDKException = aws.String(te.exception) - m.FinalSDKExceptionMessage = aws.String(te.message) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go deleted file mode 100644 index 82a3e345e9..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go +++ /dev/null @@ -1,55 +0,0 @@ -package csm - -import ( - "sync/atomic" -) - -const ( - runningEnum = iota - pausedEnum -) - -var ( - // MetricsChannelSize of metrics to hold in the channel - MetricsChannelSize = 100 -) - -type metricChan struct { - ch chan metric - paused *int64 -} - -func newMetricChan(size int) metricChan { - return metricChan{ - ch: make(chan metric, size), - paused: new(int64), - } -} - -func (ch *metricChan) Pause() { - atomic.StoreInt64(ch.paused, pausedEnum) -} - -func (ch *metricChan) Continue() { - atomic.StoreInt64(ch.paused, runningEnum) -} - -func (ch *metricChan) IsPaused() bool { - v := atomic.LoadInt64(ch.paused) - return v == pausedEnum -} - -// Push will push metrics to the metric channel if the channel -// is not paused -func (ch *metricChan) Push(m metric) bool { - if ch.IsPaused() { - return false - } - - select { - case ch.ch <- m: - return true - default: - return false - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go deleted file mode 100644 index 54a99280ce..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go +++ /dev/null @@ -1,26 +0,0 @@ -package csm - -type metricException interface { - Exception() string - Message() string -} - -type requestException struct { - exception string - message string -} - -func (e requestException) Exception() string { - return e.exception -} -func (e requestException) Message() string { - return e.message -} - -type awsException struct { - requestException -} - -type sdkException struct { - requestException -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go deleted file mode 100644 index 835bcd49cb..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go +++ /dev/null @@ -1,264 +0,0 @@ -package csm - -import ( - "encoding/json" - "net" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -// Reporter will gather metrics of API requests made and -// send those metrics to the CSM endpoint. -type Reporter struct { - clientID string - url string - conn net.Conn - metricsCh metricChan - done chan struct{} -} - -var ( - sender *Reporter -) - -func connect(url string) error { - const network = "udp" - if err := sender.connect(network, url); err != nil { - return err - } - - if sender.done == nil { - sender.done = make(chan struct{}) - go sender.start() - } - - return nil -} - -func newReporter(clientID, url string) *Reporter { - return &Reporter{ - clientID: clientID, - url: url, - metricsCh: newMetricChan(MetricsChannelSize), - } -} - -func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) { - if rep == nil { - return - } - - now := time.Now() - creds, _ := r.Config.Credentials.Get() - - m := metric{ - ClientID: aws.String(rep.clientID), - API: aws.String(r.Operation.Name), - Service: aws.String(r.ClientInfo.ServiceID), - Timestamp: (*metricTime)(&now), - UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")), - Region: r.Config.Region, - Type: aws.String("ApiCallAttempt"), - Version: aws.Int(1), - - XAmzRequestID: aws.String(r.RequestID), - - AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))), - AccessKey: aws.String(creds.AccessKeyID), - } - - if r.HTTPResponse != nil { - m.HTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode) - } - - if r.Error != nil { - if awserr, ok := r.Error.(awserr.Error); ok { - m.SetException(getMetricException(awserr)) - } - } - - m.TruncateFields() - rep.metricsCh.Push(m) -} - -func getMetricException(err awserr.Error) metricException { - msg := err.Error() - code := err.Code() - - switch code { - case request.ErrCodeRequestError, - request.ErrCodeSerialization, - request.CanceledErrorCode: - return sdkException{ - requestException{exception: code, message: msg}, - } - default: - return awsException{ - requestException{exception: code, message: msg}, - } - } -} - -func (rep *Reporter) sendAPICallMetric(r *request.Request) { - if rep == nil { - return - } - - now := time.Now() - m := metric{ - ClientID: aws.String(rep.clientID), - API: aws.String(r.Operation.Name), - Service: aws.String(r.ClientInfo.ServiceID), - Timestamp: (*metricTime)(&now), - UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")), - Type: aws.String("ApiCall"), - AttemptCount: aws.Int(r.RetryCount + 1), - Region: r.Config.Region, - Latency: aws.Int(int(time.Since(r.Time) / time.Millisecond)), - XAmzRequestID: aws.String(r.RequestID), - MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())), - } - - if r.HTTPResponse != nil { - m.FinalHTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode) - } - - if r.Error != nil { - if awserr, ok := r.Error.(awserr.Error); ok { - m.SetFinalException(getMetricException(awserr)) - } - } - - m.TruncateFields() - - // TODO: Probably want to figure something out for logging dropped - // metrics - rep.metricsCh.Push(m) -} - -func (rep *Reporter) connect(network, url string) error { - if rep.conn != nil { - rep.conn.Close() - } - - conn, err := net.Dial(network, url) - if err != nil { - return awserr.New("UDPError", "Could not connect", err) - } - - rep.conn = conn - - return nil -} - -func (rep *Reporter) close() { - if rep.done != nil { - close(rep.done) - } - - rep.metricsCh.Pause() -} - -func (rep *Reporter) start() { - defer func() { - rep.metricsCh.Pause() - }() - - for { - select { - case <-rep.done: - rep.done = nil - return - case m := <-rep.metricsCh.ch: - // TODO: What to do with this error? Probably should just log - b, err := json.Marshal(m) - if err != nil { - continue - } - - rep.conn.Write(b) - } - } -} - -// Pause will pause the metric channel preventing any new metrics from being -// added. It is safe to call concurrently with other calls to Pause, but if -// called concurently with Continue can lead to unexpected state. -func (rep *Reporter) Pause() { - lock.Lock() - defer lock.Unlock() - - if rep == nil { - return - } - - rep.close() -} - -// Continue will reopen the metric channel and allow for monitoring to be -// resumed. It is safe to call concurrently with other calls to Continue, but -// if called concurently with Pause can lead to unexpected state. -func (rep *Reporter) Continue() { - lock.Lock() - defer lock.Unlock() - if rep == nil { - return - } - - if !rep.metricsCh.IsPaused() { - return - } - - rep.metricsCh.Continue() -} - -// Client side metric handler names -const ( - APICallMetricHandlerName = "awscsm.SendAPICallMetric" - APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric" -) - -// InjectHandlers will will enable client side metrics and inject the proper -// handlers to handle how metrics are sent. -// -// InjectHandlers is NOT safe to call concurrently. Calling InjectHandlers -// multiple times may lead to unexpected behavior, (e.g. duplicate metrics). -// -// // Start must be called in order to inject the correct handlers -// r, err := csm.Start("clientID", "127.0.0.1:8094") -// if err != nil { -// panic(fmt.Errorf("expected no error, but received %v", err)) -// } -// -// sess := session.NewSession() -// r.InjectHandlers(&sess.Handlers) -// -// // create a new service client with our client side metric session -// svc := s3.New(sess) -func (rep *Reporter) InjectHandlers(handlers *request.Handlers) { - if rep == nil { - return - } - - handlers.Complete.PushFrontNamed(request.NamedHandler{ - Name: APICallMetricHandlerName, - Fn: rep.sendAPICallMetric, - }) - - handlers.CompleteAttempt.PushFrontNamed(request.NamedHandler{ - Name: APICallAttemptMetricHandlerName, - Fn: rep.sendAPICallAttemptMetric, - }) -} - -// boolIntValue return 1 for true and 0 for false. -func boolIntValue(b bool) int { - if b { - return 1 - } - - return 0 -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go deleted file mode 100644 index 23bb639e01..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go +++ /dev/null @@ -1,207 +0,0 @@ -// Package defaults is a collection of helpers to retrieve the SDK's default -// configuration and handlers. -// -// Generally this package shouldn't be used directly, but session.Session -// instead. This package is useful when you need to reset the defaults -// of a session or service client to the SDK defaults before setting -// additional parameters. -package defaults - -import ( - "fmt" - "net" - "net/http" - "net/url" - "os" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -// A Defaults provides a collection of default values for SDK clients. -type Defaults struct { - Config *aws.Config - Handlers request.Handlers -} - -// Get returns the SDK's default values with Config and handlers pre-configured. -func Get() Defaults { - cfg := Config() - handlers := Handlers() - cfg.Credentials = CredChain(cfg, handlers) - - return Defaults{ - Config: cfg, - Handlers: handlers, - } -} - -// Config returns the default configuration without credentials. -// To retrieve a config with credentials also included use -// `defaults.Get().Config` instead. -// -// Generally you shouldn't need to use this method directly, but -// is available if you need to reset the configuration of an -// existing service client or session. -func Config() *aws.Config { - return aws.NewConfig(). - WithCredentials(credentials.AnonymousCredentials). - WithRegion(os.Getenv("AWS_REGION")). - WithHTTPClient(http.DefaultClient). - WithMaxRetries(aws.UseServiceDefaultRetries). - WithLogger(aws.NewDefaultLogger()). - WithLogLevel(aws.LogOff). - WithEndpointResolver(endpoints.DefaultResolver()) -} - -// Handlers returns the default request handlers. -// -// Generally you shouldn't need to use this method directly, but -// is available if you need to reset the request handlers of an -// existing service client or session. -func Handlers() request.Handlers { - var handlers request.Handlers - - handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) - handlers.Validate.AfterEachFn = request.HandlerListStopOnError - handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) - handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHander) - handlers.Build.AfterEachFn = request.HandlerListStopOnError - handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) - handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler) - handlers.Send.PushBackNamed(corehandlers.SendHandler) - handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) - handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler) - - return handlers -} - -// CredChain returns the default credential chain. -// -// Generally you shouldn't need to use this method directly, but -// is available if you need to reset the credentials of an -// existing service client or session's Config. -func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials { - return credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: CredProviders(cfg, handlers), - }) -} - -// CredProviders returns the slice of providers used in -// the default credential chain. -// -// For applications that need to use some other provider (for example use -// different environment variables for legacy reasons) but still fall back -// on the default chain of providers. This allows that default chaint to be -// automatically updated -func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Provider { - return []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - RemoteCredProvider(*cfg, handlers), - } -} - -const ( - httpProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN" - httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" -) - -// RemoteCredProvider returns a credentials provider for the default remote -// endpoints such as EC2 or ECS Roles. -func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { - if u := os.Getenv(httpProviderEnvVar); len(u) > 0 { - return localHTTPCredProvider(cfg, handlers, u) - } - - if uri := os.Getenv(shareddefaults.ECSCredsProviderEnvVar); len(uri) > 0 { - u := fmt.Sprintf("%s%s", shareddefaults.ECSContainerCredentialsURI, uri) - return httpCredProvider(cfg, handlers, u) - } - - return ec2RoleProvider(cfg, handlers) -} - -var lookupHostFn = net.LookupHost - -func isLoopbackHost(host string) (bool, error) { - ip := net.ParseIP(host) - if ip != nil { - return ip.IsLoopback(), nil - } - - // Host is not an ip, perform lookup - addrs, err := lookupHostFn(host) - if err != nil { - return false, err - } - for _, addr := range addrs { - if !net.ParseIP(addr).IsLoopback() { - return false, nil - } - } - - return true, nil -} - -func localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider { - var errMsg string - - parsed, err := url.Parse(u) - if err != nil { - errMsg = fmt.Sprintf("invalid URL, %v", err) - } else { - host := aws.URLHostname(parsed) - if len(host) == 0 { - errMsg = "unable to parse host from local HTTP cred provider URL" - } else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil { - errMsg = fmt.Sprintf("failed to resolve host %q, %v", host, loopbackErr) - } else if !isLoopback { - errMsg = fmt.Sprintf("invalid endpoint host, %q, only loopback hosts are allowed.", host) - } - } - - if len(errMsg) > 0 { - if cfg.Logger != nil { - cfg.Logger.Log("Ignoring, HTTP credential provider", errMsg, err) - } - return credentials.ErrorProvider{ - Err: awserr.New("CredentialsEndpointError", errMsg, err), - ProviderName: endpointcreds.ProviderName, - } - } - - return httpCredProvider(cfg, handlers, u) -} - -func httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider { - return endpointcreds.NewProviderClient(cfg, handlers, u, - func(p *endpointcreds.Provider) { - p.ExpiryWindow = 5 * time.Minute - p.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar) - }, - ) -} - -func ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { - resolver := cfg.EndpointResolver - if resolver == nil { - resolver = endpoints.DefaultResolver() - } - - e, _ := resolver.EndpointFor(endpoints.Ec2metadataServiceID, "") - return &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.NewClient(cfg, handlers, e.URL, e.SigningRegion), - ExpiryWindow: 5 * time.Minute, - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go deleted file mode 100644 index ca0ee1dcc7..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go +++ /dev/null @@ -1,27 +0,0 @@ -package defaults - -import ( - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -// SharedCredentialsFilename returns the SDK's default file path -// for the shared credentials file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/credentials -// - Windows: %USERPROFILE%\.aws\credentials -func SharedCredentialsFilename() string { - return shareddefaults.SharedCredentialsFilename() -} - -// SharedConfigFilename returns the SDK's default file path for -// the shared config file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/config -// - Windows: %USERPROFILE%\.aws\config -func SharedConfigFilename() string { - return shareddefaults.SharedConfigFilename() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/doc.go deleted file mode 100644 index 4fcb616184..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/doc.go +++ /dev/null @@ -1,56 +0,0 @@ -// Package aws provides the core SDK's utilities and shared types. Use this package's -// utilities to simplify setting and reading API operations parameters. -// -// Value and Pointer Conversion Utilities -// -// This package includes a helper conversion utility for each scalar type the SDK's -// API use. These utilities make getting a pointer of the scalar, and dereferencing -// a pointer easier. -// -// Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. -// The Pointer to value will safely dereference the pointer and return its value. -// If the pointer was nil, the scalar's zero value will be returned. -// -// The value to pointer functions will be named after the scalar type. So get a -// *string from a string value use the "String" function. This makes it easy to -// to get pointer of a literal string value, because getting the address of a -// literal requires assigning the value to a variable first. -// -// var strPtr *string -// -// // Without the SDK's conversion functions -// str := "my string" -// strPtr = &str -// -// // With the SDK's conversion functions -// strPtr = aws.String("my string") -// -// // Convert *string to string value -// str = aws.StringValue(strPtr) -// -// In addition to scalars the aws package also includes conversion utilities for -// map and slice for commonly types used in API parameters. The map and slice -// conversion functions use similar naming pattern as the scalar conversion -// functions. -// -// var strPtrs []*string -// var strs []string = []string{"Go", "Gophers", "Go"} -// -// // Convert []string to []*string -// strPtrs = aws.StringSlice(strs) -// -// // Convert []*string to []string -// strs = aws.StringValueSlice(strPtrs) -// -// SDK Default HTTP Client -// -// The SDK will use the http.DefaultClient if a HTTP client is not provided to -// the SDK's Session, or service client constructor. This means that if the -// http.DefaultClient is modified by other components of your application the -// modifications will be picked up by the SDK as well. -// -// In some cases this might be intended, but it is a better practice to create -// a custom HTTP Client to share explicitly through your application. You can -// configure the SDK to use the custom HTTP Client by setting the HTTPClient -// value of the SDK's Config type when creating a Session or service client. -package aws diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go deleted file mode 100644 index 69fa63dc08..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ /dev/null @@ -1,250 +0,0 @@ -package ec2metadata - -import ( - "encoding/json" - "fmt" - "net/http" - "strconv" - "strings" - "time" - - "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/internal/sdkuri" -) - -// getToken uses the duration to return a token for EC2 metadata service, -// or an error if the request failed. -func (c *EC2Metadata) getToken(ctx aws.Context, duration time.Duration) (tokenOutput, error) { - op := &request.Operation{ - Name: "GetToken", - HTTPMethod: "PUT", - HTTPPath: "/latest/api/token", - } - - var output tokenOutput - req := c.NewRequest(op, nil, &output) - req.SetContext(ctx) - - // remove the fetch token handler from the request handlers to avoid infinite recursion - req.Handlers.Sign.RemoveByName(fetchTokenHandlerName) - - // Swap the unmarshalMetadataHandler with unmarshalTokenHandler on this request. - req.Handlers.Unmarshal.Swap(unmarshalMetadataHandlerName, unmarshalTokenHandler) - - ttl := strconv.FormatInt(int64(duration/time.Second), 10) - req.HTTPRequest.Header.Set(ttlHeader, ttl) - - err := req.Send() - - // Errors with bad request status should be returned. - if err != nil { - err = awserr.NewRequestFailure( - awserr.New(req.HTTPResponse.Status, http.StatusText(req.HTTPResponse.StatusCode), err), - req.HTTPResponse.StatusCode, req.RequestID) - } - - return output, err -} - -// GetMetadata uses the path provided to request information from the EC2 -// instance metadata service. The content will be returned as a string, or -// error if the request failed. -func (c *EC2Metadata) GetMetadata(p string) (string, error) { - return c.GetMetadataWithContext(aws.BackgroundContext(), p) -} - -// GetMetadataWithContext uses the path provided to request information from the EC2 -// instance metadata service. The content will be returned as a string, or -// error if the request failed. -func (c *EC2Metadata) GetMetadataWithContext(ctx aws.Context, p string) (string, error) { - op := &request.Operation{ - Name: "GetMetadata", - HTTPMethod: "GET", - HTTPPath: sdkuri.PathJoin("/latest/meta-data", p), - } - output := &metadataOutput{} - - req := c.NewRequest(op, nil, output) - - req.SetContext(ctx) - - err := req.Send() - return output.Content, err -} - -// GetUserData returns the userdata that was configured for the service. If -// there is no user-data setup for the EC2 instance a "NotFoundError" error -// code will be returned. -func (c *EC2Metadata) GetUserData() (string, error) { - return c.GetUserDataWithContext(aws.BackgroundContext()) -} - -// GetUserDataWithContext returns the userdata that was configured for the service. If -// there is no user-data setup for the EC2 instance a "NotFoundError" error -// code will be returned. -func (c *EC2Metadata) GetUserDataWithContext(ctx aws.Context) (string, error) { - op := &request.Operation{ - Name: "GetUserData", - HTTPMethod: "GET", - HTTPPath: "/latest/user-data", - } - - output := &metadataOutput{} - req := c.NewRequest(op, nil, output) - req.SetContext(ctx) - - err := req.Send() - return output.Content, err -} - -// GetDynamicData uses the path provided to request information from the EC2 -// instance metadata service for dynamic data. The content will be returned -// as a string, or error if the request failed. -func (c *EC2Metadata) GetDynamicData(p string) (string, error) { - return c.GetDynamicDataWithContext(aws.BackgroundContext(), p) -} - -// GetDynamicDataWithContext uses the path provided to request information from the EC2 -// instance metadata service for dynamic data. The content will be returned -// as a string, or error if the request failed. -func (c *EC2Metadata) GetDynamicDataWithContext(ctx aws.Context, p string) (string, error) { - op := &request.Operation{ - Name: "GetDynamicData", - HTTPMethod: "GET", - HTTPPath: sdkuri.PathJoin("/latest/dynamic", p), - } - - output := &metadataOutput{} - req := c.NewRequest(op, nil, output) - req.SetContext(ctx) - - err := req.Send() - return output.Content, err -} - -// GetInstanceIdentityDocument retrieves an identity document describing an -// instance. Error is returned if the request fails or is unable to parse -// the response. -func (c *EC2Metadata) GetInstanceIdentityDocument() (EC2InstanceIdentityDocument, error) { - return c.GetInstanceIdentityDocumentWithContext(aws.BackgroundContext()) -} - -// GetInstanceIdentityDocumentWithContext retrieves an identity document describing an -// instance. Error is returned if the request fails or is unable to parse -// the response. -func (c *EC2Metadata) GetInstanceIdentityDocumentWithContext(ctx aws.Context) (EC2InstanceIdentityDocument, error) { - resp, err := c.GetDynamicDataWithContext(ctx, "instance-identity/document") - if err != nil { - return EC2InstanceIdentityDocument{}, - awserr.New("EC2MetadataRequestError", - "failed to get EC2 instance identity document", err) - } - - doc := EC2InstanceIdentityDocument{} - if err := json.NewDecoder(strings.NewReader(resp)).Decode(&doc); err != nil { - return EC2InstanceIdentityDocument{}, - awserr.New(request.ErrCodeSerialization, - "failed to decode EC2 instance identity document", err) - } - - return doc, nil -} - -// IAMInfo retrieves IAM info from the metadata API -func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) { - return c.IAMInfoWithContext(aws.BackgroundContext()) -} - -// IAMInfoWithContext retrieves IAM info from the metadata API -func (c *EC2Metadata) IAMInfoWithContext(ctx aws.Context) (EC2IAMInfo, error) { - resp, err := c.GetMetadataWithContext(ctx, "iam/info") - if err != nil { - return EC2IAMInfo{}, - awserr.New("EC2MetadataRequestError", - "failed to get EC2 IAM info", err) - } - - info := EC2IAMInfo{} - if err := json.NewDecoder(strings.NewReader(resp)).Decode(&info); err != nil { - return EC2IAMInfo{}, - awserr.New(request.ErrCodeSerialization, - "failed to decode EC2 IAM info", err) - } - - if info.Code != "Success" { - errMsg := fmt.Sprintf("failed to get EC2 IAM Info (%s)", info.Code) - return EC2IAMInfo{}, - awserr.New("EC2MetadataError", errMsg, nil) - } - - return info, nil -} - -// Region returns the region the instance is running in. -func (c *EC2Metadata) Region() (string, error) { - return c.RegionWithContext(aws.BackgroundContext()) -} - -// RegionWithContext returns the region the instance is running in. -func (c *EC2Metadata) RegionWithContext(ctx aws.Context) (string, error) { - ec2InstanceIdentityDocument, err := c.GetInstanceIdentityDocumentWithContext(ctx) - if err != nil { - return "", err - } - // extract region from the ec2InstanceIdentityDocument - region := ec2InstanceIdentityDocument.Region - if len(region) == 0 { - return "", awserr.New("EC2MetadataError", "invalid region received for ec2metadata instance", nil) - } - // returns region - return region, nil -} - -// Available returns if the application has access to the EC2 Metadata service. -// Can be used to determine if application is running within an EC2 Instance and -// the metadata service is available. -func (c *EC2Metadata) Available() bool { - return c.AvailableWithContext(aws.BackgroundContext()) -} - -// AvailableWithContext returns if the application has access to the EC2 Metadata service. -// Can be used to determine if application is running within an EC2 Instance and -// the metadata service is available. -func (c *EC2Metadata) AvailableWithContext(ctx aws.Context) bool { - if _, err := c.GetMetadataWithContext(ctx, "instance-id"); err != nil { - return false - } - - return true -} - -// An EC2IAMInfo provides the shape for unmarshaling -// an IAM info from the metadata API -type EC2IAMInfo struct { - Code string - LastUpdated time.Time - InstanceProfileArn string - InstanceProfileID string -} - -// An EC2InstanceIdentityDocument provides the shape for unmarshaling -// an instance identity document -type EC2InstanceIdentityDocument struct { - DevpayProductCodes []string `json:"devpayProductCodes"` - MarketplaceProductCodes []string `json:"marketplaceProductCodes"` - AvailabilityZone string `json:"availabilityZone"` - PrivateIP string `json:"privateIp"` - Version string `json:"version"` - Region string `json:"region"` - InstanceID string `json:"instanceId"` - BillingProducts []string `json:"billingProducts"` - InstanceType string `json:"instanceType"` - AccountID string `json:"accountId"` - PendingTime time.Time `json:"pendingTime"` - ImageID string `json:"imageId"` - KernelID string `json:"kernelId"` - RamdiskID string `json:"ramdiskId"` - Architecture string `json:"architecture"` -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go deleted file mode 100644 index 8f35b3464b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ /dev/null @@ -1,245 +0,0 @@ -// Package ec2metadata provides the client for making API calls to the -// EC2 Metadata service. -// -// This package's client can be disabled completely by setting the environment -// variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to -// true instructs the SDK to disable the EC2 Metadata client. The client cannot -// be used while the environment variable is set to true, (case insensitive). -// -// The endpoint of the EC2 IMDS client can be configured via the environment -// variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a -// Session. See aws/session#Options.EC2IMDSEndpoint for more details. -package ec2metadata - -import ( - "bytes" - "errors" - "io" - "net/http" - "net/url" - "os" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" -) - -const ( - // ServiceName is the name of the service. - ServiceName = "ec2metadata" - disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED" - - // Headers for Token and TTL - ttlHeader = "x-aws-ec2-metadata-token-ttl-seconds" - tokenHeader = "x-aws-ec2-metadata-token" - - // Named Handler constants - fetchTokenHandlerName = "FetchTokenHandler" - unmarshalMetadataHandlerName = "unmarshalMetadataHandler" - unmarshalTokenHandlerName = "unmarshalTokenHandler" - enableTokenProviderHandlerName = "enableTokenProviderHandler" - - // TTL constants - defaultTTL = 21600 * time.Second - ttlExpirationWindow = 30 * time.Second -) - -// A EC2Metadata is an EC2 Metadata service Client. -type EC2Metadata struct { - *client.Client -} - -// New creates a new instance of the EC2Metadata client with a session. -// This client is safe to use across multiple goroutines. -// -// -// Example: -// // Create a EC2Metadata client from just a session. -// svc := ec2metadata.New(mySession) -// -// // Create a EC2Metadata client with additional configuration -// svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody)) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata { - c := p.ClientConfig(ServiceName, cfgs...) - return NewClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) -} - -// NewClient returns a new EC2Metadata client. Should be used to create -// a client when not using a session. Generally using just New with a session -// is preferred. -// -// Will remove the URL path from the endpoint provided to ensure the EC2 IMDS -// client is able to communicate with the EC2 IMDS API. -// -// If an unmodified HTTP client is provided from the stdlib default, or no client -// the EC2RoleProvider's EC2Metadata HTTP client's timeout will be shortened. -// To disable this set Config.EC2MetadataDisableTimeoutOverride to false. Enabled by default. -func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata { - if !aws.BoolValue(cfg.EC2MetadataDisableTimeoutOverride) && httpClientZero(cfg.HTTPClient) { - // If the http client is unmodified and this feature is not disabled - // set custom timeouts for EC2Metadata requests. - cfg.HTTPClient = &http.Client{ - // use a shorter timeout than default because the metadata - // service is local if it is running, and to fail faster - // if not running on an ec2 instance. - Timeout: 1 * time.Second, - } - // max number of retries on the client operation - cfg.MaxRetries = aws.Int(2) - } - - if u, err := url.Parse(endpoint); err == nil { - // Remove path from the endpoint since it will be added by requests. - // This is an artifact of the SDK adding `/latest` to the endpoint for - // EC2 IMDS, but this is now moved to the operation definition. - u.Path = "" - u.RawPath = "" - endpoint = u.String() - } - - svc := &EC2Metadata{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceName, - Endpoint: endpoint, - APIVersion: "latest", - }, - handlers, - ), - } - - // token provider instance - tp := newTokenProvider(svc, defaultTTL) - - // NamedHandler for fetching token - svc.Handlers.Sign.PushBackNamed(request.NamedHandler{ - Name: fetchTokenHandlerName, - Fn: tp.fetchTokenHandler, - }) - // NamedHandler for enabling token provider - svc.Handlers.Complete.PushBackNamed(request.NamedHandler{ - Name: enableTokenProviderHandlerName, - Fn: tp.enableTokenProviderHandler, - }) - - svc.Handlers.Unmarshal.PushBackNamed(unmarshalHandler) - svc.Handlers.UnmarshalError.PushBack(unmarshalError) - svc.Handlers.Validate.Clear() - svc.Handlers.Validate.PushBack(validateEndpointHandler) - - // Disable the EC2 Metadata service if the environment variable is set. - // This short-circuits the service's functionality to always fail to send - // requests. - if strings.ToLower(os.Getenv(disableServiceEnvVar)) == "true" { - svc.Handlers.Send.SwapNamed(request.NamedHandler{ - Name: corehandlers.SendHandler.Name, - Fn: func(r *request.Request) { - r.HTTPResponse = &http.Response{ - Header: http.Header{}, - } - r.Error = awserr.New( - request.CanceledErrorCode, - "EC2 IMDS access disabled via "+disableServiceEnvVar+" env var", - nil) - }, - }) - } - - // Add additional options to the service config - for _, option := range opts { - option(svc.Client) - } - return svc -} - -func httpClientZero(c *http.Client) bool { - return c == nil || (c.Transport == nil && c.CheckRedirect == nil && c.Jar == nil && c.Timeout == 0) -} - -type metadataOutput struct { - Content string -} - -type tokenOutput struct { - Token string - TTL time.Duration -} - -// unmarshal token handler is used to parse the response of a getToken operation -var unmarshalTokenHandler = request.NamedHandler{ - Name: unmarshalTokenHandlerName, - Fn: func(r *request.Request) { - defer r.HTTPResponse.Body.Close() - var b bytes.Buffer - if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, - "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) - return - } - - v := r.HTTPResponse.Header.Get(ttlHeader) - data, ok := r.Data.(*tokenOutput) - if !ok { - return - } - - data.Token = b.String() - // TTL is in seconds - i, err := strconv.ParseInt(v, 10, 64) - if err != nil { - r.Error = awserr.NewRequestFailure(awserr.New(request.ParamFormatErrCode, - "unable to parse EC2 token TTL response", err), r.HTTPResponse.StatusCode, r.RequestID) - return - } - t := time.Duration(i) * time.Second - data.TTL = t - }, -} - -var unmarshalHandler = request.NamedHandler{ - Name: unmarshalMetadataHandlerName, - Fn: func(r *request.Request) { - defer r.HTTPResponse.Body.Close() - var b bytes.Buffer - if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, - "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) - return - } - - if data, ok := r.Data.(*metadataOutput); ok { - data.Content = b.String() - } - }, -} - -func unmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - var b bytes.Buffer - - if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error response", err), - r.HTTPResponse.StatusCode, r.RequestID) - return - } - - // Response body format is not consistent between metadata endpoints. - // Grab the error message as a string and include that as the source error - r.Error = awserr.NewRequestFailure(awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())), - r.HTTPResponse.StatusCode, r.RequestID) -} - -func validateEndpointHandler(r *request.Request) { - if r.ClientInfo.Endpoint == "" { - r.Error = aws.ErrMissingEndpoint - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go deleted file mode 100644 index 4b29f190bf..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go +++ /dev/null @@ -1,93 +0,0 @@ -package ec2metadata - -import ( - "net/http" - "sync/atomic" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" -) - -// A tokenProvider struct provides access to EC2Metadata client -// and atomic instance of a token, along with configuredTTL for it. -// tokenProvider also provides an atomic flag to disable the -// fetch token operation. -// The disabled member will use 0 as false, and 1 as true. -type tokenProvider struct { - client *EC2Metadata - token atomic.Value - configuredTTL time.Duration - disabled uint32 -} - -// A ec2Token struct helps use of token in EC2 Metadata service ops -type ec2Token struct { - token string - credentials.Expiry -} - -// newTokenProvider provides a pointer to a tokenProvider instance -func newTokenProvider(c *EC2Metadata, duration time.Duration) *tokenProvider { - return &tokenProvider{client: c, configuredTTL: duration} -} - -// fetchTokenHandler fetches token for EC2Metadata service client by default. -func (t *tokenProvider) fetchTokenHandler(r *request.Request) { - - // short-circuits to insecure data flow if tokenProvider is disabled. - if v := atomic.LoadUint32(&t.disabled); v == 1 { - return - } - - if ec2Token, ok := t.token.Load().(ec2Token); ok && !ec2Token.IsExpired() { - r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) - return - } - - output, err := t.client.getToken(r.Context(), t.configuredTTL) - - if err != nil { - - // change the disabled flag on token provider to true, - // when error is request timeout error. - if requestFailureError, ok := err.(awserr.RequestFailure); ok { - switch requestFailureError.StatusCode() { - case http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed: - atomic.StoreUint32(&t.disabled, 1) - case http.StatusBadRequest: - r.Error = requestFailureError - } - - // Check if request timed out while waiting for response - if e, ok := requestFailureError.OrigErr().(awserr.Error); ok { - if e.Code() == request.ErrCodeRequestError { - atomic.StoreUint32(&t.disabled, 1) - } - } - } - return - } - - newToken := ec2Token{ - token: output.Token, - } - newToken.SetExpiration(time.Now().Add(output.TTL), ttlExpirationWindow) - t.token.Store(newToken) - - // Inject token header to the request. - if ec2Token, ok := t.token.Load().(ec2Token); ok { - r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) - } -} - -// enableTokenProviderHandler enables the token provider -func (t *tokenProvider) enableTokenProviderHandler(r *request.Request) { - // If the error code status is 401, we enable the token provider - if e, ok := r.Error.(awserr.RequestFailure); ok && e != nil && - e.StatusCode() == http.StatusUnauthorized { - t.token.Store(ec2Token{}) - atomic.StoreUint32(&t.disabled, 0) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go deleted file mode 100644 index 654fb1ad52..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go +++ /dev/null @@ -1,216 +0,0 @@ -package endpoints - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -type modelDefinition map[string]json.RawMessage - -// A DecodeModelOptions are the options for how the endpoints model definition -// are decoded. -type DecodeModelOptions struct { - SkipCustomizations bool -} - -// Set combines all of the option functions together. -func (d *DecodeModelOptions) Set(optFns ...func(*DecodeModelOptions)) { - for _, fn := range optFns { - fn(d) - } -} - -// DecodeModel unmarshals a Regions and Endpoint model definition file into -// a endpoint Resolver. If the file format is not supported, or an error occurs -// when unmarshaling the model an error will be returned. -// -// Casting the return value of this func to a EnumPartitions will -// allow you to get a list of the partitions in the order the endpoints -// will be resolved in. -// -// resolver, err := endpoints.DecodeModel(reader) -// -// partitions := resolver.(endpoints.EnumPartitions).Partitions() -// for _, p := range partitions { -// // ... inspect partitions -// } -func DecodeModel(r io.Reader, optFns ...func(*DecodeModelOptions)) (Resolver, error) { - var opts DecodeModelOptions - opts.Set(optFns...) - - // Get the version of the partition file to determine what - // unmarshaling model to use. - modelDef := modelDefinition{} - if err := json.NewDecoder(r).Decode(&modelDef); err != nil { - return nil, newDecodeModelError("failed to decode endpoints model", err) - } - - var version string - if b, ok := modelDef["version"]; ok { - version = string(b) - } else { - return nil, newDecodeModelError("endpoints version not found in model", nil) - } - - if version == "3" { - return decodeV3Endpoints(modelDef, opts) - } - - return nil, newDecodeModelError( - fmt.Sprintf("endpoints version %s, not supported", version), nil) -} - -func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resolver, error) { - b, ok := modelDef["partitions"] - if !ok { - return nil, newDecodeModelError("endpoints model missing partitions", nil) - } - - ps := partitions{} - if err := json.Unmarshal(b, &ps); err != nil { - return nil, newDecodeModelError("failed to decode endpoints model", err) - } - - if opts.SkipCustomizations { - return ps, nil - } - - // Customization - for i := 0; i < len(ps); i++ { - p := &ps[i] - custAddEC2Metadata(p) - custAddS3DualStack(p) - custRegionalS3(p) - custRmIotDataService(p) - custFixAppAutoscalingChina(p) - custFixAppAutoscalingUsGov(p) - } - - return ps, nil -} - -func custAddS3DualStack(p *partition) { - if !(p.ID == "aws" || p.ID == "aws-cn" || p.ID == "aws-us-gov") { - return - } - - custAddDualstack(p, "s3") - custAddDualstack(p, "s3-control") -} - -func custRegionalS3(p *partition) { - if p.ID != "aws" { - return - } - - service, ok := p.Services["s3"] - if !ok { - return - } - - // If global endpoint already exists no customization needed. - if _, ok := service.Endpoints["aws-global"]; ok { - return - } - - service.PartitionEndpoint = "aws-global" - service.Endpoints["us-east-1"] = endpoint{} - service.Endpoints["aws-global"] = endpoint{ - Hostname: "s3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - } - - p.Services["s3"] = service -} - -func custAddDualstack(p *partition, svcName string) { - s, ok := p.Services[svcName] - if !ok { - return - } - - s.Defaults.HasDualStack = boxedTrue - s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}" - - p.Services[svcName] = s -} - -func custAddEC2Metadata(p *partition) { - p.Services["ec2metadata"] = service{ - IsRegionalized: boxedFalse, - PartitionEndpoint: "aws-global", - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, - }, - }, - } -} - -func custRmIotDataService(p *partition) { - delete(p.Services, "data.iot") -} - -func custFixAppAutoscalingChina(p *partition) { - if p.ID != "aws-cn" { - return - } - - const serviceName = "application-autoscaling" - s, ok := p.Services[serviceName] - if !ok { - return - } - - const expectHostname = `autoscaling.{region}.amazonaws.com` - if e, a := s.Defaults.Hostname, expectHostname; e != a { - fmt.Printf("custFixAppAutoscalingChina: ignoring customization, expected %s, got %s\n", e, a) - return - } - - s.Defaults.Hostname = expectHostname + ".cn" - p.Services[serviceName] = s -} - -func custFixAppAutoscalingUsGov(p *partition) { - if p.ID != "aws-us-gov" { - return - } - - const serviceName = "application-autoscaling" - s, ok := p.Services[serviceName] - if !ok { - return - } - - if a := s.Defaults.CredentialScope.Service; a != "" { - fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty credential scope service, got %s\n", a) - return - } - - if a := s.Defaults.Hostname; a != "" { - fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty hostname, got %s\n", a) - return - } - - s.Defaults.CredentialScope.Service = "application-autoscaling" - s.Defaults.Hostname = "autoscaling.{region}.amazonaws.com" - - p.Services[serviceName] = s -} - -type decodeModelError struct { - awsError -} - -func newDecodeModelError(msg string, err error) decodeModelError { - return decodeModelError{ - awsError: awserr.New("DecodeEndpointsModelError", msg, err), - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go deleted file mode 100644 index 3cc48800d6..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ /dev/null @@ -1,10370 +0,0 @@ -// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. - -package endpoints - -import ( - "regexp" -) - -// Partition identifiers -const ( - AwsPartitionID = "aws" // AWS Standard partition. - AwsCnPartitionID = "aws-cn" // AWS China partition. - AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition. - AwsIsoPartitionID = "aws-iso" // AWS ISO (US) partition. - AwsIsoBPartitionID = "aws-iso-b" // AWS ISOB (US) partition. -) - -// AWS Standard partition's regions. -const ( - AfSouth1RegionID = "af-south-1" // Africa (Cape Town). - ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong). - ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). - ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). - ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). - ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore). - ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney). - CaCentral1RegionID = "ca-central-1" // Canada (Central). - EuCentral1RegionID = "eu-central-1" // Europe (Frankfurt). - EuNorth1RegionID = "eu-north-1" // Europe (Stockholm). - EuSouth1RegionID = "eu-south-1" // Europe (Milan). - EuWest1RegionID = "eu-west-1" // Europe (Ireland). - EuWest2RegionID = "eu-west-2" // Europe (London). - EuWest3RegionID = "eu-west-3" // Europe (Paris). - MeSouth1RegionID = "me-south-1" // Middle East (Bahrain). - SaEast1RegionID = "sa-east-1" // South America (Sao Paulo). - UsEast1RegionID = "us-east-1" // US East (N. Virginia). - UsEast2RegionID = "us-east-2" // US East (Ohio). - UsWest1RegionID = "us-west-1" // US West (N. California). - UsWest2RegionID = "us-west-2" // US West (Oregon). -) - -// AWS China partition's regions. -const ( - CnNorth1RegionID = "cn-north-1" // China (Beijing). - CnNorthwest1RegionID = "cn-northwest-1" // China (Ningxia). -) - -// AWS GovCloud (US) partition's regions. -const ( - UsGovEast1RegionID = "us-gov-east-1" // AWS GovCloud (US-East). - UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US-West). -) - -// AWS ISO (US) partition's regions. -const ( - UsIsoEast1RegionID = "us-iso-east-1" // US ISO East. -) - -// AWS ISOB (US) partition's regions. -const ( - UsIsobEast1RegionID = "us-isob-east-1" // US ISOB East (Ohio). -) - -// DefaultResolver returns an Endpoint resolver that will be able -// to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). -// -// Use DefaultPartitions() to get the list of the default partitions. -func DefaultResolver() Resolver { - return defaultPartitions -} - -// DefaultPartitions returns a list of the partitions the SDK is bundled -// with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). -// -// partitions := endpoints.DefaultPartitions -// for _, p := range partitions { -// // ... inspect partitions -// } -func DefaultPartitions() []Partition { - return defaultPartitions.Partitions() -} - -var defaultPartitions = partitions{ - awsPartition, - awscnPartition, - awsusgovPartition, - awsisoPartition, - awsisobPartition, -} - -// AwsPartition returns the Resolver for AWS Standard. -func AwsPartition() Partition { - return awsPartition.Partition() -} - -var awsPartition = partition{ - ID: "aws", - Name: "AWS Standard", - DNSSuffix: "amazonaws.com", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "af-south-1": region{ - Description: "Africa (Cape Town)", - }, - "ap-east-1": region{ - Description: "Asia Pacific (Hong Kong)", - }, - "ap-northeast-1": region{ - Description: "Asia Pacific (Tokyo)", - }, - "ap-northeast-2": region{ - Description: "Asia Pacific (Seoul)", - }, - "ap-south-1": region{ - Description: "Asia Pacific (Mumbai)", - }, - "ap-southeast-1": region{ - Description: "Asia Pacific (Singapore)", - }, - "ap-southeast-2": region{ - Description: "Asia Pacific (Sydney)", - }, - "ca-central-1": region{ - Description: "Canada (Central)", - }, - "eu-central-1": region{ - Description: "Europe (Frankfurt)", - }, - "eu-north-1": region{ - Description: "Europe (Stockholm)", - }, - "eu-south-1": region{ - Description: "Europe (Milan)", - }, - "eu-west-1": region{ - Description: "Europe (Ireland)", - }, - "eu-west-2": region{ - Description: "Europe (London)", - }, - "eu-west-3": region{ - Description: "Europe (Paris)", - }, - "me-south-1": region{ - Description: "Middle East (Bahrain)", - }, - "sa-east-1": region{ - Description: "South America (Sao Paulo)", - }, - "us-east-1": region{ - Description: "US East (N. Virginia)", - }, - "us-east-2": region{ - Description: "US East (Ohio)", - }, - "us-west-1": region{ - Description: "US West (N. California)", - }, - "us-west-2": region{ - Description: "US West (Oregon)", - }, - }, - Services: services{ - "a4b": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "access-analyzer": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "access-analyzer-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "access-analyzer-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "access-analyzer-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "access-analyzer-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "access-analyzer-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "acm": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "ca-central-1-fips": endpoint{ - Hostname: "acm-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "acm-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "acm-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "acm-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "acm-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "acm-pca": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "acm-pca-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "acm-pca-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "acm-pca-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "acm-pca-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "acm-pca-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "airflow": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "api.detective": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "api.detective-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "api.detective-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "api.detective-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "api.detective-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "api.ecr": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{ - Hostname: "api.ecr.af-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "af-south-1", - }, - }, - "ap-east-1": endpoint{ - Hostname: "api.ecr.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, - "ap-northeast-1": endpoint{ - Hostname: "api.ecr.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "api.ecr.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-south-1": endpoint{ - Hostname: "api.ecr.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "api.ecr.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "api.ecr.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "api.ecr.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "api.ecr.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-north-1": endpoint{ - Hostname: "api.ecr.eu-north-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "eu-south-1": endpoint{ - Hostname: "api.ecr.eu-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-south-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "api.ecr.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "api.ecr.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "eu-west-3": endpoint{ - Hostname: "api.ecr.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "fips-dkr-us-east-1": endpoint{ - Hostname: "ecr-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-dkr-us-east-2": endpoint{ - Hostname: "ecr-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-dkr-us-west-1": endpoint{ - Hostname: "ecr-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-dkr-us-west-2": endpoint{ - Hostname: "ecr-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "ecr-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "ecr-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "ecr-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "ecr-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{ - Hostname: "api.ecr.me-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "me-south-1", - }, - }, - "sa-east-1": endpoint{ - Hostname: "api.ecr.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "us-east-1": endpoint{ - Hostname: "api.ecr.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "api.ecr.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{ - Hostname: "api.ecr.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{ - Hostname: "api.ecr.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "api.elastic-inference": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{ - Hostname: "api.elastic-inference.ap-northeast-1.amazonaws.com", - }, - "ap-northeast-2": endpoint{ - Hostname: "api.elastic-inference.ap-northeast-2.amazonaws.com", - }, - "eu-west-1": endpoint{ - Hostname: "api.elastic-inference.eu-west-1.amazonaws.com", - }, - "us-east-1": endpoint{ - Hostname: "api.elastic-inference.us-east-1.amazonaws.com", - }, - "us-east-2": endpoint{ - Hostname: "api.elastic-inference.us-east-2.amazonaws.com", - }, - "us-west-2": endpoint{ - Hostname: "api.elastic-inference.us-west-2.amazonaws.com", - }, - }, - }, - "api.fleethub.iot": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "api.mediatailor": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "api.pricing": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "pricing", - }, - }, - Endpoints: endpoints{ - "ap-south-1": endpoint{}, - "us-east-1": endpoint{}, - }, - }, - "api.sagemaker": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "api-fips.sagemaker.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "api-fips.sagemaker.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "api-fips.sagemaker.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "apigateway": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "app-integrations": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "appflow": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "application-autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "appmesh": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "appstream2": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - CredentialScope: credentialScope{ - Service: "appstream", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "fips": endpoint{ - Hostname: "appstream2-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "appsync": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "athena": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "athena-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "athena-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "athena-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "athena-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "autoscaling-plans": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "backup": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "batch": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "fips.batch.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "fips.batch.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "fips.batch.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "fips.batch.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "budgets": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "budgets.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "ce": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "ce.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "chime": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "chime.us-east-1.amazonaws.com", - Protocols: []string{"https"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "cloud9": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "clouddirectory": service{ - - Endpoints: endpoints{ - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cloudformation": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "cloudformation-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "cloudformation-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "cloudformation-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "cloudformation-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "cloudfront": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "cloudfront.amazonaws.com", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "cloudhsm": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cloudhsmv2": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "cloudhsm", - }, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cloudsearch": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cloudtrail": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "cloudtrail-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "cloudtrail-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "cloudtrail-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "cloudtrail-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "codeartifact": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "codebuild": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "codebuild-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "codebuild-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "codebuild-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "codebuild-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "codecommit": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips": endpoint{ - Hostname: "codecommit-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "codedeploy": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "codedeploy-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "codedeploy-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "codedeploy-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "codedeploy-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "codeguru-reviewer": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "codepipeline": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "codepipeline-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "codepipeline-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "codepipeline-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "codepipeline-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "codepipeline-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "codestar": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "codestar-connections": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cognito-identity": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "cognito-identity-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "cognito-identity-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "cognito-identity-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cognito-idp": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "cognito-idp-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "cognito-idp-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "cognito-idp-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cognito-sync": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "comprehend": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "comprehend-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "comprehend-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "comprehend-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "comprehendmedical": service{ - - Endpoints: endpoints{ - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "comprehendmedical-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "comprehendmedical-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "comprehendmedical-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "config": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "config-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "config-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "config-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "config-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "connect": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "contact-lens": service{ - - Endpoints: endpoints{ - "ap-southeast-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "cur": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "data.mediastore": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "dataexchange": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "datapipeline": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "datasync": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "datasync-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "datasync-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "datasync-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "datasync-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "datasync-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "dax": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "devicefarm": service{ - - Endpoints: endpoints{ - "us-west-2": endpoint{}, - }, - }, - "directconnect": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "directconnect-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "directconnect-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "directconnect-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "directconnect-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "discovery": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "dms": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "dms-fips": endpoint{ - Hostname: "dms-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "docdb": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{ - Hostname: "rds.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "rds.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-south-1": endpoint{ - Hostname: "rds.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "rds.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "rds.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "rds.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "rds.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "rds.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "rds.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "eu-west-3": endpoint{ - Hostname: "rds.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "sa-east-1": endpoint{ - Hostname: "rds.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "us-east-1": endpoint{ - Hostname: "rds.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "rds.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-2": endpoint{ - Hostname: "rds.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "ds": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "ds-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "ds-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "ds-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "ds-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "ds-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "ca-central-1-fips": endpoint{ - Hostname: "dynamodb-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "local": endpoint{ - Hostname: "localhost:8000", - Protocols: []string{"http"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "dynamodb-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "dynamodb-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "dynamodb-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "dynamodb-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "ebs": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "ebs-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "ebs-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "ebs-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "ebs-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "ebs-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "ec2": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "ec2-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "ec2-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "ec2-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "ec2-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "ec2-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "ec2metadata": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, - }, - }, - }, - "ecs": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "ecs-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "ecs-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "ecs-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "ecs-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "eks": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "fips.eks.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "fips.eks.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "fips.eks.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "fips.eks.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "elasticache": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips": endpoint{ - Hostname: "elasticache-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "elasticbeanstalk": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "elasticbeanstalk-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "elasticbeanstalk-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "elasticbeanstalk-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "elasticbeanstalk-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "elasticfilesystem": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-af-south-1": endpoint{ - Hostname: "elasticfilesystem-fips.af-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "af-south-1", - }, - }, - "fips-ap-east-1": endpoint{ - Hostname: "elasticfilesystem-fips.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, - "fips-ap-northeast-1": endpoint{ - Hostname: "elasticfilesystem-fips.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "fips-ap-northeast-2": endpoint{ - Hostname: "elasticfilesystem-fips.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "fips-ap-south-1": endpoint{ - Hostname: "elasticfilesystem-fips.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "fips-ap-southeast-1": endpoint{ - Hostname: "elasticfilesystem-fips.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "fips-ap-southeast-2": endpoint{ - Hostname: "elasticfilesystem-fips.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "fips-ca-central-1": endpoint{ - Hostname: "elasticfilesystem-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-eu-central-1": endpoint{ - Hostname: "elasticfilesystem-fips.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "fips-eu-north-1": endpoint{ - Hostname: "elasticfilesystem-fips.eu-north-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "fips-eu-south-1": endpoint{ - Hostname: "elasticfilesystem-fips.eu-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-south-1", - }, - }, - "fips-eu-west-1": endpoint{ - Hostname: "elasticfilesystem-fips.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "fips-eu-west-2": endpoint{ - Hostname: "elasticfilesystem-fips.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "fips-eu-west-3": endpoint{ - Hostname: "elasticfilesystem-fips.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "fips-me-south-1": endpoint{ - Hostname: "elasticfilesystem-fips.me-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "me-south-1", - }, - }, - "fips-sa-east-1": endpoint{ - Hostname: "elasticfilesystem-fips.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "elasticfilesystem-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "elasticfilesystem-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "elasticfilesystem-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "elasticfilesystem-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "elasticloadbalancing": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "elasticloadbalancing-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "elasticloadbalancing-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "elasticloadbalancing-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "elasticloadbalancing-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "elasticmapreduce": service{ - Defaults: endpoint{ - SSLCommonName: "{region}.{service}.{dnsSuffix}", - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{ - SSLCommonName: "{service}.{region}.{dnsSuffix}", - }, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "elasticmapreduce-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "elasticmapreduce-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "elasticmapreduce-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "elasticmapreduce-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "elasticmapreduce-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - SSLCommonName: "{service}.{region}.{dnsSuffix}", - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "elastictranscoder": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "email": service{ - - Endpoints: endpoints{ - "ap-south-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "emr-containers": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "entitlement.marketplace": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "aws-marketplace", - }, - }, - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "es": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips": endpoint{ - Hostname: "es-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "events": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "events-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "events-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "events-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "events-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "firehose": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "firehose-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "firehose-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "firehose-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "firehose-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "fms": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-af-south-1": endpoint{ - Hostname: "fms-fips.af-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "af-south-1", - }, - }, - "fips-ap-east-1": endpoint{ - Hostname: "fms-fips.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, - "fips-ap-northeast-1": endpoint{ - Hostname: "fms-fips.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "fips-ap-northeast-2": endpoint{ - Hostname: "fms-fips.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "fips-ap-south-1": endpoint{ - Hostname: "fms-fips.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "fips-ap-southeast-1": endpoint{ - Hostname: "fms-fips.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "fips-ap-southeast-2": endpoint{ - Hostname: "fms-fips.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "fips-ca-central-1": endpoint{ - Hostname: "fms-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-eu-central-1": endpoint{ - Hostname: "fms-fips.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "fips-eu-south-1": endpoint{ - Hostname: "fms-fips.eu-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-south-1", - }, - }, - "fips-eu-west-1": endpoint{ - Hostname: "fms-fips.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "fips-eu-west-2": endpoint{ - Hostname: "fms-fips.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "fips-eu-west-3": endpoint{ - Hostname: "fms-fips.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "fips-me-south-1": endpoint{ - Hostname: "fms-fips.me-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "me-south-1", - }, - }, - "fips-sa-east-1": endpoint{ - Hostname: "fms-fips.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "fms-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "fms-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "fms-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "fms-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "forecast": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "forecastquery": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "fsx": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-prod-ca-central-1": endpoint{ - Hostname: "fsx-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-prod-us-east-1": endpoint{ - Hostname: "fsx-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-prod-us-east-2": endpoint{ - Hostname: "fsx-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-prod-us-west-1": endpoint{ - Hostname: "fsx-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-prod-us-west-2": endpoint{ - Hostname: "fsx-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "gamelift": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "glacier": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "glacier-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "glacier-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "glacier-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "glacier-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "glacier-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "glue": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "glue-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "glue-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "glue-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "glue-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "greengrass": service{ - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "groundstation": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "fips-us-east-2": endpoint{ - Hostname: "groundstation-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "groundstation-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "guardduty": service{ - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "guardduty-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "guardduty-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "guardduty-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "guardduty-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "health": service{ - - Endpoints: endpoints{ - "fips-us-east-2": endpoint{ - Hostname: "health-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - }, - }, - "healthlake": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "honeycode": service{ - - Endpoints: endpoints{ - "us-west-2": endpoint{}, - }, - }, - "iam": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "iam.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "iam-fips": endpoint{ - Hostname: "iam-fips.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "identitystore": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "importexport": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "importexport.amazonaws.com", - SignatureVersions: []string{"v2", "v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - Service: "IngestionService", - }, - }, - }, - }, - "inspector": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "inspector-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "inspector-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "inspector-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "inspector-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "iot": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "execute-api", - }, - }, - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "iotanalytics": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "iotevents": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "ioteventsdata": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{ - Hostname: "data.iotevents.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "data.iotevents.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "data.iotevents.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "data.iotevents.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "eu-central-1": endpoint{ - Hostname: "data.iotevents.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "data.iotevents.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "data.iotevents.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "us-east-1": endpoint{ - Hostname: "data.iotevents.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "data.iotevents.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-2": endpoint{ - Hostname: "data.iotevents.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "iotsecuredtunneling": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "iotthingsgraph": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "iotthingsgraph", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "iotwireless": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{ - Hostname: "api.iotwireless.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "us-east-1": endpoint{ - Hostname: "api.iotwireless.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "kafka": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kinesis": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "kinesis-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "kinesis-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "kinesis-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "kinesis-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kinesisanalytics": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kinesisvideo": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kms": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "lakeformation": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "lakeformation-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "lakeformation-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "lakeformation-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "lakeformation-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "lambda": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "lambda-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "lambda-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "lambda-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "lambda-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "license-manager": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "license-manager-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "license-manager-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "license-manager-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "license-manager-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "lightsail": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "logs": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "logs-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "logs-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "logs-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "logs-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "lookoutvision": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "machinelearning": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - }, - }, - "macie": service{ - - Endpoints: endpoints{ - "fips-us-east-1": endpoint{ - Hostname: "macie-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "macie-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "macie2": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "macie2-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "macie2-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "macie2-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "macie2-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "managedblockchain": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - }, - }, - "marketplacecommerceanalytics": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "mediaconnect": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mediaconvert": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "mediaconvert-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "mediaconvert-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "mediaconvert-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "mediaconvert-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "mediaconvert-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "medialive": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "medialive-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "medialive-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "medialive-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mediapackage": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mediastore": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "metering.marketplace": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "aws-marketplace", - }, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mgh": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mobileanalytics": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "models.lex": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "lex", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "models-fips.lex.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "models-fips.lex.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "monitoring": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "monitoring-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "monitoring-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "monitoring-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "monitoring-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mq": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "mq-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "mq-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "mq-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "mq-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "mturk-requester": service{ - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "sandbox": endpoint{ - Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com", - }, - "us-east-1": endpoint{}, - }, - }, - "neptune": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{ - Hostname: "rds.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, - "ap-northeast-1": endpoint{ - Hostname: "rds.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "rds.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-south-1": endpoint{ - Hostname: "rds.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "rds.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "rds.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "rds.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "rds.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-north-1": endpoint{ - Hostname: "rds.eu-north-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "rds.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "rds.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "eu-west-3": endpoint{ - Hostname: "rds.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "me-south-1": endpoint{ - Hostname: "rds.me-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "me-south-1", - }, - }, - "sa-east-1": endpoint{ - Hostname: "rds.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "us-east-1": endpoint{ - Hostname: "rds.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "rds.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{ - Hostname: "rds.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{ - Hostname: "rds.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "oidc": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{ - Hostname: "oidc.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "oidc.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-south-1": endpoint{ - Hostname: "oidc.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "oidc.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "oidc.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "oidc.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "oidc.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-north-1": endpoint{ - Hostname: "oidc.eu-north-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "oidc.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "oidc.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "us-east-1": endpoint{ - Hostname: "oidc.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "oidc.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-2": endpoint{ - Hostname: "oidc.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "opsworks": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "opsworks-cm": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "organizations": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "organizations.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-aws-global": endpoint{ - Hostname: "organizations-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "outposts": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "outposts-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "outposts-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "outposts-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "outposts-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "outposts-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "pinpoint": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "mobiletargeting", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "pinpoint-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "pinpoint-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{ - Hostname: "pinpoint.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-west-2": endpoint{ - Hostname: "pinpoint.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "polly": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "polly-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "polly-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "polly-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "polly-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "portal.sso": service{ - - Endpoints: endpoints{ - "ap-southeast-1": endpoint{ - Hostname: "portal.sso.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "portal.sso.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "portal.sso.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "portal.sso.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "portal.sso.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "portal.sso.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "us-east-1": endpoint{ - Hostname: "portal.sso.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "portal.sso.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-2": endpoint{ - Hostname: "portal.sso.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "profile": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "projects.iot1click": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "qldb": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "ram": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "rds": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "rds-fips.ca-central-1": endpoint{ - Hostname: "rds-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "rds-fips.us-east-1": endpoint{ - Hostname: "rds-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "rds-fips.us-east-2": endpoint{ - Hostname: "rds-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "rds-fips.us-west-1": endpoint{ - Hostname: "rds-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "rds-fips.us-west-2": endpoint{ - Hostname: "rds-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - SSLCommonName: "{service}.{dnsSuffix}", - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "redshift": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "redshift-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "redshift-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "redshift-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "redshift-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "redshift-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "rekognition": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "rekognition-fips.ca-central-1": endpoint{ - Hostname: "rekognition-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "rekognition-fips.us-east-1": endpoint{ - Hostname: "rekognition-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "rekognition-fips.us-east-2": endpoint{ - Hostname: "rekognition-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "rekognition-fips.us-west-1": endpoint{ - Hostname: "rekognition-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "rekognition-fips.us-west-2": endpoint{ - Hostname: "rekognition-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "resource-groups": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "resource-groups-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "resource-groups-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "resource-groups-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "resource-groups-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "robomaker": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "route53": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "route53.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-aws-global": endpoint{ - Hostname: "route53-fips.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "route53domains": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "route53resolver": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "runtime.lex": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "lex", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "runtime-fips.lex.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "runtime-fips.lex.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "runtime.sagemaker": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "runtime-fips.sagemaker.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "runtime-fips.sagemaker.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "runtime-fips.sagemaker.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "runtime-fips.sagemaker.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "s3": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{ - Hostname: "s3.ap-northeast-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{ - Hostname: "s3.ap-southeast-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "ap-southeast-2": endpoint{ - Hostname: "s3.ap-southeast-2.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "aws-global": endpoint{ - Hostname: "s3.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{ - Hostname: "s3.eu-west-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "s3-external-1": endpoint{ - Hostname: "s3-external-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "sa-east-1": endpoint{ - Hostname: "s3.sa-east-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "us-east-1": endpoint{ - Hostname: "s3.us-east-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{ - Hostname: "s3.us-west-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "us-west-2": endpoint{ - Hostname: "s3.us-west-2.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - }, - }, - "s3-control": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{ - Hostname: "s3-control.ap-northeast-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "s3-control.ap-northeast-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-south-1": endpoint{ - Hostname: "s3-control.ap-south-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "s3-control.ap-southeast-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "s3-control.ap-southeast-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "s3-control.ca-central-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "ca-central-1-fips": endpoint{ - Hostname: "s3-control-fips.ca-central-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "s3-control.eu-central-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-north-1": endpoint{ - Hostname: "s3-control.eu-north-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "s3-control.eu-west-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "s3-control.eu-west-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "eu-west-3": endpoint{ - Hostname: "s3-control.eu-west-3.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "sa-east-1": endpoint{ - Hostname: "s3-control.sa-east-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "us-east-1": endpoint{ - Hostname: "s3-control.us-east-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-1-fips": endpoint{ - Hostname: "s3-control-fips.us-east-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "s3-control.us-east-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-east-2-fips": endpoint{ - Hostname: "s3-control-fips.us-east-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{ - Hostname: "s3-control.us-west-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-1-fips": endpoint{ - Hostname: "s3-control-fips.us-west-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{ - Hostname: "s3-control.us-west-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-west-2-fips": endpoint{ - Hostname: "s3-control-fips.us-west-2.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "savingsplans": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "savingsplans.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "schemas": service{ - - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "sdb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v2"}, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - Hostname: "sdb.amazonaws.com", - }, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "secretsmanager": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "secretsmanager-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "secretsmanager-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "secretsmanager-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "secretsmanager-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "securityhub": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "securityhub-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "securityhub-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "securityhub-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "securityhub-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "serverlessrepo": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "ap-east-1": endpoint{ - Protocols: []string{"https"}, - }, - "ap-northeast-1": endpoint{ - Protocols: []string{"https"}, - }, - "ap-northeast-2": endpoint{ - Protocols: []string{"https"}, - }, - "ap-south-1": endpoint{ - Protocols: []string{"https"}, - }, - "ap-southeast-1": endpoint{ - Protocols: []string{"https"}, - }, - "ap-southeast-2": endpoint{ - Protocols: []string{"https"}, - }, - "ca-central-1": endpoint{ - Protocols: []string{"https"}, - }, - "eu-central-1": endpoint{ - Protocols: []string{"https"}, - }, - "eu-north-1": endpoint{ - Protocols: []string{"https"}, - }, - "eu-west-1": endpoint{ - Protocols: []string{"https"}, - }, - "eu-west-2": endpoint{ - Protocols: []string{"https"}, - }, - "eu-west-3": endpoint{ - Protocols: []string{"https"}, - }, - "me-south-1": endpoint{ - Protocols: []string{"https"}, - }, - "sa-east-1": endpoint{ - Protocols: []string{"https"}, - }, - "us-east-1": endpoint{ - Protocols: []string{"https"}, - }, - "us-east-2": endpoint{ - Protocols: []string{"https"}, - }, - "us-west-1": endpoint{ - Protocols: []string{"https"}, - }, - "us-west-2": endpoint{ - Protocols: []string{"https"}, - }, - }, - }, - "servicecatalog": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "servicecatalog-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "servicecatalog-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "servicecatalog-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "servicecatalog-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "servicediscovery": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "servicediscovery-fips": endpoint{ - Hostname: "servicediscovery-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "servicequotas": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "session.qldb": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "shield": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - Defaults: endpoint{ - SSLCommonName: "shield.us-east-1.amazonaws.com", - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "shield.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-aws-global": endpoint{ - Hostname: "shield-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "sms": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "sms-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "sms-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "sms-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "sms-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "snowball": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ap-northeast-1": endpoint{ - Hostname: "snowball-fips.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "fips-ap-northeast-2": endpoint{ - Hostname: "snowball-fips.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "fips-ap-northeast-3": endpoint{ - Hostname: "snowball-fips.ap-northeast-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-3", - }, - }, - "fips-ap-south-1": endpoint{ - Hostname: "snowball-fips.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "fips-ap-southeast-1": endpoint{ - Hostname: "snowball-fips.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "fips-ap-southeast-2": endpoint{ - Hostname: "snowball-fips.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "fips-ca-central-1": endpoint{ - Hostname: "snowball-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-eu-central-1": endpoint{ - Hostname: "snowball-fips.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "fips-eu-west-1": endpoint{ - Hostname: "snowball-fips.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "fips-eu-west-2": endpoint{ - Hostname: "snowball-fips.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "fips-eu-west-3": endpoint{ - Hostname: "snowball-fips.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "fips-sa-east-1": endpoint{ - Hostname: "snowball-fips.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "snowball-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "snowball-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "snowball-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "snowball-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "sns": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "sns-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "sns-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "sns-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "sns-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "sqs": service{ - Defaults: endpoint{ - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "sqs-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "sqs-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "sqs-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "sqs-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - SSLCommonName: "queue.{dnsSuffix}", - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "ssm": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "ssm-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "ssm-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "ssm-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "ssm-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "ssm-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "states": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "states-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "states-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "states-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "states-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "storagegateway": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips": endpoint{ - Hostname: "storagegateway-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "streams.dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "dynamodb", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "ca-central-1-fips": endpoint{ - Hostname: "dynamodb-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "local": endpoint{ - Hostname: "localhost:8000", - Protocols: []string{"http"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "dynamodb-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "dynamodb-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "dynamodb-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "dynamodb-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "sts": service{ - PartitionEndpoint: "aws-global", - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "aws-global": endpoint{ - Hostname: "sts.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "sts-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "sts-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "sts-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "sts-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "support": service{ - PartitionEndpoint: "aws-global", - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "support.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "swf": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "swf-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "swf-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "swf-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "swf-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "tagging": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "transcribe": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "fips.transcribe.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "fips.transcribe.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "fips.transcribe.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "fips.transcribe.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "transcribestreaming": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "transfer": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-ca-central-1": endpoint{ - Hostname: "transfer-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "transfer-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "transfer-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "transfer-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "transfer-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "translate": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "translate-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "translate-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "translate-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "waf": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-fips": endpoint{ - Hostname: "waf-fips.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "aws-global": endpoint{ - Hostname: "waf.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "waf-regional": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{ - Hostname: "waf-regional.af-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "af-south-1", - }, - }, - "ap-east-1": endpoint{ - Hostname: "waf-regional.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, - "ap-northeast-1": endpoint{ - Hostname: "waf-regional.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "ap-northeast-2": endpoint{ - Hostname: "waf-regional.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "ap-south-1": endpoint{ - Hostname: "waf-regional.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "ap-southeast-1": endpoint{ - Hostname: "waf-regional.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "ap-southeast-2": endpoint{ - Hostname: "waf-regional.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "ca-central-1": endpoint{ - Hostname: "waf-regional.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "eu-central-1": endpoint{ - Hostname: "waf-regional.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "eu-north-1": endpoint{ - Hostname: "waf-regional.eu-north-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "eu-south-1": endpoint{ - Hostname: "waf-regional.eu-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-south-1", - }, - }, - "eu-west-1": endpoint{ - Hostname: "waf-regional.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "eu-west-2": endpoint{ - Hostname: "waf-regional.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "eu-west-3": endpoint{ - Hostname: "waf-regional.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "fips-af-south-1": endpoint{ - Hostname: "waf-regional-fips.af-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "af-south-1", - }, - }, - "fips-ap-east-1": endpoint{ - Hostname: "waf-regional-fips.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, - "fips-ap-northeast-1": endpoint{ - Hostname: "waf-regional-fips.ap-northeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-1", - }, - }, - "fips-ap-northeast-2": endpoint{ - Hostname: "waf-regional-fips.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, - "fips-ap-south-1": endpoint{ - Hostname: "waf-regional-fips.ap-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-south-1", - }, - }, - "fips-ap-southeast-1": endpoint{ - Hostname: "waf-regional-fips.ap-southeast-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-1", - }, - }, - "fips-ap-southeast-2": endpoint{ - Hostname: "waf-regional-fips.ap-southeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-southeast-2", - }, - }, - "fips-ca-central-1": endpoint{ - Hostname: "waf-regional-fips.ca-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ca-central-1", - }, - }, - "fips-eu-central-1": endpoint{ - Hostname: "waf-regional-fips.eu-central-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-central-1", - }, - }, - "fips-eu-north-1": endpoint{ - Hostname: "waf-regional-fips.eu-north-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-north-1", - }, - }, - "fips-eu-south-1": endpoint{ - Hostname: "waf-regional-fips.eu-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-south-1", - }, - }, - "fips-eu-west-1": endpoint{ - Hostname: "waf-regional-fips.eu-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-1", - }, - }, - "fips-eu-west-2": endpoint{ - Hostname: "waf-regional-fips.eu-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-2", - }, - }, - "fips-eu-west-3": endpoint{ - Hostname: "waf-regional-fips.eu-west-3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "eu-west-3", - }, - }, - "fips-me-south-1": endpoint{ - Hostname: "waf-regional-fips.me-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "me-south-1", - }, - }, - "fips-sa-east-1": endpoint{ - Hostname: "waf-regional-fips.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "fips-us-east-1": endpoint{ - Hostname: "waf-regional-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "waf-regional-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "waf-regional-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "waf-regional-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{ - Hostname: "waf-regional.me-south-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "me-south-1", - }, - }, - "sa-east-1": endpoint{ - Hostname: "waf-regional.sa-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "sa-east-1", - }, - }, - "us-east-1": endpoint{ - Hostname: "waf-regional.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{ - Hostname: "waf-regional.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{ - Hostname: "waf-regional.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{ - Hostname: "waf-regional.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - "workdocs": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "workdocs-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "workdocs-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "workmail": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "workspaces": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "workspaces-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "workspaces-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "xray": service{ - - Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-south-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "fips-us-east-1": endpoint{ - Hostname: "xray-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "fips-us-east-2": endpoint{ - Hostname: "xray-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "fips-us-west-1": endpoint{ - Hostname: "xray-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "fips-us-west-2": endpoint{ - Hostname: "xray-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - }, -} - -// AwsCnPartition returns the Resolver for AWS China. -func AwsCnPartition() Partition { - return awscnPartition.Partition() -} - -var awscnPartition = partition{ - ID: "aws-cn", - Name: "AWS China", - DNSSuffix: "amazonaws.com.cn", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^cn\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "cn-north-1": region{ - Description: "China (Beijing)", - }, - "cn-northwest-1": region{ - Description: "China (Ningxia)", - }, - }, - Services: services{ - "access-analyzer": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "acm": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "api.ecr": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{ - Hostname: "api.ecr.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - "cn-northwest-1": endpoint{ - Hostname: "api.ecr.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "api.sagemaker": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "apigateway": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "application-autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "appsync": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "athena": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "autoscaling-plans": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "backup": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "batch": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "budgets": service{ - PartitionEndpoint: "aws-cn-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "budgets.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "ce": service{ - PartitionEndpoint: "aws-cn-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "ce.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "cloudformation": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "cloudfront": service{ - PartitionEndpoint: "aws-cn-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "cloudfront.cn-northwest-1.amazonaws.com.cn", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "cloudtrail": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "codebuild": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "codecommit": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "codedeploy": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "cognito-identity": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - }, - }, - "config": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "cur": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{}, - }, - }, - "dax": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{}, - }, - }, - "directconnect": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "dms": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "docdb": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{ - Hostname: "rds.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "ds": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "ebs": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "ec2": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "ec2metadata": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, - }, - }, - }, - "ecs": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "eks": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "elasticache": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "elasticbeanstalk": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "elasticfilesystem": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - "fips-cn-north-1": endpoint{ - Hostname: "elasticfilesystem-fips.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - "fips-cn-northwest-1": endpoint{ - Hostname: "elasticfilesystem-fips.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "elasticloadbalancing": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "elasticmapreduce": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "es": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "events": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "firehose": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "fsx": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "gamelift": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - }, - }, - "glacier": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "glue": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "greengrass": service{ - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - }, - }, - "health": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "iam": service{ - PartitionEndpoint: "aws-cn-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "iam.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - }, - }, - "iot": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "execute-api", - }, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "iotanalytics": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - }, - }, - "iotevents": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - }, - }, - "ioteventsdata": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{ - Hostname: "data.iotevents.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - }, - }, - "iotsecuredtunneling": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "kafka": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "kinesis": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "kinesisanalytics": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "kms": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "lakeformation": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - }, - }, - "lambda": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "license-manager": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "logs": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "mediaconvert": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{ - Hostname: "subscribe.mediaconvert.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "monitoring": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "neptune": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{ - Hostname: "rds.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "organizations": service{ - PartitionEndpoint: "aws-cn-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "polly": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{}, - }, - }, - "ram": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "rds": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "redshift": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "resource-groups": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "route53": service{ - PartitionEndpoint: "aws-cn-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "route53.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "runtime.sagemaker": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "s3": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "s3-control": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{ - Hostname: "s3-control.cn-north-1.amazonaws.com.cn", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - "cn-northwest-1": endpoint{ - Hostname: "s3-control.cn-northwest-1.amazonaws.com.cn", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "secretsmanager": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "securityhub": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "serverlessrepo": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{ - Protocols: []string{"https"}, - }, - "cn-northwest-1": endpoint{ - Protocols: []string{"https"}, - }, - }, - }, - "servicediscovery": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "sms": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "snowball": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - "fips-cn-north-1": endpoint{ - Hostname: "snowball-fips.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - "fips-cn-northwest-1": endpoint{ - Hostname: "snowball-fips.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "sns": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "sqs": service{ - Defaults: endpoint{ - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "ssm": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "states": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "storagegateway": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "streams.dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "dynamodb", - }, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "sts": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "support": service{ - PartitionEndpoint: "aws-cn-global", - - Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "support.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - }, - }, - "swf": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "tagging": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - "transcribe": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "cn-north-1": endpoint{ - Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-north-1", - }, - }, - "cn-northwest-1": endpoint{ - Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - "workspaces": service{ - - Endpoints: endpoints{ - "cn-northwest-1": endpoint{}, - }, - }, - "xray": service{ - - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - }, -} - -// AwsUsGovPartition returns the Resolver for AWS GovCloud (US). -func AwsUsGovPartition() Partition { - return awsusgovPartition.Partition() -} - -var awsusgovPartition = partition{ - ID: "aws-us-gov", - Name: "AWS GovCloud (US)", - DNSSuffix: "amazonaws.com", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^us\\-gov\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "us-gov-east-1": region{ - Description: "AWS GovCloud (US-East)", - }, - "us-gov-west-1": region{ - Description: "AWS GovCloud (US-West)", - }, - }, - Services: services{ - "access-analyzer": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "access-analyzer.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "access-analyzer.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "acm": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "acm.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "acm.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "acm-pca": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "acm-pca.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "acm-pca.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "api.ecr": service{ - - Endpoints: endpoints{ - "fips-dkr-us-gov-east-1": endpoint{ - Hostname: "ecr-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-dkr-us-gov-west-1": endpoint{ - Hostname: "ecr-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "fips-us-gov-east-1": endpoint{ - Hostname: "ecr-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "ecr-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{ - Hostname: "api.ecr.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "api.ecr.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "api.sagemaker": service{ - - Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "api-fips.sagemaker.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1-fips-secondary": endpoint{ - Hostname: "api.sagemaker.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "apigateway": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "application-autoscaling": service{ - Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "appstream2": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - CredentialScope: credentialScope{ - Service: "appstream", - }, - }, - Endpoints: endpoints{ - "fips": endpoint{ - Hostname: "appstream2-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "athena": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "athena-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "athena-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "autoscaling": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "autoscaling-plans": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "backup": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "batch": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "batch.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "batch.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "clouddirectory": service{ - - Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, - }, - }, - "cloudformation": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "cloudformation.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "cloudformation.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "cloudhsm": service{ - - Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, - }, - }, - "cloudhsmv2": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "cloudhsm", - }, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "cloudtrail": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "cloudtrail.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "cloudtrail.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "codebuild": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "codebuild-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "codebuild-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "codecommit": service{ - - Endpoints: endpoints{ - "fips": endpoint{ - Hostname: "codecommit-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "codedeploy": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "codedeploy-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "codedeploy-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "codepipeline": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "codepipeline-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "cognito-identity": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "cognito-identity-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "cognito-idp": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "cognito-idp-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "comprehend": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "comprehend-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "comprehendmedical": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "comprehendmedical-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "config": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "config.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "config.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "datasync": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "datasync-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "datasync-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "directconnect": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "directconnect.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "directconnect.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "dms": service{ - - Endpoints: endpoints{ - "dms-fips": endpoint{ - Hostname: "dms.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "docdb": service{ - - Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Hostname: "rds.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "ds": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "ds-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "ds-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "dynamodb": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "dynamodb.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "dynamodb.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "ebs": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "ec2": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "ec2.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "ec2.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "ec2metadata": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, - }, - }, - }, - "ecs": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "ecs-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "ecs-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "eks": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "eks.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "eks.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "elasticache": service{ - - Endpoints: endpoints{ - "fips": endpoint{ - Hostname: "elasticache.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "elasticbeanstalk": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "elasticbeanstalk.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "elasticbeanstalk.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "elasticfilesystem": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "elasticfilesystem-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "elasticfilesystem-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "elasticloadbalancing": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "elasticloadbalancing.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "elasticloadbalancing.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "elasticmapreduce": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "elasticmapreduce.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "elasticmapreduce.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{ - Protocols: []string{"https"}, - }, - }, - }, - "email": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "email-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "es": service{ - - Endpoints: endpoints{ - "fips": endpoint{ - Hostname: "es-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "events": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "events.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "events.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "firehose": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "firehose-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "firehose-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "fsx": service{ - - Endpoints: endpoints{ - "fips-prod-us-gov-east-1": endpoint{ - Hostname: "fsx-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-prod-us-gov-west-1": endpoint{ - Hostname: "fsx-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "glacier": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "glacier.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "glacier.us-gov-west-1.amazonaws.com", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "glue": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "glue-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "glue-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "greengrass": service{ - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "dataplane-us-gov-east-1": endpoint{ - Hostname: "greengrass-ats.iot.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "dataplane-us-gov-west-1": endpoint{ - Hostname: "greengrass-ats.iot.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "fips-us-gov-east-1": endpoint{ - Hostname: "greengrass-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-east-1": endpoint{ - Hostname: "greengrass.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "greengrass.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "guardduty": service{ - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "guardduty.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "guardduty.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "health": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "health-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "iam": service{ - PartitionEndpoint: "aws-us-gov-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-us-gov-global": endpoint{ - Hostname: "iam.us-gov.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "iam-govcloud-fips": endpoint{ - Hostname: "iam.us-gov.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "inspector": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "inspector-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "inspector-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "iot": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "execute-api", - }, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "iotsecuredtunneling": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "kafka": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "kinesis": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "kinesis.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "kinesis.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "kinesisanalytics": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "kms": service{ - - Endpoints: endpoints{ - "ProdFips": endpoint{ - Hostname: "kms-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "lakeformation": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "lakeformation-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "lambda": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "lambda-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "lambda-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "license-manager": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "license-manager-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "license-manager-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "logs": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "logs.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "logs.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "mediaconvert": service{ - - Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Hostname: "mediaconvert.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "metering.marketplace": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "aws-marketplace", - }, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "monitoring": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "monitoring.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "monitoring.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "neptune": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "rds.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "rds.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "organizations": service{ - PartitionEndpoint: "aws-us-gov-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-us-gov-global": endpoint{ - Hostname: "organizations.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "fips-aws-us-gov-global": endpoint{ - Hostname: "organizations.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "outposts": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "outposts.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "outposts.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "pinpoint": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "mobiletargeting", - }, - }, - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "pinpoint-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "pinpoint.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "polly": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "polly-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "ram": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "rds": service{ - - Endpoints: endpoints{ - "rds.us-gov-east-1": endpoint{ - Hostname: "rds.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "rds.us-gov-west-1": endpoint{ - Hostname: "rds.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "redshift": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "redshift.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "redshift.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "rekognition": service{ - - Endpoints: endpoints{ - "rekognition-fips.us-gov-west-1": endpoint{ - Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "resource-groups": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "resource-groups.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "resource-groups.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "route53": service{ - PartitionEndpoint: "aws-us-gov-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-us-gov-global": endpoint{ - Hostname: "route53.us-gov.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "fips-aws-us-gov-global": endpoint{ - Hostname: "route53.us-gov.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "route53resolver": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "runtime.sagemaker": service{ - - Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, - }, - }, - "s3": service{ - Defaults: endpoint{ - SignatureVersions: []string{"s3", "s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "s3-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{ - Hostname: "s3.us-gov-east-1.amazonaws.com", - Protocols: []string{"http", "https"}, - }, - "us-gov-west-1": endpoint{ - Hostname: "s3.us-gov-west-1.amazonaws.com", - Protocols: []string{"http", "https"}, - }, - }, - }, - "s3-control": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "s3-control.us-gov-east-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-east-1-fips": endpoint{ - Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "s3-control.us-gov-west-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1-fips": endpoint{ - Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com", - SignatureVersions: []string{"s3v4"}, - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "secretsmanager": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "securityhub": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "securityhub-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "securityhub-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "serverlessrepo": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com", - Protocols: []string{"https"}, - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com", - Protocols: []string{"https"}, - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "servicecatalog": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "servicecatalog-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "servicecatalog-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "sms": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "sms-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "sms-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "snowball": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "snowball-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "snowball-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "sns": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "sns.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "sns.us-gov-west-1.amazonaws.com", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "sqs": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "sqs.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "sqs.us-gov-west-1.amazonaws.com", - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "ssm": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "ssm.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "ssm.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "states": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "states-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "states.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "storagegateway": service{ - - Endpoints: endpoints{ - "fips": endpoint{ - Hostname: "storagegateway-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "streams.dynamodb": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "dynamodb", - }, - }, - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "dynamodb.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "dynamodb.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "sts": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-east-1-fips": endpoint{ - Hostname: "sts.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "sts.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "support": service{ - PartitionEndpoint: "aws-us-gov-global", - - Endpoints: endpoints{ - "aws-us-gov-global": endpoint{ - Hostname: "support.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "support.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "swf": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{ - Hostname: "swf.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "swf.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "tagging": service{ - - Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "transcribe": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "fips.transcribe.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "fips.transcribe.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "transfer": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "transfer-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "transfer-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - "translate": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, - "us-gov-west-1-fips": endpoint{ - Hostname: "translate-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "waf-regional": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "waf-regional-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "waf-regional-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{ - Hostname: "waf-regional.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "waf-regional.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - }, - }, - "workspaces": service{ - - Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "workspaces-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{}, - }, - }, - "xray": service{ - - Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "xray-fips.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "xray-fips.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, - }, - }, - }, -} - -// AwsIsoPartition returns the Resolver for AWS ISO (US). -func AwsIsoPartition() Partition { - return awsisoPartition.Partition() -} - -var awsisoPartition = partition{ - ID: "aws-iso", - Name: "AWS ISO (US)", - DNSSuffix: "c2s.ic.gov", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^us\\-iso\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "us-iso-east-1": region{ - Description: "US ISO East", - }, - }, - Services: services{ - "api.ecr": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Hostname: "api.ecr.us-iso-east-1.c2s.ic.gov", - CredentialScope: credentialScope{ - Region: "us-iso-east-1", - }, - }, - }, - }, - "api.sagemaker": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "apigateway": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "application-autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "autoscaling": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "cloudformation": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "cloudtrail": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "codedeploy": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "comprehend": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "config": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "datapipeline": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "directconnect": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "dms": service{ - - Endpoints: endpoints{ - "dms-fips": endpoint{ - Hostname: "dms.us-iso-east-1.c2s.ic.gov", - CredentialScope: credentialScope{ - Region: "us-iso-east-1", - }, - }, - "us-iso-east-1": endpoint{}, - }, - }, - "ds": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "dynamodb": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "ec2": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "ec2metadata": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, - }, - }, - }, - "ecs": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "elasticache": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "elasticloadbalancing": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "elasticmapreduce": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"https"}, - }, - }, - }, - "es": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "events": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "glacier": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "health": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "iam": service{ - PartitionEndpoint: "aws-iso-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-iso-global": endpoint{ - Hostname: "iam.us-iso-east-1.c2s.ic.gov", - CredentialScope: credentialScope{ - Region: "us-iso-east-1", - }, - }, - }, - }, - "kinesis": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "kms": service{ - - Endpoints: endpoints{ - "ProdFips": endpoint{ - Hostname: "kms-fips.us-iso-east-1.c2s.ic.gov", - CredentialScope: credentialScope{ - Region: "us-iso-east-1", - }, - }, - "us-iso-east-1": endpoint{}, - }, - }, - "lambda": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "logs": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "monitoring": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "rds": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "redshift": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "route53": service{ - PartitionEndpoint: "aws-iso-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-iso-global": endpoint{ - Hostname: "route53.c2s.ic.gov", - CredentialScope: credentialScope{ - Region: "us-iso-east-1", - }, - }, - }, - }, - "runtime.sagemaker": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "s3": service{ - Defaults: endpoint{ - SignatureVersions: []string{"s3v4"}, - }, - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"s3v4"}, - }, - }, - }, - "secretsmanager": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "snowball": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "sns": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "sqs": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "ssm": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "states": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "streams.dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "dynamodb", - }, - }, - Endpoints: endpoints{ - "us-iso-east-1": endpoint{ - Protocols: []string{"http", "https"}, - }, - }, - }, - "sts": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "support": service{ - PartitionEndpoint: "aws-iso-global", - - Endpoints: endpoints{ - "aws-iso-global": endpoint{ - Hostname: "support.us-iso-east-1.c2s.ic.gov", - CredentialScope: credentialScope{ - Region: "us-iso-east-1", - }, - }, - }, - }, - "swf": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "transcribe": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "transcribestreaming": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "translate": service{ - Defaults: endpoint{ - Protocols: []string{"https"}, - }, - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - "workspaces": service{ - - Endpoints: endpoints{ - "us-iso-east-1": endpoint{}, - }, - }, - }, -} - -// AwsIsoBPartition returns the Resolver for AWS ISOB (US). -func AwsIsoBPartition() Partition { - return awsisobPartition.Partition() -} - -var awsisobPartition = partition{ - ID: "aws-iso-b", - Name: "AWS ISOB (US)", - DNSSuffix: "sc2s.sgov.gov", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^us\\-isob\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "us-isob-east-1": region{ - Description: "US ISOB East (Ohio)", - }, - }, - Services: services{ - "api.ecr": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{ - Hostname: "api.ecr.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: credentialScope{ - Region: "us-isob-east-1", - }, - }, - }, - }, - "application-autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "cloudformation": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "cloudtrail": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "codedeploy": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "config": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "directconnect": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "dms": service{ - - Endpoints: endpoints{ - "dms-fips": endpoint{ - Hostname: "dms.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: credentialScope{ - Region: "us-isob-east-1", - }, - }, - "us-isob-east-1": endpoint{}, - }, - }, - "dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "ec2": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "ec2metadata": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, - }, - }, - }, - "ecs": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "elasticache": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "elasticloadbalancing": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{ - Protocols: []string{"https"}, - }, - }, - }, - "elasticmapreduce": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "es": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "events": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "glacier": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "health": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "iam": service{ - PartitionEndpoint: "aws-iso-b-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-iso-b-global": endpoint{ - Hostname: "iam.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: credentialScope{ - Region: "us-isob-east-1", - }, - }, - }, - }, - "kinesis": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "kms": service{ - - Endpoints: endpoints{ - "ProdFips": endpoint{ - Hostname: "kms-fips.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: credentialScope{ - Region: "us-isob-east-1", - }, - }, - "us-isob-east-1": endpoint{}, - }, - }, - "lambda": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "license-manager": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "logs": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "monitoring": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "rds": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "redshift": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "s3": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"s3v4"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "snowball": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "sns": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "sqs": service{ - Defaults: endpoint{ - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "ssm": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "states": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "streams.dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "dynamodb", - }, - }, - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "sts": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - "support": service{ - PartitionEndpoint: "aws-iso-b-global", - - Endpoints: endpoints{ - "aws-iso-b-global": endpoint{ - Hostname: "support.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: credentialScope{ - Region: "us-isob-east-1", - }, - }, - }, - }, - "swf": service{ - - Endpoints: endpoints{ - "us-isob-east-1": endpoint{}, - }, - }, - }, -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go deleted file mode 100644 index ca8fc828e1..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go +++ /dev/null @@ -1,141 +0,0 @@ -package endpoints - -// Service identifiers -// -// Deprecated: Use client package's EndpointsID value instead of these -// ServiceIDs. These IDs are not maintained, and are out of date. -const ( - A4bServiceID = "a4b" // A4b. - AcmServiceID = "acm" // Acm. - AcmPcaServiceID = "acm-pca" // AcmPca. - ApiMediatailorServiceID = "api.mediatailor" // ApiMediatailor. - ApiPricingServiceID = "api.pricing" // ApiPricing. - ApiSagemakerServiceID = "api.sagemaker" // ApiSagemaker. - ApigatewayServiceID = "apigateway" // Apigateway. - ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling. - Appstream2ServiceID = "appstream2" // Appstream2. - AppsyncServiceID = "appsync" // Appsync. - AthenaServiceID = "athena" // Athena. - AutoscalingServiceID = "autoscaling" // Autoscaling. - AutoscalingPlansServiceID = "autoscaling-plans" // AutoscalingPlans. - BatchServiceID = "batch" // Batch. - BudgetsServiceID = "budgets" // Budgets. - CeServiceID = "ce" // Ce. - ChimeServiceID = "chime" // Chime. - Cloud9ServiceID = "cloud9" // Cloud9. - ClouddirectoryServiceID = "clouddirectory" // Clouddirectory. - CloudformationServiceID = "cloudformation" // Cloudformation. - CloudfrontServiceID = "cloudfront" // Cloudfront. - CloudhsmServiceID = "cloudhsm" // Cloudhsm. - Cloudhsmv2ServiceID = "cloudhsmv2" // Cloudhsmv2. - CloudsearchServiceID = "cloudsearch" // Cloudsearch. - CloudtrailServiceID = "cloudtrail" // Cloudtrail. - CodebuildServiceID = "codebuild" // Codebuild. - CodecommitServiceID = "codecommit" // Codecommit. - CodedeployServiceID = "codedeploy" // Codedeploy. - CodepipelineServiceID = "codepipeline" // Codepipeline. - CodestarServiceID = "codestar" // Codestar. - CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity. - CognitoIdpServiceID = "cognito-idp" // CognitoIdp. - CognitoSyncServiceID = "cognito-sync" // CognitoSync. - ComprehendServiceID = "comprehend" // Comprehend. - ConfigServiceID = "config" // Config. - CurServiceID = "cur" // Cur. - DatapipelineServiceID = "datapipeline" // Datapipeline. - DaxServiceID = "dax" // Dax. - DevicefarmServiceID = "devicefarm" // Devicefarm. - DirectconnectServiceID = "directconnect" // Directconnect. - DiscoveryServiceID = "discovery" // Discovery. - DmsServiceID = "dms" // Dms. - DsServiceID = "ds" // Ds. - DynamodbServiceID = "dynamodb" // Dynamodb. - Ec2ServiceID = "ec2" // Ec2. - Ec2metadataServiceID = "ec2metadata" // Ec2metadata. - EcrServiceID = "ecr" // Ecr. - EcsServiceID = "ecs" // Ecs. - ElasticacheServiceID = "elasticache" // Elasticache. - ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk. - ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem. - ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing. - ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce. - ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder. - EmailServiceID = "email" // Email. - EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace. - EsServiceID = "es" // Es. - EventsServiceID = "events" // Events. - FirehoseServiceID = "firehose" // Firehose. - FmsServiceID = "fms" // Fms. - GameliftServiceID = "gamelift" // Gamelift. - GlacierServiceID = "glacier" // Glacier. - GlueServiceID = "glue" // Glue. - GreengrassServiceID = "greengrass" // Greengrass. - GuarddutyServiceID = "guardduty" // Guardduty. - HealthServiceID = "health" // Health. - IamServiceID = "iam" // Iam. - ImportexportServiceID = "importexport" // Importexport. - InspectorServiceID = "inspector" // Inspector. - IotServiceID = "iot" // Iot. - IotanalyticsServiceID = "iotanalytics" // Iotanalytics. - KinesisServiceID = "kinesis" // Kinesis. - KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics. - KinesisvideoServiceID = "kinesisvideo" // Kinesisvideo. - KmsServiceID = "kms" // Kms. - LambdaServiceID = "lambda" // Lambda. - LightsailServiceID = "lightsail" // Lightsail. - LogsServiceID = "logs" // Logs. - MachinelearningServiceID = "machinelearning" // Machinelearning. - MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics. - MediaconvertServiceID = "mediaconvert" // Mediaconvert. - MedialiveServiceID = "medialive" // Medialive. - MediapackageServiceID = "mediapackage" // Mediapackage. - MediastoreServiceID = "mediastore" // Mediastore. - MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace. - MghServiceID = "mgh" // Mgh. - MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics. - ModelsLexServiceID = "models.lex" // ModelsLex. - MonitoringServiceID = "monitoring" // Monitoring. - MturkRequesterServiceID = "mturk-requester" // MturkRequester. - NeptuneServiceID = "neptune" // Neptune. - OpsworksServiceID = "opsworks" // Opsworks. - OpsworksCmServiceID = "opsworks-cm" // OpsworksCm. - OrganizationsServiceID = "organizations" // Organizations. - PinpointServiceID = "pinpoint" // Pinpoint. - PollyServiceID = "polly" // Polly. - RdsServiceID = "rds" // Rds. - RedshiftServiceID = "redshift" // Redshift. - RekognitionServiceID = "rekognition" // Rekognition. - ResourceGroupsServiceID = "resource-groups" // ResourceGroups. - Route53ServiceID = "route53" // Route53. - Route53domainsServiceID = "route53domains" // Route53domains. - RuntimeLexServiceID = "runtime.lex" // RuntimeLex. - RuntimeSagemakerServiceID = "runtime.sagemaker" // RuntimeSagemaker. - S3ServiceID = "s3" // S3. - S3ControlServiceID = "s3-control" // S3Control. - SagemakerServiceID = "api.sagemaker" // Sagemaker. - SdbServiceID = "sdb" // Sdb. - SecretsmanagerServiceID = "secretsmanager" // Secretsmanager. - ServerlessrepoServiceID = "serverlessrepo" // Serverlessrepo. - ServicecatalogServiceID = "servicecatalog" // Servicecatalog. - ServicediscoveryServiceID = "servicediscovery" // Servicediscovery. - ShieldServiceID = "shield" // Shield. - SmsServiceID = "sms" // Sms. - SnowballServiceID = "snowball" // Snowball. - SnsServiceID = "sns" // Sns. - SqsServiceID = "sqs" // Sqs. - SsmServiceID = "ssm" // Ssm. - StatesServiceID = "states" // States. - StoragegatewayServiceID = "storagegateway" // Storagegateway. - StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb. - StsServiceID = "sts" // Sts. - SupportServiceID = "support" // Support. - SwfServiceID = "swf" // Swf. - TaggingServiceID = "tagging" // Tagging. - TransferServiceID = "transfer" // Transfer. - TranslateServiceID = "translate" // Translate. - WafServiceID = "waf" // Waf. - WafRegionalServiceID = "waf-regional" // WafRegional. - WorkdocsServiceID = "workdocs" // Workdocs. - WorkmailServiceID = "workmail" // Workmail. - WorkspacesServiceID = "workspaces" // Workspaces. - XrayServiceID = "xray" // Xray. -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go deleted file mode 100644 index 84316b92c0..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go +++ /dev/null @@ -1,66 +0,0 @@ -// Package endpoints provides the types and functionality for defining regions -// and endpoints, as well as querying those definitions. -// -// The SDK's Regions and Endpoints metadata is code generated into the endpoints -// package, and is accessible via the DefaultResolver function. This function -// returns a endpoint Resolver will search the metadata and build an associated -// endpoint if one is found. The default resolver will search all partitions -// known by the SDK. e.g AWS Standard (aws), AWS China (aws-cn), and -// AWS GovCloud (US) (aws-us-gov). -// . -// -// Enumerating Regions and Endpoint Metadata -// -// Casting the Resolver returned by DefaultResolver to a EnumPartitions interface -// will allow you to get access to the list of underlying Partitions with the -// Partitions method. This is helpful if you want to limit the SDK's endpoint -// resolving to a single partition, or enumerate regions, services, and endpoints -// in the partition. -// -// resolver := endpoints.DefaultResolver() -// partitions := resolver.(endpoints.EnumPartitions).Partitions() -// -// for _, p := range partitions { -// fmt.Println("Regions for", p.ID()) -// for id, _ := range p.Regions() { -// fmt.Println("*", id) -// } -// -// fmt.Println("Services for", p.ID()) -// for id, _ := range p.Services() { -// fmt.Println("*", id) -// } -// } -// -// Using Custom Endpoints -// -// The endpoints package also gives you the ability to use your own logic how -// endpoints are resolved. This is a great way to define a custom endpoint -// for select services, without passing that logic down through your code. -// -// If a type implements the Resolver interface it can be used to resolve -// endpoints. To use this with the SDK's Session and Config set the value -// of the type to the EndpointsResolver field of aws.Config when initializing -// the session, or service client. -// -// In addition the ResolverFunc is a wrapper for a func matching the signature -// of Resolver.EndpointFor, converting it to a type that satisfies the -// Resolver interface. -// -// -// myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { -// if service == endpoints.S3ServiceID { -// return endpoints.ResolvedEndpoint{ -// URL: "s3.custom.endpoint.com", -// SigningRegion: "custom-signing-region", -// }, nil -// } -// -// return endpoints.DefaultResolver().EndpointFor(service, region, optFns...) -// } -// -// sess := session.Must(session.NewSession(&aws.Config{ -// Region: aws.String("us-west-2"), -// EndpointResolver: endpoints.ResolverFunc(myCustomResolver), -// })) -package endpoints diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go deleted file mode 100644 index ca956e5f12..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go +++ /dev/null @@ -1,564 +0,0 @@ -package endpoints - -import ( - "fmt" - "regexp" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// Options provide the configuration needed to direct how the -// endpoints will be resolved. -type Options struct { - // DisableSSL forces the endpoint to be resolved as HTTP. - // instead of HTTPS if the service supports it. - DisableSSL bool - - // Sets the resolver to resolve the endpoint as a dualstack endpoint - // for the service. If dualstack support for a service is not known and - // StrictMatching is not enabled a dualstack endpoint for the service will - // be returned. This endpoint may not be valid. If StrictMatching is - // enabled only services that are known to support dualstack will return - // dualstack endpoints. - UseDualStack bool - - // Enables strict matching of services and regions resolved endpoints. - // If the partition doesn't enumerate the exact service and region an - // error will be returned. This option will prevent returning endpoints - // that look valid, but may not resolve to any real endpoint. - StrictMatching bool - - // Enables resolving a service endpoint based on the region provided if the - // service does not exist. The service endpoint ID will be used as the service - // domain name prefix. By default the endpoint resolver requires the service - // to be known when resolving endpoints. - // - // If resolving an endpoint on the partition list the provided region will - // be used to determine which partition's domain name pattern to the service - // endpoint ID with. If both the service and region are unknown and resolving - // the endpoint on partition list an UnknownEndpointError error will be returned. - // - // If resolving and endpoint on a partition specific resolver that partition's - // domain name pattern will be used with the service endpoint ID. If both - // region and service do not exist when resolving an endpoint on a specific - // partition the partition's domain pattern will be used to combine the - // endpoint and region together. - // - // This option is ignored if StrictMatching is enabled. - ResolveUnknownService bool - - // STS Regional Endpoint flag helps with resolving the STS endpoint - STSRegionalEndpoint STSRegionalEndpoint - - // S3 Regional Endpoint flag helps with resolving the S3 endpoint - S3UsEast1RegionalEndpoint S3UsEast1RegionalEndpoint -} - -// STSRegionalEndpoint is an enum for the states of the STS Regional Endpoint -// options. -type STSRegionalEndpoint int - -func (e STSRegionalEndpoint) String() string { - switch e { - case LegacySTSEndpoint: - return "legacy" - case RegionalSTSEndpoint: - return "regional" - case UnsetSTSEndpoint: - return "" - default: - return "unknown" - } -} - -const ( - - // UnsetSTSEndpoint represents that STS Regional Endpoint flag is not specified. - UnsetSTSEndpoint STSRegionalEndpoint = iota - - // LegacySTSEndpoint represents when STS Regional Endpoint flag is specified - // to use legacy endpoints. - LegacySTSEndpoint - - // RegionalSTSEndpoint represents when STS Regional Endpoint flag is specified - // to use regional endpoints. - RegionalSTSEndpoint -) - -// GetSTSRegionalEndpoint function returns the STSRegionalEndpointFlag based -// on the input string provided in env config or shared config by the user. -// -// `legacy`, `regional` are the only case-insensitive valid strings for -// resolving the STS regional Endpoint flag. -func GetSTSRegionalEndpoint(s string) (STSRegionalEndpoint, error) { - switch { - case strings.EqualFold(s, "legacy"): - return LegacySTSEndpoint, nil - case strings.EqualFold(s, "regional"): - return RegionalSTSEndpoint, nil - default: - return UnsetSTSEndpoint, fmt.Errorf("unable to resolve the value of STSRegionalEndpoint for %v", s) - } -} - -// S3UsEast1RegionalEndpoint is an enum for the states of the S3 us-east-1 -// Regional Endpoint options. -type S3UsEast1RegionalEndpoint int - -func (e S3UsEast1RegionalEndpoint) String() string { - switch e { - case LegacyS3UsEast1Endpoint: - return "legacy" - case RegionalS3UsEast1Endpoint: - return "regional" - case UnsetS3UsEast1Endpoint: - return "" - default: - return "unknown" - } -} - -const ( - - // UnsetS3UsEast1Endpoint represents that S3 Regional Endpoint flag is not - // specified. - UnsetS3UsEast1Endpoint S3UsEast1RegionalEndpoint = iota - - // LegacyS3UsEast1Endpoint represents when S3 Regional Endpoint flag is - // specified to use legacy endpoints. - LegacyS3UsEast1Endpoint - - // RegionalS3UsEast1Endpoint represents when S3 Regional Endpoint flag is - // specified to use regional endpoints. - RegionalS3UsEast1Endpoint -) - -// GetS3UsEast1RegionalEndpoint function returns the S3UsEast1RegionalEndpointFlag based -// on the input string provided in env config or shared config by the user. -// -// `legacy`, `regional` are the only case-insensitive valid strings for -// resolving the S3 regional Endpoint flag. -func GetS3UsEast1RegionalEndpoint(s string) (S3UsEast1RegionalEndpoint, error) { - switch { - case strings.EqualFold(s, "legacy"): - return LegacyS3UsEast1Endpoint, nil - case strings.EqualFold(s, "regional"): - return RegionalS3UsEast1Endpoint, nil - default: - return UnsetS3UsEast1Endpoint, - fmt.Errorf("unable to resolve the value of S3UsEast1RegionalEndpoint for %v", s) - } -} - -// Set combines all of the option functions together. -func (o *Options) Set(optFns ...func(*Options)) { - for _, fn := range optFns { - fn(o) - } -} - -// DisableSSLOption sets the DisableSSL options. Can be used as a functional -// option when resolving endpoints. -func DisableSSLOption(o *Options) { - o.DisableSSL = true -} - -// UseDualStackOption sets the UseDualStack option. Can be used as a functional -// option when resolving endpoints. -func UseDualStackOption(o *Options) { - o.UseDualStack = true -} - -// StrictMatchingOption sets the StrictMatching option. Can be used as a functional -// option when resolving endpoints. -func StrictMatchingOption(o *Options) { - o.StrictMatching = true -} - -// ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used -// as a functional option when resolving endpoints. -func ResolveUnknownServiceOption(o *Options) { - o.ResolveUnknownService = true -} - -// STSRegionalEndpointOption enables the STS endpoint resolver behavior to resolve -// STS endpoint to their regional endpoint, instead of the global endpoint. -func STSRegionalEndpointOption(o *Options) { - o.STSRegionalEndpoint = RegionalSTSEndpoint -} - -// A Resolver provides the interface for functionality to resolve endpoints. -// The build in Partition and DefaultResolver return value satisfy this interface. -type Resolver interface { - EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) -} - -// ResolverFunc is a helper utility that wraps a function so it satisfies the -// Resolver interface. This is useful when you want to add additional endpoint -// resolving logic, or stub out specific endpoints with custom values. -type ResolverFunc func(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) - -// EndpointFor wraps the ResolverFunc function to satisfy the Resolver interface. -func (fn ResolverFunc) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return fn(service, region, opts...) -} - -var schemeRE = regexp.MustCompile("^([^:]+)://") - -// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no -// scheme. If disableSSL is true HTTP will set HTTP instead of the default HTTPS. -// -// If disableSSL is set, it will only set the URL's scheme if the URL does not -// contain a scheme. -func AddScheme(endpoint string, disableSSL bool) string { - if !schemeRE.MatchString(endpoint) { - scheme := "https" - if disableSSL { - scheme = "http" - } - endpoint = fmt.Sprintf("%s://%s", scheme, endpoint) - } - - return endpoint -} - -// EnumPartitions a provides a way to retrieve the underlying partitions that -// make up the SDK's default Resolver, or any resolver decoded from a model -// file. -// -// Use this interface with DefaultResolver and DecodeModels to get the list of -// Partitions. -type EnumPartitions interface { - Partitions() []Partition -} - -// RegionsForService returns a map of regions for the partition and service. -// If either the partition or service does not exist false will be returned -// as the second parameter. -// -// This example shows how to get the regions for DynamoDB in the AWS partition. -// rs, exists := endpoints.RegionsForService(endpoints.DefaultPartitions(), endpoints.AwsPartitionID, endpoints.DynamodbServiceID) -// -// This is equivalent to using the partition directly. -// rs := endpoints.AwsPartition().Services()[endpoints.DynamodbServiceID].Regions() -func RegionsForService(ps []Partition, partitionID, serviceID string) (map[string]Region, bool) { - for _, p := range ps { - if p.ID() != partitionID { - continue - } - if _, ok := p.p.Services[serviceID]; !ok { - break - } - - s := Service{ - id: serviceID, - p: p.p, - } - return s.Regions(), true - } - - return map[string]Region{}, false -} - -// PartitionForRegion returns the first partition which includes the region -// passed in. This includes both known regions and regions which match -// a pattern supported by the partition which may include regions that are -// not explicitly known by the partition. Use the Regions method of the -// returned Partition if explicit support is needed. -func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) { - for _, p := range ps { - if _, ok := p.p.Regions[regionID]; ok || p.p.RegionRegex.MatchString(regionID) { - return p, true - } - } - - return Partition{}, false -} - -// A Partition provides the ability to enumerate the partition's regions -// and services. -type Partition struct { - id, dnsSuffix string - p *partition -} - -// DNSSuffix returns the base domain name of the partition. -func (p Partition) DNSSuffix() string { return p.dnsSuffix } - -// ID returns the identifier of the partition. -func (p Partition) ID() string { return p.id } - -// EndpointFor attempts to resolve the endpoint based on service and region. -// See Options for information on configuring how the endpoint is resolved. -// -// If the service cannot be found in the metadata the UnknownServiceError -// error will be returned. This validation will occur regardless if -// StrictMatching is enabled. To enable resolving unknown services set the -// "ResolveUnknownService" option to true. When StrictMatching is disabled -// this option allows the partition resolver to resolve a endpoint based on -// the service endpoint ID provided. -// -// When resolving endpoints you can choose to enable StrictMatching. This will -// require the provided service and region to be known by the partition. -// If the endpoint cannot be strictly resolved an error will be returned. This -// mode is useful to ensure the endpoint resolved is valid. Without -// StrictMatching enabled the endpoint returned may look valid but may not work. -// StrictMatching requires the SDK to be updated if you want to take advantage -// of new regions and services expansions. -// -// Errors that can be returned. -// * UnknownServiceError -// * UnknownEndpointError -func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return p.p.EndpointFor(service, region, opts...) -} - -// Regions returns a map of Regions indexed by their ID. This is useful for -// enumerating over the regions in a partition. -func (p Partition) Regions() map[string]Region { - rs := make(map[string]Region, len(p.p.Regions)) - for id, r := range p.p.Regions { - rs[id] = Region{ - id: id, - desc: r.Description, - p: p.p, - } - } - - return rs -} - -// Services returns a map of Service indexed by their ID. This is useful for -// enumerating over the services in a partition. -func (p Partition) Services() map[string]Service { - ss := make(map[string]Service, len(p.p.Services)) - for id := range p.p.Services { - ss[id] = Service{ - id: id, - p: p.p, - } - } - - return ss -} - -// A Region provides information about a region, and ability to resolve an -// endpoint from the context of a region, given a service. -type Region struct { - id, desc string - p *partition -} - -// ID returns the region's identifier. -func (r Region) ID() string { return r.id } - -// Description returns the region's description. The region description -// is free text, it can be empty, and it may change between SDK releases. -func (r Region) Description() string { return r.desc } - -// ResolveEndpoint resolves an endpoint from the context of the region given -// a service. See Partition.EndpointFor for usage and errors that can be returned. -func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return r.p.EndpointFor(service, r.id, opts...) -} - -// Services returns a list of all services that are known to be in this region. -func (r Region) Services() map[string]Service { - ss := map[string]Service{} - for id, s := range r.p.Services { - if _, ok := s.Endpoints[r.id]; ok { - ss[id] = Service{ - id: id, - p: r.p, - } - } - } - - return ss -} - -// A Service provides information about a service, and ability to resolve an -// endpoint from the context of a service, given a region. -type Service struct { - id string - p *partition -} - -// ID returns the identifier for the service. -func (s Service) ID() string { return s.id } - -// ResolveEndpoint resolves an endpoint from the context of a service given -// a region. See Partition.EndpointFor for usage and errors that can be returned. -func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return s.p.EndpointFor(s.id, region, opts...) -} - -// Regions returns a map of Regions that the service is present in. -// -// A region is the AWS region the service exists in. Whereas a Endpoint is -// an URL that can be resolved to a instance of a service. -func (s Service) Regions() map[string]Region { - rs := map[string]Region{} - for id := range s.p.Services[s.id].Endpoints { - if r, ok := s.p.Regions[id]; ok { - rs[id] = Region{ - id: id, - desc: r.Description, - p: s.p, - } - } - } - - return rs -} - -// Endpoints returns a map of Endpoints indexed by their ID for all known -// endpoints for a service. -// -// A region is the AWS region the service exists in. Whereas a Endpoint is -// an URL that can be resolved to a instance of a service. -func (s Service) Endpoints() map[string]Endpoint { - es := make(map[string]Endpoint, len(s.p.Services[s.id].Endpoints)) - for id := range s.p.Services[s.id].Endpoints { - es[id] = Endpoint{ - id: id, - serviceID: s.id, - p: s.p, - } - } - - return es -} - -// A Endpoint provides information about endpoints, and provides the ability -// to resolve that endpoint for the service, and the region the endpoint -// represents. -type Endpoint struct { - id string - serviceID string - p *partition -} - -// ID returns the identifier for an endpoint. -func (e Endpoint) ID() string { return e.id } - -// ServiceID returns the identifier the endpoint belongs to. -func (e Endpoint) ServiceID() string { return e.serviceID } - -// ResolveEndpoint resolves an endpoint from the context of a service and -// region the endpoint represents. See Partition.EndpointFor for usage and -// errors that can be returned. -func (e Endpoint) ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error) { - return e.p.EndpointFor(e.serviceID, e.id, opts...) -} - -// A ResolvedEndpoint is an endpoint that has been resolved based on a partition -// service, and region. -type ResolvedEndpoint struct { - // The endpoint URL - URL string - - // The endpoint partition - PartitionID string - - // The region that should be used for signing requests. - SigningRegion string - - // The service name that should be used for signing requests. - SigningName string - - // States that the signing name for this endpoint was derived from metadata - // passed in, but was not explicitly modeled. - SigningNameDerived bool - - // The signing method that should be used for signing requests. - SigningMethod string -} - -// So that the Error interface type can be included as an anonymous field -// in the requestError struct and not conflict with the error.Error() method. -type awsError awserr.Error - -// A EndpointNotFoundError is returned when in StrictMatching mode, and the -// endpoint for the service and region cannot be found in any of the partitions. -type EndpointNotFoundError struct { - awsError - Partition string - Service string - Region string -} - -// A UnknownServiceError is returned when the service does not resolve to an -// endpoint. Includes a list of all known services for the partition. Returned -// when a partition does not support the service. -type UnknownServiceError struct { - awsError - Partition string - Service string - Known []string -} - -// NewUnknownServiceError builds and returns UnknownServiceError. -func NewUnknownServiceError(p, s string, known []string) UnknownServiceError { - return UnknownServiceError{ - awsError: awserr.New("UnknownServiceError", - "could not resolve endpoint for unknown service", nil), - Partition: p, - Service: s, - Known: known, - } -} - -// String returns the string representation of the error. -func (e UnknownServiceError) Error() string { - extra := fmt.Sprintf("partition: %q, service: %q", - e.Partition, e.Service) - if len(e.Known) > 0 { - extra += fmt.Sprintf(", known: %v", e.Known) - } - return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -} - -// String returns the string representation of the error. -func (e UnknownServiceError) String() string { - return e.Error() -} - -// A UnknownEndpointError is returned when in StrictMatching mode and the -// service is valid, but the region does not resolve to an endpoint. Includes -// a list of all known endpoints for the service. -type UnknownEndpointError struct { - awsError - Partition string - Service string - Region string - Known []string -} - -// NewUnknownEndpointError builds and returns UnknownEndpointError. -func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError { - return UnknownEndpointError{ - awsError: awserr.New("UnknownEndpointError", - "could not resolve endpoint", nil), - Partition: p, - Service: s, - Region: r, - Known: known, - } -} - -// String returns the string representation of the error. -func (e UnknownEndpointError) Error() string { - extra := fmt.Sprintf("partition: %q, service: %q, region: %q", - e.Partition, e.Service, e.Region) - if len(e.Known) > 0 { - extra += fmt.Sprintf(", known: %v", e.Known) - } - return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -} - -// String returns the string representation of the error. -func (e UnknownEndpointError) String() string { - return e.Error() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go deleted file mode 100644 index df75e899ad..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go +++ /dev/null @@ -1,24 +0,0 @@ -package endpoints - -var legacyGlobalRegions = map[string]map[string]struct{}{ - "sts": { - "ap-northeast-1": {}, - "ap-south-1": {}, - "ap-southeast-1": {}, - "ap-southeast-2": {}, - "ca-central-1": {}, - "eu-central-1": {}, - "eu-north-1": {}, - "eu-west-1": {}, - "eu-west-2": {}, - "eu-west-3": {}, - "sa-east-1": {}, - "us-east-1": {}, - "us-east-2": {}, - "us-west-1": {}, - "us-west-2": {}, - }, - "s3": { - "us-east-1": {}, - }, -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go deleted file mode 100644 index 773613722f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ /dev/null @@ -1,351 +0,0 @@ -package endpoints - -import ( - "fmt" - "regexp" - "strconv" - "strings" -) - -var regionValidationRegex = regexp.MustCompile(`^[[:alnum:]]([[:alnum:]\-]*[[:alnum:]])?$`) - -type partitions []partition - -func (ps partitions) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - var opt Options - opt.Set(opts...) - - for i := 0; i < len(ps); i++ { - if !ps[i].canResolveEndpoint(service, region, opt.StrictMatching) { - continue - } - - return ps[i].EndpointFor(service, region, opts...) - } - - // If loose matching fallback to first partition format to use - // when resolving the endpoint. - if !opt.StrictMatching && len(ps) > 0 { - return ps[0].EndpointFor(service, region, opts...) - } - - return ResolvedEndpoint{}, NewUnknownEndpointError("all partitions", service, region, []string{}) -} - -// Partitions satisfies the EnumPartitions interface and returns a list -// of Partitions representing each partition represented in the SDK's -// endpoints model. -func (ps partitions) Partitions() []Partition { - parts := make([]Partition, 0, len(ps)) - for i := 0; i < len(ps); i++ { - parts = append(parts, ps[i].Partition()) - } - - return parts -} - -type partition struct { - ID string `json:"partition"` - Name string `json:"partitionName"` - DNSSuffix string `json:"dnsSuffix"` - RegionRegex regionRegex `json:"regionRegex"` - Defaults endpoint `json:"defaults"` - Regions regions `json:"regions"` - Services services `json:"services"` -} - -func (p partition) Partition() Partition { - return Partition{ - dnsSuffix: p.DNSSuffix, - id: p.ID, - p: &p, - } -} - -func (p partition) canResolveEndpoint(service, region string, strictMatch bool) bool { - s, hasService := p.Services[service] - _, hasEndpoint := s.Endpoints[region] - - if hasEndpoint && hasService { - return true - } - - if strictMatch { - return false - } - - return p.RegionRegex.MatchString(region) -} - -func allowLegacyEmptyRegion(service string) bool { - legacy := map[string]struct{}{ - "budgets": {}, - "ce": {}, - "chime": {}, - "cloudfront": {}, - "ec2metadata": {}, - "iam": {}, - "importexport": {}, - "organizations": {}, - "route53": {}, - "sts": {}, - "support": {}, - "waf": {}, - } - - _, allowed := legacy[service] - return allowed -} - -func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) { - var opt Options - opt.Set(opts...) - - s, hasService := p.Services[service] - if len(service) == 0 || !(hasService || opt.ResolveUnknownService) { - // Only return error if the resolver will not fallback to creating - // endpoint based on service endpoint ID passed in. - return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) - } - - if len(region) == 0 && allowLegacyEmptyRegion(service) && len(s.PartitionEndpoint) != 0 { - region = s.PartitionEndpoint - } - - if (service == "sts" && opt.STSRegionalEndpoint != RegionalSTSEndpoint) || - (service == "s3" && opt.S3UsEast1RegionalEndpoint != RegionalS3UsEast1Endpoint) { - if _, ok := legacyGlobalRegions[service][region]; ok { - region = "aws-global" - } - } - - e, hasEndpoint := s.endpointForRegion(region) - if len(region) == 0 || (!hasEndpoint && opt.StrictMatching) { - return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints)) - } - - defs := []endpoint{p.Defaults, s.Defaults} - - return e.resolve(service, p.ID, region, p.DNSSuffix, defs, opt) -} - -func serviceList(ss services) []string { - list := make([]string, 0, len(ss)) - for k := range ss { - list = append(list, k) - } - return list -} -func endpointList(es endpoints) []string { - list := make([]string, 0, len(es)) - for k := range es { - list = append(list, k) - } - return list -} - -type regionRegex struct { - *regexp.Regexp -} - -func (rr *regionRegex) UnmarshalJSON(b []byte) (err error) { - // Strip leading and trailing quotes - regex, err := strconv.Unquote(string(b)) - if err != nil { - return fmt.Errorf("unable to strip quotes from regex, %v", err) - } - - rr.Regexp, err = regexp.Compile(regex) - if err != nil { - return fmt.Errorf("unable to unmarshal region regex, %v", err) - } - return nil -} - -type regions map[string]region - -type region struct { - Description string `json:"description"` -} - -type services map[string]service - -type service struct { - PartitionEndpoint string `json:"partitionEndpoint"` - IsRegionalized boxedBool `json:"isRegionalized,omitempty"` - Defaults endpoint `json:"defaults"` - Endpoints endpoints `json:"endpoints"` -} - -func (s *service) endpointForRegion(region string) (endpoint, bool) { - if s.IsRegionalized == boxedFalse { - return s.Endpoints[s.PartitionEndpoint], region == s.PartitionEndpoint - } - - if e, ok := s.Endpoints[region]; ok { - return e, true - } - - // Unable to find any matching endpoint, return - // blank that will be used for generic endpoint creation. - return endpoint{}, false -} - -type endpoints map[string]endpoint - -type endpoint struct { - Hostname string `json:"hostname"` - Protocols []string `json:"protocols"` - CredentialScope credentialScope `json:"credentialScope"` - - // Custom fields not modeled - HasDualStack boxedBool `json:"-"` - DualStackHostname string `json:"-"` - - // Signature Version not used - SignatureVersions []string `json:"signatureVersions"` - - // SSLCommonName not used. - SSLCommonName string `json:"sslCommonName"` -} - -const ( - defaultProtocol = "https" - defaultSigner = "v4" -) - -var ( - protocolPriority = []string{"https", "http"} - signerPriority = []string{"v4", "v2"} -) - -func getByPriority(s []string, p []string, def string) string { - if len(s) == 0 { - return def - } - - for i := 0; i < len(p); i++ { - for j := 0; j < len(s); j++ { - if s[j] == p[i] { - return s[j] - } - } - } - - return s[0] -} - -func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs []endpoint, opts Options) (ResolvedEndpoint, error) { - var merged endpoint - for _, def := range defs { - merged.mergeIn(def) - } - merged.mergeIn(e) - e = merged - - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - - signingName := e.CredentialScope.Service - var signingNameDerived bool - if len(signingName) == 0 { - signingName = service - signingNameDerived = true - } - - hostname := e.Hostname - // Offset the hostname for dualstack if enabled - if opts.UseDualStack && e.HasDualStack == boxedTrue { - hostname = e.DualStackHostname - region = signingRegion - } - - if !validateInputRegion(region) { - return ResolvedEndpoint{}, fmt.Errorf("invalid region identifier format provided") - } - - u := strings.Replace(hostname, "{service}", service, 1) - u = strings.Replace(u, "{region}", region, 1) - u = strings.Replace(u, "{dnsSuffix}", dnsSuffix, 1) - - scheme := getEndpointScheme(e.Protocols, opts.DisableSSL) - u = fmt.Sprintf("%s://%s", scheme, u) - - return ResolvedEndpoint{ - URL: u, - PartitionID: partitionID, - SigningRegion: signingRegion, - SigningName: signingName, - SigningNameDerived: signingNameDerived, - SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), - }, nil -} - -func getEndpointScheme(protocols []string, disableSSL bool) string { - if disableSSL { - return "http" - } - - return getByPriority(protocols, protocolPriority, defaultProtocol) -} - -func (e *endpoint) mergeIn(other endpoint) { - if len(other.Hostname) > 0 { - e.Hostname = other.Hostname - } - if len(other.Protocols) > 0 { - e.Protocols = other.Protocols - } - if len(other.SignatureVersions) > 0 { - e.SignatureVersions = other.SignatureVersions - } - if len(other.CredentialScope.Region) > 0 { - e.CredentialScope.Region = other.CredentialScope.Region - } - if len(other.CredentialScope.Service) > 0 { - e.CredentialScope.Service = other.CredentialScope.Service - } - if len(other.SSLCommonName) > 0 { - e.SSLCommonName = other.SSLCommonName - } - if other.HasDualStack != boxedBoolUnset { - e.HasDualStack = other.HasDualStack - } - if len(other.DualStackHostname) > 0 { - e.DualStackHostname = other.DualStackHostname - } -} - -type credentialScope struct { - Region string `json:"region"` - Service string `json:"service"` -} - -type boxedBool int - -func (b *boxedBool) UnmarshalJSON(buf []byte) error { - v, err := strconv.ParseBool(string(buf)) - if err != nil { - return err - } - - if v { - *b = boxedTrue - } else { - *b = boxedFalse - } - - return nil -} - -const ( - boxedBoolUnset boxedBool = iota - boxedFalse - boxedTrue -) - -func validateInputRegion(region string) bool { - return regionValidationRegex.MatchString(region) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go deleted file mode 100644 index 0fdfcc56e0..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go +++ /dev/null @@ -1,351 +0,0 @@ -// +build codegen - -package endpoints - -import ( - "fmt" - "io" - "reflect" - "strings" - "text/template" - "unicode" -) - -// A CodeGenOptions are the options for code generating the endpoints into -// Go code from the endpoints model definition. -type CodeGenOptions struct { - // Options for how the model will be decoded. - DecodeModelOptions DecodeModelOptions - - // Disables code generation of the service endpoint prefix IDs defined in - // the model. - DisableGenerateServiceIDs bool -} - -// Set combines all of the option functions together -func (d *CodeGenOptions) Set(optFns ...func(*CodeGenOptions)) { - for _, fn := range optFns { - fn(d) - } -} - -// CodeGenModel given a endpoints model file will decode it and attempt to -// generate Go code from the model definition. Error will be returned if -// the code is unable to be generated, or decoded. -func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGenOptions)) error { - var opts CodeGenOptions - opts.Set(optFns...) - - resolver, err := DecodeModel(modelFile, func(d *DecodeModelOptions) { - *d = opts.DecodeModelOptions - }) - if err != nil { - return err - } - - v := struct { - Resolver - CodeGenOptions - }{ - Resolver: resolver, - CodeGenOptions: opts, - } - - tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl)) - if err := tmpl.ExecuteTemplate(outFile, "defaults", v); err != nil { - return fmt.Errorf("failed to execute template, %v", err) - } - - return nil -} - -func toSymbol(v string) string { - out := []rune{} - for _, c := range strings.Title(v) { - if !(unicode.IsNumber(c) || unicode.IsLetter(c)) { - continue - } - - out = append(out, c) - } - - return string(out) -} - -func quoteString(v string) string { - return fmt.Sprintf("%q", v) -} - -func regionConstName(p, r string) string { - return toSymbol(p) + toSymbol(r) -} - -func partitionGetter(id string) string { - return fmt.Sprintf("%sPartition", toSymbol(id)) -} - -func partitionVarName(id string) string { - return fmt.Sprintf("%sPartition", strings.ToLower(toSymbol(id))) -} - -func listPartitionNames(ps partitions) string { - names := []string{} - switch len(ps) { - case 1: - return ps[0].Name - case 2: - return fmt.Sprintf("%s and %s", ps[0].Name, ps[1].Name) - default: - for i, p := range ps { - if i == len(ps)-1 { - names = append(names, "and "+p.Name) - } else { - names = append(names, p.Name) - } - } - return strings.Join(names, ", ") - } -} - -func boxedBoolIfSet(msg string, v boxedBool) string { - switch v { - case boxedTrue: - return fmt.Sprintf(msg, "boxedTrue") - case boxedFalse: - return fmt.Sprintf(msg, "boxedFalse") - default: - return "" - } -} - -func stringIfSet(msg, v string) string { - if len(v) == 0 { - return "" - } - - return fmt.Sprintf(msg, v) -} - -func stringSliceIfSet(msg string, vs []string) string { - if len(vs) == 0 { - return "" - } - - names := []string{} - for _, v := range vs { - names = append(names, `"`+v+`"`) - } - - return fmt.Sprintf(msg, strings.Join(names, ",")) -} - -func endpointIsSet(v endpoint) bool { - return !reflect.DeepEqual(v, endpoint{}) -} - -func serviceSet(ps partitions) map[string]struct{} { - set := map[string]struct{}{} - for _, p := range ps { - for id := range p.Services { - set[id] = struct{}{} - } - } - - return set -} - -var funcMap = template.FuncMap{ - "ToSymbol": toSymbol, - "QuoteString": quoteString, - "RegionConst": regionConstName, - "PartitionGetter": partitionGetter, - "PartitionVarName": partitionVarName, - "ListPartitionNames": listPartitionNames, - "BoxedBoolIfSet": boxedBoolIfSet, - "StringIfSet": stringIfSet, - "StringSliceIfSet": stringSliceIfSet, - "EndpointIsSet": endpointIsSet, - "ServicesSet": serviceSet, -} - -const v3Tmpl = ` -{{ define "defaults" -}} -// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. - -package endpoints - -import ( - "regexp" -) - - {{ template "partition consts" $.Resolver }} - - {{ range $_, $partition := $.Resolver }} - {{ template "partition region consts" $partition }} - {{ end }} - - {{ if not $.DisableGenerateServiceIDs -}} - {{ template "service consts" $.Resolver }} - {{- end }} - - {{ template "endpoint resolvers" $.Resolver }} -{{- end }} - -{{ define "partition consts" }} - // Partition identifiers - const ( - {{ range $_, $p := . -}} - {{ ToSymbol $p.ID }}PartitionID = {{ QuoteString $p.ID }} // {{ $p.Name }} partition. - {{ end -}} - ) -{{- end }} - -{{ define "partition region consts" }} - // {{ .Name }} partition's regions. - const ( - {{ range $id, $region := .Regions -}} - {{ ToSymbol $id }}RegionID = {{ QuoteString $id }} // {{ $region.Description }}. - {{ end -}} - ) -{{- end }} - -{{ define "service consts" }} - // Service identifiers - const ( - {{ $serviceSet := ServicesSet . -}} - {{ range $id, $_ := $serviceSet -}} - {{ ToSymbol $id }}ServiceID = {{ QuoteString $id }} // {{ ToSymbol $id }}. - {{ end -}} - ) -{{- end }} - -{{ define "endpoint resolvers" }} - // DefaultResolver returns an Endpoint resolver that will be able - // to resolve endpoints for: {{ ListPartitionNames . }}. - // - // Use DefaultPartitions() to get the list of the default partitions. - func DefaultResolver() Resolver { - return defaultPartitions - } - - // DefaultPartitions returns a list of the partitions the SDK is bundled - // with. The available partitions are: {{ ListPartitionNames . }}. - // - // partitions := endpoints.DefaultPartitions - // for _, p := range partitions { - // // ... inspect partitions - // } - func DefaultPartitions() []Partition { - return defaultPartitions.Partitions() - } - - var defaultPartitions = partitions{ - {{ range $_, $partition := . -}} - {{ PartitionVarName $partition.ID }}, - {{ end }} - } - - {{ range $_, $partition := . -}} - {{ $name := PartitionGetter $partition.ID -}} - // {{ $name }} returns the Resolver for {{ $partition.Name }}. - func {{ $name }}() Partition { - return {{ PartitionVarName $partition.ID }}.Partition() - } - var {{ PartitionVarName $partition.ID }} = {{ template "gocode Partition" $partition }} - {{ end }} -{{ end }} - -{{ define "default partitions" }} - func DefaultPartitions() []Partition { - return []partition{ - {{ range $_, $partition := . -}} - // {{ ToSymbol $partition.ID}}Partition(), - {{ end }} - } - } -{{ end }} - -{{ define "gocode Partition" -}} -partition{ - {{ StringIfSet "ID: %q,\n" .ID -}} - {{ StringIfSet "Name: %q,\n" .Name -}} - {{ StringIfSet "DNSSuffix: %q,\n" .DNSSuffix -}} - RegionRegex: {{ template "gocode RegionRegex" .RegionRegex }}, - {{ if EndpointIsSet .Defaults -}} - Defaults: {{ template "gocode Endpoint" .Defaults }}, - {{- end }} - Regions: {{ template "gocode Regions" .Regions }}, - Services: {{ template "gocode Services" .Services }}, -} -{{- end }} - -{{ define "gocode RegionRegex" -}} -regionRegex{ - Regexp: func() *regexp.Regexp{ - reg, _ := regexp.Compile({{ QuoteString .Regexp.String }}) - return reg - }(), -} -{{- end }} - -{{ define "gocode Regions" -}} -regions{ - {{ range $id, $region := . -}} - "{{ $id }}": {{ template "gocode Region" $region }}, - {{ end -}} -} -{{- end }} - -{{ define "gocode Region" -}} -region{ - {{ StringIfSet "Description: %q,\n" .Description -}} -} -{{- end }} - -{{ define "gocode Services" -}} -services{ - {{ range $id, $service := . -}} - "{{ $id }}": {{ template "gocode Service" $service }}, - {{ end }} -} -{{- end }} - -{{ define "gocode Service" -}} -service{ - {{ StringIfSet "PartitionEndpoint: %q,\n" .PartitionEndpoint -}} - {{ BoxedBoolIfSet "IsRegionalized: %s,\n" .IsRegionalized -}} - {{ if EndpointIsSet .Defaults -}} - Defaults: {{ template "gocode Endpoint" .Defaults -}}, - {{- end }} - {{ if .Endpoints -}} - Endpoints: {{ template "gocode Endpoints" .Endpoints }}, - {{- end }} -} -{{- end }} - -{{ define "gocode Endpoints" -}} -endpoints{ - {{ range $id, $endpoint := . -}} - "{{ $id }}": {{ template "gocode Endpoint" $endpoint }}, - {{ end }} -} -{{- end }} - -{{ define "gocode Endpoint" -}} -endpoint{ - {{ StringIfSet "Hostname: %q,\n" .Hostname -}} - {{ StringIfSet "SSLCommonName: %q,\n" .SSLCommonName -}} - {{ StringSliceIfSet "Protocols: []string{%s},\n" .Protocols -}} - {{ StringSliceIfSet "SignatureVersions: []string{%s},\n" .SignatureVersions -}} - {{ if or .CredentialScope.Region .CredentialScope.Service -}} - CredentialScope: credentialScope{ - {{ StringIfSet "Region: %q,\n" .CredentialScope.Region -}} - {{ StringIfSet "Service: %q,\n" .CredentialScope.Service -}} - }, - {{- end }} - {{ BoxedBoolIfSet "HasDualStack: %s,\n" .HasDualStack -}} - {{ StringIfSet "DualStackHostname: %q,\n" .DualStackHostname -}} - -} -{{- end }} -` diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/errors.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/errors.go deleted file mode 100644 index fa06f7a8f8..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/errors.go +++ /dev/null @@ -1,13 +0,0 @@ -package aws - -import "github.com/aws/aws-sdk-go/aws/awserr" - -var ( - // ErrMissingRegion is an error that is returned if region configuration is - // not found. - ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) - - // ErrMissingEndpoint is an error that is returned if an endpoint cannot be - // resolved for a service. - ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go deleted file mode 100644 index 91a6f277a7..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go +++ /dev/null @@ -1,12 +0,0 @@ -package aws - -// JSONValue is a representation of a grab bag type that will be marshaled -// into a json string. This type can be used just like any other map. -// -// Example: -// -// values := aws.JSONValue{ -// "Foo": "Bar", -// } -// values["Baz"] = "Qux" -type JSONValue map[string]interface{} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/logger.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/logger.go deleted file mode 100644 index 6ed15b2ecc..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/logger.go +++ /dev/null @@ -1,118 +0,0 @@ -package aws - -import ( - "log" - "os" -) - -// A LogLevelType defines the level logging should be performed at. Used to instruct -// the SDK which statements should be logged. -type LogLevelType uint - -// LogLevel returns the pointer to a LogLevel. Should be used to workaround -// not being able to take the address of a non-composite literal. -func LogLevel(l LogLevelType) *LogLevelType { - return &l -} - -// Value returns the LogLevel value or the default value LogOff if the LogLevel -// is nil. Safe to use on nil value LogLevelTypes. -func (l *LogLevelType) Value() LogLevelType { - if l != nil { - return *l - } - return LogOff -} - -// Matches returns true if the v LogLevel is enabled by this LogLevel. Should be -// used with logging sub levels. Is safe to use on nil value LogLevelTypes. If -// LogLevel is nil, will default to LogOff comparison. -func (l *LogLevelType) Matches(v LogLevelType) bool { - c := l.Value() - return c&v == v -} - -// AtLeast returns true if this LogLevel is at least high enough to satisfies v. -// Is safe to use on nil value LogLevelTypes. If LogLevel is nil, will default -// to LogOff comparison. -func (l *LogLevelType) AtLeast(v LogLevelType) bool { - c := l.Value() - return c >= v -} - -const ( - // LogOff states that no logging should be performed by the SDK. This is the - // default state of the SDK, and should be use to disable all logging. - LogOff LogLevelType = iota * 0x1000 - - // LogDebug state that debug output should be logged by the SDK. This should - // be used to inspect request made and responses received. - LogDebug -) - -// Debug Logging Sub Levels -const ( - // LogDebugWithSigning states that the SDK should log request signing and - // presigning events. This should be used to log the signing details of - // requests for debugging. Will also enable LogDebug. - LogDebugWithSigning LogLevelType = LogDebug | (1 << iota) - - // LogDebugWithHTTPBody states the SDK should log HTTP request and response - // HTTP bodys in addition to the headers and path. This should be used to - // see the body content of requests and responses made while using the SDK - // Will also enable LogDebug. - LogDebugWithHTTPBody - - // LogDebugWithRequestRetries states the SDK should log when service requests will - // be retried. This should be used to log when you want to log when service - // requests are being retried. Will also enable LogDebug. - LogDebugWithRequestRetries - - // LogDebugWithRequestErrors states the SDK should log when service requests fail - // to build, send, validate, or unmarshal. - LogDebugWithRequestErrors - - // LogDebugWithEventStreamBody states the SDK should log EventStream - // request and response bodys. This should be used to log the EventStream - // wire unmarshaled message content of requests and responses made while - // using the SDK Will also enable LogDebug. - LogDebugWithEventStreamBody -) - -// A Logger is a minimalistic interface for the SDK to log messages to. Should -// be used to provide custom logging writers for the SDK to use. -type Logger interface { - Log(...interface{}) -} - -// A LoggerFunc is a convenience type to convert a function taking a variadic -// list of arguments and wrap it so the Logger interface can be used. -// -// Example: -// s3.New(sess, &aws.Config{Logger: aws.LoggerFunc(func(args ...interface{}) { -// fmt.Fprintln(os.Stdout, args...) -// })}) -type LoggerFunc func(...interface{}) - -// Log calls the wrapped function with the arguments provided -func (f LoggerFunc) Log(args ...interface{}) { - f(args...) -} - -// NewDefaultLogger returns a Logger which will write log messages to stdout, and -// use same formatting runes as the stdlib log.Logger -func NewDefaultLogger() Logger { - return &defaultLogger{ - logger: log.New(os.Stdout, "", log.LstdFlags), - } -} - -// A defaultLogger provides a minimalistic logger satisfying the Logger interface. -type defaultLogger struct { - logger *log.Logger -} - -// Log logs the parameters to the stdlib logger. See log.Println. -func (l defaultLogger) Log(args ...interface{}) { - l.logger.Println(args...) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go deleted file mode 100644 index 2ba3c56c11..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go +++ /dev/null @@ -1,19 +0,0 @@ -package request - -import ( - "strings" -) - -func isErrConnectionReset(err error) bool { - if strings.Contains(err.Error(), "read: connection reset") { - return false - } - - if strings.Contains(err.Error(), "use of closed network connection") || - strings.Contains(err.Error(), "connection reset") || - strings.Contains(err.Error(), "broken pipe") { - return true - } - - return false -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go deleted file mode 100644 index e819ab6c0e..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go +++ /dev/null @@ -1,343 +0,0 @@ -package request - -import ( - "fmt" - "strings" -) - -// A Handlers provides a collection of request handlers for various -// stages of handling requests. -type Handlers struct { - Validate HandlerList - Build HandlerList - BuildStream HandlerList - Sign HandlerList - Send HandlerList - ValidateResponse HandlerList - Unmarshal HandlerList - UnmarshalStream HandlerList - UnmarshalMeta HandlerList - UnmarshalError HandlerList - Retry HandlerList - AfterRetry HandlerList - CompleteAttempt HandlerList - Complete HandlerList -} - -// Copy returns a copy of this handler's lists. -func (h *Handlers) Copy() Handlers { - return Handlers{ - Validate: h.Validate.copy(), - Build: h.Build.copy(), - BuildStream: h.BuildStream.copy(), - Sign: h.Sign.copy(), - Send: h.Send.copy(), - ValidateResponse: h.ValidateResponse.copy(), - Unmarshal: h.Unmarshal.copy(), - UnmarshalStream: h.UnmarshalStream.copy(), - UnmarshalError: h.UnmarshalError.copy(), - UnmarshalMeta: h.UnmarshalMeta.copy(), - Retry: h.Retry.copy(), - AfterRetry: h.AfterRetry.copy(), - CompleteAttempt: h.CompleteAttempt.copy(), - Complete: h.Complete.copy(), - } -} - -// Clear removes callback functions for all handlers. -func (h *Handlers) Clear() { - h.Validate.Clear() - h.Build.Clear() - h.BuildStream.Clear() - h.Send.Clear() - h.Sign.Clear() - h.Unmarshal.Clear() - h.UnmarshalStream.Clear() - h.UnmarshalMeta.Clear() - h.UnmarshalError.Clear() - h.ValidateResponse.Clear() - h.Retry.Clear() - h.AfterRetry.Clear() - h.CompleteAttempt.Clear() - h.Complete.Clear() -} - -// IsEmpty returns if there are no handlers in any of the handlerlists. -func (h *Handlers) IsEmpty() bool { - if h.Validate.Len() != 0 { - return false - } - if h.Build.Len() != 0 { - return false - } - if h.BuildStream.Len() != 0 { - return false - } - if h.Send.Len() != 0 { - return false - } - if h.Sign.Len() != 0 { - return false - } - if h.Unmarshal.Len() != 0 { - return false - } - if h.UnmarshalStream.Len() != 0 { - return false - } - if h.UnmarshalMeta.Len() != 0 { - return false - } - if h.UnmarshalError.Len() != 0 { - return false - } - if h.ValidateResponse.Len() != 0 { - return false - } - if h.Retry.Len() != 0 { - return false - } - if h.AfterRetry.Len() != 0 { - return false - } - if h.CompleteAttempt.Len() != 0 { - return false - } - if h.Complete.Len() != 0 { - return false - } - - return true -} - -// A HandlerListRunItem represents an entry in the HandlerList which -// is being run. -type HandlerListRunItem struct { - Index int - Handler NamedHandler - Request *Request -} - -// A HandlerList manages zero or more handlers in a list. -type HandlerList struct { - list []NamedHandler - - // Called after each request handler in the list is called. If set - // and the func returns true the HandlerList will continue to iterate - // over the request handlers. If false is returned the HandlerList - // will stop iterating. - // - // Should be used if extra logic to be performed between each handler - // in the list. This can be used to terminate a list's iteration - // based on a condition such as error like, HandlerListStopOnError. - // Or for logging like HandlerListLogItem. - AfterEachFn func(item HandlerListRunItem) bool -} - -// A NamedHandler is a struct that contains a name and function callback. -type NamedHandler struct { - Name string - Fn func(*Request) -} - -// copy creates a copy of the handler list. -func (l *HandlerList) copy() HandlerList { - n := HandlerList{ - AfterEachFn: l.AfterEachFn, - } - if len(l.list) == 0 { - return n - } - - n.list = append(make([]NamedHandler, 0, len(l.list)), l.list...) - return n -} - -// Clear clears the handler list. -func (l *HandlerList) Clear() { - l.list = l.list[0:0] -} - -// Len returns the number of handlers in the list. -func (l *HandlerList) Len() int { - return len(l.list) -} - -// PushBack pushes handler f to the back of the handler list. -func (l *HandlerList) PushBack(f func(*Request)) { - l.PushBackNamed(NamedHandler{"__anonymous", f}) -} - -// PushBackNamed pushes named handler f to the back of the handler list. -func (l *HandlerList) PushBackNamed(n NamedHandler) { - if cap(l.list) == 0 { - l.list = make([]NamedHandler, 0, 5) - } - l.list = append(l.list, n) -} - -// PushFront pushes handler f to the front of the handler list. -func (l *HandlerList) PushFront(f func(*Request)) { - l.PushFrontNamed(NamedHandler{"__anonymous", f}) -} - -// PushFrontNamed pushes named handler f to the front of the handler list. -func (l *HandlerList) PushFrontNamed(n NamedHandler) { - if cap(l.list) == len(l.list) { - // Allocating new list required - l.list = append([]NamedHandler{n}, l.list...) - } else { - // Enough room to prepend into list. - l.list = append(l.list, NamedHandler{}) - copy(l.list[1:], l.list) - l.list[0] = n - } -} - -// Remove removes a NamedHandler n -func (l *HandlerList) Remove(n NamedHandler) { - l.RemoveByName(n.Name) -} - -// RemoveByName removes a NamedHandler by name. -func (l *HandlerList) RemoveByName(name string) { - for i := 0; i < len(l.list); i++ { - m := l.list[i] - if m.Name == name { - // Shift array preventing creating new arrays - copy(l.list[i:], l.list[i+1:]) - l.list[len(l.list)-1] = NamedHandler{} - l.list = l.list[:len(l.list)-1] - - // decrement list so next check to length is correct - i-- - } - } -} - -// SwapNamed will swap out any existing handlers with the same name as the -// passed in NamedHandler returning true if handlers were swapped. False is -// returned otherwise. -func (l *HandlerList) SwapNamed(n NamedHandler) (swapped bool) { - for i := 0; i < len(l.list); i++ { - if l.list[i].Name == n.Name { - l.list[i].Fn = n.Fn - swapped = true - } - } - - return swapped -} - -// Swap will swap out all handlers matching the name passed in. The matched -// handlers will be swapped in. True is returned if the handlers were swapped. -func (l *HandlerList) Swap(name string, replace NamedHandler) bool { - var swapped bool - - for i := 0; i < len(l.list); i++ { - if l.list[i].Name == name { - l.list[i] = replace - swapped = true - } - } - - return swapped -} - -// SetBackNamed will replace the named handler if it exists in the handler list. -// If the handler does not exist the handler will be added to the end of the list. -func (l *HandlerList) SetBackNamed(n NamedHandler) { - if !l.SwapNamed(n) { - l.PushBackNamed(n) - } -} - -// SetFrontNamed will replace the named handler if it exists in the handler list. -// If the handler does not exist the handler will be added to the beginning of -// the list. -func (l *HandlerList) SetFrontNamed(n NamedHandler) { - if !l.SwapNamed(n) { - l.PushFrontNamed(n) - } -} - -// Run executes all handlers in the list with a given request object. -func (l *HandlerList) Run(r *Request) { - for i, h := range l.list { - h.Fn(r) - item := HandlerListRunItem{ - Index: i, Handler: h, Request: r, - } - if l.AfterEachFn != nil && !l.AfterEachFn(item) { - return - } - } -} - -// HandlerListLogItem logs the request handler and the state of the -// request's Error value. Always returns true to continue iterating -// request handlers in a HandlerList. -func HandlerListLogItem(item HandlerListRunItem) bool { - if item.Request.Config.Logger == nil { - return true - } - item.Request.Config.Logger.Log("DEBUG: RequestHandler", - item.Index, item.Handler.Name, item.Request.Error) - - return true -} - -// HandlerListStopOnError returns false to stop the HandlerList iterating -// over request handlers if Request.Error is not nil. True otherwise -// to continue iterating. -func HandlerListStopOnError(item HandlerListRunItem) bool { - return item.Request.Error == nil -} - -// WithAppendUserAgent will add a string to the user agent prefixed with a -// single white space. -func WithAppendUserAgent(s string) Option { - return func(r *Request) { - r.Handlers.Build.PushBack(func(r2 *Request) { - AddToUserAgent(r, s) - }) - } -} - -// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request -// header. If the extra parameters are provided they will be added as metadata to the -// name/version pair resulting in the following format. -// "name/version (extra0; extra1; ...)" -// The user agent part will be concatenated with this current request's user agent string. -func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) { - ua := fmt.Sprintf("%s/%s", name, version) - if len(extra) > 0 { - ua += fmt.Sprintf(" (%s)", strings.Join(extra, "; ")) - } - return func(r *Request) { - AddToUserAgent(r, ua) - } -} - -// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header. -// The input string will be concatenated with the current request's user agent string. -func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) { - return func(r *Request) { - AddToUserAgent(r, s) - } -} - -// WithSetRequestHeaders updates the operation request's HTTP header to contain -// the header key value pairs provided. If the header key already exists in the -// request's HTTP header set, the existing value(s) will be replaced. -func WithSetRequestHeaders(h map[string]string) Option { - return withRequestHeader(h).SetRequestHeaders -} - -type withRequestHeader map[string]string - -func (h withRequestHeader) SetRequestHeaders(r *Request) { - for k, v := range h { - r.HTTPRequest.Header[k] = []string{v} - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go deleted file mode 100644 index 79f79602b0..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go +++ /dev/null @@ -1,24 +0,0 @@ -package request - -import ( - "io" - "net/http" - "net/url" -) - -func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { - req := new(http.Request) - *req = *r - req.URL = &url.URL{} - *req.URL = *r.URL - req.Body = body - - req.Header = http.Header{} - for k, v := range r.Header { - for _, vv := range v { - req.Header.Add(k, vv) - } - } - - return req -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go deleted file mode 100644 index 9370fa50c3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go +++ /dev/null @@ -1,65 +0,0 @@ -package request - -import ( - "io" - "sync" - - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -// offsetReader is a thread-safe io.ReadCloser to prevent racing -// with retrying requests -type offsetReader struct { - buf io.ReadSeeker - lock sync.Mutex - closed bool -} - -func newOffsetReader(buf io.ReadSeeker, offset int64) (*offsetReader, error) { - reader := &offsetReader{} - _, err := buf.Seek(offset, sdkio.SeekStart) - if err != nil { - return nil, err - } - - reader.buf = buf - return reader, nil -} - -// Close will close the instance of the offset reader's access to -// the underlying io.ReadSeeker. -func (o *offsetReader) Close() error { - o.lock.Lock() - defer o.lock.Unlock() - o.closed = true - return nil -} - -// Read is a thread-safe read of the underlying io.ReadSeeker -func (o *offsetReader) Read(p []byte) (int, error) { - o.lock.Lock() - defer o.lock.Unlock() - - if o.closed { - return 0, io.EOF - } - - return o.buf.Read(p) -} - -// Seek is a thread-safe seeking operation. -func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { - o.lock.Lock() - defer o.lock.Unlock() - - return o.buf.Seek(offset, whence) -} - -// CloseAndCopy will return a new offsetReader with a copy of the old buffer -// and close the old buffer. -func (o *offsetReader) CloseAndCopy(offset int64) (*offsetReader, error) { - if err := o.Close(); err != nil { - return nil, err - } - return newOffsetReader(o.buf, offset) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request.go deleted file mode 100644 index d597c6ead5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ /dev/null @@ -1,698 +0,0 @@ -package request - -import ( - "bytes" - "fmt" - "io" - "net/http" - "net/url" - "reflect" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -const ( - // ErrCodeSerialization is the serialization error code that is received - // during protocol unmarshaling. - ErrCodeSerialization = "SerializationError" - - // ErrCodeRead is an error that is returned during HTTP reads. - ErrCodeRead = "ReadError" - - // ErrCodeResponseTimeout is the connection timeout error that is received - // during body reads. - ErrCodeResponseTimeout = "ResponseTimeout" - - // ErrCodeInvalidPresignExpire is returned when the expire time provided to - // presign is invalid - ErrCodeInvalidPresignExpire = "InvalidPresignExpireError" - - // CanceledErrorCode is the error code that will be returned by an - // API request that was canceled. Requests given a aws.Context may - // return this error when canceled. - CanceledErrorCode = "RequestCanceled" - - // ErrCodeRequestError is an error preventing the SDK from continuing to - // process the request. - ErrCodeRequestError = "RequestError" -) - -// A Request is the service request to be made. -type Request struct { - Config aws.Config - ClientInfo metadata.ClientInfo - Handlers Handlers - - Retryer - AttemptTime time.Time - Time time.Time - Operation *Operation - HTTPRequest *http.Request - HTTPResponse *http.Response - Body io.ReadSeeker - streamingBody io.ReadCloser - BodyStart int64 // offset from beginning of Body that the request body starts - Params interface{} - Error error - Data interface{} - RequestID string - RetryCount int - Retryable *bool - RetryDelay time.Duration - NotHoist bool - SignedHeaderVals http.Header - LastSignedAt time.Time - DisableFollowRedirects bool - - // Additional API error codes that should be retried. IsErrorRetryable - // will consider these codes in addition to its built in cases. - RetryErrorCodes []string - - // Additional API error codes that should be retried with throttle backoff - // delay. IsErrorThrottle will consider these codes in addition to its - // built in cases. - ThrottleErrorCodes []string - - // A value greater than 0 instructs the request to be signed as Presigned URL - // You should not set this field directly. Instead use Request's - // Presign or PresignRequest methods. - ExpireTime time.Duration - - context aws.Context - - built bool - - // Need to persist an intermediate body between the input Body and HTTP - // request body because the HTTP Client's transport can maintain a reference - // to the HTTP request's body after the client has returned. This value is - // safe to use concurrently and wrap the input Body for each HTTP request. - safeBody *offsetReader -} - -// An Operation is the service API operation to be made. -type Operation struct { - Name string - HTTPMethod string - HTTPPath string - *Paginator - - BeforePresignFn func(r *Request) error -} - -// New returns a new Request pointer for the service API operation and -// parameters. -// -// A Retryer should be provided to direct how the request is retried. If -// Retryer is nil, a default no retry value will be used. You can use -// NoOpRetryer in the Client package to disable retry behavior directly. -// -// Params is any value of input parameters to be the request payload. -// Data is pointer value to an object which the request's response -// payload will be deserialized to. -func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, - retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { - - if retryer == nil { - retryer = noOpRetryer{} - } - - method := operation.HTTPMethod - if method == "" { - method = "POST" - } - - httpReq, _ := http.NewRequest(method, "", nil) - - var err error - httpReq.URL, err = url.Parse(clientInfo.Endpoint + operation.HTTPPath) - if err != nil { - httpReq.URL = &url.URL{} - err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err) - } - - r := &Request{ - Config: cfg, - ClientInfo: clientInfo, - Handlers: handlers.Copy(), - - Retryer: retryer, - Time: time.Now(), - ExpireTime: 0, - Operation: operation, - HTTPRequest: httpReq, - Body: nil, - Params: params, - Error: err, - Data: data, - } - r.SetBufferBody([]byte{}) - - return r -} - -// A Option is a functional option that can augment or modify a request when -// using a WithContext API operation method. -type Option func(*Request) - -// WithGetResponseHeader builds a request Option which will retrieve a single -// header value from the HTTP Response. If there are multiple values for the -// header key use WithGetResponseHeaders instead to access the http.Header -// map directly. The passed in val pointer must be non-nil. -// -// This Option can be used multiple times with a single API operation. -// -// var id2, versionID string -// svc.PutObjectWithContext(ctx, params, -// request.WithGetResponseHeader("x-amz-id-2", &id2), -// request.WithGetResponseHeader("x-amz-version-id", &versionID), -// ) -func WithGetResponseHeader(key string, val *string) Option { - return func(r *Request) { - r.Handlers.Complete.PushBack(func(req *Request) { - *val = req.HTTPResponse.Header.Get(key) - }) - } -} - -// WithGetResponseHeaders builds a request Option which will retrieve the -// headers from the HTTP response and assign them to the passed in headers -// variable. The passed in headers pointer must be non-nil. -// -// var headers http.Header -// svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers)) -func WithGetResponseHeaders(headers *http.Header) Option { - return func(r *Request) { - r.Handlers.Complete.PushBack(func(req *Request) { - *headers = req.HTTPResponse.Header - }) - } -} - -// WithLogLevel is a request option that will set the request to use a specific -// log level when the request is made. -// -// svc.PutObjectWithContext(ctx, params, request.WithLogLevel(aws.LogDebugWithHTTPBody) -func WithLogLevel(l aws.LogLevelType) Option { - return func(r *Request) { - r.Config.LogLevel = aws.LogLevel(l) - } -} - -// ApplyOptions will apply each option to the request calling them in the order -// the were provided. -func (r *Request) ApplyOptions(opts ...Option) { - for _, opt := range opts { - opt(r) - } -} - -// Context will always returns a non-nil context. If Request does not have a -// context aws.BackgroundContext will be returned. -func (r *Request) Context() aws.Context { - if r.context != nil { - return r.context - } - return aws.BackgroundContext() -} - -// SetContext adds a Context to the current request that can be used to cancel -// a in-flight request. The Context value must not be nil, or this method will -// panic. -// -// Unlike http.Request.WithContext, SetContext does not return a copy of the -// Request. It is not safe to use use a single Request value for multiple -// requests. A new Request should be created for each API operation request. -// -// Go 1.6 and below: -// The http.Request's Cancel field will be set to the Done() value of -// the context. This will overwrite the Cancel field's value. -// -// Go 1.7 and above: -// The http.Request.WithContext will be used to set the context on the underlying -// http.Request. This will create a shallow copy of the http.Request. The SDK -// may create sub contexts in the future for nested requests such as retries. -func (r *Request) SetContext(ctx aws.Context) { - if ctx == nil { - panic("context cannot be nil") - } - setRequestContext(r, ctx) -} - -// WillRetry returns if the request's can be retried. -func (r *Request) WillRetry() bool { - if !aws.IsReaderSeekable(r.Body) && r.HTTPRequest.Body != NoBody { - return false - } - return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() -} - -func fmtAttemptCount(retryCount, maxRetries int) string { - return fmt.Sprintf("attempt %v/%v", retryCount, maxRetries) -} - -// ParamsFilled returns if the request's parameters have been populated -// and the parameters are valid. False is returned if no parameters are -// provided or invalid. -func (r *Request) ParamsFilled() bool { - return r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid() -} - -// DataFilled returns true if the request's data for response deserialization -// target has been set and is a valid. False is returned if data is not -// set, or is invalid. -func (r *Request) DataFilled() bool { - return r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid() -} - -// SetBufferBody will set the request's body bytes that will be sent to -// the service API. -func (r *Request) SetBufferBody(buf []byte) { - r.SetReaderBody(bytes.NewReader(buf)) -} - -// SetStringBody sets the body of the request to be backed by a string. -func (r *Request) SetStringBody(s string) { - r.SetReaderBody(strings.NewReader(s)) -} - -// SetReaderBody will set the request's body reader. -func (r *Request) SetReaderBody(reader io.ReadSeeker) { - r.Body = reader - - if aws.IsReaderSeekable(reader) { - var err error - // Get the Bodies current offset so retries will start from the same - // initial position. - r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent) - if err != nil { - r.Error = awserr.New(ErrCodeSerialization, - "failed to determine start of request body", err) - return - } - } - r.ResetBody() -} - -// SetStreamingBody set the reader to be used for the request that will stream -// bytes to the server. Request's Body must not be set to any reader. -func (r *Request) SetStreamingBody(reader io.ReadCloser) { - r.streamingBody = reader - r.SetReaderBody(aws.ReadSeekCloser(reader)) -} - -// Presign returns the request's signed URL. Error will be returned -// if the signing fails. The expire parameter is only used for presigned Amazon -// S3 API requests. All other AWS services will use a fixed expiration -// time of 15 minutes. -// -// It is invalid to create a presigned URL with a expire duration 0 or less. An -// error is returned if expire duration is 0 or less. -func (r *Request) Presign(expire time.Duration) (string, error) { - r = r.copy() - - // Presign requires all headers be hoisted. There is no way to retrieve - // the signed headers not hoisted without this. Making the presigned URL - // useless. - r.NotHoist = false - - u, _, err := getPresignedURL(r, expire) - return u, err -} - -// PresignRequest behaves just like presign, with the addition of returning a -// set of headers that were signed. The expire parameter is only used for -// presigned Amazon S3 API requests. All other AWS services will use a fixed -// expiration time of 15 minutes. -// -// It is invalid to create a presigned URL with a expire duration 0 or less. An -// error is returned if expire duration is 0 or less. -// -// Returns the URL string for the API operation with signature in the query string, -// and the HTTP headers that were included in the signature. These headers must -// be included in any HTTP request made with the presigned URL. -// -// To prevent hoisting any headers to the query string set NotHoist to true on -// this Request value prior to calling PresignRequest. -func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error) { - r = r.copy() - return getPresignedURL(r, expire) -} - -// IsPresigned returns true if the request represents a presigned API url. -func (r *Request) IsPresigned() bool { - return r.ExpireTime != 0 -} - -func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, error) { - if expire <= 0 { - return "", nil, awserr.New( - ErrCodeInvalidPresignExpire, - "presigned URL requires an expire duration greater than 0", - nil, - ) - } - - r.ExpireTime = expire - - if r.Operation.BeforePresignFn != nil { - if err := r.Operation.BeforePresignFn(r); err != nil { - return "", nil, err - } - } - - if err := r.Sign(); err != nil { - return "", nil, err - } - - return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil -} - -const ( - notRetrying = "not retrying" -) - -func debugLogReqError(r *Request, stage, retryStr string, err error) { - if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { - return - } - - r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", - stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) -} - -// Build will build the request's object so it can be signed and sent -// to the service. Build will also validate all the request's parameters. -// Any additional build Handlers set on this request will be run -// in the order they were set. -// -// The request will only be built once. Multiple calls to build will have -// no effect. -// -// If any Validate or Build errors occur the build will stop and the error -// which occurred will be returned. -func (r *Request) Build() error { - if !r.built { - r.Handlers.Validate.Run(r) - if r.Error != nil { - debugLogReqError(r, "Validate Request", notRetrying, r.Error) - return r.Error - } - r.Handlers.Build.Run(r) - if r.Error != nil { - debugLogReqError(r, "Build Request", notRetrying, r.Error) - return r.Error - } - r.built = true - } - - return r.Error -} - -// Sign will sign the request, returning error if errors are encountered. -// -// Sign will build the request prior to signing. All Sign Handlers will -// be executed in the order they were set. -func (r *Request) Sign() error { - r.Build() - if r.Error != nil { - debugLogReqError(r, "Build Request", notRetrying, r.Error) - return r.Error - } - - SanitizeHostForHeader(r.HTTPRequest) - - r.Handlers.Sign.Run(r) - return r.Error -} - -func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { - if r.streamingBody != nil { - return r.streamingBody, nil - } - - if r.safeBody != nil { - r.safeBody.Close() - } - - r.safeBody, err = newOffsetReader(r.Body, r.BodyStart) - if err != nil { - return nil, awserr.New(ErrCodeSerialization, - "failed to get next request body reader", err) - } - - // Go 1.8 tightened and clarified the rules code needs to use when building - // requests with the http package. Go 1.8 removed the automatic detection - // of if the Request.Body was empty, or actually had bytes in it. The SDK - // always sets the Request.Body even if it is empty and should not actually - // be sent. This is incorrect. - // - // Go 1.8 did add a http.NoBody value that the SDK can use to tell the http - // client that the request really should be sent without a body. The - // Request.Body cannot be set to nil, which is preferable, because the - // field is exported and could introduce nil pointer dereferences for users - // of the SDK if they used that field. - // - // Related golang/go#18257 - l, err := aws.SeekerLen(r.Body) - if err != nil { - return nil, awserr.New(ErrCodeSerialization, - "failed to compute request body size", err) - } - - if l == 0 { - body = NoBody - } else if l > 0 { - body = r.safeBody - } else { - // Hack to prevent sending bodies for methods where the body - // should be ignored by the server. Sending bodies on these - // methods without an associated ContentLength will cause the - // request to socket timeout because the server does not handle - // Transfer-Encoding: chunked bodies for these methods. - // - // This would only happen if a aws.ReaderSeekerCloser was used with - // a io.Reader that was not also an io.Seeker, or did not implement - // Len() method. - switch r.Operation.HTTPMethod { - case "GET", "HEAD", "DELETE": - body = NoBody - default: - body = r.safeBody - } - } - - return body, nil -} - -// GetBody will return an io.ReadSeeker of the Request's underlying -// input body with a concurrency safe wrapper. -func (r *Request) GetBody() io.ReadSeeker { - return r.safeBody -} - -// Send will send the request, returning error if errors are encountered. -// -// Send will sign the request prior to sending. All Send Handlers will -// be executed in the order they were set. -// -// Canceling a request is non-deterministic. If a request has been canceled, -// then the transport will choose, randomly, one of the state channels during -// reads or getting the connection. -// -// readLoop() and getConn(req *Request, cm connectMethod) -// https://github.com/golang/go/blob/master/src/net/http/transport.go -// -// Send will not close the request.Request's body. -func (r *Request) Send() error { - defer func() { - // Regardless of success or failure of the request trigger the Complete - // request handlers. - r.Handlers.Complete.Run(r) - }() - - if err := r.Error; err != nil { - return err - } - - for { - r.Error = nil - r.AttemptTime = time.Now() - - if err := r.Sign(); err != nil { - debugLogReqError(r, "Sign Request", notRetrying, err) - return err - } - - if err := r.sendRequest(); err == nil { - return nil - } - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) - - if r.Error != nil || !aws.BoolValue(r.Retryable) { - return r.Error - } - - if err := r.prepareRetry(); err != nil { - r.Error = err - return err - } - } -} - -func (r *Request) prepareRetry() error { - if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { - r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", - r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) - } - - // The previous http.Request will have a reference to the r.Body - // and the HTTP Client's Transport may still be reading from - // the request's body even though the Client's Do returned. - r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) - r.ResetBody() - if err := r.Error; err != nil { - return awserr.New(ErrCodeSerialization, - "failed to prepare body for retry", err) - - } - - // Closing response body to ensure that no response body is leaked - // between retry attempts. - if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { - r.HTTPResponse.Body.Close() - } - - return nil -} - -func (r *Request) sendRequest() (sendErr error) { - defer r.Handlers.CompleteAttempt.Run(r) - - r.Retryable = nil - r.Handlers.Send.Run(r) - if r.Error != nil { - debugLogReqError(r, "Send Request", - fmtAttemptCount(r.RetryCount, r.MaxRetries()), - r.Error) - return r.Error - } - - r.Handlers.UnmarshalMeta.Run(r) - r.Handlers.ValidateResponse.Run(r) - if r.Error != nil { - r.Handlers.UnmarshalError.Run(r) - debugLogReqError(r, "Validate Response", - fmtAttemptCount(r.RetryCount, r.MaxRetries()), - r.Error) - return r.Error - } - - r.Handlers.Unmarshal.Run(r) - if r.Error != nil { - debugLogReqError(r, "Unmarshal Response", - fmtAttemptCount(r.RetryCount, r.MaxRetries()), - r.Error) - return r.Error - } - - return nil -} - -// copy will copy a request which will allow for local manipulation of the -// request. -func (r *Request) copy() *Request { - req := &Request{} - *req = *r - req.Handlers = r.Handlers.Copy() - op := *r.Operation - req.Operation = &op - return req -} - -// AddToUserAgent adds the string to the end of the request's current user agent. -func AddToUserAgent(r *Request, s string) { - curUA := r.HTTPRequest.Header.Get("User-Agent") - if len(curUA) > 0 { - s = curUA + " " + s - } - r.HTTPRequest.Header.Set("User-Agent", s) -} - -// SanitizeHostForHeader removes default port from host and updates request.Host -func SanitizeHostForHeader(r *http.Request) { - host := getHost(r) - port := portOnly(host) - if port != "" && isDefaultPort(r.URL.Scheme, port) { - r.Host = stripPort(host) - } -} - -// Returns host from request -func getHost(r *http.Request) string { - if r.Host != "" { - return r.Host - } - - if r.URL == nil { - return "" - } - - return r.URL.Host -} - -// Hostname returns u.Host, without any port number. -// -// If Host is an IPv6 literal with a port number, Hostname returns the -// IPv6 literal without the square brackets. IPv6 literals may include -// a zone identifier. -// -// Copied from the Go 1.8 standard library (net/url) -func stripPort(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return hostport - } - if i := strings.IndexByte(hostport, ']'); i != -1 { - return strings.TrimPrefix(hostport[:i], "[") - } - return hostport[:colon] -} - -// Port returns the port part of u.Host, without the leading colon. -// If u.Host doesn't contain a port, Port returns an empty string. -// -// Copied from the Go 1.8 standard library (net/url) -func portOnly(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return "" - } - if i := strings.Index(hostport, "]:"); i != -1 { - return hostport[i+len("]:"):] - } - if strings.Contains(hostport, "]") { - return "" - } - return hostport[colon+len(":"):] -} - -// Returns true if the specified URI is using the standard port -// (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs) -func isDefaultPort(scheme, port string) bool { - if port == "" { - return true - } - - lowerCaseScheme := strings.ToLower(scheme) - if (lowerCaseScheme == "http" && port == "80") || (lowerCaseScheme == "https" && port == "443") { - return true - } - - return false -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go deleted file mode 100644 index e36e468b7c..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go +++ /dev/null @@ -1,39 +0,0 @@ -// +build !go1.8 - -package request - -import "io" - -// NoBody is an io.ReadCloser with no bytes. Read always returns EOF -// and Close always returns nil. It can be used in an outgoing client -// request to explicitly signal that a request has zero bytes. -// An alternative, however, is to simply set Request.Body to nil. -// -// Copy of Go 1.8 NoBody type from net/http/http.go -type noBody struct{} - -func (noBody) Read([]byte) (int, error) { return 0, io.EOF } -func (noBody) Close() error { return nil } -func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil } - -// NoBody is an empty reader that will trigger the Go HTTP client to not include -// and body in the HTTP request. -var NoBody = noBody{} - -// ResetBody rewinds the request body back to its starting position, and -// sets the HTTP Request body reference. When the body is read prior -// to being sent in the HTTP request it will need to be rewound. -// -// ResetBody will automatically be called by the SDK's build handler, but if -// the request is being used directly ResetBody must be called before the request -// is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically -// call ResetBody. -func (r *Request) ResetBody() { - body, err := r.getNextRequestBody() - if err != nil { - r.Error = err - return - } - - r.HTTPRequest.Body = body -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go deleted file mode 100644 index de1292f45a..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go +++ /dev/null @@ -1,36 +0,0 @@ -// +build go1.8 - -package request - -import ( - "net/http" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// NoBody is a http.NoBody reader instructing Go HTTP client to not include -// and body in the HTTP request. -var NoBody = http.NoBody - -// ResetBody rewinds the request body back to its starting position, and -// sets the HTTP Request body reference. When the body is read prior -// to being sent in the HTTP request it will need to be rewound. -// -// ResetBody will automatically be called by the SDK's build handler, but if -// the request is being used directly ResetBody must be called before the request -// is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically -// call ResetBody. -// -// Will also set the Go 1.8's http.Request.GetBody member to allow retrying -// PUT/POST redirects. -func (r *Request) ResetBody() { - body, err := r.getNextRequestBody() - if err != nil { - r.Error = awserr.New(ErrCodeSerialization, - "failed to reset request body", err) - return - } - - r.HTTPRequest.Body = body - r.HTTPRequest.GetBody = r.getNextRequestBody -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go deleted file mode 100644 index a7365cd1e4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build go1.7 - -package request - -import "github.com/aws/aws-sdk-go/aws" - -// setContext updates the Request to use the passed in context for cancellation. -// Context will also be used for request retry delay. -// -// Creates shallow copy of the http.Request with the WithContext method. -func setRequestContext(r *Request, ctx aws.Context) { - r.context = ctx - r.HTTPRequest = r.HTTPRequest.WithContext(ctx) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go deleted file mode 100644 index 307fa0705b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build !go1.7 - -package request - -import "github.com/aws/aws-sdk-go/aws" - -// setContext updates the Request to use the passed in context for cancellation. -// Context will also be used for request retry delay. -// -// Creates shallow copy of the http.Request with the WithContext method. -func setRequestContext(r *Request, ctx aws.Context) { - r.context = ctx - r.HTTPRequest.Cancel = ctx.Done() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go deleted file mode 100644 index 64784e16f3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go +++ /dev/null @@ -1,266 +0,0 @@ -package request - -import ( - "reflect" - "sync/atomic" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" -) - -// A Pagination provides paginating of SDK API operations which are paginatable. -// Generally you should not use this type directly, but use the "Pages" API -// operations method to automatically perform pagination for you. Such as, -// "S3.ListObjectsPages", and "S3.ListObjectsPagesWithContext" methods. -// -// Pagination differs from a Paginator type in that pagination is the type that -// does the pagination between API operations, and Paginator defines the -// configuration that will be used per page request. -// -// for p.Next() { -// data := p.Page().(*s3.ListObjectsOutput) -// // process the page's data -// // ... -// // break out of loop to stop fetching additional pages -// } -// -// return p.Err() -// -// See service client API operation Pages methods for examples how the SDK will -// use the Pagination type. -type Pagination struct { - // Function to return a Request value for each pagination request. - // Any configuration or handlers that need to be applied to the request - // prior to getting the next page should be done here before the request - // returned. - // - // NewRequest should always be built from the same API operations. It is - // undefined if different API operations are returned on subsequent calls. - NewRequest func() (*Request, error) - // EndPageOnSameToken, when enabled, will allow the paginator to stop on - // token that are the same as its previous tokens. - EndPageOnSameToken bool - - started bool - prevTokens []interface{} - nextTokens []interface{} - - err error - curPage interface{} -} - -// HasNextPage will return true if Pagination is able to determine that the API -// operation has additional pages. False will be returned if there are no more -// pages remaining. -// -// Will always return true if Next has not been called yet. -func (p *Pagination) HasNextPage() bool { - if !p.started { - return true - } - - hasNextPage := len(p.nextTokens) != 0 - if p.EndPageOnSameToken { - return hasNextPage && !awsutil.DeepEqual(p.nextTokens, p.prevTokens) - } - return hasNextPage -} - -// Err returns the error Pagination encountered when retrieving the next page. -func (p *Pagination) Err() error { - return p.err -} - -// Page returns the current page. Page should only be called after a successful -// call to Next. It is undefined what Page will return if Page is called after -// Next returns false. -func (p *Pagination) Page() interface{} { - return p.curPage -} - -// Next will attempt to retrieve the next page for the API operation. When a page -// is retrieved true will be returned. If the page cannot be retrieved, or there -// are no more pages false will be returned. -// -// Use the Page method to retrieve the current page data. The data will need -// to be cast to the API operation's output type. -// -// Use the Err method to determine if an error occurred if Page returns false. -func (p *Pagination) Next() bool { - if !p.HasNextPage() { - return false - } - - req, err := p.NewRequest() - if err != nil { - p.err = err - return false - } - - if p.started { - for i, intok := range req.Operation.InputTokens { - awsutil.SetValueAtPath(req.Params, intok, p.nextTokens[i]) - } - } - p.started = true - - err = req.Send() - if err != nil { - p.err = err - return false - } - - p.prevTokens = p.nextTokens - p.nextTokens = req.nextPageTokens() - p.curPage = req.Data - - return true -} - -// A Paginator is the configuration data that defines how an API operation -// should be paginated. This type is used by the API service models to define -// the generated pagination config for service APIs. -// -// The Pagination type is what provides iterating between pages of an API. It -// is only used to store the token metadata the SDK should use for performing -// pagination. -type Paginator struct { - InputTokens []string - OutputTokens []string - LimitToken string - TruncationToken string -} - -// nextPageTokens returns the tokens to use when asking for the next page of data. -func (r *Request) nextPageTokens() []interface{} { - if r.Operation.Paginator == nil { - return nil - } - if r.Operation.TruncationToken != "" { - tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken) - if len(tr) == 0 { - return nil - } - - switch v := tr[0].(type) { - case *bool: - if !aws.BoolValue(v) { - return nil - } - case bool: - if !v { - return nil - } - } - } - - tokens := []interface{}{} - tokenAdded := false - for _, outToken := range r.Operation.OutputTokens { - vs, _ := awsutil.ValuesAtPath(r.Data, outToken) - if len(vs) == 0 { - tokens = append(tokens, nil) - continue - } - v := vs[0] - - switch tv := v.(type) { - case *string: - if len(aws.StringValue(tv)) == 0 { - tokens = append(tokens, nil) - continue - } - case string: - if len(tv) == 0 { - tokens = append(tokens, nil) - continue - } - } - - tokenAdded = true - tokens = append(tokens, v) - } - if !tokenAdded { - return nil - } - - return tokens -} - -// Ensure a deprecated item is only logged once instead of each time its used. -func logDeprecatedf(logger aws.Logger, flag *int32, msg string) { - if logger == nil { - return - } - if atomic.CompareAndSwapInt32(flag, 0, 1) { - logger.Log(msg) - } -} - -var ( - logDeprecatedHasNextPage int32 - logDeprecatedNextPage int32 - logDeprecatedEachPage int32 -) - -// HasNextPage returns true if this request has more pages of data available. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) HasNextPage() bool { - logDeprecatedf(r.Config.Logger, &logDeprecatedHasNextPage, - "Request.HasNextPage deprecated. Use Pagination type for configurable pagination of API operations") - - return len(r.nextPageTokens()) > 0 -} - -// NextPage returns a new Request that can be executed to return the next -// page of result data. Call .Send() on this request to execute it. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) NextPage() *Request { - logDeprecatedf(r.Config.Logger, &logDeprecatedNextPage, - "Request.NextPage deprecated. Use Pagination type for configurable pagination of API operations") - - tokens := r.nextPageTokens() - if len(tokens) == 0 { - return nil - } - - data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() - nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data) - for i, intok := range nr.Operation.InputTokens { - awsutil.SetValueAtPath(nr.Params, intok, tokens[i]) - } - return nr -} - -// EachPage iterates over each page of a paginated request object. The fn -// parameter should be a function with the following sample signature: -// -// func(page *T, lastPage bool) bool { -// return true // return false to stop iterating -// } -// -// Where "T" is the structure type matching the output structure of the given -// operation. For example, a request object generated by -// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput -// as the structure "T". The lastPage value represents whether the page is -// the last page of data or not. The return value of this function should -// return true to keep iterating or false to stop. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error { - logDeprecatedf(r.Config.Logger, &logDeprecatedEachPage, - "Request.EachPage deprecated. Use Pagination type for configurable pagination of API operations") - - for page := r; page != nil; page = page.NextPage() { - if err := page.Send(); err != nil { - return err - } - if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage { - return page.Error - } - } - - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go deleted file mode 100644 index 752ae47f84..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ /dev/null @@ -1,309 +0,0 @@ -package request - -import ( - "net" - "net/url" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// Retryer provides the interface drive the SDK's request retry behavior. The -// Retryer implementation is responsible for implementing exponential backoff, -// and determine if a request API error should be retried. -// -// client.DefaultRetryer is the SDK's default implementation of the Retryer. It -// uses the which uses the Request.IsErrorRetryable and Request.IsErrorThrottle -// methods to determine if the request is retried. -type Retryer interface { - // RetryRules return the retry delay that should be used by the SDK before - // making another request attempt for the failed request. - RetryRules(*Request) time.Duration - - // ShouldRetry returns if the failed request is retryable. - // - // Implementations may consider request attempt count when determining if a - // request is retryable, but the SDK will use MaxRetries to limit the - // number of attempts a request are made. - ShouldRetry(*Request) bool - - // MaxRetries is the number of times a request may be retried before - // failing. - MaxRetries() int -} - -// WithRetryer sets a Retryer value to the given Config returning the Config -// value for chaining. The value must not be nil. -func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { - if retryer == nil { - if cfg.Logger != nil { - cfg.Logger.Log("ERROR: Request.WithRetryer called with nil retryer. Replacing with retry disabled Retryer.") - } - retryer = noOpRetryer{} - } - cfg.Retryer = retryer - return cfg - -} - -// noOpRetryer is a internal no op retryer used when a request is created -// without a retryer. -// -// Provides a retryer that performs no retries. -// It should be used when we do not want retries to be performed. -type noOpRetryer struct{} - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API; For NoOpRetryer the MaxRetries will always be zero. -func (d noOpRetryer) MaxRetries() int { - return 0 -} - -// ShouldRetry will always return false for NoOpRetryer, as it should never retry. -func (d noOpRetryer) ShouldRetry(_ *Request) bool { - return false -} - -// RetryRules returns the delay duration before retrying this request again; -// since NoOpRetryer does not retry, RetryRules always returns 0. -func (d noOpRetryer) RetryRules(_ *Request) time.Duration { - return 0 -} - -// retryableCodes is a collection of service response codes which are retry-able -// without any further action. -var retryableCodes = map[string]struct{}{ - ErrCodeRequestError: {}, - "RequestTimeout": {}, - ErrCodeResponseTimeout: {}, - "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout -} - -var throttleCodes = map[string]struct{}{ - "ProvisionedThroughputExceededException": {}, - "ThrottledException": {}, // SNS, XRay, ResourceGroupsTagging API - "Throttling": {}, - "ThrottlingException": {}, - "RequestLimitExceeded": {}, - "RequestThrottled": {}, - "RequestThrottledException": {}, - "TooManyRequestsException": {}, // Lambda functions - "PriorRequestNotComplete": {}, // Route53 - "TransactionInProgressException": {}, - "EC2ThrottledException": {}, // EC2 -} - -// credsExpiredCodes is a collection of error codes which signify the credentials -// need to be refreshed. Expired tokens require refreshing of credentials, and -// resigning before the request can be retried. -var credsExpiredCodes = map[string]struct{}{ - "ExpiredToken": {}, - "ExpiredTokenException": {}, - "RequestExpired": {}, // EC2 Only -} - -func isCodeThrottle(code string) bool { - _, ok := throttleCodes[code] - return ok -} - -func isCodeRetryable(code string) bool { - if _, ok := retryableCodes[code]; ok { - return true - } - - return isCodeExpiredCreds(code) -} - -func isCodeExpiredCreds(code string) bool { - _, ok := credsExpiredCodes[code] - return ok -} - -var validParentCodes = map[string]struct{}{ - ErrCodeSerialization: {}, - ErrCodeRead: {}, -} - -func isNestedErrorRetryable(parentErr awserr.Error) bool { - if parentErr == nil { - return false - } - - if _, ok := validParentCodes[parentErr.Code()]; !ok { - return false - } - - err := parentErr.OrigErr() - if err == nil { - return false - } - - if aerr, ok := err.(awserr.Error); ok { - return isCodeRetryable(aerr.Code()) - } - - if t, ok := err.(temporary); ok { - return t.Temporary() || isErrConnectionReset(err) - } - - return isErrConnectionReset(err) -} - -// IsErrorRetryable returns whether the error is retryable, based on its Code. -// Returns false if error is nil. -func IsErrorRetryable(err error) bool { - if err == nil { - return false - } - return shouldRetryError(err) -} - -type temporary interface { - Temporary() bool -} - -func shouldRetryError(origErr error) bool { - switch err := origErr.(type) { - case awserr.Error: - if err.Code() == CanceledErrorCode { - return false - } - if isNestedErrorRetryable(err) { - return true - } - - origErr := err.OrigErr() - var shouldRetry bool - if origErr != nil { - shouldRetry = shouldRetryError(origErr) - if err.Code() == ErrCodeRequestError && !shouldRetry { - return false - } - } - if isCodeRetryable(err.Code()) { - return true - } - return shouldRetry - - case *url.Error: - if strings.Contains(err.Error(), "connection refused") { - // Refused connections should be retried as the service may not yet - // be running on the port. Go TCP dial considers refused - // connections as not temporary. - return true - } - // *url.Error only implements Temporary after golang 1.6 but since - // url.Error only wraps the error: - return shouldRetryError(err.Err) - - case temporary: - if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" { - return true - } - // If the error is temporary, we want to allow continuation of the - // retry process - return err.Temporary() || isErrConnectionReset(origErr) - - case nil: - // `awserr.Error.OrigErr()` can be nil, meaning there was an error but - // because we don't know the cause, it is marked as retryable. See - // TestRequest4xxUnretryable for an example. - return true - - default: - switch err.Error() { - case "net/http: request canceled", - "net/http: request canceled while waiting for connection": - // known 1.5 error case when an http request is cancelled - return false - } - // here we don't know the error; so we allow a retry. - return true - } -} - -// IsErrorThrottle returns whether the error is to be throttled based on its code. -// Returns false if error is nil. -func IsErrorThrottle(err error) bool { - if aerr, ok := err.(awserr.Error); ok && aerr != nil { - return isCodeThrottle(aerr.Code()) - } - return false -} - -// IsErrorExpiredCreds returns whether the error code is a credential expiry -// error. Returns false if error is nil. -func IsErrorExpiredCreds(err error) bool { - if aerr, ok := err.(awserr.Error); ok && aerr != nil { - return isCodeExpiredCreds(aerr.Code()) - } - return false -} - -// IsErrorRetryable returns whether the error is retryable, based on its Code. -// Returns false if the request has no Error set. -// -// Alias for the utility function IsErrorRetryable -func (r *Request) IsErrorRetryable() bool { - if isErrCode(r.Error, r.RetryErrorCodes) { - return true - } - - // HTTP response status code 501 should not be retried. - // 501 represents Not Implemented which means the request method is not - // supported by the server and cannot be handled. - if r.HTTPResponse != nil { - // HTTP response status code 500 represents internal server error and - // should be retried without any throttle. - if r.HTTPResponse.StatusCode == 500 { - return true - } - } - return IsErrorRetryable(r.Error) -} - -// IsErrorThrottle returns whether the error is to be throttled based on its -// code. Returns false if the request has no Error set. -// -// Alias for the utility function IsErrorThrottle -func (r *Request) IsErrorThrottle() bool { - if isErrCode(r.Error, r.ThrottleErrorCodes) { - return true - } - - if r.HTTPResponse != nil { - switch r.HTTPResponse.StatusCode { - case - 429, // error caused due to too many requests - 502, // Bad Gateway error should be throttled - 503, // caused when service is unavailable - 504: // error occurred due to gateway timeout - return true - } - } - - return IsErrorThrottle(r.Error) -} - -func isErrCode(err error, codes []string) bool { - if aerr, ok := err.(awserr.Error); ok && aerr != nil { - for _, code := range codes { - if code == aerr.Code() { - return true - } - } - } - - return false -} - -// IsErrorExpired returns whether the error code is a credential expiry error. -// Returns false if the request has no Error set. -// -// Alias for the utility function IsErrorExpiredCreds -func (r *Request) IsErrorExpired() bool { - return IsErrorExpiredCreds(r.Error) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go deleted file mode 100644 index 09a44eb987..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go +++ /dev/null @@ -1,94 +0,0 @@ -package request - -import ( - "io" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -var timeoutErr = awserr.New( - ErrCodeResponseTimeout, - "read on body has reached the timeout limit", - nil, -) - -type readResult struct { - n int - err error -} - -// timeoutReadCloser will handle body reads that take too long. -// We will return a ErrReadTimeout error if a timeout occurs. -type timeoutReadCloser struct { - reader io.ReadCloser - duration time.Duration -} - -// Read will spin off a goroutine to call the reader's Read method. We will -// select on the timer's channel or the read's channel. Whoever completes first -// will be returned. -func (r *timeoutReadCloser) Read(b []byte) (int, error) { - timer := time.NewTimer(r.duration) - c := make(chan readResult, 1) - - go func() { - n, err := r.reader.Read(b) - timer.Stop() - c <- readResult{n: n, err: err} - }() - - select { - case data := <-c: - return data.n, data.err - case <-timer.C: - return 0, timeoutErr - } -} - -func (r *timeoutReadCloser) Close() error { - return r.reader.Close() -} - -const ( - // HandlerResponseTimeout is what we use to signify the name of the - // response timeout handler. - HandlerResponseTimeout = "ResponseTimeoutHandler" -) - -// adaptToResponseTimeoutError is a handler that will replace any top level error -// to a ErrCodeResponseTimeout, if its child is that. -func adaptToResponseTimeoutError(req *Request) { - if err, ok := req.Error.(awserr.Error); ok { - aerr, ok := err.OrigErr().(awserr.Error) - if ok && aerr.Code() == ErrCodeResponseTimeout { - req.Error = aerr - } - } -} - -// WithResponseReadTimeout is a request option that will wrap the body in a timeout read closer. -// This will allow for per read timeouts. If a timeout occurred, we will return the -// ErrCodeResponseTimeout. -// -// svc.PutObjectWithContext(ctx, params, request.WithTimeoutReadCloser(30 * time.Second) -func WithResponseReadTimeout(duration time.Duration) Option { - return func(r *Request) { - - var timeoutHandler = NamedHandler{ - HandlerResponseTimeout, - func(req *Request) { - req.HTTPResponse.Body = &timeoutReadCloser{ - reader: req.HTTPResponse.Body, - duration: duration, - } - }} - - // remove the handler so we are not stomping over any new durations. - r.Handlers.Send.RemoveByName(HandlerResponseTimeout) - r.Handlers.Send.PushBackNamed(timeoutHandler) - - r.Handlers.Unmarshal.PushBack(adaptToResponseTimeoutError) - r.Handlers.UnmarshalError.PushBack(adaptToResponseTimeoutError) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go deleted file mode 100644 index 8630683f31..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go +++ /dev/null @@ -1,286 +0,0 @@ -package request - -import ( - "bytes" - "fmt" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -const ( - // InvalidParameterErrCode is the error code for invalid parameters errors - InvalidParameterErrCode = "InvalidParameter" - // ParamRequiredErrCode is the error code for required parameter errors - ParamRequiredErrCode = "ParamRequiredError" - // ParamMinValueErrCode is the error code for fields with too low of a - // number value. - ParamMinValueErrCode = "ParamMinValueError" - // ParamMinLenErrCode is the error code for fields without enough elements. - ParamMinLenErrCode = "ParamMinLenError" - // ParamMaxLenErrCode is the error code for value being too long. - ParamMaxLenErrCode = "ParamMaxLenError" - - // ParamFormatErrCode is the error code for a field with invalid - // format or characters. - ParamFormatErrCode = "ParamFormatInvalidError" -) - -// Validator provides a way for types to perform validation logic on their -// input values that external code can use to determine if a type's values -// are valid. -type Validator interface { - Validate() error -} - -// An ErrInvalidParams provides wrapping of invalid parameter errors found when -// validating API operation input parameters. -type ErrInvalidParams struct { - // Context is the base context of the invalid parameter group. - Context string - errs []ErrInvalidParam -} - -// Add adds a new invalid parameter error to the collection of invalid -// parameters. The context of the invalid parameter will be updated to reflect -// this collection. -func (e *ErrInvalidParams) Add(err ErrInvalidParam) { - err.SetContext(e.Context) - e.errs = append(e.errs, err) -} - -// AddNested adds the invalid parameter errors from another ErrInvalidParams -// value into this collection. The nested errors will have their nested context -// updated and base context to reflect the merging. -// -// Use for nested validations errors. -func (e *ErrInvalidParams) AddNested(nestedCtx string, nested ErrInvalidParams) { - for _, err := range nested.errs { - err.SetContext(e.Context) - err.AddNestedContext(nestedCtx) - e.errs = append(e.errs, err) - } -} - -// Len returns the number of invalid parameter errors -func (e ErrInvalidParams) Len() int { - return len(e.errs) -} - -// Code returns the code of the error -func (e ErrInvalidParams) Code() string { - return InvalidParameterErrCode -} - -// Message returns the message of the error -func (e ErrInvalidParams) Message() string { - return fmt.Sprintf("%d validation error(s) found.", len(e.errs)) -} - -// Error returns the string formatted form of the invalid parameters. -func (e ErrInvalidParams) Error() string { - w := &bytes.Buffer{} - fmt.Fprintf(w, "%s: %s\n", e.Code(), e.Message()) - - for _, err := range e.errs { - fmt.Fprintf(w, "- %s\n", err.Message()) - } - - return w.String() -} - -// OrigErr returns the invalid parameters as a awserr.BatchedErrors value -func (e ErrInvalidParams) OrigErr() error { - return awserr.NewBatchError( - InvalidParameterErrCode, e.Message(), e.OrigErrs()) -} - -// OrigErrs returns a slice of the invalid parameters -func (e ErrInvalidParams) OrigErrs() []error { - errs := make([]error, len(e.errs)) - for i := 0; i < len(errs); i++ { - errs[i] = e.errs[i] - } - - return errs -} - -// An ErrInvalidParam represents an invalid parameter error type. -type ErrInvalidParam interface { - awserr.Error - - // Field name the error occurred on. - Field() string - - // SetContext updates the context of the error. - SetContext(string) - - // AddNestedContext updates the error's context to include a nested level. - AddNestedContext(string) -} - -type errInvalidParam struct { - context string - nestedContext string - field string - code string - msg string -} - -// Code returns the error code for the type of invalid parameter. -func (e *errInvalidParam) Code() string { - return e.code -} - -// Message returns the reason the parameter was invalid, and its context. -func (e *errInvalidParam) Message() string { - return fmt.Sprintf("%s, %s.", e.msg, e.Field()) -} - -// Error returns the string version of the invalid parameter error. -func (e *errInvalidParam) Error() string { - return fmt.Sprintf("%s: %s", e.code, e.Message()) -} - -// OrigErr returns nil, Implemented for awserr.Error interface. -func (e *errInvalidParam) OrigErr() error { - return nil -} - -// Field Returns the field and context the error occurred. -func (e *errInvalidParam) Field() string { - field := e.context - if len(field) > 0 { - field += "." - } - if len(e.nestedContext) > 0 { - field += fmt.Sprintf("%s.", e.nestedContext) - } - field += e.field - - return field -} - -// SetContext updates the base context of the error. -func (e *errInvalidParam) SetContext(ctx string) { - e.context = ctx -} - -// AddNestedContext prepends a context to the field's path. -func (e *errInvalidParam) AddNestedContext(ctx string) { - if len(e.nestedContext) == 0 { - e.nestedContext = ctx - } else { - e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext) - } - -} - -// An ErrParamRequired represents an required parameter error. -type ErrParamRequired struct { - errInvalidParam -} - -// NewErrParamRequired creates a new required parameter error. -func NewErrParamRequired(field string) *ErrParamRequired { - return &ErrParamRequired{ - errInvalidParam{ - code: ParamRequiredErrCode, - field: field, - msg: fmt.Sprintf("missing required field"), - }, - } -} - -// An ErrParamMinValue represents a minimum value parameter error. -type ErrParamMinValue struct { - errInvalidParam - min float64 -} - -// NewErrParamMinValue creates a new minimum value parameter error. -func NewErrParamMinValue(field string, min float64) *ErrParamMinValue { - return &ErrParamMinValue{ - errInvalidParam: errInvalidParam{ - code: ParamMinValueErrCode, - field: field, - msg: fmt.Sprintf("minimum field value of %v", min), - }, - min: min, - } -} - -// MinValue returns the field's require minimum value. -// -// float64 is returned for both int and float min values. -func (e *ErrParamMinValue) MinValue() float64 { - return e.min -} - -// An ErrParamMinLen represents a minimum length parameter error. -type ErrParamMinLen struct { - errInvalidParam - min int -} - -// NewErrParamMinLen creates a new minimum length parameter error. -func NewErrParamMinLen(field string, min int) *ErrParamMinLen { - return &ErrParamMinLen{ - errInvalidParam: errInvalidParam{ - code: ParamMinLenErrCode, - field: field, - msg: fmt.Sprintf("minimum field size of %v", min), - }, - min: min, - } -} - -// MinLen returns the field's required minimum length. -func (e *ErrParamMinLen) MinLen() int { - return e.min -} - -// An ErrParamMaxLen represents a maximum length parameter error. -type ErrParamMaxLen struct { - errInvalidParam - max int -} - -// NewErrParamMaxLen creates a new maximum length parameter error. -func NewErrParamMaxLen(field string, max int, value string) *ErrParamMaxLen { - return &ErrParamMaxLen{ - errInvalidParam: errInvalidParam{ - code: ParamMaxLenErrCode, - field: field, - msg: fmt.Sprintf("maximum size of %v, %v", max, value), - }, - max: max, - } -} - -// MaxLen returns the field's required minimum length. -func (e *ErrParamMaxLen) MaxLen() int { - return e.max -} - -// An ErrParamFormat represents a invalid format parameter error. -type ErrParamFormat struct { - errInvalidParam - format string -} - -// NewErrParamFormat creates a new invalid format parameter error. -func NewErrParamFormat(field string, format, value string) *ErrParamFormat { - return &ErrParamFormat{ - errInvalidParam: errInvalidParam{ - code: ParamFormatErrCode, - field: field, - msg: fmt.Sprintf("format %v, %v", format, value), - }, - format: format, - } -} - -// Format returns the field's required format. -func (e *ErrParamFormat) Format() string { - return e.format -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go deleted file mode 100644 index 4601f883cc..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go +++ /dev/null @@ -1,295 +0,0 @@ -package request - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" -) - -// WaiterResourceNotReadyErrorCode is the error code returned by a waiter when -// the waiter's max attempts have been exhausted. -const WaiterResourceNotReadyErrorCode = "ResourceNotReady" - -// A WaiterOption is a function that will update the Waiter value's fields to -// configure the waiter. -type WaiterOption func(*Waiter) - -// WithWaiterMaxAttempts returns the maximum number of times the waiter should -// attempt to check the resource for the target state. -func WithWaiterMaxAttempts(max int) WaiterOption { - return func(w *Waiter) { - w.MaxAttempts = max - } -} - -// WaiterDelay will return a delay the waiter should pause between attempts to -// check the resource state. The passed in attempt is the number of times the -// Waiter has checked the resource state. -// -// Attempt is the number of attempts the Waiter has made checking the resource -// state. -type WaiterDelay func(attempt int) time.Duration - -// ConstantWaiterDelay returns a WaiterDelay that will always return a constant -// delay the waiter should use between attempts. It ignores the number of -// attempts made. -func ConstantWaiterDelay(delay time.Duration) WaiterDelay { - return func(attempt int) time.Duration { - return delay - } -} - -// WithWaiterDelay will set the Waiter to use the WaiterDelay passed in. -func WithWaiterDelay(delayer WaiterDelay) WaiterOption { - return func(w *Waiter) { - w.Delay = delayer - } -} - -// WithWaiterLogger returns a waiter option to set the logger a waiter -// should use to log warnings and errors to. -func WithWaiterLogger(logger aws.Logger) WaiterOption { - return func(w *Waiter) { - w.Logger = logger - } -} - -// WithWaiterRequestOptions returns a waiter option setting the request -// options for each request the waiter makes. Appends to waiter's request -// options already set. -func WithWaiterRequestOptions(opts ...Option) WaiterOption { - return func(w *Waiter) { - w.RequestOptions = append(w.RequestOptions, opts...) - } -} - -// A Waiter provides the functionality to perform a blocking call which will -// wait for a resource state to be satisfied by a service. -// -// This type should not be used directly. The API operations provided in the -// service packages prefixed with "WaitUntil" should be used instead. -type Waiter struct { - Name string - Acceptors []WaiterAcceptor - Logger aws.Logger - - MaxAttempts int - Delay WaiterDelay - - RequestOptions []Option - NewRequest func([]Option) (*Request, error) - SleepWithContext func(aws.Context, time.Duration) error -} - -// ApplyOptions updates the waiter with the list of waiter options provided. -func (w *Waiter) ApplyOptions(opts ...WaiterOption) { - for _, fn := range opts { - fn(w) - } -} - -// WaiterState are states the waiter uses based on WaiterAcceptor definitions -// to identify if the resource state the waiter is waiting on has occurred. -type WaiterState int - -// String returns the string representation of the waiter state. -func (s WaiterState) String() string { - switch s { - case SuccessWaiterState: - return "success" - case FailureWaiterState: - return "failure" - case RetryWaiterState: - return "retry" - default: - return "unknown waiter state" - } -} - -// States the waiter acceptors will use to identify target resource states. -const ( - SuccessWaiterState WaiterState = iota // waiter successful - FailureWaiterState // waiter failed - RetryWaiterState // waiter needs to be retried -) - -// WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor -// definition's Expected attribute. -type WaiterMatchMode int - -// Modes the waiter will use when inspecting API response to identify target -// resource states. -const ( - PathAllWaiterMatch WaiterMatchMode = iota // match on all paths - PathWaiterMatch // match on specific path - PathAnyWaiterMatch // match on any path - PathListWaiterMatch // match on list of paths - StatusWaiterMatch // match on status code - ErrorWaiterMatch // match on error -) - -// String returns the string representation of the waiter match mode. -func (m WaiterMatchMode) String() string { - switch m { - case PathAllWaiterMatch: - return "pathAll" - case PathWaiterMatch: - return "path" - case PathAnyWaiterMatch: - return "pathAny" - case PathListWaiterMatch: - return "pathList" - case StatusWaiterMatch: - return "status" - case ErrorWaiterMatch: - return "error" - default: - return "unknown waiter match mode" - } -} - -// WaitWithContext will make requests for the API operation using NewRequest to -// build API requests. The request's response will be compared against the -// Waiter's Acceptors to determine the successful state of the resource the -// waiter is inspecting. -// -// The passed in context must not be nil. If it is nil a panic will occur. The -// Context will be used to cancel the waiter's pending requests and retry delays. -// Use aws.BackgroundContext if no context is available. -// -// The waiter will continue until the target state defined by the Acceptors, -// or the max attempts expires. -// -// Will return the WaiterResourceNotReadyErrorCode error code if the waiter's -// retryer ShouldRetry returns false. This normally will happen when the max -// wait attempts expires. -func (w Waiter) WaitWithContext(ctx aws.Context) error { - - for attempt := 1; ; attempt++ { - req, err := w.NewRequest(w.RequestOptions) - if err != nil { - waiterLogf(w.Logger, "unable to create request %v", err) - return err - } - req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter")) - err = req.Send() - - // See if any of the acceptors match the request's response, or error - for _, a := range w.Acceptors { - if matched, matchErr := a.match(w.Name, w.Logger, req, err); matched { - return matchErr - } - } - - // The Waiter should only check the resource state MaxAttempts times - // This is here instead of in the for loop above to prevent delaying - // unnecessary when the waiter will not retry. - if attempt == w.MaxAttempts { - break - } - - // Delay to wait before inspecting the resource again - delay := w.Delay(attempt) - if sleepFn := req.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(delay) - } else { - sleepCtxFn := w.SleepWithContext - if sleepCtxFn == nil { - sleepCtxFn = aws.SleepWithContext - } - - if err := sleepCtxFn(ctx, delay); err != nil { - return awserr.New(CanceledErrorCode, "waiter context canceled", err) - } - } - } - - return awserr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil) -} - -// A WaiterAcceptor provides the information needed to wait for an API operation -// to complete. -type WaiterAcceptor struct { - State WaiterState - Matcher WaiterMatchMode - Argument string - Expected interface{} -} - -// match returns if the acceptor found a match with the passed in request -// or error. True is returned if the acceptor made a match, error is returned -// if there was an error attempting to perform the match. -func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err error) (bool, error) { - result := false - var vals []interface{} - - switch a.Matcher { - case PathAllWaiterMatch, PathWaiterMatch: - // Require all matches to be equal for result to match - vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) - if len(vals) == 0 { - break - } - result = true - for _, val := range vals { - if !awsutil.DeepEqual(val, a.Expected) { - result = false - break - } - } - case PathAnyWaiterMatch: - // Only a single match needs to equal for the result to match - vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) - for _, val := range vals { - if awsutil.DeepEqual(val, a.Expected) { - result = true - break - } - } - case PathListWaiterMatch: - // ignored matcher - case StatusWaiterMatch: - s := a.Expected.(int) - result = s == req.HTTPResponse.StatusCode - case ErrorWaiterMatch: - if aerr, ok := err.(awserr.Error); ok { - result = aerr.Code() == a.Expected.(string) - } - default: - waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s", - name, a.Matcher) - } - - if !result { - // If there was no matching result found there is nothing more to do - // for this response, retry the request. - return false, nil - } - - switch a.State { - case SuccessWaiterState: - // waiter completed - return true, nil - case FailureWaiterState: - // Waiter failure state triggered - return true, awserr.New(WaiterResourceNotReadyErrorCode, - "failed waiting for successful resource state", err) - case RetryWaiterState: - // clear the error and retry the operation - return false, nil - default: - waiterLogf(l, "WARNING: Waiter %s encountered unexpected state: %s", - name, a.State) - return false, nil - } -} - -func waiterLogf(logger aws.Logger, msg string, args ...interface{}) { - if logger != nil { - logger.Log(fmt.Sprintf(msg, args...)) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go deleted file mode 100644 index b0cef7575d..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go +++ /dev/null @@ -1,286 +0,0 @@ -package session - -import ( - "fmt" - "os" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/processcreds" - "github.com/aws/aws-sdk-go/aws/credentials/ssocreds" - "github.com/aws/aws-sdk-go/aws/credentials/stscreds" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -func resolveCredentials(cfg *aws.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) (*credentials.Credentials, error) { - - switch { - case len(sessOpts.Profile) != 0: - // User explicitly provided an Profile in the session's configuration - // so load that profile from shared config first. - // Github(aws/aws-sdk-go#2727) - return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) - - case envCfg.Creds.HasKeys(): - // Environment credentials - return credentials.NewStaticCredentialsFromCreds(envCfg.Creds), nil - - case len(envCfg.WebIdentityTokenFilePath) != 0: - // Web identity token from environment, RoleARN required to also be - // set. - return assumeWebIdentity(cfg, handlers, - envCfg.WebIdentityTokenFilePath, - envCfg.RoleARN, - envCfg.RoleSessionName, - ) - - default: - // Fallback to the "default" credential resolution chain. - return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) - } -} - -// WebIdentityEmptyRoleARNErr will occur if 'AWS_WEB_IDENTITY_TOKEN_FILE' was set but -// 'AWS_ROLE_ARN' was not set. -var WebIdentityEmptyRoleARNErr = awserr.New(stscreds.ErrCodeWebIdentity, "role ARN is not set", nil) - -// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_ROLE_ARN' was set but -// 'AWS_WEB_IDENTITY_TOKEN_FILE' was not set. -var WebIdentityEmptyTokenFilePathErr = awserr.New(stscreds.ErrCodeWebIdentity, "token file path is not set", nil) - -func assumeWebIdentity(cfg *aws.Config, handlers request.Handlers, - filepath string, - roleARN, sessionName string, -) (*credentials.Credentials, error) { - - if len(filepath) == 0 { - return nil, WebIdentityEmptyTokenFilePathErr - } - - if len(roleARN) == 0 { - return nil, WebIdentityEmptyRoleARNErr - } - - creds := stscreds.NewWebIdentityCredentials( - &Session{ - Config: cfg, - Handlers: handlers.Copy(), - }, - roleARN, - sessionName, - filepath, - ) - - return creds, nil -} - -func resolveCredsFromProfile(cfg *aws.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) (creds *credentials.Credentials, err error) { - - switch { - case sharedCfg.SourceProfile != nil: - // Assume IAM role with credentials source from a different profile. - creds, err = resolveCredsFromProfile(cfg, envCfg, - *sharedCfg.SourceProfile, handlers, sessOpts, - ) - - case sharedCfg.Creds.HasKeys(): - // Static Credentials from Shared Config/Credentials file. - creds = credentials.NewStaticCredentialsFromCreds( - sharedCfg.Creds, - ) - - case sharedCfg.hasSSOConfiguration(): - creds = resolveSSOCredentials(cfg, sharedCfg, handlers) - - case len(sharedCfg.CredentialProcess) != 0: - // Get credentials from CredentialProcess - creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) - - case len(sharedCfg.CredentialSource) != 0: - creds, err = resolveCredsFromSource(cfg, envCfg, - sharedCfg, handlers, sessOpts, - ) - - case len(sharedCfg.WebIdentityTokenFile) != 0: - // Credentials from Assume Web Identity token require an IAM Role, and - // that roll will be assumed. May be wrapped with another assume role - // via SourceProfile. - return assumeWebIdentity(cfg, handlers, - sharedCfg.WebIdentityTokenFile, - sharedCfg.RoleARN, - sharedCfg.RoleSessionName, - ) - - default: - // Fallback to default credentials provider, include mock errors for - // the credential chain so user can identify why credentials failed to - // be retrieved. - creds = credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: []credentials.Provider{ - &credProviderError{ - Err: awserr.New("EnvAccessKeyNotFound", - "failed to find credentials in the environment.", nil), - }, - &credProviderError{ - Err: awserr.New("SharedCredsLoad", - fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil), - }, - defaults.RemoteCredProvider(*cfg, handlers), - }, - }) - } - if err != nil { - return nil, err - } - - if len(sharedCfg.RoleARN) > 0 { - cfgCp := *cfg - cfgCp.Credentials = creds - return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) - } - - return creds, nil -} - -func resolveSSOCredentials(cfg *aws.Config, sharedCfg sharedConfig, handlers request.Handlers) *credentials.Credentials { - cfgCopy := cfg.Copy() - cfgCopy.Region = &sharedCfg.SSORegion - - return ssocreds.NewCredentials( - &Session{ - Config: cfgCopy, - Handlers: handlers.Copy(), - }, - sharedCfg.SSOAccountID, - sharedCfg.SSORoleName, - sharedCfg.SSOStartURL, - ) -} - -// valid credential source values -const ( - credSourceEc2Metadata = "Ec2InstanceMetadata" - credSourceEnvironment = "Environment" - credSourceECSContainer = "EcsContainer" -) - -func resolveCredsFromSource(cfg *aws.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) (creds *credentials.Credentials, err error) { - - switch sharedCfg.CredentialSource { - case credSourceEc2Metadata: - p := defaults.RemoteCredProvider(*cfg, handlers) - creds = credentials.NewCredentials(p) - - case credSourceEnvironment: - creds = credentials.NewStaticCredentialsFromCreds(envCfg.Creds) - - case credSourceECSContainer: - if len(os.Getenv(shareddefaults.ECSCredsProviderEnvVar)) == 0 { - return nil, ErrSharedConfigECSContainerEnvVarEmpty - } - - p := defaults.RemoteCredProvider(*cfg, handlers) - creds = credentials.NewCredentials(p) - - default: - return nil, ErrSharedConfigInvalidCredSource - } - - return creds, nil -} - -func credsFromAssumeRole(cfg aws.Config, - handlers request.Handlers, - sharedCfg sharedConfig, - sessOpts Options, -) (*credentials.Credentials, error) { - - if len(sharedCfg.MFASerial) != 0 && sessOpts.AssumeRoleTokenProvider == nil { - // AssumeRole Token provider is required if doing Assume Role - // with MFA. - return nil, AssumeRoleTokenProviderNotSetError{} - } - - return stscreds.NewCredentials( - &Session{ - Config: &cfg, - Handlers: handlers.Copy(), - }, - sharedCfg.RoleARN, - func(opt *stscreds.AssumeRoleProvider) { - opt.RoleSessionName = sharedCfg.RoleSessionName - - if sessOpts.AssumeRoleDuration == 0 && - sharedCfg.AssumeRoleDuration != nil && - *sharedCfg.AssumeRoleDuration/time.Minute > 15 { - opt.Duration = *sharedCfg.AssumeRoleDuration - } else if sessOpts.AssumeRoleDuration != 0 { - opt.Duration = sessOpts.AssumeRoleDuration - } - - // Assume role with external ID - if len(sharedCfg.ExternalID) > 0 { - opt.ExternalID = aws.String(sharedCfg.ExternalID) - } - - // Assume role with MFA - if len(sharedCfg.MFASerial) > 0 { - opt.SerialNumber = aws.String(sharedCfg.MFASerial) - opt.TokenProvider = sessOpts.AssumeRoleTokenProvider - } - }, - ), nil -} - -// AssumeRoleTokenProviderNotSetError is an error returned when creating a -// session when the MFAToken option is not set when shared config is configured -// load assume a role with an MFA token. -type AssumeRoleTokenProviderNotSetError struct{} - -// Code is the short id of the error. -func (e AssumeRoleTokenProviderNotSetError) Code() string { - return "AssumeRoleTokenProviderNotSetError" -} - -// Message is the description of the error -func (e AssumeRoleTokenProviderNotSetError) Message() string { - return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") -} - -// OrigErr is the underlying error that caused the failure. -func (e AssumeRoleTokenProviderNotSetError) OrigErr() error { - return nil -} - -// Error satisfies the error interface. -func (e AssumeRoleTokenProviderNotSetError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", nil) -} - -type credProviderError struct { - Err error -} - -func (c credProviderError) Retrieve() (credentials.Value, error) { - return credentials.Value{}, c.Err -} -func (c credProviderError) IsExpired() bool { - return true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go deleted file mode 100644 index 593aedc421..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go +++ /dev/null @@ -1,27 +0,0 @@ -// +build go1.13 - -package session - -import ( - "net" - "net/http" - "time" -) - -// Transport that should be used when a custom CA bundle is specified with the -// SDK. -func getCustomTransport() *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - ForceAttemptHTTP2: true, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.12.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.12.go deleted file mode 100644 index 1bf31cf8e5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.12.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build !go1.13,go1.7 - -package session - -import ( - "net" - "net/http" - "time" -) - -// Transport that should be used when a custom CA bundle is specified with the -// SDK. -func getCustomTransport() *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.5.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.5.go deleted file mode 100644 index 253d7bc9d5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.5.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build !go1.6,go1.5 - -package session - -import ( - "net" - "net/http" - "time" -) - -// Transport that should be used when a custom CA bundle is specified with the -// SDK. -func getCustomTransport() *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - TLSHandshakeTimeout: 10 * time.Second, - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.6.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.6.go deleted file mode 100644 index db24060544..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.6.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !go1.7,go1.6 - -package session - -import ( - "net" - "net/http" - "time" -) - -// Transport that should be used when a custom CA bundle is specified with the -// SDK. -func getCustomTransport() *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go deleted file mode 100644 index 9419b518d5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go +++ /dev/null @@ -1,289 +0,0 @@ -/* -Package session provides configuration for the SDK's service clients. Sessions -can be shared across service clients that share the same base configuration. - -Sessions are safe to use concurrently as long as the Session is not being -modified. Sessions should be cached when possible, because creating a new -Session will load all configuration values from the environment, and config -files each time the Session is created. Sharing the Session value across all of -your service clients will ensure the configuration is loaded the fewest number -of times possible. - -Sessions options from Shared Config - -By default NewSession will only load credentials from the shared credentials -file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is -set to a truthy value the Session will be created from the configuration -values from the shared config (~/.aws/config) and shared credentials -(~/.aws/credentials) files. Using the NewSessionWithOptions with -SharedConfigState set to SharedConfigEnable will create the session as if the -AWS_SDK_LOAD_CONFIG environment variable was set. - -Credential and config loading order - -The Session will attempt to load configuration and credentials from the -environment, configuration files, and other credential sources. The order -configuration is loaded in is: - - * Environment Variables - * Shared Credentials file - * Shared Configuration file (if SharedConfig is enabled) - * EC2 Instance Metadata (credentials only) - -The Environment variables for credentials will have precedence over shared -config even if SharedConfig is enabled. To override this behavior, and use -shared config credentials instead specify the session.Options.Profile, (e.g. -when using credential_source=Environment to assume a role). - - sess, err := session.NewSessionWithOptions(session.Options{ - Profile: "myProfile", - }) - -Creating Sessions - -Creating a Session without additional options will load credentials region, and -profile loaded from the environment and shared config automatically. See, -"Environment Variables" section for information on environment variables used -by Session. - - // Create Session - sess, err := session.NewSession() - - -When creating Sessions optional aws.Config values can be passed in that will -override the default, or loaded, config values the Session is being created -with. This allows you to provide additional, or case based, configuration -as needed. - - // Create a Session with a custom region - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("us-west-2"), - }) - -Use NewSessionWithOptions to provide additional configuration driving how the -Session's configuration will be loaded. Such as, specifying shared config -profile, or override the shared config state, (AWS_SDK_LOAD_CONFIG). - - // Equivalent to session.NewSession() - sess, err := session.NewSessionWithOptions(session.Options{ - // Options - }) - - sess, err := session.NewSessionWithOptions(session.Options{ - // Specify profile to load for the session's config - Profile: "profile_name", - - // Provide SDK Config options, such as Region. - Config: aws.Config{ - Region: aws.String("us-west-2"), - }, - - // Force enable Shared Config support - SharedConfigState: session.SharedConfigEnable, - }) - -Adding Handlers - -You can add handlers to a session to decorate API operation, (e.g. adding HTTP -headers). All clients that use the Session receive a copy of the Session's -handlers. For example, the following request handler added to the Session logs -every requests made. - - // Create a session, and add additional handlers for all service - // clients created with the Session to inherit. Adds logging handler. - sess := session.Must(session.NewSession()) - - sess.Handlers.Send.PushFront(func(r *request.Request) { - // Log every request made and its payload - logger.Printf("Request: %s/%s, Params: %s", - r.ClientInfo.ServiceName, r.Operation, r.Params) - }) - -Shared Config Fields - -By default the SDK will only load the shared credentials file's -(~/.aws/credentials) credentials values, and all other config is provided by -the environment variables, SDK defaults, and user provided aws.Config values. - -If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable -option is used to create the Session the full shared config values will be -loaded. This includes credentials, region, and support for assume role. In -addition the Session will load its configuration from both the shared config -file (~/.aws/config) and shared credentials file (~/.aws/credentials). Both -files have the same format. - -If both config files are present the configuration from both files will be -read. The Session will be created from configuration values from the shared -credentials file (~/.aws/credentials) over those in the shared config file -(~/.aws/config). - -Credentials are the values the SDK uses to authenticating requests with AWS -Services. When specified in a file, both aws_access_key_id and -aws_secret_access_key must be provided together in the same file to be -considered valid. They will be ignored if both are not present. -aws_session_token is an optional field that can be provided in addition to the -other two fields. - - aws_access_key_id = AKID - aws_secret_access_key = SECRET - aws_session_token = TOKEN - - ; region only supported if SharedConfigEnabled. - region = us-east-1 - -Assume Role configuration - -The role_arn field allows you to configure the SDK to assume an IAM role using -a set of credentials from another source. Such as when paired with static -credentials, "profile_source", "credential_process", or "credential_source" -fields. If "role_arn" is provided, a source of credentials must also be -specified, such as "source_profile", "credential_source", or -"credential_process". - - role_arn = arn:aws:iam:::role/ - source_profile = profile_with_creds - external_id = 1234 - mfa_serial = - role_session_name = session_name - - -The SDK supports assuming a role with MFA token. If "mfa_serial" is set, you -must also set the Session Option.AssumeRoleTokenProvider. The Session will fail -to load if the AssumeRoleTokenProvider is not specified. - - sess := session.Must(session.NewSessionWithOptions(session.Options{ - AssumeRoleTokenProvider: stscreds.StdinTokenProvider, - })) - -To setup Assume Role outside of a session see the stscreds.AssumeRoleProvider -documentation. - -Environment Variables - -When a Session is created several environment variables can be set to adjust -how the SDK functions, and what configuration data it loads when creating -Sessions. All environment values are optional, but some values like credentials -require multiple of the values to set or the partial values will be ignored. -All environment variable values are strings unless otherwise noted. - -Environment configuration values. If set both Access Key ID and Secret Access -Key must be provided. Session Token and optionally also be provided, but is -not required. - - # Access Key ID - AWS_ACCESS_KEY_ID=AKID - AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. - - # Secret Access Key - AWS_SECRET_ACCESS_KEY=SECRET - AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. - - # Session Token - AWS_SESSION_TOKEN=TOKEN - -Region value will instruct the SDK where to make service API requests to. If is -not provided in the environment the region must be provided before a service -client request is made. - - AWS_REGION=us-east-1 - - # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set, - # and AWS_REGION is not also set. - AWS_DEFAULT_REGION=us-east-1 - -Profile name the SDK should load use when loading shared config from the -configuration files. If not provided "default" will be used as the profile name. - - AWS_PROFILE=my_profile - - # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set, - # and AWS_PROFILE is not also set. - AWS_DEFAULT_PROFILE=my_profile - -SDK load config instructs the SDK to load the shared config in addition to -shared credentials. This also expands the configuration loaded so the shared -credentials will have parity with the shared config file. This also enables -Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE -env values as well. - - AWS_SDK_LOAD_CONFIG=1 - -Custom Shared Config and Credential Files - -Shared credentials file path can be set to instruct the SDK to use an alternative -file for the shared credentials. If not set the file will be loaded from -$HOME/.aws/credentials on Linux/Unix based systems, and -%USERPROFILE%\.aws\credentials on Windows. - - AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials - -Shared config file path can be set to instruct the SDK to use an alternative -file for the shared config. If not set the file will be loaded from -$HOME/.aws/config on Linux/Unix based systems, and -%USERPROFILE%\.aws\config on Windows. - - AWS_CONFIG_FILE=$HOME/my_shared_config - -Custom CA Bundle - -Path to a custom Credentials Authority (CA) bundle PEM file that the SDK -will use instead of the default system's root CA bundle. Use this only -if you want to replace the CA bundle the SDK uses for TLS requests. - - AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle - -Enabling this option will attempt to merge the Transport into the SDK's HTTP -client. If the client's Transport is not a http.Transport an error will be -returned. If the Transport's TLS config is set this option will cause the SDK -to overwrite the Transport's TLS config's RootCAs value. If the CA bundle file -contains multiple certificates all of them will be loaded. - -The Session option CustomCABundle is also available when creating sessions -to also enable this feature. CustomCABundle session option field has priority -over the AWS_CA_BUNDLE environment variable, and will be used if both are set. - -Setting a custom HTTPClient in the aws.Config options will override this setting. -To use this option and custom HTTP client, the HTTP client needs to be provided -when creating the session. Not the service client. - -Custom Client TLS Certificate - -The SDK supports the environment and session option being configured with -Client TLS certificates that are sent as a part of the client's TLS handshake -for client authentication. If used, both Cert and Key values are required. If -one is missing, or either fail to load the contents of the file an error will -be returned. - -HTTP Client's Transport concrete implementation must be a http.Transport -or creating the session will fail. - - AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key - AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert - -This can also be configured via the session.Options ClientTLSCert and ClientTLSKey. - - sess, err := session.NewSessionWithOptions(session.Options{ - ClientTLSCert: myCertFile, - ClientTLSKey: myKeyFile, - }) - -Custom EC2 IMDS Endpoint - -The endpoint of the EC2 IMDS client can be configured via the environment -variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a -Session. See Options.EC2IMDSEndpoint for more details. - - AWS_EC2_METADATA_SERVICE_ENDPOINT=http://169.254.169.254 - -If using an URL with an IPv6 address literal, the IPv6 address -component must be enclosed in square brackets. - - AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] - -The custom EC2 IMDS endpoint can also be specified via the Session options. - - sess, err := session.NewSessionWithOptions(session.Options{ - EC2IMDSEndpoint: "http://[::1]", - }) -*/ -package session diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go deleted file mode 100644 index 3cd5d4b5ae..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ /dev/null @@ -1,378 +0,0 @@ -package session - -import ( - "fmt" - "os" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/endpoints" -) - -// EnvProviderName provides a name of the provider when config is loaded from environment. -const EnvProviderName = "EnvConfigCredentials" - -// envConfig is a collection of environment values the SDK will read -// setup config from. All environment values are optional. But some values -// such as credentials require multiple values to be complete or the values -// will be ignored. -type envConfig struct { - // Environment configuration values. If set both Access Key ID and Secret Access - // Key must be provided. Session Token and optionally also be provided, but is - // not required. - // - // # Access Key ID - // AWS_ACCESS_KEY_ID=AKID - // AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. - // - // # Secret Access Key - // AWS_SECRET_ACCESS_KEY=SECRET - // AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. - // - // # Session Token - // AWS_SESSION_TOKEN=TOKEN - Creds credentials.Value - - // Region value will instruct the SDK where to make service API requests to. If is - // not provided in the environment the region must be provided before a service - // client request is made. - // - // AWS_REGION=us-east-1 - // - // # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set, - // # and AWS_REGION is not also set. - // AWS_DEFAULT_REGION=us-east-1 - Region string - - // Profile name the SDK should load use when loading shared configuration from the - // shared configuration files. If not provided "default" will be used as the - // profile name. - // - // AWS_PROFILE=my_profile - // - // # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set, - // # and AWS_PROFILE is not also set. - // AWS_DEFAULT_PROFILE=my_profile - Profile string - - // SDK load config instructs the SDK to load the shared config in addition to - // shared credentials. This also expands the configuration loaded from the shared - // credentials to have parity with the shared config file. This also enables - // Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE - // env values as well. - // - // AWS_SDK_LOAD_CONFIG=1 - EnableSharedConfig bool - - // Shared credentials file path can be set to instruct the SDK to use an alternate - // file for the shared credentials. If not set the file will be loaded from - // $HOME/.aws/credentials on Linux/Unix based systems, and - // %USERPROFILE%\.aws\credentials on Windows. - // - // AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials - SharedCredentialsFile string - - // Shared config file path can be set to instruct the SDK to use an alternate - // file for the shared config. If not set the file will be loaded from - // $HOME/.aws/config on Linux/Unix based systems, and - // %USERPROFILE%\.aws\config on Windows. - // - // AWS_CONFIG_FILE=$HOME/my_shared_config - SharedConfigFile string - - // Sets the path to a custom Credentials Authority (CA) Bundle PEM file - // that the SDK will use instead of the system's root CA bundle. - // Only use this if you want to configure the SDK to use a custom set - // of CAs. - // - // Enabling this option will attempt to merge the Transport - // into the SDK's HTTP client. If the client's Transport is - // not a http.Transport an error will be returned. If the - // Transport's TLS config is set this option will cause the - // SDK to overwrite the Transport's TLS config's RootCAs value. - // - // Setting a custom HTTPClient in the aws.Config options will override this setting. - // To use this option and custom HTTP client, the HTTP client needs to be provided - // when creating the session. Not the service client. - // - // AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle - CustomCABundle string - - // Sets the TLC client certificate that should be used by the SDK's HTTP transport - // when making requests. The certificate must be paired with a TLS client key file. - // - // AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert - ClientTLSCert string - - // Sets the TLC client key that should be used by the SDK's HTTP transport - // when making requests. The key must be paired with a TLS client certificate file. - // - // AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key - ClientTLSKey string - - csmEnabled string - CSMEnabled *bool - CSMPort string - CSMHost string - CSMClientID string - - // Enables endpoint discovery via environment variables. - // - // AWS_ENABLE_ENDPOINT_DISCOVERY=true - EnableEndpointDiscovery *bool - enableEndpointDiscovery string - - // Specifies the WebIdentity token the SDK should use to assume a role - // with. - // - // AWS_WEB_IDENTITY_TOKEN_FILE=file_path - WebIdentityTokenFilePath string - - // Specifies the IAM role arn to use when assuming an role. - // - // AWS_ROLE_ARN=role_arn - RoleARN string - - // Specifies the IAM role session name to use when assuming a role. - // - // AWS_ROLE_SESSION_NAME=session_name - RoleSessionName string - - // Specifies the STS Regional Endpoint flag for the SDK to resolve the endpoint - // for a service. - // - // AWS_STS_REGIONAL_ENDPOINTS=regional - // This can take value as `regional` or `legacy` - STSRegionalEndpoint endpoints.STSRegionalEndpoint - - // Specifies the S3 Regional Endpoint flag for the SDK to resolve the - // endpoint for a service. - // - // AWS_S3_US_EAST_1_REGIONAL_ENDPOINT=regional - // This can take value as `regional` or `legacy` - S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint - - // Specifies if the S3 service should allow ARNs to direct the region - // the client's requests are sent to. - // - // AWS_S3_USE_ARN_REGION=true - S3UseARNRegion bool - - // Specifies the alternative endpoint to use for EC2 IMDS. - // - // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] - EC2IMDSEndpoint string -} - -var ( - csmEnabledEnvKey = []string{ - "AWS_CSM_ENABLED", - } - csmHostEnvKey = []string{ - "AWS_CSM_HOST", - } - csmPortEnvKey = []string{ - "AWS_CSM_PORT", - } - csmClientIDEnvKey = []string{ - "AWS_CSM_CLIENT_ID", - } - credAccessEnvKey = []string{ - "AWS_ACCESS_KEY_ID", - "AWS_ACCESS_KEY", - } - credSecretEnvKey = []string{ - "AWS_SECRET_ACCESS_KEY", - "AWS_SECRET_KEY", - } - credSessionEnvKey = []string{ - "AWS_SESSION_TOKEN", - } - - enableEndpointDiscoveryEnvKey = []string{ - "AWS_ENABLE_ENDPOINT_DISCOVERY", - } - - regionEnvKeys = []string{ - "AWS_REGION", - "AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set - } - profileEnvKeys = []string{ - "AWS_PROFILE", - "AWS_DEFAULT_PROFILE", // Only read if AWS_SDK_LOAD_CONFIG is also set - } - sharedCredsFileEnvKey = []string{ - "AWS_SHARED_CREDENTIALS_FILE", - } - sharedConfigFileEnvKey = []string{ - "AWS_CONFIG_FILE", - } - webIdentityTokenFilePathEnvKey = []string{ - "AWS_WEB_IDENTITY_TOKEN_FILE", - } - roleARNEnvKey = []string{ - "AWS_ROLE_ARN", - } - roleSessionNameEnvKey = []string{ - "AWS_ROLE_SESSION_NAME", - } - stsRegionalEndpointKey = []string{ - "AWS_STS_REGIONAL_ENDPOINTS", - } - s3UsEast1RegionalEndpoint = []string{ - "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT", - } - s3UseARNRegionEnvKey = []string{ - "AWS_S3_USE_ARN_REGION", - } - ec2IMDSEndpointEnvKey = []string{ - "AWS_EC2_METADATA_SERVICE_ENDPOINT", - } - useCABundleKey = []string{ - "AWS_CA_BUNDLE", - } - useClientTLSCert = []string{ - "AWS_SDK_GO_CLIENT_TLS_CERT", - } - useClientTLSKey = []string{ - "AWS_SDK_GO_CLIENT_TLS_KEY", - } -) - -// loadEnvConfig retrieves the SDK's environment configuration. -// See `envConfig` for the values that will be retrieved. -// -// If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value -// the shared SDK config will be loaded in addition to the SDK's specific -// configuration values. -func loadEnvConfig() (envConfig, error) { - enableSharedConfig, _ := strconv.ParseBool(os.Getenv("AWS_SDK_LOAD_CONFIG")) - return envConfigLoad(enableSharedConfig) -} - -// loadEnvSharedConfig retrieves the SDK's environment configuration, and the -// SDK shared config. See `envConfig` for the values that will be retrieved. -// -// Loads the shared configuration in addition to the SDK's specific configuration. -// This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG` -// environment variable is set. -func loadSharedEnvConfig() (envConfig, error) { - return envConfigLoad(true) -} - -func envConfigLoad(enableSharedConfig bool) (envConfig, error) { - cfg := envConfig{} - - cfg.EnableSharedConfig = enableSharedConfig - - // Static environment credentials - var creds credentials.Value - setFromEnvVal(&creds.AccessKeyID, credAccessEnvKey) - setFromEnvVal(&creds.SecretAccessKey, credSecretEnvKey) - setFromEnvVal(&creds.SessionToken, credSessionEnvKey) - if creds.HasKeys() { - // Require logical grouping of credentials - creds.ProviderName = EnvProviderName - cfg.Creds = creds - } - - // Role Metadata - setFromEnvVal(&cfg.RoleARN, roleARNEnvKey) - setFromEnvVal(&cfg.RoleSessionName, roleSessionNameEnvKey) - - // Web identity environment variables - setFromEnvVal(&cfg.WebIdentityTokenFilePath, webIdentityTokenFilePathEnvKey) - - // CSM environment variables - setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey) - setFromEnvVal(&cfg.CSMHost, csmHostEnvKey) - setFromEnvVal(&cfg.CSMPort, csmPortEnvKey) - setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey) - - if len(cfg.csmEnabled) != 0 { - v, _ := strconv.ParseBool(cfg.csmEnabled) - cfg.CSMEnabled = &v - } - - regionKeys := regionEnvKeys - profileKeys := profileEnvKeys - if !cfg.EnableSharedConfig { - regionKeys = regionKeys[:1] - profileKeys = profileKeys[:1] - } - - setFromEnvVal(&cfg.Region, regionKeys) - setFromEnvVal(&cfg.Profile, profileKeys) - - // endpoint discovery is in reference to it being enabled. - setFromEnvVal(&cfg.enableEndpointDiscovery, enableEndpointDiscoveryEnvKey) - if len(cfg.enableEndpointDiscovery) > 0 { - cfg.EnableEndpointDiscovery = aws.Bool(cfg.enableEndpointDiscovery != "false") - } - - setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey) - setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey) - - if len(cfg.SharedCredentialsFile) == 0 { - cfg.SharedCredentialsFile = defaults.SharedCredentialsFilename() - } - if len(cfg.SharedConfigFile) == 0 { - cfg.SharedConfigFile = defaults.SharedConfigFilename() - } - - setFromEnvVal(&cfg.CustomCABundle, useCABundleKey) - setFromEnvVal(&cfg.ClientTLSCert, useClientTLSCert) - setFromEnvVal(&cfg.ClientTLSKey, useClientTLSKey) - - var err error - // STS Regional Endpoint variable - for _, k := range stsRegionalEndpointKey { - if v := os.Getenv(k); len(v) != 0 { - cfg.STSRegionalEndpoint, err = endpoints.GetSTSRegionalEndpoint(v) - if err != nil { - return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) - } - } - } - - // S3 Regional Endpoint variable - for _, k := range s3UsEast1RegionalEndpoint { - if v := os.Getenv(k); len(v) != 0 { - cfg.S3UsEast1RegionalEndpoint, err = endpoints.GetS3UsEast1RegionalEndpoint(v) - if err != nil { - return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) - } - } - } - - var s3UseARNRegion string - setFromEnvVal(&s3UseARNRegion, s3UseARNRegionEnvKey) - if len(s3UseARNRegion) != 0 { - switch { - case strings.EqualFold(s3UseARNRegion, "false"): - cfg.S3UseARNRegion = false - case strings.EqualFold(s3UseARNRegion, "true"): - cfg.S3UseARNRegion = true - default: - return envConfig{}, fmt.Errorf( - "invalid value for environment variable, %s=%s, need true or false", - s3UseARNRegionEnvKey[0], s3UseARNRegion) - } - } - - setFromEnvVal(&cfg.EC2IMDSEndpoint, ec2IMDSEndpointEnvKey) - - return cfg, nil -} - -func setFromEnvVal(dst *string, keys []string) { - for _, k := range keys { - if v := os.Getenv(k); len(v) != 0 { - *dst = v - break - } - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/session.go deleted file mode 100644 index 038ae222ff..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ /dev/null @@ -1,912 +0,0 @@ -package session - -import ( - "crypto/tls" - "crypto/x509" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/csm" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" -) - -const ( - // ErrCodeSharedConfig represents an error that occurs in the shared - // configuration logic - ErrCodeSharedConfig = "SharedConfigErr" - - // ErrCodeLoadCustomCABundle error code for unable to load custom CA bundle. - ErrCodeLoadCustomCABundle = "LoadCustomCABundleError" - - // ErrCodeLoadClientTLSCert error code for unable to load client TLS - // certificate or key - ErrCodeLoadClientTLSCert = "LoadClientTLSCertError" -) - -// ErrSharedConfigSourceCollision will be returned if a section contains both -// source_profile and credential_source -var ErrSharedConfigSourceCollision = awserr.New(ErrCodeSharedConfig, "only one credential type may be specified per profile: source profile, credential source, credential process, web identity token, or sso", nil) - -// ErrSharedConfigECSContainerEnvVarEmpty will be returned if the environment -// variables are empty and Environment was set as the credential source -var ErrSharedConfigECSContainerEnvVarEmpty = awserr.New(ErrCodeSharedConfig, "EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set", nil) - -// ErrSharedConfigInvalidCredSource will be returned if an invalid credential source was provided -var ErrSharedConfigInvalidCredSource = awserr.New(ErrCodeSharedConfig, "credential source values must be EcsContainer, Ec2InstanceMetadata, or Environment", nil) - -// A Session provides a central location to create service clients from and -// store configurations and request handlers for those services. -// -// Sessions are safe to create service clients concurrently, but it is not safe -// to mutate the Session concurrently. -// -// The Session satisfies the service client's client.ConfigProvider. -type Session struct { - Config *aws.Config - Handlers request.Handlers - - options Options -} - -// New creates a new instance of the handlers merging in the provided configs -// on top of the SDK's default configurations. Once the Session is created it -// can be mutated to modify the Config or Handlers. The Session is safe to be -// read concurrently, but it should not be written to concurrently. -// -// If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New -// method could now encounter an error when loading the configuration. When -// The environment variable is set, and an error occurs, New will return a -// session that will fail all requests reporting the error that occurred while -// loading the session. Use NewSession to get the error when creating the -// session. -// -// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value -// the shared config file (~/.aws/config) will also be loaded, in addition to -// the shared credentials file (~/.aws/credentials). Values set in both the -// shared config, and shared credentials will be taken from the shared -// credentials file. -// -// Deprecated: Use NewSession functions to create sessions instead. NewSession -// has the same functionality as New except an error can be returned when the -// func is called instead of waiting to receive an error until a request is made. -func New(cfgs ...*aws.Config) *Session { - // load initial config from environment - envCfg, envErr := loadEnvConfig() - - if envCfg.EnableSharedConfig { - var cfg aws.Config - cfg.MergeIn(cfgs...) - s, err := NewSessionWithOptions(Options{ - Config: cfg, - SharedConfigState: SharedConfigEnable, - }) - if err != nil { - // Old session.New expected all errors to be discovered when - // a request is made, and would report the errors then. This - // needs to be replicated if an error occurs while creating - // the session. - msg := "failed to create session with AWS_SDK_LOAD_CONFIG enabled. " + - "Use session.NewSession to handle errors occurring during session creation." - - // Session creation failed, need to report the error and prevent - // any requests from succeeding. - s = &Session{Config: defaults.Config()} - s.logDeprecatedNewSessionError(msg, err, cfgs) - } - - return s - } - - s := deprecatedNewSession(envCfg, cfgs...) - if envErr != nil { - msg := "failed to load env config" - s.logDeprecatedNewSessionError(msg, envErr, cfgs) - } - - if csmCfg, err := loadCSMConfig(envCfg, []string{}); err != nil { - if l := s.Config.Logger; l != nil { - l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) - } - } else if csmCfg.Enabled { - err := enableCSM(&s.Handlers, csmCfg, s.Config.Logger) - if err != nil { - msg := "failed to enable CSM" - s.logDeprecatedNewSessionError(msg, err, cfgs) - } - } - - return s -} - -// NewSession returns a new Session created from SDK defaults, config files, -// environment, and user provided config files. Once the Session is created -// it can be mutated to modify the Config or Handlers. The Session is safe to -// be read concurrently, but it should not be written to concurrently. -// -// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value -// the shared config file (~/.aws/config) will also be loaded in addition to -// the shared credentials file (~/.aws/credentials). Values set in both the -// shared config, and shared credentials will be taken from the shared -// credentials file. Enabling the Shared Config will also allow the Session -// to be built with retrieving credentials with AssumeRole set in the config. -// -// See the NewSessionWithOptions func for information on how to override or -// control through code how the Session will be created, such as specifying the -// config profile, and controlling if shared config is enabled or not. -func NewSession(cfgs ...*aws.Config) (*Session, error) { - opts := Options{} - opts.Config.MergeIn(cfgs...) - - return NewSessionWithOptions(opts) -} - -// SharedConfigState provides the ability to optionally override the state -// of the session's creation based on the shared config being enabled or -// disabled. -type SharedConfigState int - -const ( - // SharedConfigStateFromEnv does not override any state of the - // AWS_SDK_LOAD_CONFIG env var. It is the default value of the - // SharedConfigState type. - SharedConfigStateFromEnv SharedConfigState = iota - - // SharedConfigDisable overrides the AWS_SDK_LOAD_CONFIG env var value - // and disables the shared config functionality. - SharedConfigDisable - - // SharedConfigEnable overrides the AWS_SDK_LOAD_CONFIG env var value - // and enables the shared config functionality. - SharedConfigEnable -) - -// Options provides the means to control how a Session is created and what -// configuration values will be loaded. -// -type Options struct { - // Provides config values for the SDK to use when creating service clients - // and making API requests to services. Any value set in with this field - // will override the associated value provided by the SDK defaults, - // environment or config files where relevant. - // - // If not set, configuration values from from SDK defaults, environment, - // config will be used. - Config aws.Config - - // Overrides the config profile the Session should be created from. If not - // set the value of the environment variable will be loaded (AWS_PROFILE, - // or AWS_DEFAULT_PROFILE if the Shared Config is enabled). - // - // If not set and environment variables are not set the "default" - // (DefaultSharedConfigProfile) will be used as the profile to load the - // session config from. - Profile string - - // Instructs how the Session will be created based on the AWS_SDK_LOAD_CONFIG - // environment variable. By default a Session will be created using the - // value provided by the AWS_SDK_LOAD_CONFIG environment variable. - // - // Setting this value to SharedConfigEnable or SharedConfigDisable - // will allow you to override the AWS_SDK_LOAD_CONFIG environment variable - // and enable or disable the shared config functionality. - SharedConfigState SharedConfigState - - // Ordered list of files the session will load configuration from. - // It will override environment variable AWS_SHARED_CREDENTIALS_FILE, AWS_CONFIG_FILE. - SharedConfigFiles []string - - // When the SDK's shared config is configured to assume a role with MFA - // this option is required in order to provide the mechanism that will - // retrieve the MFA token. There is no default value for this field. If - // it is not set an error will be returned when creating the session. - // - // This token provider will be called when ever the assumed role's - // credentials need to be refreshed. Within the context of service clients - // all sharing the same session the SDK will ensure calls to the token - // provider are atomic. When sharing a token provider across multiple - // sessions additional synchronization logic is needed to ensure the - // token providers do not introduce race conditions. It is recommend to - // share the session where possible. - // - // stscreds.StdinTokenProvider is a basic implementation that will prompt - // from stdin for the MFA token code. - // - // This field is only used if the shared configuration is enabled, and - // the config enables assume role wit MFA via the mfa_serial field. - AssumeRoleTokenProvider func() (string, error) - - // When the SDK's shared config is configured to assume a role this option - // may be provided to set the expiry duration of the STS credentials. - // Defaults to 15 minutes if not set as documented in the - // stscreds.AssumeRoleProvider. - AssumeRoleDuration time.Duration - - // Reader for a custom Credentials Authority (CA) bundle in PEM format that - // the SDK will use instead of the default system's root CA bundle. Use this - // only if you want to replace the CA bundle the SDK uses for TLS requests. - // - // HTTP Client's Transport concrete implementation must be a http.Transport - // or creating the session will fail. - // - // If the Transport's TLS config is set this option will cause the SDK - // to overwrite the Transport's TLS config's RootCAs value. If the CA - // bundle reader contains multiple certificates all of them will be loaded. - // - // Can also be specified via the environment variable: - // - // AWS_CA_BUNDLE=$HOME/ca_bundle - // - // Can also be specified via the shared config field: - // - // ca_bundle = $HOME/ca_bundle - CustomCABundle io.Reader - - // Reader for the TLC client certificate that should be used by the SDK's - // HTTP transport when making requests. The certificate must be paired with - // a TLS client key file. Will be ignored if both are not provided. - // - // HTTP Client's Transport concrete implementation must be a http.Transport - // or creating the session will fail. - // - // Can also be specified via the environment variable: - // - // AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert - ClientTLSCert io.Reader - - // Reader for the TLC client key that should be used by the SDK's HTTP - // transport when making requests. The key must be paired with a TLS client - // certificate file. Will be ignored if both are not provided. - // - // HTTP Client's Transport concrete implementation must be a http.Transport - // or creating the session will fail. - // - // Can also be specified via the environment variable: - // - // AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key - ClientTLSKey io.Reader - - // The handlers that the session and all API clients will be created with. - // This must be a complete set of handlers. Use the defaults.Handlers() - // function to initialize this value before changing the handlers to be - // used by the SDK. - Handlers request.Handlers - - // Allows specifying a custom endpoint to be used by the EC2 IMDS client - // when making requests to the EC2 IMDS API. The must endpoint value must - // include protocol prefix. - // - // If unset, will the EC2 IMDS client will use its default endpoint. - // - // Can also be specified via the environment variable, - // AWS_EC2_METADATA_SERVICE_ENDPOINT. - // - // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://169.254.169.254 - // - // If using an URL with an IPv6 address literal, the IPv6 address - // component must be enclosed in square brackets. - // - // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] - EC2IMDSEndpoint string -} - -// NewSessionWithOptions returns a new Session created from SDK defaults, config files, -// environment, and user provided config files. This func uses the Options -// values to configure how the Session is created. -// -// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value -// the shared config file (~/.aws/config) will also be loaded in addition to -// the shared credentials file (~/.aws/credentials). Values set in both the -// shared config, and shared credentials will be taken from the shared -// credentials file. Enabling the Shared Config will also allow the Session -// to be built with retrieving credentials with AssumeRole set in the config. -// -// // Equivalent to session.New -// sess := session.Must(session.NewSessionWithOptions(session.Options{})) -// -// // Specify profile to load for the session's config -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// Profile: "profile_name", -// })) -// -// // Specify profile for config and region for requests -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// Config: aws.Config{Region: aws.String("us-east-1")}, -// Profile: "profile_name", -// })) -// -// // Force enable Shared Config support -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// SharedConfigState: session.SharedConfigEnable, -// })) -func NewSessionWithOptions(opts Options) (*Session, error) { - var envCfg envConfig - var err error - if opts.SharedConfigState == SharedConfigEnable { - envCfg, err = loadSharedEnvConfig() - if err != nil { - return nil, fmt.Errorf("failed to load shared config, %v", err) - } - } else { - envCfg, err = loadEnvConfig() - if err != nil { - return nil, fmt.Errorf("failed to load environment config, %v", err) - } - } - - if len(opts.Profile) != 0 { - envCfg.Profile = opts.Profile - } - - switch opts.SharedConfigState { - case SharedConfigDisable: - envCfg.EnableSharedConfig = false - case SharedConfigEnable: - envCfg.EnableSharedConfig = true - } - - return newSession(opts, envCfg, &opts.Config) -} - -// Must is a helper function to ensure the Session is valid and there was no -// error when calling a NewSession function. -// -// This helper is intended to be used in variable initialization to load the -// Session and configuration at startup. Such as: -// -// var sess = session.Must(session.NewSession()) -func Must(sess *Session, err error) *Session { - if err != nil { - panic(err) - } - - return sess -} - -// Wraps the endpoint resolver with a resolver that will return a custom -// endpoint for EC2 IMDS. -func wrapEC2IMDSEndpoint(resolver endpoints.Resolver, endpoint string) endpoints.Resolver { - return endpoints.ResolverFunc( - func(service, region string, opts ...func(*endpoints.Options)) ( - endpoints.ResolvedEndpoint, error, - ) { - if service == ec2MetadataServiceID { - return endpoints.ResolvedEndpoint{ - URL: endpoint, - SigningName: ec2MetadataServiceID, - SigningRegion: region, - }, nil - } - return resolver.EndpointFor(service, region) - }) -} - -func deprecatedNewSession(envCfg envConfig, cfgs ...*aws.Config) *Session { - cfg := defaults.Config() - handlers := defaults.Handlers() - - // Apply the passed in configs so the configuration can be applied to the - // default credential chain - cfg.MergeIn(cfgs...) - if cfg.EndpointResolver == nil { - // An endpoint resolver is required for a session to be able to provide - // endpoints for service client configurations. - cfg.EndpointResolver = endpoints.DefaultResolver() - } - - if len(envCfg.EC2IMDSEndpoint) != 0 { - cfg.EndpointResolver = wrapEC2IMDSEndpoint(cfg.EndpointResolver, envCfg.EC2IMDSEndpoint) - } - - cfg.Credentials = defaults.CredChain(cfg, handlers) - - // Reapply any passed in configs to override credentials if set - cfg.MergeIn(cfgs...) - - s := &Session{ - Config: cfg, - Handlers: handlers, - options: Options{ - EC2IMDSEndpoint: envCfg.EC2IMDSEndpoint, - }, - } - - initHandlers(s) - return s -} - -func enableCSM(handlers *request.Handlers, cfg csmConfig, logger aws.Logger) error { - if logger != nil { - logger.Log("Enabling CSM") - } - - r, err := csm.Start(cfg.ClientID, csm.AddressWithDefaults(cfg.Host, cfg.Port)) - if err != nil { - return err - } - r.InjectHandlers(handlers) - - return nil -} - -func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) { - cfg := defaults.Config() - - handlers := opts.Handlers - if handlers.IsEmpty() { - handlers = defaults.Handlers() - } - - // Get a merged version of the user provided config to determine if - // credentials were. - userCfg := &aws.Config{} - userCfg.MergeIn(cfgs...) - cfg.MergeIn(userCfg) - - // Ordered config files will be loaded in with later files overwriting - // previous config file values. - var cfgFiles []string - if opts.SharedConfigFiles != nil { - cfgFiles = opts.SharedConfigFiles - } else { - cfgFiles = []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile} - if !envCfg.EnableSharedConfig { - // The shared config file (~/.aws/config) is only loaded if instructed - // to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG). - cfgFiles = cfgFiles[1:] - } - } - - // Load additional config from file(s) - sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig) - if err != nil { - if len(envCfg.Profile) == 0 && !envCfg.EnableSharedConfig && (envCfg.Creds.HasKeys() || userCfg.Credentials != nil) { - // Special case where the user has not explicitly specified an AWS_PROFILE, - // or session.Options.profile, shared config is not enabled, and the - // environment has credentials, allow the shared config file to fail to - // load since the user has already provided credentials, and nothing else - // is required to be read file. Github(aws/aws-sdk-go#2455) - } else if _, ok := err.(SharedConfigProfileNotExistsError); !ok { - return nil, err - } - } - - if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil { - return nil, err - } - - if err := setTLSOptions(&opts, cfg, envCfg, sharedCfg); err != nil { - return nil, err - } - - s := &Session{ - Config: cfg, - Handlers: handlers, - options: opts, - } - - initHandlers(s) - - if csmCfg, err := loadCSMConfig(envCfg, cfgFiles); err != nil { - if l := s.Config.Logger; l != nil { - l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) - } - } else if csmCfg.Enabled { - err = enableCSM(&s.Handlers, csmCfg, s.Config.Logger) - if err != nil { - return nil, err - } - } - - return s, nil -} - -type csmConfig struct { - Enabled bool - Host string - Port string - ClientID string -} - -var csmProfileName = "aws_csm" - -func loadCSMConfig(envCfg envConfig, cfgFiles []string) (csmConfig, error) { - if envCfg.CSMEnabled != nil { - if *envCfg.CSMEnabled { - return csmConfig{ - Enabled: true, - ClientID: envCfg.CSMClientID, - Host: envCfg.CSMHost, - Port: envCfg.CSMPort, - }, nil - } - return csmConfig{}, nil - } - - sharedCfg, err := loadSharedConfig(csmProfileName, cfgFiles, false) - if err != nil { - if _, ok := err.(SharedConfigProfileNotExistsError); !ok { - return csmConfig{}, err - } - } - if sharedCfg.CSMEnabled != nil && *sharedCfg.CSMEnabled == true { - return csmConfig{ - Enabled: true, - ClientID: sharedCfg.CSMClientID, - Host: sharedCfg.CSMHost, - Port: sharedCfg.CSMPort, - }, nil - } - - return csmConfig{}, nil -} - -func setTLSOptions(opts *Options, cfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig) error { - // CA Bundle can be specified in both environment variable shared config file. - var caBundleFilename = envCfg.CustomCABundle - if len(caBundleFilename) == 0 { - caBundleFilename = sharedCfg.CustomCABundle - } - - // Only use environment value if session option is not provided. - customTLSOptions := map[string]struct { - filename string - field *io.Reader - errCode string - }{ - "custom CA bundle PEM": {filename: caBundleFilename, field: &opts.CustomCABundle, errCode: ErrCodeLoadCustomCABundle}, - "custom client TLS cert": {filename: envCfg.ClientTLSCert, field: &opts.ClientTLSCert, errCode: ErrCodeLoadClientTLSCert}, - "custom client TLS key": {filename: envCfg.ClientTLSKey, field: &opts.ClientTLSKey, errCode: ErrCodeLoadClientTLSCert}, - } - for name, v := range customTLSOptions { - if len(v.filename) != 0 && *v.field == nil { - f, err := os.Open(v.filename) - if err != nil { - return awserr.New(v.errCode, fmt.Sprintf("failed to open %s file", name), err) - } - defer f.Close() - *v.field = f - } - } - - // Setup HTTP client with custom cert bundle if enabled - if opts.CustomCABundle != nil { - if err := loadCustomCABundle(cfg.HTTPClient, opts.CustomCABundle); err != nil { - return err - } - } - - // Setup HTTP client TLS certificate and key for client TLS authentication. - if opts.ClientTLSCert != nil && opts.ClientTLSKey != nil { - if err := loadClientTLSCert(cfg.HTTPClient, opts.ClientTLSCert, opts.ClientTLSKey); err != nil { - return err - } - } else if opts.ClientTLSCert == nil && opts.ClientTLSKey == nil { - // Do nothing if neither values are available. - - } else { - return awserr.New(ErrCodeLoadClientTLSCert, - fmt.Sprintf("client TLS cert(%t) and key(%t) must both be provided", - opts.ClientTLSCert != nil, opts.ClientTLSKey != nil), nil) - } - - return nil -} - -func getHTTPTransport(client *http.Client) (*http.Transport, error) { - var t *http.Transport - switch v := client.Transport.(type) { - case *http.Transport: - t = v - default: - if client.Transport != nil { - return nil, fmt.Errorf("unsupported transport, %T", client.Transport) - } - } - if t == nil { - // Nil transport implies `http.DefaultTransport` should be used. Since - // the SDK cannot modify, nor copy the `DefaultTransport` specifying - // the values the next closest behavior. - t = getCustomTransport() - } - - return t, nil -} - -func loadCustomCABundle(client *http.Client, bundle io.Reader) error { - t, err := getHTTPTransport(client) - if err != nil { - return awserr.New(ErrCodeLoadCustomCABundle, - "unable to load custom CA bundle, HTTPClient's transport unsupported type", err) - } - - p, err := loadCertPool(bundle) - if err != nil { - return err - } - if t.TLSClientConfig == nil { - t.TLSClientConfig = &tls.Config{} - } - t.TLSClientConfig.RootCAs = p - - client.Transport = t - - return nil -} - -func loadCertPool(r io.Reader) (*x509.CertPool, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, awserr.New(ErrCodeLoadCustomCABundle, - "failed to read custom CA bundle PEM file", err) - } - - p := x509.NewCertPool() - if !p.AppendCertsFromPEM(b) { - return nil, awserr.New(ErrCodeLoadCustomCABundle, - "failed to load custom CA bundle PEM file", err) - } - - return p, nil -} - -func loadClientTLSCert(client *http.Client, certFile, keyFile io.Reader) error { - t, err := getHTTPTransport(client) - if err != nil { - return awserr.New(ErrCodeLoadClientTLSCert, - "unable to get usable HTTP transport from client", err) - } - - cert, err := ioutil.ReadAll(certFile) - if err != nil { - return awserr.New(ErrCodeLoadClientTLSCert, - "unable to get read client TLS cert file", err) - } - - key, err := ioutil.ReadAll(keyFile) - if err != nil { - return awserr.New(ErrCodeLoadClientTLSCert, - "unable to get read client TLS key file", err) - } - - clientCert, err := tls.X509KeyPair(cert, key) - if err != nil { - return awserr.New(ErrCodeLoadClientTLSCert, - "unable to load x509 key pair from client cert", err) - } - - tlsCfg := t.TLSClientConfig - if tlsCfg == nil { - tlsCfg = &tls.Config{} - } - - tlsCfg.Certificates = append(tlsCfg.Certificates, clientCert) - - t.TLSClientConfig = tlsCfg - client.Transport = t - - return nil -} - -func mergeConfigSrcs(cfg, userCfg *aws.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) error { - - // Region if not already set by user - if len(aws.StringValue(cfg.Region)) == 0 { - if len(envCfg.Region) > 0 { - cfg.WithRegion(envCfg.Region) - } else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 { - cfg.WithRegion(sharedCfg.Region) - } - } - - if cfg.EnableEndpointDiscovery == nil { - if envCfg.EnableEndpointDiscovery != nil { - cfg.WithEndpointDiscovery(*envCfg.EnableEndpointDiscovery) - } else if envCfg.EnableSharedConfig && sharedCfg.EnableEndpointDiscovery != nil { - cfg.WithEndpointDiscovery(*sharedCfg.EnableEndpointDiscovery) - } - } - - // Regional Endpoint flag for STS endpoint resolving - mergeSTSRegionalEndpointConfig(cfg, []endpoints.STSRegionalEndpoint{ - userCfg.STSRegionalEndpoint, - envCfg.STSRegionalEndpoint, - sharedCfg.STSRegionalEndpoint, - endpoints.LegacySTSEndpoint, - }) - - // Regional Endpoint flag for S3 endpoint resolving - mergeS3UsEast1RegionalEndpointConfig(cfg, []endpoints.S3UsEast1RegionalEndpoint{ - userCfg.S3UsEast1RegionalEndpoint, - envCfg.S3UsEast1RegionalEndpoint, - sharedCfg.S3UsEast1RegionalEndpoint, - endpoints.LegacyS3UsEast1Endpoint, - }) - - ec2IMDSEndpoint := sessOpts.EC2IMDSEndpoint - if len(ec2IMDSEndpoint) == 0 { - ec2IMDSEndpoint = envCfg.EC2IMDSEndpoint - } - if len(ec2IMDSEndpoint) != 0 { - cfg.EndpointResolver = wrapEC2IMDSEndpoint(cfg.EndpointResolver, ec2IMDSEndpoint) - } - - // Configure credentials if not already set by the user when creating the - // Session. - if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { - creds, err := resolveCredentials(cfg, envCfg, sharedCfg, handlers, sessOpts) - if err != nil { - return err - } - cfg.Credentials = creds - } - - cfg.S3UseARNRegion = userCfg.S3UseARNRegion - if cfg.S3UseARNRegion == nil { - cfg.S3UseARNRegion = &envCfg.S3UseARNRegion - } - if cfg.S3UseARNRegion == nil { - cfg.S3UseARNRegion = &sharedCfg.S3UseARNRegion - } - - return nil -} - -func mergeSTSRegionalEndpointConfig(cfg *aws.Config, values []endpoints.STSRegionalEndpoint) { - for _, v := range values { - if v != endpoints.UnsetSTSEndpoint { - cfg.STSRegionalEndpoint = v - break - } - } -} - -func mergeS3UsEast1RegionalEndpointConfig(cfg *aws.Config, values []endpoints.S3UsEast1RegionalEndpoint) { - for _, v := range values { - if v != endpoints.UnsetS3UsEast1Endpoint { - cfg.S3UsEast1RegionalEndpoint = v - break - } - } -} - -func initHandlers(s *Session) { - // Add the Validate parameter handler if it is not disabled. - s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) - if !aws.BoolValue(s.Config.DisableParamValidation) { - s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler) - } -} - -// Copy creates and returns a copy of the current Session, copying the config -// and handlers. If any additional configs are provided they will be merged -// on top of the Session's copied config. -// -// // Create a copy of the current Session, configured for the us-west-2 region. -// sess.Copy(&aws.Config{Region: aws.String("us-west-2")}) -func (s *Session) Copy(cfgs ...*aws.Config) *Session { - newSession := &Session{ - Config: s.Config.Copy(cfgs...), - Handlers: s.Handlers.Copy(), - options: s.options, - } - - initHandlers(newSession) - - return newSession -} - -// ClientConfig satisfies the client.ConfigProvider interface and is used to -// configure the service client instances. Passing the Session to the service -// client's constructor (New) will use this method to configure the client. -func (s *Session) ClientConfig(service string, cfgs ...*aws.Config) client.Config { - s = s.Copy(cfgs...) - - region := aws.StringValue(s.Config.Region) - resolved, err := s.resolveEndpoint(service, region, s.Config) - if err != nil { - s.Handlers.Validate.PushBack(func(r *request.Request) { - if len(r.ClientInfo.Endpoint) != 0 { - // Error occurred while resolving endpoint, but the request - // being invoked has had an endpoint specified after the client - // was created. - return - } - r.Error = err - }) - } - - return client.Config{ - Config: s.Config, - Handlers: s.Handlers, - PartitionID: resolved.PartitionID, - Endpoint: resolved.URL, - SigningRegion: resolved.SigningRegion, - SigningNameDerived: resolved.SigningNameDerived, - SigningName: resolved.SigningName, - } -} - -const ec2MetadataServiceID = "ec2metadata" - -func (s *Session) resolveEndpoint(service, region string, cfg *aws.Config) (endpoints.ResolvedEndpoint, error) { - - if ep := aws.StringValue(cfg.Endpoint); len(ep) != 0 { - return endpoints.ResolvedEndpoint{ - URL: endpoints.AddScheme(ep, aws.BoolValue(cfg.DisableSSL)), - SigningRegion: region, - }, nil - } - - resolved, err := cfg.EndpointResolver.EndpointFor(service, region, - func(opt *endpoints.Options) { - opt.DisableSSL = aws.BoolValue(cfg.DisableSSL) - opt.UseDualStack = aws.BoolValue(cfg.UseDualStack) - // Support for STSRegionalEndpoint where the STSRegionalEndpoint is - // provided in envConfig or sharedConfig with envConfig getting - // precedence. - opt.STSRegionalEndpoint = cfg.STSRegionalEndpoint - - // Support for S3UsEast1RegionalEndpoint where the S3UsEast1RegionalEndpoint is - // provided in envConfig or sharedConfig with envConfig getting - // precedence. - opt.S3UsEast1RegionalEndpoint = cfg.S3UsEast1RegionalEndpoint - - // Support the condition where the service is modeled but its - // endpoint metadata is not available. - opt.ResolveUnknownService = true - }, - ) - if err != nil { - return endpoints.ResolvedEndpoint{}, err - } - - return resolved, nil -} - -// ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception -// that the EndpointResolver will not be used to resolve the endpoint. The only -// endpoint set must come from the aws.Config.Endpoint field. -func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config { - s = s.Copy(cfgs...) - - var resolved endpoints.ResolvedEndpoint - if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 { - resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = aws.StringValue(s.Config.Region) - } - - return client.Config{ - Config: s.Config, - Handlers: s.Handlers, - Endpoint: resolved.URL, - SigningRegion: resolved.SigningRegion, - SigningNameDerived: resolved.SigningNameDerived, - SigningName: resolved.SigningName, - } -} - -// logDeprecatedNewSessionError function enables error handling for session -func (s *Session) logDeprecatedNewSessionError(msg string, err error, cfgs []*aws.Config) { - // Session creation failed, need to report the error and prevent - // any requests from succeeding. - s.Config.MergeIn(cfgs...) - s.Config.Logger.Log("ERROR:", msg, "Error:", err) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go deleted file mode 100644 index 5ab05d56cc..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go +++ /dev/null @@ -1,642 +0,0 @@ -package session - -import ( - "fmt" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/internal/ini" -) - -const ( - // Static Credentials group - accessKeyIDKey = `aws_access_key_id` // group required - secretAccessKey = `aws_secret_access_key` // group required - sessionTokenKey = `aws_session_token` // optional - - // Assume Role Credentials group - roleArnKey = `role_arn` // group required - sourceProfileKey = `source_profile` // group required (or credential_source) - credentialSourceKey = `credential_source` // group required (or source_profile) - externalIDKey = `external_id` // optional - mfaSerialKey = `mfa_serial` // optional - roleSessionNameKey = `role_session_name` // optional - roleDurationSecondsKey = "duration_seconds" // optional - - // AWS Single Sign-On (AWS SSO) group - ssoAccountIDKey = "sso_account_id" - ssoRegionKey = "sso_region" - ssoRoleNameKey = "sso_role_name" - ssoStartURL = "sso_start_url" - - // CSM options - csmEnabledKey = `csm_enabled` - csmHostKey = `csm_host` - csmPortKey = `csm_port` - csmClientIDKey = `csm_client_id` - - // Additional Config fields - regionKey = `region` - - // custom CA Bundle filename - customCABundleKey = `ca_bundle` - - // endpoint discovery group - enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional - - // External Credential Process - credentialProcessKey = `credential_process` // optional - - // Web Identity Token File - webIdentityTokenFileKey = `web_identity_token_file` // optional - - // Additional config fields for regional or legacy endpoints - stsRegionalEndpointSharedKey = `sts_regional_endpoints` - - // Additional config fields for regional or legacy endpoints - s3UsEast1RegionalSharedKey = `s3_us_east_1_regional_endpoint` - - // DefaultSharedConfigProfile is the default profile to be used when - // loading configuration from the config files if another profile name - // is not provided. - DefaultSharedConfigProfile = `default` - - // S3 ARN Region Usage - s3UseARNRegionKey = "s3_use_arn_region" -) - -// sharedConfig represents the configuration fields of the SDK config files. -type sharedConfig struct { - // Credentials values from the config file. Both aws_access_key_id and - // aws_secret_access_key must be provided together in the same file to be - // considered valid. The values will be ignored if not a complete group. - // aws_session_token is an optional field that can be provided if both of - // the other two fields are also provided. - // - // aws_access_key_id - // aws_secret_access_key - // aws_session_token - Creds credentials.Value - - CredentialSource string - CredentialProcess string - WebIdentityTokenFile string - - SSOAccountID string - SSORegion string - SSORoleName string - SSOStartURL string - - RoleARN string - RoleSessionName string - ExternalID string - MFASerial string - AssumeRoleDuration *time.Duration - - SourceProfileName string - SourceProfile *sharedConfig - - // Region is the region the SDK should use for looking up AWS service - // endpoints and signing requests. - // - // region - Region string - - // CustomCABundle is the file path to a PEM file the SDK will read and - // use to configure the HTTP transport with additional CA certs that are - // not present in the platforms default CA store. - // - // This value will be ignored if the file does not exist. - // - // ca_bundle - CustomCABundle string - - // EnableEndpointDiscovery can be enabled in the shared config by setting - // endpoint_discovery_enabled to true - // - // endpoint_discovery_enabled = true - EnableEndpointDiscovery *bool - - // CSM Options - CSMEnabled *bool - CSMHost string - CSMPort string - CSMClientID string - - // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service - // - // sts_regional_endpoints = regional - // This can take value as `LegacySTSEndpoint` or `RegionalSTSEndpoint` - STSRegionalEndpoint endpoints.STSRegionalEndpoint - - // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service - // - // s3_us_east_1_regional_endpoint = regional - // This can take value as `LegacyS3UsEast1Endpoint` or `RegionalS3UsEast1Endpoint` - S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint - - // Specifies if the S3 service should allow ARNs to direct the region - // the client's requests are sent to. - // - // s3_use_arn_region=true - S3UseARNRegion bool -} - -type sharedConfigFile struct { - Filename string - IniData ini.Sections -} - -// loadSharedConfig retrieves the configuration from the list of files using -// the profile provided. The order the files are listed will determine -// precedence. Values in subsequent files will overwrite values defined in -// earlier files. -// -// For example, given two files A and B. Both define credentials. If the order -// of the files are A then B, B's credential values will be used instead of -// A's. -// -// See sharedConfig.setFromFile for information how the config files -// will be loaded. -func loadSharedConfig(profile string, filenames []string, exOpts bool) (sharedConfig, error) { - if len(profile) == 0 { - profile = DefaultSharedConfigProfile - } - - files, err := loadSharedConfigIniFiles(filenames) - if err != nil { - return sharedConfig{}, err - } - - cfg := sharedConfig{} - profiles := map[string]struct{}{} - if err = cfg.setFromIniFiles(profiles, profile, files, exOpts); err != nil { - return sharedConfig{}, err - } - - return cfg, nil -} - -func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { - files := make([]sharedConfigFile, 0, len(filenames)) - - for _, filename := range filenames { - sections, err := ini.OpenFile(filename) - if aerr, ok := err.(awserr.Error); ok && aerr.Code() == ini.ErrCodeUnableToReadFile { - // Skip files which can't be opened and read for whatever reason - continue - } else if err != nil { - return nil, SharedConfigLoadError{Filename: filename, Err: err} - } - - files = append(files, sharedConfigFile{ - Filename: filename, IniData: sections, - }) - } - - return files, nil -} - -func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error { - // Trim files from the list that don't exist. - var skippedFiles int - var profileNotFoundErr error - for _, f := range files { - if err := cfg.setFromIniFile(profile, f, exOpts); err != nil { - if _, ok := err.(SharedConfigProfileNotExistsError); ok { - // Ignore profiles not defined in individual files. - profileNotFoundErr = err - skippedFiles++ - continue - } - return err - } - } - if skippedFiles == len(files) { - // If all files were skipped because the profile is not found, return - // the original profile not found error. - return profileNotFoundErr - } - - if _, ok := profiles[profile]; ok { - // if this is the second instance of the profile the Assume Role - // options must be cleared because they are only valid for the - // first reference of a profile. The self linked instance of the - // profile only have credential provider options. - cfg.clearAssumeRoleOptions() - } else { - // First time a profile has been seen, It must either be a assume role - // credentials, or SSO. Assert if the credential type requires a role ARN, - // the ARN is also set, or validate that the SSO configuration is complete. - if err := cfg.validateCredentialsConfig(profile); err != nil { - return err - } - } - profiles[profile] = struct{}{} - - if err := cfg.validateCredentialType(); err != nil { - return err - } - - // Link source profiles for assume roles - if len(cfg.SourceProfileName) != 0 { - // Linked profile via source_profile ignore credential provider - // options, the source profile must provide the credentials. - cfg.clearCredentialOptions() - - srcCfg := &sharedConfig{} - err := srcCfg.setFromIniFiles(profiles, cfg.SourceProfileName, files, exOpts) - if err != nil { - // SourceProfile that doesn't exist is an error in configuration. - if _, ok := err.(SharedConfigProfileNotExistsError); ok { - err = SharedConfigAssumeRoleError{ - RoleARN: cfg.RoleARN, - SourceProfile: cfg.SourceProfileName, - } - } - return err - } - - if !srcCfg.hasCredentials() { - return SharedConfigAssumeRoleError{ - RoleARN: cfg.RoleARN, - SourceProfile: cfg.SourceProfileName, - } - } - - cfg.SourceProfile = srcCfg - } - - return nil -} - -// setFromFile loads the configuration from the file using the profile -// provided. A sharedConfig pointer type value is used so that multiple config -// file loadings can be chained. -// -// Only loads complete logically grouped values, and will not set fields in cfg -// for incomplete grouped values in the config. Such as credentials. For -// example if a config file only includes aws_access_key_id but no -// aws_secret_access_key the aws_access_key_id will be ignored. -func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, exOpts bool) error { - section, ok := file.IniData.GetSection(profile) - if !ok { - // Fallback to to alternate profile name: profile - section, ok = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) - if !ok { - return SharedConfigProfileNotExistsError{Profile: profile, Err: nil} - } - } - - if exOpts { - // Assume Role Parameters - updateString(&cfg.RoleARN, section, roleArnKey) - updateString(&cfg.ExternalID, section, externalIDKey) - updateString(&cfg.MFASerial, section, mfaSerialKey) - updateString(&cfg.RoleSessionName, section, roleSessionNameKey) - updateString(&cfg.SourceProfileName, section, sourceProfileKey) - updateString(&cfg.CredentialSource, section, credentialSourceKey) - updateString(&cfg.Region, section, regionKey) - updateString(&cfg.CustomCABundle, section, customCABundleKey) - - if section.Has(roleDurationSecondsKey) { - d := time.Duration(section.Int(roleDurationSecondsKey)) * time.Second - cfg.AssumeRoleDuration = &d - } - - if v := section.String(stsRegionalEndpointSharedKey); len(v) != 0 { - sre, err := endpoints.GetSTSRegionalEndpoint(v) - if err != nil { - return fmt.Errorf("failed to load %s from shared config, %s, %v", - stsRegionalEndpointSharedKey, file.Filename, err) - } - cfg.STSRegionalEndpoint = sre - } - - if v := section.String(s3UsEast1RegionalSharedKey); len(v) != 0 { - sre, err := endpoints.GetS3UsEast1RegionalEndpoint(v) - if err != nil { - return fmt.Errorf("failed to load %s from shared config, %s, %v", - s3UsEast1RegionalSharedKey, file.Filename, err) - } - cfg.S3UsEast1RegionalEndpoint = sre - } - - // AWS Single Sign-On (AWS SSO) - updateString(&cfg.SSOAccountID, section, ssoAccountIDKey) - updateString(&cfg.SSORegion, section, ssoRegionKey) - updateString(&cfg.SSORoleName, section, ssoRoleNameKey) - updateString(&cfg.SSOStartURL, section, ssoStartURL) - } - - updateString(&cfg.CredentialProcess, section, credentialProcessKey) - updateString(&cfg.WebIdentityTokenFile, section, webIdentityTokenFileKey) - - // Shared Credentials - creds := credentials.Value{ - AccessKeyID: section.String(accessKeyIDKey), - SecretAccessKey: section.String(secretAccessKey), - SessionToken: section.String(sessionTokenKey), - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), - } - if creds.HasKeys() { - cfg.Creds = creds - } - - // Endpoint discovery - updateBoolPtr(&cfg.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) - - // CSM options - updateBoolPtr(&cfg.CSMEnabled, section, csmEnabledKey) - updateString(&cfg.CSMHost, section, csmHostKey) - updateString(&cfg.CSMPort, section, csmPortKey) - updateString(&cfg.CSMClientID, section, csmClientIDKey) - - updateBool(&cfg.S3UseARNRegion, section, s3UseARNRegionKey) - - return nil -} - -func (cfg *sharedConfig) validateCredentialsConfig(profile string) error { - if err := cfg.validateCredentialsRequireARN(profile); err != nil { - return err - } - - if err := cfg.validateSSOConfiguration(profile); err != nil { - return err - } - - return nil -} - -func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error { - var credSource string - - switch { - case len(cfg.SourceProfileName) != 0: - credSource = sourceProfileKey - case len(cfg.CredentialSource) != 0: - credSource = credentialSourceKey - case len(cfg.WebIdentityTokenFile) != 0: - credSource = webIdentityTokenFileKey - } - - if len(credSource) != 0 && len(cfg.RoleARN) == 0 { - return CredentialRequiresARNError{ - Type: credSource, - Profile: profile, - } - } - - return nil -} - -func (cfg *sharedConfig) validateCredentialType() error { - // Only one or no credential type can be defined. - if !oneOrNone( - len(cfg.SourceProfileName) != 0, - len(cfg.CredentialSource) != 0, - len(cfg.CredentialProcess) != 0, - len(cfg.WebIdentityTokenFile) != 0, - cfg.hasSSOConfiguration(), - ) { - return ErrSharedConfigSourceCollision - } - - return nil -} - -func (cfg *sharedConfig) validateSSOConfiguration(profile string) error { - if !cfg.hasSSOConfiguration() { - return nil - } - - var missing []string - if len(cfg.SSOAccountID) == 0 { - missing = append(missing, ssoAccountIDKey) - } - - if len(cfg.SSORegion) == 0 { - missing = append(missing, ssoRegionKey) - } - - if len(cfg.SSORoleName) == 0 { - missing = append(missing, ssoRoleNameKey) - } - - if len(cfg.SSOStartURL) == 0 { - missing = append(missing, ssoStartURL) - } - - if len(missing) > 0 { - return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", - profile, strings.Join(missing, ", ")) - } - - return nil -} - -func (cfg *sharedConfig) hasCredentials() bool { - switch { - case len(cfg.SourceProfileName) != 0: - case len(cfg.CredentialSource) != 0: - case len(cfg.CredentialProcess) != 0: - case len(cfg.WebIdentityTokenFile) != 0: - case cfg.hasSSOConfiguration(): - case cfg.Creds.HasKeys(): - default: - return false - } - - return true -} - -func (cfg *sharedConfig) clearCredentialOptions() { - cfg.CredentialSource = "" - cfg.CredentialProcess = "" - cfg.WebIdentityTokenFile = "" - cfg.Creds = credentials.Value{} -} - -func (cfg *sharedConfig) clearAssumeRoleOptions() { - cfg.RoleARN = "" - cfg.ExternalID = "" - cfg.MFASerial = "" - cfg.RoleSessionName = "" - cfg.SourceProfileName = "" -} - -func (cfg *sharedConfig) hasSSOConfiguration() bool { - switch { - case len(cfg.SSOAccountID) != 0: - case len(cfg.SSORegion) != 0: - case len(cfg.SSORoleName) != 0: - case len(cfg.SSOStartURL) != 0: - default: - return false - } - return true -} - -func oneOrNone(bs ...bool) bool { - var count int - - for _, b := range bs { - if b { - count++ - if count > 1 { - return false - } - } - } - - return true -} - -// updateString will only update the dst with the value in the section key, key -// is present in the section. -func updateString(dst *string, section ini.Section, key string) { - if !section.Has(key) { - return - } - *dst = section.String(key) -} - -// updateBool will only update the dst with the value in the section key, key -// is present in the section. -func updateBool(dst *bool, section ini.Section, key string) { - if !section.Has(key) { - return - } - *dst = section.Bool(key) -} - -// updateBoolPtr will only update the dst with the value in the section key, -// key is present in the section. -func updateBoolPtr(dst **bool, section ini.Section, key string) { - if !section.Has(key) { - return - } - *dst = new(bool) - **dst = section.Bool(key) -} - -// SharedConfigLoadError is an error for the shared config file failed to load. -type SharedConfigLoadError struct { - Filename string - Err error -} - -// Code is the short id of the error. -func (e SharedConfigLoadError) Code() string { - return "SharedConfigLoadError" -} - -// Message is the description of the error -func (e SharedConfigLoadError) Message() string { - return fmt.Sprintf("failed to load config file, %s", e.Filename) -} - -// OrigErr is the underlying error that caused the failure. -func (e SharedConfigLoadError) OrigErr() error { - return e.Err -} - -// Error satisfies the error interface. -func (e SharedConfigLoadError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", e.Err) -} - -// SharedConfigProfileNotExistsError is an error for the shared config when -// the profile was not find in the config file. -type SharedConfigProfileNotExistsError struct { - Profile string - Err error -} - -// Code is the short id of the error. -func (e SharedConfigProfileNotExistsError) Code() string { - return "SharedConfigProfileNotExistsError" -} - -// Message is the description of the error -func (e SharedConfigProfileNotExistsError) Message() string { - return fmt.Sprintf("failed to get profile, %s", e.Profile) -} - -// OrigErr is the underlying error that caused the failure. -func (e SharedConfigProfileNotExistsError) OrigErr() error { - return e.Err -} - -// Error satisfies the error interface. -func (e SharedConfigProfileNotExistsError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", e.Err) -} - -// SharedConfigAssumeRoleError is an error for the shared config when the -// profile contains assume role information, but that information is invalid -// or not complete. -type SharedConfigAssumeRoleError struct { - RoleARN string - SourceProfile string -} - -// Code is the short id of the error. -func (e SharedConfigAssumeRoleError) Code() string { - return "SharedConfigAssumeRoleError" -} - -// Message is the description of the error -func (e SharedConfigAssumeRoleError) Message() string { - return fmt.Sprintf( - "failed to load assume role for %s, source profile %s has no shared credentials", - e.RoleARN, e.SourceProfile, - ) -} - -// OrigErr is the underlying error that caused the failure. -func (e SharedConfigAssumeRoleError) OrigErr() error { - return nil -} - -// Error satisfies the error interface. -func (e SharedConfigAssumeRoleError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", nil) -} - -// CredentialRequiresARNError provides the error for shared config credentials -// that are incorrectly configured in the shared config or credentials file. -type CredentialRequiresARNError struct { - // type of credentials that were configured. - Type string - - // Profile name the credentials were in. - Profile string -} - -// Code is the short id of the error. -func (e CredentialRequiresARNError) Code() string { - return "CredentialRequiresARNError" -} - -// Message is the description of the error -func (e CredentialRequiresARNError) Message() string { - return fmt.Sprintf( - "credential type %s requires role_arn, profile %s", - e.Type, e.Profile, - ) -} - -// OrigErr is the underlying error that caused the failure. -func (e CredentialRequiresARNError) OrigErr() error { - return nil -} - -// Error satisfies the error interface. -func (e CredentialRequiresARNError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", nil) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go deleted file mode 100644 index 07ea799fbd..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go +++ /dev/null @@ -1,81 +0,0 @@ -package v4 - -import ( - "github.com/aws/aws-sdk-go/internal/strings" -) - -// validator houses a set of rule needed for validation of a -// string value -type rules []rule - -// rule interface allows for more flexible rules and just simply -// checks whether or not a value adheres to that rule -type rule interface { - IsValid(value string) bool -} - -// IsValid will iterate through all rules and see if any rules -// apply to the value and supports nested rules -func (r rules) IsValid(value string) bool { - for _, rule := range r { - if rule.IsValid(value) { - return true - } - } - return false -} - -// mapRule generic rule for maps -type mapRule map[string]struct{} - -// IsValid for the map rule satisfies whether it exists in the map -func (m mapRule) IsValid(value string) bool { - _, ok := m[value] - return ok -} - -// whitelist is a generic rule for whitelisting -type whitelist struct { - rule -} - -// IsValid for whitelist checks if the value is within the whitelist -func (w whitelist) IsValid(value string) bool { - return w.rule.IsValid(value) -} - -// blacklist is a generic rule for blacklisting -type blacklist struct { - rule -} - -// IsValid for whitelist checks if the value is within the whitelist -func (b blacklist) IsValid(value string) bool { - return !b.rule.IsValid(value) -} - -type patterns []string - -// IsValid for patterns checks each pattern and returns if a match has -// been found -func (p patterns) IsValid(value string) bool { - for _, pattern := range p { - if strings.HasPrefixFold(value, pattern) { - return true - } - } - return false -} - -// inclusiveRules rules allow for rules to depend on one another -type inclusiveRules []rule - -// IsValid will return true if all rules are true -func (r inclusiveRules) IsValid(value string) bool { - for _, rule := range r { - if !rule.IsValid(value) { - return false - } - } - return true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go deleted file mode 100644 index 6aa2ed241b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go +++ /dev/null @@ -1,7 +0,0 @@ -package v4 - -// WithUnsignedPayload will enable and set the UnsignedPayload field to -// true of the signer. -func WithUnsignedPayload(v4 *Signer) { - v4.UnsignedPayload = true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go deleted file mode 100644 index f35fc860b3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !go1.7 - -package v4 - -import ( - "net/http" - - "github.com/aws/aws-sdk-go/aws" -) - -func requestContext(r *http.Request) aws.Context { - return aws.BackgroundContext() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go deleted file mode 100644 index fed5c859ca..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build go1.7 - -package v4 - -import ( - "net/http" - - "github.com/aws/aws-sdk-go/aws" -) - -func requestContext(r *http.Request) aws.Context { - return r.Context() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/stream.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/stream.go deleted file mode 100644 index 02cbd97e23..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/stream.go +++ /dev/null @@ -1,63 +0,0 @@ -package v4 - -import ( - "encoding/hex" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws/credentials" -) - -type credentialValueProvider interface { - Get() (credentials.Value, error) -} - -// StreamSigner implements signing of event stream encoded payloads -type StreamSigner struct { - region string - service string - - credentials credentialValueProvider - - prevSig []byte -} - -// NewStreamSigner creates a SigV4 signer used to sign Event Stream encoded messages -func NewStreamSigner(region, service string, seedSignature []byte, credentials *credentials.Credentials) *StreamSigner { - return &StreamSigner{ - region: region, - service: service, - credentials: credentials, - prevSig: seedSignature, - } -} - -// GetSignature takes an event stream encoded headers and payload and returns a signature -func (s *StreamSigner) GetSignature(headers, payload []byte, date time.Time) ([]byte, error) { - credValue, err := s.credentials.Get() - if err != nil { - return nil, err - } - - sigKey := deriveSigningKey(s.region, s.service, credValue.SecretAccessKey, date) - - keyPath := buildSigningScope(s.region, s.service, date) - - stringToSign := buildEventStreamStringToSign(headers, payload, s.prevSig, keyPath, date) - - signature := hmacSHA256(sigKey, []byte(stringToSign)) - s.prevSig = signature - - return signature, nil -} - -func buildEventStreamStringToSign(headers, payload, prevSig []byte, scope string, date time.Time) string { - return strings.Join([]string{ - "AWS4-HMAC-SHA256-PAYLOAD", - formatTime(date), - scope, - hex.EncodeToString(prevSig), - hex.EncodeToString(hashSHA256(headers)), - hex.EncodeToString(hashSHA256(payload)), - }, "\n") -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go deleted file mode 100644 index bd082e9d1f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build go1.5 - -package v4 - -import ( - "net/url" - "strings" -) - -func getURIPath(u *url.URL) string { - var uri string - - if len(u.Opaque) > 0 { - uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") - } else { - uri = u.EscapedPath() - } - - if len(uri) == 0 { - uri = "/" - } - - return uri -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go deleted file mode 100644 index d71f7b3f4f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ /dev/null @@ -1,846 +0,0 @@ -// Package v4 implements signing for AWS V4 signer -// -// Provides request signing for request that need to be signed with -// AWS V4 Signatures. -// -// Standalone Signer -// -// Generally using the signer outside of the SDK should not require any additional -// logic when using Go v1.5 or higher. The signer does this by taking advantage -// of the URL.EscapedPath method. If your request URI requires additional escaping -// you many need to use the URL.Opaque to define what the raw URI should be sent -// to the service as. -// -// The signer will first check the URL.Opaque field, and use its value if set. -// The signer does require the URL.Opaque field to be set in the form of: -// -// "///" -// -// // e.g. -// "//example.com/some/path" -// -// The leading "//" and hostname are required or the URL.Opaque escaping will -// not work correctly. -// -// If URL.Opaque is not set the signer will fallback to the URL.EscapedPath() -// method and using the returned value. If you're using Go v1.4 you must set -// URL.Opaque if the URI path needs escaping. If URL.Opaque is not set with -// Go v1.5 the signer will fallback to URL.Path. -// -// AWS v4 signature validation requires that the canonical string's URI path -// element must be the URI escaped form of the HTTP request's path. -// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html -// -// The Go HTTP client will perform escaping automatically on the request. Some -// of these escaping may cause signature validation errors because the HTTP -// request differs from the URI path or query that the signature was generated. -// https://golang.org/pkg/net/url/#URL.EscapedPath -// -// Because of this, it is recommended that when using the signer outside of the -// SDK that explicitly escaping the request prior to being signed is preferable, -// and will help prevent signature validation errors. This can be done by setting -// the URL.Opaque or URL.RawPath. The SDK will use URL.Opaque first and then -// call URL.EscapedPath() if Opaque is not set. -// -// If signing a request intended for HTTP2 server, and you're using Go 1.6.2 -// through 1.7.4 you should use the URL.RawPath as the pre-escaped form of the -// request URL. https://github.com/golang/go/issues/16847 points to a bug in -// Go pre 1.8 that fails to make HTTP2 requests using absolute URL in the HTTP -// message. URL.Opaque generally will force Go to make requests with absolute URL. -// URL.RawPath does not do this, but RawPath must be a valid escaping of Path -// or url.EscapedPath will ignore the RawPath escaping. -// -// Test `TestStandaloneSign` provides a complete example of using the signer -// outside of the SDK and pre-escaping the URI path. -package v4 - -import ( - "crypto/hmac" - "crypto/sha256" - "encoding/hex" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "sort" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkio" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -const ( - authorizationHeader = "Authorization" - authHeaderSignatureElem = "Signature=" - signatureQueryKey = "X-Amz-Signature" - - authHeaderPrefix = "AWS4-HMAC-SHA256" - timeFormat = "20060102T150405Z" - shortTimeFormat = "20060102" - awsV4Request = "aws4_request" - - // emptyStringSHA256 is a SHA256 of an empty string - emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` -) - -var ignoredHeaders = rules{ - blacklist{ - mapRule{ - authorizationHeader: struct{}{}, - "User-Agent": struct{}{}, - "X-Amzn-Trace-Id": struct{}{}, - }, - }, -} - -// requiredSignedHeaders is a whitelist for build canonical headers. -var requiredSignedHeaders = rules{ - whitelist{ - mapRule{ - "Cache-Control": struct{}{}, - "Content-Disposition": struct{}{}, - "Content-Encoding": struct{}{}, - "Content-Language": struct{}{}, - "Content-Md5": struct{}{}, - "Content-Type": struct{}{}, - "Expires": struct{}{}, - "If-Match": struct{}{}, - "If-Modified-Since": struct{}{}, - "If-None-Match": struct{}{}, - "If-Unmodified-Since": struct{}{}, - "Range": struct{}{}, - "X-Amz-Acl": struct{}{}, - "X-Amz-Copy-Source": struct{}{}, - "X-Amz-Copy-Source-If-Match": struct{}{}, - "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, - "X-Amz-Copy-Source-If-None-Match": struct{}{}, - "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, - "X-Amz-Copy-Source-Range": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Grant-Full-control": struct{}{}, - "X-Amz-Grant-Read": struct{}{}, - "X-Amz-Grant-Read-Acp": struct{}{}, - "X-Amz-Grant-Write": struct{}{}, - "X-Amz-Grant-Write-Acp": struct{}{}, - "X-Amz-Metadata-Directive": struct{}{}, - "X-Amz-Mfa": struct{}{}, - "X-Amz-Request-Payer": struct{}{}, - "X-Amz-Server-Side-Encryption": struct{}{}, - "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Storage-Class": struct{}{}, - "X-Amz-Tagging": struct{}{}, - "X-Amz-Website-Redirect-Location": struct{}{}, - "X-Amz-Content-Sha256": struct{}{}, - }, - }, - patterns{"X-Amz-Meta-"}, -} - -// allowedHoisting is a whitelist for build query headers. The boolean value -// represents whether or not it is a pattern. -var allowedQueryHoisting = inclusiveRules{ - blacklist{requiredSignedHeaders}, - patterns{"X-Amz-"}, -} - -// Signer applies AWS v4 signing to given request. Use this to sign requests -// that need to be signed with AWS V4 Signatures. -type Signer struct { - // The authentication credentials the request will be signed against. - // This value must be set to sign requests. - Credentials *credentials.Credentials - - // Sets the log level the signer should use when reporting information to - // the logger. If the logger is nil nothing will be logged. See - // aws.LogLevelType for more information on available logging levels - // - // By default nothing will be logged. - Debug aws.LogLevelType - - // The logger loging information will be written to. If there the logger - // is nil, nothing will be logged. - Logger aws.Logger - - // Disables the Signer's moving HTTP header key/value pairs from the HTTP - // request header to the request's query string. This is most commonly used - // with pre-signed requests preventing headers from being added to the - // request's query string. - DisableHeaderHoisting bool - - // Disables the automatic escaping of the URI path of the request for the - // siganture's canonical string's path. For services that do not need additional - // escaping then use this to disable the signer escaping the path. - // - // S3 is an example of a service that does not need additional escaping. - // - // http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html - DisableURIPathEscaping bool - - // Disables the automatical setting of the HTTP request's Body field with the - // io.ReadSeeker passed in to the signer. This is useful if you're using a - // custom wrapper around the body for the io.ReadSeeker and want to preserve - // the Body value on the Request.Body. - // - // This does run the risk of signing a request with a body that will not be - // sent in the request. Need to ensure that the underlying data of the Body - // values are the same. - DisableRequestBodyOverwrite bool - - // currentTimeFn returns the time value which represents the current time. - // This value should only be used for testing. If it is nil the default - // time.Now will be used. - currentTimeFn func() time.Time - - // UnsignedPayload will prevent signing of the payload. This will only - // work for services that have support for this. - UnsignedPayload bool -} - -// NewSigner returns a Signer pointer configured with the credentials and optional -// option values provided. If not options are provided the Signer will use its -// default configuration. -func NewSigner(credentials *credentials.Credentials, options ...func(*Signer)) *Signer { - v4 := &Signer{ - Credentials: credentials, - } - - for _, option := range options { - option(v4) - } - - return v4 -} - -type signingCtx struct { - ServiceName string - Region string - Request *http.Request - Body io.ReadSeeker - Query url.Values - Time time.Time - ExpireTime time.Duration - SignedHeaderVals http.Header - - DisableURIPathEscaping bool - - credValues credentials.Value - isPresign bool - unsignedPayload bool - - bodyDigest string - signedHeaders string - canonicalHeaders string - canonicalString string - credentialString string - stringToSign string - signature string - authorization string -} - -// Sign signs AWS v4 requests with the provided body, service name, region the -// request is made to, and time the request is signed at. The signTime allows -// you to specify that a request is signed for the future, and cannot be -// used until then. -// -// Returns a list of HTTP headers that were included in the signature or an -// error if signing the request failed. Generally for signed requests this value -// is not needed as the full request context will be captured by the http.Request -// value. It is included for reference though. -// -// Sign will set the request's Body to be the `body` parameter passed in. If -// the body is not already an io.ReadCloser, it will be wrapped within one. If -// a `nil` body parameter passed to Sign, the request's Body field will be -// also set to nil. Its important to note that this functionality will not -// change the request's ContentLength of the request. -// -// Sign differs from Presign in that it will sign the request using HTTP -// header values. This type of signing is intended for http.Request values that -// will not be shared, or are shared in a way the header values on the request -// will not be lost. -// -// The requests body is an io.ReadSeeker so the SHA256 of the body can be -// generated. To bypass the signer computing the hash you can set the -// "X-Amz-Content-Sha256" header with a precomputed value. The signer will -// only compute the hash if the request header value is empty. -func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) { - return v4.signWithBody(r, body, service, region, 0, false, signTime) -} - -// Presign signs AWS v4 requests with the provided body, service name, region -// the request is made to, and time the request is signed at. The signTime -// allows you to specify that a request is signed for the future, and cannot -// be used until then. -// -// Returns a list of HTTP headers that were included in the signature or an -// error if signing the request failed. For presigned requests these headers -// and their values must be included on the HTTP request when it is made. This -// is helpful to know what header values need to be shared with the party the -// presigned request will be distributed to. -// -// Presign differs from Sign in that it will sign the request using query string -// instead of header values. This allows you to share the Presigned Request's -// URL with third parties, or distribute it throughout your system with minimal -// dependencies. -// -// Presign also takes an exp value which is the duration the -// signed request will be valid after the signing time. This is allows you to -// set when the request will expire. -// -// The requests body is an io.ReadSeeker so the SHA256 of the body can be -// generated. To bypass the signer computing the hash you can set the -// "X-Amz-Content-Sha256" header with a precomputed value. The signer will -// only compute the hash if the request header value is empty. -// -// Presigning a S3 request will not compute the body's SHA256 hash by default. -// This is done due to the general use case for S3 presigned URLs is to share -// PUT/GET capabilities. If you would like to include the body's SHA256 in the -// presigned request's signature you can set the "X-Amz-Content-Sha256" -// HTTP header and that will be included in the request's signature. -func (v4 Signer) Presign(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { - return v4.signWithBody(r, body, service, region, exp, true, signTime) -} - -func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, isPresign bool, signTime time.Time) (http.Header, error) { - currentTimeFn := v4.currentTimeFn - if currentTimeFn == nil { - currentTimeFn = time.Now - } - - ctx := &signingCtx{ - Request: r, - Body: body, - Query: r.URL.Query(), - Time: signTime, - ExpireTime: exp, - isPresign: isPresign, - ServiceName: service, - Region: region, - DisableURIPathEscaping: v4.DisableURIPathEscaping, - unsignedPayload: v4.UnsignedPayload, - } - - for key := range ctx.Query { - sort.Strings(ctx.Query[key]) - } - - if ctx.isRequestSigned() { - ctx.Time = currentTimeFn() - ctx.handlePresignRemoval() - } - - var err error - ctx.credValues, err = v4.Credentials.GetWithContext(requestContext(r)) - if err != nil { - return http.Header{}, err - } - - ctx.sanitizeHostForHeader() - ctx.assignAmzQueryValues() - if err := ctx.build(v4.DisableHeaderHoisting); err != nil { - return nil, err - } - - // If the request is not presigned the body should be attached to it. This - // prevents the confusion of wanting to send a signed request without - // the body the request was signed for attached. - if !(v4.DisableRequestBodyOverwrite || ctx.isPresign) { - var reader io.ReadCloser - if body != nil { - var ok bool - if reader, ok = body.(io.ReadCloser); !ok { - reader = ioutil.NopCloser(body) - } - } - r.Body = reader - } - - if v4.Debug.Matches(aws.LogDebugWithSigning) { - v4.logSigningInfo(ctx) - } - - return ctx.SignedHeaderVals, nil -} - -func (ctx *signingCtx) sanitizeHostForHeader() { - request.SanitizeHostForHeader(ctx.Request) -} - -func (ctx *signingCtx) handlePresignRemoval() { - if !ctx.isPresign { - return - } - - // The credentials have expired for this request. The current signing - // is invalid, and needs to be request because the request will fail. - ctx.removePresign() - - // Update the request's query string to ensure the values stays in - // sync in the case retrieving the new credentials fails. - ctx.Request.URL.RawQuery = ctx.Query.Encode() -} - -func (ctx *signingCtx) assignAmzQueryValues() { - if ctx.isPresign { - ctx.Query.Set("X-Amz-Algorithm", authHeaderPrefix) - if ctx.credValues.SessionToken != "" { - ctx.Query.Set("X-Amz-Security-Token", ctx.credValues.SessionToken) - } else { - ctx.Query.Del("X-Amz-Security-Token") - } - - return - } - - if ctx.credValues.SessionToken != "" { - ctx.Request.Header.Set("X-Amz-Security-Token", ctx.credValues.SessionToken) - } -} - -// SignRequestHandler is a named request handler the SDK will use to sign -// service client request with using the V4 signature. -var SignRequestHandler = request.NamedHandler{ - Name: "v4.SignRequestHandler", Fn: SignSDKRequest, -} - -// SignSDKRequest signs an AWS request with the V4 signature. This -// request handler should only be used with the SDK's built in service client's -// API operation requests. -// -// This function should not be used on its on its own, but in conjunction with -// an AWS service client's API operation call. To sign a standalone request -// not created by a service client's API operation method use the "Sign" or -// "Presign" functions of the "Signer" type. -// -// If the credentials of the request's config are set to -// credentials.AnonymousCredentials the request will not be signed. -func SignSDKRequest(req *request.Request) { - SignSDKRequestWithCurrentTime(req, time.Now) -} - -// BuildNamedHandler will build a generic handler for signing. -func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler { - return request.NamedHandler{ - Name: name, - Fn: func(req *request.Request) { - SignSDKRequestWithCurrentTime(req, time.Now, opts...) - }, - } -} - -// SignSDKRequestWithCurrentTime will sign the SDK's request using the time -// function passed in. Behaves the same as SignSDKRequest with the exception -// the request is signed with the value returned by the current time function. -func SignSDKRequestWithCurrentTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) { - // If the request does not need to be signed ignore the signing of the - // request if the AnonymousCredentials object is used. - if req.Config.Credentials == credentials.AnonymousCredentials { - return - } - - region := req.ClientInfo.SigningRegion - if region == "" { - region = aws.StringValue(req.Config.Region) - } - - name := req.ClientInfo.SigningName - if name == "" { - name = req.ClientInfo.ServiceName - } - - v4 := NewSigner(req.Config.Credentials, func(v4 *Signer) { - v4.Debug = req.Config.LogLevel.Value() - v4.Logger = req.Config.Logger - v4.DisableHeaderHoisting = req.NotHoist - v4.currentTimeFn = curTimeFn - if name == "s3" { - // S3 service should not have any escaping applied - v4.DisableURIPathEscaping = true - } - // Prevents setting the HTTPRequest's Body. Since the Body could be - // wrapped in a custom io.Closer that we do not want to be stompped - // on top of by the signer. - v4.DisableRequestBodyOverwrite = true - }) - - for _, opt := range opts { - opt(v4) - } - - curTime := curTimeFn() - signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(), - name, region, req.ExpireTime, req.ExpireTime > 0, curTime, - ) - if err != nil { - req.Error = err - req.SignedHeaderVals = nil - return - } - - req.SignedHeaderVals = signedHeaders - req.LastSignedAt = curTime -} - -const logSignInfoMsg = `DEBUG: Request Signature: ----[ CANONICAL STRING ]----------------------------- -%s ----[ STRING TO SIGN ]-------------------------------- -%s%s ------------------------------------------------------` -const logSignedURLMsg = ` ----[ SIGNED URL ]------------------------------------ -%s` - -func (v4 *Signer) logSigningInfo(ctx *signingCtx) { - signedURLMsg := "" - if ctx.isPresign { - signedURLMsg = fmt.Sprintf(logSignedURLMsg, ctx.Request.URL.String()) - } - msg := fmt.Sprintf(logSignInfoMsg, ctx.canonicalString, ctx.stringToSign, signedURLMsg) - v4.Logger.Log(msg) -} - -func (ctx *signingCtx) build(disableHeaderHoisting bool) error { - ctx.buildTime() // no depends - ctx.buildCredentialString() // no depends - - if err := ctx.buildBodyDigest(); err != nil { - return err - } - - unsignedHeaders := ctx.Request.Header - if ctx.isPresign { - if !disableHeaderHoisting { - urlValues := url.Values{} - urlValues, unsignedHeaders = buildQuery(allowedQueryHoisting, unsignedHeaders) // no depends - for k := range urlValues { - ctx.Query[k] = urlValues[k] - } - } - } - - ctx.buildCanonicalHeaders(ignoredHeaders, unsignedHeaders) - ctx.buildCanonicalString() // depends on canon headers / signed headers - ctx.buildStringToSign() // depends on canon string - ctx.buildSignature() // depends on string to sign - - if ctx.isPresign { - ctx.Request.URL.RawQuery += "&" + signatureQueryKey + "=" + ctx.signature - } else { - parts := []string{ - authHeaderPrefix + " Credential=" + ctx.credValues.AccessKeyID + "/" + ctx.credentialString, - "SignedHeaders=" + ctx.signedHeaders, - authHeaderSignatureElem + ctx.signature, - } - ctx.Request.Header.Set(authorizationHeader, strings.Join(parts, ", ")) - } - - return nil -} - -// GetSignedRequestSignature attempts to extract the signature of the request. -// Returning an error if the request is unsigned, or unable to extract the -// signature. -func GetSignedRequestSignature(r *http.Request) ([]byte, error) { - - if auth := r.Header.Get(authorizationHeader); len(auth) != 0 { - ps := strings.Split(auth, ", ") - for _, p := range ps { - if idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 { - sig := p[len(authHeaderSignatureElem):] - if len(sig) == 0 { - return nil, fmt.Errorf("invalid request signature authorization header") - } - return hex.DecodeString(sig) - } - } - } - - if sig := r.URL.Query().Get("X-Amz-Signature"); len(sig) != 0 { - return hex.DecodeString(sig) - } - - return nil, fmt.Errorf("request not signed") -} - -func (ctx *signingCtx) buildTime() { - if ctx.isPresign { - duration := int64(ctx.ExpireTime / time.Second) - ctx.Query.Set("X-Amz-Date", formatTime(ctx.Time)) - ctx.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10)) - } else { - ctx.Request.Header.Set("X-Amz-Date", formatTime(ctx.Time)) - } -} - -func (ctx *signingCtx) buildCredentialString() { - ctx.credentialString = buildSigningScope(ctx.Region, ctx.ServiceName, ctx.Time) - - if ctx.isPresign { - ctx.Query.Set("X-Amz-Credential", ctx.credValues.AccessKeyID+"/"+ctx.credentialString) - } -} - -func buildQuery(r rule, header http.Header) (url.Values, http.Header) { - query := url.Values{} - unsignedHeaders := http.Header{} - for k, h := range header { - if r.IsValid(k) { - query[k] = h - } else { - unsignedHeaders[k] = h - } - } - - return query, unsignedHeaders -} -func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) { - var headers []string - headers = append(headers, "host") - for k, v := range header { - if !r.IsValid(k) { - continue // ignored header - } - if ctx.SignedHeaderVals == nil { - ctx.SignedHeaderVals = make(http.Header) - } - - lowerCaseKey := strings.ToLower(k) - if _, ok := ctx.SignedHeaderVals[lowerCaseKey]; ok { - // include additional values - ctx.SignedHeaderVals[lowerCaseKey] = append(ctx.SignedHeaderVals[lowerCaseKey], v...) - continue - } - - headers = append(headers, lowerCaseKey) - ctx.SignedHeaderVals[lowerCaseKey] = v - } - sort.Strings(headers) - - ctx.signedHeaders = strings.Join(headers, ";") - - if ctx.isPresign { - ctx.Query.Set("X-Amz-SignedHeaders", ctx.signedHeaders) - } - - headerValues := make([]string, len(headers)) - for i, k := range headers { - if k == "host" { - if ctx.Request.Host != "" { - headerValues[i] = "host:" + ctx.Request.Host - } else { - headerValues[i] = "host:" + ctx.Request.URL.Host - } - } else { - headerValues[i] = k + ":" + - strings.Join(ctx.SignedHeaderVals[k], ",") - } - } - stripExcessSpaces(headerValues) - ctx.canonicalHeaders = strings.Join(headerValues, "\n") -} - -func (ctx *signingCtx) buildCanonicalString() { - ctx.Request.URL.RawQuery = strings.Replace(ctx.Query.Encode(), "+", "%20", -1) - - uri := getURIPath(ctx.Request.URL) - - if !ctx.DisableURIPathEscaping { - uri = rest.EscapePath(uri, false) - } - - ctx.canonicalString = strings.Join([]string{ - ctx.Request.Method, - uri, - ctx.Request.URL.RawQuery, - ctx.canonicalHeaders + "\n", - ctx.signedHeaders, - ctx.bodyDigest, - }, "\n") -} - -func (ctx *signingCtx) buildStringToSign() { - ctx.stringToSign = strings.Join([]string{ - authHeaderPrefix, - formatTime(ctx.Time), - ctx.credentialString, - hex.EncodeToString(hashSHA256([]byte(ctx.canonicalString))), - }, "\n") -} - -func (ctx *signingCtx) buildSignature() { - creds := deriveSigningKey(ctx.Region, ctx.ServiceName, ctx.credValues.SecretAccessKey, ctx.Time) - signature := hmacSHA256(creds, []byte(ctx.stringToSign)) - ctx.signature = hex.EncodeToString(signature) -} - -func (ctx *signingCtx) buildBodyDigest() error { - hash := ctx.Request.Header.Get("X-Amz-Content-Sha256") - if hash == "" { - includeSHA256Header := ctx.unsignedPayload || - ctx.ServiceName == "s3" || - ctx.ServiceName == "glacier" - - s3Presign := ctx.isPresign && ctx.ServiceName == "s3" - - if ctx.unsignedPayload || s3Presign { - hash = "UNSIGNED-PAYLOAD" - includeSHA256Header = !s3Presign - } else if ctx.Body == nil { - hash = emptyStringSHA256 - } else { - if !aws.IsReaderSeekable(ctx.Body) { - return fmt.Errorf("cannot use unseekable request body %T, for signed request with body", ctx.Body) - } - hashBytes, err := makeSha256Reader(ctx.Body) - if err != nil { - return err - } - hash = hex.EncodeToString(hashBytes) - } - - if includeSHA256Header { - ctx.Request.Header.Set("X-Amz-Content-Sha256", hash) - } - } - ctx.bodyDigest = hash - - return nil -} - -// isRequestSigned returns if the request is currently signed or presigned -func (ctx *signingCtx) isRequestSigned() bool { - if ctx.isPresign && ctx.Query.Get("X-Amz-Signature") != "" { - return true - } - if ctx.Request.Header.Get("Authorization") != "" { - return true - } - - return false -} - -// unsign removes signing flags for both signed and presigned requests. -func (ctx *signingCtx) removePresign() { - ctx.Query.Del("X-Amz-Algorithm") - ctx.Query.Del("X-Amz-Signature") - ctx.Query.Del("X-Amz-Security-Token") - ctx.Query.Del("X-Amz-Date") - ctx.Query.Del("X-Amz-Expires") - ctx.Query.Del("X-Amz-Credential") - ctx.Query.Del("X-Amz-SignedHeaders") -} - -func hmacSHA256(key []byte, data []byte) []byte { - hash := hmac.New(sha256.New, key) - hash.Write(data) - return hash.Sum(nil) -} - -func hashSHA256(data []byte) []byte { - hash := sha256.New() - hash.Write(data) - return hash.Sum(nil) -} - -func makeSha256Reader(reader io.ReadSeeker) (hashBytes []byte, err error) { - hash := sha256.New() - start, err := reader.Seek(0, sdkio.SeekCurrent) - if err != nil { - return nil, err - } - defer func() { - // ensure error is return if unable to seek back to start of payload. - _, err = reader.Seek(start, sdkio.SeekStart) - }() - - // Use CopyN to avoid allocating the 32KB buffer in io.Copy for bodies - // smaller than 32KB. Fall back to io.Copy if we fail to determine the size. - size, err := aws.SeekerLen(reader) - if err != nil { - io.Copy(hash, reader) - } else { - io.CopyN(hash, reader, size) - } - - return hash.Sum(nil), nil -} - -const doubleSpace = " " - -// stripExcessSpaces will rewrite the passed in slice's string values to not -// contain multiple side-by-side spaces. -func stripExcessSpaces(vals []string) { - var j, k, l, m, spaces int - for i, str := range vals { - // Trim trailing spaces - for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- { - } - - // Trim leading spaces - for k = 0; k < j && str[k] == ' '; k++ { - } - str = str[k : j+1] - - // Strip multiple spaces. - j = strings.Index(str, doubleSpace) - if j < 0 { - vals[i] = str - continue - } - - buf := []byte(str) - for k, m, l = j, j, len(buf); k < l; k++ { - if buf[k] == ' ' { - if spaces == 0 { - // First space. - buf[m] = buf[k] - m++ - } - spaces++ - } else { - // End of multiple spaces. - spaces = 0 - buf[m] = buf[k] - m++ - } - } - - vals[i] = string(buf[:m]) - } -} - -func buildSigningScope(region, service string, dt time.Time) string { - return strings.Join([]string{ - formatShortTime(dt), - region, - service, - awsV4Request, - }, "/") -} - -func deriveSigningKey(region, service, secretKey string, dt time.Time) []byte { - kDate := hmacSHA256([]byte("AWS4"+secretKey), []byte(formatShortTime(dt))) - kRegion := hmacSHA256(kDate, []byte(region)) - kService := hmacSHA256(kRegion, []byte(service)) - signingKey := hmacSHA256(kService, []byte(awsV4Request)) - return signingKey -} - -func formatShortTime(dt time.Time) string { - return dt.UTC().Format(shortTimeFormat) -} - -func formatTime(dt time.Time) string { - return dt.UTC().Format(timeFormat) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/types.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/types.go deleted file mode 100644 index 98751ee84f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/types.go +++ /dev/null @@ -1,264 +0,0 @@ -package aws - -import ( - "io" - "strings" - "sync" - - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Allows the -// SDK to accept an io.Reader that is not also an io.Seeker for unsigned -// streaming payload API operations. -// -// A ReadSeekCloser wrapping an nonseekable io.Reader used in an API -// operation's input will prevent that operation being retried in the case of -// network errors, and cause operation requests to fail if the operation -// requires payload signing. -// -// Note: If using With S3 PutObject to stream an object upload The SDK's S3 -// Upload manager (s3manager.Uploader) provides support for streaming with the -// ability to retry network errors. -func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { - return ReaderSeekerCloser{r} -} - -// ReaderSeekerCloser represents a reader that can also delegate io.Seeker and -// io.Closer interfaces to the underlying object if they are available. -type ReaderSeekerCloser struct { - r io.Reader -} - -// IsReaderSeekable returns if the underlying reader type can be seeked. A -// io.Reader might not actually be seekable if it is the ReaderSeekerCloser -// type. -func IsReaderSeekable(r io.Reader) bool { - switch v := r.(type) { - case ReaderSeekerCloser: - return v.IsSeeker() - case *ReaderSeekerCloser: - return v.IsSeeker() - case io.ReadSeeker: - return true - default: - return false - } -} - -// Read reads from the reader up to size of p. The number of bytes read, and -// error if it occurred will be returned. -// -// If the reader is not an io.Reader zero bytes read, and nil error will be -// returned. -// -// Performs the same functionality as io.Reader Read -func (r ReaderSeekerCloser) Read(p []byte) (int, error) { - switch t := r.r.(type) { - case io.Reader: - return t.Read(p) - } - return 0, nil -} - -// Seek sets the offset for the next Read to offset, interpreted according to -// whence: 0 means relative to the origin of the file, 1 means relative to the -// current offset, and 2 means relative to the end. Seek returns the new offset -// and an error, if any. -// -// If the ReaderSeekerCloser is not an io.Seeker nothing will be done. -func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) { - switch t := r.r.(type) { - case io.Seeker: - return t.Seek(offset, whence) - } - return int64(0), nil -} - -// IsSeeker returns if the underlying reader is also a seeker. -func (r ReaderSeekerCloser) IsSeeker() bool { - _, ok := r.r.(io.Seeker) - return ok -} - -// HasLen returns the length of the underlying reader if the value implements -// the Len() int method. -func (r ReaderSeekerCloser) HasLen() (int, bool) { - type lenner interface { - Len() int - } - - if lr, ok := r.r.(lenner); ok { - return lr.Len(), true - } - - return 0, false -} - -// GetLen returns the length of the bytes remaining in the underlying reader. -// Checks first for Len(), then io.Seeker to determine the size of the -// underlying reader. -// -// Will return -1 if the length cannot be determined. -func (r ReaderSeekerCloser) GetLen() (int64, error) { - if l, ok := r.HasLen(); ok { - return int64(l), nil - } - - if s, ok := r.r.(io.Seeker); ok { - return seekerLen(s) - } - - return -1, nil -} - -// SeekerLen attempts to get the number of bytes remaining at the seeker's -// current position. Returns the number of bytes remaining or error. -func SeekerLen(s io.Seeker) (int64, error) { - // Determine if the seeker is actually seekable. ReaderSeekerCloser - // hides the fact that a io.Readers might not actually be seekable. - switch v := s.(type) { - case ReaderSeekerCloser: - return v.GetLen() - case *ReaderSeekerCloser: - return v.GetLen() - } - - return seekerLen(s) -} - -func seekerLen(s io.Seeker) (int64, error) { - curOffset, err := s.Seek(0, sdkio.SeekCurrent) - if err != nil { - return 0, err - } - - endOffset, err := s.Seek(0, sdkio.SeekEnd) - if err != nil { - return 0, err - } - - _, err = s.Seek(curOffset, sdkio.SeekStart) - if err != nil { - return 0, err - } - - return endOffset - curOffset, nil -} - -// Close closes the ReaderSeekerCloser. -// -// If the ReaderSeekerCloser is not an io.Closer nothing will be done. -func (r ReaderSeekerCloser) Close() error { - switch t := r.r.(type) { - case io.Closer: - return t.Close() - } - return nil -} - -// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface -// Can be used with the s3manager.Downloader to download content to a buffer -// in memory. Safe to use concurrently. -type WriteAtBuffer struct { - buf []byte - m sync.Mutex - - // GrowthCoeff defines the growth rate of the internal buffer. By - // default, the growth rate is 1, where expanding the internal - // buffer will allocate only enough capacity to fit the new expected - // length. - GrowthCoeff float64 -} - -// NewWriteAtBuffer creates a WriteAtBuffer with an internal buffer -// provided by buf. -func NewWriteAtBuffer(buf []byte) *WriteAtBuffer { - return &WriteAtBuffer{buf: buf} -} - -// WriteAt writes a slice of bytes to a buffer starting at the position provided -// The number of bytes written will be returned, or error. Can overwrite previous -// written slices if the write ats overlap. -func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) { - pLen := len(p) - expLen := pos + int64(pLen) - b.m.Lock() - defer b.m.Unlock() - if int64(len(b.buf)) < expLen { - if int64(cap(b.buf)) < expLen { - if b.GrowthCoeff < 1 { - b.GrowthCoeff = 1 - } - newBuf := make([]byte, expLen, int64(b.GrowthCoeff*float64(expLen))) - copy(newBuf, b.buf) - b.buf = newBuf - } - b.buf = b.buf[:expLen] - } - copy(b.buf[pos:], p) - return pLen, nil -} - -// Bytes returns a slice of bytes written to the buffer. -func (b *WriteAtBuffer) Bytes() []byte { - b.m.Lock() - defer b.m.Unlock() - return b.buf -} - -// MultiCloser is a utility to close multiple io.Closers within a single -// statement. -type MultiCloser []io.Closer - -// Close closes all of the io.Closers making up the MultiClosers. Any -// errors that occur while closing will be returned in the order they -// occur. -func (m MultiCloser) Close() error { - var errs errors - for _, c := range m { - err := c.Close() - if err != nil { - errs = append(errs, err) - } - } - if len(errs) != 0 { - return errs - } - - return nil -} - -type errors []error - -func (es errors) Error() string { - var parts []string - for _, e := range es { - parts = append(parts, e.Error()) - } - - return strings.Join(parts, "\n") -} - -// CopySeekableBody copies the seekable body to an io.Writer -func CopySeekableBody(dst io.Writer, src io.ReadSeeker) (int64, error) { - curPos, err := src.Seek(0, sdkio.SeekCurrent) - if err != nil { - return 0, err - } - - // copy errors may be assumed to be from the body. - n, err := io.Copy(dst, src) - if err != nil { - return n, err - } - - // seek back to the first position after reading to reset - // the body for transmission. - _, err = src.Seek(curPos, sdkio.SeekStart) - if err != nil { - return n, err - } - - return n, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/url.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/url.go deleted file mode 100644 index 6192b2455b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/url.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build go1.8 - -package aws - -import "net/url" - -// URLHostname will extract the Hostname without port from the URL value. -// -// Wrapper of net/url#URL.Hostname for backwards Go version compatibility. -func URLHostname(url *url.URL) string { - return url.Hostname() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go deleted file mode 100644 index 0210d2720e..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build !go1.8 - -package aws - -import ( - "net/url" - "strings" -) - -// URLHostname will extract the Hostname without port from the URL value. -// -// Copy of Go 1.8's net/url#URL.Hostname functionality. -func URLHostname(url *url.URL) string { - return stripPort(url.Host) - -} - -// stripPort is copy of Go 1.8 url#URL.Hostname functionality. -// https://golang.org/src/net/url/url.go -func stripPort(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return hostport - } - if i := strings.IndexByte(hostport, ']'); i != -1 { - return strings.TrimPrefix(hostport[:i], "[") - } - return hostport[:colon] -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/aws/version.go b/ibm/vendor/github.com/aws/aws-sdk-go/aws/version.go deleted file mode 100644 index cf26997eb2..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package aws provides core functionality for making requests to AWS services. -package aws - -// SDKName is the name of this AWS SDK -const SDKName = "aws-sdk-go" - -// SDKVersion is the version of this SDK -const SDKVersion = "1.37.0" diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go deleted file mode 100644 index 876dcb3fde..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go +++ /dev/null @@ -1,40 +0,0 @@ -// +build !go1.7 - -package context - -import "time" - -// An emptyCtx is a copy of the Go 1.7 context.emptyCtx type. This is copied to -// provide a 1.6 and 1.5 safe version of context that is compatible with Go -// 1.7's Context. -// -// An emptyCtx is never canceled, has no values, and has no deadline. It is not -// struct{}, since vars of this type must have distinct addresses. -type emptyCtx int - -func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { - return -} - -func (*emptyCtx) Done() <-chan struct{} { - return nil -} - -func (*emptyCtx) Err() error { - return nil -} - -func (*emptyCtx) Value(key interface{}) interface{} { - return nil -} - -func (e *emptyCtx) String() string { - switch e { - case BackgroundCtx: - return "aws.BackgroundContext" - } - return "unknown empty Context" -} - -// BackgroundCtx is the common base context. -var BackgroundCtx = new(emptyCtx) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go deleted file mode 100644 index e83a99886b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go +++ /dev/null @@ -1,120 +0,0 @@ -package ini - -// ASTKind represents different states in the parse table -// and the type of AST that is being constructed -type ASTKind int - -// ASTKind* is used in the parse table to transition between -// the different states -const ( - ASTKindNone = ASTKind(iota) - ASTKindStart - ASTKindExpr - ASTKindEqualExpr - ASTKindStatement - ASTKindSkipStatement - ASTKindExprStatement - ASTKindSectionStatement - ASTKindNestedSectionStatement - ASTKindCompletedNestedSectionStatement - ASTKindCommentStatement - ASTKindCompletedSectionStatement -) - -func (k ASTKind) String() string { - switch k { - case ASTKindNone: - return "none" - case ASTKindStart: - return "start" - case ASTKindExpr: - return "expr" - case ASTKindStatement: - return "stmt" - case ASTKindSectionStatement: - return "section_stmt" - case ASTKindExprStatement: - return "expr_stmt" - case ASTKindCommentStatement: - return "comment" - case ASTKindNestedSectionStatement: - return "nested_section_stmt" - case ASTKindCompletedSectionStatement: - return "completed_stmt" - case ASTKindSkipStatement: - return "skip" - default: - return "" - } -} - -// AST interface allows us to determine what kind of node we -// are on and casting may not need to be necessary. -// -// The root is always the first node in Children -type AST struct { - Kind ASTKind - Root Token - RootToken bool - Children []AST -} - -func newAST(kind ASTKind, root AST, children ...AST) AST { - return AST{ - Kind: kind, - Children: append([]AST{root}, children...), - } -} - -func newASTWithRootToken(kind ASTKind, root Token, children ...AST) AST { - return AST{ - Kind: kind, - Root: root, - RootToken: true, - Children: children, - } -} - -// AppendChild will append to the list of children an AST has. -func (a *AST) AppendChild(child AST) { - a.Children = append(a.Children, child) -} - -// GetRoot will return the root AST which can be the first entry -// in the children list or a token. -func (a *AST) GetRoot() AST { - if a.RootToken { - return *a - } - - if len(a.Children) == 0 { - return AST{} - } - - return a.Children[0] -} - -// GetChildren will return the current AST's list of children -func (a *AST) GetChildren() []AST { - if len(a.Children) == 0 { - return []AST{} - } - - if a.RootToken { - return a.Children - } - - return a.Children[1:] -} - -// SetChildren will set and override all children of the AST. -func (a *AST) SetChildren(children []AST) { - if a.RootToken { - a.Children = children - } else { - a.Children = append(a.Children[:1], children...) - } -} - -// Start is used to indicate the starting state of the parse table. -var Start = newAST(ASTKindStart, AST{}) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go deleted file mode 100644 index 0895d53cbe..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go +++ /dev/null @@ -1,11 +0,0 @@ -package ini - -var commaRunes = []rune(",") - -func isComma(b rune) bool { - return b == ',' -} - -func newCommaToken() Token { - return newToken(TokenComma, commaRunes, NoneType) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go deleted file mode 100644 index 0b76999ba1..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go +++ /dev/null @@ -1,35 +0,0 @@ -package ini - -// isComment will return whether or not the next byte(s) is a -// comment. -func isComment(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case ';': - return true - case '#': - return true - } - - return false -} - -// newCommentToken will create a comment token and -// return how many bytes were read. -func newCommentToken(b []rune) (Token, int, error) { - i := 0 - for ; i < len(b); i++ { - if b[i] == '\n' { - break - } - - if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { - break - } - } - - return newToken(TokenComment, b[:i], NoneType), i, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go deleted file mode 100644 index 25ce0fe134..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package ini is an LL(1) parser for configuration files. -// -// Example: -// sections, err := ini.OpenFile("/path/to/file") -// if err != nil { -// panic(err) -// } -// -// profile := "foo" -// section, ok := sections.GetSection(profile) -// if !ok { -// fmt.Printf("section %q could not be found", profile) -// } -// -// Below is the BNF that describes this parser -// Grammar: -// stmt -> value stmt' -// stmt' -> epsilon | op stmt -// value -> number | string | boolean | quoted_string -// -// section -> [ section' -// section' -> value section_close -// section_close -> ] -// -// SkipState will skip (NL WS)+ -// -// comment -> # comment' | ; comment' -// comment' -> epsilon | value -package ini diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go deleted file mode 100644 index 04345a54c2..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go +++ /dev/null @@ -1,4 +0,0 @@ -package ini - -// emptyToken is used to satisfy the Token interface -var emptyToken = newToken(TokenNone, []rune{}, NoneType) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go deleted file mode 100644 index 91ba2a59dd..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go +++ /dev/null @@ -1,24 +0,0 @@ -package ini - -// newExpression will return an expression AST. -// Expr represents an expression -// -// grammar: -// expr -> string | number -func newExpression(tok Token) AST { - return newASTWithRootToken(ASTKindExpr, tok) -} - -func newEqualExpr(left AST, tok Token) AST { - return newASTWithRootToken(ASTKindEqualExpr, tok, left) -} - -// EqualExprKey will return a LHS value in the equal expr -func EqualExprKey(ast AST) string { - children := ast.GetChildren() - if len(children) == 0 || ast.Kind != ASTKindEqualExpr { - return "" - } - - return string(children[0].Root.Raw()) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go deleted file mode 100644 index 8d462f77e2..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build gofuzz - -package ini - -import ( - "bytes" -) - -func Fuzz(data []byte) int { - b := bytes.NewReader(data) - - if _, err := Parse(b); err != nil { - return 0 - } - - return 1 -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go deleted file mode 100644 index 3b0ca7afe3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go +++ /dev/null @@ -1,51 +0,0 @@ -package ini - -import ( - "io" - "os" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// OpenFile takes a path to a given file, and will open and parse -// that file. -func OpenFile(path string) (Sections, error) { - f, err := os.Open(path) - if err != nil { - return Sections{}, awserr.New(ErrCodeUnableToReadFile, "unable to open file", err) - } - defer f.Close() - - return Parse(f) -} - -// Parse will parse the given file using the shared config -// visitor. -func Parse(f io.Reader) (Sections, error) { - tree, err := ParseAST(f) - if err != nil { - return Sections{}, err - } - - v := NewDefaultVisitor() - if err = Walk(tree, v); err != nil { - return Sections{}, err - } - - return v.Sections, nil -} - -// ParseBytes will parse the given bytes and return the parsed sections. -func ParseBytes(b []byte) (Sections, error) { - tree, err := ParseASTBytes(b) - if err != nil { - return Sections{}, err - } - - v := NewDefaultVisitor() - if err = Walk(tree, v); err != nil { - return Sections{}, err - } - - return v.Sections, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go deleted file mode 100644 index 582c024ad1..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go +++ /dev/null @@ -1,165 +0,0 @@ -package ini - -import ( - "bytes" - "io" - "io/ioutil" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -const ( - // ErrCodeUnableToReadFile is used when a file is failed to be - // opened or read from. - ErrCodeUnableToReadFile = "FailedRead" -) - -// TokenType represents the various different tokens types -type TokenType int - -func (t TokenType) String() string { - switch t { - case TokenNone: - return "none" - case TokenLit: - return "literal" - case TokenSep: - return "sep" - case TokenOp: - return "op" - case TokenWS: - return "ws" - case TokenNL: - return "newline" - case TokenComment: - return "comment" - case TokenComma: - return "comma" - default: - return "" - } -} - -// TokenType enums -const ( - TokenNone = TokenType(iota) - TokenLit - TokenSep - TokenComma - TokenOp - TokenWS - TokenNL - TokenComment -) - -type iniLexer struct{} - -// Tokenize will return a list of tokens during lexical analysis of the -// io.Reader. -func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, awserr.New(ErrCodeUnableToReadFile, "unable to read file", err) - } - - return l.tokenize(b) -} - -func (l *iniLexer) tokenize(b []byte) ([]Token, error) { - runes := bytes.Runes(b) - var err error - n := 0 - tokenAmount := countTokens(runes) - tokens := make([]Token, tokenAmount) - count := 0 - - for len(runes) > 0 && count < tokenAmount { - switch { - case isWhitespace(runes[0]): - tokens[count], n, err = newWSToken(runes) - case isComma(runes[0]): - tokens[count], n = newCommaToken(), 1 - case isComment(runes): - tokens[count], n, err = newCommentToken(runes) - case isNewline(runes): - tokens[count], n, err = newNewlineToken(runes) - case isSep(runes): - tokens[count], n, err = newSepToken(runes) - case isOp(runes): - tokens[count], n, err = newOpToken(runes) - default: - tokens[count], n, err = newLitToken(runes) - } - - if err != nil { - return nil, err - } - - count++ - - runes = runes[n:] - } - - return tokens[:count], nil -} - -func countTokens(runes []rune) int { - count, n := 0, 0 - var err error - - for len(runes) > 0 { - switch { - case isWhitespace(runes[0]): - _, n, err = newWSToken(runes) - case isComma(runes[0]): - _, n = newCommaToken(), 1 - case isComment(runes): - _, n, err = newCommentToken(runes) - case isNewline(runes): - _, n, err = newNewlineToken(runes) - case isSep(runes): - _, n, err = newSepToken(runes) - case isOp(runes): - _, n, err = newOpToken(runes) - default: - _, n, err = newLitToken(runes) - } - - if err != nil { - return 0 - } - - count++ - runes = runes[n:] - } - - return count + 1 -} - -// Token indicates a metadata about a given value. -type Token struct { - t TokenType - ValueType ValueType - base int - raw []rune -} - -var emptyValue = Value{} - -func newToken(t TokenType, raw []rune, v ValueType) Token { - return Token{ - t: t, - raw: raw, - ValueType: v, - } -} - -// Raw return the raw runes that were consumed -func (tok Token) Raw() []rune { - return tok.raw -} - -// Type returns the token type -func (tok Token) Type() TokenType { - return tok.t -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go deleted file mode 100644 index 55fa73ebcf..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go +++ /dev/null @@ -1,357 +0,0 @@ -package ini - -import ( - "fmt" - "io" -) - -// State enums for the parse table -const ( - InvalidState = iota - // stmt -> value stmt' - StatementState - // stmt' -> MarkComplete | op stmt - StatementPrimeState - // value -> number | string | boolean | quoted_string - ValueState - // section -> [ section' - OpenScopeState - // section' -> value section_close - SectionState - // section_close -> ] - CloseScopeState - // SkipState will skip (NL WS)+ - SkipState - // SkipTokenState will skip any token and push the previous - // state onto the stack. - SkipTokenState - // comment -> # comment' | ; comment' - // comment' -> MarkComplete | value - CommentState - // MarkComplete state will complete statements and move that - // to the completed AST list - MarkCompleteState - // TerminalState signifies that the tokens have been fully parsed - TerminalState -) - -// parseTable is a state machine to dictate the grammar above. -var parseTable = map[ASTKind]map[TokenType]int{ - ASTKindStart: map[TokenType]int{ - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: TerminalState, - }, - ASTKindCommentStatement: map[TokenType]int{ - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindExpr: map[TokenType]int{ - TokenOp: StatementPrimeState, - TokenLit: ValueState, - TokenSep: OpenScopeState, - TokenWS: ValueState, - TokenNL: SkipState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindEqualExpr: map[TokenType]int{ - TokenLit: ValueState, - TokenWS: SkipTokenState, - TokenNL: SkipState, - TokenNone: SkipState, - }, - ASTKindStatement: map[TokenType]int{ - TokenLit: SectionState, - TokenSep: CloseScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindExprStatement: map[TokenType]int{ - TokenLit: ValueState, - TokenSep: OpenScopeState, - TokenOp: ValueState, - TokenWS: ValueState, - TokenNL: MarkCompleteState, - TokenComment: CommentState, - TokenNone: TerminalState, - TokenComma: SkipState, - }, - ASTKindSectionStatement: map[TokenType]int{ - TokenLit: SectionState, - TokenOp: SectionState, - TokenSep: CloseScopeState, - TokenWS: SectionState, - TokenNL: SkipTokenState, - }, - ASTKindCompletedSectionStatement: map[TokenType]int{ - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindSkipStatement: map[TokenType]int{ - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: TerminalState, - }, -} - -// ParseAST will parse input from an io.Reader using -// an LL(1) parser. -func ParseAST(r io.Reader) ([]AST, error) { - lexer := iniLexer{} - tokens, err := lexer.Tokenize(r) - if err != nil { - return []AST{}, err - } - - return parse(tokens) -} - -// ParseASTBytes will parse input from a byte slice using -// an LL(1) parser. -func ParseASTBytes(b []byte) ([]AST, error) { - lexer := iniLexer{} - tokens, err := lexer.tokenize(b) - if err != nil { - return []AST{}, err - } - - return parse(tokens) -} - -func parse(tokens []Token) ([]AST, error) { - start := Start - stack := newParseStack(3, len(tokens)) - - stack.Push(start) - s := newSkipper() - -loop: - for stack.Len() > 0 { - k := stack.Pop() - - var tok Token - if len(tokens) == 0 { - // this occurs when all the tokens have been processed - // but reduction of what's left on the stack needs to - // occur. - tok = emptyToken - } else { - tok = tokens[0] - } - - step := parseTable[k.Kind][tok.Type()] - if s.ShouldSkip(tok) { - // being in a skip state with no tokens will break out of - // the parse loop since there is nothing left to process. - if len(tokens) == 0 { - break loop - } - // if should skip is true, we skip the tokens until should skip is set to false. - step = SkipTokenState - } - - switch step { - case TerminalState: - // Finished parsing. Push what should be the last - // statement to the stack. If there is anything left - // on the stack, an error in parsing has occurred. - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - break loop - case SkipTokenState: - // When skipping a token, the previous state was popped off the stack. - // To maintain the correct state, the previous state will be pushed - // onto the stack. - stack.Push(k) - case StatementState: - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - expr := newExpression(tok) - stack.Push(expr) - case StatementPrimeState: - if tok.Type() != TokenOp { - stack.MarkComplete(k) - continue - } - - if k.Kind != ASTKindExpr { - return nil, NewParseError( - fmt.Sprintf("invalid expression: expected Expr type, but found %T type", k), - ) - } - - k = trimSpaces(k) - expr := newEqualExpr(k, tok) - stack.Push(expr) - case ValueState: - // ValueState requires the previous state to either be an equal expression - // or an expression statement. - // - // This grammar occurs when the RHS is a number, word, or quoted string. - // equal_expr -> lit op equal_expr' - // equal_expr' -> number | string | quoted_string - // quoted_string -> " quoted_string' - // quoted_string' -> string quoted_string_end - // quoted_string_end -> " - // - // otherwise - // expr_stmt -> equal_expr (expr_stmt')* - // expr_stmt' -> ws S | op S | MarkComplete - // S -> equal_expr' expr_stmt' - switch k.Kind { - case ASTKindEqualExpr: - // assigning a value to some key - k.AppendChild(newExpression(tok)) - stack.Push(newExprStatement(k)) - case ASTKindExpr: - k.Root.raw = append(k.Root.raw, tok.Raw()...) - stack.Push(k) - case ASTKindExprStatement: - root := k.GetRoot() - children := root.GetChildren() - if len(children) == 0 { - return nil, NewParseError( - fmt.Sprintf("invalid expression: AST contains no children %s", k.Kind), - ) - } - - rhs := children[len(children)-1] - - if rhs.Root.ValueType != QuotedStringType { - rhs.Root.ValueType = StringType - rhs.Root.raw = append(rhs.Root.raw, tok.Raw()...) - - } - - children[len(children)-1] = rhs - k.SetChildren(children) - - stack.Push(k) - } - case OpenScopeState: - if !runeCompare(tok.Raw(), openBrace) { - return nil, NewParseError("expected '['") - } - // If OpenScopeState is not at the start, we must mark the previous ast as complete - // - // for example: if previous ast was a skip statement; - // we should mark it as complete before we create a new statement - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - - stmt := newStatement() - stack.Push(stmt) - case CloseScopeState: - if !runeCompare(tok.Raw(), closeBrace) { - return nil, NewParseError("expected ']'") - } - - k = trimSpaces(k) - stack.Push(newCompletedSectionStatement(k)) - case SectionState: - var stmt AST - - switch k.Kind { - case ASTKindStatement: - // If there are multiple literals inside of a scope declaration, - // then the current token's raw value will be appended to the Name. - // - // This handles cases like [ profile default ] - // - // k will represent a SectionStatement with the children representing - // the label of the section - stmt = newSectionStatement(tok) - case ASTKindSectionStatement: - k.Root.raw = append(k.Root.raw, tok.Raw()...) - stmt = k - default: - return nil, NewParseError( - fmt.Sprintf("invalid statement: expected statement: %v", k.Kind), - ) - } - - stack.Push(stmt) - case MarkCompleteState: - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - - if stack.Len() == 0 { - stack.Push(start) - } - case SkipState: - stack.Push(newSkipStatement(k)) - s.Skip() - case CommentState: - if k.Kind == ASTKindStart { - stack.Push(k) - } else { - stack.MarkComplete(k) - } - - stmt := newCommentStatement(tok) - stack.Push(stmt) - default: - return nil, NewParseError( - fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", - k, tok.Type())) - } - - if len(tokens) > 0 { - tokens = tokens[1:] - } - } - - // this occurs when a statement has not been completed - if stack.top > 1 { - return nil, NewParseError(fmt.Sprintf("incomplete ini expression")) - } - - // returns a sublist which excludes the start symbol - return stack.List(), nil -} - -// trimSpaces will trim spaces on the left and right hand side of -// the literal. -func trimSpaces(k AST) AST { - // trim left hand side of spaces - for i := 0; i < len(k.Root.raw); i++ { - if !isWhitespace(k.Root.raw[i]) { - break - } - - k.Root.raw = k.Root.raw[1:] - i-- - } - - // trim right hand side of spaces - for i := len(k.Root.raw) - 1; i >= 0; i-- { - if !isWhitespace(k.Root.raw[i]) { - break - } - - k.Root.raw = k.Root.raw[:len(k.Root.raw)-1] - } - - return k -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go deleted file mode 100644 index 24df543d38..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go +++ /dev/null @@ -1,324 +0,0 @@ -package ini - -import ( - "fmt" - "strconv" - "strings" -) - -var ( - runesTrue = []rune("true") - runesFalse = []rune("false") -) - -var literalValues = [][]rune{ - runesTrue, - runesFalse, -} - -func isBoolValue(b []rune) bool { - for _, lv := range literalValues { - if isLitValue(lv, b) { - return true - } - } - return false -} - -func isLitValue(want, have []rune) bool { - if len(have) < len(want) { - return false - } - - for i := 0; i < len(want); i++ { - if want[i] != have[i] { - return false - } - } - - return true -} - -// isNumberValue will return whether not the leading characters in -// a byte slice is a number. A number is delimited by whitespace or -// the newline token. -// -// A number is defined to be in a binary, octal, decimal (int | float), hex format, -// or in scientific notation. -func isNumberValue(b []rune) bool { - negativeIndex := 0 - helper := numberHelper{} - needDigit := false - - for i := 0; i < len(b); i++ { - negativeIndex++ - - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return false - } - helper.Determine(b[i]) - needDigit = true - continue - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return false - } - negativeIndex = 0 - needDigit = true - continue - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - needDigit = true - if i == 0 { - return false - } - - fallthrough - case '.': - if err := helper.Determine(b[i]); err != nil { - return false - } - needDigit = true - continue - } - - if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) { - return !needDigit - } - - if !helper.CorrectByte(b[i]) { - return false - } - needDigit = false - } - - return !needDigit -} - -func isValid(b []rune) (bool, int, error) { - if len(b) == 0 { - // TODO: should probably return an error - return false, 0, nil - } - - return isValidRune(b[0]), 1, nil -} - -func isValidRune(r rune) bool { - return r != ':' && r != '=' && r != '[' && r != ']' && r != ' ' && r != '\n' -} - -// ValueType is an enum that will signify what type -// the Value is -type ValueType int - -func (v ValueType) String() string { - switch v { - case NoneType: - return "NONE" - case DecimalType: - return "FLOAT" - case IntegerType: - return "INT" - case StringType: - return "STRING" - case BoolType: - return "BOOL" - } - - return "" -} - -// ValueType enums -const ( - NoneType = ValueType(iota) - DecimalType - IntegerType - StringType - QuotedStringType - BoolType -) - -// Value is a union container -type Value struct { - Type ValueType - raw []rune - - integer int64 - decimal float64 - boolean bool - str string -} - -func newValue(t ValueType, base int, raw []rune) (Value, error) { - v := Value{ - Type: t, - raw: raw, - } - var err error - - switch t { - case DecimalType: - v.decimal, err = strconv.ParseFloat(string(raw), 64) - case IntegerType: - if base != 10 { - raw = raw[2:] - } - - v.integer, err = strconv.ParseInt(string(raw), base, 64) - case StringType: - v.str = string(raw) - case QuotedStringType: - v.str = string(raw[1 : len(raw)-1]) - case BoolType: - v.boolean = runeCompare(v.raw, runesTrue) - } - - // issue 2253 - // - // if the value trying to be parsed is too large, then we will use - // the 'StringType' and raw value instead. - if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange { - v.Type = StringType - v.str = string(raw) - err = nil - } - - return v, err -} - -// Append will append values and change the type to a string -// type. -func (v *Value) Append(tok Token) { - r := tok.Raw() - if v.Type != QuotedStringType { - v.Type = StringType - r = tok.raw[1 : len(tok.raw)-1] - } - if tok.Type() != TokenLit { - v.raw = append(v.raw, tok.Raw()...) - } else { - v.raw = append(v.raw, r...) - } -} - -func (v Value) String() string { - switch v.Type { - case DecimalType: - return fmt.Sprintf("decimal: %f", v.decimal) - case IntegerType: - return fmt.Sprintf("integer: %d", v.integer) - case StringType: - return fmt.Sprintf("string: %s", string(v.raw)) - case QuotedStringType: - return fmt.Sprintf("quoted string: %s", string(v.raw)) - case BoolType: - return fmt.Sprintf("bool: %t", v.boolean) - default: - return "union not set" - } -} - -func newLitToken(b []rune) (Token, int, error) { - n := 0 - var err error - - token := Token{} - if b[0] == '"' { - n, err = getStringValue(b) - if err != nil { - return token, n, err - } - - token = newToken(TokenLit, b[:n], QuotedStringType) - } else if isNumberValue(b) { - var base int - base, n, err = getNumericalValue(b) - if err != nil { - return token, 0, err - } - - value := b[:n] - vType := IntegerType - if contains(value, '.') || hasExponent(value) { - vType = DecimalType - } - token = newToken(TokenLit, value, vType) - token.base = base - } else if isBoolValue(b) { - n, err = getBoolValue(b) - - token = newToken(TokenLit, b[:n], BoolType) - } else { - n, err = getValue(b) - token = newToken(TokenLit, b[:n], StringType) - } - - return token, n, err -} - -// IntValue returns an integer value -func (v Value) IntValue() int64 { - return v.integer -} - -// FloatValue returns a float value -func (v Value) FloatValue() float64 { - return v.decimal -} - -// BoolValue returns a bool value -func (v Value) BoolValue() bool { - return v.boolean -} - -func isTrimmable(r rune) bool { - switch r { - case '\n', ' ': - return true - } - return false -} - -// StringValue returns the string value -func (v Value) StringValue() string { - switch v.Type { - case StringType: - return strings.TrimFunc(string(v.raw), isTrimmable) - case QuotedStringType: - // preserve all characters in the quotes - return string(removeEscapedCharacters(v.raw[1 : len(v.raw)-1])) - default: - return strings.TrimFunc(string(v.raw), isTrimmable) - } -} - -func contains(runes []rune, c rune) bool { - for i := 0; i < len(runes); i++ { - if runes[i] == c { - return true - } - } - - return false -} - -func runeCompare(v1 []rune, v2 []rune) bool { - if len(v1) != len(v2) { - return false - } - - for i := 0; i < len(v1); i++ { - if v1[i] != v2[i] { - return false - } - } - - return true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go deleted file mode 100644 index e52ac399f1..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go +++ /dev/null @@ -1,30 +0,0 @@ -package ini - -func isNewline(b []rune) bool { - if len(b) == 0 { - return false - } - - if b[0] == '\n' { - return true - } - - if len(b) < 2 { - return false - } - - return b[0] == '\r' && b[1] == '\n' -} - -func newNewlineToken(b []rune) (Token, int, error) { - i := 1 - if b[0] == '\r' && isNewline(b[1:]) { - i++ - } - - if !isNewline([]rune(b[:i])) { - return emptyToken, 0, NewParseError("invalid new line token") - } - - return newToken(TokenNL, b[:i], NoneType), i, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go deleted file mode 100644 index a45c0bc566..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go +++ /dev/null @@ -1,152 +0,0 @@ -package ini - -import ( - "bytes" - "fmt" - "strconv" -) - -const ( - none = numberFormat(iota) - binary - octal - decimal - hex - exponent -) - -type numberFormat int - -// numberHelper is used to dictate what format a number is in -// and what to do for negative values. Since -1e-4 is a valid -// number, we cannot just simply check for duplicate negatives. -type numberHelper struct { - numberFormat numberFormat - - negative bool - negativeExponent bool -} - -func (b numberHelper) Exists() bool { - return b.numberFormat != none -} - -func (b numberHelper) IsNegative() bool { - return b.negative || b.negativeExponent -} - -func (b *numberHelper) Determine(c rune) error { - if b.Exists() { - return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c))) - } - - switch c { - case 'b': - b.numberFormat = binary - case 'o': - b.numberFormat = octal - case 'x': - b.numberFormat = hex - case 'e', 'E': - b.numberFormat = exponent - case '-': - if b.numberFormat != exponent { - b.negative = true - } else { - b.negativeExponent = true - } - case '.': - b.numberFormat = decimal - default: - return NewParseError(fmt.Sprintf("invalid number character: %v", string(c))) - } - - return nil -} - -func (b numberHelper) CorrectByte(c rune) bool { - switch { - case b.numberFormat == binary: - if !isBinaryByte(c) { - return false - } - case b.numberFormat == octal: - if !isOctalByte(c) { - return false - } - case b.numberFormat == hex: - if !isHexByte(c) { - return false - } - case b.numberFormat == decimal: - if !isDigit(c) { - return false - } - case b.numberFormat == exponent: - if !isDigit(c) { - return false - } - case b.negativeExponent: - if !isDigit(c) { - return false - } - case b.negative: - if !isDigit(c) { - return false - } - default: - if !isDigit(c) { - return false - } - } - - return true -} - -func (b numberHelper) Base() int { - switch b.numberFormat { - case binary: - return 2 - case octal: - return 8 - case hex: - return 16 - default: - return 10 - } -} - -func (b numberHelper) String() string { - buf := bytes.Buffer{} - i := 0 - - switch b.numberFormat { - case binary: - i++ - buf.WriteString(strconv.Itoa(i) + ": binary format\n") - case octal: - i++ - buf.WriteString(strconv.Itoa(i) + ": octal format\n") - case hex: - i++ - buf.WriteString(strconv.Itoa(i) + ": hex format\n") - case exponent: - i++ - buf.WriteString(strconv.Itoa(i) + ": exponent format\n") - default: - i++ - buf.WriteString(strconv.Itoa(i) + ": integer format\n") - } - - if b.negative { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative format\n") - } - - if b.negativeExponent { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n") - } - - return buf.String() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go deleted file mode 100644 index 8a84c7cbe0..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go +++ /dev/null @@ -1,39 +0,0 @@ -package ini - -import ( - "fmt" -) - -var ( - equalOp = []rune("=") - equalColonOp = []rune(":") -) - -func isOp(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case '=': - return true - case ':': - return true - default: - return false - } -} - -func newOpToken(b []rune) (Token, int, error) { - tok := Token{} - - switch b[0] { - case '=': - tok = newToken(TokenOp, equalOp, NoneType) - case ':': - tok = newToken(TokenOp, equalColonOp, NoneType) - default: - return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0])) - } - return tok, 1, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go deleted file mode 100644 index 4572870193..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go +++ /dev/null @@ -1,43 +0,0 @@ -package ini - -import "fmt" - -const ( - // ErrCodeParseError is returned when a parsing error - // has occurred. - ErrCodeParseError = "INIParseError" -) - -// ParseError is an error which is returned during any part of -// the parsing process. -type ParseError struct { - msg string -} - -// NewParseError will return a new ParseError where message -// is the description of the error. -func NewParseError(message string) *ParseError { - return &ParseError{ - msg: message, - } -} - -// Code will return the ErrCodeParseError -func (err *ParseError) Code() string { - return ErrCodeParseError -} - -// Message returns the error's message -func (err *ParseError) Message() string { - return err.msg -} - -// OrigError return nothing since there will never be any -// original error. -func (err *ParseError) OrigError() error { - return nil -} - -func (err *ParseError) Error() string { - return fmt.Sprintf("%s: %s", err.Code(), err.Message()) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go deleted file mode 100644 index 7f01cf7c70..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go +++ /dev/null @@ -1,60 +0,0 @@ -package ini - -import ( - "bytes" - "fmt" -) - -// ParseStack is a stack that contains a container, the stack portion, -// and the list which is the list of ASTs that have been successfully -// parsed. -type ParseStack struct { - top int - container []AST - list []AST - index int -} - -func newParseStack(sizeContainer, sizeList int) ParseStack { - return ParseStack{ - container: make([]AST, sizeContainer), - list: make([]AST, sizeList), - } -} - -// Pop will return and truncate the last container element. -func (s *ParseStack) Pop() AST { - s.top-- - return s.container[s.top] -} - -// Push will add the new AST to the container -func (s *ParseStack) Push(ast AST) { - s.container[s.top] = ast - s.top++ -} - -// MarkComplete will append the AST to the list of completed statements -func (s *ParseStack) MarkComplete(ast AST) { - s.list[s.index] = ast - s.index++ -} - -// List will return the completed statements -func (s ParseStack) List() []AST { - return s.list[:s.index] -} - -// Len will return the length of the container -func (s *ParseStack) Len() int { - return s.top -} - -func (s ParseStack) String() string { - buf := bytes.Buffer{} - for i, node := range s.list { - buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node)) - } - - return buf.String() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go deleted file mode 100644 index f82095ba25..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go +++ /dev/null @@ -1,41 +0,0 @@ -package ini - -import ( - "fmt" -) - -var ( - emptyRunes = []rune{} -) - -func isSep(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case '[', ']': - return true - default: - return false - } -} - -var ( - openBrace = []rune("[") - closeBrace = []rune("]") -) - -func newSepToken(b []rune) (Token, int, error) { - tok := Token{} - - switch b[0] { - case '[': - tok = newToken(TokenSep, openBrace, NoneType) - case ']': - tok = newToken(TokenSep, closeBrace, NoneType) - default: - return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0])) - } - return tok, 1, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go deleted file mode 100644 index da7a4049cf..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go +++ /dev/null @@ -1,45 +0,0 @@ -package ini - -// skipper is used to skip certain blocks of an ini file. -// Currently skipper is used to skip nested blocks of ini -// files. See example below -// -// [ foo ] -// nested = ; this section will be skipped -// a=b -// c=d -// bar=baz ; this will be included -type skipper struct { - shouldSkip bool - TokenSet bool - prevTok Token -} - -func newSkipper() skipper { - return skipper{ - prevTok: emptyToken, - } -} - -func (s *skipper) ShouldSkip(tok Token) bool { - // should skip state will be modified only if previous token was new line (NL); - // and the current token is not WhiteSpace (WS). - if s.shouldSkip && - s.prevTok.Type() == TokenNL && - tok.Type() != TokenWS { - s.Continue() - return false - } - s.prevTok = tok - return s.shouldSkip -} - -func (s *skipper) Skip() { - s.shouldSkip = true -} - -func (s *skipper) Continue() { - s.shouldSkip = false - // empty token is assigned as we return to default state, when should skip is false - s.prevTok = emptyToken -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go deleted file mode 100644 index 18f3fe8931..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go +++ /dev/null @@ -1,35 +0,0 @@ -package ini - -// Statement is an empty AST mostly used for transitioning states. -func newStatement() AST { - return newAST(ASTKindStatement, AST{}) -} - -// SectionStatement represents a section AST -func newSectionStatement(tok Token) AST { - return newASTWithRootToken(ASTKindSectionStatement, tok) -} - -// ExprStatement represents a completed expression AST -func newExprStatement(ast AST) AST { - return newAST(ASTKindExprStatement, ast) -} - -// CommentStatement represents a comment in the ini definition. -// -// grammar: -// comment -> #comment' | ;comment' -// comment' -> epsilon | value -func newCommentStatement(tok Token) AST { - return newAST(ASTKindCommentStatement, newExpression(tok)) -} - -// CompletedSectionStatement represents a completed section -func newCompletedSectionStatement(ast AST) AST { - return newAST(ASTKindCompletedSectionStatement, ast) -} - -// SkipStatement is used to skip whole statements -func newSkipStatement(ast AST) AST { - return newAST(ASTKindSkipStatement, ast) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go deleted file mode 100644 index 305999d29b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go +++ /dev/null @@ -1,284 +0,0 @@ -package ini - -import ( - "fmt" -) - -// getStringValue will return a quoted string and the amount -// of bytes read -// -// an error will be returned if the string is not properly formatted -func getStringValue(b []rune) (int, error) { - if b[0] != '"' { - return 0, NewParseError("strings must start with '\"'") - } - - endQuote := false - i := 1 - - for ; i < len(b) && !endQuote; i++ { - if escaped := isEscaped(b[:i], b[i]); b[i] == '"' && !escaped { - endQuote = true - break - } else if escaped { - /*c, err := getEscapedByte(b[i]) - if err != nil { - return 0, err - } - - b[i-1] = c - b = append(b[:i], b[i+1:]...) - i--*/ - - continue - } - } - - if !endQuote { - return 0, NewParseError("missing '\"' in string value") - } - - return i + 1, nil -} - -// getBoolValue will return a boolean and the amount -// of bytes read -// -// an error will be returned if the boolean is not of a correct -// value -func getBoolValue(b []rune) (int, error) { - if len(b) < 4 { - return 0, NewParseError("invalid boolean value") - } - - n := 0 - for _, lv := range literalValues { - if len(lv) > len(b) { - continue - } - - if isLitValue(lv, b) { - n = len(lv) - } - } - - if n == 0 { - return 0, NewParseError("invalid boolean value") - } - - return n, nil -} - -// getNumericalValue will return a numerical string, the amount -// of bytes read, and the base of the number -// -// an error will be returned if the number is not of a correct -// value -func getNumericalValue(b []rune) (int, int, error) { - if !isDigit(b[0]) { - return 0, 0, NewParseError("invalid digit value") - } - - i := 0 - helper := numberHelper{} - -loop: - for negativeIndex := 0; i < len(b); i++ { - negativeIndex++ - - if !isDigit(b[i]) { - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return 0, 0, NewParseError("parse error '-'") - } - - n := getNegativeNumber(b[i:]) - i += (n - 1) - helper.Determine(b[i]) - continue - case '.': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - - negativeIndex = 0 - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - if i == 0 && b[i] != '0' { - return 0, 0, NewParseError("incorrect base format, expected leading '0'") - } - - if i != 1 { - return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i)) - } - - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - default: - if isWhitespace(b[i]) { - break loop - } - - if isNewline(b[i:]) { - break loop - } - - if !(helper.numberFormat == hex && isHexByte(b[i])) { - if i+2 < len(b) && !isNewline(b[i:i+2]) { - return 0, 0, NewParseError("invalid numerical character") - } else if !isNewline([]rune{b[i]}) { - return 0, 0, NewParseError("invalid numerical character") - } - - break loop - } - } - } - } - - return helper.Base(), i, nil -} - -// isDigit will return whether or not something is an integer -func isDigit(b rune) bool { - return b >= '0' && b <= '9' -} - -func hasExponent(v []rune) bool { - return contains(v, 'e') || contains(v, 'E') -} - -func isBinaryByte(b rune) bool { - switch b { - case '0', '1': - return true - default: - return false - } -} - -func isOctalByte(b rune) bool { - switch b { - case '0', '1', '2', '3', '4', '5', '6', '7': - return true - default: - return false - } -} - -func isHexByte(b rune) bool { - if isDigit(b) { - return true - } - return (b >= 'A' && b <= 'F') || - (b >= 'a' && b <= 'f') -} - -func getValue(b []rune) (int, error) { - i := 0 - - for i < len(b) { - if isNewline(b[i:]) { - break - } - - if isOp(b[i:]) { - break - } - - valid, n, err := isValid(b[i:]) - if err != nil { - return 0, err - } - - if !valid { - break - } - - i += n - } - - return i, nil -} - -// getNegativeNumber will return a negative number from a -// byte slice. This will iterate through all characters until -// a non-digit has been found. -func getNegativeNumber(b []rune) int { - if b[0] != '-' { - return 0 - } - - i := 1 - for ; i < len(b); i++ { - if !isDigit(b[i]) { - return i - } - } - - return i -} - -// isEscaped will return whether or not the character is an escaped -// character. -func isEscaped(value []rune, b rune) bool { - if len(value) == 0 { - return false - } - - switch b { - case '\'': // single quote - case '"': // quote - case 'n': // newline - case 't': // tab - case '\\': // backslash - default: - return false - } - - return value[len(value)-1] == '\\' -} - -func getEscapedByte(b rune) (rune, error) { - switch b { - case '\'': // single quote - return '\'', nil - case '"': // quote - return '"', nil - case 'n': // newline - return '\n', nil - case 't': // table - return '\t', nil - case '\\': // backslash - return '\\', nil - default: - return b, NewParseError(fmt.Sprintf("invalid escaped character %c", b)) - } -} - -func removeEscapedCharacters(b []rune) []rune { - for i := 0; i < len(b); i++ { - if isEscaped(b[:i], b[i]) { - c, err := getEscapedByte(b[i]) - if err != nil { - return b - } - - b[i-1] = c - b = append(b[:i], b[i+1:]...) - i-- - } - } - - return b -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go deleted file mode 100644 index 94841c3244..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go +++ /dev/null @@ -1,166 +0,0 @@ -package ini - -import ( - "fmt" - "sort" -) - -// Visitor is an interface used by walkers that will -// traverse an array of ASTs. -type Visitor interface { - VisitExpr(AST) error - VisitStatement(AST) error -} - -// DefaultVisitor is used to visit statements and expressions -// and ensure that they are both of the correct format. -// In addition, upon visiting this will build sections and populate -// the Sections field which can be used to retrieve profile -// configuration. -type DefaultVisitor struct { - scope string - Sections Sections -} - -// NewDefaultVisitor return a DefaultVisitor -func NewDefaultVisitor() *DefaultVisitor { - return &DefaultVisitor{ - Sections: Sections{ - container: map[string]Section{}, - }, - } -} - -// VisitExpr visits expressions... -func (v *DefaultVisitor) VisitExpr(expr AST) error { - t := v.Sections.container[v.scope] - if t.values == nil { - t.values = values{} - } - - switch expr.Kind { - case ASTKindExprStatement: - opExpr := expr.GetRoot() - switch opExpr.Kind { - case ASTKindEqualExpr: - children := opExpr.GetChildren() - if len(children) <= 1 { - return NewParseError("unexpected token type") - } - - rhs := children[1] - - if rhs.Root.Type() != TokenLit { - return NewParseError("unexpected token type") - } - - key := EqualExprKey(opExpr) - v, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw()) - if err != nil { - return err - } - - t.values[key] = v - default: - return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) - } - default: - return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) - } - - v.Sections.container[v.scope] = t - return nil -} - -// VisitStatement visits statements... -func (v *DefaultVisitor) VisitStatement(stmt AST) error { - switch stmt.Kind { - case ASTKindCompletedSectionStatement: - child := stmt.GetRoot() - if child.Kind != ASTKindSectionStatement { - return NewParseError(fmt.Sprintf("unsupported child statement: %T", child)) - } - - name := string(child.Root.Raw()) - v.Sections.container[name] = Section{} - v.scope = name - default: - return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind)) - } - - return nil -} - -// Sections is a map of Section structures that represent -// a configuration. -type Sections struct { - container map[string]Section -} - -// GetSection will return section p. If section p does not exist, -// false will be returned in the second parameter. -func (t Sections) GetSection(p string) (Section, bool) { - v, ok := t.container[p] - return v, ok -} - -// values represents a map of union values. -type values map[string]Value - -// List will return a list of all sections that were successfully -// parsed. -func (t Sections) List() []string { - keys := make([]string, len(t.container)) - i := 0 - for k := range t.container { - keys[i] = k - i++ - } - - sort.Strings(keys) - return keys -} - -// Section contains a name and values. This represent -// a sectioned entry in a configuration file. -type Section struct { - Name string - values values -} - -// Has will return whether or not an entry exists in a given section -func (t Section) Has(k string) bool { - _, ok := t.values[k] - return ok -} - -// ValueType will returned what type the union is set to. If -// k was not found, the NoneType will be returned. -func (t Section) ValueType(k string) (ValueType, bool) { - v, ok := t.values[k] - return v.Type, ok -} - -// Bool returns a bool value at k -func (t Section) Bool(k string) bool { - return t.values[k].BoolValue() -} - -// Int returns an integer value at k -func (t Section) Int(k string) int64 { - return t.values[k].IntValue() -} - -// Float64 returns a float value at k -func (t Section) Float64(k string) float64 { - return t.values[k].FloatValue() -} - -// String returns the string value at k -func (t Section) String(k string) string { - _, ok := t.values[k] - if !ok { - return "" - } - return t.values[k].StringValue() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go deleted file mode 100644 index 99915f7f77..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go +++ /dev/null @@ -1,25 +0,0 @@ -package ini - -// Walk will traverse the AST using the v, the Visitor. -func Walk(tree []AST, v Visitor) error { - for _, node := range tree { - switch node.Kind { - case ASTKindExpr, - ASTKindExprStatement: - - if err := v.VisitExpr(node); err != nil { - return err - } - case ASTKindStatement, - ASTKindCompletedSectionStatement, - ASTKindNestedSectionStatement, - ASTKindCompletedNestedSectionStatement: - - if err := v.VisitStatement(node); err != nil { - return err - } - } - } - - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go deleted file mode 100644 index 7ffb4ae06f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go +++ /dev/null @@ -1,24 +0,0 @@ -package ini - -import ( - "unicode" -) - -// isWhitespace will return whether or not the character is -// a whitespace character. -// -// Whitespace is defined as a space or tab. -func isWhitespace(c rune) bool { - return unicode.IsSpace(c) && c != '\n' && c != '\r' -} - -func newWSToken(b []rune) (Token, int, error) { - i := 0 - for ; i < len(b); i++ { - if !isWhitespace(b[i]) { - break - } - } - - return newToken(TokenWS, b[:i], NoneType), i, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/accesspoint_arn.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/accesspoint_arn.go deleted file mode 100644 index bf18031a38..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go deleted file mode 100644 index 7a8e46fbda..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go +++ /dev/null @@ -1,74 +0,0 @@ -package arn - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws/arn" -) - -// 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 a.Service != "s3" && a.Service != "s3-outposts" { - return nil, InvalidARNError{ARN: a, Reason: "service is not supported"} - } - 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/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/outpost_arn.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/outpost_arn.go deleted file mode 100644 index 1e10f8de00..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go deleted file mode 100644 index e756b2f873..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go +++ /dev/null @@ -1,189 +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 -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, - } -} - -// 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/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go deleted file mode 100644 index 9f70a64ecf..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go +++ /dev/null @@ -1,62 +0,0 @@ -package s3shared - -import ( - "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/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) -} - -// UseFIPS returns true if request config region is FIPS -func (r ResourceRequest) UseFIPS() bool { - return IsFIPS(aws.StringValue(r.Request.Config.Region)) -} - -// ResourceConfiguredForFIPS returns true if resource ARNs region is FIPS -func (r ResourceRequest) ResourceConfiguredForFIPS() bool { - return IsFIPS(r.ARN().Region) -} - -// 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 -} - -// IsFIPS returns true if region is a fips region -func IsFIPS(clientRegion string) bool { - return strings.HasPrefix(clientRegion, "fips-") || strings.HasSuffix(clientRegion, "-fips") -} - -// 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/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go deleted file mode 100644 index 0b9b0dfce0..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go deleted file mode 100644 index 6c443988bb..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go +++ /dev/null @@ -1,12 +0,0 @@ -package sdkio - -const ( - // Byte is 8 bits - Byte int64 = 1 - // KibiByte (KiB) is 1024 Bytes - KibiByte = Byte * 1024 - // MebiByte (MiB) is 1024 KiB - MebiByte = KibiByte * 1024 - // GibiByte (GiB) is 1024 MiB - GibiByte = MebiByte * 1024 -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go deleted file mode 100644 index 5aa9137e0f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !go1.7 - -package sdkio - -// Copy of Go 1.7 io package's Seeker constants. -const ( - SeekStart = 0 // seek relative to the origin of the file - SeekCurrent = 1 // seek relative to the current offset - SeekEnd = 2 // seek relative to the end -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go deleted file mode 100644 index e5f005613b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build go1.7 - -package sdkio - -import "io" - -// Alias for Go 1.7 io package Seeker constants -const ( - SeekStart = io.SeekStart // seek relative to the origin of the file - SeekCurrent = io.SeekCurrent // seek relative to the current offset - SeekEnd = io.SeekEnd // seek relative to the end -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go deleted file mode 100644 index 44898eed0f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build go1.10 - -package sdkmath - -import "math" - -// Round returns the nearest integer, rounding half away from zero. -// -// Special cases are: -// Round(±0) = ±0 -// Round(±Inf) = ±Inf -// Round(NaN) = NaN -func Round(x float64) float64 { - return math.Round(x) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go deleted file mode 100644 index 810ec7f08b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build !go1.10 - -package sdkmath - -import "math" - -// Copied from the Go standard library's (Go 1.12) math/floor.go for use in -// Go version prior to Go 1.10. -const ( - uvone = 0x3FF0000000000000 - mask = 0x7FF - shift = 64 - 11 - 1 - bias = 1023 - signMask = 1 << 63 - fracMask = 1<= 0.5 { - // return t + Copysign(1, x) - // } - // return t - // } - bits := math.Float64bits(x) - e := uint(bits>>shift) & mask - if e < bias { - // Round abs(x) < 1 including denormals. - bits &= signMask // +-0 - if e == bias-1 { - bits |= uvone // +-1 - } - } else if e < bias+shift { - // Round any abs(x) >= 1 containing a fractional component [0,1). - // - // Numbers with larger exponents are returned unchanged since they - // must be either an integer, infinity, or NaN. - const half = 1 << (shift - 1) - e -= bias - bits += half >> e - bits &^= fracMask >> e - } - return math.Float64frombits(bits) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go deleted file mode 100644 index 0c9802d877..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go +++ /dev/null @@ -1,29 +0,0 @@ -package sdkrand - -import ( - "math/rand" - "sync" - "time" -) - -// lockedSource is a thread-safe implementation of rand.Source -type lockedSource struct { - lk sync.Mutex - src rand.Source -} - -func (r *lockedSource) Int63() (n int64) { - r.lk.Lock() - n = r.src.Int63() - r.lk.Unlock() - return -} - -func (r *lockedSource) Seed(seed int64) { - r.lk.Lock() - r.src.Seed(seed) - r.lk.Unlock() -} - -// SeededRand is a new RNG using a thread safe implementation of rand.Source -var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go deleted file mode 100644 index f4651da2da..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build go1.6 - -package sdkrand - -import "math/rand" - -// Read provides the stub for math.Rand.Read method support for go version's -// 1.6 and greater. -func Read(r *rand.Rand, p []byte) (int, error) { - return r.Read(p) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go deleted file mode 100644 index b1d93a33d4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build !go1.6 - -package sdkrand - -import "math/rand" - -// Read backfills Go 1.6's math.Rand.Reader for Go 1.5 -func Read(r *rand.Rand, p []byte) (n int, err error) { - // Copy of Go standard libraries math package's read function not added to - // standard library until Go 1.6. - var pos int8 - var val int64 - for n = 0; n < len(p); n++ { - if pos == 0 { - val = r.Int63() - pos = 7 - } - p[n] = byte(val) - val >>= 8 - pos-- - } - - return n, err -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go deleted file mode 100644 index 38ea61afea..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go +++ /dev/null @@ -1,23 +0,0 @@ -package sdkuri - -import ( - "path" - "strings" -) - -// PathJoin will join the elements of the path delimited by the "/" -// character. Similar to path.Join with the exception the trailing "/" -// character is preserved if present. -func PathJoin(elems ...string) string { - if len(elems) == 0 { - return "" - } - - hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/") - str := path.Join(elems...) - if hasTrailing && str != "/" { - str += "/" - } - - return str -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go deleted file mode 100644 index 7da8a49ce5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go +++ /dev/null @@ -1,12 +0,0 @@ -package shareddefaults - -const ( - // ECSCredsProviderEnvVar is an environmental variable key used to - // determine which path needs to be hit. - ECSCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" -) - -// ECSContainerCredentialsURI is the endpoint to retrieve container -// credentials. This can be overridden to test to ensure the credential process -// is behaving correctly. -var ECSContainerCredentialsURI = "http://169.254.170.2" diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go deleted file mode 100644 index ebcbc2b40a..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go +++ /dev/null @@ -1,40 +0,0 @@ -package shareddefaults - -import ( - "os" - "path/filepath" - "runtime" -) - -// SharedCredentialsFilename returns the SDK's default file path -// for the shared credentials file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/credentials -// - Windows: %USERPROFILE%\.aws\credentials -func SharedCredentialsFilename() string { - return filepath.Join(UserHomeDir(), ".aws", "credentials") -} - -// SharedConfigFilename returns the SDK's default file path for -// the shared config file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/config -// - Windows: %USERPROFILE%\.aws\config -func SharedConfigFilename() string { - return filepath.Join(UserHomeDir(), ".aws", "config") -} - -// UserHomeDir returns the home directory for the user the process is -// running under. -func UserHomeDir() string { - if runtime.GOOS == "windows" { // Windows - return os.Getenv("USERPROFILE") - } - - // *nix - return os.Getenv("HOME") -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go deleted file mode 100644 index d008ae27cb..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go +++ /dev/null @@ -1,11 +0,0 @@ -package strings - -import ( - "strings" -) - -// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings, -// under Unicode case-folding. -func HasPrefixFold(s, prefix string) bool { - return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/singleflight.go b/ibm/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/singleflight.go deleted file mode 100644 index 14ad0c5891..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/singleflight.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package singleflight provides a duplicate function call suppression -// mechanism. -package singleflight - -import "sync" - -// call is an in-flight or completed singleflight.Do call -type call struct { - wg sync.WaitGroup - - // These fields are written once before the WaitGroup is done - // and are only read after the WaitGroup is done. - val interface{} - err error - - // forgotten indicates whether Forget was called with this call's key - // while the call was still in flight. - forgotten bool - - // These fields are read and written with the singleflight - // mutex held before the WaitGroup is done, and are read but - // not written after the WaitGroup is done. - dups int - chans []chan<- Result -} - -// Group represents a class of work and forms a namespace in -// which units of work can be executed with duplicate suppression. -type Group struct { - mu sync.Mutex // protects m - m map[string]*call // lazily initialized -} - -// Result holds the results of Do, so they can be passed -// on a channel. -type Result struct { - Val interface{} - Err error - Shared bool -} - -// Do executes and returns the results of the given function, making -// sure that only one execution is in-flight for a given key at a -// time. If a duplicate comes in, the duplicate caller waits for the -// original to complete and receives the same results. -// The return value shared indicates whether v was given to multiple callers. -func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { - g.mu.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - g.mu.Unlock() - c.wg.Wait() - return c.val, c.err, true - } - c := new(call) - c.wg.Add(1) - g.m[key] = c - g.mu.Unlock() - - g.doCall(c, key, fn) - return c.val, c.err, c.dups > 0 -} - -// DoChan is like Do but returns a channel that will receive the -// results when they are ready. -func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { - ch := make(chan Result, 1) - g.mu.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - c.chans = append(c.chans, ch) - g.mu.Unlock() - return ch - } - c := &call{chans: []chan<- Result{ch}} - c.wg.Add(1) - g.m[key] = c - g.mu.Unlock() - - go g.doCall(c, key, fn) - - return ch -} - -// doCall handles the single call for a key. -func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { - c.val, c.err = fn() - c.wg.Done() - - g.mu.Lock() - if !c.forgotten { - delete(g.m, key) - } - for _, ch := range c.chans { - ch <- Result{c.val, c.err, c.dups > 0} - } - g.mu.Unlock() -} - -// Forget tells the singleflight to forget about a key. Future calls -// to Do for this key will call the function rather than waiting for -// an earlier call to complete. -func (g *Group) Forget(key string) { - g.mu.Lock() - if c, ok := g.m[key]; ok { - c.forgotten = true - } - delete(g.m, key) - g.mu.Unlock() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/checksum/content_md5.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/checksum/content_md5.go deleted file mode 100644 index e045f38d83..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go deleted file mode 100644 index 151054971a..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go deleted file mode 100644 index 4743393918..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go deleted file mode 100644 index ffade3bc0c..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go deleted file mode 100644 index 5481ef3079..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go deleted file mode 100644 index 34c2e89d53..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go +++ /dev/null @@ -1,77 +0,0 @@ -package eventstreamapi - -import ( - "fmt" - "sync" -) - -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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go deleted file mode 100644 index 0e4aa42f3e..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go deleted file mode 100644 index e46b8acc20..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go deleted file mode 100644 index 3a7ba5cd57..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go deleted file mode 100644 index 433bb1630a..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go deleted file mode 100644 index 10a3823dfa..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go +++ /dev/null @@ -1,109 +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 -} - -//type EventEncoder struct { -// encoder Encoder -// ppayloadMarshaler protocol.PayloadMarshaler -// eventTypeFor func(Marshaler) (string, error) -//} -// -//func (e EventEncoder) Encode(event Marshaler) error { -// msg, err := e.marshal(event) -// if err != nil { -// return err -// } -// -// return w.encoder.Encode(msg) -//} -// -//func (e EventEncoder) 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 -//} -// -//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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go deleted file mode 100644 index f6f8c5674e..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go deleted file mode 100644 index 9f509d8f6d..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go deleted file mode 100644 index f7427da039..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go deleted file mode 100644 index 1f1d27aea4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go +++ /dev/null @@ -1,104 +0,0 @@ -package protocol - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "net" - "strconv" - "strings" -) - -// ValidateEndpointHostHandler is a request handler that will validate the -// request endpoint's hosts is a valid RFC 3986 host. -var ValidateEndpointHostHandler = request.NamedHandler{ - Name: "awssdk.protocol.ValidateEndpointHostHandler", - Fn: func(r *request.Request) { - err := ValidateEndpointHost(r.Operation.Name, r.HTTPRequest.URL.Host) - if err != nil { - r.Error = err - } - }, -} - -// ValidateEndpointHost validates that the host string passed in is a valid RFC -// 3986 host. Returns error if the host is not valid. -func ValidateEndpointHost(opName, host string) error { - paramErrs := request.ErrInvalidParams{Context: opName} - - var hostname string - var port string - var err error - - if strings.Contains(host, ":") { - hostname, port, err = net.SplitHostPort(host) - - if err != nil { - paramErrs.Add(request.NewErrParamFormat("endpoint", err.Error(), host)) - } - - if !ValidPortNumber(port) { - paramErrs.Add(request.NewErrParamFormat("endpoint port number", "[0-65535]", port)) - } - } else { - hostname = host - } - - labels := strings.Split(hostname, ".") - for i, label := range labels { - if i == len(labels)-1 && len(label) == 0 { - // Allow trailing dot for FQDN hosts. - continue - } - - if !ValidHostLabel(label) { - paramErrs.Add(request.NewErrParamFormat( - "endpoint host label", "[a-zA-Z0-9-]{1,63}", label)) - } - } - - if len(hostname) == 0 { - paramErrs.Add(request.NewErrParamMinLen("endpoint host", 1)) - } - - if len(hostname) > 255 { - paramErrs.Add(request.NewErrParamMaxLen( - "endpoint host", 255, host, - )) - } - - if paramErrs.Len() > 0 { - return paramErrs - } - return nil -} - -// ValidHostLabel returns if the label is a valid RFC 3986 host label. -func ValidHostLabel(label string) bool { - if l := len(label); l == 0 || l > 63 { - return false - } - for _, r := range label { - switch { - case r >= '0' && r <= '9': - case r >= 'A' && r <= 'Z': - case r >= 'a' && r <= 'z': - case r == '-': - default: - return false - } - } - - return true -} - -// ValidPortNumber return if the port is valid RFC 3986 port -func ValidPortNumber(port string) bool { - i, err := strconv.Atoi(port) - if err != nil { - return false - } - - if i < 0 || i > 65535 { - return false - } - return true -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go deleted file mode 100644 index 915b0fcafd..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go +++ /dev/null @@ -1,54 +0,0 @@ -package protocol - -import ( - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// HostPrefixHandlerName is the handler name for the host prefix request -// handler. -const HostPrefixHandlerName = "awssdk.endpoint.HostPrefixHandler" - -// NewHostPrefixHandler constructs a build handler -func NewHostPrefixHandler(prefix string, labelsFn func() map[string]string) request.NamedHandler { - builder := HostPrefixBuilder{ - Prefix: prefix, - LabelsFn: labelsFn, - } - - return request.NamedHandler{ - Name: HostPrefixHandlerName, - Fn: builder.Build, - } -} - -// HostPrefixBuilder provides the request handler to expand and prepend -// the host prefix into the operation's request endpoint host. -type HostPrefixBuilder struct { - Prefix string - LabelsFn func() map[string]string -} - -// Build updates the passed in Request with the HostPrefix template expanded. -func (h HostPrefixBuilder) Build(r *request.Request) { - if aws.BoolValue(r.Config.DisableEndpointHostPrefix) { - return - } - - var labels map[string]string - if h.LabelsFn != nil { - labels = h.LabelsFn() - } - - prefix := h.Prefix - for name, value := range labels { - prefix = strings.Replace(prefix, "{"+name+"}", value, -1) - } - - r.HTTPRequest.URL.Host = prefix + r.HTTPRequest.URL.Host - if len(r.HTTPRequest.Host) > 0 { - r.HTTPRequest.Host = prefix + r.HTTPRequest.Host - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go deleted file mode 100644 index 53831dff98..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go +++ /dev/null @@ -1,75 +0,0 @@ -package protocol - -import ( - "crypto/rand" - "fmt" - "reflect" -) - -// RandReader is the random reader the protocol package will use to read -// random bytes from. This is exported for testing, and should not be used. -var RandReader = rand.Reader - -const idempotencyTokenFillTag = `idempotencyToken` - -// CanSetIdempotencyToken returns true if the struct field should be -// automatically populated with a Idempotency token. -// -// Only *string and string type fields that are tagged with idempotencyToken -// which are not already set can be auto filled. -func CanSetIdempotencyToken(v reflect.Value, f reflect.StructField) bool { - switch u := v.Interface().(type) { - // To auto fill an Idempotency token the field must be a string, - // tagged for auto fill, and have a zero value. - case *string: - return u == nil && len(f.Tag.Get(idempotencyTokenFillTag)) != 0 - case string: - return len(u) == 0 && len(f.Tag.Get(idempotencyTokenFillTag)) != 0 - } - - return false -} - -// GetIdempotencyToken returns a randomly generated idempotency token. -func GetIdempotencyToken() string { - b := make([]byte, 16) - RandReader.Read(b) - - return UUIDVersion4(b) -} - -// SetIdempotencyToken will set the value provided with a Idempotency Token. -// Given that the value can be set. Will panic if value is not setable. -func SetIdempotencyToken(v reflect.Value) { - if v.Kind() == reflect.Ptr { - if v.IsNil() && v.CanSet() { - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() - } - v = reflect.Indirect(v) - - if !v.CanSet() { - panic(fmt.Sprintf("unable to set idempotnecy token %v", v)) - } - - b := make([]byte, 16) - _, err := rand.Read(b) - if err != nil { - // TODO handle error - return - } - - v.Set(reflect.ValueOf(UUIDVersion4(b))) -} - -// UUIDVersion4 returns a Version 4 random UUID from the byte slice provided -func UUIDVersion4(u []byte) string { - // https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 - // 13th character is "4" - u[6] = (u[6] | 0x40) & 0x4F - // 17th character is "8", "9", "a", or "b" - u[8] = (u[8] | 0x80) & 0xBF - - return fmt.Sprintf(`%X-%X-%X-%X-%X`, u[0:4], u[4:6], u[6:8], u[8:10], u[10:]) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go deleted file mode 100644 index 864fb6704b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go +++ /dev/null @@ -1,296 +0,0 @@ -// Package jsonutil provides JSON serialization of AWS requests and responses. -package jsonutil - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "math" - "reflect" - "sort" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/private/protocol" -) - -var timeType = reflect.ValueOf(time.Time{}).Type() -var byteSliceType = reflect.ValueOf([]byte{}).Type() - -// BuildJSON builds a JSON string for a given object v. -func BuildJSON(v interface{}) ([]byte, error) { - var buf bytes.Buffer - - err := buildAny(reflect.ValueOf(v), &buf, "") - return buf.Bytes(), err -} - -func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - origVal := value - value = reflect.Indirect(value) - if !value.IsValid() { - return nil - } - - vtype := value.Type() - - t := tag.Get("type") - if t == "" { - switch vtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if value.Type() != timeType { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := value.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - // cannot be a JSONValue map - if _, ok := value.Interface().(aws.JSONValue); !ok { - t = "map" - } - } - } - - switch t { - case "structure": - if field, ok := vtype.FieldByName("_"); ok { - tag = field.Tag - } - return buildStruct(value, buf, tag) - case "list": - return buildList(value, buf, tag) - case "map": - return buildMap(value, buf, tag) - default: - return buildScalar(origVal, buf, tag) - } -} - -func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - if !value.IsValid() { - return nil - } - - // unwrap payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := value.Type().FieldByName(payload) - tag = field.Tag - value = elemOf(value.FieldByName(payload)) - - if !value.IsValid() { - return nil - } - } - - buf.WriteByte('{') - - t := value.Type() - first := true - for i := 0; i < t.NumField(); i++ { - member := value.Field(i) - - // This allocates the most memory. - // Additionally, we cannot skip nil fields due to - // idempotency auto filling. - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("json") == "-" { - continue - } - if field.Tag.Get("location") != "" { - continue // ignore non-body elements - } - if field.Tag.Get("ignore") != "" { - continue - } - - if protocol.CanSetIdempotencyToken(member, field) { - token := protocol.GetIdempotencyToken() - member = reflect.ValueOf(&token) - } - - if (member.Kind() == reflect.Ptr || member.Kind() == reflect.Slice || member.Kind() == reflect.Map) && member.IsNil() { - continue // ignore unset fields - } - - if first { - first = false - } else { - buf.WriteByte(',') - } - - // figure out what this field is called - name := field.Name - if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - writeString(name, buf) - buf.WriteString(`:`) - - err := buildAny(member, buf, field.Tag) - if err != nil { - return err - } - - } - - buf.WriteString("}") - - return nil -} - -func buildList(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - buf.WriteString("[") - - for i := 0; i < value.Len(); i++ { - buildAny(value.Index(i), buf, "") - - if i < value.Len()-1 { - buf.WriteString(",") - } - } - - buf.WriteString("]") - - return nil -} - -type sortedValues []reflect.Value - -func (sv sortedValues) Len() int { return len(sv) } -func (sv sortedValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv sortedValues) Less(i, j int) bool { return sv[i].String() < sv[j].String() } - -func buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - buf.WriteString("{") - - sv := sortedValues(value.MapKeys()) - sort.Sort(sv) - - for i, k := range sv { - if i > 0 { - buf.WriteByte(',') - } - - writeString(k.String(), buf) - buf.WriteString(`:`) - - buildAny(value.MapIndex(k), buf, "") - } - - buf.WriteString("}") - - return nil -} - -func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - // prevents allocation on the heap. - scratch := [64]byte{} - switch value := reflect.Indirect(v); value.Kind() { - case reflect.String: - writeString(value.String(), buf) - case reflect.Bool: - if value.Bool() { - buf.WriteString("true") - } else { - buf.WriteString("false") - } - case reflect.Int64: - buf.Write(strconv.AppendInt(scratch[:0], value.Int(), 10)) - case reflect.Float64: - f := value.Float() - if math.IsInf(f, 0) || math.IsNaN(f) { - return &json.UnsupportedValueError{Value: v, Str: strconv.FormatFloat(f, 'f', -1, 64)} - } - buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64)) - default: - switch converted := value.Interface().(type) { - case time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.UnixTimeFormatName - } - - ts := protocol.FormatTime(format, converted) - if format != protocol.UnixTimeFormatName { - ts = `"` + ts + `"` - } - - buf.WriteString(ts) - case []byte: - if !value.IsNil() { - buf.WriteByte('"') - if len(converted) < 1024 { - // for small buffers, using Encode directly is much faster. - dst := make([]byte, base64.StdEncoding.EncodedLen(len(converted))) - base64.StdEncoding.Encode(dst, converted) - buf.Write(dst) - } else { - // for large buffers, avoid unnecessary extra temporary - // buffer space. - enc := base64.NewEncoder(base64.StdEncoding, buf) - enc.Write(converted) - enc.Close() - } - buf.WriteByte('"') - } - case aws.JSONValue: - str, err := protocol.EncodeJSONValue(converted, protocol.QuotedEscape) - if err != nil { - return fmt.Errorf("unable to encode JSONValue, %v", err) - } - buf.WriteString(str) - default: - return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type()) - } - } - return nil -} - -var hex = "0123456789abcdef" - -func writeString(s string, buf *bytes.Buffer) { - buf.WriteByte('"') - for i := 0; i < len(s); i++ { - if s[i] == '"' { - buf.WriteString(`\"`) - } else if s[i] == '\\' { - buf.WriteString(`\\`) - } else if s[i] == '\b' { - buf.WriteString(`\b`) - } else if s[i] == '\f' { - buf.WriteString(`\f`) - } else if s[i] == '\r' { - buf.WriteString(`\r`) - } else if s[i] == '\t' { - buf.WriteString(`\t`) - } else if s[i] == '\n' { - buf.WriteString(`\n`) - } else if s[i] < 32 { - buf.WriteString("\\u00") - buf.WriteByte(hex[s[i]>>4]) - buf.WriteByte(hex[s[i]&0xF]) - } else { - buf.WriteByte(s[i]) - } - } - buf.WriteByte('"') -} - -// Returns the reflection element of a value, if it is a pointer. -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go deleted file mode 100644 index 8b2c9bbeba..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go +++ /dev/null @@ -1,304 +0,0 @@ -package jsonutil - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "math/big" - "reflect" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/protocol" -) - -var millisecondsFloat = new(big.Float).SetInt64(1e3) - -// UnmarshalJSONError unmarshal's the reader's JSON document into the passed in -// type. The value to unmarshal the json document into must be a pointer to the -// type. -func UnmarshalJSONError(v interface{}, stream io.Reader) error { - var errBuf bytes.Buffer - body := io.TeeReader(stream, &errBuf) - - err := json.NewDecoder(body).Decode(v) - if err != nil { - msg := "failed decoding error message" - if err == io.EOF { - msg = "error message missing" - err = nil - } - return awserr.NewUnmarshalError(err, msg, errBuf.Bytes()) - } - - return nil -} - -// UnmarshalJSON reads a stream and unmarshals the results in object v. -func UnmarshalJSON(v interface{}, stream io.Reader) error { - var out interface{} - - decoder := json.NewDecoder(stream) - decoder.UseNumber() - err := decoder.Decode(&out) - if err == io.EOF { - return nil - } else if err != nil { - return err - } - - return unmarshaler{}.unmarshalAny(reflect.ValueOf(v), out, "") -} - -// UnmarshalJSONCaseInsensitive reads a stream and unmarshals the result into the -// object v. Ignores casing for structure members. -func UnmarshalJSONCaseInsensitive(v interface{}, stream io.Reader) error { - var out interface{} - - decoder := json.NewDecoder(stream) - decoder.UseNumber() - err := decoder.Decode(&out) - if err == io.EOF { - return nil - } else if err != nil { - return err - } - - return unmarshaler{ - caseInsensitive: true, - }.unmarshalAny(reflect.ValueOf(v), out, "") -} - -type unmarshaler struct { - caseInsensitive bool -} - -func (u unmarshaler) unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) error { - vtype := value.Type() - if vtype.Kind() == reflect.Ptr { - vtype = vtype.Elem() // check kind of actual element type - } - - t := tag.Get("type") - if t == "" { - switch vtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if _, ok := value.Interface().(*time.Time); !ok { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := value.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - // cannot be a JSONValue map - if _, ok := value.Interface().(aws.JSONValue); !ok { - t = "map" - } - } - } - - switch t { - case "structure": - if field, ok := vtype.FieldByName("_"); ok { - tag = field.Tag - } - return u.unmarshalStruct(value, data, tag) - case "list": - return u.unmarshalList(value, data, tag) - case "map": - return u.unmarshalMap(value, data, tag) - default: - return u.unmarshalScalar(value, data, tag) - } -} - -func (u unmarshaler) unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - mapData, ok := data.(map[string]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a structure (%#v)", data) - } - - t := value.Type() - if value.Kind() == reflect.Ptr { - if value.IsNil() { // create the structure if it's nil - s := reflect.New(value.Type().Elem()) - value.Set(s) - value = s - } - - value = value.Elem() - t = t.Elem() - } - - // unwrap any payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := t.FieldByName(payload) - return u.unmarshalAny(value.FieldByName(payload), data, field.Tag) - } - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - if field.PkgPath != "" { - continue // ignore unexported fields - } - - // figure out what this field is called - name := field.Name - if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - if u.caseInsensitive { - if _, ok := mapData[name]; !ok { - // Fallback to uncased name search if the exact name didn't match. - for kn, v := range mapData { - if strings.EqualFold(kn, name) { - mapData[name] = v - } - } - } - } - - member := value.FieldByIndex(field.Index) - err := u.unmarshalAny(member, mapData[name], field.Tag) - if err != nil { - return err - } - } - return nil -} - -func (u unmarshaler) unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - listData, ok := data.([]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a list (%#v)", data) - } - - if value.IsNil() { - l := len(listData) - value.Set(reflect.MakeSlice(value.Type(), l, l)) - } - - for i, c := range listData { - err := u.unmarshalAny(value.Index(i), c, "") - if err != nil { - return err - } - } - - return nil -} - -func (u unmarshaler) unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - mapData, ok := data.(map[string]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a map (%#v)", data) - } - - if value.IsNil() { - value.Set(reflect.MakeMap(value.Type())) - } - - for k, v := range mapData { - kvalue := reflect.ValueOf(k) - vvalue := reflect.New(value.Type().Elem()).Elem() - - u.unmarshalAny(vvalue, v, "") - value.SetMapIndex(kvalue, vvalue) - } - - return nil -} - -func (u unmarshaler) unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error { - - switch d := data.(type) { - case nil: - return nil // nothing to do here - case string: - switch value.Interface().(type) { - case *string: - value.Set(reflect.ValueOf(&d)) - case []byte: - b, err := base64.StdEncoding.DecodeString(d) - if err != nil { - return err - } - value.Set(reflect.ValueOf(b)) - case *time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - t, err := protocol.ParseTime(format, d) - if err != nil { - return err - } - value.Set(reflect.ValueOf(&t)) - case aws.JSONValue: - // No need to use escaping as the value is a non-quoted string. - v, err := protocol.DecodeJSONValue(d, protocol.NoEscape) - if err != nil { - return err - } - value.Set(reflect.ValueOf(v)) - default: - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } - case json.Number: - switch value.Interface().(type) { - case *int64: - // Retain the old behavior where we would just truncate the float64 - // calling d.Int64() here could cause an invalid syntax error due to the usage of strconv.ParseInt - f, err := d.Float64() - if err != nil { - return err - } - di := int64(f) - value.Set(reflect.ValueOf(&di)) - case *float64: - f, err := d.Float64() - if err != nil { - return err - } - value.Set(reflect.ValueOf(&f)) - case *time.Time: - float, ok := new(big.Float).SetString(d.String()) - if !ok { - return fmt.Errorf("unsupported float time representation: %v", d.String()) - } - float = float.Mul(float, millisecondsFloat) - ms, _ := float.Int64() - t := time.Unix(0, ms*1e6).UTC() - value.Set(reflect.ValueOf(&t)) - default: - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } - case bool: - switch value.Interface().(type) { - case *bool: - value.Set(reflect.ValueOf(&d)) - default: - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } - default: - return fmt.Errorf("unsupported JSON value (%v)", data) - } - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go deleted file mode 100644 index a029217e4c..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go +++ /dev/null @@ -1,88 +0,0 @@ -// Package jsonrpc provides JSON RPC utilities for serialization of AWS -// requests and responses. -package jsonrpc - -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/json.json build_test.go -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/json.json unmarshal_test.go - -import ( - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -var emptyJSON = []byte("{}") - -// BuildHandler is a named request handler for building jsonrpc protocol -// requests -var BuildHandler = request.NamedHandler{ - Name: "awssdk.jsonrpc.Build", - Fn: Build, -} - -// UnmarshalHandler is a named request handler for unmarshaling jsonrpc -// protocol requests -var UnmarshalHandler = request.NamedHandler{ - Name: "awssdk.jsonrpc.Unmarshal", - Fn: Unmarshal, -} - -// UnmarshalMetaHandler is a named request handler for unmarshaling jsonrpc -// protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{ - Name: "awssdk.jsonrpc.UnmarshalMeta", - Fn: UnmarshalMeta, -} - -// Build builds a JSON payload for a JSON RPC request. -func Build(req *request.Request) { - var buf []byte - var err error - if req.ParamsFilled() { - buf, err = jsonutil.BuildJSON(req.Params) - if err != nil { - req.Error = awserr.New(request.ErrCodeSerialization, "failed encoding JSON RPC request", err) - return - } - } else { - buf = emptyJSON - } - - if req.ClientInfo.TargetPrefix != "" || string(buf) != "{}" { - req.SetBufferBody(buf) - } - - if req.ClientInfo.TargetPrefix != "" { - target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name - req.HTTPRequest.Header.Add("X-Amz-Target", target) - } - - // Only set the content type if one is not already specified and an - // JSONVersion is specified. - if ct, v := req.HTTPRequest.Header.Get("Content-Type"), req.ClientInfo.JSONVersion; len(ct) == 0 && len(v) != 0 { - jsonVersion := req.ClientInfo.JSONVersion - req.HTTPRequest.Header.Set("Content-Type", "application/x-amz-json-"+jsonVersion) - } -} - -// Unmarshal unmarshals a response for a JSON RPC service. -func Unmarshal(req *request.Request) { - defer req.HTTPResponse.Body.Close() - if req.DataFilled() { - err := jsonutil.UnmarshalJSON(req.Data, req.HTTPResponse.Body) - if err != nil { - req.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "failed decoding JSON RPC response", err), - req.HTTPResponse.StatusCode, - req.RequestID, - ) - } - } - return -} - -// UnmarshalMeta unmarshals headers from a response for a JSON RPC service. -func UnmarshalMeta(req *request.Request) { - rest.UnmarshalMeta(req) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go deleted file mode 100644 index c0c52e2db0..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go +++ /dev/null @@ -1,107 +0,0 @@ -package jsonrpc - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" -) - -// UnmarshalTypedError provides unmarshaling errors API response errors -// for both typed and untyped errors. -type UnmarshalTypedError struct { - exceptions map[string]func(protocol.ResponseMetadata) error -} - -// NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the -// set of exception names to the error unmarshalers -func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError { - return &UnmarshalTypedError{ - exceptions: exceptions, - } -} - -// UnmarshalError attempts to unmarshal the HTTP response error as a known -// error type. If unable to unmarshal the error type, the generic SDK error -// type will be used. -func (u *UnmarshalTypedError) UnmarshalError( - resp *http.Response, - respMeta protocol.ResponseMetadata, -) (error, error) { - - var buf bytes.Buffer - var jsonErr jsonErrorResponse - teeReader := io.TeeReader(resp.Body, &buf) - err := jsonutil.UnmarshalJSONError(&jsonErr, teeReader) - if err != nil { - return nil, err - } - body := ioutil.NopCloser(&buf) - - // Code may be separated by hash(#), with the last element being the code - // used by the SDK. - codeParts := strings.SplitN(jsonErr.Code, "#", 2) - code := codeParts[len(codeParts)-1] - msg := jsonErr.Message - - if fn, ok := u.exceptions[code]; ok { - // If exception code is know, use associated constructor to get a value - // for the exception that the JSON body can be unmarshaled into. - v := fn(respMeta) - err := jsonutil.UnmarshalJSONCaseInsensitive(v, body) - if err != nil { - return nil, err - } - - return v, nil - } - - // fallback to unmodeled generic exceptions - return awserr.NewRequestFailure( - awserr.New(code, msg, nil), - respMeta.StatusCode, - respMeta.RequestID, - ), nil -} - -// UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc -// protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{ - Name: "awssdk.jsonrpc.UnmarshalError", - Fn: UnmarshalError, -} - -// UnmarshalError unmarshals an error response for a JSON RPC service. -func UnmarshalError(req *request.Request) { - defer req.HTTPResponse.Body.Close() - - var jsonErr jsonErrorResponse - err := jsonutil.UnmarshalJSONError(&jsonErr, req.HTTPResponse.Body) - if err != nil { - req.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to unmarshal error message", err), - req.HTTPResponse.StatusCode, - req.RequestID, - ) - return - } - - codes := strings.SplitN(jsonErr.Code, "#", 2) - req.Error = awserr.NewRequestFailure( - awserr.New(codes[len(codes)-1], jsonErr.Message, nil), - req.HTTPResponse.StatusCode, - req.RequestID, - ) -} - -type jsonErrorResponse struct { - Code string `json:"__type"` - Message string `json:"message"` -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go deleted file mode 100644 index 776d110184..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go +++ /dev/null @@ -1,76 +0,0 @@ -package protocol - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "strconv" - - "github.com/aws/aws-sdk-go/aws" -) - -// EscapeMode is the mode that should be use for escaping a value -type EscapeMode uint - -// The modes for escaping a value before it is marshaled, and unmarshaled. -const ( - NoEscape EscapeMode = iota - Base64Escape - QuotedEscape -) - -// EncodeJSONValue marshals the value into a JSON string, and optionally base64 -// encodes the string before returning it. -// -// Will panic if the escape mode is unknown. -func EncodeJSONValue(v aws.JSONValue, escape EscapeMode) (string, error) { - b, err := json.Marshal(v) - if err != nil { - return "", err - } - - switch escape { - case NoEscape: - return string(b), nil - case Base64Escape: - return base64.StdEncoding.EncodeToString(b), nil - case QuotedEscape: - return strconv.Quote(string(b)), nil - } - - panic(fmt.Sprintf("EncodeJSONValue called with unknown EscapeMode, %v", escape)) -} - -// DecodeJSONValue will attempt to decode the string input as a JSONValue. -// Optionally decoding base64 the value first before JSON unmarshaling. -// -// Will panic if the escape mode is unknown. -func DecodeJSONValue(v string, escape EscapeMode) (aws.JSONValue, error) { - var b []byte - var err error - - switch escape { - case NoEscape: - b = []byte(v) - case Base64Escape: - b, err = base64.StdEncoding.DecodeString(v) - case QuotedEscape: - var u string - u, err = strconv.Unquote(v) - b = []byte(u) - default: - panic(fmt.Sprintf("DecodeJSONValue called with unknown EscapeMode, %v", escape)) - } - - if err != nil { - return nil, err - } - - m := aws.JSONValue{} - err = json.Unmarshal(b, &m) - if err != nil { - return nil, err - } - - return m, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go deleted file mode 100644 index 0ea0647a57..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go +++ /dev/null @@ -1,81 +0,0 @@ -package protocol - -import ( - "io" - "io/ioutil" - "net/http" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" -) - -// PayloadUnmarshaler provides the interface for unmarshaling a payload's -// reader into a SDK shape. -type PayloadUnmarshaler interface { - UnmarshalPayload(io.Reader, interface{}) error -} - -// HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a -// HandlerList. This provides the support for unmarshaling a payload reader to -// a shape without needing a SDK request first. -type HandlerPayloadUnmarshal struct { - Unmarshalers request.HandlerList -} - -// UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using -// the Unmarshalers HandlerList provided. Returns an error if unable -// unmarshaling fails. -func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error { - req := &request.Request{ - HTTPRequest: &http.Request{}, - HTTPResponse: &http.Response{ - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(r), - }, - Data: v, - } - - h.Unmarshalers.Run(req) - - return req.Error -} - -// PayloadMarshaler provides the interface for marshaling a SDK shape into and -// io.Writer. -type PayloadMarshaler interface { - MarshalPayload(io.Writer, interface{}) error -} - -// HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList. -// This provides support for marshaling a SDK shape into an io.Writer without -// needing a SDK request first. -type HandlerPayloadMarshal struct { - Marshalers request.HandlerList -} - -// MarshalPayload marshals the SDK shape into the io.Writer using the -// Marshalers HandlerList provided. Returns an error if unable if marshal -// fails. -func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error { - req := request.New( - aws.Config{}, - metadata.ClientInfo{}, - request.Handlers{}, - nil, - &request.Operation{HTTPMethod: "PUT"}, - v, - nil, - ) - - h.Marshalers.Run(req) - - if req.Error != nil { - return req.Error - } - - io.Copy(w, req.GetBody()) - - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol.go deleted file mode 100644 index 9d521dcb95..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol.go +++ /dev/null @@ -1,49 +0,0 @@ -package protocol - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -// RequireHTTPMinProtocol request handler is used to enforce that -// the target endpoint supports the given major and minor HTTP protocol version. -type RequireHTTPMinProtocol struct { - Major, Minor int -} - -// Handler will mark the request.Request with an error if the -// target endpoint did not connect with the required HTTP protocol -// major and minor version. -func (p RequireHTTPMinProtocol) Handler(r *request.Request) { - if r.Error != nil || r.HTTPResponse == nil { - return - } - - if !strings.HasPrefix(r.HTTPResponse.Proto, "HTTP") { - r.Error = newMinHTTPProtoError(p.Major, p.Minor, r) - } - - if r.HTTPResponse.ProtoMajor < p.Major || r.HTTPResponse.ProtoMinor < p.Minor { - r.Error = newMinHTTPProtoError(p.Major, p.Minor, r) - } -} - -// ErrCodeMinimumHTTPProtocolError error code is returned when the target endpoint -// did not match the required HTTP major and minor protocol version. -const ErrCodeMinimumHTTPProtocolError = "MinimumHTTPProtocolError" - -func newMinHTTPProtoError(major, minor int, r *request.Request) error { - return awserr.NewRequestFailure( - awserr.New("MinimumHTTPProtocolError", - fmt.Sprintf( - "operation requires minimum HTTP protocol of HTTP/%d.%d, but was %s", - major, minor, r.HTTPResponse.Proto, - ), - nil, - ), - r.HTTPResponse.StatusCode, r.RequestID, - ) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go deleted file mode 100644 index d40346a779..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go +++ /dev/null @@ -1,36 +0,0 @@ -// Package query provides serialization of AWS query requests, and responses. -package query - -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/query.json build_test.go - -import ( - "net/url" - - "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/queryutil" -) - -// BuildHandler is a named request handler for building query protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.query.Build", Fn: Build} - -// Build builds a request for an AWS Query service. -func Build(r *request.Request) { - body := url.Values{ - "Action": {r.Operation.Name}, - "Version": {r.ClientInfo.APIVersion}, - } - if err := queryutil.Parse(body, r.Params, false); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "failed encoding Query request", err) - return - } - - if !r.IsPresigned() { - r.HTTPRequest.Method = "POST" - r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") - r.SetBufferBody([]byte(body.Encode())) - } else { // This is a pre-signed request - r.HTTPRequest.Method = "GET" - r.HTTPRequest.URL.RawQuery = body.Encode() - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go deleted file mode 100644 index 75866d0121..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go +++ /dev/null @@ -1,246 +0,0 @@ -package queryutil - -import ( - "encoding/base64" - "fmt" - "net/url" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/private/protocol" -) - -// Parse parses an object i and fills a url.Values object. The isEC2 flag -// indicates if this is the EC2 Query sub-protocol. -func Parse(body url.Values, i interface{}, isEC2 bool) error { - q := queryParser{isEC2: isEC2} - return q.parseValue(body, reflect.ValueOf(i), "", "") -} - -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} - -type queryParser struct { - isEC2 bool -} - -func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { - value = elemOf(value) - - // no need to handle zero values - if !value.IsValid() { - return nil - } - - t := tag.Get("type") - if t == "" { - switch value.Kind() { - case reflect.Struct: - t = "structure" - case reflect.Slice: - t = "list" - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - return q.parseStruct(v, value, prefix) - case "list": - return q.parseList(v, value, prefix, tag) - case "map": - return q.parseMap(v, value, prefix, tag) - default: - return q.parseScalar(v, value, prefix, tag) - } -} - -func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error { - if !value.IsValid() { - return nil - } - - t := value.Type() - for i := 0; i < value.NumField(); i++ { - elemValue := elemOf(value.Field(i)) - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("ignore") != "" { - continue - } - - if protocol.CanSetIdempotencyToken(value.Field(i), field) { - token := protocol.GetIdempotencyToken() - elemValue = reflect.ValueOf(token) - } - - var name string - if q.isEC2 { - name = field.Tag.Get("queryName") - } - if name == "" { - if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { - name = field.Tag.Get("locationNameList") - } else if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - if name != "" && q.isEC2 { - name = strings.ToUpper(name[0:1]) + name[1:] - } - } - if name == "" { - name = field.Name - } - - if prefix != "" { - name = prefix + "." + name - } - - if err := q.parseValue(v, elemValue, name, field.Tag); err != nil { - return err - } - } - return nil -} - -func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { - // If it's empty, generate an empty value - if !value.IsNil() && value.Len() == 0 { - v.Set(prefix, "") - return nil - } - - if _, ok := value.Interface().([]byte); ok { - return q.parseScalar(v, value, prefix, tag) - } - - // check for unflattened list member - if !q.isEC2 && tag.Get("flattened") == "" { - if listName := tag.Get("locationNameList"); listName == "" { - prefix += ".member" - } else { - prefix += "." + listName - } - } - - for i := 0; i < value.Len(); i++ { - slicePrefix := prefix - if slicePrefix == "" { - slicePrefix = strconv.Itoa(i + 1) - } else { - slicePrefix = slicePrefix + "." + strconv.Itoa(i+1) - } - if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil { - return err - } - } - return nil -} - -func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { - // If it's empty, generate an empty value - if !value.IsNil() && value.Len() == 0 { - v.Set(prefix, "") - return nil - } - - // check for unflattened list member - if !q.isEC2 && tag.Get("flattened") == "" { - prefix += ".entry" - } - - // sort keys for improved serialization consistency. - // this is not strictly necessary for protocol support. - mapKeyValues := value.MapKeys() - mapKeys := map[string]reflect.Value{} - mapKeyNames := make([]string, len(mapKeyValues)) - for i, mapKey := range mapKeyValues { - name := mapKey.String() - mapKeys[name] = mapKey - mapKeyNames[i] = name - } - sort.Strings(mapKeyNames) - - for i, mapKeyName := range mapKeyNames { - mapKey := mapKeys[mapKeyName] - mapValue := value.MapIndex(mapKey) - - kname := tag.Get("locationNameKey") - if kname == "" { - kname = "key" - } - vname := tag.Get("locationNameValue") - if vname == "" { - vname = "value" - } - - // serialize key - var keyName string - if prefix == "" { - keyName = strconv.Itoa(i+1) + "." + kname - } else { - keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname - } - - if err := q.parseValue(v, mapKey, keyName, ""); err != nil { - return err - } - - // serialize value - var valueName string - if prefix == "" { - valueName = strconv.Itoa(i+1) + "." + vname - } else { - valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname - } - - if err := q.parseValue(v, mapValue, valueName, ""); err != nil { - return err - } - } - - return nil -} - -func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error { - switch value := r.Interface().(type) { - case string: - v.Set(name, value) - case []byte: - if !r.IsNil() { - v.Set(name, base64.StdEncoding.EncodeToString(value)) - } - case bool: - v.Set(name, strconv.FormatBool(value)) - case int64: - v.Set(name, strconv.FormatInt(value, 10)) - case int: - v.Set(name, strconv.Itoa(value)) - case float64: - v.Set(name, strconv.FormatFloat(value, 'f', -1, 64)) - case float32: - v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32)) - case time.Time: - const ISO8601UTC = "2006-01-02T15:04:05Z" - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - v.Set(name, protocol.FormatTime(format, value)) - default: - return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name()) - } - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go deleted file mode 100644 index 9231e95d16..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go +++ /dev/null @@ -1,39 +0,0 @@ -package query - -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/query.json unmarshal_test.go - -import ( - "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/xml/xmlutil" -) - -// UnmarshalHandler is a named request handler for unmarshaling query protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.query.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling query protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalMeta", Fn: UnmarshalMeta} - -// Unmarshal unmarshals a response for an AWS Query service. -func Unmarshal(r *request.Request) { - defer r.HTTPResponse.Body.Close() - if r.DataFilled() { - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "failed decoding Query response", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - } -} - -// UnmarshalMeta unmarshals header response values for an AWS Query service. -func UnmarshalMeta(r *request.Request) { - r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go deleted file mode 100644 index 831b0110c5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go +++ /dev/null @@ -1,69 +0,0 @@ -package query - -import ( - "encoding/xml" - "fmt" - - "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" -) - -// UnmarshalErrorHandler is a name request handler to unmarshal request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError} - -type xmlErrorResponse struct { - Code string `xml:"Error>Code"` - Message string `xml:"Error>Message"` - RequestID string `xml:"RequestId"` -} - -type xmlResponseError struct { - xmlErrorResponse -} - -func (e *xmlResponseError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - const svcUnavailableTagName = "ServiceUnavailableException" - const errorResponseTagName = "ErrorResponse" - - switch start.Name.Local { - case svcUnavailableTagName: - e.Code = svcUnavailableTagName - e.Message = "service is unavailable" - return d.Skip() - - case errorResponseTagName: - return d.DecodeElement(&e.xmlErrorResponse, &start) - - default: - return fmt.Errorf("unknown error response tag, %v", start) - } -} - -// UnmarshalError unmarshals an error response for an AWS Query service. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - var respErr xmlResponseError - err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to unmarshal error message", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - reqID := respErr.RequestID - if len(reqID) == 0 { - reqID = r.RequestID - } - - r.Error = awserr.NewRequestFailure( - awserr.New(respErr.Code, respErr.Message, nil), - r.HTTPResponse.StatusCode, - reqID, - ) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go deleted file mode 100644 index 1301b149d3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go +++ /dev/null @@ -1,310 +0,0 @@ -// Package rest provides RESTful serialization of AWS requests and responses. -package rest - -import ( - "bytes" - "encoding/base64" - "fmt" - "io" - "net/http" - "net/url" - "path" - "reflect" - "strconv" - "strings" - "time" - - "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" -) - -// Whether the byte value can be sent without escaping in AWS URLs -var noEscape [256]bool - -var errValueNotSet = fmt.Errorf("value not set") - -var byteSliceType = reflect.TypeOf([]byte{}) - -func init() { - for i := 0; i < len(noEscape); i++ { - // AWS expects every character except these to be escaped - noEscape[i] = (i >= 'A' && i <= 'Z') || - (i >= 'a' && i <= 'z') || - (i >= '0' && i <= '9') || - i == '-' || - i == '.' || - i == '_' || - i == '~' - } -} - -// BuildHandler is a named request handler for building rest protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.rest.Build", Fn: Build} - -// Build builds the REST component of a service request. -func Build(r *request.Request) { - if r.ParamsFilled() { - v := reflect.ValueOf(r.Params).Elem() - buildLocationElements(r, v, false) - buildBody(r, v) - } -} - -// BuildAsGET builds the REST component of a service request with the ability to hoist -// data from the body. -func BuildAsGET(r *request.Request) { - if r.ParamsFilled() { - v := reflect.ValueOf(r.Params).Elem() - buildLocationElements(r, v, true) - buildBody(r, v) - } -} - -func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bool) { - query := r.HTTPRequest.URL.Query() - - // Setup the raw path to match the base path pattern. This is needed - // so that when the path is mutated a custom escaped version can be - // stored in RawPath that will be used by the Go client. - r.HTTPRequest.URL.RawPath = r.HTTPRequest.URL.Path - - for i := 0; i < v.NumField(); i++ { - m := v.Field(i) - if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) { - continue - } - - if m.IsValid() { - field := v.Type().Field(i) - name := field.Tag.Get("locationName") - if name == "" { - name = field.Name - } - if kind := m.Kind(); kind == reflect.Ptr { - m = m.Elem() - } else if kind == reflect.Interface { - if !m.Elem().IsValid() { - continue - } - } - if !m.IsValid() { - continue - } - if field.Tag.Get("ignore") != "" { - continue - } - - // Support the ability to customize values to be marshaled as a - // blob even though they were modeled as a string. Required for S3 - // API operations like SSECustomerKey is modeled as stirng but - // required to be base64 encoded in request. - if field.Tag.Get("marshal-as") == "blob" { - m = m.Convert(byteSliceType) - } - - var err error - switch field.Tag.Get("location") { - case "headers": // header maps - err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag) - case "header": - err = buildHeader(&r.HTTPRequest.Header, m, name, field.Tag) - case "uri": - err = buildURI(r.HTTPRequest.URL, m, name, field.Tag) - case "querystring": - err = buildQueryString(query, m, name, field.Tag) - default: - if buildGETQuery { - err = buildQueryString(query, m, name, field.Tag) - } - } - r.Error = err - } - if r.Error != nil { - return - } - } - - r.HTTPRequest.URL.RawQuery = query.Encode() - if !aws.BoolValue(r.Config.DisableRestProtocolURICleaning) { - cleanPath(r.HTTPRequest.URL) - } -} - -func buildBody(r *request.Request, v reflect.Value) { - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - pfield, _ := v.Type().FieldByName(payloadName) - if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { - payload := reflect.Indirect(v.FieldByName(payloadName)) - if payload.IsValid() && payload.Interface() != nil { - switch reader := payload.Interface().(type) { - case io.ReadSeeker: - r.SetReaderBody(reader) - case []byte: - r.SetBufferBody(reader) - case string: - r.SetStringBody(reader) - default: - r.Error = awserr.New(request.ErrCodeSerialization, - "failed to encode REST request", - fmt.Errorf("unknown payload type %s", payload.Type())) - } - } - } - } - } -} - -func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.StructTag) error { - str, err := convertType(v, tag) - if err == errValueNotSet { - return nil - } else if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - } - - name = strings.TrimSpace(name) - str = strings.TrimSpace(str) - - header.Add(name, str) - - return nil -} - -func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) error { - prefix := tag.Get("locationName") - for _, key := range v.MapKeys() { - str, err := convertType(v.MapIndex(key), tag) - if err == errValueNotSet { - continue - } else if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - - } - keyStr := strings.TrimSpace(key.String()) - str = strings.TrimSpace(str) - - header.Add(prefix+keyStr, str) - } - return nil -} - -func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) error { - value, err := convertType(v, tag) - if err == errValueNotSet { - return nil - } else if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - } - - u.Path = strings.Replace(u.Path, "{"+name+"}", value, -1) - u.Path = strings.Replace(u.Path, "{"+name+"+}", value, -1) - - u.RawPath = strings.Replace(u.RawPath, "{"+name+"}", EscapePath(value, true), -1) - u.RawPath = strings.Replace(u.RawPath, "{"+name+"+}", EscapePath(value, false), -1) - - return nil -} - -func buildQueryString(query url.Values, v reflect.Value, name string, tag reflect.StructTag) error { - switch value := v.Interface().(type) { - case []*string: - for _, item := range value { - query.Add(name, *item) - } - case map[string]*string: - for key, item := range value { - query.Add(key, *item) - } - case map[string][]*string: - for key, items := range value { - for _, item := range items { - query.Add(key, *item) - } - } - default: - str, err := convertType(v, tag) - if err == errValueNotSet { - return nil - } else if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - } - query.Set(name, str) - } - - return nil -} - -func cleanPath(u *url.URL) { - hasSlash := strings.HasSuffix(u.Path, "/") - - // clean up path, removing duplicate `/` - u.Path = path.Clean(u.Path) - u.RawPath = path.Clean(u.RawPath) - - if hasSlash && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - u.RawPath += "/" - } -} - -// EscapePath escapes part of a URL path in Amazon style -func EscapePath(path string, encodeSep bool) string { - var buf bytes.Buffer - for i := 0; i < len(path); i++ { - c := path[i] - if noEscape[c] || (c == '/' && !encodeSep) { - buf.WriteByte(c) - } else { - fmt.Fprintf(&buf, "%%%02X", c) - } - } - return buf.String() -} - -func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error) { - v = reflect.Indirect(v) - if !v.IsValid() { - return "", errValueNotSet - } - - switch value := v.Interface().(type) { - case string: - str = value - case []byte: - str = base64.StdEncoding.EncodeToString(value) - case bool: - str = strconv.FormatBool(value) - case int64: - str = strconv.FormatInt(value, 10) - case float64: - str = strconv.FormatFloat(value, 'f', -1, 64) - case time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.RFC822TimeFormatName - if tag.Get("location") == "querystring" { - format = protocol.ISO8601TimeFormatName - } - } - str = protocol.FormatTime(format, value) - case aws.JSONValue: - if len(value) == 0 { - return "", errValueNotSet - } - escaping := protocol.NoEscape - if tag.Get("location") == "header" { - escaping = protocol.Base64Escape - } - str, err = protocol.EncodeJSONValue(value, escaping) - if err != nil { - return "", fmt.Errorf("unable to encode JSONValue, %v", err) - } - default: - err := fmt.Errorf("unsupported value for param %v (%s)", v.Interface(), v.Type()) - return "", err - } - return str, nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go deleted file mode 100644 index 4366de2e1e..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go +++ /dev/null @@ -1,45 +0,0 @@ -package rest - -import "reflect" - -// PayloadMember returns the payload field member of i if there is one, or nil. -func PayloadMember(i interface{}) interface{} { - if i == nil { - return nil - } - - v := reflect.ValueOf(i).Elem() - if !v.IsValid() { - return nil - } - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - field, _ := v.Type().FieldByName(payloadName) - if field.Tag.Get("type") != "structure" { - return nil - } - - payload := v.FieldByName(payloadName) - if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { - return payload.Interface() - } - } - } - return nil -} - -// PayloadType returns the type of a payload field member of i if there is one, or "". -func PayloadType(i interface{}) string { - v := reflect.Indirect(reflect.ValueOf(i)) - if !v.IsValid() { - return "" - } - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - if member, ok := v.Type().FieldByName(payloadName); ok { - return member.Tag.Get("type") - } - } - } - return "" -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go deleted file mode 100644 index 92f8b4d9a4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ /dev/null @@ -1,257 +0,0 @@ -package rest - -import ( - "bytes" - "encoding/base64" - "fmt" - "io" - "io/ioutil" - "net/http" - "reflect" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - awsStrings "github.com/aws/aws-sdk-go/internal/strings" - "github.com/aws/aws-sdk-go/private/protocol" -) - -// UnmarshalHandler is a named request handler for unmarshaling rest protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.rest.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling rest protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.rest.UnmarshalMeta", Fn: UnmarshalMeta} - -// Unmarshal unmarshals the REST component of a response in a REST service. -func Unmarshal(r *request.Request) { - if r.DataFilled() { - v := reflect.Indirect(reflect.ValueOf(r.Data)) - if err := unmarshalBody(r, v); err != nil { - r.Error = err - } - } -} - -// UnmarshalMeta unmarshals the REST metadata of a response in a REST service -func UnmarshalMeta(r *request.Request) { - r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") - if r.RequestID == "" { - // Alternative version of request id in the header - r.RequestID = r.HTTPResponse.Header.Get("X-Amz-Request-Id") - } - if r.DataFilled() { - if err := UnmarshalResponse(r.HTTPResponse, r.Data, aws.BoolValue(r.Config.LowerCaseHeaderMaps)); err != nil { - r.Error = err - } - } -} - -// UnmarshalResponse attempts to unmarshal the REST response headers to -// the data type passed in. The type must be a pointer. An error is returned -// with any error unmarshaling the response into the target datatype. -func UnmarshalResponse(resp *http.Response, data interface{}, lowerCaseHeaderMaps bool) error { - v := reflect.Indirect(reflect.ValueOf(data)) - return unmarshalLocationElements(resp, v, lowerCaseHeaderMaps) -} - -func unmarshalBody(r *request.Request, v reflect.Value) error { - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - pfield, _ := v.Type().FieldByName(payloadName) - if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { - payload := v.FieldByName(payloadName) - if payload.IsValid() { - switch payload.Interface().(type) { - case []byte: - defer r.HTTPResponse.Body.Close() - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } - - payload.Set(reflect.ValueOf(b)) - - case *string: - defer r.HTTPResponse.Body.Close() - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } - - str := string(b) - payload.Set(reflect.ValueOf(&str)) - - default: - switch payload.Type().String() { - case "io.ReadCloser": - payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) - - case "io.ReadSeeker": - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - return awserr.New(request.ErrCodeSerialization, - "failed to read response body", err) - } - payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b)))) - - default: - io.Copy(ioutil.Discard, r.HTTPResponse.Body) - r.HTTPResponse.Body.Close() - return awserr.New(request.ErrCodeSerialization, - "failed to decode REST response", - fmt.Errorf("unknown payload type %s", payload.Type())) - } - } - } - } - } - } - - return nil -} - -func unmarshalLocationElements(resp *http.Response, v reflect.Value, lowerCaseHeaderMaps bool) error { - for i := 0; i < v.NumField(); i++ { - m, field := v.Field(i), v.Type().Field(i) - if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) { - continue - } - - if m.IsValid() { - name := field.Tag.Get("locationName") - if name == "" { - name = field.Name - } - - switch field.Tag.Get("location") { - case "statusCode": - unmarshalStatusCode(m, resp.StatusCode) - - case "header": - err := unmarshalHeader(m, resp.Header.Get(name), field.Tag) - if err != nil { - return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } - - case "headers": - prefix := field.Tag.Get("locationName") - err := unmarshalHeaderMap(m, resp.Header, prefix, lowerCaseHeaderMaps) - if err != nil { - awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } - } - } - } - - return nil -} - -func unmarshalStatusCode(v reflect.Value, statusCode int) { - if !v.IsValid() { - return - } - - switch v.Interface().(type) { - case *int64: - s := int64(statusCode) - v.Set(reflect.ValueOf(&s)) - } -} - -func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string, normalize bool) error { - if len(headers) == 0 { - return nil - } - switch r.Interface().(type) { - case map[string]*string: // we only support string map value types - out := map[string]*string{} - for k, v := range headers { - if awsStrings.HasPrefixFold(k, prefix) { - if normalize == true { - k = strings.ToLower(k) - } else { - k = http.CanonicalHeaderKey(k) - } - out[k[len(prefix):]] = &v[0] - } - } - if len(out) != 0 { - r.Set(reflect.ValueOf(out)) - } - - } - return nil -} - -func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { - switch tag.Get("type") { - case "jsonvalue": - if len(header) == 0 { - return nil - } - case "blob": - if len(header) == 0 { - return nil - } - default: - if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { - return nil - } - } - - switch v.Interface().(type) { - case *string: - v.Set(reflect.ValueOf(&header)) - case []byte: - b, err := base64.StdEncoding.DecodeString(header) - if err != nil { - return err - } - v.Set(reflect.ValueOf(b)) - case *bool: - b, err := strconv.ParseBool(header) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&b)) - case *int64: - i, err := strconv.ParseInt(header, 10, 64) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&i)) - case *float64: - f, err := strconv.ParseFloat(header, 64) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&f)) - case *time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.RFC822TimeFormatName - } - t, err := protocol.ParseTime(format, header) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&t)) - case aws.JSONValue: - escaping := protocol.NoEscape - if tag.Get("location") == "header" { - escaping = protocol.Base64Escape - } - m, err := protocol.DecodeJSONValue(header, escaping) - if err != nil { - return err - } - v.Set(reflect.ValueOf(m)) - default: - err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) - return err - } - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go deleted file mode 100644 index 2e0e205af3..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go +++ /dev/null @@ -1,59 +0,0 @@ -// Package restjson provides RESTful JSON serialization of AWS -// requests and responses. -package restjson - -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/rest-json.json build_test.go -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/rest-json.json unmarshal_test.go - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -// BuildHandler is a named request handler for building restjson protocol -// requests -var BuildHandler = request.NamedHandler{ - Name: "awssdk.restjson.Build", - Fn: Build, -} - -// UnmarshalHandler is a named request handler for unmarshaling restjson -// protocol requests -var UnmarshalHandler = request.NamedHandler{ - Name: "awssdk.restjson.Unmarshal", - Fn: Unmarshal, -} - -// UnmarshalMetaHandler is a named request handler for unmarshaling restjson -// protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{ - Name: "awssdk.restjson.UnmarshalMeta", - Fn: UnmarshalMeta, -} - -// Build builds a request for the REST JSON protocol. -func Build(r *request.Request) { - rest.Build(r) - - if t := rest.PayloadType(r.Params); t == "structure" || t == "" { - if v := r.HTTPRequest.Header.Get("Content-Type"); len(v) == 0 { - r.HTTPRequest.Header.Set("Content-Type", "application/json") - } - jsonrpc.Build(r) - } -} - -// Unmarshal unmarshals a response body for the REST JSON protocol. -func Unmarshal(r *request.Request) { - if t := rest.PayloadType(r.Data); t == "structure" || t == "" { - jsonrpc.Unmarshal(r) - } else { - rest.Unmarshal(r) - } -} - -// UnmarshalMeta unmarshals response headers for the REST JSON protocol. -func UnmarshalMeta(r *request.Request) { - rest.UnmarshalMeta(r) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go deleted file mode 100644 index d756d8cc52..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go +++ /dev/null @@ -1,134 +0,0 @@ -package restjson - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -const ( - errorTypeHeader = "X-Amzn-Errortype" - errorMessageHeader = "X-Amzn-Errormessage" -) - -// UnmarshalTypedError provides unmarshaling errors API response errors -// for both typed and untyped errors. -type UnmarshalTypedError struct { - exceptions map[string]func(protocol.ResponseMetadata) error -} - -// NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the -// set of exception names to the error unmarshalers -func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError { - return &UnmarshalTypedError{ - exceptions: exceptions, - } -} - -// UnmarshalError attempts to unmarshal the HTTP response error as a known -// error type. If unable to unmarshal the error type, the generic SDK error -// type will be used. -func (u *UnmarshalTypedError) UnmarshalError( - resp *http.Response, - respMeta protocol.ResponseMetadata, -) (error, error) { - - code := resp.Header.Get(errorTypeHeader) - msg := resp.Header.Get(errorMessageHeader) - - body := resp.Body - if len(code) == 0 { - // If unable to get code from HTTP headers have to parse JSON message - // to determine what kind of exception this will be. - var buf bytes.Buffer - var jsonErr jsonErrorResponse - teeReader := io.TeeReader(resp.Body, &buf) - err := jsonutil.UnmarshalJSONError(&jsonErr, teeReader) - if err != nil { - return nil, err - } - - body = ioutil.NopCloser(&buf) - code = jsonErr.Code - msg = jsonErr.Message - } - - // If code has colon separators remove them so can compare against modeled - // exception names. - code = strings.SplitN(code, ":", 2)[0] - - if fn, ok := u.exceptions[code]; ok { - // If exception code is know, use associated constructor to get a value - // for the exception that the JSON body can be unmarshaled into. - v := fn(respMeta) - if err := jsonutil.UnmarshalJSONCaseInsensitive(v, body); err != nil { - return nil, err - } - - if err := rest.UnmarshalResponse(resp, v, true); err != nil { - return nil, err - } - - return v, nil - } - - // fallback to unmodeled generic exceptions - return awserr.NewRequestFailure( - awserr.New(code, msg, nil), - respMeta.StatusCode, - respMeta.RequestID, - ), nil -} - -// UnmarshalErrorHandler is a named request handler for unmarshaling restjson -// protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{ - Name: "awssdk.restjson.UnmarshalError", - Fn: UnmarshalError, -} - -// UnmarshalError unmarshals a response error for the REST JSON protocol. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - var jsonErr jsonErrorResponse - err := jsonutil.UnmarshalJSONError(&jsonErr, r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to unmarshal response error", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - code := r.HTTPResponse.Header.Get(errorTypeHeader) - if code == "" { - code = jsonErr.Code - } - msg := r.HTTPResponse.Header.Get(errorMessageHeader) - if msg == "" { - msg = jsonErr.Message - } - - code = strings.SplitN(code, ":", 2)[0] - r.Error = awserr.NewRequestFailure( - awserr.New(code, jsonErr.Message, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) -} - -type jsonErrorResponse struct { - Code string `json:"code"` - Message string `json:"message"` -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go deleted file mode 100644 index b1ae364871..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go deleted file mode 100644 index 98f4caed91..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go +++ /dev/null @@ -1,85 +0,0 @@ -package protocol - -import ( - "math" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/internal/sdkmath" -) - -// Names of time formats supported by the SDK -const ( - RFC822TimeFormatName = "rfc822" - ISO8601TimeFormatName = "iso8601" - UnixTimeFormatName = "unixTimestamp" -) - -// Time formats supported by the SDK -// Output time is intended to not contain decimals -const ( - // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT - RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" - - // This format is used for output time without seconds precision - RFC822OutputTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" - - // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z - ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" - - // This format is used for output time with fractional second precision up to milliseconds - ISO8601OutputTimeFormat = "2006-01-02T15:04:05.999999999Z" -) - -// IsKnownTimestampFormat returns if the timestamp format name -// is know to the SDK's protocols. -func IsKnownTimestampFormat(name string) bool { - switch name { - case RFC822TimeFormatName: - fallthrough - case ISO8601TimeFormatName: - fallthrough - case UnixTimeFormatName: - return true - default: - return false - } -} - -// FormatTime returns a string value of the time. -func FormatTime(name string, t time.Time) string { - t = t.UTC().Truncate(time.Millisecond) - - switch name { - case RFC822TimeFormatName: - return t.Format(RFC822OutputTimeFormat) - case ISO8601TimeFormatName: - return t.Format(ISO8601OutputTimeFormat) - case UnixTimeFormatName: - ms := t.UnixNano() / int64(time.Millisecond) - return strconv.FormatFloat(float64(ms)/1e3, 'f', -1, 64) - default: - panic("unknown timestamp format name, " + name) - } -} - -// ParseTime attempts to parse the time given the format. Returns -// the time if it was able to be parsed, and fails otherwise. -func ParseTime(formatName, value string) (time.Time, error) { - switch formatName { - case RFC822TimeFormatName: - return time.Parse(RFC822TimeFormat, value) - case ISO8601TimeFormatName: - return time.Parse(ISO8601TimeFormat, value) - case UnixTimeFormatName: - v, err := strconv.ParseFloat(value, 64) - _, dec := math.Modf(v) - dec = sdkmath.Round(dec*1e3) / 1e3 //Rounds 0.1229999 to 0.123 - if err != nil { - return time.Time{}, err - } - return time.Unix(int64(v), int64(dec*(1e9))), nil - default: - panic("unknown timestamp format name, " + formatName) - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go deleted file mode 100644 index f614ef898b..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go +++ /dev/null @@ -1,27 +0,0 @@ -package protocol - -import ( - "io" - "io/ioutil" - - "github.com/aws/aws-sdk-go/aws/request" -) - -// UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body -var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} - -// UnmarshalDiscardBody is a request handler to empty a response's body and closing it. -func UnmarshalDiscardBody(r *request.Request) { - if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { - return - } - - io.Copy(ioutil.Discard, r.HTTPResponse.Body) - r.HTTPResponse.Body.Close() -} - -// ResponseMetadata provides the SDK response metadata attributes. -type ResponseMetadata struct { - StatusCode int - RequestID string -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_error.go deleted file mode 100644 index cc857f136c..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_error.go +++ /dev/null @@ -1,65 +0,0 @@ -package protocol - -import ( - "net/http" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -// UnmarshalErrorHandler provides unmarshaling errors API response errors for -// both typed and untyped errors. -type UnmarshalErrorHandler struct { - unmarshaler ErrorUnmarshaler -} - -// ErrorUnmarshaler is an abstract interface for concrete implementations to -// unmarshal protocol specific response errors. -type ErrorUnmarshaler interface { - UnmarshalError(*http.Response, ResponseMetadata) (error, error) -} - -// NewUnmarshalErrorHandler returns an UnmarshalErrorHandler -// initialized for the set of exception names to the error unmarshalers -func NewUnmarshalErrorHandler(unmarshaler ErrorUnmarshaler) *UnmarshalErrorHandler { - return &UnmarshalErrorHandler{ - unmarshaler: unmarshaler, - } -} - -// UnmarshalErrorHandlerName is the name of the named handler. -const UnmarshalErrorHandlerName = "awssdk.protocol.UnmarshalError" - -// NamedHandler returns a NamedHandler for the unmarshaler using the set of -// errors the unmarshaler was initialized for. -func (u *UnmarshalErrorHandler) NamedHandler() request.NamedHandler { - return request.NamedHandler{ - Name: UnmarshalErrorHandlerName, - Fn: u.UnmarshalError, - } -} - -// UnmarshalError will attempt to unmarshal the API response's error message -// into either a generic SDK error type, or a typed error corresponding to the -// errors exception name. -func (u *UnmarshalErrorHandler) UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - respMeta := ResponseMetadata{ - StatusCode: r.HTTPResponse.StatusCode, - RequestID: r.RequestID, - } - - v, err := u.unmarshaler.UnmarshalError(r.HTTPResponse, respMeta) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to unmarshal response error", err), - respMeta.StatusCode, - respMeta.RequestID, - ) - return - } - - r.Error = v -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go deleted file mode 100644 index 09ad951595..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go +++ /dev/null @@ -1,315 +0,0 @@ -// Package xmlutil provides XML serialization of AWS requests and responses. -package xmlutil - -import ( - "encoding/base64" - "encoding/xml" - "fmt" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/private/protocol" -) - -// BuildXML will serialize params into an xml.Encoder. Error will be returned -// if the serialization of any of the params or nested values fails. -func BuildXML(params interface{}, e *xml.Encoder) error { - return buildXML(params, e, false) -} - -func buildXML(params interface{}, e *xml.Encoder, sorted bool) error { - b := xmlBuilder{encoder: e, namespaces: map[string]string{}} - root := NewXMLElement(xml.Name{}) - if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil { - return err - } - for _, c := range root.Children { - for _, v := range c { - return StructToXML(e, v, sorted) - } - } - return nil -} - -// Returns the reflection element of a value, if it is a pointer. -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} - -// A xmlBuilder serializes values from Go code to XML -type xmlBuilder struct { - encoder *xml.Encoder - namespaces map[string]string -} - -// buildValue generic XMLNode builder for any type. Will build value for their specific type -// struct, list, map, scalar. -// -// Also takes a "type" tag value to set what type a value should be converted to XMLNode as. If -// type is not provided reflect will be used to determine the value's type. -func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - value = elemOf(value) - if !value.IsValid() { // no need to handle zero values - return nil - } else if tag.Get("location") != "" { // don't handle non-body location values - return nil - } - - xml := tag.Get("xml") - if len(xml) != 0 { - name := strings.SplitAfterN(xml, ",", 2)[0] - if name == "-" { - return nil - } - } - - t := tag.Get("type") - if t == "" { - switch value.Kind() { - case reflect.Struct: - t = "structure" - case reflect.Slice: - t = "list" - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - if field, ok := value.Type().FieldByName("_"); ok { - tag = tag + reflect.StructTag(" ") + field.Tag - } - return b.buildStruct(value, current, tag) - case "list": - return b.buildList(value, current, tag) - case "map": - return b.buildMap(value, current, tag) - default: - return b.buildScalar(value, current, tag) - } -} - -// buildStruct adds a struct and its fields to the current XMLNode. All fields and any nested -// types are converted to XMLNodes also. -func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - if !value.IsValid() { - return nil - } - - // unwrap payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := value.Type().FieldByName(payload) - tag = field.Tag - value = elemOf(value.FieldByName(payload)) - - if !value.IsValid() { - return nil - } - } - - child := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) - - // there is an xmlNamespace associated with this struct - if prefix, uri := tag.Get("xmlPrefix"), tag.Get("xmlURI"); uri != "" { - ns := xml.Attr{ - Name: xml.Name{Local: "xmlns"}, - Value: uri, - } - if prefix != "" { - b.namespaces[prefix] = uri // register the namespace - ns.Name.Local = "xmlns:" + prefix - } - - child.Attr = append(child.Attr, ns) - } - - var payloadFields, nonPayloadFields int - - t := value.Type() - for i := 0; i < value.NumField(); i++ { - member := elemOf(value.Field(i)) - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("ignore") != "" { - continue - } - - mTag := field.Tag - if mTag.Get("location") != "" { // skip non-body members - nonPayloadFields++ - continue - } - payloadFields++ - - if protocol.CanSetIdempotencyToken(value.Field(i), field) { - token := protocol.GetIdempotencyToken() - member = reflect.ValueOf(token) - } - - memberName := mTag.Get("locationName") - if memberName == "" { - memberName = field.Name - mTag = reflect.StructTag(string(mTag) + ` locationName:"` + memberName + `"`) - } - if err := b.buildValue(member, child, mTag); err != nil { - return err - } - } - - // Only case where the child shape is not added is if the shape only contains - // non-payload fields, e.g headers/query. - if !(payloadFields == 0 && nonPayloadFields > 0) { - current.AddChild(child) - } - - return nil -} - -// buildList adds the value's list items to the current XMLNode as children nodes. All -// nested values in the list are converted to XMLNodes also. -func (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - if value.IsNil() { // don't build omitted lists - return nil - } - - // check for unflattened list member - flattened := tag.Get("flattened") != "" - - xname := xml.Name{Local: tag.Get("locationName")} - if flattened { - for i := 0; i < value.Len(); i++ { - child := NewXMLElement(xname) - current.AddChild(child) - if err := b.buildValue(value.Index(i), child, ""); err != nil { - return err - } - } - } else { - list := NewXMLElement(xname) - current.AddChild(list) - - for i := 0; i < value.Len(); i++ { - iname := tag.Get("locationNameList") - if iname == "" { - iname = "member" - } - - child := NewXMLElement(xml.Name{Local: iname}) - list.AddChild(child) - if err := b.buildValue(value.Index(i), child, ""); err != nil { - return err - } - } - } - - return nil -} - -// buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All -// nested values in the map are converted to XMLNodes also. -// -// Error will be returned if it is unable to build the map's values into XMLNodes -func (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - if value.IsNil() { // don't build omitted maps - return nil - } - - maproot := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) - current.AddChild(maproot) - current = maproot - - kname, vname := "key", "value" - if n := tag.Get("locationNameKey"); n != "" { - kname = n - } - if n := tag.Get("locationNameValue"); n != "" { - vname = n - } - - // sorting is not required for compliance, but it makes testing easier - keys := make([]string, value.Len()) - for i, k := range value.MapKeys() { - keys[i] = k.String() - } - sort.Strings(keys) - - for _, k := range keys { - v := value.MapIndex(reflect.ValueOf(k)) - - mapcur := current - if tag.Get("flattened") == "" { // add "entry" tag to non-flat maps - child := NewXMLElement(xml.Name{Local: "entry"}) - mapcur.AddChild(child) - mapcur = child - } - - kchild := NewXMLElement(xml.Name{Local: kname}) - kchild.Text = k - vchild := NewXMLElement(xml.Name{Local: vname}) - mapcur.AddChild(kchild) - mapcur.AddChild(vchild) - - if err := b.buildValue(v, vchild, ""); err != nil { - return err - } - } - - return nil -} - -// buildScalar will convert the value into a string and append it as a attribute or child -// of the current XMLNode. -// -// The value will be added as an attribute if tag contains a "xmlAttribute" attribute value. -// -// Error will be returned if the value type is unsupported. -func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - var str string - switch converted := value.Interface().(type) { - case string: - str = converted - case []byte: - if !value.IsNil() { - str = base64.StdEncoding.EncodeToString(converted) - } - case bool: - str = strconv.FormatBool(converted) - case int64: - str = strconv.FormatInt(converted, 10) - case int: - str = strconv.Itoa(converted) - case float64: - str = strconv.FormatFloat(converted, 'f', -1, 64) - case float32: - str = strconv.FormatFloat(float64(converted), 'f', -1, 32) - case time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - str = protocol.FormatTime(format, converted) - default: - return fmt.Errorf("unsupported value for param %s: %v (%s)", - tag.Get("locationName"), value.Interface(), value.Type().Name()) - } - - xname := xml.Name{Local: tag.Get("locationName")} - if tag.Get("xmlAttribute") != "" { // put into current node's attribute list - attr := xml.Attr{Name: xname, Value: str} - current.Attr = append(current.Attr, attr) - } else { // regular text node - current.AddChild(&XMLNode{Name: xname, Text: str}) - } - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go deleted file mode 100644 index c1a511851f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go +++ /dev/null @@ -1,32 +0,0 @@ -package xmlutil - -import ( - "encoding/xml" - "strings" -) - -type xmlAttrSlice []xml.Attr - -func (x xmlAttrSlice) Len() int { - return len(x) -} - -func (x xmlAttrSlice) Less(i, j int) bool { - spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space - localI, localJ := x[i].Name.Local, x[j].Name.Local - valueI, valueJ := x[i].Value, x[j].Value - - spaceCmp := strings.Compare(spaceI, spaceJ) - localCmp := strings.Compare(localI, localJ) - valueCmp := strings.Compare(valueI, valueJ) - - if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) { - return true - } - - return false -} - -func (x xmlAttrSlice) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go deleted file mode 100644 index 107c053f8a..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go +++ /dev/null @@ -1,299 +0,0 @@ -package xmlutil - -import ( - "bytes" - "encoding/base64" - "encoding/xml" - "fmt" - "io" - "reflect" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/private/protocol" -) - -// UnmarshalXMLError unmarshals the XML error from the stream into the value -// type specified. The value must be a pointer. If the message fails to -// unmarshal, the message content will be included in the returned error as a -// awserr.UnmarshalError. -func UnmarshalXMLError(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 nil -} - -// UnmarshalXML deserializes an xml.Decoder into the container v. V -// needs to match the shape of the XML expected to be decoded. -// If the shape doesn't match unmarshaling will fail. -func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error { - n, err := XMLToStruct(d, nil) - if err != nil { - return err - } - if n.Children != nil { - for _, root := range n.Children { - for _, c := range root { - if wrappedChild, ok := c.Children[wrapper]; ok { - c = wrappedChild[0] // pull out wrapped element - } - - err = parse(reflect.ValueOf(v), c, "") - if err != nil { - if err == io.EOF { - return nil - } - return err - } - } - } - return nil - } - return nil -} - -// parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect -// will be used to determine the type from r. -func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - xml := tag.Get("xml") - if len(xml) != 0 { - name := strings.SplitAfterN(xml, ",", 2)[0] - if name == "-" { - return nil - } - } - - rtype := r.Type() - if rtype.Kind() == reflect.Ptr { - rtype = rtype.Elem() // check kind of actual element type - } - - t := tag.Get("type") - if t == "" { - switch rtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if _, ok := r.Interface().(*time.Time); !ok { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := r.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - if field, ok := rtype.FieldByName("_"); ok { - tag = field.Tag - } - return parseStruct(r, node, tag) - case "list": - return parseList(r, node, tag) - case "map": - return parseMap(r, node, tag) - default: - return parseScalar(r, node, tag) - } -} - -// parseStruct deserializes a structure and its fields from an XMLNode. Any nested -// types in the structure will also be deserialized. -func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - t := r.Type() - if r.Kind() == reflect.Ptr { - if r.IsNil() { // create the structure if it's nil - s := reflect.New(r.Type().Elem()) - r.Set(s) - r = s - } - - r = r.Elem() - t = t.Elem() - } - - // unwrap any payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := t.FieldByName(payload) - return parseStruct(r.FieldByName(payload), node, field.Tag) - } - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - if c := field.Name[0:1]; strings.ToLower(c) == c { - continue // ignore unexported fields - } - - // figure out what this field is called - name := field.Name - if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { - name = field.Tag.Get("locationNameList") - } else if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - // try to find the field by name in elements - elems := node.Children[name] - - if elems == nil { // try to find the field in attributes - if val, ok := node.findElem(name); ok { - elems = []*XMLNode{{Text: val}} - } - } - - member := r.FieldByName(field.Name) - for _, elem := range elems { - err := parse(member, elem, field.Tag) - if err != nil { - return err - } - } - } - return nil -} - -// parseList deserializes a list of values from an XML node. Each list entry -// will also be deserialized. -func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - t := r.Type() - - if tag.Get("flattened") == "" { // look at all item entries - mname := "member" - if name := tag.Get("locationNameList"); name != "" { - mname = name - } - - if Children, ok := node.Children[mname]; ok { - if r.IsNil() { - r.Set(reflect.MakeSlice(t, len(Children), len(Children))) - } - - for i, c := range Children { - err := parse(r.Index(i), c, "") - if err != nil { - return err - } - } - } - } else { // flattened list means this is a single element - if r.IsNil() { - r.Set(reflect.MakeSlice(t, 0, 0)) - } - - childR := reflect.Zero(t.Elem()) - r.Set(reflect.Append(r, childR)) - err := parse(r.Index(r.Len()-1), node, "") - if err != nil { - return err - } - } - - return nil -} - -// parseMap deserializes a map from an XMLNode. The direct children of the XMLNode -// will also be deserialized as map entries. -func parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - if r.IsNil() { - r.Set(reflect.MakeMap(r.Type())) - } - - if tag.Get("flattened") == "" { // look at all child entries - for _, entry := range node.Children["entry"] { - parseMapEntry(r, entry, tag) - } - } else { // this element is itself an entry - parseMapEntry(r, node, tag) - } - - return nil -} - -// parseMapEntry deserializes a map entry from a XML node. -func parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - kname, vname := "key", "value" - if n := tag.Get("locationNameKey"); n != "" { - kname = n - } - if n := tag.Get("locationNameValue"); n != "" { - vname = n - } - - keys, ok := node.Children[kname] - values := node.Children[vname] - if ok { - for i, key := range keys { - keyR := reflect.ValueOf(key.Text) - value := values[i] - valueR := reflect.New(r.Type().Elem()).Elem() - - parse(valueR, value, "") - r.SetMapIndex(keyR, valueR) - } - } - return nil -} - -// parseScaller deserializes an XMLNode value into a concrete type based on the -// interface type of r. -// -// Error is returned if the deserialization fails due to invalid type conversion, -// or unsupported interface type. -func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - switch r.Interface().(type) { - case *string: - r.Set(reflect.ValueOf(&node.Text)) - return nil - case []byte: - b, err := base64.StdEncoding.DecodeString(node.Text) - if err != nil { - return err - } - r.Set(reflect.ValueOf(b)) - case *bool: - v, err := strconv.ParseBool(node.Text) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&v)) - case *int64: - v, err := strconv.ParseInt(node.Text, 10, 64) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&v)) - case *float64: - v, err := strconv.ParseFloat(node.Text, 64) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&v)) - case *time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - t, err := protocol.ParseTime(format, node.Text) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&t)) - default: - return fmt.Errorf("unsupported value: %v (%s)", r.Interface(), r.Type()) - } - return nil -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go deleted file mode 100644 index 42f71648ee..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go +++ /dev/null @@ -1,159 +0,0 @@ -package xmlutil - -import ( - "encoding/xml" - "fmt" - "io" - "sort" -) - -// A XMLNode contains the values to be encoded or decoded. -type XMLNode struct { - Name xml.Name `json:",omitempty"` - Children map[string][]*XMLNode `json:",omitempty"` - Text string `json:",omitempty"` - Attr []xml.Attr `json:",omitempty"` - - namespaces map[string]string - parent *XMLNode -} - -// NewXMLElement returns a pointer to a new XMLNode initialized to default values. -func NewXMLElement(name xml.Name) *XMLNode { - return &XMLNode{ - Name: name, - Children: map[string][]*XMLNode{}, - Attr: []xml.Attr{}, - } -} - -// AddChild adds child to the XMLNode. -func (n *XMLNode) AddChild(child *XMLNode) { - child.parent = n - if _, ok := n.Children[child.Name.Local]; !ok { - n.Children[child.Name.Local] = []*XMLNode{} - } - n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child) -} - -// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values. -func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) { - out := &XMLNode{} - for { - tok, err := d.Token() - if err != nil { - if err == io.EOF { - break - } else { - return out, err - } - } - - if tok == nil { - break - } - - switch typed := tok.(type) { - case xml.CharData: - out.Text = string(typed.Copy()) - case xml.StartElement: - el := typed.Copy() - out.Attr = el.Attr - if out.Children == nil { - out.Children = map[string][]*XMLNode{} - } - - name := typed.Name.Local - slice := out.Children[name] - if slice == nil { - slice = []*XMLNode{} - } - node, e := XMLToStruct(d, &el) - out.findNamespaces() - if e != nil { - return out, e - } - node.Name = typed.Name - node.findNamespaces() - tempOut := *out - // Save into a temp variable, simply because out gets squashed during - // loop iterations - node.parent = &tempOut - slice = append(slice, node) - out.Children[name] = slice - case xml.EndElement: - if s != nil && s.Name.Local == typed.Name.Local { // matching end token - return out, nil - } - out = &XMLNode{} - } - } - return out, nil -} - -func (n *XMLNode) findNamespaces() { - ns := map[string]string{} - for _, a := range n.Attr { - if a.Name.Space == "xmlns" { - ns[a.Value] = a.Name.Local - } - } - - n.namespaces = ns -} - -func (n *XMLNode) findElem(name string) (string, bool) { - for node := n; node != nil; node = node.parent { - for _, a := range node.Attr { - namespace := a.Name.Space - if v, ok := node.namespaces[namespace]; ok { - namespace = v - } - if name == fmt.Sprintf("%s:%s", namespace, a.Name.Local) { - return a.Value, true - } - } - } - return "", false -} - -// StructToXML writes an XMLNode to a xml.Encoder as tokens. -func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { - // Sort Attributes - attrs := node.Attr - if sorted { - sortedAttrs := make([]xml.Attr, len(attrs)) - for _, k := range node.Attr { - sortedAttrs = append(sortedAttrs, k) - } - sort.Sort(xmlAttrSlice(sortedAttrs)) - attrs = sortedAttrs - } - - e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs}) - - if node.Text != "" { - e.EncodeToken(xml.CharData([]byte(node.Text))) - } else if sorted { - sortedNames := []string{} - for k := range node.Children { - sortedNames = append(sortedNames, k) - } - sort.Strings(sortedNames) - - for _, k := range sortedNames { - for _, v := range node.Children[k] { - StructToXML(e, v, sorted) - } - } - } else { - for _, c := range node.Children { - for _, v := range c { - StructToXML(e, v, sorted) - } - } - } - - e.EncodeToken(xml.EndElement{Name: node.Name}) - return e.Flush() -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/api.go deleted file mode 100644 index 89a0a29aff..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ /dev/null @@ -1,35976 +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/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 operation 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) -// operation and ensure that the parts list is empty. -// -// For information about permissions required to use the multipart upload API, -// see Multipart Upload API 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 operation 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 operation -// 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). -// -// 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 API 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 operation using -// this API. However, to copy an object greater than 5 GB, you must use the -// multipart upload Upload Part - Copy 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 -// operation 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 (https://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 Developer 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 AWS 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 Simple Storage Service Developer 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 -// AWS 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). -// -// Storage Class Options -// -// You can use the CopyObject operation 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 Service Developer 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 operation 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 AWS 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 Working with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.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). -// -// When creating a bucket using this operation, you can optionally specify the -// accounts or groups that should be granted specific permissions on the bucket. -// 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/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 -// AWS account uri – if you are granting permissions to a predefined group -// emailAddress – if the value specified is the email address of an AWS -// account Using email addresses to specify a grantee is only supported in -// the following AWS 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 AWS General Reference. For example, the following x-amz-grant-read -// header grants the AWS 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. -// -// 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 AWS 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 operation 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 operation 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 API 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 (AWS 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 AWS Key Management Service (AWS KMS) customer master keys (CMKs) or -// Amazon S3-managed encryption keys. If you choose to provide your own encryption -// key, the request headers you provide in UploadPart (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 AWS KMS CMK, the requester -// must have permission to the kms:Encrypt, kms:Decrypt, kms:ReEncrypt*, kms:GenerateDataKey*, -// and kms:DescribeKey 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. -// -// If your AWS Identity and Access Management (IAM) user or role is in the same -// AWS account as the AWS KMS CMK, 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 AWS managed encryption keys or provide your own encryption key. -// -// * Use encryption keys managed by Amazon S3 or customer master keys (CMKs) -// stored in AWS Key Management Service (AWS KMS) – If you want AWS 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 AWS managed CMK in AWS KMS to protect the data. All GET and -// PUT requests for an object protected by AWS KMS fail if you don't make -// them with SSL or by using SigV4. For more information about server-side -// encryption with CMKs stored in AWS KMS (SSE-KMS), see Protecting Data -// Using Server-Side Encryption with CMKs stored in AWS KMS (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 CMKs stored in AWS KMS (SSE-KMS), see Protecting -// Data Using Server-Side Encryption with CMKs stored in AWS KMS (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 -// AWS 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 AWS 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 -// AWS account uri – if you are granting permissions to a predefined group -// emailAddress – if the value specified is the email address of an AWS -// account Using email addresses to specify a grantee is only supported in -// the following AWS 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 AWS General Reference. For example, the following x-amz-grant-read -// header grants the AWS 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/dev/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/dev/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 Simple Storage Service Developer 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 operation 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 Simple Storage Service Developer 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/dev/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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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 additional operational overhead. S3 Intelligent-Tiering delivers -// automatic cost savings by moving data between access tiers, when access patterns -// change. -// -// The S3 Intelligent-Tiering storage class is suitable for objects larger than -// 128 KB that you plan to store for at least 30 days. If the size of an object -// is less than 128 KB, it is 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. -// -// If you delete an object before the end of the 30-day minimum storage duration -// period, you are charged for 30 days. 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/dev/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/dev/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/dev/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/dev/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 operation 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 AWS 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 AWS 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/dev/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/dev/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 Developer 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 operation 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 operation 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. -// -// 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 the DELETE Object API 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 operation 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 operation 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 operation 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 operation 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 operation supports two modes for the response: verbose and quiet. By -// default, the operation 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 operation encountered an error. For a -// successful deletion, the operation does not return any information about -// the delete in the response body. -// -// When performing this operation 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/dev/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/dev/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 operation 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/dev/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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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 Simple Storage Service Developer 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 operation 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. -// -// 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 operation 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/dev/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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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 Simple Storage Service Developer 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 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. 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/dev/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/dev/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 additional operational overhead. S3 Intelligent-Tiering delivers -// automatic cost savings by moving data between access tiers, when access patterns -// change. -// -// The S3 Intelligent-Tiering storage class is suitable for objects larger than -// 128 KB that you plan to store for at least 30 days. If the size of an object -// is less than 128 KB, it is 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. -// -// If you delete an object before the end of the 30-day minimum storage duration -// period, you are charged for 30 days. 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/dev/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/dev/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/dev/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/dev/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 API description, -// 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/dev/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/dev/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. -// -// 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/dev/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/dev/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 operation 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 operation 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/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 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 AWS 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 AWS 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 operation 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 Simple Storage Service Developer Guide. -// -// This operation 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: NoSuchTagSetError 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 operation 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). -// -// To distribute large files to many people, you can save bandwidth costs by -// using BitTorrent. For more information, see Amazon S3 Torrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html). -// 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 operation 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 -// CMKs stored in AWS KMS (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 permission to read object tags (permission for the s3:GetObjectVersionTagging -// action), 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 s3:GetObject 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 operation returns the current version of an object. To -// return a different version, use the versionId subresource. -// -// 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 READ_ACP access to the object. -// -// 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. -// -// The following operations are related to GetObjectAcl: -// -// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.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 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. -// -// 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). -// -// 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. -// -// 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 operation 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 operation is related to GetObjectTagging: -// -// * 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 operation 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 operation is useful to determine if a bucket exists and you have permission -// to access it. The operation returns a 200 OK if the bucket exists and you -// have permission to access it. Otherwise, the operation might return responses -// such as 404 Not Found and 403 Forbidden. -// -// 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/dev/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/dev/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 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 operation retrieves metadata from an object without returning the -// object itself. This operation 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 operation on an object. The -// response is identical to the GET response except that there is no response -// body. -// -// 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 -// CMKs stored in AWS KMS (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. -// -// 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 s3:GetObject 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 operation is related to HeadObject: -// -// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.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 operation 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/dev/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/dev/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 additional operational overhead. S3 Intelligent-Tiering delivers -// automatic cost savings by moving data between access tiers, when access patterns -// change. -// -// The S3 Intelligent-Tiering storage class is suitable for objects larger than -// 128 KB that you plan to store for at least 30 days. If the size of an object -// is less than 128 KB, it is 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. -// -// If you delete an object before the end of the 30-day minimum storage duration -// period, you are charged for 30 days. 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 operation 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/dev/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/dev/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 operation 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/dev/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/dev/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. -// -// 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 operation 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 operation 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 API 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. -// -// 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 API 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. 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. -// -// To use this operation, you must have READ access to the bucket. -// -// To use this operation in an AWS 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/dev/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/dev/s3-access-control.html). -// -// This section describes the latest revision of the API. 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. -// -// 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 API 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) -// -// * 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/dev/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/dev/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) -// operation 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. -// -// 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 (AWS -// 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 AWS account uri – if you are granting permissions to a predefined -// group emailAddress – if the value specified is the email address of -// an AWS account Using email addresses to specify a grantee is only supported -// in the following AWS 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 AWS 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 AWS 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 AWS 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 AWS 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/dev/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/dev/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 -// Simple Storage Service Developer 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 operation 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 AWS KMS customer master keys (SSE-KMS). If you -// specify default encryption using SSE-KMS, you can also configure Amazon S3 -// Bucket Key. 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 Simple Storage Service Developer 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 Simple Storage Service Developer Guide. -// -// This operation requires AWS Signature Version 4. For more information, see -// Authenticating Requests (AWS Signature Version 4) (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/dev/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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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. -// -// 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. S3 Intelligent-Tiering delivers -// automatic cost savings by moving data between access tiers, when access patterns -// change. -// -// The S3 Intelligent-Tiering storage class is suitable for objects larger than -// 128 KB that you plan to store for at least 30 days. If the size of an object -// is less than 128 KB, it is 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. -// -// If you delete an object before the end of the 30-day minimum storage duration -// period, you are charged for 30 days. 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) -// -// 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 operation 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 AWS 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 Simple Storage Service Developer 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/dev/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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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 Simple Storage Service Developer 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 AWS 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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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 AWS 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 Simple Storage -// Service Developer 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/dev/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. For information about lifecycle configuration, see -// Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.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. 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 AWS 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/dev/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 AWS 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. -// -// 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/dev/ServerLogs.html). -// -// 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/dev/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/dev/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) -// -// * PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.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 operation 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 AWS 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. -// -// 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 operation -// 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 operation 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/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 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 AWS 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 AWS 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 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 Developer Guide. -// -// To perform this operation, the user or role performing the operation must -// have the iam:PassRole (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) -// permission. -// -// 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). -// -// By default, a resource owner, in this case the AWS 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/dev/s3-access-control.html). -// -// Handling Replication of Encrypted Objects -// -// By default, Amazon S3 doesn't replicate objects that are stored at rest using -// server-side encryption with CMKs stored in AWS KMS. To replicate AWS KMS-encrypted -// objects, add the following: SourceSelectionCriteria, SseKmsEncryptedObjects, -// Status, EncryptionConfiguration, and ReplicaKmsKeyID. For information about -// replication configuration, see Replicating Objects Created with SSE Using -// CMKs stored in AWS KMS (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) -// -// 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 AWS bill to reflect your own cost structure. To -// do this, sign up to get your AWS 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). -// -// Within a bucket, if you add a tag that has the same key as an existing tag, -// the new value overwrites the old value. For more information, see Using Cost -// Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/dev/CostAllocTagging.html). -// -// 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/dev/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/dev/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 AWS-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 -// operation 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. To set the versioning state, -// you must be the bucket owner. -// -// 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. -// -// If the bucket owner enables MFA Delete in the bucket versioning configuration, -// the bucket owner 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 operation 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 Simple Storage Service 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 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. -// -// 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 Simple Storage Service Developer 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 AWS 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 AWS 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 Simple Storage Service Developer 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 AWS 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). -// -// 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 Service Developer 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 Simple Storage Service Developer 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 Developer 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 (AWS -// 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 AWS account uri – if you are granting permissions to a predefined -// group emailAddress – if the value specified is the email address of -// an AWS account Using email addresses to specify a grantee is only supported -// in the following AWS 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 AWS General Reference. For example, the following x-amz-grant-read -// header grants list objects permission to the two AWS 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 AWS 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 AWS 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. -// -// This action is not supported by Amazon S3 on Outposts. -// -// Related Resources -// -// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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 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. -// -// DefaultRetention requires either Days or Years. You can't specify both at -// the same time. -// -// Related Resources -// -// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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 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. -// -// This action is not supported by Amazon S3 on Outposts. -// -// Related Resources -// -// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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 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 operation -// 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) -// -// 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/dev/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/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer 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 Simple Storage Service Developer 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 AWS Region as the bucket that contains -// the archive object that is being queried. The AWS 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 Simple Storage Service Developer 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 Simple Storage Service Developer Guide Protecting Data Using -// Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon Simple Storage Service Developer 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 Simple Storage Service Developer 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 Simple Storage Service Developer 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 Simple Storage Service Developer 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 Simple Storage Service Developer 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 Simple Storage Service Developer Guide. -// -// Responses -// -// A successful operation 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 Simple Storage Service 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 Amazon Simple Storage Service's -// API operation RestoreObject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" -// This operation 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 operation 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) -// in the Amazon Simple Storage Service Developer 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 Simple Storage Service Developer 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 Simple Storage Service Developer 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 Simple Storage Service Developer Guide. For objects that -// are encrypted with Amazon S3 managed encryption keys (SSE-S3) and customer -// master keys (CMKs) stored in AWS Key Management Service (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 Simple Storage Service Developer 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 operation 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 Simple Storage Service Developer 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. Each -// part must be at least 5 MB in size, except the last part. There is no size -// limit on the last part of your multipart upload. -// -// 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 AWS 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 -// (AWS 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 Simple Storage Service Developer Guide . -// -// For information on the permissions required to use the multipart upload API, -// go to Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon Simple Storage Service Developer 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 AWS 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 Simple Storage Service Developer 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. -// -// The minimum allowable part size for a multipart upload is 5 MB. For more -// information about multipart upload limits, go to Quick Facts (https://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html) -// in the Amazon Simple Storage Service Developer 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) operation -// 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 Simple Storage Service Developer Guide. -// -// * For information about permissions required to use the multipart upload -// API, see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon Simple Storage Service Developer Guide. -// -// * For information about copying objects using a single atomic operation -// vs. the multipart upload, see Operations on Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) -// in the Amazon Simple Storage Service Developer 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() -} - -// 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 Simple Storage Service Developer 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 -func (s AbortIncompleteMultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s AbortMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AbortMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 -func (s AccelerateConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AccessControlPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service API Reference. - // - // Owner is a required field - Owner *string `type:"string" required:"true" enum:"OwnerOverride"` -} - -// String returns the string representation -func (s AccessControlTranslation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AnalyticsAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AnalyticsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AnalyticsExportDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AnalyticsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s AnalyticsS3BucketDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS 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 -func (s Bucket) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 -func (s BucketLifecycleConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service API Reference. - LoggingEnabled *LoggingEnabled `type:"structure"` -} - -// String returns the string representation -func (s BucketLoggingStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -// Simple Storage Service Developer 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 -func (s CORSConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 -func (s CORSRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s CSVInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s CSVOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// Container for specifying the AWS 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"` - - // 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 -func (s CloudFunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s CommonPrefix) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - // - // 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // 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 -func (s CompleteMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -} - -// 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. - // - // When using this API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. - Bucket *string `type:"string"` - - // Indicates whether the multipart upload uses an S3 Bucket Key for server-side - // encryption with AWS KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // 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. - 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 AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 AWS KMS customer master key (CMK) 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 -func (s CompleteMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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. - Parts []*CompletedPart `locationName:"Part" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s CompletedMultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 -func (s CompletedPart) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompletedPart) GoString() string { - return s.String() -} - -// 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. - KeyPrefixEquals *string `type:"string"` -} - -// String returns the string representation -func (s Condition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ContinuationEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 operation 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"` - - // 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/dev/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 AWS 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 *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 will fail with an HTTP - // 403 (Access Denied) error. - 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 will fail with an HTTP 403 (Access - // Denied) error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 *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 AWS 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 *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT - // requests for an object protected by AWS KMS will fail if not made via SSL - // or using SigV4. For information about configuring using any of the officially - // supported AWS SDKs and AWS 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 Developer Guide. - 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 Service Developer 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 -func (s CopyObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 AWS 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 AWS 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 *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 -func (s CopyObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // Returns the ETag of the new object. The ETag reflects only changes to the - // contents of an object, not its metadata. The source and destination ETag - // is identical for a successfully copied object. - ETag *string `type:"string"` - - // Returns the date that the object was last modified. - LastModified *time.Time `type:"timestamp"` -} - -// String returns the string representation -func (s CopyObjectResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyObjectResult) GoString() string { - return s.String() -} - -// 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"` - - // 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 -func (s CopyPartResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyPartResult) GoString() string { - return s.String() -} - -// 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 -func (s CreateBucketConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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, overwrite, and delete any object in the bucket. - 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"` -} - -// String returns the string representation -func (s CreateBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -type CreateBucketOutput struct { - _ struct{} `type:"structure"` - - // Specifies the Region where the bucket will be created. If you are creating - // a bucket on the US East (N. Virginia) Region (us-east-1), you do not need - // to specify the location. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 operation 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"` - - // 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 *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 AWS 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 *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // Specifies the ID of the symmetric customer managed AWS KMS CMK to use for - // object encryption. All GET and PUT requests for an object protected by AWS - // KMS will fail if not made via SSL or using SigV4. For information about configuring - // using any of the officially supported AWS SDKs and AWS CLI, see Specifying - // the Signature Version in Request Authentication (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) - // in the Amazon S3 Developer Guide. - 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 Service Developer 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 -func (s CreateMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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. - // - // When using this API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. - Bucket *string `locationName:"Bucket" type:"string"` - - // Indicates whether the multipart upload uses an S3 Bucket Key for server-side - // encryption with AWS KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // 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 AWS 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 *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 -func (s CreateMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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. -type DefaultRetention struct { - _ struct{} `type:"structure"` - - // The number of days that you want to specify for the default retention period. - Days *int64 `type:"integer"` - - // The default Object Lock retention mode you want to apply to new objects placed - // in the specified bucket. - Mode *string `type:"string" enum:"ObjectLockRetentionMode"` - - // The number of years that you want to specify for the default retention period. - Years *int64 `type:"integer"` -} - -// String returns the string representation -func (s DefaultRetention) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Delete) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s DeleteBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketEncryptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketEncryptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketIntelligentTieringConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketIntelligentTieringConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s DeleteBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s DeleteBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteBucketOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketOwnershipControlsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketOwnershipControlsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeleteBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteMarkerEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteMarkerReplication) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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. - 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s DeleteObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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"` - - // 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 -func (s DeleteObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeleteObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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. You must have sufficient permissions to perform this - // operation. - BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` - - // 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation -func (s DeleteObjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 operation 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 -func (s DeleteObjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s DeletePublicAccessBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeletePublicAccessBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s DeletedObject) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS account that owns the destination bucket. If this is not specified - // in the replication configuration, the replicas are owned by same AWS 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 AWS 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 Simple Storage Service Developer 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 Simple Storage Service API Reference. - StorageClass *string `type:"string" enum:"StorageClass"` -} - -// String returns the string representation -func (s Destination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS KMS CMK to use for encryption of job results. - // Amazon S3 only supports symmetric CMKs. For more information, see Using Symmetric - // and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the AWS Key Management Service Developer Guide. - KMSKeyId *string `type:"string" sensitive:"true"` -} - -// String returns the string representation -func (s Encryption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 customer - // master key (CMK) stored in AWS Key Management Service (KMS) for the destination - // bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only - // supports symmetric customer managed CMKs. For more information, see Using - // Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the AWS Key Management Service Developer Guide. - ReplicaKmsKeyID *string `type:"string"` -} - -// String returns the string representation -func (s EncryptionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s EndEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS account - // that prevents the operation from completing successfully. Contact AWS - // 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 AWS 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 AWS - // 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 AWS 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 operation 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 AWS 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 AWS 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 AWS 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: https://aws.amazon.com/s3 HTTP Status - // Code: 403 Forbidden SOAP Fault Code Prefix: Client - // - // * Code: OperationAborted Description: A conflicting conditional operation - // 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 AWS 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 -func (s Error) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ErrorDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 Developer 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 -func (s ExistingObjectReplication) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 -func (s FilterRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketAccelerateConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketAccelerateConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s GetBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketEncryptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketEncryptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketIntelligentTieringConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketIntelligentTieringConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s GetBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketLifecycleConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketLocationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketLocationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service API Reference. - LoggingEnabled *LoggingEnabled `type:"structure"` -} - -// String returns the string representation -func (s GetBucketLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s GetBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketNotificationConfigurationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketOwnershipControlsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 (BucketOwnerPreferred or ObjectWriter) currently in - // effect for this Amazon S3 bucket. - OwnershipControls *OwnershipControls `type:"structure"` -} - -// String returns the string representation -func (s GetBucketOwnershipControlsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketPolicyStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketPolicyStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketRequestPaymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketRequestPaymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketVersioningInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketVersioningOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s GetObjectAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetObjectAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 GetObjectInput struct { - _ struct{} `locationName:"GetObjectRequest" type:"structure"` - - // The bucket name containing the object. - // - // When using this API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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). - 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). - 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). - 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). - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 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 *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 -func (s GetObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s GetObjectLegalHoldInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetObjectLegalHoldOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetObjectLockConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetObjectLockConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS 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"` - - // 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 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"` - - // Last modified 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. - 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 operation 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 AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 -func (s GetObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s GetObjectRetentionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetObjectRetentionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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"` - - // 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 -func (s GetObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s GetObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation -func (s GetObjectTorrentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetObjectTorrentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s GetPublicAccessBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GetPublicAccessBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s GlacierJobParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Grant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 - // AWS 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 AWS 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 -func (s Grantee) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s HeadBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s HeadBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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). - 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). - 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). - 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). - 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"` - - // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 - // (http://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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 *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 -func (s HeadObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 AWS 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"` - - // 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 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"` - - // Last modified 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. - 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, 23 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 AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 AWS KMS - // customer master key (CMK) 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 -func (s HeadObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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. - // - // Suffix is a required field - Suffix *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s IndexDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS 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 -func (s Initiator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s InputSerialization) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s IntelligentTieringAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s IntelligentTieringConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - Prefix *string `type:"string"` - - // A container of a key value name pair. - Tag *Tag `type:"structure"` -} - -// String returns the string representation -func (s IntelligentTieringFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service 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"` - - // Specifies the schedule for generating inventory results. - // - // Schedule is a required field - Schedule *InventorySchedule `type:"structure" required:"true"` -} - -// String returns the string representation -func (s InventoryConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s InventoryDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s InventoryEncryption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s InventoryFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s InventoryS3BucketDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s InventorySchedule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s JSONInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s JSONOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s KeyFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS Lambda notifications. -type LambdaFunctionConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket event for which to invoke the AWS Lambda function. For - // more information, see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - - // 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 Simple Storage Service Developer 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 AWS 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 -func (s LambdaFunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s LifecycleConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s LifecycleExpiration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 *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. - // - // 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 -func (s LifecycleRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 -func (s LifecycleRuleAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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"` - - // Prefix identifying one or more objects to which the rule applies. - 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 -func (s LifecycleRuleFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s ListBucketAnalyticsConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListBucketAnalyticsConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListBucketIntelligentTieringConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListBucketIntelligentTieringConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s ListBucketInventoryConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListBucketInventoryConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s ListBucketMetricsConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListBucketMetricsConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListBucketsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketsInput) GoString() string { - return s.String() -} - -type ListBucketsOutput struct { - _ struct{} `type:"structure"` - - // The list of buckets owned by the requestor. - Buckets []*Bucket `locationNameList:"Bucket" type:"list"` - - // The owner of the buckets listed. - Owner *Owner `type:"structure"` -} - -// String returns the string representation -func (s ListBucketsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s ListMultipartUploadsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - 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 -func (s ListMultipartUploadsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 - // API 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 -func (s ListObjectVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ListObjectVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Specifies the key to start with when listing objects in a bucket. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // Sets the maximum number of keys returned in the response. By default the - // API 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 -func (s ListObjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 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 -func (s ListObjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 - // API 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 -func (s ListObjectsV2Input) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 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 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 - // API 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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 -func (s ListObjectsV2Output) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // 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 -func (s ListPartsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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. - Bucket *string `type:"string"` - - // Container element that identifies who initiated the multipart upload. If - // the initiator is an AWS 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 -func (s ListPartsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s Location) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service 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. - 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 -func (s LoggingEnabled) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s MetadataEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Metrics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 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 -func (s MetricsAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 PUT Bucket metrics -// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html) -// in the Amazon Simple Storage Service API Reference. -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, a tag, 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 -func (s MetricsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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, -// a tag, or a conjunction (MetricsAndOperator). -type MetricsFilter 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 *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 -func (s MetricsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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"` - - // 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 -func (s MultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MultipartUpload) GoString() string { - return s.String() -} - -// 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 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 When an Object Became Noncurrent - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) - // in the Amazon Simple Storage Service Developer Guide. - NoncurrentDays *int64 `type:"integer"` -} - -// String returns the string representation -func (s NoncurrentVersionExpiration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NoncurrentVersionExpiration) GoString() string { - return s.String() -} - -// 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, -// 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, or DEEP_ARCHIVE storage class at a specific period in the object's -// lifetime. -type NoncurrentVersionTransition struct { - _ struct{} `type:"structure"` - - // 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 Simple Storage Service Developer 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 -func (s NoncurrentVersionTransition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NoncurrentVersionTransition) GoString() string { - return s.String() -} - -// 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"` - - // Describes the AWS 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 -func (s NotificationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 AWS 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 -func (s NotificationConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 -func (s NotificationConfigurationFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 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 AWS 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 AWS 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. - 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"` - - // The date the Object was Last Modified - 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 -func (s Object) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Object) GoString() string { - return s.String() -} - -// 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 to delete. - // - // 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 -func (s ObjectIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - ObjectLockEnabled *string `type:"string" enum:"ObjectLockEnabled"` - - // The Object Lock rule in place for the specified object. - Rule *ObjectLockRule `type:"structure"` -} - -// String returns the string representation -func (s ObjectLockConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ObjectLockLegalHold) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ObjectLockRetention) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 retention period that you want to apply to new objects placed - // in the specified bucket. - DefaultRetention *DefaultRetention `type:"structure"` -} - -// String returns the string representation -func (s ObjectLockRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// The version of an object. -type ObjectVersion struct { - _ struct{} `type:"structure"` - - // 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 -func (s ObjectVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ObjectVersion) GoString() string { - return s.String() -} - -// 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 -func (s OutputLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s OutputSerialization) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Owner) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s OwnershipControls) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - // - // ObjectOwnership is a required field - ObjectOwnership *string `type:"string" required:"true" enum:"ObjectOwnership"` -} - -// String returns the string representation -func (s OwnershipControlsRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ParquetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ParquetInput) GoString() string { - return s.String() -} - -// Container for elements related to a part. -type Part struct { - _ struct{} `type:"structure"` - - // 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 -func (s Part) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Part) GoString() string { - return s.String() -} - -// 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 -func (s PolicyStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Progress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ProgressEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 - // AWS 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 -func (s PublicAccessBlockConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s PutBucketAccelerateConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketAccelerateConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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, overwrite, and delete any object in the bucket. - 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 -func (s PutBucketAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s PutBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 - // Simple Storage Service Developer Guide. - // - // CORSConfiguration is a required field - CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" 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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s PutBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 master keys stored in AWS KMS - // (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 Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketEncryptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketEncryptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s PutBucketIntelligentTieringConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s PutBucketIntelligentTieringConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s PutBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketLifecycleConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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/"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation -func (s PutBucketLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s PutBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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/"` -} - -// String returns the string representation -func (s PutBucketNotificationConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -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 -func (s PutBucketNotificationConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketNotificationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketNotificationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The OwnershipControls (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 -func (s PutBucketOwnershipControlsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s PutBucketOwnershipControlsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketRequestPaymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketRequestPaymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketVersioningInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketVersioningOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 -func (s PutBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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, overwrite, and delete any object in the bucket. - 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 operation was initiated. - // - // When using this API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s PutObjectAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutObjectAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 operation was initiated. - // - // When using this API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 operation 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"` - - // 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 operation 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. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 *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 AWS 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 *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 AWS Key Management Service (AWS KMS) - // symmetrical customer managed customer master key (CMK) that was used for - // the object. - // - // If the value of x-amz-server-side-encryption is aws:kms, this header specifies - // the ID of the symmetric customer managed AWS KMS CMK that will be 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 AWS - // managed CMK in AWS to protect the data. - 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 Service Developer 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 -func (s PutObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s PutObjectLegalHoldInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutObjectLegalHoldOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s PutObjectLockConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutObjectLockConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // 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 AWS 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 *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 AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 AWS KMS customer master - // key (CMK) 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 -func (s PutObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates whether this operation should bypass Governance-mode restrictions. - 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s PutObjectRetentionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutObjectRetentionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - 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"` - - // 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 -func (s PutObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -} - -// 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 -func (s PutObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // The account id of the expected bucket owner. If the bucket is owned by a - // different account, the request will fail with an HTTP 403 (Access Denied) - // error. - 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 Simple Storage Service Developer 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 -func (s PutPublicAccessBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s PutPublicAccessBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 Simple Storage Service Developer 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 -func (s QueueConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 -func (s QueueConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s RecordsEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - 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. - ReplaceKeyWith *string `type:"string"` -} - -// String returns the string representation -func (s Redirect) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s RedirectAllRequestsTo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ReplicaModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS 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 Simple Storage Service Developer 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 -func (s ReplicationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Developer 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. - // - // 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 Simple Storage Service Developer 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 master key (CMK) stored in AWS 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 -func (s ReplicationRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ReplicationRuleAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. - 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 -func (s ReplicationRuleFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ReplicationTime) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 values: 15 minutes. - Minutes *int64 `type:"integer"` -} - -// String returns the string representation -func (s ReplicationTimeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s RequestPaymentConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s RequestProgress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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 will fail with an HTTP 403 (Access Denied) - // error. - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Object key for which the operation 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 -func (s RestoreObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 -func (s RestoreObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s RestoreRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 -func (s RoutingRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service 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 Simple Storage Service Developer 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, - // 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, 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. - // - // 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 Simple Storage Service Developer Guide. - Transition *Transition `type:"structure"` -} - -// String returns the string representation -func (s Rule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS Key Management Service (AWS KMS) symmetric customer - // managed customer master key (CMK) to use for encrypting inventory reports. - // - // KeyId is a required field - KeyId *string `type:"string" required:"true" sensitive:"true"` -} - -// String returns the string representation -func (s SSEKMS) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s SSES3) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ScanRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 will fail with an HTTP 403 (Access Denied) - // error. - 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 SSE Algorithm used to encrypt the object. For more information, see Server-Side - // Encryption (Using Customer-Provided Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // The SSE Customer Key. For more information, see Server-Side Encryption (Using - // Customer-Provided Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // The SSE Customer Key MD5. For more information, see Server-Side Encryption - // (Using Customer-Provided Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). - 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 -func (s SelectObjectContentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s SelectObjectContentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s SelectParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. For more information, see PUT Bucket -// encryption (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) -// in the Amazon Simple Storage Service API Reference. -type ServerSideEncryptionByDefault struct { - _ struct{} `type:"structure"` - - // AWS Key Management Service (KMS) customer master 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 CMK. - // However, if you are using encryption with cross-account operations, you must - // use a fully qualified CMK 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 CMKs and not asymmetric CMKs. For more - // information, see Using Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the AWS Key Management Service Developer Guide. - 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 -func (s ServerSideEncryptionByDefault) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s ServerSideEncryptionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer Guide. - BucketKeyEnabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s ServerSideEncryptionRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 master key (CMK) stored in AWS 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 AWS KMS. If you include SourceSelectionCriteria in the replication - // configuration, this element is required. - SseKmsEncryptedObjects *SseKmsEncryptedObjects `type:"structure"` -} - -// String returns the string representation -func (s SourceSelectionCriteria) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS KMS. -type SseKmsEncryptedObjects struct { - _ struct{} `type:"structure"` - - // Specifies whether Amazon S3 replicates objects created with server-side encryption - // using a customer master key (CMK) stored in AWS Key Management Service. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"SseKmsEncryptedObjectsStatus"` -} - -// String returns the string representation -func (s SseKmsEncryptedObjects) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Stats) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s StatsEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s StorageClassAnalysis) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s StorageClassAnalysisDataExport) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Tagging) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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. -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 -func (s TargetGrant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s Tiering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer Guide. - // - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - - // 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 Simple Storage Service Developer 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 -func (s TopicConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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"` - - // 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 -func (s TopicConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 Simple Storage Service Developer 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 -func (s Transition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer 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/dev/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 AWS 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 *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 will fail with an HTTP - // 403 (Access Denied) error. - 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 will fail with an HTTP 403 (Access - // Denied) error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 *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 -func (s UploadPartCopyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 AWS 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 AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) that was used for the - // object. - 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 -func (s UploadPartCopyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 API 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 operation with an access point through the AWS 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/dev/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // When using this API 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 operation using S3 on Outposts through the AWS SDKs, you provide - // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // 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 will fail with an HTTP 403 (Access Denied) - // error. - 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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 Developer 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 *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 -func (s UploadPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 AWS KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // 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 AWS Key Management Service (AWS KMS) - // symmetric customer managed customer master key (CMK) was used for the object. - 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 -func (s UploadPartOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// 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 Simple Storage Service 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 -func (s VersioningConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -func (s WebsiteConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -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" - - // 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, - 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 ( - // 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" -) - -// 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, - } -} - -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" -) - -// 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, - } -} - -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 ( - // 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. -const ( - // ObjectOwnershipBucketOwnerPreferred is a ObjectOwnership enum value - ObjectOwnershipBucketOwnerPreferred = "BucketOwnerPreferred" - - // ObjectOwnershipObjectWriter is a ObjectOwnership enum value - ObjectOwnershipObjectWriter = "ObjectWriter" -) - -// ObjectOwnership_Values returns all elements of the ObjectOwnership enum -func ObjectOwnership_Values() []string { - return []string{ - ObjectOwnershipBucketOwnerPreferred, - ObjectOwnershipObjectWriter, - } -} - -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" -) - -// ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum -func ObjectStorageClass_Values() []string { - return []string{ - ObjectStorageClassStandard, - ObjectStorageClassReducedRedundancy, - ObjectStorageClassGlacier, - ObjectStorageClassStandardIa, - ObjectStorageClassOnezoneIa, - ObjectStorageClassIntelligentTiering, - ObjectStorageClassDeepArchive, - ObjectStorageClassOutposts, - } -} - -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 Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) -// in the Amazon S3 Developer 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" -) - -// StorageClass_Values returns all elements of the StorageClass enum -func StorageClass_Values() []string { - return []string{ - StorageClassStandard, - StorageClassReducedRedundancy, - StorageClassStandardIa, - StorageClassOnezoneIa, - StorageClassIntelligentTiering, - StorageClassGlacier, - StorageClassDeepArchive, - StorageClassOutposts, - } -} - -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" -) - -// TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum -func TransitionStorageClass_Values() []string { - return []string{ - TransitionStorageClassGlacier, - TransitionStorageClassStandardIa, - TransitionStorageClassOnezoneIa, - TransitionStorageClassIntelligentTiering, - TransitionStorageClassDeepArchive, - } -} - -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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go deleted file mode 100644 index 407f06b6ed..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go deleted file mode 100644 index 9ba8a78872..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go deleted file mode 100644 index f1959b03a9..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go +++ /dev/null @@ -1,77 +0,0 @@ -package s3 - -import ( - "github.com/aws/aws-sdk-go/aws/client" - "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) { - // 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(copyMultipartStatusOKUnmarhsalError) - 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) - } -} - -// 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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go deleted file mode 100644 index 0def02255a..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go deleted file mode 100644 index 7f7aca2085..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go +++ /dev/null @@ -1,110 +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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go deleted file mode 100644 index 403aebb688..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go +++ /dev/null @@ -1,201 +0,0 @@ -package s3 - -import ( - "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" -) - -// 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": - if a.Service != "s3" { - return arn.AccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "service is not s3"} - } - return arn.ParseAccessPointResource(a, resParts[1:]) - 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 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 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 - } - - if resReq.HasCustomEndpoint() { - req.Error = s3shared.NewInvalidARNWithCustomEndpointError(resource, nil) - return - } - - switch tv := resource.(type) { - case arn.AccessPointARN: - err = updateRequestAccessPointEndpoint(req, tv) - if err != nil { - req.Error = err - } - case arn.OutpostAccessPointARN: - // outposts does not support FIPS regions - if resReq.ResourceConfiguredForFIPS() { - req.Error = s3shared.NewInvalidARNWithFIPSError(resource, 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 since custom endpoints - // are not supported. - req.Config.DisableEndpointHostPrefix = aws.Bool(false) - - if err := accessPointEndpointBuilder(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 aws.BoolValue(req.Config.UseDualStack) { - return s3shared.NewClientConfiguredForDualStackError(accessPoint, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - } - - // Ignore the disable host prefix for access points since custom endpoints - // are not supported. - 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 = "/" - } -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go deleted file mode 100644 index c1c77da9ad..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go +++ /dev/null @@ -1,177 +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 + "}." -) - -// 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 - cfgRegion := aws.StringValue(req.Config.Region) - - if s3shared.IsFIPS(cfgRegion) { - if aws.BoolValue(req.Config.S3UseARNRegion) && s3shared.IsCrossRegion(req, resolveRegion) { - // FIPS with cross region is not supported, the SDK must fail - // because there is no well defined method for SDK to construct a - // correct FIPS endpoint. - return s3shared.NewClientConfiguredForCrossRegionFIPSError(arn.AccessPointARN(a), - req.ClientInfo.PartitionID, cfgRegion, nil) - } - resolveRegion = cfgRegion - } - - endpoint, err := resolveRegionalEndpoint(req, resolveRegion, resolveService) - if err != nil { - return s3shared.NewFailedToResolveEndpointError(arn.AccessPointARN(a), - req.ClientInfo.PartitionID, cfgRegion, err) - } - - if err = updateRequestEndpoint(req, endpoint.URL); err != nil { - return err - } - - const serviceEndpointLabel = "s3-accesspoint" - - // dual stack provided by endpoint resolver - cfgHost := req.HTTPRequest.URL.Host - if strings.HasPrefix(cfgHost, "s3") { - req.HTTPRequest.URL.Host = serviceEndpointLabel + cfgHost[2:] - } - - 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, - } -} - -// 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 == "s3-outposts" { - endpointsID = "s3" - } - - endpoint, err := resolveRegionalEndpoint(req, resolveRegion, endpointsID) - if err != nil { - return s3shared.NewFailedToResolveEndpointError(o, - req.ClientInfo.PartitionID, resolveRegion, err) - } - - if err = updateRequestEndpoint(req, endpoint.URL); err != nil { - return err - } - - // add url host as s3-outposts - cfgHost := req.HTTPRequest.URL.Host - if strings.HasPrefix(cfgHost, endpointsID) { - req.HTTPRequest.URL.Host = resolveService + cfgHost[len(endpointsID):] - } - - 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 string, 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.S3UsEast1RegionalEndpoint = endpoints.RegionalS3UsEast1Endpoint - }) -} - -func updateRequestEndpoint(r *request.Request, endpoint string) (err error) { - endpoint = endpoints.AddScheme(endpoint, aws.BoolValue(r.Config.DisableSSL)) - - 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 -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go deleted file mode 100644 index f64b55135e..0000000000 --- a/ibm/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 AWS 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 operation is not allowed against this storage tier. - ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" - - // ErrCodeObjectNotInActiveTierError for service response error code - // "ObjectNotInActiveTierError". - // - // The source object of the COPY operation is not in the active tier and is - // only stored in Amazon S3 Glacier. - ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go deleted file mode 100644 index 81cdec1ae7..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go deleted file mode 100644 index 8e6f3307d4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build !go1.6 - -package s3 - -import "github.com/aws/aws-sdk-go/aws/request" - -func platformRequestHandlers(r *request.Request) { -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go deleted file mode 100644 index 14d05f7b75..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go +++ /dev/null @@ -1,28 +0,0 @@ -// +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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/service.go deleted file mode 100644 index b4c07b4d47..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ /dev/null @@ -1,103 +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...) - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName 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", - }, - 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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go deleted file mode 100644 index 57a0bd92ca..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go deleted file mode 100644 index 247770e4c8..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go +++ /dev/null @@ -1,42 +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 copyMultipartStatusOKUnmarhsalError(r *request.Request) { - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "unable to read response body", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - 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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go deleted file mode 100644 index 6eecf66910..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go deleted file mode 100644 index 2596c694b5..0000000000 --- a/ibm/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/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/api.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/api.go deleted file mode 100644 index 4498f285e4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/api.go +++ /dev/null @@ -1,1210 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sso - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/restjson" -) - -const opGetRoleCredentials = "GetRoleCredentials" - -// GetRoleCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the GetRoleCredentials 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 GetRoleCredentials for more information on using the GetRoleCredentials -// 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 GetRoleCredentialsRequest method. -// req, resp := client.GetRoleCredentialsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials -func (c *SSO) GetRoleCredentialsRequest(input *GetRoleCredentialsInput) (req *request.Request, output *GetRoleCredentialsOutput) { - op := &request.Operation{ - Name: opGetRoleCredentials, - HTTPMethod: "GET", - HTTPPath: "/federation/credentials", - } - - if input == nil { - input = &GetRoleCredentialsInput{} - } - - output = &GetRoleCredentialsOutput{} - req = c.newRequest(op, input, output) - req.Config.Credentials = credentials.AnonymousCredentials - return -} - -// GetRoleCredentials API operation for AWS Single Sign-On. -// -// Returns the STS short-term credentials for a given role name that is assigned -// to the user. -// -// 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 Single Sign-On's -// API operation GetRoleCredentials for usage and error information. -// -// Returned Error Types: -// * InvalidRequestException -// Indicates that a problem occurred with the input to the request. For example, -// a required parameter might be missing or out of range. -// -// * UnauthorizedException -// Indicates that the request is not authorized. This can happen due to an invalid -// access token in the request. -// -// * TooManyRequestsException -// Indicates that the request is being made too frequently and is more than -// what the server can handle. -// -// * ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials -func (c *SSO) GetRoleCredentials(input *GetRoleCredentialsInput) (*GetRoleCredentialsOutput, error) { - req, out := c.GetRoleCredentialsRequest(input) - return out, req.Send() -} - -// GetRoleCredentialsWithContext is the same as GetRoleCredentials with the addition of -// the ability to pass a context and additional request options. -// -// See GetRoleCredentials 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 *SSO) GetRoleCredentialsWithContext(ctx aws.Context, input *GetRoleCredentialsInput, opts ...request.Option) (*GetRoleCredentialsOutput, error) { - req, out := c.GetRoleCredentialsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAccountRoles = "ListAccountRoles" - -// ListAccountRolesRequest generates a "aws/request.Request" representing the -// client's request for the ListAccountRoles 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 ListAccountRoles for more information on using the ListAccountRoles -// 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 ListAccountRolesRequest method. -// req, resp := client.ListAccountRolesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles -func (c *SSO) ListAccountRolesRequest(input *ListAccountRolesInput) (req *request.Request, output *ListAccountRolesOutput) { - op := &request.Operation{ - Name: opListAccountRoles, - HTTPMethod: "GET", - HTTPPath: "/assignment/roles", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAccountRolesInput{} - } - - output = &ListAccountRolesOutput{} - req = c.newRequest(op, input, output) - req.Config.Credentials = credentials.AnonymousCredentials - return -} - -// ListAccountRoles API operation for AWS Single Sign-On. -// -// Lists all roles that are assigned to the user for a given AWS 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 Single Sign-On's -// API operation ListAccountRoles for usage and error information. -// -// Returned Error Types: -// * InvalidRequestException -// Indicates that a problem occurred with the input to the request. For example, -// a required parameter might be missing or out of range. -// -// * UnauthorizedException -// Indicates that the request is not authorized. This can happen due to an invalid -// access token in the request. -// -// * TooManyRequestsException -// Indicates that the request is being made too frequently and is more than -// what the server can handle. -// -// * ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles -func (c *SSO) ListAccountRoles(input *ListAccountRolesInput) (*ListAccountRolesOutput, error) { - req, out := c.ListAccountRolesRequest(input) - return out, req.Send() -} - -// ListAccountRolesWithContext is the same as ListAccountRoles with the addition of -// the ability to pass a context and additional request options. -// -// See ListAccountRoles 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 *SSO) ListAccountRolesWithContext(ctx aws.Context, input *ListAccountRolesInput, opts ...request.Option) (*ListAccountRolesOutput, error) { - req, out := c.ListAccountRolesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAccountRolesPages iterates over the pages of a ListAccountRoles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccountRoles 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 ListAccountRoles operation. -// pageNum := 0 -// err := client.ListAccountRolesPages(params, -// func(page *sso.ListAccountRolesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSO) ListAccountRolesPages(input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool) error { - return c.ListAccountRolesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccountRolesPagesWithContext same as ListAccountRolesPages 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 *SSO) ListAccountRolesPagesWithContext(ctx aws.Context, input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAccountRolesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAccountRolesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAccountRolesOutput), !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/sso-2019-06-10/ListAccounts -func (c *SSO) ListAccountsRequest(input *ListAccountsInput) (req *request.Request, output *ListAccountsOutput) { - op := &request.Operation{ - Name: opListAccounts, - HTTPMethod: "GET", - HTTPPath: "/assignment/accounts", - 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) - req.Config.Credentials = credentials.AnonymousCredentials - return -} - -// ListAccounts API operation for AWS Single Sign-On. -// -// Lists all AWS accounts assigned to the user. These AWS accounts are assigned -// by the administrator of the account. For more information, see Assign User -// Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers) -// in the AWS SSO User Guide. This operation returns a paginated response. -// -// 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 Single Sign-On's -// API operation ListAccounts for usage and error information. -// -// Returned Error Types: -// * InvalidRequestException -// Indicates that a problem occurred with the input to the request. For example, -// a required parameter might be missing or out of range. -// -// * UnauthorizedException -// Indicates that the request is not authorized. This can happen due to an invalid -// access token in the request. -// -// * TooManyRequestsException -// Indicates that the request is being made too frequently and is more than -// what the server can handle. -// -// * ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccounts -func (c *SSO) 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 *SSO) 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 *sso.ListAccountsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SSO) 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 *SSO) 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 opLogout = "Logout" - -// LogoutRequest generates a "aws/request.Request" representing the -// client's request for the Logout 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 Logout for more information on using the Logout -// 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 LogoutRequest method. -// req, resp := client.LogoutRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout -func (c *SSO) LogoutRequest(input *LogoutInput) (req *request.Request, output *LogoutOutput) { - op := &request.Operation{ - Name: opLogout, - HTTPMethod: "POST", - HTTPPath: "/logout", - } - - if input == nil { - input = &LogoutInput{} - } - - output = &LogoutOutput{} - req = c.newRequest(op, input, output) - req.Config.Credentials = credentials.AnonymousCredentials - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// Logout API operation for AWS Single Sign-On. -// -// Removes the client- and server-side session that is associated with the user. -// -// 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 Single Sign-On's -// API operation Logout for usage and error information. -// -// Returned Error Types: -// * InvalidRequestException -// Indicates that a problem occurred with the input to the request. For example, -// a required parameter might be missing or out of range. -// -// * UnauthorizedException -// Indicates that the request is not authorized. This can happen due to an invalid -// access token in the request. -// -// * TooManyRequestsException -// Indicates that the request is being made too frequently and is more than -// what the server can handle. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout -func (c *SSO) Logout(input *LogoutInput) (*LogoutOutput, error) { - req, out := c.LogoutRequest(input) - return out, req.Send() -} - -// LogoutWithContext is the same as Logout with the addition of -// the ability to pass a context and additional request options. -// -// See Logout 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 *SSO) LogoutWithContext(ctx aws.Context, input *LogoutInput, opts ...request.Option) (*LogoutOutput, error) { - req, out := c.LogoutRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Provides information about your AWS account. -type AccountInfo struct { - _ struct{} `type:"structure"` - - // The identifier of the AWS account that is assigned to the user. - AccountId *string `locationName:"accountId" type:"string"` - - // The display name of the AWS account that is assigned to the user. - AccountName *string `locationName:"accountName" type:"string"` - - // The email address of the AWS account that is assigned to the user. - EmailAddress *string `locationName:"emailAddress" min:"1" type:"string"` -} - -// String returns the string representation -func (s AccountInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountInfo) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *AccountInfo) SetAccountId(v string) *AccountInfo { - s.AccountId = &v - return s -} - -// SetAccountName sets the AccountName field's value. -func (s *AccountInfo) SetAccountName(v string) *AccountInfo { - s.AccountName = &v - return s -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *AccountInfo) SetEmailAddress(v string) *AccountInfo { - s.EmailAddress = &v - return s -} - -type GetRoleCredentialsInput struct { - _ struct{} `type:"structure"` - - // The token issued by the CreateToken API call. For more information, see CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. - // - // AccessToken is a required field - AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` - - // The identifier for the AWS account that is assigned to the user. - // - // AccountId is a required field - AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"` - - // The friendly name of the role that is assigned to the user. - // - // RoleName is a required field - RoleName *string `location:"querystring" locationName:"role_name" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRoleCredentialsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRoleCredentialsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRoleCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRoleCredentialsInput"} - if s.AccessToken == nil { - invalidParams.Add(request.NewErrParamRequired("AccessToken")) - } - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.RoleName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessToken sets the AccessToken field's value. -func (s *GetRoleCredentialsInput) SetAccessToken(v string) *GetRoleCredentialsInput { - s.AccessToken = &v - return s -} - -// SetAccountId sets the AccountId field's value. -func (s *GetRoleCredentialsInput) SetAccountId(v string) *GetRoleCredentialsInput { - s.AccountId = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *GetRoleCredentialsInput) SetRoleName(v string) *GetRoleCredentialsInput { - s.RoleName = &v - return s -} - -type GetRoleCredentialsOutput struct { - _ struct{} `type:"structure"` - - // The credentials for the role that is assigned to the user. - RoleCredentials *RoleCredentials `locationName:"roleCredentials" type:"structure"` -} - -// String returns the string representation -func (s GetRoleCredentialsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRoleCredentialsOutput) GoString() string { - return s.String() -} - -// SetRoleCredentials sets the RoleCredentials field's value. -func (s *GetRoleCredentialsOutput) SetRoleCredentials(v *RoleCredentials) *GetRoleCredentialsOutput { - s.RoleCredentials = v - return s -} - -// Indicates that a problem occurred with the input to the request. For example, -// a required parameter might be missing or out of range. -type InvalidRequestException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s InvalidRequestException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvalidRequestException) GoString() string { - return s.String() -} - -func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { - return &InvalidRequestException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidRequestException) Code() string { - return "InvalidRequestException" -} - -// Message returns the exception's message. -func (s *InvalidRequestException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidRequestException) OrigErr() error { - return nil -} - -func (s *InvalidRequestException) 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 *InvalidRequestException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidRequestException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAccountRolesInput struct { - _ struct{} `type:"structure"` - - // The token issued by the CreateToken API call. For more information, see CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. - // - // AccessToken is a required field - AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` - - // The identifier for the AWS account that is assigned to the user. - // - // AccountId is a required field - AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"` - - // The number of items that clients can request per page. - MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"` - - // The page token from the previous response output when you request subsequent - // pages. - NextToken *string `location:"querystring" locationName:"next_token" type:"string"` -} - -// String returns the string representation -func (s ListAccountRolesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccountRolesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccountRolesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccountRolesInput"} - if s.AccessToken == nil { - invalidParams.Add(request.NewErrParamRequired("AccessToken")) - } - 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 -} - -// SetAccessToken sets the AccessToken field's value. -func (s *ListAccountRolesInput) SetAccessToken(v string) *ListAccountRolesInput { - s.AccessToken = &v - return s -} - -// SetAccountId sets the AccountId field's value. -func (s *ListAccountRolesInput) SetAccountId(v string) *ListAccountRolesInput { - s.AccountId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAccountRolesInput) SetMaxResults(v int64) *ListAccountRolesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountRolesInput) SetNextToken(v string) *ListAccountRolesInput { - s.NextToken = &v - return s -} - -type ListAccountRolesOutput struct { - _ struct{} `type:"structure"` - - // The page token client that is used to retrieve the list of accounts. - NextToken *string `locationName:"nextToken" type:"string"` - - // A paginated response with the list of roles and the next token if more results - // are available. - RoleList []*RoleInfo `locationName:"roleList" type:"list"` -} - -// String returns the string representation -func (s ListAccountRolesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccountRolesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountRolesOutput) SetNextToken(v string) *ListAccountRolesOutput { - s.NextToken = &v - return s -} - -// SetRoleList sets the RoleList field's value. -func (s *ListAccountRolesOutput) SetRoleList(v []*RoleInfo) *ListAccountRolesOutput { - s.RoleList = v - return s -} - -type ListAccountsInput struct { - _ struct{} `type:"structure"` - - // The token issued by the CreateToken API call. For more information, see CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. - // - // AccessToken is a required field - AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` - - // This is the number of items clients can request per page. - MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"` - - // (Optional) When requesting subsequent pages, this is the page token from - // the previous response output. - NextToken *string `location:"querystring" locationName:"next_token" type:"string"` -} - -// String returns the string representation -func (s ListAccountsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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.AccessToken == nil { - invalidParams.Add(request.NewErrParamRequired("AccessToken")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessToken sets the AccessToken field's value. -func (s *ListAccountsInput) SetAccessToken(v string) *ListAccountsInput { - s.AccessToken = &v - return s -} - -// 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 paginated response with the list of account information and the next token - // if more results are available. - AccountList []*AccountInfo `locationName:"accountList" type:"list"` - - // The page token client that is used to retrieve the list of accounts. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListAccountsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAccountsOutput) GoString() string { - return s.String() -} - -// SetAccountList sets the AccountList field's value. -func (s *ListAccountsOutput) SetAccountList(v []*AccountInfo) *ListAccountsOutput { - s.AccountList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput { - s.NextToken = &v - return s -} - -type LogoutInput struct { - _ struct{} `type:"structure"` - - // The token issued by the CreateToken API call. For more information, see CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. - // - // AccessToken is a required field - AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` -} - -// String returns the string representation -func (s LogoutInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogoutInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LogoutInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LogoutInput"} - if s.AccessToken == nil { - invalidParams.Add(request.NewErrParamRequired("AccessToken")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessToken sets the AccessToken field's value. -func (s *LogoutInput) SetAccessToken(v string) *LogoutInput { - s.AccessToken = &v - return s -} - -type LogoutOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s LogoutOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogoutOutput) GoString() string { - return s.String() -} - -// The specified resource doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ResourceNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} - -// Provides information about the role credentials that are assigned to the -// user. -type RoleCredentials struct { - _ struct{} `type:"structure"` - - // The identifier used for the temporary security credentials. For more information, - // see Using Temporary Security Credentials to Request Access to AWS Resources - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) - // in the AWS IAM User Guide. - AccessKeyId *string `locationName:"accessKeyId" type:"string"` - - // The date on which temporary security credentials expire. - Expiration *int64 `locationName:"expiration" type:"long"` - - // The key that is used to sign the request. For more information, see Using - // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) - // in the AWS IAM User Guide. - SecretAccessKey *string `locationName:"secretAccessKey" type:"string" sensitive:"true"` - - // The token used for temporary credentials. For more information, see Using - // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) - // in the AWS IAM User Guide. - SessionToken *string `locationName:"sessionToken" type:"string" sensitive:"true"` -} - -// String returns the string representation -func (s RoleCredentials) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RoleCredentials) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *RoleCredentials) SetAccessKeyId(v string) *RoleCredentials { - s.AccessKeyId = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *RoleCredentials) SetExpiration(v int64) *RoleCredentials { - s.Expiration = &v - return s -} - -// SetSecretAccessKey sets the SecretAccessKey field's value. -func (s *RoleCredentials) SetSecretAccessKey(v string) *RoleCredentials { - s.SecretAccessKey = &v - return s -} - -// SetSessionToken sets the SessionToken field's value. -func (s *RoleCredentials) SetSessionToken(v string) *RoleCredentials { - s.SessionToken = &v - return s -} - -// Provides information about the role that is assigned to the user. -type RoleInfo struct { - _ struct{} `type:"structure"` - - // The identifier of the AWS account assigned to the user. - AccountId *string `locationName:"accountId" type:"string"` - - // The friendly name of the role that is assigned to the user. - RoleName *string `locationName:"roleName" type:"string"` -} - -// String returns the string representation -func (s RoleInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RoleInfo) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *RoleInfo) SetAccountId(v string) *RoleInfo { - s.AccountId = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *RoleInfo) SetRoleName(v string) *RoleInfo { - s.RoleName = &v - return s -} - -// Indicates that the request is being made too frequently and is more than -// what the server can handle. -type TooManyRequestsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s TooManyRequestsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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", s.Code(), s.Message()) -} - -// 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 -} - -// Indicates that the request is not authorized. This can happen due to an invalid -// access token in the request. -type UnauthorizedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s UnauthorizedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnauthorizedException) GoString() string { - return s.String() -} - -func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { - return &UnauthorizedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnauthorizedException) Code() string { - return "UnauthorizedException" -} - -// Message returns the exception's message. -func (s *UnauthorizedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnauthorizedException) OrigErr() error { - return nil -} - -func (s *UnauthorizedException) 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 *UnauthorizedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnauthorizedException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go deleted file mode 100644 index 92d82b2afb..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sso provides the client and types for making API -// requests to AWS Single Sign-On. -// -// AWS Single Sign-On Portal is a web service that makes it easy for you to -// assign user access to AWS SSO resources such as the user portal. Users can -// get AWS account applications and roles assigned to them and get federated -// into the application. -// -// For general information about AWS SSO, see What is AWS Single Sign-On? (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) -// in the AWS SSO User Guide. -// -// This API reference guide describes the AWS SSO Portal operations that you -// can call programatically and includes detailed information on data types -// and errors. -// -// AWS provides SDKs that consist of libraries and sample code for various programming -// languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs -// provide a convenient way to create programmatic access to AWS SSO and other -// AWS services. For more information about the AWS SDKs, including how to download -// and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/). -// -// See https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10 for more information on this service. -// -// See sso package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sso/ -// -// Using the Client -// -// To contact AWS Single Sign-On 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 Single Sign-On client SSO for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sso/#New -package sso diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go deleted file mode 100644 index 77a6792e35..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sso - -import ( - "github.com/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeInvalidRequestException for service response error code - // "InvalidRequestException". - // - // Indicates that a problem occurred with the input to the request. For example, - // a required parameter might be missing or out of range. - ErrCodeInvalidRequestException = "InvalidRequestException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeTooManyRequestsException for service response error code - // "TooManyRequestsException". - // - // Indicates that the request is being made too frequently and is more than - // what the server can handle. - ErrCodeTooManyRequestsException = "TooManyRequestsException" - - // ErrCodeUnauthorizedException for service response error code - // "UnauthorizedException". - // - // Indicates that the request is not authorized. This can happen due to an invalid - // access token in the request. - ErrCodeUnauthorizedException = "UnauthorizedException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "InvalidRequestException": newErrorInvalidRequestException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "TooManyRequestsException": newErrorTooManyRequestsException, - "UnauthorizedException": newErrorUnauthorizedException, -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/service.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/service.go deleted file mode 100644 index 35175331fc..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/service.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sso - -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/restjson" -) - -// SSO provides the API operation methods for making requests to -// AWS Single Sign-On. See this package's package overview docs -// for details on the service. -// -// SSO methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SSO 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 = "SSO" // Name of service. - EndpointsID = "portal.sso" // ID to lookup a service endpoint with. - ServiceID = "SSO" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SSO 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 SSO client from just a session. -// svc := sso.New(mySession) -// -// // Create a SSO client with additional configuration -// svc := sso.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SSO { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "awsssoportal" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SSO { - svc := &SSO{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2019-06-10", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SSO operation and runs any -// custom request initialization. -func (c *SSO) 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/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go deleted file mode 100644 index 4cac247c18..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ssoiface provides an interface to enable mocking the AWS Single Sign-On service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package ssoiface - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/sso" -) - -// SSOAPI provides an interface to enable mocking the -// sso.SSO service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Single Sign-On. -// func myFunc(svc ssoiface.SSOAPI) bool { -// // Make svc.GetRoleCredentials request -// } -// -// func main() { -// sess := session.New() -// svc := sso.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSSOClient struct { -// ssoiface.SSOAPI -// } -// func (m *mockSSOClient) GetRoleCredentials(input *sso.GetRoleCredentialsInput) (*sso.GetRoleCredentialsOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSSOClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SSOAPI interface { - GetRoleCredentials(*sso.GetRoleCredentialsInput) (*sso.GetRoleCredentialsOutput, error) - GetRoleCredentialsWithContext(aws.Context, *sso.GetRoleCredentialsInput, ...request.Option) (*sso.GetRoleCredentialsOutput, error) - GetRoleCredentialsRequest(*sso.GetRoleCredentialsInput) (*request.Request, *sso.GetRoleCredentialsOutput) - - ListAccountRoles(*sso.ListAccountRolesInput) (*sso.ListAccountRolesOutput, error) - ListAccountRolesWithContext(aws.Context, *sso.ListAccountRolesInput, ...request.Option) (*sso.ListAccountRolesOutput, error) - ListAccountRolesRequest(*sso.ListAccountRolesInput) (*request.Request, *sso.ListAccountRolesOutput) - - ListAccountRolesPages(*sso.ListAccountRolesInput, func(*sso.ListAccountRolesOutput, bool) bool) error - ListAccountRolesPagesWithContext(aws.Context, *sso.ListAccountRolesInput, func(*sso.ListAccountRolesOutput, bool) bool, ...request.Option) error - - ListAccounts(*sso.ListAccountsInput) (*sso.ListAccountsOutput, error) - ListAccountsWithContext(aws.Context, *sso.ListAccountsInput, ...request.Option) (*sso.ListAccountsOutput, error) - ListAccountsRequest(*sso.ListAccountsInput) (*request.Request, *sso.ListAccountsOutput) - - ListAccountsPages(*sso.ListAccountsInput, func(*sso.ListAccountsOutput, bool) bool) error - ListAccountsPagesWithContext(aws.Context, *sso.ListAccountsInput, func(*sso.ListAccountsOutput, bool) bool, ...request.Option) error - - Logout(*sso.LogoutInput) (*sso.LogoutOutput, error) - LogoutWithContext(aws.Context, *sso.LogoutInput, ...request.Option) (*sso.LogoutOutput, error) - LogoutRequest(*sso.LogoutInput) (*request.Request, *sso.LogoutOutput) -} - -var _ SSOAPI = (*sso.SSO)(nil) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/api.go deleted file mode 100644 index bfc4372f9f..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ /dev/null @@ -1,3119 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sts - -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/credentials" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAssumeRole = "AssumeRole" - -// AssumeRoleRequest generates a "aws/request.Request" representing the -// client's request for the AssumeRole 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 AssumeRole for more information on using the AssumeRole -// 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 AssumeRoleRequest method. -// req, resp := client.AssumeRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole -func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) { - op := &request.Operation{ - Name: opAssumeRole, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssumeRoleInput{} - } - - output = &AssumeRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssumeRole API operation for AWS Security Token Service. -// -// Returns a set of temporary security credentials that you can use to access -// AWS resources that you might not normally have access to. These temporary -// credentials consist of an access key ID, a secret access key, and a security -// token. Typically, you use AssumeRole within your account or for cross-account -// access. For a comparison of AssumeRole with other API operations that produce -// temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) -// in the IAM User Guide. -// -// You cannot use AWS account root user credentials to call AssumeRole. You -// must use credentials for an IAM user or an IAM role to call AssumeRole. -// -// For cross-account access, imagine that you own multiple accounts and need -// to access resources in each account. You could create long-term credentials -// in each account to access those resources. However, managing all those credentials -// and remembering which one can access which account can be time consuming. -// Instead, you can create one set of long-term credentials in one account. -// Then use temporary security credentials to access all the other accounts -// by assuming roles in those accounts. For more information about roles, see -// IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) -// in the IAM User Guide. -// -// Session Duration -// -// By default, the temporary security credentials created by AssumeRole last -// for one hour. However, you can use the optional DurationSeconds parameter -// to specify the duration of your session. You can provide a value from 900 -// seconds (15 minutes) up to the maximum session duration setting for the role. -// This setting can have a value from 1 hour to 12 hours. To learn how to view -// the maximum value for your role, see View the Maximum Session Duration Setting -// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) -// in the IAM User Guide. The maximum session duration limit applies when you -// use the AssumeRole* API operations or the assume-role* CLI commands. However -// the limit does not apply when you use those operations to create a console -// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) -// in the IAM User Guide. -// -// Permissions -// -// The temporary security credentials created by AssumeRole can be used to make -// API calls to any AWS service with the following exception: You cannot call -// the AWS STS GetFederationToken or GetSessionToken API operations. -// -// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline -// and managed session policies can't exceed 2,048 characters. Passing policies -// to this operation returns new temporary credentials. The resulting session's -// permissions are the intersection of the role's identity-based policy and -// the session policies. You can use the role's temporary credentials in subsequent -// AWS API calls to access resources in the account that owns the role. You -// cannot use session policies to grant more permissions than those allowed -// by the identity-based policy of the role that is being assumed. For more -// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// in the IAM User Guide. -// -// To assume a role from a different account, your AWS account must be trusted -// by the role. The trust relationship is defined in the role's trust policy -// when the role is created. That trust policy states which accounts are allowed -// to delegate that access to users in the account. -// -// A user who wants to access a role in a different account must also have permissions -// that are delegated from the user account administrator. The administrator -// must attach a policy that allows the user to call AssumeRole for the ARN -// of the role in the other account. If the user is in the same account as the -// role, then you can do either of the following: -// -// * Attach a policy to the user (identical to the previous user in a different -// account). -// -// * Add the user as a principal directly in the role's trust policy. -// -// In this case, the trust policy acts as an IAM resource-based policy. Users -// in the same account as the role do not need explicit permission to assume -// the role. For more information about trust policies and resource-based policies, -// see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) -// in the IAM User Guide. -// -// Tags -// -// (Optional) You can pass tag key-value pairs to your session. These tags are -// called session tags. For more information about session tags, see Passing -// Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// An administrator must grant you the permissions necessary to pass session -// tags. The administrator can also create granular permissions to allow you -// to pass only specific session tags. For more information, see Tutorial: Using -// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) -// in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during -// role chaining. For more information, see Chaining Roles with Session Tags -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) -// in the IAM User Guide. -// -// Using MFA with AssumeRole -// -// (Optional) You can include multi-factor authentication (MFA) information -// when you call AssumeRole. This is useful for cross-account scenarios to ensure -// that the user that assumes the role has been authenticated with an AWS MFA -// device. In that scenario, the trust policy of the role being assumed includes -// a condition that tests for MFA authentication. If the caller does not include -// valid MFA information, the request to assume the role is denied. The condition -// in a trust policy that tests for MFA authentication might look like the following -// example. -// -// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} -// -// For more information, see Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) -// in the IAM User Guide guide. -// -// To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode -// parameters. The SerialNumber value identifies the user's hardware or virtual -// MFA device. The TokenCode is the time-based one-time password (TOTP) that -// the MFA device produces. -// -// 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 Security Token Service's -// API operation AssumeRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the total packed size of the session policies -// and session tags combined was too large. An AWS conversion compresses the -// session policy document, session policy ARNs, and session tags into a packed -// binary format that has a separate limit. The error message indicates by percentage -// how close the policies and tags are to the upper size limit. For more information, -// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// You could receive this error even though you meet other defined session policy -// and session tag limits. For more information, see IAM and STS Entity Character -// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// * ErrCodeRegionDisabledException "RegionDisabledException" -// STS is not activated in the requested region for the account that is being -// asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// * ErrCodeExpiredTokenException "ExpiredTokenException" -// The web identity token that was passed is expired or is not valid. Get a -// new identity token from the identity provider and then retry the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole -func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) { - req, out := c.AssumeRoleRequest(input) - return out, req.Send() -} - -// AssumeRoleWithContext is the same as AssumeRole with the addition of -// the ability to pass a context and additional request options. -// -// See AssumeRole 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 *STS) AssumeRoleWithContext(ctx aws.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error) { - req, out := c.AssumeRoleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssumeRoleWithSAML = "AssumeRoleWithSAML" - -// AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the -// client's request for the AssumeRoleWithSAML 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 AssumeRoleWithSAML for more information on using the AssumeRoleWithSAML -// 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 AssumeRoleWithSAMLRequest method. -// req, resp := client.AssumeRoleWithSAMLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML -func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) { - op := &request.Operation{ - Name: opAssumeRoleWithSAML, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssumeRoleWithSAMLInput{} - } - - output = &AssumeRoleWithSAMLOutput{} - req = c.newRequest(op, input, output) - req.Config.Credentials = credentials.AnonymousCredentials - return -} - -// AssumeRoleWithSAML API operation for AWS Security Token Service. -// -// Returns a set of temporary security credentials for users who have been authenticated -// via a SAML authentication response. This operation provides a mechanism for -// tying an enterprise identity store or directory to role-based AWS access -// without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML -// with the other API operations that produce temporary credentials, see Requesting -// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) -// in the IAM User Guide. -// -// The temporary security credentials returned by this operation consist of -// an access key ID, a secret access key, and a security token. Applications -// can use these temporary security credentials to sign calls to AWS services. -// -// Session Duration -// -// By default, the temporary security credentials created by AssumeRoleWithSAML -// last for one hour. However, you can use the optional DurationSeconds parameter -// to specify the duration of your session. Your role session lasts for the -// duration that you specify, or until the time specified in the SAML authentication -// response's SessionNotOnOrAfter value, whichever is shorter. You can provide -// a DurationSeconds value from 900 seconds (15 minutes) up to the maximum session -// duration setting for the role. This setting can have a value from 1 hour -// to 12 hours. To learn how to view the maximum value for your role, see View -// the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) -// in the IAM User Guide. The maximum session duration limit applies when you -// use the AssumeRole* API operations or the assume-role* CLI commands. However -// the limit does not apply when you use those operations to create a console -// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) -// in the IAM User Guide. -// -// Permissions -// -// The temporary security credentials created by AssumeRoleWithSAML can be used -// to make API calls to any AWS service with the following exception: you cannot -// call the STS GetFederationToken or GetSessionToken API operations. -// -// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline -// and managed session policies can't exceed 2,048 characters. Passing policies -// to this operation returns new temporary credentials. The resulting session's -// permissions are the intersection of the role's identity-based policy and -// the session policies. You can use the role's temporary credentials in subsequent -// AWS API calls to access resources in the account that owns the role. You -// cannot use session policies to grant more permissions than those allowed -// by the identity-based policy of the role that is being assumed. For more -// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// in the IAM User Guide. -// -// Calling AssumeRoleWithSAML does not require the use of AWS security credentials. -// The identity of the caller is validated by using keys in the metadata document -// that is uploaded for the SAML provider entity for your identity provider. -// -// Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail -// logs. The entry includes the value in the NameID element of the SAML assertion. -// We recommend that you use a NameIDType that is not associated with any personally -// identifiable information (PII). For example, you could instead use the persistent -// identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). -// -// Tags -// -// (Optional) You can configure your IdP to pass attributes into your SAML assertion -// as session tags. Each session tag consists of a key name and an associated -// value. For more information about session tags, see Passing Session Tags -// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// You can pass up to 50 session tags. The plain text session tag keys can’t -// exceed 128 characters and the values can’t exceed 256 characters. For these -// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) -// in the IAM User Guide. -// -// An AWS conversion compresses the passed session policies and session tags -// into a packed binary format that has a separate limit. Your request can fail -// for this limit even if your plain text meets the other requirements. The -// PackedPolicySize response element indicates by percentage how close the policies -// and tags for your request are to the upper size limit. -// -// You can pass a session tag with the same key as a tag that is attached to -// the role. When you do, session tags override the role's tags with the same -// key. -// -// An administrator must grant you the permissions necessary to pass session -// tags. The administrator can also create granular permissions to allow you -// to pass only specific session tags. For more information, see Tutorial: Using -// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) -// in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during -// role chaining. For more information, see Chaining Roles with Session Tags -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) -// in the IAM User Guide. -// -// SAML Configuration -// -// Before your application can call AssumeRoleWithSAML, you must configure your -// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, -// you must use AWS Identity and Access Management (IAM) to create a SAML provider -// entity in your AWS account that represents your identity provider. You must -// also create an IAM role that specifies this SAML provider in its trust policy. -// -// For more information, see the following resources: -// -// * About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) -// in the IAM User Guide. -// -// * Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) -// in the IAM User Guide. -// -// * Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) -// in the IAM User Guide. -// -// * Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) -// in the IAM 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 Security Token Service's -// API operation AssumeRoleWithSAML for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the total packed size of the session policies -// and session tags combined was too large. An AWS conversion compresses the -// session policy document, session policy ARNs, and session tags into a packed -// binary format that has a separate limit. The error message indicates by percentage -// how close the policies and tags are to the upper size limit. For more information, -// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// You could receive this error even though you meet other defined session policy -// and session tag limits. For more information, see IAM and STS Entity Character -// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" -// The identity provider (IdP) reported that authentication failed. This might -// be because the claim is invalid. -// -// If this error is returned for the AssumeRoleWithWebIdentity operation, it -// can also mean that the claim has expired or has been explicitly revoked. -// -// * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" -// The web identity token that was passed could not be validated by AWS. Get -// a new identity token from the identity provider and then retry the request. -// -// * ErrCodeExpiredTokenException "ExpiredTokenException" -// The web identity token that was passed is expired or is not valid. Get a -// new identity token from the identity provider and then retry the request. -// -// * ErrCodeRegionDisabledException "RegionDisabledException" -// STS is not activated in the requested region for the account that is being -// asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML -func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) { - req, out := c.AssumeRoleWithSAMLRequest(input) - return out, req.Send() -} - -// AssumeRoleWithSAMLWithContext is the same as AssumeRoleWithSAML with the addition of -// the ability to pass a context and additional request options. -// -// See AssumeRoleWithSAML 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 *STS) AssumeRoleWithSAMLWithContext(ctx aws.Context, input *AssumeRoleWithSAMLInput, opts ...request.Option) (*AssumeRoleWithSAMLOutput, error) { - req, out := c.AssumeRoleWithSAMLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" - -// AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the -// client's request for the AssumeRoleWithWebIdentity 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 AssumeRoleWithWebIdentity for more information on using the AssumeRoleWithWebIdentity -// 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 AssumeRoleWithWebIdentityRequest method. -// req, resp := client.AssumeRoleWithWebIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity -func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) { - op := &request.Operation{ - Name: opAssumeRoleWithWebIdentity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssumeRoleWithWebIdentityInput{} - } - - output = &AssumeRoleWithWebIdentityOutput{} - req = c.newRequest(op, input, output) - req.Config.Credentials = credentials.AnonymousCredentials - return -} - -// AssumeRoleWithWebIdentity API operation for AWS Security Token Service. -// -// Returns a set of temporary security credentials for users who have been authenticated -// in a mobile or web application with a web identity provider. Example providers -// include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID -// Connect-compatible identity provider. -// -// For mobile applications, we recommend that you use Amazon Cognito. You can -// use Amazon Cognito with the AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) -// and the AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) -// to uniquely identify a user. You can also supply the user with a consistent -// identity throughout the lifetime of an application. -// -// To learn more about Amazon Cognito, see Amazon Cognito Overview (https://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840) -// in AWS SDK for Android Developer Guide and Amazon Cognito Overview (https://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664) -// in the AWS SDK for iOS Developer Guide. -// -// Calling AssumeRoleWithWebIdentity does not require the use of AWS security -// credentials. Therefore, you can distribute an application (for example, on -// mobile devices) that requests temporary security credentials without including -// long-term AWS credentials in the application. You also don't need to deploy -// server-based proxy services that use long-term AWS credentials. Instead, -// the identity of the caller is validated by using a token from the web identity -// provider. For a comparison of AssumeRoleWithWebIdentity with the other API -// operations that produce temporary credentials, see Requesting Temporary Security -// Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) -// in the IAM User Guide. -// -// The temporary security credentials returned by this API consist of an access -// key ID, a secret access key, and a security token. Applications can use these -// temporary security credentials to sign calls to AWS service API operations. -// -// Session Duration -// -// By default, the temporary security credentials created by AssumeRoleWithWebIdentity -// last for one hour. However, you can use the optional DurationSeconds parameter -// to specify the duration of your session. You can provide a value from 900 -// seconds (15 minutes) up to the maximum session duration setting for the role. -// This setting can have a value from 1 hour to 12 hours. To learn how to view -// the maximum value for your role, see View the Maximum Session Duration Setting -// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) -// in the IAM User Guide. The maximum session duration limit applies when you -// use the AssumeRole* API operations or the assume-role* CLI commands. However -// the limit does not apply when you use those operations to create a console -// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) -// in the IAM User Guide. -// -// Permissions -// -// The temporary security credentials created by AssumeRoleWithWebIdentity can -// be used to make API calls to any AWS service with the following exception: -// you cannot call the STS GetFederationToken or GetSessionToken API operations. -// -// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline -// and managed session policies can't exceed 2,048 characters. Passing policies -// to this operation returns new temporary credentials. The resulting session's -// permissions are the intersection of the role's identity-based policy and -// the session policies. You can use the role's temporary credentials in subsequent -// AWS API calls to access resources in the account that owns the role. You -// cannot use session policies to grant more permissions than those allowed -// by the identity-based policy of the role that is being assumed. For more -// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// in the IAM User Guide. -// -// Tags -// -// (Optional) You can configure your IdP to pass attributes into your web identity -// token as session tags. Each session tag consists of a key name and an associated -// value. For more information about session tags, see Passing Session Tags -// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// You can pass up to 50 session tags. The plain text session tag keys can’t -// exceed 128 characters and the values can’t exceed 256 characters. For these -// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) -// in the IAM User Guide. -// -// An AWS conversion compresses the passed session policies and session tags -// into a packed binary format that has a separate limit. Your request can fail -// for this limit even if your plain text meets the other requirements. The -// PackedPolicySize response element indicates by percentage how close the policies -// and tags for your request are to the upper size limit. -// -// You can pass a session tag with the same key as a tag that is attached to -// the role. When you do, the session tag overrides the role tag with the same -// key. -// -// An administrator must grant you the permissions necessary to pass session -// tags. The administrator can also create granular permissions to allow you -// to pass only specific session tags. For more information, see Tutorial: Using -// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) -// in the IAM User Guide. -// -// You can set the session tags as transitive. Transitive tags persist during -// role chaining. For more information, see Chaining Roles with Session Tags -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) -// in the IAM User Guide. -// -// Identities -// -// Before your application can call AssumeRoleWithWebIdentity, you must have -// an identity token from a supported identity provider and create a role that -// the application can assume. The role that your application assumes must trust -// the identity provider that is associated with the identity token. In other -// words, the identity provider must be specified in the role's trust policy. -// -// Calling AssumeRoleWithWebIdentity can result in an entry in your AWS CloudTrail -// logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims) -// of the provided Web Identity Token. We recommend that you avoid using any -// personally identifiable information (PII) in this field. For example, you -// could instead use a GUID or a pairwise identifier, as suggested in the OIDC -// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes). -// -// For more information about how to use web identity federation and the AssumeRoleWithWebIdentity -// API, see the following resources: -// -// * Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) -// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). -// -// * Web Identity Federation Playground (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/). -// Walk through the process of authenticating through Login with Amazon, -// Facebook, or Google, getting temporary security credentials, and then -// using those credentials to make a request to AWS. -// -// * AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and -// AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/). -// These toolkits contain sample apps that show how to invoke the identity -// providers. The toolkits then show how to use the information from these -// providers to get and use temporary security credentials. -// -// * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications). -// This article discusses web identity federation and shows an example of -// how to use web identity federation to get access to content in Amazon -// S3. -// -// 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 Security Token Service's -// API operation AssumeRoleWithWebIdentity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the total packed size of the session policies -// and session tags combined was too large. An AWS conversion compresses the -// session policy document, session policy ARNs, and session tags into a packed -// binary format that has a separate limit. The error message indicates by percentage -// how close the policies and tags are to the upper size limit. For more information, -// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// You could receive this error even though you meet other defined session policy -// and session tag limits. For more information, see IAM and STS Entity Character -// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" -// The identity provider (IdP) reported that authentication failed. This might -// be because the claim is invalid. -// -// If this error is returned for the AssumeRoleWithWebIdentity operation, it -// can also mean that the claim has expired or has been explicitly revoked. -// -// * ErrCodeIDPCommunicationErrorException "IDPCommunicationError" -// The request could not be fulfilled because the identity provider (IDP) that -// was asked to verify the incoming identity token could not be reached. This -// is often a transient error caused by network conditions. Retry the request -// a limited number of times so that you don't exceed the request rate. If the -// error persists, the identity provider might be down or not responding. -// -// * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" -// The web identity token that was passed could not be validated by AWS. Get -// a new identity token from the identity provider and then retry the request. -// -// * ErrCodeExpiredTokenException "ExpiredTokenException" -// The web identity token that was passed is expired or is not valid. Get a -// new identity token from the identity provider and then retry the request. -// -// * ErrCodeRegionDisabledException "RegionDisabledException" -// STS is not activated in the requested region for the account that is being -// asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity -func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) { - req, out := c.AssumeRoleWithWebIdentityRequest(input) - return out, req.Send() -} - -// AssumeRoleWithWebIdentityWithContext is the same as AssumeRoleWithWebIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See AssumeRoleWithWebIdentity 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 *STS) AssumeRoleWithWebIdentityWithContext(ctx aws.Context, input *AssumeRoleWithWebIdentityInput, opts ...request.Option) (*AssumeRoleWithWebIdentityOutput, error) { - req, out := c.AssumeRoleWithWebIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" - -// DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the -// client's request for the DecodeAuthorizationMessage 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 DecodeAuthorizationMessage for more information on using the DecodeAuthorizationMessage -// 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 DecodeAuthorizationMessageRequest method. -// req, resp := client.DecodeAuthorizationMessageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage -func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) { - op := &request.Operation{ - Name: opDecodeAuthorizationMessage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DecodeAuthorizationMessageInput{} - } - - output = &DecodeAuthorizationMessageOutput{} - req = c.newRequest(op, input, output) - return -} - -// DecodeAuthorizationMessage API operation for AWS Security Token Service. -// -// Decodes additional information about the authorization status of a request -// from an encoded message returned in response to an AWS request. -// -// For example, if a user is not authorized to perform an operation that he -// or she has requested, the request returns a Client.UnauthorizedOperation -// response (an HTTP 403 response). Some AWS operations additionally return -// an encoded message that can provide details about this authorization failure. -// -// Only certain AWS operations return an encoded authorization message. The -// documentation for an individual operation indicates whether that operation -// returns an encoded message in addition to returning an HTTP code. -// -// The message is encoded because the details of the authorization status can -// constitute privileged information that the user who requested the operation -// should not see. To decode an authorization status message, a user must be -// granted permissions via an IAM policy to request the DecodeAuthorizationMessage -// (sts:DecodeAuthorizationMessage) action. -// -// The decoded message includes the following type of information: -// -// * Whether the request was denied due to an explicit deny or due to the -// absence of an explicit allow. For more information, see Determining Whether -// a Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) -// in the IAM User Guide. -// -// * The principal who made the request. -// -// * The requested action. -// -// * The requested resource. -// -// * The values of condition keys in the context of the user's 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 AWS Security Token Service's -// API operation DecodeAuthorizationMessage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidAuthorizationMessageException "InvalidAuthorizationMessageException" -// The error returned if the message passed to DecodeAuthorizationMessage was -// invalid. This can happen if the token contains invalid characters, such as -// linebreaks. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage -func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) { - req, out := c.DecodeAuthorizationMessageRequest(input) - return out, req.Send() -} - -// DecodeAuthorizationMessageWithContext is the same as DecodeAuthorizationMessage with the addition of -// the ability to pass a context and additional request options. -// -// See DecodeAuthorizationMessage 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 *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *DecodeAuthorizationMessageInput, opts ...request.Option) (*DecodeAuthorizationMessageOutput, error) { - req, out := c.DecodeAuthorizationMessageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccessKeyInfo = "GetAccessKeyInfo" - -// GetAccessKeyInfoRequest generates a "aws/request.Request" representing the -// client's request for the GetAccessKeyInfo 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 GetAccessKeyInfo for more information on using the GetAccessKeyInfo -// 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 GetAccessKeyInfoRequest method. -// req, resp := client.GetAccessKeyInfoRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo -func (c *STS) GetAccessKeyInfoRequest(input *GetAccessKeyInfoInput) (req *request.Request, output *GetAccessKeyInfoOutput) { - op := &request.Operation{ - Name: opGetAccessKeyInfo, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAccessKeyInfoInput{} - } - - output = &GetAccessKeyInfoOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccessKeyInfo API operation for AWS Security Token Service. -// -// Returns the account identifier for the specified access key ID. -// -// Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) -// and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). -// For more information about access keys, see Managing Access Keys for IAM -// Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) -// in the IAM User Guide. -// -// When you pass an access key ID to this operation, it returns the ID of the -// AWS account to which the keys belong. Access key IDs beginning with AKIA -// are long-term credentials for an IAM user or the AWS account root user. Access -// key IDs beginning with ASIA are temporary credentials that are created using -// STS operations. If the account in the response belongs to you, you can sign -// in as the root user and review your root user access keys. Then, you can -// pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) -// to learn which IAM user owns the keys. To learn who requested the temporary -// credentials for an ASIA access key, view the STS events in your CloudTrail -// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) -// in the IAM User Guide. -// -// This operation does not indicate the state of the access key. The key might -// be active, inactive, or deleted. Active keys might not have permissions to -// perform an operation. Providing a deleted access key might return an error -// that the key doesn't exist. -// -// 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 Security Token Service's -// API operation GetAccessKeyInfo for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo -func (c *STS) GetAccessKeyInfo(input *GetAccessKeyInfoInput) (*GetAccessKeyInfoOutput, error) { - req, out := c.GetAccessKeyInfoRequest(input) - return out, req.Send() -} - -// GetAccessKeyInfoWithContext is the same as GetAccessKeyInfo with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccessKeyInfo 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 *STS) GetAccessKeyInfoWithContext(ctx aws.Context, input *GetAccessKeyInfoInput, opts ...request.Option) (*GetAccessKeyInfoOutput, error) { - req, out := c.GetAccessKeyInfoRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCallerIdentity = "GetCallerIdentity" - -// GetCallerIdentityRequest generates a "aws/request.Request" representing the -// client's request for the GetCallerIdentity 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 GetCallerIdentity for more information on using the GetCallerIdentity -// 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 GetCallerIdentityRequest method. -// req, resp := client.GetCallerIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity -func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) { - op := &request.Operation{ - Name: opGetCallerIdentity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCallerIdentityInput{} - } - - output = &GetCallerIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCallerIdentity API operation for AWS Security Token Service. -// -// Returns details about the IAM user or role whose credentials are used to -// call the operation. -// -// No permissions are required to perform this operation. If an administrator -// adds a policy to your IAM user or role that explicitly denies access to the -// sts:GetCallerIdentity action, you can still perform this operation. Permissions -// are not required because the same information is returned when an IAM user -// or role is denied access. To view an example response, see I Am Not Authorized -// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) -// in the IAM 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 Security Token Service's -// API operation GetCallerIdentity for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity -func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) { - req, out := c.GetCallerIdentityRequest(input) - return out, req.Send() -} - -// GetCallerIdentityWithContext is the same as GetCallerIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See GetCallerIdentity 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 *STS) GetCallerIdentityWithContext(ctx aws.Context, input *GetCallerIdentityInput, opts ...request.Option) (*GetCallerIdentityOutput, error) { - req, out := c.GetCallerIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetFederationToken = "GetFederationToken" - -// GetFederationTokenRequest generates a "aws/request.Request" representing the -// client's request for the GetFederationToken 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 GetFederationToken for more information on using the GetFederationToken -// 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 GetFederationTokenRequest method. -// req, resp := client.GetFederationTokenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken -func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) { - op := &request.Operation{ - Name: opGetFederationToken, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetFederationTokenInput{} - } - - output = &GetFederationTokenOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFederationToken API operation for AWS Security Token Service. -// -// Returns a set of temporary security credentials (consisting of an access -// key ID, a secret access key, and a security token) for a federated user. -// A typical use is in a proxy application that gets temporary security credentials -// on behalf of distributed applications inside a corporate network. You must -// call the GetFederationToken operation using the long-term security credentials -// of an IAM user. As a result, this call is appropriate in contexts where those -// credentials can be safely stored, usually in a server-based application. -// For a comparison of GetFederationToken with the other API operations that -// produce temporary credentials, see Requesting Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) -// in the IAM User Guide. -// -// You can create a mobile-based or browser-based app that can authenticate -// users using a web identity provider like Login with Amazon, Facebook, Google, -// or an OpenID Connect-compatible identity provider. In this case, we recommend -// that you use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. -// For more information, see Federation Through a Web-based Identity Provider -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) -// in the IAM User Guide. -// -// You can also call GetFederationToken using the security credentials of an -// AWS account root user, but we do not recommend it. Instead, we recommend -// that you create an IAM user for the purpose of the proxy application. Then -// attach a policy to the IAM user that limits federated users to only the actions -// and resources that they need to access. For more information, see IAM Best -// Practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) -// in the IAM User Guide. -// -// Session duration -// -// The temporary credentials are valid for the specified duration, from 900 -// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default -// session duration is 43,200 seconds (12 hours). Temporary credentials that -// are obtained by using AWS account root user credentials have a maximum duration -// of 3,600 seconds (1 hour). -// -// Permissions -// -// You can use the temporary credentials created by GetFederationToken in any -// AWS service except the following: -// -// * You cannot call any IAM operations using the AWS CLI or the AWS API. -// -// * You cannot call any STS operations except GetCallerIdentity. -// -// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline -// and managed session policies can't exceed 2,048 characters. -// -// Though the session policy parameters are optional, if you do not pass a policy, -// then the resulting federated user session has no permissions. When you pass -// session policies, the session permissions are the intersection of the IAM -// user policies and the session policies that you pass. This gives you a way -// to further restrict the permissions for a federated user. You cannot use -// session policies to grant more permissions than those that are defined in -// the permissions policy of the IAM user. For more information, see Session -// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// in the IAM User Guide. For information about using GetFederationToken to -// create temporary security credentials, see GetFederationToken—Federation -// Through a Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). -// -// You can use the credentials to access a resource that has a resource-based -// policy. If that policy specifically references the federated user session -// in the Principal element of the policy, the session has the permissions allowed -// by the policy. These permissions are granted in addition to the permissions -// granted by the session policies. -// -// Tags -// -// (Optional) You can pass tag key-value pairs to your session. These are called -// session tags. For more information about session tags, see Passing Session -// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// An administrator must grant you the permissions necessary to pass session -// tags. The administrator can also create granular permissions to allow you -// to pass only specific session tags. For more information, see Tutorial: Using -// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) -// in the IAM User Guide. -// -// Tag key–value pairs are not case sensitive, but case is preserved. This -// means that you cannot have separate Department and department tag keys. Assume -// that the user that you are federating has the Department=Marketing tag and -// you pass the department=engineering session tag. Department and department -// are not saved as separate tags, and the session tag passed in the request -// takes precedence over the user tag. -// -// 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 Security Token Service's -// API operation GetFederationToken for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" -// The request was rejected because the policy document was malformed. The error -// message describes the specific error. -// -// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the total packed size of the session policies -// and session tags combined was too large. An AWS conversion compresses the -// session policy document, session policy ARNs, and session tags into a packed -// binary format that has a separate limit. The error message indicates by percentage -// how close the policies and tags are to the upper size limit. For more information, -// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -// -// You could receive this error even though you meet other defined session policy -// and session tag limits. For more information, see IAM and STS Entity Character -// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// * ErrCodeRegionDisabledException "RegionDisabledException" -// STS is not activated in the requested region for the account that is being -// asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken -func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) { - req, out := c.GetFederationTokenRequest(input) - return out, req.Send() -} - -// GetFederationTokenWithContext is the same as GetFederationToken with the addition of -// the ability to pass a context and additional request options. -// -// See GetFederationToken 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 *STS) GetFederationTokenWithContext(ctx aws.Context, input *GetFederationTokenInput, opts ...request.Option) (*GetFederationTokenOutput, error) { - req, out := c.GetFederationTokenRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSessionToken = "GetSessionToken" - -// GetSessionTokenRequest generates a "aws/request.Request" representing the -// client's request for the GetSessionToken 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 GetSessionToken for more information on using the GetSessionToken -// 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 GetSessionTokenRequest method. -// req, resp := client.GetSessionTokenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken -func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) { - op := &request.Operation{ - Name: opGetSessionToken, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSessionTokenInput{} - } - - output = &GetSessionTokenOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSessionToken API operation for AWS Security Token Service. -// -// Returns a set of temporary credentials for an AWS account or IAM user. The -// credentials consist of an access key ID, a secret access key, and a security -// token. Typically, you use GetSessionToken if you want to use MFA to protect -// programmatic calls to specific AWS API operations like Amazon EC2 StopInstances. -// MFA-enabled IAM users would need to call GetSessionToken and submit an MFA -// code that is associated with their MFA device. Using the temporary security -// credentials that are returned from the call, IAM users can then make programmatic -// calls to API operations that require MFA authentication. If you do not supply -// a correct MFA code, then the API returns an access denied error. For a comparison -// of GetSessionToken with the other API operations that produce temporary credentials, -// see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) -// in the IAM User Guide. -// -// Session Duration -// -// The GetSessionToken operation must be called by using the long-term AWS security -// credentials of the AWS account root user or an IAM user. Credentials that -// are created by IAM users are valid for the duration that you specify. This -// duration can range from 900 seconds (15 minutes) up to a maximum of 129,600 -// seconds (36 hours), with a default of 43,200 seconds (12 hours). Credentials -// based on account credentials can range from 900 seconds (15 minutes) up to -// 3,600 seconds (1 hour), with a default of 1 hour. -// -// Permissions -// -// The temporary security credentials created by GetSessionToken can be used -// to make API calls to any AWS service with the following exceptions: -// -// * You cannot call any IAM API operations unless MFA authentication information -// is included in the request. -// -// * You cannot call any STS API except AssumeRole or GetCallerIdentity. -// -// We recommend that you do not call GetSessionToken with AWS account root user -// credentials. Instead, follow our best practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) -// by creating one or more IAM users, giving them the necessary permissions, -// and using IAM users for everyday interaction with AWS. -// -// The credentials that are returned by GetSessionToken are based on permissions -// associated with the user whose credentials were used to call the operation. -// If GetSessionToken is called using AWS account root user credentials, the -// temporary credentials have root user permissions. Similarly, if GetSessionToken -// is called using the credentials of an IAM user, the temporary credentials -// have the same permissions as the IAM user. -// -// For more information about using GetSessionToken to create temporary credentials, -// go to Temporary Credentials for Users in Untrusted Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) -// in the IAM 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 Security Token Service's -// API operation GetSessionToken for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRegionDisabledException "RegionDisabledException" -// STS is not activated in the requested region for the account that is being -// asked to generate credentials. The account administrator must use the IAM -// console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken -func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) { - req, out := c.GetSessionTokenRequest(input) - return out, req.Send() -} - -// GetSessionTokenWithContext is the same as GetSessionToken with the addition of -// the ability to pass a context and additional request options. -// -// See GetSessionToken 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 *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionTokenInput, opts ...request.Option) (*GetSessionTokenOutput, error) { - req, out := c.GetSessionTokenRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AssumeRoleInput struct { - _ struct{} `type:"structure"` - - // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) up to the maximum session duration setting for the role. - // This setting can have a value from 1 hour to 12 hours. If you specify a value - // higher than this setting, the operation fails. For example, if you specify - // a session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see View the Maximum Session Duration Setting for a - // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) - // in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request - // to the federation endpoint for a console sign-in token takes a SessionDuration - // parameter that specifies the maximum length of the console session. For more - // information, see Creating a URL that Enables Federated Users to Access the - // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) - // in the IAM User Guide. - DurationSeconds *int64 `min:"900" type:"integer"` - - // A unique identifier that might be required when you assume a role in another - // account. If the administrator of the account to which the role belongs provided - // you with an external ID, then provide that value in the ExternalId parameter. - // This value can be any string, such as a passphrase or account number. A cross-account - // role is usually set up to trust everyone in an account. Therefore, the administrator - // of the trusting account might send an external ID to the administrator of - // the trusted account. That way, only someone with the ID can assume the role, - // rather than everyone in the account. For more information about the external - // ID, see How to Use an External ID When Granting Access to Your AWS Resources - // to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) - // in the IAM User Guide. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@:/- - ExternalId *string `min:"2" type:"string"` - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // This parameter is optional. Passing policies to this operation returns new - // temporary credentials. The resulting session's permissions are the intersection - // of the role's identity-based policy and the session policies. You can use - // the role's temporary credentials in subsequent AWS API calls to access resources - // in the account that owns the role. You cannot use session policies to grant - // more permissions than those allowed by the identity-based policy of the role - // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - Policy *string `min:"1" type:"string"` - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want - // to use as managed session policies. The policies must exist in the same account - // as the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's identity-based - // policy and the session policies. You can use the role's temporary credentials - // in subsequent AWS API calls to access resources in the account that owns - // the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - PolicyArns []*PolicyDescriptorType `type:"list"` - - // The Amazon Resource Name (ARN) of the role to assume. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` - - // An identifier for the assumed role session. - // - // Use the role session name to uniquely identify a session when the same role - // is assumed by different principals or for different reasons. In cross-account - // scenarios, the role session name is visible to, and can be logged by the - // account that owns the role. The role session name is also used in the ARN - // of the assumed role principal. This means that subsequent cross-account API - // requests that use the temporary security credentials will expose the role - // session name to the external account in their AWS CloudTrail logs. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@- - // - // RoleSessionName is a required field - RoleSessionName *string `min:"2" type:"string" required:"true"` - - // The identification number of the MFA device that is associated with the user - // who is making the AssumeRole call. Specify this value if the trust policy - // of the role being assumed includes a condition that requires MFA authentication. - // The value is either the serial number for a hardware device (such as GAHT12345678) - // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@- - SerialNumber *string `min:"9" type:"string"` - - // A list of session tags that you want to pass. Each session tag consists of - // a key name and an associated value. For more information about session tags, - // see Tagging AWS STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - // in the IAM User Guide. - // - // This parameter is optional. You can pass up to 50 session tags. The plain - // text session tag keys can’t exceed 128 characters, and the values can’t - // exceed 256 characters. For these and additional limits, see IAM and STS Character - // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - // in the IAM User Guide. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // You can pass a session tag with the same key as a tag that is already attached - // to the role. When you do, session tags override a role tag with the same - // key. - // - // Tag key–value pairs are not case sensitive, but case is preserved. This - // means that you cannot have separate Department and department tag keys. Assume - // that the role has the Department=Marketing tag and you pass the department=engineering - // session tag. Department and department are not saved as separate tags, and - // the session tag passed in the request takes precedence over the role tag. - // - // Additionally, if you used temporary credentials to perform this operation, - // the new session inherits any transitive session tags from the calling session. - // If you pass a session tag with the same key as an inherited tag, the operation - // fails. To view the inherited tags for a session, see the AWS CloudTrail logs. - // For more information, see Viewing Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs) - // in the IAM User Guide. - Tags []*Tag `type:"list"` - - // The value provided by the MFA device, if the trust policy of the role being - // assumed requires MFA (that is, if the policy includes a condition that tests - // for MFA). If the role being assumed requires MFA and if the TokenCode value - // is missing or expired, the AssumeRole call returns an "access denied" error. - // - // The format for this parameter, as described by its regex pattern, is a sequence - // of six numeric digits. - TokenCode *string `min:"6" type:"string"` - - // A list of keys for session tags that you want to set as transitive. If you - // set a tag key as transitive, the corresponding key and value passes to subsequent - // sessions in a role chain. For more information, see Chaining Roles with Session - // Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) - // in the IAM User Guide. - // - // This parameter is optional. When you set session tags as transitive, the - // session policy and session tags packed binary limit is not affected. - // - // If you choose not to specify a transitive tag key, then no tags are passed - // from this session to any subsequent sessions. - TransitiveTagKeys []*string `type:"list"` -} - -// String returns the string representation -func (s AssumeRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumeRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssumeRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssumeRoleInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.ExternalId != nil && len(*s.ExternalId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ExternalId", 2)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.RoleSessionName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleSessionName")) - } - if s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RoleSessionName", 2)) - } - if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { - invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) - } - if s.TokenCode != nil && len(*s.TokenCode) < 6 { - invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) - } - if s.PolicyArns != nil { - for i, v := range s.PolicyArns { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", 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 -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *AssumeRoleInput) SetDurationSeconds(v int64) *AssumeRoleInput { - s.DurationSeconds = &v - return s -} - -// SetExternalId sets the ExternalId field's value. -func (s *AssumeRoleInput) SetExternalId(v string) *AssumeRoleInput { - s.ExternalId = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput { - s.Policy = &v - return s -} - -// SetPolicyArns sets the PolicyArns field's value. -func (s *AssumeRoleInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleInput { - s.PolicyArns = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *AssumeRoleInput) SetRoleArn(v string) *AssumeRoleInput { - s.RoleArn = &v - return s -} - -// SetRoleSessionName sets the RoleSessionName field's value. -func (s *AssumeRoleInput) SetRoleSessionName(v string) *AssumeRoleInput { - s.RoleSessionName = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *AssumeRoleInput) SetSerialNumber(v string) *AssumeRoleInput { - s.SerialNumber = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AssumeRoleInput) SetTags(v []*Tag) *AssumeRoleInput { - s.Tags = v - return s -} - -// SetTokenCode sets the TokenCode field's value. -func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput { - s.TokenCode = &v - return s -} - -// SetTransitiveTagKeys sets the TransitiveTagKeys field's value. -func (s *AssumeRoleInput) SetTransitiveTagKeys(v []*string) *AssumeRoleInput { - s.TransitiveTagKeys = v - return s -} - -// Contains the response to a successful AssumeRole request, including temporary -// AWS credentials that can be used to make AWS requests. -type AssumeRoleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers - // that you can use to refer to the resulting temporary security credentials. - // For example, you can reference these credentials as a principal in a resource-based - // policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName - // that you specified when you called AssumeRole. - AssumedRoleUser *AssumedRoleUser `type:"structure"` - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. - // We strongly recommend that you make no assumptions about the maximum size. - Credentials *Credentials `type:"structure"` - - // A percentage value that indicates the packed size of the session policies - // and session tags combined passed in the request. The request fails if the - // packed size is greater than 100 percent, which means the policies and tags - // exceeded the allowed space. - PackedPolicySize *int64 `type:"integer"` -} - -// String returns the string representation -func (s AssumeRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumeRoleOutput) GoString() string { - return s.String() -} - -// SetAssumedRoleUser sets the AssumedRoleUser field's value. -func (s *AssumeRoleOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleOutput { - s.AssumedRoleUser = v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *AssumeRoleOutput) SetCredentials(v *Credentials) *AssumeRoleOutput { - s.Credentials = v - return s -} - -// SetPackedPolicySize sets the PackedPolicySize field's value. -func (s *AssumeRoleOutput) SetPackedPolicySize(v int64) *AssumeRoleOutput { - s.PackedPolicySize = &v - return s -} - -type AssumeRoleWithSAMLInput struct { - _ struct{} `type:"structure"` - - // The duration, in seconds, of the role session. Your role session lasts for - // the duration that you specify for the DurationSeconds parameter, or until - // the time specified in the SAML authentication response's SessionNotOnOrAfter - // value, whichever is shorter. You can provide a DurationSeconds value from - // 900 seconds (15 minutes) up to the maximum session duration setting for the - // role. This setting can have a value from 1 hour to 12 hours. If you specify - // a value higher than this setting, the operation fails. For example, if you - // specify a session duration of 12 hours, but your administrator set the maximum - // session duration to 6 hours, your operation fails. To learn how to view the - // maximum value for your role, see View the Maximum Session Duration Setting - // for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) - // in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request - // to the federation endpoint for a console sign-in token takes a SessionDuration - // parameter that specifies the maximum length of the console session. For more - // information, see Creating a URL that Enables Federated Users to Access the - // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) - // in the IAM User Guide. - DurationSeconds *int64 `min:"900" type:"integer"` - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // This parameter is optional. Passing policies to this operation returns new - // temporary credentials. The resulting session's permissions are the intersection - // of the role's identity-based policy and the session policies. You can use - // the role's temporary credentials in subsequent AWS API calls to access resources - // in the account that owns the role. You cannot use session policies to grant - // more permissions than those allowed by the identity-based policy of the role - // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - Policy *string `min:"1" type:"string"` - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want - // to use as managed session policies. The policies must exist in the same account - // as the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's identity-based - // policy and the session policies. You can use the role's temporary credentials - // in subsequent AWS API calls to access resources in the account that owns - // the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - PolicyArns []*PolicyDescriptorType `type:"list"` - - // The Amazon Resource Name (ARN) of the SAML provider in IAM that describes - // the IdP. - // - // PrincipalArn is a required field - PrincipalArn *string `min:"20" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the role that the caller is assuming. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` - - // The base-64 encoded SAML authentication response provided by the IdP. - // - // For more information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) - // in the IAM User Guide. - // - // SAMLAssertion is a required field - SAMLAssertion *string `min:"4" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssumeRoleWithSAMLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumeRoleWithSAMLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssumeRoleWithSAMLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssumeRoleWithSAMLInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PrincipalArn == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) - } - if s.PrincipalArn != nil && len(*s.PrincipalArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PrincipalArn", 20)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.SAMLAssertion == nil { - invalidParams.Add(request.NewErrParamRequired("SAMLAssertion")) - } - if s.SAMLAssertion != nil && len(*s.SAMLAssertion) < 4 { - invalidParams.Add(request.NewErrParamMinLen("SAMLAssertion", 4)) - } - if s.PolicyArns != nil { - for i, v := range s.PolicyArns { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *AssumeRoleWithSAMLInput) SetDurationSeconds(v int64) *AssumeRoleWithSAMLInput { - s.DurationSeconds = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *AssumeRoleWithSAMLInput) SetPolicy(v string) *AssumeRoleWithSAMLInput { - s.Policy = &v - return s -} - -// SetPolicyArns sets the PolicyArns field's value. -func (s *AssumeRoleWithSAMLInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleWithSAMLInput { - s.PolicyArns = v - return s -} - -// SetPrincipalArn sets the PrincipalArn field's value. -func (s *AssumeRoleWithSAMLInput) SetPrincipalArn(v string) *AssumeRoleWithSAMLInput { - s.PrincipalArn = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *AssumeRoleWithSAMLInput) SetRoleArn(v string) *AssumeRoleWithSAMLInput { - s.RoleArn = &v - return s -} - -// SetSAMLAssertion sets the SAMLAssertion field's value. -func (s *AssumeRoleWithSAMLInput) SetSAMLAssertion(v string) *AssumeRoleWithSAMLInput { - s.SAMLAssertion = &v - return s -} - -// Contains the response to a successful AssumeRoleWithSAML request, including -// temporary AWS credentials that can be used to make AWS requests. -type AssumeRoleWithSAMLOutput struct { - _ struct{} `type:"structure"` - - // The identifiers for the temporary security credentials that the operation - // returns. - AssumedRoleUser *AssumedRoleUser `type:"structure"` - - // The value of the Recipient attribute of the SubjectConfirmationData element - // of the SAML assertion. - Audience *string `type:"string"` - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. - // We strongly recommend that you make no assumptions about the maximum size. - Credentials *Credentials `type:"structure"` - - // The value of the Issuer element of the SAML assertion. - Issuer *string `type:"string"` - - // A hash value based on the concatenation of the Issuer response value, the - // AWS account ID, and the friendly name (the last part of the ARN) of the SAML - // provider in IAM. The combination of NameQualifier and Subject can be used - // to uniquely identify a federated user. - // - // The following pseudocode shows how the hash value is calculated: - // - // BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" - // ) ) - NameQualifier *string `type:"string"` - - // A percentage value that indicates the packed size of the session policies - // and session tags combined passed in the request. The request fails if the - // packed size is greater than 100 percent, which means the policies and tags - // exceeded the allowed space. - PackedPolicySize *int64 `type:"integer"` - - // The value of the NameID element in the Subject element of the SAML assertion. - Subject *string `type:"string"` - - // The format of the name ID, as defined by the Format attribute in the NameID - // element of the SAML assertion. Typical examples of the format are transient - // or persistent. - // - // If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format, - // that prefix is removed. For example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient - // is returned as transient. If the format includes any other prefix, the format - // is returned with no modifications. - SubjectType *string `type:"string"` -} - -// String returns the string representation -func (s AssumeRoleWithSAMLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumeRoleWithSAMLOutput) GoString() string { - return s.String() -} - -// SetAssumedRoleUser sets the AssumedRoleUser field's value. -func (s *AssumeRoleWithSAMLOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleWithSAMLOutput { - s.AssumedRoleUser = v - return s -} - -// SetAudience sets the Audience field's value. -func (s *AssumeRoleWithSAMLOutput) SetAudience(v string) *AssumeRoleWithSAMLOutput { - s.Audience = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *AssumeRoleWithSAMLOutput) SetCredentials(v *Credentials) *AssumeRoleWithSAMLOutput { - s.Credentials = v - return s -} - -// SetIssuer sets the Issuer field's value. -func (s *AssumeRoleWithSAMLOutput) SetIssuer(v string) *AssumeRoleWithSAMLOutput { - s.Issuer = &v - return s -} - -// SetNameQualifier sets the NameQualifier field's value. -func (s *AssumeRoleWithSAMLOutput) SetNameQualifier(v string) *AssumeRoleWithSAMLOutput { - s.NameQualifier = &v - return s -} - -// SetPackedPolicySize sets the PackedPolicySize field's value. -func (s *AssumeRoleWithSAMLOutput) SetPackedPolicySize(v int64) *AssumeRoleWithSAMLOutput { - s.PackedPolicySize = &v - return s -} - -// SetSubject sets the Subject field's value. -func (s *AssumeRoleWithSAMLOutput) SetSubject(v string) *AssumeRoleWithSAMLOutput { - s.Subject = &v - return s -} - -// SetSubjectType sets the SubjectType field's value. -func (s *AssumeRoleWithSAMLOutput) SetSubjectType(v string) *AssumeRoleWithSAMLOutput { - s.SubjectType = &v - return s -} - -type AssumeRoleWithWebIdentityInput struct { - _ struct{} `type:"structure"` - - // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) up to the maximum session duration setting for the role. - // This setting can have a value from 1 hour to 12 hours. If you specify a value - // higher than this setting, the operation fails. For example, if you specify - // a session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see View the Maximum Session Duration Setting for a - // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) - // in the IAM User Guide. - // - // By default, the value is set to 3600 seconds. - // - // The DurationSeconds parameter is separate from the duration of a console - // session that you might request using the returned credentials. The request - // to the federation endpoint for a console sign-in token takes a SessionDuration - // parameter that specifies the maximum length of the console session. For more - // information, see Creating a URL that Enables Federated Users to Access the - // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) - // in the IAM User Guide. - DurationSeconds *int64 `min:"900" type:"integer"` - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // This parameter is optional. Passing policies to this operation returns new - // temporary credentials. The resulting session's permissions are the intersection - // of the role's identity-based policy and the session policies. You can use - // the role's temporary credentials in subsequent AWS API calls to access resources - // in the account that owns the role. You cannot use session policies to grant - // more permissions than those allowed by the identity-based policy of the role - // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - Policy *string `min:"1" type:"string"` - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want - // to use as managed session policies. The policies must exist in the same account - // as the role. - // - // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's identity-based - // policy and the session policies. You can use the role's temporary credentials - // in subsequent AWS API calls to access resources in the account that owns - // the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - PolicyArns []*PolicyDescriptorType `type:"list"` - - // The fully qualified host component of the domain name of the identity provider. - // - // Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com - // and graph.facebook.com are the only supported identity providers for OAuth - // 2.0 access tokens. Do not include URL schemes and port numbers. - // - // Do not specify this value for OpenID Connect ID tokens. - ProviderId *string `min:"4" type:"string"` - - // The Amazon Resource Name (ARN) of the role that the caller is assuming. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` - - // An identifier for the assumed role session. Typically, you pass the name - // or identifier that is associated with the user who is using your application. - // That way, the temporary security credentials that your application will use - // are associated with that user. This session name is included as part of the - // ARN and assumed role ID in the AssumedRoleUser response element. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@- - // - // RoleSessionName is a required field - RoleSessionName *string `min:"2" type:"string" required:"true"` - - // The OAuth 2.0 access token or OpenID Connect ID token that is provided by - // the identity provider. Your application must get this token by authenticating - // the user who is using your application with a web identity provider before - // the application makes an AssumeRoleWithWebIdentity call. - // - // WebIdentityToken is a required field - WebIdentityToken *string `min:"4" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssumeRoleWithWebIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumeRoleWithWebIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssumeRoleWithWebIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssumeRoleWithWebIdentityInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.ProviderId != nil && len(*s.ProviderId) < 4 { - invalidParams.Add(request.NewErrParamMinLen("ProviderId", 4)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.RoleSessionName == nil { - invalidParams.Add(request.NewErrParamRequired("RoleSessionName")) - } - if s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("RoleSessionName", 2)) - } - if s.WebIdentityToken == nil { - invalidParams.Add(request.NewErrParamRequired("WebIdentityToken")) - } - if s.WebIdentityToken != nil && len(*s.WebIdentityToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("WebIdentityToken", 4)) - } - if s.PolicyArns != nil { - for i, v := range s.PolicyArns { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *AssumeRoleWithWebIdentityInput) SetDurationSeconds(v int64) *AssumeRoleWithWebIdentityInput { - s.DurationSeconds = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *AssumeRoleWithWebIdentityInput) SetPolicy(v string) *AssumeRoleWithWebIdentityInput { - s.Policy = &v - return s -} - -// SetPolicyArns sets the PolicyArns field's value. -func (s *AssumeRoleWithWebIdentityInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleWithWebIdentityInput { - s.PolicyArns = v - return s -} - -// SetProviderId sets the ProviderId field's value. -func (s *AssumeRoleWithWebIdentityInput) SetProviderId(v string) *AssumeRoleWithWebIdentityInput { - s.ProviderId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *AssumeRoleWithWebIdentityInput) SetRoleArn(v string) *AssumeRoleWithWebIdentityInput { - s.RoleArn = &v - return s -} - -// SetRoleSessionName sets the RoleSessionName field's value. -func (s *AssumeRoleWithWebIdentityInput) SetRoleSessionName(v string) *AssumeRoleWithWebIdentityInput { - s.RoleSessionName = &v - return s -} - -// SetWebIdentityToken sets the WebIdentityToken field's value. -func (s *AssumeRoleWithWebIdentityInput) SetWebIdentityToken(v string) *AssumeRoleWithWebIdentityInput { - s.WebIdentityToken = &v - return s -} - -// Contains the response to a successful AssumeRoleWithWebIdentity request, -// including temporary AWS credentials that can be used to make AWS requests. -type AssumeRoleWithWebIdentityOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers - // that you can use to refer to the resulting temporary security credentials. - // For example, you can reference these credentials as a principal in a resource-based - // policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName - // that you specified when you called AssumeRole. - AssumedRoleUser *AssumedRoleUser `type:"structure"` - - // The intended audience (also known as client ID) of the web identity token. - // This is traditionally the client identifier issued to the application that - // requested the web identity token. - Audience *string `type:"string"` - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security token. - // - // The size of the security token that STS API operations return is not fixed. - // We strongly recommend that you make no assumptions about the maximum size. - Credentials *Credentials `type:"structure"` - - // A percentage value that indicates the packed size of the session policies - // and session tags combined passed in the request. The request fails if the - // packed size is greater than 100 percent, which means the policies and tags - // exceeded the allowed space. - PackedPolicySize *int64 `type:"integer"` - - // The issuing authority of the web identity token presented. For OpenID Connect - // ID tokens, this contains the value of the iss field. For OAuth 2.0 access - // tokens, this contains the value of the ProviderId parameter that was passed - // in the AssumeRoleWithWebIdentity request. - Provider *string `type:"string"` - - // The unique user identifier that is returned by the identity provider. This - // identifier is associated with the WebIdentityToken that was submitted with - // the AssumeRoleWithWebIdentity call. The identifier is typically unique to - // the user and the application that acquired the WebIdentityToken (pairwise - // identifier). For OpenID Connect ID tokens, this field contains the value - // returned by the identity provider as the token's sub (Subject) claim. - SubjectFromWebIdentityToken *string `min:"6" type:"string"` -} - -// String returns the string representation -func (s AssumeRoleWithWebIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumeRoleWithWebIdentityOutput) GoString() string { - return s.String() -} - -// SetAssumedRoleUser sets the AssumedRoleUser field's value. -func (s *AssumeRoleWithWebIdentityOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleWithWebIdentityOutput { - s.AssumedRoleUser = v - return s -} - -// SetAudience sets the Audience field's value. -func (s *AssumeRoleWithWebIdentityOutput) SetAudience(v string) *AssumeRoleWithWebIdentityOutput { - s.Audience = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *AssumeRoleWithWebIdentityOutput) SetCredentials(v *Credentials) *AssumeRoleWithWebIdentityOutput { - s.Credentials = v - return s -} - -// SetPackedPolicySize sets the PackedPolicySize field's value. -func (s *AssumeRoleWithWebIdentityOutput) SetPackedPolicySize(v int64) *AssumeRoleWithWebIdentityOutput { - s.PackedPolicySize = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *AssumeRoleWithWebIdentityOutput) SetProvider(v string) *AssumeRoleWithWebIdentityOutput { - s.Provider = &v - return s -} - -// SetSubjectFromWebIdentityToken sets the SubjectFromWebIdentityToken field's value. -func (s *AssumeRoleWithWebIdentityOutput) SetSubjectFromWebIdentityToken(v string) *AssumeRoleWithWebIdentityOutput { - s.SubjectFromWebIdentityToken = &v - return s -} - -// The identifiers for the temporary security credentials that the operation -// returns. -type AssumedRoleUser struct { - _ struct{} `type:"structure"` - - // The ARN of the temporary security credentials that are returned from the - // AssumeRole action. For more information about ARNs and how to use them in - // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in the IAM User Guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // A unique identifier that contains the role ID and the role session name of - // the role that is being assumed. The role ID is generated by AWS when the - // role is created. - // - // AssumedRoleId is a required field - AssumedRoleId *string `min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssumedRoleUser) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssumedRoleUser) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AssumedRoleUser) SetArn(v string) *AssumedRoleUser { - s.Arn = &v - return s -} - -// SetAssumedRoleId sets the AssumedRoleId field's value. -func (s *AssumedRoleUser) SetAssumedRoleId(v string) *AssumedRoleUser { - s.AssumedRoleId = &v - return s -} - -// AWS credentials for API authentication. -type Credentials struct { - _ struct{} `type:"structure"` - - // The access key ID that identifies the temporary security credentials. - // - // AccessKeyId is a required field - AccessKeyId *string `min:"16" type:"string" required:"true"` - - // The date on which the current credentials expire. - // - // Expiration is a required field - Expiration *time.Time `type:"timestamp" required:"true"` - - // The secret access key that can be used to sign requests. - // - // SecretAccessKey is a required field - SecretAccessKey *string `type:"string" required:"true"` - - // The token that users must pass to the service API to use the temporary credentials. - // - // SessionToken is a required field - SessionToken *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Credentials) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Credentials) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *Credentials) SetAccessKeyId(v string) *Credentials { - s.AccessKeyId = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *Credentials) SetExpiration(v time.Time) *Credentials { - s.Expiration = &v - return s -} - -// SetSecretAccessKey sets the SecretAccessKey field's value. -func (s *Credentials) SetSecretAccessKey(v string) *Credentials { - s.SecretAccessKey = &v - return s -} - -// SetSessionToken sets the SessionToken field's value. -func (s *Credentials) SetSessionToken(v string) *Credentials { - s.SessionToken = &v - return s -} - -type DecodeAuthorizationMessageInput struct { - _ struct{} `type:"structure"` - - // The encoded message that was returned with the response. - // - // EncodedMessage is a required field - EncodedMessage *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DecodeAuthorizationMessageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DecodeAuthorizationMessageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DecodeAuthorizationMessageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DecodeAuthorizationMessageInput"} - if s.EncodedMessage == nil { - invalidParams.Add(request.NewErrParamRequired("EncodedMessage")) - } - if s.EncodedMessage != nil && len(*s.EncodedMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EncodedMessage", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncodedMessage sets the EncodedMessage field's value. -func (s *DecodeAuthorizationMessageInput) SetEncodedMessage(v string) *DecodeAuthorizationMessageInput { - s.EncodedMessage = &v - return s -} - -// A document that contains additional information about the authorization status -// of a request from an encoded message that is returned in response to an AWS -// request. -type DecodeAuthorizationMessageOutput struct { - _ struct{} `type:"structure"` - - // An XML document that contains the decoded message. - DecodedMessage *string `type:"string"` -} - -// String returns the string representation -func (s DecodeAuthorizationMessageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DecodeAuthorizationMessageOutput) GoString() string { - return s.String() -} - -// SetDecodedMessage sets the DecodedMessage field's value. -func (s *DecodeAuthorizationMessageOutput) SetDecodedMessage(v string) *DecodeAuthorizationMessageOutput { - s.DecodedMessage = &v - return s -} - -// Identifiers for the federated user that is associated with the credentials. -type FederatedUser struct { - _ struct{} `type:"structure"` - - // The ARN that specifies the federated user that is associated with the credentials. - // For more information about ARNs and how to use them in policies, see IAM - // Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in the IAM User Guide. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The string that identifies the federated user associated with the credentials, - // similar to the unique ID of an IAM user. - // - // FederatedUserId is a required field - FederatedUserId *string `min:"2" type:"string" required:"true"` -} - -// String returns the string representation -func (s FederatedUser) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FederatedUser) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *FederatedUser) SetArn(v string) *FederatedUser { - s.Arn = &v - return s -} - -// SetFederatedUserId sets the FederatedUserId field's value. -func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser { - s.FederatedUserId = &v - return s -} - -type GetAccessKeyInfoInput struct { - _ struct{} `type:"structure"` - - // The identifier of an access key. - // - // This parameter allows (through its regex pattern) a string of characters - // that can consist of any upper- or lowercase letter or digit. - // - // AccessKeyId is a required field - AccessKeyId *string `min:"16" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetAccessKeyInfoInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccessKeyInfoInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAccessKeyInfoInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyInfoInput"} - if s.AccessKeyId == nil { - invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) - } - if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *GetAccessKeyInfoInput) SetAccessKeyId(v string) *GetAccessKeyInfoInput { - s.AccessKeyId = &v - return s -} - -type GetAccessKeyInfoOutput struct { - _ struct{} `type:"structure"` - - // The number used to identify the AWS account. - Account *string `type:"string"` -} - -// String returns the string representation -func (s GetAccessKeyInfoOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetAccessKeyInfoOutput) GoString() string { - return s.String() -} - -// SetAccount sets the Account field's value. -func (s *GetAccessKeyInfoOutput) SetAccount(v string) *GetAccessKeyInfoOutput { - s.Account = &v - return s -} - -type GetCallerIdentityInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetCallerIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCallerIdentityInput) GoString() string { - return s.String() -} - -// Contains the response to a successful GetCallerIdentity request, including -// information about the entity making the request. -type GetCallerIdentityOutput struct { - _ struct{} `type:"structure"` - - // The AWS account ID number of the account that owns or contains the calling - // entity. - Account *string `type:"string"` - - // The AWS ARN associated with the calling entity. - Arn *string `min:"20" type:"string"` - - // The unique identifier of the calling entity. The exact value depends on the - // type of entity that is making the call. The values returned are those listed - // in the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) - // found on the Policy Variables reference page in the IAM User Guide. - UserId *string `type:"string"` -} - -// String returns the string representation -func (s GetCallerIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCallerIdentityOutput) GoString() string { - return s.String() -} - -// SetAccount sets the Account field's value. -func (s *GetCallerIdentityOutput) SetAccount(v string) *GetCallerIdentityOutput { - s.Account = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetCallerIdentityOutput) SetArn(v string) *GetCallerIdentityOutput { - s.Arn = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *GetCallerIdentityOutput) SetUserId(v string) *GetCallerIdentityOutput { - s.UserId = &v - return s -} - -type GetFederationTokenInput struct { - _ struct{} `type:"structure"` - - // The duration, in seconds, that the session should last. Acceptable durations - // for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds - // (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained - // using AWS account root user credentials are restricted to a maximum of 3,600 - // seconds (one hour). If the specified duration is longer than one hour, the - // session obtained by using root user credentials defaults to one hour. - DurationSeconds *int64 `min:"900" type:"integer"` - - // The name of the federated user. The name is used as an identifier for the - // temporary security credentials (such as Bob). For example, you can reference - // the federated user name in a resource-based policy, such as in an Amazon - // S3 bucket policy. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@- - // - // Name is a required field - Name *string `min:"2" type:"string" required:"true"` - - // An IAM policy in JSON format that you want to use as an inline session policy. - // - // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // to this operation. You can pass a single JSON policy document to use as an - // inline session policy. You can also specify up to 10 managed policies to - // use as managed session policies. - // - // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. - // - // When you pass session policies, the session permissions are the intersection - // of the IAM user policies and the session policies that you pass. This gives - // you a way to further restrict the permissions for a federated user. You cannot - // use session policies to grant more permissions than those that are defined - // in the permissions policy of the IAM user. For more information, see Session - // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - // - // The resulting credentials can be used to access a resource that has a resource-based - // policy. If that policy specifically references the federated user session - // in the Principal element of the policy, the session has the permissions allowed - // by the policy. These permissions are granted in addition to the permissions - // that are granted by the session policies. - // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - Policy *string `min:"1" type:"string"` - - // The Amazon Resource Names (ARNs) of the IAM managed policies that you want - // to use as a managed session policy. The policies must exist in the same account - // as the IAM user that is requesting federated access. - // - // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // to this operation. You can pass a single JSON policy document to use as an - // inline session policy. You can also specify up to 10 managed policies to - // use as managed session policies. The plain text that you use for both inline - // and managed session policies can't exceed 2,048 characters. You can provide - // up to 10 managed policy ARNs. For more information about ARNs, see Amazon - // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - // - // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. - // - // When you pass session policies, the session permissions are the intersection - // of the IAM user policies and the session policies that you pass. This gives - // you a way to further restrict the permissions for a federated user. You cannot - // use session policies to grant more permissions than those that are defined - // in the permissions policy of the IAM user. For more information, see Session - // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. - // - // The resulting credentials can be used to access a resource that has a resource-based - // policy. If that policy specifically references the federated user session - // in the Principal element of the policy, the session has the permissions allowed - // by the policy. These permissions are granted in addition to the permissions - // that are granted by the session policies. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - PolicyArns []*PolicyDescriptorType `type:"list"` - - // A list of session tags. Each session tag consists of a key name and an associated - // value. For more information about session tags, see Passing Session Tags - // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - // in the IAM User Guide. - // - // This parameter is optional. You can pass up to 50 session tags. The plain - // text session tag keys can’t exceed 128 characters and the values can’t - // exceed 256 characters. For these and additional limits, see IAM and STS Character - // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - // in the IAM User Guide. - // - // An AWS conversion compresses the passed session policies and session tags - // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. - // - // You can pass a session tag with the same key as a tag that is already attached - // to the user you are federating. When you do, session tags override a user - // tag with the same key. - // - // Tag key–value pairs are not case sensitive, but case is preserved. This - // means that you cannot have separate Department and department tag keys. Assume - // that the role has the Department=Marketing tag and you pass the department=engineering - // session tag. Department and department are not saved as separate tags, and - // the session tag passed in the request takes precedence over the role tag. - Tags []*Tag `type:"list"` -} - -// String returns the string representation -func (s GetFederationTokenInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetFederationTokenInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFederationTokenInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFederationTokenInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 2 { - invalidParams.Add(request.NewErrParamMinLen("Name", 2)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PolicyArns != nil { - for i, v := range s.PolicyArns { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", 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 -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *GetFederationTokenInput) SetDurationSeconds(v int64) *GetFederationTokenInput { - s.DurationSeconds = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetFederationTokenInput) SetName(v string) *GetFederationTokenInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *GetFederationTokenInput) SetPolicy(v string) *GetFederationTokenInput { - s.Policy = &v - return s -} - -// SetPolicyArns sets the PolicyArns field's value. -func (s *GetFederationTokenInput) SetPolicyArns(v []*PolicyDescriptorType) *GetFederationTokenInput { - s.PolicyArns = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetFederationTokenInput) SetTags(v []*Tag) *GetFederationTokenInput { - s.Tags = v - return s -} - -// Contains the response to a successful GetFederationToken request, including -// temporary AWS credentials that can be used to make AWS requests. -type GetFederationTokenOutput struct { - _ struct{} `type:"structure"` - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. - // We strongly recommend that you make no assumptions about the maximum size. - Credentials *Credentials `type:"structure"` - - // Identifiers for the federated user associated with the credentials (such - // as arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You - // can use the federated user's ARN in your resource-based policies, such as - // an Amazon S3 bucket policy. - FederatedUser *FederatedUser `type:"structure"` - - // A percentage value that indicates the packed size of the session policies - // and session tags combined passed in the request. The request fails if the - // packed size is greater than 100 percent, which means the policies and tags - // exceeded the allowed space. - PackedPolicySize *int64 `type:"integer"` -} - -// String returns the string representation -func (s GetFederationTokenOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetFederationTokenOutput) GoString() string { - return s.String() -} - -// SetCredentials sets the Credentials field's value. -func (s *GetFederationTokenOutput) SetCredentials(v *Credentials) *GetFederationTokenOutput { - s.Credentials = v - return s -} - -// SetFederatedUser sets the FederatedUser field's value. -func (s *GetFederationTokenOutput) SetFederatedUser(v *FederatedUser) *GetFederationTokenOutput { - s.FederatedUser = v - return s -} - -// SetPackedPolicySize sets the PackedPolicySize field's value. -func (s *GetFederationTokenOutput) SetPackedPolicySize(v int64) *GetFederationTokenOutput { - s.PackedPolicySize = &v - return s -} - -type GetSessionTokenInput struct { - _ struct{} `type:"structure"` - - // The duration, in seconds, that the credentials should remain valid. Acceptable - // durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600 - // seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions - // for AWS account owners are restricted to a maximum of 3,600 seconds (one - // hour). If the duration is longer than one hour, the session for AWS account - // owners defaults to one hour. - DurationSeconds *int64 `min:"900" type:"integer"` - - // The identification number of the MFA device that is associated with the IAM - // user who is making the GetSessionToken call. Specify this value if the IAM - // user has a policy that requires MFA authentication. The value is either the - // serial number for a hardware device (such as GAHT12345678) or an Amazon Resource - // Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). - // You can find the device for an IAM user by going to the AWS Management Console - // and viewing the user's security credentials. - // - // The regex used to validate this parameter is a string of characters consisting - // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@:/- - SerialNumber *string `min:"9" type:"string"` - - // The value provided by the MFA device, if MFA is required. If any policy requires - // the IAM user to submit an MFA code, specify this value. If MFA authentication - // is required, the user must provide a code when requesting a set of temporary - // security credentials. A user who fails to provide the code receives an "access - // denied" response when requesting resources that require MFA authentication. - // - // The format for this parameter, as described by its regex pattern, is a sequence - // of six numeric digits. - TokenCode *string `min:"6" type:"string"` -} - -// String returns the string representation -func (s GetSessionTokenInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSessionTokenInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSessionTokenInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSessionTokenInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { - invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) - } - if s.TokenCode != nil && len(*s.TokenCode) < 6 { - invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *GetSessionTokenInput) SetDurationSeconds(v int64) *GetSessionTokenInput { - s.DurationSeconds = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *GetSessionTokenInput) SetSerialNumber(v string) *GetSessionTokenInput { - s.SerialNumber = &v - return s -} - -// SetTokenCode sets the TokenCode field's value. -func (s *GetSessionTokenInput) SetTokenCode(v string) *GetSessionTokenInput { - s.TokenCode = &v - return s -} - -// Contains the response to a successful GetSessionToken request, including -// temporary AWS credentials that can be used to make AWS requests. -type GetSessionTokenOutput struct { - _ struct{} `type:"structure"` - - // The temporary security credentials, which include an access key ID, a secret - // access key, and a security (or session) token. - // - // The size of the security token that STS API operations return is not fixed. - // We strongly recommend that you make no assumptions about the maximum size. - Credentials *Credentials `type:"structure"` -} - -// String returns the string representation -func (s GetSessionTokenOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSessionTokenOutput) GoString() string { - return s.String() -} - -// SetCredentials sets the Credentials field's value. -func (s *GetSessionTokenOutput) SetCredentials(v *Credentials) *GetSessionTokenOutput { - s.Credentials = v - return s -} - -// A reference to the IAM managed policy that is passed as a session policy -// for a role session or a federated user session. -type PolicyDescriptorType struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session - // policy for the role. For more information about ARNs, see Amazon Resource - // Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the AWS General Reference. - Arn *string `locationName:"arn" min:"20" type:"string"` -} - -// String returns the string representation -func (s PolicyDescriptorType) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PolicyDescriptorType) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PolicyDescriptorType) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PolicyDescriptorType"} - if s.Arn != nil && len(*s.Arn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *PolicyDescriptorType) SetArn(v string) *PolicyDescriptorType { - s.Arn = &v - return s -} - -// You can pass custom key-value pair attributes when you assume a role or federate -// a user. These are called session tags. You can then use the session tags -// to control access to resources. For more information, see Tagging AWS STS -// Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) -// in the IAM User Guide. -type Tag struct { - _ struct{} `type:"structure"` - - // The key for a session tag. - // - // You can pass up to 50 session tags. The plain text session tag keys can’t - // exceed 128 characters. For these and additional limits, see IAM and STS Character - // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - // in the IAM User Guide. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value for a session tag. - // - // You can pass up to 50 session tags. The plain text session tag values can’t - // exceed 256 characters. For these and additional limits, see IAM and STS Character - // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - // in the IAM User Guide. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -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 -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go deleted file mode 100644 index d5307fcaa0..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go +++ /dev/null @@ -1,11 +0,0 @@ -package sts - -import "github.com/aws/aws-sdk-go/aws/request" - -func init() { - initRequest = customizeRequest -} - -func customizeRequest(r *request.Request) { - r.RetryErrorCodes = append(r.RetryErrorCodes, ErrCodeIDPCommunicationErrorException) -} diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go deleted file mode 100644 index cb1debbaa4..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sts provides the client and types for making API -// requests to AWS Security Token Service. -// -// AWS Security Token Service (STS) enables you to request temporary, limited-privilege -// credentials for AWS Identity and Access Management (IAM) users or for users -// that you authenticate (federated users). This guide provides descriptions -// of the STS API. For more information about using this service, see Temporary -// Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15 for more information on this service. -// -// See sts package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sts/ -// -// Using the Client -// -// To contact AWS Security Token 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 AWS Security Token Service client STS for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#New -package sts diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go deleted file mode 100644 index a233f542ef..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sts - -const ( - - // ErrCodeExpiredTokenException for service response error code - // "ExpiredTokenException". - // - // The web identity token that was passed is expired or is not valid. Get a - // new identity token from the identity provider and then retry the request. - ErrCodeExpiredTokenException = "ExpiredTokenException" - - // ErrCodeIDPCommunicationErrorException for service response error code - // "IDPCommunicationError". - // - // The request could not be fulfilled because the identity provider (IDP) that - // was asked to verify the incoming identity token could not be reached. This - // is often a transient error caused by network conditions. Retry the request - // a limited number of times so that you don't exceed the request rate. If the - // error persists, the identity provider might be down or not responding. - ErrCodeIDPCommunicationErrorException = "IDPCommunicationError" - - // ErrCodeIDPRejectedClaimException for service response error code - // "IDPRejectedClaim". - // - // The identity provider (IdP) reported that authentication failed. This might - // be because the claim is invalid. - // - // If this error is returned for the AssumeRoleWithWebIdentity operation, it - // can also mean that the claim has expired or has been explicitly revoked. - ErrCodeIDPRejectedClaimException = "IDPRejectedClaim" - - // ErrCodeInvalidAuthorizationMessageException for service response error code - // "InvalidAuthorizationMessageException". - // - // The error returned if the message passed to DecodeAuthorizationMessage was - // invalid. This can happen if the token contains invalid characters, such as - // linebreaks. - ErrCodeInvalidAuthorizationMessageException = "InvalidAuthorizationMessageException" - - // ErrCodeInvalidIdentityTokenException for service response error code - // "InvalidIdentityToken". - // - // The web identity token that was passed could not be validated by AWS. Get - // a new identity token from the identity provider and then retry the request. - ErrCodeInvalidIdentityTokenException = "InvalidIdentityToken" - - // ErrCodeMalformedPolicyDocumentException for service response error code - // "MalformedPolicyDocument". - // - // The request was rejected because the policy document was malformed. The error - // message describes the specific error. - ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocument" - - // ErrCodePackedPolicyTooLargeException for service response error code - // "PackedPolicyTooLarge". - // - // The request was rejected because the total packed size of the session policies - // and session tags combined was too large. An AWS conversion compresses the - // session policy document, session policy ARNs, and session tags into a packed - // binary format that has a separate limit. The error message indicates by percentage - // how close the policies and tags are to the upper size limit. For more information, - // see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - // in the IAM User Guide. - // - // You could receive this error even though you meet other defined session policy - // and session tag limits. For more information, see IAM and STS Entity Character - // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) - // in the IAM User Guide. - ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge" - - // ErrCodeRegionDisabledException for service response error code - // "RegionDisabledException". - // - // STS is not activated in the requested region for the account that is being - // asked to generate credentials. The account administrator must use the IAM - // console to activate STS in that region. For more information, see Activating - // and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) - // in the IAM User Guide. - ErrCodeRegionDisabledException = "RegionDisabledException" -) diff --git a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/service.go deleted file mode 100644 index d34a685533..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/service.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sts - -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/query" -) - -// STS provides the API operation methods for making requests to -// AWS Security Token Service. See this package's package overview docs -// for details on the service. -// -// STS methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type STS 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 = "sts" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "STS" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the STS 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 STS client from just a session. -// svc := sts.New(mySession) -// -// // Create a STS client with additional configuration -// svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *STS { - svc := &STS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2011-06-15", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a STS operation and runs any -// custom request initialization. -func (c *STS) 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/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go b/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go deleted file mode 100644 index e2e1d6efe5..0000000000 --- a/ibm/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package stsiface provides an interface to enable mocking the AWS Security Token Service service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package stsiface - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/sts" -) - -// STSAPI provides an interface to enable mocking the -// sts.STS service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Security Token Service. -// func myFunc(svc stsiface.STSAPI) bool { -// // Make svc.AssumeRole request -// } -// -// func main() { -// sess := session.New() -// svc := sts.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSTSClient struct { -// stsiface.STSAPI -// } -// func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSTSClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type STSAPI interface { - AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) - AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error) - AssumeRoleRequest(*sts.AssumeRoleInput) (*request.Request, *sts.AssumeRoleOutput) - - AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error) - AssumeRoleWithSAMLWithContext(aws.Context, *sts.AssumeRoleWithSAMLInput, ...request.Option) (*sts.AssumeRoleWithSAMLOutput, error) - AssumeRoleWithSAMLRequest(*sts.AssumeRoleWithSAMLInput) (*request.Request, *sts.AssumeRoleWithSAMLOutput) - - AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error) - AssumeRoleWithWebIdentityWithContext(aws.Context, *sts.AssumeRoleWithWebIdentityInput, ...request.Option) (*sts.AssumeRoleWithWebIdentityOutput, error) - AssumeRoleWithWebIdentityRequest(*sts.AssumeRoleWithWebIdentityInput) (*request.Request, *sts.AssumeRoleWithWebIdentityOutput) - - DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error) - DecodeAuthorizationMessageWithContext(aws.Context, *sts.DecodeAuthorizationMessageInput, ...request.Option) (*sts.DecodeAuthorizationMessageOutput, error) - DecodeAuthorizationMessageRequest(*sts.DecodeAuthorizationMessageInput) (*request.Request, *sts.DecodeAuthorizationMessageOutput) - - GetAccessKeyInfo(*sts.GetAccessKeyInfoInput) (*sts.GetAccessKeyInfoOutput, error) - GetAccessKeyInfoWithContext(aws.Context, *sts.GetAccessKeyInfoInput, ...request.Option) (*sts.GetAccessKeyInfoOutput, error) - GetAccessKeyInfoRequest(*sts.GetAccessKeyInfoInput) (*request.Request, *sts.GetAccessKeyInfoOutput) - - GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error) - GetCallerIdentityWithContext(aws.Context, *sts.GetCallerIdentityInput, ...request.Option) (*sts.GetCallerIdentityOutput, error) - GetCallerIdentityRequest(*sts.GetCallerIdentityInput) (*request.Request, *sts.GetCallerIdentityOutput) - - GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error) - GetFederationTokenWithContext(aws.Context, *sts.GetFederationTokenInput, ...request.Option) (*sts.GetFederationTokenOutput, error) - GetFederationTokenRequest(*sts.GetFederationTokenInput) (*request.Request, *sts.GetFederationTokenOutput) - - GetSessionToken(*sts.GetSessionTokenInput) (*sts.GetSessionTokenOutput, error) - GetSessionTokenWithContext(aws.Context, *sts.GetSessionTokenInput, ...request.Option) (*sts.GetSessionTokenOutput, error) - GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput) -} - -var _ STSAPI = (*sts.STS)(nil) diff --git a/ibm/vendor/github.com/bgentry/go-netrc/LICENSE b/ibm/vendor/github.com/bgentry/go-netrc/LICENSE deleted file mode 100644 index aade9a58b1..0000000000 --- a/ibm/vendor/github.com/bgentry/go-netrc/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Original version Copyright © 2010 Fazlul Shahriar . Newer -portions Copyright © 2014 Blake Gentry . - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/ibm/vendor/github.com/bgentry/go-netrc/netrc/netrc.go b/ibm/vendor/github.com/bgentry/go-netrc/netrc/netrc.go deleted file mode 100644 index ea49987c08..0000000000 --- a/ibm/vendor/github.com/bgentry/go-netrc/netrc/netrc.go +++ /dev/null @@ -1,510 +0,0 @@ -package netrc - -import ( - "bufio" - "bytes" - "fmt" - "io" - "io/ioutil" - "os" - "strings" - "sync" - "unicode" - "unicode/utf8" -) - -type tkType int - -const ( - tkMachine tkType = iota - tkDefault - tkLogin - tkPassword - tkAccount - tkMacdef - tkComment - tkWhitespace -) - -var keywords = map[string]tkType{ - "machine": tkMachine, - "default": tkDefault, - "login": tkLogin, - "password": tkPassword, - "account": tkAccount, - "macdef": tkMacdef, - "#": tkComment, -} - -type Netrc struct { - tokens []*token - machines []*Machine - macros Macros - updateLock sync.Mutex -} - -// FindMachine returns the Machine in n named by name. If a machine named by -// name exists, it is returned. If no Machine with name name is found and there -// is a ``default'' machine, the ``default'' machine is returned. Otherwise, nil -// is returned. -func (n *Netrc) FindMachine(name string) (m *Machine) { - // TODO(bgentry): not safe for concurrency - var def *Machine - for _, m = range n.machines { - if m.Name == name { - return m - } - if m.IsDefault() { - def = m - } - } - if def == nil { - return nil - } - return def -} - -// MarshalText implements the encoding.TextMarshaler interface to encode a -// Netrc into text format. -func (n *Netrc) MarshalText() (text []byte, err error) { - // TODO(bgentry): not safe for concurrency - for i := range n.tokens { - switch n.tokens[i].kind { - case tkComment, tkDefault, tkWhitespace: // always append these types - text = append(text, n.tokens[i].rawkind...) - default: - if n.tokens[i].value != "" { // skip empty-value tokens - text = append(text, n.tokens[i].rawkind...) - } - } - if n.tokens[i].kind == tkMacdef { - text = append(text, ' ') - text = append(text, n.tokens[i].macroName...) - } - text = append(text, n.tokens[i].rawvalue...) - } - return -} - -func (n *Netrc) NewMachine(name, login, password, account string) *Machine { - n.updateLock.Lock() - defer n.updateLock.Unlock() - - prefix := "\n" - if len(n.tokens) == 0 { - prefix = "" - } - m := &Machine{ - Name: name, - Login: login, - Password: password, - Account: account, - - nametoken: &token{ - kind: tkMachine, - rawkind: []byte(prefix + "machine"), - value: name, - rawvalue: []byte(" " + name), - }, - logintoken: &token{ - kind: tkLogin, - rawkind: []byte("\n\tlogin"), - value: login, - rawvalue: []byte(" " + login), - }, - passtoken: &token{ - kind: tkPassword, - rawkind: []byte("\n\tpassword"), - value: password, - rawvalue: []byte(" " + password), - }, - accounttoken: &token{ - kind: tkAccount, - rawkind: []byte("\n\taccount"), - value: account, - rawvalue: []byte(" " + account), - }, - } - n.insertMachineTokensBeforeDefault(m) - for i := range n.machines { - if n.machines[i].IsDefault() { - n.machines = append(append(n.machines[:i], m), n.machines[i:]...) - return m - } - } - n.machines = append(n.machines, m) - return m -} - -func (n *Netrc) insertMachineTokensBeforeDefault(m *Machine) { - newtokens := []*token{m.nametoken} - if m.logintoken.value != "" { - newtokens = append(newtokens, m.logintoken) - } - if m.passtoken.value != "" { - newtokens = append(newtokens, m.passtoken) - } - if m.accounttoken.value != "" { - newtokens = append(newtokens, m.accounttoken) - } - for i := range n.tokens { - if n.tokens[i].kind == tkDefault { - // found the default, now insert tokens before it - n.tokens = append(n.tokens[:i], append(newtokens, n.tokens[i:]...)...) - return - } - } - // didn't find a default, just add the newtokens to the end - n.tokens = append(n.tokens, newtokens...) - return -} - -func (n *Netrc) RemoveMachine(name string) { - n.updateLock.Lock() - defer n.updateLock.Unlock() - - for i := range n.machines { - if n.machines[i] != nil && n.machines[i].Name == name { - m := n.machines[i] - for _, t := range []*token{ - m.nametoken, m.logintoken, m.passtoken, m.accounttoken, - } { - n.removeToken(t) - } - n.machines = append(n.machines[:i], n.machines[i+1:]...) - return - } - } -} - -func (n *Netrc) removeToken(t *token) { - if t != nil { - for i := range n.tokens { - if n.tokens[i] == t { - n.tokens = append(n.tokens[:i], n.tokens[i+1:]...) - return - } - } - } -} - -// Machine contains information about a remote machine. -type Machine struct { - Name string - Login string - Password string - Account string - - nametoken *token - logintoken *token - passtoken *token - accounttoken *token -} - -// IsDefault returns true if the machine is a "default" token, denoted by an -// empty name. -func (m *Machine) IsDefault() bool { - return m.Name == "" -} - -// UpdatePassword sets the password for the Machine m. -func (m *Machine) UpdatePassword(newpass string) { - m.Password = newpass - updateTokenValue(m.passtoken, newpass) -} - -// UpdateLogin sets the login for the Machine m. -func (m *Machine) UpdateLogin(newlogin string) { - m.Login = newlogin - updateTokenValue(m.logintoken, newlogin) -} - -// UpdateAccount sets the login for the Machine m. -func (m *Machine) UpdateAccount(newaccount string) { - m.Account = newaccount - updateTokenValue(m.accounttoken, newaccount) -} - -func updateTokenValue(t *token, value string) { - oldvalue := t.value - t.value = value - newraw := make([]byte, len(t.rawvalue)) - copy(newraw, t.rawvalue) - t.rawvalue = append( - bytes.TrimSuffix(newraw, []byte(oldvalue)), - []byte(value)..., - ) -} - -// Macros contains all the macro definitions in a netrc file. -type Macros map[string]string - -type token struct { - kind tkType - macroName string - value string - rawkind []byte - rawvalue []byte -} - -// Error represents a netrc file parse error. -type Error struct { - LineNum int // Line number - Msg string // Error message -} - -// Error returns a string representation of error e. -func (e *Error) Error() string { - return fmt.Sprintf("line %d: %s", e.LineNum, e.Msg) -} - -func (e *Error) BadDefaultOrder() bool { - return e.Msg == errBadDefaultOrder -} - -const errBadDefaultOrder = "default token must appear after all machine tokens" - -// scanLinesKeepPrefix is a split function for a Scanner that returns each line -// of text. The returned token may include newlines if they are before the -// first non-space character. The returned line may be empty. The end-of-line -// marker is one optional carriage return followed by one mandatory newline. In -// regular expression notation, it is `\r?\n`. The last non-empty line of -// input will be returned even if it has no newline. -func scanLinesKeepPrefix(data []byte, atEOF bool) (advance int, token []byte, err error) { - if atEOF && len(data) == 0 { - return 0, nil, nil - } - // Skip leading spaces. - start := 0 - for width := 0; start < len(data); start += width { - var r rune - r, width = utf8.DecodeRune(data[start:]) - if !unicode.IsSpace(r) { - break - } - } - if i := bytes.IndexByte(data[start:], '\n'); i >= 0 { - // We have a full newline-terminated line. - return start + i, data[0 : start+i], nil - } - // If we're at EOF, we have a final, non-terminated line. Return it. - if atEOF { - return len(data), data, nil - } - // Request more data. - return 0, nil, nil -} - -// scanWordsKeepPrefix is a split function for a Scanner that returns each -// space-separated word of text, with prefixing spaces included. It will never -// return an empty string. The definition of space is set by unicode.IsSpace. -// -// Adapted from bufio.ScanWords(). -func scanTokensKeepPrefix(data []byte, atEOF bool) (advance int, token []byte, err error) { - // Skip leading spaces. - start := 0 - for width := 0; start < len(data); start += width { - var r rune - r, width = utf8.DecodeRune(data[start:]) - if !unicode.IsSpace(r) { - break - } - } - if atEOF && len(data) == 0 || start == len(data) { - return len(data), data, nil - } - if len(data) > start && data[start] == '#' { - return scanLinesKeepPrefix(data, atEOF) - } - // Scan until space, marking end of word. - for width, i := 0, start; i < len(data); i += width { - var r rune - r, width = utf8.DecodeRune(data[i:]) - if unicode.IsSpace(r) { - return i, data[:i], nil - } - } - // If we're at EOF, we have a final, non-empty, non-terminated word. Return it. - if atEOF && len(data) > start { - return len(data), data, nil - } - // Request more data. - return 0, nil, nil -} - -func newToken(rawb []byte) (*token, error) { - _, tkind, err := bufio.ScanWords(rawb, true) - if err != nil { - return nil, err - } - var ok bool - t := token{rawkind: rawb} - t.kind, ok = keywords[string(tkind)] - if !ok { - trimmed := strings.TrimSpace(string(tkind)) - if trimmed == "" { - t.kind = tkWhitespace // whitespace-only, should happen only at EOF - return &t, nil - } - if strings.HasPrefix(trimmed, "#") { - t.kind = tkComment // this is a comment - return &t, nil - } - return &t, fmt.Errorf("keyword expected; got " + string(tkind)) - } - return &t, nil -} - -func scanValue(scanner *bufio.Scanner, pos int) ([]byte, string, int, error) { - if scanner.Scan() { - raw := scanner.Bytes() - pos += bytes.Count(raw, []byte{'\n'}) - return raw, strings.TrimSpace(string(raw)), pos, nil - } - if err := scanner.Err(); err != nil { - return nil, "", pos, &Error{pos, err.Error()} - } - return nil, "", pos, nil -} - -func parse(r io.Reader, pos int) (*Netrc, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, err - } - - nrc := Netrc{machines: make([]*Machine, 0, 20), macros: make(Macros, 10)} - - defaultSeen := false - var currentMacro *token - var m *Machine - var t *token - scanner := bufio.NewScanner(bytes.NewReader(b)) - scanner.Split(scanTokensKeepPrefix) - - for scanner.Scan() { - rawb := scanner.Bytes() - if len(rawb) == 0 { - break - } - pos += bytes.Count(rawb, []byte{'\n'}) - t, err = newToken(rawb) - if err != nil { - if currentMacro == nil { - return nil, &Error{pos, err.Error()} - } - currentMacro.rawvalue = append(currentMacro.rawvalue, rawb...) - continue - } - - if currentMacro != nil && bytes.Contains(rawb, []byte{'\n', '\n'}) { - // if macro rawvalue + rawb would contain \n\n, then macro def is over - currentMacro.value = strings.TrimLeft(string(currentMacro.rawvalue), "\r\n") - nrc.macros[currentMacro.macroName] = currentMacro.value - currentMacro = nil - } - - switch t.kind { - case tkMacdef: - if _, t.macroName, pos, err = scanValue(scanner, pos); err != nil { - return nil, &Error{pos, err.Error()} - } - currentMacro = t - case tkDefault: - if defaultSeen { - return nil, &Error{pos, "multiple default token"} - } - if m != nil { - nrc.machines, m = append(nrc.machines, m), nil - } - m = new(Machine) - m.Name = "" - defaultSeen = true - case tkMachine: - if defaultSeen { - return nil, &Error{pos, errBadDefaultOrder} - } - if m != nil { - nrc.machines, m = append(nrc.machines, m), nil - } - m = new(Machine) - if t.rawvalue, m.Name, pos, err = scanValue(scanner, pos); err != nil { - return nil, &Error{pos, err.Error()} - } - t.value = m.Name - m.nametoken = t - case tkLogin: - if m == nil || m.Login != "" { - return nil, &Error{pos, "unexpected token login "} - } - if t.rawvalue, m.Login, pos, err = scanValue(scanner, pos); err != nil { - return nil, &Error{pos, err.Error()} - } - t.value = m.Login - m.logintoken = t - case tkPassword: - if m == nil || m.Password != "" { - return nil, &Error{pos, "unexpected token password"} - } - if t.rawvalue, m.Password, pos, err = scanValue(scanner, pos); err != nil { - return nil, &Error{pos, err.Error()} - } - t.value = m.Password - m.passtoken = t - case tkAccount: - if m == nil || m.Account != "" { - return nil, &Error{pos, "unexpected token account"} - } - if t.rawvalue, m.Account, pos, err = scanValue(scanner, pos); err != nil { - return nil, &Error{pos, err.Error()} - } - t.value = m.Account - m.accounttoken = t - } - - nrc.tokens = append(nrc.tokens, t) - } - - if err := scanner.Err(); err != nil { - return nil, err - } - - if m != nil { - nrc.machines, m = append(nrc.machines, m), nil - } - return &nrc, nil -} - -// ParseFile opens the file at filename and then passes its io.Reader to -// Parse(). -func ParseFile(filename string) (*Netrc, error) { - fd, err := os.Open(filename) - if err != nil { - return nil, err - } - defer fd.Close() - return Parse(fd) -} - -// Parse parses from the the Reader r as a netrc file and returns the set of -// machine information and macros defined in it. The ``default'' machine, -// which is intended to be used when no machine name matches, is identified -// by an empty machine name. There can be only one ``default'' machine. -// -// If there is a parsing error, an Error is returned. -func Parse(r io.Reader) (*Netrc, error) { - return parse(r, 1) -} - -// FindMachine parses the netrc file identified by filename and returns the -// Machine named by name. If a problem occurs parsing the file at filename, an -// error is returned. If a machine named by name exists, it is returned. If no -// Machine with name name is found and there is a ``default'' machine, the -// ``default'' machine is returned. Otherwise, nil is returned. -func FindMachine(filename, name string) (m *Machine, err error) { - n, err := ParseFile(filename) - if err != nil { - return nil, err - } - return n.FindMachine(name), nil -} diff --git a/ibm/vendor/github.com/go-openapi/analysis/.gitattributes b/ibm/vendor/github.com/go-openapi/analysis/.gitattributes new file mode 100644 index 0000000000..d020be8ea4 --- /dev/null +++ b/ibm/vendor/github.com/go-openapi/analysis/.gitattributes @@ -0,0 +1,2 @@ +*.go text eol=lf + diff --git a/ibm/vendor/github.com/go-openapi/analysis/.golangci.yml b/ibm/vendor/github.com/go-openapi/analysis/.golangci.yml index b5ba920b20..8cad298791 100644 --- a/ibm/vendor/github.com/go-openapi/analysis/.golangci.yml +++ b/ibm/vendor/github.com/go-openapi/analysis/.golangci.yml @@ -50,3 +50,4 @@ linters: - ifshort - forbidigo - cyclop + - varnamelen diff --git a/ibm/vendor/github.com/go-openapi/analysis/.travis.yml b/ibm/vendor/github.com/go-openapi/analysis/.travis.yml deleted file mode 100644 index 0d1dff2177..0000000000 --- a/ibm/vendor/github.com/go-openapi/analysis/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -language: go -go: -- 1.x -arch: -- amd64 -- arm64 -- ppc64le -install: -- go get gotest.tools/gotestsum -jobs: - include: - # include older golang - - go: 1.15.x - arch: - - amd64 - script: - - gotestsum -f short-with-failures -- -timeout=10m ./... - - # include osx, but only for latest go version - skip testing for race - - go: 1.x - os: - - osx - script: - - gotestsum -f short-with-failures -- -timeout=10m ./... - - # include linting check job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master - - # include race test, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - script: - - gotestsum -f short-with-failures -- -timeout=20m -race ./... - - # include long test and test coverage collection, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - script: - - gotestsum -f short-with-failures -- -timeout=20m -covermode=atomic -coverprofile=coverage.txt -coverpkg "./..." ./... -args -enable-long - after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - slack: - secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4= -script: -- gotestsum -f short-with-failures -- -timeout=10m ./... diff --git a/ibm/vendor/github.com/go-openapi/errors/.gitattributes b/ibm/vendor/github.com/go-openapi/errors/.gitattributes new file mode 100644 index 0000000000..a0717e4b3b --- /dev/null +++ b/ibm/vendor/github.com/go-openapi/errors/.gitattributes @@ -0,0 +1 @@ +*.go text eol=lf \ No newline at end of file diff --git a/ibm/vendor/github.com/go-openapi/errors/.golangci.yml b/ibm/vendor/github.com/go-openapi/errors/.golangci.yml index ee3b326969..449a43c2bc 100644 --- a/ibm/vendor/github.com/go-openapi/errors/.golangci.yml +++ b/ibm/vendor/github.com/go-openapi/errors/.golangci.yml @@ -41,3 +41,6 @@ linters: - errorlint - paralleltest - tparallel + - cyclop + - errname + - varnamelen diff --git a/ibm/vendor/github.com/go-openapi/errors/.travis.yml b/ibm/vendor/github.com/go-openapi/errors/.travis.yml deleted file mode 100644 index e4a01bfd4f..0000000000 --- a/ibm/vendor/github.com/go-openapi/errors/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: - - amd64 -jobs: - include: - # only run fast tests on ppc64le - - go: 1.x - arch: ppc64le - script: - - gotestsum -f short-verbose -- ./... - - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: gZGp9NaHxi7zawlXJXKY92BGeDR1x0tbIcTyU5nMKLq0fhIaiEBJEeALwZ4VgqsSv3DytSSF5mLH8fevAM3ixE6hxjKQ+lQuf7V/w3btCN1CSWgoua5LOh1kTnqZQtJuRvO4pzoJcT3bJWBsVZ07VGNVzzJEy/zAKCHFqBUCXShw7QemlLBcYWFNqveTlvDIfCzvouoLnPoXwxEpkjxe9uz/ZKZgAnup/fXjC8RFctmgCnkCyvJTk0Y/fZCsufixJrJhshBWTnlrFCzRmgNkz2d+i1Ls3+MJ5EJJ2Tx/A5S63dL49J1f9Kr0AKHADmulSy8JNzIckKwbyFMYUecrsW+Lsu9DhnVMy1jj5pKsJDLRi2iIU3fXTMWbcyQbXjbbnBO2mPdP3Tzme75y4D9fc8hUPeyqVv2BU26NEbQ7EF2pKJ93OXvci7HlwRBgdJa8j6mP2LEDClcPQW00g7N/OZe0cTOMa8L5AwiBlbArwqt9wv6YLJoTG0wpDhzWsFvbCg5bJxe28Yn3fIDD0Lk1I7iSnBbp/5gzF19jmxqvcT8tHRkDL4xfjbENFTZjA5uB4Z4pj4WSyWQILLV/Jwhe3fi9uQwdviFHfj5pnVrmNUiGSOQL672K5wl2c3E9mGwejvsu2dfEz28n7Y/FUnOpY3/cBS0n27JJaerS0zMKNLE= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/ibm/vendor/github.com/go-openapi/runtime/.golangci.yml b/ibm/vendor/github.com/go-openapi/runtime/.golangci.yml index 90f38cf848..b1aa7928a7 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/.golangci.yml +++ b/ibm/vendor/github.com/go-openapi/runtime/.golangci.yml @@ -1,6 +1,7 @@ linters-settings: govet: - check-shadowing: true + # Using err repeatedly considered as shadowing. + check-shadowing: false golint: min-confidence: 0 gocyclo: diff --git a/ibm/vendor/github.com/go-openapi/runtime/bytestream.go b/ibm/vendor/github.com/go-openapi/runtime/bytestream.go index 6601a7797d..6eb6ceb5c5 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/bytestream.go +++ b/ibm/vendor/github.com/go-openapi/runtime/bytestream.go @@ -38,7 +38,7 @@ type byteStreamOpts struct { Close bool } -// ByteStreamConsumer creates a consmer for byte streams, +// ByteStreamConsumer creates a consumer for byte streams, // takes a Writer/BinaryUnmarshaler interface or binary slice by reference, // and reads from the provided reader func ByteStreamConsumer(opts ...byteStreamOpt) Consumer { @@ -58,6 +58,7 @@ func ByteStreamConsumer(opts ...byteStreamOpt) Consumer { close = cl.Close } } + //nolint:errcheck // closing a reader wouldn't fail. defer close() if wrtr, ok := data.(io.Writer); ok { @@ -76,6 +77,13 @@ func ByteStreamConsumer(opts ...byteStreamOpt) Consumer { return bu.UnmarshalBinary(b) } + if data != nil { + if str, ok := data.(*string); ok { + *str = string(b) + return nil + } + } + if t := reflect.TypeOf(data); data != nil && t.Kind() == reflect.Ptr { v := reflect.Indirect(reflect.ValueOf(data)) if t = v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 { @@ -107,6 +115,7 @@ func ByteStreamProducer(opts ...byteStreamOpt) Producer { close = cl.Close } } + //nolint:errcheck // TODO: closing a writer would fail. defer close() if rc, ok := data.(io.ReadCloser); ok { diff --git a/ibm/vendor/github.com/go-openapi/runtime/client/keepalive.go b/ibm/vendor/github.com/go-openapi/runtime/client/keepalive.go index f83254515b..e9c250d6a8 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/client/keepalive.go +++ b/ibm/vendor/github.com/go-openapi/runtime/client/keepalive.go @@ -46,7 +46,10 @@ func (d *drainingReadCloser) Read(p []byte) (n int, err error) { func (d *drainingReadCloser) Close() error { // drain buffer if atomic.LoadUint32(&d.seenEOF) != 1 { - //#nosec + // If the reader side (a HTTP server) is misbehaving, it still may send + // some bytes, but the closer ignores them to keep the underling + // connection open. + //nolint:errcheck io.Copy(ioutil.Discard, d.rdr) } return d.rdr.Close() diff --git a/ibm/vendor/github.com/go-openapi/runtime/client/request.go b/ibm/vendor/github.com/go-openapi/runtime/client/request.go index 079911f2bc..7d622eee93 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/client/request.go +++ b/ibm/vendor/github.com/go-openapi/runtime/client/request.go @@ -93,6 +93,15 @@ func (r *request) BuildHTTP(mediaType, basePath string, producers map[string]run func escapeQuotes(s string) string { return strings.NewReplacer("\\", "\\\\", `"`, "\\\"").Replace(s) } + +func logClose(err error, pw *io.PipeWriter) { + log.Println(err) + closeErr := pw.CloseWithError(err) + if closeErr != nil { + log.Println(closeErr) + } +} + func (r *request) buildHTTP(mediaType, basePath string, producers map[string]runtime.Producer, registry strfmt.Registry, auth runtime.ClientAuthInfoWriter) (*http.Request, error) { // build the data if err := r.writer.WriteToRequest(r, registry); err != nil { @@ -137,8 +146,7 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run for fn, v := range r.formFields { for _, vi := range v { if err := mp.WriteField(fn, vi); err != nil { - pw.CloseWithError(err) - log.Println(err) + logClose(err, pw) return } } @@ -157,8 +165,7 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run buf := make([]byte, 512) size, err := fi.Read(buf) if err != nil { - _ = pw.CloseWithError(err) - log.Println(err) + logClose(err, pw) return } fileContentType := http.DetectContentType(buf) @@ -173,13 +180,11 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run wrtr, err := mp.CreatePart(h) if err != nil { - pw.CloseWithError(err) - log.Println(err) + logClose(err, pw) return } if _, err := io.Copy(wrtr, newFi); err != nil { - pw.CloseWithError(err) - log.Println(err) + logClose(err, pw) } } } diff --git a/ibm/vendor/github.com/go-openapi/runtime/client_response.go b/ibm/vendor/github.com/go-openapi/runtime/client_response.go index c2e82f96c7..0b7e382465 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/client_response.go +++ b/ibm/vendor/github.com/go-openapi/runtime/client_response.go @@ -69,3 +69,38 @@ func (a *APIError) Error() string { func (a *APIError) String() string { return a.Error() } + +// IsSuccess returns true when this elapse o k response returns a 2xx status code +func (o *APIError) IsSuccess() bool { + return o.Code/100 == 2 +} + +// IsRedirect returns true when this elapse o k response returns a 3xx status code +func (o *APIError) IsRedirect() bool { + return o.Code/100 == 3 +} + +// IsClientError returns true when this elapse o k response returns a 4xx status code +func (o *APIError) IsClientError() bool { + return o.Code/100 == 4 +} + +// IsServerError returns true when this elapse o k response returns a 5xx status code +func (o *APIError) IsServerError() bool { + return o.Code/100 == 5 +} + +// IsCode returns true when this elapse o k response returns a 4xx status code +func (o *APIError) IsCode(code int) bool { + return o.Code == code +} + +// A ClientResponseStatus is a common interface implemented by all responses on the generated code +// You can use this to treat any client response based on status code +type ClientResponseStatus interface { + IsSuccess() bool + IsRedirect() bool + IsClientError() bool + IsServerError() bool + IsCode(int) bool +} diff --git a/ibm/vendor/github.com/go-openapi/runtime/request.go b/ibm/vendor/github.com/go-openapi/runtime/request.go index 9e51b42b59..078fda1739 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/request.go +++ b/ibm/vendor/github.com/go-openapi/runtime/request.go @@ -48,7 +48,7 @@ func HasBody(r *http.Request) bool { return true } - if r.Header.Get(http.CanonicalHeaderKey("content-length")) != "" { + if r.Header.Get("content-length") != "" { // in this case, no Transfer-Encoding should be present // we have a header set but it was explicitly set to 0, so we assume no body return false diff --git a/ibm/vendor/github.com/go-openapi/runtime/text.go b/ibm/vendor/github.com/go-openapi/runtime/text.go index c7fd04c3c5..f33320b7dd 100644 --- a/ibm/vendor/github.com/go-openapi/runtime/text.go +++ b/ibm/vendor/github.com/go-openapi/runtime/text.go @@ -41,7 +41,6 @@ func TextConsumer() Consumer { // If the buffer is empty, no need to unmarshal it, which causes a panic. if len(b) == 0 { - data = "" return nil } diff --git a/ibm/vendor/github.com/go-openapi/strfmt/.golangci.yml b/ibm/vendor/github.com/go-openapi/strfmt/.golangci.yml index 7ffaa32b9b..da12d5e3b7 100644 --- a/ibm/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/ibm/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -35,6 +35,8 @@ linters: - godot - exhaustivestruct - paralleltest + - varnamelen + - ireturn #- thelper issues: diff --git a/ibm/vendor/github.com/go-openapi/strfmt/format.go b/ibm/vendor/github.com/go-openapi/strfmt/format.go index 602e478067..172055d22d 100644 --- a/ibm/vendor/github.com/go-openapi/strfmt/format.go +++ b/ibm/vendor/github.com/go-openapi/strfmt/format.go @@ -76,6 +76,7 @@ type defaultFormats struct { // NewFormats creates a new formats registry seeded with the values from the default func NewFormats() Registry { + //nolint:forcetypeassert return NewSeededFormats(Default.(*defaultFormats).data, nil) } diff --git a/ibm/vendor/github.com/go-openapi/strfmt/time.go b/ibm/vendor/github.com/go-openapi/strfmt/time.go index 9c9359a540..023676e6c9 100644 --- a/ibm/vendor/github.com/go-openapi/strfmt/time.go +++ b/ibm/vendor/github.com/go-openapi/strfmt/time.go @@ -18,6 +18,7 @@ import ( "database/sql/driver" "encoding/binary" "encoding/json" + "errors" "fmt" "regexp" "strings" @@ -227,6 +228,15 @@ func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { + if tpe == bsontype.Null { + *t = DateTime{} + return nil + } + + if len(data) != 8 { + return errors.New("bson date field length not exactly 8 bytes") + } + i64 := int64(binary.LittleEndian.Uint64(data)) // TODO: Use bsonprim.DateTime.Time() method *t = DateTime(time.Unix(i64/1000, i64%1000*1000000)) diff --git a/ibm/vendor/github.com/go-openapi/swag/.gitattributes b/ibm/vendor/github.com/go-openapi/swag/.gitattributes new file mode 100644 index 0000000000..49ad52766a --- /dev/null +++ b/ibm/vendor/github.com/go-openapi/swag/.gitattributes @@ -0,0 +1,2 @@ +# gofmt always uses LF, whereas Git uses CRLF on Windows. +*.go text eol=lf diff --git a/ibm/vendor/github.com/go-openapi/swag/.golangci.yml b/ibm/vendor/github.com/go-openapi/swag/.golangci.yml index 842ac1c095..2a4a71f3a8 100644 --- a/ibm/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/ibm/vendor/github.com/go-openapi/swag/.golangci.yml @@ -39,3 +39,12 @@ linters: - paralleltest - thelper - ifshort + - gomoddirectives + - cyclop + - forcetypeassert + - ireturn + - tagliatelle + - varnamelen + - goimports + - tenv + - golint diff --git a/ibm/vendor/github.com/go-openapi/swag/.travis.yml b/ibm/vendor/github.com/go-openapi/swag/.travis.yml deleted file mode 100644 index fc25a88728..0000000000 --- a/ibm/vendor/github.com/go-openapi/swag/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.14.x -- 1.x -arch: -- amd64 -jobs: - include: - # include arch ppc, but only for latest go version - skip testing for race - - go: 1.x - arch: ppc64le - install: ~ - script: - - go test -v - - #- go: 1.x - # arch: arm - # install: ~ - # script: - # - go test -v - - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/ibm/vendor/github.com/go-openapi/swag/file.go b/ibm/vendor/github.com/go-openapi/swag/file.go new file mode 100644 index 0000000000..16accc55f8 --- /dev/null +++ b/ibm/vendor/github.com/go-openapi/swag/file.go @@ -0,0 +1,33 @@ +// Copyright 2015 go-swagger maintainers +// +// 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 swag + +import "mime/multipart" + +// File represents an uploaded file. +type File struct { + Data multipart.File + Header *multipart.FileHeader +} + +// Read bytes from the file +func (f *File) Read(p []byte) (n int, err error) { + return f.Data.Read(p) +} + +// Close the file +func (f *File) Close() error { + return f.Data.Close() +} diff --git a/ibm/vendor/github.com/go-openapi/swag/post_go18.go b/ibm/vendor/github.com/go-openapi/swag/post_go18.go index c2e686d313..f5228b82c0 100644 --- a/ibm/vendor/github.com/go-openapi/swag/post_go18.go +++ b/ibm/vendor/github.com/go-openapi/swag/post_go18.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build go1.8 // +build go1.8 package swag diff --git a/ibm/vendor/github.com/go-openapi/swag/post_go19.go b/ibm/vendor/github.com/go-openapi/swag/post_go19.go index eb2f2d8bc7..7c7da9c088 100644 --- a/ibm/vendor/github.com/go-openapi/swag/post_go19.go +++ b/ibm/vendor/github.com/go-openapi/swag/post_go19.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build go1.9 // +build go1.9 package swag diff --git a/ibm/vendor/github.com/go-openapi/swag/pre_go18.go b/ibm/vendor/github.com/go-openapi/swag/pre_go18.go index 6607f33935..2757d9b95f 100644 --- a/ibm/vendor/github.com/go-openapi/swag/pre_go18.go +++ b/ibm/vendor/github.com/go-openapi/swag/pre_go18.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !go1.8 // +build !go1.8 package swag diff --git a/ibm/vendor/github.com/go-openapi/swag/pre_go19.go b/ibm/vendor/github.com/go-openapi/swag/pre_go19.go index 4bae187d1e..0565db377b 100644 --- a/ibm/vendor/github.com/go-openapi/swag/pre_go19.go +++ b/ibm/vendor/github.com/go-openapi/swag/pre_go19.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !go1.9 // +build !go1.9 package swag diff --git a/ibm/vendor/github.com/go-playground/locales/README.md b/ibm/vendor/github.com/go-playground/locales/README.md index ba1b0680c9..5b0694fd19 100644 --- a/ibm/vendor/github.com/go-playground/locales/README.md +++ b/ibm/vendor/github.com/go-playground/locales/README.md @@ -1,5 +1,5 @@ ## locales -![Project status](https://img.shields.io/badge/version-0.13.0-green.svg) +![Project status](https://img.shields.io/badge/version-0.14.0-green.svg) [![Build Status](https://travis-ci.org/go-playground/locales.svg?branch=master)](https://travis-ci.org/go-playground/locales) [![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/locales)](https://goreportcard.com/report/github.com/go-playground/locales) [![GoDoc](https://godoc.org/github.com/go-playground/locales?status.svg)](https://godoc.org/github.com/go-playground/locales) @@ -11,7 +11,7 @@ an i18n package; these were built for use with, but not exclusive to, [Universal Features -------- -- [x] Rules generated from the latest [CLDR](http://cldr.unicode.org/index/downloads) data, v31.0.1 +- [x] Rules generated from the latest [CLDR](http://cldr.unicode.org/index/downloads) data, v36.0.1 - [x] Contains Cardinal, Ordinal and Range Plural Rules - [x] Contains Month, Weekday and Timezone translations built in - [x] Contains Date & Time formatting functions diff --git a/ibm/vendor/github.com/go-playground/locales/currency/currency.go b/ibm/vendor/github.com/go-playground/locales/currency/currency.go index cdaba596b6..b5a95fb074 100644 --- a/ibm/vendor/github.com/go-playground/locales/currency/currency.go +++ b/ibm/vendor/github.com/go-playground/locales/currency/currency.go @@ -176,6 +176,7 @@ const ( MNT MOP MRO + MRU MTL MTP MUR @@ -262,9 +263,11 @@ const ( UYI UYP UYU + UYW UZS VEB VEF + VES VND VNN VUV diff --git a/ibm/vendor/github.com/go-playground/universal-translator/Makefile b/ibm/vendor/github.com/go-playground/universal-translator/Makefile new file mode 100644 index 0000000000..ec3455bd59 --- /dev/null +++ b/ibm/vendor/github.com/go-playground/universal-translator/Makefile @@ -0,0 +1,18 @@ +GOCMD=GO111MODULE=on go + +linters-install: + @golangci-lint --version >/dev/null 2>&1 || { \ + echo "installing linting tools..."; \ + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.41.1; \ + } + +lint: linters-install + golangci-lint run + +test: + $(GOCMD) test -cover -race ./... + +bench: + $(GOCMD) test -bench=. -benchmem ./... + +.PHONY: test lint linters-install \ No newline at end of file diff --git a/ibm/vendor/github.com/go-playground/universal-translator/README.md b/ibm/vendor/github.com/go-playground/universal-translator/README.md index 071f33ab25..46dec6d2b2 100644 --- a/ibm/vendor/github.com/go-playground/universal-translator/README.md +++ b/ibm/vendor/github.com/go-playground/universal-translator/README.md @@ -1,5 +1,5 @@ ## universal-translator -![Project status](https://img.shields.io/badge/version-0.17.0-green.svg) +![Project status](https://img.shields.io/badge/version-0.18.0-green.svg) [![Build Status](https://travis-ci.org/go-playground/universal-translator.svg?branch=master)](https://travis-ci.org/go-playground/universal-translator) [![Coverage Status](https://coveralls.io/repos/github/go-playground/universal-translator/badge.svg)](https://coveralls.io/github/go-playground/universal-translator) [![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/universal-translator)](https://goreportcard.com/report/github.com/go-playground/universal-translator) @@ -18,7 +18,7 @@ use in your applications. Features -------- -- [x] Rules generated from the [CLDR](http://cldr.unicode.org/index/downloads) data, v30.0.3 +- [x] Rules generated from the [CLDR](http://cldr.unicode.org/index/downloads) data, v36.0.1 - [x] Contains Cardinal, Ordinal and Range Plural Rules - [x] Contains Month, Weekday and Timezone translations built in - [x] Contains Date & Time formatting functions @@ -51,7 +51,7 @@ Please see https://godoc.org/github.com/go-playground/universal-translator for u File formatting -------------- -All types, Plain substitution, Cardinal, Ordinal and Range translations can all be contained withing the same file(s); +All types, Plain substitution, Cardinal, Ordinal and Range translations can all be contained within the same file(s); they are only separated for easy viewing. ##### Examples: diff --git a/ibm/vendor/github.com/go-playground/universal-translator/import_export.go b/ibm/vendor/github.com/go-playground/universal-translator/import_export.go index 7bd76f26b6..1216f19237 100644 --- a/ibm/vendor/github.com/go-playground/universal-translator/import_export.go +++ b/ibm/vendor/github.com/go-playground/universal-translator/import_export.go @@ -257,6 +257,8 @@ func (t *UniversalTranslator) ImportByReader(format ImportExportFormat, reader i func stringToPR(s string) locales.PluralRule { switch s { + case "Zero": + return locales.PluralRuleZero case "One": return locales.PluralRuleOne case "Two": diff --git a/ibm/vendor/github.com/go-playground/universal-translator/translator.go b/ibm/vendor/github.com/go-playground/universal-translator/translator.go index cfafce8a09..24b18db92a 100644 --- a/ibm/vendor/github.com/go-playground/universal-translator/translator.go +++ b/ibm/vendor/github.com/go-playground/universal-translator/translator.go @@ -159,13 +159,13 @@ func (t *translator) AddCardinal(key interface{}, text string, rule locales.Plur } } else { - tarr = make([]*transText, 7, 7) + tarr = make([]*transText, 7) t.cardinalTanslations[key] = tarr } trans := &transText{ text: text, - indexes: make([]int, 2, 2), + indexes: make([]int, 2), } tarr[rule] = trans @@ -211,13 +211,13 @@ func (t *translator) AddOrdinal(key interface{}, text string, rule locales.Plura } } else { - tarr = make([]*transText, 7, 7) + tarr = make([]*transText, 7) t.ordinalTanslations[key] = tarr } trans := &transText{ text: text, - indexes: make([]int, 2, 2), + indexes: make([]int, 2), } tarr[rule] = trans @@ -261,13 +261,13 @@ func (t *translator) AddRange(key interface{}, text string, rule locales.PluralR } } else { - tarr = make([]*transText, 7, 7) + tarr = make([]*transText, 7) t.rangeTanslations[key] = tarr } trans := &transText{ text: text, - indexes: make([]int, 4, 4), + indexes: make([]int, 4), } tarr[rule] = trans diff --git a/ibm/vendor/github.com/go-stack/stack/.travis.yml b/ibm/vendor/github.com/go-stack/stack/.travis.yml deleted file mode 100644 index 5c5a2b516d..0000000000 --- a/ibm/vendor/github.com/go-stack/stack/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -sudo: false -go: - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - tip - -before_install: - - go get github.com/mattn/goveralls - -script: - - goveralls -service=travis-ci diff --git a/ibm/vendor/github.com/golang/groupcache/LICENSE b/ibm/vendor/github.com/golang/groupcache/LICENSE deleted file mode 100644 index 37ec93a14f..0000000000 --- a/ibm/vendor/github.com/golang/groupcache/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: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -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 -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/ibm/vendor/github.com/golang/groupcache/lru/lru.go b/ibm/vendor/github.com/golang/groupcache/lru/lru.go deleted file mode 100644 index eac1c7664f..0000000000 --- a/ibm/vendor/github.com/golang/groupcache/lru/lru.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2013 Google Inc. - -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 lru implements an LRU cache. -package lru - -import "container/list" - -// Cache is an LRU cache. It is not safe for concurrent access. -type Cache struct { - // MaxEntries is the maximum number of cache entries before - // an item is evicted. Zero means no limit. - MaxEntries int - - // OnEvicted optionally specifies a callback function to be - // executed when an entry is purged from the cache. - OnEvicted func(key Key, value interface{}) - - ll *list.List - cache map[interface{}]*list.Element -} - -// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators -type Key interface{} - -type entry struct { - key Key - value interface{} -} - -// New creates a new Cache. -// If maxEntries is zero, the cache has no limit and it's assumed -// that eviction is done by the caller. -func New(maxEntries int) *Cache { - return &Cache{ - MaxEntries: maxEntries, - ll: list.New(), - cache: make(map[interface{}]*list.Element), - } -} - -// Add adds a value to the cache. -func (c *Cache) Add(key Key, value interface{}) { - if c.cache == nil { - c.cache = make(map[interface{}]*list.Element) - c.ll = list.New() - } - if ee, ok := c.cache[key]; ok { - c.ll.MoveToFront(ee) - ee.Value.(*entry).value = value - return - } - ele := c.ll.PushFront(&entry{key, value}) - c.cache[key] = ele - if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries { - c.RemoveOldest() - } -} - -// Get looks up a key's value from the cache. -func (c *Cache) Get(key Key) (value interface{}, ok bool) { - if c.cache == nil { - return - } - if ele, hit := c.cache[key]; hit { - c.ll.MoveToFront(ele) - return ele.Value.(*entry).value, true - } - return -} - -// Remove removes the provided key from the cache. -func (c *Cache) Remove(key Key) { - if c.cache == nil { - return - } - if ele, hit := c.cache[key]; hit { - c.removeElement(ele) - } -} - -// RemoveOldest removes the oldest item from the cache. -func (c *Cache) RemoveOldest() { - if c.cache == nil { - return - } - ele := c.ll.Back() - if ele != nil { - c.removeElement(ele) - } -} - -func (c *Cache) removeElement(e *list.Element) { - c.ll.Remove(e) - kv := e.Value.(*entry) - delete(c.cache, kv.key) - if c.OnEvicted != nil { - c.OnEvicted(kv.key, kv.value) - } -} - -// Len returns the number of items in the cache. -func (c *Cache) Len() int { - if c.cache == nil { - return 0 - } - return c.ll.Len() -} - -// Clear purges all stored items from the cache. -func (c *Cache) Clear() { - if c.OnEvicted != nil { - for _, e := range c.cache { - kv := e.Value.(*entry) - c.OnEvicted(kv.key, kv.value) - } - } - c.ll = nil - c.cache = nil -} diff --git a/ibm/vendor/github.com/golang/protobuf/internal/gengogrpc/grpc.go b/ibm/vendor/github.com/golang/protobuf/internal/gengogrpc/grpc.go deleted file mode 100644 index fd2f51d890..0000000000 --- a/ibm/vendor/github.com/golang/protobuf/internal/gengogrpc/grpc.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gengogrpc contains the gRPC code generator. -package gengogrpc - -import ( - "fmt" - "strconv" - "strings" - - "google.golang.org/protobuf/compiler/protogen" - - "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - contextPackage = protogen.GoImportPath("context") - grpcPackage = protogen.GoImportPath("google.golang.org/grpc") - codesPackage = protogen.GoImportPath("google.golang.org/grpc/codes") - statusPackage = protogen.GoImportPath("google.golang.org/grpc/status") -) - -// GenerateFile generates a _grpc.pb.go file containing gRPC service definitions. -func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { - if len(file.Services) == 0 { - return nil - } - filename := file.GeneratedFilenamePrefix + "_grpc.pb.go" - g := gen.NewGeneratedFile(filename, file.GoImportPath) - g.P("// Code generated by protoc-gen-go-grpc. DO NOT EDIT.") - g.P() - g.P("package ", file.GoPackageName) - g.P() - GenerateFileContent(gen, file, g) - return g -} - -// GenerateFileContent generates the gRPC service definitions, excluding the package statement. -func GenerateFileContent(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile) { - if len(file.Services) == 0 { - return - } - - // TODO: Remove this. We don't need to include these references any more. - g.P("// Reference imports to suppress errors if they are not otherwise used.") - g.P("var _ ", contextPackage.Ident("Context")) - g.P("var _ ", grpcPackage.Ident("ClientConnInterface")) - g.P() - - g.P("// This is a compile-time assertion to ensure that this generated file") - g.P("// is compatible with the grpc package it is being compiled against.") - g.P("const _ = ", grpcPackage.Ident("SupportPackageIsVersion6")) - g.P() - for _, service := range file.Services { - genService(gen, file, g, service) - } -} - -func genService(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) { - clientName := service.GoName + "Client" - - g.P("// ", clientName, " is the client API for ", service.GoName, " service.") - g.P("//") - g.P("// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.") - - // Client interface. - if service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() { - g.P("//") - g.P(deprecationComment) - } - g.Annotate(clientName, service.Location) - g.P("type ", clientName, " interface {") - for _, method := range service.Methods { - g.Annotate(clientName+"."+method.GoName, method.Location) - if method.Desc.Options().(*descriptorpb.MethodOptions).GetDeprecated() { - g.P(deprecationComment) - } - g.P(method.Comments.Leading, - clientSignature(g, method)) - } - g.P("}") - g.P() - - // Client structure. - g.P("type ", unexport(clientName), " struct {") - g.P("cc ", grpcPackage.Ident("ClientConnInterface")) - g.P("}") - g.P() - - // NewClient factory. - if service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() { - g.P(deprecationComment) - } - g.P("func New", clientName, " (cc ", grpcPackage.Ident("ClientConnInterface"), ") ", clientName, " {") - g.P("return &", unexport(clientName), "{cc}") - g.P("}") - g.P() - - var methodIndex, streamIndex int - // Client method implementations. - for _, method := range service.Methods { - if !method.Desc.IsStreamingServer() && !method.Desc.IsStreamingClient() { - // Unary RPC method - genClientMethod(gen, file, g, method, methodIndex) - methodIndex++ - } else { - // Streaming RPC method - genClientMethod(gen, file, g, method, streamIndex) - streamIndex++ - } - } - - // Server interface. - serverType := service.GoName + "Server" - g.P("// ", serverType, " is the server API for ", service.GoName, " service.") - if service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() { - g.P("//") - g.P(deprecationComment) - } - g.Annotate(serverType, service.Location) - g.P("type ", serverType, " interface {") - for _, method := range service.Methods { - g.Annotate(serverType+"."+method.GoName, method.Location) - if method.Desc.Options().(*descriptorpb.MethodOptions).GetDeprecated() { - g.P(deprecationComment) - } - g.P(method.Comments.Leading, - serverSignature(g, method)) - } - g.P("}") - g.P() - - // Server Unimplemented struct for forward compatibility. - g.P("// Unimplemented", serverType, " can be embedded to have forward compatible implementations.") - g.P("type Unimplemented", serverType, " struct {") - g.P("}") - g.P() - for _, method := range service.Methods { - nilArg := "" - if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() { - nilArg = "nil," - } - g.P("func (*Unimplemented", serverType, ") ", serverSignature(g, method), "{") - g.P("return ", nilArg, statusPackage.Ident("Errorf"), "(", codesPackage.Ident("Unimplemented"), `, "method `, method.GoName, ` not implemented")`) - g.P("}") - } - g.P() - - // Server registration. - if service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() { - g.P(deprecationComment) - } - serviceDescVar := "_" + service.GoName + "_serviceDesc" - g.P("func Register", service.GoName, "Server(s *", grpcPackage.Ident("Server"), ", srv ", serverType, ") {") - g.P("s.RegisterService(&", serviceDescVar, `, srv)`) - g.P("}") - g.P() - - // Server handler implementations. - var handlerNames []string - for _, method := range service.Methods { - hname := genServerMethod(gen, file, g, method) - handlerNames = append(handlerNames, hname) - } - - // Service descriptor. - g.P("var ", serviceDescVar, " = ", grpcPackage.Ident("ServiceDesc"), " {") - g.P("ServiceName: ", strconv.Quote(string(service.Desc.FullName())), ",") - g.P("HandlerType: (*", serverType, ")(nil),") - g.P("Methods: []", grpcPackage.Ident("MethodDesc"), "{") - for i, method := range service.Methods { - if method.Desc.IsStreamingClient() || method.Desc.IsStreamingServer() { - continue - } - g.P("{") - g.P("MethodName: ", strconv.Quote(string(method.Desc.Name())), ",") - g.P("Handler: ", handlerNames[i], ",") - g.P("},") - } - g.P("},") - g.P("Streams: []", grpcPackage.Ident("StreamDesc"), "{") - for i, method := range service.Methods { - if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() { - continue - } - g.P("{") - g.P("StreamName: ", strconv.Quote(string(method.Desc.Name())), ",") - g.P("Handler: ", handlerNames[i], ",") - if method.Desc.IsStreamingServer() { - g.P("ServerStreams: true,") - } - if method.Desc.IsStreamingClient() { - g.P("ClientStreams: true,") - } - g.P("},") - } - g.P("},") - g.P("Metadata: \"", file.Desc.Path(), "\",") - g.P("}") - g.P() -} - -func clientSignature(g *protogen.GeneratedFile, method *protogen.Method) string { - s := method.GoName + "(ctx " + g.QualifiedGoIdent(contextPackage.Ident("Context")) - if !method.Desc.IsStreamingClient() { - s += ", in *" + g.QualifiedGoIdent(method.Input.GoIdent) - } - s += ", opts ..." + g.QualifiedGoIdent(grpcPackage.Ident("CallOption")) + ") (" - if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() { - s += "*" + g.QualifiedGoIdent(method.Output.GoIdent) - } else { - s += method.Parent.GoName + "_" + method.GoName + "Client" - } - s += ", error)" - return s -} - -func genClientMethod(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, method *protogen.Method, index int) { - service := method.Parent - sname := fmt.Sprintf("/%s/%s", service.Desc.FullName(), method.Desc.Name()) - - if method.Desc.Options().(*descriptorpb.MethodOptions).GetDeprecated() { - g.P(deprecationComment) - } - g.P("func (c *", unexport(service.GoName), "Client) ", clientSignature(g, method), "{") - if !method.Desc.IsStreamingServer() && !method.Desc.IsStreamingClient() { - g.P("out := new(", method.Output.GoIdent, ")") - g.P(`err := c.cc.Invoke(ctx, "`, sname, `", in, out, opts...)`) - g.P("if err != nil { return nil, err }") - g.P("return out, nil") - g.P("}") - g.P() - return - } - streamType := unexport(service.GoName) + method.GoName + "Client" - serviceDescVar := "_" + service.GoName + "_serviceDesc" - g.P("stream, err := c.cc.NewStream(ctx, &", serviceDescVar, ".Streams[", index, `], "`, sname, `", opts...)`) - g.P("if err != nil { return nil, err }") - g.P("x := &", streamType, "{stream}") - if !method.Desc.IsStreamingClient() { - g.P("if err := x.ClientStream.SendMsg(in); err != nil { return nil, err }") - g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }") - } - g.P("return x, nil") - g.P("}") - g.P() - - genSend := method.Desc.IsStreamingClient() - genRecv := method.Desc.IsStreamingServer() - genCloseAndRecv := !method.Desc.IsStreamingServer() - - // Stream auxiliary types and methods. - g.P("type ", service.GoName, "_", method.GoName, "Client interface {") - if genSend { - g.P("Send(*", method.Input.GoIdent, ") error") - } - if genRecv { - g.P("Recv() (*", method.Output.GoIdent, ", error)") - } - if genCloseAndRecv { - g.P("CloseAndRecv() (*", method.Output.GoIdent, ", error)") - } - g.P(grpcPackage.Ident("ClientStream")) - g.P("}") - g.P() - - g.P("type ", streamType, " struct {") - g.P(grpcPackage.Ident("ClientStream")) - g.P("}") - g.P() - - if genSend { - g.P("func (x *", streamType, ") Send(m *", method.Input.GoIdent, ") error {") - g.P("return x.ClientStream.SendMsg(m)") - g.P("}") - g.P() - } - if genRecv { - g.P("func (x *", streamType, ") Recv() (*", method.Output.GoIdent, ", error) {") - g.P("m := new(", method.Output.GoIdent, ")") - g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }") - g.P("return m, nil") - g.P("}") - g.P() - } - if genCloseAndRecv { - g.P("func (x *", streamType, ") CloseAndRecv() (*", method.Output.GoIdent, ", error) {") - g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }") - g.P("m := new(", method.Output.GoIdent, ")") - g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }") - g.P("return m, nil") - g.P("}") - g.P() - } -} - -func serverSignature(g *protogen.GeneratedFile, method *protogen.Method) string { - var reqArgs []string - ret := "error" - if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() { - reqArgs = append(reqArgs, g.QualifiedGoIdent(contextPackage.Ident("Context"))) - ret = "(*" + g.QualifiedGoIdent(method.Output.GoIdent) + ", error)" - } - if !method.Desc.IsStreamingClient() { - reqArgs = append(reqArgs, "*"+g.QualifiedGoIdent(method.Input.GoIdent)) - } - if method.Desc.IsStreamingClient() || method.Desc.IsStreamingServer() { - reqArgs = append(reqArgs, method.Parent.GoName+"_"+method.GoName+"Server") - } - return method.GoName + "(" + strings.Join(reqArgs, ", ") + ") " + ret -} - -func genServerMethod(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, method *protogen.Method) string { - service := method.Parent - hname := fmt.Sprintf("_%s_%s_Handler", service.GoName, method.GoName) - - if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() { - g.P("func ", hname, "(srv interface{}, ctx ", contextPackage.Ident("Context"), ", dec func(interface{}) error, interceptor ", grpcPackage.Ident("UnaryServerInterceptor"), ") (interface{}, error) {") - g.P("in := new(", method.Input.GoIdent, ")") - g.P("if err := dec(in); err != nil { return nil, err }") - g.P("if interceptor == nil { return srv.(", service.GoName, "Server).", method.GoName, "(ctx, in) }") - g.P("info := &", grpcPackage.Ident("UnaryServerInfo"), "{") - g.P("Server: srv,") - g.P("FullMethod: ", strconv.Quote(fmt.Sprintf("/%s/%s", service.Desc.FullName(), method.GoName)), ",") - g.P("}") - g.P("handler := func(ctx ", contextPackage.Ident("Context"), ", req interface{}) (interface{}, error) {") - g.P("return srv.(", service.GoName, "Server).", method.GoName, "(ctx, req.(*", method.Input.GoIdent, "))") - g.P("}") - g.P("return interceptor(ctx, in, info, handler)") - g.P("}") - g.P() - return hname - } - streamType := unexport(service.GoName) + method.GoName + "Server" - g.P("func ", hname, "(srv interface{}, stream ", grpcPackage.Ident("ServerStream"), ") error {") - if !method.Desc.IsStreamingClient() { - g.P("m := new(", method.Input.GoIdent, ")") - g.P("if err := stream.RecvMsg(m); err != nil { return err }") - g.P("return srv.(", service.GoName, "Server).", method.GoName, "(m, &", streamType, "{stream})") - } else { - g.P("return srv.(", service.GoName, "Server).", method.GoName, "(&", streamType, "{stream})") - } - g.P("}") - g.P() - - genSend := method.Desc.IsStreamingServer() - genSendAndClose := !method.Desc.IsStreamingServer() - genRecv := method.Desc.IsStreamingClient() - - // Stream auxiliary types and methods. - g.P("type ", service.GoName, "_", method.GoName, "Server interface {") - if genSend { - g.P("Send(*", method.Output.GoIdent, ") error") - } - if genSendAndClose { - g.P("SendAndClose(*", method.Output.GoIdent, ") error") - } - if genRecv { - g.P("Recv() (*", method.Input.GoIdent, ", error)") - } - g.P(grpcPackage.Ident("ServerStream")) - g.P("}") - g.P() - - g.P("type ", streamType, " struct {") - g.P(grpcPackage.Ident("ServerStream")) - g.P("}") - g.P() - - if genSend { - g.P("func (x *", streamType, ") Send(m *", method.Output.GoIdent, ") error {") - g.P("return x.ServerStream.SendMsg(m)") - g.P("}") - g.P() - } - if genSendAndClose { - g.P("func (x *", streamType, ") SendAndClose(m *", method.Output.GoIdent, ") error {") - g.P("return x.ServerStream.SendMsg(m)") - g.P("}") - g.P() - } - if genRecv { - g.P("func (x *", streamType, ") Recv() (*", method.Input.GoIdent, ", error) {") - g.P("m := new(", method.Input.GoIdent, ")") - g.P("if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err }") - g.P("return m, nil") - g.P("}") - g.P() - } - - return hname -} - -const deprecationComment = "// Deprecated: Do not use." - -func unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] } diff --git a/ibm/vendor/github.com/golang/protobuf/protoc-gen-go/main.go b/ibm/vendor/github.com/golang/protobuf/protoc-gen-go/main.go deleted file mode 100644 index d45b719d1c..0000000000 --- a/ibm/vendor/github.com/golang/protobuf/protoc-gen-go/main.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// protoc-gen-go is a plugin for the Google protocol buffer compiler to generate -// Go code. Install it by building this program and making it accessible within -// your PATH with the name: -// protoc-gen-go -// -// The 'go' suffix becomes part of the argument for the protocol compiler, -// such that it can be invoked as: -// protoc --go_out=paths=source_relative:. path/to/file.proto -// -// This generates Go bindings for the protocol buffer defined by file.proto. -// With that input, the output will be written to: -// path/to/file.pb.go -// -// See the README and documentation for protocol buffers to learn more: -// https://developers.google.com/protocol-buffers/ -package main - -import ( - "flag" - "fmt" - "strings" - - "github.com/golang/protobuf/internal/gengogrpc" - gengo "google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo" - "google.golang.org/protobuf/compiler/protogen" -) - -func main() { - var ( - flags flag.FlagSet - plugins = flags.String("plugins", "", "list of plugins to enable (supported values: grpc)") - importPrefix = flags.String("import_prefix", "", "prefix to prepend to import paths") - ) - importRewriteFunc := func(importPath protogen.GoImportPath) protogen.GoImportPath { - switch importPath { - case "context", "fmt", "math": - return importPath - } - if *importPrefix != "" { - return protogen.GoImportPath(*importPrefix) + importPath - } - return importPath - } - protogen.Options{ - ParamFunc: flags.Set, - ImportRewriteFunc: importRewriteFunc, - }.Run(func(gen *protogen.Plugin) error { - grpc := false - for _, plugin := range strings.Split(*plugins, ",") { - switch plugin { - case "grpc": - grpc = true - case "": - default: - return fmt.Errorf("protoc-gen-go: unknown plugin %q", plugin) - } - } - for _, f := range gen.Files { - if !f.Generate { - continue - } - g := gengo.GenerateFile(gen, f) - if grpc { - gengogrpc.GenerateFileContent(gen, f, g) - } - } - gen.SupportedFeatures = gengo.SupportedFeatures - return nil - }) -} diff --git a/ibm/vendor/github.com/google/go-cmp/LICENSE b/ibm/vendor/github.com/google/go-cmp/LICENSE new file mode 100644 index 0000000000..32017f8fa1 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2017 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/compare.go b/ibm/vendor/github.com/google/go-cmp/cmp/compare.go new file mode 100644 index 0000000000..86d0903b8b --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/compare.go @@ -0,0 +1,682 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package cmp determines equality of values. +// +// This package is intended to be a more powerful and safer alternative to +// reflect.DeepEqual for comparing whether two values are semantically equal. +// It is intended to only be used in tests, as performance is not a goal and +// it may panic if it cannot compare the values. Its propensity towards +// panicking means that its unsuitable for production environments where a +// spurious panic may be fatal. +// +// The primary features of cmp are: +// +// • When the default behavior of equality does not suit the needs of the test, +// custom equality functions can override the equality operation. +// For example, an equality function may report floats as equal so long as they +// are within some tolerance of each other. +// +// • Types that have an Equal method may use that method to determine equality. +// This allows package authors to determine the equality operation for the types +// that they define. +// +// • If no custom equality functions are used and no Equal method is defined, +// equality is determined by recursively comparing the primitive kinds on both +// values, much like reflect.DeepEqual. Unlike reflect.DeepEqual, unexported +// fields are not compared by default; they result in panics unless suppressed +// by using an Ignore option (see cmpopts.IgnoreUnexported) or explicitly +// compared using the Exporter option. +package cmp + +import ( + "fmt" + "reflect" + "strings" + + "github.com/google/go-cmp/cmp/internal/diff" + "github.com/google/go-cmp/cmp/internal/flags" + "github.com/google/go-cmp/cmp/internal/function" + "github.com/google/go-cmp/cmp/internal/value" +) + +// Equal reports whether x and y are equal by recursively applying the +// following rules in the given order to x and y and all of their sub-values: +// +// • Let S be the set of all Ignore, Transformer, and Comparer options that +// remain after applying all path filters, value filters, and type filters. +// If at least one Ignore exists in S, then the comparison is ignored. +// If the number of Transformer and Comparer options in S is greater than one, +// then Equal panics because it is ambiguous which option to use. +// If S contains a single Transformer, then use that to transform the current +// values and recursively call Equal on the output values. +// If S contains a single Comparer, then use that to compare the current values. +// Otherwise, evaluation proceeds to the next rule. +// +// • If the values have an Equal method of the form "(T) Equal(T) bool" or +// "(T) Equal(I) bool" where T is assignable to I, then use the result of +// x.Equal(y) even if x or y is nil. Otherwise, no such method exists and +// evaluation proceeds to the next rule. +// +// • Lastly, try to compare x and y based on their basic kinds. +// Simple kinds like booleans, integers, floats, complex numbers, strings, and +// channels are compared using the equivalent of the == operator in Go. +// Functions are only equal if they are both nil, otherwise they are unequal. +// +// Structs are equal if recursively calling Equal on all fields report equal. +// If a struct contains unexported fields, Equal panics unless an Ignore option +// (e.g., cmpopts.IgnoreUnexported) ignores that field or the Exporter option +// explicitly permits comparing the unexported field. +// +// Slices are equal if they are both nil or both non-nil, where recursively +// calling Equal on all non-ignored slice or array elements report equal. +// Empty non-nil slices and nil slices are not equal; to equate empty slices, +// consider using cmpopts.EquateEmpty. +// +// Maps are equal if they are both nil or both non-nil, where recursively +// calling Equal on all non-ignored map entries report equal. +// Map keys are equal according to the == operator. +// To use custom comparisons for map keys, consider using cmpopts.SortMaps. +// Empty non-nil maps and nil maps are not equal; to equate empty maps, +// consider using cmpopts.EquateEmpty. +// +// Pointers and interfaces are equal if they are both nil or both non-nil, +// where they have the same underlying concrete type and recursively +// calling Equal on the underlying values reports equal. +// +// Before recursing into a pointer, slice element, or map, the current path +// is checked to detect whether the address has already been visited. +// If there is a cycle, then the pointed at values are considered equal +// only if both addresses were previously visited in the same path step. +func Equal(x, y interface{}, opts ...Option) bool { + s := newState(opts) + s.compareAny(rootStep(x, y)) + return s.result.Equal() +} + +// Diff returns a human-readable report of the differences between two values: +// y - x. It returns an empty string if and only if Equal returns true for the +// same input values and options. +// +// The output is displayed as a literal in pseudo-Go syntax. +// At the start of each line, a "-" prefix indicates an element removed from x, +// a "+" prefix to indicates an element added from y, and the lack of a prefix +// indicates an element common to both x and y. If possible, the output +// uses fmt.Stringer.String or error.Error methods to produce more humanly +// readable outputs. In such cases, the string is prefixed with either an +// 's' or 'e' character, respectively, to indicate that the method was called. +// +// Do not depend on this output being stable. If you need the ability to +// programmatically interpret the difference, consider using a custom Reporter. +func Diff(x, y interface{}, opts ...Option) string { + s := newState(opts) + + // Optimization: If there are no other reporters, we can optimize for the + // common case where the result is equal (and thus no reported difference). + // This avoids the expensive construction of a difference tree. + if len(s.reporters) == 0 { + s.compareAny(rootStep(x, y)) + if s.result.Equal() { + return "" + } + s.result = diff.Result{} // Reset results + } + + r := new(defaultReporter) + s.reporters = append(s.reporters, reporter{r}) + s.compareAny(rootStep(x, y)) + d := r.String() + if (d == "") != s.result.Equal() { + panic("inconsistent difference and equality results") + } + return d +} + +// rootStep constructs the first path step. If x and y have differing types, +// then they are stored within an empty interface type. +func rootStep(x, y interface{}) PathStep { + vx := reflect.ValueOf(x) + vy := reflect.ValueOf(y) + + // If the inputs are different types, auto-wrap them in an empty interface + // so that they have the same parent type. + var t reflect.Type + if !vx.IsValid() || !vy.IsValid() || vx.Type() != vy.Type() { + t = reflect.TypeOf((*interface{})(nil)).Elem() + if vx.IsValid() { + vvx := reflect.New(t).Elem() + vvx.Set(vx) + vx = vvx + } + if vy.IsValid() { + vvy := reflect.New(t).Elem() + vvy.Set(vy) + vy = vvy + } + } else { + t = vx.Type() + } + + return &pathStep{t, vx, vy} +} + +type state struct { + // These fields represent the "comparison state". + // Calling statelessCompare must not result in observable changes to these. + result diff.Result // The current result of comparison + curPath Path // The current path in the value tree + curPtrs pointerPath // The current set of visited pointers + reporters []reporter // Optional reporters + + // recChecker checks for infinite cycles applying the same set of + // transformers upon the output of itself. + recChecker recChecker + + // dynChecker triggers pseudo-random checks for option correctness. + // It is safe for statelessCompare to mutate this value. + dynChecker dynChecker + + // These fields, once set by processOption, will not change. + exporters []exporter // List of exporters for structs with unexported fields + opts Options // List of all fundamental and filter options +} + +func newState(opts []Option) *state { + // Always ensure a validator option exists to validate the inputs. + s := &state{opts: Options{validator{}}} + s.curPtrs.Init() + s.processOption(Options(opts)) + return s +} + +func (s *state) processOption(opt Option) { + switch opt := opt.(type) { + case nil: + case Options: + for _, o := range opt { + s.processOption(o) + } + case coreOption: + type filtered interface { + isFiltered() bool + } + if fopt, ok := opt.(filtered); ok && !fopt.isFiltered() { + panic(fmt.Sprintf("cannot use an unfiltered option: %v", opt)) + } + s.opts = append(s.opts, opt) + case exporter: + s.exporters = append(s.exporters, opt) + case reporter: + s.reporters = append(s.reporters, opt) + default: + panic(fmt.Sprintf("unknown option %T", opt)) + } +} + +// statelessCompare compares two values and returns the result. +// This function is stateless in that it does not alter the current result, +// or output to any registered reporters. +func (s *state) statelessCompare(step PathStep) diff.Result { + // We do not save and restore curPath and curPtrs because all of the + // compareX methods should properly push and pop from them. + // It is an implementation bug if the contents of the paths differ from + // when calling this function to when returning from it. + + oldResult, oldReporters := s.result, s.reporters + s.result = diff.Result{} // Reset result + s.reporters = nil // Remove reporters to avoid spurious printouts + s.compareAny(step) + res := s.result + s.result, s.reporters = oldResult, oldReporters + return res +} + +func (s *state) compareAny(step PathStep) { + // Update the path stack. + s.curPath.push(step) + defer s.curPath.pop() + for _, r := range s.reporters { + r.PushStep(step) + defer r.PopStep() + } + s.recChecker.Check(s.curPath) + + // Cycle-detection for slice elements (see NOTE in compareSlice). + t := step.Type() + vx, vy := step.Values() + if si, ok := step.(SliceIndex); ok && si.isSlice && vx.IsValid() && vy.IsValid() { + px, py := vx.Addr(), vy.Addr() + if eq, visited := s.curPtrs.Push(px, py); visited { + s.report(eq, reportByCycle) + return + } + defer s.curPtrs.Pop(px, py) + } + + // Rule 1: Check whether an option applies on this node in the value tree. + if s.tryOptions(t, vx, vy) { + return + } + + // Rule 2: Check whether the type has a valid Equal method. + if s.tryMethod(t, vx, vy) { + return + } + + // Rule 3: Compare based on the underlying kind. + switch t.Kind() { + case reflect.Bool: + s.report(vx.Bool() == vy.Bool(), 0) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + s.report(vx.Int() == vy.Int(), 0) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + s.report(vx.Uint() == vy.Uint(), 0) + case reflect.Float32, reflect.Float64: + s.report(vx.Float() == vy.Float(), 0) + case reflect.Complex64, reflect.Complex128: + s.report(vx.Complex() == vy.Complex(), 0) + case reflect.String: + s.report(vx.String() == vy.String(), 0) + case reflect.Chan, reflect.UnsafePointer: + s.report(vx.Pointer() == vy.Pointer(), 0) + case reflect.Func: + s.report(vx.IsNil() && vy.IsNil(), 0) + case reflect.Struct: + s.compareStruct(t, vx, vy) + case reflect.Slice, reflect.Array: + s.compareSlice(t, vx, vy) + case reflect.Map: + s.compareMap(t, vx, vy) + case reflect.Ptr: + s.comparePtr(t, vx, vy) + case reflect.Interface: + s.compareInterface(t, vx, vy) + default: + panic(fmt.Sprintf("%v kind not handled", t.Kind())) + } +} + +func (s *state) tryOptions(t reflect.Type, vx, vy reflect.Value) bool { + // Evaluate all filters and apply the remaining options. + if opt := s.opts.filter(s, t, vx, vy); opt != nil { + opt.apply(s, vx, vy) + return true + } + return false +} + +func (s *state) tryMethod(t reflect.Type, vx, vy reflect.Value) bool { + // Check if this type even has an Equal method. + m, ok := t.MethodByName("Equal") + if !ok || !function.IsType(m.Type, function.EqualAssignable) { + return false + } + + eq := s.callTTBFunc(m.Func, vx, vy) + s.report(eq, reportByMethod) + return true +} + +func (s *state) callTRFunc(f, v reflect.Value, step Transform) reflect.Value { + v = sanitizeValue(v, f.Type().In(0)) + if !s.dynChecker.Next() { + return f.Call([]reflect.Value{v})[0] + } + + // Run the function twice and ensure that we get the same results back. + // We run in goroutines so that the race detector (if enabled) can detect + // unsafe mutations to the input. + c := make(chan reflect.Value) + go detectRaces(c, f, v) + got := <-c + want := f.Call([]reflect.Value{v})[0] + if step.vx, step.vy = got, want; !s.statelessCompare(step).Equal() { + // To avoid false-positives with non-reflexive equality operations, + // we sanity check whether a value is equal to itself. + if step.vx, step.vy = want, want; !s.statelessCompare(step).Equal() { + return want + } + panic(fmt.Sprintf("non-deterministic function detected: %s", function.NameOf(f))) + } + return want +} + +func (s *state) callTTBFunc(f, x, y reflect.Value) bool { + x = sanitizeValue(x, f.Type().In(0)) + y = sanitizeValue(y, f.Type().In(1)) + if !s.dynChecker.Next() { + return f.Call([]reflect.Value{x, y})[0].Bool() + } + + // Swapping the input arguments is sufficient to check that + // f is symmetric and deterministic. + // We run in goroutines so that the race detector (if enabled) can detect + // unsafe mutations to the input. + c := make(chan reflect.Value) + go detectRaces(c, f, y, x) + got := <-c + want := f.Call([]reflect.Value{x, y})[0].Bool() + if !got.IsValid() || got.Bool() != want { + panic(fmt.Sprintf("non-deterministic or non-symmetric function detected: %s", function.NameOf(f))) + } + return want +} + +func detectRaces(c chan<- reflect.Value, f reflect.Value, vs ...reflect.Value) { + var ret reflect.Value + defer func() { + recover() // Ignore panics, let the other call to f panic instead + c <- ret + }() + ret = f.Call(vs)[0] +} + +// sanitizeValue converts nil interfaces of type T to those of type R, +// assuming that T is assignable to R. +// Otherwise, it returns the input value as is. +func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value { + // TODO(≥go1.10): Workaround for reflect bug (https://golang.org/issue/22143). + if !flags.AtLeastGo110 { + if v.Kind() == reflect.Interface && v.IsNil() && v.Type() != t { + return reflect.New(t).Elem() + } + } + return v +} + +func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { + var addr bool + var vax, vay reflect.Value // Addressable versions of vx and vy + + var mayForce, mayForceInit bool + step := StructField{&structField{}} + for i := 0; i < t.NumField(); i++ { + step.typ = t.Field(i).Type + step.vx = vx.Field(i) + step.vy = vy.Field(i) + step.name = t.Field(i).Name + step.idx = i + step.unexported = !isExported(step.name) + if step.unexported { + if step.name == "_" { + continue + } + // Defer checking of unexported fields until later to give an + // Ignore a chance to ignore the field. + if !vax.IsValid() || !vay.IsValid() { + // For retrieveUnexportedField to work, the parent struct must + // be addressable. Create a new copy of the values if + // necessary to make them addressable. + addr = vx.CanAddr() || vy.CanAddr() + vax = makeAddressable(vx) + vay = makeAddressable(vy) + } + if !mayForceInit { + for _, xf := range s.exporters { + mayForce = mayForce || xf(t) + } + mayForceInit = true + } + step.mayForce = mayForce + step.paddr = addr + step.pvx = vax + step.pvy = vay + step.field = t.Field(i) + } + s.compareAny(step) + } +} + +func (s *state) compareSlice(t reflect.Type, vx, vy reflect.Value) { + isSlice := t.Kind() == reflect.Slice + if isSlice && (vx.IsNil() || vy.IsNil()) { + s.report(vx.IsNil() && vy.IsNil(), 0) + return + } + + // NOTE: It is incorrect to call curPtrs.Push on the slice header pointer + // since slices represents a list of pointers, rather than a single pointer. + // The pointer checking logic must be handled on a per-element basis + // in compareAny. + // + // A slice header (see reflect.SliceHeader) in Go is a tuple of a starting + // pointer P, a length N, and a capacity C. Supposing each slice element has + // a memory size of M, then the slice is equivalent to the list of pointers: + // [P+i*M for i in range(N)] + // + // For example, v[:0] and v[:1] are slices with the same starting pointer, + // but they are clearly different values. Using the slice pointer alone + // violates the assumption that equal pointers implies equal values. + + step := SliceIndex{&sliceIndex{pathStep: pathStep{typ: t.Elem()}, isSlice: isSlice}} + withIndexes := func(ix, iy int) SliceIndex { + if ix >= 0 { + step.vx, step.xkey = vx.Index(ix), ix + } else { + step.vx, step.xkey = reflect.Value{}, -1 + } + if iy >= 0 { + step.vy, step.ykey = vy.Index(iy), iy + } else { + step.vy, step.ykey = reflect.Value{}, -1 + } + return step + } + + // Ignore options are able to ignore missing elements in a slice. + // However, detecting these reliably requires an optimal differencing + // algorithm, for which diff.Difference is not. + // + // Instead, we first iterate through both slices to detect which elements + // would be ignored if standing alone. The index of non-discarded elements + // are stored in a separate slice, which diffing is then performed on. + var indexesX, indexesY []int + var ignoredX, ignoredY []bool + for ix := 0; ix < vx.Len(); ix++ { + ignored := s.statelessCompare(withIndexes(ix, -1)).NumDiff == 0 + if !ignored { + indexesX = append(indexesX, ix) + } + ignoredX = append(ignoredX, ignored) + } + for iy := 0; iy < vy.Len(); iy++ { + ignored := s.statelessCompare(withIndexes(-1, iy)).NumDiff == 0 + if !ignored { + indexesY = append(indexesY, iy) + } + ignoredY = append(ignoredY, ignored) + } + + // Compute an edit-script for slices vx and vy (excluding ignored elements). + edits := diff.Difference(len(indexesX), len(indexesY), func(ix, iy int) diff.Result { + return s.statelessCompare(withIndexes(indexesX[ix], indexesY[iy])) + }) + + // Replay the ignore-scripts and the edit-script. + var ix, iy int + for ix < vx.Len() || iy < vy.Len() { + var e diff.EditType + switch { + case ix < len(ignoredX) && ignoredX[ix]: + e = diff.UniqueX + case iy < len(ignoredY) && ignoredY[iy]: + e = diff.UniqueY + default: + e, edits = edits[0], edits[1:] + } + switch e { + case diff.UniqueX: + s.compareAny(withIndexes(ix, -1)) + ix++ + case diff.UniqueY: + s.compareAny(withIndexes(-1, iy)) + iy++ + default: + s.compareAny(withIndexes(ix, iy)) + ix++ + iy++ + } + } +} + +func (s *state) compareMap(t reflect.Type, vx, vy reflect.Value) { + if vx.IsNil() || vy.IsNil() { + s.report(vx.IsNil() && vy.IsNil(), 0) + return + } + + // Cycle-detection for maps. + if eq, visited := s.curPtrs.Push(vx, vy); visited { + s.report(eq, reportByCycle) + return + } + defer s.curPtrs.Pop(vx, vy) + + // We combine and sort the two map keys so that we can perform the + // comparisons in a deterministic order. + step := MapIndex{&mapIndex{pathStep: pathStep{typ: t.Elem()}}} + for _, k := range value.SortKeys(append(vx.MapKeys(), vy.MapKeys()...)) { + step.vx = vx.MapIndex(k) + step.vy = vy.MapIndex(k) + step.key = k + if !step.vx.IsValid() && !step.vy.IsValid() { + // It is possible for both vx and vy to be invalid if the + // key contained a NaN value in it. + // + // Even with the ability to retrieve NaN keys in Go 1.12, + // there still isn't a sensible way to compare the values since + // a NaN key may map to multiple unordered values. + // The most reasonable way to compare NaNs would be to compare the + // set of values. However, this is impossible to do efficiently + // since set equality is provably an O(n^2) operation given only + // an Equal function. If we had a Less function or Hash function, + // this could be done in O(n*log(n)) or O(n), respectively. + // + // Rather than adding complex logic to deal with NaNs, make it + // the user's responsibility to compare such obscure maps. + const help = "consider providing a Comparer to compare the map" + panic(fmt.Sprintf("%#v has map key with NaNs\n%s", s.curPath, help)) + } + s.compareAny(step) + } +} + +func (s *state) comparePtr(t reflect.Type, vx, vy reflect.Value) { + if vx.IsNil() || vy.IsNil() { + s.report(vx.IsNil() && vy.IsNil(), 0) + return + } + + // Cycle-detection for pointers. + if eq, visited := s.curPtrs.Push(vx, vy); visited { + s.report(eq, reportByCycle) + return + } + defer s.curPtrs.Pop(vx, vy) + + vx, vy = vx.Elem(), vy.Elem() + s.compareAny(Indirect{&indirect{pathStep{t.Elem(), vx, vy}}}) +} + +func (s *state) compareInterface(t reflect.Type, vx, vy reflect.Value) { + if vx.IsNil() || vy.IsNil() { + s.report(vx.IsNil() && vy.IsNil(), 0) + return + } + vx, vy = vx.Elem(), vy.Elem() + if vx.Type() != vy.Type() { + s.report(false, 0) + return + } + s.compareAny(TypeAssertion{&typeAssertion{pathStep{vx.Type(), vx, vy}}}) +} + +func (s *state) report(eq bool, rf resultFlags) { + if rf&reportByIgnore == 0 { + if eq { + s.result.NumSame++ + rf |= reportEqual + } else { + s.result.NumDiff++ + rf |= reportUnequal + } + } + for _, r := range s.reporters { + r.Report(Result{flags: rf}) + } +} + +// recChecker tracks the state needed to periodically perform checks that +// user provided transformers are not stuck in an infinitely recursive cycle. +type recChecker struct{ next int } + +// Check scans the Path for any recursive transformers and panics when any +// recursive transformers are detected. Note that the presence of a +// recursive Transformer does not necessarily imply an infinite cycle. +// As such, this check only activates after some minimal number of path steps. +func (rc *recChecker) Check(p Path) { + const minLen = 1 << 16 + if rc.next == 0 { + rc.next = minLen + } + if len(p) < rc.next { + return + } + rc.next <<= 1 + + // Check whether the same transformer has appeared at least twice. + var ss []string + m := map[Option]int{} + for _, ps := range p { + if t, ok := ps.(Transform); ok { + t := t.Option() + if m[t] == 1 { // Transformer was used exactly once before + tf := t.(*transformer).fnc.Type() + ss = append(ss, fmt.Sprintf("%v: %v => %v", t, tf.In(0), tf.Out(0))) + } + m[t]++ + } + } + if len(ss) > 0 { + const warning = "recursive set of Transformers detected" + const help = "consider using cmpopts.AcyclicTransformer" + set := strings.Join(ss, "\n\t") + panic(fmt.Sprintf("%s:\n\t%s\n%s", warning, set, help)) + } +} + +// dynChecker tracks the state needed to periodically perform checks that +// user provided functions are symmetric and deterministic. +// The zero value is safe for immediate use. +type dynChecker struct{ curr, next int } + +// Next increments the state and reports whether a check should be performed. +// +// Checks occur every Nth function call, where N is a triangular number: +// 0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190 ... +// See https://en.wikipedia.org/wiki/Triangular_number +// +// This sequence ensures that the cost of checks drops significantly as +// the number of functions calls grows larger. +func (dc *dynChecker) Next() bool { + ok := dc.curr == dc.next + if ok { + dc.curr = 0 + dc.next++ + } + dc.curr++ + return ok +} + +// makeAddressable returns a value that is always addressable. +// It returns the input verbatim if it is already addressable, +// otherwise it creates a new value and returns an addressable copy. +func makeAddressable(v reflect.Value) reflect.Value { + if v.CanAddr() { + return v + } + vc := reflect.New(v.Type()).Elem() + vc.Set(v) + return vc +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/export_panic.go b/ibm/vendor/github.com/google/go-cmp/cmp/export_panic.go new file mode 100644 index 0000000000..5ff0b4218c --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/export_panic.go @@ -0,0 +1,15 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build purego + +package cmp + +import "reflect" + +const supportExporters = false + +func retrieveUnexportedField(reflect.Value, reflect.StructField, bool) reflect.Value { + panic("no support for forcibly accessing unexported fields") +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/ibm/vendor/github.com/google/go-cmp/cmp/export_unsafe.go new file mode 100644 index 0000000000..21eb54858e --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/export_unsafe.go @@ -0,0 +1,35 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !purego + +package cmp + +import ( + "reflect" + "unsafe" +) + +const supportExporters = true + +// retrieveUnexportedField uses unsafe to forcibly retrieve any field from +// a struct such that the value has read-write permissions. +// +// The parent struct, v, must be addressable, while f must be a StructField +// describing the field to retrieve. If addr is false, +// then the returned value will be shallowed copied to be non-addressable. +func retrieveUnexportedField(v reflect.Value, f reflect.StructField, addr bool) reflect.Value { + ve := reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() + if !addr { + // A field is addressable if and only if the struct is addressable. + // If the original parent value was not addressable, shallow copy the + // value to make it non-addressable to avoid leaking an implementation + // detail of how forcibly exporting a field works. + if ve.Kind() == reflect.Interface && ve.IsNil() { + return reflect.Zero(f.Type) + } + return reflect.ValueOf(ve.Interface()).Convert(f.Type) + } + return ve +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go new file mode 100644 index 0000000000..1daaaacc5e --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go @@ -0,0 +1,17 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !cmp_debug + +package diff + +var debug debugger + +type debugger struct{} + +func (debugger) Begin(_, _ int, f EqualFunc, _, _ *EditScript) EqualFunc { + return f +} +func (debugger) Update() {} +func (debugger) Finish() {} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go new file mode 100644 index 0000000000..4b91dbcaca --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go @@ -0,0 +1,122 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build cmp_debug + +package diff + +import ( + "fmt" + "strings" + "sync" + "time" +) + +// The algorithm can be seen running in real-time by enabling debugging: +// go test -tags=cmp_debug -v +// +// Example output: +// === RUN TestDifference/#34 +// ┌───────────────────────────────┐ +// │ \ · · · · · · · · · · · · · · │ +// │ · # · · · · · · · · · · · · · │ +// │ · \ · · · · · · · · · · · · · │ +// │ · · \ · · · · · · · · · · · · │ +// │ · · · X # · · · · · · · · · · │ +// │ · · · # \ · · · · · · · · · · │ +// │ · · · · · # # · · · · · · · · │ +// │ · · · · · # \ · · · · · · · · │ +// │ · · · · · · · \ · · · · · · · │ +// │ · · · · · · · · \ · · · · · · │ +// │ · · · · · · · · · \ · · · · · │ +// │ · · · · · · · · · · \ · · # · │ +// │ · · · · · · · · · · · \ # # · │ +// │ · · · · · · · · · · · # # # · │ +// │ · · · · · · · · · · # # # # · │ +// │ · · · · · · · · · # # # # # · │ +// │ · · · · · · · · · · · · · · \ │ +// └───────────────────────────────┘ +// [.Y..M.XY......YXYXY.|] +// +// The grid represents the edit-graph where the horizontal axis represents +// list X and the vertical axis represents list Y. The start of the two lists +// is the top-left, while the ends are the bottom-right. The '·' represents +// an unexplored node in the graph. The '\' indicates that the two symbols +// from list X and Y are equal. The 'X' indicates that two symbols are similar +// (but not exactly equal) to each other. The '#' indicates that the two symbols +// are different (and not similar). The algorithm traverses this graph trying to +// make the paths starting in the top-left and the bottom-right connect. +// +// The series of '.', 'X', 'Y', and 'M' characters at the bottom represents +// the currently established path from the forward and reverse searches, +// separated by a '|' character. + +const ( + updateDelay = 100 * time.Millisecond + finishDelay = 500 * time.Millisecond + ansiTerminal = true // ANSI escape codes used to move terminal cursor +) + +var debug debugger + +type debugger struct { + sync.Mutex + p1, p2 EditScript + fwdPath, revPath *EditScript + grid []byte + lines int +} + +func (dbg *debugger) Begin(nx, ny int, f EqualFunc, p1, p2 *EditScript) EqualFunc { + dbg.Lock() + dbg.fwdPath, dbg.revPath = p1, p2 + top := "┌─" + strings.Repeat("──", nx) + "┐\n" + row := "│ " + strings.Repeat("· ", nx) + "│\n" + btm := "└─" + strings.Repeat("──", nx) + "┘\n" + dbg.grid = []byte(top + strings.Repeat(row, ny) + btm) + dbg.lines = strings.Count(dbg.String(), "\n") + fmt.Print(dbg) + + // Wrap the EqualFunc so that we can intercept each result. + return func(ix, iy int) (r Result) { + cell := dbg.grid[len(top)+iy*len(row):][len("│ ")+len("· ")*ix:][:len("·")] + for i := range cell { + cell[i] = 0 // Zero out the multiple bytes of UTF-8 middle-dot + } + switch r = f(ix, iy); { + case r.Equal(): + cell[0] = '\\' + case r.Similar(): + cell[0] = 'X' + default: + cell[0] = '#' + } + return + } +} + +func (dbg *debugger) Update() { + dbg.print(updateDelay) +} + +func (dbg *debugger) Finish() { + dbg.print(finishDelay) + dbg.Unlock() +} + +func (dbg *debugger) String() string { + dbg.p1, dbg.p2 = *dbg.fwdPath, dbg.p2[:0] + for i := len(*dbg.revPath) - 1; i >= 0; i-- { + dbg.p2 = append(dbg.p2, (*dbg.revPath)[i]) + } + return fmt.Sprintf("%s[%v|%v]\n\n", dbg.grid, dbg.p1, dbg.p2) +} + +func (dbg *debugger) print(d time.Duration) { + if ansiTerminal { + fmt.Printf("\x1b[%dA", dbg.lines) // Reset terminal cursor + } + fmt.Print(dbg) + time.Sleep(d) +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go new file mode 100644 index 0000000000..bc196b16cf --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go @@ -0,0 +1,398 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package diff implements an algorithm for producing edit-scripts. +// The edit-script is a sequence of operations needed to transform one list +// of symbols into another (or vice-versa). The edits allowed are insertions, +// deletions, and modifications. The summation of all edits is called the +// Levenshtein distance as this problem is well-known in computer science. +// +// This package prioritizes performance over accuracy. That is, the run time +// is more important than obtaining a minimal Levenshtein distance. +package diff + +import ( + "math/rand" + "time" + + "github.com/google/go-cmp/cmp/internal/flags" +) + +// EditType represents a single operation within an edit-script. +type EditType uint8 + +const ( + // Identity indicates that a symbol pair is identical in both list X and Y. + Identity EditType = iota + // UniqueX indicates that a symbol only exists in X and not Y. + UniqueX + // UniqueY indicates that a symbol only exists in Y and not X. + UniqueY + // Modified indicates that a symbol pair is a modification of each other. + Modified +) + +// EditScript represents the series of differences between two lists. +type EditScript []EditType + +// String returns a human-readable string representing the edit-script where +// Identity, UniqueX, UniqueY, and Modified are represented by the +// '.', 'X', 'Y', and 'M' characters, respectively. +func (es EditScript) String() string { + b := make([]byte, len(es)) + for i, e := range es { + switch e { + case Identity: + b[i] = '.' + case UniqueX: + b[i] = 'X' + case UniqueY: + b[i] = 'Y' + case Modified: + b[i] = 'M' + default: + panic("invalid edit-type") + } + } + return string(b) +} + +// stats returns a histogram of the number of each type of edit operation. +func (es EditScript) stats() (s struct{ NI, NX, NY, NM int }) { + for _, e := range es { + switch e { + case Identity: + s.NI++ + case UniqueX: + s.NX++ + case UniqueY: + s.NY++ + case Modified: + s.NM++ + default: + panic("invalid edit-type") + } + } + return +} + +// Dist is the Levenshtein distance and is guaranteed to be 0 if and only if +// lists X and Y are equal. +func (es EditScript) Dist() int { return len(es) - es.stats().NI } + +// LenX is the length of the X list. +func (es EditScript) LenX() int { return len(es) - es.stats().NY } + +// LenY is the length of the Y list. +func (es EditScript) LenY() int { return len(es) - es.stats().NX } + +// EqualFunc reports whether the symbols at indexes ix and iy are equal. +// When called by Difference, the index is guaranteed to be within nx and ny. +type EqualFunc func(ix int, iy int) Result + +// Result is the result of comparison. +// NumSame is the number of sub-elements that are equal. +// NumDiff is the number of sub-elements that are not equal. +type Result struct{ NumSame, NumDiff int } + +// BoolResult returns a Result that is either Equal or not Equal. +func BoolResult(b bool) Result { + if b { + return Result{NumSame: 1} // Equal, Similar + } else { + return Result{NumDiff: 2} // Not Equal, not Similar + } +} + +// Equal indicates whether the symbols are equal. Two symbols are equal +// if and only if NumDiff == 0. If Equal, then they are also Similar. +func (r Result) Equal() bool { return r.NumDiff == 0 } + +// Similar indicates whether two symbols are similar and may be represented +// by using the Modified type. As a special case, we consider binary comparisons +// (i.e., those that return Result{1, 0} or Result{0, 1}) to be similar. +// +// The exact ratio of NumSame to NumDiff to determine similarity may change. +func (r Result) Similar() bool { + // Use NumSame+1 to offset NumSame so that binary comparisons are similar. + return r.NumSame+1 >= r.NumDiff +} + +var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 + +// Difference reports whether two lists of lengths nx and ny are equal +// given the definition of equality provided as f. +// +// This function returns an edit-script, which is a sequence of operations +// needed to convert one list into the other. The following invariants for +// the edit-script are maintained: +// • eq == (es.Dist()==0) +// • nx == es.LenX() +// • ny == es.LenY() +// +// This algorithm is not guaranteed to be an optimal solution (i.e., one that +// produces an edit-script with a minimal Levenshtein distance). This algorithm +// favors performance over optimality. The exact output is not guaranteed to +// be stable and may change over time. +func Difference(nx, ny int, f EqualFunc) (es EditScript) { + // This algorithm is based on traversing what is known as an "edit-graph". + // See Figure 1 from "An O(ND) Difference Algorithm and Its Variations" + // by Eugene W. Myers. Since D can be as large as N itself, this is + // effectively O(N^2). Unlike the algorithm from that paper, we are not + // interested in the optimal path, but at least some "decent" path. + // + // For example, let X and Y be lists of symbols: + // X = [A B C A B B A] + // Y = [C B A B A C] + // + // The edit-graph can be drawn as the following: + // A B C A B B A + // ┌─────────────┐ + // C │_|_|\|_|_|_|_│ 0 + // B │_|\|_|_|\|\|_│ 1 + // A │\|_|_|\|_|_|\│ 2 + // B │_|\|_|_|\|\|_│ 3 + // A │\|_|_|\|_|_|\│ 4 + // C │ | |\| | | | │ 5 + // └─────────────┘ 6 + // 0 1 2 3 4 5 6 7 + // + // List X is written along the horizontal axis, while list Y is written + // along the vertical axis. At any point on this grid, if the symbol in + // list X matches the corresponding symbol in list Y, then a '\' is drawn. + // The goal of any minimal edit-script algorithm is to find a path from the + // top-left corner to the bottom-right corner, while traveling through the + // fewest horizontal or vertical edges. + // A horizontal edge is equivalent to inserting a symbol from list X. + // A vertical edge is equivalent to inserting a symbol from list Y. + // A diagonal edge is equivalent to a matching symbol between both X and Y. + + // Invariants: + // • 0 ≤ fwdPath.X ≤ (fwdFrontier.X, revFrontier.X) ≤ revPath.X ≤ nx + // • 0 ≤ fwdPath.Y ≤ (fwdFrontier.Y, revFrontier.Y) ≤ revPath.Y ≤ ny + // + // In general: + // • fwdFrontier.X < revFrontier.X + // • fwdFrontier.Y < revFrontier.Y + // Unless, it is time for the algorithm to terminate. + fwdPath := path{+1, point{0, 0}, make(EditScript, 0, (nx+ny)/2)} + revPath := path{-1, point{nx, ny}, make(EditScript, 0)} + fwdFrontier := fwdPath.point // Forward search frontier + revFrontier := revPath.point // Reverse search frontier + + // Search budget bounds the cost of searching for better paths. + // The longest sequence of non-matching symbols that can be tolerated is + // approximately the square-root of the search budget. + searchBudget := 4 * (nx + ny) // O(n) + + // Running the tests with the "cmp_debug" build tag prints a visualization + // of the algorithm running in real-time. This is educational for + // understanding how the algorithm works. See debug_enable.go. + f = debug.Begin(nx, ny, f, &fwdPath.es, &revPath.es) + + // The algorithm below is a greedy, meet-in-the-middle algorithm for + // computing sub-optimal edit-scripts between two lists. + // + // The algorithm is approximately as follows: + // • Searching for differences switches back-and-forth between + // a search that starts at the beginning (the top-left corner), and + // a search that starts at the end (the bottom-right corner). The goal of + // the search is connect with the search from the opposite corner. + // • As we search, we build a path in a greedy manner, where the first + // match seen is added to the path (this is sub-optimal, but provides a + // decent result in practice). When matches are found, we try the next pair + // of symbols in the lists and follow all matches as far as possible. + // • When searching for matches, we search along a diagonal going through + // through the "frontier" point. If no matches are found, we advance the + // frontier towards the opposite corner. + // • This algorithm terminates when either the X coordinates or the + // Y coordinates of the forward and reverse frontier points ever intersect. + + // This algorithm is correct even if searching only in the forward direction + // or in the reverse direction. We do both because it is commonly observed + // that two lists commonly differ because elements were added to the front + // or end of the other list. + // + // Non-deterministically start with either the forward or reverse direction + // to introduce some deliberate instability so that we have the flexibility + // to change this algorithm in the future. + if flags.Deterministic || randBool { + goto forwardSearch + } else { + goto reverseSearch + } + +forwardSearch: + { + // Forward search from the beginning. + if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 { + goto finishSearch + } + for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ { + // Search in a diagonal pattern for a match. + z := zigzag(i) + p := point{fwdFrontier.X + z, fwdFrontier.Y - z} + switch { + case p.X >= revPath.X || p.Y < fwdPath.Y: + stop1 = true // Hit top-right corner + case p.Y >= revPath.Y || p.X < fwdPath.X: + stop2 = true // Hit bottom-left corner + case f(p.X, p.Y).Equal(): + // Match found, so connect the path to this point. + fwdPath.connect(p, f) + fwdPath.append(Identity) + // Follow sequence of matches as far as possible. + for fwdPath.X < revPath.X && fwdPath.Y < revPath.Y { + if !f(fwdPath.X, fwdPath.Y).Equal() { + break + } + fwdPath.append(Identity) + } + fwdFrontier = fwdPath.point + stop1, stop2 = true, true + default: + searchBudget-- // Match not found + } + debug.Update() + } + // Advance the frontier towards reverse point. + if revPath.X-fwdFrontier.X >= revPath.Y-fwdFrontier.Y { + fwdFrontier.X++ + } else { + fwdFrontier.Y++ + } + goto reverseSearch + } + +reverseSearch: + { + // Reverse search from the end. + if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 { + goto finishSearch + } + for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ { + // Search in a diagonal pattern for a match. + z := zigzag(i) + p := point{revFrontier.X - z, revFrontier.Y + z} + switch { + case fwdPath.X >= p.X || revPath.Y < p.Y: + stop1 = true // Hit bottom-left corner + case fwdPath.Y >= p.Y || revPath.X < p.X: + stop2 = true // Hit top-right corner + case f(p.X-1, p.Y-1).Equal(): + // Match found, so connect the path to this point. + revPath.connect(p, f) + revPath.append(Identity) + // Follow sequence of matches as far as possible. + for fwdPath.X < revPath.X && fwdPath.Y < revPath.Y { + if !f(revPath.X-1, revPath.Y-1).Equal() { + break + } + revPath.append(Identity) + } + revFrontier = revPath.point + stop1, stop2 = true, true + default: + searchBudget-- // Match not found + } + debug.Update() + } + // Advance the frontier towards forward point. + if revFrontier.X-fwdPath.X >= revFrontier.Y-fwdPath.Y { + revFrontier.X-- + } else { + revFrontier.Y-- + } + goto forwardSearch + } + +finishSearch: + // Join the forward and reverse paths and then append the reverse path. + fwdPath.connect(revPath.point, f) + for i := len(revPath.es) - 1; i >= 0; i-- { + t := revPath.es[i] + revPath.es = revPath.es[:i] + fwdPath.append(t) + } + debug.Finish() + return fwdPath.es +} + +type path struct { + dir int // +1 if forward, -1 if reverse + point // Leading point of the EditScript path + es EditScript +} + +// connect appends any necessary Identity, Modified, UniqueX, or UniqueY types +// to the edit-script to connect p.point to dst. +func (p *path) connect(dst point, f EqualFunc) { + if p.dir > 0 { + // Connect in forward direction. + for dst.X > p.X && dst.Y > p.Y { + switch r := f(p.X, p.Y); { + case r.Equal(): + p.append(Identity) + case r.Similar(): + p.append(Modified) + case dst.X-p.X >= dst.Y-p.Y: + p.append(UniqueX) + default: + p.append(UniqueY) + } + } + for dst.X > p.X { + p.append(UniqueX) + } + for dst.Y > p.Y { + p.append(UniqueY) + } + } else { + // Connect in reverse direction. + for p.X > dst.X && p.Y > dst.Y { + switch r := f(p.X-1, p.Y-1); { + case r.Equal(): + p.append(Identity) + case r.Similar(): + p.append(Modified) + case p.Y-dst.Y >= p.X-dst.X: + p.append(UniqueY) + default: + p.append(UniqueX) + } + } + for p.X > dst.X { + p.append(UniqueX) + } + for p.Y > dst.Y { + p.append(UniqueY) + } + } +} + +func (p *path) append(t EditType) { + p.es = append(p.es, t) + switch t { + case Identity, Modified: + p.add(p.dir, p.dir) + case UniqueX: + p.add(p.dir, 0) + case UniqueY: + p.add(0, p.dir) + } + debug.Update() +} + +type point struct{ X, Y int } + +func (p *point) add(dx, dy int) { p.X += dx; p.Y += dy } + +// zigzag maps a consecutive sequence of integers to a zig-zag sequence. +// [0 1 2 3 4 5 ...] => [0 -1 +1 -2 +2 ...] +func zigzag(x int) int { + if x&1 != 0 { + x = ^x + } + return x >> 1 +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go new file mode 100644 index 0000000000..d8e459c9b9 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go @@ -0,0 +1,9 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flags + +// Deterministic controls whether the output of Diff should be deterministic. +// This is only used for testing. +var Deterministic bool diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go new file mode 100644 index 0000000000..82d1d7fbf8 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go @@ -0,0 +1,10 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.10 + +package flags + +// AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. +const AtLeastGo110 = false diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go new file mode 100644 index 0000000000..8646f05293 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go @@ -0,0 +1,10 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.10 + +package flags + +// AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. +const AtLeastGo110 = true diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/function/func.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/function/func.go new file mode 100644 index 0000000000..d127d43623 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/function/func.go @@ -0,0 +1,99 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package function provides functionality for identifying function types. +package function + +import ( + "reflect" + "regexp" + "runtime" + "strings" +) + +type funcType int + +const ( + _ funcType = iota + + tbFunc // func(T) bool + ttbFunc // func(T, T) bool + trbFunc // func(T, R) bool + tibFunc // func(T, I) bool + trFunc // func(T) R + + Equal = ttbFunc // func(T, T) bool + EqualAssignable = tibFunc // func(T, I) bool; encapsulates func(T, T) bool + Transformer = trFunc // func(T) R + ValueFilter = ttbFunc // func(T, T) bool + Less = ttbFunc // func(T, T) bool + ValuePredicate = tbFunc // func(T) bool + KeyValuePredicate = trbFunc // func(T, R) bool +) + +var boolType = reflect.TypeOf(true) + +// IsType reports whether the reflect.Type is of the specified function type. +func IsType(t reflect.Type, ft funcType) bool { + if t == nil || t.Kind() != reflect.Func || t.IsVariadic() { + return false + } + ni, no := t.NumIn(), t.NumOut() + switch ft { + case tbFunc: // func(T) bool + if ni == 1 && no == 1 && t.Out(0) == boolType { + return true + } + case ttbFunc: // func(T, T) bool + if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == boolType { + return true + } + case trbFunc: // func(T, R) bool + if ni == 2 && no == 1 && t.Out(0) == boolType { + return true + } + case tibFunc: // func(T, I) bool + if ni == 2 && no == 1 && t.In(0).AssignableTo(t.In(1)) && t.Out(0) == boolType { + return true + } + case trFunc: // func(T) R + if ni == 1 && no == 1 { + return true + } + } + return false +} + +var lastIdentRx = regexp.MustCompile(`[_\p{L}][_\p{L}\p{N}]*$`) + +// NameOf returns the name of the function value. +func NameOf(v reflect.Value) string { + fnc := runtime.FuncForPC(v.Pointer()) + if fnc == nil { + return "" + } + fullName := fnc.Name() // e.g., "long/path/name/mypkg.(*MyType).(long/path/name/mypkg.myMethod)-fm" + + // Method closures have a "-fm" suffix. + fullName = strings.TrimSuffix(fullName, "-fm") + + var name string + for len(fullName) > 0 { + inParen := strings.HasSuffix(fullName, ")") + fullName = strings.TrimSuffix(fullName, ")") + + s := lastIdentRx.FindString(fullName) + if s == "" { + break + } + name = s + "." + name + fullName = strings.TrimSuffix(fullName, s) + + if i := strings.LastIndexByte(fullName, '('); inParen && i >= 0 { + fullName = fullName[:i] + } + fullName = strings.TrimSuffix(fullName, ".") + } + return strings.TrimSuffix(name, ".") +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/name.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/name.go new file mode 100644 index 0000000000..b6c12cefb4 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/name.go @@ -0,0 +1,157 @@ +// Copyright 2020, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package value + +import ( + "reflect" + "strconv" +) + +// TypeString is nearly identical to reflect.Type.String, +// but has an additional option to specify that full type names be used. +func TypeString(t reflect.Type, qualified bool) string { + return string(appendTypeName(nil, t, qualified, false)) +} + +func appendTypeName(b []byte, t reflect.Type, qualified, elideFunc bool) []byte { + // BUG: Go reflection provides no way to disambiguate two named types + // of the same name and within the same package, + // but declared within the namespace of different functions. + + // Named type. + if t.Name() != "" { + if qualified && t.PkgPath() != "" { + b = append(b, '"') + b = append(b, t.PkgPath()...) + b = append(b, '"') + b = append(b, '.') + b = append(b, t.Name()...) + } else { + b = append(b, t.String()...) + } + return b + } + + // Unnamed type. + switch k := t.Kind(); k { + case reflect.Bool, reflect.String, reflect.UnsafePointer, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, + reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: + b = append(b, k.String()...) + case reflect.Chan: + if t.ChanDir() == reflect.RecvDir { + b = append(b, "<-"...) + } + b = append(b, "chan"...) + if t.ChanDir() == reflect.SendDir { + b = append(b, "<-"...) + } + b = append(b, ' ') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Func: + if !elideFunc { + b = append(b, "func"...) + } + b = append(b, '(') + for i := 0; i < t.NumIn(); i++ { + if i > 0 { + b = append(b, ", "...) + } + if i == t.NumIn()-1 && t.IsVariadic() { + b = append(b, "..."...) + b = appendTypeName(b, t.In(i).Elem(), qualified, false) + } else { + b = appendTypeName(b, t.In(i), qualified, false) + } + } + b = append(b, ')') + switch t.NumOut() { + case 0: + // Do nothing + case 1: + b = append(b, ' ') + b = appendTypeName(b, t.Out(0), qualified, false) + default: + b = append(b, " ("...) + for i := 0; i < t.NumOut(); i++ { + if i > 0 { + b = append(b, ", "...) + } + b = appendTypeName(b, t.Out(i), qualified, false) + } + b = append(b, ')') + } + case reflect.Struct: + b = append(b, "struct{ "...) + for i := 0; i < t.NumField(); i++ { + if i > 0 { + b = append(b, "; "...) + } + sf := t.Field(i) + if !sf.Anonymous { + if qualified && sf.PkgPath != "" { + b = append(b, '"') + b = append(b, sf.PkgPath...) + b = append(b, '"') + b = append(b, '.') + } + b = append(b, sf.Name...) + b = append(b, ' ') + } + b = appendTypeName(b, sf.Type, qualified, false) + if sf.Tag != "" { + b = append(b, ' ') + b = strconv.AppendQuote(b, string(sf.Tag)) + } + } + if b[len(b)-1] == ' ' { + b = b[:len(b)-1] + } else { + b = append(b, ' ') + } + b = append(b, '}') + case reflect.Slice, reflect.Array: + b = append(b, '[') + if k == reflect.Array { + b = strconv.AppendUint(b, uint64(t.Len()), 10) + } + b = append(b, ']') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Map: + b = append(b, "map["...) + b = appendTypeName(b, t.Key(), qualified, false) + b = append(b, ']') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Ptr: + b = append(b, '*') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Interface: + b = append(b, "interface{ "...) + for i := 0; i < t.NumMethod(); i++ { + if i > 0 { + b = append(b, "; "...) + } + m := t.Method(i) + if qualified && m.PkgPath != "" { + b = append(b, '"') + b = append(b, m.PkgPath...) + b = append(b, '"') + b = append(b, '.') + } + b = append(b, m.Name...) + b = appendTypeName(b, m.Type, qualified, true) + } + if b[len(b)-1] == ' ' { + b = b[:len(b)-1] + } else { + b = append(b, ' ') + } + b = append(b, '}') + default: + panic("invalid kind: " + k.String()) + } + return b +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go new file mode 100644 index 0000000000..44f4a5afdd --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go @@ -0,0 +1,33 @@ +// Copyright 2018, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build purego + +package value + +import "reflect" + +// Pointer is an opaque typed pointer and is guaranteed to be comparable. +type Pointer struct { + p uintptr + t reflect.Type +} + +// PointerOf returns a Pointer from v, which must be a +// reflect.Ptr, reflect.Slice, or reflect.Map. +func PointerOf(v reflect.Value) Pointer { + // NOTE: Storing a pointer as an uintptr is technically incorrect as it + // assumes that the GC implementation does not use a moving collector. + return Pointer{v.Pointer(), v.Type()} +} + +// IsNil reports whether the pointer is nil. +func (p Pointer) IsNil() bool { + return p.p == 0 +} + +// Uintptr returns the pointer as a uintptr. +func (p Pointer) Uintptr() uintptr { + return p.p +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go new file mode 100644 index 0000000000..a605953d46 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go @@ -0,0 +1,36 @@ +// Copyright 2018, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !purego + +package value + +import ( + "reflect" + "unsafe" +) + +// Pointer is an opaque typed pointer and is guaranteed to be comparable. +type Pointer struct { + p unsafe.Pointer + t reflect.Type +} + +// PointerOf returns a Pointer from v, which must be a +// reflect.Ptr, reflect.Slice, or reflect.Map. +func PointerOf(v reflect.Value) Pointer { + // The proper representation of a pointer is unsafe.Pointer, + // which is necessary if the GC ever uses a moving collector. + return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} +} + +// IsNil reports whether the pointer is nil. +func (p Pointer) IsNil() bool { + return p.p == nil +} + +// Uintptr returns the pointer as a uintptr. +func (p Pointer) Uintptr() uintptr { + return uintptr(p.p) +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go new file mode 100644 index 0000000000..98533b036c --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go @@ -0,0 +1,106 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package value + +import ( + "fmt" + "math" + "reflect" + "sort" +) + +// SortKeys sorts a list of map keys, deduplicating keys if necessary. +// The type of each value must be comparable. +func SortKeys(vs []reflect.Value) []reflect.Value { + if len(vs) == 0 { + return vs + } + + // Sort the map keys. + sort.SliceStable(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) + + // Deduplicate keys (fails for NaNs). + vs2 := vs[:1] + for _, v := range vs[1:] { + if isLess(vs2[len(vs2)-1], v) { + vs2 = append(vs2, v) + } + } + return vs2 +} + +// isLess is a generic function for sorting arbitrary map keys. +// The inputs must be of the same type and must be comparable. +func isLess(x, y reflect.Value) bool { + switch x.Type().Kind() { + case reflect.Bool: + return !x.Bool() && y.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return x.Int() < y.Int() + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return x.Uint() < y.Uint() + case reflect.Float32, reflect.Float64: + // NOTE: This does not sort -0 as less than +0 + // since Go maps treat -0 and +0 as equal keys. + fx, fy := x.Float(), y.Float() + return fx < fy || math.IsNaN(fx) && !math.IsNaN(fy) + case reflect.Complex64, reflect.Complex128: + cx, cy := x.Complex(), y.Complex() + rx, ix, ry, iy := real(cx), imag(cx), real(cy), imag(cy) + if rx == ry || (math.IsNaN(rx) && math.IsNaN(ry)) { + return ix < iy || math.IsNaN(ix) && !math.IsNaN(iy) + } + return rx < ry || math.IsNaN(rx) && !math.IsNaN(ry) + case reflect.Ptr, reflect.UnsafePointer, reflect.Chan: + return x.Pointer() < y.Pointer() + case reflect.String: + return x.String() < y.String() + case reflect.Array: + for i := 0; i < x.Len(); i++ { + if isLess(x.Index(i), y.Index(i)) { + return true + } + if isLess(y.Index(i), x.Index(i)) { + return false + } + } + return false + case reflect.Struct: + for i := 0; i < x.NumField(); i++ { + if isLess(x.Field(i), y.Field(i)) { + return true + } + if isLess(y.Field(i), x.Field(i)) { + return false + } + } + return false + case reflect.Interface: + vx, vy := x.Elem(), y.Elem() + if !vx.IsValid() || !vy.IsValid() { + return !vx.IsValid() && vy.IsValid() + } + tx, ty := vx.Type(), vy.Type() + if tx == ty { + return isLess(x.Elem(), y.Elem()) + } + if tx.Kind() != ty.Kind() { + return vx.Kind() < vy.Kind() + } + if tx.String() != ty.String() { + return tx.String() < ty.String() + } + if tx.PkgPath() != ty.PkgPath() { + return tx.PkgPath() < ty.PkgPath() + } + // This can happen in rare situations, so we fallback to just comparing + // the unique pointer for a reflect.Type. This guarantees deterministic + // ordering within a program, but it is obviously not stable. + return reflect.ValueOf(vx.Type()).Pointer() < reflect.ValueOf(vy.Type()).Pointer() + default: + // Must be Func, Map, or Slice; which are not comparable. + panic(fmt.Sprintf("%T is not comparable", x.Type())) + } +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go new file mode 100644 index 0000000000..9147a29973 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go @@ -0,0 +1,48 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package value + +import ( + "math" + "reflect" +) + +// IsZero reports whether v is the zero value. +// This does not rely on Interface and so can be used on unexported fields. +func IsZero(v reflect.Value) bool { + switch v.Kind() { + case reflect.Bool: + return v.Bool() == false + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return math.Float64bits(v.Float()) == 0 + case reflect.Complex64, reflect.Complex128: + return math.Float64bits(real(v.Complex())) == 0 && math.Float64bits(imag(v.Complex())) == 0 + case reflect.String: + return v.String() == "" + case reflect.UnsafePointer: + return v.Pointer() == 0 + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: + return v.IsNil() + case reflect.Array: + for i := 0; i < v.Len(); i++ { + if !IsZero(v.Index(i)) { + return false + } + } + return true + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + if !IsZero(v.Field(i)) { + return false + } + } + return true + } + return false +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/options.go b/ibm/vendor/github.com/google/go-cmp/cmp/options.go new file mode 100644 index 0000000000..e57b9eb539 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/options.go @@ -0,0 +1,552 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "fmt" + "reflect" + "regexp" + "strings" + + "github.com/google/go-cmp/cmp/internal/function" +) + +// Option configures for specific behavior of Equal and Diff. In particular, +// the fundamental Option functions (Ignore, Transformer, and Comparer), +// configure how equality is determined. +// +// The fundamental options may be composed with filters (FilterPath and +// FilterValues) to control the scope over which they are applied. +// +// The cmp/cmpopts package provides helper functions for creating options that +// may be used with Equal and Diff. +type Option interface { + // filter applies all filters and returns the option that remains. + // Each option may only read s.curPath and call s.callTTBFunc. + // + // An Options is returned only if multiple comparers or transformers + // can apply simultaneously and will only contain values of those types + // or sub-Options containing values of those types. + filter(s *state, t reflect.Type, vx, vy reflect.Value) applicableOption +} + +// applicableOption represents the following types: +// Fundamental: ignore | validator | *comparer | *transformer +// Grouping: Options +type applicableOption interface { + Option + + // apply executes the option, which may mutate s or panic. + apply(s *state, vx, vy reflect.Value) +} + +// coreOption represents the following types: +// Fundamental: ignore | validator | *comparer | *transformer +// Filters: *pathFilter | *valuesFilter +type coreOption interface { + Option + isCore() +} + +type core struct{} + +func (core) isCore() {} + +// Options is a list of Option values that also satisfies the Option interface. +// Helper comparison packages may return an Options value when packing multiple +// Option values into a single Option. When this package processes an Options, +// it will be implicitly expanded into a flat list. +// +// Applying a filter on an Options is equivalent to applying that same filter +// on all individual options held within. +type Options []Option + +func (opts Options) filter(s *state, t reflect.Type, vx, vy reflect.Value) (out applicableOption) { + for _, opt := range opts { + switch opt := opt.filter(s, t, vx, vy); opt.(type) { + case ignore: + return ignore{} // Only ignore can short-circuit evaluation + case validator: + out = validator{} // Takes precedence over comparer or transformer + case *comparer, *transformer, Options: + switch out.(type) { + case nil: + out = opt + case validator: + // Keep validator + case *comparer, *transformer, Options: + out = Options{out, opt} // Conflicting comparers or transformers + } + } + } + return out +} + +func (opts Options) apply(s *state, _, _ reflect.Value) { + const warning = "ambiguous set of applicable options" + const help = "consider using filters to ensure at most one Comparer or Transformer may apply" + var ss []string + for _, opt := range flattenOptions(nil, opts) { + ss = append(ss, fmt.Sprint(opt)) + } + set := strings.Join(ss, "\n\t") + panic(fmt.Sprintf("%s at %#v:\n\t%s\n%s", warning, s.curPath, set, help)) +} + +func (opts Options) String() string { + var ss []string + for _, opt := range opts { + ss = append(ss, fmt.Sprint(opt)) + } + return fmt.Sprintf("Options{%s}", strings.Join(ss, ", ")) +} + +// FilterPath returns a new Option where opt is only evaluated if filter f +// returns true for the current Path in the value tree. +// +// This filter is called even if a slice element or map entry is missing and +// provides an opportunity to ignore such cases. The filter function must be +// symmetric such that the filter result is identical regardless of whether the +// missing value is from x or y. +// +// The option passed in may be an Ignore, Transformer, Comparer, Options, or +// a previously filtered Option. +func FilterPath(f func(Path) bool, opt Option) Option { + if f == nil { + panic("invalid path filter function") + } + if opt := normalizeOption(opt); opt != nil { + return &pathFilter{fnc: f, opt: opt} + } + return nil +} + +type pathFilter struct { + core + fnc func(Path) bool + opt Option +} + +func (f pathFilter) filter(s *state, t reflect.Type, vx, vy reflect.Value) applicableOption { + if f.fnc(s.curPath) { + return f.opt.filter(s, t, vx, vy) + } + return nil +} + +func (f pathFilter) String() string { + return fmt.Sprintf("FilterPath(%s, %v)", function.NameOf(reflect.ValueOf(f.fnc)), f.opt) +} + +// FilterValues returns a new Option where opt is only evaluated if filter f, +// which is a function of the form "func(T, T) bool", returns true for the +// current pair of values being compared. If either value is invalid or +// the type of the values is not assignable to T, then this filter implicitly +// returns false. +// +// The filter function must be +// symmetric (i.e., agnostic to the order of the inputs) and +// deterministic (i.e., produces the same result when given the same inputs). +// If T is an interface, it is possible that f is called with two values with +// different concrete types that both implement T. +// +// The option passed in may be an Ignore, Transformer, Comparer, Options, or +// a previously filtered Option. +func FilterValues(f interface{}, opt Option) Option { + v := reflect.ValueOf(f) + if !function.IsType(v.Type(), function.ValueFilter) || v.IsNil() { + panic(fmt.Sprintf("invalid values filter function: %T", f)) + } + if opt := normalizeOption(opt); opt != nil { + vf := &valuesFilter{fnc: v, opt: opt} + if ti := v.Type().In(0); ti.Kind() != reflect.Interface || ti.NumMethod() > 0 { + vf.typ = ti + } + return vf + } + return nil +} + +type valuesFilter struct { + core + typ reflect.Type // T + fnc reflect.Value // func(T, T) bool + opt Option +} + +func (f valuesFilter) filter(s *state, t reflect.Type, vx, vy reflect.Value) applicableOption { + if !vx.IsValid() || !vx.CanInterface() || !vy.IsValid() || !vy.CanInterface() { + return nil + } + if (f.typ == nil || t.AssignableTo(f.typ)) && s.callTTBFunc(f.fnc, vx, vy) { + return f.opt.filter(s, t, vx, vy) + } + return nil +} + +func (f valuesFilter) String() string { + return fmt.Sprintf("FilterValues(%s, %v)", function.NameOf(f.fnc), f.opt) +} + +// Ignore is an Option that causes all comparisons to be ignored. +// This value is intended to be combined with FilterPath or FilterValues. +// It is an error to pass an unfiltered Ignore option to Equal. +func Ignore() Option { return ignore{} } + +type ignore struct{ core } + +func (ignore) isFiltered() bool { return false } +func (ignore) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableOption { return ignore{} } +func (ignore) apply(s *state, _, _ reflect.Value) { s.report(true, reportByIgnore) } +func (ignore) String() string { return "Ignore()" } + +// validator is a sentinel Option type to indicate that some options could not +// be evaluated due to unexported fields, missing slice elements, or +// missing map entries. Both values are validator only for unexported fields. +type validator struct{ core } + +func (validator) filter(_ *state, _ reflect.Type, vx, vy reflect.Value) applicableOption { + if !vx.IsValid() || !vy.IsValid() { + return validator{} + } + if !vx.CanInterface() || !vy.CanInterface() { + return validator{} + } + return nil +} +func (validator) apply(s *state, vx, vy reflect.Value) { + // Implies missing slice element or map entry. + if !vx.IsValid() || !vy.IsValid() { + s.report(vx.IsValid() == vy.IsValid(), 0) + return + } + + // Unable to Interface implies unexported field without visibility access. + if !vx.CanInterface() || !vy.CanInterface() { + help := "consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported" + var name string + if t := s.curPath.Index(-2).Type(); t.Name() != "" { + // Named type with unexported fields. + name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType + if _, ok := reflect.New(t).Interface().(error); ok { + help = "consider using cmpopts.EquateErrors to compare error values" + } + } else { + // Unnamed type with unexported fields. Derive PkgPath from field. + var pkgPath string + for i := 0; i < t.NumField() && pkgPath == ""; i++ { + pkgPath = t.Field(i).PkgPath + } + name = fmt.Sprintf("%q.(%v)", pkgPath, t.String()) // e.g., "path/to/package".(struct { a int }) + } + panic(fmt.Sprintf("cannot handle unexported field at %#v:\n\t%v\n%s", s.curPath, name, help)) + } + + panic("not reachable") +} + +// identRx represents a valid identifier according to the Go specification. +const identRx = `[_\p{L}][_\p{L}\p{N}]*` + +var identsRx = regexp.MustCompile(`^` + identRx + `(\.` + identRx + `)*$`) + +// Transformer returns an Option that applies a transformation function that +// converts values of a certain type into that of another. +// +// The transformer f must be a function "func(T) R" that converts values of +// type T to those of type R and is implicitly filtered to input values +// assignable to T. The transformer must not mutate T in any way. +// +// To help prevent some cases of infinite recursive cycles applying the +// same transform to the output of itself (e.g., in the case where the +// input and output types are the same), an implicit filter is added such that +// a transformer is applicable only if that exact transformer is not already +// in the tail of the Path since the last non-Transform step. +// For situations where the implicit filter is still insufficient, +// consider using cmpopts.AcyclicTransformer, which adds a filter +// to prevent the transformer from being recursively applied upon itself. +// +// The name is a user provided label that is used as the Transform.Name in the +// transformation PathStep (and eventually shown in the Diff output). +// The name must be a valid identifier or qualified identifier in Go syntax. +// If empty, an arbitrary name is used. +func Transformer(name string, f interface{}) Option { + v := reflect.ValueOf(f) + if !function.IsType(v.Type(), function.Transformer) || v.IsNil() { + panic(fmt.Sprintf("invalid transformer function: %T", f)) + } + if name == "" { + name = function.NameOf(v) + if !identsRx.MatchString(name) { + name = "λ" // Lambda-symbol as placeholder name + } + } else if !identsRx.MatchString(name) { + panic(fmt.Sprintf("invalid name: %q", name)) + } + tr := &transformer{name: name, fnc: reflect.ValueOf(f)} + if ti := v.Type().In(0); ti.Kind() != reflect.Interface || ti.NumMethod() > 0 { + tr.typ = ti + } + return tr +} + +type transformer struct { + core + name string + typ reflect.Type // T + fnc reflect.Value // func(T) R +} + +func (tr *transformer) isFiltered() bool { return tr.typ != nil } + +func (tr *transformer) filter(s *state, t reflect.Type, _, _ reflect.Value) applicableOption { + for i := len(s.curPath) - 1; i >= 0; i-- { + if t, ok := s.curPath[i].(Transform); !ok { + break // Hit most recent non-Transform step + } else if tr == t.trans { + return nil // Cannot directly use same Transform + } + } + if tr.typ == nil || t.AssignableTo(tr.typ) { + return tr + } + return nil +} + +func (tr *transformer) apply(s *state, vx, vy reflect.Value) { + step := Transform{&transform{pathStep{typ: tr.fnc.Type().Out(0)}, tr}} + vvx := s.callTRFunc(tr.fnc, vx, step) + vvy := s.callTRFunc(tr.fnc, vy, step) + step.vx, step.vy = vvx, vvy + s.compareAny(step) +} + +func (tr transformer) String() string { + return fmt.Sprintf("Transformer(%s, %s)", tr.name, function.NameOf(tr.fnc)) +} + +// Comparer returns an Option that determines whether two values are equal +// to each other. +// +// The comparer f must be a function "func(T, T) bool" and is implicitly +// filtered to input values assignable to T. If T is an interface, it is +// possible that f is called with two values of different concrete types that +// both implement T. +// +// The equality function must be: +// • Symmetric: equal(x, y) == equal(y, x) +// • Deterministic: equal(x, y) == equal(x, y) +// • Pure: equal(x, y) does not modify x or y +func Comparer(f interface{}) Option { + v := reflect.ValueOf(f) + if !function.IsType(v.Type(), function.Equal) || v.IsNil() { + panic(fmt.Sprintf("invalid comparer function: %T", f)) + } + cm := &comparer{fnc: v} + if ti := v.Type().In(0); ti.Kind() != reflect.Interface || ti.NumMethod() > 0 { + cm.typ = ti + } + return cm +} + +type comparer struct { + core + typ reflect.Type // T + fnc reflect.Value // func(T, T) bool +} + +func (cm *comparer) isFiltered() bool { return cm.typ != nil } + +func (cm *comparer) filter(_ *state, t reflect.Type, _, _ reflect.Value) applicableOption { + if cm.typ == nil || t.AssignableTo(cm.typ) { + return cm + } + return nil +} + +func (cm *comparer) apply(s *state, vx, vy reflect.Value) { + eq := s.callTTBFunc(cm.fnc, vx, vy) + s.report(eq, reportByFunc) +} + +func (cm comparer) String() string { + return fmt.Sprintf("Comparer(%s)", function.NameOf(cm.fnc)) +} + +// Exporter returns an Option that specifies whether Equal is allowed to +// introspect into the unexported fields of certain struct types. +// +// Users of this option must understand that comparing on unexported fields +// from external packages is not safe since changes in the internal +// implementation of some external package may cause the result of Equal +// to unexpectedly change. However, it may be valid to use this option on types +// defined in an internal package where the semantic meaning of an unexported +// field is in the control of the user. +// +// In many cases, a custom Comparer should be used instead that defines +// equality as a function of the public API of a type rather than the underlying +// unexported implementation. +// +// For example, the reflect.Type documentation defines equality to be determined +// by the == operator on the interface (essentially performing a shallow pointer +// comparison) and most attempts to compare *regexp.Regexp types are interested +// in only checking that the regular expression strings are equal. +// Both of these are accomplished using Comparers: +// +// Comparer(func(x, y reflect.Type) bool { return x == y }) +// Comparer(func(x, y *regexp.Regexp) bool { return x.String() == y.String() }) +// +// In other cases, the cmpopts.IgnoreUnexported option can be used to ignore +// all unexported fields on specified struct types. +func Exporter(f func(reflect.Type) bool) Option { + if !supportExporters { + panic("Exporter is not supported on purego builds") + } + return exporter(f) +} + +type exporter func(reflect.Type) bool + +func (exporter) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableOption { + panic("not implemented") +} + +// AllowUnexported returns an Options that allows Equal to forcibly introspect +// unexported fields of the specified struct types. +// +// See Exporter for the proper use of this option. +func AllowUnexported(types ...interface{}) Option { + m := make(map[reflect.Type]bool) + for _, typ := range types { + t := reflect.TypeOf(typ) + if t.Kind() != reflect.Struct { + panic(fmt.Sprintf("invalid struct type: %T", typ)) + } + m[t] = true + } + return exporter(func(t reflect.Type) bool { return m[t] }) +} + +// Result represents the comparison result for a single node and +// is provided by cmp when calling Result (see Reporter). +type Result struct { + _ [0]func() // Make Result incomparable + flags resultFlags +} + +// Equal reports whether the node was determined to be equal or not. +// As a special case, ignored nodes are considered equal. +func (r Result) Equal() bool { + return r.flags&(reportEqual|reportByIgnore) != 0 +} + +// ByIgnore reports whether the node is equal because it was ignored. +// This never reports true if Equal reports false. +func (r Result) ByIgnore() bool { + return r.flags&reportByIgnore != 0 +} + +// ByMethod reports whether the Equal method determined equality. +func (r Result) ByMethod() bool { + return r.flags&reportByMethod != 0 +} + +// ByFunc reports whether a Comparer function determined equality. +func (r Result) ByFunc() bool { + return r.flags&reportByFunc != 0 +} + +// ByCycle reports whether a reference cycle was detected. +func (r Result) ByCycle() bool { + return r.flags&reportByCycle != 0 +} + +type resultFlags uint + +const ( + _ resultFlags = (1 << iota) / 2 + + reportEqual + reportUnequal + reportByIgnore + reportByMethod + reportByFunc + reportByCycle +) + +// Reporter is an Option that can be passed to Equal. When Equal traverses +// the value trees, it calls PushStep as it descends into each node in the +// tree and PopStep as it ascend out of the node. The leaves of the tree are +// either compared (determined to be equal or not equal) or ignored and reported +// as such by calling the Report method. +func Reporter(r interface { + // PushStep is called when a tree-traversal operation is performed. + // The PathStep itself is only valid until the step is popped. + // The PathStep.Values are valid for the duration of the entire traversal + // and must not be mutated. + // + // Equal always calls PushStep at the start to provide an operation-less + // PathStep used to report the root values. + // + // Within a slice, the exact set of inserted, removed, or modified elements + // is unspecified and may change in future implementations. + // The entries of a map are iterated through in an unspecified order. + PushStep(PathStep) + + // Report is called exactly once on leaf nodes to report whether the + // comparison identified the node as equal, unequal, or ignored. + // A leaf node is one that is immediately preceded by and followed by + // a pair of PushStep and PopStep calls. + Report(Result) + + // PopStep ascends back up the value tree. + // There is always a matching pop call for every push call. + PopStep() +}) Option { + return reporter{r} +} + +type reporter struct{ reporterIface } +type reporterIface interface { + PushStep(PathStep) + Report(Result) + PopStep() +} + +func (reporter) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableOption { + panic("not implemented") +} + +// normalizeOption normalizes the input options such that all Options groups +// are flattened and groups with a single element are reduced to that element. +// Only coreOptions and Options containing coreOptions are allowed. +func normalizeOption(src Option) Option { + switch opts := flattenOptions(nil, Options{src}); len(opts) { + case 0: + return nil + case 1: + return opts[0] + default: + return opts + } +} + +// flattenOptions copies all options in src to dst as a flat list. +// Only coreOptions and Options containing coreOptions are allowed. +func flattenOptions(dst, src Options) Options { + for _, opt := range src { + switch opt := opt.(type) { + case nil: + continue + case Options: + dst = flattenOptions(dst, opt) + case coreOption: + dst = append(dst, opt) + default: + panic(fmt.Sprintf("invalid option type: %T", opt)) + } + } + return dst +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/path.go b/ibm/vendor/github.com/google/go-cmp/cmp/path.go new file mode 100644 index 0000000000..f01eff318c --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/path.go @@ -0,0 +1,378 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "fmt" + "reflect" + "strings" + "unicode" + "unicode/utf8" + + "github.com/google/go-cmp/cmp/internal/value" +) + +// Path is a list of PathSteps describing the sequence of operations to get +// from some root type to the current position in the value tree. +// The first Path element is always an operation-less PathStep that exists +// simply to identify the initial type. +// +// When traversing structs with embedded structs, the embedded struct will +// always be accessed as a field before traversing the fields of the +// embedded struct themselves. That is, an exported field from the +// embedded struct will never be accessed directly from the parent struct. +type Path []PathStep + +// PathStep is a union-type for specific operations to traverse +// a value's tree structure. Users of this package never need to implement +// these types as values of this type will be returned by this package. +// +// Implementations of this interface are +// StructField, SliceIndex, MapIndex, Indirect, TypeAssertion, and Transform. +type PathStep interface { + String() string + + // Type is the resulting type after performing the path step. + Type() reflect.Type + + // Values is the resulting values after performing the path step. + // The type of each valid value is guaranteed to be identical to Type. + // + // In some cases, one or both may be invalid or have restrictions: + // • For StructField, both are not interface-able if the current field + // is unexported and the struct type is not explicitly permitted by + // an Exporter to traverse unexported fields. + // • For SliceIndex, one may be invalid if an element is missing from + // either the x or y slice. + // • For MapIndex, one may be invalid if an entry is missing from + // either the x or y map. + // + // The provided values must not be mutated. + Values() (vx, vy reflect.Value) +} + +var ( + _ PathStep = StructField{} + _ PathStep = SliceIndex{} + _ PathStep = MapIndex{} + _ PathStep = Indirect{} + _ PathStep = TypeAssertion{} + _ PathStep = Transform{} +) + +func (pa *Path) push(s PathStep) { + *pa = append(*pa, s) +} + +func (pa *Path) pop() { + *pa = (*pa)[:len(*pa)-1] +} + +// Last returns the last PathStep in the Path. +// If the path is empty, this returns a non-nil PathStep that reports a nil Type. +func (pa Path) Last() PathStep { + return pa.Index(-1) +} + +// Index returns the ith step in the Path and supports negative indexing. +// A negative index starts counting from the tail of the Path such that -1 +// refers to the last step, -2 refers to the second-to-last step, and so on. +// If index is invalid, this returns a non-nil PathStep that reports a nil Type. +func (pa Path) Index(i int) PathStep { + if i < 0 { + i = len(pa) + i + } + if i < 0 || i >= len(pa) { + return pathStep{} + } + return pa[i] +} + +// String returns the simplified path to a node. +// The simplified path only contains struct field accesses. +// +// For example: +// MyMap.MySlices.MyField +func (pa Path) String() string { + var ss []string + for _, s := range pa { + if _, ok := s.(StructField); ok { + ss = append(ss, s.String()) + } + } + return strings.TrimPrefix(strings.Join(ss, ""), ".") +} + +// GoString returns the path to a specific node using Go syntax. +// +// For example: +// (*root.MyMap["key"].(*mypkg.MyStruct).MySlices)[2][3].MyField +func (pa Path) GoString() string { + var ssPre, ssPost []string + var numIndirect int + for i, s := range pa { + var nextStep PathStep + if i+1 < len(pa) { + nextStep = pa[i+1] + } + switch s := s.(type) { + case Indirect: + numIndirect++ + pPre, pPost := "(", ")" + switch nextStep.(type) { + case Indirect: + continue // Next step is indirection, so let them batch up + case StructField: + numIndirect-- // Automatic indirection on struct fields + case nil: + pPre, pPost = "", "" // Last step; no need for parenthesis + } + if numIndirect > 0 { + ssPre = append(ssPre, pPre+strings.Repeat("*", numIndirect)) + ssPost = append(ssPost, pPost) + } + numIndirect = 0 + continue + case Transform: + ssPre = append(ssPre, s.trans.name+"(") + ssPost = append(ssPost, ")") + continue + } + ssPost = append(ssPost, s.String()) + } + for i, j := 0, len(ssPre)-1; i < j; i, j = i+1, j-1 { + ssPre[i], ssPre[j] = ssPre[j], ssPre[i] + } + return strings.Join(ssPre, "") + strings.Join(ssPost, "") +} + +type pathStep struct { + typ reflect.Type + vx, vy reflect.Value +} + +func (ps pathStep) Type() reflect.Type { return ps.typ } +func (ps pathStep) Values() (vx, vy reflect.Value) { return ps.vx, ps.vy } +func (ps pathStep) String() string { + if ps.typ == nil { + return "" + } + s := ps.typ.String() + if s == "" || strings.ContainsAny(s, "{}\n") { + return "root" // Type too simple or complex to print + } + return fmt.Sprintf("{%s}", s) +} + +// StructField represents a struct field access on a field called Name. +type StructField struct{ *structField } +type structField struct { + pathStep + name string + idx int + + // These fields are used for forcibly accessing an unexported field. + // pvx, pvy, and field are only valid if unexported is true. + unexported bool + mayForce bool // Forcibly allow visibility + paddr bool // Was parent addressable? + pvx, pvy reflect.Value // Parent values (always addressible) + field reflect.StructField // Field information +} + +func (sf StructField) Type() reflect.Type { return sf.typ } +func (sf StructField) Values() (vx, vy reflect.Value) { + if !sf.unexported { + return sf.vx, sf.vy // CanInterface reports true + } + + // Forcibly obtain read-write access to an unexported struct field. + if sf.mayForce { + vx = retrieveUnexportedField(sf.pvx, sf.field, sf.paddr) + vy = retrieveUnexportedField(sf.pvy, sf.field, sf.paddr) + return vx, vy // CanInterface reports true + } + return sf.vx, sf.vy // CanInterface reports false +} +func (sf StructField) String() string { return fmt.Sprintf(".%s", sf.name) } + +// Name is the field name. +func (sf StructField) Name() string { return sf.name } + +// Index is the index of the field in the parent struct type. +// See reflect.Type.Field. +func (sf StructField) Index() int { return sf.idx } + +// SliceIndex is an index operation on a slice or array at some index Key. +type SliceIndex struct{ *sliceIndex } +type sliceIndex struct { + pathStep + xkey, ykey int + isSlice bool // False for reflect.Array +} + +func (si SliceIndex) Type() reflect.Type { return si.typ } +func (si SliceIndex) Values() (vx, vy reflect.Value) { return si.vx, si.vy } +func (si SliceIndex) String() string { + switch { + case si.xkey == si.ykey: + return fmt.Sprintf("[%d]", si.xkey) + case si.ykey == -1: + // [5->?] means "I don't know where X[5] went" + return fmt.Sprintf("[%d->?]", si.xkey) + case si.xkey == -1: + // [?->3] means "I don't know where Y[3] came from" + return fmt.Sprintf("[?->%d]", si.ykey) + default: + // [5->3] means "X[5] moved to Y[3]" + return fmt.Sprintf("[%d->%d]", si.xkey, si.ykey) + } +} + +// Key is the index key; it may return -1 if in a split state +func (si SliceIndex) Key() int { + if si.xkey != si.ykey { + return -1 + } + return si.xkey +} + +// SplitKeys are the indexes for indexing into slices in the +// x and y values, respectively. These indexes may differ due to the +// insertion or removal of an element in one of the slices, causing +// all of the indexes to be shifted. If an index is -1, then that +// indicates that the element does not exist in the associated slice. +// +// Key is guaranteed to return -1 if and only if the indexes returned +// by SplitKeys are not the same. SplitKeys will never return -1 for +// both indexes. +func (si SliceIndex) SplitKeys() (ix, iy int) { return si.xkey, si.ykey } + +// MapIndex is an index operation on a map at some index Key. +type MapIndex struct{ *mapIndex } +type mapIndex struct { + pathStep + key reflect.Value +} + +func (mi MapIndex) Type() reflect.Type { return mi.typ } +func (mi MapIndex) Values() (vx, vy reflect.Value) { return mi.vx, mi.vy } +func (mi MapIndex) String() string { return fmt.Sprintf("[%#v]", mi.key) } + +// Key is the value of the map key. +func (mi MapIndex) Key() reflect.Value { return mi.key } + +// Indirect represents pointer indirection on the parent type. +type Indirect struct{ *indirect } +type indirect struct { + pathStep +} + +func (in Indirect) Type() reflect.Type { return in.typ } +func (in Indirect) Values() (vx, vy reflect.Value) { return in.vx, in.vy } +func (in Indirect) String() string { return "*" } + +// TypeAssertion represents a type assertion on an interface. +type TypeAssertion struct{ *typeAssertion } +type typeAssertion struct { + pathStep +} + +func (ta TypeAssertion) Type() reflect.Type { return ta.typ } +func (ta TypeAssertion) Values() (vx, vy reflect.Value) { return ta.vx, ta.vy } +func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", ta.typ) } + +// Transform is a transformation from the parent type to the current type. +type Transform struct{ *transform } +type transform struct { + pathStep + trans *transformer +} + +func (tf Transform) Type() reflect.Type { return tf.typ } +func (tf Transform) Values() (vx, vy reflect.Value) { return tf.vx, tf.vy } +func (tf Transform) String() string { return fmt.Sprintf("%s()", tf.trans.name) } + +// Name is the name of the Transformer. +func (tf Transform) Name() string { return tf.trans.name } + +// Func is the function pointer to the transformer function. +func (tf Transform) Func() reflect.Value { return tf.trans.fnc } + +// Option returns the originally constructed Transformer option. +// The == operator can be used to detect the exact option used. +func (tf Transform) Option() Option { return tf.trans } + +// pointerPath represents a dual-stack of pointers encountered when +// recursively traversing the x and y values. This data structure supports +// detection of cycles and determining whether the cycles are equal. +// In Go, cycles can occur via pointers, slices, and maps. +// +// The pointerPath uses a map to represent a stack; where descension into a +// pointer pushes the address onto the stack, and ascension from a pointer +// pops the address from the stack. Thus, when traversing into a pointer from +// reflect.Ptr, reflect.Slice element, or reflect.Map, we can detect cycles +// by checking whether the pointer has already been visited. The cycle detection +// uses a separate stack for the x and y values. +// +// If a cycle is detected we need to determine whether the two pointers +// should be considered equal. The definition of equality chosen by Equal +// requires two graphs to have the same structure. To determine this, both the +// x and y values must have a cycle where the previous pointers were also +// encountered together as a pair. +// +// Semantically, this is equivalent to augmenting Indirect, SliceIndex, and +// MapIndex with pointer information for the x and y values. +// Suppose px and py are two pointers to compare, we then search the +// Path for whether px was ever encountered in the Path history of x, and +// similarly so with py. If either side has a cycle, the comparison is only +// equal if both px and py have a cycle resulting from the same PathStep. +// +// Using a map as a stack is more performant as we can perform cycle detection +// in O(1) instead of O(N) where N is len(Path). +type pointerPath struct { + // mx is keyed by x pointers, where the value is the associated y pointer. + mx map[value.Pointer]value.Pointer + // my is keyed by y pointers, where the value is the associated x pointer. + my map[value.Pointer]value.Pointer +} + +func (p *pointerPath) Init() { + p.mx = make(map[value.Pointer]value.Pointer) + p.my = make(map[value.Pointer]value.Pointer) +} + +// Push indicates intent to descend into pointers vx and vy where +// visited reports whether either has been seen before. If visited before, +// equal reports whether both pointers were encountered together. +// Pop must be called if and only if the pointers were never visited. +// +// The pointers vx and vy must be a reflect.Ptr, reflect.Slice, or reflect.Map +// and be non-nil. +func (p pointerPath) Push(vx, vy reflect.Value) (equal, visited bool) { + px := value.PointerOf(vx) + py := value.PointerOf(vy) + _, ok1 := p.mx[px] + _, ok2 := p.my[py] + if ok1 || ok2 { + equal = p.mx[px] == py && p.my[py] == px // Pointers paired together + return equal, true + } + p.mx[px] = py + p.my[py] = px + return false, false +} + +// Pop ascends from pointers vx and vy. +func (p pointerPath) Pop(vx, vy reflect.Value) { + delete(p.mx, value.PointerOf(vx)) + delete(p.my, value.PointerOf(vy)) +} + +// isExported reports whether the identifier is exported. +func isExported(id string) bool { + r, _ := utf8.DecodeRuneInString(id) + return unicode.IsUpper(r) +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report.go b/ibm/vendor/github.com/google/go-cmp/cmp/report.go new file mode 100644 index 0000000000..f43cd12eb5 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report.go @@ -0,0 +1,54 @@ +// Copyright 2017, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +// defaultReporter implements the reporter interface. +// +// As Equal serially calls the PushStep, Report, and PopStep methods, the +// defaultReporter constructs a tree-based representation of the compared value +// and the result of each comparison (see valueNode). +// +// When the String method is called, the FormatDiff method transforms the +// valueNode tree into a textNode tree, which is a tree-based representation +// of the textual output (see textNode). +// +// Lastly, the textNode.String method produces the final report as a string. +type defaultReporter struct { + root *valueNode + curr *valueNode +} + +func (r *defaultReporter) PushStep(ps PathStep) { + r.curr = r.curr.PushStep(ps) + if r.root == nil { + r.root = r.curr + } +} +func (r *defaultReporter) Report(rs Result) { + r.curr.Report(rs) +} +func (r *defaultReporter) PopStep() { + r.curr = r.curr.PopStep() +} + +// String provides a full report of the differences detected as a structured +// literal in pseudo-Go syntax. String may only be called after the entire tree +// has been traversed. +func (r *defaultReporter) String() string { + assert(r.root != nil && r.curr == nil) + if r.root.NumDiff == 0 { + return "" + } + ptrs := new(pointerReferences) + text := formatOptions{}.FormatDiff(r.root, ptrs) + resolveReferences(text) + return text.String() +} + +func assert(ok bool) { + if !ok { + panic("assertion failure") + } +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report_compare.go b/ibm/vendor/github.com/google/go-cmp/cmp/report_compare.go new file mode 100644 index 0000000000..104bb30538 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -0,0 +1,432 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "fmt" + "reflect" + + "github.com/google/go-cmp/cmp/internal/value" +) + +// numContextRecords is the number of surrounding equal records to print. +const numContextRecords = 2 + +type diffMode byte + +const ( + diffUnknown diffMode = 0 + diffIdentical diffMode = ' ' + diffRemoved diffMode = '-' + diffInserted diffMode = '+' +) + +type typeMode int + +const ( + // emitType always prints the type. + emitType typeMode = iota + // elideType never prints the type. + elideType + // autoType prints the type only for composite kinds + // (i.e., structs, slices, arrays, and maps). + autoType +) + +type formatOptions struct { + // DiffMode controls the output mode of FormatDiff. + // + // If diffUnknown, then produce a diff of the x and y values. + // If diffIdentical, then emit values as if they were equal. + // If diffRemoved, then only emit x values (ignoring y values). + // If diffInserted, then only emit y values (ignoring x values). + DiffMode diffMode + + // TypeMode controls whether to print the type for the current node. + // + // As a general rule of thumb, we always print the type of the next node + // after an interface, and always elide the type of the next node after + // a slice or map node. + TypeMode typeMode + + // formatValueOptions are options specific to printing reflect.Values. + formatValueOptions +} + +func (opts formatOptions) WithDiffMode(d diffMode) formatOptions { + opts.DiffMode = d + return opts +} +func (opts formatOptions) WithTypeMode(t typeMode) formatOptions { + opts.TypeMode = t + return opts +} +func (opts formatOptions) WithVerbosity(level int) formatOptions { + opts.VerbosityLevel = level + opts.LimitVerbosity = true + return opts +} +func (opts formatOptions) verbosity() uint { + switch { + case opts.VerbosityLevel < 0: + return 0 + case opts.VerbosityLevel > 16: + return 16 // some reasonable maximum to avoid shift overflow + default: + return uint(opts.VerbosityLevel) + } +} + +const maxVerbosityPreset = 6 + +// verbosityPreset modifies the verbosity settings given an index +// between 0 and maxVerbosityPreset, inclusive. +func verbosityPreset(opts formatOptions, i int) formatOptions { + opts.VerbosityLevel = int(opts.verbosity()) + 2*i + if i > 0 { + opts.AvoidStringer = true + } + if i >= maxVerbosityPreset { + opts.PrintAddresses = true + opts.QualifiedNames = true + } + return opts +} + +// FormatDiff converts a valueNode tree into a textNode tree, where the later +// is a textual representation of the differences detected in the former. +func (opts formatOptions) FormatDiff(v *valueNode, ptrs *pointerReferences) (out textNode) { + if opts.DiffMode == diffIdentical { + opts = opts.WithVerbosity(1) + } else if opts.verbosity() < 3 { + opts = opts.WithVerbosity(3) + } + + // Check whether we have specialized formatting for this node. + // This is not necessary, but helpful for producing more readable outputs. + if opts.CanFormatDiffSlice(v) { + return opts.FormatDiffSlice(v) + } + + var parentKind reflect.Kind + if v.parent != nil && v.parent.TransformerName == "" { + parentKind = v.parent.Type.Kind() + } + + // For leaf nodes, format the value based on the reflect.Values alone. + if v.MaxDepth == 0 { + switch opts.DiffMode { + case diffUnknown, diffIdentical: + // Format Equal. + if v.NumDiff == 0 { + outx := opts.FormatValue(v.ValueX, parentKind, ptrs) + outy := opts.FormatValue(v.ValueY, parentKind, ptrs) + if v.NumIgnored > 0 && v.NumSame == 0 { + return textEllipsis + } else if outx.Len() < outy.Len() { + return outx + } else { + return outy + } + } + + // Format unequal. + assert(opts.DiffMode == diffUnknown) + var list textList + outx := opts.WithTypeMode(elideType).FormatValue(v.ValueX, parentKind, ptrs) + outy := opts.WithTypeMode(elideType).FormatValue(v.ValueY, parentKind, ptrs) + for i := 0; i <= maxVerbosityPreset && outx != nil && outy != nil && outx.Equal(outy); i++ { + opts2 := verbosityPreset(opts, i).WithTypeMode(elideType) + outx = opts2.FormatValue(v.ValueX, parentKind, ptrs) + outy = opts2.FormatValue(v.ValueY, parentKind, ptrs) + } + if outx != nil { + list = append(list, textRecord{Diff: '-', Value: outx}) + } + if outy != nil { + list = append(list, textRecord{Diff: '+', Value: outy}) + } + return opts.WithTypeMode(emitType).FormatType(v.Type, list) + case diffRemoved: + return opts.FormatValue(v.ValueX, parentKind, ptrs) + case diffInserted: + return opts.FormatValue(v.ValueY, parentKind, ptrs) + default: + panic("invalid diff mode") + } + } + + // Register slice element to support cycle detection. + if parentKind == reflect.Slice { + ptrRefs := ptrs.PushPair(v.ValueX, v.ValueY, opts.DiffMode, true) + defer ptrs.Pop() + defer func() { out = wrapTrunkReferences(ptrRefs, out) }() + } + + // Descend into the child value node. + if v.TransformerName != "" { + out := opts.WithTypeMode(emitType).FormatDiff(v.Value, ptrs) + out = &textWrap{Prefix: "Inverse(" + v.TransformerName + ", ", Value: out, Suffix: ")"} + return opts.FormatType(v.Type, out) + } else { + switch k := v.Type.Kind(); k { + case reflect.Struct, reflect.Array, reflect.Slice: + out = opts.formatDiffList(v.Records, k, ptrs) + out = opts.FormatType(v.Type, out) + case reflect.Map: + // Register map to support cycle detection. + ptrRefs := ptrs.PushPair(v.ValueX, v.ValueY, opts.DiffMode, false) + defer ptrs.Pop() + + out = opts.formatDiffList(v.Records, k, ptrs) + out = wrapTrunkReferences(ptrRefs, out) + out = opts.FormatType(v.Type, out) + case reflect.Ptr: + // Register pointer to support cycle detection. + ptrRefs := ptrs.PushPair(v.ValueX, v.ValueY, opts.DiffMode, false) + defer ptrs.Pop() + + out = opts.FormatDiff(v.Value, ptrs) + out = wrapTrunkReferences(ptrRefs, out) + out = &textWrap{Prefix: "&", Value: out} + case reflect.Interface: + out = opts.WithTypeMode(emitType).FormatDiff(v.Value, ptrs) + default: + panic(fmt.Sprintf("%v cannot have children", k)) + } + return out + } +} + +func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind, ptrs *pointerReferences) textNode { + // Derive record name based on the data structure kind. + var name string + var formatKey func(reflect.Value) string + switch k { + case reflect.Struct: + name = "field" + opts = opts.WithTypeMode(autoType) + formatKey = func(v reflect.Value) string { return v.String() } + case reflect.Slice, reflect.Array: + name = "element" + opts = opts.WithTypeMode(elideType) + formatKey = func(reflect.Value) string { return "" } + case reflect.Map: + name = "entry" + opts = opts.WithTypeMode(elideType) + formatKey = func(v reflect.Value) string { return formatMapKey(v, false, ptrs) } + } + + maxLen := -1 + if opts.LimitVerbosity { + if opts.DiffMode == diffIdentical { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + } else { + maxLen = (1 << opts.verbosity()) << 1 // 2, 4, 8, 16, 32, 64, etc... + } + opts.VerbosityLevel-- + } + + // Handle unification. + switch opts.DiffMode { + case diffIdentical, diffRemoved, diffInserted: + var list textList + var deferredEllipsis bool // Add final "..." to indicate records were dropped + for _, r := range recs { + if len(list) == maxLen { + deferredEllipsis = true + break + } + + // Elide struct fields that are zero value. + if k == reflect.Struct { + var isZero bool + switch opts.DiffMode { + case diffIdentical: + isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueY) + case diffRemoved: + isZero = value.IsZero(r.Value.ValueX) + case diffInserted: + isZero = value.IsZero(r.Value.ValueY) + } + if isZero { + continue + } + } + // Elide ignored nodes. + if r.Value.NumIgnored > 0 && r.Value.NumSame+r.Value.NumDiff == 0 { + deferredEllipsis = !(k == reflect.Slice || k == reflect.Array) + if !deferredEllipsis { + list.AppendEllipsis(diffStats{}) + } + continue + } + if out := opts.FormatDiff(r.Value, ptrs); out != nil { + list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + } + } + if deferredEllipsis { + list.AppendEllipsis(diffStats{}) + } + return &textWrap{Prefix: "{", Value: list, Suffix: "}"} + case diffUnknown: + default: + panic("invalid diff mode") + } + + // Handle differencing. + var numDiffs int + var list textList + var keys []reflect.Value // invariant: len(list) == len(keys) + groups := coalesceAdjacentRecords(name, recs) + maxGroup := diffStats{Name: name} + for i, ds := range groups { + if maxLen >= 0 && numDiffs >= maxLen { + maxGroup = maxGroup.Append(ds) + continue + } + + // Handle equal records. + if ds.NumDiff() == 0 { + // Compute the number of leading and trailing records to print. + var numLo, numHi int + numEqual := ds.NumIgnored + ds.NumIdentical + for numLo < numContextRecords && numLo+numHi < numEqual && i != 0 { + if r := recs[numLo].Value; r.NumIgnored > 0 && r.NumSame+r.NumDiff == 0 { + break + } + numLo++ + } + for numHi < numContextRecords && numLo+numHi < numEqual && i != len(groups)-1 { + if r := recs[numEqual-numHi-1].Value; r.NumIgnored > 0 && r.NumSame+r.NumDiff == 0 { + break + } + numHi++ + } + if numEqual-(numLo+numHi) == 1 && ds.NumIgnored == 0 { + numHi++ // Avoid pointless coalescing of a single equal record + } + + // Format the equal values. + for _, r := range recs[:numLo] { + out := opts.WithDiffMode(diffIdentical).FormatDiff(r.Value, ptrs) + list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) + } + if numEqual > numLo+numHi { + ds.NumIdentical -= numLo + numHi + list.AppendEllipsis(ds) + for len(keys) < len(list) { + keys = append(keys, reflect.Value{}) + } + } + for _, r := range recs[numEqual-numHi : numEqual] { + out := opts.WithDiffMode(diffIdentical).FormatDiff(r.Value, ptrs) + list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) + } + recs = recs[numEqual:] + continue + } + + // Handle unequal records. + for _, r := range recs[:ds.NumDiff()] { + switch { + case opts.CanFormatDiffSlice(r.Value): + out := opts.FormatDiffSlice(r.Value) + list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) + case r.Value.NumChildren == r.Value.MaxDepth: + outx := opts.WithDiffMode(diffRemoved).FormatDiff(r.Value, ptrs) + outy := opts.WithDiffMode(diffInserted).FormatDiff(r.Value, ptrs) + for i := 0; i <= maxVerbosityPreset && outx != nil && outy != nil && outx.Equal(outy); i++ { + opts2 := verbosityPreset(opts, i) + outx = opts2.WithDiffMode(diffRemoved).FormatDiff(r.Value, ptrs) + outy = opts2.WithDiffMode(diffInserted).FormatDiff(r.Value, ptrs) + } + if outx != nil { + list = append(list, textRecord{Diff: diffRemoved, Key: formatKey(r.Key), Value: outx}) + keys = append(keys, r.Key) + } + if outy != nil { + list = append(list, textRecord{Diff: diffInserted, Key: formatKey(r.Key), Value: outy}) + keys = append(keys, r.Key) + } + default: + out := opts.FormatDiff(r.Value, ptrs) + list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) + } + } + recs = recs[ds.NumDiff():] + numDiffs += ds.NumDiff() + } + if maxGroup.IsZero() { + assert(len(recs) == 0) + } else { + list.AppendEllipsis(maxGroup) + for len(keys) < len(list) { + keys = append(keys, reflect.Value{}) + } + } + assert(len(list) == len(keys)) + + // For maps, the default formatting logic uses fmt.Stringer which may + // produce ambiguous output. Avoid calling String to disambiguate. + if k == reflect.Map { + var ambiguous bool + seenKeys := map[string]reflect.Value{} + for i, currKey := range keys { + if currKey.IsValid() { + strKey := list[i].Key + prevKey, seen := seenKeys[strKey] + if seen && prevKey.CanInterface() && currKey.CanInterface() { + ambiguous = prevKey.Interface() != currKey.Interface() + if ambiguous { + break + } + } + seenKeys[strKey] = currKey + } + } + if ambiguous { + for i, k := range keys { + if k.IsValid() { + list[i].Key = formatMapKey(k, true, ptrs) + } + } + } + } + + return &textWrap{Prefix: "{", Value: list, Suffix: "}"} +} + +// coalesceAdjacentRecords coalesces the list of records into groups of +// adjacent equal, or unequal counts. +func coalesceAdjacentRecords(name string, recs []reportRecord) (groups []diffStats) { + var prevCase int // Arbitrary index into which case last occurred + lastStats := func(i int) *diffStats { + if prevCase != i { + groups = append(groups, diffStats{Name: name}) + prevCase = i + } + return &groups[len(groups)-1] + } + for _, r := range recs { + switch rv := r.Value; { + case rv.NumIgnored > 0 && rv.NumSame+rv.NumDiff == 0: + lastStats(1).NumIgnored++ + case rv.NumDiff == 0: + lastStats(1).NumIdentical++ + case rv.NumDiff > 0 && !rv.ValueY.IsValid(): + lastStats(2).NumRemoved++ + case rv.NumDiff > 0 && !rv.ValueX.IsValid(): + lastStats(2).NumInserted++ + default: + lastStats(2).NumModified++ + } + } + return groups +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report_references.go b/ibm/vendor/github.com/google/go-cmp/cmp/report_references.go new file mode 100644 index 0000000000..be31b33a9e --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report_references.go @@ -0,0 +1,264 @@ +// Copyright 2020, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "fmt" + "reflect" + "strings" + + "github.com/google/go-cmp/cmp/internal/flags" + "github.com/google/go-cmp/cmp/internal/value" +) + +const ( + pointerDelimPrefix = "⟪" + pointerDelimSuffix = "⟫" +) + +// formatPointer prints the address of the pointer. +func formatPointer(p value.Pointer, withDelims bool) string { + v := p.Uintptr() + if flags.Deterministic { + v = 0xdeadf00f // Only used for stable testing purposes + } + if withDelims { + return pointerDelimPrefix + formatHex(uint64(v)) + pointerDelimSuffix + } + return formatHex(uint64(v)) +} + +// pointerReferences is a stack of pointers visited so far. +type pointerReferences [][2]value.Pointer + +func (ps *pointerReferences) PushPair(vx, vy reflect.Value, d diffMode, deref bool) (pp [2]value.Pointer) { + if deref && vx.IsValid() { + vx = vx.Addr() + } + if deref && vy.IsValid() { + vy = vy.Addr() + } + switch d { + case diffUnknown, diffIdentical: + pp = [2]value.Pointer{value.PointerOf(vx), value.PointerOf(vy)} + case diffRemoved: + pp = [2]value.Pointer{value.PointerOf(vx), value.Pointer{}} + case diffInserted: + pp = [2]value.Pointer{value.Pointer{}, value.PointerOf(vy)} + } + *ps = append(*ps, pp) + return pp +} + +func (ps *pointerReferences) Push(v reflect.Value) (p value.Pointer, seen bool) { + p = value.PointerOf(v) + for _, pp := range *ps { + if p == pp[0] || p == pp[1] { + return p, true + } + } + *ps = append(*ps, [2]value.Pointer{p, p}) + return p, false +} + +func (ps *pointerReferences) Pop() { + *ps = (*ps)[:len(*ps)-1] +} + +// trunkReferences is metadata for a textNode indicating that the sub-tree +// represents the value for either pointer in a pair of references. +type trunkReferences struct{ pp [2]value.Pointer } + +// trunkReference is metadata for a textNode indicating that the sub-tree +// represents the value for the given pointer reference. +type trunkReference struct{ p value.Pointer } + +// leafReference is metadata for a textNode indicating that the value is +// truncated as it refers to another part of the tree (i.e., a trunk). +type leafReference struct{ p value.Pointer } + +func wrapTrunkReferences(pp [2]value.Pointer, s textNode) textNode { + switch { + case pp[0].IsNil(): + return &textWrap{Value: s, Metadata: trunkReference{pp[1]}} + case pp[1].IsNil(): + return &textWrap{Value: s, Metadata: trunkReference{pp[0]}} + case pp[0] == pp[1]: + return &textWrap{Value: s, Metadata: trunkReference{pp[0]}} + default: + return &textWrap{Value: s, Metadata: trunkReferences{pp}} + } +} +func wrapTrunkReference(p value.Pointer, printAddress bool, s textNode) textNode { + var prefix string + if printAddress { + prefix = formatPointer(p, true) + } + return &textWrap{Prefix: prefix, Value: s, Metadata: trunkReference{p}} +} +func makeLeafReference(p value.Pointer, printAddress bool) textNode { + out := &textWrap{Prefix: "(", Value: textEllipsis, Suffix: ")"} + var prefix string + if printAddress { + prefix = formatPointer(p, true) + } + return &textWrap{Prefix: prefix, Value: out, Metadata: leafReference{p}} +} + +// resolveReferences walks the textNode tree searching for any leaf reference +// metadata and resolves each against the corresponding trunk references. +// Since pointer addresses in memory are not particularly readable to the user, +// it replaces each pointer value with an arbitrary and unique reference ID. +func resolveReferences(s textNode) { + var walkNodes func(textNode, func(textNode)) + walkNodes = func(s textNode, f func(textNode)) { + f(s) + switch s := s.(type) { + case *textWrap: + walkNodes(s.Value, f) + case textList: + for _, r := range s { + walkNodes(r.Value, f) + } + } + } + + // Collect all trunks and leaves with reference metadata. + var trunks, leaves []*textWrap + walkNodes(s, func(s textNode) { + if s, ok := s.(*textWrap); ok { + switch s.Metadata.(type) { + case leafReference: + leaves = append(leaves, s) + case trunkReference, trunkReferences: + trunks = append(trunks, s) + } + } + }) + + // No leaf references to resolve. + if len(leaves) == 0 { + return + } + + // Collect the set of all leaf references to resolve. + leafPtrs := make(map[value.Pointer]bool) + for _, leaf := range leaves { + leafPtrs[leaf.Metadata.(leafReference).p] = true + } + + // Collect the set of trunk pointers that are always paired together. + // This allows us to assign a single ID to both pointers for brevity. + // If a pointer in a pair ever occurs by itself or as a different pair, + // then the pair is broken. + pairedTrunkPtrs := make(map[value.Pointer]value.Pointer) + unpair := func(p value.Pointer) { + if !pairedTrunkPtrs[p].IsNil() { + pairedTrunkPtrs[pairedTrunkPtrs[p]] = value.Pointer{} // invalidate other half + } + pairedTrunkPtrs[p] = value.Pointer{} // invalidate this half + } + for _, trunk := range trunks { + switch p := trunk.Metadata.(type) { + case trunkReference: + unpair(p.p) // standalone pointer cannot be part of a pair + case trunkReferences: + p0, ok0 := pairedTrunkPtrs[p.pp[0]] + p1, ok1 := pairedTrunkPtrs[p.pp[1]] + switch { + case !ok0 && !ok1: + // Register the newly seen pair. + pairedTrunkPtrs[p.pp[0]] = p.pp[1] + pairedTrunkPtrs[p.pp[1]] = p.pp[0] + case ok0 && ok1 && p0 == p.pp[1] && p1 == p.pp[0]: + // Exact pair already seen; do nothing. + default: + // Pair conflicts with some other pair; break all pairs. + unpair(p.pp[0]) + unpair(p.pp[1]) + } + } + } + + // Correlate each pointer referenced by leaves to a unique identifier, + // and print the IDs for each trunk that matches those pointers. + var nextID uint + ptrIDs := make(map[value.Pointer]uint) + newID := func() uint { + id := nextID + nextID++ + return id + } + for _, trunk := range trunks { + switch p := trunk.Metadata.(type) { + case trunkReference: + if print := leafPtrs[p.p]; print { + id, ok := ptrIDs[p.p] + if !ok { + id = newID() + ptrIDs[p.p] = id + } + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id)) + } + case trunkReferences: + print0 := leafPtrs[p.pp[0]] + print1 := leafPtrs[p.pp[1]] + if print0 || print1 { + id0, ok0 := ptrIDs[p.pp[0]] + id1, ok1 := ptrIDs[p.pp[1]] + isPair := pairedTrunkPtrs[p.pp[0]] == p.pp[1] && pairedTrunkPtrs[p.pp[1]] == p.pp[0] + if isPair { + var id uint + assert(ok0 == ok1) // must be seen together or not at all + if ok0 { + assert(id0 == id1) // must have the same ID + id = id0 + } else { + id = newID() + ptrIDs[p.pp[0]] = id + ptrIDs[p.pp[1]] = id + } + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id)) + } else { + if print0 && !ok0 { + id0 = newID() + ptrIDs[p.pp[0]] = id0 + } + if print1 && !ok1 { + id1 = newID() + ptrIDs[p.pp[1]] = id1 + } + switch { + case print0 && print1: + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id0)+","+formatReference(id1)) + case print0: + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id0)) + case print1: + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id1)) + } + } + } + } + } + + // Update all leaf references with the unique identifier. + for _, leaf := range leaves { + if id, ok := ptrIDs[leaf.Metadata.(leafReference).p]; ok { + leaf.Prefix = updateReferencePrefix(leaf.Prefix, formatReference(id)) + } + } +} + +func formatReference(id uint) string { + return fmt.Sprintf("ref#%d", id) +} + +func updateReferencePrefix(prefix, ref string) string { + if prefix == "" { + return pointerDelimPrefix + ref + pointerDelimSuffix + } + suffix := strings.TrimPrefix(prefix, pointerDelimPrefix) + return pointerDelimPrefix + ref + ": " + suffix +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/ibm/vendor/github.com/google/go-cmp/cmp/report_reflect.go new file mode 100644 index 0000000000..33f03577f9 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -0,0 +1,402 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "bytes" + "fmt" + "reflect" + "strconv" + "strings" + "unicode" + "unicode/utf8" + + "github.com/google/go-cmp/cmp/internal/value" +) + +type formatValueOptions struct { + // AvoidStringer controls whether to avoid calling custom stringer + // methods like error.Error or fmt.Stringer.String. + AvoidStringer bool + + // PrintAddresses controls whether to print the address of all pointers, + // slice elements, and maps. + PrintAddresses bool + + // QualifiedNames controls whether FormatType uses the fully qualified name + // (including the full package path as opposed to just the package name). + QualifiedNames bool + + // VerbosityLevel controls the amount of output to produce. + // A higher value produces more output. A value of zero or lower produces + // no output (represented using an ellipsis). + // If LimitVerbosity is false, then the level is treated as infinite. + VerbosityLevel int + + // LimitVerbosity specifies that formatting should respect VerbosityLevel. + LimitVerbosity bool +} + +// FormatType prints the type as if it were wrapping s. +// This may return s as-is depending on the current type and TypeMode mode. +func (opts formatOptions) FormatType(t reflect.Type, s textNode) textNode { + // Check whether to emit the type or not. + switch opts.TypeMode { + case autoType: + switch t.Kind() { + case reflect.Struct, reflect.Slice, reflect.Array, reflect.Map: + if s.Equal(textNil) { + return s + } + default: + return s + } + if opts.DiffMode == diffIdentical { + return s // elide type for identical nodes + } + case elideType: + return s + } + + // Determine the type label, applying special handling for unnamed types. + typeName := value.TypeString(t, opts.QualifiedNames) + if t.Name() == "" { + // According to Go grammar, certain type literals contain symbols that + // do not strongly bind to the next lexicographical token (e.g., *T). + switch t.Kind() { + case reflect.Chan, reflect.Func, reflect.Ptr: + typeName = "(" + typeName + ")" + } + } + return &textWrap{Prefix: typeName, Value: wrapParens(s)} +} + +// wrapParens wraps s with a set of parenthesis, but avoids it if the +// wrapped node itself is already surrounded by a pair of parenthesis or braces. +// It handles unwrapping one level of pointer-reference nodes. +func wrapParens(s textNode) textNode { + var refNode *textWrap + if s2, ok := s.(*textWrap); ok { + // Unwrap a single pointer reference node. + switch s2.Metadata.(type) { + case leafReference, trunkReference, trunkReferences: + refNode = s2 + if s3, ok := refNode.Value.(*textWrap); ok { + s2 = s3 + } + } + + // Already has delimiters that make parenthesis unnecessary. + hasParens := strings.HasPrefix(s2.Prefix, "(") && strings.HasSuffix(s2.Suffix, ")") + hasBraces := strings.HasPrefix(s2.Prefix, "{") && strings.HasSuffix(s2.Suffix, "}") + if hasParens || hasBraces { + return s + } + } + if refNode != nil { + refNode.Value = &textWrap{Prefix: "(", Value: refNode.Value, Suffix: ")"} + return s + } + return &textWrap{Prefix: "(", Value: s, Suffix: ")"} +} + +// FormatValue prints the reflect.Value, taking extra care to avoid descending +// into pointers already in ptrs. As pointers are visited, ptrs is also updated. +func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, ptrs *pointerReferences) (out textNode) { + if !v.IsValid() { + return nil + } + t := v.Type() + + // Check slice element for cycles. + if parentKind == reflect.Slice { + ptrRef, visited := ptrs.Push(v.Addr()) + if visited { + return makeLeafReference(ptrRef, false) + } + defer ptrs.Pop() + defer func() { out = wrapTrunkReference(ptrRef, false, out) }() + } + + // Check whether there is an Error or String method to call. + if !opts.AvoidStringer && v.CanInterface() { + // Avoid calling Error or String methods on nil receivers since many + // implementations crash when doing so. + if (t.Kind() != reflect.Ptr && t.Kind() != reflect.Interface) || !v.IsNil() { + var prefix, strVal string + func() { + // Swallow and ignore any panics from String or Error. + defer func() { recover() }() + switch v := v.Interface().(type) { + case error: + strVal = v.Error() + prefix = "e" + case fmt.Stringer: + strVal = v.String() + prefix = "s" + } + }() + if prefix != "" { + return opts.formatString(prefix, strVal) + } + } + } + + // Check whether to explicitly wrap the result with the type. + var skipType bool + defer func() { + if !skipType { + out = opts.FormatType(t, out) + } + }() + + switch t.Kind() { + case reflect.Bool: + return textLine(fmt.Sprint(v.Bool())) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return textLine(fmt.Sprint(v.Int())) + case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return textLine(fmt.Sprint(v.Uint())) + case reflect.Uint8: + if parentKind == reflect.Slice || parentKind == reflect.Array { + return textLine(formatHex(v.Uint())) + } + return textLine(fmt.Sprint(v.Uint())) + case reflect.Uintptr: + return textLine(formatHex(v.Uint())) + case reflect.Float32, reflect.Float64: + return textLine(fmt.Sprint(v.Float())) + case reflect.Complex64, reflect.Complex128: + return textLine(fmt.Sprint(v.Complex())) + case reflect.String: + return opts.formatString("", v.String()) + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + return textLine(formatPointer(value.PointerOf(v), true)) + case reflect.Struct: + var list textList + v := makeAddressable(v) // needed for retrieveUnexportedField + maxLen := v.NumField() + if opts.LimitVerbosity { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + opts.VerbosityLevel-- + } + for i := 0; i < v.NumField(); i++ { + vv := v.Field(i) + if value.IsZero(vv) { + continue // Elide fields with zero values + } + if len(list) == maxLen { + list.AppendEllipsis(diffStats{}) + break + } + sf := t.Field(i) + if supportExporters && !isExported(sf.Name) { + vv = retrieveUnexportedField(v, sf, true) + } + s := opts.WithTypeMode(autoType).FormatValue(vv, t.Kind(), ptrs) + list = append(list, textRecord{Key: sf.Name, Value: s}) + } + return &textWrap{Prefix: "{", Value: list, Suffix: "}"} + case reflect.Slice: + if v.IsNil() { + return textNil + } + + // Check whether this is a []byte of text data. + if t.Elem() == reflect.TypeOf(byte(0)) { + b := v.Bytes() + isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) && unicode.IsSpace(r) } + if len(b) > 0 && utf8.Valid(b) && len(bytes.TrimFunc(b, isPrintSpace)) == 0 { + out = opts.formatString("", string(b)) + return opts.WithTypeMode(emitType).FormatType(t, out) + } + } + + fallthrough + case reflect.Array: + maxLen := v.Len() + if opts.LimitVerbosity { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + opts.VerbosityLevel-- + } + var list textList + for i := 0; i < v.Len(); i++ { + if len(list) == maxLen { + list.AppendEllipsis(diffStats{}) + break + } + s := opts.WithTypeMode(elideType).FormatValue(v.Index(i), t.Kind(), ptrs) + list = append(list, textRecord{Value: s}) + } + + out = &textWrap{Prefix: "{", Value: list, Suffix: "}"} + if t.Kind() == reflect.Slice && opts.PrintAddresses { + header := fmt.Sprintf("ptr:%v, len:%d, cap:%d", formatPointer(value.PointerOf(v), false), v.Len(), v.Cap()) + out = &textWrap{Prefix: pointerDelimPrefix + header + pointerDelimSuffix, Value: out} + } + return out + case reflect.Map: + if v.IsNil() { + return textNil + } + + // Check pointer for cycles. + ptrRef, visited := ptrs.Push(v) + if visited { + return makeLeafReference(ptrRef, opts.PrintAddresses) + } + defer ptrs.Pop() + + maxLen := v.Len() + if opts.LimitVerbosity { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + opts.VerbosityLevel-- + } + var list textList + for _, k := range value.SortKeys(v.MapKeys()) { + if len(list) == maxLen { + list.AppendEllipsis(diffStats{}) + break + } + sk := formatMapKey(k, false, ptrs) + sv := opts.WithTypeMode(elideType).FormatValue(v.MapIndex(k), t.Kind(), ptrs) + list = append(list, textRecord{Key: sk, Value: sv}) + } + + out = &textWrap{Prefix: "{", Value: list, Suffix: "}"} + out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) + return out + case reflect.Ptr: + if v.IsNil() { + return textNil + } + + // Check pointer for cycles. + ptrRef, visited := ptrs.Push(v) + if visited { + out = makeLeafReference(ptrRef, opts.PrintAddresses) + return &textWrap{Prefix: "&", Value: out} + } + defer ptrs.Pop() + + skipType = true // Let the underlying value print the type instead + out = opts.FormatValue(v.Elem(), t.Kind(), ptrs) + out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) + out = &textWrap{Prefix: "&", Value: out} + return out + case reflect.Interface: + if v.IsNil() { + return textNil + } + // Interfaces accept different concrete types, + // so configure the underlying value to explicitly print the type. + skipType = true // Print the concrete type instead + return opts.WithTypeMode(emitType).FormatValue(v.Elem(), t.Kind(), ptrs) + default: + panic(fmt.Sprintf("%v kind not handled", v.Kind())) + } +} + +func (opts formatOptions) formatString(prefix, s string) textNode { + maxLen := len(s) + maxLines := strings.Count(s, "\n") + 1 + if opts.LimitVerbosity { + maxLen = (1 << opts.verbosity()) << 5 // 32, 64, 128, 256, etc... + maxLines = (1 << opts.verbosity()) << 2 // 4, 8, 16, 32, 64, etc... + } + + // For multiline strings, use the triple-quote syntax, + // but only use it when printing removed or inserted nodes since + // we only want the extra verbosity for those cases. + lines := strings.Split(strings.TrimSuffix(s, "\n"), "\n") + isTripleQuoted := len(lines) >= 4 && (opts.DiffMode == '-' || opts.DiffMode == '+') + for i := 0; i < len(lines) && isTripleQuoted; i++ { + lines[i] = strings.TrimPrefix(strings.TrimSuffix(lines[i], "\r"), "\r") // trim leading/trailing carriage returns for legacy Windows endline support + isPrintable := func(r rune) bool { + return unicode.IsPrint(r) || r == '\t' // specially treat tab as printable + } + line := lines[i] + isTripleQuoted = !strings.HasPrefix(strings.TrimPrefix(line, prefix), `"""`) && !strings.HasPrefix(line, "...") && strings.TrimFunc(line, isPrintable) == "" && len(line) <= maxLen + } + if isTripleQuoted { + var list textList + list = append(list, textRecord{Diff: opts.DiffMode, Value: textLine(prefix + `"""`), ElideComma: true}) + for i, line := range lines { + if numElided := len(lines) - i; i == maxLines-1 && numElided > 1 { + comment := commentString(fmt.Sprintf("%d elided lines", numElided)) + list = append(list, textRecord{Diff: opts.DiffMode, Value: textEllipsis, ElideComma: true, Comment: comment}) + break + } + list = append(list, textRecord{Diff: opts.DiffMode, Value: textLine(line), ElideComma: true}) + } + list = append(list, textRecord{Diff: opts.DiffMode, Value: textLine(prefix + `"""`), ElideComma: true}) + return &textWrap{Prefix: "(", Value: list, Suffix: ")"} + } + + // Format the string as a single-line quoted string. + if len(s) > maxLen+len(textEllipsis) { + return textLine(prefix + formatString(s[:maxLen]) + string(textEllipsis)) + } + return textLine(prefix + formatString(s)) +} + +// formatMapKey formats v as if it were a map key. +// The result is guaranteed to be a single line. +func formatMapKey(v reflect.Value, disambiguate bool, ptrs *pointerReferences) string { + var opts formatOptions + opts.DiffMode = diffIdentical + opts.TypeMode = elideType + opts.PrintAddresses = disambiguate + opts.AvoidStringer = disambiguate + opts.QualifiedNames = disambiguate + opts.VerbosityLevel = maxVerbosityPreset + opts.LimitVerbosity = true + s := opts.FormatValue(v, reflect.Map, ptrs).String() + return strings.TrimSpace(s) +} + +// formatString prints s as a double-quoted or backtick-quoted string. +func formatString(s string) string { + // Use quoted string if it the same length as a raw string literal. + // Otherwise, attempt to use the raw string form. + qs := strconv.Quote(s) + if len(qs) == 1+len(s)+1 { + return qs + } + + // Disallow newlines to ensure output is a single line. + // Only allow printable runes for readability purposes. + rawInvalid := func(r rune) bool { + return r == '`' || r == '\n' || !(unicode.IsPrint(r) || r == '\t') + } + if utf8.ValidString(s) && strings.IndexFunc(s, rawInvalid) < 0 { + return "`" + s + "`" + } + return qs +} + +// formatHex prints u as a hexadecimal integer in Go notation. +func formatHex(u uint64) string { + var f string + switch { + case u <= 0xff: + f = "0x%02x" + case u <= 0xffff: + f = "0x%04x" + case u <= 0xffffff: + f = "0x%06x" + case u <= 0xffffffff: + f = "0x%08x" + case u <= 0xffffffffff: + f = "0x%010x" + case u <= 0xffffffffffff: + f = "0x%012x" + case u <= 0xffffffffffffff: + f = "0x%014x" + case u <= 0xffffffffffffffff: + f = "0x%016x" + } + return fmt.Sprintf(f, u) +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report_slices.go b/ibm/vendor/github.com/google/go-cmp/cmp/report_slices.go new file mode 100644 index 0000000000..2ad3bc85ba --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -0,0 +1,613 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "bytes" + "fmt" + "math" + "reflect" + "strconv" + "strings" + "unicode" + "unicode/utf8" + + "github.com/google/go-cmp/cmp/internal/diff" +) + +// CanFormatDiffSlice reports whether we support custom formatting for nodes +// that are slices of primitive kinds or strings. +func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { + switch { + case opts.DiffMode != diffUnknown: + return false // Must be formatting in diff mode + case v.NumDiff == 0: + return false // No differences detected + case !v.ValueX.IsValid() || !v.ValueY.IsValid(): + return false // Both values must be valid + case v.NumIgnored > 0: + return false // Some ignore option was used + case v.NumTransformed > 0: + return false // Some transform option was used + case v.NumCompared > 1: + return false // More than one comparison was used + case v.NumCompared == 1 && v.Type.Name() != "": + // The need for cmp to check applicability of options on every element + // in a slice is a significant performance detriment for large []byte. + // The workaround is to specify Comparer(bytes.Equal), + // which enables cmp to compare []byte more efficiently. + // If they differ, we still want to provide batched diffing. + // The logic disallows named types since they tend to have their own + // String method, with nicer formatting than what this provides. + return false + } + + // Check whether this is an interface with the same concrete types. + t := v.Type + vx, vy := v.ValueX, v.ValueY + if t.Kind() == reflect.Interface && !vx.IsNil() && !vy.IsNil() && vx.Elem().Type() == vy.Elem().Type() { + vx, vy = vx.Elem(), vy.Elem() + t = vx.Type() + } + + // Check whether we provide specialized diffing for this type. + switch t.Kind() { + case reflect.String: + case reflect.Array, reflect.Slice: + // Only slices of primitive types have specialized handling. + switch t.Elem().Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, + reflect.Bool, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: + default: + return false + } + + // Both slice values have to be non-empty. + if t.Kind() == reflect.Slice && (vx.Len() == 0 || vy.Len() == 0) { + return false + } + + // If a sufficient number of elements already differ, + // use specialized formatting even if length requirement is not met. + if v.NumDiff > v.NumSame { + return true + } + default: + return false + } + + // Use specialized string diffing for longer slices or strings. + const minLength = 64 + return vx.Len() >= minLength && vy.Len() >= minLength +} + +// FormatDiffSlice prints a diff for the slices (or strings) represented by v. +// This provides custom-tailored logic to make printing of differences in +// textual strings and slices of primitive kinds more readable. +func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { + assert(opts.DiffMode == diffUnknown) + t, vx, vy := v.Type, v.ValueX, v.ValueY + if t.Kind() == reflect.Interface { + vx, vy = vx.Elem(), vy.Elem() + t = vx.Type() + opts = opts.WithTypeMode(emitType) + } + + // Auto-detect the type of the data. + var sx, sy string + var ssx, ssy []string + var isString, isMostlyText, isPureLinedText, isBinary bool + switch { + case t.Kind() == reflect.String: + sx, sy = vx.String(), vy.String() + isString = true + case t.Kind() == reflect.Slice && t.Elem() == reflect.TypeOf(byte(0)): + sx, sy = string(vx.Bytes()), string(vy.Bytes()) + isString = true + case t.Kind() == reflect.Array: + // Arrays need to be addressable for slice operations to work. + vx2, vy2 := reflect.New(t).Elem(), reflect.New(t).Elem() + vx2.Set(vx) + vy2.Set(vy) + vx, vy = vx2, vy2 + } + if isString { + var numTotalRunes, numValidRunes, numLines, lastLineIdx, maxLineLen int + for i, r := range sx + sy { + numTotalRunes++ + if (unicode.IsPrint(r) || unicode.IsSpace(r)) && r != utf8.RuneError { + numValidRunes++ + } + if r == '\n' { + if maxLineLen < i-lastLineIdx { + maxLineLen = i - lastLineIdx + } + lastLineIdx = i + 1 + numLines++ + } + } + isPureText := numValidRunes == numTotalRunes + isMostlyText = float64(numValidRunes) > math.Floor(0.90*float64(numTotalRunes)) + isPureLinedText = isPureText && numLines >= 4 && maxLineLen <= 1024 + isBinary = !isMostlyText + + // Avoid diffing by lines if it produces a significantly more complex + // edit script than diffing by bytes. + if isPureLinedText { + ssx = strings.Split(sx, "\n") + ssy = strings.Split(sy, "\n") + esLines := diff.Difference(len(ssx), len(ssy), func(ix, iy int) diff.Result { + return diff.BoolResult(ssx[ix] == ssy[iy]) + }) + esBytes := diff.Difference(len(sx), len(sy), func(ix, iy int) diff.Result { + return diff.BoolResult(sx[ix] == sy[iy]) + }) + efficiencyLines := float64(esLines.Dist()) / float64(len(esLines)) + efficiencyBytes := float64(esBytes.Dist()) / float64(len(esBytes)) + isPureLinedText = efficiencyLines < 4*efficiencyBytes + } + } + + // Format the string into printable records. + var list textList + var delim string + switch { + // If the text appears to be multi-lined text, + // then perform differencing across individual lines. + case isPureLinedText: + list = opts.formatDiffSlice( + reflect.ValueOf(ssx), reflect.ValueOf(ssy), 1, "line", + func(v reflect.Value, d diffMode) textRecord { + s := formatString(v.Index(0).String()) + return textRecord{Diff: d, Value: textLine(s)} + }, + ) + delim = "\n" + + // If possible, use a custom triple-quote (""") syntax for printing + // differences in a string literal. This format is more readable, + // but has edge-cases where differences are visually indistinguishable. + // This format is avoided under the following conditions: + // • A line starts with `"""` + // • A line starts with "..." + // • A line contains non-printable characters + // • Adjacent different lines differ only by whitespace + // + // For example: + // """ + // ... // 3 identical lines + // foo + // bar + // - baz + // + BAZ + // """ + isTripleQuoted := true + prevRemoveLines := map[string]bool{} + prevInsertLines := map[string]bool{} + var list2 textList + list2 = append(list2, textRecord{Value: textLine(`"""`), ElideComma: true}) + for _, r := range list { + if !r.Value.Equal(textEllipsis) { + line, _ := strconv.Unquote(string(r.Value.(textLine))) + line = strings.TrimPrefix(strings.TrimSuffix(line, "\r"), "\r") // trim leading/trailing carriage returns for legacy Windows endline support + normLine := strings.Map(func(r rune) rune { + if unicode.IsSpace(r) { + return -1 // drop whitespace to avoid visually indistinguishable output + } + return r + }, line) + isPrintable := func(r rune) bool { + return unicode.IsPrint(r) || r == '\t' // specially treat tab as printable + } + isTripleQuoted = !strings.HasPrefix(line, `"""`) && !strings.HasPrefix(line, "...") && strings.TrimFunc(line, isPrintable) == "" + switch r.Diff { + case diffRemoved: + isTripleQuoted = isTripleQuoted && !prevInsertLines[normLine] + prevRemoveLines[normLine] = true + case diffInserted: + isTripleQuoted = isTripleQuoted && !prevRemoveLines[normLine] + prevInsertLines[normLine] = true + } + if !isTripleQuoted { + break + } + r.Value = textLine(line) + r.ElideComma = true + } + if !(r.Diff == diffRemoved || r.Diff == diffInserted) { // start a new non-adjacent difference group + prevRemoveLines = map[string]bool{} + prevInsertLines = map[string]bool{} + } + list2 = append(list2, r) + } + if r := list2[len(list2)-1]; r.Diff == diffIdentical && len(r.Value.(textLine)) == 0 { + list2 = list2[:len(list2)-1] // elide single empty line at the end + } + list2 = append(list2, textRecord{Value: textLine(`"""`), ElideComma: true}) + if isTripleQuoted { + var out textNode = &textWrap{Prefix: "(", Value: list2, Suffix: ")"} + switch t.Kind() { + case reflect.String: + if t != reflect.TypeOf(string("")) { + out = opts.FormatType(t, out) + } + case reflect.Slice: + // Always emit type for slices since the triple-quote syntax + // looks like a string (not a slice). + opts = opts.WithTypeMode(emitType) + out = opts.FormatType(t, out) + } + return out + } + + // If the text appears to be single-lined text, + // then perform differencing in approximately fixed-sized chunks. + // The output is printed as quoted strings. + case isMostlyText: + list = opts.formatDiffSlice( + reflect.ValueOf(sx), reflect.ValueOf(sy), 64, "byte", + func(v reflect.Value, d diffMode) textRecord { + s := formatString(v.String()) + return textRecord{Diff: d, Value: textLine(s)} + }, + ) + + // If the text appears to be binary data, + // then perform differencing in approximately fixed-sized chunks. + // The output is inspired by hexdump. + case isBinary: + list = opts.formatDiffSlice( + reflect.ValueOf(sx), reflect.ValueOf(sy), 16, "byte", + func(v reflect.Value, d diffMode) textRecord { + var ss []string + for i := 0; i < v.Len(); i++ { + ss = append(ss, formatHex(v.Index(i).Uint())) + } + s := strings.Join(ss, ", ") + comment := commentString(fmt.Sprintf("%c|%v|", d, formatASCII(v.String()))) + return textRecord{Diff: d, Value: textLine(s), Comment: comment} + }, + ) + + // For all other slices of primitive types, + // then perform differencing in approximately fixed-sized chunks. + // The size of each chunk depends on the width of the element kind. + default: + var chunkSize int + if t.Elem().Kind() == reflect.Bool { + chunkSize = 16 + } else { + switch t.Elem().Bits() { + case 8: + chunkSize = 16 + case 16: + chunkSize = 12 + case 32: + chunkSize = 8 + default: + chunkSize = 8 + } + } + list = opts.formatDiffSlice( + vx, vy, chunkSize, t.Elem().Kind().String(), + func(v reflect.Value, d diffMode) textRecord { + var ss []string + for i := 0; i < v.Len(); i++ { + switch t.Elem().Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + ss = append(ss, fmt.Sprint(v.Index(i).Int())) + case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: + ss = append(ss, fmt.Sprint(v.Index(i).Uint())) + case reflect.Uint8, reflect.Uintptr: + ss = append(ss, formatHex(v.Index(i).Uint())) + case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: + ss = append(ss, fmt.Sprint(v.Index(i).Interface())) + } + } + s := strings.Join(ss, ", ") + return textRecord{Diff: d, Value: textLine(s)} + }, + ) + } + + // Wrap the output with appropriate type information. + var out textNode = &textWrap{Prefix: "{", Value: list, Suffix: "}"} + if !isMostlyText { + // The "{...}" byte-sequence literal is not valid Go syntax for strings. + // Emit the type for extra clarity (e.g. "string{...}"). + if t.Kind() == reflect.String { + opts = opts.WithTypeMode(emitType) + } + return opts.FormatType(t, out) + } + switch t.Kind() { + case reflect.String: + out = &textWrap{Prefix: "strings.Join(", Value: out, Suffix: fmt.Sprintf(", %q)", delim)} + if t != reflect.TypeOf(string("")) { + out = opts.FormatType(t, out) + } + case reflect.Slice: + out = &textWrap{Prefix: "bytes.Join(", Value: out, Suffix: fmt.Sprintf(", %q)", delim)} + if t != reflect.TypeOf([]byte(nil)) { + out = opts.FormatType(t, out) + } + } + return out +} + +// formatASCII formats s as an ASCII string. +// This is useful for printing binary strings in a semi-legible way. +func formatASCII(s string) string { + b := bytes.Repeat([]byte{'.'}, len(s)) + for i := 0; i < len(s); i++ { + if ' ' <= s[i] && s[i] <= '~' { + b[i] = s[i] + } + } + return string(b) +} + +func (opts formatOptions) formatDiffSlice( + vx, vy reflect.Value, chunkSize int, name string, + makeRec func(reflect.Value, diffMode) textRecord, +) (list textList) { + eq := func(ix, iy int) bool { + return vx.Index(ix).Interface() == vy.Index(iy).Interface() + } + es := diff.Difference(vx.Len(), vy.Len(), func(ix, iy int) diff.Result { + return diff.BoolResult(eq(ix, iy)) + }) + + appendChunks := func(v reflect.Value, d diffMode) int { + n0 := v.Len() + for v.Len() > 0 { + n := chunkSize + if n > v.Len() { + n = v.Len() + } + list = append(list, makeRec(v.Slice(0, n), d)) + v = v.Slice(n, v.Len()) + } + return n0 - v.Len() + } + + var numDiffs int + maxLen := -1 + if opts.LimitVerbosity { + maxLen = (1 << opts.verbosity()) << 2 // 4, 8, 16, 32, 64, etc... + opts.VerbosityLevel-- + } + + groups := coalesceAdjacentEdits(name, es) + groups = coalesceInterveningIdentical(groups, chunkSize/4) + groups = cleanupSurroundingIdentical(groups, eq) + maxGroup := diffStats{Name: name} + for i, ds := range groups { + if maxLen >= 0 && numDiffs >= maxLen { + maxGroup = maxGroup.Append(ds) + continue + } + + // Print equal. + if ds.NumDiff() == 0 { + // Compute the number of leading and trailing equal bytes to print. + var numLo, numHi int + numEqual := ds.NumIgnored + ds.NumIdentical + for numLo < chunkSize*numContextRecords && numLo+numHi < numEqual && i != 0 { + numLo++ + } + for numHi < chunkSize*numContextRecords && numLo+numHi < numEqual && i != len(groups)-1 { + numHi++ + } + if numEqual-(numLo+numHi) <= chunkSize && ds.NumIgnored == 0 { + numHi = numEqual - numLo // Avoid pointless coalescing of single equal row + } + + // Print the equal bytes. + appendChunks(vx.Slice(0, numLo), diffIdentical) + if numEqual > numLo+numHi { + ds.NumIdentical -= numLo + numHi + list.AppendEllipsis(ds) + } + appendChunks(vx.Slice(numEqual-numHi, numEqual), diffIdentical) + vx = vx.Slice(numEqual, vx.Len()) + vy = vy.Slice(numEqual, vy.Len()) + continue + } + + // Print unequal. + len0 := len(list) + nx := appendChunks(vx.Slice(0, ds.NumIdentical+ds.NumRemoved+ds.NumModified), diffRemoved) + vx = vx.Slice(nx, vx.Len()) + ny := appendChunks(vy.Slice(0, ds.NumIdentical+ds.NumInserted+ds.NumModified), diffInserted) + vy = vy.Slice(ny, vy.Len()) + numDiffs += len(list) - len0 + } + if maxGroup.IsZero() { + assert(vx.Len() == 0 && vy.Len() == 0) + } else { + list.AppendEllipsis(maxGroup) + } + return list +} + +// coalesceAdjacentEdits coalesces the list of edits into groups of adjacent +// equal or unequal counts. +// +// Example: +// +// Input: "..XXY...Y" +// Output: [ +// {NumIdentical: 2}, +// {NumRemoved: 2, NumInserted 1}, +// {NumIdentical: 3}, +// {NumInserted: 1}, +// ] +// +func coalesceAdjacentEdits(name string, es diff.EditScript) (groups []diffStats) { + var prevMode byte + lastStats := func(mode byte) *diffStats { + if prevMode != mode { + groups = append(groups, diffStats{Name: name}) + prevMode = mode + } + return &groups[len(groups)-1] + } + for _, e := range es { + switch e { + case diff.Identity: + lastStats('=').NumIdentical++ + case diff.UniqueX: + lastStats('!').NumRemoved++ + case diff.UniqueY: + lastStats('!').NumInserted++ + case diff.Modified: + lastStats('!').NumModified++ + } + } + return groups +} + +// coalesceInterveningIdentical coalesces sufficiently short (<= windowSize) +// equal groups into adjacent unequal groups that currently result in a +// dual inserted/removed printout. This acts as a high-pass filter to smooth +// out high-frequency changes within the windowSize. +// +// Example: +// +// WindowSize: 16, +// Input: [ +// {NumIdentical: 61}, // group 0 +// {NumRemoved: 3, NumInserted: 1}, // group 1 +// {NumIdentical: 6}, // ├── coalesce +// {NumInserted: 2}, // ├── coalesce +// {NumIdentical: 1}, // ├── coalesce +// {NumRemoved: 9}, // └── coalesce +// {NumIdentical: 64}, // group 2 +// {NumRemoved: 3, NumInserted: 1}, // group 3 +// {NumIdentical: 6}, // ├── coalesce +// {NumInserted: 2}, // ├── coalesce +// {NumIdentical: 1}, // ├── coalesce +// {NumRemoved: 7}, // ├── coalesce +// {NumIdentical: 1}, // ├── coalesce +// {NumRemoved: 2}, // └── coalesce +// {NumIdentical: 63}, // group 4 +// ] +// Output: [ +// {NumIdentical: 61}, +// {NumIdentical: 7, NumRemoved: 12, NumInserted: 3}, +// {NumIdentical: 64}, +// {NumIdentical: 8, NumRemoved: 12, NumInserted: 3}, +// {NumIdentical: 63}, +// ] +// +func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStats { + groups, groupsOrig := groups[:0], groups + for i, ds := range groupsOrig { + if len(groups) >= 2 && ds.NumDiff() > 0 { + prev := &groups[len(groups)-2] // Unequal group + curr := &groups[len(groups)-1] // Equal group + next := &groupsOrig[i] // Unequal group + hadX, hadY := prev.NumRemoved > 0, prev.NumInserted > 0 + hasX, hasY := next.NumRemoved > 0, next.NumInserted > 0 + if ((hadX || hasX) && (hadY || hasY)) && curr.NumIdentical <= windowSize { + *prev = prev.Append(*curr).Append(*next) + groups = groups[:len(groups)-1] // Truncate off equal group + continue + } + } + groups = append(groups, ds) + } + return groups +} + +// cleanupSurroundingIdentical scans through all unequal groups, and +// moves any leading sequence of equal elements to the preceding equal group and +// moves and trailing sequence of equal elements to the succeeding equal group. +// +// This is necessary since coalesceInterveningIdentical may coalesce edit groups +// together such that leading/trailing spans of equal elements becomes possible. +// Note that this can occur even with an optimal diffing algorithm. +// +// Example: +// +// Input: [ +// {NumIdentical: 61}, +// {NumIdentical: 1 , NumRemoved: 11, NumInserted: 2}, // assume 3 leading identical elements +// {NumIdentical: 67}, +// {NumIdentical: 7, NumRemoved: 12, NumInserted: 3}, // assume 10 trailing identical elements +// {NumIdentical: 54}, +// ] +// Output: [ +// {NumIdentical: 64}, // incremented by 3 +// {NumRemoved: 9}, +// {NumIdentical: 67}, +// {NumRemoved: 9}, +// {NumIdentical: 64}, // incremented by 10 +// ] +// +func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []diffStats { + var ix, iy int // indexes into sequence x and y + for i, ds := range groups { + // Handle equal group. + if ds.NumDiff() == 0 { + ix += ds.NumIdentical + iy += ds.NumIdentical + continue + } + + // Handle unequal group. + nx := ds.NumIdentical + ds.NumRemoved + ds.NumModified + ny := ds.NumIdentical + ds.NumInserted + ds.NumModified + var numLeadingIdentical, numTrailingIdentical int + for i := 0; i < nx && i < ny && eq(ix+i, iy+i); i++ { + numLeadingIdentical++ + } + for i := 0; i < nx && i < ny && eq(ix+nx-1-i, iy+ny-1-i); i++ { + numTrailingIdentical++ + } + if numIdentical := numLeadingIdentical + numTrailingIdentical; numIdentical > 0 { + if numLeadingIdentical > 0 { + // Remove leading identical span from this group and + // insert it into the preceding group. + if i-1 >= 0 { + groups[i-1].NumIdentical += numLeadingIdentical + } else { + // No preceding group exists, so prepend a new group, + // but do so after we finish iterating over all groups. + defer func() { + groups = append([]diffStats{{Name: groups[0].Name, NumIdentical: numLeadingIdentical}}, groups...) + }() + } + // Increment indexes since the preceding group would have handled this. + ix += numLeadingIdentical + iy += numLeadingIdentical + } + if numTrailingIdentical > 0 { + // Remove trailing identical span from this group and + // insert it into the succeeding group. + if i+1 < len(groups) { + groups[i+1].NumIdentical += numTrailingIdentical + } else { + // No succeeding group exists, so append a new group, + // but do so after we finish iterating over all groups. + defer func() { + groups = append(groups, diffStats{Name: groups[len(groups)-1].Name, NumIdentical: numTrailingIdentical}) + }() + } + // Do not increment indexes since the succeeding group will handle this. + } + + // Update this group since some identical elements were removed. + nx -= numIdentical + ny -= numIdentical + groups[i] = diffStats{Name: ds.Name, NumRemoved: nx, NumInserted: ny} + } + ix += nx + iy += ny + } + return groups +} diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report_text.go b/ibm/vendor/github.com/google/go-cmp/cmp/report_text.go new file mode 100644 index 0000000000..0fd46d7ffb --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -0,0 +1,431 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import ( + "bytes" + "fmt" + "math/rand" + "strings" + "time" + "unicode/utf8" + + "github.com/google/go-cmp/cmp/internal/flags" +) + +var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 + +const maxColumnLength = 80 + +type indentMode int + +func (n indentMode) appendIndent(b []byte, d diffMode) []byte { + // The output of Diff is documented as being unstable to provide future + // flexibility in changing the output for more humanly readable reports. + // This logic intentionally introduces instability to the exact output + // so that users can detect accidental reliance on stability early on, + // rather than much later when an actual change to the format occurs. + if flags.Deterministic || randBool { + // Use regular spaces (U+0020). + switch d { + case diffUnknown, diffIdentical: + b = append(b, " "...) + case diffRemoved: + b = append(b, "- "...) + case diffInserted: + b = append(b, "+ "...) + } + } else { + // Use non-breaking spaces (U+00a0). + switch d { + case diffUnknown, diffIdentical: + b = append(b, "  "...) + case diffRemoved: + b = append(b, "- "...) + case diffInserted: + b = append(b, "+ "...) + } + } + return repeatCount(n).appendChar(b, '\t') +} + +type repeatCount int + +func (n repeatCount) appendChar(b []byte, c byte) []byte { + for ; n > 0; n-- { + b = append(b, c) + } + return b +} + +// textNode is a simplified tree-based representation of structured text. +// Possible node types are textWrap, textList, or textLine. +type textNode interface { + // Len reports the length in bytes of a single-line version of the tree. + // Nested textRecord.Diff and textRecord.Comment fields are ignored. + Len() int + // Equal reports whether the two trees are structurally identical. + // Nested textRecord.Diff and textRecord.Comment fields are compared. + Equal(textNode) bool + // String returns the string representation of the text tree. + // It is not guaranteed that len(x.String()) == x.Len(), + // nor that x.String() == y.String() implies that x.Equal(y). + String() string + + // formatCompactTo formats the contents of the tree as a single-line string + // to the provided buffer. Any nested textRecord.Diff and textRecord.Comment + // fields are ignored. + // + // However, not all nodes in the tree should be collapsed as a single-line. + // If a node can be collapsed as a single-line, it is replaced by a textLine + // node. Since the top-level node cannot replace itself, this also returns + // the current node itself. + // + // This does not mutate the receiver. + formatCompactTo([]byte, diffMode) ([]byte, textNode) + // formatExpandedTo formats the contents of the tree as a multi-line string + // to the provided buffer. In order for column alignment to operate well, + // formatCompactTo must be called before calling formatExpandedTo. + formatExpandedTo([]byte, diffMode, indentMode) []byte +} + +// textWrap is a wrapper that concatenates a prefix and/or a suffix +// to the underlying node. +type textWrap struct { + Prefix string // e.g., "bytes.Buffer{" + Value textNode // textWrap | textList | textLine + Suffix string // e.g., "}" + Metadata interface{} // arbitrary metadata; has no effect on formatting +} + +func (s *textWrap) Len() int { + return len(s.Prefix) + s.Value.Len() + len(s.Suffix) +} +func (s1 *textWrap) Equal(s2 textNode) bool { + if s2, ok := s2.(*textWrap); ok { + return s1.Prefix == s2.Prefix && s1.Value.Equal(s2.Value) && s1.Suffix == s2.Suffix + } + return false +} +func (s *textWrap) String() string { + var d diffMode + var n indentMode + _, s2 := s.formatCompactTo(nil, d) + b := n.appendIndent(nil, d) // Leading indent + b = s2.formatExpandedTo(b, d, n) // Main body + b = append(b, '\n') // Trailing newline + return string(b) +} +func (s *textWrap) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { + n0 := len(b) // Original buffer length + b = append(b, s.Prefix...) + b, s.Value = s.Value.formatCompactTo(b, d) + b = append(b, s.Suffix...) + if _, ok := s.Value.(textLine); ok { + return b, textLine(b[n0:]) + } + return b, s +} +func (s *textWrap) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { + b = append(b, s.Prefix...) + b = s.Value.formatExpandedTo(b, d, n) + b = append(b, s.Suffix...) + return b +} + +// textList is a comma-separated list of textWrap or textLine nodes. +// The list may be formatted as multi-lines or single-line at the discretion +// of the textList.formatCompactTo method. +type textList []textRecord +type textRecord struct { + Diff diffMode // e.g., 0 or '-' or '+' + Key string // e.g., "MyField" + Value textNode // textWrap | textLine + ElideComma bool // avoid trailing comma + Comment fmt.Stringer // e.g., "6 identical fields" +} + +// AppendEllipsis appends a new ellipsis node to the list if none already +// exists at the end. If cs is non-zero it coalesces the statistics with the +// previous diffStats. +func (s *textList) AppendEllipsis(ds diffStats) { + hasStats := !ds.IsZero() + if len(*s) == 0 || !(*s)[len(*s)-1].Value.Equal(textEllipsis) { + if hasStats { + *s = append(*s, textRecord{Value: textEllipsis, ElideComma: true, Comment: ds}) + } else { + *s = append(*s, textRecord{Value: textEllipsis, ElideComma: true}) + } + return + } + if hasStats { + (*s)[len(*s)-1].Comment = (*s)[len(*s)-1].Comment.(diffStats).Append(ds) + } +} + +func (s textList) Len() (n int) { + for i, r := range s { + n += len(r.Key) + if r.Key != "" { + n += len(": ") + } + n += r.Value.Len() + if i < len(s)-1 { + n += len(", ") + } + } + return n +} + +func (s1 textList) Equal(s2 textNode) bool { + if s2, ok := s2.(textList); ok { + if len(s1) != len(s2) { + return false + } + for i := range s1 { + r1, r2 := s1[i], s2[i] + if !(r1.Diff == r2.Diff && r1.Key == r2.Key && r1.Value.Equal(r2.Value) && r1.Comment == r2.Comment) { + return false + } + } + return true + } + return false +} + +func (s textList) String() string { + return (&textWrap{Prefix: "{", Value: s, Suffix: "}"}).String() +} + +func (s textList) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { + s = append(textList(nil), s...) // Avoid mutating original + + // Determine whether we can collapse this list as a single line. + n0 := len(b) // Original buffer length + var multiLine bool + for i, r := range s { + if r.Diff == diffInserted || r.Diff == diffRemoved { + multiLine = true + } + b = append(b, r.Key...) + if r.Key != "" { + b = append(b, ": "...) + } + b, s[i].Value = r.Value.formatCompactTo(b, d|r.Diff) + if _, ok := s[i].Value.(textLine); !ok { + multiLine = true + } + if r.Comment != nil { + multiLine = true + } + if i < len(s)-1 { + b = append(b, ", "...) + } + } + // Force multi-lined output when printing a removed/inserted node that + // is sufficiently long. + if (d == diffInserted || d == diffRemoved) && len(b[n0:]) > maxColumnLength { + multiLine = true + } + if !multiLine { + return b, textLine(b[n0:]) + } + return b, s +} + +func (s textList) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { + alignKeyLens := s.alignLens( + func(r textRecord) bool { + _, isLine := r.Value.(textLine) + return r.Key == "" || !isLine + }, + func(r textRecord) int { return utf8.RuneCountInString(r.Key) }, + ) + alignValueLens := s.alignLens( + func(r textRecord) bool { + _, isLine := r.Value.(textLine) + return !isLine || r.Value.Equal(textEllipsis) || r.Comment == nil + }, + func(r textRecord) int { return utf8.RuneCount(r.Value.(textLine)) }, + ) + + // Format lists of simple lists in a batched form. + // If the list is sequence of only textLine values, + // then batch multiple values on a single line. + var isSimple bool + for _, r := range s { + _, isLine := r.Value.(textLine) + isSimple = r.Diff == 0 && r.Key == "" && isLine && r.Comment == nil + if !isSimple { + break + } + } + if isSimple { + n++ + var batch []byte + emitBatch := func() { + if len(batch) > 0 { + b = n.appendIndent(append(b, '\n'), d) + b = append(b, bytes.TrimRight(batch, " ")...) + batch = batch[:0] + } + } + for _, r := range s { + line := r.Value.(textLine) + if len(batch)+len(line)+len(", ") > maxColumnLength { + emitBatch() + } + batch = append(batch, line...) + batch = append(batch, ", "...) + } + emitBatch() + n-- + return n.appendIndent(append(b, '\n'), d) + } + + // Format the list as a multi-lined output. + n++ + for i, r := range s { + b = n.appendIndent(append(b, '\n'), d|r.Diff) + if r.Key != "" { + b = append(b, r.Key+": "...) + } + b = alignKeyLens[i].appendChar(b, ' ') + + b = r.Value.formatExpandedTo(b, d|r.Diff, n) + if !r.ElideComma { + b = append(b, ',') + } + b = alignValueLens[i].appendChar(b, ' ') + + if r.Comment != nil { + b = append(b, " // "+r.Comment.String()...) + } + } + n-- + + return n.appendIndent(append(b, '\n'), d) +} + +func (s textList) alignLens( + skipFunc func(textRecord) bool, + lenFunc func(textRecord) int, +) []repeatCount { + var startIdx, endIdx, maxLen int + lens := make([]repeatCount, len(s)) + for i, r := range s { + if skipFunc(r) { + for j := startIdx; j < endIdx && j < len(s); j++ { + lens[j] = repeatCount(maxLen - lenFunc(s[j])) + } + startIdx, endIdx, maxLen = i+1, i+1, 0 + } else { + if maxLen < lenFunc(r) { + maxLen = lenFunc(r) + } + endIdx = i + 1 + } + } + for j := startIdx; j < endIdx && j < len(s); j++ { + lens[j] = repeatCount(maxLen - lenFunc(s[j])) + } + return lens +} + +// textLine is a single-line segment of text and is always a leaf node +// in the textNode tree. +type textLine []byte + +var ( + textNil = textLine("nil") + textEllipsis = textLine("...") +) + +func (s textLine) Len() int { + return len(s) +} +func (s1 textLine) Equal(s2 textNode) bool { + if s2, ok := s2.(textLine); ok { + return bytes.Equal([]byte(s1), []byte(s2)) + } + return false +} +func (s textLine) String() string { + return string(s) +} +func (s textLine) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { + return append(b, s...), s +} +func (s textLine) formatExpandedTo(b []byte, _ diffMode, _ indentMode) []byte { + return append(b, s...) +} + +type diffStats struct { + Name string + NumIgnored int + NumIdentical int + NumRemoved int + NumInserted int + NumModified int +} + +func (s diffStats) IsZero() bool { + s.Name = "" + return s == diffStats{} +} + +func (s diffStats) NumDiff() int { + return s.NumRemoved + s.NumInserted + s.NumModified +} + +func (s diffStats) Append(ds diffStats) diffStats { + assert(s.Name == ds.Name) + s.NumIgnored += ds.NumIgnored + s.NumIdentical += ds.NumIdentical + s.NumRemoved += ds.NumRemoved + s.NumInserted += ds.NumInserted + s.NumModified += ds.NumModified + return s +} + +// String prints a humanly-readable summary of coalesced records. +// +// Example: +// diffStats{Name: "Field", NumIgnored: 5}.String() => "5 ignored fields" +func (s diffStats) String() string { + var ss []string + var sum int + labels := [...]string{"ignored", "identical", "removed", "inserted", "modified"} + counts := [...]int{s.NumIgnored, s.NumIdentical, s.NumRemoved, s.NumInserted, s.NumModified} + for i, n := range counts { + if n > 0 { + ss = append(ss, fmt.Sprintf("%d %v", n, labels[i])) + } + sum += n + } + + // Pluralize the name (adjusting for some obscure English grammar rules). + name := s.Name + if sum > 1 { + name += "s" + if strings.HasSuffix(name, "ys") { + name = name[:len(name)-2] + "ies" // e.g., "entrys" => "entries" + } + } + + // Format the list according to English grammar (with Oxford comma). + switch n := len(ss); n { + case 0: + return "" + case 1, 2: + return strings.Join(ss, " and ") + " " + name + default: + return strings.Join(ss[:n-1], ", ") + ", and " + ss[n-1] + " " + name + } +} + +type commentString string + +func (s commentString) String() string { return string(s) } diff --git a/ibm/vendor/github.com/google/go-cmp/cmp/report_value.go b/ibm/vendor/github.com/google/go-cmp/cmp/report_value.go new file mode 100644 index 0000000000..668d470fd8 --- /dev/null +++ b/ibm/vendor/github.com/google/go-cmp/cmp/report_value.go @@ -0,0 +1,121 @@ +// Copyright 2019, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cmp + +import "reflect" + +// valueNode represents a single node within a report, which is a +// structured representation of the value tree, containing information +// regarding which nodes are equal or not. +type valueNode struct { + parent *valueNode + + Type reflect.Type + ValueX reflect.Value + ValueY reflect.Value + + // NumSame is the number of leaf nodes that are equal. + // All descendants are equal only if NumDiff is 0. + NumSame int + // NumDiff is the number of leaf nodes that are not equal. + NumDiff int + // NumIgnored is the number of leaf nodes that are ignored. + NumIgnored int + // NumCompared is the number of leaf nodes that were compared + // using an Equal method or Comparer function. + NumCompared int + // NumTransformed is the number of non-leaf nodes that were transformed. + NumTransformed int + // NumChildren is the number of transitive descendants of this node. + // This counts from zero; thus, leaf nodes have no descendants. + NumChildren int + // MaxDepth is the maximum depth of the tree. This counts from zero; + // thus, leaf nodes have a depth of zero. + MaxDepth int + + // Records is a list of struct fields, slice elements, or map entries. + Records []reportRecord // If populated, implies Value is not populated + + // Value is the result of a transformation, pointer indirect, of + // type assertion. + Value *valueNode // If populated, implies Records is not populated + + // TransformerName is the name of the transformer. + TransformerName string // If non-empty, implies Value is populated +} +type reportRecord struct { + Key reflect.Value // Invalid for slice element + Value *valueNode +} + +func (parent *valueNode) PushStep(ps PathStep) (child *valueNode) { + vx, vy := ps.Values() + child = &valueNode{parent: parent, Type: ps.Type(), ValueX: vx, ValueY: vy} + switch s := ps.(type) { + case StructField: + assert(parent.Value == nil) + parent.Records = append(parent.Records, reportRecord{Key: reflect.ValueOf(s.Name()), Value: child}) + case SliceIndex: + assert(parent.Value == nil) + parent.Records = append(parent.Records, reportRecord{Value: child}) + case MapIndex: + assert(parent.Value == nil) + parent.Records = append(parent.Records, reportRecord{Key: s.Key(), Value: child}) + case Indirect: + assert(parent.Value == nil && parent.Records == nil) + parent.Value = child + case TypeAssertion: + assert(parent.Value == nil && parent.Records == nil) + parent.Value = child + case Transform: + assert(parent.Value == nil && parent.Records == nil) + parent.Value = child + parent.TransformerName = s.Name() + parent.NumTransformed++ + default: + assert(parent == nil) // Must be the root step + } + return child +} + +func (r *valueNode) Report(rs Result) { + assert(r.MaxDepth == 0) // May only be called on leaf nodes + + if rs.ByIgnore() { + r.NumIgnored++ + } else { + if rs.Equal() { + r.NumSame++ + } else { + r.NumDiff++ + } + } + assert(r.NumSame+r.NumDiff+r.NumIgnored == 1) + + if rs.ByMethod() { + r.NumCompared++ + } + if rs.ByFunc() { + r.NumCompared++ + } + assert(r.NumCompared <= 1) +} + +func (child *valueNode) PopStep() (parent *valueNode) { + if child.parent == nil { + return nil + } + parent = child.parent + parent.NumSame += child.NumSame + parent.NumDiff += child.NumDiff + parent.NumIgnored += child.NumIgnored + parent.NumCompared += child.NumCompared + parent.NumTransformed += child.NumTransformed + parent.NumChildren += child.NumChildren + 1 + if parent.MaxDepth < child.MaxDepth+1 { + parent.MaxDepth = child.MaxDepth + 1 + } + return parent +} diff --git a/ibm/vendor/github.com/googleapis/gax-go/v2/LICENSE b/ibm/vendor/github.com/googleapis/gax-go/v2/LICENSE deleted file mode 100644 index 6d16b6578a..0000000000 --- a/ibm/vendor/github.com/googleapis/gax-go/v2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2016, Google Inc. -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/github.com/googleapis/gax-go/v2/call_option.go b/ibm/vendor/github.com/googleapis/gax-go/v2/call_option.go deleted file mode 100644 index b1d53dd19c..0000000000 --- a/ibm/vendor/github.com/googleapis/gax-go/v2/call_option.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import ( - "math/rand" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// CallOption is an option used by Invoke to control behaviors of RPC calls. -// CallOption works by modifying relevant fields of CallSettings. -type CallOption interface { - // Resolve applies the option by modifying cs. - Resolve(cs *CallSettings) -} - -// Retryer is used by Invoke to determine retry behavior. -type Retryer interface { - // Retry reports whether a request should be retriedand how long to pause before retrying - // if the previous attempt returned with err. Invoke never calls Retry with nil error. - Retry(err error) (pause time.Duration, shouldRetry bool) -} - -type retryerOption func() Retryer - -func (o retryerOption) Resolve(s *CallSettings) { - s.Retry = o -} - -// WithRetry sets CallSettings.Retry to fn. -func WithRetry(fn func() Retryer) CallOption { - return retryerOption(fn) -} - -// OnCodes returns a Retryer that retries if and only if -// the previous attempt returns a GRPC error whose error code is stored in cc. -// Pause times between retries are specified by bo. -// -// bo is only used for its parameters; each Retryer has its own copy. -func OnCodes(cc []codes.Code, bo Backoff) Retryer { - return &boRetryer{ - backoff: bo, - codes: append([]codes.Code(nil), cc...), - } -} - -type boRetryer struct { - backoff Backoff - codes []codes.Code -} - -func (r *boRetryer) Retry(err error) (time.Duration, bool) { - st, ok := status.FromError(err) - if !ok { - return 0, false - } - c := st.Code() - for _, rc := range r.codes { - if c == rc { - return r.backoff.Pause(), true - } - } - return 0, false -} - -// Backoff implements exponential backoff. -// The wait time between retries is a random value between 0 and the "retry envelope". -// The envelope starts at Initial and increases by the factor of Multiplier every retry, -// but is capped at Max. -type Backoff struct { - // Initial is the initial value of the retry envelope, defaults to 1 second. - Initial time.Duration - - // Max is the maximum value of the retry envelope, defaults to 30 seconds. - Max time.Duration - - // Multiplier is the factor by which the retry envelope increases. - // It should be greater than 1 and defaults to 2. - Multiplier float64 - - // cur is the current retry envelope - cur time.Duration -} - -// Pause returns the next time.Duration that the caller should use to backoff. -func (bo *Backoff) Pause() time.Duration { - if bo.Initial == 0 { - bo.Initial = time.Second - } - if bo.cur == 0 { - bo.cur = bo.Initial - } - if bo.Max == 0 { - bo.Max = 30 * time.Second - } - if bo.Multiplier < 1 { - bo.Multiplier = 2 - } - // Select a duration between 1ns and the current max. It might seem - // counterintuitive to have so much jitter, but - // https://www.awsarchitectureblog.com/2015/03/backoff.html argues that - // that is the best strategy. - d := time.Duration(1 + rand.Int63n(int64(bo.cur))) - bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier) - if bo.cur > bo.Max { - bo.cur = bo.Max - } - return d -} - -type grpcOpt []grpc.CallOption - -func (o grpcOpt) Resolve(s *CallSettings) { - s.GRPC = o -} - -// WithGRPCOptions allows passing gRPC call options during client creation. -func WithGRPCOptions(opt ...grpc.CallOption) CallOption { - return grpcOpt(append([]grpc.CallOption(nil), opt...)) -} - -// CallSettings allow fine-grained control over how calls are made. -type CallSettings struct { - // Retry returns a Retryer to be used to control retry logic of a method call. - // If Retry is nil or the returned Retryer is nil, the call will not be retried. - Retry func() Retryer - - // CallOptions to be forwarded to GRPC. - GRPC []grpc.CallOption -} diff --git a/ibm/vendor/github.com/googleapis/gax-go/v2/gax.go b/ibm/vendor/github.com/googleapis/gax-go/v2/gax.go deleted file mode 100644 index 3fd1b0b84b..0000000000 --- a/ibm/vendor/github.com/googleapis/gax-go/v2/gax.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Package gax contains a set of modules which aid the development of APIs -// for clients and servers based on gRPC and Google API conventions. -// -// Application code will rarely need to use this library directly. -// However, code generated automatically from API definition files can use it -// to simplify code generation and to provide more convenient and idiomatic API surfaces. -package gax - -// Version specifies the gax-go version being used. -const Version = "2.0.4" diff --git a/ibm/vendor/github.com/googleapis/gax-go/v2/header.go b/ibm/vendor/github.com/googleapis/gax-go/v2/header.go deleted file mode 100644 index 139371a0bf..0000000000 --- a/ibm/vendor/github.com/googleapis/gax-go/v2/header.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2018, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import "bytes" - -// XGoogHeader is for use by the Google Cloud Libraries only. -// -// XGoogHeader formats key-value pairs. -// The resulting string is suitable for x-goog-api-client header. -func XGoogHeader(keyval ...string) string { - if len(keyval) == 0 { - return "" - } - if len(keyval)%2 != 0 { - panic("gax.Header: odd argument count") - } - var buf bytes.Buffer - for i := 0; i < len(keyval); i += 2 { - buf.WriteByte(' ') - buf.WriteString(keyval[i]) - buf.WriteByte('/') - buf.WriteString(keyval[i+1]) - } - return buf.String()[1:] -} diff --git a/ibm/vendor/github.com/googleapis/gax-go/v2/invoke.go b/ibm/vendor/github.com/googleapis/gax-go/v2/invoke.go deleted file mode 100644 index fe31dd004e..0000000000 --- a/ibm/vendor/github.com/googleapis/gax-go/v2/invoke.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gax - -import ( - "context" - "strings" - "time" -) - -// APICall is a user defined call stub. -type APICall func(context.Context, CallSettings) error - -// Invoke calls the given APICall, -// performing retries as specified by opts, if any. -func Invoke(ctx context.Context, call APICall, opts ...CallOption) error { - var settings CallSettings - for _, opt := range opts { - opt.Resolve(&settings) - } - return invoke(ctx, call, settings, Sleep) -} - -// Sleep is similar to time.Sleep, but it can be interrupted by ctx.Done() closing. -// If interrupted, Sleep returns ctx.Err(). -func Sleep(ctx context.Context, d time.Duration) error { - t := time.NewTimer(d) - select { - case <-ctx.Done(): - t.Stop() - return ctx.Err() - case <-t.C: - return nil - } -} - -type sleeper func(ctx context.Context, d time.Duration) error - -// invoke implements Invoke, taking an additional sleeper argument for testing. -func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) error { - var retryer Retryer - for { - err := call(ctx, settings) - if err == nil { - return nil - } - if settings.Retry == nil { - return err - } - // Never retry permanent certificate errors. (e.x. if ca-certificates - // are not installed). We should only make very few, targeted - // exceptions: many (other) status=Unavailable should be retried, such - // as if there's a network hiccup, or the internet goes out for a - // minute. This is also why here we are doing string parsing instead of - // simply making Unavailable a non-retried code elsewhere. - if strings.Contains(err.Error(), "x509: certificate signed by unknown authority") { - return err - } - if retryer == nil { - if r := settings.Retry(); r != nil { - retryer = r - } else { - return err - } - } - if d, ok := retryer.Retry(err); !ok { - return err - } else if err = sp(ctx, d); err != nil { - return err - } - } -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/.goreleaser.yml b/ibm/vendor/github.com/hashicorp/go-getter/.goreleaser.yml deleted file mode 100644 index e23ee051fb..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/.goreleaser.yml +++ /dev/null @@ -1,50 +0,0 @@ -env: - - GOPRIVATE=github.com/hashicorp - -builds: - - id: signable - mod_timestamp: '{{ .CommitTimestamp }}' - targets: - - darwin_amd64 - - windows_386 - - windows_amd64 - hooks: - post: | - docker run - -e ARTIFACTORY_TOKEN={{ .Env.ARTIFACTORY_TOKEN }} - -e ARTIFACTORY_USER={{ .Env.ARTIFACTORY_USER }} - -e CIRCLE_TOKEN={{ .Env.CIRCLE_TOKEN }} - -v {{ dir .Path }}:/workdir - {{ .Env.CODESIGN_IMAGE }} - sign -product-name={{ .ProjectName }} {{ .Name }} - dir: ./cmd/go-getter/ - flags: - - -trimpath - ldflags: - - -X main.GitCommit={{ .Commit }} - - mod_timestamp: '{{ .CommitTimestamp }}' - targets: - - linux_386 - - linux_amd64 - dir: ./cmd/go-getter/ - flags: - - -trimpath - ldflags: - - -X main.GitCommit={{ .Commit }} - -archives: - - format: zip - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - files: - - none* - -checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' - algorithm: sha256 - -signs: - - args: ["-u", "{{ .Env.PGP_KEY_ID }}", "--output", "${signature}", "--detach-sign", "${artifact}"] - artifacts: checksum - -changelog: - skip: true diff --git a/ibm/vendor/github.com/hashicorp/go-getter/README.md b/ibm/vendor/github.com/hashicorp/go-getter/README.md deleted file mode 100644 index a27e0f2623..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/README.md +++ /dev/null @@ -1,363 +0,0 @@ -# go-getter - -[![CircleCI](https://circleci.com/gh/hashicorp/go-getter/tree/main.svg?style=svg)][circleci] -[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] - -[circleci]: https://circleci.com/gh/hashicorp/go-getter/tree/main -[godocs]: http://godoc.org/github.com/hashicorp/go-getter - -go-getter is a library for Go (golang) for downloading files or directories -from various sources using a URL as the primary form of input. - -The power of this library is being flexible in being able to download -from a number of different sources (file paths, Git, HTTP, Mercurial, etc.) -using a single string as input. This removes the burden of knowing how to -download from a variety of sources from the implementer. - -The concept of a _detector_ automatically turns invalid URLs into proper -URLs. For example: "github.com/hashicorp/go-getter" would turn into a -Git URL. Or "./foo" would turn into a file URL. These are extensible. - -This library is used by [Terraform](https://terraform.io) for -downloading modules and [Nomad](https://nomadproject.io) for downloading -binaries. - -## Installation and Usage - -Package documentation can be found on -[GoDoc](http://godoc.org/github.com/hashicorp/go-getter). - -Installation can be done with a normal `go get`: - -``` -$ go get github.com/hashicorp/go-getter -``` - -go-getter also has a command you can use to test URL strings: - -``` -$ go install github.com/hashicorp/go-getter/cmd/go-getter -... - -$ go-getter github.com/foo/bar ./foo -... -``` - -The command is useful for verifying URL structures. - -## URL Format - -go-getter uses a single string URL as input to download from a variety of -protocols. go-getter has various "tricks" with this URL to do certain things. -This section documents the URL format. - -### Supported Protocols and Detectors - -**Protocols** are used to download files/directories using a specific -mechanism. Example protocols are Git and HTTP. - -**Detectors** are used to transform a valid or invalid URL into another -URL if it matches a certain pattern. Example: "github.com/user/repo" is -automatically transformed into a fully valid Git URL. This allows go-getter -to be very user friendly. - -go-getter out of the box supports the following protocols. Additional protocols -can be augmented at runtime by implementing the `Getter` interface. - - * Local files - * Git - * Mercurial - * HTTP - * Amazon S3 - * Google GCP - -In addition to the above protocols, go-getter has what are called "detectors." -These take a URL and attempt to automatically choose the best protocol for -it, which might involve even changing the protocol. The following detection -is built-in by default: - - * File paths such as "./foo" are automatically changed to absolute - file URLs. - * GitHub URLs, such as "github.com/mitchellh/vagrant" are automatically - changed to Git protocol over HTTP. - * GitLab URLs, such as "gitlab.com/inkscape/inkscape" are automatically - changed to Git protocol over HTTP. - * BitBucket URLs, such as "bitbucket.org/mitchellh/vagrant" are automatically - changed to a Git or mercurial protocol using the BitBucket API. - -### Forced Protocol - -In some cases, the protocol to use is ambiguous depending on the source -URL. For example, "http://github.com/mitchellh/vagrant.git" could reference -an HTTP URL or a Git URL. Forced protocol syntax is used to disambiguate this -URL. - -Forced protocol can be done by prefixing the URL with the protocol followed -by double colons. For example: `git::http://github.com/mitchellh/vagrant.git` -would download the given HTTP URL using the Git protocol. - -Forced protocols will also override any detectors. - -In the absence of a forced protocol, detectors may be run on the URL, transforming -the protocol anyways. The above example would've used the Git protocol either -way since the Git detector would've detected it was a GitHub URL. - -### Protocol-Specific Options - -Each protocol can support protocol-specific options to configure that -protocol. For example, the `git` protocol supports specifying a `ref` -query parameter that tells it what ref to checkout for that Git -repository. - -The options are specified as query parameters on the URL (or URL-like string) -given to go-getter. Using the Git example above, the URL below is a valid -input to go-getter: - - github.com/hashicorp/go-getter?ref=abcd1234 - -The protocol-specific options are documented below the URL format -section. But because they are part of the URL, we point it out here so -you know they exist. - -### Subdirectories - -If you want to download only a specific subdirectory from a downloaded -directory, you can specify a subdirectory after a double-slash `//`. -go-getter will first download the URL specified _before_ the double-slash -(as if you didn't specify a double-slash), but will then copy the -path after the double slash into the target directory. - -For example, if you're downloading this GitHub repository, but you only -want to download the `testdata` directory, you can do the following: - -``` -https://github.com/hashicorp/go-getter.git//testdata -``` - -If you downloaded this to the `/tmp` directory, then the file -`/tmp/archive.gz` would exist. Notice that this file is in the `testdata` -directory in this repository, but because we specified a subdirectory, -go-getter automatically copied only that directory contents. - -Subdirectory paths may also use filesystem glob patterns. The path must -match _exactly one_ entry or go-getter will return an error. -This is useful if you're not sure the exact directory name but it follows -a predictable naming structure. - -For example, the following URL would also work: - -``` -https://github.com/hashicorp/go-getter.git//test-* -``` - -### Checksumming - -For file downloads of any protocol, go-getter can automatically verify -a checksum for you. Note that checksumming only works for downloading files, -not directories, but checksumming will work for any protocol. - -To checksum a file, append a `checksum` query parameter to the URL. go-getter -will parse out this query parameter automatically and use it to verify the -checksum. The parameter value can be in the format of `type:value` or just -`value`, where type is "md5", "sha1", "sha256", "sha512" or "file" . The -"value" should be the actual checksum value or download URL for "file". When -`type` part is omitted, type will be guessed based on the length of the -checksum string. Examples: - -``` -./foo.txt?checksum=md5:b7d96c89d09d9e204f5fedc4d5d55b21 -``` - -``` -./foo.txt?checksum=b7d96c89d09d9e204f5fedc4d5d55b21 -``` - -``` -./foo.txt?checksum=file:./foo.txt.sha256sum -``` - -When checksumming from a file - ex: with `checksum=file:url` - go-getter will -get the file linked in the URL after `file:` using the same configuration. For -example, in `file:http://releases.ubuntu.com/cosmic/MD5SUMS` go-getter will -download a checksum file under the aforementioned url using the http protocol. -All protocols supported by go-getter can be used. The checksum file will be -downloaded in a temporary file then parsed. The destination of the temporary -file can be changed by setting system specific environment variables: `TMPDIR` -for unix; `TMP`, `TEMP` or `USERPROFILE` on windows. Read godoc of -[os.TempDir](https://golang.org/pkg/os/#TempDir) for more information on the -temporary directory selection. Content of files are expected to be BSD or GNU -style. Once go-getter is done with the checksum file; it is deleted. - -The checksum query parameter is never sent to the backend protocol -implementation. It is used at a higher level by go-getter itself. - -If the destination file exists and the checksums match: download -will be skipped. - -### Unarchiving - -go-getter will automatically unarchive files into a file or directory -based on the extension of the file being requested (over any protocol). -This works for both file and directory downloads. - -go-getter looks for an `archive` query parameter to specify the format of -the archive. If this isn't specified, go-getter will use the extension of -the path to see if it appears archived. Unarchiving can be explicitly -disabled by setting the `archive` query parameter to `false`. - -The following archive formats are supported: - - * `tar.gz` and `tgz` - * `tar.bz2` and `tbz2` - * `tar.xz` and `txz` - * `zip` - * `gz` - * `bz2` - * `xz` - -For example, an example URL is shown below: - -``` -./foo.zip -``` - -This will automatically be inferred to be a ZIP file and will be extracted. -You can also be explicit about the archive type: - -``` -./some/other/path?archive=zip -``` - -And finally, you can disable archiving completely: - -``` -./some/path?archive=false -``` - -You can combine unarchiving with the other features of go-getter such -as checksumming. The special `archive` query parameter will be removed -from the URL before going to the final protocol downloader. - -## Protocol-Specific Options - -This section documents the protocol-specific options that can be specified for -go-getter. These options should be appended to the input as normal query -parameters ([HTTP headers](#headers) are an exception to this, however). -Depending on the usage of go-getter, applications may provide alternate ways of -inputting options. For example, [Nomad](https://www.nomadproject.io) provides a -nice options block for specifying options rather than in the URL. - -## General (All Protocols) - -The options below are available to all protocols: - - * `archive` - The archive format to use to unarchive this file, or "" (empty - string) to disable unarchiving. For more details, see the complete section - on archive support above. - - * `checksum` - Checksum to verify the downloaded file or archive. See - the entire section on checksumming above for format and more details. - - * `filename` - When in file download mode, allows specifying the name of the - downloaded file on disk. Has no effect in directory mode. - -### Local Files (`file`) - -None - -### Git (`git`) - - * `ref` - The Git ref to checkout. This is a ref, so it can point to - a commit SHA, a branch name, etc. If it is a named ref such as a branch - name, go-getter will update it to the latest on each get. - - * `sshkey` - An SSH private key to use during clones. The provided key must - be a base64-encoded string. For example, to generate a suitable `sshkey` - from a private key file on disk, you would run `base64 -w0 `. - - **Note**: Git 2.3+ is required to use this feature. - - * `depth` - The Git clone depth. The provided number specifies the last `n` - revisions to clone from the repository. - - -The `git` getter accepts both URL-style SSH addresses like -`git::ssh://git@example.com/foo/bar`, and "scp-style" addresses like -`git::git@example.com/foo/bar`. In the latter case, omitting the `git::` -force prefix is allowed if the username prefix is exactly `git@`. - -The "scp-style" addresses _cannot_ be used in conjunction with the `ssh://` -scheme prefix, because in that case the colon is used to mark an optional -port number to connect on, rather than to delimit the path from the host. - -### Mercurial (`hg`) - - * `rev` - The Mercurial revision to checkout. - -### HTTP (`http`) - -#### Basic Authentication - -To use HTTP basic authentication with go-getter, simply prepend `username:password@` to the -hostname in the URL such as `https://Aladdin:OpenSesame@www.example.com/index.html`. All special -characters, including the username and password, must be URL encoded. - -#### Headers - -Optional request headers can be added by supplying them in a custom -[`HttpGetter`](https://godoc.org/github.com/hashicorp/go-getter#HttpGetter) -(_not_ as query parameters like most other options). These headers will be sent -out on every request the getter in question makes. - -### S3 (`s3`) - -S3 takes various access configurations in the URL. Note that it will also -read these from standard AWS environment variables if they're set. S3 compliant servers like Minio -are also supported. If the query parameters are present, these take priority. - - * `aws_access_key_id` - AWS access key. - * `aws_access_key_secret` - AWS access key secret. - * `aws_access_token` - AWS access token if this is being used. - * `aws_profile` - Use this profile from local ~/.aws/ config. Takes priority over the other three. - -#### Using IAM Instance Profiles with S3 - -If you use go-getter and want to use an EC2 IAM Instance Profile to avoid -using credentials, then just omit these and the profile, if available will -be used automatically. - -### Using S3 with Minio - If you use go-gitter for Minio support, you must consider the following: - - * `aws_access_key_id` (required) - Minio access key. - * `aws_access_key_secret` (required) - Minio access key secret. - * `region` (optional - defaults to us-east-1) - Region identifier to use. - * `version` (optional - defaults to Minio default) - Configuration file format. - -#### S3 Bucket Examples - -S3 has several addressing schemes used to reference your bucket. These are -listed here: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro - -Some examples for these addressing schemes: -- s3::https://s3.amazonaws.com/bucket/foo -- s3::https://s3-eu-west-1.amazonaws.com/bucket/foo -- bucket.s3.amazonaws.com/foo -- bucket.s3-eu-west-1.amazonaws.com/foo/bar -- "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=KEYID&aws_access_key_secret=SECRETKEY®ion=us-east-2" - -### GCS (`gcs`) - -#### GCS Authentication - -In order to access to GCS, authentication credentials should be provided. More information can be found [here](https://cloud.google.com/docs/authentication/getting-started) - -#### GCS Bucket Examples - -- gcs::https://www.googleapis.com/storage/v1/bucket -- gcs::https://www.googleapis.com/storage/v1/bucket/foo.zip -- www.googleapis.com/storage/v1/bucket/foo - -#### GCS Testing - -The tests for `get_gcs.go` require you to have GCP credentials set in your environment. These credentials can have any level of permissions to any project, they just need to exist. This means setting `GOOGLE_APPLICATION_CREDENTIALS="~/path/to/credentials.json"` or `GOOGLE_CREDENTIALS="{stringified-credentials-json}"`. Due to this configuration, `get_gcs_test.go` will fail for external contributors in CircleCI. diff --git a/ibm/vendor/github.com/hashicorp/go-getter/checksum.go b/ibm/vendor/github.com/hashicorp/go-getter/checksum.go deleted file mode 100644 index f1090839fb..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/checksum.go +++ /dev/null @@ -1,317 +0,0 @@ -package getter - -import ( - "bufio" - "bytes" - "crypto/md5" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "encoding/hex" - "fmt" - "hash" - "io" - "net/url" - "os" - "path/filepath" - "strings" - - urlhelper "github.com/hashicorp/go-getter/helper/url" -) - -// FileChecksum helps verifying the checksum for a file. -type FileChecksum struct { - Type string - Hash hash.Hash - Value []byte - Filename string -} - -// A ChecksumError is returned when a checksum differs -type ChecksumError struct { - Hash hash.Hash - Actual []byte - Expected []byte - File string -} - -func (cerr *ChecksumError) Error() string { - if cerr == nil { - return "" - } - return fmt.Sprintf( - "Checksums did not match for %s.\nExpected: %s\nGot: %s\n%T", - cerr.File, - hex.EncodeToString(cerr.Expected), - hex.EncodeToString(cerr.Actual), - cerr.Hash, // ex: *sha256.digest - ) -} - -// checksum is a simple method to compute the checksum of a source file -// and compare it to the given expected value. -func (c *FileChecksum) checksum(source string) error { - f, err := os.Open(source) - if err != nil { - return fmt.Errorf("Failed to open file for checksum: %s", err) - } - defer f.Close() - - c.Hash.Reset() - if _, err := io.Copy(c.Hash, f); err != nil { - return fmt.Errorf("Failed to hash: %s", err) - } - - if actual := c.Hash.Sum(nil); !bytes.Equal(actual, c.Value) { - return &ChecksumError{ - Hash: c.Hash, - Actual: actual, - Expected: c.Value, - File: source, - } - } - - return nil -} - -// extractChecksum will return a FileChecksum based on the 'checksum' -// parameter of u. -// ex: -// http://hashicorp.com/terraform?checksum= -// http://hashicorp.com/terraform?checksum=: -// http://hashicorp.com/terraform?checksum=file: -// when checksumming from a file, extractChecksum will go get checksum_url -// in a temporary directory, parse the content of the file then delete it. -// Content of files are expected to be BSD style or GNU style. -// -// BSD-style checksum: -// MD5 (file1) = -// MD5 (file2) = -// -// GNU-style: -// file1 -// *file2 -// -// see parseChecksumLine for more detail on checksum file parsing -func (c *Client) extractChecksum(u *url.URL) (*FileChecksum, error) { - q := u.Query() - v := q.Get("checksum") - - if v == "" { - return nil, nil - } - - vs := strings.SplitN(v, ":", 2) - switch len(vs) { - case 2: - break // good - default: - // here, we try to guess the checksum from it's length - // if the type was not passed - return newChecksumFromValue(v, filepath.Base(u.EscapedPath())) - } - - checksumType, checksumValue := vs[0], vs[1] - - switch checksumType { - case "file": - return c.ChecksumFromFile(checksumValue, u) - default: - return newChecksumFromType(checksumType, checksumValue, filepath.Base(u.EscapedPath())) - } -} - -func newChecksum(checksumValue, filename string) (*FileChecksum, error) { - c := &FileChecksum{ - Filename: filename, - } - var err error - c.Value, err = hex.DecodeString(checksumValue) - if err != nil { - return nil, fmt.Errorf("invalid checksum: %s", err) - } - return c, nil -} - -func newChecksumFromType(checksumType, checksumValue, filename string) (*FileChecksum, error) { - c, err := newChecksum(checksumValue, filename) - if err != nil { - return nil, err - } - - c.Type = strings.ToLower(checksumType) - switch c.Type { - case "md5": - c.Hash = md5.New() - case "sha1": - c.Hash = sha1.New() - case "sha256": - c.Hash = sha256.New() - case "sha512": - c.Hash = sha512.New() - default: - return nil, fmt.Errorf( - "unsupported checksum type: %s", checksumType) - } - - return c, nil -} - -func newChecksumFromValue(checksumValue, filename string) (*FileChecksum, error) { - c, err := newChecksum(checksumValue, filename) - if err != nil { - return nil, err - } - - switch len(c.Value) { - case md5.Size: - c.Hash = md5.New() - c.Type = "md5" - case sha1.Size: - c.Hash = sha1.New() - c.Type = "sha1" - case sha256.Size: - c.Hash = sha256.New() - c.Type = "sha256" - case sha512.Size: - c.Hash = sha512.New() - c.Type = "sha512" - default: - return nil, fmt.Errorf("Unknown type for checksum %s", checksumValue) - } - - return c, nil -} - -// ChecksumFromFile will return all the FileChecksums found in file -// -// ChecksumFromFile will try to guess the hashing algorithm based on content -// of checksum file -// -// ChecksumFromFile will only return checksums for files that match file -// behind src -func (c *Client) ChecksumFromFile(checksumFile string, src *url.URL) (*FileChecksum, error) { - checksumFileURL, err := urlhelper.Parse(checksumFile) - if err != nil { - return nil, err - } - - tempfile, err := tmpFile("", filepath.Base(checksumFileURL.Path)) - if err != nil { - return nil, err - } - defer os.Remove(tempfile) - - c2 := &Client{ - Ctx: c.Ctx, - Getters: c.Getters, - Decompressors: c.Decompressors, - Detectors: c.Detectors, - Pwd: c.Pwd, - Dir: false, - Src: checksumFile, - Dst: tempfile, - ProgressListener: c.ProgressListener, - } - if err = c2.Get(); err != nil { - return nil, fmt.Errorf( - "Error downloading checksum file: %s", err) - } - - filename := filepath.Base(src.Path) - absPath, err := filepath.Abs(src.Path) - if err != nil { - return nil, err - } - checksumFileDir := filepath.Dir(checksumFileURL.Path) - relpath, err := filepath.Rel(checksumFileDir, absPath) - switch { - case err == nil || - err.Error() == "Rel: can't make "+absPath+" relative to "+checksumFileDir: - // ex: on windows C:\gopath\...\content.txt cannot be relative to \ - // which is okay, may be another expected path will work. - break - default: - return nil, err - } - - // possible file identifiers: - options := []string{ - filename, // ubuntu-14.04.1-server-amd64.iso - "*" + filename, // *ubuntu-14.04.1-server-amd64.iso Standard checksum - "?" + filename, // ?ubuntu-14.04.1-server-amd64.iso shasum -p - relpath, // dir/ubuntu-14.04.1-server-amd64.iso - "./" + relpath, // ./dir/ubuntu-14.04.1-server-amd64.iso - absPath, // fullpath; set if local - } - - f, err := os.Open(tempfile) - if err != nil { - return nil, fmt.Errorf( - "Error opening downloaded file: %s", err) - } - defer f.Close() - rd := bufio.NewReader(f) - for { - line, err := rd.ReadString('\n') - if err != nil { - if err != io.EOF { - return nil, fmt.Errorf( - "Error reading checksum file: %s", err) - } - if line == "" { - break - } - // parse the line, if we hit EOF, but the line is not empty - } - checksum, err := parseChecksumLine(line) - if err != nil || checksum == nil { - continue - } - if checksum.Filename == "" { - // filename not sure, let's try - return checksum, nil - } - // make sure the checksum is for the right file - for _, option := range options { - if option != "" && checksum.Filename == option { - // any checksum will work so we return the first one - return checksum, nil - } - } - } - return nil, fmt.Errorf("no checksum found in: %s", checksumFile) -} - -// parseChecksumLine takes a line from a checksum file and returns -// checksumType, checksumValue and filename parseChecksumLine guesses the style -// of the checksum BSD vs GNU by splitting the line and by counting the parts. -// of a line. -// for BSD type sums parseChecksumLine guesses the hashing algorithm -// by checking the length of the checksum. -func parseChecksumLine(line string) (*FileChecksum, error) { - parts := strings.Fields(line) - - switch len(parts) { - case 4: - // BSD-style checksum: - // MD5 (file1) = - // MD5 (file2) = - if len(parts[1]) <= 2 || - parts[1][0] != '(' || parts[1][len(parts[1])-1] != ')' { - return nil, fmt.Errorf( - "Unexpected BSD-style-checksum filename format: %s", line) - } - filename := parts[1][1 : len(parts[1])-1] - return newChecksumFromType(parts[0], parts[3], filename) - case 2: - // GNU-style: - // file1 - // *file2 - return newChecksumFromValue(parts[0], parts[1]) - case 0: - return nil, nil // empty line - default: - return newChecksumFromValue(parts[0], "") - } -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/client.go b/ibm/vendor/github.com/hashicorp/go-getter/client.go deleted file mode 100644 index 78a96bf0be..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/client.go +++ /dev/null @@ -1,316 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" - - urlhelper "github.com/hashicorp/go-getter/helper/url" - safetemp "github.com/hashicorp/go-safetemp" -) - -// Client is a client for downloading things. -// -// Top-level functions such as Get are shortcuts for interacting with a client. -// Using a client directly allows more fine-grained control over how downloading -// is done, as well as customizing the protocols supported. -type Client struct { - // Ctx for cancellation - Ctx context.Context - - // Src is the source URL to get. - // - // Dst is the path to save the downloaded thing as. If Dir is set to - // true, then this should be a directory. If the directory doesn't exist, - // it will be created for you. - // - // Pwd is the working directory for detection. If this isn't set, some - // detection may fail. Client will not default pwd to the current - // working directory for security reasons. - Src string - Dst string - Pwd string - - // Mode is the method of download the client will use. See ClientMode - // for documentation. - Mode ClientMode - - // Umask is used to mask file permissions when storing local files or decompressing - // an archive - Umask os.FileMode - - // Detectors is the list of detectors that are tried on the source. - // If this is nil, then the default Detectors will be used. - Detectors []Detector - - // Decompressors is the map of decompressors supported by this client. - // If this is nil, then the default value is the Decompressors global. - Decompressors map[string]Decompressor - - // Getters is the map of protocols supported by this client. If this - // is nil, then the default Getters variable will be used. - Getters map[string]Getter - - // Dir, if true, tells the Client it is downloading a directory (versus - // a single file). This distinction is necessary since filenames and - // directory names follow the same format so disambiguating is impossible - // without knowing ahead of time. - // - // WARNING: deprecated. If Mode is set, that will take precedence. - Dir bool - - // ProgressListener allows to track file downloads. - // By default a no op progress listener is used. - ProgressListener ProgressTracker - - Options []ClientOption -} - -// umask returns the effective umask for the Client, defaulting to the process umask -func (c *Client) umask() os.FileMode { - if c == nil { - return 0 - } - return c.Umask -} - -// mode returns file mode umasked by the Client umask -func (c *Client) mode(mode os.FileMode) os.FileMode { - m := mode & ^c.umask() - return m -} - -// Get downloads the configured source to the destination. -func (c *Client) Get() error { - if err := c.Configure(c.Options...); err != nil { - return err - } - - // Store this locally since there are cases we swap this - mode := c.Mode - if mode == ClientModeInvalid { - if c.Dir { - mode = ClientModeDir - } else { - mode = ClientModeFile - } - } - - src, err := Detect(c.Src, c.Pwd, c.Detectors) - if err != nil { - return err - } - - // Determine if we have a forced protocol, i.e. "git::http://..." - force, src := getForcedGetter(src) - - // If there is a subdir component, then we download the root separately - // and then copy over the proper subdir. - var realDst string - dst := c.Dst - src, subDir := SourceDirSubdir(src) - if subDir != "" { - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - realDst = dst - dst = td - } - - u, err := urlhelper.Parse(src) - if err != nil { - return err - } - if force == "" { - force = u.Scheme - } - - g, ok := c.Getters[force] - if !ok { - return fmt.Errorf( - "download not supported for scheme '%s'", force) - } - - // We have magic query parameters that we use to signal different features - q := u.Query() - - // Determine if we have an archive type - archiveV := q.Get("archive") - if archiveV != "" { - // Delete the paramter since it is a magic parameter we don't - // want to pass on to the Getter - q.Del("archive") - u.RawQuery = q.Encode() - - // If we can parse the value as a bool and it is false, then - // set the archive to "-" which should never map to a decompressor - if b, err := strconv.ParseBool(archiveV); err == nil && !b { - archiveV = "-" - } - } - if archiveV == "" { - // We don't appear to... but is it part of the filename? - matchingLen := 0 - for k := range c.Decompressors { - if strings.HasSuffix(u.Path, "."+k) && len(k) > matchingLen { - archiveV = k - matchingLen = len(k) - } - } - } - - // If we have a decompressor, then we need to change the destination - // to download to a temporary path. We unarchive this into the final, - // real path. - var decompressDst string - var decompressDir bool - decompressor := c.Decompressors[archiveV] - if decompressor != nil { - // Create a temporary directory to store our archive. We delete - // this at the end of everything. - td, err := ioutil.TempDir("", "getter") - if err != nil { - return fmt.Errorf( - "Error creating temporary directory for archive: %s", err) - } - defer os.RemoveAll(td) - - // Swap the download directory to be our temporary path and - // store the old values. - decompressDst = dst - decompressDir = mode != ClientModeFile - dst = filepath.Join(td, "archive") - mode = ClientModeFile - } - - // Determine checksum if we have one - checksum, err := c.extractChecksum(u) - if err != nil { - return fmt.Errorf("invalid checksum: %s", err) - } - - // Delete the query parameter if we have it. - q.Del("checksum") - u.RawQuery = q.Encode() - - if mode == ClientModeAny { - // Ask the getter which client mode to use - mode, err = g.ClientMode(u) - if err != nil { - return err - } - - // Destination is the base name of the URL path in "any" mode when - // a file source is detected. - if mode == ClientModeFile { - filename := filepath.Base(u.Path) - - // Determine if we have a custom file name - if v := q.Get("filename"); v != "" { - // Delete the query parameter if we have it. - q.Del("filename") - u.RawQuery = q.Encode() - - filename = v - } - - dst = filepath.Join(dst, filename) - } - } - - // If we're not downloading a directory, then just download the file - // and return. - if mode == ClientModeFile { - getFile := true - if checksum != nil { - if err := checksum.checksum(dst); err == nil { - // don't get the file if the checksum of dst is correct - getFile = false - } - } - if getFile { - err := g.GetFile(dst, u) - if err != nil { - return err - } - - if checksum != nil { - if err := checksum.checksum(dst); err != nil { - return err - } - } - } - - if decompressor != nil { - // We have a decompressor, so decompress the current destination - // into the final destination with the proper mode. - err := decompressor.Decompress(decompressDst, dst, decompressDir, c.umask()) - if err != nil { - return err - } - - // Swap the information back - dst = decompressDst - if decompressDir { - mode = ClientModeAny - } else { - mode = ClientModeFile - } - } - - // We check the dir value again because it can be switched back - // if we were unarchiving. If we're still only Get-ing a file, then - // we're done. - if mode == ClientModeFile { - return nil - } - } - - // If we're at this point we're either downloading a directory or we've - // downloaded and unarchived a directory and we're just checking subdir. - // In the case we have a decompressor we don't Get because it was Get - // above. - if decompressor == nil { - // If we're getting a directory, then this is an error. You cannot - // checksum a directory. TODO: test - if checksum != nil { - return fmt.Errorf( - "checksum cannot be specified for directory download") - } - - // We're downloading a directory, which might require a bit more work - // if we're specifying a subdir. - err := g.Get(dst, u) - if err != nil { - err = fmt.Errorf("error downloading '%s': %s", src, err) - return err - } - } - - // If we have a subdir, copy that over - if subDir != "" { - if err := os.RemoveAll(realDst); err != nil { - return err - } - if err := os.MkdirAll(realDst, c.mode(0755)); err != nil { - return err - } - - // Process any globs - subDir, err := SubdirGlob(dst, subDir) - if err != nil { - return err - } - - return copyDir(c.Ctx, realDst, subDir, false, c.umask()) - } - - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/client_mode.go b/ibm/vendor/github.com/hashicorp/go-getter/client_mode.go deleted file mode 100644 index 7f02509a78..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/client_mode.go +++ /dev/null @@ -1,24 +0,0 @@ -package getter - -// ClientMode is the mode that the client operates in. -type ClientMode uint - -const ( - ClientModeInvalid ClientMode = iota - - // ClientModeAny downloads anything it can. In this mode, dst must - // be a directory. If src is a file, it is saved into the directory - // with the basename of the URL. If src is a directory or archive, - // it is unpacked directly into dst. - ClientModeAny - - // ClientModeFile downloads a single file. In this mode, dst must - // be a file path (doesn't have to exist). src must point to a single - // file. It is saved as dst. - ClientModeFile - - // ClientModeDir downloads a directory. In this mode, dst must be - // a directory path (doesn't have to exist). src must point to an - // archive or directory (such as in s3). - ClientModeDir -) diff --git a/ibm/vendor/github.com/hashicorp/go-getter/client_option.go b/ibm/vendor/github.com/hashicorp/go-getter/client_option.go deleted file mode 100644 index c1ee413b05..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/client_option.go +++ /dev/null @@ -1,46 +0,0 @@ -package getter - -import "context" - -// A ClientOption allows to configure a client -type ClientOption func(*Client) error - -// Configure configures a client with options. -func (c *Client) Configure(opts ...ClientOption) error { - if c.Ctx == nil { - c.Ctx = context.Background() - } - c.Options = opts - for _, opt := range opts { - err := opt(c) - if err != nil { - return err - } - } - // Default decompressor values - if c.Decompressors == nil { - c.Decompressors = Decompressors - } - // Default detector values - if c.Detectors == nil { - c.Detectors = Detectors - } - // Default getter values - if c.Getters == nil { - c.Getters = Getters - } - - for _, getter := range c.Getters { - getter.SetClient(c) - } - return nil -} - -// WithContext allows to pass a context to operation -// in order to be able to cancel a download in progress. -func WithContext(ctx context.Context) func(*Client) error { - return func(c *Client) error { - c.Ctx = ctx - return nil - } -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/client_option_progress.go b/ibm/vendor/github.com/hashicorp/go-getter/client_option_progress.go deleted file mode 100644 index 9b185f71de..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/client_option_progress.go +++ /dev/null @@ -1,38 +0,0 @@ -package getter - -import ( - "io" -) - -// WithProgress allows for a user to track -// the progress of a download. -// For example by displaying a progress bar with -// current download. -// Not all getters have progress support yet. -func WithProgress(pl ProgressTracker) func(*Client) error { - return func(c *Client) error { - c.ProgressListener = pl - return nil - } -} - -// ProgressTracker allows to track the progress of downloads. -type ProgressTracker interface { - // TrackProgress should be called when - // a new object is being downloaded. - // src is the location the file is - // downloaded from. - // currentSize is the current size of - // the file in case it is a partial - // download. - // totalSize is the total size in bytes, - // size can be zero if the file size - // is not known. - // stream is the file being downloaded, every - // written byte will add up to processed size. - // - // TrackProgress returns a ReadCloser that wraps the - // download in progress ( stream ). - // When the download is finished, body shall be closed. - TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/common.go b/ibm/vendor/github.com/hashicorp/go-getter/common.go deleted file mode 100644 index d2afd8ad88..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/common.go +++ /dev/null @@ -1,14 +0,0 @@ -package getter - -import ( - "io/ioutil" -) - -func tmpFile(dir, pattern string) (string, error) { - f, err := ioutil.TempFile(dir, pattern) - if err != nil { - return "", err - } - f.Close() - return f.Name(), nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/copy_dir.go b/ibm/vendor/github.com/hashicorp/go-getter/copy_dir.go deleted file mode 100644 index a629306b7f..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/copy_dir.go +++ /dev/null @@ -1,67 +0,0 @@ -package getter - -import ( - "context" - "os" - "path/filepath" - "strings" -) - -// mode returns the file mode masked by the umask -func mode(mode, umask os.FileMode) os.FileMode { - return mode & ^umask -} - -// copyDir copies the src directory contents into dst. Both directories -// should already exist. -// -// If ignoreDot is set to true, then dot-prefixed files/folders are ignored. -func copyDir(ctx context.Context, dst string, src string, ignoreDot bool, umask os.FileMode) error { - src, err := filepath.EvalSymlinks(src) - if err != nil { - return err - } - - walkFn := func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if path == src { - return nil - } - - if ignoreDot && strings.HasPrefix(filepath.Base(path), ".") { - // Skip any dot files - if info.IsDir() { - return filepath.SkipDir - } else { - return nil - } - } - - // The "path" has the src prefixed to it. We need to join our - // destination with the path without the src on it. - dstPath := filepath.Join(dst, path[len(src):]) - - // If we have a directory, make that subdirectory, then continue - // the walk. - if info.IsDir() { - if path == filepath.Join(src, dst) { - // dst is in src; don't walk it. - return nil - } - - if err := os.MkdirAll(dstPath, mode(0755, umask)); err != nil { - return err - } - - return nil - } - - // If we have a file, copy the contents. - _, err = copyFile(ctx, dstPath, path, info.Mode(), umask) - return err - } - - return filepath.Walk(src, walkFn) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress.go deleted file mode 100644 index d0ad439003..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress.go +++ /dev/null @@ -1,63 +0,0 @@ -package getter - -import ( - "os" - "strings" -) - -// Decompressor defines the interface that must be implemented to add -// support for decompressing a type. -// -// Important: if you're implementing a decompressor, please use the -// containsDotDot helper in this file to ensure that files can't be -// decompressed outside of the specified directory. -type Decompressor interface { - // Decompress should decompress src to dst. dir specifies whether dst - // is a directory or single file. src is guaranteed to be a single file - // that exists. dst is not guaranteed to exist already. - Decompress(dst, src string, dir bool, umask os.FileMode) error -} - -// Decompressors is the mapping of extension to the Decompressor implementation -// that will decompress that extension/type. -var Decompressors map[string]Decompressor - -func init() { - tbzDecompressor := new(TarBzip2Decompressor) - tgzDecompressor := new(TarGzipDecompressor) - txzDecompressor := new(TarXzDecompressor) - tzstDecompressor := new(TarZstdDecompressor) - - Decompressors = map[string]Decompressor{ - "bz2": new(Bzip2Decompressor), - "gz": new(GzipDecompressor), - "xz": new(XzDecompressor), - "tar.bz2": tbzDecompressor, - "tar.gz": tgzDecompressor, - "tar.xz": txzDecompressor, - "tar.zst": tzstDecompressor, - "tbz2": tbzDecompressor, - "tgz": tgzDecompressor, - "txz": txzDecompressor, - "tzst": tzstDecompressor, - "zip": new(ZipDecompressor), - "zst": new(ZstdDecompressor), - } -} - -// containsDotDot checks if the filepath value v contains a ".." entry. -// This will check filepath components by splitting along / or \. This -// function is copied directly from the Go net/http implementation. -func containsDotDot(v string) bool { - if !strings.Contains(v, "..") { - return false - } - for _, ent := range strings.FieldsFunc(v, isSlashRune) { - if ent == ".." { - return true - } - } - return false -} - -func isSlashRune(r rune) bool { return r == '/' || r == '\\' } diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_bzip2.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_bzip2.go deleted file mode 100644 index a5373e4e1d..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_bzip2.go +++ /dev/null @@ -1,37 +0,0 @@ -package getter - -import ( - "compress/bzip2" - "fmt" - "os" - "path/filepath" -) - -// Bzip2Decompressor is an implementation of Decompressor that can -// decompress bz2 files. -type Bzip2Decompressor struct{} - -func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // Directory isn't supported at all - if dir { - return fmt.Errorf("bzip2-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Bzip2 compression is second - bzipR := bzip2.NewReader(f) - - // Copy it out - return copyReader(dst, bzipR, 0622, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_gzip.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_gzip.go deleted file mode 100644 index 669e5eafdf..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_gzip.go +++ /dev/null @@ -1,41 +0,0 @@ -package getter - -import ( - "compress/gzip" - "fmt" - "os" - "path/filepath" -) - -// GzipDecompressor is an implementation of Decompressor that can -// decompress gzip files. -type GzipDecompressor struct{} - -func (d *GzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // Directory isn't supported at all - if dir { - return fmt.Errorf("gzip-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // gzip compression is second - gzipR, err := gzip.NewReader(f) - if err != nil { - return err - } - defer gzipR.Close() - - // Copy it out - return copyReader(dst, gzipR, 0622, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tar.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_tar.go deleted file mode 100644 index 4b58b036a1..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tar.go +++ /dev/null @@ -1,150 +0,0 @@ -package getter - -import ( - "archive/tar" - "fmt" - "io" - "os" - "path/filepath" - "time" -) - -// untar is a shared helper for untarring an archive. The reader should provide -// an uncompressed view of the tar archive. -func untar(input io.Reader, dst, src string, dir bool, umask os.FileMode) error { - tarR := tar.NewReader(input) - done := false - dirHdrs := []*tar.Header{} - now := time.Now() - for { - hdr, err := tarR.Next() - if err == io.EOF { - if !done { - // Empty archive - return fmt.Errorf("empty archive: %s", src) - } - - break - } - if err != nil { - return err - } - - if hdr.Typeflag == tar.TypeXGlobalHeader || hdr.Typeflag == tar.TypeXHeader { - // don't unpack extended headers as files - continue - } - - path := dst - if dir { - // Disallow parent traversal - if containsDotDot(hdr.Name) { - return fmt.Errorf("entry contains '..': %s", hdr.Name) - } - - path = filepath.Join(path, hdr.Name) - } - - if hdr.FileInfo().IsDir() { - if !dir { - return fmt.Errorf("expected a single file: %s", src) - } - - // A directory, just make the directory and continue unarchiving... - if err := os.MkdirAll(path, mode(0755, umask)); err != nil { - return err - } - - // Record the directory information so that we may set its attributes - // after all files have been extracted - dirHdrs = append(dirHdrs, hdr) - - continue - } else { - // There is no ordering guarantee that a file in a directory is - // listed before the directory - dstPath := filepath.Dir(path) - - // Check that the directory exists, otherwise create it - if _, err := os.Stat(dstPath); os.IsNotExist(err) { - if err := os.MkdirAll(dstPath, mode(0755, umask)); err != nil { - return err - } - } - } - - // We have a file. If we already decoded, then it is an error - if !dir && done { - return fmt.Errorf("expected a single file, got multiple: %s", src) - } - - // Mark that we're done so future in single file mode errors - done = true - - // Open the file for writing - err = copyReader(path, tarR, hdr.FileInfo().Mode(), umask) - if err != nil { - return err - } - - // Set the access and modification time if valid, otherwise default to current time - aTime := now - mTime := now - if hdr.AccessTime.Unix() > 0 { - aTime = hdr.AccessTime - } - if hdr.ModTime.Unix() > 0 { - mTime = hdr.ModTime - } - if err := os.Chtimes(path, aTime, mTime); err != nil { - return err - } - } - - // Perform a final pass over extracted directories to update metadata - for _, dirHdr := range dirHdrs { - path := filepath.Join(dst, dirHdr.Name) - // Chmod the directory since they might be created before we know the mode flags - if err := os.Chmod(path, mode(dirHdr.FileInfo().Mode(), umask)); err != nil { - return err - } - // Set the mtime/atime attributes since they would have been changed during extraction - aTime := now - mTime := now - if dirHdr.AccessTime.Unix() > 0 { - aTime = dirHdr.AccessTime - } - if dirHdr.ModTime.Unix() > 0 { - mTime = dirHdr.ModTime - } - if err := os.Chtimes(path, aTime, mTime); err != nil { - return err - } - } - - return nil -} - -// tarDecompressor is an implementation of Decompressor that can -// unpack tar files. -type tarDecompressor struct{} - -func (d *tarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - return untar(f, dst, src, dir, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go deleted file mode 100644 index e2e5458c9d..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tbz2.go +++ /dev/null @@ -1,33 +0,0 @@ -package getter - -import ( - "compress/bzip2" - "os" - "path/filepath" -) - -// TarBzip2Decompressor is an implementation of Decompressor that can -// decompress tar.bz2 files. -type TarBzip2Decompressor struct{} - -func (d *TarBzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Bzip2 compression is second - bzipR := bzip2.NewReader(f) - return untar(bzipR, dst, src, dir, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_testing.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_testing.go deleted file mode 100644 index b18bd6cb6d..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_testing.go +++ /dev/null @@ -1,171 +0,0 @@ -package getter - -import ( - "crypto/md5" - "encoding/hex" - "io" - "io/ioutil" - "os" - "path/filepath" - "reflect" - "runtime" - "sort" - "strings" - "time" - - "github.com/mitchellh/go-testing-interface" -) - -// TestDecompressCase is a single test case for testing decompressors -type TestDecompressCase struct { - Input string // Input is the complete path to the input file - Dir bool // Dir is whether or not we're testing directory mode - Err bool // Err is whether we expect an error or not - DirList []string // DirList is the list of files for Dir mode - FileMD5 string // FileMD5 is the expected MD5 for a single file - Mtime *time.Time // Mtime is the optionally expected mtime for a single file (or all files if in Dir mode) -} - -// TestDecompressor is a helper function for testing generic decompressors. -func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) { - t.Helper() - - for _, tc := range cases { - t.Logf("Testing: %s", tc.Input) - - // Temporary dir to store stuff - td, err := ioutil.TempDir("", "getter") - if err != nil { - t.Fatalf("err: %s", err) - } - - // Destination is always joining result so that we have a new path - dst := filepath.Join(td, "subdir", "result") - - // We use a function so defers work - func() { - defer os.RemoveAll(td) - - // Decompress - err := d.Decompress(dst, tc.Input, tc.Dir, 0022) - if (err != nil) != tc.Err { - t.Fatalf("err %s: %s", tc.Input, err) - } - if tc.Err { - return - } - - // If it isn't a directory, then check for a single file - if !tc.Dir { - fi, err := os.Stat(dst) - if err != nil { - t.Fatalf("err %s: %s", tc.Input, err) - } - if fi.IsDir() { - t.Fatalf("err %s: expected file, got directory", tc.Input) - } - if tc.FileMD5 != "" { - actual := testMD5(t, dst) - expected := tc.FileMD5 - if actual != expected { - t.Fatalf("err %s: expected MD5 %s, got %s", tc.Input, expected, actual) - } - } - - if tc.Mtime != nil { - actual := fi.ModTime() - if tc.Mtime.Unix() > 0 { - expected := *tc.Mtime - if actual != expected { - t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), dst, actual.String()) - } - } else if actual.Unix() <= 0 { - t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) - } - } - - return - } - - // Convert expected for windows - expected := tc.DirList - if runtime.GOOS == "windows" { - for i, v := range expected { - expected[i] = strings.Replace(v, "/", "\\", -1) - } - } - - // Directory, check for the correct contents - actual := testListDir(t, dst) - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("bad %s\n\n%#v\n\n%#v", tc.Input, actual, expected) - } - // Check for correct atime/mtime - for _, dir := range actual { - path := filepath.Join(dst, dir) - if tc.Mtime != nil { - fi, err := os.Stat(path) - if err != nil { - t.Fatalf("err: %s", err) - } - actual := fi.ModTime() - if tc.Mtime.Unix() > 0 { - expected := *tc.Mtime - if actual != expected { - t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), path, actual.String()) - } - } else if actual.Unix() < 0 { - t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) - } - - } - } - }() - } -} - -func testListDir(t testing.T, path string) []string { - var result []string - err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - sub = strings.TrimPrefix(sub, path) - if sub == "" { - return nil - } - sub = sub[1:] // Trim the leading path sep. - - // If it is a dir, add trailing sep - if info.IsDir() { - sub += string(os.PathSeparator) - } - - result = append(result, sub) - return nil - }) - if err != nil { - t.Fatalf("err: %s", err) - } - - sort.Strings(result) - return result -} - -func testMD5(t testing.T, path string) string { - f, err := os.Open(path) - if err != nil { - t.Fatalf("err: %s", err) - } - defer f.Close() - - h := md5.New() - _, err = io.Copy(h, f) - if err != nil { - t.Fatalf("err: %s", err) - } - - result := h.Sum(nil) - return hex.EncodeToString(result) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tgz.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_tgz.go deleted file mode 100644 index 84c4aa33d7..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tgz.go +++ /dev/null @@ -1,39 +0,0 @@ -package getter - -import ( - "compress/gzip" - "fmt" - "os" - "path/filepath" -) - -// TarGzipDecompressor is an implementation of Decompressor that can -// decompress tar.gzip files. -type TarGzipDecompressor struct{} - -func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Gzip compression is second - gzipR, err := gzip.NewReader(f) - if err != nil { - return fmt.Errorf("Error opening a gzip reader for %s: %s", src, err) - } - defer gzipR.Close() - - return untar(gzipR, dst, src, dir, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_txz.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_txz.go deleted file mode 100644 index 24686f4546..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_txz.go +++ /dev/null @@ -1,39 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/ulikunitz/xz" -) - -// TarXzDecompressor is an implementation of Decompressor that can -// decompress tar.xz files. -type TarXzDecompressor struct{} - -func (d *TarXzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // xz compression is second - txzR, err := xz.NewReader(f) - if err != nil { - return fmt.Errorf("Error opening an xz reader for %s: %s", src, err) - } - - return untar(txzR, dst, src, dir, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tzst.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_tzst.go deleted file mode 100644 index a9f3da51e4..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_tzst.go +++ /dev/null @@ -1,39 +0,0 @@ -package getter - -import ( - "fmt" - "github.com/klauspost/compress/zstd" - "os" - "path/filepath" -) - -// TarZstdDecompressor is an implementation of Decompressor that can -// decompress tar.zstd files. -type TarZstdDecompressor struct{} - -func (d *TarZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Zstd compression is second - zstdR, err := zstd.NewReader(f) - if err != nil { - return fmt.Errorf("Error opening a zstd reader for %s: %s", src, err) - } - defer zstdR.Close() - - return untar(zstdR, dst, src, dir, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_xz.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_xz.go deleted file mode 100644 index de5d6ce2b2..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_xz.go +++ /dev/null @@ -1,41 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/ulikunitz/xz" -) - -// XzDecompressor is an implementation of Decompressor that can -// decompress xz files. -type XzDecompressor struct{} - -func (d *XzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // Directory isn't supported at all - if dir { - return fmt.Errorf("xz-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // xz compression is second - xzR, err := xz.NewReader(f) - if err != nil { - return err - } - - // Copy it out - return copyReader(dst, xzR, 0622, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_zip.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_zip.go deleted file mode 100644 index 4876a33746..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_zip.go +++ /dev/null @@ -1,89 +0,0 @@ -package getter - -import ( - "archive/zip" - "fmt" - "os" - "path/filepath" -) - -// ZipDecompressor is an implementation of Decompressor that can -// decompress zip files. -type ZipDecompressor struct{} - -func (d *ZipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // Open the zip - zipR, err := zip.OpenReader(src) - if err != nil { - return err - } - defer zipR.Close() - - // Check the zip integrity - if len(zipR.File) == 0 { - // Empty archive - return fmt.Errorf("empty archive: %s", src) - } - if !dir && len(zipR.File) > 1 { - return fmt.Errorf("expected a single file: %s", src) - } - - // Go through and unarchive - for _, f := range zipR.File { - path := dst - if dir { - // Disallow parent traversal - if containsDotDot(f.Name) { - return fmt.Errorf("entry contains '..': %s", f.Name) - } - - path = filepath.Join(path, f.Name) - } - - if f.FileInfo().IsDir() { - if !dir { - return fmt.Errorf("expected a single file: %s", src) - } - - // A directory, just make the directory and continue unarchiving... - if err := os.MkdirAll(path, mode(0755, umask)); err != nil { - return err - } - - continue - } - - // Create the enclosing directories if we must. ZIP files aren't - // required to contain entries for just the directories so this - // can happen. - if dir { - if err := os.MkdirAll(filepath.Dir(path), mode(0755, umask)); err != nil { - return err - } - } - - // Open the file for reading - srcF, err := f.Open() - if err != nil { - srcF.Close() - return err - } - - err = copyReader(path, srcF, f.Mode(), umask) - srcF.Close() - if err != nil { - return err - } - } - - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/decompress_zstd.go b/ibm/vendor/github.com/hashicorp/go-getter/decompress_zstd.go deleted file mode 100644 index 6ff6c86a94..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/decompress_zstd.go +++ /dev/null @@ -1,40 +0,0 @@ -package getter - -import ( - "fmt" - "github.com/klauspost/compress/zstd" - "os" - "path/filepath" -) - -// ZstdDecompressor is an implementation of Decompressor that -// can decompress .zst files. -type ZstdDecompressor struct{} - -func (d *ZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - if dir { - return fmt.Errorf("zstd-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // zstd compression is second - zstdR, err := zstd.NewReader(f) - if err != nil { - return err - } - defer zstdR.Close() - - // Copy it out - return copyReader(dst, zstdR, 0622, umask) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect.go b/ibm/vendor/github.com/hashicorp/go-getter/detect.go deleted file mode 100644 index f134f77051..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect.go +++ /dev/null @@ -1,106 +0,0 @@ -package getter - -import ( - "fmt" - "path/filepath" - - "github.com/hashicorp/go-getter/helper/url" -) - -// Detector defines the interface that an invalid URL or a URL with a blank -// scheme is passed through in order to determine if its shorthand for -// something else well-known. -type Detector interface { - // Detect will detect whether the string matches a known pattern to - // turn it into a proper URL. - Detect(string, string) (string, bool, error) -} - -// Detectors is the list of detectors that are tried on an invalid URL. -// This is also the order they're tried (index 0 is first). -var Detectors []Detector - -func init() { - Detectors = []Detector{ - new(GitHubDetector), - new(GitLabDetector), - new(GitDetector), - new(BitBucketDetector), - new(S3Detector), - new(GCSDetector), - new(FileDetector), - } -} - -// Detect turns a source string into another source string if it is -// detected to be of a known pattern. -// -// The third parameter should be the list of detectors to use in the -// order to try them. If you don't want to configure this, just use -// the global Detectors variable. -// -// This is safe to be called with an already valid source string: Detect -// will just return it. -func Detect(src string, pwd string, ds []Detector) (string, error) { - getForce, getSrc := getForcedGetter(src) - - // Separate out the subdir if there is one, we don't pass that to detect - getSrc, subDir := SourceDirSubdir(getSrc) - - u, err := url.Parse(getSrc) - if err == nil && u.Scheme != "" { - // Valid URL - return src, nil - } - - for _, d := range ds { - result, ok, err := d.Detect(getSrc, pwd) - if err != nil { - return "", err - } - if !ok { - continue - } - - var detectForce string - detectForce, result = getForcedGetter(result) - result, detectSubdir := SourceDirSubdir(result) - - // If we have a subdir from the detection, then prepend it to our - // requested subdir. - if detectSubdir != "" { - if subDir != "" { - subDir = filepath.Join(detectSubdir, subDir) - } else { - subDir = detectSubdir - } - } - - if subDir != "" { - u, err := url.Parse(result) - if err != nil { - return "", fmt.Errorf("Error parsing URL: %s", err) - } - u.Path += "//" + subDir - - // a subdir may contain wildcards, but in order to support them we - // have to ensure the path isn't escaped. - u.RawPath = u.Path - - result = u.String() - } - - // Preserve the forced getter if it exists. We try to use the - // original set force first, followed by any force set by the - // detector. - if getForce != "" { - result = fmt.Sprintf("%s::%s", getForce, result) - } else if detectForce != "" { - result = fmt.Sprintf("%s::%s", detectForce, result) - } - - return result, nil - } - - return "", fmt.Errorf("invalid source string: %s", src) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_bitbucket.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_bitbucket.go deleted file mode 100644 index 19047eb197..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_bitbucket.go +++ /dev/null @@ -1,66 +0,0 @@ -package getter - -import ( - "encoding/json" - "fmt" - "net/http" - "net/url" - "strings" -) - -// BitBucketDetector implements Detector to detect BitBucket URLs and turn -// them into URLs that the Git or Hg Getter can understand. -type BitBucketDetector struct{} - -func (d *BitBucketDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.HasPrefix(src, "bitbucket.org/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *BitBucketDetector) detectHTTP(src string) (string, bool, error) { - u, err := url.Parse("https://" + src) - if err != nil { - return "", true, fmt.Errorf("error parsing BitBucket URL: %s", err) - } - - // We need to get info on this BitBucket repository to determine whether - // it is Git or Hg. - var info struct { - SCM string `json:"scm"` - } - infoUrl := "https://api.bitbucket.org/2.0/repositories" + u.Path - resp, err := http.Get(infoUrl) - if err != nil { - return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) - } - if resp.StatusCode == 403 { - // A private repo - return "", true, fmt.Errorf( - "shorthand BitBucket URL can't be used for private repos, " + - "please use a full URL") - } - dec := json.NewDecoder(resp.Body) - if err := dec.Decode(&info); err != nil { - return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) - } - - switch info.SCM { - case "git": - if !strings.HasSuffix(u.Path, ".git") { - u.Path += ".git" - } - - return "git::" + u.String(), true, nil - case "hg": - return "hg::" + u.String(), true, nil - default: - return "", true, fmt.Errorf("unknown BitBucket SCM type: %s", info.SCM) - } -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_file.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_file.go deleted file mode 100644 index 4ef41ea73f..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_file.go +++ /dev/null @@ -1,67 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - "runtime" -) - -// FileDetector implements Detector to detect file paths. -type FileDetector struct{} - -func (d *FileDetector) Detect(src, pwd string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if !filepath.IsAbs(src) { - if pwd == "" { - return "", true, fmt.Errorf( - "relative paths require a module with a pwd") - } - - // Stat the pwd to determine if its a symbolic link. If it is, - // then the pwd becomes the original directory. Otherwise, - // `filepath.Join` below does some weird stuff. - // - // We just ignore if the pwd doesn't exist. That error will be - // caught later when we try to use the URL. - if fi, err := os.Lstat(pwd); !os.IsNotExist(err) { - if err != nil { - return "", true, err - } - if fi.Mode()&os.ModeSymlink != 0 { - pwd, err = filepath.EvalSymlinks(pwd) - if err != nil { - return "", true, err - } - - // The symlink itself might be a relative path, so we have to - // resolve this to have a correctly rooted URL. - pwd, err = filepath.Abs(pwd) - if err != nil { - return "", true, err - } - } - } - - src = filepath.Join(pwd, src) - } - - return fmtFileURL(src), true, nil -} - -func fmtFileURL(path string) string { - if runtime.GOOS == "windows" { - // Make sure we're using "/" on Windows. URLs are "/"-based. - path = filepath.ToSlash(path) - return fmt.Sprintf("file://%s", path) - } - - // Make sure that we don't start with "/" since we add that below. - if path[0] == '/' { - path = path[1:] - } - return fmt.Sprintf("file:///%s", path) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_gcs.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_gcs.go deleted file mode 100644 index 11363737c7..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_gcs.go +++ /dev/null @@ -1,43 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// GCSDetector implements Detector to detect GCS URLs and turn -// them into URLs that the GCSGetter can understand. -type GCSDetector struct{} - -func (d *GCSDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.Contains(src, "googleapis.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *GCSDetector) detectHTTP(src string) (string, bool, error) { - - parts := strings.Split(src, "/") - if len(parts) < 5 { - return "", false, fmt.Errorf( - "URL is not a valid GCS URL") - } - version := parts[2] - bucket := parts[3] - object := strings.Join(parts[4:], "/") - - url, err := url.Parse(fmt.Sprintf("https://www.googleapis.com/storage/%s/%s/%s", - version, bucket, object)) - if err != nil { - return "", false, fmt.Errorf("error parsing GCS URL: %s", err) - } - - return "gcs::" + url.String(), true, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_git.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_git.go deleted file mode 100644 index eeb8a04c5e..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_git.go +++ /dev/null @@ -1,26 +0,0 @@ -package getter - -// GitDetector implements Detector to detect Git SSH URLs such as -// git@host.com:dir1/dir2 and converts them to proper URLs. -type GitDetector struct{} - -func (d *GitDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - u, err := detectSSH(src) - if err != nil { - return "", true, err - } - if u == nil { - return "", false, nil - } - - // We require the username to be "git" to assume that this is a Git URL - if u.User.Username() != "git" { - return "", false, nil - } - - return "git::" + u.String(), true, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_github.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_github.go deleted file mode 100644 index 4bf4daf238..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_github.go +++ /dev/null @@ -1,47 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// GitHubDetector implements Detector to detect GitHub URLs and turn -// them into URLs that the Git Getter can understand. -type GitHubDetector struct{} - -func (d *GitHubDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.HasPrefix(src, "github.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *GitHubDetector) detectHTTP(src string) (string, bool, error) { - parts := strings.Split(src, "/") - if len(parts) < 3 { - return "", false, fmt.Errorf( - "GitHub URLs should be github.com/username/repo") - } - - urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", true, fmt.Errorf("error parsing GitHub URL: %s", err) - } - - if !strings.HasSuffix(url.Path, ".git") { - url.Path += ".git" - } - - if len(parts) > 3 { - url.Path += "//" + strings.Join(parts[3:], "/") - } - - return "git::" + url.String(), true, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_gitlab.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_gitlab.go deleted file mode 100644 index 9d1e8d83cd..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_gitlab.go +++ /dev/null @@ -1,47 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// GitLabDetector implements Detector to detect GitLab URLs and turn -// them into URLs that the Git Getter can understand. -type GitLabDetector struct{} - -func (d *GitLabDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.HasPrefix(src, "gitlab.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *GitLabDetector) detectHTTP(src string) (string, bool, error) { - parts := strings.Split(src, "/") - if len(parts) < 3 { - return "", false, fmt.Errorf( - "GitLab URLs should be gitlab.com/username/repo") - } - - urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) - repoUrl, err := url.Parse(urlStr) - if err != nil { - return "", true, fmt.Errorf("error parsing GitLab URL: %s", err) - } - - if !strings.HasSuffix(repoUrl.Path, ".git") { - repoUrl.Path += ".git" - } - - if len(parts) > 3 { - repoUrl.Path += "//" + strings.Join(parts[3:], "/") - } - - return "git::" + repoUrl.String(), true, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_s3.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_s3.go deleted file mode 100644 index 8e0f4a03b4..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_s3.go +++ /dev/null @@ -1,61 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// S3Detector implements Detector to detect S3 URLs and turn -// them into URLs that the S3 getter can understand. -type S3Detector struct{} - -func (d *S3Detector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.Contains(src, ".amazonaws.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *S3Detector) detectHTTP(src string) (string, bool, error) { - parts := strings.Split(src, "/") - if len(parts) < 2 { - return "", false, fmt.Errorf( - "URL is not a valid S3 URL") - } - - hostParts := strings.Split(parts[0], ".") - if len(hostParts) == 3 { - return d.detectPathStyle(hostParts[0], parts[1:]) - } else if len(hostParts) == 4 { - return d.detectVhostStyle(hostParts[1], hostParts[0], parts[1:]) - } else { - return "", false, fmt.Errorf( - "URL is not a valid S3 URL") - } -} - -func (d *S3Detector) detectPathStyle(region string, parts []string) (string, bool, error) { - urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s", region, strings.Join(parts, "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", false, fmt.Errorf("error parsing S3 URL: %s", err) - } - - return "s3::" + url.String(), true, nil -} - -func (d *S3Detector) detectVhostStyle(region, bucket string, parts []string) (string, bool, error) { - urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s/%s", region, bucket, strings.Join(parts, "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", false, fmt.Errorf("error parsing S3 URL: %s", err) - } - - return "s3::" + url.String(), true, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/detect_ssh.go b/ibm/vendor/github.com/hashicorp/go-getter/detect_ssh.go deleted file mode 100644 index c0dbe9d475..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/detect_ssh.go +++ /dev/null @@ -1,49 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "regexp" - "strings" -) - -// Note that we do not have an SSH-getter currently so this file serves -// only to hold the detectSSH helper that is used by other detectors. - -// sshPattern matches SCP-like SSH patterns (user@host:path) -var sshPattern = regexp.MustCompile("^(?:([^@]+)@)?([^:]+):/?(.+)$") - -// detectSSH determines if the src string matches an SSH-like URL and -// converts it into a net.URL compatible string. This returns nil if the -// string doesn't match the SSH pattern. -// -// This function is tested indirectly via detect_git_test.go -func detectSSH(src string) (*url.URL, error) { - matched := sshPattern.FindStringSubmatch(src) - if matched == nil { - return nil, nil - } - - user := matched[1] - host := matched[2] - path := matched[3] - qidx := strings.Index(path, "?") - if qidx == -1 { - qidx = len(path) - } - - var u url.URL - u.Scheme = "ssh" - u.User = url.User(user) - u.Host = host - u.Path = path[0:qidx] - if qidx < len(path) { - q, err := url.ParseQuery(path[qidx+1:]) - if err != nil { - return nil, fmt.Errorf("error parsing GitHub SSH URL: %s", err) - } - u.RawQuery = q.Encode() - } - - return &u, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/folder_storage.go b/ibm/vendor/github.com/hashicorp/go-getter/folder_storage.go deleted file mode 100644 index 647ccf4592..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/folder_storage.go +++ /dev/null @@ -1,65 +0,0 @@ -package getter - -import ( - "crypto/md5" - "encoding/hex" - "fmt" - "os" - "path/filepath" -) - -// FolderStorage is an implementation of the Storage interface that manages -// modules on the disk. -type FolderStorage struct { - // StorageDir is the directory where the modules will be stored. - StorageDir string -} - -// Dir implements Storage.Dir -func (s *FolderStorage) Dir(key string) (d string, e bool, err error) { - d = s.dir(key) - _, err = os.Stat(d) - if err == nil { - // Directory exists - e = true - return - } - if os.IsNotExist(err) { - // Directory doesn't exist - d = "" - e = false - err = nil - return - } - - // An error - d = "" - e = false - return -} - -// Get implements Storage.Get -func (s *FolderStorage) Get(key string, source string, update bool) error { - dir := s.dir(key) - if !update { - if _, err := os.Stat(dir); err == nil { - // If the directory already exists, then we're done since - // we're not updating. - return nil - } else if !os.IsNotExist(err) { - // If the error we got wasn't a file-not-exist error, then - // something went wrong and we should report it. - return fmt.Errorf("Error reading module directory: %s", err) - } - } - - // Get the source. This always forces an update. - return Get(dir, source) -} - -// dir returns the directory name internally that we'll use to map to -// internally. -func (s *FolderStorage) dir(key string) string { - sum := md5.Sum([]byte(key)) - return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:])) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get.go b/ibm/vendor/github.com/hashicorp/go-getter/get.go deleted file mode 100644 index c233763c67..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get.go +++ /dev/null @@ -1,152 +0,0 @@ -// getter is a package for downloading files or directories from a variety of -// protocols. -// -// getter is unique in its ability to download both directories and files. -// It also detects certain source strings to be protocol-specific URLs. For -// example, "github.com/hashicorp/go-getter" would turn into a Git URL and -// use the Git protocol. -// -// Protocols and detectors are extensible. -// -// To get started, see Client. -package getter - -import ( - "bytes" - "fmt" - "net/url" - "os/exec" - "regexp" - "syscall" - - cleanhttp "github.com/hashicorp/go-cleanhttp" -) - -// Getter defines the interface that schemes must implement to download -// things. -type Getter interface { - // Get downloads the given URL into the given directory. This always - // assumes that we're updating and gets the latest version that it can. - // - // The directory may already exist (if we're updating). If it is in a - // format that isn't understood, an error should be returned. Get shouldn't - // simply nuke the directory. - Get(string, *url.URL) error - - // GetFile downloads the give URL into the given path. The URL must - // reference a single file. If possible, the Getter should check if - // the remote end contains the same file and no-op this operation. - GetFile(string, *url.URL) error - - // ClientMode returns the mode based on the given URL. This is used to - // allow clients to let the getters decide which mode to use. - ClientMode(*url.URL) (ClientMode, error) - - // SetClient allows a getter to know it's client - // in order to access client's Get functions or - // progress tracking. - SetClient(*Client) -} - -// Getters is the mapping of scheme to the Getter implementation that will -// be used to get a dependency. -var Getters map[string]Getter - -// forcedRegexp is the regular expression that finds forced getters. This -// syntax is schema::url, example: git::https://foo.com -var forcedRegexp = regexp.MustCompile(`^([A-Za-z0-9]+)::(.+)$`) - -// httpClient is the default client to be used by HttpGetters. -var httpClient = cleanhttp.DefaultClient() - -func init() { - httpGetter := &HttpGetter{ - Netrc: true, - } - - Getters = map[string]Getter{ - "file": new(FileGetter), - "git": new(GitGetter), - "gcs": new(GCSGetter), - "hg": new(HgGetter), - "s3": new(S3Getter), - "http": httpGetter, - "https": httpGetter, - } -} - -// Get downloads the directory specified by src into the folder specified by -// dst. If dst already exists, Get will attempt to update it. -// -// src is a URL, whereas dst is always just a file path to a folder. This -// folder doesn't need to exist. It will be created if it doesn't exist. -func Get(dst, src string, opts ...ClientOption) error { - return (&Client{ - Src: src, - Dst: dst, - Dir: true, - Options: opts, - }).Get() -} - -// GetAny downloads a URL into the given destination. Unlike Get or -// GetFile, both directories and files are supported. -// -// dst must be a directory. If src is a file, it will be downloaded -// into dst with the basename of the URL. If src is a directory or -// archive, it will be unpacked directly into dst. -func GetAny(dst, src string, opts ...ClientOption) error { - return (&Client{ - Src: src, - Dst: dst, - Mode: ClientModeAny, - Options: opts, - }).Get() -} - -// GetFile downloads the file specified by src into the path specified by -// dst. -func GetFile(dst, src string, opts ...ClientOption) error { - return (&Client{ - Src: src, - Dst: dst, - Dir: false, - Options: opts, - }).Get() -} - -// getRunCommand is a helper that will run a command and capture the output -// in the case an error happens. -func getRunCommand(cmd *exec.Cmd) error { - var buf bytes.Buffer - cmd.Stdout = &buf - cmd.Stderr = &buf - err := cmd.Run() - if err == nil { - return nil - } - if exiterr, ok := err.(*exec.ExitError); ok { - // The program has exited with an exit code != 0 - if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { - return fmt.Errorf( - "%s exited with %d: %s", - cmd.Path, - status.ExitStatus(), - buf.String()) - } - } - - return fmt.Errorf("error running %s: %s", cmd.Path, buf.String()) -} - -// getForcedGetter takes a source and returns the tuple of the forced -// getter and the raw URL (without the force syntax). -func getForcedGetter(src string) (string, string) { - var forced string - if ms := forcedRegexp.FindStringSubmatch(src); ms != nil { - forced = ms[1] - src = ms[2] - } - - return forced, src -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_base.go b/ibm/vendor/github.com/hashicorp/go-getter/get_base.go deleted file mode 100644 index 09e9b6313b..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_base.go +++ /dev/null @@ -1,20 +0,0 @@ -package getter - -import "context" - -// getter is our base getter; it regroups -// fields all getters have in common. -type getter struct { - client *Client -} - -func (g *getter) SetClient(c *Client) { g.client = c } - -// Context tries to returns the Contex from the getter's -// client. otherwise context.Background() is returned. -func (g *getter) Context() context.Context { - if g == nil || g.client == nil { - return context.Background() - } - return g.client.Ctx -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_file.go b/ibm/vendor/github.com/hashicorp/go-getter/get_file.go deleted file mode 100644 index 78660839a0..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_file.go +++ /dev/null @@ -1,36 +0,0 @@ -package getter - -import ( - "net/url" - "os" -) - -// FileGetter is a Getter implementation that will download a module from -// a file scheme. -type FileGetter struct { - getter - - // Copy, if set to true, will copy data instead of using a symlink. If - // false, attempts to symlink to speed up the operation and to lower the - // disk space usage. If the symlink fails, may attempt to copy on windows. - Copy bool -} - -func (g *FileGetter) ClientMode(u *url.URL) (ClientMode, error) { - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - fi, err := os.Stat(path) - if err != nil { - return 0, err - } - - // Check if the source is a directory. - if fi.IsDir() { - return ClientModeDir, nil - } - - return ClientModeFile, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_file_copy.go b/ibm/vendor/github.com/hashicorp/go-getter/get_file_copy.go deleted file mode 100644 index 29abbd1aa0..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_file_copy.go +++ /dev/null @@ -1,75 +0,0 @@ -package getter - -import ( - "context" - "io" - "os" -) - -// readerFunc is syntactic sugar for read interface. -type readerFunc func(p []byte) (n int, err error) - -func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) } - -// Copy is a io.Copy cancellable by context -func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) { - // Copy will call the Reader and Writer interface multiple time, in order - // to copy by chunk (avoiding loading the whole file in memory). - return io.Copy(dst, readerFunc(func(p []byte) (int, error) { - - select { - case <-ctx.Done(): - // context has been canceled - // stop process and propagate "context canceled" error - return 0, ctx.Err() - default: - // otherwise just run default io.Reader implementation - return src.Read(p) - } - })) -} - -// copyReader copies from an io.Reader into a file, using umask to create the dst file -func copyReader(dst string, src io.Reader, fmode, umask os.FileMode) error { - dstF, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fmode) - if err != nil { - return err - } - defer dstF.Close() - - _, err = io.Copy(dstF, src) - if err != nil { - return err - } - - // Explicitly chmod; the process umask is unconditionally applied otherwise. - // We'll mask the mode with our own umask, but that may be different than - // the process umask - return os.Chmod(dst, mode(fmode, umask)) -} - -// copyFile copies a file in chunks from src path to dst path, using umask to create the dst file -func copyFile(ctx context.Context, dst, src string, fmode, umask os.FileMode) (int64, error) { - srcF, err := os.Open(src) - if err != nil { - return 0, err - } - defer srcF.Close() - - dstF, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fmode) - if err != nil { - return 0, err - } - defer dstF.Close() - - count, err := Copy(ctx, dstF, srcF) - if err != nil { - return 0, err - } - - // Explicitly chmod; the process umask is unconditionally applied otherwise. - // We'll mask the mode with our own umask, but that may be different than - // the process umask - err = os.Chmod(dst, mode(fmode, umask)) - return count, err -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_file_unix.go b/ibm/vendor/github.com/hashicorp/go-getter/get_file_unix.go deleted file mode 100644 index 40ebc5af23..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_file_unix.go +++ /dev/null @@ -1,93 +0,0 @@ -// +build !windows - -package getter - -import ( - "fmt" - "net/url" - "os" - "path/filepath" -) - -func (g *FileGetter) Get(dst string, u *url.URL) error { - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a directory to be usable. - if fi, err := os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if !fi.IsDir() { - return fmt.Errorf("source path must be a directory") - } - - fi, err := os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - mode := fi.Mode() - if mode&os.ModeSymlink == 0 { - return fmt.Errorf("destination exists and is not a symlink") - } - - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - return os.Symlink(path, dst) -} - -func (g *FileGetter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a file to be usable. - var fi os.FileInfo - var err error - if fi, err = os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if fi.IsDir() { - return fmt.Errorf("source path must be a file") - } - - _, err = os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err = os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - // If we're not copying, just symlink and we're done - if !g.Copy { - return os.Symlink(path, dst) - } - - // Copy - _, err = copyFile(ctx, dst, path, fi.Mode(), g.client.umask()) - return err -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_file_windows.go b/ibm/vendor/github.com/hashicorp/go-getter/get_file_windows.go deleted file mode 100644 index 909d5b006f..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_file_windows.go +++ /dev/null @@ -1,124 +0,0 @@ -// +build windows - -package getter - -import ( - "fmt" - "net/url" - "os" - "os/exec" - "path/filepath" - "strings" - "syscall" -) - -func (g *FileGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a directory to be usable. - if fi, err := os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if !fi.IsDir() { - return fmt.Errorf("source path must be a directory") - } - - fi, err := os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - mode := fi.Mode() - if mode&os.ModeSymlink == 0 { - return fmt.Errorf("destination exists and is not a symlink") - } - - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - sourcePath := toBackslash(path) - - // Use mklink to create a junction point - output, err := exec.CommandContext(ctx, "cmd", "/c", "mklink", "/J", dst, sourcePath).CombinedOutput() - if err != nil { - return fmt.Errorf("failed to run mklink %v %v: %v %q", dst, sourcePath, err, output) - } - - return nil -} - -func (g *FileGetter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a directory to be usable. - if fi, err := os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if fi.IsDir() { - return fmt.Errorf("source path must be a file") - } - - _, err := os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - // If we're not copying, just symlink and we're done - if !g.Copy { - if err = os.Symlink(path, dst); err == nil { - return err - } - lerr, ok := err.(*os.LinkError) - if !ok { - return err - } - switch lerr.Err { - case syscall.ERROR_PRIVILEGE_NOT_HELD: - // no symlink privilege, let's - // fallback to a copy to avoid an error. - break - default: - return err - } - } - - // Copy - _, err = copyFile(ctx, dst, path, 0666, g.client.umask()) - return err -} - -// toBackslash returns the result of replacing each slash character -// in path with a backslash ('\') character. Multiple separators are -// replaced by multiple backslashes. -func toBackslash(path string) string { - return strings.Replace(path, "/", "\\", -1) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_gcs.go b/ibm/vendor/github.com/hashicorp/go-getter/get_gcs.go deleted file mode 100644 index 4f2172b24c..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_gcs.go +++ /dev/null @@ -1,177 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "net/url" - "os" - "path/filepath" - "strconv" - "strings" - - "cloud.google.com/go/storage" - "google.golang.org/api/iterator" -) - -// GCSGetter is a Getter implementation that will download a module from -// a GCS bucket. -type GCSGetter struct { - getter -} - -func (g *GCSGetter) ClientMode(u *url.URL) (ClientMode, error) { - ctx := g.Context() - - // Parse URL - bucket, object, _, err := g.parseURL(u) - if err != nil { - return 0, err - } - - client, err := storage.NewClient(ctx) - if err != nil { - return 0, err - } - iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) - for { - obj, err := iter.Next() - if err != nil && err != iterator.Done { - return 0, err - } - - if err == iterator.Done { - break - } - if strings.HasSuffix(obj.Name, "/") { - // A directory matched the prefix search, so this must be a directory - return ClientModeDir, nil - } else if obj.Name != object { - // A file matched the prefix search and doesn't have the same name - // as the query, so this must be a directory - return ClientModeDir, nil - } - } - // There are no directories or subdirectories, and if a match was returned, - // it was exactly equal to the prefix search. So return File mode - return ClientModeFile, nil -} - -func (g *GCSGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - // Parse URL - bucket, object, _, err := g.parseURL(u) - if err != nil { - return err - } - - // Remove destination if it already exists - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - if err == nil { - // Remove the destination - if err := os.RemoveAll(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - client, err := storage.NewClient(ctx) - if err != nil { - return err - } - - // Iterate through all matching objects. - iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) - for { - obj, err := iter.Next() - if err != nil && err != iterator.Done { - return err - } - if err == iterator.Done { - break - } - - if !strings.HasSuffix(obj.Name, "/") { - // Get the object destination path - objDst, err := filepath.Rel(object, obj.Name) - if err != nil { - return err - } - objDst = filepath.Join(dst, objDst) - // Download the matching object. - err = g.getObject(ctx, client, objDst, bucket, obj.Name, "") - if err != nil { - return err - } - } - } - return nil -} - -func (g *GCSGetter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - - // Parse URL - bucket, object, fragment, err := g.parseURL(u) - if err != nil { - return err - } - - client, err := storage.NewClient(ctx) - if err != nil { - return err - } - return g.getObject(ctx, client, dst, bucket, object, fragment) -} - -func (g *GCSGetter) getObject(ctx context.Context, client *storage.Client, dst, bucket, object, fragment string) error { - var rc *storage.Reader - var err error - if fragment != "" { - generation, err := strconv.ParseInt(fragment, 10, 64) - if err != nil { - return err - } - rc, err = client.Bucket(bucket).Object(object).Generation(generation).NewReader(ctx) - } else { - rc, err = client.Bucket(bucket).Object(object).NewReader(ctx) - } - if err != nil { - return err - } - defer rc.Close() - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - return copyReader(dst, rc, 0666, g.client.umask()) -} - -func (g *GCSGetter) parseURL(u *url.URL) (bucket, path, fragment string, err error) { - if strings.Contains(u.Host, "googleapis.com") { - hostParts := strings.Split(u.Host, ".") - if len(hostParts) != 3 { - err = fmt.Errorf("URL is not a valid GCS URL") - return - } - - pathParts := strings.SplitN(u.Path, "/", 5) - if len(pathParts) != 5 { - err = fmt.Errorf("URL is not a valid GCS URL") - return - } - bucket = pathParts[3] - path = pathParts[4] - fragment = u.Fragment - } - return -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_git.go b/ibm/vendor/github.com/hashicorp/go-getter/get_git.go deleted file mode 100644 index 1b9f4be819..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_git.go +++ /dev/null @@ -1,313 +0,0 @@ -package getter - -import ( - "bytes" - "context" - "encoding/base64" - "fmt" - "io/ioutil" - "net/url" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" - - urlhelper "github.com/hashicorp/go-getter/helper/url" - safetemp "github.com/hashicorp/go-safetemp" - version "github.com/hashicorp/go-version" -) - -// GitGetter is a Getter implementation that will download a module from -// a git repository. -type GitGetter struct { - getter -} - -var defaultBranchRegexp = regexp.MustCompile(`\s->\sorigin/(.*)`) - -func (g *GitGetter) ClientMode(_ *url.URL) (ClientMode, error) { - return ClientModeDir, nil -} - -func (g *GitGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - if _, err := exec.LookPath("git"); err != nil { - return fmt.Errorf("git must be available and on the PATH") - } - - // The port number must be parseable as an integer. If not, the user - // was probably trying to use a scp-style address, in which case the - // ssh:// prefix must be removed to indicate that. - // - // This is not necessary in versions of Go which have patched - // CVE-2019-14809 (e.g. Go 1.12.8+) - if portStr := u.Port(); portStr != "" { - if _, err := strconv.ParseUint(portStr, 10, 16); err != nil { - return fmt.Errorf("invalid port number %q; if using the \"scp-like\" git address scheme where a colon introduces the path instead, remove the ssh:// portion and use just the git:: prefix", portStr) - } - } - - // Extract some query parameters we use - var ref, sshKey string - var depth int - q := u.Query() - if len(q) > 0 { - ref = q.Get("ref") - q.Del("ref") - - sshKey = q.Get("sshkey") - q.Del("sshkey") - - if n, err := strconv.Atoi(q.Get("depth")); err == nil { - depth = n - } - q.Del("depth") - - // Copy the URL - var newU url.URL = *u - u = &newU - u.RawQuery = q.Encode() - } - - var sshKeyFile string - if sshKey != "" { - // Check that the git version is sufficiently new. - if err := checkGitVersion("2.3"); err != nil { - return fmt.Errorf("Error using ssh key: %v", err) - } - - // We have an SSH key - decode it. - raw, err := base64.StdEncoding.DecodeString(sshKey) - if err != nil { - return err - } - - // Create a temp file for the key and ensure it is removed. - fh, err := ioutil.TempFile("", "go-getter") - if err != nil { - return err - } - sshKeyFile = fh.Name() - defer os.Remove(sshKeyFile) - - // Set the permissions prior to writing the key material. - if err := os.Chmod(sshKeyFile, 0600); err != nil { - return err - } - - // Write the raw key into the temp file. - _, err = fh.Write(raw) - fh.Close() - if err != nil { - return err - } - } - - // Clone or update the repository - _, err := os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - if err == nil { - err = g.update(ctx, dst, sshKeyFile, ref, depth) - } else { - err = g.clone(ctx, dst, sshKeyFile, u, depth) - } - if err != nil { - return err - } - - // Next: check out the proper tag/branch if it is specified, and checkout - if ref != "" { - if err := g.checkout(dst, ref); err != nil { - return err - } - } - - // Lastly, download any/all submodules. - return g.fetchSubmodules(ctx, dst, sshKeyFile, depth) -} - -// GetFile for Git doesn't support updating at this time. It will download -// the file every time. -func (g *GitGetter) GetFile(dst string, u *url.URL) error { - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - // Get the filename, and strip the filename from the URL so we can - // just get the repository directly. - filename := filepath.Base(u.Path) - u.Path = filepath.Dir(u.Path) - - // Get the full repository - if err := g.Get(td, u); err != nil { - return err - } - - // Copy the single file - u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) - if err != nil { - return err - } - - fg := &FileGetter{Copy: true} - return fg.GetFile(dst, u) -} - -func (g *GitGetter) checkout(dst string, ref string) error { - cmd := exec.Command("git", "checkout", ref) - cmd.Dir = dst - return getRunCommand(cmd) -} - -func (g *GitGetter) clone(ctx context.Context, dst, sshKeyFile string, u *url.URL, depth int) error { - args := []string{"clone"} - - if depth > 0 { - args = append(args, "--depth", strconv.Itoa(depth)) - } - - args = append(args, u.String(), dst) - cmd := exec.CommandContext(ctx, "git", args...) - setupGitEnv(cmd, sshKeyFile) - return getRunCommand(cmd) -} - -func (g *GitGetter) update(ctx context.Context, dst, sshKeyFile, ref string, depth int) error { - // Determine if we're a branch. If we're NOT a branch, then we just - // switch to master prior to checking out - cmd := exec.CommandContext(ctx, "git", "show-ref", "-q", "--verify", "refs/heads/"+ref) - cmd.Dir = dst - - if getRunCommand(cmd) != nil { - // Not a branch, switch to default branch. This will also catch - // non-existent branches, in which case we want to switch to default - // and then checkout the proper branch later. - ref = findDefaultBranch(dst) - } - - // We have to be on a branch to pull - if err := g.checkout(dst, ref); err != nil { - return err - } - - if depth > 0 { - cmd = exec.Command("git", "pull", "--depth", strconv.Itoa(depth), "--ff-only") - } else { - cmd = exec.Command("git", "pull", "--ff-only") - } - - cmd.Dir = dst - setupGitEnv(cmd, sshKeyFile) - return getRunCommand(cmd) -} - -// fetchSubmodules downloads any configured submodules recursively. -func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error { - args := []string{"submodule", "update", "--init", "--recursive"} - if depth > 0 { - args = append(args, "--depth", strconv.Itoa(depth)) - } - cmd := exec.CommandContext(ctx, "git", args...) - cmd.Dir = dst - setupGitEnv(cmd, sshKeyFile) - return getRunCommand(cmd) -} - -// findDefaultBranch checks the repo's origin remote for its default branch -// (generally "master"). "master" is returned if an origin default branch -// can't be determined. -func findDefaultBranch(dst string) string { - var stdoutbuf bytes.Buffer - cmd := exec.Command("git", "branch", "-r", "--points-at", "refs/remotes/origin/HEAD") - cmd.Dir = dst - cmd.Stdout = &stdoutbuf - err := cmd.Run() - matches := defaultBranchRegexp.FindStringSubmatch(stdoutbuf.String()) - if err != nil || matches == nil { - return "master" - } - return matches[len(matches)-1] -} - -// setupGitEnv sets up the environment for the given command. This is used to -// pass configuration data to git and ssh and enables advanced cloning methods. -func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) { - const gitSSHCommand = "GIT_SSH_COMMAND=" - var sshCmd []string - - // If we have an existing GIT_SSH_COMMAND, we need to append our options. - // We will also remove our old entry to make sure the behavior is the same - // with versions of Go < 1.9. - env := os.Environ() - for i, v := range env { - if strings.HasPrefix(v, gitSSHCommand) && len(v) > len(gitSSHCommand) { - sshCmd = []string{v} - - env[i], env[len(env)-1] = env[len(env)-1], env[i] - env = env[:len(env)-1] - break - } - } - - if len(sshCmd) == 0 { - sshCmd = []string{gitSSHCommand + "ssh"} - } - - if sshKeyFile != "" { - // We have an SSH key temp file configured, tell ssh about this. - if runtime.GOOS == "windows" { - sshKeyFile = strings.Replace(sshKeyFile, `\`, `/`, -1) - } - sshCmd = append(sshCmd, "-i", sshKeyFile) - } - - env = append(env, strings.Join(sshCmd, " ")) - cmd.Env = env -} - -// checkGitVersion is used to check the version of git installed on the system -// against a known minimum version. Returns an error if the installed version -// is older than the given minimum. -func checkGitVersion(min string) error { - want, err := version.NewVersion(min) - if err != nil { - return err - } - - out, err := exec.Command("git", "version").Output() - if err != nil { - return err - } - - fields := strings.Fields(string(out)) - if len(fields) < 3 { - return fmt.Errorf("Unexpected 'git version' output: %q", string(out)) - } - v := fields[2] - if runtime.GOOS == "windows" && strings.Contains(v, ".windows.") { - // on windows, git version will return for example: - // git version 2.20.1.windows.1 - // Which does not follow the semantic versionning specs - // https://semver.org. We remove that part in order for - // go-version to not error. - v = v[:strings.Index(v, ".windows.")] - } - - have, err := version.NewVersion(v) - if err != nil { - return err - } - - if have.LessThan(want) { - return fmt.Errorf("Required git version = %s, have %s", want, have) - } - - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_hg.go b/ibm/vendor/github.com/hashicorp/go-getter/get_hg.go deleted file mode 100644 index 290649c910..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_hg.go +++ /dev/null @@ -1,135 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "net/url" - "os" - "os/exec" - "path/filepath" - "runtime" - - urlhelper "github.com/hashicorp/go-getter/helper/url" - safetemp "github.com/hashicorp/go-safetemp" -) - -// HgGetter is a Getter implementation that will download a module from -// a Mercurial repository. -type HgGetter struct { - getter -} - -func (g *HgGetter) ClientMode(_ *url.URL) (ClientMode, error) { - return ClientModeDir, nil -} - -func (g *HgGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - if _, err := exec.LookPath("hg"); err != nil { - return fmt.Errorf("hg must be available and on the PATH") - } - - newURL, err := urlhelper.Parse(u.String()) - if err != nil { - return err - } - if fixWindowsDrivePath(newURL) { - // See valid file path form on http://www.selenic.com/hg/help/urls - newURL.Path = fmt.Sprintf("/%s", newURL.Path) - } - - // Extract some query parameters we use - var rev string - q := newURL.Query() - if len(q) > 0 { - rev = q.Get("rev") - q.Del("rev") - - newURL.RawQuery = q.Encode() - } - - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - if err != nil { - if err := g.clone(dst, newURL); err != nil { - return err - } - } - - if err := g.pull(dst, newURL); err != nil { - return err - } - - return g.update(ctx, dst, newURL, rev) -} - -// GetFile for Hg doesn't support updating at this time. It will download -// the file every time. -func (g *HgGetter) GetFile(dst string, u *url.URL) error { - // Create a temporary directory to store the full source. This has to be - // a non-existent directory. - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - // Get the filename, and strip the filename from the URL so we can - // just get the repository directly. - filename := filepath.Base(u.Path) - u.Path = filepath.ToSlash(filepath.Dir(u.Path)) - - // If we're on Windows, we need to set the host to "localhost" for hg - if runtime.GOOS == "windows" { - u.Host = "localhost" - } - - // Get the full repository - if err := g.Get(td, u); err != nil { - return err - } - - // Copy the single file - u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) - if err != nil { - return err - } - - fg := &FileGetter{Copy: true, getter: g.getter} - return fg.GetFile(dst, u) -} - -func (g *HgGetter) clone(dst string, u *url.URL) error { - cmd := exec.Command("hg", "clone", "-U", u.String(), dst) - return getRunCommand(cmd) -} - -func (g *HgGetter) pull(dst string, u *url.URL) error { - cmd := exec.Command("hg", "pull") - cmd.Dir = dst - return getRunCommand(cmd) -} - -func (g *HgGetter) update(ctx context.Context, dst string, u *url.URL, rev string) error { - args := []string{"update"} - if rev != "" { - args = append(args, rev) - } - - cmd := exec.CommandContext(ctx, "hg", args...) - cmd.Dir = dst - return getRunCommand(cmd) -} - -func fixWindowsDrivePath(u *url.URL) bool { - // hg assumes a file:/// prefix for Windows drive letter file paths. - // (e.g. file:///c:/foo/bar) - // If the URL Path does not begin with a '/' character, the resulting URL - // path will have a file:// prefix. (e.g. file://c:/foo/bar) - // See http://www.selenic.com/hg/help/urls and the examples listed in - // http://selenic.com/repo/hg-stable/file/1265a3a71d75/mercurial/util.py#l1936 - return runtime.GOOS == "windows" && u.Scheme == "file" && - len(u.Path) > 1 && u.Path[0] != '/' && u.Path[1] == ':' -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_http.go b/ibm/vendor/github.com/hashicorp/go-getter/get_http.go deleted file mode 100644 index 8c2278d6ac..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_http.go +++ /dev/null @@ -1,337 +0,0 @@ -package getter - -import ( - "context" - "encoding/xml" - "fmt" - "io" - "net/http" - "net/url" - "os" - "path/filepath" - "strings" - - safetemp "github.com/hashicorp/go-safetemp" -) - -// HttpGetter is a Getter implementation that will download from an HTTP -// endpoint. -// -// For file downloads, HTTP is used directly. -// -// The protocol for downloading a directory from an HTTP endpoint is as follows: -// -// An HTTP GET request is made to the URL with the additional GET parameter -// "terraform-get=1". This lets you handle that scenario specially if you -// wish. The response must be a 2xx. -// -// First, a header is looked for "X-Terraform-Get" which should contain -// a source URL to download. -// -// If the header is not present, then a meta tag is searched for named -// "terraform-get" and the content should be a source URL. -// -// The source URL, whether from the header or meta tag, must be a fully -// formed URL. The shorthand syntax of "github.com/foo/bar" or relative -// paths are not allowed. -type HttpGetter struct { - getter - - // Netrc, if true, will lookup and use auth information found - // in the user's netrc file if available. - Netrc bool - - // Client is the http.Client to use for Get requests. - // This defaults to a cleanhttp.DefaultClient if left unset. - Client *http.Client - - // Header contains optional request header fields that should be included - // with every HTTP request. Note that the zero value of this field is nil, - // and as such it needs to be initialized before use, via something like - // make(http.Header). - Header http.Header -} - -func (g *HttpGetter) ClientMode(u *url.URL) (ClientMode, error) { - if strings.HasSuffix(u.Path, "/") { - return ClientModeDir, nil - } - return ClientModeFile, nil -} - -func (g *HttpGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - // Copy the URL so we can modify it - var newU url.URL = *u - u = &newU - - if g.Netrc { - // Add auth from netrc if we can - if err := addAuthFromNetrc(u); err != nil { - return err - } - } - - if g.Client == nil { - g.Client = httpClient - } - - // Add terraform-get to the parameter. - q := u.Query() - q.Add("terraform-get", "1") - u.RawQuery = q.Encode() - - // Get the URL - req, err := http.NewRequest("GET", u.String(), nil) - if err != nil { - return err - } - - if g.Header != nil { - req.Header = g.Header.Clone() - } - - resp, err := g.Client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return fmt.Errorf("bad response code: %d", resp.StatusCode) - } - - // Extract the source URL - var source string - if v := resp.Header.Get("X-Terraform-Get"); v != "" { - source = v - } else { - source, err = g.parseMeta(resp.Body) - if err != nil { - return err - } - } - if source == "" { - return fmt.Errorf("no source URL was returned") - } - - // If there is a subdir component, then we download the root separately - // into a temporary directory, then copy over the proper subdir. - source, subDir := SourceDirSubdir(source) - if subDir == "" { - var opts []ClientOption - if g.client != nil { - opts = g.client.Options - } - return Get(dst, source, opts...) - } - - // We have a subdir, time to jump some hoops - return g.getSubdir(ctx, dst, source, subDir) -} - -// GetFile fetches the file from src and stores it at dst. -// If the server supports Accept-Range, HttpGetter will attempt a range -// request. This means it is the caller's responsibility to ensure that an -// older version of the destination file does not exist, else it will be either -// falsely identified as being replaced, or corrupted with extra bytes -// appended. -func (g *HttpGetter) GetFile(dst string, src *url.URL) error { - ctx := g.Context() - if g.Netrc { - // Add auth from netrc if we can - if err := addAuthFromNetrc(src); err != nil { - return err - } - } - // Create all the parent directories if needed - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - f, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE, g.client.mode(0666)) - if err != nil { - return err - } - defer f.Close() - - if g.Client == nil { - g.Client = httpClient - } - - var currentFileSize int64 - - // We first make a HEAD request so we can check - // if the server supports range queries. If the server/URL doesn't - // support HEAD requests, we just fall back to GET. - req, err := http.NewRequest("HEAD", src.String(), nil) - if err != nil { - return err - } - if g.Header != nil { - req.Header = g.Header.Clone() - } - headResp, err := g.Client.Do(req) - if err == nil { - headResp.Body.Close() - if headResp.StatusCode == 200 { - // If the HEAD request succeeded, then attempt to set the range - // query if we can. - if headResp.Header.Get("Accept-Ranges") == "bytes" && headResp.ContentLength >= 0 { - if fi, err := f.Stat(); err == nil { - if _, err = f.Seek(0, io.SeekEnd); err == nil { - currentFileSize = fi.Size() - if currentFileSize >= headResp.ContentLength { - // file already present - return nil - } - } - } - } - } - } - - req, err = http.NewRequest("GET", src.String(), nil) - if err != nil { - return err - } - if g.Header != nil { - req.Header = g.Header.Clone() - } - if currentFileSize > 0 { - req.Header.Set("Range", fmt.Sprintf("bytes=%d-", currentFileSize)) - } - - resp, err := g.Client.Do(req) - if err != nil { - return err - } - switch resp.StatusCode { - case http.StatusOK, http.StatusPartialContent: - // all good - default: - resp.Body.Close() - return fmt.Errorf("bad response code: %d", resp.StatusCode) - } - - body := resp.Body - - if g.client != nil && g.client.ProgressListener != nil { - // track download - fn := filepath.Base(src.EscapedPath()) - body = g.client.ProgressListener.TrackProgress(fn, currentFileSize, currentFileSize+resp.ContentLength, resp.Body) - } - defer body.Close() - - n, err := Copy(ctx, f, body) - if err == nil && n < resp.ContentLength { - err = io.ErrShortWrite - } - return err -} - -// getSubdir downloads the source into the destination, but with -// the proper subdir. -func (g *HttpGetter) getSubdir(ctx context.Context, dst, source, subDir string) error { - // Create a temporary directory to store the full source. This has to be - // a non-existent directory. - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - var opts []ClientOption - if g.client != nil { - opts = g.client.Options - } - // Download that into the given directory - if err := Get(td, source, opts...); err != nil { - return err - } - - // Process any globbing - sourcePath, err := SubdirGlob(td, subDir) - if err != nil { - return err - } - - // Make sure the subdir path actually exists - if _, err := os.Stat(sourcePath); err != nil { - return fmt.Errorf( - "Error downloading %s: %s", source, err) - } - - // Copy the subdirectory into our actual destination. - if err := os.RemoveAll(dst); err != nil { - return err - } - - // Make the final destination - if err := os.MkdirAll(dst, g.client.mode(0755)); err != nil { - return err - } - - return copyDir(ctx, dst, sourcePath, false, g.client.umask()) -} - -// parseMeta looks for the first meta tag in the given reader that -// will give us the source URL. -func (g *HttpGetter) parseMeta(r io.Reader) (string, error) { - d := xml.NewDecoder(r) - d.CharsetReader = charsetReader - d.Strict = false - var err error - var t xml.Token - for { - t, err = d.Token() - if err != nil { - if err == io.EOF { - err = nil - } - return "", err - } - if e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, "body") { - return "", nil - } - if e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, "head") { - return "", nil - } - e, ok := t.(xml.StartElement) - if !ok || !strings.EqualFold(e.Name.Local, "meta") { - continue - } - if attrValue(e.Attr, "name") != "terraform-get" { - continue - } - if f := attrValue(e.Attr, "content"); f != "" { - return f, nil - } - } -} - -// attrValue returns the attribute value for the case-insensitive key -// `name', or the empty string if nothing is found. -func attrValue(attrs []xml.Attr, name string) string { - for _, a := range attrs { - if strings.EqualFold(a.Name.Local, name) { - return a.Value - } - } - return "" -} - -// charsetReader returns a reader for the given charset. Currently -// it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful -// error which is printed by go get, so the user can find why the package -// wasn't downloaded if the encoding is not supported. Note that, in -// order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters -// greater than 0x7f are not rejected). -func charsetReader(charset string, input io.Reader) (io.Reader, error) { - switch strings.ToLower(charset) { - case "ascii": - return input, nil - default: - return nil, fmt.Errorf("can't decode XML document using charset %q", charset) - } -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_mock.go b/ibm/vendor/github.com/hashicorp/go-getter/get_mock.go deleted file mode 100644 index e2a98ea284..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_mock.go +++ /dev/null @@ -1,54 +0,0 @@ -package getter - -import ( - "net/url" -) - -// MockGetter is an implementation of Getter that can be used for tests. -type MockGetter struct { - getter - - // Proxy, if set, will be called after recording the calls below. - // If it isn't set, then the *Err values will be returned. - Proxy Getter - - GetCalled bool - GetDst string - GetURL *url.URL - GetErr error - - GetFileCalled bool - GetFileDst string - GetFileURL *url.URL - GetFileErr error -} - -func (g *MockGetter) Get(dst string, u *url.URL) error { - g.GetCalled = true - g.GetDst = dst - g.GetURL = u - - if g.Proxy != nil { - return g.Proxy.Get(dst, u) - } - - return g.GetErr -} - -func (g *MockGetter) GetFile(dst string, u *url.URL) error { - g.GetFileCalled = true - g.GetFileDst = dst - g.GetFileURL = u - - if g.Proxy != nil { - return g.Proxy.GetFile(dst, u) - } - return g.GetFileErr -} - -func (g *MockGetter) ClientMode(u *url.URL) (ClientMode, error) { - if l := len(u.Path); l > 0 && u.Path[l-1:] == "/" { - return ClientModeDir, nil - } - return ClientModeFile, nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/get_s3.go b/ibm/vendor/github.com/hashicorp/go-getter/get_s3.go deleted file mode 100644 index dc577c0704..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/get_s3.go +++ /dev/null @@ -1,310 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "net/url" - "os" - "path/filepath" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" -) - -// S3Getter is a Getter implementation that will download a module from -// a S3 bucket. -type S3Getter struct { - getter -} - -func (g *S3Getter) ClientMode(u *url.URL) (ClientMode, error) { - // Parse URL - region, bucket, path, _, creds, err := g.parseUrl(u) - if err != nil { - return 0, err - } - - // Create client config - client, err := g.newS3Client(region, u, creds) - if err != nil { - return 0, err - } - - // List the object(s) at the given prefix - req := &s3.ListObjectsInput{ - Bucket: aws.String(bucket), - Prefix: aws.String(path), - } - resp, err := client.ListObjects(req) - if err != nil { - return 0, err - } - - for _, o := range resp.Contents { - // Use file mode on exact match. - if *o.Key == path { - return ClientModeFile, nil - } - - // Use dir mode if child keys are found. - if strings.HasPrefix(*o.Key, path+"/") { - return ClientModeDir, nil - } - } - - // There was no match, so just return file mode. The download is going - // to fail but we will let S3 return the proper error later. - return ClientModeFile, nil -} - -func (g *S3Getter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - // Parse URL - region, bucket, path, _, creds, err := g.parseUrl(u) - if err != nil { - return err - } - - // Remove destination if it already exists - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - if err == nil { - // Remove the destination - if err := os.RemoveAll(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - client, err := g.newS3Client(region, u, creds) - if err != nil { - return err - } - - // List files in path, keep listing until no more objects are found - lastMarker := "" - hasMore := true - for hasMore { - req := &s3.ListObjectsInput{ - Bucket: aws.String(bucket), - Prefix: aws.String(path), - } - if lastMarker != "" { - req.Marker = aws.String(lastMarker) - } - - resp, err := client.ListObjects(req) - if err != nil { - return err - } - - hasMore = aws.BoolValue(resp.IsTruncated) - - // Get each object storing each file relative to the destination path - for _, object := range resp.Contents { - lastMarker = aws.StringValue(object.Key) - objPath := aws.StringValue(object.Key) - - // If the key ends with a backslash assume it is a directory and ignore - if strings.HasSuffix(objPath, "/") { - continue - } - - // Get the object destination path - objDst, err := filepath.Rel(path, objPath) - if err != nil { - return err - } - objDst = filepath.Join(dst, objDst) - - if err := g.getObject(ctx, client, objDst, bucket, objPath, ""); err != nil { - return err - } - } - } - - return nil -} - -func (g *S3Getter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - region, bucket, path, version, creds, err := g.parseUrl(u) - if err != nil { - return err - } - - client, err := g.newS3Client(region, u, creds) - if err != nil { - return err - } - - return g.getObject(ctx, client, dst, bucket, path, version) -} - -func (g *S3Getter) getObject(ctx context.Context, client *s3.S3, dst, bucket, key, version string) error { - req := &s3.GetObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - } - if version != "" { - req.VersionId = aws.String(version) - } - - resp, err := client.GetObject(req) - if err != nil { - return err - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - return copyReader(dst, resp.Body, 0666, g.client.umask()) -} - -func (g *S3Getter) getAWSConfig(region string, url *url.URL, creds *credentials.Credentials) *aws.Config { - conf := &aws.Config{} - metadataURLOverride := os.Getenv("AWS_METADATA_URL") - if creds == nil && metadataURLOverride != "" { - creds = credentials.NewChainCredentials( - []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(&aws.Config{ - Endpoint: aws.String(metadataURLOverride), - })), - }, - }) - } - - if creds != nil { - conf.Endpoint = &url.Host - conf.S3ForcePathStyle = aws.Bool(true) - if url.Scheme == "http" { - conf.DisableSSL = aws.Bool(true) - } - } - - conf.Credentials = creds - if region != "" { - conf.Region = aws.String(region) - } - - return conf.WithCredentialsChainVerboseErrors(true) -} - -func (g *S3Getter) parseUrl(u *url.URL) (region, bucket, path, version string, creds *credentials.Credentials, err error) { - // This just check whether we are dealing with S3 or - // any other S3 compliant service. S3 has a predictable - // url as others do not - if strings.Contains(u.Host, "amazonaws.com") { - // Amazon S3 supports both virtual-hosted–style and path-style URLs to access a bucket, although path-style is deprecated - // In both cases few older regions supports dash-style region indication (s3-Region) even if AWS discourages their use. - // The same bucket could be reached with: - // bucket.s3.region.amazonaws.com/path - // bucket.s3-region.amazonaws.com/path - // s3.amazonaws.com/bucket/path - // s3-region.amazonaws.com/bucket/path - - hostParts := strings.Split(u.Host, ".") - switch len(hostParts) { - // path-style - case 3: - // Parse the region out of the first part of the host - region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") - if region == "" { - region = "us-east-1" - } - pathParts := strings.SplitN(u.Path, "/", 3) - bucket = pathParts[1] - path = pathParts[2] - // vhost-style, dash region indication - case 4: - // Parse the region out of the first part of the host - region = strings.TrimPrefix(strings.TrimPrefix(hostParts[1], "s3-"), "s3") - if region == "" { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } - pathParts := strings.SplitN(u.Path, "/", 2) - bucket = hostParts[0] - path = pathParts[1] - //vhost-style, dot region indication - case 5: - region = hostParts[2] - pathParts := strings.SplitN(u.Path, "/", 2) - bucket = hostParts[0] - path = pathParts[1] - - } - if len(hostParts) < 3 && len(hostParts) > 5 { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } - version = u.Query().Get("version") - - } else { - pathParts := strings.SplitN(u.Path, "/", 3) - if len(pathParts) != 3 { - err = fmt.Errorf("URL is not a valid S3 complaint URL") - return - } - bucket = pathParts[1] - path = pathParts[2] - version = u.Query().Get("version") - region = u.Query().Get("region") - if region == "" { - region = "us-east-1" - } - } - - _, hasAwsId := u.Query()["aws_access_key_id"] - _, hasAwsSecret := u.Query()["aws_access_key_secret"] - _, hasAwsToken := u.Query()["aws_access_token"] - if hasAwsId || hasAwsSecret || hasAwsToken { - creds = credentials.NewStaticCredentials( - u.Query().Get("aws_access_key_id"), - u.Query().Get("aws_access_key_secret"), - u.Query().Get("aws_access_token"), - ) - } - - return -} - -func (g *S3Getter) newS3Client( - region string, url *url.URL, creds *credentials.Credentials, -) (*s3.S3, error) { - var sess *session.Session - - if profile := url.Query().Get("aws_profile"); profile != "" { - var err error - sess, err = session.NewSessionWithOptions(session.Options{ - Profile: profile, - SharedConfigState: session.SharedConfigEnable, - }) - if err != nil { - return nil, err - } - } else { - config := g.getAWSConfig(region, url, creds) - sess = session.New(config) - } - - return s3.New(sess), nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url.go b/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url.go deleted file mode 100644 index 02497c2543..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url.go +++ /dev/null @@ -1,14 +0,0 @@ -package url - -import ( - "net/url" -) - -// Parse parses rawURL into a URL structure. -// The rawURL may be relative or absolute. -// -// Parse is a wrapper for the Go stdlib net/url Parse function, but returns -// Windows "safe" URLs on Windows platforms. -func Parse(rawURL string) (*url.URL, error) { - return parse(rawURL) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url_unix.go b/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url_unix.go deleted file mode 100644 index ed1352a917..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url_unix.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !windows - -package url - -import ( - "net/url" -) - -func parse(rawURL string) (*url.URL, error) { - return url.Parse(rawURL) -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url_windows.go b/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url_windows.go deleted file mode 100644 index 4280ec59a8..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/helper/url/url_windows.go +++ /dev/null @@ -1,39 +0,0 @@ -package url - -import ( - "fmt" - "net/url" - "path/filepath" - "strings" -) - -func parse(rawURL string) (*url.URL, error) { - // Make sure we're using "/" since URLs are "/"-based. - rawURL = filepath.ToSlash(rawURL) - - if len(rawURL) > 1 && rawURL[1] == ':' { - // Assume we're dealing with a drive letter. In which case we - // force the 'file' scheme to avoid "net/url" URL.String() prepending - // our url with "./". - rawURL = "file://" + rawURL - } - - u, err := url.Parse(rawURL) - if err != nil { - return nil, err - } - - if len(u.Host) > 1 && u.Host[1] == ':' && strings.HasPrefix(rawURL, "file://") { - // Assume we're dealing with a drive letter file path where the drive - // letter has been parsed into the URL Host. - u.Path = fmt.Sprintf("%s%s", u.Host, u.Path) - u.Host = "" - } - - // Remove leading slash for absolute file paths. - if len(u.Path) > 2 && u.Path[0] == '/' && u.Path[2] == ':' { - u.Path = u.Path[1:] - } - - return u, err -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/netrc.go b/ibm/vendor/github.com/hashicorp/go-getter/netrc.go deleted file mode 100644 index c7f6a3fb3f..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/netrc.go +++ /dev/null @@ -1,67 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "os" - "runtime" - - "github.com/bgentry/go-netrc/netrc" - "github.com/mitchellh/go-homedir" -) - -// addAuthFromNetrc adds auth information to the URL from the user's -// netrc file if it can be found. This will only add the auth info -// if the URL doesn't already have auth info specified and the -// the username is blank. -func addAuthFromNetrc(u *url.URL) error { - // If the URL already has auth information, do nothing - if u.User != nil && u.User.Username() != "" { - return nil - } - - // Get the netrc file path - path := os.Getenv("NETRC") - if path == "" { - filename := ".netrc" - if runtime.GOOS == "windows" { - filename = "_netrc" - } - - var err error - path, err = homedir.Expand("~/" + filename) - if err != nil { - return err - } - } - - // If the file is not a file, then do nothing - if fi, err := os.Stat(path); err != nil { - // File doesn't exist, do nothing - if os.IsNotExist(err) { - return nil - } - - // Some other error! - return err - } else if fi.IsDir() { - // File is directory, ignore - return nil - } - - // Load up the netrc file - net, err := netrc.ParseFile(path) - if err != nil { - return fmt.Errorf("Error parsing netrc file at %q: %s", path, err) - } - - machine := net.FindMachine(u.Host) - if machine == nil { - // Machine not found, no problem - return nil - } - - // Set the user info - u.User = url.UserPassword(machine.Login, machine.Password) - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/source.go b/ibm/vendor/github.com/hashicorp/go-getter/source.go deleted file mode 100644 index dab6d400cb..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/source.go +++ /dev/null @@ -1,75 +0,0 @@ -package getter - -import ( - "fmt" - "path/filepath" - "strings" -) - -// SourceDirSubdir takes a source URL and returns a tuple of the URL without -// the subdir and the subdir. -// -// ex: -// dom.com/path/?q=p => dom.com/path/?q=p, "" -// proto://dom.com/path//*?q=p => proto://dom.com/path?q=p, "*" -// proto://dom.com/path//path2?q=p => proto://dom.com/path?q=p, "path2" -// -func SourceDirSubdir(src string) (string, string) { - - // URL might contains another url in query parameters - stop := len(src) - if idx := strings.Index(src, "?"); idx > -1 { - stop = idx - } - - // Calculate an offset to avoid accidentally marking the scheme - // as the dir. - var offset int - if idx := strings.Index(src[:stop], "://"); idx > -1 { - offset = idx + 3 - } - - // First see if we even have an explicit subdir - idx := strings.Index(src[offset:stop], "//") - if idx == -1 { - return src, "" - } - - idx += offset - subdir := src[idx+2:] - src = src[:idx] - - // Next, check if we have query parameters and push them onto the - // URL. - if idx = strings.Index(subdir, "?"); idx > -1 { - query := subdir[idx:] - subdir = subdir[:idx] - src += query - } - - return src, subdir -} - -// SubdirGlob returns the actual subdir with globbing processed. -// -// dst should be a destination directory that is already populated (the -// download is complete) and subDir should be the set subDir. If subDir -// is an empty string, this returns an empty string. -// -// The returned path is the full absolute path. -func SubdirGlob(dst, subDir string) (string, error) { - matches, err := filepath.Glob(filepath.Join(dst, subDir)) - if err != nil { - return "", err - } - - if len(matches) == 0 { - return "", fmt.Errorf("subdir %q not found", subDir) - } - - if len(matches) > 1 { - return "", fmt.Errorf("subdir %q matches multiple paths", subDir) - } - - return matches[0], nil -} diff --git a/ibm/vendor/github.com/hashicorp/go-getter/storage.go b/ibm/vendor/github.com/hashicorp/go-getter/storage.go deleted file mode 100644 index 2bc6b9ec33..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-getter/storage.go +++ /dev/null @@ -1,13 +0,0 @@ -package getter - -// Storage is an interface that knows how to lookup downloaded directories -// as well as download and update directories from their sources into the -// proper location. -type Storage interface { - // Dir returns the directory on local disk where the directory source - // can be loaded from. - Dir(string) (string, bool, error) - - // Get will download and optionally update the given directory. - Get(string, string, bool) error -} diff --git a/ibm/vendor/github.com/hashicorp/go-hclog/interceptlogger.go b/ibm/vendor/github.com/hashicorp/go-hclog/interceptlogger.go index d8e2e76fc3..631baf2f0c 100644 --- a/ibm/vendor/github.com/hashicorp/go-hclog/interceptlogger.go +++ b/ibm/vendor/github.com/hashicorp/go-hclog/interceptlogger.go @@ -18,8 +18,13 @@ type interceptLogger struct { } func NewInterceptLogger(opts *LoggerOptions) InterceptLogger { + l := newLogger(opts) + if l.callerOffset > 0 { + // extra frames for interceptLogger.{Warn,Info,Log,etc...}, and interceptLogger.log + l.callerOffset += 2 + } intercept := &interceptLogger{ - Logger: New(opts), + Logger: l, mu: new(sync.Mutex), sinkCount: new(int32), Sinks: make(map[SinkAdapter]struct{}), @@ -31,6 +36,14 @@ func NewInterceptLogger(opts *LoggerOptions) InterceptLogger { } func (i *interceptLogger) Log(level Level, msg string, args ...interface{}) { + i.log(level, msg, args...) +} + +// log is used to make the caller stack frame lookup consistent. If Warn,Info,etc +// all called Log then direct calls to Log would have a different stack frame +// depth. By having all the methods call the same helper we ensure the stack +// frame depth is the same. +func (i *interceptLogger) log(level Level, msg string, args ...interface{}) { i.Logger.Log(level, msg, args...) if atomic.LoadInt32(i.sinkCount) == 0 { return @@ -45,72 +58,27 @@ func (i *interceptLogger) Log(level Level, msg string, args ...interface{}) { // Emit the message and args at TRACE level to log and sinks func (i *interceptLogger) Trace(msg string, args ...interface{}) { - i.Logger.Trace(msg, args...) - if atomic.LoadInt32(i.sinkCount) == 0 { - return - } - - i.mu.Lock() - defer i.mu.Unlock() - for s := range i.Sinks { - s.Accept(i.Name(), Trace, msg, i.retrieveImplied(args...)...) - } + i.log(Trace, msg, args...) } // Emit the message and args at DEBUG level to log and sinks func (i *interceptLogger) Debug(msg string, args ...interface{}) { - i.Logger.Debug(msg, args...) - if atomic.LoadInt32(i.sinkCount) == 0 { - return - } - - i.mu.Lock() - defer i.mu.Unlock() - for s := range i.Sinks { - s.Accept(i.Name(), Debug, msg, i.retrieveImplied(args...)...) - } + i.log(Debug, msg, args...) } // Emit the message and args at INFO level to log and sinks func (i *interceptLogger) Info(msg string, args ...interface{}) { - i.Logger.Info(msg, args...) - if atomic.LoadInt32(i.sinkCount) == 0 { - return - } - - i.mu.Lock() - defer i.mu.Unlock() - for s := range i.Sinks { - s.Accept(i.Name(), Info, msg, i.retrieveImplied(args...)...) - } + i.log(Info, msg, args...) } // Emit the message and args at WARN level to log and sinks func (i *interceptLogger) Warn(msg string, args ...interface{}) { - i.Logger.Warn(msg, args...) - if atomic.LoadInt32(i.sinkCount) == 0 { - return - } - - i.mu.Lock() - defer i.mu.Unlock() - for s := range i.Sinks { - s.Accept(i.Name(), Warn, msg, i.retrieveImplied(args...)...) - } + i.log(Warn, msg, args...) } // Emit the message and args at ERROR level to log and sinks func (i *interceptLogger) Error(msg string, args ...interface{}) { - i.Logger.Error(msg, args...) - if atomic.LoadInt32(i.sinkCount) == 0 { - return - } - - i.mu.Lock() - defer i.mu.Unlock() - for s := range i.Sinks { - s.Accept(i.Name(), Error, msg, i.retrieveImplied(args...)...) - } + i.log(Error, msg, args...) } func (i *interceptLogger) retrieveImplied(args ...interface{}) []interface{} { @@ -123,7 +91,7 @@ func (i *interceptLogger) retrieveImplied(args ...interface{}) []interface{} { return cp } -// Create a new sub-Logger that a name decending from the current name. +// Create a new sub-Logger that a name descending from the current name. // This is used to create a subsystem specific Logger. // Registered sinks will subscribe to these messages as well. func (i *interceptLogger) Named(name string) Logger { diff --git a/ibm/vendor/github.com/hashicorp/go-hclog/intlogger.go b/ibm/vendor/github.com/hashicorp/go-hclog/intlogger.go index f961ed9191..6099e67260 100644 --- a/ibm/vendor/github.com/hashicorp/go-hclog/intlogger.go +++ b/ibm/vendor/github.com/hashicorp/go-hclog/intlogger.go @@ -21,10 +21,14 @@ import ( "github.com/fatih/color" ) -// TimeFormat to use for logging. This is a version of RFC3339 that contains -// contains millisecond precision +// TimeFormat is the time format to use for plain (non-JSON) output. +// This is a version of RFC3339 that contains millisecond precision. const TimeFormat = "2006-01-02T15:04:05.000Z0700" +// TimeFormatJSON is the time format to use for JSON output. +// This is a version of RFC3339 that contains microsecond precision. +const TimeFormatJSON = "2006-01-02T15:04:05.000000Z07:00" + // errJsonUnsupportedTypeMsg is included in log json entries, if an arg cannot be serialized to json const errJsonUnsupportedTypeMsg = "logging contained values that don't serialize to json" @@ -52,10 +56,11 @@ var _ Logger = &intLogger{} // intLogger is an internal logger implementation. Internal in that it is // defined entirely by this package. type intLogger struct { - json bool - caller bool - name string - timeFormat string + json bool + callerOffset int + name string + timeFormat string + disableTime bool // This is an interface so that it's shared by any derived loggers, since // those derived loggers share the bufio.Writer as well. @@ -79,7 +84,12 @@ func New(opts *LoggerOptions) Logger { // NewSinkAdapter returns a SinkAdapter with configured settings // defined by LoggerOptions func NewSinkAdapter(opts *LoggerOptions) SinkAdapter { - return newLogger(opts) + l := newLogger(opts) + if l.callerOffset > 0 { + // extra frames for interceptLogger.{Warn,Info,Log,etc...}, and SinkAdapter.Accept + l.callerOffset += 2 + } + return l } func newLogger(opts *LoggerOptions) *intLogger { @@ -104,29 +114,37 @@ func newLogger(opts *LoggerOptions) *intLogger { l := &intLogger{ json: opts.JSONFormat, - caller: opts.IncludeLocation, name: opts.Name, timeFormat: TimeFormat, + disableTime: opts.DisableTime, mutex: mutex, writer: newWriter(output, opts.Color), level: new(int32), exclude: opts.Exclude, independentLevels: opts.IndependentLevels, } + if opts.IncludeLocation { + l.callerOffset = offsetIntLogger + opts.AdditionalLocationOffset + } - l.setColorization(opts) - - if opts.DisableTime { - l.timeFormat = "" - } else if opts.TimeFormat != "" { + if l.json { + l.timeFormat = TimeFormatJSON + } + if opts.TimeFormat != "" { l.timeFormat = opts.TimeFormat } + l.setColorization(opts) + atomic.StoreInt32(l.level, int32(level)) return l } +// offsetIntLogger is the stack frame offset in the call stack for the caller to +// one of the Warn,Info,Log,etc methods. +const offsetIntLogger = 3 + // Log a message and a set of key/value pairs if the given level is at // or more severe that the threshold configured in the Logger. func (l *intLogger) log(name string, level Level, msg string, args ...interface{}) { @@ -183,7 +201,8 @@ func trimCallerPath(path string) string { // Non-JSON logging format function func (l *intLogger) logPlain(t time.Time, name string, level Level, msg string, args ...interface{}) { - if len(l.timeFormat) > 0 { + + if !l.disableTime { l.writer.WriteString(t.Format(l.timeFormat)) l.writer.WriteByte(' ') } @@ -195,17 +214,8 @@ func (l *intLogger) logPlain(t time.Time, name string, level Level, msg string, l.writer.WriteString("[?????]") } - offset := 3 - if l.caller { - // Check if the caller is inside our package and inside - // a logger implementation file - if _, file, _, ok := runtime.Caller(3); ok { - if strings.HasSuffix(file, "intlogger.go") || strings.HasSuffix(file, "interceptlogger.go") { - offset = 4 - } - } - - if _, file, line, ok := runtime.Caller(offset); ok { + if l.callerOffset > 0 { + if _, file, line, ok := runtime.Caller(l.callerOffset); ok { l.writer.WriteByte(' ') l.writer.WriteString(trimCallerPath(file)) l.writer.WriteByte(':') @@ -251,6 +261,9 @@ func (l *intLogger) logPlain(t time.Time, name string, level Level, msg string, switch st := args[i+1].(type) { case string: val = st + if st == "" { + val = `""` + } case int: val = strconv.FormatInt(int64(st), 10) case int64: @@ -292,20 +305,32 @@ func (l *intLogger) logPlain(t time.Time, name string, level Level, msg string, } } - l.writer.WriteByte(' ') + var key string + switch st := args[i].(type) { case string: - l.writer.WriteString(st) + key = st default: - l.writer.WriteString(fmt.Sprintf("%s", st)) + key = fmt.Sprintf("%s", st) } - l.writer.WriteByte('=') - if !raw && strings.ContainsAny(val, " \t\n\r") { + if strings.Contains(val, "\n") { + l.writer.WriteString("\n ") + l.writer.WriteString(key) + l.writer.WriteString("=\n") + writeIndent(l.writer, val, " | ") + l.writer.WriteString(" ") + } else if !raw && strings.ContainsAny(val, " \t") { + l.writer.WriteByte(' ') + l.writer.WriteString(key) + l.writer.WriteByte('=') l.writer.WriteByte('"') l.writer.WriteString(val) l.writer.WriteByte('"') } else { + l.writer.WriteByte(' ') + l.writer.WriteString(key) + l.writer.WriteByte('=') l.writer.WriteString(val) } } @@ -319,6 +344,25 @@ func (l *intLogger) logPlain(t time.Time, name string, level Level, msg string, } } +func writeIndent(w *writer, str string, indent string) { + for { + nl := strings.IndexByte(str, "\n"[0]) + if nl == -1 { + if str != "" { + w.WriteString(indent) + w.WriteString(str) + w.WriteString("\n") + } + return + } + + w.WriteString(indent) + w.WriteString(str[:nl]) + w.WriteString("\n") + str = str[nl+1:] + } +} + func (l *intLogger) renderSlice(v reflect.Value) string { var buf bytes.Buffer @@ -335,22 +379,19 @@ func (l *intLogger) renderSlice(v reflect.Value) string { switch sv.Kind() { case reflect.String: - val = sv.String() + val = strconv.Quote(sv.String()) case reflect.Int, reflect.Int16, reflect.Int32, reflect.Int64: val = strconv.FormatInt(sv.Int(), 10) case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: val = strconv.FormatUint(sv.Uint(), 10) default: val = fmt.Sprintf("%v", sv.Interface()) + if strings.ContainsAny(val, " \t\n\r") { + val = strconv.Quote(val) + } } - if strings.ContainsAny(val, " \t\n\r") { - buf.WriteByte('"') - buf.WriteString(val) - buf.WriteByte('"') - } else { - buf.WriteString(val) - } + buf.WriteString(val) } buf.WriteRune(']') @@ -416,8 +457,10 @@ func (l *intLogger) logJSON(t time.Time, name string, level Level, msg string, a func (l intLogger) jsonMapEntry(t time.Time, name string, level Level, msg string) map[string]interface{} { vals := map[string]interface{}{ - "@message": msg, - "@timestamp": t.Format("2006-01-02T15:04:05.000000Z07:00"), + "@message": msg, + } + if !l.disableTime { + vals["@timestamp"] = t.Format(l.timeFormat) } var levelStr string @@ -442,8 +485,8 @@ func (l intLogger) jsonMapEntry(t time.Time, name string, level Level, msg strin vals["@module"] = name } - if l.caller { - if _, file, line, ok := runtime.Caller(4); ok { + if l.callerOffset > 0 { + if _, file, line, ok := runtime.Caller(l.callerOffset + 1); ok { vals["@caller"] = fmt.Sprintf("%s:%d", file, line) } } @@ -633,8 +676,15 @@ func (l *intLogger) StandardLogger(opts *StandardLoggerOptions) *log.Logger { } func (l *intLogger) StandardWriter(opts *StandardLoggerOptions) io.Writer { + newLog := *l + if l.callerOffset > 0 { + // the stack is + // logger.printf() -> l.Output() ->l.out.writer(hclog:stdlogAdaptor.write) -> hclog:stdlogAdaptor.dispatch() + // So plus 4. + newLog.callerOffset = l.callerOffset + 4 + } return &stdlogAdapter{ - log: l, + log: &newLog, inferLevels: opts.InferLevels, forceLevel: opts.ForceLevel, } diff --git a/ibm/vendor/github.com/hashicorp/go-hclog/logger.go b/ibm/vendor/github.com/hashicorp/go-hclog/logger.go index 83eafc152c..7f36b1fd20 100644 --- a/ibm/vendor/github.com/hashicorp/go-hclog/logger.go +++ b/ibm/vendor/github.com/hashicorp/go-hclog/logger.go @@ -235,6 +235,10 @@ type LoggerOptions struct { // Include file and line information in each log line IncludeLocation bool + // AdditionalLocationOffset is the number of additional stack levels to skip + // when finding the file and line information for the log line + AdditionalLocationOffset int + // The time format to use instead of the default TimeFormat string diff --git a/ibm/vendor/github.com/hashicorp/go-multierror/.travis.yml b/ibm/vendor/github.com/hashicorp/go-multierror/.travis.yml deleted file mode 100644 index 304a835955..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-multierror/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -sudo: false - -language: go - -go: - - 1.x - -branches: - only: - - master - -script: make test testrace diff --git a/ibm/vendor/github.com/hashicorp/go-multierror/README.md b/ibm/vendor/github.com/hashicorp/go-multierror/README.md index ead5830f7b..71dd308ed8 100644 --- a/ibm/vendor/github.com/hashicorp/go-multierror/README.md +++ b/ibm/vendor/github.com/hashicorp/go-multierror/README.md @@ -1,10 +1,11 @@ # go-multierror -[![Build Status](http://img.shields.io/travis/hashicorp/go-multierror.svg?style=flat-square)][travis] -[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] +[![CircleCI](https://img.shields.io/circleci/build/github/hashicorp/go-multierror/master)](https://circleci.com/gh/hashicorp/go-multierror) +[![Go Reference](https://pkg.go.dev/badge/github.com/hashicorp/go-multierror.svg)](https://pkg.go.dev/github.com/hashicorp/go-multierror) +![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/hashicorp/go-multierror) -[travis]: https://travis-ci.org/hashicorp/go-multierror -[godocs]: https://godoc.org/github.com/hashicorp/go-multierror +[circleci]: https://app.circleci.com/pipelines/github/hashicorp/go-multierror +[godocs]: https://pkg.go.dev/github.com/hashicorp/go-multierror `go-multierror` is a package for Go that provides a mechanism for representing a list of `error` values as a single `error`. @@ -14,16 +15,35 @@ be a list of errors. If the caller knows this, they can unwrap the list and access the errors. If the caller doesn't know, the error formats to a nice human-readable format. -`go-multierror` implements the -[errwrap](https://github.com/hashicorp/errwrap) interface so that it can -be used with that library, as well. +`go-multierror` is fully compatible with the Go standard library +[errors](https://golang.org/pkg/errors/) package, including the +functions `As`, `Is`, and `Unwrap`. This provides a standardized approach +for introspecting on error values. ## Installation and Docs Install using `go get github.com/hashicorp/go-multierror`. Full documentation is available at -http://godoc.org/github.com/hashicorp/go-multierror +https://pkg.go.dev/github.com/hashicorp/go-multierror + +### Requires go version 1.13 or newer + +`go-multierror` requires go version 1.13 or newer. Go 1.13 introduced +[error wrapping](https://golang.org/doc/go1.13#error_wrapping), which +this library takes advantage of. + +If you need to use an earlier version of go, you can use the +[v1.0.0](https://github.com/hashicorp/go-multierror/tree/v1.0.0) +tag, which doesn't rely on features in go 1.13. + +If you see compile errors that look like the below, it's likely that +you're on an older version of go: + +``` +/go/src/github.com/hashicorp/go-multierror/multierror.go:112:9: undefined: errors.As +/go/src/github.com/hashicorp/go-multierror/multierror.go:117:9: undefined: errors.Is +``` ## Usage @@ -81,6 +101,39 @@ if err := something(); err != nil { } ``` +You can also use the standard [`errors.Unwrap`](https://golang.org/pkg/errors/#Unwrap) +function. This will continue to unwrap into subsequent errors until none exist. + +**Extracting an error** + +The standard library [`errors.As`](https://golang.org/pkg/errors/#As) +function can be used directly with a multierror to extract a specific error: + +```go +// Assume err is a multierror value +err := somefunc() + +// We want to know if "err" has a "RichErrorType" in it and extract it. +var errRich RichErrorType +if errors.As(err, &errRich) { + // It has it, and now errRich is populated. +} +``` + +**Checking for an exact error value** + +Some errors are returned as exact errors such as the [`ErrNotExist`](https://golang.org/pkg/os/#pkg-variables) +error in the `os` package. You can check if this error is present by using +the standard [`errors.Is`](https://golang.org/pkg/errors/#Is) function. + +```go +// Assume err is a multierror value +err := somefunc() +if errors.Is(err, os.ErrNotExist) { + // err contains os.ErrNotExist +} +``` + **Returning a multierror only if there are errors** If you build a `multierror.Error`, you can use the `ErrorOrNil` function diff --git a/ibm/vendor/github.com/hashicorp/go-multierror/append.go b/ibm/vendor/github.com/hashicorp/go-multierror/append.go index 775b6e753e..3e2589bfde 100644 --- a/ibm/vendor/github.com/hashicorp/go-multierror/append.go +++ b/ibm/vendor/github.com/hashicorp/go-multierror/append.go @@ -6,6 +6,8 @@ package multierror // If err is not a multierror.Error, then it will be turned into // one. If any of the errs are multierr.Error, they will be flattened // one level into err. +// Any nil errors within errs will be ignored. If err is nil, a new +// *Error will be returned. func Append(err error, errs ...error) *Error { switch err := err.(type) { case *Error: diff --git a/ibm/vendor/github.com/hashicorp/go-multierror/group.go b/ibm/vendor/github.com/hashicorp/go-multierror/group.go new file mode 100644 index 0000000000..9c29efb7f8 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/go-multierror/group.go @@ -0,0 +1,38 @@ +package multierror + +import "sync" + +// Group is a collection of goroutines which return errors that need to be +// coalesced. +type Group struct { + mutex sync.Mutex + err *Error + wg sync.WaitGroup +} + +// Go calls the given function in a new goroutine. +// +// If the function returns an error it is added to the group multierror which +// is returned by Wait. +func (g *Group) Go(f func() error) { + g.wg.Add(1) + + go func() { + defer g.wg.Done() + + if err := f(); err != nil { + g.mutex.Lock() + g.err = Append(g.err, err) + g.mutex.Unlock() + } + }() +} + +// Wait blocks until all function calls from the Go method have returned, then +// returns the multierror. +func (g *Group) Wait() *Error { + g.wg.Wait() + g.mutex.Lock() + defer g.mutex.Unlock() + return g.err +} diff --git a/ibm/vendor/github.com/hashicorp/go-multierror/multierror.go b/ibm/vendor/github.com/hashicorp/go-multierror/multierror.go index 89b1422d1d..f545743264 100644 --- a/ibm/vendor/github.com/hashicorp/go-multierror/multierror.go +++ b/ibm/vendor/github.com/hashicorp/go-multierror/multierror.go @@ -1,6 +1,7 @@ package multierror import ( + "errors" "fmt" ) @@ -39,13 +40,82 @@ func (e *Error) GoString() string { return fmt.Sprintf("*%#v", *e) } -// WrappedErrors returns the list of errors that this Error is wrapping. -// It is an implementation of the errwrap.Wrapper interface so that -// multierror.Error can be used with that library. +// WrappedErrors returns the list of errors that this Error is wrapping. It is +// an implementation of the errwrap.Wrapper interface so that multierror.Error +// can be used with that library. // -// This method is not safe to be called concurrently and is no different -// than accessing the Errors field directly. It is implemented only to -// satisfy the errwrap.Wrapper interface. +// This method is not safe to be called concurrently. Unlike accessing the +// Errors field directly, this function also checks if the multierror is nil to +// prevent a null-pointer panic. It satisfies the errwrap.Wrapper interface. func (e *Error) WrappedErrors() []error { + if e == nil { + return nil + } return e.Errors } + +// Unwrap returns an error from Error (or nil if there are no errors). +// This error returned will further support Unwrap to get the next error, +// etc. The order will match the order of Errors in the multierror.Error +// at the time of calling. +// +// The resulting error supports errors.As/Is/Unwrap so you can continue +// to use the stdlib errors package to introspect further. +// +// This will perform a shallow copy of the errors slice. Any errors appended +// to this error after calling Unwrap will not be available until a new +// Unwrap is called on the multierror.Error. +func (e *Error) Unwrap() error { + // If we have no errors then we do nothing + if e == nil || len(e.Errors) == 0 { + return nil + } + + // If we have exactly one error, we can just return that directly. + if len(e.Errors) == 1 { + return e.Errors[0] + } + + // Shallow copy the slice + errs := make([]error, len(e.Errors)) + copy(errs, e.Errors) + return chain(errs) +} + +// chain implements the interfaces necessary for errors.Is/As/Unwrap to +// work in a deterministic way with multierror. A chain tracks a list of +// errors while accounting for the current represented error. This lets +// Is/As be meaningful. +// +// Unwrap returns the next error. In the cleanest form, Unwrap would return +// the wrapped error here but we can't do that if we want to properly +// get access to all the errors. Instead, users are recommended to use +// Is/As to get the correct error type out. +// +// Precondition: []error is non-empty (len > 0) +type chain []error + +// Error implements the error interface +func (e chain) Error() string { + return e[0].Error() +} + +// Unwrap implements errors.Unwrap by returning the next error in the +// chain or nil if there are no more errors. +func (e chain) Unwrap() error { + if len(e) == 1 { + return nil + } + + return e[1:] +} + +// As implements errors.As by attempting to map to the current value. +func (e chain) As(target interface{}) bool { + return errors.As(e[0], target) +} + +// Is implements errors.Is by comparing the current value directly. +func (e chain) Is(target error) bool { + return errors.Is(e[0], target) +} diff --git a/ibm/vendor/github.com/hashicorp/go-safetemp/LICENSE b/ibm/vendor/github.com/hashicorp/go-safetemp/LICENSE deleted file mode 100644 index be2cc4dfb6..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-safetemp/LICENSE +++ /dev/null @@ -1,362 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. diff --git a/ibm/vendor/github.com/hashicorp/go-safetemp/README.md b/ibm/vendor/github.com/hashicorp/go-safetemp/README.md deleted file mode 100644 index 02ece33171..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-safetemp/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# go-safetemp -[![Godoc](https://godoc.org/github.com/hashcorp/go-safetemp?status.svg)](https://godoc.org/github.com/hashicorp/go-safetemp) - -Functions for safely working with temporary directories and files. - -## Why? - -The Go standard library provides the excellent `ioutil` package for -working with temporary directories and files. This library builds on top -of that to provide safe abstractions above that. diff --git a/ibm/vendor/github.com/hashicorp/go-safetemp/safetemp.go b/ibm/vendor/github.com/hashicorp/go-safetemp/safetemp.go deleted file mode 100644 index c4ae72b789..0000000000 --- a/ibm/vendor/github.com/hashicorp/go-safetemp/safetemp.go +++ /dev/null @@ -1,40 +0,0 @@ -package safetemp - -import ( - "io" - "io/ioutil" - "os" - "path/filepath" -) - -// Dir creates a new temporary directory that isn't yet created. This -// can be used with calls that expect a non-existent directory. -// -// The directory is created as a child of a temporary directory created -// within the directory dir starting with prefix. The temporary directory -// returned is always named "temp". The parent directory has the specified -// prefix. -// -// The returned io.Closer should be used to clean up the returned directory. -// This will properly remove the returned directory and any other temporary -// files created. -// -// If an error is returned, the Closer does not need to be called (and will -// be nil). -func Dir(dir, prefix string) (string, io.Closer, error) { - // Create the temporary directory - td, err := ioutil.TempDir(dir, prefix) - if err != nil { - return "", nil, err - } - - return filepath.Join(td, "temp"), pathCloser(td), nil -} - -// pathCloser implements io.Closer to remove the given path on Close. -type pathCloser string - -// Close deletes this path. -func (p pathCloser) Close() error { - return os.RemoveAll(string(p)) -} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/.go-version b/ibm/vendor/github.com/hashicorp/hc-install/.go-version new file mode 100644 index 0000000000..b9a05a6dc1 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/.go-version @@ -0,0 +1 @@ +1.17.3 diff --git a/ibm/vendor/github.com/hashicorp/hc-install/.goreleaser.yml b/ibm/vendor/github.com/hashicorp/hc-install/.goreleaser.yml new file mode 100644 index 0000000000..5e5832867c --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/.goreleaser.yml @@ -0,0 +1,29 @@ +project_name: tfinstall +builds: + - env: + - CGO_ENABLED=0 + main: ./cmd/hcinstall/main.go + mod_timestamp: '{{ .CommitTimestamp }}' + id: "tfinstall" + binary: tfinstall + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm + - arm64 +archives: + - files: [] + format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +changelog: + skip: true diff --git a/ibm/vendor/github.com/hashicorp/hc-install/LICENSE b/ibm/vendor/github.com/hashicorp/hc-install/LICENSE new file mode 100644 index 0000000000..a612ad9813 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/ibm/vendor/github.com/hashicorp/hc-install/README.md b/ibm/vendor/github.com/hashicorp/hc-install/README.md new file mode 100644 index 0000000000..87c06a2034 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/README.md @@ -0,0 +1,133 @@ +# hc-install + +An **experimental** Go module for downloading or locating HashiCorp binaries, verifying signatures and checksums, and asserting version constraints. + +This module is a successor to tfinstall, available in pre-1.0 versions of [terraform-exec](https://github.com/hashicorp/terraform-exec). Current users of tfinstall are advised to move to hc-install before upgrading terraform-exec to v1.0.0. + +## hc-install is not a package manager + +This library is intended for use within Go programs or automated environments (such as CIs) +which have some business downloading or otherwise locating HashiCorp binaries. + +The included command-line utility, `hc-install`, is a convenient way of using +the library in ad-hoc or CI shell scripting outside of Go. + +`hc-install` does **not**: + + - Determine suitable installation path based on target system. e.g. in `/usr/bin` or `/usr/local/bin` on Unix based system. + - Deal with execution of installed binaries (via service files or otherwise). + - Upgrade existing binaries on your system. + - Add nor link downloaded binaries to your `$PATH`. + +## API + +The `Installer` offers a few high-level methods: + + - `Ensure(context.Context, []src.Source)` to find, install, or build a product version + - `Install(context.Context, []src.Installable)` to install a product version + +### Sources + +The `Installer` methods accept number of different `Source` types. +Each comes with different trade-offs described below. + + - `fs.{AnyVersion,ExactVersion}` - Finds a binary in `$PATH` (or additional paths) + - **Pros:** + - This is most convenient when you already have the product installed on your system + which you already manage. + - **Cons:** + - Only relies on a single version, expects _you_ to manage the installation + - _Not recommended_ for any environment where product installation is not controlled or managed by you (e.g. default GitHub Actions image managed by GitHub) + - `releases.{LatestVersion,ExactVersion}` - Downloads, verifies & installs any known product from `releases.hashicorp.com` + - **Pros:** + - Fast and reliable way of obtaining any pre-built version of any product + - **Cons:** + - Installation may consume some bandwith, disk space and a little time + - Potentially less stable builds (see `checkpoint` below) + - `checkpoint.{LatestVersion}` - Downloads, verifies & installs any known product available in HashiCorp Checkpoint + - **Pros:** + - Checkpoint typically contains only product versions considered stable + - **Cons:** + - Installation may consume some bandwith, disk space and a little time + - Currently doesn't allow installation of a old versions (see `releases` above) + - `build.{GitRevision}` - Clones raw source code and builds the product from it + - **Pros:** + - Useful for catching bugs and incompatibilities as early as possible (prior to product release). + - **Cons:** + - Building from scratch can consume significant amount of time & resources (CPU, memory, bandwith, disk space) + - There are no guarantees that build instructions will always be up-to-date + - There's increased likelihood of build containing bugs prior to release + - Any CI builds relying on this are likely to be fragile + +## Example Usage + +### Install single version + +```go +TODO +``` + +### Find or install single version + +```go +i := NewInstaller() + +v0_14_0 := version.Must(version.NewVersion("0.14.0")) + +execPath, err := i.Ensure(context.Background(), []src.Source{ + &fs.ExactVersion{ + Product: product.Terraform, + Version: v0_14_0, + }, + &releases.ExactVersion{ + Product: product.Terraform, + Version: v0_14_0, + }, +}) +if err != nil { + // process err +} + +// run any tests + +defer i.Remove() +``` + +### Install multiple versions + +```go +TODO +``` + +### Install and build multiple versions + +```go +i := NewInstaller() + +vc, _ := version.NewConstraint(">= 0.12") +rv := &releases.Versions{ + Product: product.Terraform, + Constraints: vc, +} + +versions, err := rv.List(context.Background()) +if err != nil { + return err +} +versions = append(versions, &build.GitRevision{Ref: "HEAD"}) + +for _, installableVersion := range versions { + execPath, err := i.Ensure(context.Background(), []src.Source{ + installableVersion, + }) + if err != nil { + return err + } + + // Do some testing here + _ = execPath + + // clean up + os.Remove(execPath) +} +``` diff --git a/ibm/vendor/github.com/hashicorp/hc-install/checkpoint/latest_version.go b/ibm/vendor/github.com/hashicorp/hc-install/checkpoint/latest_version.go new file mode 100644 index 0000000000..04fa241609 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/checkpoint/latest_version.go @@ -0,0 +1,154 @@ +package checkpoint + +import ( + "context" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "runtime" + "time" + + checkpoint "github.com/hashicorp/go-checkpoint" + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/internal/pubkey" + rjson "github.com/hashicorp/hc-install/internal/releasesjson" + isrc "github.com/hashicorp/hc-install/internal/src" + "github.com/hashicorp/hc-install/internal/validators" + "github.com/hashicorp/hc-install/product" +) + +var ( + defaultTimeout = 30 * time.Second + discardLogger = log.New(ioutil.Discard, "", 0) +) + +// LatestVersion installs the latest version known to Checkpoint +// to OS temp directory, or to InstallDir (if not empty) +type LatestVersion struct { + Product product.Product + Timeout time.Duration + SkipChecksumVerification bool + InstallDir string + + // ArmoredPublicKey is a public PGP key in ASCII/armor format to use + // instead of built-in pubkey to verify signature of downloaded checksums + ArmoredPublicKey string + + logger *log.Logger + pathsToRemove []string +} + +func (*LatestVersion) IsSourceImpl() isrc.InstallSrcSigil { + return isrc.InstallSrcSigil{} +} + +func (lv *LatestVersion) SetLogger(logger *log.Logger) { + lv.logger = logger +} + +func (lv *LatestVersion) log() *log.Logger { + if lv.logger == nil { + return discardLogger + } + return lv.logger +} + +func (lv *LatestVersion) Validate() error { + if !validators.IsProductNameValid(lv.Product.Name) { + return fmt.Errorf("invalid product name: %q", lv.Product.Name) + } + if !validators.IsBinaryNameValid(lv.Product.BinaryName()) { + return fmt.Errorf("invalid binary name: %q", lv.Product.BinaryName()) + } + + return nil +} + +func (lv *LatestVersion) Install(ctx context.Context) (string, error) { + timeout := defaultTimeout + if lv.Timeout > 0 { + timeout = lv.Timeout + } + ctx, cancelFunc := context.WithTimeout(ctx, timeout) + defer cancelFunc() + + // TODO: Introduce CheckWithContext to allow for cancellation + resp, err := checkpoint.Check(&checkpoint.CheckParams{ + Product: lv.Product.Name, + OS: runtime.GOOS, + Arch: runtime.GOARCH, + Force: true, + }) + if err != nil { + return "", err + } + + latestVersion, err := version.NewVersion(resp.CurrentVersion) + if err != nil { + return "", err + } + + if lv.pathsToRemove == nil { + lv.pathsToRemove = make([]string, 0) + } + + dstDir := lv.InstallDir + if dstDir == "" { + var err error + dirName := fmt.Sprintf("%s_*", lv.Product.Name) + dstDir, err = ioutil.TempDir("", dirName) + if err != nil { + return "", err + } + lv.pathsToRemove = append(lv.pathsToRemove, dstDir) + lv.log().Printf("created new temp dir at %s", dstDir) + } + lv.log().Printf("will install into dir at %s", dstDir) + + rels := rjson.NewReleases() + rels.SetLogger(lv.log()) + pv, err := rels.GetProductVersion(ctx, lv.Product.Name, latestVersion) + if err != nil { + return "", err + } + + d := &rjson.Downloader{ + Logger: lv.log(), + VerifyChecksum: !lv.SkipChecksumVerification, + ArmoredPublicKey: pubkey.DefaultPublicKey, + BaseURL: rels.BaseURL, + } + if lv.ArmoredPublicKey != "" { + d.ArmoredPublicKey = lv.ArmoredPublicKey + } + err = d.DownloadAndUnpack(ctx, pv, dstDir) + if err != nil { + return "", err + } + + execPath := filepath.Join(dstDir, lv.Product.BinaryName()) + + lv.pathsToRemove = append(lv.pathsToRemove, execPath) + + lv.log().Printf("changing perms of %s", execPath) + err = os.Chmod(execPath, 0o700) + if err != nil { + return "", err + } + + return execPath, nil +} + +func (lv *LatestVersion) Remove(ctx context.Context) error { + if lv.pathsToRemove != nil { + for _, path := range lv.pathsToRemove { + err := os.RemoveAll(path) + if err != nil { + return err + } + } + } + return nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/errors/errors.go b/ibm/vendor/github.com/hashicorp/hc-install/errors/errors.go new file mode 100644 index 0000000000..8d4f1d22d8 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/errors/errors.go @@ -0,0 +1,18 @@ +package errors + +type skippableErr struct { + Err error +} + +func (e skippableErr) Error() string { + return e.Err.Error() +} + +func SkippableErr(err error) skippableErr { + return skippableErr{Err: err} +} + +func IsErrorSkippable(err error) bool { + _, ok := err.(skippableErr) + return ok +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/fs/any_version.go b/ibm/vendor/github.com/hashicorp/hc-install/fs/any_version.go new file mode 100644 index 0000000000..fc1f946340 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/fs/any_version.go @@ -0,0 +1,95 @@ +package fs + +import ( + "context" + "fmt" + "log" + "path/filepath" + + "github.com/hashicorp/hc-install/errors" + "github.com/hashicorp/hc-install/internal/src" + "github.com/hashicorp/hc-install/internal/validators" + "github.com/hashicorp/hc-install/product" +) + +// AnyVersion finds an executable binary of any version +// either defined by ExactBinPath, or as part of Product. +// +// When ExactBinPath is used, the source is skipped when +// the binary is not found or accessible/executable. +// +// When Product is used, binary name is looked up within system $PATH +// and any declared ExtraPaths (which are *appended* to +// any directories in $PATH). Source is skipped if no binary +// is found or accessible/executable. +type AnyVersion struct { + // Product represents the product (its binary name to look up), + // conflicts with ExactBinPath + Product *product.Product + + // ExtraPaths represents additional dir paths to be appended to + // the default system $PATH, conflicts with ExactBinPath + ExtraPaths []string + + // ExactBinPath represents exact path to the binary, + // conflicts with Product and ExtraPaths + ExactBinPath string + + logger *log.Logger +} + +func (*AnyVersion) IsSourceImpl() src.InstallSrcSigil { + return src.InstallSrcSigil{} +} + +func (av *AnyVersion) Validate() error { + if av.ExactBinPath == "" && av.Product == nil { + return fmt.Errorf("must use either ExactBinPath or Product + ExtraPaths") + } + if av.ExactBinPath != "" && (av.Product != nil || len(av.ExtraPaths) > 0) { + return fmt.Errorf("use either ExactBinPath or Product + ExtraPaths, not both") + } + if av.ExactBinPath != "" && !filepath.IsAbs(av.ExactBinPath) { + return fmt.Errorf("expected ExactBinPath (%q) to be an absolute path", av.ExactBinPath) + } + if av.Product != nil && !validators.IsBinaryNameValid(av.Product.BinaryName()) { + return fmt.Errorf("invalid binary name: %q", av.Product.BinaryName()) + } + return nil +} + +func (av *AnyVersion) SetLogger(logger *log.Logger) { + av.logger = logger +} + +func (av *AnyVersion) log() *log.Logger { + if av.logger == nil { + return discardLogger + } + return av.logger +} + +func (av *AnyVersion) Find(ctx context.Context) (string, error) { + if av.ExactBinPath != "" { + err := checkExecutable(av.ExactBinPath) + if err != nil { + return "", errors.SkippableErr(err) + } + + return av.ExactBinPath, nil + } + + execPath, err := findFile(lookupDirs(av.ExtraPaths), av.Product.BinaryName(), checkExecutable) + if err != nil { + return "", errors.SkippableErr(err) + } + + if !filepath.IsAbs(execPath) { + var err error + execPath, err = filepath.Abs(execPath) + if err != nil { + return "", errors.SkippableErr(err) + } + } + return execPath, nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/fs/exact_version.go b/ibm/vendor/github.com/hashicorp/hc-install/fs/exact_version.go new file mode 100644 index 0000000000..018c1fbadc --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/fs/exact_version.go @@ -0,0 +1,95 @@ +package fs + +import ( + "context" + "fmt" + "log" + "path/filepath" + "time" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/errors" + "github.com/hashicorp/hc-install/internal/src" + "github.com/hashicorp/hc-install/internal/validators" + "github.com/hashicorp/hc-install/product" +) + +// ExactVersion finds the first executable binary of the product name +// which matches the Version within system $PATH and any declared ExtraPaths +// (which are *appended* to any directories in $PATH) +type ExactVersion struct { + Product product.Product + Version *version.Version + ExtraPaths []string + Timeout time.Duration + + logger *log.Logger +} + +func (*ExactVersion) IsSourceImpl() src.InstallSrcSigil { + return src.InstallSrcSigil{} +} + +func (ev *ExactVersion) SetLogger(logger *log.Logger) { + ev.logger = logger +} + +func (ev *ExactVersion) log() *log.Logger { + if ev.logger == nil { + return discardLogger + } + return ev.logger +} + +func (ev *ExactVersion) Validate() error { + if !validators.IsBinaryNameValid(ev.Product.BinaryName()) { + return fmt.Errorf("invalid binary name: %q", ev.Product.BinaryName()) + } + if ev.Version == nil { + return fmt.Errorf("undeclared version") + } + if ev.Product.GetVersion == nil { + return fmt.Errorf("undeclared version getter") + } + return nil +} + +func (ev *ExactVersion) Find(ctx context.Context) (string, error) { + timeout := defaultTimeout + if ev.Timeout > 0 { + timeout = ev.Timeout + } + ctx, cancelFunc := context.WithTimeout(ctx, timeout) + defer cancelFunc() + + execPath, err := findFile(lookupDirs(ev.ExtraPaths), ev.Product.BinaryName(), func(file string) error { + err := checkExecutable(file) + if err != nil { + return err + } + + v, err := ev.Product.GetVersion(ctx, file) + if err != nil { + return err + } + + if !ev.Version.Equal(v) { + return fmt.Errorf("version (%s) doesn't match %s", v, ev.Version) + } + + return nil + }) + if err != nil { + return "", errors.SkippableErr(err) + } + + if !filepath.IsAbs(execPath) { + var err error + execPath, err = filepath.Abs(execPath) + if err != nil { + return "", errors.SkippableErr(err) + } + } + + return execPath, nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/fs/fs.go b/ibm/vendor/github.com/hashicorp/hc-install/fs/fs.go new file mode 100644 index 0000000000..5adb9c329c --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/fs/fs.go @@ -0,0 +1,14 @@ +package fs + +import ( + "io/ioutil" + "log" + "time" +) + +var ( + defaultTimeout = 10 * time.Second + discardLogger = log.New(ioutil.Discard, "", 0) +) + +type fileCheckFunc func(path string) error diff --git a/ibm/vendor/github.com/hashicorp/hc-install/fs/fs_unix.go b/ibm/vendor/github.com/hashicorp/hc-install/fs/fs_unix.go new file mode 100644 index 0000000000..95c5c11f1d --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/fs/fs_unix.go @@ -0,0 +1,45 @@ +//go:build !windows +// +build !windows + +package fs + +import ( + "fmt" + "os" + "os/exec" + "path/filepath" +) + +func lookupDirs(extraDirs []string) []string { + pathVar := os.Getenv("PATH") + dirs := filepath.SplitList(pathVar) + for _, ep := range extraDirs { + dirs = append(dirs, ep) + } + return dirs +} + +func findFile(dirs []string, file string, f fileCheckFunc) (string, error) { + for _, dir := range dirs { + if dir == "" { + // Unix shell semantics: path element "" means "." + dir = "." + } + path := filepath.Join(dir, file) + if err := f(path); err == nil { + return path, nil + } + } + return "", fmt.Errorf("%s: %w", file, exec.ErrNotFound) +} + +func checkExecutable(file string) error { + d, err := os.Stat(file) + if err != nil { + return err + } + if m := d.Mode(); !m.IsDir() && m&0111 != 0 { + return nil + } + return os.ErrPermission +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/fs/fs_windows.go b/ibm/vendor/github.com/hashicorp/hc-install/fs/fs_windows.go new file mode 100644 index 0000000000..2a03c7ad2f --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/fs/fs_windows.go @@ -0,0 +1,81 @@ +package fs + +import ( + "fmt" + "io/fs" + "os" + "os/exec" + "path/filepath" + "strings" +) + +func lookupDirs(extraDirs []string) []string { + pathVar := os.Getenv("path") + dirs := filepath.SplitList(pathVar) + for _, ep := range extraDirs { + dirs = append(dirs, ep) + } + return dirs +} + +func findFile(dirs []string, file string, f fileCheckFunc) (string, error) { + for _, dir := range dirs { + path := filepath.Join(dir, file) + if err := f(path); err == nil { + return path, nil + } + } + return "", fmt.Errorf("%s: %w", file, exec.ErrNotFound) +} + +func checkExecutable(file string) error { + var exts []string + x := os.Getenv(`PATHEXT`) + if x != "" { + for _, e := range strings.Split(strings.ToLower(x), `;`) { + if e == "" { + continue + } + if e[0] != '.' { + e = "." + e + } + exts = append(exts, e) + } + } else { + exts = []string{".com", ".exe", ".bat", ".cmd"} + } + + if len(exts) == 0 { + return chkStat(file) + } + if hasExt(file) { + if chkStat(file) == nil { + return nil + } + } + for _, e := range exts { + if f := file + e; chkStat(f) == nil { + return nil + } + } + return fs.ErrNotExist +} + +func chkStat(file string) error { + d, err := os.Stat(file) + if err != nil { + return err + } + if d.IsDir() { + return fs.ErrPermission + } + return nil +} + +func hasExt(file string) bool { + i := strings.LastIndex(file, ".") + if i < 0 { + return false + } + return strings.LastIndexAny(file, `:\/`) < i +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/installer.go b/ibm/vendor/github.com/hashicorp/hc-install/installer.go new file mode 100644 index 0000000000..8b773c56db --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/installer.go @@ -0,0 +1,154 @@ +package install + +import ( + "context" + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" + "github.com/hashicorp/hc-install/errors" + "github.com/hashicorp/hc-install/src" +) + +type Installer struct { + logger *log.Logger + + removableSources []src.Removable +} + +type RemoveFunc func(ctx context.Context) error + +func NewInstaller() *Installer { + discardLogger := log.New(ioutil.Discard, "", 0) + return &Installer{ + logger: discardLogger, + } +} + +func (i *Installer) SetLogger(logger *log.Logger) { + i.logger = logger +} + +func (i *Installer) Ensure(ctx context.Context, sources []src.Source) (string, error) { + var errs *multierror.Error + + for _, source := range sources { + if srcWithLogger, ok := source.(src.LoggerSettable); ok { + srcWithLogger.SetLogger(i.logger) + } + + if srcValidatable, ok := source.(src.Validatable); ok { + err := srcValidatable.Validate() + if err != nil { + errs = multierror.Append(errs, err) + } + } + } + + if errs.ErrorOrNil() != nil { + return "", errs + } + + i.removableSources = make([]src.Removable, 0) + + for _, source := range sources { + if s, ok := source.(src.Removable); ok { + i.removableSources = append(i.removableSources, s) + } + + switch s := source.(type) { + case src.Findable: + execPath, err := s.Find(ctx) + if err != nil { + if errors.IsErrorSkippable(err) { + errs = multierror.Append(errs, err) + continue + } + return "", err + } + + return execPath, nil + case src.Installable: + execPath, err := s.Install(ctx) + if err != nil { + if errors.IsErrorSkippable(err) { + errs = multierror.Append(errs, err) + continue + } + return "", err + } + + return execPath, nil + case src.Buildable: + execPath, err := s.Build(ctx) + if err != nil { + if errors.IsErrorSkippable(err) { + errs = multierror.Append(errs, err) + continue + } + return "", err + } + + return execPath, nil + default: + return "", fmt.Errorf("unknown source: %T", s) + } + } + + return "", fmt.Errorf("unable to find, install, or build from %d sources: %s", + len(sources), errs.ErrorOrNil()) +} + +func (i *Installer) Install(ctx context.Context, sources []src.Installable) (string, error) { + var errs *multierror.Error + + i.removableSources = make([]src.Removable, 0) + + for _, source := range sources { + if srcWithLogger, ok := source.(src.LoggerSettable); ok { + srcWithLogger.SetLogger(i.logger) + } + + if srcValidatable, ok := source.(src.Validatable); ok { + err := srcValidatable.Validate() + if err != nil { + errs = multierror.Append(errs, err) + continue + } + } + + if s, ok := source.(src.Removable); ok { + i.removableSources = append(i.removableSources, s) + } + + execPath, err := source.Install(ctx) + if err != nil { + if errors.IsErrorSkippable(err) { + errs = multierror.Append(errs, err) + continue + } + return "", err + } + + return execPath, nil + } + + return "", fmt.Errorf("unable install from %d sources: %s", + len(sources), errs.ErrorOrNil()) +} + +func (i *Installer) Remove(ctx context.Context) error { + var errs *multierror.Error + + if i.removableSources != nil { + for _, rs := range i.removableSources { + err := rs.Remove(ctx) + if err != nil { + errs = multierror.Append(errs, err) + } + } + } + + return errs.ErrorOrNil() +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/build/get_go_version.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/get_go_version.go new file mode 100644 index 0000000000..3a929859ac --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/get_go_version.go @@ -0,0 +1,37 @@ +package build + +import ( + "context" + "fmt" + "os/exec" + "regexp" + "strings" + + "github.com/hashicorp/go-version" +) + +// GetGoVersion obtains version of locally installed Go via "go version" +func GetGoVersion(ctx context.Context) (*version.Version, error) { + cmd := exec.CommandContext(ctx, "go", "version") + out, err := cmd.CombinedOutput() + if err != nil { + return nil, fmt.Errorf("unable to build: %w\n%s", err, out) + } + + output := strings.TrimSpace(string(out)) + + // e.g. "go version go1.15" + re := regexp.MustCompile(`^go version go([0-9.]+)\s+`) + matches := re.FindStringSubmatch(output) + if len(matches) != 2 { + return nil, fmt.Errorf("unexpected go version output: %q", output) + } + + rawGoVersion := matches[1] + v, err := version.NewVersion(rawGoVersion) + if err != nil { + return nil, fmt.Errorf("unexpected go version output: %w", err) + } + + return v, nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/build/go_build.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/go_build.go new file mode 100644 index 0000000000..2f3f832544 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/go_build.go @@ -0,0 +1,123 @@ +package build + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + + "github.com/hashicorp/go-version" +) + +var discardLogger = log.New(ioutil.Discard, "", 0) + +// GoBuild represents a Go builder (to run "go build") +type GoBuild struct { + Version *version.Version + DetectVendoring bool + + pathToRemove string + logger *log.Logger +} + +func (gb *GoBuild) SetLogger(logger *log.Logger) { + gb.logger = logger +} + +func (gb *GoBuild) log() *log.Logger { + if gb.logger == nil { + return discardLogger + } + return gb.logger +} + +// Build runs "go build" within a given repo to produce binaryName in targetDir +func (gb *GoBuild) Build(ctx context.Context, repoDir, targetDir, binaryName string) (string, error) { + goCmd, cleanupFunc, err := gb.ensureRequiredGoVersion(ctx, repoDir) + if err != nil { + return "", err + } + defer cleanupFunc(ctx) + + goArgs := []string{"build", "-o", filepath.Join(targetDir, binaryName)} + + if gb.DetectVendoring { + vendorDir := filepath.Join(repoDir, "vendor") + if fi, err := os.Stat(vendorDir); err == nil && fi.IsDir() { + goArgs = append(goArgs, "-mod", "vendor") + } + } + + gb.log().Printf("executing %s %q in %q", goCmd, goArgs, repoDir) + cmd := exec.CommandContext(ctx, goCmd, goArgs...) + cmd.Dir = repoDir + out, err := cmd.CombinedOutput() + if err != nil { + return "", fmt.Errorf("unable to build: %w\n%s", err, out) + } + + binPath := filepath.Join(targetDir, binaryName) + + gb.pathToRemove = binPath + + return binPath, nil +} + +func (gb *GoBuild) Remove(ctx context.Context) error { + return os.RemoveAll(gb.pathToRemove) +} + +func (gb *GoBuild) ensureRequiredGoVersion(ctx context.Context, repoDir string) (string, CleanupFunc, error) { + cmdName := "go" + noopCleanupFunc := func(context.Context) {} + + if gb.Version != nil { + goVersion, err := GetGoVersion(ctx) + if err != nil { + return cmdName, noopCleanupFunc, err + } + + if !goVersion.GreaterThanOrEqual(gb.Version) { + // found incompatible version, try downloading the desired one + return gb.installGoVersion(ctx, gb.Version) + } + } + + if requiredVersion, ok := guessRequiredGoVersion(repoDir); ok { + goVersion, err := GetGoVersion(ctx) + if err != nil { + return cmdName, noopCleanupFunc, err + } + + if !goVersion.GreaterThanOrEqual(requiredVersion) { + // found incompatible version, try downloading the desired one + return gb.installGoVersion(ctx, requiredVersion) + } + } + + return cmdName, noopCleanupFunc, nil +} + +// CleanupFunc represents a function to be called once Go is no longer needed +// e.g. to remove any version installed temporarily per requirements +type CleanupFunc func(context.Context) + +func guessRequiredGoVersion(repoDir string) (*version.Version, bool) { + goEnvFile := filepath.Join(repoDir, ".go-version") + if fi, err := os.Stat(goEnvFile); err == nil && !fi.IsDir() { + b, err := ioutil.ReadFile(goEnvFile) + if err != nil { + return nil, false + } + requiredVersion, err := version.NewVersion(string(bytes.TrimSpace(b))) + if err != nil { + return nil, false + } + return requiredVersion, true + } + return nil, false +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/build/go_is_installed.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/go_is_installed.go new file mode 100644 index 0000000000..6a81d196b6 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/go_is_installed.go @@ -0,0 +1,28 @@ +package build + +import ( + "context" + "fmt" + + "github.com/hashicorp/go-version" +) + +// GoIsInstalled represents a checker of whether Go is installed locally +type GoIsInstalled struct { + RequiredVersion version.Constraints +} + +// Check checks whether any Go version is installed locally +func (gii *GoIsInstalled) Check(ctx context.Context) error { + goVersion, err := GetGoVersion(ctx) + if err != nil { + return err + } + + if gii.RequiredVersion != nil && !gii.RequiredVersion.Check(goVersion) { + return fmt.Errorf("go %s required (%s available)", + gii.RequiredVersion, goVersion) + } + + return nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/build/install_go_version.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/install_go_version.go new file mode 100644 index 0000000000..f97c859dc1 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/build/install_go_version.go @@ -0,0 +1,53 @@ +package build + +import ( + "context" + "fmt" + "os" + "os/exec" + "strings" + + "github.com/hashicorp/go-version" +) + +// installGoVersion installs given version of Go using Go +// according to https://golang.org/doc/manage-install +func (gb *GoBuild) installGoVersion(ctx context.Context, v *version.Version) (string, CleanupFunc, error) { + // trim 0 patch versions as that's how Go does it :shrug: + shortVersion := strings.TrimSuffix(v.String(), ".0") + + pkgURL := fmt.Sprintf("golang.org/dl/go%s", shortVersion) + + gb.log().Printf("go getting %q", pkgURL) + cmd := exec.CommandContext(ctx, "go", "get", pkgURL) + out, err := cmd.CombinedOutput() + if err != nil { + return "", nil, fmt.Errorf("unable to install Go %s: %w\n%s", v, err, out) + } + + cmdName := fmt.Sprintf("go%s", shortVersion) + + gb.log().Printf("downloading go %q", shortVersion) + cmd = exec.CommandContext(ctx, cmdName, "download") + out, err = cmd.CombinedOutput() + if err != nil { + return "", nil, fmt.Errorf("unable to download Go %s: %w\n%s", v, err, out) + } + gb.log().Printf("download of go %q finished", shortVersion) + + cleanupFunc := func(ctx context.Context) { + cmd = exec.CommandContext(ctx, cmdName, "env", "GOROOT") + out, err = cmd.CombinedOutput() + if err != nil { + return + } + rootPath := strings.TrimSpace(string(out)) + + // run some extra checks before deleting, just to be sure + if rootPath != "" && strings.HasSuffix(rootPath, v.String()) { + os.RemoveAll(rootPath) + } + } + + return cmdName, cleanupFunc, nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/httpclient/httpclient.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/httpclient/httpclient.go new file mode 100644 index 0000000000..159f705058 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/httpclient/httpclient.go @@ -0,0 +1,37 @@ +package httpclient + +import ( + "fmt" + "net/http" + + "github.com/hashicorp/go-cleanhttp" + "github.com/hashicorp/hc-install/internal/version" +) + +// NewHTTPClient provides a pre-configured http.Client +// e.g. with relevant User-Agent header +func NewHTTPClient() *http.Client { + client := cleanhttp.DefaultClient() + + userAgent := fmt.Sprintf("hc-install/%s", version.ModuleVersion()) + + cli := cleanhttp.DefaultPooledClient() + cli.Transport = &userAgentRoundTripper{ + userAgent: userAgent, + inner: cli.Transport, + } + + return client +} + +type userAgentRoundTripper struct { + inner http.RoundTripper + userAgent string +} + +func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + if _, ok := req.Header["User-Agent"]; !ok { + req.Header.Set("User-Agent", rt.userAgent) + } + return rt.inner.RoundTrip(req) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/pubkey.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/pubkey/pubkey.go similarity index 98% rename from ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/pubkey.go rename to ibm/vendor/github.com/hashicorp/hc-install/internal/pubkey/pubkey.go index c545595bfb..c36fba4716 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/pubkey.go +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/pubkey/pubkey.go @@ -1,6 +1,8 @@ -package tfinstall +package pubkey -const hashicorpPublicKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- +const ( + // See https://www.hashicorp.com/security + DefaultPublicKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- mQINBGB9+xkBEACabYZOWKmgZsHTdRDiyPJxhbuUiKX65GUWkyRMJKi/1dviVxOX PG6hBPtF48IFnVgxKpIb7G6NjBousAV+CuLlv5yqFKpOZEGC6sBV+Gx8Vu1CICpl @@ -122,3 +124,4 @@ pHH/hFCYBPW2D2dxB+k2pQlg5NI+TpsXj5Zun8kRw5RtVb+dLuiH/xmxArIee8Jq ZF5q4h4I33PSGDdSvGXn9UMY5Isjpg== =7pIB -----END PGP PUBLIC KEY BLOCK-----` +) diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go new file mode 100644 index 0000000000..4936dda2f9 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go @@ -0,0 +1,203 @@ +package releasesjson + +import ( + "bytes" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "log" + "net/url" + "strings" + + "github.com/hashicorp/hc-install/internal/httpclient" + "golang.org/x/crypto/openpgp" +) + +type ChecksumDownloader struct { + ProductVersion *ProductVersion + Logger *log.Logger + ArmoredPublicKey string + + BaseURL string +} + +type ChecksumFileMap map[string]HashSum + +type HashSum []byte + +func (hs HashSum) Size() int { + return len(hs) +} + +func (hs HashSum) String() string { + return hex.EncodeToString(hs) +} + +func HashSumFromHexDigest(hexDigest string) (HashSum, error) { + sumBytes, err := hex.DecodeString(hexDigest) + if err != nil { + return nil, err + } + return HashSum(sumBytes), nil +} + +func (cd *ChecksumDownloader) DownloadAndVerifyChecksums() (ChecksumFileMap, error) { + sigFilename, err := cd.findSigFilename(cd.ProductVersion) + if err != nil { + return nil, err + } + + client := httpclient.NewHTTPClient() + sigURL := fmt.Sprintf("%s/%s/%s/%s", cd.BaseURL, + url.PathEscape(cd.ProductVersion.Name), + url.PathEscape(cd.ProductVersion.RawVersion), + url.PathEscape(sigFilename)) + cd.Logger.Printf("downloading signature from %s", sigURL) + sigResp, err := client.Get(sigURL) + if err != nil { + return nil, err + } + + if sigResp.StatusCode != 200 { + return nil, fmt.Errorf("failed to download signature from %q: %s", sigURL, sigResp.Status) + } + + defer sigResp.Body.Close() + + shasumsURL := fmt.Sprintf("%s/%s/%s/%s", cd.BaseURL, + url.PathEscape(cd.ProductVersion.Name), + url.PathEscape(cd.ProductVersion.RawVersion), + url.PathEscape(cd.ProductVersion.SHASUMS)) + cd.Logger.Printf("downloading checksums from %s", shasumsURL) + sumsResp, err := client.Get(shasumsURL) + if err != nil { + return nil, err + } + + if sumsResp.StatusCode != 200 { + return nil, fmt.Errorf("failed to download checksums from %q: %s", shasumsURL, sumsResp.Status) + } + + defer sumsResp.Body.Close() + + var shaSums strings.Builder + sumsReader := io.TeeReader(sumsResp.Body, &shaSums) + + err = cd.verifySumsSignature(sumsReader, sigResp.Body) + if err != nil { + return nil, err + } + + return fileMapFromChecksums(shaSums) +} + +func fileMapFromChecksums(checksums strings.Builder) (ChecksumFileMap, error) { + csMap := make(ChecksumFileMap, 0) + + lines := strings.Split(checksums.String(), "\n") + for _, line := range lines { + line = strings.TrimSpace(line) + if line == "" { + continue + } + parts := strings.Fields(line) + if len(parts) != 2 { + return nil, fmt.Errorf("unexpected checksum line format: %q", line) + } + + h, err := HashSumFromHexDigest(parts[0]) + if err != nil { + return nil, err + } + + if h.Size() != sha256.Size { + return nil, fmt.Errorf("unexpected sha256 format (len: %d, expected: %d)", + h.Size(), sha256.Size) + } + + csMap[parts[1]] = h + } + return csMap, nil +} + +func compareChecksum(logger *log.Logger, r io.Reader, verifiedHashSum HashSum) error { + h := sha256.New() + _, err := io.Copy(h, r) + if err != nil { + return err + } + + calculatedSum := h.Sum(nil) + if !bytes.Equal(calculatedSum, verifiedHashSum) { + return fmt.Errorf("checksum mismatch (expected %q, calculated %q)", + verifiedHashSum, + hex.EncodeToString(calculatedSum)) + } + + logger.Printf("checksum matches: %q", hex.EncodeToString(calculatedSum)) + + return nil +} + +func (cd *ChecksumDownloader) verifySumsSignature(checksums, signature io.Reader) error { + el, err := cd.keyEntityList() + if err != nil { + return err + } + + _, err = openpgp.CheckDetachedSignature(el, checksums, signature) + if err != nil { + return fmt.Errorf("unable to verify checksums signature: %w", err) + } + + cd.Logger.Printf("checksum signature is valid") + + return nil +} + +func (cd *ChecksumDownloader) findSigFilename(pv *ProductVersion) (string, error) { + sigFiles := pv.SHASUMSSigs + if len(sigFiles) == 0 { + sigFiles = []string{pv.SHASUMSSig} + } + + keyIds, err := cd.pubKeyIds() + if err != nil { + return "", err + } + + for _, filename := range sigFiles { + for _, keyID := range keyIds { + if strings.HasSuffix(filename, fmt.Sprintf("_SHA256SUMS.%s.sig", keyID)) { + return filename, nil + } + } + if strings.HasSuffix(filename, "_SHA256SUMS.sig") { + return filename, nil + } + } + + return "", fmt.Errorf("no suitable sig file found") +} + +func (cd *ChecksumDownloader) pubKeyIds() ([]string, error) { + entityList, err := cd.keyEntityList() + if err != nil { + return nil, err + } + + fingerprints := make([]string, 0) + for _, entity := range entityList { + fingerprints = append(fingerprints, entity.PrimaryKey.KeyIdShortString()) + } + + return fingerprints, nil +} + +func (cd *ChecksumDownloader) keyEntityList() (openpgp.EntityList, error) { + if cd.ArmoredPublicKey == "" { + return nil, fmt.Errorf("no public key provided") + } + return openpgp.ReadArmoredKeyRing(strings.NewReader(cd.ArmoredPublicKey)) +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go new file mode 100644 index 0000000000..62ed6afd05 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go @@ -0,0 +1,182 @@ +package releasesjson + +import ( + "archive/zip" + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "log" + "net/url" + "os" + "path/filepath" + "runtime" + "strconv" + + "github.com/hashicorp/hc-install/internal/httpclient" +) + +type Downloader struct { + Logger *log.Logger + VerifyChecksum bool + ArmoredPublicKey string + BaseURL string +} + +func (d *Downloader) DownloadAndUnpack(ctx context.Context, pv *ProductVersion, dstDir string) error { + if len(pv.Builds) == 0 { + return fmt.Errorf("no builds found for %s %s", pv.Name, pv.Version) + } + + pb, ok := pv.Builds.FilterBuild(runtime.GOOS, runtime.GOARCH, "zip") + if !ok { + return fmt.Errorf("no ZIP archive found for %s %s %s/%s", + pv.Name, pv.Version, runtime.GOOS, runtime.GOARCH) + } + + var verifiedChecksum HashSum + if d.VerifyChecksum { + v := &ChecksumDownloader{ + BaseURL: d.BaseURL, + ProductVersion: pv, + Logger: d.Logger, + ArmoredPublicKey: d.ArmoredPublicKey, + } + verifiedChecksums, err := v.DownloadAndVerifyChecksums() + if err != nil { + return err + } + var ok bool + verifiedChecksum, ok = verifiedChecksums[pb.Filename] + if !ok { + return fmt.Errorf("no checksum found for %q", pb.Filename) + } + } + + client := httpclient.NewHTTPClient() + + archiveURL := pb.URL + if d.BaseURL != "" { + // ensure that absolute download links from mocked responses + // are still pointing to the mock server if one is set + baseURL, err := url.Parse(d.BaseURL) + if err != nil { + return err + } + + u, err := url.Parse(archiveURL) + if err != nil { + return err + } + u.Scheme = baseURL.Scheme + u.Host = baseURL.Host + archiveURL = u.String() + } + + d.Logger.Printf("downloading archive from %s", archiveURL) + resp, err := client.Get(archiveURL) + if err != nil { + return err + } + + if resp.StatusCode != 200 { + return fmt.Errorf("failed to download ZIP archive from %q: %s", archiveURL, resp.Status) + } + + defer resp.Body.Close() + + var pkgReader io.Reader + pkgReader = resp.Body + + contentType := resp.Header.Get("content-type") + if !contentTypeIsZip(contentType) { + return fmt.Errorf("unexpected content-type: %s (expected any of %q)", + contentType, zipMimeTypes) + } + + if d.VerifyChecksum { + d.Logger.Printf("calculating checksum of %q", pb.Filename) + // provide extra reader to calculate & compare checksum + var buf bytes.Buffer + r := io.TeeReader(resp.Body, &buf) + pkgReader = &buf + + err := compareChecksum(d.Logger, r, verifiedChecksum) + if err != nil { + return err + } + } + + pkgFile, err := ioutil.TempFile("", pb.Filename) + if err != nil { + return err + } + defer pkgFile.Close() + + d.Logger.Printf("copying downloaded file to %s", pkgFile.Name()) + bytesCopied, err := io.Copy(pkgFile, pkgReader) + if err != nil { + return err + } + d.Logger.Printf("copied %d bytes to %s", bytesCopied, pkgFile.Name()) + + expectedSize := 0 + if length := resp.Header.Get("content-length"); length != "" { + var err error + expectedSize, err = strconv.Atoi(length) + if err != nil { + return err + } + } + if expectedSize != 0 && bytesCopied != int64(expectedSize) { + return fmt.Errorf("unexpected size (downloaded: %d, expected: %d)", + bytesCopied, expectedSize) + } + + r, err := zip.OpenReader(pkgFile.Name()) + if err != nil { + return err + } + defer r.Close() + + for _, f := range r.File { + srcFile, err := f.Open() + if err != nil { + return err + } + + d.Logger.Printf("unpacking %s to %s", f.Name, dstDir) + dstPath := filepath.Join(dstDir, f.Name) + dstFile, err := os.Create(dstPath) + if err != nil { + return err + } + + _, err = io.Copy(dstFile, srcFile) + if err != nil { + return err + } + srcFile.Close() + dstFile.Close() + } + + return nil +} + +// The production release site uses consistent single mime type +// but mime types are platform-dependent +// and we may use different OS under test +var zipMimeTypes = []string{ + "application/x-zip-compressed", // Windows + "application/zip", // Unix +} + +func contentTypeIsZip(contentType string) bool { + for _, mt := range zipMimeTypes { + if mt == contentType { + return true + } + } + return false +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/product_version.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/product_version.go new file mode 100644 index 0000000000..5eecb01364 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/product_version.go @@ -0,0 +1,41 @@ +package releasesjson + +import "github.com/hashicorp/go-version" + +// ProductVersion is a wrapper around a particular product version like +// "consul 0.5.1". A ProductVersion may have one or more builds. +type ProductVersion struct { + Name string `json:"name"` + RawVersion string `json:"version"` + Version *version.Version `json:"-"` + SHASUMS string `json:"shasums,omitempty"` + SHASUMSSig string `json:"shasums_signature,omitempty"` + SHASUMSSigs []string `json:"shasums_signatures,omitempty"` + Builds ProductBuilds `json:"builds"` +} + +type ProductVersionsMap map[string]*ProductVersion + +type ProductVersions []*ProductVersion + +func (pv ProductVersions) Len() int { + return len(pv) +} + +func (pv ProductVersions) Less(i, j int) bool { + return pv[i].Version.LessThan(pv[j].Version) +} + +func (pv ProductVersions) Swap(i, j int) { + pv[i], pv[j] = pv[j], pv[i] +} + +func (pvm ProductVersionsMap) AsSlice() ProductVersions { + versions := make(ProductVersions, 0) + + for _, pVersion := range pvm { + versions = append(versions, pVersion) + } + + return versions +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go new file mode 100644 index 0000000000..24e32ffc40 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go @@ -0,0 +1,177 @@ +package releasesjson + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "log" + "net/url" + "strings" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/internal/httpclient" +) + +const defaultBaseURL = "https://releases.hashicorp.com" + +// Product is a top-level product like "Consul" or "Nomad". A Product may have +// one or more versions. +type Product struct { + Name string `json:"name"` + Versions ProductVersionsMap `json:"versions"` +} + +type ProductBuilds []*ProductBuild + +func (pbs ProductBuilds) FilterBuild(os string, arch string, suffix string) (*ProductBuild, bool) { + for _, pb := range pbs { + if pb.OS == os && pb.Arch == arch && strings.HasSuffix(pb.Filename, suffix) { + return pb, true + } + } + return nil, false +} + +// ProductBuild is an OS/arch-specific representation of a product. This is the +// actual file that a user would download, like "consul_0.5.1_linux_amd64". +type ProductBuild struct { + Name string `json:"name"` + Version string `json:"version"` + OS string `json:"os"` + Arch string `json:"arch"` + Filename string `json:"filename"` + URL string `json:"url"` +} + +type Releases struct { + logger *log.Logger + BaseURL string +} + +func NewReleases() *Releases { + return &Releases{ + logger: log.New(ioutil.Discard, "", 0), + BaseURL: defaultBaseURL, + } +} + +func (r *Releases) SetLogger(logger *log.Logger) { + r.logger = logger +} + +func (r *Releases) ListProductVersions(ctx context.Context, productName string) (ProductVersionsMap, error) { + client := httpclient.NewHTTPClient() + + productIndexURL := fmt.Sprintf("%s/%s/index.json", + r.BaseURL, + url.PathEscape(productName)) + r.logger.Printf("requesting versions from %s", productIndexURL) + + resp, err := client.Get(productIndexURL) + if err != nil { + return nil, err + } + + if resp.StatusCode != 200 { + return nil, fmt.Errorf("failed to obtain product versions from %q: %s ", + productIndexURL, resp.Status) + } + + contentType := resp.Header.Get("content-type") + if contentType != "application/json" { + return nil, fmt.Errorf("unexpected Content-Type: %q", contentType) + } + + defer resp.Body.Close() + + r.logger.Printf("received %s", resp.Status) + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + p := Product{} + err = json.Unmarshal(body, &p) + if err != nil { + return nil, fmt.Errorf("%w: failed to unmarshal: %q", + err, string(body)) + } + + for rawVersion := range p.Versions { + v, err := version.NewVersion(rawVersion) + if err != nil { + // remove unparseable version + delete(p.Versions, rawVersion) + continue + } + + if ok, _ := versionIsSupported(v); !ok { + // Remove (currently unsupported) enterprise + // version and any other "custom" build + delete(p.Versions, rawVersion) + continue + } + + p.Versions[rawVersion].Version = v + } + + return p.Versions, nil +} + +func (r *Releases) GetProductVersion(ctx context.Context, product string, version *version.Version) (*ProductVersion, error) { + if ok, err := versionIsSupported(version); !ok { + return nil, fmt.Errorf("%s: %w", product, err) + } + + client := httpclient.NewHTTPClient() + + indexURL := fmt.Sprintf("%s/%s/%s/index.json", + r.BaseURL, + url.PathEscape(product), + url.PathEscape(version.String())) + r.logger.Printf("requesting version from %s", indexURL) + + resp, err := client.Get(indexURL) + if err != nil { + return nil, err + } + + if resp.StatusCode != 200 { + return nil, fmt.Errorf("failed to obtain product version from %q: %s ", + indexURL, resp.Status) + } + + contentType := resp.Header.Get("content-type") + if contentType != "application/json" { + return nil, fmt.Errorf("unexpected Content-Type: %q", contentType) + } + + defer resp.Body.Close() + + r.logger.Printf("received %s", resp.Status) + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + pv := &ProductVersion{} + err = json.Unmarshal(body, pv) + if err != nil { + return nil, fmt.Errorf("%w: failed to unmarshal response: %q", + err, string(body)) + } + + return pv, nil +} + +func versionIsSupported(v *version.Version) (bool, error) { + isSupported := v.Metadata() == "" + if !isSupported { + return false, fmt.Errorf("cannot obtain %s (enterprise versions are not supported)", + v.String()) + } + return true, nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/src/src.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/src/src.go new file mode 100644 index 0000000000..5b53d92b12 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/src/src.go @@ -0,0 +1,3 @@ +package src + +type InstallSrcSigil struct{} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/validators/validators.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/validators/validators.go new file mode 100644 index 0000000000..5e3e6c8163 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/validators/validators.go @@ -0,0 +1,18 @@ +package validators + +import "regexp" + +var ( + productNameRe = regexp.MustCompile(`^[a-z0-9-]+$`) + binaryNameRe = regexp.MustCompile(`^[a-zA-Z0-9-_.]+$`) +) + +// IsProductNameValid provides early user-facing validation of a product name +func IsProductNameValid(productName string) bool { + return productNameRe.MatchString(productName) +} + +// IsBinaryNameValid provides early user-facing validation of binary name +func IsBinaryNameValid(binaryName string) bool { + return binaryNameRe.MatchString(binaryName) +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/internal/version/version.go b/ibm/vendor/github.com/hashicorp/hc-install/internal/version/version.go new file mode 100644 index 0000000000..d8bc462c50 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/internal/version/version.go @@ -0,0 +1,9 @@ +package version + +const version = "0.1.0" + +// ModuleVersion returns the current version of the github.com/hashicorp/hc-install Go module. +// This is a function to allow for future possible enhancement using debug.BuildInfo. +func ModuleVersion() string { + return version +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/product/consul.go b/ibm/vendor/github.com/hashicorp/hc-install/product/consul.go new file mode 100644 index 0000000000..b619d89eda --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/product/consul.go @@ -0,0 +1,57 @@ +package product + +import ( + "context" + "fmt" + "os/exec" + "regexp" + "runtime" + "strings" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/internal/build" +) + +var consulVersionOutputRe = regexp.MustCompile(`Consul ` + simpleVersionRe) + +var ( + v1_16 = version.Must(version.NewVersion("1.16")) + // TODO: version.MustConstraint() ? + v1_16c, _ = version.NewConstraint("1.16") +) + +var Consul = Product{ + Name: "consul", + BinaryName: func() string { + if runtime.GOOS == "windows" { + return "consul.exe" + } + return "consul" + }, + GetVersion: func(ctx context.Context, path string) (*version.Version, error) { + cmd := exec.CommandContext(ctx, path, "version") + + out, err := cmd.Output() + if err != nil { + return nil, err + } + + stdout := strings.TrimSpace(string(out)) + + submatches := consulVersionOutputRe.FindStringSubmatch(stdout) + if len(submatches) != 2 { + return nil, fmt.Errorf("unexpected number of version matches %d for %s", len(submatches), stdout) + } + v, err := version.NewVersion(submatches[1]) + if err != nil { + return nil, fmt.Errorf("unable to parse version %q: %w", submatches[1], err) + } + + return v, err + }, + BuildInstructions: &BuildInstructions{ + GitRepoURL: "https://github.com/hashicorp/consul.git", + PreCloneCheck: &build.GoIsInstalled{}, + Build: &build.GoBuild{Version: v1_16}, + }, +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/product/product.go b/ibm/vendor/github.com/hashicorp/hc-install/product/product.go new file mode 100644 index 0000000000..0b5e2a5467 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/product/product.go @@ -0,0 +1,60 @@ +package product + +import ( + "context" + "time" + + "github.com/hashicorp/go-version" +) + +type Product struct { + // Name which identifies the product + // on releases.hashicorp.com and in Checkpoint + Name string + + // BinaryName represents name of the unpacked binary to be executed or built + BinaryName BinaryNameFunc + + // GetVersion represents how to obtain the version of the product + // reflecting any output or CLI flag differences + GetVersion func(ctx context.Context, execPath string) (*version.Version, error) + + // BuildInstructions represents how to build the product "from scratch" + BuildInstructions *BuildInstructions +} + +type BinaryNameFunc func() string + +type BuildInstructions struct { + GitRepoURL string + + // CloneTimeout overrides default timeout + // for cloning the repository + CloneTimeout time.Duration + + // PreCloneCheck represents any checks to run + // prior to building, such as verifying build + // dependencies (e.g. whether Go is installed) + PreCloneCheck Checker + + // PreCloneCheckTimeout overrides default timeout + // for the PreCloneCheck + PreCloneCheckTimeout time.Duration + + // Build represents how to build the product + // after checking out the source code + Build Builder + + // BuildTimeout overrides default timeout + // for the Builder + BuildTimeout time.Duration +} + +type Checker interface { + Check(ctx context.Context) error +} + +type Builder interface { + Build(ctx context.Context, repoDir, targetDir, binaryName string) (string, error) + Remove(ctx context.Context) error +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/product/terraform.go b/ibm/vendor/github.com/hashicorp/hc-install/product/terraform.go new file mode 100644 index 0000000000..d820203a77 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/product/terraform.go @@ -0,0 +1,55 @@ +package product + +import ( + "context" + "fmt" + "os/exec" + "regexp" + "runtime" + "strings" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/internal/build" +) + +var ( + simpleVersionRe = `v?(?P[0-9]+(?:\.[0-9]+)*(?:-[A-Za-z0-9\.]+)?)` + + terraformVersionOutputRe = regexp.MustCompile(`Terraform ` + simpleVersionRe) +) + +var Terraform = Product{ + Name: "terraform", + BinaryName: func() string { + if runtime.GOOS == "windows" { + return "terraform.exe" + } + return "terraform" + }, + GetVersion: func(ctx context.Context, path string) (*version.Version, error) { + cmd := exec.CommandContext(ctx, path, "version") + + out, err := cmd.Output() + if err != nil { + return nil, err + } + + stdout := strings.TrimSpace(string(out)) + + submatches := terraformVersionOutputRe.FindStringSubmatch(stdout) + if len(submatches) != 2 { + return nil, fmt.Errorf("unexpected number of version matches %d for %s", len(submatches), stdout) + } + v, err := version.NewVersion(submatches[1]) + if err != nil { + return nil, fmt.Errorf("unable to parse version %q: %w", submatches[1], err) + } + + return v, err + }, + BuildInstructions: &BuildInstructions{ + GitRepoURL: "https://github.com/hashicorp/terraform.git", + PreCloneCheck: &build.GoIsInstalled{}, + Build: &build.GoBuild{DetectVendoring: true}, + }, +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/releases/exact_version.go b/ibm/vendor/github.com/hashicorp/hc-install/releases/exact_version.go new file mode 100644 index 0000000000..7fe2cb56ed --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/releases/exact_version.go @@ -0,0 +1,147 @@ +package releases + +import ( + "context" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "time" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/internal/pubkey" + rjson "github.com/hashicorp/hc-install/internal/releasesjson" + isrc "github.com/hashicorp/hc-install/internal/src" + "github.com/hashicorp/hc-install/internal/validators" + "github.com/hashicorp/hc-install/product" +) + +// ExactVersion installs the given Version of product +// to OS temp directory, or to InstallDir (if not empty) +type ExactVersion struct { + Product product.Product + Version *version.Version + InstallDir string + Timeout time.Duration + + SkipChecksumVerification bool + + // ArmoredPublicKey is a public PGP key in ASCII/armor format to use + // instead of built-in pubkey to verify signature of downloaded checksums + ArmoredPublicKey string + + apiBaseURL string + logger *log.Logger + pathsToRemove []string +} + +func (*ExactVersion) IsSourceImpl() isrc.InstallSrcSigil { + return isrc.InstallSrcSigil{} +} + +func (ev *ExactVersion) SetLogger(logger *log.Logger) { + ev.logger = logger +} + +func (ev *ExactVersion) log() *log.Logger { + if ev.logger == nil { + return discardLogger + } + return ev.logger +} + +func (ev *ExactVersion) Validate() error { + if !validators.IsProductNameValid(ev.Product.Name) { + return fmt.Errorf("invalid product name: %q", ev.Product.Name) + } + + if !validators.IsBinaryNameValid(ev.Product.BinaryName()) { + return fmt.Errorf("invalid binary name: %q", ev.Product.BinaryName()) + } + + if ev.Version == nil { + return fmt.Errorf("unknown version") + } + + return nil +} + +func (ev *ExactVersion) Install(ctx context.Context) (string, error) { + timeout := defaultInstallTimeout + if ev.Timeout > 0 { + timeout = ev.Timeout + } + ctx, cancelFunc := context.WithTimeout(ctx, timeout) + defer cancelFunc() + + if ev.pathsToRemove == nil { + ev.pathsToRemove = make([]string, 0) + } + + dstDir := ev.InstallDir + if dstDir == "" { + var err error + dirName := fmt.Sprintf("%s_*", ev.Product.Name) + dstDir, err = ioutil.TempDir("", dirName) + if err != nil { + return "", err + } + ev.pathsToRemove = append(ev.pathsToRemove, dstDir) + ev.log().Printf("created new temp dir at %s", dstDir) + } + ev.log().Printf("will install into dir at %s", dstDir) + + rels := rjson.NewReleases() + if ev.apiBaseURL != "" { + rels.BaseURL = ev.apiBaseURL + } + rels.SetLogger(ev.log()) + pv, err := rels.GetProductVersion(ctx, ev.Product.Name, ev.Version) + if err != nil { + return "", err + } + + d := &rjson.Downloader{ + Logger: ev.log(), + VerifyChecksum: !ev.SkipChecksumVerification, + ArmoredPublicKey: pubkey.DefaultPublicKey, + BaseURL: rels.BaseURL, + } + if ev.ArmoredPublicKey != "" { + d.ArmoredPublicKey = ev.ArmoredPublicKey + } + if ev.apiBaseURL != "" { + d.BaseURL = ev.apiBaseURL + } + + err = d.DownloadAndUnpack(ctx, pv, dstDir) + if err != nil { + return "", err + } + + execPath := filepath.Join(dstDir, ev.Product.BinaryName()) + + ev.pathsToRemove = append(ev.pathsToRemove, execPath) + + ev.log().Printf("changing perms of %s", execPath) + err = os.Chmod(execPath, 0o700) + if err != nil { + return "", err + } + + return execPath, nil +} + +func (ev *ExactVersion) Remove(ctx context.Context) error { + if ev.pathsToRemove != nil { + for _, path := range ev.pathsToRemove { + err := os.RemoveAll(path) + if err != nil { + return err + } + } + } + + return nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/releases/latest_version.go b/ibm/vendor/github.com/hashicorp/hc-install/releases/latest_version.go new file mode 100644 index 0000000000..c5c1807a82 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/releases/latest_version.go @@ -0,0 +1,171 @@ +package releases + +import ( + "context" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "sort" + "time" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/internal/pubkey" + rjson "github.com/hashicorp/hc-install/internal/releasesjson" + isrc "github.com/hashicorp/hc-install/internal/src" + "github.com/hashicorp/hc-install/internal/validators" + "github.com/hashicorp/hc-install/product" +) + +type LatestVersion struct { + Product product.Product + Constraints version.Constraints + InstallDir string + Timeout time.Duration + IncludePrereleases bool + + SkipChecksumVerification bool + + // ArmoredPublicKey is a public PGP key in ASCII/armor format to use + // instead of built-in pubkey to verify signature of downloaded checksums + ArmoredPublicKey string + + apiBaseURL string + logger *log.Logger + pathsToRemove []string +} + +func (*LatestVersion) IsSourceImpl() isrc.InstallSrcSigil { + return isrc.InstallSrcSigil{} +} + +func (lv *LatestVersion) SetLogger(logger *log.Logger) { + lv.logger = logger +} + +func (lv *LatestVersion) log() *log.Logger { + if lv.logger == nil { + return discardLogger + } + return lv.logger +} + +func (lv *LatestVersion) Validate() error { + if !validators.IsProductNameValid(lv.Product.Name) { + return fmt.Errorf("invalid product name: %q", lv.Product.Name) + } + + if !validators.IsBinaryNameValid(lv.Product.BinaryName()) { + return fmt.Errorf("invalid binary name: %q", lv.Product.BinaryName()) + } + + return nil +} + +func (lv *LatestVersion) Install(ctx context.Context) (string, error) { + timeout := defaultInstallTimeout + if lv.Timeout > 0 { + timeout = lv.Timeout + } + ctx, cancelFunc := context.WithTimeout(ctx, timeout) + defer cancelFunc() + + if lv.pathsToRemove == nil { + lv.pathsToRemove = make([]string, 0) + } + + dstDir := lv.InstallDir + if dstDir == "" { + var err error + dirName := fmt.Sprintf("%s_*", lv.Product.Name) + dstDir, err = ioutil.TempDir("", dirName) + if err != nil { + return "", err + } + lv.pathsToRemove = append(lv.pathsToRemove, dstDir) + lv.log().Printf("created new temp dir at %s", dstDir) + } + lv.log().Printf("will install into dir at %s", dstDir) + + rels := rjson.NewReleases() + if lv.apiBaseURL != "" { + rels.BaseURL = lv.apiBaseURL + } + rels.SetLogger(lv.log()) + versions, err := rels.ListProductVersions(ctx, lv.Product.Name) + if err != nil { + return "", err + } + + if len(versions) == 0 { + return "", fmt.Errorf("no versions found for %q", lv.Product.Name) + } + + versionToInstall, ok := lv.findLatestMatchingVersion(versions, lv.Constraints) + if !ok { + return "", fmt.Errorf("no matching version found for %q", lv.Constraints) + } + + d := &rjson.Downloader{ + Logger: lv.log(), + VerifyChecksum: !lv.SkipChecksumVerification, + ArmoredPublicKey: pubkey.DefaultPublicKey, + BaseURL: rels.BaseURL, + } + if lv.ArmoredPublicKey != "" { + d.ArmoredPublicKey = lv.ArmoredPublicKey + } + if lv.apiBaseURL != "" { + d.BaseURL = lv.apiBaseURL + } + err = d.DownloadAndUnpack(ctx, versionToInstall, dstDir) + if err != nil { + return "", err + } + + execPath := filepath.Join(dstDir, lv.Product.BinaryName()) + + lv.pathsToRemove = append(lv.pathsToRemove, execPath) + + lv.log().Printf("changing perms of %s", execPath) + err = os.Chmod(execPath, 0o700) + if err != nil { + return "", err + } + + return execPath, nil +} + +func (lv *LatestVersion) Remove(ctx context.Context) error { + if lv.pathsToRemove != nil { + for _, path := range lv.pathsToRemove { + err := os.RemoveAll(path) + if err != nil { + return err + } + } + } + return nil +} + +func (lv *LatestVersion) findLatestMatchingVersion(pvs rjson.ProductVersionsMap, vc version.Constraints) (*rjson.ProductVersion, bool) { + versions := make(version.Collection, 0) + for _, pv := range pvs.AsSlice() { + if !lv.IncludePrereleases && pv.Version.Prerelease() != "" { + // skip prereleases if desired + continue + } + + versions = append(versions, pv.Version) + } + + if len(versions) == 0 { + return nil, false + } + + sort.Stable(versions) + latestVersion := versions[len(versions)-1] + + return pvs[latestVersion.Original()], true +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/releases/releases.go b/ibm/vendor/github.com/hashicorp/hc-install/releases/releases.go new file mode 100644 index 0000000000..2c3f309928 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/releases/releases.go @@ -0,0 +1,13 @@ +package releases + +import ( + "io/ioutil" + "log" + "time" +) + +var ( + defaultInstallTimeout = 30 * time.Second + defaultListTimeout = 10 * time.Second + discardLogger = log.New(ioutil.Discard, "", 0) +) diff --git a/ibm/vendor/github.com/hashicorp/hc-install/releases/versions.go b/ibm/vendor/github.com/hashicorp/hc-install/releases/versions.go new file mode 100644 index 0000000000..bf0f799faa --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/releases/versions.go @@ -0,0 +1,82 @@ +package releases + +import ( + "context" + "fmt" + "sort" + "time" + + "github.com/hashicorp/go-version" + rjson "github.com/hashicorp/hc-install/internal/releasesjson" + "github.com/hashicorp/hc-install/internal/validators" + "github.com/hashicorp/hc-install/product" + "github.com/hashicorp/hc-install/src" +) + +// Versions allows listing all versions of a product +// which match Constraints +type Versions struct { + Product product.Product + Constraints version.Constraints + + ListTimeout time.Duration + + // Install represents configuration for installation of any listed version + Install InstallationOptions +} + +type InstallationOptions struct { + Timeout time.Duration + Dir string + + SkipChecksumVerification bool + + // ArmoredPublicKey is a public PGP key in ASCII/armor format to use + // instead of built-in pubkey to verify signature of downloaded checksums + // during installation + ArmoredPublicKey string +} + +func (v *Versions) List(ctx context.Context) ([]src.Source, error) { + if !validators.IsProductNameValid(v.Product.Name) { + return nil, fmt.Errorf("invalid product name: %q", v.Product.Name) + } + + timeout := defaultListTimeout + if v.ListTimeout > 0 { + timeout = v.ListTimeout + } + ctx, cancelFunc := context.WithTimeout(ctx, timeout) + defer cancelFunc() + + r := rjson.NewReleases() + pvs, err := r.ListProductVersions(ctx, v.Product.Name) + if err != nil { + return nil, err + } + + versions := pvs.AsSlice() + sort.Stable(versions) + + installables := make([]src.Source, 0) + for _, pv := range versions { + if !v.Constraints.Check(pv.Version) { + // skip version which doesn't match constraint + continue + } + + ev := &ExactVersion{ + Product: v.Product, + Version: pv.Version, + InstallDir: v.Install.Dir, + Timeout: v.Install.Timeout, + + ArmoredPublicKey: v.Install.ArmoredPublicKey, + SkipChecksumVerification: v.Install.SkipChecksumVerification, + } + + installables = append(installables, ev) + } + + return installables, nil +} diff --git a/ibm/vendor/github.com/hashicorp/hc-install/src/src.go b/ibm/vendor/github.com/hashicorp/hc-install/src/src.go new file mode 100644 index 0000000000..11fef7869f --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/hc-install/src/src.go @@ -0,0 +1,42 @@ +package src + +import ( + "context" + "log" + + isrc "github.com/hashicorp/hc-install/internal/src" +) + +// Source represents an installer, finder, or builder +type Source interface { + IsSourceImpl() isrc.InstallSrcSigil +} + +type Installable interface { + Source + Install(ctx context.Context) (string, error) +} + +type Findable interface { + Source + Find(ctx context.Context) (string, error) +} + +type Buildable interface { + Source + Build(ctx context.Context) (string, error) +} + +type Validatable interface { + Source + Validate() error +} + +type Removable interface { + Source + Remove(ctx context.Context) error +} + +type LoggerSettable interface { + SetLogger(logger *log.Logger) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/internal/version/version.go b/ibm/vendor/github.com/hashicorp/terraform-exec/internal/version/version.go index 4d43e000bb..cf2c1a1f32 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/internal/version/version.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/internal/version/version.go @@ -1,6 +1,6 @@ package version -const version = "0.14.0" +const version = "0.15.0" // ModuleVersion returns the current version of the github.com/hashicorp/terraform-exec Go module. // This is a function to allow for future possible enhancement using debug.BuildInfo. diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/add.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/add.go new file mode 100644 index 0000000000..0e60034e49 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/add.go @@ -0,0 +1,101 @@ +package tfexec + +import ( + "context" + "fmt" + "os/exec" + "strconv" + "strings" +) + +type addConfig struct { + fromState bool + out string + includeOptional bool + provider string + reattachInfo ReattachInfo +} + +var defaultAddOptions = addConfig{} + +type AddOption interface { + configureAdd(*addConfig) +} + +func (opt *FromStateOption) configureAdd(conf *addConfig) { + conf.fromState = opt.fromState +} + +func (opt *OutOption) configureAdd(conf *addConfig) { + conf.out = opt.path +} + +func (opt *IncludeOptionalOption) configureAdd(conf *addConfig) { + conf.includeOptional = opt.includeOptional +} + +func (opt *ProviderOption) configureAdd(conf *addConfig) { + conf.provider = opt.provider +} + +func (opt *ReattachOption) configureAdd(conf *addConfig) { + conf.reattachInfo = opt.info +} + +// Add represents the `terraform add` subcommand (added in 1.1.0). +// +// Note that this function signature and behaviour is subject +// to breaking changes including removal of that function +// until final 1.1.0 Terraform version (with this command) is released. +func (tf *Terraform) Add(ctx context.Context, address string, opts ...AddOption) (string, error) { + cmd, err := tf.addCmd(ctx, address, opts...) + if err != nil { + return "", err + } + + var outBuf strings.Builder + cmd.Stdout = mergeWriters(cmd.Stdout, &outBuf) + + if err := tf.runTerraformCmd(ctx, cmd); err != nil { + return "", err + } + + return outBuf.String(), nil +} + +func (tf *Terraform) addCmd(ctx context.Context, address string, opts ...AddOption) (*exec.Cmd, error) { + err := tf.compatible(ctx, tf1_1_0, nil) + if err != nil { + return nil, fmt.Errorf("terraform add was added in 1.1.0: %w", err) + } + + c := defaultAddOptions + + for _, o := range opts { + o.configureAdd(&c) + } + + args := []string{"add"} + + args = append(args, "-from-state="+strconv.FormatBool(c.fromState)) + if c.out != "" { + args = append(args, "-out="+c.out) + } + args = append(args, "-optional="+strconv.FormatBool(c.includeOptional)) + if c.provider != "" { + args = append(args, "-provider="+c.provider) + } + + args = append(args, address) + + mergeEnv := map[string]string{} + if c.reattachInfo != nil { + reattachStr, err := c.reattachInfo.marshalString() + if err != nil { + return nil, err + } + mergeEnv[reattachEnvVar] = reattachStr + } + + return tf.buildTerraformCmd(ctx, mergeEnv, args...), nil +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/apply.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/apply.go index 82d09d5fc7..40d9e69b9f 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/apply.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/apply.go @@ -17,6 +17,7 @@ type applyConfig struct { parallelism int reattachInfo ReattachInfo refresh bool + replaceAddrs []string state string stateOut string targets []string @@ -73,6 +74,10 @@ func (opt *RefreshOption) configureApply(conf *applyConfig) { conf.refresh = opt.refresh } +func (opt *ReplaceOption) configureApply(conf *applyConfig) { + conf.replaceAddrs = append(conf.replaceAddrs, opt.address) +} + func (opt *VarOption) configureApply(conf *applyConfig) { conf.vars = append(conf.vars, opt.assignment) } @@ -126,6 +131,15 @@ func (tf *Terraform) applyCmd(ctx context.Context, opts ...ApplyOption) (*exec.C args = append(args, "-refresh="+strconv.FormatBool(c.refresh)) // string slice opts: split into separate args + if c.replaceAddrs != nil { + err := tf.compatible(ctx, tf0_15_2, nil) + if err != nil { + return nil, fmt.Errorf("replace option was introduced in Terraform 0.15.2: %w", err) + } + for _, addr := range c.replaceAddrs { + args = append(args, "-replace="+addr) + } + } if c.targets != nil { for _, ta := range c.targets { args = append(args, "-target="+ta) diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/exit_errors.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/exit_errors.go index 359e6ad0e1..b2b0ada62b 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/exit_errors.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/exit_errors.go @@ -6,6 +6,7 @@ import ( "os/exec" "regexp" "strings" + "text/template" ) // this file contains errors parsed from stderr @@ -17,8 +18,10 @@ var ( usageRegexp = regexp.MustCompile(`Too many command line arguments|^Usage: .*Options:.*|Error: Invalid -\d+ option`) - // "Could not load plugin" is present in 0.13 - noInitErrRegexp = regexp.MustCompile(`Error: Could not satisfy plugin requirements|Error: Could not load plugin`) + noInitErrRegexp = regexp.MustCompile(`Error: Could not satisfy plugin requirements|` + + `Error: Could not load plugin|` + // v0.13 + `Please run \"terraform init\"|` + // v1.1.0 early alpha versions (ref 89b05050) + `run:\s+terraform init`) // v1.1.0 (ref df578afd) noConfigErrRegexp = regexp.MustCompile(`Error: No configuration files`) @@ -29,6 +32,9 @@ var ( tfVersionMismatchErrRegexp = regexp.MustCompile(`Error: The currently running version of Terraform doesn't meet the|Error: Unsupported Terraform Core version`) tfVersionMismatchConstraintRegexp = regexp.MustCompile(`required_version = "(.+)"|Required version: (.+)\b`) configInvalidErrRegexp = regexp.MustCompile(`There are some problems with the configuration, described below.`) + + stateLockErrRegexp = regexp.MustCompile(`Error acquiring the state lock`) + stateLockInfoRegexp = regexp.MustCompile(`Lock Info:\n\s*ID:\s*([^\n]+)\n\s*Path:\s*([^\n]+)\n\s*Operation:\s*([^\n]+)\n\s*Who:\s*([^\n]+)\n\s*Version:\s*([^\n]+)\n\s*Created:\s*([^\n]+)\n`) ) func (tf *Terraform) wrapExitError(ctx context.Context, err error, stderr string) error { @@ -127,6 +133,20 @@ func (tf *Terraform) wrapExitError(ctx context.Context, err error, stderr string } case configInvalidErrRegexp.MatchString(stderr): return &ErrConfigInvalid{stderr: stderr} + case stateLockErrRegexp.MatchString(stderr): + submatches := stateLockInfoRegexp.FindStringSubmatch(stderr) + if len(submatches) == 7 { + return &ErrStateLocked{ + unwrapper: unwrapper{exitErr, ctxErr}, + + ID: submatches[1], + Path: submatches[2], + Operation: submatches[3], + Who: submatches[4], + Version: submatches[5], + Created: submatches[6], + } + } } return fmt.Errorf("%w\n%s", &unwrapper{exitErr, ctxErr}, stderr) @@ -256,3 +276,33 @@ func (e *ErrTFVersionMismatch) Error() string { return fmt.Sprintf("terraform %s not supported by configuration%s", version, requirement) } + +// ErrStateLocked is returned when the state lock is already held by another process. +type ErrStateLocked struct { + unwrapper + + ID string + Path string + Operation string + Who string + Version string + Created string +} + +func (e *ErrStateLocked) Error() string { + tmpl := `Lock Info: + ID: {{.ID}} + Path: {{.Path}} + Operation: {{.Operation}} + Who: {{.Who}} + Version: {{.Version}} + Created: {{.Created}} +` + + t := template.Must(template.New("LockInfo").Parse(tmpl)) + var out strings.Builder + if err := t.Execute(&out, e); err != nil { + return "error acquiring the state lock" + } + return fmt.Sprintf("error acquiring the state lock: %v", out.String()) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/fmt.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/fmt.go index 10f6cb4cf4..2234c79fa7 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/fmt.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/fmt.go @@ -1,7 +1,6 @@ package tfexec import ( - "bytes" "context" "fmt" "io" @@ -44,7 +43,7 @@ func FormatString(ctx context.Context, execPath string, content string) (string, // FormatString formats a passed string. func (tf *Terraform) FormatString(ctx context.Context, content string) (string, error) { in := strings.NewReader(content) - var outBuf bytes.Buffer + var outBuf strings.Builder err := tf.Format(ctx, in, &outBuf) if err != nil { return "", err @@ -101,7 +100,7 @@ func (tf *Terraform) FormatCheck(ctx context.Context, opts ...FormatOption) (boo return false, nil, err } - var outBuf bytes.Buffer + var outBuf strings.Builder cmd.Stdout = mergeWriters(cmd.Stdout, &outBuf) err = tf.runTerraformCmd(ctx, cmd) diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/options.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/options.go index d78901071b..fb2d5bd74b 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/options.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/options.go @@ -117,6 +117,15 @@ func DryRun(dryRun bool) *DryRunOption { return &DryRunOption{dryRun} } +type FSMirrorOption struct { + fsMirror string +} + +// FSMirror represents the -fs-mirror option (path to filesystem mirror directory) +func FSMirror(fsMirror string) *FSMirrorOption { + return &FSMirrorOption{fsMirror} +} + type ForceOption struct { force bool } @@ -178,6 +187,15 @@ func LockTimeout(lockTimeout string) *LockTimeoutOption { return &LockTimeoutOption{lockTimeout} } +type NetMirrorOption struct { + netMirror string +} + +// NetMirror represents the -net-mirror option (base URL of a network mirror) +func NetMirror(netMirror string) *NetMirrorOption { + return &NetMirrorOption{netMirror} +} + type OutOption struct { path string } @@ -194,6 +212,15 @@ func Parallelism(n int) *ParallelismOption { return &ParallelismOption{n} } +type PlatformOption struct { + platform string +} + +// Platform represents the -platform flag which is an os_arch string +func Platform(platform string) *PlatformOption { + return &PlatformOption{platform} +} + type PluginDirOption struct { pluginDir string } @@ -202,6 +229,15 @@ func PluginDir(pluginDir string) *PluginDirOption { return &PluginDirOption{pluginDir} } +type ProviderOption struct { + provider string +} + +// Provider represents the positional argument (provider source address) +func Provider(providers string) *ProviderOption { + return &ProviderOption{providers} +} + type ReattachInfo map[string]ReattachConfig // ReattachConfig holds the information Terraform needs to be able to attach @@ -260,6 +296,14 @@ func Refresh(refresh bool) *RefreshOption { return &RefreshOption{refresh} } +type ReplaceOption struct { + address string +} + +func Replace(address string) *ReplaceOption { + return &ReplaceOption{address} +} + type StateOption struct { path string } @@ -329,3 +373,21 @@ type VerifyPluginsOption struct { func VerifyPlugins(verifyPlugins bool) *VerifyPluginsOption { return &VerifyPluginsOption{verifyPlugins} } + +// FromStateOption represents the -from-state option of the "terraform add" command. +type FromStateOption struct { + fromState bool +} + +func FromState(fromState bool) *FromStateOption { + return &FromStateOption{fromState} +} + +// IncludeOptionalOption represents the -optional option of the "terraform add" command. +type IncludeOptionalOption struct { + includeOptional bool +} + +func IncludeOptional(includeOptional bool) *IncludeOptionalOption { + return &IncludeOptionalOption{includeOptional} +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/plan.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/plan.go index bfe77db73f..bf41094bb8 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/plan.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/plan.go @@ -16,6 +16,7 @@ type planConfig struct { parallelism int reattachInfo ReattachInfo refresh bool + replaceAddrs []string state string targets []string vars []string @@ -63,6 +64,10 @@ func (opt *RefreshOption) configurePlan(conf *planConfig) { conf.refresh = opt.refresh } +func (opt *ReplaceOption) configurePlan(conf *planConfig) { + conf.replaceAddrs = append(conf.replaceAddrs, opt.address) +} + func (opt *ParallelismOption) configurePlan(conf *planConfig) { conf.parallelism = opt.parallelism } @@ -132,6 +137,15 @@ func (tf *Terraform) planCmd(ctx context.Context, opts ...PlanOption) (*exec.Cmd args = append(args, "-refresh="+strconv.FormatBool(c.refresh)) // unary flags: pass if true + if c.replaceAddrs != nil { + err := tf.compatible(ctx, tf0_15_2, nil) + if err != nil { + return nil, fmt.Errorf("replace option was introduced in Terraform 0.15.2: %w", err) + } + for _, addr := range c.replaceAddrs { + args = append(args, "-replace="+addr) + } + } if c.destroy { args = append(args, "-destroy") } diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/providers_lock.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/providers_lock.go new file mode 100644 index 0000000000..b3a20216d2 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/providers_lock.go @@ -0,0 +1,82 @@ +package tfexec + +import ( + "context" + "fmt" + "os/exec" +) + +type providersLockConfig struct { + fsMirror string + netMirror string + platforms []string + providers []string +} + +var defaultProvidersLockOptions = providersLockConfig{} + +type ProvidersLockOption interface { + configureProvidersLock(*providersLockConfig) +} + +func (opt *FSMirrorOption) configureProvidersLock(conf *providersLockConfig) { + conf.fsMirror = opt.fsMirror +} + +func (opt *NetMirrorOption) configureProvidersLock(conf *providersLockConfig) { + conf.netMirror = opt.netMirror +} + +func (opt *PlatformOption) configureProvidersLock(conf *providersLockConfig) { + conf.platforms = append(conf.platforms, opt.platform) +} + +func (opt *ProviderOption) configureProvidersLock(conf *providersLockConfig) { + conf.providers = append(conf.providers, opt.provider) +} + +// ProvidersLock represents the `terraform providers lock` command +func (tf *Terraform) ProvidersLock(ctx context.Context, opts ...ProvidersLockOption) error { + err := tf.compatible(ctx, tf0_14_0, nil) + if err != nil { + return fmt.Errorf("terraform providers lock was added in 0.14.0: %w", err) + } + + lockCmd := tf.providersLockCmd(ctx, opts...) + + err = tf.runTerraformCmd(ctx, lockCmd) + if err != nil { + return err + } + + return err +} + +func (tf *Terraform) providersLockCmd(ctx context.Context, opts ...ProvidersLockOption) *exec.Cmd { + c := defaultProvidersLockOptions + + for _, o := range opts { + o.configureProvidersLock(&c) + } + args := []string{"providers", "lock"} + + // string options, only pass if set + if c.fsMirror != "" { + args = append(args, "-fs-mirror="+c.fsMirror) + } + + if c.netMirror != "" { + args = append(args, "-net-mirror="+c.netMirror) + } + + for _, p := range c.platforms { + args = append(args, "-platform="+p) + } + + // positional providers argument + for _, p := range c.providers { + args = append(args, p) + } + + return tf.buildTerraformCmd(ctx, nil, args...) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/show.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/show.go index a8d67f1a4c..61e660ac99 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/show.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/show.go @@ -1,10 +1,10 @@ package tfexec import ( - "bytes" "context" "fmt" "os/exec" + "strings" tfjson "github.com/hashicorp/terraform-json" ) @@ -173,14 +173,14 @@ func (tf *Terraform) ShowPlanFileRaw(ctx context.Context, planPath string, opts showCmd := tf.showCmd(ctx, false, mergeEnv, planPath) - var ret bytes.Buffer - showCmd.Stdout = &ret + var outBuf strings.Builder + showCmd.Stdout = &outBuf err := tf.runTerraformCmd(ctx, showCmd) if err != nil { return "", err } - return ret.String(), nil + return outBuf.String(), nil } diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/validate.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/validate.go index 756eccd75c..320011df19 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/validate.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/validate.go @@ -19,8 +19,8 @@ func (tf *Terraform) Validate(ctx context.Context) (*tfjson.ValidateOutput, erro cmd := tf.buildTerraformCmd(ctx, nil, "validate", "-no-color", "-json") - var outbuf = bytes.Buffer{} - cmd.Stdout = &outbuf + var outBuf = bytes.Buffer{} + cmd.Stdout = &outBuf err = tf.runTerraformCmd(ctx, cmd) // TODO: this command should not exit 1 if you pass -json as its hard to differentiate other errors @@ -30,7 +30,7 @@ func (tf *Terraform) Validate(ctx context.Context) (*tfjson.ValidateOutput, erro var ret tfjson.ValidateOutput // TODO: ret.UseJSONNumber(true) validate output should support JSON numbers - jsonErr := json.Unmarshal(outbuf.Bytes(), &ret) + jsonErr := json.Unmarshal(outBuf.Bytes(), &ret) if jsonErr != nil { // the original call was possibly bad, if it has an error, actually just return that if err != nil { diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/version.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/version.go index 2e842a8758..d9c57cd07a 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/version.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/version.go @@ -19,6 +19,8 @@ var ( tf0_13_0 = version.Must(version.NewVersion("0.13.0")) tf0_14_0 = version.Must(version.NewVersion("0.14.0")) tf0_15_0 = version.Must(version.NewVersion("0.15.0")) + tf0_15_2 = version.Must(version.NewVersion("0.15.2")) + tf1_1_0 = version.Must(version.NewVersion("1.1.0")) ) // Version returns structured output from the terraform version command including both the Terraform CLI version @@ -88,7 +90,7 @@ func parseJsonVersionOutput(stdout []byte) (*version.Version, map[string]*versio func (tf *Terraform) versionFromPlaintext(ctx context.Context) (*version.Version, map[string]*version.Version, error) { versionCmd := tf.buildTerraformCmd(ctx, nil, "version") - var outBuf bytes.Buffer + var outBuf strings.Builder versionCmd.Stdout = &outBuf err := tf.runTerraformCmd(ctx, versionCmd) diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/workspace_list.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/workspace_list.go index b8d0309454..33c0d779b3 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/workspace_list.go +++ b/ibm/vendor/github.com/hashicorp/terraform-exec/tfexec/workspace_list.go @@ -1,7 +1,6 @@ package tfexec import ( - "bytes" "context" "strings" ) @@ -11,7 +10,7 @@ func (tf *Terraform) WorkspaceList(ctx context.Context) ([]string, string, error // TODO: [DIR] param option wlCmd := tf.buildTerraformCmd(ctx, nil, "workspace", "list", "-no-color") - var outBuf bytes.Buffer + var outBuf strings.Builder wlCmd.Stdout = &outBuf err := tf.runTerraformCmd(ctx, wlCmd) diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/doc.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/doc.go deleted file mode 100644 index e48ea412b3..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package tfinstall offers multiple strategies for finding and/or installing -// a binary version of Terraform. Some of the strategies can also authenticate -// the source of the binary as an official HashiCorp release. -package tfinstall diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/download.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/download.go deleted file mode 100644 index 69c51f036c..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/download.go +++ /dev/null @@ -1,125 +0,0 @@ -package tfinstall - -import ( - "context" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "runtime" - "strings" - - "github.com/hashicorp/go-getter" - "golang.org/x/crypto/openpgp" -) - -func ensureInstallDir(installDir string) (string, error) { - if installDir == "" { - return ioutil.TempDir("", "tfexec") - } - - if _, err := os.Stat(installDir); err != nil { - return "", fmt.Errorf("could not access directory %s for installing Terraform: %w", installDir, err) - } - - return installDir, nil -} - -func downloadWithVerification(ctx context.Context, tfVersion string, installDir string, appendUserAgent string) (string, error) { - osName := runtime.GOOS - archName := runtime.GOARCH - - // setup: ensure we have a place to put our downloaded terraform binary - tfDir, err := ensureInstallDir(installDir) - if err != nil { - return "", err - } - - httpGetter := &getter.HttpGetter{ - Netrc: true, - Client: newHTTPClient(appendUserAgent), - } - client := getter.Client{ - Ctx: ctx, - Getters: map[string]getter.Getter{ - "https": httpGetter, - }, - } - client.Mode = getter.ClientModeAny - - // firstly, download and verify the signature of the checksum file - - sumsTmpDir, err := ioutil.TempDir("", "tfinstall") - if err != nil { - return "", err - } - defer os.RemoveAll(sumsTmpDir) - - sumsFilename := "terraform_" + tfVersion + "_SHA256SUMS" - sumsSigFilename := sumsFilename + ".72D7468F.sig" - - sumsURL := fmt.Sprintf("%s/%s/%s", baseURL, tfVersion, sumsFilename) - sumsSigURL := fmt.Sprintf("%s/%s/%s", baseURL, tfVersion, sumsSigFilename) - - client.Src = sumsURL - client.Dst = sumsTmpDir - err = client.Get() - if err != nil { - return "", fmt.Errorf("error fetching checksums at URL %s: %w", sumsURL, err) - } - - client.Src = sumsSigURL - err = client.Get() - if err != nil { - return "", fmt.Errorf("error fetching checksums signature: %s", err) - } - - sumsPath := filepath.Join(sumsTmpDir, sumsFilename) - sumsSigPath := filepath.Join(sumsTmpDir, sumsSigFilename) - - err = verifySumsSignature(sumsPath, sumsSigPath) - if err != nil { - return "", err - } - - // secondly, download Terraform itself, verifying the checksum - url := tfURL(tfVersion, osName, archName) - client.Src = url - client.Dst = tfDir - client.Mode = getter.ClientModeDir - err = client.Get() - if err != nil { - return "", err - } - - return filepath.Join(tfDir, "terraform"), nil -} - -// verifySumsSignature downloads SHA256SUMS and SHA256SUMS.sig and verifies -// the signature using the HashiCorp public key. -func verifySumsSignature(sumsPath, sumsSigPath string) error { - el, err := openpgp.ReadArmoredKeyRing(strings.NewReader(hashicorpPublicKey)) - if err != nil { - return err - } - data, err := os.Open(sumsPath) - if err != nil { - return err - } - sig, err := os.Open(sumsSigPath) - if err != nil { - return err - } - _, err = openpgp.CheckDetachedSignature(el, data, sig) - - return err -} - -func tfURL(tfVersion, osName, archName string) string { - sumsFilename := "terraform_" + tfVersion + "_SHA256SUMS" - sumsURL := fmt.Sprintf("%s/%s/%s", baseURL, tfVersion, sumsFilename) - return fmt.Sprintf( - "%s/%s/terraform_%s_%s_%s.zip?checksum=file:%s", - baseURL, tfVersion, tfVersion, osName, archName, sumsURL, - ) -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/exact_path.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/exact_path.go deleted file mode 100644 index 010cc5015a..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/exact_path.go +++ /dev/null @@ -1,27 +0,0 @@ -package tfinstall - -import ( - "context" - "os" -) - -type ExactPathOption struct { - execPath string -} - -var _ ExecPathFinder = &ExactPathOption{} - -func ExactPath(execPath string) *ExactPathOption { - opt := &ExactPathOption{ - execPath: execPath, - } - return opt -} - -func (opt *ExactPathOption) ExecPath(context.Context) (string, error) { - if _, err := os.Stat(opt.execPath); err != nil { - // fall through to the next strategy if the local path does not exist - return "", nil - } - return opt.execPath, nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/exact_version.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/exact_version.go deleted file mode 100644 index afcb9aca42..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/exact_version.go +++ /dev/null @@ -1,35 +0,0 @@ -package tfinstall - -import ( - "context" - - "github.com/hashicorp/go-version" -) - -type ExactVersionOption struct { - tfVersion string - installDir string - - UserAgent string -} - -var _ ExecPathFinder = &ExactVersionOption{} - -func ExactVersion(tfVersion string, installDir string) *ExactVersionOption { - opt := &ExactVersionOption{ - tfVersion: tfVersion, - installDir: installDir, - } - - return opt -} - -func (opt *ExactVersionOption) ExecPath(ctx context.Context) (string, error) { - // validate version - _, err := version.NewVersion(opt.tfVersion) - if err != nil { - return "", err - } - - return downloadWithVerification(ctx, opt.tfVersion, opt.installDir, opt.UserAgent) -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/http.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/http.go deleted file mode 100644 index 70d95a6e80..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/http.go +++ /dev/null @@ -1,37 +0,0 @@ -package tfinstall - -import ( - "fmt" - "net/http" - "os" - "strings" - - cleanhttp "github.com/hashicorp/go-cleanhttp" - - intversion "github.com/hashicorp/terraform-exec/internal/version" -) - -type userAgentRoundTripper struct { - inner http.RoundTripper - userAgent string -} - -func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - if _, ok := req.Header["User-Agent"]; !ok { - req.Header.Set("User-Agent", rt.userAgent) - } - return rt.inner.RoundTrip(req) -} - -func newHTTPClient(appendUA string) *http.Client { - appendUA = strings.TrimSpace(appendUA + " " + os.Getenv("TF_APPEND_USER_AGENT")) - userAgent := strings.TrimSpace(fmt.Sprintf("HashiCorp-tfinstall/%s %s", intversion.ModuleVersion(), appendUA)) - - cli := cleanhttp.DefaultPooledClient() - cli.Transport = &userAgentRoundTripper{ - userAgent: userAgent, - inner: cli.Transport, - } - - return cli -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/latest_version.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/latest_version.go deleted file mode 100644 index f01735cac4..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/latest_version.go +++ /dev/null @@ -1,51 +0,0 @@ -package tfinstall - -import ( - "context" - "fmt" - - "github.com/hashicorp/go-checkpoint" -) - -type LatestVersionOption struct { - forceCheckpoint bool - installDir string - - UserAgent string -} - -var _ ExecPathFinder = &LatestVersionOption{} - -func LatestVersion(installDir string, forceCheckpoint bool) *LatestVersionOption { - opt := &LatestVersionOption{ - forceCheckpoint: forceCheckpoint, - installDir: installDir, - } - - return opt -} - -func (opt *LatestVersionOption) ExecPath(ctx context.Context) (string, error) { - v, err := latestVersion(opt.forceCheckpoint) - if err != nil { - return "", err - } - - return downloadWithVerification(ctx, v, opt.installDir, opt.UserAgent) -} - -func latestVersion(forceCheckpoint bool) (string, error) { - resp, err := checkpoint.Check(&checkpoint.CheckParams{ - Product: "terraform", - Force: forceCheckpoint, - }) - if err != nil { - return "", err - } - - if resp.CurrentVersion == "" { - return "", fmt.Errorf("could not determine latest version of terraform using checkpoint: CHECKPOINT_DISABLE may be set") - } - - return resp.CurrentVersion, nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/look_path.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/look_path.go deleted file mode 100644 index 2ebec09b65..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/look_path.go +++ /dev/null @@ -1,30 +0,0 @@ -package tfinstall - -import ( - "context" - "log" - "os/exec" -) - -type LookPathOption struct { -} - -var _ ExecPathFinder = &LookPathOption{} - -func LookPath() *LookPathOption { - opt := &LookPathOption{} - - return opt -} - -func (opt *LookPathOption) ExecPath(context.Context) (string, error) { - p, err := exec.LookPath("terraform") - if err != nil { - if notFoundErr, ok := err.(*exec.Error); ok && notFoundErr.Err == exec.ErrNotFound { - log.Printf("[WARN] could not locate a terraform executable on system path; continuing") - return "", nil - } - return "", err - } - return p, nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/tfinstall.go b/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/tfinstall.go deleted file mode 100644 index 3dd6963534..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-exec/tfinstall/tfinstall.go +++ /dev/null @@ -1,62 +0,0 @@ -package tfinstall - -import ( - "context" - "fmt" - "os/exec" - "strings" -) - -const baseURL = "https://releases.hashicorp.com/terraform" - -type ExecPathFinder interface { - ExecPath(context.Context) (string, error) -} - -func Find(ctx context.Context, opts ...ExecPathFinder) (string, error) { - var terraformPath string - - // go through the options in order - // until a valid terraform executable is found - for _, opt := range opts { - p, err := opt.ExecPath(ctx) - if err != nil { - return "", fmt.Errorf("unexpected error: %s", err) - } - - if p == "" { - // strategy did not locate an executable - fall through to next - continue - } else { - terraformPath = p - break - } - } - - if terraformPath == "" { - return "", fmt.Errorf("could not find terraform executable") - } - - err := runTerraformVersion(terraformPath) - if err != nil { - return "", fmt.Errorf("executable found at path %s is not terraform: %s", terraformPath, err) - } - - return terraformPath, nil -} - -func runTerraformVersion(execPath string) error { - cmd := exec.Command(execPath, "version") - - out, err := cmd.Output() - if err != nil { - return err - } - - // very basic sanity check - if !strings.Contains(string(out), "Terraform v") { - return fmt.Errorf("located executable at %s, but output of `terraform version` was:\n%s", execPath, out) - } - - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-json/plan.go b/ibm/vendor/github.com/hashicorp/terraform-json/plan.go index 97635bd473..1de5bc82a0 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-json/plan.go +++ b/ibm/vendor/github.com/hashicorp/terraform-json/plan.go @@ -4,11 +4,13 @@ import ( "encoding/json" "errors" "fmt" + + "github.com/hashicorp/go-version" ) -// PlanFormatVersions represents versions of the JSON plan format that -// are supported by this package. -var PlanFormatVersions = []string{"0.1", "0.2"} +// PlanFormatVersionConstraints defines the versions of the JSON plan format +// that are supported by this package. +var PlanFormatVersionConstraints = ">= 0.1, < 2.0" // ResourceMode is a string representation of the resource type found // in certain fields in the plan. @@ -66,9 +68,19 @@ func (p *Plan) Validate() error { return errors.New("unexpected plan input, format version is missing") } - if !isStringInSlice(PlanFormatVersions, p.FormatVersion) { - return fmt.Errorf("unsupported plan format version: expected %q, got %q", - PlanFormatVersions, p.FormatVersion) + constraint, err := version.NewConstraint(PlanFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(p.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", p.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported plan format version: %q does not satisfy %q", + version, constraint) } return nil diff --git a/ibm/vendor/github.com/hashicorp/terraform-json/schemas.go b/ibm/vendor/github.com/hashicorp/terraform-json/schemas.go index 88c2c94bb4..2360231d00 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-json/schemas.go +++ b/ibm/vendor/github.com/hashicorp/terraform-json/schemas.go @@ -5,12 +5,13 @@ import ( "errors" "fmt" + "github.com/hashicorp/go-version" "github.com/zclconf/go-cty/cty" ) -// ProviderSchemasFormatVersions represents the versions of -// the JSON provider schema format that are supported by this package. -var ProviderSchemasFormatVersions = []string{"0.1", "0.2"} +// ProviderSchemasFormatVersionConstraints defines the versions of the JSON +// provider schema format that are supported by this package. +var ProviderSchemasFormatVersionConstraints = ">= 0.1, < 2.0" // ProviderSchemas represents the schemas of all providers and // resources in use by the configuration. @@ -38,9 +39,19 @@ func (p *ProviderSchemas) Validate() error { return errors.New("unexpected provider schema data, format version is missing") } - if !isStringInSlice(ProviderSchemasFormatVersions, p.FormatVersion) { - return fmt.Errorf("unsupported provider schema data format version: expected %q, got %q", - ProviderSchemasFormatVersions, p.FormatVersion) + constraint, err := version.NewConstraint(PlanFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(p.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", p.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported provider schema format version: %q does not satisfy %q", + version, constraint) } return nil @@ -212,6 +223,36 @@ type SchemaAttribute struct { Sensitive bool `json:"sensitive,omitempty"` } +type jsonSchemaAttribute struct { + AttributeType json.RawMessage `json:"type,omitempty"` + AttributeNestedType *SchemaNestedAttributeType `json:"nested_type,omitempty"` + Description string `json:"description,omitempty"` + DescriptionKind SchemaDescriptionKind `json:"description_kind,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` + Required bool `json:"required,omitempty"` + Optional bool `json:"optional,omitempty"` + Computed bool `json:"computed,omitempty"` + Sensitive bool `json:"sensitive,omitempty"` +} + +func (as *SchemaAttribute) MarshalJSON() ([]byte, error) { + jsonSa := &jsonSchemaAttribute{ + AttributeNestedType: as.AttributeNestedType, + Description: as.Description, + DescriptionKind: as.DescriptionKind, + Deprecated: as.Deprecated, + Required: as.Required, + Optional: as.Optional, + Computed: as.Computed, + Sensitive: as.Sensitive, + } + if as.AttributeType != cty.NilType { + attrTy, _ := as.AttributeType.MarshalJSON() + jsonSa.AttributeType = attrTy + } + return json.Marshal(jsonSa) +} + // SchemaNestedAttributeType describes a nested attribute // which could also be just expressed simply as cty.Object(...), // cty.List(cty.Object(...)) etc. but this allows tracking additional diff --git a/ibm/vendor/github.com/hashicorp/terraform-json/state.go b/ibm/vendor/github.com/hashicorp/terraform-json/state.go index ad632e49d5..bece5c2202 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-json/state.go +++ b/ibm/vendor/github.com/hashicorp/terraform-json/state.go @@ -5,11 +5,13 @@ import ( "encoding/json" "errors" "fmt" + + "github.com/hashicorp/go-version" ) -// StateFormatVersions represents the versions of the JSON state format +// StateFormatVersionConstraints defines the versions of the JSON state format // that are supported by this package. -var StateFormatVersions = []string{"0.1", "0.2"} +var StateFormatVersionConstraints = ">= 0.1, < 2.0" // State is the top-level representation of a Terraform state. type State struct { @@ -50,9 +52,19 @@ func (s *State) Validate() error { return errors.New("unexpected state input, format version is missing") } - if !isStringInSlice(StateFormatVersions, s.FormatVersion) { - return fmt.Errorf("unsupported state format version: expected %q, got %q", - StateFormatVersions, s.FormatVersion) + constraint, err := version.NewConstraint(StateFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(s.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", s.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported state format version: %q does not satisfy %q", + version, constraint) } return nil diff --git a/ibm/vendor/github.com/hashicorp/terraform-json/validate.go b/ibm/vendor/github.com/hashicorp/terraform-json/validate.go index db9db1919c..97b82d0a97 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-json/validate.go +++ b/ibm/vendor/github.com/hashicorp/terraform-json/validate.go @@ -4,8 +4,14 @@ import ( "encoding/json" "errors" "fmt" + + "github.com/hashicorp/go-version" ) +// ValidateFormatVersionConstraints defines the versions of the JSON +// validate format that are supported by this package. +var ValidateFormatVersionConstraints = ">= 0.1, < 2.0" + // Pos represents a position in a config file type Pos struct { Line int `json:"line"` @@ -110,10 +116,19 @@ func (vo *ValidateOutput) Validate() error { return nil } - supportedVersion := "0.1" - if vo.FormatVersion != supportedVersion { - return fmt.Errorf("unsupported validation output format version: expected %q, got %q", - supportedVersion, vo.FormatVersion) + constraint, err := version.NewConstraint(ValidateFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(vo.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", vo.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported validation output format version: %q does not satisfy %q", + version, constraint) } return nil diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go index ffcb96577c..5f1acc34d0 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go @@ -29,7 +29,7 @@ const ( // SchemaNestedBlockNestingModeMap indicates that multiple instances of // the nested block should be permitted, each with a single label, and // that they should be represented in state and config values as a - // tftypes.Map, with an AttributeType of tftypes.Object. The labels on + // tftypes.Map, with an ElementType of tftypes.Object. The labels on // the blocks will be used as the map keys. It is an error, therefore, // to use the same label value on multiple block instances. SchemaNestedBlockNestingModeMap SchemaNestedBlockNestingMode = 4 diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/plugin.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/plugin.go deleted file mode 100644 index efa32947d9..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/plugin.go +++ /dev/null @@ -1,45 +0,0 @@ -package tf5server - -import ( - "context" - "errors" - "net/rpc" - - "github.com/hashicorp/go-plugin" - "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "google.golang.org/grpc" -) - -// GRPCProviderPlugin is an implementation of the -// github.com/hashicorp/go-plugin#Plugin and -// github.com/hashicorp/go-plugin#GRPCPlugin interfaces, indicating how to -// serve tfprotov5.ProviderServers as gRPC plugins for go-plugin. -type GRPCProviderPlugin struct { - GRPCProvider func() tfprotov5.ProviderServer -} - -// Server always returns an error; we're only implementing the GRPCPlugin -// interface, not the Plugin interface. -func (p *GRPCProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error) { - return nil, errors.New("terraform-plugin-go only implements gRPC servers") -} - -// Client always returns an error; we're only implementing the GRPCPlugin -// interface, not the Plugin interface. -func (p *GRPCProviderPlugin) Client(*plugin.MuxBroker, *rpc.Client) (interface{}, error) { - return nil, errors.New("terraform-plugin-go only implements gRPC servers") -} - -// GRPCClient always returns an error; we're only implementing the server half -// of the interface. -func (p *GRPCProviderPlugin) GRPCClient(context.Context, *plugin.GRPCBroker, *grpc.ClientConn) (interface{}, error) { - return nil, errors.New("terraform-plugin-go only implements gRPC servers") -} - -// GRPCServer registers the gRPC provider server with the gRPC server that -// go-plugin is standing up. -func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { - tfplugin5.RegisterProviderServer(s, New(p.GRPCProvider())) - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go deleted file mode 100644 index 34da72a4e6..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go +++ /dev/null @@ -1,358 +0,0 @@ -package tf5server - -import ( - "context" - "sync" - - "github.com/hashicorp/go-hclog" - "github.com/hashicorp/go-plugin" - "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto" -) - -// ServeOpt is an interface for defining options that can be passed to the -// Serve function. Each implementation modifies the ServeConfig being -// generated. A slice of ServeOpts then, cumulatively applied, render a full -// ServeConfig. -type ServeOpt interface { - ApplyServeOpt(*ServeConfig) error -} - -// ServeConfig contains the configured options for how a provider should be -// served. -type ServeConfig struct { - logger hclog.Logger - debugCtx context.Context - debugCh chan *plugin.ReattachConfig - debugCloseCh chan struct{} -} - -type serveConfigFunc func(*ServeConfig) error - -func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { - return s(in) -} - -// WithDebug returns a ServeOpt that will set the server into debug mode, using -// the passed options to populate the go-plugin ServeTestConfig. -func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { - return serveConfigFunc(func(in *ServeConfig) error { - in.debugCtx = ctx - in.debugCh = config - in.debugCloseCh = closeCh - return nil - }) -} - -// WithGoPluginLogger returns a ServeOpt that will set the logger that -// go-plugin should use to log messages. -func WithGoPluginLogger(logger hclog.Logger) ServeOpt { - return serveConfigFunc(func(in *ServeConfig) error { - in.logger = logger - return nil - }) -} - -// Serve starts a tfprotov5.ProviderServer serving, ready for Terraform to -// connect to it. The name passed in should be the fully qualified name that -// users will enter in the source field of the required_providers block, like -// "registry.terraform.io/hashicorp/time". -// -// Zero or more options to configure the server may also be passed. The default -// invocation is sufficient, but if the provider wants to run in debug mode or -// modify the logger that go-plugin is using, ServeOpts can be specified to -// support that. -func Serve(name string, serverFactory func() tfprotov5.ProviderServer, opts ...ServeOpt) error { - var conf ServeConfig - for _, opt := range opts { - err := opt.ApplyServeOpt(&conf) - if err != nil { - return err - } - } - serveConfig := &plugin.ServeConfig{ - HandshakeConfig: plugin.HandshakeConfig{ - ProtocolVersion: 5, - MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", - MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", - }, - Plugins: plugin.PluginSet{ - "provider": &GRPCProviderPlugin{ - GRPCProvider: serverFactory, - }, - }, - GRPCServer: plugin.DefaultGRPCServer, - } - if conf.logger != nil { - serveConfig.Logger = conf.logger - } - if conf.debugCh != nil { - serveConfig.Test = &plugin.ServeTestConfig{ - Context: conf.debugCtx, - ReattachConfigCh: conf.debugCh, - CloseCh: conf.debugCloseCh, - } - } - plugin.Serve(serveConfig) - return nil -} - -type server struct { - downstream tfprotov5.ProviderServer - tfplugin5.UnimplementedProviderServer - - stopMu sync.Mutex - stopCh chan struct{} -} - -func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { - select { - case <-ctx.Done(): - return - case <-stopCh: - cancel() - } -} - -// stoppableContext returns a context that wraps `ctx` but will be canceled -// when the server's stopCh is closed. -// -// This is used to cancel all in-flight contexts when the Stop method of the -// server is called. -func (s *server) stoppableContext(ctx context.Context) context.Context { - s.stopMu.Lock() - defer s.stopMu.Unlock() - - stoppable, cancel := context.WithCancel(ctx) - go mergeStop(stoppable, cancel, s.stopCh) - return stoppable -} - -// New converts a tfprotov5.ProviderServer into a server capable of handling -// Terraform protocol requests and issuing responses using the gRPC types. -func New(serve tfprotov5.ProviderServer) tfplugin5.ProviderServer { - return &server{ - downstream: serve, - stopCh: make(chan struct{}), - } -} - -func (s *server) GetSchema(ctx context.Context, req *tfplugin5.GetProviderSchema_Request) (*tfplugin5.GetProviderSchema_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.GetProviderSchemaRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.GetProviderSchema(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.GetProviderSchema_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) PrepareProviderConfig(ctx context.Context, req *tfplugin5.PrepareProviderConfig_Request) (*tfplugin5.PrepareProviderConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.PrepareProviderConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.PrepareProviderConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.PrepareProviderConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) Configure(ctx context.Context, req *tfplugin5.Configure_Request) (*tfplugin5.Configure_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ConfigureProviderRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ConfigureProvider(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.Configure_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -// stop closes the stopCh associated with the server and replaces it with a new -// one. -// -// This causes all in-flight requests for the server to have their contexts -// canceled. -func (s *server) stop() { - s.stopMu.Lock() - defer s.stopMu.Unlock() - - close(s.stopCh) - s.stopCh = make(chan struct{}) -} - -func (s *server) Stop(ctx context.Context, req *tfplugin5.Stop_Request) (*tfplugin5.Stop_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.StopProviderRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.StopProvider(ctx, r) - if err != nil { - return nil, err - } - s.stop() - ret, err := toproto.Stop_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateDataSourceConfig(ctx context.Context, req *tfplugin5.ValidateDataSourceConfig_Request) (*tfplugin5.ValidateDataSourceConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ValidateDataSourceConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateDataSourceConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateDataSourceConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ReadDataSource(ctx context.Context, req *tfplugin5.ReadDataSource_Request) (*tfplugin5.ReadDataSource_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ReadDataSourceRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ReadDataSource(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ReadDataSource_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateResourceTypeConfig(ctx context.Context, req *tfplugin5.ValidateResourceTypeConfig_Request) (*tfplugin5.ValidateResourceTypeConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ValidateResourceTypeConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateResourceTypeConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateResourceTypeConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin5.UpgradeResourceState_Request) (*tfplugin5.UpgradeResourceState_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.UpgradeResourceStateRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.UpgradeResourceState(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.UpgradeResourceState_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ReadResource(ctx context.Context, req *tfplugin5.ReadResource_Request) (*tfplugin5.ReadResource_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ReadResourceRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ReadResource(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ReadResource_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin5.PlanResourceChange_Request) (*tfplugin5.PlanResourceChange_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.PlanResourceChangeRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.PlanResourceChange(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.PlanResourceChange_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin5.ApplyResourceChange_Request) (*tfplugin5.ApplyResourceChange_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ApplyResourceChangeRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ApplyResourceChange(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ApplyResourceChange_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ImportResourceState(ctx context.Context, req *tfplugin5.ImportResourceState_Request) (*tfplugin5.ImportResourceState_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ImportResourceStateRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ImportResourceState(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ImportResourceState_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/doc.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/doc.go similarity index 100% rename from ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/doc.go rename to ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/doc.go diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/plugin.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/plugin.go new file mode 100644 index 0000000000..a33afd84c0 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/plugin.go @@ -0,0 +1,47 @@ +package tf5server + +import ( + "context" + "errors" + "net/rpc" + + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" + "google.golang.org/grpc" +) + +// GRPCProviderPlugin is an implementation of the +// github.com/hashicorp/go-plugin#Plugin and +// github.com/hashicorp/go-plugin#GRPCPlugin interfaces, indicating how to +// serve tfprotov5.ProviderServers as gRPC plugins for go-plugin. +type GRPCProviderPlugin struct { + GRPCProvider func() tfprotov5.ProviderServer + Opts []ServeOpt + Name string +} + +// Server always returns an error; we're only implementing the GRPCPlugin +// interface, not the Plugin interface. +func (p *GRPCProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// Client always returns an error; we're only implementing the GRPCPlugin +// interface, not the Plugin interface. +func (p *GRPCProviderPlugin) Client(*plugin.MuxBroker, *rpc.Client) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// GRPCClient always returns an error; we're only implementing the server half +// of the interface. +func (p *GRPCProviderPlugin) GRPCClient(context.Context, *plugin.GRPCBroker, *grpc.ClientConn) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// GRPCServer registers the gRPC provider server with the gRPC server that +// go-plugin is standing up. +func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { + tfplugin5.RegisterProviderServer(s, New(p.Name, p.GRPCProvider(), p.Opts...)) + return nil +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go new file mode 100644 index 0000000000..47426ada49 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go @@ -0,0 +1,640 @@ +package tf5server + +import ( + "context" + "errors" + "log" + "regexp" + "strings" + "sync" + + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" + tfaddr "github.com/hashicorp/terraform-registry-address" + testing "github.com/mitchellh/go-testing-interface" +) + +const tflogSubsystemName = "proto" + +// Global logging keys attached to all requests. +// +// Practitioners or tooling reading logs may be depending on these keys, so be +// conscious of that when changing them. +const ( + // A unique ID for the RPC request + logKeyRequestID = "tf_req_id" + + // The full address of the provider, such as + // registry.terraform.io/hashicorp/random + logKeyProviderAddress = "tf_provider_addr" + + // The RPC being run, such as "ApplyResourceChange" + logKeyRPC = "tf_rpc" + + // The type of resource being operated on, such as "random_pet" + logKeyResourceType = "tf_resource_type" + + // The type of data source being operated on, such as "archive_file" + logKeyDataSourceType = "tf_data_source_type" + + // The protocol version being used, as a string, such as "5" + logKeyProtocolVersion = "tf_proto_version" +) + +// ServeOpt is an interface for defining options that can be passed to the +// Serve function. Each implementation modifies the ServeConfig being +// generated. A slice of ServeOpts then, cumulatively applied, render a full +// ServeConfig. +type ServeOpt interface { + ApplyServeOpt(*ServeConfig) error +} + +// ServeConfig contains the configured options for how a provider should be +// served. +type ServeConfig struct { + logger hclog.Logger + debugCtx context.Context + debugCh chan *plugin.ReattachConfig + debugCloseCh chan struct{} + + disableLogInitStderr bool + disableLogLocation bool + useLoggingSink testing.T + envVar string +} + +type serveConfigFunc func(*ServeConfig) error + +func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { + return s(in) +} + +// WithDebug returns a ServeOpt that will set the server into debug mode, using +// the passed options to populate the go-plugin ServeTestConfig. +func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.debugCtx = ctx + in.debugCh = config + in.debugCloseCh = closeCh + return nil + }) +} + +// WithGoPluginLogger returns a ServeOpt that will set the logger that +// go-plugin should use to log messages. +func WithGoPluginLogger(logger hclog.Logger) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.logger = logger + return nil + }) +} + +// WithLoggingSink returns a ServeOpt that will enable the logging sink, which +// is used in test frameworks to control where terraform-plugin-log output is +// written and at what levels, mimicking Terraform's logging sink behaviors. +func WithLoggingSink(t testing.T) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.useLoggingSink = t + return nil + }) +} + +// WithoutLogStderrOverride returns a ServeOpt that will disable the +// terraform-plugin-log behavior of logging to the stderr that existed at +// startup, not the stderr that exists when the logging statement is called. +func WithoutLogStderrOverride() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogInitStderr = true + return nil + }) +} + +// WithoutLogLocation returns a ServeOpt that will exclude file names and line +// numbers from log output for the terraform-plugin-log logs generated by the +// SDKs and provider. +func WithoutLogLocation() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogLocation = true + return nil + }) +} + +// WithLogEnvVarName sets the name of the provider for the purposes of the +// logging environment variable that controls the provider's log level. It is +// the part following TF_LOG_PROVIDER_ and defaults to the name part of the +// provider's registry address, or disabled if it can't parse the provider's +// registry address. Name must only contain letters, numbers, and hyphens. +func WithLogEnvVarName(name string) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if !regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(name) { + return errors.New("environment variable names can only contain a-z, A-Z, 0-9, and -") + } + in.envVar = name + return nil + }) +} + +// Serve starts a tfprotov5.ProviderServer serving, ready for Terraform to +// connect to it. The name passed in should be the fully qualified name that +// users will enter in the source field of the required_providers block, like +// "registry.terraform.io/hashicorp/time". +// +// Zero or more options to configure the server may also be passed. The default +// invocation is sufficient, but if the provider wants to run in debug mode or +// modify the logger that go-plugin is using, ServeOpts can be specified to +// support that. +func Serve(name string, serverFactory func() tfprotov5.ProviderServer, opts ...ServeOpt) error { + var conf ServeConfig + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + return err + } + } + serveConfig := &plugin.ServeConfig{ + HandshakeConfig: plugin.HandshakeConfig{ + ProtocolVersion: 5, + MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", + MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", + }, + Plugins: plugin.PluginSet{ + "provider": &GRPCProviderPlugin{ + GRPCProvider: serverFactory, + }, + }, + GRPCServer: plugin.DefaultGRPCServer, + } + if conf.logger != nil { + serveConfig.Logger = conf.logger + } + if conf.debugCh != nil { + serveConfig.Test = &plugin.ServeTestConfig{ + Context: conf.debugCtx, + ReattachConfigCh: conf.debugCh, + CloseCh: conf.debugCloseCh, + } + } + plugin.Serve(serveConfig) + return nil +} + +type server struct { + downstream tfprotov5.ProviderServer + tfplugin5.UnimplementedProviderServer + + stopMu sync.Mutex + stopCh chan struct{} + + tflogSDKOpts tfsdklog.Options + tflogOpts tflog.Options + useTFLogSink bool + testHandle testing.T + name string +} + +func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { + select { + case <-ctx.Done(): + return + case <-stopCh: + cancel() + } +} + +// stoppableContext returns a context that wraps `ctx` but will be canceled +// when the server's stopCh is closed. +// +// This is used to cancel all in-flight contexts when the Stop method of the +// server is called. +func (s *server) stoppableContext(ctx context.Context) context.Context { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + stoppable, cancel := context.WithCancel(ctx) + go mergeStop(stoppable, cancel, s.stopCh) + return stoppable +} + +// loggingContext returns a context that wraps `ctx` and has +// terraform-plugin-log loggers injected. +func (s *server) loggingContext(ctx context.Context) context.Context { + if s.useTFLogSink { + ctx = tfsdklog.RegisterTestSink(ctx, s.testHandle) + } + + // generate a request ID + reqID, err := uuid.GenerateUUID() + if err != nil { + reqID = "unable to assign request ID: " + err.Error() + } + + // set up the logger SDK loggers are derived from + ctx = tfsdklog.NewRootSDKLogger(ctx, append(tfsdklog.Options{ + tfsdklog.WithLevelFromEnv("TF_LOG_SDK"), + }, s.tflogSDKOpts...)...) + ctx = tfsdklog.With(ctx, logKeyRequestID, reqID) + ctx = tfsdklog.With(ctx, logKeyProviderAddress, s.name) + + // set up our protocol-level subsystem logger + ctx = tfsdklog.NewSubsystem(ctx, tflogSubsystemName, append(tfsdklog.Options{ + tfsdklog.WithLevelFromEnv("TF_LOG_SDK_PROTO"), + }, s.tflogSDKOpts...)...) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyProtocolVersion, "5") + + // set up the provider logger + ctx = tfsdklog.NewRootProviderLogger(ctx, s.tflogOpts...) + ctx = tflog.With(ctx, logKeyRequestID, reqID) + ctx = tflog.With(ctx, logKeyProviderAddress, s.name) + return ctx +} + +func rpcLoggingContext(ctx context.Context, rpc string) context.Context { + ctx = tfsdklog.With(ctx, logKeyRPC, rpc) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyRPC, rpc) + ctx = tflog.With(ctx, logKeyRPC, rpc) + return ctx +} + +func resourceLoggingContext(ctx context.Context, resource string) context.Context { + ctx = tfsdklog.With(ctx, logKeyResourceType, resource) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyResourceType, resource) + ctx = tflog.With(ctx, logKeyResourceType, resource) + return ctx +} + +func dataSourceLoggingContext(ctx context.Context, dataSource string) context.Context { + ctx = tfsdklog.With(ctx, logKeyDataSourceType, dataSource) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyDataSourceType, dataSource) + ctx = tflog.With(ctx, logKeyDataSourceType, dataSource) + return ctx +} + +// New converts a tfprotov5.ProviderServer into a server capable of handling +// Terraform protocol requests and issuing responses using the gRPC types. +func New(name string, serve tfprotov5.ProviderServer, opts ...ServeOpt) tfplugin5.ProviderServer { + var conf ServeConfig + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + // this should never happen, we already executed all + // this code as part of Serve + panic(err) + } + } + var sdkOptions tfsdklog.Options + var options tflog.Options + if !conf.disableLogInitStderr { + sdkOptions = append(sdkOptions, tfsdklog.WithStderrFromInit()) + options = append(options, tfsdklog.WithStderrFromInit()) + } + if conf.disableLogLocation { + sdkOptions = append(sdkOptions, tfsdklog.WithoutLocation()) + options = append(options, tflog.WithoutLocation()) + } + envVar := conf.envVar + if envVar == "" { + addr, err := tfaddr.ParseRawProviderSourceString(name) + if err != nil { + log.Printf("[ERROR] Error parsing provider name %q: %s", name, err) + } else { + envVar = addr.Type + } + } + envVar = strings.ReplaceAll(envVar, "-", "_") + if envVar != "" { + options = append(options, tfsdklog.WithLogName(envVar), tflog.WithLevelFromEnv("TF_LOG_PROVIDER", envVar)) + } + return &server{ + downstream: serve, + stopCh: make(chan struct{}), + tflogOpts: options, + tflogSDKOpts: sdkOptions, + name: name, + useTFLogSink: conf.useLoggingSink != nil, + testHandle: conf.useLoggingSink, + } +} + +func (s *server) GetSchema(ctx context.Context, req *tfplugin5.GetProviderSchema_Request) (*tfplugin5.GetProviderSchema_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "GetSchema") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.GetProviderSchemaRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.GetProviderSchema(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.GetProviderSchema_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) PrepareProviderConfig(ctx context.Context, req *tfplugin5.PrepareProviderConfig_Request) (*tfplugin5.PrepareProviderConfig_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "PrepareProviderConfig") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.PrepareProviderConfigRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.PrepareProviderConfig(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.PrepareProviderConfig_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) Configure(ctx context.Context, req *tfplugin5.Configure_Request) (*tfplugin5.Configure_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "Configure") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ConfigureProviderRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ConfigureProvider(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.Configure_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +// stop closes the stopCh associated with the server and replaces it with a new +// one. +// +// This causes all in-flight requests for the server to have their contexts +// canceled. +func (s *server) stop() { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + close(s.stopCh) + s.stopCh = make(chan struct{}) +} + +func (s *server) Stop(ctx context.Context, req *tfplugin5.Stop_Request) (*tfplugin5.Stop_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "Stop") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.StopProviderRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.StopProvider(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Closing all our contexts") + s.stop() + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Closed all our contexts") + ret, err := toproto.Stop_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateDataSourceConfig(ctx context.Context, req *tfplugin5.ValidateDataSourceConfig_Request) (*tfplugin5.ValidateDataSourceConfig_Response, error) { + ctx = dataSourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ValidateDataSourceConfig"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ValidateDataSourceConfigRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ValidateDataSourceConfig(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ValidateDataSourceConfig_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ReadDataSource(ctx context.Context, req *tfplugin5.ReadDataSource_Request) (*tfplugin5.ReadDataSource_Response, error) { + ctx = dataSourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ReadDataSource"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ReadDataSourceRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ReadDataSource(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ReadDataSource_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateResourceTypeConfig(ctx context.Context, req *tfplugin5.ValidateResourceTypeConfig_Request) (*tfplugin5.ValidateResourceTypeConfig_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ValidateResourceTypeConfig"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ValidateResourceTypeConfigRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ValidateResourceTypeConfig(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ValidateResourceTypeConfig_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin5.UpgradeResourceState_Request) (*tfplugin5.UpgradeResourceState_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "UpgradeResourceState"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.UpgradeResourceStateRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.UpgradeResourceState(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.UpgradeResourceState_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ReadResource(ctx context.Context, req *tfplugin5.ReadResource_Request) (*tfplugin5.ReadResource_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ReadResource"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ReadResourceRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ReadResource(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ReadResource_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin5.PlanResourceChange_Request) (*tfplugin5.PlanResourceChange_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "PlanResourceChange"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.PlanResourceChangeRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.PlanResourceChange(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.PlanResourceChange_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin5.ApplyResourceChange_Request) (*tfplugin5.ApplyResourceChange_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ApplyResourceChange"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ApplyResourceChangeRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ApplyResourceChange(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ApplyResourceChange_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ImportResourceState(ctx context.Context, req *tfplugin5.ImportResourceState_Request) (*tfplugin5.ImportResourceState_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ImportResourceState"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ImportResourceStateRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ImportResourceState(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ImportResourceState_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go index 17ead5b71e..a7e139fed2 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go @@ -29,7 +29,7 @@ const ( // SchemaNestedBlockNestingModeMap indicates that multiple instances of // the nested block should be permitted, each with a single label, and // that they should be represented in state and config values as a - // tftypes.Map, with an AttributeType of tftypes.Object. The labels on + // tftypes.Map, with an ElementType of tftypes.Object. The labels on // the blocks will be used as the map keys. It is an error, therefore, // to use the same label value on multiple block instances. SchemaNestedBlockNestingModeMap SchemaNestedBlockNestingMode = 4 @@ -73,7 +73,7 @@ const ( // SchemaObjectNestingModeMap indicates that multiple instances of the // nested type should be permitted, and that they should be appear in state - // and config values as a tftypes.Map, with an AttributeType of + // and config values as a tftypes.Map, with an ElementType of // tftypes.Object. SchemaObjectNestingModeMap SchemaObjectNestingMode = 4 ) diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/plugin.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/plugin.go deleted file mode 100644 index afdb3f08da..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/plugin.go +++ /dev/null @@ -1,45 +0,0 @@ -package tf6server - -import ( - "context" - "errors" - "net/rpc" - - "github.com/hashicorp/go-plugin" - "github.com/hashicorp/terraform-plugin-go/tfprotov6" - "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" - "google.golang.org/grpc" -) - -// GRPCProviderPlugin is an implementation of the -// github.com/hashicorp/go-plugin#Plugin and -// github.com/hashicorp/go-plugin#GRPCPlugin interfaces, indicating how to -// serve tfprotov6.ProviderServers as gRPC plugins for go-plugin. -type GRPCProviderPlugin struct { - GRPCProvider func() tfprotov6.ProviderServer -} - -// Server always returns an error; we're only implementing the GRPCPlugin -// interface, not the Plugin interface. -func (p *GRPCProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error) { - return nil, errors.New("terraform-plugin-go only implements gRPC servers") -} - -// Client always returns an error; we're only implementing the GRPCPlugin -// interface, not the Plugin interface. -func (p *GRPCProviderPlugin) Client(*plugin.MuxBroker, *rpc.Client) (interface{}, error) { - return nil, errors.New("terraform-plugin-go only implements gRPC servers") -} - -// GRPCClient always returns an error; we're only implementing the server half -// of the interface. -func (p *GRPCProviderPlugin) GRPCClient(context.Context, *plugin.GRPCBroker, *grpc.ClientConn) (interface{}, error) { - return nil, errors.New("terraform-plugin-go only implements gRPC servers") -} - -// GRPCServer registers the gRPC provider server with the gRPC server that -// go-plugin is standing up. -func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { - tfplugin6.RegisterProviderServer(s, New(p.GRPCProvider())) - return nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/server.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/server.go deleted file mode 100644 index 2e907f5d66..0000000000 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/server.go +++ /dev/null @@ -1,357 +0,0 @@ -package tf6server - -import ( - "context" - "sync" - - "github.com/hashicorp/go-hclog" - "github.com/hashicorp/go-plugin" - "github.com/hashicorp/terraform-plugin-go/tfprotov6" - "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto" - "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" - "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto" -) - -// ServeOpt is an interface for defining options that can be passed to the -// Serve function. Each implementation modifies the ServeConfig being -// generated. A slice of ServeOpts then, cumulatively applied, render a full -// ServeConfig. -type ServeOpt interface { - ApplyServeOpt(*ServeConfig) error -} - -// ServeConfig contains the configured options for how a provider should be -// served. -type ServeConfig struct { - logger hclog.Logger - debugCtx context.Context - debugCh chan *plugin.ReattachConfig - debugCloseCh chan struct{} -} - -type serveConfigFunc func(*ServeConfig) error - -func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { - return s(in) -} - -// WithDebug returns a ServeOpt that will set the server into debug mode, using -// the passed options to populate the go-plugin ServeTestConfig. -func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { - return serveConfigFunc(func(in *ServeConfig) error { - in.debugCtx = ctx - in.debugCh = config - in.debugCloseCh = closeCh - return nil - }) -} - -// WithGoPluginLogger returns a ServeOpt that will set the logger that -// go-plugin should use to log messages. -func WithGoPluginLogger(logger hclog.Logger) ServeOpt { - return serveConfigFunc(func(in *ServeConfig) error { - in.logger = logger - return nil - }) -} - -// Serve starts a tfprotov6.ProviderServer serving, ready for Terraform to -// connect to it. The name passed in should be the fully qualified name that -// users will enter in the source field of the required_providers block, like -// "registry.terraform.io/hashicorp/time". -// -// Zero or more options to configure the server may also be passed. The default -// invocation is sufficient, but if the provider wants to run in debug mode or -// modify the logger that go-plugin is using, ServeOpts can be specified to -// support that. -func Serve(name string, serverFactory func() tfprotov6.ProviderServer, opts ...ServeOpt) error { - var conf ServeConfig - for _, opt := range opts { - err := opt.ApplyServeOpt(&conf) - if err != nil { - return err - } - } - serveConfig := &plugin.ServeConfig{ - HandshakeConfig: plugin.HandshakeConfig{ - ProtocolVersion: 6, - MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", - MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", - }, - Plugins: plugin.PluginSet{ - "provider": &GRPCProviderPlugin{ - GRPCProvider: serverFactory, - }, - }, - GRPCServer: plugin.DefaultGRPCServer, - } - if conf.logger != nil { - serveConfig.Logger = conf.logger - } - if conf.debugCh != nil { - serveConfig.Test = &plugin.ServeTestConfig{ - Context: conf.debugCtx, - ReattachConfigCh: conf.debugCh, - CloseCh: conf.debugCloseCh, - } - } - plugin.Serve(serveConfig) - return nil -} - -type server struct { - downstream tfprotov6.ProviderServer - tfplugin6.UnimplementedProviderServer - - stopMu sync.Mutex - stopCh chan struct{} -} - -func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { - select { - case <-ctx.Done(): - return - case <-stopCh: - cancel() - } -} - -// stoppableContext returns a context that wraps `ctx` but will be canceled -// when the server's stopCh is closed. -// -// This is used to cancel all in-flight contexts when the Stop method of the -// server is called. -func (s *server) stoppableContext(ctx context.Context) context.Context { - s.stopMu.Lock() - defer s.stopMu.Unlock() - - stoppable, cancel := context.WithCancel(ctx) - go mergeStop(stoppable, cancel, s.stopCh) - return stoppable -} - -// New converts a tfprotov6.ProviderServer into a server capable of handling -// Terraform protocol requests and issuing responses using the gRPC types. -func New(serve tfprotov6.ProviderServer) tfplugin6.ProviderServer { - return &server{ - downstream: serve, - stopCh: make(chan struct{}), - } -} - -func (s *server) GetProviderSchema(ctx context.Context, req *tfplugin6.GetProviderSchema_Request) (*tfplugin6.GetProviderSchema_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.GetProviderSchemaRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.GetProviderSchema(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.GetProviderSchema_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ConfigureProvider(ctx context.Context, req *tfplugin6.ConfigureProvider_Request) (*tfplugin6.ConfigureProvider_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ConfigureProviderRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ConfigureProvider(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.Configure_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateProviderConfig(ctx context.Context, req *tfplugin6.ValidateProviderConfig_Request) (*tfplugin6.ValidateProviderConfig_Response, error) { - r, err := fromproto.ValidateProviderConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateProviderConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateProviderConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -// stop closes the stopCh associated with the server and replaces it with a new -// one. -// -// This causes all in-flight requests for the server to have their contexts -// canceled. -func (s *server) stop() { - s.stopMu.Lock() - defer s.stopMu.Unlock() - - close(s.stopCh) - s.stopCh = make(chan struct{}) -} - -func (s *server) Stop(ctx context.Context, req *tfplugin6.StopProvider_Request) (*tfplugin6.StopProvider_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.StopProviderRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.StopProvider(ctx, r) - if err != nil { - return nil, err - } - s.stop() - ret, err := toproto.Stop_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateDataResourceConfig(ctx context.Context, req *tfplugin6.ValidateDataResourceConfig_Request) (*tfplugin6.ValidateDataResourceConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ValidateDataResourceConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateDataResourceConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateDataResourceConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ReadDataSource(ctx context.Context, req *tfplugin6.ReadDataSource_Request) (*tfplugin6.ReadDataSource_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ReadDataSourceRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ReadDataSource(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ReadDataSource_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateResourceConfig(ctx context.Context, req *tfplugin6.ValidateResourceConfig_Request) (*tfplugin6.ValidateResourceConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ValidateResourceConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateResourceConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateResourceConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin6.UpgradeResourceState_Request) (*tfplugin6.UpgradeResourceState_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.UpgradeResourceStateRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.UpgradeResourceState(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.UpgradeResourceState_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ReadResource(ctx context.Context, req *tfplugin6.ReadResource_Request) (*tfplugin6.ReadResource_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ReadResourceRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ReadResource(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ReadResource_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin6.PlanResourceChange_Request) (*tfplugin6.PlanResourceChange_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.PlanResourceChangeRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.PlanResourceChange(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.PlanResourceChange_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin6.ApplyResourceChange_Request) (*tfplugin6.ApplyResourceChange_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ApplyResourceChangeRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ApplyResourceChange(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ApplyResourceChange_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ImportResourceState(ctx context.Context, req *tfplugin6.ImportResourceState_Request) (*tfplugin6.ImportResourceState_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ImportResourceStateRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ImportResourceState(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ImportResourceState_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/doc.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/doc.go similarity index 100% rename from ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/server/doc.go rename to ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/doc.go diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go new file mode 100644 index 0000000000..e868d30a5b --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go @@ -0,0 +1,47 @@ +package tf6server + +import ( + "context" + "errors" + "net/rpc" + + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "google.golang.org/grpc" +) + +// GRPCProviderPlugin is an implementation of the +// github.com/hashicorp/go-plugin#Plugin and +// github.com/hashicorp/go-plugin#GRPCPlugin interfaces, indicating how to +// serve tfprotov6.ProviderServers as gRPC plugins for go-plugin. +type GRPCProviderPlugin struct { + GRPCProvider func() tfprotov6.ProviderServer + Opts []ServeOpt + Name string +} + +// Server always returns an error; we're only implementing the GRPCPlugin +// interface, not the Plugin interface. +func (p *GRPCProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// Client always returns an error; we're only implementing the GRPCPlugin +// interface, not the Plugin interface. +func (p *GRPCProviderPlugin) Client(*plugin.MuxBroker, *rpc.Client) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// GRPCClient always returns an error; we're only implementing the server half +// of the interface. +func (p *GRPCProviderPlugin) GRPCClient(context.Context, *plugin.GRPCBroker, *grpc.ClientConn) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// GRPCServer registers the gRPC provider server with the gRPC server that +// go-plugin is standing up. +func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { + tfplugin6.RegisterProviderServer(s, New(p.Name, p.GRPCProvider(), p.Opts...)) + return nil +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go new file mode 100644 index 0000000000..4fd0b6eba5 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go @@ -0,0 +1,641 @@ +package tf6server + +import ( + "context" + "errors" + "log" + "regexp" + "strings" + "sync" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" + tfaddr "github.com/hashicorp/terraform-registry-address" + testing "github.com/mitchellh/go-testing-interface" +) + +const tflogSubsystemName = "proto" + +// Global logging keys attached to all requests. +// +// Practitioners or tooling reading logs may be depending on these keys, so be +// conscious of that when changing them. +const ( + // A unique ID for the RPC request + logKeyRequestID = "tf_req_id" + + // The full address of the provider, such as + // registry.terraform.io/hashicorp/random + logKeyProviderAddress = "tf_provider_addr" + + // The RPC being run, such as "ApplyResourceChange" + logKeyRPC = "tf_rpc" + + // The type of resource being operated on, such as "random_pet" + logKeyResourceType = "tf_resource_type" + + // The type of data source being operated on, such as "archive_file" + logKeyDataSourceType = "tf_data_source_type" + + // The protocol version being used, as a string, such as "6" + logKeyProtocolVersion = "tf_proto_version" +) + +// ServeOpt is an interface for defining options that can be passed to the +// Serve function. Each implementation modifies the ServeConfig being +// generated. A slice of ServeOpts then, cumulatively applied, render a full +// ServeConfig. +type ServeOpt interface { + ApplyServeOpt(*ServeConfig) error +} + +// ServeConfig contains the configured options for how a provider should be +// served. +type ServeConfig struct { + logger hclog.Logger + debugCtx context.Context + debugCh chan *plugin.ReattachConfig + debugCloseCh chan struct{} + + disableLogInitStderr bool + disableLogLocation bool + useLoggingSink testing.T + envVar string +} + +type serveConfigFunc func(*ServeConfig) error + +func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { + return s(in) +} + +// WithDebug returns a ServeOpt that will set the server into debug mode, using +// the passed options to populate the go-plugin ServeTestConfig. +func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.debugCtx = ctx + in.debugCh = config + in.debugCloseCh = closeCh + return nil + }) +} + +// WithGoPluginLogger returns a ServeOpt that will set the logger that +// go-plugin should use to log messages. +func WithGoPluginLogger(logger hclog.Logger) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.logger = logger + return nil + }) +} + +// WithLoggingSink returns a ServeOpt that will enable the logging sink, which +// is used in test frameworks to control where terraform-plugin-log output is +// written and at what levels, mimicking Terraform's logging sink behaviors. +func WithLoggingSink(t testing.T) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.useLoggingSink = t + return nil + }) +} + +// WithoutLogStderrOverride returns a ServeOpt that will disable the +// terraform-plugin-log behavior of logging to the stderr that existed at +// startup, not the stderr that exists when the logging statement is called. +func WithoutLogStderrOverride() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogInitStderr = true + return nil + }) +} + +// WithoutLogLocation returns a ServeOpt that will exclude file names and line +// numbers from log output for the terraform-plugin-log logs generated by the +// SDKs and provider. +func WithoutLogLocation() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogLocation = true + return nil + }) +} + +// WithLogEnvVarName sets the name of the provider for the purposes of the +// logging environment variable that controls the provider's log level. It is +// the part following TF_LOG_PROVIDER_ and defaults to the name part of the +// provider's registry address, or disabled if it can't parse the provider's +// registry address. Name must only contain letters, numbers, and hyphens. +func WithLogEnvVarName(name string) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if !regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(name) { + return errors.New("environment variable names can only contain a-z, A-Z, 0-9, and -") + } + in.envVar = name + return nil + }) +} + +// Serve starts a tfprotov6.ProviderServer serving, ready for Terraform to +// connect to it. The name passed in should be the fully qualified name that +// users will enter in the source field of the required_providers block, like +// "registry.terraform.io/hashicorp/time". +// +// Zero or more options to configure the server may also be passed. The default +// invocation is sufficient, but if the provider wants to run in debug mode or +// modify the logger that go-plugin is using, ServeOpts can be specified to +// support that. +func Serve(name string, serverFactory func() tfprotov6.ProviderServer, opts ...ServeOpt) error { + var conf ServeConfig + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + return err + } + } + serveConfig := &plugin.ServeConfig{ + HandshakeConfig: plugin.HandshakeConfig{ + ProtocolVersion: 6, + MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", + MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", + }, + Plugins: plugin.PluginSet{ + "provider": &GRPCProviderPlugin{ + GRPCProvider: serverFactory, + Opts: opts, + Name: name, + }, + }, + GRPCServer: plugin.DefaultGRPCServer, + } + if conf.logger != nil { + serveConfig.Logger = conf.logger + } + if conf.debugCh != nil { + serveConfig.Test = &plugin.ServeTestConfig{ + Context: conf.debugCtx, + ReattachConfigCh: conf.debugCh, + CloseCh: conf.debugCloseCh, + } + } + plugin.Serve(serveConfig) + return nil +} + +type server struct { + downstream tfprotov6.ProviderServer + tfplugin6.UnimplementedProviderServer + + stopMu sync.Mutex + stopCh chan struct{} + + tflogSDKOpts tfsdklog.Options + tflogOpts tflog.Options + useTFLogSink bool + testHandle testing.T + name string +} + +func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { + select { + case <-ctx.Done(): + return + case <-stopCh: + cancel() + } +} + +// stoppableContext returns a context that wraps `ctx` but will be canceled +// when the server's stopCh is closed. +// +// This is used to cancel all in-flight contexts when the Stop method of the +// server is called. +func (s *server) stoppableContext(ctx context.Context) context.Context { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + stoppable, cancel := context.WithCancel(ctx) + go mergeStop(stoppable, cancel, s.stopCh) + return stoppable +} + +// loggingContext returns a context that wraps `ctx` and has +// terraform-plugin-log loggers injected. +func (s *server) loggingContext(ctx context.Context) context.Context { + if s.useTFLogSink { + ctx = tfsdklog.RegisterTestSink(ctx, s.testHandle) + } + + // generate a request ID + reqID, err := uuid.GenerateUUID() + if err != nil { + reqID = "unable to assign request ID: " + err.Error() + } + + // set up the logger SDK loggers are derived from + ctx = tfsdklog.NewRootSDKLogger(ctx, append(tfsdklog.Options{ + tfsdklog.WithLevelFromEnv("TF_LOG_SDK"), + }, s.tflogSDKOpts...)...) + ctx = tfsdklog.With(ctx, logKeyRequestID, reqID) + ctx = tfsdklog.With(ctx, logKeyProviderAddress, s.name) + + // set up our protocol-level subsystem logger + ctx = tfsdklog.NewSubsystem(ctx, tflogSubsystemName, append(tfsdklog.Options{ + tfsdklog.WithLevelFromEnv("TF_LOG_SDK_PROTO"), + }, s.tflogSDKOpts...)...) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyProtocolVersion, "6") + + // set up the provider logger + ctx = tfsdklog.NewRootProviderLogger(ctx, s.tflogOpts...) + ctx = tflog.With(ctx, logKeyRequestID, reqID) + ctx = tflog.With(ctx, logKeyProviderAddress, s.name) + return ctx +} + +func rpcLoggingContext(ctx context.Context, rpc string) context.Context { + ctx = tfsdklog.With(ctx, logKeyRPC, rpc) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyRPC, rpc) + ctx = tflog.With(ctx, logKeyRPC, rpc) + return ctx +} + +func resourceLoggingContext(ctx context.Context, resource string) context.Context { + ctx = tfsdklog.With(ctx, logKeyResourceType, resource) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyResourceType, resource) + ctx = tflog.With(ctx, logKeyResourceType, resource) + return ctx +} + +func dataSourceLoggingContext(ctx context.Context, dataSource string) context.Context { + ctx = tfsdklog.With(ctx, logKeyDataSourceType, dataSource) + ctx = tfsdklog.SubsystemWith(ctx, tflogSubsystemName, logKeyDataSourceType, dataSource) + ctx = tflog.With(ctx, logKeyDataSourceType, dataSource) + return ctx +} + +// New converts a tfprotov6.ProviderServer into a server capable of handling +// Terraform protocol requests and issuing responses using the gRPC types. +func New(name string, serve tfprotov6.ProviderServer, opts ...ServeOpt) tfplugin6.ProviderServer { + var conf ServeConfig + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + // this should never happen, we already executed all + // this code as part of Serve + panic(err) + } + } + var sdkOptions tfsdklog.Options + var options tflog.Options + if !conf.disableLogInitStderr { + sdkOptions = append(sdkOptions, tfsdklog.WithStderrFromInit()) + options = append(options, tfsdklog.WithStderrFromInit()) + } + if conf.disableLogLocation { + sdkOptions = append(sdkOptions, tfsdklog.WithoutLocation()) + options = append(options, tflog.WithoutLocation()) + } + envVar := conf.envVar + if envVar == "" { + addr, err := tfaddr.ParseRawProviderSourceString(name) + if err != nil { + log.Printf("[ERROR] Error parsing provider name %q: %s", name, err) + } else { + envVar = addr.Type + } + } + envVar = strings.ReplaceAll(envVar, "-", "_") + if envVar != "" { + options = append(options, tfsdklog.WithLogName(envVar), tflog.WithLevelFromEnv("TF_LOG_PROVIDER", envVar)) + } + return &server{ + downstream: serve, + stopCh: make(chan struct{}), + tflogOpts: options, + tflogSDKOpts: sdkOptions, + name: name, + useTFLogSink: conf.useLoggingSink != nil, + testHandle: conf.useLoggingSink, + } +} + +func (s *server) GetProviderSchema(ctx context.Context, req *tfplugin6.GetProviderSchema_Request) (*tfplugin6.GetProviderSchema_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "GetProviderSchema") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.GetProviderSchemaRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.GetProviderSchema(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.GetProviderSchema_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ConfigureProvider(ctx context.Context, req *tfplugin6.ConfigureProvider_Request) (*tfplugin6.ConfigureProvider_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "ConfigureProvider") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ConfigureProviderRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ConfigureProvider(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.Configure_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateProviderConfig(ctx context.Context, req *tfplugin6.ValidateProviderConfig_Request) (*tfplugin6.ValidateProviderConfig_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "ValidateProviderConfig") + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ValidateProviderConfigRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ValidateProviderConfig(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ValidateProviderConfig_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +// stop closes the stopCh associated with the server and replaces it with a new +// one. +// +// This causes all in-flight requests for the server to have their contexts +// canceled. +func (s *server) stop() { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + close(s.stopCh) + s.stopCh = make(chan struct{}) +} + +func (s *server) Stop(ctx context.Context, req *tfplugin6.StopProvider_Request) (*tfplugin6.StopProvider_Response, error) { + ctx = rpcLoggingContext(s.loggingContext(ctx), "Stop") + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.StopProviderRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.StopProvider(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Closing all our contexts") + s.stop() + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Closed all our contexts") + ret, err := toproto.Stop_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateDataResourceConfig(ctx context.Context, req *tfplugin6.ValidateDataResourceConfig_Request) (*tfplugin6.ValidateDataResourceConfig_Response, error) { + ctx = dataSourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ValidateDataResourceConfig"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ValidateDataResourceConfigRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ValidateDataResourceConfig(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ValidateDataResourceConfig_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ReadDataSource(ctx context.Context, req *tfplugin6.ReadDataSource_Request) (*tfplugin6.ReadDataSource_Response, error) { + ctx = dataSourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ReadDataSource"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ReadDataSourceRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ReadDataSource(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ReadDataSource_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateResourceConfig(ctx context.Context, req *tfplugin6.ValidateResourceConfig_Request) (*tfplugin6.ValidateResourceConfig_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ValidateResourceConfig"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ValidateResourceConfigRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ValidateResourceConfig(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ValidateResourceConfig_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin6.UpgradeResourceState_Request) (*tfplugin6.UpgradeResourceState_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "UpgradeResourceState"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.UpgradeResourceStateRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.UpgradeResourceState(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.UpgradeResourceState_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ReadResource(ctx context.Context, req *tfplugin6.ReadResource_Request) (*tfplugin6.ReadResource_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ReadResource"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ReadResourceRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ReadResource(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ReadResource_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin6.PlanResourceChange_Request) (*tfplugin6.PlanResourceChange_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "PlanResourceChange"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.PlanResourceChangeRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.PlanResourceChange(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.PlanResourceChange_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin6.ApplyResourceChange_Request) (*tfplugin6.ApplyResourceChange_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ApplyResourceChange"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ApplyResourceChangeRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ApplyResourceChange(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ApplyResourceChange_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} + +func (s *server) ImportResourceState(ctx context.Context, req *tfplugin6.ImportResourceState_Request) (*tfplugin6.ImportResourceState_Response, error) { + ctx = resourceLoggingContext(rpcLoggingContext(s.loggingContext(ctx), "ImportResourceState"), req.TypeName) + ctx = s.stoppableContext(ctx) + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Received request") + defer tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Served request") + r, err := fromproto.ImportResourceStateRequest(req) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting request from protobuf", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Calling downstream") + resp, err := s.downstream.ImportResourceState(ctx, r) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error from downstream", "error", err) + return nil, err + } + tfsdklog.SubsystemTrace(ctx, tflogSubsystemName, "Called downstream") + ret, err := toproto.ImportResourceState_Response(resp) + if err != nil { + tfsdklog.SubsystemError(ctx, tflogSubsystemName, "Error converting response to protobuf", "error", err) + return nil, err + } + return ret, nil +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go index 84eabe1453..fd91f96a5c 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go @@ -85,21 +85,9 @@ func (a *AttributePath) Equal(o *AttributePath) bool { } for pos, aStep := range a.Steps() { oStep := o.Steps()[pos] - switch aStep.(type) { - case AttributeName, ElementKeyString, ElementKeyInt: - if oStep != aStep { - return false - } - case ElementKeyValue: - oVal, ok := oStep.(ElementKeyValue) - if !ok { - return false - } - if !Value(aStep.(ElementKeyValue)).Equal(Value(oVal)) { - return false - } - default: - panic(fmt.Sprintf("unknown step %T in AttributePath.Equal", aStep)) + + if !aStep.Equal(oStep) { + return false } } return true @@ -129,6 +117,18 @@ func (a *AttributePath) NewError(err error) error { } } +// LastStep returns the last step in the path. If the path was +// empty, nil is returned. +func (a *AttributePath) LastStep() AttributePathStep { + steps := a.Steps() + + if len(steps) == 0 { + return nil + } + + return steps[len(steps)-1] +} + // WithAttributeName adds an AttributeName step to `a`, using `name` as the // attribute's name. `a` is copied, not modified. func (a *AttributePath) WithAttributeName(name string) *AttributePath { @@ -149,7 +149,7 @@ func (a *AttributePath) WithElementKeyString(key string) *AttributePath { // WithElementKeyInt adds an ElementKeyInt step to `a`, using `key` as the // element's key. `a` is copied, not modified. -func (a *AttributePath) WithElementKeyInt(key int64) *AttributePath { +func (a *AttributePath) WithElementKeyInt(key int) *AttributePath { steps := a.Steps() return &AttributePath{ steps: append(steps, ElementKeyInt(key)), @@ -185,6 +185,9 @@ func (a *AttributePath) WithoutLastStep() *AttributePath { // indicating a specific attribute or element that is the next value in the // path. type AttributePathStep interface { + // Equal returns true if the AttributePathStep is equal to the other. + Equal(AttributePathStep) bool + unfulfillable() // make this interface fillable only by this package } @@ -199,6 +202,18 @@ var ( // AttributeName is the name of the attribute to be selected. type AttributeName string +// Equal returns true if the other AttributePathStep is an AttributeName and +// has the same value. +func (a AttributeName) Equal(other AttributePathStep) bool { + otherA, ok := other.(AttributeName) + + if !ok { + return false + } + + return string(a) == string(otherA) +} + func (a AttributeName) unfulfillable() {} // ElementKeyString is an AttributePathStep implementation that indicates the @@ -206,6 +221,18 @@ func (a AttributeName) unfulfillable() {} // The value of the ElementKeyString is the key of the element to select. type ElementKeyString string +// Equal returns true if the other AttributePathStep is an ElementKeyString and +// has the same value. +func (e ElementKeyString) Equal(other AttributePathStep) bool { + otherE, ok := other.(ElementKeyString) + + if !ok { + return false + } + + return string(e) == string(otherE) +} + func (e ElementKeyString) unfulfillable() {} // ElementKeyInt is an AttributePathStep implementation that indicates the next @@ -213,6 +240,18 @@ func (e ElementKeyString) unfulfillable() {} // value of the ElementKeyInt is the key of the element to select. type ElementKeyInt int64 +// Equal returns true if the other AttributePathStep is an ElementKeyInt and +// has the same value. +func (e ElementKeyInt) Equal(other AttributePathStep) bool { + otherE, ok := other.(ElementKeyInt) + + if !ok { + return false + } + + return int(e) == int(otherE) +} + func (e ElementKeyInt) unfulfillable() {} // ElementKeyValue is an AttributePathStep implementation that indicates the @@ -221,6 +260,18 @@ func (e ElementKeyInt) unfulfillable() {} // to select. type ElementKeyValue Value +// Equal returns true if the other AttributePathStep is an ElementKeyValue and +// has the same value. +func (e ElementKeyValue) Equal(other AttributePathStep) bool { + otherE, ok := other.(ElementKeyValue) + + if !ok { + return false + } + + return Value(e).Equal(Value(otherE)) +} + func (e ElementKeyValue) unfulfillable() {} // AttributePathStepper is an interface that types can implement to make them diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go index f2276fc05d..be00020721 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go @@ -11,8 +11,31 @@ type AttributePathError struct { err error } +// Equal returns true if two AttributePathErrors are semantically equal. To be +// considered equal, they must have the same path and if errors are set, the +// strings returned by their `Error()` methods must match. +func (a AttributePathError) Equal(o AttributePathError) bool { + if !a.Path.Equal(o.Path) { + return false + } + + if (a.err == nil && o.err != nil) || (a.err != nil && o.err == nil) { + return false + } + + if a.err == nil { + return true + } + + return a.err.Error() == o.err.Error() +} + func (a AttributePathError) Error() string { - return fmt.Sprintf("%s: %s", a.Path, a.err) + var path string + if len(a.Path.Steps()) > 0 { + path = a.Path.String() + ": " + } + return fmt.Sprintf("%s%s", path, a.err) } func (a AttributePathError) Unwrap() error { diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go index afd302de52..dc89026c53 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go @@ -71,14 +71,22 @@ func (v ValueDiff) Equal(o ValueDiff) bool { // a slice of ValueDiffs. The ValueDiffs in the struct will use `val1`'s values // as Value1 and `val2`'s values as Value2. An empty or nil slice means the two // Values can be considered equal. Values must be the same type when passed to -// Diff; passing in Values of two different types will result in an error. -// val1.Type().Is(val2.Type()) is a safe way to check that Values can be -// compared with Diff. +// Diff; passing in Values of two different types will result in an error. If +// both Values are empty, they are considered equal. If one Value is missing +// type, it will result in an error. val1.Type().Is(val2.Type()) is a safe way +// to check that Values can be compared with Diff. func (val1 Value) Diff(val2 Value) ([]ValueDiff, error) { + var diffs []ValueDiff + + if val1.Type() == nil && val2.Type() == nil && val1.value == nil && val2.value == nil { + return diffs, nil + } + if (val1.Type() == nil && val2.Type() != nil) || (val1.Type() != nil && val2.Type() == nil) { + return nil, errors.New("cannot diff value missing type") + } if !val1.Type().Is(val2.Type()) { return nil, errors.New("Can't diff values of different types") } - var diffs []ValueDiff // make sure everything in val2 is also in val1 err := Walk(val2, func(path *AttributePath, value2 Value) (bool, error) { diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go index 52abc7c369..a633ed1e04 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go @@ -17,20 +17,8 @@ type List struct { // Equal returns true if the two Lists are exactly equal. Unlike Is, passing in // a List with no ElementType will always return false. -func (l List) Equal(o List) bool { - return l.equals(o, true) -} - -// Is returns whether `t` is a List type or not. If `t` is an instance of the -// List type and its ElementType property is nil, it will return true. If `t`'s -// ElementType property is not nil, it will only return true if its ElementType -// is considered the same type as `l`'s ElementType. -func (l List) Is(t Type) bool { - return l.equals(t, false) -} - -func (l List) equals(t Type, exact bool) bool { - v, ok := t.(List) +func (l List) Equal(o Type) bool { + v, ok := o.(List) if !ok { return false } @@ -38,19 +26,33 @@ func (l List) equals(t Type, exact bool) bool { // when doing exact comparisons, we can't compare types that // don't have element types set, so we just consider them not // equal - // - // when doing inexact comparisons, the absence of an element - // type just means "is this a List?" We know it is, so return - // true if and only if l has an ElementType and t doesn't. This - // behavior only makes sense if the user is trying to see if a - // proper type is a list, so we want to ensure that the method - // receiver always has an element type. - if exact { - return false - } - return l.ElementType != nil + return false } - return l.ElementType.equals(v.ElementType, exact) + return l.ElementType.Equal(v.ElementType) +} + +// UsableAs returns whether the two Lists are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a List, it will return false. +// If the other List does not have a type compatible ElementType, it will +// return false. +func (l List) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(List) + if !ok { + return false + } + return l.ElementType.UsableAs(v.ElementType) +} + +// Is returns whether `t` is a List type or not. It does not perform any +// ElementType checks. +func (l List) Is(t Type) bool { + _, ok := t.(List) + return ok } func (l List) String() string { @@ -68,13 +70,15 @@ func valueFromList(typ Type, in interface{}) (Value, error) { case []Value: var valType Type for pos, v := range value { - if err := useTypeAs(v.Type(), typ, NewAttributePath().WithElementKeyInt(int64(pos))); err != nil { - return Value{}, err + if v.Type().Is(DynamicPseudoType) && v.IsKnown() { + return Value{}, NewAttributePath().WithElementKeyInt(pos).NewErrorf("invalid value %s for %s", v, v.Type()) + } else if !v.Type().Is(DynamicPseudoType) && !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyInt(pos).NewErrorf("can't use %s as %s", v.Type(), typ) } if valType == nil { valType = v.Type() } - if !v.Type().equals(valType, true) { + if !v.Type().Equal(valType) { return Value{}, fmt.Errorf("lists must only contain one type of element, saw %s and %s", valType, v.Type()) } } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go index fe90389795..9188df88f4 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go @@ -8,7 +8,7 @@ import ( // Map is a Terraform type representing an unordered collection of elements, // all of the same type, each identifiable with a unique string key. type Map struct { - AttributeType Type + ElementType Type // used to make this type uncomparable // see https://golang.org/ref/spec#Comparison_operators @@ -17,44 +17,47 @@ type Map struct { } // Equal returns true if the two Maps are exactly equal. Unlike Is, passing in -// a Map with no AttributeType will always return false. -func (m Map) Equal(o Map) bool { - return m.equals(o, true) -} - -// Is returns whether `t` is a Map type or not. If `t` is an instance of the -// Map type and its AttributeType property is not nil, it will only return true -// if its AttributeType is considered the same type as `m`'s AttributeType. -func (m Map) Is(t Type) bool { - return m.equals(t, false) -} - -func (m Map) equals(t Type, exact bool) bool { - v, ok := t.(Map) +// a Map with no ElementType will always return false. +func (m Map) Equal(o Type) bool { + v, ok := o.(Map) if !ok { return false } - if v.AttributeType == nil || m.AttributeType == nil { + if v.ElementType == nil || m.ElementType == nil { // when doing exact comparisons, we can't compare types that // don't have element types set, so we just consider them not // equal - // - // when doing inexact comparisons, the absence of an element - // type just means "is this a Map?" We know it is, so return - // true if and only if m has an ElementType and t doesn't. This - // behavior only makes sense if the user is trying to see if a - // proper type is a map, so we want to ensure that the method - // receiver always has an element type. - if exact { - return false - } - return m.AttributeType != nil + return false } - return m.AttributeType.equals(v.AttributeType, exact) + return m.ElementType.Equal(v.ElementType) +} + +// UsableAs returns whether the two Maps are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Map, it will return false. +// If the other Map does not have a type compatible ElementType, it will +// return false. +func (m Map) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(Map) + if !ok { + return false + } + return m.ElementType.UsableAs(v.ElementType) +} + +// Is returns whether `t` is a Map type or not. It does not perform any +// ElementType checks. +func (m Map) Is(t Type) bool { + _, ok := t.(Map) + return ok } func (m Map) String() string { - return "tftypes.Map[" + m.AttributeType.String() + "]" + return "tftypes.Map[" + m.ElementType.String() + "]" } func (m Map) private() {} @@ -64,13 +67,13 @@ func (m Map) supportedGoTypes() []string { } // MarshalJSON returns a JSON representation of the full type signature of `m`, -// including its AttributeType. +// including its ElementType. // // Deprecated: this is not meant to be called by third-party code. func (m Map) MarshalJSON() ([]byte, error) { - attributeType, err := m.AttributeType.MarshalJSON() + attributeType, err := m.ElementType.MarshalJSON() if err != nil { - return nil, fmt.Errorf("error marshaling tftypes.Map's attribute type %T to JSON: %w", m.AttributeType, err) + return nil, fmt.Errorf("error marshaling tftypes.Map's attribute type %T to JSON: %w", m.ElementType, err) } return []byte(`["map",` + string(attributeType) + `]`), nil } @@ -86,18 +89,20 @@ func valueFromMap(typ Type, in interface{}) (Value, error) { var elType Type for _, k := range keys { v := value[k] - if err := useTypeAs(v.Type(), typ, NewAttributePath().WithElementKeyString(k)); err != nil { - return Value{}, err + if v.Type().Is(DynamicPseudoType) && v.IsKnown() { + return Value{}, NewAttributePath().WithElementKeyString(k).NewErrorf("invalid value %s for %s", v, v.Type()) + } else if !v.Type().Is(DynamicPseudoType) && !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyString(k).NewErrorf("can't use %s as %s", v.Type(), typ) } if elType == nil { elType = v.Type() } - if !elType.equals(v.Type(), true) { + if !elType.Equal(v.Type()) { return Value{}, fmt.Errorf("maps must only contain one type of element, saw %s and %s", elType, v.Type()) } } return Value{ - typ: Map{AttributeType: typ}, + typ: Map{ElementType: typ}, value: value, }, nil default: diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go index 2da1631f49..2c9dde76d0 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go @@ -40,21 +40,8 @@ type Object struct { // Equal returns true if the two Objects are exactly equal. Unlike Is, passing // in an Object with no AttributeTypes will always return false. -func (o Object) Equal(other Object) bool { - return o.equals(other, true) -} - -// Is returns whether `t` is an Object type or not. If `t` is an instance of -// the Object type and its AttributeTypes property is not nil, it will only -// return true the AttributeTypes are considered the same. To be considered -// equal, the same set of keys must be present in each, and each key's value -// needs to be considered the same type between the two Objects. -func (o Object) Is(t Type) bool { - return o.equals(t, false) -} - -func (o Object) equals(t Type, exact bool) bool { - v, ok := t.(Object) +func (o Object) Equal(other Type) bool { + v, ok := other.(Object) if !ok { return false } @@ -62,17 +49,7 @@ func (o Object) equals(t Type, exact bool) bool { // when doing exact comparisons, we can't compare types that // don't have attribute types set, so we just consider them not // equal - // - // when doing inexact comparisons, the absence of an attribute - // type just means "is this a Object?" We know it is, so return - // true if and only if o has AttributeTypes and t doesn't. This - // behavior only makes sense if the user is trying to see if a - // proper type is a object, so we want to ensure that the - // method receiver always has attribute types. - if exact { - return false - } - return o.AttributeTypes != nil + return false } // if the don't have the exact same optional attributes, they're not @@ -95,13 +72,56 @@ func (o Object) equals(t Type, exact bool) bool { if _, ok := v.AttributeTypes[k]; !ok { return false } - if !typ.equals(v.AttributeTypes[k], exact) { + if !typ.Equal(v.AttributeTypes[k]) { return false } } return true } +// UsableAs returns whether the two Objects are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Object, it will return false. +// If the other Object does not have matching AttributeTypes length, it will +// return false. +// If the other Object does not have a type compatible ElementType for every +// nested attribute, it will return false. +// +// If the current type contains OptionalAttributes, it will panic. +func (o Object) UsableAs(other Type) bool { + if other.Is(DynamicPseudoType) { + return true + } + v, ok := other.(Object) + if !ok { + return false + } + if len(o.OptionalAttributes) > 0 { + panic("Objects with OptionalAttributes cannot be used.") + } + if len(v.AttributeTypes) != len(o.AttributeTypes) { + return false + } + for k, typ := range o.AttributeTypes { + otherTyp, ok := v.AttributeTypes[k] + if !ok { + return false + } + if !typ.UsableAs(otherTyp) { + return false + } + } + return true +} + +// Is returns whether `t` is an Object type or not. It does not perform any +// AttributeTypes checks. +func (o Object) Is(t Type) bool { + _, ok := t.(Object) + return ok +} + func (o Object) attrIsOptional(attr string) bool { if o.OptionalAttributes == nil { return false @@ -138,15 +158,6 @@ func (o Object) supportedGoTypes() []string { return []string{"map[string]tftypes.Value"} } -func valueCanBeObject(val interface{}) bool { - switch val.(type) { - case map[string]Value: - return true - default: - return false - } -} - func valueFromObject(types map[string]Type, optionalAttrs map[string]struct{}, in interface{}) (Value, error) { switch value := in.(type) { case map[string]Value: @@ -169,9 +180,13 @@ func valueFromObject(types map[string]Type, optionalAttrs map[string]struct{}, i if !ok { return Value{}, fmt.Errorf("can't set a value on %q in tftypes.NewValue, key not part of the object type %s", k, Object{AttributeTypes: types}) } - err := useTypeAs(v.Type(), typ, NewAttributePath().WithAttributeName(k)) - if err != nil { - return Value{}, err + if v.Type() == nil { + return Value{}, NewAttributePath().WithAttributeName(k).NewErrorf("missing value type") + } + if v.Type().Is(DynamicPseudoType) && v.IsKnown() && !v.IsNull() { + return Value{}, NewAttributePath().WithAttributeName(k).NewErrorf("invalid value %s for %s", v, v.Type()) + } else if !v.Type().Is(DynamicPseudoType) && !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithAttributeName(k).NewErrorf("can't use %s as %s", v.Type(), typ) } } } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go index 905056ed52..ff0f14e608 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go @@ -37,20 +37,27 @@ type primitive struct { _ []struct{} } -func (p primitive) Equal(o primitive) bool { - return p.equals(o, true) +func (p primitive) Equal(o Type) bool { + v, ok := o.(primitive) + if !ok { + return false + } + return p.name == v.name } func (p primitive) Is(t Type) bool { - return p.equals(t, false) + return p.Equal(t) } -func (p primitive) equals(t Type, exact bool) bool { +func (p primitive) UsableAs(t Type) bool { v, ok := t.(primitive) if !ok { return false } - return p.name == v.name + if v.name == DynamicPseudoType.name { + return true + } + return v.name == p.name } func (p primitive) String() string { @@ -95,30 +102,11 @@ func (p primitive) supportedGoTypes() []string { case Bool.name: return []string{"bool", "*bool"} case DynamicPseudoType.name: - possibleTypes := []Type{ - String, Bool, Number, - Tuple{}, Object{}, - } - results := []string{} - for _, t := range possibleTypes { - results = append(results, t.supportedGoTypes()...) - } - return results + return []string{"nil", "UnknownValue"} } panic(fmt.Sprintf("unknown primitive type %q", p.name)) } -func valueCanBeString(val interface{}) bool { - switch val.(type) { - case string: - return true - case *string: - return true - default: - return false - } -} - func valueFromString(in interface{}) (Value, error) { switch value := in.(type) { case *string: @@ -142,17 +130,6 @@ func valueFromString(in interface{}) (Value, error) { } } -func valueCanBeBool(val interface{}) bool { - switch val.(type) { - case bool: - return true - case *bool: - return true - default: - return false - } -} - func valueFromBool(in interface{}) (Value, error) { switch value := in.(type) { case *bool: @@ -176,28 +153,15 @@ func valueFromBool(in interface{}) (Value, error) { } } -func valueCanBeNumber(val interface{}) bool { - switch val.(type) { - case uint, uint8, uint16, uint32, uint64: - return true - case *uint, *uint8, *uint16, *uint32, *uint64: - return true - case int, int8, int16, int32, int64: - return true - case *int, *int8, *int16, *int32, *int64: - return true - case float64, *float64: - return true - case *big.Float: - return true - default: - return false - } -} - func valueFromNumber(in interface{}) (Value, error) { switch value := in.(type) { case *big.Float: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } return Value{ typ: Number, value: value, @@ -382,45 +346,3 @@ func valueFromNumber(in interface{}) (Value, error) { return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Number; expected types are: %s", in, formattedSupportedGoTypes(Number)) } } - -func valueFromDynamicPseudoType(val interface{}) (Value, error) { - switch { - case valueCanBeString(val): - v, err := valueFromString(val) - if err != nil { - return Value{}, err - } - v.typ = DynamicPseudoType - return v, nil - case valueCanBeNumber(val): - v, err := valueFromNumber(val) - if err != nil { - return Value{}, err - } - v.typ = DynamicPseudoType - return v, nil - case valueCanBeBool(val): - v, err := valueFromBool(val) - if err != nil { - return Value{}, err - } - v.typ = DynamicPseudoType - return v, nil - case valueCanBeObject(val): - v, err := valueFromObject(nil, nil, val) - if err != nil { - return Value{}, err - } - v.typ = DynamicPseudoType - return v, nil - case valueCanBeTuple(val): - v, err := valueFromTuple(nil, val) - if err != nil { - return Value{}, err - } - v.typ = DynamicPseudoType - return v, nil - default: - return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.DynamicPseudoType; expected types are: %s", val, formattedSupportedGoTypes(DynamicPseudoType)) - } -} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go index 8f456cbee9..3bd3e8a67e 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go @@ -17,20 +17,8 @@ type Set struct { // Equal returns true if the two Sets are exactly equal. Unlike Is, passing in // a Set with no ElementType will always return false. -func (s Set) Equal(o Set) bool { - return s.equals(o, true) -} - -// Is returns whether `t` is a Set type or not. If `t` is an instance of the -// Set type and its ElementType property is nil, it will return true. If `t`'s -// ElementType property is not nil, it will only return true if its ElementType -// is considered the same type as `s`'s ElementType. -func (s Set) Is(t Type) bool { - return s.equals(t, false) -} - -func (s Set) equals(t Type, exact bool) bool { - v, ok := t.(Set) +func (s Set) Equal(o Type) bool { + v, ok := o.(Set) if !ok { return false } @@ -38,19 +26,33 @@ func (s Set) equals(t Type, exact bool) bool { // when doing exact comparisons, we can't compare types that // don't have element types set, so we just consider them not // equal - // - // when doing inexact comparisons, the absence of an element - // type just means "is this a Set?" We know it is, so return - // true if and only if s has an ElementType and t doesn't. This - // behavior only makes sense if the user is trying to see if a - // proper type is a set, so we want to ensure that the method - // receiver always has an element type. - if exact { - return false - } - return s.ElementType != nil + return false } - return s.ElementType.equals(v.ElementType, exact) + return s.ElementType.Equal(v.ElementType) +} + +// UsableAs returns whether the two Sets are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Set, it will return false. +// If the other Set does not have a type compatible ElementType, it will +// return false. +func (s Set) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(Set) + if !ok { + return false + } + return s.ElementType.UsableAs(v.ElementType) +} + +// Is returns whether `t` is a Set type or not. It does not perform any +// ElementType checks. +func (s Set) Is(t Type) bool { + _, ok := t.(Set) + return ok } func (s Set) String() string { @@ -68,13 +70,15 @@ func valueFromSet(typ Type, in interface{}) (Value, error) { case []Value: var elType Type for _, v := range value { - if err := useTypeAs(v.Type(), typ, NewAttributePath().WithElementKeyValue(v)); err != nil { - return Value{}, err + if v.Type().Is(DynamicPseudoType) && v.IsKnown() { + return Value{}, NewAttributePath().WithElementKeyValue(v).NewErrorf("invalid value %s for %s", v, v.Type()) + } else if !v.Type().Is(DynamicPseudoType) && !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyValue(v).NewErrorf("can't use %s as %s", v.Type(), typ) } if elType == nil { elType = v.Type() } - if !elType.equals(v.Type(), true) { + if !elType.Equal(v.Type()) { return Value{}, fmt.Errorf("sets must only contain one type of element, saw %s and %s", elType, v.Type()) } } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go index 8defef0cf7..088243bbd5 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go @@ -21,22 +21,8 @@ type Tuple struct { // Equal returns true if the two Tuples are exactly equal. Unlike Is, passing // in a Tuple with no ElementTypes will always return false. -func (tu Tuple) Equal(o Tuple) bool { - return tu.equals(o, true) -} - -// Is returns whether `t` is a Tuple type or not. If `t` is an instance of the -// Tuple type and its ElementTypes property is not nil, it will only return -// true if the ElementTypes are considered the same. To be considered the same, -// there must be the same number of ElementTypes, arranged in the same order, -// and the types in each position must be considered the same as the type in -// the same position in the other Tuple. -func (tu Tuple) Is(t Type) bool { - return tu.equals(t, false) -} - -func (tu Tuple) equals(t Type, exact bool) bool { - v, ok := t.(Tuple) +func (tu Tuple) Equal(o Type) bool { + v, ok := o.(Tuple) if !ok { return false } @@ -44,23 +30,53 @@ func (tu Tuple) equals(t Type, exact bool) bool { // when doing exact comparisons, we can't compare types that // don't have element types set, so we just consider them not // equal - // - // when doing inexact comparisons, the absence of an element - // type just means "is this a Tuple?" We know it is, so return - // true - return !exact + return false + } + if len(v.ElementTypes) != len(tu.ElementTypes) { + return false + } + for pos, typ := range tu.ElementTypes { + if !typ.Equal(v.ElementTypes[pos]) { + return false + } + } + return true +} + +// UsableAs returns whether the two Tuples are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Tuple, it will return false. +// If the other Tuple does not have matching ElementTypes length, it will +// return false. +// If the other Tuple does not have type compatible ElementTypes in each +// position, it will return false. +func (tu Tuple) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(Tuple) + if !ok { + return false } if len(v.ElementTypes) != len(tu.ElementTypes) { return false } for pos, typ := range tu.ElementTypes { - if !typ.equals(v.ElementTypes[pos], exact) { + if !typ.UsableAs(v.ElementTypes[pos]) { return false } } return true } +// Is returns whether `t` is a Tuple type or not. It does not perform any +// ElementTypes checks. +func (tu Tuple) Is(t Type) bool { + _, ok := t.(Tuple) + return ok +} + func (tu Tuple) String() string { var res strings.Builder res.WriteString("tftypes.Tuple[") @@ -80,15 +96,6 @@ func (tu Tuple) supportedGoTypes() []string { return []string{"[]tftypes.Value"} } -func valueCanBeTuple(val interface{}) bool { - switch val.(type) { - case []Value: - return true - default: - return false - } -} - func valueFromTuple(types []Type, in interface{}) (Value, error) { switch value := in.(type) { case []Value: @@ -102,9 +109,10 @@ func valueFromTuple(types []Type, in interface{}) (Value, error) { } for pos, v := range value { typ := types[pos] - err := useTypeAs(v.Type(), typ, NewAttributePath().WithElementKeyInt(int64(pos))) - if err != nil { - return Value{}, err + if v.Type().Is(DynamicPseudoType) && v.IsKnown() { + return Value{}, NewAttributePath().WithElementKeyInt(pos).NewErrorf("invalid value %s for %s", v, v.Type()) + } else if !v.Type().Is(DynamicPseudoType) && !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyInt(pos).NewErrorf("can't use %s as %s", v.Type(), typ) } } } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go index 4c2bc67d55..955e322fcf 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go @@ -15,8 +15,19 @@ type Type interface { // Is is used to determine what type a Type implementation is. It is // the recommended method for determining whether two types are // equivalent or not. + + // Is performs shallow type equality checks, in that the root type is + // compared, but underlying attribute/element types are not. Is(Type) bool + // Equal performs deep type equality checks, including attribute/element + // types and whether attributes are optional or not. + Equal(Type) bool + + // UsableAs performs type conformance checks. This primarily checks if the + // target implements DynamicPsuedoType in a compatible manner. + UsableAs(Type) bool + // String returns a string representation of the Type's name. String() string @@ -35,9 +46,6 @@ type Type interface { // supportedGoTypes returns a list of string representations of the Go // types that the Type supports for its values. supportedGoTypes() []string - - // equals allows for exact or inexact type comparisons. - equals(Type, bool) bool } // TypeFromElements returns the common type that the passed elements all have @@ -50,7 +58,7 @@ func TypeFromElements(elements []Value) (Type, error) { typ = el.Type() continue } - if !typ.Is(el.Type()) { + if !typ.Equal(el.Type()) { return nil, errors.New("elements do not all have the same types") } } @@ -60,75 +68,6 @@ func TypeFromElements(elements []Value) (Type, error) { return typ, nil } -func useTypeAs(candidate, usedAs Type, path *AttributePath) error { - switch { - case usedAs.Is(DynamicPseudoType): - return nil - case usedAs.Is(String), usedAs.Is(Bool), usedAs.Is(Number): - if candidate.Is(usedAs) { - return nil - } - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - case usedAs.Is(List{}): - if !candidate.Is(List{}) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - return useTypeAs(candidate.(List).ElementType, usedAs.(List).ElementType, path.WithElementKeyInt(0)) - case usedAs.Is(Set{}): - if !candidate.Is(Set{}) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - return useTypeAs(candidate.(Set).ElementType, usedAs.(Set).ElementType, path.WithElementKeyValue(NewValue(DynamicPseudoType, UnknownValue))) - case usedAs.Is(Map{}): - if !candidate.Is(Map{}) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - return useTypeAs(candidate.(Map).AttributeType, usedAs.(Map).AttributeType, path.WithElementKeyString("")) - case usedAs.Is(Tuple{}): - if !candidate.Is(Tuple{}) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - cElems := candidate.(Tuple).ElementTypes - uElems := usedAs.(Tuple).ElementTypes - if len(cElems) != len(uElems) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - for pos, cElem := range cElems { - uElem := uElems[pos] - err := useTypeAs(cElem, uElem, path.WithElementKeyInt(int64(pos))) - if err != nil { - return err - } - } - case usedAs.Is(Object{}): - if !candidate.Is(Object{}) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - if len(candidate.(Object).OptionalAttributes) != len(usedAs.(Object).OptionalAttributes) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - for attr := range usedAs.(Object).OptionalAttributes { - if !candidate.(Object).attrIsOptional(attr) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - } - if len(candidate.(Object).AttributeTypes) != len(usedAs.(Object).AttributeTypes) { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - for attr, uAttr := range usedAs.(Object).AttributeTypes { - cAttr, ok := candidate.(Object).AttributeTypes[attr] - if !ok { - return path.NewErrorf("can't use %s as %s", candidate, usedAs) - } - err := useTypeAs(cAttr, uAttr, path.WithAttributeName(attr)) - if err != nil { - return err - } - } - } - return nil -} - type jsonType struct { t Type } @@ -204,7 +143,7 @@ func (t *jsonType) UnmarshalJSON(buf []byte) error { return err } t.t = Map{ - AttributeType: ety.t, + ElementType: ety.t, } case "set": var ety jsonType diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go index 48a24ee414..6166cb01bb 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go @@ -2,6 +2,7 @@ package tftypes import ( "bytes" + "errors" "fmt" "math/big" "sort" @@ -46,6 +47,10 @@ type Value struct { func (val Value) String() string { typ := val.Type() + if typ == nil { + return "invalid typeless tftypes.Value<>" + } + // null and unknown values we use static strings for if val.IsNull() { return typ.String() + "" @@ -200,10 +205,16 @@ func (val Value) ApplyTerraform5AttributePathStep(step AttributePathStep) (inter // considered equal if their types are considered equal and if they represent // data that is considered equal. func (val Value) Equal(o Value) bool { - if val.typ == nil && o.typ == nil && val.value == nil && o.value == nil { + if val.Type() == nil && o.Type() == nil && val.value == nil && o.value == nil { return true } - if !val.Type().Is(o.Type()) { + if val.Type() == nil { + return false + } + if o.Type() == nil { + return false + } + if !val.Type().Equal(o.Type()) { return false } diff, err := val.Diff(o) @@ -284,6 +295,11 @@ func newValue(t Type, val interface{}) (Value, error) { value: val, }, nil } + + if t.Is(DynamicPseudoType) { + return Value{}, errors.New("cannot have DynamicPseudoType with known value, DynamicPseudoType can only contain null or unknown values") + } + if creator, ok := val.(ValueCreator); ok { var err error val, err = creator.ToTerraform5Value() @@ -293,12 +309,6 @@ func newValue(t Type, val interface{}) (Value, error) { } switch { - case t.Is(DynamicPseudoType): - v, err := valueFromDynamicPseudoType(val) - if err != nil { - return Value{}, err - } - return v, nil case t.Is(String): v, err := valueFromString(val) if err != nil { @@ -318,7 +328,7 @@ func newValue(t Type, val interface{}) (Value, error) { } return v, nil case t.Is(Map{}): - v, err := valueFromMap(t.(Map).AttributeType, val) + v, err := valueFromMap(t.(Map).ElementType, val) if err != nil { return Value{}, err } @@ -415,6 +425,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + var s string + *target = &s + } return val.As(*target) case *big.Float: if val.IsNull() { @@ -432,6 +446,9 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + *target = big.NewFloat(0) + } return val.As(*target) case *bool: if val.IsNull() { @@ -449,6 +466,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + var b bool + *target = &b + } return val.As(*target) case *map[string]Value: if val.IsNull() { @@ -466,6 +487,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + m := map[string]Value{} + *target = &m + } return val.As(*target) case *[]Value: if val.IsNull() { @@ -483,6 +508,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + l := []Value{} + *target = &l + } return val.As(*target) } return fmt.Errorf("can't unmarshal into %T, needs FromTerraform5Value method", dst) diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go index 247556fdee..c96401adf1 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go @@ -53,7 +53,7 @@ func jsonUnmarshal(buf []byte, typ Type, p *AttributePath) (Value, error) { return jsonUnmarshalSet(buf, typ.(Set).ElementType, p) case typ.Is(Map{}): - return jsonUnmarshalMap(buf, typ.(Map).AttributeType, p) + return jsonUnmarshalMap(buf, typ.(Map).ElementType, p) case typ.Is(Tuple{}): return jsonUnmarshalTuple(buf, typ.(Tuple).ElementTypes, p) case typ.Is(Object{}): @@ -216,7 +216,7 @@ func jsonUnmarshalList(buf []byte, elementType Type, p *AttributePath) (Value, e // distinction, so we'll allow it. vals := []Value{} - var idx int64 + var idx int for dec.More() { innerPath := p.WithElementKeyInt(idx) // update the index @@ -355,8 +355,20 @@ func jsonUnmarshalMap(buf []byte, attrType Type, p *AttributePath) (Value, error return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) } + elTyp := attrType + if attrType.Is(DynamicPseudoType) { + var elements []Value + for _, val := range vals { + elements = append(elements, val) + } + elTyp, err = TypeFromElements(elements) + if err != nil { + return Value{}, p.NewErrorf("invalid elements for map: %w", err) + } + } + return NewValue(Map{ - AttributeType: attrType, + ElementType: elTyp, }, vals), nil } @@ -381,11 +393,12 @@ func jsonUnmarshalTuple(buf []byte, elementTypes []Type, p *AttributePath) (Valu // while generally in Go it's undesirable to treat empty and nil slices // separately, in this case we're surfacing a non-Go-in-origin // distinction, so we'll allow it. + types := []Type{} vals := []Value{} - var idx int64 + var idx int for dec.More() { - if idx >= int64(len(elementTypes)) { + if idx >= len(elementTypes) { return Value{}, p.NewErrorf("too many tuple elements (only have types for %d)", len(elementTypes)) } @@ -402,6 +415,7 @@ func jsonUnmarshalTuple(buf []byte, elementTypes []Type, p *AttributePath) (Valu if err != nil { return Value{}, err } + types = append(types, val.Type()) vals = append(vals, val) } @@ -418,7 +432,7 @@ func jsonUnmarshalTuple(buf []byte, elementTypes []Type, p *AttributePath) (Valu } return NewValue(Tuple{ - ElementTypes: elementTypes, + ElementTypes: types, }, vals), nil } @@ -433,6 +447,7 @@ func jsonUnmarshalObject(buf []byte, attrTypes map[string]Type, p *AttributePath return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) } + types := map[string]Type{} vals := map[string]Value{} for dec.More() { innerPath := p.WithElementKeyValue(NewValue(String, UnknownValue)) @@ -459,6 +474,7 @@ func jsonUnmarshalObject(buf []byte, attrTypes map[string]Type, p *AttributePath if err != nil { return Value{}, err } + types[key] = val.Type() vals[key] = val } @@ -478,6 +494,6 @@ func jsonUnmarshalObject(buf []byte, attrTypes map[string]Type, p *AttributePath } return NewValue(Object{ - AttributeTypes: attrTypes, + AttributeTypes: types, }, vals), nil } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go index d2fa8a362c..3f3db12ef8 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go @@ -122,7 +122,7 @@ func msgpackUnmarshal(dec *msgpack.Decoder, typ Type, path *AttributePath) (Valu case typ.Is(Set{}): return msgpackUnmarshalSet(dec, typ.(Set).ElementType, path) case typ.Is(Map{}): - return msgpackUnmarshalMap(dec, typ.(Map).AttributeType, path) + return msgpackUnmarshalMap(dec, typ.(Map).ElementType, path) case typ.Is(Tuple{}): return msgpackUnmarshalTuple(dec, typ.(Tuple).ElementTypes, path) case typ.Is(Object{}): @@ -150,7 +150,7 @@ func msgpackUnmarshalList(dec *msgpack.Decoder, typ Type, path *AttributePath) ( vals := make([]Value, 0, length) for i := 0; i < length; i++ { - innerPath := path.WithElementKeyInt(int64(i)) + innerPath := path.WithElementKeyInt(i) val, err := msgpackUnmarshal(dec, typ, innerPath) if err != nil { return Value{}, err @@ -190,7 +190,7 @@ func msgpackUnmarshalSet(dec *msgpack.Decoder, typ Type, path *AttributePath) (V vals := make([]Value, 0, length) for i := 0; i < length; i++ { - innerPath := path.WithElementKeyInt(int64(i)) + innerPath := path.WithElementKeyInt(i) val, err := msgpackUnmarshal(dec, typ, innerPath) if err != nil { return Value{}, err @@ -217,11 +217,11 @@ func msgpackUnmarshalMap(dec *msgpack.Decoder, typ Type, path *AttributePath) (V switch { case length < 0: return NewValue(Map{ - AttributeType: typ, + ElementType: typ, }, nil), nil case length == 0: return NewValue(Map{ - AttributeType: typ, + ElementType: typ, }, map[string]Value{}), nil } @@ -238,8 +238,25 @@ func msgpackUnmarshalMap(dec *msgpack.Decoder, typ Type, path *AttributePath) (V } vals[key] = val } + + elTyp := typ + + if typ.Is(DynamicPseudoType) { + var elements []Value + + for _, val := range vals { + elements = append(elements, val) + } + + elTyp, err = TypeFromElements(elements) + + if err != nil { + return Value{}, path.NewErrorf("invalid elements for map: %w", err) + } + } + return NewValue(Map{ - AttributeType: typ, + ElementType: elTyp, }, vals), nil } @@ -254,28 +271,25 @@ func msgpackUnmarshalTuple(dec *msgpack.Decoder, types []Type, path *AttributePa return NewValue(Tuple{ ElementTypes: types, }, nil), nil - case length == 0: - return NewValue(Tuple{ - // no elements means no types - ElementTypes: nil, - }, []Value{}), nil case length != len(types): return Value{}, path.NewErrorf("error decoding tuple; expected %d items, got %d", len(types), length) } + elTypes := make([]Type, 0, length) vals := make([]Value, 0, length) for i := 0; i < length; i++ { - innerPath := path.WithElementKeyInt(int64(i)) + innerPath := path.WithElementKeyInt(i) typ := types[i] val, err := msgpackUnmarshal(dec, typ, innerPath) if err != nil { return Value{}, err } + elTypes = append(elTypes, val.Type()) vals = append(vals, val) } return NewValue(Tuple{ - ElementTypes: types, + ElementTypes: elTypes, }, vals), nil } @@ -290,15 +304,11 @@ func msgpackUnmarshalObject(dec *msgpack.Decoder, types map[string]Type, path *A return NewValue(Object{ AttributeTypes: types, }, nil), nil - case length == 0: - return NewValue(Object{ - // no attributes means no types - AttributeTypes: map[string]Type{}, - }, map[string]Value{}), nil case length != len(types): return Value{}, path.NewErrorf("error decoding object; expected %d attributes, got %d", len(types), length) } + attrTypes := make(map[string]Type, length) vals := make(map[string]Value, length) for i := 0; i < length; i++ { key, err := dec.DecodeString() @@ -314,11 +324,12 @@ func msgpackUnmarshalObject(dec *msgpack.Decoder, types map[string]Type, path *A if err != nil { return Value{}, err } + attrTypes[key] = val.Type() vals[key] = val } return NewValue(Object{ - AttributeTypes: types, + AttributeTypes: attrTypes, }, vals), nil } @@ -330,7 +341,7 @@ func msgpackUnmarshalDynamic(dec *msgpack.Decoder, path *AttributePath) (Value, switch { case length == -1: - return NewValue(DynamicPseudoType, nil), nil + return newValue(DynamicPseudoType, nil) case length != 2: return Value{}, path.NewErrorf("expected %d elements in DynamicPseudoType array, got %d", 2, length) } @@ -478,7 +489,7 @@ func marshalMsgPackList(val Value, typ Type, p *AttributePath, enc *msgpack.Enco return p.NewErrorf("error encoding list length: %w", err) } for pos, i := range l { - err := marshalMsgPack(i, typ.(List).ElementType, p.WithElementKeyInt(int64(pos)), enc) + err := marshalMsgPack(i, typ.(List).ElementType, p.WithElementKeyInt(pos), enc) if err != nil { return err } @@ -518,7 +529,7 @@ func marshalMsgPackMap(val Value, typ Type, p *AttributePath, enc *msgpack.Encod if err != nil { return p.NewErrorf("error encoding map key: %w", err) } - err = marshalMsgPack(v, typ.(Map).AttributeType, p, enc) + err = marshalMsgPack(v, typ.(Map).ElementType, p, enc) if err != nil { return err } @@ -538,7 +549,7 @@ func marshalMsgPackTuple(val Value, typ Type, p *AttributePath, enc *msgpack.Enc } for pos, v := range t { ty := types[pos] - err := marshalMsgPack(v, ty, p.WithElementKeyInt(int64(pos)), enc) + err := marshalMsgPack(v, ty, p.WithElementKeyInt(pos), enc) if err != nil { return err } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go index d72b430ff5..6b26f8ff3e 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go @@ -67,7 +67,7 @@ func walk(path *AttributePath, val Value, cb func(*AttributePath, Value) (bool, if ty.Is(Set{}) { path = path.WithElementKeyValue(el) } else { - path = path.WithElementKeyInt(int64(pos)) + path = path.WithElementKeyInt(pos) } err = walk(path, el, cb) if err != nil { @@ -116,6 +116,10 @@ func transform(path *AttributePath, val Value, cb func(*AttributePath, Value) (V var newVal Value ty := val.Type() + if ty == nil { + return val, path.NewError(errors.New("invalid transform: value missing type")) + } + switch { case val.IsNull() || !val.IsKnown(): newVal = val @@ -133,7 +137,7 @@ func transform(path *AttributePath, val Value, cb func(*AttributePath, Value) (V if ty.Is(Set{}) { path = path.WithElementKeyValue(el) } else { - path = path.WithElementKeyInt(int64(pos)) + path = path.WithElementKeyInt(pos) } newEl, err := transform(path, el, cb) if err != nil { @@ -142,7 +146,10 @@ func transform(path *AttributePath, val Value, cb func(*AttributePath, Value) (V elems = append(elems, newEl) path = path.WithoutLastStep() } - newVal = NewValue(ty, elems) + newVal, err = newValue(ty, elems) + if err != nil { + return val, path.NewError(err) + } } case ty.Is(Map{}), ty.Is(Object{}): v := map[string]Value{} @@ -167,7 +174,10 @@ func transform(path *AttributePath, val Value, cb func(*AttributePath, Value) (V elems[k] = newEl path = path.WithoutLastStep() } - newVal = NewValue(ty, elems) + newVal, err = newValue(ty, elems) + if err != nil { + return val, path.NewError(err) + } } default: newVal = val @@ -176,7 +186,11 @@ func transform(path *AttributePath, val Value, cb func(*AttributePath, Value) (V if err != nil { return res, path.NewError(err) } - if !newVal.Type().Is(ty) { + newTy := newVal.Type() + if newTy == nil { + return val, path.NewError(errors.New("invalid transform: new value missing type")) + } + if !newTy.UsableAs(ty) { return val, path.NewError(errors.New("invalid transform: value changed type")) } return res, err diff --git a/ibm/vendor/github.com/hashicorp/go-getter/LICENSE b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/LICENSE similarity index 100% rename from ibm/vendor/github.com/hashicorp/go-getter/LICENSE rename to ibm/vendor/github.com/hashicorp/terraform-plugin-log/LICENSE diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go new file mode 100644 index 0000000000..8c0ef20f4a --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go @@ -0,0 +1,47 @@ +package logging + +import ( + "io" + "os" +) + +// loggerKey defines context keys for locating loggers in context.Context +// it's a private type to make sure no other packages can override the key +type loggerKey string + +const ( + // ProviderRootLoggerKey is the loggerKey that will hold the root + // logger for writing logs from within provider code. + ProviderRootLoggerKey loggerKey = "provider" + + // SDKRootLoggerKey is the loggerKey that will hold the root logger for + // writing logs from with SDKs. + SDKRootLoggerKey loggerKey = "sdk" + + // SinkKey is the loggerKey that will hold the logging sink used for + // test frameworks. + SinkKey loggerKey = "" +) + +var ( + // Stderr caches the original os.Stderr when the process is started. + // + // When go-plugin.Serve is called, it overwrites our os.Stderr with a + // gRPC stream which Terraform ignores. This tends to be before our + // loggers get set up, as go-plugin has no way to pass in a base + // context, and our loggers are passed around via contexts. This leaves + // our loggers writing to an output that is never read by anything, + // meaning the logs get blackholed. This isn't ideal, for log output, + // so this is our workaround: we copy stderr on init, before Serve can + // be called, and offer an option to write to that instead of the + // os.Stderr available at runtime. + // + // Ideally, this is a short-term fix until Terraform starts reading + // from go-plugin's gRPC-streamed stderr channel, but for the moment it + // works. + Stderr io.Writer +) + +func init() { + Stderr = os.Stderr +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go new file mode 100644 index 0000000000..fe1e0762df --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go @@ -0,0 +1,74 @@ +package logging + +import ( + "io" + "os" + + "github.com/hashicorp/go-hclog" +) + +// Option defines a modification to the configuration for a logger. +type Option func(LoggerOpts) LoggerOpts + +// LoggerOpts is a collection of configuration settings for loggers. +type LoggerOpts struct { + // Name is the name or "@module" of a logger. + Name string + + // Level is the most verbose level that a logger will write logs for. + Level hclog.Level + + // IncludeLocation indicates whether logs should include the location + // of the logging statement or not. + IncludeLocation bool + + // Output dictates where logs are written to. Output should only ever + // be set by tflog or tfsdklog, never by SDK authors or provider + // developers. Where logs get written to is complex and delicate and + // requires a deep understanding of Terraform's architecture, and it's + // easy to mess up on accident. + Output io.Writer + + // IncludeTime indicates whether logs should incude the time they were + // written or not. It should only be set to true when testing tflog or + // tfsdklog; providers and SDKs should always include the time logs + // were written as part of the log. + IncludeTime bool +} + +// ApplyLoggerOpts generates a LoggerOpts out of a list of Option +// implementations. By default, IncludeLocation is true, IncludeTime is true, +// and Output is os.Stderr. +func ApplyLoggerOpts(opts ...Option) LoggerOpts { + // set some defaults + l := LoggerOpts{ + IncludeLocation: true, + IncludeTime: true, + Output: os.Stderr, + } + for _, opt := range opts { + l = opt(l) + } + return l +} + +// WithOutput sets the Output configuration option, controlling where logs get +// written to. This is mostly used for testing (to write to os.Stdout, so the +// test framework can compare it against the example output) and as a helper +// when implementing safe, specific output strategies in tfsdklog. +func WithOutput(output io.Writer) Option { + return func(l LoggerOpts) LoggerOpts { + l.Output = output + return l + } +} + +// WithoutTimestamp disables the timestamp included with logging statements. It +// should only ever be used to make log output deterministic when testing +// terraform-plugin-log. +func WithoutTimestamp() Option { + return func(l LoggerOpts) LoggerOpts { + l.IncludeTime = false + return l + } +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go new file mode 100644 index 0000000000..897393c5d5 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go @@ -0,0 +1,45 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/go-hclog" +) + +// GetProviderRootLogger returns the root logger used for writing logs +// from a provider. If no root logger has been created, it will return nil. +func GetProviderRootLogger(ctx context.Context) hclog.Logger { + logger := ctx.Value(ProviderRootLoggerKey) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// SetProviderRootLogger sets `logger` as the root logger used for writing +// logs from a provider. +func SetProviderRootLogger(ctx context.Context, logger hclog.Logger) context.Context { + return context.WithValue(ctx, ProviderRootLoggerKey, logger) +} + +// NewProviderSubsystemLoggerWarning is the text included in log output when a +// subsystem is auto-generated by terraform-plugin-log because it was used +// before the provider instantiated it. +const NewProviderSubsystemLoggerWarning = "This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." + +// GetProviderSubsystemLogger returns the subsystem logger for the named +// subsystem in provider space. If no such subsystem logger has been created, +// it will return nil. +func GetProviderSubsystemLogger(ctx context.Context, subsystem string) hclog.Logger { + logger := ctx.Value(ProviderRootLoggerKey + loggerKey("."+subsystem)) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// SetProviderSubsystemLogger sets `logger` as the logger for the named +// subsystem in provider space. +func SetProviderSubsystemLogger(ctx context.Context, subsystem string, logger hclog.Logger) context.Context { + return context.WithValue(ctx, ProviderRootLoggerKey+loggerKey("."+subsystem), logger) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go new file mode 100644 index 0000000000..99c577a9d6 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go @@ -0,0 +1,45 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/go-hclog" +) + +// GetSDKRootLogger returns the root logger used for writing logs from an SDK. +// If no root logger has been created, it will return nil. +func GetSDKRootLogger(ctx context.Context) hclog.Logger { + logger := ctx.Value(SDKRootLoggerKey) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// SetSDKRootLogger sets `logger` as the root logger used for writing logs from +// an SDK. +func SetSDKRootLogger(ctx context.Context, logger hclog.Logger) context.Context { + return context.WithValue(ctx, SDKRootLoggerKey, logger) +} + +// NewSDKSubsystemLoggerWarning is the text included in log output when a +// subsystem is auto-generated by terraform-plugin-log because it was used +// before the SDK instantiated it. +const NewSDKSubsystemLoggerWarning = "This log was generated by an SDK subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." + +// GetSDKSubsystemLogger returns the subsystem logger for the named subsystem +// in SDK space. If no such subsystem logger has been created, it will return +// nil. +func GetSDKSubsystemLogger(ctx context.Context, subsystem string) hclog.Logger { + logger := ctx.Value(SDKRootLoggerKey + loggerKey("."+subsystem)) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// SetSDKSubsystemLogger sets `logger` as the logger for the named subsystem in +// SDK space. +func SetSDKSubsystemLogger(ctx context.Context, subsystem string, logger hclog.Logger) context.Context { + return context.WithValue(ctx, SDKRootLoggerKey+loggerKey("."+subsystem), logger) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go new file mode 100644 index 0000000000..97ca218845 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go @@ -0,0 +1,13 @@ +// Package tflog provides helper functions for writing log output and creating +// loggers for Terraform plugins. +// +// For most plugin authors, building on an SDK or framework, the SDK or +// framework will take care of injecting a logger using New. +// +// tflog also allows plugin authors to create subsystem loggers, which are +// loggers for sufficiently distinct areas of the codebase or concerns. The +// benefit of using distinct loggers for these concerns is doing so allows +// plugin authors and practitioners to configure different log levels for each +// subsystem's log, allowing log output to be turned on or off without +// recompiling. +package tflog diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go new file mode 100644 index 0000000000..1b61eb55fc --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go @@ -0,0 +1,46 @@ +package tflog + +import ( + "os" + "strings" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// Options are a collection of logging options, useful for collecting arguments +// to NewSubsystem prior to calling it. +type Options []logging.Option + +// WithLevelFromEnv returns an option that will set the level of the logger +// based on the string in an environment variable. The environment variable +// checked will be `name` and `subsystems`, joined by _ and in all caps. +func WithLevelFromEnv(name string, subsystems ...string) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + envVar := strings.Join(subsystems, "_") + if envVar != "" { + envVar = "_" + envVar + } + envVar = strings.ToUpper(name + envVar) + l.Level = hclog.LevelFromString(os.Getenv(envVar)) + return l + } +} + +// WithLevel returns an option that will set the level of the logger. +func WithLevel(level hclog.Level) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.Level = level + return l + } +} + +// WithoutLocation returns an option that disables including the location of +// the log line in the log output, which is on by default. This has no effect +// when used with NewSubsystem. +func WithoutLocation() logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.IncludeLocation = false + return l + } +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go new file mode 100644 index 0000000000..b05856df0d --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go @@ -0,0 +1,102 @@ +package tflog + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// With returns a new context.Context that has a modified logger in it which +// will include key and value as arguments in all its log output. +func With(ctx context.Context, key string, value interface{}) context.Context { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return ctx + } + return logging.SetProviderRootLogger(ctx, logger.With(key, value)) +} + +// Trace logs `msg` at the trace level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Trace(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Trace(msg, args...) +} + +// Debug logs `msg` at the debug level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Debug(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Debug(msg, args...) +} + +// Info logs `msg` at the info level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Info(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Info(msg, args...) +} + +// Warn logs `msg` at the warn level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Warn(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Warn(msg, args...) +} + +// Error logs `msg` at the error level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Error(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Error(msg, args...) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go new file mode 100644 index 0000000000..fbc564e477 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go @@ -0,0 +1,109 @@ +package tflog + +import ( + "context" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// NewSubsystem returns a new context.Context that contains a subsystem logger +// configured with the passed options, named after the subsystem argument. +// +// Subsystem loggers allow different areas of a plugin codebase to use +// different logging levels, giving developers more fine-grained control over +// what is logging and with what verbosity. They're best utilized for logical +// concerns that are sometimes helpful to log, but may generate unwanted noise +// at other times. +// +// The only Options supported for subsystems are the Options for setting the +// level of the logger. +func NewSubsystem(ctx context.Context, subsystem string, options ...logging.Option) context.Context { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return ctx + } + subLogger := logger.Named(subsystem) + opts := logging.ApplyLoggerOpts(options...) + if opts.Level != hclog.NoLevel { + subLogger.SetLevel(opts.Level) + } + return logging.SetProviderSubsystemLogger(ctx, subsystem, subLogger) +} + +// SubsystemWith returns a new context.Context that has a modified logger for +// the specified subsystem in it which will include key and value as arguments +// in all its log output. +func SubsystemWith(ctx context.Context, subsystem, key string, value interface{}) context.Context { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + return logging.SetProviderSubsystemLogger(ctx, subsystem, logger.With(key, value)) +} + +// SubsystemTrace logs `msg` at the trace level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemTrace(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Trace(msg, args...) +} + +// SubsystemDebug logs `msg` at the debug level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemDebug(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Debug(msg, args...) +} + +// SubsystemInfo logs `msg` at the info level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemInfo(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Info(msg, args...) +} + +// SubsystemWarn logs `msg` at the warn level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemWarn(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Warn(msg, args...) +} + +// SubsystemError logs `msg` at the error level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemError(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Error(msg, args...) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go new file mode 100644 index 0000000000..2ed6f6fc83 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go @@ -0,0 +1,10 @@ +// Package tfsdklog provides helper functions for logging from SDKs and +// frameworks for building Terraform plugins. +// +// Plugin authors shouldn't need to use this package; it is meant for authors +// of the frameworks and SDKs for plugins. Plugin authors should use the tflog +// package. +// +// This package provides very similar functionality to tflog, except it uses a +// separate namespace for its logs. +package tfsdklog diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go new file mode 100644 index 0000000000..2115babd71 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go @@ -0,0 +1,64 @@ +package tfsdklog + +import ( + "os" + "strings" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// Options is a collection of logging options, useful for collecting arguments +// to NewSubsystem, NewRootSDKLogger, and NewRootProviderLogger before calling +// them. +type Options []logging.Option + +// WithLogName returns an option that will set the logger name explicitly to +// `name`. This has no effect when used with NewSubsystem. +func WithLogName(name string) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.Name = name + return l + } +} + +// WithLevelFromEnv returns an option that will set the level of the logger +// based on the string in an environment variable. The environment variable +// checked will be `name` and `subsystems`, joined by _ and in all caps. +func WithLevelFromEnv(name string, subsystems ...string) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + envVar := strings.Join(subsystems, "_") + if envVar != "" { + envVar = "_" + envVar + } + envVar = strings.ToUpper(name + envVar) + l.Level = hclog.LevelFromString(os.Getenv(envVar)) + return l + } +} + +// WithLevel returns an option that will set the level of the logger. +func WithLevel(level hclog.Level) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.Level = level + return l + } +} + +// WithoutLocation returns an option that disables including the location of +// the log line in the log output, which is on by default. This has no effect +// when used with NewSubsystem. +func WithoutLocation() logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.IncludeLocation = false + return l + } +} + +// WithStderrFromInit returns an option that tells the logger to write to the +// os.Stderr that was present when the program started, not the one that is +// available at runtime. Some versions of Terraform overwrite os.Stderr with an +// io.Writer that is never read, so any log lines written to it will be lost. +func WithStderrFromInit() logging.Option { + return logging.WithOutput(logging.Stderr) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go new file mode 100644 index 0000000000..ec22d9fc6d --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go @@ -0,0 +1,157 @@ +package tfsdklog + +import ( + "context" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// NewRootSDKLogger returns a new context.Context that contains an SDK logger +// configured with the passed options. +func NewRootSDKLogger(ctx context.Context, options ...logging.Option) context.Context { + opts := logging.ApplyLoggerOpts(options...) + if opts.Name == "" { + opts.Name = "sdk" + } + if sink := getSink(ctx); sink != nil { + logger := sink.Named(opts.Name) + if opts.Level != hclog.NoLevel { + logger.SetLevel(opts.Level) + } + return logging.SetSDKRootLogger(ctx, logger) + } + if opts.Level == hclog.NoLevel { + opts.Level = hclog.Trace + } + loggerOptions := &hclog.LoggerOptions{ + Name: opts.Name, + Level: opts.Level, + JSONFormat: true, + IndependentLevels: true, + IncludeLocation: opts.IncludeLocation, + DisableTime: !opts.IncludeTime, + Output: opts.Output, + AdditionalLocationOffset: 1, + } + return logging.SetSDKRootLogger(ctx, hclog.New(loggerOptions)) +} + +// NewRootProviderLogger returns a new context.Context that contains a provider +// logger configured with the passed options. +func NewRootProviderLogger(ctx context.Context, options ...logging.Option) context.Context { + opts := logging.ApplyLoggerOpts(options...) + if opts.Name == "" { + opts.Name = "provider" + } + if sink := getSink(ctx); sink != nil { + logger := sink.Named(opts.Name) + if opts.Level != hclog.NoLevel { + logger.SetLevel(opts.Level) + } + return logging.SetProviderRootLogger(ctx, logger) + } + if opts.Level == hclog.NoLevel { + opts.Level = hclog.Trace + } + loggerOptions := &hclog.LoggerOptions{ + Name: opts.Name, + Level: opts.Level, + JSONFormat: true, + IndependentLevels: true, + IncludeLocation: opts.IncludeLocation, + DisableTime: !opts.IncludeTime, + Output: opts.Output, + AdditionalLocationOffset: 1, + } + return logging.SetProviderRootLogger(ctx, hclog.New(loggerOptions)) +} + +// With returns a new context.Context that has a modified logger in it which +// will include key and value as arguments in all its log output. +func With(ctx context.Context, key string, value interface{}) context.Context { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return ctx + } + return logging.SetSDKRootLogger(ctx, logger.With(key, value)) +} + +// Trace logs `msg` at the trace level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Trace(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Trace(msg, args...) +} + +// Debug logs `msg` at the debug level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Debug(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Debug(msg, args...) +} + +// Info logs `msg` at the info level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Info(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Info(msg, args...) +} + +// Warn logs `msg` at the warn level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Warn(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Warn(msg, args...) +} + +// Error logs `msg` at the error level to the logger in `ctx`, with `args` as +// structured arguments in the log output. `args` is expected to be pairs of +// key and value. +func Error(ctx context.Context, msg string, args ...interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Error(msg, args...) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go new file mode 100644 index 0000000000..0b26a08907 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go @@ -0,0 +1,143 @@ +package tfsdklog + +import ( + "context" + "fmt" + "io" + "os" + "strings" + "syscall" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" + testing "github.com/mitchellh/go-testing-interface" +) + +const ( + // envLog is the environment variable that users can set to control the + // least-verbose level of logs that will be output during testing. If + // this environment variable is set, it will default to off. This is + // just the default; specific loggers and sub-loggers can set a lower + // or higher verbosity level without a problem right now. In theory, + // they should not be able to. + // + // Valid values are TRACE, DEBUG, INFO, WARN, ERROR, and OFF. A special + // pseudo-value, JSON, will set the value to TRACE and output the + // results in their JSON format. + envLog = "TF_LOG" + + // envLogFile is the environment variable that controls where log + // output is written during tests. By default, logs will be written to + // standard error. Setting this environment variable to another file + // path will write logs there instead during tests. + envLogFile = "TF_LOG_PATH" + + // envAccLogFile is the environment variable that controls where log + // output from the provider under test and the Terraform binary (and + // other providers) will be written during tests. Setting this + // environment variable to a file will combine all log output in that + // file. If both this environment variable and TF_LOG_PATH are set, + // this environment variable will take precedence. + envAccLogFile = "TF_ACC_LOG_PATH" + + // envLogPathMask is the environment variable that controls per-test + // logging output. It should be set to a fmt-compatible string, where a + // single %s will be replaced with the test name, and the log output + // for that test (and only that test) will be written to that file. + // Setting this environment variable will override TF_LOG_PATH. + // Only the logs for the provider under test are included. + envLogPathMask = "TF_LOG_PATH_MASK" +) + +// ValidLevels are the string representations of levels that can be set for +// loggers. +var ValidLevels = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF"} + +func getSink(ctx context.Context) hclog.Logger { + logger := ctx.Value(logging.SinkKey) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// RegisterTestSink sets up a logging sink, for use with test frameworks and +// other cases where plugin logs don't get routed through Terraform. This +// applies the same filtering and file output behaviors that Terraform does. +// +// RegisterTestSink should only ever be called by test frameworks, providers +// should never call it. +// +// RegisterTestSink must be called prior to any loggers being setup or +// instantiated. +func RegisterTestSink(ctx context.Context, t testing.T) context.Context { + return context.WithValue(ctx, logging.SinkKey, newSink(t)) +} + +func newSink(t testing.T) hclog.Logger { + logOutput := io.Writer(os.Stderr) + var json bool + var logLevel hclog.Level + var logFile string + + envLevel := strings.ToUpper(os.Getenv(envLog)) + + // if TF_LOG_PATH is set, output logs there + if logPath := os.Getenv(envLogFile); logPath != "" { + logFile = logPath + } + + // if TF_ACC_LOG_PATH is set, output logs there instead + if logPath := os.Getenv(envAccLogFile); logPath != "" { + logFile = logPath + // helper/resource makes this default to TRACE, so we should, + // too + envLevel = "TRACE" + } + + // if TF_LOG_PATH_MASK is set, use a test-name specific logging file, + // instead + if logPathMask := os.Getenv(envLogPathMask); logPathMask != "" { + testName := strings.Replace(t.Name(), "/", "__", -1) + logFile = fmt.Sprintf(logPathMask, testName) + } + + if logFile != "" { + f, err := os.OpenFile(logFile, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666) + if err != nil { + fmt.Fprintf(os.Stderr, "Error opening log file: %v\n", err) + } else { + logOutput = f + } + } + + // if TF_LOG is set, set the level + if envLevel == "" { + logLevel = hclog.Off + } else if envLevel == "JSON" { + logLevel = hclog.Trace + json = true + } else if isValidLogLevel(envLevel) { + logLevel = hclog.LevelFromString(envLevel) + } else { + fmt.Fprintf(os.Stderr, "[WARN] Invalid log level: %q. Defaulting to level: OFF. Valid levels are: %+v", + envLevel, ValidLevels) + } + + return hclog.New(&hclog.LoggerOptions{ + Level: logLevel, + Output: logOutput, + IndependentLevels: true, + JSONFormat: json, + }) +} + +func isValidLogLevel(level string) bool { + for _, l := range ValidLevels { + if level == string(l) { + return true + } + } + + return false +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go new file mode 100644 index 0000000000..96b76791f2 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go @@ -0,0 +1,109 @@ +package tfsdklog + +import ( + "context" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// NewSubsystem returns a new context.Context that contains a subsystem logger +// configured with the passed options, named after the subsystem argument. +// +// Subsystem loggers allow different areas of a plugin codebase to use +// different logging levels, giving developers more fine-grained control over +// what is logging and with what verbosity. They're best utilized for logical +// concerns that are sometimes helpful to log, but may generate unwanted noise +// at other times. +// +// The only Options supported for subsystems are the Options for setting the +// level of the logger. +func NewSubsystem(ctx context.Context, subsystem string, options ...logging.Option) context.Context { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return ctx + } + subLogger := logger.Named(subsystem) + opts := logging.ApplyLoggerOpts(options...) + if opts.Level != hclog.NoLevel { + subLogger.SetLevel(opts.Level) + } + return logging.SetSDKSubsystemLogger(ctx, subsystem, subLogger) +} + +// SubsystemWith returns a new context.Context that has a modified logger for +// the specified subsystem in it which will include key and value as arguments +// in all its log output. +func SubsystemWith(ctx context.Context, subsystem, key string, value interface{}) context.Context { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + return logging.SetSDKSubsystemLogger(ctx, subsystem, logger.With(key, value)) +} + +// SubsystemTrace logs `msg` at the trace level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemTrace(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Trace(msg, args...) +} + +// SubsystemDebug logs `msg` at the debug level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemDebug(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Debug(msg, args...) +} + +// SubsystemInfo logs `msg` at the info level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemInfo(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Info(msg, args...) +} + +// SubsystemWarn logs `msg` at the warn level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemWarn(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Warn(msg, args...) +} + +// SubsystemError logs `msg` at the error level to the subsystem logger +// specified in `ctx`, with `args` as structured arguments in the log output. +// `args` is expected to be pairs of key and value. +func SubsystemError(ctx context.Context, subsystem, msg string, args ...interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Error(msg, args...) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go index 546c5e1cfc..01ae25dfb3 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go @@ -1,6 +1,7 @@ package logging import ( + "context" "fmt" "io" "io/ioutil" @@ -10,27 +11,42 @@ import ( "syscall" "github.com/hashicorp/logutils" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" testing "github.com/mitchellh/go-testing-interface" ) // These are the environmental variables that determine if we log, and if // we log whether or not the log should go to a file. const ( - EnvLog = "TF_LOG" // Set to True - EnvLogFile = "TF_LOG_PATH" // Set to a file + EnvLog = "TF_LOG" // See ValidLevels + EnvLogFile = "TF_LOG_PATH" // Set to a file + EnvAccLogFile = "TF_ACC_LOG_PATH" // Set to a file // EnvLogPathMask splits test log files by name. EnvLogPathMask = "TF_LOG_PATH_MASK" ) var ValidLevels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"} -// LogOutput determines where we should send logs (if anywhere) and the log level. +// LogOutput determines where we should send logs (if anywhere) and the log +// level. This only effects this log.Print* functions called in the provider +// under test. Dependency providers for the provider under test will have their +// logging controlled by Terraform itself and managed with the TF_ACC_LOG_PATH +// environment variable. Calls to tflog.* will have their output managed by the +// tfsdklog sink. func LogOutput(t testing.T) (logOutput io.Writer, err error) { logOutput = ioutil.Discard logLevel := LogLevel() if logLevel == "" { - return + if os.Getenv(EnvAccLogFile) != "" { + // plugintest defaults to TRACE when TF_ACC_LOG_PATH is + // set for Terraform and dependency providers of the + // provider under test. We should do the same for the + // provider under test. + logLevel = "TRACE" + } else { + return + } } logOutput = os.Stderr @@ -42,6 +58,14 @@ func LogOutput(t testing.T) (logOutput io.Writer, err error) { } } + if logPath := os.Getenv(EnvAccLogFile); logPath != "" { + var err error + logOutput, err = os.OpenFile(logPath, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666) + if err != nil { + return nil, err + } + } + if logPathMask := os.Getenv(EnvLogPathMask); logPathMask != "" { // Escape special characters which may appear if we have subtests testName := strings.Replace(t.Name(), "/", "__", -1) @@ -114,3 +138,12 @@ func isValidLogLevel(level string) bool { return false } + +// GetTestLogContext creates a context that is registered to the SDK log sink. +// This function is for internal usage only and is not supported by the project's +// compatibility promises. +func GetTestLogContext(t testing.T) context.Context { + ctx := context.Background() + ctx = tfsdklog.RegisterTestSink(ctx, t) + return ctx +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go index 2eb08b4e4c..2d649def0c 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/plugin.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-exec/tfexec" "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest" "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" @@ -34,7 +35,7 @@ func runProviderCommand(t testing.T, f func() error, wd *plugintest.WorkingDir, // reattach behavior in Terraform. This ensures we get test coverage // and enables the use of delve as a debugger. - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(logging.GetTestLogContext(t)) defer cancel() // this is needed so Terraform doesn't default to expecting protocol 4; @@ -93,6 +94,8 @@ func runProviderCommand(t testing.T, f func() error, wd *plugintest.WorkingDir, Output: ioutil.Discard, }), NoLogOutputOverride: true, + UseTFLogSink: t, + ProviderAddr: getProviderAddr(providerName), } // let's actually start the provider server @@ -170,6 +173,8 @@ func runProviderCommand(t testing.T, f func() error, wd *plugintest.WorkingDir, Output: ioutil.Discard, }), NoLogOutputOverride: true, + UseTFLogSink: t, + ProviderAddr: getProviderAddr(providerName), } // let's actually start the provider server @@ -244,6 +249,8 @@ func runProviderCommand(t testing.T, f func() error, wd *plugintest.WorkingDir, Output: ioutil.Discard, }), NoLogOutputOverride: true, + UseTFLogSink: t, + ProviderAddr: getProviderAddr(providerName), } // let's actually start the provider server @@ -316,3 +323,17 @@ func runProviderCommand(t testing.T, f func() error, wd *plugintest.WorkingDir, // Terraform commands return err } + +func getProviderAddr(name string) string { + host := "registry.terraform.io" + namespace := "hashicorp" + if v := os.Getenv("TF_ACC_PROVIDER_NAMESPACE"); v != "" { + namespace = v + } + if v := os.Getenv("TF_ACC_PROVIDER_HOST"); v != "" { + host = v + } + return strings.TrimSuffix(host, "/") + "/" + + strings.TrimSuffix(namespace, "/") + "/" + + name +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go index 2a03d548e8..6d82d80173 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource/testing.go @@ -9,6 +9,7 @@ import ( "regexp" "strconv" "strings" + "time" "github.com/hashicorp/go-multierror" testing "github.com/mitchellh/go-testing-interface" @@ -113,6 +114,7 @@ func runSweepers(regions []string, sweepers map[string]*Sweeper, allowFailures b var regionSweeperErrorFound bool regionSweeperRunList := make(map[string]error) + start := time.Now() log.Printf("[DEBUG] Running Sweepers for region (%s):\n", region) for _, sweeper := range sweepers { if err := runSweeperWithRegion(region, sweeper, sweepers, regionSweeperRunList, allowFailures); err != nil { @@ -124,8 +126,10 @@ func runSweepers(regions []string, sweepers map[string]*Sweeper, allowFailures b return sweeperRunList, fmt.Errorf("sweeper (%s) for region (%s) failed: %s", sweeper.Name, region, err) } } + elapsed := time.Now().Sub(start) + log.Printf("Completed Sweepers for region (%s) in %s", region, elapsed) - log.Printf("Sweeper Tests ran successfully:\n") + log.Printf("Sweeper Tests for region (%s) ran successfully:\n", region) for sweeper, sweeperErr := range regionSweeperRunList { if sweeperErr == nil { fmt.Printf("\t- %s\n", sweeper) @@ -136,7 +140,7 @@ func runSweepers(regions []string, sweepers map[string]*Sweeper, allowFailures b if regionSweeperErrorFound { sweeperErrorFound = true - log.Printf("Sweeper Tests ran unsuccessfully:\n") + log.Printf("Sweeper Tests for region (%s) ran unsuccessfully:\n", region) for sweeper, sweeperErr := range regionSweeperRunList { if sweeperErr != nil { fmt.Printf("\t- %s: %s\n", sweeper, sweeperErr) @@ -233,7 +237,11 @@ func runSweeperWithRegion(region string, s *Sweeper, sweepers map[string]*Sweepe log.Printf("[DEBUG] Running Sweeper (%s) in region (%s)", s.Name, region) + start := time.Now() runE := s.F(region) + elapsed := time.Now().Sub(start) + + log.Printf("[DEBUG] Completed Sweeper (%s) in region (%s) in %s", s.Name, region, elapsed) sweeperRunList[s.Name] = runE diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go index 49a541b4d5..4ed1253dec 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go @@ -552,6 +552,7 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) return resp, nil } + instanceState.RawState = stateVal private := make(map[string]interface{}) if len(req.Private) > 0 { @@ -656,11 +657,20 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot return resp, nil } + configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) + if err != nil { + resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + return resp, nil + } + priorState, err := res.ShimInstanceStateFromValue(priorStateVal) if err != nil { resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) return resp, nil } + priorState.RawState = priorStateVal + priorState.RawPlan = proposedNewStateVal + priorState.RawConfig = configVal priorPrivate := make(map[string]interface{}) if len(req.PriorPrivate) > 0 { if err := json.Unmarshal(req.PriorPrivate, &priorPrivate); err != nil { @@ -869,6 +879,12 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro return resp, nil } + configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) + if err != nil { + resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + return resp, nil + } + priorState, err := res.ShimInstanceStateFromValue(priorStateVal) if err != nil { resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) @@ -893,9 +909,12 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro Attributes: make(map[string]*terraform.ResourceAttrDiff), Meta: make(map[string]interface{}), Destroy: true, + RawPlan: plannedStateVal, + RawState: priorStateVal, + RawConfig: configVal, } } else { - diff, err = DiffFromValues(ctx, priorStateVal, plannedStateVal, stripResourceModifiers(res)) + diff, err = DiffFromValues(ctx, priorStateVal, plannedStateVal, configVal, stripResourceModifiers(res)) if err != nil { resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) return resp, nil @@ -906,6 +925,9 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro diff = &terraform.InstanceDiff{ Attributes: make(map[string]*terraform.ResourceAttrDiff), Meta: make(map[string]interface{}), + RawPlan: plannedStateVal, + RawState: priorStateVal, + RawConfig: configVal, } } @@ -1101,6 +1123,12 @@ func (s *GRPCProviderServer) ReadDataSource(ctx context.Context, req *tfprotov5. return resp, nil } + // Not setting RawConfig here is okay, as ResourceData.GetRawConfig() + // will return a NullVal of the schema if there is no InstanceDiff. + if diff != nil { + diff.RawConfig = configVal + } + // now we can get the new complete data source newInstanceState, diags := res.ReadDataApply(ctx, diff, s.provider.Meta()) resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags) diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go index 25148e17c1..0d1f8e23c0 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go @@ -90,6 +90,9 @@ type Provider struct { // cancellation signal. This function can yield Diagnostics. ConfigureContextFunc ConfigureContextFunc + // configured is enabled after a Configure() call + configured bool + meta interface{} TerraformVersion string @@ -261,6 +264,10 @@ func (p *Provider) Configure(ctx context.Context, c *terraform.ResourceConfig) d return nil } + if p.configured { + log.Printf("[WARN] Previously configured provider being re-configured. This can cause issues in concurrent testing if the configurations are not equal.") + } + sm := schemaMap(p.Schema) // Get a ResourceData for this configuration. To do this, we actually @@ -282,15 +289,23 @@ func (p *Provider) Configure(ctx context.Context, c *terraform.ResourceConfig) d } p.meta = meta } + + var diags diag.Diagnostics + if p.ConfigureContextFunc != nil { - meta, diags := p.ConfigureContextFunc(ctx, data) + meta, configureDiags := p.ConfigureContextFunc(ctx, data) + diags = append(diags, configureDiags...) + if diags.HasError() { return diags } + p.meta = meta } - return nil + p.configured = true + + return diags } // Resources returns all the available resource types that this provider diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go index 45dc9c2efc..b0a8631caa 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go @@ -100,8 +100,11 @@ type Resource struct { // Deprecated: Please use the context aware equivalents instead. Only one of // the operations or context aware equivalent can be set, not both. Create CreateFunc - Read ReadFunc + // Deprecated: Please use the context aware equivalents instead. + Read ReadFunc + // Deprecated: Please use the context aware equivalents instead. Update UpdateFunc + // Deprecated: Please use the context aware equivalents instead. Delete DeleteFunc // Exists is a function that is called to check if a resource still @@ -268,9 +271,17 @@ func (r *Resource) ShimInstanceStateFromValue(state cty.Value) (*terraform.Insta // // Deprecated: Please use the context aware equivalents instead. type CreateFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type ReadFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type UpdateFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type DeleteFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type ExistsFunc func(*ResourceData, interface{}) (bool, error) // See Resource documentation. diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go index d12e754604..46ac3f2a41 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go @@ -7,6 +7,7 @@ import ( "sync" "time" + "github.com/google/go-cmp/cmp" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/go-cty/cty/gocty" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -132,6 +133,9 @@ func (d *ResourceData) HasChanges(keys ...string) bool { // // This function only works with root attribute keys. func (d *ResourceData) HasChangesExcept(keys ...string) bool { + if d == nil || d.diff == nil { + return false + } for attr := range d.diff.Attributes { rootAttr := strings.Split(attr, ".")[0] var skipAttr bool @@ -155,20 +159,16 @@ func (d *ResourceData) HasChangesExcept(keys ...string) bool { func (d *ResourceData) HasChange(key string) bool { o, n := d.GetChange(key) - // If the type implements the Equal interface, then call that - // instead of just doing a reflect.DeepEqual. An example where this is - // needed is *Set - if eq, ok := o.(Equal); ok { - return !eq.Equal(n) - } - - return !reflect.DeepEqual(o, n) + return !cmp.Equal(n, o) } // HasChangeExcept returns whether any keys outside the given key have been changed. // // This function only works with root attribute keys. func (d *ResourceData) HasChangeExcept(key string) bool { + if d == nil || d.diff == nil { + return false + } for attr := range d.diff.Attributes { rootAttr := strings.Split(attr, ".")[0] @@ -580,3 +580,51 @@ func (d *ResourceData) GetProviderMeta(dst interface{}) error { } return gocty.FromCtyValue(d.providerMeta, &dst) } + +// GetRawConfig returns the cty.Value that Terraform sent the SDK for the +// config. If no value was sent, or if a null value was sent, the value will be +// a null value of the resource's type. +// +// GetRawConfig is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceData) GetRawConfig() cty.Value { + if d.diff != nil && !d.diff.RawConfig.IsNull() { + return d.diff.RawConfig + } + if d.state != nil && !d.state.RawConfig.IsNull() { + return d.state.RawConfig + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawState returns the cty.Value that Terraform sent the SDK for the state. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawState is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceData) GetRawState() cty.Value { + if d.diff != nil && !d.diff.RawState.IsNull() { + return d.diff.RawState + } + if d.state != nil && !d.state.RawState.IsNull() { + return d.state.RawState + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawPlan returns the cty.Value that Terraform sent the SDK for the plan. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawPlan is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceData) GetRawPlan() cty.Value { + if d.diff != nil && !d.diff.RawPlan.IsNull() { + return d.diff.RawPlan + } + if d.state != nil && !d.state.RawPlan.IsNull() { + return d.state.RawPlan + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go index 984929df7b..1fdc48cca7 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go @@ -7,6 +7,7 @@ import ( "strings" "sync" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -246,20 +247,20 @@ func (d *ResourceDiff) clear(key string) error { } for k := range d.diff.Attributes { - if strings.HasPrefix(k, key) { + if k == key || childAddrOf(k, key) { delete(d.diff.Attributes, k) } } return nil } -// GetChangedKeysPrefix helps to implement Resource.CustomizeDiff -// where we need to act on all nested fields -// without calling out each one separately +// GetChangedKeysPrefix helps to implement Resource.CustomizeDiff where we need to act +// on all nested fields without calling out each one separately. +// An empty prefix is supported, returning all changed keys. func (d *ResourceDiff) GetChangedKeysPrefix(prefix string) []string { keys := make([]string, 0) for k := range d.diff.Attributes { - if strings.HasPrefix(k, prefix) { + if k == prefix || childAddrOf(k, prefix) || prefix == "" { keys = append(keys, k) } } @@ -450,6 +451,54 @@ func (d *ResourceDiff) Id() string { return result } +// GetRawConfig returns the cty.Value that Terraform sent the SDK for the +// config. If no value was sent, or if a null value was sent, the value will be +// a null value of the resource's type. +// +// GetRawConfig is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceDiff) GetRawConfig() cty.Value { + if d.diff != nil { + return d.diff.RawConfig + } + if d.state != nil { + return d.state.RawConfig + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawState returns the cty.Value that Terraform sent the SDK for the state. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawState is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceDiff) GetRawState() cty.Value { + if d.diff != nil { + return d.diff.RawState + } + if d.state != nil { + return d.state.RawState + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawPlan returns the cty.Value that Terraform sent the SDK for the plan. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawPlan is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceDiff) GetRawPlan() cty.Value { + if d.diff != nil { + return d.diff.RawPlan + } + if d.state != nil { + return d.state.RawPlan + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + // getChange gets values from two different levels, designed for use in // diffChange, HasChange, and GetChange. // diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go index 10a9743c71..8d5c22e04e 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go @@ -509,6 +509,9 @@ func (m schemaMap) Diff( // Make sure to mark if the resource is tainted if s != nil { result.DestroyTainted = s.Tainted + result.RawConfig = s.RawConfig + result.RawState = s.RawState + result.RawPlan = s.RawPlan } d := &ResourceData{ @@ -2098,9 +2101,11 @@ func (m schemaMap) validateType( // indexing into sets is not representable in the current protocol // best we can do is associate the path up to this attribute. diags = m.validateList(k, raw, schema, c, path) - log.Printf("[WARN] Truncating attribute path of %d diagnostics for TypeSet", len(diags)) - for i := range diags { - diags[i].AttributePath = path + if len(diags) > 0 { + log.Printf("[WARN] Truncating attribute path of %d diagnostics for TypeSet", len(diags)) + for i := range diags { + diags[i].AttributePath = path + } } case TypeMap: diags = m.validateMap(k, raw, schema, c, path) diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go index a510e60ff0..48755c22d1 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go @@ -3,6 +3,7 @@ package schema import ( "bytes" "fmt" + "github.com/google/go-cmp/cmp" "reflect" "sort" "strconv" @@ -150,46 +151,12 @@ func (s *Set) Union(other *Set) *Set { return result } -func checkSetMapEqual(m1, m2 map[string]interface{}) bool { - if (m1 == nil) != (m2 == nil) { - return false - } - if len(m1) != len(m2) { - return false - } - for k := range m1 { - v1 := m1[k] - v2, ok := m2[k] - if !ok { - return false - } - switch v1.(type) { - case map[string]interface{}: - same := checkSetMapEqual(v1.(map[string]interface{}), v2.(map[string]interface{})) - if !same { - return false - } - case *Set: - same := v1.(*Set).Equal(v2) - if !same { - return false - } - default: - same := reflect.DeepEqual(v1, v2) - if !same { - return false - } - } - } - return true -} - func (s *Set) Equal(raw interface{}) bool { other, ok := raw.(*Set) if !ok { return false } - return checkSetMapEqual(s.m, other.m) + return cmp.Equal(s.m, other.m) } // HashEqual simply checks to the keys the top-level map to the keys in the diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go index e1575a0f89..9c7f0906c6 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go @@ -16,20 +16,24 @@ import ( // derives a terraform.InstanceDiff to give to the legacy providers. This is // used to take the states provided by the new ApplyResourceChange method and // convert them to a state+diff required for the legacy Apply method. -func DiffFromValues(ctx context.Context, prior, planned cty.Value, res *Resource) (*terraform.InstanceDiff, error) { - return diffFromValues(ctx, prior, planned, res, nil) +func DiffFromValues(ctx context.Context, prior, planned, config cty.Value, res *Resource) (*terraform.InstanceDiff, error) { + return diffFromValues(ctx, prior, planned, config, res, nil) } // diffFromValues takes an additional CustomizeDiffFunc, so we can generate our // test fixtures from the legacy tests. In the new provider protocol the diff // only needs to be created for the apply operation, and any customizations // have already been done. -func diffFromValues(ctx context.Context, prior, planned cty.Value, res *Resource, cust CustomizeDiffFunc) (*terraform.InstanceDiff, error) { +func diffFromValues(ctx context.Context, prior, planned, config cty.Value, res *Resource, cust CustomizeDiffFunc) (*terraform.InstanceDiff, error) { instanceState, err := res.ShimInstanceStateFromValue(prior) if err != nil { return nil, err } + instanceState.RawConfig = config + instanceState.RawPlan = planned + instanceState.RawState = prior + configSchema := res.CoreConfigSchema() cfg := terraform.NewResourceConfigShimmed(planned, configSchema) diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go index babd0ecfb8..252456747d 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go @@ -123,7 +123,7 @@ func PathToAttributePath(p cty.Path) *tftypes.AttributePath { ap = ap.WithElementKeyString(key.AsString()) case cty.Number: v, _ := key.AsBigFloat().Int64() - ap = ap.WithElementKeyInt(v) + ap = ap.WithElementKeyInt(int(v)) default: // We'll bail early if we encounter anything else, and just // return the valid prefix. diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go index 310dc63878..c5dbf5b8fd 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go @@ -56,7 +56,7 @@ func tftypeFromCtyType(in cty.Type) (tftypes.Type, error) { return nil, err } return tftypes.Map{ - AttributeType: elemType, + ElementType: elemType, }, nil case in.IsObjectType(): attrTypes := make(map[string]tftypes.Type) @@ -97,7 +97,7 @@ func ctyTypeFromTFType(in tftypes.Type) (cty.Type, error) { } return cty.Set(elemType), nil case in.Is(tftypes.Map{}): - elemType, err := ctyTypeFromTFType(in.(tftypes.Map).AttributeType) + elemType, err := ctyTypeFromTFType(in.(tftypes.Map).ElementType) if err != nil { return cty.Type{}, err } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go index 9b042483ce..2c544e9e50 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest/config.go @@ -7,7 +7,13 @@ import ( "os" "strings" - "github.com/hashicorp/terraform-exec/tfinstall" + "github.com/hashicorp/go-version" + install "github.com/hashicorp/hc-install" + "github.com/hashicorp/hc-install/checkpoint" + "github.com/hashicorp/hc-install/fs" + "github.com/hashicorp/hc-install/product" + "github.com/hashicorp/hc-install/releases" + "github.com/hashicorp/hc-install/src" ) // Config is used to configure the test helper. In most normal test programs @@ -33,16 +39,36 @@ func DiscoverConfig(sourceDir string) (*Config, error) { return nil, fmt.Errorf("failed to create temp dir: %w", err) } - finders := []tfinstall.ExecPathFinder{} + var sources []src.Source switch { case tfPath != "": - finders = append(finders, tfinstall.ExactPath(tfPath)) + sources = append(sources, &fs.AnyVersion{ + ExactBinPath: tfPath, + }) case tfVersion != "": - finders = append(finders, tfinstall.ExactVersion(tfVersion, tfDir)) + tfVersion, err := version.NewVersion(tfVersion) + + if err != nil { + return nil, fmt.Errorf("invalid Terraform version: %w", err) + } + + sources = append(sources, &releases.ExactVersion{ + InstallDir: tfDir, + Product: product.Terraform, + Version: tfVersion, + }) default: - finders = append(finders, tfinstall.LookPath(), tfinstall.LatestVersion(tfDir, true)) + sources = append(sources, &fs.AnyVersion{ + Product: &product.Terraform, + }) + sources = append(sources, &checkpoint.LatestVersion{ + InstallDir: tfDir, + Product: product.Terraform, + }) } - tfExec, err := tfinstall.Find(context.Background(), finders...) + + installer := install.NewInstaller() + tfExec, err := installer.Ensure(context.Background(), sources) if err != nil { return nil, err } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go index ab6c9e2aba..35f20f7ee5 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go @@ -11,7 +11,7 @@ import ( ) // The main version number that is being run at the moment. -var SDKVersion = "2.7.0" +var SDKVersion = "2.10.1" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go index 127889986e..ac126642df 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go @@ -5,12 +5,13 @@ import ( hclog "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" + testing "github.com/mitchellh/go-testing-interface" "google.golang.org/grpc" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - tf5server "github.com/hashicorp/terraform-plugin-go/tfprotov5/server" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server" "github.com/hashicorp/terraform-plugin-go/tfprotov6" - tf6server "github.com/hashicorp/terraform-plugin-go/tfprotov6/server" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -55,6 +56,14 @@ type ServeOpts struct { // adapter. This should only be used when running the plugin in // acceptance tests. NoLogOutputOverride bool + + // UseTFLogSink is the testing.T for a test function that will turn on + // the terraform-plugin-log logging sink. + UseTFLogSink testing.T + + // ProviderAddr is the address of the provider under test, like + // registry.terraform.io/hashicorp/random. + ProviderAddr string } // Serve serves a plugin. This function never returns and should be the final @@ -95,27 +104,43 @@ func Serve(opts *ServeOpts) { // assume we have either a v5 or a v6 provider if opts.GRPCProviderFunc != nil { provider := opts.GRPCProviderFunc() + addr := opts.ProviderAddr + if addr == "" { + addr = "provider" + } serveConfig.VersionedPlugins = map[int]plugin.PluginSet{ 5: { ProviderPluginName: &tf5server.GRPCProviderPlugin{ GRPCProvider: func() tfprotov5.ProviderServer { return provider }, + Name: addr, }, }, } + if opts.UseTFLogSink != nil { + serveConfig.VersionedPlugins[5][ProviderPluginName].(*tf5server.GRPCProviderPlugin).Opts = append(serveConfig.VersionedPlugins[5][ProviderPluginName].(*tf5server.GRPCProviderPlugin).Opts, tf5server.WithLoggingSink(opts.UseTFLogSink)) + } } else if opts.GRPCProviderV6Func != nil { provider := opts.GRPCProviderV6Func() + addr := opts.ProviderAddr + if addr == "" { + addr = "provider" + } serveConfig.VersionedPlugins = map[int]plugin.PluginSet{ 6: { ProviderPluginName: &tf6server.GRPCProviderPlugin{ GRPCProvider: func() tfprotov6.ProviderServer { return provider }, + Name: addr, }, }, } + if opts.UseTFLogSink != nil { + serveConfig.VersionedPlugins[6][ProviderPluginName].(*tf6server.GRPCProviderPlugin).Opts = append(serveConfig.VersionedPlugins[6][ProviderPluginName].(*tf6server.GRPCProviderPlugin).Opts, tf6server.WithLoggingSink(opts.UseTFLogSink)) + } } diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go index c7d82cf3d0..0511a1fc5e 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go @@ -39,6 +39,10 @@ type InstanceDiff struct { DestroyDeposed bool DestroyTainted bool + RawConfig cty.Value + RawState cty.Value + RawPlan cty.Value + // Meta is a simple K/V map that is stored in a diff and persisted to // plans but otherwise is completely ignored by Terraform core. It is // meant to be used for additional data a resource may want to pass through. diff --git a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go index 87f7610a93..7f8655ee7d 100644 --- a/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go +++ b/ibm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go @@ -1343,6 +1343,10 @@ type InstanceState struct { ProviderMeta cty.Value + RawConfig cty.Value + RawState cty.Value + RawPlan cty.Value + // Tainted is used to mark a resource for recreation. Tainted bool `json:"tainted"` diff --git a/ibm/vendor/github.com/hashicorp/terraform-registry-address/.go-version b/ibm/vendor/github.com/hashicorp/terraform-registry-address/.go-version new file mode 100644 index 0000000000..42cf0675c5 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-registry-address/.go-version @@ -0,0 +1 @@ +1.15.2 diff --git a/ibm/vendor/github.com/hashicorp/terraform-registry-address/LICENSE b/ibm/vendor/github.com/hashicorp/terraform-registry-address/LICENSE new file mode 100644 index 0000000000..c33dcc7c92 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-registry-address/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/ibm/vendor/github.com/hashicorp/terraform-registry-address/README.md b/ibm/vendor/github.com/hashicorp/terraform-registry-address/README.md new file mode 100644 index 0000000000..2ed8398da7 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-registry-address/README.md @@ -0,0 +1,88 @@ +# terraform-registry-address + +This package helps with representation, comparison and parsing of +Terraform Registry addresses, such as +`registry.terraform.io/grafana/grafana` or `hashicorp/aws`. + +The most common source of these addresses outside of Terraform Core +is JSON representation of state, plan, or schemas as obtained +via [`hashicorp/terraform-exec`](https://github.com/hashicorp/terraform-exec). + +## Example + +```go +p, err := ParseRawProviderSourceString("hashicorp/aws") +if err != nil { + // deal with error +} + +// p == Provider{ +// Type: "aws", +// Namespace: "hashicorp", +// Hostname: svchost.Hostname("registry.terraform.io"), +// } +``` + +## Legacy address + +A legacy address is by itself (without more context) ambiguous. +For example `aws` may represent either the official `hashicorp/aws` +or just any custom-built provider called `aws`. + +Such ambiguous address can be produced by Terraform `<=0.12`. You can +just use `ImpliedProviderForUnqualifiedType` if you know for sure +the address was produced by an affected version. + +If you do not have that context you should parse the string via +`ParseRawProviderSourceString` and then check `addr.IsLegacy()`. + +### What to do with a legacy address? + +Ask the Registry API whether and where the provider was moved to + +(`-` represents the legacy, basically unknown namespace) + +```sh +# grafana (redirected to its own namespace) +$ curl -s https://registry.terraform.io/v1/providers/-/grafana/versions | jq '(.id, .moved_to)' +"terraform-providers/grafana" +"grafana/grafana" + +# aws (provider without redirection) +$ curl -s https://registry.terraform.io/v1/providers/-/aws/versions | jq '(.id, .moved_to)' +"hashicorp/aws" +null +``` + +Then: + + - Reparse the _new_ address (`moved_to`) of any _moved_ provider (e.g. `grafana/grafana`) via `ParseRawProviderSourceString` + - Reparse the full address (`id`) of any other provider (e.g. `hashicorp/aws`) + +Depending on context (legacy) `terraform` may need to be parsed separately. +Read more about this provider below. + +If for some reason you cannot ask the Registry API you may also use +`ParseAndInferProviderSourceString` which assumes that any legacy address +(including `terraform`) belongs to the `hashicorp` namespace. + +If you cache results (which you should), ensure you have invalidation +mechanism in place because target (migrated) namespace may change. +Hard-coding migrations anywhere in code is strongly discouraged. + +### `terraform` provider + +Like any other legacy address `terraform` is also ambiguous. Such address may +(most unlikely) represent a custom-built provider called `terraform`, +or the now archived [`hashicorp/terraform` provider in the registry](https://registry.terraform.io/providers/hashicorp/terraform/latest), +or (most likely) the `terraform` provider built into 0.12+, which is +represented via a dedicated FQN of `terraform.io/builtin/terraform` in 0.13+. + +You may be able to differentiate between these different providers if you +know the version of Terraform. + +Alternatively you may just treat the address as the builtin provider, +i.e. assume all of its logic including schema is contained within +Terraform Core. + +In such case you should just use `NewBuiltInProvider("terraform")`. diff --git a/ibm/vendor/github.com/hashicorp/terraform-registry-address/errors.go b/ibm/vendor/github.com/hashicorp/terraform-registry-address/errors.go new file mode 100644 index 0000000000..1ca735383a --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-registry-address/errors.go @@ -0,0 +1,14 @@ +package tfaddr + +import ( + "fmt" +) + +type ParserError struct { + Summary string + Detail string +} + +func (pe *ParserError) Error() string { + return fmt.Sprintf("%s: %s", pe.Summary, pe.Detail) +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-registry-address/provider.go b/ibm/vendor/github.com/hashicorp/terraform-registry-address/provider.go new file mode 100644 index 0000000000..4dd0a5b781 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-registry-address/provider.go @@ -0,0 +1,482 @@ +package tfaddr + +import ( + "fmt" + "strings" + + svchost "github.com/hashicorp/terraform-svchost" + "golang.org/x/net/idna" +) + +// Provider encapsulates a single provider type. In the future this will be +// extended to include additional fields including Namespace and SourceHost +type Provider struct { + Type string + Namespace string + Hostname svchost.Hostname +} + +// DefaultRegistryHost is the hostname used for provider addresses that do +// not have an explicit hostname. +const DefaultRegistryHost = svchost.Hostname("registry.terraform.io") + +// BuiltInProviderHost is the pseudo-hostname used for the "built-in" provider +// namespace. Built-in provider addresses must also have their namespace set +// to BuiltInProviderNamespace in order to be considered as built-in. +const BuiltInProviderHost = svchost.Hostname("terraform.io") + +// BuiltInProviderNamespace is the provider namespace used for "built-in" +// providers. Built-in provider addresses must also have their hostname +// set to BuiltInProviderHost in order to be considered as built-in. +// +// The this namespace is literally named "builtin", in the hope that users +// who see FQNs containing this will be able to infer the way in which they are +// special, even if they haven't encountered the concept formally yet. +const BuiltInProviderNamespace = "builtin" + +// LegacyProviderNamespace is the special string used in the Namespace field +// of type Provider to mark a legacy provider address. This special namespace +// value would normally be invalid, and can be used only when the hostname is +// DefaultRegistryHost because that host owns the mapping from legacy name to +// FQN. +const LegacyProviderNamespace = "-" + +// String returns an FQN string, indended for use in machine-readable output. +func (pt Provider) String() string { + if pt.IsZero() { + panic("called String on zero-value addrs.Provider") + } + return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type +} + +// ForDisplay returns a user-friendly FQN string, simplified for readability. If +// the provider is using the default hostname, the hostname is omitted. +func (pt Provider) ForDisplay() string { + if pt.IsZero() { + panic("called ForDisplay on zero-value addrs.Provider") + } + + if pt.Hostname == DefaultRegistryHost { + return pt.Namespace + "/" + pt.Type + } + return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type +} + +// NewProvider constructs a provider address from its parts, and normalizes +// the namespace and type parts to lowercase using unicode case folding rules +// so that resulting addrs.Provider values can be compared using standard +// Go equality rules (==). +// +// The hostname is given as a svchost.Hostname, which is required by the +// contract of that type to have already been normalized for equality testing. +// +// This function will panic if the given namespace or type name are not valid. +// When accepting namespace or type values from outside the program, use +// ParseProviderPart first to check that the given value is valid. +func NewProvider(hostname svchost.Hostname, namespace, typeName string) Provider { + if namespace == LegacyProviderNamespace { + // Legacy provider addresses must always be created via + // NewLegacyProvider so that we can use static analysis to find + // codepaths still working with those. + panic("attempt to create legacy provider address using NewProvider; use NewLegacyProvider instead") + } + + return Provider{ + Type: MustParseProviderPart(typeName), + Namespace: MustParseProviderPart(namespace), + Hostname: hostname, + } +} + +// ImpliedProviderForUnqualifiedType represents the rules for inferring what +// provider FQN a user intended when only a naked type name is available. +// +// For all except the type name "terraform" this returns a so-called "default" +// provider, which is under the registry.terraform.io/hashicorp/ namespace. +// +// As a special case, the string "terraform" maps to +// "terraform.io/builtin/terraform" because that is the more likely user +// intent than the now-unmaintained "registry.terraform.io/hashicorp/terraform" +// which remains only for compatibility with older Terraform versions. +func ImpliedProviderForUnqualifiedType(typeName string) Provider { + switch typeName { + case "terraform": + // Note for future maintainers: any additional strings we add here + // as implied to be builtin must never also be use as provider names + // in the registry.terraform.io/hashicorp/... namespace, because + // otherwise older versions of Terraform could implicitly select + // the registry name instead of the internal one. + return NewBuiltInProvider(typeName) + default: + return NewDefaultProvider(typeName) + } +} + +// NewDefaultProvider returns the default address of a HashiCorp-maintained, +// Registry-hosted provider. +func NewDefaultProvider(name string) Provider { + return Provider{ + Type: MustParseProviderPart(name), + Namespace: "hashicorp", + Hostname: DefaultRegistryHost, + } +} + +// NewBuiltInProvider returns the address of a "built-in" provider. See +// the docs for Provider.IsBuiltIn for more information. +func NewBuiltInProvider(name string) Provider { + return Provider{ + Type: MustParseProviderPart(name), + Namespace: BuiltInProviderNamespace, + Hostname: BuiltInProviderHost, + } +} + +// NewLegacyProvider returns a mock address for a provider. +// This will be removed when ProviderType is fully integrated. +func NewLegacyProvider(name string) Provider { + return Provider{ + // We intentionally don't normalize and validate the legacy names, + // because existing code expects legacy provider names to pass through + // verbatim, even if not compliant with our new naming rules. + Type: name, + Namespace: LegacyProviderNamespace, + Hostname: DefaultRegistryHost, + } +} + +// LegacyString returns the provider type, which is frequently used +// interchangeably with provider name. This function can and should be removed +// when provider type is fully integrated. As a safeguard for future +// refactoring, this function panics if the Provider is not a legacy provider. +func (pt Provider) LegacyString() string { + if pt.IsZero() { + panic("called LegacyString on zero-value addrs.Provider") + } + if pt.Namespace != LegacyProviderNamespace && pt.Namespace != BuiltInProviderNamespace { + panic(pt.String() + " cannot be represented as a legacy string") + } + return pt.Type +} + +// IsZero returns true if the receiver is the zero value of addrs.Provider. +// +// The zero value is not a valid addrs.Provider and calling other methods on +// such a value is likely to either panic or otherwise misbehave. +func (pt Provider) IsZero() bool { + return pt == Provider{} +} + +// IsBuiltIn returns true if the receiver is the address of a "built-in" +// provider. That is, a provider under terraform.io/builtin/ which is +// included as part of the Terraform binary itself rather than one to be +// installed from elsewhere. +// +// These are ignored by the provider installer because they are assumed to +// already be available without any further installation. +func (pt Provider) IsBuiltIn() bool { + return pt.Hostname == BuiltInProviderHost && pt.Namespace == BuiltInProviderNamespace +} + +// LessThan returns true if the receiver should sort before the other given +// address in an ordered list of provider addresses. +// +// This ordering is an arbitrary one just to allow deterministic results from +// functions that would otherwise have no natural ordering. It's subject +// to change in future. +func (pt Provider) LessThan(other Provider) bool { + switch { + case pt.Hostname != other.Hostname: + return pt.Hostname < other.Hostname + case pt.Namespace != other.Namespace: + return pt.Namespace < other.Namespace + default: + return pt.Type < other.Type + } +} + +// IsLegacy returns true if the provider is a legacy-style provider +func (pt Provider) IsLegacy() bool { + if pt.IsZero() { + panic("called IsLegacy() on zero-value addrs.Provider") + } + + return pt.Hostname == DefaultRegistryHost && pt.Namespace == LegacyProviderNamespace + +} + +// IsDefault returns true if the provider is a default hashicorp provider +func (pt Provider) IsDefault() bool { + if pt.IsZero() { + panic("called IsDefault() on zero-value addrs.Provider") + } + + return pt.Hostname == DefaultRegistryHost && pt.Namespace == "hashicorp" +} + +// Equals returns true if the receiver and other provider have the same attributes. +func (pt Provider) Equals(other Provider) bool { + return pt == other +} + +// ParseRawProviderSourceString parses the source attribute and returns a provider. +// This is intended primarily to parse the FQN-like strings returned by +// terraform-config-inspect. +// +// The following are valid source string formats: +// name +// namespace/name +// hostname/namespace/name +// +// "name"-only format is parsed as -/name (i.e. legacy namespace) +// requiring further identification of the namespace via Registry API +func ParseRawProviderSourceString(str string) (Provider, error) { + var ret Provider + parts, err := parseSourceStringParts(str) + if err != nil { + return ret, err + } + + name := parts[len(parts)-1] + ret.Type = name + ret.Hostname = DefaultRegistryHost + + if len(parts) == 1 { + return NewLegacyProvider(name), nil + } + + if len(parts) >= 2 { + // the namespace is always the second-to-last part + givenNamespace := parts[len(parts)-2] + if givenNamespace == LegacyProviderNamespace { + // For now we're tolerating legacy provider addresses until we've + // finished updating the rest of the codebase to no longer use them, + // or else we'd get errors round-tripping through legacy subsystems. + ret.Namespace = LegacyProviderNamespace + } else { + namespace, err := ParseProviderPart(givenNamespace) + if err != nil { + return Provider{}, &ParserError{ + Summary: "Invalid provider namespace", + Detail: fmt.Sprintf(`Invalid provider namespace %q in source %q: %s"`, namespace, str, err), + } + } + ret.Namespace = namespace + } + } + + // Final Case: 3 parts + if len(parts) == 3 { + // the namespace is always the first part in a three-part source string + hn, err := svchost.ForComparison(parts[0]) + if err != nil { + return Provider{}, &ParserError{ + Summary: "Invalid provider source hostname", + Detail: fmt.Sprintf(`Invalid provider source hostname namespace %q in source %q: %s"`, hn, str, err), + } + } + ret.Hostname = hn + } + + if ret.Namespace == LegacyProviderNamespace && ret.Hostname != DefaultRegistryHost { + // Legacy provider addresses must always be on the default registry + // host, because the default registry host decides what actual FQN + // each one maps to. + return Provider{}, &ParserError{ + Summary: "Invalid provider namespace", + Detail: "The legacy provider namespace \"-\" can be used only with hostname " + DefaultRegistryHost.ForDisplay() + ".", + } + } + + // Due to how plugin executables are named and provider git repositories + // are conventionally named, it's a reasonable and + // apparently-somewhat-common user error to incorrectly use the + // "terraform-provider-" prefix in a provider source address. There is + // no good reason for a provider to have the prefix "terraform-" anyway, + // so we've made that invalid from the start both so we can give feedback + // to provider developers about the terraform- prefix being redundant + // and give specialized feedback to folks who incorrectly use the full + // terraform-provider- prefix to help them self-correct. + const redundantPrefix = "terraform-" + const userErrorPrefix = "terraform-provider-" + if strings.HasPrefix(ret.Type, redundantPrefix) { + if strings.HasPrefix(ret.Type, userErrorPrefix) { + // Likely user error. We only return this specialized error if + // whatever is after the prefix would otherwise be a + // syntactically-valid provider type, so we don't end up advising + // the user to try something that would be invalid for another + // reason anyway. + // (This is mainly just for robustness, because the validation + // we already did above should've rejected most/all ways for + // the suggestedType to end up invalid here.) + suggestedType := ret.Type[len(userErrorPrefix):] + if _, err := ParseProviderPart(suggestedType); err == nil { + suggestedAddr := ret + suggestedAddr.Type = suggestedType + return Provider{}, &ParserError{ + Summary: "Invalid provider type", + Detail: fmt.Sprintf("Provider source %q has a type with the prefix %q, which isn't valid. Although that prefix is often used in the names of version control repositories for Terraform providers, provider source strings should not include it.\n\nDid you mean %q?", ret.ForDisplay(), userErrorPrefix, suggestedAddr.ForDisplay()), + } + } + } + // Otherwise, probably instead an incorrectly-named provider, perhaps + // arising from a similar instinct to what causes there to be + // thousands of Python packages on PyPI with "python-"-prefixed + // names. + return Provider{}, &ParserError{ + Summary: "Invalid provider type", + Detail: fmt.Sprintf("Provider source %q has a type with the prefix %q, which isn't allowed because it would be redundant to name a Terraform provider with that prefix. If you are the author of this provider, rename it to not include the prefix.", ret, redundantPrefix), + } + } + + return ret, nil +} + +// ParseAndInferProviderSourceString parses the source attribute and returns a provider. +// This is intended primarily to parse the FQN-like strings returned by +// terraform-config-inspect. +// +// The following are valid source string formats: +// name +// namespace/name +// hostname/namespace/name +// +// "name" format is assumed to be hashicorp/name +func ParseAndInferProviderSourceString(str string) (Provider, error) { + var ret Provider + parts, err := parseSourceStringParts(str) + if err != nil { + return ret, err + } + + if len(parts) == 1 { + return NewDefaultProvider(parts[0]), nil + } + + return ParseRawProviderSourceString(str) +} + +func parseSourceStringParts(str string) ([]string, error) { + // split the source string into individual components + parts := strings.Split(str, "/") + if len(parts) == 0 || len(parts) > 3 { + return nil, &ParserError{ + Summary: "Invalid provider source string", + Detail: `The "source" attribute must be in the format "[hostname/][namespace/]name"`, + } + } + + // check for an invalid empty string in any part + for i := range parts { + if parts[i] == "" { + return nil, &ParserError{ + Summary: "Invalid provider source string", + Detail: `The "source" attribute must be in the format "[hostname/][namespace/]name"`, + } + } + } + + // check the 'name' portion, which is always the last part + givenName := parts[len(parts)-1] + name, err := ParseProviderPart(givenName) + if err != nil { + return nil, &ParserError{ + Summary: "Invalid provider type", + Detail: fmt.Sprintf(`Invalid provider type %q in source %q: %s"`, givenName, str, err), + } + } + parts[len(parts)-1] = name + + return parts, nil +} + +// MustParseRawProviderSourceString is a wrapper around ParseRawProviderSourceString that panics if +// it returns an error. +func MustParseRawProviderSourceString(str string) Provider { + result, err := ParseRawProviderSourceString(str) + if err != nil { + panic(err) + } + return result +} + +// ParseProviderPart processes an addrs.Provider namespace or type string +// provided by an end-user, producing a normalized version if possible or +// an error if the string contains invalid characters. +// +// A provider part is processed in the same way as an individual label in a DNS +// domain name: it is transformed to lowercase per the usual DNS case mapping +// and normalization rules and may contain only letters, digits, and dashes. +// Additionally, dashes may not appear at the start or end of the string. +// +// These restrictions are intended to allow these names to appear in fussy +// contexts such as directory/file names on case-insensitive filesystems, +// repository names on GitHub, etc. We're using the DNS rules in particular, +// rather than some similar rules defined locally, because the hostname part +// of an addrs.Provider is already a hostname and it's ideal to use exactly +// the same case folding and normalization rules for all of the parts. +// +// In practice a provider type string conventionally does not contain dashes +// either. Such names are permitted, but providers with such type names will be +// hard to use because their resource type names will not be able to contain +// the provider type name and thus each resource will need an explicit provider +// address specified. (A real-world example of such a provider is the +// "google-beta" variant of the GCP provider, which has resource types that +// start with the "google_" prefix instead.) +// +// It's valid to pass the result of this function as the argument to a +// subsequent call, in which case the result will be identical. +func ParseProviderPart(given string) (string, error) { + if len(given) == 0 { + return "", fmt.Errorf("must have at least one character") + } + + // We're going to process the given name using the same "IDNA" library we + // use for the hostname portion, since it already implements the case + // folding rules we want. + // + // The idna library doesn't expose individual label parsing directly, but + // once we've verified it doesn't contain any dots we can just treat it + // like a top-level domain for this library's purposes. + if strings.ContainsRune(given, '.') { + return "", fmt.Errorf("dots are not allowed") + } + + // We don't allow names containing multiple consecutive dashes, just as + // a matter of preference: they look weird, confusing, or incorrect. + // This also, as a side-effect, prevents the use of the "punycode" + // indicator prefix "xn--" that would cause the IDNA library to interpret + // the given name as punycode, because that would be weird and unexpected. + if strings.Contains(given, "--") { + return "", fmt.Errorf("cannot use multiple consecutive dashes") + } + + result, err := idna.Lookup.ToUnicode(given) + if err != nil { + return "", fmt.Errorf("must contain only letters, digits, and dashes, and may not use leading or trailing dashes") + } + + return result, nil +} + +// MustParseProviderPart is a wrapper around ParseProviderPart that panics if +// it returns an error. +func MustParseProviderPart(given string) string { + result, err := ParseProviderPart(given) + if err != nil { + panic(err.Error()) + } + return result +} + +// IsProviderPartNormalized compares a given string to the result of ParseProviderPart(string) +func IsProviderPartNormalized(str string) (bool, error) { + normalized, err := ParseProviderPart(str) + if err != nil { + return false, err + } + if str == normalized { + return true, nil + } + return false, nil +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-svchost/LICENSE b/ibm/vendor/github.com/hashicorp/terraform-svchost/LICENSE new file mode 100644 index 0000000000..82b4de97c7 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-svchost/LICENSE @@ -0,0 +1,353 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. diff --git a/ibm/vendor/github.com/hashicorp/terraform-svchost/label_iter.go b/ibm/vendor/github.com/hashicorp/terraform-svchost/label_iter.go new file mode 100644 index 0000000000..af8ccbab20 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-svchost/label_iter.go @@ -0,0 +1,69 @@ +package svchost + +import ( + "strings" +) + +// A labelIter allows iterating over domain name labels. +// +// This type is copied from golang.org/x/net/idna, where it is used +// to segment hostnames into their separate labels for analysis. We use +// it for the same purpose here, in ForComparison. +type labelIter struct { + orig string + slice []string + curStart int + curEnd int + i int +} + +func (l *labelIter) reset() { + l.curStart = 0 + l.curEnd = 0 + l.i = 0 +} + +func (l *labelIter) done() bool { + return l.curStart >= len(l.orig) +} + +func (l *labelIter) result() string { + if l.slice != nil { + return strings.Join(l.slice, ".") + } + return l.orig +} + +func (l *labelIter) label() string { + if l.slice != nil { + return l.slice[l.i] + } + p := strings.IndexByte(l.orig[l.curStart:], '.') + l.curEnd = l.curStart + p + if p == -1 { + l.curEnd = len(l.orig) + } + return l.orig[l.curStart:l.curEnd] +} + +// next sets the value to the next label. It skips the last label if it is empty. +func (l *labelIter) next() { + l.i++ + if l.slice != nil { + if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" { + l.curStart = len(l.orig) + } + } else { + l.curStart = l.curEnd + 1 + if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' { + l.curStart = len(l.orig) + } + } +} + +func (l *labelIter) set(s string) { + if l.slice == nil { + l.slice = strings.Split(l.orig, ".") + } + l.slice[l.i] = s +} diff --git a/ibm/vendor/github.com/hashicorp/terraform-svchost/svchost.go b/ibm/vendor/github.com/hashicorp/terraform-svchost/svchost.go new file mode 100644 index 0000000000..4060b767e5 --- /dev/null +++ b/ibm/vendor/github.com/hashicorp/terraform-svchost/svchost.go @@ -0,0 +1,207 @@ +// Package svchost deals with the representations of the so-called "friendly +// hostnames" that we use to represent systems that provide Terraform-native +// remote services, such as module registry, remote operations, etc. +// +// Friendly hostnames are specified such that, as much as possible, they +// are consistent with how web browsers think of hostnames, so that users +// can bring their intuitions about how hostnames behave when they access +// a Terraform Enterprise instance's web UI (or indeed any other website) +// and have this behave in a similar way. +package svchost + +import ( + "errors" + "fmt" + "strconv" + "strings" + + "golang.org/x/net/idna" +) + +// Hostname is specialized name for string that indicates that the string +// has been converted to (or was already in) the storage and comparison form. +// +// Hostname values are not suitable for display in the user-interface. Use +// the ForDisplay method to obtain a form suitable for display in the UI. +// +// Unlike user-supplied hostnames, strings of type Hostname (assuming they +// were constructed by a function within this package) can be compared for +// equality using the standard Go == operator. +type Hostname string + +// acePrefix is the ASCII Compatible Encoding prefix, used to indicate that +// a domain name label is in "punycode" form. +const acePrefix = "xn--" + +// displayProfile is a very liberal idna profile that we use to do +// normalization for display without imposing validation rules. +var displayProfile = idna.New( + idna.MapForLookup(), + idna.Transitional(true), +) + +// ForDisplay takes a user-specified hostname and returns a normalized form of +// it suitable for display in the UI. +// +// If the input is so invalid that no normalization can be performed then +// this will return the input, assuming that the caller still wants to +// display _something_. This function is, however, more tolerant than the +// other functions in this package and will make a best effort to prepare +// _any_ given hostname for display. +// +// For validation, use either IsValid (for explicit validation) or +// ForComparison (which implicitly validates, returning an error if invalid). +func ForDisplay(given string) string { + var portPortion string + if colonPos := strings.Index(given, ":"); colonPos != -1 { + given, portPortion = given[:colonPos], given[colonPos:] + } + portPortion, _ = normalizePortPortion(portPortion) + + ascii, err := displayProfile.ToASCII(given) + if err != nil { + return given + portPortion + } + display, err := displayProfile.ToUnicode(ascii) + if err != nil { + return given + portPortion + } + return display + portPortion +} + +// IsValid returns true if the given user-specified hostname is a valid +// service hostname. +// +// Validity is determined by complying with the RFC 5891 requirements for +// names that are valid for domain lookup (section 5), with the additional +// requirement that user-supplied forms must not _already_ contain +// Punycode segments. +func IsValid(given string) bool { + _, err := ForComparison(given) + return err == nil +} + +// ForComparison takes a user-specified hostname and returns a normalized +// form of it suitable for storage and comparison. The result is not suitable +// for display to end-users because it uses Punycode to represent non-ASCII +// characters, and this form is unreadable for non-ASCII-speaking humans. +// +// The result is typed as Hostname -- a specialized name for string -- so that +// other APIs can make it clear within the type system whether they expect a +// user-specified or display-form hostname or a value already normalized for +// comparison. +// +// The returned Hostname is not valid if the returned error is non-nil. +func ForComparison(given string) (Hostname, error) { + var portPortion string + if colonPos := strings.Index(given, ":"); colonPos != -1 { + given, portPortion = given[:colonPos], given[colonPos:] + } + + var err error + portPortion, err = normalizePortPortion(portPortion) + if err != nil { + return Hostname(""), err + } + + if given == "" { + return Hostname(""), fmt.Errorf("empty string is not a valid hostname") + } + + // First we'll apply our additional constraint that Punycode must not + // be given directly by the user. This is not an IDN specification + // requirement, but we prohibit it to force users to use human-readable + // hostname forms within Terraform configuration. + labels := labelIter{orig: given} + for ; !labels.done(); labels.next() { + label := labels.label() + if label == "" { + return Hostname(""), fmt.Errorf( + "hostname contains empty label (two consecutive periods)", + ) + } + if strings.HasPrefix(label, acePrefix) { + return Hostname(""), fmt.Errorf( + "hostname label %q specified in punycode format; service hostnames must be given in unicode", + label, + ) + } + } + + result, err := idna.Lookup.ToASCII(given) + if err != nil { + return Hostname(""), err + } + return Hostname(result + portPortion), nil +} + +// ForDisplay returns a version of the receiver that is appropriate for display +// in the UI. This includes converting any punycode labels to their +// corresponding Unicode characters. +// +// A round-trip through ForComparison and this ForDisplay method does not +// guarantee the same result as calling this package's top-level ForDisplay +// function, since a round-trip through the Hostname type implies stricter +// handling than we do when doing basic display-only processing. +func (h Hostname) ForDisplay() string { + given := string(h) + var portPortion string + if colonPos := strings.Index(given, ":"); colonPos != -1 { + given, portPortion = given[:colonPos], given[colonPos:] + } + // We don't normalize the port portion here because we assume it's + // already been normalized on the way in. + + result, err := idna.Lookup.ToUnicode(given) + if err != nil { + // Should never happen, since type Hostname indicates that a string + // passed through our validation rules. + panic(fmt.Errorf("ForDisplay called on invalid Hostname: %s", err)) + } + return result + portPortion +} + +func (h Hostname) String() string { + return string(h) +} + +func (h Hostname) GoString() string { + return fmt.Sprintf("svchost.Hostname(%q)", string(h)) +} + +// normalizePortPortion attempts to normalize the "port portion" of a hostname, +// which begins with the first colon in the hostname and should be followed +// by a string of decimal digits. +// +// If the port portion is valid, a normalized version of it is returned along +// with a nil error. +// +// If the port portion is invalid, the input string is returned verbatim along +// with a non-nil error. +// +// An empty string is a valid port portion representing the absence of a port. +// If non-empty, the first character must be a colon. +func normalizePortPortion(s string) (string, error) { + if s == "" { + return s, nil + } + + if s[0] != ':' { + // should never happen, since caller tends to guarantee the presence + // of a colon due to how it's extracted from the string. + return s, errors.New("port portion is missing its initial colon") + } + + numStr := s[1:] + num, err := strconv.Atoi(numStr) + if err != nil { + return s, errors.New("port portion contains non-digit characters") + } + if num == 443 { + return "", nil // ":443" is the default + } + if num > 65535 { + return s, errors.New("port number is greater than 65535") + } + return fmt.Sprintf(":%d", num), nil +} diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/.gitignore b/ibm/vendor/github.com/jstemmer/go-junit-report/.gitignore deleted file mode 100644 index 720bda6070..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/.gitignore +++ /dev/null @@ -1 +0,0 @@ -go-junit-report diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/.travis.yml b/ibm/vendor/github.com/jstemmer/go-junit-report/.travis.yml deleted file mode 100644 index d0dff3ef8e..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go - -go: - - tip - - "1.13.x" - - "1.12.x" - - "1.11.x" - - "1.10.x" - - "1.9.x" - - "1.8.x" - - "1.7.x" - - "1.6.x" - - "1.5.x" - - "1.4.x" - - "1.3.x" - - "1.2.x" diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/LICENSE b/ibm/vendor/github.com/jstemmer/go-junit-report/LICENSE deleted file mode 100644 index f346564cef..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2012 Joel Stemmer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/README.md b/ibm/vendor/github.com/jstemmer/go-junit-report/README.md deleted file mode 100644 index 5b5f608be3..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# go-junit-report - -Converts `go test` output to an xml report, suitable for applications that -expect junit xml reports (e.g. [Jenkins](http://jenkins-ci.org)). - -[![Build Status][travis-badge]][travis-link] -[![Report Card][report-badge]][report-link] - -## Installation - -Go version 1.2 or higher is required. Install or update using the `go get` -command: - -```bash -go get -u github.com/jstemmer/go-junit-report -``` - -## Usage - -go-junit-report reads the `go test` verbose output from standard in and writes -junit compatible XML to standard out. - -```bash -go test -v 2>&1 | go-junit-report > report.xml -``` - -Note that it also can parse benchmark output with `-bench` flag: -```bash -go test -v -bench . -count 5 2>&1 | go-junit-report > report.xml -``` - -## Contribution - -Create an Issue and discuss the fix or feature, then fork the package. -Clone to github.com/jstemmer/go-junit-report. This is necessary because go import uses this path. -Fix or implement feature. Test and then commit change. -Specify #Issue and describe change in the commit message. -Create Pull Request. It can be merged by owner or administrator then. - -### Run Tests - -```bash -go test -``` - -[travis-badge]: https://travis-ci.org/jstemmer/go-junit-report.svg -[travis-link]: https://travis-ci.org/jstemmer/go-junit-report -[report-badge]: https://goreportcard.com/badge/github.com/jstemmer/go-junit-report -[report-link]: https://goreportcard.com/report/github.com/jstemmer/go-junit-report diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/formatter/formatter.go b/ibm/vendor/github.com/jstemmer/go-junit-report/formatter/formatter.go deleted file mode 100644 index 6e1a0f31d6..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/formatter/formatter.go +++ /dev/null @@ -1,182 +0,0 @@ -package formatter - -import ( - "bufio" - "encoding/xml" - "fmt" - "io" - "runtime" - "strings" - "time" - - "github.com/jstemmer/go-junit-report/parser" -) - -// JUnitTestSuites is a collection of JUnit test suites. -type JUnitTestSuites struct { - XMLName xml.Name `xml:"testsuites"` - Suites []JUnitTestSuite `xml:"testsuite"` -} - -// JUnitTestSuite is a single JUnit test suite which may contain many -// testcases. -type JUnitTestSuite struct { - XMLName xml.Name `xml:"testsuite"` - Tests int `xml:"tests,attr"` - Failures int `xml:"failures,attr"` - Time string `xml:"time,attr"` - Name string `xml:"name,attr"` - Properties []JUnitProperty `xml:"properties>property,omitempty"` - TestCases []JUnitTestCase `xml:"testcase"` -} - -// JUnitTestCase is a single test case with its result. -type JUnitTestCase struct { - XMLName xml.Name `xml:"testcase"` - Classname string `xml:"classname,attr"` - Name string `xml:"name,attr"` - Time string `xml:"time,attr"` - SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"` - Failure *JUnitFailure `xml:"failure,omitempty"` -} - -// JUnitSkipMessage contains the reason why a testcase was skipped. -type JUnitSkipMessage struct { - Message string `xml:"message,attr"` -} - -// JUnitProperty represents a key/value pair used to define properties. -type JUnitProperty struct { - Name string `xml:"name,attr"` - Value string `xml:"value,attr"` -} - -// JUnitFailure contains data related to a failed test. -type JUnitFailure struct { - Message string `xml:"message,attr"` - Type string `xml:"type,attr"` - Contents string `xml:",chardata"` -} - -// JUnitReportXML writes a JUnit xml representation of the given report to w -// in the format described at http://windyroad.org/dl/Open%20Source/JUnit.xsd -func JUnitReportXML(report *parser.Report, noXMLHeader bool, goVersion string, w io.Writer) error { - suites := JUnitTestSuites{} - - // convert Report to JUnit test suites - for _, pkg := range report.Packages { - pkg.Benchmarks = mergeBenchmarks(pkg.Benchmarks) - ts := JUnitTestSuite{ - Tests: len(pkg.Tests) + len(pkg.Benchmarks), - Failures: 0, - Time: formatTime(pkg.Duration), - Name: pkg.Name, - Properties: []JUnitProperty{}, - TestCases: []JUnitTestCase{}, - } - - classname := pkg.Name - if idx := strings.LastIndex(classname, "/"); idx > -1 && idx < len(pkg.Name) { - classname = pkg.Name[idx+1:] - } - - // properties - if goVersion == "" { - // if goVersion was not specified as a flag, fall back to version reported by runtime - goVersion = runtime.Version() - } - ts.Properties = append(ts.Properties, JUnitProperty{"go.version", goVersion}) - if pkg.CoveragePct != "" { - ts.Properties = append(ts.Properties, JUnitProperty{"coverage.statements.pct", pkg.CoveragePct}) - } - - // individual test cases - for _, test := range pkg.Tests { - testCase := JUnitTestCase{ - Classname: classname, - Name: test.Name, - Time: formatTime(test.Duration), - Failure: nil, - } - - if test.Result == parser.FAIL { - ts.Failures++ - testCase.Failure = &JUnitFailure{ - Message: "Failed", - Type: "", - Contents: strings.Join(test.Output, "\n"), - } - } - - if test.Result == parser.SKIP { - testCase.SkipMessage = &JUnitSkipMessage{strings.Join(test.Output, "\n")} - } - - ts.TestCases = append(ts.TestCases, testCase) - } - - // individual benchmarks - for _, benchmark := range pkg.Benchmarks { - benchmarkCase := JUnitTestCase{ - Classname: classname, - Name: benchmark.Name, - Time: formatBenchmarkTime(benchmark.Duration), - } - - ts.TestCases = append(ts.TestCases, benchmarkCase) - } - - suites.Suites = append(suites.Suites, ts) - } - - // to xml - bytes, err := xml.MarshalIndent(suites, "", "\t") - if err != nil { - return err - } - - writer := bufio.NewWriter(w) - - if !noXMLHeader { - writer.WriteString(xml.Header) - } - - writer.Write(bytes) - writer.WriteByte('\n') - writer.Flush() - - return nil -} - -func mergeBenchmarks(benchmarks []*parser.Benchmark) []*parser.Benchmark { - var merged []*parser.Benchmark - benchmap := make(map[string][]*parser.Benchmark) - for _, bm := range benchmarks { - if _, ok := benchmap[bm.Name]; !ok { - merged = append(merged, &parser.Benchmark{Name: bm.Name}) - } - benchmap[bm.Name] = append(benchmap[bm.Name], bm) - } - - for _, bm := range merged { - for _, b := range benchmap[bm.Name] { - bm.Allocs += b.Allocs - bm.Bytes += b.Bytes - bm.Duration += b.Duration - } - n := len(benchmap[bm.Name]) - bm.Allocs /= n - bm.Bytes /= n - bm.Duration /= time.Duration(n) - } - - return merged -} - -func formatTime(d time.Duration) string { - return fmt.Sprintf("%.3f", d.Seconds()) -} - -func formatBenchmarkTime(d time.Duration) string { - return fmt.Sprintf("%.9f", d.Seconds()) -} diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/go-junit-report.go b/ibm/vendor/github.com/jstemmer/go-junit-report/go-junit-report.go deleted file mode 100644 index 1332f3b65b..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/go-junit-report.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/jstemmer/go-junit-report/formatter" - "github.com/jstemmer/go-junit-report/parser" -) - -var ( - noXMLHeader = flag.Bool("no-xml-header", false, "do not print xml header") - packageName = flag.String("package-name", "", "specify a package name (compiled test have no package name in output)") - goVersionFlag = flag.String("go-version", "", "specify the value to use for the go.version property in the generated XML") - setExitCode = flag.Bool("set-exit-code", false, "set exit code to 1 if tests failed") -) - -func main() { - flag.Parse() - - if flag.NArg() != 0 { - fmt.Fprintf(os.Stderr, "%s does not accept positional arguments\n", os.Args[0]) - flag.Usage() - os.Exit(1) - } - - // Read input - report, err := parser.Parse(os.Stdin, *packageName) - if err != nil { - fmt.Printf("Error reading input: %s\n", err) - os.Exit(1) - } - - // Write xml - err = formatter.JUnitReportXML(report, *noXMLHeader, *goVersionFlag, os.Stdout) - if err != nil { - fmt.Printf("Error writing XML: %s\n", err) - os.Exit(1) - } - - if *setExitCode && report.Failures() > 0 { - os.Exit(1) - } -} diff --git a/ibm/vendor/github.com/jstemmer/go-junit-report/parser/parser.go b/ibm/vendor/github.com/jstemmer/go-junit-report/parser/parser.go deleted file mode 100644 index e268128a2d..0000000000 --- a/ibm/vendor/github.com/jstemmer/go-junit-report/parser/parser.go +++ /dev/null @@ -1,319 +0,0 @@ -package parser - -import ( - "bufio" - "io" - "regexp" - "strconv" - "strings" - "time" -) - -// Result represents a test result. -type Result int - -// Test result constants -const ( - PASS Result = iota - FAIL - SKIP -) - -// Report is a collection of package tests. -type Report struct { - Packages []Package -} - -// Package contains the test results of a single package. -type Package struct { - Name string - Duration time.Duration - Tests []*Test - Benchmarks []*Benchmark - CoveragePct string - - // Time is deprecated, use Duration instead. - Time int // in milliseconds -} - -// Test contains the results of a single test. -type Test struct { - Name string - Duration time.Duration - Result Result - Output []string - - SubtestIndent string - - // Time is deprecated, use Duration instead. - Time int // in milliseconds -} - -// Benchmark contains the results of a single benchmark. -type Benchmark struct { - Name string - Duration time.Duration - // number of B/op - Bytes int - // number of allocs/op - Allocs int -} - -var ( - regexStatus = regexp.MustCompile(`--- (PASS|FAIL|SKIP): (.+) \((\d+\.\d+)(?: seconds|s)\)`) - regexIndent = regexp.MustCompile(`^([ \t]+)---`) - regexCoverage = regexp.MustCompile(`^coverage:\s+(\d+\.\d+)%\s+of\s+statements(?:\sin\s.+)?$`) - regexResult = regexp.MustCompile(`^(ok|FAIL)\s+([^ ]+)\s+(?:(\d+\.\d+)s|\(cached\)|(\[\w+ failed]))(?:\s+coverage:\s+(\d+\.\d+)%\sof\sstatements(?:\sin\s.+)?)?$`) - // regexBenchmark captures 3-5 groups: benchmark name, number of times ran, ns/op (with or without decimal), B/op (optional), and allocs/op (optional). - regexBenchmark = regexp.MustCompile(`^(Benchmark[^ -]+)(?:-\d+\s+|\s+)(\d+)\s+(\d+|\d+\.\d+)\sns/op(?:\s+(\d+)\sB/op)?(?:\s+(\d+)\sallocs/op)?`) - regexOutput = regexp.MustCompile(`( )*\t(.*)`) - regexSummary = regexp.MustCompile(`^(PASS|FAIL|SKIP)$`) - regexPackageWithTest = regexp.MustCompile(`^# ([^\[\]]+) \[[^\]]+\]$`) -) - -// Parse parses go test output from reader r and returns a report with the -// results. An optional pkgName can be given, which is used in case a package -// result line is missing. -func Parse(r io.Reader, pkgName string) (*Report, error) { - reader := bufio.NewReader(r) - - report := &Report{make([]Package, 0)} - - // keep track of tests we find - var tests []*Test - - // keep track of benchmarks we find - var benchmarks []*Benchmark - - // sum of tests' time, use this if current test has no result line (when it is compiled test) - var testsTime time.Duration - - // current test - var cur string - - // coverage percentage report for current package - var coveragePct string - - // stores mapping between package name and output of build failures - var packageCaptures = map[string][]string{} - - // the name of the package which it's build failure output is being captured - var capturedPackage string - - // capture any non-test output - var buffers = map[string][]string{} - - // parse lines - for { - l, _, err := reader.ReadLine() - if err != nil && err == io.EOF { - break - } else if err != nil { - return nil, err - } - - line := string(l) - - if strings.HasPrefix(line, "=== RUN ") { - // new test - cur = strings.TrimSpace(line[8:]) - tests = append(tests, &Test{ - Name: cur, - Result: FAIL, - Output: make([]string, 0), - }) - - // clear the current build package, so output lines won't be added to that build - capturedPackage = "" - } else if matches := regexBenchmark.FindStringSubmatch(line); len(matches) == 6 { - bytes, _ := strconv.Atoi(matches[4]) - allocs, _ := strconv.Atoi(matches[5]) - - benchmarks = append(benchmarks, &Benchmark{ - Name: matches[1], - Duration: parseNanoseconds(matches[3]), - Bytes: bytes, - Allocs: allocs, - }) - } else if strings.HasPrefix(line, "=== PAUSE ") { - continue - } else if strings.HasPrefix(line, "=== CONT ") { - cur = strings.TrimSpace(line[8:]) - continue - } else if matches := regexResult.FindStringSubmatch(line); len(matches) == 6 { - if matches[5] != "" { - coveragePct = matches[5] - } - if strings.HasSuffix(matches[4], "failed]") { - // the build of the package failed, inject a dummy test into the package - // which indicate about the failure and contain the failure description. - tests = append(tests, &Test{ - Name: matches[4], - Result: FAIL, - Output: packageCaptures[matches[2]], - }) - } else if matches[1] == "FAIL" && !containsFailures(tests) && len(buffers[cur]) > 0 { - // This package didn't have any failing tests, but still it - // failed with some output. Create a dummy test with the - // output. - tests = append(tests, &Test{ - Name: "Failure", - Result: FAIL, - Output: buffers[cur], - }) - buffers[cur] = buffers[cur][0:0] - } - - // all tests in this package are finished - report.Packages = append(report.Packages, Package{ - Name: matches[2], - Duration: parseSeconds(matches[3]), - Tests: tests, - Benchmarks: benchmarks, - CoveragePct: coveragePct, - - Time: int(parseSeconds(matches[3]) / time.Millisecond), // deprecated - }) - - buffers[cur] = buffers[cur][0:0] - tests = make([]*Test, 0) - benchmarks = make([]*Benchmark, 0) - coveragePct = "" - cur = "" - testsTime = 0 - } else if matches := regexStatus.FindStringSubmatch(line); len(matches) == 4 { - cur = matches[2] - test := findTest(tests, cur) - if test == nil { - continue - } - - // test status - if matches[1] == "PASS" { - test.Result = PASS - } else if matches[1] == "SKIP" { - test.Result = SKIP - } else { - test.Result = FAIL - } - - if matches := regexIndent.FindStringSubmatch(line); len(matches) == 2 { - test.SubtestIndent = matches[1] - } - - test.Output = buffers[cur] - - test.Name = matches[2] - test.Duration = parseSeconds(matches[3]) - testsTime += test.Duration - - test.Time = int(test.Duration / time.Millisecond) // deprecated - } else if matches := regexCoverage.FindStringSubmatch(line); len(matches) == 2 { - coveragePct = matches[1] - } else if matches := regexOutput.FindStringSubmatch(line); capturedPackage == "" && len(matches) == 3 { - // Sub-tests start with one or more series of 4-space indents, followed by a hard tab, - // followed by the test output - // Top-level tests start with a hard tab. - test := findTest(tests, cur) - if test == nil { - continue - } - test.Output = append(test.Output, matches[2]) - } else if strings.HasPrefix(line, "# ") { - // indicates a capture of build output of a package. set the current build package. - packageWithTestBinary := regexPackageWithTest.FindStringSubmatch(line) - if packageWithTestBinary != nil { - // Sometimes, the text after "# " shows the name of the test binary - // (".test") in addition to the package - // e.g.: "# package/name [package/name.test]" - capturedPackage = packageWithTestBinary[1] - } else { - capturedPackage = line[2:] - } - } else if capturedPackage != "" { - // current line is build failure capture for the current built package - packageCaptures[capturedPackage] = append(packageCaptures[capturedPackage], line) - } else if regexSummary.MatchString(line) { - // unset current test name so any additional output after the - // summary is captured separately. - cur = "" - } else { - // buffer anything else that we didn't recognize - buffers[cur] = append(buffers[cur], line) - - // if we have a current test, also append to its output - test := findTest(tests, cur) - if test != nil { - if strings.HasPrefix(line, test.SubtestIndent+" ") { - test.Output = append(test.Output, strings.TrimPrefix(line, test.SubtestIndent+" ")) - } - } - } - } - - if len(tests) > 0 { - // no result line found - report.Packages = append(report.Packages, Package{ - Name: pkgName, - Duration: testsTime, - Time: int(testsTime / time.Millisecond), - Tests: tests, - Benchmarks: benchmarks, - CoveragePct: coveragePct, - }) - } - - return report, nil -} - -func parseSeconds(t string) time.Duration { - if t == "" { - return time.Duration(0) - } - // ignore error - d, _ := time.ParseDuration(t + "s") - return d -} - -func parseNanoseconds(t string) time.Duration { - // note: if input < 1 ns precision, result will be 0s. - if t == "" { - return time.Duration(0) - } - // ignore error - d, _ := time.ParseDuration(t + "ns") - return d -} - -func findTest(tests []*Test, name string) *Test { - for i := len(tests) - 1; i >= 0; i-- { - if tests[i].Name == name { - return tests[i] - } - } - return nil -} - -func containsFailures(tests []*Test) bool { - for _, test := range tests { - if test.Result == FAIL { - return true - } - } - return false -} - -// Failures counts the number of failed tests in this report -func (r *Report) Failures() int { - count := 0 - - for _, p := range r.Packages { - for _, t := range p.Tests { - if t.Result == FAIL { - count++ - } - } - } - - return count -} diff --git a/ibm/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/ibm/vendor/github.com/mailru/easyjson/jlexer/lexer.go index a42e9d65ad..b5f5e26132 100644 --- a/ibm/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ b/ibm/vendor/github.com/mailru/easyjson/jlexer/lexer.go @@ -401,6 +401,7 @@ func (r *Lexer) scanToken() { // consume resets the current token to allow scanning the next one. func (r *Lexer) consume() { r.token.kind = tokenUndef + r.token.byteValueCloned = false r.token.delimValue = 0 } @@ -528,6 +529,7 @@ func (r *Lexer) Skip() { func (r *Lexer) SkipRecursive() { r.scanToken() var start, end byte + startPos := r.start switch r.token.delimValue { case '{': @@ -553,6 +555,14 @@ func (r *Lexer) SkipRecursive() { level-- if level == 0 { r.pos += i + 1 + if !json.Valid(r.Data[startPos:r.pos]) { + r.pos = len(r.Data) + r.fatalError = &LexerError{ + Reason: "skipped array/object json value is invalid", + Offset: r.pos, + Data: string(r.Data[r.pos:]), + } + } return } case c == '\\' && inQuotes: @@ -702,6 +712,10 @@ func (r *Lexer) Bytes() []byte { r.errInvalidToken("string") return nil } + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return nil + } ret := make([]byte, base64.StdEncoding.DecodedLen(len(r.token.byteValue))) n, err := base64.StdEncoding.Decode(ret, r.token.byteValue) if err != nil { diff --git a/ibm/vendor/github.com/mitchellh/go-testing-interface/.travis.yml b/ibm/vendor/github.com/mitchellh/go-testing-interface/.travis.yml index 928d000ec4..cca949103a 100644 --- a/ibm/vendor/github.com/mitchellh/go-testing-interface/.travis.yml +++ b/ibm/vendor/github.com/mitchellh/go-testing-interface/.travis.yml @@ -1,7 +1,6 @@ language: go go: - - 1.8 - 1.x - tip diff --git a/ibm/vendor/github.com/mitchellh/go-testing-interface/README.md b/ibm/vendor/github.com/mitchellh/go-testing-interface/README.md index 26781bbae8..ee435adc54 100644 --- a/ibm/vendor/github.com/mitchellh/go-testing-interface/README.md +++ b/ibm/vendor/github.com/mitchellh/go-testing-interface/README.md @@ -38,6 +38,14 @@ You can also call the test helper at runtime if needed: TestHelper(&testing.RuntimeT{}) } +## Versioning + +The tagged version matches the version of Go that the interface is +compatible with. For example, the version "1.14.0" is for Go 1.14 and +introduced the `Cleanup` function. The patch version (the ".0" in the +prior example) is used to fix any bugs found in this library and has no +correlation to the supported Go version. + ## Why?! **Why would I call a test helper that takes a *testing.T at runtime?** diff --git a/ibm/vendor/github.com/mitchellh/go-testing-interface/testing.go b/ibm/vendor/github.com/mitchellh/go-testing-interface/testing.go index b05a49a690..86510322ab 100644 --- a/ibm/vendor/github.com/mitchellh/go-testing-interface/testing.go +++ b/ibm/vendor/github.com/mitchellh/go-testing-interface/testing.go @@ -1,5 +1,3 @@ -// +build !go1.9 - package testing import ( @@ -12,6 +10,7 @@ import ( // In unit tests you can just pass a *testing.T struct. At runtime, outside // of tests, you can pass in a RuntimeT struct from this package. type T interface { + Cleanup(func()) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fail() @@ -19,6 +18,7 @@ type T interface { Failed() bool Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) + Helper() Log(args ...interface{}) Logf(format string, args ...interface{}) Name() string @@ -34,10 +34,13 @@ type T interface { // for calls to Fatal. For calls to Error, you'll have to check the errors // list to determine whether to exit yourself. // +// Cleanup does NOT work, so if you're using a helper that uses Cleanup, +// there may be dangling resources. +// // Parallel does not do anything. type RuntimeT struct { - failed bool skipped bool + failed bool } func (t *RuntimeT) Error(args ...interface{}) { @@ -46,20 +49,10 @@ func (t *RuntimeT) Error(args ...interface{}) { } func (t *RuntimeT) Errorf(format string, args ...interface{}) { - log.Println(fmt.Sprintf(format, args...)) + log.Printf(format, args...) t.Fail() } -func (t *RuntimeT) Fatal(args ...interface{}) { - log.Println(fmt.Sprintln(args...)) - t.FailNow() -} - -func (t *RuntimeT) Fatalf(format string, args ...interface{}) { - log.Println(fmt.Sprintf(format, args...)) - t.FailNow() -} - func (t *RuntimeT) Fail() { t.failed = true } @@ -72,6 +65,16 @@ func (t *RuntimeT) Failed() bool { return t.failed } +func (t *RuntimeT) Fatal(args ...interface{}) { + log.Print(args...) + t.FailNow() +} + +func (t *RuntimeT) Fatalf(format string, args ...interface{}) { + log.Printf(format, args...) + t.FailNow() +} + func (t *RuntimeT) Log(args ...interface{}) { log.Println(fmt.Sprintln(args...)) } @@ -103,3 +106,7 @@ func (t *RuntimeT) Skipf(format string, args ...interface{}) { func (t *RuntimeT) Skipped() bool { return t.skipped } + +func (t *RuntimeT) Helper() {} + +func (t *RuntimeT) Cleanup(func()) {} diff --git a/ibm/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go b/ibm/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go deleted file mode 100644 index f09c066a42..0000000000 --- a/ibm/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go +++ /dev/null @@ -1,113 +0,0 @@ -// +build go1.9 - -// NOTE: This is a temporary copy of testing.go for Go 1.9 with the addition -// of "Helper" to the T interface. Go 1.9 at the time of typing is in RC -// and is set for release shortly. We'll support this on master as the default -// as soon as 1.9 is released. - -package testing - -import ( - "fmt" - "log" -) - -// T is the interface that mimics the standard library *testing.T. -// -// In unit tests you can just pass a *testing.T struct. At runtime, outside -// of tests, you can pass in a RuntimeT struct from this package. -type T interface { - Error(args ...interface{}) - Errorf(format string, args ...interface{}) - Fail() - FailNow() - Failed() bool - Fatal(args ...interface{}) - Fatalf(format string, args ...interface{}) - Log(args ...interface{}) - Logf(format string, args ...interface{}) - Name() string - Parallel() - Skip(args ...interface{}) - SkipNow() - Skipf(format string, args ...interface{}) - Skipped() bool - Helper() -} - -// RuntimeT implements T and can be instantiated and run at runtime to -// mimic *testing.T behavior. Unlike *testing.T, this will simply panic -// for calls to Fatal. For calls to Error, you'll have to check the errors -// list to determine whether to exit yourself. -// -// Parallel does not do anything. -type RuntimeT struct { - failed bool - skipped bool -} - -func (t *RuntimeT) Error(args ...interface{}) { - log.Println(fmt.Sprintln(args...)) - t.Fail() -} - -func (t *RuntimeT) Errorf(format string, args ...interface{}) { - log.Printf(format, args...) - t.Fail() -} - -func (t *RuntimeT) Fail() { - t.failed = true -} - -func (t *RuntimeT) FailNow() { - panic("testing.T failed, see logs for output (if any)") -} - -func (t *RuntimeT) Failed() bool { - return t.failed -} - -func (t *RuntimeT) Fatal(args ...interface{}) { - log.Print(args...) - t.FailNow() -} - -func (t *RuntimeT) Fatalf(format string, args ...interface{}) { - log.Printf(format, args...) - t.FailNow() -} - -func (t *RuntimeT) Log(args ...interface{}) { - log.Println(fmt.Sprintln(args...)) -} - -func (t *RuntimeT) Logf(format string, args ...interface{}) { - log.Println(fmt.Sprintf(format, args...)) -} - -func (t *RuntimeT) Name() string { - return "" -} - -func (t *RuntimeT) Parallel() {} - -func (t *RuntimeT) Skip(args ...interface{}) { - log.Print(args...) - t.SkipNow() -} - -func (t *RuntimeT) SkipNow() { - t.skipped = true -} - -func (t *RuntimeT) Skipf(format string, args ...interface{}) { - log.Printf(format, args...) - t.SkipNow() -} - -func (t *RuntimeT) Skipped() bool { - return t.skipped -} - -func (t *RuntimeT) Helper() {} diff --git a/ibm/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md b/ibm/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md index 1955f2878c..38a099162c 100644 --- a/ibm/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md +++ b/ibm/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md @@ -1,6 +1,16 @@ -## unreleased +## 1.4.3 -* Fix regression where `*time.Time` value would be set to empty and not be sent +* Fix cases where `json.Number` didn't decode properly [GH-261] + +## 1.4.2 + +* Custom name matchers to support any sort of casing, formatting, etc. for + field names. [GH-250] +* Fix possible panic in ComposeDecodeHookFunc [GH-251] + +## 1.4.1 + +* Fix regression where `*time.Time` value would be set to empty and not be sent to decode hooks properly [GH-232] ## 1.4.0 diff --git a/ibm/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/ibm/vendor/github.com/mitchellh/mapstructure/decode_hooks.go index 92e6f76fff..4d4bbc733b 100644 --- a/ibm/vendor/github.com/mitchellh/mapstructure/decode_hooks.go +++ b/ibm/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -62,7 +62,8 @@ func DecodeHookExec( func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { return func(f reflect.Value, t reflect.Value) (interface{}, error) { var err error - var data interface{} + data := f.Interface() + newFrom := f for _, f1 := range fs { data, err = DecodeHookExec(f1, newFrom, t) diff --git a/ibm/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/ibm/vendor/github.com/mitchellh/mapstructure/mapstructure.go index 3643901f55..6b81b00679 100644 --- a/ibm/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/ibm/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -192,7 +192,7 @@ type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface // source and target types. type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) -// DecodeHookFuncRaw is a DecodeHookFunc which has complete access to both the source and target +// DecodeHookFuncValue is a DecodeHookFunc which has complete access to both the source and target // values. type DecodeHookFuncValue func(from reflect.Value, to reflect.Value) (interface{}, error) @@ -258,6 +258,11 @@ type DecoderConfig struct { // The tag name that mapstructure reads for field names. This // defaults to "mapstructure" TagName string + + // MatchName is the function used to match the map key to the struct + // field name or tag. Defaults to `strings.EqualFold`. This can be used + // to implement case-sensitive tag values, support snake casing, etc. + MatchName func(mapKey, fieldName string) bool } // A Decoder takes a raw interface value and turns it into structured @@ -376,6 +381,10 @@ func NewDecoder(config *DecoderConfig) (*Decoder, error) { config.TagName = "mapstructure" } + if config.MatchName == nil { + config.MatchName = strings.EqualFold + } + result := &Decoder{ config: config, } @@ -675,16 +684,12 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": jn := data.(json.Number) - i, err := jn.Int64() + i, err := strconv.ParseUint(string(jn), 0, 64) if err != nil { return fmt.Errorf( "error decoding json.Number into %s: %s", name, err) } - if i < 0 && !d.config.WeaklyTypedInput { - return fmt.Errorf("cannot parse '%s', %d overflows uint", - name, i) - } - val.SetUint(uint64(i)) + val.SetUint(i) default: return fmt.Errorf( "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", @@ -1340,7 +1345,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e continue } - if strings.EqualFold(mK, fieldName) { + if d.config.MatchName(mK, fieldName) { rawMapKey = dataValKey rawMapVal = dataVal.MapIndex(dataValKey) break diff --git a/ibm/vendor/github.com/ulikunitz/xz/.gitignore b/ibm/vendor/github.com/ulikunitz/xz/.gitignore deleted file mode 100644 index e3c2fc2f1d..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# .gitignore - -TODO.html -README.html - -lzma/writer.txt -lzma/reader.txt - -cmd/gxz/gxz -cmd/xb/xb - -# test executables -*.test - -# profile files -*.out - -# vim swap file -.*.swp - -# executables on windows -*.exe - -# default compression test file -enwik8* diff --git a/ibm/vendor/github.com/ulikunitz/xz/LICENSE b/ibm/vendor/github.com/ulikunitz/xz/LICENSE deleted file mode 100644 index d32149979d..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2014-2020 Ulrich Kunitz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* My name, Ulrich Kunitz, may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/github.com/ulikunitz/xz/README.md b/ibm/vendor/github.com/ulikunitz/xz/README.md deleted file mode 100644 index 0a2dc8284f..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Package xz - -This Go language package supports the reading and writing of xz -compressed streams. It includes also a gxz command for compressing and -decompressing data. The package is completely written in Go and doesn't -have any dependency on any C code. - -The package is currently under development. There might be bugs and APIs -are not considered stable. At this time the package cannot compete with -the xz tool regarding compression speed and size. The algorithms there -have been developed over a long time and are highly optimized. However -there are a number of improvements planned and I'm very optimistic about -parallel compression and decompression. Stay tuned! - -## Using the API - -The following example program shows how to use the API. - -```go -package main - -import ( - "bytes" - "io" - "log" - "os" - - "github.com/ulikunitz/xz" -) - -func main() { - const text = "The quick brown fox jumps over the lazy dog.\n" - var buf bytes.Buffer - // compress text - w, err := xz.NewWriter(&buf) - if err != nil { - log.Fatalf("xz.NewWriter error %s", err) - } - if _, err := io.WriteString(w, text); err != nil { - log.Fatalf("WriteString error %s", err) - } - if err := w.Close(); err != nil { - log.Fatalf("w.Close error %s", err) - } - // decompress buffer and write output to stdout - r, err := xz.NewReader(&buf) - if err != nil { - log.Fatalf("NewReader error %s", err) - } - if _, err = io.Copy(os.Stdout, r); err != nil { - log.Fatalf("io.Copy error %s", err) - } -} -``` - -## Using the gxz compression tool - -The package includes a gxz command line utility for compression and -decompression. - -Use following command for installation: - - $ go get github.com/ulikunitz/xz/cmd/gxz - -To test it call the following command. - - $ gxz bigfile - -After some time a much smaller file bigfile.xz will replace bigfile. -To decompress it use the following command. - - $ gxz -d bigfile.xz - diff --git a/ibm/vendor/github.com/ulikunitz/xz/TODO.md b/ibm/vendor/github.com/ulikunitz/xz/TODO.md deleted file mode 100644 index 84bd5dcbdc..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/TODO.md +++ /dev/null @@ -1,337 +0,0 @@ -# TODO list - -## Release v0.5.x - -1. Support check flag in gxz command. - -## Release v0.6 - -1. Review encoder and check for lzma improvements under xz. -2. Fix binary tree matcher. -3. Compare compression ratio with xz tool using comparable parameters - and optimize parameters -4. Do some optimizations - - rename operation action and make it a simple type of size 8 - - make maxMatches, wordSize parameters - - stop searching after a certain length is found (parameter sweetLen) - -## Release v0.7 - -1. Optimize code -2. Do statistical analysis to get linear presets. -3. Test sync.Pool compatability for xz and lzma Writer and Reader -3. Fuzz optimized code. - -## Release v0.8 - -1. Support parallel go routines for writing and reading xz files. -2. Support a ReaderAt interface for xz files with small block sizes. -3. Improve compatibility between gxz and xz -4. Provide manual page for gxz - -## Release v0.9 - -1. Improve documentation -2. Fuzz again - -## Release v1.0 - -1. Full functioning gxz -2. Add godoc URL to README.md (godoc.org) -3. Resolve all issues. -4. Define release candidates. -5. Public announcement. - -## Package lzma - -### Release v0.6 - -- Rewrite Encoder into a simple greedy one-op-at-a-time encoder - including - + simple scan at the dictionary head for the same byte - + use the killer byte (requiring matches to get longer, the first - test should be the byte that would make the match longer) - - -## Optimizations - -- There may be a lot of false sharing in lzma.State; check whether this - can be improved by reorganizing the internal structure of it. -- Check whether batching encoding and decoding improves speed. - -### DAG optimizations - -- Use full buffer to create minimal bit-length above range encoder. -- Might be too slow (see v0.4) - -### Different match finders - -- hashes with 2, 3 characters additional to 4 characters -- binary trees with 2-7 characters (uint64 as key, use uint32 as - pointers into a an array) -- rb-trees with 2-7 characters (uint64 as key, use uint32 as pointers - into an array with bit-steeling for the colors) - -## Release Procedure - -- execute goch -l for all packages; probably with lower param like 0.5. -- check orthography with gospell -- Write release notes in doc/relnotes. -- Update README.md -- xb copyright . in xz directory to ensure all new files have Copyright - header -- VERSION= go generate github.com/ulikunitz/xz/... to update - version files -- Execute test for Linux/amd64, Linux/x86 and Windows/amd64. -- Update TODO.md - write short log entry -- git checkout master && git merge dev -- git tag -a -- git push - -## Log - -## 2020-08-19 - -Release v0.5.8 fixes issue -[issue #35](https://github.com/ulikunitz/xz/issues/35). - -### 2020-02-24 - -Release v0.5.7 supports the check-ID None and fixes -[issue #27](https://github.com/ulikunitz/xz/issues/27). - -### 2019-02-20 - -Release v0.5.6 supports the go.mod file. - -### 2018-10-28 - -Release v0.5.5 fixes issues #19 observing ErrLimit outputs. - -### 2017-06-05 - -Release v0.5.4 fixes issues #15 of another problem with the padding size -check for the xz block header. I removed the check completely. - -### 2017-02-15 - -Release v0.5.3 fixes issue #12 regarding the decompression of an empty -XZ stream. Many thanks to Tomasz Kłak, who reported the issue. - -### 2016-12-02 - -Release v0.5.2 became necessary to allow the decoding of xz files with -4-byte padding in the block header. Many thanks to Greg, who reported -the issue. - -### 2016-07-23 - -Release v0.5.1 became necessary to fix problems with 32-bit platforms. -Many thanks to Bruno Brigas, who reported the issue. - -### 2016-07-04 - -Release v0.5 provides improvements to the compressor and provides support for -the decompression of xz files with multiple xz streams. - -### 2016-01-31 - -Another compression rate increase by checking the byte at length of the -best match first, before checking the whole prefix. This makes the -compressor even faster. We have now a large time budget to beat the -compression ratio of the xz tool. For enwik8 we have now over 40 seconds -to reduce the compressed file size for another 7 MiB. - -### 2016-01-30 - -I simplified the encoder. Speed and compression rate increased -dramatically. A high compression rate affects also the decompression -speed. The approach with the buffer and optimizing for operation -compression rate has not been successful. Going for the maximum length -appears to be the best approach. - -### 2016-01-28 - -The release v0.4 is ready. It provides a working xz implementation, -which is rather slow, but works and is interoperable with the xz tool. -It is an important milestone. - -### 2016-01-10 - -I have the first working implementation of an xz reader and writer. I'm -happy about reaching this milestone. - -### 2015-12-02 - -I'm now ready to implement xz because, I have a working LZMA2 -implementation. I decided today that v0.4 will use the slow encoder -using the operations buffer to be able to go back, if I intend to do so. - -### 2015-10-21 - -I have restarted the work on the library. While trying to implement -LZMA2, I discovered that I need to resimplify the encoder and decoder -functions. The option approach is too complicated. Using a limited byte -writer and not caring for written bytes at all and not to try to handle -uncompressed data simplifies the LZMA encoder and decoder much. -Processing uncompressed data and handling limits is a feature of the -LZMA2 format not of LZMA. - -I learned an interesting method from the LZO format. If the last copy is -too far away they are moving the head one 2 bytes and not 1 byte to -reduce processing times. - -### 2015-08-26 - -I have now reimplemented the lzma package. The code is reasonably fast, -but can still be optimized. The next step is to implement LZMA2 and then -xz. - -### 2015-07-05 - -Created release v0.3. The version is the foundation for a full xz -implementation that is the target of v0.4. - -### 2015-06-11 - -The gflag package has been developed because I couldn't use flag and -pflag for a fully compatible support of gzip's and lzma's options. It -seems to work now quite nicely. - -### 2015-06-05 - -The overflow issue was interesting to research, however Henry S. Warren -Jr. Hacker's Delight book was very helpful as usual and had the issue -explained perfectly. Fefe's information on his website was based on the -C FAQ and quite bad, because it didn't address the issue of -MININT == -MININT. - -### 2015-06-04 - -It has been a productive day. I improved the interface of lzma.Reader -and lzma.Writer and fixed the error handling. - -### 2015-06-01 - -By computing the bit length of the LZMA operations I was able to -improve the greedy algorithm implementation. By using an 8 MByte buffer -the compression rate was not as good as for xz but already better then -gzip default. - -Compression is currently slow, but this is something we will be able to -improve over time. - -### 2015-05-26 - -Checked the license of ogier/pflag. The binary lzmago binary should -include the license terms for the pflag library. - -I added the endorsement clause as used by Google for the Go sources the -LICENSE file. - -### 2015-05-22 - -The package lzb contains now the basic implementation for creating or -reading LZMA byte streams. It allows the support for the implementation -of the DAG-shortest-path algorithm for the compression function. - -### 2015-04-23 - -Completed yesterday the lzbase classes. I'm a little bit concerned that -using the components may require too much code, but on the other hand -there is a lot of flexibility. - -### 2015-04-22 - -Implemented Reader and Writer during the Bayern game against Porto. The -second half gave me enough time. - -### 2015-04-21 - -While showering today morning I discovered that the design for OpEncoder -and OpDecoder doesn't work, because encoding/decoding might depend on -the current status of the dictionary. This is not exactly the right way -to start the day. - -Therefore we need to keep the Reader and Writer design. This time around -we simplify it by ignoring size limits. These can be added by wrappers -around the Reader and Writer interfaces. The Parameters type isn't -needed anymore. - -However I will implement a ReaderState and WriterState type to use -static typing to ensure the right State object is combined with the -right lzbase.Reader and lzbase.Writer. - -As a start I have implemented ReaderState and WriterState to ensure -that the state for reading is only used by readers and WriterState only -used by Writers. - -### 2015-04-20 - -Today I implemented the OpDecoder and tested OpEncoder and OpDecoder. - -### 2015-04-08 - -Came up with a new simplified design for lzbase. I implemented already -the type State that replaces OpCodec. - -### 2015-04-06 - -The new lzma package is now fully usable and lzmago is using it now. The -old lzma package has been completely removed. - -### 2015-04-05 - -Implemented lzma.Reader and tested it. - -### 2015-04-04 - -Implemented baseReader by adapting code form lzma.Reader. - -### 2015-04-03 - -The opCodec has been copied yesterday to lzma2. opCodec has a high -number of dependencies on other files in lzma2. Therefore I had to copy -almost all files from lzma. - -### 2015-03-31 - -Removed only a TODO item. - -However in Francesco Campoy's presentation "Go for Javaneros -(Javaïstes?)" is the the idea that using an embedded field E, all the -methods of E will be defined on T. If E is an interface T satisfies E. - -https://talks.golang.org/2014/go4java.slide#51 - -I have never used this, but it seems to be a cool idea. - -### 2015-03-30 - -Finished the type writerDict and wrote a simple test. - -### 2015-03-25 - -I started to implement the writerDict. - -### 2015-03-24 - -After thinking long about the LZMA2 code and several false starts, I -have now a plan to create a self-sufficient lzma2 package that supports -the classic LZMA format as well as LZMA2. The core idea is to support a -baseReader and baseWriter type that support the basic LZMA stream -without any headers. Both types must support the reuse of dictionaries -and the opCodec. - -### 2015-01-10 - -1. Implemented simple lzmago tool -2. Tested tool against large 4.4G file - - compression worked correctly; tested decompression with lzma - - decompression hits a full buffer condition -3. Fixed a bug in the compressor and wrote a test for it -4. Executed full cycle for 4.4 GB file; performance can be improved ;-) - -### 2015-01-11 - -- Release v0.2 because of the working LZMA encoder and decoder diff --git a/ibm/vendor/github.com/ulikunitz/xz/bits.go b/ibm/vendor/github.com/ulikunitz/xz/bits.go deleted file mode 100644 index dc8f328600..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/bits.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import ( - "errors" - "io" -) - -// putUint32LE puts the little-endian representation of x into the first -// four bytes of p. -func putUint32LE(p []byte, x uint32) { - p[0] = byte(x) - p[1] = byte(x >> 8) - p[2] = byte(x >> 16) - p[3] = byte(x >> 24) -} - -// putUint64LE puts the little-endian representation of x into the first -// eight bytes of p. -func putUint64LE(p []byte, x uint64) { - p[0] = byte(x) - p[1] = byte(x >> 8) - p[2] = byte(x >> 16) - p[3] = byte(x >> 24) - p[4] = byte(x >> 32) - p[5] = byte(x >> 40) - p[6] = byte(x >> 48) - p[7] = byte(x >> 56) -} - -// uint32LE converts a little endian representation to an uint32 value. -func uint32LE(p []byte) uint32 { - return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | - uint32(p[3])<<24 -} - -// putUvarint puts a uvarint representation of x into the byte slice. -func putUvarint(p []byte, x uint64) int { - i := 0 - for x >= 0x80 { - p[i] = byte(x) | 0x80 - x >>= 7 - i++ - } - p[i] = byte(x) - return i + 1 -} - -// errOverflow indicates an overflow of the 64-bit unsigned integer. -var errOverflowU64 = errors.New("xz: uvarint overflows 64-bit unsigned integer") - -// readUvarint reads a uvarint from the given byte reader. -func readUvarint(r io.ByteReader) (x uint64, n int, err error) { - const maxUvarintLen = 10 - - var s uint - i := 0 - for { - b, err := r.ReadByte() - if err != nil { - return x, i, err - } - i++ - if i > maxUvarintLen { - return x, i, errOverflowU64 - } - if b < 0x80 { - if i == maxUvarintLen && b > 1 { - return x, i, errOverflowU64 - } - return x | uint64(b)< 0 { - k = 4 - k - } - return k -} - -/*** Header ***/ - -// headerMagic stores the magic bytes for the header -var headerMagic = []byte{0xfd, '7', 'z', 'X', 'Z', 0x00} - -// HeaderLen provides the length of the xz file header. -const HeaderLen = 12 - -// Constants for the checksum methods supported by xz. -const ( - None byte = 0x0 - CRC32 = 0x1 - CRC64 = 0x4 - SHA256 = 0xa -) - -// errInvalidFlags indicates that flags are invalid. -var errInvalidFlags = errors.New("xz: invalid flags") - -// verifyFlags returns the error errInvalidFlags if the value is -// invalid. -func verifyFlags(flags byte) error { - switch flags { - case None, CRC32, CRC64, SHA256: - return nil - default: - return errInvalidFlags - } -} - -// flagstrings maps flag values to strings. -var flagstrings = map[byte]string{ - None: "None", - CRC32: "CRC-32", - CRC64: "CRC-64", - SHA256: "SHA-256", -} - -// flagString returns the string representation for the given flags. -func flagString(flags byte) string { - s, ok := flagstrings[flags] - if !ok { - return "invalid" - } - return s -} - -// newHashFunc returns a function that creates hash instances for the -// hash method encoded in flags. -func newHashFunc(flags byte) (newHash func() hash.Hash, err error) { - switch flags { - case None: - newHash = newNoneHash - case CRC32: - newHash = newCRC32 - case CRC64: - newHash = newCRC64 - case SHA256: - newHash = sha256.New - default: - err = errInvalidFlags - } - return -} - -// header provides the actual content of the xz file header: the flags. -type header struct { - flags byte -} - -// Errors returned by readHeader. -var errHeaderMagic = errors.New("xz: invalid header magic bytes") - -// ValidHeader checks whether data is a correct xz file header. The -// length of data must be HeaderLen. -func ValidHeader(data []byte) bool { - var h header - err := h.UnmarshalBinary(data) - return err == nil -} - -// String returns a string representation of the flags. -func (h header) String() string { - return flagString(h.flags) -} - -// UnmarshalBinary reads header from the provided data slice. -func (h *header) UnmarshalBinary(data []byte) error { - // header length - if len(data) != HeaderLen { - return errors.New("xz: wrong file header length") - } - - // magic header - if !bytes.Equal(headerMagic, data[:6]) { - return errHeaderMagic - } - - // checksum - crc := crc32.NewIEEE() - crc.Write(data[6:8]) - if uint32LE(data[8:]) != crc.Sum32() { - return errors.New("xz: invalid checksum for file header") - } - - // stream flags - if data[6] != 0 { - return errInvalidFlags - } - flags := data[7] - if err := verifyFlags(flags); err != nil { - return err - } - - h.flags = flags - return nil -} - -// MarshalBinary generates the xz file header. -func (h *header) MarshalBinary() (data []byte, err error) { - if err = verifyFlags(h.flags); err != nil { - return nil, err - } - - data = make([]byte, 12) - copy(data, headerMagic) - data[7] = h.flags - - crc := crc32.NewIEEE() - crc.Write(data[6:8]) - putUint32LE(data[8:], crc.Sum32()) - - return data, nil -} - -/*** Footer ***/ - -// footerLen defines the length of the footer. -const footerLen = 12 - -// footerMagic contains the footer magic bytes. -var footerMagic = []byte{'Y', 'Z'} - -// footer represents the content of the xz file footer. -type footer struct { - indexSize int64 - flags byte -} - -// String prints a string representation of the footer structure. -func (f footer) String() string { - return fmt.Sprintf("%s index size %d", flagString(f.flags), f.indexSize) -} - -// Minimum and maximum for the size of the index (backward size). -const ( - minIndexSize = 4 - maxIndexSize = (1 << 32) * 4 -) - -// MarshalBinary converts footer values into an xz file footer. Note -// that the footer value is checked for correctness. -func (f *footer) MarshalBinary() (data []byte, err error) { - if err = verifyFlags(f.flags); err != nil { - return nil, err - } - if !(minIndexSize <= f.indexSize && f.indexSize <= maxIndexSize) { - return nil, errors.New("xz: index size out of range") - } - if f.indexSize%4 != 0 { - return nil, errors.New( - "xz: index size not aligned to four bytes") - } - - data = make([]byte, footerLen) - - // backward size (index size) - s := (f.indexSize / 4) - 1 - putUint32LE(data[4:], uint32(s)) - // flags - data[9] = f.flags - // footer magic - copy(data[10:], footerMagic) - - // CRC-32 - crc := crc32.NewIEEE() - crc.Write(data[4:10]) - putUint32LE(data, crc.Sum32()) - - return data, nil -} - -// UnmarshalBinary sets the footer value by unmarshalling an xz file -// footer. -func (f *footer) UnmarshalBinary(data []byte) error { - if len(data) != footerLen { - return errors.New("xz: wrong footer length") - } - - // magic bytes - if !bytes.Equal(data[10:], footerMagic) { - return errors.New("xz: footer magic invalid") - } - - // CRC-32 - crc := crc32.NewIEEE() - crc.Write(data[4:10]) - if uint32LE(data) != crc.Sum32() { - return errors.New("xz: footer checksum error") - } - - var g footer - // backward size (index size) - g.indexSize = (int64(uint32LE(data[4:])) + 1) * 4 - - // flags - if data[8] != 0 { - return errInvalidFlags - } - g.flags = data[9] - if err := verifyFlags(g.flags); err != nil { - return err - } - - *f = g - return nil -} - -/*** Block Header ***/ - -// blockHeader represents the content of an xz block header. -type blockHeader struct { - compressedSize int64 - uncompressedSize int64 - filters []filter -} - -// String converts the block header into a string. -func (h blockHeader) String() string { - var buf bytes.Buffer - first := true - if h.compressedSize >= 0 { - fmt.Fprintf(&buf, "compressed size %d", h.compressedSize) - first = false - } - if h.uncompressedSize >= 0 { - if !first { - buf.WriteString(" ") - } - fmt.Fprintf(&buf, "uncompressed size %d", h.uncompressedSize) - first = false - } - for _, f := range h.filters { - if !first { - buf.WriteString(" ") - } - fmt.Fprintf(&buf, "filter %s", f) - first = false - } - return buf.String() -} - -// Masks for the block flags. -const ( - filterCountMask = 0x03 - compressedSizePresent = 0x40 - uncompressedSizePresent = 0x80 - reservedBlockFlags = 0x3C -) - -// errIndexIndicator signals that an index indicator (0x00) has been found -// instead of an expected block header indicator. -var errIndexIndicator = errors.New("xz: found index indicator") - -// readBlockHeader reads the block header. -func readBlockHeader(r io.Reader) (h *blockHeader, n int, err error) { - var buf bytes.Buffer - buf.Grow(20) - - // block header size - z, err := io.CopyN(&buf, r, 1) - n = int(z) - if err != nil { - return nil, n, err - } - s := buf.Bytes()[0] - if s == 0 { - return nil, n, errIndexIndicator - } - - // read complete header - headerLen := (int(s) + 1) * 4 - buf.Grow(headerLen - 1) - z, err = io.CopyN(&buf, r, int64(headerLen-1)) - n += int(z) - if err != nil { - return nil, n, err - } - - // unmarshal block header - h = new(blockHeader) - if err = h.UnmarshalBinary(buf.Bytes()); err != nil { - return nil, n, err - } - - return h, n, nil -} - -// readSizeInBlockHeader reads the uncompressed or compressed size -// fields in the block header. The present value informs the function -// whether the respective field is actually present in the header. -func readSizeInBlockHeader(r io.ByteReader, present bool) (n int64, err error) { - if !present { - return -1, nil - } - x, _, err := readUvarint(r) - if err != nil { - return 0, err - } - if x >= 1<<63 { - return 0, errors.New("xz: size overflow in block header") - } - return int64(x), nil -} - -// UnmarshalBinary unmarshals the block header. -func (h *blockHeader) UnmarshalBinary(data []byte) error { - // Check header length - s := data[0] - if data[0] == 0 { - return errIndexIndicator - } - headerLen := (int(s) + 1) * 4 - if len(data) != headerLen { - return fmt.Errorf("xz: data length %d; want %d", len(data), - headerLen) - } - n := headerLen - 4 - - // Check CRC-32 - crc := crc32.NewIEEE() - crc.Write(data[:n]) - if crc.Sum32() != uint32LE(data[n:]) { - return errors.New("xz: checksum error for block header") - } - - // Block header flags - flags := data[1] - if flags&reservedBlockFlags != 0 { - return errors.New("xz: reserved block header flags set") - } - - r := bytes.NewReader(data[2:n]) - - // Compressed size - var err error - h.compressedSize, err = readSizeInBlockHeader( - r, flags&compressedSizePresent != 0) - if err != nil { - return err - } - - // Uncompressed size - h.uncompressedSize, err = readSizeInBlockHeader( - r, flags&uncompressedSizePresent != 0) - if err != nil { - return err - } - - h.filters, err = readFilters(r, int(flags&filterCountMask)+1) - if err != nil { - return err - } - - // Check padding - // Since headerLen is a multiple of 4 we don't need to check - // alignment. - k := r.Len() - // The standard spec says that the padding should have not more - // than 3 bytes. However we found paddings of 4 or 5 in the - // wild. See https://github.com/ulikunitz/xz/pull/11 and - // https://github.com/ulikunitz/xz/issues/15 - // - // The only reasonable approach seems to be to ignore the - // padding size. We still check that all padding bytes are zero. - if !allZeros(data[n-k : n]) { - return errPadding - } - return nil -} - -// MarshalBinary marshals the binary header. -func (h *blockHeader) MarshalBinary() (data []byte, err error) { - if !(minFilters <= len(h.filters) && len(h.filters) <= maxFilters) { - return nil, errors.New("xz: filter count wrong") - } - for i, f := range h.filters { - if i < len(h.filters)-1 { - if f.id() == lzmaFilterID { - return nil, errors.New( - "xz: LZMA2 filter is not the last") - } - } else { - // last filter - if f.id() != lzmaFilterID { - return nil, errors.New("xz: " + - "last filter must be the LZMA2 filter") - } - } - } - - var buf bytes.Buffer - // header size must set at the end - buf.WriteByte(0) - - // flags - flags := byte(len(h.filters) - 1) - if h.compressedSize >= 0 { - flags |= compressedSizePresent - } - if h.uncompressedSize >= 0 { - flags |= uncompressedSizePresent - } - buf.WriteByte(flags) - - p := make([]byte, 10) - if h.compressedSize >= 0 { - k := putUvarint(p, uint64(h.compressedSize)) - buf.Write(p[:k]) - } - if h.uncompressedSize >= 0 { - k := putUvarint(p, uint64(h.uncompressedSize)) - buf.Write(p[:k]) - } - - for _, f := range h.filters { - fp, err := f.MarshalBinary() - if err != nil { - return nil, err - } - buf.Write(fp) - } - - // padding - for i := padLen(int64(buf.Len())); i > 0; i-- { - buf.WriteByte(0) - } - - // crc place holder - buf.Write(p[:4]) - - data = buf.Bytes() - if len(data)%4 != 0 { - panic("data length not aligned") - } - s := len(data)/4 - 1 - if !(1 < s && s <= 255) { - panic("wrong block header size") - } - data[0] = byte(s) - - crc := crc32.NewIEEE() - crc.Write(data[:len(data)-4]) - putUint32LE(data[len(data)-4:], crc.Sum32()) - - return data, nil -} - -// Constants used for marshalling and unmarshalling filters in the xz -// block header. -const ( - minFilters = 1 - maxFilters = 4 - minReservedID = 1 << 62 -) - -// filter represents a filter in the block header. -type filter interface { - id() uint64 - UnmarshalBinary(data []byte) error - MarshalBinary() (data []byte, err error) - reader(r io.Reader, c *ReaderConfig) (fr io.Reader, err error) - writeCloser(w io.WriteCloser, c *WriterConfig) (fw io.WriteCloser, err error) - // filter must be last filter - last() bool -} - -// readFilter reads a block filter from the block header. At this point -// in time only the LZMA2 filter is supported. -func readFilter(r io.Reader) (f filter, err error) { - br := lzma.ByteReader(r) - - // index - id, _, err := readUvarint(br) - if err != nil { - return nil, err - } - - var data []byte - switch id { - case lzmaFilterID: - data = make([]byte, lzmaFilterLen) - data[0] = lzmaFilterID - if _, err = io.ReadFull(r, data[1:]); err != nil { - return nil, err - } - f = new(lzmaFilter) - default: - if id >= minReservedID { - return nil, errors.New( - "xz: reserved filter id in block stream header") - } - return nil, errors.New("xz: invalid filter id") - } - if err = f.UnmarshalBinary(data); err != nil { - return nil, err - } - return f, err -} - -// readFilters reads count filters. At this point in time only the count -// 1 is supported. -func readFilters(r io.Reader, count int) (filters []filter, err error) { - if count != 1 { - return nil, errors.New("xz: unsupported filter count") - } - f, err := readFilter(r) - if err != nil { - return nil, err - } - return []filter{f}, err -} - -// writeFilters writes the filters. -func writeFilters(w io.Writer, filters []filter) (n int, err error) { - for _, f := range filters { - p, err := f.MarshalBinary() - if err != nil { - return n, err - } - k, err := w.Write(p) - n += k - if err != nil { - return n, err - } - } - return n, nil -} - -/*** Index ***/ - -// record describes a block in the xz file index. -type record struct { - unpaddedSize int64 - uncompressedSize int64 -} - -// readRecord reads an index record. -func readRecord(r io.ByteReader) (rec record, n int, err error) { - u, k, err := readUvarint(r) - n += k - if err != nil { - return rec, n, err - } - rec.unpaddedSize = int64(u) - if rec.unpaddedSize < 0 { - return rec, n, errors.New("xz: unpadded size negative") - } - - u, k, err = readUvarint(r) - n += k - if err != nil { - return rec, n, err - } - rec.uncompressedSize = int64(u) - if rec.uncompressedSize < 0 { - return rec, n, errors.New("xz: uncompressed size negative") - } - - return rec, n, nil -} - -// MarshalBinary converts an index record in its binary encoding. -func (rec *record) MarshalBinary() (data []byte, err error) { - // maximum length of a uvarint is 10 - p := make([]byte, 20) - n := putUvarint(p, uint64(rec.unpaddedSize)) - n += putUvarint(p[n:], uint64(rec.uncompressedSize)) - return p[:n], nil -} - -// writeIndex writes the index, a sequence of records. -func writeIndex(w io.Writer, index []record) (n int64, err error) { - crc := crc32.NewIEEE() - mw := io.MultiWriter(w, crc) - - // index indicator - k, err := mw.Write([]byte{0}) - n += int64(k) - if err != nil { - return n, err - } - - // number of records - p := make([]byte, 10) - k = putUvarint(p, uint64(len(index))) - k, err = mw.Write(p[:k]) - n += int64(k) - if err != nil { - return n, err - } - - // list of records - for _, rec := range index { - p, err := rec.MarshalBinary() - if err != nil { - return n, err - } - k, err = mw.Write(p) - n += int64(k) - if err != nil { - return n, err - } - } - - // index padding - k, err = mw.Write(make([]byte, padLen(int64(n)))) - n += int64(k) - if err != nil { - return n, err - } - - // crc32 checksum - putUint32LE(p, crc.Sum32()) - k, err = w.Write(p[:4]) - n += int64(k) - - return n, err -} - -// readIndexBody reads the index from the reader. It assumes that the -// index indicator has already been read. -func readIndexBody(r io.Reader) (records []record, n int64, err error) { - crc := crc32.NewIEEE() - // index indicator - crc.Write([]byte{0}) - - br := lzma.ByteReader(io.TeeReader(r, crc)) - - // number of records - u, k, err := readUvarint(br) - n += int64(k) - if err != nil { - return nil, n, err - } - recLen := int(u) - if recLen < 0 || uint64(recLen) != u { - return nil, n, errors.New("xz: record number overflow") - } - - // list of records - records = make([]record, recLen) - for i := range records { - records[i], k, err = readRecord(br) - n += int64(k) - if err != nil { - return nil, n, err - } - } - - p := make([]byte, padLen(int64(n+1)), 4) - k, err = io.ReadFull(br.(io.Reader), p) - n += int64(k) - if err != nil { - return nil, n, err - } - if !allZeros(p) { - return nil, n, errors.New("xz: non-zero byte in index padding") - } - - // crc32 - s := crc.Sum32() - p = p[:4] - k, err = io.ReadFull(br.(io.Reader), p) - n += int64(k) - if err != nil { - return records, n, err - } - if uint32LE(p) != s { - return nil, n, errors.New("xz: wrong checksum for index") - } - - return records, n, nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/fox-check-none.xz b/ibm/vendor/github.com/ulikunitz/xz/fox-check-none.xz deleted file mode 100644 index 46043f7dc8..0000000000 Binary files a/ibm/vendor/github.com/ulikunitz/xz/fox-check-none.xz and /dev/null differ diff --git a/ibm/vendor/github.com/ulikunitz/xz/fox.xz b/ibm/vendor/github.com/ulikunitz/xz/fox.xz deleted file mode 100644 index 4b820bd5a1..0000000000 Binary files a/ibm/vendor/github.com/ulikunitz/xz/fox.xz and /dev/null differ diff --git a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go b/ibm/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go deleted file mode 100644 index f2861ba3f7..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package hash - -// CyclicPoly provides a cyclic polynomial rolling hash. -type CyclicPoly struct { - h uint64 - p []uint64 - i int -} - -// ror rotates the unsigned 64-bit integer to right. The argument s must be -// less than 64. -func ror(x uint64, s uint) uint64 { - return (x >> s) | (x << (64 - s)) -} - -// NewCyclicPoly creates a new instance of the CyclicPoly structure. The -// argument n gives the number of bytes for which a hash will be executed. -// This number must be positive; the method panics if this isn't the case. -func NewCyclicPoly(n int) *CyclicPoly { - if n < 1 { - panic("argument n must be positive") - } - return &CyclicPoly{p: make([]uint64, 0, n)} -} - -// Len returns the length of the byte sequence for which a hash is generated. -func (r *CyclicPoly) Len() int { - return cap(r.p) -} - -// RollByte hashes the next byte and returns a hash value. The complete becomes -// available after at least Len() bytes have been hashed. -func (r *CyclicPoly) RollByte(x byte) uint64 { - y := hash[x] - if len(r.p) < cap(r.p) { - r.h = ror(r.h, 1) ^ y - r.p = append(r.p, y) - } else { - r.h ^= ror(r.p[r.i], uint(cap(r.p)-1)) - r.h = ror(r.h, 1) ^ y - r.p[r.i] = y - r.i = (r.i + 1) % cap(r.p) - } - return r.h -} - -// Stores the hash for the individual bytes. -var hash = [256]uint64{ - 0x2e4fc3f904065142, 0xc790984cfbc99527, - 0x879f95eb8c62f187, 0x3b61be86b5021ef2, - 0x65a896a04196f0a5, 0xc5b307b80470b59e, - 0xd3bff376a70df14b, 0xc332f04f0b3f1701, - 0x753b5f0e9abf3e0d, 0xb41538fdfe66ef53, - 0x1906a10c2c1c0208, 0xfb0c712a03421c0d, - 0x38be311a65c9552b, 0xfee7ee4ca6445c7e, - 0x71aadeded184f21e, 0xd73426fccda23b2d, - 0x29773fb5fb9600b5, 0xce410261cd32981a, - 0xfe2848b3c62dbc2d, 0x459eaaff6e43e11c, - 0xc13e35fc9c73a887, 0xf30ed5c201e76dbc, - 0xa5f10b3910482cea, 0x2945d59be02dfaad, - 0x06ee334ff70571b5, 0xbabf9d8070f44380, - 0xee3e2e9912ffd27c, 0x2a7118d1ea6b8ea7, - 0x26183cb9f7b1664c, 0xea71dac7da068f21, - 0xea92eca5bd1d0bb7, 0x415595862defcd75, - 0x248a386023c60648, 0x9cf021ab284b3c8a, - 0xfc9372df02870f6c, 0x2b92d693eeb3b3fc, - 0x73e799d139dc6975, 0x7b15ae312486363c, - 0xb70e5454a2239c80, 0x208e3fb31d3b2263, - 0x01f563cabb930f44, 0x2ac4533d2a3240d8, - 0x84231ed1064f6f7c, 0xa9f020977c2a6d19, - 0x213c227271c20122, 0x09fe8a9a0a03d07a, - 0x4236dc75bcaf910c, 0x460a8b2bead8f17e, - 0xd9b27be1aa07055f, 0xd202d5dc4b11c33e, - 0x70adb010543bea12, 0xcdae938f7ea6f579, - 0x3f3d870208672f4d, 0x8e6ccbce9d349536, - 0xe4c0871a389095ae, 0xf5f2a49152bca080, - 0x9a43f9b97269934e, 0xc17b3753cb6f475c, - 0xd56d941e8e206bd4, 0xac0a4f3e525eda00, - 0xa06d5a011912a550, 0x5537ed19537ad1df, - 0xa32fe713d611449d, 0x2a1d05b47c3b579f, - 0x991d02dbd30a2a52, 0x39e91e7e28f93eb0, - 0x40d06adb3e92c9ac, 0x9b9d3afde1c77c97, - 0x9a3f3f41c02c616f, 0x22ecd4ba00f60c44, - 0x0b63d5d801708420, 0x8f227ca8f37ffaec, - 0x0256278670887c24, 0x107e14877dbf540b, - 0x32c19f2786ac1c05, 0x1df5b12bb4bc9c61, - 0xc0cac129d0d4c4e2, 0x9fdb52ee9800b001, - 0x31f601d5d31c48c4, 0x72ff3c0928bcaec7, - 0xd99264421147eb03, 0x535a2d6d38aefcfe, - 0x6ba8b4454a916237, 0xfa39366eaae4719c, - 0x10f00fd7bbb24b6f, 0x5bd23185c76c84d4, - 0xb22c3d7e1b00d33f, 0x3efc20aa6bc830a8, - 0xd61c2503fe639144, 0x30ce625441eb92d3, - 0xe5d34cf359e93100, 0xa8e5aa13f2b9f7a5, - 0x5c2b8d851ca254a6, 0x68fb6c5e8b0d5fdf, - 0xc7ea4872c96b83ae, 0x6dd5d376f4392382, - 0x1be88681aaa9792f, 0xfef465ee1b6c10d9, - 0x1f98b65ed43fcb2e, 0x4d1ca11eb6e9a9c9, - 0x7808e902b3857d0b, 0x171c9c4ea4607972, - 0x58d66274850146df, 0x42b311c10d3981d1, - 0x647fa8c621c41a4c, 0xf472771c66ddfedc, - 0x338d27e3f847b46b, 0x6402ce3da97545ce, - 0x5162db616fc38638, 0x9c83be97bc22a50e, - 0x2d3d7478a78d5e72, 0xe621a9b938fd5397, - 0x9454614eb0f81c45, 0x395fb6e742ed39b6, - 0x77dd9179d06037bf, 0xc478d0fee4d2656d, - 0x35d9d6cb772007af, 0x83a56e92c883f0f6, - 0x27937453250c00a1, 0x27bd6ebc3a46a97d, - 0x9f543bf784342d51, 0xd158f38c48b0ed52, - 0x8dd8537c045f66b4, 0x846a57230226f6d5, - 0x6b13939e0c4e7cdf, 0xfca25425d8176758, - 0x92e5fc6cd52788e6, 0x9992e13d7a739170, - 0x518246f7a199e8ea, 0xf104c2a71b9979c7, - 0x86b3ffaabea4768f, 0x6388061cf3e351ad, - 0x09d9b5295de5bbb5, 0x38bf1638c2599e92, - 0x1d759846499e148d, 0x4c0ff015e5f96ef4, - 0xa41a94cfa270f565, 0x42d76f9cb2326c0b, - 0x0cf385dd3c9c23ba, 0x0508a6c7508d6e7a, - 0x337523aabbe6cf8d, 0x646bb14001d42b12, - 0xc178729d138adc74, 0xf900ef4491f24086, - 0xee1a90d334bb5ac4, 0x9755c92247301a50, - 0xb999bf7c4ff1b610, 0x6aeeb2f3b21e8fc9, - 0x0fa8084cf91ac6ff, 0x10d226cf136e6189, - 0xd302057a07d4fb21, 0x5f03800e20a0fcc3, - 0x80118d4ae46bd210, 0x58ab61a522843733, - 0x51edd575c5432a4b, 0x94ee6ff67f9197f7, - 0x765669e0e5e8157b, 0xa5347830737132f0, - 0x3ba485a69f01510c, 0x0b247d7b957a01c3, - 0x1b3d63449fd807dc, 0x0fdc4721c30ad743, - 0x8b535ed3829b2b14, 0xee41d0cad65d232c, - 0xe6a99ed97a6a982f, 0x65ac6194c202003d, - 0x692accf3a70573eb, 0xcc3c02c3e200d5af, - 0x0d419e8b325914a3, 0x320f160f42c25e40, - 0x00710d647a51fe7a, 0x3c947692330aed60, - 0x9288aa280d355a7a, 0xa1806a9b791d1696, - 0x5d60e38496763da1, 0x6c69e22e613fd0f4, - 0x977fc2a5aadffb17, 0xfb7bd063fc5a94ba, - 0x460c17992cbaece1, 0xf7822c5444d3297f, - 0x344a9790c69b74aa, 0xb80a42e6cae09dce, - 0x1b1361eaf2b1e757, 0xd84c1e758e236f01, - 0x88e0b7be347627cc, 0x45246009b7a99490, - 0x8011c6dd3fe50472, 0xc341d682bffb99d7, - 0x2511be93808e2d15, 0xd5bc13d7fd739840, - 0x2a3cd030679ae1ec, 0x8ad9898a4b9ee157, - 0x3245fef0a8eaf521, 0x3d6d8dbbb427d2b0, - 0x1ed146d8968b3981, 0x0c6a28bf7d45f3fc, - 0x4a1fd3dbcee3c561, 0x4210ff6a476bf67e, - 0xa559cce0d9199aac, 0xde39d47ef3723380, - 0xe5b69d848ce42e35, 0xefa24296f8e79f52, - 0x70190b59db9a5afc, 0x26f166cdb211e7bf, - 0x4deaf2df3c6b8ef5, 0xf171dbdd670f1017, - 0xb9059b05e9420d90, 0x2f0da855c9388754, - 0x611d5e9ab77949cc, 0x2912038ac01163f4, - 0x0231df50402b2fba, 0x45660fc4f3245f58, - 0xb91cc97c7c8dac50, 0xb72d2aafe4953427, - 0xfa6463f87e813d6b, 0x4515f7ee95d5c6a2, - 0x1310e1c1a48d21c3, 0xad48a7810cdd8544, - 0x4d5bdfefd5c9e631, 0xa43ed43f1fdcb7de, - 0xe70cfc8fe1ee9626, 0xef4711b0d8dda442, - 0xb80dd9bd4dab6c93, 0xa23be08d31ba4d93, - 0x9b37db9d0335a39c, 0x494b6f870f5cfebc, - 0x6d1b3c1149dda943, 0x372c943a518c1093, - 0xad27af45e77c09c4, 0x3b6f92b646044604, - 0xac2917909f5fcf4f, 0x2069a60e977e5557, - 0x353a469e71014de5, 0x24be356281f55c15, - 0x2b6d710ba8e9adea, 0x404ad1751c749c29, - 0xed7311bf23d7f185, 0xba4f6976b4acc43e, - 0x32d7198d2bc39000, 0xee667019014d6e01, - 0x494ef3e128d14c83, 0x1f95a152baecd6be, - 0x201648dff1f483a5, 0x68c28550c8384af6, - 0x5fc834a6824a7f48, 0x7cd06cb7365eaf28, - 0xd82bbd95e9b30909, 0x234f0d1694c53f6d, - 0xd2fb7f4a96d83f4a, 0xff0d5da83acac05e, - 0xf8f6b97f5585080a, 0x74236084be57b95b, - 0xa25e40c03bbc36ad, 0x6b6e5c14ce88465b, - 0x4378ffe93e1528c5, 0x94ca92a17118e2d2, -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/doc.go b/ibm/vendor/github.com/ulikunitz/xz/internal/hash/doc.go deleted file mode 100644 index e28d23be47..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/doc.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package hash provides rolling hashes. - -Rolling hashes have to be used for maintaining the positions of n-byte -sequences in the dictionary buffer. - -The package provides currently the Rabin-Karp rolling hash and a Cyclic -Polynomial hash. Both support the Hashes method to be used with an interface. -*/ -package hash diff --git a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go b/ibm/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go deleted file mode 100644 index b8e66d9721..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package hash - -// A is the default constant for Robin-Karp rolling hash. This is a random -// prime. -const A = 0x97b548add41d5da1 - -// RabinKarp supports the computation of a rolling hash. -type RabinKarp struct { - A uint64 - // a^n - aOldest uint64 - h uint64 - p []byte - i int -} - -// NewRabinKarp creates a new RabinKarp value. The argument n defines the -// length of the byte sequence to be hashed. The default constant will will be -// used. -func NewRabinKarp(n int) *RabinKarp { - return NewRabinKarpConst(n, A) -} - -// NewRabinKarpConst creates a new RabinKarp value. The argument n defines the -// length of the byte sequence to be hashed. The argument a provides the -// constant used to compute the hash. -func NewRabinKarpConst(n int, a uint64) *RabinKarp { - if n <= 0 { - panic("number of bytes n must be positive") - } - aOldest := uint64(1) - // There are faster methods. For the small n required by the LZMA - // compressor O(n) is sufficient. - for i := 0; i < n; i++ { - aOldest *= a - } - return &RabinKarp{ - A: a, aOldest: aOldest, - p: make([]byte, 0, n), - } -} - -// Len returns the length of the byte sequence. -func (r *RabinKarp) Len() int { - return cap(r.p) -} - -// RollByte computes the hash after x has been added. -func (r *RabinKarp) RollByte(x byte) uint64 { - if len(r.p) < cap(r.p) { - r.h += uint64(x) - r.h *= r.A - r.p = append(r.p, x) - } else { - r.h -= uint64(r.p[r.i]) * r.aOldest - r.h += uint64(x) - r.h *= r.A - r.p[r.i] = x - r.i = (r.i + 1) % cap(r.p) - } - return r.h -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/roller.go b/ibm/vendor/github.com/ulikunitz/xz/internal/hash/roller.go deleted file mode 100644 index 34c81b38a7..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/internal/hash/roller.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package hash - -// Roller provides an interface for rolling hashes. The hash value will become -// valid after hash has been called Len times. -type Roller interface { - Len() int - RollByte(x byte) uint64 -} - -// Hashes computes all hash values for the array p. Note that the state of the -// roller is changed. -func Hashes(r Roller, p []byte) []uint64 { - n := r.Len() - if len(p) < n { - return nil - } - h := make([]uint64, len(p)-n+1) - for i := 0; i < n-1; i++ { - r.RollByte(p[i]) - } - for i := range h { - h[i] = r.RollByte(p[i+n-1]) - } - return h -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go b/ibm/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go deleted file mode 100644 index 678b5a0589..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go +++ /dev/null @@ -1,457 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xlog provides a simple logging package that allows to disable -// certain message categories. It defines a type, Logger, with multiple -// methods for formatting output. The package has also a predefined -// 'standard' Logger accessible through helper function Print[f|ln], -// Fatal[f|ln], Panic[f|ln], Warn[f|ln], Print[f|ln] and Debug[f|ln] -// that are easier to use then creating a Logger manually. That logger -// writes to standard error and prints the date and time of each logged -// message, which can be configured using the function SetFlags. -// -// The Fatal functions call os.Exit(1) after the message is output -// unless not suppressed by the flags. The Panic functions call panic -// after the writing the log message unless suppressed. -package xlog - -import ( - "fmt" - "io" - "os" - "runtime" - "sync" - "time" -) - -// The flags define what information is prefixed to each log entry -// generated by the Logger. The Lno* versions allow the suppression of -// specific output. The bits are or'ed together to control what will be -// printed. There is no control over the order of the items printed and -// the format. The full format is: -// -// 2009-01-23 01:23:23.123123 /a/b/c/d.go:23: message -// -const ( - Ldate = 1 << iota // the date: 2009-01-23 - Ltime // the time: 01:23:23 - Lmicroseconds // microsecond resolution: 01:23:23.123123 - Llongfile // full file name and line number: /a/b/c/d.go:23 - Lshortfile // final file name element and line number: d.go:23 - Lnopanic // suppresses output from Panic[f|ln] but not the panic call - Lnofatal // suppresses output from Fatal[f|ln] but not the exit - Lnowarn // suppresses output from Warn[f|ln] - Lnoprint // suppresses output from Print[f|ln] - Lnodebug // suppresses output from Debug[f|ln] - // initial values for the standard logger - Lstdflags = Ldate | Ltime | Lnodebug -) - -// A Logger represents an active logging object that generates lines of -// output to an io.Writer. Each logging operation if not suppressed -// makes a single call to the Writer's Write method. A Logger can be -// used simultaneously from multiple goroutines; it guarantees to -// serialize access to the Writer. -type Logger struct { - mu sync.Mutex // ensures atomic writes; and protects the following - // fields - prefix string // prefix to write at beginning of each line - flag int // properties - out io.Writer // destination for output - buf []byte // for accumulating text to write -} - -// New creates a new Logger. The out argument sets the destination to -// which the log output will be written. The prefix appears at the -// beginning of each log line. The flag argument defines the logging -// properties. -func New(out io.Writer, prefix string, flag int) *Logger { - return &Logger{out: out, prefix: prefix, flag: flag} -} - -// std is the standard logger used by the package scope functions. -var std = New(os.Stderr, "", Lstdflags) - -// itoa converts the integer to ASCII. A negative widths will avoid -// zero-padding. The function supports only non-negative integers. -func itoa(buf *[]byte, i int, wid int) { - var u = uint(i) - if u == 0 && wid <= 1 { - *buf = append(*buf, '0') - return - } - var b [32]byte - bp := len(b) - for ; u > 0 || wid > 0; u /= 10 { - bp-- - wid-- - b[bp] = byte(u%10) + '0' - } - *buf = append(*buf, b[bp:]...) -} - -// formatHeader puts the header into the buf field of the buffer. -func (l *Logger) formatHeader(t time.Time, file string, line int) { - l.buf = append(l.buf, l.prefix...) - if l.flag&(Ldate|Ltime|Lmicroseconds) != 0 { - if l.flag&Ldate != 0 { - year, month, day := t.Date() - itoa(&l.buf, year, 4) - l.buf = append(l.buf, '-') - itoa(&l.buf, int(month), 2) - l.buf = append(l.buf, '-') - itoa(&l.buf, day, 2) - l.buf = append(l.buf, ' ') - } - if l.flag&(Ltime|Lmicroseconds) != 0 { - hour, min, sec := t.Clock() - itoa(&l.buf, hour, 2) - l.buf = append(l.buf, ':') - itoa(&l.buf, min, 2) - l.buf = append(l.buf, ':') - itoa(&l.buf, sec, 2) - if l.flag&Lmicroseconds != 0 { - l.buf = append(l.buf, '.') - itoa(&l.buf, t.Nanosecond()/1e3, 6) - } - l.buf = append(l.buf, ' ') - } - } - if l.flag&(Lshortfile|Llongfile) != 0 { - if l.flag&Lshortfile != 0 { - short := file - for i := len(file) - 1; i > 0; i-- { - if file[i] == '/' { - short = file[i+1:] - break - } - } - file = short - } - l.buf = append(l.buf, file...) - l.buf = append(l.buf, ':') - itoa(&l.buf, line, -1) - l.buf = append(l.buf, ": "...) - } -} - -func (l *Logger) output(calldepth int, now time.Time, s string) error { - var file string - var line int - if l.flag&(Lshortfile|Llongfile) != 0 { - l.mu.Unlock() - var ok bool - _, file, line, ok = runtime.Caller(calldepth) - if !ok { - file = "???" - line = 0 - } - l.mu.Lock() - } - l.buf = l.buf[:0] - l.formatHeader(now, file, line) - l.buf = append(l.buf, s...) - if len(s) == 0 || s[len(s)-1] != '\n' { - l.buf = append(l.buf, '\n') - } - _, err := l.out.Write(l.buf) - return err -} - -// Output writes the string s with the header controlled by the flags to -// the l.out writer. A newline will be appended if s doesn't end in a -// newline. Calldepth is used to recover the PC, although all current -// calls of Output use the call depth 2. Access to the function is serialized. -func (l *Logger) Output(calldepth, noflag int, v ...interface{}) error { - now := time.Now() - l.mu.Lock() - defer l.mu.Unlock() - if l.flag&noflag != 0 { - return nil - } - s := fmt.Sprint(v...) - return l.output(calldepth+1, now, s) -} - -// Outputf works like output but formats the output like Printf. -func (l *Logger) Outputf(calldepth int, noflag int, format string, v ...interface{}) error { - now := time.Now() - l.mu.Lock() - defer l.mu.Unlock() - if l.flag&noflag != 0 { - return nil - } - s := fmt.Sprintf(format, v...) - return l.output(calldepth+1, now, s) -} - -// Outputln works like output but formats the output like Println. -func (l *Logger) Outputln(calldepth int, noflag int, v ...interface{}) error { - now := time.Now() - l.mu.Lock() - defer l.mu.Unlock() - if l.flag&noflag != 0 { - return nil - } - s := fmt.Sprintln(v...) - return l.output(calldepth+1, now, s) -} - -// Panic prints the message like Print and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func (l *Logger) Panic(v ...interface{}) { - l.Output(2, Lnopanic, v...) - s := fmt.Sprint(v...) - panic(s) -} - -// Panic prints the message like Print and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func Panic(v ...interface{}) { - std.Output(2, Lnopanic, v...) - s := fmt.Sprint(v...) - panic(s) -} - -// Panicf prints the message like Printf and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func (l *Logger) Panicf(format string, v ...interface{}) { - l.Outputf(2, Lnopanic, format, v...) - s := fmt.Sprintf(format, v...) - panic(s) -} - -// Panicf prints the message like Printf and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func Panicf(format string, v ...interface{}) { - std.Outputf(2, Lnopanic, format, v...) - s := fmt.Sprintf(format, v...) - panic(s) -} - -// Panicln prints the message like Println and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func (l *Logger) Panicln(v ...interface{}) { - l.Outputln(2, Lnopanic, v...) - s := fmt.Sprintln(v...) - panic(s) -} - -// Panicln prints the message like Println and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func Panicln(v ...interface{}) { - std.Outputln(2, Lnopanic, v...) - s := fmt.Sprintln(v...) - panic(s) -} - -// Fatal prints the message like Print and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func (l *Logger) Fatal(v ...interface{}) { - l.Output(2, Lnofatal, v...) - os.Exit(1) -} - -// Fatal prints the message like Print and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func Fatal(v ...interface{}) { - std.Output(2, Lnofatal, v...) - os.Exit(1) -} - -// Fatalf prints the message like Printf and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func (l *Logger) Fatalf(format string, v ...interface{}) { - l.Outputf(2, Lnofatal, format, v...) - os.Exit(1) -} - -// Fatalf prints the message like Printf and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func Fatalf(format string, v ...interface{}) { - std.Outputf(2, Lnofatal, format, v...) - os.Exit(1) -} - -// Fatalln prints the message like Println and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func (l *Logger) Fatalln(format string, v ...interface{}) { - l.Outputln(2, Lnofatal, v...) - os.Exit(1) -} - -// Fatalln prints the message like Println and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func Fatalln(format string, v ...interface{}) { - std.Outputln(2, Lnofatal, v...) - os.Exit(1) -} - -// Warn prints the message like Print. The printing might be suppressed -// by the flag Lnowarn. -func (l *Logger) Warn(v ...interface{}) { - l.Output(2, Lnowarn, v...) -} - -// Warn prints the message like Print. The printing might be suppressed -// by the flag Lnowarn. -func Warn(v ...interface{}) { - std.Output(2, Lnowarn, v...) -} - -// Warnf prints the message like Printf. The printing might be suppressed -// by the flag Lnowarn. -func (l *Logger) Warnf(format string, v ...interface{}) { - l.Outputf(2, Lnowarn, format, v...) -} - -// Warnf prints the message like Printf. The printing might be suppressed -// by the flag Lnowarn. -func Warnf(format string, v ...interface{}) { - std.Outputf(2, Lnowarn, format, v...) -} - -// Warnln prints the message like Println. The printing might be suppressed -// by the flag Lnowarn. -func (l *Logger) Warnln(v ...interface{}) { - l.Outputln(2, Lnowarn, v...) -} - -// Warnln prints the message like Println. The printing might be suppressed -// by the flag Lnowarn. -func Warnln(v ...interface{}) { - std.Outputln(2, Lnowarn, v...) -} - -// Print prints the message like fmt.Print. The printing might be suppressed -// by the flag Lnoprint. -func (l *Logger) Print(v ...interface{}) { - l.Output(2, Lnoprint, v...) -} - -// Print prints the message like fmt.Print. The printing might be suppressed -// by the flag Lnoprint. -func Print(v ...interface{}) { - std.Output(2, Lnoprint, v...) -} - -// Printf prints the message like fmt.Printf. The printing might be suppressed -// by the flag Lnoprint. -func (l *Logger) Printf(format string, v ...interface{}) { - l.Outputf(2, Lnoprint, format, v...) -} - -// Printf prints the message like fmt.Printf. The printing might be suppressed -// by the flag Lnoprint. -func Printf(format string, v ...interface{}) { - std.Outputf(2, Lnoprint, format, v...) -} - -// Println prints the message like fmt.Println. The printing might be -// suppressed by the flag Lnoprint. -func (l *Logger) Println(v ...interface{}) { - l.Outputln(2, Lnoprint, v...) -} - -// Println prints the message like fmt.Println. The printing might be -// suppressed by the flag Lnoprint. -func Println(v ...interface{}) { - std.Outputln(2, Lnoprint, v...) -} - -// Debug prints the message like Print. The printing might be suppressed -// by the flag Lnodebug. -func (l *Logger) Debug(v ...interface{}) { - l.Output(2, Lnodebug, v...) -} - -// Debug prints the message like Print. The printing might be suppressed -// by the flag Lnodebug. -func Debug(v ...interface{}) { - std.Output(2, Lnodebug, v...) -} - -// Debugf prints the message like Printf. The printing might be suppressed -// by the flag Lnodebug. -func (l *Logger) Debugf(format string, v ...interface{}) { - l.Outputf(2, Lnodebug, format, v...) -} - -// Debugf prints the message like Printf. The printing might be suppressed -// by the flag Lnodebug. -func Debugf(format string, v ...interface{}) { - std.Outputf(2, Lnodebug, format, v...) -} - -// Debugln prints the message like Println. The printing might be suppressed -// by the flag Lnodebug. -func (l *Logger) Debugln(v ...interface{}) { - l.Outputln(2, Lnodebug, v...) -} - -// Debugln prints the message like Println. The printing might be suppressed -// by the flag Lnodebug. -func Debugln(v ...interface{}) { - std.Outputln(2, Lnodebug, v...) -} - -// Flags returns the current flags used by the logger. -func (l *Logger) Flags() int { - l.mu.Lock() - defer l.mu.Unlock() - return l.flag -} - -// Flags returns the current flags used by the standard logger. -func Flags() int { - return std.Flags() -} - -// SetFlags sets the flags of the logger. -func (l *Logger) SetFlags(flag int) { - l.mu.Lock() - defer l.mu.Unlock() - l.flag = flag -} - -// SetFlags sets the flags for the standard logger. -func SetFlags(flag int) { - std.SetFlags(flag) -} - -// Prefix returns the prefix used by the logger. -func (l *Logger) Prefix() string { - l.mu.Lock() - defer l.mu.Unlock() - return l.prefix -} - -// Prefix returns the prefix used by the standard logger of the package. -func Prefix() string { - return std.Prefix() -} - -// SetPrefix sets the prefix for the logger. -func (l *Logger) SetPrefix(prefix string) { - l.mu.Lock() - defer l.mu.Unlock() - l.prefix = prefix -} - -// SetPrefix sets the prefix of the standard logger of the package. -func SetPrefix(prefix string) { - std.SetPrefix(prefix) -} - -// SetOutput sets the output of the logger. -func (l *Logger) SetOutput(w io.Writer) { - l.mu.Lock() - defer l.mu.Unlock() - l.out = w -} - -// SetOutput sets the output for the standard logger of the package. -func SetOutput(w io.Writer) { - std.SetOutput(w) -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/bintree.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/bintree.go deleted file mode 100644 index 58d6a92a72..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/bintree.go +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "bufio" - "errors" - "fmt" - "io" - "unicode" -) - -// node represents a node in the binary tree. -type node struct { - // x is the search value - x uint32 - // p parent node - p uint32 - // l left child - l uint32 - // r right child - r uint32 -} - -// wordLen is the number of bytes represented by the v field of a node. -const wordLen = 4 - -// binTree supports the identification of the next operation based on a -// binary tree. -// -// Nodes will be identified by their index into the ring buffer. -type binTree struct { - dict *encoderDict - // ring buffer of nodes - node []node - // absolute offset of the entry for the next node. Position 4 - // byte larger. - hoff int64 - // front position in the node ring buffer - front uint32 - // index of the root node - root uint32 - // current x value - x uint32 - // preallocated array - data []byte -} - -// null represents the nonexistent index. We can't use zero because it -// would always exist or we would need to decrease the index for each -// reference. -const null uint32 = 1<<32 - 1 - -// newBinTree initializes the binTree structure. The capacity defines -// the size of the buffer and defines the maximum distance for which -// matches will be found. -func newBinTree(capacity int) (t *binTree, err error) { - if capacity < 1 { - return nil, errors.New( - "newBinTree: capacity must be larger than zero") - } - if int64(capacity) >= int64(null) { - return nil, errors.New( - "newBinTree: capacity must less 2^{32}-1") - } - t = &binTree{ - node: make([]node, capacity), - hoff: -int64(wordLen), - root: null, - data: make([]byte, maxMatchLen), - } - return t, nil -} - -func (t *binTree) SetDict(d *encoderDict) { t.dict = d } - -// WriteByte writes a single byte into the binary tree. -func (t *binTree) WriteByte(c byte) error { - t.x = (t.x << 8) | uint32(c) - t.hoff++ - if t.hoff < 0 { - return nil - } - v := t.front - if int64(v) < t.hoff { - // We are overwriting old nodes stored in the tree. - t.remove(v) - } - t.node[v].x = t.x - t.add(v) - t.front++ - if int64(t.front) >= int64(len(t.node)) { - t.front = 0 - } - return nil -} - -// Writes writes a sequence of bytes into the binTree structure. -func (t *binTree) Write(p []byte) (n int, err error) { - for _, c := range p { - t.WriteByte(c) - } - return len(p), nil -} - -// add puts the node v into the tree. The node must not be part of the -// tree before. -func (t *binTree) add(v uint32) { - vn := &t.node[v] - // Set left and right to null indices. - vn.l, vn.r = null, null - // If the binary tree is empty make v the root. - if t.root == null { - t.root = v - vn.p = null - return - } - x := vn.x - p := t.root - // Search for the right leave link and add the new node. - for { - pn := &t.node[p] - if x <= pn.x { - if pn.l == null { - pn.l = v - vn.p = p - return - } - p = pn.l - } else { - if pn.r == null { - pn.r = v - vn.p = p - return - } - p = pn.r - } - } -} - -// parent returns the parent node index of v and the pointer to v value -// in the parent. -func (t *binTree) parent(v uint32) (p uint32, ptr *uint32) { - if t.root == v { - return null, &t.root - } - p = t.node[v].p - if t.node[p].l == v { - ptr = &t.node[p].l - } else { - ptr = &t.node[p].r - } - return -} - -// Remove node v. -func (t *binTree) remove(v uint32) { - vn := &t.node[v] - p, ptr := t.parent(v) - l, r := vn.l, vn.r - if l == null { - // Move the right child up. - *ptr = r - if r != null { - t.node[r].p = p - } - return - } - if r == null { - // Move the left child up. - *ptr = l - t.node[l].p = p - return - } - - // Search the in-order predecessor u. - un := &t.node[l] - ur := un.r - if ur == null { - // In order predecessor is l. Move it up. - un.r = r - t.node[r].p = l - un.p = p - *ptr = l - return - } - var u uint32 - for { - // Look for the max value in the tree where l is root. - u = ur - ur = t.node[u].r - if ur == null { - break - } - } - // replace u with ul - un = &t.node[u] - ul := un.l - up := un.p - t.node[up].r = ul - if ul != null { - t.node[ul].p = up - } - - // replace v by u - un.l, un.r = l, r - t.node[l].p = u - t.node[r].p = u - *ptr = u - un.p = p -} - -// search looks for the node that have the value x or for the nodes that -// brace it. The node highest in the tree with the value x will be -// returned. All other nodes with the same value live in left subtree of -// the returned node. -func (t *binTree) search(v uint32, x uint32) (a, b uint32) { - a, b = null, null - if v == null { - return - } - for { - vn := &t.node[v] - if x <= vn.x { - if x == vn.x { - return v, v - } - b = v - if vn.l == null { - return - } - v = vn.l - } else { - a = v - if vn.r == null { - return - } - v = vn.r - } - } -} - -// max returns the node with maximum value in the subtree with v as -// root. -func (t *binTree) max(v uint32) uint32 { - if v == null { - return null - } - for { - r := t.node[v].r - if r == null { - return v - } - v = r - } -} - -// min returns the node with the minimum value in the subtree with v as -// root. -func (t *binTree) min(v uint32) uint32 { - if v == null { - return null - } - for { - l := t.node[v].l - if l == null { - return v - } - v = l - } -} - -// pred returns the in-order predecessor of node v. -func (t *binTree) pred(v uint32) uint32 { - if v == null { - return null - } - u := t.max(t.node[v].l) - if u != null { - return u - } - for { - p := t.node[v].p - if p == null { - return null - } - if t.node[p].r == v { - return p - } - v = p - } -} - -// succ returns the in-order successor of node v. -func (t *binTree) succ(v uint32) uint32 { - if v == null { - return null - } - u := t.min(t.node[v].r) - if u != null { - return u - } - for { - p := t.node[v].p - if p == null { - return null - } - if t.node[p].l == v { - return p - } - v = p - } -} - -// xval converts the first four bytes of a into an 32-bit unsigned -// integer in big-endian order. -func xval(a []byte) uint32 { - var x uint32 - switch len(a) { - default: - x |= uint32(a[3]) - fallthrough - case 3: - x |= uint32(a[2]) << 8 - fallthrough - case 2: - x |= uint32(a[1]) << 16 - fallthrough - case 1: - x |= uint32(a[0]) << 24 - case 0: - } - return x -} - -// dumpX converts value x into a four-letter string. -func dumpX(x uint32) string { - a := make([]byte, 4) - for i := 0; i < 4; i++ { - c := byte(x >> uint((3-i)*8)) - if unicode.IsGraphic(rune(c)) { - a[i] = c - } else { - a[i] = '.' - } - } - return string(a) -} - -// dumpNode writes a representation of the node v into the io.Writer. -func (t *binTree) dumpNode(w io.Writer, v uint32, indent int) { - if v == null { - return - } - - vn := &t.node[v] - - t.dumpNode(w, vn.r, indent+2) - - for i := 0; i < indent; i++ { - fmt.Fprint(w, " ") - } - if vn.p == null { - fmt.Fprintf(w, "node %d %q parent null\n", v, dumpX(vn.x)) - } else { - fmt.Fprintf(w, "node %d %q parent %d\n", v, dumpX(vn.x), vn.p) - } - - t.dumpNode(w, vn.l, indent+2) -} - -// dump prints a representation of the binary tree into the writer. -func (t *binTree) dump(w io.Writer) error { - bw := bufio.NewWriter(w) - t.dumpNode(bw, t.root, 0) - return bw.Flush() -} - -func (t *binTree) distance(v uint32) int { - dist := int(t.front) - int(v) - if dist <= 0 { - dist += len(t.node) - } - return dist -} - -type matchParams struct { - rep [4]uint32 - // length when match will be accepted - nAccept int - // nodes to check - check int - // finish if length get shorter - stopShorter bool -} - -func (t *binTree) match(m match, distIter func() (int, bool), p matchParams, -) (r match, checked int, accepted bool) { - buf := &t.dict.buf - for { - if checked >= p.check { - return m, checked, true - } - dist, ok := distIter() - if !ok { - return m, checked, false - } - checked++ - if m.n > 0 { - i := buf.rear - dist + m.n - 1 - if i < 0 { - i += len(buf.data) - } else if i >= len(buf.data) { - i -= len(buf.data) - } - if buf.data[i] != t.data[m.n-1] { - if p.stopShorter { - return m, checked, false - } - continue - } - } - n := buf.matchLen(dist, t.data) - switch n { - case 0: - if p.stopShorter { - return m, checked, false - } - continue - case 1: - if uint32(dist-minDistance) != p.rep[0] { - continue - } - } - if n < m.n || (n == m.n && int64(dist) >= m.distance) { - continue - } - m = match{int64(dist), n} - if n >= p.nAccept { - return m, checked, true - } - } -} - -func (t *binTree) NextOp(rep [4]uint32) operation { - // retrieve maxMatchLen data - n, _ := t.dict.buf.Peek(t.data[:maxMatchLen]) - if n == 0 { - panic("no data in buffer") - } - t.data = t.data[:n] - - var ( - m match - x, u, v uint32 - iterPred, iterSucc func() (int, bool) - ) - p := matchParams{ - rep: rep, - nAccept: maxMatchLen, - check: 32, - } - i := 4 - iterSmall := func() (dist int, ok bool) { - i-- - if i <= 0 { - return 0, false - } - return i, true - } - m, checked, accepted := t.match(m, iterSmall, p) - if accepted { - goto end - } - p.check -= checked - x = xval(t.data) - u, v = t.search(t.root, x) - if u == v && len(t.data) == 4 { - iter := func() (dist int, ok bool) { - if u == null { - return 0, false - } - dist = t.distance(u) - u, v = t.search(t.node[u].l, x) - if u != v { - u = null - } - return dist, true - } - m, _, _ = t.match(m, iter, p) - goto end - } - p.stopShorter = true - iterSucc = func() (dist int, ok bool) { - if v == null { - return 0, false - } - dist = t.distance(v) - v = t.succ(v) - return dist, true - } - m, checked, accepted = t.match(m, iterSucc, p) - if accepted { - goto end - } - p.check -= checked - iterPred = func() (dist int, ok bool) { - if u == null { - return 0, false - } - dist = t.distance(u) - u = t.pred(u) - return dist, true - } - m, _, _ = t.match(m, iterPred, p) -end: - if m.n == 0 { - return lit{t.data[0]} - } - return m -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/bitops.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/bitops.go deleted file mode 100644 index 2784ec6ba0..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/bitops.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -/* Naming conventions follows the CodeReviewComments in the Go Wiki. */ - -// ntz32Const is used by the functions NTZ and NLZ. -const ntz32Const = 0x04d7651f - -// ntz32Table is a helper table for de Bruijn algorithm by Danny Dubé. -// See Henry S. Warren, Jr. "Hacker's Delight" section 5-1 figure 5-26. -var ntz32Table = [32]int8{ - 0, 1, 2, 24, 3, 19, 6, 25, - 22, 4, 20, 10, 16, 7, 12, 26, - 31, 23, 18, 5, 21, 9, 15, 11, - 30, 17, 8, 14, 29, 13, 28, 27, -} - -// ntz32 computes the number of trailing zeros for an unsigned 32-bit integer. -func ntz32(x uint32) int { - if x == 0 { - return 32 - } - x = (x & -x) * ntz32Const - return int(ntz32Table[x>>27]) -} - -// nlz32 computes the number of leading zeros for an unsigned 32-bit integer. -func nlz32(x uint32) int { - // Smear left most bit to the right - x |= x >> 1 - x |= x >> 2 - x |= x >> 4 - x |= x >> 8 - x |= x >> 16 - // Use ntz mechanism to calculate nlz. - x++ - if x == 0 { - return 0 - } - x *= ntz32Const - return 32 - int(ntz32Table[x>>27]) -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/breader.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/breader.go deleted file mode 100644 index 4ad09a14e7..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/breader.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" -) - -// breader provides the ReadByte function for a Reader. It doesn't read -// more data from the reader than absolutely necessary. -type breader struct { - io.Reader - // helper slice to save allocations - p []byte -} - -// ByteReader converts an io.Reader into an io.ByteReader. -func ByteReader(r io.Reader) io.ByteReader { - br, ok := r.(io.ByteReader) - if !ok { - return &breader{r, make([]byte, 1)} - } - return br -} - -// ReadByte read byte function. -func (r *breader) ReadByte() (c byte, err error) { - n, err := r.Reader.Read(r.p) - if n < 1 { - if err == nil { - err = errors.New("breader.ReadByte: no data") - } - return 0, err - } - return r.p[0], nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/buffer.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/buffer.go deleted file mode 100644 index 9cb7838acb..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/buffer.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" -) - -// buffer provides a circular buffer of bytes. If the front index equals -// the rear index the buffer is empty. As a consequence front cannot be -// equal rear for a full buffer. So a full buffer has a length that is -// one byte less the the length of the data slice. -type buffer struct { - data []byte - front int - rear int -} - -// newBuffer creates a buffer with the given size. -func newBuffer(size int) *buffer { - return &buffer{data: make([]byte, size+1)} -} - -// Cap returns the capacity of the buffer. -func (b *buffer) Cap() int { - return len(b.data) - 1 -} - -// Resets the buffer. The front and rear index are set to zero. -func (b *buffer) Reset() { - b.front = 0 - b.rear = 0 -} - -// Buffered returns the number of bytes buffered. -func (b *buffer) Buffered() int { - delta := b.front - b.rear - if delta < 0 { - delta += len(b.data) - } - return delta -} - -// Available returns the number of bytes available for writing. -func (b *buffer) Available() int { - delta := b.rear - 1 - b.front - if delta < 0 { - delta += len(b.data) - } - return delta -} - -// addIndex adds a non-negative integer to the index i and returns the -// resulting index. The function takes care of wrapping the index as -// well as potential overflow situations. -func (b *buffer) addIndex(i int, n int) int { - // subtraction of len(b.data) prevents overflow - i += n - len(b.data) - if i < 0 { - i += len(b.data) - } - return i -} - -// Read reads bytes from the buffer into p and returns the number of -// bytes read. The function never returns an error but might return less -// data than requested. -func (b *buffer) Read(p []byte) (n int, err error) { - n, err = b.Peek(p) - b.rear = b.addIndex(b.rear, n) - return n, err -} - -// Peek reads bytes from the buffer into p without changing the buffer. -// Peek will never return an error but might return less data than -// requested. -func (b *buffer) Peek(p []byte) (n int, err error) { - m := b.Buffered() - n = len(p) - if m < n { - n = m - p = p[:n] - } - k := copy(p, b.data[b.rear:]) - if k < n { - copy(p[k:], b.data) - } - return n, nil -} - -// Discard skips the n next bytes to read from the buffer, returning the -// bytes discarded. -// -// If Discards skips fewer than n bytes, it returns an error. -func (b *buffer) Discard(n int) (discarded int, err error) { - if n < 0 { - return 0, errors.New("buffer.Discard: negative argument") - } - m := b.Buffered() - if m < n { - n = m - err = errors.New( - "buffer.Discard: discarded less bytes then requested") - } - b.rear = b.addIndex(b.rear, n) - return n, err -} - -// ErrNoSpace indicates that there is insufficient space for the Write -// operation. -var ErrNoSpace = errors.New("insufficient space") - -// Write puts data into the buffer. If less bytes are written than -// requested ErrNoSpace is returned. -func (b *buffer) Write(p []byte) (n int, err error) { - m := b.Available() - n = len(p) - if m < n { - n = m - p = p[:m] - err = ErrNoSpace - } - k := copy(b.data[b.front:], p) - if k < n { - copy(b.data, p[k:]) - } - b.front = b.addIndex(b.front, n) - return n, err -} - -// WriteByte writes a single byte into the buffer. The error ErrNoSpace -// is returned if no single byte is available in the buffer for writing. -func (b *buffer) WriteByte(c byte) error { - if b.Available() < 1 { - return ErrNoSpace - } - b.data[b.front] = c - b.front = b.addIndex(b.front, 1) - return nil -} - -// prefixLen returns the length of the common prefix of a and b. -func prefixLen(a, b []byte) int { - if len(a) > len(b) { - a, b = b, a - } - for i, c := range a { - if b[i] != c { - return i - } - } - return len(a) -} - -// matchLen returns the length of the common prefix for the given -// distance from the rear and the byte slice p. -func (b *buffer) matchLen(distance int, p []byte) int { - var n int - i := b.rear - distance - if i < 0 { - if n = prefixLen(p, b.data[len(b.data)+i:]); n < -i { - return n - } - p = p[n:] - i = 0 - } - n += prefixLen(p, b.data[i:]) - return n -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go deleted file mode 100644 index 290606ddcc..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" -) - -// ErrLimit indicates that the limit of the LimitedByteWriter has been -// reached. -var ErrLimit = errors.New("limit reached") - -// LimitedByteWriter provides a byte writer that can be written until a -// limit is reached. The field N provides the number of remaining -// bytes. -type LimitedByteWriter struct { - BW io.ByteWriter - N int64 -} - -// WriteByte writes a single byte to the limited byte writer. It returns -// ErrLimit if the limit has been reached. If the byte is successfully -// written the field N of the LimitedByteWriter will be decremented by -// one. -func (l *LimitedByteWriter) WriteByte(c byte) error { - if l.N <= 0 { - return ErrLimit - } - if err := l.BW.WriteByte(c); err != nil { - return err - } - l.N-- - return nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/decoder.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/decoder.go deleted file mode 100644 index e5a760a50b..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/decoder.go +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "io" -) - -// decoder decodes a raw LZMA stream without any header. -type decoder struct { - // dictionary; the rear pointer of the buffer will be used for - // reading the data. - Dict *decoderDict - // decoder state - State *state - // range decoder - rd *rangeDecoder - // start stores the head value of the dictionary for the LZMA - // stream - start int64 - // size of uncompressed data - size int64 - // end-of-stream encountered - eos bool - // EOS marker found - eosMarker bool -} - -// newDecoder creates a new decoder instance. The parameter size provides -// the expected byte size of the decompressed data. If the size is -// unknown use a negative value. In that case the decoder will look for -// a terminating end-of-stream marker. -func newDecoder(br io.ByteReader, state *state, dict *decoderDict, size int64) (d *decoder, err error) { - rd, err := newRangeDecoder(br) - if err != nil { - return nil, err - } - d = &decoder{ - State: state, - Dict: dict, - rd: rd, - size: size, - start: dict.pos(), - } - return d, nil -} - -// Reopen restarts the decoder with a new byte reader and a new size. Reopen -// resets the Decompressed counter to zero. -func (d *decoder) Reopen(br io.ByteReader, size int64) error { - var err error - if d.rd, err = newRangeDecoder(br); err != nil { - return err - } - d.start = d.Dict.pos() - d.size = size - d.eos = false - return nil -} - -// decodeLiteral decodes a single literal from the LZMA stream. -func (d *decoder) decodeLiteral() (op operation, err error) { - litState := d.State.litState(d.Dict.byteAt(1), d.Dict.head) - match := d.Dict.byteAt(int(d.State.rep[0]) + 1) - s, err := d.State.litCodec.Decode(d.rd, d.State.state, match, litState) - if err != nil { - return nil, err - } - return lit{s}, nil -} - -// errEOS indicates that an EOS marker has been found. -var errEOS = errors.New("EOS marker found") - -// readOp decodes the next operation from the compressed stream. It -// returns the operation. If an explicit end of stream marker is -// identified the eos error is returned. -func (d *decoder) readOp() (op operation, err error) { - // Value of the end of stream (EOS) marker - const eosDist = 1<<32 - 1 - - state, state2, posState := d.State.states(d.Dict.head) - - b, err := d.State.isMatch[state2].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - // literal - op, err := d.decodeLiteral() - if err != nil { - return nil, err - } - d.State.updateStateLiteral() - return op, nil - } - b, err = d.State.isRep[state].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - // simple match - d.State.rep[3], d.State.rep[2], d.State.rep[1] = - d.State.rep[2], d.State.rep[1], d.State.rep[0] - - d.State.updateStateMatch() - // The length decoder returns the length offset. - n, err := d.State.lenCodec.Decode(d.rd, posState) - if err != nil { - return nil, err - } - // The dist decoder returns the distance offset. The actual - // distance is 1 higher. - d.State.rep[0], err = d.State.distCodec.Decode(d.rd, n) - if err != nil { - return nil, err - } - if d.State.rep[0] == eosDist { - d.eosMarker = true - return nil, errEOS - } - op = match{n: int(n) + minMatchLen, - distance: int64(d.State.rep[0]) + minDistance} - return op, nil - } - b, err = d.State.isRepG0[state].Decode(d.rd) - if err != nil { - return nil, err - } - dist := d.State.rep[0] - if b == 0 { - // rep match 0 - b, err = d.State.isRepG0Long[state2].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - d.State.updateStateShortRep() - op = match{n: 1, distance: int64(dist) + minDistance} - return op, nil - } - } else { - b, err = d.State.isRepG1[state].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - dist = d.State.rep[1] - } else { - b, err = d.State.isRepG2[state].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - dist = d.State.rep[2] - } else { - dist = d.State.rep[3] - d.State.rep[3] = d.State.rep[2] - } - d.State.rep[2] = d.State.rep[1] - } - d.State.rep[1] = d.State.rep[0] - d.State.rep[0] = dist - } - n, err := d.State.repLenCodec.Decode(d.rd, posState) - if err != nil { - return nil, err - } - d.State.updateStateRep() - op = match{n: int(n) + minMatchLen, distance: int64(dist) + minDistance} - return op, nil -} - -// apply takes the operation and transforms the decoder dictionary accordingly. -func (d *decoder) apply(op operation) error { - var err error - switch x := op.(type) { - case match: - err = d.Dict.writeMatch(x.distance, x.n) - case lit: - err = d.Dict.WriteByte(x.b) - default: - panic("op is neither a match nor a literal") - } - return err -} - -// decompress fills the dictionary unless no space for new data is -// available. If the end of the LZMA stream has been reached io.EOF will -// be returned. -func (d *decoder) decompress() error { - if d.eos { - return io.EOF - } - for d.Dict.Available() >= maxMatchLen { - op, err := d.readOp() - switch err { - case nil: - break - case errEOS: - d.eos = true - if !d.rd.possiblyAtEnd() { - return errDataAfterEOS - } - if d.size >= 0 && d.size != d.Decompressed() { - return errSize - } - return io.EOF - case io.EOF: - d.eos = true - return io.ErrUnexpectedEOF - default: - return err - } - if err = d.apply(op); err != nil { - return err - } - if d.size >= 0 && d.Decompressed() >= d.size { - d.eos = true - if d.Decompressed() > d.size { - return errSize - } - if !d.rd.possiblyAtEnd() { - switch _, err = d.readOp(); err { - case nil: - return errSize - case io.EOF: - return io.ErrUnexpectedEOF - case errEOS: - break - default: - return err - } - } - return io.EOF - } - } - return nil -} - -// Errors that may be returned while decoding data. -var ( - errDataAfterEOS = errors.New("lzma: data after end of stream marker") - errSize = errors.New("lzma: wrong uncompressed data size") -) - -// Read reads data from the buffer. If no more data is available io.EOF is -// returned. -func (d *decoder) Read(p []byte) (n int, err error) { - var k int - for { - // Read of decoder dict never returns an error. - k, err = d.Dict.Read(p[n:]) - if err != nil { - panic(fmt.Errorf("dictionary read error %s", err)) - } - if k == 0 && d.eos { - return n, io.EOF - } - n += k - if n >= len(p) { - return n, nil - } - if err = d.decompress(); err != nil && err != io.EOF { - return n, err - } - } -} - -// Decompressed returns the number of bytes decompressed by the decoder. -func (d *decoder) Decompressed() int64 { - return d.Dict.pos() - d.start -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go deleted file mode 100644 index ba06712b03..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" -) - -// decoderDict provides the dictionary for the decoder. The whole -// dictionary is used as reader buffer. -type decoderDict struct { - buf buffer - head int64 -} - -// newDecoderDict creates a new decoder dictionary. The whole dictionary -// will be used as reader buffer. -func newDecoderDict(dictCap int) (d *decoderDict, err error) { - // lower limit supports easy test cases - if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { - return nil, errors.New("lzma: dictCap out of range") - } - d = &decoderDict{buf: *newBuffer(dictCap)} - return d, nil -} - -// Reset clears the dictionary. The read buffer is not changed, so the -// buffered data can still be read. -func (d *decoderDict) Reset() { - d.head = 0 -} - -// WriteByte writes a single byte into the dictionary. It is used to -// write literals into the dictionary. -func (d *decoderDict) WriteByte(c byte) error { - if err := d.buf.WriteByte(c); err != nil { - return err - } - d.head++ - return nil -} - -// pos returns the position of the dictionary head. -func (d *decoderDict) pos() int64 { return d.head } - -// dictLen returns the actual length of the dictionary. -func (d *decoderDict) dictLen() int { - capacity := d.buf.Cap() - if d.head >= int64(capacity) { - return capacity - } - return int(d.head) -} - -// byteAt returns a byte stored in the dictionary. If the distance is -// non-positive or exceeds the current length of the dictionary the zero -// byte is returned. -func (d *decoderDict) byteAt(dist int) byte { - if !(0 < dist && dist <= d.dictLen()) { - return 0 - } - i := d.buf.front - dist - if i < 0 { - i += len(d.buf.data) - } - return d.buf.data[i] -} - -// writeMatch writes the match at the top of the dictionary. The given -// distance must point in the current dictionary and the length must not -// exceed the maximum length 273 supported in LZMA. -// -// The error value ErrNoSpace indicates that no space is available in -// the dictionary for writing. You need to read from the dictionary -// first. -func (d *decoderDict) writeMatch(dist int64, length int) error { - if !(0 < dist && dist <= int64(d.dictLen())) { - return errors.New("writeMatch: distance out of range") - } - if !(0 < length && length <= maxMatchLen) { - return errors.New("writeMatch: length out of range") - } - if length > d.buf.Available() { - return ErrNoSpace - } - d.head += int64(length) - - i := d.buf.front - int(dist) - if i < 0 { - i += len(d.buf.data) - } - for length > 0 { - var p []byte - if i >= d.buf.front { - p = d.buf.data[i:] - i = 0 - } else { - p = d.buf.data[i:d.buf.front] - i = d.buf.front - } - if len(p) > length { - p = p[:length] - } - if _, err := d.buf.Write(p); err != nil { - panic(fmt.Errorf("d.buf.Write returned error %s", err)) - } - length -= len(p) - } - return nil -} - -// Write writes the given bytes into the dictionary and advances the -// head. -func (d *decoderDict) Write(p []byte) (n int, err error) { - n, err = d.buf.Write(p) - d.head += int64(n) - return n, err -} - -// Available returns the number of available bytes for writing into the -// decoder dictionary. -func (d *decoderDict) Available() int { return d.buf.Available() } - -// Read reads data from the buffer contained in the decoder dictionary. -func (d *decoderDict) Read(p []byte) (n int, err error) { return d.buf.Read(p) } - -// Buffered returns the number of bytes currently buffered in the -// decoder dictionary. -func (d *decoderDict) buffered() int { return d.buf.Buffered() } - -// Peek gets data from the buffer without advancing the rear index. -func (d *decoderDict) peek(p []byte) (n int, err error) { return d.buf.Peek(p) } diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/directcodec.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/directcodec.go deleted file mode 100644 index e6e0c6ddf3..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/directcodec.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import "fmt" - -// directCodec allows the encoding and decoding of values with a fixed number -// of bits. The number of bits must be in the range [1,32]. -type directCodec byte - -// makeDirectCodec creates a directCodec. The function panics if the number of -// bits is not in the range [1,32]. -func makeDirectCodec(bits int) directCodec { - if !(1 <= bits && bits <= 32) { - panic(fmt.Errorf("bits=%d out of range", bits)) - } - return directCodec(bits) -} - -// Bits returns the number of bits supported by this codec. -func (dc directCodec) Bits() int { - return int(dc) -} - -// Encode uses the range encoder to encode a value with the fixed number of -// bits. The most-significant bit is encoded first. -func (dc directCodec) Encode(e *rangeEncoder, v uint32) error { - for i := int(dc) - 1; i >= 0; i-- { - if err := e.DirectEncodeBit(v >> uint(i)); err != nil { - return err - } - } - return nil -} - -// Decode uses the range decoder to decode a value with the given number of -// given bits. The most-significant bit is decoded first. -func (dc directCodec) Decode(d *rangeDecoder) (v uint32, err error) { - for i := int(dc) - 1; i >= 0; i-- { - x, err := d.DirectDecodeBit() - if err != nil { - return 0, err - } - v = (v << 1) | x - } - return v, nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/distcodec.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/distcodec.go deleted file mode 100644 index 69871c04ad..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/distcodec.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// Constants used by the distance codec. -const ( - // minimum supported distance - minDistance = 1 - // maximum supported distance, value is used for the eos marker. - maxDistance = 1 << 32 - // number of the supported len states - lenStates = 4 - // start for the position models - startPosModel = 4 - // first index with align bits support - endPosModel = 14 - // bits for the position slots - posSlotBits = 6 - // number of align bits - alignBits = 4 - // maximum position slot - maxPosSlot = 63 -) - -// distCodec provides encoding and decoding of distance values. -type distCodec struct { - posSlotCodecs [lenStates]treeCodec - posModel [endPosModel - startPosModel]treeReverseCodec - alignCodec treeReverseCodec -} - -// deepcopy initializes dc as deep copy of the source. -func (dc *distCodec) deepcopy(src *distCodec) { - if dc == src { - return - } - for i := range dc.posSlotCodecs { - dc.posSlotCodecs[i].deepcopy(&src.posSlotCodecs[i]) - } - for i := range dc.posModel { - dc.posModel[i].deepcopy(&src.posModel[i]) - } - dc.alignCodec.deepcopy(&src.alignCodec) -} - -// distBits returns the number of bits required to encode dist. -func distBits(dist uint32) int { - if dist < startPosModel { - return 6 - } - // slot s > 3, dist d - // s = 2(bits(d)-1) + bit(d, bits(d)-2) - // s>>1 = bits(d)-1 - // bits(d) = 32-nlz32(d) - // s>>1=31-nlz32(d) - // n = 5 + (s>>1) = 36 - nlz32(d) - return 36 - nlz32(dist) -} - -// newDistCodec creates a new distance codec. -func (dc *distCodec) init() { - for i := range dc.posSlotCodecs { - dc.posSlotCodecs[i] = makeTreeCodec(posSlotBits) - } - for i := range dc.posModel { - posSlot := startPosModel + i - bits := (posSlot >> 1) - 1 - dc.posModel[i] = makeTreeReverseCodec(bits) - } - dc.alignCodec = makeTreeReverseCodec(alignBits) -} - -// lenState converts the value l to a supported lenState value. -func lenState(l uint32) uint32 { - if l >= lenStates { - l = lenStates - 1 - } - return l -} - -// Encode encodes the distance using the parameter l. Dist can have values from -// the full range of uint32 values. To get the distance offset the actual match -// distance has to be decreased by 1. A distance offset of 0xffffffff (eos) -// indicates the end of the stream. -func (dc *distCodec) Encode(e *rangeEncoder, dist uint32, l uint32) (err error) { - // Compute the posSlot using nlz32 - var posSlot uint32 - var bits uint32 - if dist < startPosModel { - posSlot = dist - } else { - bits = uint32(30 - nlz32(dist)) - posSlot = startPosModel - 2 + (bits << 1) - posSlot += (dist >> uint(bits)) & 1 - } - - if err = dc.posSlotCodecs[lenState(l)].Encode(e, posSlot); err != nil { - return - } - - switch { - case posSlot < startPosModel: - return nil - case posSlot < endPosModel: - tc := &dc.posModel[posSlot-startPosModel] - return tc.Encode(dist, e) - } - dic := directCodec(bits - alignBits) - if err = dic.Encode(e, dist>>alignBits); err != nil { - return - } - return dc.alignCodec.Encode(dist, e) -} - -// Decode decodes the distance offset using the parameter l. The dist value -// 0xffffffff (eos) indicates the end of the stream. Add one to the distance -// offset to get the actual match distance. -func (dc *distCodec) Decode(d *rangeDecoder, l uint32) (dist uint32, err error) { - posSlot, err := dc.posSlotCodecs[lenState(l)].Decode(d) - if err != nil { - return - } - - // posSlot equals distance - if posSlot < startPosModel { - return posSlot, nil - } - - // posSlot uses the individual models - bits := (posSlot >> 1) - 1 - dist = (2 | (posSlot & 1)) << bits - var u uint32 - if posSlot < endPosModel { - tc := &dc.posModel[posSlot-startPosModel] - if u, err = tc.Decode(d); err != nil { - return 0, err - } - dist += u - return dist, nil - } - - // posSlots use direct encoding and a single model for the four align - // bits. - dic := directCodec(bits - alignBits) - if u, err = dic.Decode(d); err != nil { - return 0, err - } - dist += u << alignBits - if u, err = dc.alignCodec.Decode(d); err != nil { - return 0, err - } - dist += u - return dist, nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/encoder.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/encoder.go deleted file mode 100644 index 59055eb64c..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/encoder.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "fmt" - "io" -) - -// opLenMargin provides the upper limit of the number of bytes required -// to encode a single operation. -const opLenMargin = 16 - -// compressFlags control the compression process. -type compressFlags uint32 - -// Values for compressFlags. -const ( - // all data should be compressed, even if compression is not - // optimal. - all compressFlags = 1 << iota -) - -// encoderFlags provide the flags for an encoder. -type encoderFlags uint32 - -// Flags for the encoder. -const ( - // eosMarker requests an EOS marker to be written. - eosMarker encoderFlags = 1 << iota -) - -// Encoder compresses data buffered in the encoder dictionary and writes -// it into a byte writer. -type encoder struct { - dict *encoderDict - state *state - re *rangeEncoder - start int64 - // generate eos marker - marker bool - limit bool - margin int -} - -// newEncoder creates a new encoder. If the byte writer must be -// limited use LimitedByteWriter provided by this package. The flags -// argument supports the eosMarker flag, controlling whether a -// terminating end-of-stream marker must be written. -func newEncoder(bw io.ByteWriter, state *state, dict *encoderDict, - flags encoderFlags) (e *encoder, err error) { - - re, err := newRangeEncoder(bw) - if err != nil { - return nil, err - } - e = &encoder{ - dict: dict, - state: state, - re: re, - marker: flags&eosMarker != 0, - start: dict.Pos(), - margin: opLenMargin, - } - if e.marker { - e.margin += 5 - } - return e, nil -} - -// Write writes the bytes from p into the dictionary. If not enough -// space is available the data in the dictionary buffer will be -// compressed to make additional space available. If the limit of the -// underlying writer has been reached ErrLimit will be returned. -func (e *encoder) Write(p []byte) (n int, err error) { - for { - k, err := e.dict.Write(p[n:]) - n += k - if err == ErrNoSpace { - if err = e.compress(0); err != nil { - return n, err - } - continue - } - return n, err - } -} - -// Reopen reopens the encoder with a new byte writer. -func (e *encoder) Reopen(bw io.ByteWriter) error { - var err error - if e.re, err = newRangeEncoder(bw); err != nil { - return err - } - e.start = e.dict.Pos() - e.limit = false - return nil -} - -// writeLiteral writes a literal into the LZMA stream -func (e *encoder) writeLiteral(l lit) error { - var err error - state, state2, _ := e.state.states(e.dict.Pos()) - if err = e.state.isMatch[state2].Encode(e.re, 0); err != nil { - return err - } - litState := e.state.litState(e.dict.ByteAt(1), e.dict.Pos()) - match := e.dict.ByteAt(int(e.state.rep[0]) + 1) - err = e.state.litCodec.Encode(e.re, l.b, state, match, litState) - if err != nil { - return err - } - e.state.updateStateLiteral() - return nil -} - -// iverson implements the Iverson operator as proposed by Donald Knuth in his -// book Concrete Mathematics. -func iverson(ok bool) uint32 { - if ok { - return 1 - } - return 0 -} - -// writeMatch writes a repetition operation into the operation stream -func (e *encoder) writeMatch(m match) error { - var err error - if !(minDistance <= m.distance && m.distance <= maxDistance) { - panic(fmt.Errorf("match distance %d out of range", m.distance)) - } - dist := uint32(m.distance - minDistance) - if !(minMatchLen <= m.n && m.n <= maxMatchLen) && - !(dist == e.state.rep[0] && m.n == 1) { - panic(fmt.Errorf( - "match length %d out of range; dist %d rep[0] %d", - m.n, dist, e.state.rep[0])) - } - state, state2, posState := e.state.states(e.dict.Pos()) - if err = e.state.isMatch[state2].Encode(e.re, 1); err != nil { - return err - } - g := 0 - for ; g < 4; g++ { - if e.state.rep[g] == dist { - break - } - } - b := iverson(g < 4) - if err = e.state.isRep[state].Encode(e.re, b); err != nil { - return err - } - n := uint32(m.n - minMatchLen) - if b == 0 { - // simple match - e.state.rep[3], e.state.rep[2], e.state.rep[1], e.state.rep[0] = - e.state.rep[2], e.state.rep[1], e.state.rep[0], dist - e.state.updateStateMatch() - if err = e.state.lenCodec.Encode(e.re, n, posState); err != nil { - return err - } - return e.state.distCodec.Encode(e.re, dist, n) - } - b = iverson(g != 0) - if err = e.state.isRepG0[state].Encode(e.re, b); err != nil { - return err - } - if b == 0 { - // g == 0 - b = iverson(m.n != 1) - if err = e.state.isRepG0Long[state2].Encode(e.re, b); err != nil { - return err - } - if b == 0 { - e.state.updateStateShortRep() - return nil - } - } else { - // g in {1,2,3} - b = iverson(g != 1) - if err = e.state.isRepG1[state].Encode(e.re, b); err != nil { - return err - } - if b == 1 { - // g in {2,3} - b = iverson(g != 2) - err = e.state.isRepG2[state].Encode(e.re, b) - if err != nil { - return err - } - if b == 1 { - e.state.rep[3] = e.state.rep[2] - } - e.state.rep[2] = e.state.rep[1] - } - e.state.rep[1] = e.state.rep[0] - e.state.rep[0] = dist - } - e.state.updateStateRep() - return e.state.repLenCodec.Encode(e.re, n, posState) -} - -// writeOp writes a single operation to the range encoder. The function -// checks whether there is enough space available to close the LZMA -// stream. -func (e *encoder) writeOp(op operation) error { - if e.re.Available() < int64(e.margin) { - return ErrLimit - } - switch x := op.(type) { - case lit: - return e.writeLiteral(x) - case match: - return e.writeMatch(x) - default: - panic("unexpected operation") - } -} - -// compress compressed data from the dictionary buffer. If the flag all -// is set, all data in the dictionary buffer will be compressed. The -// function returns ErrLimit if the underlying writer has reached its -// limit. -func (e *encoder) compress(flags compressFlags) error { - n := 0 - if flags&all == 0 { - n = maxMatchLen - 1 - } - d := e.dict - m := d.m - for d.Buffered() > n { - op := m.NextOp(e.state.rep) - if err := e.writeOp(op); err != nil { - return err - } - d.Discard(op.Len()) - } - return nil -} - -// eosMatch is a pseudo operation that indicates the end of the stream. -var eosMatch = match{distance: maxDistance, n: minMatchLen} - -// Close terminates the LZMA stream. If requested the end-of-stream -// marker will be written. If the byte writer limit has been or will be -// reached during compression of the remaining data in the buffer the -// LZMA stream will be closed and data will remain in the buffer. -func (e *encoder) Close() error { - err := e.compress(all) - if err != nil && err != ErrLimit { - return err - } - if e.marker { - if err := e.writeMatch(eosMatch); err != nil { - return err - } - } - err = e.re.Close() - return err -} - -// Compressed returns the number bytes of the input data that been -// compressed. -func (e *encoder) Compressed() int64 { - return e.dict.Pos() - e.start -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go deleted file mode 100644 index 40f3d3f64a..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "io" -) - -// matcher is an interface that supports the identification of the next -// operation. -type matcher interface { - io.Writer - SetDict(d *encoderDict) - NextOp(rep [4]uint32) operation -} - -// encoderDict provides the dictionary of the encoder. It includes an -// addtional buffer atop of the actual dictionary. -type encoderDict struct { - buf buffer - m matcher - head int64 - capacity int - // preallocated array - data [maxMatchLen]byte -} - -// newEncoderDict creates the encoder dictionary. The argument bufSize -// defines the size of the additional buffer. -func newEncoderDict(dictCap, bufSize int, m matcher) (d *encoderDict, err error) { - if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { - return nil, errors.New( - "lzma: dictionary capacity out of range") - } - if bufSize < 1 { - return nil, errors.New( - "lzma: buffer size must be larger than zero") - } - d = &encoderDict{ - buf: *newBuffer(dictCap + bufSize), - capacity: dictCap, - m: m, - } - m.SetDict(d) - return d, nil -} - -// Discard discards n bytes. Note that n must not be larger than -// MaxMatchLen. -func (d *encoderDict) Discard(n int) { - p := d.data[:n] - k, _ := d.buf.Read(p) - if k < n { - panic(fmt.Errorf("lzma: can't discard %d bytes", n)) - } - d.head += int64(n) - d.m.Write(p) -} - -// Len returns the data available in the encoder dictionary. -func (d *encoderDict) Len() int { - n := d.buf.Available() - if int64(n) > d.head { - return int(d.head) - } - return n -} - -// DictLen returns the actual length of data in the dictionary. -func (d *encoderDict) DictLen() int { - if d.head < int64(d.capacity) { - return int(d.head) - } - return d.capacity -} - -// Available returns the number of bytes that can be written by a -// following Write call. -func (d *encoderDict) Available() int { - return d.buf.Available() - d.DictLen() -} - -// Write writes data into the dictionary buffer. Note that the position -// of the dictionary head will not be moved. If there is not enough -// space in the buffer ErrNoSpace will be returned. -func (d *encoderDict) Write(p []byte) (n int, err error) { - m := d.Available() - if len(p) > m { - p = p[:m] - err = ErrNoSpace - } - var e error - if n, e = d.buf.Write(p); e != nil { - err = e - } - return n, err -} - -// Pos returns the position of the head. -func (d *encoderDict) Pos() int64 { return d.head } - -// ByteAt returns the byte at the given distance. -func (d *encoderDict) ByteAt(distance int) byte { - if !(0 < distance && distance <= d.Len()) { - return 0 - } - i := d.buf.rear - distance - if i < 0 { - i += len(d.buf.data) - } - return d.buf.data[i] -} - -// CopyN copies the last n bytes from the dictionary into the provided -// writer. This is used for copying uncompressed data into an -// uncompressed segment. -func (d *encoderDict) CopyN(w io.Writer, n int) (written int, err error) { - if n <= 0 { - return 0, nil - } - m := d.Len() - if n > m { - n = m - err = ErrNoSpace - } - i := d.buf.rear - n - var e error - if i < 0 { - i += len(d.buf.data) - if written, e = w.Write(d.buf.data[i:]); e != nil { - return written, e - } - i = 0 - } - var k int - k, e = w.Write(d.buf.data[i:d.buf.rear]) - written += k - if e != nil { - err = e - } - return written, err -} - -// Buffered returns the number of bytes in the buffer. -func (d *encoderDict) Buffered() int { return d.buf.Buffered() } diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/fox.lzma b/ibm/vendor/github.com/ulikunitz/xz/lzma/fox.lzma deleted file mode 100644 index 5edad63326..0000000000 Binary files a/ibm/vendor/github.com/ulikunitz/xz/lzma/fox.lzma and /dev/null differ diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/hashtable.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/hashtable.go deleted file mode 100644 index e82970eac2..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/hashtable.go +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - - "github.com/ulikunitz/xz/internal/hash" -) - -/* For compression we need to find byte sequences that match the byte - * sequence at the dictionary head. A hash table is a simple method to - * provide this capability. - */ - -// maxMatches limits the number of matches requested from the Matches -// function. This controls the speed of the overall encoding. -const maxMatches = 16 - -// shortDists defines the number of short distances supported by the -// implementation. -const shortDists = 8 - -// The minimum is somehow arbitrary but the maximum is limited by the -// memory requirements of the hash table. -const ( - minTableExponent = 9 - maxTableExponent = 20 -) - -// newRoller contains the function used to create an instance of the -// hash.Roller. -var newRoller = func(n int) hash.Roller { return hash.NewCyclicPoly(n) } - -// hashTable stores the hash table including the rolling hash method. -// -// We implement chained hashing into a circular buffer. Each entry in -// the circular buffer stores the delta distance to the next position with a -// word that has the same hash value. -type hashTable struct { - dict *encoderDict - // actual hash table - t []int64 - // circular list data with the offset to the next word - data []uint32 - front int - // mask for computing the index for the hash table - mask uint64 - // hash offset; initial value is -int64(wordLen) - hoff int64 - // length of the hashed word - wordLen int - // hash roller for computing the hash values for the Write - // method - wr hash.Roller - // hash roller for computing arbitrary hashes - hr hash.Roller - // preallocated slices - p [maxMatches]int64 - distances [maxMatches + shortDists]int -} - -// hashTableExponent derives the hash table exponent from the dictionary -// capacity. -func hashTableExponent(n uint32) int { - e := 30 - nlz32(n) - switch { - case e < minTableExponent: - e = minTableExponent - case e > maxTableExponent: - e = maxTableExponent - } - return e -} - -// newHashTable creates a new hash table for words of length wordLen -func newHashTable(capacity int, wordLen int) (t *hashTable, err error) { - if !(0 < capacity) { - return nil, errors.New( - "newHashTable: capacity must not be negative") - } - exp := hashTableExponent(uint32(capacity)) - if !(1 <= wordLen && wordLen <= 4) { - return nil, errors.New("newHashTable: " + - "argument wordLen out of range") - } - n := 1 << uint(exp) - if n <= 0 { - panic("newHashTable: exponent is too large") - } - t = &hashTable{ - t: make([]int64, n), - data: make([]uint32, capacity), - mask: (uint64(1) << uint(exp)) - 1, - hoff: -int64(wordLen), - wordLen: wordLen, - wr: newRoller(wordLen), - hr: newRoller(wordLen), - } - return t, nil -} - -func (t *hashTable) SetDict(d *encoderDict) { t.dict = d } - -// buffered returns the number of bytes that are currently hashed. -func (t *hashTable) buffered() int { - n := t.hoff + 1 - switch { - case n <= 0: - return 0 - case n >= int64(len(t.data)): - return len(t.data) - } - return int(n) -} - -// addIndex adds n to an index ensuring that is stays inside the -// circular buffer for the hash chain. -func (t *hashTable) addIndex(i, n int) int { - i += n - len(t.data) - if i < 0 { - i += len(t.data) - } - return i -} - -// putDelta puts the delta instance at the current front of the circular -// chain buffer. -func (t *hashTable) putDelta(delta uint32) { - t.data[t.front] = delta - t.front = t.addIndex(t.front, 1) -} - -// putEntry puts a new entry into the hash table. If there is already a -// value stored it is moved into the circular chain buffer. -func (t *hashTable) putEntry(h uint64, pos int64) { - if pos < 0 { - return - } - i := h & t.mask - old := t.t[i] - 1 - t.t[i] = pos + 1 - var delta int64 - if old >= 0 { - delta = pos - old - if delta > 1<<32-1 || delta > int64(t.buffered()) { - delta = 0 - } - } - t.putDelta(uint32(delta)) -} - -// WriteByte converts a single byte into a hash and puts them into the hash -// table. -func (t *hashTable) WriteByte(b byte) error { - h := t.wr.RollByte(b) - t.hoff++ - t.putEntry(h, t.hoff) - return nil -} - -// Write converts the bytes provided into hash tables and stores the -// abbreviated offsets into the hash table. The method will never return an -// error. -func (t *hashTable) Write(p []byte) (n int, err error) { - for _, b := range p { - // WriteByte doesn't generate an error. - t.WriteByte(b) - } - return len(p), nil -} - -// getMatches the matches for a specific hash. The functions returns the -// number of positions found. -// -// TODO: Make a getDistances because that we are actually interested in. -func (t *hashTable) getMatches(h uint64, positions []int64) (n int) { - if t.hoff < 0 || len(positions) == 0 { - return 0 - } - buffered := t.buffered() - tailPos := t.hoff + 1 - int64(buffered) - rear := t.front - buffered - if rear >= 0 { - rear -= len(t.data) - } - // get the slot for the hash - pos := t.t[h&t.mask] - 1 - delta := pos - tailPos - for { - if delta < 0 { - return n - } - positions[n] = tailPos + delta - n++ - if n >= len(positions) { - return n - } - i := rear + int(delta) - if i < 0 { - i += len(t.data) - } - u := t.data[i] - if u == 0 { - return n - } - delta -= int64(u) - } -} - -// hash computes the rolling hash for the word stored in p. For correct -// results its length must be equal to t.wordLen. -func (t *hashTable) hash(p []byte) uint64 { - var h uint64 - for _, b := range p { - h = t.hr.RollByte(b) - } - return h -} - -// Matches fills the positions slice with potential matches. The -// functions returns the number of positions filled into positions. The -// byte slice p must have word length of the hash table. -func (t *hashTable) Matches(p []byte, positions []int64) int { - if len(p) != t.wordLen { - panic(fmt.Errorf( - "byte slice must have length %d", t.wordLen)) - } - h := t.hash(p) - return t.getMatches(h, positions) -} - -// NextOp identifies the next operation using the hash table. -// -// TODO: Use all repetitions to find matches. -func (t *hashTable) NextOp(rep [4]uint32) operation { - // get positions - data := t.dict.data[:maxMatchLen] - n, _ := t.dict.buf.Peek(data) - data = data[:n] - var p []int64 - if n < t.wordLen { - p = t.p[:0] - } else { - p = t.p[:maxMatches] - n = t.Matches(data[:t.wordLen], p) - p = p[:n] - } - - // convert positions in potential distances - head := t.dict.head - dists := append(t.distances[:0], 1, 2, 3, 4, 5, 6, 7, 8) - for _, pos := range p { - dis := int(head - pos) - if dis > shortDists { - dists = append(dists, dis) - } - } - - // check distances - var m match - dictLen := t.dict.DictLen() - for _, dist := range dists { - if dist > dictLen { - continue - } - - // Here comes a trick. We are only interested in matches - // that are longer than the matches we have been found - // before. So before we test the whole byte sequence at - // the given distance, we test the first byte that would - // make the match longer. If it doesn't match the byte - // to match, we don't to care any longer. - i := t.dict.buf.rear - dist + m.n - if i < 0 { - i += len(t.dict.buf.data) - } - if t.dict.buf.data[i] != data[m.n] { - // We can't get a longer match. Jump to the next - // distance. - continue - } - - n := t.dict.buf.matchLen(dist, data) - switch n { - case 0: - continue - case 1: - if uint32(dist-minDistance) != rep[0] { - continue - } - } - if n > m.n { - m = match{int64(dist), n} - if n == len(data) { - // No better match will be found. - break - } - } - } - - if m.n == 0 { - return lit{data[0]} - } - return m -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/header.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/header.go deleted file mode 100644 index cda39462ce..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/header.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" -) - -// uint32LE reads an uint32 integer from a byte slice -func uint32LE(b []byte) uint32 { - x := uint32(b[3]) << 24 - x |= uint32(b[2]) << 16 - x |= uint32(b[1]) << 8 - x |= uint32(b[0]) - return x -} - -// uint64LE converts the uint64 value stored as little endian to an uint64 -// value. -func uint64LE(b []byte) uint64 { - x := uint64(b[7]) << 56 - x |= uint64(b[6]) << 48 - x |= uint64(b[5]) << 40 - x |= uint64(b[4]) << 32 - x |= uint64(b[3]) << 24 - x |= uint64(b[2]) << 16 - x |= uint64(b[1]) << 8 - x |= uint64(b[0]) - return x -} - -// putUint32LE puts an uint32 integer into a byte slice that must have at least -// a length of 4 bytes. -func putUint32LE(b []byte, x uint32) { - b[0] = byte(x) - b[1] = byte(x >> 8) - b[2] = byte(x >> 16) - b[3] = byte(x >> 24) -} - -// putUint64LE puts the uint64 value into the byte slice as little endian -// value. The byte slice b must have at least place for 8 bytes. -func putUint64LE(b []byte, x uint64) { - b[0] = byte(x) - b[1] = byte(x >> 8) - b[2] = byte(x >> 16) - b[3] = byte(x >> 24) - b[4] = byte(x >> 32) - b[5] = byte(x >> 40) - b[6] = byte(x >> 48) - b[7] = byte(x >> 56) -} - -// noHeaderSize defines the value of the length field in the LZMA header. -const noHeaderSize uint64 = 1<<64 - 1 - -// HeaderLen provides the length of the LZMA file header. -const HeaderLen = 13 - -// header represents the header of an LZMA file. -type header struct { - properties Properties - dictCap int - // uncompressed size; negative value if no size is given - size int64 -} - -// marshalBinary marshals the header. -func (h *header) marshalBinary() (data []byte, err error) { - if err = h.properties.verify(); err != nil { - return nil, err - } - if !(0 <= h.dictCap && int64(h.dictCap) <= MaxDictCap) { - return nil, fmt.Errorf("lzma: DictCap %d out of range", - h.dictCap) - } - - data = make([]byte, 13) - - // property byte - data[0] = h.properties.Code() - - // dictionary capacity - putUint32LE(data[1:5], uint32(h.dictCap)) - - // uncompressed size - var s uint64 - if h.size > 0 { - s = uint64(h.size) - } else { - s = noHeaderSize - } - putUint64LE(data[5:], s) - - return data, nil -} - -// unmarshalBinary unmarshals the header. -func (h *header) unmarshalBinary(data []byte) error { - if len(data) != HeaderLen { - return errors.New("lzma.unmarshalBinary: data has wrong length") - } - - // properties - var err error - if h.properties, err = PropertiesForCode(data[0]); err != nil { - return err - } - - // dictionary capacity - h.dictCap = int(uint32LE(data[1:])) - if h.dictCap < 0 { - return errors.New( - "LZMA header: dictionary capacity exceeds maximum " + - "integer") - } - - // uncompressed size - s := uint64LE(data[5:]) - if s == noHeaderSize { - h.size = -1 - } else { - h.size = int64(s) - if h.size < 0 { - return errors.New( - "LZMA header: uncompressed size " + - "out of int64 range") - } - } - - return nil -} - -// validDictCap checks whether the dictionary capacity is correct. This -// is used to weed out wrong file headers. -func validDictCap(dictcap int) bool { - if int64(dictcap) == MaxDictCap { - return true - } - for n := uint(10); n < 32; n++ { - if dictcap == 1<= 10 or 2^32-1. If -// there is an explicit size it must not exceed 256 GiB. The length of -// the data argument must be HeaderLen. -func ValidHeader(data []byte) bool { - var h header - if err := h.unmarshalBinary(data); err != nil { - return false - } - if !validDictCap(h.dictCap) { - return false - } - return h.size < 0 || h.size <= 1<<38 -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/header2.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/header2.go deleted file mode 100644 index cd148812cd..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/header2.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "io" -) - -const ( - // maximum size of compressed data in a chunk - maxCompressed = 1 << 16 - // maximum size of uncompressed data in a chunk - maxUncompressed = 1 << 21 -) - -// chunkType represents the type of an LZMA2 chunk. Note that this -// value is an internal representation and no actual encoding of a LZMA2 -// chunk header. -type chunkType byte - -// Possible values for the chunk type. -const ( - // end of stream - cEOS chunkType = iota - // uncompressed; reset dictionary - cUD - // uncompressed; no reset of dictionary - cU - // LZMA compressed; no reset - cL - // LZMA compressed; reset state - cLR - // LZMA compressed; reset state; new property value - cLRN - // LZMA compressed; reset state; new property value; reset dictionary - cLRND -) - -// chunkTypeStrings provide a string representation for the chunk types. -var chunkTypeStrings = [...]string{ - cEOS: "EOS", - cU: "U", - cUD: "UD", - cL: "L", - cLR: "LR", - cLRN: "LRN", - cLRND: "LRND", -} - -// String returns a string representation of the chunk type. -func (c chunkType) String() string { - if !(cEOS <= c && c <= cLRND) { - return "unknown" - } - return chunkTypeStrings[c] -} - -// Actual encodings for the chunk types in the value. Note that the high -// uncompressed size bits are stored in the header byte additionally. -const ( - hEOS = 0 - hUD = 1 - hU = 2 - hL = 1 << 7 - hLR = 1<<7 | 1<<5 - hLRN = 1<<7 | 1<<6 - hLRND = 1<<7 | 1<<6 | 1<<5 -) - -// errHeaderByte indicates an unsupported value for the chunk header -// byte. These bytes starts the variable-length chunk header. -var errHeaderByte = errors.New("lzma: unsupported chunk header byte") - -// headerChunkType converts the header byte into a chunk type. It -// ignores the uncompressed size bits in the chunk header byte. -func headerChunkType(h byte) (c chunkType, err error) { - if h&hL == 0 { - // no compression - switch h { - case hEOS: - c = cEOS - case hUD: - c = cUD - case hU: - c = cU - default: - return 0, errHeaderByte - } - return - } - switch h & hLRND { - case hL: - c = cL - case hLR: - c = cLR - case hLRN: - c = cLRN - case hLRND: - c = cLRND - default: - return 0, errHeaderByte - } - return -} - -// uncompressedHeaderLen provides the length of an uncompressed header -const uncompressedHeaderLen = 3 - -// headerLen returns the length of the LZMA2 header for a given chunk -// type. -func headerLen(c chunkType) int { - switch c { - case cEOS: - return 1 - case cU, cUD: - return uncompressedHeaderLen - case cL, cLR: - return 5 - case cLRN, cLRND: - return 6 - } - panic(fmt.Errorf("unsupported chunk type %d", c)) -} - -// chunkHeader represents the contents of a chunk header. -type chunkHeader struct { - ctype chunkType - uncompressed uint32 - compressed uint16 - props Properties -} - -// String returns a string representation of the chunk header. -func (h *chunkHeader) String() string { - return fmt.Sprintf("%s %d %d %s", h.ctype, h.uncompressed, - h.compressed, &h.props) -} - -// UnmarshalBinary reads the content of the chunk header from the data -// slice. The slice must have the correct length. -func (h *chunkHeader) UnmarshalBinary(data []byte) error { - if len(data) == 0 { - return errors.New("no data") - } - c, err := headerChunkType(data[0]) - if err != nil { - return err - } - - n := headerLen(c) - if len(data) < n { - return errors.New("incomplete data") - } - if len(data) > n { - return errors.New("invalid data length") - } - - *h = chunkHeader{ctype: c} - if c == cEOS { - return nil - } - - h.uncompressed = uint32(uint16BE(data[1:3])) - if c <= cU { - return nil - } - h.uncompressed |= uint32(data[0]&^hLRND) << 16 - - h.compressed = uint16BE(data[3:5]) - if c <= cLR { - return nil - } - - h.props, err = PropertiesForCode(data[5]) - return err -} - -// MarshalBinary encodes the chunk header value. The function checks -// whether the content of the chunk header is correct. -func (h *chunkHeader) MarshalBinary() (data []byte, err error) { - if h.ctype > cLRND { - return nil, errors.New("invalid chunk type") - } - if err = h.props.verify(); err != nil { - return nil, err - } - - data = make([]byte, headerLen(h.ctype)) - - switch h.ctype { - case cEOS: - return data, nil - case cUD: - data[0] = hUD - case cU: - data[0] = hU - case cL: - data[0] = hL - case cLR: - data[0] = hLR - case cLRN: - data[0] = hLRN - case cLRND: - data[0] = hLRND - } - - putUint16BE(data[1:3], uint16(h.uncompressed)) - if h.ctype <= cU { - return data, nil - } - data[0] |= byte(h.uncompressed>>16) &^ hLRND - - putUint16BE(data[3:5], h.compressed) - if h.ctype <= cLR { - return data, nil - } - - data[5] = h.props.Code() - return data, nil -} - -// readChunkHeader reads the chunk header from the IO reader. -func readChunkHeader(r io.Reader) (h *chunkHeader, err error) { - p := make([]byte, 1, 6) - if _, err = io.ReadFull(r, p); err != nil { - return - } - c, err := headerChunkType(p[0]) - if err != nil { - return - } - p = p[:headerLen(c)] - if _, err = io.ReadFull(r, p[1:]); err != nil { - return - } - h = new(chunkHeader) - if err = h.UnmarshalBinary(p); err != nil { - return nil, err - } - return h, nil -} - -// uint16BE converts a big-endian uint16 representation to an uint16 -// value. -func uint16BE(p []byte) uint16 { - return uint16(p[0])<<8 | uint16(p[1]) -} - -// putUint16BE puts the big-endian uint16 presentation into the given -// slice. -func putUint16BE(p []byte, x uint16) { - p[0] = byte(x >> 8) - p[1] = byte(x) -} - -// chunkState is used to manage the state of the chunks -type chunkState byte - -// start and stop define the initial and terminating state of the chunk -// state -const ( - start chunkState = 'S' - stop = 'T' -) - -// errors for the chunk state handling -var ( - errChunkType = errors.New("lzma: unexpected chunk type") - errState = errors.New("lzma: wrong chunk state") -) - -// next transitions state based on chunk type input -func (c *chunkState) next(ctype chunkType) error { - switch *c { - // start state - case 'S': - switch ctype { - case cEOS: - *c = 'T' - case cUD: - *c = 'R' - case cLRND: - *c = 'L' - default: - return errChunkType - } - // normal LZMA mode - case 'L': - switch ctype { - case cEOS: - *c = 'T' - case cUD: - *c = 'R' - case cU: - *c = 'U' - case cL, cLR, cLRN, cLRND: - break - default: - return errChunkType - } - // reset required - case 'R': - switch ctype { - case cEOS: - *c = 'T' - case cUD, cU: - break - case cLRN, cLRND: - *c = 'L' - default: - return errChunkType - } - // uncompressed - case 'U': - switch ctype { - case cEOS: - *c = 'T' - case cUD: - *c = 'R' - case cU: - break - case cL, cLR, cLRN, cLRND: - *c = 'L' - default: - return errChunkType - } - // terminal state - case 'T': - return errChunkType - default: - return errState - } - return nil -} - -// defaultChunkType returns the default chunk type for each chunk state. -func (c chunkState) defaultChunkType() chunkType { - switch c { - case 'S': - return cLRND - case 'L', 'U': - return cL - case 'R': - return cLRN - default: - // no error - return cEOS - } -} - -// maxDictCap defines the maximum dictionary capacity supported by the -// LZMA2 dictionary capacity encoding. -const maxDictCap = 1<<32 - 1 - -// maxDictCapCode defines the maximum dictionary capacity code. -const maxDictCapCode = 40 - -// The function decodes the dictionary capacity byte, but doesn't change -// for the correct range of the given byte. -func decodeDictCap(c byte) int64 { - return (2 | int64(c)&1) << (11 + (c>>1)&0x1f) -} - -// DecodeDictCap decodes the encoded dictionary capacity. The function -// returns an error if the code is out of range. -func DecodeDictCap(c byte) (n int64, err error) { - if c >= maxDictCapCode { - if c == maxDictCapCode { - return maxDictCap, nil - } - return 0, errors.New("lzma: invalid dictionary size code") - } - return decodeDictCap(c), nil -} - -// EncodeDictCap encodes a dictionary capacity. The function returns the -// code for the capacity that is greater or equal n. If n exceeds the -// maximum support dictionary capacity, the maximum value is returned. -func EncodeDictCap(n int64) byte { - a, b := byte(0), byte(40) - for a < b { - c := a + (b-a)>>1 - m := decodeDictCap(c) - if n <= m { - if n == m { - return c - } - b = c - } else { - a = c + 1 - } - } - return a -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go deleted file mode 100644 index 927395bd80..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import "errors" - -// maxPosBits defines the number of bits of the position value that are used to -// to compute the posState value. The value is used to select the tree codec -// for length encoding and decoding. -const maxPosBits = 4 - -// minMatchLen and maxMatchLen give the minimum and maximum values for -// encoding and decoding length values. minMatchLen is also used as base -// for the encoded length values. -const ( - minMatchLen = 2 - maxMatchLen = minMatchLen + 16 + 256 - 1 -) - -// lengthCodec support the encoding of the length value. -type lengthCodec struct { - choice [2]prob - low [1 << maxPosBits]treeCodec - mid [1 << maxPosBits]treeCodec - high treeCodec -} - -// deepcopy initializes the lc value as deep copy of the source value. -func (lc *lengthCodec) deepcopy(src *lengthCodec) { - if lc == src { - return - } - lc.choice = src.choice - for i := range lc.low { - lc.low[i].deepcopy(&src.low[i]) - } - for i := range lc.mid { - lc.mid[i].deepcopy(&src.mid[i]) - } - lc.high.deepcopy(&src.high) -} - -// init initializes a new length codec. -func (lc *lengthCodec) init() { - for i := range lc.choice { - lc.choice[i] = probInit - } - for i := range lc.low { - lc.low[i] = makeTreeCodec(3) - } - for i := range lc.mid { - lc.mid[i] = makeTreeCodec(3) - } - lc.high = makeTreeCodec(8) -} - -// lBits gives the number of bits used for the encoding of the l value -// provided to the range encoder. -func lBits(l uint32) int { - switch { - case l < 8: - return 4 - case l < 16: - return 5 - default: - return 10 - } -} - -// Encode encodes the length offset. The length offset l can be compute by -// subtracting minMatchLen (2) from the actual length. -// -// l = length - minMatchLen -// -func (lc *lengthCodec) Encode(e *rangeEncoder, l uint32, posState uint32, -) (err error) { - if l > maxMatchLen-minMatchLen { - return errors.New("lengthCodec.Encode: l out of range") - } - if l < 8 { - if err = lc.choice[0].Encode(e, 0); err != nil { - return - } - return lc.low[posState].Encode(e, l) - } - if err = lc.choice[0].Encode(e, 1); err != nil { - return - } - if l < 16 { - if err = lc.choice[1].Encode(e, 0); err != nil { - return - } - return lc.mid[posState].Encode(e, l-8) - } - if err = lc.choice[1].Encode(e, 1); err != nil { - return - } - if err = lc.high.Encode(e, l-16); err != nil { - return - } - return nil -} - -// Decode reads the length offset. Add minMatchLen to compute the actual length -// to the length offset l. -func (lc *lengthCodec) Decode(d *rangeDecoder, posState uint32, -) (l uint32, err error) { - var b uint32 - if b, err = lc.choice[0].Decode(d); err != nil { - return - } - if b == 0 { - l, err = lc.low[posState].Decode(d) - return - } - if b, err = lc.choice[1].Decode(d); err != nil { - return - } - if b == 0 { - l, err = lc.mid[posState].Decode(d) - l += 8 - return - } - l, err = lc.high.Decode(d) - l += 16 - return -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go deleted file mode 100644 index ca31530fd5..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// literalCodec supports the encoding of literal. It provides 768 probability -// values per literal state. The upper 512 probabilities are used with the -// context of a match bit. -type literalCodec struct { - probs []prob -} - -// deepcopy initializes literal codec c as a deep copy of the source. -func (c *literalCodec) deepcopy(src *literalCodec) { - if c == src { - return - } - c.probs = make([]prob, len(src.probs)) - copy(c.probs, src.probs) -} - -// init initializes the literal codec. -func (c *literalCodec) init(lc, lp int) { - switch { - case !(minLC <= lc && lc <= maxLC): - panic("lc out of range") - case !(minLP <= lp && lp <= maxLP): - panic("lp out of range") - } - c.probs = make([]prob, 0x300<= 7 { - m := uint32(match) - for { - matchBit := (m >> 7) & 1 - m <<= 1 - bit := (r >> 7) & 1 - r <<= 1 - i := ((1 + matchBit) << 8) | symbol - if err = probs[i].Encode(e, bit); err != nil { - return - } - symbol = (symbol << 1) | bit - if matchBit != bit { - break - } - if symbol >= 0x100 { - break - } - } - } - for symbol < 0x100 { - bit := (r >> 7) & 1 - r <<= 1 - if err = probs[symbol].Encode(e, bit); err != nil { - return - } - symbol = (symbol << 1) | bit - } - return nil -} - -// Decode decodes a literal byte using the range decoder as well as the LZMA -// state, a match byte, and the literal state. -func (c *literalCodec) Decode(d *rangeDecoder, - state uint32, match byte, litState uint32, -) (s byte, err error) { - k := litState * 0x300 - probs := c.probs[k : k+0x300] - symbol := uint32(1) - if state >= 7 { - m := uint32(match) - for { - matchBit := (m >> 7) & 1 - m <<= 1 - i := ((1 + matchBit) << 8) | symbol - bit, err := d.DecodeBit(&probs[i]) - if err != nil { - return 0, err - } - symbol = (symbol << 1) | bit - if matchBit != bit { - break - } - if symbol >= 0x100 { - break - } - } - } - for symbol < 0x100 { - bit, err := d.DecodeBit(&probs[symbol]) - if err != nil { - return 0, err - } - symbol = (symbol << 1) | bit - } - s = byte(symbol - 0x100) - return s, nil -} - -// minLC and maxLC define the range for LC values. -const ( - minLC = 0 - maxLC = 8 -) - -// minLC and maxLC define the range for LP values. -const ( - minLP = 0 - maxLP = 4 -) - -// minState and maxState define a range for the state values stored in -// the State values. -const ( - minState = 0 - maxState = 11 -) diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go deleted file mode 100644 index 7d03ec0dc5..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import "errors" - -// MatchAlgorithm identifies an algorithm to find matches in the -// dictionary. -type MatchAlgorithm byte - -// Supported matcher algorithms. -const ( - HashTable4 MatchAlgorithm = iota - BinaryTree -) - -// maStrings are used by the String method. -var maStrings = map[MatchAlgorithm]string{ - HashTable4: "HashTable4", - BinaryTree: "BinaryTree", -} - -// String returns a string representation of the Matcher. -func (a MatchAlgorithm) String() string { - if s, ok := maStrings[a]; ok { - return s - } - return "unknown" -} - -var errUnsupportedMatchAlgorithm = errors.New( - "lzma: unsupported match algorithm value") - -// verify checks whether the matcher value is supported. -func (a MatchAlgorithm) verify() error { - if _, ok := maStrings[a]; !ok { - return errUnsupportedMatchAlgorithm - } - return nil -} - -func (a MatchAlgorithm) new(dictCap int) (m matcher, err error) { - switch a { - case HashTable4: - return newHashTable(dictCap, 4) - case BinaryTree: - return newBinTree(dictCap) - } - return nil, errUnsupportedMatchAlgorithm -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/operation.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/operation.go deleted file mode 100644 index a75c9b46c5..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/operation.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "unicode" -) - -// operation represents an operation on the dictionary during encoding or -// decoding. -type operation interface { - Len() int -} - -// rep represents a repetition at the given distance and the given length -type match struct { - // supports all possible distance values, including the eos marker - distance int64 - // length - n int -} - -// verify checks whether the match is valid. If that is not the case an -// error is returned. -func (m match) verify() error { - if !(minDistance <= m.distance && m.distance <= maxDistance) { - return errors.New("distance out of range") - } - if !(1 <= m.n && m.n <= maxMatchLen) { - return errors.New("length out of range") - } - return nil -} - -// l return the l-value for the match, which is the difference of length -// n and 2. -func (m match) l() uint32 { - return uint32(m.n - minMatchLen) -} - -// dist returns the dist value for the match, which is one less of the -// distance stored in the match. -func (m match) dist() uint32 { - return uint32(m.distance - minDistance) -} - -// Len returns the number of bytes matched. -func (m match) Len() int { - return m.n -} - -// String returns a string representation for the repetition. -func (m match) String() string { - return fmt.Sprintf("M{%d,%d}", m.distance, m.n) -} - -// lit represents a single byte literal. -type lit struct { - b byte -} - -// Len returns 1 for the single byte literal. -func (l lit) Len() int { - return 1 -} - -// String returns a string representation for the literal. -func (l lit) String() string { - var c byte - if unicode.IsPrint(rune(l.b)) { - c = l.b - } else { - c = '.' - } - return fmt.Sprintf("L{%c/%02x}", c, l.b) -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/prob.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/prob.go deleted file mode 100644 index 6987a166f0..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/prob.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// movebits defines the number of bits used for the updates of probability -// values. -const movebits = 5 - -// probbits defines the number of bits of a probability value. -const probbits = 11 - -// probInit defines 0.5 as initial value for prob values. -const probInit prob = 1 << (probbits - 1) - -// Type prob represents probabilities. The type can also be used to encode and -// decode single bits. -type prob uint16 - -// Dec decreases the probability. The decrease is proportional to the -// probability value. -func (p *prob) dec() { - *p -= *p >> movebits -} - -// Inc increases the probability. The Increase is proportional to the -// difference of 1 and the probability value. -func (p *prob) inc() { - *p += ((1 << probbits) - *p) >> movebits -} - -// Computes the new bound for a given range using the probability value. -func (p prob) bound(r uint32) uint32 { - return (r >> probbits) * uint32(p) -} - -// Bits returns 1. One is the number of bits that can be encoded or decoded -// with a single prob value. -func (p prob) Bits() int { - return 1 -} - -// Encode encodes the least-significant bit of v. Note that the p value will be -// changed. -func (p *prob) Encode(e *rangeEncoder, v uint32) error { - return e.EncodeBit(v, p) -} - -// Decode decodes a single bit. Note that the p value will change. -func (p *prob) Decode(d *rangeDecoder) (v uint32, err error) { - return d.DecodeBit(p) -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/properties.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/properties.go deleted file mode 100644 index 662feba872..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/properties.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" -) - -// maximum and minimum values for the LZMA properties. -const ( - minPB = 0 - maxPB = 4 -) - -// maxPropertyCode is the possible maximum of a properties code byte. -const maxPropertyCode = (maxPB+1)*(maxLP+1)*(maxLC+1) - 1 - -// Properties contains the parameters LC, LP and PB. The parameter LC -// defines the number of literal context bits; parameter LP the number -// of literal position bits and PB the number of position bits. -type Properties struct { - LC int - LP int - PB int -} - -// String returns the properties in a string representation. -func (p *Properties) String() string { - return fmt.Sprintf("LC %d LP %d PB %d", p.LC, p.LP, p.PB) -} - -// PropertiesForCode converts a properties code byte into a Properties value. -func PropertiesForCode(code byte) (p Properties, err error) { - if code > maxPropertyCode { - return p, errors.New("lzma: invalid properties code") - } - p.LC = int(code % 9) - code /= 9 - p.LP = int(code % 5) - code /= 5 - p.PB = int(code % 5) - return p, err -} - -// verify checks the properties for correctness. -func (p *Properties) verify() error { - if p == nil { - return errors.New("lzma: properties are nil") - } - if !(minLC <= p.LC && p.LC <= maxLC) { - return errors.New("lzma: lc out of range") - } - if !(minLP <= p.LP && p.LP <= maxLP) { - return errors.New("lzma: lp out of range") - } - if !(minPB <= p.PB && p.PB <= maxPB) { - return errors.New("lzma: pb out of range") - } - return nil -} - -// Code converts the properties to a byte. The function assumes that -// the properties components are all in range. -func (p Properties) Code() byte { - return byte((p.PB*5+p.LP)*9 + p.LC) -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go deleted file mode 100644 index 7189a03776..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" -) - -// rangeEncoder implements range encoding of single bits. The low value can -// overflow therefore we need uint64. The cache value is used to handle -// overflows. -type rangeEncoder struct { - lbw *LimitedByteWriter - nrange uint32 - low uint64 - cacheLen int64 - cache byte -} - -// maxInt64 provides the maximal value of the int64 type -const maxInt64 = 1<<63 - 1 - -// newRangeEncoder creates a new range encoder. -func newRangeEncoder(bw io.ByteWriter) (re *rangeEncoder, err error) { - lbw, ok := bw.(*LimitedByteWriter) - if !ok { - lbw = &LimitedByteWriter{BW: bw, N: maxInt64} - } - return &rangeEncoder{ - lbw: lbw, - nrange: 0xffffffff, - cacheLen: 1}, nil -} - -// Available returns the number of bytes that still can be written. The -// method takes the bytes that will be currently written by Close into -// account. -func (e *rangeEncoder) Available() int64 { - return e.lbw.N - (e.cacheLen + 4) -} - -// writeByte writes a single byte to the underlying writer. An error is -// returned if the limit is reached. The written byte will be counted if -// the underlying writer doesn't return an error. -func (e *rangeEncoder) writeByte(c byte) error { - if e.Available() < 1 { - return ErrLimit - } - return e.lbw.WriteByte(c) -} - -// DirectEncodeBit encodes the least-significant bit of b with probability 1/2. -func (e *rangeEncoder) DirectEncodeBit(b uint32) error { - e.nrange >>= 1 - e.low += uint64(e.nrange) & (0 - (uint64(b) & 1)) - - // normalize - const top = 1 << 24 - if e.nrange >= top { - return nil - } - e.nrange <<= 8 - return e.shiftLow() -} - -// EncodeBit encodes the least significant bit of b. The p value will be -// updated by the function depending on the bit encoded. -func (e *rangeEncoder) EncodeBit(b uint32, p *prob) error { - bound := p.bound(e.nrange) - if b&1 == 0 { - e.nrange = bound - p.inc() - } else { - e.low += uint64(bound) - e.nrange -= bound - p.dec() - } - - // normalize - const top = 1 << 24 - if e.nrange >= top { - return nil - } - e.nrange <<= 8 - return e.shiftLow() -} - -// Close writes a complete copy of the low value. -func (e *rangeEncoder) Close() error { - for i := 0; i < 5; i++ { - if err := e.shiftLow(); err != nil { - return err - } - } - return nil -} - -// shiftLow shifts the low value for 8 bit. The shifted byte is written into -// the byte writer. The cache value is used to handle overflows. -func (e *rangeEncoder) shiftLow() error { - if uint32(e.low) < 0xff000000 || (e.low>>32) != 0 { - tmp := e.cache - for { - err := e.writeByte(tmp + byte(e.low>>32)) - if err != nil { - return err - } - tmp = 0xff - e.cacheLen-- - if e.cacheLen <= 0 { - if e.cacheLen < 0 { - panic("negative cacheLen") - } - break - } - } - e.cache = byte(uint32(e.low) >> 24) - } - e.cacheLen++ - e.low = uint64(uint32(e.low) << 8) - return nil -} - -// rangeDecoder decodes single bits of the range encoding stream. -type rangeDecoder struct { - br io.ByteReader - nrange uint32 - code uint32 -} - -// init initializes the range decoder, by reading from the byte reader. -func (d *rangeDecoder) init() error { - d.nrange = 0xffffffff - d.code = 0 - - b, err := d.br.ReadByte() - if err != nil { - return err - } - if b != 0 { - return errors.New("newRangeDecoder: first byte not zero") - } - - for i := 0; i < 4; i++ { - if err = d.updateCode(); err != nil { - return err - } - } - - if d.code >= d.nrange { - return errors.New("newRangeDecoder: d.code >= d.nrange") - } - - return nil -} - -// newRangeDecoder initializes a range decoder. It reads five bytes from the -// reader and therefore may return an error. -func newRangeDecoder(br io.ByteReader) (d *rangeDecoder, err error) { - d = &rangeDecoder{br: br, nrange: 0xffffffff} - - b, err := d.br.ReadByte() - if err != nil { - return nil, err - } - if b != 0 { - return nil, errors.New("newRangeDecoder: first byte not zero") - } - - for i := 0; i < 4; i++ { - if err = d.updateCode(); err != nil { - return nil, err - } - } - - if d.code >= d.nrange { - return nil, errors.New("newRangeDecoder: d.code >= d.nrange") - } - - return d, nil -} - -// possiblyAtEnd checks whether the decoder may be at the end of the stream. -func (d *rangeDecoder) possiblyAtEnd() bool { - return d.code == 0 -} - -// DirectDecodeBit decodes a bit with probability 1/2. The return value b will -// contain the bit at the least-significant position. All other bits will be -// zero. -func (d *rangeDecoder) DirectDecodeBit() (b uint32, err error) { - d.nrange >>= 1 - d.code -= d.nrange - t := 0 - (d.code >> 31) - d.code += d.nrange & t - b = (t + 1) & 1 - - // d.code will stay less then d.nrange - - // normalize - // assume d.code < d.nrange - const top = 1 << 24 - if d.nrange >= top { - return b, nil - } - d.nrange <<= 8 - // d.code < d.nrange will be maintained - return b, d.updateCode() -} - -// decodeBit decodes a single bit. The bit will be returned at the -// least-significant position. All other bits will be zero. The probability -// value will be updated. -func (d *rangeDecoder) DecodeBit(p *prob) (b uint32, err error) { - bound := p.bound(d.nrange) - if d.code < bound { - d.nrange = bound - p.inc() - b = 0 - } else { - d.code -= bound - d.nrange -= bound - p.dec() - b = 1 - } - // normalize - // assume d.code < d.nrange - const top = 1 << 24 - if d.nrange >= top { - return b, nil - } - d.nrange <<= 8 - // d.code < d.nrange will be maintained - return b, d.updateCode() -} - -// updateCode reads a new byte into the code. -func (d *rangeDecoder) updateCode() error { - b, err := d.br.ReadByte() - if err != nil { - return err - } - d.code = (d.code << 8) | uint32(b) - return nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/reader.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/reader.go deleted file mode 100644 index 7b7eef31f8..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/reader.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lzma supports the decoding and encoding of LZMA streams. -// Reader and Writer support the classic LZMA format. Reader2 and -// Writer2 support the decoding and encoding of LZMA2 streams. -// -// The package is written completely in Go and doesn't rely on any external -// library. -package lzma - -import ( - "errors" - "io" -) - -// ReaderConfig stores the parameters for the reader of the classic LZMA -// format. -type ReaderConfig struct { - DictCap int -} - -// fill converts the zero values of the configuration to the default values. -func (c *ReaderConfig) fill() { - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } -} - -// Verify checks the reader configuration for errors. Zero values will -// be replaced by default values. -func (c *ReaderConfig) Verify() error { - c.fill() - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - return nil -} - -// Reader provides a reader for LZMA files or streams. -type Reader struct { - lzma io.Reader - h header - d *decoder -} - -// NewReader creates a new reader for an LZMA stream using the classic -// format. NewReader reads and checks the header of the LZMA stream. -func NewReader(lzma io.Reader) (r *Reader, err error) { - return ReaderConfig{}.NewReader(lzma) -} - -// NewReader creates a new reader for an LZMA stream in the classic -// format. The function reads and verifies the the header of the LZMA -// stream. -func (c ReaderConfig) NewReader(lzma io.Reader) (r *Reader, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - data := make([]byte, HeaderLen) - if _, err := io.ReadFull(lzma, data); err != nil { - if err == io.EOF { - return nil, errors.New("lzma: unexpected EOF") - } - return nil, err - } - r = &Reader{lzma: lzma} - if err = r.h.unmarshalBinary(data); err != nil { - return nil, err - } - if r.h.dictCap < MinDictCap { - return nil, errors.New("lzma: dictionary capacity too small") - } - dictCap := r.h.dictCap - if c.DictCap > dictCap { - dictCap = c.DictCap - } - - state := newState(r.h.properties) - dict, err := newDecoderDict(dictCap) - if err != nil { - return nil, err - } - r.d, err = newDecoder(ByteReader(lzma), state, dict, r.h.size) - if err != nil { - return nil, err - } - return r, nil -} - -// EOSMarker indicates that an EOS marker has been encountered. -func (r *Reader) EOSMarker() bool { - return r.d.eosMarker -} - -// Read returns uncompressed data. -func (r *Reader) Read(p []byte) (n int, err error) { - return r.d.Read(p) -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/reader2.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/reader2.go deleted file mode 100644 index 33074e6242..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/reader2.go +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" - - "github.com/ulikunitz/xz/internal/xlog" -) - -// Reader2Config stores the parameters for the LZMA2 reader. -// format. -type Reader2Config struct { - DictCap int -} - -// fill converts the zero values of the configuration to the default values. -func (c *Reader2Config) fill() { - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } -} - -// Verify checks the reader configuration for errors. Zero configuration values -// will be replaced by default values. -func (c *Reader2Config) Verify() error { - c.fill() - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - return nil -} - -// Reader2 supports the reading of LZMA2 chunk sequences. Note that the -// first chunk should have a dictionary reset and the first compressed -// chunk a properties reset. The chunk sequence may not be terminated by -// an end-of-stream chunk. -type Reader2 struct { - r io.Reader - err error - - dict *decoderDict - ur *uncompressedReader - decoder *decoder - chunkReader io.Reader - - cstate chunkState - ctype chunkType -} - -// NewReader2 creates a reader for an LZMA2 chunk sequence. -func NewReader2(lzma2 io.Reader) (r *Reader2, err error) { - return Reader2Config{}.NewReader2(lzma2) -} - -// NewReader2 creates an LZMA2 reader using the given configuration. -func (c Reader2Config) NewReader2(lzma2 io.Reader) (r *Reader2, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - r = &Reader2{r: lzma2, cstate: start} - r.dict, err = newDecoderDict(c.DictCap) - if err != nil { - return nil, err - } - if err = r.startChunk(); err != nil { - r.err = err - } - return r, nil -} - -// uncompressed tests whether the chunk type specifies an uncompressed -// chunk. -func uncompressed(ctype chunkType) bool { - return ctype == cU || ctype == cUD -} - -// startChunk parses a new chunk. -func (r *Reader2) startChunk() error { - r.chunkReader = nil - header, err := readChunkHeader(r.r) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - xlog.Debugf("chunk header %v", header) - if err = r.cstate.next(header.ctype); err != nil { - return err - } - if r.cstate == stop { - return io.EOF - } - if header.ctype == cUD || header.ctype == cLRND { - r.dict.Reset() - } - size := int64(header.uncompressed) + 1 - if uncompressed(header.ctype) { - if r.ur != nil { - r.ur.Reopen(r.r, size) - } else { - r.ur = newUncompressedReader(r.r, r.dict, size) - } - r.chunkReader = r.ur - return nil - } - br := ByteReader(io.LimitReader(r.r, int64(header.compressed)+1)) - if r.decoder == nil { - state := newState(header.props) - r.decoder, err = newDecoder(br, state, r.dict, size) - if err != nil { - return err - } - r.chunkReader = r.decoder - return nil - } - switch header.ctype { - case cLR: - r.decoder.State.Reset() - case cLRN, cLRND: - r.decoder.State = newState(header.props) - } - err = r.decoder.Reopen(br, size) - if err != nil { - return err - } - r.chunkReader = r.decoder - return nil -} - -// Read reads data from the LZMA2 chunk sequence. -func (r *Reader2) Read(p []byte) (n int, err error) { - if r.err != nil { - return 0, r.err - } - for n < len(p) { - var k int - k, err = r.chunkReader.Read(p[n:]) - n += k - if err != nil { - if err == io.EOF { - err = r.startChunk() - if err == nil { - continue - } - } - r.err = err - return n, err - } - if k == 0 { - r.err = errors.New("lzma: Reader2 doesn't get data") - return n, r.err - } - } - return n, nil -} - -// EOS returns whether the LZMA2 stream has been terminated by an -// end-of-stream chunk. -func (r *Reader2) EOS() bool { - return r.cstate == stop -} - -// uncompressedReader is used to read uncompressed chunks. -type uncompressedReader struct { - lr io.LimitedReader - Dict *decoderDict - eof bool - err error -} - -// newUncompressedReader initializes a new uncompressedReader. -func newUncompressedReader(r io.Reader, dict *decoderDict, size int64) *uncompressedReader { - ur := &uncompressedReader{ - lr: io.LimitedReader{R: r, N: size}, - Dict: dict, - } - return ur -} - -// Reopen reinitializes an uncompressed reader. -func (ur *uncompressedReader) Reopen(r io.Reader, size int64) { - ur.err = nil - ur.eof = false - ur.lr = io.LimitedReader{R: r, N: size} -} - -// fill reads uncompressed data into the dictionary. -func (ur *uncompressedReader) fill() error { - if !ur.eof { - n, err := io.CopyN(ur.Dict, &ur.lr, int64(ur.Dict.Available())) - if err != io.EOF { - return err - } - ur.eof = true - if n > 0 { - return nil - } - } - if ur.lr.N != 0 { - return io.ErrUnexpectedEOF - } - return io.EOF -} - -// Read reads uncompressed data from the limited reader. -func (ur *uncompressedReader) Read(p []byte) (n int, err error) { - if ur.err != nil { - return 0, ur.err - } - for { - var k int - k, err = ur.Dict.Read(p[n:]) - n += k - if n >= len(p) { - return n, nil - } - if err != nil { - break - } - err = ur.fill() - if err != nil { - break - } - } - ur.err = err - return n, err -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/state.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/state.go deleted file mode 100644 index 03f061cf10..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/state.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// states defines the overall state count -const states = 12 - -// State maintains the full state of the operation encoding or decoding -// process. -type state struct { - rep [4]uint32 - isMatch [states << maxPosBits]prob - isRepG0Long [states << maxPosBits]prob - isRep [states]prob - isRepG0 [states]prob - isRepG1 [states]prob - isRepG2 [states]prob - litCodec literalCodec - lenCodec lengthCodec - repLenCodec lengthCodec - distCodec distCodec - state uint32 - posBitMask uint32 - Properties Properties -} - -// initProbSlice initializes a slice of probabilities. -func initProbSlice(p []prob) { - for i := range p { - p[i] = probInit - } -} - -// Reset sets all state information to the original values. -func (s *state) Reset() { - p := s.Properties - *s = state{ - Properties: p, - // dict: s.dict, - posBitMask: (uint32(1) << uint(p.PB)) - 1, - } - initProbSlice(s.isMatch[:]) - initProbSlice(s.isRep[:]) - initProbSlice(s.isRepG0[:]) - initProbSlice(s.isRepG1[:]) - initProbSlice(s.isRepG2[:]) - initProbSlice(s.isRepG0Long[:]) - s.litCodec.init(p.LC, p.LP) - s.lenCodec.init() - s.repLenCodec.init() - s.distCodec.init() -} - -// initState initializes the state. -func initState(s *state, p Properties) { - *s = state{Properties: p} - s.Reset() -} - -// newState creates a new state from the give Properties. -func newState(p Properties) *state { - s := &state{Properties: p} - s.Reset() - return s -} - -// deepcopy initializes s as a deep copy of the source. -func (s *state) deepcopy(src *state) { - if s == src { - return - } - s.rep = src.rep - s.isMatch = src.isMatch - s.isRepG0Long = src.isRepG0Long - s.isRep = src.isRep - s.isRepG0 = src.isRepG0 - s.isRepG1 = src.isRepG1 - s.isRepG2 = src.isRepG2 - s.litCodec.deepcopy(&src.litCodec) - s.lenCodec.deepcopy(&src.lenCodec) - s.repLenCodec.deepcopy(&src.repLenCodec) - s.distCodec.deepcopy(&src.distCodec) - s.state = src.state - s.posBitMask = src.posBitMask - s.Properties = src.Properties -} - -// cloneState creates a new clone of the give state. -func cloneState(src *state) *state { - s := new(state) - s.deepcopy(src) - return s -} - -// updateStateLiteral updates the state for a literal. -func (s *state) updateStateLiteral() { - switch { - case s.state < 4: - s.state = 0 - return - case s.state < 10: - s.state -= 3 - return - } - s.state -= 6 -} - -// updateStateMatch updates the state for a match. -func (s *state) updateStateMatch() { - if s.state < 7 { - s.state = 7 - } else { - s.state = 10 - } -} - -// updateStateRep updates the state for a repetition. -func (s *state) updateStateRep() { - if s.state < 7 { - s.state = 8 - } else { - s.state = 11 - } -} - -// updateStateShortRep updates the state for a short repetition. -func (s *state) updateStateShortRep() { - if s.state < 7 { - s.state = 9 - } else { - s.state = 11 - } -} - -// states computes the states of the operation codec. -func (s *state) states(dictHead int64) (state1, state2, posState uint32) { - state1 = s.state - posState = uint32(dictHead) & s.posBitMask - state2 = (s.state << maxPosBits) | posState - return -} - -// litState computes the literal state. -func (s *state) litState(prev byte, dictHead int64) uint32 { - lp, lc := uint(s.Properties.LP), uint(s.Properties.LC) - litState := ((uint32(dictHead) & ((1 << lp) - 1)) << lc) | - (uint32(prev) >> (8 - lc)) - return litState -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go deleted file mode 100644 index 1cb3596fe1..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// treeCodec encodes or decodes values with a fixed bit size. It is using a -// tree of probability value. The root of the tree is the most-significant bit. -type treeCodec struct { - probTree -} - -// makeTreeCodec makes a tree codec. The bits value must be inside the range -// [1,32]. -func makeTreeCodec(bits int) treeCodec { - return treeCodec{makeProbTree(bits)} -} - -// deepcopy initializes tc as a deep copy of the source. -func (tc *treeCodec) deepcopy(src *treeCodec) { - tc.probTree.deepcopy(&src.probTree) -} - -// Encode uses the range encoder to encode a fixed-bit-size value. -func (tc *treeCodec) Encode(e *rangeEncoder, v uint32) (err error) { - m := uint32(1) - for i := int(tc.bits) - 1; i >= 0; i-- { - b := (v >> uint(i)) & 1 - if err := e.EncodeBit(b, &tc.probs[m]); err != nil { - return err - } - m = (m << 1) | b - } - return nil -} - -// Decodes uses the range decoder to decode a fixed-bit-size value. Errors may -// be caused by the range decoder. -func (tc *treeCodec) Decode(d *rangeDecoder) (v uint32, err error) { - m := uint32(1) - for j := 0; j < int(tc.bits); j++ { - b, err := d.DecodeBit(&tc.probs[m]) - if err != nil { - return 0, err - } - m = (m << 1) | b - } - return m - (1 << uint(tc.bits)), nil -} - -// treeReverseCodec is another tree codec, where the least-significant bit is -// the start of the probability tree. -type treeReverseCodec struct { - probTree -} - -// deepcopy initializes the treeReverseCodec as a deep copy of the -// source. -func (tc *treeReverseCodec) deepcopy(src *treeReverseCodec) { - tc.probTree.deepcopy(&src.probTree) -} - -// makeTreeReverseCodec creates treeReverseCodec value. The bits argument must -// be in the range [1,32]. -func makeTreeReverseCodec(bits int) treeReverseCodec { - return treeReverseCodec{makeProbTree(bits)} -} - -// Encode uses range encoder to encode a fixed-bit-size value. The range -// encoder may cause errors. -func (tc *treeReverseCodec) Encode(v uint32, e *rangeEncoder) (err error) { - m := uint32(1) - for i := uint(0); i < uint(tc.bits); i++ { - b := (v >> i) & 1 - if err := e.EncodeBit(b, &tc.probs[m]); err != nil { - return err - } - m = (m << 1) | b - } - return nil -} - -// Decodes uses the range decoder to decode a fixed-bit-size value. Errors -// returned by the range decoder will be returned. -func (tc *treeReverseCodec) Decode(d *rangeDecoder) (v uint32, err error) { - m := uint32(1) - for j := uint(0); j < uint(tc.bits); j++ { - b, err := d.DecodeBit(&tc.probs[m]) - if err != nil { - return 0, err - } - m = (m << 1) | b - v |= b << j - } - return v, nil -} - -// probTree stores enough probability values to be used by the treeEncode and -// treeDecode methods of the range coder types. -type probTree struct { - probs []prob - bits byte -} - -// deepcopy initializes the probTree value as a deep copy of the source. -func (t *probTree) deepcopy(src *probTree) { - if t == src { - return - } - t.probs = make([]prob, len(src.probs)) - copy(t.probs, src.probs) - t.bits = src.bits -} - -// makeProbTree initializes a probTree structure. -func makeProbTree(bits int) probTree { - if !(1 <= bits && bits <= 32) { - panic("bits outside of range [1,32]") - } - t := probTree{ - bits: byte(bits), - probs: make([]prob, 1< 0 { - c.SizeInHeader = true - } - if !c.SizeInHeader { - c.EOSMarker = true - } -} - -// Verify checks WriterConfig for errors. Verify will replace zero -// values with default values. -func (c *WriterConfig) Verify() error { - c.fill() - var err error - if c == nil { - return errors.New("lzma: WriterConfig is nil") - } - if c.Properties == nil { - return errors.New("lzma: WriterConfig has no Properties set") - } - if err = c.Properties.verify(); err != nil { - return err - } - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - if !(maxMatchLen <= c.BufSize) { - return errors.New("lzma: lookahead buffer size too small") - } - if c.SizeInHeader { - if c.Size < 0 { - return errors.New("lzma: negative size not supported") - } - } else if !c.EOSMarker { - return errors.New("lzma: EOS marker is required") - } - if err = c.Matcher.verify(); err != nil { - return err - } - - return nil -} - -// header returns the header structure for this configuration. -func (c *WriterConfig) header() header { - h := header{ - properties: *c.Properties, - dictCap: c.DictCap, - size: -1, - } - if c.SizeInHeader { - h.size = c.Size - } - return h -} - -// Writer writes an LZMA stream in the classic format. -type Writer struct { - h header - bw io.ByteWriter - buf *bufio.Writer - e *encoder -} - -// NewWriter creates a new LZMA writer for the classic format. The -// method will write the header to the underlying stream. -func (c WriterConfig) NewWriter(lzma io.Writer) (w *Writer, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - w = &Writer{h: c.header()} - - var ok bool - w.bw, ok = lzma.(io.ByteWriter) - if !ok { - w.buf = bufio.NewWriter(lzma) - w.bw = w.buf - } - state := newState(w.h.properties) - m, err := c.Matcher.new(w.h.dictCap) - if err != nil { - return nil, err - } - dict, err := newEncoderDict(w.h.dictCap, c.BufSize, m) - if err != nil { - return nil, err - } - var flags encoderFlags - if c.EOSMarker { - flags = eosMarker - } - if w.e, err = newEncoder(w.bw, state, dict, flags); err != nil { - return nil, err - } - - if err = w.writeHeader(); err != nil { - return nil, err - } - return w, nil -} - -// NewWriter creates a new LZMA writer using the classic format. The -// function writes the header to the underlying stream. -func NewWriter(lzma io.Writer) (w *Writer, err error) { - return WriterConfig{}.NewWriter(lzma) -} - -// writeHeader writes the LZMA header into the stream. -func (w *Writer) writeHeader() error { - data, err := w.h.marshalBinary() - if err != nil { - return err - } - _, err = w.bw.(io.Writer).Write(data) - return err -} - -// Write puts data into the Writer. -func (w *Writer) Write(p []byte) (n int, err error) { - if w.h.size >= 0 { - m := w.h.size - m -= w.e.Compressed() + int64(w.e.dict.Buffered()) - if m < 0 { - m = 0 - } - if m < int64(len(p)) { - p = p[:m] - err = ErrNoSpace - } - } - var werr error - if n, werr = w.e.Write(p); werr != nil { - err = werr - } - return n, err -} - -// Close closes the writer stream. It ensures that all data from the -// buffer will be compressed and the LZMA stream will be finished. -func (w *Writer) Close() error { - if w.h.size >= 0 { - n := w.e.Compressed() + int64(w.e.dict.Buffered()) - if n != w.h.size { - return errSize - } - } - err := w.e.Close() - if w.buf != nil { - ferr := w.buf.Flush() - if err == nil { - err = ferr - } - } - return err -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzma/writer2.go b/ibm/vendor/github.com/ulikunitz/xz/lzma/writer2.go deleted file mode 100644 index c263b0666a..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzma/writer2.go +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "bytes" - "errors" - "io" -) - -// Writer2Config is used to create a Writer2 using parameters. -type Writer2Config struct { - // The properties for the encoding. If the it is nil the value - // {LC: 3, LP: 0, PB: 2} will be chosen. - Properties *Properties - // The capacity of the dictionary. If DictCap is zero, the value - // 8 MiB will be chosen. - DictCap int - // Size of the lookahead buffer; value 0 indicates default size - // 4096 - BufSize int - // Match algorithm - Matcher MatchAlgorithm -} - -// fill replaces zero values with default values. -func (c *Writer2Config) fill() { - if c.Properties == nil { - c.Properties = &Properties{LC: 3, LP: 0, PB: 2} - } - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } - if c.BufSize == 0 { - c.BufSize = 4096 - } -} - -// Verify checks the Writer2Config for correctness. Zero values will be -// replaced by default values. -func (c *Writer2Config) Verify() error { - c.fill() - var err error - if c == nil { - return errors.New("lzma: WriterConfig is nil") - } - if c.Properties == nil { - return errors.New("lzma: WriterConfig has no Properties set") - } - if err = c.Properties.verify(); err != nil { - return err - } - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - if !(maxMatchLen <= c.BufSize) { - return errors.New("lzma: lookahead buffer size too small") - } - if c.Properties.LC+c.Properties.LP > 4 { - return errors.New("lzma: sum of lc and lp exceeds 4") - } - if err = c.Matcher.verify(); err != nil { - return err - } - return nil -} - -// Writer2 supports the creation of an LZMA2 stream. But note that -// written data is buffered, so call Flush or Close to write data to the -// underlying writer. The Close method writes the end-of-stream marker -// to the stream. So you may be able to concatenate the output of two -// writers as long the output of the first writer has only been flushed -// but not closed. -// -// Any change to the fields Properties, DictCap must be done before the -// first call to Write, Flush or Close. -type Writer2 struct { - w io.Writer - - start *state - encoder *encoder - - cstate chunkState - ctype chunkType - - buf bytes.Buffer - lbw LimitedByteWriter -} - -// NewWriter2 creates an LZMA2 chunk sequence writer with the default -// parameters and options. -func NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { - return Writer2Config{}.NewWriter2(lzma2) -} - -// NewWriter2 creates a new LZMA2 writer using the given configuration. -func (c Writer2Config) NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - w = &Writer2{ - w: lzma2, - start: newState(*c.Properties), - cstate: start, - ctype: start.defaultChunkType(), - } - w.buf.Grow(maxCompressed) - w.lbw = LimitedByteWriter{BW: &w.buf, N: maxCompressed} - m, err := c.Matcher.new(c.DictCap) - if err != nil { - return nil, err - } - d, err := newEncoderDict(c.DictCap, c.BufSize, m) - if err != nil { - return nil, err - } - w.encoder, err = newEncoder(&w.lbw, cloneState(w.start), d, 0) - if err != nil { - return nil, err - } - return w, nil -} - -// written returns the number of bytes written to the current chunk -func (w *Writer2) written() int { - if w.encoder == nil { - return 0 - } - return int(w.encoder.Compressed()) + w.encoder.dict.Buffered() -} - -// errClosed indicates that the writer is closed. -var errClosed = errors.New("lzma: writer closed") - -// Writes data to LZMA2 stream. Note that written data will be buffered. -// Use Flush or Close to ensure that data is written to the underlying -// writer. -func (w *Writer2) Write(p []byte) (n int, err error) { - if w.cstate == stop { - return 0, errClosed - } - for n < len(p) { - m := maxUncompressed - w.written() - if m <= 0 { - panic("lzma: maxUncompressed reached") - } - var q []byte - if n+m < len(p) { - q = p[n : n+m] - } else { - q = p[n:] - } - k, err := w.encoder.Write(q) - n += k - if err != nil && err != ErrLimit { - return n, err - } - if err == ErrLimit || k == m { - if err = w.flushChunk(); err != nil { - return n, err - } - } - } - return n, nil -} - -// writeUncompressedChunk writes an uncompressed chunk to the LZMA2 -// stream. -func (w *Writer2) writeUncompressedChunk() error { - u := w.encoder.Compressed() - if u <= 0 { - return errors.New("lzma: can't write empty uncompressed chunk") - } - if u > maxUncompressed { - panic("overrun of uncompressed data limit") - } - switch w.ctype { - case cLRND: - w.ctype = cUD - default: - w.ctype = cU - } - w.encoder.state = w.start - - header := chunkHeader{ - ctype: w.ctype, - uncompressed: uint32(u - 1), - } - hdata, err := header.MarshalBinary() - if err != nil { - return err - } - if _, err = w.w.Write(hdata); err != nil { - return err - } - _, err = w.encoder.dict.CopyN(w.w, int(u)) - return err -} - -// writeCompressedChunk writes a compressed chunk to the underlying -// writer. -func (w *Writer2) writeCompressedChunk() error { - if w.ctype == cU || w.ctype == cUD { - panic("chunk type uncompressed") - } - - u := w.encoder.Compressed() - if u <= 0 { - return errors.New("writeCompressedChunk: empty chunk") - } - if u > maxUncompressed { - panic("overrun of uncompressed data limit") - } - c := w.buf.Len() - if c <= 0 { - panic("no compressed data") - } - if c > maxCompressed { - panic("overrun of compressed data limit") - } - header := chunkHeader{ - ctype: w.ctype, - uncompressed: uint32(u - 1), - compressed: uint16(c - 1), - props: w.encoder.state.Properties, - } - hdata, err := header.MarshalBinary() - if err != nil { - return err - } - if _, err = w.w.Write(hdata); err != nil { - return err - } - _, err = io.Copy(w.w, &w.buf) - return err -} - -// writes a single chunk to the underlying writer. -func (w *Writer2) writeChunk() error { - u := int(uncompressedHeaderLen + w.encoder.Compressed()) - c := headerLen(w.ctype) + w.buf.Len() - if u < c { - return w.writeUncompressedChunk() - } - return w.writeCompressedChunk() -} - -// flushChunk terminates the current chunk. The encoder will be reset -// to support the next chunk. -func (w *Writer2) flushChunk() error { - if w.written() == 0 { - return nil - } - var err error - if err = w.encoder.Close(); err != nil { - return err - } - if err = w.writeChunk(); err != nil { - return err - } - w.buf.Reset() - w.lbw.N = maxCompressed - if err = w.encoder.Reopen(&w.lbw); err != nil { - return err - } - if err = w.cstate.next(w.ctype); err != nil { - return err - } - w.ctype = w.cstate.defaultChunkType() - w.start = cloneState(w.encoder.state) - return nil -} - -// Flush writes all buffered data out to the underlying stream. This -// could result in multiple chunks to be created. -func (w *Writer2) Flush() error { - if w.cstate == stop { - return errClosed - } - for w.written() > 0 { - if err := w.flushChunk(); err != nil { - return err - } - } - return nil -} - -// Close terminates the LZMA2 stream with an EOS chunk. -func (w *Writer2) Close() error { - if w.cstate == stop { - return errClosed - } - if err := w.Flush(); err != nil { - return nil - } - // write zero byte EOS chunk - _, err := w.w.Write([]byte{0}) - if err != nil { - return err - } - w.cstate = stop - return nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/lzmafilter.go b/ibm/vendor/github.com/ulikunitz/xz/lzmafilter.go deleted file mode 100644 index 6f4aa2c09c..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/lzmafilter.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import ( - "errors" - "fmt" - "io" - - "github.com/ulikunitz/xz/lzma" -) - -// LZMA filter constants. -const ( - lzmaFilterID = 0x21 - lzmaFilterLen = 3 -) - -// lzmaFilter declares the LZMA2 filter information stored in an xz -// block header. -type lzmaFilter struct { - dictCap int64 -} - -// String returns a representation of the LZMA filter. -func (f lzmaFilter) String() string { - return fmt.Sprintf("LZMA dict cap %#x", f.dictCap) -} - -// id returns the ID for the LZMA2 filter. -func (f lzmaFilter) id() uint64 { return lzmaFilterID } - -// MarshalBinary converts the lzmaFilter in its encoded representation. -func (f lzmaFilter) MarshalBinary() (data []byte, err error) { - c := lzma.EncodeDictCap(f.dictCap) - return []byte{lzmaFilterID, 1, c}, nil -} - -// UnmarshalBinary unmarshals the given data representation of the LZMA2 -// filter. -func (f *lzmaFilter) UnmarshalBinary(data []byte) error { - if len(data) != lzmaFilterLen { - return errors.New("xz: data for LZMA2 filter has wrong length") - } - if data[0] != lzmaFilterID { - return errors.New("xz: wrong LZMA2 filter id") - } - if data[1] != 1 { - return errors.New("xz: wrong LZMA2 filter size") - } - dc, err := lzma.DecodeDictCap(data[2]) - if err != nil { - return errors.New("xz: wrong LZMA2 dictionary size property") - } - - f.dictCap = dc - return nil -} - -// reader creates a new reader for the LZMA2 filter. -func (f lzmaFilter) reader(r io.Reader, c *ReaderConfig) (fr io.Reader, - err error) { - - config := new(lzma.Reader2Config) - if c != nil { - config.DictCap = c.DictCap - } - dc := int(f.dictCap) - if dc < 1 { - return nil, errors.New("xz: LZMA2 filter parameter " + - "dictionary capacity overflow") - } - if dc > config.DictCap { - config.DictCap = dc - } - - fr, err = config.NewReader2(r) - if err != nil { - return nil, err - } - return fr, nil -} - -// writeCloser creates a io.WriteCloser for the LZMA2 filter. -func (f lzmaFilter) writeCloser(w io.WriteCloser, c *WriterConfig, -) (fw io.WriteCloser, err error) { - config := new(lzma.Writer2Config) - if c != nil { - *config = lzma.Writer2Config{ - Properties: c.Properties, - DictCap: c.DictCap, - BufSize: c.BufSize, - Matcher: c.Matcher, - } - } - - dc := int(f.dictCap) - if dc < 1 { - return nil, errors.New("xz: LZMA2 filter parameter " + - "dictionary capacity overflow") - } - if dc > config.DictCap { - config.DictCap = dc - } - - fw, err = config.NewWriter2(w) - if err != nil { - return nil, err - } - return fw, nil -} - -// last returns true, because an LZMA2 filter must be the last filter in -// the filter list. -func (f lzmaFilter) last() bool { return true } diff --git a/ibm/vendor/github.com/ulikunitz/xz/make-docs b/ibm/vendor/github.com/ulikunitz/xz/make-docs deleted file mode 100644 index a8c612ce17..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/make-docs +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -x -pandoc -t html5 -f markdown -s --css=doc/md.css -o README.html README.md -pandoc -t html5 -f markdown -s --css=doc/md.css -o TODO.html TODO.md diff --git a/ibm/vendor/github.com/ulikunitz/xz/none-check.go b/ibm/vendor/github.com/ulikunitz/xz/none-check.go deleted file mode 100644 index e12d8e476b..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/none-check.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import "hash" - -type noneHash struct{} - -func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil } - -func (h noneHash) Sum(b []byte) []byte { return b } - -func (h noneHash) Reset() {} - -func (h noneHash) Size() int { return 0 } - -func (h noneHash) BlockSize() int { return 0 } - -func newNoneHash() hash.Hash { - return &noneHash{} -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/reader.go b/ibm/vendor/github.com/ulikunitz/xz/reader.go deleted file mode 100644 index 22cd6d5007..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/reader.go +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xz supports the compression and decompression of xz files. It -// supports version 1.0.4 of the specification without the non-LZMA2 -// filters. See http://tukaani.org/xz/xz-file-format-1.0.4.txt -package xz - -import ( - "bytes" - "errors" - "fmt" - "hash" - "io" - - "github.com/ulikunitz/xz/internal/xlog" - "github.com/ulikunitz/xz/lzma" -) - -// ReaderConfig defines the parameters for the xz reader. The -// SingleStream parameter requests the reader to assume that the -// underlying stream contains only a single stream. -type ReaderConfig struct { - DictCap int - SingleStream bool -} - -// fill replaces all zero values with their default values. -func (c *ReaderConfig) fill() { - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } -} - -// Verify checks the reader parameters for Validity. Zero values will be -// replaced by default values. -func (c *ReaderConfig) Verify() error { - if c == nil { - return errors.New("xz: reader parameters are nil") - } - lc := lzma.Reader2Config{DictCap: c.DictCap} - if err := lc.Verify(); err != nil { - return err - } - return nil -} - -// Reader supports the reading of one or multiple xz streams. -type Reader struct { - ReaderConfig - - xz io.Reader - sr *streamReader -} - -// streamReader decodes a single xz stream -type streamReader struct { - ReaderConfig - - xz io.Reader - br *blockReader - newHash func() hash.Hash - h header - index []record -} - -// NewReader creates a new xz reader using the default parameters. -// The function reads and checks the header of the first XZ stream. The -// reader will process multiple streams including padding. -func NewReader(xz io.Reader) (r *Reader, err error) { - return ReaderConfig{}.NewReader(xz) -} - -// NewReader creates an xz stream reader. The created reader will be -// able to process multiple streams and padding unless a SingleStream -// has been set in the reader configuration c. -func (c ReaderConfig) NewReader(xz io.Reader) (r *Reader, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - r = &Reader{ - ReaderConfig: c, - xz: xz, - } - if r.sr, err = c.newStreamReader(xz); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return nil, err - } - return r, nil -} - -var errUnexpectedData = errors.New("xz: unexpected data after stream") - -// Read reads uncompressed data from the stream. -func (r *Reader) Read(p []byte) (n int, err error) { - for n < len(p) { - if r.sr == nil { - if r.SingleStream { - data := make([]byte, 1) - _, err = io.ReadFull(r.xz, data) - if err != io.EOF { - return n, errUnexpectedData - } - return n, io.EOF - } - for { - r.sr, err = r.ReaderConfig.newStreamReader(r.xz) - if err != errPadding { - break - } - } - if err != nil { - return n, err - } - } - k, err := r.sr.Read(p[n:]) - n += k - if err != nil { - if err == io.EOF { - r.sr = nil - continue - } - return n, err - } - } - return n, nil -} - -var errPadding = errors.New("xz: padding (4 zero bytes) encountered") - -// newStreamReader creates a new xz stream reader using the given configuration -// parameters. NewReader reads and checks the header of the xz stream. -func (c ReaderConfig) newStreamReader(xz io.Reader) (r *streamReader, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - data := make([]byte, HeaderLen) - if _, err := io.ReadFull(xz, data[:4]); err != nil { - return nil, err - } - if bytes.Equal(data[:4], []byte{0, 0, 0, 0}) { - return nil, errPadding - } - if _, err = io.ReadFull(xz, data[4:]); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return nil, err - } - r = &streamReader{ - ReaderConfig: c, - xz: xz, - index: make([]record, 0, 4), - } - if err = r.h.UnmarshalBinary(data); err != nil { - return nil, err - } - xlog.Debugf("xz header %s", r.h) - if r.newHash, err = newHashFunc(r.h.flags); err != nil { - return nil, err - } - return r, nil -} - -// errIndex indicates an error with the xz file index. -var errIndex = errors.New("xz: error in xz file index") - -// readTail reads the index body and the xz footer. -func (r *streamReader) readTail() error { - index, n, err := readIndexBody(r.xz) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - if len(index) != len(r.index) { - return fmt.Errorf("xz: index length is %d; want %d", - len(index), len(r.index)) - } - for i, rec := range r.index { - if rec != index[i] { - return fmt.Errorf("xz: record %d is %v; want %v", - i, rec, index[i]) - } - } - - p := make([]byte, footerLen) - if _, err = io.ReadFull(r.xz, p); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - var f footer - if err = f.UnmarshalBinary(p); err != nil { - return err - } - xlog.Debugf("xz footer %s", f) - if f.flags != r.h.flags { - return errors.New("xz: footer flags incorrect") - } - if f.indexSize != int64(n)+1 { - return errors.New("xz: index size in footer wrong") - } - return nil -} - -// Read reads actual data from the xz stream. -func (r *streamReader) Read(p []byte) (n int, err error) { - for n < len(p) { - if r.br == nil { - bh, hlen, err := readBlockHeader(r.xz) - if err != nil { - if err == errIndexIndicator { - if err = r.readTail(); err != nil { - return n, err - } - return n, io.EOF - } - return n, err - } - xlog.Debugf("block %v", *bh) - r.br, err = r.ReaderConfig.newBlockReader(r.xz, bh, - hlen, r.newHash()) - if err != nil { - return n, err - } - } - k, err := r.br.Read(p[n:]) - n += k - if err != nil { - if err == io.EOF { - r.index = append(r.index, r.br.record()) - r.br = nil - } else { - return n, err - } - } - } - return n, nil -} - -// countingReader is a reader that counts the bytes read. -type countingReader struct { - r io.Reader - n int64 -} - -// Read reads data from the wrapped reader and adds it to the n field. -func (lr *countingReader) Read(p []byte) (n int, err error) { - n, err = lr.r.Read(p) - lr.n += int64(n) - return n, err -} - -// blockReader supports the reading of a block. -type blockReader struct { - lxz countingReader - header *blockHeader - headerLen int - n int64 - hash hash.Hash - r io.Reader - err error -} - -// newBlockReader creates a new block reader. -func (c *ReaderConfig) newBlockReader(xz io.Reader, h *blockHeader, - hlen int, hash hash.Hash) (br *blockReader, err error) { - - br = &blockReader{ - lxz: countingReader{r: xz}, - header: h, - headerLen: hlen, - hash: hash, - } - - fr, err := c.newFilterReader(&br.lxz, h.filters) - if err != nil { - return nil, err - } - if br.hash.Size() != 0 { - br.r = io.TeeReader(fr, br.hash) - } else { - br.r = fr - } - - return br, nil -} - -// uncompressedSize returns the uncompressed size of the block. -func (br *blockReader) uncompressedSize() int64 { - return br.n -} - -// compressedSize returns the compressed size of the block. -func (br *blockReader) compressedSize() int64 { - return br.lxz.n -} - -// unpaddedSize computes the unpadded size for the block. -func (br *blockReader) unpaddedSize() int64 { - n := int64(br.headerLen) - n += br.compressedSize() - n += int64(br.hash.Size()) - return n -} - -// record returns the index record for the current block. -func (br *blockReader) record() record { - return record{br.unpaddedSize(), br.uncompressedSize()} -} - -// errBlockSize indicates that the size of the block in the block header -// is wrong. -var errBlockSize = errors.New("xz: wrong uncompressed size for block") - -// Read reads data from the block. -func (br *blockReader) Read(p []byte) (n int, err error) { - n, err = br.r.Read(p) - br.n += int64(n) - - u := br.header.uncompressedSize - if u >= 0 && br.uncompressedSize() > u { - return n, errors.New("xz: wrong uncompressed size for block") - } - c := br.header.compressedSize - if c >= 0 && br.compressedSize() > c { - return n, errors.New("xz: wrong compressed size for block") - } - if err != io.EOF { - return n, err - } - if br.uncompressedSize() < u || br.compressedSize() < c { - return n, io.ErrUnexpectedEOF - } - - s := br.hash.Size() - k := padLen(br.lxz.n) - q := make([]byte, k+s, k+2*s) - if _, err = io.ReadFull(br.lxz.r, q); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return n, err - } - if !allZeros(q[:k]) { - return n, errors.New("xz: non-zero block padding") - } - checkSum := q[k:] - computedSum := br.hash.Sum(checkSum[s:]) - if !bytes.Equal(checkSum, computedSum) { - return n, errors.New("xz: checksum error for block") - } - return n, io.EOF -} - -func (c *ReaderConfig) newFilterReader(r io.Reader, f []filter) (fr io.Reader, - err error) { - - if err = verifyFilters(f); err != nil { - return nil, err - } - - fr = r - for i := len(f) - 1; i >= 0; i-- { - fr, err = f[i].reader(fr, c) - if err != nil { - return nil, err - } - } - return fr, nil -} diff --git a/ibm/vendor/github.com/ulikunitz/xz/writer.go b/ibm/vendor/github.com/ulikunitz/xz/writer.go deleted file mode 100644 index aec10dfa62..0000000000 --- a/ibm/vendor/github.com/ulikunitz/xz/writer.go +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import ( - "errors" - "hash" - "io" - - "github.com/ulikunitz/xz/lzma" -) - -// WriterConfig describe the parameters for an xz writer. -type WriterConfig struct { - Properties *lzma.Properties - DictCap int - BufSize int - BlockSize int64 - // checksum method: CRC32, CRC64 or SHA256 (default: CRC64) - CheckSum byte - // Forces NoChecksum (default: false) - NoCheckSum bool - // match algorithm - Matcher lzma.MatchAlgorithm -} - -// fill replaces zero values with default values. -func (c *WriterConfig) fill() { - if c.Properties == nil { - c.Properties = &lzma.Properties{LC: 3, LP: 0, PB: 2} - } - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } - if c.BufSize == 0 { - c.BufSize = 4096 - } - if c.BlockSize == 0 { - c.BlockSize = maxInt64 - } - if c.CheckSum == 0 { - c.CheckSum = CRC64 - } - if c.NoCheckSum { - c.CheckSum = None - } -} - -// Verify checks the configuration for errors. Zero values will be -// replaced by default values. -func (c *WriterConfig) Verify() error { - if c == nil { - return errors.New("xz: writer configuration is nil") - } - c.fill() - lc := lzma.Writer2Config{ - Properties: c.Properties, - DictCap: c.DictCap, - BufSize: c.BufSize, - Matcher: c.Matcher, - } - if err := lc.Verify(); err != nil { - return err - } - if c.BlockSize <= 0 { - return errors.New("xz: block size out of range") - } - if err := verifyFlags(c.CheckSum); err != nil { - return err - } - return nil -} - -// filters creates the filter list for the given parameters. -func (c *WriterConfig) filters() []filter { - return []filter{&lzmaFilter{int64(c.DictCap)}} -} - -// maxInt64 defines the maximum 64-bit signed integer. -const maxInt64 = 1<<63 - 1 - -// verifyFilters checks the filter list for the length and the right -// sequence of filters. -func verifyFilters(f []filter) error { - if len(f) == 0 { - return errors.New("xz: no filters") - } - if len(f) > 4 { - return errors.New("xz: more than four filters") - } - for _, g := range f[:len(f)-1] { - if g.last() { - return errors.New("xz: last filter is not last") - } - } - if !f[len(f)-1].last() { - return errors.New("xz: wrong last filter") - } - return nil -} - -// newFilterWriteCloser converts a filter list into a WriteCloser that -// can be used by a blockWriter. -func (c *WriterConfig) newFilterWriteCloser(w io.Writer, f []filter) (fw io.WriteCloser, err error) { - if err = verifyFilters(f); err != nil { - return nil, err - } - fw = nopWriteCloser(w) - for i := len(f) - 1; i >= 0; i-- { - fw, err = f[i].writeCloser(fw, c) - if err != nil { - return nil, err - } - } - return fw, nil -} - -// nopWCloser implements a WriteCloser with a Close method not doing -// anything. -type nopWCloser struct { - io.Writer -} - -// Close returns nil and doesn't do anything else. -func (c nopWCloser) Close() error { - return nil -} - -// nopWriteCloser converts the Writer into a WriteCloser with a Close -// function that does nothing beside returning nil. -func nopWriteCloser(w io.Writer) io.WriteCloser { - return nopWCloser{w} -} - -// Writer compresses data written to it. It is an io.WriteCloser. -type Writer struct { - WriterConfig - - xz io.Writer - bw *blockWriter - newHash func() hash.Hash - h header - index []record - closed bool -} - -// newBlockWriter creates a new block writer writes the header out. -func (w *Writer) newBlockWriter() error { - var err error - w.bw, err = w.WriterConfig.newBlockWriter(w.xz, w.newHash()) - if err != nil { - return err - } - if err = w.bw.writeHeader(w.xz); err != nil { - return err - } - return nil -} - -// closeBlockWriter closes a block writer and records the sizes in the -// index. -func (w *Writer) closeBlockWriter() error { - var err error - if err = w.bw.Close(); err != nil { - return err - } - w.index = append(w.index, w.bw.record()) - return nil -} - -// NewWriter creates a new xz writer using default parameters. -func NewWriter(xz io.Writer) (w *Writer, err error) { - return WriterConfig{}.NewWriter(xz) -} - -// NewWriter creates a new Writer using the given configuration parameters. -func (c WriterConfig) NewWriter(xz io.Writer) (w *Writer, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - w = &Writer{ - WriterConfig: c, - xz: xz, - h: header{c.CheckSum}, - index: make([]record, 0, 4), - } - if w.newHash, err = newHashFunc(c.CheckSum); err != nil { - return nil, err - } - data, err := w.h.MarshalBinary() - if _, err = xz.Write(data); err != nil { - return nil, err - } - if err = w.newBlockWriter(); err != nil { - return nil, err - } - return w, nil - -} - -// Write compresses the uncompressed data provided. -func (w *Writer) Write(p []byte) (n int, err error) { - if w.closed { - return 0, errClosed - } - for { - k, err := w.bw.Write(p[n:]) - n += k - if err != errNoSpace { - return n, err - } - if err = w.closeBlockWriter(); err != nil { - return n, err - } - if err = w.newBlockWriter(); err != nil { - return n, err - } - } -} - -// Close closes the writer and adds the footer to the Writer. Close -// doesn't close the underlying writer. -func (w *Writer) Close() error { - if w.closed { - return errClosed - } - w.closed = true - var err error - if err = w.closeBlockWriter(); err != nil { - return err - } - - f := footer{flags: w.h.flags} - if f.indexSize, err = writeIndex(w.xz, w.index); err != nil { - return err - } - data, err := f.MarshalBinary() - if err != nil { - return err - } - if _, err = w.xz.Write(data); err != nil { - return err - } - return nil -} - -// countingWriter is a writer that counts all data written to it. -type countingWriter struct { - w io.Writer - n int64 -} - -// Write writes data to the countingWriter. -func (cw *countingWriter) Write(p []byte) (n int, err error) { - n, err = cw.w.Write(p) - cw.n += int64(n) - if err == nil && cw.n < 0 { - return n, errors.New("xz: counter overflow") - } - return -} - -// blockWriter is writes a single block. -type blockWriter struct { - cxz countingWriter - // mw combines io.WriteCloser w and the hash. - mw io.Writer - w io.WriteCloser - n int64 - blockSize int64 - closed bool - headerLen int - - filters []filter - hash hash.Hash -} - -// newBlockWriter creates a new block writer. -func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWriter, err error) { - bw = &blockWriter{ - cxz: countingWriter{w: xz}, - blockSize: c.BlockSize, - filters: c.filters(), - hash: hash, - } - bw.w, err = c.newFilterWriteCloser(&bw.cxz, bw.filters) - if err != nil { - return nil, err - } - if bw.hash.Size() != 0 { - bw.mw = io.MultiWriter(bw.w, bw.hash) - } else { - bw.mw = bw.w - } - return bw, nil -} - -// writeHeader writes the header. If the function is called after Close -// the commpressedSize and uncompressedSize fields will be filled. -func (bw *blockWriter) writeHeader(w io.Writer) error { - h := blockHeader{ - compressedSize: -1, - uncompressedSize: -1, - filters: bw.filters, - } - if bw.closed { - h.compressedSize = bw.compressedSize() - h.uncompressedSize = bw.uncompressedSize() - } - data, err := h.MarshalBinary() - if err != nil { - return err - } - if _, err = w.Write(data); err != nil { - return err - } - bw.headerLen = len(data) - return nil -} - -// compressed size returns the amount of data written to the underlying -// stream. -func (bw *blockWriter) compressedSize() int64 { - return bw.cxz.n -} - -// uncompressedSize returns the number of data written to the -// blockWriter -func (bw *blockWriter) uncompressedSize() int64 { - return bw.n -} - -// unpaddedSize returns the sum of the header length, the uncompressed -// size of the block and the hash size. -func (bw *blockWriter) unpaddedSize() int64 { - if bw.headerLen <= 0 { - panic("xz: block header not written") - } - n := int64(bw.headerLen) - n += bw.compressedSize() - n += int64(bw.hash.Size()) - return n -} - -// record returns the record for the current stream. Call Close before -// calling this method. -func (bw *blockWriter) record() record { - return record{bw.unpaddedSize(), bw.uncompressedSize()} -} - -var errClosed = errors.New("xz: writer already closed") - -var errNoSpace = errors.New("xz: no space") - -// Write writes uncompressed data to the block writer. -func (bw *blockWriter) Write(p []byte) (n int, err error) { - if bw.closed { - return 0, errClosed - } - - t := bw.blockSize - bw.n - if int64(len(p)) > t { - err = errNoSpace - p = p[:t] - } - - var werr error - n, werr = bw.mw.Write(p) - bw.n += int64(n) - if werr != nil { - return n, werr - } - return n, err -} - -// Close closes the writer. -func (bw *blockWriter) Close() error { - if bw.closed { - return errClosed - } - bw.closed = true - if err := bw.w.Close(); err != nil { - return err - } - s := bw.hash.Size() - k := padLen(bw.cxz.n) - p := make([]byte, k+s) - bw.hash.Sum(p[k:k]) - if _, err := bw.cxz.w.Write(p); err != nil { - return err - } - return nil -} diff --git a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go index f50f196e2c..279a20ee53 100644 --- a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go +++ b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go @@ -538,7 +538,7 @@ func flattener(flattenList cty.Value) ([]cty.Value, []cty.ValueMarks, bool) { // Any dynamic types could result in more collections that need to be // flattened, so the type cannot be known. - if val.Type().Equals(cty.DynamicPseudoType) { + if val == cty.DynamicVal { isKnown = false } diff --git a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go index 5070a5adf5..339d04dbdb 100644 --- a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go +++ b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go @@ -30,7 +30,7 @@ var CSVDecodeFunc = function.New(&function.Spec{ return cty.DynamicPseudoType, fmt.Errorf("missing header line") } if err != nil { - return cty.DynamicPseudoType, err + return cty.DynamicPseudoType, csvError(err) } atys := make(map[string]cty.Type, len(headers)) @@ -64,7 +64,7 @@ var CSVDecodeFunc = function.New(&function.Spec{ break } if err != nil { - return cty.DynamicVal, err + return cty.DynamicVal, csvError(err) } vals := make(map[string]cty.Value, len(cols)) @@ -91,3 +91,12 @@ var CSVDecodeFunc = function.New(&function.Spec{ func CSVDecode(str cty.Value) (cty.Value, error) { return CSVDecodeFunc.Call([]cty.Value{str}) } + +func csvError(err error) error { + switch err := err.(type) { + case *csv.ParseError: + return fmt.Errorf("CSV parse error on line %d: %w", err.Line, err.Err) + default: + return err + } +} diff --git a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go index 63881f5853..8b17758950 100644 --- a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go +++ b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go @@ -114,6 +114,8 @@ var FormatListFunc = function.New(&function.Spec{ continue } iterators[i] = arg.ElementIterator() + case arg == cty.DynamicVal: + unknowns[i] = true default: singleVals[i] = arg } diff --git a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go index 7bbe584b0a..4effeb7bb8 100644 --- a/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go +++ b/ibm/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go @@ -371,14 +371,21 @@ var CeilFunc = function.New(&function.Spec{ }, Type: function.StaticReturnType(cty.Number), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { - var val float64 - if err := gocty.FromCtyValue(args[0], &val); err != nil { - return cty.UnknownVal(cty.String), err + f := args[0].AsBigFloat() + + if f.IsInf() { + return cty.NumberVal(f), nil } - if math.IsInf(val, 0) { - return cty.NumberFloatVal(val), nil + + i, acc := f.Int(nil) + switch acc { + case big.Exact, big.Above: + // Done. + case big.Below: + i.Add(i, big.NewInt(1)) } - return cty.NumberIntVal(int64(math.Ceil(val))), nil + + return cty.NumberVal(f.SetInt(i)), nil }, }) @@ -393,14 +400,21 @@ var FloorFunc = function.New(&function.Spec{ }, Type: function.StaticReturnType(cty.Number), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { - var val float64 - if err := gocty.FromCtyValue(args[0], &val); err != nil { - return cty.UnknownVal(cty.String), err + f := args[0].AsBigFloat() + + if f.IsInf() { + return cty.NumberVal(f), nil } - if math.IsInf(val, 0) { - return cty.NumberFloatVal(val), nil + + i, acc := f.Int(nil) + switch acc { + case big.Exact, big.Below: + // Done. + case big.Above: + i.Sub(i, big.NewInt(1)) } - return cty.NumberIntVal(int64(math.Floor(val))), nil + + return cty.NumberVal(f.SetInt(i)), nil }, }) diff --git a/ibm/vendor/github.com/zclconf/go-cty/cty/value_ops.go b/ibm/vendor/github.com/zclconf/go-cty/cty/value_ops.go index 8c37535c88..55bebe0365 100644 --- a/ibm/vendor/github.com/zclconf/go-cty/cty/value_ops.go +++ b/ibm/vendor/github.com/zclconf/go-cty/cty/value_ops.go @@ -116,9 +116,9 @@ func (val Value) GoString() string { // Use RawEquals to compare if two values are equal *ignoring* the // short-circuit rules and the exception for null values. func (val Value) Equals(other Value) Value { - if val.IsMarked() || other.IsMarked() { - val, valMarks := val.Unmark() - other, otherMarks := other.Unmark() + if val.ContainsMarked() || other.ContainsMarked() { + val, valMarks := val.UnmarkDeep() + other, otherMarks := other.UnmarkDeep() return val.Equals(other).WithMarks(valMarks, otherMarks) } @@ -1283,9 +1283,7 @@ func (val Value) AsBigFloat() *big.Float { } // Copy the float so that callers can't mutate our internal state - ret := *(val.v.(*big.Float)) - - return &ret + return new(big.Float).Copy(val.v.(*big.Float)) } // AsValueSlice returns a []cty.Value representation of a non-null, non-unknown diff --git a/ibm/vendor/github.com/zclconf/go-cty/cty/walk.go b/ibm/vendor/github.com/zclconf/go-cty/cty/walk.go index d17f48ccd1..87ba32e796 100644 --- a/ibm/vendor/github.com/zclconf/go-cty/cty/walk.go +++ b/ibm/vendor/github.com/zclconf/go-cty/cty/walk.go @@ -33,10 +33,15 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { return nil } + // The callback already got a chance to see the mark in our + // call above, so can safely strip it off here in order to + // visit the child elements, which might still have their own marks. + rawVal, _ := val.Unmark() + ty := val.Type() switch { case ty.IsObjectType(): - for it := val.ElementIterator(); it.Next(); { + for it := rawVal.ElementIterator(); it.Next(); { nameVal, av := it.Element() path := append(path, GetAttrStep{ Name: nameVal.AsString(), @@ -46,8 +51,8 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { return err } } - case val.CanIterateElements(): - for it := val.ElementIterator(); it.Next(); { + case rawVal.CanIterateElements(): + for it := rawVal.ElementIterator(); it.Next(); { kv, ev := it.Element() path := append(path, IndexStep{ Key: kv, @@ -134,6 +139,12 @@ func transform(path Path, val Value, t Transformer) (Value, error) { ty := val.Type() var newVal Value + // We need to peel off any marks here so that we can dig around + // inside any collection values. We'll reapply these to any + // new collections we construct, but the transformer's Exit + // method gets the final say on what to do with those. + rawVal, marks := val.Unmark() + switch { case val.IsNull() || !val.IsKnown(): @@ -141,14 +152,14 @@ func transform(path Path, val Value, t Transformer) (Value, error) { newVal = val case ty.IsListType() || ty.IsSetType() || ty.IsTupleType(): - l := val.LengthInt() + l := rawVal.LengthInt() switch l { case 0: // No deep transform for an empty sequence newVal = val default: elems := make([]Value, 0, l) - for it := val.ElementIterator(); it.Next(); { + for it := rawVal.ElementIterator(); it.Next(); { kv, ev := it.Element() path := append(path, IndexStep{ Key: kv, @@ -161,25 +172,25 @@ func transform(path Path, val Value, t Transformer) (Value, error) { } switch { case ty.IsListType(): - newVal = ListVal(elems) + newVal = ListVal(elems).WithMarks(marks) case ty.IsSetType(): - newVal = SetVal(elems) + newVal = SetVal(elems).WithMarks(marks) case ty.IsTupleType(): - newVal = TupleVal(elems) + newVal = TupleVal(elems).WithMarks(marks) default: panic("unknown sequence type") // should never happen because of the case we are in } } case ty.IsMapType(): - l := val.LengthInt() + l := rawVal.LengthInt() switch l { case 0: // No deep transform for an empty map newVal = val default: elems := make(map[string]Value) - for it := val.ElementIterator(); it.Next(); { + for it := rawVal.ElementIterator(); it.Next(); { kv, ev := it.Element() path := append(path, IndexStep{ Key: kv, @@ -190,7 +201,7 @@ func transform(path Path, val Value, t Transformer) (Value, error) { } elems[kv.AsString()] = newEv } - newVal = MapVal(elems) + newVal = MapVal(elems).WithMarks(marks) } case ty.IsObjectType(): @@ -212,7 +223,7 @@ func transform(path Path, val Value, t Transformer) (Value, error) { } newAVs[name] = newAV } - newVal = ObjectVal(newAVs) + newVal = ObjectVal(newAVs).WithMarks(marks) } default: diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson.go index 0c739dd0ac..95ffc1078d 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson.go @@ -7,8 +7,6 @@ // Based on gopkg.in/mgo.v2/bson by Gustavo Niemeyer // See THIRD-PARTY-NOTICES for original license terms. -// +build go1.9 - package bson // import "go.mongodb.org/mongo-driver/bson" import ( diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go deleted file mode 100644 index bbe7792848..0000000000 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) MongoDB, Inc. 2017-present. -// -// 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 - -// +build !go1.9 - -package bson // import "go.mongodb.org/mongo-driver/bson" - -import ( - "math" - "strconv" - "strings" -) - -// Zeroer allows custom struct types to implement a report of zero -// state. All struct types that don't implement Zeroer or where IsZero -// returns false are considered to be not zero. -type Zeroer interface { - IsZero() bool -} - -// D is an ordered representation of a BSON document. This type should be used when the order of the elements matters, -// such as MongoDB command documents. If the order of the elements does not matter, an M should be used instead. -// -// Example usage: -// -// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} -type D []E - -// Map creates a map from the elements of the D. -func (d D) Map() M { - m := make(M, len(d)) - for _, e := range d { - m[e.Key] = e.Value - } - return m -} - -// E represents a BSON element for a D. It is usually used inside a D. -type E struct { - Key string - Value interface{} -} - -// M is an unordered representation of a BSON document. This type should be used when the order of the elements does not -// matter. This type is handled as a regular map[string]interface{} when encoding and decoding. Elements will be -// serialized in an undefined, random order. If the order of the elements matters, a D should be used instead. -// -// Example usage: -// -// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} -type M map[string]interface{} - -// An A is an ordered representation of a BSON array. -// -// Example usage: -// -// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}} -type A []interface{} - -func formatDouble(f float64) string { - var s string - if math.IsInf(f, 1) { - s = "Infinity" - } else if math.IsInf(f, -1) { - s = "-Infinity" - } else if math.IsNaN(f) { - s = "NaN" - } else { - // Print exactly one decimalType place for integers; otherwise, print as many are necessary to - // perfectly represent it. - s = strconv.FormatFloat(f, 'G', -1, 64) - if !strings.ContainsRune(s, '.') { - s += ".0" - } - } - - return s -} diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go index 49a0c3f14b..6bdb43cb43 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go @@ -30,7 +30,7 @@ var errInvalidValue = errors.New("cannot encode invalid element") var sliceWriterPool = sync.Pool{ New: func() interface{} { - sw := make(bsonrw.SliceWriter, 0, 0) + sw := make(bsonrw.SliceWriter, 0) return &sw }, } @@ -333,14 +333,7 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum continue } - if enc, ok := currEncoder.(ValueEncoder); ok { - err = enc.EncodeValue(ec, vw, currVal) - if err != nil { - return err - } - continue - } - err = encoder.EncodeValue(ec, vw, currVal) + err = currEncoder.EncodeValue(ec, vw, currVal) if err != nil { return err } diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go index fbb8ef427c..1f7acbcf16 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go @@ -126,14 +126,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v continue } - if enc, ok := currEncoder.(ValueEncoder); ok { - err = enc.EncodeValue(ec, vw, currVal) - if err != nil { - return err - } - continue - } - err = encoder.EncodeValue(ec, vw, currVal) + err = currEncoder.EncodeValue(ec, vw, currVal) if err != nil { return err } @@ -265,17 +258,15 @@ func (mc *MapCodec) decodeKey(key string, keyType reflect.Type) (reflect.Value, case reflect.String: keyVal = reflect.ValueOf(key).Convert(keyType) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - s := string(key) - n, parseErr := strconv.ParseInt(s, 10, 64) + n, parseErr := strconv.ParseInt(key, 10, 64) if parseErr != nil || reflect.Zero(keyType).OverflowInt(n) { - err = fmt.Errorf("failed to unmarshal number key %v", s) + err = fmt.Errorf("failed to unmarshal number key %v", key) } keyVal = reflect.ValueOf(n).Convert(keyType) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - s := string(key) - n, parseErr := strconv.ParseUint(s, 10, 64) + n, parseErr := strconv.ParseUint(key, 10, 64) if parseErr != nil || reflect.Zero(keyType).OverflowUint(n) { - err = fmt.Errorf("failed to unmarshal number key %v", s) + err = fmt.Errorf("failed to unmarshal number key %v", key) break } keyVal = reflect.ValueOf(n).Convert(keyType) diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go index 60abffb248..02b9341ffe 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go @@ -54,12 +54,6 @@ func (entme ErrNoTypeMapEntry) Error() string { // ErrNotInterface is returned when the provided type is not an interface. var ErrNotInterface = errors.New("The provided type is not an interface") -var defaultRegistry *Registry - -func init() { - defaultRegistry = buildDefaultRegistry() -} - // A RegistryBuilder is used to build a Registry. This type is not goroutine // safe. type RegistryBuilder struct { @@ -374,7 +368,7 @@ func (r *Registry) lookupInterfaceEncoder(t reflect.Type, allowAddr bool) (Value // in interfaceEncoders defaultEnc, found := r.lookupInterfaceEncoder(t, false) if !found { - defaultEnc, _ = r.kindEncoders[t.Kind()] + defaultEnc = r.kindEncoders[t.Kind()] } return newCondAddrEncoder(ienc.ve, defaultEnc), true } @@ -445,7 +439,7 @@ func (r *Registry) lookupInterfaceDecoder(t reflect.Type, allowAddr bool) (Value // in interfaceDecoders defaultDec, found := r.lookupInterfaceDecoder(t, false) if !found { - defaultDec, _ = r.kindDecoders[t.Kind()] + defaultDec = r.kindDecoders[t.Kind()] } return newCondAddrDecoder(idec.vd, defaultDec), true } diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go index 9ce901782f..be3f2081e9 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go @@ -331,14 +331,7 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r return newDecodeError(fd.name, ErrNoDecoder{Type: field.Elem().Type()}) } - if decoder, ok := fd.decoder.(ValueDecoder); ok { - err = decoder.DecodeValue(dctx, vr, field.Elem()) - if err != nil { - return newDecodeError(fd.name, err) - } - continue - } - err = fd.decoder.DecodeValue(dctx, vr, field) + err = fd.decoder.DecodeValue(dctx, vr, field.Elem()) if err != nil { return newDecodeError(fd.name, err) } @@ -567,7 +560,7 @@ func (sc *StructCodec) describeStruct(r *Registry, t reflect.Type) (*structDescr } dominant, ok := dominantField(fields[i : i+advance]) if !ok || !sc.OverwriteDuplicatedInlinedFields { - return nil, fmt.Errorf("struct %s) duplicated key %s", t.String(), name) + return nil, fmt.Errorf("struct %s has duplicated key %s", t.String(), name) } sd.fl = append(sd.fl, dominant) sd.fm[name] = dominant diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go index fb5b51084d..07f4b70e6d 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go @@ -16,36 +16,12 @@ import ( "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" ) -var ptBool = reflect.TypeOf((*bool)(nil)) -var ptInt8 = reflect.TypeOf((*int8)(nil)) -var ptInt16 = reflect.TypeOf((*int16)(nil)) -var ptInt32 = reflect.TypeOf((*int32)(nil)) -var ptInt64 = reflect.TypeOf((*int64)(nil)) -var ptInt = reflect.TypeOf((*int)(nil)) -var ptUint8 = reflect.TypeOf((*uint8)(nil)) -var ptUint16 = reflect.TypeOf((*uint16)(nil)) -var ptUint32 = reflect.TypeOf((*uint32)(nil)) -var ptUint64 = reflect.TypeOf((*uint64)(nil)) -var ptUint = reflect.TypeOf((*uint)(nil)) -var ptFloat32 = reflect.TypeOf((*float32)(nil)) -var ptFloat64 = reflect.TypeOf((*float64)(nil)) -var ptString = reflect.TypeOf((*string)(nil)) - var tBool = reflect.TypeOf(false) -var tFloat32 = reflect.TypeOf(float32(0)) var tFloat64 = reflect.TypeOf(float64(0)) -var tInt = reflect.TypeOf(int(0)) -var tInt8 = reflect.TypeOf(int8(0)) -var tInt16 = reflect.TypeOf(int16(0)) var tInt32 = reflect.TypeOf(int32(0)) var tInt64 = reflect.TypeOf(int64(0)) var tString = reflect.TypeOf("") var tTime = reflect.TypeOf(time.Time{}) -var tUint = reflect.TypeOf(uint(0)) -var tUint8 = reflect.TypeOf(uint8(0)) -var tUint16 = reflect.TypeOf(uint16(0)) -var tUint32 = reflect.TypeOf(uint32(0)) -var tUint64 = reflect.TypeOf(uint64(0)) var tEmpty = reflect.TypeOf((*interface{})(nil)).Elem() var tByteSlice = reflect.TypeOf([]byte(nil)) @@ -74,7 +50,6 @@ var tDecimal = reflect.TypeOf(primitive.Decimal128{}) var tMinKey = reflect.TypeOf(primitive.MinKey{}) var tMaxKey = reflect.TypeOf(primitive.MaxKey{}) var tD = reflect.TypeOf(primitive.D{}) -var tM = reflect.TypeOf(primitive.M{}) var tA = reflect.TypeOf(primitive.A{}) var tE = reflect.TypeOf(primitive.E{}) diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go index 3af6fcf010..9695704246 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go @@ -19,7 +19,7 @@ import ( ) func wrapperKeyBSONType(key string) bsontype.Type { - switch string(key) { + switch key { case "$numberInt": return bsontype.Int32 case "$numberLong": @@ -269,7 +269,7 @@ func (ejv *extJSONValue) parseDouble() (float64, error) { return 0, fmt.Errorf("$numberDouble value should be string, but instead is %s", ejv.t) } - switch string(ejv.v.(string)) { + switch ejv.v.(string) { case "Infinity": return math.Inf(1), nil case "-Infinity": @@ -364,7 +364,7 @@ func (ejv *extJSONValue) parseRegex() (pattern, options string, err error) { for i, key := range regexObj.keys { val := regexObj.values[i] - switch string(key) { + switch key { case "pattern": if patFound { return "", "", errors.New("duplicate pattern key in $regularExpression") diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go index 605e41a138..99ed524b77 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go @@ -10,7 +10,6 @@ import ( "bytes" "encoding/base64" "fmt" - "go.mongodb.org/mongo-driver/bson/primitive" "io" "math" "sort" @@ -19,13 +18,9 @@ import ( "sync" "time" "unicode/utf8" -) -var ejvwPool = sync.Pool{ - New: func() interface{} { - return new(extJSONValueWriter) - }, -} + "go.mongodb.org/mongo-driver/bson/primitive" +) // ExtJSONValueWriterPool is a pool for ExtJSON ValueWriters. type ExtJSONValueWriterPool struct { diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go index 55378093a2..5e147373bc 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go @@ -790,16 +790,6 @@ func (vr *valueReader) readCString() (string, error) { return string(vr.d[start : start+int64(idx)]), nil } -func (vr *valueReader) skipCString() error { - idx := bytes.IndexByte(vr.d[vr.offset:], 0x00) - if idx < 0 { - return io.EOF - } - // idx does not include the null byte - vr.offset += int64(idx) + 1 - return nil -} - func (vr *valueReader) readString() (string, error) { length, err := vr.readLength() if err != nil { diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go index 7644df1290..dff65f87f7 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go @@ -76,27 +76,3 @@ func (sw *SliceWriter) Write(p []byte) (int, error) { *sw = append(*sw, p...) return written, nil } - -type writer []byte - -func (w *writer) Write(p []byte) (int, error) { - index := len(*w) - return w.WriteAt(p, int64(index)) -} - -func (w *writer) WriteAt(p []byte, off int64) (int, error) { - newend := off + int64(len(p)) - if newend < int64(len(*w)) { - newend = int64(len(*w)) - } - - if newend > int64(cap(*w)) { - buf := make([]byte, int64(2*cap(*w))+newend) - copy(buf, *w) - *w = buf - } - - *w = []byte(*w)[:newend] - copy([]byte(*w)[off:], p) - return len(p), nil -} diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go index 63a59ca08f..7c91ae5186 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go @@ -38,6 +38,8 @@ const ( BinaryUUIDOld byte = 0x03 BinaryUUID byte = 0x04 BinaryMD5 byte = 0x05 + BinaryEncrypted byte = 0x06 + BinaryColumn byte = 0x07 BinaryUserDefined byte = 0x80 ) diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/marshal.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/marshal.go index 8d8fc8ce1b..79f038581e 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/marshal.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/marshal.go @@ -7,6 +7,9 @@ package bson import ( + "bytes" + "encoding/json" + "go.mongodb.org/mongo-driver/bson/bsoncodec" "go.mongodb.org/mongo-driver/bson/bsonrw" "go.mongodb.org/mongo-driver/bson/bsontype" @@ -221,3 +224,22 @@ func MarshalExtJSONAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val return *sw, nil } + +func IndentExtJSON(dst *bytes.Buffer, src []byte, prefix, indent string) error { + return json.Indent(dst, src, prefix, indent) +} + +func MarshalExtJSONIndent(val interface{}, canonical, escapeHTML bool, prefix, indent string) ([]byte, error) { + marshaled, err := MarshalExtJSON(val, canonical, escapeHTML) + if err != nil { + return nil, err + } + + var buf bytes.Buffer + err = IndentExtJSON(&buf, marshaled, prefix, indent) + if err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go index a57e1d6987..ffe4eed07a 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go @@ -133,11 +133,9 @@ Loop: } // BigInt returns significand as big.Int and exponent, bi * 10 ^ exp. -func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { +func (d Decimal128) BigInt() (*big.Int, int, error) { high, low := d.GetBytes() - var posSign bool // positive sign - - posSign = high>>63&1 == 0 + posSign := high>>63&1 == 0 // positive sign switch high >> 58 & (1<<5 - 1) { case 0x1F: @@ -149,6 +147,7 @@ func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { return nil, 0, ErrParseNegInf } + var exp int if high>>61&3 == 3 { // Bits: 1*sign 2*ignored 14*exponent 111*significand. // Implicit 0b100 prefix in significand. @@ -171,7 +170,7 @@ func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { return new(big.Int), 0, nil } - bi = big.NewInt(0) + bi := big.NewInt(0) const host32bit = ^uint(0)>>32 == 0 if host32bit { bi.SetBits([]big.Word{big.Word(low), big.Word(low >> 32), big.Word(high), big.Word(high >> 32)}) @@ -182,7 +181,7 @@ func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { if !posSign { return bi.Neg(bi), exp, nil } - return + return bi, exp, nil } // IsNaN returns whether d is NaN. diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go index a5a7d7c698..652898fea7 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go @@ -10,8 +10,8 @@ package primitive import ( - "bytes" "crypto/rand" + "encoding" "encoding/binary" "encoding/hex" "encoding/json" @@ -34,6 +34,9 @@ var NilObjectID ObjectID var objectIDCounter = readRandomUint32() var processUnique = processUniqueBytes() +var _ encoding.TextMarshaler = ObjectID{} +var _ encoding.TextUnmarshaler = &ObjectID{} + // NewObjectID generates a new ObjectID. func NewObjectID() ObjectID { return NewObjectIDFromTimestamp(time.Now()) @@ -67,7 +70,7 @@ func (id ObjectID) String() string { // IsZero returns true if id is the empty ObjectID. func (id ObjectID) IsZero() bool { - return bytes.Equal(id[:], NilObjectID[:]) + return id == NilObjectID } // ObjectIDFromHex creates a new ObjectID from a hex string. It returns an error if the hex string is not a @@ -83,7 +86,7 @@ func ObjectIDFromHex(s string) (ObjectID, error) { } var oid [12]byte - copy(oid[:], b[:]) + copy(oid[:], b) return oid, nil } @@ -94,6 +97,23 @@ func IsValidObjectID(s string) bool { return err == nil } +// MarshalText returns the ObjectID as UTF-8-encoded text. Implementing this allows us to use ObjectID +// as a map key when marshalling JSON. See https://pkg.go.dev/encoding#TextMarshaler +func (id ObjectID) MarshalText() ([]byte, error) { + return []byte(id.Hex()), nil +} + +// UnmarshalText populates the byte slice with the ObjectID. Implementing this allows us to use ObjectID +// as a map key when unmarshalling JSON. See https://pkg.go.dev/encoding#TextUnmarshaler +func (id *ObjectID) UnmarshalText(b []byte) error { + oid, err := ObjectIDFromHex(string(b)) + if err != nil { + return err + } + *id = oid + return nil +} + // MarshalJSON returns the ObjectID as a string func (id ObjectID) MarshalJSON() ([]byte, error) { return json.Marshal(id.Hex()) diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go index 51984e223e..b3cba1bf9d 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go @@ -111,7 +111,7 @@ func (d DBPointer) String() string { // Equal compares d to d2 and returns true if they are equal. func (d DBPointer) Equal(d2 DBPointer) bool { - return d.DB == d2.DB && bytes.Equal(d.Pointer[:], d2.Pointer[:]) + return d == d2 } // IsZero returns if d is the empty DBPointer. diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go index f397fa2d58..1cbe3884d1 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go @@ -14,6 +14,9 @@ import ( "go.mongodb.org/mongo-driver/bson/bsonrw" ) +var tRawValue = reflect.TypeOf(RawValue{}) +var tRaw = reflect.TypeOf(Raw(nil)) + var primitiveCodecs PrimitiveCodecs // PrimitiveCodecs is a namespace for all of the default bsoncodec.Codecs for the primitive types @@ -87,25 +90,3 @@ func (PrimitiveCodecs) RawDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.Valu val.Set(reflect.ValueOf(rdr)) return err } - -func (pc PrimitiveCodecs) encodeRaw(ec bsoncodec.EncodeContext, dw bsonrw.DocumentWriter, raw Raw) error { - var copier bsonrw.Copier - elems, err := raw.Elements() - if err != nil { - return err - } - for _, elem := range elems { - dvw, err := dw.WriteDocumentElement(elem.Key()) - if err != nil { - return err - } - - val := elem.Value() - err = copier.CopyValueFromBytes(dvw, val.Type, val.Value) - if err != nil { - return err - } - } - - return dw.WriteDocumentEnd() -} diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/raw.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/raw.go index 2aae9f56ab..efd705daaa 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/raw.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/raw.go @@ -15,7 +15,6 @@ import ( // ErrNilReader indicates that an operation was attempted on a nil bson.Reader. var ErrNilReader = errors.New("nil reader") -var errValidateDone = errors.New("validation loop complete") // Raw is a wrapper around a byte slice. It will interpret the slice as a // BSON document. This type is a wrapper around a bsoncore.Document. Errors returned from the @@ -84,9 +83,3 @@ func (r Raw) IndexErr(index uint) (RawElement, error) { // String implements the fmt.Stringer interface. func (r Raw) String() string { return bsoncore.Document(r).String() } - -// readi32 is a helper function for reading an int32 from slice of bytes. -func readi32(b []byte) int32 { - _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 - return int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 -} diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/bson/types.go b/ibm/vendor/go.mongodb.org/mongo-driver/bson/types.go index bf91f691ad..13a1c35cf6 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/bson/types.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/bson/types.go @@ -7,11 +7,7 @@ package bson import ( - "reflect" - "time" - "go.mongodb.org/mongo-driver/bson/bsontype" - "go.mongodb.org/mongo-driver/bson/primitive" ) // These constants uniquely refer to each BSON type. @@ -38,48 +34,3 @@ const ( TypeMinKey = bsontype.MinKey TypeMaxKey = bsontype.MaxKey ) - -var tBinary = reflect.TypeOf(primitive.Binary{}) -var tBool = reflect.TypeOf(false) -var tCodeWithScope = reflect.TypeOf(primitive.CodeWithScope{}) -var tDBPointer = reflect.TypeOf(primitive.DBPointer{}) -var tDecimal = reflect.TypeOf(primitive.Decimal128{}) -var tD = reflect.TypeOf(D{}) -var tA = reflect.TypeOf(A{}) -var tDateTime = reflect.TypeOf(primitive.DateTime(0)) -var tUndefined = reflect.TypeOf(primitive.Undefined{}) -var tNull = reflect.TypeOf(primitive.Null{}) -var tRawValue = reflect.TypeOf(RawValue{}) -var tFloat32 = reflect.TypeOf(float32(0)) -var tFloat64 = reflect.TypeOf(float64(0)) -var tInt = reflect.TypeOf(int(0)) -var tInt8 = reflect.TypeOf(int8(0)) -var tInt16 = reflect.TypeOf(int16(0)) -var tInt32 = reflect.TypeOf(int32(0)) -var tInt64 = reflect.TypeOf(int64(0)) -var tJavaScript = reflect.TypeOf(primitive.JavaScript("")) -var tOID = reflect.TypeOf(primitive.ObjectID{}) -var tRaw = reflect.TypeOf(Raw(nil)) -var tRegex = reflect.TypeOf(primitive.Regex{}) -var tString = reflect.TypeOf("") -var tSymbol = reflect.TypeOf(primitive.Symbol("")) -var tTime = reflect.TypeOf(time.Time{}) -var tTimestamp = reflect.TypeOf(primitive.Timestamp{}) -var tUint = reflect.TypeOf(uint(0)) -var tUint8 = reflect.TypeOf(uint8(0)) -var tUint16 = reflect.TypeOf(uint16(0)) -var tUint32 = reflect.TypeOf(uint32(0)) -var tUint64 = reflect.TypeOf(uint64(0)) -var tMinKey = reflect.TypeOf(primitive.MinKey{}) -var tMaxKey = reflect.TypeOf(primitive.MaxKey{}) - -var tEmpty = reflect.TypeOf((*interface{})(nil)).Elem() -var tEmptySlice = reflect.TypeOf([]interface{}(nil)) - -var zeroVal reflect.Value - -// this references the quantity of milliseconds between zero time and -// the unix epoch. useful for making sure that we convert time.Time -// objects correctly to match the legacy bson library's handling of -// time.Time values. -const zeroEpochMs = int64(62135596800000) diff --git a/ibm/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go b/ibm/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go index ed95233d96..54aa617cfd 100644 --- a/ibm/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go +++ b/ibm/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go @@ -602,7 +602,7 @@ func (v Value) Time() time.Time { if !ok { panic(NewInsufficientBytesError(v.Data, v.Data)) } - return time.Unix(int64(dt)/1000, int64(dt)%1000*1000000) + return time.Unix(dt/1000, dt%1000*1000000) } // TimeOK is the same as Time, except it returns a boolean instead of @@ -615,7 +615,7 @@ func (v Value) TimeOK() (time.Time, bool) { if !ok { return time.Time{}, false } - return time.Unix(int64(dt)/1000, int64(dt)%1000*1000000), true + return time.Unix(dt/1000, dt%1000*1000000), true } // Regex returns the BSON regex value the Value represents. It panics if the value is a BSON diff --git a/ibm/vendor/go.opencensus.io/.gitignore b/ibm/vendor/go.opencensus.io/.gitignore deleted file mode 100644 index 74a6db472e..0000000000 --- a/ibm/vendor/go.opencensus.io/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.idea/ - -# go.opencensus.io/exporter/aws -/exporter/aws/ - -# Exclude vendor, use dep ensure after checkout: -/vendor/github.com/ -/vendor/golang.org/ -/vendor/google.golang.org/ diff --git a/ibm/vendor/go.opencensus.io/.travis.yml b/ibm/vendor/go.opencensus.io/.travis.yml deleted file mode 100644 index bd6b66ee83..0000000000 --- a/ibm/vendor/go.opencensus.io/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -go_import_path: go.opencensus.io - -go: - - 1.11.x - -env: - global: - GO111MODULE=on - -before_script: - - make install-tools - -script: - - make travis-ci - - go run internal/check/version.go # TODO move this to makefile diff --git a/ibm/vendor/go.opencensus.io/AUTHORS b/ibm/vendor/go.opencensus.io/AUTHORS deleted file mode 100644 index e491a9e7f7..0000000000 --- a/ibm/vendor/go.opencensus.io/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Google Inc. diff --git a/ibm/vendor/go.opencensus.io/CONTRIBUTING.md b/ibm/vendor/go.opencensus.io/CONTRIBUTING.md deleted file mode 100644 index 1ba3962c8b..0000000000 --- a/ibm/vendor/go.opencensus.io/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -# How to contribute - -We'd love to accept your patches and contributions to this project. There are -just a few small guidelines you need to follow. - -## Contributor License Agreement - -Contributions to this project must be accompanied by a Contributor License -Agreement. You (or your employer) retain the copyright to your contribution, -this simply gives us permission to use and redistribute your contributions as -part of the project. Head over to to see -your current agreements on file or to sign a new one. - -You generally only need to submit a CLA once, so if you've already submitted one -(even if it was for a different project), you probably don't need to do it -again. - -## Code reviews - -All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult [GitHub Help] for more -information on using pull requests. - -[GitHub Help]: https://help.github.com/articles/about-pull-requests/ - -## Instructions - -Fork the repo, checkout the upstream repo to your GOPATH by: - -``` -$ go get -d go.opencensus.io -``` - -Add your fork as an origin: - -``` -cd $(go env GOPATH)/src/go.opencensus.io -git remote add fork git@github.com:YOUR_GITHUB_USERNAME/opencensus-go.git -``` - -Run tests: - -``` -$ make install-tools # Only first time. -$ make -``` - -Checkout a new branch, make modifications and push the branch to your fork: - -``` -$ git checkout -b feature -# edit files -$ git commit -$ git push fork feature -``` - -Open a pull request against the main opencensus-go repo. - -## General Notes -This project uses Appveyor and Travis for CI. - -The dependencies are managed with `go mod` if you work with the sources under your -`$GOPATH` you need to set the environment variable `GO111MODULE=on`. \ No newline at end of file diff --git a/ibm/vendor/go.opencensus.io/LICENSE b/ibm/vendor/go.opencensus.io/LICENSE deleted file mode 100644 index 7a4a3ea242..0000000000 --- a/ibm/vendor/go.opencensus.io/LICENSE +++ /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. \ No newline at end of file diff --git a/ibm/vendor/go.opencensus.io/Makefile b/ibm/vendor/go.opencensus.io/Makefile deleted file mode 100644 index b3ce3df303..0000000000 --- a/ibm/vendor/go.opencensus.io/Makefile +++ /dev/null @@ -1,97 +0,0 @@ -# TODO: Fix this on windows. -ALL_SRC := $(shell find . -name '*.go' \ - -not -path './vendor/*' \ - -not -path '*/gen-go/*' \ - -type f | sort) -ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC)))) - -GOTEST_OPT?=-v -race -timeout 30s -GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic -GOTEST=go test -GOIMPORTS=goimports -GOLINT=golint -GOVET=go vet -EMBEDMD=embedmd -# TODO decide if we need to change these names. -TRACE_ID_LINT_EXCEPTION="type name will be used as trace.TraceID by other packages" -TRACE_OPTION_LINT_EXCEPTION="type name will be used as trace.TraceOptions by other packages" -README_FILES := $(shell find . -name '*README.md' | sort | tr '\n' ' ') - -.DEFAULT_GOAL := imports-lint-vet-embedmd-test - -.PHONY: imports-lint-vet-embedmd-test -imports-lint-vet-embedmd-test: imports lint vet embedmd test - -# TODO enable test-with-coverage in tavis -.PHONY: travis-ci -travis-ci: imports lint vet embedmd test test-386 - -all-pkgs: - @echo $(ALL_PKGS) | tr ' ' '\n' | sort - -all-srcs: - @echo $(ALL_SRC) | tr ' ' '\n' | sort - -.PHONY: test -test: - $(GOTEST) $(GOTEST_OPT) $(ALL_PKGS) - -.PHONY: test-386 -test-386: - GOARCH=386 $(GOTEST) -v -timeout 30s $(ALL_PKGS) - -.PHONY: test-with-coverage -test-with-coverage: - $(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS) - -.PHONY: imports -imports: - @IMPORTSOUT=`$(GOIMPORTS) -l $(ALL_SRC) 2>&1`; \ - if [ "$$IMPORTSOUT" ]; then \ - echo "$(GOIMPORTS) FAILED => goimports the following files:\n"; \ - echo "$$IMPORTSOUT\n"; \ - exit 1; \ - else \ - echo "Imports finished successfully"; \ - fi - -.PHONY: lint -lint: - @LINTOUT=`$(GOLINT) $(ALL_PKGS) | grep -v $(TRACE_ID_LINT_EXCEPTION) | grep -v $(TRACE_OPTION_LINT_EXCEPTION) 2>&1`; \ - if [ "$$LINTOUT" ]; then \ - echo "$(GOLINT) FAILED => clean the following lint errors:\n"; \ - echo "$$LINTOUT\n"; \ - exit 1; \ - else \ - echo "Lint finished successfully"; \ - fi - -.PHONY: vet -vet: - # TODO: Understand why go vet downloads "github.com/google/go-cmp v0.2.0" - @VETOUT=`$(GOVET) ./... | grep -v "go: downloading" 2>&1`; \ - if [ "$$VETOUT" ]; then \ - echo "$(GOVET) FAILED => go vet the following files:\n"; \ - echo "$$VETOUT\n"; \ - exit 1; \ - else \ - echo "Vet finished successfully"; \ - fi - -.PHONY: embedmd -embedmd: - @EMBEDMDOUT=`$(EMBEDMD) -d $(README_FILES) 2>&1`; \ - if [ "$$EMBEDMDOUT" ]; then \ - echo "$(EMBEDMD) FAILED => embedmd the following files:\n"; \ - echo "$$EMBEDMDOUT\n"; \ - exit 1; \ - else \ - echo "Embedmd finished successfully"; \ - fi - -.PHONY: install-tools -install-tools: - go get -u golang.org/x/lint/golint - go get -u golang.org/x/tools/cmd/cover - go get -u golang.org/x/tools/cmd/goimports - go get -u github.com/rakyll/embedmd diff --git a/ibm/vendor/go.opencensus.io/README.md b/ibm/vendor/go.opencensus.io/README.md deleted file mode 100644 index 1d7e837116..0000000000 --- a/ibm/vendor/go.opencensus.io/README.md +++ /dev/null @@ -1,267 +0,0 @@ -# OpenCensus Libraries for Go - -[![Build Status][travis-image]][travis-url] -[![Windows Build Status][appveyor-image]][appveyor-url] -[![GoDoc][godoc-image]][godoc-url] -[![Gitter chat][gitter-image]][gitter-url] - -OpenCensus Go is a Go implementation of OpenCensus, a toolkit for -collecting application performance and behavior monitoring data. -Currently it consists of three major components: tags, stats and tracing. - -#### OpenCensus and OpenTracing have merged to form OpenTelemetry, which serves as the next major version of OpenCensus and OpenTracing. OpenTelemetry will offer backwards compatibility with existing OpenCensus integrations, and we will continue to make security patches to existing OpenCensus libraries for two years. Read more about the merger [here](https://medium.com/opentracing/a-roadmap-to-convergence-b074e5815289). - -## Installation - -``` -$ go get -u go.opencensus.io -``` - -The API of this project is still evolving, see: [Deprecation Policy](#deprecation-policy). -The use of vendoring or a dependency management tool is recommended. - -## Prerequisites - -OpenCensus Go libraries require Go 1.8 or later. - -## Getting Started - -The easiest way to get started using OpenCensus in your application is to use an existing -integration with your RPC framework: - -* [net/http](https://godoc.org/go.opencensus.io/plugin/ochttp) -* [gRPC](https://godoc.org/go.opencensus.io/plugin/ocgrpc) -* [database/sql](https://godoc.org/github.com/opencensus-integrations/ocsql) -* [Go kit](https://godoc.org/github.com/go-kit/kit/tracing/opencensus) -* [Groupcache](https://godoc.org/github.com/orijtech/groupcache) -* [Caddy webserver](https://godoc.org/github.com/orijtech/caddy) -* [MongoDB](https://godoc.org/github.com/orijtech/mongo-go-driver) -* [Redis gomodule/redigo](https://godoc.org/github.com/orijtech/redigo) -* [Redis goredis/redis](https://godoc.org/github.com/orijtech/redis) -* [Memcache](https://godoc.org/github.com/orijtech/gomemcache) - -If you're using a framework not listed here, you could either implement your own middleware for your -framework or use [custom stats](#stats) and [spans](#spans) directly in your application. - -## Exporters - -OpenCensus can export instrumentation data to various backends. -OpenCensus has exporter implementations for the following, users -can implement their own exporters by implementing the exporter interfaces -([stats](https://godoc.org/go.opencensus.io/stats/view#Exporter), -[trace](https://godoc.org/go.opencensus.io/trace#Exporter)): - -* [Prometheus][exporter-prom] for stats -* [OpenZipkin][exporter-zipkin] for traces -* [Stackdriver][exporter-stackdriver] Monitoring for stats and Trace for traces -* [Jaeger][exporter-jaeger] for traces -* [AWS X-Ray][exporter-xray] for traces -* [Datadog][exporter-datadog] for stats and traces -* [Graphite][exporter-graphite] for stats -* [Honeycomb][exporter-honeycomb] for traces -* [New Relic][exporter-newrelic] for stats and traces - -## Overview - -![OpenCensus Overview](https://i.imgur.com/cf4ElHE.jpg) - -In a microservices environment, a user request may go through -multiple services until there is a response. OpenCensus allows -you to instrument your services and collect diagnostics data all -through your services end-to-end. - -## Tags - -Tags represent propagated key-value pairs. They are propagated using `context.Context` -in the same process or can be encoded to be transmitted on the wire. Usually, this will -be handled by an integration plugin, e.g. `ocgrpc.ServerHandler` and `ocgrpc.ClientHandler` -for gRPC. - -Package `tag` allows adding or modifying tags in the current context. - -[embedmd]:# (internal/readme/tags.go new) -```go -ctx, err := tag.New(ctx, - tag.Insert(osKey, "macOS-10.12.5"), - tag.Upsert(userIDKey, "cde36753ed"), -) -if err != nil { - log.Fatal(err) -} -``` - -## Stats - -OpenCensus is a low-overhead framework even if instrumentation is always enabled. -In order to be so, it is optimized to make recording of data points fast -and separate from the data aggregation. - -OpenCensus stats collection happens in two stages: - -* Definition of measures and recording of data points -* Definition of views and aggregation of the recorded data - -### Recording - -Measurements are data points associated with a measure. -Recording implicitly tags the set of Measurements with the tags from the -provided context: - -[embedmd]:# (internal/readme/stats.go record) -```go -stats.Record(ctx, videoSize.M(102478)) -``` - -### Views - -Views are how Measures are aggregated. You can think of them as queries over the -set of recorded data points (measurements). - -Views have two parts: the tags to group by and the aggregation type used. - -Currently three types of aggregations are supported: -* CountAggregation is used to count the number of times a sample was recorded. -* DistributionAggregation is used to provide a histogram of the values of the samples. -* SumAggregation is used to sum up all sample values. - -[embedmd]:# (internal/readme/stats.go aggs) -```go -distAgg := view.Distribution(1<<32, 2<<32, 3<<32) -countAgg := view.Count() -sumAgg := view.Sum() -``` - -Here we create a view with the DistributionAggregation over our measure. - -[embedmd]:# (internal/readme/stats.go view) -```go -if err := view.Register(&view.View{ - Name: "example.com/video_size_distribution", - Description: "distribution of processed video size over time", - Measure: videoSize, - Aggregation: view.Distribution(1<<32, 2<<32, 3<<32), -}); err != nil { - log.Fatalf("Failed to register view: %v", err) -} -``` - -Register begins collecting data for the view. Registered views' data will be -exported via the registered exporters. - -## Traces - -A distributed trace tracks the progression of a single user request as -it is handled by the services and processes that make up an application. -Each step is called a span in the trace. Spans include metadata about the step, -including especially the time spent in the step, called the span’s latency. - -Below you see a trace and several spans underneath it. - -![Traces and spans](https://i.imgur.com/7hZwRVj.png) - -### Spans - -Span is the unit step in a trace. Each span has a name, latency, status and -additional metadata. - -Below we are starting a span for a cache read and ending it -when we are done: - -[embedmd]:# (internal/readme/trace.go startend) -```go -ctx, span := trace.StartSpan(ctx, "cache.Get") -defer span.End() - -// Do work to get from cache. -``` - -### Propagation - -Spans can have parents or can be root spans if they don't have any parents. -The current span is propagated in-process and across the network to allow associating -new child spans with the parent. - -In the same process, `context.Context` is used to propagate spans. -`trace.StartSpan` creates a new span as a root if the current context -doesn't contain a span. Or, it creates a child of the span that is -already in current context. The returned context can be used to keep -propagating the newly created span in the current context. - -[embedmd]:# (internal/readme/trace.go startend) -```go -ctx, span := trace.StartSpan(ctx, "cache.Get") -defer span.End() - -// Do work to get from cache. -``` - -Across the network, OpenCensus provides different propagation -methods for different protocols. - -* gRPC integrations use the OpenCensus' [binary propagation format](https://godoc.org/go.opencensus.io/trace/propagation). -* HTTP integrations use Zipkin's [B3](https://github.com/openzipkin/b3-propagation) - by default but can be configured to use a custom propagation method by setting another - [propagation.HTTPFormat](https://godoc.org/go.opencensus.io/trace/propagation#HTTPFormat). - -## Execution Tracer - -With Go 1.11, OpenCensus Go will support integration with the Go execution tracer. -See [Debugging Latency in Go](https://medium.com/observability/debugging-latency-in-go-1-11-9f97a7910d68) -for an example of their mutual use. - -## Profiles - -OpenCensus tags can be applied as profiler labels -for users who are on Go 1.9 and above. - -[embedmd]:# (internal/readme/tags.go profiler) -```go -ctx, err = tag.New(ctx, - tag.Insert(osKey, "macOS-10.12.5"), - tag.Insert(userIDKey, "fff0989878"), -) -if err != nil { - log.Fatal(err) -} -tag.Do(ctx, func(ctx context.Context) { - // Do work. - // When profiling is on, samples will be - // recorded with the key/values from the tag map. -}) -``` - -A screenshot of the CPU profile from the program above: - -![CPU profile](https://i.imgur.com/jBKjlkw.png) - -## Deprecation Policy - -Before version 1.0.0, the following deprecation policy will be observed: - -No backwards-incompatible changes will be made except for the removal of symbols that have -been marked as *Deprecated* for at least one minor release (e.g. 0.9.0 to 0.10.0). A release -removing the *Deprecated* functionality will be made no sooner than 28 days after the first -release in which the functionality was marked *Deprecated*. - -[travis-image]: https://travis-ci.org/census-instrumentation/opencensus-go.svg?branch=master -[travis-url]: https://travis-ci.org/census-instrumentation/opencensus-go -[appveyor-image]: https://ci.appveyor.com/api/projects/status/vgtt29ps1783ig38?svg=true -[appveyor-url]: https://ci.appveyor.com/project/opencensusgoteam/opencensus-go/branch/master -[godoc-image]: https://godoc.org/go.opencensus.io?status.svg -[godoc-url]: https://godoc.org/go.opencensus.io -[gitter-image]: https://badges.gitter.im/census-instrumentation/lobby.svg -[gitter-url]: https://gitter.im/census-instrumentation/lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge - - -[new-ex]: https://godoc.org/go.opencensus.io/tag#example-NewMap -[new-replace-ex]: https://godoc.org/go.opencensus.io/tag#example-NewMap--Replace - -[exporter-prom]: https://godoc.org/contrib.go.opencensus.io/exporter/prometheus -[exporter-stackdriver]: https://godoc.org/contrib.go.opencensus.io/exporter/stackdriver -[exporter-zipkin]: https://godoc.org/contrib.go.opencensus.io/exporter/zipkin -[exporter-jaeger]: https://godoc.org/contrib.go.opencensus.io/exporter/jaeger -[exporter-xray]: https://github.com/census-ecosystem/opencensus-go-exporter-aws -[exporter-datadog]: https://github.com/DataDog/opencensus-go-exporter-datadog -[exporter-graphite]: https://github.com/census-ecosystem/opencensus-go-exporter-graphite -[exporter-honeycomb]: https://github.com/honeycombio/opencensus-exporter -[exporter-newrelic]: https://github.com/newrelic/newrelic-opencensus-exporter-go diff --git a/ibm/vendor/go.opencensus.io/appveyor.yml b/ibm/vendor/go.opencensus.io/appveyor.yml deleted file mode 100644 index d08f0edaff..0000000000 --- a/ibm/vendor/go.opencensus.io/appveyor.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "{build}" - -platform: x64 - -clone_folder: c:\gopath\src\go.opencensus.io - -environment: - GOPATH: 'c:\gopath' - GO111MODULE: 'on' - CGO_ENABLED: '0' # See: https://github.com/appveyor/ci/issues/2613 - -stack: go 1.11 - -before_test: - - go version - - go env - -build: false -deploy: false - -test_script: - - cd %APPVEYOR_BUILD_FOLDER% - - go build -v .\... - - go test -v .\... # No -race because cgo is disabled diff --git a/ibm/vendor/go.opencensus.io/internal/internal.go b/ibm/vendor/go.opencensus.io/internal/internal.go deleted file mode 100644 index 81dc7183ec..0000000000 --- a/ibm/vendor/go.opencensus.io/internal/internal.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 internal // import "go.opencensus.io/internal" - -import ( - "fmt" - "time" - - opencensus "go.opencensus.io" -) - -// UserAgent is the user agent to be added to the outgoing -// requests from the exporters. -var UserAgent = fmt.Sprintf("opencensus-go/%s", opencensus.Version()) - -// MonotonicEndTime returns the end time at present -// but offset from start, monotonically. -// -// The monotonic clock is used in subtractions hence -// the duration since start added back to start gives -// end as a monotonic time. -// See https://golang.org/pkg/time/#hdr-Monotonic_Clocks -func MonotonicEndTime(start time.Time) time.Time { - return start.Add(time.Since(start)) -} diff --git a/ibm/vendor/go.opencensus.io/internal/sanitize.go b/ibm/vendor/go.opencensus.io/internal/sanitize.go deleted file mode 100644 index de8ccf236c..0000000000 --- a/ibm/vendor/go.opencensus.io/internal/sanitize.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 internal - -import ( - "strings" - "unicode" -) - -const labelKeySizeLimit = 100 - -// Sanitize returns a string that is trunacated to 100 characters if it's too -// long, and replaces non-alphanumeric characters to underscores. -func Sanitize(s string) string { - if len(s) == 0 { - return s - } - if len(s) > labelKeySizeLimit { - s = s[:labelKeySizeLimit] - } - s = strings.Map(sanitizeRune, s) - if unicode.IsDigit(rune(s[0])) { - s = "key_" + s - } - if s[0] == '_' { - s = "key" + s - } - return s -} - -// converts anything that is not a letter or digit to an underscore -func sanitizeRune(r rune) rune { - if unicode.IsLetter(r) || unicode.IsDigit(r) { - return r - } - // Everything else turns into an underscore - return '_' -} diff --git a/ibm/vendor/go.opencensus.io/internal/tagencoding/tagencoding.go b/ibm/vendor/go.opencensus.io/internal/tagencoding/tagencoding.go deleted file mode 100644 index 41b2c3fc03..0000000000 --- a/ibm/vendor/go.opencensus.io/internal/tagencoding/tagencoding.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tagencoding contains the tag encoding -// used interally by the stats collector. -package tagencoding // import "go.opencensus.io/internal/tagencoding" - -// Values represent the encoded buffer for the values. -type Values struct { - Buffer []byte - WriteIndex int - ReadIndex int -} - -func (vb *Values) growIfRequired(expected int) { - if len(vb.Buffer)-vb.WriteIndex < expected { - tmp := make([]byte, 2*(len(vb.Buffer)+1)+expected) - copy(tmp, vb.Buffer) - vb.Buffer = tmp - } -} - -// WriteValue is the helper method to encode Values from map[Key][]byte. -func (vb *Values) WriteValue(v []byte) { - length := len(v) & 0xff - vb.growIfRequired(1 + length) - - // writing length of v - vb.Buffer[vb.WriteIndex] = byte(length) - vb.WriteIndex++ - - if length == 0 { - // No value was encoded for this key - return - } - - // writing v - copy(vb.Buffer[vb.WriteIndex:], v[:length]) - vb.WriteIndex += length -} - -// ReadValue is the helper method to decode Values to a map[Key][]byte. -func (vb *Values) ReadValue() []byte { - // read length of v - length := int(vb.Buffer[vb.ReadIndex]) - vb.ReadIndex++ - if length == 0 { - // No value was encoded for this key - return nil - } - - // read value of v - v := make([]byte, length) - endIdx := vb.ReadIndex + length - copy(v, vb.Buffer[vb.ReadIndex:endIdx]) - vb.ReadIndex = endIdx - return v -} - -// Bytes returns a reference to already written bytes in the Buffer. -func (vb *Values) Bytes() []byte { - return vb.Buffer[:vb.WriteIndex] -} diff --git a/ibm/vendor/go.opencensus.io/internal/traceinternals.go b/ibm/vendor/go.opencensus.io/internal/traceinternals.go deleted file mode 100644 index 073af7b473..0000000000 --- a/ibm/vendor/go.opencensus.io/internal/traceinternals.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 internal - -import ( - "time" -) - -// Trace allows internal access to some trace functionality. -// TODO(#412): remove this -var Trace interface{} - -// LocalSpanStoreEnabled true if the local span store is enabled. -var LocalSpanStoreEnabled bool - -// BucketConfiguration stores the number of samples to store for span buckets -// for successful and failed spans for a particular span name. -type BucketConfiguration struct { - Name string - MaxRequestsSucceeded int - MaxRequestsErrors int -} - -// PerMethodSummary is a summary of the spans stored for a single span name. -type PerMethodSummary struct { - Active int - LatencyBuckets []LatencyBucketSummary - ErrorBuckets []ErrorBucketSummary -} - -// LatencyBucketSummary is a summary of a latency bucket. -type LatencyBucketSummary struct { - MinLatency, MaxLatency time.Duration - Size int -} - -// ErrorBucketSummary is a summary of an error bucket. -type ErrorBucketSummary struct { - ErrorCode int32 - Size int -} diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/doc.go b/ibm/vendor/go.opencensus.io/metric/metricdata/doc.go deleted file mode 100644 index 52a7b3bf85..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 metricdata contains the metrics data model. -// -// This is an EXPERIMENTAL package, and may change in arbitrary ways without -// notice. -package metricdata // import "go.opencensus.io/metric/metricdata" diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/exemplar.go b/ibm/vendor/go.opencensus.io/metric/metricdata/exemplar.go deleted file mode 100644 index 12695ce2dc..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/exemplar.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 metricdata - -import ( - "time" -) - -// Exemplars keys. -const ( - AttachmentKeySpanContext = "SpanContext" -) - -// Exemplar is an example data point associated with each bucket of a -// distribution type aggregation. -// -// Their purpose is to provide an example of the kind of thing -// (request, RPC, trace span, etc.) that resulted in that measurement. -type Exemplar struct { - Value float64 // the value that was recorded - Timestamp time.Time // the time the value was recorded - Attachments Attachments // attachments (if any) -} - -// Attachments is a map of extra values associated with a recorded data point. -type Attachments map[string]interface{} diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/label.go b/ibm/vendor/go.opencensus.io/metric/metricdata/label.go deleted file mode 100644 index aadae41e6a..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/label.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 metricdata - -// LabelKey represents key of a label. It has optional -// description attribute. -type LabelKey struct { - Key string - Description string -} - -// LabelValue represents the value of a label. -// The zero value represents a missing label value, which may be treated -// differently to an empty string value by some back ends. -type LabelValue struct { - Value string // string value of the label - Present bool // flag that indicated whether a value is present or not -} - -// NewLabelValue creates a new non-nil LabelValue that represents the given string. -func NewLabelValue(val string) LabelValue { - return LabelValue{Value: val, Present: true} -} diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/metric.go b/ibm/vendor/go.opencensus.io/metric/metricdata/metric.go deleted file mode 100644 index 8293712c77..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/metric.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 metricdata - -import ( - "time" - - "go.opencensus.io/resource" -) - -// Descriptor holds metadata about a metric. -type Descriptor struct { - Name string // full name of the metric - Description string // human-readable description - Unit Unit // units for the measure - Type Type // type of measure - LabelKeys []LabelKey // label keys -} - -// Metric represents a quantity measured against a resource with different -// label value combinations. -type Metric struct { - Descriptor Descriptor // metric descriptor - Resource *resource.Resource // resource against which this was measured - TimeSeries []*TimeSeries // one time series for each combination of label values -} - -// TimeSeries is a sequence of points associated with a combination of label -// values. -type TimeSeries struct { - LabelValues []LabelValue // label values, same order as keys in the metric descriptor - Points []Point // points sequence - StartTime time.Time // time we started recording this time series -} diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/point.go b/ibm/vendor/go.opencensus.io/metric/metricdata/point.go deleted file mode 100644 index 7fe057b19c..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/point.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 metricdata - -import ( - "time" -) - -// Point is a single data point of a time series. -type Point struct { - // Time is the point in time that this point represents in a time series. - Time time.Time - // Value is the value of this point. Prefer using ReadValue to switching on - // the value type, since new value types might be added. - Value interface{} -} - -//go:generate stringer -type ValueType - -// NewFloat64Point creates a new Point holding a float64 value. -func NewFloat64Point(t time.Time, val float64) Point { - return Point{ - Value: val, - Time: t, - } -} - -// NewInt64Point creates a new Point holding an int64 value. -func NewInt64Point(t time.Time, val int64) Point { - return Point{ - Value: val, - Time: t, - } -} - -// NewDistributionPoint creates a new Point holding a Distribution value. -func NewDistributionPoint(t time.Time, val *Distribution) Point { - return Point{ - Value: val, - Time: t, - } -} - -// NewSummaryPoint creates a new Point holding a Summary value. -func NewSummaryPoint(t time.Time, val *Summary) Point { - return Point{ - Value: val, - Time: t, - } -} - -// ValueVisitor allows reading the value of a point. -type ValueVisitor interface { - VisitFloat64Value(float64) - VisitInt64Value(int64) - VisitDistributionValue(*Distribution) - VisitSummaryValue(*Summary) -} - -// ReadValue accepts a ValueVisitor and calls the appropriate method with the -// value of this point. -// Consumers of Point should use this in preference to switching on the type -// of the value directly, since new value types may be added. -func (p Point) ReadValue(vv ValueVisitor) { - switch v := p.Value.(type) { - case int64: - vv.VisitInt64Value(v) - case float64: - vv.VisitFloat64Value(v) - case *Distribution: - vv.VisitDistributionValue(v) - case *Summary: - vv.VisitSummaryValue(v) - default: - panic("unexpected value type") - } -} - -// Distribution contains summary statistics for a population of values. It -// optionally contains a histogram representing the distribution of those -// values across a set of buckets. -type Distribution struct { - // Count is the number of values in the population. Must be non-negative. This value - // must equal the sum of the values in bucket_counts if a histogram is - // provided. - Count int64 - // Sum is the sum of the values in the population. If count is zero then this field - // must be zero. - Sum float64 - // SumOfSquaredDeviation is the sum of squared deviations from the mean of the values in the - // population. For values x_i this is: - // - // Sum[i=1..n]((x_i - mean)^2) - // - // Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition - // describes Welford's method for accumulating this sum in one pass. - // - // If count is zero then this field must be zero. - SumOfSquaredDeviation float64 - // BucketOptions describes the bounds of the histogram buckets in this - // distribution. - // - // A Distribution may optionally contain a histogram of the values in the - // population. - // - // If nil, there is no associated histogram. - BucketOptions *BucketOptions - // Bucket If the distribution does not have a histogram, then omit this field. - // If there is a histogram, then the sum of the values in the Bucket counts - // must equal the value in the count field of the distribution. - Buckets []Bucket -} - -// BucketOptions describes the bounds of the histogram buckets in this -// distribution. -type BucketOptions struct { - // Bounds specifies a set of bucket upper bounds. - // This defines len(bounds) + 1 (= N) buckets. The boundaries for bucket - // index i are: - // - // [0, Bounds[i]) for i == 0 - // [Bounds[i-1], Bounds[i]) for 0 < i < N-1 - // [Bounds[i-1], +infinity) for i == N-1 - Bounds []float64 -} - -// Bucket represents a single bucket (value range) in a distribution. -type Bucket struct { - // Count is the number of values in each bucket of the histogram, as described in - // bucket_bounds. - Count int64 - // Exemplar associated with this bucket (if any). - Exemplar *Exemplar -} - -// Summary is a representation of percentiles. -type Summary struct { - // Count is the cumulative count (if available). - Count int64 - // Sum is the cumulative sum of values (if available). - Sum float64 - // HasCountAndSum is true if Count and Sum are available. - HasCountAndSum bool - // Snapshot represents percentiles calculated over an arbitrary time window. - // The values in this struct can be reset at arbitrary unknown times, with - // the requirement that all of them are reset at the same time. - Snapshot Snapshot -} - -// Snapshot represents percentiles over an arbitrary time. -// The values in this struct can be reset at arbitrary unknown times, with -// the requirement that all of them are reset at the same time. -type Snapshot struct { - // Count is the number of values in the snapshot. Optional since some systems don't - // expose this. Set to 0 if not available. - Count int64 - // Sum is the sum of values in the snapshot. Optional since some systems don't - // expose this. If count is 0 then this field must be zero. - Sum float64 - // Percentiles is a map from percentile (range (0-100.0]) to the value of - // the percentile. - Percentiles map[float64]float64 -} - -//go:generate stringer -type Type - -// Type is the overall type of metric, including its value type and whether it -// represents a cumulative total (since the start time) or if it represents a -// gauge value. -type Type int - -// Metric types. -const ( - TypeGaugeInt64 Type = iota - TypeGaugeFloat64 - TypeGaugeDistribution - TypeCumulativeInt64 - TypeCumulativeFloat64 - TypeCumulativeDistribution - TypeSummary -) diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/type_string.go b/ibm/vendor/go.opencensus.io/metric/metricdata/type_string.go deleted file mode 100644 index c3f8ec27b5..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/type_string.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by "stringer -type Type"; DO NOT EDIT. - -package metricdata - -import "strconv" - -const _Type_name = "TypeGaugeInt64TypeGaugeFloat64TypeGaugeDistributionTypeCumulativeInt64TypeCumulativeFloat64TypeCumulativeDistributionTypeSummary" - -var _Type_index = [...]uint8{0, 14, 30, 51, 70, 91, 117, 128} - -func (i Type) String() string { - if i < 0 || i >= Type(len(_Type_index)-1) { - return "Type(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Type_name[_Type_index[i]:_Type_index[i+1]] -} diff --git a/ibm/vendor/go.opencensus.io/metric/metricdata/unit.go b/ibm/vendor/go.opencensus.io/metric/metricdata/unit.go deleted file mode 100644 index b483a1371b..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricdata/unit.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 metricdata - -// Unit is a string encoded according to the case-sensitive abbreviations from the -// Unified Code for Units of Measure: http://unitsofmeasure.org/ucum.html -type Unit string - -// Predefined units. To record against a unit not represented here, create your -// own Unit type constant from a string. -const ( - UnitDimensionless Unit = "1" - UnitBytes Unit = "By" - UnitMilliseconds Unit = "ms" -) diff --git a/ibm/vendor/go.opencensus.io/metric/metricproducer/manager.go b/ibm/vendor/go.opencensus.io/metric/metricproducer/manager.go deleted file mode 100644 index ca1f390493..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricproducer/manager.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 metricproducer - -import ( - "sync" -) - -// Manager maintains a list of active producers. Producers can register -// with the manager to allow readers to read all metrics provided by them. -// Readers can retrieve all producers registered with the manager, -// read metrics from the producers and export them. -type Manager struct { - mu sync.RWMutex - producers map[Producer]struct{} -} - -var prodMgr *Manager -var once sync.Once - -// GlobalManager is a single instance of producer manager -// that is used by all producers and all readers. -func GlobalManager() *Manager { - once.Do(func() { - prodMgr = &Manager{} - prodMgr.producers = make(map[Producer]struct{}) - }) - return prodMgr -} - -// AddProducer adds the producer to the Manager if it is not already present. -func (pm *Manager) AddProducer(producer Producer) { - if producer == nil { - return - } - pm.mu.Lock() - defer pm.mu.Unlock() - pm.producers[producer] = struct{}{} -} - -// DeleteProducer deletes the producer from the Manager if it is present. -func (pm *Manager) DeleteProducer(producer Producer) { - if producer == nil { - return - } - pm.mu.Lock() - defer pm.mu.Unlock() - delete(pm.producers, producer) -} - -// GetAll returns a slice of all producer currently registered with -// the Manager. For each call it generates a new slice. The slice -// should not be cached as registration may change at any time. It is -// typically called periodically by exporter to read metrics from -// the producers. -func (pm *Manager) GetAll() []Producer { - pm.mu.Lock() - defer pm.mu.Unlock() - producers := make([]Producer, len(pm.producers)) - i := 0 - for producer := range pm.producers { - producers[i] = producer - i++ - } - return producers -} diff --git a/ibm/vendor/go.opencensus.io/metric/metricproducer/producer.go b/ibm/vendor/go.opencensus.io/metric/metricproducer/producer.go deleted file mode 100644 index 6cee9ed178..0000000000 --- a/ibm/vendor/go.opencensus.io/metric/metricproducer/producer.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 metricproducer - -import ( - "go.opencensus.io/metric/metricdata" -) - -// Producer is a source of metrics. -type Producer interface { - // Read should return the current values of all metrics supported by this - // metric provider. - // The returned metrics should be unique for each combination of name and - // resource. - Read() []*metricdata.Metric -} diff --git a/ibm/vendor/go.opencensus.io/opencensus.go b/ibm/vendor/go.opencensus.io/opencensus.go deleted file mode 100644 index e5e4b4368c..0000000000 --- a/ibm/vendor/go.opencensus.io/opencensus.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 opencensus contains Go support for OpenCensus. -package opencensus // import "go.opencensus.io" - -// Version is the current release version of OpenCensus in use. -func Version() string { - return "0.23.0" -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/client.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/client.go deleted file mode 100644 index da815b2a73..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/client.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "net/http" - "net/http/httptrace" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// Transport is an http.RoundTripper that instruments all outgoing requests with -// OpenCensus stats and tracing. -// -// The zero value is intended to be a useful default, but for -// now it's recommended that you explicitly set Propagation, since the default -// for this may change. -type Transport struct { - // Base may be set to wrap another http.RoundTripper that does the actual - // requests. By default http.DefaultTransport is used. - // - // If base HTTP roundtripper implements CancelRequest, - // the returned round tripper will be cancelable. - Base http.RoundTripper - - // Propagation defines how traces are propagated. If unspecified, a default - // (currently B3 format) will be used. - Propagation propagation.HTTPFormat - - // StartOptions are applied to the span started by this Transport around each - // request. - // - // StartOptions.SpanKind will always be set to trace.SpanKindClient - // for spans started by this transport. - StartOptions trace.StartOptions - - // GetStartOptions allows to set start options per request. If set, - // StartOptions is going to be ignored. - GetStartOptions func(*http.Request) trace.StartOptions - - // NameFromRequest holds the function to use for generating the span name - // from the information found in the outgoing HTTP Request. By default the - // name equals the URL Path. - FormatSpanName func(*http.Request) string - - // NewClientTrace may be set to a function allowing the current *trace.Span - // to be annotated with HTTP request event information emitted by the - // httptrace package. - NewClientTrace func(*http.Request, *trace.Span) *httptrace.ClientTrace - - // TODO: Implement tag propagation for HTTP. -} - -// RoundTrip implements http.RoundTripper, delegating to Base and recording stats and traces for the request. -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - rt := t.base() - if isHealthEndpoint(req.URL.Path) { - return rt.RoundTrip(req) - } - // TODO: remove excessive nesting of http.RoundTrippers here. - format := t.Propagation - if format == nil { - format = defaultFormat - } - spanNameFormatter := t.FormatSpanName - if spanNameFormatter == nil { - spanNameFormatter = spanNameFromURL - } - - startOpts := t.StartOptions - if t.GetStartOptions != nil { - startOpts = t.GetStartOptions(req) - } - - rt = &traceTransport{ - base: rt, - format: format, - startOptions: trace.StartOptions{ - Sampler: startOpts.Sampler, - SpanKind: trace.SpanKindClient, - }, - formatSpanName: spanNameFormatter, - newClientTrace: t.NewClientTrace, - } - rt = statsTransport{base: rt} - return rt.RoundTrip(req) -} - -func (t *Transport) base() http.RoundTripper { - if t.Base != nil { - return t.Base - } - return http.DefaultTransport -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t *Transport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(*http.Request) - } - if cr, ok := t.base().(canceler); ok { - cr.CancelRequest(req) - } -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/client_stats.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/client_stats.go deleted file mode 100644 index 17142aabe0..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/client_stats.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "context" - "io" - "net/http" - "strconv" - "sync" - "time" - - "go.opencensus.io/stats" - "go.opencensus.io/tag" -) - -// statsTransport is an http.RoundTripper that collects stats for the outgoing requests. -type statsTransport struct { - base http.RoundTripper -} - -// RoundTrip implements http.RoundTripper, delegating to Base and recording stats for the request. -func (t statsTransport) RoundTrip(req *http.Request) (*http.Response, error) { - ctx, _ := tag.New(req.Context(), - tag.Upsert(KeyClientHost, req.Host), - tag.Upsert(Host, req.Host), - tag.Upsert(KeyClientPath, req.URL.Path), - tag.Upsert(Path, req.URL.Path), - tag.Upsert(KeyClientMethod, req.Method), - tag.Upsert(Method, req.Method)) - req = req.WithContext(ctx) - track := &tracker{ - start: time.Now(), - ctx: ctx, - } - if req.Body == nil { - // TODO: Handle cases where ContentLength is not set. - track.reqSize = -1 - } else if req.ContentLength > 0 { - track.reqSize = req.ContentLength - } - stats.Record(ctx, ClientRequestCount.M(1)) - - // Perform request. - resp, err := t.base.RoundTrip(req) - - if err != nil { - track.statusCode = http.StatusInternalServerError - track.end() - } else { - track.statusCode = resp.StatusCode - if req.Method != "HEAD" { - track.respContentLength = resp.ContentLength - } - if resp.Body == nil { - track.end() - } else { - track.body = resp.Body - resp.Body = wrappedBody(track, resp.Body) - } - } - return resp, err -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t statsTransport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(*http.Request) - } - if cr, ok := t.base.(canceler); ok { - cr.CancelRequest(req) - } -} - -type tracker struct { - ctx context.Context - respSize int64 - respContentLength int64 - reqSize int64 - start time.Time - body io.ReadCloser - statusCode int - endOnce sync.Once -} - -var _ io.ReadCloser = (*tracker)(nil) - -func (t *tracker) end() { - t.endOnce.Do(func() { - latencyMs := float64(time.Since(t.start)) / float64(time.Millisecond) - respSize := t.respSize - if t.respSize == 0 && t.respContentLength > 0 { - respSize = t.respContentLength - } - m := []stats.Measurement{ - ClientSentBytes.M(t.reqSize), - ClientReceivedBytes.M(respSize), - ClientRoundtripLatency.M(latencyMs), - ClientLatency.M(latencyMs), - ClientResponseBytes.M(t.respSize), - } - if t.reqSize >= 0 { - m = append(m, ClientRequestBytes.M(t.reqSize)) - } - - stats.RecordWithTags(t.ctx, []tag.Mutator{ - tag.Upsert(StatusCode, strconv.Itoa(t.statusCode)), - tag.Upsert(KeyClientStatus, strconv.Itoa(t.statusCode)), - }, m...) - }) -} - -func (t *tracker) Read(b []byte) (int, error) { - n, err := t.body.Read(b) - t.respSize += int64(n) - switch err { - case nil: - return n, nil - case io.EOF: - t.end() - } - return n, err -} - -func (t *tracker) Close() error { - // Invoking endSpan on Close will help catch the cases - // in which a read returned a non-nil error, we set the - // span status but didn't end the span. - t.end() - return t.body.Close() -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/doc.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/doc.go deleted file mode 100644 index 10e626b16e..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp provides OpenCensus instrumentation for net/http package. -// -// For server instrumentation, see Handler. For client-side instrumentation, -// see Transport. -package ochttp // import "go.opencensus.io/plugin/ochttp" diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go deleted file mode 100644 index 9ad8852198..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 b3 contains a propagation.HTTPFormat implementation -// for B3 propagation. See https://github.com/openzipkin/b3-propagation -// for more details. -package b3 // import "go.opencensus.io/plugin/ochttp/propagation/b3" - -import ( - "encoding/hex" - "net/http" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// B3 headers that OpenCensus understands. -const ( - TraceIDHeader = "X-B3-TraceId" - SpanIDHeader = "X-B3-SpanId" - SampledHeader = "X-B3-Sampled" -) - -// HTTPFormat implements propagation.HTTPFormat to propagate -// traces in HTTP headers in B3 propagation format. -// HTTPFormat skips the X-B3-ParentId and X-B3-Flags headers -// because there are additional fields not represented in the -// OpenCensus span context. Spans created from the incoming -// header will be the direct children of the client-side span. -// Similarly, receiver of the outgoing spans should use client-side -// span created by OpenCensus as the parent. -type HTTPFormat struct{} - -var _ propagation.HTTPFormat = (*HTTPFormat)(nil) - -// SpanContextFromRequest extracts a B3 span context from incoming requests. -func (f *HTTPFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) { - tid, ok := ParseTraceID(req.Header.Get(TraceIDHeader)) - if !ok { - return trace.SpanContext{}, false - } - sid, ok := ParseSpanID(req.Header.Get(SpanIDHeader)) - if !ok { - return trace.SpanContext{}, false - } - sampled, _ := ParseSampled(req.Header.Get(SampledHeader)) - return trace.SpanContext{ - TraceID: tid, - SpanID: sid, - TraceOptions: sampled, - }, true -} - -// ParseTraceID parses the value of the X-B3-TraceId header. -func ParseTraceID(tid string) (trace.TraceID, bool) { - if tid == "" { - return trace.TraceID{}, false - } - b, err := hex.DecodeString(tid) - if err != nil || len(b) > 16 { - return trace.TraceID{}, false - } - var traceID trace.TraceID - if len(b) <= 8 { - // The lower 64-bits. - start := 8 + (8 - len(b)) - copy(traceID[start:], b) - } else { - start := 16 - len(b) - copy(traceID[start:], b) - } - - return traceID, true -} - -// ParseSpanID parses the value of the X-B3-SpanId or X-B3-ParentSpanId headers. -func ParseSpanID(sid string) (spanID trace.SpanID, ok bool) { - if sid == "" { - return trace.SpanID{}, false - } - b, err := hex.DecodeString(sid) - if err != nil || len(b) > 8 { - return trace.SpanID{}, false - } - start := 8 - len(b) - copy(spanID[start:], b) - return spanID, true -} - -// ParseSampled parses the value of the X-B3-Sampled header. -func ParseSampled(sampled string) (trace.TraceOptions, bool) { - switch sampled { - case "true", "1": - return trace.TraceOptions(1), true - default: - return trace.TraceOptions(0), false - } -} - -// SpanContextToRequest modifies the given request to include B3 headers. -func (f *HTTPFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { - req.Header.Set(TraceIDHeader, hex.EncodeToString(sc.TraceID[:])) - req.Header.Set(SpanIDHeader, hex.EncodeToString(sc.SpanID[:])) - - var sampled string - if sc.IsSampled() { - sampled = "1" - } else { - sampled = "0" - } - req.Header.Set(SampledHeader, sampled) -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/route.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/route.go deleted file mode 100644 index 5e6a343076..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/route.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "context" - "net/http" - - "go.opencensus.io/tag" -) - -// SetRoute sets the http_server_route tag to the given value. -// It's useful when an HTTP framework does not support the http.Handler interface -// and using WithRouteTag is not an option, but provides a way to hook into the request flow. -func SetRoute(ctx context.Context, route string) { - if a, ok := ctx.Value(addedTagsKey{}).(*addedTags); ok { - a.t = append(a.t, tag.Upsert(KeyServerRoute, route)) - } -} - -// WithRouteTag returns an http.Handler that records stats with the -// http_server_route tag set to the given value. -func WithRouteTag(handler http.Handler, route string) http.Handler { - return taggedHandlerFunc(func(w http.ResponseWriter, r *http.Request) []tag.Mutator { - addRoute := []tag.Mutator{tag.Upsert(KeyServerRoute, route)} - ctx, _ := tag.New(r.Context(), addRoute...) - r = r.WithContext(ctx) - handler.ServeHTTP(w, r) - return addRoute - }) -} - -// taggedHandlerFunc is a http.Handler that returns tags describing the -// processing of the request. These tags will be recorded along with the -// measures in this package at the end of the request. -type taggedHandlerFunc func(w http.ResponseWriter, r *http.Request) []tag.Mutator - -func (h taggedHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) { - tags := h(w, r) - if a, ok := r.Context().Value(addedTagsKey{}).(*addedTags); ok { - a.t = append(a.t, tags...) - } -} - -type addedTagsKey struct{} - -type addedTags struct { - t []tag.Mutator -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/server.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/server.go deleted file mode 100644 index c7ea642357..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/server.go +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "context" - "io" - "net/http" - "strconv" - "sync" - "time" - - "go.opencensus.io/stats" - "go.opencensus.io/tag" - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// Handler is an http.Handler wrapper to instrument your HTTP server with -// OpenCensus. It supports both stats and tracing. -// -// Tracing -// -// This handler is aware of the incoming request's span, reading it from request -// headers as configured using the Propagation field. -// The extracted span can be accessed from the incoming request's -// context. -// -// span := trace.FromContext(r.Context()) -// -// The server span will be automatically ended at the end of ServeHTTP. -type Handler struct { - // Propagation defines how traces are propagated. If unspecified, - // B3 propagation will be used. - Propagation propagation.HTTPFormat - - // Handler is the handler used to handle the incoming request. - Handler http.Handler - - // StartOptions are applied to the span started by this Handler around each - // request. - // - // StartOptions.SpanKind will always be set to trace.SpanKindServer - // for spans started by this transport. - StartOptions trace.StartOptions - - // GetStartOptions allows to set start options per request. If set, - // StartOptions is going to be ignored. - GetStartOptions func(*http.Request) trace.StartOptions - - // IsPublicEndpoint should be set to true for publicly accessible HTTP(S) - // servers. If true, any trace metadata set on the incoming request will - // be added as a linked trace instead of being added as a parent of the - // current trace. - IsPublicEndpoint bool - - // FormatSpanName holds the function to use for generating the span name - // from the information found in the incoming HTTP Request. By default the - // name equals the URL Path. - FormatSpanName func(*http.Request) string - - // IsHealthEndpoint holds the function to use for determining if the - // incoming HTTP request should be considered a health check. This is in - // addition to the private isHealthEndpoint func which may also indicate - // tracing should be skipped. - IsHealthEndpoint func(*http.Request) bool -} - -func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - var tags addedTags - r, traceEnd := h.startTrace(w, r) - defer traceEnd() - w, statsEnd := h.startStats(w, r) - defer statsEnd(&tags) - handler := h.Handler - if handler == nil { - handler = http.DefaultServeMux - } - r = r.WithContext(context.WithValue(r.Context(), addedTagsKey{}, &tags)) - handler.ServeHTTP(w, r) -} - -func (h *Handler) startTrace(w http.ResponseWriter, r *http.Request) (*http.Request, func()) { - if h.IsHealthEndpoint != nil && h.IsHealthEndpoint(r) || isHealthEndpoint(r.URL.Path) { - return r, func() {} - } - var name string - if h.FormatSpanName == nil { - name = spanNameFromURL(r) - } else { - name = h.FormatSpanName(r) - } - ctx := r.Context() - - startOpts := h.StartOptions - if h.GetStartOptions != nil { - startOpts = h.GetStartOptions(r) - } - - var span *trace.Span - sc, ok := h.extractSpanContext(r) - if ok && !h.IsPublicEndpoint { - ctx, span = trace.StartSpanWithRemoteParent(ctx, name, sc, - trace.WithSampler(startOpts.Sampler), - trace.WithSpanKind(trace.SpanKindServer)) - } else { - ctx, span = trace.StartSpan(ctx, name, - trace.WithSampler(startOpts.Sampler), - trace.WithSpanKind(trace.SpanKindServer), - ) - if ok { - span.AddLink(trace.Link{ - TraceID: sc.TraceID, - SpanID: sc.SpanID, - Type: trace.LinkTypeParent, - Attributes: nil, - }) - } - } - span.AddAttributes(requestAttrs(r)...) - if r.Body == nil { - // TODO: Handle cases where ContentLength is not set. - } else if r.ContentLength > 0 { - span.AddMessageReceiveEvent(0, /* TODO: messageID */ - r.ContentLength, -1) - } - return r.WithContext(ctx), span.End -} - -func (h *Handler) extractSpanContext(r *http.Request) (trace.SpanContext, bool) { - if h.Propagation == nil { - return defaultFormat.SpanContextFromRequest(r) - } - return h.Propagation.SpanContextFromRequest(r) -} - -func (h *Handler) startStats(w http.ResponseWriter, r *http.Request) (http.ResponseWriter, func(tags *addedTags)) { - ctx, _ := tag.New(r.Context(), - tag.Upsert(Host, r.Host), - tag.Upsert(Path, r.URL.Path), - tag.Upsert(Method, r.Method)) - track := &trackingResponseWriter{ - start: time.Now(), - ctx: ctx, - writer: w, - } - if r.Body == nil { - // TODO: Handle cases where ContentLength is not set. - track.reqSize = -1 - } else if r.ContentLength > 0 { - track.reqSize = r.ContentLength - } - stats.Record(ctx, ServerRequestCount.M(1)) - return track.wrappedResponseWriter(), track.end -} - -type trackingResponseWriter struct { - ctx context.Context - reqSize int64 - respSize int64 - start time.Time - statusCode int - statusLine string - endOnce sync.Once - writer http.ResponseWriter -} - -// Compile time assertion for ResponseWriter interface -var _ http.ResponseWriter = (*trackingResponseWriter)(nil) - -func (t *trackingResponseWriter) end(tags *addedTags) { - t.endOnce.Do(func() { - if t.statusCode == 0 { - t.statusCode = 200 - } - - span := trace.FromContext(t.ctx) - span.SetStatus(TraceStatus(t.statusCode, t.statusLine)) - span.AddAttributes(trace.Int64Attribute(StatusCodeAttribute, int64(t.statusCode))) - - m := []stats.Measurement{ - ServerLatency.M(float64(time.Since(t.start)) / float64(time.Millisecond)), - ServerResponseBytes.M(t.respSize), - } - if t.reqSize >= 0 { - m = append(m, ServerRequestBytes.M(t.reqSize)) - } - allTags := make([]tag.Mutator, len(tags.t)+1) - allTags[0] = tag.Upsert(StatusCode, strconv.Itoa(t.statusCode)) - copy(allTags[1:], tags.t) - stats.RecordWithTags(t.ctx, allTags, m...) - }) -} - -func (t *trackingResponseWriter) Header() http.Header { - return t.writer.Header() -} - -func (t *trackingResponseWriter) Write(data []byte) (int, error) { - n, err := t.writer.Write(data) - t.respSize += int64(n) - // Add message event for request bytes sent. - span := trace.FromContext(t.ctx) - span.AddMessageSendEvent(0 /* TODO: messageID */, int64(n), -1) - return n, err -} - -func (t *trackingResponseWriter) WriteHeader(statusCode int) { - t.writer.WriteHeader(statusCode) - t.statusCode = statusCode - t.statusLine = http.StatusText(t.statusCode) -} - -// wrappedResponseWriter returns a wrapped version of the original -// ResponseWriter and only implements the same combination of additional -// interfaces as the original. -// This implementation is based on https://github.com/felixge/httpsnoop. -func (t *trackingResponseWriter) wrappedResponseWriter() http.ResponseWriter { - var ( - hj, i0 = t.writer.(http.Hijacker) - cn, i1 = t.writer.(http.CloseNotifier) - pu, i2 = t.writer.(http.Pusher) - fl, i3 = t.writer.(http.Flusher) - rf, i4 = t.writer.(io.ReaderFrom) - ) - - switch { - case !i0 && !i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - }{t} - case !i0 && !i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - io.ReaderFrom - }{t, rf} - case !i0 && !i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Flusher - }{t, fl} - case !i0 && !i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{t, fl, rf} - case !i0 && !i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Pusher - }{t, pu} - case !i0 && !i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Pusher - io.ReaderFrom - }{t, pu, rf} - case !i0 && !i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Pusher - http.Flusher - }{t, pu, fl} - case !i0 && !i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Pusher - http.Flusher - io.ReaderFrom - }{t, pu, fl, rf} - case !i0 && i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - }{t, cn} - case !i0 && i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{t, cn, rf} - case !i0 && i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Flusher - }{t, cn, fl} - case !i0 && i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Flusher - io.ReaderFrom - }{t, cn, fl, rf} - case !i0 && i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - }{t, cn, pu} - case !i0 && i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - io.ReaderFrom - }{t, cn, pu, rf} - case !i0 && i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - http.Flusher - }{t, cn, pu, fl} - case !i0 && i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - http.Flusher - io.ReaderFrom - }{t, cn, pu, fl, rf} - case i0 && !i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - }{t, hj} - case i0 && !i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{t, hj, rf} - case i0 && !i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Flusher - }{t, hj, fl} - case i0 && !i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Flusher - io.ReaderFrom - }{t, hj, fl, rf} - case i0 && !i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - }{t, hj, pu} - case i0 && !i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - io.ReaderFrom - }{t, hj, pu, rf} - case i0 && !i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - http.Flusher - }{t, hj, pu, fl} - case i0 && !i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - http.Flusher - io.ReaderFrom - }{t, hj, pu, fl, rf} - case i0 && i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - }{t, hj, cn} - case i0 && i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - io.ReaderFrom - }{t, hj, cn, rf} - case i0 && i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Flusher - }{t, hj, cn, fl} - case i0 && i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Flusher - io.ReaderFrom - }{t, hj, cn, fl, rf} - case i0 && i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - }{t, hj, cn, pu} - case i0 && i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - io.ReaderFrom - }{t, hj, cn, pu, rf} - case i0 && i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - http.Flusher - }{t, hj, cn, pu, fl} - case i0 && i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - http.Flusher - io.ReaderFrom - }{t, hj, cn, pu, fl, rf} - default: - return struct { - http.ResponseWriter - }{t} - } -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go deleted file mode 100644 index 05c6c56cc7..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "crypto/tls" - "net/http" - "net/http/httptrace" - "strings" - - "go.opencensus.io/trace" -) - -type spanAnnotator struct { - sp *trace.Span -} - -// TODO: Remove NewSpanAnnotator at the next release. - -// NewSpanAnnotator returns a httptrace.ClientTrace which annotates -// all emitted httptrace events on the provided Span. -// Deprecated: Use NewSpanAnnotatingClientTrace instead -func NewSpanAnnotator(r *http.Request, s *trace.Span) *httptrace.ClientTrace { - return NewSpanAnnotatingClientTrace(r, s) -} - -// NewSpanAnnotatingClientTrace returns a httptrace.ClientTrace which annotates -// all emitted httptrace events on the provided Span. -func NewSpanAnnotatingClientTrace(_ *http.Request, s *trace.Span) *httptrace.ClientTrace { - sa := spanAnnotator{sp: s} - - return &httptrace.ClientTrace{ - GetConn: sa.getConn, - GotConn: sa.gotConn, - PutIdleConn: sa.putIdleConn, - GotFirstResponseByte: sa.gotFirstResponseByte, - Got100Continue: sa.got100Continue, - DNSStart: sa.dnsStart, - DNSDone: sa.dnsDone, - ConnectStart: sa.connectStart, - ConnectDone: sa.connectDone, - TLSHandshakeStart: sa.tlsHandshakeStart, - TLSHandshakeDone: sa.tlsHandshakeDone, - WroteHeaders: sa.wroteHeaders, - Wait100Continue: sa.wait100Continue, - WroteRequest: sa.wroteRequest, - } -} - -func (s spanAnnotator) getConn(hostPort string) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.get_connection.host_port", hostPort), - } - s.sp.Annotate(attrs, "GetConn") -} - -func (s spanAnnotator) gotConn(info httptrace.GotConnInfo) { - attrs := []trace.Attribute{ - trace.BoolAttribute("httptrace.got_connection.reused", info.Reused), - trace.BoolAttribute("httptrace.got_connection.was_idle", info.WasIdle), - } - if info.WasIdle { - attrs = append(attrs, - trace.StringAttribute("httptrace.got_connection.idle_time", info.IdleTime.String())) - } - s.sp.Annotate(attrs, "GotConn") -} - -// PutIdleConn implements a httptrace.ClientTrace hook -func (s spanAnnotator) putIdleConn(err error) { - var attrs []trace.Attribute - if err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.put_idle_connection.error", err.Error())) - } - s.sp.Annotate(attrs, "PutIdleConn") -} - -func (s spanAnnotator) gotFirstResponseByte() { - s.sp.Annotate(nil, "GotFirstResponseByte") -} - -func (s spanAnnotator) got100Continue() { - s.sp.Annotate(nil, "Got100Continue") -} - -func (s spanAnnotator) dnsStart(info httptrace.DNSStartInfo) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.dns_start.host", info.Host), - } - s.sp.Annotate(attrs, "DNSStart") -} - -func (s spanAnnotator) dnsDone(info httptrace.DNSDoneInfo) { - var addrs []string - for _, addr := range info.Addrs { - addrs = append(addrs, addr.String()) - } - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.dns_done.addrs", strings.Join(addrs, " , ")), - } - if info.Err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.dns_done.error", info.Err.Error())) - } - s.sp.Annotate(attrs, "DNSDone") -} - -func (s spanAnnotator) connectStart(network, addr string) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.connect_start.network", network), - trace.StringAttribute("httptrace.connect_start.addr", addr), - } - s.sp.Annotate(attrs, "ConnectStart") -} - -func (s spanAnnotator) connectDone(network, addr string, err error) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.connect_done.network", network), - trace.StringAttribute("httptrace.connect_done.addr", addr), - } - if err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.connect_done.error", err.Error())) - } - s.sp.Annotate(attrs, "ConnectDone") -} - -func (s spanAnnotator) tlsHandshakeStart() { - s.sp.Annotate(nil, "TLSHandshakeStart") -} - -func (s spanAnnotator) tlsHandshakeDone(_ tls.ConnectionState, err error) { - var attrs []trace.Attribute - if err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.tls_handshake_done.error", err.Error())) - } - s.sp.Annotate(attrs, "TLSHandshakeDone") -} - -func (s spanAnnotator) wroteHeaders() { - s.sp.Annotate(nil, "WroteHeaders") -} - -func (s spanAnnotator) wait100Continue() { - s.sp.Annotate(nil, "Wait100Continue") -} - -func (s spanAnnotator) wroteRequest(info httptrace.WroteRequestInfo) { - var attrs []trace.Attribute - if info.Err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.wrote_request.error", info.Err.Error())) - } - s.sp.Annotate(attrs, "WroteRequest") -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/stats.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/stats.go deleted file mode 100644 index ee3729040d..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/stats.go +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "go.opencensus.io/stats" - "go.opencensus.io/stats/view" - "go.opencensus.io/tag" -) - -// Deprecated: client HTTP measures. -var ( - // Deprecated: Use a Count aggregation over one of the other client measures to achieve the same effect. - ClientRequestCount = stats.Int64( - "opencensus.io/http/client/request_count", - "Number of HTTP requests started", - stats.UnitDimensionless) - // Deprecated: Use ClientSentBytes. - ClientRequestBytes = stats.Int64( - "opencensus.io/http/client/request_bytes", - "HTTP request body size if set as ContentLength (uncompressed)", - stats.UnitBytes) - // Deprecated: Use ClientReceivedBytes. - ClientResponseBytes = stats.Int64( - "opencensus.io/http/client/response_bytes", - "HTTP response body size (uncompressed)", - stats.UnitBytes) - // Deprecated: Use ClientRoundtripLatency. - ClientLatency = stats.Float64( - "opencensus.io/http/client/latency", - "End-to-end latency", - stats.UnitMilliseconds) -) - -// The following client HTTP measures are supported for use in custom views. -var ( - ClientSentBytes = stats.Int64( - "opencensus.io/http/client/sent_bytes", - "Total bytes sent in request body (not including headers)", - stats.UnitBytes, - ) - ClientReceivedBytes = stats.Int64( - "opencensus.io/http/client/received_bytes", - "Total bytes received in response bodies (not including headers but including error responses with bodies)", - stats.UnitBytes, - ) - ClientRoundtripLatency = stats.Float64( - "opencensus.io/http/client/roundtrip_latency", - "Time between first byte of request headers sent to last byte of response received, or terminal error", - stats.UnitMilliseconds, - ) -) - -// The following server HTTP measures are supported for use in custom views: -var ( - ServerRequestCount = stats.Int64( - "opencensus.io/http/server/request_count", - "Number of HTTP requests started", - stats.UnitDimensionless) - ServerRequestBytes = stats.Int64( - "opencensus.io/http/server/request_bytes", - "HTTP request body size if set as ContentLength (uncompressed)", - stats.UnitBytes) - ServerResponseBytes = stats.Int64( - "opencensus.io/http/server/response_bytes", - "HTTP response body size (uncompressed)", - stats.UnitBytes) - ServerLatency = stats.Float64( - "opencensus.io/http/server/latency", - "End-to-end latency", - stats.UnitMilliseconds) -) - -// The following tags are applied to stats recorded by this package. Host, Path -// and Method are applied to all measures. StatusCode is not applied to -// ClientRequestCount or ServerRequestCount, since it is recorded before the status is known. -var ( - // Host is the value of the HTTP Host header. - // - // The value of this tag can be controlled by the HTTP client, so you need - // to watch out for potentially generating high-cardinality labels in your - // metrics backend if you use this tag in views. - Host = tag.MustNewKey("http.host") - - // StatusCode is the numeric HTTP response status code, - // or "error" if a transport error occurred and no status code was read. - StatusCode = tag.MustNewKey("http.status") - - // Path is the URL path (not including query string) in the request. - // - // The value of this tag can be controlled by the HTTP client, so you need - // to watch out for potentially generating high-cardinality labels in your - // metrics backend if you use this tag in views. - Path = tag.MustNewKey("http.path") - - // Method is the HTTP method of the request, capitalized (GET, POST, etc.). - Method = tag.MustNewKey("http.method") - - // KeyServerRoute is a low cardinality string representing the logical - // handler of the request. This is usually the pattern registered on the a - // ServeMux (or similar string). - KeyServerRoute = tag.MustNewKey("http_server_route") -) - -// Client tag keys. -var ( - // KeyClientMethod is the HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.). - KeyClientMethod = tag.MustNewKey("http_client_method") - // KeyClientPath is the URL path (not including query string). - KeyClientPath = tag.MustNewKey("http_client_path") - // KeyClientStatus is the HTTP status code as an integer (e.g. 200, 404, 500.), or "error" if no response status line was received. - KeyClientStatus = tag.MustNewKey("http_client_status") - // KeyClientHost is the value of the request Host header. - KeyClientHost = tag.MustNewKey("http_client_host") -) - -// Default distributions used by views in this package. -var ( - DefaultSizeDistribution = view.Distribution(1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296) - DefaultLatencyDistribution = view.Distribution(1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000) -) - -// Package ochttp provides some convenience views for client measures. -// You still need to register these views for data to actually be collected. -var ( - ClientSentBytesDistribution = &view.View{ - Name: "opencensus.io/http/client/sent_bytes", - Measure: ClientSentBytes, - Aggregation: DefaultSizeDistribution, - Description: "Total bytes sent in request body (not including headers), by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } - - ClientReceivedBytesDistribution = &view.View{ - Name: "opencensus.io/http/client/received_bytes", - Measure: ClientReceivedBytes, - Aggregation: DefaultSizeDistribution, - Description: "Total bytes received in response bodies (not including headers but including error responses with bodies), by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } - - ClientRoundtripLatencyDistribution = &view.View{ - Name: "opencensus.io/http/client/roundtrip_latency", - Measure: ClientRoundtripLatency, - Aggregation: DefaultLatencyDistribution, - Description: "End-to-end latency, by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } - - ClientCompletedCount = &view.View{ - Name: "opencensus.io/http/client/completed_count", - Measure: ClientRoundtripLatency, - Aggregation: view.Count(), - Description: "Count of completed requests, by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } -) - -// Deprecated: Old client Views. -var ( - // Deprecated: No direct replacement, but see ClientCompletedCount. - ClientRequestCountView = &view.View{ - Name: "opencensus.io/http/client/request_count", - Description: "Count of HTTP requests started", - Measure: ClientRequestCount, - Aggregation: view.Count(), - } - - // Deprecated: Use ClientSentBytesDistribution. - ClientRequestBytesView = &view.View{ - Name: "opencensus.io/http/client/request_bytes", - Description: "Size distribution of HTTP request body", - Measure: ClientSentBytes, - Aggregation: DefaultSizeDistribution, - } - - // Deprecated: Use ClientReceivedBytesDistribution instead. - ClientResponseBytesView = &view.View{ - Name: "opencensus.io/http/client/response_bytes", - Description: "Size distribution of HTTP response body", - Measure: ClientReceivedBytes, - Aggregation: DefaultSizeDistribution, - } - - // Deprecated: Use ClientRoundtripLatencyDistribution instead. - ClientLatencyView = &view.View{ - Name: "opencensus.io/http/client/latency", - Description: "Latency distribution of HTTP requests", - Measure: ClientRoundtripLatency, - Aggregation: DefaultLatencyDistribution, - } - - // Deprecated: Use ClientCompletedCount instead. - ClientRequestCountByMethod = &view.View{ - Name: "opencensus.io/http/client/request_count_by_method", - Description: "Client request count by HTTP method", - TagKeys: []tag.Key{Method}, - Measure: ClientSentBytes, - Aggregation: view.Count(), - } - - // Deprecated: Use ClientCompletedCount instead. - ClientResponseCountByStatusCode = &view.View{ - Name: "opencensus.io/http/client/response_count_by_status_code", - Description: "Client response count by status code", - TagKeys: []tag.Key{StatusCode}, - Measure: ClientRoundtripLatency, - Aggregation: view.Count(), - } -) - -// Package ochttp provides some convenience views for server measures. -// You still need to register these views for data to actually be collected. -var ( - ServerRequestCountView = &view.View{ - Name: "opencensus.io/http/server/request_count", - Description: "Count of HTTP requests started", - Measure: ServerRequestCount, - Aggregation: view.Count(), - } - - ServerRequestBytesView = &view.View{ - Name: "opencensus.io/http/server/request_bytes", - Description: "Size distribution of HTTP request body", - Measure: ServerRequestBytes, - Aggregation: DefaultSizeDistribution, - } - - ServerResponseBytesView = &view.View{ - Name: "opencensus.io/http/server/response_bytes", - Description: "Size distribution of HTTP response body", - Measure: ServerResponseBytes, - Aggregation: DefaultSizeDistribution, - } - - ServerLatencyView = &view.View{ - Name: "opencensus.io/http/server/latency", - Description: "Latency distribution of HTTP requests", - Measure: ServerLatency, - Aggregation: DefaultLatencyDistribution, - } - - ServerRequestCountByMethod = &view.View{ - Name: "opencensus.io/http/server/request_count_by_method", - Description: "Server request count by HTTP method", - TagKeys: []tag.Key{Method}, - Measure: ServerRequestCount, - Aggregation: view.Count(), - } - - ServerResponseCountByStatusCode = &view.View{ - Name: "opencensus.io/http/server/response_count_by_status_code", - Description: "Server response count by status code", - TagKeys: []tag.Key{StatusCode}, - Measure: ServerLatency, - Aggregation: view.Count(), - } -) - -// DefaultClientViews are the default client views provided by this package. -// Deprecated: No replacement. Register the views you would like individually. -var DefaultClientViews = []*view.View{ - ClientRequestCountView, - ClientRequestBytesView, - ClientResponseBytesView, - ClientLatencyView, - ClientRequestCountByMethod, - ClientResponseCountByStatusCode, -} - -// DefaultServerViews are the default server views provided by this package. -// Deprecated: No replacement. Register the views you would like individually. -var DefaultServerViews = []*view.View{ - ServerRequestCountView, - ServerRequestBytesView, - ServerResponseBytesView, - ServerLatencyView, - ServerRequestCountByMethod, - ServerResponseCountByStatusCode, -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/trace.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/trace.go deleted file mode 100644 index ed3a5db561..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/trace.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 ochttp - -import ( - "io" - "net/http" - "net/http/httptrace" - - "go.opencensus.io/plugin/ochttp/propagation/b3" - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// TODO(jbd): Add godoc examples. - -var defaultFormat propagation.HTTPFormat = &b3.HTTPFormat{} - -// Attributes recorded on the span for the requests. -// Only trace exporters will need them. -const ( - HostAttribute = "http.host" - MethodAttribute = "http.method" - PathAttribute = "http.path" - URLAttribute = "http.url" - UserAgentAttribute = "http.user_agent" - StatusCodeAttribute = "http.status_code" -) - -type traceTransport struct { - base http.RoundTripper - startOptions trace.StartOptions - format propagation.HTTPFormat - formatSpanName func(*http.Request) string - newClientTrace func(*http.Request, *trace.Span) *httptrace.ClientTrace -} - -// TODO(jbd): Add message events for request and response size. - -// RoundTrip creates a trace.Span and inserts it into the outgoing request's headers. -// The created span can follow a parent span, if a parent is presented in -// the request's context. -func (t *traceTransport) RoundTrip(req *http.Request) (*http.Response, error) { - name := t.formatSpanName(req) - // TODO(jbd): Discuss whether we want to prefix - // outgoing requests with Sent. - ctx, span := trace.StartSpan(req.Context(), name, - trace.WithSampler(t.startOptions.Sampler), - trace.WithSpanKind(trace.SpanKindClient)) - - if t.newClientTrace != nil { - req = req.WithContext(httptrace.WithClientTrace(ctx, t.newClientTrace(req, span))) - } else { - req = req.WithContext(ctx) - } - - if t.format != nil { - // SpanContextToRequest will modify its Request argument, which is - // contrary to the contract for http.RoundTripper, so we need to - // pass it a copy of the Request. - // However, the Request struct itself was already copied by - // the WithContext calls above and so we just need to copy the header. - header := make(http.Header) - for k, v := range req.Header { - header[k] = v - } - req.Header = header - t.format.SpanContextToRequest(span.SpanContext(), req) - } - - span.AddAttributes(requestAttrs(req)...) - resp, err := t.base.RoundTrip(req) - if err != nil { - span.SetStatus(trace.Status{Code: trace.StatusCodeUnknown, Message: err.Error()}) - span.End() - return resp, err - } - - span.AddAttributes(responseAttrs(resp)...) - span.SetStatus(TraceStatus(resp.StatusCode, resp.Status)) - - // span.End() will be invoked after - // a read from resp.Body returns io.EOF or when - // resp.Body.Close() is invoked. - bt := &bodyTracker{rc: resp.Body, span: span} - resp.Body = wrappedBody(bt, resp.Body) - return resp, err -} - -// bodyTracker wraps a response.Body and invokes -// trace.EndSpan on encountering io.EOF on reading -// the body of the original response. -type bodyTracker struct { - rc io.ReadCloser - span *trace.Span -} - -var _ io.ReadCloser = (*bodyTracker)(nil) - -func (bt *bodyTracker) Read(b []byte) (int, error) { - n, err := bt.rc.Read(b) - - switch err { - case nil: - return n, nil - case io.EOF: - bt.span.End() - default: - // For all other errors, set the span status - bt.span.SetStatus(trace.Status{ - // Code 2 is the error code for Internal server error. - Code: 2, - Message: err.Error(), - }) - } - return n, err -} - -func (bt *bodyTracker) Close() error { - // Invoking endSpan on Close will help catch the cases - // in which a read returned a non-nil error, we set the - // span status but didn't end the span. - bt.span.End() - return bt.rc.Close() -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t *traceTransport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(*http.Request) - } - if cr, ok := t.base.(canceler); ok { - cr.CancelRequest(req) - } -} - -func spanNameFromURL(req *http.Request) string { - return req.URL.Path -} - -func requestAttrs(r *http.Request) []trace.Attribute { - userAgent := r.UserAgent() - - attrs := make([]trace.Attribute, 0, 5) - attrs = append(attrs, - trace.StringAttribute(PathAttribute, r.URL.Path), - trace.StringAttribute(URLAttribute, r.URL.String()), - trace.StringAttribute(HostAttribute, r.Host), - trace.StringAttribute(MethodAttribute, r.Method), - ) - - if userAgent != "" { - attrs = append(attrs, trace.StringAttribute(UserAgentAttribute, userAgent)) - } - - return attrs -} - -func responseAttrs(resp *http.Response) []trace.Attribute { - return []trace.Attribute{ - trace.Int64Attribute(StatusCodeAttribute, int64(resp.StatusCode)), - } -} - -// TraceStatus is a utility to convert the HTTP status code to a trace.Status that -// represents the outcome as closely as possible. -func TraceStatus(httpStatusCode int, statusLine string) trace.Status { - var code int32 - if httpStatusCode < 200 || httpStatusCode >= 400 { - code = trace.StatusCodeUnknown - } - switch httpStatusCode { - case 499: - code = trace.StatusCodeCancelled - case http.StatusBadRequest: - code = trace.StatusCodeInvalidArgument - case http.StatusUnprocessableEntity: - code = trace.StatusCodeInvalidArgument - case http.StatusGatewayTimeout: - code = trace.StatusCodeDeadlineExceeded - case http.StatusNotFound: - code = trace.StatusCodeNotFound - case http.StatusForbidden: - code = trace.StatusCodePermissionDenied - case http.StatusUnauthorized: // 401 is actually unauthenticated. - code = trace.StatusCodeUnauthenticated - case http.StatusTooManyRequests: - code = trace.StatusCodeResourceExhausted - case http.StatusNotImplemented: - code = trace.StatusCodeUnimplemented - case http.StatusServiceUnavailable: - code = trace.StatusCodeUnavailable - case http.StatusOK: - code = trace.StatusCodeOK - case http.StatusConflict: - code = trace.StatusCodeAlreadyExists - } - - return trace.Status{Code: code, Message: codeToStr[code]} -} - -var codeToStr = map[int32]string{ - trace.StatusCodeOK: `OK`, - trace.StatusCodeCancelled: `CANCELLED`, - trace.StatusCodeUnknown: `UNKNOWN`, - trace.StatusCodeInvalidArgument: `INVALID_ARGUMENT`, - trace.StatusCodeDeadlineExceeded: `DEADLINE_EXCEEDED`, - trace.StatusCodeNotFound: `NOT_FOUND`, - trace.StatusCodeAlreadyExists: `ALREADY_EXISTS`, - trace.StatusCodePermissionDenied: `PERMISSION_DENIED`, - trace.StatusCodeResourceExhausted: `RESOURCE_EXHAUSTED`, - trace.StatusCodeFailedPrecondition: `FAILED_PRECONDITION`, - trace.StatusCodeAborted: `ABORTED`, - trace.StatusCodeOutOfRange: `OUT_OF_RANGE`, - trace.StatusCodeUnimplemented: `UNIMPLEMENTED`, - trace.StatusCodeInternal: `INTERNAL`, - trace.StatusCodeUnavailable: `UNAVAILABLE`, - trace.StatusCodeDataLoss: `DATA_LOSS`, - trace.StatusCodeUnauthenticated: `UNAUTHENTICATED`, -} - -func isHealthEndpoint(path string) bool { - // Health checking is pretty frequent and - // traces collected for health endpoints - // can be extremely noisy and expensive. - // Disable canonical health checking endpoints - // like /healthz and /_ah/health for now. - if path == "/healthz" || path == "/_ah/health" { - return true - } - return false -} diff --git a/ibm/vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go b/ibm/vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go deleted file mode 100644 index 7d75cae2b1..0000000000 --- a/ibm/vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 ochttp - -import ( - "io" -) - -// wrappedBody returns a wrapped version of the original -// Body and only implements the same combination of additional -// interfaces as the original. -func wrappedBody(wrapper io.ReadCloser, body io.ReadCloser) io.ReadCloser { - var ( - wr, i0 = body.(io.Writer) - ) - switch { - case !i0: - return struct { - io.ReadCloser - }{wrapper} - - case i0: - return struct { - io.ReadCloser - io.Writer - }{wrapper, wr} - default: - return struct { - io.ReadCloser - }{wrapper} - } -} diff --git a/ibm/vendor/go.opencensus.io/resource/resource.go b/ibm/vendor/go.opencensus.io/resource/resource.go deleted file mode 100644 index b1764e1d3b..0000000000 --- a/ibm/vendor/go.opencensus.io/resource/resource.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 resource provides functionality for resource, which capture -// identifying information about the entities for which signals are exported. -package resource - -import ( - "context" - "fmt" - "os" - "regexp" - "sort" - "strconv" - "strings" -) - -// Environment variables used by FromEnv to decode a resource. -const ( - EnvVarType = "OC_RESOURCE_TYPE" - EnvVarLabels = "OC_RESOURCE_LABELS" -) - -// Resource describes an entity about which identifying information and metadata is exposed. -// For example, a type "k8s.io/container" may hold labels describing the pod name and namespace. -type Resource struct { - Type string - Labels map[string]string -} - -// EncodeLabels encodes a labels map to a string as provided via the OC_RESOURCE_LABELS environment variable. -func EncodeLabels(labels map[string]string) string { - sortedKeys := make([]string, 0, len(labels)) - for k := range labels { - sortedKeys = append(sortedKeys, k) - } - sort.Strings(sortedKeys) - - s := "" - for i, k := range sortedKeys { - if i > 0 { - s += "," - } - s += k + "=" + strconv.Quote(labels[k]) - } - return s -} - -var labelRegex = regexp.MustCompile(`^\s*([[:ascii:]]{1,256}?)=("[[:ascii:]]{0,256}?")\s*,`) - -// DecodeLabels decodes a serialized label map as used in the OC_RESOURCE_LABELS variable. -// A list of labels of the form `="",="",...` is accepted. -// Domain names and paths are accepted as label keys. -// Most users will want to use FromEnv instead. -func DecodeLabels(s string) (map[string]string, error) { - m := map[string]string{} - // Ensure a trailing comma, which allows us to keep the regex simpler - s = strings.TrimRight(strings.TrimSpace(s), ",") + "," - - for len(s) > 0 { - match := labelRegex.FindStringSubmatch(s) - if len(match) == 0 { - return nil, fmt.Errorf("invalid label formatting, remainder: %s", s) - } - v := match[2] - if v == "" { - v = match[3] - } else { - var err error - if v, err = strconv.Unquote(v); err != nil { - return nil, fmt.Errorf("invalid label formatting, remainder: %s, err: %s", s, err) - } - } - m[match[1]] = v - - s = s[len(match[0]):] - } - return m, nil -} - -// FromEnv is a detector that loads resource information from the OC_RESOURCE_TYPE -// and OC_RESOURCE_labelS environment variables. -func FromEnv(context.Context) (*Resource, error) { - res := &Resource{ - Type: strings.TrimSpace(os.Getenv(EnvVarType)), - } - labels := strings.TrimSpace(os.Getenv(EnvVarLabels)) - if labels == "" { - return res, nil - } - var err error - if res.Labels, err = DecodeLabels(labels); err != nil { - return nil, err - } - return res, nil -} - -var _ Detector = FromEnv - -// merge resource information from b into a. In case of a collision, a takes precedence. -func merge(a, b *Resource) *Resource { - if a == nil { - return b - } - if b == nil { - return a - } - res := &Resource{ - Type: a.Type, - Labels: map[string]string{}, - } - if res.Type == "" { - res.Type = b.Type - } - for k, v := range b.Labels { - res.Labels[k] = v - } - // Labels from resource a overwrite labels from resource b. - for k, v := range a.Labels { - res.Labels[k] = v - } - return res -} - -// Detector attempts to detect resource information. -// If the detector cannot find resource information, the returned resource is nil but no -// error is returned. -// An error is only returned on unexpected failures. -type Detector func(context.Context) (*Resource, error) - -// MultiDetector returns a Detector that calls all input detectors in order and -// merges each result with the previous one. In case a type of label key is already set, -// the first set value is takes precedence. -// It returns on the first error that a sub-detector encounters. -func MultiDetector(detectors ...Detector) Detector { - return func(ctx context.Context) (*Resource, error) { - return detectAll(ctx, detectors...) - } -} - -// detectall calls all input detectors sequentially an merges each result with the previous one. -// It returns on the first error that a sub-detector encounters. -func detectAll(ctx context.Context, detectors ...Detector) (*Resource, error) { - var res *Resource - for _, d := range detectors { - r, err := d(ctx) - if err != nil { - return nil, err - } - res = merge(res, r) - } - return res, nil -} diff --git a/ibm/vendor/go.opencensus.io/stats/doc.go b/ibm/vendor/go.opencensus.io/stats/doc.go deleted file mode 100644 index 00d473ee02..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/doc.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 stats contains support for OpenCensus stats recording. - -OpenCensus allows users to create typed measures, record measurements, -aggregate the collected data, and export the aggregated data. - -Measures - -A measure represents a type of data point to be tracked and recorded. -For example, latency, request Mb/s, and response Mb/s are measures -to collect from a server. - -Measure constructors such as Int64 and Float64 automatically -register the measure by the given name. Each registered measure needs -to be unique by name. Measures also have a description and a unit. - -Libraries can define and export measures. Application authors can then -create views and collect and break down measures by the tags they are -interested in. - -Recording measurements - -Measurement is a data point to be collected for a measure. For example, -for a latency (ms) measure, 100 is a measurement that represents a 100ms -latency event. Measurements are created from measures with -the current context. Tags from the current context are recorded with the -measurements if they are any. - -Recorded measurements are dropped immediately if no views are registered for them. -There is usually no need to conditionally enable and disable -recording to reduce cost. Recording of measurements is cheap. - -Libraries can always record measurements, and applications can later decide -on which measurements they want to collect by registering views. This allows -libraries to turn on the instrumentation by default. - -Exemplars - -For a given recorded measurement, the associated exemplar is a diagnostic map -that gives more information about the measurement. - -When aggregated using a Distribution aggregation, an exemplar is kept for each -bucket in the Distribution. This allows you to easily find an example of a -measurement that fell into each bucket. - -For example, if you also use the OpenCensus trace package and you -record a measurement with a context that contains a sampled trace span, -then the trace span will be added to the exemplar associated with the measurement. - -When exported to a supporting back end, you should be able to easily navigate -to example traces that fell into each bucket in the Distribution. - -*/ -package stats // import "go.opencensus.io/stats" diff --git a/ibm/vendor/go.opencensus.io/stats/internal/record.go b/ibm/vendor/go.opencensus.io/stats/internal/record.go deleted file mode 100644 index 36935e629b..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/internal/record.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 internal - -import ( - "go.opencensus.io/tag" -) - -// DefaultRecorder will be called for each Record call. -var DefaultRecorder func(tags *tag.Map, measurement interface{}, attachments map[string]interface{}) - -// SubscriptionReporter reports when a view subscribed with a measure. -var SubscriptionReporter func(measure string) diff --git a/ibm/vendor/go.opencensus.io/stats/measure.go b/ibm/vendor/go.opencensus.io/stats/measure.go deleted file mode 100644 index 1ffd3cefc7..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/measure.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 stats - -import ( - "sync" - "sync/atomic" -) - -// Measure represents a single numeric value to be tracked and recorded. -// For example, latency, request bytes, and response bytes could be measures -// to collect from a server. -// -// Measures by themselves have no outside effects. In order to be exported, -// the measure needs to be used in a View. If no Views are defined over a -// measure, there is very little cost in recording it. -type Measure interface { - // Name returns the name of this measure. - // - // Measure names are globally unique (among all libraries linked into your program). - // We recommend prefixing the measure name with a domain name relevant to your - // project or application. - // - // Measure names are never sent over the wire or exported to backends. - // They are only used to create Views. - Name() string - - // Description returns the human-readable description of this measure. - Description() string - - // Unit returns the units for the values this measure takes on. - // - // Units are encoded according to the case-sensitive abbreviations from the - // Unified Code for Units of Measure: http://unitsofmeasure.org/ucum.html - Unit() string -} - -// measureDescriptor is the untyped descriptor associated with each measure. -// Int64Measure and Float64Measure wrap measureDescriptor to provide typed -// recording APIs. -// Two Measures with the same name will have the same measureDescriptor. -type measureDescriptor struct { - subs int32 // access atomically - - name string - description string - unit string -} - -func (m *measureDescriptor) subscribe() { - atomic.StoreInt32(&m.subs, 1) -} - -func (m *measureDescriptor) subscribed() bool { - return atomic.LoadInt32(&m.subs) == 1 -} - -var ( - mu sync.RWMutex - measures = make(map[string]*measureDescriptor) -) - -func registerMeasureHandle(name, desc, unit string) *measureDescriptor { - mu.Lock() - defer mu.Unlock() - - if stored, ok := measures[name]; ok { - return stored - } - m := &measureDescriptor{ - name: name, - description: desc, - unit: unit, - } - measures[name] = m - return m -} - -// Measurement is the numeric value measured when recording stats. Each measure -// provides methods to create measurements of their kind. For example, Int64Measure -// provides M to convert an int64 into a measurement. -type Measurement struct { - v float64 - m Measure - desc *measureDescriptor -} - -// Value returns the value of the Measurement as a float64. -func (m Measurement) Value() float64 { - return m.v -} - -// Measure returns the Measure from which this Measurement was created. -func (m Measurement) Measure() Measure { - return m.m -} diff --git a/ibm/vendor/go.opencensus.io/stats/measure_float64.go b/ibm/vendor/go.opencensus.io/stats/measure_float64.go deleted file mode 100644 index f02c1eda84..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/measure_float64.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 stats - -// Float64Measure is a measure for float64 values. -type Float64Measure struct { - desc *measureDescriptor -} - -// M creates a new float64 measurement. -// Use Record to record measurements. -func (m *Float64Measure) M(v float64) Measurement { - return Measurement{ - m: m, - desc: m.desc, - v: v, - } -} - -// Float64 creates a new measure for float64 values. -// -// See the documentation for interface Measure for more guidance on the -// parameters of this function. -func Float64(name, description, unit string) *Float64Measure { - mi := registerMeasureHandle(name, description, unit) - return &Float64Measure{mi} -} - -// Name returns the name of the measure. -func (m *Float64Measure) Name() string { - return m.desc.name -} - -// Description returns the description of the measure. -func (m *Float64Measure) Description() string { - return m.desc.description -} - -// Unit returns the unit of the measure. -func (m *Float64Measure) Unit() string { - return m.desc.unit -} diff --git a/ibm/vendor/go.opencensus.io/stats/measure_int64.go b/ibm/vendor/go.opencensus.io/stats/measure_int64.go deleted file mode 100644 index d101d79735..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/measure_int64.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 stats - -// Int64Measure is a measure for int64 values. -type Int64Measure struct { - desc *measureDescriptor -} - -// M creates a new int64 measurement. -// Use Record to record measurements. -func (m *Int64Measure) M(v int64) Measurement { - return Measurement{ - m: m, - desc: m.desc, - v: float64(v), - } -} - -// Int64 creates a new measure for int64 values. -// -// See the documentation for interface Measure for more guidance on the -// parameters of this function. -func Int64(name, description, unit string) *Int64Measure { - mi := registerMeasureHandle(name, description, unit) - return &Int64Measure{mi} -} - -// Name returns the name of the measure. -func (m *Int64Measure) Name() string { - return m.desc.name -} - -// Description returns the description of the measure. -func (m *Int64Measure) Description() string { - return m.desc.description -} - -// Unit returns the unit of the measure. -func (m *Int64Measure) Unit() string { - return m.desc.unit -} diff --git a/ibm/vendor/go.opencensus.io/stats/record.go b/ibm/vendor/go.opencensus.io/stats/record.go deleted file mode 100644 index 2b97283462..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/record.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 stats - -import ( - "context" - - "go.opencensus.io/metric/metricdata" - "go.opencensus.io/stats/internal" - "go.opencensus.io/tag" -) - -func init() { - internal.SubscriptionReporter = func(measure string) { - mu.Lock() - measures[measure].subscribe() - mu.Unlock() - } -} - -// Recorder provides an interface for exporting measurement information from -// the static Record method by using the WithRecorder option. -type Recorder interface { - // Record records a set of measurements associated with the given tags and attachments. - // The second argument is a `[]Measurement`. - Record(*tag.Map, interface{}, map[string]interface{}) -} - -type recordOptions struct { - attachments metricdata.Attachments - mutators []tag.Mutator - measurements []Measurement - recorder Recorder -} - -// WithAttachments applies provided exemplar attachments. -func WithAttachments(attachments metricdata.Attachments) Options { - return func(ro *recordOptions) { - ro.attachments = attachments - } -} - -// WithTags applies provided tag mutators. -func WithTags(mutators ...tag.Mutator) Options { - return func(ro *recordOptions) { - ro.mutators = mutators - } -} - -// WithMeasurements applies provided measurements. -func WithMeasurements(measurements ...Measurement) Options { - return func(ro *recordOptions) { - ro.measurements = measurements - } -} - -// WithRecorder records the measurements to the specified `Recorder`, rather -// than to the global metrics recorder. -func WithRecorder(meter Recorder) Options { - return func(ro *recordOptions) { - ro.recorder = meter - } -} - -// Options apply changes to recordOptions. -type Options func(*recordOptions) - -func createRecordOption(ros ...Options) *recordOptions { - o := &recordOptions{} - for _, ro := range ros { - ro(o) - } - return o -} - -// Record records one or multiple measurements with the same context at once. -// If there are any tags in the context, measurements will be tagged with them. -func Record(ctx context.Context, ms ...Measurement) { - RecordWithOptions(ctx, WithMeasurements(ms...)) -} - -// RecordWithTags records one or multiple measurements at once. -// -// Measurements will be tagged with the tags in the context mutated by the mutators. -// RecordWithTags is useful if you want to record with tag mutations but don't want -// to propagate the mutations in the context. -func RecordWithTags(ctx context.Context, mutators []tag.Mutator, ms ...Measurement) error { - return RecordWithOptions(ctx, WithTags(mutators...), WithMeasurements(ms...)) -} - -// RecordWithOptions records measurements from the given options (if any) against context -// and tags and attachments in the options (if any). -// If there are any tags in the context, measurements will be tagged with them. -func RecordWithOptions(ctx context.Context, ros ...Options) error { - o := createRecordOption(ros...) - if len(o.measurements) == 0 { - return nil - } - recorder := internal.DefaultRecorder - if o.recorder != nil { - recorder = o.recorder.Record - } - if recorder == nil { - return nil - } - record := false - for _, m := range o.measurements { - if m.desc.subscribed() { - record = true - break - } - } - if !record { - return nil - } - if len(o.mutators) > 0 { - var err error - if ctx, err = tag.New(ctx, o.mutators...); err != nil { - return err - } - } - recorder(tag.FromContext(ctx), o.measurements, o.attachments) - return nil -} diff --git a/ibm/vendor/go.opencensus.io/stats/units.go b/ibm/vendor/go.opencensus.io/stats/units.go deleted file mode 100644 index 736399652c..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/units.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 stats - -// Units are encoded according to the case-sensitive abbreviations from the -// Unified Code for Units of Measure: http://unitsofmeasure.org/ucum.html -const ( - UnitNone = "1" // Deprecated: Use UnitDimensionless. - UnitDimensionless = "1" - UnitBytes = "By" - UnitMilliseconds = "ms" - UnitSeconds = "s" -) diff --git a/ibm/vendor/go.opencensus.io/stats/view/aggregation.go b/ibm/vendor/go.opencensus.io/stats/view/aggregation.go deleted file mode 100644 index 9d7093728e..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/aggregation.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -// AggType represents the type of aggregation function used on a View. -type AggType int - -// All available aggregation types. -const ( - AggTypeNone AggType = iota // no aggregation; reserved for future use. - AggTypeCount // the count aggregation, see Count. - AggTypeSum // the sum aggregation, see Sum. - AggTypeDistribution // the distribution aggregation, see Distribution. - AggTypeLastValue // the last value aggregation, see LastValue. -) - -func (t AggType) String() string { - return aggTypeName[t] -} - -var aggTypeName = map[AggType]string{ - AggTypeNone: "None", - AggTypeCount: "Count", - AggTypeSum: "Sum", - AggTypeDistribution: "Distribution", - AggTypeLastValue: "LastValue", -} - -// Aggregation represents a data aggregation method. Use one of the functions: -// Count, Sum, or Distribution to construct an Aggregation. -type Aggregation struct { - Type AggType // Type is the AggType of this Aggregation. - Buckets []float64 // Buckets are the bucket endpoints if this Aggregation represents a distribution, see Distribution. - - newData func() AggregationData -} - -var ( - aggCount = &Aggregation{ - Type: AggTypeCount, - newData: func() AggregationData { - return &CountData{} - }, - } - aggSum = &Aggregation{ - Type: AggTypeSum, - newData: func() AggregationData { - return &SumData{} - }, - } -) - -// Count indicates that data collected and aggregated -// with this method will be turned into a count value. -// For example, total number of accepted requests can be -// aggregated by using Count. -func Count() *Aggregation { - return aggCount -} - -// Sum indicates that data collected and aggregated -// with this method will be summed up. -// For example, accumulated request bytes can be aggregated by using -// Sum. -func Sum() *Aggregation { - return aggSum -} - -// Distribution indicates that the desired aggregation is -// a histogram distribution. -// -// A distribution aggregation may contain a histogram of the values in the -// population. The bucket boundaries for that histogram are described -// by the bounds. This defines len(bounds)+1 buckets. -// -// If len(bounds) >= 2 then the boundaries for bucket index i are: -// -// [-infinity, bounds[i]) for i = 0 -// [bounds[i-1], bounds[i]) for 0 < i < length -// [bounds[i-1], +infinity) for i = length -// -// If len(bounds) is 0 then there is no histogram associated with the -// distribution. There will be a single bucket with boundaries -// (-infinity, +infinity). -// -// If len(bounds) is 1 then there is no finite buckets, and that single -// element is the common boundary of the overflow and underflow buckets. -func Distribution(bounds ...float64) *Aggregation { - agg := &Aggregation{ - Type: AggTypeDistribution, - Buckets: bounds, - } - agg.newData = func() AggregationData { - return newDistributionData(agg) - } - return agg -} - -// LastValue only reports the last value recorded using this -// aggregation. All other measurements will be dropped. -func LastValue() *Aggregation { - return &Aggregation{ - Type: AggTypeLastValue, - newData: func() AggregationData { - return &LastValueData{} - }, - } -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/aggregation_data.go b/ibm/vendor/go.opencensus.io/stats/view/aggregation_data.go deleted file mode 100644 index f331d456e9..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/aggregation_data.go +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -import ( - "math" - "time" - - "go.opencensus.io/metric/metricdata" -) - -// AggregationData represents an aggregated value from a collection. -// They are reported on the view data during exporting. -// Mosts users won't directly access aggregration data. -type AggregationData interface { - isAggregationData() bool - addSample(v float64, attachments map[string]interface{}, t time.Time) - clone() AggregationData - equal(other AggregationData) bool - toPoint(t metricdata.Type, time time.Time) metricdata.Point -} - -const epsilon = 1e-9 - -// CountData is the aggregated data for the Count aggregation. -// A count aggregation processes data and counts the recordings. -// -// Most users won't directly access count data. -type CountData struct { - Value int64 -} - -func (a *CountData) isAggregationData() bool { return true } - -func (a *CountData) addSample(_ float64, _ map[string]interface{}, _ time.Time) { - a.Value = a.Value + 1 -} - -func (a *CountData) clone() AggregationData { - return &CountData{Value: a.Value} -} - -func (a *CountData) equal(other AggregationData) bool { - a2, ok := other.(*CountData) - if !ok { - return false - } - - return a.Value == a2.Value -} - -func (a *CountData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point { - switch metricType { - case metricdata.TypeCumulativeInt64: - return metricdata.NewInt64Point(t, a.Value) - default: - panic("unsupported metricdata.Type") - } -} - -// SumData is the aggregated data for the Sum aggregation. -// A sum aggregation processes data and sums up the recordings. -// -// Most users won't directly access sum data. -type SumData struct { - Value float64 -} - -func (a *SumData) isAggregationData() bool { return true } - -func (a *SumData) addSample(v float64, _ map[string]interface{}, _ time.Time) { - a.Value += v -} - -func (a *SumData) clone() AggregationData { - return &SumData{Value: a.Value} -} - -func (a *SumData) equal(other AggregationData) bool { - a2, ok := other.(*SumData) - if !ok { - return false - } - return math.Pow(a.Value-a2.Value, 2) < epsilon -} - -func (a *SumData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point { - switch metricType { - case metricdata.TypeCumulativeInt64: - return metricdata.NewInt64Point(t, int64(a.Value)) - case metricdata.TypeCumulativeFloat64: - return metricdata.NewFloat64Point(t, a.Value) - default: - panic("unsupported metricdata.Type") - } -} - -// DistributionData is the aggregated data for the -// Distribution aggregation. -// -// Most users won't directly access distribution data. -// -// For a distribution with N bounds, the associated DistributionData will have -// N+1 buckets. -type DistributionData struct { - Count int64 // number of data points aggregated - Min float64 // minimum value in the distribution - Max float64 // max value in the distribution - Mean float64 // mean of the distribution - SumOfSquaredDev float64 // sum of the squared deviation from the mean - CountPerBucket []int64 // number of occurrences per bucket - // ExemplarsPerBucket is slice the same length as CountPerBucket containing - // an exemplar for the associated bucket, or nil. - ExemplarsPerBucket []*metricdata.Exemplar - bounds []float64 // histogram distribution of the values -} - -func newDistributionData(agg *Aggregation) *DistributionData { - bucketCount := len(agg.Buckets) + 1 - return &DistributionData{ - CountPerBucket: make([]int64, bucketCount), - ExemplarsPerBucket: make([]*metricdata.Exemplar, bucketCount), - bounds: agg.Buckets, - Min: math.MaxFloat64, - Max: math.SmallestNonzeroFloat64, - } -} - -// Sum returns the sum of all samples collected. -func (a *DistributionData) Sum() float64 { return a.Mean * float64(a.Count) } - -func (a *DistributionData) variance() float64 { - if a.Count <= 1 { - return 0 - } - return a.SumOfSquaredDev / float64(a.Count-1) -} - -func (a *DistributionData) isAggregationData() bool { return true } - -// TODO(songy23): support exemplar attachments. -func (a *DistributionData) addSample(v float64, attachments map[string]interface{}, t time.Time) { - if v < a.Min { - a.Min = v - } - if v > a.Max { - a.Max = v - } - a.Count++ - a.addToBucket(v, attachments, t) - - if a.Count == 1 { - a.Mean = v - return - } - - oldMean := a.Mean - a.Mean = a.Mean + (v-a.Mean)/float64(a.Count) - a.SumOfSquaredDev = a.SumOfSquaredDev + (v-oldMean)*(v-a.Mean) -} - -func (a *DistributionData) addToBucket(v float64, attachments map[string]interface{}, t time.Time) { - var count *int64 - var i int - var b float64 - for i, b = range a.bounds { - if v < b { - count = &a.CountPerBucket[i] - break - } - } - if count == nil { // Last bucket. - i = len(a.bounds) - count = &a.CountPerBucket[i] - } - *count++ - if exemplar := getExemplar(v, attachments, t); exemplar != nil { - a.ExemplarsPerBucket[i] = exemplar - } -} - -func getExemplar(v float64, attachments map[string]interface{}, t time.Time) *metricdata.Exemplar { - if len(attachments) == 0 { - return nil - } - return &metricdata.Exemplar{ - Value: v, - Timestamp: t, - Attachments: attachments, - } -} - -func (a *DistributionData) clone() AggregationData { - c := *a - c.CountPerBucket = append([]int64(nil), a.CountPerBucket...) - c.ExemplarsPerBucket = append([]*metricdata.Exemplar(nil), a.ExemplarsPerBucket...) - return &c -} - -func (a *DistributionData) equal(other AggregationData) bool { - a2, ok := other.(*DistributionData) - if !ok { - return false - } - if a2 == nil { - return false - } - if len(a.CountPerBucket) != len(a2.CountPerBucket) { - return false - } - for i := range a.CountPerBucket { - if a.CountPerBucket[i] != a2.CountPerBucket[i] { - return false - } - } - return a.Count == a2.Count && a.Min == a2.Min && a.Max == a2.Max && math.Pow(a.Mean-a2.Mean, 2) < epsilon && math.Pow(a.variance()-a2.variance(), 2) < epsilon -} - -func (a *DistributionData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point { - switch metricType { - case metricdata.TypeCumulativeDistribution: - buckets := []metricdata.Bucket{} - for i := 0; i < len(a.CountPerBucket); i++ { - buckets = append(buckets, metricdata.Bucket{ - Count: a.CountPerBucket[i], - Exemplar: a.ExemplarsPerBucket[i], - }) - } - bucketOptions := &metricdata.BucketOptions{Bounds: a.bounds} - - val := &metricdata.Distribution{ - Count: a.Count, - Sum: a.Sum(), - SumOfSquaredDeviation: a.SumOfSquaredDev, - BucketOptions: bucketOptions, - Buckets: buckets, - } - return metricdata.NewDistributionPoint(t, val) - - default: - // TODO: [rghetia] when we have a use case for TypeGaugeDistribution. - panic("unsupported metricdata.Type") - } -} - -// LastValueData returns the last value recorded for LastValue aggregation. -type LastValueData struct { - Value float64 -} - -func (l *LastValueData) isAggregationData() bool { - return true -} - -func (l *LastValueData) addSample(v float64, _ map[string]interface{}, _ time.Time) { - l.Value = v -} - -func (l *LastValueData) clone() AggregationData { - return &LastValueData{l.Value} -} - -func (l *LastValueData) equal(other AggregationData) bool { - a2, ok := other.(*LastValueData) - if !ok { - return false - } - return l.Value == a2.Value -} - -func (l *LastValueData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point { - switch metricType { - case metricdata.TypeGaugeInt64: - return metricdata.NewInt64Point(t, int64(l.Value)) - case metricdata.TypeGaugeFloat64: - return metricdata.NewFloat64Point(t, l.Value) - default: - panic("unsupported metricdata.Type") - } -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/collector.go b/ibm/vendor/go.opencensus.io/stats/view/collector.go deleted file mode 100644 index 8a6a2c0fdc..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/collector.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -import ( - "sort" - "time" - - "go.opencensus.io/internal/tagencoding" - "go.opencensus.io/tag" -) - -type collector struct { - // signatures holds the aggregations values for each unique tag signature - // (values for all keys) to its aggregator. - signatures map[string]AggregationData - // Aggregation is the description of the aggregation to perform for this - // view. - a *Aggregation -} - -func (c *collector) addSample(s string, v float64, attachments map[string]interface{}, t time.Time) { - aggregator, ok := c.signatures[s] - if !ok { - aggregator = c.a.newData() - c.signatures[s] = aggregator - } - aggregator.addSample(v, attachments, t) -} - -// collectRows returns a snapshot of the collected Row values. -func (c *collector) collectedRows(keys []tag.Key) []*Row { - rows := make([]*Row, 0, len(c.signatures)) - for sig, aggregator := range c.signatures { - tags := decodeTags([]byte(sig), keys) - row := &Row{Tags: tags, Data: aggregator.clone()} - rows = append(rows, row) - } - return rows -} - -func (c *collector) clearRows() { - c.signatures = make(map[string]AggregationData) -} - -// encodeWithKeys encodes the map by using values -// only associated with the keys provided. -func encodeWithKeys(m *tag.Map, keys []tag.Key) []byte { - vb := &tagencoding.Values{ - Buffer: make([]byte, len(keys)), - } - for _, k := range keys { - v, _ := m.Value(k) - vb.WriteValue([]byte(v)) - } - return vb.Bytes() -} - -// decodeTags decodes tags from the buffer and -// orders them by the keys. -func decodeTags(buf []byte, keys []tag.Key) []tag.Tag { - vb := &tagencoding.Values{Buffer: buf} - var tags []tag.Tag - for _, k := range keys { - v := vb.ReadValue() - if v != nil { - tags = append(tags, tag.Tag{Key: k, Value: string(v)}) - } - } - vb.ReadIndex = 0 - sort.Slice(tags, func(i, j int) bool { return tags[i].Key.Name() < tags[j].Key.Name() }) - return tags -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/doc.go b/ibm/vendor/go.opencensus.io/stats/view/doc.go deleted file mode 100644 index 7bbedfe1ff..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/doc.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view contains support for collecting and exposing aggregates over stats. -// -// In order to collect measurements, views need to be defined and registered. -// A view allows recorded measurements to be filtered and aggregated. -// -// All recorded measurements can be grouped by a list of tags. -// -// OpenCensus provides several aggregation methods: Count, Distribution and Sum. -// -// Count only counts the number of measurement points recorded. -// Distribution provides statistical summary of the aggregated data by counting -// how many recorded measurements fall into each bucket. -// Sum adds up the measurement values. -// LastValue just keeps track of the most recently recorded measurement value. -// All aggregations are cumulative. -// -// Views can be registered and unregistered at any time during program execution. -// -// Libraries can define views but it is recommended that in most cases registering -// views be left up to applications. -// -// Exporting -// -// Collected and aggregated data can be exported to a metric collection -// backend by registering its exporter. -// -// Multiple exporters can be registered to upload the data to various -// different back ends. -package view // import "go.opencensus.io/stats/view" - -// TODO(acetechnologist): Add a link to the language independent OpenCensus -// spec when it is available. diff --git a/ibm/vendor/go.opencensus.io/stats/view/export.go b/ibm/vendor/go.opencensus.io/stats/view/export.go deleted file mode 100644 index 73ba11f5b6..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/export.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -// Exporter exports the collected records as view data. -// -// The ExportView method should return quickly; if an -// Exporter takes a significant amount of time to -// process a Data, that work should be done on another goroutine. -// -// It is safe to assume that ExportView will not be called concurrently from -// multiple goroutines. -// -// The Data should not be modified. -type Exporter interface { - ExportView(viewData *Data) -} - -// RegisterExporter registers an exporter. -// Collected data will be reported via all the -// registered exporters. Once you no longer -// want data to be exported, invoke UnregisterExporter -// with the previously registered exporter. -// -// Binaries can register exporters, libraries shouldn't register exporters. -func RegisterExporter(e Exporter) { - defaultWorker.RegisterExporter(e) -} - -// UnregisterExporter unregisters an exporter. -func UnregisterExporter(e Exporter) { - defaultWorker.UnregisterExporter(e) -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/view.go b/ibm/vendor/go.opencensus.io/stats/view/view.go deleted file mode 100644 index 293b54ecbe..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/view.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -import ( - "bytes" - "errors" - "fmt" - "reflect" - "sort" - "sync/atomic" - "time" - - "go.opencensus.io/metric/metricdata" - "go.opencensus.io/stats" - "go.opencensus.io/tag" -) - -// View allows users to aggregate the recorded stats.Measurements. -// Views need to be passed to the Register function before data will be -// collected and sent to Exporters. -type View struct { - Name string // Name of View. Must be unique. If unset, will default to the name of the Measure. - Description string // Description is a human-readable description for this view. - - // TagKeys are the tag keys describing the grouping of this view. - // A single Row will be produced for each combination of associated tag values. - TagKeys []tag.Key - - // Measure is a stats.Measure to aggregate in this view. - Measure stats.Measure - - // Aggregation is the aggregation function to apply to the set of Measurements. - Aggregation *Aggregation -} - -// WithName returns a copy of the View with a new name. This is useful for -// renaming views to cope with limitations placed on metric names by various -// backends. -func (v *View) WithName(name string) *View { - vNew := *v - vNew.Name = name - return &vNew -} - -// same compares two views and returns true if they represent the same aggregation. -func (v *View) same(other *View) bool { - if v == other { - return true - } - if v == nil { - return false - } - return reflect.DeepEqual(v.Aggregation, other.Aggregation) && - v.Measure.Name() == other.Measure.Name() -} - -// ErrNegativeBucketBounds error returned if histogram contains negative bounds. -// -// Deprecated: this should not be public. -var ErrNegativeBucketBounds = errors.New("negative bucket bounds not supported") - -// canonicalize canonicalizes v by setting explicit -// defaults for Name and Description and sorting the TagKeys -func (v *View) canonicalize() error { - if v.Measure == nil { - return fmt.Errorf("cannot register view %q: measure not set", v.Name) - } - if v.Aggregation == nil { - return fmt.Errorf("cannot register view %q: aggregation not set", v.Name) - } - if v.Name == "" { - v.Name = v.Measure.Name() - } - if v.Description == "" { - v.Description = v.Measure.Description() - } - if err := checkViewName(v.Name); err != nil { - return err - } - sort.Slice(v.TagKeys, func(i, j int) bool { - return v.TagKeys[i].Name() < v.TagKeys[j].Name() - }) - sort.Float64s(v.Aggregation.Buckets) - for _, b := range v.Aggregation.Buckets { - if b < 0 { - return ErrNegativeBucketBounds - } - } - // drop 0 bucket silently. - v.Aggregation.Buckets = dropZeroBounds(v.Aggregation.Buckets...) - - return nil -} - -func dropZeroBounds(bounds ...float64) []float64 { - for i, bound := range bounds { - if bound > 0 { - return bounds[i:] - } - } - return []float64{} -} - -// viewInternal is the internal representation of a View. -type viewInternal struct { - view *View // view is the canonicalized View definition associated with this view. - subscribed uint32 // 1 if someone is subscribed and data need to be exported, use atomic to access - collector *collector - metricDescriptor *metricdata.Descriptor -} - -func newViewInternal(v *View) (*viewInternal, error) { - return &viewInternal{ - view: v, - collector: &collector{make(map[string]AggregationData), v.Aggregation}, - metricDescriptor: viewToMetricDescriptor(v), - }, nil -} - -func (v *viewInternal) subscribe() { - atomic.StoreUint32(&v.subscribed, 1) -} - -func (v *viewInternal) unsubscribe() { - atomic.StoreUint32(&v.subscribed, 0) -} - -// isSubscribed returns true if the view is exporting -// data by subscription. -func (v *viewInternal) isSubscribed() bool { - return atomic.LoadUint32(&v.subscribed) == 1 -} - -func (v *viewInternal) clearRows() { - v.collector.clearRows() -} - -func (v *viewInternal) collectedRows() []*Row { - return v.collector.collectedRows(v.view.TagKeys) -} - -func (v *viewInternal) addSample(m *tag.Map, val float64, attachments map[string]interface{}, t time.Time) { - if !v.isSubscribed() { - return - } - sig := string(encodeWithKeys(m, v.view.TagKeys)) - v.collector.addSample(sig, val, attachments, t) -} - -// A Data is a set of rows about usage of the single measure associated -// with the given view. Each row is specific to a unique set of tags. -type Data struct { - View *View - Start, End time.Time - Rows []*Row -} - -// Row is the collected value for a specific set of key value pairs a.k.a tags. -type Row struct { - Tags []tag.Tag - Data AggregationData -} - -func (r *Row) String() string { - var buffer bytes.Buffer - buffer.WriteString("{ ") - buffer.WriteString("{ ") - for _, t := range r.Tags { - buffer.WriteString(fmt.Sprintf("{%v %v}", t.Key.Name(), t.Value)) - } - buffer.WriteString(" }") - buffer.WriteString(fmt.Sprintf("%v", r.Data)) - buffer.WriteString(" }") - return buffer.String() -} - -// Equal returns true if both rows are equal. Tags are expected to be ordered -// by the key name. Even if both rows have the same tags but the tags appear in -// different orders it will return false. -func (r *Row) Equal(other *Row) bool { - if r == other { - return true - } - return reflect.DeepEqual(r.Tags, other.Tags) && r.Data.equal(other.Data) -} - -const maxNameLength = 255 - -// Returns true if the given string contains only printable characters. -func isPrintable(str string) bool { - for _, r := range str { - if !(r >= ' ' && r <= '~') { - return false - } - } - return true -} - -func checkViewName(name string) error { - if len(name) > maxNameLength { - return fmt.Errorf("view name cannot be larger than %v", maxNameLength) - } - if !isPrintable(name) { - return fmt.Errorf("view name needs to be an ASCII string") - } - return nil -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/view_to_metric.go b/ibm/vendor/go.opencensus.io/stats/view/view_to_metric.go deleted file mode 100644 index 5e1656a1f2..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/view_to_metric.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 view - -import ( - "time" - - "go.opencensus.io/resource" - - "go.opencensus.io/metric/metricdata" - "go.opencensus.io/stats" -) - -func getUnit(unit string) metricdata.Unit { - switch unit { - case "1": - return metricdata.UnitDimensionless - case "ms": - return metricdata.UnitMilliseconds - case "By": - return metricdata.UnitBytes - } - return metricdata.UnitDimensionless -} - -func getType(v *View) metricdata.Type { - m := v.Measure - agg := v.Aggregation - - switch agg.Type { - case AggTypeSum: - switch m.(type) { - case *stats.Int64Measure: - return metricdata.TypeCumulativeInt64 - case *stats.Float64Measure: - return metricdata.TypeCumulativeFloat64 - default: - panic("unexpected measure type") - } - case AggTypeDistribution: - return metricdata.TypeCumulativeDistribution - case AggTypeLastValue: - switch m.(type) { - case *stats.Int64Measure: - return metricdata.TypeGaugeInt64 - case *stats.Float64Measure: - return metricdata.TypeGaugeFloat64 - default: - panic("unexpected measure type") - } - case AggTypeCount: - switch m.(type) { - case *stats.Int64Measure: - return metricdata.TypeCumulativeInt64 - case *stats.Float64Measure: - return metricdata.TypeCumulativeInt64 - default: - panic("unexpected measure type") - } - default: - panic("unexpected aggregation type") - } -} - -func getLabelKeys(v *View) []metricdata.LabelKey { - labelKeys := []metricdata.LabelKey{} - for _, k := range v.TagKeys { - labelKeys = append(labelKeys, metricdata.LabelKey{Key: k.Name()}) - } - return labelKeys -} - -func viewToMetricDescriptor(v *View) *metricdata.Descriptor { - return &metricdata.Descriptor{ - Name: v.Name, - Description: v.Description, - Unit: convertUnit(v), - Type: getType(v), - LabelKeys: getLabelKeys(v), - } -} - -func convertUnit(v *View) metricdata.Unit { - switch v.Aggregation.Type { - case AggTypeCount: - return metricdata.UnitDimensionless - default: - return getUnit(v.Measure.Unit()) - } -} - -func toLabelValues(row *Row, expectedKeys []metricdata.LabelKey) []metricdata.LabelValue { - labelValues := []metricdata.LabelValue{} - tagMap := make(map[string]string) - for _, tag := range row.Tags { - tagMap[tag.Key.Name()] = tag.Value - } - - for _, key := range expectedKeys { - if val, ok := tagMap[key.Key]; ok { - labelValues = append(labelValues, metricdata.NewLabelValue(val)) - } else { - labelValues = append(labelValues, metricdata.LabelValue{}) - } - } - return labelValues -} - -func rowToTimeseries(v *viewInternal, row *Row, now time.Time, startTime time.Time) *metricdata.TimeSeries { - return &metricdata.TimeSeries{ - Points: []metricdata.Point{row.Data.toPoint(v.metricDescriptor.Type, now)}, - LabelValues: toLabelValues(row, v.metricDescriptor.LabelKeys), - StartTime: startTime, - } -} - -func viewToMetric(v *viewInternal, r *resource.Resource, now time.Time, startTime time.Time) *metricdata.Metric { - if v.metricDescriptor.Type == metricdata.TypeGaugeInt64 || - v.metricDescriptor.Type == metricdata.TypeGaugeFloat64 { - startTime = time.Time{} - } - - rows := v.collectedRows() - if len(rows) == 0 { - return nil - } - - ts := []*metricdata.TimeSeries{} - for _, row := range rows { - ts = append(ts, rowToTimeseries(v, row, now, startTime)) - } - - m := &metricdata.Metric{ - Descriptor: *v.metricDescriptor, - TimeSeries: ts, - Resource: r, - } - return m -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/worker.go b/ibm/vendor/go.opencensus.io/stats/view/worker.go deleted file mode 100644 index ab8bfd46d0..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/worker.go +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -import ( - "fmt" - "sync" - "time" - - "go.opencensus.io/resource" - - "go.opencensus.io/metric/metricdata" - "go.opencensus.io/metric/metricproducer" - "go.opencensus.io/stats" - "go.opencensus.io/stats/internal" - "go.opencensus.io/tag" -) - -func init() { - defaultWorker = NewMeter().(*worker) - go defaultWorker.start() - internal.DefaultRecorder = record -} - -type measureRef struct { - measure string - views map[*viewInternal]struct{} -} - -type worker struct { - measures map[string]*measureRef - views map[string]*viewInternal - startTimes map[*viewInternal]time.Time - - timer *time.Ticker - c chan command - quit, done chan bool - mu sync.RWMutex - r *resource.Resource - - exportersMu sync.RWMutex - exporters map[Exporter]struct{} -} - -// Meter defines an interface which allows a single process to maintain -// multiple sets of metrics exports (intended for the advanced case where a -// single process wants to report metrics about multiple objects, such as -// multiple databases or HTTP services). -// -// Note that this is an advanced use case, and the static functions in this -// module should cover the common use cases. -type Meter interface { - stats.Recorder - // Find returns a registered view associated with this name. - // If no registered view is found, nil is returned. - Find(name string) *View - // Register begins collecting data for the given views. - // Once a view is registered, it reports data to the registered exporters. - Register(views ...*View) error - // Unregister the given views. Data will not longer be exported for these views - // after Unregister returns. - // It is not necessary to unregister from views you expect to collect for the - // duration of your program execution. - Unregister(views ...*View) - // SetReportingPeriod sets the interval between reporting aggregated views in - // the program. If duration is less than or equal to zero, it enables the - // default behavior. - // - // Note: each exporter makes different promises about what the lowest supported - // duration is. For example, the Stackdriver exporter recommends a value no - // lower than 1 minute. Consult each exporter per your needs. - SetReportingPeriod(time.Duration) - - // RegisterExporter registers an exporter. - // Collected data will be reported via all the - // registered exporters. Once you no longer - // want data to be exported, invoke UnregisterExporter - // with the previously registered exporter. - // - // Binaries can register exporters, libraries shouldn't register exporters. - RegisterExporter(Exporter) - // UnregisterExporter unregisters an exporter. - UnregisterExporter(Exporter) - // SetResource may be used to set the Resource associated with this registry. - // This is intended to be used in cases where a single process exports metrics - // for multiple Resources, typically in a multi-tenant situation. - SetResource(*resource.Resource) - - // Start causes the Meter to start processing Record calls and aggregating - // statistics as well as exporting data. - Start() - // Stop causes the Meter to stop processing calls and terminate data export. - Stop() - - // RetrieveData gets a snapshot of the data collected for the the view registered - // with the given name. It is intended for testing only. - RetrieveData(viewName string) ([]*Row, error) -} - -var _ Meter = (*worker)(nil) - -var defaultWorker *worker - -var defaultReportingDuration = 10 * time.Second - -// Find returns a registered view associated with this name. -// If no registered view is found, nil is returned. -func Find(name string) (v *View) { - return defaultWorker.Find(name) -} - -// Find returns a registered view associated with this name. -// If no registered view is found, nil is returned. -func (w *worker) Find(name string) (v *View) { - req := &getViewByNameReq{ - name: name, - c: make(chan *getViewByNameResp), - } - w.c <- req - resp := <-req.c - return resp.v -} - -// Register begins collecting data for the given views. -// Once a view is registered, it reports data to the registered exporters. -func Register(views ...*View) error { - return defaultWorker.Register(views...) -} - -// Register begins collecting data for the given views. -// Once a view is registered, it reports data to the registered exporters. -func (w *worker) Register(views ...*View) error { - req := ®isterViewReq{ - views: views, - err: make(chan error), - } - w.c <- req - return <-req.err -} - -// Unregister the given views. Data will not longer be exported for these views -// after Unregister returns. -// It is not necessary to unregister from views you expect to collect for the -// duration of your program execution. -func Unregister(views ...*View) { - defaultWorker.Unregister(views...) -} - -// Unregister the given views. Data will not longer be exported for these views -// after Unregister returns. -// It is not necessary to unregister from views you expect to collect for the -// duration of your program execution. -func (w *worker) Unregister(views ...*View) { - names := make([]string, len(views)) - for i := range views { - names[i] = views[i].Name - } - req := &unregisterFromViewReq{ - views: names, - done: make(chan struct{}), - } - w.c <- req - <-req.done -} - -// RetrieveData gets a snapshot of the data collected for the the view registered -// with the given name. It is intended for testing only. -func RetrieveData(viewName string) ([]*Row, error) { - return defaultWorker.RetrieveData(viewName) -} - -// RetrieveData gets a snapshot of the data collected for the the view registered -// with the given name. It is intended for testing only. -func (w *worker) RetrieveData(viewName string) ([]*Row, error) { - req := &retrieveDataReq{ - now: time.Now(), - v: viewName, - c: make(chan *retrieveDataResp), - } - w.c <- req - resp := <-req.c - return resp.rows, resp.err -} - -func record(tags *tag.Map, ms interface{}, attachments map[string]interface{}) { - defaultWorker.Record(tags, ms, attachments) -} - -// Record records a set of measurements ms associated with the given tags and attachments. -func (w *worker) Record(tags *tag.Map, ms interface{}, attachments map[string]interface{}) { - req := &recordReq{ - tm: tags, - ms: ms.([]stats.Measurement), - attachments: attachments, - t: time.Now(), - } - w.c <- req -} - -// SetReportingPeriod sets the interval between reporting aggregated views in -// the program. If duration is less than or equal to zero, it enables the -// default behavior. -// -// Note: each exporter makes different promises about what the lowest supported -// duration is. For example, the Stackdriver exporter recommends a value no -// lower than 1 minute. Consult each exporter per your needs. -func SetReportingPeriod(d time.Duration) { - defaultWorker.SetReportingPeriod(d) -} - -// SetReportingPeriod sets the interval between reporting aggregated views in -// the program. If duration is less than or equal to zero, it enables the -// default behavior. -// -// Note: each exporter makes different promises about what the lowest supported -// duration is. For example, the Stackdriver exporter recommends a value no -// lower than 1 minute. Consult each exporter per your needs. -func (w *worker) SetReportingPeriod(d time.Duration) { - // TODO(acetechnologist): ensure that the duration d is more than a certain - // value. e.g. 1s - req := &setReportingPeriodReq{ - d: d, - c: make(chan bool), - } - w.c <- req - <-req.c // don't return until the timer is set to the new duration. -} - -// NewMeter constructs a Meter instance. You should only need to use this if -// you need to separate out Measurement recordings and View aggregations within -// a single process. -func NewMeter() Meter { - return &worker{ - measures: make(map[string]*measureRef), - views: make(map[string]*viewInternal), - startTimes: make(map[*viewInternal]time.Time), - timer: time.NewTicker(defaultReportingDuration), - c: make(chan command, 1024), - quit: make(chan bool), - done: make(chan bool), - - exporters: make(map[Exporter]struct{}), - } -} - -// SetResource associates all data collected by this Meter with the specified -// resource. This resource is reported when using metricexport.ReadAndExport; -// it is not provided when used with ExportView/RegisterExporter, because that -// interface does not provide a means for reporting the Resource. -func (w *worker) SetResource(r *resource.Resource) { - w.r = r -} - -func (w *worker) Start() { - go w.start() -} - -func (w *worker) start() { - prodMgr := metricproducer.GlobalManager() - prodMgr.AddProducer(w) - - for { - select { - case cmd := <-w.c: - cmd.handleCommand(w) - case <-w.timer.C: - w.reportUsage() - case <-w.quit: - w.timer.Stop() - close(w.c) - w.done <- true - return - } - } -} - -func (w *worker) Stop() { - prodMgr := metricproducer.GlobalManager() - prodMgr.DeleteProducer(w) - - w.quit <- true - <-w.done -} - -func (w *worker) getMeasureRef(name string) *measureRef { - if mr, ok := w.measures[name]; ok { - return mr - } - mr := &measureRef{ - measure: name, - views: make(map[*viewInternal]struct{}), - } - w.measures[name] = mr - return mr -} - -func (w *worker) tryRegisterView(v *View) (*viewInternal, error) { - w.mu.Lock() - defer w.mu.Unlock() - vi, err := newViewInternal(v) - if err != nil { - return nil, err - } - if x, ok := w.views[vi.view.Name]; ok { - if !x.view.same(vi.view) { - return nil, fmt.Errorf("cannot register view %q; a different view with the same name is already registered", v.Name) - } - - // the view is already registered so there is nothing to do and the - // command is considered successful. - return x, nil - } - w.views[vi.view.Name] = vi - w.startTimes[vi] = time.Now() - ref := w.getMeasureRef(vi.view.Measure.Name()) - ref.views[vi] = struct{}{} - return vi, nil -} - -func (w *worker) unregisterView(v *viewInternal) { - w.mu.Lock() - defer w.mu.Unlock() - delete(w.views, v.view.Name) - delete(w.startTimes, v) - if measure := w.measures[v.view.Measure.Name()]; measure != nil { - delete(measure.views, v) - } -} - -func (w *worker) reportView(v *viewInternal) { - if !v.isSubscribed() { - return - } - rows := v.collectedRows() - viewData := &Data{ - View: v.view, - Start: w.startTimes[v], - End: time.Now(), - Rows: rows, - } - w.exportersMu.Lock() - defer w.exportersMu.Unlock() - for e := range w.exporters { - e.ExportView(viewData) - } -} - -func (w *worker) reportUsage() { - w.mu.Lock() - defer w.mu.Unlock() - for _, v := range w.views { - w.reportView(v) - } -} - -func (w *worker) toMetric(v *viewInternal, now time.Time) *metricdata.Metric { - if !v.isSubscribed() { - return nil - } - - var startTime time.Time - if v.metricDescriptor.Type == metricdata.TypeGaugeInt64 || - v.metricDescriptor.Type == metricdata.TypeGaugeFloat64 { - startTime = time.Time{} - } else { - startTime = w.startTimes[v] - } - - return viewToMetric(v, w.r, now, startTime) -} - -// Read reads all view data and returns them as metrics. -// It is typically invoked by metric reader to export stats in metric format. -func (w *worker) Read() []*metricdata.Metric { - w.mu.Lock() - defer w.mu.Unlock() - now := time.Now() - metrics := make([]*metricdata.Metric, 0, len(w.views)) - for _, v := range w.views { - metric := w.toMetric(v, now) - if metric != nil { - metrics = append(metrics, metric) - } - } - return metrics -} - -func (w *worker) RegisterExporter(e Exporter) { - w.exportersMu.Lock() - defer w.exportersMu.Unlock() - - w.exporters[e] = struct{}{} -} - -func (w *worker) UnregisterExporter(e Exporter) { - w.exportersMu.Lock() - defer w.exportersMu.Unlock() - - delete(w.exporters, e) -} diff --git a/ibm/vendor/go.opencensus.io/stats/view/worker_commands.go b/ibm/vendor/go.opencensus.io/stats/view/worker_commands.go deleted file mode 100644 index 9ac4cc0599..0000000000 --- a/ibm/vendor/go.opencensus.io/stats/view/worker_commands.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 view - -import ( - "errors" - "fmt" - "strings" - "time" - - "go.opencensus.io/stats" - "go.opencensus.io/stats/internal" - "go.opencensus.io/tag" -) - -type command interface { - handleCommand(w *worker) -} - -// getViewByNameReq is the command to get a view given its name. -type getViewByNameReq struct { - name string - c chan *getViewByNameResp -} - -type getViewByNameResp struct { - v *View -} - -func (cmd *getViewByNameReq) handleCommand(w *worker) { - v := w.views[cmd.name] - if v == nil { - cmd.c <- &getViewByNameResp{nil} - return - } - cmd.c <- &getViewByNameResp{v.view} -} - -// registerViewReq is the command to register a view. -type registerViewReq struct { - views []*View - err chan error -} - -func (cmd *registerViewReq) handleCommand(w *worker) { - for _, v := range cmd.views { - if err := v.canonicalize(); err != nil { - cmd.err <- err - return - } - } - var errstr []string - for _, view := range cmd.views { - vi, err := w.tryRegisterView(view) - if err != nil { - errstr = append(errstr, fmt.Sprintf("%s: %v", view.Name, err)) - continue - } - internal.SubscriptionReporter(view.Measure.Name()) - vi.subscribe() - } - if len(errstr) > 0 { - cmd.err <- errors.New(strings.Join(errstr, "\n")) - } else { - cmd.err <- nil - } -} - -// unregisterFromViewReq is the command to unregister to a view. Has no -// impact on the data collection for client that are pulling data from the -// library. -type unregisterFromViewReq struct { - views []string - done chan struct{} -} - -func (cmd *unregisterFromViewReq) handleCommand(w *worker) { - for _, name := range cmd.views { - vi, ok := w.views[name] - if !ok { - continue - } - - // Report pending data for this view before removing it. - w.reportView(vi) - - vi.unsubscribe() - if !vi.isSubscribed() { - // this was the last subscription and view is not collecting anymore. - // The collected data can be cleared. - vi.clearRows() - } - w.unregisterView(vi) - } - cmd.done <- struct{}{} -} - -// retrieveDataReq is the command to retrieve data for a view. -type retrieveDataReq struct { - now time.Time - v string - c chan *retrieveDataResp -} - -type retrieveDataResp struct { - rows []*Row - err error -} - -func (cmd *retrieveDataReq) handleCommand(w *worker) { - w.mu.Lock() - defer w.mu.Unlock() - vi, ok := w.views[cmd.v] - if !ok { - cmd.c <- &retrieveDataResp{ - nil, - fmt.Errorf("cannot retrieve data; view %q is not registered", cmd.v), - } - return - } - - if !vi.isSubscribed() { - cmd.c <- &retrieveDataResp{ - nil, - fmt.Errorf("cannot retrieve data; view %q has no subscriptions or collection is not forcibly started", cmd.v), - } - return - } - cmd.c <- &retrieveDataResp{ - vi.collectedRows(), - nil, - } -} - -// recordReq is the command to record data related to multiple measures -// at once. -type recordReq struct { - tm *tag.Map - ms []stats.Measurement - attachments map[string]interface{} - t time.Time -} - -func (cmd *recordReq) handleCommand(w *worker) { - w.mu.Lock() - defer w.mu.Unlock() - for _, m := range cmd.ms { - if (m == stats.Measurement{}) { // not registered - continue - } - ref := w.getMeasureRef(m.Measure().Name()) - for v := range ref.views { - v.addSample(cmd.tm, m.Value(), cmd.attachments, cmd.t) - } - } -} - -// setReportingPeriodReq is the command to modify the duration between -// reporting the collected data to the registered clients. -type setReportingPeriodReq struct { - d time.Duration - c chan bool -} - -func (cmd *setReportingPeriodReq) handleCommand(w *worker) { - w.timer.Stop() - if cmd.d <= 0 { - w.timer = time.NewTicker(defaultReportingDuration) - } else { - w.timer = time.NewTicker(cmd.d) - } - cmd.c <- true -} diff --git a/ibm/vendor/go.opencensus.io/tag/context.go b/ibm/vendor/go.opencensus.io/tag/context.go deleted file mode 100644 index b27d1b26b1..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/context.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tag - -import ( - "context" -) - -// FromContext returns the tag map stored in the context. -func FromContext(ctx context.Context) *Map { - // The returned tag map shouldn't be mutated. - ts := ctx.Value(mapCtxKey) - if ts == nil { - return nil - } - return ts.(*Map) -} - -// NewContext creates a new context with the given tag map. -// To propagate a tag map to downstream methods and downstream RPCs, add a tag map -// to the current context. NewContext will return a copy of the current context, -// and put the tag map into the returned one. -// If there is already a tag map in the current context, it will be replaced with m. -func NewContext(ctx context.Context, m *Map) context.Context { - return context.WithValue(ctx, mapCtxKey, m) -} - -type ctxKey struct{} - -var mapCtxKey = ctxKey{} diff --git a/ibm/vendor/go.opencensus.io/tag/doc.go b/ibm/vendor/go.opencensus.io/tag/doc.go deleted file mode 100644 index da16b74e4d..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tag contains OpenCensus tags. - -Tags are key-value pairs. Tags provide additional cardinality to -the OpenCensus instrumentation data. - -Tags can be propagated on the wire and in the same -process via context.Context. Encode and Decode should be -used to represent tags into their binary propagation form. -*/ -package tag // import "go.opencensus.io/tag" diff --git a/ibm/vendor/go.opencensus.io/tag/key.go b/ibm/vendor/go.opencensus.io/tag/key.go deleted file mode 100644 index 71ec913657..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/key.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tag - -// Key represents a tag key. -type Key struct { - name string -} - -// NewKey creates or retrieves a string key identified by name. -// Calling NewKey more than once with the same name returns the same key. -func NewKey(name string) (Key, error) { - if !checkKeyName(name) { - return Key{}, errInvalidKeyName - } - return Key{name: name}, nil -} - -// MustNewKey returns a key with the given name, and panics if name is an invalid key name. -func MustNewKey(name string) Key { - k, err := NewKey(name) - if err != nil { - panic(err) - } - return k -} - -// Name returns the name of the key. -func (k Key) Name() string { - return k.name -} diff --git a/ibm/vendor/go.opencensus.io/tag/map.go b/ibm/vendor/go.opencensus.io/tag/map.go deleted file mode 100644 index 0272ef85a4..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/map.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tag - -import ( - "bytes" - "context" - "fmt" - "sort" -) - -// Tag is a key value pair that can be propagated on wire. -type Tag struct { - Key Key - Value string -} - -type tagContent struct { - value string - m metadatas -} - -// Map is a map of tags. Use New to create a context containing -// a new Map. -type Map struct { - m map[Key]tagContent -} - -// Value returns the value for the key if a value for the key exists. -func (m *Map) Value(k Key) (string, bool) { - if m == nil { - return "", false - } - v, ok := m.m[k] - return v.value, ok -} - -func (m *Map) String() string { - if m == nil { - return "nil" - } - keys := make([]Key, 0, len(m.m)) - for k := range m.m { - keys = append(keys, k) - } - sort.Slice(keys, func(i, j int) bool { return keys[i].Name() < keys[j].Name() }) - - var buffer bytes.Buffer - buffer.WriteString("{ ") - for _, k := range keys { - buffer.WriteString(fmt.Sprintf("{%v %v}", k.name, m.m[k])) - } - buffer.WriteString(" }") - return buffer.String() -} - -func (m *Map) insert(k Key, v string, md metadatas) { - if _, ok := m.m[k]; ok { - return - } - m.m[k] = tagContent{value: v, m: md} -} - -func (m *Map) update(k Key, v string, md metadatas) { - if _, ok := m.m[k]; ok { - m.m[k] = tagContent{value: v, m: md} - } -} - -func (m *Map) upsert(k Key, v string, md metadatas) { - m.m[k] = tagContent{value: v, m: md} -} - -func (m *Map) delete(k Key) { - delete(m.m, k) -} - -func newMap() *Map { - return &Map{m: make(map[Key]tagContent)} -} - -// Mutator modifies a tag map. -type Mutator interface { - Mutate(t *Map) (*Map, error) -} - -// Insert returns a mutator that inserts a -// value associated with k. If k already exists in the tag map, -// mutator doesn't update the value. -// Metadata applies metadata to the tag. It is optional. -// Metadatas are applied in the order in which it is provided. -// If more than one metadata updates the same attribute then -// the update from the last metadata prevails. -func Insert(k Key, v string, mds ...Metadata) Mutator { - return &mutator{ - fn: func(m *Map) (*Map, error) { - if !checkValue(v) { - return nil, errInvalidValue - } - m.insert(k, v, createMetadatas(mds...)) - return m, nil - }, - } -} - -// Update returns a mutator that updates the -// value of the tag associated with k with v. If k doesn't -// exists in the tag map, the mutator doesn't insert the value. -// Metadata applies metadata to the tag. It is optional. -// Metadatas are applied in the order in which it is provided. -// If more than one metadata updates the same attribute then -// the update from the last metadata prevails. -func Update(k Key, v string, mds ...Metadata) Mutator { - return &mutator{ - fn: func(m *Map) (*Map, error) { - if !checkValue(v) { - return nil, errInvalidValue - } - m.update(k, v, createMetadatas(mds...)) - return m, nil - }, - } -} - -// Upsert returns a mutator that upserts the -// value of the tag associated with k with v. It inserts the -// value if k doesn't exist already. It mutates the value -// if k already exists. -// Metadata applies metadata to the tag. It is optional. -// Metadatas are applied in the order in which it is provided. -// If more than one metadata updates the same attribute then -// the update from the last metadata prevails. -func Upsert(k Key, v string, mds ...Metadata) Mutator { - return &mutator{ - fn: func(m *Map) (*Map, error) { - if !checkValue(v) { - return nil, errInvalidValue - } - m.upsert(k, v, createMetadatas(mds...)) - return m, nil - }, - } -} - -func createMetadatas(mds ...Metadata) metadatas { - var metas metadatas - if len(mds) > 0 { - for _, md := range mds { - if md != nil { - md(&metas) - } - } - } else { - WithTTL(TTLUnlimitedPropagation)(&metas) - } - return metas - -} - -// Delete returns a mutator that deletes -// the value associated with k. -func Delete(k Key) Mutator { - return &mutator{ - fn: func(m *Map) (*Map, error) { - m.delete(k) - return m, nil - }, - } -} - -// New returns a new context that contains a tag map -// originated from the incoming context and modified -// with the provided mutators. -func New(ctx context.Context, mutator ...Mutator) (context.Context, error) { - m := newMap() - orig := FromContext(ctx) - if orig != nil { - for k, v := range orig.m { - if !checkKeyName(k.Name()) { - return ctx, fmt.Errorf("key:%q: %v", k, errInvalidKeyName) - } - if !checkValue(v.value) { - return ctx, fmt.Errorf("key:%q value:%q: %v", k.Name(), v, errInvalidValue) - } - m.insert(k, v.value, v.m) - } - } - var err error - for _, mod := range mutator { - m, err = mod.Mutate(m) - if err != nil { - return ctx, err - } - } - return NewContext(ctx, m), nil -} - -// Do is similar to pprof.Do: a convenience for installing the tags -// from the context as Go profiler labels. This allows you to -// correlated runtime profiling with stats. -// -// It converts the key/values from the given map to Go profiler labels -// and calls pprof.Do. -// -// Do is going to do nothing if your Go version is below 1.9. -func Do(ctx context.Context, f func(ctx context.Context)) { - do(ctx, f) -} - -type mutator struct { - fn func(t *Map) (*Map, error) -} - -func (m *mutator) Mutate(t *Map) (*Map, error) { - return m.fn(t) -} diff --git a/ibm/vendor/go.opencensus.io/tag/map_codec.go b/ibm/vendor/go.opencensus.io/tag/map_codec.go deleted file mode 100644 index c242e695c8..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/map_codec.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tag - -import ( - "encoding/binary" - "fmt" -) - -// KeyType defines the types of keys allowed. Currently only keyTypeString is -// supported. -type keyType byte - -const ( - keyTypeString keyType = iota - keyTypeInt64 - keyTypeTrue - keyTypeFalse - - tagsVersionID = byte(0) -) - -type encoderGRPC struct { - buf []byte - writeIdx, readIdx int -} - -// writeKeyString writes the fieldID '0' followed by the key string and value -// string. -func (eg *encoderGRPC) writeTagString(k, v string) { - eg.writeByte(byte(keyTypeString)) - eg.writeStringWithVarintLen(k) - eg.writeStringWithVarintLen(v) -} - -func (eg *encoderGRPC) writeTagUint64(k string, i uint64) { - eg.writeByte(byte(keyTypeInt64)) - eg.writeStringWithVarintLen(k) - eg.writeUint64(i) -} - -func (eg *encoderGRPC) writeTagTrue(k string) { - eg.writeByte(byte(keyTypeTrue)) - eg.writeStringWithVarintLen(k) -} - -func (eg *encoderGRPC) writeTagFalse(k string) { - eg.writeByte(byte(keyTypeFalse)) - eg.writeStringWithVarintLen(k) -} - -func (eg *encoderGRPC) writeBytesWithVarintLen(bytes []byte) { - length := len(bytes) - - eg.growIfRequired(binary.MaxVarintLen64 + length) - eg.writeIdx += binary.PutUvarint(eg.buf[eg.writeIdx:], uint64(length)) - copy(eg.buf[eg.writeIdx:], bytes) - eg.writeIdx += length -} - -func (eg *encoderGRPC) writeStringWithVarintLen(s string) { - length := len(s) - - eg.growIfRequired(binary.MaxVarintLen64 + length) - eg.writeIdx += binary.PutUvarint(eg.buf[eg.writeIdx:], uint64(length)) - copy(eg.buf[eg.writeIdx:], s) - eg.writeIdx += length -} - -func (eg *encoderGRPC) writeByte(v byte) { - eg.growIfRequired(1) - eg.buf[eg.writeIdx] = v - eg.writeIdx++ -} - -func (eg *encoderGRPC) writeUint32(i uint32) { - eg.growIfRequired(4) - binary.LittleEndian.PutUint32(eg.buf[eg.writeIdx:], i) - eg.writeIdx += 4 -} - -func (eg *encoderGRPC) writeUint64(i uint64) { - eg.growIfRequired(8) - binary.LittleEndian.PutUint64(eg.buf[eg.writeIdx:], i) - eg.writeIdx += 8 -} - -func (eg *encoderGRPC) readByte() byte { - b := eg.buf[eg.readIdx] - eg.readIdx++ - return b -} - -func (eg *encoderGRPC) readUint32() uint32 { - i := binary.LittleEndian.Uint32(eg.buf[eg.readIdx:]) - eg.readIdx += 4 - return i -} - -func (eg *encoderGRPC) readUint64() uint64 { - i := binary.LittleEndian.Uint64(eg.buf[eg.readIdx:]) - eg.readIdx += 8 - return i -} - -func (eg *encoderGRPC) readBytesWithVarintLen() ([]byte, error) { - if eg.readEnded() { - return nil, fmt.Errorf("unexpected end while readBytesWithVarintLen '%x' starting at idx '%v'", eg.buf, eg.readIdx) - } - length, valueStart := binary.Uvarint(eg.buf[eg.readIdx:]) - if valueStart <= 0 { - return nil, fmt.Errorf("unexpected end while readBytesWithVarintLen '%x' starting at idx '%v'", eg.buf, eg.readIdx) - } - - valueStart += eg.readIdx - valueEnd := valueStart + int(length) - if valueEnd > len(eg.buf) { - return nil, fmt.Errorf("malformed encoding: length:%v, upper:%v, maxLength:%v", length, valueEnd, len(eg.buf)) - } - - eg.readIdx = valueEnd - return eg.buf[valueStart:valueEnd], nil -} - -func (eg *encoderGRPC) readStringWithVarintLen() (string, error) { - bytes, err := eg.readBytesWithVarintLen() - if err != nil { - return "", err - } - return string(bytes), nil -} - -func (eg *encoderGRPC) growIfRequired(expected int) { - if len(eg.buf)-eg.writeIdx < expected { - tmp := make([]byte, 2*(len(eg.buf)+1)+expected) - copy(tmp, eg.buf) - eg.buf = tmp - } -} - -func (eg *encoderGRPC) readEnded() bool { - return eg.readIdx >= len(eg.buf) -} - -func (eg *encoderGRPC) bytes() []byte { - return eg.buf[:eg.writeIdx] -} - -// Encode encodes the tag map into a []byte. It is useful to propagate -// the tag maps on wire in binary format. -func Encode(m *Map) []byte { - if m == nil { - return nil - } - eg := &encoderGRPC{ - buf: make([]byte, len(m.m)), - } - eg.writeByte(tagsVersionID) - for k, v := range m.m { - if v.m.ttl.ttl == valueTTLUnlimitedPropagation { - eg.writeByte(byte(keyTypeString)) - eg.writeStringWithVarintLen(k.name) - eg.writeBytesWithVarintLen([]byte(v.value)) - } - } - return eg.bytes() -} - -// Decode decodes the given []byte into a tag map. -func Decode(bytes []byte) (*Map, error) { - ts := newMap() - err := DecodeEach(bytes, ts.upsert) - if err != nil { - // no partial failures - return nil, err - } - return ts, nil -} - -// DecodeEach decodes the given serialized tag map, calling handler for each -// tag key and value decoded. -func DecodeEach(bytes []byte, fn func(key Key, val string, md metadatas)) error { - eg := &encoderGRPC{ - buf: bytes, - } - if len(eg.buf) == 0 { - return nil - } - - version := eg.readByte() - if version > tagsVersionID { - return fmt.Errorf("cannot decode: unsupported version: %q; supports only up to: %q", version, tagsVersionID) - } - - for !eg.readEnded() { - typ := keyType(eg.readByte()) - - if typ != keyTypeString { - return fmt.Errorf("cannot decode: invalid key type: %q", typ) - } - - k, err := eg.readBytesWithVarintLen() - if err != nil { - return err - } - - v, err := eg.readBytesWithVarintLen() - if err != nil { - return err - } - - key, err := NewKey(string(k)) - if err != nil { - return err - } - val := string(v) - if !checkValue(val) { - return errInvalidValue - } - fn(key, val, createMetadatas(WithTTL(TTLUnlimitedPropagation))) - if err != nil { - return err - } - } - return nil -} diff --git a/ibm/vendor/go.opencensus.io/tag/metadata.go b/ibm/vendor/go.opencensus.io/tag/metadata.go deleted file mode 100644 index 6571a583ea..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/metadata.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 tag - -const ( - // valueTTLNoPropagation prevents tag from propagating. - valueTTLNoPropagation = 0 - - // valueTTLUnlimitedPropagation allows tag to propagate without any limits on number of hops. - valueTTLUnlimitedPropagation = -1 -) - -// TTL is metadata that specifies number of hops a tag can propagate. -// Details about TTL metadata is specified at https://github.com/census-instrumentation/opencensus-specs/blob/master/tags/TagMap.md#tagmetadata -type TTL struct { - ttl int -} - -var ( - // TTLUnlimitedPropagation is TTL metadata that allows tag to propagate without any limits on number of hops. - TTLUnlimitedPropagation = TTL{ttl: valueTTLUnlimitedPropagation} - - // TTLNoPropagation is TTL metadata that prevents tag from propagating. - TTLNoPropagation = TTL{ttl: valueTTLNoPropagation} -) - -type metadatas struct { - ttl TTL -} - -// Metadata applies metadatas specified by the function. -type Metadata func(*metadatas) - -// WithTTL applies metadata with provided ttl. -func WithTTL(ttl TTL) Metadata { - return func(m *metadatas) { - m.ttl = ttl - } -} diff --git a/ibm/vendor/go.opencensus.io/tag/profile_19.go b/ibm/vendor/go.opencensus.io/tag/profile_19.go deleted file mode 100644 index b34d95e34a..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/profile_19.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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. - -// +build go1.9 - -package tag - -import ( - "context" - "runtime/pprof" -) - -func do(ctx context.Context, f func(ctx context.Context)) { - m := FromContext(ctx) - keyvals := make([]string, 0, 2*len(m.m)) - for k, v := range m.m { - keyvals = append(keyvals, k.Name(), v.value) - } - pprof.Do(ctx, pprof.Labels(keyvals...), f) -} diff --git a/ibm/vendor/go.opencensus.io/tag/profile_not19.go b/ibm/vendor/go.opencensus.io/tag/profile_not19.go deleted file mode 100644 index 83adbce56b..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/profile_not19.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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. - -// +build !go1.9 - -package tag - -import "context" - -func do(ctx context.Context, f func(ctx context.Context)) { - f(ctx) -} diff --git a/ibm/vendor/go.opencensus.io/tag/validate.go b/ibm/vendor/go.opencensus.io/tag/validate.go deleted file mode 100644 index 0939fc6748..0000000000 --- a/ibm/vendor/go.opencensus.io/tag/validate.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 tag - -import "errors" - -const ( - maxKeyLength = 255 - - // valid are restricted to US-ASCII subset (range 0x20 (' ') to 0x7e ('~')). - validKeyValueMin = 32 - validKeyValueMax = 126 -) - -var ( - errInvalidKeyName = errors.New("invalid key name: only ASCII characters accepted; max length must be 255 characters") - errInvalidValue = errors.New("invalid value: only ASCII characters accepted; max length must be 255 characters") -) - -func checkKeyName(name string) bool { - if len(name) == 0 { - return false - } - if len(name) > maxKeyLength { - return false - } - return isASCII(name) -} - -func isASCII(s string) bool { - for _, c := range s { - if (c < validKeyValueMin) || (c > validKeyValueMax) { - return false - } - } - return true -} - -func checkValue(v string) bool { - if len(v) > maxKeyLength { - return false - } - return isASCII(v) -} diff --git a/ibm/vendor/go.opencensus.io/trace/basetypes.go b/ibm/vendor/go.opencensus.io/trace/basetypes.go deleted file mode 100644 index 0c54492a2b..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/basetypes.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace - -import ( - "fmt" - "time" -) - -type ( - // TraceID is a 16-byte identifier for a set of spans. - TraceID [16]byte - - // SpanID is an 8-byte identifier for a single span. - SpanID [8]byte -) - -func (t TraceID) String() string { - return fmt.Sprintf("%02x", t[:]) -} - -func (s SpanID) String() string { - return fmt.Sprintf("%02x", s[:]) -} - -// Annotation represents a text annotation with a set of attributes and a timestamp. -type Annotation struct { - Time time.Time - Message string - Attributes map[string]interface{} -} - -// Attribute represents a key-value pair on a span, link or annotation. -// Construct with one of: BoolAttribute, Int64Attribute, or StringAttribute. -type Attribute struct { - key string - value interface{} -} - -// BoolAttribute returns a bool-valued attribute. -func BoolAttribute(key string, value bool) Attribute { - return Attribute{key: key, value: value} -} - -// Int64Attribute returns an int64-valued attribute. -func Int64Attribute(key string, value int64) Attribute { - return Attribute{key: key, value: value} -} - -// Float64Attribute returns a float64-valued attribute. -func Float64Attribute(key string, value float64) Attribute { - return Attribute{key: key, value: value} -} - -// StringAttribute returns a string-valued attribute. -func StringAttribute(key string, value string) Attribute { - return Attribute{key: key, value: value} -} - -// LinkType specifies the relationship between the span that had the link -// added, and the linked span. -type LinkType int32 - -// LinkType values. -const ( - LinkTypeUnspecified LinkType = iota // The relationship of the two spans is unknown. - LinkTypeChild // The linked span is a child of the current span. - LinkTypeParent // The linked span is the parent of the current span. -) - -// Link represents a reference from one span to another span. -type Link struct { - TraceID TraceID - SpanID SpanID - Type LinkType - // Attributes is a set of attributes on the link. - Attributes map[string]interface{} -} - -// MessageEventType specifies the type of message event. -type MessageEventType int32 - -// MessageEventType values. -const ( - MessageEventTypeUnspecified MessageEventType = iota // Unknown event type. - MessageEventTypeSent // Indicates a sent RPC message. - MessageEventTypeRecv // Indicates a received RPC message. -) - -// MessageEvent represents an event describing a message sent or received on the network. -type MessageEvent struct { - Time time.Time - EventType MessageEventType - MessageID int64 - UncompressedByteSize int64 - CompressedByteSize int64 -} - -// Status is the status of a Span. -type Status struct { - // Code is a status code. Zero indicates success. - // - // If Code will be propagated to Google APIs, it ideally should be a value from - // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto . - Code int32 - Message string -} diff --git a/ibm/vendor/go.opencensus.io/trace/config.go b/ibm/vendor/go.opencensus.io/trace/config.go deleted file mode 100644 index 775f8274fa..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/config.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 trace - -import ( - "sync" - - "go.opencensus.io/trace/internal" -) - -// Config represents the global tracing configuration. -type Config struct { - // DefaultSampler is the default sampler used when creating new spans. - DefaultSampler Sampler - - // IDGenerator is for internal use only. - IDGenerator internal.IDGenerator - - // MaxAnnotationEventsPerSpan is max number of annotation events per span - MaxAnnotationEventsPerSpan int - - // MaxMessageEventsPerSpan is max number of message events per span - MaxMessageEventsPerSpan int - - // MaxAnnotationEventsPerSpan is max number of attributes per span - MaxAttributesPerSpan int - - // MaxLinksPerSpan is max number of links per span - MaxLinksPerSpan int -} - -var configWriteMu sync.Mutex - -const ( - // DefaultMaxAnnotationEventsPerSpan is default max number of annotation events per span - DefaultMaxAnnotationEventsPerSpan = 32 - - // DefaultMaxMessageEventsPerSpan is default max number of message events per span - DefaultMaxMessageEventsPerSpan = 128 - - // DefaultMaxAttributesPerSpan is default max number of attributes per span - DefaultMaxAttributesPerSpan = 32 - - // DefaultMaxLinksPerSpan is default max number of links per span - DefaultMaxLinksPerSpan = 32 -) - -// ApplyConfig applies changes to the global tracing configuration. -// -// Fields not provided in the given config are going to be preserved. -func ApplyConfig(cfg Config) { - configWriteMu.Lock() - defer configWriteMu.Unlock() - c := *config.Load().(*Config) - if cfg.DefaultSampler != nil { - c.DefaultSampler = cfg.DefaultSampler - } - if cfg.IDGenerator != nil { - c.IDGenerator = cfg.IDGenerator - } - if cfg.MaxAnnotationEventsPerSpan > 0 { - c.MaxAnnotationEventsPerSpan = cfg.MaxAnnotationEventsPerSpan - } - if cfg.MaxMessageEventsPerSpan > 0 { - c.MaxMessageEventsPerSpan = cfg.MaxMessageEventsPerSpan - } - if cfg.MaxAttributesPerSpan > 0 { - c.MaxAttributesPerSpan = cfg.MaxAttributesPerSpan - } - if cfg.MaxLinksPerSpan > 0 { - c.MaxLinksPerSpan = cfg.MaxLinksPerSpan - } - config.Store(&c) -} diff --git a/ibm/vendor/go.opencensus.io/trace/doc.go b/ibm/vendor/go.opencensus.io/trace/doc.go deleted file mode 100644 index 04b1ee4f38..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/doc.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace contains support for OpenCensus distributed tracing. - -The following assumes a basic familiarity with OpenCensus concepts. -See http://opencensus.io - - -Exporting Traces - -To export collected tracing data, register at least one exporter. You can use -one of the provided exporters or write your own. - - trace.RegisterExporter(exporter) - -By default, traces will be sampled relatively rarely. To change the sampling -frequency for your entire program, call ApplyConfig. Use a ProbabilitySampler -to sample a subset of traces, or use AlwaysSample to collect a trace on every run: - - trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()}) - -Be careful about using trace.AlwaysSample in a production application with -significant traffic: a new trace will be started and exported for every request. - -Adding Spans to a Trace - -A trace consists of a tree of spans. In Go, the current span is carried in a -context.Context. - -It is common to want to capture all the activity of a function call in a span. For -this to work, the function must take a context.Context as a parameter. Add these two -lines to the top of the function: - - ctx, span := trace.StartSpan(ctx, "example.com/Run") - defer span.End() - -StartSpan will create a new top-level span if the context -doesn't contain another span, otherwise it will create a child span. -*/ -package trace // import "go.opencensus.io/trace" diff --git a/ibm/vendor/go.opencensus.io/trace/evictedqueue.go b/ibm/vendor/go.opencensus.io/trace/evictedqueue.go deleted file mode 100644 index ffc264f23d..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/evictedqueue.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 trace - -type evictedQueue struct { - queue []interface{} - capacity int - droppedCount int -} - -func newEvictedQueue(capacity int) *evictedQueue { - eq := &evictedQueue{ - capacity: capacity, - queue: make([]interface{}, 0), - } - - return eq -} - -func (eq *evictedQueue) add(value interface{}) { - if len(eq.queue) == eq.capacity { - eq.queue = eq.queue[1:] - eq.droppedCount++ - } - eq.queue = append(eq.queue, value) -} diff --git a/ibm/vendor/go.opencensus.io/trace/export.go b/ibm/vendor/go.opencensus.io/trace/export.go deleted file mode 100644 index e0d9a4b99e..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/export.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace - -import ( - "sync" - "sync/atomic" - "time" -) - -// Exporter is a type for functions that receive sampled trace spans. -// -// The ExportSpan method should be safe for concurrent use and should return -// quickly; if an Exporter takes a significant amount of time to process a -// SpanData, that work should be done on another goroutine. -// -// The SpanData should not be modified, but a pointer to it can be kept. -type Exporter interface { - ExportSpan(s *SpanData) -} - -type exportersMap map[Exporter]struct{} - -var ( - exporterMu sync.Mutex - exporters atomic.Value -) - -// RegisterExporter adds to the list of Exporters that will receive sampled -// trace spans. -// -// Binaries can register exporters, libraries shouldn't register exporters. -func RegisterExporter(e Exporter) { - exporterMu.Lock() - new := make(exportersMap) - if old, ok := exporters.Load().(exportersMap); ok { - for k, v := range old { - new[k] = v - } - } - new[e] = struct{}{} - exporters.Store(new) - exporterMu.Unlock() -} - -// UnregisterExporter removes from the list of Exporters the Exporter that was -// registered with the given name. -func UnregisterExporter(e Exporter) { - exporterMu.Lock() - new := make(exportersMap) - if old, ok := exporters.Load().(exportersMap); ok { - for k, v := range old { - new[k] = v - } - } - delete(new, e) - exporters.Store(new) - exporterMu.Unlock() -} - -// SpanData contains all the information collected by a Span. -type SpanData struct { - SpanContext - ParentSpanID SpanID - SpanKind int - Name string - StartTime time.Time - // The wall clock time of EndTime will be adjusted to always be offset - // from StartTime by the duration of the span. - EndTime time.Time - // The values of Attributes each have type string, bool, or int64. - Attributes map[string]interface{} - Annotations []Annotation - MessageEvents []MessageEvent - Status - Links []Link - HasRemoteParent bool - DroppedAttributeCount int - DroppedAnnotationCount int - DroppedMessageEventCount int - DroppedLinkCount int - - // ChildSpanCount holds the number of child span created for this span. - ChildSpanCount int -} diff --git a/ibm/vendor/go.opencensus.io/trace/internal/internal.go b/ibm/vendor/go.opencensus.io/trace/internal/internal.go deleted file mode 100644 index 7e808d8f30..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/internal/internal.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 internal provides trace internals. -package internal - -// IDGenerator allows custom generators for TraceId and SpanId. -type IDGenerator interface { - NewTraceID() [16]byte - NewSpanID() [8]byte -} diff --git a/ibm/vendor/go.opencensus.io/trace/lrumap.go b/ibm/vendor/go.opencensus.io/trace/lrumap.go deleted file mode 100644 index 908c2497ed..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/lrumap.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// 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 trace - -import ( - "github.com/golang/groupcache/lru" -) - -// A simple lru.Cache wrapper that tracks the keys of the current contents and -// the cumulative number of evicted items. -type lruMap struct { - cacheKeys map[lru.Key]bool - cache *lru.Cache - droppedCount int -} - -func newLruMap(size int) *lruMap { - lm := &lruMap{ - cacheKeys: make(map[lru.Key]bool), - cache: lru.New(size), - droppedCount: 0, - } - lm.cache.OnEvicted = func(key lru.Key, value interface{}) { - delete(lm.cacheKeys, key) - lm.droppedCount++ - } - return lm -} - -func (lm lruMap) len() int { - return lm.cache.Len() -} - -func (lm lruMap) keys() []interface{} { - keys := make([]interface{}, len(lm.cacheKeys)) - for k := range lm.cacheKeys { - keys = append(keys, k) - } - return keys -} - -func (lm *lruMap) add(key, value interface{}) { - lm.cacheKeys[lru.Key(key)] = true - lm.cache.Add(lru.Key(key), value) -} - -func (lm *lruMap) get(key interface{}) (interface{}, bool) { - return lm.cache.Get(key) -} diff --git a/ibm/vendor/go.opencensus.io/trace/propagation/propagation.go b/ibm/vendor/go.opencensus.io/trace/propagation/propagation.go deleted file mode 100644 index 1eb190a96a..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/propagation/propagation.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 propagation implements the binary trace context format. -package propagation // import "go.opencensus.io/trace/propagation" - -// TODO: link to external spec document. - -// BinaryFormat format: -// -// Binary value: -// version_id: 1 byte representing the version id. -// -// For version_id = 0: -// -// version_format: -// field_format: -// -// Fields: -// -// TraceId: (field_id = 0, len = 16, default = "0000000000000000") - 16-byte array representing the trace_id. -// SpanId: (field_id = 1, len = 8, default = "00000000") - 8-byte array representing the span_id. -// TraceOptions: (field_id = 2, len = 1, default = "0") - 1-byte array representing the trace_options. -// -// Fields MUST be encoded using the field id order (smaller to higher). -// -// Valid value example: -// -// {0, 0, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 1, 97, -// 98, 99, 100, 101, 102, 103, 104, 2, 1} -// -// version_id = 0; -// trace_id = {64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79} -// span_id = {97, 98, 99, 100, 101, 102, 103, 104}; -// trace_options = {1}; - -import ( - "net/http" - - "go.opencensus.io/trace" -) - -// Binary returns the binary format representation of a SpanContext. -// -// If sc is the zero value, Binary returns nil. -func Binary(sc trace.SpanContext) []byte { - if sc == (trace.SpanContext{}) { - return nil - } - var b [29]byte - copy(b[2:18], sc.TraceID[:]) - b[18] = 1 - copy(b[19:27], sc.SpanID[:]) - b[27] = 2 - b[28] = uint8(sc.TraceOptions) - return b[:] -} - -// FromBinary returns the SpanContext represented by b. -// -// If b has an unsupported version ID or contains no TraceID, FromBinary -// returns with ok==false. -func FromBinary(b []byte) (sc trace.SpanContext, ok bool) { - if len(b) == 0 || b[0] != 0 { - return trace.SpanContext{}, false - } - b = b[1:] - if len(b) >= 17 && b[0] == 0 { - copy(sc.TraceID[:], b[1:17]) - b = b[17:] - } else { - return trace.SpanContext{}, false - } - if len(b) >= 9 && b[0] == 1 { - copy(sc.SpanID[:], b[1:9]) - b = b[9:] - } - if len(b) >= 2 && b[0] == 2 { - sc.TraceOptions = trace.TraceOptions(b[1]) - } - return sc, true -} - -// HTTPFormat implementations propagate span contexts -// in HTTP requests. -// -// SpanContextFromRequest extracts a span context from incoming -// requests. -// -// SpanContextToRequest modifies the given request to include the given -// span context. -type HTTPFormat interface { - SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) - SpanContextToRequest(sc trace.SpanContext, req *http.Request) -} - -// TODO(jbd): Find a more representative but short name for HTTPFormat. diff --git a/ibm/vendor/go.opencensus.io/trace/sampling.go b/ibm/vendor/go.opencensus.io/trace/sampling.go deleted file mode 100644 index 71c10f9e3b..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/sampling.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace - -import ( - "encoding/binary" -) - -const defaultSamplingProbability = 1e-4 - -// Sampler decides whether a trace should be sampled and exported. -type Sampler func(SamplingParameters) SamplingDecision - -// SamplingParameters contains the values passed to a Sampler. -type SamplingParameters struct { - ParentContext SpanContext - TraceID TraceID - SpanID SpanID - Name string - HasRemoteParent bool -} - -// SamplingDecision is the value returned by a Sampler. -type SamplingDecision struct { - Sample bool -} - -// ProbabilitySampler returns a Sampler that samples a given fraction of traces. -// -// It also samples spans whose parents are sampled. -func ProbabilitySampler(fraction float64) Sampler { - if !(fraction >= 0) { - fraction = 0 - } else if fraction >= 1 { - return AlwaysSample() - } - - traceIDUpperBound := uint64(fraction * (1 << 63)) - return Sampler(func(p SamplingParameters) SamplingDecision { - if p.ParentContext.IsSampled() { - return SamplingDecision{Sample: true} - } - x := binary.BigEndian.Uint64(p.TraceID[0:8]) >> 1 - return SamplingDecision{Sample: x < traceIDUpperBound} - }) -} - -// AlwaysSample returns a Sampler that samples every trace. -// Be careful about using this sampler in a production application with -// significant traffic: a new trace will be started and exported for every -// request. -func AlwaysSample() Sampler { - return func(p SamplingParameters) SamplingDecision { - return SamplingDecision{Sample: true} - } -} - -// NeverSample returns a Sampler that samples no traces. -func NeverSample() Sampler { - return func(p SamplingParameters) SamplingDecision { - return SamplingDecision{Sample: false} - } -} diff --git a/ibm/vendor/go.opencensus.io/trace/spanbucket.go b/ibm/vendor/go.opencensus.io/trace/spanbucket.go deleted file mode 100644 index fbabad34c0..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/spanbucket.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace - -import ( - "time" -) - -// samplePeriod is the minimum time between accepting spans in a single bucket. -const samplePeriod = time.Second - -// defaultLatencies contains the default latency bucket bounds. -// TODO: consider defaults, make configurable -var defaultLatencies = [...]time.Duration{ - 10 * time.Microsecond, - 100 * time.Microsecond, - time.Millisecond, - 10 * time.Millisecond, - 100 * time.Millisecond, - time.Second, - 10 * time.Second, - time.Minute, -} - -// bucket is a container for a set of spans for a particular error code or latency range. -type bucket struct { - nextTime time.Time // next time we can accept a span - buffer []*SpanData // circular buffer of spans - nextIndex int // location next SpanData should be placed in buffer - overflow bool // whether the circular buffer has wrapped around -} - -func makeBucket(bufferSize int) bucket { - return bucket{ - buffer: make([]*SpanData, bufferSize), - } -} - -// add adds a span to the bucket, if nextTime has been reached. -func (b *bucket) add(s *SpanData) { - if s.EndTime.Before(b.nextTime) { - return - } - if len(b.buffer) == 0 { - return - } - b.nextTime = s.EndTime.Add(samplePeriod) - b.buffer[b.nextIndex] = s - b.nextIndex++ - if b.nextIndex == len(b.buffer) { - b.nextIndex = 0 - b.overflow = true - } -} - -// size returns the number of spans in the bucket. -func (b *bucket) size() int { - if b.overflow { - return len(b.buffer) - } - return b.nextIndex -} - -// span returns the ith span in the bucket. -func (b *bucket) span(i int) *SpanData { - if !b.overflow { - return b.buffer[i] - } - if i < len(b.buffer)-b.nextIndex { - return b.buffer[b.nextIndex+i] - } - return b.buffer[b.nextIndex+i-len(b.buffer)] -} - -// resize changes the size of the bucket to n, keeping up to n existing spans. -func (b *bucket) resize(n int) { - cur := b.size() - newBuffer := make([]*SpanData, n) - if cur < n { - for i := 0; i < cur; i++ { - newBuffer[i] = b.span(i) - } - b.buffer = newBuffer - b.nextIndex = cur - b.overflow = false - return - } - for i := 0; i < n; i++ { - newBuffer[i] = b.span(i + cur - n) - } - b.buffer = newBuffer - b.nextIndex = 0 - b.overflow = true -} - -// latencyBucket returns the appropriate bucket number for a given latency. -func latencyBucket(latency time.Duration) int { - i := 0 - for i < len(defaultLatencies) && latency >= defaultLatencies[i] { - i++ - } - return i -} - -// latencyBucketBounds returns the lower and upper bounds for a latency bucket -// number. -// -// The lower bound is inclusive, the upper bound is exclusive (except for the -// last bucket.) -func latencyBucketBounds(index int) (lower time.Duration, upper time.Duration) { - if index == 0 { - return 0, defaultLatencies[index] - } - if index == len(defaultLatencies) { - return defaultLatencies[index-1], 1<<63 - 1 - } - return defaultLatencies[index-1], defaultLatencies[index] -} diff --git a/ibm/vendor/go.opencensus.io/trace/spanstore.go b/ibm/vendor/go.opencensus.io/trace/spanstore.go deleted file mode 100644 index c442d99021..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/spanstore.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace - -import ( - "sync" - "time" - - "go.opencensus.io/internal" -) - -const ( - maxBucketSize = 100000 - defaultBucketSize = 10 -) - -var ( - ssmu sync.RWMutex // protects spanStores - spanStores = make(map[string]*spanStore) -) - -// This exists purely to avoid exposing internal methods used by z-Pages externally. -type internalOnly struct{} - -func init() { - //TODO(#412): remove - internal.Trace = &internalOnly{} -} - -// ReportActiveSpans returns the active spans for the given name. -func (i internalOnly) ReportActiveSpans(name string) []*SpanData { - s := spanStoreForName(name) - if s == nil { - return nil - } - var out []*SpanData - s.mu.Lock() - defer s.mu.Unlock() - for span := range s.active { - out = append(out, span.makeSpanData()) - } - return out -} - -// ReportSpansByError returns a sample of error spans. -// -// If code is nonzero, only spans with that status code are returned. -func (i internalOnly) ReportSpansByError(name string, code int32) []*SpanData { - s := spanStoreForName(name) - if s == nil { - return nil - } - var out []*SpanData - s.mu.Lock() - defer s.mu.Unlock() - if code != 0 { - if b, ok := s.errors[code]; ok { - for _, sd := range b.buffer { - if sd == nil { - break - } - out = append(out, sd) - } - } - } else { - for _, b := range s.errors { - for _, sd := range b.buffer { - if sd == nil { - break - } - out = append(out, sd) - } - } - } - return out -} - -// ConfigureBucketSizes sets the number of spans to keep per latency and error -// bucket for different span names. -func (i internalOnly) ConfigureBucketSizes(bcs []internal.BucketConfiguration) { - for _, bc := range bcs { - latencyBucketSize := bc.MaxRequestsSucceeded - if latencyBucketSize < 0 { - latencyBucketSize = 0 - } - if latencyBucketSize > maxBucketSize { - latencyBucketSize = maxBucketSize - } - errorBucketSize := bc.MaxRequestsErrors - if errorBucketSize < 0 { - errorBucketSize = 0 - } - if errorBucketSize > maxBucketSize { - errorBucketSize = maxBucketSize - } - spanStoreSetSize(bc.Name, latencyBucketSize, errorBucketSize) - } -} - -// ReportSpansPerMethod returns a summary of what spans are being stored for each span name. -func (i internalOnly) ReportSpansPerMethod() map[string]internal.PerMethodSummary { - out := make(map[string]internal.PerMethodSummary) - ssmu.RLock() - defer ssmu.RUnlock() - for name, s := range spanStores { - s.mu.Lock() - p := internal.PerMethodSummary{ - Active: len(s.active), - } - for code, b := range s.errors { - p.ErrorBuckets = append(p.ErrorBuckets, internal.ErrorBucketSummary{ - ErrorCode: code, - Size: b.size(), - }) - } - for i, b := range s.latency { - min, max := latencyBucketBounds(i) - p.LatencyBuckets = append(p.LatencyBuckets, internal.LatencyBucketSummary{ - MinLatency: min, - MaxLatency: max, - Size: b.size(), - }) - } - s.mu.Unlock() - out[name] = p - } - return out -} - -// ReportSpansByLatency returns a sample of successful spans. -// -// minLatency is the minimum latency of spans to be returned. -// maxLatency, if nonzero, is the maximum latency of spans to be returned. -func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency time.Duration) []*SpanData { - s := spanStoreForName(name) - if s == nil { - return nil - } - var out []*SpanData - s.mu.Lock() - defer s.mu.Unlock() - for i, b := range s.latency { - min, max := latencyBucketBounds(i) - if i+1 != len(s.latency) && max <= minLatency { - continue - } - if maxLatency != 0 && maxLatency < min { - continue - } - for _, sd := range b.buffer { - if sd == nil { - break - } - if minLatency != 0 || maxLatency != 0 { - d := sd.EndTime.Sub(sd.StartTime) - if d < minLatency { - continue - } - if maxLatency != 0 && d > maxLatency { - continue - } - } - out = append(out, sd) - } - } - return out -} - -// spanStore keeps track of spans stored for a particular span name. -// -// It contains all active spans; a sample of spans for failed requests, -// categorized by error code; and a sample of spans for successful requests, -// bucketed by latency. -type spanStore struct { - mu sync.Mutex // protects everything below. - active map[*Span]struct{} - errors map[int32]*bucket - latency []bucket - maxSpansPerErrorBucket int -} - -// newSpanStore creates a span store. -func newSpanStore(name string, latencyBucketSize int, errorBucketSize int) *spanStore { - s := &spanStore{ - active: make(map[*Span]struct{}), - latency: make([]bucket, len(defaultLatencies)+1), - maxSpansPerErrorBucket: errorBucketSize, - } - for i := range s.latency { - s.latency[i] = makeBucket(latencyBucketSize) - } - return s -} - -// spanStoreForName returns the spanStore for the given name. -// -// It returns nil if it doesn't exist. -func spanStoreForName(name string) *spanStore { - var s *spanStore - ssmu.RLock() - s, _ = spanStores[name] - ssmu.RUnlock() - return s -} - -// spanStoreForNameCreateIfNew returns the spanStore for the given name. -// -// It creates it if it didn't exist. -func spanStoreForNameCreateIfNew(name string) *spanStore { - ssmu.RLock() - s, ok := spanStores[name] - ssmu.RUnlock() - if ok { - return s - } - ssmu.Lock() - defer ssmu.Unlock() - s, ok = spanStores[name] - if ok { - return s - } - s = newSpanStore(name, defaultBucketSize, defaultBucketSize) - spanStores[name] = s - return s -} - -// spanStoreSetSize resizes the spanStore for the given name. -// -// It creates it if it didn't exist. -func spanStoreSetSize(name string, latencyBucketSize int, errorBucketSize int) { - ssmu.RLock() - s, ok := spanStores[name] - ssmu.RUnlock() - if ok { - s.resize(latencyBucketSize, errorBucketSize) - return - } - ssmu.Lock() - defer ssmu.Unlock() - s, ok = spanStores[name] - if ok { - s.resize(latencyBucketSize, errorBucketSize) - return - } - s = newSpanStore(name, latencyBucketSize, errorBucketSize) - spanStores[name] = s -} - -func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) { - s.mu.Lock() - for i := range s.latency { - s.latency[i].resize(latencyBucketSize) - } - for _, b := range s.errors { - b.resize(errorBucketSize) - } - s.maxSpansPerErrorBucket = errorBucketSize - s.mu.Unlock() -} - -// add adds a span to the active bucket of the spanStore. -func (s *spanStore) add(span *Span) { - s.mu.Lock() - s.active[span] = struct{}{} - s.mu.Unlock() -} - -// finished removes a span from the active set, and adds a corresponding -// SpanData to a latency or error bucket. -func (s *spanStore) finished(span *Span, sd *SpanData) { - latency := sd.EndTime.Sub(sd.StartTime) - if latency < 0 { - latency = 0 - } - code := sd.Status.Code - - s.mu.Lock() - delete(s.active, span) - if code == 0 { - s.latency[latencyBucket(latency)].add(sd) - } else { - if s.errors == nil { - s.errors = make(map[int32]*bucket) - } - if b := s.errors[code]; b != nil { - b.add(sd) - } else { - b := makeBucket(s.maxSpansPerErrorBucket) - s.errors[code] = &b - b.add(sd) - } - } - s.mu.Unlock() -} diff --git a/ibm/vendor/go.opencensus.io/trace/status_codes.go b/ibm/vendor/go.opencensus.io/trace/status_codes.go deleted file mode 100644 index ec60effd10..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/status_codes.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 trace - -// Status codes for use with Span.SetStatus. These correspond to the status -// codes used by gRPC defined here: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto -const ( - StatusCodeOK = 0 - StatusCodeCancelled = 1 - StatusCodeUnknown = 2 - StatusCodeInvalidArgument = 3 - StatusCodeDeadlineExceeded = 4 - StatusCodeNotFound = 5 - StatusCodeAlreadyExists = 6 - StatusCodePermissionDenied = 7 - StatusCodeResourceExhausted = 8 - StatusCodeFailedPrecondition = 9 - StatusCodeAborted = 10 - StatusCodeOutOfRange = 11 - StatusCodeUnimplemented = 12 - StatusCodeInternal = 13 - StatusCodeUnavailable = 14 - StatusCodeDataLoss = 15 - StatusCodeUnauthenticated = 16 -) diff --git a/ibm/vendor/go.opencensus.io/trace/trace.go b/ibm/vendor/go.opencensus.io/trace/trace.go deleted file mode 100644 index 125e2cd901..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/trace.go +++ /dev/null @@ -1,598 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// 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 trace - -import ( - "context" - crand "crypto/rand" - "encoding/binary" - "fmt" - "math/rand" - "sync" - "sync/atomic" - "time" - - "go.opencensus.io/internal" - "go.opencensus.io/trace/tracestate" -) - -// Span represents a span of a trace. It has an associated SpanContext, and -// stores data accumulated while the span is active. -// -// Ideally users should interact with Spans by calling the functions in this -// package that take a Context parameter. -type Span struct { - // data contains information recorded about the span. - // - // It will be non-nil if we are exporting the span or recording events for it. - // Otherwise, data is nil, and the Span is simply a carrier for the - // SpanContext, so that the trace ID is propagated. - data *SpanData - mu sync.Mutex // protects the contents of *data (but not the pointer value.) - spanContext SpanContext - - // lruAttributes are capped at configured limit. When the capacity is reached an oldest entry - // is removed to create room for a new entry. - lruAttributes *lruMap - - // annotations are stored in FIFO queue capped by configured limit. - annotations *evictedQueue - - // messageEvents are stored in FIFO queue capped by configured limit. - messageEvents *evictedQueue - - // links are stored in FIFO queue capped by configured limit. - links *evictedQueue - - // spanStore is the spanStore this span belongs to, if any, otherwise it is nil. - *spanStore - endOnce sync.Once - - executionTracerTaskEnd func() // ends the execution tracer span -} - -// IsRecordingEvents returns true if events are being recorded for this span. -// Use this check to avoid computing expensive annotations when they will never -// be used. -func (s *Span) IsRecordingEvents() bool { - if s == nil { - return false - } - return s.data != nil -} - -// TraceOptions contains options associated with a trace span. -type TraceOptions uint32 - -// IsSampled returns true if the span will be exported. -func (sc SpanContext) IsSampled() bool { - return sc.TraceOptions.IsSampled() -} - -// setIsSampled sets the TraceOptions bit that determines whether the span will be exported. -func (sc *SpanContext) setIsSampled(sampled bool) { - if sampled { - sc.TraceOptions |= 1 - } else { - sc.TraceOptions &= ^TraceOptions(1) - } -} - -// IsSampled returns true if the span will be exported. -func (t TraceOptions) IsSampled() bool { - return t&1 == 1 -} - -// SpanContext contains the state that must propagate across process boundaries. -// -// SpanContext is not an implementation of context.Context. -// TODO: add reference to external Census docs for SpanContext. -type SpanContext struct { - TraceID TraceID - SpanID SpanID - TraceOptions TraceOptions - Tracestate *tracestate.Tracestate -} - -type contextKey struct{} - -// FromContext returns the Span stored in a context, or nil if there isn't one. -func FromContext(ctx context.Context) *Span { - s, _ := ctx.Value(contextKey{}).(*Span) - return s -} - -// NewContext returns a new context with the given Span attached. -func NewContext(parent context.Context, s *Span) context.Context { - return context.WithValue(parent, contextKey{}, s) -} - -// All available span kinds. Span kind must be either one of these values. -const ( - SpanKindUnspecified = iota - SpanKindServer - SpanKindClient -) - -// StartOptions contains options concerning how a span is started. -type StartOptions struct { - // Sampler to consult for this Span. If provided, it is always consulted. - // - // If not provided, then the behavior differs based on whether - // the parent of this Span is remote, local, or there is no parent. - // In the case of a remote parent or no parent, the - // default sampler (see Config) will be consulted. Otherwise, - // when there is a non-remote parent, no new sampling decision will be made: - // we will preserve the sampling of the parent. - Sampler Sampler - - // SpanKind represents the kind of a span. If none is set, - // SpanKindUnspecified is used. - SpanKind int -} - -// StartOption apply changes to StartOptions. -type StartOption func(*StartOptions) - -// WithSpanKind makes new spans to be created with the given kind. -func WithSpanKind(spanKind int) StartOption { - return func(o *StartOptions) { - o.SpanKind = spanKind - } -} - -// WithSampler makes new spans to be be created with a custom sampler. -// Otherwise, the global sampler is used. -func WithSampler(sampler Sampler) StartOption { - return func(o *StartOptions) { - o.Sampler = sampler - } -} - -// StartSpan starts a new child span of the current span in the context. If -// there is no span in the context, creates a new trace and span. -// -// Returned context contains the newly created span. You can use it to -// propagate the returned span in process. -func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { - var opts StartOptions - var parent SpanContext - if p := FromContext(ctx); p != nil { - p.addChild() - parent = p.spanContext - } - for _, op := range o { - op(&opts) - } - span := startSpanInternal(name, parent != SpanContext{}, parent, false, opts) - - ctx, end := startExecutionTracerTask(ctx, name) - span.executionTracerTaskEnd = end - return NewContext(ctx, span), span -} - -// StartSpanWithRemoteParent starts a new child span of the span from the given parent. -// -// If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is -// preferred for cases where the parent is propagated via an incoming request. -// -// Returned context contains the newly created span. You can use it to -// propagate the returned span in process. -func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { - var opts StartOptions - for _, op := range o { - op(&opts) - } - span := startSpanInternal(name, parent != SpanContext{}, parent, true, opts) - ctx, end := startExecutionTracerTask(ctx, name) - span.executionTracerTaskEnd = end - return NewContext(ctx, span), span -} - -func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *Span { - span := &Span{} - span.spanContext = parent - - cfg := config.Load().(*Config) - - if !hasParent { - span.spanContext.TraceID = cfg.IDGenerator.NewTraceID() - } - span.spanContext.SpanID = cfg.IDGenerator.NewSpanID() - sampler := cfg.DefaultSampler - - if !hasParent || remoteParent || o.Sampler != nil { - // If this span is the child of a local span and no Sampler is set in the - // options, keep the parent's TraceOptions. - // - // Otherwise, consult the Sampler in the options if it is non-nil, otherwise - // the default sampler. - if o.Sampler != nil { - sampler = o.Sampler - } - span.spanContext.setIsSampled(sampler(SamplingParameters{ - ParentContext: parent, - TraceID: span.spanContext.TraceID, - SpanID: span.spanContext.SpanID, - Name: name, - HasRemoteParent: remoteParent}).Sample) - } - - if !internal.LocalSpanStoreEnabled && !span.spanContext.IsSampled() { - return span - } - - span.data = &SpanData{ - SpanContext: span.spanContext, - StartTime: time.Now(), - SpanKind: o.SpanKind, - Name: name, - HasRemoteParent: remoteParent, - } - span.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan) - span.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan) - span.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan) - span.links = newEvictedQueue(cfg.MaxLinksPerSpan) - - if hasParent { - span.data.ParentSpanID = parent.SpanID - } - if internal.LocalSpanStoreEnabled { - var ss *spanStore - ss = spanStoreForNameCreateIfNew(name) - if ss != nil { - span.spanStore = ss - ss.add(span) - } - } - - return span -} - -// End ends the span. -func (s *Span) End() { - if s == nil { - return - } - if s.executionTracerTaskEnd != nil { - s.executionTracerTaskEnd() - } - if !s.IsRecordingEvents() { - return - } - s.endOnce.Do(func() { - exp, _ := exporters.Load().(exportersMap) - mustExport := s.spanContext.IsSampled() && len(exp) > 0 - if s.spanStore != nil || mustExport { - sd := s.makeSpanData() - sd.EndTime = internal.MonotonicEndTime(sd.StartTime) - if s.spanStore != nil { - s.spanStore.finished(s, sd) - } - if mustExport { - for e := range exp { - e.ExportSpan(sd) - } - } - } - }) -} - -// makeSpanData produces a SpanData representing the current state of the Span. -// It requires that s.data is non-nil. -func (s *Span) makeSpanData() *SpanData { - var sd SpanData - s.mu.Lock() - sd = *s.data - if s.lruAttributes.len() > 0 { - sd.Attributes = s.lruAttributesToAttributeMap() - sd.DroppedAttributeCount = s.lruAttributes.droppedCount - } - if len(s.annotations.queue) > 0 { - sd.Annotations = s.interfaceArrayToAnnotationArray() - sd.DroppedAnnotationCount = s.annotations.droppedCount - } - if len(s.messageEvents.queue) > 0 { - sd.MessageEvents = s.interfaceArrayToMessageEventArray() - sd.DroppedMessageEventCount = s.messageEvents.droppedCount - } - if len(s.links.queue) > 0 { - sd.Links = s.interfaceArrayToLinksArray() - sd.DroppedLinkCount = s.links.droppedCount - } - s.mu.Unlock() - return &sd -} - -// SpanContext returns the SpanContext of the span. -func (s *Span) SpanContext() SpanContext { - if s == nil { - return SpanContext{} - } - return s.spanContext -} - -// SetName sets the name of the span, if it is recording events. -func (s *Span) SetName(name string) { - if !s.IsRecordingEvents() { - return - } - s.mu.Lock() - s.data.Name = name - s.mu.Unlock() -} - -// SetStatus sets the status of the span, if it is recording events. -func (s *Span) SetStatus(status Status) { - if !s.IsRecordingEvents() { - return - } - s.mu.Lock() - s.data.Status = status - s.mu.Unlock() -} - -func (s *Span) interfaceArrayToLinksArray() []Link { - linksArr := make([]Link, 0, len(s.links.queue)) - for _, value := range s.links.queue { - linksArr = append(linksArr, value.(Link)) - } - return linksArr -} - -func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent { - messageEventArr := make([]MessageEvent, 0, len(s.messageEvents.queue)) - for _, value := range s.messageEvents.queue { - messageEventArr = append(messageEventArr, value.(MessageEvent)) - } - return messageEventArr -} - -func (s *Span) interfaceArrayToAnnotationArray() []Annotation { - annotationArr := make([]Annotation, 0, len(s.annotations.queue)) - for _, value := range s.annotations.queue { - annotationArr = append(annotationArr, value.(Annotation)) - } - return annotationArr -} - -func (s *Span) lruAttributesToAttributeMap() map[string]interface{} { - attributes := make(map[string]interface{}, s.lruAttributes.len()) - for _, key := range s.lruAttributes.keys() { - value, ok := s.lruAttributes.get(key) - if ok { - keyStr := key.(string) - attributes[keyStr] = value - } - } - return attributes -} - -func (s *Span) copyToCappedAttributes(attributes []Attribute) { - for _, a := range attributes { - s.lruAttributes.add(a.key, a.value) - } -} - -func (s *Span) addChild() { - if !s.IsRecordingEvents() { - return - } - s.mu.Lock() - s.data.ChildSpanCount++ - s.mu.Unlock() -} - -// AddAttributes sets attributes in the span. -// -// Existing attributes whose keys appear in the attributes parameter are overwritten. -func (s *Span) AddAttributes(attributes ...Attribute) { - if !s.IsRecordingEvents() { - return - } - s.mu.Lock() - s.copyToCappedAttributes(attributes) - s.mu.Unlock() -} - -// copyAttributes copies a slice of Attributes into a map. -func copyAttributes(m map[string]interface{}, attributes []Attribute) { - for _, a := range attributes { - m[a.key] = a.value - } -} - -func (s *Span) lazyPrintfInternal(attributes []Attribute, format string, a ...interface{}) { - now := time.Now() - msg := fmt.Sprintf(format, a...) - var m map[string]interface{} - s.mu.Lock() - if len(attributes) != 0 { - m = make(map[string]interface{}, len(attributes)) - copyAttributes(m, attributes) - } - s.annotations.add(Annotation{ - Time: now, - Message: msg, - Attributes: m, - }) - s.mu.Unlock() -} - -func (s *Span) printStringInternal(attributes []Attribute, str string) { - now := time.Now() - var a map[string]interface{} - s.mu.Lock() - if len(attributes) != 0 { - a = make(map[string]interface{}, len(attributes)) - copyAttributes(a, attributes) - } - s.annotations.add(Annotation{ - Time: now, - Message: str, - Attributes: a, - }) - s.mu.Unlock() -} - -// Annotate adds an annotation with attributes. -// Attributes can be nil. -func (s *Span) Annotate(attributes []Attribute, str string) { - if !s.IsRecordingEvents() { - return - } - s.printStringInternal(attributes, str) -} - -// Annotatef adds an annotation with attributes. -func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) { - if !s.IsRecordingEvents() { - return - } - s.lazyPrintfInternal(attributes, format, a...) -} - -// AddMessageSendEvent adds a message send event to the span. -// -// messageID is an identifier for the message, which is recommended to be -// unique in this span and the same between the send event and the receive -// event (this allows to identify a message between the sender and receiver). -// For example, this could be a sequence id. -func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { - if !s.IsRecordingEvents() { - return - } - now := time.Now() - s.mu.Lock() - s.messageEvents.add(MessageEvent{ - Time: now, - EventType: MessageEventTypeSent, - MessageID: messageID, - UncompressedByteSize: uncompressedByteSize, - CompressedByteSize: compressedByteSize, - }) - s.mu.Unlock() -} - -// AddMessageReceiveEvent adds a message receive event to the span. -// -// messageID is an identifier for the message, which is recommended to be -// unique in this span and the same between the send event and the receive -// event (this allows to identify a message between the sender and receiver). -// For example, this could be a sequence id. -func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { - if !s.IsRecordingEvents() { - return - } - now := time.Now() - s.mu.Lock() - s.messageEvents.add(MessageEvent{ - Time: now, - EventType: MessageEventTypeRecv, - MessageID: messageID, - UncompressedByteSize: uncompressedByteSize, - CompressedByteSize: compressedByteSize, - }) - s.mu.Unlock() -} - -// AddLink adds a link to the span. -func (s *Span) AddLink(l Link) { - if !s.IsRecordingEvents() { - return - } - s.mu.Lock() - s.links.add(l) - s.mu.Unlock() -} - -func (s *Span) String() string { - if s == nil { - return "" - } - if s.data == nil { - return fmt.Sprintf("span %s", s.spanContext.SpanID) - } - s.mu.Lock() - str := fmt.Sprintf("span %s %q", s.spanContext.SpanID, s.data.Name) - s.mu.Unlock() - return str -} - -var config atomic.Value // access atomically - -func init() { - gen := &defaultIDGenerator{} - // initialize traceID and spanID generators. - var rngSeed int64 - for _, p := range []interface{}{ - &rngSeed, &gen.traceIDAdd, &gen.nextSpanID, &gen.spanIDInc, - } { - binary.Read(crand.Reader, binary.LittleEndian, p) - } - gen.traceIDRand = rand.New(rand.NewSource(rngSeed)) - gen.spanIDInc |= 1 - - config.Store(&Config{ - DefaultSampler: ProbabilitySampler(defaultSamplingProbability), - IDGenerator: gen, - MaxAttributesPerSpan: DefaultMaxAttributesPerSpan, - MaxAnnotationEventsPerSpan: DefaultMaxAnnotationEventsPerSpan, - MaxMessageEventsPerSpan: DefaultMaxMessageEventsPerSpan, - MaxLinksPerSpan: DefaultMaxLinksPerSpan, - }) -} - -type defaultIDGenerator struct { - sync.Mutex - - // Please keep these as the first fields - // so that these 8 byte fields will be aligned on addresses - // divisible by 8, on both 32-bit and 64-bit machines when - // performing atomic increments and accesses. - // See: - // * https://github.com/census-instrumentation/opencensus-go/issues/587 - // * https://github.com/census-instrumentation/opencensus-go/issues/865 - // * https://golang.org/pkg/sync/atomic/#pkg-note-BUG - nextSpanID uint64 - spanIDInc uint64 - - traceIDAdd [2]uint64 - traceIDRand *rand.Rand -} - -// NewSpanID returns a non-zero span ID from a randomly-chosen sequence. -func (gen *defaultIDGenerator) NewSpanID() [8]byte { - var id uint64 - for id == 0 { - id = atomic.AddUint64(&gen.nextSpanID, gen.spanIDInc) - } - var sid [8]byte - binary.LittleEndian.PutUint64(sid[:], id) - return sid -} - -// NewTraceID returns a non-zero trace ID from a randomly-chosen sequence. -// mu should be held while this function is called. -func (gen *defaultIDGenerator) NewTraceID() [16]byte { - var tid [16]byte - // Construct the trace ID from two outputs of traceIDRand, with a constant - // added to each half for additional entropy. - gen.Lock() - binary.LittleEndian.PutUint64(tid[0:8], gen.traceIDRand.Uint64()+gen.traceIDAdd[0]) - binary.LittleEndian.PutUint64(tid[8:16], gen.traceIDRand.Uint64()+gen.traceIDAdd[1]) - gen.Unlock() - return tid -} diff --git a/ibm/vendor/go.opencensus.io/trace/trace_go11.go b/ibm/vendor/go.opencensus.io/trace/trace_go11.go deleted file mode 100644 index b7d8aaf284..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/trace_go11.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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. - -// +build go1.11 - -package trace - -import ( - "context" - t "runtime/trace" -) - -func startExecutionTracerTask(ctx context.Context, name string) (context.Context, func()) { - if !t.IsEnabled() { - // Avoid additional overhead if - // runtime/trace is not enabled. - return ctx, func() {} - } - nctx, task := t.NewTask(ctx, name) - return nctx, task.End -} diff --git a/ibm/vendor/go.opencensus.io/trace/trace_nongo11.go b/ibm/vendor/go.opencensus.io/trace/trace_nongo11.go deleted file mode 100644 index e25419859c..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/trace_nongo11.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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. - -// +build !go1.11 - -package trace - -import ( - "context" -) - -func startExecutionTracerTask(ctx context.Context, name string) (context.Context, func()) { - return ctx, func() {} -} diff --git a/ibm/vendor/go.opencensus.io/trace/tracestate/tracestate.go b/ibm/vendor/go.opencensus.io/trace/tracestate/tracestate.go deleted file mode 100644 index 2d6c713eb3..0000000000 --- a/ibm/vendor/go.opencensus.io/trace/tracestate/tracestate.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// 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 tracestate implements support for the Tracestate header of the -// W3C TraceContext propagation format. -package tracestate - -import ( - "fmt" - "regexp" -) - -const ( - keyMaxSize = 256 - valueMaxSize = 256 - maxKeyValuePairs = 32 -) - -const ( - keyWithoutVendorFormat = `[a-z][_0-9a-z\-\*\/]{0,255}` - keyWithVendorFormat = `[a-z][_0-9a-z\-\*\/]{0,240}@[a-z][_0-9a-z\-\*\/]{0,13}` - keyFormat = `(` + keyWithoutVendorFormat + `)|(` + keyWithVendorFormat + `)` - valueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]{0,255}[\x21-\x2b\x2d-\x3c\x3e-\x7e]` -) - -var keyValidationRegExp = regexp.MustCompile(`^(` + keyFormat + `)$`) -var valueValidationRegExp = regexp.MustCompile(`^(` + valueFormat + `)$`) - -// Tracestate represents tracing-system specific context in a list of key-value pairs. Tracestate allows different -// vendors propagate additional information and inter-operate with their legacy Id formats. -type Tracestate struct { - entries []Entry -} - -// Entry represents one key-value pair in a list of key-value pair of Tracestate. -type Entry struct { - // Key is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, - // and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and - // forward slashes /. - Key string - - // Value is an opaque string up to 256 characters printable ASCII RFC0020 characters (i.e., the - // range 0x20 to 0x7E) except comma , and =. - Value string -} - -// Entries returns a slice of Entry. -func (ts *Tracestate) Entries() []Entry { - if ts == nil { - return nil - } - return ts.entries -} - -func (ts *Tracestate) remove(key string) *Entry { - for index, entry := range ts.entries { - if entry.Key == key { - ts.entries = append(ts.entries[:index], ts.entries[index+1:]...) - return &entry - } - } - return nil -} - -func (ts *Tracestate) add(entries []Entry) error { - for _, entry := range entries { - ts.remove(entry.Key) - } - if len(ts.entries)+len(entries) > maxKeyValuePairs { - return fmt.Errorf("adding %d key-value pairs to current %d pairs exceeds the limit of %d", - len(entries), len(ts.entries), maxKeyValuePairs) - } - ts.entries = append(entries, ts.entries...) - return nil -} - -func isValid(entry Entry) bool { - return keyValidationRegExp.MatchString(entry.Key) && - valueValidationRegExp.MatchString(entry.Value) -} - -func containsDuplicateKey(entries ...Entry) (string, bool) { - keyMap := make(map[string]int) - for _, entry := range entries { - if _, ok := keyMap[entry.Key]; ok { - return entry.Key, true - } - keyMap[entry.Key] = 1 - } - return "", false -} - -func areEntriesValid(entries ...Entry) (*Entry, bool) { - for _, entry := range entries { - if !isValid(entry) { - return &entry, false - } - } - return nil, true -} - -// New creates a Tracestate object from a parent and/or entries (key-value pair). -// Entries from the parent are copied if present. The entries passed to this function -// are inserted in front of those copied from the parent. If an entry copied from the -// parent contains the same key as one of the entry in entries then the entry copied -// from the parent is removed. See add func. -// -// An error is returned with nil Tracestate if -// 1. one or more entry in entries is invalid. -// 2. two or more entries in the input entries have the same key. -// 3. the number of entries combined from the parent and the input entries exceeds maxKeyValuePairs. -// (duplicate entry is counted only once). -func New(parent *Tracestate, entries ...Entry) (*Tracestate, error) { - if parent == nil && len(entries) == 0 { - return nil, nil - } - if entry, ok := areEntriesValid(entries...); !ok { - return nil, fmt.Errorf("key-value pair {%s, %s} is invalid", entry.Key, entry.Value) - } - - if key, duplicate := containsDuplicateKey(entries...); duplicate { - return nil, fmt.Errorf("contains duplicate keys (%s)", key) - } - - tracestate := Tracestate{} - - if parent != nil && len(parent.entries) > 0 { - tracestate.entries = append([]Entry{}, parent.entries...) - } - - err := tracestate.add(entries) - if err != nil { - return nil, err - } - return &tracestate, nil -} diff --git a/ibm/vendor/golang.org/x/lint/.travis.yml b/ibm/vendor/golang.org/x/lint/.travis.yml deleted file mode 100644 index 50553ebd00..0000000000 --- a/ibm/vendor/golang.org/x/lint/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -sudo: false -language: go -go: - - 1.10.x - - 1.11.x - - master - -go_import_path: golang.org/x/lint - -install: - - go get -t -v ./... - -script: - - go test -v -race ./... - -matrix: - allow_failures: - - go: master - fast_finish: true diff --git a/ibm/vendor/golang.org/x/lint/CONTRIBUTING.md b/ibm/vendor/golang.org/x/lint/CONTRIBUTING.md deleted file mode 100644 index 1fadda62d2..0000000000 --- a/ibm/vendor/golang.org/x/lint/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -# Contributing to Golint - -## Before filing an issue: - -### Are you having trouble building golint? - -Check you have the latest version of its dependencies. Run -``` -go get -u golang.org/x/lint/golint -``` -If you still have problems, consider searching for existing issues before filing a new issue. - -## Before sending a pull request: - -Have you understood the purpose of golint? Make sure to carefully read `README`. diff --git a/ibm/vendor/golang.org/x/lint/LICENSE b/ibm/vendor/golang.org/x/lint/LICENSE deleted file mode 100644 index 65d761bc9f..0000000000 --- a/ibm/vendor/golang.org/x/lint/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/golang.org/x/lint/README.md b/ibm/vendor/golang.org/x/lint/README.md deleted file mode 100644 index 4968b13aef..0000000000 --- a/ibm/vendor/golang.org/x/lint/README.md +++ /dev/null @@ -1,88 +0,0 @@ -Golint is a linter for Go source code. - -[![Build Status](https://travis-ci.org/golang/lint.svg?branch=master)](https://travis-ci.org/golang/lint) - -## Installation - -Golint requires a -[supported release of Go](https://golang.org/doc/devel/release.html#policy). - - go get -u golang.org/x/lint/golint - -To find out where `golint` was installed you can run `go list -f {{.Target}} golang.org/x/lint/golint`. For `golint` to be used globally add that directory to the `$PATH` environment setting. - -## Usage - -Invoke `golint` with one or more filenames, directories, or packages named -by its import path. Golint uses the same -[import path syntax](https://golang.org/cmd/go/#hdr-Import_path_syntax) as -the `go` command and therefore -also supports relative import paths like `./...`. Additionally the `...` -wildcard can be used as suffix on relative and absolute file paths to recurse -into them. - -The output of this tool is a list of suggestions in Vim quickfix format, -which is accepted by lots of different editors. - -## Purpose - -Golint differs from gofmt. Gofmt reformats Go source code, whereas -golint prints out style mistakes. - -Golint differs from govet. Govet is concerned with correctness, whereas -golint is concerned with coding style. Golint is in use at Google, and it -seeks to match the accepted style of the open source Go project. - -The suggestions made by golint are exactly that: suggestions. -Golint is not perfect, and has both false positives and false negatives. -Do not treat its output as a gold standard. We will not be adding pragmas -or other knobs to suppress specific warnings, so do not expect or require -code to be completely "lint-free". -In short, this tool is not, and will never be, trustworthy enough for its -suggestions to be enforced automatically, for example as part of a build process. -Golint makes suggestions for many of the mechanically checkable items listed in -[Effective Go](https://golang.org/doc/effective_go.html) and the -[CodeReviewComments wiki page](https://golang.org/wiki/CodeReviewComments). - -## Scope - -Golint is meant to carry out the stylistic conventions put forth in -[Effective Go](https://golang.org/doc/effective_go.html) and -[CodeReviewComments](https://golang.org/wiki/CodeReviewComments). -Changes that are not aligned with those documents will not be considered. - -## Contributions - -Contributions to this project are welcome provided they are [in scope](#scope), -though please send mail before starting work on anything major. -Contributors retain their copyright, so we need you to fill out -[a short form](https://developers.google.com/open-source/cla/individual) -before we can accept your contribution. - -## Vim - -Add this to your ~/.vimrc: - - set rtp+=$GOPATH/src/golang.org/x/lint/misc/vim - -If you have multiple entries in your GOPATH, replace `$GOPATH` with the right value. - -Running `:Lint` will run golint on the current file and populate the quickfix list. - -Optionally, add this to your `~/.vimrc` to automatically run `golint` on `:w` - - autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow - - -## Emacs - -Add this to your `.emacs` file: - - (add-to-list 'load-path (concat (getenv "GOPATH") "/src/golang.org/x/lint/misc/emacs/")) - (require 'golint) - -If you have multiple entries in your GOPATH, replace `$GOPATH` with the right value. - -Running M-x golint will run golint on the current file. - -For more usage, see [Compilation-Mode](http://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation-Mode.html). diff --git a/ibm/vendor/golang.org/x/lint/golint/golint.go b/ibm/vendor/golang.org/x/lint/golint/golint.go deleted file mode 100644 index ac024b6d26..0000000000 --- a/ibm/vendor/golang.org/x/lint/golint/golint.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// golint lints the Go source files named on its command line. -package main - -import ( - "flag" - "fmt" - "go/build" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "golang.org/x/lint" -) - -var ( - minConfidence = flag.Float64("min_confidence", 0.8, "minimum confidence of a problem to print it") - setExitStatus = flag.Bool("set_exit_status", false, "set exit status to 1 if any issues are found") - suggestions int -) - -func usage() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - fmt.Fprintf(os.Stderr, "\tgolint [flags] # runs on package in current directory\n") - fmt.Fprintf(os.Stderr, "\tgolint [flags] [packages]\n") - fmt.Fprintf(os.Stderr, "\tgolint [flags] [directories] # where a '/...' suffix includes all sub-directories\n") - fmt.Fprintf(os.Stderr, "\tgolint [flags] [files] # all must belong to a single package\n") - fmt.Fprintf(os.Stderr, "Flags:\n") - flag.PrintDefaults() -} - -func main() { - flag.Usage = usage - flag.Parse() - - if flag.NArg() == 0 { - lintDir(".") - } else { - // dirsRun, filesRun, and pkgsRun indicate whether golint is applied to - // directory, file or package targets. The distinction affects which - // checks are run. It is no valid to mix target types. - var dirsRun, filesRun, pkgsRun int - var args []string - for _, arg := range flag.Args() { - if strings.HasSuffix(arg, "/...") && isDir(arg[:len(arg)-len("/...")]) { - dirsRun = 1 - for _, dirname := range allPackagesInFS(arg) { - args = append(args, dirname) - } - } else if isDir(arg) { - dirsRun = 1 - args = append(args, arg) - } else if exists(arg) { - filesRun = 1 - args = append(args, arg) - } else { - pkgsRun = 1 - args = append(args, arg) - } - } - - if dirsRun+filesRun+pkgsRun != 1 { - usage() - os.Exit(2) - } - switch { - case dirsRun == 1: - for _, dir := range args { - lintDir(dir) - } - case filesRun == 1: - lintFiles(args...) - case pkgsRun == 1: - for _, pkg := range importPaths(args) { - lintPackage(pkg) - } - } - } - - if *setExitStatus && suggestions > 0 { - fmt.Fprintf(os.Stderr, "Found %d lint suggestions; failing.\n", suggestions) - os.Exit(1) - } -} - -func isDir(filename string) bool { - fi, err := os.Stat(filename) - return err == nil && fi.IsDir() -} - -func exists(filename string) bool { - _, err := os.Stat(filename) - return err == nil -} - -func lintFiles(filenames ...string) { - files := make(map[string][]byte) - for _, filename := range filenames { - src, err := ioutil.ReadFile(filename) - if err != nil { - fmt.Fprintln(os.Stderr, err) - continue - } - files[filename] = src - } - - l := new(lint.Linter) - ps, err := l.LintFiles(files) - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - return - } - for _, p := range ps { - if p.Confidence >= *minConfidence { - fmt.Printf("%v: %s\n", p.Position, p.Text) - suggestions++ - } - } -} - -func lintDir(dirname string) { - pkg, err := build.ImportDir(dirname, 0) - lintImportedPackage(pkg, err) -} - -func lintPackage(pkgname string) { - pkg, err := build.Import(pkgname, ".", 0) - lintImportedPackage(pkg, err) -} - -func lintImportedPackage(pkg *build.Package, err error) { - if err != nil { - if _, nogo := err.(*build.NoGoError); nogo { - // Don't complain if the failure is due to no Go source files. - return - } - fmt.Fprintln(os.Stderr, err) - return - } - - var files []string - files = append(files, pkg.GoFiles...) - files = append(files, pkg.CgoFiles...) - files = append(files, pkg.TestGoFiles...) - if pkg.Dir != "." { - for i, f := range files { - files[i] = filepath.Join(pkg.Dir, f) - } - } - // TODO(dsymonds): Do foo_test too (pkg.XTestGoFiles) - - lintFiles(files...) -} diff --git a/ibm/vendor/golang.org/x/lint/golint/import.go b/ibm/vendor/golang.org/x/lint/golint/import.go deleted file mode 100644 index 2ba9dea779..0000000000 --- a/ibm/vendor/golang.org/x/lint/golint/import.go +++ /dev/null @@ -1,309 +0,0 @@ -package main - -/* - -This file holds a direct copy of the import path matching code of -https://github.com/golang/go/blob/master/src/cmd/go/main.go. It can be -replaced when https://golang.org/issue/8768 is resolved. - -It has been updated to follow upstream changes in a few ways. - -*/ - -import ( - "fmt" - "go/build" - "log" - "os" - "path" - "path/filepath" - "regexp" - "runtime" - "strings" -) - -var ( - buildContext = build.Default - goroot = filepath.Clean(runtime.GOROOT()) - gorootSrc = filepath.Join(goroot, "src") -) - -// importPathsNoDotExpansion returns the import paths to use for the given -// command line, but it does no ... expansion. -func importPathsNoDotExpansion(args []string) []string { - if len(args) == 0 { - return []string{"."} - } - var out []string - for _, a := range args { - // Arguments are supposed to be import paths, but - // as a courtesy to Windows developers, rewrite \ to / - // in command-line arguments. Handles .\... and so on. - if filepath.Separator == '\\' { - a = strings.Replace(a, `\`, `/`, -1) - } - - // Put argument in canonical form, but preserve leading ./. - if strings.HasPrefix(a, "./") { - a = "./" + path.Clean(a) - if a == "./." { - a = "." - } - } else { - a = path.Clean(a) - } - if a == "all" || a == "std" { - out = append(out, allPackages(a)...) - continue - } - out = append(out, a) - } - return out -} - -// importPaths returns the import paths to use for the given command line. -func importPaths(args []string) []string { - args = importPathsNoDotExpansion(args) - var out []string - for _, a := range args { - if strings.Contains(a, "...") { - if build.IsLocalImport(a) { - out = append(out, allPackagesInFS(a)...) - } else { - out = append(out, allPackages(a)...) - } - continue - } - out = append(out, a) - } - return out -} - -// matchPattern(pattern)(name) reports whether -// name matches pattern. Pattern is a limited glob -// pattern in which '...' means 'any string' and there -// is no other special syntax. -func matchPattern(pattern string) func(name string) bool { - re := regexp.QuoteMeta(pattern) - re = strings.Replace(re, `\.\.\.`, `.*`, -1) - // Special case: foo/... matches foo too. - if strings.HasSuffix(re, `/.*`) { - re = re[:len(re)-len(`/.*`)] + `(/.*)?` - } - reg := regexp.MustCompile(`^` + re + `$`) - return func(name string) bool { - return reg.MatchString(name) - } -} - -// hasPathPrefix reports whether the path s begins with the -// elements in prefix. -func hasPathPrefix(s, prefix string) bool { - switch { - default: - return false - case len(s) == len(prefix): - return s == prefix - case len(s) > len(prefix): - if prefix != "" && prefix[len(prefix)-1] == '/' { - return strings.HasPrefix(s, prefix) - } - return s[len(prefix)] == '/' && s[:len(prefix)] == prefix - } -} - -// treeCanMatchPattern(pattern)(name) reports whether -// name or children of name can possibly match pattern. -// Pattern is the same limited glob accepted by matchPattern. -func treeCanMatchPattern(pattern string) func(name string) bool { - wildCard := false - if i := strings.Index(pattern, "..."); i >= 0 { - wildCard = true - pattern = pattern[:i] - } - return func(name string) bool { - return len(name) <= len(pattern) && hasPathPrefix(pattern, name) || - wildCard && strings.HasPrefix(name, pattern) - } -} - -// allPackages returns all the packages that can be found -// under the $GOPATH directories and $GOROOT matching pattern. -// The pattern is either "all" (all packages), "std" (standard packages) -// or a path including "...". -func allPackages(pattern string) []string { - pkgs := matchPackages(pattern) - if len(pkgs) == 0 { - fmt.Fprintf(os.Stderr, "warning: %q matched no packages\n", pattern) - } - return pkgs -} - -func matchPackages(pattern string) []string { - match := func(string) bool { return true } - treeCanMatch := func(string) bool { return true } - if pattern != "all" && pattern != "std" { - match = matchPattern(pattern) - treeCanMatch = treeCanMatchPattern(pattern) - } - - have := map[string]bool{ - "builtin": true, // ignore pseudo-package that exists only for documentation - } - if !buildContext.CgoEnabled { - have["runtime/cgo"] = true // ignore during walk - } - var pkgs []string - - // Commands - cmd := filepath.Join(goroot, "src/cmd") + string(filepath.Separator) - filepath.Walk(cmd, func(path string, fi os.FileInfo, err error) error { - if err != nil || !fi.IsDir() || path == cmd { - return nil - } - name := path[len(cmd):] - if !treeCanMatch(name) { - return filepath.SkipDir - } - // Commands are all in cmd/, not in subdirectories. - if strings.Contains(name, string(filepath.Separator)) { - return filepath.SkipDir - } - - // We use, e.g., cmd/gofmt as the pseudo import path for gofmt. - name = "cmd/" + name - if have[name] { - return nil - } - have[name] = true - if !match(name) { - return nil - } - _, err = buildContext.ImportDir(path, 0) - if err != nil { - if _, noGo := err.(*build.NoGoError); !noGo { - log.Print(err) - } - return nil - } - pkgs = append(pkgs, name) - return nil - }) - - for _, src := range buildContext.SrcDirs() { - if (pattern == "std" || pattern == "cmd") && src != gorootSrc { - continue - } - src = filepath.Clean(src) + string(filepath.Separator) - root := src - if pattern == "cmd" { - root += "cmd" + string(filepath.Separator) - } - filepath.Walk(root, func(path string, fi os.FileInfo, err error) error { - if err != nil || !fi.IsDir() || path == src { - return nil - } - - // Avoid .foo, _foo, and testdata directory trees. - _, elem := filepath.Split(path) - if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" { - return filepath.SkipDir - } - - name := filepath.ToSlash(path[len(src):]) - if pattern == "std" && (strings.Contains(name, ".") || name == "cmd") { - // The name "std" is only the standard library. - // If the name is cmd, it's the root of the command tree. - return filepath.SkipDir - } - if !treeCanMatch(name) { - return filepath.SkipDir - } - if have[name] { - return nil - } - have[name] = true - if !match(name) { - return nil - } - _, err = buildContext.ImportDir(path, 0) - if err != nil { - if _, noGo := err.(*build.NoGoError); noGo { - return nil - } - } - pkgs = append(pkgs, name) - return nil - }) - } - return pkgs -} - -// allPackagesInFS is like allPackages but is passed a pattern -// beginning ./ or ../, meaning it should scan the tree rooted -// at the given directory. There are ... in the pattern too. -func allPackagesInFS(pattern string) []string { - pkgs := matchPackagesInFS(pattern) - if len(pkgs) == 0 { - fmt.Fprintf(os.Stderr, "warning: %q matched no packages\n", pattern) - } - return pkgs -} - -func matchPackagesInFS(pattern string) []string { - // Find directory to begin the scan. - // Could be smarter but this one optimization - // is enough for now, since ... is usually at the - // end of a path. - i := strings.Index(pattern, "...") - dir, _ := path.Split(pattern[:i]) - - // pattern begins with ./ or ../. - // path.Clean will discard the ./ but not the ../. - // We need to preserve the ./ for pattern matching - // and in the returned import paths. - prefix := "" - if strings.HasPrefix(pattern, "./") { - prefix = "./" - } - match := matchPattern(pattern) - - var pkgs []string - filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error { - if err != nil || !fi.IsDir() { - return nil - } - if path == dir { - // filepath.Walk starts at dir and recurses. For the recursive case, - // the path is the result of filepath.Join, which calls filepath.Clean. - // The initial case is not Cleaned, though, so we do this explicitly. - // - // This converts a path like "./io/" to "io". Without this step, running - // "cd $GOROOT/src/pkg; go list ./io/..." would incorrectly skip the io - // package, because prepending the prefix "./" to the unclean path would - // result in "././io", and match("././io") returns false. - path = filepath.Clean(path) - } - - // Avoid .foo, _foo, and testdata directory trees, but do not avoid "." or "..". - _, elem := filepath.Split(path) - dot := strings.HasPrefix(elem, ".") && elem != "." && elem != ".." - if dot || strings.HasPrefix(elem, "_") || elem == "testdata" { - return filepath.SkipDir - } - - name := prefix + filepath.ToSlash(path) - if !match(name) { - return nil - } - if _, err = build.ImportDir(path, 0); err != nil { - if _, noGo := err.(*build.NoGoError); !noGo { - log.Print(err) - } - return nil - } - pkgs = append(pkgs, name) - return nil - }) - return pkgs -} diff --git a/ibm/vendor/golang.org/x/lint/golint/importcomment.go b/ibm/vendor/golang.org/x/lint/golint/importcomment.go deleted file mode 100644 index d5b32f7346..0000000000 --- a/ibm/vendor/golang.org/x/lint/golint/importcomment.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2018 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// +build go1.12 - -// Require use of the correct import path only for Go 1.12+ users, so -// any breakages coincide with people updating their CI configs or -// whatnot. - -package main // import "golang.org/x/lint/golint" diff --git a/ibm/vendor/golang.org/x/lint/lint.go b/ibm/vendor/golang.org/x/lint/lint.go deleted file mode 100644 index 7d813e061a..0000000000 --- a/ibm/vendor/golang.org/x/lint/lint.go +++ /dev/null @@ -1,1615 +0,0 @@ -// Copyright (c) 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// Package lint contains a linter for Go source code. -package lint // import "golang.org/x/lint" - -import ( - "bufio" - "bytes" - "fmt" - "go/ast" - "go/parser" - "go/printer" - "go/token" - "go/types" - "regexp" - "sort" - "strconv" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/tools/go/ast/astutil" - "golang.org/x/tools/go/gcexportdata" -) - -const styleGuideBase = "https://golang.org/wiki/CodeReviewComments" - -// A Linter lints Go source code. -type Linter struct { -} - -// Problem represents a problem in some source code. -type Problem struct { - Position token.Position // position in source file - Text string // the prose that describes the problem - Link string // (optional) the link to the style guide for the problem - Confidence float64 // a value in (0,1] estimating the confidence in this problem's correctness - LineText string // the source line - Category string // a short name for the general category of the problem - - // If the problem has a suggested fix (the minority case), - // ReplacementLine is a full replacement for the relevant line of the source file. - ReplacementLine string -} - -func (p *Problem) String() string { - if p.Link != "" { - return p.Text + "\n\n" + p.Link - } - return p.Text -} - -type byPosition []Problem - -func (p byPosition) Len() int { return len(p) } -func (p byPosition) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p byPosition) Less(i, j int) bool { - pi, pj := p[i].Position, p[j].Position - - if pi.Filename != pj.Filename { - return pi.Filename < pj.Filename - } - if pi.Line != pj.Line { - return pi.Line < pj.Line - } - if pi.Column != pj.Column { - return pi.Column < pj.Column - } - - return p[i].Text < p[j].Text -} - -// Lint lints src. -func (l *Linter) Lint(filename string, src []byte) ([]Problem, error) { - return l.LintFiles(map[string][]byte{filename: src}) -} - -// LintFiles lints a set of files of a single package. -// The argument is a map of filename to source. -func (l *Linter) LintFiles(files map[string][]byte) ([]Problem, error) { - pkg := &pkg{ - fset: token.NewFileSet(), - files: make(map[string]*file), - } - var pkgName string - for filename, src := range files { - if isGenerated(src) { - continue // See issue #239 - } - f, err := parser.ParseFile(pkg.fset, filename, src, parser.ParseComments) - if err != nil { - return nil, err - } - if pkgName == "" { - pkgName = f.Name.Name - } else if f.Name.Name != pkgName { - return nil, fmt.Errorf("%s is in package %s, not %s", filename, f.Name.Name, pkgName) - } - pkg.files[filename] = &file{ - pkg: pkg, - f: f, - fset: pkg.fset, - src: src, - filename: filename, - } - } - if len(pkg.files) == 0 { - return nil, nil - } - return pkg.lint(), nil -} - -var ( - genHdr = []byte("// Code generated ") - genFtr = []byte(" DO NOT EDIT.") -) - -// isGenerated reports whether the source file is generated code -// according the rules from https://golang.org/s/generatedcode. -func isGenerated(src []byte) bool { - sc := bufio.NewScanner(bytes.NewReader(src)) - for sc.Scan() { - b := sc.Bytes() - if bytes.HasPrefix(b, genHdr) && bytes.HasSuffix(b, genFtr) && len(b) >= len(genHdr)+len(genFtr) { - return true - } - } - return false -} - -// pkg represents a package being linted. -type pkg struct { - fset *token.FileSet - files map[string]*file - - typesPkg *types.Package - typesInfo *types.Info - - // sortable is the set of types in the package that implement sort.Interface. - sortable map[string]bool - // main is whether this is a "main" package. - main bool - - problems []Problem -} - -func (p *pkg) lint() []Problem { - if err := p.typeCheck(); err != nil { - /* TODO(dsymonds): Consider reporting these errors when golint operates on entire packages. - if e, ok := err.(types.Error); ok { - pos := p.fset.Position(e.Pos) - conf := 1.0 - if strings.Contains(e.Msg, "can't find import: ") { - // Golint is probably being run in a context that doesn't support - // typechecking (e.g. package files aren't found), so don't warn about it. - conf = 0 - } - if conf > 0 { - p.errorfAt(pos, conf, category("typechecking"), e.Msg) - } - - // TODO(dsymonds): Abort if !e.Soft? - } - */ - } - - p.scanSortable() - p.main = p.isMain() - - for _, f := range p.files { - f.lint() - } - - sort.Sort(byPosition(p.problems)) - - return p.problems -} - -// file represents a file being linted. -type file struct { - pkg *pkg - f *ast.File - fset *token.FileSet - src []byte - filename string -} - -func (f *file) isTest() bool { return strings.HasSuffix(f.filename, "_test.go") } - -func (f *file) lint() { - f.lintPackageComment() - f.lintImports() - f.lintBlankImports() - f.lintExported() - f.lintNames() - f.lintElses() - f.lintRanges() - f.lintErrorf() - f.lintErrors() - f.lintErrorStrings() - f.lintReceiverNames() - f.lintIncDec() - f.lintErrorReturn() - f.lintUnexportedReturn() - f.lintTimeNames() - f.lintContextKeyTypes() - f.lintContextArgs() -} - -type link string -type category string - -// The variadic arguments may start with link and category types, -// and must end with a format string and any arguments. -// It returns the new Problem. -func (f *file) errorf(n ast.Node, confidence float64, args ...interface{}) *Problem { - pos := f.fset.Position(n.Pos()) - if pos.Filename == "" { - pos.Filename = f.filename - } - return f.pkg.errorfAt(pos, confidence, args...) -} - -func (p *pkg) errorfAt(pos token.Position, confidence float64, args ...interface{}) *Problem { - problem := Problem{ - Position: pos, - Confidence: confidence, - } - if pos.Filename != "" { - // The file might not exist in our mapping if a //line directive was encountered. - if f, ok := p.files[pos.Filename]; ok { - problem.LineText = srcLine(f.src, pos) - } - } - -argLoop: - for len(args) > 1 { // always leave at least the format string in args - switch v := args[0].(type) { - case link: - problem.Link = string(v) - case category: - problem.Category = string(v) - default: - break argLoop - } - args = args[1:] - } - - problem.Text = fmt.Sprintf(args[0].(string), args[1:]...) - - p.problems = append(p.problems, problem) - return &p.problems[len(p.problems)-1] -} - -var newImporter = func(fset *token.FileSet) types.ImporterFrom { - return gcexportdata.NewImporter(fset, make(map[string]*types.Package)) -} - -func (p *pkg) typeCheck() error { - config := &types.Config{ - // By setting a no-op error reporter, the type checker does as much work as possible. - Error: func(error) {}, - Importer: newImporter(p.fset), - } - info := &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Scopes: make(map[ast.Node]*types.Scope), - } - var anyFile *file - var astFiles []*ast.File - for _, f := range p.files { - anyFile = f - astFiles = append(astFiles, f.f) - } - pkg, err := config.Check(anyFile.f.Name.Name, p.fset, astFiles, info) - // Remember the typechecking info, even if config.Check failed, - // since we will get partial information. - p.typesPkg = pkg - p.typesInfo = info - return err -} - -func (p *pkg) typeOf(expr ast.Expr) types.Type { - if p.typesInfo == nil { - return nil - } - return p.typesInfo.TypeOf(expr) -} - -func (p *pkg) isNamedType(typ types.Type, importPath, name string) bool { - n, ok := typ.(*types.Named) - if !ok { - return false - } - tn := n.Obj() - return tn != nil && tn.Pkg() != nil && tn.Pkg().Path() == importPath && tn.Name() == name -} - -// scopeOf returns the tightest scope encompassing id. -func (p *pkg) scopeOf(id *ast.Ident) *types.Scope { - var scope *types.Scope - if obj := p.typesInfo.ObjectOf(id); obj != nil { - scope = obj.Parent() - } - if scope == p.typesPkg.Scope() { - // We were given a top-level identifier. - // Use the file-level scope instead of the package-level scope. - pos := id.Pos() - for _, f := range p.files { - if f.f.Pos() <= pos && pos < f.f.End() { - scope = p.typesInfo.Scopes[f.f] - break - } - } - } - return scope -} - -func (p *pkg) scanSortable() { - p.sortable = make(map[string]bool) - - // bitfield for which methods exist on each type. - const ( - Len = 1 << iota - Less - Swap - ) - nmap := map[string]int{"Len": Len, "Less": Less, "Swap": Swap} - has := make(map[string]int) - for _, f := range p.files { - f.walk(func(n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok || fn.Recv == nil || len(fn.Recv.List) == 0 { - return true - } - // TODO(dsymonds): We could check the signature to be more precise. - recv := receiverType(fn) - if i, ok := nmap[fn.Name.Name]; ok { - has[recv] |= i - } - return false - }) - } - for typ, ms := range has { - if ms == Len|Less|Swap { - p.sortable[typ] = true - } - } -} - -func (p *pkg) isMain() bool { - for _, f := range p.files { - if f.isMain() { - return true - } - } - return false -} - -func (f *file) isMain() bool { - if f.f.Name.Name == "main" { - return true - } - return false -} - -// lintPackageComment checks package comments. It complains if -// there is no package comment, or if it is not of the right form. -// This has a notable false positive in that a package comment -// could rightfully appear in a different file of the same package, -// but that's not easy to fix since this linter is file-oriented. -func (f *file) lintPackageComment() { - if f.isTest() { - return - } - - const ref = styleGuideBase + "#package-comments" - prefix := "Package " + f.f.Name.Name + " " - - // Look for a detached package comment. - // First, scan for the last comment that occurs before the "package" keyword. - var lastCG *ast.CommentGroup - for _, cg := range f.f.Comments { - if cg.Pos() > f.f.Package { - // Gone past "package" keyword. - break - } - lastCG = cg - } - if lastCG != nil && strings.HasPrefix(lastCG.Text(), prefix) { - endPos := f.fset.Position(lastCG.End()) - pkgPos := f.fset.Position(f.f.Package) - if endPos.Line+1 < pkgPos.Line { - // There isn't a great place to anchor this error; - // the start of the blank lines between the doc and the package statement - // is at least pointing at the location of the problem. - pos := token.Position{ - Filename: endPos.Filename, - // Offset not set; it is non-trivial, and doesn't appear to be needed. - Line: endPos.Line + 1, - Column: 1, - } - f.pkg.errorfAt(pos, 0.9, link(ref), category("comments"), "package comment is detached; there should be no blank lines between it and the package statement") - return - } - } - - if f.f.Doc == nil { - f.errorf(f.f, 0.2, link(ref), category("comments"), "should have a package comment, unless it's in another file for this package") - return - } - s := f.f.Doc.Text() - if ts := strings.TrimLeft(s, " \t"); ts != s { - f.errorf(f.f.Doc, 1, link(ref), category("comments"), "package comment should not have leading space") - s = ts - } - // Only non-main packages need to keep to this form. - if !f.pkg.main && !strings.HasPrefix(s, prefix) { - f.errorf(f.f.Doc, 1, link(ref), category("comments"), `package comment should be of the form "%s..."`, prefix) - } -} - -// lintBlankImports complains if a non-main package has blank imports that are -// not documented. -func (f *file) lintBlankImports() { - // In package main and in tests, we don't complain about blank imports. - if f.pkg.main || f.isTest() { - return - } - - // The first element of each contiguous group of blank imports should have - // an explanatory comment of some kind. - for i, imp := range f.f.Imports { - pos := f.fset.Position(imp.Pos()) - - if !isBlank(imp.Name) { - continue // Ignore non-blank imports. - } - if i > 0 { - prev := f.f.Imports[i-1] - prevPos := f.fset.Position(prev.Pos()) - if isBlank(prev.Name) && prevPos.Line+1 == pos.Line { - continue // A subsequent blank in a group. - } - } - - // This is the first blank import of a group. - if imp.Doc == nil && imp.Comment == nil { - ref := "" - f.errorf(imp, 1, link(ref), category("imports"), "a blank import should be only in a main or test package, or have a comment justifying it") - } - } -} - -// lintImports examines import blocks. -func (f *file) lintImports() { - for i, is := range f.f.Imports { - _ = i - if is.Name != nil && is.Name.Name == "." && !f.isTest() { - f.errorf(is, 1, link(styleGuideBase+"#import-dot"), category("imports"), "should not use dot imports") - } - - } -} - -const docCommentsLink = styleGuideBase + "#doc-comments" - -// lintExported examines the exported names. -// It complains if any required doc comments are missing, -// or if they are not of the right form. The exact rules are in -// lintFuncDoc, lintTypeDoc and lintValueSpecDoc; this function -// also tracks the GenDecl structure being traversed to permit -// doc comments for constants to be on top of the const block. -// It also complains if the names stutter when combined with -// the package name. -func (f *file) lintExported() { - if f.isTest() { - return - } - - var lastGen *ast.GenDecl // last GenDecl entered. - - // Set of GenDecls that have already had missing comments flagged. - genDeclMissingComments := make(map[*ast.GenDecl]bool) - - f.walk(func(node ast.Node) bool { - switch v := node.(type) { - case *ast.GenDecl: - if v.Tok == token.IMPORT { - return false - } - // token.CONST, token.TYPE or token.VAR - lastGen = v - return true - case *ast.FuncDecl: - f.lintFuncDoc(v) - if v.Recv == nil { - // Only check for stutter on functions, not methods. - // Method names are not used package-qualified. - f.checkStutter(v.Name, "func") - } - // Don't proceed inside funcs. - return false - case *ast.TypeSpec: - // inside a GenDecl, which usually has the doc - doc := v.Doc - if doc == nil { - doc = lastGen.Doc - } - f.lintTypeDoc(v, doc) - f.checkStutter(v.Name, "type") - // Don't proceed inside types. - return false - case *ast.ValueSpec: - f.lintValueSpecDoc(v, lastGen, genDeclMissingComments) - return false - } - return true - }) -} - -var ( - allCapsRE = regexp.MustCompile(`^[A-Z0-9_]+$`) - anyCapsRE = regexp.MustCompile(`[A-Z]`) -) - -// knownNameExceptions is a set of names that are known to be exempt from naming checks. -// This is usually because they are constrained by having to match names in the -// standard library. -var knownNameExceptions = map[string]bool{ - "LastInsertId": true, // must match database/sql - "kWh": true, -} - -func isInTopLevel(f *ast.File, ident *ast.Ident) bool { - path, _ := astutil.PathEnclosingInterval(f, ident.Pos(), ident.End()) - for _, f := range path { - switch f.(type) { - case *ast.File, *ast.GenDecl, *ast.ValueSpec, *ast.Ident: - continue - } - return false - } - return true -} - -// lintNames examines all names in the file. -// It complains if any use underscores or incorrect known initialisms. -func (f *file) lintNames() { - // Package names need slightly different handling than other names. - if strings.Contains(f.f.Name.Name, "_") && !strings.HasSuffix(f.f.Name.Name, "_test") { - f.errorf(f.f, 1, link("http://golang.org/doc/effective_go.html#package-names"), category("naming"), "don't use an underscore in package name") - } - if anyCapsRE.MatchString(f.f.Name.Name) { - f.errorf(f.f, 1, link("http://golang.org/doc/effective_go.html#package-names"), category("mixed-caps"), "don't use MixedCaps in package name; %s should be %s", f.f.Name.Name, strings.ToLower(f.f.Name.Name)) - } - - check := func(id *ast.Ident, thing string) { - if id.Name == "_" { - return - } - if knownNameExceptions[id.Name] { - return - } - - // Handle two common styles from other languages that don't belong in Go. - if len(id.Name) >= 5 && allCapsRE.MatchString(id.Name) && strings.Contains(id.Name, "_") { - capCount := 0 - for _, c := range id.Name { - if 'A' <= c && c <= 'Z' { - capCount++ - } - } - if capCount >= 2 { - f.errorf(id, 0.8, link(styleGuideBase+"#mixed-caps"), category("naming"), "don't use ALL_CAPS in Go names; use CamelCase") - return - } - } - if thing == "const" || (thing == "var" && isInTopLevel(f.f, id)) { - if len(id.Name) > 2 && id.Name[0] == 'k' && id.Name[1] >= 'A' && id.Name[1] <= 'Z' { - should := string(id.Name[1]+'a'-'A') + id.Name[2:] - f.errorf(id, 0.8, link(styleGuideBase+"#mixed-caps"), category("naming"), "don't use leading k in Go names; %s %s should be %s", thing, id.Name, should) - } - } - - should := lintName(id.Name) - if id.Name == should { - return - } - - if len(id.Name) > 2 && strings.Contains(id.Name[1:], "_") { - f.errorf(id, 0.9, link("http://golang.org/doc/effective_go.html#mixed-caps"), category("naming"), "don't use underscores in Go names; %s %s should be %s", thing, id.Name, should) - return - } - f.errorf(id, 0.8, link(styleGuideBase+"#initialisms"), category("naming"), "%s %s should be %s", thing, id.Name, should) - } - checkList := func(fl *ast.FieldList, thing string) { - if fl == nil { - return - } - for _, f := range fl.List { - for _, id := range f.Names { - check(id, thing) - } - } - } - f.walk(func(node ast.Node) bool { - switch v := node.(type) { - case *ast.AssignStmt: - if v.Tok == token.ASSIGN { - return true - } - for _, exp := range v.Lhs { - if id, ok := exp.(*ast.Ident); ok { - check(id, "var") - } - } - case *ast.FuncDecl: - if f.isTest() && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test") || strings.HasPrefix(v.Name.Name, "Benchmark")) { - return true - } - - thing := "func" - if v.Recv != nil { - thing = "method" - } - - // Exclude naming warnings for functions that are exported to C but - // not exported in the Go API. - // See https://github.com/golang/lint/issues/144. - if ast.IsExported(v.Name.Name) || !isCgoExported(v) { - check(v.Name, thing) - } - - checkList(v.Type.Params, thing+" parameter") - checkList(v.Type.Results, thing+" result") - case *ast.GenDecl: - if v.Tok == token.IMPORT { - return true - } - var thing string - switch v.Tok { - case token.CONST: - thing = "const" - case token.TYPE: - thing = "type" - case token.VAR: - thing = "var" - } - for _, spec := range v.Specs { - switch s := spec.(type) { - case *ast.TypeSpec: - check(s.Name, thing) - case *ast.ValueSpec: - for _, id := range s.Names { - check(id, thing) - } - } - } - case *ast.InterfaceType: - // Do not check interface method names. - // They are often constrainted by the method names of concrete types. - for _, x := range v.Methods.List { - ft, ok := x.Type.(*ast.FuncType) - if !ok { // might be an embedded interface name - continue - } - checkList(ft.Params, "interface method parameter") - checkList(ft.Results, "interface method result") - } - case *ast.RangeStmt: - if v.Tok == token.ASSIGN { - return true - } - if id, ok := v.Key.(*ast.Ident); ok { - check(id, "range var") - } - if id, ok := v.Value.(*ast.Ident); ok { - check(id, "range var") - } - case *ast.StructType: - for _, f := range v.Fields.List { - for _, id := range f.Names { - check(id, "struct field") - } - } - } - return true - }) -} - -// lintName returns a different name if it should be different. -func lintName(name string) (should string) { - // Fast path for simple cases: "_" and all lowercase. - if name == "_" { - return name - } - allLower := true - for _, r := range name { - if !unicode.IsLower(r) { - allLower = false - break - } - } - if allLower { - return name - } - - // Split camelCase at any lower->upper transition, and split on underscores. - // Check each word for common initialisms. - runes := []rune(name) - w, i := 0, 0 // index of start of word, scan - for i+1 <= len(runes) { - eow := false // whether we hit the end of a word - if i+1 == len(runes) { - eow = true - } else if runes[i+1] == '_' { - // underscore; shift the remainder forward over any run of underscores - eow = true - n := 1 - for i+n+1 < len(runes) && runes[i+n+1] == '_' { - n++ - } - - // Leave at most one underscore if the underscore is between two digits - if i+n+1 < len(runes) && unicode.IsDigit(runes[i]) && unicode.IsDigit(runes[i+n+1]) { - n-- - } - - copy(runes[i+1:], runes[i+n+1:]) - runes = runes[:len(runes)-n] - } else if unicode.IsLower(runes[i]) && !unicode.IsLower(runes[i+1]) { - // lower->non-lower - eow = true - } - i++ - if !eow { - continue - } - - // [w,i) is a word. - word := string(runes[w:i]) - if u := strings.ToUpper(word); commonInitialisms[u] { - // Keep consistent case, which is lowercase only at the start. - if w == 0 && unicode.IsLower(runes[w]) { - u = strings.ToLower(u) - } - // All the common initialisms are ASCII, - // so we can replace the bytes exactly. - copy(runes[w:], []rune(u)) - } else if w > 0 && strings.ToLower(word) == word { - // already all lowercase, and not the first word, so uppercase the first character. - runes[w] = unicode.ToUpper(runes[w]) - } - w = i - } - return string(runes) -} - -// commonInitialisms is a set of common initialisms. -// Only add entries that are highly unlikely to be non-initialisms. -// For instance, "ID" is fine (Freudian code is rare), but "AND" is not. -var commonInitialisms = map[string]bool{ - "ACL": true, - "API": true, - "ASCII": true, - "CPU": true, - "CSS": true, - "DNS": true, - "EOF": true, - "GUID": true, - "HTML": true, - "HTTP": true, - "HTTPS": true, - "ID": true, - "IP": true, - "JSON": true, - "LHS": true, - "QPS": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, -} - -// lintTypeDoc examines the doc comment on a type. -// It complains if they are missing from an exported type, -// or if they are not of the standard form. -func (f *file) lintTypeDoc(t *ast.TypeSpec, doc *ast.CommentGroup) { - if !ast.IsExported(t.Name.Name) { - return - } - if doc == nil { - f.errorf(t, 1, link(docCommentsLink), category("comments"), "exported type %v should have comment or be unexported", t.Name) - return - } - - s := doc.Text() - articles := [...]string{"A", "An", "The"} - for _, a := range articles { - if strings.HasPrefix(s, a+" ") { - s = s[len(a)+1:] - break - } - } - if !strings.HasPrefix(s, t.Name.Name+" ") { - f.errorf(doc, 1, link(docCommentsLink), category("comments"), `comment on exported type %v should be of the form "%v ..." (with optional leading article)`, t.Name, t.Name) - } -} - -var commonMethods = map[string]bool{ - "Error": true, - "Read": true, - "ServeHTTP": true, - "String": true, - "Write": true, - "Unwrap": true, -} - -// lintFuncDoc examines doc comments on functions and methods. -// It complains if they are missing, or not of the right form. -// It has specific exclusions for well-known methods (see commonMethods above). -func (f *file) lintFuncDoc(fn *ast.FuncDecl) { - if !ast.IsExported(fn.Name.Name) { - // func is unexported - return - } - kind := "function" - name := fn.Name.Name - if fn.Recv != nil && len(fn.Recv.List) > 0 { - // method - kind = "method" - recv := receiverType(fn) - if !ast.IsExported(recv) { - // receiver is unexported - return - } - if commonMethods[name] { - return - } - switch name { - case "Len", "Less", "Swap": - if f.pkg.sortable[recv] { - return - } - } - name = recv + "." + name - } - if fn.Doc == nil { - f.errorf(fn, 1, link(docCommentsLink), category("comments"), "exported %s %s should have comment or be unexported", kind, name) - return - } - s := fn.Doc.Text() - prefix := fn.Name.Name + " " - if !strings.HasPrefix(s, prefix) { - f.errorf(fn.Doc, 1, link(docCommentsLink), category("comments"), `comment on exported %s %s should be of the form "%s..."`, kind, name, prefix) - } -} - -// lintValueSpecDoc examines package-global variables and constants. -// It complains if they are not individually declared, -// or if they are not suitably documented in the right form (unless they are in a block that is commented). -func (f *file) lintValueSpecDoc(vs *ast.ValueSpec, gd *ast.GenDecl, genDeclMissingComments map[*ast.GenDecl]bool) { - kind := "var" - if gd.Tok == token.CONST { - kind = "const" - } - - if len(vs.Names) > 1 { - // Check that none are exported except for the first. - for _, n := range vs.Names[1:] { - if ast.IsExported(n.Name) { - f.errorf(vs, 1, category("comments"), "exported %s %s should have its own declaration", kind, n.Name) - return - } - } - } - - // Only one name. - name := vs.Names[0].Name - if !ast.IsExported(name) { - return - } - - if vs.Doc == nil && gd.Doc == nil { - if genDeclMissingComments[gd] { - return - } - block := "" - if kind == "const" && gd.Lparen.IsValid() { - block = " (or a comment on this block)" - } - f.errorf(vs, 1, link(docCommentsLink), category("comments"), "exported %s %s should have comment%s or be unexported", kind, name, block) - genDeclMissingComments[gd] = true - return - } - // If this GenDecl has parens and a comment, we don't check its comment form. - if gd.Lparen.IsValid() && gd.Doc != nil { - return - } - // The relevant text to check will be on either vs.Doc or gd.Doc. - // Use vs.Doc preferentially. - doc := vs.Doc - if doc == nil { - doc = gd.Doc - } - prefix := name + " " - if !strings.HasPrefix(doc.Text(), prefix) { - f.errorf(doc, 1, link(docCommentsLink), category("comments"), `comment on exported %s %s should be of the form "%s..."`, kind, name, prefix) - } -} - -func (f *file) checkStutter(id *ast.Ident, thing string) { - pkg, name := f.f.Name.Name, id.Name - if !ast.IsExported(name) { - // unexported name - return - } - // A name stutters if the package name is a strict prefix - // and the next character of the name starts a new word. - if len(name) <= len(pkg) { - // name is too short to stutter. - // This permits the name to be the same as the package name. - return - } - if !strings.EqualFold(pkg, name[:len(pkg)]) { - return - } - // We can assume the name is well-formed UTF-8. - // If the next rune after the package name is uppercase or an underscore - // the it's starting a new word and thus this name stutters. - rem := name[len(pkg):] - if next, _ := utf8.DecodeRuneInString(rem); next == '_' || unicode.IsUpper(next) { - f.errorf(id, 0.8, link(styleGuideBase+"#package-names"), category("naming"), "%s name will be used as %s.%s by other packages, and that stutters; consider calling this %s", thing, pkg, name, rem) - } -} - -// zeroLiteral is a set of ast.BasicLit values that are zero values. -// It is not exhaustive. -var zeroLiteral = map[string]bool{ - "false": true, // bool - // runes - `'\x00'`: true, - `'\000'`: true, - // strings - `""`: true, - "``": true, - // numerics - "0": true, - "0.": true, - "0.0": true, - "0i": true, -} - -// lintElses examines else blocks. It complains about any else block whose if block ends in a return. -func (f *file) lintElses() { - // We don't want to flag if { } else if { } else { } constructions. - // They will appear as an IfStmt whose Else field is also an IfStmt. - // Record such a node so we ignore it when we visit it. - ignore := make(map[*ast.IfStmt]bool) - - f.walk(func(node ast.Node) bool { - ifStmt, ok := node.(*ast.IfStmt) - if !ok || ifStmt.Else == nil { - return true - } - if elseif, ok := ifStmt.Else.(*ast.IfStmt); ok { - ignore[elseif] = true - return true - } - if ignore[ifStmt] { - return true - } - if _, ok := ifStmt.Else.(*ast.BlockStmt); !ok { - // only care about elses without conditions - return true - } - if len(ifStmt.Body.List) == 0 { - return true - } - shortDecl := false // does the if statement have a ":=" initialization statement? - if ifStmt.Init != nil { - if as, ok := ifStmt.Init.(*ast.AssignStmt); ok && as.Tok == token.DEFINE { - shortDecl = true - } - } - lastStmt := ifStmt.Body.List[len(ifStmt.Body.List)-1] - if _, ok := lastStmt.(*ast.ReturnStmt); ok { - extra := "" - if shortDecl { - extra = " (move short variable declaration to its own line if necessary)" - } - f.errorf(ifStmt.Else, 1, link(styleGuideBase+"#indent-error-flow"), category("indent"), "if block ends with a return statement, so drop this else and outdent its block"+extra) - } - return true - }) -} - -// lintRanges examines range clauses. It complains about redundant constructions. -func (f *file) lintRanges() { - f.walk(func(node ast.Node) bool { - rs, ok := node.(*ast.RangeStmt) - if !ok { - return true - } - - if isIdent(rs.Key, "_") && (rs.Value == nil || isIdent(rs.Value, "_")) { - p := f.errorf(rs.Key, 1, category("range-loop"), "should omit values from range; this loop is equivalent to `for range ...`") - - newRS := *rs // shallow copy - newRS.Value = nil - newRS.Key = nil - p.ReplacementLine = f.firstLineOf(&newRS, rs) - - return true - } - - if isIdent(rs.Value, "_") { - p := f.errorf(rs.Value, 1, category("range-loop"), "should omit 2nd value from range; this loop is equivalent to `for %s %s range ...`", f.render(rs.Key), rs.Tok) - - newRS := *rs // shallow copy - newRS.Value = nil - p.ReplacementLine = f.firstLineOf(&newRS, rs) - } - - return true - }) -} - -// lintErrorf examines errors.New and testing.Error calls. It complains if its only argument is an fmt.Sprintf invocation. -func (f *file) lintErrorf() { - f.walk(func(node ast.Node) bool { - ce, ok := node.(*ast.CallExpr) - if !ok || len(ce.Args) != 1 { - return true - } - isErrorsNew := isPkgDot(ce.Fun, "errors", "New") - var isTestingError bool - se, ok := ce.Fun.(*ast.SelectorExpr) - if ok && se.Sel.Name == "Error" { - if typ := f.pkg.typeOf(se.X); typ != nil { - isTestingError = typ.String() == "*testing.T" - } - } - if !isErrorsNew && !isTestingError { - return true - } - if !f.imports("errors") { - return true - } - arg := ce.Args[0] - ce, ok = arg.(*ast.CallExpr) - if !ok || !isPkgDot(ce.Fun, "fmt", "Sprintf") { - return true - } - errorfPrefix := "fmt" - if isTestingError { - errorfPrefix = f.render(se.X) - } - p := f.errorf(node, 1, category("errors"), "should replace %s(fmt.Sprintf(...)) with %s.Errorf(...)", f.render(se), errorfPrefix) - - m := f.srcLineWithMatch(ce, `^(.*)`+f.render(se)+`\(fmt\.Sprintf\((.*)\)\)(.*)$`) - if m != nil { - p.ReplacementLine = m[1] + errorfPrefix + ".Errorf(" + m[2] + ")" + m[3] - } - - return true - }) -} - -// lintErrors examines global error vars. It complains if they aren't named in the standard way. -func (f *file) lintErrors() { - for _, decl := range f.f.Decls { - gd, ok := decl.(*ast.GenDecl) - if !ok || gd.Tok != token.VAR { - continue - } - for _, spec := range gd.Specs { - spec := spec.(*ast.ValueSpec) - if len(spec.Names) != 1 || len(spec.Values) != 1 { - continue - } - ce, ok := spec.Values[0].(*ast.CallExpr) - if !ok { - continue - } - if !isPkgDot(ce.Fun, "errors", "New") && !isPkgDot(ce.Fun, "fmt", "Errorf") { - continue - } - - id := spec.Names[0] - prefix := "err" - if id.IsExported() { - prefix = "Err" - } - if !strings.HasPrefix(id.Name, prefix) { - f.errorf(id, 0.9, category("naming"), "error var %s should have name of the form %sFoo", id.Name, prefix) - } - } - } -} - -func lintErrorString(s string) (isClean bool, conf float64) { - const basicConfidence = 0.8 - const capConfidence = basicConfidence - 0.2 - first, firstN := utf8.DecodeRuneInString(s) - last, _ := utf8.DecodeLastRuneInString(s) - if last == '.' || last == ':' || last == '!' || last == '\n' { - return false, basicConfidence - } - if unicode.IsUpper(first) { - // People use proper nouns and exported Go identifiers in error strings, - // so decrease the confidence of warnings for capitalization. - if len(s) <= firstN { - return false, capConfidence - } - // Flag strings starting with something that doesn't look like an initialism. - if second, _ := utf8.DecodeRuneInString(s[firstN:]); !unicode.IsUpper(second) { - return false, capConfidence - } - } - return true, 0 -} - -// lintErrorStrings examines error strings. -// It complains if they are capitalized or end in punctuation or a newline. -func (f *file) lintErrorStrings() { - f.walk(func(node ast.Node) bool { - ce, ok := node.(*ast.CallExpr) - if !ok { - return true - } - if !isPkgDot(ce.Fun, "errors", "New") && !isPkgDot(ce.Fun, "fmt", "Errorf") { - return true - } - if len(ce.Args) < 1 { - return true - } - str, ok := ce.Args[0].(*ast.BasicLit) - if !ok || str.Kind != token.STRING { - return true - } - s, _ := strconv.Unquote(str.Value) // can assume well-formed Go - if s == "" { - return true - } - clean, conf := lintErrorString(s) - if clean { - return true - } - - f.errorf(str, conf, link(styleGuideBase+"#error-strings"), category("errors"), - "error strings should not be capitalized or end with punctuation or a newline") - return true - }) -} - -// lintReceiverNames examines receiver names. It complains about inconsistent -// names used for the same type and names such as "this". -func (f *file) lintReceiverNames() { - typeReceiver := map[string]string{} - f.walk(func(n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok || fn.Recv == nil || len(fn.Recv.List) == 0 { - return true - } - names := fn.Recv.List[0].Names - if len(names) < 1 { - return true - } - name := names[0].Name - const ref = styleGuideBase + "#receiver-names" - if name == "_" { - f.errorf(n, 1, link(ref), category("naming"), `receiver name should not be an underscore, omit the name if it is unused`) - return true - } - if name == "this" || name == "self" { - f.errorf(n, 1, link(ref), category("naming"), `receiver name should be a reflection of its identity; don't use generic names such as "this" or "self"`) - return true - } - recv := receiverType(fn) - if prev, ok := typeReceiver[recv]; ok && prev != name { - f.errorf(n, 1, link(ref), category("naming"), "receiver name %s should be consistent with previous receiver name %s for %s", name, prev, recv) - return true - } - typeReceiver[recv] = name - return true - }) -} - -// lintIncDec examines statements that increment or decrement a variable. -// It complains if they don't use x++ or x--. -func (f *file) lintIncDec() { - f.walk(func(n ast.Node) bool { - as, ok := n.(*ast.AssignStmt) - if !ok { - return true - } - if len(as.Lhs) != 1 { - return true - } - if !isOne(as.Rhs[0]) { - return true - } - var suffix string - switch as.Tok { - case token.ADD_ASSIGN: - suffix = "++" - case token.SUB_ASSIGN: - suffix = "--" - default: - return true - } - f.errorf(as, 0.8, category("unary-op"), "should replace %s with %s%s", f.render(as), f.render(as.Lhs[0]), suffix) - return true - }) -} - -// lintErrorReturn examines function declarations that return an error. -// It complains if the error isn't the last parameter. -func (f *file) lintErrorReturn() { - f.walk(func(n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok || fn.Type.Results == nil { - return true - } - ret := fn.Type.Results.List - if len(ret) <= 1 { - return true - } - if isIdent(ret[len(ret)-1].Type, "error") { - return true - } - // An error return parameter should be the last parameter. - // Flag any error parameters found before the last. - for _, r := range ret[:len(ret)-1] { - if isIdent(r.Type, "error") { - f.errorf(fn, 0.9, category("arg-order"), "error should be the last type when returning multiple items") - break // only flag one - } - } - return true - }) -} - -// lintUnexportedReturn examines exported function declarations. -// It complains if any return an unexported type. -func (f *file) lintUnexportedReturn() { - f.walk(func(n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok { - return true - } - if fn.Type.Results == nil { - return false - } - if !fn.Name.IsExported() { - return false - } - thing := "func" - if fn.Recv != nil && len(fn.Recv.List) > 0 { - thing = "method" - if !ast.IsExported(receiverType(fn)) { - // Don't report exported methods of unexported types, - // such as private implementations of sort.Interface. - return false - } - } - for _, ret := range fn.Type.Results.List { - typ := f.pkg.typeOf(ret.Type) - if exportedType(typ) { - continue - } - f.errorf(ret.Type, 0.8, category("unexported-type-in-api"), - "exported %s %s returns unexported type %s, which can be annoying to use", - thing, fn.Name.Name, typ) - break // only flag one - } - return false - }) -} - -// exportedType reports whether typ is an exported type. -// It is imprecise, and will err on the side of returning true, -// such as for composite types. -func exportedType(typ types.Type) bool { - switch T := typ.(type) { - case *types.Named: - // Builtin types have no package. - return T.Obj().Pkg() == nil || T.Obj().Exported() - case *types.Map: - return exportedType(T.Key()) && exportedType(T.Elem()) - case interface { - Elem() types.Type - }: // array, slice, pointer, chan - return exportedType(T.Elem()) - } - // Be conservative about other types, such as struct, interface, etc. - return true -} - -// timeSuffixes is a list of name suffixes that imply a time unit. -// This is not an exhaustive list. -var timeSuffixes = []string{ - "Sec", "Secs", "Seconds", - "Msec", "Msecs", - "Milli", "Millis", "Milliseconds", - "Usec", "Usecs", "Microseconds", - "MS", "Ms", -} - -func (f *file) lintTimeNames() { - f.walk(func(node ast.Node) bool { - v, ok := node.(*ast.ValueSpec) - if !ok { - return true - } - for _, name := range v.Names { - origTyp := f.pkg.typeOf(name) - // Look for time.Duration or *time.Duration; - // the latter is common when using flag.Duration. - typ := origTyp - if pt, ok := typ.(*types.Pointer); ok { - typ = pt.Elem() - } - if !f.pkg.isNamedType(typ, "time", "Duration") { - continue - } - suffix := "" - for _, suf := range timeSuffixes { - if strings.HasSuffix(name.Name, suf) { - suffix = suf - break - } - } - if suffix == "" { - continue - } - f.errorf(v, 0.9, category("time"), "var %s is of type %v; don't use unit-specific suffix %q", name.Name, origTyp, suffix) - } - return true - }) -} - -// lintContextKeyTypes checks for call expressions to context.WithValue with -// basic types used for the key argument. -// See: https://golang.org/issue/17293 -func (f *file) lintContextKeyTypes() { - f.walk(func(node ast.Node) bool { - switch node := node.(type) { - case *ast.CallExpr: - f.checkContextKeyType(node) - } - - return true - }) -} - -// checkContextKeyType reports an error if the call expression calls -// context.WithValue with a key argument of basic type. -func (f *file) checkContextKeyType(x *ast.CallExpr) { - sel, ok := x.Fun.(*ast.SelectorExpr) - if !ok { - return - } - pkg, ok := sel.X.(*ast.Ident) - if !ok || pkg.Name != "context" { - return - } - if sel.Sel.Name != "WithValue" { - return - } - - // key is second argument to context.WithValue - if len(x.Args) != 3 { - return - } - key := f.pkg.typesInfo.Types[x.Args[1]] - - if ktyp, ok := key.Type.(*types.Basic); ok && ktyp.Kind() != types.Invalid { - f.errorf(x, 1.0, category("context"), fmt.Sprintf("should not use basic type %s as key in context.WithValue", key.Type)) - } -} - -// lintContextArgs examines function declarations that contain an -// argument with a type of context.Context -// It complains if that argument isn't the first parameter. -func (f *file) lintContextArgs() { - f.walk(func(n ast.Node) bool { - fn, ok := n.(*ast.FuncDecl) - if !ok || len(fn.Type.Params.List) <= 1 { - return true - } - // A context.Context should be the first parameter of a function. - // Flag any that show up after the first. - for _, arg := range fn.Type.Params.List[1:] { - if isPkgDot(arg.Type, "context", "Context") { - f.errorf(fn, 0.9, link("https://golang.org/pkg/context/"), category("arg-order"), "context.Context should be the first parameter of a function") - break // only flag one - } - } - return true - }) -} - -// containsComments returns whether the interval [start, end) contains any -// comments without "// MATCH " prefix. -func (f *file) containsComments(start, end token.Pos) bool { - for _, cgroup := range f.f.Comments { - comments := cgroup.List - if comments[0].Slash >= end { - // All comments starting with this group are after end pos. - return false - } - if comments[len(comments)-1].Slash < start { - // Comments group ends before start pos. - continue - } - for _, c := range comments { - if start <= c.Slash && c.Slash < end && !strings.HasPrefix(c.Text, "// MATCH ") { - return true - } - } - } - return false -} - -// receiverType returns the named type of the method receiver, sans "*", -// or "invalid-type" if fn.Recv is ill formed. -func receiverType(fn *ast.FuncDecl) string { - switch e := fn.Recv.List[0].Type.(type) { - case *ast.Ident: - return e.Name - case *ast.StarExpr: - if id, ok := e.X.(*ast.Ident); ok { - return id.Name - } - } - // The parser accepts much more than just the legal forms. - return "invalid-type" -} - -func (f *file) walk(fn func(ast.Node) bool) { - ast.Walk(walker(fn), f.f) -} - -func (f *file) render(x interface{}) string { - var buf bytes.Buffer - if err := printer.Fprint(&buf, f.fset, x); err != nil { - panic(err) - } - return buf.String() -} - -func (f *file) debugRender(x interface{}) string { - var buf bytes.Buffer - if err := ast.Fprint(&buf, f.fset, x, nil); err != nil { - panic(err) - } - return buf.String() -} - -// walker adapts a function to satisfy the ast.Visitor interface. -// The function return whether the walk should proceed into the node's children. -type walker func(ast.Node) bool - -func (w walker) Visit(node ast.Node) ast.Visitor { - if w(node) { - return w - } - return nil -} - -func isIdent(expr ast.Expr, ident string) bool { - id, ok := expr.(*ast.Ident) - return ok && id.Name == ident -} - -// isBlank returns whether id is the blank identifier "_". -// If id == nil, the answer is false. -func isBlank(id *ast.Ident) bool { return id != nil && id.Name == "_" } - -func isPkgDot(expr ast.Expr, pkg, name string) bool { - sel, ok := expr.(*ast.SelectorExpr) - return ok && isIdent(sel.X, pkg) && isIdent(sel.Sel, name) -} - -func isOne(expr ast.Expr) bool { - lit, ok := expr.(*ast.BasicLit) - return ok && lit.Kind == token.INT && lit.Value == "1" -} - -func isCgoExported(f *ast.FuncDecl) bool { - if f.Recv != nil || f.Doc == nil { - return false - } - - cgoExport := regexp.MustCompile(fmt.Sprintf("(?m)^//export %s$", regexp.QuoteMeta(f.Name.Name))) - for _, c := range f.Doc.List { - if cgoExport.MatchString(c.Text) { - return true - } - } - return false -} - -var basicTypeKinds = map[types.BasicKind]string{ - types.UntypedBool: "bool", - types.UntypedInt: "int", - types.UntypedRune: "rune", - types.UntypedFloat: "float64", - types.UntypedComplex: "complex128", - types.UntypedString: "string", -} - -// isUntypedConst reports whether expr is an untyped constant, -// and indicates what its default type is. -// scope may be nil. -func (f *file) isUntypedConst(expr ast.Expr) (defType string, ok bool) { - // Re-evaluate expr outside of its context to see if it's untyped. - // (An expr evaluated within, for example, an assignment context will get the type of the LHS.) - exprStr := f.render(expr) - tv, err := types.Eval(f.fset, f.pkg.typesPkg, expr.Pos(), exprStr) - if err != nil { - return "", false - } - if b, ok := tv.Type.(*types.Basic); ok { - if dt, ok := basicTypeKinds[b.Kind()]; ok { - return dt, true - } - } - - return "", false -} - -// firstLineOf renders the given node and returns its first line. -// It will also match the indentation of another node. -func (f *file) firstLineOf(node, match ast.Node) string { - line := f.render(node) - if i := strings.Index(line, "\n"); i >= 0 { - line = line[:i] - } - return f.indentOf(match) + line -} - -func (f *file) indentOf(node ast.Node) string { - line := srcLine(f.src, f.fset.Position(node.Pos())) - for i, r := range line { - switch r { - case ' ', '\t': - default: - return line[:i] - } - } - return line // unusual or empty line -} - -func (f *file) srcLineWithMatch(node ast.Node, pattern string) (m []string) { - line := srcLine(f.src, f.fset.Position(node.Pos())) - line = strings.TrimSuffix(line, "\n") - rx := regexp.MustCompile(pattern) - return rx.FindStringSubmatch(line) -} - -// imports returns true if the current file imports the specified package path. -func (f *file) imports(importPath string) bool { - all := astutil.Imports(f.fset, f.f) - for _, p := range all { - for _, i := range p { - uq, err := strconv.Unquote(i.Path.Value) - if err == nil && importPath == uq { - return true - } - } - } - return false -} - -// srcLine returns the complete line at p, including the terminating newline. -func srcLine(src []byte, p token.Position) string { - // Run to end of line in both directions if not at line start/end. - lo, hi := p.Offset, p.Offset+1 - for lo > 0 && src[lo-1] != '\n' { - lo-- - } - for hi < len(src) && src[hi-1] != '\n' { - hi++ - } - return string(src[lo:hi]) -} diff --git a/ibm/vendor/golang.org/x/mod/LICENSE b/ibm/vendor/golang.org/x/mod/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/ibm/vendor/golang.org/x/mod/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/golang.org/x/mod/PATENTS b/ibm/vendor/golang.org/x/mod/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/ibm/vendor/golang.org/x/mod/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google 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, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/ibm/vendor/golang.org/x/mod/module/module.go b/ibm/vendor/golang.org/x/mod/module/module.go deleted file mode 100644 index 0e03014837..0000000000 --- a/ibm/vendor/golang.org/x/mod/module/module.go +++ /dev/null @@ -1,822 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package module defines the module.Version type along with support code. -// -// The module.Version type is a simple Path, Version pair: -// -// type Version struct { -// Path string -// Version string -// } -// -// There are no restrictions imposed directly by use of this structure, -// but additional checking functions, most notably Check, verify that -// a particular path, version pair is valid. -// -// Escaped Paths -// -// Module paths appear as substrings of file system paths -// (in the download cache) and of web server URLs in the proxy protocol. -// In general we cannot rely on file systems to be case-sensitive, -// nor can we rely on web servers, since they read from file systems. -// That is, we cannot rely on the file system to keep rsc.io/QUOTE -// and rsc.io/quote separate. Windows and macOS don't. -// Instead, we must never require two different casings of a file path. -// Because we want the download cache to match the proxy protocol, -// and because we want the proxy protocol to be possible to serve -// from a tree of static files (which might be stored on a case-insensitive -// file system), the proxy protocol must never require two different casings -// of a URL path either. -// -// One possibility would be to make the escaped form be the lowercase -// hexadecimal encoding of the actual path bytes. This would avoid ever -// needing different casings of a file path, but it would be fairly illegible -// to most programmers when those paths appeared in the file system -// (including in file paths in compiler errors and stack traces) -// in web server logs, and so on. Instead, we want a safe escaped form that -// leaves most paths unaltered. -// -// The safe escaped form is to replace every uppercase letter -// with an exclamation mark followed by the letter's lowercase equivalent. -// -// For example, -// -// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go. -// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy -// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus. -// -// Import paths that avoid upper-case letters are left unchanged. -// Note that because import paths are ASCII-only and avoid various -// problematic punctuation (like : < and >), the escaped form is also ASCII-only -// and avoids the same problematic punctuation. -// -// Import paths have never allowed exclamation marks, so there is no -// need to define how to escape a literal !. -// -// Unicode Restrictions -// -// Today, paths are disallowed from using Unicode. -// -// Although paths are currently disallowed from using Unicode, -// we would like at some point to allow Unicode letters as well, to assume that -// file systems and URLs are Unicode-safe (storing UTF-8), and apply -// the !-for-uppercase convention for escaping them in the file system. -// But there are at least two subtle considerations. -// -// First, note that not all case-fold equivalent distinct runes -// form an upper/lower pair. -// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin) -// are three distinct runes that case-fold to each other. -// When we do add Unicode letters, we must not assume that upper/lower -// are the only case-equivalent pairs. -// Perhaps the Kelvin symbol would be disallowed entirely, for example. -// Or perhaps it would escape as "!!k", or perhaps as "(212A)". -// -// Second, it would be nice to allow Unicode marks as well as letters, -// but marks include combining marks, and then we must deal not -// only with case folding but also normalization: both U+00E9 ('é') -// and U+0065 U+0301 ('e' followed by combining acute accent) -// look the same on the page and are treated by some file systems -// as the same path. If we do allow Unicode marks in paths, there -// must be some kind of normalization to allow only one canonical -// encoding of any character used in an import path. -package module - -// IMPORTANT NOTE -// -// This file essentially defines the set of valid import paths for the go command. -// There are many subtle considerations, including Unicode ambiguity, -// security, network, and file system representations. -// -// This file also defines the set of valid module path and version combinations, -// another topic with many subtle considerations. -// -// Changes to the semantics in this file require approval from rsc. - -import ( - "fmt" - "path" - "sort" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/mod/semver" - errors "golang.org/x/xerrors" -) - -// A Version (for clients, a module.Version) is defined by a module path and version pair. -// These are stored in their plain (unescaped) form. -type Version struct { - // Path is a module path, like "golang.org/x/text" or "rsc.io/quote/v2". - Path string - - // Version is usually a semantic version in canonical form. - // There are three exceptions to this general rule. - // First, the top-level target of a build has no specific version - // and uses Version = "". - // Second, during MVS calculations the version "none" is used - // to represent the decision to take no version of a given module. - // Third, filesystem paths found in "replace" directives are - // represented by a path with an empty version. - Version string `json:",omitempty"` -} - -// String returns a representation of the Version suitable for logging -// (Path@Version, or just Path if Version is empty). -func (m Version) String() string { - if m.Version == "" { - return m.Path - } - return m.Path + "@" + m.Version -} - -// A ModuleError indicates an error specific to a module. -type ModuleError struct { - Path string - Version string - Err error -} - -// VersionError returns a ModuleError derived from a Version and error, -// or err itself if it is already such an error. -func VersionError(v Version, err error) error { - var mErr *ModuleError - if errors.As(err, &mErr) && mErr.Path == v.Path && mErr.Version == v.Version { - return err - } - return &ModuleError{ - Path: v.Path, - Version: v.Version, - Err: err, - } -} - -func (e *ModuleError) Error() string { - if v, ok := e.Err.(*InvalidVersionError); ok { - return fmt.Sprintf("%s@%s: invalid %s: %v", e.Path, v.Version, v.noun(), v.Err) - } - if e.Version != "" { - return fmt.Sprintf("%s@%s: %v", e.Path, e.Version, e.Err) - } - return fmt.Sprintf("module %s: %v", e.Path, e.Err) -} - -func (e *ModuleError) Unwrap() error { return e.Err } - -// An InvalidVersionError indicates an error specific to a version, with the -// module path unknown or specified externally. -// -// A ModuleError may wrap an InvalidVersionError, but an InvalidVersionError -// must not wrap a ModuleError. -type InvalidVersionError struct { - Version string - Pseudo bool - Err error -} - -// noun returns either "version" or "pseudo-version", depending on whether -// e.Version is a pseudo-version. -func (e *InvalidVersionError) noun() string { - if e.Pseudo { - return "pseudo-version" - } - return "version" -} - -func (e *InvalidVersionError) Error() string { - return fmt.Sprintf("%s %q invalid: %s", e.noun(), e.Version, e.Err) -} - -func (e *InvalidVersionError) Unwrap() error { return e.Err } - -// Check checks that a given module path, version pair is valid. -// In addition to the path being a valid module path -// and the version being a valid semantic version, -// the two must correspond. -// For example, the path "yaml/v2" only corresponds to -// semantic versions beginning with "v2.". -func Check(path, version string) error { - if err := CheckPath(path); err != nil { - return err - } - if !semver.IsValid(version) { - return &ModuleError{ - Path: path, - Err: &InvalidVersionError{Version: version, Err: errors.New("not a semantic version")}, - } - } - _, pathMajor, _ := SplitPathVersion(path) - if err := CheckPathMajor(version, pathMajor); err != nil { - return &ModuleError{Path: path, Err: err} - } - return nil -} - -// firstPathOK reports whether r can appear in the first element of a module path. -// The first element of the path must be an LDH domain name, at least for now. -// To avoid case ambiguity, the domain name must be entirely lower case. -func firstPathOK(r rune) bool { - return r == '-' || r == '.' || - '0' <= r && r <= '9' || - 'a' <= r && r <= 'z' -} - -// modPathOK reports whether r can appear in a module path element. -// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. -// -// This matches what "go get" has historically recognized in import paths, -// and avoids confusing sequences like '%20' or '+' that would change meaning -// if used in a URL. -// -// TODO(rsc): We would like to allow Unicode letters, but that requires additional -// care in the safe encoding (see "escaped paths" above). -func modPathOK(r rune) bool { - if r < utf8.RuneSelf { - return r == '-' || r == '.' || r == '_' || r == '~' || - '0' <= r && r <= '9' || - 'A' <= r && r <= 'Z' || - 'a' <= r && r <= 'z' - } - return false -} - -// modPathOK reports whether r can appear in a package import path element. -// -// Import paths are intermediate between module paths and file paths: we allow -// disallow characters that would be confusing or ambiguous as arguments to -// 'go get' (such as '@' and ' ' ), but allow certain characters that are -// otherwise-unambiguous on the command line and historically used for some -// binary names (such as '++' as a suffix for compiler binaries and wrappers). -func importPathOK(r rune) bool { - return modPathOK(r) || r == '+' -} - -// fileNameOK reports whether r can appear in a file name. -// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. -// If we expand the set of allowed characters here, we have to -// work harder at detecting potential case-folding and normalization collisions. -// See note about "escaped paths" above. -func fileNameOK(r rune) bool { - if r < utf8.RuneSelf { - // Entire set of ASCII punctuation, from which we remove characters: - // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ - // We disallow some shell special characters: " ' * < > ? ` | - // (Note that some of those are disallowed by the Windows file system as well.) - // We also disallow path separators / : and \ (fileNameOK is only called on path element characters). - // We allow spaces (U+0020) in file names. - const allowed = "!#$%&()+,-.=@[]^_{}~ " - if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { - return true - } - for i := 0; i < len(allowed); i++ { - if rune(allowed[i]) == r { - return true - } - } - return false - } - // It may be OK to add more ASCII punctuation here, but only carefully. - // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. - return unicode.IsLetter(r) -} - -// CheckPath checks that a module path is valid. -// A valid module path is a valid import path, as checked by CheckImportPath, -// with three additional constraints. -// First, the leading path element (up to the first slash, if any), -// by convention a domain name, must contain only lower-case ASCII letters, -// ASCII digits, dots (U+002E), and dashes (U+002D); -// it must contain at least one dot and cannot start with a dash. -// Second, for a final path element of the form /vN, where N looks numeric -// (ASCII digits and dots) must not begin with a leading zero, must not be /v1, -// and must not contain any dots. For paths beginning with "gopkg.in/", -// this second requirement is replaced by a requirement that the path -// follow the gopkg.in server's conventions. -// Third, no path element may begin with a dot. -func CheckPath(path string) error { - if err := checkPath(path, modulePath); err != nil { - return fmt.Errorf("malformed module path %q: %v", path, err) - } - i := strings.Index(path, "/") - if i < 0 { - i = len(path) - } - if i == 0 { - return fmt.Errorf("malformed module path %q: leading slash", path) - } - if !strings.Contains(path[:i], ".") { - return fmt.Errorf("malformed module path %q: missing dot in first path element", path) - } - if path[0] == '-' { - return fmt.Errorf("malformed module path %q: leading dash in first path element", path) - } - for _, r := range path[:i] { - if !firstPathOK(r) { - return fmt.Errorf("malformed module path %q: invalid char %q in first path element", path, r) - } - } - if _, _, ok := SplitPathVersion(path); !ok { - return fmt.Errorf("malformed module path %q: invalid version", path) - } - return nil -} - -// CheckImportPath checks that an import path is valid. -// -// A valid import path consists of one or more valid path elements -// separated by slashes (U+002F). (It must not begin with nor end in a slash.) -// -// A valid path element is a non-empty string made up of -// ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. -// It must not end with a dot (U+002E), nor contain two dots in a row. -// -// The element prefix up to the first dot must not be a reserved file name -// on Windows, regardless of case (CON, com1, NuL, and so on). The element -// must not have a suffix of a tilde followed by one or more ASCII digits -// (to exclude paths elements that look like Windows short-names). -// -// CheckImportPath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckImportPath(path string) error { - if err := checkPath(path, importPath); err != nil { - return fmt.Errorf("malformed import path %q: %v", path, err) - } - return nil -} - -// pathKind indicates what kind of path we're checking. Module paths, -// import paths, and file paths have different restrictions. -type pathKind int - -const ( - modulePath pathKind = iota - importPath - filePath -) - -// checkPath checks that a general path is valid. -// It returns an error describing why but not mentioning path. -// Because these checks apply to both module paths and import paths, -// the caller is expected to add the "malformed ___ path %q: " prefix. -// fileName indicates whether the final element of the path is a file name -// (as opposed to a directory name). -func checkPath(path string, kind pathKind) error { - if !utf8.ValidString(path) { - return fmt.Errorf("invalid UTF-8") - } - if path == "" { - return fmt.Errorf("empty string") - } - if path[0] == '-' { - return fmt.Errorf("leading dash") - } - if strings.Contains(path, "//") { - return fmt.Errorf("double slash") - } - if path[len(path)-1] == '/' { - return fmt.Errorf("trailing slash") - } - elemStart := 0 - for i, r := range path { - if r == '/' { - if err := checkElem(path[elemStart:i], kind); err != nil { - return err - } - elemStart = i + 1 - } - } - if err := checkElem(path[elemStart:], kind); err != nil { - return err - } - return nil -} - -// checkElem checks whether an individual path element is valid. -func checkElem(elem string, kind pathKind) error { - if elem == "" { - return fmt.Errorf("empty path element") - } - if strings.Count(elem, ".") == len(elem) { - return fmt.Errorf("invalid path element %q", elem) - } - if elem[0] == '.' && kind == modulePath { - return fmt.Errorf("leading dot in path element") - } - if elem[len(elem)-1] == '.' { - return fmt.Errorf("trailing dot in path element") - } - for _, r := range elem { - ok := false - switch kind { - case modulePath: - ok = modPathOK(r) - case importPath: - ok = importPathOK(r) - case filePath: - ok = fileNameOK(r) - default: - panic(fmt.Sprintf("internal error: invalid kind %v", kind)) - } - if !ok { - return fmt.Errorf("invalid char %q", r) - } - } - - // Windows disallows a bunch of path elements, sadly. - // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file - short := elem - if i := strings.Index(short, "."); i >= 0 { - short = short[:i] - } - for _, bad := range badWindowsNames { - if strings.EqualFold(bad, short) { - return fmt.Errorf("%q disallowed as path element component on Windows", short) - } - } - - if kind == filePath { - // don't check for Windows short-names in file names. They're - // only an issue for import paths. - return nil - } - - // Reject path components that look like Windows short-names. - // Those usually end in a tilde followed by one or more ASCII digits. - if tilde := strings.LastIndexByte(short, '~'); tilde >= 0 && tilde < len(short)-1 { - suffix := short[tilde+1:] - suffixIsDigits := true - for _, r := range suffix { - if r < '0' || r > '9' { - suffixIsDigits = false - break - } - } - if suffixIsDigits { - return fmt.Errorf("trailing tilde and digits in path element") - } - } - - return nil -} - -// CheckFilePath checks that a slash-separated file path is valid. -// The definition of a valid file path is the same as the definition -// of a valid import path except that the set of allowed characters is larger: -// all Unicode letters, ASCII digits, the ASCII space character (U+0020), -// and the ASCII punctuation characters -// “!#$%&()+,-.=@[]^_{}~”. -// (The excluded punctuation characters, " * < > ? ` ' | / \ and :, -// have special meanings in certain shells or operating systems.) -// -// CheckFilePath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckFilePath(path string) error { - if err := checkPath(path, filePath); err != nil { - return fmt.Errorf("malformed file path %q: %v", path, err) - } - return nil -} - -// badWindowsNames are the reserved file path elements on Windows. -// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file -var badWindowsNames = []string{ - "CON", - "PRN", - "AUX", - "NUL", - "COM1", - "COM2", - "COM3", - "COM4", - "COM5", - "COM6", - "COM7", - "COM8", - "COM9", - "LPT1", - "LPT2", - "LPT3", - "LPT4", - "LPT5", - "LPT6", - "LPT7", - "LPT8", - "LPT9", -} - -// SplitPathVersion returns prefix and major version such that prefix+pathMajor == path -// and version is either empty or "/vN" for N >= 2. -// As a special case, gopkg.in paths are recognized directly; -// they require ".vN" instead of "/vN", and for all N, not just N >= 2. -// SplitPathVersion returns with ok = false when presented with -// a path whose last path element does not satisfy the constraints -// applied by CheckPath, such as "example.com/pkg/v1" or "example.com/pkg/v1.2". -func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { - if strings.HasPrefix(path, "gopkg.in/") { - return splitGopkgIn(path) - } - - i := len(path) - dot := false - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9' || path[i-1] == '.') { - if path[i-1] == '.' { - dot = true - } - i-- - } - if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' { - return path, "", true - } - prefix, pathMajor = path[:i-2], path[i-2:] - if dot || len(pathMajor) <= 2 || pathMajor[2] == '0' || pathMajor == "/v1" { - return path, "", false - } - return prefix, pathMajor, true -} - -// splitGopkgIn is like SplitPathVersion but only for gopkg.in paths. -func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) { - if !strings.HasPrefix(path, "gopkg.in/") { - return path, "", false - } - i := len(path) - if strings.HasSuffix(path, "-unstable") { - i -= len("-unstable") - } - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9') { - i-- - } - if i <= 1 || path[i-1] != 'v' || path[i-2] != '.' { - // All gopkg.in paths must end in vN for some N. - return path, "", false - } - prefix, pathMajor = path[:i-2], path[i-2:] - if len(pathMajor) <= 2 || pathMajor[2] == '0' && pathMajor != ".v0" { - return path, "", false - } - return prefix, pathMajor, true -} - -// MatchPathMajor reports whether the semantic version v -// matches the path major version pathMajor. -// -// MatchPathMajor returns true if and only if CheckPathMajor returns nil. -func MatchPathMajor(v, pathMajor string) bool { - return CheckPathMajor(v, pathMajor) == nil -} - -// CheckPathMajor returns a non-nil error if the semantic version v -// does not match the path major version pathMajor. -func CheckPathMajor(v, pathMajor string) error { - // TODO(jayconrod): return errors or panic for invalid inputs. This function - // (and others) was covered by integration tests for cmd/go, and surrounding - // code protected against invalid inputs like non-canonical versions. - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - if strings.HasPrefix(v, "v0.0.0-") && pathMajor == ".v1" { - // Allow old bug in pseudo-versions that generated v0.0.0- pseudoversion for gopkg .v1. - // For example, gopkg.in/yaml.v2@v2.2.1's go.mod requires gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405. - return nil - } - m := semver.Major(v) - if pathMajor == "" { - if m == "v0" || m == "v1" || semver.Build(v) == "+incompatible" { - return nil - } - pathMajor = "v0 or v1" - } else if pathMajor[0] == '/' || pathMajor[0] == '.' { - if m == pathMajor[1:] { - return nil - } - pathMajor = pathMajor[1:] - } - return &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("should be %s, not %s", pathMajor, semver.Major(v)), - } -} - -// PathMajorPrefix returns the major-version tag prefix implied by pathMajor. -// An empty PathMajorPrefix allows either v0 or v1. -// -// Note that MatchPathMajor may accept some versions that do not actually begin -// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1' -// pathMajor, even though that pathMajor implies 'v1' tagging. -func PathMajorPrefix(pathMajor string) string { - if pathMajor == "" { - return "" - } - if pathMajor[0] != '/' && pathMajor[0] != '.' { - panic("pathMajor suffix " + pathMajor + " passed to PathMajorPrefix lacks separator") - } - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - m := pathMajor[1:] - if m != semver.Major(m) { - panic("pathMajor suffix " + pathMajor + "passed to PathMajorPrefix is not a valid major version") - } - return m -} - -// CanonicalVersion returns the canonical form of the version string v. -// It is the same as semver.Canonical(v) except that it preserves the special build suffix "+incompatible". -func CanonicalVersion(v string) string { - cv := semver.Canonical(v) - if semver.Build(v) == "+incompatible" { - cv += "+incompatible" - } - return cv -} - -// Sort sorts the list by Path, breaking ties by comparing Version fields. -// The Version fields are interpreted as semantic versions (using semver.Compare) -// optionally followed by a tie-breaking suffix introduced by a slash character, -// like in "v0.0.1/go.mod". -func Sort(list []Version) { - sort.Slice(list, func(i, j int) bool { - mi := list[i] - mj := list[j] - if mi.Path != mj.Path { - return mi.Path < mj.Path - } - // To help go.sum formatting, allow version/file. - // Compare semver prefix by semver rules, - // file by string order. - vi := mi.Version - vj := mj.Version - var fi, fj string - if k := strings.Index(vi, "/"); k >= 0 { - vi, fi = vi[:k], vi[k:] - } - if k := strings.Index(vj, "/"); k >= 0 { - vj, fj = vj[:k], vj[k:] - } - if vi != vj { - return semver.Compare(vi, vj) < 0 - } - return fi < fj - }) -} - -// EscapePath returns the escaped form of the given module path. -// It fails if the module path is invalid. -func EscapePath(path string) (escaped string, err error) { - if err := CheckPath(path); err != nil { - return "", err - } - - return escapeString(path) -} - -// EscapeVersion returns the escaped form of the given module version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func EscapeVersion(v string) (escaped string, err error) { - if err := checkElem(v, filePath); err != nil || strings.Contains(v, "!") { - return "", &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("disallowed version string"), - } - } - return escapeString(v) -} - -func escapeString(s string) (escaped string, err error) { - haveUpper := false - for _, r := range s { - if r == '!' || r >= utf8.RuneSelf { - // This should be disallowed by CheckPath, but diagnose anyway. - // The correctness of the escaping loop below depends on it. - return "", fmt.Errorf("internal error: inconsistency in EscapePath") - } - if 'A' <= r && r <= 'Z' { - haveUpper = true - } - } - - if !haveUpper { - return s, nil - } - - var buf []byte - for _, r := range s { - if 'A' <= r && r <= 'Z' { - buf = append(buf, '!', byte(r+'a'-'A')) - } else { - buf = append(buf, byte(r)) - } - } - return string(buf), nil -} - -// UnescapePath returns the module path for the given escaped path. -// It fails if the escaped path is invalid or describes an invalid path. -func UnescapePath(escaped string) (path string, err error) { - path, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped module path %q", escaped) - } - if err := CheckPath(path); err != nil { - return "", fmt.Errorf("invalid escaped module path %q: %v", escaped, err) - } - return path, nil -} - -// UnescapeVersion returns the version string for the given escaped version. -// It fails if the escaped form is invalid or describes an invalid version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func UnescapeVersion(escaped string) (v string, err error) { - v, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped version %q", escaped) - } - if err := checkElem(v, filePath); err != nil { - return "", fmt.Errorf("invalid escaped version %q: %v", v, err) - } - return v, nil -} - -func unescapeString(escaped string) (string, bool) { - var buf []byte - - bang := false - for _, r := range escaped { - if r >= utf8.RuneSelf { - return "", false - } - if bang { - bang = false - if r < 'a' || 'z' < r { - return "", false - } - buf = append(buf, byte(r+'A'-'a')) - continue - } - if r == '!' { - bang = true - continue - } - if 'A' <= r && r <= 'Z' { - return "", false - } - buf = append(buf, byte(r)) - } - if bang { - return "", false - } - return string(buf), true -} - -// MatchPrefixPatterns reports whether any path prefix of target matches one of -// the glob patterns (as defined by path.Match) in the comma-separated globs -// list. This implements the algorithm used when matching a module path to the -// GOPRIVATE environment variable, as described by 'go help module-private'. -// -// It ignores any empty or malformed patterns in the list. -func MatchPrefixPatterns(globs, target string) bool { - for globs != "" { - // Extract next non-empty glob in comma-separated list. - var glob string - if i := strings.Index(globs, ","); i >= 0 { - glob, globs = globs[:i], globs[i+1:] - } else { - glob, globs = globs, "" - } - if glob == "" { - continue - } - - // A glob with N+1 path elements (N slashes) needs to be matched - // against the first N+1 path elements of target, - // which end just before the N+1'th slash. - n := strings.Count(glob, "/") - prefix := target - // Walk target, counting slashes, truncating at the N+1'th slash. - for i := 0; i < len(target); i++ { - if target[i] == '/' { - if n == 0 { - prefix = target[:i] - break - } - n-- - } - } - if n > 0 { - // Not enough prefix elements. - continue - } - matched, _ := path.Match(glob, prefix) - if matched { - return true - } - } - return false -} diff --git a/ibm/vendor/golang.org/x/mod/semver/semver.go b/ibm/vendor/golang.org/x/mod/semver/semver.go deleted file mode 100644 index 4338f35177..0000000000 --- a/ibm/vendor/golang.org/x/mod/semver/semver.go +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package semver implements comparison of semantic version strings. -// In this package, semantic version strings must begin with a leading "v", -// as in "v1.0.0". -// -// The general form of a semantic version string accepted by this package is -// -// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] -// -// where square brackets indicate optional parts of the syntax; -// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; -// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers -// using only alphanumeric characters and hyphens; and -// all-numeric PRERELEASE identifiers must not have leading zeros. -// -// This package follows Semantic Versioning 2.0.0 (see semver.org) -// with two exceptions. First, it requires the "v" prefix. Second, it recognizes -// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) -// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. -package semver - -// parsed returns the parsed form of a semantic version string. -type parsed struct { - major string - minor string - patch string - short string - prerelease string - build string - err string -} - -// IsValid reports whether v is a valid semantic version string. -func IsValid(v string) bool { - _, ok := parse(v) - return ok -} - -// Canonical returns the canonical formatting of the semantic version v. -// It fills in any missing .MINOR or .PATCH and discards build metadata. -// Two semantic versions compare equal only if their canonical formattings -// are identical strings. -// The canonical invalid semantic version is the empty string. -func Canonical(v string) string { - p, ok := parse(v) - if !ok { - return "" - } - if p.build != "" { - return v[:len(v)-len(p.build)] - } - if p.short != "" { - return v + p.short - } - return v -} - -// Major returns the major version prefix of the semantic version v. -// For example, Major("v2.1.0") == "v2". -// If v is an invalid semantic version string, Major returns the empty string. -func Major(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return v[:1+len(pv.major)] -} - -// MajorMinor returns the major.minor version prefix of the semantic version v. -// For example, MajorMinor("v2.1.0") == "v2.1". -// If v is an invalid semantic version string, MajorMinor returns the empty string. -func MajorMinor(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - i := 1 + len(pv.major) - if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { - return v[:j] - } - return v[:i] + "." + pv.minor -} - -// Prerelease returns the prerelease suffix of the semantic version v. -// For example, Prerelease("v2.1.0-pre+meta") == "-pre". -// If v is an invalid semantic version string, Prerelease returns the empty string. -func Prerelease(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.prerelease -} - -// Build returns the build suffix of the semantic version v. -// For example, Build("v2.1.0+meta") == "+meta". -// If v is an invalid semantic version string, Build returns the empty string. -func Build(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.build -} - -// Compare returns an integer comparing two versions according to -// semantic version precedence. -// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. -// -// An invalid semantic version string is considered less than a valid one. -// All invalid semantic version strings compare equal to each other. -func Compare(v, w string) int { - pv, ok1 := parse(v) - pw, ok2 := parse(w) - if !ok1 && !ok2 { - return 0 - } - if !ok1 { - return -1 - } - if !ok2 { - return +1 - } - if c := compareInt(pv.major, pw.major); c != 0 { - return c - } - if c := compareInt(pv.minor, pw.minor); c != 0 { - return c - } - if c := compareInt(pv.patch, pw.patch); c != 0 { - return c - } - return comparePrerelease(pv.prerelease, pw.prerelease) -} - -// Max canonicalizes its arguments and then returns the version string -// that compares greater. -// -// Deprecated: use Compare instead. In most cases, returning a canonicalized -// version is not expected or desired. -func Max(v, w string) string { - v = Canonical(v) - w = Canonical(w) - if Compare(v, w) > 0 { - return v - } - return w -} - -func parse(v string) (p parsed, ok bool) { - if v == "" || v[0] != 'v' { - p.err = "missing v prefix" - return - } - p.major, v, ok = parseInt(v[1:]) - if !ok { - p.err = "bad major version" - return - } - if v == "" { - p.minor = "0" - p.patch = "0" - p.short = ".0.0" - return - } - if v[0] != '.' { - p.err = "bad minor prefix" - ok = false - return - } - p.minor, v, ok = parseInt(v[1:]) - if !ok { - p.err = "bad minor version" - return - } - if v == "" { - p.patch = "0" - p.short = ".0" - return - } - if v[0] != '.' { - p.err = "bad patch prefix" - ok = false - return - } - p.patch, v, ok = parseInt(v[1:]) - if !ok { - p.err = "bad patch version" - return - } - if len(v) > 0 && v[0] == '-' { - p.prerelease, v, ok = parsePrerelease(v) - if !ok { - p.err = "bad prerelease" - return - } - } - if len(v) > 0 && v[0] == '+' { - p.build, v, ok = parseBuild(v) - if !ok { - p.err = "bad build" - return - } - } - if v != "" { - p.err = "junk on end" - ok = false - return - } - ok = true - return -} - -func parseInt(v string) (t, rest string, ok bool) { - if v == "" { - return - } - if v[0] < '0' || '9' < v[0] { - return - } - i := 1 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - if v[0] == '0' && i != 1 { - return - } - return v[:i], v[i:], true -} - -func parsePrerelease(v string) (t, rest string, ok bool) { - // "A pre-release version MAY be denoted by appending a hyphen and - // a series of dot separated identifiers immediately following the patch version. - // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. - // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." - if v == "" || v[0] != '-' { - return - } - i := 1 - start := 1 - for i < len(v) && v[i] != '+' { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i || isBadNum(v[start:i]) { - return - } - start = i + 1 - } - i++ - } - if start == i || isBadNum(v[start:i]) { - return - } - return v[:i], v[i:], true -} - -func parseBuild(v string) (t, rest string, ok bool) { - if v == "" || v[0] != '+' { - return - } - i := 1 - start := 1 - for i < len(v) { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i { - return - } - start = i + 1 - } - i++ - } - if start == i { - return - } - return v[:i], v[i:], true -} - -func isIdentChar(c byte) bool { - return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' -} - -func isBadNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) && i > 1 && v[0] == '0' -} - -func isNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) -} - -func compareInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} - -func comparePrerelease(x, y string) int { - // "When major, minor, and patch are equal, a pre-release version has - // lower precedence than a normal version. - // Example: 1.0.0-alpha < 1.0.0. - // Precedence for two pre-release versions with the same major, minor, - // and patch version MUST be determined by comparing each dot separated - // identifier from left to right until a difference is found as follows: - // identifiers consisting of only digits are compared numerically and - // identifiers with letters or hyphens are compared lexically in ASCII - // sort order. Numeric identifiers always have lower precedence than - // non-numeric identifiers. A larger set of pre-release fields has a - // higher precedence than a smaller set, if all of the preceding - // identifiers are equal. - // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < - // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." - if x == y { - return 0 - } - if x == "" { - return +1 - } - if y == "" { - return -1 - } - for x != "" && y != "" { - x = x[1:] // skip - or . - y = y[1:] // skip - or . - var dx, dy string - dx, x = nextIdent(x) - dy, y = nextIdent(y) - if dx != dy { - ix := isNum(dx) - iy := isNum(dy) - if ix != iy { - if ix { - return -1 - } else { - return +1 - } - } - if ix { - if len(dx) < len(dy) { - return -1 - } - if len(dx) > len(dy) { - return +1 - } - } - if dx < dy { - return -1 - } else { - return +1 - } - } - } - if x == "" { - return -1 - } else { - return +1 - } -} - -func nextIdent(x string) (dx, rest string) { - i := 0 - for i < len(x) && x[i] != '.' { - i++ - } - return x[:i], x[i:] -} diff --git a/ibm/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/ibm/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go deleted file mode 100644 index 37dc0cfdb5..0000000000 --- a/ibm/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ctxhttp provides helper functions for performing context-aware HTTP requests. -package ctxhttp // import "golang.org/x/net/context/ctxhttp" - -import ( - "context" - "io" - "net/http" - "net/url" - "strings" -) - -// Do sends an HTTP request with the provided http.Client and returns -// an HTTP response. -// -// If the client is nil, http.DefaultClient is used. -// -// The provided ctx must be non-nil. If it is canceled or times out, -// ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - resp, err := client.Do(req.WithContext(ctx)) - // If we got an error, and the context has been canceled, - // the context's error is probably more useful. - if err != nil { - select { - case <-ctx.Done(): - err = ctx.Err() - default: - } - } - return resp, err -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} diff --git a/ibm/vendor/golang.org/x/net/http2/README b/ibm/vendor/golang.org/x/net/http2/README deleted file mode 100644 index 360d5aa379..0000000000 --- a/ibm/vendor/golang.org/x/net/http2/README +++ /dev/null @@ -1,20 +0,0 @@ -This is a work-in-progress HTTP/2 implementation for Go. - -It will eventually live in the Go standard library and won't require -any changes to your code to use. It will just be automatic. - -Status: - -* The server support is pretty good. A few things are missing - but are being worked on. -* The client work has just started but shares a lot of code - is coming along much quicker. - -Docs are at https://godoc.org/golang.org/x/net/http2 - -Demo test server at https://http2.golang.org/ - -Help & bug reports welcome! - -Contributing: https://golang.org/doc/contribute.html -Bugs: https://golang.org/issue/new?title=x/net/http2:+ diff --git a/ibm/vendor/golang.org/x/net/http2/client_conn_pool.go b/ibm/vendor/golang.org/x/net/http2/client_conn_pool.go index 652bc11a02..c936843eaf 100644 --- a/ibm/vendor/golang.org/x/net/http2/client_conn_pool.go +++ b/ibm/vendor/golang.org/x/net/http2/client_conn_pool.go @@ -16,6 +16,12 @@ import ( // ClientConnPool manages a pool of HTTP/2 client connections. type ClientConnPool interface { + // GetClientConn returns a specific HTTP/2 connection (usually + // a TLS-TCP connection) to an HTTP/2 server. On success, the + // returned ClientConn accounts for the upcoming RoundTrip + // call, so the caller should not omit it. If the caller needs + // to, ClientConn.RoundTrip can be called with a bogus + // new(http.Request) to release the stream reservation. GetClientConn(req *http.Request, addr string) (*ClientConn, error) MarkDead(*ClientConn) } @@ -42,7 +48,7 @@ type clientConnPool struct { conns map[string][]*ClientConn // key is host:port dialing map[string]*dialCall // currently in-flight dials keys map[*ClientConn][]string - addConnCalls map[string]*addConnCall // in-flight addConnIfNeede calls + addConnCalls map[string]*addConnCall // in-flight addConnIfNeeded calls } func (p *clientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { @@ -54,28 +60,8 @@ const ( noDialOnMiss = false ) -// shouldTraceGetConn reports whether getClientConn should call any -// ClientTrace.GetConn hook associated with the http.Request. -// -// This complexity is needed to avoid double calls of the GetConn hook -// during the back-and-forth between net/http and x/net/http2 (when the -// net/http.Transport is upgraded to also speak http2), as well as support -// the case where x/net/http2 is being used directly. -func (p *clientConnPool) shouldTraceGetConn(st clientConnIdleState) bool { - // If our Transport wasn't made via ConfigureTransport, always - // trace the GetConn hook if provided, because that means the - // http2 package is being used directly and it's the one - // dialing, as opposed to net/http. - if _, ok := p.t.ConnPool.(noDialClientConnPool); !ok { - return true - } - // Otherwise, only use the GetConn hook if this connection has - // been used previously for other requests. For fresh - // connections, the net/http package does the dialing. - return !st.freshConn -} - func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) { + // TODO(dneil): Dial a new connection when t.DisableKeepAlives is set? if isConnectionCloseRequest(req) && dialOnMiss { // It gets its own connection. traceGetConn(req, addr) @@ -89,10 +75,14 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis for { p.mu.Lock() for _, cc := range p.conns[addr] { - if st := cc.idleState(); st.canTakeNewRequest { - if p.shouldTraceGetConn(st) { + if cc.ReserveNewRequest() { + // When a connection is presented to us by the net/http package, + // the GetConn hook has already been called. + // Don't call it a second time here. + if !cc.getConnCalled { traceGetConn(req, addr) } + cc.getConnCalled = false p.mu.Unlock() return cc, nil } @@ -108,7 +98,13 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis if shouldRetryDial(call, req) { continue } - return call.res, call.err + cc, err := call.res, call.err + if err != nil { + return nil, err + } + if cc.ReserveNewRequest() { + return cc, nil + } } } @@ -205,6 +201,7 @@ func (c *addConnCall) run(t *Transport, key string, tc *tls.Conn) { if err != nil { c.err = err } else { + cc.getConnCalled = true // already called by the net/http package p.addConnLocked(key, cc) } delete(p.addConnCalls, key) diff --git a/ibm/vendor/golang.org/x/net/http2/errors.go b/ibm/vendor/golang.org/x/net/http2/errors.go index 71f2c46317..2663e5d287 100644 --- a/ibm/vendor/golang.org/x/net/http2/errors.go +++ b/ibm/vendor/golang.org/x/net/http2/errors.go @@ -53,6 +53,13 @@ func (e ErrCode) String() string { return fmt.Sprintf("unknown error code 0x%x", uint32(e)) } +func (e ErrCode) stringToken() string { + if s, ok := errCodeName[e]; ok { + return s + } + return fmt.Sprintf("ERR_UNKNOWN_%d", uint32(e)) +} + // ConnectionError is an error that results in the termination of the // entire connection. type ConnectionError ErrCode @@ -67,6 +74,11 @@ type StreamError struct { Cause error // optional additional detail } +// errFromPeer is a sentinel error value for StreamError.Cause to +// indicate that the StreamError was sent from the peer over the wire +// and wasn't locally generated in the Transport. +var errFromPeer = errors.New("received from peer") + func streamError(id uint32, code ErrCode) StreamError { return StreamError{StreamID: id, Code: code} } diff --git a/ibm/vendor/golang.org/x/net/http2/frame.go b/ibm/vendor/golang.org/x/net/http2/frame.go index 514c126c5f..96a7479052 100644 --- a/ibm/vendor/golang.org/x/net/http2/frame.go +++ b/ibm/vendor/golang.org/x/net/http2/frame.go @@ -122,7 +122,7 @@ var flagName = map[FrameType]map[Flags]string{ // a frameParser parses a frame given its FrameHeader and payload // bytes. The length of payload will always equal fh.Length (which // might be 0). -type frameParser func(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) +type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) var frameParsers = map[FrameType]frameParser{ FrameData: parseDataFrame, @@ -267,6 +267,11 @@ type Framer struct { lastFrame Frame errDetail error + // countError is a non-nil func that's called on a frame parse + // error with some unique error path token. It's initialized + // from Transport.CountError or Server.CountError. + countError func(errToken string) + // lastHeaderStream is non-zero if the last frame was an // unfinished HEADERS/CONTINUATION. lastHeaderStream uint32 @@ -426,6 +431,7 @@ func NewFramer(w io.Writer, r io.Reader) *Framer { fr := &Framer{ w: w, r: r, + countError: func(string) {}, logReads: logFrameReads, logWrites: logFrameWrites, debugReadLoggerf: log.Printf, @@ -500,7 +506,7 @@ func (fr *Framer) ReadFrame() (Frame, error) { if _, err := io.ReadFull(fr.r, payload); err != nil { return nil, err } - f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, payload) + f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, fr.countError, payload) if err != nil { if ce, ok := err.(connError); ok { return nil, fr.connError(ce.Code, ce.Reason) @@ -588,13 +594,14 @@ func (f *DataFrame) Data() []byte { return f.data } -func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) { +func parseDataFrame(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID == 0 { // DATA frames MUST be associated with a stream. If a // DATA frame is received whose stream identifier // field is 0x0, the recipient MUST respond with a // connection error (Section 5.4.1) of type // PROTOCOL_ERROR. + countError("frame_data_stream_0") return nil, connError{ErrCodeProtocol, "DATA frame with stream ID 0"} } f := fc.getDataFrame() @@ -605,6 +612,7 @@ func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, erro var err error payload, padSize, err = readByte(payload) if err != nil { + countError("frame_data_pad_byte_short") return nil, err } } @@ -613,6 +621,7 @@ func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, erro // length of the frame payload, the recipient MUST // treat this as a connection error. // Filed: https://github.com/http2/http2-spec/issues/610 + countError("frame_data_pad_too_big") return nil, connError{ErrCodeProtocol, "pad size larger than data payload"} } f.data = payload[:len(payload)-int(padSize)] @@ -695,7 +704,7 @@ type SettingsFrame struct { p []byte } -func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseSettingsFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 { // When this (ACK 0x1) bit is set, the payload of the // SETTINGS frame MUST be empty. Receipt of a @@ -703,6 +712,7 @@ func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) // field value other than 0 MUST be treated as a // connection error (Section 5.4.1) of type // FRAME_SIZE_ERROR. + countError("frame_settings_ack_with_length") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { @@ -713,14 +723,17 @@ func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) // field is anything other than 0x0, the endpoint MUST // respond with a connection error (Section 5.4.1) of // type PROTOCOL_ERROR. + countError("frame_settings_has_stream") return nil, ConnectionError(ErrCodeProtocol) } if len(p)%6 != 0 { + countError("frame_settings_mod_6") // Expecting even number of 6 byte settings. return nil, ConnectionError(ErrCodeFrameSize) } f := &SettingsFrame{FrameHeader: fh, p: p} if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 { + countError("frame_settings_window_size_too_big") // Values above the maximum flow control window size of 2^31 - 1 MUST // be treated as a connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR. @@ -832,11 +845,13 @@ type PingFrame struct { func (f *PingFrame) IsAck() bool { return f.Flags.Has(FlagPingAck) } -func parsePingFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) { +func parsePingFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if len(payload) != 8 { + countError("frame_ping_length") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { + countError("frame_ping_has_stream") return nil, ConnectionError(ErrCodeProtocol) } f := &PingFrame{FrameHeader: fh} @@ -872,11 +887,13 @@ func (f *GoAwayFrame) DebugData() []byte { return f.debugData } -func parseGoAwayFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseGoAwayFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.StreamID != 0 { + countError("frame_goaway_has_stream") return nil, ConnectionError(ErrCodeProtocol) } if len(p) < 8 { + countError("frame_goaway_short") return nil, ConnectionError(ErrCodeFrameSize) } return &GoAwayFrame{ @@ -912,7 +929,7 @@ func (f *UnknownFrame) Payload() []byte { return f.p } -func parseUnknownFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseUnknownFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { return &UnknownFrame{fh, p}, nil } @@ -923,8 +940,9 @@ type WindowUpdateFrame struct { Increment uint32 // never read with high bit set } -func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if len(p) != 4 { + countError("frame_windowupdate_bad_len") return nil, ConnectionError(ErrCodeFrameSize) } inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit @@ -936,8 +954,10 @@ func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, err // control window MUST be treated as a connection // error (Section 5.4.1). if fh.StreamID == 0 { + countError("frame_windowupdate_zero_inc_conn") return nil, ConnectionError(ErrCodeProtocol) } + countError("frame_windowupdate_zero_inc_stream") return nil, streamError(fh.StreamID, ErrCodeProtocol) } return &WindowUpdateFrame{ @@ -988,7 +1008,7 @@ func (f *HeadersFrame) HasPriority() bool { return f.FrameHeader.Flags.Has(FlagHeadersPriority) } -func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) { +func parseHeadersFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { hf := &HeadersFrame{ FrameHeader: fh, } @@ -997,11 +1017,13 @@ func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err er // is received whose stream identifier field is 0x0, the recipient MUST // respond with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR. + countError("frame_headers_zero_stream") return nil, connError{ErrCodeProtocol, "HEADERS frame with stream ID 0"} } var padLength uint8 if fh.Flags.Has(FlagHeadersPadded) { if p, padLength, err = readByte(p); err != nil { + countError("frame_headers_pad_short") return } } @@ -1009,16 +1031,19 @@ func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err er var v uint32 p, v, err = readUint32(p) if err != nil { + countError("frame_headers_prio_short") return nil, err } hf.Priority.StreamDep = v & 0x7fffffff hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set p, hf.Priority.Weight, err = readByte(p) if err != nil { + countError("frame_headers_prio_weight_short") return nil, err } } - if len(p)-int(padLength) <= 0 { + if len(p)-int(padLength) < 0 { + countError("frame_headers_pad_too_big") return nil, streamError(fh.StreamID, ErrCodeProtocol) } hf.headerFragBuf = p[:len(p)-int(padLength)] @@ -1125,11 +1150,13 @@ func (p PriorityParam) IsZero() bool { return p == PriorityParam{} } -func parsePriorityFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) { +func parsePriorityFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID == 0 { + countError("frame_priority_zero_stream") return nil, connError{ErrCodeProtocol, "PRIORITY frame with stream ID 0"} } if len(payload) != 5 { + countError("frame_priority_bad_length") return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY frame payload size was %d; want 5", len(payload))} } v := binary.BigEndian.Uint32(payload[:4]) @@ -1172,11 +1199,13 @@ type RSTStreamFrame struct { ErrCode ErrCode } -func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if len(p) != 4 { + countError("frame_rststream_bad_len") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID == 0 { + countError("frame_rststream_zero_stream") return nil, ConnectionError(ErrCodeProtocol) } return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil @@ -1202,8 +1231,9 @@ type ContinuationFrame struct { headerFragBuf []byte } -func parseContinuationFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseContinuationFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.StreamID == 0 { + countError("frame_continuation_zero_stream") return nil, connError{ErrCodeProtocol, "CONTINUATION frame with stream ID 0"} } return &ContinuationFrame{fh, p}, nil @@ -1252,7 +1282,7 @@ func (f *PushPromiseFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders) } -func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) { +func parsePushPromise(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { pp := &PushPromiseFrame{ FrameHeader: fh, } @@ -1263,6 +1293,7 @@ func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err err // with. If the stream identifier field specifies the value // 0x0, a recipient MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. + countError("frame_pushpromise_zero_stream") return nil, ConnectionError(ErrCodeProtocol) } // The PUSH_PROMISE frame includes optional padding. @@ -1270,18 +1301,21 @@ func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err err var padLength uint8 if fh.Flags.Has(FlagPushPromisePadded) { if p, padLength, err = readByte(p); err != nil { + countError("frame_pushpromise_pad_short") return } } p, pp.PromiseID, err = readUint32(p) if err != nil { + countError("frame_pushpromise_promiseid_short") return } pp.PromiseID = pp.PromiseID & (1<<31 - 1) if int(padLength) > len(p) { // like the DATA frame, error out if padding is longer than the body. + countError("frame_pushpromise_pad_too_big") return nil, ConnectionError(ErrCodeProtocol) } pp.headerFragBuf = p[:len(p)-int(padLength)] diff --git a/ibm/vendor/golang.org/x/net/http2/go118.go b/ibm/vendor/golang.org/x/net/http2/go118.go new file mode 100644 index 0000000000..aca4b2b31a --- /dev/null +++ b/ibm/vendor/golang.org/x/net/http2/go118.go @@ -0,0 +1,17 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.18 +// +build go1.18 + +package http2 + +import ( + "crypto/tls" + "net" +) + +func tlsUnderlyingConn(tc *tls.Conn) net.Conn { + return tc.NetConn() +} diff --git a/ibm/vendor/golang.org/x/net/http2/hpack/huffman.go b/ibm/vendor/golang.org/x/net/http2/hpack/huffman.go index a1ab2f0567..fe0b84ccd4 100644 --- a/ibm/vendor/golang.org/x/net/http2/hpack/huffman.go +++ b/ibm/vendor/golang.org/x/net/http2/hpack/huffman.go @@ -140,25 +140,29 @@ func buildRootHuffmanNode() { panic("unexpected size") } lazyRootHuffmanNode = newInternalNode() - for i, code := range huffmanCodes { - addDecoderNode(byte(i), code, huffmanCodeLen[i]) - } -} + // allocate a leaf node for each of the 256 symbols + leaves := new([256]node) + + for sym, code := range huffmanCodes { + codeLen := huffmanCodeLen[sym] + + cur := lazyRootHuffmanNode + for codeLen > 8 { + codeLen -= 8 + i := uint8(code >> codeLen) + if cur.children[i] == nil { + cur.children[i] = newInternalNode() + } + cur = cur.children[i] + } + shift := 8 - codeLen + start, end := int(uint8(code< 8 { - codeLen -= 8 - i := uint8(code >> codeLen) - if cur.children[i] == nil { - cur.children[i] = newInternalNode() + leaves[sym].sym = byte(sym) + leaves[sym].codeLen = codeLen + for i := start; i < start+end; i++ { + cur.children[i] = &leaves[sym] } - cur = cur.children[i] - } - shift := 8 - codeLen - start, end := int(uint8(code< 0 { // Check whether the client has flow control quota. if st.inflow.available() < int32(f.Length) { - return streamError(id, ErrCodeFlowControl) + return sc.countError("flow_on_data_length", streamError(id, ErrCodeFlowControl)) } st.inflow.take(int32(f.Length)) @@ -1701,7 +1727,7 @@ func (sc *serverConn) processData(f *DataFrame) error { wrote, err := st.body.Write(data) if err != nil { sc.sendWindowUpdate(nil, int(f.Length)-wrote) - return streamError(id, ErrCodeStreamClosed) + return sc.countError("body_write_err", streamError(id, ErrCodeStreamClosed)) } if wrote != len(data) { panic("internal error: bad Writer") @@ -1787,7 +1813,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // stream identifier MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. if id%2 != 1 { - return ConnectionError(ErrCodeProtocol) + return sc.countError("headers_even", ConnectionError(ErrCodeProtocol)) } // A HEADERS frame can be used to create a new stream or // send a trailer for an open one. If we already have a stream @@ -1804,7 +1830,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // this state, it MUST respond with a stream error (Section 5.4.2) of // type STREAM_CLOSED. if st.state == stateHalfClosedRemote { - return streamError(id, ErrCodeStreamClosed) + return sc.countError("headers_half_closed", streamError(id, ErrCodeStreamClosed)) } return st.processTrailerHeaders(f) } @@ -1815,7 +1841,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // receives an unexpected stream identifier MUST respond with // a connection error (Section 5.4.1) of type PROTOCOL_ERROR. if id <= sc.maxClientStreamID { - return ConnectionError(ErrCodeProtocol) + return sc.countError("stream_went_down", ConnectionError(ErrCodeProtocol)) } sc.maxClientStreamID = id @@ -1832,14 +1858,14 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { if sc.curClientStreams+1 > sc.advMaxStreams { if sc.unackedSettings == 0 { // They should know better. - return streamError(id, ErrCodeProtocol) + return sc.countError("over_max_streams", streamError(id, ErrCodeProtocol)) } // Assume it's a network race, where they just haven't // received our last SETTINGS update. But actually // this can't happen yet, because we don't yet provide // a way for users to adjust server parameters at // runtime. - return streamError(id, ErrCodeRefusedStream) + return sc.countError("over_max_streams_race", streamError(id, ErrCodeRefusedStream)) } initialState := stateOpen @@ -1849,7 +1875,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { st := sc.newStream(id, 0, initialState) if f.HasPriority() { - if err := checkPriority(f.StreamID, f.Priority); err != nil { + if err := sc.checkPriority(f.StreamID, f.Priority); err != nil { return err } sc.writeSched.AdjustStream(st.id, f.Priority) @@ -1893,15 +1919,15 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { sc := st.sc sc.serveG.check() if st.gotTrailerHeader { - return ConnectionError(ErrCodeProtocol) + return sc.countError("dup_trailers", ConnectionError(ErrCodeProtocol)) } st.gotTrailerHeader = true if !f.StreamEnded() { - return streamError(st.id, ErrCodeProtocol) + return sc.countError("trailers_not_ended", streamError(st.id, ErrCodeProtocol)) } if len(f.PseudoFields()) > 0 { - return streamError(st.id, ErrCodeProtocol) + return sc.countError("trailers_pseudo", streamError(st.id, ErrCodeProtocol)) } if st.trailer != nil { for _, hf := range f.RegularFields() { @@ -1910,7 +1936,7 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { // TODO: send more details to the peer somehow. But http2 has // no way to send debug data at a stream level. Discuss with // HTTP folk. - return streamError(st.id, ErrCodeProtocol) + return sc.countError("trailers_bogus", streamError(st.id, ErrCodeProtocol)) } st.trailer[key] = append(st.trailer[key], hf.Value) } @@ -1919,13 +1945,13 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { return nil } -func checkPriority(streamID uint32, p PriorityParam) error { +func (sc *serverConn) checkPriority(streamID uint32, p PriorityParam) error { if streamID == p.StreamDep { // Section 5.3.1: "A stream cannot depend on itself. An endpoint MUST treat // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR." // Section 5.3.3 says that a stream can depend on one of its dependencies, // so it's only self-dependencies that are forbidden. - return streamError(streamID, ErrCodeProtocol) + return sc.countError("priority", streamError(streamID, ErrCodeProtocol)) } return nil } @@ -1934,7 +1960,7 @@ func (sc *serverConn) processPriority(f *PriorityFrame) error { if sc.inGoAway { return nil } - if err := checkPriority(f.StreamID, f.PriorityParam); err != nil { + if err := sc.checkPriority(f.StreamID, f.PriorityParam); err != nil { return err } sc.writeSched.AdjustStream(f.StreamID, f.PriorityParam) @@ -1991,7 +2017,7 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res isConnect := rp.method == "CONNECT" if isConnect { if rp.path != "" || rp.scheme != "" || rp.authority == "" { - return nil, nil, streamError(f.StreamID, ErrCodeProtocol) + return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) } } else if rp.method == "" || rp.path == "" || (rp.scheme != "https" && rp.scheme != "http") { // See 8.1.2.6 Malformed Requests and Responses: @@ -2004,13 +2030,13 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res // "All HTTP/2 requests MUST include exactly one valid // value for the :method, :scheme, and :path // pseudo-header fields" - return nil, nil, streamError(f.StreamID, ErrCodeProtocol) + return nil, nil, sc.countError("bad_path_method", streamError(f.StreamID, ErrCodeProtocol)) } bodyOpen := !f.StreamEnded() if rp.method == "HEAD" && bodyOpen { // HEAD requests can't have bodies - return nil, nil, streamError(f.StreamID, ErrCodeProtocol) + return nil, nil, sc.countError("head_body", streamError(f.StreamID, ErrCodeProtocol)) } rp.header = make(http.Header) @@ -2093,7 +2119,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*r var err error url_, err = url.ParseRequestURI(rp.path) if err != nil { - return nil, nil, streamError(st.id, ErrCodeProtocol) + return nil, nil, sc.countError("bad_path", streamError(st.id, ErrCodeProtocol)) } requestURI = rp.path } @@ -2976,3 +3002,31 @@ func h1ServerKeepAlivesDisabled(hs *http.Server) bool { } return false } + +func (sc *serverConn) countError(name string, err error) error { + if sc == nil || sc.srv == nil { + return err + } + f := sc.srv.CountError + if f == nil { + return err + } + var typ string + var code ErrCode + switch e := err.(type) { + case ConnectionError: + typ = "conn" + code = ErrCode(e) + case StreamError: + typ = "stream" + code = ErrCode(e.Code) + default: + return err + } + codeStr := errCodeName[code] + if codeStr == "" { + codeStr = strconv.Itoa(int(code)) + } + f(fmt.Sprintf("%s_%s_%s", typ, codeStr, name)) + return err +} diff --git a/ibm/vendor/golang.org/x/net/http2/transport.go b/ibm/vendor/golang.org/x/net/http2/transport.go index b97adff7d0..4f09897637 100644 --- a/ibm/vendor/golang.org/x/net/http2/transport.go +++ b/ibm/vendor/golang.org/x/net/http2/transport.go @@ -24,6 +24,7 @@ import ( "net/http" "net/http/httptrace" "net/textproto" + "os" "sort" "strconv" "strings" @@ -51,6 +52,15 @@ const ( transportDefaultStreamMinRefresh = 4 << 10 defaultUserAgent = "Go-http-client/2.0" + + // initialMaxConcurrentStreams is a connections maxConcurrentStreams until + // it's received servers initial SETTINGS frame, which corresponds with the + // spec's minimum recommended value. + initialMaxConcurrentStreams = 100 + + // defaultMaxConcurrentStreams is a connections default maxConcurrentStreams + // if the server doesn't include one in its initial SETTINGS frame. + defaultMaxConcurrentStreams = 1000 ) // Transport is an HTTP/2 Transport. @@ -121,6 +131,17 @@ type Transport struct { // Defaults to 15s. PingTimeout time.Duration + // WriteByteTimeout is the timeout after which the connection will be + // closed no data can be written to it. The timeout begins when data is + // available to write, and is extended whenever any bytes are written. + WriteByteTimeout time.Duration + + // CountError, if non-nil, is called on HTTP/2 transport errors. + // It's intended to increment a metric for monitoring, such + // as an expvar or Prometheus metric. + // The errType consists of only ASCII word characters. + CountError func(errType string) + // t1, if non-nil, is the standard library Transport using // this transport. Its settings are used (but not its // RoundTrip method, etc). @@ -227,11 +248,12 @@ func (t *Transport) initConnPool() { // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. type ClientConn struct { - t *Transport - tconn net.Conn // usually *tls.Conn, except specialized impls - tlsState *tls.ConnectionState // nil only for specialized impls - reused uint32 // whether conn is being reused; atomic - singleUse bool // whether being used for a single http.Request + t *Transport + tconn net.Conn // usually *tls.Conn, except specialized impls + tlsState *tls.ConnectionState // nil only for specialized impls + reused uint32 // whether conn is being reused; atomic + singleUse bool // whether being used for a single http.Request + getConnCalled bool // used by clientConnPool // readLoop goroutine fields: readerDone chan struct{} // closed on error @@ -244,86 +266,94 @@ type ClientConn struct { cond *sync.Cond // hold mu; broadcast on flow/closed changes flow flow // our conn-level flow control quota (cs.flow is per stream) inflow flow // peer's conn-level flow control + doNotReuse bool // whether conn is marked to not be reused for any future requests closing bool closed bool + seenSettings bool // true if we've seen a settings frame, false otherwise wantSettingsAck bool // we sent a SETTINGS frame and haven't heard back goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received goAwayDebug string // goAway frame's debug data, retained as a string streams map[uint32]*clientStream // client-initiated + streamsReserved int // incr by ReserveNewRequest; decr on RoundTrip nextStreamID uint32 pendingRequests int // requests blocked and waiting to be sent because len(streams) == maxConcurrentStreams pings map[[8]byte]chan struct{} // in flight ping data to notification channel - bw *bufio.Writer br *bufio.Reader - fr *Framer lastActive time.Time lastIdle time.Time // time last idle - // Settings from peer: (also guarded by mu) + // Settings from peer: (also guarded by wmu) maxFrameSize uint32 maxConcurrentStreams uint32 peerMaxHeaderListSize uint64 initialWindowSize uint32 + // reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests. + // Write to reqHeaderMu to lock it, read from it to unlock. + // Lock reqmu BEFORE mu or wmu. + reqHeaderMu chan struct{} + + // wmu is held while writing. + // Acquire BEFORE mu when holding both, to avoid blocking mu on network writes. + // Only acquire both at the same time when changing peer settings. + wmu sync.Mutex + bw *bufio.Writer + fr *Framer + werr error // first write error that has occurred hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder - - wmu sync.Mutex // held while writing; acquire AFTER mu if holding both - werr error // first write error that has occurred } // clientStream is the state for a single HTTP/2 stream. One of these // is created for each Transport.RoundTrip call. type clientStream struct { - cc *ClientConn - req *http.Request + cc *ClientConn + + // Fields of Request that we may access even after the response body is closed. + ctx context.Context + reqCancel <-chan struct{} + trace *httptrace.ClientTrace // or nil ID uint32 - resc chan resAndError bufPipe pipe // buffered pipe with the flow-controlled response payload - startedWrite bool // started request body write; guarded by cc.mu requestedGzip bool - on100 func() // optional code to run if get a 100 continue response + isHead bool + + abortOnce sync.Once + abort chan struct{} // closed to signal stream should end immediately + abortErr error // set if abort is closed + + peerClosed chan struct{} // closed when the peer sends an END_STREAM flag + donec chan struct{} // closed after the stream is in the closed state + on100 chan struct{} // buffered; written to if a 100 is received + + respHeaderRecv chan struct{} // closed when headers are received + res *http.Response // set if respHeaderRecv is closed flow flow // guarded by cc.mu inflow flow // guarded by cc.mu bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read readErr error // sticky read error; owned by transportResponseBody.Read - stopReqBody error // if non-nil, stop writing req body; guarded by cc.mu - didReset bool // whether we sent a RST_STREAM to the server; guarded by cc.mu - peerReset chan struct{} // closed on peer reset - resetErr error // populated before peerReset is closed + reqBody io.ReadCloser + reqBodyContentLength int64 // -1 means unknown + reqBodyClosed bool // body has been closed; guarded by cc.mu - done chan struct{} // closed when stream remove from cc.streams map; close calls guarded by cc.mu + // owned by writeRequest: + sentEndStream bool // sent an END_STREAM flag to the peer + sentHeaders bool // owned by clientConnReadLoop: firstByte bool // got the first response byte pastHeaders bool // got first MetaHeadersFrame (actual headers) pastTrailers bool // got optional second MetaHeadersFrame (trailers) num1xx uint8 // number of 1xx responses seen + readClosed bool // peer sent an END_STREAM flag + readAborted bool // read loop reset the stream trailer http.Header // accumulated trailers resTrailer *http.Header // client's Response.Trailer } -// awaitRequestCancel waits for the user to cancel a request or for the done -// channel to be signaled. A non-nil error is returned only if the request was -// canceled. -func awaitRequestCancel(req *http.Request, done <-chan struct{}) error { - ctx := req.Context() - if req.Cancel == nil && ctx.Done() == nil { - return nil - } - select { - case <-req.Cancel: - return errRequestCanceled - case <-ctx.Done(): - return ctx.Err() - case <-done: - return nil - } -} - var got1xxFuncForTests func(int, textproto.MIMEHeader) error // get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func, @@ -335,73 +365,65 @@ func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error return traceGot1xxResponseFunc(cs.trace) } -// awaitRequestCancel waits for the user to cancel a request, its context to -// expire, or for the request to be done (any way it might be removed from the -// cc.streams map: peer reset, successful completion, TCP connection breakage, -// etc). If the request is canceled, then cs will be canceled and closed. -func (cs *clientStream) awaitRequestCancel(req *http.Request) { - if err := awaitRequestCancel(req, cs.done); err != nil { - cs.cancelStream() - cs.bufPipe.CloseWithError(err) - } +func (cs *clientStream) abortStream(err error) { + cs.cc.mu.Lock() + defer cs.cc.mu.Unlock() + cs.abortStreamLocked(err) } -func (cs *clientStream) cancelStream() { - cc := cs.cc - cc.mu.Lock() - didReset := cs.didReset - cs.didReset = true - cc.mu.Unlock() - - if !didReset { - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - cc.forgetStreamID(cs.ID) +func (cs *clientStream) abortStreamLocked(err error) { + cs.abortOnce.Do(func() { + cs.abortErr = err + close(cs.abort) + }) + if cs.reqBody != nil && !cs.reqBodyClosed { + cs.reqBody.Close() + cs.reqBodyClosed = true } -} - -// checkResetOrDone reports any error sent in a RST_STREAM frame by the -// server, or errStreamClosed if the stream is complete. -func (cs *clientStream) checkResetOrDone() error { - select { - case <-cs.peerReset: - return cs.resetErr - case <-cs.done: - return errStreamClosed - default: - return nil + // TODO(dneil): Clean up tests where cs.cc.cond is nil. + if cs.cc.cond != nil { + // Wake up writeRequestBody if it is waiting on flow control. + cs.cc.cond.Broadcast() } } -func (cs *clientStream) getStartedWrite() bool { +func (cs *clientStream) abortRequestBodyWrite() { cc := cs.cc cc.mu.Lock() defer cc.mu.Unlock() - return cs.startedWrite -} - -func (cs *clientStream) abortRequestBodyWrite(err error) { - if err == nil { - panic("nil error") + if cs.reqBody != nil && !cs.reqBodyClosed { + cs.reqBody.Close() + cs.reqBodyClosed = true + cc.cond.Broadcast() } - cc := cs.cc - cc.mu.Lock() - cs.stopReqBody = err - cc.cond.Broadcast() - cc.mu.Unlock() } type stickyErrWriter struct { - w io.Writer - err *error + conn net.Conn + timeout time.Duration + err *error } func (sew stickyErrWriter) Write(p []byte) (n int, err error) { if *sew.err != nil { return 0, *sew.err } - n, err = sew.w.Write(p) - *sew.err = err - return + for { + if sew.timeout != 0 { + sew.conn.SetWriteDeadline(time.Now().Add(sew.timeout)) + } + nn, err := sew.conn.Write(p[n:]) + n += nn + if n < len(p) && nn > 0 && errors.Is(err, os.ErrDeadlineExceeded) { + // Keep extending the deadline so long as we're making progress. + continue + } + if sew.timeout != 0 { + sew.conn.SetWriteDeadline(time.Time{}) + } + *sew.err = err + return n, err + } } // noCachedConnError is the concrete type of ErrNoCachedConn, which @@ -474,9 +496,9 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res } reused := !atomic.CompareAndSwapUint32(&cc.reused, 0, 1) traceGotConn(req, cc, reused) - res, gotErrAfterReqBodyWrite, err := cc.roundTrip(req) + res, err := cc.RoundTrip(req) if err != nil && retry <= 6 { - if req, err = shouldRetryRequest(req, err, gotErrAfterReqBodyWrite); err == nil { + if req, err = shouldRetryRequest(req, err); err == nil { // After the first retry, do exponential backoff with 10% jitter. if retry == 0 { continue @@ -487,7 +509,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res case <-time.After(time.Second * time.Duration(backoff)): continue case <-req.Context().Done(): - return nil, req.Context().Err() + err = req.Context().Err() } } } @@ -518,7 +540,7 @@ var ( // response headers. It is always called with a non-nil error. // It returns either a request to retry (either the same request, or a // modified clone), or an error if the request can't be replayed. -func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*http.Request, error) { +func shouldRetryRequest(req *http.Request, err error) (*http.Request, error) { if !canRetryError(err) { return nil, err } @@ -531,7 +553,6 @@ func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*htt // If the request body can be reset back to its original // state via the optional req.GetBody, do that. if req.GetBody != nil { - // TODO: consider a req.Body.Close here? or audit that all caller paths do? body, err := req.GetBody() if err != nil { return nil, err @@ -543,10 +564,8 @@ func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*htt // The Request.Body can't reset back to the beginning, but we // don't seem to have started to read from it yet, so reuse - // the request directly. The "afterBodyWrite" means the - // bodyWrite process has started, which becomes true before - // the first Read. - if !afterBodyWrite { + // the request directly. + if err == errClientConnUnusable { return req, nil } @@ -558,6 +577,10 @@ func canRetryError(err error) bool { return true } if se, ok := err.(StreamError); ok { + if se.Code == ErrCodeProtocol && se.Cause == errFromPeer { + // See golang/go#47635, golang/go#42777 + return true + } return se.Code == ErrCodeRefusedStream } return false @@ -632,14 +655,15 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro tconn: c, readerDone: make(chan struct{}), nextStreamID: 1, - maxFrameSize: 16 << 10, // spec default - initialWindowSize: 65535, // spec default - maxConcurrentStreams: 1000, // "infinite", per spec. 1000 seems good enough. - peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. + maxFrameSize: 16 << 10, // spec default + initialWindowSize: 65535, // spec default + maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings. + peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. streams: make(map[uint32]*clientStream), singleUse: singleUse, wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), + reqHeaderMu: make(chan struct{}, 1), } if d := t.idleConnTimeout(); d != 0 { cc.idleTimeout = d @@ -654,9 +678,16 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro // TODO: adjust this writer size to account for frame size + // MTU + crypto/tls record padding. - cc.bw = bufio.NewWriter(stickyErrWriter{c, &cc.werr}) + cc.bw = bufio.NewWriter(stickyErrWriter{ + conn: c, + timeout: t.WriteByteTimeout, + err: &cc.werr, + }) cc.br = bufio.NewReader(c) cc.fr = NewFramer(cc.bw, cc.br) + if t.CountError != nil { + cc.fr.countError = t.CountError + } cc.fr.ReadMetaHeaders = hpack.NewDecoder(initialHeaderTableSize, nil) cc.fr.MaxHeaderListSize = t.maxHeaderListSize() @@ -704,11 +735,17 @@ func (cc *ClientConn) healthCheck() { err := cc.Ping(ctx) if err != nil { cc.closeForLostPing() - cc.t.connPool().MarkDead(cc) return } } +// SetDoNotReuse marks cc as not reusable for future HTTP requests. +func (cc *ClientConn) SetDoNotReuse() { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.doNotReuse = true +} + func (cc *ClientConn) setGoAway(f *GoAwayFrame) { cc.mu.Lock() defer cc.mu.Unlock() @@ -726,27 +763,94 @@ func (cc *ClientConn) setGoAway(f *GoAwayFrame) { last := f.LastStreamID for streamID, cs := range cc.streams { if streamID > last { - select { - case cs.resc <- resAndError{err: errClientConnGotGoAway}: - default: - } + cs.abortStreamLocked(errClientConnGotGoAway) } } } // CanTakeNewRequest reports whether the connection can take a new request, // meaning it has not been closed or received or sent a GOAWAY. +// +// If the caller is going to immediately make a new request on this +// connection, use ReserveNewRequest instead. func (cc *ClientConn) CanTakeNewRequest() bool { cc.mu.Lock() defer cc.mu.Unlock() return cc.canTakeNewRequestLocked() } +// ReserveNewRequest is like CanTakeNewRequest but also reserves a +// concurrent stream in cc. The reservation is decremented on the +// next call to RoundTrip. +func (cc *ClientConn) ReserveNewRequest() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + if st := cc.idleStateLocked(); !st.canTakeNewRequest { + return false + } + cc.streamsReserved++ + return true +} + +// ClientConnState describes the state of a ClientConn. +type ClientConnState struct { + // Closed is whether the connection is closed. + Closed bool + + // Closing is whether the connection is in the process of + // closing. It may be closing due to shutdown, being a + // single-use connection, being marked as DoNotReuse, or + // having received a GOAWAY frame. + Closing bool + + // StreamsActive is how many streams are active. + StreamsActive int + + // StreamsReserved is how many streams have been reserved via + // ClientConn.ReserveNewRequest. + StreamsReserved int + + // StreamsPending is how many requests have been sent in excess + // of the peer's advertised MaxConcurrentStreams setting and + // are waiting for other streams to complete. + StreamsPending int + + // MaxConcurrentStreams is how many concurrent streams the + // peer advertised as acceptable. Zero means no SETTINGS + // frame has been received yet. + MaxConcurrentStreams uint32 + + // LastIdle, if non-zero, is when the connection last + // transitioned to idle state. + LastIdle time.Time +} + +// State returns a snapshot of cc's state. +func (cc *ClientConn) State() ClientConnState { + cc.wmu.Lock() + maxConcurrent := cc.maxConcurrentStreams + if !cc.seenSettings { + maxConcurrent = 0 + } + cc.wmu.Unlock() + + cc.mu.Lock() + defer cc.mu.Unlock() + return ClientConnState{ + Closed: cc.closed, + Closing: cc.closing || cc.singleUse || cc.doNotReuse || cc.goAway != nil, + StreamsActive: len(cc.streams), + StreamsReserved: cc.streamsReserved, + StreamsPending: cc.pendingRequests, + LastIdle: cc.lastIdle, + MaxConcurrentStreams: maxConcurrent, + } +} + // clientConnIdleState describes the suitability of a client // connection to initiate a new RoundTrip request. type clientConnIdleState struct { canTakeNewRequest bool - freshConn bool // whether it's unused by any previous request } func (cc *ClientConn) idleState() clientConnIdleState { @@ -767,13 +871,13 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { // writing it. maxConcurrentOkay = true } else { - maxConcurrentOkay = int64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams) + maxConcurrentOkay = int64(len(cc.streams)+cc.streamsReserved+1) <= int64(cc.maxConcurrentStreams) } st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && + !cc.doNotReuse && int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && !cc.tooIdleLocked() - st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest return } @@ -802,9 +906,27 @@ func (cc *ClientConn) onIdleTimeout() { cc.closeIfIdle() } +func (cc *ClientConn) closeConn() error { + t := time.AfterFunc(250*time.Millisecond, cc.forceCloseConn) + defer t.Stop() + return cc.tconn.Close() +} + +// A tls.Conn.Close can hang for a long time if the peer is unresponsive. +// Try to shut it down more aggressively. +func (cc *ClientConn) forceCloseConn() { + tc, ok := cc.tconn.(*tls.Conn) + if !ok { + return + } + if nc := tlsUnderlyingConn(tc); nc != nil { + nc.Close() + } +} + func (cc *ClientConn) closeIfIdle() { cc.mu.Lock() - if len(cc.streams) > 0 { + if len(cc.streams) > 0 || cc.streamsReserved > 0 { cc.mu.Unlock() return } @@ -816,18 +938,24 @@ func (cc *ClientConn) closeIfIdle() { if VerboseLogs { cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, nextID-2) } - cc.tconn.Close() + cc.closeConn() +} + +func (cc *ClientConn) isDoNotReuseAndIdle() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.doNotReuse && len(cc.streams) == 0 } var shutdownEnterWaitStateHook = func() {} -// Shutdown gracefully close the client connection, waiting for running streams to complete. +// Shutdown gracefully closes the client connection, waiting for running streams to complete. func (cc *ClientConn) Shutdown(ctx context.Context) error { if err := cc.sendGoAway(); err != nil { return err } // Wait for all in-flight streams to complete or connection to close - done := make(chan error, 1) + done := make(chan struct{}) cancelled := false // guarded by cc.mu go func() { cc.mu.Lock() @@ -835,7 +963,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { for { if len(cc.streams) == 0 || cc.closed { cc.closed = true - done <- cc.tconn.Close() + close(done) break } if cancelled { @@ -846,8 +974,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { }() shutdownEnterWaitStateHook() select { - case err := <-done: - return err + case <-done: + return cc.closeConn() case <-ctx.Done(): cc.mu.Lock() // Free the goroutine above @@ -860,15 +988,18 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { func (cc *ClientConn) sendGoAway() error { cc.mu.Lock() - defer cc.mu.Unlock() - cc.wmu.Lock() - defer cc.wmu.Unlock() - if cc.closing { + closing := cc.closing + cc.closing = true + maxStreamID := cc.nextStreamID + cc.mu.Unlock() + if closing { // GOAWAY sent already return nil } + + cc.wmu.Lock() + defer cc.wmu.Unlock() // Send a graceful shutdown frame to server - maxStreamID := cc.nextStreamID if err := cc.fr.WriteGoAway(maxStreamID, ErrCodeNo, nil); err != nil { return err } @@ -876,7 +1007,6 @@ func (cc *ClientConn) sendGoAway() error { return err } // Prevent new requests - cc.closing = true return nil } @@ -884,18 +1014,13 @@ func (cc *ClientConn) sendGoAway() error { // err is sent to streams. func (cc *ClientConn) closeForError(err error) error { cc.mu.Lock() - defer cc.cond.Broadcast() - defer cc.mu.Unlock() - for id, cs := range cc.streams { - select { - case cs.resc <- resAndError{err: err}: - default: - } - cs.bufPipe.CloseWithError(err) - delete(cc.streams, id) - } cc.closed = true - return cc.tconn.Close() + for _, cs := range cc.streams { + cs.abortStreamLocked(err) + } + cc.cond.Broadcast() + cc.mu.Unlock() + return cc.closeConn() } // Close closes the client connection immediately. @@ -909,6 +1034,9 @@ func (cc *ClientConn) Close() error { // closes the client connection immediately. In-flight requests are interrupted. func (cc *ClientConn) closeForLostPing() error { err := errors.New("http2: client connection lost") + if f := cc.t.CountError; f != nil { + f("conn_close_lost_ping") + } return cc.closeForError(err) } @@ -973,41 +1101,158 @@ func actualContentLength(req *http.Request) int64 { return -1 } +func (cc *ClientConn) decrStreamReservations() { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.decrStreamReservationsLocked() +} + +func (cc *ClientConn) decrStreamReservationsLocked() { + if cc.streamsReserved > 0 { + cc.streamsReserved-- + } +} + func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { - resp, _, err := cc.roundTrip(req) - return resp, err + ctx := req.Context() + cs := &clientStream{ + cc: cc, + ctx: ctx, + reqCancel: req.Cancel, + isHead: req.Method == "HEAD", + reqBody: req.Body, + reqBodyContentLength: actualContentLength(req), + trace: httptrace.ContextClientTrace(ctx), + peerClosed: make(chan struct{}), + abort: make(chan struct{}), + respHeaderRecv: make(chan struct{}), + donec: make(chan struct{}), + } + go cs.doRequest(req) + + waitDone := func() error { + select { + case <-cs.donec: + return nil + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + } + } + + handleResponseHeaders := func() (*http.Response, error) { + res := cs.res + if res.StatusCode > 299 { + // On error or status code 3xx, 4xx, 5xx, etc abort any + // ongoing write, assuming that the server doesn't care + // about our request body. If the server replied with 1xx or + // 2xx, however, then assume the server DOES potentially + // want our body (e.g. full-duplex streaming: + // golang.org/issue/13444). If it turns out the server + // doesn't, they'll RST_STREAM us soon enough. This is a + // heuristic to avoid adding knobs to Transport. Hopefully + // we can keep it. + cs.abortRequestBodyWrite() + } + res.Request = req + res.TLS = cc.tlsState + if res.Body == noBody && actualContentLength(req) == 0 { + // If there isn't a request or response body still being + // written, then wait for the stream to be closed before + // RoundTrip returns. + if err := waitDone(); err != nil { + return nil, err + } + } + return res, nil + } + + for { + select { + case <-cs.respHeaderRecv: + return handleResponseHeaders() + case <-cs.abort: + select { + case <-cs.respHeaderRecv: + // If both cs.respHeaderRecv and cs.abort are signaling, + // pick respHeaderRecv. The server probably wrote the + // response and immediately reset the stream. + // golang.org/issue/49645 + return handleResponseHeaders() + default: + waitDone() + return nil, cs.abortErr + } + case <-ctx.Done(): + err := ctx.Err() + cs.abortStream(err) + return nil, err + case <-cs.reqCancel: + cs.abortStream(errRequestCanceled) + return nil, errRequestCanceled + } + } } -func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAfterReqBodyWrite bool, err error) { +// doRequest runs for the duration of the request lifetime. +// +// It sends the request and performs post-request cleanup (closing Request.Body, etc.). +func (cs *clientStream) doRequest(req *http.Request) { + err := cs.writeRequest(req) + cs.cleanupWriteRequest(err) +} + +// writeRequest sends a request. +// +// It returns nil after the request is written, the response read, +// and the request stream is half-closed by the peer. +// +// It returns non-nil if the request ends otherwise. +// If the returned error is StreamError, the error Code may be used in resetting the stream. +func (cs *clientStream) writeRequest(req *http.Request) (err error) { + cc := cs.cc + ctx := cs.ctx + if err := checkConnHeaders(req); err != nil { - return nil, false, err - } - if cc.idleTimer != nil { - cc.idleTimer.Stop() + return err } - trailers, err := commaSeparatedTrailers(req) - if err != nil { - return nil, false, err + // Acquire the new-request lock by writing to reqHeaderMu. + // This lock guards the critical section covering allocating a new stream ID + // (requires mu) and creating the stream (requires wmu). + if cc.reqHeaderMu == nil { + panic("RoundTrip on uninitialized ClientConn") // for tests + } + select { + case cc.reqHeaderMu <- struct{}{}: + case <-cs.reqCancel: + return errRequestCanceled + case <-ctx.Done(): + return ctx.Err() } - hasTrailers := trailers != "" cc.mu.Lock() - if err := cc.awaitOpenSlotForRequest(req); err != nil { + if cc.idleTimer != nil { + cc.idleTimer.Stop() + } + cc.decrStreamReservationsLocked() + if err := cc.awaitOpenSlotForStreamLocked(cs); err != nil { cc.mu.Unlock() - return nil, false, err + <-cc.reqHeaderMu + return err } - - body := req.Body - contentLen := actualContentLength(req) - hasBody := contentLen != 0 + cc.addStreamLocked(cs) // assigns stream ID + if isConnectionCloseRequest(req) { + cc.doNotReuse = true + } + cc.mu.Unlock() // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? - var requestedGzip bool if !cc.t.disableCompression() && req.Header.Get("Accept-Encoding") == "" && req.Header.Get("Range") == "" && - req.Method != "HEAD" { + !cs.isHead { // Request gzip only, not deflate. Deflate is ambiguous and // not as universally supported anyway. // See: https://zlib.net/zlib_faq.html#faq39 @@ -1020,195 +1265,224 @@ func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAf // We don't request gzip if the request is for a range, since // auto-decoding a portion of a gzipped document will just fail // anyway. See https://golang.org/issue/8923 - requestedGzip = true + cs.requestedGzip = true } - // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is - // sent by writeRequestBody below, along with any Trailers, - // again in form HEADERS{1}, CONTINUATION{0,}) - hdrs, err := cc.encodeHeaders(req, requestedGzip, trailers, contentLen) - if err != nil { - cc.mu.Unlock() - return nil, false, err + continueTimeout := cc.t.expectContinueTimeout() + if continueTimeout != 0 { + if !httpguts.HeaderValuesContainsToken(req.Header["Expect"], "100-continue") { + continueTimeout = 0 + } else { + cs.on100 = make(chan struct{}, 1) + } } - cs := cc.newStream() - cs.req = req - cs.trace = httptrace.ContextClientTrace(req.Context()) - cs.requestedGzip = requestedGzip - bodyWriter := cc.t.getBodyWriterState(cs, body) - cs.on100 = bodyWriter.on100 + // Past this point (where we send request headers), it is possible for + // RoundTrip to return successfully. Since the RoundTrip contract permits + // the caller to "mutate or reuse" the Request after closing the Response's Body, + // we must take care when referencing the Request from here on. + err = cs.encodeAndWriteHeaders(req) + <-cc.reqHeaderMu + if err != nil { + return err + } - defer func() { - cc.wmu.Lock() - werr := cc.werr - cc.wmu.Unlock() - if werr != nil { - cc.Close() + hasBody := cs.reqBodyContentLength != 0 + if !hasBody { + cs.sentEndStream = true + } else { + if continueTimeout != 0 { + traceWait100Continue(cs.trace) + timer := time.NewTimer(continueTimeout) + select { + case <-timer.C: + err = nil + case <-cs.on100: + err = nil + case <-cs.abort: + err = cs.abortErr + case <-ctx.Done(): + err = ctx.Err() + case <-cs.reqCancel: + err = errRequestCanceled + } + timer.Stop() + if err != nil { + traceWroteRequest(cs.trace, err) + return err + } } - }() - cc.wmu.Lock() - endStream := !hasBody && !hasTrailers - werr := cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) - cc.wmu.Unlock() - traceWroteHeaders(cs.trace) - cc.mu.Unlock() - - if werr != nil { - if hasBody { - req.Body.Close() // per RoundTripper contract - bodyWriter.cancel() + if err = cs.writeRequestBody(req); err != nil { + if err != errStopReqBodyWrite { + traceWroteRequest(cs.trace, err) + return err + } + } else { + cs.sentEndStream = true } - cc.forgetStreamID(cs.ID) - // Don't bother sending a RST_STREAM (our write already failed; - // no need to keep writing) - traceWroteRequest(cs.trace, werr) - return nil, false, werr } + traceWroteRequest(cs.trace, err) + var respHeaderTimer <-chan time.Time - if hasBody { - bodyWriter.scheduleBodyWrite() - } else { - traceWroteRequest(cs.trace, nil) - if d := cc.responseHeaderTimeout(); d != 0 { - timer := time.NewTimer(d) - defer timer.Stop() - respHeaderTimer = timer.C + var respHeaderRecv chan struct{} + if d := cc.responseHeaderTimeout(); d != 0 { + timer := time.NewTimer(d) + defer timer.Stop() + respHeaderTimer = timer.C + respHeaderRecv = cs.respHeaderRecv + } + // Wait until the peer half-closes its end of the stream, + // or until the request is aborted (via context, error, or otherwise), + // whichever comes first. + for { + select { + case <-cs.peerClosed: + return nil + case <-respHeaderTimer: + return errTimeout + case <-respHeaderRecv: + respHeaderRecv = nil + respHeaderTimer = nil // keep waiting for END_STREAM + case <-cs.abort: + return cs.abortErr + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled } } +} - readLoopResCh := cs.resc - bodyWritten := false - ctx := req.Context() +func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error { + cc := cs.cc + ctx := cs.ctx - handleReadLoopResponse := func(re resAndError) (*http.Response, bool, error) { - res := re.res - if re.err != nil || res.StatusCode > 299 { - // On error or status code 3xx, 4xx, 5xx, etc abort any - // ongoing write, assuming that the server doesn't care - // about our request body. If the server replied with 1xx or - // 2xx, however, then assume the server DOES potentially - // want our body (e.g. full-duplex streaming: - // golang.org/issue/13444). If it turns out the server - // doesn't, they'll RST_STREAM us soon enough. This is a - // heuristic to avoid adding knobs to Transport. Hopefully - // we can keep it. - bodyWriter.cancel() - cs.abortRequestBodyWrite(errStopReqBodyWrite) - if hasBody && !bodyWritten { - <-bodyWriter.resc - } - } - if re.err != nil { - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), re.err - } - res.Request = req - res.TLS = cc.tlsState - return res, false, nil + cc.wmu.Lock() + defer cc.wmu.Unlock() + + // If the request was canceled while waiting for cc.mu, just quit. + select { + case <-cs.abort: + return cs.abortErr + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + default: + } + + // Encode headers. + // + // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is + // sent by writeRequestBody below, along with any Trailers, + // again in form HEADERS{1}, CONTINUATION{0,}) + trailers, err := commaSeparatedTrailers(req) + if err != nil { + return err + } + hasTrailers := trailers != "" + contentLen := actualContentLength(req) + hasBody := contentLen != 0 + hdrs, err := cc.encodeHeaders(req, cs.requestedGzip, trailers, contentLen) + if err != nil { + return err + } + + // Write the request. + endStream := !hasBody && !hasTrailers + cs.sentHeaders = true + err = cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) + traceWroteHeaders(cs.trace) + return err +} + +// cleanupWriteRequest performs post-request tasks. +// +// If err (the result of writeRequest) is non-nil and the stream is not closed, +// cleanupWriteRequest will send a reset to the peer. +func (cs *clientStream) cleanupWriteRequest(err error) { + cc := cs.cc + + if cs.ID == 0 { + // We were canceled before creating the stream, so return our reservation. + cc.decrStreamReservations() + } + + // TODO: write h12Compare test showing whether + // Request.Body is closed by the Transport, + // and in multiple cases: server replies <=299 and >299 + // while still writing request body + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cs.reqBodyClosed = true + cc.mu.Unlock() + if !bodyClosed && cs.reqBody != nil { + cs.reqBody.Close() } - for { + if err != nil && cs.sentEndStream { + // If the connection is closed immediately after the response is read, + // we may be aborted before finishing up here. If the stream was closed + // cleanly on both sides, there is no error. select { - case re := <-readLoopResCh: - return handleReadLoopResponse(re) - case <-respHeaderTimer: - if !hasBody || bodyWritten { - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - } else { - bodyWriter.cancel() - cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) - <-bodyWriter.resc - } - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), errTimeout - case <-ctx.Done(): - if !hasBody || bodyWritten { - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - } else { - bodyWriter.cancel() - cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) - <-bodyWriter.resc - } - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), ctx.Err() - case <-req.Cancel: - if !hasBody || bodyWritten { - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) + case <-cs.peerClosed: + err = nil + default: + } + } + if err != nil { + cs.abortStream(err) // possibly redundant, but harmless + if cs.sentHeaders { + if se, ok := err.(StreamError); ok { + if se.Cause != errFromPeer { + cc.writeStreamReset(cs.ID, se.Code, err) + } } else { - bodyWriter.cancel() - cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) - <-bodyWriter.resc - } - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), errRequestCanceled - case <-cs.peerReset: - // processResetStream already removed the - // stream from the streams map; no need for - // forgetStreamID. - return nil, cs.getStartedWrite(), cs.resetErr - case err := <-bodyWriter.resc: - bodyWritten = true - // Prefer the read loop's response, if available. Issue 16102. - select { - case re := <-readLoopResCh: - return handleReadLoopResponse(re) - default: - } - if err != nil { - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), err - } - if d := cc.responseHeaderTimeout(); d != 0 { - timer := time.NewTimer(d) - defer timer.Stop() - respHeaderTimer = timer.C + cc.writeStreamReset(cs.ID, ErrCodeCancel, err) } } + cs.bufPipe.CloseWithError(err) // no-op if already closed + } else { + if cs.sentHeaders && !cs.sentEndStream { + cc.writeStreamReset(cs.ID, ErrCodeNo, nil) + } + cs.bufPipe.CloseWithError(errRequestCanceled) + } + if cs.ID != 0 { + cc.forgetStreamID(cs.ID) + } + + cc.wmu.Lock() + werr := cc.werr + cc.wmu.Unlock() + if werr != nil { + cc.Close() } + + close(cs.donec) } -// awaitOpenSlotForRequest waits until len(streams) < maxConcurrentStreams. +// awaitOpenSlotForStream waits until len(streams) < maxConcurrentStreams. // Must hold cc.mu. -func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error { - var waitingForConn chan struct{} - var waitingForConnErr error // guarded by cc.mu +func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { for { cc.lastActive = time.Now() if cc.closed || !cc.canTakeNewRequestLocked() { - if waitingForConn != nil { - close(waitingForConn) - } return errClientConnUnusable } cc.lastIdle = time.Time{} - if int64(len(cc.streams))+1 <= int64(cc.maxConcurrentStreams) { - if waitingForConn != nil { - close(waitingForConn) - } + if int64(len(cc.streams)) < int64(cc.maxConcurrentStreams) { return nil } - // Unfortunately, we cannot wait on a condition variable and channel at - // the same time, so instead, we spin up a goroutine to check if the - // request is canceled while we wait for a slot to open in the connection. - if waitingForConn == nil { - waitingForConn = make(chan struct{}) - go func() { - if err := awaitRequestCancel(req, waitingForConn); err != nil { - cc.mu.Lock() - waitingForConnErr = err - cc.cond.Broadcast() - cc.mu.Unlock() - } - }() - } cc.pendingRequests++ cc.cond.Wait() cc.pendingRequests-- - if waitingForConnErr != nil { - return waitingForConnErr + select { + case <-cs.abort: + return cs.abortErr + default: } } } @@ -1235,10 +1509,6 @@ func (cc *ClientConn) writeHeaders(streamID uint32, endStream bool, maxFrameSize cc.fr.WriteContinuation(streamID, endHeaders, chunk) } } - // TODO(bradfitz): this Flush could potentially block (as - // could the WriteHeaders call(s) above), which means they - // wouldn't respond to Request.Cancel being readable. That's - // rare, but this should probably be in a goroutine. cc.bw.Flush() return cc.werr } @@ -1265,7 +1535,7 @@ func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { if n > max { n = max } - if cl := actualContentLength(cs.req); cl != -1 && cl+1 < n { + if cl := cs.reqBodyContentLength; cl != -1 && cl+1 < n { // Add an extra byte past the declared content-length to // give the caller's Request.Body io.Reader a chance to // give us more bytes than they declared, so we can catch it @@ -1280,25 +1550,13 @@ func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { var bufPool sync.Pool // of *[]byte -func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (err error) { +func (cs *clientStream) writeRequestBody(req *http.Request) (err error) { cc := cs.cc + body := cs.reqBody sentEnd := false // whether we sent the final DATA frame w/ END_STREAM - defer func() { - traceWroteRequest(cs.trace, err) - // TODO: write h12Compare test showing whether - // Request.Body is closed by the Transport, - // and in multiple cases: server replies <=299 and >299 - // while still writing request body - cerr := bodyCloser.Close() - if err == nil { - err = cerr - } - }() - - req := cs.req hasTrailers := req.Trailer != nil - remainLen := actualContentLength(req) + remainLen := cs.reqBodyContentLength hasContentLen := remainLen != -1 cc.mu.Lock() @@ -1336,29 +1594,29 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( } if remainLen < 0 { err = errReqBodyTooLong - cc.writeStreamReset(cs.ID, ErrCodeCancel, err) return err } } - if err == io.EOF { - sawEOF = true - err = nil - } else if err != nil { - cc.writeStreamReset(cs.ID, ErrCodeCancel, err) - return err + if err != nil { + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cc.mu.Unlock() + switch { + case bodyClosed: + return errStopReqBodyWrite + case err == io.EOF: + sawEOF = true + err = nil + default: + return err + } } remain := buf[:n] for len(remain) > 0 && err == nil { var allowed int32 allowed, err = cs.awaitFlowControl(len(remain)) - switch { - case err == errStopReqBodyWrite: - return err - case err == errStopReqBodyWriteAndCancel: - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - return err - case err != nil: + if err != nil { return err } cc.wmu.Lock() @@ -1389,21 +1647,27 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( return nil } + // Since the RoundTrip contract permits the caller to "mutate or reuse" + // a request after the Response's Body is closed, verify that this hasn't + // happened before accessing the trailers. + cc.mu.Lock() + trailer := req.Trailer + err = cs.abortErr + cc.mu.Unlock() + if err != nil { + return err + } + + cc.wmu.Lock() + defer cc.wmu.Unlock() var trls []byte - if hasTrailers { - cc.mu.Lock() - trls, err = cc.encodeTrailers(req) - cc.mu.Unlock() + if len(trailer) > 0 { + trls, err = cc.encodeTrailers(trailer) if err != nil { - cc.writeStreamReset(cs.ID, ErrCodeInternal, err) - cc.forgetStreamID(cs.ID) return err } } - cc.wmu.Lock() - defer cc.wmu.Unlock() - // Two ways to send END_STREAM: either with trailers, or // with an empty DATA frame. if len(trls) > 0 { @@ -1423,17 +1687,24 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( // if the stream is dead. func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) { cc := cs.cc + ctx := cs.ctx cc.mu.Lock() defer cc.mu.Unlock() for { if cc.closed { return 0, errClientConnClosed } - if cs.stopReqBody != nil { - return 0, cs.stopReqBody + if cs.reqBodyClosed { + return 0, errStopReqBodyWrite } - if err := cs.checkResetOrDone(); err != nil { - return 0, err + select { + case <-cs.abort: + return 0, cs.abortErr + case <-ctx.Done(): + return 0, ctx.Err() + case <-cs.reqCancel: + return 0, errRequestCanceled + default: } if a := cs.flow.available(); a > 0 { take := a @@ -1451,9 +1722,14 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) } } -// requires cc.mu be held. +var errNilRequestURL = errors.New("http2: Request.URI is nil") + +// requires cc.wmu be held. func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trailers string, contentLength int64) ([]byte, error) { cc.hbuf.Reset() + if req.URL == nil { + return nil, errNilRequestURL + } host := req.Host if host == "" { @@ -1639,12 +1915,12 @@ func shouldSendReqContentLength(method string, contentLength int64) bool { } } -// requires cc.mu be held. -func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { +// requires cc.wmu be held. +func (cc *ClientConn) encodeTrailers(trailer http.Header) ([]byte, error) { cc.hbuf.Reset() hlSize := uint64(0) - for k, vv := range req.Trailer { + for k, vv := range trailer { for _, v := range vv { hf := hpack.HeaderField{Name: k, Value: v} hlSize += uint64(hf.Size()) @@ -1654,7 +1930,7 @@ func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { return nil, errRequestHeaderListSize } - for k, vv := range req.Trailer { + for k, vv := range trailer { lowKey, ascii := asciiToLower(k) if !ascii { // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header @@ -1684,51 +1960,51 @@ type resAndError struct { } // requires cc.mu be held. -func (cc *ClientConn) newStream() *clientStream { - cs := &clientStream{ - cc: cc, - ID: cc.nextStreamID, - resc: make(chan resAndError, 1), - peerReset: make(chan struct{}), - done: make(chan struct{}), - } +func (cc *ClientConn) addStreamLocked(cs *clientStream) { cs.flow.add(int32(cc.initialWindowSize)) cs.flow.setConnFlow(&cc.flow) cs.inflow.add(transportDefaultStreamFlow) cs.inflow.setConnFlow(&cc.inflow) + cs.ID = cc.nextStreamID cc.nextStreamID += 2 cc.streams[cs.ID] = cs - return cs + if cs.ID == 0 { + panic("assigned stream ID 0") + } } func (cc *ClientConn) forgetStreamID(id uint32) { - cc.streamByID(id, true) -} - -func (cc *ClientConn) streamByID(id uint32, andRemove bool) *clientStream { cc.mu.Lock() - defer cc.mu.Unlock() - cs := cc.streams[id] - if andRemove && cs != nil && !cc.closed { - cc.lastActive = time.Now() - delete(cc.streams, id) - if len(cc.streams) == 0 && cc.idleTimer != nil { - cc.idleTimer.Reset(cc.idleTimeout) - cc.lastIdle = time.Now() - } - close(cs.done) - // Wake up checkResetOrDone via clientStream.awaitFlowControl and - // wake up RoundTrip if there is a pending request. - cc.cond.Broadcast() + slen := len(cc.streams) + delete(cc.streams, id) + if len(cc.streams) != slen-1 { + panic("forgetting unknown stream id") + } + cc.lastActive = time.Now() + if len(cc.streams) == 0 && cc.idleTimer != nil { + cc.idleTimer.Reset(cc.idleTimeout) + cc.lastIdle = time.Now() + } + // Wake up writeRequestBody via clientStream.awaitFlowControl and + // wake up RoundTrip if there is a pending request. + cc.cond.Broadcast() + + closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() + if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { + if VerboseLogs { + cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, cc.nextStreamID-2) + } + cc.closed = true + defer cc.closeConn() } - return cs + + cc.mu.Unlock() } // clientConnReadLoop is the state owned by the clientConn's frame-reading readLoop. type clientConnReadLoop struct { - _ incomparable - cc *ClientConn - closeWhenIdle bool + _ incomparable + cc *ClientConn } // readLoop runs in its own goroutine and reads and dispatches frames. @@ -1766,8 +2042,8 @@ func isEOFOrNetReadError(err error) bool { func (rl *clientConnReadLoop) cleanup() { cc := rl.cc - defer cc.tconn.Close() - defer cc.t.connPool().MarkDead(cc) + cc.t.connPool().MarkDead(cc) + defer cc.closeConn() defer close(cc.readerDone) if cc.idleTimer != nil { @@ -1788,23 +2064,49 @@ func (rl *clientConnReadLoop) cleanup() { } else if err == io.EOF { err = io.ErrUnexpectedEOF } + cc.closed = true for _, cs := range cc.streams { - cs.bufPipe.CloseWithError(err) // no-op if already closed select { - case cs.resc <- resAndError{err: err}: + case <-cs.peerClosed: + // The server closed the stream before closing the conn, + // so no need to interrupt it. default: + cs.abortStreamLocked(err) } - close(cs.done) } - cc.closed = true cc.cond.Broadcast() cc.mu.Unlock() } +// countReadFrameError calls Transport.CountError with a string +// representing err. +func (cc *ClientConn) countReadFrameError(err error) { + f := cc.t.CountError + if f == nil || err == nil { + return + } + if ce, ok := err.(ConnectionError); ok { + errCode := ErrCode(ce) + f(fmt.Sprintf("read_frame_conn_error_%s", errCode.stringToken())) + return + } + if errors.Is(err, io.EOF) { + f("read_frame_eof") + return + } + if errors.Is(err, io.ErrUnexpectedEOF) { + f("read_frame_unexpected_eof") + return + } + if errors.Is(err, ErrFrameTooLarge) { + f("read_frame_too_large") + return + } + f("read_frame_other") +} + func (rl *clientConnReadLoop) run() error { cc := rl.cc - rl.closeWhenIdle = cc.t.disableKeepAlives() || cc.singleUse - gotReply := false // ever saw a HEADERS reply gotSettings := false readIdleTimeout := cc.t.ReadIdleTimeout var t *time.Timer @@ -1821,9 +2123,7 @@ func (rl *clientConnReadLoop) run() error { cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", cc, err, err) } if se, ok := err.(StreamError); ok { - if cs := cc.streamByID(se.StreamID, false); cs != nil { - cs.cc.writeStreamReset(cs.ID, se.Code, err) - cs.cc.forgetStreamID(cs.ID) + if cs := rl.streamByID(se.StreamID); cs != nil { if se.Cause == nil { se.Cause = cc.fr.errDetail } @@ -1831,6 +2131,7 @@ func (rl *clientConnReadLoop) run() error { } continue } else if err != nil { + cc.countReadFrameError(err) return err } if VerboseLogs { @@ -1843,22 +2144,16 @@ func (rl *clientConnReadLoop) run() error { } gotSettings = true } - maybeIdle := false // whether frame might transition us to idle switch f := f.(type) { case *MetaHeadersFrame: err = rl.processHeaders(f) - maybeIdle = true - gotReply = true case *DataFrame: err = rl.processData(f) - maybeIdle = true case *GoAwayFrame: err = rl.processGoAway(f) - maybeIdle = true case *RSTStreamFrame: err = rl.processResetStream(f) - maybeIdle = true case *SettingsFrame: err = rl.processSettings(f) case *PushPromiseFrame: @@ -1876,38 +2171,24 @@ func (rl *clientConnReadLoop) run() error { } return err } - if rl.closeWhenIdle && gotReply && maybeIdle { - cc.closeIfIdle() - } } } func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { - cc := rl.cc - cs := cc.streamByID(f.StreamID, false) + cs := rl.streamByID(f.StreamID) if cs == nil { // We'd get here if we canceled a request while the // server had its response still in flight. So if this // was just something we canceled, ignore it. return nil } - if f.StreamEnded() { - // Issue 20521: If the stream has ended, streamByID() causes - // clientStream.done to be closed, which causes the request's bodyWriter - // to be closed with an errStreamClosed, which may be received by - // clientConn.RoundTrip before the result of processing these headers. - // Deferring stream closure allows the header processing to occur first. - // clientConn.RoundTrip may still receive the bodyWriter error first, but - // the fix for issue 16102 prioritises any response. - // - // Issue 22413: If there is no request body, we should close the - // stream before writing to cs.resc so that the stream is closed - // immediately once RoundTrip returns. - if cs.req.Body != nil { - defer cc.forgetStreamID(f.StreamID) - } else { - cc.forgetStreamID(f.StreamID) - } + if cs.readClosed { + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + Cause: errors.New("protocol error: headers after END_STREAM"), + }) + return nil } if !cs.firstByte { if cs.trace != nil { @@ -1931,9 +2212,11 @@ func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { return err } // Any other error type is a stream error. - cs.cc.writeStreamReset(f.StreamID, ErrCodeProtocol, err) - cc.forgetStreamID(cs.ID) - cs.resc <- resAndError{err: err} + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + Cause: err, + }) return nil // return nil from process* funcs to keep conn alive } if res == nil { @@ -1941,7 +2224,11 @@ func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { return nil } cs.resTrailer = &res.Trailer - cs.resc <- resAndError{res: res} + cs.res = res + close(cs.respHeaderRecv) + if f.StreamEnded() { + rl.endStream(cs) + } return nil } @@ -2003,6 +2290,9 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra } if statusCode >= 100 && statusCode <= 199 { + if f.StreamEnded() { + return nil, errors.New("1xx informational response with END_STREAM flag") + } cs.num1xx++ const max1xxResponses = 5 // arbitrary bound on number of informational responses, same as net/http if cs.num1xx > max1xxResponses { @@ -2015,42 +2305,49 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra } if statusCode == 100 { traceGot100Continue(cs.trace) - if cs.on100 != nil { - cs.on100() // forces any write delay timer to fire + select { + case cs.on100 <- struct{}{}: + default: } } cs.pastHeaders = false // do it all again return nil, nil } - streamEnded := f.StreamEnded() - isHead := cs.req.Method == "HEAD" - if !streamEnded || isHead { - res.ContentLength = -1 - if clens := res.Header["Content-Length"]; len(clens) == 1 { - if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { - res.ContentLength = int64(cl) - } else { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. - } - } else if len(clens) > 1 { + res.ContentLength = -1 + if clens := res.Header["Content-Length"]; len(clens) == 1 { + if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { + res.ContentLength = int64(cl) + } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } + } else if len(clens) > 1 { + // TODO: care? unlike http/1, it won't mess up our framing, so it's + // more safe smuggling-wise to ignore. + } else if f.StreamEnded() && !cs.isHead { + res.ContentLength = 0 } - if streamEnded || isHead { + if cs.isHead { res.Body = noBody return res, nil } - cs.bufPipe = pipe{b: &dataBuffer{expected: res.ContentLength}} + if f.StreamEnded() { + if res.ContentLength > 0 { + res.Body = missingBody{} + } else { + res.Body = noBody + } + return res, nil + } + + cs.bufPipe.setBuffer(&dataBuffer{expected: res.ContentLength}) cs.bytesRemain = res.ContentLength res.Body = transportResponseBody{cs} - go cs.awaitRequestCancel(cs.req) - if cs.requestedGzip && res.Header.Get("Content-Encoding") == "gzip" { + if cs.requestedGzip && asciiEqualFold(res.Header.Get("Content-Encoding"), "gzip") { res.Header.Del("Content-Encoding") res.Header.Del("Content-Length") res.ContentLength = -1 @@ -2089,8 +2386,7 @@ func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFr } // transportResponseBody is the concrete type of Transport.RoundTrip's -// Response.Body. It is an io.ReadCloser. On Read, it reads from cs.body. -// On Close it sends RST_STREAM if EOF wasn't already seen. +// Response.Body. It is an io.ReadCloser. type transportResponseBody struct { cs *clientStream } @@ -2108,7 +2404,7 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { n = int(cs.bytesRemain) if err == nil { err = errors.New("net/http: server replied with more than declared Content-Length; truncated") - cc.writeStreamReset(cs.ID, ErrCodeProtocol, err) + cs.abortStream(err) } cs.readErr = err return int(cs.bytesRemain), err @@ -2126,8 +2422,6 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { } cc.mu.Lock() - defer cc.mu.Unlock() - var connAdd, streamAdd int32 // Check the conn-level first, before the stream-level. if v := cc.inflow.available(); v < transportDefaultConnFlow/2 { @@ -2144,6 +2438,8 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { cs.inflow.add(streamAdd) } } + cc.mu.Unlock() + if connAdd != 0 || streamAdd != 0 { cc.wmu.Lock() defer cc.wmu.Unlock() @@ -2164,34 +2460,45 @@ func (b transportResponseBody) Close() error { cs := b.cs cc := cs.cc - serverSentStreamEnd := cs.bufPipe.Err() == io.EOF unread := cs.bufPipe.Len() - - if unread > 0 || !serverSentStreamEnd { + if unread > 0 { cc.mu.Lock() - cc.wmu.Lock() - if !serverSentStreamEnd { - cc.fr.WriteRSTStream(cs.ID, ErrCodeCancel) - cs.didReset = true - } // Return connection-level flow control. if unread > 0 { cc.inflow.add(int32(unread)) + } + cc.mu.Unlock() + + // TODO(dneil): Acquiring this mutex can block indefinitely. + // Move flow control return to a goroutine? + cc.wmu.Lock() + // Return connection-level flow control. + if unread > 0 { cc.fr.WriteWindowUpdate(0, uint32(unread)) } cc.bw.Flush() cc.wmu.Unlock() - cc.mu.Unlock() } cs.bufPipe.BreakWithError(errClosedResponseBody) - cc.forgetStreamID(cs.ID) + cs.abortStream(errClosedResponseBody) + + select { + case <-cs.donec: + case <-cs.ctx.Done(): + // See golang/go#49366: The net/http package can cancel the + // request context after the response body is fully read. + // Don't treat this as an error. + return nil + case <-cs.reqCancel: + return errRequestCanceled + } return nil } func (rl *clientConnReadLoop) processData(f *DataFrame) error { cc := rl.cc - cs := cc.streamByID(f.StreamID, f.StreamEnded()) + cs := rl.streamByID(f.StreamID) data := f.Data() if cs == nil { cc.mu.Lock() @@ -2220,6 +2527,14 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { } return nil } + if cs.readClosed { + cc.logf("protocol error: received DATA after END_STREAM") + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + }) + return nil + } if !cs.firstByte { cc.logf("protocol error: received DATA before a HEADERS frame") rl.endStreamError(cs, StreamError{ @@ -2229,7 +2544,7 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { return nil } if f.Length > 0 { - if cs.req.Method == "HEAD" && len(data) > 0 { + if cs.isHead && len(data) > 0 { cc.logf("protocol error: received DATA on a HEAD request") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, @@ -2251,30 +2566,39 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { if pad := int(f.Length) - len(data); pad > 0 { refund += pad } - // Return len(data) now if the stream is already closed, - // since data will never be read. - didReset := cs.didReset - if didReset { - refund += len(data) + + didReset := false + var err error + if len(data) > 0 { + if _, err = cs.bufPipe.Write(data); err != nil { + // Return len(data) now if the stream is already closed, + // since data will never be read. + didReset = true + refund += len(data) + } } + if refund > 0 { cc.inflow.add(int32(refund)) + if !didReset { + cs.inflow.add(int32(refund)) + } + } + cc.mu.Unlock() + + if refund > 0 { cc.wmu.Lock() cc.fr.WriteWindowUpdate(0, uint32(refund)) if !didReset { - cs.inflow.add(int32(refund)) cc.fr.WriteWindowUpdate(cs.ID, uint32(refund)) } cc.bw.Flush() cc.wmu.Unlock() } - cc.mu.Unlock() - if len(data) > 0 && !didReset { - if _, err := cs.bufPipe.Write(data); err != nil { - rl.endStreamError(cs, err) - return err - } + if err != nil { + rl.endStreamError(cs, err) + return nil } } @@ -2287,24 +2611,32 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { func (rl *clientConnReadLoop) endStream(cs *clientStream) { // TODO: check that any declared content-length matches, like // server.go's (*stream).endStream method. - rl.endStreamError(cs, nil) + if !cs.readClosed { + cs.readClosed = true + // Close cs.bufPipe and cs.peerClosed with cc.mu held to avoid a + // race condition: The caller can read io.EOF from Response.Body + // and close the body before we close cs.peerClosed, causing + // cleanupWriteRequest to send a RST_STREAM. + rl.cc.mu.Lock() + defer rl.cc.mu.Unlock() + cs.bufPipe.closeWithErrorAndCode(io.EOF, cs.copyTrailers) + close(cs.peerClosed) + } } func (rl *clientConnReadLoop) endStreamError(cs *clientStream, err error) { - var code func() - if err == nil { - err = io.EOF - code = cs.copyTrailers - } - if isConnectionCloseRequest(cs.req) { - rl.closeWhenIdle = true - } - cs.bufPipe.closeWithErrorAndCode(err, code) + cs.readAborted = true + cs.abortStream(err) +} - select { - case cs.resc <- resAndError{err: err}: - default: +func (rl *clientConnReadLoop) streamByID(id uint32) *clientStream { + rl.cc.mu.Lock() + defer rl.cc.mu.Unlock() + cs := rl.cc.streams[id] + if cs != nil && !cs.readAborted { + return cs } + return nil } func (cs *clientStream) copyTrailers() { @@ -2323,12 +2655,33 @@ func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error { if f.ErrCode != 0 { // TODO: deal with GOAWAY more. particularly the error code cc.vlogf("transport got GOAWAY with error code = %v", f.ErrCode) + if fn := cc.t.CountError; fn != nil { + fn("recv_goaway_" + f.ErrCode.stringToken()) + } + } cc.setGoAway(f) return nil } func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { + cc := rl.cc + // Locking both mu and wmu here allows frame encoding to read settings with only wmu held. + // Acquiring wmu when f.IsAck() is unnecessary, but convenient and mostly harmless. + cc.wmu.Lock() + defer cc.wmu.Unlock() + + if err := rl.processSettingsNoWrite(f); err != nil { + return err + } + if !f.IsAck() { + cc.fr.WriteSettingsAck() + cc.bw.Flush() + } + return nil +} + +func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc := rl.cc cc.mu.Lock() defer cc.mu.Unlock() @@ -2341,12 +2694,14 @@ func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { return ConnectionError(ErrCodeProtocol) } + var seenMaxConcurrentStreams bool err := f.ForeachSetting(func(s Setting) error { switch s.ID { case SettingMaxFrameSize: cc.maxFrameSize = s.Val case SettingMaxConcurrentStreams: cc.maxConcurrentStreams = s.Val + seenMaxConcurrentStreams = true case SettingMaxHeaderListSize: cc.peerMaxHeaderListSize = uint64(s.Val) case SettingInitialWindowSize: @@ -2378,17 +2733,23 @@ func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { return err } - cc.wmu.Lock() - defer cc.wmu.Unlock() + if !cc.seenSettings { + if !seenMaxConcurrentStreams { + // This was the servers initial SETTINGS frame and it + // didn't contain a MAX_CONCURRENT_STREAMS field so + // increase the number of concurrent streams this + // connection can establish to our default. + cc.maxConcurrentStreams = defaultMaxConcurrentStreams + } + cc.seenSettings = true + } - cc.fr.WriteSettingsAck() - cc.bw.Flush() - return cc.werr + return nil } func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { cc := rl.cc - cs := cc.streamByID(f.StreamID, false) + cs := rl.streamByID(f.StreamID) if f.StreamID != 0 && cs == nil { return nil } @@ -2408,24 +2769,22 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { } func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error { - cs := rl.cc.streamByID(f.StreamID, true) + cs := rl.streamByID(f.StreamID) if cs == nil { - // TODO: return error if server tries to RST_STEAM an idle stream + // TODO: return error if server tries to RST_STREAM an idle stream return nil } - select { - case <-cs.peerReset: - // Already reset. - // This is the only goroutine - // which closes this, so there - // isn't a race. - default: - err := streamError(cs.ID, f.ErrCode) - cs.resetErr = err - close(cs.peerReset) - cs.bufPipe.CloseWithError(err) - cs.cc.cond.Broadcast() // wake up checkResetOrDone via clientStream.awaitFlowControl + serr := streamError(cs.ID, f.ErrCode) + serr.Cause = errFromPeer + if f.ErrCode == ErrCodeProtocol { + rl.cc.SetDoNotReuse() } + if fn := cs.cc.t.CountError; fn != nil { + fn("recv_rststream_" + f.ErrCode.stringToken()) + } + cs.abortStream(serr) + + cs.bufPipe.CloseWithError(serr) return nil } @@ -2447,19 +2806,24 @@ func (cc *ClientConn) Ping(ctx context.Context) error { } cc.mu.Unlock() } - cc.wmu.Lock() - if err := cc.fr.WritePing(false, p); err != nil { - cc.wmu.Unlock() - return err - } - if err := cc.bw.Flush(); err != nil { - cc.wmu.Unlock() - return err - } - cc.wmu.Unlock() + errc := make(chan error, 1) + go func() { + cc.wmu.Lock() + defer cc.wmu.Unlock() + if err := cc.fr.WritePing(false, p); err != nil { + errc <- err + return + } + if err := cc.bw.Flush(); err != nil { + errc <- err + return + } + }() select { case <-c: return nil + case err := <-errc: + return err case <-ctx.Done(): return ctx.Err() case <-cc.readerDone: @@ -2536,6 +2900,11 @@ func (t *Transport) logf(format string, args ...interface{}) { var noBody io.ReadCloser = ioutil.NopCloser(bytes.NewReader(nil)) +type missingBody struct{} + +func (missingBody) Close() error { return nil } +func (missingBody) Read([]byte) (int, error) { return 0, io.ErrUnexpectedEOF } + func strSliceContains(ss []string, s string) bool { for _, v := range ss { if v == s { @@ -2581,87 +2950,6 @@ type errorReader struct{ err error } func (r errorReader) Read(p []byte) (int, error) { return 0, r.err } -// bodyWriterState encapsulates various state around the Transport's writing -// of the request body, particularly regarding doing delayed writes of the body -// when the request contains "Expect: 100-continue". -type bodyWriterState struct { - cs *clientStream - timer *time.Timer // if non-nil, we're doing a delayed write - fnonce *sync.Once // to call fn with - fn func() // the code to run in the goroutine, writing the body - resc chan error // result of fn's execution - delay time.Duration // how long we should delay a delayed write for -} - -func (t *Transport) getBodyWriterState(cs *clientStream, body io.Reader) (s bodyWriterState) { - s.cs = cs - if body == nil { - return - } - resc := make(chan error, 1) - s.resc = resc - s.fn = func() { - cs.cc.mu.Lock() - cs.startedWrite = true - cs.cc.mu.Unlock() - resc <- cs.writeRequestBody(body, cs.req.Body) - } - s.delay = t.expectContinueTimeout() - if s.delay == 0 || - !httpguts.HeaderValuesContainsToken( - cs.req.Header["Expect"], - "100-continue") { - return - } - s.fnonce = new(sync.Once) - - // Arm the timer with a very large duration, which we'll - // intentionally lower later. It has to be large now because - // we need a handle to it before writing the headers, but the - // s.delay value is defined to not start until after the - // request headers were written. - const hugeDuration = 365 * 24 * time.Hour - s.timer = time.AfterFunc(hugeDuration, func() { - s.fnonce.Do(s.fn) - }) - return -} - -func (s bodyWriterState) cancel() { - if s.timer != nil { - if s.timer.Stop() { - s.resc <- nil - } - } -} - -func (s bodyWriterState) on100() { - if s.timer == nil { - // If we didn't do a delayed write, ignore the server's - // bogus 100 continue response. - return - } - s.timer.Stop() - go func() { s.fnonce.Do(s.fn) }() -} - -// scheduleBodyWrite starts writing the body, either immediately (in -// the common case) or after the delay timeout. It should not be -// called until after the headers have been written. -func (s bodyWriterState) scheduleBodyWrite() { - if s.timer == nil { - // We're not doing a delayed write (see - // getBodyWriterState), so just start the writing - // goroutine immediately. - go s.fn() - return - } - traceWait100Continue(s.cs.trace) - if s.timer.Stop() { - s.timer.Reset(s.delay) - } -} - // isConnectionCloseRequest reports whether req should use its own // connection for a single request and then close the connection. func isConnectionCloseRequest(req *http.Request) bool { diff --git a/ibm/vendor/golang.org/x/net/http2/writesched.go b/ibm/vendor/golang.org/x/net/http2/writesched.go index f24d2b1e7d..c7cd001739 100644 --- a/ibm/vendor/golang.org/x/net/http2/writesched.go +++ b/ibm/vendor/golang.org/x/net/http2/writesched.go @@ -32,7 +32,8 @@ type WriteScheduler interface { // Pop dequeues the next frame to write. Returns false if no frames can // be written. Frames with a given wr.StreamID() are Pop'd in the same - // order they are Push'd. No frames should be discarded except by CloseStream. + // order they are Push'd, except RST_STREAM frames. No frames should be + // discarded except by CloseStream. Pop() (wr FrameWriteRequest, ok bool) } @@ -52,6 +53,7 @@ type FrameWriteRequest struct { // stream is the stream on which this frame will be written. // nil for non-stream frames like PING and SETTINGS. + // nil for RST_STREAM streams, which use the StreamError.StreamID field instead. stream *stream // done, if non-nil, must be a buffered channel with space for diff --git a/ibm/vendor/golang.org/x/net/http2/writesched_random.go b/ibm/vendor/golang.org/x/net/http2/writesched_random.go index 9a7b9e581c..f2e55e05ce 100644 --- a/ibm/vendor/golang.org/x/net/http2/writesched_random.go +++ b/ibm/vendor/golang.org/x/net/http2/writesched_random.go @@ -45,11 +45,11 @@ func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityP } func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { - id := wr.StreamID() - if id == 0 { + if wr.isControl() { ws.zero.push(wr) return } + id := wr.StreamID() q, ok := ws.sq[id] if !ok { q = ws.queuePool.get() @@ -59,7 +59,7 @@ func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { } func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) { - // Control frames first. + // Control and RST_STREAM frames first. if !ws.zero.empty() { return ws.zero.shift(), true } diff --git a/ibm/vendor/golang.org/x/net/idna/go118.go b/ibm/vendor/golang.org/x/net/idna/go118.go new file mode 100644 index 0000000000..c5c4338dbe --- /dev/null +++ b/ibm/vendor/golang.org/x/net/idna/go118.go @@ -0,0 +1,14 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.18 +// +build go1.18 + +package idna + +// Transitional processing is disabled by default in Go 1.18. +// https://golang.org/issue/47510 +const transitionalLookup = false diff --git a/ibm/vendor/golang.org/x/net/idna/idna10.0.0.go b/ibm/vendor/golang.org/x/net/idna/idna10.0.0.go index 5208ba6cb8..64ccf85feb 100644 --- a/ibm/vendor/golang.org/x/net/idna/idna10.0.0.go +++ b/ibm/vendor/golang.org/x/net/idna/idna10.0.0.go @@ -59,10 +59,10 @@ type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 -// compatibility. It is used by most browsers when resolving domain names. This +// compatibility. It is used by some browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { - return func(o *options) { o.transitional = true } + return func(o *options) { o.transitional = transitional } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts @@ -284,7 +284,7 @@ var ( punycode = &Profile{} lookup = &Profile{options{ - transitional: true, + transitional: transitionalLookup, useSTD3Rules: true, checkHyphens: true, checkJoiners: true, diff --git a/ibm/vendor/golang.org/x/net/idna/idna9.0.0.go b/ibm/vendor/golang.org/x/net/idna/idna9.0.0.go index 55f718f127..aae6aac872 100644 --- a/ibm/vendor/golang.org/x/net/idna/idna9.0.0.go +++ b/ibm/vendor/golang.org/x/net/idna/idna9.0.0.go @@ -58,10 +58,10 @@ type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 -// compatibility. It is used by most browsers when resolving domain names. This +// compatibility. It is used by some browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { - return func(o *options) { o.transitional = true } + return func(o *options) { o.transitional = transitional } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts diff --git a/ibm/vendor/golang.org/x/net/idna/pre_go118.go b/ibm/vendor/golang.org/x/net/idna/pre_go118.go new file mode 100644 index 0000000000..3aaccab1c5 --- /dev/null +++ b/ibm/vendor/golang.org/x/net/idna/pre_go118.go @@ -0,0 +1,12 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.18 +// +build !go1.18 + +package idna + +const transitionalLookup = true diff --git a/ibm/vendor/golang.org/x/net/idna/punycode.go b/ibm/vendor/golang.org/x/net/idna/punycode.go index 02c7d59af3..e8e3ac11a9 100644 --- a/ibm/vendor/golang.org/x/net/idna/punycode.go +++ b/ibm/vendor/golang.org/x/net/idna/punycode.go @@ -49,6 +49,7 @@ func decode(encoded string) (string, error) { } } i, n, bias := int32(0), initialN, initialBias + overflow := false for pos < len(encoded) { oldI, w := i, int32(1) for k := base; ; k += base { @@ -60,29 +61,32 @@ func decode(encoded string) (string, error) { return "", punyError(encoded) } pos++ - i += digit * w - if i < 0 { + i, overflow = madd(i, digit, w) + if overflow { return "", punyError(encoded) } t := k - bias - if t < tmin { + if k <= bias { t = tmin - } else if t > tmax { + } else if k >= bias+tmax { t = tmax } if digit < t { break } - w *= base - t - if w >= math.MaxInt32/base { + w, overflow = madd(0, w, base-t) + if overflow { return "", punyError(encoded) } } + if len(output) >= 1024 { + return "", punyError(encoded) + } x := int32(len(output) + 1) bias = adapt(i-oldI, x, oldI == 0) n += i / x i %= x - if n > utf8.MaxRune || len(output) >= 1024 { + if n < 0 || n > utf8.MaxRune { return "", punyError(encoded) } output = append(output, 0) @@ -115,6 +119,7 @@ func encode(prefix, s string) (string, error) { if b > 0 { output = append(output, '-') } + overflow := false for remaining != 0 { m := int32(0x7fffffff) for _, r := range s { @@ -122,8 +127,8 @@ func encode(prefix, s string) (string, error) { m = r } } - delta += (m - n) * (h + 1) - if delta < 0 { + delta, overflow = madd(delta, m-n, h+1) + if overflow { return "", punyError(s) } n = m @@ -141,9 +146,9 @@ func encode(prefix, s string) (string, error) { q := delta for k := base; ; k += base { t := k - bias - if t < tmin { + if k <= bias { t = tmin - } else if t > tmax { + } else if k >= bias+tmax { t = tmax } if q < t { @@ -164,6 +169,15 @@ func encode(prefix, s string) (string, error) { return string(output), nil } +// madd computes a + (b * c), detecting overflow. +func madd(a, b, c int32) (next int32, overflow bool) { + p := int64(b) * int64(c) + if p > math.MaxInt32-int64(a) { + return 0, true + } + return a + int32(p), false +} + func decodeDigit(x byte) (digit int32, ok bool) { switch { case '0' <= x && x <= '9': diff --git a/ibm/vendor/golang.org/x/oauth2/.travis.yml b/ibm/vendor/golang.org/x/oauth2/.travis.yml deleted file mode 100644 index fa139db225..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - tip - -install: - - export GOPATH="$HOME/gopath" - - mkdir -p "$GOPATH/src/golang.org/x" - - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" - - go get -v -t -d golang.org/x/oauth2/... - -script: - - go test -v golang.org/x/oauth2/... diff --git a/ibm/vendor/golang.org/x/oauth2/AUTHORS b/ibm/vendor/golang.org/x/oauth2/AUTHORS deleted file mode 100644 index 15167cd746..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/ibm/vendor/golang.org/x/oauth2/CONTRIBUTING.md b/ibm/vendor/golang.org/x/oauth2/CONTRIBUTING.md deleted file mode 100644 index dfbed62cf5..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# Contributing to Go - -Go is an open source project. - -It is the work of hundreds of contributors. We appreciate your help! - -## Filing issues - -When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: - -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? - -General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. -The gophers there will answer or ask you to file an issue if you've tripped over a bug. - -## Contributing code - -Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) -before sending patches. - -Unless otherwise noted, the Go source files are distributed under -the BSD-style license found in the LICENSE file. diff --git a/ibm/vendor/golang.org/x/oauth2/CONTRIBUTORS b/ibm/vendor/golang.org/x/oauth2/CONTRIBUTORS deleted file mode 100644 index 1c4577e968..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/ibm/vendor/golang.org/x/oauth2/LICENSE b/ibm/vendor/golang.org/x/oauth2/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/golang.org/x/oauth2/README.md b/ibm/vendor/golang.org/x/oauth2/README.md deleted file mode 100644 index 8cfd6063e7..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# OAuth2 for Go - -[![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) -[![GoDoc](https://godoc.org/golang.org/x/oauth2?status.svg)](https://godoc.org/golang.org/x/oauth2) - -oauth2 package contains a client implementation for OAuth 2.0 spec. - -## Installation - -~~~~ -go get golang.org/x/oauth2 -~~~~ - -Or you can manually git clone the repository to -`$(go env GOPATH)/src/golang.org/x/oauth2`. - -See godoc for further documentation and examples. - -* [godoc.org/golang.org/x/oauth2](https://godoc.org/golang.org/x/oauth2) -* [godoc.org/golang.org/x/oauth2/google](https://godoc.org/golang.org/x/oauth2/google) - -## Policy for new packages - -We no longer accept new provider-specific packages in this repo if all -they do is add a single endpoint variable. If you just want to add a -single endpoint, add it to the -[godoc.org/golang.org/x/oauth2/endpoints](https://godoc.org/golang.org/x/oauth2/endpoints) -package. - -## Report Issues / Send Patches - -This repository uses Gerrit for code changes. To learn how to submit changes to -this repository, see https://golang.org/doc/contribute.html. - -The main issue tracker for the oauth2 repository is located at -https://github.com/golang/oauth2/issues. diff --git a/ibm/vendor/golang.org/x/oauth2/google/appengine.go b/ibm/vendor/golang.org/x/oauth2/google/appengine.go deleted file mode 100644 index feb1157b15..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/appengine.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package google - -import ( - "context" - "time" - - "golang.org/x/oauth2" -) - -// Set at init time by appengine_gen1.go. If nil, we're not on App Engine standard first generation (<= Go 1.9) or App Engine flexible. -var appengineTokenFunc func(c context.Context, scopes ...string) (token string, expiry time.Time, err error) - -// Set at init time by appengine_gen1.go. If nil, we're not on App Engine standard first generation (<= Go 1.9) or App Engine flexible. -var appengineAppIDFunc func(c context.Context) string - -// AppEngineTokenSource returns a token source that fetches tokens from either -// the current application's service account or from the metadata server, -// depending on the App Engine environment. See below for environment-specific -// details. If you are implementing a 3-legged OAuth 2.0 flow on App Engine that -// involves user accounts, see oauth2.Config instead. -// -// First generation App Engine runtimes (<= Go 1.9): -// AppEngineTokenSource returns a token source that fetches tokens issued to the -// current App Engine application's service account. The provided context must have -// come from appengine.NewContext. -// -// Second generation App Engine runtimes (>= Go 1.11) and App Engine flexible: -// AppEngineTokenSource is DEPRECATED on second generation runtimes and on the -// flexible environment. It delegates to ComputeTokenSource, and the provided -// context and scopes are not used. Please use DefaultTokenSource (or ComputeTokenSource, -// which DefaultTokenSource will use in this case) instead. -func AppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - return appEngineTokenSource(ctx, scope...) -} diff --git a/ibm/vendor/golang.org/x/oauth2/google/appengine_gen1.go b/ibm/vendor/golang.org/x/oauth2/google/appengine_gen1.go deleted file mode 100644 index 83dacac320..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/appengine_gen1.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine - -// This file applies to App Engine first generation runtimes (<= Go 1.9). - -package google - -import ( - "context" - "sort" - "strings" - "sync" - - "golang.org/x/oauth2" - "google.golang.org/appengine" -) - -func init() { - appengineTokenFunc = appengine.AccessToken - appengineAppIDFunc = appengine.AppID -} - -// See comment on AppEngineTokenSource in appengine.go. -func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - scopes := append([]string{}, scope...) - sort.Strings(scopes) - return &gaeTokenSource{ - ctx: ctx, - scopes: scopes, - key: strings.Join(scopes, " "), - } -} - -// aeTokens helps the fetched tokens to be reused until their expiration. -var ( - aeTokensMu sync.Mutex - aeTokens = make(map[string]*tokenLock) // key is space-separated scopes -) - -type tokenLock struct { - mu sync.Mutex // guards t; held while fetching or updating t - t *oauth2.Token -} - -type gaeTokenSource struct { - ctx context.Context - scopes []string - key string // to aeTokens map; space-separated scopes -} - -func (ts *gaeTokenSource) Token() (*oauth2.Token, error) { - aeTokensMu.Lock() - tok, ok := aeTokens[ts.key] - if !ok { - tok = &tokenLock{} - aeTokens[ts.key] = tok - } - aeTokensMu.Unlock() - - tok.mu.Lock() - defer tok.mu.Unlock() - if tok.t.Valid() { - return tok.t, nil - } - access, exp, err := appengineTokenFunc(ts.ctx, ts.scopes...) - if err != nil { - return nil, err - } - tok.t = &oauth2.Token{ - AccessToken: access, - Expiry: exp, - } - return tok.t, nil -} diff --git a/ibm/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go b/ibm/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go deleted file mode 100644 index 04c2c2216a..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !appengine - -// This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible. - -package google - -import ( - "context" - "log" - "sync" - - "golang.org/x/oauth2" -) - -var logOnce sync.Once // only spam about deprecation once - -// See comment on AppEngineTokenSource in appengine.go. -func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - logOnce.Do(func() { - log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") - }) - return ComputeTokenSource("") -} diff --git a/ibm/vendor/golang.org/x/oauth2/google/default.go b/ibm/vendor/golang.org/x/oauth2/google/default.go deleted file mode 100644 index ad2c09236c..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/default.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package google - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "os" - "path/filepath" - "runtime" - - "cloud.google.com/go/compute/metadata" - "golang.org/x/oauth2" -) - -// Credentials holds Google credentials, including "Application Default Credentials". -// For more details, see: -// https://developers.google.com/accounts/docs/application-default-credentials -type Credentials struct { - ProjectID string // may be empty - TokenSource oauth2.TokenSource - - // JSON contains the raw bytes from a JSON credentials file. - // This field may be nil if authentication is provided by the - // environment and not with a credentials file, e.g. when code is - // running on Google Cloud Platform. - JSON []byte -} - -// DefaultCredentials is the old name of Credentials. -// -// Deprecated: use Credentials instead. -type DefaultCredentials = Credentials - -// DefaultClient returns an HTTP Client that uses the -// DefaultTokenSource to obtain authentication credentials. -func DefaultClient(ctx context.Context, scope ...string) (*http.Client, error) { - ts, err := DefaultTokenSource(ctx, scope...) - if err != nil { - return nil, err - } - return oauth2.NewClient(ctx, ts), nil -} - -// DefaultTokenSource returns the token source for -// "Application Default Credentials". -// It is a shortcut for FindDefaultCredentials(ctx, scope).TokenSource. -func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSource, error) { - creds, err := FindDefaultCredentials(ctx, scope...) - if err != nil { - return nil, err - } - return creds.TokenSource, nil -} - -// FindDefaultCredentials searches for "Application Default Credentials". -// -// It looks for credentials in the following places, -// preferring the first location found: -// -// 1. A JSON file whose path is specified by the -// GOOGLE_APPLICATION_CREDENTIALS environment variable. -// 2. A JSON file in a location known to the gcloud command-line tool. -// On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. -// On other systems, $HOME/.config/gcloud/application_default_credentials.json. -// 3. On Google App Engine standard first generation runtimes (<= Go 1.9) it uses -// the appengine.AccessToken function. -// 4. On Google Compute Engine, Google App Engine standard second generation runtimes -// (>= Go 1.11), and Google App Engine flexible environment, it fetches -// credentials from the metadata server. -func FindDefaultCredentials(ctx context.Context, scopes ...string) (*Credentials, error) { - // First, try the environment variable. - const envVar = "GOOGLE_APPLICATION_CREDENTIALS" - if filename := os.Getenv(envVar); filename != "" { - creds, err := readCredentialsFile(ctx, filename, scopes) - if err != nil { - return nil, fmt.Errorf("google: error getting credentials using %v environment variable: %v", envVar, err) - } - return creds, nil - } - - // Second, try a well-known file. - filename := wellKnownFile() - if creds, err := readCredentialsFile(ctx, filename, scopes); err == nil { - return creds, nil - } else if !os.IsNotExist(err) { - return nil, fmt.Errorf("google: error getting credentials using well-known file (%v): %v", filename, err) - } - - // Third, if we're on a Google App Engine standard first generation runtime (<= Go 1.9) - // use those credentials. App Engine standard second generation runtimes (>= Go 1.11) - // and App Engine flexible use ComputeTokenSource and the metadata server. - if appengineTokenFunc != nil { - return &DefaultCredentials{ - ProjectID: appengineAppIDFunc(ctx), - TokenSource: AppEngineTokenSource(ctx, scopes...), - }, nil - } - - // Fourth, if we're on Google Compute Engine, an App Engine standard second generation runtime, - // or App Engine flexible, use the metadata server. - if metadata.OnGCE() { - id, _ := metadata.ProjectID() - return &DefaultCredentials{ - ProjectID: id, - TokenSource: ComputeTokenSource("", scopes...), - }, nil - } - - // None are found; return helpful error. - const url = "https://developers.google.com/accounts/docs/application-default-credentials" - return nil, fmt.Errorf("google: could not find default credentials. See %v for more information.", url) -} - -// CredentialsFromJSON obtains Google credentials from a JSON value. The JSON can -// represent either a Google Developers Console client_credentials.json file (as in -// ConfigFromJSON) or a Google Developers service account key file (as in -// JWTConfigFromJSON). -func CredentialsFromJSON(ctx context.Context, jsonData []byte, scopes ...string) (*Credentials, error) { - var f credentialsFile - if err := json.Unmarshal(jsonData, &f); err != nil { - return nil, err - } - ts, err := f.tokenSource(ctx, append([]string(nil), scopes...)) - if err != nil { - return nil, err - } - return &DefaultCredentials{ - ProjectID: f.ProjectID, - TokenSource: ts, - JSON: jsonData, - }, nil -} - -func wellKnownFile() string { - const f = "application_default_credentials.json" - if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "gcloud", f) - } - return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", f) -} - -func readCredentialsFile(ctx context.Context, filename string, scopes []string) (*DefaultCredentials, error) { - b, err := ioutil.ReadFile(filename) - if err != nil { - return nil, err - } - return CredentialsFromJSON(ctx, b, scopes...) -} diff --git a/ibm/vendor/golang.org/x/oauth2/google/doc.go b/ibm/vendor/golang.org/x/oauth2/google/doc.go deleted file mode 100644 index 73be629033..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/doc.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package google provides support for making OAuth2 authorized and authenticated -// HTTP requests to Google APIs. It supports the Web server flow, client-side -// credentials, service accounts, Google Compute Engine service accounts, and Google -// App Engine service accounts. -// -// A brief overview of the package follows. For more information, please read -// https://developers.google.com/accounts/docs/OAuth2 -// and -// https://developers.google.com/accounts/docs/application-default-credentials. -// -// OAuth2 Configs -// -// Two functions in this package return golang.org/x/oauth2.Config values from Google credential -// data. Google supports two JSON formats for OAuth2 credentials: one is handled by ConfigFromJSON, -// the other by JWTConfigFromJSON. The returned Config can be used to obtain a TokenSource or -// create an http.Client. -// -// -// Credentials -// -// The Credentials type represents Google credentials, including Application Default -// Credentials. -// -// Use FindDefaultCredentials to obtain Application Default Credentials. -// FindDefaultCredentials looks in some well-known places for a credentials file, and -// will call AppEngineTokenSource or ComputeTokenSource as needed. -// -// DefaultClient and DefaultTokenSource are convenience methods. They first call FindDefaultCredentials, -// then use the credentials to construct an http.Client or an oauth2.TokenSource. -// -// Use CredentialsFromJSON to obtain credentials from either of the two JSON formats -// described in OAuth2 Configs, above. The TokenSource in the returned value is the -// same as the one obtained from the oauth2.Config returned from ConfigFromJSON or -// JWTConfigFromJSON, but the Credentials may contain additional information -// that is useful is some circumstances. -package google // import "golang.org/x/oauth2/google" diff --git a/ibm/vendor/golang.org/x/oauth2/google/google.go b/ibm/vendor/golang.org/x/oauth2/google/google.go deleted file mode 100644 index 81de32b360..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/google.go +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package google - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/url" - "strings" - "time" - - "cloud.google.com/go/compute/metadata" - "golang.org/x/oauth2" - "golang.org/x/oauth2/jwt" -) - -// Endpoint is Google's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://accounts.google.com/o/oauth2/auth", - TokenURL: "https://oauth2.googleapis.com/token", - AuthStyle: oauth2.AuthStyleInParams, -} - -// JWTTokenURL is Google's OAuth 2.0 token URL to use with the JWT flow. -const JWTTokenURL = "https://oauth2.googleapis.com/token" - -// ConfigFromJSON uses a Google Developers Console client_credentials.json -// file to construct a config. -// client_credentials.json can be downloaded from -// https://console.developers.google.com, under "Credentials". Download the Web -// application credentials in the JSON format and provide the contents of the -// file as jsonKey. -func ConfigFromJSON(jsonKey []byte, scope ...string) (*oauth2.Config, error) { - type cred struct { - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - RedirectURIs []string `json:"redirect_uris"` - AuthURI string `json:"auth_uri"` - TokenURI string `json:"token_uri"` - } - var j struct { - Web *cred `json:"web"` - Installed *cred `json:"installed"` - } - if err := json.Unmarshal(jsonKey, &j); err != nil { - return nil, err - } - var c *cred - switch { - case j.Web != nil: - c = j.Web - case j.Installed != nil: - c = j.Installed - default: - return nil, fmt.Errorf("oauth2/google: no credentials found") - } - if len(c.RedirectURIs) < 1 { - return nil, errors.New("oauth2/google: missing redirect URL in the client_credentials.json") - } - return &oauth2.Config{ - ClientID: c.ClientID, - ClientSecret: c.ClientSecret, - RedirectURL: c.RedirectURIs[0], - Scopes: scope, - Endpoint: oauth2.Endpoint{ - AuthURL: c.AuthURI, - TokenURL: c.TokenURI, - }, - }, nil -} - -// JWTConfigFromJSON uses a Google Developers service account JSON key file to read -// the credentials that authorize and authenticate the requests. -// Create a service account on "Credentials" for your project at -// https://console.developers.google.com to download a JSON key file. -func JWTConfigFromJSON(jsonKey []byte, scope ...string) (*jwt.Config, error) { - var f credentialsFile - if err := json.Unmarshal(jsonKey, &f); err != nil { - return nil, err - } - if f.Type != serviceAccountKey { - return nil, fmt.Errorf("google: read JWT from JSON credentials: 'type' field is %q (expected %q)", f.Type, serviceAccountKey) - } - scope = append([]string(nil), scope...) // copy - return f.jwtConfig(scope), nil -} - -// JSON key file types. -const ( - serviceAccountKey = "service_account" - userCredentialsKey = "authorized_user" -) - -// credentialsFile is the unmarshalled representation of a credentials file. -type credentialsFile struct { - Type string `json:"type"` // serviceAccountKey or userCredentialsKey - - // Service Account fields - ClientEmail string `json:"client_email"` - PrivateKeyID string `json:"private_key_id"` - PrivateKey string `json:"private_key"` - TokenURL string `json:"token_uri"` - ProjectID string `json:"project_id"` - - // User Credential fields - // (These typically come from gcloud auth.) - ClientSecret string `json:"client_secret"` - ClientID string `json:"client_id"` - RefreshToken string `json:"refresh_token"` -} - -func (f *credentialsFile) jwtConfig(scopes []string) *jwt.Config { - cfg := &jwt.Config{ - Email: f.ClientEmail, - PrivateKey: []byte(f.PrivateKey), - PrivateKeyID: f.PrivateKeyID, - Scopes: scopes, - TokenURL: f.TokenURL, - } - if cfg.TokenURL == "" { - cfg.TokenURL = JWTTokenURL - } - return cfg -} - -func (f *credentialsFile) tokenSource(ctx context.Context, scopes []string) (oauth2.TokenSource, error) { - switch f.Type { - case serviceAccountKey: - cfg := f.jwtConfig(scopes) - return cfg.TokenSource(ctx), nil - case userCredentialsKey: - cfg := &oauth2.Config{ - ClientID: f.ClientID, - ClientSecret: f.ClientSecret, - Scopes: scopes, - Endpoint: Endpoint, - } - tok := &oauth2.Token{RefreshToken: f.RefreshToken} - return cfg.TokenSource(ctx, tok), nil - case "": - return nil, errors.New("missing 'type' field in credentials") - default: - return nil, fmt.Errorf("unknown credential type: %q", f.Type) - } -} - -// ComputeTokenSource returns a token source that fetches access tokens -// from Google Compute Engine (GCE)'s metadata server. It's only valid to use -// this token source if your program is running on a GCE instance. -// If no account is specified, "default" is used. -// If no scopes are specified, a set of default scopes are automatically granted. -// Further information about retrieving access tokens from the GCE metadata -// server can be found at https://cloud.google.com/compute/docs/authentication. -func ComputeTokenSource(account string, scope ...string) oauth2.TokenSource { - return oauth2.ReuseTokenSource(nil, computeSource{account: account, scopes: scope}) -} - -type computeSource struct { - account string - scopes []string -} - -func (cs computeSource) Token() (*oauth2.Token, error) { - if !metadata.OnGCE() { - return nil, errors.New("oauth2/google: can't get a token from the metadata service; not running on GCE") - } - acct := cs.account - if acct == "" { - acct = "default" - } - tokenURI := "instance/service-accounts/" + acct + "/token" - if len(cs.scopes) > 0 { - v := url.Values{} - v.Set("scopes", strings.Join(cs.scopes, ",")) - tokenURI = tokenURI + "?" + v.Encode() - } - tokenJSON, err := metadata.Get(tokenURI) - if err != nil { - return nil, err - } - var res struct { - AccessToken string `json:"access_token"` - ExpiresInSec int `json:"expires_in"` - TokenType string `json:"token_type"` - } - err = json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res) - if err != nil { - return nil, fmt.Errorf("oauth2/google: invalid token JSON from metadata: %v", err) - } - if res.ExpiresInSec == 0 || res.AccessToken == "" { - return nil, fmt.Errorf("oauth2/google: incomplete token received from metadata") - } - tok := &oauth2.Token{ - AccessToken: res.AccessToken, - TokenType: res.TokenType, - Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second), - } - // NOTE(cbro): add hidden metadata about where the token is from. - // This is needed for detection by client libraries to know that credentials come from the metadata server. - // This may be removed in a future version of this library. - return tok.WithExtra(map[string]interface{}{ - "oauth2.google.tokenSource": "compute-metadata", - "oauth2.google.serviceAccount": acct, - }), nil -} diff --git a/ibm/vendor/golang.org/x/oauth2/google/jwt.go b/ibm/vendor/golang.org/x/oauth2/google/jwt.go deleted file mode 100644 index b0fdb3a888..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/jwt.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package google - -import ( - "crypto/rsa" - "fmt" - "time" - - "golang.org/x/oauth2" - "golang.org/x/oauth2/internal" - "golang.org/x/oauth2/jws" -) - -// JWTAccessTokenSourceFromJSON uses a Google Developers service account JSON -// key file to read the credentials that authorize and authenticate the -// requests, and returns a TokenSource that does not use any OAuth2 flow but -// instead creates a JWT and sends that as the access token. -// The audience is typically a URL that specifies the scope of the credentials. -// -// Note that this is not a standard OAuth flow, but rather an -// optimization supported by a few Google services. -// Unless you know otherwise, you should use JWTConfigFromJSON instead. -func JWTAccessTokenSourceFromJSON(jsonKey []byte, audience string) (oauth2.TokenSource, error) { - cfg, err := JWTConfigFromJSON(jsonKey) - if err != nil { - return nil, fmt.Errorf("google: could not parse JSON key: %v", err) - } - pk, err := internal.ParseKey(cfg.PrivateKey) - if err != nil { - return nil, fmt.Errorf("google: could not parse key: %v", err) - } - ts := &jwtAccessTokenSource{ - email: cfg.Email, - audience: audience, - pk: pk, - pkID: cfg.PrivateKeyID, - } - tok, err := ts.Token() - if err != nil { - return nil, err - } - return oauth2.ReuseTokenSource(tok, ts), nil -} - -type jwtAccessTokenSource struct { - email, audience string - pk *rsa.PrivateKey - pkID string -} - -func (ts *jwtAccessTokenSource) Token() (*oauth2.Token, error) { - iat := time.Now() - exp := iat.Add(time.Hour) - cs := &jws.ClaimSet{ - Iss: ts.email, - Sub: ts.email, - Aud: ts.audience, - Iat: iat.Unix(), - Exp: exp.Unix(), - } - hdr := &jws.Header{ - Algorithm: "RS256", - Typ: "JWT", - KeyID: string(ts.pkID), - } - msg, err := jws.Encode(hdr, cs, ts.pk) - if err != nil { - return nil, fmt.Errorf("google: could not encode JWT: %v", err) - } - return &oauth2.Token{AccessToken: msg, TokenType: "Bearer", Expiry: exp}, nil -} diff --git a/ibm/vendor/golang.org/x/oauth2/google/sdk.go b/ibm/vendor/golang.org/x/oauth2/google/sdk.go deleted file mode 100644 index 456224bc78..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/google/sdk.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package google - -import ( - "bufio" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "os" - "os/user" - "path/filepath" - "runtime" - "strings" - "time" - - "golang.org/x/oauth2" -) - -type sdkCredentials struct { - Data []struct { - Credential struct { - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - AccessToken string `json:"access_token"` - RefreshToken string `json:"refresh_token"` - TokenExpiry *time.Time `json:"token_expiry"` - } `json:"credential"` - Key struct { - Account string `json:"account"` - Scope string `json:"scope"` - } `json:"key"` - } -} - -// An SDKConfig provides access to tokens from an account already -// authorized via the Google Cloud SDK. -type SDKConfig struct { - conf oauth2.Config - initialToken *oauth2.Token -} - -// NewSDKConfig creates an SDKConfig for the given Google Cloud SDK -// account. If account is empty, the account currently active in -// Google Cloud SDK properties is used. -// Google Cloud SDK credentials must be created by running `gcloud auth` -// before using this function. -// The Google Cloud SDK is available at https://cloud.google.com/sdk/. -func NewSDKConfig(account string) (*SDKConfig, error) { - configPath, err := sdkConfigPath() - if err != nil { - return nil, fmt.Errorf("oauth2/google: error getting SDK config path: %v", err) - } - credentialsPath := filepath.Join(configPath, "credentials") - f, err := os.Open(credentialsPath) - if err != nil { - return nil, fmt.Errorf("oauth2/google: failed to load SDK credentials: %v", err) - } - defer f.Close() - - var c sdkCredentials - if err := json.NewDecoder(f).Decode(&c); err != nil { - return nil, fmt.Errorf("oauth2/google: failed to decode SDK credentials from %q: %v", credentialsPath, err) - } - if len(c.Data) == 0 { - return nil, fmt.Errorf("oauth2/google: no credentials found in %q, run `gcloud auth login` to create one", credentialsPath) - } - if account == "" { - propertiesPath := filepath.Join(configPath, "properties") - f, err := os.Open(propertiesPath) - if err != nil { - return nil, fmt.Errorf("oauth2/google: failed to load SDK properties: %v", err) - } - defer f.Close() - ini, err := parseINI(f) - if err != nil { - return nil, fmt.Errorf("oauth2/google: failed to parse SDK properties %q: %v", propertiesPath, err) - } - core, ok := ini["core"] - if !ok { - return nil, fmt.Errorf("oauth2/google: failed to find [core] section in %v", ini) - } - active, ok := core["account"] - if !ok { - return nil, fmt.Errorf("oauth2/google: failed to find %q attribute in %v", "account", core) - } - account = active - } - - for _, d := range c.Data { - if account == "" || d.Key.Account == account { - if d.Credential.AccessToken == "" && d.Credential.RefreshToken == "" { - return nil, fmt.Errorf("oauth2/google: no token available for account %q", account) - } - var expiry time.Time - if d.Credential.TokenExpiry != nil { - expiry = *d.Credential.TokenExpiry - } - return &SDKConfig{ - conf: oauth2.Config{ - ClientID: d.Credential.ClientID, - ClientSecret: d.Credential.ClientSecret, - Scopes: strings.Split(d.Key.Scope, " "), - Endpoint: Endpoint, - RedirectURL: "oob", - }, - initialToken: &oauth2.Token{ - AccessToken: d.Credential.AccessToken, - RefreshToken: d.Credential.RefreshToken, - Expiry: expiry, - }, - }, nil - } - } - return nil, fmt.Errorf("oauth2/google: no such credentials for account %q", account) -} - -// Client returns an HTTP client using Google Cloud SDK credentials to -// authorize requests. The token will auto-refresh as necessary. The -// underlying http.RoundTripper will be obtained using the provided -// context. The returned client and its Transport should not be -// modified. -func (c *SDKConfig) Client(ctx context.Context) *http.Client { - return &http.Client{ - Transport: &oauth2.Transport{ - Source: c.TokenSource(ctx), - }, - } -} - -// TokenSource returns an oauth2.TokenSource that retrieve tokens from -// Google Cloud SDK credentials using the provided context. -// It will returns the current access token stored in the credentials, -// and refresh it when it expires, but it won't update the credentials -// with the new access token. -func (c *SDKConfig) TokenSource(ctx context.Context) oauth2.TokenSource { - return c.conf.TokenSource(ctx, c.initialToken) -} - -// Scopes are the OAuth 2.0 scopes the current account is authorized for. -func (c *SDKConfig) Scopes() []string { - return c.conf.Scopes -} - -func parseINI(ini io.Reader) (map[string]map[string]string, error) { - result := map[string]map[string]string{ - "": {}, // root section - } - scanner := bufio.NewScanner(ini) - currentSection := "" - for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) - if strings.HasPrefix(line, ";") { - // comment. - continue - } - if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") { - currentSection = strings.TrimSpace(line[1 : len(line)-1]) - result[currentSection] = map[string]string{} - continue - } - parts := strings.SplitN(line, "=", 2) - if len(parts) == 2 && parts[0] != "" { - result[currentSection][strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1]) - } - } - if err := scanner.Err(); err != nil { - return nil, fmt.Errorf("error scanning ini: %v", err) - } - return result, nil -} - -// sdkConfigPath tries to guess where the gcloud config is located. -// It can be overridden during tests. -var sdkConfigPath = func() (string, error) { - if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "gcloud"), nil - } - homeDir := guessUnixHomeDir() - if homeDir == "" { - return "", errors.New("unable to get current user home directory: os/user lookup failed; $HOME is empty") - } - return filepath.Join(homeDir, ".config", "gcloud"), nil -} - -func guessUnixHomeDir() string { - // Prefer $HOME over user.Current due to glibc bug: golang.org/issue/13470 - if v := os.Getenv("HOME"); v != "" { - return v - } - // Else, fall back to user.Current: - if u, err := user.Current(); err == nil { - return u.HomeDir - } - return "" -} diff --git a/ibm/vendor/golang.org/x/oauth2/internal/client_appengine.go b/ibm/vendor/golang.org/x/oauth2/internal/client_appengine.go deleted file mode 100644 index 7434871880..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/internal/client_appengine.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine - -package internal - -import "google.golang.org/appengine/urlfetch" - -func init() { - appengineClientHook = urlfetch.Client -} diff --git a/ibm/vendor/golang.org/x/oauth2/internal/doc.go b/ibm/vendor/golang.org/x/oauth2/internal/doc.go deleted file mode 100644 index 03265e888a..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/internal/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package internal contains support packages for oauth2 package. -package internal diff --git a/ibm/vendor/golang.org/x/oauth2/internal/oauth2.go b/ibm/vendor/golang.org/x/oauth2/internal/oauth2.go deleted file mode 100644 index c0ab196cf4..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/internal/oauth2.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "errors" - "fmt" -) - -// ParseKey converts the binary contents of a private key file -// to an *rsa.PrivateKey. It detects whether the private key is in a -// PEM container or not. If so, it extracts the the private key -// from PEM container before conversion. It only supports PEM -// containers with no passphrase. -func ParseKey(key []byte) (*rsa.PrivateKey, error) { - block, _ := pem.Decode(key) - if block != nil { - key = block.Bytes - } - parsedKey, err := x509.ParsePKCS8PrivateKey(key) - if err != nil { - parsedKey, err = x509.ParsePKCS1PrivateKey(key) - if err != nil { - return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8; parse error: %v", err) - } - } - parsed, ok := parsedKey.(*rsa.PrivateKey) - if !ok { - return nil, errors.New("private key is invalid") - } - return parsed, nil -} diff --git a/ibm/vendor/golang.org/x/oauth2/internal/token.go b/ibm/vendor/golang.org/x/oauth2/internal/token.go deleted file mode 100644 index 355c386961..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/internal/token.go +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "math" - "mime" - "net/http" - "net/url" - "strconv" - "strings" - "sync" - "time" - - "golang.org/x/net/context/ctxhttp" -) - -// Token represents the credentials used to authorize -// the requests to access protected resources on the OAuth 2.0 -// provider's backend. -// -// This type is a mirror of oauth2.Token and exists to break -// an otherwise-circular dependency. Other internal packages -// should convert this Token into an oauth2.Token before use. -type Token struct { - // AccessToken is the token that authorizes and authenticates - // the requests. - AccessToken string - - // TokenType is the type of token. - // The Type method returns either this or "Bearer", the default. - TokenType string - - // RefreshToken is a token that's used by the application - // (as opposed to the user) to refresh the access token - // if it expires. - RefreshToken string - - // Expiry is the optional expiration time of the access token. - // - // If zero, TokenSource implementations will reuse the same - // token forever and RefreshToken or equivalent - // mechanisms for that TokenSource will not be used. - Expiry time.Time - - // Raw optionally contains extra metadata from the server - // when updating a token. - Raw interface{} -} - -// tokenJSON is the struct representing the HTTP response from OAuth2 -// providers returning a token in JSON form. -type tokenJSON struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - RefreshToken string `json:"refresh_token"` - ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number -} - -func (e *tokenJSON) expiry() (t time.Time) { - if v := e.ExpiresIn; v != 0 { - return time.Now().Add(time.Duration(v) * time.Second) - } - return -} - -type expirationTime int32 - -func (e *expirationTime) UnmarshalJSON(b []byte) error { - if len(b) == 0 || string(b) == "null" { - return nil - } - var n json.Number - err := json.Unmarshal(b, &n) - if err != nil { - return err - } - i, err := n.Int64() - if err != nil { - return err - } - if i > math.MaxInt32 { - i = math.MaxInt32 - } - *e = expirationTime(i) - return nil -} - -// RegisterBrokenAuthHeaderProvider previously did something. It is now a no-op. -// -// Deprecated: this function no longer does anything. Caller code that -// wants to avoid potential extra HTTP requests made during -// auto-probing of the provider's auth style should set -// Endpoint.AuthStyle. -func RegisterBrokenAuthHeaderProvider(tokenURL string) {} - -// AuthStyle is a copy of the golang.org/x/oauth2 package's AuthStyle type. -type AuthStyle int - -const ( - AuthStyleUnknown AuthStyle = 0 - AuthStyleInParams AuthStyle = 1 - AuthStyleInHeader AuthStyle = 2 -) - -// authStyleCache is the set of tokenURLs we've successfully used via -// RetrieveToken and which style auth we ended up using. -// It's called a cache, but it doesn't (yet?) shrink. It's expected that -// the set of OAuth2 servers a program contacts over time is fixed and -// small. -var authStyleCache struct { - sync.Mutex - m map[string]AuthStyle // keyed by tokenURL -} - -// ResetAuthCache resets the global authentication style cache used -// for AuthStyleUnknown token requests. -func ResetAuthCache() { - authStyleCache.Lock() - defer authStyleCache.Unlock() - authStyleCache.m = nil -} - -// lookupAuthStyle reports which auth style we last used with tokenURL -// when calling RetrieveToken and whether we have ever done so. -func lookupAuthStyle(tokenURL string) (style AuthStyle, ok bool) { - authStyleCache.Lock() - defer authStyleCache.Unlock() - style, ok = authStyleCache.m[tokenURL] - return -} - -// setAuthStyle adds an entry to authStyleCache, documented above. -func setAuthStyle(tokenURL string, v AuthStyle) { - authStyleCache.Lock() - defer authStyleCache.Unlock() - if authStyleCache.m == nil { - authStyleCache.m = make(map[string]AuthStyle) - } - authStyleCache.m[tokenURL] = v -} - -// newTokenRequest returns a new *http.Request to retrieve a new token -// from tokenURL using the provided clientID, clientSecret, and POST -// body parameters. -// -// inParams is whether the clientID & clientSecret should be encoded -// as the POST body. An 'inParams' value of true means to send it in -// the POST body (along with any values in v); false means to send it -// in the Authorization header. -func newTokenRequest(tokenURL, clientID, clientSecret string, v url.Values, authStyle AuthStyle) (*http.Request, error) { - if authStyle == AuthStyleInParams { - v = cloneURLValues(v) - if clientID != "" { - v.Set("client_id", clientID) - } - if clientSecret != "" { - v.Set("client_secret", clientSecret) - } - } - req, err := http.NewRequest("POST", tokenURL, strings.NewReader(v.Encode())) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - if authStyle == AuthStyleInHeader { - req.SetBasicAuth(url.QueryEscape(clientID), url.QueryEscape(clientSecret)) - } - return req, nil -} - -func cloneURLValues(v url.Values) url.Values { - v2 := make(url.Values, len(v)) - for k, vv := range v { - v2[k] = append([]string(nil), vv...) - } - return v2 -} - -func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle) (*Token, error) { - needsAuthStyleProbe := authStyle == 0 - if needsAuthStyleProbe { - if style, ok := lookupAuthStyle(tokenURL); ok { - authStyle = style - needsAuthStyleProbe = false - } else { - authStyle = AuthStyleInHeader // the first way we'll try - } - } - req, err := newTokenRequest(tokenURL, clientID, clientSecret, v, authStyle) - if err != nil { - return nil, err - } - token, err := doTokenRoundTrip(ctx, req) - if err != nil && needsAuthStyleProbe { - // If we get an error, assume the server wants the - // clientID & clientSecret in a different form. - // See https://code.google.com/p/goauth2/issues/detail?id=31 for background. - // In summary: - // - Reddit only accepts client secret in the Authorization header - // - Dropbox accepts either it in URL param or Auth header, but not both. - // - Google only accepts URL param (not spec compliant?), not Auth header - // - Stripe only accepts client secret in Auth header with Bearer method, not Basic - // - // We used to maintain a big table in this code of all the sites and which way - // they went, but maintaining it didn't scale & got annoying. - // So just try both ways. - authStyle = AuthStyleInParams // the second way we'll try - req, _ = newTokenRequest(tokenURL, clientID, clientSecret, v, authStyle) - token, err = doTokenRoundTrip(ctx, req) - } - if needsAuthStyleProbe && err == nil { - setAuthStyle(tokenURL, authStyle) - } - // Don't overwrite `RefreshToken` with an empty value - // if this was a token refreshing request. - if token != nil && token.RefreshToken == "" { - token.RefreshToken = v.Get("refresh_token") - } - return token, err -} - -func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { - r, err := ctxhttp.Do(ctx, ContextClient(ctx), req) - if err != nil { - return nil, err - } - body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20)) - r.Body.Close() - if err != nil { - return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) - } - if code := r.StatusCode; code < 200 || code > 299 { - return nil, &RetrieveError{ - Response: r, - Body: body, - } - } - - var token *Token - content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) - switch content { - case "application/x-www-form-urlencoded", "text/plain": - vals, err := url.ParseQuery(string(body)) - if err != nil { - return nil, err - } - token = &Token{ - AccessToken: vals.Get("access_token"), - TokenType: vals.Get("token_type"), - RefreshToken: vals.Get("refresh_token"), - Raw: vals, - } - e := vals.Get("expires_in") - expires, _ := strconv.Atoi(e) - if expires != 0 { - token.Expiry = time.Now().Add(time.Duration(expires) * time.Second) - } - default: - var tj tokenJSON - if err = json.Unmarshal(body, &tj); err != nil { - return nil, err - } - token = &Token{ - AccessToken: tj.AccessToken, - TokenType: tj.TokenType, - RefreshToken: tj.RefreshToken, - Expiry: tj.expiry(), - Raw: make(map[string]interface{}), - } - json.Unmarshal(body, &token.Raw) // no error checks for optional fields - } - if token.AccessToken == "" { - return nil, errors.New("oauth2: server response missing access_token") - } - return token, nil -} - -type RetrieveError struct { - Response *http.Response - Body []byte -} - -func (r *RetrieveError) Error() string { - return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) -} diff --git a/ibm/vendor/golang.org/x/oauth2/internal/transport.go b/ibm/vendor/golang.org/x/oauth2/internal/transport.go deleted file mode 100644 index 572074a637..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/internal/transport.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "context" - "net/http" -) - -// HTTPClient is the context key to use with golang.org/x/net/context's -// WithValue function to associate an *http.Client value with a context. -var HTTPClient ContextKey - -// ContextKey is just an empty struct. It exists so HTTPClient can be -// an immutable public variable with a unique type. It's immutable -// because nobody else can create a ContextKey, being unexported. -type ContextKey struct{} - -var appengineClientHook func(context.Context) *http.Client - -func ContextClient(ctx context.Context) *http.Client { - if ctx != nil { - if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { - return hc - } - } - if appengineClientHook != nil { - return appengineClientHook(ctx) - } - return http.DefaultClient -} diff --git a/ibm/vendor/golang.org/x/oauth2/jws/jws.go b/ibm/vendor/golang.org/x/oauth2/jws/jws.go deleted file mode 100644 index 683d2d271a..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/jws/jws.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package jws provides a partial implementation -// of JSON Web Signature encoding and decoding. -// It exists to support the golang.org/x/oauth2 package. -// -// See RFC 7515. -// -// Deprecated: this package is not intended for public use and might be -// removed in the future. It exists for internal use only. -// Please switch to another JWS package or copy this package into your own -// source tree. -package jws // import "golang.org/x/oauth2/jws" - -import ( - "bytes" - "crypto" - "crypto/rand" - "crypto/rsa" - "crypto/sha256" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "strings" - "time" -) - -// ClaimSet contains information about the JWT signature including the -// permissions being requested (scopes), the target of the token, the issuer, -// the time the token was issued, and the lifetime of the token. -type ClaimSet struct { - Iss string `json:"iss"` // email address of the client_id of the application making the access token request - Scope string `json:"scope,omitempty"` // space-delimited list of the permissions the application requests - Aud string `json:"aud"` // descriptor of the intended target of the assertion (Optional). - Exp int64 `json:"exp"` // the expiration time of the assertion (seconds since Unix epoch) - Iat int64 `json:"iat"` // the time the assertion was issued (seconds since Unix epoch) - Typ string `json:"typ,omitempty"` // token type (Optional). - - // Email for which the application is requesting delegated access (Optional). - Sub string `json:"sub,omitempty"` - - // The old name of Sub. Client keeps setting Prn to be - // complaint with legacy OAuth 2.0 providers. (Optional) - Prn string `json:"prn,omitempty"` - - // See http://tools.ietf.org/html/draft-jones-json-web-token-10#section-4.3 - // This array is marshalled using custom code (see (c *ClaimSet) encode()). - PrivateClaims map[string]interface{} `json:"-"` -} - -func (c *ClaimSet) encode() (string, error) { - // Reverting time back for machines whose time is not perfectly in sync. - // If client machine's time is in the future according - // to Google servers, an access token will not be issued. - now := time.Now().Add(-10 * time.Second) - if c.Iat == 0 { - c.Iat = now.Unix() - } - if c.Exp == 0 { - c.Exp = now.Add(time.Hour).Unix() - } - if c.Exp < c.Iat { - return "", fmt.Errorf("jws: invalid Exp = %v; must be later than Iat = %v", c.Exp, c.Iat) - } - - b, err := json.Marshal(c) - if err != nil { - return "", err - } - - if len(c.PrivateClaims) == 0 { - return base64.RawURLEncoding.EncodeToString(b), nil - } - - // Marshal private claim set and then append it to b. - prv, err := json.Marshal(c.PrivateClaims) - if err != nil { - return "", fmt.Errorf("jws: invalid map of private claims %v", c.PrivateClaims) - } - - // Concatenate public and private claim JSON objects. - if !bytes.HasSuffix(b, []byte{'}'}) { - return "", fmt.Errorf("jws: invalid JSON %s", b) - } - if !bytes.HasPrefix(prv, []byte{'{'}) { - return "", fmt.Errorf("jws: invalid JSON %s", prv) - } - b[len(b)-1] = ',' // Replace closing curly brace with a comma. - b = append(b, prv[1:]...) // Append private claims. - return base64.RawURLEncoding.EncodeToString(b), nil -} - -// Header represents the header for the signed JWS payloads. -type Header struct { - // The algorithm used for signature. - Algorithm string `json:"alg"` - - // Represents the token type. - Typ string `json:"typ"` - - // The optional hint of which key is being used. - KeyID string `json:"kid,omitempty"` -} - -func (h *Header) encode() (string, error) { - b, err := json.Marshal(h) - if err != nil { - return "", err - } - return base64.RawURLEncoding.EncodeToString(b), nil -} - -// Decode decodes a claim set from a JWS payload. -func Decode(payload string) (*ClaimSet, error) { - // decode returned id token to get expiry - s := strings.Split(payload, ".") - if len(s) < 2 { - // TODO(jbd): Provide more context about the error. - return nil, errors.New("jws: invalid token received") - } - decoded, err := base64.RawURLEncoding.DecodeString(s[1]) - if err != nil { - return nil, err - } - c := &ClaimSet{} - err = json.NewDecoder(bytes.NewBuffer(decoded)).Decode(c) - return c, err -} - -// Signer returns a signature for the given data. -type Signer func(data []byte) (sig []byte, err error) - -// EncodeWithSigner encodes a header and claim set with the provided signer. -func EncodeWithSigner(header *Header, c *ClaimSet, sg Signer) (string, error) { - head, err := header.encode() - if err != nil { - return "", err - } - cs, err := c.encode() - if err != nil { - return "", err - } - ss := fmt.Sprintf("%s.%s", head, cs) - sig, err := sg([]byte(ss)) - if err != nil { - return "", err - } - return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil -} - -// Encode encodes a signed JWS with provided header and claim set. -// This invokes EncodeWithSigner using crypto/rsa.SignPKCS1v15 with the given RSA private key. -func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error) { - sg := func(data []byte) (sig []byte, err error) { - h := sha256.New() - h.Write(data) - return rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, h.Sum(nil)) - } - return EncodeWithSigner(header, c, sg) -} - -// Verify tests whether the provided JWT token's signature was produced by the private key -// associated with the supplied public key. -func Verify(token string, key *rsa.PublicKey) error { - parts := strings.Split(token, ".") - if len(parts) != 3 { - return errors.New("jws: invalid token received, token must have 3 parts") - } - - signedContent := parts[0] + "." + parts[1] - signatureString, err := base64.RawURLEncoding.DecodeString(parts[2]) - if err != nil { - return err - } - - h := sha256.New() - h.Write([]byte(signedContent)) - return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), []byte(signatureString)) -} diff --git a/ibm/vendor/golang.org/x/oauth2/jwt/jwt.go b/ibm/vendor/golang.org/x/oauth2/jwt/jwt.go deleted file mode 100644 index b2bf18298b..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/jwt/jwt.go +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package jwt implements the OAuth 2.0 JSON Web Token flow, commonly -// known as "two-legged OAuth 2.0". -// -// See: https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer-12 -package jwt - -import ( - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strings" - "time" - - "golang.org/x/oauth2" - "golang.org/x/oauth2/internal" - "golang.org/x/oauth2/jws" -) - -var ( - defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" - defaultHeader = &jws.Header{Algorithm: "RS256", Typ: "JWT"} -) - -// Config is the configuration for using JWT to fetch tokens, -// commonly known as "two-legged OAuth 2.0". -type Config struct { - // Email is the OAuth client identifier used when communicating with - // the configured OAuth provider. - Email string - - // PrivateKey contains the contents of an RSA private key or the - // contents of a PEM file that contains a private key. The provided - // private key is used to sign JWT payloads. - // PEM containers with a passphrase are not supported. - // Use the following command to convert a PKCS 12 file into a PEM. - // - // $ openssl pkcs12 -in key.p12 -out key.pem -nodes - // - PrivateKey []byte - - // PrivateKeyID contains an optional hint indicating which key is being - // used. - PrivateKeyID string - - // Subject is the optional user to impersonate. - Subject string - - // Scopes optionally specifies a list of requested permission scopes. - Scopes []string - - // TokenURL is the endpoint required to complete the 2-legged JWT flow. - TokenURL string - - // Expires optionally specifies how long the token is valid for. - Expires time.Duration - - // Audience optionally specifies the intended audience of the - // request. If empty, the value of TokenURL is used as the - // intended audience. - Audience string - - // PrivateClaims optionally specifies custom private claims in the JWT. - // See http://tools.ietf.org/html/draft-jones-json-web-token-10#section-4.3 - PrivateClaims map[string]interface{} - - // UseIDToken optionally specifies whether ID token should be used instead - // of access token when the server returns both. - UseIDToken bool -} - -// TokenSource returns a JWT TokenSource using the configuration -// in c and the HTTP client from the provided context. -func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { - return oauth2.ReuseTokenSource(nil, jwtSource{ctx, c}) -} - -// Client returns an HTTP client wrapping the context's -// HTTP transport and adding Authorization headers with tokens -// obtained from c. -// -// The returned client and its Transport should not be modified. -func (c *Config) Client(ctx context.Context) *http.Client { - return oauth2.NewClient(ctx, c.TokenSource(ctx)) -} - -// jwtSource is a source that always does a signed JWT request for a token. -// It should typically be wrapped with a reuseTokenSource. -type jwtSource struct { - ctx context.Context - conf *Config -} - -func (js jwtSource) Token() (*oauth2.Token, error) { - pk, err := internal.ParseKey(js.conf.PrivateKey) - if err != nil { - return nil, err - } - hc := oauth2.NewClient(js.ctx, nil) - claimSet := &jws.ClaimSet{ - Iss: js.conf.Email, - Scope: strings.Join(js.conf.Scopes, " "), - Aud: js.conf.TokenURL, - PrivateClaims: js.conf.PrivateClaims, - } - if subject := js.conf.Subject; subject != "" { - claimSet.Sub = subject - // prn is the old name of sub. Keep setting it - // to be compatible with legacy OAuth 2.0 providers. - claimSet.Prn = subject - } - if t := js.conf.Expires; t > 0 { - claimSet.Exp = time.Now().Add(t).Unix() - } - if aud := js.conf.Audience; aud != "" { - claimSet.Aud = aud - } - h := *defaultHeader - h.KeyID = js.conf.PrivateKeyID - payload, err := jws.Encode(&h, claimSet, pk) - if err != nil { - return nil, err - } - v := url.Values{} - v.Set("grant_type", defaultGrantType) - v.Set("assertion", payload) - resp, err := hc.PostForm(js.conf.TokenURL, v) - if err != nil { - return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) - } - defer resp.Body.Close() - body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) - if err != nil { - return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) - } - if c := resp.StatusCode; c < 200 || c > 299 { - return nil, &oauth2.RetrieveError{ - Response: resp, - Body: body, - } - } - // tokenRes is the JSON response body. - var tokenRes struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - IDToken string `json:"id_token"` - ExpiresIn int64 `json:"expires_in"` // relative seconds from now - } - if err := json.Unmarshal(body, &tokenRes); err != nil { - return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) - } - token := &oauth2.Token{ - AccessToken: tokenRes.AccessToken, - TokenType: tokenRes.TokenType, - } - raw := make(map[string]interface{}) - json.Unmarshal(body, &raw) // no error checks for optional fields - token = token.WithExtra(raw) - - if secs := tokenRes.ExpiresIn; secs > 0 { - token.Expiry = time.Now().Add(time.Duration(secs) * time.Second) - } - if v := tokenRes.IDToken; v != "" { - // decode returned id token to get expiry - claimSet, err := jws.Decode(v) - if err != nil { - return nil, fmt.Errorf("oauth2: error decoding JWT token: %v", err) - } - token.Expiry = time.Unix(claimSet.Exp, 0) - } - if js.conf.UseIDToken { - if tokenRes.IDToken == "" { - return nil, fmt.Errorf("oauth2: response doesn't have JWT token") - } - token.AccessToken = tokenRes.IDToken - } - return token, nil -} diff --git a/ibm/vendor/golang.org/x/oauth2/oauth2.go b/ibm/vendor/golang.org/x/oauth2/oauth2.go deleted file mode 100644 index 291df5c833..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/oauth2.go +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package oauth2 provides support for making -// OAuth2 authorized and authenticated HTTP requests, -// as specified in RFC 6749. -// It can additionally grant authorization with Bearer JWT. -package oauth2 // import "golang.org/x/oauth2" - -import ( - "bytes" - "context" - "errors" - "net/http" - "net/url" - "strings" - "sync" - - "golang.org/x/oauth2/internal" -) - -// NoContext is the default context you should supply if not using -// your own context.Context (see https://golang.org/x/net/context). -// -// Deprecated: Use context.Background() or context.TODO() instead. -var NoContext = context.TODO() - -// RegisterBrokenAuthHeaderProvider previously did something. It is now a no-op. -// -// Deprecated: this function no longer does anything. Caller code that -// wants to avoid potential extra HTTP requests made during -// auto-probing of the provider's auth style should set -// Endpoint.AuthStyle. -func RegisterBrokenAuthHeaderProvider(tokenURL string) {} - -// Config describes a typical 3-legged OAuth2 flow, with both the -// client application information and the server's endpoint URLs. -// For the client credentials 2-legged OAuth2 flow, see the clientcredentials -// package (https://golang.org/x/oauth2/clientcredentials). -type Config struct { - // ClientID is the application's ID. - ClientID string - - // ClientSecret is the application's secret. - ClientSecret string - - // Endpoint contains the resource server's token endpoint - // URLs. These are constants specific to each server and are - // often available via site-specific packages, such as - // google.Endpoint or github.Endpoint. - Endpoint Endpoint - - // RedirectURL is the URL to redirect users going through - // the OAuth flow, after the resource owner's URLs. - RedirectURL string - - // Scope specifies optional requested permissions. - Scopes []string -} - -// A TokenSource is anything that can return a token. -type TokenSource interface { - // Token returns a token or an error. - // Token must be safe for concurrent use by multiple goroutines. - // The returned Token must not be modified. - Token() (*Token, error) -} - -// Endpoint represents an OAuth 2.0 provider's authorization and token -// endpoint URLs. -type Endpoint struct { - AuthURL string - TokenURL string - - // AuthStyle optionally specifies how the endpoint wants the - // client ID & client secret sent. The zero value means to - // auto-detect. - AuthStyle AuthStyle -} - -// AuthStyle represents how requests for tokens are authenticated -// to the server. -type AuthStyle int - -const ( - // AuthStyleAutoDetect means to auto-detect which authentication - // style the provider wants by trying both ways and caching - // the successful way for the future. - AuthStyleAutoDetect AuthStyle = 0 - - // AuthStyleInParams sends the "client_id" and "client_secret" - // in the POST body as application/x-www-form-urlencoded parameters. - AuthStyleInParams AuthStyle = 1 - - // AuthStyleInHeader sends the client_id and client_password - // using HTTP Basic Authorization. This is an optional style - // described in the OAuth2 RFC 6749 section 2.3.1. - AuthStyleInHeader AuthStyle = 2 -) - -var ( - // AccessTypeOnline and AccessTypeOffline are options passed - // to the Options.AuthCodeURL method. They modify the - // "access_type" field that gets sent in the URL returned by - // AuthCodeURL. - // - // Online is the default if neither is specified. If your - // application needs to refresh access tokens when the user - // is not present at the browser, then use offline. This will - // result in your application obtaining a refresh token the - // first time your application exchanges an authorization - // code for a user. - AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") - AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") - - // ApprovalForce forces the users to view the consent dialog - // and confirm the permissions request at the URL returned - // from AuthCodeURL, even if they've already done so. - ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent") -) - -// An AuthCodeOption is passed to Config.AuthCodeURL. -type AuthCodeOption interface { - setValue(url.Values) -} - -type setParam struct{ k, v string } - -func (p setParam) setValue(m url.Values) { m.Set(p.k, p.v) } - -// SetAuthURLParam builds an AuthCodeOption which passes key/value parameters -// to a provider's authorization endpoint. -func SetAuthURLParam(key, value string) AuthCodeOption { - return setParam{key, value} -} - -// AuthCodeURL returns a URL to OAuth 2.0 provider's consent page -// that asks for permissions for the required scopes explicitly. -// -// State is a token to protect the user from CSRF attacks. You must -// always provide a non-empty string and validate that it matches the -// the state query parameter on your redirect callback. -// See http://tools.ietf.org/html/rfc6749#section-10.12 for more info. -// -// Opts may include AccessTypeOnline or AccessTypeOffline, as well -// as ApprovalForce. -// It can also be used to pass the PKCE challenge. -// See https://www.oauth.com/oauth2-servers/pkce/ for more info. -func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { - var buf bytes.Buffer - buf.WriteString(c.Endpoint.AuthURL) - v := url.Values{ - "response_type": {"code"}, - "client_id": {c.ClientID}, - } - if c.RedirectURL != "" { - v.Set("redirect_uri", c.RedirectURL) - } - if len(c.Scopes) > 0 { - v.Set("scope", strings.Join(c.Scopes, " ")) - } - if state != "" { - // TODO(light): Docs say never to omit state; don't allow empty. - v.Set("state", state) - } - for _, opt := range opts { - opt.setValue(v) - } - if strings.Contains(c.Endpoint.AuthURL, "?") { - buf.WriteByte('&') - } else { - buf.WriteByte('?') - } - buf.WriteString(v.Encode()) - return buf.String() -} - -// PasswordCredentialsToken converts a resource owner username and password -// pair into a token. -// -// Per the RFC, this grant type should only be used "when there is a high -// degree of trust between the resource owner and the client (e.g., the client -// is part of the device operating system or a highly privileged application), -// and when other authorization grant types are not available." -// See https://tools.ietf.org/html/rfc6749#section-4.3 for more info. -// -// The provided context optionally controls which HTTP client is used. See the HTTPClient variable. -func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) { - v := url.Values{ - "grant_type": {"password"}, - "username": {username}, - "password": {password}, - } - if len(c.Scopes) > 0 { - v.Set("scope", strings.Join(c.Scopes, " ")) - } - return retrieveToken(ctx, c, v) -} - -// Exchange converts an authorization code into a token. -// -// It is used after a resource provider redirects the user back -// to the Redirect URI (the URL obtained from AuthCodeURL). -// -// The provided context optionally controls which HTTP client is used. See the HTTPClient variable. -// -// The code will be in the *http.Request.FormValue("code"). Before -// calling Exchange, be sure to validate FormValue("state"). -// -// Opts may include the PKCE verifier code if previously used in AuthCodeURL. -// See https://www.oauth.com/oauth2-servers/pkce/ for more info. -func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) { - v := url.Values{ - "grant_type": {"authorization_code"}, - "code": {code}, - } - if c.RedirectURL != "" { - v.Set("redirect_uri", c.RedirectURL) - } - for _, opt := range opts { - opt.setValue(v) - } - return retrieveToken(ctx, c, v) -} - -// Client returns an HTTP client using the provided token. -// The token will auto-refresh as necessary. The underlying -// HTTP transport will be obtained using the provided context. -// The returned client and its Transport should not be modified. -func (c *Config) Client(ctx context.Context, t *Token) *http.Client { - return NewClient(ctx, c.TokenSource(ctx, t)) -} - -// TokenSource returns a TokenSource that returns t until t expires, -// automatically refreshing it as necessary using the provided context. -// -// Most users will use Config.Client instead. -func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource { - tkr := &tokenRefresher{ - ctx: ctx, - conf: c, - } - if t != nil { - tkr.refreshToken = t.RefreshToken - } - return &reuseTokenSource{ - t: t, - new: tkr, - } -} - -// tokenRefresher is a TokenSource that makes "grant_type"=="refresh_token" -// HTTP requests to renew a token using a RefreshToken. -type tokenRefresher struct { - ctx context.Context // used to get HTTP requests - conf *Config - refreshToken string -} - -// WARNING: Token is not safe for concurrent access, as it -// updates the tokenRefresher's refreshToken field. -// Within this package, it is used by reuseTokenSource which -// synchronizes calls to this method with its own mutex. -func (tf *tokenRefresher) Token() (*Token, error) { - if tf.refreshToken == "" { - return nil, errors.New("oauth2: token expired and refresh token is not set") - } - - tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{ - "grant_type": {"refresh_token"}, - "refresh_token": {tf.refreshToken}, - }) - - if err != nil { - return nil, err - } - if tf.refreshToken != tk.RefreshToken { - tf.refreshToken = tk.RefreshToken - } - return tk, err -} - -// reuseTokenSource is a TokenSource that holds a single token in memory -// and validates its expiry before each call to retrieve it with -// Token. If it's expired, it will be auto-refreshed using the -// new TokenSource. -type reuseTokenSource struct { - new TokenSource // called when t is expired. - - mu sync.Mutex // guards t - t *Token -} - -// Token returns the current token if it's still valid, else will -// refresh the current token (using r.Context for HTTP client -// information) and return the new one. -func (s *reuseTokenSource) Token() (*Token, error) { - s.mu.Lock() - defer s.mu.Unlock() - if s.t.Valid() { - return s.t, nil - } - t, err := s.new.Token() - if err != nil { - return nil, err - } - s.t = t - return t, nil -} - -// StaticTokenSource returns a TokenSource that always returns the same token. -// Because the provided token t is never refreshed, StaticTokenSource is only -// useful for tokens that never expire. -func StaticTokenSource(t *Token) TokenSource { - return staticTokenSource{t} -} - -// staticTokenSource is a TokenSource that always returns the same Token. -type staticTokenSource struct { - t *Token -} - -func (s staticTokenSource) Token() (*Token, error) { - return s.t, nil -} - -// HTTPClient is the context key to use with golang.org/x/net/context's -// WithValue function to associate an *http.Client value with a context. -var HTTPClient internal.ContextKey - -// NewClient creates an *http.Client from a Context and TokenSource. -// The returned client is not valid beyond the lifetime of the context. -// -// Note that if a custom *http.Client is provided via the Context it -// is used only for token acquisition and is not used to configure the -// *http.Client returned from NewClient. -// -// As a special case, if src is nil, a non-OAuth2 client is returned -// using the provided context. This exists to support related OAuth2 -// packages. -func NewClient(ctx context.Context, src TokenSource) *http.Client { - if src == nil { - return internal.ContextClient(ctx) - } - return &http.Client{ - Transport: &Transport{ - Base: internal.ContextClient(ctx).Transport, - Source: ReuseTokenSource(nil, src), - }, - } -} - -// ReuseTokenSource returns a TokenSource which repeatedly returns the -// same token as long as it's valid, starting with t. -// When its cached token is invalid, a new token is obtained from src. -// -// ReuseTokenSource is typically used to reuse tokens from a cache -// (such as a file on disk) between runs of a program, rather than -// obtaining new tokens unnecessarily. -// -// The initial token t may be nil, in which case the TokenSource is -// wrapped in a caching version if it isn't one already. This also -// means it's always safe to wrap ReuseTokenSource around any other -// TokenSource without adverse effects. -func ReuseTokenSource(t *Token, src TokenSource) TokenSource { - // Don't wrap a reuseTokenSource in itself. That would work, - // but cause an unnecessary number of mutex operations. - // Just build the equivalent one. - if rt, ok := src.(*reuseTokenSource); ok { - if t == nil { - // Just use it directly. - return rt - } - src = rt.new - } - return &reuseTokenSource{ - t: t, - new: src, - } -} diff --git a/ibm/vendor/golang.org/x/oauth2/token.go b/ibm/vendor/golang.org/x/oauth2/token.go deleted file mode 100644 index 822720341a..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/token.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package oauth2 - -import ( - "context" - "fmt" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "golang.org/x/oauth2/internal" -) - -// expiryDelta determines how earlier a token should be considered -// expired than its actual expiration time. It is used to avoid late -// expirations due to client-server time mismatches. -const expiryDelta = 10 * time.Second - -// Token represents the credentials used to authorize -// the requests to access protected resources on the OAuth 2.0 -// provider's backend. -// -// Most users of this package should not access fields of Token -// directly. They're exported mostly for use by related packages -// implementing derivative OAuth2 flows. -type Token struct { - // AccessToken is the token that authorizes and authenticates - // the requests. - AccessToken string `json:"access_token"` - - // TokenType is the type of token. - // The Type method returns either this or "Bearer", the default. - TokenType string `json:"token_type,omitempty"` - - // RefreshToken is a token that's used by the application - // (as opposed to the user) to refresh the access token - // if it expires. - RefreshToken string `json:"refresh_token,omitempty"` - - // Expiry is the optional expiration time of the access token. - // - // If zero, TokenSource implementations will reuse the same - // token forever and RefreshToken or equivalent - // mechanisms for that TokenSource will not be used. - Expiry time.Time `json:"expiry,omitempty"` - - // raw optionally contains extra metadata from the server - // when updating a token. - raw interface{} -} - -// Type returns t.TokenType if non-empty, else "Bearer". -func (t *Token) Type() string { - if strings.EqualFold(t.TokenType, "bearer") { - return "Bearer" - } - if strings.EqualFold(t.TokenType, "mac") { - return "MAC" - } - if strings.EqualFold(t.TokenType, "basic") { - return "Basic" - } - if t.TokenType != "" { - return t.TokenType - } - return "Bearer" -} - -// SetAuthHeader sets the Authorization header to r using the access -// token in t. -// -// This method is unnecessary when using Transport or an HTTP Client -// returned by this package. -func (t *Token) SetAuthHeader(r *http.Request) { - r.Header.Set("Authorization", t.Type()+" "+t.AccessToken) -} - -// WithExtra returns a new Token that's a clone of t, but using the -// provided raw extra map. This is only intended for use by packages -// implementing derivative OAuth2 flows. -func (t *Token) WithExtra(extra interface{}) *Token { - t2 := new(Token) - *t2 = *t - t2.raw = extra - return t2 -} - -// Extra returns an extra field. -// Extra fields are key-value pairs returned by the server as a -// part of the token retrieval response. -func (t *Token) Extra(key string) interface{} { - if raw, ok := t.raw.(map[string]interface{}); ok { - return raw[key] - } - - vals, ok := t.raw.(url.Values) - if !ok { - return nil - } - - v := vals.Get(key) - switch s := strings.TrimSpace(v); strings.Count(s, ".") { - case 0: // Contains no "."; try to parse as int - if i, err := strconv.ParseInt(s, 10, 64); err == nil { - return i - } - case 1: // Contains a single "."; try to parse as float - if f, err := strconv.ParseFloat(s, 64); err == nil { - return f - } - } - - return v -} - -// timeNow is time.Now but pulled out as a variable for tests. -var timeNow = time.Now - -// expired reports whether the token is expired. -// t must be non-nil. -func (t *Token) expired() bool { - if t.Expiry.IsZero() { - return false - } - return t.Expiry.Round(0).Add(-expiryDelta).Before(timeNow()) -} - -// Valid reports whether t is non-nil, has an AccessToken, and is not expired. -func (t *Token) Valid() bool { - return t != nil && t.AccessToken != "" && !t.expired() -} - -// tokenFromInternal maps an *internal.Token struct into -// a *Token struct. -func tokenFromInternal(t *internal.Token) *Token { - if t == nil { - return nil - } - return &Token{ - AccessToken: t.AccessToken, - TokenType: t.TokenType, - RefreshToken: t.RefreshToken, - Expiry: t.Expiry, - raw: t.Raw, - } -} - -// retrieveToken takes a *Config and uses that to retrieve an *internal.Token. -// This token is then mapped from *internal.Token into an *oauth2.Token which is returned along -// with an error.. -func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) { - tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle)) - if err != nil { - if rErr, ok := err.(*internal.RetrieveError); ok { - return nil, (*RetrieveError)(rErr) - } - return nil, err - } - return tokenFromInternal(tk), nil -} - -// RetrieveError is the error returned when the token endpoint returns a -// non-2XX HTTP status code. -type RetrieveError struct { - Response *http.Response - // Body is the body that was consumed by reading Response.Body. - // It may be truncated. - Body []byte -} - -func (r *RetrieveError) Error() string { - return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) -} diff --git a/ibm/vendor/golang.org/x/oauth2/transport.go b/ibm/vendor/golang.org/x/oauth2/transport.go deleted file mode 100644 index 90657915fb..0000000000 --- a/ibm/vendor/golang.org/x/oauth2/transport.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package oauth2 - -import ( - "errors" - "log" - "net/http" - "sync" -) - -// Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests, -// wrapping a base RoundTripper and adding an Authorization header -// with a token from the supplied Sources. -// -// Transport is a low-level mechanism. Most code will use the -// higher-level Config.Client method instead. -type Transport struct { - // Source supplies the token to add to outgoing requests' - // Authorization headers. - Source TokenSource - - // Base is the base RoundTripper used to make HTTP requests. - // If nil, http.DefaultTransport is used. - Base http.RoundTripper -} - -// RoundTrip authorizes and authenticates the request with an -// access token from Transport's Source. -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - reqBodyClosed := false - if req.Body != nil { - defer func() { - if !reqBodyClosed { - req.Body.Close() - } - }() - } - - if t.Source == nil { - return nil, errors.New("oauth2: Transport's Source is nil") - } - token, err := t.Source.Token() - if err != nil { - return nil, err - } - - req2 := cloneRequest(req) // per RoundTripper contract - token.SetAuthHeader(req2) - - // req.Body is assumed to be closed by the base RoundTripper. - reqBodyClosed = true - return t.base().RoundTrip(req2) -} - -var cancelOnce sync.Once - -// CancelRequest does nothing. It used to be a legacy cancellation mechanism -// but now only it only logs on first use to warn that it's deprecated. -// -// Deprecated: use contexts for cancellation instead. -func (t *Transport) CancelRequest(req *http.Request) { - cancelOnce.Do(func() { - log.Printf("deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does anything; use contexts") - }) -} - -func (t *Transport) base() http.RoundTripper { - if t.Base != nil { - return t.Base - } - return http.DefaultTransport -} - -// cloneRequest returns a clone of the provided *http.Request. -// The clone is a shallow copy of the struct and its Header map. -func cloneRequest(r *http.Request) *http.Request { - // shallow copy of the struct - r2 := new(http.Request) - *r2 = *r - // deep copy of the Header - r2.Header = make(http.Header, len(r.Header)) - for k, s := range r.Header { - r2.Header[k] = append([]string(nil), s...) - } - return r2 -} diff --git a/ibm/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/ibm/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go index 3298a87e98..fa7cdb9bcd 100644 --- a/ibm/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go +++ b/ibm/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go @@ -15,7 +15,3 @@ func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func xgetbv() (eax, edx uint32) - -// darwinSupportsAVX512 is implemented in cpu_x86.s for gc compiler -// and in cpu_gccgo_x86.go for gccgo. -func darwinSupportsAVX512() bool diff --git a/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.go b/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.go index 5ea287b7ec..f5aacfc825 100644 --- a/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.go +++ b/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.go @@ -90,9 +90,10 @@ func archInit() { osSupportsAVX = isSet(1, eax) && isSet(2, eax) if runtime.GOOS == "darwin" { - // Check darwin commpage for AVX512 support. Necessary because: - // https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/osfmk/i386/fpu.c#L175-L201 - osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512() + // Darwin doesn't save/restore AVX-512 mask registers correctly across signal handlers. + // Since users can't rely on mask register contents, let's not advertise AVX-512 support. + // See issue 49233. + osSupportsAVX512 = false } else { // Check if OPMASK and ZMM registers have OS support. osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax) diff --git a/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.s b/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.s index b748ba52f7..39acab2ff5 100644 --- a/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.s +++ b/ibm/vendor/golang.org/x/sys/cpu/cpu_x86.s @@ -26,27 +26,3 @@ TEXT ·xgetbv(SB),NOSPLIT,$0-8 MOVL AX, eax+0(FP) MOVL DX, edx+4(FP) RET - -// func darwinSupportsAVX512() bool -TEXT ·darwinSupportsAVX512(SB), NOSPLIT, $0-1 - MOVB $0, ret+0(FP) // default to false -#ifdef GOOS_darwin // return if not darwin -#ifdef GOARCH_amd64 // return if not amd64 -// These values from: -// https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/osfmk/i386/cpu_capabilities.h -#define commpage64_base_address 0x00007fffffe00000 -#define commpage64_cpu_capabilities64 (commpage64_base_address+0x010) -#define commpage64_version (commpage64_base_address+0x01E) -#define hasAVX512F 0x0000004000000000 - MOVQ $commpage64_version, BX - CMPW (BX), $13 // cpu_capabilities64 undefined in versions < 13 - JL no_avx512 - MOVQ $commpage64_cpu_capabilities64, BX - MOVQ $hasAVX512F, CX - TESTQ (BX), CX - JZ no_avx512 - MOVB $1, ret+0(FP) -no_avx512: -#endif -#endif - RET diff --git a/ibm/vendor/golang.org/x/sys/execabs/execabs.go b/ibm/vendor/golang.org/x/sys/execabs/execabs.go deleted file mode 100644 index 78192498db..0000000000 --- a/ibm/vendor/golang.org/x/sys/execabs/execabs.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package execabs is a drop-in replacement for os/exec -// that requires PATH lookups to find absolute paths. -// That is, execabs.Command("cmd") runs the same PATH lookup -// as exec.Command("cmd"), but if the result is a path -// which is relative, the Run and Start methods will report -// an error instead of running the executable. -// -// See https://blog.golang.org/path-security for more information -// about when it may be necessary or appropriate to use this package. -package execabs - -import ( - "context" - "fmt" - "os/exec" - "path/filepath" - "reflect" - "unsafe" -) - -// ErrNotFound is the error resulting if a path search failed to find an executable file. -// It is an alias for exec.ErrNotFound. -var ErrNotFound = exec.ErrNotFound - -// Cmd represents an external command being prepared or run. -// It is an alias for exec.Cmd. -type Cmd = exec.Cmd - -// Error is returned by LookPath when it fails to classify a file as an executable. -// It is an alias for exec.Error. -type Error = exec.Error - -// An ExitError reports an unsuccessful exit by a command. -// It is an alias for exec.ExitError. -type ExitError = exec.ExitError - -func relError(file, path string) error { - return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path) -} - -// LookPath searches for an executable named file in the directories -// named by the PATH environment variable. If file contains a slash, -// it is tried directly and the PATH is not consulted. The result will be -// an absolute path. -// -// LookPath differs from exec.LookPath in its handling of PATH lookups, -// which are used for file names without slashes. If exec.LookPath's -// PATH lookup would have returned an executable from the current directory, -// LookPath instead returns an error. -func LookPath(file string) (string, error) { - path, err := exec.LookPath(file) - if err != nil { - return "", err - } - if filepath.Base(file) == file && !filepath.IsAbs(path) { - return "", relError(file, path) - } - return path, nil -} - -func fixCmd(name string, cmd *exec.Cmd) { - if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) { - // exec.Command was called with a bare binary name and - // exec.LookPath returned a path which is not absolute. - // Set cmd.lookPathErr and clear cmd.Path so that it - // cannot be run. - lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer())) - if *lookPathErr == nil { - *lookPathErr = relError(name, cmd.Path) - } - cmd.Path = "" - } -} - -// CommandContext is like Command but includes a context. -// -// The provided context is used to kill the process (by calling os.Process.Kill) -// if the context becomes done before the command completes on its own. -func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd { - cmd := exec.CommandContext(ctx, name, arg...) - fixCmd(name, cmd) - return cmd - -} - -// Command returns the Cmd struct to execute the named program with the given arguments. -// See exec.Command for most details. -// -// Command differs from exec.Command in its handling of PATH lookups, -// which are used when the program name contains no slashes. -// If exec.Command would have returned an exec.Cmd configured to run an -// executable from the current directory, Command instead -// returns an exec.Cmd that will return an error from Start or Run. -func Command(name string, arg ...string) *exec.Cmd { - cmd := exec.Command(name, arg...) - fixCmd(name, cmd) - return cmd -} diff --git a/ibm/vendor/golang.org/x/sys/unix/README.md b/ibm/vendor/golang.org/x/sys/unix/README.md index 474efad0e0..7d3c060e12 100644 --- a/ibm/vendor/golang.org/x/sys/unix/README.md +++ b/ibm/vendor/golang.org/x/sys/unix/README.md @@ -149,7 +149,7 @@ To add a constant, add the header that includes it to the appropriate variable. Then, edit the regex (if necessary) to match the desired constant. Avoid making the regex too broad to avoid matching unintended constants. -### mkmerge.go +### internal/mkmerge This program is used to extract duplicate const, func, and type declarations from the generated architecture-specific files listed below, and merge these diff --git a/ibm/vendor/golang.org/x/sys/unix/mkall.sh b/ibm/vendor/golang.org/x/sys/unix/mkall.sh index 396aadf86d..ee73623489 100644 --- a/ibm/vendor/golang.org/x/sys/unix/mkall.sh +++ b/ibm/vendor/golang.org/x/sys/unix/mkall.sh @@ -50,7 +50,7 @@ if [[ "$GOOS" = "linux" ]]; then # Use the Docker-based build system # Files generated through docker (use $cmd so you can Ctl-C the build or run) $cmd docker build --tag generate:$GOOS $GOOS - $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")" && /bin/pwd):/build generate:$GOOS + $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && /bin/pwd):/build generate:$GOOS exit fi diff --git a/ibm/vendor/golang.org/x/sys/unix/mkerrors.sh b/ibm/vendor/golang.org/x/sys/unix/mkerrors.sh index a74ef58f8c..a47b035f9a 100644 --- a/ibm/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/ibm/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -239,6 +239,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -260,6 +261,7 @@ struct ltchars { #include #include #include +#include #include #include @@ -520,7 +522,7 @@ ccflags="$@" $2 ~ /^HW_MACHINE$/ || $2 ~ /^SYSCTL_VERS/ || $2 !~ "MNT_BITS" && - $2 ~ /^(MS|MNT|UMOUNT)_/ || + $2 ~ /^(MS|MNT|MOUNT|UMOUNT)_/ || $2 ~ /^NS_GET_/ || $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|TFD)_/ || @@ -605,6 +607,7 @@ ccflags="$@" $2 ~ /^MTD/ || $2 ~ /^OTP/ || $2 ~ /^MEM/ || + $2 ~ /^WG/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} diff --git a/ibm/vendor/golang.org/x/sys/unix/sockcmsg_linux.go b/ibm/vendor/golang.org/x/sys/unix/sockcmsg_linux.go index 8bf4570594..5f63147e06 100644 --- a/ibm/vendor/golang.org/x/sys/unix/sockcmsg_linux.go +++ b/ibm/vendor/golang.org/x/sys/unix/sockcmsg_linux.go @@ -34,3 +34,52 @@ func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) return &ucred, nil } + +// PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO. +func PktInfo4(info *Inet4Pktinfo) []byte { + b := make([]byte, CmsgSpace(SizeofInet4Pktinfo)) + h := (*Cmsghdr)(unsafe.Pointer(&b[0])) + h.Level = SOL_IP + h.Type = IP_PKTINFO + h.SetLen(CmsgLen(SizeofInet4Pktinfo)) + *(*Inet4Pktinfo)(h.data(0)) = *info + return b +} + +// PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO. +func PktInfo6(info *Inet6Pktinfo) []byte { + b := make([]byte, CmsgSpace(SizeofInet6Pktinfo)) + h := (*Cmsghdr)(unsafe.Pointer(&b[0])) + h.Level = SOL_IPV6 + h.Type = IPV6_PKTINFO + h.SetLen(CmsgLen(SizeofInet6Pktinfo)) + *(*Inet6Pktinfo)(h.data(0)) = *info + return b +} + +// ParseOrigDstAddr decodes a socket control message containing the original +// destination address. To receive such a message the IP_RECVORIGDSTADDR or +// IPV6_RECVORIGDSTADDR option must be enabled on the socket. +func ParseOrigDstAddr(m *SocketControlMessage) (Sockaddr, error) { + switch { + case m.Header.Level == SOL_IP && m.Header.Type == IP_ORIGDSTADDR: + pp := (*RawSockaddrInet4)(unsafe.Pointer(&m.Data[0])) + sa := new(SockaddrInet4) + p := (*[2]byte)(unsafe.Pointer(&pp.Port)) + sa.Port = int(p[0])<<8 + int(p[1]) + sa.Addr = pp.Addr + return sa, nil + + case m.Header.Level == SOL_IPV6 && m.Header.Type == IPV6_ORIGDSTADDR: + pp := (*RawSockaddrInet6)(unsafe.Pointer(&m.Data[0])) + sa := new(SockaddrInet6) + p := (*[2]byte)(unsafe.Pointer(&pp.Port)) + sa.Port = int(p[0])<<8 + int(p[1]) + sa.ZoneId = pp.Scope_id + sa.Addr = pp.Addr + return sa, nil + + default: + return nil, EINVAL + } +} diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_aix.go b/ibm/vendor/golang.org/x/sys/unix/syscall_aix.go index d8efb715ff..4f55c8d999 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -70,9 +70,7 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } @@ -85,9 +83,7 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } @@ -261,9 +257,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil case AF_INET6: @@ -272,9 +266,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } return nil, EAFNOSUPPORT @@ -385,6 +377,11 @@ func (w WaitStatus) TrapCause() int { return -1 } //sys fcntl(fd int, cmd int, arg int) (val int, err error) +//sys fsyncRange(fd int, how int, start int64, length int64) (err error) = fsync_range +func Fsync(fd int) error { + return fsyncRange(fd, O_SYNC, 0, 0) +} + /* * Direct access */ @@ -401,7 +398,6 @@ func (w WaitStatus) TrapCause() int { return -1 } //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Fdatasync(fd int) (err error) -//sys Fsync(fd int) (err error) // readdir_r //sysnb Getpgid(pid int) (pgid int, err error) @@ -523,8 +519,10 @@ func Pipe(p []int) (err error) { } var pp [2]_C_int err = pipe(&pp) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return } diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_bsd.go b/ibm/vendor/golang.org/x/sys/unix/syscall_bsd.go index 95ac3946b5..0ce4523261 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -163,9 +163,7 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -179,9 +177,7 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -210,9 +206,7 @@ func (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Nlen = sa.Nlen sa.raw.Alen = sa.Alen sa.raw.Slen = sa.Slen - for i := 0; i < len(sa.raw.Data); i++ { - sa.raw.Data[i] = sa.Data[i] - } + sa.raw.Data = sa.Data return unsafe.Pointer(&sa.raw), SizeofSockaddrDatalink, nil } @@ -228,9 +222,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa.Nlen = pp.Nlen sa.Alen = pp.Alen sa.Slen = pp.Slen - for i := 0; i < len(sa.Data); i++ { - sa.Data[i] = pp.Data[i] - } + sa.Data = pp.Data return sa, nil case AF_UNIX: @@ -262,9 +254,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil case AF_INET6: @@ -273,9 +263,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } return anyToSockaddrGOOS(fd, rsa) diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_darwin.go b/ibm/vendor/golang.org/x/sys/unix/syscall_darwin.go index d59fb95c82..0eaab91314 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -48,6 +48,30 @@ func (sa *SockaddrCtl) sockaddr() (unsafe.Pointer, _Socklen, error) { return unsafe.Pointer(&sa.raw), SizeofSockaddrCtl, nil } +// SockaddrVM implements the Sockaddr interface for AF_VSOCK type sockets. +// SockaddrVM provides access to Darwin VM sockets: a mechanism that enables +// bidirectional communication between a hypervisor and its guest virtual +// machines. +type SockaddrVM struct { + // CID and Port specify a context ID and port address for a VM socket. + // Guests have a unique CID, and hosts may have a well-known CID of: + // - VMADDR_CID_HYPERVISOR: refers to the hypervisor process. + // - VMADDR_CID_LOCAL: refers to local communication (loopback). + // - VMADDR_CID_HOST: refers to other processes on the host. + CID uint32 + Port uint32 + raw RawSockaddrVM +} + +func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) { + sa.raw.Len = SizeofSockaddrVM + sa.raw.Family = AF_VSOCK + sa.raw.Port = sa.Port + sa.raw.Cid = sa.CID + + return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil +} + func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_SYSTEM: @@ -58,6 +82,13 @@ func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa.Unit = pp.Sc_unit return sa, nil } + case AF_VSOCK: + pp := (*RawSockaddrVM)(unsafe.Pointer(rsa)) + sa := &SockaddrVM{ + CID: pp.Cid, + Port: pp.Port, + } + return sa, nil } return nil, EAFNOSUPPORT } @@ -128,8 +159,10 @@ func Pipe(p []int) (err error) { } var x [2]int32 err = pipe(&x) - p[0] = int(x[0]) - p[1] = int(x[1]) + if err == nil { + p[0] = int(x[0]) + p[1] = int(x[1]) + } return } @@ -399,8 +432,25 @@ func GetsockoptXucred(fd, level, opt int) (*Xucred, error) { return x, err } -func SysctlKinfoProcSlice(name string) ([]KinfoProc, error) { - mib, err := sysctlmib(name) +func SysctlKinfoProc(name string, args ...int) (*KinfoProc, error) { + mib, err := sysctlmib(name, args...) + if err != nil { + return nil, err + } + + var kinfo KinfoProc + n := uintptr(SizeofKinfoProc) + if err := sysctl(mib, (*byte)(unsafe.Pointer(&kinfo)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofKinfoProc { + return nil, EIO + } + return &kinfo, nil +} + +func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) { + mib, err := sysctlmib(name, args...) if err != nil { return nil, err } diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/ibm/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index 5af108a503..2e37c3167f 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -101,7 +101,10 @@ func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } - p[0], p[1], err = pipe() + r, w, err := pipe() + if err == nil { + p[0], p[1] = r, w + } return } @@ -114,7 +117,10 @@ func Pipe2(p []int, flags int) (err error) { var pp [2]_C_int // pipe2 on dragonfly takes an fds array as an argument, but still // returns the file descriptors. - p[0], p[1], err = pipe2(&pp, flags) + r, w, err := pipe2(&pp, flags) + if err == nil { + p[0], p[1] = r, w + } return err } diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/ibm/vendor/golang.org/x/sys/unix/syscall_freebsd.go index 18c392cf36..2f650ae665 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -110,8 +110,10 @@ func Pipe2(p []int, flags int) error { } var pp [2]_C_int err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return err } diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_linux.go b/ibm/vendor/golang.org/x/sys/unix/syscall_linux.go index fff38a84c9..f432b0684b 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -131,8 +131,10 @@ func Pipe2(p []int, flags int) error { } var pp [2]_C_int err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return err } @@ -372,9 +374,7 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } @@ -387,9 +387,7 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } @@ -438,9 +436,7 @@ func (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Hatype = sa.Hatype sa.raw.Pkttype = sa.Pkttype sa.raw.Halen = sa.Halen - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil } @@ -855,12 +851,10 @@ func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Addr == nil { return nil, 0, EINVAL } - sa.raw.Family = AF_TIPC sa.raw.Scope = int8(sa.Scope) sa.raw.Addrtype = sa.Addr.tipcAddrtype() sa.raw.Addr = sa.Addr.tipcAddr() - return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil } @@ -874,9 +868,7 @@ type SockaddrL2TPIP struct { func (sa *SockaddrL2TPIP) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_INET sa.raw.Conn_id = sa.ConnId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP, nil } @@ -892,9 +884,7 @@ func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_INET6 sa.raw.Conn_id = sa.ConnId sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP6, nil } @@ -990,9 +980,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa.Hatype = pp.Hatype sa.Pkttype = pp.Pkttype sa.Halen = pp.Halen - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil case AF_UNIX: @@ -1031,18 +1019,14 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { pp := (*RawSockaddrL2TPIP)(unsafe.Pointer(rsa)) sa := new(SockaddrL2TPIP) sa.ConnId = pp.Conn_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil default: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } @@ -1058,9 +1042,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrL2TPIP6) sa.ConnId = pp.Conn_id sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil default: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) @@ -1068,9 +1050,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } @@ -1797,6 +1777,16 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri return mount(source, target, fstype, flags, datap) } +//sys mountSetattr(dirfd int, pathname string, flags uint, attr *MountAttr, size uintptr) (err error) = SYS_MOUNT_SETATTR + +// MountSetattr is a wrapper for mount_setattr(2). +// https://man7.org/linux/man-pages/man2/mount_setattr.2.html +// +// Requires kernel >= 5.12. +func MountSetattr(dirfd int, pathname string, flags uint, attr *MountAttr) error { + return mountSetattr(dirfd, pathname, flags, attr, unsafe.Sizeof(*attr)) +} + func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/ibm/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 853d5f0f43..696fed496f 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -110,14 +110,8 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } -//sysnb pipe() (fd1 int, fd2 int, err error) - func Pipe(p []int) (err error) { - if len(p) != 2 { - return EINVAL - } - p[0], p[1], err = pipe() - return + return Pipe2(p, 0) } //sysnb pipe2(p *[2]_C_int, flags int) (err error) @@ -128,8 +122,10 @@ func Pipe2(p []int, flags int) error { } var pp [2]_C_int err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return err } diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/ibm/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 22b5503850..11b1d419da 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -87,8 +87,10 @@ func Pipe2(p []int, flags int) error { } var pp [2]_C_int err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return err } diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_solaris.go b/ibm/vendor/golang.org/x/sys/unix/syscall_solaris.go index d2a6495c7e..5c813921e8 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -66,8 +66,10 @@ func Pipe(p []int) (err error) { if n != 0 { return err } - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return nil } @@ -79,8 +81,10 @@ func Pipe2(p []int, flags int) error { } var pp [2]_C_int err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return err } @@ -92,9 +96,7 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } @@ -107,9 +109,7 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } @@ -417,9 +417,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil case AF_INET6: @@ -428,9 +426,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } return nil, EAFNOSUPPORT diff --git a/ibm/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/ibm/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go index 1ffd8bfcfb..f8616f454e 100644 --- a/ibm/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/ibm/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -67,9 +67,7 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -83,9 +81,7 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } + sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -144,9 +140,7 @@ func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil case AF_INET6: @@ -155,9 +149,7 @@ func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } + sa.Addr = pp.Addr return sa, nil } return nil, EAFNOSUPPORT @@ -587,8 +579,10 @@ func Pipe(p []int) (err error) { } var pp [2]_C_int err = pipe(&pp) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + if err == nil { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } return } diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux.go index 78d4b85ece..4e54205861 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1,4 +1,4 @@ -// Code generated by mkmerge.go; DO NOT EDIT. +// Code generated by mkmerge; DO NOT EDIT. //go:build linux // +build linux @@ -116,6 +116,7 @@ const ( ARPHRD_LAPB = 0x204 ARPHRD_LOCALTLK = 0x305 ARPHRD_LOOPBACK = 0x304 + ARPHRD_MCTP = 0x122 ARPHRD_METRICOM = 0x17 ARPHRD_NETLINK = 0x338 ARPHRD_NETROM = 0x0 @@ -472,6 +473,7 @@ const ( DM_DEV_WAIT = 0xc138fd08 DM_DIR = "mapper" DM_GET_TARGET_VERSION = 0xc138fd11 + DM_IMA_MEASUREMENT_FLAG = 0x80000 DM_INACTIVE_PRESENT_FLAG = 0x40 DM_INTERNAL_SUSPEND_FLAG = 0x40000 DM_IOCTL = 0xfd @@ -716,6 +718,7 @@ const ( ETH_P_LOOPBACK = 0x9000 ETH_P_MACSEC = 0x88e5 ETH_P_MAP = 0xf9 + ETH_P_MCTP = 0xfa ETH_P_MOBITEX = 0x15 ETH_P_MPLS_MC = 0x8848 ETH_P_MPLS_UC = 0x8847 @@ -738,6 +741,7 @@ const ( ETH_P_QINQ2 = 0x9200 ETH_P_QINQ3 = 0x9300 ETH_P_RARP = 0x8035 + ETH_P_REALTEK = 0x8899 ETH_P_SCA = 0x6007 ETH_P_SLOW = 0x8809 ETH_P_SNAP = 0x5 @@ -751,6 +755,21 @@ const ( ETH_P_WCCP = 0x883e ETH_P_X25 = 0x805 ETH_P_XDSA = 0xf8 + EV_ABS = 0x3 + EV_CNT = 0x20 + EV_FF = 0x15 + EV_FF_STATUS = 0x17 + EV_KEY = 0x1 + EV_LED = 0x11 + EV_MAX = 0x1f + EV_MSC = 0x4 + EV_PWR = 0x16 + EV_REL = 0x2 + EV_REP = 0x14 + EV_SND = 0x12 + EV_SW = 0x5 + EV_SYN = 0x0 + EV_VERSION = 0x10001 EXABYTE_ENABLE_NEST = 0xf0 EXT2_SUPER_MAGIC = 0xef53 EXT3_SUPER_MAGIC = 0xef53 @@ -789,11 +808,15 @@ const ( FAN_DELETE_SELF = 0x400 FAN_DENY = 0x2 FAN_ENABLE_AUDIT = 0x40 + FAN_EPIDFD = -0x2 FAN_EVENT_INFO_TYPE_DFID = 0x3 FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 + FAN_EVENT_INFO_TYPE_ERROR = 0x5 FAN_EVENT_INFO_TYPE_FID = 0x1 + FAN_EVENT_INFO_TYPE_PIDFD = 0x4 FAN_EVENT_METADATA_LEN = 0x18 FAN_EVENT_ON_CHILD = 0x8000000 + FAN_FS_ERROR = 0x8000 FAN_MARK_ADD = 0x1 FAN_MARK_DONT_FOLLOW = 0x4 FAN_MARK_FILESYSTEM = 0x100 @@ -811,6 +834,7 @@ const ( FAN_MOVE_SELF = 0x800 FAN_NOFD = -0x1 FAN_NONBLOCK = 0x2 + FAN_NOPIDFD = -0x1 FAN_ONDIR = 0x40000000 FAN_OPEN = 0x20 FAN_OPEN_EXEC = 0x1000 @@ -821,6 +845,7 @@ const ( FAN_REPORT_DIR_FID = 0x400 FAN_REPORT_FID = 0x200 FAN_REPORT_NAME = 0x800 + FAN_REPORT_PIDFD = 0x80 FAN_REPORT_TID = 0x100 FAN_UNLIMITED_MARKS = 0x20 FAN_UNLIMITED_QUEUE = 0x10 @@ -1454,6 +1479,18 @@ const ( MNT_FORCE = 0x1 MODULE_INIT_IGNORE_MODVERSIONS = 0x1 MODULE_INIT_IGNORE_VERMAGIC = 0x2 + MOUNT_ATTR_IDMAP = 0x100000 + MOUNT_ATTR_NOATIME = 0x10 + MOUNT_ATTR_NODEV = 0x4 + MOUNT_ATTR_NODIRATIME = 0x80 + MOUNT_ATTR_NOEXEC = 0x8 + MOUNT_ATTR_NOSUID = 0x2 + MOUNT_ATTR_NOSYMFOLLOW = 0x200000 + MOUNT_ATTR_RDONLY = 0x1 + MOUNT_ATTR_RELATIME = 0x0 + MOUNT_ATTR_SIZE_VER0 = 0x20 + MOUNT_ATTR_STRICTATIME = 0x20 + MOUNT_ATTR__ATIME = 0x70 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1793,6 +1830,8 @@ const ( PERF_MEM_BLK_DATA = 0x2 PERF_MEM_BLK_NA = 0x1 PERF_MEM_BLK_SHIFT = 0x28 + PERF_MEM_HOPS_0 = 0x1 + PERF_MEM_HOPS_SHIFT = 0x2b PERF_MEM_LOCK_LOCKED = 0x2 PERF_MEM_LOCK_NA = 0x1 PERF_MEM_LOCK_SHIFT = 0x18 @@ -1952,6 +1991,9 @@ const ( PR_SCHED_CORE_CREATE = 0x1 PR_SCHED_CORE_GET = 0x0 PR_SCHED_CORE_MAX = 0x4 + PR_SCHED_CORE_SCOPE_PROCESS_GROUP = 0x2 + PR_SCHED_CORE_SCOPE_THREAD = 0x0 + PR_SCHED_CORE_SCOPE_THREAD_GROUP = 0x1 PR_SCHED_CORE_SHARE_FROM = 0x3 PR_SCHED_CORE_SHARE_TO = 0x2 PR_SET_CHILD_SUBREAPER = 0x24 @@ -1997,6 +2039,7 @@ const ( PR_SPEC_ENABLE = 0x2 PR_SPEC_FORCE_DISABLE = 0x8 PR_SPEC_INDIRECT_BRANCH = 0x1 + PR_SPEC_L1D_FLUSH = 0x2 PR_SPEC_NOT_AFFECTED = 0x0 PR_SPEC_PRCTL = 0x1 PR_SPEC_STORE_BYPASS = 0x0 @@ -2132,12 +2175,23 @@ const ( RTCF_NAT = 0x800000 RTCF_VALVE = 0x200000 RTC_AF = 0x20 + RTC_BSM_DIRECT = 0x1 + RTC_BSM_DISABLED = 0x0 + RTC_BSM_LEVEL = 0x2 + RTC_BSM_STANDBY = 0x3 RTC_FEATURE_ALARM = 0x0 + RTC_FEATURE_ALARM_RES_2S = 0x3 RTC_FEATURE_ALARM_RES_MINUTE = 0x1 - RTC_FEATURE_CNT = 0x3 + RTC_FEATURE_BACKUP_SWITCH_MODE = 0x6 + RTC_FEATURE_CNT = 0x7 + RTC_FEATURE_CORRECTION = 0x5 RTC_FEATURE_NEED_WEEK_DAY = 0x2 + RTC_FEATURE_UPDATE_INTERRUPT = 0x4 RTC_IRQF = 0x80 RTC_MAX_FREQ = 0x2000 + RTC_PARAM_BACKUP_SWITCH_MODE = 0x2 + RTC_PARAM_CORRECTION = 0x1 + RTC_PARAM_FEATURES = 0x0 RTC_PF = 0x40 RTC_UF = 0x10 RTF_ADDRCLASSMASK = 0xf8000000 @@ -2432,12 +2486,15 @@ const ( SMART_WRITE_THRESHOLDS = 0xd7 SMB_SUPER_MAGIC = 0x517b SOCKFS_MAGIC = 0x534f434b + SOCK_BUF_LOCK_MASK = 0x3 SOCK_DCCP = 0x6 SOCK_IOC_TYPE = 0x89 SOCK_PACKET = 0xa SOCK_RAW = 0x3 + SOCK_RCVBUF_LOCK = 0x2 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 + SOCK_SNDBUF_LOCK = 0x1 SOL_AAL = 0x109 SOL_ALG = 0x117 SOL_ATM = 0x108 @@ -2494,6 +2551,8 @@ const ( SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 SO_VM_SOCKETS_BUFFER_SIZE = 0x0 SO_VM_SOCKETS_CONNECT_TIMEOUT = 0x6 + SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW = 0x8 + SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD = 0x6 SO_VM_SOCKETS_NONBLOCK_TXRX = 0x7 SO_VM_SOCKETS_PEER_HOST_VM_ID = 0x3 SO_VM_SOCKETS_TRUSTED = 0x5 @@ -2788,6 +2847,13 @@ const ( WDIOS_TEMPPANIC = 0x4 WDIOS_UNKNOWN = -0x1 WEXITED = 0x4 + WGALLOWEDIP_A_MAX = 0x3 + WGDEVICE_A_MAX = 0x8 + WGPEER_A_MAX = 0xa + WG_CMD_MAX = 0x1 + WG_GENL_NAME = "wireguard" + WG_GENL_VERSION = 0x1 + WG_KEY_LEN = 0x20 WIN_ACKMEDIACHANGE = 0xdb WIN_CHECKPOWERMODE1 = 0xe5 WIN_CHECKPOWERMODE2 = 0x98 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 697811a460..234fd4a5d1 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -5,7 +5,7 @@ // +build 386,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/unix/_const.go package unix @@ -250,6 +250,8 @@ const ( RTC_EPOCH_SET = 0x4004700e RTC_IRQP_READ = 0x8004700b RTC_IRQP_SET = 0x4004700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x801c7011 @@ -293,6 +295,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -326,6 +329,7 @@ const ( SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 7d8d93bfc4..58619b7589 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -5,7 +5,7 @@ // +build amd64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/unix/_const.go package unix @@ -251,6 +251,8 @@ const ( RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 @@ -294,6 +296,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -327,6 +330,7 @@ const ( SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index f707d50894..3a64ff59dc 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -5,7 +5,7 @@ // +build arm,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -257,6 +257,8 @@ const ( RTC_EPOCH_SET = 0x4004700e RTC_IRQP_READ = 0x8004700b RTC_IRQP_SET = 0x4004700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x801c7011 @@ -300,6 +302,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -333,6 +336,7 @@ const ( SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 3a67a9c852..abe0b92578 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -5,7 +5,7 @@ // +build arm64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/_const.go package unix @@ -247,6 +247,8 @@ const ( RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 @@ -290,6 +292,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -323,6 +326,7 @@ const ( SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index a7ccef56c5..14d7a84399 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -5,7 +5,7 @@ // +build mips,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -250,6 +250,8 @@ const ( RTC_EPOCH_SET = 0x8004700e RTC_IRQP_READ = 0x4004700b RTC_IRQP_SET = 0x8004700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x401c7011 @@ -293,6 +295,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -326,6 +329,7 @@ const ( SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index f7b7cec910..99e7c4ac0b 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -5,7 +5,7 @@ // +build mips64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -250,6 +250,8 @@ const ( RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 @@ -293,6 +295,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -326,6 +329,7 @@ const ( SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 4fcacf9584..496364c33c 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -5,7 +5,7 @@ // +build mips64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -250,6 +250,8 @@ const ( RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 @@ -293,6 +295,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -326,6 +329,7 @@ const ( SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 6f6c223a2c..3e40830857 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -5,7 +5,7 @@ // +build mipsle,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -250,6 +250,8 @@ const ( RTC_EPOCH_SET = 0x8004700e RTC_IRQP_READ = 0x4004700b RTC_IRQP_SET = 0x8004700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x401c7011 @@ -293,6 +295,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -326,6 +329,7 @@ const ( SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 59e522bcf4..1151a7dfab 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -5,7 +5,7 @@ // +build ppc,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -305,6 +305,8 @@ const ( RTC_EPOCH_SET = 0x8004700e RTC_IRQP_READ = 0x4004700b RTC_IRQP_SET = 0x8004700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x401c7011 @@ -348,6 +350,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -381,6 +384,7 @@ const ( SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index d4264a0f73..ed17f249e7 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -5,7 +5,7 @@ // +build ppc64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -309,6 +309,8 @@ const ( RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 @@ -352,6 +354,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -385,6 +388,7 @@ const ( SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 21cbec1dd3..d84a37c1ac 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -5,7 +5,7 @@ // +build ppc64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -309,6 +309,8 @@ const ( RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 @@ -352,6 +354,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -385,6 +388,7 @@ const ( SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 9b05bf12fc..5cafba83f6 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -5,7 +5,7 @@ // +build riscv64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -238,6 +238,8 @@ const ( RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 @@ -281,6 +283,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -314,6 +317,7 @@ const ( SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index bd82ace09a..6d122da41c 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -5,7 +5,7 @@ // +build s390x,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/_const.go package unix @@ -313,6 +313,8 @@ const ( RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 @@ -356,6 +358,7 @@ const ( SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 @@ -389,6 +392,7 @@ const ( SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 diff --git a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 1f8bded56b..6bd19e51db 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -5,7 +5,7 @@ // +build sparc64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go package unix @@ -304,6 +304,8 @@ const ( RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c + RTC_PARAM_GET = 0x80187013 + RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 @@ -347,6 +349,7 @@ const ( SO_BPF_EXTENSIONS = 0x32 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0x400 + SO_BUF_LOCK = 0x51 SO_BUSY_POLL = 0x30 SO_BUSY_POLL_BUDGET = 0x49 SO_CNX_ADVICE = 0x37 @@ -380,6 +383,7 @@ const ( SO_RCVTIMEO = 0x2000 SO_RCVTIMEO_NEW = 0x44 SO_RCVTIMEO_OLD = 0x2000 + SO_RESERVE_MEM = 0x52 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x24 diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go index 91a23cc728..85e0cc3866 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go @@ -17,6 +17,7 @@ int getdirent(int, uintptr_t, size_t); int wait4(int, uintptr_t, int, uintptr_t); int ioctl(int, int, uintptr_t); int fcntl(uintptr_t, int, uintptr_t); +int fsync_range(int, int, long long, long long); int acct(uintptr_t); int chdir(uintptr_t); int chroot(uintptr_t); @@ -29,7 +30,6 @@ int fchmod(int, unsigned int); int fchmodat(int, uintptr_t, unsigned int, int); int fchownat(int, uintptr_t, int, int, int); int fdatasync(int); -int fsync(int); int getpgid(int); int getpgrp(); int getpid(); @@ -255,6 +255,16 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fsyncRange(fd int, how int, start int64, length int64) (err error) { + r0, er := C.fsync_range(C.int(fd), C.int(how), C.longlong(start), C.longlong(length)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Acct(path string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.acct(C.uintptr_t(_p0)) @@ -379,16 +389,6 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fsync(fd int) (err error) { - r0, er := C.fsync(C.int(fd)) - if r0 == -1 && er != nil { - err = er - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getpgid(pid int) (pgid int, err error) { r0, er := C.getpgid(C.int(pid)) pgid = int(r0) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go index 33c2609b8b..f1d4a73b08 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go @@ -135,6 +135,16 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fsyncRange(fd int, how int, start int64, length int64) (err error) { + _, e1 := callfsync_range(fd, how, start, length) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -283,16 +293,6 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fsync(fd int) (err error) { - _, e1 := callfsync(fd) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getpgid(pid int) (pgid int, err error) { r0, e1 := callgetpgid(pid) pgid = int(r0) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go index 8b737fa971..2caa5adf95 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go @@ -18,6 +18,7 @@ import ( //go:cgo_import_dynamic libc_wait4 wait4 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_ioctl ioctl "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fcntl fcntl "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fsync_range fsync_range "libc.a/shr_64.o" //go:cgo_import_dynamic libc_acct acct "libc.a/shr_64.o" //go:cgo_import_dynamic libc_chdir chdir "libc.a/shr_64.o" //go:cgo_import_dynamic libc_chroot chroot "libc.a/shr_64.o" @@ -30,7 +31,6 @@ import ( //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fchownat fchownat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fdatasync fdatasync "libc.a/shr_64.o" -//go:cgo_import_dynamic libc_fsync fsync "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpgid getpgid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpid getpid "libc.a/shr_64.o" @@ -136,6 +136,7 @@ import ( //go:linkname libc_wait4 libc_wait4 //go:linkname libc_ioctl libc_ioctl //go:linkname libc_fcntl libc_fcntl +//go:linkname libc_fsync_range libc_fsync_range //go:linkname libc_acct libc_acct //go:linkname libc_chdir libc_chdir //go:linkname libc_chroot libc_chroot @@ -148,7 +149,6 @@ import ( //go:linkname libc_fchmodat libc_fchmodat //go:linkname libc_fchownat libc_fchownat //go:linkname libc_fdatasync libc_fdatasync -//go:linkname libc_fsync libc_fsync //go:linkname libc_getpgid libc_getpgid //go:linkname libc_getpgrp libc_getpgrp //go:linkname libc_getpid libc_getpid @@ -257,6 +257,7 @@ var ( libc_wait4, libc_ioctl, libc_fcntl, + libc_fsync_range, libc_acct, libc_chdir, libc_chroot, @@ -269,7 +270,6 @@ var ( libc_fchmodat, libc_fchownat, libc_fdatasync, - libc_fsync, libc_getpgid, libc_getpgrp, libc_getpid, @@ -430,6 +430,13 @@ func callfcntl(fd uintptr, cmd int, arg uintptr) (r1 uintptr, e1 Errno) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func callfsync_range(fd int, how int, start int64, length int64) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fsync_range)), 4, uintptr(fd), uintptr(how), uintptr(start), uintptr(length), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func callacct(_p0 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_acct)), 1, _p0, 0, 0, 0, 0, 0) return @@ -514,13 +521,6 @@ func callfdatasync(fd int) (r1 uintptr, e1 Errno) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func callfsync(fd int) (r1 uintptr, e1 Errno) { - r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fsync)), 1, uintptr(fd), 0, 0, 0, 0, 0) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func callgetpgid(pid int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0) return diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go index 3c260917ed..944a714b1a 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go @@ -16,6 +16,7 @@ int getdirent(int, uintptr_t, size_t); int wait4(int, uintptr_t, int, uintptr_t); int ioctl(int, int, uintptr_t); int fcntl(uintptr_t, int, uintptr_t); +int fsync_range(int, int, long long, long long); int acct(uintptr_t); int chdir(uintptr_t); int chroot(uintptr_t); @@ -28,7 +29,6 @@ int fchmod(int, unsigned int); int fchmodat(int, uintptr_t, unsigned int, int); int fchownat(int, uintptr_t, int, int, int); int fdatasync(int); -int fsync(int); int getpgid(int); int getpgrp(); int getpid(); @@ -199,6 +199,14 @@ func callfcntl(fd uintptr, cmd int, arg uintptr) (r1 uintptr, e1 Errno) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func callfsync_range(fd int, how int, start int64, length int64) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fsync_range(C.int(fd), C.int(how), C.longlong(start), C.longlong(length))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func callacct(_p0 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.acct(C.uintptr_t(_p0))) e1 = syscall.GetErrno() @@ -295,14 +303,6 @@ func callfdatasync(fd int) (r1 uintptr, e1 Errno) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func callfsync(fd int) (r1 uintptr, e1 Errno) { - r1 = uintptr(C.fsync(C.int(fd))) - e1 = syscall.GetErrno() - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func callgetpgid(pid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getpgid(C.int(pid))) e1 = syscall.GetErrno() diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/ibm/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 33e19776db..4ebcf21758 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -264,6 +264,30 @@ TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendfile_trampoline_addr(SB)/8, $libc_sendfile_trampoline<>(SB) +TEXT libc_shmat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_shmat(SB) + +GLOBL ·libc_shmat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_shmat_trampoline_addr(SB)/8, $libc_shmat_trampoline<>(SB) + +TEXT libc_shmctl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_shmctl(SB) + +GLOBL ·libc_shmctl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_shmctl_trampoline_addr(SB)/8, $libc_shmctl_trampoline<>(SB) + +TEXT libc_shmdt_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_shmdt(SB) + +GLOBL ·libc_shmdt_trampoline_addr(SB), RODATA, $8 +DATA ·libc_shmdt_trampoline_addr(SB)/8, $libc_shmdt_trampoline<>(SB) + +TEXT libc_shmget_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_shmget(SB) + +GLOBL ·libc_shmget_trampoline_addr(SB), RODATA, $8 +DATA ·libc_shmget_trampoline_addr(SB)/8, $libc_shmget_trampoline<>(SB) + TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 4f5da1f54f..93edda4c49 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -1,4 +1,4 @@ -// Code generated by mkmerge.go; DO NOT EDIT. +// Code generated by mkmerge; DO NOT EDIT. //go:build linux // +build linux @@ -409,6 +409,21 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mountSetattr(dirfd int, pathname string, flags uint, attr *MountAttr, size uintptr) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(pathname) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MOUNT_SETATTR, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(unsafe.Pointer(attr)), uintptr(size), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 4726ab30a8..51d0c0742b 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -351,18 +351,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (fd1 int, fd2 int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - fd1 = int(r0) - fd2 = int(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index fe71456dbc..df2efb6db3 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -351,18 +351,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (fd1 int, fd2 int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - fd1 = int(r0) - fd2 = int(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index 0b5b2f0143..c8536c2c9f 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -351,18 +351,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (fd1 int, fd2 int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - fd1 = int(r0) - fd2 = int(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { diff --git a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index bfca28648f..8b981bfc2e 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -351,18 +351,6 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (fd1 int, fd2 int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - fd1 = int(r0) - fd2 = int(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index aa7ce85d15..cac1f758bf 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -444,4 +444,6 @@ const ( SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index b830326386..f327e4a0bc 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -366,4 +366,6 @@ const ( SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index d75f65a0aa..fb06a08d4e 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -7,6 +7,7 @@ package unix const ( + SYS_SYSCALL_MASK = 0 SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 @@ -407,4 +408,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 8b02f09e9b..58285646eb 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -311,4 +311,6 @@ const ( SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 026695abb1..3b0418e689 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -428,4 +428,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 4444 SYS_LANDLOCK_ADD_RULE = 4445 SYS_LANDLOCK_RESTRICT_SELF = 4446 + SYS_PROCESS_MRELEASE = 4448 + SYS_FUTEX_WAITV = 4449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 7320ba9583..314ebf166a 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -358,4 +358,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 5444 SYS_LANDLOCK_ADD_RULE = 5445 SYS_LANDLOCK_RESTRICT_SELF = 5446 + SYS_PROCESS_MRELEASE = 5448 + SYS_FUTEX_WAITV = 5449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 45082dd67f..b8fbb937a3 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -358,4 +358,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 5444 SYS_LANDLOCK_ADD_RULE = 5445 SYS_LANDLOCK_RESTRICT_SELF = 5446 + SYS_PROCESS_MRELEASE = 5448 + SYS_FUTEX_WAITV = 5449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 570a857a56..ee309b2bac 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -428,4 +428,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 4444 SYS_LANDLOCK_ADD_RULE = 4445 SYS_LANDLOCK_RESTRICT_SELF = 4446 + SYS_PROCESS_MRELEASE = 4448 + SYS_FUTEX_WAITV = 4449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 638498d62e..ac3748104e 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -435,4 +435,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 702beebfef..5aa4721110 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -407,4 +407,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index bfc87ea444..0793ac1a65 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -407,4 +407,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index a390e147d3..a520962e39 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -309,4 +309,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 3e791e6cd2..d1738586b4 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -372,4 +372,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 78802a5cf7..dfd5660f97 100644 --- a/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -386,4 +386,6 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 ) diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index 7efe5ccba3..885842c0eb 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -641,13 +641,13 @@ type Eproc struct { Tdev int32 Tpgid int32 Tsess uintptr - Wmesg [8]int8 + Wmesg [8]byte Xsize int32 Xrssize int16 Xccount int16 Xswrss int16 Flag int32 - Login [12]int8 + Login [12]byte Spare [4]int32 _ [4]byte } @@ -688,7 +688,7 @@ type ExternProc struct { P_priority uint8 P_usrpri uint8 P_nice int8 - P_comm [17]int8 + P_comm [17]byte P_pgrp uintptr P_addr uintptr P_xstat uint16 diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index b23a2efe81..b23c02337d 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -641,13 +641,13 @@ type Eproc struct { Tdev int32 Tpgid int32 Tsess uintptr - Wmesg [8]int8 + Wmesg [8]byte Xsize int32 Xrssize int16 Xccount int16 Xswrss int16 Flag int32 - Login [12]int8 + Login [12]byte Spare [4]int32 _ [4]byte } @@ -688,7 +688,7 @@ type ExternProc struct { P_priority uint8 P_usrpri uint8 P_nice int8 - P_comm [17]int8 + P_comm [17]byte P_pgrp uintptr P_addr uintptr P_xstat uint16 diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux.go index 249ecfcd4c..66788f1568 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -1,4 +1,4 @@ -// Code generated by mkmerge.go; DO NOT EDIT. +// Code generated by mkmerge; DO NOT EDIT. //go:build linux // +build linux @@ -743,6 +743,8 @@ const ( AT_STATX_FORCE_SYNC = 0x2000 AT_STATX_DONT_SYNC = 0x4000 + AT_RECURSIVE = 0x8000 + AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 @@ -865,6 +867,7 @@ const ( CTRL_CMD_NEWMCAST_GRP = 0x7 CTRL_CMD_DELMCAST_GRP = 0x8 CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_CMD_GETPOLICY = 0xa CTRL_ATTR_UNSPEC = 0x0 CTRL_ATTR_FAMILY_ID = 0x1 CTRL_ATTR_FAMILY_NAME = 0x2 @@ -873,12 +876,19 @@ const ( CTRL_ATTR_MAXATTR = 0x5 CTRL_ATTR_OPS = 0x6 CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_POLICY = 0x8 + CTRL_ATTR_OP_POLICY = 0x9 + CTRL_ATTR_OP = 0xa CTRL_ATTR_OP_UNSPEC = 0x0 CTRL_ATTR_OP_ID = 0x1 CTRL_ATTR_OP_FLAGS = 0x2 CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 CTRL_ATTR_MCAST_GRP_NAME = 0x1 CTRL_ATTR_MCAST_GRP_ID = 0x2 + CTRL_ATTR_POLICY_UNSPEC = 0x0 + CTRL_ATTR_POLICY_DO = 0x1 + CTRL_ATTR_POLICY_DUMP = 0x2 + CTRL_ATTR_POLICY_DUMP_MAX = 0x2 ) const ( @@ -1134,7 +1144,8 @@ const ( PERF_RECORD_BPF_EVENT = 0x12 PERF_RECORD_CGROUP = 0x13 PERF_RECORD_TEXT_POKE = 0x14 - PERF_RECORD_MAX = 0x15 + PERF_RECORD_AUX_OUTPUT_HW_ID = 0x15 + PERF_RECORD_MAX = 0x16 PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0x0 PERF_RECORD_KSYMBOL_TYPE_BPF = 0x1 PERF_RECORD_KSYMBOL_TYPE_OOL = 0x2 @@ -1774,7 +1785,8 @@ const ( const ( NF_NETDEV_INGRESS = 0x0 - NF_NETDEV_NUMHOOKS = 0x1 + NF_NETDEV_EGRESS = 0x1 + NF_NETDEV_NUMHOOKS = 0x2 ) const ( @@ -3156,7 +3168,13 @@ const ( DEVLINK_ATTR_RELOAD_ACTION_INFO = 0xa2 DEVLINK_ATTR_RELOAD_ACTION_STATS = 0xa3 DEVLINK_ATTR_PORT_PCI_SF_NUMBER = 0xa4 - DEVLINK_ATTR_MAX = 0xa9 + DEVLINK_ATTR_RATE_TYPE = 0xa5 + DEVLINK_ATTR_RATE_TX_SHARE = 0xa6 + DEVLINK_ATTR_RATE_TX_MAX = 0xa7 + DEVLINK_ATTR_RATE_NODE_NAME = 0xa8 + DEVLINK_ATTR_RATE_PARENT_NODE_NAME = 0xa9 + DEVLINK_ATTR_REGION_MAX_SNAPSHOTS = 0xaa + DEVLINK_ATTR_MAX = 0xaa DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 @@ -3264,7 +3282,8 @@ const ( LWTUNNEL_ENCAP_BPF = 0x6 LWTUNNEL_ENCAP_SEG6_LOCAL = 0x7 LWTUNNEL_ENCAP_RPL = 0x8 - LWTUNNEL_ENCAP_MAX = 0x8 + LWTUNNEL_ENCAP_IOAM6 = 0x9 + LWTUNNEL_ENCAP_MAX = 0x9 MPLS_IPTUNNEL_UNSPEC = 0x0 MPLS_IPTUNNEL_DST = 0x1 @@ -3452,7 +3471,14 @@ const ( ETHTOOL_MSG_CABLE_TEST_ACT = 0x1a ETHTOOL_MSG_CABLE_TEST_TDR_ACT = 0x1b ETHTOOL_MSG_TUNNEL_INFO_GET = 0x1c - ETHTOOL_MSG_USER_MAX = 0x21 + ETHTOOL_MSG_FEC_GET = 0x1d + ETHTOOL_MSG_FEC_SET = 0x1e + ETHTOOL_MSG_MODULE_EEPROM_GET = 0x1f + ETHTOOL_MSG_STATS_GET = 0x20 + ETHTOOL_MSG_PHC_VCLOCKS_GET = 0x21 + ETHTOOL_MSG_MODULE_GET = 0x22 + ETHTOOL_MSG_MODULE_SET = 0x23 + ETHTOOL_MSG_USER_MAX = 0x23 ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3483,7 +3509,14 @@ const ( ETHTOOL_MSG_CABLE_TEST_NTF = 0x1b ETHTOOL_MSG_CABLE_TEST_TDR_NTF = 0x1c ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY = 0x1d - ETHTOOL_MSG_KERNEL_MAX = 0x22 + ETHTOOL_MSG_FEC_GET_REPLY = 0x1e + ETHTOOL_MSG_FEC_NTF = 0x1f + ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY = 0x20 + ETHTOOL_MSG_STATS_GET_REPLY = 0x21 + ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY = 0x22 + ETHTOOL_MSG_MODULE_GET_REPLY = 0x23 + ETHTOOL_MSG_MODULE_NTF = 0x24 + ETHTOOL_MSG_KERNEL_MAX = 0x24 ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 @@ -3617,7 +3650,9 @@ const ( ETHTOOL_A_COALESCE_TX_USECS_HIGH = 0x15 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH = 0x16 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17 - ETHTOOL_A_COALESCE_MAX = 0x17 + ETHTOOL_A_COALESCE_USE_CQE_MODE_TX = 0x18 + ETHTOOL_A_COALESCE_USE_CQE_MODE_RX = 0x19 + ETHTOOL_A_COALESCE_MAX = 0x19 ETHTOOL_A_PAUSE_UNSPEC = 0x0 ETHTOOL_A_PAUSE_HEADER = 0x1 ETHTOOL_A_PAUSE_AUTONEG = 0x2 @@ -3956,3 +3991,77 @@ const ( SHM_RDONLY = 0x1000 SHM_RND = 0x2000 ) + +type MountAttr struct { + Attr_set uint64 + Attr_clr uint64 + Propagation uint64 + Userns_fd uint64 +} + +const ( + WG_CMD_GET_DEVICE = 0x0 + WG_CMD_SET_DEVICE = 0x1 + WGDEVICE_F_REPLACE_PEERS = 0x1 + WGDEVICE_A_UNSPEC = 0x0 + WGDEVICE_A_IFINDEX = 0x1 + WGDEVICE_A_IFNAME = 0x2 + WGDEVICE_A_PRIVATE_KEY = 0x3 + WGDEVICE_A_PUBLIC_KEY = 0x4 + WGDEVICE_A_FLAGS = 0x5 + WGDEVICE_A_LISTEN_PORT = 0x6 + WGDEVICE_A_FWMARK = 0x7 + WGDEVICE_A_PEERS = 0x8 + WGPEER_F_REMOVE_ME = 0x1 + WGPEER_F_REPLACE_ALLOWEDIPS = 0x2 + WGPEER_F_UPDATE_ONLY = 0x4 + WGPEER_A_UNSPEC = 0x0 + WGPEER_A_PUBLIC_KEY = 0x1 + WGPEER_A_PRESHARED_KEY = 0x2 + WGPEER_A_FLAGS = 0x3 + WGPEER_A_ENDPOINT = 0x4 + WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL = 0x5 + WGPEER_A_LAST_HANDSHAKE_TIME = 0x6 + WGPEER_A_RX_BYTES = 0x7 + WGPEER_A_TX_BYTES = 0x8 + WGPEER_A_ALLOWEDIPS = 0x9 + WGPEER_A_PROTOCOL_VERSION = 0xa + WGALLOWEDIP_A_UNSPEC = 0x0 + WGALLOWEDIP_A_FAMILY = 0x1 + WGALLOWEDIP_A_IPADDR = 0x2 + WGALLOWEDIP_A_CIDR_MASK = 0x3 +) + +const ( + NL_ATTR_TYPE_INVALID = 0x0 + NL_ATTR_TYPE_FLAG = 0x1 + NL_ATTR_TYPE_U8 = 0x2 + NL_ATTR_TYPE_U16 = 0x3 + NL_ATTR_TYPE_U32 = 0x4 + NL_ATTR_TYPE_U64 = 0x5 + NL_ATTR_TYPE_S8 = 0x6 + NL_ATTR_TYPE_S16 = 0x7 + NL_ATTR_TYPE_S32 = 0x8 + NL_ATTR_TYPE_S64 = 0x9 + NL_ATTR_TYPE_BINARY = 0xa + NL_ATTR_TYPE_STRING = 0xb + NL_ATTR_TYPE_NUL_STRING = 0xc + NL_ATTR_TYPE_NESTED = 0xd + NL_ATTR_TYPE_NESTED_ARRAY = 0xe + NL_ATTR_TYPE_BITFIELD32 = 0xf + + NL_POLICY_TYPE_ATTR_UNSPEC = 0x0 + NL_POLICY_TYPE_ATTR_TYPE = 0x1 + NL_POLICY_TYPE_ATTR_MIN_VALUE_S = 0x2 + NL_POLICY_TYPE_ATTR_MAX_VALUE_S = 0x3 + NL_POLICY_TYPE_ATTR_MIN_VALUE_U = 0x4 + NL_POLICY_TYPE_ATTR_MAX_VALUE_U = 0x5 + NL_POLICY_TYPE_ATTR_MIN_LENGTH = 0x6 + NL_POLICY_TYPE_ATTR_MAX_LENGTH = 0x7 + NL_POLICY_TYPE_ATTR_POLICY_IDX = 0x8 + NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE = 0x9 + NL_POLICY_TYPE_ATTR_BITFIELD32_MASK = 0xa + NL_POLICY_TYPE_ATTR_PAD = 0xb + NL_POLICY_TYPE_ATTR_MASK = 0xc + NL_POLICY_TYPE_ATTR_MAX = 0xc +) diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index eeeb9aa39a..bea2549455 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index d30e1155cc..b8c8f28943 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 69d0297520..4db4430163 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 28a0455bc9..3ebcad8a88 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 64a845483d..3eb33e48ab 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index a1b7dee412..79a9446725 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 936fa6a266..8f4b107cad 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 5dd546fbf0..e4eb217981 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 947b32e434..d5b21f0f7d 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 2a606151b0..5188d142b9 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index d0d735d02c..de4dd4c736 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 95e3d6d06f..dccbf9b060 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index cccf1ef26a..6358806106 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 44fcbe4e9a..765edc13ff 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -1,4 +1,4 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go index 2a8b1e6f73..baf5fe6504 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go @@ -564,12 +564,11 @@ type Uvmexp struct { Kmapent int32 } -const SizeofClockinfo = 0x14 +const SizeofClockinfo = 0x10 type Clockinfo struct { - Hz int32 - Tick int32 - Tickadj int32 - Stathz int32 - Profhz int32 + Hz int32 + Tick int32 + Stathz int32 + Profhz int32 } diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go index b1759cf705..e21ae8ecfa 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go @@ -564,12 +564,11 @@ type Uvmexp struct { Kmapent int32 } -const SizeofClockinfo = 0x14 +const SizeofClockinfo = 0x10 type Clockinfo struct { - Hz int32 - Tick int32 - Tickadj int32 - Stathz int32 - Profhz int32 + Hz int32 + Tick int32 + Stathz int32 + Profhz int32 } diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go index e807de2065..f190651cd9 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go @@ -565,12 +565,11 @@ type Uvmexp struct { Kmapent int32 } -const SizeofClockinfo = 0x14 +const SizeofClockinfo = 0x10 type Clockinfo struct { - Hz int32 - Tick int32 - Tickadj int32 - Stathz int32 - Profhz int32 + Hz int32 + Tick int32 + Stathz int32 + Profhz int32 } diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go index ff3aecaee4..84747c582c 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go @@ -558,12 +558,11 @@ type Uvmexp struct { Kmapent int32 } -const SizeofClockinfo = 0x14 +const SizeofClockinfo = 0x10 type Clockinfo struct { - Hz int32 - Tick int32 - Tickadj int32 - Stathz int32 - Profhz int32 + Hz int32 + Tick int32 + Stathz int32 + Profhz int32 } diff --git a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go index 9ecda69174..ac5c8b6370 100644 --- a/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +++ b/ibm/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go @@ -558,12 +558,11 @@ type Uvmexp struct { Kmapent int32 } -const SizeofClockinfo = 0x14 +const SizeofClockinfo = 0x10 type Clockinfo struct { - Hz int32 - Tick int32 - Tickadj int32 - Stathz int32 - Profhz int32 + Hz int32 + Tick int32 + Stathz int32 + Profhz int32 } diff --git a/ibm/vendor/golang.org/x/tools/AUTHORS b/ibm/vendor/golang.org/x/tools/AUTHORS deleted file mode 100644 index 15167cd746..0000000000 --- a/ibm/vendor/golang.org/x/tools/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/ibm/vendor/golang.org/x/tools/CONTRIBUTORS b/ibm/vendor/golang.org/x/tools/CONTRIBUTORS deleted file mode 100644 index 1c4577e968..0000000000 --- a/ibm/vendor/golang.org/x/tools/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/ibm/vendor/golang.org/x/tools/LICENSE b/ibm/vendor/golang.org/x/tools/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/ibm/vendor/golang.org/x/tools/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/golang.org/x/tools/PATENTS b/ibm/vendor/golang.org/x/tools/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/ibm/vendor/golang.org/x/tools/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google 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, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/ibm/vendor/golang.org/x/tools/cmd/goimports/doc.go b/ibm/vendor/golang.org/x/tools/cmd/goimports/doc.go deleted file mode 100644 index f344d8014a..0000000000 --- a/ibm/vendor/golang.org/x/tools/cmd/goimports/doc.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* - -Command goimports updates your Go import lines, -adding missing ones and removing unreferenced ones. - - $ go get golang.org/x/tools/cmd/goimports - -In addition to fixing imports, goimports also formats -your code in the same style as gofmt so it can be used -as a replacement for your editor's gofmt-on-save hook. - -For emacs, make sure you have the latest go-mode.el: - https://github.com/dominikh/go-mode.el -Then in your .emacs file: - (setq gofmt-command "goimports") - (add-hook 'before-save-hook 'gofmt-before-save) - -For vim, set "gofmt_command" to "goimports": - https://golang.org/change/39c724dd7f252 - https://golang.org/wiki/IDEsAndTextEditorPlugins - etc - -For GoSublime, follow the steps described here: - http://michaelwhatcott.com/gosublime-goimports/ - -For other editors, you probably know what to do. - -To exclude directories in your $GOPATH from being scanned for Go -files, goimports respects a configuration file at -$GOPATH/src/.goimportsignore which may contain blank lines, comment -lines (beginning with '#'), or lines naming a directory relative to -the configuration file to ignore when scanning. No globbing or regex -patterns are allowed. Use the "-v" verbose flag to verify it's -working and see what goimports is doing. - -File bugs or feature requests at: - - https://golang.org/issues/new?title=x/tools/cmd/goimports:+ - -Happy hacking! - -*/ -package main // import "golang.org/x/tools/cmd/goimports" diff --git a/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports.go b/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports.go deleted file mode 100644 index b354c9e824..0000000000 --- a/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports.go +++ /dev/null @@ -1,380 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "bufio" - "bytes" - "errors" - "flag" - "fmt" - "go/scanner" - exec "golang.org/x/sys/execabs" - "io" - "io/ioutil" - "log" - "os" - "path/filepath" - "runtime" - "runtime/pprof" - "strings" - - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/imports" -) - -var ( - // main operation modes - list = flag.Bool("l", false, "list files whose formatting differs from goimport's") - write = flag.Bool("w", false, "write result to (source) file instead of stdout") - doDiff = flag.Bool("d", false, "display diffs instead of rewriting files") - srcdir = flag.String("srcdir", "", "choose imports as if source code is from `dir`. When operating on a single file, dir may instead be the complete file name.") - - verbose bool // verbose logging - - cpuProfile = flag.String("cpuprofile", "", "CPU profile output") - memProfile = flag.String("memprofile", "", "memory profile output") - memProfileRate = flag.Int("memrate", 0, "if > 0, sets runtime.MemProfileRate") - - options = &imports.Options{ - TabWidth: 8, - TabIndent: true, - Comments: true, - Fragment: true, - Env: &imports.ProcessEnv{ - GocmdRunner: &gocommand.Runner{}, - }, - } - exitCode = 0 -) - -func init() { - flag.BoolVar(&options.AllErrors, "e", false, "report all errors (not just the first 10 on different lines)") - flag.StringVar(&options.LocalPrefix, "local", "", "put imports beginning with this string after 3rd-party packages; comma-separated list") - flag.BoolVar(&options.FormatOnly, "format-only", false, "if true, don't fix imports and only format. In this mode, goimports is effectively gofmt, with the addition that imports are grouped into sections.") -} - -func report(err error) { - scanner.PrintError(os.Stderr, err) - exitCode = 2 -} - -func usage() { - fmt.Fprintf(os.Stderr, "usage: goimports [flags] [path ...]\n") - flag.PrintDefaults() - os.Exit(2) -} - -func isGoFile(f os.FileInfo) bool { - // ignore non-Go files - name := f.Name() - return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") -} - -// argumentType is which mode goimports was invoked as. -type argumentType int - -const ( - // fromStdin means the user is piping their source into goimports. - fromStdin argumentType = iota - - // singleArg is the common case from editors, when goimports is run on - // a single file. - singleArg - - // multipleArg is when the user ran "goimports file1.go file2.go" - // or ran goimports on a directory tree. - multipleArg -) - -func processFile(filename string, in io.Reader, out io.Writer, argType argumentType) error { - opt := options - if argType == fromStdin { - nopt := *options - nopt.Fragment = true - opt = &nopt - } - - if in == nil { - f, err := os.Open(filename) - if err != nil { - return err - } - defer f.Close() - in = f - } - - src, err := ioutil.ReadAll(in) - if err != nil { - return err - } - - target := filename - if *srcdir != "" { - // Determine whether the provided -srcdirc is a directory or file - // and then use it to override the target. - // - // See https://github.com/dominikh/go-mode.el/issues/146 - if isFile(*srcdir) { - if argType == multipleArg { - return errors.New("-srcdir value can't be a file when passing multiple arguments or when walking directories") - } - target = *srcdir - } else if argType == singleArg && strings.HasSuffix(*srcdir, ".go") && !isDir(*srcdir) { - // For a file which doesn't exist on disk yet, but might shortly. - // e.g. user in editor opens $DIR/newfile.go and newfile.go doesn't yet exist on disk. - // The goimports on-save hook writes the buffer to a temp file - // first and runs goimports before the actual save to newfile.go. - // The editor's buffer is named "newfile.go" so that is passed to goimports as: - // goimports -srcdir=/gopath/src/pkg/newfile.go /tmp/gofmtXXXXXXXX.go - // and then the editor reloads the result from the tmp file and writes - // it to newfile.go. - target = *srcdir - } else { - // Pretend that file is from *srcdir in order to decide - // visible imports correctly. - target = filepath.Join(*srcdir, filepath.Base(filename)) - } - } - - res, err := imports.Process(target, src, opt) - if err != nil { - return err - } - - if !bytes.Equal(src, res) { - // formatting has changed - if *list { - fmt.Fprintln(out, filename) - } - if *write { - if argType == fromStdin { - // filename is "" - return errors.New("can't use -w on stdin") - } - // On Windows, we need to re-set the permissions from the file. See golang/go#38225. - var perms os.FileMode - if fi, err := os.Stat(filename); err == nil { - perms = fi.Mode() & os.ModePerm - } - err = ioutil.WriteFile(filename, res, perms) - if err != nil { - return err - } - } - if *doDiff { - if argType == fromStdin { - filename = "stdin.go" // because .orig looks silly - } - data, err := diff(src, res, filename) - if err != nil { - return fmt.Errorf("computing diff: %s", err) - } - fmt.Printf("diff -u %s %s\n", filepath.ToSlash(filename+".orig"), filepath.ToSlash(filename)) - out.Write(data) - } - } - - if !*list && !*write && !*doDiff { - _, err = out.Write(res) - } - - return err -} - -func visitFile(path string, f os.FileInfo, err error) error { - if err == nil && isGoFile(f) { - err = processFile(path, nil, os.Stdout, multipleArg) - } - if err != nil { - report(err) - } - return nil -} - -func walkDir(path string) { - filepath.Walk(path, visitFile) -} - -func main() { - runtime.GOMAXPROCS(runtime.NumCPU()) - - // call gofmtMain in a separate function - // so that it can use defer and have them - // run before the exit. - gofmtMain() - os.Exit(exitCode) -} - -// parseFlags parses command line flags and returns the paths to process. -// It's a var so that custom implementations can replace it in other files. -var parseFlags = func() []string { - flag.BoolVar(&verbose, "v", false, "verbose logging") - - flag.Parse() - return flag.Args() -} - -func bufferedFileWriter(dest string) (w io.Writer, close func()) { - f, err := os.Create(dest) - if err != nil { - log.Fatal(err) - } - bw := bufio.NewWriter(f) - return bw, func() { - if err := bw.Flush(); err != nil { - log.Fatalf("error flushing %v: %v", dest, err) - } - if err := f.Close(); err != nil { - log.Fatal(err) - } - } -} - -func gofmtMain() { - flag.Usage = usage - paths := parseFlags() - - if *cpuProfile != "" { - bw, flush := bufferedFileWriter(*cpuProfile) - pprof.StartCPUProfile(bw) - defer flush() - defer pprof.StopCPUProfile() - } - // doTrace is a conditionally compiled wrapper around runtime/trace. It is - // used to allow goimports to compile under gccgo, which does not support - // runtime/trace. See https://golang.org/issue/15544. - defer doTrace()() - if *memProfileRate > 0 { - runtime.MemProfileRate = *memProfileRate - bw, flush := bufferedFileWriter(*memProfile) - defer func() { - runtime.GC() // materialize all statistics - if err := pprof.WriteHeapProfile(bw); err != nil { - log.Fatal(err) - } - flush() - }() - } - - if verbose { - log.SetFlags(log.LstdFlags | log.Lmicroseconds) - options.Env.Logf = log.Printf - } - if options.TabWidth < 0 { - fmt.Fprintf(os.Stderr, "negative tabwidth %d\n", options.TabWidth) - exitCode = 2 - return - } - - if len(paths) == 0 { - if err := processFile("", os.Stdin, os.Stdout, fromStdin); err != nil { - report(err) - } - return - } - - argType := singleArg - if len(paths) > 1 { - argType = multipleArg - } - - for _, path := range paths { - switch dir, err := os.Stat(path); { - case err != nil: - report(err) - case dir.IsDir(): - walkDir(path) - default: - if err := processFile(path, nil, os.Stdout, argType); err != nil { - report(err) - } - } - } -} - -func writeTempFile(dir, prefix string, data []byte) (string, error) { - file, err := ioutil.TempFile(dir, prefix) - if err != nil { - return "", err - } - _, err = file.Write(data) - if err1 := file.Close(); err == nil { - err = err1 - } - if err != nil { - os.Remove(file.Name()) - return "", err - } - return file.Name(), nil -} - -func diff(b1, b2 []byte, filename string) (data []byte, err error) { - f1, err := writeTempFile("", "gofmt", b1) - if err != nil { - return - } - defer os.Remove(f1) - - f2, err := writeTempFile("", "gofmt", b2) - if err != nil { - return - } - defer os.Remove(f2) - - cmd := "diff" - if runtime.GOOS == "plan9" { - cmd = "/bin/ape/diff" - } - - data, err = exec.Command(cmd, "-u", f1, f2).CombinedOutput() - if len(data) > 0 { - // diff exits with a non-zero status when the files don't match. - // Ignore that failure as long as we get output. - return replaceTempFilename(data, filename) - } - return -} - -// replaceTempFilename replaces temporary filenames in diff with actual one. -// -// --- /tmp/gofmt316145376 2017-02-03 19:13:00.280468375 -0500 -// +++ /tmp/gofmt617882815 2017-02-03 19:13:00.280468375 -0500 -// ... -// -> -// --- path/to/file.go.orig 2017-02-03 19:13:00.280468375 -0500 -// +++ path/to/file.go 2017-02-03 19:13:00.280468375 -0500 -// ... -func replaceTempFilename(diff []byte, filename string) ([]byte, error) { - bs := bytes.SplitN(diff, []byte{'\n'}, 3) - if len(bs) < 3 { - return nil, fmt.Errorf("got unexpected diff for %s", filename) - } - // Preserve timestamps. - var t0, t1 []byte - if i := bytes.LastIndexByte(bs[0], '\t'); i != -1 { - t0 = bs[0][i:] - } - if i := bytes.LastIndexByte(bs[1], '\t'); i != -1 { - t1 = bs[1][i:] - } - // Always print filepath with slash separator. - f := filepath.ToSlash(filename) - bs[0] = []byte(fmt.Sprintf("--- %s%s", f+".orig", t0)) - bs[1] = []byte(fmt.Sprintf("+++ %s%s", f, t1)) - return bytes.Join(bs, []byte{'\n'}), nil -} - -// isFile reports whether name is a file. -func isFile(name string) bool { - fi, err := os.Stat(name) - return err == nil && fi.Mode().IsRegular() -} - -// isDir reports whether name is a directory. -func isDir(name string) bool { - fi, err := os.Stat(name) - return err == nil && fi.IsDir() -} diff --git a/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports_gc.go b/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports_gc.go deleted file mode 100644 index 190a56535c..0000000000 --- a/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports_gc.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc -// +build gc - -package main - -import ( - "flag" - "runtime/trace" -) - -var traceProfile = flag.String("trace", "", "trace profile output") - -func doTrace() func() { - if *traceProfile != "" { - bw, flush := bufferedFileWriter(*traceProfile) - trace.Start(bw) - return func() { - flush() - trace.Stop() - } - } - return func() {} -} diff --git a/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports_not_gc.go b/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports_not_gc.go deleted file mode 100644 index 344fe7576b..0000000000 --- a/ibm/vendor/golang.org/x/tools/cmd/goimports/goimports_not_gc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !gc -// +build !gc - -package main - -func doTrace() func() { - return func() {} -} diff --git a/ibm/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/ibm/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go deleted file mode 100644 index 6b7052b892..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -// This file defines utilities for working with source positions. - -import ( - "fmt" - "go/ast" - "go/token" - "sort" -) - -// PathEnclosingInterval returns the node that encloses the source -// interval [start, end), and all its ancestors up to the AST root. -// -// The definition of "enclosing" used by this function considers -// additional whitespace abutting a node to be enclosed by it. -// In this example: -// -// z := x + y // add them -// <-A-> -// <----B-----> -// -// the ast.BinaryExpr(+) node is considered to enclose interval B -// even though its [Pos()..End()) is actually only interval A. -// This behaviour makes user interfaces more tolerant of imperfect -// input. -// -// This function treats tokens as nodes, though they are not included -// in the result. e.g. PathEnclosingInterval("+") returns the -// enclosing ast.BinaryExpr("x + y"). -// -// If start==end, the 1-char interval following start is used instead. -// -// The 'exact' result is true if the interval contains only path[0] -// and perhaps some adjacent whitespace. It is false if the interval -// overlaps multiple children of path[0], or if it contains only -// interior whitespace of path[0]. -// In this example: -// -// z := x + y // add them -// <--C--> <---E--> -// ^ -// D -// -// intervals C, D and E are inexact. C is contained by the -// z-assignment statement, because it spans three of its children (:=, -// x, +). So too is the 1-char interval D, because it contains only -// interior whitespace of the assignment. E is considered interior -// whitespace of the BlockStmt containing the assignment. -// -// Precondition: [start, end) both lie within the same file as root. -// TODO(adonovan): return (nil, false) in this case and remove precond. -// Requires FileSet; see loader.tokenFileContainsPos. -// -// Postcondition: path is never nil; it always contains at least 'root'. -// -func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool) { - // fmt.Printf("EnclosingInterval %d %d\n", start, end) // debugging - - // Precondition: node.[Pos..End) and adjoining whitespace contain [start, end). - var visit func(node ast.Node) bool - visit = func(node ast.Node) bool { - path = append(path, node) - - nodePos := node.Pos() - nodeEnd := node.End() - - // fmt.Printf("visit(%T, %d, %d)\n", node, nodePos, nodeEnd) // debugging - - // Intersect [start, end) with interval of node. - if start < nodePos { - start = nodePos - } - if end > nodeEnd { - end = nodeEnd - } - - // Find sole child that contains [start, end). - children := childrenOf(node) - l := len(children) - for i, child := range children { - // [childPos, childEnd) is unaugmented interval of child. - childPos := child.Pos() - childEnd := child.End() - - // [augPos, augEnd) is whitespace-augmented interval of child. - augPos := childPos - augEnd := childEnd - if i > 0 { - augPos = children[i-1].End() // start of preceding whitespace - } - if i < l-1 { - nextChildPos := children[i+1].Pos() - // Does [start, end) lie between child and next child? - if start >= augEnd && end <= nextChildPos { - return false // inexact match - } - augEnd = nextChildPos // end of following whitespace - } - - // fmt.Printf("\tchild %d: [%d..%d)\tcontains interval [%d..%d)?\n", - // i, augPos, augEnd, start, end) // debugging - - // Does augmented child strictly contain [start, end)? - if augPos <= start && end <= augEnd { - _, isToken := child.(tokenNode) - return isToken || visit(child) - } - - // Does [start, end) overlap multiple children? - // i.e. left-augmented child contains start - // but LR-augmented child does not contain end. - if start < childEnd && end > augEnd { - break - } - } - - // No single child contained [start, end), - // so node is the result. Is it exact? - - // (It's tempting to put this condition before the - // child loop, but it gives the wrong result in the - // case where a node (e.g. ExprStmt) and its sole - // child have equal intervals.) - if start == nodePos && end == nodeEnd { - return true // exact match - } - - return false // inexact: overlaps multiple children - } - - if start > end { - start, end = end, start - } - - if start < root.End() && end > root.Pos() { - if start == end { - end = start + 1 // empty interval => interval of size 1 - } - exact = visit(root) - - // Reverse the path: - for i, l := 0, len(path); i < l/2; i++ { - path[i], path[l-1-i] = path[l-1-i], path[i] - } - } else { - // Selection lies within whitespace preceding the - // first (or following the last) declaration in the file. - // The result nonetheless always includes the ast.File. - path = append(path, root) - } - - return -} - -// tokenNode is a dummy implementation of ast.Node for a single token. -// They are used transiently by PathEnclosingInterval but never escape -// this package. -// -type tokenNode struct { - pos token.Pos - end token.Pos -} - -func (n tokenNode) Pos() token.Pos { - return n.pos -} - -func (n tokenNode) End() token.Pos { - return n.end -} - -func tok(pos token.Pos, len int) ast.Node { - return tokenNode{pos, pos + token.Pos(len)} -} - -// childrenOf returns the direct non-nil children of ast.Node n. -// It may include fake ast.Node implementations for bare tokens. -// it is not safe to call (e.g.) ast.Walk on such nodes. -// -func childrenOf(n ast.Node) []ast.Node { - var children []ast.Node - - // First add nodes for all true subtrees. - ast.Inspect(n, func(node ast.Node) bool { - if node == n { // push n - return true // recur - } - if node != nil { // push child - children = append(children, node) - } - return false // no recursion - }) - - // Then add fake Nodes for bare tokens. - switch n := n.(type) { - case *ast.ArrayType: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Elt.End(), len("]"))) - - case *ast.AssignStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.BasicLit: - children = append(children, - tok(n.ValuePos, len(n.Value))) - - case *ast.BinaryExpr: - children = append(children, tok(n.OpPos, len(n.Op.String()))) - - case *ast.BlockStmt: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("}"))) - - case *ast.BranchStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.CallExpr: - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - if n.Ellipsis != 0 { - children = append(children, tok(n.Ellipsis, len("..."))) - } - - case *ast.CaseClause: - if n.List == nil { - children = append(children, - tok(n.Case, len("default"))) - } else { - children = append(children, - tok(n.Case, len("case"))) - } - children = append(children, tok(n.Colon, len(":"))) - - case *ast.ChanType: - switch n.Dir { - case ast.RECV: - children = append(children, tok(n.Begin, len("<-chan"))) - case ast.SEND: - children = append(children, tok(n.Begin, len("chan<-"))) - case ast.RECV | ast.SEND: - children = append(children, tok(n.Begin, len("chan"))) - } - - case *ast.CommClause: - if n.Comm == nil { - children = append(children, - tok(n.Case, len("default"))) - } else { - children = append(children, - tok(n.Case, len("case"))) - } - children = append(children, tok(n.Colon, len(":"))) - - case *ast.Comment: - // nop - - case *ast.CommentGroup: - // nop - - case *ast.CompositeLit: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("{"))) - - case *ast.DeclStmt: - // nop - - case *ast.DeferStmt: - children = append(children, - tok(n.Defer, len("defer"))) - - case *ast.Ellipsis: - children = append(children, - tok(n.Ellipsis, len("..."))) - - case *ast.EmptyStmt: - // nop - - case *ast.ExprStmt: - // nop - - case *ast.Field: - // TODO(adonovan): Field.{Doc,Comment,Tag}? - - case *ast.FieldList: - children = append(children, - tok(n.Opening, len("(")), - tok(n.Closing, len(")"))) - - case *ast.File: - // TODO test: Doc - children = append(children, - tok(n.Package, len("package"))) - - case *ast.ForStmt: - children = append(children, - tok(n.For, len("for"))) - - case *ast.FuncDecl: - // TODO(adonovan): FuncDecl.Comment? - - // Uniquely, FuncDecl breaks the invariant that - // preorder traversal yields tokens in lexical order: - // in fact, FuncDecl.Recv precedes FuncDecl.Type.Func. - // - // As a workaround, we inline the case for FuncType - // here and order things correctly. - // - children = nil // discard ast.Walk(FuncDecl) info subtrees - children = append(children, tok(n.Type.Func, len("func"))) - if n.Recv != nil { - children = append(children, n.Recv) - } - children = append(children, n.Name) - if n.Type.Params != nil { - children = append(children, n.Type.Params) - } - if n.Type.Results != nil { - children = append(children, n.Type.Results) - } - if n.Body != nil { - children = append(children, n.Body) - } - - case *ast.FuncLit: - // nop - - case *ast.FuncType: - if n.Func != 0 { - children = append(children, - tok(n.Func, len("func"))) - } - - case *ast.GenDecl: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - if n.Lparen != 0 { - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - } - - case *ast.GoStmt: - children = append(children, - tok(n.Go, len("go"))) - - case *ast.Ident: - children = append(children, - tok(n.NamePos, len(n.Name))) - - case *ast.IfStmt: - children = append(children, - tok(n.If, len("if"))) - - case *ast.ImportSpec: - // TODO(adonovan): ImportSpec.{Doc,EndPos}? - - case *ast.IncDecStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.IndexExpr: - children = append(children, - tok(n.Lbrack, len("{")), - tok(n.Rbrack, len("}"))) - - case *ast.InterfaceType: - children = append(children, - tok(n.Interface, len("interface"))) - - case *ast.KeyValueExpr: - children = append(children, - tok(n.Colon, len(":"))) - - case *ast.LabeledStmt: - children = append(children, - tok(n.Colon, len(":"))) - - case *ast.MapType: - children = append(children, - tok(n.Map, len("map"))) - - case *ast.ParenExpr: - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - - case *ast.RangeStmt: - children = append(children, - tok(n.For, len("for")), - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.ReturnStmt: - children = append(children, - tok(n.Return, len("return"))) - - case *ast.SelectStmt: - children = append(children, - tok(n.Select, len("select"))) - - case *ast.SelectorExpr: - // nop - - case *ast.SendStmt: - children = append(children, - tok(n.Arrow, len("<-"))) - - case *ast.SliceExpr: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Rbrack, len("]"))) - - case *ast.StarExpr: - children = append(children, tok(n.Star, len("*"))) - - case *ast.StructType: - children = append(children, tok(n.Struct, len("struct"))) - - case *ast.SwitchStmt: - children = append(children, tok(n.Switch, len("switch"))) - - case *ast.TypeAssertExpr: - children = append(children, - tok(n.Lparen-1, len(".")), - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - - case *ast.TypeSpec: - // TODO(adonovan): TypeSpec.{Doc,Comment}? - - case *ast.TypeSwitchStmt: - children = append(children, tok(n.Switch, len("switch"))) - - case *ast.UnaryExpr: - children = append(children, tok(n.OpPos, len(n.Op.String()))) - - case *ast.ValueSpec: - // TODO(adonovan): ValueSpec.{Doc,Comment}? - - case *ast.BadDecl, *ast.BadExpr, *ast.BadStmt: - // nop - } - - // TODO(adonovan): opt: merge the logic of ast.Inspect() into - // the switch above so we can make interleaved callbacks for - // both Nodes and Tokens in the right order and avoid the need - // to sort. - sort.Sort(byPos(children)) - - return children -} - -type byPos []ast.Node - -func (sl byPos) Len() int { - return len(sl) -} -func (sl byPos) Less(i, j int) bool { - return sl[i].Pos() < sl[j].Pos() -} -func (sl byPos) Swap(i, j int) { - sl[i], sl[j] = sl[j], sl[i] -} - -// NodeDescription returns a description of the concrete type of n suitable -// for a user interface. -// -// TODO(adonovan): in some cases (e.g. Field, FieldList, Ident, -// StarExpr) we could be much more specific given the path to the AST -// root. Perhaps we should do that. -// -func NodeDescription(n ast.Node) string { - switch n := n.(type) { - case *ast.ArrayType: - return "array type" - case *ast.AssignStmt: - return "assignment" - case *ast.BadDecl: - return "bad declaration" - case *ast.BadExpr: - return "bad expression" - case *ast.BadStmt: - return "bad statement" - case *ast.BasicLit: - return "basic literal" - case *ast.BinaryExpr: - return fmt.Sprintf("binary %s operation", n.Op) - case *ast.BlockStmt: - return "block" - case *ast.BranchStmt: - switch n.Tok { - case token.BREAK: - return "break statement" - case token.CONTINUE: - return "continue statement" - case token.GOTO: - return "goto statement" - case token.FALLTHROUGH: - return "fall-through statement" - } - case *ast.CallExpr: - if len(n.Args) == 1 && !n.Ellipsis.IsValid() { - return "function call (or conversion)" - } - return "function call" - case *ast.CaseClause: - return "case clause" - case *ast.ChanType: - return "channel type" - case *ast.CommClause: - return "communication clause" - case *ast.Comment: - return "comment" - case *ast.CommentGroup: - return "comment group" - case *ast.CompositeLit: - return "composite literal" - case *ast.DeclStmt: - return NodeDescription(n.Decl) + " statement" - case *ast.DeferStmt: - return "defer statement" - case *ast.Ellipsis: - return "ellipsis" - case *ast.EmptyStmt: - return "empty statement" - case *ast.ExprStmt: - return "expression statement" - case *ast.Field: - // Can be any of these: - // struct {x, y int} -- struct field(s) - // struct {T} -- anon struct field - // interface {I} -- interface embedding - // interface {f()} -- interface method - // func (A) func(B) C -- receiver, param(s), result(s) - return "field/method/parameter" - case *ast.FieldList: - return "field/method/parameter list" - case *ast.File: - return "source file" - case *ast.ForStmt: - return "for loop" - case *ast.FuncDecl: - return "function declaration" - case *ast.FuncLit: - return "function literal" - case *ast.FuncType: - return "function type" - case *ast.GenDecl: - switch n.Tok { - case token.IMPORT: - return "import declaration" - case token.CONST: - return "constant declaration" - case token.TYPE: - return "type declaration" - case token.VAR: - return "variable declaration" - } - case *ast.GoStmt: - return "go statement" - case *ast.Ident: - return "identifier" - case *ast.IfStmt: - return "if statement" - case *ast.ImportSpec: - return "import specification" - case *ast.IncDecStmt: - if n.Tok == token.INC { - return "increment statement" - } - return "decrement statement" - case *ast.IndexExpr: - return "index expression" - case *ast.InterfaceType: - return "interface type" - case *ast.KeyValueExpr: - return "key/value association" - case *ast.LabeledStmt: - return "statement label" - case *ast.MapType: - return "map type" - case *ast.Package: - return "package" - case *ast.ParenExpr: - return "parenthesized " + NodeDescription(n.X) - case *ast.RangeStmt: - return "range loop" - case *ast.ReturnStmt: - return "return statement" - case *ast.SelectStmt: - return "select statement" - case *ast.SelectorExpr: - return "selector" - case *ast.SendStmt: - return "channel send" - case *ast.SliceExpr: - return "slice expression" - case *ast.StarExpr: - return "*-operation" // load/store expr or pointer type - case *ast.StructType: - return "struct type" - case *ast.SwitchStmt: - return "switch statement" - case *ast.TypeAssertExpr: - return "type assertion" - case *ast.TypeSpec: - return "type specification" - case *ast.TypeSwitchStmt: - return "type switch" - case *ast.UnaryExpr: - return fmt.Sprintf("unary %s operation", n.Op) - case *ast.ValueSpec: - return "value specification" - - } - panic(fmt.Sprintf("unexpected node type: %T", n)) -} diff --git a/ibm/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/ibm/vendor/golang.org/x/tools/go/ast/astutil/imports.go deleted file mode 100644 index 2087ceec9c..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/ast/astutil/imports.go +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package astutil contains common utilities for working with the Go AST. -package astutil // import "golang.org/x/tools/go/ast/astutil" - -import ( - "fmt" - "go/ast" - "go/token" - "strconv" - "strings" -) - -// AddImport adds the import path to the file f, if absent. -func AddImport(fset *token.FileSet, f *ast.File, path string) (added bool) { - return AddNamedImport(fset, f, "", path) -} - -// AddNamedImport adds the import with the given name and path to the file f, if absent. -// If name is not empty, it is used to rename the import. -// -// For example, calling -// AddNamedImport(fset, f, "pathpkg", "path") -// adds -// import pathpkg "path" -func AddNamedImport(fset *token.FileSet, f *ast.File, name, path string) (added bool) { - if imports(f, name, path) { - return false - } - - newImport := &ast.ImportSpec{ - Path: &ast.BasicLit{ - Kind: token.STRING, - Value: strconv.Quote(path), - }, - } - if name != "" { - newImport.Name = &ast.Ident{Name: name} - } - - // Find an import decl to add to. - // The goal is to find an existing import - // whose import path has the longest shared - // prefix with path. - var ( - bestMatch = -1 // length of longest shared prefix - lastImport = -1 // index in f.Decls of the file's final import decl - impDecl *ast.GenDecl // import decl containing the best match - impIndex = -1 // spec index in impDecl containing the best match - - isThirdPartyPath = isThirdParty(path) - ) - for i, decl := range f.Decls { - gen, ok := decl.(*ast.GenDecl) - if ok && gen.Tok == token.IMPORT { - lastImport = i - // Do not add to import "C", to avoid disrupting the - // association with its doc comment, breaking cgo. - if declImports(gen, "C") { - continue - } - - // Match an empty import decl if that's all that is available. - if len(gen.Specs) == 0 && bestMatch == -1 { - impDecl = gen - } - - // Compute longest shared prefix with imports in this group and find best - // matched import spec. - // 1. Always prefer import spec with longest shared prefix. - // 2. While match length is 0, - // - for stdlib package: prefer first import spec. - // - for third party package: prefer first third party import spec. - // We cannot use last import spec as best match for third party package - // because grouped imports are usually placed last by goimports -local - // flag. - // See issue #19190. - seenAnyThirdParty := false - for j, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - p := importPath(impspec) - n := matchLen(p, path) - if n > bestMatch || (bestMatch == 0 && !seenAnyThirdParty && isThirdPartyPath) { - bestMatch = n - impDecl = gen - impIndex = j - } - seenAnyThirdParty = seenAnyThirdParty || isThirdParty(p) - } - } - } - - // If no import decl found, add one after the last import. - if impDecl == nil { - impDecl = &ast.GenDecl{ - Tok: token.IMPORT, - } - if lastImport >= 0 { - impDecl.TokPos = f.Decls[lastImport].End() - } else { - // There are no existing imports. - // Our new import, preceded by a blank line, goes after the package declaration - // and after the comment, if any, that starts on the same line as the - // package declaration. - impDecl.TokPos = f.Package - - file := fset.File(f.Package) - pkgLine := file.Line(f.Package) - for _, c := range f.Comments { - if file.Line(c.Pos()) > pkgLine { - break - } - // +2 for a blank line - impDecl.TokPos = c.End() + 2 - } - } - f.Decls = append(f.Decls, nil) - copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:]) - f.Decls[lastImport+1] = impDecl - } - - // Insert new import at insertAt. - insertAt := 0 - if impIndex >= 0 { - // insert after the found import - insertAt = impIndex + 1 - } - impDecl.Specs = append(impDecl.Specs, nil) - copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:]) - impDecl.Specs[insertAt] = newImport - pos := impDecl.Pos() - if insertAt > 0 { - // If there is a comment after an existing import, preserve the comment - // position by adding the new import after the comment. - if spec, ok := impDecl.Specs[insertAt-1].(*ast.ImportSpec); ok && spec.Comment != nil { - pos = spec.Comment.End() - } else { - // Assign same position as the previous import, - // so that the sorter sees it as being in the same block. - pos = impDecl.Specs[insertAt-1].Pos() - } - } - if newImport.Name != nil { - newImport.Name.NamePos = pos - } - newImport.Path.ValuePos = pos - newImport.EndPos = pos - - // Clean up parens. impDecl contains at least one spec. - if len(impDecl.Specs) == 1 { - // Remove unneeded parens. - impDecl.Lparen = token.NoPos - } else if !impDecl.Lparen.IsValid() { - // impDecl needs parens added. - impDecl.Lparen = impDecl.Specs[0].Pos() - } - - f.Imports = append(f.Imports, newImport) - - if len(f.Decls) <= 1 { - return true - } - - // Merge all the import declarations into the first one. - var first *ast.GenDecl - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { - continue - } - if first == nil { - first = gen - continue // Don't touch the first one. - } - // We now know there is more than one package in this import - // declaration. Ensure that it ends up parenthesized. - first.Lparen = first.Pos() - // Move the imports of the other import declaration to the first one. - for _, spec := range gen.Specs { - spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() - first.Specs = append(first.Specs, spec) - } - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - i-- - } - - return true -} - -func isThirdParty(importPath string) bool { - // Third party package import path usually contains "." (".com", ".org", ...) - // This logic is taken from golang.org/x/tools/imports package. - return strings.Contains(importPath, ".") -} - -// DeleteImport deletes the import path from the file f, if present. -// If there are duplicate import declarations, all matching ones are deleted. -func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) { - return DeleteNamedImport(fset, f, "", path) -} - -// DeleteNamedImport deletes the import with the given name and path from the file f, if present. -// If there are duplicate import declarations, all matching ones are deleted. -func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (deleted bool) { - var delspecs []*ast.ImportSpec - var delcomments []*ast.CommentGroup - - // Find the import nodes that import path, if any. - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT { - continue - } - for j := 0; j < len(gen.Specs); j++ { - spec := gen.Specs[j] - impspec := spec.(*ast.ImportSpec) - if importName(impspec) != name || importPath(impspec) != path { - continue - } - - // We found an import spec that imports path. - // Delete it. - delspecs = append(delspecs, impspec) - deleted = true - copy(gen.Specs[j:], gen.Specs[j+1:]) - gen.Specs = gen.Specs[:len(gen.Specs)-1] - - // If this was the last import spec in this decl, - // delete the decl, too. - if len(gen.Specs) == 0 { - copy(f.Decls[i:], f.Decls[i+1:]) - f.Decls = f.Decls[:len(f.Decls)-1] - i-- - break - } else if len(gen.Specs) == 1 { - if impspec.Doc != nil { - delcomments = append(delcomments, impspec.Doc) - } - if impspec.Comment != nil { - delcomments = append(delcomments, impspec.Comment) - } - for _, cg := range f.Comments { - // Found comment on the same line as the import spec. - if cg.End() < impspec.Pos() && fset.Position(cg.End()).Line == fset.Position(impspec.Pos()).Line { - delcomments = append(delcomments, cg) - break - } - } - - spec := gen.Specs[0].(*ast.ImportSpec) - - // Move the documentation right after the import decl. - if spec.Doc != nil { - for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Doc.Pos()).Line { - fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) - } - } - for _, cg := range f.Comments { - if cg.End() < spec.Pos() && fset.Position(cg.End()).Line == fset.Position(spec.Pos()).Line { - for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Pos()).Line { - fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) - } - break - } - } - } - if j > 0 { - lastImpspec := gen.Specs[j-1].(*ast.ImportSpec) - lastLine := fset.Position(lastImpspec.Path.ValuePos).Line - line := fset.Position(impspec.Path.ValuePos).Line - - // We deleted an entry but now there may be - // a blank line-sized hole where the import was. - if line-lastLine > 1 || !gen.Rparen.IsValid() { - // There was a blank line immediately preceding the deleted import, - // so there's no need to close the hole. The right parenthesis is - // invalid after AddImport to an import statement without parenthesis. - // Do nothing. - } else if line != fset.File(gen.Rparen).LineCount() { - // There was no blank line. Close the hole. - fset.File(gen.Rparen).MergeLine(line) - } - } - j-- - } - } - - // Delete imports from f.Imports. - for i := 0; i < len(f.Imports); i++ { - imp := f.Imports[i] - for j, del := range delspecs { - if imp == del { - copy(f.Imports[i:], f.Imports[i+1:]) - f.Imports = f.Imports[:len(f.Imports)-1] - copy(delspecs[j:], delspecs[j+1:]) - delspecs = delspecs[:len(delspecs)-1] - i-- - break - } - } - } - - // Delete comments from f.Comments. - for i := 0; i < len(f.Comments); i++ { - cg := f.Comments[i] - for j, del := range delcomments { - if cg == del { - copy(f.Comments[i:], f.Comments[i+1:]) - f.Comments = f.Comments[:len(f.Comments)-1] - copy(delcomments[j:], delcomments[j+1:]) - delcomments = delcomments[:len(delcomments)-1] - i-- - break - } - } - } - - if len(delspecs) > 0 { - panic(fmt.Sprintf("deleted specs from Decls but not Imports: %v", delspecs)) - } - - return -} - -// RewriteImport rewrites any import of path oldPath to path newPath. -func RewriteImport(fset *token.FileSet, f *ast.File, oldPath, newPath string) (rewrote bool) { - for _, imp := range f.Imports { - if importPath(imp) == oldPath { - rewrote = true - // record old End, because the default is to compute - // it using the length of imp.Path.Value. - imp.EndPos = imp.End() - imp.Path.Value = strconv.Quote(newPath) - } - } - return -} - -// UsesImport reports whether a given import is used. -func UsesImport(f *ast.File, path string) (used bool) { - spec := importSpec(f, path) - if spec == nil { - return - } - - name := spec.Name.String() - switch name { - case "": - // If the package name is not explicitly specified, - // make an educated guess. This is not guaranteed to be correct. - lastSlash := strings.LastIndex(path, "/") - if lastSlash == -1 { - name = path - } else { - name = path[lastSlash+1:] - } - case "_", ".": - // Not sure if this import is used - err on the side of caution. - return true - } - - ast.Walk(visitFn(func(n ast.Node) { - sel, ok := n.(*ast.SelectorExpr) - if ok && isTopName(sel.X, name) { - used = true - } - }), f) - - return -} - -type visitFn func(node ast.Node) - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - fn(node) - return fn -} - -// imports reports whether f has an import with the specified name and path. -func imports(f *ast.File, name, path string) bool { - for _, s := range f.Imports { - if importName(s) == name && importPath(s) == path { - return true - } - } - return false -} - -// importSpec returns the import spec if f imports path, -// or nil otherwise. -func importSpec(f *ast.File, path string) *ast.ImportSpec { - for _, s := range f.Imports { - if importPath(s) == path { - return s - } - } - return nil -} - -// importName returns the name of s, -// or "" if the import is not named. -func importName(s *ast.ImportSpec) string { - if s.Name == nil { - return "" - } - return s.Name.Name -} - -// importPath returns the unquoted import path of s, -// or "" if the path is not properly quoted. -func importPath(s *ast.ImportSpec) string { - t, err := strconv.Unquote(s.Path.Value) - if err != nil { - return "" - } - return t -} - -// declImports reports whether gen contains an import of path. -func declImports(gen *ast.GenDecl, path string) bool { - if gen.Tok != token.IMPORT { - return false - } - for _, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - if importPath(impspec) == path { - return true - } - } - return false -} - -// matchLen returns the length of the longest path segment prefix shared by x and y. -func matchLen(x, y string) int { - n := 0 - for i := 0; i < len(x) && i < len(y) && x[i] == y[i]; i++ { - if x[i] == '/' { - n++ - } - } - return n -} - -// isTopName returns true if n is a top-level unresolved identifier with the given name. -func isTopName(n ast.Expr, name string) bool { - id, ok := n.(*ast.Ident) - return ok && id.Name == name && id.Obj == nil -} - -// Imports returns the file imports grouped by paragraph. -func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec { - var groups [][]*ast.ImportSpec - - for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok || genDecl.Tok != token.IMPORT { - break - } - - group := []*ast.ImportSpec{} - - var lastLine int - for _, spec := range genDecl.Specs { - importSpec := spec.(*ast.ImportSpec) - pos := importSpec.Path.ValuePos - line := fset.Position(pos).Line - if lastLine > 0 && pos > 0 && line-lastLine > 1 { - groups = append(groups, group) - group = []*ast.ImportSpec{} - } - group = append(group, importSpec) - lastLine = line - } - groups = append(groups, group) - } - - return groups -} diff --git a/ibm/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/ibm/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go deleted file mode 100644 index 5fe75b14c7..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -import ( - "fmt" - "go/ast" - "reflect" - "sort" - - "golang.org/x/tools/internal/typeparams" -) - -// An ApplyFunc is invoked by Apply for each node n, even if n is nil, -// before and/or after the node's children, using a Cursor describing -// the current node and providing operations on it. -// -// The return value of ApplyFunc controls the syntax tree traversal. -// See Apply for details. -type ApplyFunc func(*Cursor) bool - -// Apply traverses a syntax tree recursively, starting with root, -// and calling pre and post for each node as described below. -// Apply returns the syntax tree, possibly modified. -// -// If pre is not nil, it is called for each node before the node's -// children are traversed (pre-order). If pre returns false, no -// children are traversed, and post is not called for that node. -// -// If post is not nil, and a prior call of pre didn't return false, -// post is called for each node after its children are traversed -// (post-order). If post returns false, traversal is terminated and -// Apply returns immediately. -// -// Only fields that refer to AST nodes are considered children; -// i.e., token.Pos, Scopes, Objects, and fields of basic types -// (strings, etc.) are ignored. -// -// Children are traversed in the order in which they appear in the -// respective node's struct definition. A package's files are -// traversed in the filenames' alphabetical order. -// -func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node) { - parent := &struct{ ast.Node }{root} - defer func() { - if r := recover(); r != nil && r != abort { - panic(r) - } - result = parent.Node - }() - a := &application{pre: pre, post: post} - a.apply(parent, "Node", nil, root) - return -} - -var abort = new(int) // singleton, to signal termination of Apply - -// A Cursor describes a node encountered during Apply. -// Information about the node and its parent is available -// from the Node, Parent, Name, and Index methods. -// -// If p is a variable of type and value of the current parent node -// c.Parent(), and f is the field identifier with name c.Name(), -// the following invariants hold: -// -// p.f == c.Node() if c.Index() < 0 -// p.f[c.Index()] == c.Node() if c.Index() >= 0 -// -// The methods Replace, Delete, InsertBefore, and InsertAfter -// can be used to change the AST without disrupting Apply. -type Cursor struct { - parent ast.Node - name string - iter *iterator // valid if non-nil - node ast.Node -} - -// Node returns the current Node. -func (c *Cursor) Node() ast.Node { return c.node } - -// Parent returns the parent of the current Node. -func (c *Cursor) Parent() ast.Node { return c.parent } - -// Name returns the name of the parent Node field that contains the current Node. -// If the parent is a *ast.Package and the current Node is a *ast.File, Name returns -// the filename for the current Node. -func (c *Cursor) Name() string { return c.name } - -// Index reports the index >= 0 of the current Node in the slice of Nodes that -// contains it, or a value < 0 if the current Node is not part of a slice. -// The index of the current node changes if InsertBefore is called while -// processing the current node. -func (c *Cursor) Index() int { - if c.iter != nil { - return c.iter.index - } - return -1 -} - -// field returns the current node's parent field value. -func (c *Cursor) field() reflect.Value { - return reflect.Indirect(reflect.ValueOf(c.parent)).FieldByName(c.name) -} - -// Replace replaces the current Node with n. -// The replacement node is not walked by Apply. -func (c *Cursor) Replace(n ast.Node) { - if _, ok := c.node.(*ast.File); ok { - file, ok := n.(*ast.File) - if !ok { - panic("attempt to replace *ast.File with non-*ast.File") - } - c.parent.(*ast.Package).Files[c.name] = file - return - } - - v := c.field() - if i := c.Index(); i >= 0 { - v = v.Index(i) - } - v.Set(reflect.ValueOf(n)) -} - -// Delete deletes the current Node from its containing slice. -// If the current Node is not part of a slice, Delete panics. -// As a special case, if the current node is a package file, -// Delete removes it from the package's Files map. -func (c *Cursor) Delete() { - if _, ok := c.node.(*ast.File); ok { - delete(c.parent.(*ast.Package).Files, c.name) - return - } - - i := c.Index() - if i < 0 { - panic("Delete node not contained in slice") - } - v := c.field() - l := v.Len() - reflect.Copy(v.Slice(i, l), v.Slice(i+1, l)) - v.Index(l - 1).Set(reflect.Zero(v.Type().Elem())) - v.SetLen(l - 1) - c.iter.step-- -} - -// InsertAfter inserts n after the current Node in its containing slice. -// If the current Node is not part of a slice, InsertAfter panics. -// Apply does not walk n. -func (c *Cursor) InsertAfter(n ast.Node) { - i := c.Index() - if i < 0 { - panic("InsertAfter node not contained in slice") - } - v := c.field() - v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) - l := v.Len() - reflect.Copy(v.Slice(i+2, l), v.Slice(i+1, l)) - v.Index(i + 1).Set(reflect.ValueOf(n)) - c.iter.step++ -} - -// InsertBefore inserts n before the current Node in its containing slice. -// If the current Node is not part of a slice, InsertBefore panics. -// Apply will not walk n. -func (c *Cursor) InsertBefore(n ast.Node) { - i := c.Index() - if i < 0 { - panic("InsertBefore node not contained in slice") - } - v := c.field() - v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) - l := v.Len() - reflect.Copy(v.Slice(i+1, l), v.Slice(i, l)) - v.Index(i).Set(reflect.ValueOf(n)) - c.iter.index++ -} - -// application carries all the shared data so we can pass it around cheaply. -type application struct { - pre, post ApplyFunc - cursor Cursor - iter iterator -} - -func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast.Node) { - // convert typed nil into untyped nil - if v := reflect.ValueOf(n); v.Kind() == reflect.Ptr && v.IsNil() { - n = nil - } - - // avoid heap-allocating a new cursor for each apply call; reuse a.cursor instead - saved := a.cursor - a.cursor.parent = parent - a.cursor.name = name - a.cursor.iter = iter - a.cursor.node = n - - if a.pre != nil && !a.pre(&a.cursor) { - a.cursor = saved - return - } - - // walk children - // (the order of the cases matches the order of the corresponding node types in go/ast) - switch n := n.(type) { - case nil: - // nothing to do - - // Comments and fields - case *ast.Comment: - // nothing to do - - case *ast.CommentGroup: - if n != nil { - a.applyList(n, "List") - } - - case *ast.Field: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Names") - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Tag", nil, n.Tag) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.FieldList: - a.applyList(n, "List") - - // Expressions - case *ast.BadExpr, *ast.Ident, *ast.BasicLit: - // nothing to do - - case *ast.Ellipsis: - a.apply(n, "Elt", nil, n.Elt) - - case *ast.FuncLit: - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Body", nil, n.Body) - - case *ast.CompositeLit: - a.apply(n, "Type", nil, n.Type) - a.applyList(n, "Elts") - - case *ast.ParenExpr: - a.apply(n, "X", nil, n.X) - - case *ast.SelectorExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Sel", nil, n.Sel) - - case *ast.IndexExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Index", nil, n.Index) - - case *ast.SliceExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Low", nil, n.Low) - a.apply(n, "High", nil, n.High) - a.apply(n, "Max", nil, n.Max) - - case *ast.TypeAssertExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Type", nil, n.Type) - - case *ast.CallExpr: - a.apply(n, "Fun", nil, n.Fun) - a.applyList(n, "Args") - - case *ast.StarExpr: - a.apply(n, "X", nil, n.X) - - case *ast.UnaryExpr: - a.apply(n, "X", nil, n.X) - - case *ast.BinaryExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Y", nil, n.Y) - - case *ast.KeyValueExpr: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - - // Types - case *ast.ArrayType: - a.apply(n, "Len", nil, n.Len) - a.apply(n, "Elt", nil, n.Elt) - - case *ast.StructType: - a.apply(n, "Fields", nil, n.Fields) - - case *ast.FuncType: - a.apply(n, "Params", nil, n.Params) - a.apply(n, "Results", nil, n.Results) - - case *ast.InterfaceType: - a.apply(n, "Methods", nil, n.Methods) - - case *ast.MapType: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - - case *ast.ChanType: - a.apply(n, "Value", nil, n.Value) - - // Statements - case *ast.BadStmt: - // nothing to do - - case *ast.DeclStmt: - a.apply(n, "Decl", nil, n.Decl) - - case *ast.EmptyStmt: - // nothing to do - - case *ast.LabeledStmt: - a.apply(n, "Label", nil, n.Label) - a.apply(n, "Stmt", nil, n.Stmt) - - case *ast.ExprStmt: - a.apply(n, "X", nil, n.X) - - case *ast.SendStmt: - a.apply(n, "Chan", nil, n.Chan) - a.apply(n, "Value", nil, n.Value) - - case *ast.IncDecStmt: - a.apply(n, "X", nil, n.X) - - case *ast.AssignStmt: - a.applyList(n, "Lhs") - a.applyList(n, "Rhs") - - case *ast.GoStmt: - a.apply(n, "Call", nil, n.Call) - - case *ast.DeferStmt: - a.apply(n, "Call", nil, n.Call) - - case *ast.ReturnStmt: - a.applyList(n, "Results") - - case *ast.BranchStmt: - a.apply(n, "Label", nil, n.Label) - - case *ast.BlockStmt: - a.applyList(n, "List") - - case *ast.IfStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Cond", nil, n.Cond) - a.apply(n, "Body", nil, n.Body) - a.apply(n, "Else", nil, n.Else) - - case *ast.CaseClause: - a.applyList(n, "List") - a.applyList(n, "Body") - - case *ast.SwitchStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Tag", nil, n.Tag) - a.apply(n, "Body", nil, n.Body) - - case *ast.TypeSwitchStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Assign", nil, n.Assign) - a.apply(n, "Body", nil, n.Body) - - case *ast.CommClause: - a.apply(n, "Comm", nil, n.Comm) - a.applyList(n, "Body") - - case *ast.SelectStmt: - a.apply(n, "Body", nil, n.Body) - - case *ast.ForStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Cond", nil, n.Cond) - a.apply(n, "Post", nil, n.Post) - a.apply(n, "Body", nil, n.Body) - - case *ast.RangeStmt: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - a.apply(n, "X", nil, n.X) - a.apply(n, "Body", nil, n.Body) - - // Declarations - case *ast.ImportSpec: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Path", nil, n.Path) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.ValueSpec: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Names") - a.apply(n, "Type", nil, n.Type) - a.applyList(n, "Values") - a.apply(n, "Comment", nil, n.Comment) - - case *ast.TypeSpec: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.BadDecl: - // nothing to do - - case *ast.GenDecl: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Specs") - - case *ast.FuncDecl: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Recv", nil, n.Recv) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Body", nil, n.Body) - - // Files and packages - case *ast.File: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.applyList(n, "Decls") - // Don't walk n.Comments; they have either been walked already if - // they are Doc comments, or they can be easily walked explicitly. - - case *ast.Package: - // collect and sort names for reproducible behavior - var names []string - for name := range n.Files { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - a.apply(n, name, nil, n.Files[name]) - } - - default: - if ix := typeparams.GetIndexExprData(n); ix != nil { - a.apply(n, "X", nil, ix.X) - // *ast.IndexExpr was handled above, so n must be an *ast.MultiIndexExpr. - a.applyList(n, "Indices") - } else { - panic(fmt.Sprintf("Apply: unexpected node type %T", n)) - } - } - - if a.post != nil && !a.post(&a.cursor) { - panic(abort) - } - - a.cursor = saved -} - -// An iterator controls iteration over a slice of nodes. -type iterator struct { - index, step int -} - -func (a *application) applyList(parent ast.Node, name string) { - // avoid heap-allocating a new iterator for each applyList call; reuse a.iter instead - saved := a.iter - a.iter.index = 0 - for { - // must reload parent.name each time, since cursor modifications might change it - v := reflect.Indirect(reflect.ValueOf(parent)).FieldByName(name) - if a.iter.index >= v.Len() { - break - } - - // element x may be nil in a bad AST - be cautious - var x ast.Node - if e := v.Index(a.iter.index); e.IsValid() { - x = e.Interface().(ast.Node) - } - - a.iter.step = 1 - a.apply(parent, name, &a.iter, x) - a.iter.index += a.iter.step - } - a.iter = saved -} diff --git a/ibm/vendor/golang.org/x/tools/go/ast/astutil/util.go b/ibm/vendor/golang.org/x/tools/go/ast/astutil/util.go deleted file mode 100644 index 919d5305ab..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/ast/astutil/util.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -import "go/ast" - -// Unparen returns e with any enclosing parentheses stripped. -func Unparen(e ast.Expr) ast.Expr { - for { - p, ok := e.(*ast.ParenExpr) - if !ok { - return e - } - e = p.X - } -} diff --git a/ibm/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/ibm/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go deleted file mode 100644 index fc8beea5d8..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gcexportdata provides functions for locating, reading, and -// writing export data files containing type information produced by the -// gc compiler. This package supports go1.7 export data format and all -// later versions. -// -// Although it might seem convenient for this package to live alongside -// go/types in the standard library, this would cause version skew -// problems for developer tools that use it, since they must be able to -// consume the outputs of the gc compiler both before and after a Go -// update such as from Go 1.7 to Go 1.8. Because this package lives in -// golang.org/x/tools, sites can update their version of this repo some -// time before the Go 1.8 release and rebuild and redeploy their -// developer tools, which will then be able to consume both Go 1.7 and -// Go 1.8 export data files, so they will work before and after the -// Go update. (See discussion at https://golang.org/issue/15651.) -// -package gcexportdata // import "golang.org/x/tools/go/gcexportdata" - -import ( - "bufio" - "bytes" - "fmt" - "go/token" - "go/types" - "io" - "io/ioutil" - - "golang.org/x/tools/go/internal/gcimporter" -) - -// Find returns the name of an object (.o) or archive (.a) file -// containing type information for the specified import path, -// using the workspace layout conventions of go/build. -// If no file was found, an empty filename is returned. -// -// A relative srcDir is interpreted relative to the current working directory. -// -// Find also returns the package's resolved (canonical) import path, -// reflecting the effects of srcDir and vendoring on importPath. -func Find(importPath, srcDir string) (filename, path string) { - return gcimporter.FindPkg(importPath, srcDir) -} - -// NewReader returns a reader for the export data section of an object -// (.o) or archive (.a) file read from r. The new reader may provide -// additional trailing data beyond the end of the export data. -func NewReader(r io.Reader) (io.Reader, error) { - buf := bufio.NewReader(r) - _, err := gcimporter.FindExportData(buf) - // If we ever switch to a zip-like archive format with the ToC - // at the end, we can return the correct portion of export data, - // but for now we must return the entire rest of the file. - return buf, err -} - -// Read reads export data from in, decodes it, and returns type -// information for the package. -// The package name is specified by path. -// File position information is added to fset. -// -// Read may inspect and add to the imports map to ensure that references -// within the export data to other packages are consistent. The caller -// must ensure that imports[path] does not exist, or exists but is -// incomplete (see types.Package.Complete), and Read inserts the -// resulting package into this map entry. -// -// On return, the state of the reader is undefined. -func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { - data, err := ioutil.ReadAll(in) - if err != nil { - return nil, fmt.Errorf("reading export data for %q: %v", path, err) - } - - if bytes.HasPrefix(data, []byte("!")) { - return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) - } - - // The App Engine Go runtime v1.6 uses the old export data format. - // TODO(adonovan): delete once v1.7 has been around for a while. - if bytes.HasPrefix(data, []byte("package ")) { - return gcimporter.ImportData(imports, path, path, bytes.NewReader(data)) - } - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 && data[0] == 'i' { - _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) - return pkg, err - } - - _, pkg, err := gcimporter.BImportData(fset, imports, data, path) - return pkg, err -} - -// Write writes encoded type information for the specified package to out. -// The FileSet provides file position information for named objects. -func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - if _, err := io.WriteString(out, "i"); err != nil { - return err - } - return gcimporter.IExportData(out, fset, pkg) -} - -// ReadBundle reads an export bundle from in, decodes it, and returns type -// information for the packages. -// File position information is added to fset. -// -// ReadBundle may inspect and add to the imports map to ensure that references -// within the export bundle to other packages are consistent. -// -// On return, the state of the reader is undefined. -// -// Experimental: This API is experimental and may change in the future. -func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) { - data, err := ioutil.ReadAll(in) - if err != nil { - return nil, fmt.Errorf("reading export bundle: %v", err) - } - return gcimporter.IImportBundle(fset, imports, data) -} - -// WriteBundle writes encoded type information for the specified packages to out. -// The FileSet provides file position information for named objects. -// -// Experimental: This API is experimental and may change in the future. -func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - return gcimporter.IExportBundle(out, fset, pkgs) -} diff --git a/ibm/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/ibm/vendor/golang.org/x/tools/go/gcexportdata/importer.go deleted file mode 100644 index efe221e7e1..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/gcexportdata/importer.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcexportdata - -import ( - "fmt" - "go/token" - "go/types" - "os" -) - -// NewImporter returns a new instance of the types.Importer interface -// that reads type information from export data files written by gc. -// The Importer also satisfies types.ImporterFrom. -// -// Export data files are located using "go build" workspace conventions -// and the build.Default context. -// -// Use this importer instead of go/importer.For("gc", ...) to avoid the -// version-skew problems described in the documentation of this package, -// or to control the FileSet or access the imports map populated during -// package loading. -// -func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { - return importer{fset, imports} -} - -type importer struct { - fset *token.FileSet - imports map[string]*types.Package -} - -func (imp importer) Import(importPath string) (*types.Package, error) { - return imp.ImportFrom(importPath, "", 0) -} - -func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { - filename, path := Find(importPath, srcDir) - if filename == "" { - if importPath == "unsafe" { - // Even for unsafe, call Find first in case - // the package was vendored. - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %s", importPath) - } - - if pkg, ok := imp.imports[path]; ok && pkg.Complete() { - return pkg, nil // cache hit - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - f.Close() - if err != nil { - // add file name to error - err = fmt.Errorf("reading export data: %s: %v", filename, err) - } - }() - - r, err := NewReader(f) - if err != nil { - return nil, err - } - - return Read(r, imp.fset, imp.imports, path) -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go deleted file mode 100644 index 072005af89..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go +++ /dev/null @@ -1,854 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Binary package export. -// This file was derived from $GOROOT/src/cmd/compile/internal/gc/bexport.go; -// see that file for specification of the format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "math" - "math/big" - "sort" - "strings" -) - -// If debugFormat is set, each integer and string value is preceded by a marker -// and position information in the encoding. This mechanism permits an importer -// to recognize immediately when it is out of sync. The importer recognizes this -// mode automatically (i.e., it can import export data produced with debugging -// support even if debugFormat is not set at the time of import). This mode will -// lead to massively larger export data (by a factor of 2 to 3) and should only -// be enabled during development and debugging. -// -// NOTE: This flag is the first flag to enable if importing dies because of -// (suspected) format errors, and whenever a change is made to the format. -const debugFormat = false // default: false - -// If trace is set, debugging output is printed to std out. -const trace = false // default: false - -// Current export format version. Increase with each format change. -// Note: The latest binary (non-indexed) export format is at version 6. -// This exporter is still at level 4, but it doesn't matter since -// the binary importer can handle older versions just fine. -// 6: package height (CL 105038) -- NOT IMPLEMENTED HERE -// 5: improved position encoding efficiency (issue 20080, CL 41619) -- NOT IMPLEMEMTED HERE -// 4: type name objects support type aliases, uses aliasTag -// 3: Go1.8 encoding (same as version 2, aliasTag defined but never used) -// 2: removed unused bool in ODCL export (compiler only) -// 1: header format change (more regular), export package for _ struct fields -// 0: Go1.7 encoding -const exportVersion = 4 - -// trackAllTypes enables cycle tracking for all types, not just named -// types. The existing compiler invariants assume that unnamed types -// that are not completely set up are not used, or else there are spurious -// errors. -// If disabled, only named types are tracked, possibly leading to slightly -// less efficient encoding in rare cases. It also prevents the export of -// some corner-case type declarations (but those are not handled correctly -// with with the textual export format either). -// TODO(gri) enable and remove once issues caused by it are fixed -const trackAllTypes = false - -type exporter struct { - fset *token.FileSet - out bytes.Buffer - - // object -> index maps, indexed in order of serialization - strIndex map[string]int - pkgIndex map[*types.Package]int - typIndex map[types.Type]int - - // position encoding - posInfoFormat bool - prevFile string - prevLine int - - // debugging support - written int // bytes written - indent int // for trace -} - -// internalError represents an error generated inside this package. -type internalError string - -func (e internalError) Error() string { return "gcimporter: " + string(e) } - -func internalErrorf(format string, args ...interface{}) error { - return internalError(fmt.Sprintf(format, args...)) -} - -// BExportData returns binary export data for pkg. -// If no file set is provided, position info will be missing. -func BExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { - if !debug { - defer func() { - if e := recover(); e != nil { - if ierr, ok := e.(internalError); ok { - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - } - - p := exporter{ - fset: fset, - strIndex: map[string]int{"": 0}, // empty string is mapped to 0 - pkgIndex: make(map[*types.Package]int), - typIndex: make(map[types.Type]int), - posInfoFormat: true, // TODO(gri) might become a flag, eventually - } - - // write version info - // The version string must start with "version %d" where %d is the version - // number. Additional debugging information may follow after a blank; that - // text is ignored by the importer. - p.rawStringln(fmt.Sprintf("version %d", exportVersion)) - var debug string - if debugFormat { - debug = "debug" - } - p.rawStringln(debug) // cannot use p.bool since it's affected by debugFormat; also want to see this clearly - p.bool(trackAllTypes) - p.bool(p.posInfoFormat) - - // --- generic export data --- - - // populate type map with predeclared "known" types - for index, typ := range predeclared() { - p.typIndex[typ] = index - } - if len(p.typIndex) != len(predeclared()) { - return nil, internalError("duplicate entries in type map?") - } - - // write package data - p.pkg(pkg, true) - if trace { - p.tracef("\n") - } - - // write objects - objcount := 0 - scope := pkg.Scope() - for _, name := range scope.Names() { - if !ast.IsExported(name) { - continue - } - if trace { - p.tracef("\n") - } - p.obj(scope.Lookup(name)) - objcount++ - } - - // indicate end of list - if trace { - p.tracef("\n") - } - p.tag(endTag) - - // for self-verification only (redundant) - p.int(objcount) - - if trace { - p.tracef("\n") - } - - // --- end of export data --- - - return p.out.Bytes(), nil -} - -func (p *exporter) pkg(pkg *types.Package, emptypath bool) { - if pkg == nil { - panic(internalError("unexpected nil pkg")) - } - - // if we saw the package before, write its index (>= 0) - if i, ok := p.pkgIndex[pkg]; ok { - p.index('P', i) - return - } - - // otherwise, remember the package, write the package tag (< 0) and package data - if trace { - p.tracef("P%d = { ", len(p.pkgIndex)) - defer p.tracef("} ") - } - p.pkgIndex[pkg] = len(p.pkgIndex) - - p.tag(packageTag) - p.string(pkg.Name()) - if emptypath { - p.string("") - } else { - p.string(pkg.Path()) - } -} - -func (p *exporter) obj(obj types.Object) { - switch obj := obj.(type) { - case *types.Const: - p.tag(constTag) - p.pos(obj) - p.qualifiedName(obj) - p.typ(obj.Type()) - p.value(obj.Val()) - - case *types.TypeName: - if obj.IsAlias() { - p.tag(aliasTag) - p.pos(obj) - p.qualifiedName(obj) - } else { - p.tag(typeTag) - } - p.typ(obj.Type()) - - case *types.Var: - p.tag(varTag) - p.pos(obj) - p.qualifiedName(obj) - p.typ(obj.Type()) - - case *types.Func: - p.tag(funcTag) - p.pos(obj) - p.qualifiedName(obj) - sig := obj.Type().(*types.Signature) - p.paramList(sig.Params(), sig.Variadic()) - p.paramList(sig.Results(), false) - - default: - panic(internalErrorf("unexpected object %v (%T)", obj, obj)) - } -} - -func (p *exporter) pos(obj types.Object) { - if !p.posInfoFormat { - return - } - - file, line := p.fileLine(obj) - if file == p.prevFile { - // common case: write line delta - // delta == 0 means different file or no line change - delta := line - p.prevLine - p.int(delta) - if delta == 0 { - p.int(-1) // -1 means no file change - } - } else { - // different file - p.int(0) - // Encode filename as length of common prefix with previous - // filename, followed by (possibly empty) suffix. Filenames - // frequently share path prefixes, so this can save a lot - // of space and make export data size less dependent on file - // path length. The suffix is unlikely to be empty because - // file names tend to end in ".go". - n := commonPrefixLen(p.prevFile, file) - p.int(n) // n >= 0 - p.string(file[n:]) // write suffix only - p.prevFile = file - p.int(line) - } - p.prevLine = line -} - -func (p *exporter) fileLine(obj types.Object) (file string, line int) { - if p.fset != nil { - pos := p.fset.Position(obj.Pos()) - file = pos.Filename - line = pos.Line - } - return -} - -func commonPrefixLen(a, b string) int { - if len(a) > len(b) { - a, b = b, a - } - // len(a) <= len(b) - i := 0 - for i < len(a) && a[i] == b[i] { - i++ - } - return i -} - -func (p *exporter) qualifiedName(obj types.Object) { - p.string(obj.Name()) - p.pkg(obj.Pkg(), false) -} - -func (p *exporter) typ(t types.Type) { - if t == nil { - panic(internalError("nil type")) - } - - // Possible optimization: Anonymous pointer types *T where - // T is a named type are common. We could canonicalize all - // such types *T to a single type PT = *T. This would lead - // to at most one *T entry in typIndex, and all future *T's - // would be encoded as the respective index directly. Would - // save 1 byte (pointerTag) per *T and reduce the typIndex - // size (at the cost of a canonicalization map). We can do - // this later, without encoding format change. - - // if we saw the type before, write its index (>= 0) - if i, ok := p.typIndex[t]; ok { - p.index('T', i) - return - } - - // otherwise, remember the type, write the type tag (< 0) and type data - if trackAllTypes { - if trace { - p.tracef("T%d = {>\n", len(p.typIndex)) - defer p.tracef("<\n} ") - } - p.typIndex[t] = len(p.typIndex) - } - - switch t := t.(type) { - case *types.Named: - if !trackAllTypes { - // if we don't track all types, track named types now - p.typIndex[t] = len(p.typIndex) - } - - p.tag(namedTag) - p.pos(t.Obj()) - p.qualifiedName(t.Obj()) - p.typ(t.Underlying()) - if !types.IsInterface(t) { - p.assocMethods(t) - } - - case *types.Array: - p.tag(arrayTag) - p.int64(t.Len()) - p.typ(t.Elem()) - - case *types.Slice: - p.tag(sliceTag) - p.typ(t.Elem()) - - case *dddSlice: - p.tag(dddTag) - p.typ(t.elem) - - case *types.Struct: - p.tag(structTag) - p.fieldList(t) - - case *types.Pointer: - p.tag(pointerTag) - p.typ(t.Elem()) - - case *types.Signature: - p.tag(signatureTag) - p.paramList(t.Params(), t.Variadic()) - p.paramList(t.Results(), false) - - case *types.Interface: - p.tag(interfaceTag) - p.iface(t) - - case *types.Map: - p.tag(mapTag) - p.typ(t.Key()) - p.typ(t.Elem()) - - case *types.Chan: - p.tag(chanTag) - p.int(int(3 - t.Dir())) // hack - p.typ(t.Elem()) - - default: - panic(internalErrorf("unexpected type %T: %s", t, t)) - } -} - -func (p *exporter) assocMethods(named *types.Named) { - // Sort methods (for determinism). - var methods []*types.Func - for i := 0; i < named.NumMethods(); i++ { - methods = append(methods, named.Method(i)) - } - sort.Sort(methodsByName(methods)) - - p.int(len(methods)) - - if trace && methods != nil { - p.tracef("associated methods {>\n") - } - - for i, m := range methods { - if trace && i > 0 { - p.tracef("\n") - } - - p.pos(m) - name := m.Name() - p.string(name) - if !exported(name) { - p.pkg(m.Pkg(), false) - } - - sig := m.Type().(*types.Signature) - p.paramList(types.NewTuple(sig.Recv()), false) - p.paramList(sig.Params(), sig.Variadic()) - p.paramList(sig.Results(), false) - p.int(0) // dummy value for go:nointerface pragma - ignored by importer - } - - if trace && methods != nil { - p.tracef("<\n} ") - } -} - -type methodsByName []*types.Func - -func (x methodsByName) Len() int { return len(x) } -func (x methodsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x methodsByName) Less(i, j int) bool { return x[i].Name() < x[j].Name() } - -func (p *exporter) fieldList(t *types.Struct) { - if trace && t.NumFields() > 0 { - p.tracef("fields {>\n") - defer p.tracef("<\n} ") - } - - p.int(t.NumFields()) - for i := 0; i < t.NumFields(); i++ { - if trace && i > 0 { - p.tracef("\n") - } - p.field(t.Field(i)) - p.string(t.Tag(i)) - } -} - -func (p *exporter) field(f *types.Var) { - if !f.IsField() { - panic(internalError("field expected")) - } - - p.pos(f) - p.fieldName(f) - p.typ(f.Type()) -} - -func (p *exporter) iface(t *types.Interface) { - // TODO(gri): enable importer to load embedded interfaces, - // then emit Embeddeds and ExplicitMethods separately here. - p.int(0) - - n := t.NumMethods() - if trace && n > 0 { - p.tracef("methods {>\n") - defer p.tracef("<\n} ") - } - p.int(n) - for i := 0; i < n; i++ { - if trace && i > 0 { - p.tracef("\n") - } - p.method(t.Method(i)) - } -} - -func (p *exporter) method(m *types.Func) { - sig := m.Type().(*types.Signature) - if sig.Recv() == nil { - panic(internalError("method expected")) - } - - p.pos(m) - p.string(m.Name()) - if m.Name() != "_" && !ast.IsExported(m.Name()) { - p.pkg(m.Pkg(), false) - } - - // interface method; no need to encode receiver. - p.paramList(sig.Params(), sig.Variadic()) - p.paramList(sig.Results(), false) -} - -func (p *exporter) fieldName(f *types.Var) { - name := f.Name() - - if f.Anonymous() { - // anonymous field - we distinguish between 3 cases: - // 1) field name matches base type name and is exported - // 2) field name matches base type name and is not exported - // 3) field name doesn't match base type name (alias name) - bname := basetypeName(f.Type()) - if name == bname { - if ast.IsExported(name) { - name = "" // 1) we don't need to know the field name or package - } else { - name = "?" // 2) use unexported name "?" to force package export - } - } else { - // 3) indicate alias and export name as is - // (this requires an extra "@" but this is a rare case) - p.string("@") - } - } - - p.string(name) - if name != "" && !ast.IsExported(name) { - p.pkg(f.Pkg(), false) - } -} - -func basetypeName(typ types.Type) string { - switch typ := deref(typ).(type) { - case *types.Basic: - return typ.Name() - case *types.Named: - return typ.Obj().Name() - default: - return "" // unnamed type - } -} - -func (p *exporter) paramList(params *types.Tuple, variadic bool) { - // use negative length to indicate unnamed parameters - // (look at the first parameter only since either all - // names are present or all are absent) - n := params.Len() - if n > 0 && params.At(0).Name() == "" { - n = -n - } - p.int(n) - for i := 0; i < params.Len(); i++ { - q := params.At(i) - t := q.Type() - if variadic && i == params.Len()-1 { - t = &dddSlice{t.(*types.Slice).Elem()} - } - p.typ(t) - if n > 0 { - name := q.Name() - p.string(name) - if name != "_" { - p.pkg(q.Pkg(), false) - } - } - p.string("") // no compiler-specific info - } -} - -func (p *exporter) value(x constant.Value) { - if trace { - p.tracef("= ") - } - - switch x.Kind() { - case constant.Bool: - tag := falseTag - if constant.BoolVal(x) { - tag = trueTag - } - p.tag(tag) - - case constant.Int: - if v, exact := constant.Int64Val(x); exact { - // common case: x fits into an int64 - use compact encoding - p.tag(int64Tag) - p.int64(v) - return - } - // uncommon case: large x - use float encoding - // (powers of 2 will be encoded efficiently with exponent) - p.tag(floatTag) - p.float(constant.ToFloat(x)) - - case constant.Float: - p.tag(floatTag) - p.float(x) - - case constant.Complex: - p.tag(complexTag) - p.float(constant.Real(x)) - p.float(constant.Imag(x)) - - case constant.String: - p.tag(stringTag) - p.string(constant.StringVal(x)) - - case constant.Unknown: - // package contains type errors - p.tag(unknownTag) - - default: - panic(internalErrorf("unexpected value %v (%T)", x, x)) - } -} - -func (p *exporter) float(x constant.Value) { - if x.Kind() != constant.Float { - panic(internalErrorf("unexpected constant %v, want float", x)) - } - // extract sign (there is no -0) - sign := constant.Sign(x) - if sign == 0 { - // x == 0 - p.int(0) - return - } - // x != 0 - - var f big.Float - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - r := valueToRat(num) - f.SetRat(r.Quo(r, valueToRat(denom))) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - f.SetFloat64(math.MaxFloat64) // FIXME - } - - // extract exponent such that 0.5 <= m < 1.0 - var m big.Float - exp := f.MantExp(&m) - - // extract mantissa as *big.Int - // - set exponent large enough so mant satisfies mant.IsInt() - // - get *big.Int from mant - m.SetMantExp(&m, int(m.MinPrec())) - mant, acc := m.Int(nil) - if acc != big.Exact { - panic(internalError("internal error")) - } - - p.int(sign) - p.int(exp) - p.string(string(mant.Bytes())) -} - -func valueToRat(x constant.Value) *big.Rat { - // Convert little-endian to big-endian. - // I can't believe this is necessary. - bytes := constant.Bytes(x) - for i := 0; i < len(bytes)/2; i++ { - bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] - } - return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) -} - -func (p *exporter) bool(b bool) bool { - if trace { - p.tracef("[") - defer p.tracef("= %v] ", b) - } - - x := 0 - if b { - x = 1 - } - p.int(x) - return b -} - -// ---------------------------------------------------------------------------- -// Low-level encoders - -func (p *exporter) index(marker byte, index int) { - if index < 0 { - panic(internalError("invalid index < 0")) - } - if debugFormat { - p.marker('t') - } - if trace { - p.tracef("%c%d ", marker, index) - } - p.rawInt64(int64(index)) -} - -func (p *exporter) tag(tag int) { - if tag >= 0 { - panic(internalError("invalid tag >= 0")) - } - if debugFormat { - p.marker('t') - } - if trace { - p.tracef("%s ", tagString[-tag]) - } - p.rawInt64(int64(tag)) -} - -func (p *exporter) int(x int) { - p.int64(int64(x)) -} - -func (p *exporter) int64(x int64) { - if debugFormat { - p.marker('i') - } - if trace { - p.tracef("%d ", x) - } - p.rawInt64(x) -} - -func (p *exporter) string(s string) { - if debugFormat { - p.marker('s') - } - if trace { - p.tracef("%q ", s) - } - // if we saw the string before, write its index (>= 0) - // (the empty string is mapped to 0) - if i, ok := p.strIndex[s]; ok { - p.rawInt64(int64(i)) - return - } - // otherwise, remember string and write its negative length and bytes - p.strIndex[s] = len(p.strIndex) - p.rawInt64(-int64(len(s))) - for i := 0; i < len(s); i++ { - p.rawByte(s[i]) - } -} - -// marker emits a marker byte and position information which makes -// it easy for a reader to detect if it is "out of sync". Used for -// debugFormat format only. -func (p *exporter) marker(m byte) { - p.rawByte(m) - // Enable this for help tracking down the location - // of an incorrect marker when running in debugFormat. - if false && trace { - p.tracef("#%d ", p.written) - } - p.rawInt64(int64(p.written)) -} - -// rawInt64 should only be used by low-level encoders. -func (p *exporter) rawInt64(x int64) { - var tmp [binary.MaxVarintLen64]byte - n := binary.PutVarint(tmp[:], x) - for i := 0; i < n; i++ { - p.rawByte(tmp[i]) - } -} - -// rawStringln should only be used to emit the initial version string. -func (p *exporter) rawStringln(s string) { - for i := 0; i < len(s); i++ { - p.rawByte(s[i]) - } - p.rawByte('\n') -} - -// rawByte is the bottleneck interface to write to p.out. -// rawByte escapes b as follows (any encoding does that -// hides '$'): -// -// '$' => '|' 'S' -// '|' => '|' '|' -// -// Necessary so other tools can find the end of the -// export data by searching for "$$". -// rawByte should only be used by low-level encoders. -func (p *exporter) rawByte(b byte) { - switch b { - case '$': - // write '$' as '|' 'S' - b = 'S' - fallthrough - case '|': - // write '|' as '|' '|' - p.out.WriteByte('|') - p.written++ - } - p.out.WriteByte(b) - p.written++ -} - -// tracef is like fmt.Printf but it rewrites the format string -// to take care of indentation. -func (p *exporter) tracef(format string, args ...interface{}) { - if strings.ContainsAny(format, "<>\n") { - var buf bytes.Buffer - for i := 0; i < len(format); i++ { - // no need to deal with runes - ch := format[i] - switch ch { - case '>': - p.indent++ - continue - case '<': - p.indent-- - continue - } - buf.WriteByte(ch) - if ch == '\n' { - for j := p.indent; j > 0; j-- { - buf.WriteString(". ") - } - } - } - format = buf.String() - } - fmt.Printf(format, args...) -} - -// Debugging support. -// (tagString is only used when tracing is enabled) -var tagString = [...]string{ - // Packages - -packageTag: "package", - - // Types - -namedTag: "named type", - -arrayTag: "array", - -sliceTag: "slice", - -dddTag: "ddd", - -structTag: "struct", - -pointerTag: "pointer", - -signatureTag: "signature", - -interfaceTag: "interface", - -mapTag: "map", - -chanTag: "chan", - - // Values - -falseTag: "false", - -trueTag: "true", - -int64Tag: "int64", - -floatTag: "float", - -fractionTag: "fraction", - -complexTag: "complex", - -stringTag: "string", - -unknownTag: "unknown", - - // Type aliases - -aliasTag: "alias", -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go deleted file mode 100644 index b023120001..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go +++ /dev/null @@ -1,1040 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/bimport.go. - -package gcimporter - -import ( - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "sort" - "strconv" - "strings" - "sync" - "unicode" - "unicode/utf8" -) - -type importer struct { - imports map[string]*types.Package - data []byte - importpath string - buf []byte // for reading strings - version int // export format version - - // object lists - strList []string // in order of appearance - pathList []string // in order of appearance - pkgList []*types.Package // in order of appearance - typList []types.Type // in order of appearance - interfaceList []*types.Interface // for delayed completion only - trackAllTypes bool - - // position encoding - posInfoFormat bool - prevFile string - prevLine int - fake fakeFileSet - - // debugging support - debugFormat bool - read int // bytes read -} - -// BImportData imports a package from the serialized package data -// and returns the number of bytes consumed and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func BImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - // catch panics and return them as errors - const currentVersion = 6 - version := -1 // unknown version - defer func() { - if e := recover(); e != nil { - // Return a (possibly nil or incomplete) package unchanged (see #16088). - if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) - } - } - }() - - p := importer{ - imports: imports, - data: data, - importpath: path, - version: version, - strList: []string{""}, // empty string is mapped to 0 - pathList: []string{""}, // empty string is mapped to 0 - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*token.File), - }, - } - - // read version info - var versionstr string - if b := p.rawByte(); b == 'c' || b == 'd' { - // Go1.7 encoding; first byte encodes low-level - // encoding format (compact vs debug). - // For backward-compatibility only (avoid problems with - // old installed packages). Newly compiled packages use - // the extensible format string. - // TODO(gri) Remove this support eventually; after Go1.8. - if b == 'd' { - p.debugFormat = true - } - p.trackAllTypes = p.rawByte() == 'a' - p.posInfoFormat = p.int() != 0 - versionstr = p.string() - if versionstr == "v1" { - version = 0 - } - } else { - // Go1.8 extensible encoding - // read version string and extract version number (ignore anything after the version number) - versionstr = p.rawStringln(b) - if s := strings.SplitN(versionstr, " ", 3); len(s) >= 2 && s[0] == "version" { - if v, err := strconv.Atoi(s[1]); err == nil && v > 0 { - version = v - } - } - } - p.version = version - - // read version specific flags - extend as necessary - switch p.version { - // case currentVersion: - // ... - // fallthrough - case currentVersion, 5, 4, 3, 2, 1: - p.debugFormat = p.rawStringln(p.rawByte()) == "debug" - p.trackAllTypes = p.int() != 0 - p.posInfoFormat = p.int() != 0 - case 0: - // Go1.7 encoding format - nothing to do here - default: - errorf("unknown bexport format version %d (%q)", p.version, versionstr) - } - - // --- generic export data --- - - // populate typList with predeclared "known" types - p.typList = append(p.typList, predeclared()...) - - // read package data - pkg = p.pkg() - - // read objects of phase 1 only (see cmd/compile/internal/gc/bexport.go) - objcount := 0 - for { - tag := p.tagOrIndex() - if tag == endTag { - break - } - p.obj(tag) - objcount++ - } - - // self-verification - if count := p.int(); count != objcount { - errorf("got %d objects; want %d", objcount, count) - } - - // ignore compiler-specific import data - - // complete interfaces - // TODO(gri) re-investigate if we still need to do this in a delayed fashion - for _, typ := range p.interfaceList { - typ.Complete() - } - - // record all referenced packages as imports - list := append(([]*types.Package)(nil), p.pkgList[1:]...) - sort.Sort(byPath(list)) - pkg.SetImports(list) - - // package was imported completely and without errors - pkg.MarkComplete() - - return p.read, pkg, nil -} - -func errorf(format string, args ...interface{}) { - panic(fmt.Sprintf(format, args...)) -} - -func (p *importer) pkg() *types.Package { - // if the package was seen before, i is its index (>= 0) - i := p.tagOrIndex() - if i >= 0 { - return p.pkgList[i] - } - - // otherwise, i is the package tag (< 0) - if i != packageTag { - errorf("unexpected package tag %d version %d", i, p.version) - } - - // read package data - name := p.string() - var path string - if p.version >= 5 { - path = p.path() - } else { - path = p.string() - } - if p.version >= 6 { - p.int() // package height; unused by go/types - } - - // we should never see an empty package name - if name == "" { - errorf("empty package name in import") - } - - // an empty path denotes the package we are currently importing; - // it must be the first package we see - if (path == "") != (len(p.pkgList) == 0) { - errorf("package path %q for pkg index %d", path, len(p.pkgList)) - } - - // if the package was imported before, use that one; otherwise create a new one - if path == "" { - path = p.importpath - } - pkg := p.imports[path] - if pkg == nil { - pkg = types.NewPackage(path, name) - p.imports[path] = pkg - } else if pkg.Name() != name { - errorf("conflicting names %s and %s for package %q", pkg.Name(), name, path) - } - p.pkgList = append(p.pkgList, pkg) - - return pkg -} - -// objTag returns the tag value for each object kind. -func objTag(obj types.Object) int { - switch obj.(type) { - case *types.Const: - return constTag - case *types.TypeName: - return typeTag - case *types.Var: - return varTag - case *types.Func: - return funcTag - default: - errorf("unexpected object: %v (%T)", obj, obj) // panics - panic("unreachable") - } -} - -func sameObj(a, b types.Object) bool { - // Because unnamed types are not canonicalized, we cannot simply compare types for - // (pointer) identity. - // Ideally we'd check equality of constant values as well, but this is good enough. - return objTag(a) == objTag(b) && types.Identical(a.Type(), b.Type()) -} - -func (p *importer) declare(obj types.Object) { - pkg := obj.Pkg() - if alt := pkg.Scope().Insert(obj); alt != nil { - // This can only trigger if we import a (non-type) object a second time. - // Excluding type aliases, this cannot happen because 1) we only import a package - // once; and b) we ignore compiler-specific export data which may contain - // functions whose inlined function bodies refer to other functions that - // were already imported. - // However, type aliases require reexporting the original type, so we need - // to allow it (see also the comment in cmd/compile/internal/gc/bimport.go, - // method importer.obj, switch case importing functions). - // TODO(gri) review/update this comment once the gc compiler handles type aliases. - if !sameObj(obj, alt) { - errorf("inconsistent import:\n\t%v\npreviously imported as:\n\t%v\n", obj, alt) - } - } -} - -func (p *importer) obj(tag int) { - switch tag { - case constTag: - pos := p.pos() - pkg, name := p.qualifiedName() - typ := p.typ(nil, nil) - val := p.value() - p.declare(types.NewConst(pos, pkg, name, typ, val)) - - case aliasTag: - // TODO(gri) verify type alias hookup is correct - pos := p.pos() - pkg, name := p.qualifiedName() - typ := p.typ(nil, nil) - p.declare(types.NewTypeName(pos, pkg, name, typ)) - - case typeTag: - p.typ(nil, nil) - - case varTag: - pos := p.pos() - pkg, name := p.qualifiedName() - typ := p.typ(nil, nil) - p.declare(types.NewVar(pos, pkg, name, typ)) - - case funcTag: - pos := p.pos() - pkg, name := p.qualifiedName() - params, isddd := p.paramList() - result, _ := p.paramList() - sig := types.NewSignature(nil, params, result, isddd) - p.declare(types.NewFunc(pos, pkg, name, sig)) - - default: - errorf("unexpected object tag %d", tag) - } -} - -const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go - -func (p *importer) pos() token.Pos { - if !p.posInfoFormat { - return token.NoPos - } - - file := p.prevFile - line := p.prevLine - delta := p.int() - line += delta - if p.version >= 5 { - if delta == deltaNewFile { - if n := p.int(); n >= 0 { - // file changed - file = p.path() - line = n - } - } - } else { - if delta == 0 { - if n := p.int(); n >= 0 { - // file changed - file = p.prevFile[:n] + p.string() - line = p.int() - } - } - } - p.prevFile = file - p.prevLine = line - - return p.fake.pos(file, line, 0) -} - -// Synthesize a token.Pos -type fakeFileSet struct { - fset *token.FileSet - files map[string]*token.File -} - -func (s *fakeFileSet) pos(file string, line, column int) token.Pos { - // TODO(mdempsky): Make use of column. - - // Since we don't know the set of needed file positions, we - // reserve maxlines positions per file. - const maxlines = 64 * 1024 - f := s.files[file] - if f == nil { - f = s.fset.AddFile(file, -1, maxlines) - s.files[file] = f - // Allocate the fake linebreak indices on first use. - // TODO(adonovan): opt: save ~512KB using a more complex scheme? - fakeLinesOnce.Do(func() { - fakeLines = make([]int, maxlines) - for i := range fakeLines { - fakeLines[i] = i - } - }) - f.SetLines(fakeLines) - } - - if line > maxlines { - line = 1 - } - - // Treat the file as if it contained only newlines - // and column=1: use the line number as the offset. - return f.Pos(line - 1) -} - -var ( - fakeLines []int - fakeLinesOnce sync.Once -) - -func (p *importer) qualifiedName() (pkg *types.Package, name string) { - name = p.string() - pkg = p.pkg() - return -} - -func (p *importer) record(t types.Type) { - p.typList = append(p.typList, t) -} - -// A dddSlice is a types.Type representing ...T parameters. -// It only appears for parameter types and does not escape -// the importer. -type dddSlice struct { - elem types.Type -} - -func (t *dddSlice) Underlying() types.Type { return t } -func (t *dddSlice) String() string { return "..." + t.elem.String() } - -// parent is the package which declared the type; parent == nil means -// the package currently imported. The parent package is needed for -// exported struct fields and interface methods which don't contain -// explicit package information in the export data. -// -// A non-nil tname is used as the "owner" of the result type; i.e., -// the result type is the underlying type of tname. tname is used -// to give interface methods a named receiver type where possible. -func (p *importer) typ(parent *types.Package, tname *types.Named) types.Type { - // if the type was seen before, i is its index (>= 0) - i := p.tagOrIndex() - if i >= 0 { - return p.typList[i] - } - - // otherwise, i is the type tag (< 0) - switch i { - case namedTag: - // read type object - pos := p.pos() - parent, name := p.qualifiedName() - scope := parent.Scope() - obj := scope.Lookup(name) - - // if the object doesn't exist yet, create and insert it - if obj == nil { - obj = types.NewTypeName(pos, parent, name, nil) - scope.Insert(obj) - } - - if _, ok := obj.(*types.TypeName); !ok { - errorf("pkg = %s, name = %s => %s", parent, name, obj) - } - - // associate new named type with obj if it doesn't exist yet - t0 := types.NewNamed(obj.(*types.TypeName), nil, nil) - - // but record the existing type, if any - tname := obj.Type().(*types.Named) // tname is either t0 or the existing type - p.record(tname) - - // read underlying type - t0.SetUnderlying(p.typ(parent, t0)) - - // interfaces don't have associated methods - if types.IsInterface(t0) { - return tname - } - - // read associated methods - for i := p.int(); i > 0; i-- { - // TODO(gri) replace this with something closer to fieldName - pos := p.pos() - name := p.string() - if !exported(name) { - p.pkg() - } - - recv, _ := p.paramList() // TODO(gri) do we need a full param list for the receiver? - params, isddd := p.paramList() - result, _ := p.paramList() - p.int() // go:nointerface pragma - discarded - - sig := types.NewSignature(recv.At(0), params, result, isddd) - t0.AddMethod(types.NewFunc(pos, parent, name, sig)) - } - - return tname - - case arrayTag: - t := new(types.Array) - if p.trackAllTypes { - p.record(t) - } - - n := p.int64() - *t = *types.NewArray(p.typ(parent, nil), n) - return t - - case sliceTag: - t := new(types.Slice) - if p.trackAllTypes { - p.record(t) - } - - *t = *types.NewSlice(p.typ(parent, nil)) - return t - - case dddTag: - t := new(dddSlice) - if p.trackAllTypes { - p.record(t) - } - - t.elem = p.typ(parent, nil) - return t - - case structTag: - t := new(types.Struct) - if p.trackAllTypes { - p.record(t) - } - - *t = *types.NewStruct(p.fieldList(parent)) - return t - - case pointerTag: - t := new(types.Pointer) - if p.trackAllTypes { - p.record(t) - } - - *t = *types.NewPointer(p.typ(parent, nil)) - return t - - case signatureTag: - t := new(types.Signature) - if p.trackAllTypes { - p.record(t) - } - - params, isddd := p.paramList() - result, _ := p.paramList() - *t = *types.NewSignature(nil, params, result, isddd) - return t - - case interfaceTag: - // Create a dummy entry in the type list. This is safe because we - // cannot expect the interface type to appear in a cycle, as any - // such cycle must contain a named type which would have been - // first defined earlier. - // TODO(gri) Is this still true now that we have type aliases? - // See issue #23225. - n := len(p.typList) - if p.trackAllTypes { - p.record(nil) - } - - var embeddeds []types.Type - for n := p.int(); n > 0; n-- { - p.pos() - embeddeds = append(embeddeds, p.typ(parent, nil)) - } - - t := newInterface(p.methodList(parent, tname), embeddeds) - p.interfaceList = append(p.interfaceList, t) - if p.trackAllTypes { - p.typList[n] = t - } - return t - - case mapTag: - t := new(types.Map) - if p.trackAllTypes { - p.record(t) - } - - key := p.typ(parent, nil) - val := p.typ(parent, nil) - *t = *types.NewMap(key, val) - return t - - case chanTag: - t := new(types.Chan) - if p.trackAllTypes { - p.record(t) - } - - dir := chanDir(p.int()) - val := p.typ(parent, nil) - *t = *types.NewChan(dir, val) - return t - - default: - errorf("unexpected type tag %d", i) // panics - panic("unreachable") - } -} - -func chanDir(d int) types.ChanDir { - // tag values must match the constants in cmd/compile/internal/gc/go.go - switch d { - case 1 /* Crecv */ : - return types.RecvOnly - case 2 /* Csend */ : - return types.SendOnly - case 3 /* Cboth */ : - return types.SendRecv - default: - errorf("unexpected channel dir %d", d) - return 0 - } -} - -func (p *importer) fieldList(parent *types.Package) (fields []*types.Var, tags []string) { - if n := p.int(); n > 0 { - fields = make([]*types.Var, n) - tags = make([]string, n) - for i := range fields { - fields[i], tags[i] = p.field(parent) - } - } - return -} - -func (p *importer) field(parent *types.Package) (*types.Var, string) { - pos := p.pos() - pkg, name, alias := p.fieldName(parent) - typ := p.typ(parent, nil) - tag := p.string() - - anonymous := false - if name == "" { - // anonymous field - typ must be T or *T and T must be a type name - switch typ := deref(typ).(type) { - case *types.Basic: // basic types are named types - pkg = nil // // objects defined in Universe scope have no package - name = typ.Name() - case *types.Named: - name = typ.Obj().Name() - default: - errorf("named base type expected") - } - anonymous = true - } else if alias { - // anonymous field: we have an explicit name because it's an alias - anonymous = true - } - - return types.NewField(pos, pkg, name, typ, anonymous), tag -} - -func (p *importer) methodList(parent *types.Package, baseType *types.Named) (methods []*types.Func) { - if n := p.int(); n > 0 { - methods = make([]*types.Func, n) - for i := range methods { - methods[i] = p.method(parent, baseType) - } - } - return -} - -func (p *importer) method(parent *types.Package, baseType *types.Named) *types.Func { - pos := p.pos() - pkg, name, _ := p.fieldName(parent) - // If we don't have a baseType, use a nil receiver. - // A receiver using the actual interface type (which - // we don't know yet) will be filled in when we call - // types.Interface.Complete. - var recv *types.Var - if baseType != nil { - recv = types.NewVar(token.NoPos, parent, "", baseType) - } - params, isddd := p.paramList() - result, _ := p.paramList() - sig := types.NewSignature(recv, params, result, isddd) - return types.NewFunc(pos, pkg, name, sig) -} - -func (p *importer) fieldName(parent *types.Package) (pkg *types.Package, name string, alias bool) { - name = p.string() - pkg = parent - if pkg == nil { - // use the imported package instead - pkg = p.pkgList[0] - } - if p.version == 0 && name == "_" { - // version 0 didn't export a package for _ fields - return - } - switch name { - case "": - // 1) field name matches base type name and is exported: nothing to do - case "?": - // 2) field name matches base type name and is not exported: need package - name = "" - pkg = p.pkg() - case "@": - // 3) field name doesn't match type name (alias) - name = p.string() - alias = true - fallthrough - default: - if !exported(name) { - pkg = p.pkg() - } - } - return -} - -func (p *importer) paramList() (*types.Tuple, bool) { - n := p.int() - if n == 0 { - return nil, false - } - // negative length indicates unnamed parameters - named := true - if n < 0 { - n = -n - named = false - } - // n > 0 - params := make([]*types.Var, n) - isddd := false - for i := range params { - params[i], isddd = p.param(named) - } - return types.NewTuple(params...), isddd -} - -func (p *importer) param(named bool) (*types.Var, bool) { - t := p.typ(nil, nil) - td, isddd := t.(*dddSlice) - if isddd { - t = types.NewSlice(td.elem) - } - - var pkg *types.Package - var name string - if named { - name = p.string() - if name == "" { - errorf("expected named parameter") - } - if name != "_" { - pkg = p.pkg() - } - if i := strings.Index(name, "·"); i > 0 { - name = name[:i] // cut off gc-specific parameter numbering - } - } - - // read and discard compiler-specific info - p.string() - - return types.NewVar(token.NoPos, pkg, name, t), isddd -} - -func exported(name string) bool { - ch, _ := utf8.DecodeRuneInString(name) - return unicode.IsUpper(ch) -} - -func (p *importer) value() constant.Value { - switch tag := p.tagOrIndex(); tag { - case falseTag: - return constant.MakeBool(false) - case trueTag: - return constant.MakeBool(true) - case int64Tag: - return constant.MakeInt64(p.int64()) - case floatTag: - return p.float() - case complexTag: - re := p.float() - im := p.float() - return constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - case stringTag: - return constant.MakeString(p.string()) - case unknownTag: - return constant.MakeUnknown() - default: - errorf("unexpected value tag %d", tag) // panics - panic("unreachable") - } -} - -func (p *importer) float() constant.Value { - sign := p.int() - if sign == 0 { - return constant.MakeInt64(0) - } - - exp := p.int() - mant := []byte(p.string()) // big endian - - // remove leading 0's if any - for len(mant) > 0 && mant[0] == 0 { - mant = mant[1:] - } - - // convert to little endian - // TODO(gri) go/constant should have a more direct conversion function - // (e.g., once it supports a big.Float based implementation) - for i, j := 0, len(mant)-1; i < j; i, j = i+1, j-1 { - mant[i], mant[j] = mant[j], mant[i] - } - - // adjust exponent (constant.MakeFromBytes creates an integer value, - // but mant represents the mantissa bits such that 0.5 <= mant < 1.0) - exp -= len(mant) << 3 - if len(mant) > 0 { - for msd := mant[len(mant)-1]; msd&0x80 == 0; msd <<= 1 { - exp++ - } - } - - x := constant.MakeFromBytes(mant) - switch { - case exp < 0: - d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) - x = constant.BinaryOp(x, token.QUO, d) - case exp > 0: - x = constant.Shift(x, token.SHL, uint(exp)) - } - - if sign < 0 { - x = constant.UnaryOp(token.SUB, x, 0) - } - return x -} - -// ---------------------------------------------------------------------------- -// Low-level decoders - -func (p *importer) tagOrIndex() int { - if p.debugFormat { - p.marker('t') - } - - return int(p.rawInt64()) -} - -func (p *importer) int() int { - x := p.int64() - if int64(int(x)) != x { - errorf("exported integer too large") - } - return int(x) -} - -func (p *importer) int64() int64 { - if p.debugFormat { - p.marker('i') - } - - return p.rawInt64() -} - -func (p *importer) path() string { - if p.debugFormat { - p.marker('p') - } - // if the path was seen before, i is its index (>= 0) - // (the empty string is at index 0) - i := p.rawInt64() - if i >= 0 { - return p.pathList[i] - } - // otherwise, i is the negative path length (< 0) - a := make([]string, -i) - for n := range a { - a[n] = p.string() - } - s := strings.Join(a, "/") - p.pathList = append(p.pathList, s) - return s -} - -func (p *importer) string() string { - if p.debugFormat { - p.marker('s') - } - // if the string was seen before, i is its index (>= 0) - // (the empty string is at index 0) - i := p.rawInt64() - if i >= 0 { - return p.strList[i] - } - // otherwise, i is the negative string length (< 0) - if n := int(-i); n <= cap(p.buf) { - p.buf = p.buf[:n] - } else { - p.buf = make([]byte, n) - } - for i := range p.buf { - p.buf[i] = p.rawByte() - } - s := string(p.buf) - p.strList = append(p.strList, s) - return s -} - -func (p *importer) marker(want byte) { - if got := p.rawByte(); got != want { - errorf("incorrect marker: got %c; want %c (pos = %d)", got, want, p.read) - } - - pos := p.read - if n := int(p.rawInt64()); n != pos { - errorf("incorrect position: got %d; want %d", n, pos) - } -} - -// rawInt64 should only be used by low-level decoders. -func (p *importer) rawInt64() int64 { - i, err := binary.ReadVarint(p) - if err != nil { - errorf("read error: %v", err) - } - return i -} - -// rawStringln should only be used to read the initial version string. -func (p *importer) rawStringln(b byte) string { - p.buf = p.buf[:0] - for b != '\n' { - p.buf = append(p.buf, b) - b = p.rawByte() - } - return string(p.buf) -} - -// needed for binary.ReadVarint in rawInt64 -func (p *importer) ReadByte() (byte, error) { - return p.rawByte(), nil -} - -// byte is the bottleneck interface for reading p.data. -// It unescapes '|' 'S' to '$' and '|' '|' to '|'. -// rawByte should only be used by low-level decoders. -func (p *importer) rawByte() byte { - b := p.data[0] - r := 1 - if b == '|' { - b = p.data[1] - r = 2 - switch b { - case 'S': - b = '$' - case '|': - // nothing to do - default: - errorf("unexpected escape sequence in export data") - } - } - p.data = p.data[r:] - p.read += r - return b - -} - -// ---------------------------------------------------------------------------- -// Export format - -// Tags. Must be < 0. -const ( - // Objects - packageTag = -(iota + 1) - constTag - typeTag - varTag - funcTag - endTag - - // Types - namedTag - arrayTag - sliceTag - dddTag - structTag - pointerTag - signatureTag - interfaceTag - mapTag - chanTag - - // Values - falseTag - trueTag - int64Tag - floatTag - fractionTag // not used by gc - complexTag - stringTag - nilTag // only used by gc (appears in exported inlined function bodies) - unknownTag // not used by gc (only appears in packages with errors) - - // Type aliases - aliasTag -) - -var predeclOnce sync.Once -var predecl []types.Type // initialized lazily - -func predeclared() []types.Type { - predeclOnce.Do(func() { - // initialize lazily to be sure that all - // elements have been initialized before - predecl = []types.Type{ // basic types - types.Typ[types.Bool], - types.Typ[types.Int], - types.Typ[types.Int8], - types.Typ[types.Int16], - types.Typ[types.Int32], - types.Typ[types.Int64], - types.Typ[types.Uint], - types.Typ[types.Uint8], - types.Typ[types.Uint16], - types.Typ[types.Uint32], - types.Typ[types.Uint64], - types.Typ[types.Uintptr], - types.Typ[types.Float32], - types.Typ[types.Float64], - types.Typ[types.Complex64], - types.Typ[types.Complex128], - types.Typ[types.String], - - // basic type aliases - types.Universe.Lookup("byte").Type(), - types.Universe.Lookup("rune").Type(), - - // error - types.Universe.Lookup("error").Type(), - - // untyped types - types.Typ[types.UntypedBool], - types.Typ[types.UntypedInt], - types.Typ[types.UntypedRune], - types.Typ[types.UntypedFloat], - types.Typ[types.UntypedComplex], - types.Typ[types.UntypedString], - types.Typ[types.UntypedNil], - - // package unsafe - types.Typ[types.UnsafePointer], - - // invalid type - types.Typ[types.Invalid], // only appears in packages with errors - - // used internally by gc; never used by this package or in .a files - anyType{}, - } - predecl = append(predecl, additionalPredeclared()...) - }) - return predecl -} - -type anyType struct{} - -func (t anyType) Underlying() types.Type { return t } -func (t anyType) String() string { return "any" } diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go deleted file mode 100644 index f33dc5613e..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go. - -// This file implements FindExportData. - -package gcimporter - -import ( - "bufio" - "fmt" - "io" - "strconv" - "strings" -) - -func readGopackHeader(r *bufio.Reader) (name string, size int, err error) { - // See $GOROOT/include/ar.h. - hdr := make([]byte, 16+12+6+6+8+10+2) - _, err = io.ReadFull(r, hdr) - if err != nil { - return - } - // leave for debugging - if false { - fmt.Printf("header: %s", hdr) - } - s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) - size, err = strconv.Atoi(s) - if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' { - err = fmt.Errorf("invalid archive header") - return - } - name = strings.TrimSpace(string(hdr[:16])) - return -} - -// FindExportData positions the reader r at the beginning of the -// export data section of an underlying GC-created object/archive -// file by reading from it. The reader must be positioned at the -// start of the file before calling this function. The hdr result -// is the string before the export data, either "$$" or "$$B". -// -func FindExportData(r *bufio.Reader) (hdr string, err error) { - // Read first line to make sure this is an object file. - line, err := r.ReadSlice('\n') - if err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - - if string(line) == "!\n" { - // Archive file. Scan to __.PKGDEF. - var name string - if name, _, err = readGopackHeader(r); err != nil { - return - } - - // First entry should be __.PKGDEF. - if name != "__.PKGDEF" { - err = fmt.Errorf("go archive is missing __.PKGDEF") - return - } - - // Read first line of __.PKGDEF data, so that line - // is once again the first line of the input. - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - } - - // Now at __.PKGDEF in archive or still at beginning of file. - // Either way, line should begin with "go object ". - if !strings.HasPrefix(string(line), "go object ") { - err = fmt.Errorf("not a Go object file") - return - } - - // Skip over object header to export data. - // Begins after first line starting with $$. - for line[0] != '$' { - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - } - hdr = string(line) - - return -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go deleted file mode 100644 index e8cba6b237..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go +++ /dev/null @@ -1,1078 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a modified copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go, -// but it also contains the original source-based importer code for Go1.6. -// Once we stop supporting 1.6, we can remove that code. - -// Package gcimporter provides various functions for reading -// gc-generated object files that can be used to implement the -// Importer interface defined by the Go 1.5 standard library package. -package gcimporter // import "golang.org/x/tools/go/internal/gcimporter" - -import ( - "bufio" - "errors" - "fmt" - "go/build" - "go/constant" - "go/token" - "go/types" - "io" - "io/ioutil" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - "text/scanner" -) - -// debugging/development support -const debug = false - -var pkgExts = [...]string{".a", ".o"} - -// FindPkg returns the filename and unique package id for an import -// path based on package information provided by build.Import (using -// the build.Default build.Context). A relative srcDir is interpreted -// relative to the current working directory. -// If no file was found, an empty filename is returned. -// -func FindPkg(path, srcDir string) (filename, id string) { - if path == "" { - return - } - - var noext string - switch { - default: - // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" - // Don't require the source files to be present. - if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 - srcDir = abs - } - bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary) - if bp.PkgObj == "" { - id = path // make sure we have an id to print in error message - return - } - noext = strings.TrimSuffix(bp.PkgObj, ".a") - id = bp.ImportPath - - case build.IsLocalImport(path): - // "./x" -> "/this/directory/x.ext", "/this/directory/x" - noext = filepath.Join(srcDir, path) - id = noext - - case filepath.IsAbs(path): - // for completeness only - go/build.Import - // does not support absolute imports - // "/x" -> "/x.ext", "/x" - noext = path - id = path - } - - if false { // for debugging - if path != id { - fmt.Printf("%s -> %s\n", path, id) - } - } - - // try extensions - for _, ext := range pkgExts { - filename = noext + ext - if f, err := os.Stat(filename); err == nil && !f.IsDir() { - return - } - } - - filename = "" // not found - return -} - -// ImportData imports a package by reading the gc-generated export data, -// adds the corresponding package object to the packages map indexed by id, -// and returns the object. -// -// The packages map must contains all packages already imported. The data -// reader position must be the beginning of the export data section. The -// filename is only used in error messages. -// -// If packages[id] contains the completely imported package, that package -// can be used directly, and there is no need to call this function (but -// there is also no harm but for extra time used). -// -func ImportData(packages map[string]*types.Package, filename, id string, data io.Reader) (pkg *types.Package, err error) { - // support for parser error handling - defer func() { - switch r := recover().(type) { - case nil: - // nothing to do - case importError: - err = r - default: - panic(r) // internal error - } - }() - - var p parser - p.init(filename, id, data, packages) - pkg = p.parseExport() - - return -} - -// Import imports a gc-generated package given its import path and srcDir, adds -// the corresponding package object to the packages map, and returns the object. -// The packages map must contain all packages already imported. -// -func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { - var rc io.ReadCloser - var filename, id string - if lookup != nil { - // With custom lookup specified, assume that caller has - // converted path to a canonical import path for use in the map. - if path == "unsafe" { - return types.Unsafe, nil - } - id = path - - // No need to re-import if the package was imported completely before. - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - f, err := lookup(path) - if err != nil { - return nil, err - } - rc = f - } else { - filename, id = FindPkg(path, srcDir) - if filename == "" { - if path == "unsafe" { - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %q", id) - } - - // no need to re-import if the package was imported completely before - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - if err != nil { - // add file name to error - err = fmt.Errorf("%s: %v", filename, err) - } - }() - rc = f - } - defer rc.Close() - - var hdr string - buf := bufio.NewReader(rc) - if hdr, err = FindExportData(buf); err != nil { - return - } - - switch hdr { - case "$$\n": - // Work-around if we don't have a filename; happens only if lookup != nil. - // Either way, the filename is only needed for importer error messages, so - // this is fine. - if filename == "" { - filename = path - } - return ImportData(packages, filename, id, buf) - - case "$$B\n": - var data []byte - data, err = ioutil.ReadAll(buf) - if err != nil { - break - } - - // TODO(gri): allow clients of go/importer to provide a FileSet. - // Or, define a new standard go/types/gcexportdata package. - fset := token.NewFileSet() - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 && data[0] == 'i' { - _, pkg, err = IImportData(fset, packages, data[1:], id) - } else { - _, pkg, err = BImportData(fset, packages, data, id) - } - - default: - err = fmt.Errorf("unknown export data header: %q", hdr) - } - - return -} - -// ---------------------------------------------------------------------------- -// Parser - -// TODO(gri) Imported objects don't have position information. -// Ideally use the debug table line info; alternatively -// create some fake position (or the position of the -// import). That way error messages referring to imported -// objects can print meaningful information. - -// parser parses the exports inside a gc compiler-produced -// object/archive file and populates its scope with the results. -type parser struct { - scanner scanner.Scanner - tok rune // current token - lit string // literal string; only valid for Ident, Int, String tokens - id string // package id of imported package - sharedPkgs map[string]*types.Package // package id -> package object (across importer) - localPkgs map[string]*types.Package // package id -> package object (just this package) -} - -func (p *parser) init(filename, id string, src io.Reader, packages map[string]*types.Package) { - p.scanner.Init(src) - p.scanner.Error = func(_ *scanner.Scanner, msg string) { p.error(msg) } - p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanChars | scanner.ScanStrings | scanner.ScanComments | scanner.SkipComments - p.scanner.Whitespace = 1<<'\t' | 1<<' ' - p.scanner.Filename = filename // for good error messages - p.next() - p.id = id - p.sharedPkgs = packages - if debug { - // check consistency of packages map - for _, pkg := range packages { - if pkg.Name() == "" { - fmt.Printf("no package name for %s\n", pkg.Path()) - } - } - } -} - -func (p *parser) next() { - p.tok = p.scanner.Scan() - switch p.tok { - case scanner.Ident, scanner.Int, scanner.Char, scanner.String, '·': - p.lit = p.scanner.TokenText() - default: - p.lit = "" - } - if debug { - fmt.Printf("%s: %q -> %q\n", scanner.TokenString(p.tok), p.scanner.TokenText(), p.lit) - } -} - -func declTypeName(pkg *types.Package, name string) *types.TypeName { - scope := pkg.Scope() - if obj := scope.Lookup(name); obj != nil { - return obj.(*types.TypeName) - } - obj := types.NewTypeName(token.NoPos, pkg, name, nil) - // a named type may be referred to before the underlying type - // is known - set it up - types.NewNamed(obj, nil, nil) - scope.Insert(obj) - return obj -} - -// ---------------------------------------------------------------------------- -// Error handling - -// Internal errors are boxed as importErrors. -type importError struct { - pos scanner.Position - err error -} - -func (e importError) Error() string { - return fmt.Sprintf("import error %s (byte offset = %d): %s", e.pos, e.pos.Offset, e.err) -} - -func (p *parser) error(err interface{}) { - if s, ok := err.(string); ok { - err = errors.New(s) - } - // panic with a runtime.Error if err is not an error - panic(importError{p.scanner.Pos(), err.(error)}) -} - -func (p *parser) errorf(format string, args ...interface{}) { - p.error(fmt.Sprintf(format, args...)) -} - -func (p *parser) expect(tok rune) string { - lit := p.lit - if p.tok != tok { - p.errorf("expected %s, got %s (%s)", scanner.TokenString(tok), scanner.TokenString(p.tok), lit) - } - p.next() - return lit -} - -func (p *parser) expectSpecial(tok string) { - sep := 'x' // not white space - i := 0 - for i < len(tok) && p.tok == rune(tok[i]) && sep > ' ' { - sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token - p.next() - i++ - } - if i < len(tok) { - p.errorf("expected %q, got %q", tok, tok[0:i]) - } -} - -func (p *parser) expectKeyword(keyword string) { - lit := p.expect(scanner.Ident) - if lit != keyword { - p.errorf("expected keyword %s, got %q", keyword, lit) - } -} - -// ---------------------------------------------------------------------------- -// Qualified and unqualified names - -// PackageId = string_lit . -// -func (p *parser) parsePackageID() string { - id, err := strconv.Unquote(p.expect(scanner.String)) - if err != nil { - p.error(err) - } - // id == "" stands for the imported package id - // (only known at time of package installation) - if id == "" { - id = p.id - } - return id -} - -// PackageName = ident . -// -func (p *parser) parsePackageName() string { - return p.expect(scanner.Ident) -} - -// dotIdentifier = ( ident | '·' ) { ident | int | '·' } . -func (p *parser) parseDotIdent() string { - ident := "" - if p.tok != scanner.Int { - sep := 'x' // not white space - for (p.tok == scanner.Ident || p.tok == scanner.Int || p.tok == '·') && sep > ' ' { - ident += p.lit - sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token - p.next() - } - } - if ident == "" { - p.expect(scanner.Ident) // use expect() for error handling - } - return ident -} - -// QualifiedName = "@" PackageId "." ( "?" | dotIdentifier ) . -// -func (p *parser) parseQualifiedName() (id, name string) { - p.expect('@') - id = p.parsePackageID() - p.expect('.') - // Per rev f280b8a485fd (10/2/2013), qualified names may be used for anonymous fields. - if p.tok == '?' { - p.next() - } else { - name = p.parseDotIdent() - } - return -} - -// getPkg returns the package for a given id. If the package is -// not found, create the package and add it to the p.localPkgs -// and p.sharedPkgs maps. name is the (expected) name of the -// package. If name == "", the package name is expected to be -// set later via an import clause in the export data. -// -// id identifies a package, usually by a canonical package path like -// "encoding/json" but possibly by a non-canonical import path like -// "./json". -// -func (p *parser) getPkg(id, name string) *types.Package { - // package unsafe is not in the packages maps - handle explicitly - if id == "unsafe" { - return types.Unsafe - } - - pkg := p.localPkgs[id] - if pkg == nil { - // first import of id from this package - pkg = p.sharedPkgs[id] - if pkg == nil { - // first import of id by this importer; - // add (possibly unnamed) pkg to shared packages - pkg = types.NewPackage(id, name) - p.sharedPkgs[id] = pkg - } - // add (possibly unnamed) pkg to local packages - if p.localPkgs == nil { - p.localPkgs = make(map[string]*types.Package) - } - p.localPkgs[id] = pkg - } else if name != "" { - // package exists already and we have an expected package name; - // make sure names match or set package name if necessary - if pname := pkg.Name(); pname == "" { - pkg.SetName(name) - } else if pname != name { - p.errorf("%s package name mismatch: %s (given) vs %s (expected)", id, pname, name) - } - } - return pkg -} - -// parseExportedName is like parseQualifiedName, but -// the package id is resolved to an imported *types.Package. -// -func (p *parser) parseExportedName() (pkg *types.Package, name string) { - id, name := p.parseQualifiedName() - pkg = p.getPkg(id, "") - return -} - -// ---------------------------------------------------------------------------- -// Types - -// BasicType = identifier . -// -func (p *parser) parseBasicType() types.Type { - id := p.expect(scanner.Ident) - obj := types.Universe.Lookup(id) - if obj, ok := obj.(*types.TypeName); ok { - return obj.Type() - } - p.errorf("not a basic type: %s", id) - return nil -} - -// ArrayType = "[" int_lit "]" Type . -// -func (p *parser) parseArrayType(parent *types.Package) types.Type { - // "[" already consumed and lookahead known not to be "]" - lit := p.expect(scanner.Int) - p.expect(']') - elem := p.parseType(parent) - n, err := strconv.ParseInt(lit, 10, 64) - if err != nil { - p.error(err) - } - return types.NewArray(elem, n) -} - -// MapType = "map" "[" Type "]" Type . -// -func (p *parser) parseMapType(parent *types.Package) types.Type { - p.expectKeyword("map") - p.expect('[') - key := p.parseType(parent) - p.expect(']') - elem := p.parseType(parent) - return types.NewMap(key, elem) -} - -// Name = identifier | "?" | QualifiedName . -// -// For unqualified and anonymous names, the returned package is the parent -// package unless parent == nil, in which case the returned package is the -// package being imported. (The parent package is not nil if the name -// is an unqualified struct field or interface method name belonging to a -// type declared in another package.) -// -// For qualified names, the returned package is nil (and not created if -// it doesn't exist yet) unless materializePkg is set (which creates an -// unnamed package with valid package path). In the latter case, a -// subsequent import clause is expected to provide a name for the package. -// -func (p *parser) parseName(parent *types.Package, materializePkg bool) (pkg *types.Package, name string) { - pkg = parent - if pkg == nil { - pkg = p.sharedPkgs[p.id] - } - switch p.tok { - case scanner.Ident: - name = p.lit - p.next() - case '?': - // anonymous - p.next() - case '@': - // exported name prefixed with package path - pkg = nil - var id string - id, name = p.parseQualifiedName() - if materializePkg { - pkg = p.getPkg(id, "") - } - default: - p.error("name expected") - } - return -} - -func deref(typ types.Type) types.Type { - if p, _ := typ.(*types.Pointer); p != nil { - return p.Elem() - } - return typ -} - -// Field = Name Type [ string_lit ] . -// -func (p *parser) parseField(parent *types.Package) (*types.Var, string) { - pkg, name := p.parseName(parent, true) - - if name == "_" { - // Blank fields should be package-qualified because they - // are unexported identifiers, but gc does not qualify them. - // Assuming that the ident belongs to the current package - // causes types to change during re-exporting, leading - // to spurious "can't assign A to B" errors from go/types. - // As a workaround, pretend all blank fields belong - // to the same unique dummy package. - const blankpkg = "<_>" - pkg = p.getPkg(blankpkg, blankpkg) - } - - typ := p.parseType(parent) - anonymous := false - if name == "" { - // anonymous field - typ must be T or *T and T must be a type name - switch typ := deref(typ).(type) { - case *types.Basic: // basic types are named types - pkg = nil // objects defined in Universe scope have no package - name = typ.Name() - case *types.Named: - name = typ.Obj().Name() - default: - p.errorf("anonymous field expected") - } - anonymous = true - } - tag := "" - if p.tok == scanner.String { - s := p.expect(scanner.String) - var err error - tag, err = strconv.Unquote(s) - if err != nil { - p.errorf("invalid struct tag %s: %s", s, err) - } - } - return types.NewField(token.NoPos, pkg, name, typ, anonymous), tag -} - -// StructType = "struct" "{" [ FieldList ] "}" . -// FieldList = Field { ";" Field } . -// -func (p *parser) parseStructType(parent *types.Package) types.Type { - var fields []*types.Var - var tags []string - - p.expectKeyword("struct") - p.expect('{') - for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { - if i > 0 { - p.expect(';') - } - fld, tag := p.parseField(parent) - if tag != "" && tags == nil { - tags = make([]string, i) - } - if tags != nil { - tags = append(tags, tag) - } - fields = append(fields, fld) - } - p.expect('}') - - return types.NewStruct(fields, tags) -} - -// Parameter = ( identifier | "?" ) [ "..." ] Type [ string_lit ] . -// -func (p *parser) parseParameter() (par *types.Var, isVariadic bool) { - _, name := p.parseName(nil, false) - // remove gc-specific parameter numbering - if i := strings.Index(name, "·"); i >= 0 { - name = name[:i] - } - if p.tok == '.' { - p.expectSpecial("...") - isVariadic = true - } - typ := p.parseType(nil) - if isVariadic { - typ = types.NewSlice(typ) - } - // ignore argument tag (e.g. "noescape") - if p.tok == scanner.String { - p.next() - } - // TODO(gri) should we provide a package? - par = types.NewVar(token.NoPos, nil, name, typ) - return -} - -// Parameters = "(" [ ParameterList ] ")" . -// ParameterList = { Parameter "," } Parameter . -// -func (p *parser) parseParameters() (list []*types.Var, isVariadic bool) { - p.expect('(') - for p.tok != ')' && p.tok != scanner.EOF { - if len(list) > 0 { - p.expect(',') - } - par, variadic := p.parseParameter() - list = append(list, par) - if variadic { - if isVariadic { - p.error("... not on final argument") - } - isVariadic = true - } - } - p.expect(')') - - return -} - -// Signature = Parameters [ Result ] . -// Result = Type | Parameters . -// -func (p *parser) parseSignature(recv *types.Var) *types.Signature { - params, isVariadic := p.parseParameters() - - // optional result type - var results []*types.Var - if p.tok == '(' { - var variadic bool - results, variadic = p.parseParameters() - if variadic { - p.error("... not permitted on result type") - } - } - - return types.NewSignature(recv, types.NewTuple(params...), types.NewTuple(results...), isVariadic) -} - -// InterfaceType = "interface" "{" [ MethodList ] "}" . -// MethodList = Method { ";" Method } . -// Method = Name Signature . -// -// The methods of embedded interfaces are always "inlined" -// by the compiler and thus embedded interfaces are never -// visible in the export data. -// -func (p *parser) parseInterfaceType(parent *types.Package) types.Type { - var methods []*types.Func - - p.expectKeyword("interface") - p.expect('{') - for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { - if i > 0 { - p.expect(';') - } - pkg, name := p.parseName(parent, true) - sig := p.parseSignature(nil) - methods = append(methods, types.NewFunc(token.NoPos, pkg, name, sig)) - } - p.expect('}') - - // Complete requires the type's embedded interfaces to be fully defined, - // but we do not define any - return newInterface(methods, nil).Complete() -} - -// ChanType = ( "chan" [ "<-" ] | "<-" "chan" ) Type . -// -func (p *parser) parseChanType(parent *types.Package) types.Type { - dir := types.SendRecv - if p.tok == scanner.Ident { - p.expectKeyword("chan") - if p.tok == '<' { - p.expectSpecial("<-") - dir = types.SendOnly - } - } else { - p.expectSpecial("<-") - p.expectKeyword("chan") - dir = types.RecvOnly - } - elem := p.parseType(parent) - return types.NewChan(dir, elem) -} - -// Type = -// BasicType | TypeName | ArrayType | SliceType | StructType | -// PointerType | FuncType | InterfaceType | MapType | ChanType | -// "(" Type ")" . -// -// BasicType = ident . -// TypeName = ExportedName . -// SliceType = "[" "]" Type . -// PointerType = "*" Type . -// FuncType = "func" Signature . -// -func (p *parser) parseType(parent *types.Package) types.Type { - switch p.tok { - case scanner.Ident: - switch p.lit { - default: - return p.parseBasicType() - case "struct": - return p.parseStructType(parent) - case "func": - // FuncType - p.next() - return p.parseSignature(nil) - case "interface": - return p.parseInterfaceType(parent) - case "map": - return p.parseMapType(parent) - case "chan": - return p.parseChanType(parent) - } - case '@': - // TypeName - pkg, name := p.parseExportedName() - return declTypeName(pkg, name).Type() - case '[': - p.next() // look ahead - if p.tok == ']' { - // SliceType - p.next() - return types.NewSlice(p.parseType(parent)) - } - return p.parseArrayType(parent) - case '*': - // PointerType - p.next() - return types.NewPointer(p.parseType(parent)) - case '<': - return p.parseChanType(parent) - case '(': - // "(" Type ")" - p.next() - typ := p.parseType(parent) - p.expect(')') - return typ - } - p.errorf("expected type, got %s (%q)", scanner.TokenString(p.tok), p.lit) - return nil -} - -// ---------------------------------------------------------------------------- -// Declarations - -// ImportDecl = "import" PackageName PackageId . -// -func (p *parser) parseImportDecl() { - p.expectKeyword("import") - name := p.parsePackageName() - p.getPkg(p.parsePackageID(), name) -} - -// int_lit = [ "+" | "-" ] { "0" ... "9" } . -// -func (p *parser) parseInt() string { - s := "" - switch p.tok { - case '-': - s = "-" - p.next() - case '+': - p.next() - } - return s + p.expect(scanner.Int) -} - -// number = int_lit [ "p" int_lit ] . -// -func (p *parser) parseNumber() (typ *types.Basic, val constant.Value) { - // mantissa - mant := constant.MakeFromLiteral(p.parseInt(), token.INT, 0) - if mant == nil { - panic("invalid mantissa") - } - - if p.lit == "p" { - // exponent (base 2) - p.next() - exp, err := strconv.ParseInt(p.parseInt(), 10, 0) - if err != nil { - p.error(err) - } - if exp < 0 { - denom := constant.MakeInt64(1) - denom = constant.Shift(denom, token.SHL, uint(-exp)) - typ = types.Typ[types.UntypedFloat] - val = constant.BinaryOp(mant, token.QUO, denom) - return - } - if exp > 0 { - mant = constant.Shift(mant, token.SHL, uint(exp)) - } - typ = types.Typ[types.UntypedFloat] - val = mant - return - } - - typ = types.Typ[types.UntypedInt] - val = mant - return -} - -// ConstDecl = "const" ExportedName [ Type ] "=" Literal . -// Literal = bool_lit | int_lit | float_lit | complex_lit | rune_lit | string_lit . -// bool_lit = "true" | "false" . -// complex_lit = "(" float_lit "+" float_lit "i" ")" . -// rune_lit = "(" int_lit "+" int_lit ")" . -// string_lit = `"` { unicode_char } `"` . -// -func (p *parser) parseConstDecl() { - p.expectKeyword("const") - pkg, name := p.parseExportedName() - - var typ0 types.Type - if p.tok != '=' { - // constant types are never structured - no need for parent type - typ0 = p.parseType(nil) - } - - p.expect('=') - var typ types.Type - var val constant.Value - switch p.tok { - case scanner.Ident: - // bool_lit - if p.lit != "true" && p.lit != "false" { - p.error("expected true or false") - } - typ = types.Typ[types.UntypedBool] - val = constant.MakeBool(p.lit == "true") - p.next() - - case '-', scanner.Int: - // int_lit - typ, val = p.parseNumber() - - case '(': - // complex_lit or rune_lit - p.next() - if p.tok == scanner.Char { - p.next() - p.expect('+') - typ = types.Typ[types.UntypedRune] - _, val = p.parseNumber() - p.expect(')') - break - } - _, re := p.parseNumber() - p.expect('+') - _, im := p.parseNumber() - p.expectKeyword("i") - p.expect(')') - typ = types.Typ[types.UntypedComplex] - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - case scanner.Char: - // rune_lit - typ = types.Typ[types.UntypedRune] - val = constant.MakeFromLiteral(p.lit, token.CHAR, 0) - p.next() - - case scanner.String: - // string_lit - typ = types.Typ[types.UntypedString] - val = constant.MakeFromLiteral(p.lit, token.STRING, 0) - p.next() - - default: - p.errorf("expected literal got %s", scanner.TokenString(p.tok)) - } - - if typ0 == nil { - typ0 = typ - } - - pkg.Scope().Insert(types.NewConst(token.NoPos, pkg, name, typ0, val)) -} - -// TypeDecl = "type" ExportedName Type . -// -func (p *parser) parseTypeDecl() { - p.expectKeyword("type") - pkg, name := p.parseExportedName() - obj := declTypeName(pkg, name) - - // The type object may have been imported before and thus already - // have a type associated with it. We still need to parse the type - // structure, but throw it away if the object already has a type. - // This ensures that all imports refer to the same type object for - // a given type declaration. - typ := p.parseType(pkg) - - if name := obj.Type().(*types.Named); name.Underlying() == nil { - name.SetUnderlying(typ) - } -} - -// VarDecl = "var" ExportedName Type . -// -func (p *parser) parseVarDecl() { - p.expectKeyword("var") - pkg, name := p.parseExportedName() - typ := p.parseType(pkg) - pkg.Scope().Insert(types.NewVar(token.NoPos, pkg, name, typ)) -} - -// Func = Signature [ Body ] . -// Body = "{" ... "}" . -// -func (p *parser) parseFunc(recv *types.Var) *types.Signature { - sig := p.parseSignature(recv) - if p.tok == '{' { - p.next() - for i := 1; i > 0; p.next() { - switch p.tok { - case '{': - i++ - case '}': - i-- - } - } - } - return sig -} - -// MethodDecl = "func" Receiver Name Func . -// Receiver = "(" ( identifier | "?" ) [ "*" ] ExportedName ")" . -// -func (p *parser) parseMethodDecl() { - // "func" already consumed - p.expect('(') - recv, _ := p.parseParameter() // receiver - p.expect(')') - - // determine receiver base type object - base := deref(recv.Type()).(*types.Named) - - // parse method name, signature, and possibly inlined body - _, name := p.parseName(nil, false) - sig := p.parseFunc(recv) - - // methods always belong to the same package as the base type object - pkg := base.Obj().Pkg() - - // add method to type unless type was imported before - // and method exists already - // TODO(gri) This leads to a quadratic algorithm - ok for now because method counts are small. - base.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig)) -} - -// FuncDecl = "func" ExportedName Func . -// -func (p *parser) parseFuncDecl() { - // "func" already consumed - pkg, name := p.parseExportedName() - typ := p.parseFunc(nil) - pkg.Scope().Insert(types.NewFunc(token.NoPos, pkg, name, typ)) -} - -// Decl = [ ImportDecl | ConstDecl | TypeDecl | VarDecl | FuncDecl | MethodDecl ] "\n" . -// -func (p *parser) parseDecl() { - if p.tok == scanner.Ident { - switch p.lit { - case "import": - p.parseImportDecl() - case "const": - p.parseConstDecl() - case "type": - p.parseTypeDecl() - case "var": - p.parseVarDecl() - case "func": - p.next() // look ahead - if p.tok == '(' { - p.parseMethodDecl() - } else { - p.parseFuncDecl() - } - } - } - p.expect('\n') -} - -// ---------------------------------------------------------------------------- -// Export - -// Export = "PackageClause { Decl } "$$" . -// PackageClause = "package" PackageName [ "safe" ] "\n" . -// -func (p *parser) parseExport() *types.Package { - p.expectKeyword("package") - name := p.parsePackageName() - if p.tok == scanner.Ident && p.lit == "safe" { - // package was compiled with -u option - ignore - p.next() - } - p.expect('\n') - - pkg := p.getPkg(p.id, name) - - for p.tok != '$' && p.tok != scanner.EOF { - p.parseDecl() - } - - if ch := p.scanner.Peek(); p.tok != '$' || ch != '$' { - // don't call next()/expect() since reading past the - // export data may cause scanner errors (e.g. NUL chars) - p.errorf("expected '$$', got %s %c", scanner.TokenString(p.tok), ch) - } - - if n := p.scanner.ErrorCount; n != 0 { - p.errorf("expected no scanner errors, got %d", n) - } - - // Record all locally referenced packages as imports. - var imports []*types.Package - for id, pkg2 := range p.localPkgs { - if pkg2.Name() == "" { - p.errorf("%s package has no name", id) - } - if id == p.id { - continue // avoid self-edge - } - imports = append(imports, pkg2) - } - sort.Sort(byPath(imports)) - pkg.SetImports(imports) - - // package was imported completely and without errors - pkg.MarkComplete() - - return pkg -} - -type byPath []*types.Package - -func (a byPath) Len() int { return len(a) } -func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go deleted file mode 100644 index be8b7459af..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go +++ /dev/null @@ -1,911 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed binary package export. -// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go; -// see that file for specification of the format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "go/ast" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "reflect" - "sort" - - "golang.org/x/tools/internal/typeparams" -) - -// Current bundled export format version. Increase with each format change. -// 0: initial implementation -const bundleVersion = 0 - -// IExportData writes indexed export data for pkg to out. -// -// If no file set is provided, position info will be missing. -// The package path of the top-level package will not be recorded, -// so that calls to IImportData can override with a provided package path. -func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - return iexportCommon(out, fset, false, []*types.Package{pkg}) -} - -// IExportBundle writes an indexed export bundle for pkgs to out. -func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - return iexportCommon(out, fset, true, pkgs) -} - -func iexportCommon(out io.Writer, fset *token.FileSet, bundle bool, pkgs []*types.Package) (err error) { - if !debug { - defer func() { - if e := recover(); e != nil { - if ierr, ok := e.(internalError); ok { - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - } - - p := iexporter{ - fset: fset, - allPkgs: map[*types.Package]bool{}, - stringIndex: map[string]uint64{}, - declIndex: map[types.Object]uint64{}, - typIndex: map[types.Type]uint64{}, - } - if !bundle { - p.localpkg = pkgs[0] - } - - for i, pt := range predeclared() { - p.typIndex[pt] = uint64(i) - } - if len(p.typIndex) > predeclReserved { - panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) - } - - // Initialize work queue with exported declarations. - for _, pkg := range pkgs { - scope := pkg.Scope() - for _, name := range scope.Names() { - if ast.IsExported(name) { - p.pushDecl(scope.Lookup(name)) - } - } - - if bundle { - // Ensure pkg and its imports are included in the index. - p.allPkgs[pkg] = true - for _, imp := range pkg.Imports() { - p.allPkgs[imp] = true - } - } - } - - // Loop until no more work. - for !p.declTodo.empty() { - p.doDecl(p.declTodo.popHead()) - } - - // Append indices to data0 section. - dataLen := uint64(p.data0.Len()) - w := p.newWriter() - w.writeIndex(p.declIndex) - - if bundle { - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.pkg(pkg) - imps := pkg.Imports() - w.uint64(uint64(len(imps))) - for _, imp := range imps { - w.pkg(imp) - } - } - } - w.flush() - - // Assemble header. - var hdr intWriter - if bundle { - hdr.uint64(bundleVersion) - } - hdr.uint64(iexportVersion) - hdr.uint64(uint64(p.strings.Len())) - hdr.uint64(dataLen) - - // Flush output. - io.Copy(out, &hdr) - io.Copy(out, &p.strings) - io.Copy(out, &p.data0) - - return nil -} - -// writeIndex writes out an object index. mainIndex indicates whether -// we're writing out the main index, which is also read by -// non-compiler tools and includes a complete package description -// (i.e., name and height). -func (w *exportWriter) writeIndex(index map[types.Object]uint64) { - // Build a map from packages to objects from that package. - pkgObjs := map[*types.Package][]types.Object{} - - // For the main index, make sure to include every package that - // we reference, even if we're not exporting (or reexporting) - // any symbols from it. - if w.p.localpkg != nil { - pkgObjs[w.p.localpkg] = nil - } - for pkg := range w.p.allPkgs { - pkgObjs[pkg] = nil - } - - for obj := range index { - pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], obj) - } - - var pkgs []*types.Package - for pkg, objs := range pkgObjs { - pkgs = append(pkgs, pkg) - - sort.Slice(objs, func(i, j int) bool { - return indexName(objs[i]) < indexName(objs[j]) - }) - } - - sort.Slice(pkgs, func(i, j int) bool { - return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) - }) - - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.string(w.exportPath(pkg)) - w.string(pkg.Name()) - w.uint64(uint64(0)) // package height is not needed for go/types - - objs := pkgObjs[pkg] - w.uint64(uint64(len(objs))) - for _, obj := range objs { - w.string(indexName(obj)) - w.uint64(index[obj]) - } - } -} - -// indexName returns the 'indexed' name of an object. It differs from -// obj.Name() only for type parameter names, where we include the subscripted -// type parameter ID. -// -// TODO(rfindley): remove this once we no longer need subscripts. -func indexName(obj types.Object) (res string) { - if _, ok := obj.(*types.TypeName); ok { - if tparam, ok := obj.Type().(*typeparams.TypeParam); ok { - return types.TypeString(tparam, func(*types.Package) string { return "" }) - } - } - return obj.Name() -} - -type iexporter struct { - fset *token.FileSet - out *bytes.Buffer - - localpkg *types.Package - - // allPkgs tracks all packages that have been referenced by - // the export data, so we can ensure to include them in the - // main index. - allPkgs map[*types.Package]bool - - declTodo objQueue - - strings intWriter - stringIndex map[string]uint64 - - data0 intWriter - declIndex map[types.Object]uint64 - typIndex map[types.Type]uint64 -} - -// stringOff returns the offset of s within the string section. -// If not already present, it's added to the end. -func (p *iexporter) stringOff(s string) uint64 { - off, ok := p.stringIndex[s] - if !ok { - off = uint64(p.strings.Len()) - p.stringIndex[s] = off - - p.strings.uint64(uint64(len(s))) - p.strings.WriteString(s) - } - return off -} - -// pushDecl adds n to the declaration work queue, if not already present. -func (p *iexporter) pushDecl(obj types.Object) { - // Package unsafe is known to the compiler and predeclared. - assert(obj.Pkg() != types.Unsafe) - - if _, ok := p.declIndex[obj]; ok { - return - } - - p.declIndex[obj] = ^uint64(0) // mark n present in work queue - p.declTodo.pushTail(obj) -} - -// exportWriter handles writing out individual data section chunks. -type exportWriter struct { - p *iexporter - - data intWriter - currPkg *types.Package - prevFile string - prevLine int64 - prevColumn int64 -} - -func (w *exportWriter) exportPath(pkg *types.Package) string { - if pkg == w.p.localpkg { - return "" - } - return pkg.Path() -} - -func (p *iexporter) doDecl(obj types.Object) { - w := p.newWriter() - w.setPkg(obj.Pkg(), false) - - switch obj := obj.(type) { - case *types.Var: - w.tag('V') - w.pos(obj.Pos()) - w.typ(obj.Type(), obj.Pkg()) - - case *types.Func: - sig, _ := obj.Type().(*types.Signature) - if sig.Recv() != nil { - panic(internalErrorf("unexpected method: %v", sig)) - } - - // Function. - if typeparams.ForSignature(sig).Len() == 0 { - w.tag('F') - } else { - w.tag('G') - } - w.pos(obj.Pos()) - // The tparam list of the function type is the - // declaration of the type params. So, write out the type - // params right now. Then those type params will be - // referenced via their type offset (via typOff) in all - // other places in the signature and function that they - // are used. - if tparams := typeparams.ForSignature(sig); tparams.Len() > 0 { - w.tparamList(tparams, obj.Pkg()) - } - w.signature(sig) - - case *types.Const: - w.tag('C') - w.pos(obj.Pos()) - w.value(obj.Type(), obj.Val()) - - case *types.TypeName: - t := obj.Type() - - if tparam, ok := t.(*typeparams.TypeParam); ok { - w.tag('P') - w.pos(obj.Pos()) - w.typ(tparam.Constraint(), obj.Pkg()) - break - } - - if obj.IsAlias() { - w.tag('A') - w.pos(obj.Pos()) - w.typ(t, obj.Pkg()) - break - } - - // Defined type. - named, ok := t.(*types.Named) - if !ok { - panic(internalErrorf("%s is not a defined type", t)) - } - - if typeparams.ForNamed(named).Len() == 0 { - w.tag('T') - } else { - w.tag('U') - } - w.pos(obj.Pos()) - - if typeparams.ForNamed(named).Len() > 0 { - w.tparamList(typeparams.ForNamed(named), obj.Pkg()) - } - - underlying := obj.Type().Underlying() - w.typ(underlying, obj.Pkg()) - - if types.IsInterface(t) { - break - } - - n := named.NumMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := named.Method(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.param(sig.Recv()) - w.signature(sig) - } - - default: - panic(internalErrorf("unexpected object: %v", obj)) - } - - p.declIndex[obj] = w.flush() -} - -func (w *exportWriter) tag(tag byte) { - w.data.WriteByte(tag) -} - -func (w *exportWriter) pos(pos token.Pos) { - if iexportVersion >= iexportVersionPosCol { - w.posV1(pos) - } else { - w.posV0(pos) - } -} - -func (w *exportWriter) posV1(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - column := int64(p.Column) - - deltaColumn := (column - w.prevColumn) << 1 - deltaLine := (line - w.prevLine) << 1 - - if file != w.prevFile { - deltaLine |= 1 - } - if deltaLine != 0 { - deltaColumn |= 1 - } - - w.int64(deltaColumn) - if deltaColumn&1 != 0 { - w.int64(deltaLine) - if deltaLine&1 != 0 { - w.string(file) - } - } - - w.prevFile = file - w.prevLine = line - w.prevColumn = column -} - -func (w *exportWriter) posV0(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - - // When file is the same as the last position (common case), - // we can save a few bytes by delta encoding just the line - // number. - // - // Note: Because data objects may be read out of order (or not - // at all), we can only apply delta encoding within a single - // object. This is handled implicitly by tracking prevFile and - // prevLine as fields of exportWriter. - - if file == w.prevFile { - delta := line - w.prevLine - w.int64(delta) - if delta == deltaNewFile { - w.int64(-1) - } - } else { - w.int64(deltaNewFile) - w.int64(line) // line >= 0 - w.string(file) - w.prevFile = file - } - w.prevLine = line -} - -func (w *exportWriter) pkg(pkg *types.Package) { - // Ensure any referenced packages are declared in the main index. - w.p.allPkgs[pkg] = true - - w.string(w.exportPath(pkg)) -} - -func (w *exportWriter) qualifiedIdent(obj types.Object) { - // Ensure any referenced declarations are written out too. - w.p.pushDecl(obj) - w.string(indexName(obj)) - w.pkg(obj.Pkg()) -} - -func (w *exportWriter) typ(t types.Type, pkg *types.Package) { - w.data.uint64(w.p.typOff(t, pkg)) -} - -func (p *iexporter) newWriter() *exportWriter { - return &exportWriter{p: p} -} - -func (w *exportWriter) flush() uint64 { - off := uint64(w.p.data0.Len()) - io.Copy(&w.p.data0, &w.data) - return off -} - -func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { - off, ok := p.typIndex[t] - if !ok { - w := p.newWriter() - w.doTyp(t, pkg) - off = predeclReserved + w.flush() - p.typIndex[t] = off - } - return off -} - -func (w *exportWriter) startType(k itag) { - w.data.uint64(uint64(k)) -} - -func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { - switch t := t.(type) { - case *types.Named: - if targs := typeparams.NamedTypeArgs(t); targs.Len() > 0 { - w.startType(instanceType) - // TODO(rfindley): investigate if this position is correct, and if it - // matters. - w.pos(t.Obj().Pos()) - w.typeList(targs, pkg) - w.typ(typeparams.NamedTypeOrigin(t), pkg) - return - } - w.startType(definedType) - w.qualifiedIdent(t.Obj()) - - case *typeparams.TypeParam: - w.startType(typeParamType) - w.qualifiedIdent(t.Obj()) - - case *types.Pointer: - w.startType(pointerType) - w.typ(t.Elem(), pkg) - - case *types.Slice: - w.startType(sliceType) - w.typ(t.Elem(), pkg) - - case *types.Array: - w.startType(arrayType) - w.uint64(uint64(t.Len())) - w.typ(t.Elem(), pkg) - - case *types.Chan: - w.startType(chanType) - // 1 RecvOnly; 2 SendOnly; 3 SendRecv - var dir uint64 - switch t.Dir() { - case types.RecvOnly: - dir = 1 - case types.SendOnly: - dir = 2 - case types.SendRecv: - dir = 3 - } - w.uint64(dir) - w.typ(t.Elem(), pkg) - - case *types.Map: - w.startType(mapType) - w.typ(t.Key(), pkg) - w.typ(t.Elem(), pkg) - - case *types.Signature: - w.startType(signatureType) - w.setPkg(pkg, true) - w.signature(t) - - case *types.Struct: - w.startType(structType) - w.setPkg(pkg, true) - - n := t.NumFields() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - f := t.Field(i) - w.pos(f.Pos()) - w.string(f.Name()) - w.typ(f.Type(), pkg) - w.bool(f.Anonymous()) - w.string(t.Tag(i)) // note (or tag) - } - - case *types.Interface: - w.startType(interfaceType) - w.setPkg(pkg, true) - - n := t.NumEmbeddeds() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - ft := t.EmbeddedType(i) - tPkg := pkg - if named, _ := ft.(*types.Named); named != nil { - w.pos(named.Obj().Pos()) - } else { - w.pos(token.NoPos) - } - w.typ(ft, tPkg) - } - - n = t.NumExplicitMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := t.ExplicitMethod(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.signature(sig) - } - - case *typeparams.Union: - w.startType(unionType) - nt := t.Len() - w.uint64(uint64(nt)) - for i := 0; i < nt; i++ { - term := t.Term(i) - w.bool(term.Tilde()) - w.typ(term.Type(), pkg) - } - - default: - panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) - } -} - -func (w *exportWriter) setPkg(pkg *types.Package, write bool) { - if write { - w.pkg(pkg) - } - - w.currPkg = pkg -} - -func (w *exportWriter) signature(sig *types.Signature) { - w.paramList(sig.Params()) - w.paramList(sig.Results()) - if sig.Params().Len() > 0 { - w.bool(sig.Variadic()) - } -} - -func (w *exportWriter) typeList(ts *typeparams.TypeList, pkg *types.Package) { - w.uint64(uint64(ts.Len())) - for i := 0; i < ts.Len(); i++ { - w.typ(ts.At(i), pkg) - } -} - -func (w *exportWriter) tparamList(list *typeparams.TypeParamList, pkg *types.Package) { - ll := uint64(list.Len()) - w.uint64(ll) - for i := 0; i < list.Len(); i++ { - w.typ(list.At(i), pkg) - } -} - -func (w *exportWriter) paramList(tup *types.Tuple) { - n := tup.Len() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - w.param(tup.At(i)) - } -} - -func (w *exportWriter) param(obj types.Object) { - w.pos(obj.Pos()) - w.localIdent(obj) - w.typ(obj.Type(), obj.Pkg()) -} - -func (w *exportWriter) value(typ types.Type, v constant.Value) { - w.typ(typ, nil) - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - w.bool(constant.BoolVal(v)) - case types.IsInteger: - var i big.Int - if i64, exact := constant.Int64Val(v); exact { - i.SetInt64(i64) - } else if ui64, exact := constant.Uint64Val(v); exact { - i.SetUint64(ui64) - } else { - i.SetString(v.ExactString(), 10) - } - w.mpint(&i, typ) - case types.IsFloat: - f := constantToFloat(v) - w.mpfloat(f, typ) - case types.IsComplex: - w.mpfloat(constantToFloat(constant.Real(v)), typ) - w.mpfloat(constantToFloat(constant.Imag(v)), typ) - case types.IsString: - w.string(constant.StringVal(v)) - default: - if b.Kind() == types.Invalid { - // package contains type errors - break - } - panic(internalErrorf("unexpected type %v (%v)", typ, typ.Underlying())) - } -} - -// constantToFloat converts a constant.Value with kind constant.Float to a -// big.Float. -func constantToFloat(x constant.Value) *big.Float { - x = constant.ToFloat(x) - // Use the same floating-point precision (512) as cmd/compile - // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). - const mpprec = 512 - var f big.Float - f.SetPrec(mpprec) - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - n := valueToRat(num) - d := valueToRat(denom) - f.SetRat(n.Quo(n, d)) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - _, ok := f.SetString(x.ExactString()) - assert(ok) - } - return &f -} - -// mpint exports a multi-precision integer. -// -// For unsigned types, small values are written out as a single -// byte. Larger values are written out as a length-prefixed big-endian -// byte string, where the length prefix is encoded as its complement. -// For example, bytes 0, 1, and 2 directly represent the integer -// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, -// 2-, and 3-byte big-endian string follow. -// -// Encoding for signed types use the same general approach as for -// unsigned types, except small values use zig-zag encoding and the -// bottom bit of length prefix byte for large values is reserved as a -// sign bit. -// -// The exact boundary between small and large encodings varies -// according to the maximum number of bytes needed to encode a value -// of type typ. As a special case, 8-bit types are always encoded as a -// single byte. -// -// TODO(mdempsky): Is this level of complexity really worthwhile? -func (w *exportWriter) mpint(x *big.Int, typ types.Type) { - basic, ok := typ.Underlying().(*types.Basic) - if !ok { - panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) - } - - signed, maxBytes := intSize(basic) - - negative := x.Sign() < 0 - if !signed && negative { - panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) - } - - b := x.Bytes() - if len(b) > 0 && b[0] == 0 { - panic(internalErrorf("leading zeros")) - } - if uint(len(b)) > maxBytes { - panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) - } - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - // Check if x can use small value encoding. - if len(b) <= 1 { - var ux uint - if len(b) == 1 { - ux = uint(b[0]) - } - if signed { - ux <<= 1 - if negative { - ux-- - } - } - if ux < maxSmall { - w.data.WriteByte(byte(ux)) - return - } - } - - n := 256 - uint(len(b)) - if signed { - n = 256 - 2*uint(len(b)) - if negative { - n |= 1 - } - } - if n < maxSmall || n >= 256 { - panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) - } - - w.data.WriteByte(byte(n)) - w.data.Write(b) -} - -// mpfloat exports a multi-precision floating point number. -// -// The number's value is decomposed into mantissa × 2**exponent, where -// mantissa is an integer. The value is written out as mantissa (as a -// multi-precision integer) and then the exponent, except exponent is -// omitted if mantissa is zero. -func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { - if f.IsInf() { - panic("infinite constant") - } - - // Break into f = mant × 2**exp, with 0.5 <= mant < 1. - var mant big.Float - exp := int64(f.MantExp(&mant)) - - // Scale so that mant is an integer. - prec := mant.MinPrec() - mant.SetMantExp(&mant, int(prec)) - exp -= int64(prec) - - manti, acc := mant.Int(nil) - if acc != big.Exact { - panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) - } - w.mpint(manti, typ) - if manti.Sign() != 0 { - w.int64(exp) - } -} - -func (w *exportWriter) bool(b bool) bool { - var x uint64 - if b { - x = 1 - } - w.uint64(x) - return b -} - -func (w *exportWriter) int64(x int64) { w.data.int64(x) } -func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } -func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } - -func (w *exportWriter) localIdent(obj types.Object) { - // Anonymous parameters. - if obj == nil { - w.string("") - return - } - - name := indexName(obj) - if name == "_" { - w.string("_") - return - } - - w.string(name) -} - -type intWriter struct { - bytes.Buffer -} - -func (w *intWriter) int64(x int64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutVarint(buf[:], x) - w.Write(buf[:n]) -} - -func (w *intWriter) uint64(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - w.Write(buf[:n]) -} - -func assert(cond bool) { - if !cond { - panic("internal error: assertion failed") - } -} - -// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. - -// objQueue is a FIFO queue of types.Object. The zero value of objQueue is -// a ready-to-use empty queue. -type objQueue struct { - ring []types.Object - head, tail int -} - -// empty returns true if q contains no Nodes. -func (q *objQueue) empty() bool { - return q.head == q.tail -} - -// pushTail appends n to the tail of the queue. -func (q *objQueue) pushTail(obj types.Object) { - if len(q.ring) == 0 { - q.ring = make([]types.Object, 16) - } else if q.head+len(q.ring) == q.tail { - // Grow the ring. - nring := make([]types.Object, len(q.ring)*2) - // Copy the old elements. - part := q.ring[q.head%len(q.ring):] - if q.tail-q.head <= len(part) { - part = part[:q.tail-q.head] - copy(nring, part) - } else { - pos := copy(nring, part) - copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) - } - q.ring, q.head, q.tail = nring, 0, q.tail-q.head - } - - q.ring[q.tail%len(q.ring)] = obj - q.tail++ -} - -// popHead pops a node from the head of the queue. It panics if q is empty. -func (q *objQueue) popHead() types.Object { - if q.empty() { - panic("dequeue empty") - } - obj := q.ring[q.head%len(q.ring)] - q.head++ - return obj -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go deleted file mode 100644 index 1fcc87e58e..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go +++ /dev/null @@ -1,845 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package import. -// See cmd/compile/internal/gc/iexport.go for the export data format. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "sort" - - "golang.org/x/tools/internal/typeparams" -) - -type intReader struct { - *bytes.Reader - path string -} - -func (r *intReader) int64() int64 { - i, err := binary.ReadVarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -func (r *intReader) uint64() uint64 { - i, err := binary.ReadUvarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -// Keep this in sync with constants in iexport.go. -const ( - iexportVersionGo1_11 = 0 - iexportVersionPosCol = 1 - // TODO: before release, change this back to 2. - iexportVersionGenerics = iexportVersionPosCol - - iexportVersionCurrent = iexportVersionGenerics -) - -type ident struct { - pkg string - name string -} - -const predeclReserved = 32 - -type itag uint64 - -const ( - // Types - definedType itag = iota - pointerType - sliceType - arrayType - chanType - mapType - signatureType - structType - interfaceType - typeParamType - instanceType - unionType -) - -// IImportData imports a package from the serialized package data -// and returns 0 and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { - pkgs, err := iimportCommon(fset, imports, data, false, path) - if err != nil { - return 0, nil, err - } - return 0, pkgs[0], nil -} - -// IImportBundle imports a set of packages from the serialized package bundle. -func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) { - return iimportCommon(fset, imports, data, true, "") -} - -func iimportCommon(fset *token.FileSet, imports map[string]*types.Package, data []byte, bundle bool, path string) (pkgs []*types.Package, err error) { - const currentVersion = 1 - version := int64(-1) - if !debug { - defer func() { - if e := recover(); e != nil { - if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) - } - } - }() - } - - r := &intReader{bytes.NewReader(data), path} - - if bundle { - bundleVersion := r.uint64() - switch bundleVersion { - case bundleVersion: - default: - errorf("unknown bundle format version %d", bundleVersion) - } - } - - version = int64(r.uint64()) - switch version { - case /* iexportVersionGenerics, */ iexportVersionPosCol, iexportVersionGo1_11: - default: - if version > iexportVersionGenerics { - errorf("unstable iexport format version %d, just rebuild compiler and std library", version) - } else { - errorf("unknown iexport format version %d", version) - } - } - - sLen := int64(r.uint64()) - dLen := int64(r.uint64()) - - whence, _ := r.Seek(0, io.SeekCurrent) - stringData := data[whence : whence+sLen] - declData := data[whence+sLen : whence+sLen+dLen] - r.Seek(sLen+dLen, io.SeekCurrent) - - p := iimporter{ - exportVersion: version, - ipath: path, - version: int(version), - - stringData: stringData, - stringCache: make(map[uint64]string), - pkgCache: make(map[uint64]*types.Package), - - declData: declData, - pkgIndex: make(map[*types.Package]map[string]uint64), - typCache: make(map[uint64]types.Type), - // Separate map for typeparams, keyed by their package and unique - // name (name with subscript). - tparamIndex: make(map[ident]types.Type), - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*token.File), - }, - } - - for i, pt := range predeclared() { - p.typCache[uint64(i)] = pt - } - - pkgList := make([]*types.Package, r.uint64()) - for i := range pkgList { - pkgPathOff := r.uint64() - pkgPath := p.stringAt(pkgPathOff) - pkgName := p.stringAt(r.uint64()) - _ = r.uint64() // package height; unused by go/types - - if pkgPath == "" { - pkgPath = path - } - pkg := imports[pkgPath] - if pkg == nil { - pkg = types.NewPackage(pkgPath, pkgName) - imports[pkgPath] = pkg - } else if pkg.Name() != pkgName { - errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path) - } - - p.pkgCache[pkgPathOff] = pkg - - nameIndex := make(map[string]uint64) - for nSyms := r.uint64(); nSyms > 0; nSyms-- { - name := p.stringAt(r.uint64()) - nameIndex[name] = r.uint64() - } - - p.pkgIndex[pkg] = nameIndex - pkgList[i] = pkg - } - - if bundle { - pkgs = make([]*types.Package, r.uint64()) - for i := range pkgs { - pkg := p.pkgAt(r.uint64()) - imps := make([]*types.Package, r.uint64()) - for j := range imps { - imps[j] = p.pkgAt(r.uint64()) - } - pkg.SetImports(imps) - pkgs[i] = pkg - } - } else { - if len(pkgList) == 0 { - errorf("no packages found for %s", path) - panic("unreachable") - } - pkgs = pkgList[:1] - - // record all referenced packages as imports - list := append(([]*types.Package)(nil), pkgList[1:]...) - sort.Sort(byPath(list)) - pkgs[0].SetImports(list) - } - - for _, pkg := range pkgs { - if pkg.Complete() { - continue - } - - names := make([]string, 0, len(p.pkgIndex[pkg])) - for name := range p.pkgIndex[pkg] { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - p.doDecl(pkg, name) - } - - // package was imported completely and without errors - pkg.MarkComplete() - } - - for _, typ := range p.interfaceList { - typ.Complete() - } - - return pkgs, nil -} - -type iimporter struct { - exportVersion int64 - ipath string - version int - - stringData []byte - stringCache map[uint64]string - pkgCache map[uint64]*types.Package - - declData []byte - pkgIndex map[*types.Package]map[string]uint64 - typCache map[uint64]types.Type - tparamIndex map[ident]types.Type - - fake fakeFileSet - interfaceList []*types.Interface -} - -func (p *iimporter) doDecl(pkg *types.Package, name string) { - // See if we've already imported this declaration. - if obj := pkg.Scope().Lookup(name); obj != nil { - return - } - - off, ok := p.pkgIndex[pkg][name] - if !ok { - errorf("%v.%v not in index", pkg, name) - } - - r := &importReader{p: p, currPkg: pkg} - r.declReader.Reset(p.declData[off:]) - - r.obj(name) -} - -func (p *iimporter) stringAt(off uint64) string { - if s, ok := p.stringCache[off]; ok { - return s - } - - slen, n := binary.Uvarint(p.stringData[off:]) - if n <= 0 { - errorf("varint failed") - } - spos := off + uint64(n) - s := string(p.stringData[spos : spos+slen]) - p.stringCache[off] = s - return s -} - -func (p *iimporter) pkgAt(off uint64) *types.Package { - if pkg, ok := p.pkgCache[off]; ok { - return pkg - } - path := p.stringAt(off) - errorf("missing package %q in %q", path, p.ipath) - return nil -} - -func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { - if t, ok := p.typCache[off]; ok && (base == nil || !isInterface(t)) { - return t - } - - if off < predeclReserved { - errorf("predeclared type missing from cache: %v", off) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off-predeclReserved:]) - t := r.doType(base) - - if base == nil || !isInterface(t) { - p.typCache[off] = t - } - return t -} - -type importReader struct { - p *iimporter - declReader bytes.Reader - currPkg *types.Package - prevFile string - prevLine int64 - prevColumn int64 -} - -func (r *importReader) obj(name string) { - tag := r.byte() - pos := r.pos() - - switch tag { - case 'A': - typ := r.typ() - - r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) - - case 'C': - typ, val := r.value() - - r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) - - case 'F', 'G': - var tparams []*typeparams.TypeParam - if tag == 'G' { - tparams = r.tparamList() - } - sig := r.signature(nil) - typeparams.SetForSignature(sig, tparams) - r.declare(types.NewFunc(pos, r.currPkg, name, sig)) - - case 'T', 'U': - // Types can be recursive. We need to setup a stub - // declaration before recursing. - obj := types.NewTypeName(pos, r.currPkg, name, nil) - named := types.NewNamed(obj, nil, nil) - // Declare obj before calling r.tparamList, so the new type name is recognized - // if used in the constraint of one of its own typeparams (see #48280). - r.declare(obj) - if tag == 'U' { - tparams := r.tparamList() - typeparams.SetForNamed(named, tparams) - } - - underlying := r.p.typAt(r.uint64(), named).Underlying() - named.SetUnderlying(underlying) - - if !isInterface(underlying) { - for n := r.uint64(); n > 0; n-- { - mpos := r.pos() - mname := r.ident() - recv := r.param() - msig := r.signature(recv) - - // If the receiver has any targs, set those as the - // rparams of the method (since those are the - // typeparams being used in the method sig/body). - targs := typeparams.NamedTypeArgs(baseType(msig.Recv().Type())) - if targs.Len() > 0 { - rparams := make([]*typeparams.TypeParam, targs.Len()) - for i := range rparams { - // TODO(rfindley): this is less tolerant than the standard library - // go/internal/gcimporter, which calls under(...) and is tolerant - // of nil rparams. Bring them in sync by making the standard - // library importer stricter. - rparams[i] = targs.At(i).(*typeparams.TypeParam) - } - typeparams.SetRecvTypeParams(msig, rparams) - } - - named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) - } - } - - case 'P': - // We need to "declare" a typeparam in order to have a name that - // can be referenced recursively (if needed) in the type param's - // bound. - if r.p.exportVersion < iexportVersionGenerics { - errorf("unexpected type param type") - } - name0, sub := parseSubscript(name) - tn := types.NewTypeName(pos, r.currPkg, name0, nil) - t := typeparams.NewTypeParam(tn, nil) - if sub == 0 { - errorf("name %q missing subscript", name) - } - - // TODO(rfindley): can we use a different, stable ID? - // t.SetId(sub) - - // To handle recursive references to the typeparam within its - // bound, save the partial type in tparamIndex before reading the bounds. - id := ident{r.currPkg.Name(), name} - r.p.tparamIndex[id] = t - - typeparams.SetTypeParamConstraint(t, r.typ()) - - case 'V': - typ := r.typ() - - r.declare(types.NewVar(pos, r.currPkg, name, typ)) - - default: - errorf("unexpected tag: %v", tag) - } -} - -func (r *importReader) declare(obj types.Object) { - obj.Pkg().Scope().Insert(obj) -} - -func (r *importReader) value() (typ types.Type, val constant.Value) { - typ = r.typ() - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - val = constant.MakeBool(r.bool()) - - case types.IsString: - val = constant.MakeString(r.string()) - - case types.IsInteger: - val = r.mpint(b) - - case types.IsFloat: - val = r.mpfloat(b) - - case types.IsComplex: - re := r.mpfloat(b) - im := r.mpfloat(b) - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - default: - if b.Kind() == types.Invalid { - val = constant.MakeUnknown() - return - } - errorf("unexpected type %v", typ) // panics - panic("unreachable") - } - - return -} - -func intSize(b *types.Basic) (signed bool, maxBytes uint) { - if (b.Info() & types.IsUntyped) != 0 { - return true, 64 - } - - switch b.Kind() { - case types.Float32, types.Complex64: - return true, 3 - case types.Float64, types.Complex128: - return true, 7 - } - - signed = (b.Info() & types.IsUnsigned) == 0 - switch b.Kind() { - case types.Int8, types.Uint8: - maxBytes = 1 - case types.Int16, types.Uint16: - maxBytes = 2 - case types.Int32, types.Uint32: - maxBytes = 4 - default: - maxBytes = 8 - } - - return -} - -func (r *importReader) mpint(b *types.Basic) constant.Value { - signed, maxBytes := intSize(b) - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - n, _ := r.declReader.ReadByte() - if uint(n) < maxSmall { - v := int64(n) - if signed { - v >>= 1 - if n&1 != 0 { - v = ^v - } - } - return constant.MakeInt64(v) - } - - v := -n - if signed { - v = -(n &^ 1) >> 1 - } - if v < 1 || uint(v) > maxBytes { - errorf("weird decoding: %v, %v => %v", n, signed, v) - } - - buf := make([]byte, v) - io.ReadFull(&r.declReader, buf) - - // convert to little endian - // TODO(gri) go/constant should have a more direct conversion function - // (e.g., once it supports a big.Float based implementation) - for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 { - buf[i], buf[j] = buf[j], buf[i] - } - - x := constant.MakeFromBytes(buf) - if signed && n&1 != 0 { - x = constant.UnaryOp(token.SUB, x, 0) - } - return x -} - -func (r *importReader) mpfloat(b *types.Basic) constant.Value { - x := r.mpint(b) - if constant.Sign(x) == 0 { - return x - } - - exp := r.int64() - switch { - case exp > 0: - x = constant.Shift(x, token.SHL, uint(exp)) - // Ensure that the imported Kind is Float, else this constant may run into - // bitsize limits on overlarge integers. Eventually we can instead adopt - // the approach of CL 288632, but that CL relies on go/constant APIs that - // were introduced in go1.13. - // - // TODO(rFindley): sync the logic here with tip Go once we no longer - // support go1.12. - x = constant.ToFloat(x) - case exp < 0: - d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) - x = constant.BinaryOp(x, token.QUO, d) - } - return x -} - -func (r *importReader) ident() string { - return r.string() -} - -func (r *importReader) qualifiedIdent() (*types.Package, string) { - name := r.string() - pkg := r.pkg() - return pkg, name -} - -func (r *importReader) pos() token.Pos { - if r.p.exportVersion >= iexportVersionPosCol { - r.posv1() - } else { - r.posv0() - } - - if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { - return token.NoPos - } - return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) -} - -func (r *importReader) posv0() { - delta := r.int64() - if delta != deltaNewFile { - r.prevLine += delta - } else if l := r.int64(); l == -1 { - r.prevLine += deltaNewFile - } else { - r.prevFile = r.string() - r.prevLine = l - } -} - -func (r *importReader) posv1() { - delta := r.int64() - r.prevColumn += delta >> 1 - if delta&1 != 0 { - delta = r.int64() - r.prevLine += delta >> 1 - if delta&1 != 0 { - r.prevFile = r.string() - } - } -} - -func (r *importReader) typ() types.Type { - return r.p.typAt(r.uint64(), nil) -} - -func isInterface(t types.Type) bool { - _, ok := t.(*types.Interface) - return ok -} - -func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } -func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } - -func (r *importReader) doType(base *types.Named) types.Type { - switch k := r.kind(); k { - default: - errorf("unexpected kind tag in %q: %v", r.p.ipath, k) - return nil - - case definedType: - pkg, name := r.qualifiedIdent() - r.p.doDecl(pkg, name) - return pkg.Scope().Lookup(name).(*types.TypeName).Type() - case pointerType: - return types.NewPointer(r.typ()) - case sliceType: - return types.NewSlice(r.typ()) - case arrayType: - n := r.uint64() - return types.NewArray(r.typ(), int64(n)) - case chanType: - dir := chanDir(int(r.uint64())) - return types.NewChan(dir, r.typ()) - case mapType: - return types.NewMap(r.typ(), r.typ()) - case signatureType: - r.currPkg = r.pkg() - return r.signature(nil) - - case structType: - r.currPkg = r.pkg() - - fields := make([]*types.Var, r.uint64()) - tags := make([]string, len(fields)) - for i := range fields { - fpos := r.pos() - fname := r.ident() - ftyp := r.typ() - emb := r.bool() - tag := r.string() - - fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb) - tags[i] = tag - } - return types.NewStruct(fields, tags) - - case interfaceType: - r.currPkg = r.pkg() - - embeddeds := make([]types.Type, r.uint64()) - for i := range embeddeds { - _ = r.pos() - embeddeds[i] = r.typ() - } - - methods := make([]*types.Func, r.uint64()) - for i := range methods { - mpos := r.pos() - mname := r.ident() - - // TODO(mdempsky): Matches bimport.go, but I - // don't agree with this. - var recv *types.Var - if base != nil { - recv = types.NewVar(token.NoPos, r.currPkg, "", base) - } - - msig := r.signature(recv) - methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig) - } - - typ := newInterface(methods, embeddeds) - r.p.interfaceList = append(r.p.interfaceList, typ) - return typ - - case typeParamType: - if r.p.exportVersion < iexportVersionGenerics { - errorf("unexpected type param type") - } - pkg, name := r.qualifiedIdent() - id := ident{pkg.Name(), name} - if t, ok := r.p.tparamIndex[id]; ok { - // We're already in the process of importing this typeparam. - return t - } - // Otherwise, import the definition of the typeparam now. - r.p.doDecl(pkg, name) - return r.p.tparamIndex[id] - - case instanceType: - if r.p.exportVersion < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - // pos does not matter for instances: they are positioned on the original - // type. - _ = r.pos() - len := r.uint64() - targs := make([]types.Type, len) - for i := range targs { - targs[i] = r.typ() - } - baseType := r.typ() - // The imported instantiated type doesn't include any methods, so - // we must always use the methods of the base (orig) type. - // TODO provide a non-nil *Environment - t, _ := typeparams.Instantiate(nil, baseType, targs, false) - return t - - case unionType: - if r.p.exportVersion < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - terms := make([]*typeparams.Term, r.uint64()) - for i := range terms { - terms[i] = typeparams.NewTerm(r.bool(), r.typ()) - } - return typeparams.NewUnion(terms) - } -} - -func (r *importReader) kind() itag { - return itag(r.uint64()) -} - -func (r *importReader) signature(recv *types.Var) *types.Signature { - params := r.paramList() - results := r.paramList() - variadic := params.Len() > 0 && r.bool() - return types.NewSignature(recv, params, results, variadic) -} - -func (r *importReader) tparamList() []*typeparams.TypeParam { - n := r.uint64() - if n == 0 { - return nil - } - xs := make([]*typeparams.TypeParam, n) - for i := range xs { - // Note: the standard library importer is tolerant of nil types here, - // though would panic in SetTypeParams. - xs[i] = r.typ().(*typeparams.TypeParam) - } - return xs -} - -func (r *importReader) paramList() *types.Tuple { - xs := make([]*types.Var, r.uint64()) - for i := range xs { - xs[i] = r.param() - } - return types.NewTuple(xs...) -} - -func (r *importReader) param() *types.Var { - pos := r.pos() - name := r.ident() - typ := r.typ() - return types.NewParam(pos, r.currPkg, name, typ) -} - -func (r *importReader) bool() bool { - return r.uint64() != 0 -} - -func (r *importReader) int64() int64 { - n, err := binary.ReadVarint(&r.declReader) - if err != nil { - errorf("readVarint: %v", err) - } - return n -} - -func (r *importReader) uint64() uint64 { - n, err := binary.ReadUvarint(&r.declReader) - if err != nil { - errorf("readUvarint: %v", err) - } - return n -} - -func (r *importReader) byte() byte { - x, err := r.declReader.ReadByte() - if err != nil { - errorf("declReader.ReadByte: %v", err) - } - return x -} - -func baseType(typ types.Type) *types.Named { - // pointer receivers are never types.Named types - if p, _ := typ.(*types.Pointer); p != nil { - typ = p.Elem() - } - // receiver base types are always (possibly generic) types.Named types - n, _ := typ.(*types.Named) - return n -} - -func parseSubscript(name string) (string, uint64) { - // Extract the subscript value from the type param name. We export - // and import the subscript value, so that all type params have - // unique names. - sub := uint64(0) - startsub := -1 - for i, r := range name { - if '₀' <= r && r < '₀'+10 { - if startsub == -1 { - startsub = i - } - sub = sub*10 + uint64(r-'₀') - } - } - if startsub >= 0 { - name = name[:startsub] - } - return name, sub -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go deleted file mode 100644 index 8b163e3d05..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.11 -// +build !go1.11 - -package gcimporter - -import "go/types" - -func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { - named := make([]*types.Named, len(embeddeds)) - for i, e := range embeddeds { - var ok bool - named[i], ok = e.(*types.Named) - if !ok { - panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") - } - } - return types.NewInterface(methods, named) -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go deleted file mode 100644 index 49984f40fd..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.11 -// +build go1.11 - -package gcimporter - -import "go/types" - -func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { - return types.NewInterfaceType(methods, embeddeds) -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/support_go117.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/support_go117.go deleted file mode 100644 index 817a147ef0..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/support_go117.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !typeparams || !go1.18 -// +build !typeparams !go1.18 - -package gcimporter - -import "go/types" - -const iexportVersion = iexportVersionGo1_11 - -func additionalPredeclared() []types.Type { - return nil -} diff --git a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/support_go118.go b/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/support_go118.go deleted file mode 100644 index e6b81fc50e..0000000000 --- a/ibm/vendor/golang.org/x/tools/go/internal/gcimporter/support_go118.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build typeparams && go1.18 -// +build typeparams,go1.18 - -package gcimporter - -import "go/types" - -const iexportVersion = iexportVersionGenerics - -// additionalPredeclared returns additional predeclared types in go.1.18. -func additionalPredeclared() []types.Type { - return []types.Type{ - // comparable - types.Universe.Lookup("comparable").Type(), - } -} diff --git a/ibm/vendor/golang.org/x/tools/internal/event/core/event.go b/ibm/vendor/golang.org/x/tools/internal/event/core/event.go deleted file mode 100644 index a6cf0e64a4..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/core/event.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package core provides support for event based telemetry. -package core - -import ( - "fmt" - "time" - - "golang.org/x/tools/internal/event/label" -) - -// Event holds the information about an event of note that occurred. -type Event struct { - at time.Time - - // As events are often on the stack, storing the first few labels directly - // in the event can avoid an allocation at all for the very common cases of - // simple events. - // The length needs to be large enough to cope with the majority of events - // but no so large as to cause undue stack pressure. - // A log message with two values will use 3 labels (one for each value and - // one for the message itself). - - static [3]label.Label // inline storage for the first few labels - dynamic []label.Label // dynamically sized storage for remaining labels -} - -// eventLabelMap implements label.Map for a the labels of an Event. -type eventLabelMap struct { - event Event -} - -func (ev Event) At() time.Time { return ev.at } - -func (ev Event) Format(f fmt.State, r rune) { - if !ev.at.IsZero() { - fmt.Fprint(f, ev.at.Format("2006/01/02 15:04:05 ")) - } - for index := 0; ev.Valid(index); index++ { - if l := ev.Label(index); l.Valid() { - fmt.Fprintf(f, "\n\t%v", l) - } - } -} - -func (ev Event) Valid(index int) bool { - return index >= 0 && index < len(ev.static)+len(ev.dynamic) -} - -func (ev Event) Label(index int) label.Label { - if index < len(ev.static) { - return ev.static[index] - } - return ev.dynamic[index-len(ev.static)] -} - -func (ev Event) Find(key label.Key) label.Label { - for _, l := range ev.static { - if l.Key() == key { - return l - } - } - for _, l := range ev.dynamic { - if l.Key() == key { - return l - } - } - return label.Label{} -} - -func MakeEvent(static [3]label.Label, labels []label.Label) Event { - return Event{ - static: static, - dynamic: labels, - } -} - -// CloneEvent event returns a copy of the event with the time adjusted to at. -func CloneEvent(ev Event, at time.Time) Event { - ev.at = at - return ev -} diff --git a/ibm/vendor/golang.org/x/tools/internal/event/core/export.go b/ibm/vendor/golang.org/x/tools/internal/event/core/export.go deleted file mode 100644 index 05f3a9a579..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/core/export.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - "sync/atomic" - "time" - "unsafe" - - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, Event, label.Map) context.Context - -var ( - exporter unsafe.Pointer -) - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - p := unsafe.Pointer(&e) - if e == nil { - // &e is always valid, and so p is always valid, but for the early abort - // of ProcessEvent to be efficient it needs to make the nil check on the - // pointer without having to dereference it, so we make the nil function - // also a nil pointer - p = nil - } - atomic.StorePointer(&exporter, p) -} - -// deliver is called to deliver an event to the supplied exporter. -// it will fill in the time. -func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { - // add the current time to the event - ev.at = time.Now() - // hand the event off to the current exporter - return exporter(ctx, ev, ev) -} - -// Export is called to deliver an event to the global exporter if set. -func Export(ctx context.Context, ev Event) context.Context { - // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) - if exporterPtr == nil { - return ctx - } - return deliver(ctx, *exporterPtr, ev) -} - -// ExportPair is called to deliver a start event to the supplied exporter. -// It also returns a function that will deliver the end event to the same -// exporter. -// It will fill in the time. -func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { - // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) - if exporterPtr == nil { - return ctx, func() {} - } - ctx = deliver(ctx, *exporterPtr, begin) - return ctx, func() { deliver(ctx, *exporterPtr, end) } -} diff --git a/ibm/vendor/golang.org/x/tools/internal/event/core/fast.go b/ibm/vendor/golang.org/x/tools/internal/event/core/fast.go deleted file mode 100644 index 06c1d4615e..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/core/fast.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Log1 takes a message and one label delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log1(ctx context.Context, message string, t1 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - }, nil)) -} - -// Log2 takes a message and two labels and delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - t2, - }, nil)) -} - -// Metric1 sends a label event to the exporter with the supplied labels. -func Metric1(ctx context.Context, t1 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - }, nil)) -} - -// Metric2 sends a label event to the exporter with the supplied labels. -func Metric2(ctx context.Context, t1, t2 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - t2, - }, nil)) -} - -// Start1 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// Start2 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - t2, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/event/doc.go b/ibm/vendor/golang.org/x/tools/internal/event/doc.go deleted file mode 100644 index 5dc6e6babe..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package event provides a set of packages that cover the main -// concepts of telemetry in an implementation agnostic way. -package event diff --git a/ibm/vendor/golang.org/x/tools/internal/event/event.go b/ibm/vendor/golang.org/x/tools/internal/event/event.go deleted file mode 100644 index 4d55e577d1..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/event.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package event - -import ( - "context" - - "golang.org/x/tools/internal/event/core" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, core.Event, label.Map) context.Context - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - core.SetExporter(core.Exporter(e)) -} - -// Log takes a message and a label list and combines them into a single event -// before delivering them to the exporter. -func Log(ctx context.Context, message string, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - }, labels)) -} - -// IsLog returns true if the event was built by the Log function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLog(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg -} - -// Error takes a message and a label list and combines them into a single event -// before delivering them to the exporter. It captures the error in the -// delivered event. -func Error(ctx context.Context, message string, err error, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - keys.Err.Of(err), - }, labels)) -} - -// IsError returns true if the event was built by the Error function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsError(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg && - ev.Label(1).Key() == keys.Err -} - -// Metric sends a label event to the exporter with the supplied labels. -func Metric(ctx context.Context, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Metric.New(), - }, labels)) -} - -// IsMetric returns true if the event was built by the Metric function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsMetric(ev core.Event) bool { - return ev.Label(0).Key() == keys.Metric -} - -// Label sends a label event to the exporter with the supplied labels. -func Label(ctx context.Context, labels ...label.Label) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Label.New(), - }, labels)) -} - -// IsLabel returns true if the event was built by the Label function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLabel(ev core.Event) bool { - return ev.Label(0).Key() == keys.Label -} - -// Start sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func()) { - return core.ExportPair(ctx, - core.MakeEvent([3]label.Label{ - keys.Start.Of(name), - }, labels), - core.MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// IsStart returns true if the event was built by the Start function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsStart(ev core.Event) bool { - return ev.Label(0).Key() == keys.Start -} - -// IsEnd returns true if the event was built by the End function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsEnd(ev core.Event) bool { - return ev.Label(0).Key() == keys.End -} - -// Detach returns a context without an associated span. -// This allows the creation of spans that are not children of the current span. -func Detach(ctx context.Context) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Detach.New(), - }, nil)) -} - -// IsDetach returns true if the event was built by the Detach function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsDetach(ev core.Event) bool { - return ev.Label(0).Key() == keys.Detach -} diff --git a/ibm/vendor/golang.org/x/tools/internal/event/keys/keys.go b/ibm/vendor/golang.org/x/tools/internal/event/keys/keys.go deleted file mode 100644 index a02206e301..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/keys/keys.go +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "fmt" - "io" - "math" - "strconv" - - "golang.org/x/tools/internal/event/label" -) - -// Value represents a key for untyped values. -type Value struct { - name string - description string -} - -// New creates a new Key for untyped values. -func New(name, description string) *Value { - return &Value{name: name, description: description} -} - -func (k *Value) Name() string { return k.name } -func (k *Value) Description() string { return k.description } - -func (k *Value) Format(w io.Writer, buf []byte, l label.Label) { - fmt.Fprint(w, k.From(l)) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Value) Get(lm label.Map) interface{} { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From can be used to get a value from a Label. -func (k *Value) From(t label.Label) interface{} { return t.UnpackValue() } - -// Of creates a new Label with this key and the supplied value. -func (k *Value) Of(value interface{}) label.Label { return label.OfValue(k, value) } - -// Tag represents a key for tagging labels that have no value. -// These are used when the existence of the label is the entire information it -// carries, such as marking events to be of a specific kind, or from a specific -// package. -type Tag struct { - name string - description string -} - -// NewTag creates a new Key for tagging labels. -func NewTag(name, description string) *Tag { - return &Tag{name: name, description: description} -} - -func (k *Tag) Name() string { return k.name } -func (k *Tag) Description() string { return k.description } - -func (k *Tag) Format(w io.Writer, buf []byte, l label.Label) {} - -// New creates a new Label with this key. -func (k *Tag) New() label.Label { return label.OfValue(k, nil) } - -// Int represents a key -type Int struct { - name string - description string -} - -// NewInt creates a new Key for int values. -func NewInt(name, description string) *Int { - return &Int{name: name, description: description} -} - -func (k *Int) Name() string { return k.name } -func (k *Int) Description() string { return k.description } - -func (k *Int) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int) Of(v int) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int) Get(lm label.Map) int { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int) From(t label.Label) int { return int(t.Unpack64()) } - -// Int8 represents a key -type Int8 struct { - name string - description string -} - -// NewInt8 creates a new Key for int8 values. -func NewInt8(name, description string) *Int8 { - return &Int8{name: name, description: description} -} - -func (k *Int8) Name() string { return k.name } -func (k *Int8) Description() string { return k.description } - -func (k *Int8) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int8) Of(v int8) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int8) Get(lm label.Map) int8 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int8) From(t label.Label) int8 { return int8(t.Unpack64()) } - -// Int16 represents a key -type Int16 struct { - name string - description string -} - -// NewInt16 creates a new Key for int16 values. -func NewInt16(name, description string) *Int16 { - return &Int16{name: name, description: description} -} - -func (k *Int16) Name() string { return k.name } -func (k *Int16) Description() string { return k.description } - -func (k *Int16) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int16) Of(v int16) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int16) Get(lm label.Map) int16 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int16) From(t label.Label) int16 { return int16(t.Unpack64()) } - -// Int32 represents a key -type Int32 struct { - name string - description string -} - -// NewInt32 creates a new Key for int32 values. -func NewInt32(name, description string) *Int32 { - return &Int32{name: name, description: description} -} - -func (k *Int32) Name() string { return k.name } -func (k *Int32) Description() string { return k.description } - -func (k *Int32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int32) Of(v int32) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int32) Get(lm label.Map) int32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int32) From(t label.Label) int32 { return int32(t.Unpack64()) } - -// Int64 represents a key -type Int64 struct { - name string - description string -} - -// NewInt64 creates a new Key for int64 values. -func NewInt64(name, description string) *Int64 { - return &Int64{name: name, description: description} -} - -func (k *Int64) Name() string { return k.name } -func (k *Int64) Description() string { return k.description } - -func (k *Int64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, k.From(l), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int64) Of(v int64) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int64) Get(lm label.Map) int64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int64) From(t label.Label) int64 { return int64(t.Unpack64()) } - -// UInt represents a key -type UInt struct { - name string - description string -} - -// NewUInt creates a new Key for uint values. -func NewUInt(name, description string) *UInt { - return &UInt{name: name, description: description} -} - -func (k *UInt) Name() string { return k.name } -func (k *UInt) Description() string { return k.description } - -func (k *UInt) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt) Of(v uint) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt) Get(lm label.Map) uint { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt) From(t label.Label) uint { return uint(t.Unpack64()) } - -// UInt8 represents a key -type UInt8 struct { - name string - description string -} - -// NewUInt8 creates a new Key for uint8 values. -func NewUInt8(name, description string) *UInt8 { - return &UInt8{name: name, description: description} -} - -func (k *UInt8) Name() string { return k.name } -func (k *UInt8) Description() string { return k.description } - -func (k *UInt8) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt8) Of(v uint8) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt8) Get(lm label.Map) uint8 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt8) From(t label.Label) uint8 { return uint8(t.Unpack64()) } - -// UInt16 represents a key -type UInt16 struct { - name string - description string -} - -// NewUInt16 creates a new Key for uint16 values. -func NewUInt16(name, description string) *UInt16 { - return &UInt16{name: name, description: description} -} - -func (k *UInt16) Name() string { return k.name } -func (k *UInt16) Description() string { return k.description } - -func (k *UInt16) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt16) Of(v uint16) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt16) Get(lm label.Map) uint16 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt16) From(t label.Label) uint16 { return uint16(t.Unpack64()) } - -// UInt32 represents a key -type UInt32 struct { - name string - description string -} - -// NewUInt32 creates a new Key for uint32 values. -func NewUInt32(name, description string) *UInt32 { - return &UInt32{name: name, description: description} -} - -func (k *UInt32) Name() string { return k.name } -func (k *UInt32) Description() string { return k.description } - -func (k *UInt32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt32) Of(v uint32) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt32) Get(lm label.Map) uint32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt32) From(t label.Label) uint32 { return uint32(t.Unpack64()) } - -// UInt64 represents a key -type UInt64 struct { - name string - description string -} - -// NewUInt64 creates a new Key for uint64 values. -func NewUInt64(name, description string) *UInt64 { - return &UInt64{name: name, description: description} -} - -func (k *UInt64) Name() string { return k.name } -func (k *UInt64) Description() string { return k.description } - -func (k *UInt64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, k.From(l), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt64) Of(v uint64) label.Label { return label.Of64(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt64) Get(lm label.Map) uint64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt64) From(t label.Label) uint64 { return t.Unpack64() } - -// Float32 represents a key -type Float32 struct { - name string - description string -} - -// NewFloat32 creates a new Key for float32 values. -func NewFloat32(name, description string) *Float32 { - return &Float32{name: name, description: description} -} - -func (k *Float32) Name() string { return k.name } -func (k *Float32) Description() string { return k.description } - -func (k *Float32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendFloat(buf, float64(k.From(l)), 'E', -1, 32)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float32) Of(v float32) label.Label { - return label.Of64(k, uint64(math.Float32bits(v))) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Float32) Get(lm label.Map) float32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Float32) From(t label.Label) float32 { - return math.Float32frombits(uint32(t.Unpack64())) -} - -// Float64 represents a key -type Float64 struct { - name string - description string -} - -// NewFloat64 creates a new Key for int64 values. -func NewFloat64(name, description string) *Float64 { - return &Float64{name: name, description: description} -} - -func (k *Float64) Name() string { return k.name } -func (k *Float64) Description() string { return k.description } - -func (k *Float64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendFloat(buf, k.From(l), 'E', -1, 64)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float64) Of(v float64) label.Label { - return label.Of64(k, math.Float64bits(v)) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Float64) Get(lm label.Map) float64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Float64) From(t label.Label) float64 { - return math.Float64frombits(t.Unpack64()) -} - -// String represents a key -type String struct { - name string - description string -} - -// NewString creates a new Key for int64 values. -func NewString(name, description string) *String { - return &String{name: name, description: description} -} - -func (k *String) Name() string { return k.name } -func (k *String) Description() string { return k.description } - -func (k *String) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendQuote(buf, k.From(l))) -} - -// Of creates a new Label with this key and the supplied value. -func (k *String) Of(v string) label.Label { return label.OfString(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *String) Get(lm label.Map) string { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return "" -} - -// From can be used to get a value from a Label. -func (k *String) From(t label.Label) string { return t.UnpackString() } - -// Boolean represents a key -type Boolean struct { - name string - description string -} - -// NewBoolean creates a new Key for bool values. -func NewBoolean(name, description string) *Boolean { - return &Boolean{name: name, description: description} -} - -func (k *Boolean) Name() string { return k.name } -func (k *Boolean) Description() string { return k.description } - -func (k *Boolean) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendBool(buf, k.From(l))) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Boolean) Of(v bool) label.Label { - if v { - return label.Of64(k, 1) - } - return label.Of64(k, 0) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Boolean) Get(lm label.Map) bool { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return false -} - -// From can be used to get a value from a Label. -func (k *Boolean) From(t label.Label) bool { return t.Unpack64() > 0 } - -// Error represents a key -type Error struct { - name string - description string -} - -// NewError creates a new Key for int64 values. -func NewError(name, description string) *Error { - return &Error{name: name, description: description} -} - -func (k *Error) Name() string { return k.name } -func (k *Error) Description() string { return k.description } - -func (k *Error) Format(w io.Writer, buf []byte, l label.Label) { - io.WriteString(w, k.From(l).Error()) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Error) Of(v error) label.Label { return label.OfValue(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Error) Get(lm label.Map) error { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From can be used to get a value from a Label. -func (k *Error) From(t label.Label) error { - err, _ := t.UnpackValue().(error) - return err -} diff --git a/ibm/vendor/golang.org/x/tools/internal/event/keys/standard.go b/ibm/vendor/golang.org/x/tools/internal/event/keys/standard.go deleted file mode 100644 index 7e95866592..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/keys/standard.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -var ( - // Msg is a key used to add message strings to label lists. - Msg = NewString("message", "a readable message") - // Label is a key used to indicate an event adds labels to the context. - Label = NewTag("label", "a label context marker") - // Start is used for things like traces that have a name. - Start = NewString("start", "span start") - // Metric is a key used to indicate an event records metrics. - End = NewTag("end", "a span end marker") - // Metric is a key used to indicate an event records metrics. - Detach = NewTag("detach", "a span detach marker") - // Err is a key used to add error values to label lists. - Err = NewError("error", "an error that occurred") - // Metric is a key used to indicate an event records metrics. - Metric = NewTag("metric", "a metric event marker") -) diff --git a/ibm/vendor/golang.org/x/tools/internal/event/label/label.go b/ibm/vendor/golang.org/x/tools/internal/event/label/label.go deleted file mode 100644 index 0f526e1f9a..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/event/label/label.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package label - -import ( - "fmt" - "io" - "reflect" - "unsafe" -) - -// Key is used as the identity of a Label. -// Keys are intended to be compared by pointer only, the name should be unique -// for communicating with external systems, but it is not required or enforced. -type Key interface { - // Name returns the key name. - Name() string - // Description returns a string that can be used to describe the value. - Description() string - - // Format is used in formatting to append the value of the label to the - // supplied buffer. - // The formatter may use the supplied buf as a scratch area to avoid - // allocations. - Format(w io.Writer, buf []byte, l Label) -} - -// Label holds a key and value pair. -// It is normally used when passing around lists of labels. -type Label struct { - key Key - packed uint64 - untyped interface{} -} - -// Map is the interface to a collection of Labels indexed by key. -type Map interface { - // Find returns the label that matches the supplied key. - Find(key Key) Label -} - -// List is the interface to something that provides an iterable -// list of labels. -// Iteration should start from 0 and continue until Valid returns false. -type List interface { - // Valid returns true if the index is within range for the list. - // It does not imply the label at that index will itself be valid. - Valid(index int) bool - // Label returns the label at the given index. - Label(index int) Label -} - -// list implements LabelList for a list of Labels. -type list struct { - labels []Label -} - -// filter wraps a LabelList filtering out specific labels. -type filter struct { - keys []Key - underlying List -} - -// listMap implements LabelMap for a simple list of labels. -type listMap struct { - labels []Label -} - -// mapChain implements LabelMap for a list of underlying LabelMap. -type mapChain struct { - maps []Map -} - -// OfValue creates a new label from the key and value. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfValue(k Key, value interface{}) Label { return Label{key: k, untyped: value} } - -// UnpackValue assumes the label was built using LabelOfValue and returns the value -// that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackValue() interface{} { return t.untyped } - -// Of64 creates a new label from a key and a uint64. This is often -// used for non uint64 values that can be packed into a uint64. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func Of64(k Key, v uint64) Label { return Label{key: k, packed: v} } - -// Unpack64 assumes the label was built using LabelOf64 and returns the value that -// was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) Unpack64() uint64 { return t.packed } - -type stringptr unsafe.Pointer - -// OfString creates a new label from a key and a string. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfString(k Key, v string) Label { - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - return Label{ - key: k, - packed: uint64(hdr.Len), - untyped: stringptr(hdr.Data), - } -} - -// UnpackString assumes the label was built using LabelOfString and returns the -// value that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackString() string { - var v string - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - hdr.Data = uintptr(t.untyped.(stringptr)) - hdr.Len = int(t.packed) - return v -} - -// Valid returns true if the Label is a valid one (it has a key). -func (t Label) Valid() bool { return t.key != nil } - -// Key returns the key of this Label. -func (t Label) Key() Key { return t.key } - -// Format is used for debug printing of labels. -func (t Label) Format(f fmt.State, r rune) { - if !t.Valid() { - io.WriteString(f, `nil`) - return - } - io.WriteString(f, t.Key().Name()) - io.WriteString(f, "=") - var buf [128]byte - t.Key().Format(f, buf[:0], t) -} - -func (l *list) Valid(index int) bool { - return index >= 0 && index < len(l.labels) -} - -func (l *list) Label(index int) Label { - return l.labels[index] -} - -func (f *filter) Valid(index int) bool { - return f.underlying.Valid(index) -} - -func (f *filter) Label(index int) Label { - l := f.underlying.Label(index) - for _, f := range f.keys { - if l.Key() == f { - return Label{} - } - } - return l -} - -func (lm listMap) Find(key Key) Label { - for _, l := range lm.labels { - if l.Key() == key { - return l - } - } - return Label{} -} - -func (c mapChain) Find(key Key) Label { - for _, src := range c.maps { - l := src.Find(key) - if l.Valid() { - return l - } - } - return Label{} -} - -var emptyList = &list{} - -func NewList(labels ...Label) List { - if len(labels) == 0 { - return emptyList - } - return &list{labels: labels} -} - -func Filter(l List, keys ...Key) List { - if len(keys) == 0 { - return l - } - return &filter{keys: keys, underlying: l} -} - -func NewMap(labels ...Label) Map { - return listMap{labels: labels} -} - -func MergeMaps(srcs ...Map) Map { - var nonNil []Map - for _, src := range srcs { - if src != nil { - nonNil = append(nonNil, src) - } - } - if len(nonNil) == 1 { - return nonNil[0] - } - return mapChain{maps: nonNil} -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go deleted file mode 100644 index 9887f7e7a0..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package fastwalk provides a faster version of filepath.Walk for file system -// scanning tools. -package fastwalk - -import ( - "errors" - "os" - "path/filepath" - "runtime" - "sync" -) - -// ErrTraverseLink is used as a return value from WalkFuncs to indicate that the -// symlink named in the call may be traversed. -var ErrTraverseLink = errors.New("fastwalk: traverse symlink, assuming target is a directory") - -// ErrSkipFiles is a used as a return value from WalkFuncs to indicate that the -// callback should not be called for any other files in the current directory. -// Child directories will still be traversed. -var ErrSkipFiles = errors.New("fastwalk: skip remaining files in directory") - -// Walk is a faster implementation of filepath.Walk. -// -// filepath.Walk's design necessarily calls os.Lstat on each file, -// even if the caller needs less info. -// Many tools need only the type of each file. -// On some platforms, this information is provided directly by the readdir -// system call, avoiding the need to stat each file individually. -// fastwalk_unix.go contains a fork of the syscall routines. -// -// See golang.org/issue/16399 -// -// Walk walks the file tree rooted at root, calling walkFn for -// each file or directory in the tree, including root. -// -// If fastWalk returns filepath.SkipDir, the directory is skipped. -// -// Unlike filepath.Walk: -// * file stat calls must be done by the user. -// The only provided metadata is the file type, which does not include -// any permission bits. -// * multiple goroutines stat the filesystem concurrently. The provided -// walkFn must be safe for concurrent use. -// * fastWalk can follow symlinks if walkFn returns the TraverseLink -// sentinel error. It is the walkFn's responsibility to prevent -// fastWalk from going into symlink cycles. -func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - // TODO(bradfitz): make numWorkers configurable? We used a - // minimum of 4 to give the kernel more info about multiple - // things we want, in hopes its I/O scheduling can take - // advantage of that. Hopefully most are in cache. Maybe 4 is - // even too low of a minimum. Profile more. - numWorkers := 4 - if n := runtime.NumCPU(); n > numWorkers { - numWorkers = n - } - - // Make sure to wait for all workers to finish, otherwise - // walkFn could still be called after returning. This Wait call - // runs after close(e.donec) below. - var wg sync.WaitGroup - defer wg.Wait() - - w := &walker{ - fn: walkFn, - enqueuec: make(chan walkItem, numWorkers), // buffered for performance - workc: make(chan walkItem, numWorkers), // buffered for performance - donec: make(chan struct{}), - - // buffered for correctness & not leaking goroutines: - resc: make(chan error, numWorkers), - } - defer close(w.donec) - - for i := 0; i < numWorkers; i++ { - wg.Add(1) - go w.doWork(&wg) - } - todo := []walkItem{{dir: root}} - out := 0 - for { - workc := w.workc - var workItem walkItem - if len(todo) == 0 { - workc = nil - } else { - workItem = todo[len(todo)-1] - } - select { - case workc <- workItem: - todo = todo[:len(todo)-1] - out++ - case it := <-w.enqueuec: - todo = append(todo, it) - case err := <-w.resc: - out-- - if err != nil { - return err - } - if out == 0 && len(todo) == 0 { - // It's safe to quit here, as long as the buffered - // enqueue channel isn't also readable, which might - // happen if the worker sends both another unit of - // work and its result before the other select was - // scheduled and both w.resc and w.enqueuec were - // readable. - select { - case it := <-w.enqueuec: - todo = append(todo, it) - default: - return nil - } - } - } - } -} - -// doWork reads directories as instructed (via workc) and runs the -// user's callback function. -func (w *walker) doWork(wg *sync.WaitGroup) { - defer wg.Done() - for { - select { - case <-w.donec: - return - case it := <-w.workc: - select { - case <-w.donec: - return - case w.resc <- w.walk(it.dir, !it.callbackDone): - } - } - } -} - -type walker struct { - fn func(path string, typ os.FileMode) error - - donec chan struct{} // closed on fastWalk's return - workc chan walkItem // to workers - enqueuec chan walkItem // from workers - resc chan error // from workers -} - -type walkItem struct { - dir string - callbackDone bool // callback already called; don't do it again -} - -func (w *walker) enqueue(it walkItem) { - select { - case w.enqueuec <- it: - case <-w.donec: - } -} - -func (w *walker) onDirEnt(dirName, baseName string, typ os.FileMode) error { - joined := dirName + string(os.PathSeparator) + baseName - if typ == os.ModeDir { - w.enqueue(walkItem{dir: joined}) - return nil - } - - err := w.fn(joined, typ) - if typ == os.ModeSymlink { - if err == ErrTraverseLink { - // Set callbackDone so we don't call it twice for both the - // symlink-as-symlink and the symlink-as-directory later: - w.enqueue(walkItem{dir: joined, callbackDone: true}) - return nil - } - if err == filepath.SkipDir { - // Permit SkipDir on symlinks too. - return nil - } - } - return err -} - -func (w *walker) walk(root string, runUserCallback bool) error { - if runUserCallback { - err := w.fn(root, os.ModeDir) - if err == filepath.SkipDir { - return nil - } - if err != nil { - return err - } - } - - return readDir(root, w.onDirEnt) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go deleted file mode 100644 index d58595dbd3..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build freebsd || openbsd || netbsd -// +build freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Fileno) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go deleted file mode 100644 index ea02b9ebfe..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (linux || darwin) && !appengine -// +build linux darwin -// +build !appengine - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Ino) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go deleted file mode 100644 index d5c9c321ed..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build darwin || freebsd || openbsd || netbsd -// +build darwin freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntNamlen(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Namlen) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go deleted file mode 100644 index c82e57df85..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build linux && !appengine -// +build linux,!appengine - -package fastwalk - -import ( - "bytes" - "syscall" - "unsafe" -) - -func direntNamlen(dirent *syscall.Dirent) uint64 { - const fixedHdr = uint16(unsafe.Offsetof(syscall.Dirent{}.Name)) - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - const nameBufLen = uint16(len(nameBuf)) - limit := dirent.Reclen - fixedHdr - if limit > nameBufLen { - limit = nameBufLen - } - nameLen := bytes.IndexByte(nameBuf[:limit], 0) - if nameLen < 0 { - panic("failed to find terminating 0 byte in dirent") - } - return uint64(nameLen) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go deleted file mode 100644 index 085d311600..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build appengine || (!linux && !darwin && !freebsd && !openbsd && !netbsd) -// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd - -package fastwalk - -import ( - "io/ioutil" - "os" -) - -// readDir calls fn for each directory entry in dirName. -// It does not descend into directories or follow symlinks. -// If fn returns a non-nil error, readDir returns with that error -// immediately. -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fis, err := ioutil.ReadDir(dirName) - if err != nil { - return err - } - skipFiles := false - for _, fi := range fis { - if fi.Mode().IsRegular() && skipFiles { - continue - } - if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } - return nil -} diff --git a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go b/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go deleted file mode 100644 index 58bd87841e..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (linux || darwin || freebsd || openbsd || netbsd) && !appengine -// +build linux darwin freebsd openbsd netbsd -// +build !appengine - -package fastwalk - -import ( - "fmt" - "os" - "syscall" - "unsafe" -) - -const blockSize = 8 << 10 - -// unknownFileMode is a sentinel (and bogus) os.FileMode -// value used to represent a syscall.DT_UNKNOWN Dirent.Type. -const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := open(dirName, 0, 0) - if err != nil { - return &os.PathError{Op: "open", Path: dirName, Err: err} - } - defer syscall.Close(fd) - - // The buffer must be at least a block long. - buf := make([]byte, blockSize) // stack-allocated; doesn't escape - bufp := 0 // starting read position in buf - nbuf := 0 // end valid data in buf - skipFiles := false - for { - if bufp >= nbuf { - bufp = 0 - nbuf, err = readDirent(fd, buf) - if err != nil { - return os.NewSyscallError("readdirent", err) - } - if nbuf <= 0 { - return nil - } - } - consumed, name, typ := parseDirEnt(buf[bufp:nbuf]) - bufp += consumed - if name == "" || name == "." || name == ".." { - continue - } - // Fallback for filesystems (like old XFS) that don't - // support Dirent.Type and have DT_UNKNOWN (0) there - // instead. - if typ == unknownFileMode { - fi, err := os.Lstat(dirName + "/" + name) - if err != nil { - // It got deleted in the meantime. - if os.IsNotExist(err) { - continue - } - return err - } - typ = fi.Mode() & os.ModeType - } - if skipFiles && typ.IsRegular() { - continue - } - if err := fn(dirName, name, typ); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } -} - -func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) { - // golang.org/issue/37269 - dirent := &syscall.Dirent{} - copy((*[unsafe.Sizeof(syscall.Dirent{})]byte)(unsafe.Pointer(dirent))[:], buf) - if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v { - panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v)) - } - if len(buf) < int(dirent.Reclen) { - panic(fmt.Sprintf("buf size %d < record length %d", len(buf), dirent.Reclen)) - } - consumed = int(dirent.Reclen) - if direntInode(dirent) == 0 { // File absent in directory. - return - } - switch dirent.Type { - case syscall.DT_REG: - typ = 0 - case syscall.DT_DIR: - typ = os.ModeDir - case syscall.DT_LNK: - typ = os.ModeSymlink - case syscall.DT_BLK: - typ = os.ModeDevice - case syscall.DT_FIFO: - typ = os.ModeNamedPipe - case syscall.DT_SOCK: - typ = os.ModeSocket - case syscall.DT_UNKNOWN: - typ = unknownFileMode - default: - // Skip weird things. - // It's probably a DT_WHT (http://lwn.net/Articles/325369/) - // or something. Revisit if/when this package is moved outside - // of goimports. goimports only cares about regular files, - // symlinks, and directories. - return - } - - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - nameLen := direntNamlen(dirent) - - // Special cases for common things: - if nameLen == 1 && nameBuf[0] == '.' { - name = "." - } else if nameLen == 2 && nameBuf[0] == '.' && nameBuf[1] == '.' { - name = ".." - } else { - name = string(nameBuf[:nameLen]) - } - return -} - -// According to https://golang.org/doc/go1.14#runtime -// A consequence of the implementation of preemption is that on Unix systems, including Linux and macOS -// systems, programs built with Go 1.14 will receive more signals than programs built with earlier releases. -// -// This causes syscall.Open and syscall.ReadDirent sometimes fail with EINTR errors. -// We need to retry in this case. -func open(path string, mode int, perm uint32) (fd int, err error) { - for { - fd, err := syscall.Open(path, mode, perm) - if err != syscall.EINTR { - return fd, err - } - } -} - -func readDirent(fd int, buf []byte) (n int, err error) { - for { - nbuf, err := syscall.ReadDirent(fd, buf) - if err != syscall.EINTR { - return nbuf, err - } - } -} diff --git a/ibm/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/ibm/vendor/golang.org/x/tools/internal/gocommand/invoke.go deleted file mode 100644 index 8659a0c5da..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gocommand is a helper for calling the go command. -package gocommand - -import ( - "bytes" - "context" - "fmt" - exec "golang.org/x/sys/execabs" - "io" - "os" - "regexp" - "strconv" - "strings" - "sync" - "time" - - "golang.org/x/tools/internal/event" -) - -// An Runner will run go command invocations and serialize -// them if it sees a concurrency error. -type Runner struct { - // once guards the runner initialization. - once sync.Once - - // inFlight tracks available workers. - inFlight chan struct{} - - // serialized guards the ability to run a go command serially, - // to avoid deadlocks when claiming workers. - serialized chan struct{} -} - -const maxInFlight = 10 - -func (runner *Runner) initialize() { - runner.once.Do(func() { - runner.inFlight = make(chan struct{}, maxInFlight) - runner.serialized = make(chan struct{}, 1) - }) -} - -// 1.13: go: updates to go.mod needed, but contents have changed -// 1.14: go: updating go.mod: existing contents have changed since last read -var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) - -// Run is a convenience wrapper around RunRaw. -// It returns only stdout and a "friendly" error. -func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) { - stdout, _, friendly, _ := runner.RunRaw(ctx, inv) - return stdout, friendly -} - -// RunPiped runs the invocation serially, always waiting for any concurrent -// invocations to complete first. -func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) error { - _, err := runner.runPiped(ctx, inv, stdout, stderr) - return err -} - -// RunRaw runs the invocation, serializing requests only if they fight over -// go.mod changes. -func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - // Make sure the runner is always initialized. - runner.initialize() - - // First, try to run the go command concurrently. - stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) - - // If we encounter a load concurrency error, we need to retry serially. - if friendlyErr == nil || !modConcurrencyError.MatchString(friendlyErr.Error()) { - return stdout, stderr, friendlyErr, err - } - event.Error(ctx, "Load concurrency error, will retry serially", err) - - // Run serially by calling runPiped. - stdout.Reset() - stderr.Reset() - friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) - return stdout, stderr, friendlyErr, err -} - -func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - // Wait for 1 worker to become available. - select { - case <-ctx.Done(): - return nil, nil, nil, ctx.Err() - case runner.inFlight <- struct{}{}: - defer func() { <-runner.inFlight }() - } - - stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} - friendlyErr, err := inv.runWithFriendlyError(ctx, stdout, stderr) - return stdout, stderr, friendlyErr, err -} - -func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { - // Make sure the runner is always initialized. - runner.initialize() - - // Acquire the serialization lock. This avoids deadlocks between two - // runPiped commands. - select { - case <-ctx.Done(): - return nil, ctx.Err() - case runner.serialized <- struct{}{}: - defer func() { <-runner.serialized }() - } - - // Wait for all in-progress go commands to return before proceeding, - // to avoid load concurrency errors. - for i := 0; i < maxInFlight; i++ { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case runner.inFlight <- struct{}{}: - // Make sure we always "return" any workers we took. - defer func() { <-runner.inFlight }() - } - } - - return inv.runWithFriendlyError(ctx, stdout, stderr) -} - -// An Invocation represents a call to the go command. -type Invocation struct { - Verb string - Args []string - BuildFlags []string - ModFlag string - ModFile string - Overlay string - // If CleanEnv is set, the invocation will run only with the environment - // in Env, not starting with os.Environ. - CleanEnv bool - Env []string - WorkingDir string - Logf func(format string, args ...interface{}) -} - -func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { - rawError = i.run(ctx, stdout, stderr) - if rawError != nil { - friendlyError = rawError - // Check for 'go' executable not being found. - if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - friendlyError = fmt.Errorf("go command required, not found: %v", ee) - } - if ctx.Err() != nil { - friendlyError = ctx.Err() - } - friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) - } - return -} - -func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { - log := i.Logf - if log == nil { - log = func(string, ...interface{}) {} - } - - goArgs := []string{i.Verb} - - appendModFile := func() { - if i.ModFile != "" { - goArgs = append(goArgs, "-modfile="+i.ModFile) - } - } - appendModFlag := func() { - if i.ModFlag != "" { - goArgs = append(goArgs, "-mod="+i.ModFlag) - } - } - appendOverlayFlag := func() { - if i.Overlay != "" { - goArgs = append(goArgs, "-overlay="+i.Overlay) - } - } - - switch i.Verb { - case "env", "version": - goArgs = append(goArgs, i.Args...) - case "mod": - // mod needs the sub-verb before flags. - goArgs = append(goArgs, i.Args[0]) - appendModFile() - goArgs = append(goArgs, i.Args[1:]...) - case "get": - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - goArgs = append(goArgs, i.Args...) - - default: // notably list and build. - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - appendModFlag() - appendOverlayFlag() - goArgs = append(goArgs, i.Args...) - } - cmd := exec.Command("go", goArgs...) - cmd.Stdout = stdout - cmd.Stderr = stderr - // On darwin the cwd gets resolved to the real path, which breaks anything that - // expects the working directory to keep the original path, including the - // go command when dealing with modules. - // The Go stdlib has a special feature where if the cwd and the PWD are the - // same node then it trusts the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go command. - if !i.CleanEnv { - cmd.Env = os.Environ() - } - cmd.Env = append(cmd.Env, i.Env...) - if i.WorkingDir != "" { - cmd.Env = append(cmd.Env, "PWD="+i.WorkingDir) - cmd.Dir = i.WorkingDir - } - defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) - - return runCmdContext(ctx, cmd) -} - -// runCmdContext is like exec.CommandContext except it sends os.Interrupt -// before os.Kill. -func runCmdContext(ctx context.Context, cmd *exec.Cmd) error { - if err := cmd.Start(); err != nil { - return err - } - resChan := make(chan error, 1) - go func() { - resChan <- cmd.Wait() - }() - - select { - case err := <-resChan: - return err - case <-ctx.Done(): - } - // Cancelled. Interrupt and see if it ends voluntarily. - cmd.Process.Signal(os.Interrupt) - select { - case err := <-resChan: - return err - case <-time.After(time.Second): - } - // Didn't shut down in response to interrupt. Kill it hard. - cmd.Process.Kill() - return <-resChan -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - k, v := split[0], split[1] - env[k] = v - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/ibm/vendor/golang.org/x/tools/internal/gocommand/vendor.go deleted file mode 100644 index 5e75bd6d8f..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/gocommand/vendor.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "bytes" - "context" - "fmt" - "os" - "path/filepath" - "regexp" - "strings" - "time" - - "golang.org/x/mod/semver" -) - -// ModuleJSON holds information about a module. -type ModuleJSON struct { - Path string // module path - Version string // module version - Versions []string // available module versions (with -versions) - Replace *ModuleJSON // replaced by this module - Time *time.Time // time version was created - Update *ModuleJSON // available update, if any (with -u) - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module -} - -var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) - -// VendorEnabled reports whether vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { - mainMod, go114, err := getMainModuleAnd114(ctx, inv, r) - if err != nil { - return nil, false, err - } - - // We check the GOFLAGS to see if there is anything overridden or not. - inv.Verb = "env" - inv.Args = []string{"GOFLAGS"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, false, err - } - goflags := string(bytes.TrimSpace(stdout.Bytes())) - matches := modFlagRegexp.FindStringSubmatch(goflags) - var modFlag string - if len(matches) != 0 { - modFlag = matches[1] - } - if modFlag != "" { - // Don't override an explicit '-mod=' argument. - return mainMod, modFlag == "vendor", nil - } - if mainMod == nil || !go114 { - return mainMod, false, nil - } - // Check 1.14's automatic vendor mode. - if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { - if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { - // The Go version is at least 1.14, and a vendor directory exists. - // Set -mod=vendor by default. - return mainMod, true, nil - } - } - return mainMod, false, nil -} - -// getMainModuleAnd114 gets the main module's information and whether the -// go command in use is 1.14+. This is the information needed to figure out -// if vendoring should be enabled. -func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, false, err - } - - lines := strings.Split(stdout.String(), "\n") - if len(lines) < 5 { - return nil, false, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mod := &ModuleJSON{ - Path: lines[0], - Dir: lines[1], - GoMod: lines[2], - GoVersion: lines[3], - Main: true, - } - return mod, lines[4] == "go1.14", nil -} diff --git a/ibm/vendor/golang.org/x/tools/internal/gocommand/version.go b/ibm/vendor/golang.org/x/tools/internal/gocommand/version.go deleted file mode 100644 index 7130436802..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/gocommand/version.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "context" - "fmt" - "strings" -) - -// GoVersion checks the go version by running "go list" with modules off. -// It returns the X in Go 1.X. -func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { - inv.Verb = "list" - inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`, `--`, `unsafe`} - inv.Env = append(append([]string{}, inv.Env...), "GO111MODULE=off") - // Unset any unneeded flags, and remove them from BuildFlags, if they're - // present. - inv.ModFile = "" - inv.ModFlag = "" - var buildFlags []string - for _, flag := range inv.BuildFlags { - // Flags can be prefixed by one or two dashes. - f := strings.TrimPrefix(strings.TrimPrefix(flag, "-"), "-") - if strings.HasPrefix(f, "mod=") || strings.HasPrefix(f, "modfile=") { - continue - } - buildFlags = append(buildFlags, flag) - } - inv.BuildFlags = buildFlags - stdoutBytes, err := r.Run(ctx, inv) - if err != nil { - return 0, err - } - stdout := stdoutBytes.String() - if len(stdout) < 3 { - return 0, fmt.Errorf("bad ReleaseTags output: %q", stdout) - } - // Split up "[go1.1 go1.15]" - tags := strings.Fields(stdout[1 : len(stdout)-2]) - for i := len(tags) - 1; i >= 0; i-- { - var version int - if _, err := fmt.Sscanf(tags[i], "go1.%d", &version); err != nil { - continue - } - return version, nil - } - return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags) -} diff --git a/ibm/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/ibm/vendor/golang.org/x/tools/internal/gopathwalk/walk.go deleted file mode 100644 index 925ff53560..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/gopathwalk/walk.go +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gopathwalk is like filepath.Walk but specialized for finding Go -// packages, particularly in $GOPATH and $GOROOT. -package gopathwalk - -import ( - "bufio" - "bytes" - "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - "strings" - "time" - - "golang.org/x/tools/internal/fastwalk" -) - -// Options controls the behavior of a Walk call. -type Options struct { - // If Logf is non-nil, debug logging is enabled through this function. - Logf func(format string, args ...interface{}) - // Search module caches. Also disables legacy goimports ignore rules. - ModulesEnabled bool -} - -// RootType indicates the type of a Root. -type RootType int - -const ( - RootUnknown RootType = iota - RootGOROOT - RootGOPATH - RootCurrentModule - RootModuleCache - RootOther -) - -// A Root is a starting point for a Walk. -type Root struct { - Path string - Type RootType -} - -// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute -// paths of the containing source directory and the package directory. -// add will be called concurrently. -func Walk(roots []Root, add func(root Root, dir string), opts Options) { - WalkSkip(roots, add, func(Root, string) bool { return false }, opts) -} - -// WalkSkip walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute -// paths of the containing source directory and the package directory. -// For each directory that will be scanned, skip will be called (concurrently) -// with the absolute paths of the containing source directory and the directory. -// If skip returns false on a directory it will be processed. -// add will be called concurrently. -// skip will be called concurrently. -func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root, dir string) bool, opts Options) { - for _, root := range roots { - walkDir(root, add, skip, opts) - } -} - -// walkDir creates a walker and starts fastwalk with this walker. -func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) { - if _, err := os.Stat(root.Path); os.IsNotExist(err) { - if opts.Logf != nil { - opts.Logf("skipping nonexistent directory: %v", root.Path) - } - return - } - start := time.Now() - if opts.Logf != nil { - opts.Logf("gopathwalk: scanning %s", root.Path) - } - w := &walker{ - root: root, - add: add, - skip: skip, - opts: opts, - } - w.init() - if err := fastwalk.Walk(root.Path, w.walk); err != nil { - log.Printf("gopathwalk: scanning directory %v: %v", root.Path, err) - } - - if opts.Logf != nil { - opts.Logf("gopathwalk: scanned %s in %v", root.Path, time.Since(start)) - } -} - -// walker is the callback for fastwalk.Walk. -type walker struct { - root Root // The source directory to scan. - add func(Root, string) // The callback that will be invoked for every possible Go package dir. - skip func(Root, string) bool // The callback that will be invoked for every dir. dir is skipped if it returns true. - opts Options // Options passed to Walk by the user. - - ignoredDirs []os.FileInfo // The ignored directories, loaded from .goimportsignore files. -} - -// init initializes the walker based on its Options -func (w *walker) init() { - var ignoredPaths []string - if w.root.Type == RootModuleCache { - ignoredPaths = []string{"cache"} - } - if !w.opts.ModulesEnabled && w.root.Type == RootGOPATH { - ignoredPaths = w.getIgnoredDirs(w.root.Path) - ignoredPaths = append(ignoredPaths, "v", "mod") - } - - for _, p := range ignoredPaths { - full := filepath.Join(w.root.Path, p) - if fi, err := os.Stat(full); err == nil { - w.ignoredDirs = append(w.ignoredDirs, fi) - if w.opts.Logf != nil { - w.opts.Logf("Directory added to ignore list: %s", full) - } - } else if w.opts.Logf != nil { - w.opts.Logf("Error statting ignored directory: %v", err) - } - } -} - -// getIgnoredDirs reads an optional config file at /.goimportsignore -// of relative directories to ignore when scanning for go files. -// The provided path is one of the $GOPATH entries with "src" appended. -func (w *walker) getIgnoredDirs(path string) []string { - file := filepath.Join(path, ".goimportsignore") - slurp, err := ioutil.ReadFile(file) - if w.opts.Logf != nil { - if err != nil { - w.opts.Logf("%v", err) - } else { - w.opts.Logf("Read %s", file) - } - } - if err != nil { - return nil - } - - var ignoredDirs []string - bs := bufio.NewScanner(bytes.NewReader(slurp)) - for bs.Scan() { - line := strings.TrimSpace(bs.Text()) - if line == "" || strings.HasPrefix(line, "#") { - continue - } - ignoredDirs = append(ignoredDirs, line) - } - return ignoredDirs -} - -// shouldSkipDir reports whether the file should be skipped or not. -func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { - for _, ignoredDir := range w.ignoredDirs { - if os.SameFile(fi, ignoredDir) { - return true - } - } - if w.skip != nil { - // Check with the user specified callback. - return w.skip(w.root, dir) - } - return false -} - -// walk walks through the given path. -func (w *walker) walk(path string, typ os.FileMode) error { - dir := filepath.Dir(path) - if typ.IsRegular() { - if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { - // Doesn't make sense to have regular files - // directly in your $GOPATH/src or $GOROOT/src. - return fastwalk.ErrSkipFiles - } - if !strings.HasSuffix(path, ".go") { - return nil - } - - w.add(w.root, dir) - return fastwalk.ErrSkipFiles - } - if typ == os.ModeDir { - base := filepath.Base(path) - if base == "" || base[0] == '.' || base[0] == '_' || - base == "testdata" || - (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || - (!w.opts.ModulesEnabled && base == "node_modules") { - return filepath.SkipDir - } - fi, err := os.Lstat(path) - if err == nil && w.shouldSkipDir(fi, path) { - return filepath.SkipDir - } - return nil - } - if typ == os.ModeSymlink { - base := filepath.Base(path) - if strings.HasPrefix(base, ".#") { - // Emacs noise. - return nil - } - fi, err := os.Lstat(path) - if err != nil { - // Just ignore it. - return nil - } - if w.shouldTraverse(dir, fi) { - return fastwalk.ErrTraverseLink - } - } - return nil -} - -// shouldTraverse reports whether the symlink fi, found in dir, -// should be followed. It makes sure symlinks were never visited -// before to avoid symlink loops. -func (w *walker) shouldTraverse(dir string, fi os.FileInfo) bool { - path := filepath.Join(dir, fi.Name()) - target, err := filepath.EvalSymlinks(path) - if err != nil { - return false - } - ts, err := os.Stat(target) - if err != nil { - fmt.Fprintln(os.Stderr, err) - return false - } - if !ts.IsDir() { - return false - } - if w.shouldSkipDir(ts, dir) { - return false - } - // Check for symlink loops by statting each directory component - // and seeing if any are the same file as ts. - for { - parent := filepath.Dir(path) - if parent == path { - // Made it to the root without seeing a cycle. - // Use this symlink. - return true - } - parentInfo, err := os.Stat(parent) - if err != nil { - return false - } - if os.SameFile(ts, parentInfo) { - // Cycle. Don't traverse. - return false - } - path = parent - } - -} diff --git a/ibm/vendor/golang.org/x/tools/internal/imports/fix.go b/ibm/vendor/golang.org/x/tools/internal/imports/fix.go deleted file mode 100644 index d859617b77..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/imports/fix.go +++ /dev/null @@ -1,1730 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "io/ioutil" - "os" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - "unicode/utf8" - - "golang.org/x/tools/go/ast/astutil" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/gopathwalk" -) - -// importToGroup is a list of functions which map from an import path to -// a group number. -var importToGroup = []func(localPrefix, importPath string) (num int, ok bool){ - func(localPrefix, importPath string) (num int, ok bool) { - if localPrefix == "" { - return - } - for _, p := range strings.Split(localPrefix, ",") { - if strings.HasPrefix(importPath, p) || strings.TrimSuffix(p, "/") == importPath { - return 3, true - } - } - return - }, - func(_, importPath string) (num int, ok bool) { - if strings.HasPrefix(importPath, "appengine") { - return 2, true - } - return - }, - func(_, importPath string) (num int, ok bool) { - firstComponent := strings.Split(importPath, "/")[0] - if strings.Contains(firstComponent, ".") { - return 1, true - } - return - }, -} - -func importGroup(localPrefix, importPath string) int { - for _, fn := range importToGroup { - if n, ok := fn(localPrefix, importPath); ok { - return n - } - } - return 0 -} - -type ImportFixType int - -const ( - AddImport ImportFixType = iota - DeleteImport - SetImportName -) - -type ImportFix struct { - // StmtInfo represents the import statement this fix will add, remove, or change. - StmtInfo ImportInfo - // IdentName is the identifier that this fix will add or remove. - IdentName string - // FixType is the type of fix this is (AddImport, DeleteImport, SetImportName). - FixType ImportFixType - Relevance float64 // see pkg -} - -// An ImportInfo represents a single import statement. -type ImportInfo struct { - ImportPath string // import path, e.g. "crypto/rand". - Name string // import name, e.g. "crand", or "" if none. -} - -// A packageInfo represents what's known about a package. -type packageInfo struct { - name string // real package name, if known. - exports map[string]bool // known exports. -} - -// parseOtherFiles parses all the Go files in srcDir except filename, including -// test files if filename looks like a test. -func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { - // This could use go/packages but it doesn't buy much, and it fails - // with https://golang.org/issue/26296 in LoadFiles mode in some cases. - considerTests := strings.HasSuffix(filename, "_test.go") - - fileBase := filepath.Base(filename) - packageFileInfos, err := ioutil.ReadDir(srcDir) - if err != nil { - return nil - } - - var files []*ast.File - for _, fi := range packageFileInfos { - if fi.Name() == fileBase || !strings.HasSuffix(fi.Name(), ".go") { - continue - } - if !considerTests && strings.HasSuffix(fi.Name(), "_test.go") { - continue - } - - f, err := parser.ParseFile(fset, filepath.Join(srcDir, fi.Name()), nil, 0) - if err != nil { - continue - } - - files = append(files, f) - } - - return files -} - -// addGlobals puts the names of package vars into the provided map. -func addGlobals(f *ast.File, globals map[string]bool) { - for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - - for _, spec := range genDecl.Specs { - valueSpec, ok := spec.(*ast.ValueSpec) - if !ok { - continue - } - globals[valueSpec.Names[0].Name] = true - } - } -} - -// collectReferences builds a map of selector expressions, from -// left hand side (X) to a set of right hand sides (Sel). -func collectReferences(f *ast.File) references { - refs := references{} - - var visitor visitFn - visitor = func(node ast.Node) ast.Visitor { - if node == nil { - return visitor - } - switch v := node.(type) { - case *ast.SelectorExpr: - xident, ok := v.X.(*ast.Ident) - if !ok { - break - } - if xident.Obj != nil { - // If the parser can resolve it, it's not a package ref. - break - } - if !ast.IsExported(v.Sel.Name) { - // Whatever this is, it's not exported from a package. - break - } - pkgName := xident.Name - r := refs[pkgName] - if r == nil { - r = make(map[string]bool) - refs[pkgName] = r - } - r[v.Sel.Name] = true - } - return visitor - } - ast.Walk(visitor, f) - return refs -} - -// collectImports returns all the imports in f. -// Unnamed imports (., _) and "C" are ignored. -func collectImports(f *ast.File) []*ImportInfo { - var imports []*ImportInfo - for _, imp := range f.Imports { - var name string - if imp.Name != nil { - name = imp.Name.Name - } - if imp.Path.Value == `"C"` || name == "_" || name == "." { - continue - } - path := strings.Trim(imp.Path.Value, `"`) - imports = append(imports, &ImportInfo{ - Name: name, - ImportPath: path, - }) - } - return imports -} - -// findMissingImport searches pass's candidates for an import that provides -// pkg, containing all of syms. -func (p *pass) findMissingImport(pkg string, syms map[string]bool) *ImportInfo { - for _, candidate := range p.candidates { - pkgInfo, ok := p.knownPackages[candidate.ImportPath] - if !ok { - continue - } - if p.importIdentifier(candidate) != pkg { - continue - } - - allFound := true - for right := range syms { - if !pkgInfo.exports[right] { - allFound = false - break - } - } - - if allFound { - return candidate - } - } - return nil -} - -// references is set of references found in a Go file. The first map key is the -// left hand side of a selector expression, the second key is the right hand -// side, and the value should always be true. -type references map[string]map[string]bool - -// A pass contains all the inputs and state necessary to fix a file's imports. -// It can be modified in some ways during use; see comments below. -type pass struct { - // Inputs. These must be set before a call to load, and not modified after. - fset *token.FileSet // fset used to parse f and its siblings. - f *ast.File // the file being fixed. - srcDir string // the directory containing f. - env *ProcessEnv // the environment to use for go commands, etc. - loadRealPackageNames bool // if true, load package names from disk rather than guessing them. - otherFiles []*ast.File // sibling files. - - // Intermediate state, generated by load. - existingImports map[string]*ImportInfo - allRefs references - missingRefs references - - // Inputs to fix. These can be augmented between successive fix calls. - lastTry bool // indicates that this is the last call and fix should clean up as best it can. - candidates []*ImportInfo // candidate imports in priority order. - knownPackages map[string]*packageInfo // information about all known packages. -} - -// loadPackageNames saves the package names for everything referenced by imports. -func (p *pass) loadPackageNames(imports []*ImportInfo) error { - if p.env.Logf != nil { - p.env.Logf("loading package names for %v packages", len(imports)) - defer func() { - p.env.Logf("done loading package names for %v packages", len(imports)) - }() - } - var unknown []string - for _, imp := range imports { - if _, ok := p.knownPackages[imp.ImportPath]; ok { - continue - } - unknown = append(unknown, imp.ImportPath) - } - - resolver, err := p.env.GetResolver() - if err != nil { - return err - } - - names, err := resolver.loadPackageNames(unknown, p.srcDir) - if err != nil { - return err - } - - for path, name := range names { - p.knownPackages[path] = &packageInfo{ - name: name, - exports: map[string]bool{}, - } - } - return nil -} - -// importIdentifier returns the identifier that imp will introduce. It will -// guess if the package name has not been loaded, e.g. because the source -// is not available. -func (p *pass) importIdentifier(imp *ImportInfo) string { - if imp.Name != "" { - return imp.Name - } - known := p.knownPackages[imp.ImportPath] - if known != nil && known.name != "" { - return known.name - } - return ImportPathToAssumedName(imp.ImportPath) -} - -// load reads in everything necessary to run a pass, and reports whether the -// file already has all the imports it needs. It fills in p.missingRefs with the -// file's missing symbols, if any, or removes unused imports if not. -func (p *pass) load() ([]*ImportFix, bool) { - p.knownPackages = map[string]*packageInfo{} - p.missingRefs = references{} - p.existingImports = map[string]*ImportInfo{} - - // Load basic information about the file in question. - p.allRefs = collectReferences(p.f) - - // Load stuff from other files in the same package: - // global variables so we know they don't need resolving, and imports - // that we might want to mimic. - globals := map[string]bool{} - for _, otherFile := range p.otherFiles { - // Don't load globals from files that are in the same directory - // but a different package. Using them to suggest imports is OK. - if p.f.Name.Name == otherFile.Name.Name { - addGlobals(otherFile, globals) - } - p.candidates = append(p.candidates, collectImports(otherFile)...) - } - - // Resolve all the import paths we've seen to package names, and store - // f's imports by the identifier they introduce. - imports := collectImports(p.f) - if p.loadRealPackageNames { - err := p.loadPackageNames(append(imports, p.candidates...)) - if err != nil { - if p.env.Logf != nil { - p.env.Logf("loading package names: %v", err) - } - return nil, false - } - } - for _, imp := range imports { - p.existingImports[p.importIdentifier(imp)] = imp - } - - // Find missing references. - for left, rights := range p.allRefs { - if globals[left] { - continue - } - _, ok := p.existingImports[left] - if !ok { - p.missingRefs[left] = rights - continue - } - } - if len(p.missingRefs) != 0 { - return nil, false - } - - return p.fix() -} - -// fix attempts to satisfy missing imports using p.candidates. If it finds -// everything, or if p.lastTry is true, it updates fixes to add the imports it found, -// delete anything unused, and update import names, and returns true. -func (p *pass) fix() ([]*ImportFix, bool) { - // Find missing imports. - var selected []*ImportInfo - for left, rights := range p.missingRefs { - if imp := p.findMissingImport(left, rights); imp != nil { - selected = append(selected, imp) - } - } - - if !p.lastTry && len(selected) != len(p.missingRefs) { - return nil, false - } - - // Found everything, or giving up. Add the new imports and remove any unused. - var fixes []*ImportFix - for _, imp := range p.existingImports { - // We deliberately ignore globals here, because we can't be sure - // they're in the same package. People do things like put multiple - // main packages in the same directory, and we don't want to - // remove imports if they happen to have the same name as a var in - // a different package. - if _, ok := p.allRefs[p.importIdentifier(imp)]; !ok { - fixes = append(fixes, &ImportFix{ - StmtInfo: *imp, - IdentName: p.importIdentifier(imp), - FixType: DeleteImport, - }) - continue - } - - // An existing import may need to update its import name to be correct. - if name := p.importSpecName(imp); name != imp.Name { - fixes = append(fixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: name, - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: SetImportName, - }) - } - } - - for _, imp := range selected { - fixes = append(fixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: p.importSpecName(imp), - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: AddImport, - }) - } - - return fixes, true -} - -// importSpecName gets the import name of imp in the import spec. -// -// When the import identifier matches the assumed import name, the import name does -// not appear in the import spec. -func (p *pass) importSpecName(imp *ImportInfo) string { - // If we did not load the real package names, or the name is already set, - // we just return the existing name. - if !p.loadRealPackageNames || imp.Name != "" { - return imp.Name - } - - ident := p.importIdentifier(imp) - if ident == ImportPathToAssumedName(imp.ImportPath) { - return "" // ident not needed since the assumed and real names are the same. - } - return ident -} - -// apply will perform the fixes on f in order. -func apply(fset *token.FileSet, f *ast.File, fixes []*ImportFix) { - for _, fix := range fixes { - switch fix.FixType { - case DeleteImport: - astutil.DeleteNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) - case AddImport: - astutil.AddNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) - case SetImportName: - // Find the matching import path and change the name. - for _, spec := range f.Imports { - path := strings.Trim(spec.Path.Value, `"`) - if path == fix.StmtInfo.ImportPath { - spec.Name = &ast.Ident{ - Name: fix.StmtInfo.Name, - NamePos: spec.Pos(), - } - } - } - } - } -} - -// assumeSiblingImportsValid assumes that siblings' use of packages is valid, -// adding the exports they use. -func (p *pass) assumeSiblingImportsValid() { - for _, f := range p.otherFiles { - refs := collectReferences(f) - imports := collectImports(f) - importsByName := map[string]*ImportInfo{} - for _, imp := range imports { - importsByName[p.importIdentifier(imp)] = imp - } - for left, rights := range refs { - if imp, ok := importsByName[left]; ok { - if m, ok := stdlib[imp.ImportPath]; ok { - // We have the stdlib in memory; no need to guess. - rights = copyExports(m) - } - p.addCandidate(imp, &packageInfo{ - // no name; we already know it. - exports: rights, - }) - } - } - } -} - -// addCandidate adds a candidate import to p, and merges in the information -// in pkg. -func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) { - p.candidates = append(p.candidates, imp) - if existing, ok := p.knownPackages[imp.ImportPath]; ok { - if existing.name == "" { - existing.name = pkg.name - } - for export := range pkg.exports { - existing.exports[export] = true - } - } else { - p.knownPackages[imp.ImportPath] = pkg - } -} - -// fixImports adds and removes imports from f so that all its references are -// satisfied and there are no unused imports. -// -// This is declared as a variable rather than a function so goimports can -// easily be extended by adding a file with an init function. -var fixImports = fixImportsDefault - -func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { - fixes, err := getFixes(fset, f, filename, env) - if err != nil { - return err - } - apply(fset, f, fixes) - return err -} - -// getFixes gets the import fixes that need to be made to f in order to fix the imports. -// It does not modify the ast. -func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*ImportFix, error) { - abs, err := filepath.Abs(filename) - if err != nil { - return nil, err - } - srcDir := filepath.Dir(abs) - if env.Logf != nil { - env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir) - } - - // First pass: looking only at f, and using the naive algorithm to - // derive package names from import paths, see if the file is already - // complete. We can't add any imports yet, because we don't know - // if missing references are actually package vars. - p := &pass{fset: fset, f: f, srcDir: srcDir, env: env} - if fixes, done := p.load(); done { - return fixes, nil - } - - otherFiles := parseOtherFiles(fset, srcDir, filename) - - // Second pass: add information from other files in the same package, - // like their package vars and imports. - p.otherFiles = otherFiles - if fixes, done := p.load(); done { - return fixes, nil - } - - // Now we can try adding imports from the stdlib. - p.assumeSiblingImportsValid() - addStdlibCandidates(p, p.missingRefs) - if fixes, done := p.fix(); done { - return fixes, nil - } - - // Third pass: get real package names where we had previously used - // the naive algorithm. - p = &pass{fset: fset, f: f, srcDir: srcDir, env: env} - p.loadRealPackageNames = true - p.otherFiles = otherFiles - if fixes, done := p.load(); done { - return fixes, nil - } - - if err := addStdlibCandidates(p, p.missingRefs); err != nil { - return nil, err - } - p.assumeSiblingImportsValid() - if fixes, done := p.fix(); done { - return fixes, nil - } - - // Go look for candidates in $GOPATH, etc. We don't necessarily load - // the real exports of sibling imports, so keep assuming their contents. - if err := addExternalCandidates(p, p.missingRefs, filename); err != nil { - return nil, err - } - - p.lastTry = true - fixes, _ := p.fix() - return fixes, nil -} - -// MaxRelevance is the highest relevance, used for the standard library. -// Chosen arbitrarily to match pre-existing gopls code. -const MaxRelevance = 7.0 - -// getCandidatePkgs works with the passed callback to find all acceptable packages. -// It deduplicates by import path, and uses a cached stdlib rather than reading -// from disk. -func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filename, filePkg string, env *ProcessEnv) error { - notSelf := func(p *pkg) bool { - return p.packageName != filePkg || p.dir != filepath.Dir(filename) - } - goenv, err := env.goEnv() - if err != nil { - return err - } - - var mu sync.Mutex // to guard asynchronous access to dupCheck - dupCheck := map[string]struct{}{} - - // Start off with the standard library. - for importPath, exports := range stdlib { - p := &pkg{ - dir: filepath.Join(goenv["GOROOT"], "src", importPath), - importPathShort: importPath, - packageName: path.Base(importPath), - relevance: MaxRelevance, - } - dupCheck[importPath] = struct{}{} - if notSelf(p) && wrappedCallback.dirFound(p) && wrappedCallback.packageNameLoaded(p) { - wrappedCallback.exportsLoaded(p, exports) - } - } - - scanFilter := &scanCallback{ - rootFound: func(root gopathwalk.Root) bool { - // Exclude goroot results -- getting them is relatively expensive, not cached, - // and generally redundant with the in-memory version. - return root.Type != gopathwalk.RootGOROOT && wrappedCallback.rootFound(root) - }, - dirFound: wrappedCallback.dirFound, - packageNameLoaded: func(pkg *pkg) bool { - mu.Lock() - defer mu.Unlock() - if _, ok := dupCheck[pkg.importPathShort]; ok { - return false - } - dupCheck[pkg.importPathShort] = struct{}{} - return notSelf(pkg) && wrappedCallback.packageNameLoaded(pkg) - }, - exportsLoaded: func(pkg *pkg, exports []string) { - // If we're an x_test, load the package under test's test variant. - if strings.HasSuffix(filePkg, "_test") && pkg.dir == filepath.Dir(filename) { - var err error - _, exports, err = loadExportsFromFiles(ctx, env, pkg.dir, true) - if err != nil { - return - } - } - wrappedCallback.exportsLoaded(pkg, exports) - }, - } - resolver, err := env.GetResolver() - if err != nil { - return err - } - return resolver.scan(ctx, scanFilter) -} - -func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map[string]float64, error) { - result := make(map[string]float64) - resolver, err := env.GetResolver() - if err != nil { - return nil, err - } - for _, path := range paths { - result[path] = resolver.scoreImportPath(ctx, path) - } - return result, nil -} - -func PrimeCache(ctx context.Context, env *ProcessEnv) error { - // Fully scan the disk for directories, but don't actually read any Go files. - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - return false - }, - packageNameLoaded: func(pkg *pkg) bool { - return false - }, - } - return getCandidatePkgs(ctx, callback, "", "", env) -} - -func candidateImportName(pkg *pkg) string { - if ImportPathToAssumedName(pkg.importPathShort) != pkg.packageName { - return pkg.packageName - } - return "" -} - -// GetAllCandidates calls wrapped for each package whose name starts with -// searchPrefix, and can be imported from filename with the package name filePkg. -func GetAllCandidates(ctx context.Context, wrapped func(ImportFix), searchPrefix, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - if !canUse(filename, pkg.dir) { - return false - } - // Try the assumed package name first, then a simpler path match - // in case of packages named vN, which are not uncommon. - return strings.HasPrefix(ImportPathToAssumedName(pkg.importPathShort), searchPrefix) || - strings.HasPrefix(path.Base(pkg.importPathShort), searchPrefix) - }, - packageNameLoaded: func(pkg *pkg) bool { - if !strings.HasPrefix(pkg.packageName, searchPrefix) { - return false - } - wrapped(ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }) - return false - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -// GetImportPaths calls wrapped for each package whose import path starts with -// searchPrefix, and can be imported from filename with the package name filePkg. -func GetImportPaths(ctx context.Context, wrapped func(ImportFix), searchPrefix, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - if !canUse(filename, pkg.dir) { - return false - } - return strings.HasPrefix(pkg.importPathShort, searchPrefix) - }, - packageNameLoaded: func(pkg *pkg) bool { - wrapped(ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }) - return false - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -// A PackageExport is a package and its exports. -type PackageExport struct { - Fix *ImportFix - Exports []string -} - -// GetPackageExports returns all known packages with name pkg and their exports. -func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchPkg, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - return pkgIsCandidate(filename, references{searchPkg: nil}, pkg) - }, - packageNameLoaded: func(pkg *pkg) bool { - return pkg.packageName == searchPkg - }, - exportsLoaded: func(pkg *pkg, exports []string) { - sort.Strings(exports) - wrapped(PackageExport{ - Fix: &ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }, - Exports: exports, - }) - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -var RequiredGoEnvVars = []string{"GO111MODULE", "GOFLAGS", "GOINSECURE", "GOMOD", "GOMODCACHE", "GONOPROXY", "GONOSUMDB", "GOPATH", "GOPROXY", "GOROOT", "GOSUMDB"} - -// ProcessEnv contains environment variables and settings that affect the use of -// the go command, the go/build package, etc. -type ProcessEnv struct { - GocmdRunner *gocommand.Runner - - BuildFlags []string - ModFlag string - ModFile string - - // Env overrides the OS environment, and can be used to specify - // GOPROXY, GO111MODULE, etc. PATH cannot be set here, because - // exec.Command will not honor it. - // Specifying all of RequiredGoEnvVars avoids a call to `go env`. - Env map[string]string - - WorkingDir string - - // If Logf is non-nil, debug logging is enabled through this function. - Logf func(format string, args ...interface{}) - - initialized bool - - resolver Resolver -} - -func (e *ProcessEnv) goEnv() (map[string]string, error) { - if err := e.init(); err != nil { - return nil, err - } - return e.Env, nil -} - -func (e *ProcessEnv) matchFile(dir, name string) (bool, error) { - bctx, err := e.buildContext() - if err != nil { - return false, err - } - return bctx.MatchFile(dir, name) -} - -// CopyConfig copies the env's configuration into a new env. -func (e *ProcessEnv) CopyConfig() *ProcessEnv { - copy := &ProcessEnv{ - GocmdRunner: e.GocmdRunner, - initialized: e.initialized, - BuildFlags: e.BuildFlags, - Logf: e.Logf, - WorkingDir: e.WorkingDir, - resolver: nil, - Env: map[string]string{}, - } - for k, v := range e.Env { - copy.Env[k] = v - } - return copy -} - -func (e *ProcessEnv) init() error { - if e.initialized { - return nil - } - - foundAllRequired := true - for _, k := range RequiredGoEnvVars { - if _, ok := e.Env[k]; !ok { - foundAllRequired = false - break - } - } - if foundAllRequired { - e.initialized = true - return nil - } - - if e.Env == nil { - e.Env = map[string]string{} - } - - goEnv := map[string]string{} - stdout, err := e.invokeGo(context.TODO(), "env", append([]string{"-json"}, RequiredGoEnvVars...)...) - if err != nil { - return err - } - if err := json.Unmarshal(stdout.Bytes(), &goEnv); err != nil { - return err - } - for k, v := range goEnv { - e.Env[k] = v - } - e.initialized = true - return nil -} - -func (e *ProcessEnv) env() []string { - var env []string // the gocommand package will prepend os.Environ. - for k, v := range e.Env { - env = append(env, k+"="+v) - } - return env -} - -func (e *ProcessEnv) GetResolver() (Resolver, error) { - if e.resolver != nil { - return e.resolver, nil - } - if err := e.init(); err != nil { - return nil, err - } - if len(e.Env["GOMOD"]) == 0 { - e.resolver = newGopathResolver(e) - return e.resolver, nil - } - e.resolver = newModuleResolver(e) - return e.resolver, nil -} - -func (e *ProcessEnv) buildContext() (*build.Context, error) { - ctx := build.Default - goenv, err := e.goEnv() - if err != nil { - return nil, err - } - ctx.GOROOT = goenv["GOROOT"] - ctx.GOPATH = goenv["GOPATH"] - - // As of Go 1.14, build.Context has a Dir field - // (see golang.org/issue/34860). - // Populate it only if present. - rc := reflect.ValueOf(&ctx).Elem() - dir := rc.FieldByName("Dir") - if dir.IsValid() && dir.Kind() == reflect.String { - dir.SetString(e.WorkingDir) - } - - // Since Go 1.11, go/build.Context.Import may invoke 'go list' depending on - // the value in GO111MODULE in the process's environment. We always want to - // run in GOPATH mode when calling Import, so we need to prevent this from - // happening. In Go 1.16, GO111MODULE defaults to "on", so this problem comes - // up more frequently. - // - // HACK: setting any of the Context I/O hooks prevents Import from invoking - // 'go list', regardless of GO111MODULE. This is undocumented, but it's - // unlikely to change before GOPATH support is removed. - ctx.ReadDir = ioutil.ReadDir - - return &ctx, nil -} - -func (e *ProcessEnv) invokeGo(ctx context.Context, verb string, args ...string) (*bytes.Buffer, error) { - inv := gocommand.Invocation{ - Verb: verb, - Args: args, - BuildFlags: e.BuildFlags, - Env: e.env(), - Logf: e.Logf, - WorkingDir: e.WorkingDir, - } - return e.GocmdRunner.Run(ctx, inv) -} - -func addStdlibCandidates(pass *pass, refs references) error { - goenv, err := pass.env.goEnv() - if err != nil { - return err - } - add := func(pkg string) { - // Prevent self-imports. - if path.Base(pkg) == pass.f.Name.Name && filepath.Join(goenv["GOROOT"], "src", pkg) == pass.srcDir { - return - } - exports := copyExports(stdlib[pkg]) - pass.addCandidate( - &ImportInfo{ImportPath: pkg}, - &packageInfo{name: path.Base(pkg), exports: exports}) - } - for left := range refs { - if left == "rand" { - // Make sure we try crypto/rand before math/rand. - add("crypto/rand") - add("math/rand") - continue - } - for importPath := range stdlib { - if path.Base(importPath) == left { - add(importPath) - } - } - } - return nil -} - -// A Resolver does the build-system-specific parts of goimports. -type Resolver interface { - // loadPackageNames loads the package names in importPaths. - loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) - // scan works with callback to search for packages. See scanCallback for details. - scan(ctx context.Context, callback *scanCallback) error - // loadExports returns the set of exported symbols in the package at dir. - // loadExports may be called concurrently. - loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) - // scoreImportPath returns the relevance for an import path. - scoreImportPath(ctx context.Context, path string) float64 - - ClearForNewScan() -} - -// A scanCallback controls a call to scan and receives its results. -// In general, minor errors will be silently discarded; a user should not -// expect to receive a full series of calls for everything. -type scanCallback struct { - // rootFound is called before scanning a new root dir. If it returns true, - // the root will be scanned. Returning false will not necessarily prevent - // directories from that root making it to dirFound. - rootFound func(gopathwalk.Root) bool - // dirFound is called when a directory is found that is possibly a Go package. - // pkg will be populated with everything except packageName. - // If it returns true, the package's name will be loaded. - dirFound func(pkg *pkg) bool - // packageNameLoaded is called when a package is found and its name is loaded. - // If it returns true, the package's exports will be loaded. - packageNameLoaded func(pkg *pkg) bool - // exportsLoaded is called when a package's exports have been loaded. - exportsLoaded func(pkg *pkg, exports []string) -} - -func addExternalCandidates(pass *pass, refs references, filename string) error { - var mu sync.Mutex - found := make(map[string][]pkgDistance) - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true // We want everything. - }, - dirFound: func(pkg *pkg) bool { - return pkgIsCandidate(filename, refs, pkg) - }, - packageNameLoaded: func(pkg *pkg) bool { - if _, want := refs[pkg.packageName]; !want { - return false - } - if pkg.dir == pass.srcDir && pass.f.Name.Name == pkg.packageName { - // The candidate is in the same directory and has the - // same package name. Don't try to import ourselves. - return false - } - if !canUse(filename, pkg.dir) { - return false - } - mu.Lock() - defer mu.Unlock() - found[pkg.packageName] = append(found[pkg.packageName], pkgDistance{pkg, distance(pass.srcDir, pkg.dir)}) - return false // We'll do our own loading after we sort. - }, - } - resolver, err := pass.env.GetResolver() - if err != nil { - return err - } - if err = resolver.scan(context.Background(), callback); err != nil { - return err - } - - // Search for imports matching potential package references. - type result struct { - imp *ImportInfo - pkg *packageInfo - } - results := make(chan result, len(refs)) - - ctx, cancel := context.WithCancel(context.TODO()) - var wg sync.WaitGroup - defer func() { - cancel() - wg.Wait() - }() - var ( - firstErr error - firstErrOnce sync.Once - ) - for pkgName, symbols := range refs { - wg.Add(1) - go func(pkgName string, symbols map[string]bool) { - defer wg.Done() - - found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols, filename) - - if err != nil { - firstErrOnce.Do(func() { - firstErr = err - cancel() - }) - return - } - - if found == nil { - return // No matching package. - } - - imp := &ImportInfo{ - ImportPath: found.importPathShort, - } - - pkg := &packageInfo{ - name: pkgName, - exports: symbols, - } - results <- result{imp, pkg} - }(pkgName, symbols) - } - go func() { - wg.Wait() - close(results) - }() - - for result := range results { - pass.addCandidate(result.imp, result.pkg) - } - return firstErr -} - -// notIdentifier reports whether ch is an invalid identifier character. -func notIdentifier(ch rune) bool { - return !('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || - '0' <= ch && ch <= '9' || - ch == '_' || - ch >= utf8.RuneSelf && (unicode.IsLetter(ch) || unicode.IsDigit(ch))) -} - -// ImportPathToAssumedName returns the assumed package name of an import path. -// It does this using only string parsing of the import path. -// It picks the last element of the path that does not look like a major -// version, and then picks the valid identifier off the start of that element. -// It is used to determine if a local rename should be added to an import for -// clarity. -// This function could be moved to a standard package and exported if we want -// for use in other tools. -func ImportPathToAssumedName(importPath string) string { - base := path.Base(importPath) - if strings.HasPrefix(base, "v") { - if _, err := strconv.Atoi(base[1:]); err == nil { - dir := path.Dir(importPath) - if dir != "." { - base = path.Base(dir) - } - } - } - base = strings.TrimPrefix(base, "go-") - if i := strings.IndexFunc(base, notIdentifier); i >= 0 { - base = base[:i] - } - return base -} - -// gopathResolver implements resolver for GOPATH workspaces. -type gopathResolver struct { - env *ProcessEnv - walked bool - cache *dirInfoCache - scanSema chan struct{} // scanSema prevents concurrent scans. -} - -func newGopathResolver(env *ProcessEnv) *gopathResolver { - r := &gopathResolver{ - env: env, - cache: &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - }, - scanSema: make(chan struct{}, 1), - } - r.scanSema <- struct{}{} - return r -} - -func (r *gopathResolver) ClearForNewScan() { - <-r.scanSema - r.cache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.walked = false - r.scanSema <- struct{}{} -} - -func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - names := map[string]string{} - bctx, err := r.env.buildContext() - if err != nil { - return nil, err - } - for _, path := range importPaths { - names[path] = importPathToName(bctx, path, srcDir) - } - return names, nil -} - -// importPathToName finds out the actual package name, as declared in its .go files. -func importPathToName(bctx *build.Context, importPath, srcDir string) string { - // Fast path for standard library without going to disk. - if _, ok := stdlib[importPath]; ok { - return path.Base(importPath) // stdlib packages always match their paths. - } - - buildPkg, err := bctx.Import(importPath, srcDir, build.FindOnly) - if err != nil { - return "" - } - pkgName, err := packageDirToName(buildPkg.Dir) - if err != nil { - return "" - } - return pkgName -} - -// packageDirToName is a faster version of build.Import if -// the only thing desired is the package name. Given a directory, -// packageDirToName then only parses one file in the package, -// trusting that the files in the directory are consistent. -func packageDirToName(dir string) (packageName string, err error) { - d, err := os.Open(dir) - if err != nil { - return "", err - } - names, err := d.Readdirnames(-1) - d.Close() - if err != nil { - return "", err - } - sort.Strings(names) // to have predictable behavior - var lastErr error - var nfile int - for _, name := range names { - if !strings.HasSuffix(name, ".go") { - continue - } - if strings.HasSuffix(name, "_test.go") { - continue - } - nfile++ - fullFile := filepath.Join(dir, name) - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, fullFile, nil, parser.PackageClauseOnly) - if err != nil { - lastErr = err - continue - } - pkgName := f.Name.Name - if pkgName == "documentation" { - // Special case from go/build.ImportDir, not - // handled by ctx.MatchFile. - continue - } - if pkgName == "main" { - // Also skip package main, assuming it's a +build ignore generator or example. - // Since you can't import a package main anyway, there's no harm here. - continue - } - return pkgName, nil - } - if lastErr != nil { - return "", lastErr - } - return "", fmt.Errorf("no importable package found in %d Go files", nfile) -} - -type pkg struct { - dir string // absolute file path to pkg directory ("/usr/lib/go/src/net/http") - importPathShort string // vendorless import path ("net/http", "a/b") - packageName string // package name loaded from source if requested - relevance float64 // a weakly-defined score of how relevant a package is. 0 is most relevant. -} - -type pkgDistance struct { - pkg *pkg - distance int // relative distance to target -} - -// byDistanceOrImportPathShortLength sorts by relative distance breaking ties -// on the short import path length and then the import string itself. -type byDistanceOrImportPathShortLength []pkgDistance - -func (s byDistanceOrImportPathShortLength) Len() int { return len(s) } -func (s byDistanceOrImportPathShortLength) Less(i, j int) bool { - di, dj := s[i].distance, s[j].distance - if di == -1 { - return false - } - if dj == -1 { - return true - } - if di != dj { - return di < dj - } - - vi, vj := s[i].pkg.importPathShort, s[j].pkg.importPathShort - if len(vi) != len(vj) { - return len(vi) < len(vj) - } - return vi < vj -} -func (s byDistanceOrImportPathShortLength) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -func distance(basepath, targetpath string) int { - p, err := filepath.Rel(basepath, targetpath) - if err != nil { - return -1 - } - if p == "." { - return 0 - } - return strings.Count(p, string(filepath.Separator)) + 1 -} - -func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error { - add := func(root gopathwalk.Root, dir string) { - // We assume cached directories have not changed. We can skip them and their - // children. - if _, ok := r.cache.Load(dir); ok { - return - } - - importpath := filepath.ToSlash(dir[len(root.Path)+len("/"):]) - info := directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: VendorlessPath(importpath), - } - r.cache.Store(dir, info) - } - processDir := func(info directoryPackageInfo) { - // Skip this directory if we were not able to get the package information successfully. - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return - } - - p := &pkg{ - importPathShort: info.nonCanonicalImportPath, - dir: info.dir, - relevance: MaxRelevance - 1, - } - if info.rootType == gopathwalk.RootGOROOT { - p.relevance = MaxRelevance - } - - if !callback.dirFound(p) { - return - } - var err error - p.packageName, err = r.cache.CachePackageName(info) - if err != nil { - return - } - - if !callback.packageNameLoaded(p) { - return - } - if _, exports, err := r.loadExports(ctx, p, false); err == nil { - callback.exportsLoaded(p, exports) - } - } - stop := r.cache.ScanAndListen(ctx, processDir) - defer stop() - - goenv, err := r.env.goEnv() - if err != nil { - return err - } - var roots []gopathwalk.Root - roots = append(roots, gopathwalk.Root{filepath.Join(goenv["GOROOT"], "src"), gopathwalk.RootGOROOT}) - for _, p := range filepath.SplitList(goenv["GOPATH"]) { - roots = append(roots, gopathwalk.Root{filepath.Join(p, "src"), gopathwalk.RootGOPATH}) - } - // The callback is not necessarily safe to use in the goroutine below. Process roots eagerly. - roots = filterRoots(roots, callback.rootFound) - // We can't cancel walks, because we need them to finish to have a usable - // cache. Instead, run them in a separate goroutine and detach. - scanDone := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - return - case <-r.scanSema: - } - defer func() { r.scanSema <- struct{}{} }() - gopathwalk.Walk(roots, add, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: false}) - close(scanDone) - }() - select { - case <-ctx.Done(): - case <-scanDone: - } - return nil -} - -func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) float64 { - if _, ok := stdlib[path]; ok { - return MaxRelevance - } - return MaxRelevance - 1 -} - -func filterRoots(roots []gopathwalk.Root, include func(gopathwalk.Root) bool) []gopathwalk.Root { - var result []gopathwalk.Root - for _, root := range roots { - if !include(root) { - continue - } - result = append(result, root) - } - return result -} - -func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if info, ok := r.cache.Load(pkg.dir); ok && !includeTest { - return r.cache.CacheExports(ctx, r.env, info) - } - return loadExportsFromFiles(ctx, r.env, pkg.dir, includeTest) -} - -// VendorlessPath returns the devendorized version of the import path ipath. -// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". -func VendorlessPath(ipath string) string { - // Devendorize for use in import statement. - if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 { - return ipath[i+len("/vendor/"):] - } - if strings.HasPrefix(ipath, "vendor/") { - return ipath[len("vendor/"):] - } - return ipath -} - -func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { - // Look for non-test, buildable .go files which could provide exports. - all, err := ioutil.ReadDir(dir) - if err != nil { - return "", nil, err - } - var files []os.FileInfo - for _, fi := range all { - name := fi.Name() - if !strings.HasSuffix(name, ".go") || (!includeTest && strings.HasSuffix(name, "_test.go")) { - continue - } - match, err := env.matchFile(dir, fi.Name()) - if err != nil || !match { - continue - } - files = append(files, fi) - } - - if len(files) == 0 { - return "", nil, fmt.Errorf("dir %v contains no buildable, non-test .go files", dir) - } - - var pkgName string - var exports []string - fset := token.NewFileSet() - for _, fi := range files { - select { - case <-ctx.Done(): - return "", nil, ctx.Err() - default: - } - - fullFile := filepath.Join(dir, fi.Name()) - f, err := parser.ParseFile(fset, fullFile, nil, 0) - if err != nil { - if env.Logf != nil { - env.Logf("error parsing %v: %v", fullFile, err) - } - continue - } - if f.Name.Name == "documentation" { - // Special case from go/build.ImportDir, not - // handled by MatchFile above. - continue - } - if includeTest && strings.HasSuffix(f.Name.Name, "_test") { - // x_test package. We want internal test files only. - continue - } - pkgName = f.Name.Name - for name := range f.Scope.Objects { - if ast.IsExported(name) { - exports = append(exports, name) - } - } - } - - if env.Logf != nil { - sortedExports := append([]string(nil), exports...) - sort.Strings(sortedExports) - env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", ")) - } - return pkgName, exports, nil -} - -// findImport searches for a package with the given symbols. -// If no package is found, findImport returns ("", false, nil) -func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool, filename string) (*pkg, error) { - // Sort the candidates by their import package length, - // assuming that shorter package names are better than long - // ones. Note that this sorts by the de-vendored name, so - // there's no "penalty" for vendoring. - sort.Sort(byDistanceOrImportPathShortLength(candidates)) - if pass.env.Logf != nil { - for i, c := range candidates { - pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir) - } - } - resolver, err := pass.env.GetResolver() - if err != nil { - return nil, err - } - - // Collect exports for packages with matching names. - rescv := make([]chan *pkg, len(candidates)) - for i := range candidates { - rescv[i] = make(chan *pkg, 1) - } - const maxConcurrentPackageImport = 4 - loadExportsSem := make(chan struct{}, maxConcurrentPackageImport) - - ctx, cancel := context.WithCancel(ctx) - var wg sync.WaitGroup - defer func() { - cancel() - wg.Wait() - }() - - wg.Add(1) - go func() { - defer wg.Done() - for i, c := range candidates { - select { - case loadExportsSem <- struct{}{}: - case <-ctx.Done(): - return - } - - wg.Add(1) - go func(c pkgDistance, resc chan<- *pkg) { - defer func() { - <-loadExportsSem - wg.Done() - }() - - if pass.env.Logf != nil { - pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName) - } - // If we're an x_test, load the package under test's test variant. - includeTest := strings.HasSuffix(pass.f.Name.Name, "_test") && c.pkg.dir == pass.srcDir - _, exports, err := resolver.loadExports(ctx, c.pkg, includeTest) - if err != nil { - if pass.env.Logf != nil { - pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err) - } - resc <- nil - return - } - - exportsMap := make(map[string]bool, len(exports)) - for _, sym := range exports { - exportsMap[sym] = true - } - - // If it doesn't have the right - // symbols, send nil to mean no match. - for symbol := range symbols { - if !exportsMap[symbol] { - resc <- nil - return - } - } - resc <- c.pkg - }(c, rescv[i]) - } - }() - - for _, resc := range rescv { - pkg := <-resc - if pkg == nil { - continue - } - return pkg, nil - } - return nil, nil -} - -// pkgIsCandidate reports whether pkg is a candidate for satisfying the -// finding which package pkgIdent in the file named by filename is trying -// to refer to. -// -// This check is purely lexical and is meant to be as fast as possible -// because it's run over all $GOPATH directories to filter out poor -// candidates in order to limit the CPU and I/O later parsing the -// exports in candidate packages. -// -// filename is the file being formatted. -// pkgIdent is the package being searched for, like "client" (if -// searching for "client.New") -func pkgIsCandidate(filename string, refs references, pkg *pkg) bool { - // Check "internal" and "vendor" visibility: - if !canUse(filename, pkg.dir) { - return false - } - - // Speed optimization to minimize disk I/O: - // the last two components on disk must contain the - // package name somewhere. - // - // This permits mismatch naming like directory - // "go-foo" being package "foo", or "pkg.v3" being "pkg", - // or directory "google.golang.org/api/cloudbilling/v1" - // being package "cloudbilling", but doesn't - // permit a directory "foo" to be package - // "bar", which is strongly discouraged - // anyway. There's no reason goimports needs - // to be slow just to accommodate that. - for pkgIdent := range refs { - lastTwo := lastTwoComponents(pkg.importPathShort) - if strings.Contains(lastTwo, pkgIdent) { - return true - } - if hasHyphenOrUpperASCII(lastTwo) && !hasHyphenOrUpperASCII(pkgIdent) { - lastTwo = lowerASCIIAndRemoveHyphen(lastTwo) - if strings.Contains(lastTwo, pkgIdent) { - return true - } - } - } - return false -} - -func hasHyphenOrUpperASCII(s string) bool { - for i := 0; i < len(s); i++ { - b := s[i] - if b == '-' || ('A' <= b && b <= 'Z') { - return true - } - } - return false -} - -func lowerASCIIAndRemoveHyphen(s string) (ret string) { - buf := make([]byte, 0, len(s)) - for i := 0; i < len(s); i++ { - b := s[i] - switch { - case b == '-': - continue - case 'A' <= b && b <= 'Z': - buf = append(buf, b+('a'-'A')) - default: - buf = append(buf, b) - } - } - return string(buf) -} - -// canUse reports whether the package in dir is usable from filename, -// respecting the Go "internal" and "vendor" visibility rules. -func canUse(filename, dir string) bool { - // Fast path check, before any allocations. If it doesn't contain vendor - // or internal, it's not tricky: - // Note that this can false-negative on directories like "notinternal", - // but we check it correctly below. This is just a fast path. - if !strings.Contains(dir, "vendor") && !strings.Contains(dir, "internal") { - return true - } - - dirSlash := filepath.ToSlash(dir) - if !strings.Contains(dirSlash, "/vendor/") && !strings.Contains(dirSlash, "/internal/") && !strings.HasSuffix(dirSlash, "/internal") { - return true - } - // Vendor or internal directory only visible from children of parent. - // That means the path from the current directory to the target directory - // can contain ../vendor or ../internal but not ../foo/vendor or ../foo/internal - // or bar/vendor or bar/internal. - // After stripping all the leading ../, the only okay place to see vendor or internal - // is at the very beginning of the path. - absfile, err := filepath.Abs(filename) - if err != nil { - return false - } - absdir, err := filepath.Abs(dir) - if err != nil { - return false - } - rel, err := filepath.Rel(absfile, absdir) - if err != nil { - return false - } - relSlash := filepath.ToSlash(rel) - if i := strings.LastIndex(relSlash, "../"); i >= 0 { - relSlash = relSlash[i+len("../"):] - } - return !strings.Contains(relSlash, "/vendor/") && !strings.Contains(relSlash, "/internal/") && !strings.HasSuffix(relSlash, "/internal") -} - -// lastTwoComponents returns at most the last two path components -// of v, using either / or \ as the path separator. -func lastTwoComponents(v string) string { - nslash := 0 - for i := len(v) - 1; i >= 0; i-- { - if v[i] == '/' || v[i] == '\\' { - nslash++ - if nslash == 2 { - return v[i:] - } - } - } - return v -} - -type visitFn func(node ast.Node) ast.Visitor - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - return fn(node) -} - -func copyExports(pkg []string) map[string]bool { - m := make(map[string]bool, len(pkg)) - for _, v := range pkg { - m[v] = true - } - return m -} diff --git a/ibm/vendor/golang.org/x/tools/internal/imports/imports.go b/ibm/vendor/golang.org/x/tools/internal/imports/imports.go deleted file mode 100644 index 2815edc33d..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/imports/imports.go +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run mkstdlib.go - -// Package imports implements a Go pretty-printer (like package "go/format") -// that also adds or removes import statements as necessary. -package imports - -import ( - "bufio" - "bytes" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/printer" - "go/token" - "io" - "regexp" - "strconv" - "strings" - - "golang.org/x/tools/go/ast/astutil" -) - -// Options is golang.org/x/tools/imports.Options with extra internal-only options. -type Options struct { - Env *ProcessEnv // The environment to use. Note: this contains the cached module and filesystem state. - - // LocalPrefix is a comma-separated string of import path prefixes, which, if - // set, instructs Process to sort the import paths with the given prefixes - // into another group after 3rd-party packages. - LocalPrefix string - - Fragment bool // Accept fragment of a source file (no package statement) - AllErrors bool // Report all errors (not just the first 10 on different lines) - - Comments bool // Print comments (true if nil *Options provided) - TabIndent bool // Use tabs for indent (true if nil *Options provided) - TabWidth int // Tab width (8 if nil *Options provided) - - FormatOnly bool // Disable the insertion and deletion of imports -} - -// Process implements golang.org/x/tools/imports.Process with explicit context in opt.Env. -func Process(filename string, src []byte, opt *Options) (formatted []byte, err error) { - fileSet := token.NewFileSet() - file, adjust, err := parse(fileSet, filename, src, opt) - if err != nil { - return nil, err - } - - if !opt.FormatOnly { - if err := fixImports(fileSet, file, filename, opt.Env); err != nil { - return nil, err - } - } - return formatFile(fileSet, file, src, adjust, opt) -} - -// FixImports returns a list of fixes to the imports that, when applied, -// will leave the imports in the same state as Process. src and opt must -// be specified. -// -// Note that filename's directory influences which imports can be chosen, -// so it is important that filename be accurate. -func FixImports(filename string, src []byte, opt *Options) (fixes []*ImportFix, err error) { - fileSet := token.NewFileSet() - file, _, err := parse(fileSet, filename, src, opt) - if err != nil { - return nil, err - } - - return getFixes(fileSet, file, filename, opt.Env) -} - -// ApplyFixes applies all of the fixes to the file and formats it. extraMode -// is added in when parsing the file. src and opts must be specified, but no -// env is needed. -func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, extraMode parser.Mode) (formatted []byte, err error) { - // Don't use parse() -- we don't care about fragments or statement lists - // here, and we need to work with unparseable files. - fileSet := token.NewFileSet() - parserMode := parser.Mode(0) - if opt.Comments { - parserMode |= parser.ParseComments - } - if opt.AllErrors { - parserMode |= parser.AllErrors - } - parserMode |= extraMode - - file, err := parser.ParseFile(fileSet, filename, src, parserMode) - if file == nil { - return nil, err - } - - // Apply the fixes to the file. - apply(fileSet, file, fixes) - - return formatFile(fileSet, file, src, nil, opt) -} - -func formatFile(fileSet *token.FileSet, file *ast.File, src []byte, adjust func(orig []byte, src []byte) []byte, opt *Options) ([]byte, error) { - mergeImports(fileSet, file) - sortImports(opt.LocalPrefix, fileSet, file) - imps := astutil.Imports(fileSet, file) - var spacesBefore []string // import paths we need spaces before - for _, impSection := range imps { - // Within each block of contiguous imports, see if any - // import lines are in different group numbers. If so, - // we'll need to put a space between them so it's - // compatible with gofmt. - lastGroup := -1 - for _, importSpec := range impSection { - importPath, _ := strconv.Unquote(importSpec.Path.Value) - groupNum := importGroup(opt.LocalPrefix, importPath) - if groupNum != lastGroup && lastGroup != -1 { - spacesBefore = append(spacesBefore, importPath) - } - lastGroup = groupNum - } - - } - - printerMode := printer.UseSpaces - if opt.TabIndent { - printerMode |= printer.TabIndent - } - printConfig := &printer.Config{Mode: printerMode, Tabwidth: opt.TabWidth} - - var buf bytes.Buffer - err := printConfig.Fprint(&buf, fileSet, file) - if err != nil { - return nil, err - } - out := buf.Bytes() - if adjust != nil { - out = adjust(src, out) - } - if len(spacesBefore) > 0 { - out, err = addImportSpaces(bytes.NewReader(out), spacesBefore) - if err != nil { - return nil, err - } - } - - out, err = format.Source(out) - if err != nil { - return nil, err - } - return out, nil -} - -// parse parses src, which was read from filename, -// as a Go source file or statement list. -func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast.File, func(orig, src []byte) []byte, error) { - parserMode := parser.Mode(0) - if opt.Comments { - parserMode |= parser.ParseComments - } - if opt.AllErrors { - parserMode |= parser.AllErrors - } - - // Try as whole source file. - file, err := parser.ParseFile(fset, filename, src, parserMode) - if err == nil { - return file, nil, nil - } - // If the error is that the source file didn't begin with a - // package line and we accept fragmented input, fall through to - // try as a source fragment. Stop and return on any other error. - if !opt.Fragment || !strings.Contains(err.Error(), "expected 'package'") { - return nil, nil, err - } - - // If this is a declaration list, make it a source file - // by inserting a package clause. - // Insert using a ;, not a newline, so that parse errors are on - // the correct line. - const prefix = "package main;" - psrc := append([]byte(prefix), src...) - file, err = parser.ParseFile(fset, filename, psrc, parserMode) - if err == nil { - // Gofmt will turn the ; into a \n. - // Do that ourselves now and update the file contents, - // so that positions and line numbers are correct going forward. - psrc[len(prefix)-1] = '\n' - fset.File(file.Package).SetLinesForContent(psrc) - - // If a main function exists, we will assume this is a main - // package and leave the file. - if containsMainFunc(file) { - return file, nil, nil - } - - adjust := func(orig, src []byte) []byte { - // Remove the package clause. - src = src[len(prefix):] - return matchSpace(orig, src) - } - return file, adjust, nil - } - // If the error is that the source file didn't begin with a - // declaration, fall through to try as a statement list. - // Stop and return on any other error. - if !strings.Contains(err.Error(), "expected declaration") { - return nil, nil, err - } - - // If this is a statement list, make it a source file - // by inserting a package clause and turning the list - // into a function body. This handles expressions too. - // Insert using a ;, not a newline, so that the line numbers - // in fsrc match the ones in src. - fsrc := append(append([]byte("package p; func _() {"), src...), '}') - file, err = parser.ParseFile(fset, filename, fsrc, parserMode) - if err == nil { - adjust := func(orig, src []byte) []byte { - // Remove the wrapping. - // Gofmt has turned the ; into a \n\n. - src = src[len("package p\n\nfunc _() {"):] - src = src[:len(src)-len("}\n")] - // Gofmt has also indented the function body one level. - // Remove that indent. - src = bytes.Replace(src, []byte("\n\t"), []byte("\n"), -1) - return matchSpace(orig, src) - } - return file, adjust, nil - } - - // Failed, and out of options. - return nil, nil, err -} - -// containsMainFunc checks if a file contains a function declaration with the -// function signature 'func main()' -func containsMainFunc(file *ast.File) bool { - for _, decl := range file.Decls { - if f, ok := decl.(*ast.FuncDecl); ok { - if f.Name.Name != "main" { - continue - } - - if len(f.Type.Params.List) != 0 { - continue - } - - if f.Type.Results != nil && len(f.Type.Results.List) != 0 { - continue - } - - return true - } - } - - return false -} - -func cutSpace(b []byte) (before, middle, after []byte) { - i := 0 - for i < len(b) && (b[i] == ' ' || b[i] == '\t' || b[i] == '\n') { - i++ - } - j := len(b) - for j > 0 && (b[j-1] == ' ' || b[j-1] == '\t' || b[j-1] == '\n') { - j-- - } - if i <= j { - return b[:i], b[i:j], b[j:] - } - return nil, nil, b[j:] -} - -// matchSpace reformats src to use the same space context as orig. -// 1) If orig begins with blank lines, matchSpace inserts them at the beginning of src. -// 2) matchSpace copies the indentation of the first non-blank line in orig -// to every non-blank line in src. -// 3) matchSpace copies the trailing space from orig and uses it in place -// of src's trailing space. -func matchSpace(orig []byte, src []byte) []byte { - before, _, after := cutSpace(orig) - i := bytes.LastIndex(before, []byte{'\n'}) - before, indent := before[:i+1], before[i+1:] - - _, src, _ = cutSpace(src) - - var b bytes.Buffer - b.Write(before) - for len(src) > 0 { - line := src - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, src = line[:i+1], line[i+1:] - } else { - src = nil - } - if len(line) > 0 && line[0] != '\n' { // not blank - b.Write(indent) - } - b.Write(line) - } - b.Write(after) - return b.Bytes() -} - -var impLine = regexp.MustCompile(`^\s+(?:[\w\.]+\s+)?"(.+)"`) - -func addImportSpaces(r io.Reader, breaks []string) ([]byte, error) { - var out bytes.Buffer - in := bufio.NewReader(r) - inImports := false - done := false - for { - s, err := in.ReadString('\n') - if err == io.EOF { - break - } else if err != nil { - return nil, err - } - - if !inImports && !done && strings.HasPrefix(s, "import") { - inImports = true - } - if inImports && (strings.HasPrefix(s, "var") || - strings.HasPrefix(s, "func") || - strings.HasPrefix(s, "const") || - strings.HasPrefix(s, "type")) { - done = true - inImports = false - } - if inImports && len(breaks) > 0 { - if m := impLine.FindStringSubmatch(s); m != nil { - if m[1] == breaks[0] { - out.WriteByte('\n') - breaks = breaks[1:] - } - } - } - - fmt.Fprint(&out, s) - } - return out.Bytes(), nil -} diff --git a/ibm/vendor/golang.org/x/tools/internal/imports/mod.go b/ibm/vendor/golang.org/x/tools/internal/imports/mod.go deleted file mode 100644 index dff6d55362..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/imports/mod.go +++ /dev/null @@ -1,695 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/mod/module" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/gopathwalk" -) - -// ModuleResolver implements resolver for modules using the go command as little -// as feasible. -type ModuleResolver struct { - env *ProcessEnv - moduleCacheDir string - dummyVendorMod *gocommand.ModuleJSON // If vendoring is enabled, the pseudo-module that represents the /vendor directory. - roots []gopathwalk.Root - scanSema chan struct{} // scanSema prevents concurrent scans and guards scannedRoots. - scannedRoots map[gopathwalk.Root]bool - - initialized bool - main *gocommand.ModuleJSON - modsByModPath []*gocommand.ModuleJSON // All modules, ordered by # of path components in module Path... - modsByDir []*gocommand.ModuleJSON // ...or Dir. - - // moduleCacheCache stores information about the module cache. - moduleCacheCache *dirInfoCache - otherCache *dirInfoCache -} - -func newModuleResolver(e *ProcessEnv) *ModuleResolver { - r := &ModuleResolver{ - env: e, - scanSema: make(chan struct{}, 1), - } - r.scanSema <- struct{}{} - return r -} - -func (r *ModuleResolver) init() error { - if r.initialized { - return nil - } - - goenv, err := r.env.goEnv() - if err != nil { - return err - } - inv := gocommand.Invocation{ - BuildFlags: r.env.BuildFlags, - ModFlag: r.env.ModFlag, - ModFile: r.env.ModFile, - Env: r.env.env(), - Logf: r.env.Logf, - WorkingDir: r.env.WorkingDir, - } - mainMod, vendorEnabled, err := gocommand.VendorEnabled(context.TODO(), inv, r.env.GocmdRunner) - if err != nil { - return err - } - - if mainMod != nil && vendorEnabled { - // Vendor mode is on, so all the non-Main modules are irrelevant, - // and we need to search /vendor for everything. - r.main = mainMod - r.dummyVendorMod = &gocommand.ModuleJSON{ - Path: "", - Dir: filepath.Join(mainMod.Dir, "vendor"), - } - r.modsByModPath = []*gocommand.ModuleJSON{mainMod, r.dummyVendorMod} - r.modsByDir = []*gocommand.ModuleJSON{mainMod, r.dummyVendorMod} - } else { - // Vendor mode is off, so run go list -m ... to find everything. - err := r.initAllMods() - // We expect an error when running outside of a module with - // GO111MODULE=on. Other errors are fatal. - if err != nil { - if errMsg := err.Error(); !strings.Contains(errMsg, "working directory is not part of a module") && !strings.Contains(errMsg, "go.mod file not found") { - return err - } - } - } - - if gmc := r.env.Env["GOMODCACHE"]; gmc != "" { - r.moduleCacheDir = gmc - } else { - gopaths := filepath.SplitList(goenv["GOPATH"]) - if len(gopaths) == 0 { - return fmt.Errorf("empty GOPATH") - } - r.moduleCacheDir = filepath.Join(gopaths[0], "/pkg/mod") - } - - sort.Slice(r.modsByModPath, func(i, j int) bool { - count := func(x int) int { - return strings.Count(r.modsByModPath[x].Path, "/") - } - return count(j) < count(i) // descending order - }) - sort.Slice(r.modsByDir, func(i, j int) bool { - count := func(x int) int { - return strings.Count(r.modsByDir[x].Dir, "/") - } - return count(j) < count(i) // descending order - }) - - r.roots = []gopathwalk.Root{ - {filepath.Join(goenv["GOROOT"], "/src"), gopathwalk.RootGOROOT}, - } - if r.main != nil { - r.roots = append(r.roots, gopathwalk.Root{r.main.Dir, gopathwalk.RootCurrentModule}) - } - if vendorEnabled { - r.roots = append(r.roots, gopathwalk.Root{r.dummyVendorMod.Dir, gopathwalk.RootOther}) - } else { - addDep := func(mod *gocommand.ModuleJSON) { - if mod.Replace == nil { - // This is redundant with the cache, but we'll skip it cheaply enough. - r.roots = append(r.roots, gopathwalk.Root{mod.Dir, gopathwalk.RootModuleCache}) - } else { - r.roots = append(r.roots, gopathwalk.Root{mod.Dir, gopathwalk.RootOther}) - } - } - // Walk dependent modules before scanning the full mod cache, direct deps first. - for _, mod := range r.modsByModPath { - if !mod.Indirect && !mod.Main { - addDep(mod) - } - } - for _, mod := range r.modsByModPath { - if mod.Indirect && !mod.Main { - addDep(mod) - } - } - r.roots = append(r.roots, gopathwalk.Root{r.moduleCacheDir, gopathwalk.RootModuleCache}) - } - - r.scannedRoots = map[gopathwalk.Root]bool{} - if r.moduleCacheCache == nil { - r.moduleCacheCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - if r.otherCache == nil { - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - r.initialized = true - return nil -} - -func (r *ModuleResolver) initAllMods() error { - stdout, err := r.env.invokeGo(context.TODO(), "list", "-m", "-e", "-json", "...") - if err != nil { - return err - } - for dec := json.NewDecoder(stdout); dec.More(); { - mod := &gocommand.ModuleJSON{} - if err := dec.Decode(mod); err != nil { - return err - } - if mod.Dir == "" { - if r.env.Logf != nil { - r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path) - } - // Can't do anything with a module that's not downloaded. - continue - } - // golang/go#36193: the go command doesn't always clean paths. - mod.Dir = filepath.Clean(mod.Dir) - r.modsByModPath = append(r.modsByModPath, mod) - r.modsByDir = append(r.modsByDir, mod) - if mod.Main { - r.main = mod - } - } - return nil -} - -func (r *ModuleResolver) ClearForNewScan() { - <-r.scanSema - r.scannedRoots = map[gopathwalk.Root]bool{} - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.scanSema <- struct{}{} -} - -func (r *ModuleResolver) ClearForNewMod() { - <-r.scanSema - *r = ModuleResolver{ - env: r.env, - moduleCacheCache: r.moduleCacheCache, - otherCache: r.otherCache, - scanSema: r.scanSema, - } - r.init() - r.scanSema <- struct{}{} -} - -// findPackage returns the module and directory that contains the package at -// the given import path, or returns nil, "" if no module is in scope. -func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, string) { - // This can't find packages in the stdlib, but that's harmless for all - // the existing code paths. - for _, m := range r.modsByModPath { - if !strings.HasPrefix(importPath, m.Path) { - continue - } - pathInModule := importPath[len(m.Path):] - pkgDir := filepath.Join(m.Dir, pathInModule) - if r.dirIsNestedModule(pkgDir, m) { - continue - } - - if info, ok := r.cacheLoad(pkgDir); ok { - if loaded, err := info.reachedStatus(nameLoaded); loaded { - if err != nil { - continue // No package in this dir. - } - return m, pkgDir - } - if scanned, err := info.reachedStatus(directoryScanned); scanned && err != nil { - continue // Dir is unreadable, etc. - } - // This is slightly wrong: a directory doesn't have to have an - // importable package to count as a package for package-to-module - // resolution. package main or _test files should count but - // don't. - // TODO(heschi): fix this. - if _, err := r.cachePackageName(info); err == nil { - return m, pkgDir - } - } - - // Not cached. Read the filesystem. - pkgFiles, err := ioutil.ReadDir(pkgDir) - if err != nil { - continue - } - // A module only contains a package if it has buildable go - // files in that directory. If not, it could be provided by an - // outer module. See #29736. - for _, fi := range pkgFiles { - if ok, _ := r.env.matchFile(pkgDir, fi.Name()); ok { - return m, pkgDir - } - } - } - return nil, "" -} - -func (r *ModuleResolver) cacheLoad(dir string) (directoryPackageInfo, bool) { - if info, ok := r.moduleCacheCache.Load(dir); ok { - return info, ok - } - return r.otherCache.Load(dir) -} - -func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { - if info.rootType == gopathwalk.RootModuleCache { - r.moduleCacheCache.Store(info.dir, info) - } else { - r.otherCache.Store(info.dir, info) - } -} - -func (r *ModuleResolver) cacheKeys() []string { - return append(r.moduleCacheCache.Keys(), r.otherCache.Keys()...) -} - -// cachePackageName caches the package name for a dir already in the cache. -func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, error) { - if info.rootType == gopathwalk.RootModuleCache { - return r.moduleCacheCache.CachePackageName(info) - } - return r.otherCache.CachePackageName(info) -} - -func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { - if info.rootType == gopathwalk.RootModuleCache { - return r.moduleCacheCache.CacheExports(ctx, env, info) - } - return r.otherCache.CacheExports(ctx, env, info) -} - -// findModuleByDir returns the module that contains dir, or nil if no such -// module is in scope. -func (r *ModuleResolver) findModuleByDir(dir string) *gocommand.ModuleJSON { - // This is quite tricky and may not be correct. dir could be: - // - a package in the main module. - // - a replace target underneath the main module's directory. - // - a nested module in the above. - // - a replace target somewhere totally random. - // - a nested module in the above. - // - in the mod cache. - // - in /vendor/ in -mod=vendor mode. - // - nested module? Dunno. - // Rumor has it that replace targets cannot contain other replace targets. - for _, m := range r.modsByDir { - if !strings.HasPrefix(dir, m.Dir) { - continue - } - - if r.dirIsNestedModule(dir, m) { - continue - } - - return m - } - return nil -} - -// dirIsNestedModule reports if dir is contained in a nested module underneath -// mod, not actually in mod. -func (r *ModuleResolver) dirIsNestedModule(dir string, mod *gocommand.ModuleJSON) bool { - if !strings.HasPrefix(dir, mod.Dir) { - return false - } - if r.dirInModuleCache(dir) { - // Nested modules in the module cache are pruned, - // so it cannot be a nested module. - return false - } - if mod != nil && mod == r.dummyVendorMod { - // The /vendor pseudomodule is flattened and doesn't actually count. - return false - } - modDir, _ := r.modInfo(dir) - if modDir == "" { - return false - } - return modDir != mod.Dir -} - -func (r *ModuleResolver) modInfo(dir string) (modDir string, modName string) { - readModName := func(modFile string) string { - modBytes, err := ioutil.ReadFile(modFile) - if err != nil { - return "" - } - return modulePath(modBytes) - } - - if r.dirInModuleCache(dir) { - if matches := modCacheRegexp.FindStringSubmatch(dir); len(matches) == 3 { - index := strings.Index(dir, matches[1]+"@"+matches[2]) - modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) - return modDir, readModName(filepath.Join(modDir, "go.mod")) - } - } - for { - if info, ok := r.cacheLoad(dir); ok { - return info.moduleDir, info.moduleName - } - f := filepath.Join(dir, "go.mod") - info, err := os.Stat(f) - if err == nil && !info.IsDir() { - return dir, readModName(f) - } - - d := filepath.Dir(dir) - if len(d) >= len(dir) { - return "", "" // reached top of file system, no go.mod - } - dir = d - } -} - -func (r *ModuleResolver) dirInModuleCache(dir string) bool { - if r.moduleCacheDir == "" { - return false - } - return strings.HasPrefix(dir, r.moduleCacheDir) -} - -func (r *ModuleResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - if err := r.init(); err != nil { - return nil, err - } - names := map[string]string{} - for _, path := range importPaths { - _, packageDir := r.findPackage(path) - if packageDir == "" { - continue - } - name, err := packageDirToName(packageDir) - if err != nil { - continue - } - names[path] = name - } - return names, nil -} - -func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error { - if err := r.init(); err != nil { - return err - } - - processDir := func(info directoryPackageInfo) { - // Skip this directory if we were not able to get the package information successfully. - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return - } - pkg, err := r.canonicalize(info) - if err != nil { - return - } - - if !callback.dirFound(pkg) { - return - } - pkg.packageName, err = r.cachePackageName(info) - if err != nil { - return - } - - if !callback.packageNameLoaded(pkg) { - return - } - _, exports, err := r.loadExports(ctx, pkg, false) - if err != nil { - return - } - callback.exportsLoaded(pkg, exports) - } - - // Start processing everything in the cache, and listen for the new stuff - // we discover in the walk below. - stop1 := r.moduleCacheCache.ScanAndListen(ctx, processDir) - defer stop1() - stop2 := r.otherCache.ScanAndListen(ctx, processDir) - defer stop2() - - // We assume cached directories are fully cached, including all their - // children, and have not changed. We can skip them. - skip := func(root gopathwalk.Root, dir string) bool { - info, ok := r.cacheLoad(dir) - if !ok { - return false - } - // This directory can be skipped as long as we have already scanned it. - // Packages with errors will continue to have errors, so there is no need - // to rescan them. - packageScanned, _ := info.reachedStatus(directoryScanned) - return packageScanned - } - - // Add anything new to the cache, and process it if we're still listening. - add := func(root gopathwalk.Root, dir string) { - r.cacheStore(r.scanDirForPackage(root, dir)) - } - - // r.roots and the callback are not necessarily safe to use in the - // goroutine below. Process them eagerly. - roots := filterRoots(r.roots, callback.rootFound) - // We can't cancel walks, because we need them to finish to have a usable - // cache. Instead, run them in a separate goroutine and detach. - scanDone := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - return - case <-r.scanSema: - } - defer func() { r.scanSema <- struct{}{} }() - // We have the lock on r.scannedRoots, and no other scans can run. - for _, root := range roots { - if ctx.Err() != nil { - return - } - - if r.scannedRoots[root] { - continue - } - gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: true}) - r.scannedRoots[root] = true - } - close(scanDone) - }() - select { - case <-ctx.Done(): - case <-scanDone: - } - return nil -} - -func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) float64 { - if _, ok := stdlib[path]; ok { - return MaxRelevance - } - mod, _ := r.findPackage(path) - return modRelevance(mod) -} - -func modRelevance(mod *gocommand.ModuleJSON) float64 { - var relevance float64 - switch { - case mod == nil: // out of scope - return MaxRelevance - 4 - case mod.Indirect: - relevance = MaxRelevance - 3 - case !mod.Main: - relevance = MaxRelevance - 2 - default: - relevance = MaxRelevance - 1 // main module ties with stdlib - } - - _, versionString, ok := module.SplitPathVersion(mod.Path) - if ok { - index := strings.Index(versionString, "v") - if index == -1 { - return relevance - } - if versionNumber, err := strconv.ParseFloat(versionString[index+1:], 64); err == nil { - relevance += versionNumber / 1000 - } - } - - return relevance -} - -// canonicalize gets the result of canonicalizing the packages using the results -// of initializing the resolver from 'go list -m'. -func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { - // Packages in GOROOT are already canonical, regardless of the std/cmd modules. - if info.rootType == gopathwalk.RootGOROOT { - return &pkg{ - importPathShort: info.nonCanonicalImportPath, - dir: info.dir, - packageName: path.Base(info.nonCanonicalImportPath), - relevance: MaxRelevance, - }, nil - } - - importPath := info.nonCanonicalImportPath - mod := r.findModuleByDir(info.dir) - // Check if the directory is underneath a module that's in scope. - if mod != nil { - // It is. If dir is the target of a replace directive, - // our guessed import path is wrong. Use the real one. - if mod.Dir == info.dir { - importPath = mod.Path - } else { - dirInMod := info.dir[len(mod.Dir)+len("/"):] - importPath = path.Join(mod.Path, filepath.ToSlash(dirInMod)) - } - } else if !strings.HasPrefix(importPath, info.moduleName) { - // The module's name doesn't match the package's import path. It - // probably needs a replace directive we don't have. - return nil, fmt.Errorf("package in %q is not valid without a replace statement", info.dir) - } - - res := &pkg{ - importPathShort: importPath, - dir: info.dir, - relevance: modRelevance(mod), - } - // We may have discovered a package that has a different version - // in scope already. Canonicalize to that one if possible. - if _, canonicalDir := r.findPackage(importPath); canonicalDir != "" { - res.dir = canonicalDir - } - return res, nil -} - -func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if err := r.init(); err != nil { - return "", nil, err - } - if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { - return r.cacheExports(ctx, r.env, info) - } - return loadExportsFromFiles(ctx, r.env, pkg.dir, includeTest) -} - -func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) directoryPackageInfo { - subdir := "" - if dir != root.Path { - subdir = dir[len(root.Path)+len("/"):] - } - importPath := filepath.ToSlash(subdir) - if strings.HasPrefix(importPath, "vendor/") { - // Only enter vendor directories if they're explicitly requested as a root. - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("unwanted vendor directory"), - } - } - switch root.Type { - case gopathwalk.RootCurrentModule: - importPath = path.Join(r.main.Path, filepath.ToSlash(subdir)) - case gopathwalk.RootModuleCache: - matches := modCacheRegexp.FindStringSubmatch(subdir) - if len(matches) == 0 { - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("invalid module cache path: %v", subdir), - } - } - modPath, err := module.UnescapePath(filepath.ToSlash(matches[1])) - if err != nil { - if r.env.Logf != nil { - r.env.Logf("decoding module cache path %q: %v", subdir, err) - } - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("decoding module cache path %q: %v", subdir, err), - } - } - importPath = path.Join(modPath, filepath.ToSlash(matches[3])) - } - - modDir, modName := r.modInfo(dir) - result := directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: importPath, - moduleDir: modDir, - moduleName: modName, - } - if root.Type == gopathwalk.RootGOROOT { - // stdlib packages are always in scope, despite the confusing go.mod - return result - } - return result -} - -// modCacheRegexp splits a path in a module cache into module, module version, and package. -var modCacheRegexp = regexp.MustCompile(`(.*)@([^/\\]*)(.*)`) - -var ( - slashSlash = []byte("//") - moduleStr = []byte("module") -) - -// modulePath returns the module path from the gomod file text. -// If it cannot find a module path, it returns an empty string. -// It is tolerant of unrelated problems in the go.mod file. -// -// Copied from cmd/go/internal/modfile. -func modulePath(mod []byte) string { - for len(mod) > 0 { - line := mod - mod = nil - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, mod = line[:i], line[i+1:] - } - if i := bytes.Index(line, slashSlash); i >= 0 { - line = line[:i] - } - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, moduleStr) { - continue - } - line = line[len(moduleStr):] - n := len(line) - line = bytes.TrimSpace(line) - if len(line) == n || len(line) == 0 { - continue - } - - if line[0] == '"' || line[0] == '`' { - p, err := strconv.Unquote(string(line)) - if err != nil { - return "" // malformed quoted string or multiline module path - } - return p - } - - return string(line) - } - return "" // missing module path -} diff --git a/ibm/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/ibm/vendor/golang.org/x/tools/internal/imports/mod_cache.go deleted file mode 100644 index 18dada495c..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "context" - "fmt" - "sync" - - "golang.org/x/tools/internal/gopathwalk" -) - -// To find packages to import, the resolver needs to know about all of the -// the packages that could be imported. This includes packages that are -// already in modules that are in (1) the current module, (2) replace targets, -// and (3) packages in the module cache. Packages in (1) and (2) may change over -// time, as the client may edit the current module and locally replaced modules. -// The module cache (which includes all of the packages in (3)) can only -// ever be added to. -// -// The resolver can thus save state about packages in the module cache -// and guarantee that this will not change over time. To obtain information -// about new modules added to the module cache, the module cache should be -// rescanned. -// -// It is OK to serve information about modules that have been deleted, -// as they do still exist. -// TODO(suzmue): can we share information with the caller about -// what module needs to be downloaded to import this package? - -type directoryPackageStatus int - -const ( - _ directoryPackageStatus = iota - directoryScanned - nameLoaded - exportsLoaded -) - -type directoryPackageInfo struct { - // status indicates the extent to which this struct has been filled in. - status directoryPackageStatus - // err is non-nil when there was an error trying to reach status. - err error - - // Set when status >= directoryScanned. - - // dir is the absolute directory of this package. - dir string - rootType gopathwalk.RootType - // nonCanonicalImportPath is the package's expected import path. It may - // not actually be importable at that path. - nonCanonicalImportPath string - - // Module-related information. - moduleDir string // The directory that is the module root of this dir. - moduleName string // The module name that contains this dir. - - // Set when status >= nameLoaded. - - packageName string // the package name, as declared in the source. - - // Set when status >= exportsLoaded. - - exports []string -} - -// reachedStatus returns true when info has a status at least target and any error associated with -// an attempt to reach target. -func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) (bool, error) { - if info.err == nil { - return info.status >= target, nil - } - if info.status == target { - return true, info.err - } - return true, nil -} - -// dirInfoCache is a concurrency safe map for storing information about -// directories that may contain packages. -// -// The information in this cache is built incrementally. Entries are initialized in scan. -// No new keys should be added in any other functions, as all directories containing -// packages are identified in scan. -// -// Other functions, including loadExports and findPackage, may update entries in this cache -// as they discover new things about the directory. -// -// The information in the cache is not expected to change for the cache's -// lifetime, so there is no protection against competing writes. Users should -// take care not to hold the cache across changes to the underlying files. -// -// TODO(suzmue): consider other concurrency strategies and data structures (RWLocks, sync.Map, etc) -type dirInfoCache struct { - mu sync.Mutex - // dirs stores information about packages in directories, keyed by absolute path. - dirs map[string]*directoryPackageInfo - listeners map[*int]cacheListener -} - -type cacheListener func(directoryPackageInfo) - -// ScanAndListen calls listener on all the items in the cache, and on anything -// newly added. The returned stop function waits for all in-flight callbacks to -// finish and blocks new ones. -func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { - ctx, cancel := context.WithCancel(ctx) - - // Flushing out all the callbacks is tricky without knowing how many there - // are going to be. Setting an arbitrary limit makes it much easier. - const maxInFlight = 10 - sema := make(chan struct{}, maxInFlight) - for i := 0; i < maxInFlight; i++ { - sema <- struct{}{} - } - - cookie := new(int) // A unique ID we can use for the listener. - - // We can't hold mu while calling the listener. - d.mu.Lock() - var keys []string - for key := range d.dirs { - keys = append(keys, key) - } - d.listeners[cookie] = func(info directoryPackageInfo) { - select { - case <-ctx.Done(): - return - case <-sema: - } - listener(info) - sema <- struct{}{} - } - d.mu.Unlock() - - stop := func() { - cancel() - d.mu.Lock() - delete(d.listeners, cookie) - d.mu.Unlock() - for i := 0; i < maxInFlight; i++ { - <-sema - } - } - - // Process the pre-existing keys. - for _, k := range keys { - select { - case <-ctx.Done(): - return stop - default: - } - if v, ok := d.Load(k); ok { - listener(v) - } - } - - return stop -} - -// Store stores the package info for dir. -func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { - d.mu.Lock() - _, old := d.dirs[dir] - d.dirs[dir] = &info - var listeners []cacheListener - for _, l := range d.listeners { - listeners = append(listeners, l) - } - d.mu.Unlock() - - if !old { - for _, l := range listeners { - l(info) - } - } -} - -// Load returns a copy of the directoryPackageInfo for absolute directory dir. -func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { - d.mu.Lock() - defer d.mu.Unlock() - info, ok := d.dirs[dir] - if !ok { - return directoryPackageInfo{}, false - } - return *info, true -} - -// Keys returns the keys currently present in d. -func (d *dirInfoCache) Keys() (keys []string) { - d.mu.Lock() - defer d.mu.Unlock() - for key := range d.dirs { - keys = append(keys, key) - } - return keys -} - -func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { - if loaded, err := info.reachedStatus(nameLoaded); loaded { - return info.packageName, err - } - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return "", fmt.Errorf("cannot read package name, scan error: %v", err) - } - info.packageName, info.err = packageDirToName(info.dir) - info.status = nameLoaded - d.Store(info.dir, info) - return info.packageName, info.err -} - -func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { - if reached, _ := info.reachedStatus(exportsLoaded); reached { - return info.packageName, info.exports, info.err - } - if reached, err := info.reachedStatus(nameLoaded); reached && err != nil { - return "", nil, err - } - info.packageName, info.exports, info.err = loadExportsFromFiles(ctx, env, info.dir, false) - if info.err == context.Canceled || info.err == context.DeadlineExceeded { - return info.packageName, info.exports, info.err - } - // The cache structure wants things to proceed linearly. We can skip a - // step here, but only if we succeed. - if info.status == nameLoaded || info.err == nil { - info.status = exportsLoaded - } else { - info.status = nameLoaded - } - d.Store(info.dir, info) - return info.packageName, info.exports, info.err -} diff --git a/ibm/vendor/golang.org/x/tools/internal/imports/sortimports.go b/ibm/vendor/golang.org/x/tools/internal/imports/sortimports.go deleted file mode 100644 index be8ffa25fe..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/imports/sortimports.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Hacked up copy of go/ast/import.go - -package imports - -import ( - "go/ast" - "go/token" - "sort" - "strconv" -) - -// sortImports sorts runs of consecutive import lines in import blocks in f. -// It also removes duplicate imports when it is possible to do so without data loss. -func sortImports(localPrefix string, fset *token.FileSet, f *ast.File) { - for i, d := range f.Decls { - d, ok := d.(*ast.GenDecl) - if !ok || d.Tok != token.IMPORT { - // Not an import declaration, so we're done. - // Imports are always first. - break - } - - if len(d.Specs) == 0 { - // Empty import block, remove it. - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - } - - if !d.Lparen.IsValid() { - // Not a block: sorted by default. - continue - } - - // Identify and sort runs of specs on successive lines. - i := 0 - specs := d.Specs[:0] - for j, s := range d.Specs { - if j > i && fset.Position(s.Pos()).Line > 1+fset.Position(d.Specs[j-1].End()).Line { - // j begins a new run. End this one. - specs = append(specs, sortSpecs(localPrefix, fset, f, d.Specs[i:j])...) - i = j - } - } - specs = append(specs, sortSpecs(localPrefix, fset, f, d.Specs[i:])...) - d.Specs = specs - - // Deduping can leave a blank line before the rparen; clean that up. - if len(d.Specs) > 0 { - lastSpec := d.Specs[len(d.Specs)-1] - lastLine := fset.Position(lastSpec.Pos()).Line - if rParenLine := fset.Position(d.Rparen).Line; rParenLine > lastLine+1 { - fset.File(d.Rparen).MergeLine(rParenLine - 1) - } - } - } -} - -// mergeImports merges all the import declarations into the first one. -// Taken from golang.org/x/tools/ast/astutil. -func mergeImports(fset *token.FileSet, f *ast.File) { - if len(f.Decls) <= 1 { - return - } - - // Merge all the import declarations into the first one. - var first *ast.GenDecl - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { - continue - } - if first == nil { - first = gen - continue // Don't touch the first one. - } - // We now know there is more than one package in this import - // declaration. Ensure that it ends up parenthesized. - first.Lparen = first.Pos() - // Move the imports of the other import declaration to the first one. - for _, spec := range gen.Specs { - spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() - first.Specs = append(first.Specs, spec) - } - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - i-- - } -} - -// declImports reports whether gen contains an import of path. -// Taken from golang.org/x/tools/ast/astutil. -func declImports(gen *ast.GenDecl, path string) bool { - if gen.Tok != token.IMPORT { - return false - } - for _, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - if importPath(impspec) == path { - return true - } - } - return false -} - -func importPath(s ast.Spec) string { - t, err := strconv.Unquote(s.(*ast.ImportSpec).Path.Value) - if err == nil { - return t - } - return "" -} - -func importName(s ast.Spec) string { - n := s.(*ast.ImportSpec).Name - if n == nil { - return "" - } - return n.Name -} - -func importComment(s ast.Spec) string { - c := s.(*ast.ImportSpec).Comment - if c == nil { - return "" - } - return c.Text() -} - -// collapse indicates whether prev may be removed, leaving only next. -func collapse(prev, next ast.Spec) bool { - if importPath(next) != importPath(prev) || importName(next) != importName(prev) { - return false - } - return prev.(*ast.ImportSpec).Comment == nil -} - -type posSpan struct { - Start token.Pos - End token.Pos -} - -func sortSpecs(localPrefix string, fset *token.FileSet, f *ast.File, specs []ast.Spec) []ast.Spec { - // Can't short-circuit here even if specs are already sorted, - // since they might yet need deduplication. - // A lone import, however, may be safely ignored. - if len(specs) <= 1 { - return specs - } - - // Record positions for specs. - pos := make([]posSpan, len(specs)) - for i, s := range specs { - pos[i] = posSpan{s.Pos(), s.End()} - } - - // Identify comments in this range. - // Any comment from pos[0].Start to the final line counts. - lastLine := fset.Position(pos[len(pos)-1].End).Line - cstart := len(f.Comments) - cend := len(f.Comments) - for i, g := range f.Comments { - if g.Pos() < pos[0].Start { - continue - } - if i < cstart { - cstart = i - } - if fset.Position(g.End()).Line > lastLine { - cend = i - break - } - } - comments := f.Comments[cstart:cend] - - // Assign each comment to the import spec preceding it. - importComment := map[*ast.ImportSpec][]*ast.CommentGroup{} - specIndex := 0 - for _, g := range comments { - for specIndex+1 < len(specs) && pos[specIndex+1].Start <= g.Pos() { - specIndex++ - } - s := specs[specIndex].(*ast.ImportSpec) - importComment[s] = append(importComment[s], g) - } - - // Sort the import specs by import path. - // Remove duplicates, when possible without data loss. - // Reassign the import paths to have the same position sequence. - // Reassign each comment to abut the end of its spec. - // Sort the comments by new position. - sort.Sort(byImportSpec{localPrefix, specs}) - - // Dedup. Thanks to our sorting, we can just consider - // adjacent pairs of imports. - deduped := specs[:0] - for i, s := range specs { - if i == len(specs)-1 || !collapse(s, specs[i+1]) { - deduped = append(deduped, s) - } else { - p := s.Pos() - fset.File(p).MergeLine(fset.Position(p).Line) - } - } - specs = deduped - - // Fix up comment positions - for i, s := range specs { - s := s.(*ast.ImportSpec) - if s.Name != nil { - s.Name.NamePos = pos[i].Start - } - s.Path.ValuePos = pos[i].Start - s.EndPos = pos[i].End - nextSpecPos := pos[i].End - - for _, g := range importComment[s] { - for _, c := range g.List { - c.Slash = pos[i].End - nextSpecPos = c.End() - } - } - if i < len(specs)-1 { - pos[i+1].Start = nextSpecPos - pos[i+1].End = nextSpecPos - } - } - - sort.Sort(byCommentPos(comments)) - - // Fixup comments can insert blank lines, because import specs are on different lines. - // We remove those blank lines here by merging import spec to the first import spec line. - firstSpecLine := fset.Position(specs[0].Pos()).Line - for _, s := range specs[1:] { - p := s.Pos() - line := fset.File(p).Line(p) - for previousLine := line - 1; previousLine >= firstSpecLine; { - fset.File(p).MergeLine(previousLine) - previousLine-- - } - } - return specs -} - -type byImportSpec struct { - localPrefix string - specs []ast.Spec // slice of *ast.ImportSpec -} - -func (x byImportSpec) Len() int { return len(x.specs) } -func (x byImportSpec) Swap(i, j int) { x.specs[i], x.specs[j] = x.specs[j], x.specs[i] } -func (x byImportSpec) Less(i, j int) bool { - ipath := importPath(x.specs[i]) - jpath := importPath(x.specs[j]) - - igroup := importGroup(x.localPrefix, ipath) - jgroup := importGroup(x.localPrefix, jpath) - if igroup != jgroup { - return igroup < jgroup - } - - if ipath != jpath { - return ipath < jpath - } - iname := importName(x.specs[i]) - jname := importName(x.specs[j]) - - if iname != jname { - return iname < jname - } - return importComment(x.specs[i]) < importComment(x.specs[j]) -} - -type byCommentPos []*ast.CommentGroup - -func (x byCommentPos) Len() int { return len(x) } -func (x byCommentPos) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byCommentPos) Less(i, j int) bool { return x[i].Pos() < x[j].Pos() } diff --git a/ibm/vendor/golang.org/x/tools/internal/imports/zstdlib.go b/ibm/vendor/golang.org/x/tools/internal/imports/zstdlib.go deleted file mode 100644 index 7de2be9b4b..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/imports/zstdlib.go +++ /dev/null @@ -1,10756 +0,0 @@ -// Code generated by mkstdlib.go. DO NOT EDIT. - -package imports - -var stdlib = map[string][]string{ - "archive/tar": []string{ - "ErrFieldTooLong", - "ErrHeader", - "ErrWriteAfterClose", - "ErrWriteTooLong", - "FileInfoHeader", - "Format", - "FormatGNU", - "FormatPAX", - "FormatUSTAR", - "FormatUnknown", - "Header", - "NewReader", - "NewWriter", - "Reader", - "TypeBlock", - "TypeChar", - "TypeCont", - "TypeDir", - "TypeFifo", - "TypeGNULongLink", - "TypeGNULongName", - "TypeGNUSparse", - "TypeLink", - "TypeReg", - "TypeRegA", - "TypeSymlink", - "TypeXGlobalHeader", - "TypeXHeader", - "Writer", - }, - "archive/zip": []string{ - "Compressor", - "Decompressor", - "Deflate", - "ErrAlgorithm", - "ErrChecksum", - "ErrFormat", - "File", - "FileHeader", - "FileInfoHeader", - "NewReader", - "NewWriter", - "OpenReader", - "ReadCloser", - "Reader", - "RegisterCompressor", - "RegisterDecompressor", - "Store", - "Writer", - }, - "bufio": []string{ - "ErrAdvanceTooFar", - "ErrBadReadCount", - "ErrBufferFull", - "ErrFinalToken", - "ErrInvalidUnreadByte", - "ErrInvalidUnreadRune", - "ErrNegativeAdvance", - "ErrNegativeCount", - "ErrTooLong", - "MaxScanTokenSize", - "NewReadWriter", - "NewReader", - "NewReaderSize", - "NewScanner", - "NewWriter", - "NewWriterSize", - "ReadWriter", - "Reader", - "ScanBytes", - "ScanLines", - "ScanRunes", - "ScanWords", - "Scanner", - "SplitFunc", - "Writer", - }, - "bytes": []string{ - "Buffer", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "Equal", - "EqualFold", - "ErrTooLarge", - "Fields", - "FieldsFunc", - "HasPrefix", - "HasSuffix", - "Index", - "IndexAny", - "IndexByte", - "IndexFunc", - "IndexRune", - "Join", - "LastIndex", - "LastIndexAny", - "LastIndexByte", - "LastIndexFunc", - "Map", - "MinRead", - "NewBuffer", - "NewBufferString", - "NewReader", - "Reader", - "Repeat", - "Replace", - "ReplaceAll", - "Runes", - "Split", - "SplitAfter", - "SplitAfterN", - "SplitN", - "Title", - "ToLower", - "ToLowerSpecial", - "ToTitle", - "ToTitleSpecial", - "ToUpper", - "ToUpperSpecial", - "ToValidUTF8", - "Trim", - "TrimFunc", - "TrimLeft", - "TrimLeftFunc", - "TrimPrefix", - "TrimRight", - "TrimRightFunc", - "TrimSpace", - "TrimSuffix", - }, - "compress/bzip2": []string{ - "NewReader", - "StructuralError", - }, - "compress/flate": []string{ - "BestCompression", - "BestSpeed", - "CorruptInputError", - "DefaultCompression", - "HuffmanOnly", - "InternalError", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterDict", - "NoCompression", - "ReadError", - "Reader", - "Resetter", - "WriteError", - "Writer", - }, - "compress/gzip": []string{ - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrHeader", - "Header", - "HuffmanOnly", - "NewReader", - "NewWriter", - "NewWriterLevel", - "NoCompression", - "Reader", - "Writer", - }, - "compress/lzw": []string{ - "LSB", - "MSB", - "NewReader", - "NewWriter", - "Order", - "Reader", - "Writer", - }, - "compress/zlib": []string{ - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrDictionary", - "ErrHeader", - "HuffmanOnly", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterLevel", - "NewWriterLevelDict", - "NoCompression", - "Resetter", - "Writer", - }, - "container/heap": []string{ - "Fix", - "Init", - "Interface", - "Pop", - "Push", - "Remove", - }, - "container/list": []string{ - "Element", - "List", - "New", - }, - "container/ring": []string{ - "New", - "Ring", - }, - "context": []string{ - "Background", - "CancelFunc", - "Canceled", - "Context", - "DeadlineExceeded", - "TODO", - "WithCancel", - "WithDeadline", - "WithTimeout", - "WithValue", - }, - "crypto": []string{ - "BLAKE2b_256", - "BLAKE2b_384", - "BLAKE2b_512", - "BLAKE2s_256", - "Decrypter", - "DecrypterOpts", - "Hash", - "MD4", - "MD5", - "MD5SHA1", - "PrivateKey", - "PublicKey", - "RIPEMD160", - "RegisterHash", - "SHA1", - "SHA224", - "SHA256", - "SHA384", - "SHA3_224", - "SHA3_256", - "SHA3_384", - "SHA3_512", - "SHA512", - "SHA512_224", - "SHA512_256", - "Signer", - "SignerOpts", - }, - "crypto/aes": []string{ - "BlockSize", - "KeySizeError", - "NewCipher", - }, - "crypto/cipher": []string{ - "AEAD", - "Block", - "BlockMode", - "NewCBCDecrypter", - "NewCBCEncrypter", - "NewCFBDecrypter", - "NewCFBEncrypter", - "NewCTR", - "NewGCM", - "NewGCMWithNonceSize", - "NewGCMWithTagSize", - "NewOFB", - "Stream", - "StreamReader", - "StreamWriter", - }, - "crypto/des": []string{ - "BlockSize", - "KeySizeError", - "NewCipher", - "NewTripleDESCipher", - }, - "crypto/dsa": []string{ - "ErrInvalidPublicKey", - "GenerateKey", - "GenerateParameters", - "L1024N160", - "L2048N224", - "L2048N256", - "L3072N256", - "ParameterSizes", - "Parameters", - "PrivateKey", - "PublicKey", - "Sign", - "Verify", - }, - "crypto/ecdsa": []string{ - "GenerateKey", - "PrivateKey", - "PublicKey", - "Sign", - "SignASN1", - "Verify", - "VerifyASN1", - }, - "crypto/ed25519": []string{ - "GenerateKey", - "NewKeyFromSeed", - "PrivateKey", - "PrivateKeySize", - "PublicKey", - "PublicKeySize", - "SeedSize", - "Sign", - "SignatureSize", - "Verify", - }, - "crypto/elliptic": []string{ - "Curve", - "CurveParams", - "GenerateKey", - "Marshal", - "MarshalCompressed", - "P224", - "P256", - "P384", - "P521", - "Unmarshal", - "UnmarshalCompressed", - }, - "crypto/hmac": []string{ - "Equal", - "New", - }, - "crypto/md5": []string{ - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/rand": []string{ - "Int", - "Prime", - "Read", - "Reader", - }, - "crypto/rc4": []string{ - "Cipher", - "KeySizeError", - "NewCipher", - }, - "crypto/rsa": []string{ - "CRTValue", - "DecryptOAEP", - "DecryptPKCS1v15", - "DecryptPKCS1v15SessionKey", - "EncryptOAEP", - "EncryptPKCS1v15", - "ErrDecryption", - "ErrMessageTooLong", - "ErrVerification", - "GenerateKey", - "GenerateMultiPrimeKey", - "OAEPOptions", - "PKCS1v15DecryptOptions", - "PSSOptions", - "PSSSaltLengthAuto", - "PSSSaltLengthEqualsHash", - "PrecomputedValues", - "PrivateKey", - "PublicKey", - "SignPKCS1v15", - "SignPSS", - "VerifyPKCS1v15", - "VerifyPSS", - }, - "crypto/sha1": []string{ - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/sha256": []string{ - "BlockSize", - "New", - "New224", - "Size", - "Size224", - "Sum224", - "Sum256", - }, - "crypto/sha512": []string{ - "BlockSize", - "New", - "New384", - "New512_224", - "New512_256", - "Size", - "Size224", - "Size256", - "Size384", - "Sum384", - "Sum512", - "Sum512_224", - "Sum512_256", - }, - "crypto/subtle": []string{ - "ConstantTimeByteEq", - "ConstantTimeCompare", - "ConstantTimeCopy", - "ConstantTimeEq", - "ConstantTimeLessOrEq", - "ConstantTimeSelect", - }, - "crypto/tls": []string{ - "Certificate", - "CertificateRequestInfo", - "CipherSuite", - "CipherSuiteName", - "CipherSuites", - "Client", - "ClientAuthType", - "ClientHelloInfo", - "ClientSessionCache", - "ClientSessionState", - "Config", - "Conn", - "ConnectionState", - "CurveID", - "CurveP256", - "CurveP384", - "CurveP521", - "Dial", - "DialWithDialer", - "Dialer", - "ECDSAWithP256AndSHA256", - "ECDSAWithP384AndSHA384", - "ECDSAWithP521AndSHA512", - "ECDSAWithSHA1", - "Ed25519", - "InsecureCipherSuites", - "Listen", - "LoadX509KeyPair", - "NewLRUClientSessionCache", - "NewListener", - "NoClientCert", - "PKCS1WithSHA1", - "PKCS1WithSHA256", - "PKCS1WithSHA384", - "PKCS1WithSHA512", - "PSSWithSHA256", - "PSSWithSHA384", - "PSSWithSHA512", - "RecordHeaderError", - "RenegotiateFreelyAsClient", - "RenegotiateNever", - "RenegotiateOnceAsClient", - "RenegotiationSupport", - "RequestClientCert", - "RequireAndVerifyClientCert", - "RequireAnyClientCert", - "Server", - "SignatureScheme", - "TLS_AES_128_GCM_SHA256", - "TLS_AES_256_GCM_SHA384", - "TLS_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_FALLBACK_SCSV", - "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA256", - "TLS_RSA_WITH_AES_128_GCM_SHA256", - "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_RSA_WITH_AES_256_GCM_SHA384", - "TLS_RSA_WITH_RC4_128_SHA", - "VerifyClientCertIfGiven", - "VersionSSL30", - "VersionTLS10", - "VersionTLS11", - "VersionTLS12", - "VersionTLS13", - "X25519", - "X509KeyPair", - }, - "crypto/x509": []string{ - "CANotAuthorizedForExtKeyUsage", - "CANotAuthorizedForThisName", - "CertPool", - "Certificate", - "CertificateInvalidError", - "CertificateRequest", - "ConstraintViolationError", - "CreateCertificate", - "CreateCertificateRequest", - "CreateRevocationList", - "DSA", - "DSAWithSHA1", - "DSAWithSHA256", - "DecryptPEMBlock", - "ECDSA", - "ECDSAWithSHA1", - "ECDSAWithSHA256", - "ECDSAWithSHA384", - "ECDSAWithSHA512", - "Ed25519", - "EncryptPEMBlock", - "ErrUnsupportedAlgorithm", - "Expired", - "ExtKeyUsage", - "ExtKeyUsageAny", - "ExtKeyUsageClientAuth", - "ExtKeyUsageCodeSigning", - "ExtKeyUsageEmailProtection", - "ExtKeyUsageIPSECEndSystem", - "ExtKeyUsageIPSECTunnel", - "ExtKeyUsageIPSECUser", - "ExtKeyUsageMicrosoftCommercialCodeSigning", - "ExtKeyUsageMicrosoftKernelCodeSigning", - "ExtKeyUsageMicrosoftServerGatedCrypto", - "ExtKeyUsageNetscapeServerGatedCrypto", - "ExtKeyUsageOCSPSigning", - "ExtKeyUsageServerAuth", - "ExtKeyUsageTimeStamping", - "HostnameError", - "IncompatibleUsage", - "IncorrectPasswordError", - "InsecureAlgorithmError", - "InvalidReason", - "IsEncryptedPEMBlock", - "KeyUsage", - "KeyUsageCRLSign", - "KeyUsageCertSign", - "KeyUsageContentCommitment", - "KeyUsageDataEncipherment", - "KeyUsageDecipherOnly", - "KeyUsageDigitalSignature", - "KeyUsageEncipherOnly", - "KeyUsageKeyAgreement", - "KeyUsageKeyEncipherment", - "MD2WithRSA", - "MD5WithRSA", - "MarshalECPrivateKey", - "MarshalPKCS1PrivateKey", - "MarshalPKCS1PublicKey", - "MarshalPKCS8PrivateKey", - "MarshalPKIXPublicKey", - "NameConstraintsWithoutSANs", - "NameMismatch", - "NewCertPool", - "NotAuthorizedToSign", - "PEMCipher", - "PEMCipher3DES", - "PEMCipherAES128", - "PEMCipherAES192", - "PEMCipherAES256", - "PEMCipherDES", - "ParseCRL", - "ParseCertificate", - "ParseCertificateRequest", - "ParseCertificates", - "ParseDERCRL", - "ParseECPrivateKey", - "ParsePKCS1PrivateKey", - "ParsePKCS1PublicKey", - "ParsePKCS8PrivateKey", - "ParsePKIXPublicKey", - "PublicKeyAlgorithm", - "PureEd25519", - "RSA", - "RevocationList", - "SHA1WithRSA", - "SHA256WithRSA", - "SHA256WithRSAPSS", - "SHA384WithRSA", - "SHA384WithRSAPSS", - "SHA512WithRSA", - "SHA512WithRSAPSS", - "SignatureAlgorithm", - "SystemCertPool", - "SystemRootsError", - "TooManyConstraints", - "TooManyIntermediates", - "UnconstrainedName", - "UnhandledCriticalExtension", - "UnknownAuthorityError", - "UnknownPublicKeyAlgorithm", - "UnknownSignatureAlgorithm", - "VerifyOptions", - }, - "crypto/x509/pkix": []string{ - "AlgorithmIdentifier", - "AttributeTypeAndValue", - "AttributeTypeAndValueSET", - "CertificateList", - "Extension", - "Name", - "RDNSequence", - "RelativeDistinguishedNameSET", - "RevokedCertificate", - "TBSCertificateList", - }, - "database/sql": []string{ - "ColumnType", - "Conn", - "DB", - "DBStats", - "Drivers", - "ErrConnDone", - "ErrNoRows", - "ErrTxDone", - "IsolationLevel", - "LevelDefault", - "LevelLinearizable", - "LevelReadCommitted", - "LevelReadUncommitted", - "LevelRepeatableRead", - "LevelSerializable", - "LevelSnapshot", - "LevelWriteCommitted", - "Named", - "NamedArg", - "NullBool", - "NullByte", - "NullFloat64", - "NullInt16", - "NullInt32", - "NullInt64", - "NullString", - "NullTime", - "Open", - "OpenDB", - "Out", - "RawBytes", - "Register", - "Result", - "Row", - "Rows", - "Scanner", - "Stmt", - "Tx", - "TxOptions", - }, - "database/sql/driver": []string{ - "Bool", - "ColumnConverter", - "Conn", - "ConnBeginTx", - "ConnPrepareContext", - "Connector", - "DefaultParameterConverter", - "Driver", - "DriverContext", - "ErrBadConn", - "ErrRemoveArgument", - "ErrSkip", - "Execer", - "ExecerContext", - "Int32", - "IsScanValue", - "IsValue", - "IsolationLevel", - "NamedValue", - "NamedValueChecker", - "NotNull", - "Null", - "Pinger", - "Queryer", - "QueryerContext", - "Result", - "ResultNoRows", - "Rows", - "RowsAffected", - "RowsColumnTypeDatabaseTypeName", - "RowsColumnTypeLength", - "RowsColumnTypeNullable", - "RowsColumnTypePrecisionScale", - "RowsColumnTypeScanType", - "RowsNextResultSet", - "SessionResetter", - "Stmt", - "StmtExecContext", - "StmtQueryContext", - "String", - "Tx", - "TxOptions", - "Validator", - "Value", - "ValueConverter", - "Valuer", - }, - "debug/dwarf": []string{ - "AddrType", - "ArrayType", - "Attr", - "AttrAbstractOrigin", - "AttrAccessibility", - "AttrAddrBase", - "AttrAddrClass", - "AttrAlignment", - "AttrAllocated", - "AttrArtificial", - "AttrAssociated", - "AttrBaseTypes", - "AttrBinaryScale", - "AttrBitOffset", - "AttrBitSize", - "AttrByteSize", - "AttrCallAllCalls", - "AttrCallAllSourceCalls", - "AttrCallAllTailCalls", - "AttrCallColumn", - "AttrCallDataLocation", - "AttrCallDataValue", - "AttrCallFile", - "AttrCallLine", - "AttrCallOrigin", - "AttrCallPC", - "AttrCallParameter", - "AttrCallReturnPC", - "AttrCallTailCall", - "AttrCallTarget", - "AttrCallTargetClobbered", - "AttrCallValue", - "AttrCalling", - "AttrCommonRef", - "AttrCompDir", - "AttrConstExpr", - "AttrConstValue", - "AttrContainingType", - "AttrCount", - "AttrDataBitOffset", - "AttrDataLocation", - "AttrDataMemberLoc", - "AttrDecimalScale", - "AttrDecimalSign", - "AttrDeclColumn", - "AttrDeclFile", - "AttrDeclLine", - "AttrDeclaration", - "AttrDefaultValue", - "AttrDefaulted", - "AttrDeleted", - "AttrDescription", - "AttrDigitCount", - "AttrDiscr", - "AttrDiscrList", - "AttrDiscrValue", - "AttrDwoName", - "AttrElemental", - "AttrEncoding", - "AttrEndianity", - "AttrEntrypc", - "AttrEnumClass", - "AttrExplicit", - "AttrExportSymbols", - "AttrExtension", - "AttrExternal", - "AttrFrameBase", - "AttrFriend", - "AttrHighpc", - "AttrIdentifierCase", - "AttrImport", - "AttrInline", - "AttrIsOptional", - "AttrLanguage", - "AttrLinkageName", - "AttrLocation", - "AttrLoclistsBase", - "AttrLowerBound", - "AttrLowpc", - "AttrMacroInfo", - "AttrMacros", - "AttrMainSubprogram", - "AttrMutable", - "AttrName", - "AttrNamelistItem", - "AttrNoreturn", - "AttrObjectPointer", - "AttrOrdering", - "AttrPictureString", - "AttrPriority", - "AttrProducer", - "AttrPrototyped", - "AttrPure", - "AttrRanges", - "AttrRank", - "AttrRecursive", - "AttrReference", - "AttrReturnAddr", - "AttrRnglistsBase", - "AttrRvalueReference", - "AttrSegment", - "AttrSibling", - "AttrSignature", - "AttrSmall", - "AttrSpecification", - "AttrStartScope", - "AttrStaticLink", - "AttrStmtList", - "AttrStrOffsetsBase", - "AttrStride", - "AttrStrideSize", - "AttrStringLength", - "AttrStringLengthBitSize", - "AttrStringLengthByteSize", - "AttrThreadsScaled", - "AttrTrampoline", - "AttrType", - "AttrUpperBound", - "AttrUseLocation", - "AttrUseUTF8", - "AttrVarParam", - "AttrVirtuality", - "AttrVisibility", - "AttrVtableElemLoc", - "BasicType", - "BoolType", - "CharType", - "Class", - "ClassAddrPtr", - "ClassAddress", - "ClassBlock", - "ClassConstant", - "ClassExprLoc", - "ClassFlag", - "ClassLinePtr", - "ClassLocList", - "ClassLocListPtr", - "ClassMacPtr", - "ClassRangeListPtr", - "ClassReference", - "ClassReferenceAlt", - "ClassReferenceSig", - "ClassRngList", - "ClassRngListsPtr", - "ClassStrOffsetsPtr", - "ClassString", - "ClassStringAlt", - "ClassUnknown", - "CommonType", - "ComplexType", - "Data", - "DecodeError", - "DotDotDotType", - "Entry", - "EnumType", - "EnumValue", - "ErrUnknownPC", - "Field", - "FloatType", - "FuncType", - "IntType", - "LineEntry", - "LineFile", - "LineReader", - "LineReaderPos", - "New", - "Offset", - "PtrType", - "QualType", - "Reader", - "StructField", - "StructType", - "Tag", - "TagAccessDeclaration", - "TagArrayType", - "TagAtomicType", - "TagBaseType", - "TagCallSite", - "TagCallSiteParameter", - "TagCatchDwarfBlock", - "TagClassType", - "TagCoarrayType", - "TagCommonDwarfBlock", - "TagCommonInclusion", - "TagCompileUnit", - "TagCondition", - "TagConstType", - "TagConstant", - "TagDwarfProcedure", - "TagDynamicType", - "TagEntryPoint", - "TagEnumerationType", - "TagEnumerator", - "TagFileType", - "TagFormalParameter", - "TagFriend", - "TagGenericSubrange", - "TagImmutableType", - "TagImportedDeclaration", - "TagImportedModule", - "TagImportedUnit", - "TagInheritance", - "TagInlinedSubroutine", - "TagInterfaceType", - "TagLabel", - "TagLexDwarfBlock", - "TagMember", - "TagModule", - "TagMutableType", - "TagNamelist", - "TagNamelistItem", - "TagNamespace", - "TagPackedType", - "TagPartialUnit", - "TagPointerType", - "TagPtrToMemberType", - "TagReferenceType", - "TagRestrictType", - "TagRvalueReferenceType", - "TagSetType", - "TagSharedType", - "TagSkeletonUnit", - "TagStringType", - "TagStructType", - "TagSubprogram", - "TagSubrangeType", - "TagSubroutineType", - "TagTemplateAlias", - "TagTemplateTypeParameter", - "TagTemplateValueParameter", - "TagThrownType", - "TagTryDwarfBlock", - "TagTypeUnit", - "TagTypedef", - "TagUnionType", - "TagUnspecifiedParameters", - "TagUnspecifiedType", - "TagVariable", - "TagVariant", - "TagVariantPart", - "TagVolatileType", - "TagWithStmt", - "Type", - "TypedefType", - "UcharType", - "UintType", - "UnspecifiedType", - "UnsupportedType", - "VoidType", - }, - "debug/elf": []string{ - "ARM_MAGIC_TRAMP_NUMBER", - "COMPRESS_HIOS", - "COMPRESS_HIPROC", - "COMPRESS_LOOS", - "COMPRESS_LOPROC", - "COMPRESS_ZLIB", - "Chdr32", - "Chdr64", - "Class", - "CompressionType", - "DF_BIND_NOW", - "DF_ORIGIN", - "DF_STATIC_TLS", - "DF_SYMBOLIC", - "DF_TEXTREL", - "DT_ADDRRNGHI", - "DT_ADDRRNGLO", - "DT_AUDIT", - "DT_AUXILIARY", - "DT_BIND_NOW", - "DT_CHECKSUM", - "DT_CONFIG", - "DT_DEBUG", - "DT_DEPAUDIT", - "DT_ENCODING", - "DT_FEATURE", - "DT_FILTER", - "DT_FINI", - "DT_FINI_ARRAY", - "DT_FINI_ARRAYSZ", - "DT_FLAGS", - "DT_FLAGS_1", - "DT_GNU_CONFLICT", - "DT_GNU_CONFLICTSZ", - "DT_GNU_HASH", - "DT_GNU_LIBLIST", - "DT_GNU_LIBLISTSZ", - "DT_GNU_PRELINKED", - "DT_HASH", - "DT_HIOS", - "DT_HIPROC", - "DT_INIT", - "DT_INIT_ARRAY", - "DT_INIT_ARRAYSZ", - "DT_JMPREL", - "DT_LOOS", - "DT_LOPROC", - "DT_MIPS_AUX_DYNAMIC", - "DT_MIPS_BASE_ADDRESS", - "DT_MIPS_COMPACT_SIZE", - "DT_MIPS_CONFLICT", - "DT_MIPS_CONFLICTNO", - "DT_MIPS_CXX_FLAGS", - "DT_MIPS_DELTA_CLASS", - "DT_MIPS_DELTA_CLASSSYM", - "DT_MIPS_DELTA_CLASSSYM_NO", - "DT_MIPS_DELTA_CLASS_NO", - "DT_MIPS_DELTA_INSTANCE", - "DT_MIPS_DELTA_INSTANCE_NO", - "DT_MIPS_DELTA_RELOC", - "DT_MIPS_DELTA_RELOC_NO", - "DT_MIPS_DELTA_SYM", - "DT_MIPS_DELTA_SYM_NO", - "DT_MIPS_DYNSTR_ALIGN", - "DT_MIPS_FLAGS", - "DT_MIPS_GOTSYM", - "DT_MIPS_GP_VALUE", - "DT_MIPS_HIDDEN_GOTIDX", - "DT_MIPS_HIPAGENO", - "DT_MIPS_ICHECKSUM", - "DT_MIPS_INTERFACE", - "DT_MIPS_INTERFACE_SIZE", - "DT_MIPS_IVERSION", - "DT_MIPS_LIBLIST", - "DT_MIPS_LIBLISTNO", - "DT_MIPS_LOCALPAGE_GOTIDX", - "DT_MIPS_LOCAL_GOTIDX", - "DT_MIPS_LOCAL_GOTNO", - "DT_MIPS_MSYM", - "DT_MIPS_OPTIONS", - "DT_MIPS_PERF_SUFFIX", - "DT_MIPS_PIXIE_INIT", - "DT_MIPS_PLTGOT", - "DT_MIPS_PROTECTED_GOTIDX", - "DT_MIPS_RLD_MAP", - "DT_MIPS_RLD_MAP_REL", - "DT_MIPS_RLD_TEXT_RESOLVE_ADDR", - "DT_MIPS_RLD_VERSION", - "DT_MIPS_RWPLT", - "DT_MIPS_SYMBOL_LIB", - "DT_MIPS_SYMTABNO", - "DT_MIPS_TIME_STAMP", - "DT_MIPS_UNREFEXTNO", - "DT_MOVEENT", - "DT_MOVESZ", - "DT_MOVETAB", - "DT_NEEDED", - "DT_NULL", - "DT_PLTGOT", - "DT_PLTPAD", - "DT_PLTPADSZ", - "DT_PLTREL", - "DT_PLTRELSZ", - "DT_POSFLAG_1", - "DT_PPC64_GLINK", - "DT_PPC64_OPD", - "DT_PPC64_OPDSZ", - "DT_PPC64_OPT", - "DT_PPC_GOT", - "DT_PPC_OPT", - "DT_PREINIT_ARRAY", - "DT_PREINIT_ARRAYSZ", - "DT_REL", - "DT_RELA", - "DT_RELACOUNT", - "DT_RELAENT", - "DT_RELASZ", - "DT_RELCOUNT", - "DT_RELENT", - "DT_RELSZ", - "DT_RPATH", - "DT_RUNPATH", - "DT_SONAME", - "DT_SPARC_REGISTER", - "DT_STRSZ", - "DT_STRTAB", - "DT_SYMBOLIC", - "DT_SYMENT", - "DT_SYMINENT", - "DT_SYMINFO", - "DT_SYMINSZ", - "DT_SYMTAB", - "DT_SYMTAB_SHNDX", - "DT_TEXTREL", - "DT_TLSDESC_GOT", - "DT_TLSDESC_PLT", - "DT_USED", - "DT_VALRNGHI", - "DT_VALRNGLO", - "DT_VERDEF", - "DT_VERDEFNUM", - "DT_VERNEED", - "DT_VERNEEDNUM", - "DT_VERSYM", - "Data", - "Dyn32", - "Dyn64", - "DynFlag", - "DynTag", - "EI_ABIVERSION", - "EI_CLASS", - "EI_DATA", - "EI_NIDENT", - "EI_OSABI", - "EI_PAD", - "EI_VERSION", - "ELFCLASS32", - "ELFCLASS64", - "ELFCLASSNONE", - "ELFDATA2LSB", - "ELFDATA2MSB", - "ELFDATANONE", - "ELFMAG", - "ELFOSABI_86OPEN", - "ELFOSABI_AIX", - "ELFOSABI_ARM", - "ELFOSABI_AROS", - "ELFOSABI_CLOUDABI", - "ELFOSABI_FENIXOS", - "ELFOSABI_FREEBSD", - "ELFOSABI_HPUX", - "ELFOSABI_HURD", - "ELFOSABI_IRIX", - "ELFOSABI_LINUX", - "ELFOSABI_MODESTO", - "ELFOSABI_NETBSD", - "ELFOSABI_NONE", - "ELFOSABI_NSK", - "ELFOSABI_OPENBSD", - "ELFOSABI_OPENVMS", - "ELFOSABI_SOLARIS", - "ELFOSABI_STANDALONE", - "ELFOSABI_TRU64", - "EM_386", - "EM_486", - "EM_56800EX", - "EM_68HC05", - "EM_68HC08", - "EM_68HC11", - "EM_68HC12", - "EM_68HC16", - "EM_68K", - "EM_78KOR", - "EM_8051", - "EM_860", - "EM_88K", - "EM_960", - "EM_AARCH64", - "EM_ALPHA", - "EM_ALPHA_STD", - "EM_ALTERA_NIOS2", - "EM_AMDGPU", - "EM_ARC", - "EM_ARCA", - "EM_ARC_COMPACT", - "EM_ARC_COMPACT2", - "EM_ARM", - "EM_AVR", - "EM_AVR32", - "EM_BA1", - "EM_BA2", - "EM_BLACKFIN", - "EM_BPF", - "EM_C166", - "EM_CDP", - "EM_CE", - "EM_CLOUDSHIELD", - "EM_COGE", - "EM_COLDFIRE", - "EM_COOL", - "EM_COREA_1ST", - "EM_COREA_2ND", - "EM_CR", - "EM_CR16", - "EM_CRAYNV2", - "EM_CRIS", - "EM_CRX", - "EM_CSR_KALIMBA", - "EM_CUDA", - "EM_CYPRESS_M8C", - "EM_D10V", - "EM_D30V", - "EM_DSP24", - "EM_DSPIC30F", - "EM_DXP", - "EM_ECOG1", - "EM_ECOG16", - "EM_ECOG1X", - "EM_ECOG2", - "EM_ETPU", - "EM_EXCESS", - "EM_F2MC16", - "EM_FIREPATH", - "EM_FR20", - "EM_FR30", - "EM_FT32", - "EM_FX66", - "EM_H8S", - "EM_H8_300", - "EM_H8_300H", - "EM_H8_500", - "EM_HUANY", - "EM_IA_64", - "EM_INTEL205", - "EM_INTEL206", - "EM_INTEL207", - "EM_INTEL208", - "EM_INTEL209", - "EM_IP2K", - "EM_JAVELIN", - "EM_K10M", - "EM_KM32", - "EM_KMX16", - "EM_KMX32", - "EM_KMX8", - "EM_KVARC", - "EM_L10M", - "EM_LANAI", - "EM_LATTICEMICO32", - "EM_M16C", - "EM_M32", - "EM_M32C", - "EM_M32R", - "EM_MANIK", - "EM_MAX", - "EM_MAXQ30", - "EM_MCHP_PIC", - "EM_MCST_ELBRUS", - "EM_ME16", - "EM_METAG", - "EM_MICROBLAZE", - "EM_MIPS", - "EM_MIPS_RS3_LE", - "EM_MIPS_RS4_BE", - "EM_MIPS_X", - "EM_MMA", - "EM_MMDSP_PLUS", - "EM_MMIX", - "EM_MN10200", - "EM_MN10300", - "EM_MOXIE", - "EM_MSP430", - "EM_NCPU", - "EM_NDR1", - "EM_NDS32", - "EM_NONE", - "EM_NORC", - "EM_NS32K", - "EM_OPEN8", - "EM_OPENRISC", - "EM_PARISC", - "EM_PCP", - "EM_PDP10", - "EM_PDP11", - "EM_PDSP", - "EM_PJ", - "EM_PPC", - "EM_PPC64", - "EM_PRISM", - "EM_QDSP6", - "EM_R32C", - "EM_RCE", - "EM_RH32", - "EM_RISCV", - "EM_RL78", - "EM_RS08", - "EM_RX", - "EM_S370", - "EM_S390", - "EM_SCORE7", - "EM_SEP", - "EM_SE_C17", - "EM_SE_C33", - "EM_SH", - "EM_SHARC", - "EM_SLE9X", - "EM_SNP1K", - "EM_SPARC", - "EM_SPARC32PLUS", - "EM_SPARCV9", - "EM_ST100", - "EM_ST19", - "EM_ST200", - "EM_ST7", - "EM_ST9PLUS", - "EM_STARCORE", - "EM_STM8", - "EM_STXP7X", - "EM_SVX", - "EM_TILE64", - "EM_TILEGX", - "EM_TILEPRO", - "EM_TINYJ", - "EM_TI_ARP32", - "EM_TI_C2000", - "EM_TI_C5500", - "EM_TI_C6000", - "EM_TI_PRU", - "EM_TMM_GPP", - "EM_TPC", - "EM_TRICORE", - "EM_TRIMEDIA", - "EM_TSK3000", - "EM_UNICORE", - "EM_V800", - "EM_V850", - "EM_VAX", - "EM_VIDEOCORE", - "EM_VIDEOCORE3", - "EM_VIDEOCORE5", - "EM_VISIUM", - "EM_VPP500", - "EM_X86_64", - "EM_XCORE", - "EM_XGATE", - "EM_XIMO16", - "EM_XTENSA", - "EM_Z80", - "EM_ZSP", - "ET_CORE", - "ET_DYN", - "ET_EXEC", - "ET_HIOS", - "ET_HIPROC", - "ET_LOOS", - "ET_LOPROC", - "ET_NONE", - "ET_REL", - "EV_CURRENT", - "EV_NONE", - "ErrNoSymbols", - "File", - "FileHeader", - "FormatError", - "Header32", - "Header64", - "ImportedSymbol", - "Machine", - "NT_FPREGSET", - "NT_PRPSINFO", - "NT_PRSTATUS", - "NType", - "NewFile", - "OSABI", - "Open", - "PF_MASKOS", - "PF_MASKPROC", - "PF_R", - "PF_W", - "PF_X", - "PT_AARCH64_ARCHEXT", - "PT_AARCH64_UNWIND", - "PT_ARM_ARCHEXT", - "PT_ARM_EXIDX", - "PT_DYNAMIC", - "PT_GNU_EH_FRAME", - "PT_GNU_MBIND_HI", - "PT_GNU_MBIND_LO", - "PT_GNU_PROPERTY", - "PT_GNU_RELRO", - "PT_GNU_STACK", - "PT_HIOS", - "PT_HIPROC", - "PT_INTERP", - "PT_LOAD", - "PT_LOOS", - "PT_LOPROC", - "PT_MIPS_ABIFLAGS", - "PT_MIPS_OPTIONS", - "PT_MIPS_REGINFO", - "PT_MIPS_RTPROC", - "PT_NOTE", - "PT_NULL", - "PT_OPENBSD_BOOTDATA", - "PT_OPENBSD_RANDOMIZE", - "PT_OPENBSD_WXNEEDED", - "PT_PAX_FLAGS", - "PT_PHDR", - "PT_S390_PGSTE", - "PT_SHLIB", - "PT_SUNWSTACK", - "PT_SUNW_EH_FRAME", - "PT_TLS", - "Prog", - "Prog32", - "Prog64", - "ProgFlag", - "ProgHeader", - "ProgType", - "R_386", - "R_386_16", - "R_386_32", - "R_386_32PLT", - "R_386_8", - "R_386_COPY", - "R_386_GLOB_DAT", - "R_386_GOT32", - "R_386_GOT32X", - "R_386_GOTOFF", - "R_386_GOTPC", - "R_386_IRELATIVE", - "R_386_JMP_SLOT", - "R_386_NONE", - "R_386_PC16", - "R_386_PC32", - "R_386_PC8", - "R_386_PLT32", - "R_386_RELATIVE", - "R_386_SIZE32", - "R_386_TLS_DESC", - "R_386_TLS_DESC_CALL", - "R_386_TLS_DTPMOD32", - "R_386_TLS_DTPOFF32", - "R_386_TLS_GD", - "R_386_TLS_GD_32", - "R_386_TLS_GD_CALL", - "R_386_TLS_GD_POP", - "R_386_TLS_GD_PUSH", - "R_386_TLS_GOTDESC", - "R_386_TLS_GOTIE", - "R_386_TLS_IE", - "R_386_TLS_IE_32", - "R_386_TLS_LDM", - "R_386_TLS_LDM_32", - "R_386_TLS_LDM_CALL", - "R_386_TLS_LDM_POP", - "R_386_TLS_LDM_PUSH", - "R_386_TLS_LDO_32", - "R_386_TLS_LE", - "R_386_TLS_LE_32", - "R_386_TLS_TPOFF", - "R_386_TLS_TPOFF32", - "R_390", - "R_390_12", - "R_390_16", - "R_390_20", - "R_390_32", - "R_390_64", - "R_390_8", - "R_390_COPY", - "R_390_GLOB_DAT", - "R_390_GOT12", - "R_390_GOT16", - "R_390_GOT20", - "R_390_GOT32", - "R_390_GOT64", - "R_390_GOTENT", - "R_390_GOTOFF", - "R_390_GOTOFF16", - "R_390_GOTOFF64", - "R_390_GOTPC", - "R_390_GOTPCDBL", - "R_390_GOTPLT12", - "R_390_GOTPLT16", - "R_390_GOTPLT20", - "R_390_GOTPLT32", - "R_390_GOTPLT64", - "R_390_GOTPLTENT", - "R_390_GOTPLTOFF16", - "R_390_GOTPLTOFF32", - "R_390_GOTPLTOFF64", - "R_390_JMP_SLOT", - "R_390_NONE", - "R_390_PC16", - "R_390_PC16DBL", - "R_390_PC32", - "R_390_PC32DBL", - "R_390_PC64", - "R_390_PLT16DBL", - "R_390_PLT32", - "R_390_PLT32DBL", - "R_390_PLT64", - "R_390_RELATIVE", - "R_390_TLS_DTPMOD", - "R_390_TLS_DTPOFF", - "R_390_TLS_GD32", - "R_390_TLS_GD64", - "R_390_TLS_GDCALL", - "R_390_TLS_GOTIE12", - "R_390_TLS_GOTIE20", - "R_390_TLS_GOTIE32", - "R_390_TLS_GOTIE64", - "R_390_TLS_IE32", - "R_390_TLS_IE64", - "R_390_TLS_IEENT", - "R_390_TLS_LDCALL", - "R_390_TLS_LDM32", - "R_390_TLS_LDM64", - "R_390_TLS_LDO32", - "R_390_TLS_LDO64", - "R_390_TLS_LE32", - "R_390_TLS_LE64", - "R_390_TLS_LOAD", - "R_390_TLS_TPOFF", - "R_AARCH64", - "R_AARCH64_ABS16", - "R_AARCH64_ABS32", - "R_AARCH64_ABS64", - "R_AARCH64_ADD_ABS_LO12_NC", - "R_AARCH64_ADR_GOT_PAGE", - "R_AARCH64_ADR_PREL_LO21", - "R_AARCH64_ADR_PREL_PG_HI21", - "R_AARCH64_ADR_PREL_PG_HI21_NC", - "R_AARCH64_CALL26", - "R_AARCH64_CONDBR19", - "R_AARCH64_COPY", - "R_AARCH64_GLOB_DAT", - "R_AARCH64_GOT_LD_PREL19", - "R_AARCH64_IRELATIVE", - "R_AARCH64_JUMP26", - "R_AARCH64_JUMP_SLOT", - "R_AARCH64_LD64_GOTOFF_LO15", - "R_AARCH64_LD64_GOTPAGE_LO15", - "R_AARCH64_LD64_GOT_LO12_NC", - "R_AARCH64_LDST128_ABS_LO12_NC", - "R_AARCH64_LDST16_ABS_LO12_NC", - "R_AARCH64_LDST32_ABS_LO12_NC", - "R_AARCH64_LDST64_ABS_LO12_NC", - "R_AARCH64_LDST8_ABS_LO12_NC", - "R_AARCH64_LD_PREL_LO19", - "R_AARCH64_MOVW_SABS_G0", - "R_AARCH64_MOVW_SABS_G1", - "R_AARCH64_MOVW_SABS_G2", - "R_AARCH64_MOVW_UABS_G0", - "R_AARCH64_MOVW_UABS_G0_NC", - "R_AARCH64_MOVW_UABS_G1", - "R_AARCH64_MOVW_UABS_G1_NC", - "R_AARCH64_MOVW_UABS_G2", - "R_AARCH64_MOVW_UABS_G2_NC", - "R_AARCH64_MOVW_UABS_G3", - "R_AARCH64_NONE", - "R_AARCH64_NULL", - "R_AARCH64_P32_ABS16", - "R_AARCH64_P32_ABS32", - "R_AARCH64_P32_ADD_ABS_LO12_NC", - "R_AARCH64_P32_ADR_GOT_PAGE", - "R_AARCH64_P32_ADR_PREL_LO21", - "R_AARCH64_P32_ADR_PREL_PG_HI21", - "R_AARCH64_P32_CALL26", - "R_AARCH64_P32_CONDBR19", - "R_AARCH64_P32_COPY", - "R_AARCH64_P32_GLOB_DAT", - "R_AARCH64_P32_GOT_LD_PREL19", - "R_AARCH64_P32_IRELATIVE", - "R_AARCH64_P32_JUMP26", - "R_AARCH64_P32_JUMP_SLOT", - "R_AARCH64_P32_LD32_GOT_LO12_NC", - "R_AARCH64_P32_LDST128_ABS_LO12_NC", - "R_AARCH64_P32_LDST16_ABS_LO12_NC", - "R_AARCH64_P32_LDST32_ABS_LO12_NC", - "R_AARCH64_P32_LDST64_ABS_LO12_NC", - "R_AARCH64_P32_LDST8_ABS_LO12_NC", - "R_AARCH64_P32_LD_PREL_LO19", - "R_AARCH64_P32_MOVW_SABS_G0", - "R_AARCH64_P32_MOVW_UABS_G0", - "R_AARCH64_P32_MOVW_UABS_G0_NC", - "R_AARCH64_P32_MOVW_UABS_G1", - "R_AARCH64_P32_PREL16", - "R_AARCH64_P32_PREL32", - "R_AARCH64_P32_RELATIVE", - "R_AARCH64_P32_TLSDESC", - "R_AARCH64_P32_TLSDESC_ADD_LO12_NC", - "R_AARCH64_P32_TLSDESC_ADR_PAGE21", - "R_AARCH64_P32_TLSDESC_ADR_PREL21", - "R_AARCH64_P32_TLSDESC_CALL", - "R_AARCH64_P32_TLSDESC_LD32_LO12_NC", - "R_AARCH64_P32_TLSDESC_LD_PREL19", - "R_AARCH64_P32_TLSGD_ADD_LO12_NC", - "R_AARCH64_P32_TLSGD_ADR_PAGE21", - "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", - "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", - "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", - "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", - "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", - "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", - "R_AARCH64_P32_TLS_DTPMOD", - "R_AARCH64_P32_TLS_DTPREL", - "R_AARCH64_P32_TLS_TPREL", - "R_AARCH64_P32_TSTBR14", - "R_AARCH64_PREL16", - "R_AARCH64_PREL32", - "R_AARCH64_PREL64", - "R_AARCH64_RELATIVE", - "R_AARCH64_TLSDESC", - "R_AARCH64_TLSDESC_ADD", - "R_AARCH64_TLSDESC_ADD_LO12_NC", - "R_AARCH64_TLSDESC_ADR_PAGE21", - "R_AARCH64_TLSDESC_ADR_PREL21", - "R_AARCH64_TLSDESC_CALL", - "R_AARCH64_TLSDESC_LD64_LO12_NC", - "R_AARCH64_TLSDESC_LDR", - "R_AARCH64_TLSDESC_LD_PREL19", - "R_AARCH64_TLSDESC_OFF_G0_NC", - "R_AARCH64_TLSDESC_OFF_G1", - "R_AARCH64_TLSGD_ADD_LO12_NC", - "R_AARCH64_TLSGD_ADR_PAGE21", - "R_AARCH64_TLSGD_ADR_PREL21", - "R_AARCH64_TLSGD_MOVW_G0_NC", - "R_AARCH64_TLSGD_MOVW_G1", - "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", - "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", - "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", - "R_AARCH64_TLSLD_ADR_PAGE21", - "R_AARCH64_TLSLD_ADR_PREL21", - "R_AARCH64_TLSLD_LDST128_DTPREL_LO12", - "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", - "R_AARCH64_TLSLE_ADD_TPREL_HI12", - "R_AARCH64_TLSLE_ADD_TPREL_LO12", - "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", - "R_AARCH64_TLSLE_LDST128_TPREL_LO12", - "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G0", - "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G1", - "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G2", - "R_AARCH64_TLS_DTPMOD64", - "R_AARCH64_TLS_DTPREL64", - "R_AARCH64_TLS_TPREL64", - "R_AARCH64_TSTBR14", - "R_ALPHA", - "R_ALPHA_BRADDR", - "R_ALPHA_COPY", - "R_ALPHA_GLOB_DAT", - "R_ALPHA_GPDISP", - "R_ALPHA_GPREL32", - "R_ALPHA_GPRELHIGH", - "R_ALPHA_GPRELLOW", - "R_ALPHA_GPVALUE", - "R_ALPHA_HINT", - "R_ALPHA_IMMED_BR_HI32", - "R_ALPHA_IMMED_GP_16", - "R_ALPHA_IMMED_GP_HI32", - "R_ALPHA_IMMED_LO32", - "R_ALPHA_IMMED_SCN_HI32", - "R_ALPHA_JMP_SLOT", - "R_ALPHA_LITERAL", - "R_ALPHA_LITUSE", - "R_ALPHA_NONE", - "R_ALPHA_OP_PRSHIFT", - "R_ALPHA_OP_PSUB", - "R_ALPHA_OP_PUSH", - "R_ALPHA_OP_STORE", - "R_ALPHA_REFLONG", - "R_ALPHA_REFQUAD", - "R_ALPHA_RELATIVE", - "R_ALPHA_SREL16", - "R_ALPHA_SREL32", - "R_ALPHA_SREL64", - "R_ARM", - "R_ARM_ABS12", - "R_ARM_ABS16", - "R_ARM_ABS32", - "R_ARM_ABS32_NOI", - "R_ARM_ABS8", - "R_ARM_ALU_PCREL_15_8", - "R_ARM_ALU_PCREL_23_15", - "R_ARM_ALU_PCREL_7_0", - "R_ARM_ALU_PC_G0", - "R_ARM_ALU_PC_G0_NC", - "R_ARM_ALU_PC_G1", - "R_ARM_ALU_PC_G1_NC", - "R_ARM_ALU_PC_G2", - "R_ARM_ALU_SBREL_19_12_NC", - "R_ARM_ALU_SBREL_27_20_CK", - "R_ARM_ALU_SB_G0", - "R_ARM_ALU_SB_G0_NC", - "R_ARM_ALU_SB_G1", - "R_ARM_ALU_SB_G1_NC", - "R_ARM_ALU_SB_G2", - "R_ARM_AMP_VCALL9", - "R_ARM_BASE_ABS", - "R_ARM_CALL", - "R_ARM_COPY", - "R_ARM_GLOB_DAT", - "R_ARM_GNU_VTENTRY", - "R_ARM_GNU_VTINHERIT", - "R_ARM_GOT32", - "R_ARM_GOTOFF", - "R_ARM_GOTOFF12", - "R_ARM_GOTPC", - "R_ARM_GOTRELAX", - "R_ARM_GOT_ABS", - "R_ARM_GOT_BREL12", - "R_ARM_GOT_PREL", - "R_ARM_IRELATIVE", - "R_ARM_JUMP24", - "R_ARM_JUMP_SLOT", - "R_ARM_LDC_PC_G0", - "R_ARM_LDC_PC_G1", - "R_ARM_LDC_PC_G2", - "R_ARM_LDC_SB_G0", - "R_ARM_LDC_SB_G1", - "R_ARM_LDC_SB_G2", - "R_ARM_LDRS_PC_G0", - "R_ARM_LDRS_PC_G1", - "R_ARM_LDRS_PC_G2", - "R_ARM_LDRS_SB_G0", - "R_ARM_LDRS_SB_G1", - "R_ARM_LDRS_SB_G2", - "R_ARM_LDR_PC_G1", - "R_ARM_LDR_PC_G2", - "R_ARM_LDR_SBREL_11_10_NC", - "R_ARM_LDR_SB_G0", - "R_ARM_LDR_SB_G1", - "R_ARM_LDR_SB_G2", - "R_ARM_ME_TOO", - "R_ARM_MOVT_ABS", - "R_ARM_MOVT_BREL", - "R_ARM_MOVT_PREL", - "R_ARM_MOVW_ABS_NC", - "R_ARM_MOVW_BREL", - "R_ARM_MOVW_BREL_NC", - "R_ARM_MOVW_PREL_NC", - "R_ARM_NONE", - "R_ARM_PC13", - "R_ARM_PC24", - "R_ARM_PLT32", - "R_ARM_PLT32_ABS", - "R_ARM_PREL31", - "R_ARM_PRIVATE_0", - "R_ARM_PRIVATE_1", - "R_ARM_PRIVATE_10", - "R_ARM_PRIVATE_11", - "R_ARM_PRIVATE_12", - "R_ARM_PRIVATE_13", - "R_ARM_PRIVATE_14", - "R_ARM_PRIVATE_15", - "R_ARM_PRIVATE_2", - "R_ARM_PRIVATE_3", - "R_ARM_PRIVATE_4", - "R_ARM_PRIVATE_5", - "R_ARM_PRIVATE_6", - "R_ARM_PRIVATE_7", - "R_ARM_PRIVATE_8", - "R_ARM_PRIVATE_9", - "R_ARM_RABS32", - "R_ARM_RBASE", - "R_ARM_REL32", - "R_ARM_REL32_NOI", - "R_ARM_RELATIVE", - "R_ARM_RPC24", - "R_ARM_RREL32", - "R_ARM_RSBREL32", - "R_ARM_RXPC25", - "R_ARM_SBREL31", - "R_ARM_SBREL32", - "R_ARM_SWI24", - "R_ARM_TARGET1", - "R_ARM_TARGET2", - "R_ARM_THM_ABS5", - "R_ARM_THM_ALU_ABS_G0_NC", - "R_ARM_THM_ALU_ABS_G1_NC", - "R_ARM_THM_ALU_ABS_G2_NC", - "R_ARM_THM_ALU_ABS_G3", - "R_ARM_THM_ALU_PREL_11_0", - "R_ARM_THM_GOT_BREL12", - "R_ARM_THM_JUMP11", - "R_ARM_THM_JUMP19", - "R_ARM_THM_JUMP24", - "R_ARM_THM_JUMP6", - "R_ARM_THM_JUMP8", - "R_ARM_THM_MOVT_ABS", - "R_ARM_THM_MOVT_BREL", - "R_ARM_THM_MOVT_PREL", - "R_ARM_THM_MOVW_ABS_NC", - "R_ARM_THM_MOVW_BREL", - "R_ARM_THM_MOVW_BREL_NC", - "R_ARM_THM_MOVW_PREL_NC", - "R_ARM_THM_PC12", - "R_ARM_THM_PC22", - "R_ARM_THM_PC8", - "R_ARM_THM_RPC22", - "R_ARM_THM_SWI8", - "R_ARM_THM_TLS_CALL", - "R_ARM_THM_TLS_DESCSEQ16", - "R_ARM_THM_TLS_DESCSEQ32", - "R_ARM_THM_XPC22", - "R_ARM_TLS_CALL", - "R_ARM_TLS_DESCSEQ", - "R_ARM_TLS_DTPMOD32", - "R_ARM_TLS_DTPOFF32", - "R_ARM_TLS_GD32", - "R_ARM_TLS_GOTDESC", - "R_ARM_TLS_IE12GP", - "R_ARM_TLS_IE32", - "R_ARM_TLS_LDM32", - "R_ARM_TLS_LDO12", - "R_ARM_TLS_LDO32", - "R_ARM_TLS_LE12", - "R_ARM_TLS_LE32", - "R_ARM_TLS_TPOFF32", - "R_ARM_V4BX", - "R_ARM_XPC25", - "R_INFO", - "R_INFO32", - "R_MIPS", - "R_MIPS_16", - "R_MIPS_26", - "R_MIPS_32", - "R_MIPS_64", - "R_MIPS_ADD_IMMEDIATE", - "R_MIPS_CALL16", - "R_MIPS_CALL_HI16", - "R_MIPS_CALL_LO16", - "R_MIPS_DELETE", - "R_MIPS_GOT16", - "R_MIPS_GOT_DISP", - "R_MIPS_GOT_HI16", - "R_MIPS_GOT_LO16", - "R_MIPS_GOT_OFST", - "R_MIPS_GOT_PAGE", - "R_MIPS_GPREL16", - "R_MIPS_GPREL32", - "R_MIPS_HI16", - "R_MIPS_HIGHER", - "R_MIPS_HIGHEST", - "R_MIPS_INSERT_A", - "R_MIPS_INSERT_B", - "R_MIPS_JALR", - "R_MIPS_LITERAL", - "R_MIPS_LO16", - "R_MIPS_NONE", - "R_MIPS_PC16", - "R_MIPS_PJUMP", - "R_MIPS_REL16", - "R_MIPS_REL32", - "R_MIPS_RELGOT", - "R_MIPS_SCN_DISP", - "R_MIPS_SHIFT5", - "R_MIPS_SHIFT6", - "R_MIPS_SUB", - "R_MIPS_TLS_DTPMOD32", - "R_MIPS_TLS_DTPMOD64", - "R_MIPS_TLS_DTPREL32", - "R_MIPS_TLS_DTPREL64", - "R_MIPS_TLS_DTPREL_HI16", - "R_MIPS_TLS_DTPREL_LO16", - "R_MIPS_TLS_GD", - "R_MIPS_TLS_GOTTPREL", - "R_MIPS_TLS_LDM", - "R_MIPS_TLS_TPREL32", - "R_MIPS_TLS_TPREL64", - "R_MIPS_TLS_TPREL_HI16", - "R_MIPS_TLS_TPREL_LO16", - "R_PPC", - "R_PPC64", - "R_PPC64_ADDR14", - "R_PPC64_ADDR14_BRNTAKEN", - "R_PPC64_ADDR14_BRTAKEN", - "R_PPC64_ADDR16", - "R_PPC64_ADDR16_DS", - "R_PPC64_ADDR16_HA", - "R_PPC64_ADDR16_HI", - "R_PPC64_ADDR16_HIGH", - "R_PPC64_ADDR16_HIGHA", - "R_PPC64_ADDR16_HIGHER", - "R_PPC64_ADDR16_HIGHERA", - "R_PPC64_ADDR16_HIGHEST", - "R_PPC64_ADDR16_HIGHESTA", - "R_PPC64_ADDR16_LO", - "R_PPC64_ADDR16_LO_DS", - "R_PPC64_ADDR24", - "R_PPC64_ADDR32", - "R_PPC64_ADDR64", - "R_PPC64_ADDR64_LOCAL", - "R_PPC64_DTPMOD64", - "R_PPC64_DTPREL16", - "R_PPC64_DTPREL16_DS", - "R_PPC64_DTPREL16_HA", - "R_PPC64_DTPREL16_HI", - "R_PPC64_DTPREL16_HIGH", - "R_PPC64_DTPREL16_HIGHA", - "R_PPC64_DTPREL16_HIGHER", - "R_PPC64_DTPREL16_HIGHERA", - "R_PPC64_DTPREL16_HIGHEST", - "R_PPC64_DTPREL16_HIGHESTA", - "R_PPC64_DTPREL16_LO", - "R_PPC64_DTPREL16_LO_DS", - "R_PPC64_DTPREL64", - "R_PPC64_ENTRY", - "R_PPC64_GOT16", - "R_PPC64_GOT16_DS", - "R_PPC64_GOT16_HA", - "R_PPC64_GOT16_HI", - "R_PPC64_GOT16_LO", - "R_PPC64_GOT16_LO_DS", - "R_PPC64_GOT_DTPREL16_DS", - "R_PPC64_GOT_DTPREL16_HA", - "R_PPC64_GOT_DTPREL16_HI", - "R_PPC64_GOT_DTPREL16_LO_DS", - "R_PPC64_GOT_TLSGD16", - "R_PPC64_GOT_TLSGD16_HA", - "R_PPC64_GOT_TLSGD16_HI", - "R_PPC64_GOT_TLSGD16_LO", - "R_PPC64_GOT_TLSLD16", - "R_PPC64_GOT_TLSLD16_HA", - "R_PPC64_GOT_TLSLD16_HI", - "R_PPC64_GOT_TLSLD16_LO", - "R_PPC64_GOT_TPREL16_DS", - "R_PPC64_GOT_TPREL16_HA", - "R_PPC64_GOT_TPREL16_HI", - "R_PPC64_GOT_TPREL16_LO_DS", - "R_PPC64_IRELATIVE", - "R_PPC64_JMP_IREL", - "R_PPC64_JMP_SLOT", - "R_PPC64_NONE", - "R_PPC64_PLT16_LO_DS", - "R_PPC64_PLTGOT16", - "R_PPC64_PLTGOT16_DS", - "R_PPC64_PLTGOT16_HA", - "R_PPC64_PLTGOT16_HI", - "R_PPC64_PLTGOT16_LO", - "R_PPC64_PLTGOT_LO_DS", - "R_PPC64_REL14", - "R_PPC64_REL14_BRNTAKEN", - "R_PPC64_REL14_BRTAKEN", - "R_PPC64_REL16", - "R_PPC64_REL16DX_HA", - "R_PPC64_REL16_HA", - "R_PPC64_REL16_HI", - "R_PPC64_REL16_LO", - "R_PPC64_REL24", - "R_PPC64_REL24_NOTOC", - "R_PPC64_REL32", - "R_PPC64_REL64", - "R_PPC64_SECTOFF_DS", - "R_PPC64_SECTOFF_LO_DS", - "R_PPC64_TLS", - "R_PPC64_TLSGD", - "R_PPC64_TLSLD", - "R_PPC64_TOC", - "R_PPC64_TOC16", - "R_PPC64_TOC16_DS", - "R_PPC64_TOC16_HA", - "R_PPC64_TOC16_HI", - "R_PPC64_TOC16_LO", - "R_PPC64_TOC16_LO_DS", - "R_PPC64_TOCSAVE", - "R_PPC64_TPREL16", - "R_PPC64_TPREL16_DS", - "R_PPC64_TPREL16_HA", - "R_PPC64_TPREL16_HI", - "R_PPC64_TPREL16_HIGH", - "R_PPC64_TPREL16_HIGHA", - "R_PPC64_TPREL16_HIGHER", - "R_PPC64_TPREL16_HIGHERA", - "R_PPC64_TPREL16_HIGHEST", - "R_PPC64_TPREL16_HIGHESTA", - "R_PPC64_TPREL16_LO", - "R_PPC64_TPREL16_LO_DS", - "R_PPC64_TPREL64", - "R_PPC_ADDR14", - "R_PPC_ADDR14_BRNTAKEN", - "R_PPC_ADDR14_BRTAKEN", - "R_PPC_ADDR16", - "R_PPC_ADDR16_HA", - "R_PPC_ADDR16_HI", - "R_PPC_ADDR16_LO", - "R_PPC_ADDR24", - "R_PPC_ADDR32", - "R_PPC_COPY", - "R_PPC_DTPMOD32", - "R_PPC_DTPREL16", - "R_PPC_DTPREL16_HA", - "R_PPC_DTPREL16_HI", - "R_PPC_DTPREL16_LO", - "R_PPC_DTPREL32", - "R_PPC_EMB_BIT_FLD", - "R_PPC_EMB_MRKREF", - "R_PPC_EMB_NADDR16", - "R_PPC_EMB_NADDR16_HA", - "R_PPC_EMB_NADDR16_HI", - "R_PPC_EMB_NADDR16_LO", - "R_PPC_EMB_NADDR32", - "R_PPC_EMB_RELSDA", - "R_PPC_EMB_RELSEC16", - "R_PPC_EMB_RELST_HA", - "R_PPC_EMB_RELST_HI", - "R_PPC_EMB_RELST_LO", - "R_PPC_EMB_SDA21", - "R_PPC_EMB_SDA2I16", - "R_PPC_EMB_SDA2REL", - "R_PPC_EMB_SDAI16", - "R_PPC_GLOB_DAT", - "R_PPC_GOT16", - "R_PPC_GOT16_HA", - "R_PPC_GOT16_HI", - "R_PPC_GOT16_LO", - "R_PPC_GOT_TLSGD16", - "R_PPC_GOT_TLSGD16_HA", - "R_PPC_GOT_TLSGD16_HI", - "R_PPC_GOT_TLSGD16_LO", - "R_PPC_GOT_TLSLD16", - "R_PPC_GOT_TLSLD16_HA", - "R_PPC_GOT_TLSLD16_HI", - "R_PPC_GOT_TLSLD16_LO", - "R_PPC_GOT_TPREL16", - "R_PPC_GOT_TPREL16_HA", - "R_PPC_GOT_TPREL16_HI", - "R_PPC_GOT_TPREL16_LO", - "R_PPC_JMP_SLOT", - "R_PPC_LOCAL24PC", - "R_PPC_NONE", - "R_PPC_PLT16_HA", - "R_PPC_PLT16_HI", - "R_PPC_PLT16_LO", - "R_PPC_PLT32", - "R_PPC_PLTREL24", - "R_PPC_PLTREL32", - "R_PPC_REL14", - "R_PPC_REL14_BRNTAKEN", - "R_PPC_REL14_BRTAKEN", - "R_PPC_REL24", - "R_PPC_REL32", - "R_PPC_RELATIVE", - "R_PPC_SDAREL16", - "R_PPC_SECTOFF", - "R_PPC_SECTOFF_HA", - "R_PPC_SECTOFF_HI", - "R_PPC_SECTOFF_LO", - "R_PPC_TLS", - "R_PPC_TPREL16", - "R_PPC_TPREL16_HA", - "R_PPC_TPREL16_HI", - "R_PPC_TPREL16_LO", - "R_PPC_TPREL32", - "R_PPC_UADDR16", - "R_PPC_UADDR32", - "R_RISCV", - "R_RISCV_32", - "R_RISCV_32_PCREL", - "R_RISCV_64", - "R_RISCV_ADD16", - "R_RISCV_ADD32", - "R_RISCV_ADD64", - "R_RISCV_ADD8", - "R_RISCV_ALIGN", - "R_RISCV_BRANCH", - "R_RISCV_CALL", - "R_RISCV_CALL_PLT", - "R_RISCV_COPY", - "R_RISCV_GNU_VTENTRY", - "R_RISCV_GNU_VTINHERIT", - "R_RISCV_GOT_HI20", - "R_RISCV_GPREL_I", - "R_RISCV_GPREL_S", - "R_RISCV_HI20", - "R_RISCV_JAL", - "R_RISCV_JUMP_SLOT", - "R_RISCV_LO12_I", - "R_RISCV_LO12_S", - "R_RISCV_NONE", - "R_RISCV_PCREL_HI20", - "R_RISCV_PCREL_LO12_I", - "R_RISCV_PCREL_LO12_S", - "R_RISCV_RELATIVE", - "R_RISCV_RELAX", - "R_RISCV_RVC_BRANCH", - "R_RISCV_RVC_JUMP", - "R_RISCV_RVC_LUI", - "R_RISCV_SET16", - "R_RISCV_SET32", - "R_RISCV_SET6", - "R_RISCV_SET8", - "R_RISCV_SUB16", - "R_RISCV_SUB32", - "R_RISCV_SUB6", - "R_RISCV_SUB64", - "R_RISCV_SUB8", - "R_RISCV_TLS_DTPMOD32", - "R_RISCV_TLS_DTPMOD64", - "R_RISCV_TLS_DTPREL32", - "R_RISCV_TLS_DTPREL64", - "R_RISCV_TLS_GD_HI20", - "R_RISCV_TLS_GOT_HI20", - "R_RISCV_TLS_TPREL32", - "R_RISCV_TLS_TPREL64", - "R_RISCV_TPREL_ADD", - "R_RISCV_TPREL_HI20", - "R_RISCV_TPREL_I", - "R_RISCV_TPREL_LO12_I", - "R_RISCV_TPREL_LO12_S", - "R_RISCV_TPREL_S", - "R_SPARC", - "R_SPARC_10", - "R_SPARC_11", - "R_SPARC_13", - "R_SPARC_16", - "R_SPARC_22", - "R_SPARC_32", - "R_SPARC_5", - "R_SPARC_6", - "R_SPARC_64", - "R_SPARC_7", - "R_SPARC_8", - "R_SPARC_COPY", - "R_SPARC_DISP16", - "R_SPARC_DISP32", - "R_SPARC_DISP64", - "R_SPARC_DISP8", - "R_SPARC_GLOB_DAT", - "R_SPARC_GLOB_JMP", - "R_SPARC_GOT10", - "R_SPARC_GOT13", - "R_SPARC_GOT22", - "R_SPARC_H44", - "R_SPARC_HH22", - "R_SPARC_HI22", - "R_SPARC_HIPLT22", - "R_SPARC_HIX22", - "R_SPARC_HM10", - "R_SPARC_JMP_SLOT", - "R_SPARC_L44", - "R_SPARC_LM22", - "R_SPARC_LO10", - "R_SPARC_LOPLT10", - "R_SPARC_LOX10", - "R_SPARC_M44", - "R_SPARC_NONE", - "R_SPARC_OLO10", - "R_SPARC_PC10", - "R_SPARC_PC22", - "R_SPARC_PCPLT10", - "R_SPARC_PCPLT22", - "R_SPARC_PCPLT32", - "R_SPARC_PC_HH22", - "R_SPARC_PC_HM10", - "R_SPARC_PC_LM22", - "R_SPARC_PLT32", - "R_SPARC_PLT64", - "R_SPARC_REGISTER", - "R_SPARC_RELATIVE", - "R_SPARC_UA16", - "R_SPARC_UA32", - "R_SPARC_UA64", - "R_SPARC_WDISP16", - "R_SPARC_WDISP19", - "R_SPARC_WDISP22", - "R_SPARC_WDISP30", - "R_SPARC_WPLT30", - "R_SYM32", - "R_SYM64", - "R_TYPE32", - "R_TYPE64", - "R_X86_64", - "R_X86_64_16", - "R_X86_64_32", - "R_X86_64_32S", - "R_X86_64_64", - "R_X86_64_8", - "R_X86_64_COPY", - "R_X86_64_DTPMOD64", - "R_X86_64_DTPOFF32", - "R_X86_64_DTPOFF64", - "R_X86_64_GLOB_DAT", - "R_X86_64_GOT32", - "R_X86_64_GOT64", - "R_X86_64_GOTOFF64", - "R_X86_64_GOTPC32", - "R_X86_64_GOTPC32_TLSDESC", - "R_X86_64_GOTPC64", - "R_X86_64_GOTPCREL", - "R_X86_64_GOTPCREL64", - "R_X86_64_GOTPCRELX", - "R_X86_64_GOTPLT64", - "R_X86_64_GOTTPOFF", - "R_X86_64_IRELATIVE", - "R_X86_64_JMP_SLOT", - "R_X86_64_NONE", - "R_X86_64_PC16", - "R_X86_64_PC32", - "R_X86_64_PC32_BND", - "R_X86_64_PC64", - "R_X86_64_PC8", - "R_X86_64_PLT32", - "R_X86_64_PLT32_BND", - "R_X86_64_PLTOFF64", - "R_X86_64_RELATIVE", - "R_X86_64_RELATIVE64", - "R_X86_64_REX_GOTPCRELX", - "R_X86_64_SIZE32", - "R_X86_64_SIZE64", - "R_X86_64_TLSDESC", - "R_X86_64_TLSDESC_CALL", - "R_X86_64_TLSGD", - "R_X86_64_TLSLD", - "R_X86_64_TPOFF32", - "R_X86_64_TPOFF64", - "Rel32", - "Rel64", - "Rela32", - "Rela64", - "SHF_ALLOC", - "SHF_COMPRESSED", - "SHF_EXECINSTR", - "SHF_GROUP", - "SHF_INFO_LINK", - "SHF_LINK_ORDER", - "SHF_MASKOS", - "SHF_MASKPROC", - "SHF_MERGE", - "SHF_OS_NONCONFORMING", - "SHF_STRINGS", - "SHF_TLS", - "SHF_WRITE", - "SHN_ABS", - "SHN_COMMON", - "SHN_HIOS", - "SHN_HIPROC", - "SHN_HIRESERVE", - "SHN_LOOS", - "SHN_LOPROC", - "SHN_LORESERVE", - "SHN_UNDEF", - "SHN_XINDEX", - "SHT_DYNAMIC", - "SHT_DYNSYM", - "SHT_FINI_ARRAY", - "SHT_GNU_ATTRIBUTES", - "SHT_GNU_HASH", - "SHT_GNU_LIBLIST", - "SHT_GNU_VERDEF", - "SHT_GNU_VERNEED", - "SHT_GNU_VERSYM", - "SHT_GROUP", - "SHT_HASH", - "SHT_HIOS", - "SHT_HIPROC", - "SHT_HIUSER", - "SHT_INIT_ARRAY", - "SHT_LOOS", - "SHT_LOPROC", - "SHT_LOUSER", - "SHT_MIPS_ABIFLAGS", - "SHT_NOBITS", - "SHT_NOTE", - "SHT_NULL", - "SHT_PREINIT_ARRAY", - "SHT_PROGBITS", - "SHT_REL", - "SHT_RELA", - "SHT_SHLIB", - "SHT_STRTAB", - "SHT_SYMTAB", - "SHT_SYMTAB_SHNDX", - "STB_GLOBAL", - "STB_HIOS", - "STB_HIPROC", - "STB_LOCAL", - "STB_LOOS", - "STB_LOPROC", - "STB_WEAK", - "STT_COMMON", - "STT_FILE", - "STT_FUNC", - "STT_HIOS", - "STT_HIPROC", - "STT_LOOS", - "STT_LOPROC", - "STT_NOTYPE", - "STT_OBJECT", - "STT_SECTION", - "STT_TLS", - "STV_DEFAULT", - "STV_HIDDEN", - "STV_INTERNAL", - "STV_PROTECTED", - "ST_BIND", - "ST_INFO", - "ST_TYPE", - "ST_VISIBILITY", - "Section", - "Section32", - "Section64", - "SectionFlag", - "SectionHeader", - "SectionIndex", - "SectionType", - "Sym32", - "Sym32Size", - "Sym64", - "Sym64Size", - "SymBind", - "SymType", - "SymVis", - "Symbol", - "Type", - "Version", - }, - "debug/gosym": []string{ - "DecodingError", - "Func", - "LineTable", - "NewLineTable", - "NewTable", - "Obj", - "Sym", - "Table", - "UnknownFileError", - "UnknownLineError", - }, - "debug/macho": []string{ - "ARM64_RELOC_ADDEND", - "ARM64_RELOC_BRANCH26", - "ARM64_RELOC_GOT_LOAD_PAGE21", - "ARM64_RELOC_GOT_LOAD_PAGEOFF12", - "ARM64_RELOC_PAGE21", - "ARM64_RELOC_PAGEOFF12", - "ARM64_RELOC_POINTER_TO_GOT", - "ARM64_RELOC_SUBTRACTOR", - "ARM64_RELOC_TLVP_LOAD_PAGE21", - "ARM64_RELOC_TLVP_LOAD_PAGEOFF12", - "ARM64_RELOC_UNSIGNED", - "ARM_RELOC_BR24", - "ARM_RELOC_HALF", - "ARM_RELOC_HALF_SECTDIFF", - "ARM_RELOC_LOCAL_SECTDIFF", - "ARM_RELOC_PAIR", - "ARM_RELOC_PB_LA_PTR", - "ARM_RELOC_SECTDIFF", - "ARM_RELOC_VANILLA", - "ARM_THUMB_32BIT_BRANCH", - "ARM_THUMB_RELOC_BR22", - "Cpu", - "Cpu386", - "CpuAmd64", - "CpuArm", - "CpuArm64", - "CpuPpc", - "CpuPpc64", - "Dylib", - "DylibCmd", - "Dysymtab", - "DysymtabCmd", - "ErrNotFat", - "FatArch", - "FatArchHeader", - "FatFile", - "File", - "FileHeader", - "FlagAllModsBound", - "FlagAllowStackExecution", - "FlagAppExtensionSafe", - "FlagBindAtLoad", - "FlagBindsToWeak", - "FlagCanonical", - "FlagDeadStrippableDylib", - "FlagDyldLink", - "FlagForceFlat", - "FlagHasTLVDescriptors", - "FlagIncrLink", - "FlagLazyInit", - "FlagNoFixPrebinding", - "FlagNoHeapExecution", - "FlagNoMultiDefs", - "FlagNoReexportedDylibs", - "FlagNoUndefs", - "FlagPIE", - "FlagPrebindable", - "FlagPrebound", - "FlagRootSafe", - "FlagSetuidSafe", - "FlagSplitSegs", - "FlagSubsectionsViaSymbols", - "FlagTwoLevel", - "FlagWeakDefines", - "FormatError", - "GENERIC_RELOC_LOCAL_SECTDIFF", - "GENERIC_RELOC_PAIR", - "GENERIC_RELOC_PB_LA_PTR", - "GENERIC_RELOC_SECTDIFF", - "GENERIC_RELOC_TLV", - "GENERIC_RELOC_VANILLA", - "Load", - "LoadBytes", - "LoadCmd", - "LoadCmdDylib", - "LoadCmdDylinker", - "LoadCmdDysymtab", - "LoadCmdRpath", - "LoadCmdSegment", - "LoadCmdSegment64", - "LoadCmdSymtab", - "LoadCmdThread", - "LoadCmdUnixThread", - "Magic32", - "Magic64", - "MagicFat", - "NewFatFile", - "NewFile", - "Nlist32", - "Nlist64", - "Open", - "OpenFat", - "Regs386", - "RegsAMD64", - "Reloc", - "RelocTypeARM", - "RelocTypeARM64", - "RelocTypeGeneric", - "RelocTypeX86_64", - "Rpath", - "RpathCmd", - "Section", - "Section32", - "Section64", - "SectionHeader", - "Segment", - "Segment32", - "Segment64", - "SegmentHeader", - "Symbol", - "Symtab", - "SymtabCmd", - "Thread", - "Type", - "TypeBundle", - "TypeDylib", - "TypeExec", - "TypeObj", - "X86_64_RELOC_BRANCH", - "X86_64_RELOC_GOT", - "X86_64_RELOC_GOT_LOAD", - "X86_64_RELOC_SIGNED", - "X86_64_RELOC_SIGNED_1", - "X86_64_RELOC_SIGNED_2", - "X86_64_RELOC_SIGNED_4", - "X86_64_RELOC_SUBTRACTOR", - "X86_64_RELOC_TLV", - "X86_64_RELOC_UNSIGNED", - }, - "debug/pe": []string{ - "COFFSymbol", - "COFFSymbolSize", - "DataDirectory", - "File", - "FileHeader", - "FormatError", - "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", - "IMAGE_DIRECTORY_ENTRY_BASERELOC", - "IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", - "IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", - "IMAGE_DIRECTORY_ENTRY_DEBUG", - "IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", - "IMAGE_DIRECTORY_ENTRY_EXCEPTION", - "IMAGE_DIRECTORY_ENTRY_EXPORT", - "IMAGE_DIRECTORY_ENTRY_GLOBALPTR", - "IMAGE_DIRECTORY_ENTRY_IAT", - "IMAGE_DIRECTORY_ENTRY_IMPORT", - "IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", - "IMAGE_DIRECTORY_ENTRY_RESOURCE", - "IMAGE_DIRECTORY_ENTRY_SECURITY", - "IMAGE_DIRECTORY_ENTRY_TLS", - "IMAGE_DLLCHARACTERISTICS_APPCONTAINER", - "IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", - "IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", - "IMAGE_DLLCHARACTERISTICS_GUARD_CF", - "IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", - "IMAGE_DLLCHARACTERISTICS_NO_BIND", - "IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", - "IMAGE_DLLCHARACTERISTICS_NO_SEH", - "IMAGE_DLLCHARACTERISTICS_NX_COMPAT", - "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", - "IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", - "IMAGE_FILE_32BIT_MACHINE", - "IMAGE_FILE_AGGRESIVE_WS_TRIM", - "IMAGE_FILE_BYTES_REVERSED_HI", - "IMAGE_FILE_BYTES_REVERSED_LO", - "IMAGE_FILE_DEBUG_STRIPPED", - "IMAGE_FILE_DLL", - "IMAGE_FILE_EXECUTABLE_IMAGE", - "IMAGE_FILE_LARGE_ADDRESS_AWARE", - "IMAGE_FILE_LINE_NUMS_STRIPPED", - "IMAGE_FILE_LOCAL_SYMS_STRIPPED", - "IMAGE_FILE_MACHINE_AM33", - "IMAGE_FILE_MACHINE_AMD64", - "IMAGE_FILE_MACHINE_ARM", - "IMAGE_FILE_MACHINE_ARM64", - "IMAGE_FILE_MACHINE_ARMNT", - "IMAGE_FILE_MACHINE_EBC", - "IMAGE_FILE_MACHINE_I386", - "IMAGE_FILE_MACHINE_IA64", - "IMAGE_FILE_MACHINE_M32R", - "IMAGE_FILE_MACHINE_MIPS16", - "IMAGE_FILE_MACHINE_MIPSFPU", - "IMAGE_FILE_MACHINE_MIPSFPU16", - "IMAGE_FILE_MACHINE_POWERPC", - "IMAGE_FILE_MACHINE_POWERPCFP", - "IMAGE_FILE_MACHINE_R4000", - "IMAGE_FILE_MACHINE_SH3", - "IMAGE_FILE_MACHINE_SH3DSP", - "IMAGE_FILE_MACHINE_SH4", - "IMAGE_FILE_MACHINE_SH5", - "IMAGE_FILE_MACHINE_THUMB", - "IMAGE_FILE_MACHINE_UNKNOWN", - "IMAGE_FILE_MACHINE_WCEMIPSV2", - "IMAGE_FILE_NET_RUN_FROM_SWAP", - "IMAGE_FILE_RELOCS_STRIPPED", - "IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", - "IMAGE_FILE_SYSTEM", - "IMAGE_FILE_UP_SYSTEM_ONLY", - "IMAGE_SUBSYSTEM_EFI_APPLICATION", - "IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", - "IMAGE_SUBSYSTEM_EFI_ROM", - "IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", - "IMAGE_SUBSYSTEM_NATIVE", - "IMAGE_SUBSYSTEM_NATIVE_WINDOWS", - "IMAGE_SUBSYSTEM_OS2_CUI", - "IMAGE_SUBSYSTEM_POSIX_CUI", - "IMAGE_SUBSYSTEM_UNKNOWN", - "IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", - "IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", - "IMAGE_SUBSYSTEM_WINDOWS_CUI", - "IMAGE_SUBSYSTEM_WINDOWS_GUI", - "IMAGE_SUBSYSTEM_XBOX", - "ImportDirectory", - "NewFile", - "Open", - "OptionalHeader32", - "OptionalHeader64", - "Reloc", - "Section", - "SectionHeader", - "SectionHeader32", - "StringTable", - "Symbol", - }, - "debug/plan9obj": []string{ - "File", - "FileHeader", - "Magic386", - "Magic64", - "MagicAMD64", - "MagicARM", - "NewFile", - "Open", - "Section", - "SectionHeader", - "Sym", - }, - "embed": []string{ - "FS", - }, - "encoding": []string{ - "BinaryMarshaler", - "BinaryUnmarshaler", - "TextMarshaler", - "TextUnmarshaler", - }, - "encoding/ascii85": []string{ - "CorruptInputError", - "Decode", - "Encode", - "MaxEncodedLen", - "NewDecoder", - "NewEncoder", - }, - "encoding/asn1": []string{ - "BitString", - "ClassApplication", - "ClassContextSpecific", - "ClassPrivate", - "ClassUniversal", - "Enumerated", - "Flag", - "Marshal", - "MarshalWithParams", - "NullBytes", - "NullRawValue", - "ObjectIdentifier", - "RawContent", - "RawValue", - "StructuralError", - "SyntaxError", - "TagBMPString", - "TagBitString", - "TagBoolean", - "TagEnum", - "TagGeneralString", - "TagGeneralizedTime", - "TagIA5String", - "TagInteger", - "TagNull", - "TagNumericString", - "TagOID", - "TagOctetString", - "TagPrintableString", - "TagSequence", - "TagSet", - "TagT61String", - "TagUTCTime", - "TagUTF8String", - "Unmarshal", - "UnmarshalWithParams", - }, - "encoding/base32": []string{ - "CorruptInputError", - "Encoding", - "HexEncoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "StdEncoding", - "StdPadding", - }, - "encoding/base64": []string{ - "CorruptInputError", - "Encoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "RawStdEncoding", - "RawURLEncoding", - "StdEncoding", - "StdPadding", - "URLEncoding", - }, - "encoding/binary": []string{ - "BigEndian", - "ByteOrder", - "LittleEndian", - "MaxVarintLen16", - "MaxVarintLen32", - "MaxVarintLen64", - "PutUvarint", - "PutVarint", - "Read", - "ReadUvarint", - "ReadVarint", - "Size", - "Uvarint", - "Varint", - "Write", - }, - "encoding/csv": []string{ - "ErrBareQuote", - "ErrFieldCount", - "ErrQuote", - "ErrTrailingComma", - "NewReader", - "NewWriter", - "ParseError", - "Reader", - "Writer", - }, - "encoding/gob": []string{ - "CommonType", - "Decoder", - "Encoder", - "GobDecoder", - "GobEncoder", - "NewDecoder", - "NewEncoder", - "Register", - "RegisterName", - }, - "encoding/hex": []string{ - "Decode", - "DecodeString", - "DecodedLen", - "Dump", - "Dumper", - "Encode", - "EncodeToString", - "EncodedLen", - "ErrLength", - "InvalidByteError", - "NewDecoder", - "NewEncoder", - }, - "encoding/json": []string{ - "Compact", - "Decoder", - "Delim", - "Encoder", - "HTMLEscape", - "Indent", - "InvalidUTF8Error", - "InvalidUnmarshalError", - "Marshal", - "MarshalIndent", - "Marshaler", - "MarshalerError", - "NewDecoder", - "NewEncoder", - "Number", - "RawMessage", - "SyntaxError", - "Token", - "Unmarshal", - "UnmarshalFieldError", - "UnmarshalTypeError", - "Unmarshaler", - "UnsupportedTypeError", - "UnsupportedValueError", - "Valid", - }, - "encoding/pem": []string{ - "Block", - "Decode", - "Encode", - "EncodeToMemory", - }, - "encoding/xml": []string{ - "Attr", - "CharData", - "Comment", - "CopyToken", - "Decoder", - "Directive", - "Encoder", - "EndElement", - "Escape", - "EscapeText", - "HTMLAutoClose", - "HTMLEntity", - "Header", - "Marshal", - "MarshalIndent", - "Marshaler", - "MarshalerAttr", - "Name", - "NewDecoder", - "NewEncoder", - "NewTokenDecoder", - "ProcInst", - "StartElement", - "SyntaxError", - "TagPathError", - "Token", - "TokenReader", - "Unmarshal", - "UnmarshalError", - "Unmarshaler", - "UnmarshalerAttr", - "UnsupportedTypeError", - }, - "errors": []string{ - "As", - "Is", - "New", - "Unwrap", - }, - "expvar": []string{ - "Do", - "Float", - "Func", - "Get", - "Handler", - "Int", - "KeyValue", - "Map", - "NewFloat", - "NewInt", - "NewMap", - "NewString", - "Publish", - "String", - "Var", - }, - "flag": []string{ - "Arg", - "Args", - "Bool", - "BoolVar", - "CommandLine", - "ContinueOnError", - "Duration", - "DurationVar", - "ErrHelp", - "ErrorHandling", - "ExitOnError", - "Flag", - "FlagSet", - "Float64", - "Float64Var", - "Func", - "Getter", - "Int", - "Int64", - "Int64Var", - "IntVar", - "Lookup", - "NArg", - "NFlag", - "NewFlagSet", - "PanicOnError", - "Parse", - "Parsed", - "PrintDefaults", - "Set", - "String", - "StringVar", - "Uint", - "Uint64", - "Uint64Var", - "UintVar", - "UnquoteUsage", - "Usage", - "Value", - "Var", - "Visit", - "VisitAll", - }, - "fmt": []string{ - "Errorf", - "Formatter", - "Fprint", - "Fprintf", - "Fprintln", - "Fscan", - "Fscanf", - "Fscanln", - "GoStringer", - "Print", - "Printf", - "Println", - "Scan", - "ScanState", - "Scanf", - "Scanln", - "Scanner", - "Sprint", - "Sprintf", - "Sprintln", - "Sscan", - "Sscanf", - "Sscanln", - "State", - "Stringer", - }, - "go/ast": []string{ - "ArrayType", - "AssignStmt", - "Bad", - "BadDecl", - "BadExpr", - "BadStmt", - "BasicLit", - "BinaryExpr", - "BlockStmt", - "BranchStmt", - "CallExpr", - "CaseClause", - "ChanDir", - "ChanType", - "CommClause", - "Comment", - "CommentGroup", - "CommentMap", - "CompositeLit", - "Con", - "Decl", - "DeclStmt", - "DeferStmt", - "Ellipsis", - "EmptyStmt", - "Expr", - "ExprStmt", - "Field", - "FieldFilter", - "FieldList", - "File", - "FileExports", - "Filter", - "FilterDecl", - "FilterFile", - "FilterFuncDuplicates", - "FilterImportDuplicates", - "FilterPackage", - "FilterUnassociatedComments", - "ForStmt", - "Fprint", - "Fun", - "FuncDecl", - "FuncLit", - "FuncType", - "GenDecl", - "GoStmt", - "Ident", - "IfStmt", - "ImportSpec", - "Importer", - "IncDecStmt", - "IndexExpr", - "Inspect", - "InterfaceType", - "IsExported", - "KeyValueExpr", - "LabeledStmt", - "Lbl", - "MapType", - "MergeMode", - "MergePackageFiles", - "NewCommentMap", - "NewIdent", - "NewObj", - "NewPackage", - "NewScope", - "Node", - "NotNilFilter", - "ObjKind", - "Object", - "Package", - "PackageExports", - "ParenExpr", - "Pkg", - "Print", - "RECV", - "RangeStmt", - "ReturnStmt", - "SEND", - "Scope", - "SelectStmt", - "SelectorExpr", - "SendStmt", - "SliceExpr", - "SortImports", - "Spec", - "StarExpr", - "Stmt", - "StructType", - "SwitchStmt", - "Typ", - "TypeAssertExpr", - "TypeSpec", - "TypeSwitchStmt", - "UnaryExpr", - "ValueSpec", - "Var", - "Visitor", - "Walk", - }, - "go/build": []string{ - "AllowBinary", - "ArchChar", - "Context", - "Default", - "FindOnly", - "IgnoreVendor", - "Import", - "ImportComment", - "ImportDir", - "ImportMode", - "IsLocalImport", - "MultiplePackageError", - "NoGoError", - "Package", - "ToolDir", - }, - "go/build/constraint": []string{ - "AndExpr", - "Expr", - "IsGoBuild", - "IsPlusBuild", - "NotExpr", - "OrExpr", - "Parse", - "PlusBuildLines", - "SyntaxError", - "TagExpr", - }, - "go/constant": []string{ - "BinaryOp", - "BitLen", - "Bool", - "BoolVal", - "Bytes", - "Compare", - "Complex", - "Denom", - "Float", - "Float32Val", - "Float64Val", - "Imag", - "Int", - "Int64Val", - "Kind", - "Make", - "MakeBool", - "MakeFloat64", - "MakeFromBytes", - "MakeFromLiteral", - "MakeImag", - "MakeInt64", - "MakeString", - "MakeUint64", - "MakeUnknown", - "Num", - "Real", - "Shift", - "Sign", - "String", - "StringVal", - "ToComplex", - "ToFloat", - "ToInt", - "Uint64Val", - "UnaryOp", - "Unknown", - "Val", - "Value", - }, - "go/doc": []string{ - "AllDecls", - "AllMethods", - "Example", - "Examples", - "Filter", - "Func", - "IllegalPrefixes", - "IsPredeclared", - "Mode", - "New", - "NewFromFiles", - "Note", - "Package", - "PreserveAST", - "Synopsis", - "ToHTML", - "ToText", - "Type", - "Value", - }, - "go/format": []string{ - "Node", - "Source", - }, - "go/importer": []string{ - "Default", - "For", - "ForCompiler", - "Lookup", - }, - "go/parser": []string{ - "AllErrors", - "DeclarationErrors", - "ImportsOnly", - "Mode", - "PackageClauseOnly", - "ParseComments", - "ParseDir", - "ParseExpr", - "ParseExprFrom", - "ParseFile", - "SkipObjectResolution", - "SpuriousErrors", - "Trace", - }, - "go/printer": []string{ - "CommentedNode", - "Config", - "Fprint", - "Mode", - "RawFormat", - "SourcePos", - "TabIndent", - "UseSpaces", - }, - "go/scanner": []string{ - "Error", - "ErrorHandler", - "ErrorList", - "Mode", - "PrintError", - "ScanComments", - "Scanner", - }, - "go/token": []string{ - "ADD", - "ADD_ASSIGN", - "AND", - "AND_ASSIGN", - "AND_NOT", - "AND_NOT_ASSIGN", - "ARROW", - "ASSIGN", - "BREAK", - "CASE", - "CHAN", - "CHAR", - "COLON", - "COMMA", - "COMMENT", - "CONST", - "CONTINUE", - "DEC", - "DEFAULT", - "DEFER", - "DEFINE", - "ELLIPSIS", - "ELSE", - "EOF", - "EQL", - "FALLTHROUGH", - "FLOAT", - "FOR", - "FUNC", - "File", - "FileSet", - "GEQ", - "GO", - "GOTO", - "GTR", - "HighestPrec", - "IDENT", - "IF", - "ILLEGAL", - "IMAG", - "IMPORT", - "INC", - "INT", - "INTERFACE", - "IsExported", - "IsIdentifier", - "IsKeyword", - "LAND", - "LBRACE", - "LBRACK", - "LEQ", - "LOR", - "LPAREN", - "LSS", - "Lookup", - "LowestPrec", - "MAP", - "MUL", - "MUL_ASSIGN", - "NEQ", - "NOT", - "NewFileSet", - "NoPos", - "OR", - "OR_ASSIGN", - "PACKAGE", - "PERIOD", - "Pos", - "Position", - "QUO", - "QUO_ASSIGN", - "RANGE", - "RBRACE", - "RBRACK", - "REM", - "REM_ASSIGN", - "RETURN", - "RPAREN", - "SELECT", - "SEMICOLON", - "SHL", - "SHL_ASSIGN", - "SHR", - "SHR_ASSIGN", - "STRING", - "STRUCT", - "SUB", - "SUB_ASSIGN", - "SWITCH", - "TYPE", - "Token", - "UnaryPrec", - "VAR", - "XOR", - "XOR_ASSIGN", - }, - "go/types": []string{ - "Array", - "AssertableTo", - "AssignableTo", - "Basic", - "BasicInfo", - "BasicKind", - "Bool", - "Builtin", - "Byte", - "Chan", - "ChanDir", - "CheckExpr", - "Checker", - "Comparable", - "Complex128", - "Complex64", - "Config", - "Const", - "ConvertibleTo", - "DefPredeclaredTestFuncs", - "Default", - "Error", - "Eval", - "ExprString", - "FieldVal", - "Float32", - "Float64", - "Func", - "Id", - "Identical", - "IdenticalIgnoreTags", - "Implements", - "ImportMode", - "Importer", - "ImporterFrom", - "Info", - "Initializer", - "Int", - "Int16", - "Int32", - "Int64", - "Int8", - "Interface", - "Invalid", - "IsBoolean", - "IsComplex", - "IsConstType", - "IsFloat", - "IsInteger", - "IsInterface", - "IsNumeric", - "IsOrdered", - "IsString", - "IsUnsigned", - "IsUntyped", - "Label", - "LookupFieldOrMethod", - "Map", - "MethodExpr", - "MethodSet", - "MethodVal", - "MissingMethod", - "Named", - "NewArray", - "NewChan", - "NewChecker", - "NewConst", - "NewField", - "NewFunc", - "NewInterface", - "NewInterfaceType", - "NewLabel", - "NewMap", - "NewMethodSet", - "NewNamed", - "NewPackage", - "NewParam", - "NewPkgName", - "NewPointer", - "NewScope", - "NewSignature", - "NewSlice", - "NewStruct", - "NewTuple", - "NewTypeName", - "NewVar", - "Nil", - "Object", - "ObjectString", - "Package", - "PkgName", - "Pointer", - "Qualifier", - "RecvOnly", - "RelativeTo", - "Rune", - "Scope", - "Selection", - "SelectionKind", - "SelectionString", - "SendOnly", - "SendRecv", - "Signature", - "Sizes", - "SizesFor", - "Slice", - "StdSizes", - "String", - "Struct", - "Tuple", - "Typ", - "Type", - "TypeAndValue", - "TypeName", - "TypeString", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "Universe", - "Unsafe", - "UnsafePointer", - "UntypedBool", - "UntypedComplex", - "UntypedFloat", - "UntypedInt", - "UntypedNil", - "UntypedRune", - "UntypedString", - "Var", - "WriteExpr", - "WriteSignature", - "WriteType", - }, - "hash": []string{ - "Hash", - "Hash32", - "Hash64", - }, - "hash/adler32": []string{ - "Checksum", - "New", - "Size", - }, - "hash/crc32": []string{ - "Castagnoli", - "Checksum", - "ChecksumIEEE", - "IEEE", - "IEEETable", - "Koopman", - "MakeTable", - "New", - "NewIEEE", - "Size", - "Table", - "Update", - }, - "hash/crc64": []string{ - "Checksum", - "ECMA", - "ISO", - "MakeTable", - "New", - "Size", - "Table", - "Update", - }, - "hash/fnv": []string{ - "New128", - "New128a", - "New32", - "New32a", - "New64", - "New64a", - }, - "hash/maphash": []string{ - "Hash", - "MakeSeed", - "Seed", - }, - "html": []string{ - "EscapeString", - "UnescapeString", - }, - "html/template": []string{ - "CSS", - "ErrAmbigContext", - "ErrBadHTML", - "ErrBranchEnd", - "ErrEndContext", - "ErrNoSuchTemplate", - "ErrOutputContext", - "ErrPartialCharset", - "ErrPartialEscape", - "ErrPredefinedEscaper", - "ErrRangeLoopReentry", - "ErrSlashAmbig", - "Error", - "ErrorCode", - "FuncMap", - "HTML", - "HTMLAttr", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JS", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "JSStr", - "Must", - "New", - "OK", - "ParseFS", - "ParseFiles", - "ParseGlob", - "Srcset", - "Template", - "URL", - "URLQueryEscaper", - }, - "image": []string{ - "Alpha", - "Alpha16", - "Black", - "CMYK", - "Config", - "Decode", - "DecodeConfig", - "ErrFormat", - "Gray", - "Gray16", - "Image", - "NRGBA", - "NRGBA64", - "NYCbCrA", - "NewAlpha", - "NewAlpha16", - "NewCMYK", - "NewGray", - "NewGray16", - "NewNRGBA", - "NewNRGBA64", - "NewNYCbCrA", - "NewPaletted", - "NewRGBA", - "NewRGBA64", - "NewUniform", - "NewYCbCr", - "Opaque", - "Paletted", - "PalettedImage", - "Point", - "Pt", - "RGBA", - "RGBA64", - "RGBA64Image", - "Rect", - "Rectangle", - "RegisterFormat", - "Transparent", - "Uniform", - "White", - "YCbCr", - "YCbCrSubsampleRatio", - "YCbCrSubsampleRatio410", - "YCbCrSubsampleRatio411", - "YCbCrSubsampleRatio420", - "YCbCrSubsampleRatio422", - "YCbCrSubsampleRatio440", - "YCbCrSubsampleRatio444", - "ZP", - "ZR", - }, - "image/color": []string{ - "Alpha", - "Alpha16", - "Alpha16Model", - "AlphaModel", - "Black", - "CMYK", - "CMYKModel", - "CMYKToRGB", - "Color", - "Gray", - "Gray16", - "Gray16Model", - "GrayModel", - "Model", - "ModelFunc", - "NRGBA", - "NRGBA64", - "NRGBA64Model", - "NRGBAModel", - "NYCbCrA", - "NYCbCrAModel", - "Opaque", - "Palette", - "RGBA", - "RGBA64", - "RGBA64Model", - "RGBAModel", - "RGBToCMYK", - "RGBToYCbCr", - "Transparent", - "White", - "YCbCr", - "YCbCrModel", - "YCbCrToRGB", - }, - "image/color/palette": []string{ - "Plan9", - "WebSafe", - }, - "image/draw": []string{ - "Draw", - "DrawMask", - "Drawer", - "FloydSteinberg", - "Image", - "Op", - "Over", - "Quantizer", - "RGBA64Image", - "Src", - }, - "image/gif": []string{ - "Decode", - "DecodeAll", - "DecodeConfig", - "DisposalBackground", - "DisposalNone", - "DisposalPrevious", - "Encode", - "EncodeAll", - "GIF", - "Options", - }, - "image/jpeg": []string{ - "Decode", - "DecodeConfig", - "DefaultQuality", - "Encode", - "FormatError", - "Options", - "Reader", - "UnsupportedError", - }, - "image/png": []string{ - "BestCompression", - "BestSpeed", - "CompressionLevel", - "Decode", - "DecodeConfig", - "DefaultCompression", - "Encode", - "Encoder", - "EncoderBuffer", - "EncoderBufferPool", - "FormatError", - "NoCompression", - "UnsupportedError", - }, - "index/suffixarray": []string{ - "Index", - "New", - }, - "io": []string{ - "ByteReader", - "ByteScanner", - "ByteWriter", - "Closer", - "Copy", - "CopyBuffer", - "CopyN", - "Discard", - "EOF", - "ErrClosedPipe", - "ErrNoProgress", - "ErrShortBuffer", - "ErrShortWrite", - "ErrUnexpectedEOF", - "LimitReader", - "LimitedReader", - "MultiReader", - "MultiWriter", - "NewSectionReader", - "NopCloser", - "Pipe", - "PipeReader", - "PipeWriter", - "ReadAll", - "ReadAtLeast", - "ReadCloser", - "ReadFull", - "ReadSeekCloser", - "ReadSeeker", - "ReadWriteCloser", - "ReadWriteSeeker", - "ReadWriter", - "Reader", - "ReaderAt", - "ReaderFrom", - "RuneReader", - "RuneScanner", - "SectionReader", - "SeekCurrent", - "SeekEnd", - "SeekStart", - "Seeker", - "StringWriter", - "TeeReader", - "WriteCloser", - "WriteSeeker", - "WriteString", - "Writer", - "WriterAt", - "WriterTo", - }, - "io/fs": []string{ - "DirEntry", - "ErrClosed", - "ErrExist", - "ErrInvalid", - "ErrNotExist", - "ErrPermission", - "FS", - "File", - "FileInfo", - "FileInfoToDirEntry", - "FileMode", - "Glob", - "GlobFS", - "ModeAppend", - "ModeCharDevice", - "ModeDevice", - "ModeDir", - "ModeExclusive", - "ModeIrregular", - "ModeNamedPipe", - "ModePerm", - "ModeSetgid", - "ModeSetuid", - "ModeSocket", - "ModeSticky", - "ModeSymlink", - "ModeTemporary", - "ModeType", - "PathError", - "ReadDir", - "ReadDirFS", - "ReadDirFile", - "ReadFile", - "ReadFileFS", - "SkipDir", - "Stat", - "StatFS", - "Sub", - "SubFS", - "ValidPath", - "WalkDir", - "WalkDirFunc", - }, - "io/ioutil": []string{ - "Discard", - "NopCloser", - "ReadAll", - "ReadDir", - "ReadFile", - "TempDir", - "TempFile", - "WriteFile", - }, - "log": []string{ - "Default", - "Fatal", - "Fatalf", - "Fatalln", - "Flags", - "LUTC", - "Ldate", - "Llongfile", - "Lmicroseconds", - "Lmsgprefix", - "Logger", - "Lshortfile", - "LstdFlags", - "Ltime", - "New", - "Output", - "Panic", - "Panicf", - "Panicln", - "Prefix", - "Print", - "Printf", - "Println", - "SetFlags", - "SetOutput", - "SetPrefix", - "Writer", - }, - "log/syslog": []string{ - "Dial", - "LOG_ALERT", - "LOG_AUTH", - "LOG_AUTHPRIV", - "LOG_CRIT", - "LOG_CRON", - "LOG_DAEMON", - "LOG_DEBUG", - "LOG_EMERG", - "LOG_ERR", - "LOG_FTP", - "LOG_INFO", - "LOG_KERN", - "LOG_LOCAL0", - "LOG_LOCAL1", - "LOG_LOCAL2", - "LOG_LOCAL3", - "LOG_LOCAL4", - "LOG_LOCAL5", - "LOG_LOCAL6", - "LOG_LOCAL7", - "LOG_LPR", - "LOG_MAIL", - "LOG_NEWS", - "LOG_NOTICE", - "LOG_SYSLOG", - "LOG_USER", - "LOG_UUCP", - "LOG_WARNING", - "New", - "NewLogger", - "Priority", - "Writer", - }, - "math": []string{ - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atan2", - "Atanh", - "Cbrt", - "Ceil", - "Copysign", - "Cos", - "Cosh", - "Dim", - "E", - "Erf", - "Erfc", - "Erfcinv", - "Erfinv", - "Exp", - "Exp2", - "Expm1", - "FMA", - "Float32bits", - "Float32frombits", - "Float64bits", - "Float64frombits", - "Floor", - "Frexp", - "Gamma", - "Hypot", - "Ilogb", - "Inf", - "IsInf", - "IsNaN", - "J0", - "J1", - "Jn", - "Ldexp", - "Lgamma", - "Ln10", - "Ln2", - "Log", - "Log10", - "Log10E", - "Log1p", - "Log2", - "Log2E", - "Logb", - "Max", - "MaxFloat32", - "MaxFloat64", - "MaxInt", - "MaxInt16", - "MaxInt32", - "MaxInt64", - "MaxInt8", - "MaxUint", - "MaxUint16", - "MaxUint32", - "MaxUint64", - "MaxUint8", - "Min", - "MinInt", - "MinInt16", - "MinInt32", - "MinInt64", - "MinInt8", - "Mod", - "Modf", - "NaN", - "Nextafter", - "Nextafter32", - "Phi", - "Pi", - "Pow", - "Pow10", - "Remainder", - "Round", - "RoundToEven", - "Signbit", - "Sin", - "Sincos", - "Sinh", - "SmallestNonzeroFloat32", - "SmallestNonzeroFloat64", - "Sqrt", - "Sqrt2", - "SqrtE", - "SqrtPhi", - "SqrtPi", - "Tan", - "Tanh", - "Trunc", - "Y0", - "Y1", - "Yn", - }, - "math/big": []string{ - "Above", - "Accuracy", - "AwayFromZero", - "Below", - "ErrNaN", - "Exact", - "Float", - "Int", - "Jacobi", - "MaxBase", - "MaxExp", - "MaxPrec", - "MinExp", - "NewFloat", - "NewInt", - "NewRat", - "ParseFloat", - "Rat", - "RoundingMode", - "ToNearestAway", - "ToNearestEven", - "ToNegativeInf", - "ToPositiveInf", - "ToZero", - "Word", - }, - "math/bits": []string{ - "Add", - "Add32", - "Add64", - "Div", - "Div32", - "Div64", - "LeadingZeros", - "LeadingZeros16", - "LeadingZeros32", - "LeadingZeros64", - "LeadingZeros8", - "Len", - "Len16", - "Len32", - "Len64", - "Len8", - "Mul", - "Mul32", - "Mul64", - "OnesCount", - "OnesCount16", - "OnesCount32", - "OnesCount64", - "OnesCount8", - "Rem", - "Rem32", - "Rem64", - "Reverse", - "Reverse16", - "Reverse32", - "Reverse64", - "Reverse8", - "ReverseBytes", - "ReverseBytes16", - "ReverseBytes32", - "ReverseBytes64", - "RotateLeft", - "RotateLeft16", - "RotateLeft32", - "RotateLeft64", - "RotateLeft8", - "Sub", - "Sub32", - "Sub64", - "TrailingZeros", - "TrailingZeros16", - "TrailingZeros32", - "TrailingZeros64", - "TrailingZeros8", - "UintSize", - }, - "math/cmplx": []string{ - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atanh", - "Conj", - "Cos", - "Cosh", - "Cot", - "Exp", - "Inf", - "IsInf", - "IsNaN", - "Log", - "Log10", - "NaN", - "Phase", - "Polar", - "Pow", - "Rect", - "Sin", - "Sinh", - "Sqrt", - "Tan", - "Tanh", - }, - "math/rand": []string{ - "ExpFloat64", - "Float32", - "Float64", - "Int", - "Int31", - "Int31n", - "Int63", - "Int63n", - "Intn", - "New", - "NewSource", - "NewZipf", - "NormFloat64", - "Perm", - "Rand", - "Read", - "Seed", - "Shuffle", - "Source", - "Source64", - "Uint32", - "Uint64", - "Zipf", - }, - "mime": []string{ - "AddExtensionType", - "BEncoding", - "ErrInvalidMediaParameter", - "ExtensionsByType", - "FormatMediaType", - "ParseMediaType", - "QEncoding", - "TypeByExtension", - "WordDecoder", - "WordEncoder", - }, - "mime/multipart": []string{ - "ErrMessageTooLarge", - "File", - "FileHeader", - "Form", - "NewReader", - "NewWriter", - "Part", - "Reader", - "Writer", - }, - "mime/quotedprintable": []string{ - "NewReader", - "NewWriter", - "Reader", - "Writer", - }, - "net": []string{ - "Addr", - "AddrError", - "Buffers", - "CIDRMask", - "Conn", - "DNSConfigError", - "DNSError", - "DefaultResolver", - "Dial", - "DialIP", - "DialTCP", - "DialTimeout", - "DialUDP", - "DialUnix", - "Dialer", - "ErrClosed", - "ErrWriteToConnected", - "Error", - "FileConn", - "FileListener", - "FilePacketConn", - "FlagBroadcast", - "FlagLoopback", - "FlagMulticast", - "FlagPointToPoint", - "FlagUp", - "Flags", - "HardwareAddr", - "IP", - "IPAddr", - "IPConn", - "IPMask", - "IPNet", - "IPv4", - "IPv4Mask", - "IPv4allrouter", - "IPv4allsys", - "IPv4bcast", - "IPv4len", - "IPv4zero", - "IPv6interfacelocalallnodes", - "IPv6len", - "IPv6linklocalallnodes", - "IPv6linklocalallrouters", - "IPv6loopback", - "IPv6unspecified", - "IPv6zero", - "Interface", - "InterfaceAddrs", - "InterfaceByIndex", - "InterfaceByName", - "Interfaces", - "InvalidAddrError", - "JoinHostPort", - "Listen", - "ListenConfig", - "ListenIP", - "ListenMulticastUDP", - "ListenPacket", - "ListenTCP", - "ListenUDP", - "ListenUnix", - "ListenUnixgram", - "Listener", - "LookupAddr", - "LookupCNAME", - "LookupHost", - "LookupIP", - "LookupMX", - "LookupNS", - "LookupPort", - "LookupSRV", - "LookupTXT", - "MX", - "NS", - "OpError", - "PacketConn", - "ParseCIDR", - "ParseError", - "ParseIP", - "ParseMAC", - "Pipe", - "ResolveIPAddr", - "ResolveTCPAddr", - "ResolveUDPAddr", - "ResolveUnixAddr", - "Resolver", - "SRV", - "SplitHostPort", - "TCPAddr", - "TCPConn", - "TCPListener", - "UDPAddr", - "UDPConn", - "UnixAddr", - "UnixConn", - "UnixListener", - "UnknownNetworkError", - }, - "net/http": []string{ - "AllowQuerySemicolons", - "CanonicalHeaderKey", - "Client", - "CloseNotifier", - "ConnState", - "Cookie", - "CookieJar", - "DefaultClient", - "DefaultMaxHeaderBytes", - "DefaultMaxIdleConnsPerHost", - "DefaultServeMux", - "DefaultTransport", - "DetectContentType", - "Dir", - "ErrAbortHandler", - "ErrBodyNotAllowed", - "ErrBodyReadAfterClose", - "ErrContentLength", - "ErrHandlerTimeout", - "ErrHeaderTooLong", - "ErrHijacked", - "ErrLineTooLong", - "ErrMissingBoundary", - "ErrMissingContentLength", - "ErrMissingFile", - "ErrNoCookie", - "ErrNoLocation", - "ErrNotMultipart", - "ErrNotSupported", - "ErrServerClosed", - "ErrShortBody", - "ErrSkipAltProtocol", - "ErrUnexpectedTrailer", - "ErrUseLastResponse", - "ErrWriteAfterFlush", - "Error", - "FS", - "File", - "FileServer", - "FileSystem", - "Flusher", - "Get", - "Handle", - "HandleFunc", - "Handler", - "HandlerFunc", - "Head", - "Header", - "Hijacker", - "ListenAndServe", - "ListenAndServeTLS", - "LocalAddrContextKey", - "MaxBytesReader", - "MethodConnect", - "MethodDelete", - "MethodGet", - "MethodHead", - "MethodOptions", - "MethodPatch", - "MethodPost", - "MethodPut", - "MethodTrace", - "NewFileTransport", - "NewRequest", - "NewRequestWithContext", - "NewServeMux", - "NoBody", - "NotFound", - "NotFoundHandler", - "ParseHTTPVersion", - "ParseTime", - "Post", - "PostForm", - "ProtocolError", - "ProxyFromEnvironment", - "ProxyURL", - "PushOptions", - "Pusher", - "ReadRequest", - "ReadResponse", - "Redirect", - "RedirectHandler", - "Request", - "Response", - "ResponseWriter", - "RoundTripper", - "SameSite", - "SameSiteDefaultMode", - "SameSiteLaxMode", - "SameSiteNoneMode", - "SameSiteStrictMode", - "Serve", - "ServeContent", - "ServeFile", - "ServeMux", - "ServeTLS", - "Server", - "ServerContextKey", - "SetCookie", - "StateActive", - "StateClosed", - "StateHijacked", - "StateIdle", - "StateNew", - "StatusAccepted", - "StatusAlreadyReported", - "StatusBadGateway", - "StatusBadRequest", - "StatusConflict", - "StatusContinue", - "StatusCreated", - "StatusEarlyHints", - "StatusExpectationFailed", - "StatusFailedDependency", - "StatusForbidden", - "StatusFound", - "StatusGatewayTimeout", - "StatusGone", - "StatusHTTPVersionNotSupported", - "StatusIMUsed", - "StatusInsufficientStorage", - "StatusInternalServerError", - "StatusLengthRequired", - "StatusLocked", - "StatusLoopDetected", - "StatusMethodNotAllowed", - "StatusMisdirectedRequest", - "StatusMovedPermanently", - "StatusMultiStatus", - "StatusMultipleChoices", - "StatusNetworkAuthenticationRequired", - "StatusNoContent", - "StatusNonAuthoritativeInfo", - "StatusNotAcceptable", - "StatusNotExtended", - "StatusNotFound", - "StatusNotImplemented", - "StatusNotModified", - "StatusOK", - "StatusPartialContent", - "StatusPaymentRequired", - "StatusPermanentRedirect", - "StatusPreconditionFailed", - "StatusPreconditionRequired", - "StatusProcessing", - "StatusProxyAuthRequired", - "StatusRequestEntityTooLarge", - "StatusRequestHeaderFieldsTooLarge", - "StatusRequestTimeout", - "StatusRequestURITooLong", - "StatusRequestedRangeNotSatisfiable", - "StatusResetContent", - "StatusSeeOther", - "StatusServiceUnavailable", - "StatusSwitchingProtocols", - "StatusTeapot", - "StatusTemporaryRedirect", - "StatusText", - "StatusTooEarly", - "StatusTooManyRequests", - "StatusUnauthorized", - "StatusUnavailableForLegalReasons", - "StatusUnprocessableEntity", - "StatusUnsupportedMediaType", - "StatusUpgradeRequired", - "StatusUseProxy", - "StatusVariantAlsoNegotiates", - "StripPrefix", - "TimeFormat", - "TimeoutHandler", - "TrailerPrefix", - "Transport", - }, - "net/http/cgi": []string{ - "Handler", - "Request", - "RequestFromMap", - "Serve", - }, - "net/http/cookiejar": []string{ - "Jar", - "New", - "Options", - "PublicSuffixList", - }, - "net/http/fcgi": []string{ - "ErrConnClosed", - "ErrRequestAborted", - "ProcessEnv", - "Serve", - }, - "net/http/httptest": []string{ - "DefaultRemoteAddr", - "NewRecorder", - "NewRequest", - "NewServer", - "NewTLSServer", - "NewUnstartedServer", - "ResponseRecorder", - "Server", - }, - "net/http/httptrace": []string{ - "ClientTrace", - "ContextClientTrace", - "DNSDoneInfo", - "DNSStartInfo", - "GotConnInfo", - "WithClientTrace", - "WroteRequestInfo", - }, - "net/http/httputil": []string{ - "BufferPool", - "ClientConn", - "DumpRequest", - "DumpRequestOut", - "DumpResponse", - "ErrClosed", - "ErrLineTooLong", - "ErrPersistEOF", - "ErrPipeline", - "NewChunkedReader", - "NewChunkedWriter", - "NewClientConn", - "NewProxyClientConn", - "NewServerConn", - "NewSingleHostReverseProxy", - "ReverseProxy", - "ServerConn", - }, - "net/http/pprof": []string{ - "Cmdline", - "Handler", - "Index", - "Profile", - "Symbol", - "Trace", - }, - "net/mail": []string{ - "Address", - "AddressParser", - "ErrHeaderNotPresent", - "Header", - "Message", - "ParseAddress", - "ParseAddressList", - "ParseDate", - "ReadMessage", - }, - "net/rpc": []string{ - "Accept", - "Call", - "Client", - "ClientCodec", - "DefaultDebugPath", - "DefaultRPCPath", - "DefaultServer", - "Dial", - "DialHTTP", - "DialHTTPPath", - "ErrShutdown", - "HandleHTTP", - "NewClient", - "NewClientWithCodec", - "NewServer", - "Register", - "RegisterName", - "Request", - "Response", - "ServeCodec", - "ServeConn", - "ServeRequest", - "Server", - "ServerCodec", - "ServerError", - }, - "net/rpc/jsonrpc": []string{ - "Dial", - "NewClient", - "NewClientCodec", - "NewServerCodec", - "ServeConn", - }, - "net/smtp": []string{ - "Auth", - "CRAMMD5Auth", - "Client", - "Dial", - "NewClient", - "PlainAuth", - "SendMail", - "ServerInfo", - }, - "net/textproto": []string{ - "CanonicalMIMEHeaderKey", - "Conn", - "Dial", - "Error", - "MIMEHeader", - "NewConn", - "NewReader", - "NewWriter", - "Pipeline", - "ProtocolError", - "Reader", - "TrimBytes", - "TrimString", - "Writer", - }, - "net/url": []string{ - "Error", - "EscapeError", - "InvalidHostError", - "Parse", - "ParseQuery", - "ParseRequestURI", - "PathEscape", - "PathUnescape", - "QueryEscape", - "QueryUnescape", - "URL", - "User", - "UserPassword", - "Userinfo", - "Values", - }, - "os": []string{ - "Args", - "Chdir", - "Chmod", - "Chown", - "Chtimes", - "Clearenv", - "Create", - "CreateTemp", - "DevNull", - "DirEntry", - "DirFS", - "Environ", - "ErrClosed", - "ErrDeadlineExceeded", - "ErrExist", - "ErrInvalid", - "ErrNoDeadline", - "ErrNotExist", - "ErrPermission", - "ErrProcessDone", - "Executable", - "Exit", - "Expand", - "ExpandEnv", - "File", - "FileInfo", - "FileMode", - "FindProcess", - "Getegid", - "Getenv", - "Geteuid", - "Getgid", - "Getgroups", - "Getpagesize", - "Getpid", - "Getppid", - "Getuid", - "Getwd", - "Hostname", - "Interrupt", - "IsExist", - "IsNotExist", - "IsPathSeparator", - "IsPermission", - "IsTimeout", - "Kill", - "Lchown", - "Link", - "LinkError", - "LookupEnv", - "Lstat", - "Mkdir", - "MkdirAll", - "MkdirTemp", - "ModeAppend", - "ModeCharDevice", - "ModeDevice", - "ModeDir", - "ModeExclusive", - "ModeIrregular", - "ModeNamedPipe", - "ModePerm", - "ModeSetgid", - "ModeSetuid", - "ModeSocket", - "ModeSticky", - "ModeSymlink", - "ModeTemporary", - "ModeType", - "NewFile", - "NewSyscallError", - "O_APPEND", - "O_CREATE", - "O_EXCL", - "O_RDONLY", - "O_RDWR", - "O_SYNC", - "O_TRUNC", - "O_WRONLY", - "Open", - "OpenFile", - "PathError", - "PathListSeparator", - "PathSeparator", - "Pipe", - "ProcAttr", - "Process", - "ProcessState", - "ReadDir", - "ReadFile", - "Readlink", - "Remove", - "RemoveAll", - "Rename", - "SEEK_CUR", - "SEEK_END", - "SEEK_SET", - "SameFile", - "Setenv", - "Signal", - "StartProcess", - "Stat", - "Stderr", - "Stdin", - "Stdout", - "Symlink", - "SyscallError", - "TempDir", - "Truncate", - "Unsetenv", - "UserCacheDir", - "UserConfigDir", - "UserHomeDir", - "WriteFile", - }, - "os/exec": []string{ - "Cmd", - "Command", - "CommandContext", - "ErrNotFound", - "Error", - "ExitError", - "LookPath", - }, - "os/signal": []string{ - "Ignore", - "Ignored", - "Notify", - "NotifyContext", - "Reset", - "Stop", - }, - "os/user": []string{ - "Current", - "Group", - "Lookup", - "LookupGroup", - "LookupGroupId", - "LookupId", - "UnknownGroupError", - "UnknownGroupIdError", - "UnknownUserError", - "UnknownUserIdError", - "User", - }, - "path": []string{ - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "Ext", - "IsAbs", - "Join", - "Match", - "Split", - }, - "path/filepath": []string{ - "Abs", - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "EvalSymlinks", - "Ext", - "FromSlash", - "Glob", - "HasPrefix", - "IsAbs", - "Join", - "ListSeparator", - "Match", - "Rel", - "Separator", - "SkipDir", - "Split", - "SplitList", - "ToSlash", - "VolumeName", - "Walk", - "WalkDir", - "WalkFunc", - }, - "plugin": []string{ - "Open", - "Plugin", - "Symbol", - }, - "reflect": []string{ - "Append", - "AppendSlice", - "Array", - "ArrayOf", - "Bool", - "BothDir", - "Chan", - "ChanDir", - "ChanOf", - "Complex128", - "Complex64", - "Copy", - "DeepEqual", - "Float32", - "Float64", - "Func", - "FuncOf", - "Indirect", - "Int", - "Int16", - "Int32", - "Int64", - "Int8", - "Interface", - "Invalid", - "Kind", - "MakeChan", - "MakeFunc", - "MakeMap", - "MakeMapWithSize", - "MakeSlice", - "Map", - "MapIter", - "MapOf", - "Method", - "New", - "NewAt", - "Ptr", - "PtrTo", - "RecvDir", - "Select", - "SelectCase", - "SelectDefault", - "SelectDir", - "SelectRecv", - "SelectSend", - "SendDir", - "Slice", - "SliceHeader", - "SliceOf", - "String", - "StringHeader", - "Struct", - "StructField", - "StructOf", - "StructTag", - "Swapper", - "Type", - "TypeOf", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "UnsafePointer", - "Value", - "ValueError", - "ValueOf", - "VisibleFields", - "Zero", - }, - "regexp": []string{ - "Compile", - "CompilePOSIX", - "Match", - "MatchReader", - "MatchString", - "MustCompile", - "MustCompilePOSIX", - "QuoteMeta", - "Regexp", - }, - "regexp/syntax": []string{ - "ClassNL", - "Compile", - "DotNL", - "EmptyBeginLine", - "EmptyBeginText", - "EmptyEndLine", - "EmptyEndText", - "EmptyNoWordBoundary", - "EmptyOp", - "EmptyOpContext", - "EmptyWordBoundary", - "ErrInternalError", - "ErrInvalidCharClass", - "ErrInvalidCharRange", - "ErrInvalidEscape", - "ErrInvalidNamedCapture", - "ErrInvalidPerlOp", - "ErrInvalidRepeatOp", - "ErrInvalidRepeatSize", - "ErrInvalidUTF8", - "ErrMissingBracket", - "ErrMissingParen", - "ErrMissingRepeatArgument", - "ErrTrailingBackslash", - "ErrUnexpectedParen", - "Error", - "ErrorCode", - "Flags", - "FoldCase", - "Inst", - "InstAlt", - "InstAltMatch", - "InstCapture", - "InstEmptyWidth", - "InstFail", - "InstMatch", - "InstNop", - "InstOp", - "InstRune", - "InstRune1", - "InstRuneAny", - "InstRuneAnyNotNL", - "IsWordChar", - "Literal", - "MatchNL", - "NonGreedy", - "OneLine", - "Op", - "OpAlternate", - "OpAnyChar", - "OpAnyCharNotNL", - "OpBeginLine", - "OpBeginText", - "OpCapture", - "OpCharClass", - "OpConcat", - "OpEmptyMatch", - "OpEndLine", - "OpEndText", - "OpLiteral", - "OpNoMatch", - "OpNoWordBoundary", - "OpPlus", - "OpQuest", - "OpRepeat", - "OpStar", - "OpWordBoundary", - "POSIX", - "Parse", - "Perl", - "PerlX", - "Prog", - "Regexp", - "Simple", - "UnicodeGroups", - "WasDollar", - }, - "runtime": []string{ - "BlockProfile", - "BlockProfileRecord", - "Breakpoint", - "CPUProfile", - "Caller", - "Callers", - "CallersFrames", - "Compiler", - "Error", - "Frame", - "Frames", - "Func", - "FuncForPC", - "GC", - "GOARCH", - "GOMAXPROCS", - "GOOS", - "GOROOT", - "Goexit", - "GoroutineProfile", - "Gosched", - "KeepAlive", - "LockOSThread", - "MemProfile", - "MemProfileRate", - "MemProfileRecord", - "MemStats", - "MutexProfile", - "NumCPU", - "NumCgoCall", - "NumGoroutine", - "ReadMemStats", - "ReadTrace", - "SetBlockProfileRate", - "SetCPUProfileRate", - "SetCgoTraceback", - "SetFinalizer", - "SetMutexProfileFraction", - "Stack", - "StackRecord", - "StartTrace", - "StopTrace", - "ThreadCreateProfile", - "TypeAssertionError", - "UnlockOSThread", - "Version", - }, - "runtime/cgo": []string{ - "Handle", - "NewHandle", - }, - "runtime/debug": []string{ - "BuildInfo", - "FreeOSMemory", - "GCStats", - "Module", - "PrintStack", - "ReadBuildInfo", - "ReadGCStats", - "SetGCPercent", - "SetMaxStack", - "SetMaxThreads", - "SetPanicOnFault", - "SetTraceback", - "Stack", - "WriteHeapDump", - }, - "runtime/metrics": []string{ - "All", - "Description", - "Float64Histogram", - "KindBad", - "KindFloat64", - "KindFloat64Histogram", - "KindUint64", - "Read", - "Sample", - "Value", - "ValueKind", - }, - "runtime/pprof": []string{ - "Do", - "ForLabels", - "Label", - "LabelSet", - "Labels", - "Lookup", - "NewProfile", - "Profile", - "Profiles", - "SetGoroutineLabels", - "StartCPUProfile", - "StopCPUProfile", - "WithLabels", - "WriteHeapProfile", - }, - "runtime/trace": []string{ - "IsEnabled", - "Log", - "Logf", - "NewTask", - "Region", - "Start", - "StartRegion", - "Stop", - "Task", - "WithRegion", - }, - "sort": []string{ - "Float64Slice", - "Float64s", - "Float64sAreSorted", - "IntSlice", - "Interface", - "Ints", - "IntsAreSorted", - "IsSorted", - "Reverse", - "Search", - "SearchFloat64s", - "SearchInts", - "SearchStrings", - "Slice", - "SliceIsSorted", - "SliceStable", - "Sort", - "Stable", - "StringSlice", - "Strings", - "StringsAreSorted", - }, - "strconv": []string{ - "AppendBool", - "AppendFloat", - "AppendInt", - "AppendQuote", - "AppendQuoteRune", - "AppendQuoteRuneToASCII", - "AppendQuoteRuneToGraphic", - "AppendQuoteToASCII", - "AppendQuoteToGraphic", - "AppendUint", - "Atoi", - "CanBackquote", - "ErrRange", - "ErrSyntax", - "FormatBool", - "FormatComplex", - "FormatFloat", - "FormatInt", - "FormatUint", - "IntSize", - "IsGraphic", - "IsPrint", - "Itoa", - "NumError", - "ParseBool", - "ParseComplex", - "ParseFloat", - "ParseInt", - "ParseUint", - "Quote", - "QuoteRune", - "QuoteRuneToASCII", - "QuoteRuneToGraphic", - "QuoteToASCII", - "QuoteToGraphic", - "QuotedPrefix", - "Unquote", - "UnquoteChar", - }, - "strings": []string{ - "Builder", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "EqualFold", - "Fields", - "FieldsFunc", - "HasPrefix", - "HasSuffix", - "Index", - "IndexAny", - "IndexByte", - "IndexFunc", - "IndexRune", - "Join", - "LastIndex", - "LastIndexAny", - "LastIndexByte", - "LastIndexFunc", - "Map", - "NewReader", - "NewReplacer", - "Reader", - "Repeat", - "Replace", - "ReplaceAll", - "Replacer", - "Split", - "SplitAfter", - "SplitAfterN", - "SplitN", - "Title", - "ToLower", - "ToLowerSpecial", - "ToTitle", - "ToTitleSpecial", - "ToUpper", - "ToUpperSpecial", - "ToValidUTF8", - "Trim", - "TrimFunc", - "TrimLeft", - "TrimLeftFunc", - "TrimPrefix", - "TrimRight", - "TrimRightFunc", - "TrimSpace", - "TrimSuffix", - }, - "sync": []string{ - "Cond", - "Locker", - "Map", - "Mutex", - "NewCond", - "Once", - "Pool", - "RWMutex", - "WaitGroup", - }, - "sync/atomic": []string{ - "AddInt32", - "AddInt64", - "AddUint32", - "AddUint64", - "AddUintptr", - "CompareAndSwapInt32", - "CompareAndSwapInt64", - "CompareAndSwapPointer", - "CompareAndSwapUint32", - "CompareAndSwapUint64", - "CompareAndSwapUintptr", - "LoadInt32", - "LoadInt64", - "LoadPointer", - "LoadUint32", - "LoadUint64", - "LoadUintptr", - "StoreInt32", - "StoreInt64", - "StorePointer", - "StoreUint32", - "StoreUint64", - "StoreUintptr", - "SwapInt32", - "SwapInt64", - "SwapPointer", - "SwapUint32", - "SwapUint64", - "SwapUintptr", - "Value", - }, - "syscall": []string{ - "AF_ALG", - "AF_APPLETALK", - "AF_ARP", - "AF_ASH", - "AF_ATM", - "AF_ATMPVC", - "AF_ATMSVC", - "AF_AX25", - "AF_BLUETOOTH", - "AF_BRIDGE", - "AF_CAIF", - "AF_CAN", - "AF_CCITT", - "AF_CHAOS", - "AF_CNT", - "AF_COIP", - "AF_DATAKIT", - "AF_DECnet", - "AF_DLI", - "AF_E164", - "AF_ECMA", - "AF_ECONET", - "AF_ENCAP", - "AF_FILE", - "AF_HYLINK", - "AF_IEEE80211", - "AF_IEEE802154", - "AF_IMPLINK", - "AF_INET", - "AF_INET6", - "AF_INET6_SDP", - "AF_INET_SDP", - "AF_IPX", - "AF_IRDA", - "AF_ISDN", - "AF_ISO", - "AF_IUCV", - "AF_KEY", - "AF_LAT", - "AF_LINK", - "AF_LLC", - "AF_LOCAL", - "AF_MAX", - "AF_MPLS", - "AF_NATM", - "AF_NDRV", - "AF_NETBEUI", - "AF_NETBIOS", - "AF_NETGRAPH", - "AF_NETLINK", - "AF_NETROM", - "AF_NS", - "AF_OROUTE", - "AF_OSI", - "AF_PACKET", - "AF_PHONET", - "AF_PPP", - "AF_PPPOX", - "AF_PUP", - "AF_RDS", - "AF_RESERVED_36", - "AF_ROSE", - "AF_ROUTE", - "AF_RXRPC", - "AF_SCLUSTER", - "AF_SECURITY", - "AF_SIP", - "AF_SLOW", - "AF_SNA", - "AF_SYSTEM", - "AF_TIPC", - "AF_UNIX", - "AF_UNSPEC", - "AF_VENDOR00", - "AF_VENDOR01", - "AF_VENDOR02", - "AF_VENDOR03", - "AF_VENDOR04", - "AF_VENDOR05", - "AF_VENDOR06", - "AF_VENDOR07", - "AF_VENDOR08", - "AF_VENDOR09", - "AF_VENDOR10", - "AF_VENDOR11", - "AF_VENDOR12", - "AF_VENDOR13", - "AF_VENDOR14", - "AF_VENDOR15", - "AF_VENDOR16", - "AF_VENDOR17", - "AF_VENDOR18", - "AF_VENDOR19", - "AF_VENDOR20", - "AF_VENDOR21", - "AF_VENDOR22", - "AF_VENDOR23", - "AF_VENDOR24", - "AF_VENDOR25", - "AF_VENDOR26", - "AF_VENDOR27", - "AF_VENDOR28", - "AF_VENDOR29", - "AF_VENDOR30", - "AF_VENDOR31", - "AF_VENDOR32", - "AF_VENDOR33", - "AF_VENDOR34", - "AF_VENDOR35", - "AF_VENDOR36", - "AF_VENDOR37", - "AF_VENDOR38", - "AF_VENDOR39", - "AF_VENDOR40", - "AF_VENDOR41", - "AF_VENDOR42", - "AF_VENDOR43", - "AF_VENDOR44", - "AF_VENDOR45", - "AF_VENDOR46", - "AF_VENDOR47", - "AF_WANPIPE", - "AF_X25", - "AI_CANONNAME", - "AI_NUMERICHOST", - "AI_PASSIVE", - "APPLICATION_ERROR", - "ARPHRD_ADAPT", - "ARPHRD_APPLETLK", - "ARPHRD_ARCNET", - "ARPHRD_ASH", - "ARPHRD_ATM", - "ARPHRD_AX25", - "ARPHRD_BIF", - "ARPHRD_CHAOS", - "ARPHRD_CISCO", - "ARPHRD_CSLIP", - "ARPHRD_CSLIP6", - "ARPHRD_DDCMP", - "ARPHRD_DLCI", - "ARPHRD_ECONET", - "ARPHRD_EETHER", - "ARPHRD_ETHER", - "ARPHRD_EUI64", - "ARPHRD_FCAL", - "ARPHRD_FCFABRIC", - "ARPHRD_FCPL", - "ARPHRD_FCPP", - "ARPHRD_FDDI", - "ARPHRD_FRAD", - "ARPHRD_FRELAY", - "ARPHRD_HDLC", - "ARPHRD_HIPPI", - "ARPHRD_HWX25", - "ARPHRD_IEEE1394", - "ARPHRD_IEEE802", - "ARPHRD_IEEE80211", - "ARPHRD_IEEE80211_PRISM", - "ARPHRD_IEEE80211_RADIOTAP", - "ARPHRD_IEEE802154", - "ARPHRD_IEEE802154_PHY", - "ARPHRD_IEEE802_TR", - "ARPHRD_INFINIBAND", - "ARPHRD_IPDDP", - "ARPHRD_IPGRE", - "ARPHRD_IRDA", - "ARPHRD_LAPB", - "ARPHRD_LOCALTLK", - "ARPHRD_LOOPBACK", - "ARPHRD_METRICOM", - "ARPHRD_NETROM", - "ARPHRD_NONE", - "ARPHRD_PIMREG", - "ARPHRD_PPP", - "ARPHRD_PRONET", - "ARPHRD_RAWHDLC", - "ARPHRD_ROSE", - "ARPHRD_RSRVD", - "ARPHRD_SIT", - "ARPHRD_SKIP", - "ARPHRD_SLIP", - "ARPHRD_SLIP6", - "ARPHRD_STRIP", - "ARPHRD_TUNNEL", - "ARPHRD_TUNNEL6", - "ARPHRD_VOID", - "ARPHRD_X25", - "AUTHTYPE_CLIENT", - "AUTHTYPE_SERVER", - "Accept", - "Accept4", - "AcceptEx", - "Access", - "Acct", - "AddrinfoW", - "Adjtime", - "Adjtimex", - "AllThreadsSyscall", - "AllThreadsSyscall6", - "AttachLsf", - "B0", - "B1000000", - "B110", - "B115200", - "B1152000", - "B1200", - "B134", - "B14400", - "B150", - "B1500000", - "B1800", - "B19200", - "B200", - "B2000000", - "B230400", - "B2400", - "B2500000", - "B28800", - "B300", - "B3000000", - "B3500000", - "B38400", - "B4000000", - "B460800", - "B4800", - "B50", - "B500000", - "B57600", - "B576000", - "B600", - "B7200", - "B75", - "B76800", - "B921600", - "B9600", - "BASE_PROTOCOL", - "BIOCFEEDBACK", - "BIOCFLUSH", - "BIOCGBLEN", - "BIOCGDIRECTION", - "BIOCGDIRFILT", - "BIOCGDLT", - "BIOCGDLTLIST", - "BIOCGETBUFMODE", - "BIOCGETIF", - "BIOCGETZMAX", - "BIOCGFEEDBACK", - "BIOCGFILDROP", - "BIOCGHDRCMPLT", - "BIOCGRSIG", - "BIOCGRTIMEOUT", - "BIOCGSEESENT", - "BIOCGSTATS", - "BIOCGSTATSOLD", - "BIOCGTSTAMP", - "BIOCIMMEDIATE", - "BIOCLOCK", - "BIOCPROMISC", - "BIOCROTZBUF", - "BIOCSBLEN", - "BIOCSDIRECTION", - "BIOCSDIRFILT", - "BIOCSDLT", - "BIOCSETBUFMODE", - "BIOCSETF", - "BIOCSETFNR", - "BIOCSETIF", - "BIOCSETWF", - "BIOCSETZBUF", - "BIOCSFEEDBACK", - "BIOCSFILDROP", - "BIOCSHDRCMPLT", - "BIOCSRSIG", - "BIOCSRTIMEOUT", - "BIOCSSEESENT", - "BIOCSTCPF", - "BIOCSTSTAMP", - "BIOCSUDPF", - "BIOCVERSION", - "BPF_A", - "BPF_ABS", - "BPF_ADD", - "BPF_ALIGNMENT", - "BPF_ALIGNMENT32", - "BPF_ALU", - "BPF_AND", - "BPF_B", - "BPF_BUFMODE_BUFFER", - "BPF_BUFMODE_ZBUF", - "BPF_DFLTBUFSIZE", - "BPF_DIRECTION_IN", - "BPF_DIRECTION_OUT", - "BPF_DIV", - "BPF_H", - "BPF_IMM", - "BPF_IND", - "BPF_JA", - "BPF_JEQ", - "BPF_JGE", - "BPF_JGT", - "BPF_JMP", - "BPF_JSET", - "BPF_K", - "BPF_LD", - "BPF_LDX", - "BPF_LEN", - "BPF_LSH", - "BPF_MAJOR_VERSION", - "BPF_MAXBUFSIZE", - "BPF_MAXINSNS", - "BPF_MEM", - "BPF_MEMWORDS", - "BPF_MINBUFSIZE", - "BPF_MINOR_VERSION", - "BPF_MISC", - "BPF_MSH", - "BPF_MUL", - "BPF_NEG", - "BPF_OR", - "BPF_RELEASE", - "BPF_RET", - "BPF_RSH", - "BPF_ST", - "BPF_STX", - "BPF_SUB", - "BPF_TAX", - "BPF_TXA", - "BPF_T_BINTIME", - "BPF_T_BINTIME_FAST", - "BPF_T_BINTIME_MONOTONIC", - "BPF_T_BINTIME_MONOTONIC_FAST", - "BPF_T_FAST", - "BPF_T_FLAG_MASK", - "BPF_T_FORMAT_MASK", - "BPF_T_MICROTIME", - "BPF_T_MICROTIME_FAST", - "BPF_T_MICROTIME_MONOTONIC", - "BPF_T_MICROTIME_MONOTONIC_FAST", - "BPF_T_MONOTONIC", - "BPF_T_MONOTONIC_FAST", - "BPF_T_NANOTIME", - "BPF_T_NANOTIME_FAST", - "BPF_T_NANOTIME_MONOTONIC", - "BPF_T_NANOTIME_MONOTONIC_FAST", - "BPF_T_NONE", - "BPF_T_NORMAL", - "BPF_W", - "BPF_X", - "BRKINT", - "Bind", - "BindToDevice", - "BpfBuflen", - "BpfDatalink", - "BpfHdr", - "BpfHeadercmpl", - "BpfInsn", - "BpfInterface", - "BpfJump", - "BpfProgram", - "BpfStat", - "BpfStats", - "BpfStmt", - "BpfTimeout", - "BpfTimeval", - "BpfVersion", - "BpfZbuf", - "BpfZbufHeader", - "ByHandleFileInformation", - "BytePtrFromString", - "ByteSliceFromString", - "CCR0_FLUSH", - "CERT_CHAIN_POLICY_AUTHENTICODE", - "CERT_CHAIN_POLICY_AUTHENTICODE_TS", - "CERT_CHAIN_POLICY_BASE", - "CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", - "CERT_CHAIN_POLICY_EV", - "CERT_CHAIN_POLICY_MICROSOFT_ROOT", - "CERT_CHAIN_POLICY_NT_AUTH", - "CERT_CHAIN_POLICY_SSL", - "CERT_E_CN_NO_MATCH", - "CERT_E_EXPIRED", - "CERT_E_PURPOSE", - "CERT_E_ROLE", - "CERT_E_UNTRUSTEDROOT", - "CERT_STORE_ADD_ALWAYS", - "CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", - "CERT_STORE_PROV_MEMORY", - "CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", - "CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", - "CERT_TRUST_INVALID_BASIC_CONSTRAINTS", - "CERT_TRUST_INVALID_EXTENSION", - "CERT_TRUST_INVALID_NAME_CONSTRAINTS", - "CERT_TRUST_INVALID_POLICY_CONSTRAINTS", - "CERT_TRUST_IS_CYCLIC", - "CERT_TRUST_IS_EXPLICIT_DISTRUST", - "CERT_TRUST_IS_NOT_SIGNATURE_VALID", - "CERT_TRUST_IS_NOT_TIME_VALID", - "CERT_TRUST_IS_NOT_VALID_FOR_USAGE", - "CERT_TRUST_IS_OFFLINE_REVOCATION", - "CERT_TRUST_IS_REVOKED", - "CERT_TRUST_IS_UNTRUSTED_ROOT", - "CERT_TRUST_NO_ERROR", - "CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", - "CERT_TRUST_REVOCATION_STATUS_UNKNOWN", - "CFLUSH", - "CLOCAL", - "CLONE_CHILD_CLEARTID", - "CLONE_CHILD_SETTID", - "CLONE_CSIGNAL", - "CLONE_DETACHED", - "CLONE_FILES", - "CLONE_FS", - "CLONE_IO", - "CLONE_NEWIPC", - "CLONE_NEWNET", - "CLONE_NEWNS", - "CLONE_NEWPID", - "CLONE_NEWUSER", - "CLONE_NEWUTS", - "CLONE_PARENT", - "CLONE_PARENT_SETTID", - "CLONE_PID", - "CLONE_PTRACE", - "CLONE_SETTLS", - "CLONE_SIGHAND", - "CLONE_SYSVSEM", - "CLONE_THREAD", - "CLONE_UNTRACED", - "CLONE_VFORK", - "CLONE_VM", - "CPUID_CFLUSH", - "CREAD", - "CREATE_ALWAYS", - "CREATE_NEW", - "CREATE_NEW_PROCESS_GROUP", - "CREATE_UNICODE_ENVIRONMENT", - "CRYPT_DEFAULT_CONTAINER_OPTIONAL", - "CRYPT_DELETEKEYSET", - "CRYPT_MACHINE_KEYSET", - "CRYPT_NEWKEYSET", - "CRYPT_SILENT", - "CRYPT_VERIFYCONTEXT", - "CS5", - "CS6", - "CS7", - "CS8", - "CSIZE", - "CSTART", - "CSTATUS", - "CSTOP", - "CSTOPB", - "CSUSP", - "CTL_MAXNAME", - "CTL_NET", - "CTL_QUERY", - "CTRL_BREAK_EVENT", - "CTRL_CLOSE_EVENT", - "CTRL_C_EVENT", - "CTRL_LOGOFF_EVENT", - "CTRL_SHUTDOWN_EVENT", - "CancelIo", - "CancelIoEx", - "CertAddCertificateContextToStore", - "CertChainContext", - "CertChainElement", - "CertChainPara", - "CertChainPolicyPara", - "CertChainPolicyStatus", - "CertCloseStore", - "CertContext", - "CertCreateCertificateContext", - "CertEnhKeyUsage", - "CertEnumCertificatesInStore", - "CertFreeCertificateChain", - "CertFreeCertificateContext", - "CertGetCertificateChain", - "CertInfo", - "CertOpenStore", - "CertOpenSystemStore", - "CertRevocationCrlInfo", - "CertRevocationInfo", - "CertSimpleChain", - "CertTrustListInfo", - "CertTrustStatus", - "CertUsageMatch", - "CertVerifyCertificateChainPolicy", - "Chdir", - "CheckBpfVersion", - "Chflags", - "Chmod", - "Chown", - "Chroot", - "Clearenv", - "Close", - "CloseHandle", - "CloseOnExec", - "Closesocket", - "CmsgLen", - "CmsgSpace", - "Cmsghdr", - "CommandLineToArgv", - "ComputerName", - "Conn", - "Connect", - "ConnectEx", - "ConvertSidToStringSid", - "ConvertStringSidToSid", - "CopySid", - "Creat", - "CreateDirectory", - "CreateFile", - "CreateFileMapping", - "CreateHardLink", - "CreateIoCompletionPort", - "CreatePipe", - "CreateProcess", - "CreateProcessAsUser", - "CreateSymbolicLink", - "CreateToolhelp32Snapshot", - "Credential", - "CryptAcquireContext", - "CryptGenRandom", - "CryptReleaseContext", - "DIOCBSFLUSH", - "DIOCOSFPFLUSH", - "DLL", - "DLLError", - "DLT_A429", - "DLT_A653_ICM", - "DLT_AIRONET_HEADER", - "DLT_AOS", - "DLT_APPLE_IP_OVER_IEEE1394", - "DLT_ARCNET", - "DLT_ARCNET_LINUX", - "DLT_ATM_CLIP", - "DLT_ATM_RFC1483", - "DLT_AURORA", - "DLT_AX25", - "DLT_AX25_KISS", - "DLT_BACNET_MS_TP", - "DLT_BLUETOOTH_HCI_H4", - "DLT_BLUETOOTH_HCI_H4_WITH_PHDR", - "DLT_CAN20B", - "DLT_CAN_SOCKETCAN", - "DLT_CHAOS", - "DLT_CHDLC", - "DLT_CISCO_IOS", - "DLT_C_HDLC", - "DLT_C_HDLC_WITH_DIR", - "DLT_DBUS", - "DLT_DECT", - "DLT_DOCSIS", - "DLT_DVB_CI", - "DLT_ECONET", - "DLT_EN10MB", - "DLT_EN3MB", - "DLT_ENC", - "DLT_ERF", - "DLT_ERF_ETH", - "DLT_ERF_POS", - "DLT_FC_2", - "DLT_FC_2_WITH_FRAME_DELIMS", - "DLT_FDDI", - "DLT_FLEXRAY", - "DLT_FRELAY", - "DLT_FRELAY_WITH_DIR", - "DLT_GCOM_SERIAL", - "DLT_GCOM_T1E1", - "DLT_GPF_F", - "DLT_GPF_T", - "DLT_GPRS_LLC", - "DLT_GSMTAP_ABIS", - "DLT_GSMTAP_UM", - "DLT_HDLC", - "DLT_HHDLC", - "DLT_HIPPI", - "DLT_IBM_SN", - "DLT_IBM_SP", - "DLT_IEEE802", - "DLT_IEEE802_11", - "DLT_IEEE802_11_RADIO", - "DLT_IEEE802_11_RADIO_AVS", - "DLT_IEEE802_15_4", - "DLT_IEEE802_15_4_LINUX", - "DLT_IEEE802_15_4_NOFCS", - "DLT_IEEE802_15_4_NONASK_PHY", - "DLT_IEEE802_16_MAC_CPS", - "DLT_IEEE802_16_MAC_CPS_RADIO", - "DLT_IPFILTER", - "DLT_IPMB", - "DLT_IPMB_LINUX", - "DLT_IPNET", - "DLT_IPOIB", - "DLT_IPV4", - "DLT_IPV6", - "DLT_IP_OVER_FC", - "DLT_JUNIPER_ATM1", - "DLT_JUNIPER_ATM2", - "DLT_JUNIPER_ATM_CEMIC", - "DLT_JUNIPER_CHDLC", - "DLT_JUNIPER_ES", - "DLT_JUNIPER_ETHER", - "DLT_JUNIPER_FIBRECHANNEL", - "DLT_JUNIPER_FRELAY", - "DLT_JUNIPER_GGSN", - "DLT_JUNIPER_ISM", - "DLT_JUNIPER_MFR", - "DLT_JUNIPER_MLFR", - "DLT_JUNIPER_MLPPP", - "DLT_JUNIPER_MONITOR", - "DLT_JUNIPER_PIC_PEER", - "DLT_JUNIPER_PPP", - "DLT_JUNIPER_PPPOE", - "DLT_JUNIPER_PPPOE_ATM", - "DLT_JUNIPER_SERVICES", - "DLT_JUNIPER_SRX_E2E", - "DLT_JUNIPER_ST", - "DLT_JUNIPER_VP", - "DLT_JUNIPER_VS", - "DLT_LAPB_WITH_DIR", - "DLT_LAPD", - "DLT_LIN", - "DLT_LINUX_EVDEV", - "DLT_LINUX_IRDA", - "DLT_LINUX_LAPD", - "DLT_LINUX_PPP_WITHDIRECTION", - "DLT_LINUX_SLL", - "DLT_LOOP", - "DLT_LTALK", - "DLT_MATCHING_MAX", - "DLT_MATCHING_MIN", - "DLT_MFR", - "DLT_MOST", - "DLT_MPEG_2_TS", - "DLT_MPLS", - "DLT_MTP2", - "DLT_MTP2_WITH_PHDR", - "DLT_MTP3", - "DLT_MUX27010", - "DLT_NETANALYZER", - "DLT_NETANALYZER_TRANSPARENT", - "DLT_NFC_LLCP", - "DLT_NFLOG", - "DLT_NG40", - "DLT_NULL", - "DLT_PCI_EXP", - "DLT_PFLOG", - "DLT_PFSYNC", - "DLT_PPI", - "DLT_PPP", - "DLT_PPP_BSDOS", - "DLT_PPP_ETHER", - "DLT_PPP_PPPD", - "DLT_PPP_SERIAL", - "DLT_PPP_WITH_DIR", - "DLT_PPP_WITH_DIRECTION", - "DLT_PRISM_HEADER", - "DLT_PRONET", - "DLT_RAIF1", - "DLT_RAW", - "DLT_RAWAF_MASK", - "DLT_RIO", - "DLT_SCCP", - "DLT_SITA", - "DLT_SLIP", - "DLT_SLIP_BSDOS", - "DLT_STANAG_5066_D_PDU", - "DLT_SUNATM", - "DLT_SYMANTEC_FIREWALL", - "DLT_TZSP", - "DLT_USB", - "DLT_USB_LINUX", - "DLT_USB_LINUX_MMAPPED", - "DLT_USER0", - "DLT_USER1", - "DLT_USER10", - "DLT_USER11", - "DLT_USER12", - "DLT_USER13", - "DLT_USER14", - "DLT_USER15", - "DLT_USER2", - "DLT_USER3", - "DLT_USER4", - "DLT_USER5", - "DLT_USER6", - "DLT_USER7", - "DLT_USER8", - "DLT_USER9", - "DLT_WIHART", - "DLT_X2E_SERIAL", - "DLT_X2E_XORAYA", - "DNSMXData", - "DNSPTRData", - "DNSRecord", - "DNSSRVData", - "DNSTXTData", - "DNS_INFO_NO_RECORDS", - "DNS_TYPE_A", - "DNS_TYPE_A6", - "DNS_TYPE_AAAA", - "DNS_TYPE_ADDRS", - "DNS_TYPE_AFSDB", - "DNS_TYPE_ALL", - "DNS_TYPE_ANY", - "DNS_TYPE_ATMA", - "DNS_TYPE_AXFR", - "DNS_TYPE_CERT", - "DNS_TYPE_CNAME", - "DNS_TYPE_DHCID", - "DNS_TYPE_DNAME", - "DNS_TYPE_DNSKEY", - "DNS_TYPE_DS", - "DNS_TYPE_EID", - "DNS_TYPE_GID", - "DNS_TYPE_GPOS", - "DNS_TYPE_HINFO", - "DNS_TYPE_ISDN", - "DNS_TYPE_IXFR", - "DNS_TYPE_KEY", - "DNS_TYPE_KX", - "DNS_TYPE_LOC", - "DNS_TYPE_MAILA", - "DNS_TYPE_MAILB", - "DNS_TYPE_MB", - "DNS_TYPE_MD", - "DNS_TYPE_MF", - "DNS_TYPE_MG", - "DNS_TYPE_MINFO", - "DNS_TYPE_MR", - "DNS_TYPE_MX", - "DNS_TYPE_NAPTR", - "DNS_TYPE_NBSTAT", - "DNS_TYPE_NIMLOC", - "DNS_TYPE_NS", - "DNS_TYPE_NSAP", - "DNS_TYPE_NSAPPTR", - "DNS_TYPE_NSEC", - "DNS_TYPE_NULL", - "DNS_TYPE_NXT", - "DNS_TYPE_OPT", - "DNS_TYPE_PTR", - "DNS_TYPE_PX", - "DNS_TYPE_RP", - "DNS_TYPE_RRSIG", - "DNS_TYPE_RT", - "DNS_TYPE_SIG", - "DNS_TYPE_SINK", - "DNS_TYPE_SOA", - "DNS_TYPE_SRV", - "DNS_TYPE_TEXT", - "DNS_TYPE_TKEY", - "DNS_TYPE_TSIG", - "DNS_TYPE_UID", - "DNS_TYPE_UINFO", - "DNS_TYPE_UNSPEC", - "DNS_TYPE_WINS", - "DNS_TYPE_WINSR", - "DNS_TYPE_WKS", - "DNS_TYPE_X25", - "DT_BLK", - "DT_CHR", - "DT_DIR", - "DT_FIFO", - "DT_LNK", - "DT_REG", - "DT_SOCK", - "DT_UNKNOWN", - "DT_WHT", - "DUPLICATE_CLOSE_SOURCE", - "DUPLICATE_SAME_ACCESS", - "DeleteFile", - "DetachLsf", - "DeviceIoControl", - "Dirent", - "DnsNameCompare", - "DnsQuery", - "DnsRecordListFree", - "DnsSectionAdditional", - "DnsSectionAnswer", - "DnsSectionAuthority", - "DnsSectionQuestion", - "Dup", - "Dup2", - "Dup3", - "DuplicateHandle", - "E2BIG", - "EACCES", - "EADDRINUSE", - "EADDRNOTAVAIL", - "EADV", - "EAFNOSUPPORT", - "EAGAIN", - "EALREADY", - "EAUTH", - "EBADARCH", - "EBADE", - "EBADEXEC", - "EBADF", - "EBADFD", - "EBADMACHO", - "EBADMSG", - "EBADR", - "EBADRPC", - "EBADRQC", - "EBADSLT", - "EBFONT", - "EBUSY", - "ECANCELED", - "ECAPMODE", - "ECHILD", - "ECHO", - "ECHOCTL", - "ECHOE", - "ECHOK", - "ECHOKE", - "ECHONL", - "ECHOPRT", - "ECHRNG", - "ECOMM", - "ECONNABORTED", - "ECONNREFUSED", - "ECONNRESET", - "EDEADLK", - "EDEADLOCK", - "EDESTADDRREQ", - "EDEVERR", - "EDOM", - "EDOOFUS", - "EDOTDOT", - "EDQUOT", - "EEXIST", - "EFAULT", - "EFBIG", - "EFER_LMA", - "EFER_LME", - "EFER_NXE", - "EFER_SCE", - "EFTYPE", - "EHOSTDOWN", - "EHOSTUNREACH", - "EHWPOISON", - "EIDRM", - "EILSEQ", - "EINPROGRESS", - "EINTR", - "EINVAL", - "EIO", - "EIPSEC", - "EISCONN", - "EISDIR", - "EISNAM", - "EKEYEXPIRED", - "EKEYREJECTED", - "EKEYREVOKED", - "EL2HLT", - "EL2NSYNC", - "EL3HLT", - "EL3RST", - "ELAST", - "ELF_NGREG", - "ELF_PRARGSZ", - "ELIBACC", - "ELIBBAD", - "ELIBEXEC", - "ELIBMAX", - "ELIBSCN", - "ELNRNG", - "ELOOP", - "EMEDIUMTYPE", - "EMFILE", - "EMLINK", - "EMSGSIZE", - "EMT_TAGOVF", - "EMULTIHOP", - "EMUL_ENABLED", - "EMUL_LINUX", - "EMUL_LINUX32", - "EMUL_MAXID", - "EMUL_NATIVE", - "ENAMETOOLONG", - "ENAVAIL", - "ENDRUNDISC", - "ENEEDAUTH", - "ENETDOWN", - "ENETRESET", - "ENETUNREACH", - "ENFILE", - "ENOANO", - "ENOATTR", - "ENOBUFS", - "ENOCSI", - "ENODATA", - "ENODEV", - "ENOENT", - "ENOEXEC", - "ENOKEY", - "ENOLCK", - "ENOLINK", - "ENOMEDIUM", - "ENOMEM", - "ENOMSG", - "ENONET", - "ENOPKG", - "ENOPOLICY", - "ENOPROTOOPT", - "ENOSPC", - "ENOSR", - "ENOSTR", - "ENOSYS", - "ENOTBLK", - "ENOTCAPABLE", - "ENOTCONN", - "ENOTDIR", - "ENOTEMPTY", - "ENOTNAM", - "ENOTRECOVERABLE", - "ENOTSOCK", - "ENOTSUP", - "ENOTTY", - "ENOTUNIQ", - "ENXIO", - "EN_SW_CTL_INF", - "EN_SW_CTL_PREC", - "EN_SW_CTL_ROUND", - "EN_SW_DATACHAIN", - "EN_SW_DENORM", - "EN_SW_INVOP", - "EN_SW_OVERFLOW", - "EN_SW_PRECLOSS", - "EN_SW_UNDERFLOW", - "EN_SW_ZERODIV", - "EOPNOTSUPP", - "EOVERFLOW", - "EOWNERDEAD", - "EPERM", - "EPFNOSUPPORT", - "EPIPE", - "EPOLLERR", - "EPOLLET", - "EPOLLHUP", - "EPOLLIN", - "EPOLLMSG", - "EPOLLONESHOT", - "EPOLLOUT", - "EPOLLPRI", - "EPOLLRDBAND", - "EPOLLRDHUP", - "EPOLLRDNORM", - "EPOLLWRBAND", - "EPOLLWRNORM", - "EPOLL_CLOEXEC", - "EPOLL_CTL_ADD", - "EPOLL_CTL_DEL", - "EPOLL_CTL_MOD", - "EPOLL_NONBLOCK", - "EPROCLIM", - "EPROCUNAVAIL", - "EPROGMISMATCH", - "EPROGUNAVAIL", - "EPROTO", - "EPROTONOSUPPORT", - "EPROTOTYPE", - "EPWROFF", - "ERANGE", - "EREMCHG", - "EREMOTE", - "EREMOTEIO", - "ERESTART", - "ERFKILL", - "EROFS", - "ERPCMISMATCH", - "ERROR_ACCESS_DENIED", - "ERROR_ALREADY_EXISTS", - "ERROR_BROKEN_PIPE", - "ERROR_BUFFER_OVERFLOW", - "ERROR_DIR_NOT_EMPTY", - "ERROR_ENVVAR_NOT_FOUND", - "ERROR_FILE_EXISTS", - "ERROR_FILE_NOT_FOUND", - "ERROR_HANDLE_EOF", - "ERROR_INSUFFICIENT_BUFFER", - "ERROR_IO_PENDING", - "ERROR_MOD_NOT_FOUND", - "ERROR_MORE_DATA", - "ERROR_NETNAME_DELETED", - "ERROR_NOT_FOUND", - "ERROR_NO_MORE_FILES", - "ERROR_OPERATION_ABORTED", - "ERROR_PATH_NOT_FOUND", - "ERROR_PRIVILEGE_NOT_HELD", - "ERROR_PROC_NOT_FOUND", - "ESHLIBVERS", - "ESHUTDOWN", - "ESOCKTNOSUPPORT", - "ESPIPE", - "ESRCH", - "ESRMNT", - "ESTALE", - "ESTRPIPE", - "ETHERCAP_JUMBO_MTU", - "ETHERCAP_VLAN_HWTAGGING", - "ETHERCAP_VLAN_MTU", - "ETHERMIN", - "ETHERMTU", - "ETHERMTU_JUMBO", - "ETHERTYPE_8023", - "ETHERTYPE_AARP", - "ETHERTYPE_ACCTON", - "ETHERTYPE_AEONIC", - "ETHERTYPE_ALPHA", - "ETHERTYPE_AMBER", - "ETHERTYPE_AMOEBA", - "ETHERTYPE_AOE", - "ETHERTYPE_APOLLO", - "ETHERTYPE_APOLLODOMAIN", - "ETHERTYPE_APPLETALK", - "ETHERTYPE_APPLITEK", - "ETHERTYPE_ARGONAUT", - "ETHERTYPE_ARP", - "ETHERTYPE_AT", - "ETHERTYPE_ATALK", - "ETHERTYPE_ATOMIC", - "ETHERTYPE_ATT", - "ETHERTYPE_ATTSTANFORD", - "ETHERTYPE_AUTOPHON", - "ETHERTYPE_AXIS", - "ETHERTYPE_BCLOOP", - "ETHERTYPE_BOFL", - "ETHERTYPE_CABLETRON", - "ETHERTYPE_CHAOS", - "ETHERTYPE_COMDESIGN", - "ETHERTYPE_COMPUGRAPHIC", - "ETHERTYPE_COUNTERPOINT", - "ETHERTYPE_CRONUS", - "ETHERTYPE_CRONUSVLN", - "ETHERTYPE_DCA", - "ETHERTYPE_DDE", - "ETHERTYPE_DEBNI", - "ETHERTYPE_DECAM", - "ETHERTYPE_DECCUST", - "ETHERTYPE_DECDIAG", - "ETHERTYPE_DECDNS", - "ETHERTYPE_DECDTS", - "ETHERTYPE_DECEXPER", - "ETHERTYPE_DECLAST", - "ETHERTYPE_DECLTM", - "ETHERTYPE_DECMUMPS", - "ETHERTYPE_DECNETBIOS", - "ETHERTYPE_DELTACON", - "ETHERTYPE_DIDDLE", - "ETHERTYPE_DLOG1", - "ETHERTYPE_DLOG2", - "ETHERTYPE_DN", - "ETHERTYPE_DOGFIGHT", - "ETHERTYPE_DSMD", - "ETHERTYPE_ECMA", - "ETHERTYPE_ENCRYPT", - "ETHERTYPE_ES", - "ETHERTYPE_EXCELAN", - "ETHERTYPE_EXPERDATA", - "ETHERTYPE_FLIP", - "ETHERTYPE_FLOWCONTROL", - "ETHERTYPE_FRARP", - "ETHERTYPE_GENDYN", - "ETHERTYPE_HAYES", - "ETHERTYPE_HIPPI_FP", - "ETHERTYPE_HITACHI", - "ETHERTYPE_HP", - "ETHERTYPE_IEEEPUP", - "ETHERTYPE_IEEEPUPAT", - "ETHERTYPE_IMLBL", - "ETHERTYPE_IMLBLDIAG", - "ETHERTYPE_IP", - "ETHERTYPE_IPAS", - "ETHERTYPE_IPV6", - "ETHERTYPE_IPX", - "ETHERTYPE_IPXNEW", - "ETHERTYPE_KALPANA", - "ETHERTYPE_LANBRIDGE", - "ETHERTYPE_LANPROBE", - "ETHERTYPE_LAT", - "ETHERTYPE_LBACK", - "ETHERTYPE_LITTLE", - "ETHERTYPE_LLDP", - "ETHERTYPE_LOGICRAFT", - "ETHERTYPE_LOOPBACK", - "ETHERTYPE_MATRA", - "ETHERTYPE_MAX", - "ETHERTYPE_MERIT", - "ETHERTYPE_MICP", - "ETHERTYPE_MOPDL", - "ETHERTYPE_MOPRC", - "ETHERTYPE_MOTOROLA", - "ETHERTYPE_MPLS", - "ETHERTYPE_MPLS_MCAST", - "ETHERTYPE_MUMPS", - "ETHERTYPE_NBPCC", - "ETHERTYPE_NBPCLAIM", - "ETHERTYPE_NBPCLREQ", - "ETHERTYPE_NBPCLRSP", - "ETHERTYPE_NBPCREQ", - "ETHERTYPE_NBPCRSP", - "ETHERTYPE_NBPDG", - "ETHERTYPE_NBPDGB", - "ETHERTYPE_NBPDLTE", - "ETHERTYPE_NBPRAR", - "ETHERTYPE_NBPRAS", - "ETHERTYPE_NBPRST", - "ETHERTYPE_NBPSCD", - "ETHERTYPE_NBPVCD", - "ETHERTYPE_NBS", - "ETHERTYPE_NCD", - "ETHERTYPE_NESTAR", - "ETHERTYPE_NETBEUI", - "ETHERTYPE_NOVELL", - "ETHERTYPE_NS", - "ETHERTYPE_NSAT", - "ETHERTYPE_NSCOMPAT", - "ETHERTYPE_NTRAILER", - "ETHERTYPE_OS9", - "ETHERTYPE_OS9NET", - "ETHERTYPE_PACER", - "ETHERTYPE_PAE", - "ETHERTYPE_PCS", - "ETHERTYPE_PLANNING", - "ETHERTYPE_PPP", - "ETHERTYPE_PPPOE", - "ETHERTYPE_PPPOEDISC", - "ETHERTYPE_PRIMENTS", - "ETHERTYPE_PUP", - "ETHERTYPE_PUPAT", - "ETHERTYPE_QINQ", - "ETHERTYPE_RACAL", - "ETHERTYPE_RATIONAL", - "ETHERTYPE_RAWFR", - "ETHERTYPE_RCL", - "ETHERTYPE_RDP", - "ETHERTYPE_RETIX", - "ETHERTYPE_REVARP", - "ETHERTYPE_SCA", - "ETHERTYPE_SECTRA", - "ETHERTYPE_SECUREDATA", - "ETHERTYPE_SGITW", - "ETHERTYPE_SG_BOUNCE", - "ETHERTYPE_SG_DIAG", - "ETHERTYPE_SG_NETGAMES", - "ETHERTYPE_SG_RESV", - "ETHERTYPE_SIMNET", - "ETHERTYPE_SLOW", - "ETHERTYPE_SLOWPROTOCOLS", - "ETHERTYPE_SNA", - "ETHERTYPE_SNMP", - "ETHERTYPE_SONIX", - "ETHERTYPE_SPIDER", - "ETHERTYPE_SPRITE", - "ETHERTYPE_STP", - "ETHERTYPE_TALARIS", - "ETHERTYPE_TALARISMC", - "ETHERTYPE_TCPCOMP", - "ETHERTYPE_TCPSM", - "ETHERTYPE_TEC", - "ETHERTYPE_TIGAN", - "ETHERTYPE_TRAIL", - "ETHERTYPE_TRANSETHER", - "ETHERTYPE_TYMSHARE", - "ETHERTYPE_UBBST", - "ETHERTYPE_UBDEBUG", - "ETHERTYPE_UBDIAGLOOP", - "ETHERTYPE_UBDL", - "ETHERTYPE_UBNIU", - "ETHERTYPE_UBNMC", - "ETHERTYPE_VALID", - "ETHERTYPE_VARIAN", - "ETHERTYPE_VAXELN", - "ETHERTYPE_VEECO", - "ETHERTYPE_VEXP", - "ETHERTYPE_VGLAB", - "ETHERTYPE_VINES", - "ETHERTYPE_VINESECHO", - "ETHERTYPE_VINESLOOP", - "ETHERTYPE_VITAL", - "ETHERTYPE_VLAN", - "ETHERTYPE_VLTLMAN", - "ETHERTYPE_VPROD", - "ETHERTYPE_VURESERVED", - "ETHERTYPE_WATERLOO", - "ETHERTYPE_WELLFLEET", - "ETHERTYPE_X25", - "ETHERTYPE_X75", - "ETHERTYPE_XNSSM", - "ETHERTYPE_XTP", - "ETHER_ADDR_LEN", - "ETHER_ALIGN", - "ETHER_CRC_LEN", - "ETHER_CRC_POLY_BE", - "ETHER_CRC_POLY_LE", - "ETHER_HDR_LEN", - "ETHER_MAX_DIX_LEN", - "ETHER_MAX_LEN", - "ETHER_MAX_LEN_JUMBO", - "ETHER_MIN_LEN", - "ETHER_PPPOE_ENCAP_LEN", - "ETHER_TYPE_LEN", - "ETHER_VLAN_ENCAP_LEN", - "ETH_P_1588", - "ETH_P_8021Q", - "ETH_P_802_2", - "ETH_P_802_3", - "ETH_P_AARP", - "ETH_P_ALL", - "ETH_P_AOE", - "ETH_P_ARCNET", - "ETH_P_ARP", - "ETH_P_ATALK", - "ETH_P_ATMFATE", - "ETH_P_ATMMPOA", - "ETH_P_AX25", - "ETH_P_BPQ", - "ETH_P_CAIF", - "ETH_P_CAN", - "ETH_P_CONTROL", - "ETH_P_CUST", - "ETH_P_DDCMP", - "ETH_P_DEC", - "ETH_P_DIAG", - "ETH_P_DNA_DL", - "ETH_P_DNA_RC", - "ETH_P_DNA_RT", - "ETH_P_DSA", - "ETH_P_ECONET", - "ETH_P_EDSA", - "ETH_P_FCOE", - "ETH_P_FIP", - "ETH_P_HDLC", - "ETH_P_IEEE802154", - "ETH_P_IEEEPUP", - "ETH_P_IEEEPUPAT", - "ETH_P_IP", - "ETH_P_IPV6", - "ETH_P_IPX", - "ETH_P_IRDA", - "ETH_P_LAT", - "ETH_P_LINK_CTL", - "ETH_P_LOCALTALK", - "ETH_P_LOOP", - "ETH_P_MOBITEX", - "ETH_P_MPLS_MC", - "ETH_P_MPLS_UC", - "ETH_P_PAE", - "ETH_P_PAUSE", - "ETH_P_PHONET", - "ETH_P_PPPTALK", - "ETH_P_PPP_DISC", - "ETH_P_PPP_MP", - "ETH_P_PPP_SES", - "ETH_P_PUP", - "ETH_P_PUPAT", - "ETH_P_RARP", - "ETH_P_SCA", - "ETH_P_SLOW", - "ETH_P_SNAP", - "ETH_P_TEB", - "ETH_P_TIPC", - "ETH_P_TRAILER", - "ETH_P_TR_802_2", - "ETH_P_WAN_PPP", - "ETH_P_WCCP", - "ETH_P_X25", - "ETIME", - "ETIMEDOUT", - "ETOOMANYREFS", - "ETXTBSY", - "EUCLEAN", - "EUNATCH", - "EUSERS", - "EVFILT_AIO", - "EVFILT_FS", - "EVFILT_LIO", - "EVFILT_MACHPORT", - "EVFILT_PROC", - "EVFILT_READ", - "EVFILT_SIGNAL", - "EVFILT_SYSCOUNT", - "EVFILT_THREADMARKER", - "EVFILT_TIMER", - "EVFILT_USER", - "EVFILT_VM", - "EVFILT_VNODE", - "EVFILT_WRITE", - "EV_ADD", - "EV_CLEAR", - "EV_DELETE", - "EV_DISABLE", - "EV_DISPATCH", - "EV_DROP", - "EV_ENABLE", - "EV_EOF", - "EV_ERROR", - "EV_FLAG0", - "EV_FLAG1", - "EV_ONESHOT", - "EV_OOBAND", - "EV_POLL", - "EV_RECEIPT", - "EV_SYSFLAGS", - "EWINDOWS", - "EWOULDBLOCK", - "EXDEV", - "EXFULL", - "EXTA", - "EXTB", - "EXTPROC", - "Environ", - "EpollCreate", - "EpollCreate1", - "EpollCtl", - "EpollEvent", - "EpollWait", - "Errno", - "EscapeArg", - "Exchangedata", - "Exec", - "Exit", - "ExitProcess", - "FD_CLOEXEC", - "FD_SETSIZE", - "FILE_ACTION_ADDED", - "FILE_ACTION_MODIFIED", - "FILE_ACTION_REMOVED", - "FILE_ACTION_RENAMED_NEW_NAME", - "FILE_ACTION_RENAMED_OLD_NAME", - "FILE_APPEND_DATA", - "FILE_ATTRIBUTE_ARCHIVE", - "FILE_ATTRIBUTE_DIRECTORY", - "FILE_ATTRIBUTE_HIDDEN", - "FILE_ATTRIBUTE_NORMAL", - "FILE_ATTRIBUTE_READONLY", - "FILE_ATTRIBUTE_REPARSE_POINT", - "FILE_ATTRIBUTE_SYSTEM", - "FILE_BEGIN", - "FILE_CURRENT", - "FILE_END", - "FILE_FLAG_BACKUP_SEMANTICS", - "FILE_FLAG_OPEN_REPARSE_POINT", - "FILE_FLAG_OVERLAPPED", - "FILE_LIST_DIRECTORY", - "FILE_MAP_COPY", - "FILE_MAP_EXECUTE", - "FILE_MAP_READ", - "FILE_MAP_WRITE", - "FILE_NOTIFY_CHANGE_ATTRIBUTES", - "FILE_NOTIFY_CHANGE_CREATION", - "FILE_NOTIFY_CHANGE_DIR_NAME", - "FILE_NOTIFY_CHANGE_FILE_NAME", - "FILE_NOTIFY_CHANGE_LAST_ACCESS", - "FILE_NOTIFY_CHANGE_LAST_WRITE", - "FILE_NOTIFY_CHANGE_SIZE", - "FILE_SHARE_DELETE", - "FILE_SHARE_READ", - "FILE_SHARE_WRITE", - "FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", - "FILE_SKIP_SET_EVENT_ON_HANDLE", - "FILE_TYPE_CHAR", - "FILE_TYPE_DISK", - "FILE_TYPE_PIPE", - "FILE_TYPE_REMOTE", - "FILE_TYPE_UNKNOWN", - "FILE_WRITE_ATTRIBUTES", - "FLUSHO", - "FORMAT_MESSAGE_ALLOCATE_BUFFER", - "FORMAT_MESSAGE_ARGUMENT_ARRAY", - "FORMAT_MESSAGE_FROM_HMODULE", - "FORMAT_MESSAGE_FROM_STRING", - "FORMAT_MESSAGE_FROM_SYSTEM", - "FORMAT_MESSAGE_IGNORE_INSERTS", - "FORMAT_MESSAGE_MAX_WIDTH_MASK", - "FSCTL_GET_REPARSE_POINT", - "F_ADDFILESIGS", - "F_ADDSIGS", - "F_ALLOCATEALL", - "F_ALLOCATECONTIG", - "F_CANCEL", - "F_CHKCLEAN", - "F_CLOSEM", - "F_DUP2FD", - "F_DUP2FD_CLOEXEC", - "F_DUPFD", - "F_DUPFD_CLOEXEC", - "F_EXLCK", - "F_FLUSH_DATA", - "F_FREEZE_FS", - "F_FSCTL", - "F_FSDIRMASK", - "F_FSIN", - "F_FSINOUT", - "F_FSOUT", - "F_FSPRIV", - "F_FSVOID", - "F_FULLFSYNC", - "F_GETFD", - "F_GETFL", - "F_GETLEASE", - "F_GETLK", - "F_GETLK64", - "F_GETLKPID", - "F_GETNOSIGPIPE", - "F_GETOWN", - "F_GETOWN_EX", - "F_GETPATH", - "F_GETPATH_MTMINFO", - "F_GETPIPE_SZ", - "F_GETPROTECTIONCLASS", - "F_GETSIG", - "F_GLOBAL_NOCACHE", - "F_LOCK", - "F_LOG2PHYS", - "F_LOG2PHYS_EXT", - "F_MARKDEPENDENCY", - "F_MAXFD", - "F_NOCACHE", - "F_NODIRECT", - "F_NOTIFY", - "F_OGETLK", - "F_OK", - "F_OSETLK", - "F_OSETLKW", - "F_PARAM_MASK", - "F_PARAM_MAX", - "F_PATHPKG_CHECK", - "F_PEOFPOSMODE", - "F_PREALLOCATE", - "F_RDADVISE", - "F_RDAHEAD", - "F_RDLCK", - "F_READAHEAD", - "F_READBOOTSTRAP", - "F_SETBACKINGSTORE", - "F_SETFD", - "F_SETFL", - "F_SETLEASE", - "F_SETLK", - "F_SETLK64", - "F_SETLKW", - "F_SETLKW64", - "F_SETLK_REMOTE", - "F_SETNOSIGPIPE", - "F_SETOWN", - "F_SETOWN_EX", - "F_SETPIPE_SZ", - "F_SETPROTECTIONCLASS", - "F_SETSIG", - "F_SETSIZE", - "F_SHLCK", - "F_TEST", - "F_THAW_FS", - "F_TLOCK", - "F_ULOCK", - "F_UNLCK", - "F_UNLCKSYS", - "F_VOLPOSMODE", - "F_WRITEBOOTSTRAP", - "F_WRLCK", - "Faccessat", - "Fallocate", - "Fbootstraptransfer_t", - "Fchdir", - "Fchflags", - "Fchmod", - "Fchmodat", - "Fchown", - "Fchownat", - "FcntlFlock", - "FdSet", - "Fdatasync", - "FileNotifyInformation", - "Filetime", - "FindClose", - "FindFirstFile", - "FindNextFile", - "Flock", - "Flock_t", - "FlushBpf", - "FlushFileBuffers", - "FlushViewOfFile", - "ForkExec", - "ForkLock", - "FormatMessage", - "Fpathconf", - "FreeAddrInfoW", - "FreeEnvironmentStrings", - "FreeLibrary", - "Fsid", - "Fstat", - "Fstatat", - "Fstatfs", - "Fstore_t", - "Fsync", - "Ftruncate", - "FullPath", - "Futimes", - "Futimesat", - "GENERIC_ALL", - "GENERIC_EXECUTE", - "GENERIC_READ", - "GENERIC_WRITE", - "GUID", - "GetAcceptExSockaddrs", - "GetAdaptersInfo", - "GetAddrInfoW", - "GetCommandLine", - "GetComputerName", - "GetConsoleMode", - "GetCurrentDirectory", - "GetCurrentProcess", - "GetEnvironmentStrings", - "GetEnvironmentVariable", - "GetExitCodeProcess", - "GetFileAttributes", - "GetFileAttributesEx", - "GetFileExInfoStandard", - "GetFileExMaxInfoLevel", - "GetFileInformationByHandle", - "GetFileType", - "GetFullPathName", - "GetHostByName", - "GetIfEntry", - "GetLastError", - "GetLengthSid", - "GetLongPathName", - "GetProcAddress", - "GetProcessTimes", - "GetProtoByName", - "GetQueuedCompletionStatus", - "GetServByName", - "GetShortPathName", - "GetStartupInfo", - "GetStdHandle", - "GetSystemTimeAsFileTime", - "GetTempPath", - "GetTimeZoneInformation", - "GetTokenInformation", - "GetUserNameEx", - "GetUserProfileDirectory", - "GetVersion", - "Getcwd", - "Getdents", - "Getdirentries", - "Getdtablesize", - "Getegid", - "Getenv", - "Geteuid", - "Getfsstat", - "Getgid", - "Getgroups", - "Getpagesize", - "Getpeername", - "Getpgid", - "Getpgrp", - "Getpid", - "Getppid", - "Getpriority", - "Getrlimit", - "Getrusage", - "Getsid", - "Getsockname", - "Getsockopt", - "GetsockoptByte", - "GetsockoptICMPv6Filter", - "GetsockoptIPMreq", - "GetsockoptIPMreqn", - "GetsockoptIPv6MTUInfo", - "GetsockoptIPv6Mreq", - "GetsockoptInet4Addr", - "GetsockoptInt", - "GetsockoptUcred", - "Gettid", - "Gettimeofday", - "Getuid", - "Getwd", - "Getxattr", - "HANDLE_FLAG_INHERIT", - "HKEY_CLASSES_ROOT", - "HKEY_CURRENT_CONFIG", - "HKEY_CURRENT_USER", - "HKEY_DYN_DATA", - "HKEY_LOCAL_MACHINE", - "HKEY_PERFORMANCE_DATA", - "HKEY_USERS", - "HUPCL", - "Handle", - "Hostent", - "ICANON", - "ICMP6_FILTER", - "ICMPV6_FILTER", - "ICMPv6Filter", - "ICRNL", - "IEXTEN", - "IFAN_ARRIVAL", - "IFAN_DEPARTURE", - "IFA_ADDRESS", - "IFA_ANYCAST", - "IFA_BROADCAST", - "IFA_CACHEINFO", - "IFA_F_DADFAILED", - "IFA_F_DEPRECATED", - "IFA_F_HOMEADDRESS", - "IFA_F_NODAD", - "IFA_F_OPTIMISTIC", - "IFA_F_PERMANENT", - "IFA_F_SECONDARY", - "IFA_F_TEMPORARY", - "IFA_F_TENTATIVE", - "IFA_LABEL", - "IFA_LOCAL", - "IFA_MAX", - "IFA_MULTICAST", - "IFA_ROUTE", - "IFA_UNSPEC", - "IFF_ALLMULTI", - "IFF_ALTPHYS", - "IFF_AUTOMEDIA", - "IFF_BROADCAST", - "IFF_CANTCHANGE", - "IFF_CANTCONFIG", - "IFF_DEBUG", - "IFF_DRV_OACTIVE", - "IFF_DRV_RUNNING", - "IFF_DYING", - "IFF_DYNAMIC", - "IFF_LINK0", - "IFF_LINK1", - "IFF_LINK2", - "IFF_LOOPBACK", - "IFF_MASTER", - "IFF_MONITOR", - "IFF_MULTICAST", - "IFF_NOARP", - "IFF_NOTRAILERS", - "IFF_NO_PI", - "IFF_OACTIVE", - "IFF_ONE_QUEUE", - "IFF_POINTOPOINT", - "IFF_POINTTOPOINT", - "IFF_PORTSEL", - "IFF_PPROMISC", - "IFF_PROMISC", - "IFF_RENAMING", - "IFF_RUNNING", - "IFF_SIMPLEX", - "IFF_SLAVE", - "IFF_SMART", - "IFF_STATICARP", - "IFF_TAP", - "IFF_TUN", - "IFF_TUN_EXCL", - "IFF_UP", - "IFF_VNET_HDR", - "IFLA_ADDRESS", - "IFLA_BROADCAST", - "IFLA_COST", - "IFLA_IFALIAS", - "IFLA_IFNAME", - "IFLA_LINK", - "IFLA_LINKINFO", - "IFLA_LINKMODE", - "IFLA_MAP", - "IFLA_MASTER", - "IFLA_MAX", - "IFLA_MTU", - "IFLA_NET_NS_PID", - "IFLA_OPERSTATE", - "IFLA_PRIORITY", - "IFLA_PROTINFO", - "IFLA_QDISC", - "IFLA_STATS", - "IFLA_TXQLEN", - "IFLA_UNSPEC", - "IFLA_WEIGHT", - "IFLA_WIRELESS", - "IFNAMSIZ", - "IFT_1822", - "IFT_A12MPPSWITCH", - "IFT_AAL2", - "IFT_AAL5", - "IFT_ADSL", - "IFT_AFLANE8023", - "IFT_AFLANE8025", - "IFT_ARAP", - "IFT_ARCNET", - "IFT_ARCNETPLUS", - "IFT_ASYNC", - "IFT_ATM", - "IFT_ATMDXI", - "IFT_ATMFUNI", - "IFT_ATMIMA", - "IFT_ATMLOGICAL", - "IFT_ATMRADIO", - "IFT_ATMSUBINTERFACE", - "IFT_ATMVCIENDPT", - "IFT_ATMVIRTUAL", - "IFT_BGPPOLICYACCOUNTING", - "IFT_BLUETOOTH", - "IFT_BRIDGE", - "IFT_BSC", - "IFT_CARP", - "IFT_CCTEMUL", - "IFT_CELLULAR", - "IFT_CEPT", - "IFT_CES", - "IFT_CHANNEL", - "IFT_CNR", - "IFT_COFFEE", - "IFT_COMPOSITELINK", - "IFT_DCN", - "IFT_DIGITALPOWERLINE", - "IFT_DIGITALWRAPPEROVERHEADCHANNEL", - "IFT_DLSW", - "IFT_DOCSCABLEDOWNSTREAM", - "IFT_DOCSCABLEMACLAYER", - "IFT_DOCSCABLEUPSTREAM", - "IFT_DOCSCABLEUPSTREAMCHANNEL", - "IFT_DS0", - "IFT_DS0BUNDLE", - "IFT_DS1FDL", - "IFT_DS3", - "IFT_DTM", - "IFT_DUMMY", - "IFT_DVBASILN", - "IFT_DVBASIOUT", - "IFT_DVBRCCDOWNSTREAM", - "IFT_DVBRCCMACLAYER", - "IFT_DVBRCCUPSTREAM", - "IFT_ECONET", - "IFT_ENC", - "IFT_EON", - "IFT_EPLRS", - "IFT_ESCON", - "IFT_ETHER", - "IFT_FAITH", - "IFT_FAST", - "IFT_FASTETHER", - "IFT_FASTETHERFX", - "IFT_FDDI", - "IFT_FIBRECHANNEL", - "IFT_FRAMERELAYINTERCONNECT", - "IFT_FRAMERELAYMPI", - "IFT_FRDLCIENDPT", - "IFT_FRELAY", - "IFT_FRELAYDCE", - "IFT_FRF16MFRBUNDLE", - "IFT_FRFORWARD", - "IFT_G703AT2MB", - "IFT_G703AT64K", - "IFT_GIF", - "IFT_GIGABITETHERNET", - "IFT_GR303IDT", - "IFT_GR303RDT", - "IFT_H323GATEKEEPER", - "IFT_H323PROXY", - "IFT_HDH1822", - "IFT_HDLC", - "IFT_HDSL2", - "IFT_HIPERLAN2", - "IFT_HIPPI", - "IFT_HIPPIINTERFACE", - "IFT_HOSTPAD", - "IFT_HSSI", - "IFT_HY", - "IFT_IBM370PARCHAN", - "IFT_IDSL", - "IFT_IEEE1394", - "IFT_IEEE80211", - "IFT_IEEE80212", - "IFT_IEEE8023ADLAG", - "IFT_IFGSN", - "IFT_IMT", - "IFT_INFINIBAND", - "IFT_INTERLEAVE", - "IFT_IP", - "IFT_IPFORWARD", - "IFT_IPOVERATM", - "IFT_IPOVERCDLC", - "IFT_IPOVERCLAW", - "IFT_IPSWITCH", - "IFT_IPXIP", - "IFT_ISDN", - "IFT_ISDNBASIC", - "IFT_ISDNPRIMARY", - "IFT_ISDNS", - "IFT_ISDNU", - "IFT_ISO88022LLC", - "IFT_ISO88023", - "IFT_ISO88024", - "IFT_ISO88025", - "IFT_ISO88025CRFPINT", - "IFT_ISO88025DTR", - "IFT_ISO88025FIBER", - "IFT_ISO88026", - "IFT_ISUP", - "IFT_L2VLAN", - "IFT_L3IPVLAN", - "IFT_L3IPXVLAN", - "IFT_LAPB", - "IFT_LAPD", - "IFT_LAPF", - "IFT_LINEGROUP", - "IFT_LOCALTALK", - "IFT_LOOP", - "IFT_MEDIAMAILOVERIP", - "IFT_MFSIGLINK", - "IFT_MIOX25", - "IFT_MODEM", - "IFT_MPC", - "IFT_MPLS", - "IFT_MPLSTUNNEL", - "IFT_MSDSL", - "IFT_MVL", - "IFT_MYRINET", - "IFT_NFAS", - "IFT_NSIP", - "IFT_OPTICALCHANNEL", - "IFT_OPTICALTRANSPORT", - "IFT_OTHER", - "IFT_P10", - "IFT_P80", - "IFT_PARA", - "IFT_PDP", - "IFT_PFLOG", - "IFT_PFLOW", - "IFT_PFSYNC", - "IFT_PLC", - "IFT_PON155", - "IFT_PON622", - "IFT_POS", - "IFT_PPP", - "IFT_PPPMULTILINKBUNDLE", - "IFT_PROPATM", - "IFT_PROPBWAP2MP", - "IFT_PROPCNLS", - "IFT_PROPDOCSWIRELESSDOWNSTREAM", - "IFT_PROPDOCSWIRELESSMACLAYER", - "IFT_PROPDOCSWIRELESSUPSTREAM", - "IFT_PROPMUX", - "IFT_PROPVIRTUAL", - "IFT_PROPWIRELESSP2P", - "IFT_PTPSERIAL", - "IFT_PVC", - "IFT_Q2931", - "IFT_QLLC", - "IFT_RADIOMAC", - "IFT_RADSL", - "IFT_REACHDSL", - "IFT_RFC1483", - "IFT_RS232", - "IFT_RSRB", - "IFT_SDLC", - "IFT_SDSL", - "IFT_SHDSL", - "IFT_SIP", - "IFT_SIPSIG", - "IFT_SIPTG", - "IFT_SLIP", - "IFT_SMDSDXI", - "IFT_SMDSICIP", - "IFT_SONET", - "IFT_SONETOVERHEADCHANNEL", - "IFT_SONETPATH", - "IFT_SONETVT", - "IFT_SRP", - "IFT_SS7SIGLINK", - "IFT_STACKTOSTACK", - "IFT_STARLAN", - "IFT_STF", - "IFT_T1", - "IFT_TDLC", - "IFT_TELINK", - "IFT_TERMPAD", - "IFT_TR008", - "IFT_TRANSPHDLC", - "IFT_TUNNEL", - "IFT_ULTRA", - "IFT_USB", - "IFT_V11", - "IFT_V35", - "IFT_V36", - "IFT_V37", - "IFT_VDSL", - "IFT_VIRTUALIPADDRESS", - "IFT_VIRTUALTG", - "IFT_VOICEDID", - "IFT_VOICEEM", - "IFT_VOICEEMFGD", - "IFT_VOICEENCAP", - "IFT_VOICEFGDEANA", - "IFT_VOICEFXO", - "IFT_VOICEFXS", - "IFT_VOICEOVERATM", - "IFT_VOICEOVERCABLE", - "IFT_VOICEOVERFRAMERELAY", - "IFT_VOICEOVERIP", - "IFT_X213", - "IFT_X25", - "IFT_X25DDN", - "IFT_X25HUNTGROUP", - "IFT_X25MLP", - "IFT_X25PLE", - "IFT_XETHER", - "IGNBRK", - "IGNCR", - "IGNORE", - "IGNPAR", - "IMAXBEL", - "INFINITE", - "INLCR", - "INPCK", - "INVALID_FILE_ATTRIBUTES", - "IN_ACCESS", - "IN_ALL_EVENTS", - "IN_ATTRIB", - "IN_CLASSA_HOST", - "IN_CLASSA_MAX", - "IN_CLASSA_NET", - "IN_CLASSA_NSHIFT", - "IN_CLASSB_HOST", - "IN_CLASSB_MAX", - "IN_CLASSB_NET", - "IN_CLASSB_NSHIFT", - "IN_CLASSC_HOST", - "IN_CLASSC_NET", - "IN_CLASSC_NSHIFT", - "IN_CLASSD_HOST", - "IN_CLASSD_NET", - "IN_CLASSD_NSHIFT", - "IN_CLOEXEC", - "IN_CLOSE", - "IN_CLOSE_NOWRITE", - "IN_CLOSE_WRITE", - "IN_CREATE", - "IN_DELETE", - "IN_DELETE_SELF", - "IN_DONT_FOLLOW", - "IN_EXCL_UNLINK", - "IN_IGNORED", - "IN_ISDIR", - "IN_LINKLOCALNETNUM", - "IN_LOOPBACKNET", - "IN_MASK_ADD", - "IN_MODIFY", - "IN_MOVE", - "IN_MOVED_FROM", - "IN_MOVED_TO", - "IN_MOVE_SELF", - "IN_NONBLOCK", - "IN_ONESHOT", - "IN_ONLYDIR", - "IN_OPEN", - "IN_Q_OVERFLOW", - "IN_RFC3021_HOST", - "IN_RFC3021_MASK", - "IN_RFC3021_NET", - "IN_RFC3021_NSHIFT", - "IN_UNMOUNT", - "IOC_IN", - "IOC_INOUT", - "IOC_OUT", - "IOC_VENDOR", - "IOC_WS2", - "IO_REPARSE_TAG_SYMLINK", - "IPMreq", - "IPMreqn", - "IPPROTO_3PC", - "IPPROTO_ADFS", - "IPPROTO_AH", - "IPPROTO_AHIP", - "IPPROTO_APES", - "IPPROTO_ARGUS", - "IPPROTO_AX25", - "IPPROTO_BHA", - "IPPROTO_BLT", - "IPPROTO_BRSATMON", - "IPPROTO_CARP", - "IPPROTO_CFTP", - "IPPROTO_CHAOS", - "IPPROTO_CMTP", - "IPPROTO_COMP", - "IPPROTO_CPHB", - "IPPROTO_CPNX", - "IPPROTO_DCCP", - "IPPROTO_DDP", - "IPPROTO_DGP", - "IPPROTO_DIVERT", - "IPPROTO_DIVERT_INIT", - "IPPROTO_DIVERT_RESP", - "IPPROTO_DONE", - "IPPROTO_DSTOPTS", - "IPPROTO_EGP", - "IPPROTO_EMCON", - "IPPROTO_ENCAP", - "IPPROTO_EON", - "IPPROTO_ESP", - "IPPROTO_ETHERIP", - "IPPROTO_FRAGMENT", - "IPPROTO_GGP", - "IPPROTO_GMTP", - "IPPROTO_GRE", - "IPPROTO_HELLO", - "IPPROTO_HMP", - "IPPROTO_HOPOPTS", - "IPPROTO_ICMP", - "IPPROTO_ICMPV6", - "IPPROTO_IDP", - "IPPROTO_IDPR", - "IPPROTO_IDRP", - "IPPROTO_IGMP", - "IPPROTO_IGP", - "IPPROTO_IGRP", - "IPPROTO_IL", - "IPPROTO_INLSP", - "IPPROTO_INP", - "IPPROTO_IP", - "IPPROTO_IPCOMP", - "IPPROTO_IPCV", - "IPPROTO_IPEIP", - "IPPROTO_IPIP", - "IPPROTO_IPPC", - "IPPROTO_IPV4", - "IPPROTO_IPV6", - "IPPROTO_IPV6_ICMP", - "IPPROTO_IRTP", - "IPPROTO_KRYPTOLAN", - "IPPROTO_LARP", - "IPPROTO_LEAF1", - "IPPROTO_LEAF2", - "IPPROTO_MAX", - "IPPROTO_MAXID", - "IPPROTO_MEAS", - "IPPROTO_MH", - "IPPROTO_MHRP", - "IPPROTO_MICP", - "IPPROTO_MOBILE", - "IPPROTO_MPLS", - "IPPROTO_MTP", - "IPPROTO_MUX", - "IPPROTO_ND", - "IPPROTO_NHRP", - "IPPROTO_NONE", - "IPPROTO_NSP", - "IPPROTO_NVPII", - "IPPROTO_OLD_DIVERT", - "IPPROTO_OSPFIGP", - "IPPROTO_PFSYNC", - "IPPROTO_PGM", - "IPPROTO_PIGP", - "IPPROTO_PIM", - "IPPROTO_PRM", - "IPPROTO_PUP", - "IPPROTO_PVP", - "IPPROTO_RAW", - "IPPROTO_RCCMON", - "IPPROTO_RDP", - "IPPROTO_ROUTING", - "IPPROTO_RSVP", - "IPPROTO_RVD", - "IPPROTO_SATEXPAK", - "IPPROTO_SATMON", - "IPPROTO_SCCSP", - "IPPROTO_SCTP", - "IPPROTO_SDRP", - "IPPROTO_SEND", - "IPPROTO_SEP", - "IPPROTO_SKIP", - "IPPROTO_SPACER", - "IPPROTO_SRPC", - "IPPROTO_ST", - "IPPROTO_SVMTP", - "IPPROTO_SWIPE", - "IPPROTO_TCF", - "IPPROTO_TCP", - "IPPROTO_TLSP", - "IPPROTO_TP", - "IPPROTO_TPXX", - "IPPROTO_TRUNK1", - "IPPROTO_TRUNK2", - "IPPROTO_TTP", - "IPPROTO_UDP", - "IPPROTO_UDPLITE", - "IPPROTO_VINES", - "IPPROTO_VISA", - "IPPROTO_VMTP", - "IPPROTO_VRRP", - "IPPROTO_WBEXPAK", - "IPPROTO_WBMON", - "IPPROTO_WSN", - "IPPROTO_XNET", - "IPPROTO_XTP", - "IPV6_2292DSTOPTS", - "IPV6_2292HOPLIMIT", - "IPV6_2292HOPOPTS", - "IPV6_2292NEXTHOP", - "IPV6_2292PKTINFO", - "IPV6_2292PKTOPTIONS", - "IPV6_2292RTHDR", - "IPV6_ADDRFORM", - "IPV6_ADD_MEMBERSHIP", - "IPV6_AUTHHDR", - "IPV6_AUTH_LEVEL", - "IPV6_AUTOFLOWLABEL", - "IPV6_BINDANY", - "IPV6_BINDV6ONLY", - "IPV6_BOUND_IF", - "IPV6_CHECKSUM", - "IPV6_DEFAULT_MULTICAST_HOPS", - "IPV6_DEFAULT_MULTICAST_LOOP", - "IPV6_DEFHLIM", - "IPV6_DONTFRAG", - "IPV6_DROP_MEMBERSHIP", - "IPV6_DSTOPTS", - "IPV6_ESP_NETWORK_LEVEL", - "IPV6_ESP_TRANS_LEVEL", - "IPV6_FAITH", - "IPV6_FLOWINFO_MASK", - "IPV6_FLOWLABEL_MASK", - "IPV6_FRAGTTL", - "IPV6_FW_ADD", - "IPV6_FW_DEL", - "IPV6_FW_FLUSH", - "IPV6_FW_GET", - "IPV6_FW_ZERO", - "IPV6_HLIMDEC", - "IPV6_HOPLIMIT", - "IPV6_HOPOPTS", - "IPV6_IPCOMP_LEVEL", - "IPV6_IPSEC_POLICY", - "IPV6_JOIN_ANYCAST", - "IPV6_JOIN_GROUP", - "IPV6_LEAVE_ANYCAST", - "IPV6_LEAVE_GROUP", - "IPV6_MAXHLIM", - "IPV6_MAXOPTHDR", - "IPV6_MAXPACKET", - "IPV6_MAX_GROUP_SRC_FILTER", - "IPV6_MAX_MEMBERSHIPS", - "IPV6_MAX_SOCK_SRC_FILTER", - "IPV6_MIN_MEMBERSHIPS", - "IPV6_MMTU", - "IPV6_MSFILTER", - "IPV6_MTU", - "IPV6_MTU_DISCOVER", - "IPV6_MULTICAST_HOPS", - "IPV6_MULTICAST_IF", - "IPV6_MULTICAST_LOOP", - "IPV6_NEXTHOP", - "IPV6_OPTIONS", - "IPV6_PATHMTU", - "IPV6_PIPEX", - "IPV6_PKTINFO", - "IPV6_PMTUDISC_DO", - "IPV6_PMTUDISC_DONT", - "IPV6_PMTUDISC_PROBE", - "IPV6_PMTUDISC_WANT", - "IPV6_PORTRANGE", - "IPV6_PORTRANGE_DEFAULT", - "IPV6_PORTRANGE_HIGH", - "IPV6_PORTRANGE_LOW", - "IPV6_PREFER_TEMPADDR", - "IPV6_RECVDSTOPTS", - "IPV6_RECVDSTPORT", - "IPV6_RECVERR", - "IPV6_RECVHOPLIMIT", - "IPV6_RECVHOPOPTS", - "IPV6_RECVPATHMTU", - "IPV6_RECVPKTINFO", - "IPV6_RECVRTHDR", - "IPV6_RECVTCLASS", - "IPV6_ROUTER_ALERT", - "IPV6_RTABLE", - "IPV6_RTHDR", - "IPV6_RTHDRDSTOPTS", - "IPV6_RTHDR_LOOSE", - "IPV6_RTHDR_STRICT", - "IPV6_RTHDR_TYPE_0", - "IPV6_RXDSTOPTS", - "IPV6_RXHOPOPTS", - "IPV6_SOCKOPT_RESERVED1", - "IPV6_TCLASS", - "IPV6_UNICAST_HOPS", - "IPV6_USE_MIN_MTU", - "IPV6_V6ONLY", - "IPV6_VERSION", - "IPV6_VERSION_MASK", - "IPV6_XFRM_POLICY", - "IP_ADD_MEMBERSHIP", - "IP_ADD_SOURCE_MEMBERSHIP", - "IP_AUTH_LEVEL", - "IP_BINDANY", - "IP_BLOCK_SOURCE", - "IP_BOUND_IF", - "IP_DEFAULT_MULTICAST_LOOP", - "IP_DEFAULT_MULTICAST_TTL", - "IP_DF", - "IP_DIVERTFL", - "IP_DONTFRAG", - "IP_DROP_MEMBERSHIP", - "IP_DROP_SOURCE_MEMBERSHIP", - "IP_DUMMYNET3", - "IP_DUMMYNET_CONFIGURE", - "IP_DUMMYNET_DEL", - "IP_DUMMYNET_FLUSH", - "IP_DUMMYNET_GET", - "IP_EF", - "IP_ERRORMTU", - "IP_ESP_NETWORK_LEVEL", - "IP_ESP_TRANS_LEVEL", - "IP_FAITH", - "IP_FREEBIND", - "IP_FW3", - "IP_FW_ADD", - "IP_FW_DEL", - "IP_FW_FLUSH", - "IP_FW_GET", - "IP_FW_NAT_CFG", - "IP_FW_NAT_DEL", - "IP_FW_NAT_GET_CONFIG", - "IP_FW_NAT_GET_LOG", - "IP_FW_RESETLOG", - "IP_FW_TABLE_ADD", - "IP_FW_TABLE_DEL", - "IP_FW_TABLE_FLUSH", - "IP_FW_TABLE_GETSIZE", - "IP_FW_TABLE_LIST", - "IP_FW_ZERO", - "IP_HDRINCL", - "IP_IPCOMP_LEVEL", - "IP_IPSECFLOWINFO", - "IP_IPSEC_LOCAL_AUTH", - "IP_IPSEC_LOCAL_CRED", - "IP_IPSEC_LOCAL_ID", - "IP_IPSEC_POLICY", - "IP_IPSEC_REMOTE_AUTH", - "IP_IPSEC_REMOTE_CRED", - "IP_IPSEC_REMOTE_ID", - "IP_MAXPACKET", - "IP_MAX_GROUP_SRC_FILTER", - "IP_MAX_MEMBERSHIPS", - "IP_MAX_SOCK_MUTE_FILTER", - "IP_MAX_SOCK_SRC_FILTER", - "IP_MAX_SOURCE_FILTER", - "IP_MF", - "IP_MINFRAGSIZE", - "IP_MINTTL", - "IP_MIN_MEMBERSHIPS", - "IP_MSFILTER", - "IP_MSS", - "IP_MTU", - "IP_MTU_DISCOVER", - "IP_MULTICAST_IF", - "IP_MULTICAST_IFINDEX", - "IP_MULTICAST_LOOP", - "IP_MULTICAST_TTL", - "IP_MULTICAST_VIF", - "IP_NAT__XXX", - "IP_OFFMASK", - "IP_OLD_FW_ADD", - "IP_OLD_FW_DEL", - "IP_OLD_FW_FLUSH", - "IP_OLD_FW_GET", - "IP_OLD_FW_RESETLOG", - "IP_OLD_FW_ZERO", - "IP_ONESBCAST", - "IP_OPTIONS", - "IP_ORIGDSTADDR", - "IP_PASSSEC", - "IP_PIPEX", - "IP_PKTINFO", - "IP_PKTOPTIONS", - "IP_PMTUDISC", - "IP_PMTUDISC_DO", - "IP_PMTUDISC_DONT", - "IP_PMTUDISC_PROBE", - "IP_PMTUDISC_WANT", - "IP_PORTRANGE", - "IP_PORTRANGE_DEFAULT", - "IP_PORTRANGE_HIGH", - "IP_PORTRANGE_LOW", - "IP_RECVDSTADDR", - "IP_RECVDSTPORT", - "IP_RECVERR", - "IP_RECVIF", - "IP_RECVOPTS", - "IP_RECVORIGDSTADDR", - "IP_RECVPKTINFO", - "IP_RECVRETOPTS", - "IP_RECVRTABLE", - "IP_RECVTOS", - "IP_RECVTTL", - "IP_RETOPTS", - "IP_RF", - "IP_ROUTER_ALERT", - "IP_RSVP_OFF", - "IP_RSVP_ON", - "IP_RSVP_VIF_OFF", - "IP_RSVP_VIF_ON", - "IP_RTABLE", - "IP_SENDSRCADDR", - "IP_STRIPHDR", - "IP_TOS", - "IP_TRAFFIC_MGT_BACKGROUND", - "IP_TRANSPARENT", - "IP_TTL", - "IP_UNBLOCK_SOURCE", - "IP_XFRM_POLICY", - "IPv6MTUInfo", - "IPv6Mreq", - "ISIG", - "ISTRIP", - "IUCLC", - "IUTF8", - "IXANY", - "IXOFF", - "IXON", - "IfAddrmsg", - "IfAnnounceMsghdr", - "IfData", - "IfInfomsg", - "IfMsghdr", - "IfaMsghdr", - "IfmaMsghdr", - "IfmaMsghdr2", - "ImplementsGetwd", - "Inet4Pktinfo", - "Inet6Pktinfo", - "InotifyAddWatch", - "InotifyEvent", - "InotifyInit", - "InotifyInit1", - "InotifyRmWatch", - "InterfaceAddrMessage", - "InterfaceAnnounceMessage", - "InterfaceInfo", - "InterfaceMessage", - "InterfaceMulticastAddrMessage", - "InvalidHandle", - "Ioperm", - "Iopl", - "Iovec", - "IpAdapterInfo", - "IpAddrString", - "IpAddressString", - "IpMaskString", - "Issetugid", - "KEY_ALL_ACCESS", - "KEY_CREATE_LINK", - "KEY_CREATE_SUB_KEY", - "KEY_ENUMERATE_SUB_KEYS", - "KEY_EXECUTE", - "KEY_NOTIFY", - "KEY_QUERY_VALUE", - "KEY_READ", - "KEY_SET_VALUE", - "KEY_WOW64_32KEY", - "KEY_WOW64_64KEY", - "KEY_WRITE", - "Kevent", - "Kevent_t", - "Kill", - "Klogctl", - "Kqueue", - "LANG_ENGLISH", - "LAYERED_PROTOCOL", - "LCNT_OVERLOAD_FLUSH", - "LINUX_REBOOT_CMD_CAD_OFF", - "LINUX_REBOOT_CMD_CAD_ON", - "LINUX_REBOOT_CMD_HALT", - "LINUX_REBOOT_CMD_KEXEC", - "LINUX_REBOOT_CMD_POWER_OFF", - "LINUX_REBOOT_CMD_RESTART", - "LINUX_REBOOT_CMD_RESTART2", - "LINUX_REBOOT_CMD_SW_SUSPEND", - "LINUX_REBOOT_MAGIC1", - "LINUX_REBOOT_MAGIC2", - "LOCK_EX", - "LOCK_NB", - "LOCK_SH", - "LOCK_UN", - "LazyDLL", - "LazyProc", - "Lchown", - "Linger", - "Link", - "Listen", - "Listxattr", - "LoadCancelIoEx", - "LoadConnectEx", - "LoadCreateSymbolicLink", - "LoadDLL", - "LoadGetAddrInfo", - "LoadLibrary", - "LoadSetFileCompletionNotificationModes", - "LocalFree", - "Log2phys_t", - "LookupAccountName", - "LookupAccountSid", - "LookupSID", - "LsfJump", - "LsfSocket", - "LsfStmt", - "Lstat", - "MADV_AUTOSYNC", - "MADV_CAN_REUSE", - "MADV_CORE", - "MADV_DOFORK", - "MADV_DONTFORK", - "MADV_DONTNEED", - "MADV_FREE", - "MADV_FREE_REUSABLE", - "MADV_FREE_REUSE", - "MADV_HUGEPAGE", - "MADV_HWPOISON", - "MADV_MERGEABLE", - "MADV_NOCORE", - "MADV_NOHUGEPAGE", - "MADV_NORMAL", - "MADV_NOSYNC", - "MADV_PROTECT", - "MADV_RANDOM", - "MADV_REMOVE", - "MADV_SEQUENTIAL", - "MADV_SPACEAVAIL", - "MADV_UNMERGEABLE", - "MADV_WILLNEED", - "MADV_ZERO_WIRED_PAGES", - "MAP_32BIT", - "MAP_ALIGNED_SUPER", - "MAP_ALIGNMENT_16MB", - "MAP_ALIGNMENT_1TB", - "MAP_ALIGNMENT_256TB", - "MAP_ALIGNMENT_4GB", - "MAP_ALIGNMENT_64KB", - "MAP_ALIGNMENT_64PB", - "MAP_ALIGNMENT_MASK", - "MAP_ALIGNMENT_SHIFT", - "MAP_ANON", - "MAP_ANONYMOUS", - "MAP_COPY", - "MAP_DENYWRITE", - "MAP_EXECUTABLE", - "MAP_FILE", - "MAP_FIXED", - "MAP_FLAGMASK", - "MAP_GROWSDOWN", - "MAP_HASSEMAPHORE", - "MAP_HUGETLB", - "MAP_INHERIT", - "MAP_INHERIT_COPY", - "MAP_INHERIT_DEFAULT", - "MAP_INHERIT_DONATE_COPY", - "MAP_INHERIT_NONE", - "MAP_INHERIT_SHARE", - "MAP_JIT", - "MAP_LOCKED", - "MAP_NOCACHE", - "MAP_NOCORE", - "MAP_NOEXTEND", - "MAP_NONBLOCK", - "MAP_NORESERVE", - "MAP_NOSYNC", - "MAP_POPULATE", - "MAP_PREFAULT_READ", - "MAP_PRIVATE", - "MAP_RENAME", - "MAP_RESERVED0080", - "MAP_RESERVED0100", - "MAP_SHARED", - "MAP_STACK", - "MAP_TRYFIXED", - "MAP_TYPE", - "MAP_WIRED", - "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", - "MAXLEN_IFDESCR", - "MAXLEN_PHYSADDR", - "MAX_ADAPTER_ADDRESS_LENGTH", - "MAX_ADAPTER_DESCRIPTION_LENGTH", - "MAX_ADAPTER_NAME_LENGTH", - "MAX_COMPUTERNAME_LENGTH", - "MAX_INTERFACE_NAME_LEN", - "MAX_LONG_PATH", - "MAX_PATH", - "MAX_PROTOCOL_CHAIN", - "MCL_CURRENT", - "MCL_FUTURE", - "MNT_DETACH", - "MNT_EXPIRE", - "MNT_FORCE", - "MSG_BCAST", - "MSG_CMSG_CLOEXEC", - "MSG_COMPAT", - "MSG_CONFIRM", - "MSG_CONTROLMBUF", - "MSG_CTRUNC", - "MSG_DONTROUTE", - "MSG_DONTWAIT", - "MSG_EOF", - "MSG_EOR", - "MSG_ERRQUEUE", - "MSG_FASTOPEN", - "MSG_FIN", - "MSG_FLUSH", - "MSG_HAVEMORE", - "MSG_HOLD", - "MSG_IOVUSRSPACE", - "MSG_LENUSRSPACE", - "MSG_MCAST", - "MSG_MORE", - "MSG_NAMEMBUF", - "MSG_NBIO", - "MSG_NEEDSA", - "MSG_NOSIGNAL", - "MSG_NOTIFICATION", - "MSG_OOB", - "MSG_PEEK", - "MSG_PROXY", - "MSG_RCVMORE", - "MSG_RST", - "MSG_SEND", - "MSG_SYN", - "MSG_TRUNC", - "MSG_TRYHARD", - "MSG_USERFLAGS", - "MSG_WAITALL", - "MSG_WAITFORONE", - "MSG_WAITSTREAM", - "MS_ACTIVE", - "MS_ASYNC", - "MS_BIND", - "MS_DEACTIVATE", - "MS_DIRSYNC", - "MS_INVALIDATE", - "MS_I_VERSION", - "MS_KERNMOUNT", - "MS_KILLPAGES", - "MS_MANDLOCK", - "MS_MGC_MSK", - "MS_MGC_VAL", - "MS_MOVE", - "MS_NOATIME", - "MS_NODEV", - "MS_NODIRATIME", - "MS_NOEXEC", - "MS_NOSUID", - "MS_NOUSER", - "MS_POSIXACL", - "MS_PRIVATE", - "MS_RDONLY", - "MS_REC", - "MS_RELATIME", - "MS_REMOUNT", - "MS_RMT_MASK", - "MS_SHARED", - "MS_SILENT", - "MS_SLAVE", - "MS_STRICTATIME", - "MS_SYNC", - "MS_SYNCHRONOUS", - "MS_UNBINDABLE", - "Madvise", - "MapViewOfFile", - "MaxTokenInfoClass", - "Mclpool", - "MibIfRow", - "Mkdir", - "Mkdirat", - "Mkfifo", - "Mknod", - "Mknodat", - "Mlock", - "Mlockall", - "Mmap", - "Mount", - "MoveFile", - "Mprotect", - "Msghdr", - "Munlock", - "Munlockall", - "Munmap", - "MustLoadDLL", - "NAME_MAX", - "NETLINK_ADD_MEMBERSHIP", - "NETLINK_AUDIT", - "NETLINK_BROADCAST_ERROR", - "NETLINK_CONNECTOR", - "NETLINK_DNRTMSG", - "NETLINK_DROP_MEMBERSHIP", - "NETLINK_ECRYPTFS", - "NETLINK_FIB_LOOKUP", - "NETLINK_FIREWALL", - "NETLINK_GENERIC", - "NETLINK_INET_DIAG", - "NETLINK_IP6_FW", - "NETLINK_ISCSI", - "NETLINK_KOBJECT_UEVENT", - "NETLINK_NETFILTER", - "NETLINK_NFLOG", - "NETLINK_NO_ENOBUFS", - "NETLINK_PKTINFO", - "NETLINK_RDMA", - "NETLINK_ROUTE", - "NETLINK_SCSITRANSPORT", - "NETLINK_SELINUX", - "NETLINK_UNUSED", - "NETLINK_USERSOCK", - "NETLINK_XFRM", - "NET_RT_DUMP", - "NET_RT_DUMP2", - "NET_RT_FLAGS", - "NET_RT_IFLIST", - "NET_RT_IFLIST2", - "NET_RT_IFLISTL", - "NET_RT_IFMALIST", - "NET_RT_MAXID", - "NET_RT_OIFLIST", - "NET_RT_OOIFLIST", - "NET_RT_STAT", - "NET_RT_STATS", - "NET_RT_TABLE", - "NET_RT_TRASH", - "NLA_ALIGNTO", - "NLA_F_NESTED", - "NLA_F_NET_BYTEORDER", - "NLA_HDRLEN", - "NLMSG_ALIGNTO", - "NLMSG_DONE", - "NLMSG_ERROR", - "NLMSG_HDRLEN", - "NLMSG_MIN_TYPE", - "NLMSG_NOOP", - "NLMSG_OVERRUN", - "NLM_F_ACK", - "NLM_F_APPEND", - "NLM_F_ATOMIC", - "NLM_F_CREATE", - "NLM_F_DUMP", - "NLM_F_ECHO", - "NLM_F_EXCL", - "NLM_F_MATCH", - "NLM_F_MULTI", - "NLM_F_REPLACE", - "NLM_F_REQUEST", - "NLM_F_ROOT", - "NOFLSH", - "NOTE_ABSOLUTE", - "NOTE_ATTRIB", - "NOTE_CHILD", - "NOTE_DELETE", - "NOTE_EOF", - "NOTE_EXEC", - "NOTE_EXIT", - "NOTE_EXITSTATUS", - "NOTE_EXTEND", - "NOTE_FFAND", - "NOTE_FFCOPY", - "NOTE_FFCTRLMASK", - "NOTE_FFLAGSMASK", - "NOTE_FFNOP", - "NOTE_FFOR", - "NOTE_FORK", - "NOTE_LINK", - "NOTE_LOWAT", - "NOTE_NONE", - "NOTE_NSECONDS", - "NOTE_PCTRLMASK", - "NOTE_PDATAMASK", - "NOTE_REAP", - "NOTE_RENAME", - "NOTE_RESOURCEEND", - "NOTE_REVOKE", - "NOTE_SECONDS", - "NOTE_SIGNAL", - "NOTE_TRACK", - "NOTE_TRACKERR", - "NOTE_TRIGGER", - "NOTE_TRUNCATE", - "NOTE_USECONDS", - "NOTE_VM_ERROR", - "NOTE_VM_PRESSURE", - "NOTE_VM_PRESSURE_SUDDEN_TERMINATE", - "NOTE_VM_PRESSURE_TERMINATE", - "NOTE_WRITE", - "NameCanonical", - "NameCanonicalEx", - "NameDisplay", - "NameDnsDomain", - "NameFullyQualifiedDN", - "NameSamCompatible", - "NameServicePrincipal", - "NameUniqueId", - "NameUnknown", - "NameUserPrincipal", - "Nanosleep", - "NetApiBufferFree", - "NetGetJoinInformation", - "NetSetupDomainName", - "NetSetupUnjoined", - "NetSetupUnknownStatus", - "NetSetupWorkgroupName", - "NetUserGetInfo", - "NetlinkMessage", - "NetlinkRIB", - "NetlinkRouteAttr", - "NetlinkRouteRequest", - "NewCallback", - "NewCallbackCDecl", - "NewLazyDLL", - "NlAttr", - "NlMsgerr", - "NlMsghdr", - "NsecToFiletime", - "NsecToTimespec", - "NsecToTimeval", - "Ntohs", - "OCRNL", - "OFDEL", - "OFILL", - "OFIOGETBMAP", - "OID_PKIX_KP_SERVER_AUTH", - "OID_SERVER_GATED_CRYPTO", - "OID_SGC_NETSCAPE", - "OLCUC", - "ONLCR", - "ONLRET", - "ONOCR", - "ONOEOT", - "OPEN_ALWAYS", - "OPEN_EXISTING", - "OPOST", - "O_ACCMODE", - "O_ALERT", - "O_ALT_IO", - "O_APPEND", - "O_ASYNC", - "O_CLOEXEC", - "O_CREAT", - "O_DIRECT", - "O_DIRECTORY", - "O_DSYNC", - "O_EVTONLY", - "O_EXCL", - "O_EXEC", - "O_EXLOCK", - "O_FSYNC", - "O_LARGEFILE", - "O_NDELAY", - "O_NOATIME", - "O_NOCTTY", - "O_NOFOLLOW", - "O_NONBLOCK", - "O_NOSIGPIPE", - "O_POPUP", - "O_RDONLY", - "O_RDWR", - "O_RSYNC", - "O_SHLOCK", - "O_SYMLINK", - "O_SYNC", - "O_TRUNC", - "O_TTY_INIT", - "O_WRONLY", - "Open", - "OpenCurrentProcessToken", - "OpenProcess", - "OpenProcessToken", - "Openat", - "Overlapped", - "PACKET_ADD_MEMBERSHIP", - "PACKET_BROADCAST", - "PACKET_DROP_MEMBERSHIP", - "PACKET_FASTROUTE", - "PACKET_HOST", - "PACKET_LOOPBACK", - "PACKET_MR_ALLMULTI", - "PACKET_MR_MULTICAST", - "PACKET_MR_PROMISC", - "PACKET_MULTICAST", - "PACKET_OTHERHOST", - "PACKET_OUTGOING", - "PACKET_RECV_OUTPUT", - "PACKET_RX_RING", - "PACKET_STATISTICS", - "PAGE_EXECUTE_READ", - "PAGE_EXECUTE_READWRITE", - "PAGE_EXECUTE_WRITECOPY", - "PAGE_READONLY", - "PAGE_READWRITE", - "PAGE_WRITECOPY", - "PARENB", - "PARMRK", - "PARODD", - "PENDIN", - "PFL_HIDDEN", - "PFL_MATCHES_PROTOCOL_ZERO", - "PFL_MULTIPLE_PROTO_ENTRIES", - "PFL_NETWORKDIRECT_PROVIDER", - "PFL_RECOMMENDED_PROTO_ENTRY", - "PF_FLUSH", - "PKCS_7_ASN_ENCODING", - "PMC5_PIPELINE_FLUSH", - "PRIO_PGRP", - "PRIO_PROCESS", - "PRIO_USER", - "PRI_IOFLUSH", - "PROCESS_QUERY_INFORMATION", - "PROCESS_TERMINATE", - "PROT_EXEC", - "PROT_GROWSDOWN", - "PROT_GROWSUP", - "PROT_NONE", - "PROT_READ", - "PROT_WRITE", - "PROV_DH_SCHANNEL", - "PROV_DSS", - "PROV_DSS_DH", - "PROV_EC_ECDSA_FULL", - "PROV_EC_ECDSA_SIG", - "PROV_EC_ECNRA_FULL", - "PROV_EC_ECNRA_SIG", - "PROV_FORTEZZA", - "PROV_INTEL_SEC", - "PROV_MS_EXCHANGE", - "PROV_REPLACE_OWF", - "PROV_RNG", - "PROV_RSA_AES", - "PROV_RSA_FULL", - "PROV_RSA_SCHANNEL", - "PROV_RSA_SIG", - "PROV_SPYRUS_LYNKS", - "PROV_SSL", - "PR_CAPBSET_DROP", - "PR_CAPBSET_READ", - "PR_CLEAR_SECCOMP_FILTER", - "PR_ENDIAN_BIG", - "PR_ENDIAN_LITTLE", - "PR_ENDIAN_PPC_LITTLE", - "PR_FPEMU_NOPRINT", - "PR_FPEMU_SIGFPE", - "PR_FP_EXC_ASYNC", - "PR_FP_EXC_DISABLED", - "PR_FP_EXC_DIV", - "PR_FP_EXC_INV", - "PR_FP_EXC_NONRECOV", - "PR_FP_EXC_OVF", - "PR_FP_EXC_PRECISE", - "PR_FP_EXC_RES", - "PR_FP_EXC_SW_ENABLE", - "PR_FP_EXC_UND", - "PR_GET_DUMPABLE", - "PR_GET_ENDIAN", - "PR_GET_FPEMU", - "PR_GET_FPEXC", - "PR_GET_KEEPCAPS", - "PR_GET_NAME", - "PR_GET_PDEATHSIG", - "PR_GET_SECCOMP", - "PR_GET_SECCOMP_FILTER", - "PR_GET_SECUREBITS", - "PR_GET_TIMERSLACK", - "PR_GET_TIMING", - "PR_GET_TSC", - "PR_GET_UNALIGN", - "PR_MCE_KILL", - "PR_MCE_KILL_CLEAR", - "PR_MCE_KILL_DEFAULT", - "PR_MCE_KILL_EARLY", - "PR_MCE_KILL_GET", - "PR_MCE_KILL_LATE", - "PR_MCE_KILL_SET", - "PR_SECCOMP_FILTER_EVENT", - "PR_SECCOMP_FILTER_SYSCALL", - "PR_SET_DUMPABLE", - "PR_SET_ENDIAN", - "PR_SET_FPEMU", - "PR_SET_FPEXC", - "PR_SET_KEEPCAPS", - "PR_SET_NAME", - "PR_SET_PDEATHSIG", - "PR_SET_PTRACER", - "PR_SET_SECCOMP", - "PR_SET_SECCOMP_FILTER", - "PR_SET_SECUREBITS", - "PR_SET_TIMERSLACK", - "PR_SET_TIMING", - "PR_SET_TSC", - "PR_SET_UNALIGN", - "PR_TASK_PERF_EVENTS_DISABLE", - "PR_TASK_PERF_EVENTS_ENABLE", - "PR_TIMING_STATISTICAL", - "PR_TIMING_TIMESTAMP", - "PR_TSC_ENABLE", - "PR_TSC_SIGSEGV", - "PR_UNALIGN_NOPRINT", - "PR_UNALIGN_SIGBUS", - "PTRACE_ARCH_PRCTL", - "PTRACE_ATTACH", - "PTRACE_CONT", - "PTRACE_DETACH", - "PTRACE_EVENT_CLONE", - "PTRACE_EVENT_EXEC", - "PTRACE_EVENT_EXIT", - "PTRACE_EVENT_FORK", - "PTRACE_EVENT_VFORK", - "PTRACE_EVENT_VFORK_DONE", - "PTRACE_GETCRUNCHREGS", - "PTRACE_GETEVENTMSG", - "PTRACE_GETFPREGS", - "PTRACE_GETFPXREGS", - "PTRACE_GETHBPREGS", - "PTRACE_GETREGS", - "PTRACE_GETREGSET", - "PTRACE_GETSIGINFO", - "PTRACE_GETVFPREGS", - "PTRACE_GETWMMXREGS", - "PTRACE_GET_THREAD_AREA", - "PTRACE_KILL", - "PTRACE_OLDSETOPTIONS", - "PTRACE_O_MASK", - "PTRACE_O_TRACECLONE", - "PTRACE_O_TRACEEXEC", - "PTRACE_O_TRACEEXIT", - "PTRACE_O_TRACEFORK", - "PTRACE_O_TRACESYSGOOD", - "PTRACE_O_TRACEVFORK", - "PTRACE_O_TRACEVFORKDONE", - "PTRACE_PEEKDATA", - "PTRACE_PEEKTEXT", - "PTRACE_PEEKUSR", - "PTRACE_POKEDATA", - "PTRACE_POKETEXT", - "PTRACE_POKEUSR", - "PTRACE_SETCRUNCHREGS", - "PTRACE_SETFPREGS", - "PTRACE_SETFPXREGS", - "PTRACE_SETHBPREGS", - "PTRACE_SETOPTIONS", - "PTRACE_SETREGS", - "PTRACE_SETREGSET", - "PTRACE_SETSIGINFO", - "PTRACE_SETVFPREGS", - "PTRACE_SETWMMXREGS", - "PTRACE_SET_SYSCALL", - "PTRACE_SET_THREAD_AREA", - "PTRACE_SINGLEBLOCK", - "PTRACE_SINGLESTEP", - "PTRACE_SYSCALL", - "PTRACE_SYSEMU", - "PTRACE_SYSEMU_SINGLESTEP", - "PTRACE_TRACEME", - "PT_ATTACH", - "PT_ATTACHEXC", - "PT_CONTINUE", - "PT_DATA_ADDR", - "PT_DENY_ATTACH", - "PT_DETACH", - "PT_FIRSTMACH", - "PT_FORCEQUOTA", - "PT_KILL", - "PT_MASK", - "PT_READ_D", - "PT_READ_I", - "PT_READ_U", - "PT_SIGEXC", - "PT_STEP", - "PT_TEXT_ADDR", - "PT_TEXT_END_ADDR", - "PT_THUPDATE", - "PT_TRACE_ME", - "PT_WRITE_D", - "PT_WRITE_I", - "PT_WRITE_U", - "ParseDirent", - "ParseNetlinkMessage", - "ParseNetlinkRouteAttr", - "ParseRoutingMessage", - "ParseRoutingSockaddr", - "ParseSocketControlMessage", - "ParseUnixCredentials", - "ParseUnixRights", - "PathMax", - "Pathconf", - "Pause", - "Pipe", - "Pipe2", - "PivotRoot", - "Pointer", - "PostQueuedCompletionStatus", - "Pread", - "Proc", - "ProcAttr", - "Process32First", - "Process32Next", - "ProcessEntry32", - "ProcessInformation", - "Protoent", - "PtraceAttach", - "PtraceCont", - "PtraceDetach", - "PtraceGetEventMsg", - "PtraceGetRegs", - "PtracePeekData", - "PtracePeekText", - "PtracePokeData", - "PtracePokeText", - "PtraceRegs", - "PtraceSetOptions", - "PtraceSetRegs", - "PtraceSingleStep", - "PtraceSyscall", - "Pwrite", - "REG_BINARY", - "REG_DWORD", - "REG_DWORD_BIG_ENDIAN", - "REG_DWORD_LITTLE_ENDIAN", - "REG_EXPAND_SZ", - "REG_FULL_RESOURCE_DESCRIPTOR", - "REG_LINK", - "REG_MULTI_SZ", - "REG_NONE", - "REG_QWORD", - "REG_QWORD_LITTLE_ENDIAN", - "REG_RESOURCE_LIST", - "REG_RESOURCE_REQUIREMENTS_LIST", - "REG_SZ", - "RLIMIT_AS", - "RLIMIT_CORE", - "RLIMIT_CPU", - "RLIMIT_DATA", - "RLIMIT_FSIZE", - "RLIMIT_NOFILE", - "RLIMIT_STACK", - "RLIM_INFINITY", - "RTAX_ADVMSS", - "RTAX_AUTHOR", - "RTAX_BRD", - "RTAX_CWND", - "RTAX_DST", - "RTAX_FEATURES", - "RTAX_FEATURE_ALLFRAG", - "RTAX_FEATURE_ECN", - "RTAX_FEATURE_SACK", - "RTAX_FEATURE_TIMESTAMP", - "RTAX_GATEWAY", - "RTAX_GENMASK", - "RTAX_HOPLIMIT", - "RTAX_IFA", - "RTAX_IFP", - "RTAX_INITCWND", - "RTAX_INITRWND", - "RTAX_LABEL", - "RTAX_LOCK", - "RTAX_MAX", - "RTAX_MTU", - "RTAX_NETMASK", - "RTAX_REORDERING", - "RTAX_RTO_MIN", - "RTAX_RTT", - "RTAX_RTTVAR", - "RTAX_SRC", - "RTAX_SRCMASK", - "RTAX_SSTHRESH", - "RTAX_TAG", - "RTAX_UNSPEC", - "RTAX_WINDOW", - "RTA_ALIGNTO", - "RTA_AUTHOR", - "RTA_BRD", - "RTA_CACHEINFO", - "RTA_DST", - "RTA_FLOW", - "RTA_GATEWAY", - "RTA_GENMASK", - "RTA_IFA", - "RTA_IFP", - "RTA_IIF", - "RTA_LABEL", - "RTA_MAX", - "RTA_METRICS", - "RTA_MULTIPATH", - "RTA_NETMASK", - "RTA_OIF", - "RTA_PREFSRC", - "RTA_PRIORITY", - "RTA_SRC", - "RTA_SRCMASK", - "RTA_TABLE", - "RTA_TAG", - "RTA_UNSPEC", - "RTCF_DIRECTSRC", - "RTCF_DOREDIRECT", - "RTCF_LOG", - "RTCF_MASQ", - "RTCF_NAT", - "RTCF_VALVE", - "RTF_ADDRCLASSMASK", - "RTF_ADDRCONF", - "RTF_ALLONLINK", - "RTF_ANNOUNCE", - "RTF_BLACKHOLE", - "RTF_BROADCAST", - "RTF_CACHE", - "RTF_CLONED", - "RTF_CLONING", - "RTF_CONDEMNED", - "RTF_DEFAULT", - "RTF_DELCLONE", - "RTF_DONE", - "RTF_DYNAMIC", - "RTF_FLOW", - "RTF_FMASK", - "RTF_GATEWAY", - "RTF_GWFLAG_COMPAT", - "RTF_HOST", - "RTF_IFREF", - "RTF_IFSCOPE", - "RTF_INTERFACE", - "RTF_IRTT", - "RTF_LINKRT", - "RTF_LLDATA", - "RTF_LLINFO", - "RTF_LOCAL", - "RTF_MASK", - "RTF_MODIFIED", - "RTF_MPATH", - "RTF_MPLS", - "RTF_MSS", - "RTF_MTU", - "RTF_MULTICAST", - "RTF_NAT", - "RTF_NOFORWARD", - "RTF_NONEXTHOP", - "RTF_NOPMTUDISC", - "RTF_PERMANENT_ARP", - "RTF_PINNED", - "RTF_POLICY", - "RTF_PRCLONING", - "RTF_PROTO1", - "RTF_PROTO2", - "RTF_PROTO3", - "RTF_REINSTATE", - "RTF_REJECT", - "RTF_RNH_LOCKED", - "RTF_SOURCE", - "RTF_SRC", - "RTF_STATIC", - "RTF_STICKY", - "RTF_THROW", - "RTF_TUNNEL", - "RTF_UP", - "RTF_USETRAILERS", - "RTF_WASCLONED", - "RTF_WINDOW", - "RTF_XRESOLVE", - "RTM_ADD", - "RTM_BASE", - "RTM_CHANGE", - "RTM_CHGADDR", - "RTM_DELACTION", - "RTM_DELADDR", - "RTM_DELADDRLABEL", - "RTM_DELETE", - "RTM_DELLINK", - "RTM_DELMADDR", - "RTM_DELNEIGH", - "RTM_DELQDISC", - "RTM_DELROUTE", - "RTM_DELRULE", - "RTM_DELTCLASS", - "RTM_DELTFILTER", - "RTM_DESYNC", - "RTM_F_CLONED", - "RTM_F_EQUALIZE", - "RTM_F_NOTIFY", - "RTM_F_PREFIX", - "RTM_GET", - "RTM_GET2", - "RTM_GETACTION", - "RTM_GETADDR", - "RTM_GETADDRLABEL", - "RTM_GETANYCAST", - "RTM_GETDCB", - "RTM_GETLINK", - "RTM_GETMULTICAST", - "RTM_GETNEIGH", - "RTM_GETNEIGHTBL", - "RTM_GETQDISC", - "RTM_GETROUTE", - "RTM_GETRULE", - "RTM_GETTCLASS", - "RTM_GETTFILTER", - "RTM_IEEE80211", - "RTM_IFANNOUNCE", - "RTM_IFINFO", - "RTM_IFINFO2", - "RTM_LLINFO_UPD", - "RTM_LOCK", - "RTM_LOSING", - "RTM_MAX", - "RTM_MAXSIZE", - "RTM_MISS", - "RTM_NEWACTION", - "RTM_NEWADDR", - "RTM_NEWADDRLABEL", - "RTM_NEWLINK", - "RTM_NEWMADDR", - "RTM_NEWMADDR2", - "RTM_NEWNDUSEROPT", - "RTM_NEWNEIGH", - "RTM_NEWNEIGHTBL", - "RTM_NEWPREFIX", - "RTM_NEWQDISC", - "RTM_NEWROUTE", - "RTM_NEWRULE", - "RTM_NEWTCLASS", - "RTM_NEWTFILTER", - "RTM_NR_FAMILIES", - "RTM_NR_MSGTYPES", - "RTM_OIFINFO", - "RTM_OLDADD", - "RTM_OLDDEL", - "RTM_OOIFINFO", - "RTM_REDIRECT", - "RTM_RESOLVE", - "RTM_RTTUNIT", - "RTM_SETDCB", - "RTM_SETGATE", - "RTM_SETLINK", - "RTM_SETNEIGHTBL", - "RTM_VERSION", - "RTNH_ALIGNTO", - "RTNH_F_DEAD", - "RTNH_F_ONLINK", - "RTNH_F_PERVASIVE", - "RTNLGRP_IPV4_IFADDR", - "RTNLGRP_IPV4_MROUTE", - "RTNLGRP_IPV4_ROUTE", - "RTNLGRP_IPV4_RULE", - "RTNLGRP_IPV6_IFADDR", - "RTNLGRP_IPV6_IFINFO", - "RTNLGRP_IPV6_MROUTE", - "RTNLGRP_IPV6_PREFIX", - "RTNLGRP_IPV6_ROUTE", - "RTNLGRP_IPV6_RULE", - "RTNLGRP_LINK", - "RTNLGRP_ND_USEROPT", - "RTNLGRP_NEIGH", - "RTNLGRP_NONE", - "RTNLGRP_NOTIFY", - "RTNLGRP_TC", - "RTN_ANYCAST", - "RTN_BLACKHOLE", - "RTN_BROADCAST", - "RTN_LOCAL", - "RTN_MAX", - "RTN_MULTICAST", - "RTN_NAT", - "RTN_PROHIBIT", - "RTN_THROW", - "RTN_UNICAST", - "RTN_UNREACHABLE", - "RTN_UNSPEC", - "RTN_XRESOLVE", - "RTPROT_BIRD", - "RTPROT_BOOT", - "RTPROT_DHCP", - "RTPROT_DNROUTED", - "RTPROT_GATED", - "RTPROT_KERNEL", - "RTPROT_MRT", - "RTPROT_NTK", - "RTPROT_RA", - "RTPROT_REDIRECT", - "RTPROT_STATIC", - "RTPROT_UNSPEC", - "RTPROT_XORP", - "RTPROT_ZEBRA", - "RTV_EXPIRE", - "RTV_HOPCOUNT", - "RTV_MTU", - "RTV_RPIPE", - "RTV_RTT", - "RTV_RTTVAR", - "RTV_SPIPE", - "RTV_SSTHRESH", - "RTV_WEIGHT", - "RT_CACHING_CONTEXT", - "RT_CLASS_DEFAULT", - "RT_CLASS_LOCAL", - "RT_CLASS_MAIN", - "RT_CLASS_MAX", - "RT_CLASS_UNSPEC", - "RT_DEFAULT_FIB", - "RT_NORTREF", - "RT_SCOPE_HOST", - "RT_SCOPE_LINK", - "RT_SCOPE_NOWHERE", - "RT_SCOPE_SITE", - "RT_SCOPE_UNIVERSE", - "RT_TABLEID_MAX", - "RT_TABLE_COMPAT", - "RT_TABLE_DEFAULT", - "RT_TABLE_LOCAL", - "RT_TABLE_MAIN", - "RT_TABLE_MAX", - "RT_TABLE_UNSPEC", - "RUSAGE_CHILDREN", - "RUSAGE_SELF", - "RUSAGE_THREAD", - "Radvisory_t", - "RawConn", - "RawSockaddr", - "RawSockaddrAny", - "RawSockaddrDatalink", - "RawSockaddrInet4", - "RawSockaddrInet6", - "RawSockaddrLinklayer", - "RawSockaddrNetlink", - "RawSockaddrUnix", - "RawSyscall", - "RawSyscall6", - "Read", - "ReadConsole", - "ReadDirectoryChanges", - "ReadDirent", - "ReadFile", - "Readlink", - "Reboot", - "Recvfrom", - "Recvmsg", - "RegCloseKey", - "RegEnumKeyEx", - "RegOpenKeyEx", - "RegQueryInfoKey", - "RegQueryValueEx", - "RemoveDirectory", - "Removexattr", - "Rename", - "Renameat", - "Revoke", - "Rlimit", - "Rmdir", - "RouteMessage", - "RouteRIB", - "RoutingMessage", - "RtAttr", - "RtGenmsg", - "RtMetrics", - "RtMsg", - "RtMsghdr", - "RtNexthop", - "Rusage", - "SCM_BINTIME", - "SCM_CREDENTIALS", - "SCM_CREDS", - "SCM_RIGHTS", - "SCM_TIMESTAMP", - "SCM_TIMESTAMPING", - "SCM_TIMESTAMPNS", - "SCM_TIMESTAMP_MONOTONIC", - "SHUT_RD", - "SHUT_RDWR", - "SHUT_WR", - "SID", - "SIDAndAttributes", - "SIGABRT", - "SIGALRM", - "SIGBUS", - "SIGCHLD", - "SIGCLD", - "SIGCONT", - "SIGEMT", - "SIGFPE", - "SIGHUP", - "SIGILL", - "SIGINFO", - "SIGINT", - "SIGIO", - "SIGIOT", - "SIGKILL", - "SIGLIBRT", - "SIGLWP", - "SIGPIPE", - "SIGPOLL", - "SIGPROF", - "SIGPWR", - "SIGQUIT", - "SIGSEGV", - "SIGSTKFLT", - "SIGSTOP", - "SIGSYS", - "SIGTERM", - "SIGTHR", - "SIGTRAP", - "SIGTSTP", - "SIGTTIN", - "SIGTTOU", - "SIGUNUSED", - "SIGURG", - "SIGUSR1", - "SIGUSR2", - "SIGVTALRM", - "SIGWINCH", - "SIGXCPU", - "SIGXFSZ", - "SIOCADDDLCI", - "SIOCADDMULTI", - "SIOCADDRT", - "SIOCAIFADDR", - "SIOCAIFGROUP", - "SIOCALIFADDR", - "SIOCARPIPLL", - "SIOCATMARK", - "SIOCAUTOADDR", - "SIOCAUTONETMASK", - "SIOCBRDGADD", - "SIOCBRDGADDS", - "SIOCBRDGARL", - "SIOCBRDGDADDR", - "SIOCBRDGDEL", - "SIOCBRDGDELS", - "SIOCBRDGFLUSH", - "SIOCBRDGFRL", - "SIOCBRDGGCACHE", - "SIOCBRDGGFD", - "SIOCBRDGGHT", - "SIOCBRDGGIFFLGS", - "SIOCBRDGGMA", - "SIOCBRDGGPARAM", - "SIOCBRDGGPRI", - "SIOCBRDGGRL", - "SIOCBRDGGSIFS", - "SIOCBRDGGTO", - "SIOCBRDGIFS", - "SIOCBRDGRTS", - "SIOCBRDGSADDR", - "SIOCBRDGSCACHE", - "SIOCBRDGSFD", - "SIOCBRDGSHT", - "SIOCBRDGSIFCOST", - "SIOCBRDGSIFFLGS", - "SIOCBRDGSIFPRIO", - "SIOCBRDGSMA", - "SIOCBRDGSPRI", - "SIOCBRDGSPROTO", - "SIOCBRDGSTO", - "SIOCBRDGSTXHC", - "SIOCDARP", - "SIOCDELDLCI", - "SIOCDELMULTI", - "SIOCDELRT", - "SIOCDEVPRIVATE", - "SIOCDIFADDR", - "SIOCDIFGROUP", - "SIOCDIFPHYADDR", - "SIOCDLIFADDR", - "SIOCDRARP", - "SIOCGARP", - "SIOCGDRVSPEC", - "SIOCGETKALIVE", - "SIOCGETLABEL", - "SIOCGETPFLOW", - "SIOCGETPFSYNC", - "SIOCGETSGCNT", - "SIOCGETVIFCNT", - "SIOCGETVLAN", - "SIOCGHIWAT", - "SIOCGIFADDR", - "SIOCGIFADDRPREF", - "SIOCGIFALIAS", - "SIOCGIFALTMTU", - "SIOCGIFASYNCMAP", - "SIOCGIFBOND", - "SIOCGIFBR", - "SIOCGIFBRDADDR", - "SIOCGIFCAP", - "SIOCGIFCONF", - "SIOCGIFCOUNT", - "SIOCGIFDATA", - "SIOCGIFDESCR", - "SIOCGIFDEVMTU", - "SIOCGIFDLT", - "SIOCGIFDSTADDR", - "SIOCGIFENCAP", - "SIOCGIFFIB", - "SIOCGIFFLAGS", - "SIOCGIFGATTR", - "SIOCGIFGENERIC", - "SIOCGIFGMEMB", - "SIOCGIFGROUP", - "SIOCGIFHARDMTU", - "SIOCGIFHWADDR", - "SIOCGIFINDEX", - "SIOCGIFKPI", - "SIOCGIFMAC", - "SIOCGIFMAP", - "SIOCGIFMEDIA", - "SIOCGIFMEM", - "SIOCGIFMETRIC", - "SIOCGIFMTU", - "SIOCGIFNAME", - "SIOCGIFNETMASK", - "SIOCGIFPDSTADDR", - "SIOCGIFPFLAGS", - "SIOCGIFPHYS", - "SIOCGIFPRIORITY", - "SIOCGIFPSRCADDR", - "SIOCGIFRDOMAIN", - "SIOCGIFRTLABEL", - "SIOCGIFSLAVE", - "SIOCGIFSTATUS", - "SIOCGIFTIMESLOT", - "SIOCGIFTXQLEN", - "SIOCGIFVLAN", - "SIOCGIFWAKEFLAGS", - "SIOCGIFXFLAGS", - "SIOCGLIFADDR", - "SIOCGLIFPHYADDR", - "SIOCGLIFPHYRTABLE", - "SIOCGLIFPHYTTL", - "SIOCGLINKSTR", - "SIOCGLOWAT", - "SIOCGPGRP", - "SIOCGPRIVATE_0", - "SIOCGPRIVATE_1", - "SIOCGRARP", - "SIOCGSPPPPARAMS", - "SIOCGSTAMP", - "SIOCGSTAMPNS", - "SIOCGVH", - "SIOCGVNETID", - "SIOCIFCREATE", - "SIOCIFCREATE2", - "SIOCIFDESTROY", - "SIOCIFGCLONERS", - "SIOCINITIFADDR", - "SIOCPROTOPRIVATE", - "SIOCRSLVMULTI", - "SIOCRTMSG", - "SIOCSARP", - "SIOCSDRVSPEC", - "SIOCSETKALIVE", - "SIOCSETLABEL", - "SIOCSETPFLOW", - "SIOCSETPFSYNC", - "SIOCSETVLAN", - "SIOCSHIWAT", - "SIOCSIFADDR", - "SIOCSIFADDRPREF", - "SIOCSIFALTMTU", - "SIOCSIFASYNCMAP", - "SIOCSIFBOND", - "SIOCSIFBR", - "SIOCSIFBRDADDR", - "SIOCSIFCAP", - "SIOCSIFDESCR", - "SIOCSIFDSTADDR", - "SIOCSIFENCAP", - "SIOCSIFFIB", - "SIOCSIFFLAGS", - "SIOCSIFGATTR", - "SIOCSIFGENERIC", - "SIOCSIFHWADDR", - "SIOCSIFHWBROADCAST", - "SIOCSIFKPI", - "SIOCSIFLINK", - "SIOCSIFLLADDR", - "SIOCSIFMAC", - "SIOCSIFMAP", - "SIOCSIFMEDIA", - "SIOCSIFMEM", - "SIOCSIFMETRIC", - "SIOCSIFMTU", - "SIOCSIFNAME", - "SIOCSIFNETMASK", - "SIOCSIFPFLAGS", - "SIOCSIFPHYADDR", - "SIOCSIFPHYS", - "SIOCSIFPRIORITY", - "SIOCSIFRDOMAIN", - "SIOCSIFRTLABEL", - "SIOCSIFRVNET", - "SIOCSIFSLAVE", - "SIOCSIFTIMESLOT", - "SIOCSIFTXQLEN", - "SIOCSIFVLAN", - "SIOCSIFVNET", - "SIOCSIFXFLAGS", - "SIOCSLIFPHYADDR", - "SIOCSLIFPHYRTABLE", - "SIOCSLIFPHYTTL", - "SIOCSLINKSTR", - "SIOCSLOWAT", - "SIOCSPGRP", - "SIOCSRARP", - "SIOCSSPPPPARAMS", - "SIOCSVH", - "SIOCSVNETID", - "SIOCZIFDATA", - "SIO_GET_EXTENSION_FUNCTION_POINTER", - "SIO_GET_INTERFACE_LIST", - "SIO_KEEPALIVE_VALS", - "SIO_UDP_CONNRESET", - "SOCK_CLOEXEC", - "SOCK_DCCP", - "SOCK_DGRAM", - "SOCK_FLAGS_MASK", - "SOCK_MAXADDRLEN", - "SOCK_NONBLOCK", - "SOCK_NOSIGPIPE", - "SOCK_PACKET", - "SOCK_RAW", - "SOCK_RDM", - "SOCK_SEQPACKET", - "SOCK_STREAM", - "SOL_AAL", - "SOL_ATM", - "SOL_DECNET", - "SOL_ICMPV6", - "SOL_IP", - "SOL_IPV6", - "SOL_IRDA", - "SOL_PACKET", - "SOL_RAW", - "SOL_SOCKET", - "SOL_TCP", - "SOL_X25", - "SOMAXCONN", - "SO_ACCEPTCONN", - "SO_ACCEPTFILTER", - "SO_ATTACH_FILTER", - "SO_BINDANY", - "SO_BINDTODEVICE", - "SO_BINTIME", - "SO_BROADCAST", - "SO_BSDCOMPAT", - "SO_DEBUG", - "SO_DETACH_FILTER", - "SO_DOMAIN", - "SO_DONTROUTE", - "SO_DONTTRUNC", - "SO_ERROR", - "SO_KEEPALIVE", - "SO_LABEL", - "SO_LINGER", - "SO_LINGER_SEC", - "SO_LISTENINCQLEN", - "SO_LISTENQLEN", - "SO_LISTENQLIMIT", - "SO_MARK", - "SO_NETPROC", - "SO_NKE", - "SO_NOADDRERR", - "SO_NOHEADER", - "SO_NOSIGPIPE", - "SO_NOTIFYCONFLICT", - "SO_NO_CHECK", - "SO_NO_DDP", - "SO_NO_OFFLOAD", - "SO_NP_EXTENSIONS", - "SO_NREAD", - "SO_NWRITE", - "SO_OOBINLINE", - "SO_OVERFLOWED", - "SO_PASSCRED", - "SO_PASSSEC", - "SO_PEERCRED", - "SO_PEERLABEL", - "SO_PEERNAME", - "SO_PEERSEC", - "SO_PRIORITY", - "SO_PROTOCOL", - "SO_PROTOTYPE", - "SO_RANDOMPORT", - "SO_RCVBUF", - "SO_RCVBUFFORCE", - "SO_RCVLOWAT", - "SO_RCVTIMEO", - "SO_RESTRICTIONS", - "SO_RESTRICT_DENYIN", - "SO_RESTRICT_DENYOUT", - "SO_RESTRICT_DENYSET", - "SO_REUSEADDR", - "SO_REUSEPORT", - "SO_REUSESHAREUID", - "SO_RTABLE", - "SO_RXQ_OVFL", - "SO_SECURITY_AUTHENTICATION", - "SO_SECURITY_ENCRYPTION_NETWORK", - "SO_SECURITY_ENCRYPTION_TRANSPORT", - "SO_SETFIB", - "SO_SNDBUF", - "SO_SNDBUFFORCE", - "SO_SNDLOWAT", - "SO_SNDTIMEO", - "SO_SPLICE", - "SO_TIMESTAMP", - "SO_TIMESTAMPING", - "SO_TIMESTAMPNS", - "SO_TIMESTAMP_MONOTONIC", - "SO_TYPE", - "SO_UPCALLCLOSEWAIT", - "SO_UPDATE_ACCEPT_CONTEXT", - "SO_UPDATE_CONNECT_CONTEXT", - "SO_USELOOPBACK", - "SO_USER_COOKIE", - "SO_VENDOR", - "SO_WANTMORE", - "SO_WANTOOBFLAG", - "SSLExtraCertChainPolicyPara", - "STANDARD_RIGHTS_ALL", - "STANDARD_RIGHTS_EXECUTE", - "STANDARD_RIGHTS_READ", - "STANDARD_RIGHTS_REQUIRED", - "STANDARD_RIGHTS_WRITE", - "STARTF_USESHOWWINDOW", - "STARTF_USESTDHANDLES", - "STD_ERROR_HANDLE", - "STD_INPUT_HANDLE", - "STD_OUTPUT_HANDLE", - "SUBLANG_ENGLISH_US", - "SW_FORCEMINIMIZE", - "SW_HIDE", - "SW_MAXIMIZE", - "SW_MINIMIZE", - "SW_NORMAL", - "SW_RESTORE", - "SW_SHOW", - "SW_SHOWDEFAULT", - "SW_SHOWMAXIMIZED", - "SW_SHOWMINIMIZED", - "SW_SHOWMINNOACTIVE", - "SW_SHOWNA", - "SW_SHOWNOACTIVATE", - "SW_SHOWNORMAL", - "SYMBOLIC_LINK_FLAG_DIRECTORY", - "SYNCHRONIZE", - "SYSCTL_VERSION", - "SYSCTL_VERS_0", - "SYSCTL_VERS_1", - "SYSCTL_VERS_MASK", - "SYS_ABORT2", - "SYS_ACCEPT", - "SYS_ACCEPT4", - "SYS_ACCEPT_NOCANCEL", - "SYS_ACCESS", - "SYS_ACCESS_EXTENDED", - "SYS_ACCT", - "SYS_ADD_KEY", - "SYS_ADD_PROFIL", - "SYS_ADJFREQ", - "SYS_ADJTIME", - "SYS_ADJTIMEX", - "SYS_AFS_SYSCALL", - "SYS_AIO_CANCEL", - "SYS_AIO_ERROR", - "SYS_AIO_FSYNC", - "SYS_AIO_READ", - "SYS_AIO_RETURN", - "SYS_AIO_SUSPEND", - "SYS_AIO_SUSPEND_NOCANCEL", - "SYS_AIO_WRITE", - "SYS_ALARM", - "SYS_ARCH_PRCTL", - "SYS_ARM_FADVISE64_64", - "SYS_ARM_SYNC_FILE_RANGE", - "SYS_ATGETMSG", - "SYS_ATPGETREQ", - "SYS_ATPGETRSP", - "SYS_ATPSNDREQ", - "SYS_ATPSNDRSP", - "SYS_ATPUTMSG", - "SYS_ATSOCKET", - "SYS_AUDIT", - "SYS_AUDITCTL", - "SYS_AUDITON", - "SYS_AUDIT_SESSION_JOIN", - "SYS_AUDIT_SESSION_PORT", - "SYS_AUDIT_SESSION_SELF", - "SYS_BDFLUSH", - "SYS_BIND", - "SYS_BINDAT", - "SYS_BREAK", - "SYS_BRK", - "SYS_BSDTHREAD_CREATE", - "SYS_BSDTHREAD_REGISTER", - "SYS_BSDTHREAD_TERMINATE", - "SYS_CAPGET", - "SYS_CAPSET", - "SYS_CAP_ENTER", - "SYS_CAP_FCNTLS_GET", - "SYS_CAP_FCNTLS_LIMIT", - "SYS_CAP_GETMODE", - "SYS_CAP_GETRIGHTS", - "SYS_CAP_IOCTLS_GET", - "SYS_CAP_IOCTLS_LIMIT", - "SYS_CAP_NEW", - "SYS_CAP_RIGHTS_GET", - "SYS_CAP_RIGHTS_LIMIT", - "SYS_CHDIR", - "SYS_CHFLAGS", - "SYS_CHFLAGSAT", - "SYS_CHMOD", - "SYS_CHMOD_EXTENDED", - "SYS_CHOWN", - "SYS_CHOWN32", - "SYS_CHROOT", - "SYS_CHUD", - "SYS_CLOCK_ADJTIME", - "SYS_CLOCK_GETCPUCLOCKID2", - "SYS_CLOCK_GETRES", - "SYS_CLOCK_GETTIME", - "SYS_CLOCK_NANOSLEEP", - "SYS_CLOCK_SETTIME", - "SYS_CLONE", - "SYS_CLOSE", - "SYS_CLOSEFROM", - "SYS_CLOSE_NOCANCEL", - "SYS_CONNECT", - "SYS_CONNECTAT", - "SYS_CONNECT_NOCANCEL", - "SYS_COPYFILE", - "SYS_CPUSET", - "SYS_CPUSET_GETAFFINITY", - "SYS_CPUSET_GETID", - "SYS_CPUSET_SETAFFINITY", - "SYS_CPUSET_SETID", - "SYS_CREAT", - "SYS_CREATE_MODULE", - "SYS_CSOPS", - "SYS_DELETE", - "SYS_DELETE_MODULE", - "SYS_DUP", - "SYS_DUP2", - "SYS_DUP3", - "SYS_EACCESS", - "SYS_EPOLL_CREATE", - "SYS_EPOLL_CREATE1", - "SYS_EPOLL_CTL", - "SYS_EPOLL_CTL_OLD", - "SYS_EPOLL_PWAIT", - "SYS_EPOLL_WAIT", - "SYS_EPOLL_WAIT_OLD", - "SYS_EVENTFD", - "SYS_EVENTFD2", - "SYS_EXCHANGEDATA", - "SYS_EXECVE", - "SYS_EXIT", - "SYS_EXIT_GROUP", - "SYS_EXTATTRCTL", - "SYS_EXTATTR_DELETE_FD", - "SYS_EXTATTR_DELETE_FILE", - "SYS_EXTATTR_DELETE_LINK", - "SYS_EXTATTR_GET_FD", - "SYS_EXTATTR_GET_FILE", - "SYS_EXTATTR_GET_LINK", - "SYS_EXTATTR_LIST_FD", - "SYS_EXTATTR_LIST_FILE", - "SYS_EXTATTR_LIST_LINK", - "SYS_EXTATTR_SET_FD", - "SYS_EXTATTR_SET_FILE", - "SYS_EXTATTR_SET_LINK", - "SYS_FACCESSAT", - "SYS_FADVISE64", - "SYS_FADVISE64_64", - "SYS_FALLOCATE", - "SYS_FANOTIFY_INIT", - "SYS_FANOTIFY_MARK", - "SYS_FCHDIR", - "SYS_FCHFLAGS", - "SYS_FCHMOD", - "SYS_FCHMODAT", - "SYS_FCHMOD_EXTENDED", - "SYS_FCHOWN", - "SYS_FCHOWN32", - "SYS_FCHOWNAT", - "SYS_FCHROOT", - "SYS_FCNTL", - "SYS_FCNTL64", - "SYS_FCNTL_NOCANCEL", - "SYS_FDATASYNC", - "SYS_FEXECVE", - "SYS_FFCLOCK_GETCOUNTER", - "SYS_FFCLOCK_GETESTIMATE", - "SYS_FFCLOCK_SETESTIMATE", - "SYS_FFSCTL", - "SYS_FGETATTRLIST", - "SYS_FGETXATTR", - "SYS_FHOPEN", - "SYS_FHSTAT", - "SYS_FHSTATFS", - "SYS_FILEPORT_MAKEFD", - "SYS_FILEPORT_MAKEPORT", - "SYS_FKTRACE", - "SYS_FLISTXATTR", - "SYS_FLOCK", - "SYS_FORK", - "SYS_FPATHCONF", - "SYS_FREEBSD6_FTRUNCATE", - "SYS_FREEBSD6_LSEEK", - "SYS_FREEBSD6_MMAP", - "SYS_FREEBSD6_PREAD", - "SYS_FREEBSD6_PWRITE", - "SYS_FREEBSD6_TRUNCATE", - "SYS_FREMOVEXATTR", - "SYS_FSCTL", - "SYS_FSETATTRLIST", - "SYS_FSETXATTR", - "SYS_FSGETPATH", - "SYS_FSTAT", - "SYS_FSTAT64", - "SYS_FSTAT64_EXTENDED", - "SYS_FSTATAT", - "SYS_FSTATAT64", - "SYS_FSTATFS", - "SYS_FSTATFS64", - "SYS_FSTATV", - "SYS_FSTATVFS1", - "SYS_FSTAT_EXTENDED", - "SYS_FSYNC", - "SYS_FSYNC_NOCANCEL", - "SYS_FSYNC_RANGE", - "SYS_FTIME", - "SYS_FTRUNCATE", - "SYS_FTRUNCATE64", - "SYS_FUTEX", - "SYS_FUTIMENS", - "SYS_FUTIMES", - "SYS_FUTIMESAT", - "SYS_GETATTRLIST", - "SYS_GETAUDIT", - "SYS_GETAUDIT_ADDR", - "SYS_GETAUID", - "SYS_GETCONTEXT", - "SYS_GETCPU", - "SYS_GETCWD", - "SYS_GETDENTS", - "SYS_GETDENTS64", - "SYS_GETDIRENTRIES", - "SYS_GETDIRENTRIES64", - "SYS_GETDIRENTRIESATTR", - "SYS_GETDTABLECOUNT", - "SYS_GETDTABLESIZE", - "SYS_GETEGID", - "SYS_GETEGID32", - "SYS_GETEUID", - "SYS_GETEUID32", - "SYS_GETFH", - "SYS_GETFSSTAT", - "SYS_GETFSSTAT64", - "SYS_GETGID", - "SYS_GETGID32", - "SYS_GETGROUPS", - "SYS_GETGROUPS32", - "SYS_GETHOSTUUID", - "SYS_GETITIMER", - "SYS_GETLCID", - "SYS_GETLOGIN", - "SYS_GETLOGINCLASS", - "SYS_GETPEERNAME", - "SYS_GETPGID", - "SYS_GETPGRP", - "SYS_GETPID", - "SYS_GETPMSG", - "SYS_GETPPID", - "SYS_GETPRIORITY", - "SYS_GETRESGID", - "SYS_GETRESGID32", - "SYS_GETRESUID", - "SYS_GETRESUID32", - "SYS_GETRLIMIT", - "SYS_GETRTABLE", - "SYS_GETRUSAGE", - "SYS_GETSGROUPS", - "SYS_GETSID", - "SYS_GETSOCKNAME", - "SYS_GETSOCKOPT", - "SYS_GETTHRID", - "SYS_GETTID", - "SYS_GETTIMEOFDAY", - "SYS_GETUID", - "SYS_GETUID32", - "SYS_GETVFSSTAT", - "SYS_GETWGROUPS", - "SYS_GETXATTR", - "SYS_GET_KERNEL_SYMS", - "SYS_GET_MEMPOLICY", - "SYS_GET_ROBUST_LIST", - "SYS_GET_THREAD_AREA", - "SYS_GTTY", - "SYS_IDENTITYSVC", - "SYS_IDLE", - "SYS_INITGROUPS", - "SYS_INIT_MODULE", - "SYS_INOTIFY_ADD_WATCH", - "SYS_INOTIFY_INIT", - "SYS_INOTIFY_INIT1", - "SYS_INOTIFY_RM_WATCH", - "SYS_IOCTL", - "SYS_IOPERM", - "SYS_IOPL", - "SYS_IOPOLICYSYS", - "SYS_IOPRIO_GET", - "SYS_IOPRIO_SET", - "SYS_IO_CANCEL", - "SYS_IO_DESTROY", - "SYS_IO_GETEVENTS", - "SYS_IO_SETUP", - "SYS_IO_SUBMIT", - "SYS_IPC", - "SYS_ISSETUGID", - "SYS_JAIL", - "SYS_JAIL_ATTACH", - "SYS_JAIL_GET", - "SYS_JAIL_REMOVE", - "SYS_JAIL_SET", - "SYS_KDEBUG_TRACE", - "SYS_KENV", - "SYS_KEVENT", - "SYS_KEVENT64", - "SYS_KEXEC_LOAD", - "SYS_KEYCTL", - "SYS_KILL", - "SYS_KLDFIND", - "SYS_KLDFIRSTMOD", - "SYS_KLDLOAD", - "SYS_KLDNEXT", - "SYS_KLDSTAT", - "SYS_KLDSYM", - "SYS_KLDUNLOAD", - "SYS_KLDUNLOADF", - "SYS_KQUEUE", - "SYS_KQUEUE1", - "SYS_KTIMER_CREATE", - "SYS_KTIMER_DELETE", - "SYS_KTIMER_GETOVERRUN", - "SYS_KTIMER_GETTIME", - "SYS_KTIMER_SETTIME", - "SYS_KTRACE", - "SYS_LCHFLAGS", - "SYS_LCHMOD", - "SYS_LCHOWN", - "SYS_LCHOWN32", - "SYS_LGETFH", - "SYS_LGETXATTR", - "SYS_LINK", - "SYS_LINKAT", - "SYS_LIO_LISTIO", - "SYS_LISTEN", - "SYS_LISTXATTR", - "SYS_LLISTXATTR", - "SYS_LOCK", - "SYS_LOOKUP_DCOOKIE", - "SYS_LPATHCONF", - "SYS_LREMOVEXATTR", - "SYS_LSEEK", - "SYS_LSETXATTR", - "SYS_LSTAT", - "SYS_LSTAT64", - "SYS_LSTAT64_EXTENDED", - "SYS_LSTATV", - "SYS_LSTAT_EXTENDED", - "SYS_LUTIMES", - "SYS_MAC_SYSCALL", - "SYS_MADVISE", - "SYS_MADVISE1", - "SYS_MAXSYSCALL", - "SYS_MBIND", - "SYS_MIGRATE_PAGES", - "SYS_MINCORE", - "SYS_MINHERIT", - "SYS_MKCOMPLEX", - "SYS_MKDIR", - "SYS_MKDIRAT", - "SYS_MKDIR_EXTENDED", - "SYS_MKFIFO", - "SYS_MKFIFOAT", - "SYS_MKFIFO_EXTENDED", - "SYS_MKNOD", - "SYS_MKNODAT", - "SYS_MLOCK", - "SYS_MLOCKALL", - "SYS_MMAP", - "SYS_MMAP2", - "SYS_MODCTL", - "SYS_MODFIND", - "SYS_MODFNEXT", - "SYS_MODIFY_LDT", - "SYS_MODNEXT", - "SYS_MODSTAT", - "SYS_MODWATCH", - "SYS_MOUNT", - "SYS_MOVE_PAGES", - "SYS_MPROTECT", - "SYS_MPX", - "SYS_MQUERY", - "SYS_MQ_GETSETATTR", - "SYS_MQ_NOTIFY", - "SYS_MQ_OPEN", - "SYS_MQ_TIMEDRECEIVE", - "SYS_MQ_TIMEDSEND", - "SYS_MQ_UNLINK", - "SYS_MREMAP", - "SYS_MSGCTL", - "SYS_MSGGET", - "SYS_MSGRCV", - "SYS_MSGRCV_NOCANCEL", - "SYS_MSGSND", - "SYS_MSGSND_NOCANCEL", - "SYS_MSGSYS", - "SYS_MSYNC", - "SYS_MSYNC_NOCANCEL", - "SYS_MUNLOCK", - "SYS_MUNLOCKALL", - "SYS_MUNMAP", - "SYS_NAME_TO_HANDLE_AT", - "SYS_NANOSLEEP", - "SYS_NEWFSTATAT", - "SYS_NFSCLNT", - "SYS_NFSSERVCTL", - "SYS_NFSSVC", - "SYS_NFSTAT", - "SYS_NICE", - "SYS_NLSTAT", - "SYS_NMOUNT", - "SYS_NSTAT", - "SYS_NTP_ADJTIME", - "SYS_NTP_GETTIME", - "SYS_OABI_SYSCALL_BASE", - "SYS_OBREAK", - "SYS_OLDFSTAT", - "SYS_OLDLSTAT", - "SYS_OLDOLDUNAME", - "SYS_OLDSTAT", - "SYS_OLDUNAME", - "SYS_OPEN", - "SYS_OPENAT", - "SYS_OPENBSD_POLL", - "SYS_OPEN_BY_HANDLE_AT", - "SYS_OPEN_EXTENDED", - "SYS_OPEN_NOCANCEL", - "SYS_OVADVISE", - "SYS_PACCEPT", - "SYS_PATHCONF", - "SYS_PAUSE", - "SYS_PCICONFIG_IOBASE", - "SYS_PCICONFIG_READ", - "SYS_PCICONFIG_WRITE", - "SYS_PDFORK", - "SYS_PDGETPID", - "SYS_PDKILL", - "SYS_PERF_EVENT_OPEN", - "SYS_PERSONALITY", - "SYS_PID_HIBERNATE", - "SYS_PID_RESUME", - "SYS_PID_SHUTDOWN_SOCKETS", - "SYS_PID_SUSPEND", - "SYS_PIPE", - "SYS_PIPE2", - "SYS_PIVOT_ROOT", - "SYS_PMC_CONTROL", - "SYS_PMC_GET_INFO", - "SYS_POLL", - "SYS_POLLTS", - "SYS_POLL_NOCANCEL", - "SYS_POSIX_FADVISE", - "SYS_POSIX_FALLOCATE", - "SYS_POSIX_OPENPT", - "SYS_POSIX_SPAWN", - "SYS_PPOLL", - "SYS_PRCTL", - "SYS_PREAD", - "SYS_PREAD64", - "SYS_PREADV", - "SYS_PREAD_NOCANCEL", - "SYS_PRLIMIT64", - "SYS_PROCCTL", - "SYS_PROCESS_POLICY", - "SYS_PROCESS_VM_READV", - "SYS_PROCESS_VM_WRITEV", - "SYS_PROC_INFO", - "SYS_PROF", - "SYS_PROFIL", - "SYS_PSELECT", - "SYS_PSELECT6", - "SYS_PSET_ASSIGN", - "SYS_PSET_CREATE", - "SYS_PSET_DESTROY", - "SYS_PSYNCH_CVBROAD", - "SYS_PSYNCH_CVCLRPREPOST", - "SYS_PSYNCH_CVSIGNAL", - "SYS_PSYNCH_CVWAIT", - "SYS_PSYNCH_MUTEXDROP", - "SYS_PSYNCH_MUTEXWAIT", - "SYS_PSYNCH_RW_DOWNGRADE", - "SYS_PSYNCH_RW_LONGRDLOCK", - "SYS_PSYNCH_RW_RDLOCK", - "SYS_PSYNCH_RW_UNLOCK", - "SYS_PSYNCH_RW_UNLOCK2", - "SYS_PSYNCH_RW_UPGRADE", - "SYS_PSYNCH_RW_WRLOCK", - "SYS_PSYNCH_RW_YIELDWRLOCK", - "SYS_PTRACE", - "SYS_PUTPMSG", - "SYS_PWRITE", - "SYS_PWRITE64", - "SYS_PWRITEV", - "SYS_PWRITE_NOCANCEL", - "SYS_QUERY_MODULE", - "SYS_QUOTACTL", - "SYS_RASCTL", - "SYS_RCTL_ADD_RULE", - "SYS_RCTL_GET_LIMITS", - "SYS_RCTL_GET_RACCT", - "SYS_RCTL_GET_RULES", - "SYS_RCTL_REMOVE_RULE", - "SYS_READ", - "SYS_READAHEAD", - "SYS_READDIR", - "SYS_READLINK", - "SYS_READLINKAT", - "SYS_READV", - "SYS_READV_NOCANCEL", - "SYS_READ_NOCANCEL", - "SYS_REBOOT", - "SYS_RECV", - "SYS_RECVFROM", - "SYS_RECVFROM_NOCANCEL", - "SYS_RECVMMSG", - "SYS_RECVMSG", - "SYS_RECVMSG_NOCANCEL", - "SYS_REMAP_FILE_PAGES", - "SYS_REMOVEXATTR", - "SYS_RENAME", - "SYS_RENAMEAT", - "SYS_REQUEST_KEY", - "SYS_RESTART_SYSCALL", - "SYS_REVOKE", - "SYS_RFORK", - "SYS_RMDIR", - "SYS_RTPRIO", - "SYS_RTPRIO_THREAD", - "SYS_RT_SIGACTION", - "SYS_RT_SIGPENDING", - "SYS_RT_SIGPROCMASK", - "SYS_RT_SIGQUEUEINFO", - "SYS_RT_SIGRETURN", - "SYS_RT_SIGSUSPEND", - "SYS_RT_SIGTIMEDWAIT", - "SYS_RT_TGSIGQUEUEINFO", - "SYS_SBRK", - "SYS_SCHED_GETAFFINITY", - "SYS_SCHED_GETPARAM", - "SYS_SCHED_GETSCHEDULER", - "SYS_SCHED_GET_PRIORITY_MAX", - "SYS_SCHED_GET_PRIORITY_MIN", - "SYS_SCHED_RR_GET_INTERVAL", - "SYS_SCHED_SETAFFINITY", - "SYS_SCHED_SETPARAM", - "SYS_SCHED_SETSCHEDULER", - "SYS_SCHED_YIELD", - "SYS_SCTP_GENERIC_RECVMSG", - "SYS_SCTP_GENERIC_SENDMSG", - "SYS_SCTP_GENERIC_SENDMSG_IOV", - "SYS_SCTP_PEELOFF", - "SYS_SEARCHFS", - "SYS_SECURITY", - "SYS_SELECT", - "SYS_SELECT_NOCANCEL", - "SYS_SEMCONFIG", - "SYS_SEMCTL", - "SYS_SEMGET", - "SYS_SEMOP", - "SYS_SEMSYS", - "SYS_SEMTIMEDOP", - "SYS_SEM_CLOSE", - "SYS_SEM_DESTROY", - "SYS_SEM_GETVALUE", - "SYS_SEM_INIT", - "SYS_SEM_OPEN", - "SYS_SEM_POST", - "SYS_SEM_TRYWAIT", - "SYS_SEM_UNLINK", - "SYS_SEM_WAIT", - "SYS_SEM_WAIT_NOCANCEL", - "SYS_SEND", - "SYS_SENDFILE", - "SYS_SENDFILE64", - "SYS_SENDMMSG", - "SYS_SENDMSG", - "SYS_SENDMSG_NOCANCEL", - "SYS_SENDTO", - "SYS_SENDTO_NOCANCEL", - "SYS_SETATTRLIST", - "SYS_SETAUDIT", - "SYS_SETAUDIT_ADDR", - "SYS_SETAUID", - "SYS_SETCONTEXT", - "SYS_SETDOMAINNAME", - "SYS_SETEGID", - "SYS_SETEUID", - "SYS_SETFIB", - "SYS_SETFSGID", - "SYS_SETFSGID32", - "SYS_SETFSUID", - "SYS_SETFSUID32", - "SYS_SETGID", - "SYS_SETGID32", - "SYS_SETGROUPS", - "SYS_SETGROUPS32", - "SYS_SETHOSTNAME", - "SYS_SETITIMER", - "SYS_SETLCID", - "SYS_SETLOGIN", - "SYS_SETLOGINCLASS", - "SYS_SETNS", - "SYS_SETPGID", - "SYS_SETPRIORITY", - "SYS_SETPRIVEXEC", - "SYS_SETREGID", - "SYS_SETREGID32", - "SYS_SETRESGID", - "SYS_SETRESGID32", - "SYS_SETRESUID", - "SYS_SETRESUID32", - "SYS_SETREUID", - "SYS_SETREUID32", - "SYS_SETRLIMIT", - "SYS_SETRTABLE", - "SYS_SETSGROUPS", - "SYS_SETSID", - "SYS_SETSOCKOPT", - "SYS_SETTID", - "SYS_SETTID_WITH_PID", - "SYS_SETTIMEOFDAY", - "SYS_SETUID", - "SYS_SETUID32", - "SYS_SETWGROUPS", - "SYS_SETXATTR", - "SYS_SET_MEMPOLICY", - "SYS_SET_ROBUST_LIST", - "SYS_SET_THREAD_AREA", - "SYS_SET_TID_ADDRESS", - "SYS_SGETMASK", - "SYS_SHARED_REGION_CHECK_NP", - "SYS_SHARED_REGION_MAP_AND_SLIDE_NP", - "SYS_SHMAT", - "SYS_SHMCTL", - "SYS_SHMDT", - "SYS_SHMGET", - "SYS_SHMSYS", - "SYS_SHM_OPEN", - "SYS_SHM_UNLINK", - "SYS_SHUTDOWN", - "SYS_SIGACTION", - "SYS_SIGALTSTACK", - "SYS_SIGNAL", - "SYS_SIGNALFD", - "SYS_SIGNALFD4", - "SYS_SIGPENDING", - "SYS_SIGPROCMASK", - "SYS_SIGQUEUE", - "SYS_SIGQUEUEINFO", - "SYS_SIGRETURN", - "SYS_SIGSUSPEND", - "SYS_SIGSUSPEND_NOCANCEL", - "SYS_SIGTIMEDWAIT", - "SYS_SIGWAIT", - "SYS_SIGWAITINFO", - "SYS_SOCKET", - "SYS_SOCKETCALL", - "SYS_SOCKETPAIR", - "SYS_SPLICE", - "SYS_SSETMASK", - "SYS_SSTK", - "SYS_STACK_SNAPSHOT", - "SYS_STAT", - "SYS_STAT64", - "SYS_STAT64_EXTENDED", - "SYS_STATFS", - "SYS_STATFS64", - "SYS_STATV", - "SYS_STATVFS1", - "SYS_STAT_EXTENDED", - "SYS_STIME", - "SYS_STTY", - "SYS_SWAPCONTEXT", - "SYS_SWAPCTL", - "SYS_SWAPOFF", - "SYS_SWAPON", - "SYS_SYMLINK", - "SYS_SYMLINKAT", - "SYS_SYNC", - "SYS_SYNCFS", - "SYS_SYNC_FILE_RANGE", - "SYS_SYSARCH", - "SYS_SYSCALL", - "SYS_SYSCALL_BASE", - "SYS_SYSFS", - "SYS_SYSINFO", - "SYS_SYSLOG", - "SYS_TEE", - "SYS_TGKILL", - "SYS_THREAD_SELFID", - "SYS_THR_CREATE", - "SYS_THR_EXIT", - "SYS_THR_KILL", - "SYS_THR_KILL2", - "SYS_THR_NEW", - "SYS_THR_SELF", - "SYS_THR_SET_NAME", - "SYS_THR_SUSPEND", - "SYS_THR_WAKE", - "SYS_TIME", - "SYS_TIMERFD_CREATE", - "SYS_TIMERFD_GETTIME", - "SYS_TIMERFD_SETTIME", - "SYS_TIMER_CREATE", - "SYS_TIMER_DELETE", - "SYS_TIMER_GETOVERRUN", - "SYS_TIMER_GETTIME", - "SYS_TIMER_SETTIME", - "SYS_TIMES", - "SYS_TKILL", - "SYS_TRUNCATE", - "SYS_TRUNCATE64", - "SYS_TUXCALL", - "SYS_UGETRLIMIT", - "SYS_ULIMIT", - "SYS_UMASK", - "SYS_UMASK_EXTENDED", - "SYS_UMOUNT", - "SYS_UMOUNT2", - "SYS_UNAME", - "SYS_UNDELETE", - "SYS_UNLINK", - "SYS_UNLINKAT", - "SYS_UNMOUNT", - "SYS_UNSHARE", - "SYS_USELIB", - "SYS_USTAT", - "SYS_UTIME", - "SYS_UTIMENSAT", - "SYS_UTIMES", - "SYS_UTRACE", - "SYS_UUIDGEN", - "SYS_VADVISE", - "SYS_VFORK", - "SYS_VHANGUP", - "SYS_VM86", - "SYS_VM86OLD", - "SYS_VMSPLICE", - "SYS_VM_PRESSURE_MONITOR", - "SYS_VSERVER", - "SYS_WAIT4", - "SYS_WAIT4_NOCANCEL", - "SYS_WAIT6", - "SYS_WAITEVENT", - "SYS_WAITID", - "SYS_WAITID_NOCANCEL", - "SYS_WAITPID", - "SYS_WATCHEVENT", - "SYS_WORKQ_KERNRETURN", - "SYS_WORKQ_OPEN", - "SYS_WRITE", - "SYS_WRITEV", - "SYS_WRITEV_NOCANCEL", - "SYS_WRITE_NOCANCEL", - "SYS_YIELD", - "SYS__LLSEEK", - "SYS__LWP_CONTINUE", - "SYS__LWP_CREATE", - "SYS__LWP_CTL", - "SYS__LWP_DETACH", - "SYS__LWP_EXIT", - "SYS__LWP_GETNAME", - "SYS__LWP_GETPRIVATE", - "SYS__LWP_KILL", - "SYS__LWP_PARK", - "SYS__LWP_SELF", - "SYS__LWP_SETNAME", - "SYS__LWP_SETPRIVATE", - "SYS__LWP_SUSPEND", - "SYS__LWP_UNPARK", - "SYS__LWP_UNPARK_ALL", - "SYS__LWP_WAIT", - "SYS__LWP_WAKEUP", - "SYS__NEWSELECT", - "SYS__PSET_BIND", - "SYS__SCHED_GETAFFINITY", - "SYS__SCHED_GETPARAM", - "SYS__SCHED_SETAFFINITY", - "SYS__SCHED_SETPARAM", - "SYS__SYSCTL", - "SYS__UMTX_LOCK", - "SYS__UMTX_OP", - "SYS__UMTX_UNLOCK", - "SYS___ACL_ACLCHECK_FD", - "SYS___ACL_ACLCHECK_FILE", - "SYS___ACL_ACLCHECK_LINK", - "SYS___ACL_DELETE_FD", - "SYS___ACL_DELETE_FILE", - "SYS___ACL_DELETE_LINK", - "SYS___ACL_GET_FD", - "SYS___ACL_GET_FILE", - "SYS___ACL_GET_LINK", - "SYS___ACL_SET_FD", - "SYS___ACL_SET_FILE", - "SYS___ACL_SET_LINK", - "SYS___CLONE", - "SYS___DISABLE_THREADSIGNAL", - "SYS___GETCWD", - "SYS___GETLOGIN", - "SYS___GET_TCB", - "SYS___MAC_EXECVE", - "SYS___MAC_GETFSSTAT", - "SYS___MAC_GET_FD", - "SYS___MAC_GET_FILE", - "SYS___MAC_GET_LCID", - "SYS___MAC_GET_LCTX", - "SYS___MAC_GET_LINK", - "SYS___MAC_GET_MOUNT", - "SYS___MAC_GET_PID", - "SYS___MAC_GET_PROC", - "SYS___MAC_MOUNT", - "SYS___MAC_SET_FD", - "SYS___MAC_SET_FILE", - "SYS___MAC_SET_LCTX", - "SYS___MAC_SET_LINK", - "SYS___MAC_SET_PROC", - "SYS___MAC_SYSCALL", - "SYS___OLD_SEMWAIT_SIGNAL", - "SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", - "SYS___POSIX_CHOWN", - "SYS___POSIX_FCHOWN", - "SYS___POSIX_LCHOWN", - "SYS___POSIX_RENAME", - "SYS___PTHREAD_CANCELED", - "SYS___PTHREAD_CHDIR", - "SYS___PTHREAD_FCHDIR", - "SYS___PTHREAD_KILL", - "SYS___PTHREAD_MARKCANCEL", - "SYS___PTHREAD_SIGMASK", - "SYS___QUOTACTL", - "SYS___SEMCTL", - "SYS___SEMWAIT_SIGNAL", - "SYS___SEMWAIT_SIGNAL_NOCANCEL", - "SYS___SETLOGIN", - "SYS___SETUGID", - "SYS___SET_TCB", - "SYS___SIGACTION_SIGTRAMP", - "SYS___SIGTIMEDWAIT", - "SYS___SIGWAIT", - "SYS___SIGWAIT_NOCANCEL", - "SYS___SYSCTL", - "SYS___TFORK", - "SYS___THREXIT", - "SYS___THRSIGDIVERT", - "SYS___THRSLEEP", - "SYS___THRWAKEUP", - "S_ARCH1", - "S_ARCH2", - "S_BLKSIZE", - "S_IEXEC", - "S_IFBLK", - "S_IFCHR", - "S_IFDIR", - "S_IFIFO", - "S_IFLNK", - "S_IFMT", - "S_IFREG", - "S_IFSOCK", - "S_IFWHT", - "S_IREAD", - "S_IRGRP", - "S_IROTH", - "S_IRUSR", - "S_IRWXG", - "S_IRWXO", - "S_IRWXU", - "S_ISGID", - "S_ISTXT", - "S_ISUID", - "S_ISVTX", - "S_IWGRP", - "S_IWOTH", - "S_IWRITE", - "S_IWUSR", - "S_IXGRP", - "S_IXOTH", - "S_IXUSR", - "S_LOGIN_SET", - "SecurityAttributes", - "Seek", - "Select", - "Sendfile", - "Sendmsg", - "SendmsgN", - "Sendto", - "Servent", - "SetBpf", - "SetBpfBuflen", - "SetBpfDatalink", - "SetBpfHeadercmpl", - "SetBpfImmediate", - "SetBpfInterface", - "SetBpfPromisc", - "SetBpfTimeout", - "SetCurrentDirectory", - "SetEndOfFile", - "SetEnvironmentVariable", - "SetFileAttributes", - "SetFileCompletionNotificationModes", - "SetFilePointer", - "SetFileTime", - "SetHandleInformation", - "SetKevent", - "SetLsfPromisc", - "SetNonblock", - "Setdomainname", - "Setegid", - "Setenv", - "Seteuid", - "Setfsgid", - "Setfsuid", - "Setgid", - "Setgroups", - "Sethostname", - "Setlogin", - "Setpgid", - "Setpriority", - "Setprivexec", - "Setregid", - "Setresgid", - "Setresuid", - "Setreuid", - "Setrlimit", - "Setsid", - "Setsockopt", - "SetsockoptByte", - "SetsockoptICMPv6Filter", - "SetsockoptIPMreq", - "SetsockoptIPMreqn", - "SetsockoptIPv6Mreq", - "SetsockoptInet4Addr", - "SetsockoptInt", - "SetsockoptLinger", - "SetsockoptString", - "SetsockoptTimeval", - "Settimeofday", - "Setuid", - "Setxattr", - "Shutdown", - "SidTypeAlias", - "SidTypeComputer", - "SidTypeDeletedAccount", - "SidTypeDomain", - "SidTypeGroup", - "SidTypeInvalid", - "SidTypeLabel", - "SidTypeUnknown", - "SidTypeUser", - "SidTypeWellKnownGroup", - "Signal", - "SizeofBpfHdr", - "SizeofBpfInsn", - "SizeofBpfProgram", - "SizeofBpfStat", - "SizeofBpfVersion", - "SizeofBpfZbuf", - "SizeofBpfZbufHeader", - "SizeofCmsghdr", - "SizeofICMPv6Filter", - "SizeofIPMreq", - "SizeofIPMreqn", - "SizeofIPv6MTUInfo", - "SizeofIPv6Mreq", - "SizeofIfAddrmsg", - "SizeofIfAnnounceMsghdr", - "SizeofIfData", - "SizeofIfInfomsg", - "SizeofIfMsghdr", - "SizeofIfaMsghdr", - "SizeofIfmaMsghdr", - "SizeofIfmaMsghdr2", - "SizeofInet4Pktinfo", - "SizeofInet6Pktinfo", - "SizeofInotifyEvent", - "SizeofLinger", - "SizeofMsghdr", - "SizeofNlAttr", - "SizeofNlMsgerr", - "SizeofNlMsghdr", - "SizeofRtAttr", - "SizeofRtGenmsg", - "SizeofRtMetrics", - "SizeofRtMsg", - "SizeofRtMsghdr", - "SizeofRtNexthop", - "SizeofSockFilter", - "SizeofSockFprog", - "SizeofSockaddrAny", - "SizeofSockaddrDatalink", - "SizeofSockaddrInet4", - "SizeofSockaddrInet6", - "SizeofSockaddrLinklayer", - "SizeofSockaddrNetlink", - "SizeofSockaddrUnix", - "SizeofTCPInfo", - "SizeofUcred", - "SlicePtrFromStrings", - "SockFilter", - "SockFprog", - "Sockaddr", - "SockaddrDatalink", - "SockaddrGen", - "SockaddrInet4", - "SockaddrInet6", - "SockaddrLinklayer", - "SockaddrNetlink", - "SockaddrUnix", - "Socket", - "SocketControlMessage", - "SocketDisableIPv6", - "Socketpair", - "Splice", - "StartProcess", - "StartupInfo", - "Stat", - "Stat_t", - "Statfs", - "Statfs_t", - "Stderr", - "Stdin", - "Stdout", - "StringBytePtr", - "StringByteSlice", - "StringSlicePtr", - "StringToSid", - "StringToUTF16", - "StringToUTF16Ptr", - "Symlink", - "Sync", - "SyncFileRange", - "SysProcAttr", - "SysProcIDMap", - "Syscall", - "Syscall12", - "Syscall15", - "Syscall18", - "Syscall6", - "Syscall9", - "Sysctl", - "SysctlUint32", - "Sysctlnode", - "Sysinfo", - "Sysinfo_t", - "Systemtime", - "TCGETS", - "TCIFLUSH", - "TCIOFLUSH", - "TCOFLUSH", - "TCPInfo", - "TCPKeepalive", - "TCP_CA_NAME_MAX", - "TCP_CONGCTL", - "TCP_CONGESTION", - "TCP_CONNECTIONTIMEOUT", - "TCP_CORK", - "TCP_DEFER_ACCEPT", - "TCP_INFO", - "TCP_KEEPALIVE", - "TCP_KEEPCNT", - "TCP_KEEPIDLE", - "TCP_KEEPINIT", - "TCP_KEEPINTVL", - "TCP_LINGER2", - "TCP_MAXBURST", - "TCP_MAXHLEN", - "TCP_MAXOLEN", - "TCP_MAXSEG", - "TCP_MAXWIN", - "TCP_MAX_SACK", - "TCP_MAX_WINSHIFT", - "TCP_MD5SIG", - "TCP_MD5SIG_MAXKEYLEN", - "TCP_MINMSS", - "TCP_MINMSSOVERLOAD", - "TCP_MSS", - "TCP_NODELAY", - "TCP_NOOPT", - "TCP_NOPUSH", - "TCP_NSTATES", - "TCP_QUICKACK", - "TCP_RXT_CONNDROPTIME", - "TCP_RXT_FINDROP", - "TCP_SACK_ENABLE", - "TCP_SYNCNT", - "TCP_VENDOR", - "TCP_WINDOW_CLAMP", - "TCSAFLUSH", - "TCSETS", - "TF_DISCONNECT", - "TF_REUSE_SOCKET", - "TF_USE_DEFAULT_WORKER", - "TF_USE_KERNEL_APC", - "TF_USE_SYSTEM_THREAD", - "TF_WRITE_BEHIND", - "TH32CS_INHERIT", - "TH32CS_SNAPALL", - "TH32CS_SNAPHEAPLIST", - "TH32CS_SNAPMODULE", - "TH32CS_SNAPMODULE32", - "TH32CS_SNAPPROCESS", - "TH32CS_SNAPTHREAD", - "TIME_ZONE_ID_DAYLIGHT", - "TIME_ZONE_ID_STANDARD", - "TIME_ZONE_ID_UNKNOWN", - "TIOCCBRK", - "TIOCCDTR", - "TIOCCONS", - "TIOCDCDTIMESTAMP", - "TIOCDRAIN", - "TIOCDSIMICROCODE", - "TIOCEXCL", - "TIOCEXT", - "TIOCFLAG_CDTRCTS", - "TIOCFLAG_CLOCAL", - "TIOCFLAG_CRTSCTS", - "TIOCFLAG_MDMBUF", - "TIOCFLAG_PPS", - "TIOCFLAG_SOFTCAR", - "TIOCFLUSH", - "TIOCGDEV", - "TIOCGDRAINWAIT", - "TIOCGETA", - "TIOCGETD", - "TIOCGFLAGS", - "TIOCGICOUNT", - "TIOCGLCKTRMIOS", - "TIOCGLINED", - "TIOCGPGRP", - "TIOCGPTN", - "TIOCGQSIZE", - "TIOCGRANTPT", - "TIOCGRS485", - "TIOCGSERIAL", - "TIOCGSID", - "TIOCGSIZE", - "TIOCGSOFTCAR", - "TIOCGTSTAMP", - "TIOCGWINSZ", - "TIOCINQ", - "TIOCIXOFF", - "TIOCIXON", - "TIOCLINUX", - "TIOCMBIC", - "TIOCMBIS", - "TIOCMGDTRWAIT", - "TIOCMGET", - "TIOCMIWAIT", - "TIOCMODG", - "TIOCMODS", - "TIOCMSDTRWAIT", - "TIOCMSET", - "TIOCM_CAR", - "TIOCM_CD", - "TIOCM_CTS", - "TIOCM_DCD", - "TIOCM_DSR", - "TIOCM_DTR", - "TIOCM_LE", - "TIOCM_RI", - "TIOCM_RNG", - "TIOCM_RTS", - "TIOCM_SR", - "TIOCM_ST", - "TIOCNOTTY", - "TIOCNXCL", - "TIOCOUTQ", - "TIOCPKT", - "TIOCPKT_DATA", - "TIOCPKT_DOSTOP", - "TIOCPKT_FLUSHREAD", - "TIOCPKT_FLUSHWRITE", - "TIOCPKT_IOCTL", - "TIOCPKT_NOSTOP", - "TIOCPKT_START", - "TIOCPKT_STOP", - "TIOCPTMASTER", - "TIOCPTMGET", - "TIOCPTSNAME", - "TIOCPTYGNAME", - "TIOCPTYGRANT", - "TIOCPTYUNLK", - "TIOCRCVFRAME", - "TIOCREMOTE", - "TIOCSBRK", - "TIOCSCONS", - "TIOCSCTTY", - "TIOCSDRAINWAIT", - "TIOCSDTR", - "TIOCSERCONFIG", - "TIOCSERGETLSR", - "TIOCSERGETMULTI", - "TIOCSERGSTRUCT", - "TIOCSERGWILD", - "TIOCSERSETMULTI", - "TIOCSERSWILD", - "TIOCSER_TEMT", - "TIOCSETA", - "TIOCSETAF", - "TIOCSETAW", - "TIOCSETD", - "TIOCSFLAGS", - "TIOCSIG", - "TIOCSLCKTRMIOS", - "TIOCSLINED", - "TIOCSPGRP", - "TIOCSPTLCK", - "TIOCSQSIZE", - "TIOCSRS485", - "TIOCSSERIAL", - "TIOCSSIZE", - "TIOCSSOFTCAR", - "TIOCSTART", - "TIOCSTAT", - "TIOCSTI", - "TIOCSTOP", - "TIOCSTSTAMP", - "TIOCSWINSZ", - "TIOCTIMESTAMP", - "TIOCUCNTL", - "TIOCVHANGUP", - "TIOCXMTFRAME", - "TOKEN_ADJUST_DEFAULT", - "TOKEN_ADJUST_GROUPS", - "TOKEN_ADJUST_PRIVILEGES", - "TOKEN_ADJUST_SESSIONID", - "TOKEN_ALL_ACCESS", - "TOKEN_ASSIGN_PRIMARY", - "TOKEN_DUPLICATE", - "TOKEN_EXECUTE", - "TOKEN_IMPERSONATE", - "TOKEN_QUERY", - "TOKEN_QUERY_SOURCE", - "TOKEN_READ", - "TOKEN_WRITE", - "TOSTOP", - "TRUNCATE_EXISTING", - "TUNATTACHFILTER", - "TUNDETACHFILTER", - "TUNGETFEATURES", - "TUNGETIFF", - "TUNGETSNDBUF", - "TUNGETVNETHDRSZ", - "TUNSETDEBUG", - "TUNSETGROUP", - "TUNSETIFF", - "TUNSETLINK", - "TUNSETNOCSUM", - "TUNSETOFFLOAD", - "TUNSETOWNER", - "TUNSETPERSIST", - "TUNSETSNDBUF", - "TUNSETTXFILTER", - "TUNSETVNETHDRSZ", - "Tee", - "TerminateProcess", - "Termios", - "Tgkill", - "Time", - "Time_t", - "Times", - "Timespec", - "TimespecToNsec", - "Timeval", - "Timeval32", - "TimevalToNsec", - "Timex", - "Timezoneinformation", - "Tms", - "Token", - "TokenAccessInformation", - "TokenAuditPolicy", - "TokenDefaultDacl", - "TokenElevation", - "TokenElevationType", - "TokenGroups", - "TokenGroupsAndPrivileges", - "TokenHasRestrictions", - "TokenImpersonationLevel", - "TokenIntegrityLevel", - "TokenLinkedToken", - "TokenLogonSid", - "TokenMandatoryPolicy", - "TokenOrigin", - "TokenOwner", - "TokenPrimaryGroup", - "TokenPrivileges", - "TokenRestrictedSids", - "TokenSandBoxInert", - "TokenSessionId", - "TokenSessionReference", - "TokenSource", - "TokenStatistics", - "TokenType", - "TokenUIAccess", - "TokenUser", - "TokenVirtualizationAllowed", - "TokenVirtualizationEnabled", - "Tokenprimarygroup", - "Tokenuser", - "TranslateAccountName", - "TranslateName", - "TransmitFile", - "TransmitFileBuffers", - "Truncate", - "UNIX_PATH_MAX", - "USAGE_MATCH_TYPE_AND", - "USAGE_MATCH_TYPE_OR", - "UTF16FromString", - "UTF16PtrFromString", - "UTF16ToString", - "Ucred", - "Umask", - "Uname", - "Undelete", - "UnixCredentials", - "UnixRights", - "Unlink", - "Unlinkat", - "UnmapViewOfFile", - "Unmount", - "Unsetenv", - "Unshare", - "UserInfo10", - "Ustat", - "Ustat_t", - "Utimbuf", - "Utime", - "Utimes", - "UtimesNano", - "Utsname", - "VDISCARD", - "VDSUSP", - "VEOF", - "VEOL", - "VEOL2", - "VERASE", - "VERASE2", - "VINTR", - "VKILL", - "VLNEXT", - "VMIN", - "VQUIT", - "VREPRINT", - "VSTART", - "VSTATUS", - "VSTOP", - "VSUSP", - "VSWTC", - "VT0", - "VT1", - "VTDLY", - "VTIME", - "VWERASE", - "VirtualLock", - "VirtualUnlock", - "WAIT_ABANDONED", - "WAIT_FAILED", - "WAIT_OBJECT_0", - "WAIT_TIMEOUT", - "WALL", - "WALLSIG", - "WALTSIG", - "WCLONE", - "WCONTINUED", - "WCOREFLAG", - "WEXITED", - "WLINUXCLONE", - "WNOHANG", - "WNOTHREAD", - "WNOWAIT", - "WNOZOMBIE", - "WOPTSCHECKED", - "WORDSIZE", - "WSABuf", - "WSACleanup", - "WSADESCRIPTION_LEN", - "WSAData", - "WSAEACCES", - "WSAECONNABORTED", - "WSAECONNRESET", - "WSAEnumProtocols", - "WSAID_CONNECTEX", - "WSAIoctl", - "WSAPROTOCOL_LEN", - "WSAProtocolChain", - "WSAProtocolInfo", - "WSARecv", - "WSARecvFrom", - "WSASYS_STATUS_LEN", - "WSASend", - "WSASendTo", - "WSASendto", - "WSAStartup", - "WSTOPPED", - "WTRAPPED", - "WUNTRACED", - "Wait4", - "WaitForSingleObject", - "WaitStatus", - "Win32FileAttributeData", - "Win32finddata", - "Write", - "WriteConsole", - "WriteFile", - "X509_ASN_ENCODING", - "XCASE", - "XP1_CONNECTIONLESS", - "XP1_CONNECT_DATA", - "XP1_DISCONNECT_DATA", - "XP1_EXPEDITED_DATA", - "XP1_GRACEFUL_CLOSE", - "XP1_GUARANTEED_DELIVERY", - "XP1_GUARANTEED_ORDER", - "XP1_IFS_HANDLES", - "XP1_MESSAGE_ORIENTED", - "XP1_MULTIPOINT_CONTROL_PLANE", - "XP1_MULTIPOINT_DATA_PLANE", - "XP1_PARTIAL_MESSAGE", - "XP1_PSEUDO_STREAM", - "XP1_QOS_SUPPORTED", - "XP1_SAN_SUPPORT_SDP", - "XP1_SUPPORT_BROADCAST", - "XP1_SUPPORT_MULTIPOINT", - "XP1_UNI_RECV", - "XP1_UNI_SEND", - }, - "syscall/js": []string{ - "CopyBytesToGo", - "CopyBytesToJS", - "Error", - "Func", - "FuncOf", - "Global", - "Null", - "Type", - "TypeBoolean", - "TypeFunction", - "TypeNull", - "TypeNumber", - "TypeObject", - "TypeString", - "TypeSymbol", - "TypeUndefined", - "Undefined", - "Value", - "ValueError", - "ValueOf", - "Wrapper", - }, - "testing": []string{ - "AllocsPerRun", - "B", - "Benchmark", - "BenchmarkResult", - "Cover", - "CoverBlock", - "CoverMode", - "Coverage", - "Init", - "InternalBenchmark", - "InternalExample", - "InternalTest", - "M", - "Main", - "MainStart", - "PB", - "RegisterCover", - "RunBenchmarks", - "RunExamples", - "RunTests", - "Short", - "T", - "TB", - "Verbose", - }, - "testing/fstest": []string{ - "MapFS", - "MapFile", - "TestFS", - }, - "testing/iotest": []string{ - "DataErrReader", - "ErrReader", - "ErrTimeout", - "HalfReader", - "NewReadLogger", - "NewWriteLogger", - "OneByteReader", - "TestReader", - "TimeoutReader", - "TruncateWriter", - }, - "testing/quick": []string{ - "Check", - "CheckEqual", - "CheckEqualError", - "CheckError", - "Config", - "Generator", - "SetupError", - "Value", - }, - "text/scanner": []string{ - "Char", - "Comment", - "EOF", - "Float", - "GoTokens", - "GoWhitespace", - "Ident", - "Int", - "Position", - "RawString", - "ScanChars", - "ScanComments", - "ScanFloats", - "ScanIdents", - "ScanInts", - "ScanRawStrings", - "ScanStrings", - "Scanner", - "SkipComments", - "String", - "TokenString", - }, - "text/tabwriter": []string{ - "AlignRight", - "Debug", - "DiscardEmptyColumns", - "Escape", - "FilterHTML", - "NewWriter", - "StripEscape", - "TabIndent", - "Writer", - }, - "text/template": []string{ - "ExecError", - "FuncMap", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "Must", - "New", - "ParseFS", - "ParseFiles", - "ParseGlob", - "Template", - "URLQueryEscaper", - }, - "text/template/parse": []string{ - "ActionNode", - "BoolNode", - "BranchNode", - "ChainNode", - "CommandNode", - "CommentNode", - "DotNode", - "FieldNode", - "IdentifierNode", - "IfNode", - "IsEmptyTree", - "ListNode", - "Mode", - "New", - "NewIdentifier", - "NilNode", - "Node", - "NodeAction", - "NodeBool", - "NodeChain", - "NodeCommand", - "NodeComment", - "NodeDot", - "NodeField", - "NodeIdentifier", - "NodeIf", - "NodeList", - "NodeNil", - "NodeNumber", - "NodePipe", - "NodeRange", - "NodeString", - "NodeTemplate", - "NodeText", - "NodeType", - "NodeVariable", - "NodeWith", - "NumberNode", - "Parse", - "ParseComments", - "PipeNode", - "Pos", - "RangeNode", - "SkipFuncCheck", - "StringNode", - "TemplateNode", - "TextNode", - "Tree", - "VariableNode", - "WithNode", - }, - "time": []string{ - "ANSIC", - "After", - "AfterFunc", - "April", - "August", - "Date", - "December", - "Duration", - "February", - "FixedZone", - "Friday", - "Hour", - "January", - "July", - "June", - "Kitchen", - "Layout", - "LoadLocation", - "LoadLocationFromTZData", - "Local", - "Location", - "March", - "May", - "Microsecond", - "Millisecond", - "Minute", - "Monday", - "Month", - "Nanosecond", - "NewTicker", - "NewTimer", - "November", - "Now", - "October", - "Parse", - "ParseDuration", - "ParseError", - "ParseInLocation", - "RFC1123", - "RFC1123Z", - "RFC3339", - "RFC3339Nano", - "RFC822", - "RFC822Z", - "RFC850", - "RubyDate", - "Saturday", - "Second", - "September", - "Since", - "Sleep", - "Stamp", - "StampMicro", - "StampMilli", - "StampNano", - "Sunday", - "Thursday", - "Tick", - "Ticker", - "Time", - "Timer", - "Tuesday", - "UTC", - "Unix", - "UnixDate", - "UnixMicro", - "UnixMilli", - "Until", - "Wednesday", - "Weekday", - }, - "unicode": []string{ - "ASCII_Hex_Digit", - "Adlam", - "Ahom", - "Anatolian_Hieroglyphs", - "Arabic", - "Armenian", - "Avestan", - "AzeriCase", - "Balinese", - "Bamum", - "Bassa_Vah", - "Batak", - "Bengali", - "Bhaiksuki", - "Bidi_Control", - "Bopomofo", - "Brahmi", - "Braille", - "Buginese", - "Buhid", - "C", - "Canadian_Aboriginal", - "Carian", - "CaseRange", - "CaseRanges", - "Categories", - "Caucasian_Albanian", - "Cc", - "Cf", - "Chakma", - "Cham", - "Cherokee", - "Chorasmian", - "Co", - "Common", - "Coptic", - "Cs", - "Cuneiform", - "Cypriot", - "Cyrillic", - "Dash", - "Deprecated", - "Deseret", - "Devanagari", - "Diacritic", - "Digit", - "Dives_Akuru", - "Dogra", - "Duployan", - "Egyptian_Hieroglyphs", - "Elbasan", - "Elymaic", - "Ethiopic", - "Extender", - "FoldCategory", - "FoldScript", - "Georgian", - "Glagolitic", - "Gothic", - "Grantha", - "GraphicRanges", - "Greek", - "Gujarati", - "Gunjala_Gondi", - "Gurmukhi", - "Han", - "Hangul", - "Hanifi_Rohingya", - "Hanunoo", - "Hatran", - "Hebrew", - "Hex_Digit", - "Hiragana", - "Hyphen", - "IDS_Binary_Operator", - "IDS_Trinary_Operator", - "Ideographic", - "Imperial_Aramaic", - "In", - "Inherited", - "Inscriptional_Pahlavi", - "Inscriptional_Parthian", - "Is", - "IsControl", - "IsDigit", - "IsGraphic", - "IsLetter", - "IsLower", - "IsMark", - "IsNumber", - "IsOneOf", - "IsPrint", - "IsPunct", - "IsSpace", - "IsSymbol", - "IsTitle", - "IsUpper", - "Javanese", - "Join_Control", - "Kaithi", - "Kannada", - "Katakana", - "Kayah_Li", - "Kharoshthi", - "Khitan_Small_Script", - "Khmer", - "Khojki", - "Khudawadi", - "L", - "Lao", - "Latin", - "Lepcha", - "Letter", - "Limbu", - "Linear_A", - "Linear_B", - "Lisu", - "Ll", - "Lm", - "Lo", - "Logical_Order_Exception", - "Lower", - "LowerCase", - "Lt", - "Lu", - "Lycian", - "Lydian", - "M", - "Mahajani", - "Makasar", - "Malayalam", - "Mandaic", - "Manichaean", - "Marchen", - "Mark", - "Masaram_Gondi", - "MaxASCII", - "MaxCase", - "MaxLatin1", - "MaxRune", - "Mc", - "Me", - "Medefaidrin", - "Meetei_Mayek", - "Mende_Kikakui", - "Meroitic_Cursive", - "Meroitic_Hieroglyphs", - "Miao", - "Mn", - "Modi", - "Mongolian", - "Mro", - "Multani", - "Myanmar", - "N", - "Nabataean", - "Nandinagari", - "Nd", - "New_Tai_Lue", - "Newa", - "Nko", - "Nl", - "No", - "Noncharacter_Code_Point", - "Number", - "Nushu", - "Nyiakeng_Puachue_Hmong", - "Ogham", - "Ol_Chiki", - "Old_Hungarian", - "Old_Italic", - "Old_North_Arabian", - "Old_Permic", - "Old_Persian", - "Old_Sogdian", - "Old_South_Arabian", - "Old_Turkic", - "Oriya", - "Osage", - "Osmanya", - "Other", - "Other_Alphabetic", - "Other_Default_Ignorable_Code_Point", - "Other_Grapheme_Extend", - "Other_ID_Continue", - "Other_ID_Start", - "Other_Lowercase", - "Other_Math", - "Other_Uppercase", - "P", - "Pahawh_Hmong", - "Palmyrene", - "Pattern_Syntax", - "Pattern_White_Space", - "Pau_Cin_Hau", - "Pc", - "Pd", - "Pe", - "Pf", - "Phags_Pa", - "Phoenician", - "Pi", - "Po", - "Prepended_Concatenation_Mark", - "PrintRanges", - "Properties", - "Ps", - "Psalter_Pahlavi", - "Punct", - "Quotation_Mark", - "Radical", - "Range16", - "Range32", - "RangeTable", - "Regional_Indicator", - "Rejang", - "ReplacementChar", - "Runic", - "S", - "STerm", - "Samaritan", - "Saurashtra", - "Sc", - "Scripts", - "Sentence_Terminal", - "Sharada", - "Shavian", - "Siddham", - "SignWriting", - "SimpleFold", - "Sinhala", - "Sk", - "Sm", - "So", - "Soft_Dotted", - "Sogdian", - "Sora_Sompeng", - "Soyombo", - "Space", - "SpecialCase", - "Sundanese", - "Syloti_Nagri", - "Symbol", - "Syriac", - "Tagalog", - "Tagbanwa", - "Tai_Le", - "Tai_Tham", - "Tai_Viet", - "Takri", - "Tamil", - "Tangut", - "Telugu", - "Terminal_Punctuation", - "Thaana", - "Thai", - "Tibetan", - "Tifinagh", - "Tirhuta", - "Title", - "TitleCase", - "To", - "ToLower", - "ToTitle", - "ToUpper", - "TurkishCase", - "Ugaritic", - "Unified_Ideograph", - "Upper", - "UpperCase", - "UpperLower", - "Vai", - "Variation_Selector", - "Version", - "Wancho", - "Warang_Citi", - "White_Space", - "Yezidi", - "Yi", - "Z", - "Zanabazar_Square", - "Zl", - "Zp", - "Zs", - }, - "unicode/utf16": []string{ - "Decode", - "DecodeRune", - "Encode", - "EncodeRune", - "IsSurrogate", - }, - "unicode/utf8": []string{ - "DecodeLastRune", - "DecodeLastRuneInString", - "DecodeRune", - "DecodeRuneInString", - "EncodeRune", - "FullRune", - "FullRuneInString", - "MaxRune", - "RuneCount", - "RuneCountInString", - "RuneError", - "RuneLen", - "RuneSelf", - "RuneStart", - "UTFMax", - "Valid", - "ValidRune", - "ValidString", - }, - "unsafe": []string{ - "Alignof", - "ArbitraryType", - "Offsetof", - "Pointer", - "Sizeof", - }, -} diff --git a/ibm/vendor/golang.org/x/tools/internal/typeparams/common.go b/ibm/vendor/golang.org/x/tools/internal/typeparams/common.go deleted file mode 100644 index 9fc6b4beb8..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/typeparams/common.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package typeparams provides functions to work indirectly with type parameter -// data stored in go/ast and go/types objects, while these API are guarded by a -// build constraint. -// -// This package exists to make it easier for tools to work with generic code, -// while also compiling against older Go versions. -package typeparams - -import ( - "go/ast" - "go/token" -) - -// A IndexExprData holds data from both ast.IndexExpr and the new -// ast.MultiIndexExpr, which was introduced in Go 1.18. -type IndexExprData struct { - X ast.Expr // expression - Lbrack token.Pos // position of "[" - Indices []ast.Expr // index expressions - Rbrack token.Pos // position of "]" -} diff --git a/ibm/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go b/ibm/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go deleted file mode 100644 index 72d010e518..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !typeparams || !go1.18 -// +build !typeparams !go1.18 - -package typeparams - -// Enabled reports whether type parameters are enabled in the current build -// environment. -const Enabled = false diff --git a/ibm/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go b/ibm/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go deleted file mode 100644 index 642fc8ee21..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build typeparams && go1.18 -// +build typeparams,go1.18 - -package typeparams - -// Note: this constant is in a separate file as this is the only acceptable -// diff between the <1.18 API of this package and the 1.18 API. - -// Enabled reports whether type parameters are enabled in the current build -// environment. -const Enabled = true diff --git a/ibm/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go b/ibm/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go deleted file mode 100644 index 12817af856..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !typeparams || !go1.18 -// +build !typeparams !go1.18 - -package typeparams - -import ( - "go/ast" - "go/types" -) - -func unsupported() { - panic("type parameters are unsupported at this go version") -} - -// GetIndexExprData extracts data from *ast.IndexExpr nodes. -// For other nodes, GetIndexExprData returns nil. -func GetIndexExprData(n ast.Node) *IndexExprData { - if e, _ := n.(*ast.IndexExpr); e != nil { - return &IndexExprData{ - X: e.X, - Lbrack: e.Lbrack, - Indices: []ast.Expr{e.Index}, - Rbrack: e.Rbrack, - } - } - return nil -} - -// ForTypeSpec returns an empty field list, as type parameters on not supported -// at this Go version. -func ForTypeSpec(*ast.TypeSpec) *ast.FieldList { - return nil -} - -// ForFuncType returns an empty field list, as type parameters are not -// supported at this Go version. -func ForFuncType(*ast.FuncType) *ast.FieldList { - return nil -} - -// TypeParam is a placeholder type, as type parameters are not supported at -// this Go version. Its methods panic on use. -type TypeParam struct{ types.Type } - -func (*TypeParam) Constraint() types.Type { unsupported(); return nil } -func (*TypeParam) Obj() *types.TypeName { unsupported(); return nil } - -// TypeParamList is a placeholder for an empty type parameter list. -type TypeParamList struct{} - -func (*TypeParamList) Len() int { return 0 } -func (*TypeParamList) At(int) *TypeParam { unsupported(); return nil } - -// TypeList is a placeholder for an empty type list. -type TypeList struct{} - -func (*TypeList) Len() int { return 0 } -func (*TypeList) At(int) types.Type { unsupported(); return nil } - -// NewTypeParam is unsupported at this Go version, and panics. -func NewTypeParam(name *types.TypeName, constraint types.Type) *TypeParam { - unsupported() - return nil -} - -// SetTypeParamConstraint is unsupported at this Go version, and panics. -func SetTypeParamConstraint(tparam *TypeParam, constraint types.Type) { - unsupported() -} - -// ForSignature returns an empty slice. -func ForSignature(*types.Signature) *TypeParamList { - return nil -} - -// SetForSignature panics if tparams is non-empty. -func SetForSignature(_ *types.Signature, tparams []*TypeParam) { - if len(tparams) > 0 { - unsupported() - } -} - -// RecvTypeParams returns a nil slice. -func RecvTypeParams(sig *types.Signature) *TypeParamList { - return nil -} - -// SetRecvTypeParams panics if rparams is non-empty. -func SetRecvTypeParams(sig *types.Signature, rparams []*TypeParam) { - if len(rparams) > 0 { - unsupported() - } -} - -// IsComparable returns false, as no interfaces are type-restricted at this Go -// version. -func IsComparable(*types.Interface) bool { - return false -} - -// IsConstraint returns false, as no interfaces are type-restricted at this Go -// version. -func IsConstraint(*types.Interface) bool { - return false -} - -// ForNamed returns an empty type parameter list, as type parameters are not -// supported at this Go version. -func ForNamed(*types.Named) *TypeParamList { - return nil -} - -// SetForNamed panics if tparams is non-empty. -func SetForNamed(_ *types.Named, tparams []*TypeParam) { - if len(tparams) > 0 { - unsupported() - } -} - -// NamedTypeArgs returns nil. -func NamedTypeArgs(*types.Named) *TypeList { - return nil -} - -// NamedTypeOrigin is the identity method at this Go version. -func NamedTypeOrigin(named *types.Named) types.Type { - return named -} - -// Term is a placeholder type, as type parameters are not supported at this Go -// version. Its methods panic on use. -type Term struct{} - -func (*Term) Tilde() bool { unsupported(); return false } -func (*Term) Type() types.Type { unsupported(); return nil } -func (*Term) String() string { unsupported(); return "" } -func (*Term) Underlying() types.Type { unsupported(); return nil } - -// NewTerm is unsupported at this Go version, and panics. -func NewTerm(tilde bool, typ types.Type) *Term { - unsupported() - return nil -} - -// Union is a placeholder type, as type parameters are not supported at this Go -// version. Its methods panic on use. -type Union struct{ types.Type } - -func (*Union) Len() int { return 0 } -func (*Union) Term(i int) *Term { unsupported(); return nil } - -// NewUnion is unsupported at this Go version, and panics. -func NewUnion(terms []*Term) *Union { - unsupported() - return nil -} - -// InitInstanceInfo is a noop at this Go version. -func InitInstanceInfo(*types.Info) {} - -// GetInstance returns nothing, as type parameters are not supported at this Go -// version. -func GetInstance(*types.Info, *ast.Ident) (*TypeList, types.Type) { return nil, nil } - -// Environment is a placeholder type, as type parameters are not supported at -// this Go version. -type Environment struct{} - -// Instantiate is unsupported on this Go version, and panics. -func Instantiate(env *Environment, typ types.Type, targs []types.Type, validate bool) (types.Type, error) { - unsupported() - return nil, nil -} diff --git a/ibm/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go b/ibm/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go deleted file mode 100644 index 8ab17b7779..0000000000 --- a/ibm/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build typeparams && go1.18 -// +build typeparams,go1.18 - -package typeparams - -import ( - "go/ast" - "go/types" -) - -// GetIndexExprData extracts data from AST nodes that represent index -// expressions. -// -// For an ast.IndexExpr, the resulting IndexExprData will have exactly one -// index expression. For an ast.IndexListExpr (go1.18+), it may have a -// variable number of index expressions. -// -// For nodes that don't represent index expressions, GetIndexExprData returns -// nil. -func GetIndexExprData(n ast.Node) *IndexExprData { - switch e := n.(type) { - case *ast.IndexExpr: - return &IndexExprData{ - X: e.X, - Lbrack: e.Lbrack, - Indices: []ast.Expr{e.Index}, - Rbrack: e.Rbrack, - } - case *ast.IndexListExpr: - return (*IndexExprData)(e) - } - return nil -} - -// ForTypeSpec returns n.TypeParams. -func ForTypeSpec(n *ast.TypeSpec) *ast.FieldList { - if n == nil { - return nil - } - return n.TypeParams -} - -// ForFuncType returns n.TypeParams. -func ForFuncType(n *ast.FuncType) *ast.FieldList { - if n == nil { - return nil - } - return n.TypeParams -} - -// TypeParam is an alias for types.TypeParam -type TypeParam = types.TypeParam - -// TypeParamList is an alias for types.TypeParamList -type TypeParamList = types.TypeParamList - -// TypeList is an alias for types.TypeList -type TypeList = types.TypeList - -// NewTypeParam calls types.NewTypeParam. -func NewTypeParam(name *types.TypeName, constraint types.Type) *TypeParam { - return types.NewTypeParam(name, constraint) -} - -// SetTypeParamConstraint calls tparam.SetConstraint(constraint). -func SetTypeParamConstraint(tparam *TypeParam, constraint types.Type) { - tparam.SetConstraint(constraint) -} - -// ForSignature returns sig.TypeParams() -func ForSignature(sig *types.Signature) *TypeParamList { - return sig.TypeParams() -} - -// SetForSignature calls sig.SetTypeParams(tparams) -func SetForSignature(sig *types.Signature, tparams []*TypeParam) { - sig.SetTypeParams(tparams) -} - -// RecvTypeParams returns sig.RecvTypeParams(). -func RecvTypeParams(sig *types.Signature) *TypeParamList { - return sig.RecvTypeParams() -} - -// SetRecvTypeParams calls sig.SetRecvTypeParams(rparams). -func SetRecvTypeParams(sig *types.Signature, rparams []*TypeParam) { - sig.SetRecvTypeParams(rparams) -} - -// IsComparable calls iface.IsComparable(). -func IsComparable(iface *types.Interface) bool { - return iface.IsComparable() -} - -// IsConstraint calls iface.IsConstraint(). -func IsConstraint(iface *types.Interface) bool { - return iface.IsConstraint() -} - -// ForNamed extracts the (possibly empty) type parameter object list from -// named. -func ForNamed(named *types.Named) *TypeParamList { - return named.TypeParams() -} - -// SetForNamed sets the type params tparams on n. Each tparam must be of -// dynamic type *types.TypeParam. -func SetForNamed(n *types.Named, tparams []*TypeParam) { - n.SetTypeParams(tparams) -} - -// NamedTypeArgs returns named.TypeArgs(). -func NamedTypeArgs(named *types.Named) *TypeList { - return named.TypeArgs() -} - -// NamedTypeOrigin returns named.Orig(). -func NamedTypeOrigin(named *types.Named) types.Type { - return named.Origin() -} - -// Term is an alias for types.Term. -type Term = types.Term - -// NewTerm calls types.NewTerm. -func NewTerm(tilde bool, typ types.Type) *Term { - return types.NewTerm(tilde, typ) -} - -// Union is an alias for types.Union -type Union = types.Union - -// NewUnion calls types.NewUnion. -func NewUnion(terms []*Term) *Union { - return types.NewUnion(terms) -} - -// InitInstanceInfo initializes info to record information about type and -// function instances. -func InitInstanceInfo(info *types.Info) { - info.Instances = make(map[*ast.Ident]types.Instance) -} - -// GetInstance extracts information about the instantiation occurring at the -// identifier id. id should be the identifier denoting a parameterized type or -// function in an instantiation expression or function call. -func GetInstance(info *types.Info, id *ast.Ident) (*TypeList, types.Type) { - if info.Instances != nil { - inf := info.Instances[id] - return inf.TypeArgs, inf.Type - } - return nil, nil -} - -// Environment is an alias for types.Environment. -type Environment = types.Environment - -// Instantiate calls types.Instantiate. -func Instantiate(env *Environment, typ types.Type, targs []types.Type, validate bool) (types.Type, error) { - return types.Instantiate(env, typ, targs, validate) -} diff --git a/ibm/vendor/golang.org/x/xerrors/LICENSE b/ibm/vendor/golang.org/x/xerrors/LICENSE deleted file mode 100644 index e4a47e17f1..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/golang.org/x/xerrors/PATENTS b/ibm/vendor/golang.org/x/xerrors/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google 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, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/ibm/vendor/golang.org/x/xerrors/README b/ibm/vendor/golang.org/x/xerrors/README deleted file mode 100644 index aac7867a56..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/README +++ /dev/null @@ -1,2 +0,0 @@ -This repository holds the transition packages for the new Go 1.13 error values. -See golang.org/design/29934-error-values. diff --git a/ibm/vendor/golang.org/x/xerrors/adaptor.go b/ibm/vendor/golang.org/x/xerrors/adaptor.go deleted file mode 100644 index 4317f24833..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/adaptor.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strconv" -) - -// FormatError calls the FormatError method of f with an errors.Printer -// configured according to s and verb, and writes the result to s. -func FormatError(f Formatter, s fmt.State, verb rune) { - // Assuming this function is only called from the Format method, and given - // that FormatError takes precedence over Format, it cannot be called from - // any package that supports errors.Formatter. It is therefore safe to - // disregard that State may be a specific printer implementation and use one - // of our choice instead. - - // limitations: does not support printing error as Go struct. - - var ( - sep = " " // separator before next error - p = &state{State: s} - direct = true - ) - - var err error = f - - switch verb { - // Note that this switch must match the preference order - // for ordinary string printing (%#v before %+v, and so on). - - case 'v': - if s.Flag('#') { - if stringer, ok := err.(fmt.GoStringer); ok { - io.WriteString(&p.buf, stringer.GoString()) - goto exit - } - // proceed as if it were %v - } else if s.Flag('+') { - p.printDetail = true - sep = "\n - " - } - case 's': - case 'q', 'x', 'X': - // Use an intermediate buffer in the rare cases that precision, - // truncation, or one of the alternative verbs (q, x, and X) are - // specified. - direct = false - - default: - p.buf.WriteString("%!") - p.buf.WriteRune(verb) - p.buf.WriteByte('(') - switch { - case err != nil: - p.buf.WriteString(reflect.TypeOf(f).String()) - default: - p.buf.WriteString("") - } - p.buf.WriteByte(')') - io.Copy(s, &p.buf) - return - } - -loop: - for { - switch v := err.(type) { - case Formatter: - err = v.FormatError((*printer)(p)) - case fmt.Formatter: - v.Format(p, 'v') - break loop - default: - io.WriteString(&p.buf, v.Error()) - break loop - } - if err == nil { - break - } - if p.needColon || !p.printDetail { - p.buf.WriteByte(':') - p.needColon = false - } - p.buf.WriteString(sep) - p.inDetail = false - p.needNewline = false - } - -exit: - width, okW := s.Width() - prec, okP := s.Precision() - - if !direct || (okW && width > 0) || okP { - // Construct format string from State s. - format := []byte{'%'} - if s.Flag('-') { - format = append(format, '-') - } - if s.Flag('+') { - format = append(format, '+') - } - if s.Flag(' ') { - format = append(format, ' ') - } - if okW { - format = strconv.AppendInt(format, int64(width), 10) - } - if okP { - format = append(format, '.') - format = strconv.AppendInt(format, int64(prec), 10) - } - format = append(format, string(verb)...) - fmt.Fprintf(s, string(format), p.buf.String()) - } else { - io.Copy(s, &p.buf) - } -} - -var detailSep = []byte("\n ") - -// state tracks error printing state. It implements fmt.State. -type state struct { - fmt.State - buf bytes.Buffer - - printDetail bool - inDetail bool - needColon bool - needNewline bool -} - -func (s *state) Write(b []byte) (n int, err error) { - if s.printDetail { - if len(b) == 0 { - return 0, nil - } - if s.inDetail && s.needColon { - s.needNewline = true - if b[0] == '\n' { - b = b[1:] - } - } - k := 0 - for i, c := range b { - if s.needNewline { - if s.inDetail && s.needColon { - s.buf.WriteByte(':') - s.needColon = false - } - s.buf.Write(detailSep) - s.needNewline = false - } - if c == '\n' { - s.buf.Write(b[k:i]) - k = i + 1 - s.needNewline = true - } - } - s.buf.Write(b[k:]) - if !s.inDetail { - s.needColon = true - } - } else if !s.inDetail { - s.buf.Write(b) - } - return len(b), nil -} - -// printer wraps a state to implement an xerrors.Printer. -type printer state - -func (s *printer) Print(args ...interface{}) { - if !s.inDetail || s.printDetail { - fmt.Fprint((*state)(s), args...) - } -} - -func (s *printer) Printf(format string, args ...interface{}) { - if !s.inDetail || s.printDetail { - fmt.Fprintf((*state)(s), format, args...) - } -} - -func (s *printer) Detail() bool { - s.inDetail = true - return s.printDetail -} diff --git a/ibm/vendor/golang.org/x/xerrors/codereview.cfg b/ibm/vendor/golang.org/x/xerrors/codereview.cfg deleted file mode 100644 index 3f8b14b64e..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/codereview.cfg +++ /dev/null @@ -1 +0,0 @@ -issuerepo: golang/go diff --git a/ibm/vendor/golang.org/x/xerrors/doc.go b/ibm/vendor/golang.org/x/xerrors/doc.go deleted file mode 100644 index eef99d9d54..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xerrors implements functions to manipulate errors. -// -// This package is based on the Go 2 proposal for error values: -// https://golang.org/design/29934-error-values -// -// These functions were incorporated into the standard library's errors package -// in Go 1.13: -// - Is -// - As -// - Unwrap -// -// Also, Errorf's %w verb was incorporated into fmt.Errorf. -// -// Use this package to get equivalent behavior in all supported Go versions. -// -// No other features of this package were included in Go 1.13, and at present -// there are no plans to include any of them. -package xerrors // import "golang.org/x/xerrors" diff --git a/ibm/vendor/golang.org/x/xerrors/errors.go b/ibm/vendor/golang.org/x/xerrors/errors.go deleted file mode 100644 index e88d3772d8..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/errors.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import "fmt" - -// errorString is a trivial implementation of error. -type errorString struct { - s string - frame Frame -} - -// New returns an error that formats as the given text. -// -// The returned error contains a Frame set to the caller's location and -// implements Formatter to show this information when printed with details. -func New(text string) error { - return &errorString{text, Caller(1)} -} - -func (e *errorString) Error() string { - return e.s -} - -func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *errorString) FormatError(p Printer) (next error) { - p.Print(e.s) - e.frame.Format(p) - return nil -} diff --git a/ibm/vendor/golang.org/x/xerrors/fmt.go b/ibm/vendor/golang.org/x/xerrors/fmt.go deleted file mode 100644 index 829862ddf6..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/fmt.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "fmt" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/xerrors/internal" -) - -const percentBangString = "%!" - -// Errorf formats according to a format specifier and returns the string as a -// value that satisfies error. -// -// The returned error includes the file and line number of the caller when -// formatted with additional detail enabled. If the last argument is an error -// the returned error's Format method will return it if the format string ends -// with ": %s", ": %v", or ": %w". If the last argument is an error and the -// format string ends with ": %w", the returned error implements an Unwrap -// method returning it. -// -// If the format specifier includes a %w verb with an error operand in a -// position other than at the end, the returned error will still implement an -// Unwrap method returning the operand, but the error's Format method will not -// return the wrapped error. -// -// It is invalid to include more than one %w verb or to supply it with an -// operand that does not implement the error interface. The %w verb is otherwise -// a synonym for %v. -func Errorf(format string, a ...interface{}) error { - format = formatPlusW(format) - // Support a ": %[wsv]" suffix, which works well with xerrors.Formatter. - wrap := strings.HasSuffix(format, ": %w") - idx, format2, ok := parsePercentW(format) - percentWElsewhere := !wrap && idx >= 0 - if !percentWElsewhere && (wrap || strings.HasSuffix(format, ": %s") || strings.HasSuffix(format, ": %v")) { - err := errorAt(a, len(a)-1) - if err == nil { - return &noWrapError{fmt.Sprintf(format, a...), nil, Caller(1)} - } - // TODO: this is not entirely correct. The error value could be - // printed elsewhere in format if it mixes numbered with unnumbered - // substitutions. With relatively small changes to doPrintf we can - // have it optionally ignore extra arguments and pass the argument - // list in its entirety. - msg := fmt.Sprintf(format[:len(format)-len(": %s")], a[:len(a)-1]...) - frame := Frame{} - if internal.EnableTrace { - frame = Caller(1) - } - if wrap { - return &wrapError{msg, err, frame} - } - return &noWrapError{msg, err, frame} - } - // Support %w anywhere. - // TODO: don't repeat the wrapped error's message when %w occurs in the middle. - msg := fmt.Sprintf(format2, a...) - if idx < 0 { - return &noWrapError{msg, nil, Caller(1)} - } - err := errorAt(a, idx) - if !ok || err == nil { - // Too many %ws or argument of %w is not an error. Approximate the Go - // 1.13 fmt.Errorf message. - return &noWrapError{fmt.Sprintf("%sw(%s)", percentBangString, msg), nil, Caller(1)} - } - frame := Frame{} - if internal.EnableTrace { - frame = Caller(1) - } - return &wrapError{msg, err, frame} -} - -func errorAt(args []interface{}, i int) error { - if i < 0 || i >= len(args) { - return nil - } - err, ok := args[i].(error) - if !ok { - return nil - } - return err -} - -// formatPlusW is used to avoid the vet check that will barf at %w. -func formatPlusW(s string) string { - return s -} - -// Return the index of the only %w in format, or -1 if none. -// Also return a rewritten format string with %w replaced by %v, and -// false if there is more than one %w. -// TODO: handle "%[N]w". -func parsePercentW(format string) (idx int, newFormat string, ok bool) { - // Loosely copied from golang.org/x/tools/go/analysis/passes/printf/printf.go. - idx = -1 - ok = true - n := 0 - sz := 0 - var isW bool - for i := 0; i < len(format); i += sz { - if format[i] != '%' { - sz = 1 - continue - } - // "%%" is not a format directive. - if i+1 < len(format) && format[i+1] == '%' { - sz = 2 - continue - } - sz, isW = parsePrintfVerb(format[i:]) - if isW { - if idx >= 0 { - ok = false - } else { - idx = n - } - // "Replace" the last character, the 'w', with a 'v'. - p := i + sz - 1 - format = format[:p] + "v" + format[p+1:] - } - n++ - } - return idx, format, ok -} - -// Parse the printf verb starting with a % at s[0]. -// Return how many bytes it occupies and whether the verb is 'w'. -func parsePrintfVerb(s string) (int, bool) { - // Assume only that the directive is a sequence of non-letters followed by a single letter. - sz := 0 - var r rune - for i := 1; i < len(s); i += sz { - r, sz = utf8.DecodeRuneInString(s[i:]) - if unicode.IsLetter(r) { - return i + sz, r == 'w' - } - } - return len(s), false -} - -type noWrapError struct { - msg string - err error - frame Frame -} - -func (e *noWrapError) Error() string { - return fmt.Sprint(e) -} - -func (e *noWrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *noWrapError) FormatError(p Printer) (next error) { - p.Print(e.msg) - e.frame.Format(p) - return e.err -} - -type wrapError struct { - msg string - err error - frame Frame -} - -func (e *wrapError) Error() string { - return fmt.Sprint(e) -} - -func (e *wrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *wrapError) FormatError(p Printer) (next error) { - p.Print(e.msg) - e.frame.Format(p) - return e.err -} - -func (e *wrapError) Unwrap() error { - return e.err -} diff --git a/ibm/vendor/golang.org/x/xerrors/format.go b/ibm/vendor/golang.org/x/xerrors/format.go deleted file mode 100644 index 1bc9c26b97..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/format.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -// A Formatter formats error messages. -type Formatter interface { - error - - // FormatError prints the receiver's first error and returns the next error in - // the error chain, if any. - FormatError(p Printer) (next error) -} - -// A Printer formats error messages. -// -// The most common implementation of Printer is the one provided by package fmt -// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message -// typically provide their own implementations. -type Printer interface { - // Print appends args to the message output. - Print(args ...interface{}) - - // Printf writes a formatted string. - Printf(format string, args ...interface{}) - - // Detail reports whether error detail is requested. - // After the first call to Detail, all text written to the Printer - // is formatted as additional detail, or ignored when - // detail has not been requested. - // If Detail returns false, the caller can avoid printing the detail at all. - Detail() bool -} diff --git a/ibm/vendor/golang.org/x/xerrors/frame.go b/ibm/vendor/golang.org/x/xerrors/frame.go deleted file mode 100644 index 0de628ec50..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/frame.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "runtime" -) - -// A Frame contains part of a call stack. -type Frame struct { - // Make room for three PCs: the one we were asked for, what it called, - // and possibly a PC for skipPleaseUseCallersFrames. See: - // https://go.googlesource.com/go/+/032678e0fb/src/runtime/extern.go#169 - frames [3]uintptr -} - -// Caller returns a Frame that describes a frame on the caller's stack. -// The argument skip is the number of frames to skip over. -// Caller(0) returns the frame for the caller of Caller. -func Caller(skip int) Frame { - var s Frame - runtime.Callers(skip+1, s.frames[:]) - return s -} - -// location reports the file, line, and function of a frame. -// -// The returned function may be "" even if file and line are not. -func (f Frame) location() (function, file string, line int) { - frames := runtime.CallersFrames(f.frames[:]) - if _, ok := frames.Next(); !ok { - return "", "", 0 - } - fr, ok := frames.Next() - if !ok { - return "", "", 0 - } - return fr.Function, fr.File, fr.Line -} - -// Format prints the stack as error detail. -// It should be called from an error's Format implementation -// after printing any other error detail. -func (f Frame) Format(p Printer) { - if p.Detail() { - function, file, line := f.location() - if function != "" { - p.Printf("%s\n ", function) - } - if file != "" { - p.Printf("%s:%d\n", file, line) - } - } -} diff --git a/ibm/vendor/golang.org/x/xerrors/internal/internal.go b/ibm/vendor/golang.org/x/xerrors/internal/internal.go deleted file mode 100644 index 89f4eca5df..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/internal/internal.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -// EnableTrace indicates whether stack information should be recorded in errors. -var EnableTrace = true diff --git a/ibm/vendor/golang.org/x/xerrors/wrap.go b/ibm/vendor/golang.org/x/xerrors/wrap.go deleted file mode 100644 index 9a3b510374..0000000000 --- a/ibm/vendor/golang.org/x/xerrors/wrap.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "reflect" -) - -// A Wrapper provides context around another error. -type Wrapper interface { - // Unwrap returns the next error in the error chain. - // If there is no next error, Unwrap returns nil. - Unwrap() error -} - -// Opaque returns an error with the same error formatting as err -// but that does not match err and cannot be unwrapped. -func Opaque(err error) error { - return noWrapper{err} -} - -type noWrapper struct { - error -} - -func (e noWrapper) FormatError(p Printer) (next error) { - if f, ok := e.error.(Formatter); ok { - return f.FormatError(p) - } - p.Print(e.error) - return nil -} - -// Unwrap returns the result of calling the Unwrap method on err, if err implements -// Unwrap. Otherwise, Unwrap returns nil. -func Unwrap(err error) error { - u, ok := err.(Wrapper) - if !ok { - return nil - } - return u.Unwrap() -} - -// Is reports whether any error in err's chain matches target. -// -// An error is considered to match a target if it is equal to that target or if -// it implements a method Is(error) bool such that Is(target) returns true. -func Is(err, target error) bool { - if target == nil { - return err == target - } - - isComparable := reflect.TypeOf(target).Comparable() - for { - if isComparable && err == target { - return true - } - if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { - return true - } - // TODO: consider supporing target.Is(err). This would allow - // user-definable predicates, but also may allow for coping with sloppy - // APIs, thereby making it easier to get away with them. - if err = Unwrap(err); err == nil { - return false - } - } -} - -// As finds the first error in err's chain that matches the type to which target -// points, and if so, sets the target to its value and returns true. An error -// matches a type if it is assignable to the target type, or if it has a method -// As(interface{}) bool such that As(target) returns true. As will panic if target -// is not a non-nil pointer to a type which implements error or is of interface type. -// -// The As method should set the target to its value and return true if err -// matches the type to which target points. -func As(err error, target interface{}) bool { - if target == nil { - panic("errors: target cannot be nil") - } - val := reflect.ValueOf(target) - typ := val.Type() - if typ.Kind() != reflect.Ptr || val.IsNil() { - panic("errors: target must be a non-nil pointer") - } - if e := typ.Elem(); e.Kind() != reflect.Interface && !e.Implements(errorType) { - panic("errors: *target must be interface or implement error") - } - targetType := typ.Elem() - for err != nil { - if reflect.TypeOf(err).AssignableTo(targetType) { - val.Elem().Set(reflect.ValueOf(err)) - return true - } - if x, ok := err.(interface{ As(interface{}) bool }); ok && x.As(target) { - return true - } - err = Unwrap(err) - } - return false -} - -var errorType = reflect.TypeOf((*error)(nil)).Elem() diff --git a/ibm/vendor/google.golang.org/api/AUTHORS b/ibm/vendor/google.golang.org/api/AUTHORS deleted file mode 100644 index f07029059d..0000000000 --- a/ibm/vendor/google.golang.org/api/AUTHORS +++ /dev/null @@ -1,11 +0,0 @@ -# This is the official list of authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. -Google Inc. -LightStep Inc. diff --git a/ibm/vendor/google.golang.org/api/CONTRIBUTORS b/ibm/vendor/google.golang.org/api/CONTRIBUTORS deleted file mode 100644 index 788677b8f0..0000000000 --- a/ibm/vendor/google.golang.org/api/CONTRIBUTORS +++ /dev/null @@ -1,56 +0,0 @@ -# This is the official list of people who can contribute -# (and typically have contributed) code to the repository. -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees are listed here -# but not in AUTHORS, because Google holds the copyright. -# -# The submission process automatically checks to make sure -# that people submitting code are listed in this file (by email address). -# -# Names should be added to this file only after verifying that -# the individual or the individual's organization has agreed to -# the appropriate Contributor License Agreement, found here: -# -# https://cla.developers.google.com/about/google-individual -# https://cla.developers.google.com/about/google-corporate -# -# The CLA can be filled out on the web: -# -# https://cla.developers.google.com/ -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file, depending on whether the -# individual or corporate CLA was used. - -# Names should be added to this file like so: -# Name -# -# An entry with two email addresses specifies that the -# first address should be used in the submit logs and -# that the second address should be recognized as the -# same person when interacting with Rietveld. - -# Please keep the list sorted. - -Alain Vongsouvanhalainv -Andrew Gerrand -Brad Fitzpatrick -Eric Koleda -Francesc Campoy -Garrick Evans -Glenn Lewis -Ivan Krasin -Jason Hall -Johan Euphrosine -Kostik Shtoyk -Kunpei Sakai -Matthew Dolan -Matthew Whisenhunt -Michael McGreevy -Nick Craig-Wood -Robbie Trencheny -Ross Light -Sarah Adams -Scott Van Woudenberg -Takashi Matsuo diff --git a/ibm/vendor/google.golang.org/api/LICENSE b/ibm/vendor/google.golang.org/api/LICENSE deleted file mode 100644 index 263aa7a0c1..0000000000 --- a/ibm/vendor/google.golang.org/api/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/google.golang.org/api/googleapi/googleapi.go b/ibm/vendor/google.golang.org/api/googleapi/googleapi.go deleted file mode 100644 index d1784f1a34..0000000000 --- a/ibm/vendor/google.golang.org/api/googleapi/googleapi.go +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2011 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package googleapi contains the common code shared by all Google API -// libraries. -package googleapi // import "google.golang.org/api/googleapi" - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "google.golang.org/api/internal/third_party/uritemplates" -) - -// ContentTyper is an interface for Readers which know (or would like -// to override) their Content-Type. If a media body doesn't implement -// ContentTyper, the type is sniffed from the content using -// http.DetectContentType. -type ContentTyper interface { - ContentType() string -} - -// A SizeReaderAt is a ReaderAt with a Size method. -// An io.SectionReader implements SizeReaderAt. -type SizeReaderAt interface { - io.ReaderAt - Size() int64 -} - -// ServerResponse is embedded in each Do response and -// provides the HTTP status code and header sent by the server. -type ServerResponse struct { - // HTTPStatusCode is the server's response status code. When using a - // resource method's Do call, this will always be in the 2xx range. - HTTPStatusCode int - // Header contains the response header fields from the server. - Header http.Header -} - -const ( - // Version defines the gax version being used. This is typically sent - // in an HTTP header to services. - Version = "0.5" - - // UserAgent is the header string used to identify this package. - UserAgent = "google-api-go-client/" + Version - - // DefaultUploadChunkSize is the default chunk size to use for resumable - // uploads if not specified by the user. - DefaultUploadChunkSize = 16 * 1024 * 1024 - - // MinUploadChunkSize is the minimum chunk size that can be used for - // resumable uploads. All user-specified chunk sizes must be multiple of - // this value. - MinUploadChunkSize = 256 * 1024 -) - -// Error contains an error response from the server. -type Error struct { - // Code is the HTTP response status code and will always be populated. - Code int `json:"code"` - // Message is the server response message and is only populated when - // explicitly referenced by the JSON server response. - Message string `json:"message"` - // Details provide more context to an error. - Details []interface{} `json:"details"` - // Body is the raw response returned by the server. - // It is often but not always JSON, depending on how the request fails. - Body string - // Header contains the response header fields from the server. - Header http.Header - - Errors []ErrorItem -} - -// ErrorItem is a detailed error code & message from the Google API frontend. -type ErrorItem struct { - // Reason is the typed error code. For example: "some_example". - Reason string `json:"reason"` - // Message is the human-readable description of the error. - Message string `json:"message"` -} - -func (e *Error) Error() string { - if len(e.Errors) == 0 && e.Message == "" { - return fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", e.Code, e.Body) - } - var buf bytes.Buffer - fmt.Fprintf(&buf, "googleapi: Error %d: ", e.Code) - if e.Message != "" { - fmt.Fprintf(&buf, "%s", e.Message) - } - if len(e.Details) > 0 { - var detailBuf bytes.Buffer - enc := json.NewEncoder(&detailBuf) - enc.SetIndent("", " ") - if err := enc.Encode(e.Details); err == nil { - fmt.Fprint(&buf, "\nDetails:") - fmt.Fprintf(&buf, "\n%s", detailBuf.String()) - - } - } - if len(e.Errors) == 0 { - return strings.TrimSpace(buf.String()) - } - if len(e.Errors) == 1 && e.Errors[0].Message == e.Message { - fmt.Fprintf(&buf, ", %s", e.Errors[0].Reason) - return buf.String() - } - fmt.Fprintln(&buf, "\nMore details:") - for _, v := range e.Errors { - fmt.Fprintf(&buf, "Reason: %s, Message: %s\n", v.Reason, v.Message) - } - return buf.String() -} - -type errorReply struct { - Error *Error `json:"error"` -} - -// CheckResponse returns an error (of type *Error) if the response -// status code is not 2xx. -func CheckResponse(res *http.Response) error { - if res.StatusCode >= 200 && res.StatusCode <= 299 { - return nil - } - slurp, err := ioutil.ReadAll(res.Body) - if err == nil { - jerr := new(errorReply) - err = json.Unmarshal(slurp, jerr) - if err == nil && jerr.Error != nil { - if jerr.Error.Code == 0 { - jerr.Error.Code = res.StatusCode - } - jerr.Error.Body = string(slurp) - return jerr.Error - } - } - return &Error{ - Code: res.StatusCode, - Body: string(slurp), - Header: res.Header, - } -} - -// IsNotModified reports whether err is the result of the -// server replying with http.StatusNotModified. -// Such error values are sometimes returned by "Do" methods -// on calls when If-None-Match is used. -func IsNotModified(err error) bool { - if err == nil { - return false - } - ae, ok := err.(*Error) - return ok && ae.Code == http.StatusNotModified -} - -// CheckMediaResponse returns an error (of type *Error) if the response -// status code is not 2xx. Unlike CheckResponse it does not assume the -// body is a JSON error document. -// It is the caller's responsibility to close res.Body. -func CheckMediaResponse(res *http.Response) error { - if res.StatusCode >= 200 && res.StatusCode <= 299 { - return nil - } - slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20)) - return &Error{ - Code: res.StatusCode, - Body: string(slurp), - } -} - -// MarshalStyle defines whether to marshal JSON with a {"data": ...} wrapper. -type MarshalStyle bool - -// WithDataWrapper marshals JSON with a {"data": ...} wrapper. -var WithDataWrapper = MarshalStyle(true) - -// WithoutDataWrapper marshals JSON without a {"data": ...} wrapper. -var WithoutDataWrapper = MarshalStyle(false) - -func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) { - buf := new(bytes.Buffer) - if wrap { - buf.Write([]byte(`{"data": `)) - } - err := json.NewEncoder(buf).Encode(v) - if err != nil { - return nil, err - } - if wrap { - buf.Write([]byte(`}`)) - } - return buf, nil -} - -// ProgressUpdater is a function that is called upon every progress update of a resumable upload. -// This is the only part of a resumable upload (from googleapi) that is usable by the developer. -// The remaining usable pieces of resumable uploads is exposed in each auto-generated API. -type ProgressUpdater func(current, total int64) - -// MediaOption defines the interface for setting media options. -type MediaOption interface { - setOptions(o *MediaOptions) -} - -type contentTypeOption string - -func (ct contentTypeOption) setOptions(o *MediaOptions) { - o.ContentType = string(ct) - if o.ContentType == "" { - o.ForceEmptyContentType = true - } -} - -// ContentType returns a MediaOption which sets the Content-Type header for media uploads. -// If ctype is empty, the Content-Type header will be omitted. -func ContentType(ctype string) MediaOption { - return contentTypeOption(ctype) -} - -type chunkSizeOption int - -func (cs chunkSizeOption) setOptions(o *MediaOptions) { - size := int(cs) - if size%MinUploadChunkSize != 0 { - size += MinUploadChunkSize - (size % MinUploadChunkSize) - } - o.ChunkSize = size -} - -// ChunkSize returns a MediaOption which sets the chunk size for media uploads. -// size will be rounded up to the nearest multiple of 256K. -// Media which contains fewer than size bytes will be uploaded in a single request. -// Media which contains size bytes or more will be uploaded in separate chunks. -// If size is zero, media will be uploaded in a single request. -func ChunkSize(size int) MediaOption { - return chunkSizeOption(size) -} - -// MediaOptions stores options for customizing media upload. It is not used by developers directly. -type MediaOptions struct { - ContentType string - ForceEmptyContentType bool - - ChunkSize int -} - -// ProcessMediaOptions stores options from opts in a MediaOptions. -// It is not used by developers directly. -func ProcessMediaOptions(opts []MediaOption) *MediaOptions { - mo := &MediaOptions{ChunkSize: DefaultUploadChunkSize} - for _, o := range opts { - o.setOptions(mo) - } - return mo -} - -// ResolveRelative resolves relatives such as "http://www.golang.org/" and -// "topics/myproject/mytopic" into a single string, such as -// "http://www.golang.org/topics/myproject/mytopic". It strips all parent -// references (e.g. ../..) as well as anything after the host -// (e.g. /bar/gaz gets stripped out of foo.com/bar/gaz). -// -// ResolveRelative panics if either basestr or relstr is not able to be parsed. -func ResolveRelative(basestr, relstr string) string { - u, err := url.Parse(basestr) - if err != nil { - panic(fmt.Sprintf("failed to parse %q", basestr)) - } - afterColonPath := "" - if i := strings.IndexRune(relstr, ':'); i > 0 { - afterColonPath = relstr[i+1:] - relstr = relstr[:i] - } - rel, err := url.Parse(relstr) - if err != nil { - panic(fmt.Sprintf("failed to parse %q", relstr)) - } - u = u.ResolveReference(rel) - us := u.String() - if afterColonPath != "" { - us = fmt.Sprintf("%s:%s", us, afterColonPath) - } - us = strings.Replace(us, "%7B", "{", -1) - us = strings.Replace(us, "%7D", "}", -1) - us = strings.Replace(us, "%2A", "*", -1) - return us -} - -// Expand subsitutes any {encoded} strings in the URL passed in using -// the map supplied. -// -// This calls SetOpaque to avoid encoding of the parameters in the URL path. -func Expand(u *url.URL, expansions map[string]string) { - escaped, unescaped, err := uritemplates.Expand(u.Path, expansions) - if err == nil { - u.Path = unescaped - u.RawPath = escaped - } -} - -// CloseBody is used to close res.Body. -// Prior to calling Close, it also tries to Read a small amount to see an EOF. -// Not seeing an EOF can prevent HTTP Transports from reusing connections. -func CloseBody(res *http.Response) { - if res == nil || res.Body == nil { - return - } - // Justification for 3 byte reads: two for up to "\r\n" after - // a JSON/XML document, and then 1 to see EOF if we haven't yet. - // TODO(bradfitz): detect Go 1.3+ and skip these reads. - // See https://codereview.appspot.com/58240043 - // and https://codereview.appspot.com/49570044 - buf := make([]byte, 1) - for i := 0; i < 3; i++ { - _, err := res.Body.Read(buf) - if err != nil { - break - } - } - res.Body.Close() - -} - -// VariantType returns the type name of the given variant. -// If the map doesn't contain the named key or the value is not a []interface{}, "" is returned. -// This is used to support "variant" APIs that can return one of a number of different types. -func VariantType(t map[string]interface{}) string { - s, _ := t["type"].(string) - return s -} - -// ConvertVariant uses the JSON encoder/decoder to fill in the struct 'dst' with the fields found in variant 'v'. -// This is used to support "variant" APIs that can return one of a number of different types. -// It reports whether the conversion was successful. -func ConvertVariant(v map[string]interface{}, dst interface{}) bool { - var buf bytes.Buffer - err := json.NewEncoder(&buf).Encode(v) - if err != nil { - return false - } - return json.Unmarshal(buf.Bytes(), dst) == nil -} - -// A Field names a field to be retrieved with a partial response. -// https://cloud.google.com/storage/docs/json_api/v1/how-tos/performance -// -// Partial responses can dramatically reduce the amount of data that must be sent to your application. -// In order to request partial responses, you can specify the full list of fields -// that your application needs by adding the Fields option to your request. -// -// Field strings use camelCase with leading lower-case characters to identify fields within the response. -// -// For example, if your response has a "NextPageToken" and a slice of "Items" with "Id" fields, -// you could request just those fields like this: -// -// svc.Events.List().Fields("nextPageToken", "items/id").Do() -// -// or if you were also interested in each Item's "Updated" field, you can combine them like this: -// -// svc.Events.List().Fields("nextPageToken", "items(id,updated)").Do() -// -// Another way to find field names is through the Google API explorer: -// https://developers.google.com/apis-explorer/#p/ -type Field string - -// CombineFields combines fields into a single string. -func CombineFields(s []Field) string { - r := make([]string, len(s)) - for i, v := range s { - r[i] = string(v) - } - return strings.Join(r, ",") -} - -// A CallOption is an optional argument to an API call. -// It should be treated as an opaque value by users of Google APIs. -// -// A CallOption is something that configures an API call in a way that is -// not specific to that API; for instance, controlling the quota user for -// an API call is common across many APIs, and is thus a CallOption. -type CallOption interface { - Get() (key, value string) -} - -// QuotaUser returns a CallOption that will set the quota user for a call. -// The quota user can be used by server-side applications to control accounting. -// It can be an arbitrary string up to 40 characters, and will override UserIP -// if both are provided. -func QuotaUser(u string) CallOption { return quotaUser(u) } - -type quotaUser string - -func (q quotaUser) Get() (string, string) { return "quotaUser", string(q) } - -// UserIP returns a CallOption that will set the "userIp" parameter of a call. -// This should be the IP address of the originating request. -func UserIP(ip string) CallOption { return userIP(ip) } - -type userIP string - -func (i userIP) Get() (string, string) { return "userIp", string(i) } - -// Trace returns a CallOption that enables diagnostic tracing for a call. -// traceToken is an ID supplied by Google support. -func Trace(traceToken string) CallOption { return traceTok(traceToken) } - -type traceTok string - -func (t traceTok) Get() (string, string) { return "trace", "token:" + string(t) } - -// TODO: Fields too diff --git a/ibm/vendor/google.golang.org/api/googleapi/transport/apikey.go b/ibm/vendor/google.golang.org/api/googleapi/transport/apikey.go deleted file mode 100644 index 61720ec2ea..0000000000 --- a/ibm/vendor/google.golang.org/api/googleapi/transport/apikey.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package transport contains HTTP transports used to make -// authenticated API requests. -// -// This package is DEPRECATED. Users should instead use, -// -// service, err := NewService(..., option.WithAPIKey(...)) -package transport - -import ( - "errors" - "net/http" -) - -// APIKey is an HTTP Transport which wraps an underlying transport and -// appends an API Key "key" parameter to the URL of outgoing requests. -// -// Deprecated: please use NewService(..., option.WithAPIKey(...)) instead. -type APIKey struct { - // Key is the API Key to set on requests. - Key string - - // Transport is the underlying HTTP transport. - // If nil, http.DefaultTransport is used. - Transport http.RoundTripper -} - -func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) { - rt := t.Transport - if rt == nil { - rt = http.DefaultTransport - if rt == nil { - return nil, errors.New("googleapi/transport: no Transport specified or available") - } - } - newReq := *req - args := newReq.URL.Query() - args.Set("key", t.Key) - newReq.URL.RawQuery = args.Encode() - return rt.RoundTrip(&newReq) -} diff --git a/ibm/vendor/google.golang.org/api/googleapi/types.go b/ibm/vendor/google.golang.org/api/googleapi/types.go deleted file mode 100644 index fabf74d50d..0000000000 --- a/ibm/vendor/google.golang.org/api/googleapi/types.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2013 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package googleapi - -import ( - "encoding/json" - "errors" - "strconv" -) - -// Int64s is a slice of int64s that marshal as quoted strings in JSON. -type Int64s []int64 - -func (q *Int64s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseInt(s, 10, 64) - if err != nil { - return err - } - *q = append(*q, int64(v)) - } - return nil -} - -// Int32s is a slice of int32s that marshal as quoted strings in JSON. -type Int32s []int32 - -func (q *Int32s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseInt(s, 10, 32) - if err != nil { - return err - } - *q = append(*q, int32(v)) - } - return nil -} - -// Uint64s is a slice of uint64s that marshal as quoted strings in JSON. -type Uint64s []uint64 - -func (q *Uint64s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseUint(s, 10, 64) - if err != nil { - return err - } - *q = append(*q, uint64(v)) - } - return nil -} - -// Uint32s is a slice of uint32s that marshal as quoted strings in JSON. -type Uint32s []uint32 - -func (q *Uint32s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseUint(s, 10, 32) - if err != nil { - return err - } - *q = append(*q, uint32(v)) - } - return nil -} - -// Float64s is a slice of float64s that marshal as quoted strings in JSON. -type Float64s []float64 - -func (q *Float64s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseFloat(s, 64) - if err != nil { - return err - } - *q = append(*q, float64(v)) - } - return nil -} - -func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) { - dst := make([]byte, 0, 2+n*10) // somewhat arbitrary - dst = append(dst, '[') - for i := 0; i < n; i++ { - if i > 0 { - dst = append(dst, ',') - } - dst = append(dst, '"') - dst = fn(dst, i) - dst = append(dst, '"') - } - dst = append(dst, ']') - return dst, nil -} - -func (q Int64s) MarshalJSON() ([]byte, error) { - return quotedList(len(q), func(dst []byte, i int) []byte { - return strconv.AppendInt(dst, q[i], 10) - }) -} - -func (q Int32s) MarshalJSON() ([]byte, error) { - return quotedList(len(q), func(dst []byte, i int) []byte { - return strconv.AppendInt(dst, int64(q[i]), 10) - }) -} - -func (q Uint64s) MarshalJSON() ([]byte, error) { - return quotedList(len(q), func(dst []byte, i int) []byte { - return strconv.AppendUint(dst, q[i], 10) - }) -} - -func (q Uint32s) MarshalJSON() ([]byte, error) { - return quotedList(len(q), func(dst []byte, i int) []byte { - return strconv.AppendUint(dst, uint64(q[i]), 10) - }) -} - -func (q Float64s) MarshalJSON() ([]byte, error) { - return quotedList(len(q), func(dst []byte, i int) []byte { - return strconv.AppendFloat(dst, q[i], 'g', -1, 64) - }) -} - -// RawMessage is a raw encoded JSON value. -// It is identical to json.RawMessage, except it does not suffer from -// https://golang.org/issue/14493. -type RawMessage []byte - -// MarshalJSON returns m. -func (m RawMessage) MarshalJSON() ([]byte, error) { - return m, nil -} - -// UnmarshalJSON sets *m to a copy of data. -func (m *RawMessage) UnmarshalJSON(data []byte) error { - if m == nil { - return errors.New("googleapi.RawMessage: UnmarshalJSON on nil pointer") - } - *m = append((*m)[:0], data...) - return nil -} - -/* - * Helper routines for simplifying the creation of optional fields of basic type. - */ - -// Bool is a helper routine that allocates a new bool value -// to store v and returns a pointer to it. -func Bool(v bool) *bool { return &v } - -// Int32 is a helper routine that allocates a new int32 value -// to store v and returns a pointer to it. -func Int32(v int32) *int32 { return &v } - -// Int64 is a helper routine that allocates a new int64 value -// to store v and returns a pointer to it. -func Int64(v int64) *int64 { return &v } - -// Float64 is a helper routine that allocates a new float64 value -// to store v and returns a pointer to it. -func Float64(v float64) *float64 { return &v } - -// Uint32 is a helper routine that allocates a new uint32 value -// to store v and returns a pointer to it. -func Uint32(v uint32) *uint32 { return &v } - -// Uint64 is a helper routine that allocates a new uint64 value -// to store v and returns a pointer to it. -func Uint64(v uint64) *uint64 { return &v } - -// String is a helper routine that allocates a new string value -// to store v and returns a pointer to it. -func String(v string) *string { return &v } diff --git a/ibm/vendor/google.golang.org/api/internal/conn_pool.go b/ibm/vendor/google.golang.org/api/internal/conn_pool.go deleted file mode 100644 index fedcce15b4..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/conn_pool.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "google.golang.org/grpc" -) - -// ConnPool is a pool of grpc.ClientConns. -type ConnPool interface { - // Conn returns a ClientConn from the pool. - // - // Conns aren't returned to the pool. - Conn() *grpc.ClientConn - - // Num returns the number of connections in the pool. - // - // It will always return the same value. - Num() int - - // Close closes every ClientConn in the pool. - // - // The error returned by Close may be a single error or multiple errors. - Close() error - - // ConnPool implements grpc.ClientConnInterface to enable it to be used directly with generated proto stubs. - grpc.ClientConnInterface -} diff --git a/ibm/vendor/google.golang.org/api/internal/creds.go b/ibm/vendor/google.golang.org/api/internal/creds.go deleted file mode 100644 index dc6d50e96a..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/creds.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2017 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - - "golang.org/x/oauth2" - "google.golang.org/api/internal/impersonate" - - "golang.org/x/oauth2/google" -) - -// Creds returns credential information obtained from DialSettings, or if none, then -// it returns default credential information. -func Creds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { - creds, err := baseCreds(ctx, ds) - if err != nil { - return nil, err - } - if ds.ImpersonationConfig != nil { - return impersonateCredentials(ctx, creds, ds) - } - return creds, nil -} - -func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { - if ds.Credentials != nil { - return ds.Credentials, nil - } - if ds.CredentialsJSON != nil { - return credentialsFromJSON(ctx, ds.CredentialsJSON, ds.Endpoint, ds.Scopes, ds.Audiences) - } - if ds.CredentialsFile != "" { - data, err := ioutil.ReadFile(ds.CredentialsFile) - if err != nil { - return nil, fmt.Errorf("cannot read credentials file: %v", err) - } - return credentialsFromJSON(ctx, data, ds.Endpoint, ds.Scopes, ds.Audiences) - } - if ds.TokenSource != nil { - return &google.Credentials{TokenSource: ds.TokenSource}, nil - } - cred, err := google.FindDefaultCredentials(ctx, ds.Scopes...) - if err != nil { - return nil, err - } - if len(cred.JSON) > 0 { - return credentialsFromJSON(ctx, cred.JSON, ds.Endpoint, ds.Scopes, ds.Audiences) - } - // For GAE and GCE, the JSON is empty so return the default credentials directly. - return cred, nil -} - -// JSON key file type. -const ( - serviceAccountKey = "service_account" -) - -// credentialsFromJSON returns a google.Credentials based on the input. -// -// - If the JSON is a service account and no scopes provided, returns self-signed JWT auth flow -// - Otherwise, returns OAuth 2.0 flow. -func credentialsFromJSON(ctx context.Context, data []byte, endpoint string, scopes []string, audiences []string) (*google.Credentials, error) { - cred, err := google.CredentialsFromJSON(ctx, data, scopes...) - if err != nil { - return nil, err - } - if len(data) > 0 && len(scopes) == 0 { - var f struct { - Type string `json:"type"` - // The rest JSON fields are omitted because they are not used. - } - if err := json.Unmarshal(cred.JSON, &f); err != nil { - return nil, err - } - if f.Type == serviceAccountKey { - ts, err := selfSignedJWTTokenSource(data, endpoint, audiences) - if err != nil { - return nil, err - } - cred.TokenSource = ts - } - } - return cred, err -} - -func selfSignedJWTTokenSource(data []byte, endpoint string, audiences []string) (oauth2.TokenSource, error) { - // Use the API endpoint as the default audience - audience := endpoint - if len(audiences) > 0 { - // TODO(shinfan): Update golang oauth to support multiple audiences. - if len(audiences) > 1 { - return nil, fmt.Errorf("multiple audiences support is not implemented") - } - audience = audiences[0] - } - return google.JWTAccessTokenSourceFromJSON(data, audience) -} - -// QuotaProjectFromCreds returns the quota project from the JSON blob in the provided credentials. -// -// NOTE(cbro): consider promoting this to a field on google.Credentials. -func QuotaProjectFromCreds(cred *google.Credentials) string { - var v struct { - QuotaProject string `json:"quota_project_id"` - } - if err := json.Unmarshal(cred.JSON, &v); err != nil { - return "" - } - return v.QuotaProject -} - -func impersonateCredentials(ctx context.Context, creds *google.Credentials, ds *DialSettings) (*google.Credentials, error) { - if len(ds.ImpersonationConfig.Scopes) == 0 { - ds.ImpersonationConfig.Scopes = ds.Scopes - } - ts, err := impersonate.TokenSource(ctx, creds.TokenSource, ds.ImpersonationConfig) - if err != nil { - return nil, err - } - return &google.Credentials{ - TokenSource: ts, - ProjectID: creds.ProjectID, - }, nil -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/buffer.go b/ibm/vendor/google.golang.org/api/internal/gensupport/buffer.go deleted file mode 100644 index 3d0817ede9..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/buffer.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "bytes" - "io" - - "google.golang.org/api/googleapi" -) - -// MediaBuffer buffers data from an io.Reader to support uploading media in -// retryable chunks. It should be created with NewMediaBuffer. -type MediaBuffer struct { - media io.Reader - - chunk []byte // The current chunk which is pending upload. The capacity is the chunk size. - err error // Any error generated when populating chunk by reading media. - - // The absolute position of chunk in the underlying media. - off int64 -} - -// NewMediaBuffer initializes a MediaBuffer. -func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer { - return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)} -} - -// Chunk returns the current buffered chunk, the offset in the underlying media -// from which the chunk is drawn, and the size of the chunk. -// Successive calls to Chunk return the same chunk between calls to Next. -func (mb *MediaBuffer) Chunk() (chunk io.Reader, off int64, size int, err error) { - // There may already be data in chunk if Next has not been called since the previous call to Chunk. - if mb.err == nil && len(mb.chunk) == 0 { - mb.err = mb.loadChunk() - } - return bytes.NewReader(mb.chunk), mb.off, len(mb.chunk), mb.err -} - -// loadChunk will read from media into chunk, up to the capacity of chunk. -func (mb *MediaBuffer) loadChunk() error { - bufSize := cap(mb.chunk) - mb.chunk = mb.chunk[:bufSize] - - read := 0 - var err error - for err == nil && read < bufSize { - var n int - n, err = mb.media.Read(mb.chunk[read:]) - read += n - } - mb.chunk = mb.chunk[:read] - return err -} - -// Next advances to the next chunk, which will be returned by the next call to Chunk. -// Calls to Next without a corresponding prior call to Chunk will have no effect. -func (mb *MediaBuffer) Next() { - mb.off += int64(len(mb.chunk)) - mb.chunk = mb.chunk[0:0] -} - -type readerTyper struct { - io.Reader - googleapi.ContentTyper -} - -// ReaderAtToReader adapts a ReaderAt to be used as a Reader. -// If ra implements googleapi.ContentTyper, then the returned reader -// will also implement googleapi.ContentTyper, delegating to ra. -func ReaderAtToReader(ra io.ReaderAt, size int64) io.Reader { - r := io.NewSectionReader(ra, 0, size) - if typer, ok := ra.(googleapi.ContentTyper); ok { - return readerTyper{r, typer} - } - return r -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/doc.go b/ibm/vendor/google.golang.org/api/internal/gensupport/doc.go deleted file mode 100644 index 752c4b411b..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gensupport is an internal implementation detail used by code -// generated by the google-api-go-generator tool. -// -// This package may be modified at any time without regard for backwards -// compatibility. It should not be used directly by API users. -package gensupport diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/json.go b/ibm/vendor/google.golang.org/api/internal/gensupport/json.go deleted file mode 100644 index c01e32189f..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/json.go +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "encoding/json" - "fmt" - "reflect" - "strings" -) - -// MarshalJSON returns a JSON encoding of schema containing only selected fields. -// A field is selected if any of the following is true: -// * it has a non-empty value -// * its field name is present in forceSendFields and it is not a nil pointer or nil interface -// * its field name is present in nullFields. -// The JSON key for each selected field is taken from the field's json: struct tag. -func MarshalJSON(schema interface{}, forceSendFields, nullFields []string) ([]byte, error) { - if len(forceSendFields) == 0 && len(nullFields) == 0 { - return json.Marshal(schema) - } - - mustInclude := make(map[string]bool) - for _, f := range forceSendFields { - mustInclude[f] = true - } - useNull := make(map[string]bool) - useNullMaps := make(map[string]map[string]bool) - for _, nf := range nullFields { - parts := strings.SplitN(nf, ".", 2) - field := parts[0] - if len(parts) == 1 { - useNull[field] = true - } else { - if useNullMaps[field] == nil { - useNullMaps[field] = map[string]bool{} - } - useNullMaps[field][parts[1]] = true - } - } - - dataMap, err := schemaToMap(schema, mustInclude, useNull, useNullMaps) - if err != nil { - return nil, err - } - return json.Marshal(dataMap) -} - -func schemaToMap(schema interface{}, mustInclude, useNull map[string]bool, useNullMaps map[string]map[string]bool) (map[string]interface{}, error) { - m := make(map[string]interface{}) - s := reflect.ValueOf(schema) - st := s.Type() - - for i := 0; i < s.NumField(); i++ { - jsonTag := st.Field(i).Tag.Get("json") - if jsonTag == "" { - continue - } - tag, err := parseJSONTag(jsonTag) - if err != nil { - return nil, err - } - if tag.ignore { - continue - } - - v := s.Field(i) - f := st.Field(i) - - if useNull[f.Name] { - if !isEmptyValue(v) { - return nil, fmt.Errorf("field %q in NullFields has non-empty value", f.Name) - } - m[tag.apiName] = nil - continue - } - - if !includeField(v, f, mustInclude) { - continue - } - - // If map fields are explicitly set to null, use a map[string]interface{}. - if f.Type.Kind() == reflect.Map && useNullMaps[f.Name] != nil { - ms, ok := v.Interface().(map[string]string) - if !ok { - return nil, fmt.Errorf("field %q has keys in NullFields but is not a map[string]string", f.Name) - } - mi := map[string]interface{}{} - for k, v := range ms { - mi[k] = v - } - for k := range useNullMaps[f.Name] { - mi[k] = nil - } - m[tag.apiName] = mi - continue - } - - // nil maps are treated as empty maps. - if f.Type.Kind() == reflect.Map && v.IsNil() { - m[tag.apiName] = map[string]string{} - continue - } - - // nil slices are treated as empty slices. - if f.Type.Kind() == reflect.Slice && v.IsNil() { - m[tag.apiName] = []bool{} - continue - } - - if tag.stringFormat { - m[tag.apiName] = formatAsString(v, f.Type.Kind()) - } else { - m[tag.apiName] = v.Interface() - } - } - return m, nil -} - -// formatAsString returns a string representation of v, dereferencing it first if possible. -func formatAsString(v reflect.Value, kind reflect.Kind) string { - if kind == reflect.Ptr && !v.IsNil() { - v = v.Elem() - } - - return fmt.Sprintf("%v", v.Interface()) -} - -// jsonTag represents a restricted version of the struct tag format used by encoding/json. -// It is used to describe the JSON encoding of fields in a Schema struct. -type jsonTag struct { - apiName string - stringFormat bool - ignore bool -} - -// parseJSONTag parses a restricted version of the struct tag format used by encoding/json. -// The format of the tag must match that generated by the Schema.writeSchemaStruct method -// in the api generator. -func parseJSONTag(val string) (jsonTag, error) { - if val == "-" { - return jsonTag{ignore: true}, nil - } - - var tag jsonTag - - i := strings.Index(val, ",") - if i == -1 || val[:i] == "" { - return tag, fmt.Errorf("malformed json tag: %s", val) - } - - tag = jsonTag{ - apiName: val[:i], - } - - switch val[i+1:] { - case "omitempty": - case "omitempty,string": - tag.stringFormat = true - default: - return tag, fmt.Errorf("malformed json tag: %s", val) - } - - return tag, nil -} - -// Reports whether the struct field "f" with value "v" should be included in JSON output. -func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]bool) bool { - // The regular JSON encoding of a nil pointer is "null", which means "delete this field". - // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. - // However, many fields are not pointers, so there would be no way to delete these fields. - // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. - // Deletion will be handled by a separate mechanism. - if f.Type.Kind() == reflect.Ptr && v.IsNil() { - return false - } - - // The "any" type is represented as an interface{}. If this interface - // is nil, there is no reasonable representation to send. We ignore - // these fields, for the same reasons as given above for pointers. - if f.Type.Kind() == reflect.Interface && v.IsNil() { - return false - } - - return mustInclude[f.Name] || !isEmptyValue(v) -} - -// isEmptyValue reports whether v is the empty value for its type. This -// implementation is based on that of the encoding/json package, but its -// correctness does not depend on it being identical. What's important is that -// this function return false in situations where v should not be sent as part -// of a PATCH operation. -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/jsonfloat.go b/ibm/vendor/google.golang.org/api/internal/gensupport/jsonfloat.go deleted file mode 100644 index 13c2f93020..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/jsonfloat.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2016 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "encoding/json" - "errors" - "fmt" - "math" -) - -// JSONFloat64 is a float64 that supports proper unmarshaling of special float -// values in JSON, according to -// https://developers.google.com/protocol-buffers/docs/proto3#json. Although -// that is a proto-to-JSON spec, it applies to all Google APIs. -// -// The jsonpb package -// (https://github.com/golang/protobuf/blob/master/jsonpb/jsonpb.go) has -// similar functionality, but only for direct translation from proto messages -// to JSON. -type JSONFloat64 float64 - -func (f *JSONFloat64) UnmarshalJSON(data []byte) error { - var ff float64 - if err := json.Unmarshal(data, &ff); err == nil { - *f = JSONFloat64(ff) - return nil - } - var s string - if err := json.Unmarshal(data, &s); err == nil { - switch s { - case "NaN": - ff = math.NaN() - case "Infinity": - ff = math.Inf(1) - case "-Infinity": - ff = math.Inf(-1) - default: - return fmt.Errorf("google.golang.org/api/internal: bad float string %q", s) - } - *f = JSONFloat64(ff) - return nil - } - return errors.New("google.golang.org/api/internal: data not float or string") -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/media.go b/ibm/vendor/google.golang.org/api/internal/gensupport/media.go deleted file mode 100644 index 0460ab5940..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/media.go +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "mime" - "mime/multipart" - "net/http" - "net/textproto" - "strings" - "sync" - - "google.golang.org/api/googleapi" -) - -const sniffBuffSize = 512 - -func newContentSniffer(r io.Reader) *contentSniffer { - return &contentSniffer{r: r} -} - -// contentSniffer wraps a Reader, and reports the content type determined by sniffing up to 512 bytes from the Reader. -type contentSniffer struct { - r io.Reader - start []byte // buffer for the sniffed bytes. - err error // set to any error encountered while reading bytes to be sniffed. - - ctype string // set on first sniff. - sniffed bool // set to true on first sniff. -} - -func (cs *contentSniffer) Read(p []byte) (n int, err error) { - // Ensure that the content type is sniffed before any data is consumed from Reader. - _, _ = cs.ContentType() - - if len(cs.start) > 0 { - n := copy(p, cs.start) - cs.start = cs.start[n:] - return n, nil - } - - // We may have read some bytes into start while sniffing, even if the read ended in an error. - // We should first return those bytes, then the error. - if cs.err != nil { - return 0, cs.err - } - - // Now we have handled all bytes that were buffered while sniffing. Now just delegate to the underlying reader. - return cs.r.Read(p) -} - -// ContentType returns the sniffed content type, and whether the content type was successfully sniffed. -func (cs *contentSniffer) ContentType() (string, bool) { - if cs.sniffed { - return cs.ctype, cs.ctype != "" - } - cs.sniffed = true - // If ReadAll hits EOF, it returns err==nil. - cs.start, cs.err = ioutil.ReadAll(io.LimitReader(cs.r, sniffBuffSize)) - - // Don't try to detect the content type based on possibly incomplete data. - if cs.err != nil { - return "", false - } - - cs.ctype = http.DetectContentType(cs.start) - return cs.ctype, true -} - -// DetermineContentType determines the content type of the supplied reader. -// If the content type is already known, it can be specified via ctype. -// Otherwise, the content of media will be sniffed to determine the content type. -// If media implements googleapi.ContentTyper (deprecated), this will be used -// instead of sniffing the content. -// After calling DetectContentType the caller must not perform further reads on -// media, but rather read from the Reader that is returned. -func DetermineContentType(media io.Reader, ctype string) (io.Reader, string) { - // Note: callers could avoid calling DetectContentType if ctype != "", - // but doing the check inside this function reduces the amount of - // generated code. - if ctype != "" { - return media, ctype - } - - // For backwards compatibility, allow clients to set content - // type by providing a ContentTyper for media. - if typer, ok := media.(googleapi.ContentTyper); ok { - return media, typer.ContentType() - } - - sniffer := newContentSniffer(media) - if ctype, ok := sniffer.ContentType(); ok { - return sniffer, ctype - } - // If content type could not be sniffed, reads from sniffer will eventually fail with an error. - return sniffer, "" -} - -type typeReader struct { - io.Reader - typ string -} - -// multipartReader combines the contents of multiple readers to create a multipart/related HTTP body. -// Close must be called if reads from the multipartReader are abandoned before reaching EOF. -type multipartReader struct { - pr *io.PipeReader - ctype string - mu sync.Mutex - pipeOpen bool -} - -// boundary optionally specifies the MIME boundary -func newMultipartReader(parts []typeReader, boundary string) *multipartReader { - mp := &multipartReader{pipeOpen: true} - var pw *io.PipeWriter - mp.pr, pw = io.Pipe() - mpw := multipart.NewWriter(pw) - if boundary != "" { - mpw.SetBoundary(boundary) - } - mp.ctype = "multipart/related; boundary=" + mpw.Boundary() - go func() { - for _, part := range parts { - w, err := mpw.CreatePart(typeHeader(part.typ)) - if err != nil { - mpw.Close() - pw.CloseWithError(fmt.Errorf("googleapi: CreatePart failed: %v", err)) - return - } - _, err = io.Copy(w, part.Reader) - if err != nil { - mpw.Close() - pw.CloseWithError(fmt.Errorf("googleapi: Copy failed: %v", err)) - return - } - } - - mpw.Close() - pw.Close() - }() - return mp -} - -func (mp *multipartReader) Read(data []byte) (n int, err error) { - return mp.pr.Read(data) -} - -func (mp *multipartReader) Close() error { - mp.mu.Lock() - if !mp.pipeOpen { - mp.mu.Unlock() - return nil - } - mp.pipeOpen = false - mp.mu.Unlock() - return mp.pr.Close() -} - -// CombineBodyMedia combines a json body with media content to create a multipart/related HTTP body. -// It returns a ReadCloser containing the combined body, and the overall "multipart/related" content type, with random boundary. -// -// The caller must call Close on the returned ReadCloser if reads are abandoned before reaching EOF. -func CombineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType string) (io.ReadCloser, string) { - return combineBodyMedia(body, bodyContentType, media, mediaContentType, "") -} - -// combineBodyMedia is CombineBodyMedia but with an optional mimeBoundary field. -func combineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType, mimeBoundary string) (io.ReadCloser, string) { - mp := newMultipartReader([]typeReader{ - {body, bodyContentType}, - {media, mediaContentType}, - }, mimeBoundary) - return mp, mp.ctype -} - -func typeHeader(contentType string) textproto.MIMEHeader { - h := make(textproto.MIMEHeader) - if contentType != "" { - h.Set("Content-Type", contentType) - } - return h -} - -// PrepareUpload determines whether the data in the supplied reader should be -// uploaded in a single request, or in sequential chunks. -// chunkSize is the size of the chunk that media should be split into. -// -// If chunkSize is zero, media is returned as the first value, and the other -// two return values are nil, true. -// -// Otherwise, a MediaBuffer is returned, along with a bool indicating whether the -// contents of media fit in a single chunk. -// -// After PrepareUpload has been called, media should no longer be used: the -// media content should be accessed via one of the return values. -func PrepareUpload(media io.Reader, chunkSize int) (r io.Reader, mb *MediaBuffer, singleChunk bool) { - if chunkSize == 0 { // do not chunk - return media, nil, true - } - mb = NewMediaBuffer(media, chunkSize) - _, _, _, err := mb.Chunk() - // If err is io.EOF, we can upload this in a single request. Otherwise, err is - // either nil or a non-EOF error. If it is the latter, then the next call to - // mb.Chunk will return the same error. Returning a MediaBuffer ensures that this - // error will be handled at some point. - return nil, mb, err == io.EOF -} - -// MediaInfo holds information for media uploads. It is intended for use by generated -// code only. -type MediaInfo struct { - // At most one of Media and MediaBuffer will be set. - media io.Reader - buffer *MediaBuffer - singleChunk bool - mType string - size int64 // mediaSize, if known. Used only for calls to progressUpdater_. - progressUpdater googleapi.ProgressUpdater -} - -// NewInfoFromMedia should be invoked from the Media method of a call. It returns a -// MediaInfo populated with chunk size and content type, and a reader or MediaBuffer -// if needed. -func NewInfoFromMedia(r io.Reader, options []googleapi.MediaOption) *MediaInfo { - mi := &MediaInfo{} - opts := googleapi.ProcessMediaOptions(options) - if !opts.ForceEmptyContentType { - r, mi.mType = DetermineContentType(r, opts.ContentType) - } - mi.media, mi.buffer, mi.singleChunk = PrepareUpload(r, opts.ChunkSize) - return mi -} - -// NewInfoFromResumableMedia should be invoked from the ResumableMedia method of a -// call. It returns a MediaInfo using the given reader, size and media type. -func NewInfoFromResumableMedia(r io.ReaderAt, size int64, mediaType string) *MediaInfo { - rdr := ReaderAtToReader(r, size) - rdr, mType := DetermineContentType(rdr, mediaType) - return &MediaInfo{ - size: size, - mType: mType, - buffer: NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize), - media: nil, - singleChunk: false, - } -} - -// SetProgressUpdater sets the progress updater for the media info. -func (mi *MediaInfo) SetProgressUpdater(pu googleapi.ProgressUpdater) { - if mi != nil { - mi.progressUpdater = pu - } -} - -// UploadType determines the type of upload: a single request, or a resumable -// series of requests. -func (mi *MediaInfo) UploadType() string { - if mi.singleChunk { - return "multipart" - } - return "resumable" -} - -// UploadRequest sets up an HTTP request for media upload. It adds headers -// as necessary, and returns a replacement for the body and a function for http.Request.GetBody. -func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newBody io.Reader, getBody func() (io.ReadCloser, error), cleanup func()) { - cleanup = func() {} - if mi == nil { - return body, nil, cleanup - } - var media io.Reader - if mi.media != nil { - // This only happens when the caller has turned off chunking. In that - // case, we write all of media in a single non-retryable request. - media = mi.media - } else if mi.singleChunk { - // The data fits in a single chunk, which has now been read into the MediaBuffer. - // We obtain that chunk so we can write it in a single request. The request can - // be retried because the data is stored in the MediaBuffer. - media, _, _, _ = mi.buffer.Chunk() - } - if media != nil { - fb := readerFunc(body) - fm := readerFunc(media) - combined, ctype := CombineBodyMedia(body, "application/json", media, mi.mType) - toCleanup := []io.Closer{ - combined, - } - if fb != nil && fm != nil { - getBody = func() (io.ReadCloser, error) { - rb := ioutil.NopCloser(fb()) - rm := ioutil.NopCloser(fm()) - var mimeBoundary string - if _, params, err := mime.ParseMediaType(ctype); err == nil { - mimeBoundary = params["boundary"] - } - r, _ := combineBodyMedia(rb, "application/json", rm, mi.mType, mimeBoundary) - toCleanup = append(toCleanup, r) - return r, nil - } - } - cleanup = func() { - for _, closer := range toCleanup { - _ = closer.Close() - } - - } - reqHeaders.Set("Content-Type", ctype) - body = combined - } - if mi.buffer != nil && mi.mType != "" && !mi.singleChunk { - reqHeaders.Set("X-Upload-Content-Type", mi.mType) - } - return body, getBody, cleanup -} - -// readerFunc returns a function that always returns an io.Reader that has the same -// contents as r, provided that can be done without consuming r. Otherwise, it -// returns nil. -// See http.NewRequest (in net/http/request.go). -func readerFunc(r io.Reader) func() io.Reader { - switch r := r.(type) { - case *bytes.Buffer: - buf := r.Bytes() - return func() io.Reader { return bytes.NewReader(buf) } - case *bytes.Reader: - snapshot := *r - return func() io.Reader { r := snapshot; return &r } - case *strings.Reader: - snapshot := *r - return func() io.Reader { r := snapshot; return &r } - default: - return nil - } -} - -// ResumableUpload returns an appropriately configured ResumableUpload value if the -// upload is resumable, or nil otherwise. -func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload { - if mi == nil || mi.singleChunk { - return nil - } - return &ResumableUpload{ - URI: locURI, - Media: mi.buffer, - MediaType: mi.mType, - Callback: func(curr int64) { - if mi.progressUpdater != nil { - mi.progressUpdater(curr, mi.size) - } - }, - } -} - -// SetGetBody sets the GetBody field of req to f. This was once needed -// to gracefully support Go 1.7 and earlier which didn't have that -// field. -// -// Deprecated: the code generator no longer uses this as of -// 2019-02-19. Nothing else should be calling this anyway, but we -// won't delete this immediately; it will be deleted in as early as 6 -// months. -func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) { - req.GetBody = f -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/params.go b/ibm/vendor/google.golang.org/api/internal/gensupport/params.go deleted file mode 100644 index 0e878a4255..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/params.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "net/url" - - "google.golang.org/api/googleapi" -) - -// URLParams is a simplified replacement for url.Values -// that safely builds up URL parameters for encoding. -type URLParams map[string][]string - -// Get returns the first value for the given key, or "". -func (u URLParams) Get(key string) string { - vs := u[key] - if len(vs) == 0 { - return "" - } - return vs[0] -} - -// Set sets the key to value. -// It replaces any existing values. -func (u URLParams) Set(key, value string) { - u[key] = []string{value} -} - -// SetMulti sets the key to an array of values. -// It replaces any existing values. -// Note that values must not be modified after calling SetMulti -// so the caller is responsible for making a copy if necessary. -func (u URLParams) SetMulti(key string, values []string) { - u[key] = values -} - -// Encode encodes the values into ``URL encoded'' form -// ("bar=baz&foo=quux") sorted by key. -func (u URLParams) Encode() string { - return url.Values(u).Encode() -} - -// SetOptions sets the URL params and any additional call options. -func SetOptions(u URLParams, opts ...googleapi.CallOption) { - for _, o := range opts { - u.Set(o.Get()) - } -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/resumable.go b/ibm/vendor/google.golang.org/api/internal/gensupport/resumable.go deleted file mode 100644 index edc87ec24f..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/resumable.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "sync" - "time" - - gax "github.com/googleapis/gax-go/v2" -) - -// Backoff is an interface around gax.Backoff's Pause method, allowing tests to provide their -// own implementation. -type Backoff interface { - Pause() time.Duration -} - -// These are declared as global variables so that tests can overwrite them. -var ( - retryDeadline = 32 * time.Second - backoff = func() Backoff { - return &gax.Backoff{Initial: 100 * time.Millisecond} - } - // isRetryable is a platform-specific hook, specified in retryable_linux.go - syscallRetryable func(error) bool = func(err error) bool { return false } -) - -const ( - // statusTooManyRequests is returned by the storage API if the - // per-project limits have been temporarily exceeded. The request - // should be retried. - // https://cloud.google.com/storage/docs/json_api/v1/status-codes#standardcodes - statusTooManyRequests = 429 -) - -// ResumableUpload is used by the generated APIs to provide resumable uploads. -// It is not used by developers directly. -type ResumableUpload struct { - Client *http.Client - // URI is the resumable resource destination provided by the server after specifying "&uploadType=resumable". - URI string - UserAgent string // User-Agent for header of the request - // Media is the object being uploaded. - Media *MediaBuffer - // MediaType defines the media type, e.g. "image/jpeg". - MediaType string - - mu sync.Mutex // guards progress - progress int64 // number of bytes uploaded so far - - // Callback is an optional function that will be periodically called with the cumulative number of bytes uploaded. - Callback func(int64) -} - -// Progress returns the number of bytes uploaded at this point. -func (rx *ResumableUpload) Progress() int64 { - rx.mu.Lock() - defer rx.mu.Unlock() - return rx.progress -} - -// doUploadRequest performs a single HTTP request to upload data. -// off specifies the offset in rx.Media from which data is drawn. -// size is the number of bytes in data. -// final specifies whether data is the final chunk to be uploaded. -func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader, off, size int64, final bool) (*http.Response, error) { - req, err := http.NewRequest("POST", rx.URI, data) - if err != nil { - return nil, err - } - - req.ContentLength = size - var contentRange string - if final { - if size == 0 { - contentRange = fmt.Sprintf("bytes */%v", off) - } else { - contentRange = fmt.Sprintf("bytes %v-%v/%v", off, off+size-1, off+size) - } - } else { - contentRange = fmt.Sprintf("bytes %v-%v/*", off, off+size-1) - } - req.Header.Set("Content-Range", contentRange) - req.Header.Set("Content-Type", rx.MediaType) - req.Header.Set("User-Agent", rx.UserAgent) - - // Google's upload endpoint uses status code 308 for a - // different purpose than the "308 Permanent Redirect" - // since-standardized in RFC 7238. Because of the conflict in - // semantics, Google added this new request header which - // causes it to not use "308" and instead reply with 200 OK - // and sets the upload-specific "X-HTTP-Status-Code-Override: - // 308" response header. - req.Header.Set("X-GUploader-No-308", "yes") - - return SendRequest(ctx, rx.Client, req) -} - -func statusResumeIncomplete(resp *http.Response) bool { - // This is how the server signals "status resume incomplete" - // when X-GUploader-No-308 is set to "yes": - return resp != nil && resp.Header.Get("X-Http-Status-Code-Override") == "308" -} - -// reportProgress calls a user-supplied callback to report upload progress. -// If old==updated, the callback is not called. -func (rx *ResumableUpload) reportProgress(old, updated int64) { - if updated-old == 0 { - return - } - rx.mu.Lock() - rx.progress = updated - rx.mu.Unlock() - if rx.Callback != nil { - rx.Callback(updated) - } -} - -// transferChunk performs a single HTTP request to upload a single chunk from rx.Media. -func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, error) { - chunk, off, size, err := rx.Media.Chunk() - - done := err == io.EOF - if !done && err != nil { - return nil, err - } - - res, err := rx.doUploadRequest(ctx, chunk, off, int64(size), done) - if err != nil { - return res, err - } - - // We sent "X-GUploader-No-308: yes" (see comment elsewhere in - // this file), so we don't expect to get a 308. - if res.StatusCode == 308 { - return nil, errors.New("unexpected 308 response status code") - } - - if res.StatusCode == http.StatusOK { - rx.reportProgress(off, off+int64(size)) - } - - if statusResumeIncomplete(res) { - rx.Media.Next() - } - return res, nil -} - -// Upload starts the process of a resumable upload with a cancellable context. -// It retries using the provided back off strategy until cancelled or the -// strategy indicates to stop retrying. -// It is called from the auto-generated API code and is not visible to the user. -// Before sending an HTTP request, Upload calls any registered hook functions, -// and calls the returned functions after the request returns (see send.go). -// rx is private to the auto-generated API code. -// Exactly one of resp or err will be nil. If resp is non-nil, the caller must call resp.Body.Close. -func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err error) { - - // There are a couple of cases where it's possible for err and resp to both - // be non-nil. However, we expose a simpler contract to our callers: exactly - // one of resp and err will be non-nil. This means that any response body - // must be closed here before returning a non-nil error. - var prepareReturn = func(resp *http.Response, err error) (*http.Response, error) { - if err != nil { - if resp != nil && resp.Body != nil { - resp.Body.Close() - } - return nil, err - } - return resp, nil - } - - // Send all chunks. - for { - var pause time.Duration - - // Each chunk gets its own initialized-at-zero retry. - bo := backoff() - quitAfter := time.After(retryDeadline) - - // Retry loop for a single chunk. - for { - select { - case <-ctx.Done(): - if err == nil { - err = ctx.Err() - } - return prepareReturn(resp, err) - case <-time.After(pause): - case <-quitAfter: - return prepareReturn(resp, err) - } - - resp, err = rx.transferChunk(ctx) - - var status int - if resp != nil { - status = resp.StatusCode - } - - // Check if we should retry the request. - if !shouldRetry(status, err) { - break - } - - pause = bo.Pause() - if resp != nil && resp.Body != nil { - resp.Body.Close() - } - } - - // If the chunk was uploaded successfully, but there's still - // more to go, upload the next chunk without any delay. - if statusResumeIncomplete(resp) { - resp.Body.Close() - continue - } - - return prepareReturn(resp, err) - } -} - -// shouldRetry indicates whether an error is retryable for the purposes of this -// package, following guidance from -// https://cloud.google.com/storage/docs/exponential-backoff . -func shouldRetry(status int, err error) bool { - if 500 <= status && status <= 599 { - return true - } - if status == statusTooManyRequests { - return true - } - if err == io.ErrUnexpectedEOF { - return true - } - // Transient network errors should be retried. - if syscallRetryable(err) { - return true - } - if err, ok := err.(interface{ Temporary() bool }); ok { - if err.Temporary() { - return true - } - } - // If Go 1.13 error unwrapping is available, use this to examine wrapped - // errors. - if err, ok := err.(interface{ Unwrap() error }); ok { - return shouldRetry(status, err.Unwrap()) - } - return false -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/retryable_linux.go b/ibm/vendor/google.golang.org/api/internal/gensupport/retryable_linux.go deleted file mode 100644 index fed998b5d0..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/retryable_linux.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux - -package gensupport - -import "syscall" - -func init() { - // Initialize syscallRetryable to return true on transient socket-level - // errors. These errors are specific to Linux. - syscallRetryable = func(err error) bool { return err == syscall.ECONNRESET || err == syscall.ECONNREFUSED } -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/send.go b/ibm/vendor/google.golang.org/api/internal/gensupport/send.go deleted file mode 100644 index 3338c8d193..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/send.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "time" -) - -// Hook is the type of a function that is called once before each HTTP request -// that is sent by a generated API. It returns a function that is called after -// the request returns. -// Hooks are not called if the context is nil. -type Hook func(ctx context.Context, req *http.Request) func(resp *http.Response) - -var hooks []Hook - -// RegisterHook registers a Hook to be called before each HTTP request by a -// generated API. Hooks are called in the order they are registered. Each -// hook can return a function; if it is non-nil, it is called after the HTTP -// request returns. These functions are called in the reverse order. -// RegisterHook should not be called concurrently with itself or SendRequest. -func RegisterHook(h Hook) { - hooks = append(hooks, h) -} - -// SendRequest sends a single HTTP request using the given client. -// If ctx is non-nil, it calls all hooks, then sends the request with -// req.WithContext, then calls any functions returned by the hooks in -// reverse order. -func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - // Disallow Accept-Encoding because it interferes with the automatic gzip handling - // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. - if _, ok := req.Header["Accept-Encoding"]; ok { - return nil, errors.New("google api: custom Accept-Encoding headers not allowed") - } - if ctx == nil { - return client.Do(req) - } - // Call hooks in order of registration, store returned funcs. - post := make([]func(resp *http.Response), len(hooks)) - for i, h := range hooks { - fn := h(ctx, req) - post[i] = fn - } - - // Send request. - resp, err := send(ctx, client, req) - - // Call returned funcs in reverse order. - for i := len(post) - 1; i >= 0; i-- { - if fn := post[i]; fn != nil { - fn(resp) - } - } - return resp, err -} - -func send(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - resp, err := client.Do(req.WithContext(ctx)) - // If we got an error, and the context has been canceled, - // the context's error is probably more useful. - if err != nil { - select { - case <-ctx.Done(): - err = ctx.Err() - default: - } - } - return resp, err -} - -// SendRequestWithRetry sends a single HTTP request using the given client, -// with retries if a retryable error is returned. -// If ctx is non-nil, it calls all hooks, then sends the request with -// req.WithContext, then calls any functions returned by the hooks in -// reverse order. -func SendRequestWithRetry(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - // Disallow Accept-Encoding because it interferes with the automatic gzip handling - // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. - if _, ok := req.Header["Accept-Encoding"]; ok { - return nil, errors.New("google api: custom Accept-Encoding headers not allowed") - } - if ctx == nil { - return client.Do(req) - } - // Call hooks in order of registration, store returned funcs. - post := make([]func(resp *http.Response), len(hooks)) - for i, h := range hooks { - fn := h(ctx, req) - post[i] = fn - } - - // Send request with retry. - resp, err := sendAndRetry(ctx, client, req) - - // Call returned funcs in reverse order. - for i := len(post) - 1; i >= 0; i-- { - if fn := post[i]; fn != nil { - fn(resp) - } - } - return resp, err -} - -func sendAndRetry(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - - var resp *http.Response - var err error - - // Loop to retry the request, up to the context deadline. - var pause time.Duration - bo := backoff() - - for { - select { - case <-ctx.Done(): - // If we got an error, and the context has been canceled, - // the context's error is probably more useful. - if err == nil { - err = ctx.Err() - } - return resp, err - case <-time.After(pause): - } - - resp, err = client.Do(req.WithContext(ctx)) - - var status int - if resp != nil { - status = resp.StatusCode - } - - // Check if we can retry the request. A retry can only be done if the error - // is retryable and the request body can be re-created using GetBody (this - // will not be possible if the body was unbuffered). - if req.GetBody == nil || !shouldRetry(status, err) { - break - } - var errBody error - req.Body, errBody = req.GetBody() - if errBody != nil { - break - } - - pause = bo.Pause() - if resp != nil && resp.Body != nil { - resp.Body.Close() - } - } - return resp, err -} - -// DecodeResponse decodes the body of res into target. If there is no body, -// target is unchanged. -func DecodeResponse(target interface{}, res *http.Response) error { - if res.StatusCode == http.StatusNoContent { - return nil - } - return json.NewDecoder(res.Body).Decode(target) -} diff --git a/ibm/vendor/google.golang.org/api/internal/gensupport/version.go b/ibm/vendor/google.golang.org/api/internal/gensupport/version.go deleted file mode 100644 index 23f6aa24ea..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/gensupport/version.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gensupport - -import ( - "runtime" - "strings" - "unicode" -) - -// GoVersion returns the Go runtime version. The returned string -// has no whitespace. -func GoVersion() string { - return goVersion -} - -var goVersion = goVer(runtime.Version()) - -const develPrefix = "devel +" - -func goVer(s string) string { - if strings.HasPrefix(s, develPrefix) { - s = s[len(develPrefix):] - if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { - s = s[:p] - } - return s - } - - if strings.HasPrefix(s, "go1") { - s = s[2:] - var prerelease string - if p := strings.IndexFunc(s, notSemverRune); p >= 0 { - s, prerelease = s[:p], s[p:] - } - if strings.HasSuffix(s, ".") { - s += "0" - } else if strings.Count(s, ".") < 2 { - s += ".0" - } - if prerelease != "" { - s += "-" + prerelease - } - return s - } - return "" -} - -func notSemverRune(r rune) bool { - return !strings.ContainsRune("0123456789.", r) -} diff --git a/ibm/vendor/google.golang.org/api/internal/impersonate/impersonate.go b/ibm/vendor/google.golang.org/api/internal/impersonate/impersonate.go deleted file mode 100644 index b465bbcd12..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/impersonate/impersonate.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package impersonate is used to impersonate Google Credentials. -package impersonate - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "time" - - "golang.org/x/oauth2" -) - -// Config for generating impersonated credentials. -type Config struct { - // Target is the service account to impersonate. Required. - Target string - // Scopes the impersonated credential should have. Required. - Scopes []string - // Delegates are the service accounts in a delegation chain. Each service - // account must be granted roles/iam.serviceAccountTokenCreator on the next - // service account in the chain. Optional. - Delegates []string -} - -// TokenSource returns an impersonated TokenSource configured with the provided -// config using ts as the base credential provider for making requests. -func TokenSource(ctx context.Context, ts oauth2.TokenSource, config *Config) (oauth2.TokenSource, error) { - if len(config.Scopes) == 0 { - return nil, fmt.Errorf("impersonate: scopes must be provided") - } - its := impersonatedTokenSource{ - ctx: ctx, - ts: ts, - name: formatIAMServiceAccountName(config.Target), - // Default to the longest acceptable value of one hour as the token will - // be refreshed automatically. - lifetime: "3600s", - } - - its.delegates = make([]string, len(config.Delegates)) - for i, v := range config.Delegates { - its.delegates[i] = formatIAMServiceAccountName(v) - } - its.scopes = make([]string, len(config.Scopes)) - copy(its.scopes, config.Scopes) - - return oauth2.ReuseTokenSource(nil, its), nil -} - -func formatIAMServiceAccountName(name string) string { - return fmt.Sprintf("projects/-/serviceAccounts/%s", name) -} - -type generateAccessTokenReq struct { - Delegates []string `json:"delegates,omitempty"` - Lifetime string `json:"lifetime,omitempty"` - Scope []string `json:"scope,omitempty"` -} - -type generateAccessTokenResp struct { - AccessToken string `json:"accessToken"` - ExpireTime string `json:"expireTime"` -} - -type impersonatedTokenSource struct { - ctx context.Context - ts oauth2.TokenSource - - name string - lifetime string - scopes []string - delegates []string -} - -// Token returns an impersonated Token. -func (i impersonatedTokenSource) Token() (*oauth2.Token, error) { - hc := oauth2.NewClient(i.ctx, i.ts) - reqBody := generateAccessTokenReq{ - Delegates: i.delegates, - Lifetime: i.lifetime, - Scope: i.scopes, - } - b, err := json.Marshal(reqBody) - if err != nil { - return nil, fmt.Errorf("impersonate: unable to marshal request: %v", err) - } - url := fmt.Sprintf("https://iamcredentials.googleapis.com/v1/%s:generateAccessToken", i.name) - req, err := http.NewRequest("POST", url, bytes.NewReader(b)) - if err != nil { - return nil, fmt.Errorf("impersonate: unable to create request: %v", err) - } - req = req.WithContext(i.ctx) - req.Header.Set("Content-Type", "application/json") - - resp, err := hc.Do(req) - if err != nil { - return nil, fmt.Errorf("impersonate: unable to generate access token: %v", err) - } - defer resp.Body.Close() - body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) - if err != nil { - return nil, fmt.Errorf("impersonate: unable to read body: %v", err) - } - if c := resp.StatusCode; c < 200 || c > 299 { - return nil, fmt.Errorf("impersonate: status code %d: %s", c, body) - } - - var accessTokenResp generateAccessTokenResp - if err := json.Unmarshal(body, &accessTokenResp); err != nil { - return nil, fmt.Errorf("impersonate: unable to parse response: %v", err) - } - expiry, err := time.Parse(time.RFC3339, accessTokenResp.ExpireTime) - if err != nil { - return nil, fmt.Errorf("impersonate: unable to parse expiry: %v", err) - } - return &oauth2.Token{ - AccessToken: accessTokenResp.AccessToken, - Expiry: expiry, - }, nil -} diff --git a/ibm/vendor/google.golang.org/api/internal/settings.go b/ibm/vendor/google.golang.org/api/internal/settings.go deleted file mode 100644 index 26259b82ab..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/settings.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2017 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package internal supports the options and transport packages. -package internal - -import ( - "crypto/tls" - "errors" - "net/http" - - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "google.golang.org/api/internal/impersonate" - "google.golang.org/grpc" -) - -// DialSettings holds information needed to establish a connection with a -// Google API service. -type DialSettings struct { - Endpoint string - DefaultEndpoint string - DefaultMTLSEndpoint string - Scopes []string - TokenSource oauth2.TokenSource - Credentials *google.Credentials - CredentialsFile string // if set, Token Source is ignored. - CredentialsJSON []byte - UserAgent string - APIKey string - Audiences []string - HTTPClient *http.Client - GRPCDialOpts []grpc.DialOption - GRPCConn *grpc.ClientConn - GRPCConnPool ConnPool - GRPCConnPoolSize int - NoAuth bool - TelemetryDisabled bool - ClientCertSource func(*tls.CertificateRequestInfo) (*tls.Certificate, error) - CustomClaims map[string]interface{} - SkipValidation bool - ImpersonationConfig *impersonate.Config - - // Google API system parameters. For more information please read: - // https://cloud.google.com/apis/docs/system-parameters - QuotaProject string - RequestReason string -} - -// Validate reports an error if ds is invalid. -func (ds *DialSettings) Validate() error { - if ds.SkipValidation { - return nil - } - hasCreds := ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "" || ds.Credentials != nil - if ds.NoAuth && hasCreds { - return errors.New("options.WithoutAuthentication is incompatible with any option that provides credentials") - } - // Credentials should not appear with other options. - // We currently allow TokenSource and CredentialsFile to coexist. - // TODO(jba): make TokenSource & CredentialsFile an error (breaking change). - nCreds := 0 - if ds.Credentials != nil { - nCreds++ - } - if ds.CredentialsJSON != nil { - nCreds++ - } - if ds.CredentialsFile != "" { - nCreds++ - } - if ds.APIKey != "" { - nCreds++ - } - if ds.TokenSource != nil { - nCreds++ - } - if len(ds.Scopes) > 0 && len(ds.Audiences) > 0 { - return errors.New("WithScopes is incompatible with WithAudience") - } - // Accept only one form of credentials, except we allow TokenSource and CredentialsFile for backwards compatibility. - if nCreds > 1 && !(nCreds == 2 && ds.TokenSource != nil && ds.CredentialsFile != "") { - return errors.New("multiple credential options provided") - } - if ds.GRPCConn != nil && ds.GRPCConnPool != nil { - return errors.New("WithGRPCConn is incompatible with WithConnPool") - } - if ds.HTTPClient != nil && ds.GRPCConnPool != nil { - return errors.New("WithHTTPClient is incompatible with WithConnPool") - } - if ds.HTTPClient != nil && ds.GRPCConn != nil { - return errors.New("WithHTTPClient is incompatible with WithGRPCConn") - } - if ds.HTTPClient != nil && ds.GRPCDialOpts != nil { - return errors.New("WithHTTPClient is incompatible with gRPC dial options") - } - if ds.HTTPClient != nil && ds.QuotaProject != "" { - return errors.New("WithHTTPClient is incompatible with QuotaProject") - } - if ds.HTTPClient != nil && ds.RequestReason != "" { - return errors.New("WithHTTPClient is incompatible with RequestReason") - } - if ds.HTTPClient != nil && ds.ClientCertSource != nil { - return errors.New("WithHTTPClient is incompatible with WithClientCertSource") - } - if ds.ClientCertSource != nil && (ds.GRPCConn != nil || ds.GRPCConnPool != nil || ds.GRPCConnPoolSize != 0 || ds.GRPCDialOpts != nil) { - return errors.New("WithClientCertSource is currently only supported for HTTP. gRPC settings are incompatible") - } - if ds.ImpersonationConfig != nil && len(ds.ImpersonationConfig.Scopes) == 0 && len(ds.Scopes) == 0 { - return errors.New("WithImpersonatedCredentials requires scopes being provided") - } - return nil -} diff --git a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/LICENSE b/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/LICENSE deleted file mode 100644 index 7109c6ef93..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Joshua Tacoma. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/METADATA b/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/METADATA deleted file mode 100644 index c7f86fcd5f..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/METADATA +++ /dev/null @@ -1,14 +0,0 @@ -name: "uritemplates" -description: - "Package uritemplates is a level 4 implementation of RFC 6570 (URI " - "Template, http://tools.ietf.org/html/rfc6570)." - -third_party { - url { - type: GIT - value: "https://github.com/jtacoma/uritemplates" - } - version: "0.1" - last_upgrade_date { year: 2014 month: 8 day: 18 } - license_type: NOTICE -} diff --git a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/uritemplates.go b/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/uritemplates.go deleted file mode 100644 index 8c27d19d75..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/uritemplates.go +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2013 Joshua Tacoma. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package uritemplates is a level 3 implementation of RFC 6570 (URI -// Template, http://tools.ietf.org/html/rfc6570). -// uritemplates does not support composite values (in Go: slices or maps) -// and so does not qualify as a level 4 implementation. -package uritemplates - -import ( - "bytes" - "errors" - "regexp" - "strconv" - "strings" -) - -var ( - unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]") - reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]") - validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$") - hex = []byte("0123456789ABCDEF") -) - -func pctEncode(src []byte) []byte { - dst := make([]byte, len(src)*3) - for i, b := range src { - buf := dst[i*3 : i*3+3] - buf[0] = 0x25 - buf[1] = hex[b/16] - buf[2] = hex[b%16] - } - return dst -} - -// pairWriter is a convenience struct which allows escaped and unescaped -// versions of the template to be written in parallel. -type pairWriter struct { - escaped, unescaped bytes.Buffer -} - -// Write writes the provided string directly without any escaping. -func (w *pairWriter) Write(s string) { - w.escaped.WriteString(s) - w.unescaped.WriteString(s) -} - -// Escape writes the provided string, escaping the string for the -// escaped output. -func (w *pairWriter) Escape(s string, allowReserved bool) { - w.unescaped.WriteString(s) - if allowReserved { - w.escaped.Write(reserved.ReplaceAllFunc([]byte(s), pctEncode)) - } else { - w.escaped.Write(unreserved.ReplaceAllFunc([]byte(s), pctEncode)) - } -} - -// Escaped returns the escaped string. -func (w *pairWriter) Escaped() string { - return w.escaped.String() -} - -// Unescaped returns the unescaped string. -func (w *pairWriter) Unescaped() string { - return w.unescaped.String() -} - -// A uriTemplate is a parsed representation of a URI template. -type uriTemplate struct { - raw string - parts []templatePart -} - -// parse parses a URI template string into a uriTemplate object. -func parse(rawTemplate string) (*uriTemplate, error) { - split := strings.Split(rawTemplate, "{") - parts := make([]templatePart, len(split)*2-1) - for i, s := range split { - if i == 0 { - if strings.Contains(s, "}") { - return nil, errors.New("unexpected }") - } - parts[i].raw = s - continue - } - subsplit := strings.Split(s, "}") - if len(subsplit) != 2 { - return nil, errors.New("malformed template") - } - expression := subsplit[0] - var err error - parts[i*2-1], err = parseExpression(expression) - if err != nil { - return nil, err - } - parts[i*2].raw = subsplit[1] - } - return &uriTemplate{ - raw: rawTemplate, - parts: parts, - }, nil -} - -type templatePart struct { - raw string - terms []templateTerm - first string - sep string - named bool - ifemp string - allowReserved bool -} - -type templateTerm struct { - name string - explode bool - truncate int -} - -func parseExpression(expression string) (result templatePart, err error) { - switch expression[0] { - case '+': - result.sep = "," - result.allowReserved = true - expression = expression[1:] - case '.': - result.first = "." - result.sep = "." - expression = expression[1:] - case '/': - result.first = "/" - result.sep = "/" - expression = expression[1:] - case ';': - result.first = ";" - result.sep = ";" - result.named = true - expression = expression[1:] - case '?': - result.first = "?" - result.sep = "&" - result.named = true - result.ifemp = "=" - expression = expression[1:] - case '&': - result.first = "&" - result.sep = "&" - result.named = true - result.ifemp = "=" - expression = expression[1:] - case '#': - result.first = "#" - result.sep = "," - result.allowReserved = true - expression = expression[1:] - default: - result.sep = "," - } - rawterms := strings.Split(expression, ",") - result.terms = make([]templateTerm, len(rawterms)) - for i, raw := range rawterms { - result.terms[i], err = parseTerm(raw) - if err != nil { - break - } - } - return result, err -} - -func parseTerm(term string) (result templateTerm, err error) { - // TODO(djd): Remove "*" suffix parsing once we check that no APIs have - // mistakenly used that attribute. - if strings.HasSuffix(term, "*") { - result.explode = true - term = term[:len(term)-1] - } - split := strings.Split(term, ":") - if len(split) == 1 { - result.name = term - } else if len(split) == 2 { - result.name = split[0] - var parsed int64 - parsed, err = strconv.ParseInt(split[1], 10, 0) - result.truncate = int(parsed) - } else { - err = errors.New("multiple colons in same term") - } - if !validname.MatchString(result.name) { - err = errors.New("not a valid name: " + result.name) - } - if result.explode && result.truncate > 0 { - err = errors.New("both explode and prefix modifiers on same term") - } - return result, err -} - -// Expand expands a URI template with a set of values to produce the -// resultant URI. Two forms of the result are returned: one with all the -// elements escaped, and one with the elements unescaped. -func (t *uriTemplate) Expand(values map[string]string) (escaped, unescaped string) { - var w pairWriter - for _, p := range t.parts { - p.expand(&w, values) - } - return w.Escaped(), w.Unescaped() -} - -func (tp *templatePart) expand(w *pairWriter, values map[string]string) { - if len(tp.raw) > 0 { - w.Write(tp.raw) - return - } - var first = true - for _, term := range tp.terms { - value, exists := values[term.name] - if !exists { - continue - } - if first { - w.Write(tp.first) - first = false - } else { - w.Write(tp.sep) - } - tp.expandString(w, term, value) - } -} - -func (tp *templatePart) expandName(w *pairWriter, name string, empty bool) { - if tp.named { - w.Write(name) - if empty { - w.Write(tp.ifemp) - } else { - w.Write("=") - } - } -} - -func (tp *templatePart) expandString(w *pairWriter, t templateTerm, s string) { - if len(s) > t.truncate && t.truncate > 0 { - s = s[:t.truncate] - } - tp.expandName(w, t.name, len(s) == 0) - w.Escape(s, tp.allowReserved) -} diff --git a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/utils.go b/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/utils.go deleted file mode 100644 index 2e70b81543..0000000000 --- a/ibm/vendor/google.golang.org/api/internal/third_party/uritemplates/utils.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uritemplates - -// Expand parses then expands a URI template with a set of values to produce -// the resultant URI. Two forms of the result are returned: one with all the -// elements escaped, and one with the elements unescaped. -func Expand(path string, values map[string]string) (escaped, unescaped string, err error) { - template, err := parse(path) - if err != nil { - return "", "", err - } - escaped, unescaped = template.Expand(values) - return escaped, unescaped, nil -} diff --git a/ibm/vendor/google.golang.org/api/iterator/iterator.go b/ibm/vendor/google.golang.org/api/iterator/iterator.go deleted file mode 100644 index 1799b5d9af..0000000000 --- a/ibm/vendor/google.golang.org/api/iterator/iterator.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2016 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package iterator provides support for standard Google API iterators. -// See https://github.com/GoogleCloudPlatform/gcloud-golang/wiki/Iterator-Guidelines. -package iterator - -import ( - "errors" - "fmt" - "reflect" -) - -// Done is returned by an iterator's Next method when the iteration is -// complete; when there are no more items to return. -var Done = errors.New("no more items in iterator") - -// We don't support mixed calls to Next and NextPage because they play -// with the paging state in incompatible ways. -var errMixed = errors.New("iterator: Next and NextPage called on same iterator") - -// PageInfo contains information about an iterator's paging state. -type PageInfo struct { - // Token is the token used to retrieve the next page of items from the - // API. You may set Token immediately after creating an iterator to - // begin iteration at a particular point. If Token is the empty string, - // the iterator will begin with the first eligible item. - // - // The result of setting Token after the first call to Next is undefined. - // - // After the underlying API method is called to retrieve a page of items, - // Token is set to the next-page token in the response. - Token string - - // MaxSize is the maximum number of items returned by a call to the API. - // Set MaxSize as a hint to optimize the buffering behavior of the iterator. - // If zero, the page size is determined by the underlying service. - // - // Use Pager to retrieve a page of a specific, exact size. - MaxSize int - - // The error state of the iterator. Manipulated by PageInfo.next and Pager. - // This is a latch: it starts as nil, and once set should never change. - err error - - // If true, no more calls to fetch should be made. Set to true when fetch - // returns an empty page token. The iterator is Done when this is true AND - // the buffer is empty. - atEnd bool - - // Function that fetches a page from the underlying service. It should pass - // the pageSize and pageToken arguments to the service, fill the buffer - // with the results from the call, and return the next-page token returned - // by the service. The function must not remove any existing items from the - // buffer. If the underlying RPC takes an int32 page size, pageSize should - // be silently truncated. - fetch func(pageSize int, pageToken string) (nextPageToken string, err error) - - // Function that returns the number of currently buffered items. - bufLen func() int - - // Function that returns the buffer, after setting the buffer variable to nil. - takeBuf func() interface{} - - // Set to true on first call to PageInfo.next or Pager.NextPage. Used to check - // for calls to both Next and NextPage with the same iterator. - nextCalled, nextPageCalled bool -} - -// NewPageInfo exposes internals for iterator implementations. -// It is not a stable interface. -var NewPageInfo = newPageInfo - -// newPageInfo creates and returns a PageInfo and a next func. If an iterator can -// support paging, its iterator-creating method should call this. Each time the -// iterator's Next is called, it should call the returned next fn to determine -// whether a next item exists, and if so it should pop an item from the buffer. -// -// The fetch, bufLen and takeBuf arguments provide access to the iterator's -// internal slice of buffered items. They behave as described in PageInfo, above. -// -// The return value is the PageInfo.next method bound to the returned PageInfo value. -// (Returning it avoids exporting PageInfo.next.) -// -// Note: the returned PageInfo and next fn do not remove items from the buffer. -// It is up to the iterator using these to remove items from the buffer: -// typically by performing a pop in its Next. If items are not removed from the -// buffer, memory may grow unbounded. -func newPageInfo(fetch func(int, string) (string, error), bufLen func() int, takeBuf func() interface{}) (pi *PageInfo, next func() error) { - pi = &PageInfo{ - fetch: fetch, - bufLen: bufLen, - takeBuf: takeBuf, - } - return pi, pi.next -} - -// Remaining returns the number of items available before the iterator makes another API call. -func (pi *PageInfo) Remaining() int { return pi.bufLen() } - -// next provides support for an iterator's Next function. An iterator's Next -// should return the error returned by next if non-nil; else it can assume -// there is at least one item in its buffer, and it should return that item and -// remove it from the buffer. -func (pi *PageInfo) next() error { - pi.nextCalled = true - if pi.err != nil { // Once we get an error, always return it. - // TODO(jba): fix so users can retry on transient errors? Probably not worth it. - return pi.err - } - if pi.nextPageCalled { - pi.err = errMixed - return pi.err - } - // Loop until we get some items or reach the end. - for pi.bufLen() == 0 && !pi.atEnd { - if err := pi.fill(pi.MaxSize); err != nil { - pi.err = err - return pi.err - } - if pi.Token == "" { - pi.atEnd = true - } - } - // Either the buffer is non-empty or pi.atEnd is true (or both). - if pi.bufLen() == 0 { - // The buffer is empty and pi.atEnd is true, i.e. the service has no - // more items. - pi.err = Done - } - return pi.err -} - -// Call the service to fill the buffer, using size and pi.Token. Set pi.Token to the -// next-page token returned by the call. -// If fill returns a non-nil error, the buffer will be empty. -func (pi *PageInfo) fill(size int) error { - tok, err := pi.fetch(size, pi.Token) - if err != nil { - pi.takeBuf() // clear the buffer - return err - } - pi.Token = tok - return nil -} - -// Pageable is implemented by iterators that support paging. -type Pageable interface { - // PageInfo returns paging information associated with the iterator. - PageInfo() *PageInfo -} - -// Pager supports retrieving iterator items a page at a time. -type Pager struct { - pageInfo *PageInfo - pageSize int -} - -// NewPager returns a pager that uses iter. Calls to its NextPage method will -// obtain exactly pageSize items, unless fewer remain. The pageToken argument -// indicates where to start the iteration. Pass the empty string to start at -// the beginning, or pass a token retrieved from a call to Pager.NextPage. -// -// If you use an iterator with a Pager, you must not call Next on the iterator. -func NewPager(iter Pageable, pageSize int, pageToken string) *Pager { - p := &Pager{ - pageInfo: iter.PageInfo(), - pageSize: pageSize, - } - p.pageInfo.Token = pageToken - if pageSize <= 0 { - p.pageInfo.err = errors.New("iterator: page size must be positive") - } - return p -} - -// NextPage retrieves a sequence of items from the iterator and appends them -// to slicep, which must be a pointer to a slice of the iterator's item type. -// Exactly p.pageSize items will be appended, unless fewer remain. -// -// The first return value is the page token to use for the next page of items. -// If empty, there are no more pages. Aside from checking for the end of the -// iteration, the returned page token is only needed if the iteration is to be -// resumed a later time, in another context (possibly another process). -// -// The second return value is non-nil if an error occurred. It will never be -// the special iterator sentinel value Done. To recognize the end of the -// iteration, compare nextPageToken to the empty string. -// -// It is possible for NextPage to return a single zero-length page along with -// an empty page token when there are no more items in the iteration. -func (p *Pager) NextPage(slicep interface{}) (nextPageToken string, err error) { - p.pageInfo.nextPageCalled = true - if p.pageInfo.err != nil { - return "", p.pageInfo.err - } - if p.pageInfo.nextCalled { - p.pageInfo.err = errMixed - return "", p.pageInfo.err - } - if p.pageInfo.bufLen() > 0 { - return "", errors.New("must call NextPage with an empty buffer") - } - // The buffer must be empty here, so takeBuf is a no-op. We call it just to get - // the buffer's type. - wantSliceType := reflect.PtrTo(reflect.ValueOf(p.pageInfo.takeBuf()).Type()) - if slicep == nil { - return "", errors.New("nil passed to Pager.NextPage") - } - vslicep := reflect.ValueOf(slicep) - if vslicep.Type() != wantSliceType { - return "", fmt.Errorf("slicep should be of type %s, got %T", wantSliceType, slicep) - } - for p.pageInfo.bufLen() < p.pageSize { - if err := p.pageInfo.fill(p.pageSize - p.pageInfo.bufLen()); err != nil { - p.pageInfo.err = err - return "", p.pageInfo.err - } - if p.pageInfo.Token == "" { - break - } - } - e := vslicep.Elem() - e.Set(reflect.AppendSlice(e, reflect.ValueOf(p.pageInfo.takeBuf()))) - return p.pageInfo.Token, nil -} diff --git a/ibm/vendor/google.golang.org/api/option/credentials_go19.go b/ibm/vendor/google.golang.org/api/option/credentials_go19.go deleted file mode 100644 index d06f918b0e..0000000000 --- a/ibm/vendor/google.golang.org/api/option/credentials_go19.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.9 - -package option - -import ( - "golang.org/x/oauth2/google" - "google.golang.org/api/internal" -) - -type withCreds google.Credentials - -func (w *withCreds) Apply(o *internal.DialSettings) { - o.Credentials = (*google.Credentials)(w) -} - -// WithCredentials returns a ClientOption that authenticates API calls. -func WithCredentials(creds *google.Credentials) ClientOption { - return (*withCreds)(creds) -} diff --git a/ibm/vendor/google.golang.org/api/option/credentials_notgo19.go b/ibm/vendor/google.golang.org/api/option/credentials_notgo19.go deleted file mode 100644 index 0ce107a624..0000000000 --- a/ibm/vendor/google.golang.org/api/option/credentials_notgo19.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.9 - -package option - -import ( - "golang.org/x/oauth2/google" - "google.golang.org/api/internal" -) - -type withCreds google.DefaultCredentials - -func (w *withCreds) Apply(o *internal.DialSettings) { - o.Credentials = (*google.DefaultCredentials)(w) -} - -func WithCredentials(creds *google.DefaultCredentials) ClientOption { - return (*withCreds)(creds) -} diff --git a/ibm/vendor/google.golang.org/api/option/internaloption/internaloption.go b/ibm/vendor/google.golang.org/api/option/internaloption/internaloption.go deleted file mode 100644 index b4d78a830a..0000000000 --- a/ibm/vendor/google.golang.org/api/option/internaloption/internaloption.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package internaloption contains options used internally by Google client code. -package internaloption - -import ( - "google.golang.org/api/internal" - "google.golang.org/api/option" -) - -type defaultEndpointOption string - -func (o defaultEndpointOption) Apply(settings *internal.DialSettings) { - settings.DefaultEndpoint = string(o) -} - -// WithDefaultEndpoint is an option that indicates the default endpoint. -// -// It should only be used internally by generated clients. -// -// This is similar to WithEndpoint, but allows us to determine whether the user has overridden the default endpoint. -func WithDefaultEndpoint(url string) option.ClientOption { - return defaultEndpointOption(url) -} - -type defaultMTLSEndpointOption string - -func (o defaultMTLSEndpointOption) Apply(settings *internal.DialSettings) { - settings.DefaultMTLSEndpoint = string(o) -} - -// WithDefaultMTLSEndpoint is an option that indicates the default mTLS endpoint. -// -// It should only be used internally by generated clients. -func WithDefaultMTLSEndpoint(url string) option.ClientOption { - return defaultMTLSEndpointOption(url) -} - -// SkipDialSettingsValidation bypasses validation on ClientOptions. -// -// It should only be used internally. -func SkipDialSettingsValidation() option.ClientOption { - return skipDialSettingsValidation{} -} - -type skipDialSettingsValidation struct{} - -func (s skipDialSettingsValidation) Apply(settings *internal.DialSettings) { - settings.SkipValidation = true -} diff --git a/ibm/vendor/google.golang.org/api/option/option.go b/ibm/vendor/google.golang.org/api/option/option.go deleted file mode 100644 index 686476f9cb..0000000000 --- a/ibm/vendor/google.golang.org/api/option/option.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2017 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package option contains options for Google API clients. -package option - -import ( - "crypto/tls" - "net/http" - - "golang.org/x/oauth2" - "google.golang.org/api/internal" - "google.golang.org/api/internal/impersonate" - "google.golang.org/grpc" -) - -// A ClientOption is an option for a Google API client. -type ClientOption interface { - Apply(*internal.DialSettings) -} - -// WithTokenSource returns a ClientOption that specifies an OAuth2 token -// source to be used as the basis for authentication. -func WithTokenSource(s oauth2.TokenSource) ClientOption { - return withTokenSource{s} -} - -type withTokenSource struct{ ts oauth2.TokenSource } - -func (w withTokenSource) Apply(o *internal.DialSettings) { - o.TokenSource = w.ts -} - -type withCredFile string - -func (w withCredFile) Apply(o *internal.DialSettings) { - o.CredentialsFile = string(w) -} - -// WithCredentialsFile returns a ClientOption that authenticates -// API calls with the given service account or refresh token JSON -// credentials file. -func WithCredentialsFile(filename string) ClientOption { - return withCredFile(filename) -} - -// WithServiceAccountFile returns a ClientOption that uses a Google service -// account credentials file to authenticate. -// -// Deprecated: Use WithCredentialsFile instead. -func WithServiceAccountFile(filename string) ClientOption { - return WithCredentialsFile(filename) -} - -// WithCredentialsJSON returns a ClientOption that authenticates -// API calls with the given service account or refresh token JSON -// credentials. -func WithCredentialsJSON(p []byte) ClientOption { - return withCredentialsJSON(p) -} - -type withCredentialsJSON []byte - -func (w withCredentialsJSON) Apply(o *internal.DialSettings) { - o.CredentialsJSON = make([]byte, len(w)) - copy(o.CredentialsJSON, w) -} - -// WithEndpoint returns a ClientOption that overrides the default endpoint -// to be used for a service. -func WithEndpoint(url string) ClientOption { - return withEndpoint(url) -} - -type withEndpoint string - -func (w withEndpoint) Apply(o *internal.DialSettings) { - o.Endpoint = string(w) -} - -// WithScopes returns a ClientOption that overrides the default OAuth2 scopes -// to be used for a service. -func WithScopes(scope ...string) ClientOption { - return withScopes(scope) -} - -type withScopes []string - -func (w withScopes) Apply(o *internal.DialSettings) { - o.Scopes = make([]string, len(w)) - copy(o.Scopes, w) -} - -// WithUserAgent returns a ClientOption that sets the User-Agent. -func WithUserAgent(ua string) ClientOption { - return withUA(ua) -} - -type withUA string - -func (w withUA) Apply(o *internal.DialSettings) { o.UserAgent = string(w) } - -// WithHTTPClient returns a ClientOption that specifies the HTTP client to use -// as the basis of communications. This option may only be used with services -// that support HTTP as their communication transport. When used, the -// WithHTTPClient option takes precedent over all other supplied options. -func WithHTTPClient(client *http.Client) ClientOption { - return withHTTPClient{client} -} - -type withHTTPClient struct{ client *http.Client } - -func (w withHTTPClient) Apply(o *internal.DialSettings) { - o.HTTPClient = w.client -} - -// WithGRPCConn returns a ClientOption that specifies the gRPC client -// connection to use as the basis of communications. This option may only be -// used with services that support gRPC as their communication transport. When -// used, the WithGRPCConn option takes precedent over all other supplied -// options. -func WithGRPCConn(conn *grpc.ClientConn) ClientOption { - return withGRPCConn{conn} -} - -type withGRPCConn struct{ conn *grpc.ClientConn } - -func (w withGRPCConn) Apply(o *internal.DialSettings) { - o.GRPCConn = w.conn -} - -// WithGRPCDialOption returns a ClientOption that appends a new grpc.DialOption -// to an underlying gRPC dial. It does not work with WithGRPCConn. -func WithGRPCDialOption(opt grpc.DialOption) ClientOption { - return withGRPCDialOption{opt} -} - -type withGRPCDialOption struct{ opt grpc.DialOption } - -func (w withGRPCDialOption) Apply(o *internal.DialSettings) { - o.GRPCDialOpts = append(o.GRPCDialOpts, w.opt) -} - -// WithGRPCConnectionPool returns a ClientOption that creates a pool of gRPC -// connections that requests will be balanced between. -// -// This is an EXPERIMENTAL API and may be changed or removed in the future. -func WithGRPCConnectionPool(size int) ClientOption { - return withGRPCConnectionPool(size) -} - -type withGRPCConnectionPool int - -func (w withGRPCConnectionPool) Apply(o *internal.DialSettings) { - o.GRPCConnPoolSize = int(w) -} - -// WithAPIKey returns a ClientOption that specifies an API key to be used -// as the basis for authentication. -// -// API Keys can only be used for JSON-over-HTTP APIs, including those under -// the import path google.golang.org/api/.... -func WithAPIKey(apiKey string) ClientOption { - return withAPIKey(apiKey) -} - -type withAPIKey string - -func (w withAPIKey) Apply(o *internal.DialSettings) { o.APIKey = string(w) } - -// WithAudiences returns a ClientOption that specifies an audience to be used -// as the audience field ("aud") for the JWT token authentication. -func WithAudiences(audience ...string) ClientOption { - return withAudiences(audience) -} - -type withAudiences []string - -func (w withAudiences) Apply(o *internal.DialSettings) { - o.Audiences = make([]string, len(w)) - copy(o.Audiences, w) -} - -// WithoutAuthentication returns a ClientOption that specifies that no -// authentication should be used. It is suitable only for testing and for -// accessing public resources, like public Google Cloud Storage buckets. -// It is an error to provide both WithoutAuthentication and any of WithAPIKey, -// WithTokenSource, WithCredentialsFile or WithServiceAccountFile. -func WithoutAuthentication() ClientOption { - return withoutAuthentication{} -} - -type withoutAuthentication struct{} - -func (w withoutAuthentication) Apply(o *internal.DialSettings) { o.NoAuth = true } - -// WithQuotaProject returns a ClientOption that specifies the project used -// for quota and billing purposes. -// -// For more information please read: -// https://cloud.google.com/apis/docs/system-parameters -func WithQuotaProject(quotaProject string) ClientOption { - return withQuotaProject(quotaProject) -} - -type withQuotaProject string - -func (w withQuotaProject) Apply(o *internal.DialSettings) { - o.QuotaProject = string(w) -} - -// WithRequestReason returns a ClientOption that specifies a reason for -// making the request, which is intended to be recorded in audit logging. -// An example reason would be a support-case ticket number. -// -// For more information please read: -// https://cloud.google.com/apis/docs/system-parameters -func WithRequestReason(requestReason string) ClientOption { - return withRequestReason(requestReason) -} - -type withRequestReason string - -func (w withRequestReason) Apply(o *internal.DialSettings) { - o.RequestReason = string(w) -} - -// WithTelemetryDisabled returns a ClientOption that disables default telemetry (OpenCensus) -// settings on gRPC and HTTP clients. -// An example reason would be to bind custom telemetry that overrides the defaults. -func WithTelemetryDisabled() ClientOption { - return withTelemetryDisabled{} -} - -type withTelemetryDisabled struct{} - -func (w withTelemetryDisabled) Apply(o *internal.DialSettings) { - o.TelemetryDisabled = true -} - -// ClientCertSource is a function that returns a TLS client certificate to be used -// when opening TLS connections. -// -// It follows the same semantics as crypto/tls.Config.GetClientCertificate. -// -// This is an EXPERIMENTAL API and may be changed or removed in the future. -type ClientCertSource = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) - -// WithClientCertSource returns a ClientOption that specifies a -// callback function for obtaining a TLS client certificate. -// -// This option is used for supporting mTLS authentication, where the -// server validates the client certifcate when establishing a connection. -// -// The callback function will be invoked whenever the server requests a -// certificate from the client. Implementations of the callback function -// should try to ensure that a valid certificate can be repeatedly returned -// on demand for the entire life cycle of the transport client. If a nil -// Certificate is returned (i.e. no Certificate can be obtained), an error -// should be returned. -// -// This is an EXPERIMENTAL API and may be changed or removed in the future. -func WithClientCertSource(s ClientCertSource) ClientOption { - return withClientCertSource{s} -} - -type withClientCertSource struct{ s ClientCertSource } - -func (w withClientCertSource) Apply(o *internal.DialSettings) { - o.ClientCertSource = w.s -} - -// ImpersonateCredentials returns a ClientOption that will impersonate the -// target service account. -// -// In order to impersonate the target service account -// the base service account must have the Service Account Token Creator role, -// roles/iam.serviceAccountTokenCreator, on the target service account. -// See https://cloud.google.com/iam/docs/understanding-service-accounts. -// -// Optionally, delegates can be used during impersonation if the base service -// account lacks the token creator role on the target. When using delegates, -// each service account must be granted roles/iam.serviceAccountTokenCreator -// on the next service account in the chain. -// -// For example, if a base service account of SA1 is trying to impersonate target -// service account SA2 while using delegate service accounts DSA1 and DSA2, -// the following must be true: -// -// 1. Base service account SA1 has roles/iam.serviceAccountTokenCreator on -// DSA1. -// 2. DSA1 has roles/iam.serviceAccountTokenCreator on DSA2. -// 3. DSA2 has roles/iam.serviceAccountTokenCreator on target SA2. -// -// The resulting impersonated credential will either have the default scopes of -// the client being instantiating or the scopes from WithScopes if provided. -// Scopes are required for creating impersonated credentials, so if this option -// is used while not using a NewClient/NewService function, WithScopes must also -// be explicitly passed in as well. -// -// If the base credential is an authorized user and not a service account, or if -// the option WithQuotaProject is set, the target service account must have a -// role that grants the serviceusage.services.use permission such as -// roles/serviceusage.serviceUsageConsumer. -// -// This is an EXPERIMENTAL API and may be changed or removed in the future. -func ImpersonateCredentials(target string, delegates ...string) ClientOption { - return impersonateServiceAccount{ - target: target, - delegates: delegates, - } -} - -type impersonateServiceAccount struct { - target string - delegates []string -} - -func (i impersonateServiceAccount) Apply(o *internal.DialSettings) { - o.ImpersonationConfig = &impersonate.Config{ - Target: i.target, - } - o.ImpersonationConfig.Delegates = make([]string, len(i.delegates)) - copy(o.ImpersonationConfig.Delegates, i.delegates) -} diff --git a/ibm/vendor/google.golang.org/api/storage/v1/storage-api.json b/ibm/vendor/google.golang.org/api/storage/v1/storage-api.json deleted file mode 100644 index 1e076ab66d..0000000000 --- a/ibm/vendor/google.golang.org/api/storage/v1/storage-api.json +++ /dev/null @@ -1,4455 +0,0 @@ -{ - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/devstorage.full_control": { - "description": "Manage your data and permissions in Google Cloud Storage" - }, - "https://www.googleapis.com/auth/devstorage.read_only": { - "description": "View your data in Google Cloud Storage" - }, - "https://www.googleapis.com/auth/devstorage.read_write": { - "description": "Manage your data in Google Cloud Storage" - } - } - } - }, - "basePath": "/storage/v1/", - "baseUrl": "https://storage.googleapis.com/storage/v1/", - "batchPath": "batch/storage/v1", - "description": "Stores and retrieves potentially large, immutable data objects.", - "discoveryVersion": "v1", - "documentationLink": "https://developers.google.com/storage/docs/json_api/", - "etag": "\"3133373531323239383338313531333236393038\"", - "icons": { - "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", - "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" - }, - "id": "storage:v1", - "kind": "discovery#restDescription", - "labels": [ - "labs" - ], - "name": "storage", - "ownerDomain": "google.com", - "ownerName": "Google", - "parameters": { - "alt": { - "default": "json", - "description": "Data format for the response.", - "enum": [ - "json" - ], - "enumDescriptions": [ - "Responses with Content-Type of application/json" - ], - "location": "query", - "type": "string" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "location": "query", - "type": "string" - }, - "key": { - "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", - "location": "query", - "type": "string" - }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "location": "query", - "type": "string" - }, - "prettyPrint": { - "default": "true", - "description": "Returns response with indentations and line breaks.", - "location": "query", - "type": "boolean" - }, - "quotaUser": { - "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", - "location": "query", - "type": "string" - }, - "userIp": { - "description": "Deprecated. Please use quotaUser instead.", - "location": "query", - "type": "string" - } - }, - "protocol": "rest", - "resources": { - "bucketAccessControls": { - "methods": { - "delete": { - "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", - "httpMethod": "DELETE", - "id": "storage.bucketAccessControls.delete", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/acl/{entity}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "description": "Returns the ACL entry for the specified entity on the specified bucket.", - "httpMethod": "GET", - "id": "storage.bucketAccessControls.get", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/acl/{entity}", - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "description": "Creates a new ACL entry on the specified bucket.", - "httpMethod": "POST", - "id": "storage.bucketAccessControls.insert", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/acl", - "request": { - "$ref": "BucketAccessControl" - }, - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "description": "Retrieves ACL entries on the specified bucket.", - "httpMethod": "GET", - "id": "storage.bucketAccessControls.list", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/acl", - "response": { - "$ref": "BucketAccessControls" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "description": "Patches an ACL entry on the specified bucket.", - "httpMethod": "PATCH", - "id": "storage.bucketAccessControls.patch", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/acl/{entity}", - "request": { - "$ref": "BucketAccessControl" - }, - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "description": "Updates an ACL entry on the specified bucket.", - "httpMethod": "PUT", - "id": "storage.bucketAccessControls.update", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/acl/{entity}", - "request": { - "$ref": "BucketAccessControl" - }, - "response": { - "$ref": "BucketAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "buckets": { - "methods": { - "delete": { - "description": "Permanently deletes an empty bucket.", - "httpMethod": "DELETE", - "id": "storage.buckets.delete", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "If set, only deletes the bucket if its metageneration matches this value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "If set, only deletes the bucket if its metageneration does not match this value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "description": "Returns metadata for the specified bucket.", - "httpMethod": "GET", - "id": "storage.buckets.get", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}", - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "getIamPolicy": { - "description": "Returns an IAM policy for the specified bucket.", - "httpMethod": "GET", - "id": "storage.buckets.getIamPolicy", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "optionsRequestedPolicyVersion": { - "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", - "format": "int32", - "location": "query", - "minimum": "1", - "type": "integer" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/iam", - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "description": "Creates a new bucket.", - "httpMethod": "POST", - "id": "storage.buckets.insert", - "parameterOrder": [ - "project" - ], - "parameters": { - "predefinedAcl": { - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query", - "type": "string" - }, - "predefinedDefaultObjectAcl": { - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "project": { - "description": "A valid API project identifier.", - "location": "query", - "required": true, - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "b", - "request": { - "$ref": "Bucket" - }, - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "description": "Retrieves a list of buckets for a given project.", - "httpMethod": "GET", - "id": "storage.buckets.list", - "parameterOrder": [ - "project" - ], - "parameters": { - "maxResults": { - "default": "1000", - "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", - "format": "uint32", - "location": "query", - "minimum": "0", - "type": "integer" - }, - "pageToken": { - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query", - "type": "string" - }, - "prefix": { - "description": "Filter results to buckets whose names begin with this prefix.", - "location": "query", - "type": "string" - }, - "project": { - "description": "A valid API project identifier.", - "location": "query", - "required": true, - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "b", - "response": { - "$ref": "Buckets" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "lockRetentionPolicy": { - "description": "Locks retention policy on a bucket.", - "httpMethod": "POST", - "id": "storage.buckets.lockRetentionPolicy", - "parameterOrder": [ - "bucket", - "ifMetagenerationMatch" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/lockRetentionPolicy", - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "patch": { - "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - "httpMethod": "PATCH", - "id": "storage.buckets.patch", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "predefinedAcl": { - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query", - "type": "string" - }, - "predefinedDefaultObjectAcl": { - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}", - "request": { - "$ref": "Bucket" - }, - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "setIamPolicy": { - "description": "Updates an IAM policy for the specified bucket.", - "httpMethod": "PUT", - "id": "storage.buckets.setIamPolicy", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/iam", - "request": { - "$ref": "Policy" - }, - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "testIamPermissions": { - "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", - "httpMethod": "GET", - "id": "storage.buckets.testIamPermissions", - "parameterOrder": [ - "bucket", - "permissions" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "permissions": { - "description": "Permissions to test.", - "location": "query", - "repeated": true, - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/iam/testPermissions", - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "update": { - "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - "httpMethod": "PUT", - "id": "storage.buckets.update", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "predefinedAcl": { - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query", - "type": "string" - }, - "predefinedDefaultObjectAcl": { - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}", - "request": { - "$ref": "Bucket" - }, - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "channels": { - "methods": { - "stop": { - "description": "Stop watching resources through this channel", - "httpMethod": "POST", - "id": "storage.channels.stop", - "path": "channels/stop", - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "defaultObjectAccessControls": { - "methods": { - "delete": { - "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", - "httpMethod": "DELETE", - "id": "storage.defaultObjectAccessControls.delete", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", - "httpMethod": "GET", - "id": "storage.defaultObjectAccessControls.get", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "description": "Creates a new default object ACL entry on the specified bucket.", - "httpMethod": "POST", - "id": "storage.defaultObjectAccessControls.insert", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/defaultObjectAcl", - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "description": "Retrieves default object ACL entries on the specified bucket.", - "httpMethod": "GET", - "id": "storage.defaultObjectAccessControls.list", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/defaultObjectAcl", - "response": { - "$ref": "ObjectAccessControls" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "description": "Patches a default object ACL entry on the specified bucket.", - "httpMethod": "PATCH", - "id": "storage.defaultObjectAccessControls.patch", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "description": "Updates a default object ACL entry on the specified bucket.", - "httpMethod": "PUT", - "id": "storage.defaultObjectAccessControls.update", - "parameterOrder": [ - "bucket", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "notifications": { - "methods": { - "delete": { - "description": "Permanently deletes a notification subscription.", - "httpMethod": "DELETE", - "id": "storage.notifications.delete", - "parameterOrder": [ - "bucket", - "notification" - ], - "parameters": { - "bucket": { - "description": "The parent bucket of the notification.", - "location": "path", - "required": true, - "type": "string" - }, - "notification": { - "description": "ID of the notification to delete.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/notificationConfigs/{notification}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "description": "View a notification configuration.", - "httpMethod": "GET", - "id": "storage.notifications.get", - "parameterOrder": [ - "bucket", - "notification" - ], - "parameters": { - "bucket": { - "description": "The parent bucket of the notification.", - "location": "path", - "required": true, - "type": "string" - }, - "notification": { - "description": "Notification ID", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/notificationConfigs/{notification}", - "response": { - "$ref": "Notification" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "insert": { - "description": "Creates a notification subscription for a given bucket.", - "httpMethod": "POST", - "id": "storage.notifications.insert", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "The parent bucket of the notification.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/notificationConfigs", - "request": { - "$ref": "Notification" - }, - "response": { - "$ref": "Notification" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "description": "Retrieves a list of notification subscriptions for a given bucket.", - "httpMethod": "GET", - "id": "storage.notifications.list", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of a Google Cloud Storage bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/notificationConfigs", - "response": { - "$ref": "Notifications" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "objectAccessControls": { - "methods": { - "delete": { - "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", - "httpMethod": "DELETE", - "id": "storage.objectAccessControls.delete", - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/acl/{entity}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "description": "Returns the ACL entry for the specified entity on the specified object.", - "httpMethod": "GET", - "id": "storage.objectAccessControls.get", - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/acl/{entity}", - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "description": "Creates a new ACL entry on the specified object.", - "httpMethod": "POST", - "id": "storage.objectAccessControls.insert", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/acl", - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "description": "Retrieves ACL entries on the specified object.", - "httpMethod": "GET", - "id": "storage.objectAccessControls.list", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/acl", - "response": { - "$ref": "ObjectAccessControls" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "description": "Patches an ACL entry on the specified object.", - "httpMethod": "PATCH", - "id": "storage.objectAccessControls.patch", - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/acl/{entity}", - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "description": "Updates an ACL entry on the specified object.", - "httpMethod": "PUT", - "id": "storage.objectAccessControls.update", - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "parameters": { - "bucket": { - "description": "Name of a bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "entity": { - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/acl/{entity}", - "request": { - "$ref": "ObjectAccessControl" - }, - "response": { - "$ref": "ObjectAccessControl" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "objects": { - "methods": { - "compose": { - "description": "Concatenates a list of existing objects into a new object in the same bucket.", - "httpMethod": "POST", - "id": "storage.objects.compose", - "parameterOrder": [ - "destinationBucket", - "destinationObject" - ], - "parameters": { - "destinationBucket": { - "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", - "location": "path", - "required": true, - "type": "string" - }, - "destinationObject": { - "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "destinationPredefinedAcl": { - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "kmsKeyName": { - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{destinationBucket}/o/{destinationObject}/compose", - "request": { - "$ref": "ComposeRequest" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "copy": { - "description": "Copies a source object to a destination object. Optionally overrides metadata.", - "httpMethod": "POST", - "id": "storage.objects.copy", - "parameterOrder": [ - "sourceBucket", - "sourceObject", - "destinationBucket", - "destinationObject" - ], - "parameters": { - "destinationBucket": { - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "destinationKmsKeyName": { - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query", - "type": "string" - }, - "destinationObject": { - "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", - "location": "path", - "required": true, - "type": "string" - }, - "destinationPredefinedAcl": { - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceGenerationMatch": { - "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceGenerationNotMatch": { - "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceMetagenerationMatch": { - "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "sourceBucket": { - "description": "Name of the bucket in which to find the source object.", - "location": "path", - "required": true, - "type": "string" - }, - "sourceGeneration": { - "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "sourceObject": { - "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "delete": { - "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", - "httpMethod": "DELETE", - "id": "storage.objects.delete", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "description": "Retrieves an object or its metadata.", - "httpMethod": "GET", - "id": "storage.objects.get", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}", - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - }, - "getIamPolicy": { - "description": "Returns an IAM policy for the specified object.", - "httpMethod": "GET", - "id": "storage.objects.getIamPolicy", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/iam", - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "insert": { - "description": "Stores a new object and metadata.", - "httpMethod": "POST", - "id": "storage.objects.insert", - "mediaUpload": { - "accept": [ - "*/*" - ], - "protocols": { - "resumable": { - "multipart": true, - "path": "/resumable/upload/storage/v1/b/{bucket}/o" - }, - "simple": { - "multipart": true, - "path": "/upload/storage/v1/b/{bucket}/o" - } - } - }, - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - "location": "path", - "required": true, - "type": "string" - }, - "contentEncoding": { - "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "kmsKeyName": { - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query", - "type": "string" - }, - "name": { - "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "query", - "type": "string" - }, - "predefinedAcl": { - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o", - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaUpload": true - }, - "list": { - "description": "Retrieves a list of objects matching the criteria.", - "httpMethod": "GET", - "id": "storage.objects.list", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which to look for objects.", - "location": "path", - "required": true, - "type": "string" - }, - "delimiter": { - "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - "location": "query", - "type": "string" - }, - "endOffset": { - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query", - "type": "string" - }, - "includeTrailingDelimiter": { - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query", - "type": "boolean" - }, - "maxResults": { - "default": "1000", - "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - "format": "uint32", - "location": "query", - "minimum": "0", - "type": "integer" - }, - "pageToken": { - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query", - "type": "string" - }, - "prefix": { - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "startOffset": { - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - }, - "versions": { - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - "location": "query", - "type": "boolean" - } - }, - "path": "b/{bucket}/o", - "response": { - "$ref": "Objects" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true - }, - "patch": { - "description": "Patches an object's metadata.", - "httpMethod": "PATCH", - "id": "storage.objects.patch", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "predefinedAcl": { - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request, for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}", - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "rewrite": { - "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", - "httpMethod": "POST", - "id": "storage.objects.rewrite", - "parameterOrder": [ - "sourceBucket", - "sourceObject", - "destinationBucket", - "destinationObject" - ], - "parameters": { - "destinationBucket": { - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - "location": "path", - "required": true, - "type": "string" - }, - "destinationKmsKeyName": { - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query", - "type": "string" - }, - "destinationObject": { - "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "destinationPredefinedAcl": { - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceGenerationMatch": { - "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceGenerationNotMatch": { - "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceMetagenerationMatch": { - "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifSourceMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "maxBytesRewrittenPerCall": { - "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", - "format": "int64", - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "rewriteToken": { - "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", - "location": "query", - "type": "string" - }, - "sourceBucket": { - "description": "Name of the bucket in which to find the source object.", - "location": "path", - "required": true, - "type": "string" - }, - "sourceGeneration": { - "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "sourceObject": { - "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "RewriteResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "setIamPolicy": { - "description": "Updates an IAM policy for the specified object.", - "httpMethod": "PUT", - "id": "storage.objects.setIamPolicy", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/iam", - "request": { - "$ref": "Policy" - }, - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "testIamPermissions": { - "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", - "httpMethod": "GET", - "id": "storage.objects.testIamPermissions", - "parameterOrder": [ - "bucket", - "object", - "permissions" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "permissions": { - "description": "Permissions to test.", - "location": "query", - "repeated": true, - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}/iam/testPermissions", - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "update": { - "description": "Updates an object's metadata.", - "httpMethod": "PUT", - "id": "storage.objects.update", - "parameterOrder": [ - "bucket", - "object" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which the object resides.", - "location": "path", - "required": true, - "type": "string" - }, - "generation": { - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationMatch": { - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifGenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "ifMetagenerationNotMatch": { - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query", - "type": "string" - }, - "object": { - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "path", - "required": true, - "type": "string" - }, - "predefinedAcl": { - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - } - }, - "path": "b/{bucket}/o/{object}", - "request": { - "$ref": "Object" - }, - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "watchAll": { - "description": "Watch for changes on all objects in a bucket.", - "httpMethod": "POST", - "id": "storage.objects.watchAll", - "parameterOrder": [ - "bucket" - ], - "parameters": { - "bucket": { - "description": "Name of the bucket in which to look for objects.", - "location": "path", - "required": true, - "type": "string" - }, - "delimiter": { - "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - "location": "query", - "type": "string" - }, - "endOffset": { - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query", - "type": "string" - }, - "includeTrailingDelimiter": { - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query", - "type": "boolean" - }, - "maxResults": { - "default": "1000", - "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - "format": "uint32", - "location": "query", - "minimum": "0", - "type": "integer" - }, - "pageToken": { - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query", - "type": "string" - }, - "prefix": { - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query", - "type": "string" - }, - "projection": { - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query", - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "startOffset": { - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query", - "type": "string" - }, - "versions": { - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - "location": "query", - "type": "boolean" - } - }, - "path": "b/{bucket}/o/watch", - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "response": { - "$ref": "Channel" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true - } - } - }, - "projects": { - "resources": { - "hmacKeys": { - "methods": { - "create": { - "description": "Creates a new HMAC key for the specified service account.", - "httpMethod": "POST", - "id": "storage.projects.hmacKeys.create", - "parameterOrder": [ - "projectId", - "serviceAccountEmail" - ], - "parameters": { - "projectId": { - "description": "Project ID owning the service account.", - "location": "path", - "required": true, - "type": "string" - }, - "serviceAccountEmail": { - "description": "Email address of the service account.", - "location": "query", - "required": true, - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "projects/{projectId}/hmacKeys", - "response": { - "$ref": "HmacKey" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "delete": { - "description": "Deletes an HMAC key.", - "httpMethod": "DELETE", - "id": "storage.projects.hmacKeys.delete", - "parameterOrder": [ - "projectId", - "accessId" - ], - "parameters": { - "accessId": { - "description": "Name of the HMAC key to be deleted.", - "location": "path", - "required": true, - "type": "string" - }, - "projectId": { - "description": "Project ID owning the requested key", - "location": "path", - "required": true, - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "projects/{projectId}/hmacKeys/{accessId}", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "description": "Retrieves an HMAC key's metadata", - "httpMethod": "GET", - "id": "storage.projects.hmacKeys.get", - "parameterOrder": [ - "projectId", - "accessId" - ], - "parameters": { - "accessId": { - "description": "Name of the HMAC key.", - "location": "path", - "required": true, - "type": "string" - }, - "projectId": { - "description": "Project ID owning the service account of the requested key.", - "location": "path", - "required": true, - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "projects/{projectId}/hmacKeys/{accessId}", - "response": { - "$ref": "HmacKeyMetadata" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only" - ] - }, - "list": { - "description": "Retrieves a list of HMAC keys matching the criteria.", - "httpMethod": "GET", - "id": "storage.projects.hmacKeys.list", - "parameterOrder": [ - "projectId" - ], - "parameters": { - "maxResults": { - "default": "250", - "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", - "format": "uint32", - "location": "query", - "minimum": "0", - "type": "integer" - }, - "pageToken": { - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query", - "type": "string" - }, - "projectId": { - "description": "Name of the project in which to look for HMAC keys.", - "location": "path", - "required": true, - "type": "string" - }, - "serviceAccountEmail": { - "description": "If present, only keys for the given service account are returned.", - "location": "query", - "type": "string" - }, - "showDeletedKeys": { - "description": "Whether or not to show keys in the DELETED state.", - "location": "query", - "type": "boolean" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "projects/{projectId}/hmacKeys", - "response": { - "$ref": "HmacKeysMetadata" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only" - ] - }, - "update": { - "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", - "httpMethod": "PUT", - "id": "storage.projects.hmacKeys.update", - "parameterOrder": [ - "projectId", - "accessId" - ], - "parameters": { - "accessId": { - "description": "Name of the HMAC key being updated.", - "location": "path", - "required": true, - "type": "string" - }, - "projectId": { - "description": "Project ID owning the service account of the updated key.", - "location": "path", - "required": true, - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "projects/{projectId}/hmacKeys/{accessId}", - "request": { - "$ref": "HmacKeyMetadata" - }, - "response": { - "$ref": "HmacKeyMetadata" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "serviceAccount": { - "methods": { - "get": { - "description": "Get the email address of this project's Google Cloud Storage service account.", - "httpMethod": "GET", - "id": "storage.projects.serviceAccount.get", - "parameterOrder": [ - "projectId" - ], - "parameters": { - "projectId": { - "description": "Project ID", - "location": "path", - "required": true, - "type": "string" - }, - "provisionalUserProject": { - "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - "location": "query", - "type": "string" - }, - "userProject": { - "description": "The project to be billed for this request.", - "location": "query", - "type": "string" - } - }, - "path": "projects/{projectId}/serviceAccount", - "response": { - "$ref": "ServiceAccount" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - } - } - } - }, - "revision": "20200927", - "rootUrl": "https://storage.googleapis.com/", - "schemas": { - "Bucket": { - "description": "A bucket.", - "id": "Bucket", - "properties": { - "acl": { - "annotations": { - "required": [ - "storage.buckets.update" - ] - }, - "description": "Access controls on the bucket.", - "items": { - "$ref": "BucketAccessControl" - }, - "type": "array" - }, - "billing": { - "description": "The bucket's billing configuration.", - "properties": { - "requesterPays": { - "description": "When set to true, Requester Pays is enabled for this bucket.", - "type": "boolean" - } - }, - "type": "object" - }, - "cors": { - "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.", - "items": { - "properties": { - "maxAgeSeconds": { - "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.", - "format": "int32", - "type": "integer" - }, - "method": { - "description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".", - "items": { - "type": "string" - }, - "type": "array" - }, - "origin": { - "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".", - "items": { - "type": "string" - }, - "type": "array" - }, - "responseHeader": { - "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "type": "array" - }, - "defaultEventBasedHold": { - "description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed.", - "type": "boolean" - }, - "defaultObjectAcl": { - "description": "Default access controls to apply to new objects when no ACL is provided.", - "items": { - "$ref": "ObjectAccessControl" - }, - "type": "array" - }, - "encryption": { - "description": "Encryption configuration for a bucket.", - "properties": { - "defaultKmsKeyName": { - "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified.", - "type": "string" - } - }, - "type": "object" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for the bucket.", - "type": "string" - }, - "iamConfiguration": { - "description": "The bucket's IAM configuration.", - "properties": { - "bucketPolicyOnly": { - "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.", - "properties": { - "enabled": { - "description": "If set, access is controlled only by bucket-level or above IAM policies.", - "type": "boolean" - }, - "lockedTime": { - "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.", - "format": "date-time", - "type": "string" - } - }, - "type": "object" - }, - "uniformBucketLevelAccess": { - "description": "The bucket's uniform bucket-level access configuration.", - "properties": { - "enabled": { - "description": "If set, access is controlled only by bucket-level or above IAM policies.", - "type": "boolean" - }, - "lockedTime": { - "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.", - "format": "date-time", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "id": { - "description": "The ID of the bucket. For buckets, the id and name properties are the same.", - "type": "string" - }, - "kind": { - "default": "storage#bucket", - "description": "The kind of item this is. For buckets, this is always storage#bucket.", - "type": "string" - }, - "labels": { - "additionalProperties": { - "description": "An individual label entry.", - "type": "string" - }, - "description": "User-provided labels, in key/value pairs.", - "type": "object" - }, - "lifecycle": { - "description": "The bucket's lifecycle configuration. See lifecycle management for more information.", - "properties": { - "rule": { - "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.", - "items": { - "properties": { - "action": { - "description": "The action to take.", - "properties": { - "storageClass": { - "description": "Target storage class. Required iff the type of the action is SetStorageClass.", - "type": "string" - }, - "type": { - "description": "Type of the action. Currently, only Delete and SetStorageClass are supported.", - "type": "string" - } - }, - "type": "object" - }, - "condition": { - "description": "The condition(s) under which the action will be taken.", - "properties": { - "age": { - "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.", - "format": "int32", - "type": "integer" - }, - "createdBefore": { - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.", - "format": "date", - "type": "string" - }, - "customTimeBefore": { - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.", - "format": "date", - "type": "string" - }, - "daysSinceCustomTime": { - "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.", - "format": "int32", - "type": "integer" - }, - "daysSinceNoncurrentTime": { - "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.", - "format": "int32", - "type": "integer" - }, - "isLive": { - "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects.", - "type": "boolean" - }, - "matchesPattern": { - "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released.", - "type": "string" - }, - "matchesStorageClass": { - "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.", - "items": { - "type": "string" - }, - "type": "array" - }, - "noncurrentTimeBefore": { - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.", - "format": "date", - "type": "string" - }, - "numNewerVersions": { - "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "location": { - "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list.", - "type": "string" - }, - "locationType": { - "description": "The type of the bucket location.", - "type": "string" - }, - "logging": { - "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.", - "properties": { - "logBucket": { - "description": "The destination bucket where the current bucket's logs should be placed.", - "type": "string" - }, - "logObjectPrefix": { - "description": "A prefix for log object names.", - "type": "string" - } - }, - "type": "object" - }, - "metageneration": { - "description": "The metadata generation of this bucket.", - "format": "int64", - "type": "string" - }, - "name": { - "annotations": { - "required": [ - "storage.buckets.insert" - ] - }, - "description": "The name of the bucket.", - "type": "string" - }, - "owner": { - "description": "The owner of the bucket. This is always the project team's owner group.", - "properties": { - "entity": { - "description": "The entity, in the form project-owner-projectId.", - "type": "string" - }, - "entityId": { - "description": "The ID for the entity.", - "type": "string" - } - }, - "type": "object" - }, - "projectNumber": { - "description": "The project number of the project the bucket belongs to.", - "format": "uint64", - "type": "string" - }, - "retentionPolicy": { - "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.", - "properties": { - "effectiveTime": { - "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.", - "format": "date-time", - "type": "string" - }, - "isLocked": { - "description": "Once locked, an object retention policy cannot be modified.", - "type": "boolean" - }, - "retentionPeriod": { - "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.", - "format": "int64", - "type": "string" - } - }, - "type": "object" - }, - "selfLink": { - "description": "The URI of this bucket.", - "type": "string" - }, - "storageClass": { - "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes.", - "type": "string" - }, - "timeCreated": { - "description": "The creation time of the bucket in RFC 3339 format.", - "format": "date-time", - "type": "string" - }, - "updated": { - "description": "The modification time of the bucket in RFC 3339 format.", - "format": "date-time", - "type": "string" - }, - "versioning": { - "description": "The bucket's versioning configuration.", - "properties": { - "enabled": { - "description": "While set to true, versioning is fully enabled for this bucket.", - "type": "boolean" - } - }, - "type": "object" - }, - "website": { - "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.", - "properties": { - "mainPageSuffix": { - "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages.", - "type": "string" - }, - "notFoundPage": { - "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result.", - "type": "string" - } - }, - "type": "object" - }, - "zoneAffinity": { - "description": "The zone or zones from which the bucket is intended to use zonal quota. Requests for data from outside the specified affinities are still allowed but won't be able to use zonal quota. The zone or zones need to be within the bucket location otherwise the requests will fail with a 400 Bad Request response.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "BucketAccessControl": { - "description": "An access-control entry.", - "id": "BucketAccessControl", - "properties": { - "bucket": { - "description": "The name of the bucket.", - "type": "string" - }, - "domain": { - "description": "The domain associated with the entity, if any.", - "type": "string" - }, - "email": { - "description": "The email address associated with the entity, if any.", - "type": "string" - }, - "entity": { - "annotations": { - "required": [ - "storage.bucketAccessControls.insert" - ] - }, - "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", - "type": "string" - }, - "entityId": { - "description": "The ID for the entity, if any.", - "type": "string" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for the access-control entry.", - "type": "string" - }, - "id": { - "description": "The ID of the access-control entry.", - "type": "string" - }, - "kind": { - "default": "storage#bucketAccessControl", - "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", - "type": "string" - }, - "projectTeam": { - "description": "The project team associated with the entity, if any.", - "properties": { - "projectNumber": { - "description": "The project number.", - "type": "string" - }, - "team": { - "description": "The team.", - "type": "string" - } - }, - "type": "object" - }, - "role": { - "annotations": { - "required": [ - "storage.bucketAccessControls.insert" - ] - }, - "description": "The access permission for the entity.", - "type": "string" - }, - "selfLink": { - "description": "The link to this access-control entry.", - "type": "string" - } - }, - "type": "object" - }, - "BucketAccessControls": { - "description": "An access-control list.", - "id": "BucketAccessControls", - "properties": { - "items": { - "description": "The list of items.", - "items": { - "$ref": "BucketAccessControl" - }, - "type": "array" - }, - "kind": { - "default": "storage#bucketAccessControls", - "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", - "type": "string" - } - }, - "type": "object" - }, - "Buckets": { - "description": "A list of buckets.", - "id": "Buckets", - "properties": { - "items": { - "description": "The list of items.", - "items": { - "$ref": "Bucket" - }, - "type": "array" - }, - "kind": { - "default": "storage#buckets", - "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", - "type": "string" - }, - "nextPageToken": { - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.", - "type": "string" - } - }, - "type": "object" - }, - "Channel": { - "description": "An notification channel used to watch for resource changes.", - "id": "Channel", - "properties": { - "address": { - "description": "The address where notifications are delivered for this channel.", - "type": "string" - }, - "expiration": { - "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.", - "format": "int64", - "type": "string" - }, - "id": { - "description": "A UUID or similar unique string that identifies this channel.", - "type": "string" - }, - "kind": { - "default": "api#channel", - "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".", - "type": "string" - }, - "params": { - "additionalProperties": { - "description": "Declares a new parameter by name.", - "type": "string" - }, - "description": "Additional parameters controlling delivery channel behavior. Optional.", - "type": "object" - }, - "payload": { - "description": "A Boolean value to indicate whether payload is wanted. Optional.", - "type": "boolean" - }, - "resourceId": { - "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.", - "type": "string" - }, - "resourceUri": { - "description": "A version-specific identifier for the watched resource.", - "type": "string" - }, - "token": { - "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.", - "type": "string" - }, - "type": { - "description": "The type of delivery mechanism used for this channel.", - "type": "string" - } - }, - "type": "object" - }, - "ComposeRequest": { - "description": "A Compose request.", - "id": "ComposeRequest", - "properties": { - "destination": { - "$ref": "Object", - "description": "Properties of the resulting object." - }, - "kind": { - "default": "storage#composeRequest", - "description": "The kind of item this is.", - "type": "string" - }, - "sourceObjects": { - "annotations": { - "required": [ - "storage.objects.compose" - ] - }, - "description": "The list of source objects that will be concatenated into a single object.", - "items": { - "properties": { - "generation": { - "description": "The generation of this object to use as the source.", - "format": "int64", - "type": "string" - }, - "name": { - "annotations": { - "required": [ - "storage.objects.compose" - ] - }, - "description": "The source object's name. All source objects must reside in the same bucket.", - "type": "string" - }, - "objectPreconditions": { - "description": "Conditions that must be met for this operation to execute.", - "properties": { - "ifGenerationMatch": { - "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.", - "format": "int64", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Expr": { - "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"", - "id": "Expr", - "properties": { - "description": { - "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.", - "type": "string" - }, - "expression": { - "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported.", - "type": "string" - }, - "location": { - "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.", - "type": "string" - }, - "title": { - "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.", - "type": "string" - } - }, - "type": "object" - }, - "HmacKey": { - "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.", - "id": "HmacKey", - "properties": { - "kind": { - "default": "storage#hmacKey", - "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.", - "type": "string" - }, - "metadata": { - "$ref": "HmacKeyMetadata", - "description": "Key metadata." - }, - "secret": { - "description": "HMAC secret key material.", - "type": "string" - } - }, - "type": "object" - }, - "HmacKeyMetadata": { - "description": "JSON template to produce a JSON-style HMAC Key metadata resource.", - "id": "HmacKeyMetadata", - "properties": { - "accessId": { - "description": "The ID of the HMAC Key.", - "type": "string" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for the HMAC key.", - "type": "string" - }, - "id": { - "description": "The ID of the HMAC key, including the Project ID and the Access ID.", - "type": "string" - }, - "kind": { - "default": "storage#hmacKeyMetadata", - "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.", - "type": "string" - }, - "projectId": { - "description": "Project ID owning the service account to which the key authenticates.", - "type": "string" - }, - "selfLink": { - "description": "The link to this resource.", - "type": "string" - }, - "serviceAccountEmail": { - "description": "The email address of the key's associated service account.", - "type": "string" - }, - "state": { - "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.", - "type": "string" - }, - "timeCreated": { - "description": "The creation time of the HMAC key in RFC 3339 format.", - "format": "date-time", - "type": "string" - }, - "updated": { - "description": "The last modification time of the HMAC key metadata in RFC 3339 format.", - "format": "date-time", - "type": "string" - } - }, - "type": "object" - }, - "HmacKeysMetadata": { - "description": "A list of hmacKeys.", - "id": "HmacKeysMetadata", - "properties": { - "items": { - "description": "The list of items.", - "items": { - "$ref": "HmacKeyMetadata" - }, - "type": "array" - }, - "kind": { - "default": "storage#hmacKeysMetadata", - "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.", - "type": "string" - }, - "nextPageToken": { - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.", - "type": "string" - } - }, - "type": "object" - }, - "Notification": { - "description": "A subscription to receive Google PubSub notifications.", - "id": "Notification", - "properties": { - "custom_attributes": { - "additionalProperties": { - "type": "string" - }, - "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.", - "type": "object" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for this subscription notification.", - "type": "string" - }, - "event_types": { - "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.", - "items": { - "type": "string" - }, - "type": "array" - }, - "id": { - "description": "The ID of the notification.", - "type": "string" - }, - "kind": { - "default": "storage#notification", - "description": "The kind of item this is. For notifications, this is always storage#notification.", - "type": "string" - }, - "object_name_prefix": { - "description": "If present, only apply this notification configuration to object names that begin with this prefix.", - "type": "string" - }, - "payload_format": { - "annotations": { - "required": [ - "storage.notifications.insert" - ] - }, - "default": "JSON_API_V1", - "description": "The desired content of the Payload.", - "type": "string" - }, - "selfLink": { - "description": "The canonical URL of this notification.", - "type": "string" - }, - "topic": { - "annotations": { - "required": [ - "storage.notifications.insert" - ] - }, - "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'", - "type": "string" - } - }, - "type": "object" - }, - "Notifications": { - "description": "A list of notification subscriptions.", - "id": "Notifications", - "properties": { - "items": { - "description": "The list of items.", - "items": { - "$ref": "Notification" - }, - "type": "array" - }, - "kind": { - "default": "storage#notifications", - "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.", - "type": "string" - } - }, - "type": "object" - }, - "Object": { - "description": "An object.", - "id": "Object", - "properties": { - "acl": { - "annotations": { - "required": [ - "storage.objects.update" - ] - }, - "description": "Access controls on the object.", - "items": { - "$ref": "ObjectAccessControl" - }, - "type": "array" - }, - "bucket": { - "description": "The name of the bucket containing this object.", - "type": "string" - }, - "cacheControl": { - "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.", - "type": "string" - }, - "componentCount": { - "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.", - "format": "int32", - "type": "integer" - }, - "contentDisposition": { - "description": "Content-Disposition of the object data.", - "type": "string" - }, - "contentEncoding": { - "description": "Content-Encoding of the object data.", - "type": "string" - }, - "contentLanguage": { - "description": "Content-Language of the object data.", - "type": "string" - }, - "contentType": { - "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.", - "type": "string" - }, - "crc32c": { - "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices.", - "type": "string" - }, - "customTime": { - "description": "A timestamp in RFC 3339 format specified by the user for an object.", - "format": "date-time", - "type": "string" - }, - "customerEncryption": { - "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.", - "properties": { - "encryptionAlgorithm": { - "description": "The encryption algorithm.", - "type": "string" - }, - "keySha256": { - "description": "SHA256 hash value of the encryption key.", - "type": "string" - } - }, - "type": "object" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for the object.", - "type": "string" - }, - "eventBasedHold": { - "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.", - "type": "boolean" - }, - "generation": { - "description": "The content generation of this object. Used for object versioning.", - "format": "int64", - "type": "string" - }, - "id": { - "description": "The ID of the object, including the bucket name, object name, and generation number.", - "type": "string" - }, - "kind": { - "default": "storage#object", - "description": "The kind of item this is. For objects, this is always storage#object.", - "type": "string" - }, - "kmsKeyName": { - "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.", - "type": "string" - }, - "md5Hash": { - "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices.", - "type": "string" - }, - "mediaLink": { - "description": "Media download link.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "description": "An individual metadata entry.", - "type": "string" - }, - "description": "User-provided metadata, in key/value pairs.", - "type": "object" - }, - "metageneration": { - "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.", - "format": "int64", - "type": "string" - }, - "name": { - "description": "The name of the object. Required if not specified by URL parameter.", - "type": "string" - }, - "owner": { - "description": "The owner of the object. This will always be the uploader of the object.", - "properties": { - "entity": { - "description": "The entity, in the form user-userId.", - "type": "string" - }, - "entityId": { - "description": "The ID for the entity.", - "type": "string" - } - }, - "type": "object" - }, - "retentionExpirationTime": { - "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).", - "format": "date-time", - "type": "string" - }, - "selfLink": { - "description": "The link to this object.", - "type": "string" - }, - "size": { - "description": "Content-Length of the data in bytes.", - "format": "uint64", - "type": "string" - }, - "storageClass": { - "description": "Storage class of the object.", - "type": "string" - }, - "temporaryHold": { - "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.", - "type": "boolean" - }, - "timeCreated": { - "description": "The creation time of the object in RFC 3339 format.", - "format": "date-time", - "type": "string" - }, - "timeDeleted": { - "description": "The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.", - "format": "date-time", - "type": "string" - }, - "timeStorageClassUpdated": { - "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.", - "format": "date-time", - "type": "string" - }, - "updated": { - "description": "The modification time of the object metadata in RFC 3339 format.", - "format": "date-time", - "type": "string" - } - }, - "type": "object" - }, - "ObjectAccessControl": { - "description": "An access-control entry.", - "id": "ObjectAccessControl", - "properties": { - "bucket": { - "description": "The name of the bucket.", - "type": "string" - }, - "domain": { - "description": "The domain associated with the entity, if any.", - "type": "string" - }, - "email": { - "description": "The email address associated with the entity, if any.", - "type": "string" - }, - "entity": { - "annotations": { - "required": [ - "storage.defaultObjectAccessControls.insert", - "storage.objectAccessControls.insert" - ] - }, - "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", - "type": "string" - }, - "entityId": { - "description": "The ID for the entity, if any.", - "type": "string" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for the access-control entry.", - "type": "string" - }, - "generation": { - "description": "The content generation of the object, if applied to an object.", - "format": "int64", - "type": "string" - }, - "id": { - "description": "The ID of the access-control entry.", - "type": "string" - }, - "kind": { - "default": "storage#objectAccessControl", - "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", - "type": "string" - }, - "object": { - "description": "The name of the object, if applied to an object.", - "type": "string" - }, - "projectTeam": { - "description": "The project team associated with the entity, if any.", - "properties": { - "projectNumber": { - "description": "The project number.", - "type": "string" - }, - "team": { - "description": "The team.", - "type": "string" - } - }, - "type": "object" - }, - "role": { - "annotations": { - "required": [ - "storage.defaultObjectAccessControls.insert", - "storage.objectAccessControls.insert" - ] - }, - "description": "The access permission for the entity.", - "type": "string" - }, - "selfLink": { - "description": "The link to this access-control entry.", - "type": "string" - } - }, - "type": "object" - }, - "ObjectAccessControls": { - "description": "An access-control list.", - "id": "ObjectAccessControls", - "properties": { - "items": { - "description": "The list of items.", - "items": { - "$ref": "ObjectAccessControl" - }, - "type": "array" - }, - "kind": { - "default": "storage#objectAccessControls", - "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", - "type": "string" - } - }, - "type": "object" - }, - "Objects": { - "description": "A list of objects.", - "id": "Objects", - "properties": { - "items": { - "description": "The list of items.", - "items": { - "$ref": "Object" - }, - "type": "array" - }, - "kind": { - "default": "storage#objects", - "description": "The kind of item this is. For lists of objects, this is always storage#objects.", - "type": "string" - }, - "nextPageToken": { - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.", - "type": "string" - }, - "prefixes": { - "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "Policy": { - "description": "A bucket/object IAM policy.", - "id": "Policy", - "properties": { - "bindings": { - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy" - ] - }, - "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.", - "items": { - "properties": { - "condition": { - "$ref": "Expr", - "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently." - }, - "members": { - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy" - ] - }, - "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers — A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid — An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid — An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project", - "items": { - "type": "string" - }, - "type": "array" - }, - "role": { - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy" - ] - }, - "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin — Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator — Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner — Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "etag": { - "description": "HTTP 1.1 Entity tag for the policy.", - "format": "byte", - "type": "string" - }, - "kind": { - "default": "storage#policy", - "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.", - "type": "string" - }, - "resourceId": { - "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.", - "type": "string" - }, - "version": { - "description": "The IAM policy format version.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, - "RewriteResponse": { - "description": "A rewrite response.", - "id": "RewriteResponse", - "properties": { - "done": { - "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response.", - "type": "boolean" - }, - "kind": { - "default": "storage#rewriteResponse", - "description": "The kind of item this is.", - "type": "string" - }, - "objectSize": { - "description": "The total size of the object being copied in bytes. This property is always present in the response.", - "format": "int64", - "type": "string" - }, - "resource": { - "$ref": "Object", - "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." - }, - "rewriteToken": { - "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy.", - "type": "string" - }, - "totalBytesRewritten": { - "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", - "format": "int64", - "type": "string" - } - }, - "type": "object" - }, - "ServiceAccount": { - "description": "A subscription to receive Google PubSub notifications.", - "id": "ServiceAccount", - "properties": { - "email_address": { - "description": "The ID of the notification.", - "type": "string" - }, - "kind": { - "default": "storage#serviceAccount", - "description": "The kind of item this is. For notifications, this is always storage#notification.", - "type": "string" - } - }, - "type": "object" - }, - "TestIamPermissionsResponse": { - "description": "A storage.(buckets|objects).testIamPermissions response.", - "id": "TestIamPermissionsResponse", - "properties": { - "kind": { - "default": "storage#testIamPermissionsResponse", - "description": "The kind of item this is.", - "type": "string" - }, - "permissions": { - "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: \n- storage.buckets.delete — Delete bucket. \n- storage.buckets.get — Read bucket metadata. \n- storage.buckets.getIamPolicy — Read bucket IAM policy. \n- storage.buckets.create — Create bucket. \n- storage.buckets.list — List buckets. \n- storage.buckets.setIamPolicy — Update bucket IAM policy. \n- storage.buckets.update — Update bucket metadata. \n- storage.objects.delete — Delete object. \n- storage.objects.get — Read object data and metadata. \n- storage.objects.getIamPolicy — Read object IAM policy. \n- storage.objects.create — Create object. \n- storage.objects.list — List objects. \n- storage.objects.setIamPolicy — Update object IAM policy. \n- storage.objects.update — Update object metadata.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - } - }, - "servicePath": "storage/v1/", - "title": "Cloud Storage JSON API", - "version": "v1" -} \ No newline at end of file diff --git a/ibm/vendor/google.golang.org/api/storage/v1/storage-gen.go b/ibm/vendor/google.golang.org/api/storage/v1/storage-gen.go deleted file mode 100644 index 6c80946b21..0000000000 --- a/ibm/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ /dev/null @@ -1,13407 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated file. DO NOT EDIT. - -// Package storage provides access to the Cloud Storage JSON API. -// -// This package is DEPRECATED. Use package cloud.google.com/go/storage instead. -// -// For product documentation, see: https://developers.google.com/storage/docs/json_api/ -// -// Creating a client -// -// Usage example: -// -// import "google.golang.org/api/storage/v1" -// ... -// ctx := context.Background() -// storageService, err := storage.NewService(ctx) -// -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. -// -// Other authentication options -// -// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: -// -// storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope)) -// -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: -// -// storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza...")) -// -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: -// -// config := &oauth2.Config{...} -// // ... -// token, err := config.Exchange(ctx, ...) -// storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) -// -// See https://godoc.org/google.golang.org/api/option/ for details on options. -package storage // import "google.golang.org/api/storage/v1" - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "strconv" - "strings" - - googleapi "google.golang.org/api/googleapi" - gensupport "google.golang.org/api/internal/gensupport" - option "google.golang.org/api/option" - internaloption "google.golang.org/api/option/internaloption" - htransport "google.golang.org/api/transport/http" -) - -// Always reference these packages, just in case the auto-generated code -// below doesn't. -var _ = bytes.NewBuffer -var _ = strconv.Itoa -var _ = fmt.Sprintf -var _ = json.NewDecoder -var _ = io.Copy -var _ = url.Parse -var _ = gensupport.MarshalJSON -var _ = googleapi.Version -var _ = errors.New -var _ = strings.Replace -var _ = context.Canceled -var _ = internaloption.WithDefaultEndpoint - -const apiId = "storage:v1" -const apiName = "storage" -const apiVersion = "v1" -const basePath = "https://storage.googleapis.com/storage/v1/" - -// OAuth2 scopes used by this API. -const ( - // View and manage your data across Google Cloud Platform services - CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" - - // View your data across Google Cloud Platform services - CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" - - // Manage your data and permissions in Google Cloud Storage - DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" - - // View your data in Google Cloud Storage - DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" - - // Manage your data in Google Cloud Storage - DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" -) - -// NewService creates a new Service. -func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { - scopesOption := option.WithScopes( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write", - ) - // NOTE: prepend, so we don't override user-specified scopes. - opts = append([]option.ClientOption{scopesOption}, opts...) - opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) - client, endpoint, err := htransport.NewClient(ctx, opts...) - if err != nil { - return nil, err - } - s, err := New(client) - if err != nil { - return nil, err - } - if endpoint != "" { - s.BasePath = endpoint - } - return s, nil -} - -// New creates a new Service. It uses the provided http.Client for requests. -// -// Deprecated: please use NewService instead. -// To provide a custom HTTP client, use option.WithHTTPClient. -// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } - s := &Service{client: client, BasePath: basePath} - s.BucketAccessControls = NewBucketAccessControlsService(s) - s.Buckets = NewBucketsService(s) - s.Channels = NewChannelsService(s) - s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s) - s.Notifications = NewNotificationsService(s) - s.ObjectAccessControls = NewObjectAccessControlsService(s) - s.Objects = NewObjectsService(s) - s.Projects = NewProjectsService(s) - return s, nil -} - -type Service struct { - client *http.Client - BasePath string // API endpoint base URL - UserAgent string // optional additional User-Agent fragment - - BucketAccessControls *BucketAccessControlsService - - Buckets *BucketsService - - Channels *ChannelsService - - DefaultObjectAccessControls *DefaultObjectAccessControlsService - - Notifications *NotificationsService - - ObjectAccessControls *ObjectAccessControlsService - - Objects *ObjectsService - - Projects *ProjectsService -} - -func (s *Service) userAgent() string { - if s.UserAgent == "" { - return googleapi.UserAgent - } - return googleapi.UserAgent + " " + s.UserAgent -} - -func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService { - rs := &BucketAccessControlsService{s: s} - return rs -} - -type BucketAccessControlsService struct { - s *Service -} - -func NewBucketsService(s *Service) *BucketsService { - rs := &BucketsService{s: s} - return rs -} - -type BucketsService struct { - s *Service -} - -func NewChannelsService(s *Service) *ChannelsService { - rs := &ChannelsService{s: s} - return rs -} - -type ChannelsService struct { - s *Service -} - -func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService { - rs := &DefaultObjectAccessControlsService{s: s} - return rs -} - -type DefaultObjectAccessControlsService struct { - s *Service -} - -func NewNotificationsService(s *Service) *NotificationsService { - rs := &NotificationsService{s: s} - return rs -} - -type NotificationsService struct { - s *Service -} - -func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService { - rs := &ObjectAccessControlsService{s: s} - return rs -} - -type ObjectAccessControlsService struct { - s *Service -} - -func NewObjectsService(s *Service) *ObjectsService { - rs := &ObjectsService{s: s} - return rs -} - -type ObjectsService struct { - s *Service -} - -func NewProjectsService(s *Service) *ProjectsService { - rs := &ProjectsService{s: s} - rs.HmacKeys = NewProjectsHmacKeysService(s) - rs.ServiceAccount = NewProjectsServiceAccountService(s) - return rs -} - -type ProjectsService struct { - s *Service - - HmacKeys *ProjectsHmacKeysService - - ServiceAccount *ProjectsServiceAccountService -} - -func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService { - rs := &ProjectsHmacKeysService{s: s} - return rs -} - -type ProjectsHmacKeysService struct { - s *Service -} - -func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService { - rs := &ProjectsServiceAccountService{s: s} - return rs -} - -type ProjectsServiceAccountService struct { - s *Service -} - -// Bucket: A bucket. -type Bucket struct { - // Acl: Access controls on the bucket. - Acl []*BucketAccessControl `json:"acl,omitempty"` - - // Billing: The bucket's billing configuration. - Billing *BucketBilling `json:"billing,omitempty"` - - // Cors: The bucket's Cross-Origin Resource Sharing (CORS) - // configuration. - Cors []*BucketCors `json:"cors,omitempty"` - - // DefaultEventBasedHold: The default value for event-based hold on - // newly created objects in this bucket. Event-based hold is a way to - // retain objects indefinitely until an event occurs, signified by the - // hold's release. After being released, such objects will be subject to - // bucket-level retention (if any). One sample use case of this flag is - // for banks to hold loan documents for at least 3 years after loan is - // paid in full. Here, bucket-level retention is 3 years and the event - // is loan being paid in full. In this example, these objects will be - // held intact for any number of years until the event has occurred - // (event-based hold on the object is released) and then 3 more years - // after that. That means retention duration of the objects begins from - // the moment event-based hold transitioned from true to false. Objects - // under event-based hold cannot be deleted, overwritten or archived - // until the hold is removed. - DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"` - - // DefaultObjectAcl: Default access controls to apply to new objects - // when no ACL is provided. - DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` - - // Encryption: Encryption configuration for a bucket. - Encryption *BucketEncryption `json:"encryption,omitempty"` - - // Etag: HTTP 1.1 Entity tag for the bucket. - Etag string `json:"etag,omitempty"` - - // IamConfiguration: The bucket's IAM configuration. - IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"` - - // Id: The ID of the bucket. For buckets, the id and name properties are - // the same. - Id string `json:"id,omitempty"` - - // Kind: The kind of item this is. For buckets, this is always - // storage#bucket. - Kind string `json:"kind,omitempty"` - - // Labels: User-provided labels, in key/value pairs. - Labels map[string]string `json:"labels,omitempty"` - - // Lifecycle: The bucket's lifecycle configuration. See lifecycle - // management for more information. - Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"` - - // Location: The location of the bucket. Object data for objects in the - // bucket resides in physical storage within this region. Defaults to - // US. See the developer's guide for the authoritative list. - Location string `json:"location,omitempty"` - - // LocationType: The type of the bucket location. - LocationType string `json:"locationType,omitempty"` - - // Logging: The bucket's logging configuration, which defines the - // destination bucket and optional name prefix for the current bucket's - // logs. - Logging *BucketLogging `json:"logging,omitempty"` - - // Metageneration: The metadata generation of this bucket. - Metageneration int64 `json:"metageneration,omitempty,string"` - - // Name: The name of the bucket. - Name string `json:"name,omitempty"` - - // Owner: The owner of the bucket. This is always the project team's - // owner group. - Owner *BucketOwner `json:"owner,omitempty"` - - // ProjectNumber: The project number of the project the bucket belongs - // to. - ProjectNumber uint64 `json:"projectNumber,omitempty,string"` - - // RetentionPolicy: The bucket's retention policy. The retention policy - // enforces a minimum retention time for all objects contained in the - // bucket, based on their creation time. Any attempt to overwrite or - // delete objects younger than the retention period will result in a - // PERMISSION_DENIED error. An unlocked retention policy can be modified - // or removed from the bucket via a storage.buckets.update operation. A - // locked retention policy cannot be removed or shortened in duration - // for the lifetime of the bucket. Attempting to remove or decrease - // period of a locked retention policy will result in a - // PERMISSION_DENIED error. - RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"` - - // SelfLink: The URI of this bucket. - SelfLink string `json:"selfLink,omitempty"` - - // StorageClass: The bucket's default storage class, used whenever no - // storageClass is specified for a newly-created object. This defines - // how objects in the bucket are stored and determines the SLA and the - // cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, - // NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If - // this value is not specified when the bucket is created, it will - // default to STANDARD. For more information, see storage classes. - StorageClass string `json:"storageClass,omitempty"` - - // TimeCreated: The creation time of the bucket in RFC 3339 format. - TimeCreated string `json:"timeCreated,omitempty"` - - // Updated: The modification time of the bucket in RFC 3339 format. - Updated string `json:"updated,omitempty"` - - // Versioning: The bucket's versioning configuration. - Versioning *BucketVersioning `json:"versioning,omitempty"` - - // Website: The bucket's website configuration, controlling how the - // service behaves when accessing bucket contents as a web site. See the - // Static Website Examples for more information. - Website *BucketWebsite `json:"website,omitempty"` - - // ZoneAffinity: The zone or zones from which the bucket is intended to - // use zonal quota. Requests for data from outside the specified - // affinities are still allowed but won't be able to use zonal quota. - // The zone or zones need to be within the bucket location otherwise the - // requests will fail with a 400 Bad Request response. - ZoneAffinity []string `json:"zoneAffinity,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Acl") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Acl") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Bucket) MarshalJSON() ([]byte, error) { - type NoMethod Bucket - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketBilling: The bucket's billing configuration. -type BucketBilling struct { - // RequesterPays: When set to true, Requester Pays is enabled for this - // bucket. - RequesterPays bool `json:"requesterPays,omitempty"` - - // ForceSendFields is a list of field names (e.g. "RequesterPays") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "RequesterPays") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketBilling) MarshalJSON() ([]byte, error) { - type NoMethod BucketBilling - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type BucketCors struct { - // MaxAgeSeconds: The value, in seconds, to return in the - // Access-Control-Max-Age header used in preflight responses. - MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"` - - // Method: The list of HTTP methods on which to include CORS response - // headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list - // of methods, and means "any method". - Method []string `json:"method,omitempty"` - - // Origin: The list of Origins eligible to receive CORS response - // headers. Note: "*" is permitted in the list of origins, and means - // "any Origin". - Origin []string `json:"origin,omitempty"` - - // ResponseHeader: The list of HTTP headers other than the simple - // response headers to give permission for the user-agent to share - // across domains. - ResponseHeader []string `json:"responseHeader,omitempty"` - - // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketCors) MarshalJSON() ([]byte, error) { - type NoMethod BucketCors - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketEncryption: Encryption configuration for a bucket. -type BucketEncryption struct { - // DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt - // objects inserted into this bucket, if no encryption method is - // specified. - DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"` - - // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName") - // to unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "DefaultKmsKeyName") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *BucketEncryption) MarshalJSON() ([]byte, error) { - type NoMethod BucketEncryption - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketIamConfiguration: The bucket's IAM configuration. -type BucketIamConfiguration struct { - // BucketPolicyOnly: The bucket's uniform bucket-level access - // configuration. The feature was formerly known as Bucket Policy Only. - // For backward compatibility, this field will be populated with - // identical information as the uniformBucketLevelAccess field. We - // recommend using the uniformBucketLevelAccess field to enable and - // disable the feature. - BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"` - - // UniformBucketLevelAccess: The bucket's uniform bucket-level access - // configuration. - UniformBucketLevelAccess *BucketIamConfigurationUniformBucketLevelAccess `json:"uniformBucketLevelAccess,omitempty"` - - // ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "BucketPolicyOnly") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) { - type NoMethod BucketIamConfiguration - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketIamConfigurationBucketPolicyOnly: The bucket's uniform -// bucket-level access configuration. The feature was formerly known as -// Bucket Policy Only. For backward compatibility, this field will be -// populated with identical information as the uniformBucketLevelAccess -// field. We recommend using the uniformBucketLevelAccess field to -// enable and disable the feature. -type BucketIamConfigurationBucketPolicyOnly struct { - // Enabled: If set, access is controlled only by bucket-level or above - // IAM policies. - Enabled bool `json:"enabled,omitempty"` - - // LockedTime: The deadline for changing - // iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC - // 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed - // from true to false until the locked time, after which the field is - // immutable. - LockedTime string `json:"lockedTime,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Enabled") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Enabled") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) { - type NoMethod BucketIamConfigurationBucketPolicyOnly - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketIamConfigurationUniformBucketLevelAccess: The bucket's uniform -// bucket-level access configuration. -type BucketIamConfigurationUniformBucketLevelAccess struct { - // Enabled: If set, access is controlled only by bucket-level or above - // IAM policies. - Enabled bool `json:"enabled,omitempty"` - - // LockedTime: The deadline for changing - // iamConfiguration.uniformBucketLevelAccess.enabled from true to false - // in RFC 3339 format. - // iamConfiguration.uniformBucketLevelAccess.enabled may be changed from - // true to false until the locked time, after which the field is - // immutable. - LockedTime string `json:"lockedTime,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Enabled") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Enabled") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketIamConfigurationUniformBucketLevelAccess) MarshalJSON() ([]byte, error) { - type NoMethod BucketIamConfigurationUniformBucketLevelAccess - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle -// management for more information. -type BucketLifecycle struct { - // Rule: A lifecycle management rule, which is made of an action to take - // and the condition(s) under which the action will be taken. - Rule []*BucketLifecycleRule `json:"rule,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Rule") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Rule") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketLifecycle) MarshalJSON() ([]byte, error) { - type NoMethod BucketLifecycle - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type BucketLifecycleRule struct { - // Action: The action to take. - Action *BucketLifecycleRuleAction `json:"action,omitempty"` - - // Condition: The condition(s) under which the action will be taken. - Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Action") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Action") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) { - type NoMethod BucketLifecycleRule - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketLifecycleRuleAction: The action to take. -type BucketLifecycleRuleAction struct { - // StorageClass: Target storage class. Required iff the type of the - // action is SetStorageClass. - StorageClass string `json:"storageClass,omitempty"` - - // Type: Type of the action. Currently, only Delete and SetStorageClass - // are supported. - Type string `json:"type,omitempty"` - - // ForceSendFields is a list of field names (e.g. "StorageClass") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "StorageClass") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) { - type NoMethod BucketLifecycleRuleAction - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketLifecycleRuleCondition: The condition(s) under which the action -// will be taken. -type BucketLifecycleRuleCondition struct { - // Age: Age of an object (in days). This condition is satisfied when an - // object reaches the specified age. - Age int64 `json:"age,omitempty"` - - // CreatedBefore: A date in RFC 3339 format with only the date part (for - // instance, "2013-01-15"). This condition is satisfied when an object - // is created before midnight of the specified date in UTC. - CreatedBefore string `json:"createdBefore,omitempty"` - - // CustomTimeBefore: A date in RFC 3339 format with only the date part - // (for instance, "2013-01-15"). This condition is satisfied when the - // custom time on an object is before this date in UTC. - CustomTimeBefore string `json:"customTimeBefore,omitempty"` - - // DaysSinceCustomTime: Number of days elapsed since the user-specified - // timestamp set on an object. The condition is satisfied if the days - // elapsed is at least this number. If no custom timestamp is specified - // on an object, the condition does not apply. - DaysSinceCustomTime int64 `json:"daysSinceCustomTime,omitempty"` - - // DaysSinceNoncurrentTime: Number of days elapsed since the noncurrent - // timestamp of an object. The condition is satisfied if the days - // elapsed is at least this number. This condition is relevant only for - // versioned objects. The value of the field must be a nonnegative - // integer. If it's zero, the object version will become eligible for - // Lifecycle action as soon as it becomes noncurrent. - DaysSinceNoncurrentTime int64 `json:"daysSinceNoncurrentTime,omitempty"` - - // IsLive: Relevant only for versioned objects. If the value is true, - // this condition matches live objects; if the value is false, it - // matches archived objects. - IsLive *bool `json:"isLive,omitempty"` - - // MatchesPattern: A regular expression that satisfies the RE2 syntax. - // This condition is satisfied when the name of the object matches the - // RE2 pattern. Note: This feature is currently in the "Early Access" - // launch stage and is only available to a whitelisted set of users; - // that means that this feature may be changed in backward-incompatible - // ways and that it is not guaranteed to be released. - MatchesPattern string `json:"matchesPattern,omitempty"` - - // MatchesStorageClass: Objects having any of the storage classes - // specified by this condition will be matched. Values include - // MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and - // DURABLE_REDUCED_AVAILABILITY. - MatchesStorageClass []string `json:"matchesStorageClass,omitempty"` - - // NoncurrentTimeBefore: A date in RFC 3339 format with only the date - // part (for instance, "2013-01-15"). This condition is satisfied when - // the noncurrent time on an object is before this date in UTC. This - // condition is relevant only for versioned objects. - NoncurrentTimeBefore string `json:"noncurrentTimeBefore,omitempty"` - - // NumNewerVersions: Relevant only for versioned objects. If the value - // is N, this condition is satisfied when there are at least N versions - // (including the live version) newer than this version of the object. - NumNewerVersions int64 `json:"numNewerVersions,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Age") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Age") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) { - type NoMethod BucketLifecycleRuleCondition - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketLogging: The bucket's logging configuration, which defines the -// destination bucket and optional name prefix for the current bucket's -// logs. -type BucketLogging struct { - // LogBucket: The destination bucket where the current bucket's logs - // should be placed. - LogBucket string `json:"logBucket,omitempty"` - - // LogObjectPrefix: A prefix for log object names. - LogObjectPrefix string `json:"logObjectPrefix,omitempty"` - - // ForceSendFields is a list of field names (e.g. "LogBucket") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "LogBucket") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketLogging) MarshalJSON() ([]byte, error) { - type NoMethod BucketLogging - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketOwner: The owner of the bucket. This is always the project -// team's owner group. -type BucketOwner struct { - // Entity: The entity, in the form project-owner-projectId. - Entity string `json:"entity,omitempty"` - - // EntityId: The ID for the entity. - EntityId string `json:"entityId,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Entity") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Entity") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketOwner) MarshalJSON() ([]byte, error) { - type NoMethod BucketOwner - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketRetentionPolicy: The bucket's retention policy. The retention -// policy enforces a minimum retention time for all objects contained in -// the bucket, based on their creation time. Any attempt to overwrite or -// delete objects younger than the retention period will result in a -// PERMISSION_DENIED error. An unlocked retention policy can be modified -// or removed from the bucket via a storage.buckets.update operation. A -// locked retention policy cannot be removed or shortened in duration -// for the lifetime of the bucket. Attempting to remove or decrease -// period of a locked retention policy will result in a -// PERMISSION_DENIED error. -type BucketRetentionPolicy struct { - // EffectiveTime: Server-determined value that indicates the time from - // which policy was enforced and effective. This value is in RFC 3339 - // format. - EffectiveTime string `json:"effectiveTime,omitempty"` - - // IsLocked: Once locked, an object retention policy cannot be modified. - IsLocked bool `json:"isLocked,omitempty"` - - // RetentionPeriod: The duration in seconds that objects need to be - // retained. Retention duration must be greater than zero and less than - // 100 years. Note that enforcement of retention periods less than a day - // is not guaranteed. Such periods should only be used for testing - // purposes. - RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. "EffectiveTime") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "EffectiveTime") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) { - type NoMethod BucketRetentionPolicy - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketVersioning: The bucket's versioning configuration. -type BucketVersioning struct { - // Enabled: While set to true, versioning is fully enabled for this - // bucket. - Enabled bool `json:"enabled,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Enabled") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Enabled") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketVersioning) MarshalJSON() ([]byte, error) { - type NoMethod BucketVersioning - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketWebsite: The bucket's website configuration, controlling how -// the service behaves when accessing bucket contents as a web site. See -// the Static Website Examples for more information. -type BucketWebsite struct { - // MainPageSuffix: If the requested object path is missing, the service - // will ensure the path has a trailing '/', append this suffix, and - // attempt to retrieve the resulting object. This allows the creation of - // index.html objects to represent directory pages. - MainPageSuffix string `json:"mainPageSuffix,omitempty"` - - // NotFoundPage: If the requested object path is missing, and any - // mainPageSuffix object is missing, if applicable, the service will - // return the named object from this bucket as the content for a 404 Not - // Found result. - NotFoundPage string `json:"notFoundPage,omitempty"` - - // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "MainPageSuffix") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *BucketWebsite) MarshalJSON() ([]byte, error) { - type NoMethod BucketWebsite - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketAccessControl: An access-control entry. -type BucketAccessControl struct { - // Bucket: The name of the bucket. - Bucket string `json:"bucket,omitempty"` - - // Domain: The domain associated with the entity, if any. - Domain string `json:"domain,omitempty"` - - // Email: The email address associated with the entity, if any. - Email string `json:"email,omitempty"` - - // Entity: The entity holding the permission, in one of the following - // forms: - // - user-userId - // - user-email - // - group-groupId - // - group-email - // - domain-domain - // - project-team-projectId - // - allUsers - // - allAuthenticatedUsers Examples: - // - The user liz@example.com would be user-liz@example.com. - // - The group example@googlegroups.com would be - // group-example@googlegroups.com. - // - To refer to all members of the Google Apps for Business domain - // example.com, the entity would be domain-example.com. - Entity string `json:"entity,omitempty"` - - // EntityId: The ID for the entity, if any. - EntityId string `json:"entityId,omitempty"` - - // Etag: HTTP 1.1 Entity tag for the access-control entry. - Etag string `json:"etag,omitempty"` - - // Id: The ID of the access-control entry. - Id string `json:"id,omitempty"` - - // Kind: The kind of item this is. For bucket access control entries, - // this is always storage#bucketAccessControl. - Kind string `json:"kind,omitempty"` - - // ProjectTeam: The project team associated with the entity, if any. - ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"` - - // Role: The access permission for the entity. - Role string `json:"role,omitempty"` - - // SelfLink: The link to this access-control entry. - SelfLink string `json:"selfLink,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Bucket") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Bucket") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { - type NoMethod BucketAccessControl - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketAccessControlProjectTeam: The project team associated with the -// entity, if any. -type BucketAccessControlProjectTeam struct { - // ProjectNumber: The project number. - ProjectNumber string `json:"projectNumber,omitempty"` - - // Team: The team. - Team string `json:"team,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ProjectNumber") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ProjectNumber") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) { - type NoMethod BucketAccessControlProjectTeam - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// BucketAccessControls: An access-control list. -type BucketAccessControls struct { - // Items: The list of items. - Items []*BucketAccessControl `json:"items,omitempty"` - - // Kind: The kind of item this is. For lists of bucket access control - // entries, this is always storage#bucketAccessControls. - Kind string `json:"kind,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Items") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Items") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { - type NoMethod BucketAccessControls - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Buckets: A list of buckets. -type Buckets struct { - // Items: The list of items. - Items []*Bucket `json:"items,omitempty"` - - // Kind: The kind of item this is. For lists of buckets, this is always - // storage#buckets. - Kind string `json:"kind,omitempty"` - - // NextPageToken: The continuation token, used to page through large - // result sets. Provide this value in a subsequent request to return the - // next page of results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Items") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Items") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Buckets) MarshalJSON() ([]byte, error) { - type NoMethod Buckets - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Channel: An notification channel used to watch for resource changes. -type Channel struct { - // Address: The address where notifications are delivered for this - // channel. - Address string `json:"address,omitempty"` - - // Expiration: Date and time of notification channel expiration, - // expressed as a Unix timestamp, in milliseconds. Optional. - Expiration int64 `json:"expiration,omitempty,string"` - - // Id: A UUID or similar unique string that identifies this channel. - Id string `json:"id,omitempty"` - - // Kind: Identifies this as a notification channel used to watch for - // changes to a resource, which is "api#channel". - Kind string `json:"kind,omitempty"` - - // Params: Additional parameters controlling delivery channel behavior. - // Optional. - Params map[string]string `json:"params,omitempty"` - - // Payload: A Boolean value to indicate whether payload is wanted. - // Optional. - Payload bool `json:"payload,omitempty"` - - // ResourceId: An opaque ID that identifies the resource being watched - // on this channel. Stable across different API versions. - ResourceId string `json:"resourceId,omitempty"` - - // ResourceUri: A version-specific identifier for the watched resource. - ResourceUri string `json:"resourceUri,omitempty"` - - // Token: An arbitrary string delivered to the target address with each - // notification delivered over this channel. Optional. - Token string `json:"token,omitempty"` - - // Type: The type of delivery mechanism used for this channel. - Type string `json:"type,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Address") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Address") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Channel) MarshalJSON() ([]byte, error) { - type NoMethod Channel - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ComposeRequest: A Compose request. -type ComposeRequest struct { - // Destination: Properties of the resulting object. - Destination *Object `json:"destination,omitempty"` - - // Kind: The kind of item this is. - Kind string `json:"kind,omitempty"` - - // SourceObjects: The list of source objects that will be concatenated - // into a single object. - SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Destination") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Destination") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ComposeRequest) MarshalJSON() ([]byte, error) { - type NoMethod ComposeRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type ComposeRequestSourceObjects struct { - // Generation: The generation of this object to use as the source. - Generation int64 `json:"generation,omitempty,string"` - - // Name: The source object's name. All source objects must reside in the - // same bucket. - Name string `json:"name,omitempty"` - - // ObjectPreconditions: Conditions that must be met for this operation - // to execute. - ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Generation") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Generation") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) { - type NoMethod ComposeRequestSourceObjects - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must -// be met for this operation to execute. -type ComposeRequestSourceObjectsObjectPreconditions struct { - // IfGenerationMatch: Only perform the composition if the generation of - // the source object that would be used matches this value. If this - // value and a generation are both specified, they must be the same - // value or the call will fail. - IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. "IfGenerationMatch") - // to unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "IfGenerationMatch") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) { - type NoMethod ComposeRequestSourceObjectsObjectPreconditions - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Expr: Represents an expression text. Example: title: "User account -// presence" description: "Determines whether the request has a user -// account" expression: "size(request.user) > 0" -type Expr struct { - // Description: An optional description of the expression. This is a - // longer text which describes the expression, e.g. when hovered over it - // in a UI. - Description string `json:"description,omitempty"` - - // Expression: Textual representation of an expression in Common - // Expression Language syntax. The application context of the containing - // message determines which well-known feature set of CEL is supported. - Expression string `json:"expression,omitempty"` - - // Location: An optional string indicating the location of the - // expression for error reporting, e.g. a file name and a position in - // the file. - Location string `json:"location,omitempty"` - - // Title: An optional title for the expression, i.e. a short string - // describing its purpose. This can be used e.g. in UIs which allow to - // enter the expression. - Title string `json:"title,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Description") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Description") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Expr) MarshalJSON() ([]byte, error) { - type NoMethod Expr - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// HmacKey: JSON template to produce a JSON-style HMAC Key resource for -// Create responses. -type HmacKey struct { - // Kind: The kind of item this is. For HMAC keys, this is always - // storage#hmacKey. - Kind string `json:"kind,omitempty"` - - // Metadata: Key metadata. - Metadata *HmacKeyMetadata `json:"metadata,omitempty"` - - // Secret: HMAC secret key material. - Secret string `json:"secret,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Kind") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Kind") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *HmacKey) MarshalJSON() ([]byte, error) { - type NoMethod HmacKey - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key -// metadata resource. -type HmacKeyMetadata struct { - // AccessId: The ID of the HMAC Key. - AccessId string `json:"accessId,omitempty"` - - // Etag: HTTP 1.1 Entity tag for the HMAC key. - Etag string `json:"etag,omitempty"` - - // Id: The ID of the HMAC key, including the Project ID and the Access - // ID. - Id string `json:"id,omitempty"` - - // Kind: The kind of item this is. For HMAC Key metadata, this is always - // storage#hmacKeyMetadata. - Kind string `json:"kind,omitempty"` - - // ProjectId: Project ID owning the service account to which the key - // authenticates. - ProjectId string `json:"projectId,omitempty"` - - // SelfLink: The link to this resource. - SelfLink string `json:"selfLink,omitempty"` - - // ServiceAccountEmail: The email address of the key's associated - // service account. - ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` - - // State: The state of the key. Can be one of ACTIVE, INACTIVE, or - // DELETED. - State string `json:"state,omitempty"` - - // TimeCreated: The creation time of the HMAC key in RFC 3339 format. - TimeCreated string `json:"timeCreated,omitempty"` - - // Updated: The last modification time of the HMAC key metadata in RFC - // 3339 format. - Updated string `json:"updated,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "AccessId") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "AccessId") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) { - type NoMethod HmacKeyMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// HmacKeysMetadata: A list of hmacKeys. -type HmacKeysMetadata struct { - // Items: The list of items. - Items []*HmacKeyMetadata `json:"items,omitempty"` - - // Kind: The kind of item this is. For lists of hmacKeys, this is always - // storage#hmacKeysMetadata. - Kind string `json:"kind,omitempty"` - - // NextPageToken: The continuation token, used to page through large - // result sets. Provide this value in a subsequent request to return the - // next page of results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Items") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Items") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) { - type NoMethod HmacKeysMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Notification: A subscription to receive Google PubSub notifications. -type Notification struct { - // CustomAttributes: An optional list of additional attributes to attach - // to each Cloud PubSub message published for this notification - // subscription. - CustomAttributes map[string]string `json:"custom_attributes,omitempty"` - - // Etag: HTTP 1.1 Entity tag for this subscription notification. - Etag string `json:"etag,omitempty"` - - // EventTypes: If present, only send notifications about listed event - // types. If empty, sent notifications for all event types. - EventTypes []string `json:"event_types,omitempty"` - - // Id: The ID of the notification. - Id string `json:"id,omitempty"` - - // Kind: The kind of item this is. For notifications, this is always - // storage#notification. - Kind string `json:"kind,omitempty"` - - // ObjectNamePrefix: If present, only apply this notification - // configuration to object names that begin with this prefix. - ObjectNamePrefix string `json:"object_name_prefix,omitempty"` - - // PayloadFormat: The desired content of the Payload. - PayloadFormat string `json:"payload_format,omitempty"` - - // SelfLink: The canonical URL of this notification. - SelfLink string `json:"selfLink,omitempty"` - - // Topic: The Cloud PubSub topic to which this subscription publishes. - // Formatted as: - // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi - // c}' - Topic string `json:"topic,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "CustomAttributes") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "CustomAttributes") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *Notification) MarshalJSON() ([]byte, error) { - type NoMethod Notification - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Notifications: A list of notification subscriptions. -type Notifications struct { - // Items: The list of items. - Items []*Notification `json:"items,omitempty"` - - // Kind: The kind of item this is. For lists of notifications, this is - // always storage#notifications. - Kind string `json:"kind,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Items") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Items") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Notifications) MarshalJSON() ([]byte, error) { - type NoMethod Notifications - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Object: An object. -type Object struct { - // Acl: Access controls on the object. - Acl []*ObjectAccessControl `json:"acl,omitempty"` - - // Bucket: The name of the bucket containing this object. - Bucket string `json:"bucket,omitempty"` - - // CacheControl: Cache-Control directive for the object data. If - // omitted, and the object is accessible to all anonymous users, the - // default will be public, max-age=3600. - CacheControl string `json:"cacheControl,omitempty"` - - // ComponentCount: Number of underlying components that make up this - // object. Components are accumulated by compose operations. - ComponentCount int64 `json:"componentCount,omitempty"` - - // ContentDisposition: Content-Disposition of the object data. - ContentDisposition string `json:"contentDisposition,omitempty"` - - // ContentEncoding: Content-Encoding of the object data. - ContentEncoding string `json:"contentEncoding,omitempty"` - - // ContentLanguage: Content-Language of the object data. - ContentLanguage string `json:"contentLanguage,omitempty"` - - // ContentType: Content-Type of the object data. If an object is stored - // without a Content-Type, it is served as application/octet-stream. - ContentType string `json:"contentType,omitempty"` - - // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B; - // encoded using base64 in big-endian byte order. For more information - // about using the CRC32c checksum, see Hashes and ETags: Best - // Practices. - Crc32c string `json:"crc32c,omitempty"` - - // CustomTime: A timestamp in RFC 3339 format specified by the user for - // an object. - CustomTime string `json:"customTime,omitempty"` - - // CustomerEncryption: Metadata of customer-supplied encryption key, if - // the object is encrypted by such a key. - CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"` - - // Etag: HTTP 1.1 Entity tag for the object. - Etag string `json:"etag,omitempty"` - - // EventBasedHold: Whether an object is under event-based hold. - // Event-based hold is a way to retain objects until an event occurs, - // which is signified by the hold's release (i.e. this value is set to - // false). After being released (set to false), such objects will be - // subject to bucket-level retention (if any). One sample use case of - // this flag is for banks to hold loan documents for at least 3 years - // after loan is paid in full. Here, bucket-level retention is 3 years - // and the event is the loan being paid in full. In this example, these - // objects will be held intact for any number of years until the event - // has occurred (event-based hold on the object is released) and then 3 - // more years after that. That means retention duration of the objects - // begins from the moment event-based hold transitioned from true to - // false. - EventBasedHold bool `json:"eventBasedHold,omitempty"` - - // Generation: The content generation of this object. Used for object - // versioning. - Generation int64 `json:"generation,omitempty,string"` - - // Id: The ID of the object, including the bucket name, object name, and - // generation number. - Id string `json:"id,omitempty"` - - // Kind: The kind of item this is. For objects, this is always - // storage#object. - Kind string `json:"kind,omitempty"` - - // KmsKeyName: Not currently supported. Specifying the parameter causes - // the request to fail with status code 400 - Bad Request. - KmsKeyName string `json:"kmsKeyName,omitempty"` - - // Md5Hash: MD5 hash of the data; encoded using base64. For more - // information about using the MD5 hash, see Hashes and ETags: Best - // Practices. - Md5Hash string `json:"md5Hash,omitempty"` - - // MediaLink: Media download link. - MediaLink string `json:"mediaLink,omitempty"` - - // Metadata: User-provided metadata, in key/value pairs. - Metadata map[string]string `json:"metadata,omitempty"` - - // Metageneration: The version of the metadata for this object at this - // generation. Used for preconditions and for detecting changes in - // metadata. A metageneration number is only meaningful in the context - // of a particular generation of a particular object. - Metageneration int64 `json:"metageneration,omitempty,string"` - - // Name: The name of the object. Required if not specified by URL - // parameter. - Name string `json:"name,omitempty"` - - // Owner: The owner of the object. This will always be the uploader of - // the object. - Owner *ObjectOwner `json:"owner,omitempty"` - - // RetentionExpirationTime: A server-determined value that specifies the - // earliest time that the object's retention period expires. This value - // is in RFC 3339 format. Note 1: This field is not provided for objects - // with an active event-based hold, since retention expiration is - // unknown until the hold is removed. Note 2: This value can be provided - // even when temporary hold is set (so that the user can reason about - // policy without having to first unset the temporary hold). - RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"` - - // SelfLink: The link to this object. - SelfLink string `json:"selfLink,omitempty"` - - // Size: Content-Length of the data in bytes. - Size uint64 `json:"size,omitempty,string"` - - // StorageClass: Storage class of the object. - StorageClass string `json:"storageClass,omitempty"` - - // TemporaryHold: Whether an object is under temporary hold. While this - // flag is set to true, the object is protected against deletion and - // overwrites. A common use case of this flag is regulatory - // investigations where objects need to be retained while the - // investigation is ongoing. Note that unlike event-based hold, - // temporary hold does not impact retention expiration time of an - // object. - TemporaryHold bool `json:"temporaryHold,omitempty"` - - // TimeCreated: The creation time of the object in RFC 3339 format. - TimeCreated string `json:"timeCreated,omitempty"` - - // TimeDeleted: The deletion time of the object in RFC 3339 format. Will - // be returned if and only if this version of the object has been - // deleted. - TimeDeleted string `json:"timeDeleted,omitempty"` - - // TimeStorageClassUpdated: The time at which the object's storage class - // was last changed. When the object is initially created, it will be - // set to timeCreated. - TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"` - - // Updated: The modification time of the object metadata in RFC 3339 - // format. - Updated string `json:"updated,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Acl") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Acl") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Object) MarshalJSON() ([]byte, error) { - type NoMethod Object - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ObjectCustomerEncryption: Metadata of customer-supplied encryption -// key, if the object is encrypted by such a key. -type ObjectCustomerEncryption struct { - // EncryptionAlgorithm: The encryption algorithm. - EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"` - - // KeySha256: SHA256 hash value of the encryption key. - KeySha256 string `json:"keySha256,omitempty"` - - // ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm") - // to unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "EncryptionAlgorithm") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) { - type NoMethod ObjectCustomerEncryption - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ObjectOwner: The owner of the object. This will always be the -// uploader of the object. -type ObjectOwner struct { - // Entity: The entity, in the form user-userId. - Entity string `json:"entity,omitempty"` - - // EntityId: The ID for the entity. - EntityId string `json:"entityId,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Entity") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Entity") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ObjectOwner) MarshalJSON() ([]byte, error) { - type NoMethod ObjectOwner - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ObjectAccessControl: An access-control entry. -type ObjectAccessControl struct { - // Bucket: The name of the bucket. - Bucket string `json:"bucket,omitempty"` - - // Domain: The domain associated with the entity, if any. - Domain string `json:"domain,omitempty"` - - // Email: The email address associated with the entity, if any. - Email string `json:"email,omitempty"` - - // Entity: The entity holding the permission, in one of the following - // forms: - // - user-userId - // - user-email - // - group-groupId - // - group-email - // - domain-domain - // - project-team-projectId - // - allUsers - // - allAuthenticatedUsers Examples: - // - The user liz@example.com would be user-liz@example.com. - // - The group example@googlegroups.com would be - // group-example@googlegroups.com. - // - To refer to all members of the Google Apps for Business domain - // example.com, the entity would be domain-example.com. - Entity string `json:"entity,omitempty"` - - // EntityId: The ID for the entity, if any. - EntityId string `json:"entityId,omitempty"` - - // Etag: HTTP 1.1 Entity tag for the access-control entry. - Etag string `json:"etag,omitempty"` - - // Generation: The content generation of the object, if applied to an - // object. - Generation int64 `json:"generation,omitempty,string"` - - // Id: The ID of the access-control entry. - Id string `json:"id,omitempty"` - - // Kind: The kind of item this is. For object access control entries, - // this is always storage#objectAccessControl. - Kind string `json:"kind,omitempty"` - - // Object: The name of the object, if applied to an object. - Object string `json:"object,omitempty"` - - // ProjectTeam: The project team associated with the entity, if any. - ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"` - - // Role: The access permission for the entity. - Role string `json:"role,omitempty"` - - // SelfLink: The link to this access-control entry. - SelfLink string `json:"selfLink,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Bucket") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Bucket") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { - type NoMethod ObjectAccessControl - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ObjectAccessControlProjectTeam: The project team associated with the -// entity, if any. -type ObjectAccessControlProjectTeam struct { - // ProjectNumber: The project number. - ProjectNumber string `json:"projectNumber,omitempty"` - - // Team: The team. - Team string `json:"team,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ProjectNumber") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ProjectNumber") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) { - type NoMethod ObjectAccessControlProjectTeam - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ObjectAccessControls: An access-control list. -type ObjectAccessControls struct { - // Items: The list of items. - Items []*ObjectAccessControl `json:"items,omitempty"` - - // Kind: The kind of item this is. For lists of object access control - // entries, this is always storage#objectAccessControls. - Kind string `json:"kind,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Items") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Items") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { - type NoMethod ObjectAccessControls - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Objects: A list of objects. -type Objects struct { - // Items: The list of items. - Items []*Object `json:"items,omitempty"` - - // Kind: The kind of item this is. For lists of objects, this is always - // storage#objects. - Kind string `json:"kind,omitempty"` - - // NextPageToken: The continuation token, used to page through large - // result sets. Provide this value in a subsequent request to return the - // next page of results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // Prefixes: The list of prefixes of objects matching-but-not-listed up - // to and including the requested delimiter. - Prefixes []string `json:"prefixes,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Items") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Items") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Objects) MarshalJSON() ([]byte, error) { - type NoMethod Objects - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Policy: A bucket/object IAM policy. -type Policy struct { - // Bindings: An association between a role, which comes with a set of - // permissions, and members who may assume that role. - Bindings []*PolicyBindings `json:"bindings,omitempty"` - - // Etag: HTTP 1.1 Entity tag for the policy. - Etag string `json:"etag,omitempty"` - - // Kind: The kind of item this is. For policies, this is always - // storage#policy. This field is ignored on input. - Kind string `json:"kind,omitempty"` - - // ResourceId: The ID of the resource to which this policy belongs. Will - // be of the form projects/_/buckets/bucket for buckets, and - // projects/_/buckets/bucket/objects/object for objects. A specific - // generation may be specified by appending #generationNumber to the end - // of the object name, e.g. - // projects/_/buckets/my-bucket/objects/data.txt#17. The current - // generation can be denoted with #0. This field is ignored on input. - ResourceId string `json:"resourceId,omitempty"` - - // Version: The IAM policy format version. - Version int64 `json:"version,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Bindings") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Bindings") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Policy) MarshalJSON() ([]byte, error) { - type NoMethod Policy - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type PolicyBindings struct { - // Condition: The condition that is associated with this binding. NOTE: - // an unsatisfied condition will not allow user access via current - // binding. Different bindings, including their conditions, are examined - // independently. - Condition *Expr `json:"condition,omitempty"` - - // Members: A collection of identifiers for members who may assume the - // provided role. Recognized identifiers are as follows: - // - allUsers — A special identifier that represents anyone on the - // internet; with or without a Google account. - // - allAuthenticatedUsers — A special identifier that represents - // anyone who is authenticated with a Google account or a service - // account. - // - user:emailid — An email address that represents a specific - // account. For example, user:alice@gmail.com or user:joe@example.com. - // - // - serviceAccount:emailid — An email address that represents a - // service account. For example, - // serviceAccount:my-other-app@appspot.gserviceaccount.com . - // - group:emailid — An email address that represents a Google group. - // For example, group:admins@example.com. - // - domain:domain — A Google Apps domain name that represents all the - // users of that domain. For example, domain:google.com or - // domain:example.com. - // - projectOwner:projectid — Owners of the given project. For - // example, projectOwner:my-example-project - // - projectEditor:projectid — Editors of the given project. For - // example, projectEditor:my-example-project - // - projectViewer:projectid — Viewers of the given project. For - // example, projectViewer:my-example-project - Members []string `json:"members,omitempty"` - - // Role: The role to which members belong. Two types of roles are - // supported: new IAM roles, which grant permissions that do not map - // directly to those provided by ACLs, and legacy IAM roles, which do - // map directly to ACL permissions. All roles are of the format - // roles/storage.specificRole. - // The new IAM roles are: - // - roles/storage.admin — Full control of Google Cloud Storage - // resources. - // - roles/storage.objectViewer — Read-Only access to Google Cloud - // Storage objects. - // - roles/storage.objectCreator — Access to create objects in Google - // Cloud Storage. - // - roles/storage.objectAdmin — Full control of Google Cloud Storage - // objects. The legacy IAM roles are: - // - roles/storage.legacyObjectReader — Read-only access to objects - // without listing. Equivalent to an ACL entry on an object with the - // READER role. - // - roles/storage.legacyObjectOwner — Read/write access to existing - // objects without listing. Equivalent to an ACL entry on an object with - // the OWNER role. - // - roles/storage.legacyBucketReader — Read access to buckets with - // object listing. Equivalent to an ACL entry on a bucket with the - // READER role. - // - roles/storage.legacyBucketWriter — Read access to buckets with - // object listing/creation/deletion. Equivalent to an ACL entry on a - // bucket with the WRITER role. - // - roles/storage.legacyBucketOwner — Read and write access to - // existing buckets with object listing/creation/deletion. Equivalent to - // an ACL entry on a bucket with the OWNER role. - Role string `json:"role,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Condition") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Condition") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *PolicyBindings) MarshalJSON() ([]byte, error) { - type NoMethod PolicyBindings - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// RewriteResponse: A rewrite response. -type RewriteResponse struct { - // Done: true if the copy is finished; otherwise, false if the copy is - // in progress. This property is always present in the response. - Done bool `json:"done,omitempty"` - - // Kind: The kind of item this is. - Kind string `json:"kind,omitempty"` - - // ObjectSize: The total size of the object being copied in bytes. This - // property is always present in the response. - ObjectSize int64 `json:"objectSize,omitempty,string"` - - // Resource: A resource containing the metadata for the copied-to - // object. This property is present in the response only when copying - // completes. - Resource *Object `json:"resource,omitempty"` - - // RewriteToken: A token to use in subsequent requests to continue - // copying data. This token is present in the response only when there - // is more data to copy. - RewriteToken string `json:"rewriteToken,omitempty"` - - // TotalBytesRewritten: The total bytes written so far, which can be - // used to provide a waiting user with a progress indicator. This - // property is always present in the response. - TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Done") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Done") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *RewriteResponse) MarshalJSON() ([]byte, error) { - type NoMethod RewriteResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ServiceAccount: A subscription to receive Google PubSub -// notifications. -type ServiceAccount struct { - // EmailAddress: The ID of the notification. - EmailAddress string `json:"email_address,omitempty"` - - // Kind: The kind of item this is. For notifications, this is always - // storage#notification. - Kind string `json:"kind,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "EmailAddress") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "EmailAddress") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ServiceAccount) MarshalJSON() ([]byte, error) { - type NoMethod ServiceAccount - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// TestIamPermissionsResponse: A -// storage.(buckets|objects).testIamPermissions response. -type TestIamPermissionsResponse struct { - // Kind: The kind of item this is. - Kind string `json:"kind,omitempty"` - - // Permissions: The permissions held by the caller. Permissions are - // always of the format storage.resource.capability, where resource is - // one of buckets or objects. The supported permissions are as follows: - // - // - storage.buckets.delete — Delete bucket. - // - storage.buckets.get — Read bucket metadata. - // - storage.buckets.getIamPolicy — Read bucket IAM policy. - // - storage.buckets.create — Create bucket. - // - storage.buckets.list — List buckets. - // - storage.buckets.setIamPolicy — Update bucket IAM policy. - // - storage.buckets.update — Update bucket metadata. - // - storage.objects.delete — Delete object. - // - storage.objects.get — Read object data and metadata. - // - storage.objects.getIamPolicy — Read object IAM policy. - // - storage.objects.create — Create object. - // - storage.objects.list — List objects. - // - storage.objects.setIamPolicy — Update object IAM policy. - // - storage.objects.update — Update object metadata. - Permissions []string `json:"permissions,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Kind") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Kind") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { - type NoMethod TestIamPermissionsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// method id "storage.bucketAccessControls.delete": - -type BucketAccessControlsDeleteCall struct { - s *Service - bucket string - entity string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Permanently deletes the ACL entry for the specified entity on -// the specified bucket. -func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall { - c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsDeleteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketAccessControlsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.bucketAccessControls.delete" call. -func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", - // "httpMethod": "DELETE", - // "id": "storage.bucketAccessControls.delete", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/acl/{entity}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.bucketAccessControls.get": - -type BucketAccessControlsGetCall struct { - s *Service - bucket string - entity string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Returns the ACL entry for the specified entity on the specified -// bucket. -func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall { - c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketAccessControlsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.bucketAccessControls.get" call. -// Exactly one of *BucketAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BucketAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &BucketAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns the ACL entry for the specified entity on the specified bucket.", - // "httpMethod": "GET", - // "id": "storage.bucketAccessControls.get", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/acl/{entity}", - // "response": { - // "$ref": "BucketAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.bucketAccessControls.insert": - -type BucketAccessControlsInsertCall struct { - s *Service - bucket string - bucketaccesscontrol *BucketAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a new ACL entry on the specified bucket. -func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall { - c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.bucketaccesscontrol = bucketaccesscontrol - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsInsertCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketAccessControlsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.bucketAccessControls.insert" call. -// Exactly one of *BucketAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BucketAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &BucketAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a new ACL entry on the specified bucket.", - // "httpMethod": "POST", - // "id": "storage.bucketAccessControls.insert", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/acl", - // "request": { - // "$ref": "BucketAccessControl" - // }, - // "response": { - // "$ref": "BucketAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.bucketAccessControls.list": - -type BucketAccessControlsListCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves ACL entries on the specified bucket. -func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall { - c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsListCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketAccessControlsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.bucketAccessControls.list" call. -// Exactly one of *BucketAccessControls or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BucketAccessControls.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &BucketAccessControls{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves ACL entries on the specified bucket.", - // "httpMethod": "GET", - // "id": "storage.bucketAccessControls.list", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/acl", - // "response": { - // "$ref": "BucketAccessControls" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.bucketAccessControls.patch": - -type BucketAccessControlsPatchCall struct { - s *Service - bucket string - entity string - bucketaccesscontrol *BucketAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches an ACL entry on the specified bucket. -func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall { - c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - c.bucketaccesscontrol = bucketaccesscontrol - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsPatchCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketAccessControlsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.bucketAccessControls.patch" call. -// Exactly one of *BucketAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BucketAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &BucketAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Patches an ACL entry on the specified bucket.", - // "httpMethod": "PATCH", - // "id": "storage.bucketAccessControls.patch", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/acl/{entity}", - // "request": { - // "$ref": "BucketAccessControl" - // }, - // "response": { - // "$ref": "BucketAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.bucketAccessControls.update": - -type BucketAccessControlsUpdateCall struct { - s *Service - bucket string - entity string - bucketaccesscontrol *BucketAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates an ACL entry on the specified bucket. -func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall { - c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - c.bucketaccesscontrol = bucketaccesscontrol - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsUpdateCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketAccessControlsUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.bucketAccessControls.update" call. -// Exactly one of *BucketAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BucketAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &BucketAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates an ACL entry on the specified bucket.", - // "httpMethod": "PUT", - // "id": "storage.bucketAccessControls.update", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/acl/{entity}", - // "request": { - // "$ref": "BucketAccessControl" - // }, - // "response": { - // "$ref": "BucketAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.buckets.delete": - -type BucketsDeleteCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Permanently deletes an empty bucket. -func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall { - c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": If set, only deletes the bucket if its -// metageneration matches this value. -func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": If set, only deletes the bucket if its -// metageneration does not match this value. -func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketsDeleteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.delete" call. -func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Permanently deletes an empty bucket.", - // "httpMethod": "DELETE", - // "id": "storage.buckets.delete", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "If set, only deletes the bucket if its metageneration matches this value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "If set, only deletes the bucket if its metageneration does not match this value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.buckets.get": - -type BucketsGetCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Returns metadata for the specified bucket. -func (r *BucketsService) Get(bucket string) *BucketsGetCall { - c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the return of the bucket metadata -// conditional on whether the bucket's current metageneration matches -// the given value. -func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the return of the bucket metadata -// conditional on whether the bucket's current metageneration does not -// match the given value. -func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit owner, acl and defaultObjectAcl properties. -func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.get" call. -// Exactly one of *Bucket or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bucket.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Bucket{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns metadata for the specified bucket.", - // "httpMethod": "GET", - // "id": "storage.buckets.get", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit owner, acl and defaultObjectAcl properties." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}", - // "response": { - // "$ref": "Bucket" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.buckets.getIamPolicy": - -type BucketsGetIamPolicyCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// GetIamPolicy: Returns an IAM policy for the specified bucket. -func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall { - c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": The IAM policy format version to be -// returned. If the optionsRequestedPolicyVersion is for an older -// version that doesn't support part of the requested IAM policy, the -// request fails. -func (c *BucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BucketsGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetIamPolicyCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsGetIamPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Policy{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns an IAM policy for the specified bucket.", - // "httpMethod": "GET", - // "id": "storage.buckets.getIamPolicy", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "optionsRequestedPolicyVersion": { - // "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", - // "format": "int32", - // "location": "query", - // "minimum": "1", - // "type": "integer" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/iam", - // "response": { - // "$ref": "Policy" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.buckets.insert": - -type BucketsInsertCall struct { - s *Service - bucket *Bucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a new bucket. -func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall { - c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.urlParams_.Set("project", projectid) - c.bucket = bucket - return c -} - -// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a -// predefined set of access controls to this bucket. -// -// Possible values: -// "authenticatedRead" - Project team owners get OWNER access, and -// allAuthenticatedUsers get READER access. -// "private" - Project team owners get OWNER access. -// "projectPrivate" - Project team members get access according to -// their roles. -// "publicRead" - Project team owners get OWNER access, and allUsers -// get READER access. -// "publicReadWrite" - Project team owners get OWNER access, and -// allUsers get WRITER access. -func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall { - c.urlParams_.Set("predefinedAcl", predefinedAcl) - return c -} - -// PredefinedDefaultObjectAcl sets the optional parameter -// "predefinedDefaultObjectAcl": Apply a predefined set of default -// object access controls to this bucket. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall { - c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl, unless the bucket resource -// specifies acl or defaultObjectAcl properties, when it defaults to -// full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit owner, acl and defaultObjectAcl properties. -func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketsInsertCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.insert" call. -// Exactly one of *Bucket or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bucket.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Bucket{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a new bucket.", - // "httpMethod": "POST", - // "id": "storage.buckets.insert", - // "parameterOrder": [ - // "project" - // ], - // "parameters": { - // "predefinedAcl": { - // "description": "Apply a predefined set of access controls to this bucket.", - // "enum": [ - // "authenticatedRead", - // "private", - // "projectPrivate", - // "publicRead", - // "publicReadWrite" - // ], - // "enumDescriptions": [ - // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - // "Project team owners get OWNER access.", - // "Project team members get access according to their roles.", - // "Project team owners get OWNER access, and allUsers get READER access.", - // "Project team owners get OWNER access, and allUsers get WRITER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "predefinedDefaultObjectAcl": { - // "description": "Apply a predefined set of default object access controls to this bucket.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "project": { - // "description": "A valid API project identifier.", - // "location": "query", - // "required": true, - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit owner, acl and defaultObjectAcl properties." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b", - // "request": { - // "$ref": "Bucket" - // }, - // "response": { - // "$ref": "Bucket" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.buckets.list": - -type BucketsListCall struct { - s *Service - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves a list of buckets for a given project. -func (r *BucketsService) List(projectid string) *BucketsListCall { - c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.urlParams_.Set("project", projectid) - return c -} - -// MaxResults sets the optional parameter "maxResults": Maximum number -// of buckets to return in a single response. The service will use this -// parameter or 1,000 items, whichever is smaller. -func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": A -// previously-returned page token representing part of the larger set of -// results to view. -func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Prefix sets the optional parameter "prefix": Filter results to -// buckets whose names begin with this prefix. -func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall { - c.urlParams_.Set("prefix", prefix) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit owner, acl and defaultObjectAcl properties. -func (c *BucketsListCall) Projection(projection string) *BucketsListCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketsListCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.list" call. -// Exactly one of *Buckets or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Buckets.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Buckets{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves a list of buckets for a given project.", - // "httpMethod": "GET", - // "id": "storage.buckets.list", - // "parameterOrder": [ - // "project" - // ], - // "parameters": { - // "maxResults": { - // "default": "1000", - // "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", - // "format": "uint32", - // "location": "query", - // "minimum": "0", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A previously-returned page token representing part of the larger set of results to view.", - // "location": "query", - // "type": "string" - // }, - // "prefix": { - // "description": "Filter results to buckets whose names begin with this prefix.", - // "location": "query", - // "type": "string" - // }, - // "project": { - // "description": "A valid API project identifier.", - // "location": "query", - // "required": true, - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit owner, acl and defaultObjectAcl properties." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b", - // "response": { - // "$ref": "Buckets" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "storage.buckets.lockRetentionPolicy": - -type BucketsLockRetentionPolicyCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// LockRetentionPolicy: Locks retention policy on a bucket. -func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall { - c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsLockRetentionPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsLockRetentionPolicyCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsLockRetentionPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.lockRetentionPolicy" call. -// Exactly one of *Bucket or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bucket.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Bucket{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Locks retention policy on a bucket.", - // "httpMethod": "POST", - // "id": "storage.buckets.lockRetentionPolicy", - // "parameterOrder": [ - // "bucket", - // "ifMetagenerationMatch" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/lockRetentionPolicy", - // "response": { - // "$ref": "Bucket" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.buckets.patch": - -type BucketsPatchCall struct { - s *Service - bucket string - bucket2 *Bucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches a bucket. Changes to the bucket will be readable -// immediately after writing, but configuration changes may take time to -// propagate. -func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall { - c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.bucket2 = bucket2 - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the return of the bucket metadata -// conditional on whether the bucket's current metageneration matches -// the given value. -func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the return of the bucket metadata -// conditional on whether the bucket's current metageneration does not -// match the given value. -func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a -// predefined set of access controls to this bucket. -// -// Possible values: -// "authenticatedRead" - Project team owners get OWNER access, and -// allAuthenticatedUsers get READER access. -// "private" - Project team owners get OWNER access. -// "projectPrivate" - Project team members get access according to -// their roles. -// "publicRead" - Project team owners get OWNER access, and allUsers -// get READER access. -// "publicReadWrite" - Project team owners get OWNER access, and -// allUsers get WRITER access. -func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall { - c.urlParams_.Set("predefinedAcl", predefinedAcl) - return c -} - -// PredefinedDefaultObjectAcl sets the optional parameter -// "predefinedDefaultObjectAcl": Apply a predefined set of default -// object access controls to this bucket. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall { - c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit owner, acl and defaultObjectAcl properties. -func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketsPatchCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.patch" call. -// Exactly one of *Bucket or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bucket.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Bucket{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - // "httpMethod": "PATCH", - // "id": "storage.buckets.patch", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "predefinedAcl": { - // "description": "Apply a predefined set of access controls to this bucket.", - // "enum": [ - // "authenticatedRead", - // "private", - // "projectPrivate", - // "publicRead", - // "publicReadWrite" - // ], - // "enumDescriptions": [ - // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - // "Project team owners get OWNER access.", - // "Project team members get access according to their roles.", - // "Project team owners get OWNER access, and allUsers get READER access.", - // "Project team owners get OWNER access, and allUsers get WRITER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "predefinedDefaultObjectAcl": { - // "description": "Apply a predefined set of default object access controls to this bucket.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit owner, acl and defaultObjectAcl properties." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}", - // "request": { - // "$ref": "Bucket" - // }, - // "response": { - // "$ref": "Bucket" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.buckets.setIamPolicy": - -type BucketsSetIamPolicyCall struct { - s *Service - bucket string - policy *Policy - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// SetIamPolicy: Updates an IAM policy for the specified bucket. -func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall { - c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.policy = policy - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsSetIamPolicyCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsSetIamPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.setIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Policy{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates an IAM policy for the specified bucket.", - // "httpMethod": "PUT", - // "id": "storage.buckets.setIamPolicy", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/iam", - // "request": { - // "$ref": "Policy" - // }, - // "response": { - // "$ref": "Policy" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.buckets.testIamPermissions": - -type BucketsTestIamPermissionsCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// TestIamPermissions: Tests a set of permissions on the given bucket to -// see which, if any, are held by the caller. -func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall { - c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.urlParams_.SetMulti("permissions", append([]string{}, permissions...)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *BucketsTestIamPermissionsCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsTestIamPermissionsCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.testIamPermissions" call. -// Exactly one of *TestIamPermissionsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TestIamPermissionsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &TestIamPermissionsResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", - // "httpMethod": "GET", - // "id": "storage.buckets.testIamPermissions", - // "parameterOrder": [ - // "bucket", - // "permissions" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "permissions": { - // "description": "Permissions to test.", - // "location": "query", - // "repeated": true, - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/iam/testPermissions", - // "response": { - // "$ref": "TestIamPermissionsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.buckets.update": - -type BucketsUpdateCall struct { - s *Service - bucket string - bucket2 *Bucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates a bucket. Changes to the bucket will be readable -// immediately after writing, but configuration changes may take time to -// propagate. -func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall { - c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.bucket2 = bucket2 - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the return of the bucket metadata -// conditional on whether the bucket's current metageneration matches -// the given value. -func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the return of the bucket metadata -// conditional on whether the bucket's current metageneration does not -// match the given value. -func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a -// predefined set of access controls to this bucket. -// -// Possible values: -// "authenticatedRead" - Project team owners get OWNER access, and -// allAuthenticatedUsers get READER access. -// "private" - Project team owners get OWNER access. -// "projectPrivate" - Project team members get access according to -// their roles. -// "publicRead" - Project team owners get OWNER access, and allUsers -// get READER access. -// "publicReadWrite" - Project team owners get OWNER access, and -// allUsers get WRITER access. -func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall { - c.urlParams_.Set("predefinedAcl", predefinedAcl) - return c -} - -// PredefinedDefaultObjectAcl sets the optional parameter -// "predefinedDefaultObjectAcl": Apply a predefined set of default -// object access controls to this bucket. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall { - c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit owner, acl and defaultObjectAcl properties. -func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *BucketsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketsUpdateCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BucketsUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.buckets.update" call. -// Exactly one of *Bucket or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bucket.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Bucket{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - // "httpMethod": "PUT", - // "id": "storage.buckets.update", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "predefinedAcl": { - // "description": "Apply a predefined set of access controls to this bucket.", - // "enum": [ - // "authenticatedRead", - // "private", - // "projectPrivate", - // "publicRead", - // "publicReadWrite" - // ], - // "enumDescriptions": [ - // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - // "Project team owners get OWNER access.", - // "Project team members get access according to their roles.", - // "Project team owners get OWNER access, and allUsers get READER access.", - // "Project team owners get OWNER access, and allUsers get WRITER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "predefinedDefaultObjectAcl": { - // "description": "Apply a predefined set of default object access controls to this bucket.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit owner, acl and defaultObjectAcl properties." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}", - // "request": { - // "$ref": "Bucket" - // }, - // "response": { - // "$ref": "Bucket" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.channels.stop": - -type ChannelsStopCall struct { - s *Service - channel *Channel - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Stop: Stop watching resources through this channel -func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { - c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.channel = channel - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ChannelsStopCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.channels.stop" call. -func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Stop watching resources through this channel", - // "httpMethod": "POST", - // "id": "storage.channels.stop", - // "path": "channels/stop", - // "request": { - // "$ref": "Channel", - // "parameterName": "resource" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.defaultObjectAccessControls.delete": - -type DefaultObjectAccessControlsDeleteCall struct { - s *Service - bucket string - entity string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Permanently deletes the default object ACL entry for the -// specified entity on the specified bucket. -func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall { - c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *DefaultObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsDeleteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.defaultObjectAccessControls.delete" call. -func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", - // "httpMethod": "DELETE", - // "id": "storage.defaultObjectAccessControls.delete", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/defaultObjectAcl/{entity}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.defaultObjectAccessControls.get": - -type DefaultObjectAccessControlsGetCall struct { - s *Service - bucket string - entity string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Returns the default object ACL entry for the specified entity on -// the specified bucket. -func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall { - c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *DefaultObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *DefaultObjectAccessControlsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.defaultObjectAccessControls.get" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", - // "httpMethod": "GET", - // "id": "storage.defaultObjectAccessControls.get", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/defaultObjectAcl/{entity}", - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.defaultObjectAccessControls.insert": - -type DefaultObjectAccessControlsInsertCall struct { - s *Service - bucket string - objectaccesscontrol *ObjectAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a new default object ACL entry on the specified -// bucket. -func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall { - c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.objectaccesscontrol = objectaccesscontrol - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *DefaultObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsInsertCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.defaultObjectAccessControls.insert" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a new default object ACL entry on the specified bucket.", - // "httpMethod": "POST", - // "id": "storage.defaultObjectAccessControls.insert", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/defaultObjectAcl", - // "request": { - // "$ref": "ObjectAccessControl" - // }, - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.defaultObjectAccessControls.list": - -type DefaultObjectAccessControlsListCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves default object ACL entries on the specified bucket. -func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall { - c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": If present, only return default ACL listing -// if the bucket's current metageneration matches this value. -func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": If present, only return default ACL -// listing if the bucket's current metageneration does not match the -// given value. -func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *DefaultObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsListCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *DefaultObjectAccessControlsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.defaultObjectAccessControls.list" call. -// Exactly one of *ObjectAccessControls or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControls.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControls{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves default object ACL entries on the specified bucket.", - // "httpMethod": "GET", - // "id": "storage.defaultObjectAccessControls.list", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/defaultObjectAcl", - // "response": { - // "$ref": "ObjectAccessControls" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.defaultObjectAccessControls.patch": - -type DefaultObjectAccessControlsPatchCall struct { - s *Service - bucket string - entity string - objectaccesscontrol *ObjectAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches a default object ACL entry on the specified bucket. -func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall { - c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - c.objectaccesscontrol = objectaccesscontrol - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *DefaultObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsPatchCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.defaultObjectAccessControls.patch" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Patches a default object ACL entry on the specified bucket.", - // "httpMethod": "PATCH", - // "id": "storage.defaultObjectAccessControls.patch", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/defaultObjectAcl/{entity}", - // "request": { - // "$ref": "ObjectAccessControl" - // }, - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.defaultObjectAccessControls.update": - -type DefaultObjectAccessControlsUpdateCall struct { - s *Service - bucket string - entity string - objectaccesscontrol *ObjectAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates a default object ACL entry on the specified bucket. -func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall { - c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.entity = entity - c.objectaccesscontrol = objectaccesscontrol - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *DefaultObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsUpdateCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.defaultObjectAccessControls.update" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a default object ACL entry on the specified bucket.", - // "httpMethod": "PUT", - // "id": "storage.defaultObjectAccessControls.update", - // "parameterOrder": [ - // "bucket", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/defaultObjectAcl/{entity}", - // "request": { - // "$ref": "ObjectAccessControl" - // }, - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.notifications.delete": - -type NotificationsDeleteCall struct { - s *Service - bucket string - notification string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Permanently deletes a notification subscription. -func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall { - c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.notification = notification - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *NotificationsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsDeleteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *NotificationsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "notification": c.notification, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.notifications.delete" call. -func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Permanently deletes a notification subscription.", - // "httpMethod": "DELETE", - // "id": "storage.notifications.delete", - // "parameterOrder": [ - // "bucket", - // "notification" - // ], - // "parameters": { - // "bucket": { - // "description": "The parent bucket of the notification.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "notification": { - // "description": "ID of the notification to delete.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/notificationConfigs/{notification}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.notifications.get": - -type NotificationsGetCall struct { - s *Service - bucket string - notification string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: View a notification configuration. -func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall { - c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.notification = notification - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *NotificationsGetCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *NotificationsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "notification": c.notification, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.notifications.get" call. -// Exactly one of *Notification or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Notification.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Notification{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "View a notification configuration.", - // "httpMethod": "GET", - // "id": "storage.notifications.get", - // "parameterOrder": [ - // "bucket", - // "notification" - // ], - // "parameters": { - // "bucket": { - // "description": "The parent bucket of the notification.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "notification": { - // "description": "Notification ID", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/notificationConfigs/{notification}", - // "response": { - // "$ref": "Notification" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.notifications.insert": - -type NotificationsInsertCall struct { - s *Service - bucket string - notification *Notification - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a notification subscription for a given bucket. -func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall { - c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.notification = notification - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *NotificationsInsertCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsInsertCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *NotificationsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.notifications.insert" call. -// Exactly one of *Notification or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Notification.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Notification{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a notification subscription for a given bucket.", - // "httpMethod": "POST", - // "id": "storage.notifications.insert", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "The parent bucket of the notification.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/notificationConfigs", - // "request": { - // "$ref": "Notification" - // }, - // "response": { - // "$ref": "Notification" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.notifications.list": - -type NotificationsListCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves a list of notification subscriptions for a given -// bucket. -func (r *NotificationsService) List(bucket string) *NotificationsListCall { - c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *NotificationsListCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsListCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *NotificationsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.notifications.list" call. -// Exactly one of *Notifications or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Notifications.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Notifications{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves a list of notification subscriptions for a given bucket.", - // "httpMethod": "GET", - // "id": "storage.notifications.list", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a Google Cloud Storage bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/notificationConfigs", - // "response": { - // "$ref": "Notifications" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objectAccessControls.delete": - -type ObjectAccessControlsDeleteCall struct { - s *Service - bucket string - object string - entity string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Permanently deletes the ACL entry for the specified entity on -// the specified object. -func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall { - c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.entity = entity - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsDeleteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectAccessControlsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objectAccessControls.delete" call. -func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", - // "httpMethod": "DELETE", - // "id": "storage.objectAccessControls.delete", - // "parameterOrder": [ - // "bucket", - // "object", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/acl/{entity}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objectAccessControls.get": - -type ObjectAccessControlsGetCall struct { - s *Service - bucket string - object string - entity string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Returns the ACL entry for the specified entity on the specified -// object. -func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall { - c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.entity = entity - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectAccessControlsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objectAccessControls.get" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns the ACL entry for the specified entity on the specified object.", - // "httpMethod": "GET", - // "id": "storage.objectAccessControls.get", - // "parameterOrder": [ - // "bucket", - // "object", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/acl/{entity}", - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objectAccessControls.insert": - -type ObjectAccessControlsInsertCall struct { - s *Service - bucket string - object string - objectaccesscontrol *ObjectAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a new ACL entry on the specified object. -func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall { - c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.objectaccesscontrol = objectaccesscontrol - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsInsertCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectAccessControlsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objectAccessControls.insert" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a new ACL entry on the specified object.", - // "httpMethod": "POST", - // "id": "storage.objectAccessControls.insert", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/acl", - // "request": { - // "$ref": "ObjectAccessControl" - // }, - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objectAccessControls.list": - -type ObjectAccessControlsListCall struct { - s *Service - bucket string - object string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves ACL entries on the specified object. -func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall { - c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsListCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectAccessControlsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objectAccessControls.list" call. -// Exactly one of *ObjectAccessControls or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControls.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControls{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves ACL entries on the specified object.", - // "httpMethod": "GET", - // "id": "storage.objectAccessControls.list", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/acl", - // "response": { - // "$ref": "ObjectAccessControls" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objectAccessControls.patch": - -type ObjectAccessControlsPatchCall struct { - s *Service - bucket string - object string - entity string - objectaccesscontrol *ObjectAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches an ACL entry on the specified object. -func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall { - c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.entity = entity - c.objectaccesscontrol = objectaccesscontrol - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsPatchCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectAccessControlsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objectAccessControls.patch" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Patches an ACL entry on the specified object.", - // "httpMethod": "PATCH", - // "id": "storage.objectAccessControls.patch", - // "parameterOrder": [ - // "bucket", - // "object", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/acl/{entity}", - // "request": { - // "$ref": "ObjectAccessControl" - // }, - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objectAccessControls.update": - -type ObjectAccessControlsUpdateCall struct { - s *Service - bucket string - object string - entity string - objectaccesscontrol *ObjectAccessControl - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates an ACL entry on the specified object. -func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall { - c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.entity = entity - c.objectaccesscontrol = objectaccesscontrol - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsUpdateCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectAccessControlsUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - "entity": c.entity, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objectAccessControls.update" call. -// Exactly one of *ObjectAccessControl or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ObjectAccessControl.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ObjectAccessControl{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates an ACL entry on the specified object.", - // "httpMethod": "PUT", - // "id": "storage.objectAccessControls.update", - // "parameterOrder": [ - // "bucket", - // "object", - // "entity" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of a bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "entity": { - // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/acl/{entity}", - // "request": { - // "$ref": "ObjectAccessControl" - // }, - // "response": { - // "$ref": "ObjectAccessControl" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objects.compose": - -type ObjectsComposeCall struct { - s *Service - destinationBucket string - destinationObject string - composerequest *ComposeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Compose: Concatenates a list of existing objects into a new object in -// the same bucket. -func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall { - c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.destinationBucket = destinationBucket - c.destinationObject = destinationObject - c.composerequest = composerequest - return c -} - -// DestinationPredefinedAcl sets the optional parameter -// "destinationPredefinedAcl": Apply a predefined set of access controls -// to the destination object. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall { - c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the object's current metageneration matches the given value. -func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of -// the Cloud KMS key, of the form -// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, -// that will be used to encrypt the object. Overrides the object -// metadata's kms_key_name value, if any. -func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall { - c.urlParams_.Set("kmsKeyName", kmsKeyName) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsComposeCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsComposeCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsComposeCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "destinationBucket": c.destinationBucket, - "destinationObject": c.destinationObject, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.compose" call. -// Exactly one of *Object or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Object.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Object{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Concatenates a list of existing objects into a new object in the same bucket.", - // "httpMethod": "POST", - // "id": "storage.objects.compose", - // "parameterOrder": [ - // "destinationBucket", - // "destinationObject" - // ], - // "parameters": { - // "destinationBucket": { - // "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "destinationObject": { - // "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "destinationPredefinedAcl": { - // "description": "Apply a predefined set of access controls to the destination object.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "kmsKeyName": { - // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{destinationBucket}/o/{destinationObject}/compose", - // "request": { - // "$ref": "ComposeRequest" - // }, - // "response": { - // "$ref": "Object" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.copy": - -type ObjectsCopyCall struct { - s *Service - sourceBucket string - sourceObject string - destinationBucket string - destinationObject string - object *Object - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Copy: Copies a source object to a destination object. Optionally -// overrides metadata. -func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall { - c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sourceBucket = sourceBucket - c.sourceObject = sourceObject - c.destinationBucket = destinationBucket - c.destinationObject = destinationObject - c.object = object - return c -} - -// DestinationKmsKeyName sets the optional parameter -// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the -// form -// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, -// that will be used to encrypt the object. Overrides the object -// metadata's kms_key_name value, if any. -func (c *ObjectsCopyCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsCopyCall { - c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) - return c -} - -// DestinationPredefinedAcl sets the optional parameter -// "destinationPredefinedAcl": Apply a predefined set of access controls -// to the destination object. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall { - c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the destination object's -// current generation matches the given value. Setting to 0 makes the -// operation succeed only if there are no live versions of the object. -func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the destination object's current generation does not match the given -// value. If no live object exists, the precondition fails. Setting to 0 -// makes the operation succeed only if there is a live version of the -// object. -func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the destination object's current metageneration matches the given -// value. -func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the destination object's current metageneration does not -// match the given value. -func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// IfSourceGenerationMatch sets the optional parameter -// "ifSourceGenerationMatch": Makes the operation conditional on whether -// the source object's current generation matches the given value. -func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch)) - return c -} - -// IfSourceGenerationNotMatch sets the optional parameter -// "ifSourceGenerationNotMatch": Makes the operation conditional on -// whether the source object's current generation does not match the -// given value. -func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch)) - return c -} - -// IfSourceMetagenerationMatch sets the optional parameter -// "ifSourceMetagenerationMatch": Makes the operation conditional on -// whether the source object's current metageneration matches the given -// value. -func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch)) - return c -} - -// IfSourceMetagenerationNotMatch sets the optional parameter -// "ifSourceMetagenerationNotMatch": Makes the operation conditional on -// whether the source object's current metageneration does not match the -// given value. -func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall { - c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch)) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl, unless the object resource -// specifies the acl property, when it defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsCopyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsCopyCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// SourceGeneration sets the optional parameter "sourceGeneration": If -// present, selects a specific revision of the source object (as opposed -// to the latest version, the default). -func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall { - c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration)) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsCopyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "sourceBucket": c.sourceBucket, - "sourceObject": c.sourceObject, - "destinationBucket": c.destinationBucket, - "destinationObject": c.destinationObject, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.copy" call. -// Exactly one of *Object or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Object.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Object{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Copies a source object to a destination object. Optionally overrides metadata.", - // "httpMethod": "POST", - // "id": "storage.objects.copy", - // "parameterOrder": [ - // "sourceBucket", - // "sourceObject", - // "destinationBucket", - // "destinationObject" - // ], - // "parameters": { - // "destinationBucket": { - // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "destinationKmsKeyName": { - // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - // "location": "query", - // "type": "string" - // }, - // "destinationObject": { - // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "destinationPredefinedAcl": { - // "description": "Apply a predefined set of access controls to the destination object.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceGenerationMatch": { - // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "sourceBucket": { - // "description": "Name of the bucket in which to find the source object.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sourceGeneration": { - // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "sourceObject": { - // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", - // "request": { - // "$ref": "Object" - // }, - // "response": { - // "$ref": "Object" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.delete": - -type ObjectsDeleteCall struct { - s *Service - bucket string - object string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes an object and its metadata. Deletions are permanent -// if versioning is not enabled for the bucket, or if the generation -// parameter is used. -func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall { - c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - return c -} - -// Generation sets the optional parameter "generation": If present, -// permanently deletes a specific revision of this object (as opposed to -// the latest version, the default). -func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the object's current generation does not match the given value. If no -// live object exists, the precondition fails. Setting to 0 makes the -// operation succeed only if there is a live version of the object. -func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the object's current metageneration matches the given value. -func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the object's current metageneration does not match the given -// value. -func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsDeleteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.delete" call. -func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", - // "httpMethod": "DELETE", - // "id": "storage.objects.delete", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.get": - -type ObjectsGetCall struct { - s *Service - bucket string - object string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Retrieves an object or its metadata. -func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall { - c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the object's current generation does not match the given value. If no -// live object exists, the precondition fails. Setting to 0 makes the -// operation succeed only if there is a live version of the object. -func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the object's current metageneration matches the given value. -func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the object's current metageneration does not match the given -// value. -func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do and Download -// methods. Any pending HTTP request will be aborted if the provided -// context is canceled. -func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Download fetches the API endpoint's "media" value, instead of the normal -// API response value. If the returned error is nil, the Response is guaranteed to -// have a 2xx status code. Callers must close the Response.Body as usual. -func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("media") - if err != nil { - return nil, err - } - if err := googleapi.CheckMediaResponse(res); err != nil { - res.Body.Close() - return nil, err - } - return res, nil -} - -// Do executes the "storage.objects.get" call. -// Exactly one of *Object or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Object.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Object{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves an object or its metadata.", - // "httpMethod": "GET", - // "id": "storage.objects.get", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}", - // "response": { - // "$ref": "Object" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ], - // "supportsMediaDownload": true, - // "useMediaDownloadService": true - // } - -} - -// method id "storage.objects.getIamPolicy": - -type ObjectsGetIamPolicyCall struct { - s *Service - bucket string - object string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// GetIamPolicy: Returns an IAM policy for the specified object. -func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall { - c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetIamPolicyCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsGetIamPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Policy{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns an IAM policy for the specified object.", - // "httpMethod": "GET", - // "id": "storage.objects.getIamPolicy", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/iam", - // "response": { - // "$ref": "Policy" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.insert": - -type ObjectsInsertCall struct { - s *Service - bucket string - object *Object - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header -} - -// Insert: Stores a new object and metadata. -func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall { - c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - return c -} - -// ContentEncoding sets the optional parameter "contentEncoding": If -// set, sets the contentEncoding property of the final object to this -// value. Setting this parameter is equivalent to setting the -// contentEncoding metadata property. This can be useful when uploading -// an object with uploadType=media to indicate the encoding of the -// content being uploaded. -func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall { - c.urlParams_.Set("contentEncoding", contentEncoding) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the object's current generation does not match the given value. If no -// live object exists, the precondition fails. Setting to 0 makes the -// operation succeed only if there is a live version of the object. -func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the object's current metageneration matches the given value. -func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the object's current metageneration does not match the given -// value. -func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of -// the Cloud KMS key, of the form -// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, -// that will be used to encrypt the object. Overrides the object -// metadata's kms_key_name value, if any. -func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall { - c.urlParams_.Set("kmsKeyName", kmsKeyName) - return c -} - -// Name sets the optional parameter "name": Name of the object. Required -// when the object metadata is not otherwise provided. Overrides the -// object metadata's name value, if any. For information about how to -// URL encode object names to be path safe, see Encoding URI Path Parts. -func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall { - c.urlParams_.Set("name", name) - return c -} - -// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a -// predefined set of access controls to this object. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall { - c.urlParams_.Set("predefinedAcl", predefinedAcl) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl, unless the object resource -// specifies the acl property, when it defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsInsertCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall { - if ct := c.object.ContentType; ct != "" { - options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...) - } - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall { - c.mediaInfo_.SetProgressUpdater(pu) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1/b/{bucket}/o") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - req.GetBody = getBody - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequestWithRetry(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.insert" call. -// Exactly one of *Object or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Object.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &Object{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Stores a new object and metadata.", - // "httpMethod": "POST", - // "id": "storage.objects.insert", - // "mediaUpload": { - // "accept": [ - // "*/*" - // ], - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/storage/v1/b/{bucket}/o" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/storage/v1/b/{bucket}/o" - // } - // } - // }, - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "contentEncoding": { - // "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "kmsKeyName": { - // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "query", - // "type": "string" - // }, - // "predefinedAcl": { - // "description": "Apply a predefined set of access controls to this object.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o", - // "request": { - // "$ref": "Object" - // }, - // "response": { - // "$ref": "Object" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ], - // "supportsMediaUpload": true - // } - -} - -// method id "storage.objects.list": - -type ObjectsListCall struct { - s *Service - bucket string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves a list of objects matching the criteria. -func (r *ObjectsService) List(bucket string) *ObjectsListCall { - c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - return c -} - -// Delimiter sets the optional parameter "delimiter": Returns results in -// a directory-like mode. items will contain only objects whose names, -// aside from the prefix, do not contain delimiter. Objects whose names, -// aside from the prefix, contain delimiter will have their name, -// truncated after the delimiter, returned in prefixes. Duplicate -// prefixes are omitted. -func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall { - c.urlParams_.Set("delimiter", delimiter) - return c -} - -// EndOffset sets the optional parameter "endOffset": Filter results to -// objects whose names are lexicographically before endOffset. If -// startOffset is also set, the objects listed will have names between -// startOffset (inclusive) and endOffset (exclusive). -func (c *ObjectsListCall) EndOffset(endOffset string) *ObjectsListCall { - c.urlParams_.Set("endOffset", endOffset) - return c -} - -// IncludeTrailingDelimiter sets the optional parameter -// "includeTrailingDelimiter": If true, objects that end in exactly one -// instance of delimiter will have their metadata included in items in -// addition to prefixes. -func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall { - c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) - return c -} - -// MaxResults sets the optional parameter "maxResults": Maximum number -// of items plus prefixes to return in a single page of responses. As -// duplicate prefixes are omitted, fewer total results may be returned -// than requested. The service will use this parameter or 1,000 items, -// whichever is smaller. -func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": A -// previously-returned page token representing part of the larger set of -// results to view. -func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Prefix sets the optional parameter "prefix": Filter results to -// objects whose names begin with this prefix. -func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall { - c.urlParams_.Set("prefix", prefix) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsListCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// StartOffset sets the optional parameter "startOffset": Filter results -// to objects whose names are lexicographically equal to or after -// startOffset. If endOffset is also set, the objects listed will have -// names between startOffset (inclusive) and endOffset (exclusive). -func (c *ObjectsListCall) StartOffset(startOffset string) *ObjectsListCall { - c.urlParams_.Set("startOffset", startOffset) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Versions sets the optional parameter "versions": If true, lists all -// versions of an object as distinct results. The default is false. For -// more information, see Object Versioning. -func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall { - c.urlParams_.Set("versions", fmt.Sprint(versions)) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.list" call. -// Exactly one of *Objects or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Objects.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Objects{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves a list of objects matching the criteria.", - // "httpMethod": "GET", - // "id": "storage.objects.list", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which to look for objects.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "delimiter": { - // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - // "location": "query", - // "type": "string" - // }, - // "endOffset": { - // "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - // "location": "query", - // "type": "string" - // }, - // "includeTrailingDelimiter": { - // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - // "location": "query", - // "type": "boolean" - // }, - // "maxResults": { - // "default": "1000", - // "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - // "format": "uint32", - // "location": "query", - // "minimum": "0", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A previously-returned page token representing part of the larger set of results to view.", - // "location": "query", - // "type": "string" - // }, - // "prefix": { - // "description": "Filter results to objects whose names begin with this prefix.", - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "startOffset": { - // "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // }, - // "versions": { - // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - // "location": "query", - // "type": "boolean" - // } - // }, - // "path": "b/{bucket}/o", - // "response": { - // "$ref": "Objects" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ], - // "supportsSubscription": true - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "storage.objects.patch": - -type ObjectsPatchCall struct { - s *Service - bucket string - object string - object2 *Object - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches an object's metadata. -func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall { - c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.object2 = object2 - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the object's current generation does not match the given value. If no -// live object exists, the precondition fails. Setting to 0 makes the -// operation succeed only if there is a live version of the object. -func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the object's current metageneration matches the given value. -func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the object's current metageneration does not match the given -// value. -func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a -// predefined set of access controls to this object. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall { - c.urlParams_.Set("predefinedAcl", predefinedAcl) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsPatchCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request, for Requester Pays buckets. -func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.patch" call. -// Exactly one of *Object or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Object.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Object{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Patches an object's metadata.", - // "httpMethod": "PATCH", - // "id": "storage.objects.patch", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "predefinedAcl": { - // "description": "Apply a predefined set of access controls to this object.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request, for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}", - // "request": { - // "$ref": "Object" - // }, - // "response": { - // "$ref": "Object" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objects.rewrite": - -type ObjectsRewriteCall struct { - s *Service - sourceBucket string - sourceObject string - destinationBucket string - destinationObject string - object *Object - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Rewrite: Rewrites a source object to a destination object. Optionally -// overrides metadata. -func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall { - c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sourceBucket = sourceBucket - c.sourceObject = sourceObject - c.destinationBucket = destinationBucket - c.destinationObject = destinationObject - c.object = object - return c -} - -// DestinationKmsKeyName sets the optional parameter -// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the -// form -// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, -// that will be used to encrypt the object. Overrides the object -// metadata's kms_key_name value, if any. -func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall { - c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) - return c -} - -// DestinationPredefinedAcl sets the optional parameter -// "destinationPredefinedAcl": Apply a predefined set of access controls -// to the destination object. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall { - c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the object's current generation does not match the given value. If no -// live object exists, the precondition fails. Setting to 0 makes the -// operation succeed only if there is a live version of the object. -func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the destination object's current metageneration matches the given -// value. -func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the destination object's current metageneration does not -// match the given value. -func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// IfSourceGenerationMatch sets the optional parameter -// "ifSourceGenerationMatch": Makes the operation conditional on whether -// the source object's current generation matches the given value. -func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch)) - return c -} - -// IfSourceGenerationNotMatch sets the optional parameter -// "ifSourceGenerationNotMatch": Makes the operation conditional on -// whether the source object's current generation does not match the -// given value. -func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch)) - return c -} - -// IfSourceMetagenerationMatch sets the optional parameter -// "ifSourceMetagenerationMatch": Makes the operation conditional on -// whether the source object's current metageneration matches the given -// value. -func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch)) - return c -} - -// IfSourceMetagenerationNotMatch sets the optional parameter -// "ifSourceMetagenerationNotMatch": Makes the operation conditional on -// whether the source object's current metageneration does not match the -// given value. -func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall { - c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch)) - return c -} - -// MaxBytesRewrittenPerCall sets the optional parameter -// "maxBytesRewrittenPerCall": The maximum number of bytes that will be -// rewritten per rewrite request. Most callers shouldn't need to specify -// this parameter - it is primarily in place to support testing. If -// specified the value must be an integral multiple of 1 MiB (1048576). -// Also, this only applies to requests where the source and destination -// span locations and/or storage classes. Finally, this value must not -// change across rewrite calls else you'll get an error that the -// rewriteToken is invalid. -func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall { - c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall)) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl, unless the object resource -// specifies the acl property, when it defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsRewriteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsRewriteCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// RewriteToken sets the optional parameter "rewriteToken": Include this -// field (from the previous rewrite response) on each rewrite request -// after the first one, until the rewrite response 'done' flag is true. -// Calls that provide a rewriteToken can omit all other request fields, -// but if included those fields must match the values provided in the -// first rewrite request. -func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall { - c.urlParams_.Set("rewriteToken", rewriteToken) - return c -} - -// SourceGeneration sets the optional parameter "sourceGeneration": If -// present, selects a specific revision of the source object (as opposed -// to the latest version, the default). -func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall { - c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration)) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsRewriteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "sourceBucket": c.sourceBucket, - "sourceObject": c.sourceObject, - "destinationBucket": c.destinationBucket, - "destinationObject": c.destinationObject, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.rewrite" call. -// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *RewriteResponse.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &RewriteResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", - // "httpMethod": "POST", - // "id": "storage.objects.rewrite", - // "parameterOrder": [ - // "sourceBucket", - // "sourceObject", - // "destinationBucket", - // "destinationObject" - // ], - // "parameters": { - // "destinationBucket": { - // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "destinationKmsKeyName": { - // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - // "location": "query", - // "type": "string" - // }, - // "destinationObject": { - // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "destinationPredefinedAcl": { - // "description": "Apply a predefined set of access controls to the destination object.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceGenerationMatch": { - // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifSourceMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "maxBytesRewrittenPerCall": { - // "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "rewriteToken": { - // "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", - // "location": "query", - // "type": "string" - // }, - // "sourceBucket": { - // "description": "Name of the bucket in which to find the source object.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sourceGeneration": { - // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "sourceObject": { - // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", - // "request": { - // "$ref": "Object" - // }, - // "response": { - // "$ref": "RewriteResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.setIamPolicy": - -type ObjectsSetIamPolicyCall struct { - s *Service - bucket string - object string - policy *Policy - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// SetIamPolicy: Updates an IAM policy for the specified object. -func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall { - c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.policy = policy - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsSetIamPolicyCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsSetIamPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.setIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Policy{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates an IAM policy for the specified object.", - // "httpMethod": "PUT", - // "id": "storage.objects.setIamPolicy", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/iam", - // "request": { - // "$ref": "Policy" - // }, - // "response": { - // "$ref": "Policy" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.testIamPermissions": - -type ObjectsTestIamPermissionsCall struct { - s *Service - bucket string - object string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// TestIamPermissions: Tests a set of permissions on the given object to -// see which, if any, are held by the caller. -func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall { - c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.urlParams_.SetMulti("permissions", append([]string{}, permissions...)) - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsTestIamPermissionsCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsTestIamPermissionsCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.testIamPermissions" call. -// Exactly one of *TestIamPermissionsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TestIamPermissionsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &TestIamPermissionsResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", - // "httpMethod": "GET", - // "id": "storage.objects.testIamPermissions", - // "parameterOrder": [ - // "bucket", - // "object", - // "permissions" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "permissions": { - // "description": "Permissions to test.", - // "location": "query", - // "repeated": true, - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}/iam/testPermissions", - // "response": { - // "$ref": "TestIamPermissionsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.objects.update": - -type ObjectsUpdateCall struct { - s *Service - bucket string - object string - object2 *Object - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates an object's metadata. -func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall { - c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.object = object - c.object2 = object2 - return c -} - -// Generation sets the optional parameter "generation": If present, -// selects a specific revision of this object (as opposed to the latest -// version, the default). -func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall { - c.urlParams_.Set("generation", fmt.Sprint(generation)) - return c -} - -// IfGenerationMatch sets the optional parameter "ifGenerationMatch": -// Makes the operation conditional on whether the object's current -// generation matches the given value. Setting to 0 makes the operation -// succeed only if there are no live versions of the object. -func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall { - c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) - return c -} - -// IfGenerationNotMatch sets the optional parameter -// "ifGenerationNotMatch": Makes the operation conditional on whether -// the object's current generation does not match the given value. If no -// live object exists, the precondition fails. Setting to 0 makes the -// operation succeed only if there is a live version of the object. -func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall { - c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) - return c -} - -// IfMetagenerationMatch sets the optional parameter -// "ifMetagenerationMatch": Makes the operation conditional on whether -// the object's current metageneration matches the given value. -func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall { - c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) - return c -} - -// IfMetagenerationNotMatch sets the optional parameter -// "ifMetagenerationNotMatch": Makes the operation conditional on -// whether the object's current metageneration does not match the given -// value. -func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall { - c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) - return c -} - -// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a -// predefined set of access controls to this object. -// -// Possible values: -// "authenticatedRead" - Object owner gets OWNER access, and -// allAuthenticatedUsers get READER access. -// "bucketOwnerFullControl" - Object owner gets OWNER access, and -// project team owners get OWNER access. -// "bucketOwnerRead" - Object owner gets OWNER access, and project -// team owners get READER access. -// "private" - Object owner gets OWNER access. -// "projectPrivate" - Object owner gets OWNER access, and project team -// members get access according to their roles. -// "publicRead" - Object owner gets OWNER access, and allUsers get -// READER access. -func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall { - c.urlParams_.Set("predefinedAcl", predefinedAcl) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to full. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsUpdateCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - "object": c.object, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.update" call. -// Exactly one of *Object or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Object.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Object{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates an object's metadata.", - // "httpMethod": "PUT", - // "id": "storage.objects.update", - // "parameterOrder": [ - // "bucket", - // "object" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which the object resides.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "generation": { - // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifGenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "ifMetagenerationNotMatch": { - // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, - // "object": { - // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "predefinedAcl": { - // "description": "Apply a predefined set of access controls to this object.", - // "enum": [ - // "authenticatedRead", - // "bucketOwnerFullControl", - // "bucketOwnerRead", - // "private", - // "projectPrivate", - // "publicRead" - // ], - // "enumDescriptions": [ - // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - // "Object owner gets OWNER access, and project team owners get OWNER access.", - // "Object owner gets OWNER access, and project team owners get READER access.", - // "Object owner gets OWNER access.", - // "Object owner gets OWNER access, and project team members get access according to their roles.", - // "Object owner gets OWNER access, and allUsers get READER access." - // ], - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to full.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "b/{bucket}/o/{object}", - // "request": { - // "$ref": "Object" - // }, - // "response": { - // "$ref": "Object" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.objects.watchAll": - -type ObjectsWatchAllCall struct { - s *Service - bucket string - channel *Channel - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// WatchAll: Watch for changes on all objects in a bucket. -func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall { - c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.bucket = bucket - c.channel = channel - return c -} - -// Delimiter sets the optional parameter "delimiter": Returns results in -// a directory-like mode. items will contain only objects whose names, -// aside from the prefix, do not contain delimiter. Objects whose names, -// aside from the prefix, contain delimiter will have their name, -// truncated after the delimiter, returned in prefixes. Duplicate -// prefixes are omitted. -func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall { - c.urlParams_.Set("delimiter", delimiter) - return c -} - -// EndOffset sets the optional parameter "endOffset": Filter results to -// objects whose names are lexicographically before endOffset. If -// startOffset is also set, the objects listed will have names between -// startOffset (inclusive) and endOffset (exclusive). -func (c *ObjectsWatchAllCall) EndOffset(endOffset string) *ObjectsWatchAllCall { - c.urlParams_.Set("endOffset", endOffset) - return c -} - -// IncludeTrailingDelimiter sets the optional parameter -// "includeTrailingDelimiter": If true, objects that end in exactly one -// instance of delimiter will have their metadata included in items in -// addition to prefixes. -func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall { - c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) - return c -} - -// MaxResults sets the optional parameter "maxResults": Maximum number -// of items plus prefixes to return in a single page of responses. As -// duplicate prefixes are omitted, fewer total results may be returned -// than requested. The service will use this parameter or 1,000 items, -// whichever is smaller. -func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": A -// previously-returned page token representing part of the larger set of -// results to view. -func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Prefix sets the optional parameter "prefix": Filter results to -// objects whose names begin with this prefix. -func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall { - c.urlParams_.Set("prefix", prefix) - return c -} - -// Projection sets the optional parameter "projection": Set of -// properties to return. Defaults to noAcl. -// -// Possible values: -// "full" - Include all properties. -// "noAcl" - Omit the owner, acl property. -func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall { - c.urlParams_.Set("projection", projection) - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ObjectsWatchAllCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsWatchAllCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// StartOffset sets the optional parameter "startOffset": Filter results -// to objects whose names are lexicographically equal to or after -// startOffset. If endOffset is also set, the objects listed will have -// names between startOffset (inclusive) and endOffset (exclusive). -func (c *ObjectsWatchAllCall) StartOffset(startOffset string) *ObjectsWatchAllCall { - c.urlParams_.Set("startOffset", startOffset) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. Required for Requester Pays buckets. -func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Versions sets the optional parameter "versions": If true, lists all -// versions of an object as distinct results. The default is false. For -// more information, see Object Versioning. -func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall { - c.urlParams_.Set("versions", fmt.Sprint(versions)) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ObjectsWatchAllCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "bucket": c.bucket, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.objects.watchAll" call. -// Exactly one of *Channel or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Channel.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Channel{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Watch for changes on all objects in a bucket.", - // "httpMethod": "POST", - // "id": "storage.objects.watchAll", - // "parameterOrder": [ - // "bucket" - // ], - // "parameters": { - // "bucket": { - // "description": "Name of the bucket in which to look for objects.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "delimiter": { - // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - // "location": "query", - // "type": "string" - // }, - // "endOffset": { - // "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - // "location": "query", - // "type": "string" - // }, - // "includeTrailingDelimiter": { - // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - // "location": "query", - // "type": "boolean" - // }, - // "maxResults": { - // "default": "1000", - // "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - // "format": "uint32", - // "location": "query", - // "minimum": "0", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A previously-returned page token representing part of the larger set of results to view.", - // "location": "query", - // "type": "string" - // }, - // "prefix": { - // "description": "Filter results to objects whose names begin with this prefix.", - // "location": "query", - // "type": "string" - // }, - // "projection": { - // "description": "Set of properties to return. Defaults to noAcl.", - // "enum": [ - // "full", - // "noAcl" - // ], - // "enumDescriptions": [ - // "Include all properties.", - // "Omit the owner, acl property." - // ], - // "location": "query", - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "startOffset": { - // "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request. Required for Requester Pays buckets.", - // "location": "query", - // "type": "string" - // }, - // "versions": { - // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - // "location": "query", - // "type": "boolean" - // } - // }, - // "path": "b/{bucket}/o/watch", - // "request": { - // "$ref": "Channel", - // "parameterName": "resource" - // }, - // "response": { - // "$ref": "Channel" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ], - // "supportsSubscription": true - // } - -} - -// method id "storage.projects.hmacKeys.create": - -type ProjectsHmacKeysCreateCall struct { - s *Service - projectId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Create: Creates a new HMAC key for the specified service account. -func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall { - c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectId = projectId - c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsHmacKeysCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "projectId": c.projectId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.projects.hmacKeys.create" call. -// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *HmacKey.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &HmacKey{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a new HMAC key for the specified service account.", - // "httpMethod": "POST", - // "id": "storage.projects.hmacKeys.create", - // "parameterOrder": [ - // "projectId", - // "serviceAccountEmail" - // ], - // "parameters": { - // "projectId": { - // "description": "Project ID owning the service account.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "serviceAccountEmail": { - // "description": "Email address of the service account.", - // "location": "query", - // "required": true, - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "projects/{projectId}/hmacKeys", - // "response": { - // "$ref": "HmacKey" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.projects.hmacKeys.delete": - -type ProjectsHmacKeysDeleteCall struct { - s *Service - projectId string - accessId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes an HMAC key. -func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall { - c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectId = projectId - c.accessId = accessId - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsHmacKeysDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "projectId": c.projectId, - "accessId": c.accessId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.projects.hmacKeys.delete" call. -func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err - } - return nil - // { - // "description": "Deletes an HMAC key.", - // "httpMethod": "DELETE", - // "id": "storage.projects.hmacKeys.delete", - // "parameterOrder": [ - // "projectId", - // "accessId" - // ], - // "parameters": { - // "accessId": { - // "description": "Name of the HMAC key to be deleted.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectId": { - // "description": "Project ID owning the requested key", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "projects/{projectId}/hmacKeys/{accessId}", - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} - -// method id "storage.projects.hmacKeys.get": - -type ProjectsHmacKeysGetCall struct { - s *Service - projectId string - accessId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Retrieves an HMAC key's metadata -func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall { - c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectId = projectId - c.accessId = accessId - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsHmacKeysGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "projectId": c.projectId, - "accessId": c.accessId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.projects.hmacKeys.get" call. -// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &HmacKeyMetadata{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves an HMAC key's metadata", - // "httpMethod": "GET", - // "id": "storage.projects.hmacKeys.get", - // "parameterOrder": [ - // "projectId", - // "accessId" - // ], - // "parameters": { - // "accessId": { - // "description": "Name of the HMAC key.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectId": { - // "description": "Project ID owning the service account of the requested key.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "projects/{projectId}/hmacKeys/{accessId}", - // "response": { - // "$ref": "HmacKeyMetadata" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only" - // ] - // } - -} - -// method id "storage.projects.hmacKeys.list": - -type ProjectsHmacKeysListCall struct { - s *Service - projectId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves a list of HMAC keys matching the criteria. -func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall { - c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectId = projectId - return c -} - -// MaxResults sets the optional parameter "maxResults": Maximum number -// of items to return in a single page of responses. The service uses -// this parameter or 250 items, whichever is smaller. The max number of -// items per page will also be limited by the number of distinct service -// accounts in the response. If the number of service accounts in a -// single response is too high, the page will truncated and a next page -// token will be returned. -func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": A -// previously-returned page token representing part of the larger set of -// results to view. -func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ServiceAccountEmail sets the optional parameter -// "serviceAccountEmail": If present, only keys for the given service -// account are returned. -func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall { - c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail) - return c -} - -// ShowDeletedKeys sets the optional parameter "showDeletedKeys": -// Whether or not to show keys in the DELETED state. -func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall { - c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys)) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsHmacKeysListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "projectId": c.projectId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.projects.hmacKeys.list" call. -// Exactly one of *HmacKeysMetadata or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *HmacKeysMetadata.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &HmacKeysMetadata{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves a list of HMAC keys matching the criteria.", - // "httpMethod": "GET", - // "id": "storage.projects.hmacKeys.list", - // "parameterOrder": [ - // "projectId" - // ], - // "parameters": { - // "maxResults": { - // "default": "250", - // "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", - // "format": "uint32", - // "location": "query", - // "minimum": "0", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A previously-returned page token representing part of the larger set of results to view.", - // "location": "query", - // "type": "string" - // }, - // "projectId": { - // "description": "Name of the project in which to look for HMAC keys.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "serviceAccountEmail": { - // "description": "If present, only keys for the given service account are returned.", - // "location": "query", - // "type": "string" - // }, - // "showDeletedKeys": { - // "description": "Whether or not to show keys in the DELETED state.", - // "location": "query", - // "type": "boolean" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "projects/{projectId}/hmacKeys", - // "response": { - // "$ref": "HmacKeysMetadata" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "storage.projects.hmacKeys.update": - -type ProjectsHmacKeysUpdateCall struct { - s *Service - projectId string - accessId string - hmackeymetadata *HmacKeyMetadata - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Update: Updates the state of an HMAC key. See the HMAC Key resource -// descriptor for valid states. -func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall { - c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectId = projectId - c.accessId = accessId - c.hmackeymetadata = hmackeymetadata - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsHmacKeysUpdateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "projectId": c.projectId, - "accessId": c.accessId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.projects.hmacKeys.update" call. -// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &HmacKeyMetadata{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", - // "httpMethod": "PUT", - // "id": "storage.projects.hmacKeys.update", - // "parameterOrder": [ - // "projectId", - // "accessId" - // ], - // "parameters": { - // "accessId": { - // "description": "Name of the HMAC key being updated.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectId": { - // "description": "Project ID owning the service account of the updated key.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "projects/{projectId}/hmacKeys/{accessId}", - // "request": { - // "$ref": "HmacKeyMetadata" - // }, - // "response": { - // "$ref": "HmacKeyMetadata" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/devstorage.full_control" - // ] - // } - -} - -// method id "storage.projects.serviceAccount.get": - -type ProjectsServiceAccountGetCall struct { - s *Service - projectId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Get the email address of this project's Google Cloud Storage -// service account. -func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall { - c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectId = projectId - return c -} - -// ProvisionalUserProject sets the optional parameter -// "provisionalUserProject": The project to be billed for this request -// if the target bucket is requester-pays bucket. -func (c *ProjectsServiceAccountGetCall) ProvisionalUserProject(provisionalUserProject string) *ProjectsServiceAccountGetCall { - c.urlParams_.Set("provisionalUserProject", provisionalUserProject) - return c -} - -// UserProject sets the optional parameter "userProject": The project to -// be billed for this request. -func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall { - c.urlParams_.Set("userProject", userProject) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsServiceAccountGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "projectId": c.projectId, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "storage.projects.serviceAccount.get" call. -// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ServiceAccount.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ServiceAccount{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Get the email address of this project's Google Cloud Storage service account.", - // "httpMethod": "GET", - // "id": "storage.projects.serviceAccount.get", - // "parameterOrder": [ - // "projectId" - // ], - // "parameters": { - // "projectId": { - // "description": "Project ID", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "provisionalUserProject": { - // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", - // "location": "query", - // "type": "string" - // }, - // "userProject": { - // "description": "The project to be billed for this request.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "projects/{projectId}/serviceAccount", - // "response": { - // "$ref": "ServiceAccount" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/devstorage.full_control", - // "https://www.googleapis.com/auth/devstorage.read_only", - // "https://www.googleapis.com/auth/devstorage.read_write" - // ] - // } - -} diff --git a/ibm/vendor/google.golang.org/api/transport/cert/default_cert.go b/ibm/vendor/google.golang.org/api/transport/cert/default_cert.go deleted file mode 100644 index c03af65fd7..0000000000 --- a/ibm/vendor/google.golang.org/api/transport/cert/default_cert.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package cert contains certificate tools for Google API clients. -// This package is intended to be used with crypto/tls.Config.GetClientCertificate. -// -// The certificates can be used to satisfy Google's Endpoint Validation. -// See https://cloud.google.com/endpoint-verification/docs/overview -// -// This package is not intended for use by end developers. Use the -// google.golang.org/api/option package to configure API clients. -package cert - -import ( - "crypto/tls" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "os" - "os/exec" - "os/user" - "path/filepath" - "sync" -) - -const ( - metadataPath = ".secureConnect" - metadataFile = "context_aware_metadata.json" -) - -var ( - defaultSourceOnce sync.Once - defaultSource Source - defaultSourceErr error -) - -// Source is a function that can be passed into crypto/tls.Config.GetClientCertificate. -type Source func(*tls.CertificateRequestInfo) (*tls.Certificate, error) - -// DefaultSource returns a certificate source that execs the command specified -// in the file at ~/.secureConnect/context_aware_metadata.json -// -// If that file does not exist, a nil source is returned. -func DefaultSource() (Source, error) { - defaultSourceOnce.Do(func() { - defaultSource, defaultSourceErr = newSecureConnectSource() - }) - return defaultSource, defaultSourceErr -} - -type secureConnectSource struct { - metadata secureConnectMetadata -} - -type secureConnectMetadata struct { - Cmd []string `json:"cert_provider_command"` -} - -// newSecureConnectSource creates a secureConnectSource by reading the well-known file. -func newSecureConnectSource() (Source, error) { - user, err := user.Current() - if err != nil { - // Ignore. - return nil, nil - } - filename := filepath.Join(user.HomeDir, metadataPath, metadataFile) - file, err := ioutil.ReadFile(filename) - if os.IsNotExist(err) { - // Ignore. - return nil, nil - } - if err != nil { - return nil, err - } - - var metadata secureConnectMetadata - if err := json.Unmarshal(file, &metadata); err != nil { - return nil, fmt.Errorf("cert: could not parse JSON in %q: %v", filename, err) - } - if err := validateMetadata(metadata); err != nil { - return nil, fmt.Errorf("cert: invalid config in %q: %v", filename, err) - } - return (&secureConnectSource{ - metadata: metadata, - }).getClientCertificate, nil -} - -func validateMetadata(metadata secureConnectMetadata) error { - if len(metadata.Cmd) == 0 { - return errors.New("empty cert_provider_command") - } - return nil -} - -func (s *secureConnectSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) { - // TODO(cbro): consider caching valid certificates rather than exec'ing every time. - command := s.metadata.Cmd - data, err := exec.Command(command[0], command[1:]...).Output() - if err != nil { - // TODO(cbro): read stderr for error message? Might contain sensitive info. - return nil, err - } - cert, err := tls.X509KeyPair(data, data) - if err != nil { - return nil, err - } - return &cert, nil -} diff --git a/ibm/vendor/google.golang.org/api/transport/http/default_transport_go113.go b/ibm/vendor/google.golang.org/api/transport/http/default_transport_go113.go deleted file mode 100644 index 924f2704d1..0000000000 --- a/ibm/vendor/google.golang.org/api/transport/http/default_transport_go113.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.13 - -package http - -import "net/http" - -// clonedTransport returns the given RoundTripper as a cloned *http.Transport. -// It returns nil if the RoundTripper can't be cloned or coerced to -// *http.Transport. -func clonedTransport(rt http.RoundTripper) *http.Transport { - t, ok := rt.(*http.Transport) - if !ok { - return nil - } - return t.Clone() -} diff --git a/ibm/vendor/google.golang.org/api/transport/http/default_transport_not_go113.go b/ibm/vendor/google.golang.org/api/transport/http/default_transport_not_go113.go deleted file mode 100644 index 3cb16c6cb6..0000000000 --- a/ibm/vendor/google.golang.org/api/transport/http/default_transport_not_go113.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.13 - -package http - -import "net/http" - -// clonedTransport returns the given RoundTripper as a cloned *http.Transport. -// For versions of Go <1.13, this is not supported, so return nil. -func clonedTransport(rt http.RoundTripper) *http.Transport { - return nil -} diff --git a/ibm/vendor/google.golang.org/api/transport/http/dial.go b/ibm/vendor/google.golang.org/api/transport/http/dial.go deleted file mode 100644 index 8578cac9ef..0000000000 --- a/ibm/vendor/google.golang.org/api/transport/http/dial.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2015 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package http supports network connections to HTTP servers. -// This package is not intended for use by end developers. Use the -// google.golang.org/api/option package to configure API clients. -package http - -import ( - "context" - "crypto/tls" - "errors" - "net" - "net/http" - "time" - - "go.opencensus.io/plugin/ochttp" - "golang.org/x/oauth2" - "google.golang.org/api/googleapi/transport" - "google.golang.org/api/internal" - "google.golang.org/api/option" - "google.golang.org/api/transport/cert" - "google.golang.org/api/transport/http/internal/propagation" - "google.golang.org/api/transport/internal/dca" -) - -// NewClient returns an HTTP client for use communicating with a Google cloud -// service, configured with the given ClientOptions. It also returns the endpoint -// for the service as specified in the options. -func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, string, error) { - settings, err := newSettings(opts) - if err != nil { - return nil, "", err - } - clientCertSource, endpoint, err := dca.GetClientCertificateSourceAndEndpoint(settings) - if err != nil { - return nil, "", err - } - // TODO(cbro): consider injecting the User-Agent even if an explicit HTTP client is provided? - if settings.HTTPClient != nil { - return settings.HTTPClient, endpoint, nil - } - trans, err := newTransport(ctx, defaultBaseTransport(ctx, clientCertSource), settings) - if err != nil { - return nil, "", err - } - return &http.Client{Transport: trans}, endpoint, nil -} - -// NewTransport creates an http.RoundTripper for use communicating with a Google -// cloud service, configured with the given ClientOptions. Its RoundTrip method delegates to base. -func NewTransport(ctx context.Context, base http.RoundTripper, opts ...option.ClientOption) (http.RoundTripper, error) { - settings, err := newSettings(opts) - if err != nil { - return nil, err - } - if settings.HTTPClient != nil { - return nil, errors.New("transport/http: WithHTTPClient passed to NewTransport") - } - return newTransport(ctx, base, settings) -} - -func newTransport(ctx context.Context, base http.RoundTripper, settings *internal.DialSettings) (http.RoundTripper, error) { - paramTransport := ¶meterTransport{ - base: base, - userAgent: settings.UserAgent, - quotaProject: settings.QuotaProject, - requestReason: settings.RequestReason, - } - var trans http.RoundTripper = paramTransport - trans = addOCTransport(trans, settings) - switch { - case settings.NoAuth: - // Do nothing. - case settings.APIKey != "": - trans = &transport.APIKey{ - Transport: trans, - Key: settings.APIKey, - } - default: - creds, err := internal.Creds(ctx, settings) - if err != nil { - return nil, err - } - if paramTransport.quotaProject == "" { - paramTransport.quotaProject = internal.QuotaProjectFromCreds(creds) - } - - ts := creds.TokenSource - if settings.TokenSource != nil { - ts = settings.TokenSource - } - trans = &oauth2.Transport{ - Base: trans, - Source: ts, - } - } - return trans, nil -} - -func newSettings(opts []option.ClientOption) (*internal.DialSettings, error) { - var o internal.DialSettings - for _, opt := range opts { - opt.Apply(&o) - } - if err := o.Validate(); err != nil { - return nil, err - } - if o.GRPCConn != nil { - return nil, errors.New("unsupported gRPC connection specified") - } - return &o, nil -} - -type parameterTransport struct { - userAgent string - quotaProject string - requestReason string - - base http.RoundTripper -} - -func (t *parameterTransport) RoundTrip(req *http.Request) (*http.Response, error) { - rt := t.base - if rt == nil { - return nil, errors.New("transport: no Transport specified") - } - newReq := *req - newReq.Header = make(http.Header) - for k, vv := range req.Header { - newReq.Header[k] = vv - } - if t.userAgent != "" { - // TODO(cbro): append to existing User-Agent header? - newReq.Header.Set("User-Agent", t.userAgent) - } - - // Attach system parameters into the header - if t.quotaProject != "" { - newReq.Header.Set("X-Goog-User-Project", t.quotaProject) - } - if t.requestReason != "" { - newReq.Header.Set("X-Goog-Request-Reason", t.requestReason) - } - - return rt.RoundTrip(&newReq) -} - -// Set at init time by dial_appengine.go. If nil, we're not on App Engine. -var appengineUrlfetchHook func(context.Context) http.RoundTripper - -// defaultBaseTransport returns the base HTTP transport. -// On App Engine, this is urlfetch.Transport. -// Otherwise, use a default transport, taking most defaults from -// http.DefaultTransport. -// If TLSCertificate is available, set TLSClientConfig as well. -func defaultBaseTransport(ctx context.Context, clientCertSource cert.Source) http.RoundTripper { - if appengineUrlfetchHook != nil { - return appengineUrlfetchHook(ctx) - } - - // Copy http.DefaultTransport except for MaxIdleConnsPerHost setting, - // which is increased due to reported performance issues under load in the GCS - // client. Transport.Clone is only available in Go 1.13 and up. - trans := clonedTransport(http.DefaultTransport) - if trans == nil { - trans = fallbackBaseTransport() - } - trans.MaxIdleConnsPerHost = 100 - - if clientCertSource != nil { - trans.TLSClientConfig = &tls.Config{ - GetClientCertificate: clientCertSource, - } - } - - return trans -} - -// fallbackBaseTransport is used in httpHeaderMaxSize { - return trace.SpanContext{}, false - } - - // Parse the trace id field. - slash := strings.Index(h, `/`) - if slash == -1 { - return trace.SpanContext{}, false - } - tid, h := h[:slash], h[slash+1:] - - buf, err := hex.DecodeString(tid) - if err != nil { - return trace.SpanContext{}, false - } - copy(sc.TraceID[:], buf) - - // Parse the span id field. - spanstr := h - semicolon := strings.Index(h, `;`) - if semicolon != -1 { - spanstr, h = h[:semicolon], h[semicolon+1:] - } - sid, err := strconv.ParseUint(spanstr, 10, 64) - if err != nil { - return trace.SpanContext{}, false - } - binary.BigEndian.PutUint64(sc.SpanID[:], sid) - - // Parse the options field, options field is optional. - if !strings.HasPrefix(h, "o=") { - return sc, true - } - o, err := strconv.ParseUint(h[2:], 10, 64) - if err != nil { - return trace.SpanContext{}, false - } - sc.TraceOptions = trace.TraceOptions(o) - return sc, true -} - -// SpanContextToRequest modifies the given request to include a Stackdriver Trace header. -func (f *HTTPFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { - sid := binary.BigEndian.Uint64(sc.SpanID[:]) - header := fmt.Sprintf("%s/%d;o=%d", hex.EncodeToString(sc.TraceID[:]), sid, int64(sc.TraceOptions)) - req.Header.Set(httpHeader, header) -} diff --git a/ibm/vendor/google.golang.org/api/transport/internal/dca/dca.go b/ibm/vendor/google.golang.org/api/transport/internal/dca/dca.go deleted file mode 100644 index b3be7e4e3a..0000000000 --- a/ibm/vendor/google.golang.org/api/transport/internal/dca/dca.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package dca contains utils for implementing Device Certificate -// Authentication according to https://google.aip.dev/auth/4114 -// -// The overall logic for DCA is as follows: -// 1. If both endpoint override and client certificate are specified, use them as is. -// 2. If user does not specify client certificate, we will attempt to use default -// client certificate. -// 3. If user does not specify endpoint override, we will use defaultMtlsEndpoint if -// client certificate is available and defaultEndpoint otherwise. -// -// Implications of the above logic: -// 1. If the user specifies a non-mTLS endpoint override but client certificate is -// available, we will pass along the cert anyway and let the server decide what to do. -// 2. If the user specifies an mTLS endpoint override but client certificate is not -// available, we will not fail-fast, but let backend throw error when connecting. -// -// We would like to avoid introducing client-side logic that parses whether the -// endpoint override is an mTLS url, since the url pattern may change at anytime. -// -// This package is not intended for use by end developers. Use the -// google.golang.org/api/option package to configure API clients. -package dca - -import ( - "net/url" - "os" - "strings" - - "google.golang.org/api/internal" - "google.golang.org/api/transport/cert" -) - -const ( - mTLSModeAlways = "always" - mTLSModeNever = "never" - mTLSModeAuto = "auto" -) - -// GetClientCertificateSourceAndEndpoint is a convenience function that invokes -// getClientCertificateSource and getEndpoint sequentially and returns the client -// cert source and endpoint as a tuple. -func GetClientCertificateSourceAndEndpoint(settings *internal.DialSettings) (cert.Source, string, error) { - clientCertSource, err := getClientCertificateSource(settings) - if err != nil { - return nil, "", err - } - endpoint, err := getEndpoint(settings, clientCertSource) - if err != nil { - return nil, "", err - } - return clientCertSource, endpoint, nil -} - -// getClientCertificateSource returns a default client certificate source, if -// not provided by the user. -// -// A nil default source can be returned if the source does not exist. Any exceptions -// encountered while initializing the default source will be reported as client -// error (ex. corrupt metadata file). -// -// Important Note: For now, the environment variable GOOGLE_API_USE_CLIENT_CERTIFICATE -// must be set to "true" to allow certificate to be used (including user provided -// certificates). For details, see AIP-4114. -func getClientCertificateSource(settings *internal.DialSettings) (cert.Source, error) { - if !isClientCertificateEnabled() { - return nil, nil - } else if settings.HTTPClient != nil { - return nil, nil // HTTPClient is incompatible with ClientCertificateSource - } else if settings.ClientCertSource != nil { - return settings.ClientCertSource, nil - } else { - return cert.DefaultSource() - } -} - -func isClientCertificateEnabled() bool { - useClientCert := os.Getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") - // TODO(andyrzhao): Update default to return "true" after DCA feature is fully released. - return strings.ToLower(useClientCert) == "true" -} - -// getEndpoint returns the endpoint for the service, taking into account the -// user-provided endpoint override "settings.Endpoint". -// -// If no endpoint override is specified, we will either return the default endpoint or -// the default mTLS endpoint if a client certificate is available. -// -// You can override the default endpoint choice (mtls vs. regular) by setting the -// GOOGLE_API_USE_MTLS_ENDPOINT environment variable. -// -// If the endpoint override is an address (host:port) rather than full base -// URL (ex. https://...), then the user-provided address will be merged into -// the default endpoint. For example, WithEndpoint("myhost:8000") and -// WithDefaultEndpoint("https://foo.com/bar/baz") will return "https://myhost:8080/bar/baz" -func getEndpoint(settings *internal.DialSettings, clientCertSource cert.Source) (string, error) { - if settings.Endpoint == "" { - mtlsMode := getMTLSMode() - if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) { - return settings.DefaultMTLSEndpoint, nil - } - return settings.DefaultEndpoint, nil - } - if strings.Contains(settings.Endpoint, "://") { - // User passed in a full URL path, use it verbatim. - return settings.Endpoint, nil - } - if settings.DefaultEndpoint == "" { - // If DefaultEndpoint is not configured, use the user provided endpoint verbatim. - // This allows a naked "host[:port]" URL to be used with GRPC Direct Path. - return settings.Endpoint, nil - } - - // Assume user-provided endpoint is host[:port], merge it with the default endpoint. - return mergeEndpoints(settings.DefaultEndpoint, settings.Endpoint) -} - -func getMTLSMode() string { - mode := os.Getenv("GOOGLE_API_USE_MTLS_ENDPOINT") - if mode == "" { - mode = os.Getenv("GOOGLE_API_USE_MTLS") // Deprecated. - } - if mode == "" { - return mTLSModeAuto - } - return strings.ToLower(mode) -} - -func mergeEndpoints(baseURL, newHost string) (string, error) { - u, err := url.Parse(fixScheme(baseURL)) - if err != nil { - return "", err - } - return strings.Replace(baseURL, u.Host, newHost, 1), nil -} - -func fixScheme(baseURL string) string { - if !strings.Contains(baseURL, "://") { - return "https://" + baseURL - } - return baseURL -} diff --git a/ibm/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go b/ibm/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go deleted file mode 100644 index 5f727750ad..0000000000 --- a/ibm/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go +++ /dev/null @@ -1,527 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto - -package urlfetch - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type URLFetchServiceError_ErrorCode int32 - -const ( - URLFetchServiceError_OK URLFetchServiceError_ErrorCode = 0 - URLFetchServiceError_INVALID_URL URLFetchServiceError_ErrorCode = 1 - URLFetchServiceError_FETCH_ERROR URLFetchServiceError_ErrorCode = 2 - URLFetchServiceError_UNSPECIFIED_ERROR URLFetchServiceError_ErrorCode = 3 - URLFetchServiceError_RESPONSE_TOO_LARGE URLFetchServiceError_ErrorCode = 4 - URLFetchServiceError_DEADLINE_EXCEEDED URLFetchServiceError_ErrorCode = 5 - URLFetchServiceError_SSL_CERTIFICATE_ERROR URLFetchServiceError_ErrorCode = 6 - URLFetchServiceError_DNS_ERROR URLFetchServiceError_ErrorCode = 7 - URLFetchServiceError_CLOSED URLFetchServiceError_ErrorCode = 8 - URLFetchServiceError_INTERNAL_TRANSIENT_ERROR URLFetchServiceError_ErrorCode = 9 - URLFetchServiceError_TOO_MANY_REDIRECTS URLFetchServiceError_ErrorCode = 10 - URLFetchServiceError_MALFORMED_REPLY URLFetchServiceError_ErrorCode = 11 - URLFetchServiceError_CONNECTION_ERROR URLFetchServiceError_ErrorCode = 12 -) - -var URLFetchServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "INVALID_URL", - 2: "FETCH_ERROR", - 3: "UNSPECIFIED_ERROR", - 4: "RESPONSE_TOO_LARGE", - 5: "DEADLINE_EXCEEDED", - 6: "SSL_CERTIFICATE_ERROR", - 7: "DNS_ERROR", - 8: "CLOSED", - 9: "INTERNAL_TRANSIENT_ERROR", - 10: "TOO_MANY_REDIRECTS", - 11: "MALFORMED_REPLY", - 12: "CONNECTION_ERROR", -} -var URLFetchServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "INVALID_URL": 1, - "FETCH_ERROR": 2, - "UNSPECIFIED_ERROR": 3, - "RESPONSE_TOO_LARGE": 4, - "DEADLINE_EXCEEDED": 5, - "SSL_CERTIFICATE_ERROR": 6, - "DNS_ERROR": 7, - "CLOSED": 8, - "INTERNAL_TRANSIENT_ERROR": 9, - "TOO_MANY_REDIRECTS": 10, - "MALFORMED_REPLY": 11, - "CONNECTION_ERROR": 12, -} - -func (x URLFetchServiceError_ErrorCode) Enum() *URLFetchServiceError_ErrorCode { - p := new(URLFetchServiceError_ErrorCode) - *p = x - return p -} -func (x URLFetchServiceError_ErrorCode) String() string { - return proto.EnumName(URLFetchServiceError_ErrorCode_name, int32(x)) -} -func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(URLFetchServiceError_ErrorCode_value, data, "URLFetchServiceError_ErrorCode") - if err != nil { - return err - } - *x = URLFetchServiceError_ErrorCode(value) - return nil -} -func (URLFetchServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0, 0} -} - -type URLFetchRequest_RequestMethod int32 - -const ( - URLFetchRequest_GET URLFetchRequest_RequestMethod = 1 - URLFetchRequest_POST URLFetchRequest_RequestMethod = 2 - URLFetchRequest_HEAD URLFetchRequest_RequestMethod = 3 - URLFetchRequest_PUT URLFetchRequest_RequestMethod = 4 - URLFetchRequest_DELETE URLFetchRequest_RequestMethod = 5 - URLFetchRequest_PATCH URLFetchRequest_RequestMethod = 6 -) - -var URLFetchRequest_RequestMethod_name = map[int32]string{ - 1: "GET", - 2: "POST", - 3: "HEAD", - 4: "PUT", - 5: "DELETE", - 6: "PATCH", -} -var URLFetchRequest_RequestMethod_value = map[string]int32{ - "GET": 1, - "POST": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5, - "PATCH": 6, -} - -func (x URLFetchRequest_RequestMethod) Enum() *URLFetchRequest_RequestMethod { - p := new(URLFetchRequest_RequestMethod) - *p = x - return p -} -func (x URLFetchRequest_RequestMethod) String() string { - return proto.EnumName(URLFetchRequest_RequestMethod_name, int32(x)) -} -func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod") - if err != nil { - return err - } - *x = URLFetchRequest_RequestMethod(value) - return nil -} -func (URLFetchRequest_RequestMethod) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0} -} - -type URLFetchServiceError struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} } -func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) } -func (*URLFetchServiceError) ProtoMessage() {} -func (*URLFetchServiceError) Descriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0} -} -func (m *URLFetchServiceError) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_URLFetchServiceError.Unmarshal(m, b) -} -func (m *URLFetchServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_URLFetchServiceError.Marshal(b, m, deterministic) -} -func (dst *URLFetchServiceError) XXX_Merge(src proto.Message) { - xxx_messageInfo_URLFetchServiceError.Merge(dst, src) -} -func (m *URLFetchServiceError) XXX_Size() int { - return xxx_messageInfo_URLFetchServiceError.Size(m) -} -func (m *URLFetchServiceError) XXX_DiscardUnknown() { - xxx_messageInfo_URLFetchServiceError.DiscardUnknown(m) -} - -var xxx_messageInfo_URLFetchServiceError proto.InternalMessageInfo - -type URLFetchRequest struct { - Method *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,name=Method,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"` - Url *string `protobuf:"bytes,2,req,name=Url" json:"Url,omitempty"` - Header []*URLFetchRequest_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"` - Payload []byte `protobuf:"bytes,6,opt,name=Payload" json:"Payload,omitempty"` - FollowRedirects *bool `protobuf:"varint,7,opt,name=FollowRedirects,def=1" json:"FollowRedirects,omitempty"` - Deadline *float64 `protobuf:"fixed64,8,opt,name=Deadline" json:"Deadline,omitempty"` - MustValidateServerCertificate *bool `protobuf:"varint,9,opt,name=MustValidateServerCertificate,def=1" json:"MustValidateServerCertificate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} } -func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) } -func (*URLFetchRequest) ProtoMessage() {} -func (*URLFetchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1} -} -func (m *URLFetchRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_URLFetchRequest.Unmarshal(m, b) -} -func (m *URLFetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_URLFetchRequest.Marshal(b, m, deterministic) -} -func (dst *URLFetchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_URLFetchRequest.Merge(dst, src) -} -func (m *URLFetchRequest) XXX_Size() int { - return xxx_messageInfo_URLFetchRequest.Size(m) -} -func (m *URLFetchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_URLFetchRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_URLFetchRequest proto.InternalMessageInfo - -const Default_URLFetchRequest_FollowRedirects bool = true -const Default_URLFetchRequest_MustValidateServerCertificate bool = true - -func (m *URLFetchRequest) GetMethod() URLFetchRequest_RequestMethod { - if m != nil && m.Method != nil { - return *m.Method - } - return URLFetchRequest_GET -} - -func (m *URLFetchRequest) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *URLFetchRequest) GetHeader() []*URLFetchRequest_Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *URLFetchRequest) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *URLFetchRequest) GetFollowRedirects() bool { - if m != nil && m.FollowRedirects != nil { - return *m.FollowRedirects - } - return Default_URLFetchRequest_FollowRedirects -} - -func (m *URLFetchRequest) GetDeadline() float64 { - if m != nil && m.Deadline != nil { - return *m.Deadline - } - return 0 -} - -func (m *URLFetchRequest) GetMustValidateServerCertificate() bool { - if m != nil && m.MustValidateServerCertificate != nil { - return *m.MustValidateServerCertificate - } - return Default_URLFetchRequest_MustValidateServerCertificate -} - -type URLFetchRequest_Header struct { - Key *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"` - Value *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} } -func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) } -func (*URLFetchRequest_Header) ProtoMessage() {} -func (*URLFetchRequest_Header) Descriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0} -} -func (m *URLFetchRequest_Header) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_URLFetchRequest_Header.Unmarshal(m, b) -} -func (m *URLFetchRequest_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_URLFetchRequest_Header.Marshal(b, m, deterministic) -} -func (dst *URLFetchRequest_Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_URLFetchRequest_Header.Merge(dst, src) -} -func (m *URLFetchRequest_Header) XXX_Size() int { - return xxx_messageInfo_URLFetchRequest_Header.Size(m) -} -func (m *URLFetchRequest_Header) XXX_DiscardUnknown() { - xxx_messageInfo_URLFetchRequest_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_URLFetchRequest_Header proto.InternalMessageInfo - -func (m *URLFetchRequest_Header) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *URLFetchRequest_Header) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type URLFetchResponse struct { - Content []byte `protobuf:"bytes,1,opt,name=Content" json:"Content,omitempty"` - StatusCode *int32 `protobuf:"varint,2,req,name=StatusCode" json:"StatusCode,omitempty"` - Header []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"` - ContentWasTruncated *bool `protobuf:"varint,6,opt,name=ContentWasTruncated,def=0" json:"ContentWasTruncated,omitempty"` - ExternalBytesSent *int64 `protobuf:"varint,7,opt,name=ExternalBytesSent" json:"ExternalBytesSent,omitempty"` - ExternalBytesReceived *int64 `protobuf:"varint,8,opt,name=ExternalBytesReceived" json:"ExternalBytesReceived,omitempty"` - FinalUrl *string `protobuf:"bytes,9,opt,name=FinalUrl" json:"FinalUrl,omitempty"` - ApiCpuMilliseconds *int64 `protobuf:"varint,10,opt,name=ApiCpuMilliseconds,def=0" json:"ApiCpuMilliseconds,omitempty"` - ApiBytesSent *int64 `protobuf:"varint,11,opt,name=ApiBytesSent,def=0" json:"ApiBytesSent,omitempty"` - ApiBytesReceived *int64 `protobuf:"varint,12,opt,name=ApiBytesReceived,def=0" json:"ApiBytesReceived,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} } -func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) } -func (*URLFetchResponse) ProtoMessage() {} -func (*URLFetchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2} -} -func (m *URLFetchResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_URLFetchResponse.Unmarshal(m, b) -} -func (m *URLFetchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_URLFetchResponse.Marshal(b, m, deterministic) -} -func (dst *URLFetchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_URLFetchResponse.Merge(dst, src) -} -func (m *URLFetchResponse) XXX_Size() int { - return xxx_messageInfo_URLFetchResponse.Size(m) -} -func (m *URLFetchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_URLFetchResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_URLFetchResponse proto.InternalMessageInfo - -const Default_URLFetchResponse_ContentWasTruncated bool = false -const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0 -const Default_URLFetchResponse_ApiBytesSent int64 = 0 -const Default_URLFetchResponse_ApiBytesReceived int64 = 0 - -func (m *URLFetchResponse) GetContent() []byte { - if m != nil { - return m.Content - } - return nil -} - -func (m *URLFetchResponse) GetStatusCode() int32 { - if m != nil && m.StatusCode != nil { - return *m.StatusCode - } - return 0 -} - -func (m *URLFetchResponse) GetHeader() []*URLFetchResponse_Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *URLFetchResponse) GetContentWasTruncated() bool { - if m != nil && m.ContentWasTruncated != nil { - return *m.ContentWasTruncated - } - return Default_URLFetchResponse_ContentWasTruncated -} - -func (m *URLFetchResponse) GetExternalBytesSent() int64 { - if m != nil && m.ExternalBytesSent != nil { - return *m.ExternalBytesSent - } - return 0 -} - -func (m *URLFetchResponse) GetExternalBytesReceived() int64 { - if m != nil && m.ExternalBytesReceived != nil { - return *m.ExternalBytesReceived - } - return 0 -} - -func (m *URLFetchResponse) GetFinalUrl() string { - if m != nil && m.FinalUrl != nil { - return *m.FinalUrl - } - return "" -} - -func (m *URLFetchResponse) GetApiCpuMilliseconds() int64 { - if m != nil && m.ApiCpuMilliseconds != nil { - return *m.ApiCpuMilliseconds - } - return Default_URLFetchResponse_ApiCpuMilliseconds -} - -func (m *URLFetchResponse) GetApiBytesSent() int64 { - if m != nil && m.ApiBytesSent != nil { - return *m.ApiBytesSent - } - return Default_URLFetchResponse_ApiBytesSent -} - -func (m *URLFetchResponse) GetApiBytesReceived() int64 { - if m != nil && m.ApiBytesReceived != nil { - return *m.ApiBytesReceived - } - return Default_URLFetchResponse_ApiBytesReceived -} - -type URLFetchResponse_Header struct { - Key *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"` - Value *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} } -func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) } -func (*URLFetchResponse_Header) ProtoMessage() {} -func (*URLFetchResponse_Header) Descriptor() ([]byte, []int) { - return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2, 0} -} -func (m *URLFetchResponse_Header) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_URLFetchResponse_Header.Unmarshal(m, b) -} -func (m *URLFetchResponse_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_URLFetchResponse_Header.Marshal(b, m, deterministic) -} -func (dst *URLFetchResponse_Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_URLFetchResponse_Header.Merge(dst, src) -} -func (m *URLFetchResponse_Header) XXX_Size() int { - return xxx_messageInfo_URLFetchResponse_Header.Size(m) -} -func (m *URLFetchResponse_Header) XXX_DiscardUnknown() { - xxx_messageInfo_URLFetchResponse_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_URLFetchResponse_Header proto.InternalMessageInfo - -func (m *URLFetchResponse_Header) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *URLFetchResponse_Header) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -func init() { - proto.RegisterType((*URLFetchServiceError)(nil), "appengine.URLFetchServiceError") - proto.RegisterType((*URLFetchRequest)(nil), "appengine.URLFetchRequest") - proto.RegisterType((*URLFetchRequest_Header)(nil), "appengine.URLFetchRequest.Header") - proto.RegisterType((*URLFetchResponse)(nil), "appengine.URLFetchResponse") - proto.RegisterType((*URLFetchResponse_Header)(nil), "appengine.URLFetchResponse.Header") -} - -func init() { - proto.RegisterFile("google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto", fileDescriptor_urlfetch_service_b245a7065f33bced) -} - -var fileDescriptor_urlfetch_service_b245a7065f33bced = []byte{ - // 770 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08,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68, 0x47, 0x7e, 0x00, 0xe3, - 0xb7, 0xc0, 0x76, 0xf9, 0x7e, 0xcc, 0xe3, 0x1d, 0xf5, 0x83, 0xd2, 0xff, 0x5f, 0xa6, 0x4b, 0xf8, - 0xad, 0xb7, 0x7b, 0x2a, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x9f, 0x6d, 0x24, 0x63, 0x05, - 0x00, 0x00, -} diff --git a/ibm/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto b/ibm/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto deleted file mode 100644 index f695edf6a9..0000000000 --- a/ibm/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto +++ /dev/null @@ -1,64 +0,0 @@ -syntax = "proto2"; -option go_package = "urlfetch"; - -package appengine; - -message URLFetchServiceError { - enum ErrorCode { - OK = 0; - INVALID_URL = 1; - FETCH_ERROR = 2; - UNSPECIFIED_ERROR = 3; - RESPONSE_TOO_LARGE = 4; - DEADLINE_EXCEEDED = 5; - SSL_CERTIFICATE_ERROR = 6; - DNS_ERROR = 7; - CLOSED = 8; - INTERNAL_TRANSIENT_ERROR = 9; - TOO_MANY_REDIRECTS = 10; - MALFORMED_REPLY = 11; - CONNECTION_ERROR = 12; - } -} - -message URLFetchRequest { - enum RequestMethod { - GET = 1; - POST = 2; - HEAD = 3; - PUT = 4; - DELETE = 5; - PATCH = 6; - } - required RequestMethod Method = 1; - required string Url = 2; - repeated group Header = 3 { - required string Key = 4; - required string Value = 5; - } - optional bytes Payload = 6 [ctype=CORD]; - - optional bool FollowRedirects = 7 [default=true]; - - optional double Deadline = 8; - - optional bool MustValidateServerCertificate = 9 [default=true]; -} - -message URLFetchResponse { - optional bytes Content = 1; - required int32 StatusCode = 2; - repeated group Header = 3 { - required string Key = 4; - required string Value = 5; - } - optional bool ContentWasTruncated = 6 [default=false]; - optional int64 ExternalBytesSent = 7; - optional int64 ExternalBytesReceived = 8; - - optional string FinalUrl = 9; - - optional int64 ApiCpuMilliseconds = 10 [default=0]; - optional int64 ApiBytesSent = 11 [default=0]; - optional int64 ApiBytesReceived = 12 [default=0]; -} diff --git a/ibm/vendor/google.golang.org/appengine/urlfetch/urlfetch.go b/ibm/vendor/google.golang.org/appengine/urlfetch/urlfetch.go deleted file mode 100644 index 6ffe1e6d90..0000000000 --- a/ibm/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package urlfetch provides an http.RoundTripper implementation -// for fetching URLs via App Engine's urlfetch service. -package urlfetch // import "google.golang.org/appengine/urlfetch" - -import ( - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/urlfetch" -) - -// Transport is an implementation of http.RoundTripper for -// App Engine. Users should generally create an http.Client using -// this transport and use the Client rather than using this transport -// directly. -type Transport struct { - Context context.Context - - // Controls whether the application checks the validity of SSL certificates - // over HTTPS connections. A value of false (the default) instructs the - // application to send a request to the server only if the certificate is - // valid and signed by a trusted certificate authority (CA), and also - // includes a hostname that matches the certificate. A value of true - // instructs the application to perform no certificate validation. - AllowInvalidServerCertificate bool -} - -// Verify statically that *Transport implements http.RoundTripper. -var _ http.RoundTripper = (*Transport)(nil) - -// Client returns an *http.Client using a default urlfetch Transport. This -// client will have the default deadline of 5 seconds, and will check the -// validity of SSL certificates. -// -// Any deadline of the provided context will be used for requests through this client; -// if the client does not have a deadline then a 5 second default is used. -func Client(ctx context.Context) *http.Client { - return &http.Client{ - Transport: &Transport{ - Context: ctx, - }, - } -} - -type bodyReader struct { - content []byte - truncated bool - closed bool -} - -// ErrTruncatedBody is the error returned after the final Read() from a -// response's Body if the body has been truncated by App Engine's proxy. -var ErrTruncatedBody = errors.New("urlfetch: truncated body") - -func statusCodeToText(code int) string { - if t := http.StatusText(code); t != "" { - return t - } - return strconv.Itoa(code) -} - -func (br *bodyReader) Read(p []byte) (n int, err error) { - if br.closed { - if br.truncated { - return 0, ErrTruncatedBody - } - return 0, io.EOF - } - n = copy(p, br.content) - if n > 0 { - br.content = br.content[n:] - return - } - if br.truncated { - br.closed = true - return 0, ErrTruncatedBody - } - return 0, io.EOF -} - -func (br *bodyReader) Close() error { - br.closed = true - br.content = nil - return nil -} - -// A map of the URL Fetch-accepted methods that take a request body. -var methodAcceptsRequestBody = map[string]bool{ - "POST": true, - "PUT": true, - "PATCH": true, -} - -// urlString returns a valid string given a URL. This function is necessary because -// the String method of URL doesn't correctly handle URLs with non-empty Opaque values. -// See http://code.google.com/p/go/issues/detail?id=4860. -func urlString(u *url.URL) string { - if u.Opaque == "" || strings.HasPrefix(u.Opaque, "//") { - return u.String() - } - aux := *u - aux.Opaque = "//" + aux.Host + aux.Opaque - return aux.String() -} - -// RoundTrip issues a single HTTP request and returns its response. Per the -// http.RoundTripper interface, RoundTrip only returns an error if there -// was an unsupported request or the URL Fetch proxy fails. -// Note that HTTP response codes such as 5xx, 403, 404, etc are not -// errors as far as the transport is concerned and will be returned -// with err set to nil. -func (t *Transport) RoundTrip(req *http.Request) (res *http.Response, err error) { - methNum, ok := pb.URLFetchRequest_RequestMethod_value[req.Method] - if !ok { - return nil, fmt.Errorf("urlfetch: unsupported HTTP method %q", req.Method) - } - - method := pb.URLFetchRequest_RequestMethod(methNum) - - freq := &pb.URLFetchRequest{ - Method: &method, - Url: proto.String(urlString(req.URL)), - FollowRedirects: proto.Bool(false), // http.Client's responsibility - MustValidateServerCertificate: proto.Bool(!t.AllowInvalidServerCertificate), - } - if deadline, ok := t.Context.Deadline(); ok { - freq.Deadline = proto.Float64(deadline.Sub(time.Now()).Seconds()) - } - - for k, vals := range req.Header { - for _, val := range vals { - freq.Header = append(freq.Header, &pb.URLFetchRequest_Header{ - Key: proto.String(k), - Value: proto.String(val), - }) - } - } - if methodAcceptsRequestBody[req.Method] && req.Body != nil { - // Avoid a []byte copy if req.Body has a Bytes method. - switch b := req.Body.(type) { - case interface { - Bytes() []byte - }: - freq.Payload = b.Bytes() - default: - freq.Payload, err = ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - } - } - - fres := &pb.URLFetchResponse{} - if err := internal.Call(t.Context, "urlfetch", "Fetch", freq, fres); err != nil { - return nil, err - } - - res = &http.Response{} - res.StatusCode = int(*fres.StatusCode) - res.Status = fmt.Sprintf("%d %s", res.StatusCode, statusCodeToText(res.StatusCode)) - res.Header = make(http.Header) - res.Request = req - - // Faked: - res.ProtoMajor = 1 - res.ProtoMinor = 1 - res.Proto = "HTTP/1.1" - res.Close = true - - for _, h := range fres.Header { - hkey := http.CanonicalHeaderKey(*h.Key) - hval := *h.Value - if hkey == "Content-Length" { - // Will get filled in below for all but HEAD requests. - if req.Method == "HEAD" { - res.ContentLength, _ = strconv.ParseInt(hval, 10, 64) - } - continue - } - res.Header.Add(hkey, hval) - } - - if req.Method != "HEAD" { - res.ContentLength = int64(len(fres.Content)) - } - - truncated := fres.GetContentWasTruncated() - res.Body = &bodyReader{content: fres.Content, truncated: truncated} - return -} - -func init() { - internal.RegisterErrorCodeMap("urlfetch", pb.URLFetchServiceError_ErrorCode_name) - internal.RegisterTimeoutErrorCode("urlfetch", int32(pb.URLFetchServiceError_DEADLINE_EXCEEDED)) -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go deleted file mode 100644 index 55111d110c..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/api/annotations.proto - -package annotations - -import ( - reflect "reflect" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -var file_google_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*HttpRule)(nil), - Field: 72295728, - Name: "google.api.http", - Tag: "bytes,72295728,opt,name=http", - Filename: "google/api/annotations.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // See `HttpRule`. - // - // optional google.api.HttpRule http = 72295728; - E_Http = &file_google_api_annotations_proto_extTypes[0] -) - -var File_google_api_annotations_proto protoreflect.FileDescriptor - -var file_google_api_annotations_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x15, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x3a, 0x4b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x1e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb0, 0xca, 0xbc, 0x22, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, - 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x42, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, - 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_google_api_annotations_proto_goTypes = []interface{}{ - (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions - (*HttpRule)(nil), // 1: google.api.HttpRule -} -var file_google_api_annotations_proto_depIdxs = []int32{ - 0, // 0: google.api.http:extendee -> google.protobuf.MethodOptions - 1, // 1: google.api.http:type_name -> google.api.HttpRule - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_annotations_proto_init() } -func file_google_api_annotations_proto_init() { - if File_google_api_annotations_proto != nil { - return - } - file_google_api_http_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_annotations_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_annotations_proto_goTypes, - DependencyIndexes: file_google_api_annotations_proto_depIdxs, - ExtensionInfos: file_google_api_annotations_proto_extTypes, - }.Build() - File_google_api_annotations_proto = out.File - file_google_api_annotations_proto_rawDesc = nil - file_google_api_annotations_proto_goTypes = nil - file_google_api_annotations_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go deleted file mode 100644 index e4324641d6..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2020 Google LLC -// -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/api/client.proto - -package annotations - -import ( - reflect "reflect" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: ([]string)(nil), - Field: 1051, - Name: "google.api.method_signature", - Tag: "bytes,1051,rep,name=method_signature", - Filename: "google/api/client.proto", - }, - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 1049, - Name: "google.api.default_host", - Tag: "bytes,1049,opt,name=default_host", - Filename: "google/api/client.proto", - }, - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 1050, - Name: "google.api.oauth_scopes", - Tag: "bytes,1050,opt,name=oauth_scopes", - Filename: "google/api/client.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // A definition of a client library method signature. - // - // In client libraries, each proto RPC corresponds to one or more methods - // which the end user is able to call, and calls the underlying RPC. - // Normally, this method receives a single argument (a struct or instance - // corresponding to the RPC request object). Defining this field will - // add one or more overloads providing flattened or simpler method signatures - // in some languages. - // - // The fields on the method signature are provided as a comma-separated - // string. - // - // For example, the proto RPC and annotation: - // - // rpc CreateSubscription(CreateSubscriptionRequest) - // returns (Subscription) { - // option (google.api.method_signature) = "name,topic"; - // } - // - // Would add the following Java overload (in addition to the method accepting - // the request object): - // - // public final Subscription createSubscription(String name, String topic) - // - // The following backwards-compatibility guidelines apply: - // - // * Adding this annotation to an unannotated method is backwards - // compatible. - // * Adding this annotation to a method which already has existing - // method signature annotations is backwards compatible if and only if - // the new method signature annotation is last in the sequence. - // * Modifying or removing an existing method signature annotation is - // a breaking change. - // * Re-ordering existing method signature annotations is a breaking - // change. - // - // repeated string method_signature = 1051; - E_MethodSignature = &file_google_api_client_proto_extTypes[0] -) - -// Extension fields to descriptorpb.ServiceOptions. -var ( - // The hostname for this service. - // This should be specified with no prefix or protocol. - // - // Example: - // - // service Foo { - // option (google.api.default_host) = "foo.googleapi.com"; - // ... - // } - // - // optional string default_host = 1049; - E_DefaultHost = &file_google_api_client_proto_extTypes[1] - // OAuth scopes needed for the client. - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform"; - // ... - // } - // - // If there is more than one scope, use a comma-separated string: - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform," - // "https://www.googleapis.com/auth/monitoring"; - // ... - // } - // - // optional string oauth_scopes = 1050; - E_OauthScopes = &file_google_api_client_proto_extTypes[2] -) - -var File_google_api_client_proto protoreflect.FileDescriptor - -var file_google_api_client_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x4a, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9b, 0x08, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x3a, 0x43, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x68, - 0x6f, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x43, 0x0a, 0x0c, 0x6f, 0x61, 0x75, 0x74, - 0x68, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x42, 0x69, 0x0a, - 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, - 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, - 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_google_api_client_proto_goTypes = []interface{}{ - (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions - (*descriptorpb.ServiceOptions)(nil), // 1: google.protobuf.ServiceOptions -} -var file_google_api_client_proto_depIdxs = []int32{ - 0, // 0: google.api.method_signature:extendee -> google.protobuf.MethodOptions - 1, // 1: google.api.default_host:extendee -> google.protobuf.ServiceOptions - 1, // 2: google.api.oauth_scopes:extendee -> google.protobuf.ServiceOptions - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 0, // [0:3] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_client_proto_init() } -func file_google_api_client_proto_init() { - if File_google_api_client_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_client_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 3, - NumServices: 0, - }, - GoTypes: file_google_api_client_proto_goTypes, - DependencyIndexes: file_google_api_client_proto_depIdxs, - ExtensionInfos: file_google_api_client_proto_extTypes, - }.Build() - File_google_api_client_proto = out.File - file_google_api_client_proto_rawDesc = nil - file_google_api_client_proto_goTypes = nil - file_google_api_client_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go deleted file mode 100644 index b6b9094c9a..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2020 Google LLC -// -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/api/field_behavior.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// An indicator of the behavior of a given field (for example, that a field -// is required in requests, or given as output but ignored as input). -// This **does not** change the behavior in protocol buffers itself; it only -// denotes the behavior and may affect how API tooling handles the field. -// -// Note: This enum **may** receive new values in the future. -type FieldBehavior int32 - -const ( - // Conventional default for enums. Do not use this. - FieldBehavior_FIELD_BEHAVIOR_UNSPECIFIED FieldBehavior = 0 - // Specifically denotes a field as optional. - // While all fields in protocol buffers are optional, this may be specified - // for emphasis if appropriate. - FieldBehavior_OPTIONAL FieldBehavior = 1 - // Denotes a field as required. - // This indicates that the field **must** be provided as part of the request, - // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - FieldBehavior_REQUIRED FieldBehavior = 2 - // Denotes a field as output only. - // This indicates that the field is provided in responses, but including the - // field in a request does nothing (the server *must* ignore it and - // *must not* throw an error as a result of the field's presence). - FieldBehavior_OUTPUT_ONLY FieldBehavior = 3 - // Denotes a field as input only. - // This indicates that the field is provided in requests, and the - // corresponding field is not included in output. - FieldBehavior_INPUT_ONLY FieldBehavior = 4 - // Denotes a field as immutable. - // This indicates that the field may be set once in a request to create a - // resource, but may not be changed thereafter. - FieldBehavior_IMMUTABLE FieldBehavior = 5 -) - -// Enum value maps for FieldBehavior. -var ( - FieldBehavior_name = map[int32]string{ - 0: "FIELD_BEHAVIOR_UNSPECIFIED", - 1: "OPTIONAL", - 2: "REQUIRED", - 3: "OUTPUT_ONLY", - 4: "INPUT_ONLY", - 5: "IMMUTABLE", - } - FieldBehavior_value = map[string]int32{ - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - } -) - -func (x FieldBehavior) Enum() *FieldBehavior { - p := new(FieldBehavior) - *p = x - return p -} - -func (x FieldBehavior) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FieldBehavior) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_field_behavior_proto_enumTypes[0].Descriptor() -} - -func (FieldBehavior) Type() protoreflect.EnumType { - return &file_google_api_field_behavior_proto_enumTypes[0] -} - -func (x FieldBehavior) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FieldBehavior.Descriptor instead. -func (FieldBehavior) EnumDescriptor() ([]byte, []int) { - return file_google_api_field_behavior_proto_rawDescGZIP(), []int{0} -} - -var file_google_api_field_behavior_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: ([]FieldBehavior)(nil), - Field: 1052, - Name: "google.api.field_behavior", - Tag: "varint,1052,rep,name=field_behavior,enum=google.api.FieldBehavior", - Filename: "google/api/field_behavior.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // A designation of a specific field behavior (required, output only, etc.) - // in protobuf messages. - // - // Examples: - // - // string name = 1 [(google.api.field_behavior) = REQUIRED]; - // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // google.protobuf.Duration ttl = 1 - // [(google.api.field_behavior) = INPUT_ONLY]; - // google.protobuf.Timestamp expire_time = 1 - // [(google.api.field_behavior) = OUTPUT_ONLY, - // (google.api.field_behavior) = IMMUTABLE]; - // - // repeated google.api.FieldBehavior field_behavior = 1052; - E_FieldBehavior = &file_google_api_field_behavior_proto_extTypes[0] -) - -var File_google_api_field_behavior_proto protoreflect.FileDescriptor - -var file_google_api_field_behavior_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, - 0x7b, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, - 0x12, 0x1e, 0x0a, 0x1a, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, - 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0c, - 0x0a, 0x08, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, - 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x12, 0x0e, 0x0a, - 0x0a, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, 0x0d, 0x0a, - 0x09, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x05, 0x3a, 0x60, 0x0a, 0x0e, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0x08, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, - 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x70, - 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x42, 0x12, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, - 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_field_behavior_proto_rawDescOnce sync.Once - file_google_api_field_behavior_proto_rawDescData = file_google_api_field_behavior_proto_rawDesc -) - -func file_google_api_field_behavior_proto_rawDescGZIP() []byte { - file_google_api_field_behavior_proto_rawDescOnce.Do(func() { - file_google_api_field_behavior_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_field_behavior_proto_rawDescData) - }) - return file_google_api_field_behavior_proto_rawDescData -} - -var file_google_api_field_behavior_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_api_field_behavior_proto_goTypes = []interface{}{ - (FieldBehavior)(0), // 0: google.api.FieldBehavior - (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions -} -var file_google_api_field_behavior_proto_depIdxs = []int32{ - 1, // 0: google.api.field_behavior:extendee -> google.protobuf.FieldOptions - 0, // 1: google.api.field_behavior:type_name -> google.api.FieldBehavior - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_field_behavior_proto_init() } -func file_google_api_field_behavior_proto_init() { - if File_google_api_field_behavior_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_field_behavior_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_field_behavior_proto_goTypes, - DependencyIndexes: file_google_api_field_behavior_proto_depIdxs, - EnumInfos: file_google_api_field_behavior_proto_enumTypes, - ExtensionInfos: file_google_api_field_behavior_proto_extTypes, - }.Build() - File_google_api_field_behavior_proto = out.File - file_google_api_field_behavior_proto_rawDesc = nil - file_google_api_field_behavior_proto_goTypes = nil - file_google_api_field_behavior_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go deleted file mode 100644 index f36d981ced..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go +++ /dev/null @@ -1,783 +0,0 @@ -// Copyright 2020 Google LLC -// -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/api/http.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -type Http struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` -} - -func (x *Http) Reset() { - *x = Http{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_http_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Http) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Http) ProtoMessage() {} - -func (x *Http) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Http.ProtoReflect.Descriptor instead. -func (*Http) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{0} -} - -func (x *Http) GetRules() []*HttpRule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *Http) GetFullyDecodeReservedExpansion() bool { - if x != nil { - return x.FullyDecodeReservedExpansion - } - return false -} - -// # gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` -// -// ## Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all -// fields are passed via URL path and URL query parameters. -// -// ### Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// ## Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// Example: -// -// http: -// rules: -// # Selects a gRPC method and applies HttpRule to it. -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// ## Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -type HttpRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - // - // Types that are assignable to Pattern: - // *HttpRule_Get - // *HttpRule_Put - // *HttpRule_Post - // *HttpRule_Delete - // *HttpRule_Patch - // *HttpRule_Custom - Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` -} - -func (x *HttpRule) Reset() { - *x = HttpRule{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_http_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HttpRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HttpRule) ProtoMessage() {} - -func (x *HttpRule) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HttpRule.ProtoReflect.Descriptor instead. -func (*HttpRule) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{1} -} - -func (x *HttpRule) GetSelector() string { - if x != nil { - return x.Selector - } - return "" -} - -func (m *HttpRule) GetPattern() isHttpRule_Pattern { - if m != nil { - return m.Pattern - } - return nil -} - -func (x *HttpRule) GetGet() string { - if x, ok := x.GetPattern().(*HttpRule_Get); ok { - return x.Get - } - return "" -} - -func (x *HttpRule) GetPut() string { - if x, ok := x.GetPattern().(*HttpRule_Put); ok { - return x.Put - } - return "" -} - -func (x *HttpRule) GetPost() string { - if x, ok := x.GetPattern().(*HttpRule_Post); ok { - return x.Post - } - return "" -} - -func (x *HttpRule) GetDelete() string { - if x, ok := x.GetPattern().(*HttpRule_Delete); ok { - return x.Delete - } - return "" -} - -func (x *HttpRule) GetPatch() string { - if x, ok := x.GetPattern().(*HttpRule_Patch); ok { - return x.Patch - } - return "" -} - -func (x *HttpRule) GetCustom() *CustomHttpPattern { - if x, ok := x.GetPattern().(*HttpRule_Custom); ok { - return x.Custom - } - return nil -} - -func (x *HttpRule) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *HttpRule) GetResponseBody() string { - if x != nil { - return x.ResponseBody - } - return "" -} - -func (x *HttpRule) GetAdditionalBindings() []*HttpRule { - if x != nil { - return x.AdditionalBindings - } - return nil -} - -type isHttpRule_Pattern interface { - isHttpRule_Pattern() -} - -type HttpRule_Get struct { - // Maps to HTTP GET. Used for listing and getting information about - // resources. - Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof"` -} - -type HttpRule_Put struct { - // Maps to HTTP PUT. Used for replacing a resource. - Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof"` -} - -type HttpRule_Post struct { - // Maps to HTTP POST. Used for creating a resource or performing an action. - Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof"` -} - -type HttpRule_Delete struct { - // Maps to HTTP DELETE. Used for deleting a resource. - Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof"` -} - -type HttpRule_Patch struct { - // Maps to HTTP PATCH. Used for updating a resource. - Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof"` -} - -type HttpRule_Custom struct { - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof"` -} - -func (*HttpRule_Get) isHttpRule_Pattern() {} - -func (*HttpRule_Put) isHttpRule_Pattern() {} - -func (*HttpRule_Post) isHttpRule_Pattern() {} - -func (*HttpRule_Delete) isHttpRule_Pattern() {} - -func (*HttpRule_Patch) isHttpRule_Pattern() {} - -func (*HttpRule_Custom) isHttpRule_Pattern() {} - -// A custom pattern is used for defining custom HTTP verb. -type CustomHttpPattern struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of this custom HTTP verb. - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // The path matched by this custom verb. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *CustomHttpPattern) Reset() { - *x = CustomHttpPattern{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_http_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CustomHttpPattern) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CustomHttpPattern) ProtoMessage() {} - -func (x *CustomHttpPattern) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CustomHttpPattern.ProtoReflect.Descriptor instead. -func (*CustomHttpPattern) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{2} -} - -func (x *CustomHttpPattern) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -func (x *CustomHttpPattern) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -var File_google_api_http_proto protoreflect.FileDescriptor - -var file_google_api_http_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x22, 0x79, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, 0x12, 0x2a, 0x0a, 0x05, 0x72, - 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x1f, 0x66, 0x75, 0x6c, 0x6c, 0x79, - 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1c, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x64, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xda, - 0x02, 0x0a, 0x08, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x70, - 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, - 0x14, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, - 0x16, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x74, 0x74, 0x70, 0x50, - 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x13, 0x61, 0x64, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x12, 0x61, 0x64, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x22, 0x3b, 0x0a, 0x11, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x09, 0x48, 0x74, 0x74, 0x70, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x04, - 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_http_proto_rawDescOnce sync.Once - file_google_api_http_proto_rawDescData = file_google_api_http_proto_rawDesc -) - -func file_google_api_http_proto_rawDescGZIP() []byte { - file_google_api_http_proto_rawDescOnce.Do(func() { - file_google_api_http_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_http_proto_rawDescData) - }) - return file_google_api_http_proto_rawDescData -} - -var file_google_api_http_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_google_api_http_proto_goTypes = []interface{}{ - (*Http)(nil), // 0: google.api.Http - (*HttpRule)(nil), // 1: google.api.HttpRule - (*CustomHttpPattern)(nil), // 2: google.api.CustomHttpPattern -} -var file_google_api_http_proto_depIdxs = []int32{ - 1, // 0: google.api.Http.rules:type_name -> google.api.HttpRule - 2, // 1: google.api.HttpRule.custom:type_name -> google.api.CustomHttpPattern - 1, // 2: google.api.HttpRule.additional_bindings:type_name -> google.api.HttpRule - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_google_api_http_proto_init() } -func file_google_api_http_proto_init() { - if File_google_api_http_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Http); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_http_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HttpRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_http_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CustomHttpPattern); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_google_api_http_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*HttpRule_Get)(nil), - (*HttpRule_Put)(nil), - (*HttpRule_Post)(nil), - (*HttpRule_Delete)(nil), - (*HttpRule_Patch)(nil), - (*HttpRule_Custom)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_http_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_api_http_proto_goTypes, - DependencyIndexes: file_google_api_http_proto_depIdxs, - MessageInfos: file_google_api_http_proto_msgTypes, - }.Build() - File_google_api_http_proto = out.File - file_google_api_http_proto_rawDesc = nil - file_google_api_http_proto_goTypes = nil - file_google_api_http_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go deleted file mode 100644 index d3e36efee6..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright 2020 Google LLC -// -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/api/resource.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// A description of the historical or future-looking state of the -// resource pattern. -type ResourceDescriptor_History int32 - -const ( - // The "unset" value. - ResourceDescriptor_HISTORY_UNSPECIFIED ResourceDescriptor_History = 0 - // The resource originally had one pattern and launched as such, and - // additional patterns were added later. - ResourceDescriptor_ORIGINALLY_SINGLE_PATTERN ResourceDescriptor_History = 1 - // The resource has one pattern, but the API owner expects to add more - // later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - // that from being necessary once there are multiple patterns.) - ResourceDescriptor_FUTURE_MULTI_PATTERN ResourceDescriptor_History = 2 -) - -// Enum value maps for ResourceDescriptor_History. -var ( - ResourceDescriptor_History_name = map[int32]string{ - 0: "HISTORY_UNSPECIFIED", - 1: "ORIGINALLY_SINGLE_PATTERN", - 2: "FUTURE_MULTI_PATTERN", - } - ResourceDescriptor_History_value = map[string]int32{ - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2, - } -) - -func (x ResourceDescriptor_History) Enum() *ResourceDescriptor_History { - p := new(ResourceDescriptor_History) - *p = x - return p -} - -func (x ResourceDescriptor_History) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ResourceDescriptor_History) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_resource_proto_enumTypes[0].Descriptor() -} - -func (ResourceDescriptor_History) Type() protoreflect.EnumType { - return &file_google_api_resource_proto_enumTypes[0] -} - -func (x ResourceDescriptor_History) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ResourceDescriptor_History.Descriptor instead. -func (ResourceDescriptor_History) EnumDescriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{0, 0} -} - -// A simple descriptor of a resource type. -// -// ResourceDescriptor annotates a resource message (either by means of a -// protobuf annotation or use in the service config), and associates the -// resource's schema, the resource type, and the pattern of the resource name. -// -// Example: -// -// message Topic { -// // Indicates this message defines a resource schema. -// // Declares the resource type in the format of {service}/{kind}. -// // For Kubernetes resources, the format is {api group}/{kind}. -// option (google.api.resource) = { -// type: "pubsub.googleapis.com/Topic" -// name_descriptor: { -// pattern: "projects/{project}/topics/{topic}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// } -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: "pubsub.googleapis.com/Topic" -// name_descriptor: -// - pattern: "projects/{project}/topics/{topic}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// -// Sometimes, resources have multiple patterns, typically because they can -// live under multiple parents. -// -// Example: -// -// message LogEntry { -// option (google.api.resource) = { -// type: "logging.googleapis.com/LogEntry" -// name_descriptor: { -// pattern: "projects/{project}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// } -// name_descriptor: { -// pattern: "folders/{folder}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -// parent_name_extractor: "folders/{folder}" -// } -// name_descriptor: { -// pattern: "organizations/{organization}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Organization" -// parent_name_extractor: "organizations/{organization}" -// } -// name_descriptor: { -// pattern: "billingAccounts/{billing_account}/logs/{log}" -// parent_type: "billing.googleapis.com/BillingAccount" -// parent_name_extractor: "billingAccounts/{billing_account}" -// } -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: 'logging.googleapis.com/LogEntry' -// name_descriptor: -// - pattern: "projects/{project}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// parent_name_extractor: "projects/{project}" -// - pattern: "folders/{folder}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -// parent_name_extractor: "folders/{folder}" -// - pattern: "organizations/{organization}/logs/{log}" -// parent_type: "cloudresourcemanager.googleapis.com/Organization" -// parent_name_extractor: "organizations/{organization}" -// - pattern: "billingAccounts/{billing_account}/logs/{log}" -// parent_type: "billing.googleapis.com/BillingAccount" -// parent_name_extractor: "billingAccounts/{billing_account}" -// -// For flexible resources, the resource name doesn't contain parent names, but -// the resource itself has parents for policy evaluation. -// -// Example: -// -// message Shelf { -// option (google.api.resource) = { -// type: "library.googleapis.com/Shelf" -// name_descriptor: { -// pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// } -// name_descriptor: { -// pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -// } -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: 'library.googleapis.com/Shelf' -// name_descriptor: -// - pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Project" -// - pattern: "shelves/{shelf}" -// parent_type: "cloudresourcemanager.googleapis.com/Folder" -type ResourceDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource type. It must be in the format of - // {service_name}/{resource_type_kind}. The `resource_type_kind` must be - // singular and must not include version numbers. - // - // Example: `storage.googleapis.com/Bucket` - // - // The value of the resource_type_kind must follow the regular expression - // /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - // should use PascalCase (UpperCamelCase). The maximum number of - // characters allowed for the `resource_type_kind` is 100. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Optional. The relative resource name pattern associated with this resource - // type. The DNS prefix of the full resource name shouldn't be specified here. - // - // The path pattern must follow the syntax, which aligns with HTTP binding - // syntax: - // - // Template = Segment { "/" Segment } ; - // Segment = LITERAL | Variable ; - // Variable = "{" LITERAL "}" ; - // - // Examples: - // - // - "projects/{project}/topics/{topic}" - // - "projects/{project}/knowledgeBases/{knowledge_base}" - // - // The components in braces correspond to the IDs for each resource in the - // hierarchy. It is expected that, if multiple patterns are provided, - // the same component name (e.g. "project") refers to IDs of the same - // type of resource. - Pattern []string `protobuf:"bytes,2,rep,name=pattern,proto3" json:"pattern,omitempty"` - // Optional. The field on the resource that designates the resource name - // field. If omitted, this is assumed to be "name". - NameField string `protobuf:"bytes,3,opt,name=name_field,json=nameField,proto3" json:"name_field,omitempty"` - // Optional. The historical or future-looking state of the resource pattern. - // - // Example: - // - // // The InspectTemplate message originally only supported resource - // // names with organization, and project was added later. - // message InspectTemplate { - // option (google.api.resource) = { - // type: "dlp.googleapis.com/InspectTemplate" - // pattern: - // "organizations/{organization}/inspectTemplates/{inspect_template}" - // pattern: "projects/{project}/inspectTemplates/{inspect_template}" - // history: ORIGINALLY_SINGLE_PATTERN - // }; - // } - History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` - // The plural name used in the resource name and permission names, such as - // 'projects' for the resource name of 'projects/{project}' and the permission - // name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same - // concept of the `plural` field in k8s CRD spec - // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - // - // Note: The plural form is required even for singleton resources. See - // https://aip.dev/156 - Plural string `protobuf:"bytes,5,opt,name=plural,proto3" json:"plural,omitempty"` - // The same concept of the `singular` field in k8s CRD spec - // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - // Such as "project" for the `resourcemanager.googleapis.com/Project` type. - Singular string `protobuf:"bytes,6,opt,name=singular,proto3" json:"singular,omitempty"` -} - -func (x *ResourceDescriptor) Reset() { - *x = ResourceDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceDescriptor) ProtoMessage() {} - -func (x *ResourceDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_google_api_resource_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceDescriptor.ProtoReflect.Descriptor instead. -func (*ResourceDescriptor) Descriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{0} -} - -func (x *ResourceDescriptor) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *ResourceDescriptor) GetPattern() []string { - if x != nil { - return x.Pattern - } - return nil -} - -func (x *ResourceDescriptor) GetNameField() string { - if x != nil { - return x.NameField - } - return "" -} - -func (x *ResourceDescriptor) GetHistory() ResourceDescriptor_History { - if x != nil { - return x.History - } - return ResourceDescriptor_HISTORY_UNSPECIFIED -} - -func (x *ResourceDescriptor) GetPlural() string { - if x != nil { - return x.Plural - } - return "" -} - -func (x *ResourceDescriptor) GetSingular() string { - if x != nil { - return x.Singular - } - return "" -} - -// Defines a proto annotation that describes a string field that refers to -// an API resource. -type ResourceReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource type that the annotated field references. - // - // Example: - // - // message Subscription { - // string topic = 2 [(google.api.resource_reference) = { - // type: "pubsub.googleapis.com/Topic" - // }]; - // } - // - // Occasionally, a field may reference an arbitrary resource. In this case, - // APIs use the special value * in their resource reference. - // - // Example: - // - // message GetIamPolicyRequest { - // string resource = 2 [(google.api.resource_reference) = { - // type: "*" - // }]; - // } - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // The resource type of a child collection that the annotated field - // references. This is useful for annotating the `parent` field that - // doesn't have a fixed resource type. - // - // Example: - // - // message ListLogEntriesRequest { - // string parent = 1 [(google.api.resource_reference) = { - // child_type: "logging.googleapis.com/LogEntry" - // }; - // } - ChildType string `protobuf:"bytes,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` -} - -func (x *ResourceReference) Reset() { - *x = ResourceReference{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_resource_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceReference) ProtoMessage() {} - -func (x *ResourceReference) ProtoReflect() protoreflect.Message { - mi := &file_google_api_resource_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceReference.ProtoReflect.Descriptor instead. -func (*ResourceReference) Descriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{1} -} - -func (x *ResourceReference) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *ResourceReference) GetChildType() string { - if x != nil { - return x.ChildType - } - return "" -} - -var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*ResourceReference)(nil), - Field: 1055, - Name: "google.api.resource_reference", - Tag: "bytes,1055,opt,name=resource_reference", - Filename: "google/api/resource.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: ([]*ResourceDescriptor)(nil), - Field: 1053, - Name: "google.api.resource_definition", - Tag: "bytes,1053,rep,name=resource_definition", - Filename: "google/api/resource.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*ResourceDescriptor)(nil), - Field: 1053, - Name: "google.api.resource", - Tag: "bytes,1053,opt,name=resource", - Filename: "google/api/resource.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // An annotation that describes a resource reference, see - // [ResourceReference][]. - // - // optional google.api.ResourceReference resource_reference = 1055; - E_ResourceReference = &file_google_api_resource_proto_extTypes[0] -) - -// Extension fields to descriptorpb.FileOptions. -var ( - // An annotation that describes a resource definition without a corresponding - // message; see [ResourceDescriptor][]. - // - // repeated google.api.ResourceDescriptor resource_definition = 1053; - E_ResourceDefinition = &file_google_api_resource_proto_extTypes[1] -) - -// Extension fields to descriptorpb.MessageOptions. -var ( - // An annotation that describes a resource definition, see - // [ResourceDescriptor][]. - // - // optional google.api.ResourceDescriptor resource = 1053; - E_Resource = &file_google_api_resource_proto_extTypes[2] -) - -var File_google_api_resource_proto protoreflect.FileDescriptor - -var file_google_api_resource_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x02, 0x0a, 0x12, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1d, - 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x40, 0x0a, - 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x48, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x67, 0x75, - 0x6c, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x6e, 0x67, 0x75, - 0x6c, 0x61, 0x72, 0x22, 0x5b, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x17, - 0x0a, 0x13, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x4f, 0x52, 0x49, 0x47, 0x49, - 0x4e, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x5f, 0x50, 0x41, 0x54, - 0x54, 0x45, 0x52, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x55, 0x54, 0x55, 0x52, 0x45, - 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x5f, 0x50, 0x41, 0x54, 0x54, 0x45, 0x52, 0x4e, 0x10, 0x02, - 0x22, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, - 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x6c, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9f, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x11, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x6e, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x52, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x5c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x04, - 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_resource_proto_rawDescOnce sync.Once - file_google_api_resource_proto_rawDescData = file_google_api_resource_proto_rawDesc -) - -func file_google_api_resource_proto_rawDescGZIP() []byte { - file_google_api_resource_proto_rawDescOnce.Do(func() { - file_google_api_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_resource_proto_rawDescData) - }) - return file_google_api_resource_proto_rawDescData -} - -var file_google_api_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_api_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_google_api_resource_proto_goTypes = []interface{}{ - (ResourceDescriptor_History)(0), // 0: google.api.ResourceDescriptor.History - (*ResourceDescriptor)(nil), // 1: google.api.ResourceDescriptor - (*ResourceReference)(nil), // 2: google.api.ResourceReference - (*descriptorpb.FieldOptions)(nil), // 3: google.protobuf.FieldOptions - (*descriptorpb.FileOptions)(nil), // 4: google.protobuf.FileOptions - (*descriptorpb.MessageOptions)(nil), // 5: google.protobuf.MessageOptions -} -var file_google_api_resource_proto_depIdxs = []int32{ - 0, // 0: google.api.ResourceDescriptor.history:type_name -> google.api.ResourceDescriptor.History - 3, // 1: google.api.resource_reference:extendee -> google.protobuf.FieldOptions - 4, // 2: google.api.resource_definition:extendee -> google.protobuf.FileOptions - 5, // 3: google.api.resource:extendee -> google.protobuf.MessageOptions - 2, // 4: google.api.resource_reference:type_name -> google.api.ResourceReference - 1, // 5: google.api.resource_definition:type_name -> google.api.ResourceDescriptor - 1, // 6: google.api.resource:type_name -> google.api.ResourceDescriptor - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 4, // [4:7] is the sub-list for extension type_name - 1, // [1:4] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_google_api_resource_proto_init() } -func file_google_api_resource_proto_init() { - if File_google_api_resource_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_resource_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 3, - NumServices: 0, - }, - GoTypes: file_google_api_resource_proto_goTypes, - DependencyIndexes: file_google_api_resource_proto_depIdxs, - EnumInfos: file_google_api_resource_proto_enumTypes, - MessageInfos: file_google_api_resource_proto_msgTypes, - ExtensionInfos: file_google_api_resource_proto_extTypes, - }.Build() - File_google_api_resource_proto = out.File - file_google_api_resource_proto_rawDesc = nil - file_google_api_resource_proto_goTypes = nil - file_google_api_resource_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go deleted file mode 100644 index 8a0cca603e..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go +++ /dev/null @@ -1,652 +0,0 @@ -// Copyright 2019 Google LLC. -// -// 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/iam/v1/iam_policy.proto - -package iam - -import ( - context "context" - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// Request message for `SetIamPolicy` method. -type SetIamPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // REQUIRED: The resource for which the policy is being specified. - // See the operation documentation for the appropriate value for this field. - Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` - // REQUIRED: The complete policy to be applied to the `resource`. The size of - // the policy is limited to a few 10s of KB. An empty policy is a - // valid policy but certain Cloud Platform services (such as Projects) - // might reject them. - Policy *Policy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (x *SetIamPolicyRequest) Reset() { - *x = SetIamPolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetIamPolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetIamPolicyRequest) ProtoMessage() {} - -func (x *SetIamPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetIamPolicyRequest.ProtoReflect.Descriptor instead. -func (*SetIamPolicyRequest) Descriptor() ([]byte, []int) { - return file_google_iam_v1_iam_policy_proto_rawDescGZIP(), []int{0} -} - -func (x *SetIamPolicyRequest) GetResource() string { - if x != nil { - return x.Resource - } - return "" -} - -func (x *SetIamPolicyRequest) GetPolicy() *Policy { - if x != nil { - return x.Policy - } - return nil -} - -// Request message for `GetIamPolicy` method. -type GetIamPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // REQUIRED: The resource for which the policy is being requested. - // See the operation documentation for the appropriate value for this field. - Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` - // OPTIONAL: A `GetPolicyOptions` object for specifying options to - // `GetIamPolicy`. This field is only used by Cloud IAM. - Options *GetPolicyOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *GetIamPolicyRequest) Reset() { - *x = GetIamPolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetIamPolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetIamPolicyRequest) ProtoMessage() {} - -func (x *GetIamPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetIamPolicyRequest.ProtoReflect.Descriptor instead. -func (*GetIamPolicyRequest) Descriptor() ([]byte, []int) { - return file_google_iam_v1_iam_policy_proto_rawDescGZIP(), []int{1} -} - -func (x *GetIamPolicyRequest) GetResource() string { - if x != nil { - return x.Resource - } - return "" -} - -func (x *GetIamPolicyRequest) GetOptions() *GetPolicyOptions { - if x != nil { - return x.Options - } - return nil -} - -// Request message for `TestIamPermissions` method. -type TestIamPermissionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // REQUIRED: The resource for which the policy detail is being requested. - // See the operation documentation for the appropriate value for this field. - Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` - // The set of permissions to check for the `resource`. Permissions with - // wildcards (such as '*' or 'storage.*') are not allowed. For more - // information see - // [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - Permissions []string `protobuf:"bytes,2,rep,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (x *TestIamPermissionsRequest) Reset() { - *x = TestIamPermissionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestIamPermissionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestIamPermissionsRequest) ProtoMessage() {} - -func (x *TestIamPermissionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestIamPermissionsRequest.ProtoReflect.Descriptor instead. -func (*TestIamPermissionsRequest) Descriptor() ([]byte, []int) { - return file_google_iam_v1_iam_policy_proto_rawDescGZIP(), []int{2} -} - -func (x *TestIamPermissionsRequest) GetResource() string { - if x != nil { - return x.Resource - } - return "" -} - -func (x *TestIamPermissionsRequest) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -// Response message for `TestIamPermissions` method. -type TestIamPermissionsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A subset of `TestPermissionsRequest.permissions` that the caller is - // allowed. - Permissions []string `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (x *TestIamPermissionsResponse) Reset() { - *x = TestIamPermissionsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestIamPermissionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestIamPermissionsResponse) ProtoMessage() {} - -func (x *TestIamPermissionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_iam_policy_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestIamPermissionsResponse.ProtoReflect.Descriptor instead. -func (*TestIamPermissionsResponse) Descriptor() ([]byte, []int) { - return file_google_iam_v1_iam_policy_proto_rawDescGZIP(), []int{3} -} - -func (x *TestIamPermissionsResponse) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -var File_google_iam_v1_iam_policy_proto protoreflect.FileDescriptor - -var file_google_iam_v1_iam_policy_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, - 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x70, 0x0a, 0x13, 0x53, - 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03, 0x0a, 0x01, 0x2a, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x77, 0x0a, - 0x13, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03, 0x0a, 0x01, - 0x2a, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x19, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, - 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03, 0x0a, 0x01, 0x2a, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0x3e, 0x0a, 0x1a, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x32, 0xb4, 0x03, 0x0a, 0x09, 0x49, 0x41, 0x4d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x74, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x23, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x74, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, - 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x74, 0x49, - 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x9a, 0x01, 0x0a, 0x12, - 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, - 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, - 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, - 0x2a, 0x7d, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x01, 0x2a, 0x1a, 0x1e, 0xca, 0x41, 0x1b, 0x69, 0x61, 0x6d, - 0x2d, 0x6d, 0x65, 0x74, 0x61, 0x2d, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x86, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0e, - 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, - 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x69, - 0x61, 0x6d, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_iam_v1_iam_policy_proto_rawDescOnce sync.Once - file_google_iam_v1_iam_policy_proto_rawDescData = file_google_iam_v1_iam_policy_proto_rawDesc -) - -func file_google_iam_v1_iam_policy_proto_rawDescGZIP() []byte { - file_google_iam_v1_iam_policy_proto_rawDescOnce.Do(func() { - file_google_iam_v1_iam_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_iam_policy_proto_rawDescData) - }) - return file_google_iam_v1_iam_policy_proto_rawDescData -} - -var file_google_iam_v1_iam_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_google_iam_v1_iam_policy_proto_goTypes = []interface{}{ - (*SetIamPolicyRequest)(nil), // 0: google.iam.v1.SetIamPolicyRequest - (*GetIamPolicyRequest)(nil), // 1: google.iam.v1.GetIamPolicyRequest - (*TestIamPermissionsRequest)(nil), // 2: google.iam.v1.TestIamPermissionsRequest - (*TestIamPermissionsResponse)(nil), // 3: google.iam.v1.TestIamPermissionsResponse - (*Policy)(nil), // 4: google.iam.v1.Policy - (*GetPolicyOptions)(nil), // 5: google.iam.v1.GetPolicyOptions -} -var file_google_iam_v1_iam_policy_proto_depIdxs = []int32{ - 4, // 0: google.iam.v1.SetIamPolicyRequest.policy:type_name -> google.iam.v1.Policy - 5, // 1: google.iam.v1.GetIamPolicyRequest.options:type_name -> google.iam.v1.GetPolicyOptions - 0, // 2: google.iam.v1.IAMPolicy.SetIamPolicy:input_type -> google.iam.v1.SetIamPolicyRequest - 1, // 3: google.iam.v1.IAMPolicy.GetIamPolicy:input_type -> google.iam.v1.GetIamPolicyRequest - 2, // 4: google.iam.v1.IAMPolicy.TestIamPermissions:input_type -> google.iam.v1.TestIamPermissionsRequest - 4, // 5: google.iam.v1.IAMPolicy.SetIamPolicy:output_type -> google.iam.v1.Policy - 4, // 6: google.iam.v1.IAMPolicy.GetIamPolicy:output_type -> google.iam.v1.Policy - 3, // 7: google.iam.v1.IAMPolicy.TestIamPermissions:output_type -> google.iam.v1.TestIamPermissionsResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_google_iam_v1_iam_policy_proto_init() } -func file_google_iam_v1_iam_policy_proto_init() { - if File_google_iam_v1_iam_policy_proto != nil { - return - } - file_google_iam_v1_options_proto_init() - file_google_iam_v1_policy_proto_init() - if !protoimpl.UnsafeEnabled { - file_google_iam_v1_iam_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetIamPolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_iam_policy_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetIamPolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_iam_policy_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestIamPermissionsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_iam_policy_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestIamPermissionsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_iam_policy_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_google_iam_v1_iam_policy_proto_goTypes, - DependencyIndexes: file_google_iam_v1_iam_policy_proto_depIdxs, - MessageInfos: file_google_iam_v1_iam_policy_proto_msgTypes, - }.Build() - File_google_iam_v1_iam_policy_proto = out.File - file_google_iam_v1_iam_policy_proto_rawDesc = nil - file_google_iam_v1_iam_policy_proto_goTypes = nil - file_google_iam_v1_iam_policy_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// IAMPolicyClient is the client API for IAMPolicy service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type IAMPolicyClient interface { - // Sets the access control policy on the specified resource. Replaces any - // existing policy. - SetIamPolicy(ctx context.Context, in *SetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) - // Gets the access control policy for a resource. - // Returns an empty policy if the resource exists and does not have a policy - // set. - GetIamPolicy(ctx context.Context, in *GetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) - // Returns permissions that a caller has on the specified resource. - // If the resource does not exist, this will return an empty set of - // permissions, not a NOT_FOUND error. - // - // Note: This operation is designed to be used for building permission-aware - // UIs and command-line tools, not for authorization checking. This operation - // may "fail open" without warning. - TestIamPermissions(ctx context.Context, in *TestIamPermissionsRequest, opts ...grpc.CallOption) (*TestIamPermissionsResponse, error) -} - -type iAMPolicyClient struct { - cc grpc.ClientConnInterface -} - -func NewIAMPolicyClient(cc grpc.ClientConnInterface) IAMPolicyClient { - return &iAMPolicyClient{cc} -} - -func (c *iAMPolicyClient) SetIamPolicy(ctx context.Context, in *SetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) { - out := new(Policy) - err := c.cc.Invoke(ctx, "/google.iam.v1.IAMPolicy/SetIamPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *iAMPolicyClient) GetIamPolicy(ctx context.Context, in *GetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) { - out := new(Policy) - err := c.cc.Invoke(ctx, "/google.iam.v1.IAMPolicy/GetIamPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *iAMPolicyClient) TestIamPermissions(ctx context.Context, in *TestIamPermissionsRequest, opts ...grpc.CallOption) (*TestIamPermissionsResponse, error) { - out := new(TestIamPermissionsResponse) - err := c.cc.Invoke(ctx, "/google.iam.v1.IAMPolicy/TestIamPermissions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// IAMPolicyServer is the server API for IAMPolicy service. -type IAMPolicyServer interface { - // Sets the access control policy on the specified resource. Replaces any - // existing policy. - SetIamPolicy(context.Context, *SetIamPolicyRequest) (*Policy, error) - // Gets the access control policy for a resource. - // Returns an empty policy if the resource exists and does not have a policy - // set. - GetIamPolicy(context.Context, *GetIamPolicyRequest) (*Policy, error) - // Returns permissions that a caller has on the specified resource. - // If the resource does not exist, this will return an empty set of - // permissions, not a NOT_FOUND error. - // - // Note: This operation is designed to be used for building permission-aware - // UIs and command-line tools, not for authorization checking. This operation - // may "fail open" without warning. - TestIamPermissions(context.Context, *TestIamPermissionsRequest) (*TestIamPermissionsResponse, error) -} - -// UnimplementedIAMPolicyServer can be embedded to have forward compatible implementations. -type UnimplementedIAMPolicyServer struct { -} - -func (*UnimplementedIAMPolicyServer) SetIamPolicy(context.Context, *SetIamPolicyRequest) (*Policy, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetIamPolicy not implemented") -} -func (*UnimplementedIAMPolicyServer) GetIamPolicy(context.Context, *GetIamPolicyRequest) (*Policy, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetIamPolicy not implemented") -} -func (*UnimplementedIAMPolicyServer) TestIamPermissions(context.Context, *TestIamPermissionsRequest) (*TestIamPermissionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TestIamPermissions not implemented") -} - -func RegisterIAMPolicyServer(s *grpc.Server, srv IAMPolicyServer) { - s.RegisterService(&_IAMPolicy_serviceDesc, srv) -} - -func _IAMPolicy_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetIamPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IAMPolicyServer).SetIamPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.iam.v1.IAMPolicy/SetIamPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMPolicyServer).SetIamPolicy(ctx, req.(*SetIamPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IAMPolicy_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetIamPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IAMPolicyServer).GetIamPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.iam.v1.IAMPolicy/GetIamPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMPolicyServer).GetIamPolicy(ctx, req.(*GetIamPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _IAMPolicy_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TestIamPermissionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IAMPolicyServer).TestIamPermissions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.iam.v1.IAMPolicy/TestIamPermissions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMPolicyServer).TestIamPermissions(ctx, req.(*TestIamPermissionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _IAMPolicy_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.iam.v1.IAMPolicy", - HandlerType: (*IAMPolicyServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SetIamPolicy", - Handler: _IAMPolicy_SetIamPolicy_Handler, - }, - { - MethodName: "GetIamPolicy", - Handler: _IAMPolicy_GetIamPolicy_Handler, - }, - { - MethodName: "TestIamPermissions", - Handler: _IAMPolicy_TestIamPermissions_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/iam/v1/iam_policy.proto", -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go deleted file mode 100644 index f8f9fb0e92..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2019 Google LLC. -// -// 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/iam/v1/options.proto - -package iam - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// Encapsulates settings provided to GetIamPolicy. -type GetPolicyOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional. The policy format version to be returned. - // - // Valid values are 0, 1, and 3. Requests specifying an invalid value will be - // rejected. - // - // Requests for policies with any conditional bindings must specify version 3. - // Policies without any conditional bindings may specify any valid value or - // leave the field unset. - RequestedPolicyVersion int32 `protobuf:"varint,1,opt,name=requested_policy_version,json=requestedPolicyVersion,proto3" json:"requested_policy_version,omitempty"` -} - -func (x *GetPolicyOptions) Reset() { - *x = GetPolicyOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_options_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPolicyOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPolicyOptions) ProtoMessage() {} - -func (x *GetPolicyOptions) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_options_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPolicyOptions.ProtoReflect.Descriptor instead. -func (*GetPolicyOptions) Descriptor() ([]byte, []int) { - return file_google_iam_v1_options_proto_rawDescGZIP(), []int{0} -} - -func (x *GetPolicyOptions) GetRequestedPolicyVersion() int32 { - if x != nil { - return x.RequestedPolicyVersion - } - return 0 -} - -var File_google_iam_v1_options_proto protoreflect.FileDescriptor - -var file_google_iam_v1_options_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, - 0x0a, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x84, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0c, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, - 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x61, 0x6d, - 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_iam_v1_options_proto_rawDescOnce sync.Once - file_google_iam_v1_options_proto_rawDescData = file_google_iam_v1_options_proto_rawDesc -) - -func file_google_iam_v1_options_proto_rawDescGZIP() []byte { - file_google_iam_v1_options_proto_rawDescOnce.Do(func() { - file_google_iam_v1_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_options_proto_rawDescData) - }) - return file_google_iam_v1_options_proto_rawDescData -} - -var file_google_iam_v1_options_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_iam_v1_options_proto_goTypes = []interface{}{ - (*GetPolicyOptions)(nil), // 0: google.iam.v1.GetPolicyOptions -} -var file_google_iam_v1_options_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_iam_v1_options_proto_init() } -func file_google_iam_v1_options_proto_init() { - if File_google_iam_v1_options_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_iam_v1_options_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPolicyOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_options_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_iam_v1_options_proto_goTypes, - DependencyIndexes: file_google_iam_v1_options_proto_depIdxs, - MessageInfos: file_google_iam_v1_options_proto_msgTypes, - }.Build() - File_google_iam_v1_options_proto = out.File - file_google_iam_v1_options_proto_rawDesc = nil - file_google_iam_v1_options_proto_goTypes = nil - file_google_iam_v1_options_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go deleted file mode 100644 index 78fa900862..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go +++ /dev/null @@ -1,818 +0,0 @@ -// Copyright 2019 Google LLC. -// -// 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/iam/v1/policy.proto - -package iam - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - expr "google.golang.org/genproto/googleapis/type/expr" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// The type of action performed on a Binding in a policy. -type BindingDelta_Action int32 - -const ( - // Unspecified. - BindingDelta_ACTION_UNSPECIFIED BindingDelta_Action = 0 - // Addition of a Binding. - BindingDelta_ADD BindingDelta_Action = 1 - // Removal of a Binding. - BindingDelta_REMOVE BindingDelta_Action = 2 -) - -// Enum value maps for BindingDelta_Action. -var ( - BindingDelta_Action_name = map[int32]string{ - 0: "ACTION_UNSPECIFIED", - 1: "ADD", - 2: "REMOVE", - } - BindingDelta_Action_value = map[string]int32{ - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2, - } -) - -func (x BindingDelta_Action) Enum() *BindingDelta_Action { - p := new(BindingDelta_Action) - *p = x - return p -} - -func (x BindingDelta_Action) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BindingDelta_Action) Descriptor() protoreflect.EnumDescriptor { - return file_google_iam_v1_policy_proto_enumTypes[0].Descriptor() -} - -func (BindingDelta_Action) Type() protoreflect.EnumType { - return &file_google_iam_v1_policy_proto_enumTypes[0] -} - -func (x BindingDelta_Action) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BindingDelta_Action.Descriptor instead. -func (BindingDelta_Action) EnumDescriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{3, 0} -} - -// The type of action performed on an audit configuration in a policy. -type AuditConfigDelta_Action int32 - -const ( - // Unspecified. - AuditConfigDelta_ACTION_UNSPECIFIED AuditConfigDelta_Action = 0 - // Addition of an audit configuration. - AuditConfigDelta_ADD AuditConfigDelta_Action = 1 - // Removal of an audit configuration. - AuditConfigDelta_REMOVE AuditConfigDelta_Action = 2 -) - -// Enum value maps for AuditConfigDelta_Action. -var ( - AuditConfigDelta_Action_name = map[int32]string{ - 0: "ACTION_UNSPECIFIED", - 1: "ADD", - 2: "REMOVE", - } - AuditConfigDelta_Action_value = map[string]int32{ - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2, - } -) - -func (x AuditConfigDelta_Action) Enum() *AuditConfigDelta_Action { - p := new(AuditConfigDelta_Action) - *p = x - return p -} - -func (x AuditConfigDelta_Action) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AuditConfigDelta_Action) Descriptor() protoreflect.EnumDescriptor { - return file_google_iam_v1_policy_proto_enumTypes[1].Descriptor() -} - -func (AuditConfigDelta_Action) Type() protoreflect.EnumType { - return &file_google_iam_v1_policy_proto_enumTypes[1] -} - -func (x AuditConfigDelta_Action) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AuditConfigDelta_Action.Descriptor instead. -func (AuditConfigDelta_Action) EnumDescriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{4, 0} -} - -// Defines an Identity and Access Management (IAM) policy. It is used to -// specify access control policies for Cloud Platform resources. -// -// -// A `Policy` is a collection of `bindings`. A `binding` binds one or more -// `members` to a single `role`. Members can be user accounts, service accounts, -// Google groups, and domains (such as G Suite). A `role` is a named list of -// permissions (defined by IAM or configured by users). A `binding` can -// optionally specify a `condition`, which is a logic expression that further -// constrains the role binding based on attributes about the request and/or -// target resource. -// -// **JSON Example** -// -// { -// "bindings": [ -// { -// "role": "roles/resourcemanager.organizationAdmin", -// "members": [ -// "user:mike@example.com", -// "group:admins@example.com", -// "domain:google.com", -// "serviceAccount:my-project-id@appspot.gserviceaccount.com" -// ] -// }, -// { -// "role": "roles/resourcemanager.organizationViewer", -// "members": ["user:eve@example.com"], -// "condition": { -// "title": "expirable access", -// "description": "Does not grant access after Sep 2020", -// "expression": "request.time < -// timestamp('2020-10-01T00:00:00.000Z')", -// } -// } -// ] -// } -// -// **YAML Example** -// -// bindings: -// - members: -// - user:mike@example.com -// - group:admins@example.com -// - domain:google.com -// - serviceAccount:my-project-id@appspot.gserviceaccount.com -// role: roles/resourcemanager.organizationAdmin -// - members: -// - user:eve@example.com -// role: roles/resourcemanager.organizationViewer -// condition: -// title: expirable access -// description: Does not grant access after Sep 2020 -// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') -// -// For a description of IAM and its features, see the -// [IAM developer's guide](https://cloud.google.com/iam/docs). -type Policy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Specifies the format of the policy. - // - // Valid values are 0, 1, and 3. Requests specifying an invalid value will be - // rejected. - // - // Operations affecting conditional bindings must specify version 3. This can - // be either setting a conditional policy, modifying a conditional binding, - // or removing a binding (conditional or unconditional) from the stored - // conditional policy. - // Operations on non-conditional policies may specify any valid value or - // leave the field unset. - // - // If no etag is provided in the call to `setIamPolicy`, version compliance - // checks against the stored policy is skipped. - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - // Associates a list of `members` to a `role`. Optionally may specify a - // `condition` that determines when binding is in effect. - // `bindings` with no members will result in an error. - Bindings []*Binding `protobuf:"bytes,4,rep,name=bindings,proto3" json:"bindings,omitempty"` - // `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a policy from overwriting each other. - // It is strongly suggested that systems make use of the `etag` in the - // read-modify-write cycle to perform policy updates in order to avoid race - // conditions: An `etag` is returned in the response to `getIamPolicy`, and - // systems are expected to put that etag in the request to `setIamPolicy` to - // ensure that their change will be applied to the same version of the policy. - // - // If no `etag` is provided in the call to `setIamPolicy`, then the existing - // policy is overwritten. Due to blind-set semantics of an etag-less policy, - // 'setIamPolicy' will not fail even if the incoming policy version does not - // meet the requirements for modifying the stored policy. - Etag []byte `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` -} - -func (x *Policy) Reset() { - *x = Policy{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_policy_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Policy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Policy) ProtoMessage() {} - -func (x *Policy) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_policy_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Policy.ProtoReflect.Descriptor instead. -func (*Policy) Descriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{0} -} - -func (x *Policy) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *Policy) GetBindings() []*Binding { - if x != nil { - return x.Bindings - } - return nil -} - -func (x *Policy) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -// Associates `members` with a `role`. -type Binding struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Role that is assigned to `members`. - // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - // Specifies the identities requesting access for a Cloud Platform resource. - // `members` can have the following values: - // - // * `allUsers`: A special identifier that represents anyone who is - // on the internet; with or without a Google account. - // - // * `allAuthenticatedUsers`: A special identifier that represents anyone - // who is authenticated with a Google account or a service account. - // - // * `user:{emailid}`: An email address that represents a specific Google - // account. For example, `alice@example.com` . - // - // - // * `serviceAccount:{emailid}`: An email address that represents a service - // account. For example, `my-other-app@appspot.gserviceaccount.com`. - // - // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. - // - // - // * `domain:{domain}`: The G Suite domain (primary) that represents all the - // users of that domain. For example, `google.com` or `example.com`. - // - // - Members []string `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - // The condition that is associated with this binding. - // NOTE: An unsatisfied condition will not allow user access via current - // binding. Different bindings, including their conditions, are examined - // independently. - Condition *expr.Expr `protobuf:"bytes,3,opt,name=condition,proto3" json:"condition,omitempty"` -} - -func (x *Binding) Reset() { - *x = Binding{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_policy_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Binding) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Binding) ProtoMessage() {} - -func (x *Binding) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_policy_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Binding.ProtoReflect.Descriptor instead. -func (*Binding) Descriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{1} -} - -func (x *Binding) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -func (x *Binding) GetMembers() []string { - if x != nil { - return x.Members - } - return nil -} - -func (x *Binding) GetCondition() *expr.Expr { - if x != nil { - return x.Condition - } - return nil -} - -// The difference delta between two policies. -type PolicyDelta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The delta for Bindings between two policies. - BindingDeltas []*BindingDelta `protobuf:"bytes,1,rep,name=binding_deltas,json=bindingDeltas,proto3" json:"binding_deltas,omitempty"` - // The delta for AuditConfigs between two policies. - AuditConfigDeltas []*AuditConfigDelta `protobuf:"bytes,2,rep,name=audit_config_deltas,json=auditConfigDeltas,proto3" json:"audit_config_deltas,omitempty"` -} - -func (x *PolicyDelta) Reset() { - *x = PolicyDelta{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_policy_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PolicyDelta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PolicyDelta) ProtoMessage() {} - -func (x *PolicyDelta) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_policy_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PolicyDelta.ProtoReflect.Descriptor instead. -func (*PolicyDelta) Descriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{2} -} - -func (x *PolicyDelta) GetBindingDeltas() []*BindingDelta { - if x != nil { - return x.BindingDeltas - } - return nil -} - -func (x *PolicyDelta) GetAuditConfigDeltas() []*AuditConfigDelta { - if x != nil { - return x.AuditConfigDeltas - } - return nil -} - -// One delta entry for Binding. Each individual change (only one member in each -// entry) to a binding will be a separate entry. -type BindingDelta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The action that was performed on a Binding. - // Required - Action BindingDelta_Action `protobuf:"varint,1,opt,name=action,proto3,enum=google.iam.v1.BindingDelta_Action" json:"action,omitempty"` - // Role that is assigned to `members`. - // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - // Required - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - // A single identity requesting access for a Cloud Platform resource. - // Follows the same format of Binding.members. - // Required - Member string `protobuf:"bytes,3,opt,name=member,proto3" json:"member,omitempty"` - // The condition that is associated with this binding. - Condition *expr.Expr `protobuf:"bytes,4,opt,name=condition,proto3" json:"condition,omitempty"` -} - -func (x *BindingDelta) Reset() { - *x = BindingDelta{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_policy_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindingDelta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindingDelta) ProtoMessage() {} - -func (x *BindingDelta) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_policy_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindingDelta.ProtoReflect.Descriptor instead. -func (*BindingDelta) Descriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{3} -} - -func (x *BindingDelta) GetAction() BindingDelta_Action { - if x != nil { - return x.Action - } - return BindingDelta_ACTION_UNSPECIFIED -} - -func (x *BindingDelta) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -func (x *BindingDelta) GetMember() string { - if x != nil { - return x.Member - } - return "" -} - -func (x *BindingDelta) GetCondition() *expr.Expr { - if x != nil { - return x.Condition - } - return nil -} - -// One delta entry for AuditConfig. Each individual change (only one -// exempted_member in each entry) to a AuditConfig will be a separate entry. -type AuditConfigDelta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The action that was performed on an audit configuration in a policy. - // Required - Action AuditConfigDelta_Action `protobuf:"varint,1,opt,name=action,proto3,enum=google.iam.v1.AuditConfigDelta_Action" json:"action,omitempty"` - // Specifies a service that was configured for Cloud Audit Logging. - // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - // `allServices` is a special value that covers all services. - // Required - Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` - // A single identity that is exempted from "data access" audit - // logging for the `service` specified above. - // Follows the same format of Binding.members. - ExemptedMember string `protobuf:"bytes,3,opt,name=exempted_member,json=exemptedMember,proto3" json:"exempted_member,omitempty"` - // Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - // enabled, and cannot be configured. - // Required - LogType string `protobuf:"bytes,4,opt,name=log_type,json=logType,proto3" json:"log_type,omitempty"` -} - -func (x *AuditConfigDelta) Reset() { - *x = AuditConfigDelta{} - if protoimpl.UnsafeEnabled { - mi := &file_google_iam_v1_policy_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuditConfigDelta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuditConfigDelta) ProtoMessage() {} - -func (x *AuditConfigDelta) ProtoReflect() protoreflect.Message { - mi := &file_google_iam_v1_policy_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuditConfigDelta.ProtoReflect.Descriptor instead. -func (*AuditConfigDelta) Descriptor() ([]byte, []int) { - return file_google_iam_v1_policy_proto_rawDescGZIP(), []int{4} -} - -func (x *AuditConfigDelta) GetAction() AuditConfigDelta_Action { - if x != nil { - return x.Action - } - return AuditConfigDelta_ACTION_UNSPECIFIED -} - -func (x *AuditConfigDelta) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -func (x *AuditConfigDelta) GetExemptedMember() string { - if x != nil { - return x.ExemptedMember - } - return "" -} - -func (x *AuditConfigDelta) GetLogType() string { - if x != nil { - return x.LogType - } - return "" -} - -var File_google_iam_v1_policy_proto protoreflect.FileDescriptor - -var file_google_iam_v1_policy_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x6a, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, - 0x08, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, - 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x22, 0x68, 0x0a, - 0x07, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa2, 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x0e, 0x62, 0x69, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x0d, 0x62, 0x69, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x12, 0x4f, 0x0a, 0x13, 0x61, - 0x75, 0x64, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x74, - 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x11, 0x61, 0x75, 0x64, 0x69, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x22, 0xde, 0x01, 0x0a, - 0x0c, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x3a, 0x0a, - 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, - 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, 0x22, 0xe7, 0x01, - 0x0a, 0x10, 0x41, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, 0x6c, - 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x65, - 0x6c, 0x74, 0x61, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, - 0x65, 0x78, 0x65, 0x6d, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x74, 0x65, 0x64, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, - 0x22, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, - 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, - 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x61, 0x6d, 0xf8, 0x01, - 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_iam_v1_policy_proto_rawDescOnce sync.Once - file_google_iam_v1_policy_proto_rawDescData = file_google_iam_v1_policy_proto_rawDesc -) - -func file_google_iam_v1_policy_proto_rawDescGZIP() []byte { - file_google_iam_v1_policy_proto_rawDescOnce.Do(func() { - file_google_iam_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_iam_v1_policy_proto_rawDescData) - }) - return file_google_iam_v1_policy_proto_rawDescData -} - -var file_google_iam_v1_policy_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_google_iam_v1_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_google_iam_v1_policy_proto_goTypes = []interface{}{ - (BindingDelta_Action)(0), // 0: google.iam.v1.BindingDelta.Action - (AuditConfigDelta_Action)(0), // 1: google.iam.v1.AuditConfigDelta.Action - (*Policy)(nil), // 2: google.iam.v1.Policy - (*Binding)(nil), // 3: google.iam.v1.Binding - (*PolicyDelta)(nil), // 4: google.iam.v1.PolicyDelta - (*BindingDelta)(nil), // 5: google.iam.v1.BindingDelta - (*AuditConfigDelta)(nil), // 6: google.iam.v1.AuditConfigDelta - (*expr.Expr)(nil), // 7: google.type.Expr -} -var file_google_iam_v1_policy_proto_depIdxs = []int32{ - 3, // 0: google.iam.v1.Policy.bindings:type_name -> google.iam.v1.Binding - 7, // 1: google.iam.v1.Binding.condition:type_name -> google.type.Expr - 5, // 2: google.iam.v1.PolicyDelta.binding_deltas:type_name -> google.iam.v1.BindingDelta - 6, // 3: google.iam.v1.PolicyDelta.audit_config_deltas:type_name -> google.iam.v1.AuditConfigDelta - 0, // 4: google.iam.v1.BindingDelta.action:type_name -> google.iam.v1.BindingDelta.Action - 7, // 5: google.iam.v1.BindingDelta.condition:type_name -> google.type.Expr - 1, // 6: google.iam.v1.AuditConfigDelta.action:type_name -> google.iam.v1.AuditConfigDelta.Action - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_google_iam_v1_policy_proto_init() } -func file_google_iam_v1_policy_proto_init() { - if File_google_iam_v1_policy_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_iam_v1_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Policy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_policy_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Binding); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_policy_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PolicyDelta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_policy_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindingDelta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_iam_v1_policy_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuditConfigDelta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_iam_v1_policy_proto_rawDesc, - NumEnums: 2, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_iam_v1_policy_proto_goTypes, - DependencyIndexes: file_google_iam_v1_policy_proto_depIdxs, - EnumInfos: file_google_iam_v1_policy_proto_enumTypes, - MessageInfos: file_google_iam_v1_policy_proto_msgTypes, - }.Build() - File_google_iam_v1_policy_proto = out.File - file_google_iam_v1_policy_proto_rawDesc = nil - file_google_iam_v1_policy_proto_goTypes = nil - file_google_iam_v1_policy_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go deleted file mode 100644 index 386fd7b13c..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2020 Google LLC -// -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/rpc/code.proto - -package code - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// The canonical error codes for gRPC APIs. -// -// -// Sometimes multiple error codes may apply. Services should return -// the most specific error code that applies. For example, prefer -// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. -// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. -type Code int32 - -const ( - // Not an error; returned on success - // - // HTTP Mapping: 200 OK - Code_OK Code = 0 - // The operation was cancelled, typically by the caller. - // - // HTTP Mapping: 499 Client Closed Request - Code_CANCELLED Code = 1 - // Unknown error. For example, this error may be returned when - // a `Status` value received from another address space belongs to - // an error space that is not known in this address space. Also - // errors raised by APIs that do not return enough error information - // may be converted to this error. - // - // HTTP Mapping: 500 Internal Server Error - Code_UNKNOWN Code = 2 - // The client specified an invalid argument. Note that this differs - // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments - // that are problematic regardless of the state of the system - // (e.g., a malformed file name). - // - // HTTP Mapping: 400 Bad Request - Code_INVALID_ARGUMENT Code = 3 - // The deadline expired before the operation could complete. For operations - // that change the state of the system, this error may be returned - // even if the operation has completed successfully. For example, a - // successful response from a server could have been delayed long - // enough for the deadline to expire. - // - // HTTP Mapping: 504 Gateway Timeout - Code_DEADLINE_EXCEEDED Code = 4 - // Some requested entity (e.g., file or directory) was not found. - // - // Note to server developers: if a request is denied for an entire class - // of users, such as gradual feature rollout or undocumented whitelist, - // `NOT_FOUND` may be used. If a request is denied for some users within - // a class of users, such as user-based access control, `PERMISSION_DENIED` - // must be used. - // - // HTTP Mapping: 404 Not Found - Code_NOT_FOUND Code = 5 - // The entity that a client attempted to create (e.g., file or directory) - // already exists. - // - // HTTP Mapping: 409 Conflict - Code_ALREADY_EXISTS Code = 6 - // The caller does not have permission to execute the specified - // operation. `PERMISSION_DENIED` must not be used for rejections - // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` - // instead for those errors). `PERMISSION_DENIED` must not be - // used if the caller can not be identified (use `UNAUTHENTICATED` - // instead for those errors). This error code does not imply the - // request is valid or the requested entity exists or satisfies - // other pre-conditions. - // - // HTTP Mapping: 403 Forbidden - Code_PERMISSION_DENIED Code = 7 - // The request does not have valid authentication credentials for the - // operation. - // - // HTTP Mapping: 401 Unauthorized - Code_UNAUTHENTICATED Code = 16 - // Some resource has been exhausted, perhaps a per-user quota, or - // perhaps the entire file system is out of space. - // - // HTTP Mapping: 429 Too Many Requests - Code_RESOURCE_EXHAUSTED Code = 8 - // The operation was rejected because the system is not in a state - // required for the operation's execution. For example, the directory - // to be deleted is non-empty, an rmdir operation is applied to - // a non-directory, etc. - // - // Service implementors can use the following guidelines to decide - // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: - // (a) Use `UNAVAILABLE` if the client can retry just the failing call. - // (b) Use `ABORTED` if the client should retry at a higher level - // (e.g., when a client-specified test-and-set fails, indicating the - // client should restart a read-modify-write sequence). - // (c) Use `FAILED_PRECONDITION` if the client should not retry until - // the system state has been explicitly fixed. E.g., if an "rmdir" - // fails because the directory is non-empty, `FAILED_PRECONDITION` - // should be returned since the client should not retry unless - // the files are deleted from the directory. - // - // HTTP Mapping: 400 Bad Request - Code_FAILED_PRECONDITION Code = 9 - // The operation was aborted, typically due to a concurrency issue such as - // a sequencer check failure or transaction abort. - // - // See the guidelines above for deciding between `FAILED_PRECONDITION`, - // `ABORTED`, and `UNAVAILABLE`. - // - // HTTP Mapping: 409 Conflict - Code_ABORTED Code = 10 - // The operation was attempted past the valid range. E.g., seeking or - // reading past end-of-file. - // - // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may - // be fixed if the system state changes. For example, a 32-bit file - // system will generate `INVALID_ARGUMENT` if asked to read at an - // offset that is not in the range [0,2^32-1], but it will generate - // `OUT_OF_RANGE` if asked to read from an offset past the current - // file size. - // - // There is a fair bit of overlap between `FAILED_PRECONDITION` and - // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific - // error) when it applies so that callers who are iterating through - // a space can easily look for an `OUT_OF_RANGE` error to detect when - // they are done. - // - // HTTP Mapping: 400 Bad Request - Code_OUT_OF_RANGE Code = 11 - // The operation is not implemented or is not supported/enabled in this - // service. - // - // HTTP Mapping: 501 Not Implemented - Code_UNIMPLEMENTED Code = 12 - // Internal errors. This means that some invariants expected by the - // underlying system have been broken. This error code is reserved - // for serious errors. - // - // HTTP Mapping: 500 Internal Server Error - Code_INTERNAL Code = 13 - // The service is currently unavailable. This is most likely a - // transient condition, which can be corrected by retrying with - // a backoff. Note that it is not always safe to retry - // non-idempotent operations. - // - // See the guidelines above for deciding between `FAILED_PRECONDITION`, - // `ABORTED`, and `UNAVAILABLE`. - // - // HTTP Mapping: 503 Service Unavailable - Code_UNAVAILABLE Code = 14 - // Unrecoverable data loss or corruption. - // - // HTTP Mapping: 500 Internal Server Error - Code_DATA_LOSS Code = 15 -) - -// Enum value maps for Code. -var ( - Code_name = map[int32]string{ - 0: "OK", - 1: "CANCELLED", - 2: "UNKNOWN", - 3: "INVALID_ARGUMENT", - 4: "DEADLINE_EXCEEDED", - 5: "NOT_FOUND", - 6: "ALREADY_EXISTS", - 7: "PERMISSION_DENIED", - 16: "UNAUTHENTICATED", - 8: "RESOURCE_EXHAUSTED", - 9: "FAILED_PRECONDITION", - 10: "ABORTED", - 11: "OUT_OF_RANGE", - 12: "UNIMPLEMENTED", - 13: "INTERNAL", - 14: "UNAVAILABLE", - 15: "DATA_LOSS", - } - Code_value = map[string]int32{ - "OK": 0, - "CANCELLED": 1, - "UNKNOWN": 2, - "INVALID_ARGUMENT": 3, - "DEADLINE_EXCEEDED": 4, - "NOT_FOUND": 5, - "ALREADY_EXISTS": 6, - "PERMISSION_DENIED": 7, - "UNAUTHENTICATED": 16, - "RESOURCE_EXHAUSTED": 8, - "FAILED_PRECONDITION": 9, - "ABORTED": 10, - "OUT_OF_RANGE": 11, - "UNIMPLEMENTED": 12, - "INTERNAL": 13, - "UNAVAILABLE": 14, - "DATA_LOSS": 15, - } -) - -func (x Code) Enum() *Code { - p := new(Code) - *p = x - return p -} - -func (x Code) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Code) Descriptor() protoreflect.EnumDescriptor { - return file_google_rpc_code_proto_enumTypes[0].Descriptor() -} - -func (Code) Type() protoreflect.EnumType { - return &file_google_rpc_code_proto_enumTypes[0] -} - -func (x Code) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Code.Descriptor instead. -func (Code) EnumDescriptor() ([]byte, []int) { - return file_google_rpc_code_proto_rawDescGZIP(), []int{0} -} - -var File_google_rpc_code_proto protoreflect.FileDescriptor - -var file_google_rpc_code_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x72, 0x70, 0x63, 0x2a, 0xb7, 0x02, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x06, 0x0a, 0x02, - 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, - 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, - 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x41, 0x44, 0x4c, 0x49, - 0x4e, 0x45, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0d, 0x0a, - 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, - 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x06, - 0x12, 0x15, 0x0a, 0x11, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x44, - 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x4e, 0x41, 0x55, 0x54, - 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x10, 0x12, 0x16, 0x0a, 0x12, - 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x45, 0x58, 0x48, 0x41, 0x55, 0x53, 0x54, - 0x45, 0x44, 0x10, 0x08, 0x12, 0x17, 0x0a, 0x13, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x50, - 0x52, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x0b, 0x0a, - 0x07, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, - 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x11, 0x0a, 0x0d, - 0x55, 0x4e, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x0c, 0x12, - 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x0d, 0x12, 0x0f, 0x0a, - 0x0b, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x0e, 0x12, 0x0d, - 0x0a, 0x09, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x4c, 0x4f, 0x53, 0x53, 0x10, 0x0f, 0x42, 0x58, 0x0a, - 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x42, - 0x09, 0x43, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, - 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x3b, 0x63, 0x6f, 0x64, - 0x65, 0xa2, 0x02, 0x03, 0x52, 0x50, 0x43, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_rpc_code_proto_rawDescOnce sync.Once - file_google_rpc_code_proto_rawDescData = file_google_rpc_code_proto_rawDesc -) - -func file_google_rpc_code_proto_rawDescGZIP() []byte { - file_google_rpc_code_proto_rawDescOnce.Do(func() { - file_google_rpc_code_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_rpc_code_proto_rawDescData) - }) - return file_google_rpc_code_proto_rawDescData -} - -var file_google_rpc_code_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_rpc_code_proto_goTypes = []interface{}{ - (Code)(0), // 0: google.rpc.Code -} -var file_google_rpc_code_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_rpc_code_proto_init() } -func file_google_rpc_code_proto_init() { - if File_google_rpc_code_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_rpc_code_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_rpc_code_proto_goTypes, - DependencyIndexes: file_google_rpc_code_proto_depIdxs, - EnumInfos: file_google_rpc_code_proto_enumTypes, - }.Build() - File_google_rpc_code_proto = out.File - file_google_rpc_code_proto_rawDesc = nil - file_google_rpc_code_proto_goTypes = nil - file_google_rpc_code_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go b/ibm/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go deleted file mode 100644 index 1cc50df736..0000000000 --- a/ibm/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2019 Google LLC. -// -// 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 -// source: google/type/expr.proto - -package expr - -import ( - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// Represents an expression text. Example: -// -// title: "User account presence" -// description: "Determines whether the request has a user account" -// expression: "size(request.user) > 0" -type Expr struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Textual representation of an expression in - // Common Expression Language syntax. - // - // The application context of the containing message determines which - // well-known feature set of CEL is supported. - Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"` - // An optional title for the expression, i.e. a short string describing - // its purpose. This can be used e.g. in UIs which allow to enter the - // expression. - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - // An optional description of the expression. This is a longer text which - // describes the expression, e.g. when hovered over it in a UI. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // An optional string indicating the location of the expression for error - // reporting, e.g. a file name and a position in the file. - Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` -} - -func (x *Expr) Reset() { - *x = Expr{} - if protoimpl.UnsafeEnabled { - mi := &file_google_type_expr_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Expr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr) ProtoMessage() {} - -func (x *Expr) ProtoReflect() protoreflect.Message { - mi := &file_google_type_expr_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expr.ProtoReflect.Descriptor instead. -func (*Expr) Descriptor() ([]byte, []int) { - return file_google_type_expr_proto_rawDescGZIP(), []int{0} -} - -func (x *Expr) GetExpression() string { - if x != nil { - return x.Expression - } - return "" -} - -func (x *Expr) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *Expr) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Expr) GetLocation() string { - if x != nil { - return x.Location - } - return "" -} - -var File_google_type_expr_proto protoreflect.FileDescriptor - -var file_google_type_expr_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x65, 0x78, - 0x70, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x22, 0x7a, 0x0a, 0x04, 0x45, 0x78, 0x70, 0x72, 0x12, 0x1e, 0x0a, - 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x5a, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x42, 0x09, 0x45, 0x78, 0x70, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x65, 0x78, - 0x70, 0x72, 0x3b, 0x65, 0x78, 0x70, 0x72, 0xa2, 0x02, 0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_type_expr_proto_rawDescOnce sync.Once - file_google_type_expr_proto_rawDescData = file_google_type_expr_proto_rawDesc -) - -func file_google_type_expr_proto_rawDescGZIP() []byte { - file_google_type_expr_proto_rawDescOnce.Do(func() { - file_google_type_expr_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_type_expr_proto_rawDescData) - }) - return file_google_type_expr_proto_rawDescData -} - -var file_google_type_expr_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_type_expr_proto_goTypes = []interface{}{ - (*Expr)(nil), // 0: google.type.Expr -} -var file_google_type_expr_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_type_expr_proto_init() } -func file_google_type_expr_proto_init() { - if File_google_type_expr_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_type_expr_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Expr); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_type_expr_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_type_expr_proto_goTypes, - DependencyIndexes: file_google_type_expr_proto_depIdxs, - MessageInfos: file_google_type_expr_proto_msgTypes, - }.Build() - File_google_type_expr_proto = out.File - file_google_type_expr_proto_rawDesc = nil - file_google_type_expr_proto_goTypes = nil - file_google_type_expr_proto_depIdxs = nil -} diff --git a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/init.go b/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/init.go deleted file mode 100644 index 369df13da2..0000000000 --- a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/init.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal_gengo - -import ( - "unicode" - "unicode/utf8" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/encoding/protowire" - - "google.golang.org/protobuf/types/descriptorpb" -) - -type fileInfo struct { - *protogen.File - - allEnums []*enumInfo - allMessages []*messageInfo - allExtensions []*extensionInfo - - allEnumsByPtr map[*enumInfo]int // value is index into allEnums - allMessagesByPtr map[*messageInfo]int // value is index into allMessages - allMessageFieldsByPtr map[*messageInfo]*structFields - - // needRawDesc specifies whether the generator should emit logic to provide - // the legacy raw descriptor in GZIP'd form. - // This is updated by enum and message generation logic as necessary, - // and checked at the end of file generation. - needRawDesc bool -} - -type structFields struct { - count int - unexported map[int]string -} - -func (sf *structFields) append(name string) { - if r, _ := utf8.DecodeRuneInString(name); !unicode.IsUpper(r) { - if sf.unexported == nil { - sf.unexported = make(map[int]string) - } - sf.unexported[sf.count] = name - } - sf.count++ -} - -func newFileInfo(file *protogen.File) *fileInfo { - f := &fileInfo{File: file} - - // Collect all enums, messages, and extensions in "flattened ordering". - // See filetype.TypeBuilder. - var walkMessages func([]*protogen.Message, func(*protogen.Message)) - walkMessages = func(messages []*protogen.Message, f func(*protogen.Message)) { - for _, m := range messages { - f(m) - walkMessages(m.Messages, f) - } - } - initEnumInfos := func(enums []*protogen.Enum) { - for _, enum := range enums { - f.allEnums = append(f.allEnums, newEnumInfo(f, enum)) - } - } - initMessageInfos := func(messages []*protogen.Message) { - for _, message := range messages { - f.allMessages = append(f.allMessages, newMessageInfo(f, message)) - } - } - initExtensionInfos := func(extensions []*protogen.Extension) { - for _, extension := range extensions { - f.allExtensions = append(f.allExtensions, newExtensionInfo(f, extension)) - } - } - initEnumInfos(f.Enums) - initMessageInfos(f.Messages) - initExtensionInfos(f.Extensions) - walkMessages(f.Messages, func(m *protogen.Message) { - initEnumInfos(m.Enums) - initMessageInfos(m.Messages) - initExtensionInfos(m.Extensions) - }) - - // Derive a reverse mapping of enum and message pointers to their index - // in allEnums and allMessages. - if len(f.allEnums) > 0 { - f.allEnumsByPtr = make(map[*enumInfo]int) - for i, e := range f.allEnums { - f.allEnumsByPtr[e] = i - } - } - if len(f.allMessages) > 0 { - f.allMessagesByPtr = make(map[*messageInfo]int) - f.allMessageFieldsByPtr = make(map[*messageInfo]*structFields) - for i, m := range f.allMessages { - f.allMessagesByPtr[m] = i - f.allMessageFieldsByPtr[m] = new(structFields) - } - } - - return f -} - -type enumInfo struct { - *protogen.Enum - - genJSONMethod bool - genRawDescMethod bool -} - -func newEnumInfo(f *fileInfo, enum *protogen.Enum) *enumInfo { - e := &enumInfo{Enum: enum} - e.genJSONMethod = true - e.genRawDescMethod = true - return e -} - -type messageInfo struct { - *protogen.Message - - genRawDescMethod bool - genExtRangeMethod bool - - isTracked bool - hasWeak bool -} - -func newMessageInfo(f *fileInfo, message *protogen.Message) *messageInfo { - m := &messageInfo{Message: message} - m.genRawDescMethod = true - m.genExtRangeMethod = true - m.isTracked = isTrackedMessage(m) - for _, field := range m.Fields { - m.hasWeak = m.hasWeak || field.Desc.IsWeak() - } - return m -} - -// isTrackedMessage reports whether field tracking is enabled on the message. -func isTrackedMessage(m *messageInfo) (tracked bool) { - const trackFieldUse_fieldNumber = 37383685 - - // Decode the option from unknown fields to avoid a dependency on the - // annotation proto from protoc-gen-go. - b := m.Desc.Options().(*descriptorpb.MessageOptions).ProtoReflect().GetUnknown() - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - if num == trackFieldUse_fieldNumber && typ == protowire.VarintType { - v, _ := protowire.ConsumeVarint(b) - tracked = protowire.DecodeBool(v) - } - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - return tracked -} - -type extensionInfo struct { - *protogen.Extension -} - -func newExtensionInfo(f *fileInfo, extension *protogen.Extension) *extensionInfo { - x := &extensionInfo{Extension: extension} - return x -} diff --git a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/main.go b/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/main.go deleted file mode 100644 index 6338c44dc4..0000000000 --- a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/main.go +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package internal_gengo is internal to the protobuf module. -package internal_gengo - -import ( - "fmt" - "go/ast" - "go/parser" - "go/token" - "math" - "strconv" - "strings" - "unicode" - "unicode/utf8" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/internal/encoding/tag" - "google.golang.org/protobuf/internal/genid" - "google.golang.org/protobuf/internal/version" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/runtime/protoimpl" - - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -// SupportedFeatures reports the set of supported protobuf language features. -var SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) - -// GenerateVersionMarkers specifies whether to generate version markers. -var GenerateVersionMarkers = true - -// Standard library dependencies. -const ( - base64Package = protogen.GoImportPath("encoding/base64") - mathPackage = protogen.GoImportPath("math") - reflectPackage = protogen.GoImportPath("reflect") - sortPackage = protogen.GoImportPath("sort") - stringsPackage = protogen.GoImportPath("strings") - syncPackage = protogen.GoImportPath("sync") - timePackage = protogen.GoImportPath("time") - utf8Package = protogen.GoImportPath("unicode/utf8") -) - -// Protobuf library dependencies. -// -// These are declared as an interface type so that they can be more easily -// patched to support unique build environments that impose restrictions -// on the dependencies of generated source code. -var ( - protoPackage goImportPath = protogen.GoImportPath("google.golang.org/protobuf/proto") - protoifacePackage goImportPath = protogen.GoImportPath("google.golang.org/protobuf/runtime/protoiface") - protoimplPackage goImportPath = protogen.GoImportPath("google.golang.org/protobuf/runtime/protoimpl") - protojsonPackage goImportPath = protogen.GoImportPath("google.golang.org/protobuf/encoding/protojson") - protoreflectPackage goImportPath = protogen.GoImportPath("google.golang.org/protobuf/reflect/protoreflect") - protoregistryPackage goImportPath = protogen.GoImportPath("google.golang.org/protobuf/reflect/protoregistry") -) - -type goImportPath interface { - String() string - Ident(string) protogen.GoIdent -} - -// GenerateFile generates the contents of a .pb.go file. -func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { - filename := file.GeneratedFilenamePrefix + ".pb.go" - g := gen.NewGeneratedFile(filename, file.GoImportPath) - f := newFileInfo(file) - - genStandaloneComments(g, f, int32(genid.FileDescriptorProto_Syntax_field_number)) - genGeneratedHeader(gen, g, f) - genStandaloneComments(g, f, int32(genid.FileDescriptorProto_Package_field_number)) - - packageDoc := genPackageKnownComment(f) - g.P(packageDoc, "package ", f.GoPackageName) - g.P() - - // Emit a static check that enforces a minimum version of the proto package. - if GenerateVersionMarkers { - g.P("const (") - g.P("// Verify that this generated code is sufficiently up-to-date.") - g.P("_ = ", protoimplPackage.Ident("EnforceVersion"), "(", protoimpl.GenVersion, " - ", protoimplPackage.Ident("MinVersion"), ")") - g.P("// Verify that runtime/protoimpl is sufficiently up-to-date.") - g.P("_ = ", protoimplPackage.Ident("EnforceVersion"), "(", protoimplPackage.Ident("MaxVersion"), " - ", protoimpl.GenVersion, ")") - g.P(")") - g.P() - } - - for i, imps := 0, f.Desc.Imports(); i < imps.Len(); i++ { - genImport(gen, g, f, imps.Get(i)) - } - for _, enum := range f.allEnums { - genEnum(g, f, enum) - } - for _, message := range f.allMessages { - genMessage(g, f, message) - } - genExtensions(g, f) - - genReflectFileDescriptor(gen, g, f) - - return g -} - -// genStandaloneComments prints all leading comments for a FileDescriptorProto -// location identified by the field number n. -func genStandaloneComments(g *protogen.GeneratedFile, f *fileInfo, n int32) { - loc := f.Desc.SourceLocations().ByPath(protoreflect.SourcePath{n}) - for _, s := range loc.LeadingDetachedComments { - g.P(protogen.Comments(s)) - g.P() - } - if s := loc.LeadingComments; s != "" { - g.P(protogen.Comments(s)) - g.P() - } -} - -func genGeneratedHeader(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) { - g.P("// Code generated by protoc-gen-go. DO NOT EDIT.") - - if GenerateVersionMarkers { - g.P("// versions:") - protocGenGoVersion := version.String() - protocVersion := "(unknown)" - if v := gen.Request.GetCompilerVersion(); v != nil { - protocVersion = fmt.Sprintf("v%v.%v.%v", v.GetMajor(), v.GetMinor(), v.GetPatch()) - } - g.P("// \tprotoc-gen-go ", protocGenGoVersion) - g.P("// \tprotoc ", protocVersion) - } - - if f.Proto.GetOptions().GetDeprecated() { - g.P("// ", f.Desc.Path(), " is a deprecated file.") - } else { - g.P("// source: ", f.Desc.Path()) - } - g.P() -} - -func genImport(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, imp protoreflect.FileImport) { - impFile, ok := gen.FilesByPath[imp.Path()] - if !ok { - return - } - if impFile.GoImportPath == f.GoImportPath { - // Don't generate imports or aliases for types in the same Go package. - return - } - // Generate imports for all non-weak dependencies, even if they are not - // referenced, because other code and tools depend on having the - // full transitive closure of protocol buffer types in the binary. - if !imp.IsWeak { - g.Import(impFile.GoImportPath) - } - if !imp.IsPublic { - return - } - - // Generate public imports by generating the imported file, parsing it, - // and extracting every symbol that should receive a forwarding declaration. - impGen := GenerateFile(gen, impFile) - impGen.Skip() - b, err := impGen.Content() - if err != nil { - gen.Error(err) - return - } - fset := token.NewFileSet() - astFile, err := parser.ParseFile(fset, "", b, parser.ParseComments) - if err != nil { - gen.Error(err) - return - } - genForward := func(tok token.Token, name string, expr ast.Expr) { - // Don't import unexported symbols. - r, _ := utf8.DecodeRuneInString(name) - if !unicode.IsUpper(r) { - return - } - // Don't import the FileDescriptor. - if name == impFile.GoDescriptorIdent.GoName { - return - } - // Don't import decls referencing a symbol defined in another package. - // i.e., don't import decls which are themselves public imports: - // - // type T = somepackage.T - if _, ok := expr.(*ast.SelectorExpr); ok { - return - } - g.P(tok, " ", name, " = ", impFile.GoImportPath.Ident(name)) - } - g.P("// Symbols defined in public import of ", imp.Path(), ".") - g.P() - for _, decl := range astFile.Decls { - switch decl := decl.(type) { - case *ast.GenDecl: - for _, spec := range decl.Specs { - switch spec := spec.(type) { - case *ast.TypeSpec: - genForward(decl.Tok, spec.Name.Name, spec.Type) - case *ast.ValueSpec: - for i, name := range spec.Names { - var expr ast.Expr - if i < len(spec.Values) { - expr = spec.Values[i] - } - genForward(decl.Tok, name.Name, expr) - } - case *ast.ImportSpec: - default: - panic(fmt.Sprintf("can't generate forward for spec type %T", spec)) - } - } - } - } - g.P() -} - -func genEnum(g *protogen.GeneratedFile, f *fileInfo, e *enumInfo) { - // Enum type declaration. - g.Annotate(e.GoIdent.GoName, e.Location) - leadingComments := appendDeprecationSuffix(e.Comments.Leading, - e.Desc.Options().(*descriptorpb.EnumOptions).GetDeprecated()) - g.P(leadingComments, - "type ", e.GoIdent, " int32") - - // Enum value constants. - g.P("const (") - for _, value := range e.Values { - g.Annotate(value.GoIdent.GoName, value.Location) - leadingComments := appendDeprecationSuffix(value.Comments.Leading, - value.Desc.Options().(*descriptorpb.EnumValueOptions).GetDeprecated()) - g.P(leadingComments, - value.GoIdent, " ", e.GoIdent, " = ", value.Desc.Number(), - trailingComment(value.Comments.Trailing)) - } - g.P(")") - g.P() - - // Enum value maps. - g.P("// Enum value maps for ", e.GoIdent, ".") - g.P("var (") - g.P(e.GoIdent.GoName+"_name", " = map[int32]string{") - for _, value := range e.Values { - duplicate := "" - if value.Desc != e.Desc.Values().ByNumber(value.Desc.Number()) { - duplicate = "// Duplicate value: " - } - g.P(duplicate, value.Desc.Number(), ": ", strconv.Quote(string(value.Desc.Name())), ",") - } - g.P("}") - g.P(e.GoIdent.GoName+"_value", " = map[string]int32{") - for _, value := range e.Values { - g.P(strconv.Quote(string(value.Desc.Name())), ": ", value.Desc.Number(), ",") - } - g.P("}") - g.P(")") - g.P() - - // Enum method. - // - // NOTE: A pointer value is needed to represent presence in proto2. - // Since a proto2 message can reference a proto3 enum, it is useful to - // always generate this method (even on proto3 enums) to support that case. - g.P("func (x ", e.GoIdent, ") Enum() *", e.GoIdent, " {") - g.P("p := new(", e.GoIdent, ")") - g.P("*p = x") - g.P("return p") - g.P("}") - g.P() - - // String method. - g.P("func (x ", e.GoIdent, ") String() string {") - g.P("return ", protoimplPackage.Ident("X"), ".EnumStringOf(x.Descriptor(), ", protoreflectPackage.Ident("EnumNumber"), "(x))") - g.P("}") - g.P() - - genEnumReflectMethods(g, f, e) - - // UnmarshalJSON method. - if e.genJSONMethod && e.Desc.Syntax() == protoreflect.Proto2 { - g.P("// Deprecated: Do not use.") - g.P("func (x *", e.GoIdent, ") UnmarshalJSON(b []byte) error {") - g.P("num, err := ", protoimplPackage.Ident("X"), ".UnmarshalJSONEnum(x.Descriptor(), b)") - g.P("if err != nil {") - g.P("return err") - g.P("}") - g.P("*x = ", e.GoIdent, "(num)") - g.P("return nil") - g.P("}") - g.P() - } - - // EnumDescriptor method. - if e.genRawDescMethod { - var indexes []string - for i := 1; i < len(e.Location.Path); i += 2 { - indexes = append(indexes, strconv.Itoa(int(e.Location.Path[i]))) - } - g.P("// Deprecated: Use ", e.GoIdent, ".Descriptor instead.") - g.P("func (", e.GoIdent, ") EnumDescriptor() ([]byte, []int) {") - g.P("return ", rawDescVarName(f), "GZIP(), []int{", strings.Join(indexes, ","), "}") - g.P("}") - g.P() - f.needRawDesc = true - } -} - -func genMessage(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - if m.Desc.IsMapEntry() { - return - } - - // Message type declaration. - g.Annotate(m.GoIdent.GoName, m.Location) - leadingComments := appendDeprecationSuffix(m.Comments.Leading, - m.Desc.Options().(*descriptorpb.MessageOptions).GetDeprecated()) - g.P(leadingComments, - "type ", m.GoIdent, " struct {") - genMessageFields(g, f, m) - g.P("}") - g.P() - - genMessageKnownFunctions(g, f, m) - genMessageDefaultDecls(g, f, m) - genMessageMethods(g, f, m) - genMessageOneofWrapperTypes(g, f, m) -} - -func genMessageFields(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - sf := f.allMessageFieldsByPtr[m] - genMessageInternalFields(g, f, m, sf) - for _, field := range m.Fields { - genMessageField(g, f, m, field, sf) - } -} - -func genMessageInternalFields(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo, sf *structFields) { - g.P(genid.State_goname, " ", protoimplPackage.Ident("MessageState")) - sf.append(genid.State_goname) - g.P(genid.SizeCache_goname, " ", protoimplPackage.Ident("SizeCache")) - sf.append(genid.SizeCache_goname) - if m.hasWeak { - g.P(genid.WeakFields_goname, " ", protoimplPackage.Ident("WeakFields")) - sf.append(genid.WeakFields_goname) - } - g.P(genid.UnknownFields_goname, " ", protoimplPackage.Ident("UnknownFields")) - sf.append(genid.UnknownFields_goname) - if m.Desc.ExtensionRanges().Len() > 0 { - g.P(genid.ExtensionFields_goname, " ", protoimplPackage.Ident("ExtensionFields")) - sf.append(genid.ExtensionFields_goname) - } - if sf.count > 0 { - g.P() - } -} - -func genMessageField(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo, field *protogen.Field, sf *structFields) { - if oneof := field.Oneof; oneof != nil && !oneof.Desc.IsSynthetic() { - // It would be a bit simpler to iterate over the oneofs below, - // but generating the field here keeps the contents of the Go - // struct in the same order as the contents of the source - // .proto file. - if oneof.Fields[0] != field { - return // only generate for first appearance - } - - tags := structTags{ - {"protobuf_oneof", string(oneof.Desc.Name())}, - } - if m.isTracked { - tags = append(tags, gotrackTags...) - } - - g.Annotate(m.GoIdent.GoName+"."+oneof.GoName, oneof.Location) - leadingComments := oneof.Comments.Leading - if leadingComments != "" { - leadingComments += "\n" - } - ss := []string{fmt.Sprintf(" Types that are assignable to %s:\n", oneof.GoName)} - for _, field := range oneof.Fields { - ss = append(ss, "\t*"+field.GoIdent.GoName+"\n") - } - leadingComments += protogen.Comments(strings.Join(ss, "")) - g.P(leadingComments, - oneof.GoName, " ", oneofInterfaceName(oneof), tags) - sf.append(oneof.GoName) - return - } - goType, pointer := fieldGoType(g, f, field) - if pointer { - goType = "*" + goType - } - tags := structTags{ - {"protobuf", fieldProtobufTagValue(field)}, - {"json", fieldJSONTagValue(field)}, - } - if field.Desc.IsMap() { - key := field.Message.Fields[0] - val := field.Message.Fields[1] - tags = append(tags, structTags{ - {"protobuf_key", fieldProtobufTagValue(key)}, - {"protobuf_val", fieldProtobufTagValue(val)}, - }...) - } - if m.isTracked { - tags = append(tags, gotrackTags...) - } - - name := field.GoName - if field.Desc.IsWeak() { - name = genid.WeakFieldPrefix_goname + name - } - g.Annotate(m.GoIdent.GoName+"."+name, field.Location) - leadingComments := appendDeprecationSuffix(field.Comments.Leading, - field.Desc.Options().(*descriptorpb.FieldOptions).GetDeprecated()) - g.P(leadingComments, - name, " ", goType, tags, - trailingComment(field.Comments.Trailing)) - sf.append(field.GoName) -} - -// genMessageDefaultDecls generates consts and vars holding the default -// values of fields. -func genMessageDefaultDecls(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - var consts, vars []string - for _, field := range m.Fields { - if !field.Desc.HasDefault() { - continue - } - name := "Default_" + m.GoIdent.GoName + "_" + field.GoName - goType, _ := fieldGoType(g, f, field) - defVal := field.Desc.Default() - switch field.Desc.Kind() { - case protoreflect.StringKind: - consts = append(consts, fmt.Sprintf("%s = %s(%q)", name, goType, defVal.String())) - case protoreflect.BytesKind: - vars = append(vars, fmt.Sprintf("%s = %s(%q)", name, goType, defVal.Bytes())) - case protoreflect.EnumKind: - idx := field.Desc.DefaultEnumValue().Index() - val := field.Enum.Values[idx] - consts = append(consts, fmt.Sprintf("%s = %s", name, g.QualifiedGoIdent(val.GoIdent))) - case protoreflect.FloatKind, protoreflect.DoubleKind: - if f := defVal.Float(); math.IsNaN(f) || math.IsInf(f, 0) { - var fn, arg string - switch f := defVal.Float(); { - case math.IsInf(f, -1): - fn, arg = g.QualifiedGoIdent(mathPackage.Ident("Inf")), "-1" - case math.IsInf(f, +1): - fn, arg = g.QualifiedGoIdent(mathPackage.Ident("Inf")), "+1" - case math.IsNaN(f): - fn, arg = g.QualifiedGoIdent(mathPackage.Ident("NaN")), "" - } - vars = append(vars, fmt.Sprintf("%s = %s(%s(%s))", name, goType, fn, arg)) - } else { - consts = append(consts, fmt.Sprintf("%s = %s(%v)", name, goType, f)) - } - default: - consts = append(consts, fmt.Sprintf("%s = %s(%v)", name, goType, defVal.Interface())) - } - } - if len(consts) > 0 { - g.P("// Default values for ", m.GoIdent, " fields.") - g.P("const (") - for _, s := range consts { - g.P(s) - } - g.P(")") - } - if len(vars) > 0 { - g.P("// Default values for ", m.GoIdent, " fields.") - g.P("var (") - for _, s := range vars { - g.P(s) - } - g.P(")") - } - g.P() -} - -func genMessageMethods(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - genMessageBaseMethods(g, f, m) - genMessageGetterMethods(g, f, m) - genMessageSetterMethods(g, f, m) -} - -func genMessageBaseMethods(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - // Reset method. - g.P("func (x *", m.GoIdent, ") Reset() {") - g.P("*x = ", m.GoIdent, "{}") - g.P("if ", protoimplPackage.Ident("UnsafeEnabled"), " {") - g.P("mi := &", messageTypesVarName(f), "[", f.allMessagesByPtr[m], "]") - g.P("ms := ", protoimplPackage.Ident("X"), ".MessageStateOf(", protoimplPackage.Ident("Pointer"), "(x))") - g.P("ms.StoreMessageInfo(mi)") - g.P("}") - g.P("}") - g.P() - - // String method. - g.P("func (x *", m.GoIdent, ") String() string {") - g.P("return ", protoimplPackage.Ident("X"), ".MessageStringOf(x)") - g.P("}") - g.P() - - // ProtoMessage method. - g.P("func (*", m.GoIdent, ") ProtoMessage() {}") - g.P() - - // ProtoReflect method. - genMessageReflectMethods(g, f, m) - - // Descriptor method. - if m.genRawDescMethod { - var indexes []string - for i := 1; i < len(m.Location.Path); i += 2 { - indexes = append(indexes, strconv.Itoa(int(m.Location.Path[i]))) - } - g.P("// Deprecated: Use ", m.GoIdent, ".ProtoReflect.Descriptor instead.") - g.P("func (*", m.GoIdent, ") Descriptor() ([]byte, []int) {") - g.P("return ", rawDescVarName(f), "GZIP(), []int{", strings.Join(indexes, ","), "}") - g.P("}") - g.P() - f.needRawDesc = true - } - - // ExtensionRangeArray method. - extRanges := m.Desc.ExtensionRanges() - if m.genExtRangeMethod && extRanges.Len() > 0 { - protoExtRange := protoifacePackage.Ident("ExtensionRangeV1") - extRangeVar := "extRange_" + m.GoIdent.GoName - g.P("var ", extRangeVar, " = []", protoExtRange, " {") - for i := 0; i < extRanges.Len(); i++ { - r := extRanges.Get(i) - g.P("{Start:", r[0], ", End:", r[1]-1 /* inclusive */, "},") - } - g.P("}") - g.P() - g.P("// Deprecated: Use ", m.GoIdent, ".ProtoReflect.Descriptor.ExtensionRanges instead.") - g.P("func (*", m.GoIdent, ") ExtensionRangeArray() []", protoExtRange, " {") - g.P("return ", extRangeVar) - g.P("}") - g.P() - } -} - -func genMessageGetterMethods(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - for _, field := range m.Fields { - genNoInterfacePragma(g, m.isTracked) - - // Getter for parent oneof. - if oneof := field.Oneof; oneof != nil && oneof.Fields[0] == field && !oneof.Desc.IsSynthetic() { - g.Annotate(m.GoIdent.GoName+".Get"+oneof.GoName, oneof.Location) - g.P("func (m *", m.GoIdent.GoName, ") Get", oneof.GoName, "() ", oneofInterfaceName(oneof), " {") - g.P("if m != nil {") - g.P("return m.", oneof.GoName) - g.P("}") - g.P("return nil") - g.P("}") - g.P() - } - - // Getter for message field. - goType, pointer := fieldGoType(g, f, field) - defaultValue := fieldDefaultValue(g, m, field) - g.Annotate(m.GoIdent.GoName+".Get"+field.GoName, field.Location) - leadingComments := appendDeprecationSuffix("", - field.Desc.Options().(*descriptorpb.FieldOptions).GetDeprecated()) - switch { - case field.Desc.IsWeak(): - g.P(leadingComments, "func (x *", m.GoIdent, ") Get", field.GoName, "() ", protoPackage.Ident("Message"), "{") - g.P("var w ", protoimplPackage.Ident("WeakFields")) - g.P("if x != nil {") - g.P("w = x.", genid.WeakFields_goname) - if m.isTracked { - g.P("_ = x.", genid.WeakFieldPrefix_goname+field.GoName) - } - g.P("}") - g.P("return ", protoimplPackage.Ident("X"), ".GetWeak(w, ", field.Desc.Number(), ", ", strconv.Quote(string(field.Message.Desc.FullName())), ")") - g.P("}") - case field.Oneof != nil && !field.Oneof.Desc.IsSynthetic(): - g.P(leadingComments, "func (x *", m.GoIdent, ") Get", field.GoName, "() ", goType, " {") - g.P("if x, ok := x.Get", field.Oneof.GoName, "().(*", field.GoIdent, "); ok {") - g.P("return x.", field.GoName) - g.P("}") - g.P("return ", defaultValue) - g.P("}") - default: - g.P(leadingComments, "func (x *", m.GoIdent, ") Get", field.GoName, "() ", goType, " {") - if !field.Desc.HasPresence() || defaultValue == "nil" { - g.P("if x != nil {") - } else { - g.P("if x != nil && x.", field.GoName, " != nil {") - } - star := "" - if pointer { - star = "*" - } - g.P("return ", star, " x.", field.GoName) - g.P("}") - g.P("return ", defaultValue) - g.P("}") - } - g.P() - } -} - -func genMessageSetterMethods(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - for _, field := range m.Fields { - if !field.Desc.IsWeak() { - continue - } - - genNoInterfacePragma(g, m.isTracked) - - g.Annotate(m.GoIdent.GoName+".Set"+field.GoName, field.Location) - leadingComments := appendDeprecationSuffix("", - field.Desc.Options().(*descriptorpb.FieldOptions).GetDeprecated()) - g.P(leadingComments, "func (x *", m.GoIdent, ") Set", field.GoName, "(v ", protoPackage.Ident("Message"), ") {") - g.P("var w *", protoimplPackage.Ident("WeakFields")) - g.P("if x != nil {") - g.P("w = &x.", genid.WeakFields_goname) - if m.isTracked { - g.P("_ = x.", genid.WeakFieldPrefix_goname+field.GoName) - } - g.P("}") - g.P(protoimplPackage.Ident("X"), ".SetWeak(w, ", field.Desc.Number(), ", ", strconv.Quote(string(field.Message.Desc.FullName())), ", v)") - g.P("}") - g.P() - } -} - -// fieldGoType returns the Go type used for a field. -// -// If it returns pointer=true, the struct field is a pointer to the type. -func fieldGoType(g *protogen.GeneratedFile, f *fileInfo, field *protogen.Field) (goType string, pointer bool) { - if field.Desc.IsWeak() { - return "struct{}", false - } - - pointer = field.Desc.HasPresence() - switch field.Desc.Kind() { - case protoreflect.BoolKind: - goType = "bool" - case protoreflect.EnumKind: - goType = g.QualifiedGoIdent(field.Enum.GoIdent) - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - goType = "int32" - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - goType = "uint32" - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - goType = "int64" - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - goType = "uint64" - case protoreflect.FloatKind: - goType = "float32" - case protoreflect.DoubleKind: - goType = "float64" - case protoreflect.StringKind: - goType = "string" - case protoreflect.BytesKind: - goType = "[]byte" - pointer = false // rely on nullability of slices for presence - case protoreflect.MessageKind, protoreflect.GroupKind: - goType = "*" + g.QualifiedGoIdent(field.Message.GoIdent) - pointer = false // pointer captured as part of the type - } - switch { - case field.Desc.IsList(): - return "[]" + goType, false - case field.Desc.IsMap(): - keyType, _ := fieldGoType(g, f, field.Message.Fields[0]) - valType, _ := fieldGoType(g, f, field.Message.Fields[1]) - return fmt.Sprintf("map[%v]%v", keyType, valType), false - } - return goType, pointer -} - -func fieldProtobufTagValue(field *protogen.Field) string { - var enumName string - if field.Desc.Kind() == protoreflect.EnumKind { - enumName = protoimpl.X.LegacyEnumName(field.Enum.Desc) - } - return tag.Marshal(field.Desc, enumName) -} - -func fieldDefaultValue(g *protogen.GeneratedFile, m *messageInfo, field *protogen.Field) string { - if field.Desc.IsList() { - return "nil" - } - if field.Desc.HasDefault() { - defVarName := "Default_" + m.GoIdent.GoName + "_" + field.GoName - if field.Desc.Kind() == protoreflect.BytesKind { - return "append([]byte(nil), " + defVarName + "...)" - } - return defVarName - } - switch field.Desc.Kind() { - case protoreflect.BoolKind: - return "false" - case protoreflect.StringKind: - return `""` - case protoreflect.MessageKind, protoreflect.GroupKind, protoreflect.BytesKind: - return "nil" - case protoreflect.EnumKind: - return g.QualifiedGoIdent(field.Enum.Values[0].GoIdent) - default: - return "0" - } -} - -func fieldJSONTagValue(field *protogen.Field) string { - return string(field.Desc.Name()) + ",omitempty" -} - -func genExtensions(g *protogen.GeneratedFile, f *fileInfo) { - if len(f.allExtensions) == 0 { - return - } - - g.P("var ", extensionTypesVarName(f), " = []", protoimplPackage.Ident("ExtensionInfo"), "{") - for _, x := range f.allExtensions { - g.P("{") - g.P("ExtendedType: (*", x.Extendee.GoIdent, ")(nil),") - goType, pointer := fieldGoType(g, f, x.Extension) - if pointer { - goType = "*" + goType - } - g.P("ExtensionType: (", goType, ")(nil),") - g.P("Field: ", x.Desc.Number(), ",") - g.P("Name: ", strconv.Quote(string(x.Desc.FullName())), ",") - g.P("Tag: ", strconv.Quote(fieldProtobufTagValue(x.Extension)), ",") - g.P("Filename: ", strconv.Quote(f.Desc.Path()), ",") - g.P("},") - } - g.P("}") - g.P() - - // Group extensions by the target message. - var orderedTargets []protogen.GoIdent - allExtensionsByTarget := make(map[protogen.GoIdent][]*extensionInfo) - allExtensionsByPtr := make(map[*extensionInfo]int) - for i, x := range f.allExtensions { - target := x.Extendee.GoIdent - if len(allExtensionsByTarget[target]) == 0 { - orderedTargets = append(orderedTargets, target) - } - allExtensionsByTarget[target] = append(allExtensionsByTarget[target], x) - allExtensionsByPtr[x] = i - } - for _, target := range orderedTargets { - g.P("// Extension fields to ", target, ".") - g.P("var (") - for _, x := range allExtensionsByTarget[target] { - xd := x.Desc - typeName := xd.Kind().String() - switch xd.Kind() { - case protoreflect.EnumKind: - typeName = string(xd.Enum().FullName()) - case protoreflect.MessageKind, protoreflect.GroupKind: - typeName = string(xd.Message().FullName()) - } - fieldName := string(xd.Name()) - - leadingComments := x.Comments.Leading - if leadingComments != "" { - leadingComments += "\n" - } - leadingComments += protogen.Comments(fmt.Sprintf(" %v %v %v = %v;\n", - xd.Cardinality(), typeName, fieldName, xd.Number())) - leadingComments = appendDeprecationSuffix(leadingComments, - x.Desc.Options().(*descriptorpb.FieldOptions).GetDeprecated()) - g.P(leadingComments, - "E_", x.GoIdent, " = &", extensionTypesVarName(f), "[", allExtensionsByPtr[x], "]", - trailingComment(x.Comments.Trailing)) - } - g.P(")") - g.P() - } -} - -// genMessageOneofWrapperTypes generates the oneof wrapper types and -// associates the types with the parent message type. -func genMessageOneofWrapperTypes(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - for _, oneof := range m.Oneofs { - if oneof.Desc.IsSynthetic() { - continue - } - ifName := oneofInterfaceName(oneof) - g.P("type ", ifName, " interface {") - g.P(ifName, "()") - g.P("}") - g.P() - for _, field := range oneof.Fields { - g.Annotate(field.GoIdent.GoName, field.Location) - g.Annotate(field.GoIdent.GoName+"."+field.GoName, field.Location) - g.P("type ", field.GoIdent, " struct {") - goType, _ := fieldGoType(g, f, field) - tags := structTags{ - {"protobuf", fieldProtobufTagValue(field)}, - } - if m.isTracked { - tags = append(tags, gotrackTags...) - } - leadingComments := appendDeprecationSuffix(field.Comments.Leading, - field.Desc.Options().(*descriptorpb.FieldOptions).GetDeprecated()) - g.P(leadingComments, - field.GoName, " ", goType, tags, - trailingComment(field.Comments.Trailing)) - g.P("}") - g.P() - } - for _, field := range oneof.Fields { - g.P("func (*", field.GoIdent, ") ", ifName, "() {}") - g.P() - } - } -} - -// oneofInterfaceName returns the name of the interface type implemented by -// the oneof field value types. -func oneofInterfaceName(oneof *protogen.Oneof) string { - return "is" + oneof.GoIdent.GoName -} - -// genNoInterfacePragma generates a standalone "nointerface" pragma to -// decorate methods with field-tracking support. -func genNoInterfacePragma(g *protogen.GeneratedFile, tracked bool) { - if tracked { - g.P("//go:nointerface") - g.P() - } -} - -var gotrackTags = structTags{{"go", "track"}} - -// structTags is a data structure for build idiomatic Go struct tags. -// Each [2]string is a key-value pair, where value is the unescaped string. -// -// Example: structTags{{"key", "value"}}.String() -> `key:"value"` -type structTags [][2]string - -func (tags structTags) String() string { - if len(tags) == 0 { - return "" - } - var ss []string - for _, tag := range tags { - // NOTE: When quoting the value, we need to make sure the backtick - // character does not appear. Convert all cases to the escaped hex form. - key := tag[0] - val := strings.Replace(strconv.Quote(tag[1]), "`", `\x60`, -1) - ss = append(ss, fmt.Sprintf("%s:%s", key, val)) - } - return "`" + strings.Join(ss, " ") + "`" -} - -// appendDeprecationSuffix optionally appends a deprecation notice as a suffix. -func appendDeprecationSuffix(prefix protogen.Comments, deprecated bool) protogen.Comments { - if !deprecated { - return prefix - } - if prefix != "" { - prefix += "\n" - } - return prefix + " Deprecated: Do not use.\n" -} - -// trailingComment is like protogen.Comments, but lacks a trailing newline. -type trailingComment protogen.Comments - -func (c trailingComment) String() string { - s := strings.TrimSuffix(protogen.Comments(c).String(), "\n") - if strings.Contains(s, "\n") { - // We don't support multi-lined trailing comments as it is unclear - // how to best render them in the generated code. - return "" - } - return s -} diff --git a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/reflect.go b/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/reflect.go deleted file mode 100644 index 1319a12675..0000000000 --- a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/reflect.go +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal_gengo - -import ( - "fmt" - "math" - "strings" - "unicode/utf8" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "google.golang.org/protobuf/types/descriptorpb" -) - -func genReflectFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) { - g.P("var ", f.GoDescriptorIdent, " ", protoreflectPackage.Ident("FileDescriptor")) - g.P() - - genFileDescriptor(gen, g, f) - if len(f.allEnums) > 0 { - g.P("var ", enumTypesVarName(f), " = make([]", protoimplPackage.Ident("EnumInfo"), ",", len(f.allEnums), ")") - } - if len(f.allMessages) > 0 { - g.P("var ", messageTypesVarName(f), " = make([]", protoimplPackage.Ident("MessageInfo"), ",", len(f.allMessages), ")") - } - - // Generate a unique list of Go types for all declarations and dependencies, - // and the associated index into the type list for all dependencies. - var goTypes []string - var depIdxs []string - seen := map[protoreflect.FullName]int{} - genDep := func(name protoreflect.FullName, depSource string) { - if depSource != "" { - line := fmt.Sprintf("%d, // %d: %s -> %s", seen[name], len(depIdxs), depSource, name) - depIdxs = append(depIdxs, line) - } - } - genEnum := func(e *protogen.Enum, depSource string) { - if e != nil { - name := e.Desc.FullName() - if _, ok := seen[name]; !ok { - line := fmt.Sprintf("(%s)(0), // %d: %s", g.QualifiedGoIdent(e.GoIdent), len(goTypes), name) - goTypes = append(goTypes, line) - seen[name] = len(seen) - } - if depSource != "" { - genDep(name, depSource) - } - } - } - genMessage := func(m *protogen.Message, depSource string) { - if m != nil { - name := m.Desc.FullName() - if _, ok := seen[name]; !ok { - line := fmt.Sprintf("(*%s)(nil), // %d: %s", g.QualifiedGoIdent(m.GoIdent), len(goTypes), name) - if m.Desc.IsMapEntry() { - // Map entry messages have no associated Go type. - line = fmt.Sprintf("nil, // %d: %s", len(goTypes), name) - } - goTypes = append(goTypes, line) - seen[name] = len(seen) - } - if depSource != "" { - genDep(name, depSource) - } - } - } - - // This ordering is significant. - // See filetype.TypeBuilder.DependencyIndexes. - type offsetEntry struct { - start int - name string - } - var depOffsets []offsetEntry - for _, enum := range f.allEnums { - genEnum(enum.Enum, "") - } - for _, message := range f.allMessages { - genMessage(message.Message, "") - } - depOffsets = append(depOffsets, offsetEntry{len(depIdxs), "field type_name"}) - for _, message := range f.allMessages { - for _, field := range message.Fields { - if field.Desc.IsWeak() { - continue - } - source := string(field.Desc.FullName()) - genEnum(field.Enum, source+":type_name") - genMessage(field.Message, source+":type_name") - } - } - depOffsets = append(depOffsets, offsetEntry{len(depIdxs), "extension extendee"}) - for _, extension := range f.allExtensions { - source := string(extension.Desc.FullName()) - genMessage(extension.Extendee, source+":extendee") - } - depOffsets = append(depOffsets, offsetEntry{len(depIdxs), "extension type_name"}) - for _, extension := range f.allExtensions { - source := string(extension.Desc.FullName()) - genEnum(extension.Enum, source+":type_name") - genMessage(extension.Message, source+":type_name") - } - depOffsets = append(depOffsets, offsetEntry{len(depIdxs), "method input_type"}) - for _, service := range f.Services { - for _, method := range service.Methods { - source := string(method.Desc.FullName()) - genMessage(method.Input, source+":input_type") - } - } - depOffsets = append(depOffsets, offsetEntry{len(depIdxs), "method output_type"}) - for _, service := range f.Services { - for _, method := range service.Methods { - source := string(method.Desc.FullName()) - genMessage(method.Output, source+":output_type") - } - } - depOffsets = append(depOffsets, offsetEntry{len(depIdxs), ""}) - for i := len(depOffsets) - 2; i >= 0; i-- { - curr, next := depOffsets[i], depOffsets[i+1] - depIdxs = append(depIdxs, fmt.Sprintf("%d, // [%d:%d] is the sub-list for %s", - curr.start, curr.start, next.start, curr.name)) - } - if len(depIdxs) > math.MaxInt32 { - panic("too many dependencies") // sanity check - } - - g.P("var ", goTypesVarName(f), " = []interface{}{") - for _, s := range goTypes { - g.P(s) - } - g.P("}") - - g.P("var ", depIdxsVarName(f), " = []int32{") - for _, s := range depIdxs { - g.P(s) - } - g.P("}") - - g.P("func init() { ", initFuncName(f.File), "() }") - - g.P("func ", initFuncName(f.File), "() {") - g.P("if ", f.GoDescriptorIdent, " != nil {") - g.P("return") - g.P("}") - - // Ensure that initialization functions for different files in the same Go - // package run in the correct order: Call the init funcs for every .proto file - // imported by this one that is in the same Go package. - for i, imps := 0, f.Desc.Imports(); i < imps.Len(); i++ { - impFile := gen.FilesByPath[imps.Get(i).Path()] - if impFile.GoImportPath != f.GoImportPath { - continue - } - g.P(initFuncName(impFile), "()") - } - - if len(f.allMessages) > 0 { - // Populate MessageInfo.Exporters. - g.P("if !", protoimplPackage.Ident("UnsafeEnabled"), " {") - for _, message := range f.allMessages { - if sf := f.allMessageFieldsByPtr[message]; len(sf.unexported) > 0 { - idx := f.allMessagesByPtr[message] - typesVar := messageTypesVarName(f) - - g.P(typesVar, "[", idx, "].Exporter = func(v interface{}, i int) interface{} {") - g.P("switch v := v.(*", message.GoIdent, "); i {") - for i := 0; i < sf.count; i++ { - if name := sf.unexported[i]; name != "" { - g.P("case ", i, ": return &v.", name) - } - } - g.P("default: return nil") - g.P("}") - g.P("}") - } - } - g.P("}") - - // Populate MessageInfo.OneofWrappers. - for _, message := range f.allMessages { - if len(message.Oneofs) > 0 { - idx := f.allMessagesByPtr[message] - typesVar := messageTypesVarName(f) - - // Associate the wrapper types by directly passing them to the MessageInfo. - g.P(typesVar, "[", idx, "].OneofWrappers = []interface{} {") - for _, oneof := range message.Oneofs { - if !oneof.Desc.IsSynthetic() { - for _, field := range oneof.Fields { - g.P("(*", field.GoIdent, ")(nil),") - } - } - } - g.P("}") - } - } - } - - g.P("type x struct{}") - g.P("out := ", protoimplPackage.Ident("TypeBuilder"), "{") - g.P("File: ", protoimplPackage.Ident("DescBuilder"), "{") - g.P("GoPackagePath: ", reflectPackage.Ident("TypeOf"), "(x{}).PkgPath(),") - g.P("RawDescriptor: ", rawDescVarName(f), ",") - g.P("NumEnums: ", len(f.allEnums), ",") - g.P("NumMessages: ", len(f.allMessages), ",") - g.P("NumExtensions: ", len(f.allExtensions), ",") - g.P("NumServices: ", len(f.Services), ",") - g.P("},") - g.P("GoTypes: ", goTypesVarName(f), ",") - g.P("DependencyIndexes: ", depIdxsVarName(f), ",") - if len(f.allEnums) > 0 { - g.P("EnumInfos: ", enumTypesVarName(f), ",") - } - if len(f.allMessages) > 0 { - g.P("MessageInfos: ", messageTypesVarName(f), ",") - } - if len(f.allExtensions) > 0 { - g.P("ExtensionInfos: ", extensionTypesVarName(f), ",") - } - g.P("}.Build()") - g.P(f.GoDescriptorIdent, " = out.File") - - // Set inputs to nil to allow GC to reclaim resources. - g.P(rawDescVarName(f), " = nil") - g.P(goTypesVarName(f), " = nil") - g.P(depIdxsVarName(f), " = nil") - g.P("}") -} - -func genFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) { - descProto := proto.Clone(f.Proto).(*descriptorpb.FileDescriptorProto) - descProto.SourceCodeInfo = nil // drop source code information - - b, err := proto.MarshalOptions{AllowPartial: true, Deterministic: true}.Marshal(descProto) - if err != nil { - gen.Error(err) - return - } - - g.P("var ", rawDescVarName(f), " = []byte{") - for len(b) > 0 { - n := 16 - if n > len(b) { - n = len(b) - } - - s := "" - for _, c := range b[:n] { - s += fmt.Sprintf("0x%02x,", c) - } - g.P(s) - - b = b[n:] - } - g.P("}") - g.P() - - if f.needRawDesc { - onceVar := rawDescVarName(f) + "Once" - dataVar := rawDescVarName(f) + "Data" - g.P("var (") - g.P(onceVar, " ", syncPackage.Ident("Once")) - g.P(dataVar, " = ", rawDescVarName(f)) - g.P(")") - g.P() - - g.P("func ", rawDescVarName(f), "GZIP() []byte {") - g.P(onceVar, ".Do(func() {") - g.P(dataVar, " = ", protoimplPackage.Ident("X"), ".CompressGZIP(", dataVar, ")") - g.P("})") - g.P("return ", dataVar) - g.P("}") - g.P() - } -} - -func genEnumReflectMethods(g *protogen.GeneratedFile, f *fileInfo, e *enumInfo) { - idx := f.allEnumsByPtr[e] - typesVar := enumTypesVarName(f) - - // Descriptor method. - g.P("func (", e.GoIdent, ") Descriptor() ", protoreflectPackage.Ident("EnumDescriptor"), " {") - g.P("return ", typesVar, "[", idx, "].Descriptor()") - g.P("}") - g.P() - - // Type method. - g.P("func (", e.GoIdent, ") Type() ", protoreflectPackage.Ident("EnumType"), " {") - g.P("return &", typesVar, "[", idx, "]") - g.P("}") - g.P() - - // Number method. - g.P("func (x ", e.GoIdent, ") Number() ", protoreflectPackage.Ident("EnumNumber"), " {") - g.P("return ", protoreflectPackage.Ident("EnumNumber"), "(x)") - g.P("}") - g.P() -} - -func genMessageReflectMethods(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - idx := f.allMessagesByPtr[m] - typesVar := messageTypesVarName(f) - - // ProtoReflect method. - g.P("func (x *", m.GoIdent, ") ProtoReflect() ", protoreflectPackage.Ident("Message"), " {") - g.P("mi := &", typesVar, "[", idx, "]") - g.P("if ", protoimplPackage.Ident("UnsafeEnabled"), " && x != nil {") - g.P("ms := ", protoimplPackage.Ident("X"), ".MessageStateOf(", protoimplPackage.Ident("Pointer"), "(x))") - g.P("if ms.LoadMessageInfo() == nil {") - g.P("ms.StoreMessageInfo(mi)") - g.P("}") - g.P("return ms") - g.P("}") - g.P("return mi.MessageOf(x)") - g.P("}") - g.P() -} - -func fileVarName(f *protogen.File, suffix string) string { - prefix := f.GoDescriptorIdent.GoName - _, n := utf8.DecodeRuneInString(prefix) - prefix = strings.ToLower(prefix[:n]) + prefix[n:] - return prefix + "_" + suffix -} -func rawDescVarName(f *fileInfo) string { - return fileVarName(f.File, "rawDesc") -} -func goTypesVarName(f *fileInfo) string { - return fileVarName(f.File, "goTypes") -} -func depIdxsVarName(f *fileInfo) string { - return fileVarName(f.File, "depIdxs") -} -func enumTypesVarName(f *fileInfo) string { - return fileVarName(f.File, "enumTypes") -} -func messageTypesVarName(f *fileInfo) string { - return fileVarName(f.File, "msgTypes") -} -func extensionTypesVarName(f *fileInfo) string { - return fileVarName(f.File, "extTypes") -} -func initFuncName(f *protogen.File) string { - return fileVarName(f, "init") -} diff --git a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/well_known_types.go b/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/well_known_types.go deleted file mode 100644 index dbaa529ca0..0000000000 --- a/ibm/vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/well_known_types.go +++ /dev/null @@ -1,1080 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal_gengo - -import ( - "strings" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/internal/genid" -) - -// Specialized support for well-known types are hard-coded into the generator -// as opposed to being injected in adjacent .go sources in the generated package -// in order to support specialized build systems like Bazel that always generate -// dynamically from the source .proto files. - -func genPackageKnownComment(f *fileInfo) protogen.Comments { - switch f.Desc.Path() { - case genid.File_google_protobuf_any_proto: - return ` Package anypb contains generated types for ` + genid.File_google_protobuf_any_proto + `. - - The Any message is a dynamic representation of any other message value. - It is functionally a tuple of the full name of the remote message type and - the serialized bytes of the remote message value. - - - Constructing an Any - - An Any message containing another message value is constructed using New: - - any, err := anypb.New(m) - if err != nil { - ... // handle error - } - ... // make use of any - - - Unmarshaling an Any - - With a populated Any message, the underlying message can be serialized into - a remote concrete message value in a few ways. - - If the exact concrete type is known, then a new (or pre-existing) instance - of that message can be passed to the UnmarshalTo method: - - m := new(foopb.MyMessage) - if err := any.UnmarshalTo(m); err != nil { - ... // handle error - } - ... // make use of m - - If the exact concrete type is not known, then the UnmarshalNew method can be - used to unmarshal the contents into a new instance of the remote message type: - - m, err := any.UnmarshalNew() - if err != nil { - ... // handle error - } - ... // make use of m - - UnmarshalNew uses the global type registry to resolve the message type and - construct a new instance of that message to unmarshal into. In order for a - message type to appear in the global registry, the Go type representing that - protobuf message type must be linked into the Go binary. For messages - generated by protoc-gen-go, this is achieved through an import of the - generated Go package representing a .proto file. - - A common pattern with UnmarshalNew is to use a type switch with the resulting - proto.Message value: - - switch m := m.(type) { - case *foopb.MyMessage: - ... // make use of m as a *foopb.MyMessage - case *barpb.OtherMessage: - ... // make use of m as a *barpb.OtherMessage - case *bazpb.SomeMessage: - ... // make use of m as a *bazpb.SomeMessage - } - - This pattern ensures that the generated packages containing the message types - listed in the case clauses are linked into the Go binary and therefore also - registered in the global registry. - - - Type checking an Any - - In order to type check whether an Any message represents some other message, - then use the MessageIs method: - - if any.MessageIs((*foopb.MyMessage)(nil)) { - ... // make use of any, knowing that it contains a foopb.MyMessage - } - - The MessageIs method can also be used with an allocated instance of the target - message type if the intention is to unmarshal into it if the type matches: - - m := new(foopb.MyMessage) - if any.MessageIs(m) { - if err := any.UnmarshalTo(m); err != nil { - ... // handle error - } - ... // make use of m - } - -` - case genid.File_google_protobuf_timestamp_proto: - return ` Package timestamppb contains generated types for ` + genid.File_google_protobuf_timestamp_proto + `. - - The Timestamp message represents a timestamp, - an instant in time since the Unix epoch (January 1st, 1970). - - - Conversion to a Go Time - - The AsTime method can be used to convert a Timestamp message to a - standard Go time.Time value in UTC: - - t := ts.AsTime() - ... // make use of t as a time.Time - - Converting to a time.Time is a common operation so that the extensive - set of time-based operations provided by the time package can be leveraged. - See https://golang.org/pkg/time for more information. - - The AsTime method performs the conversion on a best-effort basis. Timestamps - with denormal values (e.g., nanoseconds beyond 0 and 99999999, inclusive) - are normalized during the conversion to a time.Time. To manually check for - invalid Timestamps per the documented limitations in timestamp.proto, - additionally call the CheckValid method: - - if err := ts.CheckValid(); err != nil { - ... // handle error - } - - - Conversion from a Go Time - - The timestamppb.New function can be used to construct a Timestamp message - from a standard Go time.Time value: - - ts := timestamppb.New(t) - ... // make use of ts as a *timestamppb.Timestamp - - In order to construct a Timestamp representing the current time, use Now: - - ts := timestamppb.Now() - ... // make use of ts as a *timestamppb.Timestamp - -` - case genid.File_google_protobuf_duration_proto: - return ` Package durationpb contains generated types for ` + genid.File_google_protobuf_duration_proto + `. - - The Duration message represents a signed span of time. - - - Conversion to a Go Duration - - The AsDuration method can be used to convert a Duration message to a - standard Go time.Duration value: - - d := dur.AsDuration() - ... // make use of d as a time.Duration - - Converting to a time.Duration is a common operation so that the extensive - set of time-based operations provided by the time package can be leveraged. - See https://golang.org/pkg/time for more information. - - The AsDuration method performs the conversion on a best-effort basis. - Durations with denormal values (e.g., nanoseconds beyond -99999999 and - +99999999, inclusive; or seconds and nanoseconds with opposite signs) - are normalized during the conversion to a time.Duration. To manually check for - invalid Duration per the documented limitations in duration.proto, - additionally call the CheckValid method: - - if err := dur.CheckValid(); err != nil { - ... // handle error - } - - Note that the documented limitations in duration.proto does not protect a - Duration from overflowing the representable range of a time.Duration in Go. - The AsDuration method uses saturation arithmetic such that an overflow clamps - the resulting value to the closest representable value (e.g., math.MaxInt64 - for positive overflow and math.MinInt64 for negative overflow). - - - Conversion from a Go Duration - - The durationpb.New function can be used to construct a Duration message - from a standard Go time.Duration value: - - dur := durationpb.New(d) - ... // make use of d as a *durationpb.Duration - -` - case genid.File_google_protobuf_struct_proto: - return ` Package structpb contains generated types for ` + genid.File_google_protobuf_struct_proto + `. - - The messages (i.e., Value, Struct, and ListValue) defined in struct.proto are - used to represent arbitrary JSON. The Value message represents a JSON value, - the Struct message represents a JSON object, and the ListValue message - represents a JSON array. See https://json.org for more information. - - The Value, Struct, and ListValue types have generated MarshalJSON and - UnmarshalJSON methods such that they serialize JSON equivalent to what the - messages themselves represent. Use of these types with the - "google.golang.org/protobuf/encoding/protojson" package - ensures that they will be serialized as their JSON equivalent. - - - Conversion to and from a Go interface - - The standard Go "encoding/json" package has functionality to serialize - arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and - ListValue.AsSlice methods can convert the protobuf message representation into - a form represented by interface{}, map[string]interface{}, and []interface{}. - This form can be used with other packages that operate on such data structures - and also directly with the standard json package. - - In order to convert the interface{}, map[string]interface{}, and []interface{} - forms back as Value, Struct, and ListValue messages, use the NewStruct, - NewList, and NewValue constructor functions. - - - Example usage - - Consider the following example JSON object: - - { - "firstName": "John", - "lastName": "Smith", - "isAlive": true, - "age": 27, - "address": { - "streetAddress": "21 2nd Street", - "city": "New York", - "state": "NY", - "postalCode": "10021-3100" - }, - "phoneNumbers": [ - { - "type": "home", - "number": "212 555-1234" - }, - { - "type": "office", - "number": "646 555-4567" - } - ], - "children": [], - "spouse": null - } - - To construct a Value message representing the above JSON object: - - m, err := structpb.NewValue(map[string]interface{}{ - "firstName": "John", - "lastName": "Smith", - "isAlive": true, - "age": 27, - "address": map[string]interface{}{ - "streetAddress": "21 2nd Street", - "city": "New York", - "state": "NY", - "postalCode": "10021-3100", - }, - "phoneNumbers": []interface{}{ - map[string]interface{}{ - "type": "home", - "number": "212 555-1234", - }, - map[string]interface{}{ - "type": "office", - "number": "646 555-4567", - }, - }, - "children": []interface{}{}, - "spouse": nil, - }) - if err != nil { - ... // handle error - } - ... // make use of m as a *structpb.Value - -` - case genid.File_google_protobuf_field_mask_proto: - return ` Package fieldmaskpb contains generated types for ` + genid.File_google_protobuf_field_mask_proto + `. - - The FieldMask message represents a set of symbolic field paths. - The paths are specific to some target message type, - which is not stored within the FieldMask message itself. - - - Constructing a FieldMask - - The New function is used construct a FieldMask: - - var messageType *descriptorpb.DescriptorProto - fm, err := fieldmaskpb.New(messageType, "field.name", "field.number") - if err != nil { - ... // handle error - } - ... // make use of fm - - The "field.name" and "field.number" paths are valid paths according to the - google.protobuf.DescriptorProto message. Use of a path that does not correlate - to valid fields reachable from DescriptorProto would result in an error. - - Once a FieldMask message has been constructed, - the Append method can be used to insert additional paths to the path set: - - var messageType *descriptorpb.DescriptorProto - if err := fm.Append(messageType, "options"); err != nil { - ... // handle error - } - - - Type checking a FieldMask - - In order to verify that a FieldMask represents a set of fields that are - reachable from some target message type, use the IsValid method: - - var messageType *descriptorpb.DescriptorProto - if fm.IsValid(messageType) { - ... // make use of fm - } - - IsValid needs to be passed the target message type as an input since the - FieldMask message itself does not store the message type that the set of paths - are for. -` - default: - return "" - } -} - -func genMessageKnownFunctions(g *protogen.GeneratedFile, f *fileInfo, m *messageInfo) { - switch m.Desc.FullName() { - case genid.Any_message_fullname: - g.P("// New marshals src into a new Any instance.") - g.P("func New(src ", protoPackage.Ident("Message"), ") (*Any, error) {") - g.P(" dst := new(Any)") - g.P(" if err := dst.MarshalFrom(src); err != nil {") - g.P(" return nil, err") - g.P(" }") - g.P(" return dst, nil") - g.P("}") - g.P() - - g.P("// MarshalFrom marshals src into dst as the underlying message") - g.P("// using the provided marshal options.") - g.P("//") - g.P("// If no options are specified, call dst.MarshalFrom instead.") - g.P("func MarshalFrom(dst *Any, src ", protoPackage.Ident("Message"), ", opts ", protoPackage.Ident("MarshalOptions"), ") error {") - g.P(" const urlPrefix = \"type.googleapis.com/\"") - g.P(" if src == nil {") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"invalid nil source message\")") - g.P(" }") - g.P(" b, err := opts.Marshal(src)") - g.P(" if err != nil {") - g.P(" return err") - g.P(" }") - g.P(" dst.TypeUrl = urlPrefix + string(src.ProtoReflect().Descriptor().FullName())") - g.P(" dst.Value = b") - g.P(" return nil") - g.P("}") - g.P() - - g.P("// UnmarshalTo unmarshals the underlying message from src into dst") - g.P("// using the provided unmarshal options.") - g.P("// It reports an error if dst is not of the right message type.") - g.P("//") - g.P("// If no options are specified, call src.UnmarshalTo instead.") - g.P("func UnmarshalTo(src *Any, dst ", protoPackage.Ident("Message"), ", opts ", protoPackage.Ident("UnmarshalOptions"), ") error {") - g.P(" if src == nil {") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"invalid nil source message\")") - g.P(" }") - g.P(" if !src.MessageIs(dst) {") - g.P(" got := dst.ProtoReflect().Descriptor().FullName()") - g.P(" want := src.MessageName()") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"mismatched message type: got %q, want %q\", got, want)") - g.P(" }") - g.P(" return opts.Unmarshal(src.GetValue(), dst)") - g.P("}") - g.P() - - g.P("// UnmarshalNew unmarshals the underlying message from src into dst,") - g.P("// which is newly created message using a type resolved from the type URL.") - g.P("// The message type is resolved according to opt.Resolver,") - g.P("// which should implement protoregistry.MessageTypeResolver.") - g.P("// It reports an error if the underlying message type could not be resolved.") - g.P("//") - g.P("// If no options are specified, call src.UnmarshalNew instead.") - g.P("func UnmarshalNew(src *Any, opts ", protoPackage.Ident("UnmarshalOptions"), ") (dst ", protoPackage.Ident("Message"), ", err error) {") - g.P(" if src.GetTypeUrl() == \"\" {") - g.P(" return nil, ", protoimplPackage.Ident("X"), ".NewError(\"invalid empty type URL\")") - g.P(" }") - g.P(" if opts.Resolver == nil {") - g.P(" opts.Resolver = ", protoregistryPackage.Ident("GlobalTypes")) - g.P(" }") - g.P(" r, ok := opts.Resolver.(", protoregistryPackage.Ident("MessageTypeResolver"), ")") - g.P(" if !ok {") - g.P(" return nil, ", protoregistryPackage.Ident("NotFound")) - g.P(" }") - g.P(" mt, err := r.FindMessageByURL(src.GetTypeUrl())") - g.P(" if err != nil {") - g.P(" if err == ", protoregistryPackage.Ident("NotFound"), " {") - g.P(" return nil, err") - g.P(" }") - g.P(" return nil, ", protoimplPackage.Ident("X"), ".NewError(\"could not resolve %q: %v\", src.GetTypeUrl(), err)") - g.P(" }") - g.P(" dst = mt.New().Interface()") - g.P(" return dst, opts.Unmarshal(src.GetValue(), dst)") - g.P("}") - g.P() - - g.P("// MessageIs reports whether the underlying message is of the same type as m.") - g.P("func (x *Any) MessageIs(m ", protoPackage.Ident("Message"), ") bool {") - g.P(" if m == nil {") - g.P(" return false") - g.P(" }") - g.P(" url := x.GetTypeUrl()") - g.P(" name := string(m.ProtoReflect().Descriptor().FullName())") - g.P(" if !", stringsPackage.Ident("HasSuffix"), "(url, name) {") - g.P(" return false") - g.P(" }") - g.P(" return len(url) == len(name) || url[len(url)-len(name)-1] == '/'") - g.P("}") - g.P() - - g.P("// MessageName reports the full name of the underlying message,") - g.P("// returning an empty string if invalid.") - g.P("func (x *Any) MessageName() ", protoreflectPackage.Ident("FullName"), " {") - g.P(" url := x.GetTypeUrl()") - g.P(" name := ", protoreflectPackage.Ident("FullName"), "(url)") - g.P(" if i := ", stringsPackage.Ident("LastIndexByte"), "(url, '/'); i >= 0 {") - g.P(" name = name[i+len(\"/\"):]") - g.P(" }") - g.P(" if !name.IsValid() {") - g.P(" return \"\"") - g.P(" }") - g.P(" return name") - g.P("}") - g.P() - - g.P("// MarshalFrom marshals m into x as the underlying message.") - g.P("func (x *Any) MarshalFrom(m ", protoPackage.Ident("Message"), ") error {") - g.P(" return MarshalFrom(x, m, ", protoPackage.Ident("MarshalOptions"), "{})") - g.P("}") - g.P() - - g.P("// UnmarshalTo unmarshals the contents of the underlying message of x into m.") - g.P("// It resets m before performing the unmarshal operation.") - g.P("// It reports an error if m is not of the right message type.") - g.P("func (x *Any) UnmarshalTo(m ", protoPackage.Ident("Message"), ") error {") - g.P(" return UnmarshalTo(x, m, ", protoPackage.Ident("UnmarshalOptions"), "{})") - g.P("}") - g.P() - - g.P("// UnmarshalNew unmarshals the contents of the underlying message of x into") - g.P("// a newly allocated message of the specified type.") - g.P("// It reports an error if the underlying message type could not be resolved.") - g.P("func (x *Any) UnmarshalNew() (", protoPackage.Ident("Message"), ", error) {") - g.P(" return UnmarshalNew(x, ", protoPackage.Ident("UnmarshalOptions"), "{})") - g.P("}") - g.P() - - case genid.Timestamp_message_fullname: - g.P("// Now constructs a new Timestamp from the current time.") - g.P("func Now() *Timestamp {") - g.P(" return New(", timePackage.Ident("Now"), "())") - g.P("}") - g.P() - - g.P("// New constructs a new Timestamp from the provided time.Time.") - g.P("func New(t ", timePackage.Ident("Time"), ") *Timestamp {") - g.P(" return &Timestamp{Seconds: int64(t.Unix()), Nanos: int32(t.Nanosecond())}") - g.P("}") - g.P() - - g.P("// AsTime converts x to a time.Time.") - g.P("func (x *Timestamp) AsTime() ", timePackage.Ident("Time"), " {") - g.P(" return ", timePackage.Ident("Unix"), "(int64(x.GetSeconds()), int64(x.GetNanos())).UTC()") - g.P("}") - g.P() - - g.P("// IsValid reports whether the timestamp is valid.") - g.P("// It is equivalent to CheckValid == nil.") - g.P("func (x *Timestamp) IsValid() bool {") - g.P(" return x.check() == 0") - g.P("}") - g.P() - - g.P("// CheckValid returns an error if the timestamp is invalid.") - g.P("// In particular, it checks whether the value represents a date that is") - g.P("// in the range of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.") - g.P("// An error is reported for a nil Timestamp.") - g.P("func (x *Timestamp) CheckValid() error {") - g.P(" switch x.check() {") - g.P(" case invalidNil:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"invalid nil Timestamp\")") - g.P(" case invalidUnderflow:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"timestamp (%v) before 0001-01-01\", x)") - g.P(" case invalidOverflow:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"timestamp (%v) after 9999-12-31\", x)") - g.P(" case invalidNanos:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"timestamp (%v) has out-of-range nanos\", x)") - g.P(" default:") - g.P(" return nil") - g.P(" }") - g.P("}") - g.P() - - g.P("const (") - g.P(" _ = iota") - g.P(" invalidNil") - g.P(" invalidUnderflow") - g.P(" invalidOverflow") - g.P(" invalidNanos") - g.P(")") - g.P() - - g.P("func (x *Timestamp) check() uint {") - g.P(" const minTimestamp = -62135596800 // Seconds between 1970-01-01T00:00:00Z and 0001-01-01T00:00:00Z, inclusive") - g.P(" const maxTimestamp = +253402300799 // Seconds between 1970-01-01T00:00:00Z and 9999-12-31T23:59:59Z, inclusive") - g.P(" secs := x.GetSeconds()") - g.P(" nanos := x.GetNanos()") - g.P(" switch {") - g.P(" case x == nil:") - g.P(" return invalidNil") - g.P(" case secs < minTimestamp:") - g.P(" return invalidUnderflow") - g.P(" case secs > maxTimestamp:") - g.P(" return invalidOverflow") - g.P(" case nanos < 0 || nanos >= 1e9:") - g.P(" return invalidNanos") - g.P(" default:") - g.P(" return 0") - g.P(" }") - g.P("}") - g.P() - - case genid.Duration_message_fullname: - g.P("// New constructs a new Duration from the provided time.Duration.") - g.P("func New(d ", timePackage.Ident("Duration"), ") *Duration {") - g.P(" nanos := d.Nanoseconds()") - g.P(" secs := nanos / 1e9") - g.P(" nanos -= secs * 1e9") - g.P(" return &Duration{Seconds: int64(secs), Nanos: int32(nanos)}") - g.P("}") - g.P() - - g.P("// AsDuration converts x to a time.Duration,") - g.P("// returning the closest duration value in the event of overflow.") - g.P("func (x *Duration) AsDuration() ", timePackage.Ident("Duration"), " {") - g.P(" secs := x.GetSeconds()") - g.P(" nanos := x.GetNanos()") - g.P(" d := ", timePackage.Ident("Duration"), "(secs) * ", timePackage.Ident("Second")) - g.P(" overflow := d/", timePackage.Ident("Second"), " != ", timePackage.Ident("Duration"), "(secs)") - g.P(" d += ", timePackage.Ident("Duration"), "(nanos) * ", timePackage.Ident("Nanosecond")) - g.P(" overflow = overflow || (secs < 0 && nanos < 0 && d > 0)") - g.P(" overflow = overflow || (secs > 0 && nanos > 0 && d < 0)") - g.P(" if overflow {") - g.P(" switch {") - g.P(" case secs < 0:") - g.P(" return ", timePackage.Ident("Duration"), "(", mathPackage.Ident("MinInt64"), ")") - g.P(" case secs > 0:") - g.P(" return ", timePackage.Ident("Duration"), "(", mathPackage.Ident("MaxInt64"), ")") - g.P(" }") - g.P(" }") - g.P(" return d") - g.P("}") - g.P() - - g.P("// IsValid reports whether the duration is valid.") - g.P("// It is equivalent to CheckValid == nil.") - g.P("func (x *Duration) IsValid() bool {") - g.P(" return x.check() == 0") - g.P("}") - g.P() - - g.P("// CheckValid returns an error if the duration is invalid.") - g.P("// In particular, it checks whether the value is within the range of") - g.P("// -10000 years to +10000 years inclusive.") - g.P("// An error is reported for a nil Duration.") - g.P("func (x *Duration) CheckValid() error {") - g.P(" switch x.check() {") - g.P(" case invalidNil:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"invalid nil Duration\")") - g.P(" case invalidUnderflow:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"duration (%v) exceeds -10000 years\", x)") - g.P(" case invalidOverflow:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"duration (%v) exceeds +10000 years\", x)") - g.P(" case invalidNanosRange:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"duration (%v) has out-of-range nanos\", x)") - g.P(" case invalidNanosSign:") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"duration (%v) has seconds and nanos with different signs\", x)") - g.P(" default:") - g.P(" return nil") - g.P(" }") - g.P("}") - g.P() - - g.P("const (") - g.P(" _ = iota") - g.P(" invalidNil") - g.P(" invalidUnderflow") - g.P(" invalidOverflow") - g.P(" invalidNanosRange") - g.P(" invalidNanosSign") - g.P(")") - g.P() - - g.P("func (x *Duration) check() uint {") - g.P(" const absDuration = 315576000000 // 10000yr * 365.25day/yr * 24hr/day * 60min/hr * 60sec/min") - g.P(" secs := x.GetSeconds()") - g.P(" nanos := x.GetNanos()") - g.P(" switch {") - g.P(" case x == nil:") - g.P(" return invalidNil") - g.P(" case secs < -absDuration:") - g.P(" return invalidUnderflow") - g.P(" case secs > +absDuration:") - g.P(" return invalidOverflow") - g.P(" case nanos <= -1e9 || nanos >= +1e9:") - g.P(" return invalidNanosRange") - g.P(" case (secs > 0 && nanos < 0) || (secs < 0 && nanos > 0):") - g.P(" return invalidNanosSign") - g.P(" default:") - g.P(" return 0") - g.P(" }") - g.P("}") - g.P() - - case genid.Struct_message_fullname: - g.P("// NewStruct constructs a Struct from a general-purpose Go map.") - g.P("// The map keys must be valid UTF-8.") - g.P("// The map values are converted using NewValue.") - g.P("func NewStruct(v map[string]interface{}) (*Struct, error) {") - g.P(" x := &Struct{Fields: make(map[string]*Value, len(v))}") - g.P(" for k, v := range v {") - g.P(" if !", utf8Package.Ident("ValidString"), "(k) {") - g.P(" return nil, ", protoimplPackage.Ident("X"), ".NewError(\"invalid UTF-8 in string: %q\", k)") - g.P(" }") - g.P(" var err error") - g.P(" x.Fields[k], err = NewValue(v)") - g.P(" if err != nil {") - g.P(" return nil, err") - g.P(" }") - g.P(" }") - g.P(" return x, nil") - g.P("}") - g.P() - - g.P("// AsMap converts x to a general-purpose Go map.") - g.P("// The map values are converted by calling Value.AsInterface.") - g.P("func (x *Struct) AsMap() map[string]interface{} {") - g.P(" vs := make(map[string]interface{})") - g.P(" for k, v := range x.GetFields() {") - g.P(" vs[k] = v.AsInterface()") - g.P(" }") - g.P(" return vs") - g.P("}") - g.P() - - g.P("func (x *Struct) MarshalJSON() ([]byte, error) {") - g.P(" return ", protojsonPackage.Ident("Marshal"), "(x)") - g.P("}") - g.P() - - g.P("func (x *Struct) UnmarshalJSON(b []byte) error {") - g.P(" return ", protojsonPackage.Ident("Unmarshal"), "(b, x)") - g.P("}") - g.P() - - case genid.ListValue_message_fullname: - g.P("// NewList constructs a ListValue from a general-purpose Go slice.") - g.P("// The slice elements are converted using NewValue.") - g.P("func NewList(v []interface{}) (*ListValue, error) {") - g.P(" x := &ListValue{Values: make([]*Value, len(v))}") - g.P(" for i, v := range v {") - g.P(" var err error") - g.P(" x.Values[i], err = NewValue(v)") - g.P(" if err != nil {") - g.P(" return nil, err") - g.P(" }") - g.P(" }") - g.P(" return x, nil") - g.P("}") - g.P() - - g.P("// AsSlice converts x to a general-purpose Go slice.") - g.P("// The slice elements are converted by calling Value.AsInterface.") - g.P("func (x *ListValue) AsSlice() []interface{} {") - g.P(" vs := make([]interface{}, len(x.GetValues()))") - g.P(" for i, v := range x.GetValues() {") - g.P(" vs[i] = v.AsInterface()") - g.P(" }") - g.P(" return vs") - g.P("}") - g.P() - - g.P("func (x *ListValue) MarshalJSON() ([]byte, error) {") - g.P(" return ", protojsonPackage.Ident("Marshal"), "(x)") - g.P("}") - g.P() - - g.P("func (x *ListValue) UnmarshalJSON(b []byte) error {") - g.P(" return ", protojsonPackage.Ident("Unmarshal"), "(b, x)") - g.P("}") - g.P() - - case genid.Value_message_fullname: - g.P("// NewValue constructs a Value from a general-purpose Go interface.") - g.P("//") - g.P("// ╔════════════════════════╤════════════════════════════════════════════╗") - g.P("// ║ Go type │ Conversion ║") - g.P("// ╠════════════════════════╪════════════════════════════════════════════╣") - g.P("// ║ nil │ stored as NullValue ║") - g.P("// ║ bool │ stored as BoolValue ║") - g.P("// ║ int, int32, int64 │ stored as NumberValue ║") - g.P("// ║ uint, uint32, uint64 │ stored as NumberValue ║") - g.P("// ║ float32, float64 │ stored as NumberValue ║") - g.P("// ║ string │ stored as StringValue; must be valid UTF-8 ║") - g.P("// ║ []byte │ stored as StringValue; base64-encoded ║") - g.P("// ║ map[string]interface{} │ stored as StructValue ║") - g.P("// ║ []interface{} │ stored as ListValue ║") - g.P("// ╚════════════════════════╧════════════════════════════════════════════╝") - g.P("//") - g.P("// When converting an int64 or uint64 to a NumberValue, numeric precision loss") - g.P("// is possible since they are stored as a float64.") - g.P("func NewValue(v interface{}) (*Value, error) {") - g.P(" switch v := v.(type) {") - g.P(" case nil:") - g.P(" return NewNullValue(), nil") - g.P(" case bool:") - g.P(" return NewBoolValue(v), nil") - g.P(" case int:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case int32:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case int64:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case uint:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case uint32:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case uint64:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case float32:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case float64:") - g.P(" return NewNumberValue(float64(v)), nil") - g.P(" case string:") - g.P(" if !", utf8Package.Ident("ValidString"), "(v) {") - g.P(" return nil, ", protoimplPackage.Ident("X"), ".NewError(\"invalid UTF-8 in string: %q\", v)") - g.P(" }") - g.P(" return NewStringValue(v), nil") - g.P(" case []byte:") - g.P(" s := ", base64Package.Ident("StdEncoding"), ".EncodeToString(v)") - g.P(" return NewStringValue(s), nil") - g.P(" case map[string]interface{}:") - g.P(" v2, err := NewStruct(v)") - g.P(" if err != nil {") - g.P(" return nil, err") - g.P(" }") - g.P(" return NewStructValue(v2), nil") - g.P(" case []interface{}:") - g.P(" v2, err := NewList(v)") - g.P(" if err != nil {") - g.P(" return nil, err") - g.P(" }") - g.P(" return NewListValue(v2), nil") - g.P(" default:") - g.P(" return nil, ", protoimplPackage.Ident("X"), ".NewError(\"invalid type: %T\", v)") - g.P(" }") - g.P("}") - g.P() - - g.P("// NewNullValue constructs a new null Value.") - g.P("func NewNullValue() *Value {") - g.P(" return &Value{Kind: &Value_NullValue{NullValue: NullValue_NULL_VALUE}}") - g.P("}") - g.P() - - g.P("// NewBoolValue constructs a new boolean Value.") - g.P("func NewBoolValue(v bool) *Value {") - g.P(" return &Value{Kind: &Value_BoolValue{BoolValue: v}}") - g.P("}") - g.P() - - g.P("// NewNumberValue constructs a new number Value.") - g.P("func NewNumberValue(v float64) *Value {") - g.P(" return &Value{Kind: &Value_NumberValue{NumberValue: v}}") - g.P("}") - g.P() - - g.P("// NewStringValue constructs a new string Value.") - g.P("func NewStringValue(v string) *Value {") - g.P(" return &Value{Kind: &Value_StringValue{StringValue: v}}") - g.P("}") - g.P() - - g.P("// NewStructValue constructs a new struct Value.") - g.P("func NewStructValue(v *Struct) *Value {") - g.P(" return &Value{Kind: &Value_StructValue{StructValue: v}}") - g.P("}") - g.P() - - g.P("// NewListValue constructs a new list Value.") - g.P("func NewListValue(v *ListValue) *Value {") - g.P(" return &Value{Kind: &Value_ListValue{ListValue: v}}") - g.P("}") - g.P() - - g.P("// AsInterface converts x to a general-purpose Go interface.") - g.P("//") - g.P("// Calling Value.MarshalJSON and \"encoding/json\".Marshal on this output produce") - g.P("// semantically equivalent JSON (assuming no errors occur).") - g.P("//") - g.P("// Floating-point values (i.e., \"NaN\", \"Infinity\", and \"-Infinity\") are") - g.P("// converted as strings to remain compatible with MarshalJSON.") - g.P("func (x *Value) AsInterface() interface{} {") - g.P(" switch v := x.GetKind().(type) {") - g.P(" case *Value_NumberValue:") - g.P(" if v != nil {") - g.P(" switch {") - g.P(" case ", mathPackage.Ident("IsNaN"), "(v.NumberValue):") - g.P(" return \"NaN\"") - g.P(" case ", mathPackage.Ident("IsInf"), "(v.NumberValue, +1):") - g.P(" return \"Infinity\"") - g.P(" case ", mathPackage.Ident("IsInf"), "(v.NumberValue, -1):") - g.P(" return \"-Infinity\"") - g.P(" default:") - g.P(" return v.NumberValue") - g.P(" }") - g.P(" }") - g.P(" case *Value_StringValue:") - g.P(" if v != nil {") - g.P(" return v.StringValue") - g.P(" }") - g.P(" case *Value_BoolValue:") - g.P(" if v != nil {") - g.P(" return v.BoolValue") - g.P(" }") - g.P(" case *Value_StructValue:") - g.P(" if v != nil {") - g.P(" return v.StructValue.AsMap()") - g.P(" }") - g.P(" case *Value_ListValue:") - g.P(" if v != nil {") - g.P(" return v.ListValue.AsSlice()") - g.P(" }") - g.P(" }") - g.P(" return nil") - g.P("}") - g.P() - - g.P("func (x *Value) MarshalJSON() ([]byte, error) {") - g.P(" return ", protojsonPackage.Ident("Marshal"), "(x)") - g.P("}") - g.P() - - g.P("func (x *Value) UnmarshalJSON(b []byte) error {") - g.P(" return ", protojsonPackage.Ident("Unmarshal"), "(b, x)") - g.P("}") - g.P() - - case genid.FieldMask_message_fullname: - g.P("// New constructs a field mask from a list of paths and verifies that") - g.P("// each one is valid according to the specified message type.") - g.P("func New(m ", protoPackage.Ident("Message"), ", paths ...string) (*FieldMask, error) {") - g.P(" x := new(FieldMask)") - g.P(" return x, x.Append(m, paths...)") - g.P("}") - g.P() - - g.P("// Union returns the union of all the paths in the input field masks.") - g.P("func Union(mx *FieldMask, my *FieldMask, ms ...*FieldMask) *FieldMask {") - g.P(" var out []string") - g.P(" out = append(out, mx.GetPaths()...)") - g.P(" out = append(out, my.GetPaths()...)") - g.P(" for _, m := range ms {") - g.P(" out = append(out, m.GetPaths()...)") - g.P(" }") - g.P(" return &FieldMask{Paths: normalizePaths(out)}") - g.P("}") - g.P() - - g.P("// Intersect returns the intersection of all the paths in the input field masks.") - g.P("func Intersect(mx *FieldMask, my *FieldMask, ms ...*FieldMask) *FieldMask {") - g.P(" var ss1, ss2 []string // reused buffers for performance") - g.P(" intersect := func(out, in []string) []string {") - g.P(" ss1 = normalizePaths(append(ss1[:0], in...))") - g.P(" ss2 = normalizePaths(append(ss2[:0], out...))") - g.P(" out = out[:0]") - g.P(" for i1, i2 := 0, 0; i1 < len(ss1) && i2 < len(ss2); {") - g.P(" switch s1, s2 := ss1[i1], ss2[i2]; {") - g.P(" case hasPathPrefix(s1, s2):") - g.P(" out = append(out, s1)") - g.P(" i1++") - g.P(" case hasPathPrefix(s2, s1):") - g.P(" out = append(out, s2)") - g.P(" i2++") - g.P(" case lessPath(s1, s2):") - g.P(" i1++") - g.P(" case lessPath(s2, s1):") - g.P(" i2++") - g.P(" }") - g.P(" }") - g.P(" return out") - g.P(" }") - g.P() - g.P(" out := Union(mx, my, ms...).GetPaths()") - g.P(" out = intersect(out, mx.GetPaths())") - g.P(" out = intersect(out, my.GetPaths())") - g.P(" for _, m := range ms {") - g.P(" out = intersect(out, m.GetPaths())") - g.P(" }") - g.P(" return &FieldMask{Paths: normalizePaths(out)}") - g.P("}") - g.P() - - g.P("// IsValid reports whether all the paths are syntactically valid and") - g.P("// refer to known fields in the specified message type.") - g.P("// It reports false for a nil FieldMask.") - g.P("func (x *FieldMask) IsValid(m ", protoPackage.Ident("Message"), ") bool {") - g.P(" paths := x.GetPaths()") - g.P(" return x != nil && numValidPaths(m, paths) == len(paths)") - g.P("}") - g.P() - - g.P("// Append appends a list of paths to the mask and verifies that each one") - g.P("// is valid according to the specified message type.") - g.P("// An invalid path is not appended and breaks insertion of subsequent paths.") - g.P("func (x *FieldMask) Append(m ", protoPackage.Ident("Message"), ", paths ...string) error {") - g.P(" numValid := numValidPaths(m, paths)") - g.P(" x.Paths = append(x.Paths, paths[:numValid]...)") - g.P(" paths = paths[numValid:]") - g.P(" if len(paths) > 0 {") - g.P(" name := m.ProtoReflect().Descriptor().FullName()") - g.P(" return ", protoimplPackage.Ident("X"), ".NewError(\"invalid path %q for message %q\", paths[0], name)") - g.P(" }") - g.P(" return nil") - g.P("}") - g.P() - - g.P("func numValidPaths(m ", protoPackage.Ident("Message"), ", paths []string) int {") - g.P(" md0 := m.ProtoReflect().Descriptor()") - g.P(" for i, path := range paths {") - g.P(" md := md0") - g.P(" if !rangeFields(path, func(field string) bool {") - g.P(" // Search the field within the message.") - g.P(" if md == nil {") - g.P(" return false // not within a message") - g.P(" }") - g.P(" fd := md.Fields().ByName(", protoreflectPackage.Ident("Name"), "(field))") - g.P(" // The real field name of a group is the message name.") - g.P(" if fd == nil {") - g.P(" gd := md.Fields().ByName(", protoreflectPackage.Ident("Name"), "(", stringsPackage.Ident("ToLower"), "(field)))") - g.P(" if gd != nil && gd.Kind() == ", protoreflectPackage.Ident("GroupKind"), " && string(gd.Message().Name()) == field {") - g.P(" fd = gd") - g.P(" }") - g.P(" } else if fd.Kind() == ", protoreflectPackage.Ident("GroupKind"), " && string(fd.Message().Name()) != field {") - g.P(" fd = nil") - g.P(" }") - g.P(" if fd == nil {") - g.P(" return false // message has does not have this field") - g.P(" }") - g.P() - g.P(" // Identify the next message to search within.") - g.P(" md = fd.Message() // may be nil") - g.P() - g.P(" // Repeated fields are only allowed at the last postion.") - g.P(" if fd.IsList() || fd.IsMap() {") - g.P(" md = nil") - g.P(" }") - g.P() - g.P(" return true") - g.P(" }) {") - g.P(" return i") - g.P(" }") - g.P(" }") - g.P(" return len(paths)") - g.P("}") - g.P() - - g.P("// Normalize converts the mask to its canonical form where all paths are sorted") - g.P("// and redundant paths are removed.") - g.P("func (x *FieldMask) Normalize() {") - g.P(" x.Paths = normalizePaths(x.Paths)") - g.P("}") - g.P() - g.P("func normalizePaths(paths []string) []string {") - g.P(" ", sortPackage.Ident("Slice"), "(paths, func(i, j int) bool {") - g.P(" return lessPath(paths[i], paths[j])") - g.P(" })") - g.P() - g.P(" // Elide any path that is a prefix match on the previous.") - g.P(" out := paths[:0]") - g.P(" for _, path := range paths {") - g.P(" if len(out) > 0 && hasPathPrefix(path, out[len(out)-1]) {") - g.P(" continue") - g.P(" }") - g.P(" out = append(out, path)") - g.P(" }") - g.P(" return out") - g.P("}") - g.P() - - g.P("// hasPathPrefix is like strings.HasPrefix, but further checks for either") - g.P("// an exact matche or that the prefix is delimited by a dot.") - g.P("func hasPathPrefix(path, prefix string) bool {") - g.P(" return ", stringsPackage.Ident("HasPrefix"), "(path, prefix) && (len(path) == len(prefix) || path[len(prefix)] == '.')") - g.P("}") - g.P() - - g.P("// lessPath is a lexicographical comparison where dot is specially treated") - g.P("// as the smallest symbol.") - g.P("func lessPath(x, y string) bool {") - g.P(" for i := 0; i < len(x) && i < len(y); i++ {") - g.P(" if x[i] != y[i] {") - g.P(" return (x[i] - '.') < (y[i] - '.')") - g.P(" }") - g.P(" }") - g.P(" return len(x) < len(y)") - g.P("}") - g.P() - - g.P("// rangeFields is like strings.Split(path, \".\"), but avoids allocations by") - g.P("// iterating over each field in place and calling a iterator function.") - g.P("func rangeFields(path string, f func(field string) bool) bool {") - g.P(" for {") - g.P(" var field string") - g.P(" if i := ", stringsPackage.Ident("IndexByte"), "(path, '.'); i >= 0 {") - g.P(" field, path = path[:i], path[i:]") - g.P(" } else {") - g.P(" field, path = path, \"\"") - g.P(" }") - g.P() - g.P(" if !f(field) {") - g.P(" return false") - g.P(" }") - g.P() - g.P(" if len(path) == 0 {") - g.P(" return true") - g.P(" }") - g.P(" path = ", stringsPackage.Ident("TrimPrefix"), "(path, \".\")") - g.P(" }") - g.P("}") - g.P() - - case genid.BoolValue_message_fullname, - genid.Int32Value_message_fullname, - genid.Int64Value_message_fullname, - genid.UInt32Value_message_fullname, - genid.UInt64Value_message_fullname, - genid.FloatValue_message_fullname, - genid.DoubleValue_message_fullname, - genid.StringValue_message_fullname, - genid.BytesValue_message_fullname: - funcName := strings.TrimSuffix(m.GoIdent.GoName, "Value") - typeName := strings.ToLower(funcName) - switch typeName { - case "float": - typeName = "float32" - case "double": - typeName = "float64" - case "bytes": - typeName = "[]byte" - } - - g.P("// ", funcName, " stores v in a new ", m.GoIdent, " and returns a pointer to it.") - g.P("func ", funcName, "(v ", typeName, ") *", m.GoIdent, " {") - g.P(" return &", m.GoIdent, "{Value: v}") - g.P("}") - g.P() - } -} diff --git a/ibm/vendor/google.golang.org/protobuf/compiler/protogen/protogen.go b/ibm/vendor/google.golang.org/protobuf/compiler/protogen/protogen.go deleted file mode 100644 index 17cbe1a391..0000000000 --- a/ibm/vendor/google.golang.org/protobuf/compiler/protogen/protogen.go +++ /dev/null @@ -1,1260 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package protogen provides support for writing protoc plugins. -// -// Plugins for protoc, the Protocol Buffer compiler, -// are programs which read a CodeGeneratorRequest message from standard input -// and write a CodeGeneratorResponse message to standard output. -// This package provides support for writing plugins which generate Go code. -package protogen - -import ( - "bufio" - "bytes" - "fmt" - "go/ast" - "go/parser" - "go/printer" - "go/token" - "go/types" - "io/ioutil" - "os" - "path" - "path/filepath" - "sort" - "strconv" - "strings" - - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/internal/genid" - "google.golang.org/protobuf/internal/strs" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -const goPackageDocURL = "https://developers.google.com/protocol-buffers/docs/reference/go-generated#package" - -// Run executes a function as a protoc plugin. -// -// It reads a CodeGeneratorRequest message from os.Stdin, invokes the plugin -// function, and writes a CodeGeneratorResponse message to os.Stdout. -// -// If a failure occurs while reading or writing, Run prints an error to -// os.Stderr and calls os.Exit(1). -func (opts Options) Run(f func(*Plugin) error) { - if err := run(opts, f); err != nil { - fmt.Fprintf(os.Stderr, "%s: %v\n", filepath.Base(os.Args[0]), err) - os.Exit(1) - } -} - -func run(opts Options, f func(*Plugin) error) error { - if len(os.Args) > 1 { - return fmt.Errorf("unknown argument %q (this program should be run by protoc, not directly)", os.Args[1]) - } - in, err := ioutil.ReadAll(os.Stdin) - if err != nil { - return err - } - req := &pluginpb.CodeGeneratorRequest{} - if err := proto.Unmarshal(in, req); err != nil { - return err - } - gen, err := opts.New(req) - if err != nil { - return err - } - if err := f(gen); err != nil { - // Errors from the plugin function are reported by setting the - // error field in the CodeGeneratorResponse. - // - // In contrast, errors that indicate a problem in protoc - // itself (unparsable input, I/O errors, etc.) are reported - // to stderr. - gen.Error(err) - } - resp := gen.Response() - out, err := proto.Marshal(resp) - if err != nil { - return err - } - if _, err := os.Stdout.Write(out); err != nil { - return err - } - return nil -} - -// A Plugin is a protoc plugin invocation. -type Plugin struct { - // Request is the CodeGeneratorRequest provided by protoc. - Request *pluginpb.CodeGeneratorRequest - - // Files is the set of files to generate and everything they import. - // Files appear in topological order, so each file appears before any - // file that imports it. - Files []*File - FilesByPath map[string]*File - - // SupportedFeatures is the set of protobuf language features supported by - // this generator plugin. See the documentation for - // google.protobuf.CodeGeneratorResponse.supported_features for details. - SupportedFeatures uint64 - - fileReg *protoregistry.Files - enumsByName map[protoreflect.FullName]*Enum - messagesByName map[protoreflect.FullName]*Message - annotateCode bool - pathType pathType - module string - genFiles []*GeneratedFile - opts Options - err error -} - -type Options struct { - // If ParamFunc is non-nil, it will be called with each unknown - // generator parameter. - // - // Plugins for protoc can accept parameters from the command line, - // passed in the --_out protoc, separated from the output - // directory with a colon; e.g., - // - // --go_out==,=: - // - // Parameters passed in this fashion as a comma-separated list of - // key=value pairs will be passed to the ParamFunc. - // - // The (flag.FlagSet).Set method matches this function signature, - // so parameters can be converted into flags as in the following: - // - // var flags flag.FlagSet - // value := flags.Bool("param", false, "") - // opts := &protogen.Options{ - // ParamFunc: flags.Set, - // } - // protogen.Run(opts, func(p *protogen.Plugin) error { - // if *value { ... } - // }) - ParamFunc func(name, value string) error - - // ImportRewriteFunc is called with the import path of each package - // imported by a generated file. It returns the import path to use - // for this package. - ImportRewriteFunc func(GoImportPath) GoImportPath -} - -// New returns a new Plugin. -func (opts Options) New(req *pluginpb.CodeGeneratorRequest) (*Plugin, error) { - gen := &Plugin{ - Request: req, - FilesByPath: make(map[string]*File), - fileReg: new(protoregistry.Files), - enumsByName: make(map[protoreflect.FullName]*Enum), - messagesByName: make(map[protoreflect.FullName]*Message), - opts: opts, - } - - packageNames := make(map[string]GoPackageName) // filename -> package name - importPaths := make(map[string]GoImportPath) // filename -> import path - for _, param := range strings.Split(req.GetParameter(), ",") { - var value string - if i := strings.Index(param, "="); i >= 0 { - value = param[i+1:] - param = param[0:i] - } - switch param { - case "": - // Ignore. - case "module": - gen.module = value - case "paths": - switch value { - case "import": - gen.pathType = pathTypeImport - case "source_relative": - gen.pathType = pathTypeSourceRelative - default: - return nil, fmt.Errorf(`unknown path type %q: want "import" or "source_relative"`, value) - } - case "annotate_code": - switch value { - case "true", "": - gen.annotateCode = true - case "false": - default: - return nil, fmt.Errorf(`bad value for parameter %q: want "true" or "false"`, param) - } - default: - if param[0] == 'M' { - impPath, pkgName := splitImportPathAndPackageName(value) - if pkgName != "" { - packageNames[param[1:]] = pkgName - } - if impPath != "" { - importPaths[param[1:]] = impPath - } - continue - } - if opts.ParamFunc != nil { - if err := opts.ParamFunc(param, value); err != nil { - return nil, err - } - } - } - } - // When the module= option is provided, we strip the module name - // prefix from generated files. This only makes sense if generated - // filenames are based on the import path. - if gen.module != "" && gen.pathType == pathTypeSourceRelative { - return nil, fmt.Errorf("cannot use module= with paths=source_relative") - } - - // Figure out the import path and package name for each file. - // - // The rules here are complicated and have grown organically over time. - // Interactions between different ways of specifying package information - // may be surprising. - // - // The recommended approach is to include a go_package option in every - // .proto source file specifying the full import path of the Go package - // associated with this file. - // - // option go_package = "google.golang.org/protobuf/types/known/anypb"; - // - // Alternatively, build systems which want to exert full control over - // import paths may specify M= flags. - for _, fdesc := range gen.Request.ProtoFile { - // The "M" command-line flags take precedence over - // the "go_package" option in the .proto source file. - filename := fdesc.GetName() - impPath, pkgName := splitImportPathAndPackageName(fdesc.GetOptions().GetGoPackage()) - if importPaths[filename] == "" && impPath != "" { - importPaths[filename] = impPath - } - if packageNames[filename] == "" && pkgName != "" { - packageNames[filename] = pkgName - } - switch { - case importPaths[filename] == "": - // The import path must be specified one way or another. - return nil, fmt.Errorf( - "unable to determine Go import path for %q\n\n"+ - "Please specify either:\n"+ - "\t• a \"go_package\" option in the .proto source file, or\n"+ - "\t• a \"M\" argument on the command line.\n\n"+ - "See %v for more information.\n", - fdesc.GetName(), goPackageDocURL) - case !strings.Contains(string(importPaths[filename]), "/"): - // Check that import paths contain at least one slash to avoid a - // common mistake where import path is confused with package name. - return nil, fmt.Errorf( - "invalid Go import path %q for %q\n\n"+ - "The import path must contain at least one forward slash ('/') character.\n\n"+ - "See %v for more information.\n", - string(importPaths[filename]), fdesc.GetName(), goPackageDocURL) - case packageNames[filename] == "": - // If the package name is not explicitly specified, - // then derive a reasonable package name from the import path. - // - // NOTE: The package name is derived first from the import path in - // the "go_package" option (if present) before trying the "M" flag. - // The inverted order for this is because the primary use of the "M" - // flag is by build systems that have full control over the - // import paths all packages, where it is generally expected that - // the Go package name still be identical for the Go toolchain and - // for custom build systems like Bazel. - if impPath == "" { - impPath = importPaths[filename] - } - packageNames[filename] = cleanPackageName(path.Base(string(impPath))) - } - } - - // Consistency check: Every file with the same Go import path should have - // the same Go package name. - packageFiles := make(map[GoImportPath][]string) - for filename, importPath := range importPaths { - if _, ok := packageNames[filename]; !ok { - // Skip files mentioned in a M= parameter - // but which do not appear in the CodeGeneratorRequest. - continue - } - packageFiles[importPath] = append(packageFiles[importPath], filename) - } - for importPath, filenames := range packageFiles { - for i := 1; i < len(filenames); i++ { - if a, b := packageNames[filenames[0]], packageNames[filenames[i]]; a != b { - return nil, fmt.Errorf("Go package %v has inconsistent names %v (%v) and %v (%v)", - importPath, a, filenames[0], b, filenames[i]) - } - } - } - - for _, fdesc := range gen.Request.ProtoFile { - filename := fdesc.GetName() - if gen.FilesByPath[filename] != nil { - return nil, fmt.Errorf("duplicate file name: %q", filename) - } - f, err := newFile(gen, fdesc, packageNames[filename], importPaths[filename]) - if err != nil { - return nil, err - } - gen.Files = append(gen.Files, f) - gen.FilesByPath[filename] = f - } - for _, filename := range gen.Request.FileToGenerate { - f, ok := gen.FilesByPath[filename] - if !ok { - return nil, fmt.Errorf("no descriptor for generated file: %v", filename) - } - f.Generate = true - } - return gen, nil -} - -// Error records an error in code generation. The generator will report the -// error back to protoc and will not produce output. -func (gen *Plugin) Error(err error) { - if gen.err == nil { - gen.err = err - } -} - -// Response returns the generator output. -func (gen *Plugin) Response() *pluginpb.CodeGeneratorResponse { - resp := &pluginpb.CodeGeneratorResponse{} - if gen.err != nil { - resp.Error = proto.String(gen.err.Error()) - return resp - } - for _, g := range gen.genFiles { - if g.skip { - continue - } - content, err := g.Content() - if err != nil { - return &pluginpb.CodeGeneratorResponse{ - Error: proto.String(err.Error()), - } - } - filename := g.filename - if gen.module != "" { - trim := gen.module + "/" - if !strings.HasPrefix(filename, trim) { - return &pluginpb.CodeGeneratorResponse{ - Error: proto.String(fmt.Sprintf("%v: generated file does not match prefix %q", filename, gen.module)), - } - } - filename = strings.TrimPrefix(filename, trim) - } - resp.File = append(resp.File, &pluginpb.CodeGeneratorResponse_File{ - Name: proto.String(filename), - Content: proto.String(string(content)), - }) - if gen.annotateCode && strings.HasSuffix(g.filename, ".go") { - meta, err := g.metaFile(content) - if err != nil { - return &pluginpb.CodeGeneratorResponse{ - Error: proto.String(err.Error()), - } - } - resp.File = append(resp.File, &pluginpb.CodeGeneratorResponse_File{ - Name: proto.String(filename + ".meta"), - Content: proto.String(meta), - }) - } - } - if gen.SupportedFeatures > 0 { - resp.SupportedFeatures = proto.Uint64(gen.SupportedFeatures) - } - return resp -} - -// A File describes a .proto source file. -type File struct { - Desc protoreflect.FileDescriptor - Proto *descriptorpb.FileDescriptorProto - - GoDescriptorIdent GoIdent // name of Go variable for the file descriptor - GoPackageName GoPackageName // name of this file's Go package - GoImportPath GoImportPath // import path of this file's Go package - - Enums []*Enum // top-level enum declarations - Messages []*Message // top-level message declarations - Extensions []*Extension // top-level extension declarations - Services []*Service // top-level service declarations - - Generate bool // true if we should generate code for this file - - // GeneratedFilenamePrefix is used to construct filenames for generated - // files associated with this source file. - // - // For example, the source file "dir/foo.proto" might have a filename prefix - // of "dir/foo". Appending ".pb.go" produces an output file of "dir/foo.pb.go". - GeneratedFilenamePrefix string - - location Location -} - -func newFile(gen *Plugin, p *descriptorpb.FileDescriptorProto, packageName GoPackageName, importPath GoImportPath) (*File, error) { - desc, err := protodesc.NewFile(p, gen.fileReg) - if err != nil { - return nil, fmt.Errorf("invalid FileDescriptorProto %q: %v", p.GetName(), err) - } - if err := gen.fileReg.RegisterFile(desc); err != nil { - return nil, fmt.Errorf("cannot register descriptor %q: %v", p.GetName(), err) - } - f := &File{ - Desc: desc, - Proto: p, - GoPackageName: packageName, - GoImportPath: importPath, - location: Location{SourceFile: desc.Path()}, - } - - // Determine the prefix for generated Go files. - prefix := p.GetName() - if ext := path.Ext(prefix); ext == ".proto" || ext == ".protodevel" { - prefix = prefix[:len(prefix)-len(ext)] - } - switch gen.pathType { - case pathTypeImport: - // If paths=import, the output filename is derived from the Go import path. - prefix = path.Join(string(f.GoImportPath), path.Base(prefix)) - case pathTypeSourceRelative: - // If paths=source_relative, the output filename is derived from - // the input filename. - } - f.GoDescriptorIdent = GoIdent{ - GoName: "File_" + strs.GoSanitized(p.GetName()), - GoImportPath: f.GoImportPath, - } - f.GeneratedFilenamePrefix = prefix - - for i, eds := 0, desc.Enums(); i < eds.Len(); i++ { - f.Enums = append(f.Enums, newEnum(gen, f, nil, eds.Get(i))) - } - for i, mds := 0, desc.Messages(); i < mds.Len(); i++ { - f.Messages = append(f.Messages, newMessage(gen, f, nil, mds.Get(i))) - } - for i, xds := 0, desc.Extensions(); i < xds.Len(); i++ { - f.Extensions = append(f.Extensions, newField(gen, f, nil, xds.Get(i))) - } - for i, sds := 0, desc.Services(); i < sds.Len(); i++ { - f.Services = append(f.Services, newService(gen, f, sds.Get(i))) - } - for _, message := range f.Messages { - if err := message.resolveDependencies(gen); err != nil { - return nil, err - } - } - for _, extension := range f.Extensions { - if err := extension.resolveDependencies(gen); err != nil { - return nil, err - } - } - for _, service := range f.Services { - for _, method := range service.Methods { - if err := method.resolveDependencies(gen); err != nil { - return nil, err - } - } - } - return f, nil -} - -// splitImportPathAndPackageName splits off the optional Go package name -// from the Go import path when seperated by a ';' delimiter. -func splitImportPathAndPackageName(s string) (GoImportPath, GoPackageName) { - if i := strings.Index(s, ";"); i >= 0 { - return GoImportPath(s[:i]), GoPackageName(s[i+1:]) - } - return GoImportPath(s), "" -} - -// An Enum describes an enum. -type Enum struct { - Desc protoreflect.EnumDescriptor - - GoIdent GoIdent // name of the generated Go type - - Values []*EnumValue // enum value declarations - - Location Location // location of this enum - Comments CommentSet // comments associated with this enum -} - -func newEnum(gen *Plugin, f *File, parent *Message, desc protoreflect.EnumDescriptor) *Enum { - var loc Location - if parent != nil { - loc = parent.Location.appendPath(genid.DescriptorProto_EnumType_field_number, desc.Index()) - } else { - loc = f.location.appendPath(genid.FileDescriptorProto_EnumType_field_number, desc.Index()) - } - enum := &Enum{ - Desc: desc, - GoIdent: newGoIdent(f, desc), - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } - gen.enumsByName[desc.FullName()] = enum - for i, vds := 0, enum.Desc.Values(); i < vds.Len(); i++ { - enum.Values = append(enum.Values, newEnumValue(gen, f, parent, enum, vds.Get(i))) - } - return enum -} - -// An EnumValue describes an enum value. -type EnumValue struct { - Desc protoreflect.EnumValueDescriptor - - GoIdent GoIdent // name of the generated Go declaration - - Parent *Enum // enum in which this value is declared - - Location Location // location of this enum value - Comments CommentSet // comments associated with this enum value -} - -func newEnumValue(gen *Plugin, f *File, message *Message, enum *Enum, desc protoreflect.EnumValueDescriptor) *EnumValue { - // A top-level enum value's name is: EnumName_ValueName - // An enum value contained in a message is: MessageName_ValueName - // - // For historical reasons, enum value names are not camel-cased. - parentIdent := enum.GoIdent - if message != nil { - parentIdent = message.GoIdent - } - name := parentIdent.GoName + "_" + string(desc.Name()) - loc := enum.Location.appendPath(genid.EnumDescriptorProto_Value_field_number, desc.Index()) - return &EnumValue{ - Desc: desc, - GoIdent: f.GoImportPath.Ident(name), - Parent: enum, - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } -} - -// A Message describes a message. -type Message struct { - Desc protoreflect.MessageDescriptor - - GoIdent GoIdent // name of the generated Go type - - Fields []*Field // message field declarations - Oneofs []*Oneof // message oneof declarations - - Enums []*Enum // nested enum declarations - Messages []*Message // nested message declarations - Extensions []*Extension // nested extension declarations - - Location Location // location of this message - Comments CommentSet // comments associated with this message -} - -func newMessage(gen *Plugin, f *File, parent *Message, desc protoreflect.MessageDescriptor) *Message { - var loc Location - if parent != nil { - loc = parent.Location.appendPath(genid.DescriptorProto_NestedType_field_number, desc.Index()) - } else { - loc = f.location.appendPath(genid.FileDescriptorProto_MessageType_field_number, desc.Index()) - } - message := &Message{ - Desc: desc, - GoIdent: newGoIdent(f, desc), - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } - gen.messagesByName[desc.FullName()] = message - for i, eds := 0, desc.Enums(); i < eds.Len(); i++ { - message.Enums = append(message.Enums, newEnum(gen, f, message, eds.Get(i))) - } - for i, mds := 0, desc.Messages(); i < mds.Len(); i++ { - message.Messages = append(message.Messages, newMessage(gen, f, message, mds.Get(i))) - } - for i, fds := 0, desc.Fields(); i < fds.Len(); i++ { - message.Fields = append(message.Fields, newField(gen, f, message, fds.Get(i))) - } - for i, ods := 0, desc.Oneofs(); i < ods.Len(); i++ { - message.Oneofs = append(message.Oneofs, newOneof(gen, f, message, ods.Get(i))) - } - for i, xds := 0, desc.Extensions(); i < xds.Len(); i++ { - message.Extensions = append(message.Extensions, newField(gen, f, message, xds.Get(i))) - } - - // Resolve local references between fields and oneofs. - for _, field := range message.Fields { - if od := field.Desc.ContainingOneof(); od != nil { - oneof := message.Oneofs[od.Index()] - field.Oneof = oneof - oneof.Fields = append(oneof.Fields, field) - } - } - - // Field name conflict resolution. - // - // We assume well-known method names that may be attached to a generated - // message type, as well as a 'Get*' method for each field. For each - // field in turn, we add _s to its name until there are no conflicts. - // - // Any change to the following set of method names is a potential - // incompatible API change because it may change generated field names. - // - // TODO: If we ever support a 'go_name' option to set the Go name of a - // field, we should consider dropping this entirely. The conflict - // resolution algorithm is subtle and surprising (changing the order - // in which fields appear in the .proto source file can change the - // names of fields in generated code), and does not adapt well to - // adding new per-field methods such as setters. - usedNames := map[string]bool{ - "Reset": true, - "String": true, - "ProtoMessage": true, - "Marshal": true, - "Unmarshal": true, - "ExtensionRangeArray": true, - "ExtensionMap": true, - "Descriptor": true, - } - makeNameUnique := func(name string, hasGetter bool) string { - for usedNames[name] || (hasGetter && usedNames["Get"+name]) { - name += "_" - } - usedNames[name] = true - usedNames["Get"+name] = hasGetter - return name - } - for _, field := range message.Fields { - field.GoName = makeNameUnique(field.GoName, true) - field.GoIdent.GoName = message.GoIdent.GoName + "_" + field.GoName - if field.Oneof != nil && field.Oneof.Fields[0] == field { - // Make the name for a oneof unique as well. For historical reasons, - // this assumes that a getter method is not generated for oneofs. - // This is incorrect, but fixing it breaks existing code. - field.Oneof.GoName = makeNameUnique(field.Oneof.GoName, false) - field.Oneof.GoIdent.GoName = message.GoIdent.GoName + "_" + field.Oneof.GoName - } - } - - // Oneof field name conflict resolution. - // - // This conflict resolution is incomplete as it does not consider collisions - // with other oneof field types, but fixing it breaks existing code. - for _, field := range message.Fields { - if field.Oneof != nil { - Loop: - for { - for _, nestedMessage := range message.Messages { - if nestedMessage.GoIdent == field.GoIdent { - field.GoIdent.GoName += "_" - continue Loop - } - } - for _, nestedEnum := range message.Enums { - if nestedEnum.GoIdent == field.GoIdent { - field.GoIdent.GoName += "_" - continue Loop - } - } - break Loop - } - } - } - - return message -} - -func (message *Message) resolveDependencies(gen *Plugin) error { - for _, field := range message.Fields { - if err := field.resolveDependencies(gen); err != nil { - return err - } - } - for _, message := range message.Messages { - if err := message.resolveDependencies(gen); err != nil { - return err - } - } - for _, extension := range message.Extensions { - if err := extension.resolveDependencies(gen); err != nil { - return err - } - } - return nil -} - -// A Field describes a message field. -type Field struct { - Desc protoreflect.FieldDescriptor - - // GoName is the base name of this field's Go field and methods. - // For code generated by protoc-gen-go, this means a field named - // '{{GoName}}' and a getter method named 'Get{{GoName}}'. - GoName string // e.g., "FieldName" - - // GoIdent is the base name of a top-level declaration for this field. - // For code generated by protoc-gen-go, this means a wrapper type named - // '{{GoIdent}}' for members fields of a oneof, and a variable named - // 'E_{{GoIdent}}' for extension fields. - GoIdent GoIdent // e.g., "MessageName_FieldName" - - Parent *Message // message in which this field is declared; nil if top-level extension - Oneof *Oneof // containing oneof; nil if not part of a oneof - Extendee *Message // extended message for extension fields; nil otherwise - - Enum *Enum // type for enum fields; nil otherwise - Message *Message // type for message or group fields; nil otherwise - - Location Location // location of this field - Comments CommentSet // comments associated with this field -} - -func newField(gen *Plugin, f *File, message *Message, desc protoreflect.FieldDescriptor) *Field { - var loc Location - switch { - case desc.IsExtension() && message == nil: - loc = f.location.appendPath(genid.FileDescriptorProto_Extension_field_number, desc.Index()) - case desc.IsExtension() && message != nil: - loc = message.Location.appendPath(genid.DescriptorProto_Extension_field_number, desc.Index()) - default: - loc = message.Location.appendPath(genid.DescriptorProto_Field_field_number, desc.Index()) - } - camelCased := strs.GoCamelCase(string(desc.Name())) - var parentPrefix string - if message != nil { - parentPrefix = message.GoIdent.GoName + "_" - } - field := &Field{ - Desc: desc, - GoName: camelCased, - GoIdent: GoIdent{ - GoImportPath: f.GoImportPath, - GoName: parentPrefix + camelCased, - }, - Parent: message, - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } - return field -} - -func (field *Field) resolveDependencies(gen *Plugin) error { - desc := field.Desc - switch desc.Kind() { - case protoreflect.EnumKind: - name := field.Desc.Enum().FullName() - enum, ok := gen.enumsByName[name] - if !ok { - return fmt.Errorf("field %v: no descriptor for enum %v", desc.FullName(), name) - } - field.Enum = enum - case protoreflect.MessageKind, protoreflect.GroupKind: - name := desc.Message().FullName() - message, ok := gen.messagesByName[name] - if !ok { - return fmt.Errorf("field %v: no descriptor for type %v", desc.FullName(), name) - } - field.Message = message - } - if desc.IsExtension() { - name := desc.ContainingMessage().FullName() - message, ok := gen.messagesByName[name] - if !ok { - return fmt.Errorf("field %v: no descriptor for type %v", desc.FullName(), name) - } - field.Extendee = message - } - return nil -} - -// A Oneof describes a message oneof. -type Oneof struct { - Desc protoreflect.OneofDescriptor - - // GoName is the base name of this oneof's Go field and methods. - // For code generated by protoc-gen-go, this means a field named - // '{{GoName}}' and a getter method named 'Get{{GoName}}'. - GoName string // e.g., "OneofName" - - // GoIdent is the base name of a top-level declaration for this oneof. - GoIdent GoIdent // e.g., "MessageName_OneofName" - - Parent *Message // message in which this oneof is declared - - Fields []*Field // fields that are part of this oneof - - Location Location // location of this oneof - Comments CommentSet // comments associated with this oneof -} - -func newOneof(gen *Plugin, f *File, message *Message, desc protoreflect.OneofDescriptor) *Oneof { - loc := message.Location.appendPath(genid.DescriptorProto_OneofDecl_field_number, desc.Index()) - camelCased := strs.GoCamelCase(string(desc.Name())) - parentPrefix := message.GoIdent.GoName + "_" - return &Oneof{ - Desc: desc, - Parent: message, - GoName: camelCased, - GoIdent: GoIdent{ - GoImportPath: f.GoImportPath, - GoName: parentPrefix + camelCased, - }, - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } -} - -// Extension is an alias of Field for documentation. -type Extension = Field - -// A Service describes a service. -type Service struct { - Desc protoreflect.ServiceDescriptor - - GoName string - - Methods []*Method // service method declarations - - Location Location // location of this service - Comments CommentSet // comments associated with this service -} - -func newService(gen *Plugin, f *File, desc protoreflect.ServiceDescriptor) *Service { - loc := f.location.appendPath(genid.FileDescriptorProto_Service_field_number, desc.Index()) - service := &Service{ - Desc: desc, - GoName: strs.GoCamelCase(string(desc.Name())), - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } - for i, mds := 0, desc.Methods(); i < mds.Len(); i++ { - service.Methods = append(service.Methods, newMethod(gen, f, service, mds.Get(i))) - } - return service -} - -// A Method describes a method in a service. -type Method struct { - Desc protoreflect.MethodDescriptor - - GoName string - - Parent *Service // service in which this method is declared - - Input *Message - Output *Message - - Location Location // location of this method - Comments CommentSet // comments associated with this method -} - -func newMethod(gen *Plugin, f *File, service *Service, desc protoreflect.MethodDescriptor) *Method { - loc := service.Location.appendPath(genid.ServiceDescriptorProto_Method_field_number, desc.Index()) - method := &Method{ - Desc: desc, - GoName: strs.GoCamelCase(string(desc.Name())), - Parent: service, - Location: loc, - Comments: makeCommentSet(f.Desc.SourceLocations().ByDescriptor(desc)), - } - return method -} - -func (method *Method) resolveDependencies(gen *Plugin) error { - desc := method.Desc - - inName := desc.Input().FullName() - in, ok := gen.messagesByName[inName] - if !ok { - return fmt.Errorf("method %v: no descriptor for type %v", desc.FullName(), inName) - } - method.Input = in - - outName := desc.Output().FullName() - out, ok := gen.messagesByName[outName] - if !ok { - return fmt.Errorf("method %v: no descriptor for type %v", desc.FullName(), outName) - } - method.Output = out - - return nil -} - -// A GeneratedFile is a generated file. -type GeneratedFile struct { - gen *Plugin - skip bool - filename string - goImportPath GoImportPath - buf bytes.Buffer - packageNames map[GoImportPath]GoPackageName - usedPackageNames map[GoPackageName]bool - manualImports map[GoImportPath]bool - annotations map[string][]Location -} - -// NewGeneratedFile creates a new generated file with the given filename -// and import path. -func (gen *Plugin) NewGeneratedFile(filename string, goImportPath GoImportPath) *GeneratedFile { - g := &GeneratedFile{ - gen: gen, - filename: filename, - goImportPath: goImportPath, - packageNames: make(map[GoImportPath]GoPackageName), - usedPackageNames: make(map[GoPackageName]bool), - manualImports: make(map[GoImportPath]bool), - annotations: make(map[string][]Location), - } - - // All predeclared identifiers in Go are already used. - for _, s := range types.Universe.Names() { - g.usedPackageNames[GoPackageName(s)] = true - } - - gen.genFiles = append(gen.genFiles, g) - return g -} - -// P prints a line to the generated output. It converts each parameter to a -// string following the same rules as fmt.Print. It never inserts spaces -// between parameters. -func (g *GeneratedFile) P(v ...interface{}) { - for _, x := range v { - switch x := x.(type) { - case GoIdent: - fmt.Fprint(&g.buf, g.QualifiedGoIdent(x)) - default: - fmt.Fprint(&g.buf, x) - } - } - fmt.Fprintln(&g.buf) -} - -// QualifiedGoIdent returns the string to use for a Go identifier. -// -// If the identifier is from a different Go package than the generated file, -// the returned name will be qualified (package.name) and an import statement -// for the identifier's package will be included in the file. -func (g *GeneratedFile) QualifiedGoIdent(ident GoIdent) string { - if ident.GoImportPath == g.goImportPath { - return ident.GoName - } - if packageName, ok := g.packageNames[ident.GoImportPath]; ok { - return string(packageName) + "." + ident.GoName - } - packageName := cleanPackageName(path.Base(string(ident.GoImportPath))) - for i, orig := 1, packageName; g.usedPackageNames[packageName]; i++ { - packageName = orig + GoPackageName(strconv.Itoa(i)) - } - g.packageNames[ident.GoImportPath] = packageName - g.usedPackageNames[packageName] = true - return string(packageName) + "." + ident.GoName -} - -// Import ensures a package is imported by the generated file. -// -// Packages referenced by QualifiedGoIdent are automatically imported. -// Explicitly importing a package with Import is generally only necessary -// when the import will be blank (import _ "package"). -func (g *GeneratedFile) Import(importPath GoImportPath) { - g.manualImports[importPath] = true -} - -// Write implements io.Writer. -func (g *GeneratedFile) Write(p []byte) (n int, err error) { - return g.buf.Write(p) -} - -// Skip removes the generated file from the plugin output. -func (g *GeneratedFile) Skip() { - g.skip = true -} - -// Unskip reverts a previous call to Skip, re-including the generated file in -// the plugin output. -func (g *GeneratedFile) Unskip() { - g.skip = false -} - -// Annotate associates a symbol in a generated Go file with a location in a -// source .proto file. -// -// The symbol may refer to a type, constant, variable, function, method, or -// struct field. The "T.sel" syntax is used to identify the method or field -// 'sel' on type 'T'. -func (g *GeneratedFile) Annotate(symbol string, loc Location) { - g.annotations[symbol] = append(g.annotations[symbol], loc) -} - -// Content returns the contents of the generated file. -func (g *GeneratedFile) Content() ([]byte, error) { - if !strings.HasSuffix(g.filename, ".go") { - return g.buf.Bytes(), nil - } - - // Reformat generated code. - original := g.buf.Bytes() - fset := token.NewFileSet() - file, err := parser.ParseFile(fset, "", original, parser.ParseComments) - if err != nil { - // Print out the bad code with line numbers. - // This should never happen in practice, but it can while changing generated code - // so consider this a debugging aid. - var src bytes.Buffer - s := bufio.NewScanner(bytes.NewReader(original)) - for line := 1; s.Scan(); line++ { - fmt.Fprintf(&src, "%5d\t%s\n", line, s.Bytes()) - } - return nil, fmt.Errorf("%v: unparsable Go source: %v\n%v", g.filename, err, src.String()) - } - - // Collect a sorted list of all imports. - var importPaths [][2]string - rewriteImport := func(importPath string) string { - if f := g.gen.opts.ImportRewriteFunc; f != nil { - return string(f(GoImportPath(importPath))) - } - return importPath - } - for importPath := range g.packageNames { - pkgName := string(g.packageNames[GoImportPath(importPath)]) - pkgPath := rewriteImport(string(importPath)) - importPaths = append(importPaths, [2]string{pkgName, pkgPath}) - } - for importPath := range g.manualImports { - if _, ok := g.packageNames[importPath]; !ok { - pkgPath := rewriteImport(string(importPath)) - importPaths = append(importPaths, [2]string{"_", pkgPath}) - } - } - sort.Slice(importPaths, func(i, j int) bool { - return importPaths[i][1] < importPaths[j][1] - }) - - // Modify the AST to include a new import block. - if len(importPaths) > 0 { - // Insert block after package statement or - // possible comment attached to the end of the package statement. - pos := file.Package - tokFile := fset.File(file.Package) - pkgLine := tokFile.Line(file.Package) - for _, c := range file.Comments { - if tokFile.Line(c.Pos()) > pkgLine { - break - } - pos = c.End() - } - - // Construct the import block. - impDecl := &ast.GenDecl{ - Tok: token.IMPORT, - TokPos: pos, - Lparen: pos, - Rparen: pos, - } - for _, importPath := range importPaths { - impDecl.Specs = append(impDecl.Specs, &ast.ImportSpec{ - Name: &ast.Ident{ - Name: importPath[0], - NamePos: pos, - }, - Path: &ast.BasicLit{ - Kind: token.STRING, - Value: strconv.Quote(importPath[1]), - ValuePos: pos, - }, - EndPos: pos, - }) - } - file.Decls = append([]ast.Decl{impDecl}, file.Decls...) - } - - var out bytes.Buffer - if err = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(&out, fset, file); err != nil { - return nil, fmt.Errorf("%v: can not reformat Go source: %v", g.filename, err) - } - return out.Bytes(), nil -} - -// metaFile returns the contents of the file's metadata file, which is a -// text formatted string of the google.protobuf.GeneratedCodeInfo. -func (g *GeneratedFile) metaFile(content []byte) (string, error) { - fset := token.NewFileSet() - astFile, err := parser.ParseFile(fset, "", content, 0) - if err != nil { - return "", err - } - info := &descriptorpb.GeneratedCodeInfo{} - - seenAnnotations := make(map[string]bool) - annotate := func(s string, ident *ast.Ident) { - seenAnnotations[s] = true - for _, loc := range g.annotations[s] { - info.Annotation = append(info.Annotation, &descriptorpb.GeneratedCodeInfo_Annotation{ - SourceFile: proto.String(loc.SourceFile), - Path: loc.Path, - Begin: proto.Int32(int32(fset.Position(ident.Pos()).Offset)), - End: proto.Int32(int32(fset.Position(ident.End()).Offset)), - }) - } - } - for _, decl := range astFile.Decls { - switch decl := decl.(type) { - case *ast.GenDecl: - for _, spec := range decl.Specs { - switch spec := spec.(type) { - case *ast.TypeSpec: - annotate(spec.Name.Name, spec.Name) - switch st := spec.Type.(type) { - case *ast.StructType: - for _, field := range st.Fields.List { - for _, name := range field.Names { - annotate(spec.Name.Name+"."+name.Name, name) - } - } - case *ast.InterfaceType: - for _, field := range st.Methods.List { - for _, name := range field.Names { - annotate(spec.Name.Name+"."+name.Name, name) - } - } - } - case *ast.ValueSpec: - for _, name := range spec.Names { - annotate(name.Name, name) - } - } - } - case *ast.FuncDecl: - if decl.Recv == nil { - annotate(decl.Name.Name, decl.Name) - } else { - recv := decl.Recv.List[0].Type - if s, ok := recv.(*ast.StarExpr); ok { - recv = s.X - } - if id, ok := recv.(*ast.Ident); ok { - annotate(id.Name+"."+decl.Name.Name, decl.Name) - } - } - } - } - for a := range g.annotations { - if !seenAnnotations[a] { - return "", fmt.Errorf("%v: no symbol matching annotation %q", g.filename, a) - } - } - - b, err := prototext.Marshal(info) - if err != nil { - return "", err - } - return string(b), nil -} - -// A GoIdent is a Go identifier, consisting of a name and import path. -// The name is a single identifier and may not be a dot-qualified selector. -type GoIdent struct { - GoName string - GoImportPath GoImportPath -} - -func (id GoIdent) String() string { return fmt.Sprintf("%q.%v", id.GoImportPath, id.GoName) } - -// newGoIdent returns the Go identifier for a descriptor. -func newGoIdent(f *File, d protoreflect.Descriptor) GoIdent { - name := strings.TrimPrefix(string(d.FullName()), string(f.Desc.Package())+".") - return GoIdent{ - GoName: strs.GoCamelCase(name), - GoImportPath: f.GoImportPath, - } -} - -// A GoImportPath is the import path of a Go package. -// For example: "google.golang.org/protobuf/compiler/protogen" -type GoImportPath string - -func (p GoImportPath) String() string { return strconv.Quote(string(p)) } - -// Ident returns a GoIdent with s as the GoName and p as the GoImportPath. -func (p GoImportPath) Ident(s string) GoIdent { - return GoIdent{GoName: s, GoImportPath: p} -} - -// A GoPackageName is the name of a Go package. e.g., "protobuf". -type GoPackageName string - -// cleanPackageName converts a string to a valid Go package name. -func cleanPackageName(name string) GoPackageName { - return GoPackageName(strs.GoSanitized(name)) -} - -type pathType int - -const ( - pathTypeImport pathType = iota - pathTypeSourceRelative -) - -// A Location is a location in a .proto source file. -// -// See the google.protobuf.SourceCodeInfo documentation in descriptor.proto -// for details. -type Location struct { - SourceFile string - Path protoreflect.SourcePath -} - -// appendPath add elements to a Location's path, returning a new Location. -func (loc Location) appendPath(num protoreflect.FieldNumber, idx int) Location { - loc.Path = append(protoreflect.SourcePath(nil), loc.Path...) // make copy - loc.Path = append(loc.Path, int32(num), int32(idx)) - return loc -} - -// CommentSet is a set of leading and trailing comments associated -// with a .proto descriptor declaration. -type CommentSet struct { - LeadingDetached []Comments - Leading Comments - Trailing Comments -} - -func makeCommentSet(loc protoreflect.SourceLocation) CommentSet { - var leadingDetached []Comments - for _, s := range loc.LeadingDetachedComments { - leadingDetached = append(leadingDetached, Comments(s)) - } - return CommentSet{ - LeadingDetached: leadingDetached, - Leading: Comments(loc.LeadingComments), - Trailing: Comments(loc.TrailingComments), - } -} - -// Comments is a comments string as provided by protoc. -type Comments string - -// String formats the comments by inserting // to the start of each line, -// ensuring that there is a trailing newline. -// An empty comment is formatted as an empty string. -func (c Comments) String() string { - if c == "" { - return "" - } - var b []byte - for _, line := range strings.Split(strings.TrimSuffix(string(c), "\n"), "\n") { - b = append(b, "//"...) - b = append(b, line...) - b = append(b, "\n"...) - } - return string(b) -} diff --git a/ibm/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go b/ibm/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go deleted file mode 100644 index e511ad6f7f..0000000000 --- a/ibm/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go +++ /dev/null @@ -1,653 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to -// change. -// -// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is -// just a program that reads a CodeGeneratorRequest from stdin and writes a -// CodeGeneratorResponse to stdout. -// -// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead -// of dealing with the raw protocol defined here. -// -// A plugin executable needs only to be placed somewhere in the path. The -// plugin should be named "protoc-gen-$NAME", and will then be used when the -// flag "--${NAME}_out" is passed to protoc. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/compiler/plugin.proto - -package pluginpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" -) - -// Sync with code_generator.h. -type CodeGeneratorResponse_Feature int32 - -const ( - CodeGeneratorResponse_FEATURE_NONE CodeGeneratorResponse_Feature = 0 - CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL CodeGeneratorResponse_Feature = 1 -) - -// Enum value maps for CodeGeneratorResponse_Feature. -var ( - CodeGeneratorResponse_Feature_name = map[int32]string{ - 0: "FEATURE_NONE", - 1: "FEATURE_PROTO3_OPTIONAL", - } - CodeGeneratorResponse_Feature_value = map[string]int32{ - "FEATURE_NONE": 0, - "FEATURE_PROTO3_OPTIONAL": 1, - } -) - -func (x CodeGeneratorResponse_Feature) Enum() *CodeGeneratorResponse_Feature { - p := new(CodeGeneratorResponse_Feature) - *p = x - return p -} - -func (x CodeGeneratorResponse_Feature) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CodeGeneratorResponse_Feature) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_compiler_plugin_proto_enumTypes[0].Descriptor() -} - -func (CodeGeneratorResponse_Feature) Type() protoreflect.EnumType { - return &file_google_protobuf_compiler_plugin_proto_enumTypes[0] -} - -func (x CodeGeneratorResponse_Feature) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *CodeGeneratorResponse_Feature) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = CodeGeneratorResponse_Feature(num) - return nil -} - -// Deprecated: Use CodeGeneratorResponse_Feature.Descriptor instead. -func (CodeGeneratorResponse_Feature) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{2, 0} -} - -// The version number of protocol compiler. -type Version struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Major *int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"` - Minor *int32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"` - Patch *int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"` - // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - // be empty for mainline stable releases. - Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"` -} - -func (x *Version) Reset() { - *x = Version{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Version) ProtoMessage() {} - -func (x *Version) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Version.ProtoReflect.Descriptor instead. -func (*Version) Descriptor() ([]byte, []int) { - return file_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{0} -} - -func (x *Version) GetMajor() int32 { - if x != nil && x.Major != nil { - return *x.Major - } - return 0 -} - -func (x *Version) GetMinor() int32 { - if x != nil && x.Minor != nil { - return *x.Minor - } - return 0 -} - -func (x *Version) GetPatch() int32 { - if x != nil && x.Patch != nil { - return *x.Patch - } - return 0 -} - -func (x *Version) GetSuffix() string { - if x != nil && x.Suffix != nil { - return *x.Suffix - } - return "" -} - -// An encoded CodeGeneratorRequest is written to the plugin's stdin. -type CodeGeneratorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The .proto files that were explicitly listed on the command-line. The - // code generator should generate code only for these files. Each file's - // descriptor will be included in proto_file, below. - FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate,json=fileToGenerate" json:"file_to_generate,omitempty"` - // The generator parameter passed on the command-line. - Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"` - // FileDescriptorProtos for all files in files_to_generate and everything - // they import. The files will appear in topological order, so each file - // appears before any file that imports it. - // - // protoc guarantees that all proto_files will be written after - // the fields above, even though this is not technically guaranteed by the - // protobuf wire format. This theoretically could allow a plugin to stream - // in the FileDescriptorProtos and handle them one by one rather than read - // the entire set into memory at once. However, as of this writing, this - // is not similarly optimized on protoc's end -- it will store all fields in - // memory at once before sending them to the plugin. - // - // Type names of fields and extensions in the FileDescriptorProto are always - // fully qualified. - ProtoFile []*descriptorpb.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"` - // The version number of protocol compiler. - CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"` -} - -func (x *CodeGeneratorRequest) Reset() { - *x = CodeGeneratorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeGeneratorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeGeneratorRequest) ProtoMessage() {} - -func (x *CodeGeneratorRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeGeneratorRequest.ProtoReflect.Descriptor instead. -func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) { - return file_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{1} -} - -func (x *CodeGeneratorRequest) GetFileToGenerate() []string { - if x != nil { - return x.FileToGenerate - } - return nil -} - -func (x *CodeGeneratorRequest) GetParameter() string { - if x != nil && x.Parameter != nil { - return *x.Parameter - } - return "" -} - -func (x *CodeGeneratorRequest) GetProtoFile() []*descriptorpb.FileDescriptorProto { - if x != nil { - return x.ProtoFile - } - return nil -} - -func (x *CodeGeneratorRequest) GetCompilerVersion() *Version { - if x != nil { - return x.CompilerVersion - } - return nil -} - -// The plugin writes an encoded CodeGeneratorResponse to stdout. -type CodeGeneratorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Error message. If non-empty, code generation failed. The plugin process - // should exit with status code zero even if it reports an error in this way. - // - // This should be used to indicate errors in .proto files which prevent the - // code generator from generating correct code. Errors which indicate a - // problem in protoc itself -- such as the input CodeGeneratorRequest being - // unparseable -- should be reported by writing a message to stderr and - // exiting with a non-zero status code. - Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - // A bitmask of supported features that the code generator supports. - // This is a bitwise "or" of values from the Feature enum. - SupportedFeatures *uint64 `protobuf:"varint,2,opt,name=supported_features,json=supportedFeatures" json:"supported_features,omitempty"` - File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"` -} - -func (x *CodeGeneratorResponse) Reset() { - *x = CodeGeneratorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeGeneratorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeGeneratorResponse) ProtoMessage() {} - -func (x *CodeGeneratorResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeGeneratorResponse.ProtoReflect.Descriptor instead. -func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) { - return file_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{2} -} - -func (x *CodeGeneratorResponse) GetError() string { - if x != nil && x.Error != nil { - return *x.Error - } - return "" -} - -func (x *CodeGeneratorResponse) GetSupportedFeatures() uint64 { - if x != nil && x.SupportedFeatures != nil { - return *x.SupportedFeatures - } - return 0 -} - -func (x *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File { - if x != nil { - return x.File - } - return nil -} - -// Represents a single generated file. -type CodeGeneratorResponse_File struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The file name, relative to the output directory. The name must not - // contain "." or ".." components and must be relative, not be absolute (so, - // the file cannot lie outside the output directory). "/" must be used as - // the path separator, not "\". - // - // If the name is omitted, the content will be appended to the previous - // file. This allows the generator to break large files into small chunks, - // and allows the generated text to be streamed back to protoc so that large - // files need not reside completely in memory at one time. Note that as of - // this writing protoc does not optimize for this -- it will read the entire - // CodeGeneratorResponse before writing files to disk. - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // If non-empty, indicates that the named file should already exist, and the - // content here is to be inserted into that file at a defined insertion - // point. This feature allows a code generator to extend the output - // produced by another code generator. The original generator may provide - // insertion points by placing special annotations in the file that look - // like: - // @@protoc_insertion_point(NAME) - // The annotation can have arbitrary text before and after it on the line, - // which allows it to be placed in a comment. NAME should be replaced with - // an identifier naming the point -- this is what other generators will use - // as the insertion_point. Code inserted at this point will be placed - // immediately above the line containing the insertion point (thus multiple - // insertions to the same point will come out in the order they were added). - // The double-@ is intended to make it unlikely that the generated code - // could contain things that look like insertion points by accident. - // - // For example, the C++ code generator places the following line in the - // .pb.h files that it generates: - // // @@protoc_insertion_point(namespace_scope) - // This line appears within the scope of the file's package namespace, but - // outside of any particular class. Another plugin can then specify the - // insertion_point "namespace_scope" to generate additional classes or - // other declarations that should be placed in this scope. - // - // Note that if the line containing the insertion point begins with - // whitespace, the same whitespace will be added to every line of the - // inserted text. This is useful for languages like Python, where - // indentation matters. In these languages, the insertion point comment - // should be indented the same amount as any inserted code will need to be - // in order to work correctly in that context. - // - // The code generator that generates the initial file and the one which - // inserts into it must both run as part of a single invocation of protoc. - // Code generators are executed in the order in which they appear on the - // command line. - // - // If |insertion_point| is present, |name| must also be present. - InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point,json=insertionPoint" json:"insertion_point,omitempty"` - // The file contents. - Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"` - // Information describing the file content being inserted. If an insertion - // point is used, this information will be appropriately offset and inserted - // into the code generation metadata for the generated files. - GeneratedCodeInfo *descriptorpb.GeneratedCodeInfo `protobuf:"bytes,16,opt,name=generated_code_info,json=generatedCodeInfo" json:"generated_code_info,omitempty"` -} - -func (x *CodeGeneratorResponse_File) Reset() { - *x = CodeGeneratorResponse_File{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeGeneratorResponse_File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeGeneratorResponse_File) ProtoMessage() {} - -func (x *CodeGeneratorResponse_File) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_compiler_plugin_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeGeneratorResponse_File.ProtoReflect.Descriptor instead. -func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) { - return file_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *CodeGeneratorResponse_File) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *CodeGeneratorResponse_File) GetInsertionPoint() string { - if x != nil && x.InsertionPoint != nil { - return *x.InsertionPoint - } - return "" -} - -func (x *CodeGeneratorResponse_File) GetContent() string { - if x != nil && x.Content != nil { - return *x.Content - } - return "" -} - -func (x *CodeGeneratorResponse_File) GetGeneratedCodeInfo() *descriptorpb.GeneratedCodeInfo { - if x != nil { - return x.GeneratedCodeInfo - } - return nil -} - -var File_google_protobuf_compiler_plugin_proto protoreflect.FileDescriptor - -var file_google_protobuf_compiler_plugin_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, - 0x72, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, - 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x22, 0xf1, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x64, - 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x28, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, - 0x65, 0x54, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x4c, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x03, 0x0a, - 0x15, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2d, 0x0a, 0x12, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x04, 0x66, - 0x69, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, - 0x04, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0xb1, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x73, - 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x52, 0x0a, 0x13, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, - 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x38, 0x0a, 0x07, 0x46, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, - 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, - 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, - 0x4c, 0x10, 0x01, 0x42, 0x57, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x72, 0x42, 0x0c, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x5a, 0x29, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x70, 0x62, -} - -var ( - file_google_protobuf_compiler_plugin_proto_rawDescOnce sync.Once - file_google_protobuf_compiler_plugin_proto_rawDescData = file_google_protobuf_compiler_plugin_proto_rawDesc -) - -func file_google_protobuf_compiler_plugin_proto_rawDescGZIP() []byte { - file_google_protobuf_compiler_plugin_proto_rawDescOnce.Do(func() { - file_google_protobuf_compiler_plugin_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_compiler_plugin_proto_rawDescData) - }) - return file_google_protobuf_compiler_plugin_proto_rawDescData -} - -var file_google_protobuf_compiler_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_protobuf_compiler_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_google_protobuf_compiler_plugin_proto_goTypes = []interface{}{ - (CodeGeneratorResponse_Feature)(0), // 0: google.protobuf.compiler.CodeGeneratorResponse.Feature - (*Version)(nil), // 1: google.protobuf.compiler.Version - (*CodeGeneratorRequest)(nil), // 2: google.protobuf.compiler.CodeGeneratorRequest - (*CodeGeneratorResponse)(nil), // 3: google.protobuf.compiler.CodeGeneratorResponse - (*CodeGeneratorResponse_File)(nil), // 4: google.protobuf.compiler.CodeGeneratorResponse.File - (*descriptorpb.FileDescriptorProto)(nil), // 5: google.protobuf.FileDescriptorProto - (*descriptorpb.GeneratedCodeInfo)(nil), // 6: google.protobuf.GeneratedCodeInfo -} -var file_google_protobuf_compiler_plugin_proto_depIdxs = []int32{ - 5, // 0: google.protobuf.compiler.CodeGeneratorRequest.proto_file:type_name -> google.protobuf.FileDescriptorProto - 1, // 1: google.protobuf.compiler.CodeGeneratorRequest.compiler_version:type_name -> google.protobuf.compiler.Version - 4, // 2: google.protobuf.compiler.CodeGeneratorResponse.file:type_name -> google.protobuf.compiler.CodeGeneratorResponse.File - 6, // 3: google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info:type_name -> google.protobuf.GeneratedCodeInfo - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_google_protobuf_compiler_plugin_proto_init() } -func file_google_protobuf_compiler_plugin_proto_init() { - if File_google_protobuf_compiler_plugin_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_compiler_plugin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_compiler_plugin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeGeneratorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_compiler_plugin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeGeneratorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_compiler_plugin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeGeneratorResponse_File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_protobuf_compiler_plugin_proto_rawDesc, - NumEnums: 1, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_protobuf_compiler_plugin_proto_goTypes, - DependencyIndexes: file_google_protobuf_compiler_plugin_proto_depIdxs, - EnumInfos: file_google_protobuf_compiler_plugin_proto_enumTypes, - MessageInfos: file_google_protobuf_compiler_plugin_proto_msgTypes, - }.Build() - File_google_protobuf_compiler_plugin_proto = out.File - file_google_protobuf_compiler_plugin_proto_rawDesc = nil - file_google_protobuf_compiler_plugin_proto_goTypes = nil - file_google_protobuf_compiler_plugin_proto_depIdxs = nil -} diff --git a/ibm/vendor/modules.txt b/ibm/vendor/modules.txt index a1dd5456c3..57306761dc 100644 --- a/ibm/vendor/modules.txt +++ b/ibm/vendor/modules.txt @@ -1,16 +1,4 @@ -# cloud.google.com/go v0.65.0 -## explicit; go 1.11 -cloud.google.com/go -cloud.google.com/go/compute/metadata -cloud.google.com/go/iam -cloud.google.com/go/internal -cloud.google.com/go/internal/optional -cloud.google.com/go/internal/trace -cloud.google.com/go/internal/version -# cloud.google.com/go/storage v1.10.0 -## explicit; go 1.11 -cloud.google.com/go/storage -# github.com/IBM-Cloud/bluemix-go v0.0.0-20211223094327-0da2539481f7 +# github.com/IBM-Cloud/bluemix-go v0.0.0-20220407050707-b4cd0d4da813 ## explicit; go 1.13 github.com/IBM-Cloud/bluemix-go github.com/IBM-Cloud/bluemix-go/api/account/accountv1 @@ -50,8 +38,8 @@ github.com/IBM-Cloud/bluemix-go/utils github.com/IBM-Cloud/container-services-go-sdk/common github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1 github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1 -# github.com/IBM-Cloud/power-go-client v1.0.87 -## explicit; go 1.13 +# github.com/IBM-Cloud/power-go-client v1.1.4 +## explicit; go 1.17 github.com/IBM-Cloud/power-go-client/clients/instance github.com/IBM-Cloud/power-go-client/errors github.com/IBM-Cloud/power-go-client/helpers @@ -88,13 +76,51 @@ github.com/IBM-Cloud/power-go-client/power/client/service_instances github.com/IBM-Cloud/power-go-client/power/client/storage_types github.com/IBM-Cloud/power-go-client/power/client/swagger_spec github.com/IBM-Cloud/power-go-client/power/models -github.com/IBM-Cloud/power-go-client/utils -# github.com/IBM-Cloud/terraform-provider-ibm v1.38.1 +# github.com/IBM-Cloud/terraform-provider-ibm v1.40.1 ## explicit; go 1.16 github.com/IBM-Cloud/terraform-provider-ibm -github.com/IBM-Cloud/terraform-provider-ibm/ibm -github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/hashcode -github.com/IBM-Cloud/terraform-provider-ibm/ibm/internal/mutexkv +github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns +github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex +github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/apigateway +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appconfiguration +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/appid +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/atracker +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/catalogmanagement +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/certificatemanager +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cis +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/classicinfrastructure +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudant +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudfoundry +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cloudshell +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/contextbasedrestrictions +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/cos +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/database +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/dnsservices +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/enterprise +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventnotification +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/eventstreams +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/functions +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/hpcs +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamaccessgroup +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iamidentity +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kms +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/pushnotification +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/registry +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcecontroller +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/resourcemanager +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/scc +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/schematics +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/secretsmanager +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/transitgateway +github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc +github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate github.com/IBM-Cloud/terraform-provider-ibm/version # github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca ## explicit; go 1.13 @@ -128,7 +154,7 @@ github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1 # github.com/IBM/go-sdk-core/v3 v3.2.4 ## explicit; go 1.12 github.com/IBM/go-sdk-core/v3/core -# github.com/IBM/go-sdk-core/v5 v5.8.2 +# github.com/IBM/go-sdk-core/v5 v5.9.1 ## explicit; go 1.14 github.com/IBM/go-sdk-core/v5/core # github.com/IBM/ibm-cos-sdk-go v1.8.0 @@ -186,8 +212,9 @@ github.com/IBM/ibm-hpcs-tke-sdk/tkesdk ## explicit; go 1.12 github.com/IBM/keyprotect-go-client github.com/IBM/keyprotect-go-client/iam -# github.com/IBM/networking-go-sdk v0.23.1 +# github.com/IBM/networking-go-sdk v0.26.0 ## explicit; go 1.14 +github.com/IBM/networking-go-sdk/alertsv1 github.com/IBM/networking-go-sdk/cachingapiv1 github.com/IBM/networking-go-sdk/cisipapiv1 github.com/IBM/networking-go-sdk/common @@ -212,6 +239,7 @@ github.com/IBM/networking-go-sdk/useragentblockingrulesv1 github.com/IBM/networking-go-sdk/wafrulegroupsapiv1 github.com/IBM/networking-go-sdk/wafrulepackagesapiv1 github.com/IBM/networking-go-sdk/wafrulesapiv1 +github.com/IBM/networking-go-sdk/webhooksv1 github.com/IBM/networking-go-sdk/zonefirewallaccessrulesv1 github.com/IBM/networking-go-sdk/zonelockdownv1 github.com/IBM/networking-go-sdk/zoneratelimitsv1 @@ -237,11 +265,14 @@ github.com/IBM/push-notifications-go-sdk/common github.com/IBM/push-notifications-go-sdk/pushservicev1 # github.com/IBM/scc-go-sdk v1.3.4 ## explicit; go 1.14 -github.com/IBM/scc-go-sdk/adminserviceapiv1 github.com/IBM/scc-go-sdk/common github.com/IBM/scc-go-sdk/findingsv1 -github.com/IBM/scc-go-sdk/posturemanagementv1 -github.com/IBM/scc-go-sdk/posturemanagementv2 +# github.com/IBM/scc-go-sdk/v3 v3.1.6 +## explicit; go 1.14 +github.com/IBM/scc-go-sdk/v3/adminserviceapiv1 +github.com/IBM/scc-go-sdk/v3/common +github.com/IBM/scc-go-sdk/v3/posturemanagementv1 +github.com/IBM/scc-go-sdk/v3/posturemanagementv2 # github.com/IBM/schematics-go-sdk v0.1.3 ## explicit; go 1.15 github.com/IBM/schematics-go-sdk/common @@ -250,7 +281,7 @@ github.com/IBM/schematics-go-sdk/schematicsv1 ## explicit; go 1.14 github.com/IBM/secrets-manager-go-sdk/common github.com/IBM/secrets-manager-go-sdk/secretsmanagerv1 -# github.com/IBM/vpc-go-sdk v0.15.0 +# github.com/IBM/vpc-go-sdk v0.17.0 ## explicit; go 1.14 github.com/IBM/vpc-go-sdk/common github.com/IBM/vpc-go-sdk/vpcv1 @@ -288,60 +319,6 @@ github.com/apparentlymart/go-textseg/v13/textseg # github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d ## explicit; go 1.13 github.com/asaskevich/govalidator -# github.com/aws/aws-sdk-go v1.37.0 -## explicit; go 1.11 -github.com/aws/aws-sdk-go/aws -github.com/aws/aws-sdk-go/aws/arn -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/client/metadata -github.com/aws/aws-sdk-go/aws/corehandlers -github.com/aws/aws-sdk-go/aws/credentials -github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds -github.com/aws/aws-sdk-go/aws/credentials/endpointcreds -github.com/aws/aws-sdk-go/aws/credentials/processcreds -github.com/aws/aws-sdk-go/aws/credentials/ssocreds -github.com/aws/aws-sdk-go/aws/credentials/stscreds -github.com/aws/aws-sdk-go/aws/csm -github.com/aws/aws-sdk-go/aws/defaults -github.com/aws/aws-sdk-go/aws/ec2metadata -github.com/aws/aws-sdk-go/aws/endpoints -github.com/aws/aws-sdk-go/aws/request -github.com/aws/aws-sdk-go/aws/session -github.com/aws/aws-sdk-go/aws/signer/v4 -github.com/aws/aws-sdk-go/internal/context -github.com/aws/aws-sdk-go/internal/ini -github.com/aws/aws-sdk-go/internal/s3shared -github.com/aws/aws-sdk-go/internal/s3shared/arn -github.com/aws/aws-sdk-go/internal/s3shared/s3err -github.com/aws/aws-sdk-go/internal/sdkio -github.com/aws/aws-sdk-go/internal/sdkmath -github.com/aws/aws-sdk-go/internal/sdkrand -github.com/aws/aws-sdk-go/internal/sdkuri -github.com/aws/aws-sdk-go/internal/shareddefaults -github.com/aws/aws-sdk-go/internal/strings -github.com/aws/aws-sdk-go/internal/sync/singleflight -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/json/jsonutil -github.com/aws/aws-sdk-go/private/protocol/jsonrpc -github.com/aws/aws-sdk-go/private/protocol/query -github.com/aws/aws-sdk-go/private/protocol/query/queryutil -github.com/aws/aws-sdk-go/private/protocol/rest -github.com/aws/aws-sdk-go/private/protocol/restjson -github.com/aws/aws-sdk-go/private/protocol/restxml -github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil -github.com/aws/aws-sdk-go/service/s3 -github.com/aws/aws-sdk-go/service/sso -github.com/aws/aws-sdk-go/service/sso/ssoiface -github.com/aws/aws-sdk-go/service/sts -github.com/aws/aws-sdk-go/service/sts/stsiface -# github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d -## explicit -github.com/bgentry/go-netrc/netrc # github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 ## explicit github.com/cloudfoundry/jibber_jabber @@ -369,7 +346,7 @@ github.com/fatih/color # github.com/ghodss/yaml v1.0.0 ## explicit github.com/ghodss/yaml -# github.com/go-openapi/analysis v0.20.1 +# github.com/go-openapi/analysis v0.21.2 ## explicit; go 1.13 github.com/go-openapi/analysis github.com/go-openapi/analysis/internal/debug @@ -378,7 +355,7 @@ github.com/go-openapi/analysis/internal/flatten/operations github.com/go-openapi/analysis/internal/flatten/replace github.com/go-openapi/analysis/internal/flatten/schutils github.com/go-openapi/analysis/internal/flatten/sortref -# github.com/go-openapi/errors v0.20.1 +# github.com/go-openapi/errors v0.20.2 ## explicit; go 1.14 github.com/go-openapi/errors # github.com/go-openapi/jsonpointer v0.19.5 @@ -387,10 +364,10 @@ github.com/go-openapi/jsonpointer # github.com/go-openapi/jsonreference v0.19.6 ## explicit; go 1.13 github.com/go-openapi/jsonreference -# github.com/go-openapi/loads v0.21.0 +# github.com/go-openapi/loads v0.21.1 ## explicit; go 1.13 github.com/go-openapi/loads -# github.com/go-openapi/runtime v0.21.0 +# github.com/go-openapi/runtime v0.23.0 ## explicit; go 1.15 github.com/go-openapi/runtime github.com/go-openapi/runtime/client @@ -404,36 +381,31 @@ github.com/go-openapi/runtime/yamlpc # github.com/go-openapi/spec v0.20.4 ## explicit; go 1.13 github.com/go-openapi/spec -# github.com/go-openapi/strfmt v0.21.1 +# github.com/go-openapi/strfmt v0.21.2 ## explicit; go 1.13 github.com/go-openapi/strfmt -# github.com/go-openapi/swag v0.19.15 +# github.com/go-openapi/swag v0.21.1 ## explicit; go 1.11 github.com/go-openapi/swag # github.com/go-openapi/validate v0.20.3 ## explicit; go 1.14 github.com/go-openapi/validate -# github.com/go-playground/locales v0.13.0 +# github.com/go-playground/locales v0.14.0 ## explicit; go 1.13 github.com/go-playground/locales github.com/go-playground/locales/currency -# github.com/go-playground/universal-translator v0.17.0 +# github.com/go-playground/universal-translator v0.18.0 ## explicit; go 1.13 github.com/go-playground/universal-translator -# github.com/go-stack/stack v1.8.0 -## explicit +# github.com/go-stack/stack v1.8.1 +## explicit; go 1.17 github.com/go-stack/stack # github.com/golang-jwt/jwt v3.2.2+incompatible ## explicit github.com/golang-jwt/jwt -# github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e -## explicit -github.com/golang/groupcache/lru # github.com/golang/protobuf v1.5.2 ## explicit; go 1.9 -github.com/golang/protobuf/internal/gengogrpc github.com/golang/protobuf/proto -github.com/golang/protobuf/protoc-gen-go github.com/golang/protobuf/protoc-gen-go/descriptor github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any @@ -443,15 +415,19 @@ github.com/golang/protobuf/ptypes/timestamp # github.com/golang/snappy v0.0.3 ## explicit github.com/golang/snappy +# github.com/google/go-cmp v0.5.6 +## explicit; go 1.8 +github.com/google/go-cmp/cmp +github.com/google/go-cmp/cmp/internal/diff +github.com/google/go-cmp/cmp/internal/flags +github.com/google/go-cmp/cmp/internal/function +github.com/google/go-cmp/cmp/internal/value # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query # github.com/google/uuid v1.3.0 ## explicit github.com/google/uuid -# github.com/googleapis/gax-go/v2 v2.0.5 -## explicit -github.com/googleapis/gax-go/v2 # github.com/hashicorp/errwrap v1.0.0 ## explicit github.com/hashicorp/errwrap @@ -469,15 +445,11 @@ github.com/hashicorp/go-cty/cty/gocty github.com/hashicorp/go-cty/cty/json github.com/hashicorp/go-cty/cty/msgpack github.com/hashicorp/go-cty/cty/set -# github.com/hashicorp/go-getter v1.5.3 -## explicit; go 1.13 -github.com/hashicorp/go-getter -github.com/hashicorp/go-getter/helper/url -# github.com/hashicorp/go-hclog v0.15.0 +# github.com/hashicorp/go-hclog v0.16.1 ## explicit; go 1.13 github.com/hashicorp/go-hclog -# github.com/hashicorp/go-multierror v1.0.0 -## explicit +# github.com/hashicorp/go-multierror v1.1.1 +## explicit; go 1.13 github.com/hashicorp/go-multierror # github.com/hashicorp/go-plugin v1.4.1 ## explicit; go 1.13 @@ -486,15 +458,28 @@ github.com/hashicorp/go-plugin/internal/plugin # github.com/hashicorp/go-retryablehttp v0.7.0 ## explicit; go 1.13 github.com/hashicorp/go-retryablehttp -# github.com/hashicorp/go-safetemp v1.0.0 -## explicit -github.com/hashicorp/go-safetemp # github.com/hashicorp/go-uuid v1.0.2 ## explicit github.com/hashicorp/go-uuid # github.com/hashicorp/go-version v1.3.0 ## explicit github.com/hashicorp/go-version +# github.com/hashicorp/hc-install v0.3.1 +## explicit; go 1.16 +github.com/hashicorp/hc-install +github.com/hashicorp/hc-install/checkpoint +github.com/hashicorp/hc-install/errors +github.com/hashicorp/hc-install/fs +github.com/hashicorp/hc-install/internal/build +github.com/hashicorp/hc-install/internal/httpclient +github.com/hashicorp/hc-install/internal/pubkey +github.com/hashicorp/hc-install/internal/releasesjson +github.com/hashicorp/hc-install/internal/src +github.com/hashicorp/hc-install/internal/validators +github.com/hashicorp/hc-install/internal/version +github.com/hashicorp/hc-install/product +github.com/hashicorp/hc-install/releases +github.com/hashicorp/hc-install/src # github.com/hashicorp/hcl/v2 v2.8.2 ## explicit; go 1.12 github.com/hashicorp/hcl/v2 @@ -503,29 +488,33 @@ github.com/hashicorp/hcl/v2/hclsyntax # github.com/hashicorp/logutils v1.0.0 ## explicit github.com/hashicorp/logutils -# github.com/hashicorp/terraform-exec v0.14.0 +# github.com/hashicorp/terraform-exec v0.15.0 ## explicit; go 1.14 github.com/hashicorp/terraform-exec/internal/version github.com/hashicorp/terraform-exec/tfexec -github.com/hashicorp/terraform-exec/tfinstall -# github.com/hashicorp/terraform-json v0.12.0 +# github.com/hashicorp/terraform-json v0.13.0 ## explicit; go 1.13 github.com/hashicorp/terraform-json -# github.com/hashicorp/terraform-plugin-go v0.3.0 -## explicit; go 1.15 +# github.com/hashicorp/terraform-plugin-go v0.5.0 +## explicit; go 1.16 github.com/hashicorp/terraform-plugin-go/tfprotov5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto -github.com/hashicorp/terraform-plugin-go/tfprotov5/server +github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server github.com/hashicorp/terraform-plugin-go/tfprotov6 github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6 github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto -github.com/hashicorp/terraform-plugin-go/tfprotov6/server +github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server github.com/hashicorp/terraform-plugin-go/tftypes -# github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 -## explicit; go 1.15 +# github.com/hashicorp/terraform-plugin-log v0.2.0 +## explicit; go 1.16 +github.com/hashicorp/terraform-plugin-log/internal/logging +github.com/hashicorp/terraform-plugin-log/tflog +github.com/hashicorp/terraform-plugin-log/tfsdklog +# github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 +## explicit; go 1.16 github.com/hashicorp/terraform-plugin-sdk/v2/diag github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging @@ -544,6 +533,12 @@ github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfdiags github.com/hashicorp/terraform-plugin-sdk/v2/meta github.com/hashicorp/terraform-plugin-sdk/v2/plugin github.com/hashicorp/terraform-plugin-sdk/v2/terraform +# github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 +## explicit; go 1.14 +github.com/hashicorp/terraform-registry-address +# github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 +## explicit; go 1.12 +github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d ## explicit github.com/hashicorp/yamux @@ -605,11 +600,6 @@ github.com/jmespath/go-jmespath # github.com/josharian/intern v1.0.0 ## explicit; go 1.5 github.com/josharian/intern -# github.com/jstemmer/go-junit-report v0.9.1 -## explicit; go 1.2 -github.com/jstemmer/go-junit-report -github.com/jstemmer/go-junit-report/formatter -github.com/jstemmer/go-junit-report/parser # github.com/klauspost/compress v1.13.6 ## explicit; go 1.15 github.com/klauspost/compress @@ -621,7 +611,7 @@ github.com/klauspost/compress/zstd/internal/xxhash # github.com/leodido/go-urn v1.2.1 ## explicit; go 1.13 github.com/leodido/go-urn -# github.com/mailru/easyjson v0.7.6 +# github.com/mailru/easyjson v0.7.7 ## explicit; go 1.12 github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer @@ -643,13 +633,13 @@ github.com/mitchellh/copystructure # github.com/mitchellh/go-homedir v1.1.0 ## explicit github.com/mitchellh/go-homedir -# github.com/mitchellh/go-testing-interface v1.0.4 -## explicit +# github.com/mitchellh/go-testing-interface v1.14.1 +## explicit; go 1.14 github.com/mitchellh/go-testing-interface # github.com/mitchellh/go-wordwrap v1.0.0 ## explicit github.com/mitchellh/go-wordwrap -# github.com/mitchellh/mapstructure v1.4.1 +# github.com/mitchellh/mapstructure v1.4.3 ## explicit; go 1.14 github.com/mitchellh/mapstructure # github.com/mitchellh/reflectwalk v1.0.2 @@ -699,17 +689,11 @@ github.com/softlayer/softlayer-go/sl # github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e ## explicit github.com/softlayer/xmlrpc -# github.com/ulikunitz/xz v0.5.8 -## explicit; go 1.12 -github.com/ulikunitz/xz -github.com/ulikunitz/xz/internal/hash -github.com/ulikunitz/xz/internal/xlog -github.com/ulikunitz/xz/lzma # github.com/vmihailenco/msgpack v4.0.4+incompatible ## explicit github.com/vmihailenco/msgpack github.com/vmihailenco/msgpack/codes -# github.com/zclconf/go-cty v1.8.4 +# github.com/zclconf/go-cty v1.9.1 ## explicit; go 1.12 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/convert @@ -718,7 +702,7 @@ github.com/zclconf/go-cty/cty/function/stdlib github.com/zclconf/go-cty/cty/gocty github.com/zclconf/go-cty/cty/json github.com/zclconf/go-cty/cty/set -# go.mongodb.org/mongo-driver v1.7.5 +# go.mongodb.org/mongo-driver v1.8.3 ## explicit; go 1.10 go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/bson/bsoncodec @@ -727,24 +711,6 @@ go.mongodb.org/mongo-driver/bson/bsonrw go.mongodb.org/mongo-driver/bson/bsontype go.mongodb.org/mongo-driver/bson/primitive go.mongodb.org/mongo-driver/x/bsonx/bsoncore -# go.opencensus.io v0.22.4 -## explicit; go 1.13 -go.opencensus.io -go.opencensus.io/internal -go.opencensus.io/internal/tagencoding -go.opencensus.io/metric/metricdata -go.opencensus.io/metric/metricproducer -go.opencensus.io/plugin/ochttp -go.opencensus.io/plugin/ochttp/propagation/b3 -go.opencensus.io/resource -go.opencensus.io/stats -go.opencensus.io/stats/internal -go.opencensus.io/stats/view -go.opencensus.io/tag -go.opencensus.io/trace -go.opencensus.io/trace/internal -go.opencensus.io/trace/propagation -go.opencensus.io/trace/tracestate # golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 ## explicit; go 1.17 golang.org/x/crypto/blowfish @@ -766,18 +732,9 @@ golang.org/x/crypto/pbkdf2 golang.org/x/crypto/poly1305 golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/lint v0.0.0-20200302205851-738671d3881b -## explicit; go 1.11 -golang.org/x/lint -golang.org/x/lint/golint -# golang.org/x/mod v0.4.2 -## explicit; go 1.12 -golang.org/x/mod/module -golang.org/x/mod/semver -# golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d +# golang.org/x/net v0.0.0-20220225172249-27dd8689420f ## explicit; go 1.17 golang.org/x/net/context -golang.org/x/net/context/ctxhttp golang.org/x/net/http/httpguts golang.org/x/net/http2 golang.org/x/net/http2/hpack @@ -787,17 +744,9 @@ golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/trace golang.org/x/net/websocket -# golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 -## explicit; go 1.11 -golang.org/x/oauth2 -golang.org/x/oauth2/google -golang.org/x/oauth2/internal -golang.org/x/oauth2/jws -golang.org/x/oauth2/jwt -# golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef +# golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 ## explicit; go 1.17 golang.org/x/sys/cpu -golang.org/x/sys/execabs golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix # golang.org/x/text v0.3.7 @@ -811,41 +760,6 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/width -# golang.org/x/tools v0.1.7 -## explicit; go 1.17 -golang.org/x/tools/cmd/goimports -golang.org/x/tools/go/ast/astutil -golang.org/x/tools/go/gcexportdata -golang.org/x/tools/go/internal/gcimporter -golang.org/x/tools/internal/event -golang.org/x/tools/internal/event/core -golang.org/x/tools/internal/event/keys -golang.org/x/tools/internal/event/label -golang.org/x/tools/internal/fastwalk -golang.org/x/tools/internal/gocommand -golang.org/x/tools/internal/gopathwalk -golang.org/x/tools/internal/imports -golang.org/x/tools/internal/typeparams -# golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 -## explicit; go 1.11 -golang.org/x/xerrors -golang.org/x/xerrors/internal -# google.golang.org/api v0.34.0 -## explicit; go 1.11 -google.golang.org/api/googleapi -google.golang.org/api/googleapi/transport -google.golang.org/api/internal -google.golang.org/api/internal/gensupport -google.golang.org/api/internal/impersonate -google.golang.org/api/internal/third_party/uritemplates -google.golang.org/api/iterator -google.golang.org/api/option -google.golang.org/api/option/internaloption -google.golang.org/api/storage/v1 -google.golang.org/api/transport/cert -google.golang.org/api/transport/http -google.golang.org/api/transport/http/internal/propagation -google.golang.org/api/transport/internal/dca # google.golang.org/appengine v1.6.6 ## explicit; go 1.11 google.golang.org/appengine @@ -859,15 +773,9 @@ google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api -google.golang.org/appengine/internal/urlfetch -google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d ## explicit; go 1.11 -google.golang.org/genproto/googleapis/api/annotations -google.golang.org/genproto/googleapis/iam/v1 -google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/status -google.golang.org/genproto/googleapis/type/expr # google.golang.org/grpc v1.32.0 ## explicit; go 1.11 google.golang.org/grpc @@ -916,8 +824,6 @@ google.golang.org/grpc/status google.golang.org/grpc/tap # google.golang.org/protobuf v1.26.0 ## explicit; go 1.9 -google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo -google.golang.org/protobuf/compiler/protogen google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/internal/descfmt @@ -949,7 +855,6 @@ google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/timestamppb -google.golang.org/protobuf/types/pluginpb # gopkg.in/go-playground/validator.v9 v9.31.0 ## explicit gopkg.in/go-playground/validator.v9